From: Andrea Amorese Date: Thu, 9 Sep 2021 09:49:17 +0000 (+0200) Subject: Built motion from commit d1b4846f.|2.5.35 X-Git-Url: http://repos.xcallymotion.com/base/%22angular-material.themes.css/%22javascript:;/%22card-image.png//%27?a=commitdiff_plain;h=86772a3de04915c26c22785b691cd325c27d25fd;p=motion2.git Built motion from commit d1b4846f.|2.5.35 --- diff --git a/apidoc/api_project.js b/apidoc/api_project.js index 24a53bd..e82ae48 100644 --- a/apidoc/api_project.js +++ b/apidoc/api_project.js @@ -17,7 +17,7 @@ define({ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2021-09-09T09:00:06.205Z", + "time": "2021-09-09T09:42:37.224Z", "url": "http://apidocjs.com", "version": "0.24.0" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index f46dcc2..cd5185f 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2021-09-09T09:00:06.205Z", + "time": "2021-09-09T09:42:37.224Z", "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 1a122af..e557752 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 _0x2581=['integration','motionbar','jscripty','urlForward','browser','bot','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth]','TEXT','urlForward[body]','sequelize','exports','VIRTUAL','getDataValue','STRING','contactManager'];(function(_0x2dbd62,_0x359933){var _0x1518d=function(_0x523267){while(--_0x523267){_0x2dbd62['push'](_0x2dbd62['shift']());}};_0x1518d(++_0x359933);}(_0x2581,0xcb));var _0x1258=function(_0x49729c,_0x4d1167){_0x49729c=_0x49729c-0x0;var _0x3b215a=_0x2581[_0x49729c];return _0x3b215a;};'use strict';var Sequelize=require(_0x1258('0x0'));module[_0x1258('0x1')]={'name':{'type':Sequelize[_0x1258('0x2')],'get':function(_0x348640){return this[_0x1258('0x3')]('action');}},'action':{'type':Sequelize[_0x1258('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x1258('0x5'),_0x1258('0x6'),_0x1258('0x7'),_0x1258('0x8'),_0x1258('0x9'),_0x1258('0xa'),_0x1258('0xb'),'script']],'msg':_0x1258('0xc')}},'comment':_0x1258('0xc')},'data1':{'type':Sequelize[_0x1258('0x4')](0x1000),'comment':_0x1258('0xd')},'data2':{'type':Sequelize[_0x1258('0x4')](0x1000),'comment':_0x1258('0xe')},'data3':{'type':Sequelize[_0x1258('0x4')](0x1000),'comment':'contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]'},'data4':{'type':Sequelize['STRING'](0x1000),'comments':_0x1258('0xf')},'data5':{'type':Sequelize[_0x1258('0x4')](0x1000),'comments':_0x1258('0x10')},'data6':{'type':Sequelize[_0x1258('0x4')],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize[_0x1258('0x11')],'comments':_0x1258('0x12')}}; \ No newline at end of file +var _0x68b3=['contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','sequelize','exports','VIRTUAL','getDataValue','STRING','contactManager','integration','motionbar','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)]'];(function(_0x725cd5,_0x2fd992){var _0x56bb7d=function(_0x52b073){while(--_0x52b073){_0x725cd5['push'](_0x725cd5['shift']());}};_0x56bb7d(++_0x2fd992);}(_0x68b3,0x1d8));var _0x368b=function(_0x3ef736,_0x446c29){_0x3ef736=_0x3ef736-0x0;var _0x27d6aa=_0x68b3[_0x3ef736];return _0x27d6aa;};'use strict';var Sequelize=require(_0x368b('0x0'));module[_0x368b('0x1')]={'name':{'type':Sequelize[_0x368b('0x2')],'get':function(_0xa371c){return this[_0x368b('0x3')]('action');}},'action':{'type':Sequelize[_0x368b('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x368b('0x5'),_0x368b('0x6'),_0x368b('0x7'),'jscripty',_0x368b('0x8'),_0x368b('0x9'),_0x368b('0xa'),_0x368b('0xb')]],'msg':_0x368b('0xc')}},'comment':_0x368b('0xc')},'data1':{'type':Sequelize[_0x368b('0x4')](0x1000),'comment':_0x368b('0xd')},'data2':{'type':Sequelize[_0x368b('0x4')](0x1000),'comment':_0x368b('0xe')},'data3':{'type':Sequelize[_0x368b('0x4')](0x1000),'comment':'contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]'},'data4':{'type':Sequelize[_0x368b('0x4')](0x1000),'comments':_0x368b('0xf')},'data5':{'type':Sequelize[_0x368b('0x4')](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth]'},'data6':{'type':Sequelize[_0x368b('0x4')],'comments':_0x368b('0x10')},'data7':{'type':Sequelize[_0x368b('0x11')],'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 d089f8e..4aa4b09 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 _0x60f0=['Action','eml-format','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/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','reject','update','then','destroy','error','name','send','body','find','params','catch'];(function(_0x1fa98d,_0x3ba2b2){var _0x26f5d8=function(_0x1d2030){while(--_0x1d2030){_0x1fa98d['push'](_0x1fa98d['shift']());}};_0x26f5d8(++_0x3ba2b2);}(_0x60f0,0xec));var _0x060f=function(_0x261f69,_0x7e0602){_0x261f69=_0x261f69-0x0;var _0x5bdbb6=_0x60f0[_0x261f69];return _0x5bdbb6;};'use strict';var emlformat=require(_0x060f('0x0'));var rimraf=require(_0x060f('0x1'));var zipdir=require(_0x060f('0x2'));var jsonpatch=require(_0x060f('0x3'));var rp=require(_0x060f('0x4'));var moment=require(_0x060f('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x060f('0x6'));var util=require(_0x060f('0x7'));var path=require(_0x060f('0x8'));var sox=require(_0x060f('0x9'));var csv=require(_0x060f('0xa'));var ejs=require(_0x060f('0xb'));var fs=require('fs');var fs_extra=require(_0x060f('0xc'));var _=require(_0x060f('0xd'));var squel=require(_0x060f('0xe'));var crypto=require(_0x060f('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x060f('0x10'));var toCsv=require(_0x060f('0xa'));var querystring=require(_0x060f('0x11'));var Papa=require(_0x060f('0x12'));var Redis=require(_0x060f('0x13'));var authService=require(_0x060f('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x060f('0x15'));var hardwareService=require(_0x060f('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0x060f('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x060f('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1f2e15,_0x49b3ac){_0x49b3ac=_0x49b3ac||0xcc;return function(_0x1199b9){if(_0x1199b9){return _0x1f2e15[_0x060f('0x19')](_0x49b3ac);}return _0x1f2e15[_0x060f('0x1a')](_0x49b3ac)[_0x060f('0x1b')]();};}function respondWithResult(_0xff6d8,_0x126e5d){_0x126e5d=_0x126e5d||0xc8;return function(_0x2e2851){if(_0x2e2851){return _0xff6d8['status'](_0x126e5d)[_0x060f('0x1c')](_0x2e2851);}};}function respondWithFilteredResult(_0x4a349d,_0x31cd2d){return function(_0x6e98ef){if(_0x6e98ef){var _0x473e76=typeof _0x31cd2d['offset']===_0x060f('0x1d')&&typeof _0x31cd2d[_0x060f('0x1e')]===_0x060f('0x1d');var _0x4d25fa=_0x6e98ef[_0x060f('0x1f')];var _0x485aaf=_0x473e76?0x0:_0x31cd2d[_0x060f('0x20')];var _0x164028=_0x473e76?_0x6e98ef[_0x060f('0x1f')]:_0x31cd2d['offset']+_0x31cd2d['limit'];var _0x26e895;if(_0x164028>=_0x4d25fa){_0x164028=_0x4d25fa;_0x26e895=0xc8;}else{_0x26e895=0xce;}_0x4a349d[_0x060f('0x1a')](_0x26e895);return _0x4a349d[_0x060f('0x21')](_0x060f('0x22'),_0x485aaf+'-'+_0x164028+'/'+_0x4d25fa)['json'](_0x6e98ef);}return null;};}function patchUpdates(_0x1f7bb6){return function(_0x52c397){try{jsonpatch['apply'](_0x52c397,_0x1f7bb6,!![]);}catch(_0x1b9ef0){return BPromise[_0x060f('0x23')](_0x1b9ef0);}return _0x52c397['save']();};}function saveUpdates(_0x4e783b,_0x5d3f78){return function(_0x23baf4){if(_0x23baf4){return _0x23baf4[_0x060f('0x24')](_0x4e783b)[_0x060f('0x25')](function(_0x3be490){return _0x3be490;});}return null;};}function removeEntity(_0x93a692,_0x183f3c){return function(_0x43bede){if(_0x43bede){return _0x43bede[_0x060f('0x26')]()[_0x060f('0x25')](function(){_0x93a692['status'](0xcc)[_0x060f('0x1b')]();});}};}function handleEntityNotFound(_0x1fded6,_0x86fd14){return function(_0x18f91f){if(!_0x18f91f){_0x1fded6[_0x060f('0x19')](0x194);}return _0x18f91f;};}function handleError(_0x58c5b8,_0x1d9e9b){_0x1d9e9b=_0x1d9e9b||0x1f4;return function(_0x53c9b3){logger[_0x060f('0x27')](_0x53c9b3['stack']);if(_0x53c9b3['name']){delete _0x53c9b3[_0x060f('0x28')];}_0x58c5b8[_0x060f('0x1a')](_0x1d9e9b)[_0x060f('0x29')](_0x53c9b3);};}exports[_0x060f('0x24')]=function(_0x377320,_0x426f74){if(_0x377320[_0x060f('0x2a')]['id']){delete _0x377320[_0x060f('0x2a')]['id'];}return db['Action'][_0x060f('0x2b')]({'where':{'id':_0x377320[_0x060f('0x2c')]['id']}})['then'](handleEntityNotFound(_0x426f74,null))[_0x060f('0x25')](saveUpdates(_0x377320[_0x060f('0x2a')],null))[_0x060f('0x25')](respondWithResult(_0x426f74,null))[_0x060f('0x2d')](handleError(_0x426f74,null));};exports[_0x060f('0x26')]=function(_0x2b2c42,_0x1ccadd){return db[_0x060f('0x2e')][_0x060f('0x2b')]({'where':{'id':_0x2b2c42[_0x060f('0x2c')]['id']}})['then'](handleEntityNotFound(_0x1ccadd,null))[_0x060f('0x25')](removeEntity(_0x1ccadd,null))['catch'](handleError(_0x1ccadd,null));}; \ No newline at end of file +var _0x852c=['status','end','json','undefined','limit','count','offset','Content-Range','reject','save','update','then','error','stack','name','body','Action','find','catch','destroy','params','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus'];(function(_0x324835,_0x5a424c){var _0x5cd699=function(_0x3e343a){while(--_0x3e343a){_0x324835['push'](_0x324835['shift']());}};_0x5cd699(++_0x5a424c);}(_0x852c,0x100));var _0xc852=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x852c[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xc852('0x0'));var rimraf=require(_0xc852('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc852('0x2'));var rp=require(_0xc852('0x3'));var moment=require(_0xc852('0x4'));var BPromise=require(_0xc852('0x5'));var Mustache=require(_0xc852('0x6'));var util=require(_0xc852('0x7'));var path=require(_0xc852('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xc852('0x9'));var fs=require('fs');var fs_extra=require(_0xc852('0xa'));var _=require(_0xc852('0xb'));var squel=require(_0xc852('0xc'));var crypto=require(_0xc852('0xd'));var jsforce=require(_0xc852('0xe'));var deskjs=require(_0xc852('0xf'));var toCsv=require(_0xc852('0x10'));var querystring=require(_0xc852('0x11'));var Papa=require('papaparse');var Redis=require(_0xc852('0x12'));var authService=require(_0xc852('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xc852('0x14'));var hardwareService=require(_0xc852('0x15'));var logger=require('../../config/logger')(_0xc852('0x16'));var utils=require(_0xc852('0x17'));var config=require(_0xc852('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1362a3,_0x49a65c){_0x49a65c=_0x49a65c||0xcc;return function(_0x4692c0){if(_0x4692c0){return _0x1362a3[_0xc852('0x19')](_0x49a65c);}return _0x1362a3[_0xc852('0x1a')](_0x49a65c)[_0xc852('0x1b')]();};}function respondWithResult(_0x620d72,_0x158f63){_0x158f63=_0x158f63||0xc8;return function(_0xf28b34){if(_0xf28b34){return _0x620d72['status'](_0x158f63)[_0xc852('0x1c')](_0xf28b34);}};}function respondWithFilteredResult(_0xdccf7b,_0x1ef235){return function(_0x1102f5){if(_0x1102f5){var _0x546c5f=typeof _0x1ef235['offset']===_0xc852('0x1d')&&typeof _0x1ef235[_0xc852('0x1e')]==='undefined';var _0x554b59=_0x1102f5[_0xc852('0x1f')];var _0x3318b2=_0x546c5f?0x0:_0x1ef235[_0xc852('0x20')];var _0xc0b68a=_0x546c5f?_0x1102f5['count']:_0x1ef235[_0xc852('0x20')]+_0x1ef235[_0xc852('0x1e')];var _0xaecf08;if(_0xc0b68a>=_0x554b59){_0xc0b68a=_0x554b59;_0xaecf08=0xc8;}else{_0xaecf08=0xce;}_0xdccf7b[_0xc852('0x1a')](_0xaecf08);return _0xdccf7b['set'](_0xc852('0x21'),_0x3318b2+'-'+_0xc0b68a+'/'+_0x554b59)['json'](_0x1102f5);}return null;};}function patchUpdates(_0x1b36d8){return function(_0x27eb1b){try{jsonpatch['apply'](_0x27eb1b,_0x1b36d8,!![]);}catch(_0xf78198){return BPromise[_0xc852('0x22')](_0xf78198);}return _0x27eb1b[_0xc852('0x23')]();};}function saveUpdates(_0x4e8934,_0x4d65ad){return function(_0x3ca06b){if(_0x3ca06b){return _0x3ca06b[_0xc852('0x24')](_0x4e8934)[_0xc852('0x25')](function(_0x5bdc72){return _0x5bdc72;});}return null;};}function removeEntity(_0xb9b243,_0x4d9814){return function(_0x58882a){if(_0x58882a){return _0x58882a['destroy']()['then'](function(){_0xb9b243['status'](0xcc)[_0xc852('0x1b')]();});}};}function handleEntityNotFound(_0x1192a0,_0x4266c5){return function(_0x1378bd){if(!_0x1378bd){_0x1192a0[_0xc852('0x19')](0x194);}return _0x1378bd;};}function handleError(_0x3bb3e4,_0x5d6da1){_0x5d6da1=_0x5d6da1||0x1f4;return function(_0x1ce663){logger[_0xc852('0x26')](_0x1ce663[_0xc852('0x27')]);if(_0x1ce663['name']){delete _0x1ce663[_0xc852('0x28')];}_0x3bb3e4[_0xc852('0x1a')](_0x5d6da1)['send'](_0x1ce663);};}exports['update']=function(_0x23af0f,_0x362b7d){if(_0x23af0f['body']['id']){delete _0x23af0f[_0xc852('0x29')]['id'];}return db[_0xc852('0x2a')][_0xc852('0x2b')]({'where':{'id':_0x23af0f['params']['id']}})[_0xc852('0x25')](handleEntityNotFound(_0x362b7d,null))[_0xc852('0x25')](saveUpdates(_0x23af0f[_0xc852('0x29')],null))[_0xc852('0x25')](respondWithResult(_0x362b7d,null))[_0xc852('0x2c')](handleError(_0x362b7d,null));};exports[_0xc852('0x2d')]=function(_0x3dde01,_0xabeddb){return db[_0xc852('0x2a')]['find']({'where':{'id':_0x3dde01[_0xc852('0x2e')]['id']}})[_0xc852('0x25')](handleEntityNotFound(_0xabeddb,null))[_0xc852('0x25')](removeEntity(_0xabeddb,null))[_0xc852('0x2c')](handleError(_0xabeddb,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index 20ec6dd..e7e3a86 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 _0x5b52=['./action.attributes','define','Action','tools_actions','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x7b590b,_0x3db80b){var _0x326f58=function(_0x39dbe5){while(--_0x39dbe5){_0x7b590b['push'](_0x7b590b['shift']());}};_0x326f58(++_0x3db80b);}(_0x5b52,0xad));var _0x25b5=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x5b52[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x25b5('0x0'));var util=require(_0x25b5('0x1'));var logger=require('../../config/logger')(_0x25b5('0x2'));var moment=require(_0x25b5('0x3'));var BPromise=require(_0x25b5('0x4'));var rp=require(_0x25b5('0x5'));var fs=require('fs');var path=require(_0x25b5('0x6'));var rimraf=require(_0x25b5('0x7'));var config=require(_0x25b5('0x8'));var attributes=require(_0x25b5('0x9'));module['exports']=function(_0x22a115,_0x547856){return _0x22a115[_0x25b5('0xa')](_0x25b5('0xb'),attributes,{'tableName':_0x25b5('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc50b=['./action.attributes','exports','define','tools_actions','../../config/logger','api','moment','rimraf','../../config/environment'];(function(_0x119d5a,_0x19b457){var _0x15bff4=function(_0x1b7c78){while(--_0x1b7c78){_0x119d5a['push'](_0x119d5a['shift']());}};_0x15bff4(++_0x19b457);}(_0xc50b,0x151));var _0xbc50=function(_0x52121d,_0x1d1704){_0x52121d=_0x52121d-0x0;var _0x448627=_0xc50b[_0x52121d];return _0x448627;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xbc50('0x0'))(_0xbc50('0x1'));var moment=require(_0xbc50('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xbc50('0x3'));var config=require(_0xbc50('0x4'));var attributes=require(_0xbc50('0x5'));module[_0xbc50('0x6')]=function(_0x5dfcb9,_0x11913f){return _0x5dfcb9[_0xbc50('0x7')]('Action',attributes,{'tableName':_0xbc50('0x8'),'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 a3c42ea..0987a04 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 _0xabce=['util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','client','then','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash'];(function(_0x684225,_0x516e52){var _0x2060f7=function(_0x21fb0d){while(--_0x21fb0d){_0x684225['push'](_0x684225['shift']());}};_0x2060f7(++_0x516e52);}(_0xabce,0x103));var _0xeabc=function(_0x15bc81,_0x4d4f77){_0x15bc81=_0x15bc81-0x0;var _0x59440e=_0xabce[_0x15bc81];return _0x59440e;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var moment=require(_0xeabc('0x2'));var BPromise=require(_0xeabc('0x3'));var rs=require(_0xeabc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xeabc('0x5'));var logger=require(_0xeabc('0x6'))(_0xeabc('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xeabc('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x229ba4,_0x52ede8,_0x3bdc29){return new BPromise(function(_0x9417af,_0x8434c5){return client['request'](_0x229ba4,_0x3bdc29)[_0xeabc('0x9')](function(_0x341f16){logger[_0xeabc('0xa')](_0xeabc('0xb'),_0x52ede8,_0xeabc('0xc'));logger[_0xeabc('0xd')](_0xeabc('0xe'),_0x52ede8,_0xeabc('0xc'),JSON[_0xeabc('0xf')](_0x341f16));if(_0x341f16[_0xeabc('0x10')]){if(_0x341f16[_0xeabc('0x10')][_0xeabc('0x11')]===0x1f4){logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);return _0x8434c5(_0x341f16['error'][_0xeabc('0x12')]);}logger[_0xeabc('0x10')](_0xeabc('0xb'),_0x52ede8,_0x341f16['error']['message']);return _0x9417af(_0x341f16[_0xeabc('0x10')][_0xeabc('0x12')]);}else{logger[_0xeabc('0xa')]('Action,\x20%s,\x20%s',_0x52ede8,_0xeabc('0xc'));_0x9417af(_0x341f16[_0xeabc('0x13')]['message']);}})['catch'](function(_0x10fa8e){logger['error'](_0xeabc('0xb'),_0x52ede8,_0x10fa8e);_0x8434c5(_0x10fa8e);});});} \ No newline at end of file +var _0xf494=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','Action,\x20%s,\x20%s','request\x20sent','Action,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x15b380,_0x1a3c5f){var _0x232c5c=function(_0x12f8e0){while(--_0x12f8e0){_0x15b380['push'](_0x15b380['shift']());}};_0x232c5c(++_0x1a3c5f);}(_0xf494,0x1c6));var _0x4f49=function(_0xfc5df5,_0x5935dc){_0xfc5df5=_0xfc5df5-0x0;var _0x3a9b2c=_0xf494[_0xfc5df5];return _0x3a9b2c;};'use strict';var _=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var moment=require(_0x4f49('0x2'));var BPromise=require('bluebird');var rs=require(_0x4f49('0x3'));var fs=require('fs');var Redis=require(_0x4f49('0x4'));var db=require(_0x4f49('0x5'))['db'];var utils=require(_0x4f49('0x6'));var logger=require(_0x4f49('0x7'))(_0x4f49('0x8'));var config=require(_0x4f49('0x9'));var jayson=require(_0x4f49('0xa'));var client=jayson[_0x4f49('0xb')][_0x4f49('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x42b0e8,_0x5eb186,_0x58e9a0){return new BPromise(function(_0x169c95,_0x327bd5){return client[_0x4f49('0xd')](_0x42b0e8,_0x58e9a0)[_0x4f49('0xe')](function(_0x185174){logger[_0x4f49('0xf')](_0x4f49('0x10'),_0x5eb186,_0x4f49('0x11'));logger['debug'](_0x4f49('0x12'),_0x5eb186,_0x4f49('0x11'),JSON['stringify'](_0x185174));if(_0x185174[_0x4f49('0x13')]){if(_0x185174['error']['code']===0x1f4){logger[_0x4f49('0x13')](_0x4f49('0x10'),_0x5eb186,_0x185174['error'][_0x4f49('0x14')]);return _0x327bd5(_0x185174[_0x4f49('0x13')][_0x4f49('0x14')]);}logger[_0x4f49('0x13')](_0x4f49('0x10'),_0x5eb186,_0x185174[_0x4f49('0x13')][_0x4f49('0x14')]);return _0x169c95(_0x185174['error'][_0x4f49('0x14')]);}else{logger[_0x4f49('0xf')](_0x4f49('0x10'),_0x5eb186,'request\x20sent');_0x169c95(_0x185174['result'][_0x4f49('0x14')]);}})[_0x4f49('0x15')](function(_0x74886e){logger['error'](_0x4f49('0x10'),_0x5eb186,_0x74886e);_0x327bd5(_0x74886e);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index 47eaa65..5e0c07c 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 _0x4d86=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put','isAuthenticated','update','delete','destroy','exports','util'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x4d86,0x19f));var _0x64d8=function(_0x313e67,_0x39dce7){_0x313e67=_0x313e67-0x0;var _0x49a3da=_0x4d86[_0x313e67];return _0x49a3da;};'use strict';var multer=require('multer');var util=require(_0x64d8('0x0'));var path=require(_0x64d8('0x1'));var timeout=require(_0x64d8('0x2'));var express=require(_0x64d8('0x3'));var router=express[_0x64d8('0x4')]();var fs_extra=require(_0x64d8('0x5'));var auth=require(_0x64d8('0x6'));var interaction=require(_0x64d8('0x7'));var config=require(_0x64d8('0x8'));var controller=require(_0x64d8('0x9'));router[_0x64d8('0xa')]('/:id',auth[_0x64d8('0xb')](),controller[_0x64d8('0xc')]);router[_0x64d8('0xd')]('/:id',auth[_0x64d8('0xb')](),controller[_0x64d8('0xe')]);module[_0x64d8('0xf')]=router; \ No newline at end of file +var _0xd85a=['update','destroy','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./action.controller','put','/:id','isAuthenticated'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0xd85a,0x1a6));var _0xad85=function(_0x4606d8,_0x3a3702){_0x4606d8=_0x4606d8-0x0;var _0x5e85cf=_0xd85a[_0x4606d8];return _0x5e85cf;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xad85('0x0'));var timeout=require(_0xad85('0x1'));var express=require(_0xad85('0x2'));var router=express['Router']();var fs_extra=require(_0xad85('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0xad85('0x4'));var config=require(_0xad85('0x5'));var controller=require(_0xad85('0x6'));router[_0xad85('0x7')](_0xad85('0x8'),auth[_0xad85('0x9')](),controller[_0xad85('0xa')]);router['delete'](_0xad85('0x8'),auth[_0xad85('0x9')](),controller[_0xad85('0xb')]);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 5095202..1cb870c 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 _0x5fab=['exports','STRING','TEXT','sequelize'];(function(_0x21331a,_0x57fc48){var _0x325c55=function(_0x770dfa){while(--_0x770dfa){_0x21331a['push'](_0x21331a['shift']());}};_0x325c55(++_0x57fc48);}(_0x5fab,0x177));var _0xb5fa=function(_0x3e4006,_0x6690ec){_0x3e4006=_0x3e4006-0x0;var _0x2553c2=_0x5fab[_0x3e4006];return _0x2553c2;};'use strict';var Sequelize=require(_0xb5fa('0x0'));module[_0xb5fa('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xb5fa('0x2')]},'parent':{'type':Sequelize[_0xb5fa('0x2')]},'table':{'type':Sequelize[_0xb5fa('0x2')]},'conditions':{'type':Sequelize[_0xb5fa('0x3')]},'joins':{'type':Sequelize[_0xb5fa('0x3')]}}; \ No newline at end of file +var _0xfdbd=['sequelize','exports','STRING','TEXT'];(function(_0x1fc4e2,_0x493c3b){var _0x2ba184=function(_0x58e64f){while(--_0x58e64f){_0x1fc4e2['push'](_0x1fc4e2['shift']());}};_0x2ba184(++_0x493c3b);}(_0xfdbd,0xf0));var _0xdfdb=function(_0x55e839,_0x3b5345){_0x55e839=_0x55e839-0x0;var _0x39c61a=_0xfdbd[_0x55e839];return _0x39c61a;};'use strict';var Sequelize=require(_0xdfdb('0x0'));module[_0xdfdb('0x1')]={'name':{'type':Sequelize[_0xdfdb('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xdfdb('0x2')]},'parent':{'type':Sequelize[_0xdfdb('0x2')]},'table':{'type':Sequelize[_0xdfdb('0x2')]},'conditions':{'type':Sequelize[_0xdfdb('0x3')]},'joins':{'type':Sequelize[_0xdfdb('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index 3b65825..045a244 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 _0xe864=['update','then','CustomReports','UserProfileResource','destroy','error','stack','name','index','map','AnalyticCustomReport','rawAttributes','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','filter','where','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','keys','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','join','left_join','right_join','cross_join','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)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','operator','field','getFields','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','MetricId','function','format','replace','groupBy','group','orderBy','DESC','alias','joins','parse','includes','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','table','foreignKey','conditions','debug','toString','sequelize','QueryTypes','SELECT','HOUR(%s)','condition','value','ValidationErrorItem','metric','output','web','randomstring','csv','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','startDate','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','run','runReport','SUM(%s)','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20EMPTY','clone','Limited\x20Query:','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','dbH','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe864,0x1c1));var _0x4e86=function(_0x44d699,_0x190895){_0x44d699=_0x44d699-0x0;var _0x3ae5dd=_0xe864[_0x44d699];return _0x3ae5dd;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4e86('0x0'));var zipdir=require(_0x4e86('0x1'));var jsonpatch=require(_0x4e86('0x2'));var rp=require('request-promise');var moment=require(_0x4e86('0x3'));var BPromise=require(_0x4e86('0x4'));var Mustache=require(_0x4e86('0x5'));var util=require('util');var path=require('path');var sox=require(_0x4e86('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4e86('0x7'));var _=require(_0x4e86('0x8'));var squel=require('squel');var crypto=require(_0x4e86('0x9'));var jsforce=require(_0x4e86('0xa'));var deskjs=require(_0x4e86('0xb'));var toCsv=require(_0x4e86('0xc'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4e86('0xd'));var authService=require(_0x4e86('0xe'));var qs=require(_0x4e86('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x4e86('0x10'))(_0x4e86('0x11'));var utils=require(_0x4e86('0x12'));var config=require(_0x4e86('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x4e86('0x14'))['db'];var dbH=require(_0x4e86('0x14'))[_0x4e86('0x15')];function respondWithStatusCode(_0x3f6d7f,_0x2d3de1){_0x2d3de1=_0x2d3de1||0xcc;return function(_0x1dd24c){if(_0x1dd24c){return _0x3f6d7f[_0x4e86('0x16')](_0x2d3de1);}return _0x3f6d7f['status'](_0x2d3de1)['end']();};}function respondWithResult(_0x3ff696,_0xaa128d){_0xaa128d=_0xaa128d||0xc8;return function(_0x3d1548){if(_0x3d1548){return _0x3ff696[_0x4e86('0x17')](_0xaa128d)[_0x4e86('0x18')](_0x3d1548);}};}function respondWithFilteredResult(_0x1a5858,_0x4aada6){return function(_0x145cbb){if(_0x145cbb){var _0x4b947=typeof _0x4aada6[_0x4e86('0x19')]===_0x4e86('0x1a')&&typeof _0x4aada6[_0x4e86('0x1b')]==='undefined';var _0x51b5fb=_0x145cbb[_0x4e86('0x1c')];var _0x51a6ae=_0x4b947?0x0:_0x4aada6[_0x4e86('0x19')];var _0x10f8a8=_0x4b947?_0x145cbb['count']:_0x4aada6[_0x4e86('0x19')]+_0x4aada6[_0x4e86('0x1b')];var _0x3d6659;if(_0x10f8a8>=_0x51b5fb){_0x10f8a8=_0x51b5fb;_0x3d6659=0xc8;}else{_0x3d6659=0xce;}_0x1a5858[_0x4e86('0x17')](_0x3d6659);return _0x1a5858[_0x4e86('0x1d')](_0x4e86('0x1e'),_0x51a6ae+'-'+_0x10f8a8+'/'+_0x51b5fb)[_0x4e86('0x18')](_0x145cbb);}return null;};}function patchUpdates(_0x559174){return function(_0x1490e4){try{jsonpatch[_0x4e86('0x1f')](_0x1490e4,_0x559174,!![]);}catch(_0x20c938){return BPromise[_0x4e86('0x20')](_0x20c938);}return _0x1490e4[_0x4e86('0x21')]();};}function saveUpdates(_0x226649,_0x3f67d9){return function(_0x3ad169){if(_0x3ad169){return _0x3ad169[_0x4e86('0x22')](_0x226649)[_0x4e86('0x23')](function(_0x539a9b){return _0x539a9b;});}return null;};}function removeEntity(_0x23ca45,_0x40d567){return function(_0x1209f3){if(_0x1209f3){return _0x1209f3['destroy']()[_0x4e86('0x23')](function(){var _0x54e870=_0x1209f3['get']({'plain':!![]});var _0x440193=_0x4e86('0x24');return db[_0x4e86('0x25')][_0x4e86('0x26')]({'where':{'type':_0x440193,'resourceId':_0x54e870['id']}})[_0x4e86('0x23')](function(){return _0x1209f3;});})[_0x4e86('0x23')](function(){_0x23ca45['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c34e7,_0x4878ef){return function(_0x4cc304){if(!_0x4cc304){_0x2c34e7[_0x4e86('0x16')](0x194);}return _0x4cc304;};}function handleError(_0x935de9,_0x3b9d3e){_0x3b9d3e=_0x3b9d3e||0x1f4;return function(_0x175122){logger[_0x4e86('0x27')](_0x175122[_0x4e86('0x28')]);if(_0x175122['name']){delete _0x175122[_0x4e86('0x29')];}_0x935de9['status'](_0x3b9d3e)['send'](_0x175122);};}exports[_0x4e86('0x2a')]=function(_0x2ed9e,_0x4cd3a1){var _0x6d7fa2={},_0x3b0f74={},_0x4754b9={'count':0x0,'rows':[]};var _0x2af6fd=_[_0x4e86('0x2b')](db[_0x4e86('0x2c')][_0x4e86('0x2d')],function(_0x31367d){return{'name':_0x31367d['fieldName'],'type':_0x31367d['type'][_0x4e86('0x2e')]};});_0x3b0f74[_0x4e86('0x2f')]=_['map'](_0x2af6fd,_0x4e86('0x29'));_0x3b0f74[_0x4e86('0x30')]=_['keys'](_0x2ed9e[_0x4e86('0x30')]);_0x3b0f74[_0x4e86('0x31')]=_[_0x4e86('0x32')](_0x3b0f74['model'],_0x3b0f74[_0x4e86('0x30')]);_0x6d7fa2[_0x4e86('0x33')]=_[_0x4e86('0x32')](_0x3b0f74[_0x4e86('0x2f')],qs[_0x4e86('0x34')](_0x2ed9e[_0x4e86('0x30')][_0x4e86('0x34')]));_0x6d7fa2[_0x4e86('0x33')]=_0x6d7fa2[_0x4e86('0x33')][_0x4e86('0x35')]?_0x6d7fa2[_0x4e86('0x33')]:_0x3b0f74[_0x4e86('0x2f')];if(!_0x2ed9e[_0x4e86('0x30')][_0x4e86('0x36')]('nolimit')){_0x6d7fa2[_0x4e86('0x1b')]=qs['limit'](_0x2ed9e[_0x4e86('0x30')][_0x4e86('0x1b')]);_0x6d7fa2[_0x4e86('0x19')]=qs[_0x4e86('0x19')](_0x2ed9e[_0x4e86('0x30')][_0x4e86('0x19')]);}_0x6d7fa2[_0x4e86('0x37')]=qs[_0x4e86('0x38')](_0x2ed9e['query']['sort']);_0x6d7fa2['where']=qs[_0x4e86('0x31')](_['pick'](_0x2ed9e[_0x4e86('0x30')],_0x3b0f74['filters']),_0x2af6fd);if(_0x2ed9e[_0x4e86('0x30')][_0x4e86('0x39')]){_0x6d7fa2[_0x4e86('0x3a')]=_['merge'](_0x6d7fa2[_0x4e86('0x3a')],{'$or':_[_0x4e86('0x2b')](_0x2af6fd,function(_0x29b4b5){if(_0x29b4b5[_0x4e86('0x3b')]!==_0x4e86('0x3c')){var _0x469a2c={};_0x469a2c[_0x29b4b5[_0x4e86('0x29')]]={'$like':'%'+_0x2ed9e[_0x4e86('0x30')][_0x4e86('0x39')]+'%'};return _0x469a2c;}})});}_0x6d7fa2=_[_0x4e86('0x3d')]({},_0x6d7fa2,_0x2ed9e[_0x4e86('0x3e')]);var _0x19a868={'where':_0x6d7fa2[_0x4e86('0x3a')]};return db[_0x4e86('0x2c')]['count'](_0x19a868)['then'](function(_0x1e73b5){_0x4754b9[_0x4e86('0x1c')]=_0x1e73b5;if(_0x2ed9e['query'][_0x4e86('0x3f')]){_0x6d7fa2[_0x4e86('0x40')]=[{'all':!![]}];}return db[_0x4e86('0x2c')][_0x4e86('0x41')](_0x6d7fa2);})[_0x4e86('0x23')](function(_0x5b6e85){_0x4754b9[_0x4e86('0x42')]=_0x5b6e85;return _0x4754b9;})['then'](respondWithFilteredResult(_0x4cd3a1,_0x6d7fa2))[_0x4e86('0x43')](handleError(_0x4cd3a1,null));};exports[_0x4e86('0x44')]=function(_0x40edfd,_0x277eb1){var _0x73c48b={'raw':![],'where':{'id':_0x40edfd['params']['id']}},_0x444721={};_0x444721[_0x4e86('0x2f')]=_[_0x4e86('0x45')](db[_0x4e86('0x2c')][_0x4e86('0x2d')]);_0x444721[_0x4e86('0x30')]=_[_0x4e86('0x45')](_0x40edfd[_0x4e86('0x30')]);_0x444721[_0x4e86('0x31')]=_[_0x4e86('0x32')](_0x444721[_0x4e86('0x2f')],_0x444721[_0x4e86('0x30')]);_0x73c48b[_0x4e86('0x33')]=_[_0x4e86('0x32')](_0x444721[_0x4e86('0x2f')],qs[_0x4e86('0x34')](_0x40edfd[_0x4e86('0x30')]['fields']));_0x73c48b[_0x4e86('0x33')]=_0x73c48b[_0x4e86('0x33')][_0x4e86('0x35')]?_0x73c48b[_0x4e86('0x33')]:_0x444721[_0x4e86('0x2f')];if(_0x40edfd[_0x4e86('0x30')]['includeAll']){_0x73c48b['include']=[{'all':!![]}];}_0x73c48b=_[_0x4e86('0x3d')]({},_0x73c48b,_0x40edfd[_0x4e86('0x3e')]);return db[_0x4e86('0x2c')][_0x4e86('0x46')](_0x73c48b)[_0x4e86('0x23')](handleEntityNotFound(_0x277eb1,null))[_0x4e86('0x23')](respondWithResult(_0x277eb1,null))[_0x4e86('0x43')](handleError(_0x277eb1,null));};exports[_0x4e86('0x47')]=function(_0x483c50,_0x52bc54){return db[_0x4e86('0x2c')][_0x4e86('0x47')](_0x483c50[_0x4e86('0x48')],{})['then'](function(_0x5dcdec){var _0x28898e=_0x483c50[_0x4e86('0x49')][_0x4e86('0x4a')]({'plain':!![]});if(!_0x28898e)throw new Error(_0x4e86('0x4b'));if(_0x28898e['role']===_0x4e86('0x49')){var _0x3a3701=_0x5dcdec['get']({'plain':!![]});var _0x1836e8=_0x4e86('0x4c');return db[_0x4e86('0x4d')][_0x4e86('0x46')]({'where':{'name':_0x1836e8,'userProfileId':_0x28898e[_0x4e86('0x4e')]},'raw':!![]})[_0x4e86('0x23')](function(_0x5da835){if(_0x5da835&&_0x5da835[_0x4e86('0x4f')]===0x0){return db['UserProfileResource'][_0x4e86('0x47')]({'name':_0x3a3701[_0x4e86('0x29')],'resourceId':_0x3a3701['id'],'type':'CustomReports','sectionId':_0x5da835['id']},{})[_0x4e86('0x23')](function(){return _0x5dcdec;});}else{return _0x5dcdec;}})['catch'](function(_0x51d62c){logger[_0x4e86('0x27')](_0x4e86('0x50'),_0x51d62c);throw _0x51d62c;});}return _0x5dcdec;})[_0x4e86('0x23')](respondWithResult(_0x52bc54,0xc9))['catch'](handleError(_0x52bc54,null));};exports[_0x4e86('0x22')]=function(_0x298739,_0x2ed488){if(_0x298739[_0x4e86('0x48')]['id']){delete _0x298739['body']['id'];}return db['AnalyticCustomReport'][_0x4e86('0x46')]({'where':{'id':_0x298739['params']['id']}})[_0x4e86('0x23')](handleEntityNotFound(_0x2ed488,null))[_0x4e86('0x23')](saveUpdates(_0x298739[_0x4e86('0x48')],null))['then'](respondWithResult(_0x2ed488,null))[_0x4e86('0x43')](handleError(_0x2ed488,null));};exports[_0x4e86('0x26')]=function(_0x495067,_0x210494){return db[_0x4e86('0x2c')][_0x4e86('0x46')]({'where':{'id':_0x495067[_0x4e86('0x51')]['id']}})['then'](handleEntityNotFound(_0x210494,null))[_0x4e86('0x23')](removeEntity(_0x210494,null))[_0x4e86('0x43')](handleError(_0x210494,null));};exports['preview']=function(_0x5afa06,_0x1177c2){var _0x384ef3=0xa;var _0x1190b8=[_0x4e86('0x52'),_0x4e86('0x53'),_0x4e86('0x54'),_0x4e86('0x55')];var _0x4cb0cf={'SUM':'SUM(%s)','COUNT':_0x4e86('0x56'),'COUNT DISTINCT':_0x4e86('0x57'),'MAX':_0x4e86('0x58'),'MIN':_0x4e86('0x59'),'AVG':_0x4e86('0x5a'),'GROUP_CONCAT':_0x4e86('0x5b'),'GROUP_CONCAT ASC':_0x4e86('0x5c'),'GROUP_CONCAT DESC':_0x4e86('0x5d')};var _0xfe6feb={'SEC_TO_TIME':_0x4e86('0x5e'),'DATE':_0x4e86('0x5f'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x26baf4=function(_0x4810fd){return!_['includes']([_0x4e86('0x60'),_0x4e86('0x61'),_0x4e86('0x62'),'IS\x20NOT\x20EMPTY'],_0x4810fd);};var _0x2214db=function(_0x2b858f){if(!_0x2b858f||!_0x2b858f[_0x4e86('0x63')][_0x4e86('0x35')]){return'';}for(var _0x1444f2='(',_0x3f7966=0x0;_0x3f7966<_0x2b858f[_0x4e86('0x63')][_0x4e86('0x35')];_0x3f7966+=0x1){_0x3f7966>0x0&&(_0x1444f2+='\x20'+_0x2b858f[_0x4e86('0x64')]+'\x20');_0x1444f2+=_0x2b858f[_0x4e86('0x63')][_0x3f7966]['group']?_0x2214db(_0x2b858f[_0x4e86('0x63')][_0x3f7966]['group']):_0x2b858f[_0x4e86('0x63')][_0x3f7966][_0x4e86('0x65')]+'\x20'+_0x2b858f[_0x4e86('0x63')][_0x3f7966]['condition']+(_0x26baf4(_0x2b858f[_0x4e86('0x63')][_0x3f7966]['condition'])?'\x20'+_0x2b858f[_0x4e86('0x63')][_0x3f7966]['value']:'');}return _0x1444f2+')';};var _0x59d5d6={'where':{'id':_0x5afa06[_0x4e86('0x51')]['id']}},_0x366ffa,_0x1b5fab,_0x2bf478,_0x185d12,_0x455be8;_0x59d5d6=_['merge']({},_0x59d5d6,_0x5afa06[_0x4e86('0x3e')]);return db[_0x4e86('0x2c')][_0x4e86('0x46')](_0x59d5d6)[_0x4e86('0x23')](function(_0x551083){if(_0x551083){_0x366ffa=_0x551083;return _0x551083[_0x4e86('0x66')]();}return null;})[_0x4e86('0x23')](function(_0x39f9b5){if(_0x39f9b5){if(!_0x39f9b5[_0x4e86('0x35')]){throw new db[(_0x4e86('0x67'))]['ValidationErrorItem'](_0x4e86('0x68'),0x193);}_0x1b5fab=_0x39f9b5;return db[_0x4e86('0x69')]['findAll']({'raw':!![]});}return null;})[_0x4e86('0x23')](function(_0x37555d){if(_0x37555d){_0x2bf478=_[_0x4e86('0x6a')](_0x37555d,'id');var _0x2aa573;var _0x44e0f5=squel[_0x4e86('0x6b')]();_0x44e0f5[_0x4e86('0x6c')](_0x366ffa['table']);for(var _0x23f4d7=0x0;_0x23f4d7<_0x1b5fab[_0x4e86('0x35')];_0x23f4d7+=0x1){_0x2aa573=_0x1b5fab[_0x23f4d7]['MetricId']?_0x2bf478[_0x1b5fab[_0x23f4d7][_0x4e86('0x6d')]]['metric']:_0x1b5fab[_0x23f4d7][_0x4e86('0x65')];_0x2aa573=_0x1b5fab[_0x23f4d7][_0x4e86('0x6e')]?_['replace'](_0x4cb0cf[_0x1b5fab[_0x23f4d7][_0x4e86('0x6e')]],'%s',_0x2aa573):_0x2aa573;_0x2aa573=_0x1b5fab[_0x23f4d7][_0x4e86('0x6f')]?_[_0x4e86('0x70')](_0xfe6feb[_0x1b5fab[_0x23f4d7][_0x4e86('0x6f')]],'%s',_0x2aa573):_0x2aa573;if(_0x1b5fab[_0x23f4d7][_0x4e86('0x71')]){_0x44e0f5[_0x4e86('0x72')](_0x2aa573);}_0x1b5fab[_0x23f4d7]['orderBy']&&_0x44e0f5['order'](_0x2aa573,_0x1b5fab[_0x23f4d7][_0x4e86('0x73')]===_0x4e86('0x74')?![]:!![]);_0x44e0f5[_0x4e86('0x65')](_0x2aa573,_0x1b5fab[_0x23f4d7][_0x4e86('0x75')]||_0x2aa573);}if(_0x366ffa[_0x4e86('0x76')]){_0x366ffa[_0x4e86('0x76')]=JSON[_0x4e86('0x77')](_0x366ffa['joins']);for(var _0x1a621b=0x0;_0x1a621b<_0x366ffa[_0x4e86('0x76')]['length'];_0x1a621b+=0x1){if(_0x366ffa['joins'][_0x1a621b][_0x4e86('0x3b')]&&_[_0x4e86('0x78')](_0x1190b8,_0x366ffa[_0x4e86('0x76')][_0x1a621b][_0x4e86('0x3b')])&&_0x366ffa['joins'][_0x1a621b][_0x4e86('0x79')]&&_0x366ffa[_0x4e86('0x76')][_0x1a621b][_0x4e86('0x7a')]&&_0x366ffa[_0x4e86('0x76')][_0x1a621b]['foreignKey']){_0x44e0f5[_0x366ffa['joins'][_0x1a621b][_0x4e86('0x3b')]](_0x366ffa[_0x4e86('0x76')][_0x1a621b][_0x4e86('0x7a')],null,util[_0x4e86('0x6f')](_0x4e86('0x7b'),_0x366ffa[_0x4e86('0x7c')],_0x366ffa[_0x4e86('0x76')][_0x1a621b][_0x4e86('0x79')],_0x366ffa[_0x4e86('0x76')][_0x1a621b]['foreignTable'],_0x366ffa[_0x4e86('0x76')][_0x1a621b][_0x4e86('0x7d')]));}}}if(_0x366ffa['conditions']){_0x366ffa[_0x4e86('0x7e')]=JSON[_0x4e86('0x77')](_0x366ffa[_0x4e86('0x7e')]);_0x44e0f5[_0x4e86('0x3a')](_0x2214db(_0x366ffa[_0x4e86('0x7e')][_0x4e86('0x72')]));}_0x455be8=_0x44e0f5['clone']();_0x44e0f5[_0x4e86('0x1b')](_0x384ef3);_0x44e0f5['offset'](0x0);logger[_0x4e86('0x7f')]('Limited\x20Query:',_0x44e0f5[_0x4e86('0x80')]());return dbH['sequelize'][_0x4e86('0x30')](_0x44e0f5['toString'](),{'type':dbH[_0x4e86('0x81')][_0x4e86('0x82')][_0x4e86('0x83')]});}})[_0x4e86('0x23')](respondWithResult(_0x1177c2,null))[_0x4e86('0x43')](handleError(_0x1177c2,null));};function runReport(_0x2284c1,_0x50d900,_0x522e5c){var _0x328fc3=_0x50d900[_0x4e86('0x29')];var _0x535da1=0xa;var _0x100925=[_0x4e86('0x52'),_0x4e86('0x53'),_0x4e86('0x54'),_0x4e86('0x55')];var _0x4e459a={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x4e86('0x57'),'MAX':'MAX(%s)','MIN':_0x4e86('0x59'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x4e86('0x5d')};var _0x28a526={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x4e86('0x5f'),'HOUR':_0x4e86('0x84'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x27ea58=function(_0x194c0e){return!_[_0x4e86('0x78')]([_0x4e86('0x60'),'IS\x20NOT\x20NULL',_0x4e86('0x62'),'IS\x20NOT\x20EMPTY'],_0x194c0e);};var _0x1ec30e=function(_0x12ba98){if(!_0x12ba98||!_0x12ba98['rules'][_0x4e86('0x35')]){return'';}for(var _0x157818='(',_0xb66cec=0x0;_0xb66cec<_0x12ba98['rules'][_0x4e86('0x35')];_0xb66cec+=0x1){_0xb66cec>0x0&&(_0x157818+='\x20'+_0x12ba98['operator']+'\x20');_0x157818+=_0x12ba98[_0x4e86('0x63')][_0xb66cec][_0x4e86('0x72')]?_0x1ec30e(_0x12ba98[_0x4e86('0x63')][_0xb66cec]['group']):_0x12ba98['rules'][_0xb66cec][_0x4e86('0x65')]+'\x20'+_0x12ba98[_0x4e86('0x63')][_0xb66cec][_0x4e86('0x85')]+(_0x27ea58(_0x12ba98[_0x4e86('0x63')][_0xb66cec][_0x4e86('0x85')])?'\x20'+_0x12ba98[_0x4e86('0x63')][_0xb66cec][_0x4e86('0x86')]:'');}return _0x157818+')';};var _0x4f75cf={'where':{'id':_0x2284c1['id']}},_0x452814,_0x360cba,_0x2e9da8,_0x38fd2b,_0x719b68;_0x4f75cf=_[_0x4e86('0x3d')]({},_0x4f75cf,_0x522e5c);return db[_0x4e86('0x2c')][_0x4e86('0x46')](_0x4f75cf)[_0x4e86('0x23')](function(_0x74019f){if(_0x74019f){_0x452814=_0x74019f;return _0x74019f['getFields']();}return null;})['then'](function(_0x2759d2){if(_0x2759d2){if(!_0x2759d2[_0x4e86('0x35')]){throw new db[(_0x4e86('0x67'))][(_0x4e86('0x87'))](_0x4e86('0x68'),0x193);}_0x360cba=_0x2759d2;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0x4e86('0x23')](function(_0x51bc42){if(_0x51bc42){_0x2e9da8=_[_0x4e86('0x6a')](_0x51bc42,'id');var _0x202b97;var _0x3062f3=squel['select']();_0x3062f3[_0x4e86('0x6c')](_0x452814[_0x4e86('0x7c')]);for(var _0x20aff0=0x0;_0x20aff0<_0x360cba[_0x4e86('0x35')];_0x20aff0+=0x1){_0x202b97=_0x360cba[_0x20aff0][_0x4e86('0x6d')]?_0x2e9da8[_0x360cba[_0x20aff0][_0x4e86('0x6d')]][_0x4e86('0x88')]:_0x360cba[_0x20aff0][_0x4e86('0x65')];_0x202b97=_0x360cba[_0x20aff0]['function']?_[_0x4e86('0x70')](_0x4e459a[_0x360cba[_0x20aff0][_0x4e86('0x6e')]],'%s',_0x202b97):_0x202b97;_0x202b97=_0x360cba[_0x20aff0][_0x4e86('0x6f')]?_[_0x4e86('0x70')](_0x28a526[_0x360cba[_0x20aff0][_0x4e86('0x6f')]],'%s',_0x202b97):_0x202b97;if(_0x360cba[_0x20aff0][_0x4e86('0x71')]){_0x3062f3[_0x4e86('0x72')](_0x202b97);}_0x360cba[_0x20aff0][_0x4e86('0x73')]&&_0x3062f3[_0x4e86('0x37')](_0x202b97,_0x360cba[_0x20aff0][_0x4e86('0x73')]===_0x4e86('0x74')?![]:!![]);_0x3062f3[_0x4e86('0x65')](_0x202b97,_0x360cba[_0x20aff0][_0x4e86('0x75')]||_0x202b97);}if(_0x452814['joins']){_0x452814['joins']=JSON[_0x4e86('0x77')](_0x452814[_0x4e86('0x76')]);for(var _0xb67480=0x0;_0xb67480<_0x452814['joins'][_0x4e86('0x35')];_0xb67480+=0x1){if(_0x452814[_0x4e86('0x76')][_0xb67480][_0x4e86('0x3b')]&&_[_0x4e86('0x78')](_0x100925,_0x452814[_0x4e86('0x76')][_0xb67480][_0x4e86('0x3b')])&&_0x452814[_0x4e86('0x76')][_0xb67480][_0x4e86('0x79')]&&_0x452814[_0x4e86('0x76')][_0xb67480][_0x4e86('0x7a')]&&_0x452814[_0x4e86('0x76')][_0xb67480][_0x4e86('0x7d')]){_0x3062f3[_0x452814[_0x4e86('0x76')][_0xb67480][_0x4e86('0x3b')]](_0x452814['joins'][_0xb67480][_0x4e86('0x7a')],null,util['format'](_0x4e86('0x7b'),_0x452814['table'],_0x452814[_0x4e86('0x76')][_0xb67480]['parentKey'],_0x452814[_0x4e86('0x76')][_0xb67480][_0x4e86('0x7a')],_0x452814[_0x4e86('0x76')][_0xb67480][_0x4e86('0x7d')]));}}}if(_0x452814[_0x4e86('0x7e')]){_0x452814[_0x4e86('0x7e')]=JSON[_0x4e86('0x77')](_0x452814[_0x4e86('0x7e')]);_0x3062f3[_0x4e86('0x3a')](_0x1ec30e(_0x452814['conditions']['group']));}_0x719b68=_0x3062f3['clone']();_0x3062f3[_0x4e86('0x1b')](_0x535da1);_0x3062f3[_0x4e86('0x19')](0x0);return;}})['then'](function(){if(_0x50d900[_0x4e86('0x89')]===_0x4e86('0x8a')){return null;}var _0x5d7d9d=_[_0x4e86('0x3d')](_0x50d900,{'name':_0x50d900['fullPath']||_0x50d900[_0x4e86('0x29')]||_0x452814['name'],'basename':_0x328fc3,'savename':util[_0x4e86('0x6f')]('%s-%s.%s',_0x50d900['name']||_0x452814[_0x4e86('0x29')],require(_0x4e86('0x8b'))['generate'](0x4),_0x50d900[_0x4e86('0x89')]||_0x4e86('0x8c')),'reportId':_0x452814['id'],'reportType':'custom'});return db['AnalyticExtractedReport'][_0x4e86('0x47')](_0x5d7d9d,{'raw':!![]});})[_0x4e86('0x23')](function(_0x5bd257){if(_0x452814[_0x4e86('0x7c')]===_0x4e86('0x8d')){_0x719b68['where'](_0x452814['table']+_0x4e86('0x8e'),_0x50d900['startDate'],_0x50d900[_0x4e86('0x8f')]);}else{_0x719b68[_0x4e86('0x3a')](_0x452814[_0x4e86('0x7c')]+_0x4e86('0x90'),_0x50d900[_0x4e86('0x91')],_0x50d900[_0x4e86('0x8f')]);}if(_0x5bd257){logger[_0x4e86('0x92')](_0x4e86('0x93'),_0x719b68['toString']());require(_0x4e86('0x94'))[_0x4e86('0x95')](path[_0x4e86('0x52')](__dirname,_0x4e86('0x96'),_0x5bd257['output']),[_0x5bd257['id'],_0x719b68['toString'](),path[_0x4e86('0x52')](__dirname,_0x4e86('0x97'),_0x5bd257[_0x4e86('0x98')]),_0x328fc3]);return _0x5bd257;}else{var _0x5b37df=squel[_0x4e86('0x6b')]();_0x5b37df[_0x4e86('0x6c')]('('+_0x719b68[_0x4e86('0x80')]()+')',_0x4e86('0x99'));_0x5b37df['field']('COUNT(*)',_0x4e86('0x1c'));_0x719b68['limit'](_0x50d900[_0x4e86('0x1b')]||_0x535da1);_0x719b68['offset'](_0x50d900[_0x4e86('0x19')]||0x0);return dbH[_0x4e86('0x81')][_0x4e86('0x30')](_0x5b37df['toString'](),{'type':dbH[_0x4e86('0x81')][_0x4e86('0x82')]['SELECT']})[_0x4e86('0x23')](function(_0x17e40e){if(!_0x17e40e[_0x4e86('0x35')]){_0x38fd2b=0x0;}else{_0x38fd2b=_0x17e40e[0x0]['count']||0x0;}return dbH[_0x4e86('0x81')][_0x4e86('0x30')](_0x719b68[_0x4e86('0x80')](),{'type':dbH[_0x4e86('0x81')]['QueryTypes'][_0x4e86('0x83')]});})[_0x4e86('0x23')](function(_0x1471fa){return{'rows':_0x1471fa||[],'count':_0x38fd2b};});}});}exports[_0x4e86('0x9a')]=function(_0x16bcfe,_0x192817){return runReport(_0x16bcfe[_0x4e86('0x51')],_0x16bcfe['query'],_0x16bcfe['options'])['then'](respondWithResult(_0x192817,null))['catch'](handleError(_0x192817,null));};exports[_0x4e86('0x9b')]=runReport;exports[_0x4e86('0x30')]=function(_0x107ed9,_0x4634c4){var _0x43125c=0xa;var _0x86e078=[_0x4e86('0x52'),_0x4e86('0x53'),'right_join','cross_join'];var _0x1ad303={'SUM':_0x4e86('0x9c'),'COUNT':_0x4e86('0x56'),'COUNT DISTINCT':_0x4e86('0x57'),'MAX':_0x4e86('0x58'),'MIN':_0x4e86('0x59'),'AVG':_0x4e86('0x5a'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x4e86('0x5c'),'GROUP_CONCAT DESC':_0x4e86('0x5d')};var _0x599b6e={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x4e86('0x5f'),'HOUR':_0x4e86('0x84'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x4e86('0x9d')};var _0x1bfb02=function(_0x57e04c){return!_[_0x4e86('0x78')]([_0x4e86('0x60'),_0x4e86('0x61'),'IS\x20EMPTY',_0x4e86('0x9e')],_0x57e04c);};var _0x3ea900=function(_0x31076c){if(!_0x31076c||!_0x31076c['rules'][_0x4e86('0x35')]){return'';}for(var _0x5e9d7e='(',_0x2af1c8=0x0;_0x2af1c8<_0x31076c[_0x4e86('0x63')][_0x4e86('0x35')];_0x2af1c8+=0x1){_0x2af1c8>0x0&&(_0x5e9d7e+='\x20'+_0x31076c[_0x4e86('0x64')]+'\x20');_0x5e9d7e+=_0x31076c[_0x4e86('0x63')][_0x2af1c8][_0x4e86('0x72')]?_0x3ea900(_0x31076c['rules'][_0x2af1c8][_0x4e86('0x72')]):_0x31076c['rules'][_0x2af1c8][_0x4e86('0x65')]+'\x20'+_0x31076c[_0x4e86('0x63')][_0x2af1c8][_0x4e86('0x85')]+(_0x1bfb02(_0x31076c[_0x4e86('0x63')][_0x2af1c8][_0x4e86('0x85')])?'\x20'+_0x31076c['rules'][_0x2af1c8][_0x4e86('0x86')]:'');}return _0x5e9d7e+')';};var _0x14d29f={'where':{'id':_0x107ed9[_0x4e86('0x51')]['id']}},_0x4941a9,_0x1dfc30,_0x4d3375,_0x315bbb,_0x241d7f;_0x14d29f=_[_0x4e86('0x3d')]({},_0x14d29f,_0x107ed9[_0x4e86('0x3e')]);return db['AnalyticCustomReport'][_0x4e86('0x46')](_0x14d29f)[_0x4e86('0x23')](function(_0x270569){if(_0x270569){_0x4941a9=_0x270569;return _0x270569[_0x4e86('0x66')]();}return null;})['then'](function(_0x13da76){if(_0x13da76){if(!_0x13da76[_0x4e86('0x35')]){throw new db[(_0x4e86('0x67'))]['ValidationErrorItem'](_0x4e86('0x68'),0x193);}_0x1dfc30=_0x13da76;return db[_0x4e86('0x69')][_0x4e86('0x41')]({'raw':!![]});}return null;})[_0x4e86('0x23')](function(_0xae3206){if(_0xae3206){_0x4d3375=_[_0x4e86('0x6a')](_0xae3206,'id');var _0x322c21;var _0xdaf1f3=squel[_0x4e86('0x6b')]();_0xdaf1f3[_0x4e86('0x6c')](_0x4941a9[_0x4e86('0x7c')]);for(var _0x94265e=0x0;_0x94265e<_0x1dfc30[_0x4e86('0x35')];_0x94265e+=0x1){_0x322c21=_0x1dfc30[_0x94265e]['MetricId']?_0x4d3375[_0x1dfc30[_0x94265e][_0x4e86('0x6d')]][_0x4e86('0x88')]:_0x1dfc30[_0x94265e][_0x4e86('0x65')];_0x322c21=_0x1dfc30[_0x94265e][_0x4e86('0x6e')]?_[_0x4e86('0x70')](_0x1ad303[_0x1dfc30[_0x94265e][_0x4e86('0x6e')]],'%s',_0x322c21):_0x322c21;_0x322c21=_0x1dfc30[_0x94265e][_0x4e86('0x6f')]?_[_0x4e86('0x70')](_0x599b6e[_0x1dfc30[_0x94265e][_0x4e86('0x6f')]],'%s',_0x322c21):_0x322c21;if(_0x1dfc30[_0x94265e][_0x4e86('0x71')]){_0xdaf1f3[_0x4e86('0x72')](_0x322c21);}_0x1dfc30[_0x94265e][_0x4e86('0x73')]&&_0xdaf1f3['order'](_0x322c21,_0x1dfc30[_0x94265e]['orderBy']==='DESC'?![]:!![]);_0xdaf1f3[_0x4e86('0x65')](_0x322c21,_0x1dfc30[_0x94265e]['alias']||_0x322c21);}if(_0x4941a9['joins']){_0x4941a9['joins']=JSON['parse'](_0x4941a9[_0x4e86('0x76')]);for(var _0x3d7f3c=0x0;_0x3d7f3c<_0x4941a9[_0x4e86('0x76')]['length'];_0x3d7f3c+=0x1){if(_0x4941a9[_0x4e86('0x76')][_0x3d7f3c][_0x4e86('0x3b')]&&_[_0x4e86('0x78')](_0x86e078,_0x4941a9[_0x4e86('0x76')][_0x3d7f3c][_0x4e86('0x3b')])&&_0x4941a9[_0x4e86('0x76')][_0x3d7f3c][_0x4e86('0x79')]&&_0x4941a9['joins'][_0x3d7f3c][_0x4e86('0x7a')]&&_0x4941a9[_0x4e86('0x76')][_0x3d7f3c][_0x4e86('0x7d')]){_0xdaf1f3[_0x4941a9[_0x4e86('0x76')][_0x3d7f3c]['type']](_0x4941a9[_0x4e86('0x76')][_0x3d7f3c]['foreignTable'],null,util['format'](_0x4e86('0x7b'),_0x4941a9[_0x4e86('0x7c')],_0x4941a9[_0x4e86('0x76')][_0x3d7f3c]['parentKey'],_0x4941a9[_0x4e86('0x76')][_0x3d7f3c][_0x4e86('0x7a')],_0x4941a9[_0x4e86('0x76')][_0x3d7f3c]['foreignKey']));}}}if(_0x4941a9[_0x4e86('0x7e')]){_0x4941a9[_0x4e86('0x7e')]=JSON[_0x4e86('0x77')](_0x4941a9[_0x4e86('0x7e')]);_0xdaf1f3['where'](_0x3ea900(_0x4941a9[_0x4e86('0x7e')][_0x4e86('0x72')]));}_0x241d7f=_0xdaf1f3[_0x4e86('0x9f')]();_0xdaf1f3[_0x4e86('0x1b')](_0x43125c);_0xdaf1f3[_0x4e86('0x19')](0x0);logger[_0x4e86('0x7f')](_0x4e86('0xa0'),_0xdaf1f3['toString']());return dbH[_0x4e86('0x81')][_0x4e86('0x30')](_0xdaf1f3[_0x4e86('0x80')](),{'type':dbH[_0x4e86('0x81')][_0x4e86('0x82')][_0x4e86('0x83')]});}})[_0x4e86('0x23')](function(){return{'sql':_0x241d7f['toString']()};})[_0x4e86('0x23')](respondWithResult(_0x4634c4,null))[_0x4e86('0x43')](handleError(_0x4634c4,null));}; \ No newline at end of file +var _0x16d7=['intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','include','rows','catch','show','params','includeAll','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','UserProfileSection','update','body','preview','join','left_join','right_join','cross_join','COUNT(DISTINCT\x20%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','Sequelize','keyBy','select','from','table','metric','function','replace','format','groupBy','orderBy','DESC','alias','parse','joins','type','includes','foreignTable','foreignKey','parentKey','conditions','clone','debug','toString','sequelize','SELECT','SUM(%s)','COUNT(%s)','MAX(%s)','GROUP_CONCAT(%s)','SEC_TO_TIME(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','Please\x20insert\x20at\x20least\x20one\x20field','findAll','MetricId','%s.%s\x20=\x20%s.%s','web','%s-%s.%s','randomstring','generate','output','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','QueryTypes','run','ValidationErrorItem','Limited\x20Query:','eml-format','rimraf','zip-dir','fast-json-patch','moment','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','save','then','destroy','get','CustomReports','error','stack','name','send','index','map','AnalyticCustomReport','rawAttributes','key','query','keys','filters'];(function(_0x484ffe,_0x23a14b){var _0xc4c541=function(_0x583466){while(--_0x583466){_0x484ffe['push'](_0x484ffe['shift']());}};_0xc4c541(++_0x23a14b);}(_0x16d7,0x1ac));var _0x716d=function(_0x1af533,_0x2b8b3b){_0x1af533=_0x1af533-0x0;var _0x7149d6=_0x16d7[_0x1af533];return _0x7149d6;};'use strict';var emlformat=require(_0x716d('0x0'));var rimraf=require(_0x716d('0x1'));var zipdir=require(_0x716d('0x2'));var jsonpatch=require(_0x716d('0x3'));var rp=require('request-promise');var moment=require(_0x716d('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x716d('0x5'));var sox=require('sox');var csv=require(_0x716d('0x6'));var ejs=require(_0x716d('0x7'));var fs=require('fs');var fs_extra=require(_0x716d('0x8'));var _=require(_0x716d('0x9'));var squel=require(_0x716d('0xa'));var crypto=require(_0x716d('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x716d('0xc'));var toCsv=require(_0x716d('0x6'));var querystring=require(_0x716d('0xd'));var Papa=require(_0x716d('0xe'));var Redis=require(_0x716d('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x716d('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x716d('0x11'));var logger=require(_0x716d('0x12'))(_0x716d('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x716d('0x14'))['db'];var dbH=require('../../mysqldb')[_0x716d('0x15')];function respondWithStatusCode(_0x2ad605,_0x536250){_0x536250=_0x536250||0xcc;return function(_0x3432ed){if(_0x3432ed){return _0x2ad605[_0x716d('0x16')](_0x536250);}return _0x2ad605[_0x716d('0x17')](_0x536250)[_0x716d('0x18')]();};}function respondWithResult(_0x2a3d42,_0x527cf0){_0x527cf0=_0x527cf0||0xc8;return function(_0xbcad3e){if(_0xbcad3e){return _0x2a3d42[_0x716d('0x17')](_0x527cf0)[_0x716d('0x19')](_0xbcad3e);}};}function respondWithFilteredResult(_0x5cf0f2,_0x38b57b){return function(_0xd002c3){if(_0xd002c3){var _0x1bfa7e=typeof _0x38b57b[_0x716d('0x1a')]===_0x716d('0x1b')&&typeof _0x38b57b[_0x716d('0x1c')]==='undefined';var _0x4bbd1f=_0xd002c3[_0x716d('0x1d')];var _0xa74566=_0x1bfa7e?0x0:_0x38b57b[_0x716d('0x1a')];var _0x364efe=_0x1bfa7e?_0xd002c3[_0x716d('0x1d')]:_0x38b57b[_0x716d('0x1a')]+_0x38b57b[_0x716d('0x1c')];var _0x4f3f09;if(_0x364efe>=_0x4bbd1f){_0x364efe=_0x4bbd1f;_0x4f3f09=0xc8;}else{_0x4f3f09=0xce;}_0x5cf0f2['status'](_0x4f3f09);return _0x5cf0f2['set']('Content-Range',_0xa74566+'-'+_0x364efe+'/'+_0x4bbd1f)[_0x716d('0x19')](_0xd002c3);}return null;};}function patchUpdates(_0x4f9ef2){return function(_0x493f40){try{jsonpatch[_0x716d('0x1e')](_0x493f40,_0x4f9ef2,!![]);}catch(_0x420e92){return BPromise[_0x716d('0x1f')](_0x420e92);}return _0x493f40[_0x716d('0x20')]();};}function saveUpdates(_0xe29754,_0x33920d){return function(_0x388bc8){if(_0x388bc8){return _0x388bc8['update'](_0xe29754)[_0x716d('0x21')](function(_0x3998a9){return _0x3998a9;});}return null;};}function removeEntity(_0x368cf0,_0x295276){return function(_0x3a0f16){if(_0x3a0f16){return _0x3a0f16[_0x716d('0x22')]()[_0x716d('0x21')](function(){var _0x1aca26=_0x3a0f16[_0x716d('0x23')]({'plain':!![]});var _0x124d88=_0x716d('0x24');return db['UserProfileResource'][_0x716d('0x22')]({'where':{'type':_0x124d88,'resourceId':_0x1aca26['id']}})[_0x716d('0x21')](function(){return _0x3a0f16;});})['then'](function(){_0x368cf0[_0x716d('0x17')](0xcc)[_0x716d('0x18')]();});}};}function handleEntityNotFound(_0x3f6a92,_0x5497da){return function(_0x2de374){if(!_0x2de374){_0x3f6a92['sendStatus'](0x194);}return _0x2de374;};}function handleError(_0x3283c0,_0x4c6986){_0x4c6986=_0x4c6986||0x1f4;return function(_0x34e621){logger[_0x716d('0x25')](_0x34e621[_0x716d('0x26')]);if(_0x34e621['name']){delete _0x34e621[_0x716d('0x27')];}_0x3283c0['status'](_0x4c6986)[_0x716d('0x28')](_0x34e621);};}exports[_0x716d('0x29')]=function(_0x5a4cfa,_0x18f0d1){var _0x27182e={},_0x16fecf={},_0xfd47d1={'count':0x0,'rows':[]};var _0x21a059=_[_0x716d('0x2a')](db[_0x716d('0x2b')][_0x716d('0x2c')],function(_0x15da0a){return{'name':_0x15da0a['fieldName'],'type':_0x15da0a['type'][_0x716d('0x2d')]};});_0x16fecf['model']=_[_0x716d('0x2a')](_0x21a059,_0x716d('0x27'));_0x16fecf[_0x716d('0x2e')]=_[_0x716d('0x2f')](_0x5a4cfa[_0x716d('0x2e')]);_0x16fecf[_0x716d('0x30')]=_[_0x716d('0x31')](_0x16fecf[_0x716d('0x32')],_0x16fecf[_0x716d('0x2e')]);_0x27182e[_0x716d('0x33')]=_[_0x716d('0x31')](_0x16fecf[_0x716d('0x32')],qs[_0x716d('0x34')](_0x5a4cfa[_0x716d('0x2e')]['fields']));_0x27182e[_0x716d('0x33')]=_0x27182e[_0x716d('0x33')][_0x716d('0x35')]?_0x27182e[_0x716d('0x33')]:_0x16fecf[_0x716d('0x32')];if(!_0x5a4cfa[_0x716d('0x2e')][_0x716d('0x36')](_0x716d('0x37'))){_0x27182e['limit']=qs[_0x716d('0x1c')](_0x5a4cfa['query'][_0x716d('0x1c')]);_0x27182e['offset']=qs[_0x716d('0x1a')](_0x5a4cfa['query'][_0x716d('0x1a')]);}_0x27182e[_0x716d('0x38')]=qs[_0x716d('0x39')](_0x5a4cfa['query'][_0x716d('0x39')]);_0x27182e['where']=qs[_0x716d('0x30')](_[_0x716d('0x3a')](_0x5a4cfa[_0x716d('0x2e')],_0x16fecf[_0x716d('0x30')]),_0x21a059);if(_0x5a4cfa[_0x716d('0x2e')][_0x716d('0x3b')]){_0x27182e['where']=_['merge'](_0x27182e[_0x716d('0x3c')],{'$or':_[_0x716d('0x2a')](_0x21a059,function(_0x44de3e){if(_0x44de3e['type']!==_0x716d('0x3d')){var _0x54a08c={};_0x54a08c[_0x44de3e['name']]={'$like':'%'+_0x5a4cfa[_0x716d('0x2e')][_0x716d('0x3b')]+'%'};return _0x54a08c;}})});}_0x27182e=_[_0x716d('0x3e')]({},_0x27182e,_0x5a4cfa[_0x716d('0x3f')]);var _0x89dd7b={'where':_0x27182e[_0x716d('0x3c')]};return db['AnalyticCustomReport'][_0x716d('0x1d')](_0x89dd7b)[_0x716d('0x21')](function(_0x3db122){_0xfd47d1[_0x716d('0x1d')]=_0x3db122;if(_0x5a4cfa[_0x716d('0x2e')]['includeAll']){_0x27182e[_0x716d('0x40')]=[{'all':!![]}];}return db[_0x716d('0x2b')]['findAll'](_0x27182e);})[_0x716d('0x21')](function(_0x17c68c){_0xfd47d1[_0x716d('0x41')]=_0x17c68c;return _0xfd47d1;})[_0x716d('0x21')](respondWithFilteredResult(_0x18f0d1,_0x27182e))[_0x716d('0x42')](handleError(_0x18f0d1,null));};exports[_0x716d('0x43')]=function(_0xcce44c,_0x2612cc){var _0x5847f2={'raw':![],'where':{'id':_0xcce44c[_0x716d('0x44')]['id']}},_0x4d0bff={};_0x4d0bff[_0x716d('0x32')]=_[_0x716d('0x2f')](db[_0x716d('0x2b')][_0x716d('0x2c')]);_0x4d0bff[_0x716d('0x2e')]=_['keys'](_0xcce44c[_0x716d('0x2e')]);_0x4d0bff[_0x716d('0x30')]=_['intersection'](_0x4d0bff[_0x716d('0x32')],_0x4d0bff[_0x716d('0x2e')]);_0x5847f2['attributes']=_[_0x716d('0x31')](_0x4d0bff[_0x716d('0x32')],qs['fields'](_0xcce44c['query'][_0x716d('0x34')]));_0x5847f2[_0x716d('0x33')]=_0x5847f2[_0x716d('0x33')][_0x716d('0x35')]?_0x5847f2['attributes']:_0x4d0bff['model'];if(_0xcce44c['query'][_0x716d('0x45')]){_0x5847f2[_0x716d('0x40')]=[{'all':!![]}];}_0x5847f2=_[_0x716d('0x3e')]({},_0x5847f2,_0xcce44c[_0x716d('0x3f')]);return db[_0x716d('0x2b')][_0x716d('0x46')](_0x5847f2)[_0x716d('0x21')](handleEntityNotFound(_0x2612cc,null))['then'](respondWithResult(_0x2612cc,null))['catch'](handleError(_0x2612cc,null));};exports[_0x716d('0x47')]=function(_0x26a185,_0x4dff4a){return db['AnalyticCustomReport']['create'](_0x26a185['body'],{})[_0x716d('0x21')](function(_0x495e19){var _0x3f24f5=_0x26a185[_0x716d('0x48')][_0x716d('0x23')]({'plain':!![]});if(!_0x3f24f5)throw new Error(_0x716d('0x49'));if(_0x3f24f5['role']==='user'){var _0x24791c=_0x495e19[_0x716d('0x23')]({'plain':!![]});var _0x4c5596=_0x716d('0x4a');return db[_0x716d('0x4b')][_0x716d('0x46')]({'where':{'name':_0x4c5596,'userProfileId':_0x3f24f5['userProfileId']},'raw':!![]})[_0x716d('0x21')](function(_0x528f9a){if(_0x528f9a&&_0x528f9a['autoAssociation']===0x0){return db['UserProfileResource'][_0x716d('0x47')]({'name':_0x24791c['name'],'resourceId':_0x24791c['id'],'type':_0x716d('0x24'),'sectionId':_0x528f9a['id']},{})[_0x716d('0x21')](function(){return _0x495e19;});}else{return _0x495e19;}})[_0x716d('0x42')](function(_0x1aeba1){logger[_0x716d('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1aeba1);throw _0x1aeba1;});}return _0x495e19;})[_0x716d('0x21')](respondWithResult(_0x4dff4a,0xc9))['catch'](handleError(_0x4dff4a,null));};exports[_0x716d('0x4c')]=function(_0x2d65f1,_0x510191){if(_0x2d65f1['body']['id']){delete _0x2d65f1[_0x716d('0x4d')]['id'];}return db[_0x716d('0x2b')][_0x716d('0x46')]({'where':{'id':_0x2d65f1[_0x716d('0x44')]['id']}})['then'](handleEntityNotFound(_0x510191,null))[_0x716d('0x21')](saveUpdates(_0x2d65f1[_0x716d('0x4d')],null))['then'](respondWithResult(_0x510191,null))[_0x716d('0x42')](handleError(_0x510191,null));};exports[_0x716d('0x22')]=function(_0x186717,_0x29750d){return db['AnalyticCustomReport'][_0x716d('0x46')]({'where':{'id':_0x186717[_0x716d('0x44')]['id']}})[_0x716d('0x21')](handleEntityNotFound(_0x29750d,null))[_0x716d('0x21')](removeEntity(_0x29750d,null))[_0x716d('0x42')](handleError(_0x29750d,null));};exports[_0x716d('0x4e')]=function(_0x34043d,_0x33e262){var _0x5e7436=0xa;var _0x1e8732=[_0x716d('0x4f'),_0x716d('0x50'),_0x716d('0x51'),_0x716d('0x52')];var _0x5a9b0f={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x716d('0x53'),'MAX':'MAX(%s)','MIN':_0x716d('0x54'),'AVG':_0x716d('0x55'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x716d('0x56'),'GROUP_CONCAT DESC':_0x716d('0x57')};var _0x339030={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x716d('0x58'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0xc26fc3=function(_0x406d9c){return!_['includes']([_0x716d('0x59'),_0x716d('0x5a'),_0x716d('0x5b'),_0x716d('0x5c')],_0x406d9c);};var _0x35de7f=function(_0x5de923){if(!_0x5de923||!_0x5de923['rules'][_0x716d('0x35')]){return'';}for(var _0xd5701a='(',_0x3e1410=0x0;_0x3e1410<_0x5de923[_0x716d('0x5d')][_0x716d('0x35')];_0x3e1410+=0x1){_0x3e1410>0x0&&(_0xd5701a+='\x20'+_0x5de923[_0x716d('0x5e')]+'\x20');_0xd5701a+=_0x5de923[_0x716d('0x5d')][_0x3e1410][_0x716d('0x5f')]?_0x35de7f(_0x5de923['rules'][_0x3e1410][_0x716d('0x5f')]):_0x5de923['rules'][_0x3e1410][_0x716d('0x60')]+'\x20'+_0x5de923[_0x716d('0x5d')][_0x3e1410][_0x716d('0x61')]+(_0xc26fc3(_0x5de923[_0x716d('0x5d')][_0x3e1410][_0x716d('0x61')])?'\x20'+_0x5de923[_0x716d('0x5d')][_0x3e1410][_0x716d('0x62')]:'');}return _0xd5701a+')';};var _0x1cfbf5={'where':{'id':_0x34043d[_0x716d('0x44')]['id']}},_0x3e1d73,_0x1501d3,_0x434a3b,_0x261b42,_0x476100;_0x1cfbf5=_[_0x716d('0x3e')]({},_0x1cfbf5,_0x34043d[_0x716d('0x3f')]);return db[_0x716d('0x2b')][_0x716d('0x46')](_0x1cfbf5)[_0x716d('0x21')](function(_0x339eba){if(_0x339eba){_0x3e1d73=_0x339eba;return _0x339eba['getFields']();}return null;})[_0x716d('0x21')](function(_0x2819e5){if(_0x2819e5){if(!_0x2819e5[_0x716d('0x35')]){throw new db[(_0x716d('0x63'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x1501d3=_0x2819e5;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0x716d('0x21')](function(_0x47696a){if(_0x47696a){_0x434a3b=_[_0x716d('0x64')](_0x47696a,'id');var _0x52c965;var _0x35b71d=squel[_0x716d('0x65')]();_0x35b71d[_0x716d('0x66')](_0x3e1d73[_0x716d('0x67')]);for(var _0x1c0c7f=0x0;_0x1c0c7f<_0x1501d3[_0x716d('0x35')];_0x1c0c7f+=0x1){_0x52c965=_0x1501d3[_0x1c0c7f]['MetricId']?_0x434a3b[_0x1501d3[_0x1c0c7f]['MetricId']][_0x716d('0x68')]:_0x1501d3[_0x1c0c7f][_0x716d('0x60')];_0x52c965=_0x1501d3[_0x1c0c7f][_0x716d('0x69')]?_[_0x716d('0x6a')](_0x5a9b0f[_0x1501d3[_0x1c0c7f]['function']],'%s',_0x52c965):_0x52c965;_0x52c965=_0x1501d3[_0x1c0c7f][_0x716d('0x6b')]?_[_0x716d('0x6a')](_0x339030[_0x1501d3[_0x1c0c7f]['format']],'%s',_0x52c965):_0x52c965;if(_0x1501d3[_0x1c0c7f][_0x716d('0x6c')]){_0x35b71d[_0x716d('0x5f')](_0x52c965);}_0x1501d3[_0x1c0c7f]['orderBy']&&_0x35b71d[_0x716d('0x38')](_0x52c965,_0x1501d3[_0x1c0c7f][_0x716d('0x6d')]===_0x716d('0x6e')?![]:!![]);_0x35b71d['field'](_0x52c965,_0x1501d3[_0x1c0c7f][_0x716d('0x6f')]||_0x52c965);}if(_0x3e1d73['joins']){_0x3e1d73['joins']=JSON[_0x716d('0x70')](_0x3e1d73[_0x716d('0x71')]);for(var _0x413d35=0x0;_0x413d35<_0x3e1d73[_0x716d('0x71')]['length'];_0x413d35+=0x1){if(_0x3e1d73['joins'][_0x413d35][_0x716d('0x72')]&&_[_0x716d('0x73')](_0x1e8732,_0x3e1d73[_0x716d('0x71')][_0x413d35][_0x716d('0x72')])&&_0x3e1d73[_0x716d('0x71')][_0x413d35]['parentKey']&&_0x3e1d73[_0x716d('0x71')][_0x413d35][_0x716d('0x74')]&&_0x3e1d73[_0x716d('0x71')][_0x413d35][_0x716d('0x75')]){_0x35b71d[_0x3e1d73[_0x716d('0x71')][_0x413d35]['type']](_0x3e1d73[_0x716d('0x71')][_0x413d35][_0x716d('0x74')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x3e1d73['table'],_0x3e1d73[_0x716d('0x71')][_0x413d35][_0x716d('0x76')],_0x3e1d73['joins'][_0x413d35]['foreignTable'],_0x3e1d73[_0x716d('0x71')][_0x413d35][_0x716d('0x75')]));}}}if(_0x3e1d73['conditions']){_0x3e1d73[_0x716d('0x77')]=JSON[_0x716d('0x70')](_0x3e1d73['conditions']);_0x35b71d[_0x716d('0x3c')](_0x35de7f(_0x3e1d73['conditions'][_0x716d('0x5f')]));}_0x476100=_0x35b71d[_0x716d('0x78')]();_0x35b71d['limit'](_0x5e7436);_0x35b71d[_0x716d('0x1a')](0x0);logger[_0x716d('0x79')]('Limited\x20Query:',_0x35b71d[_0x716d('0x7a')]());return dbH[_0x716d('0x7b')]['query'](_0x35b71d['toString'](),{'type':dbH[_0x716d('0x7b')]['QueryTypes'][_0x716d('0x7c')]});}})[_0x716d('0x21')](respondWithResult(_0x33e262,null))[_0x716d('0x42')](handleError(_0x33e262,null));};function runReport(_0xc5e14f,_0x52c559,_0x243759){var _0x119df6=_0x52c559[_0x716d('0x27')];var _0x3784d9=0xa;var _0x3eab81=['join',_0x716d('0x50'),_0x716d('0x51'),_0x716d('0x52')];var _0x108adf={'SUM':_0x716d('0x7d'),'COUNT':_0x716d('0x7e'),'COUNT DISTINCT':_0x716d('0x53'),'MAX':_0x716d('0x7f'),'MIN':_0x716d('0x54'),'AVG':_0x716d('0x55'),'GROUP_CONCAT':_0x716d('0x80'),'GROUP_CONCAT ASC':_0x716d('0x56'),'GROUP_CONCAT DESC':_0x716d('0x57')};var _0x2b3c08={'SEC_TO_TIME':_0x716d('0x81'),'DATE':_0x716d('0x58'),'HOUR':_0x716d('0x82'),'ROUND':_0x716d('0x83'),'UNIX_TIMESTAMP':_0x716d('0x84')};var _0x4e4760=function(_0x50463e){return!_[_0x716d('0x73')](['IS\x20NULL',_0x716d('0x5a'),_0x716d('0x5b'),'IS\x20NOT\x20EMPTY'],_0x50463e);};var _0x3a237c=function(_0x48b87e){if(!_0x48b87e||!_0x48b87e[_0x716d('0x5d')][_0x716d('0x35')]){return'';}for(var _0xa7243a='(',_0xe8692e=0x0;_0xe8692e<_0x48b87e['rules'][_0x716d('0x35')];_0xe8692e+=0x1){_0xe8692e>0x0&&(_0xa7243a+='\x20'+_0x48b87e[_0x716d('0x5e')]+'\x20');_0xa7243a+=_0x48b87e[_0x716d('0x5d')][_0xe8692e][_0x716d('0x5f')]?_0x3a237c(_0x48b87e['rules'][_0xe8692e][_0x716d('0x5f')]):_0x48b87e[_0x716d('0x5d')][_0xe8692e][_0x716d('0x60')]+'\x20'+_0x48b87e[_0x716d('0x5d')][_0xe8692e][_0x716d('0x61')]+(_0x4e4760(_0x48b87e[_0x716d('0x5d')][_0xe8692e][_0x716d('0x61')])?'\x20'+_0x48b87e[_0x716d('0x5d')][_0xe8692e][_0x716d('0x62')]:'');}return _0xa7243a+')';};var _0x547325={'where':{'id':_0xc5e14f['id']}},_0x26342b,_0x592f0d,_0x127e31,_0x3cac10,_0x1c61af;_0x547325=_['merge']({},_0x547325,_0x243759);return db[_0x716d('0x2b')][_0x716d('0x46')](_0x547325)[_0x716d('0x21')](function(_0x3c9b2e){if(_0x3c9b2e){_0x26342b=_0x3c9b2e;return _0x3c9b2e['getFields']();}return null;})['then'](function(_0x6812ab){if(_0x6812ab){if(!_0x6812ab[_0x716d('0x35')]){throw new db[(_0x716d('0x63'))]['ValidationErrorItem'](_0x716d('0x85'),0x193);}_0x592f0d=_0x6812ab;return db['AnalyticMetric'][_0x716d('0x86')]({'raw':!![]});}return null;})[_0x716d('0x21')](function(_0x50c995){if(_0x50c995){_0x127e31=_[_0x716d('0x64')](_0x50c995,'id');var _0x48ec9f;var _0x5e9525=squel[_0x716d('0x65')]();_0x5e9525[_0x716d('0x66')](_0x26342b['table']);for(var _0x4808cc=0x0;_0x4808cc<_0x592f0d[_0x716d('0x35')];_0x4808cc+=0x1){_0x48ec9f=_0x592f0d[_0x4808cc][_0x716d('0x87')]?_0x127e31[_0x592f0d[_0x4808cc][_0x716d('0x87')]]['metric']:_0x592f0d[_0x4808cc][_0x716d('0x60')];_0x48ec9f=_0x592f0d[_0x4808cc][_0x716d('0x69')]?_['replace'](_0x108adf[_0x592f0d[_0x4808cc][_0x716d('0x69')]],'%s',_0x48ec9f):_0x48ec9f;_0x48ec9f=_0x592f0d[_0x4808cc][_0x716d('0x6b')]?_['replace'](_0x2b3c08[_0x592f0d[_0x4808cc][_0x716d('0x6b')]],'%s',_0x48ec9f):_0x48ec9f;if(_0x592f0d[_0x4808cc]['groupBy']){_0x5e9525[_0x716d('0x5f')](_0x48ec9f);}_0x592f0d[_0x4808cc][_0x716d('0x6d')]&&_0x5e9525[_0x716d('0x38')](_0x48ec9f,_0x592f0d[_0x4808cc][_0x716d('0x6d')]===_0x716d('0x6e')?![]:!![]);_0x5e9525[_0x716d('0x60')](_0x48ec9f,_0x592f0d[_0x4808cc][_0x716d('0x6f')]||_0x48ec9f);}if(_0x26342b[_0x716d('0x71')]){_0x26342b[_0x716d('0x71')]=JSON[_0x716d('0x70')](_0x26342b[_0x716d('0x71')]);for(var _0x15278c=0x0;_0x15278c<_0x26342b['joins'][_0x716d('0x35')];_0x15278c+=0x1){if(_0x26342b['joins'][_0x15278c][_0x716d('0x72')]&&_[_0x716d('0x73')](_0x3eab81,_0x26342b[_0x716d('0x71')][_0x15278c]['type'])&&_0x26342b[_0x716d('0x71')][_0x15278c][_0x716d('0x76')]&&_0x26342b[_0x716d('0x71')][_0x15278c][_0x716d('0x74')]&&_0x26342b['joins'][_0x15278c][_0x716d('0x75')]){_0x5e9525[_0x26342b['joins'][_0x15278c][_0x716d('0x72')]](_0x26342b[_0x716d('0x71')][_0x15278c]['foreignTable'],null,util['format'](_0x716d('0x88'),_0x26342b[_0x716d('0x67')],_0x26342b[_0x716d('0x71')][_0x15278c][_0x716d('0x76')],_0x26342b[_0x716d('0x71')][_0x15278c][_0x716d('0x74')],_0x26342b[_0x716d('0x71')][_0x15278c][_0x716d('0x75')]));}}}if(_0x26342b[_0x716d('0x77')]){_0x26342b[_0x716d('0x77')]=JSON[_0x716d('0x70')](_0x26342b['conditions']);_0x5e9525[_0x716d('0x3c')](_0x3a237c(_0x26342b['conditions']['group']));}_0x1c61af=_0x5e9525[_0x716d('0x78')]();_0x5e9525[_0x716d('0x1c')](_0x3784d9);_0x5e9525[_0x716d('0x1a')](0x0);return;}})['then'](function(){if(_0x52c559['output']===_0x716d('0x89')){return null;}var _0x4bb6f5=_[_0x716d('0x3e')](_0x52c559,{'name':_0x52c559['fullPath']||_0x52c559['name']||_0x26342b[_0x716d('0x27')],'basename':_0x119df6,'savename':util[_0x716d('0x6b')](_0x716d('0x8a'),_0x52c559['name']||_0x26342b[_0x716d('0x27')],require(_0x716d('0x8b'))[_0x716d('0x8c')](0x4),_0x52c559[_0x716d('0x8d')]||'csv'),'reportId':_0x26342b['id'],'reportType':_0x716d('0x8e')});return db[_0x716d('0x8f')][_0x716d('0x47')](_0x4bb6f5,{'raw':!![]});})[_0x716d('0x21')](function(_0x3e682c){if(_0x26342b['table']===_0x716d('0x90')){_0x1c61af[_0x716d('0x3c')](_0x26342b['table']+_0x716d('0x91'),_0x52c559['startDate'],_0x52c559[_0x716d('0x92')]);}else{_0x1c61af['where'](_0x26342b[_0x716d('0x67')]+_0x716d('0x93'),_0x52c559['startDate'],_0x52c559[_0x716d('0x92')]);}if(_0x3e682c){logger['info'](_0x716d('0x94'),_0x1c61af[_0x716d('0x7a')]());require(_0x716d('0x95'))[_0x716d('0x96')](path[_0x716d('0x4f')](__dirname,_0x716d('0x97'),_0x3e682c[_0x716d('0x8d')]),[_0x3e682c['id'],_0x1c61af[_0x716d('0x7a')](),path[_0x716d('0x4f')](__dirname,_0x716d('0x98'),_0x3e682c[_0x716d('0x99')]),_0x119df6]);return _0x3e682c;}else{var _0x22bb00=squel[_0x716d('0x65')]();_0x22bb00[_0x716d('0x66')]('('+_0x1c61af['toString']()+')',_0x716d('0x9a'));_0x22bb00[_0x716d('0x60')]('COUNT(*)',_0x716d('0x1d'));_0x1c61af[_0x716d('0x1c')](_0x52c559[_0x716d('0x1c')]||_0x3784d9);_0x1c61af[_0x716d('0x1a')](_0x52c559[_0x716d('0x1a')]||0x0);return dbH[_0x716d('0x7b')]['query'](_0x22bb00[_0x716d('0x7a')](),{'type':dbH[_0x716d('0x7b')][_0x716d('0x9b')][_0x716d('0x7c')]})[_0x716d('0x21')](function(_0x16427b){if(!_0x16427b[_0x716d('0x35')]){_0x3cac10=0x0;}else{_0x3cac10=_0x16427b[0x0][_0x716d('0x1d')]||0x0;}return dbH[_0x716d('0x7b')][_0x716d('0x2e')](_0x1c61af[_0x716d('0x7a')](),{'type':dbH[_0x716d('0x7b')][_0x716d('0x9b')][_0x716d('0x7c')]});})[_0x716d('0x21')](function(_0x53f340){return{'rows':_0x53f340||[],'count':_0x3cac10};});}});}exports[_0x716d('0x9c')]=function(_0x58486a,_0x17ac26){return runReport(_0x58486a[_0x716d('0x44')],_0x58486a[_0x716d('0x2e')],_0x58486a[_0x716d('0x3f')])['then'](respondWithResult(_0x17ac26,null))[_0x716d('0x42')](handleError(_0x17ac26,null));};exports['runReport']=runReport;exports[_0x716d('0x2e')]=function(_0x3ff46c,_0x31ae48){var _0xb21ec8=0xa;var _0x23f891=[_0x716d('0x4f'),'left_join',_0x716d('0x51'),_0x716d('0x52')];var _0x30a456={'SUM':_0x716d('0x7d'),'COUNT':_0x716d('0x7e'),'COUNT DISTINCT':_0x716d('0x53'),'MAX':_0x716d('0x7f'),'MIN':_0x716d('0x54'),'AVG':_0x716d('0x55'),'GROUP_CONCAT':_0x716d('0x80'),'GROUP_CONCAT ASC':_0x716d('0x56'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x2b16d9={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x716d('0x58'),'HOUR':'HOUR(%s)','ROUND':_0x716d('0x83'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x46153b=function(_0x119fec){return!_['includes'](['IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY',_0x716d('0x5c')],_0x119fec);};var _0x483858=function(_0x4a2590){if(!_0x4a2590||!_0x4a2590[_0x716d('0x5d')][_0x716d('0x35')]){return'';}for(var _0xb63953='(',_0x22f00c=0x0;_0x22f00c<_0x4a2590['rules'][_0x716d('0x35')];_0x22f00c+=0x1){_0x22f00c>0x0&&(_0xb63953+='\x20'+_0x4a2590[_0x716d('0x5e')]+'\x20');_0xb63953+=_0x4a2590[_0x716d('0x5d')][_0x22f00c][_0x716d('0x5f')]?_0x483858(_0x4a2590[_0x716d('0x5d')][_0x22f00c][_0x716d('0x5f')]):_0x4a2590[_0x716d('0x5d')][_0x22f00c][_0x716d('0x60')]+'\x20'+_0x4a2590[_0x716d('0x5d')][_0x22f00c][_0x716d('0x61')]+(_0x46153b(_0x4a2590[_0x716d('0x5d')][_0x22f00c][_0x716d('0x61')])?'\x20'+_0x4a2590[_0x716d('0x5d')][_0x22f00c][_0x716d('0x62')]:'');}return _0xb63953+')';};var _0xf75655={'where':{'id':_0x3ff46c['params']['id']}},_0x207eb1,_0x45229e,_0x4f1d7a,_0x371da3,_0x47642b;_0xf75655=_[_0x716d('0x3e')]({},_0xf75655,_0x3ff46c[_0x716d('0x3f')]);return db[_0x716d('0x2b')][_0x716d('0x46')](_0xf75655)[_0x716d('0x21')](function(_0x4a02b0){if(_0x4a02b0){_0x207eb1=_0x4a02b0;return _0x4a02b0['getFields']();}return null;})[_0x716d('0x21')](function(_0x1fac4c){if(_0x1fac4c){if(!_0x1fac4c[_0x716d('0x35')]){throw new db[(_0x716d('0x63'))][(_0x716d('0x9d'))](_0x716d('0x85'),0x193);}_0x45229e=_0x1fac4c;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0x716d('0x21')](function(_0x47d1ed){if(_0x47d1ed){_0x4f1d7a=_['keyBy'](_0x47d1ed,'id');var _0x1f00c6;var _0x46be1b=squel[_0x716d('0x65')]();_0x46be1b[_0x716d('0x66')](_0x207eb1[_0x716d('0x67')]);for(var _0x483c26=0x0;_0x483c26<_0x45229e['length'];_0x483c26+=0x1){_0x1f00c6=_0x45229e[_0x483c26][_0x716d('0x87')]?_0x4f1d7a[_0x45229e[_0x483c26]['MetricId']][_0x716d('0x68')]:_0x45229e[_0x483c26]['field'];_0x1f00c6=_0x45229e[_0x483c26][_0x716d('0x69')]?_[_0x716d('0x6a')](_0x30a456[_0x45229e[_0x483c26][_0x716d('0x69')]],'%s',_0x1f00c6):_0x1f00c6;_0x1f00c6=_0x45229e[_0x483c26]['format']?_[_0x716d('0x6a')](_0x2b16d9[_0x45229e[_0x483c26]['format']],'%s',_0x1f00c6):_0x1f00c6;if(_0x45229e[_0x483c26][_0x716d('0x6c')]){_0x46be1b[_0x716d('0x5f')](_0x1f00c6);}_0x45229e[_0x483c26][_0x716d('0x6d')]&&_0x46be1b[_0x716d('0x38')](_0x1f00c6,_0x45229e[_0x483c26][_0x716d('0x6d')]===_0x716d('0x6e')?![]:!![]);_0x46be1b[_0x716d('0x60')](_0x1f00c6,_0x45229e[_0x483c26][_0x716d('0x6f')]||_0x1f00c6);}if(_0x207eb1[_0x716d('0x71')]){_0x207eb1['joins']=JSON['parse'](_0x207eb1[_0x716d('0x71')]);for(var _0x1b9e49=0x0;_0x1b9e49<_0x207eb1[_0x716d('0x71')]['length'];_0x1b9e49+=0x1){if(_0x207eb1[_0x716d('0x71')][_0x1b9e49][_0x716d('0x72')]&&_['includes'](_0x23f891,_0x207eb1[_0x716d('0x71')][_0x1b9e49][_0x716d('0x72')])&&_0x207eb1[_0x716d('0x71')][_0x1b9e49][_0x716d('0x76')]&&_0x207eb1[_0x716d('0x71')][_0x1b9e49][_0x716d('0x74')]&&_0x207eb1['joins'][_0x1b9e49][_0x716d('0x75')]){_0x46be1b[_0x207eb1['joins'][_0x1b9e49]['type']](_0x207eb1[_0x716d('0x71')][_0x1b9e49][_0x716d('0x74')],null,util[_0x716d('0x6b')](_0x716d('0x88'),_0x207eb1[_0x716d('0x67')],_0x207eb1[_0x716d('0x71')][_0x1b9e49][_0x716d('0x76')],_0x207eb1[_0x716d('0x71')][_0x1b9e49]['foreignTable'],_0x207eb1[_0x716d('0x71')][_0x1b9e49][_0x716d('0x75')]));}}}if(_0x207eb1[_0x716d('0x77')]){_0x207eb1[_0x716d('0x77')]=JSON[_0x716d('0x70')](_0x207eb1['conditions']);_0x46be1b[_0x716d('0x3c')](_0x483858(_0x207eb1[_0x716d('0x77')][_0x716d('0x5f')]));}_0x47642b=_0x46be1b['clone']();_0x46be1b['limit'](_0xb21ec8);_0x46be1b[_0x716d('0x1a')](0x0);logger['debug'](_0x716d('0x9e'),_0x46be1b['toString']());return dbH[_0x716d('0x7b')][_0x716d('0x2e')](_0x46be1b[_0x716d('0x7a')](),{'type':dbH[_0x716d('0x7b')][_0x716d('0x9b')][_0x716d('0x7c')]});}})[_0x716d('0x21')](function(){return{'sql':_0x47642b['toString']()};})[_0x716d('0x21')](respondWithResult(_0x31ae48,null))[_0x716d('0x42')](handleError(_0x31ae48,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index 7417235..89958c3 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 _0xfd56=['./analyticCustomReport.attributes','AnalyticCustomReport','analytics_custom_reports','lodash','moment','path','rimraf','../../config/environment'];(function(_0x2304de,_0x1ba04d){var _0x3922fa=function(_0x2809a5){while(--_0x2809a5){_0x2304de['push'](_0x2304de['shift']());}};_0x3922fa(++_0x1ba04d);}(_0xfd56,0x1bb));var _0x6fd5=function(_0x4af52f,_0x5182b4){_0x4af52f=_0x4af52f-0x0;var _0x3da82e=_0xfd56[_0x4af52f];return _0x3da82e;};'use strict';var _=require(_0x6fd5('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x6fd5('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x6fd5('0x2'));var rimraf=require(_0x6fd5('0x3'));var config=require(_0x6fd5('0x4'));var attributes=require(_0x6fd5('0x5'));module['exports']=function(_0x52e50c,_0x447a50){return _0x52e50c['define'](_0x6fd5('0x6'),attributes,{'tableName':_0x6fd5('0x7'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x568a=['api','moment','request-promise','path','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','define','analytics_custom_reports','util','../../config/logger'];(function(_0x1097d7,_0x1bf6df){var _0x140177=function(_0x5ea0c2){while(--_0x5ea0c2){_0x1097d7['push'](_0x1097d7['shift']());}};_0x140177(++_0x1bf6df);}(_0x568a,0x9a));var _0xa568=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0x568a[_0x36dfbd];return _0x4ecad9;};'use strict';var _=require('lodash');var util=require(_0xa568('0x0'));var logger=require(_0xa568('0x1'))(_0xa568('0x2'));var moment=require(_0xa568('0x3'));var BPromise=require('bluebird');var rp=require(_0xa568('0x4'));var fs=require('fs');var path=require(_0xa568('0x5'));var rimraf=require(_0xa568('0x6'));var config=require(_0xa568('0x7'));var attributes=require(_0xa568('0x8'));module[_0xa568('0x9')]=function(_0x28ba50,_0x1024db){return _0x28ba50[_0xa568('0xa')]('AnalyticCustomReport',attributes,{'tableName':_0xa568('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.rpc.js b/server/api/analyticCustomReport/analyticCustomReport.rpc.js index bac299a..b93d7a9 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 _0xbb68=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird'];(function(_0x785612,_0x44643f){var _0x3e589b=function(_0x283f31){while(--_0x283f31){_0x785612['push'](_0x785612['shift']());}};_0x3e589b(++_0x44643f);}(_0xbb68,0xec));var _0x8bb6=function(_0x25848f,_0x32a708){_0x25848f=_0x25848f-0x0;var _0x454345=_0xbb68[_0x25848f];return _0x454345;};'use strict';var _=require(_0x8bb6('0x0'));var util=require(_0x8bb6('0x1'));var moment=require(_0x8bb6('0x2'));var BPromise=require(_0x8bb6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8bb6('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x8bb6('0x5'));var logger=require(_0x8bb6('0x6'))(_0x8bb6('0x7'));var config=require(_0x8bb6('0x8'));var jayson=require(_0x8bb6('0x9'));var client=jayson['client'][_0x8bb6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4cf731,_0x52b338,_0x5cd37f){return new BPromise(function(_0x4fab3f,_0x1af51e){return client['request'](_0x4cf731,_0x5cd37f)['then'](function(_0x4ab0b5){logger[_0x8bb6('0xb')](_0x8bb6('0xc'),_0x52b338,_0x8bb6('0xd'));logger['debug'](_0x8bb6('0xe'),_0x52b338,_0x8bb6('0xd'),JSON['stringify'](_0x4ab0b5));if(_0x4ab0b5[_0x8bb6('0xf')]){if(_0x4ab0b5[_0x8bb6('0xf')][_0x8bb6('0x10')]===0x1f4){logger[_0x8bb6('0xf')](_0x8bb6('0xc'),_0x52b338,_0x4ab0b5['error'][_0x8bb6('0x11')]);return _0x1af51e(_0x4ab0b5['error'][_0x8bb6('0x11')]);}logger[_0x8bb6('0xf')](_0x8bb6('0xc'),_0x52b338,_0x4ab0b5[_0x8bb6('0xf')][_0x8bb6('0x11')]);return _0x4fab3f(_0x4ab0b5['error']['message']);}else{logger[_0x8bb6('0xb')](_0x8bb6('0xc'),_0x52b338,_0x8bb6('0xd'));_0x4fab3f(_0x4ab0b5[_0x8bb6('0x12')][_0x8bb6('0x11')]);}})[_0x8bb6('0x13')](function(_0xaaf916){logger['error'](_0x8bb6('0xc'),_0x52b338,_0xaaf916);_0x1af51e(_0xaaf916);});});} \ No newline at end of file +var _0xdf79=['request','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x22bd79,_0x1360ed){var _0x5adf74=function(_0x445e38){while(--_0x445e38){_0x22bd79['push'](_0x22bd79['shift']());}};_0x5adf74(++_0x1360ed);}(_0xdf79,0x1ed));var _0x9df7=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xdf79[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x9df7('0x0'));var util=require(_0x9df7('0x1'));var moment=require(_0x9df7('0x2'));var BPromise=require(_0x9df7('0x3'));var rs=require(_0x9df7('0x4'));var fs=require('fs');var Redis=require(_0x9df7('0x5'));var db=require(_0x9df7('0x6'))['db'];var utils=require(_0x9df7('0x7'));var logger=require('../../config/logger')(_0x9df7('0x8'));var config=require(_0x9df7('0x9'));var jayson=require(_0x9df7('0xa'));var client=jayson[_0x9df7('0xb')][_0x9df7('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x119b5b,_0x420b38,_0x4b2de5){return new BPromise(function(_0x402469,_0x6f4787){return client[_0x9df7('0xd')](_0x119b5b,_0x4b2de5)['then'](function(_0x3f83fa){logger[_0x9df7('0xe')](_0x9df7('0xf'),_0x420b38,_0x9df7('0x10'));logger[_0x9df7('0x11')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x420b38,_0x9df7('0x10'),JSON['stringify'](_0x3f83fa));if(_0x3f83fa[_0x9df7('0x12')]){if(_0x3f83fa[_0x9df7('0x12')]['code']===0x1f4){logger['error'](_0x9df7('0xf'),_0x420b38,_0x3f83fa[_0x9df7('0x12')]['message']);return _0x6f4787(_0x3f83fa[_0x9df7('0x12')][_0x9df7('0x13')]);}logger[_0x9df7('0x12')](_0x9df7('0xf'),_0x420b38,_0x3f83fa[_0x9df7('0x12')][_0x9df7('0x13')]);return _0x402469(_0x3f83fa[_0x9df7('0x12')][_0x9df7('0x13')]);}else{logger[_0x9df7('0xe')](_0x9df7('0xf'),_0x420b38,_0x9df7('0x10'));_0x402469(_0x3f83fa[_0x9df7('0x14')]['message']);}})[_0x9df7('0x15')](function(_0x58e198){logger[_0x9df7('0x12')]('AnalyticCustomReport,\x20%s,\x20%s',_0x420b38,_0x58e198);_0x6f4787(_0x58e198);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index 1a79e5c..0879ece 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 _0xcf01=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/preview','preview','run','/:id/query','query','post','put','update','destroy','exports','multer','util','express'];(function(_0x1bffe8,_0xdbe373){var _0x4ab5cd=function(_0x979865){while(--_0x979865){_0x1bffe8['push'](_0x1bffe8['shift']());}};_0x4ab5cd(++_0xdbe373);}(_0xcf01,0xef));var _0x1cf0=function(_0x4bacb6,_0x2b299d){_0x4bacb6=_0x4bacb6-0x0;var _0x58c029=_0xcf01[_0x4bacb6];return _0x58c029;};'use strict';var multer=require(_0x1cf0('0x0'));var util=require(_0x1cf0('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x1cf0('0x2'));var router=express[_0x1cf0('0x3')]();var fs_extra=require(_0x1cf0('0x4'));var auth=require(_0x1cf0('0x5'));var interaction=require(_0x1cf0('0x6'));var config=require(_0x1cf0('0x7'));var controller=require('./analyticCustomReport.controller');router[_0x1cf0('0x8')]('/',auth[_0x1cf0('0x9')](),controller['index']);router[_0x1cf0('0x8')](_0x1cf0('0xa'),auth[_0x1cf0('0x9')](),controller[_0x1cf0('0xb')]);router[_0x1cf0('0x8')](_0x1cf0('0xc'),auth[_0x1cf0('0x9')](),controller[_0x1cf0('0xd')]);router[_0x1cf0('0x8')]('/:id/run',auth[_0x1cf0('0x9')](),controller[_0x1cf0('0xe')]);router['get'](_0x1cf0('0xf'),auth[_0x1cf0('0x9')](),controller[_0x1cf0('0x10')]);router[_0x1cf0('0x11')]('/',auth[_0x1cf0('0x9')](),controller['create']);router[_0x1cf0('0x12')](_0x1cf0('0xa'),auth[_0x1cf0('0x9')](),controller[_0x1cf0('0x13')]);router['delete'](_0x1cf0('0xa'),auth['isAuthenticated'](),controller[_0x1cf0('0x14')]);module[_0x1cf0('0x15')]=router; \ No newline at end of file +var _0x902b=['put','update','destroy','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','isAuthenticated','get','/:id','show','/:id/preview','preview','run','/:id/query','query','post','create'];(function(_0xee2e7a,_0x58354d){var _0x319dd3=function(_0xa99240){while(--_0xa99240){_0xee2e7a['push'](_0xee2e7a['shift']());}};_0x319dd3(++_0x58354d);}(_0x902b,0x121));var _0xb902=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0x902b[_0x36ed48];return _0x51c63a;};'use strict';var multer=require('multer');var util=require(_0xb902('0x0'));var path=require(_0xb902('0x1'));var timeout=require(_0xb902('0x2'));var express=require('express');var router=express[_0xb902('0x3')]();var fs_extra=require(_0xb902('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xb902('0x5'));var config=require(_0xb902('0x6'));var controller=require(_0xb902('0x7'));router['get']('/',auth[_0xb902('0x8')](),controller['index']);router[_0xb902('0x9')](_0xb902('0xa'),auth[_0xb902('0x8')](),controller[_0xb902('0xb')]);router[_0xb902('0x9')](_0xb902('0xc'),auth[_0xb902('0x8')](),controller[_0xb902('0xd')]);router[_0xb902('0x9')]('/:id/run',auth['isAuthenticated'](),controller[_0xb902('0xe')]);router[_0xb902('0x9')](_0xb902('0xf'),auth['isAuthenticated'](),controller[_0xb902('0x10')]);router[_0xb902('0x11')]('/',auth[_0xb902('0x8')](),controller[_0xb902('0x12')]);router[_0xb902('0x13')]('/:id',auth['isAuthenticated'](),controller[_0xb902('0x14')]);router['delete'](_0xb902('0xa'),auth[_0xb902('0x8')](),controller[_0xb902('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index 710bfb2..e8c11f1 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 _0x5d58=['TEXT','STRING'];(function(_0x466ec4,_0x1654d3){var _0x541fa2=function(_0x3a292d){while(--_0x3a292d){_0x466ec4['push'](_0x466ec4['shift']());}};_0x541fa2(++_0x1654d3);}(_0x5d58,0x187));var _0x85d5=function(_0x5f221c,_0x45aaac){_0x5f221c=_0x5f221c-0x0;var _0x2f8046=_0x5d58[_0x5f221c];return _0x2f8046;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0x85d5('0x0')]},'conditions':{'type':Sequelize[_0x85d5('0x1')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x33c5=['STRING','TEXT','exports'];(function(_0x51d7d1,_0x56aaff){var _0x228a87=function(_0x33bb62){while(--_0x33bb62){_0x51d7d1['push'](_0x51d7d1['shift']());}};_0x228a87(++_0x56aaff);}(_0x33c5,0xe6));var _0x533c=function(_0x487ee4,_0x3d3e66){_0x487ee4=_0x487ee4-0x0;var _0x3b0877=_0x33c5[_0x487ee4];return _0x3b0877;};'use strict';var Sequelize=require('sequelize');module[_0x533c('0x0')]={'name':{'type':Sequelize[_0x533c('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x533c('0x1')]},'table':{'type':Sequelize[_0x533c('0x1')]},'conditions':{'type':Sequelize[_0x533c('0x2')]},'joins':{'type':Sequelize[_0x533c('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index 0d8dff3..3060c90 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 _0x6d38=['Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','select','countTable','COUNT(*)','sequelize','run','SEC_TO_TIME(%s)','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','dbH','sendStatus','status','json','offset','undefined','limit','count','Content-Range','save','update','then','get','destroy','error','stack','name','send','index','map','rawAttributes','type','key','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','AnalyticDefaultReport','findAll','rows','show','keys','fields','find','catch','create','body','user','role','Reports','autoAssociation','UserProfileResource','DefaultReports','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','join','right_join','cross_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20EMPTY','rules','operator','group','field','condition','value','getFields','ValidationErrorItem','AnalyticMetric','keyBy','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','alias','joins','parse','parentKey','foreignTable','foreignKey','conditions','clone','debug','toString','QueryTypes','SELECT','left_join','COUNT(DISTINCT\x20%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','DESC','%s.%s\x20=\x20%s.%s','output','web','fullPath','randomstring','generate','csv','default','AnalyticExtractedReport','cdr','startDate','endDate','info'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x6d38,0x1ef));var _0x86d3=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x6d38[_0x21a9d9];return _0x46adce;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x86d3('0x0'));var zipdir=require(_0x86d3('0x1'));var jsonpatch=require(_0x86d3('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x86d3('0x3'));var Mustache=require('mustache');var util=require(_0x86d3('0x4'));var path=require(_0x86d3('0x5'));var sox=require(_0x86d3('0x6'));var csv=require('to-csv');var ejs=require(_0x86d3('0x7'));var fs=require('fs');var fs_extra=require(_0x86d3('0x8'));var _=require(_0x86d3('0x9'));var squel=require(_0x86d3('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x86d3('0xb'));var toCsv=require(_0x86d3('0xc'));var querystring=require(_0x86d3('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x86d3('0xe'));var qs=require(_0x86d3('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x86d3('0x10'))(_0x86d3('0x11'));var utils=require('../../config/utils');var config=require(_0x86d3('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x86d3('0x13'))['db'];var dbH=require(_0x86d3('0x13'))[_0x86d3('0x14')];function respondWithStatusCode(_0x26d64c,_0xe1b3d7){_0xe1b3d7=_0xe1b3d7||0xcc;return function(_0x1b8d0a){if(_0x1b8d0a){return _0x26d64c[_0x86d3('0x15')](_0xe1b3d7);}return _0x26d64c[_0x86d3('0x16')](_0xe1b3d7)['end']();};}function respondWithResult(_0x1c1ba8,_0x1f35cf){_0x1f35cf=_0x1f35cf||0xc8;return function(_0x356e7d){if(_0x356e7d){return _0x1c1ba8[_0x86d3('0x16')](_0x1f35cf)[_0x86d3('0x17')](_0x356e7d);}};}function respondWithFilteredResult(_0x34fb3b,_0x1ff008){return function(_0x44436d){if(_0x44436d){var _0x53b437=typeof _0x1ff008[_0x86d3('0x18')]===_0x86d3('0x19')&&typeof _0x1ff008[_0x86d3('0x1a')]===_0x86d3('0x19');var _0x46feec=_0x44436d[_0x86d3('0x1b')];var _0x33e459=_0x53b437?0x0:_0x1ff008[_0x86d3('0x18')];var _0x9b76f2=_0x53b437?_0x44436d['count']:_0x1ff008[_0x86d3('0x18')]+_0x1ff008['limit'];var _0x6ced9e;if(_0x9b76f2>=_0x46feec){_0x9b76f2=_0x46feec;_0x6ced9e=0xc8;}else{_0x6ced9e=0xce;}_0x34fb3b['status'](_0x6ced9e);return _0x34fb3b['set'](_0x86d3('0x1c'),_0x33e459+'-'+_0x9b76f2+'/'+_0x46feec)[_0x86d3('0x17')](_0x44436d);}return null;};}function patchUpdates(_0x988066){return function(_0x1720ae){try{jsonpatch['apply'](_0x1720ae,_0x988066,!![]);}catch(_0x2901de){return BPromise['reject'](_0x2901de);}return _0x1720ae[_0x86d3('0x1d')]();};}function saveUpdates(_0x3fdf67,_0x1ce849){return function(_0x5b990d){if(_0x5b990d){return _0x5b990d[_0x86d3('0x1e')](_0x3fdf67)[_0x86d3('0x1f')](function(_0x1fa4ac){return _0x1fa4ac;});}return null;};}function removeEntity(_0x4bf5b8,_0x58ba51){return function(_0x26262a){if(_0x26262a){return _0x26262a['destroy']()[_0x86d3('0x1f')](function(){var _0x1bea5e=_0x26262a[_0x86d3('0x20')]({'plain':!![]});var _0x3c5fe4='DefaultReports';return db['UserProfileResource'][_0x86d3('0x21')]({'where':{'type':_0x3c5fe4,'resourceId':_0x1bea5e['id']}})[_0x86d3('0x1f')](function(){return _0x26262a;});})['then'](function(){_0x4bf5b8[_0x86d3('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x42413c,_0x41e2f0){return function(_0x287b96){if(!_0x287b96){_0x42413c[_0x86d3('0x15')](0x194);}return _0x287b96;};}function handleError(_0x11a6fd,_0x14c9ff){_0x14c9ff=_0x14c9ff||0x1f4;return function(_0x1f203e){logger[_0x86d3('0x22')](_0x1f203e[_0x86d3('0x23')]);if(_0x1f203e[_0x86d3('0x24')]){delete _0x1f203e[_0x86d3('0x24')];}_0x11a6fd[_0x86d3('0x16')](_0x14c9ff)[_0x86d3('0x25')](_0x1f203e);};}exports[_0x86d3('0x26')]=function(_0x5b09f6,_0x120a0c){var _0x403be3={},_0x2bda35={},_0x31cefe={'count':0x0,'rows':[]};var _0x7709f0=_[_0x86d3('0x27')](db['AnalyticDefaultReport'][_0x86d3('0x28')],function(_0x5c71df){return{'name':_0x5c71df['fieldName'],'type':_0x5c71df[_0x86d3('0x29')][_0x86d3('0x2a')]};});_0x2bda35[_0x86d3('0x2b')]=_['map'](_0x7709f0,_0x86d3('0x24'));_0x2bda35[_0x86d3('0x2c')]=_['keys'](_0x5b09f6[_0x86d3('0x2c')]);_0x2bda35[_0x86d3('0x2d')]=_[_0x86d3('0x2e')](_0x2bda35[_0x86d3('0x2b')],_0x2bda35[_0x86d3('0x2c')]);_0x403be3[_0x86d3('0x2f')]=_[_0x86d3('0x2e')](_0x2bda35[_0x86d3('0x2b')],qs['fields'](_0x5b09f6['query']['fields']));_0x403be3[_0x86d3('0x2f')]=_0x403be3['attributes'][_0x86d3('0x30')]?_0x403be3['attributes']:_0x2bda35[_0x86d3('0x2b')];if(!_0x5b09f6[_0x86d3('0x2c')][_0x86d3('0x31')](_0x86d3('0x32'))){_0x403be3[_0x86d3('0x1a')]=qs[_0x86d3('0x1a')](_0x5b09f6[_0x86d3('0x2c')]['limit']);_0x403be3[_0x86d3('0x18')]=qs[_0x86d3('0x18')](_0x5b09f6['query'][_0x86d3('0x18')]);}_0x403be3[_0x86d3('0x33')]=qs[_0x86d3('0x34')](_0x5b09f6[_0x86d3('0x2c')]['sort']);_0x403be3[_0x86d3('0x35')]=qs[_0x86d3('0x2d')](_[_0x86d3('0x36')](_0x5b09f6['query'],_0x2bda35[_0x86d3('0x2d')]),_0x7709f0);if(_0x5b09f6[_0x86d3('0x2c')][_0x86d3('0x37')]){_0x403be3[_0x86d3('0x35')]=_[_0x86d3('0x38')](_0x403be3[_0x86d3('0x35')],{'$or':_[_0x86d3('0x27')](_0x7709f0,function(_0x436065){if(_0x436065['type']!==_0x86d3('0x39')){var _0x470978={};_0x470978[_0x436065[_0x86d3('0x24')]]={'$like':'%'+_0x5b09f6[_0x86d3('0x2c')]['filter']+'%'};return _0x470978;}})});}_0x403be3=_[_0x86d3('0x38')]({},_0x403be3,_0x5b09f6[_0x86d3('0x3a')]);var _0x6f72be={'where':_0x403be3[_0x86d3('0x35')]};return db['AnalyticDefaultReport']['count'](_0x6f72be)[_0x86d3('0x1f')](function(_0x4f422b){_0x31cefe['count']=_0x4f422b;if(_0x5b09f6[_0x86d3('0x2c')][_0x86d3('0x3b')]){_0x403be3[_0x86d3('0x3c')]=[{'all':!![]}];}return db[_0x86d3('0x3d')][_0x86d3('0x3e')](_0x403be3);})['then'](function(_0x2a5f6c){_0x31cefe[_0x86d3('0x3f')]=_0x2a5f6c;return _0x31cefe;})[_0x86d3('0x1f')](respondWithFilteredResult(_0x120a0c,_0x403be3))['catch'](handleError(_0x120a0c,null));};exports[_0x86d3('0x40')]=function(_0x810d10,_0x5dfae8){var _0x369f68={'raw':!![],'where':{'id':_0x810d10['params']['id']}},_0xcf6c9e={};_0xcf6c9e['model']=_['keys'](db[_0x86d3('0x3d')][_0x86d3('0x28')]);_0xcf6c9e[_0x86d3('0x2c')]=_[_0x86d3('0x41')](_0x810d10[_0x86d3('0x2c')]);_0xcf6c9e[_0x86d3('0x2d')]=_['intersection'](_0xcf6c9e[_0x86d3('0x2b')],_0xcf6c9e[_0x86d3('0x2c')]);_0x369f68['attributes']=_[_0x86d3('0x2e')](_0xcf6c9e[_0x86d3('0x2b')],qs[_0x86d3('0x42')](_0x810d10[_0x86d3('0x2c')][_0x86d3('0x42')]));_0x369f68[_0x86d3('0x2f')]=_0x369f68['attributes'][_0x86d3('0x30')]?_0x369f68[_0x86d3('0x2f')]:_0xcf6c9e['model'];if(_0x810d10[_0x86d3('0x2c')][_0x86d3('0x3b')]){_0x369f68[_0x86d3('0x3c')]=[{'all':!![]}];}_0x369f68=_[_0x86d3('0x38')]({},_0x369f68,_0x810d10[_0x86d3('0x3a')]);return db['AnalyticDefaultReport'][_0x86d3('0x43')](_0x369f68)[_0x86d3('0x1f')](handleEntityNotFound(_0x5dfae8,null))[_0x86d3('0x1f')](respondWithResult(_0x5dfae8,null))[_0x86d3('0x44')](handleError(_0x5dfae8,null));};exports[_0x86d3('0x45')]=function(_0x7af7b3,_0x1a4345){return db[_0x86d3('0x3d')][_0x86d3('0x45')](_0x7af7b3[_0x86d3('0x46')],{})[_0x86d3('0x1f')](function(_0x1236ea){var _0x4ea940=_0x7af7b3[_0x86d3('0x47')][_0x86d3('0x20')]({'plain':!![]});if(!_0x4ea940)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4ea940[_0x86d3('0x48')]===_0x86d3('0x47')){var _0x197047=_0x1236ea[_0x86d3('0x20')]({'plain':!![]});var _0x1dcff0=_0x86d3('0x49');return db['UserProfileSection']['find']({'where':{'name':_0x1dcff0,'userProfileId':_0x4ea940['userProfileId']},'raw':!![]})['then'](function(_0x159253){if(_0x159253&&_0x159253[_0x86d3('0x4a')]===0x0){return db[_0x86d3('0x4b')][_0x86d3('0x45')]({'name':_0x197047[_0x86d3('0x24')],'resourceId':_0x197047['id'],'type':_0x86d3('0x4c'),'sectionId':_0x159253['id']},{})[_0x86d3('0x1f')](function(){return _0x1236ea;});}else{return _0x1236ea;}})['catch'](function(_0x2afb07){logger[_0x86d3('0x22')](_0x86d3('0x4d'),_0x2afb07);throw _0x2afb07;});}return _0x1236ea;})[_0x86d3('0x1f')](respondWithResult(_0x1a4345,0xc9))[_0x86d3('0x44')](handleError(_0x1a4345,null));};exports[_0x86d3('0x1e')]=function(_0x34935f,_0x4c8828){if(_0x34935f[_0x86d3('0x46')]['id']){delete _0x34935f['body']['id'];}return db[_0x86d3('0x3d')][_0x86d3('0x43')]({'where':{'id':_0x34935f[_0x86d3('0x4e')]['id']}})[_0x86d3('0x1f')](handleEntityNotFound(_0x4c8828,null))[_0x86d3('0x1f')](saveUpdates(_0x34935f['body'],null))[_0x86d3('0x1f')](respondWithResult(_0x4c8828,null))[_0x86d3('0x44')](handleError(_0x4c8828,null));};exports[_0x86d3('0x21')]=function(_0x4e10d9,_0x4ad164){return db['AnalyticDefaultReport'][_0x86d3('0x43')]({'where':{'id':_0x4e10d9['params']['id']}})[_0x86d3('0x1f')](handleEntityNotFound(_0x4ad164,null))[_0x86d3('0x1f')](removeEntity(_0x4ad164,null))[_0x86d3('0x44')](handleError(_0x4ad164,null));};exports[_0x86d3('0x4f')]=function(_0x5963bb,_0x4cd835){var _0x551806=0xa;var _0x28655a=[_0x86d3('0x50'),'left_join',_0x86d3('0x51'),_0x86d3('0x52')];var _0xa085b2={'SUM':_0x86d3('0x53'),'COUNT':_0x86d3('0x54'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x86d3('0x55'),'MIN':_0x86d3('0x56'),'AVG':_0x86d3('0x57'),'GROUP_CONCAT':_0x86d3('0x58'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x86d3('0x59')};var _0x41fad7={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x86d3('0x5a'),'HOUR':_0x86d3('0x5b'),'ROUND':_0x86d3('0x5c'),'UNIX_TIMESTAMP':_0x86d3('0x5d')};var _0x4598d4=function(_0x4029a4){return!_[_0x86d3('0x5e')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x86d3('0x5f'),'IS\x20NOT\x20EMPTY'],_0x4029a4);};var _0x528ca8=function(_0x58e4b6){if(!_0x58e4b6||!_0x58e4b6[_0x86d3('0x60')]['length']){return'';}for(var _0x254ac3='(',_0x5f2ed6=0x0;_0x5f2ed6<_0x58e4b6[_0x86d3('0x60')][_0x86d3('0x30')];_0x5f2ed6+=0x1){_0x5f2ed6>0x0&&(_0x254ac3+='\x20'+_0x58e4b6[_0x86d3('0x61')]+'\x20');_0x254ac3+=_0x58e4b6['rules'][_0x5f2ed6]['group']?_0x528ca8(_0x58e4b6[_0x86d3('0x60')][_0x5f2ed6][_0x86d3('0x62')]):_0x58e4b6[_0x86d3('0x60')][_0x5f2ed6][_0x86d3('0x63')]+'\x20'+_0x58e4b6[_0x86d3('0x60')][_0x5f2ed6][_0x86d3('0x64')]+(_0x4598d4(_0x58e4b6[_0x86d3('0x60')][_0x5f2ed6][_0x86d3('0x64')])?'\x20'+_0x58e4b6[_0x86d3('0x60')][_0x5f2ed6][_0x86d3('0x65')]:'');}return _0x254ac3+')';};var _0x1e3479={'where':{'id':_0x5963bb[_0x86d3('0x4e')]['id']}},_0x265beb,_0xfaf168,_0xf0dbbb,_0x3f978c,_0x5e1835;_0x1e3479=_[_0x86d3('0x38')]({},_0x1e3479,_0x5963bb['options']);return db[_0x86d3('0x3d')][_0x86d3('0x43')](_0x1e3479)[_0x86d3('0x1f')](function(_0x52dc99){if(_0x52dc99){_0x265beb=_0x52dc99;return _0x52dc99[_0x86d3('0x66')]();}return null;})[_0x86d3('0x1f')](function(_0x45e8d9){if(_0x45e8d9){if(!_0x45e8d9[_0x86d3('0x30')]){throw new db['Sequelize'][(_0x86d3('0x67'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0xfaf168=_0x45e8d9;return db[_0x86d3('0x68')][_0x86d3('0x3e')]({'raw':!![]});}return null;})[_0x86d3('0x1f')](function(_0x2d4bc1){if(_0x2d4bc1){_0xf0dbbb=_[_0x86d3('0x69')](_0x2d4bc1,'id');var _0x56fd96;var _0x3cc1d8=squel['select']();_0x3cc1d8[_0x86d3('0x6a')](_0x265beb[_0x86d3('0x6b')]);for(var _0x5866fe=0x0;_0x5866fe<_0xfaf168[_0x86d3('0x30')];_0x5866fe+=0x1){_0x56fd96=_0xfaf168[_0x5866fe][_0x86d3('0x6c')]?_0xf0dbbb[_0xfaf168[_0x5866fe][_0x86d3('0x6c')]][_0x86d3('0x6d')]:_0xfaf168[_0x5866fe][_0x86d3('0x63')];_0x56fd96=_0xfaf168[_0x5866fe][_0x86d3('0x6e')]?_[_0x86d3('0x6f')](_0xa085b2[_0xfaf168[_0x5866fe]['function']],'%s',_0x56fd96):_0x56fd96;_0x56fd96=_0xfaf168[_0x5866fe][_0x86d3('0x70')]?_[_0x86d3('0x6f')](_0x41fad7[_0xfaf168[_0x5866fe][_0x86d3('0x70')]],'%s',_0x56fd96):_0x56fd96;if(_0xfaf168[_0x5866fe][_0x86d3('0x71')]){_0x3cc1d8[_0x86d3('0x62')](_0x56fd96);}_0xfaf168[_0x5866fe]['orderBy']&&_0x3cc1d8[_0x86d3('0x33')](_0x56fd96,_0xfaf168[_0x5866fe][_0x86d3('0x72')]==='DESC'?![]:!![]);_0x3cc1d8[_0x86d3('0x63')](_0x56fd96,_0xfaf168[_0x5866fe][_0x86d3('0x73')]||_0x56fd96);}if(_0x265beb[_0x86d3('0x74')]){_0x265beb[_0x86d3('0x74')]=JSON[_0x86d3('0x75')](_0x265beb[_0x86d3('0x74')]);for(var _0x1bf5ba=0x0;_0x1bf5ba<_0x265beb[_0x86d3('0x74')][_0x86d3('0x30')];_0x1bf5ba+=0x1){if(_0x265beb[_0x86d3('0x74')][_0x1bf5ba][_0x86d3('0x29')]&&_[_0x86d3('0x5e')](_0x28655a,_0x265beb[_0x86d3('0x74')][_0x1bf5ba][_0x86d3('0x29')])&&_0x265beb['joins'][_0x1bf5ba][_0x86d3('0x76')]&&_0x265beb[_0x86d3('0x74')][_0x1bf5ba][_0x86d3('0x77')]&&_0x265beb[_0x86d3('0x74')][_0x1bf5ba]['foreignKey']){_0x3cc1d8[_0x265beb[_0x86d3('0x74')][_0x1bf5ba][_0x86d3('0x29')]](_0x265beb[_0x86d3('0x74')][_0x1bf5ba][_0x86d3('0x77')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x265beb[_0x86d3('0x6b')],_0x265beb['joins'][_0x1bf5ba][_0x86d3('0x76')],_0x265beb['joins'][_0x1bf5ba]['foreignTable'],_0x265beb[_0x86d3('0x74')][_0x1bf5ba][_0x86d3('0x78')]));}}}if(_0x265beb[_0x86d3('0x79')]){_0x265beb[_0x86d3('0x79')]=JSON[_0x86d3('0x75')](_0x265beb['conditions']);_0x3cc1d8[_0x86d3('0x35')](_0x528ca8(_0x265beb[_0x86d3('0x79')]['group']));}_0x5e1835=_0x3cc1d8[_0x86d3('0x7a')]();_0x3cc1d8[_0x86d3('0x1a')](_0x551806);_0x3cc1d8['offset'](0x0);logger[_0x86d3('0x7b')]('Limited\x20Query:',_0x3cc1d8[_0x86d3('0x7c')]());return dbH['sequelize']['query'](_0x3cc1d8[_0x86d3('0x7c')](),{'type':dbH['sequelize'][_0x86d3('0x7d')][_0x86d3('0x7e')]});}})[_0x86d3('0x1f')](respondWithResult(_0x4cd835,null))[_0x86d3('0x44')](handleError(_0x4cd835,null));};function runReport(_0x3193d5,_0x3a1acc,_0x268c93){var _0x3b989c=_0x3a1acc['name'];var _0x245b39=0xa;var _0x158f56=[_0x86d3('0x50'),_0x86d3('0x7f'),_0x86d3('0x51'),'cross_join'];var _0x3d8b35={'SUM':_0x86d3('0x53'),'COUNT':_0x86d3('0x54'),'COUNT DISTINCT':_0x86d3('0x80'),'MAX':_0x86d3('0x55'),'MIN':_0x86d3('0x56'),'AVG':_0x86d3('0x57'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x86d3('0x81'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0xca2e0={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x86d3('0x5b'),'ROUND':_0x86d3('0x5c'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1b503a=function(_0x24410c){return!_[_0x86d3('0x5e')]([_0x86d3('0x82'),_0x86d3('0x83'),_0x86d3('0x5f'),_0x86d3('0x84')],_0x24410c);};var _0x5f4a38=function(_0x593b85){if(!_0x593b85||!_0x593b85[_0x86d3('0x60')][_0x86d3('0x30')]){return'';}for(var _0x3fac94='(',_0x28d98e=0x0;_0x28d98e<_0x593b85[_0x86d3('0x60')][_0x86d3('0x30')];_0x28d98e+=0x1){_0x28d98e>0x0&&(_0x3fac94+='\x20'+_0x593b85['operator']+'\x20');_0x3fac94+=_0x593b85[_0x86d3('0x60')][_0x28d98e][_0x86d3('0x62')]?_0x5f4a38(_0x593b85[_0x86d3('0x60')][_0x28d98e][_0x86d3('0x62')]):_0x593b85[_0x86d3('0x60')][_0x28d98e][_0x86d3('0x63')]+'\x20'+_0x593b85[_0x86d3('0x60')][_0x28d98e][_0x86d3('0x64')]+(_0x1b503a(_0x593b85[_0x86d3('0x60')][_0x28d98e]['condition'])?'\x20'+_0x593b85[_0x86d3('0x60')][_0x28d98e][_0x86d3('0x65')]:'');}return _0x3fac94+')';};var _0x4b871b={'where':{'id':_0x3193d5['id']}},_0x584a57,_0x36ee46,_0x1cbc3a,_0x682a6d,_0x5004cd;_0x4b871b=_[_0x86d3('0x38')]({},_0x4b871b,_0x268c93);return db[_0x86d3('0x3d')][_0x86d3('0x43')](_0x4b871b)[_0x86d3('0x1f')](function(_0x3d3e7f){if(_0x3d3e7f){_0x584a57=_0x3d3e7f;return _0x3d3e7f['getFields']();}return null;})[_0x86d3('0x1f')](function(_0x1aaf08){if(_0x1aaf08){if(!_0x1aaf08['length']){throw new db[(_0x86d3('0x85'))][(_0x86d3('0x67'))](_0x86d3('0x86'),0x193);}_0x36ee46=_0x1aaf08;return db[_0x86d3('0x68')]['findAll']({'raw':!![]});}return null;})[_0x86d3('0x1f')](function(_0x2896e1){if(_0x2896e1){_0x1cbc3a=_[_0x86d3('0x69')](_0x2896e1,'id');var _0x18295c;var _0x44af1c=squel['select']();_0x44af1c[_0x86d3('0x6a')](_0x584a57[_0x86d3('0x6b')]);for(var _0x3582a2=0x0;_0x3582a2<_0x36ee46[_0x86d3('0x30')];_0x3582a2+=0x1){_0x18295c=_0x36ee46[_0x3582a2][_0x86d3('0x6c')]?_0x1cbc3a[_0x36ee46[_0x3582a2][_0x86d3('0x6c')]][_0x86d3('0x6d')]:_0x36ee46[_0x3582a2][_0x86d3('0x63')];_0x18295c=_0x36ee46[_0x3582a2][_0x86d3('0x6e')]?_[_0x86d3('0x6f')](_0x3d8b35[_0x36ee46[_0x3582a2]['function']],'%s',_0x18295c):_0x18295c;_0x18295c=_0x36ee46[_0x3582a2]['format']?_[_0x86d3('0x6f')](_0xca2e0[_0x36ee46[_0x3582a2][_0x86d3('0x70')]],'%s',_0x18295c):_0x18295c;if(_0x36ee46[_0x3582a2]['groupBy']){_0x44af1c[_0x86d3('0x62')](_0x18295c);}_0x36ee46[_0x3582a2][_0x86d3('0x72')]&&_0x44af1c[_0x86d3('0x33')](_0x18295c,_0x36ee46[_0x3582a2][_0x86d3('0x72')]===_0x86d3('0x87')?![]:!![]);_0x44af1c[_0x86d3('0x63')](_0x18295c,_0x36ee46[_0x3582a2][_0x86d3('0x73')]||_0x18295c);}if(_0x584a57[_0x86d3('0x74')]){_0x584a57[_0x86d3('0x74')]=JSON['parse'](_0x584a57['joins']);for(var _0x48a6d7=0x0;_0x48a6d7<_0x584a57['joins'][_0x86d3('0x30')];_0x48a6d7+=0x1){if(_0x584a57[_0x86d3('0x74')][_0x48a6d7][_0x86d3('0x29')]&&_[_0x86d3('0x5e')](_0x158f56,_0x584a57[_0x86d3('0x74')][_0x48a6d7][_0x86d3('0x29')])&&_0x584a57[_0x86d3('0x74')][_0x48a6d7]['parentKey']&&_0x584a57[_0x86d3('0x74')][_0x48a6d7][_0x86d3('0x77')]&&_0x584a57[_0x86d3('0x74')][_0x48a6d7][_0x86d3('0x78')]){_0x44af1c[_0x584a57['joins'][_0x48a6d7][_0x86d3('0x29')]](_0x584a57['joins'][_0x48a6d7][_0x86d3('0x77')],null,util[_0x86d3('0x70')](_0x86d3('0x88'),_0x584a57[_0x86d3('0x6b')],_0x584a57[_0x86d3('0x74')][_0x48a6d7]['parentKey'],_0x584a57['joins'][_0x48a6d7][_0x86d3('0x77')],_0x584a57['joins'][_0x48a6d7][_0x86d3('0x78')]));}}}if(_0x584a57['conditions']){_0x584a57[_0x86d3('0x79')]=JSON['parse'](_0x584a57['conditions']);_0x44af1c[_0x86d3('0x35')](_0x5f4a38(_0x584a57[_0x86d3('0x79')][_0x86d3('0x62')]));}_0x5004cd=_0x44af1c[_0x86d3('0x7a')]();_0x44af1c[_0x86d3('0x1a')](_0x245b39);_0x44af1c[_0x86d3('0x18')](0x0);return;}})[_0x86d3('0x1f')](function(){if(_0x3a1acc[_0x86d3('0x89')]===_0x86d3('0x8a')){return null;}var _0x120a85=_[_0x86d3('0x38')](_0x3a1acc,{'name':_0x3a1acc[_0x86d3('0x8b')]||_0x3a1acc[_0x86d3('0x24')]||_0x584a57[_0x86d3('0x24')],'basename':_0x3b989c,'savename':util[_0x86d3('0x70')]('%s-%s.%s',_0x3a1acc['name']||_0x584a57['name'],require(_0x86d3('0x8c'))[_0x86d3('0x8d')](0x4),_0x3a1acc[_0x86d3('0x89')]||_0x86d3('0x8e')),'reportId':_0x584a57['id'],'reportType':_0x86d3('0x8f')});return db[_0x86d3('0x90')][_0x86d3('0x45')](_0x120a85,{'raw':!![]});})[_0x86d3('0x1f')](function(_0x10e23d){if(_0x584a57[_0x86d3('0x6b')]===_0x86d3('0x91')){_0x5004cd['where'](_0x584a57[_0x86d3('0x6b')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x3a1acc[_0x86d3('0x92')],_0x3a1acc[_0x86d3('0x93')]);}else{_0x5004cd[_0x86d3('0x35')](_0x584a57[_0x86d3('0x6b')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x3a1acc[_0x86d3('0x92')],_0x3a1acc[_0x86d3('0x93')]);}if(_0x10e23d){logger[_0x86d3('0x94')](_0x86d3('0x95'),_0x5004cd[_0x86d3('0x7c')]());require(_0x86d3('0x96'))[_0x86d3('0x97')](path[_0x86d3('0x50')](__dirname,_0x86d3('0x98'),_0x10e23d[_0x86d3('0x89')]),[_0x10e23d['id'],_0x5004cd[_0x86d3('0x7c')](),path[_0x86d3('0x50')](__dirname,_0x86d3('0x99'),_0x10e23d[_0x86d3('0x9a')]),_0x3b989c]);return _0x10e23d;}else{var _0x428b11=squel[_0x86d3('0x9b')]();_0x428b11[_0x86d3('0x6a')]('('+_0x5004cd['toString']()+')',_0x86d3('0x9c'));_0x428b11[_0x86d3('0x63')](_0x86d3('0x9d'),_0x86d3('0x1b'));_0x5004cd['limit'](_0x3a1acc[_0x86d3('0x1a')]||_0x245b39);_0x5004cd['offset'](_0x3a1acc['offset']||0x0);return dbH[_0x86d3('0x9e')][_0x86d3('0x2c')](_0x428b11[_0x86d3('0x7c')](),{'type':dbH[_0x86d3('0x9e')][_0x86d3('0x7d')][_0x86d3('0x7e')]})[_0x86d3('0x1f')](function(_0x4777f1){if(!_0x4777f1['length']){_0x682a6d=0x0;}else{_0x682a6d=_0x4777f1[0x0]['count']||0x0;}return dbH['sequelize'][_0x86d3('0x2c')](_0x5004cd[_0x86d3('0x7c')](),{'type':dbH[_0x86d3('0x9e')]['QueryTypes'][_0x86d3('0x7e')]});})['then'](function(_0x435b8e){return{'rows':_0x435b8e||[],'count':_0x682a6d};});}});}exports[_0x86d3('0x9f')]=function(_0x73b8e6,_0x2c98e1){return runReport(_0x73b8e6['params'],_0x73b8e6[_0x86d3('0x2c')],_0x73b8e6[_0x86d3('0x3a')])[_0x86d3('0x1f')](respondWithResult(_0x2c98e1,null))['catch'](handleError(_0x2c98e1,null));};exports['runReport']=runReport;exports['query']=function(_0x458997,_0x1e3559){var _0x49a101=0xa;var _0x38d724=['join',_0x86d3('0x7f'),_0x86d3('0x51'),_0x86d3('0x52')];var _0x56ff91={'SUM':_0x86d3('0x53'),'COUNT':_0x86d3('0x54'),'COUNT DISTINCT':_0x86d3('0x80'),'MAX':_0x86d3('0x55'),'MIN':_0x86d3('0x56'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x86d3('0x58'),'GROUP_CONCAT ASC':_0x86d3('0x81'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x1f347e={'SEC_TO_TIME':_0x86d3('0xa0'),'DATE':'DATE(%s)','HOUR':_0x86d3('0x5b'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x45b210=function(_0x144e43){return!_[_0x86d3('0x5e')]([_0x86d3('0x82'),_0x86d3('0x83'),_0x86d3('0x5f'),_0x86d3('0x84')],_0x144e43);};var _0xdc7c21=function(_0x2e0397){if(!_0x2e0397||!_0x2e0397[_0x86d3('0x60')][_0x86d3('0x30')]){return'';}for(var _0x2cc617='(',_0x25339c=0x0;_0x25339c<_0x2e0397['rules'][_0x86d3('0x30')];_0x25339c+=0x1){_0x25339c>0x0&&(_0x2cc617+='\x20'+_0x2e0397[_0x86d3('0x61')]+'\x20');_0x2cc617+=_0x2e0397[_0x86d3('0x60')][_0x25339c][_0x86d3('0x62')]?_0xdc7c21(_0x2e0397[_0x86d3('0x60')][_0x25339c][_0x86d3('0x62')]):_0x2e0397['rules'][_0x25339c][_0x86d3('0x63')]+'\x20'+_0x2e0397['rules'][_0x25339c][_0x86d3('0x64')]+(_0x45b210(_0x2e0397[_0x86d3('0x60')][_0x25339c]['condition'])?'\x20'+_0x2e0397['rules'][_0x25339c][_0x86d3('0x65')]:'');}return _0x2cc617+')';};var _0x2c0070={'where':{'id':_0x458997[_0x86d3('0x4e')]['id']}},_0x31d436,_0x56e713,_0x525559,_0x3b9e1e,_0x1d8d7c;_0x2c0070=_['merge']({},_0x2c0070,_0x458997[_0x86d3('0x3a')]);return db[_0x86d3('0x3d')][_0x86d3('0x43')](_0x2c0070)[_0x86d3('0x1f')](function(_0x1f80be){if(_0x1f80be){_0x31d436=_0x1f80be;return _0x1f80be[_0x86d3('0x66')]();}return null;})[_0x86d3('0x1f')](function(_0x3dddbe){if(_0x3dddbe){if(!_0x3dddbe[_0x86d3('0x30')]){throw new db[(_0x86d3('0x85'))][(_0x86d3('0x67'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x56e713=_0x3dddbe;return db[_0x86d3('0x68')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x1d7e83){if(_0x1d7e83){_0x525559=_[_0x86d3('0x69')](_0x1d7e83,'id');var _0x5d9385;var _0x49a499=squel[_0x86d3('0x9b')]();_0x49a499[_0x86d3('0x6a')](_0x31d436[_0x86d3('0x6b')]);for(var _0x33e0a5=0x0;_0x33e0a5<_0x56e713['length'];_0x33e0a5+=0x1){_0x5d9385=_0x56e713[_0x33e0a5][_0x86d3('0x6c')]?_0x525559[_0x56e713[_0x33e0a5][_0x86d3('0x6c')]][_0x86d3('0x6d')]:_0x56e713[_0x33e0a5][_0x86d3('0x63')];_0x5d9385=_0x56e713[_0x33e0a5][_0x86d3('0x6e')]?_['replace'](_0x56ff91[_0x56e713[_0x33e0a5][_0x86d3('0x6e')]],'%s',_0x5d9385):_0x5d9385;_0x5d9385=_0x56e713[_0x33e0a5][_0x86d3('0x70')]?_[_0x86d3('0x6f')](_0x1f347e[_0x56e713[_0x33e0a5]['format']],'%s',_0x5d9385):_0x5d9385;if(_0x56e713[_0x33e0a5][_0x86d3('0x71')]){_0x49a499['group'](_0x5d9385);}_0x56e713[_0x33e0a5][_0x86d3('0x72')]&&_0x49a499[_0x86d3('0x33')](_0x5d9385,_0x56e713[_0x33e0a5]['orderBy']===_0x86d3('0x87')?![]:!![]);_0x49a499[_0x86d3('0x63')](_0x5d9385,_0x56e713[_0x33e0a5][_0x86d3('0x73')]||_0x5d9385);}if(_0x31d436[_0x86d3('0x74')]){_0x31d436[_0x86d3('0x74')]=JSON[_0x86d3('0x75')](_0x31d436['joins']);for(var _0x10af91=0x0;_0x10af91<_0x31d436['joins'][_0x86d3('0x30')];_0x10af91+=0x1){if(_0x31d436[_0x86d3('0x74')][_0x10af91][_0x86d3('0x29')]&&_[_0x86d3('0x5e')](_0x38d724,_0x31d436['joins'][_0x10af91][_0x86d3('0x29')])&&_0x31d436[_0x86d3('0x74')][_0x10af91][_0x86d3('0x76')]&&_0x31d436[_0x86d3('0x74')][_0x10af91][_0x86d3('0x77')]&&_0x31d436[_0x86d3('0x74')][_0x10af91]['foreignKey']){_0x49a499[_0x31d436[_0x86d3('0x74')][_0x10af91][_0x86d3('0x29')]](_0x31d436['joins'][_0x10af91]['foreignTable'],null,util[_0x86d3('0x70')]('%s.%s\x20=\x20%s.%s',_0x31d436['table'],_0x31d436[_0x86d3('0x74')][_0x10af91][_0x86d3('0x76')],_0x31d436[_0x86d3('0x74')][_0x10af91]['foreignTable'],_0x31d436[_0x86d3('0x74')][_0x10af91][_0x86d3('0x78')]));}}}if(_0x31d436[_0x86d3('0x79')]){_0x31d436[_0x86d3('0x79')]=JSON[_0x86d3('0x75')](_0x31d436['conditions']);_0x49a499[_0x86d3('0x35')](_0xdc7c21(_0x31d436[_0x86d3('0x79')]['group']));}_0x1d8d7c=_0x49a499['clone']();_0x49a499['limit'](_0x49a101);_0x49a499[_0x86d3('0x18')](0x0);logger['debug']('Limited\x20Query:',_0x49a499[_0x86d3('0x7c')]());return dbH[_0x86d3('0x9e')]['query'](_0x49a499['toString'](),{'type':dbH[_0x86d3('0x9e')][_0x86d3('0x7d')][_0x86d3('0x7e')]});}})['then'](function(){return{'sql':_0x1d8d7c[_0x86d3('0x7c')]()};})[_0x86d3('0x1f')](respondWithResult(_0x1e3559,null))[_0x86d3('0x44')](handleError(_0x1e3559,null));}; \ No newline at end of file +var _0x1967=['conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','SUM(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','IS\x20NOT\x20NULL','table','web','%s-%s.%s','randomstring','output','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','runReport','select','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','update','then','destroy','get','stack','name','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','findAll','rows','show','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','DefaultReports','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','join','left_join','right_join','cross_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','from','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','foreignTable','%s.%s\x20=\x20%s.%s','parentKey','foreignKey'];(function(_0x916778,_0x1ea50f){var _0xcf2eae=function(_0x342e58){while(--_0x342e58){_0x916778['push'](_0x916778['shift']());}};_0xcf2eae(++_0x1ea50f);}(_0x1967,0x173));var _0x7196=function(_0x317bba,_0x5c6d0f){_0x317bba=_0x317bba-0x0;var _0x9396e6=_0x1967[_0x317bba];return _0x9396e6;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7196('0x0'));var zipdir=require(_0x7196('0x1'));var jsonpatch=require(_0x7196('0x2'));var rp=require(_0x7196('0x3'));var moment=require(_0x7196('0x4'));var BPromise=require(_0x7196('0x5'));var Mustache=require(_0x7196('0x6'));var util=require(_0x7196('0x7'));var path=require(_0x7196('0x8'));var sox=require(_0x7196('0x9'));var csv=require('to-csv');var ejs=require(_0x7196('0xa'));var fs=require('fs');var fs_extra=require(_0x7196('0xb'));var _=require(_0x7196('0xc'));var squel=require(_0x7196('0xd'));var crypto=require(_0x7196('0xe'));var jsforce=require(_0x7196('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x7196('0x10'));var querystring=require(_0x7196('0x11'));var Papa=require(_0x7196('0x12'));var Redis=require(_0x7196('0x13'));var authService=require(_0x7196('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7196('0x15'));var logger=require(_0x7196('0x16'))(_0x7196('0x17'));var utils=require(_0x7196('0x18'));var config=require(_0x7196('0x19'));var licenseUtil=require(_0x7196('0x1a'));var db=require(_0x7196('0x1b'))['db'];var dbH=require(_0x7196('0x1b'))[_0x7196('0x1c')];function respondWithStatusCode(_0xba707b,_0x154101){_0x154101=_0x154101||0xcc;return function(_0x4e8c4c){if(_0x4e8c4c){return _0xba707b[_0x7196('0x1d')](_0x154101);}return _0xba707b[_0x7196('0x1e')](_0x154101)[_0x7196('0x1f')]();};}function respondWithResult(_0xf098c1,_0x511aa1){_0x511aa1=_0x511aa1||0xc8;return function(_0x31c778){if(_0x31c778){return _0xf098c1['status'](_0x511aa1)[_0x7196('0x20')](_0x31c778);}};}function respondWithFilteredResult(_0x2590a6,_0xf7e97){return function(_0x3ed1ad){if(_0x3ed1ad){var _0x12dce7=typeof _0xf7e97[_0x7196('0x21')]===_0x7196('0x22')&&typeof _0xf7e97[_0x7196('0x23')]===_0x7196('0x22');var _0x32fe2b=_0x3ed1ad[_0x7196('0x24')];var _0x5b716a=_0x12dce7?0x0:_0xf7e97['offset'];var _0x448f13=_0x12dce7?_0x3ed1ad[_0x7196('0x24')]:_0xf7e97[_0x7196('0x21')]+_0xf7e97['limit'];var _0x39b944;if(_0x448f13>=_0x32fe2b){_0x448f13=_0x32fe2b;_0x39b944=0xc8;}else{_0x39b944=0xce;}_0x2590a6['status'](_0x39b944);return _0x2590a6['set'](_0x7196('0x25'),_0x5b716a+'-'+_0x448f13+'/'+_0x32fe2b)[_0x7196('0x20')](_0x3ed1ad);}return null;};}function patchUpdates(_0x8dee9d){return function(_0x4ddf78){try{jsonpatch['apply'](_0x4ddf78,_0x8dee9d,!![]);}catch(_0x38d291){return BPromise[_0x7196('0x26')](_0x38d291);}return _0x4ddf78['save']();};}function saveUpdates(_0x18649b,_0x27ff84){return function(_0x6e22e5){if(_0x6e22e5){return _0x6e22e5[_0x7196('0x27')](_0x18649b)[_0x7196('0x28')](function(_0x549f34){return _0x549f34;});}return null;};}function removeEntity(_0x3f8178,_0x520d01){return function(_0x3ce9a0){if(_0x3ce9a0){return _0x3ce9a0[_0x7196('0x29')]()[_0x7196('0x28')](function(){var _0xa69810=_0x3ce9a0[_0x7196('0x2a')]({'plain':!![]});var _0x43f6a2='DefaultReports';return db['UserProfileResource'][_0x7196('0x29')]({'where':{'type':_0x43f6a2,'resourceId':_0xa69810['id']}})[_0x7196('0x28')](function(){return _0x3ce9a0;});})[_0x7196('0x28')](function(){_0x3f8178['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x41cfd2,_0x162cfc){return function(_0x675e64){if(!_0x675e64){_0x41cfd2['sendStatus'](0x194);}return _0x675e64;};}function handleError(_0x35eef9,_0x4ecea1){_0x4ecea1=_0x4ecea1||0x1f4;return function(_0x4fd339){logger['error'](_0x4fd339[_0x7196('0x2b')]);if(_0x4fd339[_0x7196('0x2c')]){delete _0x4fd339[_0x7196('0x2c')];}_0x35eef9['status'](_0x4ecea1)[_0x7196('0x2d')](_0x4fd339);};}exports[_0x7196('0x2e')]=function(_0x2f9583,_0xf999e9){var _0x50c386={},_0x39710d={},_0x429160={'count':0x0,'rows':[]};var _0xd07f22=_[_0x7196('0x2f')](db[_0x7196('0x30')][_0x7196('0x31')],function(_0x15c5f0){return{'name':_0x15c5f0[_0x7196('0x32')],'type':_0x15c5f0[_0x7196('0x33')][_0x7196('0x34')]};});_0x39710d[_0x7196('0x35')]=_['map'](_0xd07f22,_0x7196('0x2c'));_0x39710d['query']=_[_0x7196('0x36')](_0x2f9583['query']);_0x39710d[_0x7196('0x37')]=_[_0x7196('0x38')](_0x39710d['model'],_0x39710d[_0x7196('0x39')]);_0x50c386[_0x7196('0x3a')]=_[_0x7196('0x38')](_0x39710d[_0x7196('0x35')],qs[_0x7196('0x3b')](_0x2f9583['query'][_0x7196('0x3b')]));_0x50c386[_0x7196('0x3a')]=_0x50c386[_0x7196('0x3a')][_0x7196('0x3c')]?_0x50c386[_0x7196('0x3a')]:_0x39710d[_0x7196('0x35')];if(!_0x2f9583['query'][_0x7196('0x3d')](_0x7196('0x3e'))){_0x50c386[_0x7196('0x23')]=qs['limit'](_0x2f9583[_0x7196('0x39')][_0x7196('0x23')]);_0x50c386[_0x7196('0x21')]=qs[_0x7196('0x21')](_0x2f9583[_0x7196('0x39')][_0x7196('0x21')]);}_0x50c386[_0x7196('0x3f')]=qs[_0x7196('0x40')](_0x2f9583[_0x7196('0x39')][_0x7196('0x40')]);_0x50c386['where']=qs[_0x7196('0x37')](_[_0x7196('0x41')](_0x2f9583['query'],_0x39710d[_0x7196('0x37')]),_0xd07f22);if(_0x2f9583['query']['filter']){_0x50c386[_0x7196('0x42')]=_[_0x7196('0x43')](_0x50c386['where'],{'$or':_['map'](_0xd07f22,function(_0x1bad95){if(_0x1bad95[_0x7196('0x33')]!==_0x7196('0x44')){var _0x4c2341={};_0x4c2341[_0x1bad95[_0x7196('0x2c')]]={'$like':'%'+_0x2f9583[_0x7196('0x39')][_0x7196('0x45')]+'%'};return _0x4c2341;}})});}_0x50c386=_[_0x7196('0x43')]({},_0x50c386,_0x2f9583[_0x7196('0x46')]);var _0x428d76={'where':_0x50c386[_0x7196('0x42')]};return db[_0x7196('0x30')]['count'](_0x428d76)[_0x7196('0x28')](function(_0xa852e1){_0x429160['count']=_0xa852e1;if(_0x2f9583[_0x7196('0x39')][_0x7196('0x47')]){_0x50c386['include']=[{'all':!![]}];}return db[_0x7196('0x30')][_0x7196('0x48')](_0x50c386);})[_0x7196('0x28')](function(_0x5749e2){_0x429160[_0x7196('0x49')]=_0x5749e2;return _0x429160;})[_0x7196('0x28')](respondWithFilteredResult(_0xf999e9,_0x50c386))['catch'](handleError(_0xf999e9,null));};exports[_0x7196('0x4a')]=function(_0x1a7052,_0x4f0c6c){var _0x335e6f={'raw':!![],'where':{'id':_0x1a7052['params']['id']}},_0x53a5e6={};_0x53a5e6['model']=_['keys'](db['AnalyticDefaultReport'][_0x7196('0x31')]);_0x53a5e6['query']=_[_0x7196('0x36')](_0x1a7052[_0x7196('0x39')]);_0x53a5e6[_0x7196('0x37')]=_[_0x7196('0x38')](_0x53a5e6['model'],_0x53a5e6[_0x7196('0x39')]);_0x335e6f['attributes']=_[_0x7196('0x38')](_0x53a5e6[_0x7196('0x35')],qs[_0x7196('0x3b')](_0x1a7052['query'][_0x7196('0x3b')]));_0x335e6f[_0x7196('0x3a')]=_0x335e6f[_0x7196('0x3a')]['length']?_0x335e6f['attributes']:_0x53a5e6[_0x7196('0x35')];if(_0x1a7052['query'][_0x7196('0x47')]){_0x335e6f['include']=[{'all':!![]}];}_0x335e6f=_['merge']({},_0x335e6f,_0x1a7052[_0x7196('0x46')]);return db['AnalyticDefaultReport']['find'](_0x335e6f)['then'](handleEntityNotFound(_0x4f0c6c,null))[_0x7196('0x28')](respondWithResult(_0x4f0c6c,null))['catch'](handleError(_0x4f0c6c,null));};exports['create']=function(_0x28591e,_0x182c8b){return db[_0x7196('0x30')][_0x7196('0x4b')](_0x28591e['body'],{})[_0x7196('0x28')](function(_0x564688){var _0x36844f=_0x28591e[_0x7196('0x4c')]['get']({'plain':!![]});if(!_0x36844f)throw new Error(_0x7196('0x4d'));if(_0x36844f[_0x7196('0x4e')]===_0x7196('0x4c')){var _0x4fa18f=_0x564688[_0x7196('0x2a')]({'plain':!![]});var _0x5d51aa=_0x7196('0x4f');return db[_0x7196('0x50')][_0x7196('0x51')]({'where':{'name':_0x5d51aa,'userProfileId':_0x36844f[_0x7196('0x52')]},'raw':!![]})[_0x7196('0x28')](function(_0x19733a){if(_0x19733a&&_0x19733a[_0x7196('0x53')]===0x0){return db[_0x7196('0x54')]['create']({'name':_0x4fa18f['name'],'resourceId':_0x4fa18f['id'],'type':_0x7196('0x55'),'sectionId':_0x19733a['id']},{})[_0x7196('0x28')](function(){return _0x564688;});}else{return _0x564688;}})[_0x7196('0x56')](function(_0xe4b032){logger['error'](_0x7196('0x57'),_0xe4b032);throw _0xe4b032;});}return _0x564688;})[_0x7196('0x28')](respondWithResult(_0x182c8b,0xc9))[_0x7196('0x56')](handleError(_0x182c8b,null));};exports[_0x7196('0x27')]=function(_0x9fcfd4,_0x3177c2){if(_0x9fcfd4[_0x7196('0x58')]['id']){delete _0x9fcfd4[_0x7196('0x58')]['id'];}return db[_0x7196('0x30')][_0x7196('0x51')]({'where':{'id':_0x9fcfd4[_0x7196('0x59')]['id']}})['then'](handleEntityNotFound(_0x3177c2,null))[_0x7196('0x28')](saveUpdates(_0x9fcfd4[_0x7196('0x58')],null))[_0x7196('0x28')](respondWithResult(_0x3177c2,null))['catch'](handleError(_0x3177c2,null));};exports[_0x7196('0x29')]=function(_0x5ca1ca,_0x34407d){return db[_0x7196('0x30')][_0x7196('0x51')]({'where':{'id':_0x5ca1ca[_0x7196('0x59')]['id']}})[_0x7196('0x28')](handleEntityNotFound(_0x34407d,null))['then'](removeEntity(_0x34407d,null))[_0x7196('0x56')](handleError(_0x34407d,null));};exports['preview']=function(_0x4be36d,_0x5b9824){var _0x1bc358=0xa;var _0x3be180=[_0x7196('0x5a'),_0x7196('0x5b'),_0x7196('0x5c'),_0x7196('0x5d')];var _0x2d8b3d={'SUM':'SUM(%s)','COUNT':_0x7196('0x5e'),'COUNT DISTINCT':_0x7196('0x5f'),'MAX':_0x7196('0x60'),'MIN':_0x7196('0x61'),'AVG':_0x7196('0x62'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x7196('0x63')};var _0x1c7eb2={'SEC_TO_TIME':_0x7196('0x64'),'DATE':_0x7196('0x65'),'HOUR':_0x7196('0x66'),'ROUND':_0x7196('0x67'),'UNIX_TIMESTAMP':_0x7196('0x68')};var _0x43ee13=function(_0x13e9d0){return!_[_0x7196('0x69')]([_0x7196('0x6a'),'IS\x20NOT\x20NULL',_0x7196('0x6b'),_0x7196('0x6c')],_0x13e9d0);};var _0x27d5d7=function(_0x33f43b){if(!_0x33f43b||!_0x33f43b['rules'][_0x7196('0x3c')]){return'';}for(var _0x204c3a='(',_0x1f3acc=0x0;_0x1f3acc<_0x33f43b[_0x7196('0x6d')][_0x7196('0x3c')];_0x1f3acc+=0x1){_0x1f3acc>0x0&&(_0x204c3a+='\x20'+_0x33f43b[_0x7196('0x6e')]+'\x20');_0x204c3a+=_0x33f43b[_0x7196('0x6d')][_0x1f3acc]['group']?_0x27d5d7(_0x33f43b[_0x7196('0x6d')][_0x1f3acc][_0x7196('0x6f')]):_0x33f43b[_0x7196('0x6d')][_0x1f3acc][_0x7196('0x70')]+'\x20'+_0x33f43b['rules'][_0x1f3acc][_0x7196('0x71')]+(_0x43ee13(_0x33f43b[_0x7196('0x6d')][_0x1f3acc][_0x7196('0x71')])?'\x20'+_0x33f43b[_0x7196('0x6d')][_0x1f3acc][_0x7196('0x72')]:'');}return _0x204c3a+')';};var _0x37c6be={'where':{'id':_0x4be36d['params']['id']}},_0x57065,_0x517dfb,_0x56b2eb,_0x56955e,_0x72f6f1;_0x37c6be=_[_0x7196('0x43')]({},_0x37c6be,_0x4be36d[_0x7196('0x46')]);return db[_0x7196('0x30')][_0x7196('0x51')](_0x37c6be)[_0x7196('0x28')](function(_0x30d44f){if(_0x30d44f){_0x57065=_0x30d44f;return _0x30d44f[_0x7196('0x73')]();}return null;})[_0x7196('0x28')](function(_0x3881a5){if(_0x3881a5){if(!_0x3881a5['length']){throw new db['Sequelize'][(_0x7196('0x74'))](_0x7196('0x75'),0x193);}_0x517dfb=_0x3881a5;return db[_0x7196('0x76')][_0x7196('0x48')]({'raw':!![]});}return null;})[_0x7196('0x28')](function(_0x45e21f){if(_0x45e21f){_0x56b2eb=_[_0x7196('0x77')](_0x45e21f,'id');var _0x2f36f8;var _0x4cc5e3=squel['select']();_0x4cc5e3[_0x7196('0x78')](_0x57065['table']);for(var _0x30d114=0x0;_0x30d114<_0x517dfb['length'];_0x30d114+=0x1){_0x2f36f8=_0x517dfb[_0x30d114][_0x7196('0x79')]?_0x56b2eb[_0x517dfb[_0x30d114][_0x7196('0x79')]][_0x7196('0x7a')]:_0x517dfb[_0x30d114][_0x7196('0x70')];_0x2f36f8=_0x517dfb[_0x30d114]['function']?_['replace'](_0x2d8b3d[_0x517dfb[_0x30d114][_0x7196('0x7b')]],'%s',_0x2f36f8):_0x2f36f8;_0x2f36f8=_0x517dfb[_0x30d114]['format']?_[_0x7196('0x7c')](_0x1c7eb2[_0x517dfb[_0x30d114][_0x7196('0x7d')]],'%s',_0x2f36f8):_0x2f36f8;if(_0x517dfb[_0x30d114][_0x7196('0x7e')]){_0x4cc5e3[_0x7196('0x6f')](_0x2f36f8);}_0x517dfb[_0x30d114][_0x7196('0x7f')]&&_0x4cc5e3[_0x7196('0x3f')](_0x2f36f8,_0x517dfb[_0x30d114]['orderBy']===_0x7196('0x80')?![]:!![]);_0x4cc5e3[_0x7196('0x70')](_0x2f36f8,_0x517dfb[_0x30d114][_0x7196('0x81')]||_0x2f36f8);}if(_0x57065[_0x7196('0x82')]){_0x57065[_0x7196('0x82')]=JSON[_0x7196('0x83')](_0x57065[_0x7196('0x82')]);for(var _0x473c0e=0x0;_0x473c0e<_0x57065[_0x7196('0x82')][_0x7196('0x3c')];_0x473c0e+=0x1){if(_0x57065[_0x7196('0x82')][_0x473c0e][_0x7196('0x33')]&&_['includes'](_0x3be180,_0x57065[_0x7196('0x82')][_0x473c0e][_0x7196('0x33')])&&_0x57065['joins'][_0x473c0e]['parentKey']&&_0x57065[_0x7196('0x82')][_0x473c0e][_0x7196('0x84')]&&_0x57065[_0x7196('0x82')][_0x473c0e]['foreignKey']){_0x4cc5e3[_0x57065[_0x7196('0x82')][_0x473c0e]['type']](_0x57065[_0x7196('0x82')][_0x473c0e][_0x7196('0x84')],null,util['format'](_0x7196('0x85'),_0x57065['table'],_0x57065['joins'][_0x473c0e][_0x7196('0x86')],_0x57065[_0x7196('0x82')][_0x473c0e][_0x7196('0x84')],_0x57065['joins'][_0x473c0e][_0x7196('0x87')]));}}}if(_0x57065['conditions']){_0x57065[_0x7196('0x88')]=JSON[_0x7196('0x83')](_0x57065[_0x7196('0x88')]);_0x4cc5e3[_0x7196('0x42')](_0x27d5d7(_0x57065[_0x7196('0x88')]['group']));}_0x72f6f1=_0x4cc5e3[_0x7196('0x89')]();_0x4cc5e3[_0x7196('0x23')](_0x1bc358);_0x4cc5e3[_0x7196('0x21')](0x0);logger[_0x7196('0x8a')](_0x7196('0x8b'),_0x4cc5e3[_0x7196('0x8c')]());return dbH[_0x7196('0x8d')][_0x7196('0x39')](_0x4cc5e3['toString'](),{'type':dbH[_0x7196('0x8d')][_0x7196('0x8e')][_0x7196('0x8f')]});}})[_0x7196('0x28')](respondWithResult(_0x5b9824,null))['catch'](handleError(_0x5b9824,null));};function runReport(_0x1364f5,_0x2cb53c,_0x4fe2cb){var _0x2e4807=_0x2cb53c['name'];var _0xd6d8cf=0xa;var _0x5318c1=[_0x7196('0x5a'),_0x7196('0x5b'),'right_join',_0x7196('0x5d')];var _0x2b52c0={'SUM':_0x7196('0x90'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x7196('0x60'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x7196('0x91'),'GROUP_CONCAT ASC':_0x7196('0x92'),'GROUP_CONCAT DESC':_0x7196('0x63')};var _0x509c4a={'SEC_TO_TIME':_0x7196('0x64'),'DATE':_0x7196('0x65'),'HOUR':_0x7196('0x66'),'ROUND':_0x7196('0x67'),'UNIX_TIMESTAMP':_0x7196('0x68')};var _0x26048c=function(_0x1a4d17){return!_[_0x7196('0x69')]([_0x7196('0x6a'),_0x7196('0x93'),_0x7196('0x6b'),'IS\x20NOT\x20EMPTY'],_0x1a4d17);};var _0x5acff1=function(_0x32ab6c){if(!_0x32ab6c||!_0x32ab6c['rules']['length']){return'';}for(var _0x2bfdc4='(',_0x1604fa=0x0;_0x1604fa<_0x32ab6c[_0x7196('0x6d')][_0x7196('0x3c')];_0x1604fa+=0x1){_0x1604fa>0x0&&(_0x2bfdc4+='\x20'+_0x32ab6c['operator']+'\x20');_0x2bfdc4+=_0x32ab6c['rules'][_0x1604fa][_0x7196('0x6f')]?_0x5acff1(_0x32ab6c[_0x7196('0x6d')][_0x1604fa][_0x7196('0x6f')]):_0x32ab6c[_0x7196('0x6d')][_0x1604fa]['field']+'\x20'+_0x32ab6c[_0x7196('0x6d')][_0x1604fa]['condition']+(_0x26048c(_0x32ab6c['rules'][_0x1604fa][_0x7196('0x71')])?'\x20'+_0x32ab6c[_0x7196('0x6d')][_0x1604fa][_0x7196('0x72')]:'');}return _0x2bfdc4+')';};var _0x494418={'where':{'id':_0x1364f5['id']}},_0x400aa5,_0x40d4c3,_0x1824e2,_0x30c54b,_0x10712f;_0x494418=_[_0x7196('0x43')]({},_0x494418,_0x4fe2cb);return db[_0x7196('0x30')][_0x7196('0x51')](_0x494418)['then'](function(_0x9bd2ea){if(_0x9bd2ea){_0x400aa5=_0x9bd2ea;return _0x9bd2ea[_0x7196('0x73')]();}return null;})[_0x7196('0x28')](function(_0x408760){if(_0x408760){if(!_0x408760[_0x7196('0x3c')]){throw new db['Sequelize'][(_0x7196('0x74'))](_0x7196('0x75'),0x193);}_0x40d4c3=_0x408760;return db[_0x7196('0x76')]['findAll']({'raw':!![]});}return null;})[_0x7196('0x28')](function(_0x4b98de){if(_0x4b98de){_0x1824e2=_['keyBy'](_0x4b98de,'id');var _0x1dcf93;var _0x25d323=squel['select']();_0x25d323[_0x7196('0x78')](_0x400aa5[_0x7196('0x94')]);for(var _0x48ceda=0x0;_0x48ceda<_0x40d4c3[_0x7196('0x3c')];_0x48ceda+=0x1){_0x1dcf93=_0x40d4c3[_0x48ceda][_0x7196('0x79')]?_0x1824e2[_0x40d4c3[_0x48ceda][_0x7196('0x79')]][_0x7196('0x7a')]:_0x40d4c3[_0x48ceda][_0x7196('0x70')];_0x1dcf93=_0x40d4c3[_0x48ceda][_0x7196('0x7b')]?_['replace'](_0x2b52c0[_0x40d4c3[_0x48ceda][_0x7196('0x7b')]],'%s',_0x1dcf93):_0x1dcf93;_0x1dcf93=_0x40d4c3[_0x48ceda][_0x7196('0x7d')]?_[_0x7196('0x7c')](_0x509c4a[_0x40d4c3[_0x48ceda]['format']],'%s',_0x1dcf93):_0x1dcf93;if(_0x40d4c3[_0x48ceda]['groupBy']){_0x25d323['group'](_0x1dcf93);}_0x40d4c3[_0x48ceda][_0x7196('0x7f')]&&_0x25d323[_0x7196('0x3f')](_0x1dcf93,_0x40d4c3[_0x48ceda][_0x7196('0x7f')]==='DESC'?![]:!![]);_0x25d323[_0x7196('0x70')](_0x1dcf93,_0x40d4c3[_0x48ceda]['alias']||_0x1dcf93);}if(_0x400aa5[_0x7196('0x82')]){_0x400aa5['joins']=JSON[_0x7196('0x83')](_0x400aa5[_0x7196('0x82')]);for(var _0x33d5bf=0x0;_0x33d5bf<_0x400aa5[_0x7196('0x82')][_0x7196('0x3c')];_0x33d5bf+=0x1){if(_0x400aa5[_0x7196('0x82')][_0x33d5bf][_0x7196('0x33')]&&_['includes'](_0x5318c1,_0x400aa5[_0x7196('0x82')][_0x33d5bf]['type'])&&_0x400aa5['joins'][_0x33d5bf]['parentKey']&&_0x400aa5['joins'][_0x33d5bf]['foreignTable']&&_0x400aa5[_0x7196('0x82')][_0x33d5bf][_0x7196('0x87')]){_0x25d323[_0x400aa5[_0x7196('0x82')][_0x33d5bf]['type']](_0x400aa5[_0x7196('0x82')][_0x33d5bf]['foreignTable'],null,util['format']('%s.%s\x20=\x20%s.%s',_0x400aa5[_0x7196('0x94')],_0x400aa5['joins'][_0x33d5bf][_0x7196('0x86')],_0x400aa5[_0x7196('0x82')][_0x33d5bf][_0x7196('0x84')],_0x400aa5[_0x7196('0x82')][_0x33d5bf][_0x7196('0x87')]));}}}if(_0x400aa5[_0x7196('0x88')]){_0x400aa5[_0x7196('0x88')]=JSON[_0x7196('0x83')](_0x400aa5['conditions']);_0x25d323[_0x7196('0x42')](_0x5acff1(_0x400aa5[_0x7196('0x88')][_0x7196('0x6f')]));}_0x10712f=_0x25d323['clone']();_0x25d323[_0x7196('0x23')](_0xd6d8cf);_0x25d323[_0x7196('0x21')](0x0);return;}})[_0x7196('0x28')](function(){if(_0x2cb53c['output']===_0x7196('0x95')){return null;}var _0x46a563=_[_0x7196('0x43')](_0x2cb53c,{'name':_0x2cb53c['fullPath']||_0x2cb53c[_0x7196('0x2c')]||_0x400aa5[_0x7196('0x2c')],'basename':_0x2e4807,'savename':util['format'](_0x7196('0x96'),_0x2cb53c['name']||_0x400aa5[_0x7196('0x2c')],require(_0x7196('0x97'))['generate'](0x4),_0x2cb53c[_0x7196('0x98')]||'csv'),'reportId':_0x400aa5['id'],'reportType':_0x7196('0x99')});return db[_0x7196('0x9a')][_0x7196('0x4b')](_0x46a563,{'raw':!![]});})['then'](function(_0xd9619d){if(_0x400aa5[_0x7196('0x94')]===_0x7196('0x9b')){_0x10712f[_0x7196('0x42')](_0x400aa5['table']+_0x7196('0x9c'),_0x2cb53c[_0x7196('0x9d')],_0x2cb53c[_0x7196('0x9e')]);}else{_0x10712f['where'](_0x400aa5['table']+_0x7196('0x9f'),_0x2cb53c[_0x7196('0x9d')],_0x2cb53c[_0x7196('0x9e')]);}if(_0xd9619d){logger[_0x7196('0xa0')]('Run\x20Query:',_0x10712f[_0x7196('0x8c')]());require('child_process')[_0x7196('0xa1')](path['join'](__dirname,_0x7196('0xa2'),_0xd9619d[_0x7196('0x98')]),[_0xd9619d['id'],_0x10712f[_0x7196('0x8c')](),path[_0x7196('0x5a')](__dirname,_0x7196('0xa3'),_0xd9619d[_0x7196('0xa4')]),_0x2e4807]);return _0xd9619d;}else{var _0x342fb1=squel['select']();_0x342fb1[_0x7196('0x78')]('('+_0x10712f[_0x7196('0x8c')]()+')',_0x7196('0xa5'));_0x342fb1[_0x7196('0x70')](_0x7196('0xa6'),_0x7196('0x24'));_0x10712f[_0x7196('0x23')](_0x2cb53c[_0x7196('0x23')]||_0xd6d8cf);_0x10712f['offset'](_0x2cb53c[_0x7196('0x21')]||0x0);return dbH[_0x7196('0x8d')]['query'](_0x342fb1[_0x7196('0x8c')](),{'type':dbH[_0x7196('0x8d')]['QueryTypes'][_0x7196('0x8f')]})[_0x7196('0x28')](function(_0xdf1ede){if(!_0xdf1ede[_0x7196('0x3c')]){_0x30c54b=0x0;}else{_0x30c54b=_0xdf1ede[0x0]['count']||0x0;}return dbH['sequelize'][_0x7196('0x39')](_0x10712f['toString'](),{'type':dbH[_0x7196('0x8d')][_0x7196('0x8e')][_0x7196('0x8f')]});})[_0x7196('0x28')](function(_0x2df80a){return{'rows':_0x2df80a||[],'count':_0x30c54b};});}});}exports['run']=function(_0x392e74,_0x17ba6d){return runReport(_0x392e74[_0x7196('0x59')],_0x392e74[_0x7196('0x39')],_0x392e74[_0x7196('0x46')])[_0x7196('0x28')](respondWithResult(_0x17ba6d,null))[_0x7196('0x56')](handleError(_0x17ba6d,null));};exports[_0x7196('0xa7')]=runReport;exports[_0x7196('0x39')]=function(_0x5a3c87,_0x58fb86){var _0x51da79=0xa;var _0x144613=[_0x7196('0x5a'),_0x7196('0x5b'),_0x7196('0x5c'),_0x7196('0x5d')];var _0x9055af={'SUM':_0x7196('0x90'),'COUNT':_0x7196('0x5e'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x7196('0x91'),'GROUP_CONCAT ASC':_0x7196('0x92'),'GROUP_CONCAT DESC':_0x7196('0x63')};var _0xab9595={'SEC_TO_TIME':_0x7196('0x64'),'DATE':_0x7196('0x65'),'HOUR':'HOUR(%s)','ROUND':_0x7196('0x67'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x5236a0=function(_0x520fe8){return!_['includes'](['IS\x20NULL',_0x7196('0x93'),'IS\x20EMPTY',_0x7196('0x6c')],_0x520fe8);};var _0x425a57=function(_0x302728){if(!_0x302728||!_0x302728[_0x7196('0x6d')][_0x7196('0x3c')]){return'';}for(var _0x14492e='(',_0x58df43=0x0;_0x58df43<_0x302728[_0x7196('0x6d')][_0x7196('0x3c')];_0x58df43+=0x1){_0x58df43>0x0&&(_0x14492e+='\x20'+_0x302728[_0x7196('0x6e')]+'\x20');_0x14492e+=_0x302728['rules'][_0x58df43][_0x7196('0x6f')]?_0x425a57(_0x302728[_0x7196('0x6d')][_0x58df43][_0x7196('0x6f')]):_0x302728['rules'][_0x58df43]['field']+'\x20'+_0x302728[_0x7196('0x6d')][_0x58df43][_0x7196('0x71')]+(_0x5236a0(_0x302728[_0x7196('0x6d')][_0x58df43][_0x7196('0x71')])?'\x20'+_0x302728[_0x7196('0x6d')][_0x58df43][_0x7196('0x72')]:'');}return _0x14492e+')';};var _0x1a8a5a={'where':{'id':_0x5a3c87[_0x7196('0x59')]['id']}},_0x2944e5,_0x3f9385,_0xbd94ef,_0x5d2a56,_0x2fb552;_0x1a8a5a=_['merge']({},_0x1a8a5a,_0x5a3c87[_0x7196('0x46')]);return db[_0x7196('0x30')]['find'](_0x1a8a5a)[_0x7196('0x28')](function(_0x386259){if(_0x386259){_0x2944e5=_0x386259;return _0x386259[_0x7196('0x73')]();}return null;})[_0x7196('0x28')](function(_0x1e7a64){if(_0x1e7a64){if(!_0x1e7a64[_0x7196('0x3c')]){throw new db['Sequelize']['ValidationErrorItem'](_0x7196('0x75'),0x193);}_0x3f9385=_0x1e7a64;return db['AnalyticMetric'][_0x7196('0x48')]({'raw':!![]});}return null;})[_0x7196('0x28')](function(_0x30db09){if(_0x30db09){_0xbd94ef=_['keyBy'](_0x30db09,'id');var _0x4729e1;var _0x66e1e6=squel[_0x7196('0xa8')]();_0x66e1e6[_0x7196('0x78')](_0x2944e5[_0x7196('0x94')]);for(var _0x1e2105=0x0;_0x1e2105<_0x3f9385[_0x7196('0x3c')];_0x1e2105+=0x1){_0x4729e1=_0x3f9385[_0x1e2105][_0x7196('0x79')]?_0xbd94ef[_0x3f9385[_0x1e2105][_0x7196('0x79')]]['metric']:_0x3f9385[_0x1e2105][_0x7196('0x70')];_0x4729e1=_0x3f9385[_0x1e2105][_0x7196('0x7b')]?_[_0x7196('0x7c')](_0x9055af[_0x3f9385[_0x1e2105][_0x7196('0x7b')]],'%s',_0x4729e1):_0x4729e1;_0x4729e1=_0x3f9385[_0x1e2105][_0x7196('0x7d')]?_[_0x7196('0x7c')](_0xab9595[_0x3f9385[_0x1e2105]['format']],'%s',_0x4729e1):_0x4729e1;if(_0x3f9385[_0x1e2105][_0x7196('0x7e')]){_0x66e1e6['group'](_0x4729e1);}_0x3f9385[_0x1e2105][_0x7196('0x7f')]&&_0x66e1e6[_0x7196('0x3f')](_0x4729e1,_0x3f9385[_0x1e2105][_0x7196('0x7f')]==='DESC'?![]:!![]);_0x66e1e6['field'](_0x4729e1,_0x3f9385[_0x1e2105][_0x7196('0x81')]||_0x4729e1);}if(_0x2944e5[_0x7196('0x82')]){_0x2944e5[_0x7196('0x82')]=JSON[_0x7196('0x83')](_0x2944e5[_0x7196('0x82')]);for(var _0x220315=0x0;_0x220315<_0x2944e5[_0x7196('0x82')][_0x7196('0x3c')];_0x220315+=0x1){if(_0x2944e5['joins'][_0x220315][_0x7196('0x33')]&&_[_0x7196('0x69')](_0x144613,_0x2944e5['joins'][_0x220315][_0x7196('0x33')])&&_0x2944e5[_0x7196('0x82')][_0x220315][_0x7196('0x86')]&&_0x2944e5['joins'][_0x220315][_0x7196('0x84')]&&_0x2944e5[_0x7196('0x82')][_0x220315][_0x7196('0x87')]){_0x66e1e6[_0x2944e5[_0x7196('0x82')][_0x220315][_0x7196('0x33')]](_0x2944e5['joins'][_0x220315]['foreignTable'],null,util[_0x7196('0x7d')](_0x7196('0x85'),_0x2944e5[_0x7196('0x94')],_0x2944e5[_0x7196('0x82')][_0x220315][_0x7196('0x86')],_0x2944e5[_0x7196('0x82')][_0x220315]['foreignTable'],_0x2944e5[_0x7196('0x82')][_0x220315][_0x7196('0x87')]));}}}if(_0x2944e5[_0x7196('0x88')]){_0x2944e5[_0x7196('0x88')]=JSON['parse'](_0x2944e5[_0x7196('0x88')]);_0x66e1e6[_0x7196('0x42')](_0x425a57(_0x2944e5[_0x7196('0x88')][_0x7196('0x6f')]));}_0x2fb552=_0x66e1e6[_0x7196('0x89')]();_0x66e1e6[_0x7196('0x23')](_0x51da79);_0x66e1e6[_0x7196('0x21')](0x0);logger[_0x7196('0x8a')](_0x7196('0x8b'),_0x66e1e6[_0x7196('0x8c')]());return dbH[_0x7196('0x8d')][_0x7196('0x39')](_0x66e1e6['toString'](),{'type':dbH[_0x7196('0x8d')]['QueryTypes'][_0x7196('0x8f')]});}})['then'](function(){return{'sql':_0x2fb552[_0x7196('0x8c')]()};})['then'](respondWithResult(_0x58fb86,null))[_0x7196('0x56')](handleError(_0x58fb86,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index 9200652..5502d1a 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 _0x0edc=['rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0xe61b71,_0x49b800){var _0x1604b7=function(_0x681020){while(--_0x681020){_0xe61b71['push'](_0xe61b71['shift']());}};_0x1604b7(++_0x49b800);}(_0x0edc,0xfd));var _0xc0ed=function(_0xa98dea,_0x189bab){_0xa98dea=_0xa98dea-0x0;var _0x361e03=_0x0edc[_0xa98dea];return _0x361e03;};'use strict';var _=require(_0xc0ed('0x0'));var util=require(_0xc0ed('0x1'));var logger=require(_0xc0ed('0x2'))(_0xc0ed('0x3'));var moment=require(_0xc0ed('0x4'));var BPromise=require(_0xc0ed('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc0ed('0x6'));var rimraf=require(_0xc0ed('0x7'));var config=require(_0xc0ed('0x8'));var attributes=require(_0xc0ed('0x9'));module[_0xc0ed('0xa')]=function(_0x144edc,_0x7886e5){return _0x144edc[_0xc0ed('0xb')](_0xc0ed('0xc'),attributes,{'tableName':'analytics_default_reports','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6871=['request-promise','path','rimraf','../../config/environment','exports','AnalyticDefaultReport','analytics_default_reports','lodash','util','../../config/logger','moment'];(function(_0x94e185,_0x217b2d){var _0x48d1fa=function(_0x190994){while(--_0x190994){_0x94e185['push'](_0x94e185['shift']());}};_0x48d1fa(++_0x217b2d);}(_0x6871,0xac));var _0x1687=function(_0x339d0c,_0x45d2eb){_0x339d0c=_0x339d0c-0x0;var _0x34e391=_0x6871[_0x339d0c];return _0x34e391;};'use strict';var _=require(_0x1687('0x0'));var util=require(_0x1687('0x1'));var logger=require(_0x1687('0x2'))('api');var moment=require(_0x1687('0x3'));var BPromise=require('bluebird');var rp=require(_0x1687('0x4'));var fs=require('fs');var path=require(_0x1687('0x5'));var rimraf=require(_0x1687('0x6'));var config=require(_0x1687('0x7'));var attributes=require('./analyticDefaultReport.attributes');module[_0x1687('0x8')]=function(_0x1ad151,_0x1f8b36){return _0x1ad151['define'](_0x1687('0x9'),attributes,{'tableName':_0x1687('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js index c574ed3..a3ff6c6 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 _0x1c06=['request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s'];(function(_0x45ffaa,_0x3d1753){var _0x4b2d51=function(_0x46990b){while(--_0x46990b){_0x45ffaa['push'](_0x45ffaa['shift']());}};_0x4b2d51(++_0x3d1753);}(_0x1c06,0x1e3));var _0x61c0=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0x1c06[_0x5c351c];return _0x26f3b3;};'use strict';var _=require(_0x61c0('0x0'));var util=require(_0x61c0('0x1'));var moment=require(_0x61c0('0x2'));var BPromise=require(_0x61c0('0x3'));var rs=require(_0x61c0('0x4'));var fs=require('fs');var Redis=require(_0x61c0('0x5'));var db=require(_0x61c0('0x6'))['db'];var utils=require(_0x61c0('0x7'));var logger=require(_0x61c0('0x8'))(_0x61c0('0x9'));var config=require(_0x61c0('0xa'));var jayson=require(_0x61c0('0xb'));var client=jayson[_0x61c0('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x47f620,_0x3ccd0b,_0x22ed46){return new BPromise(function(_0x53f724,_0x3d6048){return client[_0x61c0('0xd')](_0x47f620,_0x22ed46)[_0x61c0('0xe')](function(_0x5b4b0e){logger[_0x61c0('0xf')](_0x61c0('0x10'),_0x3ccd0b,_0x61c0('0x11'));logger[_0x61c0('0x12')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x3ccd0b,_0x61c0('0x11'),JSON[_0x61c0('0x13')](_0x5b4b0e));if(_0x5b4b0e[_0x61c0('0x14')]){if(_0x5b4b0e[_0x61c0('0x14')][_0x61c0('0x15')]===0x1f4){logger[_0x61c0('0x14')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x3ccd0b,_0x5b4b0e[_0x61c0('0x14')][_0x61c0('0x16')]);return _0x3d6048(_0x5b4b0e['error'][_0x61c0('0x16')]);}logger[_0x61c0('0x14')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x3ccd0b,_0x5b4b0e[_0x61c0('0x14')][_0x61c0('0x16')]);return _0x53f724(_0x5b4b0e['error'][_0x61c0('0x16')]);}else{logger['info'](_0x61c0('0x10'),_0x3ccd0b,_0x61c0('0x11'));_0x53f724(_0x5b4b0e[_0x61c0('0x17')][_0x61c0('0x16')]);}})[_0x61c0('0x18')](function(_0x1d4526){logger[_0x61c0('0x14')](_0x61c0('0x10'),_0x3ccd0b,_0x1d4526);_0x3d6048(_0x1d4526);});});} \ No newline at end of file +var _0x8ed5=['lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x8ed5,0x1b5));var _0x58ed=function(_0x50b31e,_0x3e6a06){_0x50b31e=_0x50b31e-0x0;var _0x27bd52=_0x8ed5[_0x50b31e];return _0x27bd52;};'use strict';var _=require(_0x58ed('0x0'));var util=require(_0x58ed('0x1'));var moment=require('moment');var BPromise=require(_0x58ed('0x2'));var rs=require(_0x58ed('0x3'));var fs=require('fs');var Redis=require(_0x58ed('0x4'));var db=require(_0x58ed('0x5'))['db'];var utils=require(_0x58ed('0x6'));var logger=require('../../config/logger')(_0x58ed('0x7'));var config=require(_0x58ed('0x8'));var jayson=require(_0x58ed('0x9'));var client=jayson[_0x58ed('0xa')][_0x58ed('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x379c50,_0x318c6b,_0x5ed7de){return new BPromise(function(_0x113a1d,_0x1ef12d){return client[_0x58ed('0xc')](_0x379c50,_0x5ed7de)[_0x58ed('0xd')](function(_0x46cba2){logger[_0x58ed('0xe')](_0x58ed('0xf'),_0x318c6b,_0x58ed('0x10'));logger['debug'](_0x58ed('0x11'),_0x318c6b,_0x58ed('0x10'),JSON[_0x58ed('0x12')](_0x46cba2));if(_0x46cba2[_0x58ed('0x13')]){if(_0x46cba2['error']['code']===0x1f4){logger[_0x58ed('0x13')](_0x58ed('0xf'),_0x318c6b,_0x46cba2[_0x58ed('0x13')][_0x58ed('0x14')]);return _0x1ef12d(_0x46cba2[_0x58ed('0x13')]['message']);}logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0x318c6b,_0x46cba2[_0x58ed('0x13')]['message']);return _0x113a1d(_0x46cba2[_0x58ed('0x13')][_0x58ed('0x14')]);}else{logger[_0x58ed('0xe')](_0x58ed('0xf'),_0x318c6b,_0x58ed('0x10'));_0x113a1d(_0x46cba2[_0x58ed('0x15')][_0x58ed('0x14')]);}})[_0x58ed('0x16')](function(_0x4b311b){logger[_0x58ed('0x13')](_0x58ed('0xf'),_0x318c6b,_0x4b311b);_0x1ef12d(_0x4b311b);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index b19157c..88f538f 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 _0x45a4=['delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','/:id','show','get','/:id/preview','/:id/run','run','/:id/query','query','create','put'];(function(_0x4f9b18,_0x2cb5ca){var _0x29f20c=function(_0x268b3d){while(--_0x268b3d){_0x4f9b18['push'](_0x4f9b18['shift']());}};_0x29f20c(++_0x2cb5ca);}(_0x45a4,0xc3));var _0x445a=function(_0x346f7a,_0x171423){_0x346f7a=_0x346f7a-0x0;var _0x35eea1=_0x45a4[_0x346f7a];return _0x35eea1;};'use strict';var multer=require('multer');var util=require(_0x445a('0x0'));var path=require(_0x445a('0x1'));var timeout=require(_0x445a('0x2'));var express=require(_0x445a('0x3'));var router=express[_0x445a('0x4')]();var fs_extra=require(_0x445a('0x5'));var auth=require(_0x445a('0x6'));var interaction=require(_0x445a('0x7'));var config=require(_0x445a('0x8'));var controller=require('./analyticDefaultReport.controller');router['get']('/',auth[_0x445a('0x9')](),controller[_0x445a('0xa')]);router['get'](_0x445a('0xb'),auth[_0x445a('0x9')](),controller[_0x445a('0xc')]);router[_0x445a('0xd')](_0x445a('0xe'),auth['isAuthenticated'](),controller['preview']);router[_0x445a('0xd')](_0x445a('0xf'),auth[_0x445a('0x9')](),controller[_0x445a('0x10')]);router[_0x445a('0xd')](_0x445a('0x11'),auth[_0x445a('0x9')](),controller[_0x445a('0x12')]);router['post']('/',auth['isAuthenticated'](),controller[_0x445a('0x13')]);router[_0x445a('0x14')](_0x445a('0xb'),auth[_0x445a('0x9')](),controller['update']);router[_0x445a('0x15')](_0x445a('0xb'),auth[_0x445a('0x9')](),controller[_0x445a('0x16')]);module[_0x445a('0x17')]=router; \ No newline at end of file +var _0xb3de=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview','/:id/run','query','create','put','update','delete','destroy','exports','multer','util'];(function(_0x2b0078,_0x391775){var _0x44cc60=function(_0x4e9df3){while(--_0x4e9df3){_0x2b0078['push'](_0x2b0078['shift']());}};_0x44cc60(++_0x391775);}(_0xb3de,0x16e));var _0xeb3d=function(_0x4e8d64,_0xab2c8b){_0x4e8d64=_0x4e8d64-0x0;var _0x98584b=_0xb3de[_0x4e8d64];return _0x98584b;};'use strict';var multer=require(_0xeb3d('0x0'));var util=require(_0xeb3d('0x1'));var path=require('path');var timeout=require(_0xeb3d('0x2'));var express=require('express');var router=express[_0xeb3d('0x3')]();var fs_extra=require(_0xeb3d('0x4'));var auth=require(_0xeb3d('0x5'));var interaction=require(_0xeb3d('0x6'));var config=require(_0xeb3d('0x7'));var controller=require(_0xeb3d('0x8'));router[_0xeb3d('0x9')]('/',auth[_0xeb3d('0xa')](),controller[_0xeb3d('0xb')]);router[_0xeb3d('0x9')](_0xeb3d('0xc'),auth[_0xeb3d('0xa')](),controller[_0xeb3d('0xd')]);router['get'](_0xeb3d('0xe'),auth[_0xeb3d('0xa')](),controller['preview']);router[_0xeb3d('0x9')](_0xeb3d('0xf'),auth['isAuthenticated'](),controller['run']);router[_0xeb3d('0x9')]('/:id/query',auth['isAuthenticated'](),controller[_0xeb3d('0x10')]);router['post']('/',auth[_0xeb3d('0xa')](),controller[_0xeb3d('0x11')]);router[_0xeb3d('0x12')]('/:id',auth[_0xeb3d('0xa')](),controller[_0xeb3d('0x13')]);router[_0xeb3d('0x14')](_0xeb3d('0xc'),auth['isAuthenticated'](),controller[_0xeb3d('0x15')]);module[_0xeb3d('0x16')]=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index b962e26..008eb9c 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 _0x9d61=['UNSIGNED','STRING','pdf','csv','DATE','Loading','manual','scheduled'];(function(_0x5899b9,_0x3c4477){var _0x2c766d=function(_0x288fc9){while(--_0x288fc9){_0x5899b9['push'](_0x5899b9['shift']());}};_0x2c766d(++_0x3c4477);}(_0x9d61,0xe9));var _0x19d6=function(_0x1eedfd,_0x59c38e){_0x1eedfd=_0x1eedfd-0x0;var _0x4c3989=_0x9d61[_0x1eedfd];return _0x4c3989;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module['exports']={'name':{'type':Sequelize[_0x19d6('0x0')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize['ENUM']('csv',_0x19d6('0x1'),'xlsx'),'allowNull':![],'defaultValue':_0x19d6('0x2')},'savename':{'type':Sequelize[_0x19d6('0x0')],'allowNull':![]},'startDate':{'type':Sequelize[_0x19d6('0x3')]},'endDate':{'type':Sequelize[_0x19d6('0x3')]},'status':{'type':Sequelize[_0x19d6('0x0')],'defaultValue':_0x19d6('0x4')},'type':{'type':Sequelize['ENUM'](_0x19d6('0x5'),_0x19d6('0x6')),'allowNull':![],'defaultValue':_0x19d6('0x5')},'reportId':{'type':Sequelize['INTEGER'](0xb)[_0x19d6('0x7')]},'reportType':{'type':Sequelize[_0x19d6('0x0')]}}; \ No newline at end of file +var _0x3a57=['sequelize','moment','exports','STRING','ENUM','csv','xlsx','DATE','manual','scheduled','INTEGER'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x3a57,0xa5));var _0x73a5=function(_0x4841b0,_0x12ba5d){_0x4841b0=_0x4841b0-0x0;var _0xc8064c=_0x3a57[_0x4841b0];return _0xc8064c;};'use strict';var Sequelize=require(_0x73a5('0x0'));var moment=require(_0x73a5('0x1'));module[_0x73a5('0x2')]={'name':{'type':Sequelize[_0x73a5('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0x73a5('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0x73a5('0x4')](_0x73a5('0x5'),'pdf',_0x73a5('0x6')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0x73a5('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0x73a5('0x7')]},'endDate':{'type':Sequelize[_0x73a5('0x7')]},'status':{'type':Sequelize['STRING'],'defaultValue':'Loading'},'type':{'type':Sequelize[_0x73a5('0x4')](_0x73a5('0x8'),_0x73a5('0x9')),'allowNull':![],'defaultValue':_0x73a5('0x8')},'reportId':{'type':Sequelize[_0x73a5('0xa')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index 1551a52..a652adf 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 _0xe716=['query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','findAll','rows','show','params','include','catch','create','role','UserProfileSection','find','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','basename','savename','output','existsSync','join','server/files/reports','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','download','format','%s.%s','toLowerCase','eml-format','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','Content-Range','apply','reject','update','then','get','ExtractedReports','UserProfileResource','destroy','stack','name','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','model'];(function(_0xbfe0d,_0x5e2d89){var _0x59b8f2=function(_0x4e4706){while(--_0x4e4706){_0xbfe0d['push'](_0xbfe0d['shift']());}};_0x59b8f2(++_0x5e2d89);}(_0xe716,0x92));var _0x6e71=function(_0x126364,_0x45e752){_0x126364=_0x126364-0x0;var _0x2ce699=_0xe716[_0x126364];return _0x2ce699;};'use strict';var emlformat=require(_0x6e71('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6e71('0x1'));var jsonpatch=require(_0x6e71('0x2'));var rp=require('request-promise');var moment=require(_0x6e71('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x6e71('0x4'));var util=require(_0x6e71('0x5'));var path=require(_0x6e71('0x6'));var sox=require(_0x6e71('0x7'));var csv=require(_0x6e71('0x8'));var ejs=require(_0x6e71('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6e71('0xa'));var squel=require('squel');var crypto=require(_0x6e71('0xb'));var jsforce=require(_0x6e71('0xc'));var deskjs=require(_0x6e71('0xd'));var toCsv=require(_0x6e71('0x8'));var querystring=require(_0x6e71('0xe'));var Papa=require(_0x6e71('0xf'));var Redis=require(_0x6e71('0x10'));var authService=require(_0x6e71('0x11'));var qs=require(_0x6e71('0x12'));var as=require(_0x6e71('0x13'));var hardwareService=require(_0x6e71('0x14'));var logger=require(_0x6e71('0x15'))(_0x6e71('0x16'));var utils=require(_0x6e71('0x17'));var config=require(_0x6e71('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x6e71('0x19'))['db'];function respondWithStatusCode(_0x3e8f96,_0x16dd3f){_0x16dd3f=_0x16dd3f||0xcc;return function(_0x386c8d){if(_0x386c8d){return _0x3e8f96[_0x6e71('0x1a')](_0x16dd3f);}return _0x3e8f96[_0x6e71('0x1b')](_0x16dd3f)[_0x6e71('0x1c')]();};}function respondWithResult(_0x5ef446,_0x44cd35){_0x44cd35=_0x44cd35||0xc8;return function(_0x32d35e){if(_0x32d35e){return _0x5ef446['status'](_0x44cd35)[_0x6e71('0x1d')](_0x32d35e);}};}function respondWithFilteredResult(_0x2c6390,_0x5004d7){return function(_0x1da31b){if(_0x1da31b){var _0x284950=typeof _0x5004d7['offset']===_0x6e71('0x1e')&&typeof _0x5004d7['limit']===_0x6e71('0x1e');var _0x2dc53b=_0x1da31b[_0x6e71('0x1f')];var _0x10ac7d=_0x284950?0x0:_0x5004d7[_0x6e71('0x20')];var _0x2bf181=_0x284950?_0x1da31b[_0x6e71('0x1f')]:_0x5004d7[_0x6e71('0x20')]+_0x5004d7['limit'];var _0x2eb9b1;if(_0x2bf181>=_0x2dc53b){_0x2bf181=_0x2dc53b;_0x2eb9b1=0xc8;}else{_0x2eb9b1=0xce;}_0x2c6390[_0x6e71('0x1b')](_0x2eb9b1);return _0x2c6390['set'](_0x6e71('0x21'),_0x10ac7d+'-'+_0x2bf181+'/'+_0x2dc53b)[_0x6e71('0x1d')](_0x1da31b);}return null;};}function patchUpdates(_0xeb8d6a){return function(_0x594656){try{jsonpatch[_0x6e71('0x22')](_0x594656,_0xeb8d6a,!![]);}catch(_0xe9c8fd){return BPromise[_0x6e71('0x23')](_0xe9c8fd);}return _0x594656['save']();};}function saveUpdates(_0x30d7e8,_0x28eae4){return function(_0x1e2a61){if(_0x1e2a61){return _0x1e2a61[_0x6e71('0x24')](_0x30d7e8)[_0x6e71('0x25')](function(_0x2c4944){return _0x2c4944;});}return null;};}function removeEntity(_0x4e6bfd,_0x19ee25){return function(_0x213bec){if(_0x213bec){return _0x213bec['destroy']()[_0x6e71('0x25')](function(){var _0x43870b=_0x213bec[_0x6e71('0x26')]({'plain':!![]});var _0x456341=_0x6e71('0x27');return db[_0x6e71('0x28')][_0x6e71('0x29')]({'where':{'type':_0x456341,'resourceId':_0x43870b['id']}})[_0x6e71('0x25')](function(){return _0x213bec;});})[_0x6e71('0x25')](function(){_0x4e6bfd[_0x6e71('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x379036,_0x15d098){return function(_0xe1dae8){if(!_0xe1dae8){_0x379036[_0x6e71('0x1a')](0x194);}return _0xe1dae8;};}function handleError(_0x93489b,_0x2dfaf0){_0x2dfaf0=_0x2dfaf0||0x1f4;return function(_0x4ec2f3){logger['error'](_0x4ec2f3[_0x6e71('0x2a')]);if(_0x4ec2f3[_0x6e71('0x2b')]){delete _0x4ec2f3[_0x6e71('0x2b')];}_0x93489b[_0x6e71('0x1b')](_0x2dfaf0)[_0x6e71('0x2c')](_0x4ec2f3);};}exports[_0x6e71('0x2d')]=function(_0x324cd1,_0x331eea){var _0x141301={},_0x2870ca={},_0x1b90f6={'count':0x0,'rows':[]};var _0x3be3f5=_[_0x6e71('0x2e')](db[_0x6e71('0x2f')][_0x6e71('0x30')],function(_0x38d2cc){return{'name':_0x38d2cc[_0x6e71('0x31')],'type':_0x38d2cc[_0x6e71('0x32')]['key']};});_0x2870ca[_0x6e71('0x33')]=_['map'](_0x3be3f5,_0x6e71('0x2b'));_0x2870ca[_0x6e71('0x34')]=_[_0x6e71('0x35')](_0x324cd1[_0x6e71('0x34')]);_0x2870ca[_0x6e71('0x36')]=_[_0x6e71('0x37')](_0x2870ca['model'],_0x2870ca[_0x6e71('0x34')]);_0x141301[_0x6e71('0x38')]=_[_0x6e71('0x37')](_0x2870ca[_0x6e71('0x33')],qs[_0x6e71('0x39')](_0x324cd1[_0x6e71('0x34')]['fields']));_0x141301[_0x6e71('0x38')]=_0x141301[_0x6e71('0x38')][_0x6e71('0x3a')]?_0x141301['attributes']:_0x2870ca[_0x6e71('0x33')];if(!_0x324cd1[_0x6e71('0x34')][_0x6e71('0x3b')](_0x6e71('0x3c'))){_0x141301[_0x6e71('0x3d')]=qs[_0x6e71('0x3d')](_0x324cd1[_0x6e71('0x34')][_0x6e71('0x3d')]);_0x141301[_0x6e71('0x20')]=qs['offset'](_0x324cd1['query'][_0x6e71('0x20')]);}_0x141301[_0x6e71('0x3e')]=qs['sort'](_0x324cd1[_0x6e71('0x34')][_0x6e71('0x3f')]);_0x141301['where']=qs[_0x6e71('0x36')](_[_0x6e71('0x40')](_0x324cd1[_0x6e71('0x34')],_0x2870ca[_0x6e71('0x36')]),_0x3be3f5);if(_0x324cd1[_0x6e71('0x34')][_0x6e71('0x41')]){_0x141301[_0x6e71('0x42')]=_['merge'](_0x141301[_0x6e71('0x42')],{'$or':_[_0x6e71('0x2e')](_0x3be3f5,function(_0x51b3b7){if(_0x51b3b7[_0x6e71('0x32')]!==_0x6e71('0x43')){var _0x3eb418={};_0x3eb418[_0x51b3b7['name']]={'$like':'%'+_0x324cd1[_0x6e71('0x34')][_0x6e71('0x41')]+'%'};return _0x3eb418;}})});}_0x141301=_[_0x6e71('0x44')]({},_0x141301,_0x324cd1[_0x6e71('0x45')]);var _0x5e2c90={'where':_0x141301[_0x6e71('0x42')]};return db[_0x6e71('0x2f')][_0x6e71('0x1f')](_0x5e2c90)[_0x6e71('0x25')](function(_0x15d43b){_0x1b90f6['count']=_0x15d43b;if(_0x324cd1['query'][_0x6e71('0x46')]){_0x141301['include']=[{'all':!![]}];}return db[_0x6e71('0x2f')][_0x6e71('0x47')](_0x141301);})[_0x6e71('0x25')](function(_0x507192){_0x1b90f6[_0x6e71('0x48')]=_0x507192;return _0x1b90f6;})[_0x6e71('0x25')](respondWithFilteredResult(_0x331eea,_0x141301))['catch'](handleError(_0x331eea,null));};exports[_0x6e71('0x49')]=function(_0x2fb62b,_0x555651){var _0x52ad27={'raw':!![],'where':{'id':_0x2fb62b[_0x6e71('0x4a')]['id']}},_0x5823a3={};_0x5823a3[_0x6e71('0x33')]=_[_0x6e71('0x35')](db[_0x6e71('0x2f')][_0x6e71('0x30')]);_0x5823a3[_0x6e71('0x34')]=_[_0x6e71('0x35')](_0x2fb62b[_0x6e71('0x34')]);_0x5823a3[_0x6e71('0x36')]=_[_0x6e71('0x37')](_0x5823a3[_0x6e71('0x33')],_0x5823a3[_0x6e71('0x34')]);_0x52ad27['attributes']=_[_0x6e71('0x37')](_0x5823a3[_0x6e71('0x33')],qs[_0x6e71('0x39')](_0x2fb62b[_0x6e71('0x34')][_0x6e71('0x39')]));_0x52ad27[_0x6e71('0x38')]=_0x52ad27[_0x6e71('0x38')]['length']?_0x52ad27[_0x6e71('0x38')]:_0x5823a3[_0x6e71('0x33')];if(_0x2fb62b[_0x6e71('0x34')][_0x6e71('0x46')]){_0x52ad27[_0x6e71('0x4b')]=[{'all':!![]}];}_0x52ad27=_[_0x6e71('0x44')]({},_0x52ad27,_0x2fb62b[_0x6e71('0x45')]);return db[_0x6e71('0x2f')]['find'](_0x52ad27)[_0x6e71('0x25')](handleEntityNotFound(_0x555651,null))[_0x6e71('0x25')](respondWithResult(_0x555651,null))[_0x6e71('0x4c')](handleError(_0x555651,null));};exports[_0x6e71('0x4d')]=function(_0x1abe9f,_0xdae892){return db[_0x6e71('0x2f')][_0x6e71('0x4d')](_0x1abe9f['body'],{})[_0x6e71('0x25')](function(_0x203bf7){var _0x23a9a0=_0x1abe9f['user']['get']({'plain':!![]});if(!_0x23a9a0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x23a9a0[_0x6e71('0x4e')]==='user'){var _0x4347e0=_0x203bf7[_0x6e71('0x26')]({'plain':!![]});var _0x4a91e3=_0x6e71('0x27');return db[_0x6e71('0x4f')][_0x6e71('0x50')]({'where':{'name':_0x4a91e3,'userProfileId':_0x23a9a0[_0x6e71('0x51')]},'raw':!![]})[_0x6e71('0x25')](function(_0x70fd92){if(_0x70fd92&&_0x70fd92[_0x6e71('0x52')]===0x0){return db['UserProfileResource'][_0x6e71('0x4d')]({'name':_0x4347e0[_0x6e71('0x2b')],'resourceId':_0x4347e0['id'],'type':_0x70fd92['name'],'sectionId':_0x70fd92['id']},{})['then'](function(){return _0x203bf7;});}else{return _0x203bf7;}})[_0x6e71('0x4c')](function(_0x452ac1){logger[_0x6e71('0x53')](_0x6e71('0x54'),_0x452ac1);throw _0x452ac1;});}return _0x203bf7;})[_0x6e71('0x25')](respondWithResult(_0xdae892,0xc9))[_0x6e71('0x4c')](handleError(_0xdae892,null));};exports[_0x6e71('0x24')]=function(_0x3e72c7,_0x46f8c5){if(_0x3e72c7[_0x6e71('0x55')]['id']){delete _0x3e72c7['body']['id'];}return db[_0x6e71('0x2f')]['find']({'where':{'id':_0x3e72c7[_0x6e71('0x4a')]['id']}})[_0x6e71('0x25')](handleEntityNotFound(_0x46f8c5,null))[_0x6e71('0x25')](saveUpdates(_0x3e72c7[_0x6e71('0x55')],null))['then'](respondWithResult(_0x46f8c5,null))['catch'](handleError(_0x46f8c5,null));};exports[_0x6e71('0x29')]=function(_0x377d0c,_0x25fcb8){return db[_0x6e71('0x2f')]['find']({'where':{'id':_0x377d0c['params']['id']}})[_0x6e71('0x25')](handleEntityNotFound(_0x25fcb8,null))[_0x6e71('0x25')](removeEntity(_0x25fcb8,null))['catch'](handleError(_0x25fcb8,null));};exports['download']=function(_0xa68e7d,_0x3eb59b,_0x11b2ff){return db[_0x6e71('0x2f')]['find']({'where':{'id':_0xa68e7d[_0x6e71('0x4a')]['id']},'attributes':[_0x6e71('0x2b'),_0x6e71('0x56'),_0x6e71('0x57'),_0x6e71('0x58')],'raw':!![]})['then'](handleEntityNotFound(_0x3eb59b,null))[_0x6e71('0x25')](function(_0x5dbc1e){if(_0x5dbc1e){if(!fs[_0x6e71('0x59')](path[_0x6e71('0x5a')](config['root'],_0x6e71('0x5b'),_0x5dbc1e['savename']))){throw new db['Sequelize'][(_0x6e71('0x5c'))](_0x6e71('0x5d'));}if(_0xa68e7d['query'][_0x6e71('0x5e')]){return _0x3eb59b[_0x6e71('0x1a')](0xc8);}return _0x3eb59b[_0x6e71('0x5f')](path[_0x6e71('0x5a')](config['root'],_0x6e71('0x5b'),_0x5dbc1e[_0x6e71('0x57')]),util[_0x6e71('0x60')](_0x6e71('0x61'),_0x5dbc1e[_0x6e71('0x56')]||_0x5dbc1e['name'],_0x5dbc1e[_0x6e71('0x58')][_0x6e71('0x62')]()));}})[_0x6e71('0x4c')](handleError(_0x3eb59b,null));}; \ No newline at end of file +var _0x4d7e=['UserProfileResource','end','error','name','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','rows','catch','show','params','length','find','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','update','body','download','savename','output','root','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','join','format','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','ExtractedReports'];(function(_0x415074,_0x5b1f19){var _0x2c6a28=function(_0x149e45){while(--_0x149e45){_0x415074['push'](_0x415074['shift']());}};_0x2c6a28(++_0x5b1f19);}(_0x4d7e,0x1bd));var _0xe4d7=function(_0x5a3fb1,_0x14dbbc){_0x5a3fb1=_0x5a3fb1-0x0;var _0x49e026=_0x4d7e[_0x5a3fb1];return _0x49e026;};'use strict';var emlformat=require(_0xe4d7('0x0'));var rimraf=require(_0xe4d7('0x1'));var zipdir=require(_0xe4d7('0x2'));var jsonpatch=require(_0xe4d7('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xe4d7('0x4'));var util=require('util');var path=require(_0xe4d7('0x5'));var sox=require(_0xe4d7('0x6'));var csv=require(_0xe4d7('0x7'));var ejs=require(_0xe4d7('0x8'));var fs=require('fs');var fs_extra=require(_0xe4d7('0x9'));var _=require(_0xe4d7('0xa'));var squel=require(_0xe4d7('0xb'));var crypto=require(_0xe4d7('0xc'));var jsforce=require(_0xe4d7('0xd'));var deskjs=require(_0xe4d7('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xe4d7('0xf'));var Redis=require(_0xe4d7('0x10'));var authService=require(_0xe4d7('0x11'));var qs=require(_0xe4d7('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe4d7('0x13'));var logger=require(_0xe4d7('0x14'))(_0xe4d7('0x15'));var utils=require(_0xe4d7('0x16'));var config=require(_0xe4d7('0x17'));var licenseUtil=require(_0xe4d7('0x18'));var db=require(_0xe4d7('0x19'))['db'];function respondWithStatusCode(_0x185580,_0x27f8e8){_0x27f8e8=_0x27f8e8||0xcc;return function(_0xa6aeee){if(_0xa6aeee){return _0x185580[_0xe4d7('0x1a')](_0x27f8e8);}return _0x185580[_0xe4d7('0x1b')](_0x27f8e8)['end']();};}function respondWithResult(_0x588183,_0x460894){_0x460894=_0x460894||0xc8;return function(_0x43f03e){if(_0x43f03e){return _0x588183[_0xe4d7('0x1b')](_0x460894)[_0xe4d7('0x1c')](_0x43f03e);}};}function respondWithFilteredResult(_0x78e8f5,_0x151259){return function(_0x382acf){if(_0x382acf){var _0x45d13b=typeof _0x151259[_0xe4d7('0x1d')]===_0xe4d7('0x1e')&&typeof _0x151259[_0xe4d7('0x1f')]==='undefined';var _0x234d40=_0x382acf[_0xe4d7('0x20')];var _0x3b8675=_0x45d13b?0x0:_0x151259[_0xe4d7('0x1d')];var _0x1b4a75=_0x45d13b?_0x382acf[_0xe4d7('0x20')]:_0x151259['offset']+_0x151259[_0xe4d7('0x1f')];var _0x216e7d;if(_0x1b4a75>=_0x234d40){_0x1b4a75=_0x234d40;_0x216e7d=0xc8;}else{_0x216e7d=0xce;}_0x78e8f5[_0xe4d7('0x1b')](_0x216e7d);return _0x78e8f5[_0xe4d7('0x21')](_0xe4d7('0x22'),_0x3b8675+'-'+_0x1b4a75+'/'+_0x234d40)[_0xe4d7('0x1c')](_0x382acf);}return null;};}function patchUpdates(_0x59153e){return function(_0x4d6dcb){try{jsonpatch['apply'](_0x4d6dcb,_0x59153e,!![]);}catch(_0x2f57be){return BPromise[_0xe4d7('0x23')](_0x2f57be);}return _0x4d6dcb[_0xe4d7('0x24')]();};}function saveUpdates(_0xfc40a1,_0x358d0f){return function(_0x4a55ea){if(_0x4a55ea){return _0x4a55ea['update'](_0xfc40a1)[_0xe4d7('0x25')](function(_0x1868f7){return _0x1868f7;});}return null;};}function removeEntity(_0xda405f,_0x45993c){return function(_0x3cc1b0){if(_0x3cc1b0){return _0x3cc1b0[_0xe4d7('0x26')]()[_0xe4d7('0x25')](function(){var _0x21f5bc=_0x3cc1b0['get']({'plain':!![]});var _0x2ca9aa=_0xe4d7('0x27');return db[_0xe4d7('0x28')]['destroy']({'where':{'type':_0x2ca9aa,'resourceId':_0x21f5bc['id']}})['then'](function(){return _0x3cc1b0;});})[_0xe4d7('0x25')](function(){_0xda405f[_0xe4d7('0x1b')](0xcc)[_0xe4d7('0x29')]();});}};}function handleEntityNotFound(_0x2cebc0,_0x42f909){return function(_0x7c4464){if(!_0x7c4464){_0x2cebc0['sendStatus'](0x194);}return _0x7c4464;};}function handleError(_0x98ad54,_0x1c5226){_0x1c5226=_0x1c5226||0x1f4;return function(_0x24cc0e){logger[_0xe4d7('0x2a')](_0x24cc0e['stack']);if(_0x24cc0e['name']){delete _0x24cc0e[_0xe4d7('0x2b')];}_0x98ad54[_0xe4d7('0x1b')](_0x1c5226)[_0xe4d7('0x2c')](_0x24cc0e);};}exports[_0xe4d7('0x2d')]=function(_0x1a12c0,_0x2f4f0c){var _0x4c86ad={},_0x2bdd8d={},_0x35c0fe={'count':0x0,'rows':[]};var _0x207c54=_[_0xe4d7('0x2e')](db[_0xe4d7('0x2f')][_0xe4d7('0x30')],function(_0xb79e1b){return{'name':_0xb79e1b[_0xe4d7('0x31')],'type':_0xb79e1b[_0xe4d7('0x32')][_0xe4d7('0x33')]};});_0x2bdd8d[_0xe4d7('0x34')]=_[_0xe4d7('0x2e')](_0x207c54,_0xe4d7('0x2b'));_0x2bdd8d['query']=_[_0xe4d7('0x35')](_0x1a12c0[_0xe4d7('0x36')]);_0x2bdd8d[_0xe4d7('0x37')]=_[_0xe4d7('0x38')](_0x2bdd8d[_0xe4d7('0x34')],_0x2bdd8d[_0xe4d7('0x36')]);_0x4c86ad[_0xe4d7('0x39')]=_[_0xe4d7('0x38')](_0x2bdd8d[_0xe4d7('0x34')],qs[_0xe4d7('0x3a')](_0x1a12c0['query']['fields']));_0x4c86ad['attributes']=_0x4c86ad['attributes']['length']?_0x4c86ad[_0xe4d7('0x39')]:_0x2bdd8d[_0xe4d7('0x34')];if(!_0x1a12c0[_0xe4d7('0x36')]['hasOwnProperty']('nolimit')){_0x4c86ad[_0xe4d7('0x1f')]=qs['limit'](_0x1a12c0['query'][_0xe4d7('0x1f')]);_0x4c86ad[_0xe4d7('0x1d')]=qs['offset'](_0x1a12c0['query']['offset']);}_0x4c86ad[_0xe4d7('0x3b')]=qs[_0xe4d7('0x3c')](_0x1a12c0['query'][_0xe4d7('0x3c')]);_0x4c86ad[_0xe4d7('0x3d')]=qs[_0xe4d7('0x37')](_[_0xe4d7('0x3e')](_0x1a12c0[_0xe4d7('0x36')],_0x2bdd8d['filters']),_0x207c54);if(_0x1a12c0[_0xe4d7('0x36')]['filter']){_0x4c86ad[_0xe4d7('0x3d')]=_[_0xe4d7('0x3f')](_0x4c86ad[_0xe4d7('0x3d')],{'$or':_[_0xe4d7('0x2e')](_0x207c54,function(_0x5d3127){if(_0x5d3127[_0xe4d7('0x32')]!==_0xe4d7('0x40')){var _0x43008d={};_0x43008d[_0x5d3127[_0xe4d7('0x2b')]]={'$like':'%'+_0x1a12c0[_0xe4d7('0x36')][_0xe4d7('0x41')]+'%'};return _0x43008d;}})});}_0x4c86ad=_[_0xe4d7('0x3f')]({},_0x4c86ad,_0x1a12c0[_0xe4d7('0x42')]);var _0x15d7bc={'where':_0x4c86ad[_0xe4d7('0x3d')]};return db['AnalyticExtractedReport'][_0xe4d7('0x20')](_0x15d7bc)[_0xe4d7('0x25')](function(_0x1457f1){_0x35c0fe[_0xe4d7('0x20')]=_0x1457f1;if(_0x1a12c0['query'][_0xe4d7('0x43')]){_0x4c86ad[_0xe4d7('0x44')]=[{'all':!![]}];}return db[_0xe4d7('0x2f')]['findAll'](_0x4c86ad);})[_0xe4d7('0x25')](function(_0x46accd){_0x35c0fe[_0xe4d7('0x45')]=_0x46accd;return _0x35c0fe;})[_0xe4d7('0x25')](respondWithFilteredResult(_0x2f4f0c,_0x4c86ad))[_0xe4d7('0x46')](handleError(_0x2f4f0c,null));};exports[_0xe4d7('0x47')]=function(_0x339f57,_0x586d5f){var _0x2d22ba={'raw':!![],'where':{'id':_0x339f57[_0xe4d7('0x48')]['id']}},_0x1f6ff0={};_0x1f6ff0['model']=_[_0xe4d7('0x35')](db[_0xe4d7('0x2f')]['rawAttributes']);_0x1f6ff0[_0xe4d7('0x36')]=_[_0xe4d7('0x35')](_0x339f57[_0xe4d7('0x36')]);_0x1f6ff0['filters']=_[_0xe4d7('0x38')](_0x1f6ff0['model'],_0x1f6ff0[_0xe4d7('0x36')]);_0x2d22ba['attributes']=_[_0xe4d7('0x38')](_0x1f6ff0[_0xe4d7('0x34')],qs[_0xe4d7('0x3a')](_0x339f57[_0xe4d7('0x36')]['fields']));_0x2d22ba[_0xe4d7('0x39')]=_0x2d22ba['attributes'][_0xe4d7('0x49')]?_0x2d22ba['attributes']:_0x1f6ff0[_0xe4d7('0x34')];if(_0x339f57[_0xe4d7('0x36')][_0xe4d7('0x43')]){_0x2d22ba[_0xe4d7('0x44')]=[{'all':!![]}];}_0x2d22ba=_[_0xe4d7('0x3f')]({},_0x2d22ba,_0x339f57[_0xe4d7('0x42')]);return db[_0xe4d7('0x2f')][_0xe4d7('0x4a')](_0x2d22ba)[_0xe4d7('0x25')](handleEntityNotFound(_0x586d5f,null))['then'](respondWithResult(_0x586d5f,null))[_0xe4d7('0x46')](handleError(_0x586d5f,null));};exports['create']=function(_0x339e7f,_0xcd5def){return db['AnalyticExtractedReport'][_0xe4d7('0x4b')](_0x339e7f['body'],{})[_0xe4d7('0x25')](function(_0x38db7b){var _0x189ccc=_0x339e7f['user'][_0xe4d7('0x4c')]({'plain':!![]});if(!_0x189ccc)throw new Error(_0xe4d7('0x4d'));if(_0x189ccc[_0xe4d7('0x4e')]===_0xe4d7('0x4f')){var _0x253d4a=_0x38db7b['get']({'plain':!![]});var _0x1ef92c='ExtractedReports';return db[_0xe4d7('0x50')][_0xe4d7('0x4a')]({'where':{'name':_0x1ef92c,'userProfileId':_0x189ccc[_0xe4d7('0x51')]},'raw':!![]})[_0xe4d7('0x25')](function(_0x3e0a7c){if(_0x3e0a7c&&_0x3e0a7c[_0xe4d7('0x52')]===0x0){return db[_0xe4d7('0x28')][_0xe4d7('0x4b')]({'name':_0x253d4a[_0xe4d7('0x2b')],'resourceId':_0x253d4a['id'],'type':_0x3e0a7c[_0xe4d7('0x2b')],'sectionId':_0x3e0a7c['id']},{})[_0xe4d7('0x25')](function(){return _0x38db7b;});}else{return _0x38db7b;}})[_0xe4d7('0x46')](function(_0x4425fc){logger[_0xe4d7('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4425fc);throw _0x4425fc;});}return _0x38db7b;})['then'](respondWithResult(_0xcd5def,0xc9))['catch'](handleError(_0xcd5def,null));};exports[_0xe4d7('0x53')]=function(_0x38025b,_0x3e077a){if(_0x38025b['body']['id']){delete _0x38025b[_0xe4d7('0x54')]['id'];}return db[_0xe4d7('0x2f')][_0xe4d7('0x4a')]({'where':{'id':_0x38025b[_0xe4d7('0x48')]['id']}})[_0xe4d7('0x25')](handleEntityNotFound(_0x3e077a,null))[_0xe4d7('0x25')](saveUpdates(_0x38025b[_0xe4d7('0x54')],null))[_0xe4d7('0x25')](respondWithResult(_0x3e077a,null))[_0xe4d7('0x46')](handleError(_0x3e077a,null));};exports[_0xe4d7('0x26')]=function(_0x159220,_0xa00d62){return db[_0xe4d7('0x2f')][_0xe4d7('0x4a')]({'where':{'id':_0x159220[_0xe4d7('0x48')]['id']}})['then'](handleEntityNotFound(_0xa00d62,null))[_0xe4d7('0x25')](removeEntity(_0xa00d62,null))['catch'](handleError(_0xa00d62,null));};exports[_0xe4d7('0x55')]=function(_0x3eef96,_0x9c5cd2,_0x676db2){return db[_0xe4d7('0x2f')][_0xe4d7('0x4a')]({'where':{'id':_0x3eef96['params']['id']},'attributes':[_0xe4d7('0x2b'),'basename',_0xe4d7('0x56'),_0xe4d7('0x57')],'raw':!![]})['then'](handleEntityNotFound(_0x9c5cd2,null))[_0xe4d7('0x25')](function(_0x40a595){if(_0x40a595){if(!fs['existsSync'](path['join'](config[_0xe4d7('0x58')],_0xe4d7('0x59'),_0x40a595[_0xe4d7('0x56')]))){throw new db[(_0xe4d7('0x5a'))][(_0xe4d7('0x5b'))](_0xe4d7('0x5c'));}if(_0x3eef96[_0xe4d7('0x36')][_0xe4d7('0x5d')]){return _0x9c5cd2[_0xe4d7('0x1a')](0xc8);}return _0x9c5cd2[_0xe4d7('0x55')](path[_0xe4d7('0x5e')](config[_0xe4d7('0x58')],_0xe4d7('0x59'),_0x40a595['savename']),util[_0xe4d7('0x5f')]('%s.%s',_0x40a595['basename']||_0x40a595[_0xe4d7('0x2b')],_0x40a595[_0xe4d7('0x57')][_0xe4d7('0x60')]()));}})['catch'](handleError(_0x9c5cd2,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index 028909b..7467c05 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 _0x867e=['path','../../config/environment','./analyticExtractedReport.attributes','AnalyticExtractedReport','analytics_extracted_reports','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x45317b,_0xe6022b){var _0x27488f=function(_0x2e5431){while(--_0x2e5431){_0x45317b['push'](_0x45317b['shift']());}};_0x27488f(++_0xe6022b);}(_0x867e,0x89));var _0xe867=function(_0x1745aa,_0x3505d3){_0x1745aa=_0x1745aa-0x0;var _0x96f7a9=_0x867e[_0x1745aa];return _0x96f7a9;};'use strict';var _=require(_0xe867('0x0'));var util=require(_0xe867('0x1'));var logger=require(_0xe867('0x2'))(_0xe867('0x3'));var moment=require(_0xe867('0x4'));var BPromise=require(_0xe867('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe867('0x6'));var rimraf=require('rimraf');var config=require(_0xe867('0x7'));var attributes=require(_0xe867('0x8'));module['exports']=function(_0x5a4a21,_0x5e8aec){return _0x5a4a21['define'](_0xe867('0x9'),attributes,{'tableName':_0xe867('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf0ea=['../../config/environment','./analyticExtractedReport.attributes','AnalyticExtractedReport','analytics_extracted_reports','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xf0ea,0x12d));var _0xaf0e=function(_0x3a2f82,_0x5ef637){_0x3a2f82=_0x3a2f82-0x0;var _0x52ba90=_0xf0ea[_0x3a2f82];return _0x52ba90;};'use strict';var _=require(_0xaf0e('0x0'));var util=require('util');var logger=require(_0xaf0e('0x1'))(_0xaf0e('0x2'));var moment=require(_0xaf0e('0x3'));var BPromise=require(_0xaf0e('0x4'));var rp=require(_0xaf0e('0x5'));var fs=require('fs');var path=require(_0xaf0e('0x6'));var rimraf=require('rimraf');var config=require(_0xaf0e('0x7'));var attributes=require(_0xaf0e('0x8'));module['exports']=function(_0xbb74b7,_0x371415){return _0xbb74b7['define'](_0xaf0e('0x9'),attributes,{'tableName':_0xaf0e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js index bf6ff44..638d54c 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 _0x4b39=['AnalyticExtractedReport,\x20%s,\x20%s','message','catch','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','request\x20sent','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x31cef4,_0x2b7946){var _0x1bda27=function(_0x49fe13){while(--_0x49fe13){_0x31cef4['push'](_0x31cef4['shift']());}};_0x1bda27(++_0x2b7946);}(_0x4b39,0x133));var _0x94b3=function(_0x5d9cdf,_0x40a459){_0x5d9cdf=_0x5d9cdf-0x0;var _0x3074b4=_0x4b39[_0x5d9cdf];return _0x3074b4;};'use strict';var _=require(_0x94b3('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x94b3('0x1'));var rs=require(_0x94b3('0x2'));var fs=require('fs');var Redis=require(_0x94b3('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x94b3('0x4'));var logger=require(_0x94b3('0x5'))(_0x94b3('0x6'));var config=require(_0x94b3('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x94b3('0x8')][_0x94b3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x25daa0,_0x547e4d,_0x19a221){return new BPromise(function(_0x538ad5,_0x363a67){return client['request'](_0x25daa0,_0x19a221)[_0x94b3('0xa')](function(_0x4e6307){logger[_0x94b3('0xb')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x547e4d,_0x94b3('0xc'));logger['debug'](_0x94b3('0xd'),_0x547e4d,_0x94b3('0xc'),JSON[_0x94b3('0xe')](_0x4e6307));if(_0x4e6307['error']){if(_0x4e6307[_0x94b3('0xf')]['code']===0x1f4){logger[_0x94b3('0xf')](_0x94b3('0x10'),_0x547e4d,_0x4e6307[_0x94b3('0xf')][_0x94b3('0x11')]);return _0x363a67(_0x4e6307['error']['message']);}logger[_0x94b3('0xf')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x547e4d,_0x4e6307[_0x94b3('0xf')]['message']);return _0x538ad5(_0x4e6307[_0x94b3('0xf')][_0x94b3('0x11')]);}else{logger['info'](_0x94b3('0x10'),_0x547e4d,_0x94b3('0xc'));_0x538ad5(_0x4e6307['result'][_0x94b3('0x11')]);}})[_0x94b3('0x12')](function(_0x1896ec){logger[_0x94b3('0xf')](_0x94b3('0x10'),_0x547e4d,_0x1896ec);_0x363a67(_0x1896ec);});});} \ No newline at end of file +var _0x8292=['randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','moment','bluebird'];(function(_0x3cefed,_0x2d8ac4){var _0x366f63=function(_0x4c87aa){while(--_0x4c87aa){_0x3cefed['push'](_0x3cefed['shift']());}};_0x366f63(++_0x2d8ac4);}(_0x8292,0x19b));var _0x2829=function(_0x31f85c,_0x13dbef){_0x31f85c=_0x31f85c-0x0;var _0x3d057f=_0x8292[_0x31f85c];return _0x3d057f;};'use strict';var _=require(_0x2829('0x0'));var util=require('util');var moment=require(_0x2829('0x1'));var BPromise=require(_0x2829('0x2'));var rs=require(_0x2829('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2829('0x4'))['db'];var utils=require(_0x2829('0x5'));var logger=require(_0x2829('0x6'))('rpc');var config=require(_0x2829('0x7'));var jayson=require(_0x2829('0x8'));var client=jayson[_0x2829('0x9')][_0x2829('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x36735f,_0x33bf09,_0x39f092){return new BPromise(function(_0x1146ee,_0x14bbe2){return client[_0x2829('0xb')](_0x36735f,_0x39f092)[_0x2829('0xc')](function(_0xddf604){logger['info'](_0x2829('0xd'),_0x33bf09,_0x2829('0xe'));logger[_0x2829('0xf')](_0x2829('0x10'),_0x33bf09,_0x2829('0xe'),JSON[_0x2829('0x11')](_0xddf604));if(_0xddf604[_0x2829('0x12')]){if(_0xddf604['error']['code']===0x1f4){logger[_0x2829('0x12')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x33bf09,_0xddf604[_0x2829('0x12')][_0x2829('0x13')]);return _0x14bbe2(_0xddf604['error'][_0x2829('0x13')]);}logger[_0x2829('0x12')](_0x2829('0xd'),_0x33bf09,_0xddf604[_0x2829('0x12')]['message']);return _0x1146ee(_0xddf604['error']['message']);}else{logger[_0x2829('0x14')](_0x2829('0xd'),_0x33bf09,_0x2829('0xe'));_0x1146ee(_0xddf604[_0x2829('0x15')][_0x2829('0x13')]);}})[_0x2829('0x16')](function(_0x5e71ab){logger['error']('AnalyticExtractedReport,\x20%s,\x20%s',_0x33bf09,_0x5e71ab);_0x14bbe2(_0x5e71ab);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index 3e27dc8..72f3e32 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 _0x38c7=['download','post','create','put','update','delete','/:id','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','isAuthenticated','index','get','show','/:id/download'];(function(_0x3c7e74,_0x431a67){var _0x5e7924=function(_0x39e11f){while(--_0x39e11f){_0x3c7e74['push'](_0x3c7e74['shift']());}};_0x5e7924(++_0x431a67);}(_0x38c7,0x16d));var _0x738c=function(_0x5c5eb6,_0x351da8){_0x5c5eb6=_0x5c5eb6-0x0;var _0xe4b6d4=_0x38c7[_0x5c5eb6];return _0xe4b6d4;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x738c('0x0'));var timeout=require(_0x738c('0x1'));var express=require(_0x738c('0x2'));var router=express[_0x738c('0x3')]();var fs_extra=require(_0x738c('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x738c('0x5'));var config=require(_0x738c('0x6'));var controller=require(_0x738c('0x7'));router['get']('/',auth[_0x738c('0x8')](),controller[_0x738c('0x9')]);router[_0x738c('0xa')]('/:id',auth[_0x738c('0x8')](),controller[_0x738c('0xb')]);router[_0x738c('0xa')](_0x738c('0xc'),auth['isAuthenticated'](),controller[_0x738c('0xd')]);router[_0x738c('0xe')]('/',auth[_0x738c('0x8')](),controller[_0x738c('0xf')]);router[_0x738c('0x10')]('/:id',auth[_0x738c('0x8')](),controller[_0x738c('0x11')]);router[_0x738c('0x12')](_0x738c('0x13'),auth[_0x738c('0x8')](),controller['destroy']);module[_0x738c('0x14')]=router; \ No newline at end of file +var _0xf8d9=['./analyticExtractedReport.controller','index','get','/:id','isAuthenticated','show','download','post','create','destroy','multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment'];(function(_0x2b357c,_0x4c562c){var _0x50ca27=function(_0x6c6eba){while(--_0x6c6eba){_0x2b357c['push'](_0x2b357c['shift']());}};_0x50ca27(++_0x4c562c);}(_0xf8d9,0x15e));var _0x9f8d=function(_0x30a5b5,_0x21e05e){_0x30a5b5=_0x30a5b5-0x0;var _0x58e1c4=_0xf8d9[_0x30a5b5];return _0x58e1c4;};'use strict';var multer=require(_0x9f8d('0x0'));var util=require(_0x9f8d('0x1'));var path=require('path');var timeout=require(_0x9f8d('0x2'));var express=require(_0x9f8d('0x3'));var router=express[_0x9f8d('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x9f8d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x9f8d('0x6'));var controller=require(_0x9f8d('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x9f8d('0x8')]);router[_0x9f8d('0x9')](_0x9f8d('0xa'),auth[_0x9f8d('0xb')](),controller[_0x9f8d('0xc')]);router[_0x9f8d('0x9')]('/:id/download',auth[_0x9f8d('0xb')](),controller[_0x9f8d('0xd')]);router[_0x9f8d('0xe')]('/',auth[_0x9f8d('0xb')](),controller[_0x9f8d('0xf')]);router['put'](_0x9f8d('0xa'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x9f8d('0x10')]);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 a6946f8..a888b8f 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 _0xfd39=['sequelize','TEXT','STRING','BOOLEAN'];(function(_0x56a871,_0x18b7fe){var _0x124954=function(_0x39b7a1){while(--_0x39b7a1){_0x56a871['push'](_0x56a871['shift']());}};_0x124954(++_0x18b7fe);}(_0xfd39,0x17c));var _0x9fd3=function(_0x2da602,_0x2bcacb){_0x2da602=_0x2da602-0x0;var _0x70aa4c=_0xfd39[_0x2da602];return _0x70aa4c;};'use strict';var Sequelize=require(_0x9fd3('0x0'));module['exports']={'field':{'type':Sequelize[_0x9fd3('0x1')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0x9fd3('0x2')]},'format':{'type':Sequelize[_0x9fd3('0x2')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x9fd3('0x2')]},'custom':{'type':Sequelize[_0x9fd3('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x3728=['sequelize','exports','TEXT','STRING'];(function(_0x5eefd3,_0x3bb469){var _0x21272b=function(_0x4d540d){while(--_0x4d540d){_0x5eefd3['push'](_0x5eefd3['shift']());}};_0x21272b(++_0x3bb469);}(_0x3728,0x11c));var _0x8372=function(_0x4b4c32,_0x508ae1){_0x4b4c32=_0x4b4c32-0x0;var _0x265dc0=_0x3728[_0x4b4c32];return _0x265dc0;};'use strict';var Sequelize=require(_0x8372('0x0'));module[_0x8372('0x1')]={'field':{'type':Sequelize[_0x8372('0x2')]},'alias':{'type':Sequelize[_0x8372('0x3')]},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js index d040137..10ffa24 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 _0xf3aa=['../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','AnalyticFieldReport','then','includeAll','include','findAll','rows','catch','params','length','find','create','bulkCreate','ids','addFields','AnalyticCustomReport','findOne','body','CustomReportId','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x13b8f3,_0x442821){var _0x1a6d06=function(_0x5126f2){while(--_0x5126f2){_0x13b8f3['push'](_0x13b8f3['shift']());}};_0x1a6d06(++_0x442821);}(_0xf3aa,0xe7));var _0xaf3a=function(_0x11fd4e,_0x1a32ec){_0x11fd4e=_0x11fd4e-0x0;var _0x324371=_0xf3aa[_0x11fd4e];return _0x324371;};'use strict';var emlformat=require(_0xaf3a('0x0'));var rimraf=require(_0xaf3a('0x1'));var zipdir=require(_0xaf3a('0x2'));var jsonpatch=require(_0xaf3a('0x3'));var rp=require(_0xaf3a('0x4'));var moment=require('moment');var BPromise=require(_0xaf3a('0x5'));var Mustache=require(_0xaf3a('0x6'));var util=require(_0xaf3a('0x7'));var path=require(_0xaf3a('0x8'));var sox=require(_0xaf3a('0x9'));var csv=require(_0xaf3a('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xaf3a('0xb'));var _=require(_0xaf3a('0xc'));var squel=require(_0xaf3a('0xd'));var crypto=require(_0xaf3a('0xe'));var jsforce=require(_0xaf3a('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xaf3a('0x10'));var Papa=require(_0xaf3a('0x11'));var Redis=require(_0xaf3a('0x12'));var authService=require(_0xaf3a('0x13'));var qs=require(_0xaf3a('0x14'));var as=require(_0xaf3a('0x15'));var hardwareService=require(_0xaf3a('0x16'));var logger=require(_0xaf3a('0x17'))(_0xaf3a('0x18'));var utils=require(_0xaf3a('0x19'));var config=require(_0xaf3a('0x1a'));var licenseUtil=require(_0xaf3a('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2585ef,_0x49d1d2){_0x49d1d2=_0x49d1d2||0xcc;return function(_0x2b78f7){if(_0x2b78f7){return _0x2585ef[_0xaf3a('0x1c')](_0x49d1d2);}return _0x2585ef[_0xaf3a('0x1d')](_0x49d1d2)[_0xaf3a('0x1e')]();};}function respondWithResult(_0x535551,_0x36958d){_0x36958d=_0x36958d||0xc8;return function(_0x424391){if(_0x424391){return _0x535551[_0xaf3a('0x1d')](_0x36958d)[_0xaf3a('0x1f')](_0x424391);}};}function respondWithFilteredResult(_0x566ce2,_0x173fc8){return function(_0x4357bd){if(_0x4357bd){var _0x3ffea6=typeof _0x173fc8[_0xaf3a('0x20')]===_0xaf3a('0x21')&&typeof _0x173fc8[_0xaf3a('0x22')]===_0xaf3a('0x21');var _0x29997c=_0x4357bd[_0xaf3a('0x23')];var _0x1b022f=_0x3ffea6?0x0:_0x173fc8[_0xaf3a('0x20')];var _0x4ba42a=_0x3ffea6?_0x4357bd[_0xaf3a('0x23')]:_0x173fc8[_0xaf3a('0x20')]+_0x173fc8[_0xaf3a('0x22')];var _0x25e8a3;if(_0x4ba42a>=_0x29997c){_0x4ba42a=_0x29997c;_0x25e8a3=0xc8;}else{_0x25e8a3=0xce;}_0x566ce2['status'](_0x25e8a3);return _0x566ce2[_0xaf3a('0x24')]('Content-Range',_0x1b022f+'-'+_0x4ba42a+'/'+_0x29997c)[_0xaf3a('0x1f')](_0x4357bd);}return null;};}function patchUpdates(_0x453fb4){return function(_0x511f76){try{jsonpatch[_0xaf3a('0x25')](_0x511f76,_0x453fb4,!![]);}catch(_0x3f72d8){return BPromise[_0xaf3a('0x26')](_0x3f72d8);}return _0x511f76[_0xaf3a('0x27')]();};}function saveUpdates(_0x4bea2c,_0x5bb58c){return function(_0x3ddbfc){if(_0x3ddbfc){return _0x3ddbfc[_0xaf3a('0x28')](_0x4bea2c)['then'](function(_0x28cbd3){return _0x28cbd3;});}return null;};}function removeEntity(_0x511abb,_0x4d6008){return function(_0x5b80ed){if(_0x5b80ed){return _0x5b80ed[_0xaf3a('0x29')]()['then'](function(){_0x511abb[_0xaf3a('0x1d')](0xcc)[_0xaf3a('0x1e')]();});}};}function handleEntityNotFound(_0x12504a,_0x804fac){return function(_0x527394){if(!_0x527394){_0x12504a[_0xaf3a('0x1c')](0x194);}return _0x527394;};}function handleError(_0x39d637,_0xb5db33){_0xb5db33=_0xb5db33||0x1f4;return function(_0x5f3b81){logger[_0xaf3a('0x2a')](_0x5f3b81[_0xaf3a('0x2b')]);if(_0x5f3b81[_0xaf3a('0x2c')]){delete _0x5f3b81[_0xaf3a('0x2c')];}_0x39d637[_0xaf3a('0x1d')](_0xb5db33)[_0xaf3a('0x2d')](_0x5f3b81);};}exports[_0xaf3a('0x2e')]=function(_0xcc95ed,_0x7277c){var _0x37b9f2={},_0x126d05={},_0x1ffb37={'count':0x0,'rows':[]};var _0x125219=_[_0xaf3a('0x2f')](db['AnalyticFieldReport'][_0xaf3a('0x30')],function(_0x5401ea){return{'name':_0x5401ea[_0xaf3a('0x31')],'type':_0x5401ea[_0xaf3a('0x32')][_0xaf3a('0x33')]};});_0x126d05[_0xaf3a('0x34')]=_[_0xaf3a('0x2f')](_0x125219,_0xaf3a('0x2c'));_0x126d05[_0xaf3a('0x35')]=_[_0xaf3a('0x36')](_0xcc95ed[_0xaf3a('0x35')]);_0x126d05[_0xaf3a('0x37')]=_[_0xaf3a('0x38')](_0x126d05[_0xaf3a('0x34')],_0x126d05['query']);_0x37b9f2[_0xaf3a('0x39')]=_[_0xaf3a('0x38')](_0x126d05[_0xaf3a('0x34')],qs['fields'](_0xcc95ed['query'][_0xaf3a('0x3a')]));_0x37b9f2['attributes']=_0x37b9f2[_0xaf3a('0x39')]['length']?_0x37b9f2[_0xaf3a('0x39')]:_0x126d05[_0xaf3a('0x34')];if(!_0xcc95ed[_0xaf3a('0x35')][_0xaf3a('0x3b')](_0xaf3a('0x3c'))){_0x37b9f2['limit']=qs[_0xaf3a('0x22')](_0xcc95ed['query'][_0xaf3a('0x22')]);_0x37b9f2[_0xaf3a('0x20')]=qs[_0xaf3a('0x20')](_0xcc95ed[_0xaf3a('0x35')]['offset']);}_0x37b9f2[_0xaf3a('0x3d')]=qs[_0xaf3a('0x3e')](_0xcc95ed[_0xaf3a('0x35')][_0xaf3a('0x3e')]);_0x37b9f2['where']=qs[_0xaf3a('0x37')](_['pick'](_0xcc95ed[_0xaf3a('0x35')],_0x126d05[_0xaf3a('0x37')]),_0x125219);if(_0xcc95ed[_0xaf3a('0x35')][_0xaf3a('0x3f')]){_0x37b9f2[_0xaf3a('0x40')]=_[_0xaf3a('0x41')](_0x37b9f2[_0xaf3a('0x40')],{'$or':_[_0xaf3a('0x2f')](_0x125219,function(_0x5671bb){if(_0x5671bb[_0xaf3a('0x32')]!==_0xaf3a('0x42')){var _0x45b6b2={};_0x45b6b2[_0x5671bb[_0xaf3a('0x2c')]]={'$like':'%'+_0xcc95ed['query']['filter']+'%'};return _0x45b6b2;}})});}_0x37b9f2=_[_0xaf3a('0x41')]({},_0x37b9f2,_0xcc95ed[_0xaf3a('0x43')]);var _0x4ff3e7={'where':_0x37b9f2[_0xaf3a('0x40')]};return db[_0xaf3a('0x44')][_0xaf3a('0x23')](_0x4ff3e7)[_0xaf3a('0x45')](function(_0x249c1b){_0x1ffb37['count']=_0x249c1b;if(_0xcc95ed[_0xaf3a('0x35')][_0xaf3a('0x46')]){_0x37b9f2[_0xaf3a('0x47')]=[{'all':!![]}];}return db[_0xaf3a('0x44')][_0xaf3a('0x48')](_0x37b9f2);})[_0xaf3a('0x45')](function(_0x55c23e){_0x1ffb37[_0xaf3a('0x49')]=_0x55c23e;return _0x1ffb37;})[_0xaf3a('0x45')](respondWithFilteredResult(_0x7277c,_0x37b9f2))[_0xaf3a('0x4a')](handleError(_0x7277c,null));};exports['show']=function(_0x5c9e02,_0x3985c4){var _0x4a4460={'raw':![],'where':{'id':_0x5c9e02[_0xaf3a('0x4b')]['id']}},_0xae4a58={};_0xae4a58[_0xaf3a('0x34')]=_['keys'](db['AnalyticFieldReport']['rawAttributes']);_0xae4a58[_0xaf3a('0x35')]=_[_0xaf3a('0x36')](_0x5c9e02[_0xaf3a('0x35')]);_0xae4a58[_0xaf3a('0x37')]=_['intersection'](_0xae4a58['model'],_0xae4a58[_0xaf3a('0x35')]);_0x4a4460[_0xaf3a('0x39')]=_[_0xaf3a('0x38')](_0xae4a58['model'],qs[_0xaf3a('0x3a')](_0x5c9e02['query'][_0xaf3a('0x3a')]));_0x4a4460[_0xaf3a('0x39')]=_0x4a4460[_0xaf3a('0x39')][_0xaf3a('0x4c')]?_0x4a4460[_0xaf3a('0x39')]:_0xae4a58['model'];if(_0x5c9e02['query'][_0xaf3a('0x46')]){_0x4a4460[_0xaf3a('0x47')]=[{'all':!![]}];}_0x4a4460=_[_0xaf3a('0x41')]({},_0x4a4460,_0x5c9e02[_0xaf3a('0x43')]);return db[_0xaf3a('0x44')][_0xaf3a('0x4d')](_0x4a4460)[_0xaf3a('0x45')](handleEntityNotFound(_0x3985c4,null))[_0xaf3a('0x45')](respondWithResult(_0x3985c4,null))[_0xaf3a('0x4a')](handleError(_0x3985c4,null));};exports[_0xaf3a('0x4e')]=function(_0x2d00b1,_0x10bce2){return db[_0xaf3a('0x44')]['create'](_0x2d00b1['body'],{})[_0xaf3a('0x45')](respondWithResult(_0x10bce2,0xc9))[_0xaf3a('0x4a')](handleError(_0x10bce2,null));};exports[_0xaf3a('0x4f')]=function(_0x415289,_0xb2d845){return db[_0xaf3a('0x44')][_0xaf3a('0x4f')](_0x415289['body'],{'raw':![],'individualHooks':!![]})[_0xaf3a('0x45')](respondWithResult(_0xb2d845,0xc9))[_0xaf3a('0x4a')](handleError(_0xb2d845,null));};exports[_0xaf3a('0x28')]=function(_0x41122a,_0x11e639){if(_0x41122a['body']['id']){delete _0x41122a['body']['id'];}return db[_0xaf3a('0x44')][_0xaf3a('0x4d')]({'where':{'id':_0x41122a[_0xaf3a('0x4b')]['id']}})[_0xaf3a('0x45')](handleEntityNotFound(_0x11e639,null))['then'](saveUpdates(_0x41122a['body'],null))[_0xaf3a('0x45')](respondWithResult(_0x11e639,null))[_0xaf3a('0x4a')](handleError(_0x11e639,null));};exports[_0xaf3a('0x29')]=function(_0x59a8c3,_0x101421){return db['AnalyticFieldReport']['find']({'where':{'id':_0x59a8c3[_0xaf3a('0x4b')]['id']}})[_0xaf3a('0x45')](handleEntityNotFound(_0x101421,null))[_0xaf3a('0x45')](removeEntity(_0x101421,null))[_0xaf3a('0x4a')](handleError(_0x101421,null));};exports['bulkDestroy']=function(_0x3f2bf0,_0x45cde9){return db['AnalyticFieldReport'][_0xaf3a('0x29')]({'where':{'id':_0x3f2bf0[_0xaf3a('0x35')][_0xaf3a('0x50')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x45cde9,0xcc))[_0xaf3a('0x4a')](handleError(_0x45cde9,null));};exports[_0xaf3a('0x51')]=function(_0x4d3d3c,_0x374a25,_0x22992a){return db[_0xaf3a('0x52')][_0xaf3a('0x53')]({'where':{'id':_0x4d3d3c[_0xaf3a('0x4b')]['id']}})[_0xaf3a('0x45')](handleEntityNotFound(_0x374a25,null))[_0xaf3a('0x45')](function(_0x40dc13){if(_0x40dc13){return db['sequelize']['transaction'](function(_0x414607){return db['AnalyticFieldReport']['destroy']({'where':{'CustomReportId':_0x4d3d3c['params']['id']},'transaction':_0x414607})[_0xaf3a('0x45')](function(_0x3df9fd){var _0x3e0a90=_[_0xaf3a('0x2f')](_0x4d3d3c[_0xaf3a('0x54')],function(_0x12dee0){delete _0x12dee0['id'];_0x12dee0[_0xaf3a('0x55')]=_0x4d3d3c[_0xaf3a('0x4b')]['id'];return _0x12dee0;});return db[_0xaf3a('0x44')]['bulkCreate'](_0x3e0a90,{'transaction':_0x414607});});})['then'](function(){return db[_0xaf3a('0x44')][_0xaf3a('0x48')]({'where':{'CustomReportId':_0x4d3d3c[_0xaf3a('0x4b')]['id']}});});}})[_0xaf3a('0x45')](respondWithResult(_0x374a25,null))[_0xaf3a('0x4a')](handleError(_0x374a25,null));}; \ No newline at end of file +var _0xf82d=['findAll','rows','catch','show','params','includeAll','find','create','bulkCreate','body','bulkDestroy','addFields','AnalyticCustomReport','sequelize','transaction','CustomReportId','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','jsforce','desk.js','to-csv','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','apply','save','then','destroy','error','stack','name','index','AnalyticFieldReport','rawAttributes','fieldName','type','key','model','map','keys','filters','intersection','attributes','fields','query','length','nolimit','limit','order','sort','where','filter','options','include'];(function(_0x442f02,_0x47d845){var _0xab6ef1=function(_0x4cad5c){while(--_0x4cad5c){_0x442f02['push'](_0x442f02['shift']());}};_0xab6ef1(++_0x47d845);}(_0xf82d,0x1ea));var _0xdf82=function(_0x56d55f,_0x52549c){_0x56d55f=_0x56d55f-0x0;var _0x306d2e=_0xf82d[_0x56d55f];return _0x306d2e;};'use strict';var emlformat=require(_0xdf82('0x0'));var rimraf=require(_0xdf82('0x1'));var zipdir=require(_0xdf82('0x2'));var jsonpatch=require(_0xdf82('0x3'));var rp=require(_0xdf82('0x4'));var moment=require(_0xdf82('0x5'));var BPromise=require(_0xdf82('0x6'));var Mustache=require(_0xdf82('0x7'));var util=require(_0xdf82('0x8'));var path=require(_0xdf82('0x9'));var sox=require(_0xdf82('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xdf82('0xb'));var _=require(_0xdf82('0xc'));var squel=require(_0xdf82('0xd'));var crypto=require('crypto');var jsforce=require(_0xdf82('0xe'));var deskjs=require(_0xdf82('0xf'));var toCsv=require(_0xdf82('0x10'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xdf82('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xdf82('0x12'));var as=require(_0xdf82('0x13'));var hardwareService=require(_0xdf82('0x14'));var logger=require(_0xdf82('0x15'))(_0xdf82('0x16'));var utils=require(_0xdf82('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xdf82('0x18'))['db'];function respondWithStatusCode(_0x5995fc,_0x3b8f61){_0x3b8f61=_0x3b8f61||0xcc;return function(_0x1619f1){if(_0x1619f1){return _0x5995fc[_0xdf82('0x19')](_0x3b8f61);}return _0x5995fc[_0xdf82('0x1a')](_0x3b8f61)[_0xdf82('0x1b')]();};}function respondWithResult(_0x386098,_0x392a78){_0x392a78=_0x392a78||0xc8;return function(_0x2368d8){if(_0x2368d8){return _0x386098[_0xdf82('0x1a')](_0x392a78)[_0xdf82('0x1c')](_0x2368d8);}};}function respondWithFilteredResult(_0x2bb261,_0x27e492){return function(_0x197c75){if(_0x197c75){var _0x5c2e0e=typeof _0x27e492[_0xdf82('0x1d')]===_0xdf82('0x1e')&&typeof _0x27e492['limit']===_0xdf82('0x1e');var _0x31a3b8=_0x197c75[_0xdf82('0x1f')];var _0x6f53b3=_0x5c2e0e?0x0:_0x27e492[_0xdf82('0x1d')];var _0x3db619=_0x5c2e0e?_0x197c75[_0xdf82('0x1f')]:_0x27e492[_0xdf82('0x1d')]+_0x27e492['limit'];var _0x373751;if(_0x3db619>=_0x31a3b8){_0x3db619=_0x31a3b8;_0x373751=0xc8;}else{_0x373751=0xce;}_0x2bb261['status'](_0x373751);return _0x2bb261[_0xdf82('0x20')]('Content-Range',_0x6f53b3+'-'+_0x3db619+'/'+_0x31a3b8)[_0xdf82('0x1c')](_0x197c75);}return null;};}function patchUpdates(_0x12a11b){return function(_0x3934fe){try{jsonpatch[_0xdf82('0x21')](_0x3934fe,_0x12a11b,!![]);}catch(_0x4514f4){return BPromise['reject'](_0x4514f4);}return _0x3934fe[_0xdf82('0x22')]();};}function saveUpdates(_0x29c347,_0x2f22fd){return function(_0xd4fe8c){if(_0xd4fe8c){return _0xd4fe8c['update'](_0x29c347)[_0xdf82('0x23')](function(_0x4bf320){return _0x4bf320;});}return null;};}function removeEntity(_0xb71e8,_0x3c2ef9){return function(_0xc8a818){if(_0xc8a818){return _0xc8a818[_0xdf82('0x24')]()['then'](function(){_0xb71e8[_0xdf82('0x1a')](0xcc)[_0xdf82('0x1b')]();});}};}function handleEntityNotFound(_0x5c4de6,_0x245119){return function(_0x21a3cc){if(!_0x21a3cc){_0x5c4de6[_0xdf82('0x19')](0x194);}return _0x21a3cc;};}function handleError(_0x1eb737,_0x5a6b15){_0x5a6b15=_0x5a6b15||0x1f4;return function(_0x4a76dd){logger[_0xdf82('0x25')](_0x4a76dd[_0xdf82('0x26')]);if(_0x4a76dd[_0xdf82('0x27')]){delete _0x4a76dd[_0xdf82('0x27')];}_0x1eb737['status'](_0x5a6b15)['send'](_0x4a76dd);};}exports[_0xdf82('0x28')]=function(_0xd82f47,_0x5ccc4f){var _0x23c3e9={},_0x378aa3={},_0x5a978d={'count':0x0,'rows':[]};var _0x5eb7ac=_['map'](db[_0xdf82('0x29')][_0xdf82('0x2a')],function(_0x2601f6){return{'name':_0x2601f6[_0xdf82('0x2b')],'type':_0x2601f6[_0xdf82('0x2c')][_0xdf82('0x2d')]};});_0x378aa3[_0xdf82('0x2e')]=_[_0xdf82('0x2f')](_0x5eb7ac,_0xdf82('0x27'));_0x378aa3['query']=_[_0xdf82('0x30')](_0xd82f47['query']);_0x378aa3[_0xdf82('0x31')]=_[_0xdf82('0x32')](_0x378aa3[_0xdf82('0x2e')],_0x378aa3['query']);_0x23c3e9[_0xdf82('0x33')]=_['intersection'](_0x378aa3[_0xdf82('0x2e')],qs[_0xdf82('0x34')](_0xd82f47[_0xdf82('0x35')][_0xdf82('0x34')]));_0x23c3e9[_0xdf82('0x33')]=_0x23c3e9[_0xdf82('0x33')][_0xdf82('0x36')]?_0x23c3e9[_0xdf82('0x33')]:_0x378aa3[_0xdf82('0x2e')];if(!_0xd82f47[_0xdf82('0x35')]['hasOwnProperty'](_0xdf82('0x37'))){_0x23c3e9[_0xdf82('0x38')]=qs[_0xdf82('0x38')](_0xd82f47[_0xdf82('0x35')][_0xdf82('0x38')]);_0x23c3e9[_0xdf82('0x1d')]=qs[_0xdf82('0x1d')](_0xd82f47[_0xdf82('0x35')]['offset']);}_0x23c3e9[_0xdf82('0x39')]=qs['sort'](_0xd82f47[_0xdf82('0x35')][_0xdf82('0x3a')]);_0x23c3e9[_0xdf82('0x3b')]=qs[_0xdf82('0x31')](_['pick'](_0xd82f47[_0xdf82('0x35')],_0x378aa3[_0xdf82('0x31')]),_0x5eb7ac);if(_0xd82f47[_0xdf82('0x35')][_0xdf82('0x3c')]){_0x23c3e9[_0xdf82('0x3b')]=_['merge'](_0x23c3e9[_0xdf82('0x3b')],{'$or':_[_0xdf82('0x2f')](_0x5eb7ac,function(_0x599411){if(_0x599411['type']!=='VIRTUAL'){var _0x14b027={};_0x14b027[_0x599411['name']]={'$like':'%'+_0xd82f47[_0xdf82('0x35')][_0xdf82('0x3c')]+'%'};return _0x14b027;}})});}_0x23c3e9=_['merge']({},_0x23c3e9,_0xd82f47[_0xdf82('0x3d')]);var _0xc9c21f={'where':_0x23c3e9['where']};return db['AnalyticFieldReport']['count'](_0xc9c21f)[_0xdf82('0x23')](function(_0x588414){_0x5a978d[_0xdf82('0x1f')]=_0x588414;if(_0xd82f47[_0xdf82('0x35')]['includeAll']){_0x23c3e9[_0xdf82('0x3e')]=[{'all':!![]}];}return db[_0xdf82('0x29')][_0xdf82('0x3f')](_0x23c3e9);})[_0xdf82('0x23')](function(_0x520745){_0x5a978d[_0xdf82('0x40')]=_0x520745;return _0x5a978d;})['then'](respondWithFilteredResult(_0x5ccc4f,_0x23c3e9))[_0xdf82('0x41')](handleError(_0x5ccc4f,null));};exports[_0xdf82('0x42')]=function(_0x53ddf1,_0x5f266e){var _0x3cc4eb={'raw':![],'where':{'id':_0x53ddf1[_0xdf82('0x43')]['id']}},_0x424aa2={};_0x424aa2[_0xdf82('0x2e')]=_['keys'](db[_0xdf82('0x29')][_0xdf82('0x2a')]);_0x424aa2[_0xdf82('0x35')]=_['keys'](_0x53ddf1[_0xdf82('0x35')]);_0x424aa2[_0xdf82('0x31')]=_[_0xdf82('0x32')](_0x424aa2[_0xdf82('0x2e')],_0x424aa2['query']);_0x3cc4eb[_0xdf82('0x33')]=_[_0xdf82('0x32')](_0x424aa2[_0xdf82('0x2e')],qs[_0xdf82('0x34')](_0x53ddf1[_0xdf82('0x35')][_0xdf82('0x34')]));_0x3cc4eb[_0xdf82('0x33')]=_0x3cc4eb[_0xdf82('0x33')][_0xdf82('0x36')]?_0x3cc4eb[_0xdf82('0x33')]:_0x424aa2[_0xdf82('0x2e')];if(_0x53ddf1[_0xdf82('0x35')][_0xdf82('0x44')]){_0x3cc4eb[_0xdf82('0x3e')]=[{'all':!![]}];}_0x3cc4eb=_['merge']({},_0x3cc4eb,_0x53ddf1[_0xdf82('0x3d')]);return db[_0xdf82('0x29')][_0xdf82('0x45')](_0x3cc4eb)[_0xdf82('0x23')](handleEntityNotFound(_0x5f266e,null))['then'](respondWithResult(_0x5f266e,null))[_0xdf82('0x41')](handleError(_0x5f266e,null));};exports[_0xdf82('0x46')]=function(_0x3de663,_0x29e163){return db[_0xdf82('0x29')][_0xdf82('0x46')](_0x3de663['body'],{})['then'](respondWithResult(_0x29e163,0xc9))[_0xdf82('0x41')](handleError(_0x29e163,null));};exports[_0xdf82('0x47')]=function(_0x4d68a7,_0x3a0ac7){return db[_0xdf82('0x29')][_0xdf82('0x47')](_0x4d68a7[_0xdf82('0x48')],{'raw':![],'individualHooks':!![]})[_0xdf82('0x23')](respondWithResult(_0x3a0ac7,0xc9))['catch'](handleError(_0x3a0ac7,null));};exports['update']=function(_0x3aa21b,_0x21a954){if(_0x3aa21b[_0xdf82('0x48')]['id']){delete _0x3aa21b[_0xdf82('0x48')]['id'];}return db[_0xdf82('0x29')][_0xdf82('0x45')]({'where':{'id':_0x3aa21b[_0xdf82('0x43')]['id']}})['then'](handleEntityNotFound(_0x21a954,null))[_0xdf82('0x23')](saveUpdates(_0x3aa21b[_0xdf82('0x48')],null))[_0xdf82('0x23')](respondWithResult(_0x21a954,null))[_0xdf82('0x41')](handleError(_0x21a954,null));};exports['destroy']=function(_0x3f37e5,_0x1ac48a){return db[_0xdf82('0x29')][_0xdf82('0x45')]({'where':{'id':_0x3f37e5[_0xdf82('0x43')]['id']}})[_0xdf82('0x23')](handleEntityNotFound(_0x1ac48a,null))[_0xdf82('0x23')](removeEntity(_0x1ac48a,null))['catch'](handleError(_0x1ac48a,null));};exports[_0xdf82('0x49')]=function(_0x2afc2c,_0x5ed6d5){return db[_0xdf82('0x29')][_0xdf82('0x24')]({'where':{'id':_0x2afc2c['query']['ids']||[]},'raw':![],'individualHooks':!![]})[_0xdf82('0x23')](respondWithResult(_0x5ed6d5,0xcc))[_0xdf82('0x41')](handleError(_0x5ed6d5,null));};exports[_0xdf82('0x4a')]=function(_0x339015,_0x2a3416,_0x2d8294){return db[_0xdf82('0x4b')]['findOne']({'where':{'id':_0x339015[_0xdf82('0x43')]['id']}})[_0xdf82('0x23')](handleEntityNotFound(_0x2a3416,null))[_0xdf82('0x23')](function(_0x90c915){if(_0x90c915){return db[_0xdf82('0x4c')][_0xdf82('0x4d')](function(_0x79f27c){return db[_0xdf82('0x29')]['destroy']({'where':{'CustomReportId':_0x339015[_0xdf82('0x43')]['id']},'transaction':_0x79f27c})['then'](function(_0x481325){var _0x8bc95d=_[_0xdf82('0x2f')](_0x339015[_0xdf82('0x48')],function(_0x46185d){delete _0x46185d['id'];_0x46185d[_0xdf82('0x4e')]=_0x339015[_0xdf82('0x43')]['id'];return _0x46185d;});return db[_0xdf82('0x29')][_0xdf82('0x47')](_0x8bc95d,{'transaction':_0x79f27c});});})[_0xdf82('0x23')](function(){return db[_0xdf82('0x29')][_0xdf82('0x3f')]({'where':{'CustomReportId':_0x339015[_0xdf82('0x43')]['id']}});});}})['then'](respondWithResult(_0x2a3416,null))[_0xdf82('0x41')](handleError(_0x2a3416,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index 20f8303..3a48286 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 _0x365d=['api','moment','bluebird','rimraf','../../config/environment','./analyticFieldReport.attributes','AnalyticFieldReport','analytics_report_fields','lodash','util'];(function(_0x2615f8,_0xd41fc5){var _0x3320ae=function(_0x140d16){while(--_0x140d16){_0x2615f8['push'](_0x2615f8['shift']());}};_0x3320ae(++_0xd41fc5);}(_0x365d,0x134));var _0xd365=function(_0x493836,_0x5af577){_0x493836=_0x493836-0x0;var _0x57b579=_0x365d[_0x493836];return _0x57b579;};'use strict';var _=require(_0xd365('0x0'));var util=require(_0xd365('0x1'));var logger=require('../../config/logger')(_0xd365('0x2'));var moment=require(_0xd365('0x3'));var BPromise=require(_0xd365('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xd365('0x5'));var config=require(_0xd365('0x6'));var attributes=require(_0xd365('0x7'));module['exports']=function(_0x521f53,_0x3067e4){return _0x521f53['define'](_0xd365('0x8'),attributes,{'tableName':_0xd365('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa441=['../../config/logger','api','moment','bluebird','path','./analyticFieldReport.attributes','define','analytics_report_fields','lodash','util'];(function(_0x486398,_0x370d53){var _0x2d4bc5=function(_0x4013f9){while(--_0x4013f9){_0x486398['push'](_0x486398['shift']());}};_0x2d4bc5(++_0x370d53);}(_0xa441,0xa8));var _0x1a44=function(_0x3a5e46,_0x4e3a77){_0x3a5e46=_0x3a5e46-0x0;var _0x2bbf34=_0xa441[_0x3a5e46];return _0x2bbf34;};'use strict';var _=require(_0x1a44('0x0'));var util=require(_0x1a44('0x1'));var logger=require(_0x1a44('0x2'))(_0x1a44('0x3'));var moment=require(_0x1a44('0x4'));var BPromise=require(_0x1a44('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1a44('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x1a44('0x7'));module['exports']=function(_0xf1e0f2,_0xdad695){return _0xf1e0f2[_0x1a44('0x8')]('AnalyticFieldReport',attributes,{'tableName':_0x1a44('0x9'),'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 593fd17..d0d5b07 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 _0xeb9a=['error','code','message','result','moment','bluebird','../../mysqldb','../../config/environment','jayson/promise','http','request','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x30805d,_0x487d81){var _0x48477b=function(_0x196711){while(--_0x196711){_0x30805d['push'](_0x30805d['shift']());}};_0x48477b(++_0x487d81);}(_0xeb9a,0x1c4));var _0xaeb9=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0xeb9a[_0x2070da];return _0x4f9fe1;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xaeb9('0x0'));var BPromise=require(_0xaeb9('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xaeb9('0x2'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xaeb9('0x3'));var jayson=require(_0xaeb9('0x4'));var client=jayson['client'][_0xaeb9('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x2c253a,_0x4dba76,_0x1d3064){return new BPromise(function(_0x53b235,_0x3ee99e){return client[_0xaeb9('0x6')](_0x2c253a,_0x1d3064)['then'](function(_0x19c7ab){logger[_0xaeb9('0x7')](_0xaeb9('0x8'),_0x4dba76,_0xaeb9('0x9'));logger[_0xaeb9('0xa')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x4dba76,_0xaeb9('0x9'),JSON[_0xaeb9('0xb')](_0x19c7ab));if(_0x19c7ab[_0xaeb9('0xc')]){if(_0x19c7ab['error'][_0xaeb9('0xd')]===0x1f4){logger[_0xaeb9('0xc')]('AnalyticFieldReport,\x20%s,\x20%s',_0x4dba76,_0x19c7ab[_0xaeb9('0xc')]['message']);return _0x3ee99e(_0x19c7ab[_0xaeb9('0xc')]['message']);}logger[_0xaeb9('0xc')]('AnalyticFieldReport,\x20%s,\x20%s',_0x4dba76,_0x19c7ab[_0xaeb9('0xc')][_0xaeb9('0xe')]);return _0x53b235(_0x19c7ab['error'][_0xaeb9('0xe')]);}else{logger[_0xaeb9('0x7')](_0xaeb9('0x8'),_0x4dba76,'request\x20sent');_0x53b235(_0x19c7ab[_0xaeb9('0xf')][_0xaeb9('0xe')]);}})['catch'](function(_0x2d73f2){logger[_0xaeb9('0xc')]('AnalyticFieldReport,\x20%s,\x20%s',_0x4dba76,_0x2d73f2);_0x3ee99e(_0x2d73f2);});});} \ No newline at end of file +var _0x4438=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','moment','bluebird','randomstring'];(function(_0x4fcb77,_0x4b2e50){var _0x10e4c6=function(_0x40df18){while(--_0x40df18){_0x4fcb77['push'](_0x4fcb77['shift']());}};_0x10e4c6(++_0x4b2e50);}(_0x4438,0x1e0));var _0x8443=function(_0x444394,_0x5b9f1a){_0x444394=_0x444394-0x0;var _0x3a23c3=_0x4438[_0x444394];return _0x3a23c3;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x8443('0x0'));var BPromise=require(_0x8443('0x1'));var rs=require(_0x8443('0x2'));var fs=require('fs');var Redis=require(_0x8443('0x3'));var db=require(_0x8443('0x4'))['db'];var utils=require(_0x8443('0x5'));var logger=require(_0x8443('0x6'))(_0x8443('0x7'));var config=require(_0x8443('0x8'));var jayson=require(_0x8443('0x9'));var client=jayson[_0x8443('0xa')][_0x8443('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x24fb37,_0x5cf1db,_0x4cd179){return new BPromise(function(_0x227909,_0x9ab2de){return client['request'](_0x24fb37,_0x4cd179)[_0x8443('0xc')](function(_0x54031e){logger[_0x8443('0xd')](_0x8443('0xe'),_0x5cf1db,_0x8443('0xf'));logger[_0x8443('0x10')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x5cf1db,_0x8443('0xf'),JSON[_0x8443('0x11')](_0x54031e));if(_0x54031e[_0x8443('0x12')]){if(_0x54031e[_0x8443('0x12')][_0x8443('0x13')]===0x1f4){logger['error'](_0x8443('0xe'),_0x5cf1db,_0x54031e[_0x8443('0x12')][_0x8443('0x14')]);return _0x9ab2de(_0x54031e[_0x8443('0x12')]['message']);}logger[_0x8443('0x12')](_0x8443('0xe'),_0x5cf1db,_0x54031e[_0x8443('0x12')]['message']);return _0x227909(_0x54031e['error'][_0x8443('0x14')]);}else{logger[_0x8443('0xd')](_0x8443('0xe'),_0x5cf1db,_0x8443('0xf'));_0x227909(_0x54031e[_0x8443('0x15')][_0x8443('0x14')]);}})[_0x8443('0x16')](function(_0x5051a4){logger[_0x8443('0x12')](_0x8443('0xe'),_0x5cf1db,_0x5051a4);_0x9ab2de(_0x5051a4);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index 4011cc8..cbc262a 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(_0x16def0,_0x6bf355){var _0x5f2de2=function(_0x3debdf){while(--_0x3debdf){_0x16def0['push'](_0x16def0['shift']());}};_0x5f2de2(++_0x6bf355);}(_0xa9e0,0x123));var _0x0a9e=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0xa9e0[_0x36dfbd];return _0x4ecad9;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0a9e('0xb')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xb')](_0x0a9e('0xf'),auth['isAuthenticated'](),controller['addFields']);router['put']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x14')]);module[_0x0a9e('0x15')]=router; \ No newline at end of file +var _0xa9e0=['delete','/destroy_many','bulkDestroy','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticFieldReport.controller','get','index','/:id','post','/create_many','isAuthenticated','bulkCreate','/:id/create_many','update'];(function(_0x95c0bd,_0x553048){var _0x4d7c3e=function(_0x356ec6){while(--_0x356ec6){_0x95c0bd['push'](_0x95c0bd['shift']());}};_0x4d7c3e(++_0x553048);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0xa9e0[_0x2160a9];return _0xa88cf7;};'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 adc320a..0a30cca 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 _0x16d2=['TEXT','sequelize','exports','STRING','name'];(function(_0x4f2c11,_0x15da99){var _0x29e71a=function(_0x12e193){while(--_0x12e193){_0x4f2c11['push'](_0x4f2c11['shift']());}};_0x29e71a(++_0x15da99);}(_0x16d2,0x123));var _0x216d=function(_0x47bf54,_0x327a53){_0x47bf54=_0x47bf54-0x0;var _0x2b75bc=_0x16d2[_0x47bf54];return _0x2b75bc;};'use strict';var Sequelize=require(_0x216d('0x0'));module[_0x216d('0x1')]={'name':{'type':Sequelize[_0x216d('0x2')],'allowNull':![],'unique':_0x216d('0x3')},'table':{'type':Sequelize[_0x216d('0x2')]},'metric':{'type':Sequelize[_0x216d('0x4')]},'description':{'type':Sequelize[_0x216d('0x2')]}}; \ No newline at end of file +var _0xaa1b=['sequelize','exports','STRING'];(function(_0x12bcf7,_0xc11103){var _0x2825a=function(_0x4452ba){while(--_0x4452ba){_0x12bcf7['push'](_0x12bcf7['shift']());}};_0x2825a(++_0xc11103);}(_0xaa1b,0x123));var _0xbaa1=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xaa1b[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xbaa1('0x0'));module[_0xbaa1('0x1')]={'name':{'type':Sequelize[_0xbaa1('0x2')],'allowNull':![],'unique':'name'},'table':{'type':Sequelize[_0xbaa1('0x2')]},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize[_0xbaa1('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index 5927427..273a21b 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(_0x5f51d0,_0x56cb80){var _0x124417=function(_0x16d87a){while(--_0x16d87a){_0x5f51d0['push'](_0x5f51d0['shift']());}};_0x124417(++_0x56cb80);}(_0xdc97,0x13b));var _0x7dc9=function(_0xcdc7c,_0x38d432){_0xcdc7c=_0xcdc7c-0x0;var _0x3d9383=_0xdc97[_0xcdc7c];return _0x3d9383;};'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 _0x9957=['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','Metrics','UserProfileResource','end','error','name','map','type','key','model','keys','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','AnalyticMetric','include','findAll','rawAttributes','intersection','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs'];(function(_0x3c04ef,_0x9d110c){var _0x6a3a69=function(_0x333514){while(--_0x333514){_0x3c04ef['push'](_0x3c04ef['shift']());}};_0x6a3a69(++_0x9d110c);}(_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(){var _0x472195=_0x563799['get']({'plain':!![]});var _0x39df42=_0x7995('0x28');return db[_0x7995('0x29')][_0x7995('0x27')]({'where':{'type':_0x39df42,'resourceId':_0x472195['id']}})[_0x7995('0x26')](function(){return _0x563799;});})[_0x7995('0x26')](function(){_0x204507['status'](0xcc)[_0x7995('0x2a')]();});}};}function handleEntityNotFound(_0x5911c3,_0x229742){return function(_0x49bc7e){if(!_0x49bc7e){_0x5911c3[_0x7995('0x1b')](0x194);}return _0x49bc7e;};}function handleError(_0x132a42,_0x11c1eb){_0x11c1eb=_0x11c1eb||0x1f4;return function(_0x4b6f99){logger[_0x7995('0x2b')](_0x4b6f99['stack']);if(_0x4b6f99[_0x7995('0x2c')]){delete _0x4b6f99[_0x7995('0x2c')];}_0x132a42[_0x7995('0x1c')](_0x11c1eb)['send'](_0x4b6f99);};}exports['index']=function(_0x48e573,_0x3573be){var _0xe6b0b3={},_0x327a81={},_0x2b874d={'count':0x0,'rows':[]};var _0x2e3493=_[_0x7995('0x2d')](db['AnalyticMetric']['rawAttributes'],function(_0xfa8f15){return{'name':_0xfa8f15['fieldName'],'type':_0xfa8f15[_0x7995('0x2e')][_0x7995('0x2f')]};});_0x327a81[_0x7995('0x30')]=_[_0x7995('0x2d')](_0x2e3493,_0x7995('0x2c'));_0x327a81['query']=_[_0x7995('0x31')](_0x48e573[_0x7995('0x32')]);_0x327a81['filters']=_['intersection'](_0x327a81['model'],_0x327a81[_0x7995('0x32')]);_0xe6b0b3[_0x7995('0x33')]=_['intersection'](_0x327a81[_0x7995('0x30')],qs['fields'](_0x48e573[_0x7995('0x32')][_0x7995('0x34')]));_0xe6b0b3[_0x7995('0x33')]=_0xe6b0b3['attributes']['length']?_0xe6b0b3[_0x7995('0x33')]:_0x327a81['model'];if(!_0x48e573['query'][_0x7995('0x35')](_0x7995('0x36'))){_0xe6b0b3['limit']=qs[_0x7995('0x21')](_0x48e573[_0x7995('0x32')][_0x7995('0x21')]);_0xe6b0b3[_0x7995('0x20')]=qs[_0x7995('0x20')](_0x48e573['query'][_0x7995('0x20')]);}_0xe6b0b3[_0x7995('0x37')]=qs[_0x7995('0x38')](_0x48e573[_0x7995('0x32')]['sort']);_0xe6b0b3[_0x7995('0x39')]=qs[_0x7995('0x3a')](_[_0x7995('0x3b')](_0x48e573[_0x7995('0x32')],_0x327a81[_0x7995('0x3a')]),_0x2e3493);if(_0x48e573[_0x7995('0x32')]['filter']){_0xe6b0b3[_0x7995('0x39')]=_[_0x7995('0x3c')](_0xe6b0b3[_0x7995('0x39')],{'$or':_[_0x7995('0x2d')](_0x2e3493,function(_0x2e04cd){if(_0x2e04cd[_0x7995('0x2e')]!==_0x7995('0x3d')){var _0x270c0e={};_0x270c0e[_0x2e04cd[_0x7995('0x2c')]]={'$like':'%'+_0x48e573[_0x7995('0x32')][_0x7995('0x3e')]+'%'};return _0x270c0e;}})});}_0xe6b0b3=_[_0x7995('0x3c')]({},_0xe6b0b3,_0x48e573[_0x7995('0x3f')]);var _0x53cda2={'where':_0xe6b0b3['where']};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x53cda2)['then'](function(_0x4b0855){_0x2b874d[_0x7995('0x1f')]=_0x4b0855;if(_0x48e573['query']['includeAll']){_0xe6b0b3[_0x7995('0x41')]=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x42')](_0xe6b0b3);})['then'](function(_0x46ac4f){_0x2b874d['rows']=_0x46ac4f;return _0x2b874d;})[_0x7995('0x26')](respondWithFilteredResult(_0x3573be,_0xe6b0b3))['catch'](handleError(_0x3573be,null));};exports['show']=function(_0x39c5b8,_0x403f54){var _0xc04e5={'raw':!![],'where':{'id':_0x39c5b8['params']['id']}},_0x3f1c35={};_0x3f1c35[_0x7995('0x30')]=_[_0x7995('0x31')](db[_0x7995('0x40')][_0x7995('0x43')]);_0x3f1c35['query']=_['keys'](_0x39c5b8[_0x7995('0x32')]);_0x3f1c35['filters']=_[_0x7995('0x44')](_0x3f1c35['model'],_0x3f1c35[_0x7995('0x32')]);_0xc04e5['attributes']=_[_0x7995('0x44')](_0x3f1c35[_0x7995('0x30')],qs['fields'](_0x39c5b8[_0x7995('0x32')][_0x7995('0x34')]));_0xc04e5[_0x7995('0x33')]=_0xc04e5[_0x7995('0x33')]['length']?_0xc04e5[_0x7995('0x33')]:_0x3f1c35[_0x7995('0x30')];if(_0x39c5b8[_0x7995('0x32')]['includeAll']){_0xc04e5[_0x7995('0x41')]=[{'all':!![]}];}_0xc04e5=_[_0x7995('0x3c')]({},_0xc04e5,_0x39c5b8[_0x7995('0x3f')]);return db[_0x7995('0x40')][_0x7995('0x45')](_0xc04e5)['then'](handleEntityNotFound(_0x403f54,null))[_0x7995('0x26')](respondWithResult(_0x403f54,null))[_0x7995('0x46')](handleError(_0x403f54,null));};exports['create']=function(_0x3d1dbb,_0x5843ba){return db[_0x7995('0x40')][_0x7995('0x47')](_0x3d1dbb[_0x7995('0x48')],{})[_0x7995('0x26')](function(_0xddf537){var _0x14b537=_0x3d1dbb[_0x7995('0x49')]['get']({'plain':!![]});if(!_0x14b537)throw new Error(_0x7995('0x4a'));if(_0x14b537[_0x7995('0x4b')]===_0x7995('0x49')){var _0x4ffc8a=_0xddf537[_0x7995('0x4c')]({'plain':!![]});var _0x1fe77e=_0x7995('0x28');return db['UserProfileSection']['find']({'where':{'name':_0x1fe77e,'userProfileId':_0x14b537['userProfileId']},'raw':!![]})[_0x7995('0x26')](function(_0x1fd1ca){if(_0x1fd1ca&&_0x1fd1ca['autoAssociation']===0x0){return db[_0x7995('0x29')][_0x7995('0x47')]({'name':_0x4ffc8a[_0x7995('0x2c')],'resourceId':_0x4ffc8a['id'],'type':_0x1fd1ca[_0x7995('0x2c')],'sectionId':_0x1fd1ca['id']},{})[_0x7995('0x26')](function(){return _0xddf537;});}else{return _0xddf537;}})['catch'](function(_0x29ee32){logger['error'](_0x7995('0x4d'),_0x29ee32);throw _0x29ee32;});}return _0xddf537;})[_0x7995('0x26')](respondWithResult(_0x5843ba,0xc9))[_0x7995('0x46')](handleError(_0x5843ba,null));};exports['update']=function(_0x5e1f34,_0x54e2b1){if(_0x5e1f34['body']['id']){delete _0x5e1f34[_0x7995('0x48')]['id'];}return db[_0x7995('0x40')][_0x7995('0x45')]({'where':{'id':_0x5e1f34[_0x7995('0x4e')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x54e2b1,null))[_0x7995('0x26')](saveUpdates(_0x5e1f34[_0x7995('0x48')],null))[_0x7995('0x26')](respondWithResult(_0x54e2b1,null))[_0x7995('0x46')](handleError(_0x54e2b1,null));};exports[_0x7995('0x27')]=function(_0xa7af8c,_0x133c63){return db[_0x7995('0x40')][_0x7995('0x45')]({'where':{'id':_0xa7af8c[_0x7995('0x4e')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x133c63,null))[_0x7995('0x26')](removeEntity(_0x133c63,null))[_0x7995('0x46')](handleError(_0x133c63,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index 6a0edca..a8f8a9e 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 _0x598a=['util','../../config/logger','api','moment','request-promise','./analyticMetric.attributes','exports','define','lodash'];(function(_0xe5530b,_0x4477ea){var _0x549c66=function(_0x495293){while(--_0x495293){_0xe5530b['push'](_0xe5530b['shift']());}};_0x549c66(++_0x4477ea);}(_0x598a,0xfb));var _0xa598=function(_0x5ed364,_0x4c5423){_0x5ed364=_0x5ed364-0x0;var _0x38c6e1=_0x598a[_0x5ed364];return _0x38c6e1;};'use strict';var _=require(_0xa598('0x0'));var util=require(_0xa598('0x1'));var logger=require(_0xa598('0x2'))(_0xa598('0x3'));var moment=require(_0xa598('0x4'));var BPromise=require('bluebird');var rp=require(_0xa598('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xa598('0x6'));module[_0xa598('0x7')]=function(_0x41ebaa,_0x2b0ef0){return _0x41ebaa[_0xa598('0x8')]('AnalyticMetric',attributes,{'tableName':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc7b3=['api','moment','bluebird','request-promise','path','rimraf','./analyticMetric.attributes','exports','define','AnalyticMetric','lodash','util'];(function(_0x5d6066,_0x274a21){var _0x42f798=function(_0x258e55){while(--_0x258e55){_0x5d6066['push'](_0x5d6066['shift']());}};_0x42f798(++_0x274a21);}(_0xc7b3,0x1c6));var _0x3c7b=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xc7b3[_0xfae23b];return _0x200640;};'use strict';var _=require(_0x3c7b('0x0'));var util=require(_0x3c7b('0x1'));var logger=require('../../config/logger')(_0x3c7b('0x2'));var moment=require(_0x3c7b('0x3'));var BPromise=require(_0x3c7b('0x4'));var rp=require(_0x3c7b('0x5'));var fs=require('fs');var path=require(_0x3c7b('0x6'));var rimraf=require(_0x3c7b('0x7'));var config=require('../../config/environment');var attributes=require(_0x3c7b('0x8'));module[_0x3c7b('0x9')]=function(_0x1fa371,_0x55975f){return _0x1fa371[_0x3c7b('0xa')](_0x3c7b('0xb'),attributes,{'tableName':'analytics_metrics','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 3c3d96e..b53abe9 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 _0x05fb=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','AnalyticMetric,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis'];(function(_0x2ff3e5,_0x43ea59){var _0x3430a3=function(_0x202824){while(--_0x202824){_0x2ff3e5['push'](_0x2ff3e5['shift']());}};_0x3430a3(++_0x43ea59);}(_0x05fb,0x1d6));var _0xb05f=function(_0x2f0837,_0x3fa02a){_0x2f0837=_0x2f0837-0x0;var _0x1a2b2e=_0x05fb[_0x2f0837];return _0x1a2b2e;};'use strict';var _=require(_0xb05f('0x0'));var util=require(_0xb05f('0x1'));var moment=require('moment');var BPromise=require(_0xb05f('0x2'));var rs=require(_0xb05f('0x3'));var fs=require('fs');var Redis=require(_0xb05f('0x4'));var db=require(_0xb05f('0x5'))['db'];var utils=require(_0xb05f('0x6'));var logger=require(_0xb05f('0x7'))(_0xb05f('0x8'));var config=require(_0xb05f('0x9'));var jayson=require(_0xb05f('0xa'));var client=jayson['client'][_0xb05f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3b1012,_0x8348a6,_0x4a2e0c){return new BPromise(function(_0x5d9498,_0x2d04ce){return client[_0xb05f('0xc')](_0x3b1012,_0x4a2e0c)[_0xb05f('0xd')](function(_0x1149bd){logger['info']('AnalyticMetric,\x20%s,\x20%s',_0x8348a6,'request\x20sent');logger[_0xb05f('0xe')](_0xb05f('0xf'),_0x8348a6,_0xb05f('0x10'),JSON[_0xb05f('0x11')](_0x1149bd));if(_0x1149bd[_0xb05f('0x12')]){if(_0x1149bd['error'][_0xb05f('0x13')]===0x1f4){logger[_0xb05f('0x12')]('AnalyticMetric,\x20%s,\x20%s',_0x8348a6,_0x1149bd[_0xb05f('0x12')]['message']);return _0x2d04ce(_0x1149bd['error'][_0xb05f('0x14')]);}logger['error']('AnalyticMetric,\x20%s,\x20%s',_0x8348a6,_0x1149bd[_0xb05f('0x12')][_0xb05f('0x14')]);return _0x5d9498(_0x1149bd[_0xb05f('0x12')][_0xb05f('0x14')]);}else{logger[_0xb05f('0x15')](_0xb05f('0x16'),_0x8348a6,'request\x20sent');_0x5d9498(_0x1149bd[_0xb05f('0x17')][_0xb05f('0x14')]);}})[_0xb05f('0x18')](function(_0x1ae52f){logger['error']('AnalyticMetric,\x20%s,\x20%s',_0x8348a6,_0x1ae52f);_0x2d04ce(_0x1ae52f);});});} \ No newline at end of file +var _0x0526=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','moment'];(function(_0x576b14,_0x366fbd){var _0xc4aca8=function(_0x3a9e1f){while(--_0x3a9e1f){_0x576b14['push'](_0x576b14['shift']());}};_0xc4aca8(++_0x366fbd);}(_0x0526,0x1e2));var _0x6052=function(_0xcddfd,_0x4f79b5){_0xcddfd=_0xcddfd-0x0;var _0x2fdea8=_0x0526[_0xcddfd];return _0x2fdea8;};'use strict';var _=require(_0x6052('0x0'));var util=require('util');var moment=require(_0x6052('0x1'));var BPromise=require(_0x6052('0x2'));var rs=require(_0x6052('0x3'));var fs=require('fs');var Redis=require(_0x6052('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6052('0x5'));var logger=require(_0x6052('0x6'))('rpc');var config=require(_0x6052('0x7'));var jayson=require(_0x6052('0x8'));var client=jayson[_0x6052('0x9')][_0x6052('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1961a8,_0xe41dec,_0x5ee444){return new BPromise(function(_0x1d0a2d,_0x5bfff7){return client[_0x6052('0xb')](_0x1961a8,_0x5ee444)[_0x6052('0xc')](function(_0x29b3a9){logger[_0x6052('0xd')](_0x6052('0xe'),_0xe41dec,'request\x20sent');logger['debug']('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0xe41dec,_0x6052('0xf'),JSON[_0x6052('0x10')](_0x29b3a9));if(_0x29b3a9[_0x6052('0x11')]){if(_0x29b3a9[_0x6052('0x11')][_0x6052('0x12')]===0x1f4){logger[_0x6052('0x11')](_0x6052('0xe'),_0xe41dec,_0x29b3a9['error']['message']);return _0x5bfff7(_0x29b3a9[_0x6052('0x11')][_0x6052('0x13')]);}logger[_0x6052('0x11')](_0x6052('0xe'),_0xe41dec,_0x29b3a9['error'][_0x6052('0x13')]);return _0x1d0a2d(_0x29b3a9[_0x6052('0x11')][_0x6052('0x13')]);}else{logger['info'](_0x6052('0xe'),_0xe41dec,_0x6052('0xf'));_0x1d0a2d(_0x29b3a9[_0x6052('0x14')]['message']);}})[_0x6052('0x15')](function(_0x5b521a){logger['error']('AnalyticMetric,\x20%s,\x20%s',_0xe41dec,_0x5b521a);_0x5bfff7(_0x5b521a);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index a2d7d16..29bfa4b 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 _0x8ce1=['../../config/environment','./analyticMetric.controller','get','isAuthenticated','index','/:id','show','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x5938b5,_0x3fa937){var _0x53224c=function(_0xc66565){while(--_0xc66565){_0x5938b5['push'](_0x5938b5['shift']());}};_0x53224c(++_0x3fa937);}(_0x8ce1,0x183));var _0x18ce=function(_0x53604f,_0x1d7403){_0x53604f=_0x53604f-0x0;var _0x45740a=_0x8ce1[_0x53604f];return _0x45740a;};'use strict';var multer=require(_0x18ce('0x0'));var util=require(_0x18ce('0x1'));var path=require(_0x18ce('0x2'));var timeout=require(_0x18ce('0x3'));var express=require(_0x18ce('0x4'));var router=express[_0x18ce('0x5')]();var fs_extra=require(_0x18ce('0x6'));var auth=require(_0x18ce('0x7'));var interaction=require(_0x18ce('0x8'));var config=require(_0x18ce('0x9'));var controller=require(_0x18ce('0xa'));router[_0x18ce('0xb')]('/',auth[_0x18ce('0xc')](),controller[_0x18ce('0xd')]);router[_0x18ce('0xb')](_0x18ce('0xe'),auth['isAuthenticated'](),controller[_0x18ce('0xf')]);router[_0x18ce('0x10')]('/',auth[_0x18ce('0xc')](),controller[_0x18ce('0x11')]);router['put'](_0x18ce('0xe'),auth[_0x18ce('0xc')](),controller[_0x18ce('0x12')]);router[_0x18ce('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x18ce('0x14')]);module[_0x18ce('0x15')]=router; \ No newline at end of file +var _0xf3cc=['Router','fs-extra','../../components/auth/service','../../config/environment','./analyticMetric.controller','isAuthenticated','index','get','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x24c2c3,_0x31eabf){var _0x6e30ac=function(_0xfbf8f1){while(--_0xfbf8f1){_0x24c2c3['push'](_0x24c2c3['shift']());}};_0x6e30ac(++_0x31eabf);}(_0xf3cc,0x10d));var _0xcf3c=function(_0x2db12b,_0x30ab1d){_0x2db12b=_0x2db12b-0x0;var _0x20990b=_0xf3cc[_0x2db12b];return _0x20990b;};'use strict';var multer=require(_0xcf3c('0x0'));var util=require(_0xcf3c('0x1'));var path=require(_0xcf3c('0x2'));var timeout=require(_0xcf3c('0x3'));var express=require('express');var router=express[_0xcf3c('0x4')]();var fs_extra=require(_0xcf3c('0x5'));var auth=require(_0xcf3c('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xcf3c('0x7'));var controller=require(_0xcf3c('0x8'));router['get']('/',auth[_0xcf3c('0x9')](),controller[_0xcf3c('0xa')]);router[_0xcf3c('0xb')](_0xcf3c('0xc'),auth[_0xcf3c('0x9')](),controller[_0xcf3c('0xd')]);router[_0xcf3c('0xe')]('/',auth[_0xcf3c('0x9')](),controller[_0xcf3c('0xf')]);router[_0xcf3c('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xcf3c('0x11')]);router[_0xcf3c('0x12')](_0xcf3c('0xc'),auth[_0xcf3c('0x9')](),controller[_0xcf3c('0x13')]);module[_0xcf3c('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 88b25f4..ec55af6 100644 --- a/server/api/analyticTreeReport/analyticTreeReport.attributes.js +++ b/server/api/analyticTreeReport/analyticTreeReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb977=['exports','sequelize'];(function(_0x108d63,_0x14491b){var _0x51d6df=function(_0x595598){while(--_0x595598){_0x108d63['push'](_0x108d63['shift']());}};_0x51d6df(++_0x14491b);}(_0xb977,0xd7));var _0x7b97=function(_0x47b92b,_0x410a46){_0x47b92b=_0x47b92b-0x0;var _0x2c6676=_0xb977[_0x47b92b];return _0x2c6676;};'use strict';var Sequelize=require(_0x7b97('0x0'));module[_0x7b97('0x1')]={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}}; \ No newline at end of file +var _0x5db4=['exports'];(function(_0x332d5c,_0x4a2336){var _0x47448d=function(_0x4a00f6){while(--_0x4a00f6){_0x332d5c['push'](_0x332d5c['shift']());}};_0x47448d(++_0x4a2336);}(_0x5db4,0x167));var _0x45db=function(_0x5df59e,_0x4911be){_0x5df59e=_0x5df59e-0x0;var _0x6a7fe3=_0x5db4[_0x5df59e];return _0x6a7fe3;};'use strict';var Sequelize=require('sequelize');module[_0x45db('0x0')]={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js index c46a2dd..6b33a61 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 _0x50d2=['util','path','to-csv','fs-extra','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','then','end','error','name','send','index','map','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','merge','where','options','AnalyticTreeReport','includeAll','findAll','rows','catch','show','params','rawAttributes','include','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x1d8b10,_0x9603a6){var _0x123f31=function(_0x675fd8){while(--_0x675fd8){_0x1d8b10['push'](_0x1d8b10['shift']());}};_0x123f31(++_0x9603a6);}(_0x50d2,0x128));var _0x250d=function(_0x2fd7fb,_0x32afad){_0x2fd7fb=_0x2fd7fb-0x0;var _0x15bf0a=_0x50d2[_0x2fd7fb];return _0x15bf0a;};'use strict';var emlformat=require(_0x250d('0x0'));var rimraf=require(_0x250d('0x1'));var zipdir=require(_0x250d('0x2'));var jsonpatch=require(_0x250d('0x3'));var rp=require(_0x250d('0x4'));var moment=require(_0x250d('0x5'));var BPromise=require(_0x250d('0x6'));var Mustache=require(_0x250d('0x7'));var util=require(_0x250d('0x8'));var path=require(_0x250d('0x9'));var sox=require('sox');var csv=require(_0x250d('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x250d('0xb'));var _=require('lodash');var squel=require(_0x250d('0xc'));var crypto=require('crypto');var jsforce=require(_0x250d('0xd'));var deskjs=require(_0x250d('0xe'));var toCsv=require('to-csv');var querystring=require(_0x250d('0xf'));var Papa=require('papaparse');var Redis=require(_0x250d('0x10'));var authService=require(_0x250d('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x250d('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x250d('0x13'));var config=require(_0x250d('0x14'));var licenseUtil=require(_0x250d('0x15'));var db=require(_0x250d('0x16'))['db'];function respondWithStatusCode(_0x573a5b,_0x3bf830){_0x3bf830=_0x3bf830||0xcc;return function(_0x5ba5c8){if(_0x5ba5c8){return _0x573a5b[_0x250d('0x17')](_0x3bf830);}return _0x573a5b[_0x250d('0x18')](_0x3bf830)['end']();};}function respondWithResult(_0x11a763,_0x5a2074){_0x5a2074=_0x5a2074||0xc8;return function(_0x25bf05){if(_0x25bf05){return _0x11a763[_0x250d('0x18')](_0x5a2074)[_0x250d('0x19')](_0x25bf05);}};}function respondWithFilteredResult(_0x4360a5,_0x423877){return function(_0x52105e){if(_0x52105e){var _0x50e626=typeof _0x423877['offset']==='undefined'&&typeof _0x423877[_0x250d('0x1a')]===_0x250d('0x1b');var _0x797c9c=_0x52105e[_0x250d('0x1c')];var _0x1d6176=_0x50e626?0x0:_0x423877['offset'];var _0x54934e=_0x50e626?_0x52105e[_0x250d('0x1c')]:_0x423877[_0x250d('0x1d')]+_0x423877[_0x250d('0x1a')];var _0x49d256;if(_0x54934e>=_0x797c9c){_0x54934e=_0x797c9c;_0x49d256=0xc8;}else{_0x49d256=0xce;}_0x4360a5['status'](_0x49d256);return _0x4360a5[_0x250d('0x1e')](_0x250d('0x1f'),_0x1d6176+'-'+_0x54934e+'/'+_0x797c9c)[_0x250d('0x19')](_0x52105e);}return null;};}function patchUpdates(_0x245bda){return function(_0x31e804){try{jsonpatch[_0x250d('0x20')](_0x31e804,_0x245bda,!![]);}catch(_0xca36ed){return BPromise[_0x250d('0x21')](_0xca36ed);}return _0x31e804[_0x250d('0x22')]();};}function saveUpdates(_0x503eb2,_0x1f9849){return function(_0x1373a3){if(_0x1373a3){return _0x1373a3[_0x250d('0x23')](_0x503eb2)[_0x250d('0x24')](function(_0x4f192e){return _0x4f192e;});}return null;};}function removeEntity(_0x992abc,_0x45f18f){return function(_0x52705f){if(_0x52705f){return _0x52705f['destroy']()[_0x250d('0x24')](function(){_0x992abc[_0x250d('0x18')](0xcc)[_0x250d('0x25')]();});}};}function handleEntityNotFound(_0x2c58c1,_0x1b3578){return function(_0x5c4ef1){if(!_0x5c4ef1){_0x2c58c1[_0x250d('0x17')](0x194);}return _0x5c4ef1;};}function handleError(_0x283954,_0x260eb5){_0x260eb5=_0x260eb5||0x1f4;return function(_0x1738d9){logger[_0x250d('0x26')](_0x1738d9['stack']);if(_0x1738d9['name']){delete _0x1738d9[_0x250d('0x27')];}_0x283954[_0x250d('0x18')](_0x260eb5)[_0x250d('0x28')](_0x1738d9);};}exports[_0x250d('0x29')]=function(_0x577f48,_0x5e58c8){var _0x52170d={},_0x2d8a4f={},_0x5814ce={'count':0x0,'rows':[]};var _0xabf5f7=_[_0x250d('0x2a')](db['AnalyticTreeReport']['rawAttributes'],function(_0xf2d780){return{'name':_0xf2d780[_0x250d('0x2b')],'type':_0xf2d780[_0x250d('0x2c')][_0x250d('0x2d')]};});_0x2d8a4f[_0x250d('0x2e')]=_['map'](_0xabf5f7,_0x250d('0x27'));_0x2d8a4f[_0x250d('0x2f')]=_[_0x250d('0x30')](_0x577f48[_0x250d('0x2f')]);_0x2d8a4f['filters']=_[_0x250d('0x31')](_0x2d8a4f[_0x250d('0x2e')],_0x2d8a4f[_0x250d('0x2f')]);_0x52170d[_0x250d('0x32')]=_[_0x250d('0x31')](_0x2d8a4f[_0x250d('0x2e')],qs[_0x250d('0x33')](_0x577f48[_0x250d('0x2f')][_0x250d('0x33')]));_0x52170d[_0x250d('0x32')]=_0x52170d[_0x250d('0x32')][_0x250d('0x34')]?_0x52170d[_0x250d('0x32')]:_0x2d8a4f[_0x250d('0x2e')];if(!_0x577f48[_0x250d('0x2f')][_0x250d('0x35')](_0x250d('0x36'))){_0x52170d['limit']=qs[_0x250d('0x1a')](_0x577f48[_0x250d('0x2f')][_0x250d('0x1a')]);_0x52170d['offset']=qs['offset'](_0x577f48['query'][_0x250d('0x1d')]);}_0x52170d[_0x250d('0x37')]=qs[_0x250d('0x38')](_0x577f48[_0x250d('0x2f')][_0x250d('0x38')]);_0x52170d['where']=qs[_0x250d('0x39')](_[_0x250d('0x3a')](_0x577f48[_0x250d('0x2f')],_0x2d8a4f[_0x250d('0x39')]),_0xabf5f7);if(_0x577f48[_0x250d('0x2f')][_0x250d('0x3b')]){_0x52170d['where']=_[_0x250d('0x3c')](_0x52170d[_0x250d('0x3d')],{'$or':_[_0x250d('0x2a')](_0xabf5f7,function(_0x526860){if(_0x526860[_0x250d('0x2c')]!=='VIRTUAL'){var _0x43cda6={};_0x43cda6[_0x526860[_0x250d('0x27')]]={'$like':'%'+_0x577f48[_0x250d('0x2f')][_0x250d('0x3b')]+'%'};return _0x43cda6;}})});}_0x52170d=_['merge']({},_0x52170d,_0x577f48[_0x250d('0x3e')]);var _0x3951fd={'where':_0x52170d[_0x250d('0x3d')]};return db[_0x250d('0x3f')][_0x250d('0x1c')](_0x3951fd)[_0x250d('0x24')](function(_0x18b33d){_0x5814ce[_0x250d('0x1c')]=_0x18b33d;if(_0x577f48[_0x250d('0x2f')][_0x250d('0x40')]){_0x52170d['include']=[{'all':!![]}];}return db[_0x250d('0x3f')][_0x250d('0x41')](_0x52170d);})[_0x250d('0x24')](function(_0x1a7d5f){_0x5814ce[_0x250d('0x42')]=_0x1a7d5f;return _0x5814ce;})['then'](respondWithFilteredResult(_0x5e58c8,_0x52170d))[_0x250d('0x43')](handleError(_0x5e58c8,null));};exports[_0x250d('0x44')]=function(_0x3fea3a,_0xf2d299){var _0x44cc13={'raw':!![],'where':{'id':_0x3fea3a[_0x250d('0x45')]['id']}},_0x119bef={};_0x119bef[_0x250d('0x2e')]=_['keys'](db[_0x250d('0x3f')][_0x250d('0x46')]);_0x119bef['query']=_[_0x250d('0x30')](_0x3fea3a[_0x250d('0x2f')]);_0x119bef[_0x250d('0x39')]=_[_0x250d('0x31')](_0x119bef['model'],_0x119bef[_0x250d('0x2f')]);_0x44cc13[_0x250d('0x32')]=_[_0x250d('0x31')](_0x119bef[_0x250d('0x2e')],qs[_0x250d('0x33')](_0x3fea3a[_0x250d('0x2f')][_0x250d('0x33')]));_0x44cc13[_0x250d('0x32')]=_0x44cc13[_0x250d('0x32')][_0x250d('0x34')]?_0x44cc13[_0x250d('0x32')]:_0x119bef[_0x250d('0x2e')];if(_0x3fea3a['query']['includeAll']){_0x44cc13[_0x250d('0x47')]=[{'all':!![]}];}_0x44cc13=_[_0x250d('0x3c')]({},_0x44cc13,_0x3fea3a[_0x250d('0x3e')]);return db['AnalyticTreeReport'][_0x250d('0x48')](_0x44cc13)[_0x250d('0x24')](handleEntityNotFound(_0xf2d299,null))[_0x250d('0x24')](respondWithResult(_0xf2d299,null))[_0x250d('0x43')](handleError(_0xf2d299,null));};exports['create']=function(_0xf262f8,_0x2d87ce){return db[_0x250d('0x3f')][_0x250d('0x49')](_0xf262f8[_0x250d('0x4a')],{})[_0x250d('0x24')](respondWithResult(_0x2d87ce,0xc9))['catch'](handleError(_0x2d87ce,null));};exports[_0x250d('0x23')]=function(_0x5ec6e1,_0x499915){if(_0x5ec6e1[_0x250d('0x4a')]['id']){delete _0x5ec6e1[_0x250d('0x4a')]['id'];}return db[_0x250d('0x3f')]['find']({'where':{'id':_0x5ec6e1[_0x250d('0x45')]['id']}})['then'](handleEntityNotFound(_0x499915,null))[_0x250d('0x24')](saveUpdates(_0x5ec6e1[_0x250d('0x4a')],null))['then'](respondWithResult(_0x499915,null))['catch'](handleError(_0x499915,null));};exports[_0x250d('0x4b')]=function(_0x5dcc27,_0x4735f6){return db[_0x250d('0x3f')][_0x250d('0x48')]({'where':{'id':_0x5dcc27['params']['id']}})[_0x250d('0x24')](handleEntityNotFound(_0x4735f6,null))['then'](removeEntity(_0x4735f6,null))['catch'](handleError(_0x4735f6,null));}; \ No newline at end of file +var _0xbe9b=['model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','destroy','eml-format','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','stack','name','send','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection'];(function(_0x17b6e3,_0x4522ed){var _0x3906f3=function(_0x430f87){while(--_0x430f87){_0x17b6e3['push'](_0x17b6e3['shift']());}};_0x3906f3(++_0x4522ed);}(_0xbe9b,0x194));var _0xbbe9=function(_0x170469,_0x4c9a3b){_0x170469=_0x170469-0x0;var _0xe6de53=_0xbe9b[_0x170469];return _0xe6de53;};'use strict';var emlformat=require(_0xbbe9('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xbbe9('0x1'));var moment=require('moment');var BPromise=require(_0xbbe9('0x2'));var Mustache=require(_0xbbe9('0x3'));var util=require('util');var path=require(_0xbbe9('0x4'));var sox=require(_0xbbe9('0x5'));var csv=require(_0xbbe9('0x6'));var ejs=require(_0xbbe9('0x7'));var fs=require('fs');var fs_extra=require(_0xbbe9('0x8'));var _=require(_0xbbe9('0x9'));var squel=require(_0xbbe9('0xa'));var crypto=require(_0xbbe9('0xb'));var jsforce=require(_0xbbe9('0xc'));var deskjs=require(_0xbbe9('0xd'));var toCsv=require(_0xbbe9('0x6'));var querystring=require(_0xbbe9('0xe'));var Papa=require(_0xbbe9('0xf'));var Redis=require('ioredis');var authService=require(_0xbbe9('0x10'));var qs=require(_0xbbe9('0x11'));var as=require(_0xbbe9('0x12'));var hardwareService=require(_0xbbe9('0x13'));var logger=require(_0xbbe9('0x14'))('api');var utils=require(_0xbbe9('0x15'));var config=require(_0xbbe9('0x16'));var licenseUtil=require(_0xbbe9('0x17'));var db=require(_0xbbe9('0x18'))['db'];function respondWithStatusCode(_0xda65a5,_0x4c0715){_0x4c0715=_0x4c0715||0xcc;return function(_0x571dce){if(_0x571dce){return _0xda65a5[_0xbbe9('0x19')](_0x4c0715);}return _0xda65a5[_0xbbe9('0x1a')](_0x4c0715)[_0xbbe9('0x1b')]();};}function respondWithResult(_0x24002e,_0x48778a){_0x48778a=_0x48778a||0xc8;return function(_0x36af2c){if(_0x36af2c){return _0x24002e[_0xbbe9('0x1a')](_0x48778a)[_0xbbe9('0x1c')](_0x36af2c);}};}function respondWithFilteredResult(_0x239cf2,_0x151559){return function(_0x3705a4){if(_0x3705a4){var _0x338413=typeof _0x151559[_0xbbe9('0x1d')]===_0xbbe9('0x1e')&&typeof _0x151559[_0xbbe9('0x1f')]==='undefined';var _0x28c2d0=_0x3705a4[_0xbbe9('0x20')];var _0x27d414=_0x338413?0x0:_0x151559[_0xbbe9('0x1d')];var _0x142121=_0x338413?_0x3705a4[_0xbbe9('0x20')]:_0x151559['offset']+_0x151559['limit'];var _0x64bd3b;if(_0x142121>=_0x28c2d0){_0x142121=_0x28c2d0;_0x64bd3b=0xc8;}else{_0x64bd3b=0xce;}_0x239cf2[_0xbbe9('0x1a')](_0x64bd3b);return _0x239cf2[_0xbbe9('0x21')]('Content-Range',_0x27d414+'-'+_0x142121+'/'+_0x28c2d0)['json'](_0x3705a4);}return null;};}function patchUpdates(_0x5cfc33){return function(_0x1e608f){try{jsonpatch[_0xbbe9('0x22')](_0x1e608f,_0x5cfc33,!![]);}catch(_0x455e68){return BPromise['reject'](_0x455e68);}return _0x1e608f[_0xbbe9('0x23')]();};}function saveUpdates(_0x2884c7,_0x5a68d1){return function(_0x56a9ea){if(_0x56a9ea){return _0x56a9ea[_0xbbe9('0x24')](_0x2884c7)[_0xbbe9('0x25')](function(_0x263f90){return _0x263f90;});}return null;};}function removeEntity(_0x234e4a,_0x237251){return function(_0x371550){if(_0x371550){return _0x371550['destroy']()['then'](function(){_0x234e4a['status'](0xcc)[_0xbbe9('0x1b')]();});}};}function handleEntityNotFound(_0x3435e1,_0x4dce04){return function(_0x473b86){if(!_0x473b86){_0x3435e1[_0xbbe9('0x19')](0x194);}return _0x473b86;};}function handleError(_0x4f8772,_0x32e92c){_0x32e92c=_0x32e92c||0x1f4;return function(_0x256e4c){logger['error'](_0x256e4c[_0xbbe9('0x26')]);if(_0x256e4c[_0xbbe9('0x27')]){delete _0x256e4c['name'];}_0x4f8772[_0xbbe9('0x1a')](_0x32e92c)[_0xbbe9('0x28')](_0x256e4c);};}exports[_0xbbe9('0x29')]=function(_0x3ccbd1,_0x334a40){var _0x355503={},_0x1251f0={},_0x3c75b5={'count':0x0,'rows':[]};var _0x49bc5c=_[_0xbbe9('0x2a')](db[_0xbbe9('0x2b')][_0xbbe9('0x2c')],function(_0x38b8cb){return{'name':_0x38b8cb[_0xbbe9('0x2d')],'type':_0x38b8cb[_0xbbe9('0x2e')][_0xbbe9('0x2f')]};});_0x1251f0['model']=_['map'](_0x49bc5c,_0xbbe9('0x27'));_0x1251f0[_0xbbe9('0x30')]=_[_0xbbe9('0x31')](_0x3ccbd1[_0xbbe9('0x30')]);_0x1251f0[_0xbbe9('0x32')]=_[_0xbbe9('0x33')](_0x1251f0[_0xbbe9('0x34')],_0x1251f0[_0xbbe9('0x30')]);_0x355503[_0xbbe9('0x35')]=_[_0xbbe9('0x33')](_0x1251f0['model'],qs['fields'](_0x3ccbd1[_0xbbe9('0x30')][_0xbbe9('0x36')]));_0x355503['attributes']=_0x355503['attributes'][_0xbbe9('0x37')]?_0x355503[_0xbbe9('0x35')]:_0x1251f0[_0xbbe9('0x34')];if(!_0x3ccbd1['query'][_0xbbe9('0x38')]('nolimit')){_0x355503[_0xbbe9('0x1f')]=qs['limit'](_0x3ccbd1[_0xbbe9('0x30')][_0xbbe9('0x1f')]);_0x355503[_0xbbe9('0x1d')]=qs[_0xbbe9('0x1d')](_0x3ccbd1[_0xbbe9('0x30')][_0xbbe9('0x1d')]);}_0x355503[_0xbbe9('0x39')]=qs['sort'](_0x3ccbd1[_0xbbe9('0x30')][_0xbbe9('0x3a')]);_0x355503[_0xbbe9('0x3b')]=qs[_0xbbe9('0x32')](_[_0xbbe9('0x3c')](_0x3ccbd1[_0xbbe9('0x30')],_0x1251f0[_0xbbe9('0x32')]),_0x49bc5c);if(_0x3ccbd1[_0xbbe9('0x30')]['filter']){_0x355503[_0xbbe9('0x3b')]=_[_0xbbe9('0x3d')](_0x355503[_0xbbe9('0x3b')],{'$or':_[_0xbbe9('0x2a')](_0x49bc5c,function(_0x1c2653){if(_0x1c2653[_0xbbe9('0x2e')]!==_0xbbe9('0x3e')){var _0x51668c={};_0x51668c[_0x1c2653[_0xbbe9('0x27')]]={'$like':'%'+_0x3ccbd1[_0xbbe9('0x30')][_0xbbe9('0x3f')]+'%'};return _0x51668c;}})});}_0x355503=_[_0xbbe9('0x3d')]({},_0x355503,_0x3ccbd1[_0xbbe9('0x40')]);var _0x49f96f={'where':_0x355503[_0xbbe9('0x3b')]};return db[_0xbbe9('0x2b')]['count'](_0x49f96f)[_0xbbe9('0x25')](function(_0x4466c5){_0x3c75b5[_0xbbe9('0x20')]=_0x4466c5;if(_0x3ccbd1[_0xbbe9('0x30')][_0xbbe9('0x41')]){_0x355503[_0xbbe9('0x42')]=[{'all':!![]}];}return db[_0xbbe9('0x2b')][_0xbbe9('0x43')](_0x355503);})[_0xbbe9('0x25')](function(_0x370bea){_0x3c75b5[_0xbbe9('0x44')]=_0x370bea;return _0x3c75b5;})[_0xbbe9('0x25')](respondWithFilteredResult(_0x334a40,_0x355503))[_0xbbe9('0x45')](handleError(_0x334a40,null));};exports[_0xbbe9('0x46')]=function(_0x346d4b,_0x42bf75){var _0x169e89={'raw':!![],'where':{'id':_0x346d4b['params']['id']}},_0x114320={};_0x114320[_0xbbe9('0x34')]=_['keys'](db[_0xbbe9('0x2b')]['rawAttributes']);_0x114320[_0xbbe9('0x30')]=_['keys'](_0x346d4b[_0xbbe9('0x30')]);_0x114320[_0xbbe9('0x32')]=_['intersection'](_0x114320['model'],_0x114320[_0xbbe9('0x30')]);_0x169e89['attributes']=_[_0xbbe9('0x33')](_0x114320[_0xbbe9('0x34')],qs['fields'](_0x346d4b[_0xbbe9('0x30')][_0xbbe9('0x36')]));_0x169e89[_0xbbe9('0x35')]=_0x169e89[_0xbbe9('0x35')]['length']?_0x169e89[_0xbbe9('0x35')]:_0x114320[_0xbbe9('0x34')];if(_0x346d4b[_0xbbe9('0x30')][_0xbbe9('0x41')]){_0x169e89['include']=[{'all':!![]}];}_0x169e89=_[_0xbbe9('0x3d')]({},_0x169e89,_0x346d4b[_0xbbe9('0x40')]);return db[_0xbbe9('0x2b')][_0xbbe9('0x47')](_0x169e89)[_0xbbe9('0x25')](handleEntityNotFound(_0x42bf75,null))[_0xbbe9('0x25')](respondWithResult(_0x42bf75,null))[_0xbbe9('0x45')](handleError(_0x42bf75,null));};exports[_0xbbe9('0x48')]=function(_0x3e394e,_0x1e986c){return db['AnalyticTreeReport']['create'](_0x3e394e[_0xbbe9('0x49')],{})['then'](respondWithResult(_0x1e986c,0xc9))[_0xbbe9('0x45')](handleError(_0x1e986c,null));};exports[_0xbbe9('0x24')]=function(_0x5545b1,_0x5eeb6e){if(_0x5545b1['body']['id']){delete _0x5545b1['body']['id'];}return db['AnalyticTreeReport'][_0xbbe9('0x47')]({'where':{'id':_0x5545b1[_0xbbe9('0x4a')]['id']}})[_0xbbe9('0x25')](handleEntityNotFound(_0x5eeb6e,null))[_0xbbe9('0x25')](saveUpdates(_0x5545b1['body'],null))[_0xbbe9('0x25')](respondWithResult(_0x5eeb6e,null))[_0xbbe9('0x45')](handleError(_0x5eeb6e,null));};exports[_0xbbe9('0x4b')]=function(_0x5358e3,_0x219033){return db[_0xbbe9('0x2b')][_0xbbe9('0x47')]({'where':{'id':_0x5358e3[_0xbbe9('0x4a')]['id']}})['then'](handleEntityNotFound(_0x219033,null))[_0xbbe9('0x25')](removeEntity(_0x219033,null))[_0xbbe9('0x45')](handleError(_0x219033,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index 98f0395..c43d728 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 _0x31fb=['analytics_report_trees','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticTreeReport.attributes','define','AnalyticTreeReport'];(function(_0x10a13d,_0x15e2aa){var _0x479dd4=function(_0x4de691){while(--_0x4de691){_0x10a13d['push'](_0x10a13d['shift']());}};_0x479dd4(++_0x15e2aa);}(_0x31fb,0x1e2));var _0xb31f=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x31fb[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0xb31f('0x0'));var util=require(_0xb31f('0x1'));var logger=require('../../config/logger')(_0xb31f('0x2'));var moment=require(_0xb31f('0x3'));var BPromise=require(_0xb31f('0x4'));var rp=require(_0xb31f('0x5'));var fs=require('fs');var path=require(_0xb31f('0x6'));var rimraf=require(_0xb31f('0x7'));var config=require(_0xb31f('0x8'));var attributes=require(_0xb31f('0x9'));module['exports']=function(_0x5a92f9,_0x5277ed){return _0x5a92f9[_0xb31f('0xa')](_0xb31f('0xb'),attributes,{'tableName':_0xb31f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xab28=['define','AnalyticTreeReport','analytics_report_trees','api','moment','bluebird','request-promise','path','rimraf','./analyticTreeReport.attributes'];(function(_0x555b2f,_0x43b622){var _0x81c0a6=function(_0x4629e6){while(--_0x4629e6){_0x555b2f['push'](_0x555b2f['shift']());}};_0x81c0a6(++_0x43b622);}(_0xab28,0x1b1));var _0x8ab2=function(_0x707bd,_0xa35918){_0x707bd=_0x707bd-0x0;var _0x454003=_0xab28[_0x707bd];return _0x454003;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x8ab2('0x0'));var moment=require(_0x8ab2('0x1'));var BPromise=require(_0x8ab2('0x2'));var rp=require(_0x8ab2('0x3'));var fs=require('fs');var path=require(_0x8ab2('0x4'));var rimraf=require(_0x8ab2('0x5'));var config=require('../../config/environment');var attributes=require(_0x8ab2('0x6'));module['exports']=function(_0xcfb8ca,_0x1ce928){return _0xcfb8ca[_0x8ab2('0x7')](_0x8ab2('0x8'),attributes,{'tableName':_0x8ab2('0x9'),'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 5c19011..deca057 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(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7a54,0x106));var _0x47a5=function(_0x431f7b,_0x2b624b){_0x431f7b=_0x431f7b-0x0;var _0x279c74=_0x7a54[_0x431f7b];return _0x279c74;};'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 _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0x291a57,_0x174cf3){var _0x1dedf0=function(_0x3cc479){while(--_0x3cc479){_0x291a57['push'](_0x291a57['shift']());}};_0x1dedf0(++_0x174cf3);}(_0xdb28,0x106));var _0x8db2=function(_0x575cf1,_0xfe69a9){_0x575cf1=_0x575cf1-0x0;var _0xc8abc9=_0xdb28[_0x575cf1];return _0xc8abc9;};'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')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index 306e80b..6a18abc 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 _0x5499=['show','post','put','update','delete','exports','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','index','get','/:id','isAuthenticated'];(function(_0x166fb4,_0x43cb69){var _0xa0c5ef=function(_0x21fe31){while(--_0x21fe31){_0x166fb4['push'](_0x166fb4['shift']());}};_0xa0c5ef(++_0x43cb69);}(_0x5499,0x15c));var _0x9549=function(_0x2f2d45,_0x338762){_0x2f2d45=_0x2f2d45-0x0;var _0x1fc082=_0x5499[_0x2f2d45];return _0x1fc082;};'use strict';var multer=require('multer');var util=require(_0x9549('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x9549('0x1'));var router=express[_0x9549('0x2')]();var fs_extra=require(_0x9549('0x3'));var auth=require(_0x9549('0x4'));var interaction=require(_0x9549('0x5'));var config=require(_0x9549('0x6'));var controller=require(_0x9549('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x9549('0x8')]);router[_0x9549('0x9')](_0x9549('0xa'),auth[_0x9549('0xb')](),controller[_0x9549('0xc')]);router[_0x9549('0xd')]('/',auth[_0x9549('0xb')](),controller['create']);router[_0x9549('0xe')](_0x9549('0xa'),auth[_0x9549('0xb')](),controller[_0x9549('0xf')]);router[_0x9549('0x10')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x9549('0x11')]=router; \ No newline at end of file +var _0x3e6e=['./analyticTreeReport.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x3e6e,0xc9));var _0xe3e6=function(_0x186302,_0x5d83e0){_0x186302=_0x186302-0x0;var _0x3bd0b5=_0x3e6e[_0x186302];return _0x3bd0b5;};'use strict';var multer=require(_0xe3e6('0x0'));var util=require(_0xe3e6('0x1'));var path=require('path');var timeout=require(_0xe3e6('0x2'));var express=require(_0xe3e6('0x3'));var router=express[_0xe3e6('0x4')]();var fs_extra=require(_0xe3e6('0x5'));var auth=require(_0xe3e6('0x6'));var interaction=require(_0xe3e6('0x7'));var config=require(_0xe3e6('0x8'));var controller=require(_0xe3e6('0x9'));router[_0xe3e6('0xa')]('/',auth[_0xe3e6('0xb')](),controller[_0xe3e6('0xc')]);router[_0xe3e6('0xa')](_0xe3e6('0xd'),auth[_0xe3e6('0xb')](),controller[_0xe3e6('0xe')]);router[_0xe3e6('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0xe3e6('0x10')](_0xe3e6('0xd'),auth[_0xe3e6('0xb')](),controller[_0xe3e6('0x11')]);router[_0xe3e6('0x12')](_0xe3e6('0xd'),auth[_0xe3e6('0xb')](),controller[_0xe3e6('0x13')]);module[_0xe3e6('0x14')]=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index 389f8d6..19edd9e 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 _0x98d5=['STRING','sequelize'];(function(_0x236092,_0x2f90ba){var _0x353481=function(_0x591807){while(--_0x591807){_0x236092['push'](_0x236092['shift']());}};_0x353481(++_0x2f90ba);}(_0x98d5,0xfb));var _0x598d=function(_0x6cecca,_0x406465){_0x6cecca=_0x6cecca-0x0;var _0x546160=_0x98d5[_0x6cecca];return _0x546160;};'use strict';var Sequelize=require(_0x598d('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize[_0x598d('0x1')]},'type':{'type':Sequelize[_0x598d('0x1')]}}; \ No newline at end of file +var _0x765b=['STRING'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x765b,0x18c));var _0xb765=function(_0x3f3f40,_0x4c71f4){_0x3f3f40=_0x3f3f40-0x0;var _0x403b7a=_0x765b[_0x3f3f40];return _0x403b7a;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize[_0xb765('0x0')]},'type':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index 0927a3f..78757ae 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 _0x103a=['../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','Attachment','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','catch','show','params','intersection','length','options','find','get','omit','body','updatedAt','create','file','originalname','filename','download','findOne','join','root','server/files/attachments/','offline-chat/','basename','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware'];(function(_0x24b773,_0x392c26){var _0x35f6c9=function(_0x37b5c3){while(--_0x37b5c3){_0x24b773['push'](_0x24b773['shift']());}};_0x35f6c9(++_0x392c26);}(_0x103a,0xfc));var _0xa103=function(_0x573658,_0x4effb7){_0x573658=_0x573658-0x0;var _0xee4e96=_0x103a[_0x573658];return _0xee4e96;};'use strict';var emlformat=require(_0xa103('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa103('0x1'));var jsonpatch=require(_0xa103('0x2'));var rp=require(_0xa103('0x3'));var moment=require(_0xa103('0x4'));var BPromise=require(_0xa103('0x5'));var Mustache=require(_0xa103('0x6'));var util=require(_0xa103('0x7'));var path=require('path');var sox=require(_0xa103('0x8'));var csv=require(_0xa103('0x9'));var ejs=require(_0xa103('0xa'));var fs=require('fs');var fs_extra=require(_0xa103('0xb'));var _=require(_0xa103('0xc'));var squel=require(_0xa103('0xd'));var crypto=require(_0xa103('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xa103('0xf'));var toCsv=require(_0xa103('0x9'));var querystring=require(_0xa103('0x10'));var Papa=require(_0xa103('0x11'));var Redis=require('ioredis');var authService=require(_0xa103('0x12'));var qs=require(_0xa103('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa103('0x14'));var logger=require(_0xa103('0x15'))(_0xa103('0x16'));var utils=require(_0xa103('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xa103('0x18'));var db=require(_0xa103('0x19'))['db'];function respondWithStatusCode(_0x16d922,_0x4183c1){_0x4183c1=_0x4183c1||0xcc;return function(_0x2fe57b){if(_0x2fe57b){return _0x16d922[_0xa103('0x1a')](_0x4183c1);}return _0x16d922[_0xa103('0x1b')](_0x4183c1)[_0xa103('0x1c')]();};}function respondWithResult(_0x48ec50,_0x896417){_0x896417=_0x896417||0xc8;return function(_0x4efc68){if(_0x4efc68){return _0x48ec50[_0xa103('0x1b')](_0x896417)[_0xa103('0x1d')](_0x4efc68);}};}function respondWithFilteredResult(_0x58f0a8,_0x2bb675){return function(_0x56d97f){if(_0x56d97f){var _0x3f4c81=typeof _0x2bb675[_0xa103('0x1e')]===_0xa103('0x1f')&&typeof _0x2bb675['limit']===_0xa103('0x1f');var _0x23f5d1=_0x56d97f[_0xa103('0x20')];var _0x4eb4ae=_0x3f4c81?0x0:_0x2bb675['offset'];var _0xfab670=_0x3f4c81?_0x56d97f['count']:_0x2bb675[_0xa103('0x1e')]+_0x2bb675[_0xa103('0x21')];var _0x1f4e65;if(_0xfab670>=_0x23f5d1){_0xfab670=_0x23f5d1;_0x1f4e65=0xc8;}else{_0x1f4e65=0xce;}_0x58f0a8[_0xa103('0x1b')](_0x1f4e65);return _0x58f0a8[_0xa103('0x22')](_0xa103('0x23'),_0x4eb4ae+'-'+_0xfab670+'/'+_0x23f5d1)[_0xa103('0x1d')](_0x56d97f);}return null;};}function patchUpdates(_0xd51914){return function(_0x253d91){try{jsonpatch[_0xa103('0x24')](_0x253d91,_0xd51914,!![]);}catch(_0x5e749c){return BPromise[_0xa103('0x25')](_0x5e749c);}return _0x253d91['save']();};}function saveUpdates(_0x565905,_0x45d360){return function(_0x5af8ee){if(_0x5af8ee){return _0x5af8ee[_0xa103('0x26')](_0x565905)[_0xa103('0x27')](function(_0x47e648){return _0x47e648;});}return null;};}function removeEntity(_0x337d0f,_0x2c047f){return function(_0x1a37fa){if(_0x1a37fa){return _0x1a37fa[_0xa103('0x28')]()[_0xa103('0x27')](function(){_0x337d0f[_0xa103('0x1b')](0xcc)[_0xa103('0x1c')]();});}};}function handleEntityNotFound(_0x1678fc,_0x455e0a){return function(_0x484af4){if(!_0x484af4){_0x1678fc[_0xa103('0x1a')](0x194);}return _0x484af4;};}function handleError(_0x4635d7,_0x44a04c){_0x44a04c=_0x44a04c||0x1f4;return function(_0x19348a){logger[_0xa103('0x29')](_0x19348a[_0xa103('0x2a')]);if(_0x19348a[_0xa103('0x2b')]){delete _0x19348a[_0xa103('0x2b')];}_0x4635d7[_0xa103('0x1b')](_0x44a04c)[_0xa103('0x2c')](_0x19348a);};}exports[_0xa103('0x2d')]=function(_0x217340,_0x145fac){var _0x3d593d={},_0x15ec6c={},_0x4a14e3={'count':0x0,'rows':[]};var _0xfe8e06=_[_0xa103('0x2e')](db[_0xa103('0x2f')][_0xa103('0x30')],function(_0x9b091a){return{'name':_0x9b091a[_0xa103('0x31')],'type':_0x9b091a[_0xa103('0x32')][_0xa103('0x33')]};});_0x15ec6c['model']=_[_0xa103('0x2e')](_0xfe8e06,_0xa103('0x2b'));_0x15ec6c[_0xa103('0x34')]=_[_0xa103('0x35')](_0x217340[_0xa103('0x34')]);_0x15ec6c[_0xa103('0x36')]=_['intersection'](_0x15ec6c[_0xa103('0x37')],_0x15ec6c['query']);_0x3d593d[_0xa103('0x38')]=_['intersection'](_0x15ec6c[_0xa103('0x37')],qs[_0xa103('0x39')](_0x217340[_0xa103('0x34')][_0xa103('0x39')]));_0x3d593d[_0xa103('0x38')]=_0x3d593d['attributes']['length']?_0x3d593d[_0xa103('0x38')]:_0x15ec6c[_0xa103('0x37')];if(!_0x217340['query'][_0xa103('0x3a')](_0xa103('0x3b'))){_0x3d593d['limit']=qs[_0xa103('0x21')](_0x217340['query']['limit']);_0x3d593d['offset']=qs[_0xa103('0x1e')](_0x217340[_0xa103('0x34')][_0xa103('0x1e')]);}_0x3d593d[_0xa103('0x3c')]=qs[_0xa103('0x3d')](_0x217340[_0xa103('0x34')][_0xa103('0x3d')]);_0x3d593d[_0xa103('0x3e')]=qs[_0xa103('0x36')](_['pick'](_0x217340[_0xa103('0x34')],_0x15ec6c['filters']),_0xfe8e06);if(_0x217340[_0xa103('0x34')][_0xa103('0x3f')]){_0x3d593d[_0xa103('0x3e')]=_[_0xa103('0x40')](_0x3d593d['where'],{'$or':_[_0xa103('0x2e')](_0xfe8e06,function(_0x2c632c){if(_0x2c632c[_0xa103('0x32')]!==_0xa103('0x41')){var _0x43f0f8={};_0x43f0f8[_0x2c632c[_0xa103('0x2b')]]={'$like':'%'+_0x217340[_0xa103('0x34')]['filter']+'%'};return _0x43f0f8;}})});}_0x3d593d=_[_0xa103('0x40')]({},_0x3d593d,_0x217340['options']);var _0x46a958={'where':_0x3d593d[_0xa103('0x3e')]};return db[_0xa103('0x2f')]['count'](_0x46a958)[_0xa103('0x27')](function(_0x1ed8b0){_0x4a14e3['count']=_0x1ed8b0;if(_0x217340[_0xa103('0x34')][_0xa103('0x42')]){_0x3d593d[_0xa103('0x43')]=[{'all':!![]}];}return db[_0xa103('0x2f')][_0xa103('0x44')](_0x3d593d);})['then'](function(_0x68bf2b){_0x4a14e3['rows']=_0x68bf2b;return _0x4a14e3;})['then'](respondWithFilteredResult(_0x145fac,_0x3d593d))[_0xa103('0x45')](handleError(_0x145fac,null));};exports[_0xa103('0x46')]=function(_0x28d41b,_0x42656b){var _0x2743d7={'raw':!![],'where':{'id':_0x28d41b[_0xa103('0x47')]['id']}},_0x4ead54={};_0x4ead54[_0xa103('0x37')]=_[_0xa103('0x35')](db[_0xa103('0x2f')][_0xa103('0x30')]);_0x4ead54[_0xa103('0x34')]=_['keys'](_0x28d41b[_0xa103('0x34')]);_0x4ead54[_0xa103('0x36')]=_[_0xa103('0x48')](_0x4ead54['model'],_0x4ead54[_0xa103('0x34')]);_0x2743d7[_0xa103('0x38')]=_[_0xa103('0x48')](_0x4ead54[_0xa103('0x37')],qs[_0xa103('0x39')](_0x28d41b[_0xa103('0x34')][_0xa103('0x39')]));_0x2743d7[_0xa103('0x38')]=_0x2743d7[_0xa103('0x38')][_0xa103('0x49')]?_0x2743d7[_0xa103('0x38')]:_0x4ead54[_0xa103('0x37')];if(_0x28d41b[_0xa103('0x34')][_0xa103('0x42')]){_0x2743d7[_0xa103('0x43')]=[{'all':!![]}];}_0x2743d7=_[_0xa103('0x40')]({},_0x2743d7,_0x28d41b[_0xa103('0x4a')]);return db[_0xa103('0x2f')][_0xa103('0x4b')](_0x2743d7)[_0xa103('0x27')](handleEntityNotFound(_0x42656b,null))[_0xa103('0x27')](respondWithResult(_0x42656b,null))[_0xa103('0x45')](handleError(_0x42656b,null));};exports['clone']=function(_0x3884dd,_0x2c4cd8){var _0x4de73d={'where':{'id':_0x3884dd['params']['id']}},_0x47cd98={};_0x47cd98['model']=_[_0xa103('0x35')](db['Attachment']['rawAttributes']);_0x4de73d[_0xa103('0x38')]=_[_0xa103('0x48')](_0x47cd98[_0xa103('0x37')],qs['fields'](_0x3884dd['query'][_0xa103('0x39')]));_0x4de73d[_0xa103('0x38')]=_0x4de73d[_0xa103('0x38')][_0xa103('0x49')]?_0x4de73d[_0xa103('0x38')]:_0x47cd98[_0xa103('0x37')];if(_0x3884dd[_0xa103('0x34')]['includeAll']){_0x4de73d[_0xa103('0x43')]=[{'all':!![]}];}_0x4de73d=_[_0xa103('0x40')]({},_0x4de73d,_0x3884dd[_0xa103('0x4a')]);return db[_0xa103('0x2f')][_0xa103('0x4b')](_0x4de73d)[_0xa103('0x27')](handleEntityNotFound(_0x2c4cd8,null))[_0xa103('0x27')](function(_0x5c640b){if(_0x5c640b){var _0x2d275c=_0x5c640b[_0xa103('0x4c')]({'plain':!![]});_0x2d275c=qs[_0xa103('0x4d')](_0x2d275c,['id','createdAt','updatedAt']);_0x3884dd[_0xa103('0x4e')]=_[_0xa103('0x4d')](_0x3884dd[_0xa103('0x4e')],['id','createdAt',_0xa103('0x4f')]);return db[_0xa103('0x2f')][_0xa103('0x50')](_[_0xa103('0x40')](_0x2d275c,_0x3884dd['body']),{'include':_0x3884dd[_0xa103('0x34')][_0xa103('0x42')]?[{'all':!![]}]:undefined});}})[_0xa103('0x27')](respondWithResult(_0x2c4cd8,0xc9))[_0xa103('0x45')](handleError(_0x2c4cd8,null));};exports[_0xa103('0x26')]=function(_0x277c63,_0x43f2f7){if(_0x277c63[_0xa103('0x4e')]['id']){delete _0x277c63[_0xa103('0x4e')]['id'];}return db[_0xa103('0x2f')]['find']({'where':{'id':_0x277c63[_0xa103('0x47')]['id']}})['then'](handleEntityNotFound(_0x43f2f7,null))['then'](saveUpdates(_0x277c63[_0xa103('0x4e')],null))['then'](respondWithResult(_0x43f2f7,null))['catch'](handleError(_0x43f2f7,null));};exports['destroy']=function(_0x40399d,_0x528fa5){return db['Attachment'][_0xa103('0x4b')]({'where':{'id':_0x40399d[_0xa103('0x47')]['id']}})['then'](handleEntityNotFound(_0x528fa5,null))[_0xa103('0x27')](removeEntity(_0x528fa5,null))['catch'](handleError(_0x528fa5,null));};exports[_0xa103('0x50')]=function(_0x2cc086,_0x3d8e61,_0xc6ddc0){_0x2cc086[_0xa103('0x4e')][_0xa103('0x2b')]=_0x2cc086[_0xa103('0x51')][_0xa103('0x52')];_0x2cc086['body']['basename']=_0x2cc086[_0xa103('0x51')][_0xa103('0x53')];_0x2cc086['body']['type']=_0x2cc086[_0xa103('0x51')]['mimetype'];return db[_0xa103('0x2f')][_0xa103('0x50')](_0x2cc086['body'])[_0xa103('0x27')](respondWithResult(_0x3d8e61,0xc9))[_0xa103('0x45')](handleError(_0x3d8e61,null));};exports[_0xa103('0x54')]=function(_0x5cc3e7,_0x2d7151,_0x4fdb71){return db[_0xa103('0x2f')][_0xa103('0x55')]({'where':{'id':_0x5cc3e7[_0xa103('0x47')]['id']},'raw':!![]})[_0xa103('0x27')](handleEntityNotFound(_0x2d7151,null))['then'](function(_0x395485){if(_0x395485){var _0x3e400d=_0x395485['ChatOfflineMessageId']!==null;var _0x3e968a=path[_0xa103('0x56')](config[_0xa103('0x57')],_0xa103('0x58'));if(_0x3e400d){_0x3e968a=path[_0xa103('0x56')](_0x3e968a,_0xa103('0x59'));}var _0x4b0876=path[_0xa103('0x56')](_0x3e968a,_0x395485[_0xa103('0x5a')]);return _0x2d7151[_0xa103('0x54')](_0x4b0876);}})[_0xa103('0x45')](handleError(_0x2d7151,null));}; \ No newline at end of file +var _0x61a4=['ejs','fs-extra','crypto','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','undefined','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','error','stack','name','map','Attachment','rawAttributes','key','query','filters','model','attributes','intersection','fields','length','nolimit','order','sort','where','pick','type','VIRTUAL','filter','merge','includeAll','include','findAll','rows','catch','params','keys','options','clone','find','get','omit','updatedAt','body','createdAt','create','file','originalname','basename','mimetype','download','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv'];(function(_0x4f05ff,_0x2174dc){var _0x243f65=function(_0x280cfb){while(--_0x280cfb){_0x4f05ff['push'](_0x4f05ff['shift']());}};_0x243f65(++_0x2174dc);}(_0x61a4,0x105));var _0x461a=function(_0x59d382,_0x3f8d31){_0x59d382=_0x59d382-0x0;var _0x3c3d97=_0x61a4[_0x59d382];return _0x3c3d97;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x461a('0x0'));var zipdir=require(_0x461a('0x1'));var jsonpatch=require(_0x461a('0x2'));var rp=require('request-promise');var moment=require(_0x461a('0x3'));var BPromise=require(_0x461a('0x4'));var Mustache=require(_0x461a('0x5'));var util=require(_0x461a('0x6'));var path=require('path');var sox=require(_0x461a('0x7'));var csv=require(_0x461a('0x8'));var ejs=require(_0x461a('0x9'));var fs=require('fs');var fs_extra=require(_0x461a('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x461a('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x461a('0xc'));var toCsv=require(_0x461a('0x8'));var querystring=require(_0x461a('0xd'));var Papa=require(_0x461a('0xe'));var Redis=require(_0x461a('0xf'));var authService=require(_0x461a('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x461a('0x11'));var hardwareService=require(_0x461a('0x12'));var logger=require(_0x461a('0x13'))(_0x461a('0x14'));var utils=require(_0x461a('0x15'));var config=require(_0x461a('0x16'));var licenseUtil=require(_0x461a('0x17'));var db=require(_0x461a('0x18'))['db'];function respondWithStatusCode(_0x1e3196,_0x47b37f){_0x47b37f=_0x47b37f||0xcc;return function(_0x1ca4b4){if(_0x1ca4b4){return _0x1e3196[_0x461a('0x19')](_0x47b37f);}return _0x1e3196[_0x461a('0x1a')](_0x47b37f)[_0x461a('0x1b')]();};}function respondWithResult(_0x3f0275,_0x201e9d){_0x201e9d=_0x201e9d||0xc8;return function(_0x24e5dd){if(_0x24e5dd){return _0x3f0275[_0x461a('0x1a')](_0x201e9d)['json'](_0x24e5dd);}};}function respondWithFilteredResult(_0x4092f8,_0xfee820){return function(_0x331fa9){if(_0x331fa9){var _0x5b43f3=typeof _0xfee820['offset']===_0x461a('0x1c')&&typeof _0xfee820['limit']==='undefined';var _0x13e800=_0x331fa9[_0x461a('0x1d')];var _0x529a1a=_0x5b43f3?0x0:_0xfee820[_0x461a('0x1e')];var _0x200b81=_0x5b43f3?_0x331fa9[_0x461a('0x1d')]:_0xfee820['offset']+_0xfee820[_0x461a('0x1f')];var _0x354714;if(_0x200b81>=_0x13e800){_0x200b81=_0x13e800;_0x354714=0xc8;}else{_0x354714=0xce;}_0x4092f8[_0x461a('0x1a')](_0x354714);return _0x4092f8[_0x461a('0x20')](_0x461a('0x21'),_0x529a1a+'-'+_0x200b81+'/'+_0x13e800)[_0x461a('0x22')](_0x331fa9);}return null;};}function patchUpdates(_0x3a1852){return function(_0x23229d){try{jsonpatch[_0x461a('0x23')](_0x23229d,_0x3a1852,!![]);}catch(_0x4a0f9a){return BPromise[_0x461a('0x24')](_0x4a0f9a);}return _0x23229d[_0x461a('0x25')]();};}function saveUpdates(_0x1d46d2,_0x2ed108){return function(_0x28a009){if(_0x28a009){return _0x28a009[_0x461a('0x26')](_0x1d46d2)[_0x461a('0x27')](function(_0xfa209c){return _0xfa209c;});}return null;};}function removeEntity(_0x2e69ca,_0x3441f1){return function(_0x3a1f7d){if(_0x3a1f7d){return _0x3a1f7d['destroy']()['then'](function(){_0x2e69ca[_0x461a('0x1a')](0xcc)[_0x461a('0x1b')]();});}};}function handleEntityNotFound(_0x13e3c3,_0x58a84d){return function(_0x170a71){if(!_0x170a71){_0x13e3c3[_0x461a('0x19')](0x194);}return _0x170a71;};}function handleError(_0x40382b,_0x40e705){_0x40e705=_0x40e705||0x1f4;return function(_0x1d24da){logger[_0x461a('0x28')](_0x1d24da[_0x461a('0x29')]);if(_0x1d24da[_0x461a('0x2a')]){delete _0x1d24da[_0x461a('0x2a')];}_0x40382b[_0x461a('0x1a')](_0x40e705)['send'](_0x1d24da);};}exports['index']=function(_0x3b04e1,_0x34f1bc){var _0x56e280={},_0x2e6f9a={},_0x107ac1={'count':0x0,'rows':[]};var _0xcaf529=_[_0x461a('0x2b')](db[_0x461a('0x2c')][_0x461a('0x2d')],function(_0x14668f){return{'name':_0x14668f['fieldName'],'type':_0x14668f['type'][_0x461a('0x2e')]};});_0x2e6f9a['model']=_[_0x461a('0x2b')](_0xcaf529,'name');_0x2e6f9a[_0x461a('0x2f')]=_['keys'](_0x3b04e1[_0x461a('0x2f')]);_0x2e6f9a[_0x461a('0x30')]=_['intersection'](_0x2e6f9a[_0x461a('0x31')],_0x2e6f9a[_0x461a('0x2f')]);_0x56e280[_0x461a('0x32')]=_[_0x461a('0x33')](_0x2e6f9a[_0x461a('0x31')],qs[_0x461a('0x34')](_0x3b04e1[_0x461a('0x2f')]['fields']));_0x56e280[_0x461a('0x32')]=_0x56e280['attributes'][_0x461a('0x35')]?_0x56e280[_0x461a('0x32')]:_0x2e6f9a[_0x461a('0x31')];if(!_0x3b04e1['query']['hasOwnProperty'](_0x461a('0x36'))){_0x56e280[_0x461a('0x1f')]=qs['limit'](_0x3b04e1[_0x461a('0x2f')][_0x461a('0x1f')]);_0x56e280['offset']=qs['offset'](_0x3b04e1[_0x461a('0x2f')][_0x461a('0x1e')]);}_0x56e280[_0x461a('0x37')]=qs[_0x461a('0x38')](_0x3b04e1[_0x461a('0x2f')][_0x461a('0x38')]);_0x56e280[_0x461a('0x39')]=qs[_0x461a('0x30')](_[_0x461a('0x3a')](_0x3b04e1[_0x461a('0x2f')],_0x2e6f9a[_0x461a('0x30')]),_0xcaf529);if(_0x3b04e1[_0x461a('0x2f')]['filter']){_0x56e280[_0x461a('0x39')]=_['merge'](_0x56e280['where'],{'$or':_[_0x461a('0x2b')](_0xcaf529,function(_0x4b9994){if(_0x4b9994[_0x461a('0x3b')]!==_0x461a('0x3c')){var _0x3409e2={};_0x3409e2[_0x4b9994[_0x461a('0x2a')]]={'$like':'%'+_0x3b04e1['query'][_0x461a('0x3d')]+'%'};return _0x3409e2;}})});}_0x56e280=_[_0x461a('0x3e')]({},_0x56e280,_0x3b04e1['options']);var _0x237f50={'where':_0x56e280[_0x461a('0x39')]};return db[_0x461a('0x2c')]['count'](_0x237f50)[_0x461a('0x27')](function(_0x52399f){_0x107ac1[_0x461a('0x1d')]=_0x52399f;if(_0x3b04e1['query'][_0x461a('0x3f')]){_0x56e280[_0x461a('0x40')]=[{'all':!![]}];}return db[_0x461a('0x2c')][_0x461a('0x41')](_0x56e280);})[_0x461a('0x27')](function(_0x5425c7){_0x107ac1[_0x461a('0x42')]=_0x5425c7;return _0x107ac1;})['then'](respondWithFilteredResult(_0x34f1bc,_0x56e280))[_0x461a('0x43')](handleError(_0x34f1bc,null));};exports['show']=function(_0x1e5328,_0x18d35d){var _0x426ef8={'raw':!![],'where':{'id':_0x1e5328[_0x461a('0x44')]['id']}},_0x324c36={};_0x324c36[_0x461a('0x31')]=_[_0x461a('0x45')](db[_0x461a('0x2c')][_0x461a('0x2d')]);_0x324c36['query']=_[_0x461a('0x45')](_0x1e5328[_0x461a('0x2f')]);_0x324c36['filters']=_[_0x461a('0x33')](_0x324c36[_0x461a('0x31')],_0x324c36[_0x461a('0x2f')]);_0x426ef8['attributes']=_[_0x461a('0x33')](_0x324c36['model'],qs[_0x461a('0x34')](_0x1e5328[_0x461a('0x2f')][_0x461a('0x34')]));_0x426ef8[_0x461a('0x32')]=_0x426ef8[_0x461a('0x32')][_0x461a('0x35')]?_0x426ef8[_0x461a('0x32')]:_0x324c36['model'];if(_0x1e5328[_0x461a('0x2f')][_0x461a('0x3f')]){_0x426ef8[_0x461a('0x40')]=[{'all':!![]}];}_0x426ef8=_[_0x461a('0x3e')]({},_0x426ef8,_0x1e5328[_0x461a('0x46')]);return db[_0x461a('0x2c')]['find'](_0x426ef8)[_0x461a('0x27')](handleEntityNotFound(_0x18d35d,null))[_0x461a('0x27')](respondWithResult(_0x18d35d,null))[_0x461a('0x43')](handleError(_0x18d35d,null));};exports[_0x461a('0x47')]=function(_0x2ba4e6,_0x4ebf94){var _0x4a1447={'where':{'id':_0x2ba4e6[_0x461a('0x44')]['id']}},_0x52c7be={};_0x52c7be['model']=_[_0x461a('0x45')](db['Attachment'][_0x461a('0x2d')]);_0x4a1447[_0x461a('0x32')]=_['intersection'](_0x52c7be['model'],qs[_0x461a('0x34')](_0x2ba4e6[_0x461a('0x2f')][_0x461a('0x34')]));_0x4a1447[_0x461a('0x32')]=_0x4a1447[_0x461a('0x32')][_0x461a('0x35')]?_0x4a1447[_0x461a('0x32')]:_0x52c7be[_0x461a('0x31')];if(_0x2ba4e6[_0x461a('0x2f')]['includeAll']){_0x4a1447[_0x461a('0x40')]=[{'all':!![]}];}_0x4a1447=_[_0x461a('0x3e')]({},_0x4a1447,_0x2ba4e6[_0x461a('0x46')]);return db['Attachment'][_0x461a('0x48')](_0x4a1447)[_0x461a('0x27')](handleEntityNotFound(_0x4ebf94,null))['then'](function(_0x36d22b){if(_0x36d22b){var _0x1ad41b=_0x36d22b[_0x461a('0x49')]({'plain':!![]});_0x1ad41b=qs[_0x461a('0x4a')](_0x1ad41b,['id','createdAt',_0x461a('0x4b')]);_0x2ba4e6['body']=_[_0x461a('0x4a')](_0x2ba4e6[_0x461a('0x4c')],['id',_0x461a('0x4d'),'updatedAt']);return db[_0x461a('0x2c')][_0x461a('0x4e')](_['merge'](_0x1ad41b,_0x2ba4e6['body']),{'include':_0x2ba4e6[_0x461a('0x2f')]['includeAll']?[{'all':!![]}]:undefined});}})[_0x461a('0x27')](respondWithResult(_0x4ebf94,0xc9))[_0x461a('0x43')](handleError(_0x4ebf94,null));};exports[_0x461a('0x26')]=function(_0x15ab07,_0x4af074){if(_0x15ab07[_0x461a('0x4c')]['id']){delete _0x15ab07[_0x461a('0x4c')]['id'];}return db[_0x461a('0x2c')]['find']({'where':{'id':_0x15ab07[_0x461a('0x44')]['id']}})[_0x461a('0x27')](handleEntityNotFound(_0x4af074,null))[_0x461a('0x27')](saveUpdates(_0x15ab07[_0x461a('0x4c')],null))[_0x461a('0x27')](respondWithResult(_0x4af074,null))[_0x461a('0x43')](handleError(_0x4af074,null));};exports['destroy']=function(_0xaee1ee,_0x310ee3){return db[_0x461a('0x2c')]['find']({'where':{'id':_0xaee1ee[_0x461a('0x44')]['id']}})['then'](handleEntityNotFound(_0x310ee3,null))[_0x461a('0x27')](removeEntity(_0x310ee3,null))[_0x461a('0x43')](handleError(_0x310ee3,null));};exports[_0x461a('0x4e')]=function(_0x36f615,_0xbb61a1,_0x166d96){_0x36f615[_0x461a('0x4c')][_0x461a('0x2a')]=_0x36f615[_0x461a('0x4f')][_0x461a('0x50')];_0x36f615[_0x461a('0x4c')][_0x461a('0x51')]=_0x36f615[_0x461a('0x4f')]['filename'];_0x36f615[_0x461a('0x4c')][_0x461a('0x3b')]=_0x36f615[_0x461a('0x4f')][_0x461a('0x52')];return db['Attachment'][_0x461a('0x4e')](_0x36f615['body'])[_0x461a('0x27')](respondWithResult(_0xbb61a1,0xc9))['catch'](handleError(_0xbb61a1,null));};exports[_0x461a('0x53')]=function(_0x4730dc,_0x4dd4ef,_0x379e82){return db[_0x461a('0x2c')][_0x461a('0x54')]({'where':{'id':_0x4730dc['params']['id']},'raw':!![]})['then'](handleEntityNotFound(_0x4dd4ef,null))[_0x461a('0x27')](function(_0xf4b899){if(_0xf4b899){var _0x230468=_0xf4b899[_0x461a('0x55')]!==null;var _0x3c3a79=path[_0x461a('0x56')](config[_0x461a('0x57')],_0x461a('0x58'));if(_0x230468){_0x3c3a79=path[_0x461a('0x56')](_0x3c3a79,_0x461a('0x59'));}var _0x19a51e=path['join'](_0x3c3a79,_0xf4b899[_0x461a('0x51')]);return _0x4dd4ef[_0x461a('0x53')](_0x19a51e);}})[_0x461a('0x43')](handleError(_0x4dd4ef,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index 8e082ea..4087566 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 _0xc155=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./attachment.attributes','define','attachments'];(function(_0x46cb32,_0x4dcba3){var _0x4281aa=function(_0x4a3ee2){while(--_0x4a3ee2){_0x46cb32['push'](_0x46cb32['shift']());}};_0x4281aa(++_0x4dcba3);}(_0xc155,0x90));var _0x5c15=function(_0x13e0a1,_0x3092d3){_0x13e0a1=_0x13e0a1-0x0;var _0x5d7318=_0xc155[_0x13e0a1];return _0x5d7318;};'use strict';var _=require(_0x5c15('0x0'));var util=require(_0x5c15('0x1'));var logger=require(_0x5c15('0x2'))(_0x5c15('0x3'));var moment=require(_0x5c15('0x4'));var BPromise=require(_0x5c15('0x5'));var rp=require(_0x5c15('0x6'));var fs=require('fs');var path=require(_0x5c15('0x7'));var rimraf=require('rimraf');var config=require(_0x5c15('0x8'));var attributes=require(_0x5c15('0x9'));module['exports']=function(_0x1065e5,_0x2fd23a){return _0x1065e5[_0x5c15('0xa')]('Attachment',attributes,{'tableName':_0x5c15('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4d0a=['rimraf','../../config/environment','./attachment.attributes','define','util','../../config/logger','bluebird','request-promise'];(function(_0x1b0865,_0x1daf7e){var _0x318381=function(_0x4f9ed2){while(--_0x4f9ed2){_0x1b0865['push'](_0x1b0865['shift']());}};_0x318381(++_0x1daf7e);}(_0x4d0a,0x134));var _0xa4d0=function(_0x4caf8a,_0x58292a){_0x4caf8a=_0x4caf8a-0x0;var _0x5b4df6=_0x4d0a[_0x4caf8a];return _0x5b4df6;};'use strict';var _=require('lodash');var util=require(_0xa4d0('0x0'));var logger=require(_0xa4d0('0x1'))('api');var moment=require('moment');var BPromise=require(_0xa4d0('0x2'));var rp=require(_0xa4d0('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa4d0('0x4'));var config=require(_0xa4d0('0x5'));var attributes=require(_0xa4d0('0x6'));module['exports']=function(_0x4a7884,_0x2c1c2a){return _0x4a7884[_0xa4d0('0x7')]('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 442dd18..08b07f3 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 _0xf323=['create','options','raw','debug','CreateAttachment','catch','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','Attachment'];(function(_0x203883,_0x5532f4){var _0x83022e=function(_0x5dc021){while(--_0x5dc021){_0x203883['push'](_0x203883['shift']());}};_0x83022e(++_0x5532f4);}(_0xf323,0x1c6));var _0x3f32=function(_0x144dd9,_0x8b4392){_0x144dd9=_0x144dd9-0x0;var _0x4a8e88=_0xf323[_0x144dd9];return _0x4a8e88;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3f32('0x0'));var BPromise=require(_0x3f32('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3f32('0x2'));var db=require(_0x3f32('0x3'))['db'];var utils=require(_0x3f32('0x4'));var logger=require(_0x3f32('0x5'))(_0x3f32('0x6'));var config=require('../../config/environment');var jayson=require(_0x3f32('0x7'));var client=jayson[_0x3f32('0x8')][_0x3f32('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1134e9,_0x5c9dc2,_0x567ab1){return new BPromise(function(_0x34b93e,_0x109af2){return client[_0x3f32('0xa')](_0x1134e9,_0x567ab1)[_0x3f32('0xb')](function(_0x22a9d3){logger[_0x3f32('0xc')](_0x3f32('0xd'),_0x5c9dc2,_0x3f32('0xe'));logger['debug'](_0x3f32('0xf'),_0x5c9dc2,_0x3f32('0xe'),JSON[_0x3f32('0x10')](_0x22a9d3));if(_0x22a9d3['error']){if(_0x22a9d3[_0x3f32('0x11')][_0x3f32('0x12')]===0x1f4){logger[_0x3f32('0x11')](_0x3f32('0xd'),_0x5c9dc2,_0x22a9d3['error']['message']);return _0x109af2(_0x22a9d3[_0x3f32('0x11')][_0x3f32('0x13')]);}logger['error'](_0x3f32('0xd'),_0x5c9dc2,_0x22a9d3[_0x3f32('0x11')][_0x3f32('0x13')]);return _0x34b93e(_0x22a9d3['error']['message']);}else{logger[_0x3f32('0xc')](_0x3f32('0xd'),_0x5c9dc2,_0x3f32('0xe'));_0x34b93e(_0x22a9d3[_0x3f32('0x14')]['message']);}})['catch'](function(_0x352010){logger[_0x3f32('0x11')](_0x3f32('0xd'),_0x5c9dc2,_0x352010);_0x109af2(_0x352010);});});}exports['CreateAttachment']=function(_0x5c36d9){var _0x1697c9=this;return new Promise(function(_0x19ec90,_0x8d70ee){return db[_0x3f32('0x15')][_0x3f32('0x16')](_0x5c36d9['body'],{'raw':_0x5c36d9[_0x3f32('0x17')]?_0x5c36d9[_0x3f32('0x17')][_0x3f32('0x18')]===undefined?!![]:![]:!![]})[_0x3f32('0xb')](function(_0xbc366b){logger[_0x3f32('0xc')]('CreateAttachment',_0x5c36d9);logger[_0x3f32('0x19')](_0x3f32('0x1a'),_0x5c36d9,JSON['stringify'](_0xbc366b));_0x19ec90(_0xbc366b);})[_0x3f32('0x1b')](function(_0x21cf2e){logger[_0x3f32('0x11')](_0x3f32('0x1a'),_0x21cf2e['message'],_0x5c36d9);_0x8d70ee(_0x1697c9[_0x3f32('0x11')](0x1f4,_0x21cf2e[_0x3f32('0x13')]));});});}; \ No newline at end of file +var _0x2f68=['client','request','then','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','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise'];(function(_0x43a01c,_0x42bd4d){var _0x4aeaf3=function(_0x48a6ea){while(--_0x48a6ea){_0x43a01c['push'](_0x43a01c['shift']());}};_0x4aeaf3(++_0x42bd4d);}(_0x2f68,0x9a));var _0x82f6=function(_0x22bce0,_0x4508ba){_0x22bce0=_0x22bce0-0x0;var _0xeb74a0=_0x2f68[_0x22bce0];return _0xeb74a0;};'use strict';var _=require('lodash');var util=require(_0x82f6('0x0'));var moment=require(_0x82f6('0x1'));var BPromise=require(_0x82f6('0x2'));var rs=require(_0x82f6('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x82f6('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x82f6('0x5'))(_0x82f6('0x6'));var config=require('../../config/environment');var jayson=require(_0x82f6('0x7'));var client=jayson[_0x82f6('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5a8089,_0x1bc0be,_0x5660bf){return new BPromise(function(_0x5daa3c,_0x864400){return client[_0x82f6('0x9')](_0x5a8089,_0x5660bf)[_0x82f6('0xa')](function(_0x5ee0e5){logger[_0x82f6('0xb')](_0x82f6('0xc'),_0x1bc0be,'request\x20sent');logger[_0x82f6('0xd')](_0x82f6('0xe'),_0x1bc0be,_0x82f6('0xf'),JSON[_0x82f6('0x10')](_0x5ee0e5));if(_0x5ee0e5[_0x82f6('0x11')]){if(_0x5ee0e5[_0x82f6('0x11')]['code']===0x1f4){logger[_0x82f6('0x11')](_0x82f6('0xc'),_0x1bc0be,_0x5ee0e5['error'][_0x82f6('0x12')]);return _0x864400(_0x5ee0e5[_0x82f6('0x11')][_0x82f6('0x12')]);}logger[_0x82f6('0x11')](_0x82f6('0xc'),_0x1bc0be,_0x5ee0e5[_0x82f6('0x11')][_0x82f6('0x12')]);return _0x5daa3c(_0x5ee0e5[_0x82f6('0x11')][_0x82f6('0x12')]);}else{logger['info'](_0x82f6('0xc'),_0x1bc0be,'request\x20sent');_0x5daa3c(_0x5ee0e5[_0x82f6('0x13')][_0x82f6('0x12')]);}})[_0x82f6('0x14')](function(_0x1033d3){logger[_0x82f6('0x11')](_0x82f6('0xc'),_0x1bc0be,_0x1033d3);_0x864400(_0x1033d3);});});}exports[_0x82f6('0x15')]=function(_0xcbc95f){var _0x4072f0=this;return new Promise(function(_0x2bfd57,_0x1c79f9){return db[_0x82f6('0x16')][_0x82f6('0x17')](_0xcbc95f[_0x82f6('0x18')],{'raw':_0xcbc95f[_0x82f6('0x19')]?_0xcbc95f['options'][_0x82f6('0x1a')]===undefined?!![]:![]:!![]})[_0x82f6('0xa')](function(_0x55cbce){logger[_0x82f6('0xb')](_0x82f6('0x15'),_0xcbc95f);logger[_0x82f6('0xd')](_0x82f6('0x15'),_0xcbc95f,JSON['stringify'](_0x55cbce));_0x2bfd57(_0x55cbce);})[_0x82f6('0x14')](function(_0x4beccf){logger[_0x82f6('0x11')](_0x82f6('0x15'),_0x4beccf['message'],_0xcbc95f);_0x1c79f9(_0x4072f0['error'](0x1f4,_0x4beccf[_0x82f6('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index 5cfe904..a59c804 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(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x0b0e,0x187));var _0xe0b0=function(_0x351509,_0x54725c){_0x351509=_0x351509-0x0;var _0x4e9861=_0x0b0e[_0x351509];return _0x4e9861;};'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 _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(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x0b0e,0x187));var _0xe0b0=function(_0x237bf7,_0xb851fc){_0x237bf7=_0x237bf7-0x0;var _0x5928ba=_0x0b0e[_0x237bf7];return _0x5928ba;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var fs_extra=require(_0xe0b0('0x4'));var auth=require(_0xe0b0('0x5'));var interaction=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var controller=require(_0xe0b0('0x8'));router[_0xe0b0('0x9')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xb')]);router[_0xe0b0('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xe0b0('0xc')]);router[_0xe0b0('0x9')](_0xe0b0('0xd'),auth[_0xe0b0('0xa')](),controller['download']);router[_0xe0b0('0xe')](_0xe0b0('0xf'),auth['isAuthenticated'](),controller[_0xe0b0('0x10')]);var upload=multer({'storage':multer[_0xe0b0('0x11')]({'destination':function(_0x574d96,_0x399320,_0x2cdad2){_0x2cdad2(null,path[_0xe0b0('0x12')](config['root'],_0xe0b0('0x13')));},'filename':function(_0x1c358a,_0x3cc19a,_0x45f914){_0x45f914(null,util[_0xe0b0('0x14')]('%s-%s',Date[_0xe0b0('0x15')](),_0x3cc19a[_0xe0b0('0x16')][_0xe0b0('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xe0b0('0xe')]('/',upload[_0xe0b0('0x18')]('file'),controller[_0xe0b0('0x19')]);router['put'](_0xe0b0('0x1a'),auth[_0xe0b0('0xa')](),controller['update']);router[_0xe0b0('0x1b')]('/:id',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x1c')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index 6a3cf8d..7f01341 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 _0xe45f=['google','profile','email','authenticate','/login','use','clientID','clientSecret','callbackURL','Setting','findOne','allowedLoginAttempts','blockDuration','User','find','map','emails','value','admin','agent','then','disabled','blockedAt','add','minutes','clearBlockUser','getLicense','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','catch','lodash','passport','passport-google-oauth20','Strategy','moment','../../mysqldb','../../config/environment','../../components/auth/service','signToken','../../config/utils','login'];(function(_0x4533ec,_0x2e7187){var _0x43ead4=function(_0x1b8f87){while(--_0x1b8f87){_0x4533ec['push'](_0x4533ec['shift']());}};_0x43ead4(++_0x2e7187);}(_0xe45f,0x6d));var _0xfe45=function(_0x128d23,_0x3e6b7d){_0x128d23=_0x128d23-0x0;var _0x395633=_0xe45f[_0x128d23];return _0x395633;};'use strict';var _=require(_0xfe45('0x0'));var passport=require(_0xfe45('0x1'));var GoogleStrategy=require(_0xfe45('0x2'))[_0xfe45('0x3')];var moment=require(_0xfe45('0x4'));var db=require(_0xfe45('0x5'))['db'];var config=require(_0xfe45('0x6'));var signToken=require(_0xfe45('0x7'))[_0xfe45('0x8')];var utils=require(_0xfe45('0x9'));exports[_0xfe45('0xa')]=passport['authenticate'](_0xfe45('0xb'),{'failureRedirect':'/login','scope':[_0xfe45('0xc'),_0xfe45('0xd')],'session':![]});exports['callback']=passport[_0xfe45('0xe')](_0xfe45('0xb'),{'failureRedirect':_0xfe45('0xf'),'session':![]});passport[_0xfe45('0x10')](new GoogleStrategy({'clientID':config[_0xfe45('0xb')]?config[_0xfe45('0xb')][_0xfe45('0x11')]:'id','clientSecret':config[_0xfe45('0xb')]?config['google'][_0xfe45('0x12')]:'secret','callbackURL':config[_0xfe45('0xb')]?config[_0xfe45('0xb')][_0xfe45('0x13')]:''},function(_0x5294cb,_0x4db001,_0x18b693,_0xe62d08){var _0x29925d,_0x3e021e;return db[_0xfe45('0x14')][_0xfe45('0x15')]({'where':{'id':0x1},'attributes':[_0xfe45('0x16'),_0xfe45('0x17')],'raw':!![]})['then'](function(_0x6dd9e2){_0x29925d=_0x6dd9e2;return db[_0xfe45('0x18')][_0xfe45('0x19')]({'where':{'email':_[_0xfe45('0x1a')](_0x18b693[_0xfe45('0x1b')],_0xfe45('0x1c')),'role':{'$or':[_0xfe45('0x1d'),'user',_0xfe45('0x1e')]}}});})[_0xfe45('0x1f')](function(_0x657165){_0x3e021e=_0x657165;if(_0x3e021e){if(_0x3e021e[_0xfe45('0x20')]){return _0xe62d08('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(_0x29925d[_0xfe45('0x17')]>0x0){if(_0x3e021e['blocked']){if(moment(_0x3e021e[_0xfe45('0x21')])[_0xfe45('0x22')](_0x29925d[_0xfe45('0x17')],_0xfe45('0x23'))>moment()){return _0xe62d08('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{return utils[_0xfe45('0x24')](_0x3e021e,0x0,![],null)[_0xfe45('0x1f')](function(){return utils[_0xfe45('0x25')](_0x3e021e);})[_0xfe45('0x1f')](function(){return _0xe62d08(null,_0x3e021e);});}}else{return utils[_0xfe45('0x25')](_0x3e021e)[_0xfe45('0x1f')](function(){return _0xe62d08(null,_0x3e021e);});}}else{return utils[_0xfe45('0x25')](_0x3e021e)[_0xfe45('0x1f')](function(){return _0xe62d08(null,_0x3e021e);});}}return _0xe62d08(_0xfe45('0x26'));})[_0xfe45('0x27')](function(_0x16f48d){_0xe62d08(_0x16f48d);});})); \ No newline at end of file +var _0x24f9=['moment','../../mysqldb','../../config/environment','../../components/auth/service','signToken','login','google','/login','profile','email','callback','authenticate','clientID','clientSecret','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','User','find','map','emails','agent','then','disabled','blocked','blockedAt','add','minutes','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','clearBlockUser','getLicense','catch','passport'];(function(_0x37d5cf,_0x2fef1a){var _0x283e2e=function(_0x1284a2){while(--_0x1284a2){_0x37d5cf['push'](_0x37d5cf['shift']());}};_0x283e2e(++_0x2fef1a);}(_0x24f9,0x15d));var _0x924f=function(_0x71a3b4,_0x42aef6){_0x71a3b4=_0x71a3b4-0x0;var _0x50fb89=_0x24f9[_0x71a3b4];return _0x50fb89;};'use strict';var _=require('lodash');var passport=require(_0x924f('0x0'));var GoogleStrategy=require('passport-google-oauth20')['Strategy'];var moment=require(_0x924f('0x1'));var db=require(_0x924f('0x2'))['db'];var config=require(_0x924f('0x3'));var signToken=require(_0x924f('0x4'))[_0x924f('0x5')];var utils=require('../../config/utils');exports[_0x924f('0x6')]=passport['authenticate'](_0x924f('0x7'),{'failureRedirect':_0x924f('0x8'),'scope':[_0x924f('0x9'),_0x924f('0xa')],'session':![]});exports[_0x924f('0xb')]=passport[_0x924f('0xc')](_0x924f('0x7'),{'failureRedirect':_0x924f('0x8'),'session':![]});passport['use'](new GoogleStrategy({'clientID':config[_0x924f('0x7')]?config[_0x924f('0x7')][_0x924f('0xd')]:'id','clientSecret':config[_0x924f('0x7')]?config['google'][_0x924f('0xe')]:_0x924f('0xf'),'callbackURL':config[_0x924f('0x7')]?config['google'][_0x924f('0x10')]:''},function(_0x202a4a,_0x235f37,_0x2dd0f8,_0x15e2cc){var _0x524a98,_0x5cad17;return db['Setting'][_0x924f('0x11')]({'where':{'id':0x1},'attributes':[_0x924f('0x12'),_0x924f('0x13')],'raw':!![]})['then'](function(_0x271793){_0x524a98=_0x271793;return db[_0x924f('0x14')][_0x924f('0x15')]({'where':{'email':_[_0x924f('0x16')](_0x2dd0f8[_0x924f('0x17')],'value'),'role':{'$or':['admin','user',_0x924f('0x18')]}}});})[_0x924f('0x19')](function(_0x2f31bd){_0x5cad17=_0x2f31bd;if(_0x5cad17){if(_0x5cad17[_0x924f('0x1a')]){return _0x15e2cc('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(_0x524a98[_0x924f('0x13')]>0x0){if(_0x5cad17[_0x924f('0x1b')]){if(moment(_0x5cad17[_0x924f('0x1c')])[_0x924f('0x1d')](_0x524a98[_0x924f('0x13')],_0x924f('0x1e'))>moment()){return _0x15e2cc(_0x924f('0x1f'));}else{return utils[_0x924f('0x20')](_0x5cad17,0x0,![],null)[_0x924f('0x19')](function(){return utils[_0x924f('0x21')](_0x5cad17);})[_0x924f('0x19')](function(){return _0x15e2cc(null,_0x5cad17);});}}else{return utils['getLicense'](_0x5cad17)['then'](function(){return _0x15e2cc(null,_0x5cad17);});}}else{return utils['getLicense'](_0x5cad17)[_0x924f('0x19')](function(){return _0x15e2cc(null,_0x5cad17);});}}return _0x15e2cc('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');})[_0x924f('0x22')](function(_0x1d3207){_0x15e2cc(_0x1d3207);});})); \ No newline at end of file diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index 1838225..bf8db6a 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 _0x42a2=['./authGoogle.controller','../user/user.controller.js','get','login','/callback','callback','isMiddleware','setTokenCookie','express','Router'];(function(_0x20e81e,_0x2ad41f){var _0x3e6654=function(_0x3f2904){while(--_0x3f2904){_0x20e81e['push'](_0x20e81e['shift']());}};_0x3e6654(++_0x2ad41f);}(_0x42a2,0xf8));var _0x242a=function(_0x47fd36,_0x41535d){_0x47fd36=_0x47fd36-0x0;var _0x21a0fc=_0x42a2[_0x47fd36];return _0x21a0fc;};'use strict';var express=require(_0x242a('0x0'));var passport=require('passport');var router=express[_0x242a('0x1')]();var controller=require(_0x242a('0x2'));var userController=require(_0x242a('0x3'));var authService=require('../../components/auth/service');router[_0x242a('0x4')]('/',controller[_0x242a('0x5')]);router[_0x242a('0x4')](_0x242a('0x6'),controller[_0x242a('0x7')],authService[_0x242a('0x8')],userController[_0x242a('0x5')],authService[_0x242a('0x9')]);module['exports']=router; \ No newline at end of file +var _0xba27=['./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','/callback','isMiddleware','login','exports','passport','Router'];(function(_0x2ee1d1,_0x1443fc){var _0x4215d2=function(_0x518aac){while(--_0x518aac){_0x2ee1d1['push'](_0x2ee1d1['shift']());}};_0x4215d2(++_0x1443fc);}(_0xba27,0x15c));var _0x7ba2=function(_0x276e0a,_0xfa4f3f){_0x276e0a=_0x276e0a-0x0;var _0x1f2970=_0xba27[_0x276e0a];return _0x1f2970;};'use strict';var express=require('express');var passport=require(_0x7ba2('0x0'));var router=express[_0x7ba2('0x1')]();var controller=require(_0x7ba2('0x2'));var userController=require(_0x7ba2('0x3'));var authService=require(_0x7ba2('0x4'));router[_0x7ba2('0x5')]('/',controller['login']);router[_0x7ba2('0x5')](_0x7ba2('0x6'),controller['callback'],authService[_0x7ba2('0x7')],userController[_0x7ba2('0x8')],authService['setTokenCookie']);module[_0x7ba2('0x9')]=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index 854f7c4..1f30ed4 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 _0x7c21=['token','now','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','password','previousPasswords','util','passport','passport-local','jayson/promise','lodash','moment','../../mysqldb','../../components/auth/service','../../config/utils','http','Setting','findOne','allowedLoginAttempts','then','name','salt','role','disabled','loginAttempts','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','blocked','blockDuration','blockedAt','minutes','clearBlockUser','add','getLicense','catch','find','email','MailServerOut','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','secure','auth','merge','\x22%s\x22\x20<%s>','request','SendMail','error','format','message','send','login','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','body','Email\x20parameter\x20is\x20missing','trim','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','status','params'];(function(_0x366f2a,_0x116363){var _0x6e347d=function(_0x2293e3){while(--_0x2293e3){_0x366f2a['push'](_0x366f2a['shift']());}};_0x6e347d(++_0x116363);}(_0x7c21,0x1e2));var _0x17c2=function(_0x996bff,_0x389fc9){_0x996bff=_0x996bff-0x0;var _0x442fda=_0x7c21[_0x996bff];return _0x442fda;};'use strict';var util=require(_0x17c2('0x0'));var passport=require(_0x17c2('0x1'));var LocalStrategy=require(_0x17c2('0x2'))['Strategy'];var jayson=require(_0x17c2('0x3'));var _=require(_0x17c2('0x4'));var rs=require('randomstring');var moment=require(_0x17c2('0x5'));var db=require(_0x17c2('0x6'))['db'];var authService=require(_0x17c2('0x7'));var utils=require(_0x17c2('0x8'));var client=jayson['client'][_0x17c2('0x9')]({'port':0x232b});function localAuthenticate(_0x4b7196,_0x5b1d18,_0x30a8bc,_0xc0d8c8){var _0x3c354d,_0x43e027;return db[_0x17c2('0xa')][_0x17c2('0xb')]({'where':{'id':0x1},'attributes':[_0x17c2('0xc'),'blockDuration'],'raw':!![]})[_0x17c2('0xd')](function(_0x483f6f){_0x3c354d=_0x483f6f;return _0x4b7196['findOne']({'attributes':['id',_0x17c2('0xe'),'password',_0x17c2('0xf'),_0x17c2('0x10'),_0x17c2('0x11'),'blocked','blockedAt',_0x17c2('0x12')],'where':{'name':_0x5b1d18,'role':{'$or':['admin',_0x17c2('0x13'),_0x17c2('0x14')]}}});})[_0x17c2('0xd')](function(_0xd9e07a){if(!_0xd9e07a||_0xd9e07a&&_0xd9e07a['name']!==_0x5b1d18){throw new Error(_0x17c2('0x15'));}else{_0x43e027=_0xd9e07a;return _0x43e027;}})[_0x17c2('0xd')](function(){_0x43e027[_0x17c2('0x16')](_0x30a8bc,function(_0x246ede,_0x3ebf19){var _0x5a6d4f=_0x43e027[_0x17c2('0x12')]+0x1;if(_0x246ede){return _0xc0d8c8(_0x246ede);}else if(!_0x3ebf19){if(_0x43e027[_0x17c2('0x11')]){return _0xc0d8c8(null,![],{'message':_0x17c2('0x15')});}else if(_0x3c354d[_0x17c2('0xc')]>0x0){if(_0x43e027[_0x17c2('0x17')]){if(_0x3c354d[_0x17c2('0x18')]>0x0){if(moment(_0x43e027[_0x17c2('0x19')])['add'](_0x3c354d[_0x17c2('0x18')],_0x17c2('0x1a'))>moment()){return _0xc0d8c8(null,![],{'message':_0x17c2('0x15')});}else{return utils[_0x17c2('0x1b')](_0x43e027,_0x5a6d4f,![],null)[_0x17c2('0xd')](function(){return _0xc0d8c8(null,![],{'message':_0x17c2('0x15')});});}}else{return _0xc0d8c8(null,![],{'message':_0x17c2('0x15')});}}else{if(_0x5a6d4f>=_0x3c354d[_0x17c2('0xc')]){return utils[_0x17c2('0x1b')](_0x43e027,0x0,!![],moment())[_0x17c2('0xd')](function(){return _0xc0d8c8(null,![],{'message':_0x17c2('0x15')});});}else{return utils[_0x17c2('0x1b')](_0x43e027,_0x5a6d4f,![],null)[_0x17c2('0xd')](function(){return _0xc0d8c8(null,![],{'message':_0x17c2('0x15')});});}}}else{return _0xc0d8c8(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x43e027['disabled']){return _0xc0d8c8(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x3c354d[_0x17c2('0xc')]>0x0){if(_0x43e027[_0x17c2('0x17')]){if(_0x3c354d[_0x17c2('0x18')]>0x0){if(moment(_0x43e027[_0x17c2('0x19')])[_0x17c2('0x1c')](_0x3c354d[_0x17c2('0x18')],_0x17c2('0x1a'))>moment()){return _0xc0d8c8(null,![],{'message':_0x17c2('0x15')});}else{return utils[_0x17c2('0x1b')](_0x43e027,0x0,![],null)[_0x17c2('0xd')](function(){return utils[_0x17c2('0x1d')](_0x43e027);})[_0x17c2('0xd')](function(){return _0xc0d8c8(null,_0x43e027);});}}else{return _0xc0d8c8(null,![],{'message':_0x17c2('0x15')});}}else{return utils[_0x17c2('0x1b')](_0x43e027,0x0,![],null)[_0x17c2('0xd')](function(){return utils['getLicense'](_0x43e027);})[_0x17c2('0xd')](function(){return _0xc0d8c8(null,_0x43e027);})[_0x17c2('0x1e')](function(_0x53b831){return _0xc0d8c8(null,![],_0x53b831);});}}else{if(_0x43e027[_0x17c2('0x17')]){return _0xc0d8c8(null,![],{'message':_0x17c2('0x15')});}else{return utils[_0x17c2('0x1d')](_0x43e027)[_0x17c2('0xd')](function(){return _0xc0d8c8(null,_0x43e027);});}}}});})[_0x17c2('0x1e')](function(_0x50232f){return _0xc0d8c8(null,![],_0x50232f);});}function sendServiceMail(_0x45a3b0){return db['MailAccount'][_0x17c2('0x1f')]({'where':{'service':!![]},'attributes':['id',_0x17c2('0xe'),_0x17c2('0x20')],'include':[{'model':db[_0x17c2('0x21')],'as':_0x17c2('0x22')}]})['then'](function(_0x1b69f2){if(!_0x1b69f2){throw new Error(_0x17c2('0x23'));}var _0x191103={'tls':{'rejectUnauthorized':![]}};if(_0x1b69f2['Smtp'][_0x17c2('0x24')]){_0x191103[_0x17c2('0x24')]=_0x1b69f2[_0x17c2('0x22')][_0x17c2('0x24')];}else{_0x191103['host']=_0x1b69f2[_0x17c2('0x22')][_0x17c2('0x25')];_0x191103['port']=_0x1b69f2[_0x17c2('0x22')]['port'];_0x191103[_0x17c2('0x26')]=_0x1b69f2[_0x17c2('0x22')][_0x17c2('0x26')];}if(_0x1b69f2['Smtp']['authentication']){_0x191103[_0x17c2('0x27')]={'user':_0x1b69f2[_0x17c2('0x22')][_0x17c2('0x13')],'pass':_0x1b69f2[_0x17c2('0x22')]['pass']};}var _0x2da177={'account':_0x191103,'message':_[_0x17c2('0x28')]({'from':util['format'](_0x17c2('0x29'),_0x1b69f2['name'],_0x1b69f2['email']||_0x1b69f2[_0x17c2('0x22')]['user'])},_0x45a3b0)};return client[_0x17c2('0x2a')](_0x17c2('0x2b'),_0x2da177);})['then'](function(_0x3a8579){if(_0x3a8579[_0x17c2('0x2c')]){throw new Error(util[_0x17c2('0x2d')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x3a8579[_0x17c2('0x2c')][_0x17c2('0x2e')]||JSON['stringify'](_0x3a8579[_0x17c2('0x2c')])));}return!![];});}function handleError(_0x510549,_0x5eb2f4,_0x48b98a){return _0x510549['status'](_0x5eb2f4||0x1f4)[_0x17c2('0x2f')]({'message':_0x48b98a?_0x48b98a[_0x17c2('0x2e')]||_0x48b98a:''});}exports[_0x17c2('0x30')]=function(_0x5a4335,_0x1658ec,_0x48e793){passport[_0x17c2('0x16')](_0x17c2('0x31'),function(_0x2b5a70,_0xd1c3f3,_0x2579ff){var _0x45511c=_0x2b5a70||_0x2579ff;if(_0x45511c){return handleError(_0x1658ec,0x191,_0x45511c);}if(!_0xd1c3f3){return handleError(_0x1658ec,0x194,{'message':_0x17c2('0x32')});}else{var _0x4f3e3b={'payload':{'id':_0xd1c3f3['id'],'role':_0xd1c3f3['role']},'options':{'expiresIn':0x15180}};return authService[_0x17c2('0x33')](_0x4f3e3b)[_0x17c2('0xd')](function(_0x3ae4ee){_0x1658ec[_0x17c2('0x34')]({'id':_0xd1c3f3['id'],'token':_0x3ae4ee,'statusCall':'','isAlreadyLogged':_0xd1c3f3['online']});});}})(_0x5a4335,_0x1658ec,_0x48e793);};exports['forgot']=function(_0x536810,_0x177589,_0x1927ab){if(!_0x536810[_0x17c2('0x35')][_0x17c2('0x20')]){return handleError(_0x177589,0x1f4,{'message':_0x17c2('0x36')});}var _0x2ec791=rs['generate']();_0x536810['body'][_0x17c2('0x20')]=_0x536810['body']['email'][_0x17c2('0x37')]()[_0x17c2('0x38')]();var _0x52b551;return db[_0x17c2('0xa')][_0x17c2('0xb')]({'where':{'id':0x1},'attributes':[_0x17c2('0xc'),'blockDuration'],'raw':!![]})[_0x17c2('0xd')](function(_0x43de45){_0x52b551=_0x43de45;return db[_0x17c2('0x39')]['find']({'where':{'email':_0x536810['body'][_0x17c2('0x20')]}});})[_0x17c2('0xd')](function(_0x541a64){if(!_0x541a64){throw new Error(_0x17c2('0x3a'));}if(_0x541a64[_0x17c2('0x11')]){throw new Error(_0x17c2('0x3b'));}if(_0x541a64[_0x17c2('0x17')]){if(moment(_0x541a64[_0x17c2('0x19')])[_0x17c2('0x1c')](_0x52b551[_0x17c2('0x18')],_0x17c2('0x1a'))>moment()){throw new Error(_0x17c2('0x3c'));}else{_0x541a64[_0x17c2('0x17')]=![];_0x541a64[_0x17c2('0x19')]=null;}}_0x541a64[_0x17c2('0x3d')]=_0x2ec791;_0x541a64[_0x17c2('0x3e')]=Date['now']()+0x36ee80;return _0x541a64['save']();})[_0x17c2('0xd')](function(){return sendServiceMail({'to':_0x536810[_0x17c2('0x35')]['email'],'subject':_0x17c2('0x3f'),'text':_0x17c2('0x40')+_0x17c2('0x41')+_0x17c2('0x42')+_0x536810[_0x17c2('0x43')][_0x17c2('0x25')]+'/reset/'+_0x2ec791+'\x0a\x0a'+_0x17c2('0x44')});})['then'](function(){_0x177589[_0x17c2('0x45')](0xc8)['send']({'message':'Reset\x20Email\x20sent!'});})[_0x17c2('0x1e')](function(_0x20a83c){return handleError(_0x177589,0x1f4,_0x20a83c);});};exports['reset']=function(_0x455524,_0x4c58f2,_0x562b93){return db[_0x17c2('0x39')][_0x17c2('0x1f')]({'where':{'resetPasswordToken':_0x455524[_0x17c2('0x46')][_0x17c2('0x47')],'resetPasswordExpires':{'$gt':Date[_0x17c2('0x48')]()}}})[_0x17c2('0xd')](function(_0x1ca76d){if(!_0x1ca76d){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db[_0x17c2('0xa')]['findOne']({'attributes':['id',_0x17c2('0x49'),_0x17c2('0x4a'),_0x17c2('0x4b')]})[_0x17c2('0xd')](function(_0x36b101){if(_0x36b101['securePassword'])authService[_0x17c2('0x4c')](_0x455524['body'][_0x17c2('0x4d')]);if(!_0x36b101['enforcePasswordHistory']||!_0x1ca76d[_0x17c2('0x4e')])return _0x1ca76d;authService['validatePasswordHistory'](_0x455524[_0x17c2('0x35')]['password'],_0x1ca76d['previousPasswords'],_0x36b101['passwordHistoryLimit']);return _0x1ca76d;})[_0x17c2('0xd')](function(){_0x1ca76d['password']=_0x455524[_0x17c2('0x35')][_0x17c2('0x4d')];_0x1ca76d['resetPasswordToken']=null;_0x1ca76d[_0x17c2('0x3e')]=null;return _0x1ca76d['save']();});})['then'](function(){_0x4c58f2[_0x17c2('0x45')](0xc8)[_0x17c2('0x2f')]({'message':'Password\x20reset!'});})[_0x17c2('0x1e')](function(_0x2bbeb3){return handleError(_0x4c58f2,0x1f4,_0x2bbeb3);});};passport['use'](new LocalStrategy({'usernameField':_0x17c2('0xe'),'passwordField':_0x17c2('0x4d')},function(_0x58946e,_0x195453,_0x5f2b50){return localAuthenticate(db[_0x17c2('0x39')],_0x58946e,_0x195453,_0x5f2b50);})); \ No newline at end of file +var _0x20c6=['add','getLicense','MailAccount','find','email','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','authentication','format','\x22%s\x22\x20<%s>','request','SendMail','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','error','message','stringify','status','send','login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','forgot','generate','body','trim','Setting','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordExpires','save','xCally\x20Motion\x20Password\x20Reset','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','catch','params','token','now','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','validatePasswordPattern','previousPasswords','validatePasswordHistory','passwordHistoryLimit','resetPasswordToken','Password\x20reset!','use','util','passport','passport-local','Strategy','jayson/promise','lodash','../../mysqldb','../../components/auth/service','../../config/utils','http','findOne','allowedLoginAttempts','blockDuration','then','name','password','role','disabled','blocked','loginAttempts','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','minutes','clearBlockUser','blockedAt'];(function(_0x39304b,_0x30a033){var _0x21160c=function(_0x3b51a9){while(--_0x3b51a9){_0x39304b['push'](_0x39304b['shift']());}};_0x21160c(++_0x30a033);}(_0x20c6,0x1e8));var _0x620c=function(_0x2a0755,_0xdf6bac){_0x2a0755=_0x2a0755-0x0;var _0x3eaf4f=_0x20c6[_0x2a0755];return _0x3eaf4f;};'use strict';var util=require(_0x620c('0x0'));var passport=require(_0x620c('0x1'));var LocalStrategy=require(_0x620c('0x2'))[_0x620c('0x3')];var jayson=require(_0x620c('0x4'));var _=require(_0x620c('0x5'));var rs=require('randomstring');var moment=require('moment');var db=require(_0x620c('0x6'))['db'];var authService=require(_0x620c('0x7'));var utils=require(_0x620c('0x8'));var client=jayson['client'][_0x620c('0x9')]({'port':0x232b});function localAuthenticate(_0x4374d7,_0x329af4,_0x3e1d09,_0x449e83){var _0x4c9ec1,_0x49fa3f;return db['Setting'][_0x620c('0xa')]({'where':{'id':0x1},'attributes':[_0x620c('0xb'),_0x620c('0xc')],'raw':!![]})[_0x620c('0xd')](function(_0x4db776){_0x4c9ec1=_0x4db776;return _0x4374d7[_0x620c('0xa')]({'attributes':['id',_0x620c('0xe'),_0x620c('0xf'),'salt',_0x620c('0x10'),_0x620c('0x11'),_0x620c('0x12'),'blockedAt',_0x620c('0x13')],'where':{'name':_0x329af4,'role':{'$or':[_0x620c('0x14'),_0x620c('0x15'),_0x620c('0x16')]}}});})[_0x620c('0xd')](function(_0x50e618){if(!_0x50e618||_0x50e618&&_0x50e618[_0x620c('0xe')]!==_0x329af4){throw new Error(_0x620c('0x17'));}else{_0x49fa3f=_0x50e618;return _0x49fa3f;}})[_0x620c('0xd')](function(){_0x49fa3f[_0x620c('0x18')](_0x3e1d09,function(_0x258102,_0x332ee4){var _0x1c61d0=_0x49fa3f[_0x620c('0x13')]+0x1;if(_0x258102){return _0x449e83(_0x258102);}else if(!_0x332ee4){if(_0x49fa3f[_0x620c('0x11')]){return _0x449e83(null,![],{'message':_0x620c('0x17')});}else if(_0x4c9ec1[_0x620c('0xb')]>0x0){if(_0x49fa3f['blocked']){if(_0x4c9ec1[_0x620c('0xc')]>0x0){if(moment(_0x49fa3f['blockedAt'])['add'](_0x4c9ec1['blockDuration'],_0x620c('0x19'))>moment()){return _0x449e83(null,![],{'message':_0x620c('0x17')});}else{return utils[_0x620c('0x1a')](_0x49fa3f,_0x1c61d0,![],null)[_0x620c('0xd')](function(){return _0x449e83(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x449e83(null,![],{'message':_0x620c('0x17')});}}else{if(_0x1c61d0>=_0x4c9ec1['allowedLoginAttempts']){return utils[_0x620c('0x1a')](_0x49fa3f,0x0,!![],moment())['then'](function(){return _0x449e83(null,![],{'message':_0x620c('0x17')});});}else{return utils['clearBlockUser'](_0x49fa3f,_0x1c61d0,![],null)[_0x620c('0xd')](function(){return _0x449e83(null,![],{'message':_0x620c('0x17')});});}}}else{return _0x449e83(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x49fa3f['disabled']){return _0x449e83(null,![],{'message':_0x620c('0x17')});}else if(_0x4c9ec1['allowedLoginAttempts']>0x0){if(_0x49fa3f[_0x620c('0x12')]){if(_0x4c9ec1[_0x620c('0xc')]>0x0){if(moment(_0x49fa3f[_0x620c('0x1b')])[_0x620c('0x1c')](_0x4c9ec1[_0x620c('0xc')],_0x620c('0x19'))>moment()){return _0x449e83(null,![],{'message':_0x620c('0x17')});}else{return utils[_0x620c('0x1a')](_0x49fa3f,0x0,![],null)['then'](function(){return utils[_0x620c('0x1d')](_0x49fa3f);})['then'](function(){return _0x449e83(null,_0x49fa3f);});}}else{return _0x449e83(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils[_0x620c('0x1a')](_0x49fa3f,0x0,![],null)[_0x620c('0xd')](function(){return utils[_0x620c('0x1d')](_0x49fa3f);})[_0x620c('0xd')](function(){return _0x449e83(null,_0x49fa3f);})['catch'](function(_0x492ea9){return _0x449e83(null,![],_0x492ea9);});}}else{if(_0x49fa3f[_0x620c('0x12')]){return _0x449e83(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x620c('0x1d')](_0x49fa3f)['then'](function(){return _0x449e83(null,_0x49fa3f);});}}}});})['catch'](function(_0x12694f){return _0x449e83(null,![],_0x12694f);});}function sendServiceMail(_0x66d78){return db[_0x620c('0x1e')][_0x620c('0x1f')]({'where':{'service':!![]},'attributes':['id',_0x620c('0xe'),_0x620c('0x20')],'include':[{'model':db['MailServerOut'],'as':_0x620c('0x21')}]})['then'](function(_0x4bc363){if(!_0x4bc363){throw new Error(_0x620c('0x22'));}var _0x51d49d={'tls':{'rejectUnauthorized':![]}};if(_0x4bc363[_0x620c('0x21')][_0x620c('0x23')]){_0x51d49d[_0x620c('0x23')]=_0x4bc363['Smtp'][_0x620c('0x23')];}else{_0x51d49d[_0x620c('0x24')]=_0x4bc363[_0x620c('0x21')][_0x620c('0x24')];_0x51d49d[_0x620c('0x25')]=_0x4bc363[_0x620c('0x21')][_0x620c('0x25')];_0x51d49d[_0x620c('0x26')]=_0x4bc363[_0x620c('0x21')][_0x620c('0x26')];}if(_0x4bc363[_0x620c('0x21')][_0x620c('0x27')]){_0x51d49d['auth']={'user':_0x4bc363[_0x620c('0x21')][_0x620c('0x15')],'pass':_0x4bc363['Smtp']['pass']};}var _0x2e4368={'account':_0x51d49d,'message':_['merge']({'from':util[_0x620c('0x28')](_0x620c('0x29'),_0x4bc363['name'],_0x4bc363['email']||_0x4bc363[_0x620c('0x21')]['user'])},_0x66d78)};return client[_0x620c('0x2a')](_0x620c('0x2b'),_0x2e4368);})[_0x620c('0xd')](function(_0x4e236b){if(_0x4e236b['error']){throw new Error(util[_0x620c('0x28')](_0x620c('0x2c'),_0x4e236b[_0x620c('0x2d')][_0x620c('0x2e')]||JSON[_0x620c('0x2f')](_0x4e236b[_0x620c('0x2d')])));}return!![];});}function handleError(_0xf76cb3,_0x4628e1,_0x4fa1aa){return _0xf76cb3[_0x620c('0x30')](_0x4628e1||0x1f4)[_0x620c('0x31')]({'message':_0x4fa1aa?_0x4fa1aa['message']||_0x4fa1aa:''});}exports[_0x620c('0x32')]=function(_0x696c7c,_0x47e76a,_0x82b8b6){passport[_0x620c('0x18')]('local',function(_0x240040,_0x4615f2,_0x58f5ae){var _0x548bfc=_0x240040||_0x58f5ae;if(_0x548bfc){return handleError(_0x47e76a,0x191,_0x548bfc);}if(!_0x4615f2){return handleError(_0x47e76a,0x194,{'message':_0x620c('0x33')});}else{var _0x2913c7={'payload':{'id':_0x4615f2['id'],'role':_0x4615f2[_0x620c('0x10')]},'options':{'expiresIn':0x15180}};return authService[_0x620c('0x34')](_0x2913c7)['then'](function(_0xc02096){_0x47e76a[_0x620c('0x35')]({'id':_0x4615f2['id'],'token':_0xc02096,'statusCall':'','isAlreadyLogged':_0x4615f2[_0x620c('0x36')]});});}})(_0x696c7c,_0x47e76a,_0x82b8b6);};exports[_0x620c('0x37')]=function(_0x208f83,_0x6041b0,_0x5ea523){if(!_0x208f83['body'][_0x620c('0x20')]){return handleError(_0x6041b0,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x5b8b52=rs[_0x620c('0x38')]();_0x208f83['body'][_0x620c('0x20')]=_0x208f83[_0x620c('0x39')][_0x620c('0x20')][_0x620c('0x3a')]()['toLowerCase']();var _0x7bebd2;return db[_0x620c('0x3b')]['findOne']({'where':{'id':0x1},'attributes':[_0x620c('0xb'),_0x620c('0xc')],'raw':!![]})[_0x620c('0xd')](function(_0x197b7d){_0x7bebd2=_0x197b7d;return db[_0x620c('0x3c')][_0x620c('0x1f')]({'where':{'email':_0x208f83[_0x620c('0x39')][_0x620c('0x20')]}});})[_0x620c('0xd')](function(_0x3f0c1e){if(!_0x3f0c1e){throw new Error(_0x620c('0x3d'));}if(_0x3f0c1e[_0x620c('0x11')]){throw new Error(_0x620c('0x3e'));}if(_0x3f0c1e['blocked']){if(moment(_0x3f0c1e['blockedAt'])[_0x620c('0x1c')](_0x7bebd2[_0x620c('0xc')],_0x620c('0x19'))>moment()){throw new Error(_0x620c('0x3f'));}else{_0x3f0c1e[_0x620c('0x12')]=![];_0x3f0c1e[_0x620c('0x1b')]=null;}}_0x3f0c1e['resetPasswordToken']=_0x5b8b52;_0x3f0c1e[_0x620c('0x40')]=Date['now']()+0x36ee80;return _0x3f0c1e[_0x620c('0x41')]();})[_0x620c('0xd')](function(){return sendServiceMail({'to':_0x208f83[_0x620c('0x39')]['email'],'subject':_0x620c('0x42'),'text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+_0x620c('0x43')+_0x620c('0x44')+_0x208f83[_0x620c('0x45')][_0x620c('0x24')]+_0x620c('0x46')+_0x5b8b52+'\x0a\x0a'+_0x620c('0x47')});})[_0x620c('0xd')](function(){_0x6041b0[_0x620c('0x30')](0xc8)[_0x620c('0x31')]({'message':'Reset\x20Email\x20sent!'});})[_0x620c('0x48')](function(_0x2daf3b){return handleError(_0x6041b0,0x1f4,_0x2daf3b);});};exports['reset']=function(_0x33e9cc,_0x118460,_0x105879){return db[_0x620c('0x3c')][_0x620c('0x1f')]({'where':{'resetPasswordToken':_0x33e9cc[_0x620c('0x49')][_0x620c('0x4a')],'resetPasswordExpires':{'$gt':Date[_0x620c('0x4b')]()}}})[_0x620c('0xd')](function(_0x48e515){if(!_0x48e515){throw new Error(_0x620c('0x4c'));}return db[_0x620c('0x3b')][_0x620c('0xa')]({'attributes':['id',_0x620c('0x4d'),_0x620c('0x4e'),'passwordHistoryLimit']})[_0x620c('0xd')](function(_0x2b98db){if(_0x2b98db[_0x620c('0x4d')])authService[_0x620c('0x4f')](_0x33e9cc['body']['password']);if(!_0x2b98db[_0x620c('0x4e')]||!_0x48e515[_0x620c('0x50')])return _0x48e515;authService[_0x620c('0x51')](_0x33e9cc[_0x620c('0x39')]['password'],_0x48e515[_0x620c('0x50')],_0x2b98db[_0x620c('0x52')]);return _0x48e515;})['then'](function(){_0x48e515[_0x620c('0xf')]=_0x33e9cc[_0x620c('0x39')][_0x620c('0xf')];_0x48e515[_0x620c('0x53')]=null;_0x48e515[_0x620c('0x40')]=null;return _0x48e515[_0x620c('0x41')]();});})[_0x620c('0xd')](function(){_0x118460[_0x620c('0x30')](0xc8)[_0x620c('0x31')]({'message':_0x620c('0x54')});})[_0x620c('0x48')](function(_0x5ce8cf){return handleError(_0x118460,0x1f4,_0x5ce8cf);});};passport[_0x620c('0x55')](new LocalStrategy({'usernameField':'name','passwordField':_0x620c('0xf')},function(_0x11fc0f,_0x3417c4,_0x58d2ea){return localAuthenticate(db['User'],_0x11fc0f,_0x3417c4,_0x58d2ea);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index 9b6fdc0..81bb770 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 _0x6302=['post','/forgot','forgot','reset','exports','express','Router','./authLocal.controller','login'];(function(_0x1fe113,_0x5ed48a){var _0x36b894=function(_0x344737){while(--_0x344737){_0x1fe113['push'](_0x1fe113['shift']());}};_0x36b894(++_0x5ed48a);}(_0x6302,0x1b5));var _0x2630=function(_0x3b5f61,_0x37a454){_0x3b5f61=_0x3b5f61-0x0;var _0x5f0f20=_0x6302[_0x3b5f61];return _0x5f0f20;};'use strict';var express=require(_0x2630('0x0'));var router=express[_0x2630('0x1')]();var controller=require(_0x2630('0x2'));router['post']('/',controller[_0x2630('0x3')]);router[_0x2630('0x4')](_0x2630('0x5'),controller[_0x2630('0x6')]);router[_0x2630('0x4')]('/reset/:token',controller[_0x2630('0x7')]);module[_0x2630('0x8')]=router; \ No newline at end of file +var _0x4ea4=['post','login','/forgot','/reset/:token','reset','exports','express','Router','./authLocal.controller'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0x4ea4,0x141));var _0x44ea=function(_0x561d9f,_0x447dea){_0x561d9f=_0x561d9f-0x0;var _0x4ecca0=_0x4ea4[_0x561d9f];return _0x4ecca0;};'use strict';var express=require(_0x44ea('0x0'));var router=express[_0x44ea('0x1')]();var controller=require(_0x44ea('0x2'));router[_0x44ea('0x3')]('/',controller[_0x44ea('0x4')]);router[_0x44ea('0x3')](_0x44ea('0x5'),controller['forgot']);router[_0x44ea('0x3')](_0x44ea('0x6'),controller[_0x44ea('0x7')]);module[_0x44ea('0x8')]=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index 0f6fb96..7468e4d 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 _0xb45c=['BOOLEAN','INTEGER','sequelize','exports','STRING'];(function(_0x5aecb9,_0x431f00){var _0x2bac52=function(_0x44076f){while(--_0x44076f){_0x5aecb9['push'](_0x5aecb9['shift']());}};_0x2bac52(++_0x431f00);}(_0xb45c,0xa7));var _0xcb45=function(_0x4ba347,_0x3eea2f){_0x4ba347=_0x4ba347-0x0;var _0x1022f2=_0xb45c[_0x4ba347];return _0x1022f2;};'use strict';var Sequelize=require(_0xcb45('0x0'));module[_0xcb45('0x1')]={'name':{'type':Sequelize[_0xcb45('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0xcb45('0x2')]},'description':{'type':Sequelize[_0xcb45('0x2')]},'status':{'type':Sequelize[_0xcb45('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0xcb45('0x4')],'defaultValue':0xa}}; \ No newline at end of file +var _0x3c92=['exports','STRING'];(function(_0x5b7a83,_0x37f3b1){var _0x1dec84=function(_0x58d9cf){while(--_0x58d9cf){_0x5b7a83['push'](_0x5b7a83['shift']());}};_0x1dec84(++_0x37f3b1);}(_0x3c92,0x158));var _0x23c9=function(_0x5e87ad,_0x4ec349){_0x5e87ad=_0x5e87ad-0x0;var _0x646a8b=_0x3c92[_0x5e87ad];return _0x646a8b;};'use strict';var Sequelize=require('sequelize');module[_0x23c9('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize[_0x23c9('0x1')]},'description':{'type':Sequelize[_0x23c9('0x1')]},'status':{'type':Sequelize['BOOLEAN'],'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 e0e45f4..268ed60 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 _0xce85=['querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','update','then','destroy','end','error','stack','name','send','map','Automation','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','sort','filters','pick','filter','where','merge','VIRTUAL','include','findAll','rows','show','params','rawAttributes','keys','includeAll','options','find','body','catch','addConditions','Condition','ids','omit','getConditions','findOne','addActions','Action','order','getActions','nolimit','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','fs-extra','jsforce','desk.js','to-csv'];(function(_0x3a1953,_0x440442){var _0x51c757=function(_0x7846eb){while(--_0x7846eb){_0x3a1953['push'](_0x3a1953['shift']());}};_0x51c757(++_0x440442);}(_0xce85,0x1c3));var _0x5ce8=function(_0x32cbf0,_0x47b073){_0x32cbf0=_0x32cbf0-0x0;var _0x332b2e=_0xce85[_0x32cbf0];return _0x332b2e;};'use strict';var emlformat=require(_0x5ce8('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5ce8('0x1'));var rp=require(_0x5ce8('0x2'));var moment=require(_0x5ce8('0x3'));var BPromise=require(_0x5ce8('0x4'));var Mustache=require(_0x5ce8('0x5'));var util=require(_0x5ce8('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(_0x5ce8('0x7'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x5ce8('0x8'));var deskjs=require(_0x5ce8('0x9'));var toCsv=require(_0x5ce8('0xa'));var querystring=require(_0x5ce8('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x5ce8('0xc'));var as=require(_0x5ce8('0xd'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5ce8('0xe'))(_0x5ce8('0xf'));var utils=require(_0x5ce8('0x10'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x5ce8('0x11'))['db'];function respondWithStatusCode(_0x97537e,_0x127125){_0x127125=_0x127125||0xcc;return function(_0x125e0b){if(_0x125e0b){return _0x97537e[_0x5ce8('0x12')](_0x127125);}return _0x97537e[_0x5ce8('0x13')](_0x127125)['end']();};}function respondWithResult(_0x428187,_0x1dc733){_0x1dc733=_0x1dc733||0xc8;return function(_0x454a27){if(_0x454a27){return _0x428187[_0x5ce8('0x13')](_0x1dc733)[_0x5ce8('0x14')](_0x454a27);}};}function respondWithFilteredResult(_0x1fe1f0,_0x16c250){return function(_0x1bcf35){if(_0x1bcf35){var _0x28c626=typeof _0x16c250[_0x5ce8('0x15')]===_0x5ce8('0x16')&&typeof _0x16c250[_0x5ce8('0x17')]===_0x5ce8('0x16');var _0x5f2c82=_0x1bcf35[_0x5ce8('0x18')];var _0xbeff59=_0x28c626?0x0:_0x16c250[_0x5ce8('0x15')];var _0x57f81f=_0x28c626?_0x1bcf35[_0x5ce8('0x18')]:_0x16c250[_0x5ce8('0x15')]+_0x16c250['limit'];var _0x13d24b;if(_0x57f81f>=_0x5f2c82){_0x57f81f=_0x5f2c82;_0x13d24b=0xc8;}else{_0x13d24b=0xce;}_0x1fe1f0[_0x5ce8('0x13')](_0x13d24b);return _0x1fe1f0[_0x5ce8('0x19')]('Content-Range',_0xbeff59+'-'+_0x57f81f+'/'+_0x5f2c82)[_0x5ce8('0x14')](_0x1bcf35);}return null;};}function patchUpdates(_0x236bce){return function(_0x35311d){try{jsonpatch[_0x5ce8('0x1a')](_0x35311d,_0x236bce,!![]);}catch(_0x3ea589){return BPromise['reject'](_0x3ea589);}return _0x35311d['save']();};}function saveUpdates(_0x7f5be2,_0x38be8f){return function(_0x1bfa4e){if(_0x1bfa4e){return _0x1bfa4e[_0x5ce8('0x1b')](_0x7f5be2)[_0x5ce8('0x1c')](function(_0x233e06){return _0x233e06;});}return null;};}function removeEntity(_0xbe6061,_0x43f009){return function(_0x16c2d9){if(_0x16c2d9){return _0x16c2d9[_0x5ce8('0x1d')]()[_0x5ce8('0x1c')](function(){_0xbe6061['status'](0xcc)[_0x5ce8('0x1e')]();});}};}function handleEntityNotFound(_0x2b12fb,_0x282dba){return function(_0x5d66ed){if(!_0x5d66ed){_0x2b12fb['sendStatus'](0x194);}return _0x5d66ed;};}function handleError(_0x5e3912,_0x128e13){_0x128e13=_0x128e13||0x1f4;return function(_0x138aec){logger[_0x5ce8('0x1f')](_0x138aec[_0x5ce8('0x20')]);if(_0x138aec[_0x5ce8('0x21')]){delete _0x138aec['name'];}_0x5e3912[_0x5ce8('0x13')](_0x128e13)[_0x5ce8('0x22')](_0x138aec);};}exports['index']=function(_0x5272e8,_0x1cfef2){var _0x3a5e01={},_0x5b2546={},_0x5a30de={'count':0x0,'rows':[]};var _0x2e8595=_[_0x5ce8('0x23')](db[_0x5ce8('0x24')]['rawAttributes'],function(_0x220adf){return{'name':_0x220adf[_0x5ce8('0x25')],'type':_0x220adf[_0x5ce8('0x26')][_0x5ce8('0x27')]};});_0x5b2546[_0x5ce8('0x28')]=_[_0x5ce8('0x23')](_0x2e8595,'name');_0x5b2546[_0x5ce8('0x29')]=_['keys'](_0x5272e8['query']);_0x5b2546['filters']=_[_0x5ce8('0x2a')](_0x5b2546[_0x5ce8('0x28')],_0x5b2546[_0x5ce8('0x29')]);_0x3a5e01[_0x5ce8('0x2b')]=_['intersection'](_0x5b2546['model'],qs['fields'](_0x5272e8[_0x5ce8('0x29')][_0x5ce8('0x2c')]));_0x3a5e01[_0x5ce8('0x2b')]=_0x3a5e01[_0x5ce8('0x2b')][_0x5ce8('0x2d')]?_0x3a5e01[_0x5ce8('0x2b')]:_0x5b2546[_0x5ce8('0x28')];if(!_0x5272e8[_0x5ce8('0x29')][_0x5ce8('0x2e')]('nolimit')){_0x3a5e01[_0x5ce8('0x17')]=qs[_0x5ce8('0x17')](_0x5272e8['query'][_0x5ce8('0x17')]);_0x3a5e01[_0x5ce8('0x15')]=qs['offset'](_0x5272e8[_0x5ce8('0x29')][_0x5ce8('0x15')]);}_0x3a5e01['order']=qs[_0x5ce8('0x2f')](_0x5272e8[_0x5ce8('0x29')][_0x5ce8('0x2f')]);_0x3a5e01['where']=qs[_0x5ce8('0x30')](_[_0x5ce8('0x31')](_0x5272e8[_0x5ce8('0x29')],_0x5b2546['filters']),_0x2e8595);if(_0x5272e8[_0x5ce8('0x29')][_0x5ce8('0x32')]){_0x3a5e01[_0x5ce8('0x33')]=_[_0x5ce8('0x34')](_0x3a5e01['where'],{'$or':_[_0x5ce8('0x23')](_0x2e8595,function(_0x1359c0){if(_0x1359c0[_0x5ce8('0x26')]!==_0x5ce8('0x35')){var _0x141f85={};_0x141f85[_0x1359c0[_0x5ce8('0x21')]]={'$like':'%'+_0x5272e8[_0x5ce8('0x29')][_0x5ce8('0x32')]+'%'};return _0x141f85;}})});}_0x3a5e01=_[_0x5ce8('0x34')]({},_0x3a5e01,_0x5272e8['options']);var _0x5a67b3={'where':_0x3a5e01[_0x5ce8('0x33')]};return db[_0x5ce8('0x24')]['count'](_0x5a67b3)[_0x5ce8('0x1c')](function(_0x1d1a09){_0x5a30de['count']=_0x1d1a09;if(_0x5272e8[_0x5ce8('0x29')]['includeAll']){_0x3a5e01[_0x5ce8('0x36')]=[{'all':!![]}];}return db[_0x5ce8('0x24')][_0x5ce8('0x37')](_0x3a5e01);})[_0x5ce8('0x1c')](function(_0x2e0661){_0x5a30de[_0x5ce8('0x38')]=_0x2e0661;return _0x5a30de;})[_0x5ce8('0x1c')](respondWithFilteredResult(_0x1cfef2,_0x3a5e01))['catch'](handleError(_0x1cfef2,null));};exports[_0x5ce8('0x39')]=function(_0x40ddda,_0x53e785){var _0x21540c={'raw':![],'where':{'id':_0x40ddda[_0x5ce8('0x3a')]['id']}},_0x39ee64={};_0x39ee64[_0x5ce8('0x28')]=_['keys'](db[_0x5ce8('0x24')][_0x5ce8('0x3b')]);_0x39ee64[_0x5ce8('0x29')]=_[_0x5ce8('0x3c')](_0x40ddda[_0x5ce8('0x29')]);_0x39ee64['filters']=_[_0x5ce8('0x2a')](_0x39ee64[_0x5ce8('0x28')],_0x39ee64[_0x5ce8('0x29')]);_0x21540c['attributes']=_[_0x5ce8('0x2a')](_0x39ee64[_0x5ce8('0x28')],qs[_0x5ce8('0x2c')](_0x40ddda['query'][_0x5ce8('0x2c')]));_0x21540c['attributes']=_0x21540c[_0x5ce8('0x2b')][_0x5ce8('0x2d')]?_0x21540c[_0x5ce8('0x2b')]:_0x39ee64['model'];if(_0x40ddda[_0x5ce8('0x29')][_0x5ce8('0x3d')]){_0x21540c['include']=[{'all':!![]}];}_0x21540c=_[_0x5ce8('0x34')]({},_0x21540c,_0x40ddda[_0x5ce8('0x3e')]);return db[_0x5ce8('0x24')][_0x5ce8('0x3f')](_0x21540c)[_0x5ce8('0x1c')](handleEntityNotFound(_0x53e785,null))[_0x5ce8('0x1c')](respondWithResult(_0x53e785,null))['catch'](handleError(_0x53e785,null));};exports['create']=function(_0x301df7,_0x5f37c3){return db[_0x5ce8('0x24')]['create'](_0x301df7[_0x5ce8('0x40')],{})[_0x5ce8('0x1c')](respondWithResult(_0x5f37c3,0xc9))[_0x5ce8('0x41')](handleError(_0x5f37c3,null));};exports['update']=function(_0x134ea4,_0x2af7f1){if(_0x134ea4[_0x5ce8('0x40')]['id']){delete _0x134ea4['body']['id'];}return db[_0x5ce8('0x24')][_0x5ce8('0x3f')]({'where':{'id':_0x134ea4[_0x5ce8('0x3a')]['id']}})[_0x5ce8('0x1c')](handleEntityNotFound(_0x2af7f1,null))['then'](saveUpdates(_0x134ea4['body'],null))[_0x5ce8('0x1c')](respondWithResult(_0x2af7f1,null))[_0x5ce8('0x41')](handleError(_0x2af7f1,null));};exports[_0x5ce8('0x1d')]=function(_0x18e3c5,_0x1d4f19){return db[_0x5ce8('0x24')][_0x5ce8('0x3f')]({'where':{'id':_0x18e3c5['params']['id']}})[_0x5ce8('0x1c')](handleEntityNotFound(_0x1d4f19,null))[_0x5ce8('0x1c')](removeEntity(_0x1d4f19,null))[_0x5ce8('0x41')](handleError(_0x1d4f19,null));};exports[_0x5ce8('0x42')]=function(_0x4a6066,_0x396d3f,_0x430132){return db[_0x5ce8('0x43')][_0x5ce8('0x3f')]({'where':{'id':_0x4a6066[_0x5ce8('0x3a')]['id']}})[_0x5ce8('0x1c')](handleEntityNotFound(_0x396d3f,null))[_0x5ce8('0x1c')](function(_0x3e74b1){if(_0x3e74b1){return _0x3e74b1['addConditions'](_0x4a6066['body'][_0x5ce8('0x44')],_[_0x5ce8('0x45')](_0x4a6066[_0x5ce8('0x40')],[_0x5ce8('0x44'),'id'])||{});}})[_0x5ce8('0x1c')](respondWithResult(_0x396d3f,null))[_0x5ce8('0x41')](handleError(_0x396d3f,null));};exports[_0x5ce8('0x46')]=function(_0x5d5394,_0x2e0bc5,_0x3cfa61){var _0x4ef8be={};var _0x4d04de={};var _0x400e41;var _0x4a65e8;return db[_0x5ce8('0x24')][_0x5ce8('0x47')]({'where':{'id':_0x5d5394[_0x5ce8('0x3a')]['id']}})[_0x5ce8('0x1c')](handleEntityNotFound(_0x2e0bc5,null))[_0x5ce8('0x1c')](function(_0x476ce2){if(_0x476ce2){_0x400e41=_0x476ce2;_0x4d04de[_0x5ce8('0x28')]=_[_0x5ce8('0x3c')](db[_0x5ce8('0x43')][_0x5ce8('0x3b')]);_0x4d04de['query']=_[_0x5ce8('0x3c')](_0x5d5394['query']);_0x4d04de[_0x5ce8('0x30')]=_['intersection'](_0x4d04de[_0x5ce8('0x28')],_0x4d04de['query']);_0x4ef8be[_0x5ce8('0x2b')]=_['intersection'](_0x4d04de['model'],qs[_0x5ce8('0x2c')](_0x5d5394[_0x5ce8('0x29')]['fields']));_0x4ef8be[_0x5ce8('0x2b')]=_0x4ef8be[_0x5ce8('0x2b')][_0x5ce8('0x2d')]?_0x4ef8be[_0x5ce8('0x2b')]:_0x4d04de[_0x5ce8('0x28')];_0x4ef8be['order']=qs[_0x5ce8('0x2f')](_0x5d5394['query'][_0x5ce8('0x2f')]);_0x4ef8be['where']=qs['filters'](_[_0x5ce8('0x31')](_0x5d5394[_0x5ce8('0x29')],_0x4d04de[_0x5ce8('0x30')]));if(_0x5d5394['query'][_0x5ce8('0x32')]){_0x4ef8be['where']=_[_0x5ce8('0x34')](_0x4ef8be[_0x5ce8('0x33')],{'$or':_['map'](_0x4ef8be[_0x5ce8('0x2b')],function(_0x1b017c){var _0x544ef8={};_0x544ef8[_0x1b017c]={'$like':'%'+_0x5d5394[_0x5ce8('0x29')][_0x5ce8('0x32')]+'%'};return _0x544ef8;})});}_0x4ef8be=_['merge']({},_0x4ef8be,_0x5d5394[_0x5ce8('0x3e')]);return _0x400e41[_0x5ce8('0x46')](_0x4ef8be);}})[_0x5ce8('0x1c')](function(_0x4a23e0){if(_0x4a23e0){_0x4a65e8=_0x4a23e0[_0x5ce8('0x2d')];if(!_0x5d5394['query'][_0x5ce8('0x2e')]('nolimit')){_0x4ef8be[_0x5ce8('0x17')]=qs[_0x5ce8('0x17')](_0x5d5394[_0x5ce8('0x29')][_0x5ce8('0x17')]);_0x4ef8be[_0x5ce8('0x15')]=qs[_0x5ce8('0x15')](_0x5d5394['query']['offset']);}return _0x400e41[_0x5ce8('0x46')](_0x4ef8be);}})[_0x5ce8('0x1c')](function(_0x132963){if(_0x132963){return _0x132963?{'count':_0x4a65e8,'rows':_0x132963}:null;}})[_0x5ce8('0x1c')](respondWithResult(_0x2e0bc5,null))[_0x5ce8('0x41')](handleError(_0x2e0bc5,null));};exports[_0x5ce8('0x48')]=function(_0xf308b2,_0x205e33,_0x4af42b){return db[_0x5ce8('0x49')][_0x5ce8('0x3f')]({'where':{'id':_0xf308b2[_0x5ce8('0x3a')]['id']}})[_0x5ce8('0x1c')](handleEntityNotFound(_0x205e33,null))[_0x5ce8('0x1c')](function(_0x46d1a5){if(_0x46d1a5){return _0x46d1a5['addActions'](_0xf308b2['body']['ids'],_['omit'](_0xf308b2[_0x5ce8('0x40')],['ids','id'])||{});}})['then'](respondWithResult(_0x205e33,null))[_0x5ce8('0x41')](handleError(_0x205e33,null));};exports['getActions']=function(_0x3e9567,_0x4088c4,_0x5bca39){var _0x391da2={};var _0x2390b9={};var _0x3e0970;var _0x27b430;return db[_0x5ce8('0x24')][_0x5ce8('0x47')]({'where':{'id':_0x3e9567[_0x5ce8('0x3a')]['id']}})[_0x5ce8('0x1c')](handleEntityNotFound(_0x4088c4,null))['then'](function(_0x17ae09){if(_0x17ae09){_0x3e0970=_0x17ae09;_0x2390b9[_0x5ce8('0x28')]=_[_0x5ce8('0x3c')](db[_0x5ce8('0x49')][_0x5ce8('0x3b')]);_0x2390b9[_0x5ce8('0x29')]=_[_0x5ce8('0x3c')](_0x3e9567[_0x5ce8('0x29')]);_0x2390b9['filters']=_['intersection'](_0x2390b9[_0x5ce8('0x28')],_0x2390b9[_0x5ce8('0x29')]);_0x391da2[_0x5ce8('0x2b')]=_[_0x5ce8('0x2a')](_0x2390b9[_0x5ce8('0x28')],qs[_0x5ce8('0x2c')](_0x3e9567[_0x5ce8('0x29')][_0x5ce8('0x2c')]));_0x391da2['attributes']=_0x391da2['attributes'][_0x5ce8('0x2d')]?_0x391da2[_0x5ce8('0x2b')]:_0x2390b9[_0x5ce8('0x28')];_0x391da2[_0x5ce8('0x4a')]=qs['sort'](_0x3e9567[_0x5ce8('0x29')][_0x5ce8('0x2f')]);_0x391da2['where']=qs[_0x5ce8('0x30')](_[_0x5ce8('0x31')](_0x3e9567['query'],_0x2390b9[_0x5ce8('0x30')]));if(_0x3e9567['query']['filter']){_0x391da2[_0x5ce8('0x33')]=_[_0x5ce8('0x34')](_0x391da2[_0x5ce8('0x33')],{'$or':_['map'](_0x391da2[_0x5ce8('0x2b')],function(_0x61141f){var _0x45c130={};_0x45c130[_0x61141f]={'$like':'%'+_0x3e9567['query']['filter']+'%'};return _0x45c130;})});}_0x391da2=_[_0x5ce8('0x34')]({},_0x391da2,_0x3e9567[_0x5ce8('0x3e')]);return _0x3e0970[_0x5ce8('0x4b')](_0x391da2);}})[_0x5ce8('0x1c')](function(_0x169d27){if(_0x169d27){_0x27b430=_0x169d27[_0x5ce8('0x2d')];if(!_0x3e9567[_0x5ce8('0x29')][_0x5ce8('0x2e')](_0x5ce8('0x4c'))){_0x391da2[_0x5ce8('0x17')]=qs[_0x5ce8('0x17')](_0x3e9567[_0x5ce8('0x29')][_0x5ce8('0x17')]);_0x391da2[_0x5ce8('0x15')]=qs[_0x5ce8('0x15')](_0x3e9567['query']['offset']);}return _0x3e0970['getActions'](_0x391da2);}})[_0x5ce8('0x1c')](function(_0x1893dc){if(_0x1893dc){return _0x1893dc?{'count':_0x27b430,'rows':_0x1893dc}:null;}})[_0x5ce8('0x1c')](respondWithResult(_0x4088c4,null))['catch'](handleError(_0x4088c4,null));}; \ No newline at end of file +var _0x5326=['fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','undefined','count','offset','set','Content-Range','json','apply','reject','update','then','stack','name','send','index','map','Automation','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','limit','order','sort','pick','filter','where','merge','options','includeAll','include','findAll','rows','show','params','length','find','catch','create','body','destroy','addConditions','Condition','ids','omit','getConditions','findOne','nolimit','addActions','Action','getActions','eml-format','rimraf'];(function(_0x2d4434,_0x3ab433){var _0x1af75f=function(_0x4c0d9e){while(--_0x4c0d9e){_0x2d4434['push'](_0x2d4434['shift']());}};_0x1af75f(++_0x3ab433);}(_0x5326,0x198));var _0x6532=function(_0x231f6f,_0xf231e0){_0x231f6f=_0x231f6f-0x0;var _0xc621c4=_0x5326[_0x231f6f];return _0xc621c4;};'use strict';var emlformat=require(_0x6532('0x0'));var rimraf=require(_0x6532('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6532('0x2'));var rp=require(_0x6532('0x3'));var moment=require(_0x6532('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x6532('0x5'));var util=require('util');var path=require(_0x6532('0x6'));var sox=require(_0x6532('0x7'));var csv=require(_0x6532('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6532('0x9'));var squel=require(_0x6532('0xa'));var crypto=require(_0x6532('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x6532('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x6532('0xd'));var Redis=require(_0x6532('0xe'));var authService=require(_0x6532('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x6532('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6532('0x11'))('api');var utils=require(_0x6532('0x12'));var config=require(_0x6532('0x13'));var licenseUtil=require(_0x6532('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x9dbdf0,_0x4e1004){_0x4e1004=_0x4e1004||0xcc;return function(_0x2f8933){if(_0x2f8933){return _0x9dbdf0[_0x6532('0x15')](_0x4e1004);}return _0x9dbdf0[_0x6532('0x16')](_0x4e1004)[_0x6532('0x17')]();};}function respondWithResult(_0x28d50d,_0x4cee9c){_0x4cee9c=_0x4cee9c||0xc8;return function(_0xa075ed){if(_0xa075ed){return _0x28d50d[_0x6532('0x16')](_0x4cee9c)['json'](_0xa075ed);}};}function respondWithFilteredResult(_0x3ec8d5,_0x4d3655){return function(_0x4ed11a){if(_0x4ed11a){var _0x44282a=typeof _0x4d3655['offset']===_0x6532('0x18')&&typeof _0x4d3655['limit']===_0x6532('0x18');var _0x5c18ca=_0x4ed11a[_0x6532('0x19')];var _0x20afbc=_0x44282a?0x0:_0x4d3655['offset'];var _0x348615=_0x44282a?_0x4ed11a['count']:_0x4d3655[_0x6532('0x1a')]+_0x4d3655['limit'];var _0x3317d7;if(_0x348615>=_0x5c18ca){_0x348615=_0x5c18ca;_0x3317d7=0xc8;}else{_0x3317d7=0xce;}_0x3ec8d5['status'](_0x3317d7);return _0x3ec8d5[_0x6532('0x1b')](_0x6532('0x1c'),_0x20afbc+'-'+_0x348615+'/'+_0x5c18ca)[_0x6532('0x1d')](_0x4ed11a);}return null;};}function patchUpdates(_0x251226){return function(_0x3f24f9){try{jsonpatch[_0x6532('0x1e')](_0x3f24f9,_0x251226,!![]);}catch(_0x20ab49){return BPromise[_0x6532('0x1f')](_0x20ab49);}return _0x3f24f9['save']();};}function saveUpdates(_0x213203,_0x2e7032){return function(_0x3f01f8){if(_0x3f01f8){return _0x3f01f8[_0x6532('0x20')](_0x213203)[_0x6532('0x21')](function(_0x224001){return _0x224001;});}return null;};}function removeEntity(_0x29b4a1,_0x115ae2){return function(_0x26ca0a){if(_0x26ca0a){return _0x26ca0a['destroy']()[_0x6532('0x21')](function(){_0x29b4a1[_0x6532('0x16')](0xcc)[_0x6532('0x17')]();});}};}function handleEntityNotFound(_0x6cea75,_0x3b8381){return function(_0x2e0a39){if(!_0x2e0a39){_0x6cea75['sendStatus'](0x194);}return _0x2e0a39;};}function handleError(_0x92f4f8,_0x3dc7fd){_0x3dc7fd=_0x3dc7fd||0x1f4;return function(_0x5c57de){logger['error'](_0x5c57de[_0x6532('0x22')]);if(_0x5c57de[_0x6532('0x23')]){delete _0x5c57de[_0x6532('0x23')];}_0x92f4f8[_0x6532('0x16')](_0x3dc7fd)[_0x6532('0x24')](_0x5c57de);};}exports[_0x6532('0x25')]=function(_0x584558,_0x27814e){var _0x2e700a={},_0x39d83b={},_0x57ecb9={'count':0x0,'rows':[]};var _0x2bc71e=_[_0x6532('0x26')](db[_0x6532('0x27')][_0x6532('0x28')],function(_0x3d04d4){return{'name':_0x3d04d4[_0x6532('0x29')],'type':_0x3d04d4[_0x6532('0x2a')][_0x6532('0x2b')]};});_0x39d83b[_0x6532('0x2c')]=_[_0x6532('0x26')](_0x2bc71e,_0x6532('0x23'));_0x39d83b[_0x6532('0x2d')]=_[_0x6532('0x2e')](_0x584558[_0x6532('0x2d')]);_0x39d83b[_0x6532('0x2f')]=_[_0x6532('0x30')](_0x39d83b['model'],_0x39d83b[_0x6532('0x2d')]);_0x2e700a[_0x6532('0x31')]=_[_0x6532('0x30')](_0x39d83b[_0x6532('0x2c')],qs['fields'](_0x584558[_0x6532('0x2d')][_0x6532('0x32')]));_0x2e700a[_0x6532('0x31')]=_0x2e700a[_0x6532('0x31')]['length']?_0x2e700a['attributes']:_0x39d83b[_0x6532('0x2c')];if(!_0x584558[_0x6532('0x2d')][_0x6532('0x33')]('nolimit')){_0x2e700a['limit']=qs[_0x6532('0x34')](_0x584558[_0x6532('0x2d')][_0x6532('0x34')]);_0x2e700a[_0x6532('0x1a')]=qs['offset'](_0x584558['query'][_0x6532('0x1a')]);}_0x2e700a[_0x6532('0x35')]=qs[_0x6532('0x36')](_0x584558[_0x6532('0x2d')][_0x6532('0x36')]);_0x2e700a['where']=qs[_0x6532('0x2f')](_[_0x6532('0x37')](_0x584558['query'],_0x39d83b['filters']),_0x2bc71e);if(_0x584558[_0x6532('0x2d')][_0x6532('0x38')]){_0x2e700a[_0x6532('0x39')]=_['merge'](_0x2e700a[_0x6532('0x39')],{'$or':_[_0x6532('0x26')](_0x2bc71e,function(_0x15eae8){if(_0x15eae8['type']!=='VIRTUAL'){var _0x43b32f={};_0x43b32f[_0x15eae8['name']]={'$like':'%'+_0x584558['query'][_0x6532('0x38')]+'%'};return _0x43b32f;}})});}_0x2e700a=_[_0x6532('0x3a')]({},_0x2e700a,_0x584558[_0x6532('0x3b')]);var _0x4fb70b={'where':_0x2e700a[_0x6532('0x39')]};return db[_0x6532('0x27')][_0x6532('0x19')](_0x4fb70b)[_0x6532('0x21')](function(_0x49eee6){_0x57ecb9[_0x6532('0x19')]=_0x49eee6;if(_0x584558[_0x6532('0x2d')][_0x6532('0x3c')]){_0x2e700a[_0x6532('0x3d')]=[{'all':!![]}];}return db[_0x6532('0x27')][_0x6532('0x3e')](_0x2e700a);})[_0x6532('0x21')](function(_0x35d867){_0x57ecb9[_0x6532('0x3f')]=_0x35d867;return _0x57ecb9;})[_0x6532('0x21')](respondWithFilteredResult(_0x27814e,_0x2e700a))['catch'](handleError(_0x27814e,null));};exports[_0x6532('0x40')]=function(_0x5d6867,_0x398dde){var _0x325f50={'raw':![],'where':{'id':_0x5d6867[_0x6532('0x41')]['id']}},_0x31c580={};_0x31c580['model']=_['keys'](db[_0x6532('0x27')][_0x6532('0x28')]);_0x31c580[_0x6532('0x2d')]=_['keys'](_0x5d6867['query']);_0x31c580[_0x6532('0x2f')]=_[_0x6532('0x30')](_0x31c580[_0x6532('0x2c')],_0x31c580[_0x6532('0x2d')]);_0x325f50[_0x6532('0x31')]=_['intersection'](_0x31c580[_0x6532('0x2c')],qs[_0x6532('0x32')](_0x5d6867[_0x6532('0x2d')]['fields']));_0x325f50[_0x6532('0x31')]=_0x325f50[_0x6532('0x31')][_0x6532('0x42')]?_0x325f50['attributes']:_0x31c580[_0x6532('0x2c')];if(_0x5d6867[_0x6532('0x2d')][_0x6532('0x3c')]){_0x325f50[_0x6532('0x3d')]=[{'all':!![]}];}_0x325f50=_[_0x6532('0x3a')]({},_0x325f50,_0x5d6867[_0x6532('0x3b')]);return db[_0x6532('0x27')][_0x6532('0x43')](_0x325f50)['then'](handleEntityNotFound(_0x398dde,null))['then'](respondWithResult(_0x398dde,null))[_0x6532('0x44')](handleError(_0x398dde,null));};exports[_0x6532('0x45')]=function(_0x1ef0bb,_0x10d9ed){return db[_0x6532('0x27')]['create'](_0x1ef0bb['body'],{})['then'](respondWithResult(_0x10d9ed,0xc9))['catch'](handleError(_0x10d9ed,null));};exports[_0x6532('0x20')]=function(_0xd23996,_0xe0f28a){if(_0xd23996['body']['id']){delete _0xd23996[_0x6532('0x46')]['id'];}return db['Automation'][_0x6532('0x43')]({'where':{'id':_0xd23996[_0x6532('0x41')]['id']}})[_0x6532('0x21')](handleEntityNotFound(_0xe0f28a,null))['then'](saveUpdates(_0xd23996[_0x6532('0x46')],null))[_0x6532('0x21')](respondWithResult(_0xe0f28a,null))[_0x6532('0x44')](handleError(_0xe0f28a,null));};exports[_0x6532('0x47')]=function(_0x207379,_0x33961f){return db[_0x6532('0x27')][_0x6532('0x43')]({'where':{'id':_0x207379[_0x6532('0x41')]['id']}})['then'](handleEntityNotFound(_0x33961f,null))[_0x6532('0x21')](removeEntity(_0x33961f,null))[_0x6532('0x44')](handleError(_0x33961f,null));};exports[_0x6532('0x48')]=function(_0x4e27bc,_0x540f6c,_0x3c5313){return db[_0x6532('0x49')][_0x6532('0x43')]({'where':{'id':_0x4e27bc[_0x6532('0x41')]['id']}})['then'](handleEntityNotFound(_0x540f6c,null))[_0x6532('0x21')](function(_0x5f5208){if(_0x5f5208){return _0x5f5208[_0x6532('0x48')](_0x4e27bc[_0x6532('0x46')][_0x6532('0x4a')],_[_0x6532('0x4b')](_0x4e27bc[_0x6532('0x46')],[_0x6532('0x4a'),'id'])||{});}})['then'](respondWithResult(_0x540f6c,null))[_0x6532('0x44')](handleError(_0x540f6c,null));};exports[_0x6532('0x4c')]=function(_0x976f65,_0x233e53,_0x44c593){var _0x557f72={};var _0x48d3b3={};var _0x26078b;var _0x58aa28;return db[_0x6532('0x27')][_0x6532('0x4d')]({'where':{'id':_0x976f65['params']['id']}})[_0x6532('0x21')](handleEntityNotFound(_0x233e53,null))['then'](function(_0x7a0467){if(_0x7a0467){_0x26078b=_0x7a0467;_0x48d3b3[_0x6532('0x2c')]=_['keys'](db[_0x6532('0x49')][_0x6532('0x28')]);_0x48d3b3[_0x6532('0x2d')]=_[_0x6532('0x2e')](_0x976f65[_0x6532('0x2d')]);_0x48d3b3[_0x6532('0x2f')]=_[_0x6532('0x30')](_0x48d3b3[_0x6532('0x2c')],_0x48d3b3[_0x6532('0x2d')]);_0x557f72[_0x6532('0x31')]=_[_0x6532('0x30')](_0x48d3b3[_0x6532('0x2c')],qs[_0x6532('0x32')](_0x976f65[_0x6532('0x2d')]['fields']));_0x557f72[_0x6532('0x31')]=_0x557f72[_0x6532('0x31')][_0x6532('0x42')]?_0x557f72[_0x6532('0x31')]:_0x48d3b3[_0x6532('0x2c')];_0x557f72[_0x6532('0x35')]=qs[_0x6532('0x36')](_0x976f65[_0x6532('0x2d')][_0x6532('0x36')]);_0x557f72['where']=qs[_0x6532('0x2f')](_[_0x6532('0x37')](_0x976f65[_0x6532('0x2d')],_0x48d3b3['filters']));if(_0x976f65[_0x6532('0x2d')][_0x6532('0x38')]){_0x557f72[_0x6532('0x39')]=_[_0x6532('0x3a')](_0x557f72[_0x6532('0x39')],{'$or':_['map'](_0x557f72['attributes'],function(_0x110e35){var _0x55bde7={};_0x55bde7[_0x110e35]={'$like':'%'+_0x976f65['query']['filter']+'%'};return _0x55bde7;})});}_0x557f72=_[_0x6532('0x3a')]({},_0x557f72,_0x976f65['options']);return _0x26078b[_0x6532('0x4c')](_0x557f72);}})[_0x6532('0x21')](function(_0x2fc76a){if(_0x2fc76a){_0x58aa28=_0x2fc76a['length'];if(!_0x976f65[_0x6532('0x2d')][_0x6532('0x33')](_0x6532('0x4e'))){_0x557f72[_0x6532('0x34')]=qs['limit'](_0x976f65[_0x6532('0x2d')]['limit']);_0x557f72[_0x6532('0x1a')]=qs[_0x6532('0x1a')](_0x976f65[_0x6532('0x2d')]['offset']);}return _0x26078b[_0x6532('0x4c')](_0x557f72);}})[_0x6532('0x21')](function(_0x24d13f){if(_0x24d13f){return _0x24d13f?{'count':_0x58aa28,'rows':_0x24d13f}:null;}})[_0x6532('0x21')](respondWithResult(_0x233e53,null))['catch'](handleError(_0x233e53,null));};exports[_0x6532('0x4f')]=function(_0x543fc6,_0x9f1fce,_0x3a690c){return db[_0x6532('0x50')][_0x6532('0x43')]({'where':{'id':_0x543fc6['params']['id']}})[_0x6532('0x21')](handleEntityNotFound(_0x9f1fce,null))['then'](function(_0x1beb00){if(_0x1beb00){return _0x1beb00['addActions'](_0x543fc6[_0x6532('0x46')]['ids'],_[_0x6532('0x4b')](_0x543fc6['body'],[_0x6532('0x4a'),'id'])||{});}})[_0x6532('0x21')](respondWithResult(_0x9f1fce,null))[_0x6532('0x44')](handleError(_0x9f1fce,null));};exports[_0x6532('0x51')]=function(_0x550b1b,_0x25d7b9,_0x38b2a8){var _0x295f71={};var _0x4b350d={};var _0x20e3cf;var _0xe3993d;return db[_0x6532('0x27')][_0x6532('0x4d')]({'where':{'id':_0x550b1b[_0x6532('0x41')]['id']}})['then'](handleEntityNotFound(_0x25d7b9,null))[_0x6532('0x21')](function(_0x4371c3){if(_0x4371c3){_0x20e3cf=_0x4371c3;_0x4b350d['model']=_['keys'](db[_0x6532('0x50')][_0x6532('0x28')]);_0x4b350d['query']=_[_0x6532('0x2e')](_0x550b1b[_0x6532('0x2d')]);_0x4b350d[_0x6532('0x2f')]=_['intersection'](_0x4b350d[_0x6532('0x2c')],_0x4b350d[_0x6532('0x2d')]);_0x295f71[_0x6532('0x31')]=_[_0x6532('0x30')](_0x4b350d[_0x6532('0x2c')],qs[_0x6532('0x32')](_0x550b1b['query'][_0x6532('0x32')]));_0x295f71['attributes']=_0x295f71['attributes'][_0x6532('0x42')]?_0x295f71['attributes']:_0x4b350d[_0x6532('0x2c')];_0x295f71[_0x6532('0x35')]=qs[_0x6532('0x36')](_0x550b1b[_0x6532('0x2d')][_0x6532('0x36')]);_0x295f71[_0x6532('0x39')]=qs[_0x6532('0x2f')](_['pick'](_0x550b1b[_0x6532('0x2d')],_0x4b350d[_0x6532('0x2f')]));if(_0x550b1b[_0x6532('0x2d')]['filter']){_0x295f71['where']=_[_0x6532('0x3a')](_0x295f71[_0x6532('0x39')],{'$or':_['map'](_0x295f71[_0x6532('0x31')],function(_0xe1bd7e){var _0x4e6794={};_0x4e6794[_0xe1bd7e]={'$like':'%'+_0x550b1b['query'][_0x6532('0x38')]+'%'};return _0x4e6794;})});}_0x295f71=_['merge']({},_0x295f71,_0x550b1b['options']);return _0x20e3cf[_0x6532('0x51')](_0x295f71);}})[_0x6532('0x21')](function(_0x2ec2f8){if(_0x2ec2f8){_0xe3993d=_0x2ec2f8['length'];if(!_0x550b1b[_0x6532('0x2d')][_0x6532('0x33')](_0x6532('0x4e'))){_0x295f71[_0x6532('0x34')]=qs['limit'](_0x550b1b[_0x6532('0x2d')]['limit']);_0x295f71['offset']=qs[_0x6532('0x1a')](_0x550b1b['query'][_0x6532('0x1a')]);}return _0x20e3cf[_0x6532('0x51')](_0x295f71);}})[_0x6532('0x21')](function(_0x27ace6){if(_0x27ace6){return _0x27ace6?{'count':_0xe3993d,'rows':_0x27ace6}:null;}})[_0x6532('0x21')](respondWithResult(_0x25d7b9,null))[_0x6532('0x44')](handleError(_0x25d7b9,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index 29c3bb6..b189167 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 _0x4815=['moment','bluebird','path','rimraf','./automation.attributes','exports','define','tools_automations','lodash','util','../../config/logger','api'];(function(_0x40b613,_0x242cca){var _0x3082da=function(_0xf4c1ae){while(--_0xf4c1ae){_0x40b613['push'](_0x40b613['shift']());}};_0x3082da(++_0x242cca);}(_0x4815,0x140));var _0x5481=function(_0xc53fb4,_0x24571f){_0xc53fb4=_0xc53fb4-0x0;var _0xa624c6=_0x4815[_0xc53fb4];return _0xa624c6;};'use strict';var _=require(_0x5481('0x0'));var util=require(_0x5481('0x1'));var logger=require(_0x5481('0x2'))(_0x5481('0x3'));var moment=require(_0x5481('0x4'));var BPromise=require(_0x5481('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5481('0x6'));var rimraf=require(_0x5481('0x7'));var config=require('../../config/environment');var attributes=require(_0x5481('0x8'));module[_0x5481('0x9')]=function(_0xff398f,_0x366a34){return _0xff398f[_0x5481('0xa')]('Automation',attributes,{'tableName':_0x5481('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xeee1=['exports','define','Automation','tools_automations','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./automation.attributes'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xeee1,0x146));var _0x1eee=function(_0x17dcff,_0x546d31){_0x17dcff=_0x17dcff-0x0;var _0x27618b=_0xeee1[_0x17dcff];return _0x27618b;};'use strict';var _=require(_0x1eee('0x0'));var util=require(_0x1eee('0x1'));var logger=require(_0x1eee('0x2'))(_0x1eee('0x3'));var moment=require(_0x1eee('0x4'));var BPromise=require('bluebird');var rp=require(_0x1eee('0x5'));var fs=require('fs');var path=require(_0x1eee('0x6'));var rimraf=require(_0x1eee('0x7'));var config=require(_0x1eee('0x8'));var attributes=require(_0x1eee('0x9'));module[_0x1eee('0xa')]=function(_0x4e3855,_0x316562){return _0x4e3855[_0x1eee('0xb')](_0x1eee('0xc'),attributes,{'tableName':_0x1eee('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/automation/automation.rpc.js b/server/api/automation/automation.rpc.js index 22817d6..44a2209 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 _0x50a8=['message','info','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','http','request','then','request\x20sent','debug','error','code','Automation,\x20%s,\x20%s'];(function(_0x416759,_0x7df167){var _0x25c3f8=function(_0x575358){while(--_0x575358){_0x416759['push'](_0x416759['shift']());}};_0x25c3f8(++_0x7df167);}(_0x50a8,0x193));var _0x850a=function(_0x48788c,_0x22c6cf){_0x48788c=_0x48788c-0x0;var _0x111b0f=_0x50a8[_0x48788c];return _0x111b0f;};'use strict';var _=require('lodash');var util=require(_0x850a('0x0'));var moment=require('moment');var BPromise=require(_0x850a('0x1'));var rs=require(_0x850a('0x2'));var fs=require('fs');var Redis=require(_0x850a('0x3'));var db=require(_0x850a('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x850a('0x5'));var jayson=require(_0x850a('0x6'));var client=jayson['client'][_0x850a('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4d74c5,_0x29c689,_0x2cfc90){return new BPromise(function(_0x245f43,_0x596f57){return client[_0x850a('0x8')](_0x4d74c5,_0x2cfc90)[_0x850a('0x9')](function(_0x21b814){logger['info']('Automation,\x20%s,\x20%s',_0x29c689,_0x850a('0xa'));logger[_0x850a('0xb')]('Automation,\x20%s,\x20%s,\x20%s',_0x29c689,_0x850a('0xa'),JSON['stringify'](_0x21b814));if(_0x21b814[_0x850a('0xc')]){if(_0x21b814[_0x850a('0xc')][_0x850a('0xd')]===0x1f4){logger[_0x850a('0xc')](_0x850a('0xe'),_0x29c689,_0x21b814['error'][_0x850a('0xf')]);return _0x596f57(_0x21b814[_0x850a('0xc')]['message']);}logger[_0x850a('0xc')](_0x850a('0xe'),_0x29c689,_0x21b814['error'][_0x850a('0xf')]);return _0x245f43(_0x21b814[_0x850a('0xc')][_0x850a('0xf')]);}else{logger[_0x850a('0x10')]('Automation,\x20%s,\x20%s',_0x29c689,_0x850a('0xa'));_0x245f43(_0x21b814[_0x850a('0x11')][_0x850a('0xf')]);}})[_0x850a('0x12')](function(_0x67adce){logger[_0x850a('0xc')]('Automation,\x20%s,\x20%s',_0x29c689,_0x67adce);_0x596f57(_0x67adce);});});} \ No newline at end of file +var _0x63a6=['../../config/environment','request','then','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x56bb84,_0x3f96c5){var _0x476e44=function(_0x433fd8){while(--_0x433fd8){_0x56bb84['push'](_0x56bb84['shift']());}};_0x476e44(++_0x3f96c5);}(_0x63a6,0x1c7));var _0x663a=function(_0x3b9b2e,_0x1d3afe){_0x3b9b2e=_0x3b9b2e-0x0;var _0x3e1a74=_0x63a6[_0x3b9b2e];return _0x3e1a74;};'use strict';var _=require('lodash');var util=require(_0x663a('0x0'));var moment=require(_0x663a('0x1'));var BPromise=require('bluebird');var rs=require(_0x663a('0x2'));var fs=require('fs');var Redis=require(_0x663a('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x663a('0x4'));var logger=require(_0x663a('0x5'))(_0x663a('0x6'));var config=require(_0x663a('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x14b552,_0x20203b,_0x4b1314){return new BPromise(function(_0x4d4249,_0x326b53){return client[_0x663a('0x8')](_0x14b552,_0x4b1314)[_0x663a('0x9')](function(_0x4aa93a){logger['info'](_0x663a('0xa'),_0x20203b,_0x663a('0xb'));logger[_0x663a('0xc')](_0x663a('0xd'),_0x20203b,_0x663a('0xb'),JSON[_0x663a('0xe')](_0x4aa93a));if(_0x4aa93a['error']){if(_0x4aa93a[_0x663a('0xf')][_0x663a('0x10')]===0x1f4){logger[_0x663a('0xf')]('Automation,\x20%s,\x20%s',_0x20203b,_0x4aa93a['error'][_0x663a('0x11')]);return _0x326b53(_0x4aa93a['error']['message']);}logger[_0x663a('0xf')](_0x663a('0xa'),_0x20203b,_0x4aa93a['error'][_0x663a('0x11')]);return _0x4d4249(_0x4aa93a['error'][_0x663a('0x11')]);}else{logger[_0x663a('0x12')](_0x663a('0xa'),_0x20203b,_0x663a('0xb'));_0x4d4249(_0x4aa93a[_0x663a('0x13')]['message']);}})[_0x663a('0x14')](function(_0x5cc6ab){logger[_0x663a('0xf')](_0x663a('0xa'),_0x20203b,_0x5cc6ab);_0x326b53(_0x5cc6ab);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index fa1c843..999fa4e 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 _0xf72b=['show','/:id/conditions','getConditions','/:id/actions','post','create','addConditions','addActions','put','destroy','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','/:id'];(function(_0x36402b,_0x17be28){var _0x35002c=function(_0x23f5b6){while(--_0x23f5b6){_0x36402b['push'](_0x36402b['shift']());}};_0x35002c(++_0x17be28);}(_0xf72b,0x1d9));var _0xbf72=function(_0x15cc73,_0x5e52d3){_0x15cc73=_0x15cc73-0x0;var _0x43aa76=_0xf72b[_0x15cc73];return _0x43aa76;};'use strict';var multer=require(_0xbf72('0x0'));var util=require('util');var path=require(_0xbf72('0x1'));var timeout=require('connect-timeout');var express=require(_0xbf72('0x2'));var router=express[_0xbf72('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbf72('0x4'));var interaction=require(_0xbf72('0x5'));var config=require(_0xbf72('0x6'));var controller=require(_0xbf72('0x7'));router[_0xbf72('0x8')]('/',auth[_0xbf72('0x9')](),controller['index']);router[_0xbf72('0x8')](_0xbf72('0xa'),auth[_0xbf72('0x9')](),controller[_0xbf72('0xb')]);router[_0xbf72('0x8')](_0xbf72('0xc'),auth['isAuthenticated'](),controller[_0xbf72('0xd')]);router['get'](_0xbf72('0xe'),auth[_0xbf72('0x9')](),controller['getActions']);router[_0xbf72('0xf')]('/',auth[_0xbf72('0x9')](),controller[_0xbf72('0x10')]);router[_0xbf72('0xf')](_0xbf72('0xc'),auth[_0xbf72('0x9')](),controller[_0xbf72('0x11')]);router[_0xbf72('0xf')]('/:id/actions',auth[_0xbf72('0x9')](),controller[_0xbf72('0x12')]);router[_0xbf72('0x13')]('/:id',auth[_0xbf72('0x9')](),controller['update']);router['delete']('/:id',auth[_0xbf72('0x9')](),controller[_0xbf72('0x14')]);module[_0xbf72('0x15')]=router; \ No newline at end of file +var _0xbdb0=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./automation.controller','isAuthenticated','get','/:id','show','/:id/conditions','getActions','create','addConditions','post','/:id/actions','put','destroy','exports','multer','util','path'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xbdb0,0x189));var _0x0bdb=function(_0x4c06a3,_0x1e6b6f){_0x4c06a3=_0x4c06a3-0x0;var _0x7ff53c=_0xbdb0[_0x4c06a3];return _0x7ff53c;};'use strict';var multer=require(_0x0bdb('0x0'));var util=require(_0x0bdb('0x1'));var path=require(_0x0bdb('0x2'));var timeout=require('connect-timeout');var express=require(_0x0bdb('0x3'));var router=express[_0x0bdb('0x4')]();var fs_extra=require(_0x0bdb('0x5'));var auth=require(_0x0bdb('0x6'));var interaction=require(_0x0bdb('0x7'));var config=require('../../config/environment');var controller=require(_0x0bdb('0x8'));router['get']('/',auth[_0x0bdb('0x9')](),controller['index']);router[_0x0bdb('0xa')](_0x0bdb('0xb'),auth[_0x0bdb('0x9')](),controller[_0x0bdb('0xc')]);router[_0x0bdb('0xa')](_0x0bdb('0xd'),auth[_0x0bdb('0x9')](),controller['getConditions']);router[_0x0bdb('0xa')]('/:id/actions',auth['isAuthenticated'](),controller[_0x0bdb('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x0bdb('0xf')]);router['post']('/:id/conditions',auth[_0x0bdb('0x9')](),controller[_0x0bdb('0x10')]);router[_0x0bdb('0x11')](_0x0bdb('0x12'),auth[_0x0bdb('0x9')](),controller['addActions']);router[_0x0bdb('0x13')](_0x0bdb('0xb'),auth[_0x0bdb('0x9')](),controller['update']);router['delete']('/:id',auth[_0x0bdb('0x9')](),controller[_0x0bdb('0x14')]);module[_0x0bdb('0x15')]=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index f61a765..ec5a148 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 _0xd191=['always','BOOLEAN','#AMD\x20Initial\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','ASC','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','#Drop\x20Retry\x20(min:1,\x20max:999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','name','ENUM','ivr','Active/Disactive\x20Campaign','UNSIGNED','Max\x20200\x20calls.','INTEGER','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','onlyIfOpen'];(function(_0x465f18,_0x2d600c){var _0x529a8e=function(_0x5391b9){while(--_0x5391b9){_0x465f18['push'](_0x465f18['shift']());}};_0x529a8e(++_0x2d600c);}(_0xd191,0xaf));var _0x1d19=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd191[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x1d19('0x0'));module[_0x1d19('0x1')]={'name':{'type':Sequelize[_0x1d19('0x2')],'unique':_0x1d19('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x1d19('0x4')](_0x1d19('0x5')),'allowNull':![],'defaultValue':_0x1d19('0x5')},'description':{'type':Sequelize[_0x1d19('0x2')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x1d19('0x6')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0x1d19('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x1d19('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0x1d19('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x1d19('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x1d19('0x9')](0x3)[_0x1d19('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1d19('0xa')},'dialCongestionMaxRetry':{'type':Sequelize[_0x1d19('0x9')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1d19('0xb')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x1d19('0x9')](0x5)[_0x1d19('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1d19('0xc')},'dialBusyMaxRetry':{'type':Sequelize[_0x1d19('0x9')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1d19('0xd')},'dialBusyRetryFrequency':{'type':Sequelize[_0x1d19('0x9')](0x5)[_0x1d19('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1d19('0xe')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x1d19('0x9')](0x3)[_0x1d19('0x7')],'defaultValue':0x3,'comment':_0x1d19('0xf')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x1d19('0x9')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1d19('0x10')},'dialGlobalMaxRetry':{'type':Sequelize[_0x1d19('0x9')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x1d19('0x11')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0x1d19('0x12')},'dialCheckDuplicateType':{'type':Sequelize['ENUM']('always','never',_0x1d19('0x13')),'defaultValue':_0x1d19('0x14')},'dialAMDActive':{'type':Sequelize[_0x1d19('0x15')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0x1d19('0x9')](0x9)[_0x1d19('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x1d19('0x16')},'dialAMDGreeting':{'type':Sequelize[_0x1d19('0x9')](0x9)[_0x1d19('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)[_0x1d19('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x1d19('0x9')](0x9)[_0x1d19('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x1d19('0x17')},'dialAMDMinWordLength':{'type':Sequelize[_0x1d19('0x9')](0x9)[_0x1d19('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x1d19('0x18')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x1d19('0x9')](0x9)[_0x1d19('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x1d19('0x19')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x1d19('0x9')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x1d19('0x1a')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x1d19('0x9')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x1d19('0x1b')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x1d19('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x1d19('0x1c')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM']('DESC',_0x1d19('0x1d')),'defaultValue':_0x1d19('0x1e')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x1d19('0x9')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x1d19('0x1f')},'dialCutDigit':{'type':Sequelize[_0x1d19('0x9')](0x3)[_0x1d19('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x1d19('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1d19('0x20')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x1d19('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0x1d19('0x9')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1d19('0x21')},'dialDropRetryFrequency':{'type':Sequelize[_0x1d19('0x9')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x1d19('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1d19('0x22')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x1d19('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x1d19('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1d19('0x23')},'dialMachineRetryFrequency':{'type':Sequelize[_0x1d19('0x9')](0x5)[_0x1d19('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1d19('0x24')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x1d19('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1d19('0x25')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x1d19('0x9')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1d19('0x26')}}; \ No newline at end of file +var _0x6a0b=['Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','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)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','name','ENUM','ivr','STRING','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','Max\x20200\x20calls.','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'];(function(_0x5c2206,_0x1a42f6){var _0x302939=function(_0x131a8d){while(--_0x131a8d){_0x5c2206['push'](_0x5c2206['shift']());}};_0x302939(++_0x1a42f6);}(_0x6a0b,0xc1));var _0xb6a0=function(_0x7cd93b,_0x3ee5de){_0x7cd93b=_0x7cd93b-0x0;var _0x510859=_0x6a0b[_0x7cd93b];return _0x510859;};'use strict';var Sequelize=require(_0xb6a0('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0xb6a0('0x1'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xb6a0('0x2')](_0xb6a0('0x3')),'allowNull':![],'defaultValue':_0xb6a0('0x3')},'description':{'type':Sequelize[_0xb6a0('0x4')]},'active':{'type':Sequelize[_0xb6a0('0x5')],'defaultValue':0x0,'comment':_0xb6a0('0x6')},'limitCalls':{'type':Sequelize[_0xb6a0('0x7')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xb6a0('0x8')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0xb6a0('0x7')](0x3)[_0xb6a0('0x9')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb6a0('0xa')},'dialCongestionMaxRetry':{'type':Sequelize[_0xb6a0('0x7')](0x3)[_0xb6a0('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0xb6a0('0x7')](0x5)[_0xb6a0('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb6a0('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0xb6a0('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb6a0('0xc')},'dialBusyRetryFrequency':{'type':Sequelize[_0xb6a0('0x7')](0x5)[_0xb6a0('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb6a0('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xb6a0('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0xb6a0('0xe')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xb6a0('0x7')](0x5)[_0xb6a0('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb6a0('0xf')},'dialGlobalMaxRetry':{'type':Sequelize[_0xb6a0('0x7')](0x3)[_0xb6a0('0x9')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xb6a0('0x10')},'dialTimezone':{'type':Sequelize[_0xb6a0('0x4')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xb6a0('0x4')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0xb6a0('0x2')](_0xb6a0('0x11'),_0xb6a0('0x12'),_0xb6a0('0x13')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xb6a0('0x14')},'dialAMDInitialSilence':{'type':Sequelize[_0xb6a0('0x7')](0x9)[_0xb6a0('0x9')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xb6a0('0x15')},'dialAMDGreeting':{'type':Sequelize[_0xb6a0('0x7')](0x9)[_0xb6a0('0x9')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xb6a0('0x7')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xb6a0('0x7')](0x9)[_0xb6a0('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xb6a0('0x16')},'dialAMDMinWordLength':{'type':Sequelize[_0xb6a0('0x7')](0x9)[_0xb6a0('0x9')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0xb6a0('0x9')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xb6a0('0x7')](0x9)[_0xb6a0('0x9')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xb6a0('0x17')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xb6a0('0x7')](0x5)[_0xb6a0('0x9')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xb6a0('0x18')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0xb6a0('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize[_0xb6a0('0x2')]('DESC','ASC'),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0xb6a0('0x4')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0xb6a0('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xb6a0('0x19')},'dialCutDigit':{'type':Sequelize[_0xb6a0('0x7')](0x3)[_0xb6a0('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xb6a0('0x1a')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xb6a0('0x7')](0x3)[_0xb6a0('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb6a0('0x1b')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xb6a0('0x7')](0x5)[_0xb6a0('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb6a0('0x1c')},'dialDropMaxRetry':{'type':Sequelize[_0xb6a0('0x7')](0x3)[_0xb6a0('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb6a0('0x1d')},'dialDropRetryFrequency':{'type':Sequelize[_0xb6a0('0x7')](0x5)[_0xb6a0('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb6a0('0x1e')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xb6a0('0x7')](0x3)[_0xb6a0('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb6a0('0x1f')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xb6a0('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0xb6a0('0x7')](0x3)[_0xb6a0('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb6a0('0x20')},'dialMachineRetryFrequency':{'type':Sequelize[_0xb6a0('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb6a0('0x21')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xb6a0('0x7')](0x3)[_0xb6a0('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xb6a0('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index 40ebdc4..0bdb01e 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 _0x130d=['getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','fast-json-patch','moment','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../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','reject','save','update','then','destroy','UserProfileResource','error','name','send','index','map','rawAttributes','fieldName','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filters','filter','type','VIRTUAL','merge','options','Campaign','includeAll','findAll','rows','catch','show','params','keys','include','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','IvrCampaigns','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','createdAt','updatedAt','body','omit','autoAssociation','getHoppers','findOne','CmHopper','CampaignId','getHopperHistories','CmHopperHistory','order','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','addLists','ids','spread','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','ContactId','ListId','select','field','scheduledAt','toString','NOW()','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','CmListId','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','push','sequelize','all','removeLists'];(function(_0x57fb9d,_0x14a22d){var _0x5daabc=function(_0x3371e4){while(--_0x3371e4){_0x57fb9d['push'](_0x57fb9d['shift']());}};_0x5daabc(++_0x14a22d);}(_0x130d,0x89));var _0xd130=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x130d[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xd130('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xd130('0x1'));var rp=require('request-promise');var moment=require(_0xd130('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xd130('0x3'));var path=require(_0xd130('0x4'));var sox=require(_0xd130('0x5'));var csv=require(_0xd130('0x6'));var ejs=require(_0xd130('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd130('0x8'));var squel=require('squel');var crypto=require(_0xd130('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xd130('0xa'));var toCsv=require('to-csv');var querystring=require(_0xd130('0xb'));var Papa=require('papaparse');var Redis=require(_0xd130('0xc'));var authService=require(_0xd130('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0xd130('0xe'));var hardwareService=require(_0xd130('0xf'));var logger=require(_0xd130('0x10'))('api');var utils=require(_0xd130('0x11'));var config=require(_0xd130('0x12'));var licenseUtil=require(_0xd130('0x13'));var db=require(_0xd130('0x14'))['db'];function respondWithStatusCode(_0x48bdce,_0x2ddd0b){_0x2ddd0b=_0x2ddd0b||0xcc;return function(_0x59c59a){if(_0x59c59a){return _0x48bdce['sendStatus'](_0x2ddd0b);}return _0x48bdce[_0xd130('0x15')](_0x2ddd0b)[_0xd130('0x16')]();};}function respondWithResult(_0x18d24b,_0x1c5eb7){_0x1c5eb7=_0x1c5eb7||0xc8;return function(_0x42f354){if(_0x42f354){return _0x18d24b[_0xd130('0x15')](_0x1c5eb7)[_0xd130('0x17')](_0x42f354);}};}function respondWithFilteredResult(_0x36b948,_0x32c19e){return function(_0x1cef52){if(_0x1cef52){var _0x3f8808=typeof _0x32c19e[_0xd130('0x18')]===_0xd130('0x19')&&typeof _0x32c19e[_0xd130('0x1a')]===_0xd130('0x19');var _0x162183=_0x1cef52[_0xd130('0x1b')];var _0x2707c1=_0x3f8808?0x0:_0x32c19e['offset'];var _0x419605=_0x3f8808?_0x1cef52[_0xd130('0x1b')]:_0x32c19e[_0xd130('0x18')]+_0x32c19e[_0xd130('0x1a')];var _0x3cd5e2;if(_0x419605>=_0x162183){_0x419605=_0x162183;_0x3cd5e2=0xc8;}else{_0x3cd5e2=0xce;}_0x36b948[_0xd130('0x15')](_0x3cd5e2);return _0x36b948[_0xd130('0x1c')](_0xd130('0x1d'),_0x2707c1+'-'+_0x419605+'/'+_0x162183)[_0xd130('0x17')](_0x1cef52);}return null;};}function patchUpdates(_0x23b4b4){return function(_0x380283){try{jsonpatch[_0xd130('0x1e')](_0x380283,_0x23b4b4,!![]);}catch(_0x431e97){return BPromise[_0xd130('0x1f')](_0x431e97);}return _0x380283[_0xd130('0x20')]();};}function saveUpdates(_0x1cd8d8,_0x3fabd){return function(_0x54e365){if(_0x54e365){return _0x54e365[_0xd130('0x21')](_0x1cd8d8)[_0xd130('0x22')](function(_0x52e077){return _0x52e077;});}return null;};}function removeEntity(_0x3df0fc,_0x31945f){return function(_0x511482){if(_0x511482){return _0x511482[_0xd130('0x23')]()[_0xd130('0x22')](function(){var _0x1d684e=_0x511482['get']({'plain':!![]});var _0x2b2f05='IvrCampaigns';return db[_0xd130('0x24')]['destroy']({'where':{'type':_0x2b2f05,'resourceId':_0x1d684e['id']}})['then'](function(){return _0x511482;});})[_0xd130('0x22')](function(){_0x3df0fc[_0xd130('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1131a0,_0x4e9e23){return function(_0x29572c){if(!_0x29572c){_0x1131a0['sendStatus'](0x194);}return _0x29572c;};}function handleError(_0x3aad76,_0x9eb5cf){_0x9eb5cf=_0x9eb5cf||0x1f4;return function(_0x23b091){logger[_0xd130('0x25')](_0x23b091['stack']);if(_0x23b091[_0xd130('0x26')]){delete _0x23b091[_0xd130('0x26')];}_0x3aad76['status'](_0x9eb5cf)[_0xd130('0x27')](_0x23b091);};}exports[_0xd130('0x28')]=function(_0x3ea968,_0x297994){var _0x3a856f={},_0x2fd263={},_0xe36f42={'count':0x0,'rows':[]};var _0xa6061a=_[_0xd130('0x29')](db['Campaign'][_0xd130('0x2a')],function(_0x3c53d4){return{'name':_0x3c53d4[_0xd130('0x2b')],'type':_0x3c53d4['type'][_0xd130('0x2c')]};});_0x2fd263[_0xd130('0x2d')]=_[_0xd130('0x29')](_0xa6061a,_0xd130('0x26'));_0x2fd263['query']=_['keys'](_0x3ea968[_0xd130('0x2e')]);_0x2fd263['filters']=_[_0xd130('0x2f')](_0x2fd263[_0xd130('0x2d')],_0x2fd263[_0xd130('0x2e')]);_0x3a856f[_0xd130('0x30')]=_[_0xd130('0x2f')](_0x2fd263['model'],qs[_0xd130('0x31')](_0x3ea968['query'][_0xd130('0x31')]));_0x3a856f[_0xd130('0x30')]=_0x3a856f[_0xd130('0x30')][_0xd130('0x32')]?_0x3a856f['attributes']:_0x2fd263['model'];if(!_0x3ea968[_0xd130('0x2e')][_0xd130('0x33')](_0xd130('0x34'))){_0x3a856f[_0xd130('0x1a')]=qs[_0xd130('0x1a')](_0x3ea968['query']['limit']);_0x3a856f['offset']=qs[_0xd130('0x18')](_0x3ea968[_0xd130('0x2e')][_0xd130('0x18')]);}_0x3a856f['order']=qs['sort'](_0x3ea968['query'][_0xd130('0x35')]);_0x3a856f[_0xd130('0x36')]=qs['filters'](_[_0xd130('0x37')](_0x3ea968[_0xd130('0x2e')],_0x2fd263[_0xd130('0x38')]),_0xa6061a);if(_0x3ea968[_0xd130('0x2e')][_0xd130('0x39')]){_0x3a856f[_0xd130('0x36')]=_['merge'](_0x3a856f['where'],{'$or':_[_0xd130('0x29')](_0xa6061a,function(_0x9cf755){if(_0x9cf755[_0xd130('0x3a')]!==_0xd130('0x3b')){var _0x1e4326={};_0x1e4326[_0x9cf755[_0xd130('0x26')]]={'$like':'%'+_0x3ea968[_0xd130('0x2e')]['filter']+'%'};return _0x1e4326;}})});}_0x3a856f=_[_0xd130('0x3c')]({},_0x3a856f,_0x3ea968[_0xd130('0x3d')]);var _0x2f7401={'where':_0x3a856f[_0xd130('0x36')]};return db[_0xd130('0x3e')][_0xd130('0x1b')](_0x2f7401)['then'](function(_0x1d9762){_0xe36f42[_0xd130('0x1b')]=_0x1d9762;if(_0x3ea968['query'][_0xd130('0x3f')]){_0x3a856f['include']=[{'all':!![]}];}return db[_0xd130('0x3e')][_0xd130('0x40')](_0x3a856f);})[_0xd130('0x22')](function(_0x12ac68){_0xe36f42[_0xd130('0x41')]=_0x12ac68;return _0xe36f42;})[_0xd130('0x22')](respondWithFilteredResult(_0x297994,_0x3a856f))[_0xd130('0x42')](handleError(_0x297994,null));};exports[_0xd130('0x43')]=function(_0x48c4ed,_0x3b431c){var _0x31d3bf={'raw':![],'where':{'id':_0x48c4ed[_0xd130('0x44')]['id']}},_0x549eb1={};_0x549eb1[_0xd130('0x2d')]=_['keys'](db['Campaign']['rawAttributes']);_0x549eb1['query']=_[_0xd130('0x45')](_0x48c4ed[_0xd130('0x2e')]);_0x549eb1[_0xd130('0x38')]=_[_0xd130('0x2f')](_0x549eb1['model'],_0x549eb1[_0xd130('0x2e')]);_0x31d3bf['attributes']=_[_0xd130('0x2f')](_0x549eb1[_0xd130('0x2d')],qs[_0xd130('0x31')](_0x48c4ed[_0xd130('0x2e')]['fields']));_0x31d3bf[_0xd130('0x30')]=_0x31d3bf[_0xd130('0x30')][_0xd130('0x32')]?_0x31d3bf[_0xd130('0x30')]:_0x549eb1['model'];if(_0x48c4ed['query'][_0xd130('0x3f')]){_0x31d3bf[_0xd130('0x46')]=[{'all':!![]}];}_0x31d3bf=_[_0xd130('0x3c')]({},_0x31d3bf,_0x48c4ed[_0xd130('0x3d')]);return db[_0xd130('0x3e')][_0xd130('0x47')](_0x31d3bf)[_0xd130('0x22')](handleEntityNotFound(_0x3b431c,null))[_0xd130('0x22')](respondWithResult(_0x3b431c,null))[_0xd130('0x42')](handleError(_0x3b431c,null));};exports['create']=function(_0xb71194,_0x122543){return db[_0xd130('0x3e')][_0xd130('0x48')](_0xb71194['body'],{})[_0xd130('0x22')](function(_0x5a5fe3){var _0x53dd4c=_0xb71194[_0xd130('0x49')][_0xd130('0x4a')]({'plain':!![]});if(!_0x53dd4c)throw new Error(_0xd130('0x4b'));if(_0x53dd4c['role']===_0xd130('0x49')){var _0x1219e5=_0x5a5fe3[_0xd130('0x4a')]({'plain':!![]});var _0x23e951=_0xd130('0x4c');return db[_0xd130('0x4d')]['find']({'where':{'name':_0x23e951,'userProfileId':_0x53dd4c[_0xd130('0x4e')]},'raw':!![]})[_0xd130('0x22')](function(_0x424845){if(_0x424845&&_0x424845['autoAssociation']===0x0){return db[_0xd130('0x24')][_0xd130('0x48')]({'name':_0x1219e5['name'],'resourceId':_0x1219e5['id'],'type':_0x424845[_0xd130('0x26')],'sectionId':_0x424845['id']},{})[_0xd130('0x22')](function(){return _0x5a5fe3;});}else{return _0x5a5fe3;}})[_0xd130('0x42')](function(_0x455af1){logger[_0xd130('0x25')](_0xd130('0x4f'),_0x455af1);throw _0x455af1;});}return _0x5a5fe3;})[_0xd130('0x22')](respondWithResult(_0x122543,0xc9))[_0xd130('0x42')](handleError(_0x122543,null));};exports[_0xd130('0x50')]=function(_0x18030d,_0x48ba9c){var _0x187e91={'where':{'id':_0x18030d[_0xd130('0x44')]['id']}},_0x1ae903={};_0x1ae903[_0xd130('0x2d')]=_[_0xd130('0x45')](db['Campaign'][_0xd130('0x2a')]);_0x187e91['attributes']=_[_0xd130('0x2f')](_0x1ae903[_0xd130('0x2d')],qs[_0xd130('0x31')](_0x18030d['query'][_0xd130('0x31')]));_0x187e91[_0xd130('0x30')]=_0x187e91[_0xd130('0x30')][_0xd130('0x32')]?_0x187e91[_0xd130('0x30')]:_0x1ae903['model'];if(_0x18030d[_0xd130('0x2e')][_0xd130('0x3f')]){_0x187e91[_0xd130('0x46')]=[{'all':!![]}];}_0x187e91=_[_0xd130('0x3c')]({},_0x187e91,_0x18030d[_0xd130('0x3d')]);return db[_0xd130('0x3e')]['find'](_0x187e91)[_0xd130('0x22')](handleEntityNotFound(_0x48ba9c,null))[_0xd130('0x22')](function(_0x34d7c3){if(_0x34d7c3){var _0xd4be77=_0x34d7c3['get']({'plain':!![]});_0xd4be77=qs['omit'](_0xd4be77,['id',_0xd130('0x51'),_0xd130('0x52')]);_0x18030d[_0xd130('0x53')]=_[_0xd130('0x54')](_0x18030d[_0xd130('0x53')],['id','createdAt',_0xd130('0x52')]);return db[_0xd130('0x3e')][_0xd130('0x48')](_[_0xd130('0x3c')](_0xd4be77,_0x18030d['body']),{'include':_0x18030d[_0xd130('0x2e')]['includeAll']?[{'all':!![]}]:undefined})[_0xd130('0x22')](function(_0x157de4){var _0x4a713f=_0x18030d[_0xd130('0x49')]['get']({'plain':!![]});if(!_0x4a713f)throw new Error(_0xd130('0x4b'));if(_0x4a713f['role']===_0xd130('0x49')){var _0x34319a=_0x157de4[_0xd130('0x4a')]({'plain':!![]});var _0x2d31df='IvrCampaigns';return db['UserProfileSection'][_0xd130('0x47')]({'where':{'name':_0x2d31df,'userProfileId':_0x4a713f[_0xd130('0x4e')]},'raw':!![]})[_0xd130('0x22')](function(_0x1e242a){if(_0x1e242a&&_0x1e242a[_0xd130('0x55')]===0x0){return db[_0xd130('0x24')]['create']({'name':_0x34319a[_0xd130('0x26')],'resourceId':_0x34319a['id'],'type':_0x1e242a['name'],'sectionId':_0x1e242a['id']},{})[_0xd130('0x22')](function(){return _0x157de4;});}else{return _0x157de4;}})[_0xd130('0x42')](function(_0x326b48){logger[_0xd130('0x25')](_0xd130('0x4f'),_0x326b48);throw _0x326b48;});}return _0x157de4;});}})[_0xd130('0x22')](respondWithResult(_0x48ba9c,0xc9))[_0xd130('0x42')](handleError(_0x48ba9c,null));};exports[_0xd130('0x21')]=function(_0x46456f,_0x2b13){if(_0x46456f[_0xd130('0x53')]['id']){delete _0x46456f[_0xd130('0x53')]['id'];}return db[_0xd130('0x3e')][_0xd130('0x47')]({'where':{'id':_0x46456f[_0xd130('0x44')]['id']}})[_0xd130('0x22')](handleEntityNotFound(_0x2b13,null))['then'](saveUpdates(_0x46456f['body'],null))[_0xd130('0x22')](respondWithResult(_0x2b13,null))[_0xd130('0x42')](handleError(_0x2b13,null));};exports[_0xd130('0x23')]=function(_0x3af558,_0xb16830){return db[_0xd130('0x3e')][_0xd130('0x47')]({'where':{'id':_0x3af558[_0xd130('0x44')]['id']}})[_0xd130('0x22')](handleEntityNotFound(_0xb16830,null))['then'](removeEntity(_0xb16830,null))['catch'](handleError(_0xb16830,null));};exports[_0xd130('0x56')]=function(_0x117131,_0x2dd2ae,_0x2528b3){var _0x592917={'raw':!![],'where':{}};var _0x482c0a={};var _0x4d38ed={'count':0x0,'rows':[]};return db[_0xd130('0x3e')][_0xd130('0x57')]({'where':{'id':_0x117131[_0xd130('0x44')]['id']}})[_0xd130('0x22')](handleEntityNotFound(_0x2dd2ae,null))['then'](function(_0x4e155a){if(_0x4e155a){_0x482c0a[_0xd130('0x2d')]=_[_0xd130('0x45')](db[_0xd130('0x58')][_0xd130('0x2a')]);_0x482c0a[_0xd130('0x2e')]=_['keys'](_0x117131['query']);_0x482c0a['filters']=_[_0xd130('0x2f')](_0x482c0a[_0xd130('0x2d')],_0x482c0a[_0xd130('0x2e')]);_0x592917['attributes']=_[_0xd130('0x2f')](_0x482c0a[_0xd130('0x2d')],qs[_0xd130('0x31')](_0x117131[_0xd130('0x2e')]['fields']));_0x592917[_0xd130('0x30')]=_0x592917[_0xd130('0x30')]['length']?_0x592917[_0xd130('0x30')]:_0x482c0a[_0xd130('0x2d')];if(!_0x117131[_0xd130('0x2e')][_0xd130('0x33')](_0xd130('0x34'))){_0x592917[_0xd130('0x1a')]=qs[_0xd130('0x1a')](_0x117131[_0xd130('0x2e')][_0xd130('0x1a')]);_0x592917[_0xd130('0x18')]=qs[_0xd130('0x18')](_0x117131[_0xd130('0x2e')][_0xd130('0x18')]);}_0x592917['order']=qs[_0xd130('0x35')](_0x117131[_0xd130('0x2e')][_0xd130('0x35')]);_0x592917[_0xd130('0x36')]=qs['filters'](_[_0xd130('0x37')](_0x117131['query'],_0x482c0a[_0xd130('0x38')]));_0x592917[_0xd130('0x36')][_0xd130('0x59')]=_0x4e155a['id'];if(_0x117131[_0xd130('0x2e')]['filter']){_0x592917['where']=_[_0xd130('0x3c')](_0x592917[_0xd130('0x36')],{'$or':_[_0xd130('0x29')](_0x592917[_0xd130('0x30')],function(_0x19572d){var _0x141ff6={};_0x141ff6[_0x19572d]={'$like':'%'+_0x117131['query'][_0xd130('0x39')]+'%'};return _0x141ff6;})});}_0x592917=_[_0xd130('0x3c')]({},_0x592917,_0x117131[_0xd130('0x3d')]);return db[_0xd130('0x58')][_0xd130('0x1b')]({'where':_0x592917[_0xd130('0x36')]})[_0xd130('0x22')](function(_0x4949d0){_0x4d38ed[_0xd130('0x1b')]=_0x4949d0;if(_0x117131['query'][_0xd130('0x3f')]){_0x592917['include']=[{'all':!![]}];}return db[_0xd130('0x58')]['findAll'](_0x592917);})[_0xd130('0x22')](function(_0x14f916){_0x4d38ed['rows']=_0x14f916;return _0x4d38ed;});}})[_0xd130('0x22')](respondWithFilteredResult(_0x2dd2ae,_0x592917))[_0xd130('0x42')](handleError(_0x2dd2ae,null));};exports[_0xd130('0x5a')]=function(_0x211ba8,_0xd0dcc3,_0x5e0f71){var _0x7ca944={'raw':!![],'where':{}};var _0x43490c={};var _0x448e4e={'count':0x0,'rows':[]};return db[_0xd130('0x3e')]['findOne']({'where':{'id':_0x211ba8[_0xd130('0x44')]['id']}})[_0xd130('0x22')](handleEntityNotFound(_0xd0dcc3,null))[_0xd130('0x22')](function(_0x11500b){if(_0x11500b){_0x43490c[_0xd130('0x2d')]=_[_0xd130('0x45')](db[_0xd130('0x5b')]['rawAttributes']);_0x43490c[_0xd130('0x2e')]=_[_0xd130('0x45')](_0x211ba8[_0xd130('0x2e')]);_0x43490c['filters']=_[_0xd130('0x2f')](_0x43490c[_0xd130('0x2d')],_0x43490c[_0xd130('0x2e')]);_0x7ca944['attributes']=_[_0xd130('0x2f')](_0x43490c['model'],qs[_0xd130('0x31')](_0x211ba8[_0xd130('0x2e')]['fields']));_0x7ca944[_0xd130('0x30')]=_0x7ca944[_0xd130('0x30')][_0xd130('0x32')]?_0x7ca944['attributes']:_0x43490c['model'];if(!_0x211ba8[_0xd130('0x2e')][_0xd130('0x33')](_0xd130('0x34'))){_0x7ca944[_0xd130('0x1a')]=qs[_0xd130('0x1a')](_0x211ba8[_0xd130('0x2e')][_0xd130('0x1a')]);_0x7ca944[_0xd130('0x18')]=qs[_0xd130('0x18')](_0x211ba8[_0xd130('0x2e')][_0xd130('0x18')]);}_0x7ca944[_0xd130('0x5c')]=qs[_0xd130('0x35')](_0x211ba8[_0xd130('0x2e')]['sort']);_0x7ca944[_0xd130('0x36')]=qs[_0xd130('0x38')](_[_0xd130('0x37')](_0x211ba8[_0xd130('0x2e')],_0x43490c[_0xd130('0x38')]));_0x7ca944[_0xd130('0x36')][_0xd130('0x59')]=_0x11500b['id'];if(_0x211ba8[_0xd130('0x2e')][_0xd130('0x39')]){_0x7ca944['where']=_[_0xd130('0x3c')](_0x7ca944[_0xd130('0x36')],{'$or':_[_0xd130('0x29')](_0x7ca944['attributes'],function(_0x2d17b8){var _0x27e00d={};_0x27e00d[_0x2d17b8]={'$like':'%'+_0x211ba8['query'][_0xd130('0x39')]+'%'};return _0x27e00d;})});}_0x7ca944=_[_0xd130('0x3c')]({},_0x7ca944,_0x211ba8[_0xd130('0x3d')]);return db[_0xd130('0x5b')][_0xd130('0x1b')]({'where':_0x7ca944['where']})[_0xd130('0x22')](function(_0x2fa51a){_0x448e4e[_0xd130('0x1b')]=_0x2fa51a;if(_0x211ba8[_0xd130('0x2e')][_0xd130('0x3f')]){_0x7ca944[_0xd130('0x46')]=[{'all':!![]}];}return db[_0xd130('0x5b')]['findAll'](_0x7ca944);})[_0xd130('0x22')](function(_0x3ec735){_0x448e4e[_0xd130('0x41')]=_0x3ec735;return _0x448e4e;});}})[_0xd130('0x22')](respondWithFilteredResult(_0xd0dcc3,_0x7ca944))['catch'](handleError(_0xd0dcc3,null));};exports['getHopperFinals']=function(_0x335685,_0x147bb9,_0x391273){var _0x4adfe5={'raw':!![],'where':{}};var _0x2adca3={};var _0x55bf8d={'count':0x0,'rows':[]};return db[_0xd130('0x3e')][_0xd130('0x57')]({'where':{'id':_0x335685[_0xd130('0x44')]['id']}})[_0xd130('0x22')](handleEntityNotFound(_0x147bb9,null))['then'](function(_0x50bc03){if(_0x50bc03){_0x2adca3[_0xd130('0x2d')]=_['keys'](db[_0xd130('0x5d')][_0xd130('0x2a')]);_0x2adca3[_0xd130('0x2e')]=_[_0xd130('0x45')](_0x335685['query']);_0x2adca3[_0xd130('0x38')]=_[_0xd130('0x2f')](_0x2adca3[_0xd130('0x2d')],_0x2adca3[_0xd130('0x2e')]);_0x4adfe5[_0xd130('0x30')]=_[_0xd130('0x2f')](_0x2adca3['model'],qs[_0xd130('0x31')](_0x335685[_0xd130('0x2e')][_0xd130('0x31')]));_0x4adfe5[_0xd130('0x30')]=_0x4adfe5[_0xd130('0x30')][_0xd130('0x32')]?_0x4adfe5[_0xd130('0x30')]:_0x2adca3[_0xd130('0x2d')];if(!_0x335685[_0xd130('0x2e')]['hasOwnProperty']('nolimit')){_0x4adfe5[_0xd130('0x1a')]=qs[_0xd130('0x1a')](_0x335685['query'][_0xd130('0x1a')]);_0x4adfe5[_0xd130('0x18')]=qs[_0xd130('0x18')](_0x335685[_0xd130('0x2e')][_0xd130('0x18')]);}_0x4adfe5['order']=qs[_0xd130('0x35')](_0x335685[_0xd130('0x2e')][_0xd130('0x35')]);_0x4adfe5[_0xd130('0x36')]=qs[_0xd130('0x38')](_[_0xd130('0x37')](_0x335685[_0xd130('0x2e')],_0x2adca3[_0xd130('0x38')]));_0x4adfe5[_0xd130('0x36')][_0xd130('0x59')]=_0x50bc03['id'];if(_0x335685[_0xd130('0x2e')][_0xd130('0x39')]){_0x4adfe5['where']=_[_0xd130('0x3c')](_0x4adfe5[_0xd130('0x36')],{'$or':_[_0xd130('0x29')](_0x4adfe5[_0xd130('0x30')],function(_0x4ae29a){var _0x2a1956={};_0x2a1956[_0x4ae29a]={'$like':'%'+_0x335685[_0xd130('0x2e')][_0xd130('0x39')]+'%'};return _0x2a1956;})});}_0x4adfe5=_['merge']({},_0x4adfe5,_0x335685[_0xd130('0x3d')]);return db[_0xd130('0x5d')]['count']({'where':_0x4adfe5[_0xd130('0x36')]})[_0xd130('0x22')](function(_0x431563){_0x55bf8d['count']=_0x431563;if(_0x335685[_0xd130('0x2e')][_0xd130('0x3f')]){_0x4adfe5['include']=[{'all':!![]}];}return db[_0xd130('0x5d')][_0xd130('0x40')](_0x4adfe5);})[_0xd130('0x22')](function(_0x3a96a6){_0x55bf8d[_0xd130('0x41')]=_0x3a96a6;return _0x55bf8d;});}})[_0xd130('0x22')](respondWithFilteredResult(_0x147bb9,_0x4adfe5))['catch'](handleError(_0x147bb9,null));};exports[_0xd130('0x5e')]=function(_0x1e04d4,_0x49a0dc,_0x361655){var _0x37fa20={'raw':!![],'where':{}};var _0x4b480b={};var _0x27833e={'count':0x0,'rows':[]};return db['Campaign'][_0xd130('0x57')]({'where':{'id':_0x1e04d4['params']['id']}})[_0xd130('0x22')](handleEntityNotFound(_0x49a0dc,null))[_0xd130('0x22')](function(_0x46e36e){if(_0x46e36e){_0x4b480b[_0xd130('0x2d')]=_[_0xd130('0x45')](db[_0xd130('0x5f')][_0xd130('0x2a')]);_0x4b480b[_0xd130('0x2e')]=_[_0xd130('0x45')](_0x1e04d4[_0xd130('0x2e')]);_0x4b480b[_0xd130('0x38')]=_[_0xd130('0x2f')](_0x4b480b[_0xd130('0x2d')],_0x4b480b[_0xd130('0x2e')]);_0x37fa20['attributes']=_[_0xd130('0x2f')](_0x4b480b[_0xd130('0x2d')],qs['fields'](_0x1e04d4[_0xd130('0x2e')]['fields']));_0x37fa20[_0xd130('0x30')]=_0x37fa20[_0xd130('0x30')][_0xd130('0x32')]?_0x37fa20['attributes']:_0x4b480b[_0xd130('0x2d')];if(!_0x1e04d4[_0xd130('0x2e')][_0xd130('0x33')](_0xd130('0x34'))){_0x37fa20['limit']=qs['limit'](_0x1e04d4[_0xd130('0x2e')]['limit']);_0x37fa20['offset']=qs[_0xd130('0x18')](_0x1e04d4[_0xd130('0x2e')][_0xd130('0x18')]);}_0x37fa20[_0xd130('0x5c')]=qs[_0xd130('0x35')](_0x1e04d4[_0xd130('0x2e')][_0xd130('0x35')]);_0x37fa20['where']=qs[_0xd130('0x38')](_[_0xd130('0x37')](_0x1e04d4[_0xd130('0x2e')],_0x4b480b[_0xd130('0x38')]));_0x37fa20[_0xd130('0x36')][_0xd130('0x59')]=_0x46e36e['id'];if(_0x1e04d4[_0xd130('0x2e')][_0xd130('0x39')]){_0x37fa20[_0xd130('0x36')]=_[_0xd130('0x3c')](_0x37fa20[_0xd130('0x36')],{'$or':_['map'](_0x37fa20[_0xd130('0x30')],function(_0x1b50a0){var _0x99ad05={};_0x99ad05[_0x1b50a0]={'$like':'%'+_0x1e04d4[_0xd130('0x2e')][_0xd130('0x39')]+'%'};return _0x99ad05;})});}_0x37fa20=_[_0xd130('0x3c')]({},_0x37fa20,_0x1e04d4[_0xd130('0x3d')]);return db[_0xd130('0x5f')]['count']({'where':_0x37fa20['where']})[_0xd130('0x22')](function(_0x2f7f1b){_0x27833e['count']=_0x2f7f1b;if(_0x1e04d4[_0xd130('0x2e')]['includeAll']){_0x37fa20[_0xd130('0x46')]=[{'all':!![]}];}return db[_0xd130('0x5f')][_0xd130('0x40')](_0x37fa20);})['then'](function(_0x229051){_0x27833e['rows']=_0x229051;return _0x27833e;});}})[_0xd130('0x22')](respondWithFilteredResult(_0x49a0dc,_0x37fa20))[_0xd130('0x42')](handleError(_0x49a0dc,null));};exports[_0xd130('0x60')]=function(_0x38b705,_0x446322,_0x24b442){var _0x2a484c={};var _0x2347e0={};var _0x45e088;var _0x511b93;return db[_0xd130('0x3e')]['findOne']({'where':{'id':_0x38b705[_0xd130('0x44')]['id']}})[_0xd130('0x22')](handleEntityNotFound(_0x446322,null))[_0xd130('0x22')](function(_0x249eef){if(_0x249eef){_0x45e088=_0x249eef;_0x2347e0[_0xd130('0x2d')]=_[_0xd130('0x45')](db['CmList']['rawAttributes']);_0x2347e0[_0xd130('0x2e')]=_[_0xd130('0x45')](_0x38b705['query']);_0x2347e0[_0xd130('0x38')]=_[_0xd130('0x2f')](_0x2347e0[_0xd130('0x2d')],_0x2347e0[_0xd130('0x2e')]);_0x2a484c[_0xd130('0x30')]=_['intersection'](_0x2347e0[_0xd130('0x2d')],qs[_0xd130('0x31')](_0x38b705[_0xd130('0x2e')][_0xd130('0x31')]));_0x2a484c['attributes']=_0x2a484c[_0xd130('0x30')][_0xd130('0x32')]?_0x2a484c[_0xd130('0x30')]:_0x2347e0[_0xd130('0x2d')];_0x2a484c[_0xd130('0x5c')]=qs[_0xd130('0x35')](_0x38b705[_0xd130('0x2e')]['sort']);_0x2a484c['where']=qs[_0xd130('0x38')](_[_0xd130('0x37')](_0x38b705[_0xd130('0x2e')],_0x2347e0['filters']));if(_0x38b705['query'][_0xd130('0x39')]){_0x2a484c[_0xd130('0x36')]=_[_0xd130('0x3c')](_0x2a484c[_0xd130('0x36')],{'$or':_[_0xd130('0x29')](_0x2a484c[_0xd130('0x30')],function(_0x548809){var _0x522fda={};_0x522fda[_0x548809]={'$like':'%'+_0x38b705[_0xd130('0x2e')][_0xd130('0x39')]+'%'};return _0x522fda;})});}_0x2a484c=_[_0xd130('0x3c')]({},_0x2a484c,_0x38b705[_0xd130('0x3d')]);return _0x45e088['getLists'](_0x2a484c);}})[_0xd130('0x22')](function(_0x15e63b){if(_0x15e63b){_0x511b93=_0x15e63b[_0xd130('0x32')];if(!_0x38b705[_0xd130('0x2e')][_0xd130('0x33')](_0xd130('0x34'))){_0x2a484c[_0xd130('0x1a')]=qs[_0xd130('0x1a')](_0x38b705[_0xd130('0x2e')][_0xd130('0x1a')]);_0x2a484c['offset']=qs[_0xd130('0x18')](_0x38b705['query'][_0xd130('0x18')]);}return _0x45e088[_0xd130('0x60')](_0x2a484c);}})[_0xd130('0x22')](function(_0x23bf5a){if(_0x23bf5a){return _0x23bf5a?{'count':_0x511b93,'rows':_0x23bf5a}:null;}})[_0xd130('0x22')](respondWithResult(_0x446322,null))['catch'](handleError(_0x446322,null));};exports['addLists']=function(_0x4ca984,_0x3ab103,_0x30492){var _0x34122c,_0x8a7ba9;return db[_0xd130('0x3e')][_0xd130('0x47')]({'where':{'id':_0x4ca984['params']['id']}})['then'](handleEntityNotFound(_0x3ab103,null))[_0xd130('0x22')](function(_0x2d971c){if(_0x2d971c){_0x8a7ba9=_0x2d971c;return _0x2d971c[_0xd130('0x61')](_0x4ca984['body'][_0xd130('0x62')],_[_0xd130('0x54')](_0x4ca984['body'],[_0xd130('0x62'),'id'])||{});}return null;})[_0xd130('0x63')](function(_0x37fcca){var _0x2f2848;_0x34122c=_0x37fcca||[];var _0x59d18b=[];if(_0x37fcca){for(var _0xf65d48=0x0;_0xf65d48<_0x37fcca[_0xd130('0x32')];_0xf65d48+=0x1){var _0x3ff20a=_0x37fcca[_0xf65d48]['get']({'plain':!![]});_0x8a7ba9['dialCheckDuplicateType']=_0x4ca984[_0xd130('0x53')][_0xd130('0x64')]?_0x4ca984['body'][_0xd130('0x64')]:_0x8a7ba9[_0xd130('0x64')];switch(_0x8a7ba9[_0xd130('0x64')]){case _0xd130('0x65'):_0x2f2848=squel[_0xd130('0x66')]()[_0xd130('0x67')](_0xd130('0x68'))[_0xd130('0x69')]([_0xd130('0x6a'),'scheduledAt',_0xd130('0x6b'),_0xd130('0x6c'),_0xd130('0x59'),_0xd130('0x51'),_0xd130('0x52')],squel[_0xd130('0x6d')]()[_0xd130('0x6e')](_0xd130('0x6a'),'phone')[_0xd130('0x6e')]('NOW()',_0xd130('0x6f'))['field']('id',_0xd130('0x6b'))[_0xd130('0x6e')](_0x3ff20a['CmListId'][_0xd130('0x70')](),_0xd130('0x6c'))[_0xd130('0x6e')](_0x4ca984[_0xd130('0x44')]['id']['toString'](),_0xd130('0x59'))['field'](_0xd130('0x71'),_0xd130('0x51'))[_0xd130('0x6e')]('NOW()',_0xd130('0x52'))[_0xd130('0x72')](_0xd130('0x73'))['where'](_0xd130('0x74'))['where'](_0xd130('0x75'),_0x3ff20a[_0xd130('0x76')][_0xd130('0x70')]())['where'](_0xd130('0x77'))[_0xd130('0x36')](_0xd130('0x78'),squel[_0xd130('0x6d')]()['field'](_0xd130('0x79'))['from']('cm_hopper_final')[_0xd130('0x36')](_0xd130('0x7a'),_0x4ca984[_0xd130('0x44')]['id'][_0xd130('0x70')]()))[_0xd130('0x36')](_0xd130('0x78'),squel[_0xd130('0x6d')]()['field'](_0xd130('0x7b'))[_0xd130('0x72')](_0xd130('0x68'))['where'](_0xd130('0x7a'),_0x4ca984[_0xd130('0x44')]['id'][_0xd130('0x70')]())))[_0xd130('0x70')]();break;case _0xd130('0x7c'):_0x2f2848=squel[_0xd130('0x66')]()[_0xd130('0x67')](_0xd130('0x68'))[_0xd130('0x69')]([_0xd130('0x6a'),_0xd130('0x6f'),_0xd130('0x6b'),_0xd130('0x6c'),_0xd130('0x59'),'createdAt',_0xd130('0x52')],squel[_0xd130('0x6d')]()[_0xd130('0x6e')]('phone',_0xd130('0x6a'))[_0xd130('0x6e')]('NOW()',_0xd130('0x6f'))['field']('id',_0xd130('0x6b'))[_0xd130('0x6e')](_0x3ff20a[_0xd130('0x76')][_0xd130('0x70')](),'ListId')['field'](_0x4ca984[_0xd130('0x44')]['id']['toString'](),_0xd130('0x59'))[_0xd130('0x6e')](_0xd130('0x71'),_0xd130('0x51'))[_0xd130('0x6e')](_0xd130('0x71'),'updatedAt')[_0xd130('0x72')](_0xd130('0x73'))[_0xd130('0x36')](_0xd130('0x74'))[_0xd130('0x36')](_0xd130('0x75'),_0x3ff20a['CmListId'][_0xd130('0x70')]())['where']('phone\x20IS\x20NOT\x20NULL')[_0xd130('0x36')](_0xd130('0x78'),squel[_0xd130('0x6d')]()[_0xd130('0x6e')]('COALESCE(phone,\x27\x27)')['from'](_0xd130('0x68'))[_0xd130('0x36')](_0xd130('0x7a'),_0x4ca984[_0xd130('0x44')]['id'][_0xd130('0x70')]())))['toString']();break;default:_0x2f2848=squel[_0xd130('0x66')]()[_0xd130('0x67')]('cm_hopper')[_0xd130('0x69')]([_0xd130('0x6a'),_0xd130('0x6f'),_0xd130('0x6b'),_0xd130('0x6c'),'CampaignId',_0xd130('0x51'),_0xd130('0x52')],squel[_0xd130('0x6d')]()[_0xd130('0x6e')]('phone',_0xd130('0x6a'))[_0xd130('0x6e')](_0xd130('0x71'),'scheduledAt')[_0xd130('0x6e')]('id',_0xd130('0x6b'))[_0xd130('0x6e')](_0x3ff20a[_0xd130('0x76')][_0xd130('0x70')](),_0xd130('0x6c'))[_0xd130('0x6e')](_0x4ca984[_0xd130('0x44')]['id'][_0xd130('0x70')](),'CampaignId')[_0xd130('0x6e')](_0xd130('0x71'),_0xd130('0x51'))['field'](_0xd130('0x71'),_0xd130('0x52'))['from'](_0xd130('0x73'))['where']('deletedAt\x20IS\x20NULL')[_0xd130('0x36')](_0xd130('0x75'),_0x3ff20a[_0xd130('0x76')][_0xd130('0x70')]())[_0xd130('0x36')]('phone\x20IS\x20NOT\x20NULL'))[_0xd130('0x70')]();}_0x59d18b[_0xd130('0x7d')](db[_0xd130('0x7e')][_0xd130('0x2e')](_0x2f2848));}return BPromise[_0xd130('0x7f')](_0x59d18b);}})[_0xd130('0x22')](function(){return _0x34122c;})[_0xd130('0x22')](respondWithResult(_0x3ab103,null))[_0xd130('0x42')](handleError(_0x3ab103,null));};exports[_0xd130('0x80')]=function(_0xe34932,_0x36e3ce,_0x2f1a71){return db[_0xd130('0x3e')][_0xd130('0x47')]({'where':{'id':_0xe34932[_0xd130('0x44')]['id']}})[_0xd130('0x22')](handleEntityNotFound(_0x36e3ce,null))[_0xd130('0x22')](function(_0x15c756){if(_0x15c756){return _0x15c756[_0xd130('0x80')](_0xe34932[_0xd130('0x2e')][_0xd130('0x62')]);}})['then'](function(_0x115cb5){if(_0x115cb5){return db['CmHopper'][_0xd130('0x23')]({'where':{'ListId':_0xe34932[_0xd130('0x2e')][_0xd130('0x62')],'CampaignId':_0xe34932[_0xd130('0x44')]['id']}})[_0xd130('0x22')](function(){return _0x115cb5;});}})[_0xd130('0x22')](respondWithStatusCode(_0x36e3ce,null))[_0xd130('0x42')](handleError(_0x36e3ce,null));};exports['getBlackLists']=function(_0x345164,_0x293e03,_0x32755c){var _0x540dbc={};var _0x206c23={};var _0xdcd2ec;var _0x413bb9;return db[_0xd130('0x3e')]['findOne']({'where':{'id':_0x345164[_0xd130('0x44')]['id']}})[_0xd130('0x22')](handleEntityNotFound(_0x293e03,null))['then'](function(_0x56401d){if(_0x56401d){_0xdcd2ec=_0x56401d;_0x206c23[_0xd130('0x2d')]=_['keys'](db['CmList'][_0xd130('0x2a')]);_0x206c23[_0xd130('0x2e')]=_[_0xd130('0x45')](_0x345164[_0xd130('0x2e')]);_0x206c23[_0xd130('0x38')]=_['intersection'](_0x206c23[_0xd130('0x2d')],_0x206c23['query']);_0x540dbc['attributes']=_['intersection'](_0x206c23[_0xd130('0x2d')],qs[_0xd130('0x31')](_0x345164[_0xd130('0x2e')][_0xd130('0x31')]));_0x540dbc[_0xd130('0x30')]=_0x540dbc[_0xd130('0x30')][_0xd130('0x32')]?_0x540dbc[_0xd130('0x30')]:_0x206c23[_0xd130('0x2d')];_0x540dbc[_0xd130('0x5c')]=qs['sort'](_0x345164['query']['sort']);_0x540dbc[_0xd130('0x36')]=qs[_0xd130('0x38')](_['pick'](_0x345164[_0xd130('0x2e')],_0x206c23['filters']));if(_0x345164['query'][_0xd130('0x39')]){_0x540dbc[_0xd130('0x36')]=_[_0xd130('0x3c')](_0x540dbc['where'],{'$or':_[_0xd130('0x29')](_0x540dbc['attributes'],function(_0x2ecbfe){var _0x2757dc={};_0x2757dc[_0x2ecbfe]={'$like':'%'+_0x345164[_0xd130('0x2e')][_0xd130('0x39')]+'%'};return _0x2757dc;})});}_0x540dbc=_[_0xd130('0x3c')]({},_0x540dbc,_0x345164[_0xd130('0x3d')]);return _0xdcd2ec[_0xd130('0x81')](_0x540dbc);}})[_0xd130('0x22')](function(_0x50170c){if(_0x50170c){_0x413bb9=_0x50170c['length'];if(!_0x345164['query'][_0xd130('0x33')](_0xd130('0x34'))){_0x540dbc['limit']=qs[_0xd130('0x1a')](_0x345164['query'][_0xd130('0x1a')]);_0x540dbc[_0xd130('0x18')]=qs[_0xd130('0x18')](_0x345164[_0xd130('0x2e')]['offset']);}return _0xdcd2ec[_0xd130('0x81')](_0x540dbc);}})[_0xd130('0x22')](function(_0xd7fc21){if(_0xd7fc21){return _0xd7fc21?{'count':_0x413bb9,'rows':_0xd7fc21}:null;}})[_0xd130('0x22')](respondWithResult(_0x293e03,null))[_0xd130('0x42')](handleError(_0x293e03,null));};exports[_0xd130('0x82')]=function(_0x4f8d48,_0xd049d2,_0x148b61){var _0x17e0ae,_0x129d94;return db[_0xd130('0x3e')][_0xd130('0x47')]({'where':{'id':_0x4f8d48['params']['id']}})[_0xd130('0x22')](handleEntityNotFound(_0xd049d2,null))[_0xd130('0x22')](function(_0x428141){if(_0x428141){_0x129d94=_0x428141;return _0x428141[_0xd130('0x82')](_0x4f8d48['body'][_0xd130('0x62')],_['omit'](_0x4f8d48[_0xd130('0x53')],[_0xd130('0x62'),'id'])||{});}return null;})['spread'](function(_0x169966){var _0x23479d;_0x17e0ae=_0x169966||[];var _0x5d7539=[];if(_0x169966){for(var _0x42a085=0x0;_0x42a085<_0x169966[_0xd130('0x32')];_0x42a085+=0x1){var _0x4a321b=_0x169966[_0x42a085][_0xd130('0x4a')]({'plain':!![]});_0x23479d=squel[_0xd130('0x66')]()[_0xd130('0x67')](_0xd130('0x83'))[_0xd130('0x69')]([_0xd130('0x6a'),_0xd130('0x6b'),_0xd130('0x6c'),_0xd130('0x59'),_0xd130('0x51'),'updatedAt'],squel[_0xd130('0x6d')]()[_0xd130('0x6e')](_0xd130('0x6a'),_0xd130('0x6a'))['field']('id',_0xd130('0x6b'))[_0xd130('0x6e')](_0x4a321b['CmListId'][_0xd130('0x70')](),_0xd130('0x6c'))['field'](_0x4f8d48['params']['id'][_0xd130('0x70')](),_0xd130('0x59'))[_0xd130('0x6e')](_0xd130('0x71'),_0xd130('0x51'))[_0xd130('0x6e')]('NOW()',_0xd130('0x52'))[_0xd130('0x72')](_0xd130('0x73'))[_0xd130('0x36')](_0xd130('0x74'))['where']('ListId\x20=\x20?',_0x4a321b['CmListId'][_0xd130('0x70')]())[_0xd130('0x36')](_0xd130('0x77')))[_0xd130('0x70')]();_0x5d7539[_0xd130('0x7d')](db[_0xd130('0x7e')][_0xd130('0x2e')](_0x23479d));}return BPromise[_0xd130('0x7f')](_0x5d7539);}})[_0xd130('0x22')](function(){return _0x17e0ae;})[_0xd130('0x22')](respondWithResult(_0xd049d2,null))[_0xd130('0x42')](handleError(_0xd049d2,null));};exports[_0xd130('0x84')]=function(_0x40fee1,_0x1314f6,_0x4ffde5){return db[_0xd130('0x3e')][_0xd130('0x47')]({'where':{'id':_0x40fee1['params']['id']}})['then'](handleEntityNotFound(_0x1314f6,null))['then'](function(_0x18cfba){if(_0x18cfba){return _0x18cfba[_0xd130('0x84')](_0x40fee1[_0xd130('0x2e')][_0xd130('0x62')]);}})['then'](function(_0x2d1eb9){if(_0x2d1eb9){return db[_0xd130('0x5f')][_0xd130('0x23')]({'where':{'ListId':_0x40fee1[_0xd130('0x2e')]['ids'],'CampaignId':_0x40fee1[_0xd130('0x44')]['id']}})[_0xd130('0x22')](function(){return _0x2d1eb9;});}})[_0xd130('0x22')](respondWithStatusCode(_0x1314f6,null))[_0xd130('0x42')](handleError(_0x1314f6,null));}; \ No newline at end of file +var _0x8b74=['sequelize','all','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','count','offset','limit','set','update','then','destroy','get','IvrCampaigns','UserProfileResource','sendStatus','stack','name','send','map','Campaign','fieldName','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','keys','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','autoAssociation','clone','params','omit','createdAt','updatedAt','role','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getHoppers','CmHopper','rawAttributes','CampaignId','rows','findOne','CmHopperHistory','getHopperFinals','CmHopperFinal','CmHopperBlack','getLists','CmList','addLists','ids','dialCheckDuplicateType','always','insert','fromQuery','phone','scheduledAt','ContactId','select','field','NOW()','CmListId','toString','ListId','from','cm_contacts','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','COALESCE(phone,\x27\x27)','cm_hopper','CampaignId\x20=\x20?','into','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','push'];(function(_0x466247,_0x5d69e3){var _0x4b352e=function(_0x58c71b){while(--_0x58c71b){_0x466247['push'](_0x466247['shift']());}};_0x4b352e(++_0x5d69e3);}(_0x8b74,0x18c));var _0x48b7=function(_0x44ef08,_0x378fb5){_0x44ef08=_0x44ef08-0x0;var _0x124aa4=_0x8b74[_0x44ef08];return _0x124aa4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x48b7('0x0'));var zipdir=require(_0x48b7('0x1'));var jsonpatch=require(_0x48b7('0x2'));var rp=require(_0x48b7('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x48b7('0x4'));var util=require(_0x48b7('0x5'));var path=require(_0x48b7('0x6'));var sox=require('sox');var csv=require(_0x48b7('0x7'));var ejs=require(_0x48b7('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x48b7('0x9'));var squel=require(_0x48b7('0xa'));var crypto=require(_0x48b7('0xb'));var jsforce=require(_0x48b7('0xc'));var deskjs=require(_0x48b7('0xd'));var toCsv=require(_0x48b7('0x7'));var querystring=require(_0x48b7('0xe'));var Papa=require(_0x48b7('0xf'));var Redis=require('ioredis');var authService=require(_0x48b7('0x10'));var qs=require(_0x48b7('0x11'));var as=require(_0x48b7('0x12'));var hardwareService=require(_0x48b7('0x13'));var logger=require(_0x48b7('0x14'))(_0x48b7('0x15'));var utils=require(_0x48b7('0x16'));var config=require(_0x48b7('0x17'));var licenseUtil=require(_0x48b7('0x18'));var db=require(_0x48b7('0x19'))['db'];function respondWithStatusCode(_0x50306f,_0x2c5c1f){_0x2c5c1f=_0x2c5c1f||0xcc;return function(_0x4a5ad3){if(_0x4a5ad3){return _0x50306f['sendStatus'](_0x2c5c1f);}return _0x50306f[_0x48b7('0x1a')](_0x2c5c1f)[_0x48b7('0x1b')]();};}function respondWithResult(_0x31dfc2,_0x5379ab){_0x5379ab=_0x5379ab||0xc8;return function(_0x2c9da5){if(_0x2c9da5){return _0x31dfc2['status'](_0x5379ab)[_0x48b7('0x1c')](_0x2c9da5);}};}function respondWithFilteredResult(_0x1cdc2f,_0x32c6da){return function(_0x581d22){if(_0x581d22){var _0x4d5137=typeof _0x32c6da['offset']==='undefined'&&typeof _0x32c6da['limit']===_0x48b7('0x1d');var _0x2e19d7=_0x581d22[_0x48b7('0x1e')];var _0x63a8e8=_0x4d5137?0x0:_0x32c6da[_0x48b7('0x1f')];var _0x34ec4a=_0x4d5137?_0x581d22[_0x48b7('0x1e')]:_0x32c6da[_0x48b7('0x1f')]+_0x32c6da[_0x48b7('0x20')];var _0x27d820;if(_0x34ec4a>=_0x2e19d7){_0x34ec4a=_0x2e19d7;_0x27d820=0xc8;}else{_0x27d820=0xce;}_0x1cdc2f[_0x48b7('0x1a')](_0x27d820);return _0x1cdc2f[_0x48b7('0x21')]('Content-Range',_0x63a8e8+'-'+_0x34ec4a+'/'+_0x2e19d7)[_0x48b7('0x1c')](_0x581d22);}return null;};}function patchUpdates(_0x1bab60){return function(_0x1e9e06){try{jsonpatch['apply'](_0x1e9e06,_0x1bab60,!![]);}catch(_0x1175d8){return BPromise['reject'](_0x1175d8);}return _0x1e9e06['save']();};}function saveUpdates(_0x2cc278,_0x36a23d){return function(_0x81e310){if(_0x81e310){return _0x81e310[_0x48b7('0x22')](_0x2cc278)[_0x48b7('0x23')](function(_0x4e0e26){return _0x4e0e26;});}return null;};}function removeEntity(_0x185718,_0x230deb){return function(_0xfbe9a3){if(_0xfbe9a3){return _0xfbe9a3[_0x48b7('0x24')]()[_0x48b7('0x23')](function(){var _0x430d99=_0xfbe9a3[_0x48b7('0x25')]({'plain':!![]});var _0x4c4ced=_0x48b7('0x26');return db[_0x48b7('0x27')][_0x48b7('0x24')]({'where':{'type':_0x4c4ced,'resourceId':_0x430d99['id']}})[_0x48b7('0x23')](function(){return _0xfbe9a3;});})[_0x48b7('0x23')](function(){_0x185718['status'](0xcc)[_0x48b7('0x1b')]();});}};}function handleEntityNotFound(_0x5d82db,_0x49e09f){return function(_0x526a6d){if(!_0x526a6d){_0x5d82db[_0x48b7('0x28')](0x194);}return _0x526a6d;};}function handleError(_0x50c746,_0x38a6bd){_0x38a6bd=_0x38a6bd||0x1f4;return function(_0xe0b654){logger['error'](_0xe0b654[_0x48b7('0x29')]);if(_0xe0b654[_0x48b7('0x2a')]){delete _0xe0b654['name'];}_0x50c746[_0x48b7('0x1a')](_0x38a6bd)[_0x48b7('0x2b')](_0xe0b654);};}exports['index']=function(_0x11581b,_0x197b1f){var _0x1004e6={},_0x779ae1={},_0x1202d7={'count':0x0,'rows':[]};var _0x4f7271=_[_0x48b7('0x2c')](db[_0x48b7('0x2d')]['rawAttributes'],function(_0x4ec214){return{'name':_0x4ec214[_0x48b7('0x2e')],'type':_0x4ec214['type']['key']};});_0x779ae1[_0x48b7('0x2f')]=_['map'](_0x4f7271,_0x48b7('0x2a'));_0x779ae1['query']=_['keys'](_0x11581b[_0x48b7('0x30')]);_0x779ae1[_0x48b7('0x31')]=_[_0x48b7('0x32')](_0x779ae1[_0x48b7('0x2f')],_0x779ae1[_0x48b7('0x30')]);_0x1004e6[_0x48b7('0x33')]=_[_0x48b7('0x32')](_0x779ae1[_0x48b7('0x2f')],qs[_0x48b7('0x34')](_0x11581b['query'][_0x48b7('0x34')]));_0x1004e6[_0x48b7('0x33')]=_0x1004e6[_0x48b7('0x33')][_0x48b7('0x35')]?_0x1004e6['attributes']:_0x779ae1[_0x48b7('0x2f')];if(!_0x11581b['query'][_0x48b7('0x36')](_0x48b7('0x37'))){_0x1004e6[_0x48b7('0x20')]=qs[_0x48b7('0x20')](_0x11581b[_0x48b7('0x30')][_0x48b7('0x20')]);_0x1004e6[_0x48b7('0x1f')]=qs[_0x48b7('0x1f')](_0x11581b['query'][_0x48b7('0x1f')]);}_0x1004e6[_0x48b7('0x38')]=qs[_0x48b7('0x39')](_0x11581b[_0x48b7('0x30')][_0x48b7('0x39')]);_0x1004e6[_0x48b7('0x3a')]=qs[_0x48b7('0x31')](_[_0x48b7('0x3b')](_0x11581b[_0x48b7('0x30')],_0x779ae1[_0x48b7('0x31')]),_0x4f7271);if(_0x11581b[_0x48b7('0x30')][_0x48b7('0x3c')]){_0x1004e6[_0x48b7('0x3a')]=_[_0x48b7('0x3d')](_0x1004e6['where'],{'$or':_['map'](_0x4f7271,function(_0x1a1742){if(_0x1a1742['type']!==_0x48b7('0x3e')){var _0x643f7f={};_0x643f7f[_0x1a1742[_0x48b7('0x2a')]]={'$like':'%'+_0x11581b[_0x48b7('0x30')][_0x48b7('0x3c')]+'%'};return _0x643f7f;}})});}_0x1004e6=_[_0x48b7('0x3d')]({},_0x1004e6,_0x11581b[_0x48b7('0x3f')]);var _0x1976ec={'where':_0x1004e6['where']};return db[_0x48b7('0x2d')][_0x48b7('0x1e')](_0x1976ec)['then'](function(_0x554899){_0x1202d7[_0x48b7('0x1e')]=_0x554899;if(_0x11581b[_0x48b7('0x30')][_0x48b7('0x40')]){_0x1004e6[_0x48b7('0x41')]=[{'all':!![]}];}return db[_0x48b7('0x2d')][_0x48b7('0x42')](_0x1004e6);})['then'](function(_0x2421e2){_0x1202d7['rows']=_0x2421e2;return _0x1202d7;})[_0x48b7('0x23')](respondWithFilteredResult(_0x197b1f,_0x1004e6))[_0x48b7('0x43')](handleError(_0x197b1f,null));};exports['show']=function(_0x10790d,_0x363b0a){var _0x3184f4={'raw':![],'where':{'id':_0x10790d['params']['id']}},_0x57f3be={};_0x57f3be['model']=_[_0x48b7('0x44')](db[_0x48b7('0x2d')]['rawAttributes']);_0x57f3be['query']=_['keys'](_0x10790d[_0x48b7('0x30')]);_0x57f3be['filters']=_[_0x48b7('0x32')](_0x57f3be['model'],_0x57f3be['query']);_0x3184f4['attributes']=_[_0x48b7('0x32')](_0x57f3be[_0x48b7('0x2f')],qs['fields'](_0x10790d[_0x48b7('0x30')][_0x48b7('0x34')]));_0x3184f4[_0x48b7('0x33')]=_0x3184f4[_0x48b7('0x33')][_0x48b7('0x35')]?_0x3184f4[_0x48b7('0x33')]:_0x57f3be['model'];if(_0x10790d['query'][_0x48b7('0x40')]){_0x3184f4[_0x48b7('0x41')]=[{'all':!![]}];}_0x3184f4=_[_0x48b7('0x3d')]({},_0x3184f4,_0x10790d[_0x48b7('0x3f')]);return db[_0x48b7('0x2d')]['find'](_0x3184f4)[_0x48b7('0x23')](handleEntityNotFound(_0x363b0a,null))[_0x48b7('0x23')](respondWithResult(_0x363b0a,null))[_0x48b7('0x43')](handleError(_0x363b0a,null));};exports[_0x48b7('0x45')]=function(_0x4451b9,_0x2c5919){return db[_0x48b7('0x2d')][_0x48b7('0x45')](_0x4451b9[_0x48b7('0x46')],{})[_0x48b7('0x23')](function(_0x17cbfb){var _0x3334dd=_0x4451b9[_0x48b7('0x47')][_0x48b7('0x25')]({'plain':!![]});if(!_0x3334dd)throw new Error(_0x48b7('0x48'));if(_0x3334dd['role']===_0x48b7('0x47')){var _0xf2a830=_0x17cbfb[_0x48b7('0x25')]({'plain':!![]});var _0x2ce192=_0x48b7('0x26');return db[_0x48b7('0x49')][_0x48b7('0x4a')]({'where':{'name':_0x2ce192,'userProfileId':_0x3334dd['userProfileId']},'raw':!![]})[_0x48b7('0x23')](function(_0x2e003c){if(_0x2e003c&&_0x2e003c[_0x48b7('0x4b')]===0x0){return db[_0x48b7('0x27')]['create']({'name':_0xf2a830[_0x48b7('0x2a')],'resourceId':_0xf2a830['id'],'type':_0x2e003c['name'],'sectionId':_0x2e003c['id']},{})[_0x48b7('0x23')](function(){return _0x17cbfb;});}else{return _0x17cbfb;}})[_0x48b7('0x43')](function(_0x4426f4){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4426f4);throw _0x4426f4;});}return _0x17cbfb;})[_0x48b7('0x23')](respondWithResult(_0x2c5919,0xc9))[_0x48b7('0x43')](handleError(_0x2c5919,null));};exports[_0x48b7('0x4c')]=function(_0x2880be,_0x32f2db){var _0x9f04d9={'where':{'id':_0x2880be[_0x48b7('0x4d')]['id']}},_0x5b0b9e={};_0x5b0b9e[_0x48b7('0x2f')]=_[_0x48b7('0x44')](db[_0x48b7('0x2d')]['rawAttributes']);_0x9f04d9['attributes']=_['intersection'](_0x5b0b9e[_0x48b7('0x2f')],qs['fields'](_0x2880be[_0x48b7('0x30')][_0x48b7('0x34')]));_0x9f04d9[_0x48b7('0x33')]=_0x9f04d9[_0x48b7('0x33')][_0x48b7('0x35')]?_0x9f04d9[_0x48b7('0x33')]:_0x5b0b9e[_0x48b7('0x2f')];if(_0x2880be[_0x48b7('0x30')]['includeAll']){_0x9f04d9['include']=[{'all':!![]}];}_0x9f04d9=_[_0x48b7('0x3d')]({},_0x9f04d9,_0x2880be['options']);return db['Campaign']['find'](_0x9f04d9)[_0x48b7('0x23')](handleEntityNotFound(_0x32f2db,null))['then'](function(_0x56c2ca){if(_0x56c2ca){var _0x2fd7c2=_0x56c2ca[_0x48b7('0x25')]({'plain':!![]});_0x2fd7c2=qs[_0x48b7('0x4e')](_0x2fd7c2,['id',_0x48b7('0x4f'),'updatedAt']);_0x2880be[_0x48b7('0x46')]=_[_0x48b7('0x4e')](_0x2880be['body'],['id',_0x48b7('0x4f'),_0x48b7('0x50')]);return db[_0x48b7('0x2d')][_0x48b7('0x45')](_[_0x48b7('0x3d')](_0x2fd7c2,_0x2880be[_0x48b7('0x46')]),{'include':_0x2880be[_0x48b7('0x30')]['includeAll']?[{'all':!![]}]:undefined})[_0x48b7('0x23')](function(_0x393091){var _0x3f1ac5=_0x2880be['user'][_0x48b7('0x25')]({'plain':!![]});if(!_0x3f1ac5)throw new Error(_0x48b7('0x48'));if(_0x3f1ac5[_0x48b7('0x51')]===_0x48b7('0x47')){var _0x44fd52=_0x393091[_0x48b7('0x25')]({'plain':!![]});var _0x3036db=_0x48b7('0x26');return db['UserProfileSection']['find']({'where':{'name':_0x3036db,'userProfileId':_0x3f1ac5['userProfileId']},'raw':!![]})[_0x48b7('0x23')](function(_0x58901d){if(_0x58901d&&_0x58901d[_0x48b7('0x4b')]===0x0){return db[_0x48b7('0x27')][_0x48b7('0x45')]({'name':_0x44fd52[_0x48b7('0x2a')],'resourceId':_0x44fd52['id'],'type':_0x58901d[_0x48b7('0x2a')],'sectionId':_0x58901d['id']},{})['then'](function(){return _0x393091;});}else{return _0x393091;}})[_0x48b7('0x43')](function(_0x34587c){logger[_0x48b7('0x52')](_0x48b7('0x53'),_0x34587c);throw _0x34587c;});}return _0x393091;});}})['then'](respondWithResult(_0x32f2db,0xc9))[_0x48b7('0x43')](handleError(_0x32f2db,null));};exports[_0x48b7('0x22')]=function(_0x47c8da,_0x1c6fec){if(_0x47c8da[_0x48b7('0x46')]['id']){delete _0x47c8da['body']['id'];}return db[_0x48b7('0x2d')][_0x48b7('0x4a')]({'where':{'id':_0x47c8da['params']['id']}})[_0x48b7('0x23')](handleEntityNotFound(_0x1c6fec,null))[_0x48b7('0x23')](saveUpdates(_0x47c8da[_0x48b7('0x46')],null))[_0x48b7('0x23')](respondWithResult(_0x1c6fec,null))[_0x48b7('0x43')](handleError(_0x1c6fec,null));};exports[_0x48b7('0x24')]=function(_0x4e136c,_0x446803){return db['Campaign'][_0x48b7('0x4a')]({'where':{'id':_0x4e136c['params']['id']}})[_0x48b7('0x23')](handleEntityNotFound(_0x446803,null))[_0x48b7('0x23')](removeEntity(_0x446803,null))[_0x48b7('0x43')](handleError(_0x446803,null));};exports[_0x48b7('0x54')]=function(_0x526804,_0x396ba4,_0x1c3165){var _0x47564f={'raw':!![],'where':{}};var _0x2ecdb4={};var _0x5774df={'count':0x0,'rows':[]};return db[_0x48b7('0x2d')]['findOne']({'where':{'id':_0x526804[_0x48b7('0x4d')]['id']}})[_0x48b7('0x23')](handleEntityNotFound(_0x396ba4,null))['then'](function(_0x5ef72d){if(_0x5ef72d){_0x2ecdb4[_0x48b7('0x2f')]=_[_0x48b7('0x44')](db[_0x48b7('0x55')][_0x48b7('0x56')]);_0x2ecdb4['query']=_[_0x48b7('0x44')](_0x526804['query']);_0x2ecdb4['filters']=_[_0x48b7('0x32')](_0x2ecdb4[_0x48b7('0x2f')],_0x2ecdb4[_0x48b7('0x30')]);_0x47564f[_0x48b7('0x33')]=_[_0x48b7('0x32')](_0x2ecdb4[_0x48b7('0x2f')],qs[_0x48b7('0x34')](_0x526804['query'][_0x48b7('0x34')]));_0x47564f['attributes']=_0x47564f[_0x48b7('0x33')][_0x48b7('0x35')]?_0x47564f[_0x48b7('0x33')]:_0x2ecdb4[_0x48b7('0x2f')];if(!_0x526804[_0x48b7('0x30')][_0x48b7('0x36')](_0x48b7('0x37'))){_0x47564f[_0x48b7('0x20')]=qs[_0x48b7('0x20')](_0x526804[_0x48b7('0x30')][_0x48b7('0x20')]);_0x47564f[_0x48b7('0x1f')]=qs[_0x48b7('0x1f')](_0x526804[_0x48b7('0x30')][_0x48b7('0x1f')]);}_0x47564f['order']=qs[_0x48b7('0x39')](_0x526804['query'][_0x48b7('0x39')]);_0x47564f['where']=qs['filters'](_[_0x48b7('0x3b')](_0x526804['query'],_0x2ecdb4[_0x48b7('0x31')]));_0x47564f['where'][_0x48b7('0x57')]=_0x5ef72d['id'];if(_0x526804['query']['filter']){_0x47564f[_0x48b7('0x3a')]=_[_0x48b7('0x3d')](_0x47564f[_0x48b7('0x3a')],{'$or':_['map'](_0x47564f[_0x48b7('0x33')],function(_0x14fc81){var _0x18688a={};_0x18688a[_0x14fc81]={'$like':'%'+_0x526804['query'][_0x48b7('0x3c')]+'%'};return _0x18688a;})});}_0x47564f=_['merge']({},_0x47564f,_0x526804['options']);return db[_0x48b7('0x55')][_0x48b7('0x1e')]({'where':_0x47564f[_0x48b7('0x3a')]})[_0x48b7('0x23')](function(_0x4aa232){_0x5774df[_0x48b7('0x1e')]=_0x4aa232;if(_0x526804[_0x48b7('0x30')][_0x48b7('0x40')]){_0x47564f[_0x48b7('0x41')]=[{'all':!![]}];}return db['CmHopper'][_0x48b7('0x42')](_0x47564f);})['then'](function(_0xf6b77e){_0x5774df[_0x48b7('0x58')]=_0xf6b77e;return _0x5774df;});}})[_0x48b7('0x23')](respondWithFilteredResult(_0x396ba4,_0x47564f))['catch'](handleError(_0x396ba4,null));};exports['getHopperHistories']=function(_0xdcc0a5,_0x22d450,_0x1933dd){var _0x311936={'raw':!![],'where':{}};var _0xf75db7={};var _0x4e0fec={'count':0x0,'rows':[]};return db[_0x48b7('0x2d')][_0x48b7('0x59')]({'where':{'id':_0xdcc0a5[_0x48b7('0x4d')]['id']}})[_0x48b7('0x23')](handleEntityNotFound(_0x22d450,null))['then'](function(_0x2a71a9){if(_0x2a71a9){_0xf75db7[_0x48b7('0x2f')]=_[_0x48b7('0x44')](db[_0x48b7('0x5a')][_0x48b7('0x56')]);_0xf75db7[_0x48b7('0x30')]=_[_0x48b7('0x44')](_0xdcc0a5['query']);_0xf75db7[_0x48b7('0x31')]=_[_0x48b7('0x32')](_0xf75db7['model'],_0xf75db7['query']);_0x311936[_0x48b7('0x33')]=_[_0x48b7('0x32')](_0xf75db7[_0x48b7('0x2f')],qs[_0x48b7('0x34')](_0xdcc0a5[_0x48b7('0x30')][_0x48b7('0x34')]));_0x311936[_0x48b7('0x33')]=_0x311936[_0x48b7('0x33')]['length']?_0x311936[_0x48b7('0x33')]:_0xf75db7[_0x48b7('0x2f')];if(!_0xdcc0a5['query'][_0x48b7('0x36')](_0x48b7('0x37'))){_0x311936['limit']=qs[_0x48b7('0x20')](_0xdcc0a5[_0x48b7('0x30')]['limit']);_0x311936['offset']=qs[_0x48b7('0x1f')](_0xdcc0a5[_0x48b7('0x30')][_0x48b7('0x1f')]);}_0x311936[_0x48b7('0x38')]=qs['sort'](_0xdcc0a5[_0x48b7('0x30')][_0x48b7('0x39')]);_0x311936[_0x48b7('0x3a')]=qs[_0x48b7('0x31')](_['pick'](_0xdcc0a5['query'],_0xf75db7['filters']));_0x311936[_0x48b7('0x3a')][_0x48b7('0x57')]=_0x2a71a9['id'];if(_0xdcc0a5[_0x48b7('0x30')][_0x48b7('0x3c')]){_0x311936[_0x48b7('0x3a')]=_['merge'](_0x311936[_0x48b7('0x3a')],{'$or':_[_0x48b7('0x2c')](_0x311936[_0x48b7('0x33')],function(_0x26c82c){var _0x2e65f2={};_0x2e65f2[_0x26c82c]={'$like':'%'+_0xdcc0a5['query'][_0x48b7('0x3c')]+'%'};return _0x2e65f2;})});}_0x311936=_[_0x48b7('0x3d')]({},_0x311936,_0xdcc0a5['options']);return db[_0x48b7('0x5a')][_0x48b7('0x1e')]({'where':_0x311936['where']})[_0x48b7('0x23')](function(_0x4d21b9){_0x4e0fec[_0x48b7('0x1e')]=_0x4d21b9;if(_0xdcc0a5[_0x48b7('0x30')][_0x48b7('0x40')]){_0x311936[_0x48b7('0x41')]=[{'all':!![]}];}return db[_0x48b7('0x5a')][_0x48b7('0x42')](_0x311936);})[_0x48b7('0x23')](function(_0x2460af){_0x4e0fec[_0x48b7('0x58')]=_0x2460af;return _0x4e0fec;});}})[_0x48b7('0x23')](respondWithFilteredResult(_0x22d450,_0x311936))['catch'](handleError(_0x22d450,null));};exports[_0x48b7('0x5b')]=function(_0x22f0c6,_0x6b0df4,_0xc589f3){var _0x267504={'raw':!![],'where':{}};var _0x33d5fd={};var _0x56fe69={'count':0x0,'rows':[]};return db[_0x48b7('0x2d')][_0x48b7('0x59')]({'where':{'id':_0x22f0c6[_0x48b7('0x4d')]['id']}})[_0x48b7('0x23')](handleEntityNotFound(_0x6b0df4,null))[_0x48b7('0x23')](function(_0x524155){if(_0x524155){_0x33d5fd[_0x48b7('0x2f')]=_['keys'](db[_0x48b7('0x5c')][_0x48b7('0x56')]);_0x33d5fd['query']=_[_0x48b7('0x44')](_0x22f0c6['query']);_0x33d5fd[_0x48b7('0x31')]=_['intersection'](_0x33d5fd[_0x48b7('0x2f')],_0x33d5fd['query']);_0x267504[_0x48b7('0x33')]=_[_0x48b7('0x32')](_0x33d5fd[_0x48b7('0x2f')],qs['fields'](_0x22f0c6[_0x48b7('0x30')][_0x48b7('0x34')]));_0x267504[_0x48b7('0x33')]=_0x267504[_0x48b7('0x33')][_0x48b7('0x35')]?_0x267504['attributes']:_0x33d5fd[_0x48b7('0x2f')];if(!_0x22f0c6[_0x48b7('0x30')][_0x48b7('0x36')](_0x48b7('0x37'))){_0x267504[_0x48b7('0x20')]=qs['limit'](_0x22f0c6['query'][_0x48b7('0x20')]);_0x267504['offset']=qs[_0x48b7('0x1f')](_0x22f0c6[_0x48b7('0x30')][_0x48b7('0x1f')]);}_0x267504['order']=qs['sort'](_0x22f0c6[_0x48b7('0x30')]['sort']);_0x267504[_0x48b7('0x3a')]=qs[_0x48b7('0x31')](_[_0x48b7('0x3b')](_0x22f0c6['query'],_0x33d5fd['filters']));_0x267504[_0x48b7('0x3a')][_0x48b7('0x57')]=_0x524155['id'];if(_0x22f0c6['query'][_0x48b7('0x3c')]){_0x267504[_0x48b7('0x3a')]=_[_0x48b7('0x3d')](_0x267504[_0x48b7('0x3a')],{'$or':_[_0x48b7('0x2c')](_0x267504[_0x48b7('0x33')],function(_0x267ab2){var _0x9eb0={};_0x9eb0[_0x267ab2]={'$like':'%'+_0x22f0c6[_0x48b7('0x30')]['filter']+'%'};return _0x9eb0;})});}_0x267504=_['merge']({},_0x267504,_0x22f0c6[_0x48b7('0x3f')]);return db['CmHopperFinal'][_0x48b7('0x1e')]({'where':_0x267504[_0x48b7('0x3a')]})['then'](function(_0x225bed){_0x56fe69[_0x48b7('0x1e')]=_0x225bed;if(_0x22f0c6[_0x48b7('0x30')]['includeAll']){_0x267504[_0x48b7('0x41')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x48b7('0x42')](_0x267504);})[_0x48b7('0x23')](function(_0x5f08cd){_0x56fe69['rows']=_0x5f08cd;return _0x56fe69;});}})[_0x48b7('0x23')](respondWithFilteredResult(_0x6b0df4,_0x267504))[_0x48b7('0x43')](handleError(_0x6b0df4,null));};exports['getHopperBlacks']=function(_0xb39bc3,_0x55671c,_0x5a6a9c){var _0x6d76d5={'raw':!![],'where':{}};var _0x5983c4={};var _0x1a4a53={'count':0x0,'rows':[]};return db[_0x48b7('0x2d')][_0x48b7('0x59')]({'where':{'id':_0xb39bc3[_0x48b7('0x4d')]['id']}})['then'](handleEntityNotFound(_0x55671c,null))[_0x48b7('0x23')](function(_0x2851bc){if(_0x2851bc){_0x5983c4[_0x48b7('0x2f')]=_['keys'](db['CmHopperBlack']['rawAttributes']);_0x5983c4[_0x48b7('0x30')]=_['keys'](_0xb39bc3[_0x48b7('0x30')]);_0x5983c4[_0x48b7('0x31')]=_[_0x48b7('0x32')](_0x5983c4[_0x48b7('0x2f')],_0x5983c4[_0x48b7('0x30')]);_0x6d76d5[_0x48b7('0x33')]=_[_0x48b7('0x32')](_0x5983c4[_0x48b7('0x2f')],qs['fields'](_0xb39bc3['query'][_0x48b7('0x34')]));_0x6d76d5[_0x48b7('0x33')]=_0x6d76d5['attributes'][_0x48b7('0x35')]?_0x6d76d5[_0x48b7('0x33')]:_0x5983c4['model'];if(!_0xb39bc3[_0x48b7('0x30')]['hasOwnProperty'](_0x48b7('0x37'))){_0x6d76d5[_0x48b7('0x20')]=qs[_0x48b7('0x20')](_0xb39bc3[_0x48b7('0x30')][_0x48b7('0x20')]);_0x6d76d5['offset']=qs[_0x48b7('0x1f')](_0xb39bc3[_0x48b7('0x30')]['offset']);}_0x6d76d5['order']=qs[_0x48b7('0x39')](_0xb39bc3[_0x48b7('0x30')][_0x48b7('0x39')]);_0x6d76d5[_0x48b7('0x3a')]=qs[_0x48b7('0x31')](_[_0x48b7('0x3b')](_0xb39bc3['query'],_0x5983c4[_0x48b7('0x31')]));_0x6d76d5[_0x48b7('0x3a')][_0x48b7('0x57')]=_0x2851bc['id'];if(_0xb39bc3[_0x48b7('0x30')][_0x48b7('0x3c')]){_0x6d76d5['where']=_[_0x48b7('0x3d')](_0x6d76d5[_0x48b7('0x3a')],{'$or':_[_0x48b7('0x2c')](_0x6d76d5['attributes'],function(_0x599cd8){var _0x34dd56={};_0x34dd56[_0x599cd8]={'$like':'%'+_0xb39bc3[_0x48b7('0x30')]['filter']+'%'};return _0x34dd56;})});}_0x6d76d5=_[_0x48b7('0x3d')]({},_0x6d76d5,_0xb39bc3[_0x48b7('0x3f')]);return db[_0x48b7('0x5d')][_0x48b7('0x1e')]({'where':_0x6d76d5[_0x48b7('0x3a')]})[_0x48b7('0x23')](function(_0x3d53a3){_0x1a4a53['count']=_0x3d53a3;if(_0xb39bc3[_0x48b7('0x30')][_0x48b7('0x40')]){_0x6d76d5['include']=[{'all':!![]}];}return db[_0x48b7('0x5d')][_0x48b7('0x42')](_0x6d76d5);})[_0x48b7('0x23')](function(_0x872a49){_0x1a4a53[_0x48b7('0x58')]=_0x872a49;return _0x1a4a53;});}})[_0x48b7('0x23')](respondWithFilteredResult(_0x55671c,_0x6d76d5))[_0x48b7('0x43')](handleError(_0x55671c,null));};exports[_0x48b7('0x5e')]=function(_0x16bf51,_0x243fc7,_0x36994d){var _0x5ef345={};var _0x450cb1={};var _0x475551;var _0x78cf98;return db[_0x48b7('0x2d')][_0x48b7('0x59')]({'where':{'id':_0x16bf51['params']['id']}})[_0x48b7('0x23')](handleEntityNotFound(_0x243fc7,null))[_0x48b7('0x23')](function(_0x5556cf){if(_0x5556cf){_0x475551=_0x5556cf;_0x450cb1[_0x48b7('0x2f')]=_[_0x48b7('0x44')](db[_0x48b7('0x5f')][_0x48b7('0x56')]);_0x450cb1[_0x48b7('0x30')]=_[_0x48b7('0x44')](_0x16bf51[_0x48b7('0x30')]);_0x450cb1['filters']=_[_0x48b7('0x32')](_0x450cb1[_0x48b7('0x2f')],_0x450cb1['query']);_0x5ef345[_0x48b7('0x33')]=_['intersection'](_0x450cb1['model'],qs[_0x48b7('0x34')](_0x16bf51[_0x48b7('0x30')][_0x48b7('0x34')]));_0x5ef345[_0x48b7('0x33')]=_0x5ef345[_0x48b7('0x33')][_0x48b7('0x35')]?_0x5ef345[_0x48b7('0x33')]:_0x450cb1[_0x48b7('0x2f')];_0x5ef345[_0x48b7('0x38')]=qs[_0x48b7('0x39')](_0x16bf51[_0x48b7('0x30')][_0x48b7('0x39')]);_0x5ef345['where']=qs[_0x48b7('0x31')](_[_0x48b7('0x3b')](_0x16bf51['query'],_0x450cb1[_0x48b7('0x31')]));if(_0x16bf51['query']['filter']){_0x5ef345[_0x48b7('0x3a')]=_[_0x48b7('0x3d')](_0x5ef345[_0x48b7('0x3a')],{'$or':_[_0x48b7('0x2c')](_0x5ef345[_0x48b7('0x33')],function(_0x3c3756){var _0x298560={};_0x298560[_0x3c3756]={'$like':'%'+_0x16bf51['query']['filter']+'%'};return _0x298560;})});}_0x5ef345=_['merge']({},_0x5ef345,_0x16bf51[_0x48b7('0x3f')]);return _0x475551[_0x48b7('0x5e')](_0x5ef345);}})[_0x48b7('0x23')](function(_0x1fc3a2){if(_0x1fc3a2){_0x78cf98=_0x1fc3a2[_0x48b7('0x35')];if(!_0x16bf51[_0x48b7('0x30')][_0x48b7('0x36')](_0x48b7('0x37'))){_0x5ef345['limit']=qs[_0x48b7('0x20')](_0x16bf51[_0x48b7('0x30')]['limit']);_0x5ef345[_0x48b7('0x1f')]=qs[_0x48b7('0x1f')](_0x16bf51[_0x48b7('0x30')][_0x48b7('0x1f')]);}return _0x475551[_0x48b7('0x5e')](_0x5ef345);}})[_0x48b7('0x23')](function(_0xec09f4){if(_0xec09f4){return _0xec09f4?{'count':_0x78cf98,'rows':_0xec09f4}:null;}})['then'](respondWithResult(_0x243fc7,null))['catch'](handleError(_0x243fc7,null));};exports[_0x48b7('0x60')]=function(_0x3719a1,_0x139622,_0x4d3199){var _0x16150f,_0x2113b8;return db[_0x48b7('0x2d')][_0x48b7('0x4a')]({'where':{'id':_0x3719a1['params']['id']}})[_0x48b7('0x23')](handleEntityNotFound(_0x139622,null))[_0x48b7('0x23')](function(_0x38d6c3){if(_0x38d6c3){_0x2113b8=_0x38d6c3;return _0x38d6c3[_0x48b7('0x60')](_0x3719a1[_0x48b7('0x46')][_0x48b7('0x61')],_[_0x48b7('0x4e')](_0x3719a1[_0x48b7('0x46')],[_0x48b7('0x61'),'id'])||{});}return null;})['spread'](function(_0x4adede){var _0x41dadb;_0x16150f=_0x4adede||[];var _0x3c4512=[];if(_0x4adede){for(var _0x287010=0x0;_0x287010<_0x4adede[_0x48b7('0x35')];_0x287010+=0x1){var _0x1e4460=_0x4adede[_0x287010][_0x48b7('0x25')]({'plain':!![]});_0x2113b8[_0x48b7('0x62')]=_0x3719a1[_0x48b7('0x46')][_0x48b7('0x62')]?_0x3719a1[_0x48b7('0x46')][_0x48b7('0x62')]:_0x2113b8[_0x48b7('0x62')];switch(_0x2113b8[_0x48b7('0x62')]){case _0x48b7('0x63'):_0x41dadb=squel[_0x48b7('0x64')]()['into']('cm_hopper')[_0x48b7('0x65')]([_0x48b7('0x66'),_0x48b7('0x67'),_0x48b7('0x68'),'ListId',_0x48b7('0x57'),_0x48b7('0x4f'),_0x48b7('0x50')],squel[_0x48b7('0x69')]()[_0x48b7('0x6a')](_0x48b7('0x66'),_0x48b7('0x66'))[_0x48b7('0x6a')](_0x48b7('0x6b'),_0x48b7('0x67'))[_0x48b7('0x6a')]('id',_0x48b7('0x68'))[_0x48b7('0x6a')](_0x1e4460[_0x48b7('0x6c')][_0x48b7('0x6d')](),_0x48b7('0x6e'))['field'](_0x3719a1[_0x48b7('0x4d')]['id'][_0x48b7('0x6d')](),'CampaignId')[_0x48b7('0x6a')]('NOW()',_0x48b7('0x4f'))[_0x48b7('0x6a')]('NOW()',_0x48b7('0x50'))[_0x48b7('0x6f')](_0x48b7('0x70'))[_0x48b7('0x3a')]('deletedAt\x20IS\x20NULL')[_0x48b7('0x3a')]('ListId\x20=\x20?',_0x1e4460['CmListId'][_0x48b7('0x6d')]())[_0x48b7('0x3a')](_0x48b7('0x71'))[_0x48b7('0x3a')](_0x48b7('0x72'),squel[_0x48b7('0x69')]()[_0x48b7('0x6a')](_0x48b7('0x73'))[_0x48b7('0x6f')](_0x48b7('0x74'))[_0x48b7('0x3a')]('CampaignId\x20=\x20?',_0x3719a1[_0x48b7('0x4d')]['id'][_0x48b7('0x6d')]()))[_0x48b7('0x3a')]('phone\x20NOT\x20IN\x20(?)',squel[_0x48b7('0x69')]()[_0x48b7('0x6a')](_0x48b7('0x75'))[_0x48b7('0x6f')](_0x48b7('0x76'))[_0x48b7('0x3a')](_0x48b7('0x77'),_0x3719a1[_0x48b7('0x4d')]['id']['toString']())))[_0x48b7('0x6d')]();break;case'onlyIfOpen':_0x41dadb=squel[_0x48b7('0x64')]()[_0x48b7('0x78')](_0x48b7('0x76'))['fromQuery'](['phone','scheduledAt',_0x48b7('0x68'),_0x48b7('0x6e'),_0x48b7('0x57'),_0x48b7('0x4f'),_0x48b7('0x50')],squel[_0x48b7('0x69')]()['field']('phone',_0x48b7('0x66'))[_0x48b7('0x6a')](_0x48b7('0x6b'),_0x48b7('0x67'))[_0x48b7('0x6a')]('id',_0x48b7('0x68'))[_0x48b7('0x6a')](_0x1e4460['CmListId']['toString'](),'ListId')[_0x48b7('0x6a')](_0x3719a1[_0x48b7('0x4d')]['id'][_0x48b7('0x6d')](),_0x48b7('0x57'))[_0x48b7('0x6a')](_0x48b7('0x6b'),'createdAt')['field'](_0x48b7('0x6b'),_0x48b7('0x50'))[_0x48b7('0x6f')](_0x48b7('0x70'))[_0x48b7('0x3a')](_0x48b7('0x79'))[_0x48b7('0x3a')](_0x48b7('0x7a'),_0x1e4460[_0x48b7('0x6c')]['toString']())[_0x48b7('0x3a')](_0x48b7('0x71'))[_0x48b7('0x3a')]('phone\x20NOT\x20IN\x20(?)',squel[_0x48b7('0x69')]()['field'](_0x48b7('0x75'))[_0x48b7('0x6f')](_0x48b7('0x76'))['where'](_0x48b7('0x77'),_0x3719a1[_0x48b7('0x4d')]['id'][_0x48b7('0x6d')]())))[_0x48b7('0x6d')]();break;default:_0x41dadb=squel[_0x48b7('0x64')]()[_0x48b7('0x78')](_0x48b7('0x76'))[_0x48b7('0x65')](['phone',_0x48b7('0x67'),_0x48b7('0x68'),'ListId',_0x48b7('0x57'),_0x48b7('0x4f'),_0x48b7('0x50')],squel[_0x48b7('0x69')]()['field'](_0x48b7('0x66'),'phone')['field'](_0x48b7('0x6b'),'scheduledAt')[_0x48b7('0x6a')]('id',_0x48b7('0x68'))[_0x48b7('0x6a')](_0x1e4460[_0x48b7('0x6c')][_0x48b7('0x6d')](),_0x48b7('0x6e'))[_0x48b7('0x6a')](_0x3719a1[_0x48b7('0x4d')]['id']['toString'](),_0x48b7('0x57'))[_0x48b7('0x6a')]('NOW()',_0x48b7('0x4f'))[_0x48b7('0x6a')](_0x48b7('0x6b'),_0x48b7('0x50'))[_0x48b7('0x6f')](_0x48b7('0x70'))[_0x48b7('0x3a')](_0x48b7('0x79'))[_0x48b7('0x3a')](_0x48b7('0x7a'),_0x1e4460[_0x48b7('0x6c')]['toString']())[_0x48b7('0x3a')](_0x48b7('0x71')))[_0x48b7('0x6d')]();}_0x3c4512[_0x48b7('0x7b')](db[_0x48b7('0x7c')][_0x48b7('0x30')](_0x41dadb));}return BPromise[_0x48b7('0x7d')](_0x3c4512);}})['then'](function(){return _0x16150f;})['then'](respondWithResult(_0x139622,null))[_0x48b7('0x43')](handleError(_0x139622,null));};exports['removeLists']=function(_0x3a8257,_0x471ccc,_0xdee034){return db[_0x48b7('0x2d')]['find']({'where':{'id':_0x3a8257['params']['id']}})[_0x48b7('0x23')](handleEntityNotFound(_0x471ccc,null))[_0x48b7('0x23')](function(_0x4bee27){if(_0x4bee27){return _0x4bee27['removeLists'](_0x3a8257[_0x48b7('0x30')][_0x48b7('0x61')]);}})[_0x48b7('0x23')](function(_0x3a082f){if(_0x3a082f){return db[_0x48b7('0x55')][_0x48b7('0x24')]({'where':{'ListId':_0x3a8257['query']['ids'],'CampaignId':_0x3a8257[_0x48b7('0x4d')]['id']}})[_0x48b7('0x23')](function(){return _0x3a082f;});}})[_0x48b7('0x23')](respondWithStatusCode(_0x471ccc,null))['catch'](handleError(_0x471ccc,null));};exports[_0x48b7('0x7e')]=function(_0x2b3932,_0x5a0025,_0x43c495){var _0x2d2a9d={};var _0xcae3c0={};var _0x38de8c;var _0x551db1;return db[_0x48b7('0x2d')][_0x48b7('0x59')]({'where':{'id':_0x2b3932[_0x48b7('0x4d')]['id']}})[_0x48b7('0x23')](handleEntityNotFound(_0x5a0025,null))[_0x48b7('0x23')](function(_0x120cd2){if(_0x120cd2){_0x38de8c=_0x120cd2;_0xcae3c0[_0x48b7('0x2f')]=_[_0x48b7('0x44')](db[_0x48b7('0x5f')][_0x48b7('0x56')]);_0xcae3c0[_0x48b7('0x30')]=_[_0x48b7('0x44')](_0x2b3932[_0x48b7('0x30')]);_0xcae3c0['filters']=_[_0x48b7('0x32')](_0xcae3c0[_0x48b7('0x2f')],_0xcae3c0['query']);_0x2d2a9d[_0x48b7('0x33')]=_[_0x48b7('0x32')](_0xcae3c0['model'],qs['fields'](_0x2b3932['query'][_0x48b7('0x34')]));_0x2d2a9d[_0x48b7('0x33')]=_0x2d2a9d[_0x48b7('0x33')][_0x48b7('0x35')]?_0x2d2a9d[_0x48b7('0x33')]:_0xcae3c0[_0x48b7('0x2f')];_0x2d2a9d['order']=qs[_0x48b7('0x39')](_0x2b3932[_0x48b7('0x30')][_0x48b7('0x39')]);_0x2d2a9d[_0x48b7('0x3a')]=qs[_0x48b7('0x31')](_[_0x48b7('0x3b')](_0x2b3932['query'],_0xcae3c0[_0x48b7('0x31')]));if(_0x2b3932[_0x48b7('0x30')][_0x48b7('0x3c')]){_0x2d2a9d['where']=_['merge'](_0x2d2a9d[_0x48b7('0x3a')],{'$or':_[_0x48b7('0x2c')](_0x2d2a9d['attributes'],function(_0x19e2cd){var _0x1194f4={};_0x1194f4[_0x19e2cd]={'$like':'%'+_0x2b3932['query'][_0x48b7('0x3c')]+'%'};return _0x1194f4;})});}_0x2d2a9d=_[_0x48b7('0x3d')]({},_0x2d2a9d,_0x2b3932['options']);return _0x38de8c[_0x48b7('0x7e')](_0x2d2a9d);}})[_0x48b7('0x23')](function(_0x2ce703){if(_0x2ce703){_0x551db1=_0x2ce703[_0x48b7('0x35')];if(!_0x2b3932[_0x48b7('0x30')][_0x48b7('0x36')]('nolimit')){_0x2d2a9d[_0x48b7('0x20')]=qs[_0x48b7('0x20')](_0x2b3932[_0x48b7('0x30')][_0x48b7('0x20')]);_0x2d2a9d['offset']=qs[_0x48b7('0x1f')](_0x2b3932['query'][_0x48b7('0x1f')]);}return _0x38de8c['getBlackLists'](_0x2d2a9d);}})[_0x48b7('0x23')](function(_0x460f10){if(_0x460f10){return _0x460f10?{'count':_0x551db1,'rows':_0x460f10}:null;}})[_0x48b7('0x23')](respondWithResult(_0x5a0025,null))[_0x48b7('0x43')](handleError(_0x5a0025,null));};exports['addBlackLists']=function(_0x28f709,_0x59dd05,_0xb67fe9){var _0x253aea,_0xd603d4;return db[_0x48b7('0x2d')][_0x48b7('0x4a')]({'where':{'id':_0x28f709[_0x48b7('0x4d')]['id']}})[_0x48b7('0x23')](handleEntityNotFound(_0x59dd05,null))[_0x48b7('0x23')](function(_0x3d19d5){if(_0x3d19d5){_0xd603d4=_0x3d19d5;return _0x3d19d5[_0x48b7('0x7f')](_0x28f709[_0x48b7('0x46')]['ids'],_[_0x48b7('0x4e')](_0x28f709[_0x48b7('0x46')],[_0x48b7('0x61'),'id'])||{});}return null;})['spread'](function(_0x65b9b9){var _0xcfe643;_0x253aea=_0x65b9b9||[];var _0x4a2fbd=[];if(_0x65b9b9){for(var _0x455743=0x0;_0x455743<_0x65b9b9[_0x48b7('0x35')];_0x455743+=0x1){var _0x4206f1=_0x65b9b9[_0x455743]['get']({'plain':!![]});_0xcfe643=squel[_0x48b7('0x64')]()[_0x48b7('0x78')](_0x48b7('0x80'))[_0x48b7('0x65')]([_0x48b7('0x66'),'ContactId',_0x48b7('0x6e'),_0x48b7('0x57'),'createdAt',_0x48b7('0x50')],squel[_0x48b7('0x69')]()['field'](_0x48b7('0x66'),_0x48b7('0x66'))[_0x48b7('0x6a')]('id',_0x48b7('0x68'))['field'](_0x4206f1['CmListId']['toString'](),_0x48b7('0x6e'))[_0x48b7('0x6a')](_0x28f709[_0x48b7('0x4d')]['id'][_0x48b7('0x6d')](),_0x48b7('0x57'))['field'](_0x48b7('0x6b'),_0x48b7('0x4f'))[_0x48b7('0x6a')]('NOW()','updatedAt')['from'](_0x48b7('0x70'))[_0x48b7('0x3a')](_0x48b7('0x79'))[_0x48b7('0x3a')](_0x48b7('0x7a'),_0x4206f1['CmListId'][_0x48b7('0x6d')]())['where']('phone\x20IS\x20NOT\x20NULL'))[_0x48b7('0x6d')]();_0x4a2fbd[_0x48b7('0x7b')](db[_0x48b7('0x7c')][_0x48b7('0x30')](_0xcfe643));}return BPromise['all'](_0x4a2fbd);}})[_0x48b7('0x23')](function(){return _0x253aea;})[_0x48b7('0x23')](respondWithResult(_0x59dd05,null))[_0x48b7('0x43')](handleError(_0x59dd05,null));};exports[_0x48b7('0x81')]=function(_0xd48dc2,_0x1a1478,_0x3b833a){return db['Campaign'][_0x48b7('0x4a')]({'where':{'id':_0xd48dc2[_0x48b7('0x4d')]['id']}})[_0x48b7('0x23')](handleEntityNotFound(_0x1a1478,null))[_0x48b7('0x23')](function(_0x821fec){if(_0x821fec){return _0x821fec[_0x48b7('0x81')](_0xd48dc2[_0x48b7('0x30')]['ids']);}})['then'](function(_0x2863a1){if(_0x2863a1){return db[_0x48b7('0x5d')]['destroy']({'where':{'ListId':_0xd48dc2['query'][_0x48b7('0x61')],'CampaignId':_0xd48dc2[_0x48b7('0x4d')]['id']}})[_0x48b7('0x23')](function(){return _0x2863a1;});}})[_0x48b7('0x23')](respondWithStatusCode(_0x1a1478,null))[_0x48b7('0x43')](handleError(_0x1a1478,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index 09201ce..8540aed 100644 --- a/server/api/campaign/campaign.model.js +++ b/server/api/campaign/campaign.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0xd3ac55,_0x3915b6){var _0x526e60=function(_0x10ac01){while(--_0x10ac01){_0xd3ac55['push'](_0xd3ac55['shift']());}};_0x526e60(++_0x3915b6);}(_0x7a54,0x106));var _0x47a5=function(_0x2442d0,_0x347f56){_0x2442d0=_0x2442d0-0x0;var _0x344d5f=_0x7a54[_0x2442d0];return _0x344d5f;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x1b6186,_0x1ec7f2){var _0x186121=function(_0x1748a8){while(--_0x1748a8){_0x1b6186['push'](_0x1b6186['shift']());}};_0x186121(++_0x1ec7f2);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js index c204198..136ba7a 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 _0x8f37=['ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http','request','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetCampaign','Campaign','findAll','options','where','limit','include','map','attributes','model','then','lodash','util','moment'];(function(_0x15e634,_0x28558e){var _0x4d5d95=function(_0x5c3a6f){while(--_0x5c3a6f){_0x15e634['push'](_0x15e634['shift']());}};_0x4d5d95(++_0x28558e);}(_0x8f37,0x190));var _0x78f3=function(_0x1c8c47,_0x3bad79){_0x1c8c47=_0x1c8c47-0x0;var _0x3a7f35=_0x8f37[_0x1c8c47];return _0x3a7f35;};'use strict';var _=require(_0x78f3('0x0'));var util=require(_0x78f3('0x1'));var moment=require(_0x78f3('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x78f3('0x3'));var db=require(_0x78f3('0x4'))['db'];var utils=require(_0x78f3('0x5'));var logger=require('../../config/logger')(_0x78f3('0x6'));var config=require('../../config/environment');var jayson=require(_0x78f3('0x7'));var client=jayson['client'][_0x78f3('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3dc185,_0x492dc7,_0x58bd73){return new BPromise(function(_0x55e353,_0x35d861){return client[_0x78f3('0x9')](_0x3dc185,_0x58bd73)['then'](function(_0x20c081){logger[_0x78f3('0xa')](_0x78f3('0xb'),_0x492dc7,_0x78f3('0xc'));logger[_0x78f3('0xd')]('Campaign,\x20%s,\x20%s,\x20%s',_0x492dc7,_0x78f3('0xc'),JSON[_0x78f3('0xe')](_0x20c081));if(_0x20c081['error']){if(_0x20c081[_0x78f3('0xf')][_0x78f3('0x10')]===0x1f4){logger[_0x78f3('0xf')]('Campaign,\x20%s,\x20%s',_0x492dc7,_0x20c081[_0x78f3('0xf')][_0x78f3('0x11')]);return _0x35d861(_0x20c081[_0x78f3('0xf')][_0x78f3('0x11')]);}logger[_0x78f3('0xf')](_0x78f3('0xb'),_0x492dc7,_0x20c081[_0x78f3('0xf')][_0x78f3('0x11')]);return _0x55e353(_0x20c081[_0x78f3('0xf')][_0x78f3('0x11')]);}else{logger[_0x78f3('0xa')](_0x78f3('0xb'),_0x492dc7,_0x78f3('0xc'));_0x55e353(_0x20c081[_0x78f3('0x12')][_0x78f3('0x11')]);}})[_0x78f3('0x13')](function(_0x39adfc){logger[_0x78f3('0xf')](_0x78f3('0xb'),_0x492dc7,_0x39adfc);_0x35d861(_0x39adfc);});});}exports[_0x78f3('0x14')]=function(_0x3c76d2){var _0x1c25f2=this;return new Promise(function(_0x225176,_0x4a5db4){return db[_0x78f3('0x15')][_0x78f3('0x16')]({'raw':_0x3c76d2['options']?_0x3c76d2['options']['raw']===undefined?!![]:![]:!![],'where':_0x3c76d2[_0x78f3('0x17')]?_0x3c76d2[_0x78f3('0x17')][_0x78f3('0x18')]||null:null,'attributes':_0x3c76d2[_0x78f3('0x17')]?_0x3c76d2[_0x78f3('0x17')]['attributes']||null:null,'limit':_0x3c76d2[_0x78f3('0x17')]?_0x3c76d2[_0x78f3('0x17')][_0x78f3('0x19')]||null:null,'include':_0x3c76d2[_0x78f3('0x17')]?_0x3c76d2[_0x78f3('0x17')][_0x78f3('0x1a')]?_[_0x78f3('0x1b')](_0x3c76d2[_0x78f3('0x17')][_0x78f3('0x1a')],function(_0x3c6bf8){return{'model':db[_0x3c6bf8['model']],'as':_0x3c6bf8['as'],'attributes':_0x3c6bf8[_0x78f3('0x1c')],'include':_0x3c6bf8[_0x78f3('0x1a')]?_['map'](_0x3c6bf8[_0x78f3('0x1a')],function(_0x238001){return{'model':db[_0x238001[_0x78f3('0x1d')]],'as':_0x238001['as'],'attributes':_0x238001[_0x78f3('0x1c')],'include':_0x238001[_0x78f3('0x1a')]?_['map'](_0x238001[_0x78f3('0x1a')],function(_0x197837){return{'model':db[_0x197837[_0x78f3('0x1d')]],'as':_0x197837['as'],'attributes':_0x197837[_0x78f3('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x78f3('0x1e')](function(_0x54d5ae){logger[_0x78f3('0xa')](_0x78f3('0x14'),_0x3c76d2);logger[_0x78f3('0xd')](_0x78f3('0x14'),_0x3c76d2,JSON[_0x78f3('0xe')](_0x54d5ae));_0x225176(_0x54d5ae);})[_0x78f3('0x13')](function(_0x2de1bb){logger[_0x78f3('0xf')](_0x78f3('0x14'),_0x2de1bb[_0x78f3('0x11')],_0x3c76d2);_0x4a5db4(_0x1c25f2[_0x78f3('0xf')](0x1f4,_0x2de1bb[_0x78f3('0x11')]));});});}; \ No newline at end of file +var _0xe77f=['then','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','error','code','message','Campaign,\x20%s,\x20%s','info','result','catch','GetCampaign','Campaign','options','raw','where','attributes','limit','include','map','model','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x3ecd75,_0x2545b5){var _0x422da6=function(_0x3570d6){while(--_0x3570d6){_0x3ecd75['push'](_0x3ecd75['shift']());}};_0x422da6(++_0x2545b5);}(_0xe77f,0xba));var _0xfe77=function(_0x32c326,_0x1d9711){_0x32c326=_0x32c326-0x0;var _0x5516ca=_0xe77f[_0x32c326];return _0x5516ca;};'use strict';var _=require(_0xfe77('0x0'));var util=require(_0xfe77('0x1'));var moment=require('moment');var BPromise=require(_0xfe77('0x2'));var rs=require(_0xfe77('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfe77('0x4'))['db'];var utils=require(_0xfe77('0x5'));var logger=require('../../config/logger')(_0xfe77('0x6'));var config=require(_0xfe77('0x7'));var jayson=require(_0xfe77('0x8'));var client=jayson[_0xfe77('0x9')][_0xfe77('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x51d137,_0x5ecf79,_0x1a65af){return new BPromise(function(_0xc2b8f4,_0x1bb5e0){return client[_0xfe77('0xb')](_0x51d137,_0x1a65af)[_0xfe77('0xc')](function(_0x38fcb2){logger['info']('Campaign,\x20%s,\x20%s',_0x5ecf79,_0xfe77('0xd'));logger[_0xfe77('0xe')](_0xfe77('0xf'),_0x5ecf79,_0xfe77('0xd'),JSON['stringify'](_0x38fcb2));if(_0x38fcb2[_0xfe77('0x10')]){if(_0x38fcb2[_0xfe77('0x10')][_0xfe77('0x11')]===0x1f4){logger[_0xfe77('0x10')]('Campaign,\x20%s,\x20%s',_0x5ecf79,_0x38fcb2[_0xfe77('0x10')][_0xfe77('0x12')]);return _0x1bb5e0(_0x38fcb2[_0xfe77('0x10')]['message']);}logger[_0xfe77('0x10')](_0xfe77('0x13'),_0x5ecf79,_0x38fcb2['error'][_0xfe77('0x12')]);return _0xc2b8f4(_0x38fcb2[_0xfe77('0x10')][_0xfe77('0x12')]);}else{logger[_0xfe77('0x14')](_0xfe77('0x13'),_0x5ecf79,_0xfe77('0xd'));_0xc2b8f4(_0x38fcb2[_0xfe77('0x15')][_0xfe77('0x12')]);}})[_0xfe77('0x16')](function(_0x19d7af){logger[_0xfe77('0x10')](_0xfe77('0x13'),_0x5ecf79,_0x19d7af);_0x1bb5e0(_0x19d7af);});});}exports[_0xfe77('0x17')]=function(_0x5b9f81){var _0xede9cb=this;return new Promise(function(_0x596f18,_0x465e0d){return db[_0xfe77('0x18')]['findAll']({'raw':_0x5b9f81[_0xfe77('0x19')]?_0x5b9f81['options'][_0xfe77('0x1a')]===undefined?!![]:![]:!![],'where':_0x5b9f81['options']?_0x5b9f81['options'][_0xfe77('0x1b')]||null:null,'attributes':_0x5b9f81['options']?_0x5b9f81[_0xfe77('0x19')][_0xfe77('0x1c')]||null:null,'limit':_0x5b9f81[_0xfe77('0x19')]?_0x5b9f81[_0xfe77('0x19')][_0xfe77('0x1d')]||null:null,'include':_0x5b9f81[_0xfe77('0x19')]?_0x5b9f81[_0xfe77('0x19')][_0xfe77('0x1e')]?_[_0xfe77('0x1f')](_0x5b9f81[_0xfe77('0x19')][_0xfe77('0x1e')],function(_0x10de1a){return{'model':db[_0x10de1a['model']],'as':_0x10de1a['as'],'attributes':_0x10de1a['attributes'],'include':_0x10de1a['include']?_[_0xfe77('0x1f')](_0x10de1a[_0xfe77('0x1e')],function(_0x9b5b2f){return{'model':db[_0x9b5b2f[_0xfe77('0x20')]],'as':_0x9b5b2f['as'],'attributes':_0x9b5b2f['attributes'],'include':_0x9b5b2f[_0xfe77('0x1e')]?_[_0xfe77('0x1f')](_0x9b5b2f['include'],function(_0x3fe30d){return{'model':db[_0x3fe30d[_0xfe77('0x20')]],'as':_0x3fe30d['as'],'attributes':_0x3fe30d[_0xfe77('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xfe77('0xc')](function(_0x352120){logger[_0xfe77('0x14')](_0xfe77('0x17'),_0x5b9f81);logger[_0xfe77('0xe')](_0xfe77('0x17'),_0x5b9f81,JSON['stringify'](_0x352120));_0x596f18(_0x352120);})[_0xfe77('0x16')](function(_0x2faa56){logger[_0xfe77('0x10')](_0xfe77('0x17'),_0x2faa56[_0xfe77('0x12')],_0x5b9f81);_0x465e0d(_0xede9cb[_0xfe77('0x10')](0x1f4,_0x2faa56['message']));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index d7241c6..3991305 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 _0x710b=['removeBlackLists','exports','multer','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','/:id','show','getHoppers','getHopperHistories','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','post','create','addLists','addBlackLists','put','delete','destroy','removeLists'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x710b,0x110));var _0xb710=function(_0x1fac98,_0x3a615e){_0x1fac98=_0x1fac98-0x0;var _0x56dfff=_0x710b[_0x1fac98];return _0x56dfff;};'use strict';var multer=require(_0xb710('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xb710('0x1'));var express=require(_0xb710('0x2'));var router=express[_0xb710('0x3')]();var fs_extra=require(_0xb710('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xb710('0x5'));var config=require(_0xb710('0x6'));var controller=require(_0xb710('0x7'));router[_0xb710('0x8')]('/',auth[_0xb710('0x9')](),controller['index']);router[_0xb710('0x8')](_0xb710('0xa'),auth['isAuthenticated'](),controller[_0xb710('0xb')]);router[_0xb710('0x8')]('/:id/hoppers',auth[_0xb710('0x9')](),controller[_0xb710('0xc')]);router['get']('/:id/hopper_histories',auth[_0xb710('0x9')](),controller[_0xb710('0xd')]);router[_0xb710('0x8')]('/:id/hopper_finals',auth[_0xb710('0x9')](),controller[_0xb710('0xe')]);router['get'](_0xb710('0xf'),auth[_0xb710('0x9')](),controller[_0xb710('0x10')]);router[_0xb710('0x8')](_0xb710('0x11'),auth['isAuthenticated'](),controller[_0xb710('0x12')]);router[_0xb710('0x8')](_0xb710('0x13'),auth[_0xb710('0x9')](),controller['getBlackLists']);router[_0xb710('0x14')]('/',auth[_0xb710('0x9')](),controller[_0xb710('0x15')]);router['post']('/:id/clone',auth[_0xb710('0x9')](),controller['clone']);router[_0xb710('0x14')](_0xb710('0x11'),auth[_0xb710('0x9')](),controller[_0xb710('0x16')]);router[_0xb710('0x14')](_0xb710('0x13'),auth[_0xb710('0x9')](),controller[_0xb710('0x17')]);router[_0xb710('0x18')](_0xb710('0xa'),auth[_0xb710('0x9')](),controller['update']);router[_0xb710('0x19')](_0xb710('0xa'),auth[_0xb710('0x9')](),controller[_0xb710('0x1a')]);router[_0xb710('0x19')](_0xb710('0x11'),auth[_0xb710('0x9')](),controller[_0xb710('0x1b')]);router['delete'](_0xb710('0x13'),auth[_0xb710('0x9')](),controller[_0xb710('0x1c')]);module[_0xb710('0x1d')]=router; \ No newline at end of file +var _0x897d=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','isAuthenticated','index','get','/:id','show','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','post','create','/:id/clone','addLists','put','update','delete','removeLists','removeBlackLists','exports','path','connect-timeout','express','Router'];(function(_0x18baf7,_0x29cd83){var _0x525a5e=function(_0x415b3e){while(--_0x415b3e){_0x18baf7['push'](_0x18baf7['shift']());}};_0x525a5e(++_0x29cd83);}(_0x897d,0x1ca));var _0xd897=function(_0xee9c59,_0x3a9bdd){_0xee9c59=_0xee9c59-0x0;var _0x1f13e3=_0x897d[_0xee9c59];return _0x1f13e3;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xd897('0x0'));var timeout=require(_0xd897('0x1'));var express=require(_0xd897('0x2'));var router=express[_0xd897('0x3')]();var fs_extra=require(_0xd897('0x4'));var auth=require(_0xd897('0x5'));var interaction=require(_0xd897('0x6'));var config=require(_0xd897('0x7'));var controller=require(_0xd897('0x8'));router['get']('/',auth[_0xd897('0x9')](),controller[_0xd897('0xa')]);router[_0xd897('0xb')](_0xd897('0xc'),auth[_0xd897('0x9')](),controller[_0xd897('0xd')]);router[_0xd897('0xb')]('/:id/hoppers',auth['isAuthenticated'](),controller['getHoppers']);router['get'](_0xd897('0xe'),auth[_0xd897('0x9')](),controller[_0xd897('0xf')]);router[_0xd897('0xb')](_0xd897('0x10'),auth['isAuthenticated'](),controller[_0xd897('0x11')]);router['get'](_0xd897('0x12'),auth[_0xd897('0x9')](),controller[_0xd897('0x13')]);router['get'](_0xd897('0x14'),auth[_0xd897('0x9')](),controller[_0xd897('0x15')]);router[_0xd897('0xb')](_0xd897('0x16'),auth[_0xd897('0x9')](),controller['getBlackLists']);router[_0xd897('0x17')]('/',auth[_0xd897('0x9')](),controller[_0xd897('0x18')]);router['post'](_0xd897('0x19'),auth[_0xd897('0x9')](),controller['clone']);router['post'](_0xd897('0x14'),auth[_0xd897('0x9')](),controller[_0xd897('0x1a')]);router[_0xd897('0x17')](_0xd897('0x16'),auth['isAuthenticated'](),controller['addBlackLists']);router[_0xd897('0x1b')](_0xd897('0xc'),auth[_0xd897('0x9')](),controller[_0xd897('0x1c')]);router[_0xd897('0x1d')]('/:id',auth[_0xd897('0x9')](),controller['destroy']);router[_0xd897('0x1d')](_0xd897('0x14'),auth[_0xd897('0x9')](),controller[_0xd897('0x1e')]);router[_0xd897('0x1d')]('/:id/blacklists',auth['isAuthenticated'](),controller[_0xd897('0x1f')]);module[_0xd897('0x20')]=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index 3e6e8eb..4901404 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 _0xbd6c=['STRING','key','sequelize','exports'];(function(_0x3ec2ff,_0x5f0ef2){var _0x5b4a2e=function(_0x2ddd34){while(--_0x2ddd34){_0x3ec2ff['push'](_0x3ec2ff['shift']());}};_0x5b4a2e(++_0x5f0ef2);}(_0xbd6c,0xaa));var _0xcbd6=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xbd6c[_0x3ab51d];return _0x29a04e;};'use strict';var Sequelize=require(_0xcbd6('0x0'));module[_0xcbd6('0x1')]={'key':{'type':Sequelize[_0xcbd6('0x2')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'allowNull':![]},'description':{'type':Sequelize[_0xcbd6('0x2')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this['getDataValue'](_0xcbd6('0x3'));}}}; \ No newline at end of file +var _0xdce2=['sequelize','exports','STRING','VIRTUAL','getDataValue','key'];(function(_0x18dee6,_0x4e06a8){var _0x533270=function(_0x584bb1){while(--_0x584bb1){_0x18dee6['push'](_0x18dee6['shift']());}};_0x533270(++_0x4e06a8);}(_0xdce2,0xd2));var _0x2dce=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xdce2[_0x17d9e3];return _0x14192d;};'use strict';var Sequelize=require(_0x2dce('0x0'));module[_0x2dce('0x1')]={'key':{'type':Sequelize[_0x2dce('0x2')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'allowNull':![]},'description':{'type':Sequelize[_0x2dce('0x2')]},'name':{'type':Sequelize[_0x2dce('0x3')],'get':function(){return this[_0x2dce('0x4')](_0x2dce('0x5'));}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index b811a33..11def7b 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 _0x0c42=['to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','update','destroy','then','get','CannedAnswers','UserProfileResource','error','name','index','map','CannedAnswer','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','includeAll','include','findAll','catch','show','params','length','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','find','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox'];(function(_0x33c6a5,_0x3e0b2b){var _0x24f17f=function(_0x1781a7){while(--_0x1781a7){_0x33c6a5['push'](_0x33c6a5['shift']());}};_0x24f17f(++_0x3e0b2b);}(_0x0c42,0xab));var _0x20c4=function(_0x1993cc,_0x46a9d5){_0x1993cc=_0x1993cc-0x0;var _0x7cd105=_0x0c42[_0x1993cc];return _0x7cd105;};'use strict';var emlformat=require(_0x20c4('0x0'));var rimraf=require(_0x20c4('0x1'));var zipdir=require(_0x20c4('0x2'));var jsonpatch=require(_0x20c4('0x3'));var rp=require(_0x20c4('0x4'));var moment=require(_0x20c4('0x5'));var BPromise=require(_0x20c4('0x6'));var Mustache=require('mustache');var util=require(_0x20c4('0x7'));var path=require('path');var sox=require(_0x20c4('0x8'));var csv=require(_0x20c4('0x9'));var ejs=require(_0x20c4('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x20c4('0xb'));var squel=require('squel');var crypto=require(_0x20c4('0xc'));var jsforce=require(_0x20c4('0xd'));var deskjs=require(_0x20c4('0xe'));var toCsv=require(_0x20c4('0x9'));var querystring=require(_0x20c4('0xf'));var Papa=require(_0x20c4('0x10'));var Redis=require(_0x20c4('0x11'));var authService=require(_0x20c4('0x12'));var qs=require(_0x20c4('0x13'));var as=require(_0x20c4('0x14'));var hardwareService=require(_0x20c4('0x15'));var logger=require('../../config/logger')(_0x20c4('0x16'));var utils=require(_0x20c4('0x17'));var config=require(_0x20c4('0x18'));var licenseUtil=require(_0x20c4('0x19'));var db=require(_0x20c4('0x1a'))['db'];function respondWithStatusCode(_0x4c26af,_0x2f0086){_0x2f0086=_0x2f0086||0xcc;return function(_0xd17466){if(_0xd17466){return _0x4c26af[_0x20c4('0x1b')](_0x2f0086);}return _0x4c26af[_0x20c4('0x1c')](_0x2f0086)[_0x20c4('0x1d')]();};}function respondWithResult(_0x1b6675,_0x90d864){_0x90d864=_0x90d864||0xc8;return function(_0x5956a5){if(_0x5956a5){return _0x1b6675[_0x20c4('0x1c')](_0x90d864)[_0x20c4('0x1e')](_0x5956a5);}};}function respondWithFilteredResult(_0x1bddc6,_0x48921c){return function(_0x4c053e){if(_0x4c053e){var _0x257e80=typeof _0x48921c[_0x20c4('0x1f')]===_0x20c4('0x20')&&typeof _0x48921c[_0x20c4('0x21')]==='undefined';var _0x6acaa5=_0x4c053e[_0x20c4('0x22')];var _0x3a813e=_0x257e80?0x0:_0x48921c[_0x20c4('0x1f')];var _0x23baa2=_0x257e80?_0x4c053e[_0x20c4('0x22')]:_0x48921c[_0x20c4('0x1f')]+_0x48921c[_0x20c4('0x21')];var _0x5f19d7;if(_0x23baa2>=_0x6acaa5){_0x23baa2=_0x6acaa5;_0x5f19d7=0xc8;}else{_0x5f19d7=0xce;}_0x1bddc6[_0x20c4('0x1c')](_0x5f19d7);return _0x1bddc6['set'](_0x20c4('0x23'),_0x3a813e+'-'+_0x23baa2+'/'+_0x6acaa5)[_0x20c4('0x1e')](_0x4c053e);}return null;};}function patchUpdates(_0x1f1a93){return function(_0x1ecf26){try{jsonpatch[_0x20c4('0x24')](_0x1ecf26,_0x1f1a93,!![]);}catch(_0x18cb75){return BPromise[_0x20c4('0x25')](_0x18cb75);}return _0x1ecf26['save']();};}function saveUpdates(_0x54ac33,_0x85fa93){return function(_0x3b83ef){if(_0x3b83ef){return _0x3b83ef[_0x20c4('0x26')](_0x54ac33)['then'](function(_0x3e6ef2){return _0x3e6ef2;});}return null;};}function removeEntity(_0x336a37,_0x525cb2){return function(_0x2eca74){if(_0x2eca74){return _0x2eca74[_0x20c4('0x27')]()[_0x20c4('0x28')](function(){var _0x5d7e41=_0x2eca74[_0x20c4('0x29')]({'plain':!![]});var _0x433a80=_0x20c4('0x2a');return db[_0x20c4('0x2b')][_0x20c4('0x27')]({'where':{'type':_0x433a80,'resourceId':_0x5d7e41['id']}})['then'](function(){return _0x2eca74;});})[_0x20c4('0x28')](function(){_0x336a37[_0x20c4('0x1c')](0xcc)[_0x20c4('0x1d')]();});}};}function handleEntityNotFound(_0x36c1b3,_0x47490f){return function(_0x2510ad){if(!_0x2510ad){_0x36c1b3[_0x20c4('0x1b')](0x194);}return _0x2510ad;};}function handleError(_0x54d536,_0x1a9495){_0x1a9495=_0x1a9495||0x1f4;return function(_0x4b2bc5){logger[_0x20c4('0x2c')](_0x4b2bc5['stack']);if(_0x4b2bc5[_0x20c4('0x2d')]){delete _0x4b2bc5['name'];}_0x54d536[_0x20c4('0x1c')](_0x1a9495)['send'](_0x4b2bc5);};}exports[_0x20c4('0x2e')]=function(_0x4c8307,_0x392978){var _0x375aaa={},_0x2ec092={},_0x4310ff={'count':0x0,'rows':[]};var _0x3152c3=_[_0x20c4('0x2f')](db[_0x20c4('0x30')][_0x20c4('0x31')],function(_0x889d56){return{'name':_0x889d56[_0x20c4('0x32')],'type':_0x889d56['type'][_0x20c4('0x33')]};});_0x2ec092[_0x20c4('0x34')]=_['map'](_0x3152c3,_0x20c4('0x2d'));_0x2ec092[_0x20c4('0x35')]=_[_0x20c4('0x36')](_0x4c8307[_0x20c4('0x35')]);_0x2ec092[_0x20c4('0x37')]=_[_0x20c4('0x38')](_0x2ec092['model'],_0x2ec092[_0x20c4('0x35')]);_0x375aaa['attributes']=_['intersection'](_0x2ec092['model'],qs[_0x20c4('0x39')](_0x4c8307['query'][_0x20c4('0x39')]));_0x375aaa[_0x20c4('0x3a')]=_0x375aaa[_0x20c4('0x3a')]['length']?_0x375aaa['attributes']:_0x2ec092[_0x20c4('0x34')];if(!_0x4c8307[_0x20c4('0x35')][_0x20c4('0x3b')](_0x20c4('0x3c'))){_0x375aaa[_0x20c4('0x21')]=qs[_0x20c4('0x21')](_0x4c8307['query']['limit']);_0x375aaa['offset']=qs[_0x20c4('0x1f')](_0x4c8307[_0x20c4('0x35')][_0x20c4('0x1f')]);}_0x375aaa[_0x20c4('0x3d')]=qs[_0x20c4('0x3e')](_0x4c8307[_0x20c4('0x35')][_0x20c4('0x3e')]);_0x375aaa[_0x20c4('0x3f')]=qs['filters'](_[_0x20c4('0x40')](_0x4c8307[_0x20c4('0x35')],_0x2ec092[_0x20c4('0x37')]),_0x3152c3);if(_0x4c8307[_0x20c4('0x35')]['filter']){_0x375aaa[_0x20c4('0x3f')]=_[_0x20c4('0x41')](_0x375aaa[_0x20c4('0x3f')],{'$or':[{'key':{'$like':'%'+_0x4c8307['query']['filter']+'%'}},{'value':{'$like':'%'+_0x4c8307[_0x20c4('0x35')][_0x20c4('0x42')]+'%'}}]});}_0x375aaa=_[_0x20c4('0x41')]({},_0x375aaa,_0x4c8307[_0x20c4('0x43')]);var _0x4aab6a={'where':_0x375aaa[_0x20c4('0x3f')]};return db[_0x20c4('0x30')][_0x20c4('0x22')](_0x4aab6a)['then'](function(_0x19aa6d){_0x4310ff[_0x20c4('0x22')]=_0x19aa6d;if(_0x4c8307['query'][_0x20c4('0x44')]){_0x375aaa[_0x20c4('0x45')]=[{'all':!![]}];}return db['CannedAnswer'][_0x20c4('0x46')](_0x375aaa);})[_0x20c4('0x28')](function(_0x4ed074){_0x4310ff['rows']=_0x4ed074;return _0x4310ff;})['then'](respondWithFilteredResult(_0x392978,_0x375aaa))[_0x20c4('0x47')](handleError(_0x392978,null));};exports[_0x20c4('0x48')]=function(_0x57dcf7,_0x30c838){var _0x5adfc7={'raw':!![],'where':{'id':_0x57dcf7[_0x20c4('0x49')]['id']}},_0x2b9841={};_0x2b9841[_0x20c4('0x34')]=_[_0x20c4('0x36')](db[_0x20c4('0x30')][_0x20c4('0x31')]);_0x2b9841[_0x20c4('0x35')]=_[_0x20c4('0x36')](_0x57dcf7['query']);_0x2b9841['filters']=_[_0x20c4('0x38')](_0x2b9841[_0x20c4('0x34')],_0x2b9841[_0x20c4('0x35')]);_0x5adfc7['attributes']=_[_0x20c4('0x38')](_0x2b9841[_0x20c4('0x34')],qs['fields'](_0x57dcf7[_0x20c4('0x35')][_0x20c4('0x39')]));_0x5adfc7['attributes']=_0x5adfc7[_0x20c4('0x3a')][_0x20c4('0x4a')]?_0x5adfc7[_0x20c4('0x3a')]:_0x2b9841['model'];if(_0x57dcf7[_0x20c4('0x35')][_0x20c4('0x44')]){_0x5adfc7[_0x20c4('0x45')]=[{'all':!![]}];}_0x5adfc7=_[_0x20c4('0x41')]({},_0x5adfc7,_0x57dcf7[_0x20c4('0x43')]);return db['CannedAnswer']['find'](_0x5adfc7)[_0x20c4('0x28')](handleEntityNotFound(_0x30c838,null))[_0x20c4('0x28')](respondWithResult(_0x30c838,null))['catch'](handleError(_0x30c838,null));};exports[_0x20c4('0x26')]=function(_0x20f3e2,_0x524118){if(_0x20f3e2[_0x20c4('0x4b')]['id']){delete _0x20f3e2['body']['id'];}return db[_0x20c4('0x30')]['find']({'where':{'id':_0x20f3e2[_0x20c4('0x49')]['id']}})[_0x20c4('0x28')](handleEntityNotFound(_0x524118,null))[_0x20c4('0x28')](saveUpdates(_0x20f3e2[_0x20c4('0x4b')],null))[_0x20c4('0x28')](respondWithResult(_0x524118,null))['catch'](handleError(_0x524118,null));};exports[_0x20c4('0x27')]=function(_0x49efb0,_0x356603){return db[_0x20c4('0x30')]['find']({'where':{'id':_0x49efb0['params']['id']}})[_0x20c4('0x28')](handleEntityNotFound(_0x356603,null))[_0x20c4('0x28')](removeEntity(_0x356603,null))[_0x20c4('0x47')](handleError(_0x356603,null));};exports[_0x20c4('0x4c')]=function(_0x2df34c,_0x56643c){var _0x445cd6={'key':_0x2df34c[_0x20c4('0x4b')]['key']};if(_0x2df34c[_0x20c4('0x4b')]['MailAccountId']){_0x445cd6[_0x20c4('0x4d')]=_0x2df34c[_0x20c4('0x4b')]['MailAccountId'];}else if(_0x2df34c['body'][_0x20c4('0x4e')]){_0x445cd6['SmsAccountId']=_0x2df34c[_0x20c4('0x4b')][_0x20c4('0x4e')];}else if(_0x2df34c[_0x20c4('0x4b')]['OpenchannelAccountId']){_0x445cd6[_0x20c4('0x4f')]=_0x2df34c[_0x20c4('0x4b')][_0x20c4('0x4f')];}else if(_0x2df34c[_0x20c4('0x4b')]['ChatWebsiteId']){_0x445cd6[_0x20c4('0x50')]=_0x2df34c['body'][_0x20c4('0x50')];}return db[_0x20c4('0x30')][_0x20c4('0x51')]({'where':_0x445cd6})['then'](function(_0x1472c8){if(_0x1472c8){throw new db[(_0x20c4('0x52'))][(_0x20c4('0x53'))](_0x20c4('0x54'));}return db[_0x20c4('0x30')][_0x20c4('0x4c')](_0x2df34c[_0x20c4('0x4b')]);})[_0x20c4('0x28')](function(_0x38c1d3){var _0x300844=_0x2df34c[_0x20c4('0x55')][_0x20c4('0x29')]({'plain':!![]});if(!_0x300844)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x300844['role']==='user'){var _0xcccc27=_0x38c1d3[_0x20c4('0x29')]({'plain':!![]});return db[_0x20c4('0x56')]['find']({'where':{'name':_0x20c4('0x2a'),'userProfileId':_0x300844[_0x20c4('0x57')]},'raw':!![]})['then'](function(_0x3b34fe){if(_0x3b34fe&&_0x3b34fe[_0x20c4('0x58')]===0x0){return db[_0x20c4('0x2b')][_0x20c4('0x4c')]({'name':_0xcccc27[_0x20c4('0x2d')],'resourceId':_0xcccc27['id'],'type':_0x3b34fe[_0x20c4('0x2d')],'sectionId':_0x3b34fe['id']},{})['then'](function(){return _0x38c1d3;});}else{return _0x38c1d3;}})['catch'](function(_0x822375){logger[_0x20c4('0x2c')](_0x20c4('0x59'),_0x822375);throw _0x822375;});}return _0x38c1d3;})[_0x20c4('0x28')](respondWithResult(_0x56643c,0xc9))[_0x20c4('0x47')](handleError(_0x56643c,null));}; \ No newline at end of file +var _0x1066=['find','catch','body','destroy','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','get','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','CannedAnswers','UserProfileResource','then','end','error','stack','send','index','map','rawAttributes','fieldName','type','model','name','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','options','includeAll','include','CannedAnswer','findAll','rows','params','length','merge'];(function(_0x2ac5f8,_0x4c3a9f){var _0x3b8229=function(_0x46a3c0){while(--_0x46a3c0){_0x2ac5f8['push'](_0x2ac5f8['shift']());}};_0x3b8229(++_0x4c3a9f);}(_0x1066,0xca));var _0x6106=function(_0x59ee52,_0x1227bc){_0x59ee52=_0x59ee52-0x0;var _0x1f82fd=_0x1066[_0x59ee52];return _0x1f82fd;};'use strict';var emlformat=require(_0x6106('0x0'));var rimraf=require(_0x6106('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x6106('0x2'));var moment=require(_0x6106('0x3'));var BPromise=require(_0x6106('0x4'));var Mustache=require('mustache');var util=require(_0x6106('0x5'));var path=require(_0x6106('0x6'));var sox=require(_0x6106('0x7'));var csv=require(_0x6106('0x8'));var ejs=require(_0x6106('0x9'));var fs=require('fs');var fs_extra=require(_0x6106('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x6106('0xb'));var jsforce=require(_0x6106('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x6106('0x8'));var querystring=require(_0x6106('0xd'));var Papa=require(_0x6106('0xe'));var Redis=require(_0x6106('0xf'));var authService=require(_0x6106('0x10'));var qs=require(_0x6106('0x11'));var as=require(_0x6106('0x12'));var hardwareService=require(_0x6106('0x13'));var logger=require(_0x6106('0x14'))(_0x6106('0x15'));var utils=require('../../config/utils');var config=require(_0x6106('0x16'));var licenseUtil=require(_0x6106('0x17'));var db=require(_0x6106('0x18'))['db'];function respondWithStatusCode(_0x3ddd80,_0x148fcd){_0x148fcd=_0x148fcd||0xcc;return function(_0x2f6fbe){if(_0x2f6fbe){return _0x3ddd80[_0x6106('0x19')](_0x148fcd);}return _0x3ddd80['status'](_0x148fcd)['end']();};}function respondWithResult(_0x4c3739,_0x481249){_0x481249=_0x481249||0xc8;return function(_0x2aa68d){if(_0x2aa68d){return _0x4c3739[_0x6106('0x1a')](_0x481249)['json'](_0x2aa68d);}};}function respondWithFilteredResult(_0x6f3f06,_0x4a2a85){return function(_0x5bd48b){if(_0x5bd48b){var _0xb1373e=typeof _0x4a2a85[_0x6106('0x1b')]===_0x6106('0x1c')&&typeof _0x4a2a85[_0x6106('0x1d')]===_0x6106('0x1c');var _0x3520ff=_0x5bd48b['count'];var _0x754df9=_0xb1373e?0x0:_0x4a2a85[_0x6106('0x1b')];var _0x26cdaa=_0xb1373e?_0x5bd48b[_0x6106('0x1e')]:_0x4a2a85[_0x6106('0x1b')]+_0x4a2a85['limit'];var _0xdc4069;if(_0x26cdaa>=_0x3520ff){_0x26cdaa=_0x3520ff;_0xdc4069=0xc8;}else{_0xdc4069=0xce;}_0x6f3f06[_0x6106('0x1a')](_0xdc4069);return _0x6f3f06[_0x6106('0x1f')](_0x6106('0x20'),_0x754df9+'-'+_0x26cdaa+'/'+_0x3520ff)[_0x6106('0x21')](_0x5bd48b);}return null;};}function patchUpdates(_0x52c3af){return function(_0x38e095){try{jsonpatch[_0x6106('0x22')](_0x38e095,_0x52c3af,!![]);}catch(_0x598c2c){return BPromise[_0x6106('0x23')](_0x598c2c);}return _0x38e095[_0x6106('0x24')]();};}function saveUpdates(_0x3b071d,_0x2fd847){return function(_0x16f6dc){if(_0x16f6dc){return _0x16f6dc[_0x6106('0x25')](_0x3b071d)['then'](function(_0x2a6741){return _0x2a6741;});}return null;};}function removeEntity(_0x57b4b1,_0x949db9){return function(_0x36ef5b){if(_0x36ef5b){return _0x36ef5b['destroy']()['then'](function(){var _0x225696=_0x36ef5b['get']({'plain':!![]});var _0x206505=_0x6106('0x26');return db[_0x6106('0x27')]['destroy']({'where':{'type':_0x206505,'resourceId':_0x225696['id']}})[_0x6106('0x28')](function(){return _0x36ef5b;});})[_0x6106('0x28')](function(){_0x57b4b1[_0x6106('0x1a')](0xcc)[_0x6106('0x29')]();});}};}function handleEntityNotFound(_0x4fd491,_0x5738f2){return function(_0x496506){if(!_0x496506){_0x4fd491[_0x6106('0x19')](0x194);}return _0x496506;};}function handleError(_0x49fdbf,_0x5557d9){_0x5557d9=_0x5557d9||0x1f4;return function(_0x40916b){logger[_0x6106('0x2a')](_0x40916b[_0x6106('0x2b')]);if(_0x40916b['name']){delete _0x40916b['name'];}_0x49fdbf[_0x6106('0x1a')](_0x5557d9)[_0x6106('0x2c')](_0x40916b);};}exports[_0x6106('0x2d')]=function(_0x80edfe,_0x31424d){var _0x51e8ef={},_0x2de0c2={},_0x213319={'count':0x0,'rows':[]};var _0x2e7c29=_[_0x6106('0x2e')](db['CannedAnswer'][_0x6106('0x2f')],function(_0x510d6d){return{'name':_0x510d6d[_0x6106('0x30')],'type':_0x510d6d[_0x6106('0x31')]['key']};});_0x2de0c2[_0x6106('0x32')]=_[_0x6106('0x2e')](_0x2e7c29,_0x6106('0x33'));_0x2de0c2[_0x6106('0x34')]=_[_0x6106('0x35')](_0x80edfe[_0x6106('0x34')]);_0x2de0c2[_0x6106('0x36')]=_[_0x6106('0x37')](_0x2de0c2[_0x6106('0x32')],_0x2de0c2[_0x6106('0x34')]);_0x51e8ef[_0x6106('0x38')]=_['intersection'](_0x2de0c2[_0x6106('0x32')],qs[_0x6106('0x39')](_0x80edfe[_0x6106('0x34')][_0x6106('0x39')]));_0x51e8ef[_0x6106('0x38')]=_0x51e8ef['attributes']['length']?_0x51e8ef[_0x6106('0x38')]:_0x2de0c2[_0x6106('0x32')];if(!_0x80edfe[_0x6106('0x34')][_0x6106('0x3a')](_0x6106('0x3b'))){_0x51e8ef[_0x6106('0x1d')]=qs[_0x6106('0x1d')](_0x80edfe[_0x6106('0x34')][_0x6106('0x1d')]);_0x51e8ef['offset']=qs['offset'](_0x80edfe[_0x6106('0x34')]['offset']);}_0x51e8ef[_0x6106('0x3c')]=qs[_0x6106('0x3d')](_0x80edfe[_0x6106('0x34')][_0x6106('0x3d')]);_0x51e8ef[_0x6106('0x3e')]=qs[_0x6106('0x36')](_[_0x6106('0x3f')](_0x80edfe['query'],_0x2de0c2[_0x6106('0x36')]),_0x2e7c29);if(_0x80edfe[_0x6106('0x34')][_0x6106('0x40')]){_0x51e8ef[_0x6106('0x3e')]=_['merge'](_0x51e8ef['where'],{'$or':[{'key':{'$like':'%'+_0x80edfe[_0x6106('0x34')][_0x6106('0x40')]+'%'}},{'value':{'$like':'%'+_0x80edfe['query']['filter']+'%'}}]});}_0x51e8ef=_['merge']({},_0x51e8ef,_0x80edfe[_0x6106('0x41')]);var _0x11d66a={'where':_0x51e8ef[_0x6106('0x3e')]};return db['CannedAnswer'][_0x6106('0x1e')](_0x11d66a)[_0x6106('0x28')](function(_0x142812){_0x213319['count']=_0x142812;if(_0x80edfe['query'][_0x6106('0x42')]){_0x51e8ef[_0x6106('0x43')]=[{'all':!![]}];}return db[_0x6106('0x44')][_0x6106('0x45')](_0x51e8ef);})[_0x6106('0x28')](function(_0x1e4ff8){_0x213319[_0x6106('0x46')]=_0x1e4ff8;return _0x213319;})[_0x6106('0x28')](respondWithFilteredResult(_0x31424d,_0x51e8ef))['catch'](handleError(_0x31424d,null));};exports['show']=function(_0x553b98,_0x412157){var _0x545cb1={'raw':!![],'where':{'id':_0x553b98[_0x6106('0x47')]['id']}},_0x9f2408={};_0x9f2408[_0x6106('0x32')]=_[_0x6106('0x35')](db[_0x6106('0x44')]['rawAttributes']);_0x9f2408['query']=_[_0x6106('0x35')](_0x553b98[_0x6106('0x34')]);_0x9f2408[_0x6106('0x36')]=_['intersection'](_0x9f2408[_0x6106('0x32')],_0x9f2408[_0x6106('0x34')]);_0x545cb1[_0x6106('0x38')]=_[_0x6106('0x37')](_0x9f2408[_0x6106('0x32')],qs['fields'](_0x553b98['query'][_0x6106('0x39')]));_0x545cb1[_0x6106('0x38')]=_0x545cb1[_0x6106('0x38')][_0x6106('0x48')]?_0x545cb1['attributes']:_0x9f2408[_0x6106('0x32')];if(_0x553b98[_0x6106('0x34')]['includeAll']){_0x545cb1[_0x6106('0x43')]=[{'all':!![]}];}_0x545cb1=_[_0x6106('0x49')]({},_0x545cb1,_0x553b98['options']);return db[_0x6106('0x44')][_0x6106('0x4a')](_0x545cb1)[_0x6106('0x28')](handleEntityNotFound(_0x412157,null))['then'](respondWithResult(_0x412157,null))[_0x6106('0x4b')](handleError(_0x412157,null));};exports['update']=function(_0x464dd2,_0x333c9a){if(_0x464dd2[_0x6106('0x4c')]['id']){delete _0x464dd2[_0x6106('0x4c')]['id'];}return db[_0x6106('0x44')][_0x6106('0x4a')]({'where':{'id':_0x464dd2[_0x6106('0x47')]['id']}})[_0x6106('0x28')](handleEntityNotFound(_0x333c9a,null))[_0x6106('0x28')](saveUpdates(_0x464dd2[_0x6106('0x4c')],null))[_0x6106('0x28')](respondWithResult(_0x333c9a,null))[_0x6106('0x4b')](handleError(_0x333c9a,null));};exports[_0x6106('0x4d')]=function(_0x369d81,_0x41a3a3){return db['CannedAnswer']['find']({'where':{'id':_0x369d81['params']['id']}})[_0x6106('0x28')](handleEntityNotFound(_0x41a3a3,null))['then'](removeEntity(_0x41a3a3,null))['catch'](handleError(_0x41a3a3,null));};exports[_0x6106('0x4e')]=function(_0x275844,_0x2cc36d){var _0x43bcef={'key':_0x275844[_0x6106('0x4c')]['key']};if(_0x275844[_0x6106('0x4c')][_0x6106('0x4f')]){_0x43bcef[_0x6106('0x4f')]=_0x275844[_0x6106('0x4c')]['MailAccountId'];}else if(_0x275844[_0x6106('0x4c')][_0x6106('0x50')]){_0x43bcef['SmsAccountId']=_0x275844['body'][_0x6106('0x50')];}else if(_0x275844['body'][_0x6106('0x51')]){_0x43bcef[_0x6106('0x51')]=_0x275844['body'][_0x6106('0x51')];}else if(_0x275844[_0x6106('0x4c')][_0x6106('0x52')]){_0x43bcef[_0x6106('0x52')]=_0x275844[_0x6106('0x4c')]['ChatWebsiteId'];}return db[_0x6106('0x44')]['find']({'where':_0x43bcef})[_0x6106('0x28')](function(_0x5cdfad){if(_0x5cdfad){throw new db[(_0x6106('0x53'))][(_0x6106('0x54'))](_0x6106('0x55'));}return db['CannedAnswer']['create'](_0x275844[_0x6106('0x4c')]);})[_0x6106('0x28')](function(_0x2b425b){var _0x2fbbbf=_0x275844[_0x6106('0x56')][_0x6106('0x57')]({'plain':!![]});if(!_0x2fbbbf)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2fbbbf[_0x6106('0x58')]==='user'){var _0x478695=_0x2b425b[_0x6106('0x57')]({'plain':!![]});return db['UserProfileSection'][_0x6106('0x4a')]({'where':{'name':_0x6106('0x26'),'userProfileId':_0x2fbbbf[_0x6106('0x59')]},'raw':!![]})[_0x6106('0x28')](function(_0x5aaaf3){if(_0x5aaaf3&&_0x5aaaf3[_0x6106('0x5a')]===0x0){return db['UserProfileResource']['create']({'name':_0x478695[_0x6106('0x33')],'resourceId':_0x478695['id'],'type':_0x5aaaf3[_0x6106('0x33')],'sectionId':_0x5aaaf3['id']},{})[_0x6106('0x28')](function(){return _0x2b425b;});}else{return _0x2b425b;}})[_0x6106('0x4b')](function(_0x2a87f8){logger[_0x6106('0x2a')](_0x6106('0x5b'),_0x2a87f8);throw _0x2a87f8;});}return _0x2b425b;})[_0x6106('0x28')](respondWithResult(_0x2cc36d,0xc9))[_0x6106('0x4b')](handleError(_0x2cc36d,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index 6146084..30007ee 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 _0xabc0=['utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','CannedAnswer','tools_canned_answers','utf8mb4'];(function(_0x530b29,_0x30dff4){var _0x3a4c1a=function(_0x6498e8){while(--_0x6498e8){_0x530b29['push'](_0x530b29['shift']());}};_0x3a4c1a(++_0x30dff4);}(_0xabc0,0x16d));var _0x0abc=function(_0x33cd12,_0x8e8b30){_0x33cd12=_0x33cd12-0x0;var _0x483b8d=_0xabc0[_0x33cd12];return _0x483b8d;};'use strict';var _=require(_0x0abc('0x0'));var util=require(_0x0abc('0x1'));var logger=require(_0x0abc('0x2'))(_0x0abc('0x3'));var moment=require(_0x0abc('0x4'));var BPromise=require('bluebird');var rp=require(_0x0abc('0x5'));var fs=require('fs');var path=require(_0x0abc('0x6'));var rimraf=require(_0x0abc('0x7'));var config=require(_0x0abc('0x8'));var attributes=require('./cannedAnswer.attributes');module[_0x0abc('0x9')]=function(_0x214f2f,_0x3336ee){return _0x214f2f['define'](_0x0abc('0xa'),attributes,{'tableName':_0x0abc('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x0abc('0xc'),'collate':_0x0abc('0xd')});}; \ No newline at end of file +var _0x29fa=['../../config/environment','./cannedAnswer.attributes','define','CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','path'];(function(_0x356261,_0x313d43){var _0x53269a=function(_0x4cc384){while(--_0x4cc384){_0x356261['push'](_0x356261['shift']());}};_0x53269a(++_0x313d43);}(_0x29fa,0x1e8));var _0xa29f=function(_0x35fabd,_0x825452){_0x35fabd=_0x35fabd-0x0;var _0x61a8ee=_0x29fa[_0x35fabd];return _0x61a8ee;};'use strict';var _=require(_0xa29f('0x0'));var util=require(_0xa29f('0x1'));var logger=require('../../config/logger')(_0xa29f('0x2'));var moment=require(_0xa29f('0x3'));var BPromise=require(_0xa29f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa29f('0x5'));var rimraf=require('rimraf');var config=require(_0xa29f('0x6'));var attributes=require(_0xa29f('0x7'));module['exports']=function(_0xefee8b,_0x12c632){return _0xefee8b[_0xa29f('0x8')](_0xa29f('0x9'),attributes,{'tableName':_0xa29f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa29f('0xb'),'collate':_0xa29f('0xc')});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index 065026d..2b2395a 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(_0x1013eb,_0x4e850e){var _0x315721=function(_0x1c5242){while(--_0x1c5242){_0x1013eb['push'](_0x1013eb['shift']());}};_0x315721(++_0x4e850e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0xa9e0[_0x43d11d];return _0x38cd08;};'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(_0x24cbd3,_0x231762){var _0x1c802f=function(_0x19a9ee){while(--_0x19a9ee){_0x24cbd3['push'](_0x24cbd3['shift']());}};_0x1c802f(++_0x231762);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xa9e0[_0x9df060];return _0x338dfe;};'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 7cf1e20..d4b3d47 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 _0x2c33=['fs-extra','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','index','/:id','post','put','update','delete','destroy','exports','multer','util','path','express','Router'];(function(_0xa8c896,_0x163116){var _0x3fac5b=function(_0x555e59){while(--_0x555e59){_0xa8c896['push'](_0xa8c896['shift']());}};_0x3fac5b(++_0x163116);}(_0x2c33,0x13e));var _0x32c3=function(_0x2a11f6,_0x59eb3a){_0x2a11f6=_0x2a11f6-0x0;var _0x1a9ef9=_0x2c33[_0x2a11f6];return _0x1a9ef9;};'use strict';var multer=require(_0x32c3('0x0'));var util=require(_0x32c3('0x1'));var path=require(_0x32c3('0x2'));var timeout=require('connect-timeout');var express=require(_0x32c3('0x3'));var router=express[_0x32c3('0x4')]();var fs_extra=require(_0x32c3('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x32c3('0x6'));var config=require(_0x32c3('0x7'));var controller=require(_0x32c3('0x8'));router[_0x32c3('0x9')]('/',auth[_0x32c3('0xa')](),controller[_0x32c3('0xb')]);router[_0x32c3('0x9')](_0x32c3('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x32c3('0xd')]('/',auth[_0x32c3('0xa')](),controller['create']);router[_0x32c3('0xe')](_0x32c3('0xc'),auth['isAuthenticated'](),controller[_0x32c3('0xf')]);router[_0x32c3('0x10')](_0x32c3('0xc'),auth[_0x32c3('0xa')](),controller[_0x32c3('0x11')]);module[_0x32c3('0x12')]=router; \ No newline at end of file +var _0x9a27=['fs-extra','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','isAuthenticated','index','get','/:id','show','post','create','update','delete','exports','multer','path','connect-timeout','express','Router'];(function(_0x2f48e9,_0x1bd1b4){var _0x34d5bb=function(_0x399242){while(--_0x399242){_0x2f48e9['push'](_0x2f48e9['shift']());}};_0x34d5bb(++_0x1bd1b4);}(_0x9a27,0x118));var _0x79a2=function(_0x3c38fc,_0x3582a2){_0x3c38fc=_0x3c38fc-0x0;var _0x875b73=_0x9a27[_0x3c38fc];return _0x875b73;};'use strict';var multer=require(_0x79a2('0x0'));var util=require('util');var path=require(_0x79a2('0x1'));var timeout=require(_0x79a2('0x2'));var express=require(_0x79a2('0x3'));var router=express[_0x79a2('0x4')]();var fs_extra=require(_0x79a2('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x79a2('0x6'));var config=require(_0x79a2('0x7'));var controller=require(_0x79a2('0x8'));router['get']('/',auth[_0x79a2('0x9')](),controller[_0x79a2('0xa')]);router[_0x79a2('0xb')](_0x79a2('0xc'),auth[_0x79a2('0x9')](),controller[_0x79a2('0xd')]);router[_0x79a2('0xe')]('/',auth[_0x79a2('0x9')](),controller[_0x79a2('0xf')]);router['put'](_0x79a2('0xc'),auth['isAuthenticated'](),controller[_0x79a2('0x10')]);router[_0x79a2('0x11')](_0x79a2('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x79a2('0x12')]=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index c22fd35..9858888 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 _0x98b8=['1970-01-01\x2000:00:01','STRING','INTEGER','sequelize','exports','DATE'];(function(_0x4373a8,_0x201514){var _0x3bfabe=function(_0x47eb6c){while(--_0x47eb6c){_0x4373a8['push'](_0x4373a8['shift']());}};_0x3bfabe(++_0x201514);}(_0x98b8,0x93));var _0x898b=function(_0x563a7e,_0x4d543a){_0x563a7e=_0x563a7e-0x0;var _0x4f7bd4=_0x98b8[_0x563a7e];return _0x4f7bd4;};'use strict';var Sequelize=require(_0x898b('0x0'));module[_0x898b('0x1')]={'calldate':{'type':Sequelize[_0x898b('0x2')],'allowNull':![],'defaultValue':_0x898b('0x3')},'clid':{'type':Sequelize[_0x898b('0x4')]},'src':{'type':Sequelize[_0x898b('0x4')]},'dst':{'type':Sequelize[_0x898b('0x4')]},'dcontext':{'type':Sequelize[_0x898b('0x4')]},'channel':{'type':Sequelize[_0x898b('0x4')]},'dstchannel':{'type':Sequelize[_0x898b('0x4')]},'lastapp':{'type':Sequelize[_0x898b('0x4')]},'lastdata':{'type':Sequelize[_0x898b('0x4')]},'duration':{'type':Sequelize[_0x898b('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x898b('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x898b('0x4')]},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x898b('0x4')]},'userfield':{'type':Sequelize[_0x898b('0x4')]},'uniqueid':{'type':Sequelize[_0x898b('0x4')]},'linkedid':{'type':Sequelize[_0x898b('0x4')]},'sequence':{'type':Sequelize[_0x898b('0x4')]},'peeraccount':{'type':Sequelize[_0x898b('0x4')]},'type':{'type':Sequelize[_0x898b('0x4')]},'tag':{'type':Sequelize[_0x898b('0x4')]}}; \ No newline at end of file +var _0x8ce3=['sequelize','exports','1970-01-01\x2000:00:01','STRING','INTEGER'];(function(_0x3718b7,_0x2da677){var _0xf8c91e=function(_0x2519b4){while(--_0x2519b4){_0x3718b7['push'](_0x3718b7['shift']());}};_0xf8c91e(++_0x2da677);}(_0x8ce3,0xc3));var _0x38ce=function(_0x7978a5,_0x5a4e10){_0x7978a5=_0x7978a5-0x0;var _0x5a7ad3=_0x8ce3[_0x7978a5];return _0x5a7ad3;};'use strict';var Sequelize=require(_0x38ce('0x0'));module[_0x38ce('0x1')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0x38ce('0x2')},'clid':{'type':Sequelize[_0x38ce('0x3')]},'src':{'type':Sequelize[_0x38ce('0x3')]},'dst':{'type':Sequelize[_0x38ce('0x3')]},'dcontext':{'type':Sequelize[_0x38ce('0x3')]},'channel':{'type':Sequelize[_0x38ce('0x3')]},'dstchannel':{'type':Sequelize[_0x38ce('0x3')]},'lastapp':{'type':Sequelize[_0x38ce('0x3')]},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0x38ce('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x38ce('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x38ce('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x38ce('0x3')]},'userfield':{'type':Sequelize[_0x38ce('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0x38ce('0x3')]},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize[_0x38ce('0x3')]},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize[_0x38ce('0x3')]}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index ec2f3f3..4976687 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 _0x6c7b=['apply','reject','update','then','error','stack','name','send','index','map','Cdr','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','findAll','rows','params','includeAll','include','find','catch','create','body','destroy','describe','eml-format','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range'];(function(_0x34b87f,_0x28aef2){var _0x449805=function(_0x3735b7){while(--_0x3735b7){_0x34b87f['push'](_0x34b87f['shift']());}};_0x449805(++_0x28aef2);}(_0x6c7b,0x10b));var _0xb6c7=function(_0x2067da,_0x231256){_0x2067da=_0x2067da-0x0;var _0x348f8b=_0x6c7b[_0x2067da];return _0x348f8b;};'use strict';var emlformat=require(_0xb6c7('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xb6c7('0x1'));var moment=require('moment');var BPromise=require(_0xb6c7('0x2'));var Mustache=require(_0xb6c7('0x3'));var util=require(_0xb6c7('0x4'));var path=require('path');var sox=require(_0xb6c7('0x5'));var csv=require(_0xb6c7('0x6'));var ejs=require(_0xb6c7('0x7'));var fs=require('fs');var fs_extra=require(_0xb6c7('0x8'));var _=require(_0xb6c7('0x9'));var squel=require('squel');var crypto=require(_0xb6c7('0xa'));var jsforce=require(_0xb6c7('0xb'));var deskjs=require(_0xb6c7('0xc'));var toCsv=require(_0xb6c7('0x6'));var querystring=require(_0xb6c7('0xd'));var Papa=require(_0xb6c7('0xe'));var Redis=require(_0xb6c7('0xf'));var authService=require(_0xb6c7('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb6c7('0x11'));var logger=require(_0xb6c7('0x12'))(_0xb6c7('0x13'));var utils=require(_0xb6c7('0x14'));var config=require(_0xb6c7('0x15'));var licenseUtil=require(_0xb6c7('0x16'));var db=require(_0xb6c7('0x17'))['db'];function respondWithStatusCode(_0x50c2de,_0x9b32b7){_0x9b32b7=_0x9b32b7||0xcc;return function(_0xa858c5){if(_0xa858c5){return _0x50c2de[_0xb6c7('0x18')](_0x9b32b7);}return _0x50c2de[_0xb6c7('0x19')](_0x9b32b7)[_0xb6c7('0x1a')]();};}function respondWithResult(_0x383ac5,_0x147e4a){_0x147e4a=_0x147e4a||0xc8;return function(_0x561eb4){if(_0x561eb4){return _0x383ac5[_0xb6c7('0x19')](_0x147e4a)['json'](_0x561eb4);}};}function respondWithFilteredResult(_0x480d9a,_0x5d5428){return function(_0x19c145){if(_0x19c145){var _0x48b7ec=typeof _0x5d5428[_0xb6c7('0x1b')]===_0xb6c7('0x1c')&&typeof _0x5d5428[_0xb6c7('0x1d')]===_0xb6c7('0x1c');var _0x209659=_0x19c145[_0xb6c7('0x1e')];var _0x2c819d=_0x48b7ec?0x0:_0x5d5428[_0xb6c7('0x1b')];var _0x1a591f=_0x48b7ec?_0x19c145[_0xb6c7('0x1e')]:_0x5d5428[_0xb6c7('0x1b')]+_0x5d5428[_0xb6c7('0x1d')];var _0x3beafa;if(_0x1a591f>=_0x209659){_0x1a591f=_0x209659;_0x3beafa=0xc8;}else{_0x3beafa=0xce;}_0x480d9a['status'](_0x3beafa);return _0x480d9a[_0xb6c7('0x1f')](_0xb6c7('0x20'),_0x2c819d+'-'+_0x1a591f+'/'+_0x209659)['json'](_0x19c145);}return null;};}function patchUpdates(_0x25ca5d){return function(_0x5a1c0a){try{jsonpatch[_0xb6c7('0x21')](_0x5a1c0a,_0x25ca5d,!![]);}catch(_0x5b7ebf){return BPromise[_0xb6c7('0x22')](_0x5b7ebf);}return _0x5a1c0a['save']();};}function saveUpdates(_0x24c0b3,_0x146dd4){return function(_0x4a4788){if(_0x4a4788){return _0x4a4788[_0xb6c7('0x23')](_0x24c0b3)[_0xb6c7('0x24')](function(_0x2081a6){return _0x2081a6;});}return null;};}function removeEntity(_0x4232b6,_0xd33675){return function(_0x1ee45d){if(_0x1ee45d){return _0x1ee45d['destroy']()[_0xb6c7('0x24')](function(){_0x4232b6[_0xb6c7('0x19')](0xcc)[_0xb6c7('0x1a')]();});}};}function handleEntityNotFound(_0x418920,_0x5ed41e){return function(_0x1eb265){if(!_0x1eb265){_0x418920[_0xb6c7('0x18')](0x194);}return _0x1eb265;};}function handleError(_0x49909e,_0x1eee74){_0x1eee74=_0x1eee74||0x1f4;return function(_0x164801){logger[_0xb6c7('0x25')](_0x164801[_0xb6c7('0x26')]);if(_0x164801['name']){delete _0x164801[_0xb6c7('0x27')];}_0x49909e['status'](_0x1eee74)[_0xb6c7('0x28')](_0x164801);};}exports[_0xb6c7('0x29')]=function(_0x232f7f,_0x5f3be2){var _0x47acab={},_0x4f19da={},_0x438dc3={'count':0x0,'rows':[]};var _0xcd9464=_[_0xb6c7('0x2a')](db[_0xb6c7('0x2b')][_0xb6c7('0x2c')],function(_0x1b4180){return{'name':_0x1b4180[_0xb6c7('0x2d')],'type':_0x1b4180[_0xb6c7('0x2e')][_0xb6c7('0x2f')]};});_0x4f19da[_0xb6c7('0x30')]=_['map'](_0xcd9464,_0xb6c7('0x27'));_0x4f19da['query']=_[_0xb6c7('0x31')](_0x232f7f[_0xb6c7('0x32')]);_0x4f19da[_0xb6c7('0x33')]=_[_0xb6c7('0x34')](_0x4f19da[_0xb6c7('0x30')],_0x4f19da['query']);_0x47acab['attributes']=_['intersection'](_0x4f19da[_0xb6c7('0x30')],qs[_0xb6c7('0x35')](_0x232f7f['query'][_0xb6c7('0x35')]));_0x47acab[_0xb6c7('0x36')]=_0x47acab['attributes'][_0xb6c7('0x37')]?_0x47acab[_0xb6c7('0x36')]:_0x4f19da[_0xb6c7('0x30')];if(!_0x232f7f[_0xb6c7('0x32')][_0xb6c7('0x38')](_0xb6c7('0x39'))){_0x47acab['limit']=qs[_0xb6c7('0x1d')](_0x232f7f[_0xb6c7('0x32')][_0xb6c7('0x1d')]);_0x47acab[_0xb6c7('0x1b')]=qs[_0xb6c7('0x1b')](_0x232f7f[_0xb6c7('0x32')][_0xb6c7('0x1b')]);}_0x47acab['order']=qs['sort'](_0x232f7f[_0xb6c7('0x32')][_0xb6c7('0x3a')]);_0x47acab[_0xb6c7('0x3b')]=qs[_0xb6c7('0x33')](_[_0xb6c7('0x3c')](_0x232f7f[_0xb6c7('0x32')],_0x4f19da[_0xb6c7('0x33')]),_0xcd9464);if(_0x232f7f[_0xb6c7('0x32')][_0xb6c7('0x3d')]){_0x47acab[_0xb6c7('0x3b')]=_['merge'](_0x47acab[_0xb6c7('0x3b')],{'$or':_['map'](_0xcd9464,function(_0x5836e9){if(_0x5836e9[_0xb6c7('0x2e')]!=='VIRTUAL'){var _0x3af5be={};_0x3af5be[_0x5836e9[_0xb6c7('0x27')]]={'$like':'%'+_0x232f7f['query'][_0xb6c7('0x3d')]+'%'};return _0x3af5be;}})});}_0x47acab=_[_0xb6c7('0x3e')]({},_0x47acab,_0x232f7f[_0xb6c7('0x3f')]);var _0x84861f={'where':_0x47acab[_0xb6c7('0x3b')]};return db['Cdr']['count'](_0x84861f)[_0xb6c7('0x24')](function(_0xb575){_0x438dc3[_0xb6c7('0x1e')]=_0xb575;if(_0x232f7f[_0xb6c7('0x32')]['includeAll']){_0x47acab['include']=[{'all':!![]}];}return db[_0xb6c7('0x2b')][_0xb6c7('0x40')](_0x47acab);})[_0xb6c7('0x24')](function(_0x214d04){_0x438dc3[_0xb6c7('0x41')]=_0x214d04;return _0x438dc3;})['then'](respondWithFilteredResult(_0x5f3be2,_0x47acab))['catch'](handleError(_0x5f3be2,null));};exports['show']=function(_0x45369e,_0x80ee40){var _0x4462dc={'raw':!![],'where':{'id':_0x45369e[_0xb6c7('0x42')]['id']}},_0x5050c9={};_0x5050c9[_0xb6c7('0x30')]=_['keys'](db[_0xb6c7('0x2b')][_0xb6c7('0x2c')]);_0x5050c9[_0xb6c7('0x32')]=_[_0xb6c7('0x31')](_0x45369e[_0xb6c7('0x32')]);_0x5050c9['filters']=_[_0xb6c7('0x34')](_0x5050c9[_0xb6c7('0x30')],_0x5050c9[_0xb6c7('0x32')]);_0x4462dc['attributes']=_['intersection'](_0x5050c9[_0xb6c7('0x30')],qs[_0xb6c7('0x35')](_0x45369e[_0xb6c7('0x32')]['fields']));_0x4462dc['attributes']=_0x4462dc['attributes'][_0xb6c7('0x37')]?_0x4462dc[_0xb6c7('0x36')]:_0x5050c9[_0xb6c7('0x30')];if(_0x45369e[_0xb6c7('0x32')][_0xb6c7('0x43')]){_0x4462dc[_0xb6c7('0x44')]=[{'all':!![]}];}_0x4462dc=_[_0xb6c7('0x3e')]({},_0x4462dc,_0x45369e['options']);return db[_0xb6c7('0x2b')][_0xb6c7('0x45')](_0x4462dc)[_0xb6c7('0x24')](handleEntityNotFound(_0x80ee40,null))[_0xb6c7('0x24')](respondWithResult(_0x80ee40,null))[_0xb6c7('0x46')](handleError(_0x80ee40,null));};exports['create']=function(_0x33b9a2,_0x40bbff){return db[_0xb6c7('0x2b')][_0xb6c7('0x47')](_0x33b9a2[_0xb6c7('0x48')],{})[_0xb6c7('0x24')](respondWithResult(_0x40bbff,0xc9))['catch'](handleError(_0x40bbff,null));};exports[_0xb6c7('0x23')]=function(_0x141cd5,_0x2116cb){if(_0x141cd5[_0xb6c7('0x48')]['id']){delete _0x141cd5[_0xb6c7('0x48')]['id'];}return db[_0xb6c7('0x2b')][_0xb6c7('0x45')]({'where':{'id':_0x141cd5['params']['id']}})['then'](handleEntityNotFound(_0x2116cb,null))['then'](saveUpdates(_0x141cd5[_0xb6c7('0x48')],null))[_0xb6c7('0x24')](respondWithResult(_0x2116cb,null))[_0xb6c7('0x46')](handleError(_0x2116cb,null));};exports[_0xb6c7('0x49')]=function(_0x2278c0,_0x2002f8){return db['Cdr']['find']({'where':{'id':_0x2278c0[_0xb6c7('0x42')]['id']}})['then'](handleEntityNotFound(_0x2002f8,null))[_0xb6c7('0x24')](removeEntity(_0x2002f8,null))[_0xb6c7('0x46')](handleError(_0x2002f8,null));};exports[_0xb6c7('0x4a')]=function(_0x210d50,_0x317a4b){return db['Cdr'][_0xb6c7('0x4a')]()['then'](respondWithResult(_0x317a4b,null))[_0xb6c7('0x46')](handleError(_0x317a4b,null));}; \ No newline at end of file +var _0xb4c7=['Cdr','rawAttributes','fieldName','type','query','keys','intersection','model','attributes','fields','hasOwnProperty','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','include','rows','catch','params','includeAll','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map'];(function(_0x592b7a,_0x50edb5){var _0x373ee2=function(_0x562eb4){while(--_0x562eb4){_0x592b7a['push'](_0x592b7a['shift']());}};_0x373ee2(++_0x50edb5);}(_0xb4c7,0x1ea));var _0x7b4c=function(_0x4df40d,_0x576e5f){_0x4df40d=_0x4df40d-0x0;var _0x9fda22=_0xb4c7[_0x4df40d];return _0x9fda22;};'use strict';var emlformat=require(_0x7b4c('0x0'));var rimraf=require(_0x7b4c('0x1'));var zipdir=require(_0x7b4c('0x2'));var jsonpatch=require(_0x7b4c('0x3'));var rp=require(_0x7b4c('0x4'));var moment=require('moment');var BPromise=require(_0x7b4c('0x5'));var Mustache=require(_0x7b4c('0x6'));var util=require(_0x7b4c('0x7'));var path=require(_0x7b4c('0x8'));var sox=require(_0x7b4c('0x9'));var csv=require('to-csv');var ejs=require(_0x7b4c('0xa'));var fs=require('fs');var fs_extra=require(_0x7b4c('0xb'));var _=require(_0x7b4c('0xc'));var squel=require('squel');var crypto=require(_0x7b4c('0xd'));var jsforce=require(_0x7b4c('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x7b4c('0xf'));var querystring=require(_0x7b4c('0x10'));var Papa=require(_0x7b4c('0x11'));var Redis=require(_0x7b4c('0x12'));var authService=require(_0x7b4c('0x13'));var qs=require(_0x7b4c('0x14'));var as=require(_0x7b4c('0x15'));var hardwareService=require(_0x7b4c('0x16'));var logger=require(_0x7b4c('0x17'))(_0x7b4c('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x7b4c('0x19'));var db=require(_0x7b4c('0x1a'))['db'];function respondWithStatusCode(_0x38656b,_0x1722ad){_0x1722ad=_0x1722ad||0xcc;return function(_0x3e1558){if(_0x3e1558){return _0x38656b[_0x7b4c('0x1b')](_0x1722ad);}return _0x38656b[_0x7b4c('0x1c')](_0x1722ad)[_0x7b4c('0x1d')]();};}function respondWithResult(_0x25b90b,_0x387488){_0x387488=_0x387488||0xc8;return function(_0x593a19){if(_0x593a19){return _0x25b90b[_0x7b4c('0x1c')](_0x387488)[_0x7b4c('0x1e')](_0x593a19);}};}function respondWithFilteredResult(_0xdc71cd,_0x2a0e2f){return function(_0xa0a812){if(_0xa0a812){var _0x2471b3=typeof _0x2a0e2f[_0x7b4c('0x1f')]===_0x7b4c('0x20')&&typeof _0x2a0e2f['limit']===_0x7b4c('0x20');var _0xe71d88=_0xa0a812[_0x7b4c('0x21')];var _0x36c02a=_0x2471b3?0x0:_0x2a0e2f['offset'];var _0x3ce10c=_0x2471b3?_0xa0a812[_0x7b4c('0x21')]:_0x2a0e2f[_0x7b4c('0x1f')]+_0x2a0e2f[_0x7b4c('0x22')];var _0x2d4c72;if(_0x3ce10c>=_0xe71d88){_0x3ce10c=_0xe71d88;_0x2d4c72=0xc8;}else{_0x2d4c72=0xce;}_0xdc71cd[_0x7b4c('0x1c')](_0x2d4c72);return _0xdc71cd[_0x7b4c('0x23')](_0x7b4c('0x24'),_0x36c02a+'-'+_0x3ce10c+'/'+_0xe71d88)[_0x7b4c('0x1e')](_0xa0a812);}return null;};}function patchUpdates(_0x55e3df){return function(_0x1f06ec){try{jsonpatch[_0x7b4c('0x25')](_0x1f06ec,_0x55e3df,!![]);}catch(_0x11996d){return BPromise[_0x7b4c('0x26')](_0x11996d);}return _0x1f06ec[_0x7b4c('0x27')]();};}function saveUpdates(_0x168ac9,_0x176704){return function(_0x3d4826){if(_0x3d4826){return _0x3d4826[_0x7b4c('0x28')](_0x168ac9)[_0x7b4c('0x29')](function(_0x5eec1e){return _0x5eec1e;});}return null;};}function removeEntity(_0x45438c,_0x4350c9){return function(_0x276271){if(_0x276271){return _0x276271[_0x7b4c('0x2a')]()[_0x7b4c('0x29')](function(){_0x45438c[_0x7b4c('0x1c')](0xcc)[_0x7b4c('0x1d')]();});}};}function handleEntityNotFound(_0x459eb4,_0x1f311e){return function(_0x1a69db){if(!_0x1a69db){_0x459eb4[_0x7b4c('0x1b')](0x194);}return _0x1a69db;};}function handleError(_0x257da2,_0x316e5f){_0x316e5f=_0x316e5f||0x1f4;return function(_0x501f75){logger[_0x7b4c('0x2b')](_0x501f75[_0x7b4c('0x2c')]);if(_0x501f75[_0x7b4c('0x2d')]){delete _0x501f75[_0x7b4c('0x2d')];}_0x257da2[_0x7b4c('0x1c')](_0x316e5f)[_0x7b4c('0x2e')](_0x501f75);};}exports[_0x7b4c('0x2f')]=function(_0x2552f9,_0x3e4a46){var _0x9a799b={},_0x3585cd={},_0x130ace={'count':0x0,'rows':[]};var _0x3544bc=_[_0x7b4c('0x30')](db[_0x7b4c('0x31')][_0x7b4c('0x32')],function(_0x1d0724){return{'name':_0x1d0724[_0x7b4c('0x33')],'type':_0x1d0724[_0x7b4c('0x34')]['key']};});_0x3585cd['model']=_['map'](_0x3544bc,_0x7b4c('0x2d'));_0x3585cd[_0x7b4c('0x35')]=_[_0x7b4c('0x36')](_0x2552f9[_0x7b4c('0x35')]);_0x3585cd['filters']=_[_0x7b4c('0x37')](_0x3585cd[_0x7b4c('0x38')],_0x3585cd['query']);_0x9a799b[_0x7b4c('0x39')]=_['intersection'](_0x3585cd[_0x7b4c('0x38')],qs[_0x7b4c('0x3a')](_0x2552f9[_0x7b4c('0x35')]['fields']));_0x9a799b[_0x7b4c('0x39')]=_0x9a799b[_0x7b4c('0x39')]['length']?_0x9a799b[_0x7b4c('0x39')]:_0x3585cd[_0x7b4c('0x38')];if(!_0x2552f9[_0x7b4c('0x35')][_0x7b4c('0x3b')]('nolimit')){_0x9a799b['limit']=qs[_0x7b4c('0x22')](_0x2552f9[_0x7b4c('0x35')]['limit']);_0x9a799b[_0x7b4c('0x1f')]=qs['offset'](_0x2552f9['query'][_0x7b4c('0x1f')]);}_0x9a799b[_0x7b4c('0x3c')]=qs[_0x7b4c('0x3d')](_0x2552f9[_0x7b4c('0x35')]['sort']);_0x9a799b[_0x7b4c('0x3e')]=qs[_0x7b4c('0x3f')](_[_0x7b4c('0x40')](_0x2552f9[_0x7b4c('0x35')],_0x3585cd[_0x7b4c('0x3f')]),_0x3544bc);if(_0x2552f9[_0x7b4c('0x35')][_0x7b4c('0x41')]){_0x9a799b['where']=_['merge'](_0x9a799b[_0x7b4c('0x3e')],{'$or':_[_0x7b4c('0x30')](_0x3544bc,function(_0x31ef1e){if(_0x31ef1e[_0x7b4c('0x34')]!==_0x7b4c('0x42')){var _0x592834={};_0x592834[_0x31ef1e[_0x7b4c('0x2d')]]={'$like':'%'+_0x2552f9[_0x7b4c('0x35')][_0x7b4c('0x41')]+'%'};return _0x592834;}})});}_0x9a799b=_[_0x7b4c('0x43')]({},_0x9a799b,_0x2552f9[_0x7b4c('0x44')]);var _0x25659d={'where':_0x9a799b[_0x7b4c('0x3e')]};return db[_0x7b4c('0x31')][_0x7b4c('0x21')](_0x25659d)['then'](function(_0x2a4085){_0x130ace['count']=_0x2a4085;if(_0x2552f9[_0x7b4c('0x35')]['includeAll']){_0x9a799b[_0x7b4c('0x45')]=[{'all':!![]}];}return db[_0x7b4c('0x31')]['findAll'](_0x9a799b);})['then'](function(_0x354578){_0x130ace[_0x7b4c('0x46')]=_0x354578;return _0x130ace;})[_0x7b4c('0x29')](respondWithFilteredResult(_0x3e4a46,_0x9a799b))[_0x7b4c('0x47')](handleError(_0x3e4a46,null));};exports['show']=function(_0x2b1681,_0x2ed731){var _0x100774={'raw':!![],'where':{'id':_0x2b1681[_0x7b4c('0x48')]['id']}},_0x5d4ed8={};_0x5d4ed8['model']=_['keys'](db[_0x7b4c('0x31')]['rawAttributes']);_0x5d4ed8[_0x7b4c('0x35')]=_[_0x7b4c('0x36')](_0x2b1681[_0x7b4c('0x35')]);_0x5d4ed8[_0x7b4c('0x3f')]=_[_0x7b4c('0x37')](_0x5d4ed8[_0x7b4c('0x38')],_0x5d4ed8[_0x7b4c('0x35')]);_0x100774[_0x7b4c('0x39')]=_[_0x7b4c('0x37')](_0x5d4ed8['model'],qs[_0x7b4c('0x3a')](_0x2b1681['query']['fields']));_0x100774[_0x7b4c('0x39')]=_0x100774[_0x7b4c('0x39')]['length']?_0x100774['attributes']:_0x5d4ed8[_0x7b4c('0x38')];if(_0x2b1681[_0x7b4c('0x35')][_0x7b4c('0x49')]){_0x100774[_0x7b4c('0x45')]=[{'all':!![]}];}_0x100774=_[_0x7b4c('0x43')]({},_0x100774,_0x2b1681[_0x7b4c('0x44')]);return db[_0x7b4c('0x31')][_0x7b4c('0x4a')](_0x100774)['then'](handleEntityNotFound(_0x2ed731,null))[_0x7b4c('0x29')](respondWithResult(_0x2ed731,null))[_0x7b4c('0x47')](handleError(_0x2ed731,null));};exports[_0x7b4c('0x4b')]=function(_0x387efd,_0xc76435){return db[_0x7b4c('0x31')][_0x7b4c('0x4b')](_0x387efd[_0x7b4c('0x4c')],{})[_0x7b4c('0x29')](respondWithResult(_0xc76435,0xc9))['catch'](handleError(_0xc76435,null));};exports['update']=function(_0x1884a4,_0x3f6aaa){if(_0x1884a4[_0x7b4c('0x4c')]['id']){delete _0x1884a4['body']['id'];}return db[_0x7b4c('0x31')][_0x7b4c('0x4a')]({'where':{'id':_0x1884a4['params']['id']}})[_0x7b4c('0x29')](handleEntityNotFound(_0x3f6aaa,null))['then'](saveUpdates(_0x1884a4[_0x7b4c('0x4c')],null))['then'](respondWithResult(_0x3f6aaa,null))[_0x7b4c('0x47')](handleError(_0x3f6aaa,null));};exports['destroy']=function(_0x15d7f1,_0x11faed){return db['Cdr']['find']({'where':{'id':_0x15d7f1[_0x7b4c('0x48')]['id']}})[_0x7b4c('0x29')](handleEntityNotFound(_0x11faed,null))[_0x7b4c('0x29')](removeEntity(_0x11faed,null))['catch'](handleError(_0x11faed,null));};exports['describe']=function(_0x2fc5b5,_0x1c118a){return db['Cdr']['describe']()[_0x7b4c('0x29')](respondWithResult(_0x1c118a,null))[_0x7b4c('0x47')](handleError(_0x1c118a,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index a8642dc..17de4a7 100644 --- a/server/api/cdr/cdr.model.js +++ b/server/api/cdr/cdr.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x4eafcf,_0x458eb5){var _0x431945=function(_0x2f2777){while(--_0x2f2777){_0x4eafcf['push'](_0x4eafcf['shift']());}};_0x431945(++_0x458eb5);}(_0x9957,0x93));var _0x7995=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x9957[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});}; \ No newline at end of file +var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x38031e,_0x4cc6b6){var _0x57af97=function(_0x224d29){while(--_0x224d29){_0x38031e['push'](_0x38031e['shift']());}};_0x57af97(++_0x4cc6b6);}(_0x7a54,0x106));var _0x47a5=function(_0x2da10a,_0x141f11){_0x2da10a=_0x2da10a-0x0;var _0x4a7f18=_0x7a54[_0x2da10a];return _0x4a7f18;};'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 3cd47e3..9d0a03a 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 _0x8709=['../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Cdr,\x20%s,\x20%s','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x8476ab,_0x23ee0d){var _0x1d892d=function(_0x3f6596){while(--_0x3f6596){_0x8476ab['push'](_0x8476ab['shift']());}};_0x1d892d(++_0x23ee0d);}(_0x8709,0x90));var _0x9870=function(_0x4ef7e2,_0x257e37){_0x4ef7e2=_0x4ef7e2-0x0;var _0x84fa8=_0x8709[_0x4ef7e2];return _0x84fa8;};'use strict';var _=require('lodash');var util=require(_0x9870('0x0'));var moment=require(_0x9870('0x1'));var BPromise=require(_0x9870('0x2'));var rs=require(_0x9870('0x3'));var fs=require('fs');var Redis=require(_0x9870('0x4'));var db=require(_0x9870('0x5'))['db'];var utils=require(_0x9870('0x6'));var logger=require(_0x9870('0x7'))(_0x9870('0x8'));var config=require(_0x9870('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x9870('0xa')][_0x9870('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x54b9a6,_0x4ab315,_0x34cf72){return new BPromise(function(_0x1907f6,_0x591d5a){return client[_0x9870('0xc')](_0x54b9a6,_0x34cf72)[_0x9870('0xd')](function(_0x1f5e82){logger['info']('Cdr,\x20%s,\x20%s',_0x4ab315,_0x9870('0xe'));logger[_0x9870('0xf')](_0x9870('0x10'),_0x4ab315,_0x9870('0xe'),JSON[_0x9870('0x11')](_0x1f5e82));if(_0x1f5e82[_0x9870('0x12')]){if(_0x1f5e82['error'][_0x9870('0x13')]===0x1f4){logger[_0x9870('0x12')]('Cdr,\x20%s,\x20%s',_0x4ab315,_0x1f5e82[_0x9870('0x12')][_0x9870('0x14')]);return _0x591d5a(_0x1f5e82[_0x9870('0x12')]['message']);}logger['error'](_0x9870('0x15'),_0x4ab315,_0x1f5e82[_0x9870('0x12')][_0x9870('0x14')]);return _0x1907f6(_0x1f5e82[_0x9870('0x12')][_0x9870('0x14')]);}else{logger[_0x9870('0x16')]('Cdr,\x20%s,\x20%s',_0x4ab315,'request\x20sent');_0x1907f6(_0x1f5e82[_0x9870('0x17')][_0x9870('0x14')]);}})[_0x9870('0x18')](function(_0x1dd876){logger[_0x9870('0x12')](_0x9870('0x15'),_0x4ab315,_0x1dd876);_0x591d5a(_0x1dd876);});});} \ No newline at end of file +var _0x2111=['Cdr,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','Cdr,\x20%s,\x20%s'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x2111,0x1eb));var _0x1211=function(_0x1fc36f,_0x464552){_0x1fc36f=_0x1fc36f-0x0;var _0x2856b4=_0x2111[_0x1fc36f];return _0x2856b4;};'use strict';var _=require(_0x1211('0x0'));var util=require(_0x1211('0x1'));var moment=require('moment');var BPromise=require(_0x1211('0x2'));var rs=require(_0x1211('0x3'));var fs=require('fs');var Redis=require(_0x1211('0x4'));var db=require(_0x1211('0x5'))['db'];var utils=require(_0x1211('0x6'));var logger=require(_0x1211('0x7'))(_0x1211('0x8'));var config=require(_0x1211('0x9'));var jayson=require(_0x1211('0xa'));var client=jayson[_0x1211('0xb')][_0x1211('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x7d7e04,_0x48779e,_0x57aa8c){return new BPromise(function(_0x21705d,_0x397b3a){return client[_0x1211('0xd')](_0x7d7e04,_0x57aa8c)['then'](function(_0x411f35){logger['info'](_0x1211('0xe'),_0x48779e,'request\x20sent');logger['debug'](_0x1211('0xf'),_0x48779e,_0x1211('0x10'),JSON['stringify'](_0x411f35));if(_0x411f35['error']){if(_0x411f35[_0x1211('0x11')][_0x1211('0x12')]===0x1f4){logger[_0x1211('0x11')](_0x1211('0xe'),_0x48779e,_0x411f35['error'][_0x1211('0x13')]);return _0x397b3a(_0x411f35['error'][_0x1211('0x13')]);}logger[_0x1211('0x11')]('Cdr,\x20%s,\x20%s',_0x48779e,_0x411f35[_0x1211('0x11')][_0x1211('0x13')]);return _0x21705d(_0x411f35[_0x1211('0x11')][_0x1211('0x13')]);}else{logger['info'](_0x1211('0xe'),_0x48779e,'request\x20sent');_0x21705d(_0x411f35[_0x1211('0x14')][_0x1211('0x13')]);}})[_0x1211('0x15')](function(_0x5583fb){logger[_0x1211('0x11')]('Cdr,\x20%s,\x20%s',_0x48779e,_0x5583fb);_0x397b3a(_0x5583fb);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index 83626ac..62705c9 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(_0x56c6a9,_0x1239ee){var _0xa3ad43=function(_0x386c0a){while(--_0x386c0a){_0x56c6a9['push'](_0x56c6a9['shift']());}};_0xa3ad43(++_0x1239ee);}(_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(_0x4d8b8e,_0x12fb10){var _0x3103ba=function(_0x361cae){while(--_0x361cae){_0x4d8b8e['push'](_0x4d8b8e['shift']());}};_0x3103ba(++_0x12fb10);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js index 1821acb..396082f 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 _0xfc84=['STRING','noop','TEXT','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x4570ab,_0x5a97c1){var _0x531d8b=function(_0x58e635){while(--_0x58e635){_0x4570ab['push'](_0x4570ab['shift']());}};_0x531d8b(++_0x5a97c1);}(_0xfc84,0x97));var _0x4fc8=function(_0x323aab,_0x5df4b9){_0x323aab=_0x323aab-0x0;var _0xc0d363=_0xfc84[_0x323aab];return _0xc0d363;};'use strict';var Sequelize=require(_0x4fc8('0x0'));module[_0x4fc8('0x1')]={'priority':{'type':Sequelize[_0x4fc8('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x4fc8('0x3')],'allowNull':![],'defaultValue':_0x4fc8('0x4')},'appdata':{'type':Sequelize[_0x4fc8('0x5')]()},'description':{'type':Sequelize[_0x4fc8('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x4fc8('0x6')}}; \ No newline at end of file +var _0x677a=['TEXT','*,*,*,*','exports','INTEGER','STRING','noop'];(function(_0x50f392,_0x1d8441){var _0x5926f2=function(_0x17df32){while(--_0x17df32){_0x50f392['push'](_0x50f392['shift']());}};_0x5926f2(++_0x1d8441);}(_0x677a,0x6e));var _0xa677=function(_0x20d550,_0x58c393){_0x20d550=_0x20d550-0x0;var _0x4e9cd7=_0x677a[_0x20d550];return _0x4e9cd7;};'use strict';var Sequelize=require('sequelize');module[_0xa677('0x0')]={'priority':{'type':Sequelize[_0xa677('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xa677('0x2')],'allowNull':![],'defaultValue':_0xa677('0x3')},'appdata':{'type':Sequelize[_0xa677('0x4')]()},'description':{'type':Sequelize[_0xa677('0x2')]},'interval':{'type':Sequelize[_0xa677('0x2')],'defaultValue':_0xa677('0x5')}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index ad4f408..e0c160b 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 _0xe493=['then','catch','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','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','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','error','stack','name','params','keys','ChatApplication','rawAttributes','query','model','attributes','intersection','fields','length','includeAll','include','merge','options'];(function(_0x2dca49,_0x66a57e){var _0x3df140=function(_0x583752){while(--_0x583752){_0x2dca49['push'](_0x2dca49['shift']());}};_0x3df140(++_0x66a57e);}(_0xe493,0x7e));var _0x3e49=function(_0x6b055c,_0x5d9aee){_0x6b055c=_0x6b055c-0x0;var _0x14f684=_0xe493[_0x6b055c];return _0x14f684;};'use strict';var emlformat=require(_0x3e49('0x0'));var rimraf=require(_0x3e49('0x1'));var zipdir=require(_0x3e49('0x2'));var jsonpatch=require(_0x3e49('0x3'));var rp=require(_0x3e49('0x4'));var moment=require('moment');var BPromise=require(_0x3e49('0x5'));var Mustache=require(_0x3e49('0x6'));var util=require('util');var path=require(_0x3e49('0x7'));var sox=require('sox');var csv=require(_0x3e49('0x8'));var ejs=require(_0x3e49('0x9'));var fs=require('fs');var fs_extra=require(_0x3e49('0xa'));var _=require(_0x3e49('0xb'));var squel=require(_0x3e49('0xc'));var crypto=require(_0x3e49('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3e49('0xe'));var Papa=require(_0x3e49('0xf'));var Redis=require(_0x3e49('0x10'));var authService=require(_0x3e49('0x11'));var qs=require(_0x3e49('0x12'));var as=require(_0x3e49('0x13'));var hardwareService=require(_0x3e49('0x14'));var logger=require(_0x3e49('0x15'))(_0x3e49('0x16'));var utils=require(_0x3e49('0x17'));var config=require(_0x3e49('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x3e49('0x19'))['db'];function respondWithStatusCode(_0x3c9410,_0x56114b){_0x56114b=_0x56114b||0xcc;return function(_0x2539a7){if(_0x2539a7){return _0x3c9410[_0x3e49('0x1a')](_0x56114b);}return _0x3c9410['status'](_0x56114b)[_0x3e49('0x1b')]();};}function respondWithResult(_0x40504b,_0x54463c){_0x54463c=_0x54463c||0xc8;return function(_0x258db5){if(_0x258db5){return _0x40504b[_0x3e49('0x1c')](_0x54463c)[_0x3e49('0x1d')](_0x258db5);}};}function respondWithFilteredResult(_0x238d1b,_0x401e84){return function(_0x3a9685){if(_0x3a9685){var _0x46d813=typeof _0x401e84[_0x3e49('0x1e')]===_0x3e49('0x1f')&&typeof _0x401e84[_0x3e49('0x20')]===_0x3e49('0x1f');var _0x1826ac=_0x3a9685[_0x3e49('0x21')];var _0x3ae5f4=_0x46d813?0x0:_0x401e84[_0x3e49('0x1e')];var _0x4e1cdf=_0x46d813?_0x3a9685[_0x3e49('0x21')]:_0x401e84['offset']+_0x401e84[_0x3e49('0x20')];var _0x524707;if(_0x4e1cdf>=_0x1826ac){_0x4e1cdf=_0x1826ac;_0x524707=0xc8;}else{_0x524707=0xce;}_0x238d1b[_0x3e49('0x1c')](_0x524707);return _0x238d1b['set'](_0x3e49('0x22'),_0x3ae5f4+'-'+_0x4e1cdf+'/'+_0x1826ac)[_0x3e49('0x1d')](_0x3a9685);}return null;};}function patchUpdates(_0x420d7b){return function(_0x5a4e67){try{jsonpatch[_0x3e49('0x23')](_0x5a4e67,_0x420d7b,!![]);}catch(_0x5ce419){return BPromise[_0x3e49('0x24')](_0x5ce419);}return _0x5a4e67[_0x3e49('0x25')]();};}function saveUpdates(_0x323be5,_0x5e0f1d){return function(_0x547c3b){if(_0x547c3b){return _0x547c3b[_0x3e49('0x26')](_0x323be5)['then'](function(_0x12d71a){return _0x12d71a;});}return null;};}function removeEntity(_0x1b338b,_0x567d13){return function(_0x5b85df){if(_0x5b85df){return _0x5b85df[_0x3e49('0x27')]()['then'](function(){_0x1b338b[_0x3e49('0x1c')](0xcc)[_0x3e49('0x1b')]();});}};}function handleEntityNotFound(_0x1bdb3e,_0x38cbe0){return function(_0x538547){if(!_0x538547){_0x1bdb3e[_0x3e49('0x1a')](0x194);}return _0x538547;};}function handleError(_0x469d8d,_0xd573d7){_0xd573d7=_0xd573d7||0x1f4;return function(_0x1710e8){logger[_0x3e49('0x28')](_0x1710e8[_0x3e49('0x29')]);if(_0x1710e8[_0x3e49('0x2a')]){delete _0x1710e8[_0x3e49('0x2a')];}_0x469d8d[_0x3e49('0x1c')](_0xd573d7)['send'](_0x1710e8);};}exports['show']=function(_0x5aea97,_0x1d6680){var _0x366c78={'raw':!![],'where':{'id':_0x5aea97[_0x3e49('0x2b')]['id']}},_0x486057={};_0x486057['model']=_[_0x3e49('0x2c')](db[_0x3e49('0x2d')][_0x3e49('0x2e')]);_0x486057[_0x3e49('0x2f')]=_['keys'](_0x5aea97[_0x3e49('0x2f')]);_0x486057['filters']=_['intersection'](_0x486057[_0x3e49('0x30')],_0x486057[_0x3e49('0x2f')]);_0x366c78[_0x3e49('0x31')]=_[_0x3e49('0x32')](_0x486057[_0x3e49('0x30')],qs[_0x3e49('0x33')](_0x5aea97[_0x3e49('0x2f')][_0x3e49('0x33')]));_0x366c78['attributes']=_0x366c78[_0x3e49('0x31')][_0x3e49('0x34')]?_0x366c78[_0x3e49('0x31')]:_0x486057[_0x3e49('0x30')];if(_0x5aea97[_0x3e49('0x2f')][_0x3e49('0x35')]){_0x366c78[_0x3e49('0x36')]=[{'all':!![]}];}_0x366c78=_[_0x3e49('0x37')]({},_0x366c78,_0x5aea97[_0x3e49('0x38')]);return db[_0x3e49('0x2d')]['find'](_0x366c78)[_0x3e49('0x39')](handleEntityNotFound(_0x1d6680,null))[_0x3e49('0x39')](respondWithResult(_0x1d6680,null))[_0x3e49('0x3a')](handleError(_0x1d6680,null));};exports[_0x3e49('0x26')]=function(_0xa474a1,_0x27380c){if(_0xa474a1[_0x3e49('0x3b')]['id']){delete _0xa474a1[_0x3e49('0x3b')]['id'];}return db[_0x3e49('0x2d')][_0x3e49('0x3c')]({'where':{'id':_0xa474a1['params']['id']}})['then'](handleEntityNotFound(_0x27380c,null))[_0x3e49('0x39')](saveUpdates(_0xa474a1[_0x3e49('0x3b')],null))[_0x3e49('0x39')](respondWithResult(_0x27380c,null))[_0x3e49('0x3a')](handleError(_0x27380c,null));};exports[_0x3e49('0x27')]=function(_0x4d8475,_0x129e62){return db[_0x3e49('0x2d')][_0x3e49('0x3c')]({'where':{'id':_0x4d8475['params']['id']}})['then'](handleEntityNotFound(_0x129e62,null))['then'](removeEntity(_0x129e62,null))[_0x3e49('0x3a')](handleError(_0x129e62,null));}; \ No newline at end of file +var _0x6146=['to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','then','error','stack','name','send','show','params','model','ChatApplication','rawAttributes','query','keys','filters','intersection','attributes','fields','length','includeAll','merge','options','find','catch','update','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox'];(function(_0x4ade89,_0x33f831){var _0x5edb02=function(_0x3c9f66){while(--_0x3c9f66){_0x4ade89['push'](_0x4ade89['shift']());}};_0x5edb02(++_0x33f831);}(_0x6146,0xba));var _0x6614=function(_0x55317b,_0x36520c){_0x55317b=_0x55317b-0x0;var _0xd20fc8=_0x6146[_0x55317b];return _0xd20fc8;};'use strict';var emlformat=require(_0x6614('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6614('0x1'));var jsonpatch=require(_0x6614('0x2'));var rp=require(_0x6614('0x3'));var moment=require(_0x6614('0x4'));var BPromise=require(_0x6614('0x5'));var Mustache=require(_0x6614('0x6'));var util=require(_0x6614('0x7'));var path=require('path');var sox=require(_0x6614('0x8'));var csv=require(_0x6614('0x9'));var ejs=require(_0x6614('0xa'));var fs=require('fs');var fs_extra=require(_0x6614('0xb'));var _=require(_0x6614('0xc'));var squel=require(_0x6614('0xd'));var crypto=require(_0x6614('0xe'));var jsforce=require(_0x6614('0xf'));var deskjs=require(_0x6614('0x10'));var toCsv=require('to-csv');var querystring=require(_0x6614('0x11'));var Papa=require(_0x6614('0x12'));var Redis=require(_0x6614('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x6614('0x14'));var as=require(_0x6614('0x15'));var hardwareService=require(_0x6614('0x16'));var logger=require(_0x6614('0x17'))(_0x6614('0x18'));var utils=require(_0x6614('0x19'));var config=require(_0x6614('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x6614('0x1b'))['db'];function respondWithStatusCode(_0x4fa29b,_0x3550a7){_0x3550a7=_0x3550a7||0xcc;return function(_0x11b16b){if(_0x11b16b){return _0x4fa29b[_0x6614('0x1c')](_0x3550a7);}return _0x4fa29b[_0x6614('0x1d')](_0x3550a7)[_0x6614('0x1e')]();};}function respondWithResult(_0x1d0d2b,_0x1bae1d){_0x1bae1d=_0x1bae1d||0xc8;return function(_0x288cd7){if(_0x288cd7){return _0x1d0d2b[_0x6614('0x1d')](_0x1bae1d)['json'](_0x288cd7);}};}function respondWithFilteredResult(_0x481f26,_0x219365){return function(_0x40a008){if(_0x40a008){var _0x5e933f=typeof _0x219365[_0x6614('0x1f')]===_0x6614('0x20')&&typeof _0x219365[_0x6614('0x21')]==='undefined';var _0xfddeb9=_0x40a008[_0x6614('0x22')];var _0x449ec5=_0x5e933f?0x0:_0x219365['offset'];var _0x53080d=_0x5e933f?_0x40a008[_0x6614('0x22')]:_0x219365[_0x6614('0x1f')]+_0x219365[_0x6614('0x21')];var _0x30c5bc;if(_0x53080d>=_0xfddeb9){_0x53080d=_0xfddeb9;_0x30c5bc=0xc8;}else{_0x30c5bc=0xce;}_0x481f26['status'](_0x30c5bc);return _0x481f26[_0x6614('0x23')](_0x6614('0x24'),_0x449ec5+'-'+_0x53080d+'/'+_0xfddeb9)[_0x6614('0x25')](_0x40a008);}return null;};}function patchUpdates(_0x5442e0){return function(_0x15c667){try{jsonpatch[_0x6614('0x26')](_0x15c667,_0x5442e0,!![]);}catch(_0x13868d){return BPromise[_0x6614('0x27')](_0x13868d);}return _0x15c667[_0x6614('0x28')]();};}function saveUpdates(_0x1db8fc,_0x18889c){return function(_0x3275ee){if(_0x3275ee){return _0x3275ee['update'](_0x1db8fc)[_0x6614('0x29')](function(_0x4a665a){return _0x4a665a;});}return null;};}function removeEntity(_0x13ad7a,_0x30205e){return function(_0x332fca){if(_0x332fca){return _0x332fca['destroy']()['then'](function(){_0x13ad7a[_0x6614('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1137ef,_0x5c8651){return function(_0x3c82e5){if(!_0x3c82e5){_0x1137ef[_0x6614('0x1c')](0x194);}return _0x3c82e5;};}function handleError(_0x5ddae6,_0x119e53){_0x119e53=_0x119e53||0x1f4;return function(_0x4e9450){logger[_0x6614('0x2a')](_0x4e9450[_0x6614('0x2b')]);if(_0x4e9450[_0x6614('0x2c')]){delete _0x4e9450[_0x6614('0x2c')];}_0x5ddae6[_0x6614('0x1d')](_0x119e53)[_0x6614('0x2d')](_0x4e9450);};}exports[_0x6614('0x2e')]=function(_0x2f9a26,_0x1fef5f){var _0x32ee73={'raw':!![],'where':{'id':_0x2f9a26[_0x6614('0x2f')]['id']}},_0x153b8e={};_0x153b8e[_0x6614('0x30')]=_['keys'](db[_0x6614('0x31')][_0x6614('0x32')]);_0x153b8e[_0x6614('0x33')]=_[_0x6614('0x34')](_0x2f9a26[_0x6614('0x33')]);_0x153b8e[_0x6614('0x35')]=_[_0x6614('0x36')](_0x153b8e[_0x6614('0x30')],_0x153b8e['query']);_0x32ee73[_0x6614('0x37')]=_[_0x6614('0x36')](_0x153b8e[_0x6614('0x30')],qs['fields'](_0x2f9a26['query'][_0x6614('0x38')]));_0x32ee73['attributes']=_0x32ee73[_0x6614('0x37')][_0x6614('0x39')]?_0x32ee73['attributes']:_0x153b8e[_0x6614('0x30')];if(_0x2f9a26[_0x6614('0x33')][_0x6614('0x3a')]){_0x32ee73['include']=[{'all':!![]}];}_0x32ee73=_[_0x6614('0x3b')]({},_0x32ee73,_0x2f9a26[_0x6614('0x3c')]);return db[_0x6614('0x31')][_0x6614('0x3d')](_0x32ee73)[_0x6614('0x29')](handleEntityNotFound(_0x1fef5f,null))[_0x6614('0x29')](respondWithResult(_0x1fef5f,null))[_0x6614('0x3e')](handleError(_0x1fef5f,null));};exports[_0x6614('0x3f')]=function(_0x2c40d1,_0x15a9bd){if(_0x2c40d1[_0x6614('0x40')]['id']){delete _0x2c40d1[_0x6614('0x40')]['id'];}return db[_0x6614('0x31')][_0x6614('0x3d')]({'where':{'id':_0x2c40d1[_0x6614('0x2f')]['id']}})[_0x6614('0x29')](handleEntityNotFound(_0x15a9bd,null))[_0x6614('0x29')](saveUpdates(_0x2c40d1[_0x6614('0x40')],null))[_0x6614('0x29')](respondWithResult(_0x15a9bd,null))[_0x6614('0x3e')](handleError(_0x15a9bd,null));};exports['destroy']=function(_0x1a59b8,_0x1019fe){return db[_0x6614('0x31')][_0x6614('0x3d')]({'where':{'id':_0x1a59b8[_0x6614('0x2f')]['id']}})[_0x6614('0x29')](handleEntityNotFound(_0x1019fe,null))[_0x6614('0x29')](removeEntity(_0x1019fe,null))[_0x6614('0x3e')](handleError(_0x1019fe,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index e24792d..a0cc473 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 _0xca99=['./chatApplication.attributes','exports','define','ChatApplication','chat_applications','utf8mb4','lodash','util','moment','path','rimraf','../../config/environment'];(function(_0x2a7680,_0x9992d8){var _0x44d8a1=function(_0x581d8b){while(--_0x581d8b){_0x2a7680['push'](_0x2a7680['shift']());}};_0x44d8a1(++_0x9992d8);}(_0xca99,0x186));var _0x9ca9=function(_0x1ca4cc,_0x402c23){_0x1ca4cc=_0x1ca4cc-0x0;var _0x108010=_0xca99[_0x1ca4cc];return _0x108010;};'use strict';var _=require(_0x9ca9('0x0'));var util=require(_0x9ca9('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x9ca9('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x9ca9('0x3'));var rimraf=require(_0x9ca9('0x4'));var config=require(_0x9ca9('0x5'));var attributes=require(_0x9ca9('0x6'));module[_0x9ca9('0x7')]=function(_0x5294e4,_0x8f5ff3){return _0x5294e4[_0x9ca9('0x8')](_0x9ca9('0x9'),attributes,{'tableName':_0x9ca9('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x9ca9('0xb'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xd8a1=['../../config/environment','exports','define','lodash','util','../../config/logger','moment','bluebird','path','rimraf'];(function(_0x4697fa,_0x21c841){var _0x390950=function(_0x3deb8a){while(--_0x3deb8a){_0x4697fa['push'](_0x4697fa['shift']());}};_0x390950(++_0x21c841);}(_0xd8a1,0x111));var _0x1d8a=function(_0xed3e2b,_0x584cb0){_0xed3e2b=_0xed3e2b-0x0;var _0x301bd6=_0xd8a1[_0xed3e2b];return _0x301bd6;};'use strict';var _=require(_0x1d8a('0x0'));var util=require(_0x1d8a('0x1'));var logger=require(_0x1d8a('0x2'))('api');var moment=require(_0x1d8a('0x3'));var BPromise=require(_0x1d8a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1d8a('0x5'));var rimraf=require(_0x1d8a('0x6'));var config=require(_0x1d8a('0x7'));var attributes=require('./chatApplication.attributes');module[_0x1d8a('0x8')]=function(_0x18f057,_0x3d7b2c){return _0x18f057[_0x1d8a('0x9')]('ChatApplication',attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index 978f2e0..6203029 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 _0x52c0=['debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent'];(function(_0x2d1fdb,_0x50d2de){var _0x19e74b=function(_0x30fee6){while(--_0x30fee6){_0x2d1fdb['push'](_0x2d1fdb['shift']());}};_0x19e74b(++_0x50d2de);}(_0x52c0,0x1e2));var _0x052c=function(_0x18c790,_0x2e5ce6){_0x18c790=_0x18c790-0x0;var _0x2ae38e=_0x52c0[_0x18c790];return _0x2ae38e;};'use strict';var _=require('lodash');var util=require(_0x052c('0x0'));var moment=require(_0x052c('0x1'));var BPromise=require(_0x052c('0x2'));var rs=require(_0x052c('0x3'));var fs=require('fs');var Redis=require(_0x052c('0x4'));var db=require(_0x052c('0x5'))['db'];var utils=require(_0x052c('0x6'));var logger=require(_0x052c('0x7'))(_0x052c('0x8'));var config=require(_0x052c('0x9'));var jayson=require(_0x052c('0xa'));var client=jayson[_0x052c('0xb')][_0x052c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1870aa,_0x4cba16,_0x493f5f){return new BPromise(function(_0x187ff5,_0x1042b9){return client[_0x052c('0xd')](_0x1870aa,_0x493f5f)[_0x052c('0xe')](function(_0x419bf4){logger[_0x052c('0xf')](_0x052c('0x10'),_0x4cba16,_0x052c('0x11'));logger[_0x052c('0x12')](_0x052c('0x13'),_0x4cba16,_0x052c('0x11'),JSON[_0x052c('0x14')](_0x419bf4));if(_0x419bf4[_0x052c('0x15')]){if(_0x419bf4[_0x052c('0x15')]['code']===0x1f4){logger[_0x052c('0x15')]('ChatApplication,\x20%s,\x20%s',_0x4cba16,_0x419bf4[_0x052c('0x15')][_0x052c('0x16')]);return _0x1042b9(_0x419bf4[_0x052c('0x15')][_0x052c('0x16')]);}logger[_0x052c('0x15')](_0x052c('0x10'),_0x4cba16,_0x419bf4[_0x052c('0x15')][_0x052c('0x16')]);return _0x187ff5(_0x419bf4[_0x052c('0x15')][_0x052c('0x16')]);}else{logger[_0x052c('0xf')](_0x052c('0x10'),_0x4cba16,_0x052c('0x11'));_0x187ff5(_0x419bf4[_0x052c('0x17')][_0x052c('0x16')]);}})[_0x052c('0x18')](function(_0x575898){logger[_0x052c('0x15')](_0x052c('0x10'),_0x4cba16,_0x575898);_0x1042b9(_0x575898);});});} \ No newline at end of file +var _0x126a=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','info','catch','lodash','util','moment'];(function(_0x1ad279,_0x42d157){var _0x272861=function(_0x3cb41f){while(--_0x3cb41f){_0x1ad279['push'](_0x1ad279['shift']());}};_0x272861(++_0x42d157);}(_0x126a,0x6b));var _0xa126=function(_0x1c6c29,_0x4bb3ac){_0x1c6c29=_0x1c6c29-0x0;var _0x591994=_0x126a[_0x1c6c29];return _0x591994;};'use strict';var _=require(_0xa126('0x0'));var util=require(_0xa126('0x1'));var moment=require(_0xa126('0x2'));var BPromise=require(_0xa126('0x3'));var rs=require(_0xa126('0x4'));var fs=require('fs');var Redis=require(_0xa126('0x5'));var db=require(_0xa126('0x6'))['db'];var utils=require(_0xa126('0x7'));var logger=require(_0xa126('0x8'))('rpc');var config=require(_0xa126('0x9'));var jayson=require(_0xa126('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5e588f,_0x150c95,_0x14d810){return new BPromise(function(_0x5197aa,_0x42cf3e){return client[_0xa126('0xb')](_0x5e588f,_0x14d810)[_0xa126('0xc')](function(_0x4da7ad){logger['info'](_0xa126('0xd'),_0x150c95,_0xa126('0xe'));logger[_0xa126('0xf')]('ChatApplication,\x20%s,\x20%s,\x20%s',_0x150c95,_0xa126('0xe'),JSON[_0xa126('0x10')](_0x4da7ad));if(_0x4da7ad['error']){if(_0x4da7ad['error'][_0xa126('0x11')]===0x1f4){logger[_0xa126('0x12')](_0xa126('0xd'),_0x150c95,_0x4da7ad[_0xa126('0x12')][_0xa126('0x13')]);return _0x42cf3e(_0x4da7ad[_0xa126('0x12')][_0xa126('0x13')]);}logger[_0xa126('0x12')](_0xa126('0xd'),_0x150c95,_0x4da7ad[_0xa126('0x12')]['message']);return _0x5197aa(_0x4da7ad[_0xa126('0x12')][_0xa126('0x13')]);}else{logger[_0xa126('0x14')](_0xa126('0xd'),_0x150c95,'request\x20sent');_0x5197aa(_0x4da7ad['result'][_0xa126('0x13')]);}})[_0xa126('0x15')](function(_0xaaf6d9){logger[_0xa126('0x12')](_0xa126('0xd'),_0x150c95,_0xaaf6d9);_0x42cf3e(_0xaaf6d9);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index 0106c1c..08e2659 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 _0x3607=['delete','destroy','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatApplication.controller','get','/:id','isAuthenticated','put','update'];(function(_0x4b73a2,_0x40b5fe){var _0x383c66=function(_0x3917ae){while(--_0x3917ae){_0x4b73a2['push'](_0x4b73a2['shift']());}};_0x383c66(++_0x40b5fe);}(_0x3607,0xe3));var _0x7360=function(_0x4cb91c,_0x131bd4){_0x4cb91c=_0x4cb91c-0x0;var _0x3bd919=_0x3607[_0x4cb91c];return _0x3bd919;};'use strict';var multer=require('multer');var util=require(_0x7360('0x0'));var path=require('path');var timeout=require(_0x7360('0x1'));var express=require(_0x7360('0x2'));var router=express[_0x7360('0x3')]();var fs_extra=require(_0x7360('0x4'));var auth=require(_0x7360('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x7360('0x6'));var controller=require(_0x7360('0x7'));router[_0x7360('0x8')](_0x7360('0x9'),auth[_0x7360('0xa')](),controller['show']);router[_0x7360('0xb')](_0x7360('0x9'),auth['isAuthenticated'](),controller[_0x7360('0xc')]);router[_0x7360('0xd')](_0x7360('0x9'),auth[_0x7360('0xa')](),controller[_0x7360('0xe')]);module[_0x7360('0xf')]=router; \ No newline at end of file +var _0x2ec1=['../../config/environment','./chatApplication.controller','get','/:id','show','isAuthenticated','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x433ac1,_0x53ae9b){var _0x29ae08=function(_0x57d950){while(--_0x57d950){_0x433ac1['push'](_0x433ac1['shift']());}};_0x29ae08(++_0x53ae9b);}(_0x2ec1,0x108));var _0x12ec=function(_0x111fec,_0x55932a){_0x111fec=_0x111fec-0x0;var _0x13b1a4=_0x2ec1[_0x111fec];return _0x13b1a4;};'use strict';var multer=require('multer');var util=require(_0x12ec('0x0'));var path=require(_0x12ec('0x1'));var timeout=require(_0x12ec('0x2'));var express=require(_0x12ec('0x3'));var router=express[_0x12ec('0x4')]();var fs_extra=require(_0x12ec('0x5'));var auth=require(_0x12ec('0x6'));var interaction=require(_0x12ec('0x7'));var config=require(_0x12ec('0x8'));var controller=require(_0x12ec('0x9'));router[_0x12ec('0xa')](_0x12ec('0xb'),auth['isAuthenticated'](),controller[_0x12ec('0xc')]);router['put'](_0x12ec('0xb'),auth[_0x12ec('0xd')](),controller['update']);router[_0x12ec('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x12ec('0xf')]);module[_0x12ec('0x10')]=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index e64ce73..bb6d9dd 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 _0x3e24=['exports','STRING','BOOLEAN','sequelize'];(function(_0x31a371,_0x50828e){var _0x2a5bd6=function(_0x2fb481){while(--_0x2fb481){_0x31a371['push'](_0x31a371['shift']());}};_0x2a5bd6(++_0x50828e);}(_0x3e24,0x167));var _0x43e2=function(_0x4045ff,_0x46cbcd){_0x4045ff=_0x4045ff-0x0;var _0x5797ac=_0x3e24[_0x4045ff];return _0x5797ac;};'use strict';var Sequelize=require(_0x43e2('0x0'));module[_0x43e2('0x1')]={'name':{'type':Sequelize[_0x43e2('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x43e2('0x2')]},'write':{'type':Sequelize[_0x43e2('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0x88c3=['exports','STRING','BOOLEAN'];(function(_0x4d9a0f,_0x1bd48e){var _0x2c277b=function(_0x5a7808){while(--_0x5a7808){_0x4d9a0f['push'](_0x4d9a0f['shift']());}};_0x2c277b(++_0x1bd48e);}(_0x88c3,0x7b));var _0x388c=function(_0x2db952,_0xd328de){_0x2db952=_0x2db952-0x0;var _0x41c3dd=_0x88c3[_0x2db952];return _0x41c3dd;};'use strict';var Sequelize=require('sequelize');module[_0x388c('0x0')]={'name':{'type':Sequelize[_0x388c('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize[_0x388c('0x2')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js index d71fed4..5568d88 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 _0x97da=['includeAll','findAll','rows','rawAttributes','include','catch','create','body','update','find','params','describe','ChatInternalMessage','user','addMembers','getMembers','findOne','User','pick','removeMembers','ids','ChatGroupId','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','nolimit','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','sox','ejs','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./chatGroup.socket','register','sendStatus','status','json','count','offset','limit','set','reject','save','then','destroy','end','error','stack','name','send','map','ChatGroup','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filters','filter','merge','VIRTUAL','options'];(function(_0x592389,_0x18ab51){var _0xf71a9c=function(_0xa98b4b){while(--_0xa98b4b){_0x592389['push'](_0x592389['shift']());}};_0xf71a9c(++_0x18ab51);}(_0x97da,0x136));var _0xa97d=function(_0x39dfcc,_0x277658){_0x39dfcc=_0x39dfcc-0x0;var _0x323723=_0x97da[_0x39dfcc];return _0x323723;};'use strict';var emlformat=require(_0xa97d('0x0'));var rimraf=require(_0xa97d('0x1'));var zipdir=require(_0xa97d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa97d('0x3'));var moment=require(_0xa97d('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xa97d('0x5'));var util=require(_0xa97d('0x6'));var path=require('path');var sox=require(_0xa97d('0x7'));var csv=require('to-csv');var ejs=require(_0xa97d('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa97d('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xa97d('0xa'));var deskjs=require(_0xa97d('0xb'));var toCsv=require('to-csv');var querystring=require(_0xa97d('0xc'));var Papa=require(_0xa97d('0xd'));var Redis=require(_0xa97d('0xe'));var authService=require(_0xa97d('0xf'));var qs=require(_0xa97d('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa97d('0x11'));var logger=require(_0xa97d('0x12'))(_0xa97d('0x13'));var utils=require(_0xa97d('0x14'));var config=require(_0xa97d('0x15'));var licenseUtil=require(_0xa97d('0x16'));var db=require(_0xa97d('0x17'))['db'];config[_0xa97d('0x18')]=_[_0xa97d('0x19')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xa97d('0x1a'))(new Redis(config[_0xa97d('0x18')]));require(_0xa97d('0x1b'))[_0xa97d('0x1c')](socket);function respondWithStatusCode(_0x34d9d8,_0x44176d){_0x44176d=_0x44176d||0xcc;return function(_0x26884b){if(_0x26884b){return _0x34d9d8[_0xa97d('0x1d')](_0x44176d);}return _0x34d9d8[_0xa97d('0x1e')](_0x44176d)['end']();};}function respondWithResult(_0x5e55b3,_0x3a2166){_0x3a2166=_0x3a2166||0xc8;return function(_0xc5e3ac){if(_0xc5e3ac){return _0x5e55b3[_0xa97d('0x1e')](_0x3a2166)[_0xa97d('0x1f')](_0xc5e3ac);}};}function respondWithFilteredResult(_0x520790,_0x240d47){return function(_0x1328e4){if(_0x1328e4){var _0x190979=typeof _0x240d47['offset']==='undefined'&&typeof _0x240d47['limit']==='undefined';var _0x457f3c=_0x1328e4[_0xa97d('0x20')];var _0x21e971=_0x190979?0x0:_0x240d47['offset'];var _0x5ad339=_0x190979?_0x1328e4[_0xa97d('0x20')]:_0x240d47[_0xa97d('0x21')]+_0x240d47[_0xa97d('0x22')];var _0x19dafd;if(_0x5ad339>=_0x457f3c){_0x5ad339=_0x457f3c;_0x19dafd=0xc8;}else{_0x19dafd=0xce;}_0x520790[_0xa97d('0x1e')](_0x19dafd);return _0x520790[_0xa97d('0x23')]('Content-Range',_0x21e971+'-'+_0x5ad339+'/'+_0x457f3c)[_0xa97d('0x1f')](_0x1328e4);}return null;};}function patchUpdates(_0x324331){return function(_0x748281){try{jsonpatch['apply'](_0x748281,_0x324331,!![]);}catch(_0x25e55d){return BPromise[_0xa97d('0x24')](_0x25e55d);}return _0x748281[_0xa97d('0x25')]();};}function saveUpdates(_0xdd0aee,_0x53dac2){return function(_0x262584){if(_0x262584){return _0x262584['update'](_0xdd0aee)[_0xa97d('0x26')](function(_0x46be86){return _0x46be86;});}return null;};}function removeEntity(_0x50eeaa,_0x37297e){return function(_0x1efc2c){if(_0x1efc2c){return _0x1efc2c[_0xa97d('0x27')]()['then'](function(){_0x50eeaa[_0xa97d('0x1e')](0xcc)[_0xa97d('0x28')]();});}};}function handleEntityNotFound(_0x4ef7e0,_0x3a98e3){return function(_0x3576b8){if(!_0x3576b8){_0x4ef7e0['sendStatus'](0x194);}return _0x3576b8;};}function handleError(_0x55bde6,_0x42077f){_0x42077f=_0x42077f||0x1f4;return function(_0x22b7aa){logger[_0xa97d('0x29')](_0x22b7aa[_0xa97d('0x2a')]);if(_0x22b7aa[_0xa97d('0x2b')]){delete _0x22b7aa[_0xa97d('0x2b')];}_0x55bde6[_0xa97d('0x1e')](_0x42077f)[_0xa97d('0x2c')](_0x22b7aa);};}exports['index']=function(_0xf1edf2,_0x5a1c9e){var _0x175ba0={},_0x3a1ff4={},_0x31760f={'count':0x0,'rows':[]};var _0x17adde=_[_0xa97d('0x2d')](db[_0xa97d('0x2e')]['rawAttributes'],function(_0x2491fa){return{'name':_0x2491fa[_0xa97d('0x2f')],'type':_0x2491fa[_0xa97d('0x30')][_0xa97d('0x31')]};});_0x3a1ff4[_0xa97d('0x32')]=_[_0xa97d('0x2d')](_0x17adde,'name');_0x3a1ff4[_0xa97d('0x33')]=_[_0xa97d('0x34')](_0xf1edf2[_0xa97d('0x33')]);_0x3a1ff4['filters']=_[_0xa97d('0x35')](_0x3a1ff4[_0xa97d('0x32')],_0x3a1ff4['query']);_0x175ba0['attributes']=_[_0xa97d('0x35')](_0x3a1ff4[_0xa97d('0x32')],qs[_0xa97d('0x36')](_0xf1edf2[_0xa97d('0x33')]['fields']));_0x175ba0[_0xa97d('0x37')]=_0x175ba0[_0xa97d('0x37')][_0xa97d('0x38')]?_0x175ba0[_0xa97d('0x37')]:_0x3a1ff4[_0xa97d('0x32')];if(!_0xf1edf2[_0xa97d('0x33')][_0xa97d('0x39')]('nolimit')){_0x175ba0[_0xa97d('0x22')]=qs[_0xa97d('0x22')](_0xf1edf2['query'][_0xa97d('0x22')]);_0x175ba0[_0xa97d('0x21')]=qs[_0xa97d('0x21')](_0xf1edf2[_0xa97d('0x33')][_0xa97d('0x21')]);}_0x175ba0[_0xa97d('0x3a')]=qs[_0xa97d('0x3b')](_0xf1edf2[_0xa97d('0x33')][_0xa97d('0x3b')]);_0x175ba0[_0xa97d('0x3c')]=qs[_0xa97d('0x3d')](_['pick'](_0xf1edf2[_0xa97d('0x33')],_0x3a1ff4['filters']),_0x17adde);if(_0xf1edf2[_0xa97d('0x33')][_0xa97d('0x3e')]){_0x175ba0['where']=_[_0xa97d('0x3f')](_0x175ba0[_0xa97d('0x3c')],{'$or':_[_0xa97d('0x2d')](_0x17adde,function(_0x1d3a79){if(_0x1d3a79[_0xa97d('0x30')]!==_0xa97d('0x40')){var _0x44bb1b={};_0x44bb1b[_0x1d3a79[_0xa97d('0x2b')]]={'$like':'%'+_0xf1edf2[_0xa97d('0x33')][_0xa97d('0x3e')]+'%'};return _0x44bb1b;}})});}_0x175ba0=_['merge']({},_0x175ba0,_0xf1edf2[_0xa97d('0x41')]);var _0x4ae986={'where':_0x175ba0['where']};return db[_0xa97d('0x2e')][_0xa97d('0x20')](_0x4ae986)[_0xa97d('0x26')](function(_0x1447e6){_0x31760f[_0xa97d('0x20')]=_0x1447e6;if(_0xf1edf2[_0xa97d('0x33')][_0xa97d('0x42')]){_0x175ba0['include']=[{'all':!![]}];}return db['ChatGroup'][_0xa97d('0x43')](_0x175ba0);})[_0xa97d('0x26')](function(_0x14b70b){_0x31760f[_0xa97d('0x44')]=_0x14b70b;return _0x31760f;})[_0xa97d('0x26')](respondWithFilteredResult(_0x5a1c9e,_0x175ba0))['catch'](handleError(_0x5a1c9e,null));};exports['show']=function(_0x5b888a,_0x523ad3){var _0x3f659e={'raw':!![],'where':{'id':_0x5b888a['params']['id']}},_0x132cf={};_0x132cf[_0xa97d('0x32')]=_['keys'](db[_0xa97d('0x2e')][_0xa97d('0x45')]);_0x132cf[_0xa97d('0x33')]=_[_0xa97d('0x34')](_0x5b888a[_0xa97d('0x33')]);_0x132cf['filters']=_[_0xa97d('0x35')](_0x132cf['model'],_0x132cf[_0xa97d('0x33')]);_0x3f659e['attributes']=_[_0xa97d('0x35')](_0x132cf['model'],qs[_0xa97d('0x36')](_0x5b888a['query']['fields']));_0x3f659e[_0xa97d('0x37')]=_0x3f659e[_0xa97d('0x37')]['length']?_0x3f659e[_0xa97d('0x37')]:_0x132cf['model'];if(_0x5b888a['query'][_0xa97d('0x42')]){_0x3f659e[_0xa97d('0x46')]=[{'all':!![]}];}_0x3f659e=_['merge']({},_0x3f659e,_0x5b888a['options']);return db[_0xa97d('0x2e')]['find'](_0x3f659e)[_0xa97d('0x26')](handleEntityNotFound(_0x523ad3,null))[_0xa97d('0x26')](respondWithResult(_0x523ad3,null))[_0xa97d('0x47')](handleError(_0x523ad3,null));};exports['create']=function(_0x514507,_0xb206af){return db[_0xa97d('0x2e')][_0xa97d('0x48')](_0x514507[_0xa97d('0x49')],{})[_0xa97d('0x26')](respondWithResult(_0xb206af,0xc9))['catch'](handleError(_0xb206af,null));};exports[_0xa97d('0x4a')]=function(_0x1d6670,_0x26a9f5){if(_0x1d6670[_0xa97d('0x49')]['id']){delete _0x1d6670[_0xa97d('0x49')]['id'];}return db[_0xa97d('0x2e')][_0xa97d('0x4b')]({'where':{'id':_0x1d6670['params']['id']}})['then'](handleEntityNotFound(_0x26a9f5,null))['then'](saveUpdates(_0x1d6670[_0xa97d('0x49')],null))[_0xa97d('0x26')](respondWithResult(_0x26a9f5,null))[_0xa97d('0x47')](handleError(_0x26a9f5,null));};exports[_0xa97d('0x27')]=function(_0x28213f,_0x3668a7){return db[_0xa97d('0x2e')][_0xa97d('0x4b')]({'where':{'id':_0x28213f[_0xa97d('0x4c')]['id']}})[_0xa97d('0x26')](handleEntityNotFound(_0x3668a7,null))[_0xa97d('0x26')](removeEntity(_0x3668a7,null))[_0xa97d('0x47')](handleError(_0x3668a7,null));};exports[_0xa97d('0x4d')]=function(_0x1f91a2,_0x35e108){return db[_0xa97d('0x2e')][_0xa97d('0x4d')]()[_0xa97d('0x26')](respondWithResult(_0x35e108,null))[_0xa97d('0x47')](handleError(_0x35e108,null));};exports['getUnread']=function(_0x182c64,_0xcdb7a7,_0x46a727){return db[_0xa97d('0x4e')][_0xa97d('0x20')]({'where':{'ChatGroupId':_0x182c64['params']['id'],'ToId':_0x182c64[_0xa97d('0x4f')]['id'],'read':![]}})[_0xa97d('0x26')](function(_0x279f3e){return{'id':_['toInteger'](_0x182c64[_0xa97d('0x4c')]['id']),'count':_0x279f3e};})[_0xa97d('0x26')](respondWithResult(_0xcdb7a7,null))[_0xa97d('0x47')](handleError(_0xcdb7a7,null));};exports[_0xa97d('0x50')]=function(_0xf442ef,_0x16315f,_0x39ab64){return db[_0xa97d('0x2e')][_0xa97d('0x4b')]({'where':{'id':_0xf442ef[_0xa97d('0x4c')]['id']}})[_0xa97d('0x26')](handleEntityNotFound(_0x16315f,null))['then'](function(_0x1bfd50){if(_0x1bfd50){return _0x1bfd50['addMembers'](_0xf442ef[_0xa97d('0x49')]['ids'],_['omit'](_0xf442ef[_0xa97d('0x49')],['ids','id'])||{});}})[_0xa97d('0x26')](respondWithResult(_0x16315f,null))['catch'](handleError(_0x16315f,null));};exports[_0xa97d('0x51')]=function(_0xce5a5f,_0x56ba98,_0x40f4bb){var _0x3bb093={};var _0x11532d={};var _0x25a645;var _0x1758fb;return db['ChatGroup'][_0xa97d('0x52')]({'where':{'id':_0xce5a5f[_0xa97d('0x4c')]['id']}})['then'](handleEntityNotFound(_0x56ba98,null))[_0xa97d('0x26')](function(_0x679e75){if(_0x679e75){_0x25a645=_0x679e75;_0x11532d['model']=_[_0xa97d('0x34')](db[_0xa97d('0x53')][_0xa97d('0x45')]);_0x11532d[_0xa97d('0x33')]=_[_0xa97d('0x34')](_0xce5a5f['query']);_0x11532d[_0xa97d('0x3d')]=_[_0xa97d('0x35')](_0x11532d[_0xa97d('0x32')],_0x11532d[_0xa97d('0x33')]);_0x3bb093[_0xa97d('0x37')]=_['intersection'](_0x11532d[_0xa97d('0x32')],qs['fields'](_0xce5a5f['query'][_0xa97d('0x36')]));_0x3bb093[_0xa97d('0x37')]=_0x3bb093[_0xa97d('0x37')][_0xa97d('0x38')]?_0x3bb093[_0xa97d('0x37')]:_0x11532d[_0xa97d('0x32')];_0x3bb093[_0xa97d('0x3a')]=qs[_0xa97d('0x3b')](_0xce5a5f['query'][_0xa97d('0x3b')]);_0x3bb093['where']=qs[_0xa97d('0x3d')](_[_0xa97d('0x54')](_0xce5a5f['query'],_0x11532d['filters']));if(_0xce5a5f[_0xa97d('0x33')][_0xa97d('0x3e')]){_0x3bb093[_0xa97d('0x3c')]=_[_0xa97d('0x3f')](_0x3bb093['where'],{'$or':_[_0xa97d('0x2d')](_0x3bb093[_0xa97d('0x37')],function(_0x4a9929){var _0x4afab6={};_0x4afab6[_0x4a9929]={'$like':'%'+_0xce5a5f['query'][_0xa97d('0x3e')]+'%'};return _0x4afab6;})});}_0x3bb093=_[_0xa97d('0x3f')]({},_0x3bb093,_0xce5a5f[_0xa97d('0x41')]);return _0x25a645[_0xa97d('0x51')](_0x3bb093);}})['then'](function(_0x412acb){if(_0x412acb){_0x1758fb=_0x412acb[_0xa97d('0x38')];if(!_0xce5a5f[_0xa97d('0x33')][_0xa97d('0x39')]('nolimit')){_0x3bb093[_0xa97d('0x22')]=qs[_0xa97d('0x22')](_0xce5a5f[_0xa97d('0x33')][_0xa97d('0x22')]);_0x3bb093[_0xa97d('0x21')]=qs['offset'](_0xce5a5f[_0xa97d('0x33')][_0xa97d('0x21')]);}return _0x25a645[_0xa97d('0x51')](_0x3bb093);}})[_0xa97d('0x26')](function(_0x36d88e){if(_0x36d88e){return _0x36d88e?{'count':_0x1758fb,'rows':_0x36d88e}:null;}})['then'](respondWithResult(_0x56ba98,null))['catch'](handleError(_0x56ba98,null));};exports[_0xa97d('0x55')]=function(_0x451580,_0x13f988,_0x3eaf40){return db[_0xa97d('0x2e')][_0xa97d('0x4b')]({'where':{'id':_0x451580['params']['id']}})[_0xa97d('0x26')](handleEntityNotFound(_0x13f988,null))[_0xa97d('0x26')](function(_0x44db25){if(_0x44db25){return _0x44db25[_0xa97d('0x55')](_0x451580[_0xa97d('0x33')][_0xa97d('0x56')]);}})[_0xa97d('0x26')](respondWithStatusCode(_0x13f988,null))['catch'](handleError(_0x13f988,null));};exports['addMessage']=function(_0x4014c0,_0x25ff60,_0x639928){if(_0x4014c0[_0xa97d('0x49')]['id']){delete _0x4014c0['body']['id'];}return db[_0xa97d('0x2e')]['find']({'where':{'id':_0x4014c0[_0xa97d('0x4c')]['id']}})[_0xa97d('0x26')](handleEntityNotFound(_0x25ff60,null))[_0xa97d('0x26')](function(_0xb932eb){if(_0xb932eb){_0x4014c0[_0xa97d('0x49')][_0xa97d('0x57')]=_0xb932eb['id'];return db[_0xa97d('0x4e')]['create'](_0x4014c0[_0xa97d('0x49')]);}})[_0xa97d('0x26')](respondWithResult(_0x25ff60,null))[_0xa97d('0x47')](handleError(_0x25ff60,null));};exports[_0xa97d('0x58')]=function(_0x3004ef,_0x1767c8,_0x38e6f0){var _0x3d6f51={};var _0x528803={};var _0x5e855c;var _0xdd265;return db[_0xa97d('0x2e')][_0xa97d('0x52')]({'where':{'id':_0x3004ef[_0xa97d('0x4c')]['id']}})[_0xa97d('0x26')](handleEntityNotFound(_0x1767c8,null))[_0xa97d('0x26')](function(_0x2ba30b){if(_0x2ba30b){_0x5e855c=_0x2ba30b;_0x528803[_0xa97d('0x32')]=_[_0xa97d('0x34')](db['ChatInternalMessage'][_0xa97d('0x45')]);_0x528803[_0xa97d('0x33')]=_[_0xa97d('0x34')](_0x3004ef[_0xa97d('0x33')]);_0x528803[_0xa97d('0x3d')]=_[_0xa97d('0x35')](_0x528803[_0xa97d('0x32')],_0x528803['query']);_0x3d6f51[_0xa97d('0x37')]=_[_0xa97d('0x35')](_0x528803[_0xa97d('0x32')],qs[_0xa97d('0x36')](_0x3004ef[_0xa97d('0x33')][_0xa97d('0x36')]));_0x3d6f51['attributes']=_0x3d6f51[_0xa97d('0x37')][_0xa97d('0x38')]?_0x3d6f51[_0xa97d('0x37')]:_0x528803[_0xa97d('0x32')];_0x3d6f51[_0xa97d('0x3a')]=qs['sort'](_0x3004ef[_0xa97d('0x33')][_0xa97d('0x3b')]);_0x3d6f51['where']=qs[_0xa97d('0x3d')](_[_0xa97d('0x54')](_0x3004ef[_0xa97d('0x33')],_0x528803[_0xa97d('0x3d')]));if(_0x3004ef[_0xa97d('0x33')][_0xa97d('0x3e')]){_0x3d6f51[_0xa97d('0x3c')]=_[_0xa97d('0x3f')](_0x3d6f51[_0xa97d('0x3c')],{'$or':_[_0xa97d('0x2d')](_0x3d6f51['attributes'],function(_0xde0e5e){var _0x19fea7={};_0x19fea7[_0xde0e5e]={'$like':'%'+_0x3004ef[_0xa97d('0x33')][_0xa97d('0x3e')]+'%'};return _0x19fea7;})});}if(_0x3004ef['query'][_0xa97d('0x59')]){var _0x1cc2d9=_0x3004ef[_0xa97d('0x33')][_0xa97d('0x59')][_0xa97d('0x5a')](',');var _0x5dd0e4={};_0x5dd0e4[_0x1cc2d9[0x0]]={'$gte':moment(_0x1cc2d9[0x1])[_0xa97d('0x5b')](_0xa97d('0x5c'))};_0x3d6f51[_0xa97d('0x3c')]=_[_0xa97d('0x3f')](_0x3d6f51[_0xa97d('0x3c')],_0x5dd0e4);}_0x3d6f51=_[_0xa97d('0x3f')]({},_0x3d6f51,_0x3004ef['options']);return _0x5e855c[_0xa97d('0x58')](_0x3d6f51);}})[_0xa97d('0x26')](function(_0x1ee472){if(_0x1ee472){_0xdd265=_0x1ee472[_0xa97d('0x38')];if(!_0x3004ef[_0xa97d('0x33')][_0xa97d('0x39')](_0xa97d('0x5d'))){_0x3d6f51[_0xa97d('0x22')]=qs['limit'](_0x3004ef['query'][_0xa97d('0x22')]);_0x3d6f51['offset']=qs[_0xa97d('0x21')](_0x3004ef[_0xa97d('0x33')]['offset']);}return _0x5e855c[_0xa97d('0x58')](_0x3d6f51);}})[_0xa97d('0x26')](function(_0x396b83){if(_0x396b83){return _0x396b83?{'count':_0xdd265,'rows':_0x396b83}:null;}})[_0xa97d('0x26')](respondWithResult(_0x1767c8,null))['catch'](handleError(_0x1767c8,null));}; \ No newline at end of file +var _0x4336=['type','VIRTUAL','options','include','findAll','rows','show','params','ChatGroup','includeAll','find','catch','create','body','update','describe','getUnread','ChatInternalMessage','user','addMembers','ids','omit','getMembers','findOne','User','order','nolimit','addMessage','ChatGroupId','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','ejs','fs-extra','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./chatGroup.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','save','then','destroy','error','stack','name','send','index','rawAttributes','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4336,0x1b6));var _0x6433=function(_0x563032,_0x237603){_0x563032=_0x563032-0x0;var _0x540be9=_0x4336[_0x563032];return _0x540be9;};'use strict';var emlformat=require(_0x6433('0x0'));var rimraf=require(_0x6433('0x1'));var zipdir=require(_0x6433('0x2'));var jsonpatch=require(_0x6433('0x3'));var rp=require(_0x6433('0x4'));var moment=require(_0x6433('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x6433('0x6'));var util=require(_0x6433('0x7'));var path=require(_0x6433('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x6433('0x9'));var fs=require('fs');var fs_extra=require(_0x6433('0xa'));var _=require('lodash');var squel=require(_0x6433('0xb'));var crypto=require('crypto');var jsforce=require(_0x6433('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x6433('0xd'));var querystring=require(_0x6433('0xe'));var Papa=require(_0x6433('0xf'));var Redis=require(_0x6433('0x10'));var authService=require(_0x6433('0x11'));var qs=require(_0x6433('0x12'));var as=require(_0x6433('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6433('0x14'));var utils=require(_0x6433('0x15'));var config=require(_0x6433('0x16'));var licenseUtil=require(_0x6433('0x17'));var db=require(_0x6433('0x18'))['db'];config['redis']=_[_0x6433('0x19')](config['redis'],{'host':_0x6433('0x1a'),'port':0x18eb});var socket=require(_0x6433('0x1b'))(new Redis(config[_0x6433('0x1c')]));require(_0x6433('0x1d'))[_0x6433('0x1e')](socket);function respondWithStatusCode(_0x187994,_0x3e62fc){_0x3e62fc=_0x3e62fc||0xcc;return function(_0x1f7c13){if(_0x1f7c13){return _0x187994[_0x6433('0x1f')](_0x3e62fc);}return _0x187994[_0x6433('0x20')](_0x3e62fc)[_0x6433('0x21')]();};}function respondWithResult(_0x4474ee,_0x7f9242){_0x7f9242=_0x7f9242||0xc8;return function(_0xb25cd2){if(_0xb25cd2){return _0x4474ee[_0x6433('0x20')](_0x7f9242)[_0x6433('0x22')](_0xb25cd2);}};}function respondWithFilteredResult(_0x3fc557,_0x97b3f3){return function(_0x62a9a6){if(_0x62a9a6){var _0x4f753c=typeof _0x97b3f3[_0x6433('0x23')]==='undefined'&&typeof _0x97b3f3[_0x6433('0x24')]===_0x6433('0x25');var _0x463c9c=_0x62a9a6['count'];var _0x36cfb1=_0x4f753c?0x0:_0x97b3f3[_0x6433('0x23')];var _0x25db8a=_0x4f753c?_0x62a9a6[_0x6433('0x26')]:_0x97b3f3['offset']+_0x97b3f3[_0x6433('0x24')];var _0x6de9fe;if(_0x25db8a>=_0x463c9c){_0x25db8a=_0x463c9c;_0x6de9fe=0xc8;}else{_0x6de9fe=0xce;}_0x3fc557[_0x6433('0x20')](_0x6de9fe);return _0x3fc557[_0x6433('0x27')](_0x6433('0x28'),_0x36cfb1+'-'+_0x25db8a+'/'+_0x463c9c)['json'](_0x62a9a6);}return null;};}function patchUpdates(_0x3ce549){return function(_0x19bf13){try{jsonpatch[_0x6433('0x29')](_0x19bf13,_0x3ce549,!![]);}catch(_0x25037){return BPromise['reject'](_0x25037);}return _0x19bf13[_0x6433('0x2a')]();};}function saveUpdates(_0x29d16d,_0x4de725){return function(_0x2c4997){if(_0x2c4997){return _0x2c4997['update'](_0x29d16d)[_0x6433('0x2b')](function(_0x562477){return _0x562477;});}return null;};}function removeEntity(_0x3ff0ab,_0x30b457){return function(_0x373f5a){if(_0x373f5a){return _0x373f5a[_0x6433('0x2c')]()[_0x6433('0x2b')](function(){_0x3ff0ab[_0x6433('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x49c031,_0x337667){return function(_0x335d02){if(!_0x335d02){_0x49c031['sendStatus'](0x194);}return _0x335d02;};}function handleError(_0x31f889,_0x3f674d){_0x3f674d=_0x3f674d||0x1f4;return function(_0x384bda){logger[_0x6433('0x2d')](_0x384bda[_0x6433('0x2e')]);if(_0x384bda[_0x6433('0x2f')]){delete _0x384bda[_0x6433('0x2f')];}_0x31f889[_0x6433('0x20')](_0x3f674d)[_0x6433('0x30')](_0x384bda);};}exports[_0x6433('0x31')]=function(_0x201c82,_0x43a7ff){var _0x208aa0={},_0x58a500={},_0x171723={'count':0x0,'rows':[]};var _0x4696c7=_['map'](db['ChatGroup'][_0x6433('0x32')],function(_0x51fb64){return{'name':_0x51fb64['fieldName'],'type':_0x51fb64['type'][_0x6433('0x33')]};});_0x58a500[_0x6433('0x34')]=_[_0x6433('0x35')](_0x4696c7,_0x6433('0x2f'));_0x58a500['query']=_[_0x6433('0x36')](_0x201c82[_0x6433('0x37')]);_0x58a500[_0x6433('0x38')]=_[_0x6433('0x39')](_0x58a500[_0x6433('0x34')],_0x58a500['query']);_0x208aa0[_0x6433('0x3a')]=_[_0x6433('0x39')](_0x58a500['model'],qs[_0x6433('0x3b')](_0x201c82[_0x6433('0x37')]['fields']));_0x208aa0[_0x6433('0x3a')]=_0x208aa0['attributes'][_0x6433('0x3c')]?_0x208aa0[_0x6433('0x3a')]:_0x58a500[_0x6433('0x34')];if(!_0x201c82['query'][_0x6433('0x3d')]('nolimit')){_0x208aa0['limit']=qs[_0x6433('0x24')](_0x201c82[_0x6433('0x37')][_0x6433('0x24')]);_0x208aa0[_0x6433('0x23')]=qs[_0x6433('0x23')](_0x201c82['query'][_0x6433('0x23')]);}_0x208aa0['order']=qs[_0x6433('0x3e')](_0x201c82[_0x6433('0x37')][_0x6433('0x3e')]);_0x208aa0[_0x6433('0x3f')]=qs[_0x6433('0x38')](_[_0x6433('0x40')](_0x201c82[_0x6433('0x37')],_0x58a500[_0x6433('0x38')]),_0x4696c7);if(_0x201c82[_0x6433('0x37')][_0x6433('0x41')]){_0x208aa0[_0x6433('0x3f')]=_[_0x6433('0x42')](_0x208aa0[_0x6433('0x3f')],{'$or':_[_0x6433('0x35')](_0x4696c7,function(_0x4eaaf3){if(_0x4eaaf3[_0x6433('0x43')]!==_0x6433('0x44')){var _0x338720={};_0x338720[_0x4eaaf3[_0x6433('0x2f')]]={'$like':'%'+_0x201c82[_0x6433('0x37')][_0x6433('0x41')]+'%'};return _0x338720;}})});}_0x208aa0=_[_0x6433('0x42')]({},_0x208aa0,_0x201c82[_0x6433('0x45')]);var _0x1bf9c8={'where':_0x208aa0[_0x6433('0x3f')]};return db['ChatGroup'][_0x6433('0x26')](_0x1bf9c8)['then'](function(_0x345eda){_0x171723[_0x6433('0x26')]=_0x345eda;if(_0x201c82[_0x6433('0x37')]['includeAll']){_0x208aa0[_0x6433('0x46')]=[{'all':!![]}];}return db['ChatGroup'][_0x6433('0x47')](_0x208aa0);})[_0x6433('0x2b')](function(_0x5d11c9){_0x171723[_0x6433('0x48')]=_0x5d11c9;return _0x171723;})[_0x6433('0x2b')](respondWithFilteredResult(_0x43a7ff,_0x208aa0))['catch'](handleError(_0x43a7ff,null));};exports[_0x6433('0x49')]=function(_0x12ca85,_0xe32200){var _0xc03422={'raw':!![],'where':{'id':_0x12ca85[_0x6433('0x4a')]['id']}},_0x4888b8={};_0x4888b8[_0x6433('0x34')]=_[_0x6433('0x36')](db[_0x6433('0x4b')][_0x6433('0x32')]);_0x4888b8[_0x6433('0x37')]=_['keys'](_0x12ca85[_0x6433('0x37')]);_0x4888b8[_0x6433('0x38')]=_['intersection'](_0x4888b8['model'],_0x4888b8['query']);_0xc03422['attributes']=_[_0x6433('0x39')](_0x4888b8[_0x6433('0x34')],qs[_0x6433('0x3b')](_0x12ca85[_0x6433('0x37')][_0x6433('0x3b')]));_0xc03422[_0x6433('0x3a')]=_0xc03422[_0x6433('0x3a')][_0x6433('0x3c')]?_0xc03422[_0x6433('0x3a')]:_0x4888b8['model'];if(_0x12ca85['query'][_0x6433('0x4c')]){_0xc03422[_0x6433('0x46')]=[{'all':!![]}];}_0xc03422=_['merge']({},_0xc03422,_0x12ca85[_0x6433('0x45')]);return db['ChatGroup'][_0x6433('0x4d')](_0xc03422)['then'](handleEntityNotFound(_0xe32200,null))['then'](respondWithResult(_0xe32200,null))[_0x6433('0x4e')](handleError(_0xe32200,null));};exports[_0x6433('0x4f')]=function(_0xa2d90d,_0x573177){return db['ChatGroup']['create'](_0xa2d90d[_0x6433('0x50')],{})[_0x6433('0x2b')](respondWithResult(_0x573177,0xc9))[_0x6433('0x4e')](handleError(_0x573177,null));};exports[_0x6433('0x51')]=function(_0x5768dd,_0x2d0e95){if(_0x5768dd[_0x6433('0x50')]['id']){delete _0x5768dd['body']['id'];}return db['ChatGroup'][_0x6433('0x4d')]({'where':{'id':_0x5768dd['params']['id']}})[_0x6433('0x2b')](handleEntityNotFound(_0x2d0e95,null))[_0x6433('0x2b')](saveUpdates(_0x5768dd[_0x6433('0x50')],null))[_0x6433('0x2b')](respondWithResult(_0x2d0e95,null))[_0x6433('0x4e')](handleError(_0x2d0e95,null));};exports[_0x6433('0x2c')]=function(_0x5bed8b,_0x238fd0){return db[_0x6433('0x4b')][_0x6433('0x4d')]({'where':{'id':_0x5bed8b['params']['id']}})['then'](handleEntityNotFound(_0x238fd0,null))[_0x6433('0x2b')](removeEntity(_0x238fd0,null))['catch'](handleError(_0x238fd0,null));};exports[_0x6433('0x52')]=function(_0x170050,_0x8e1894){return db[_0x6433('0x4b')]['describe']()[_0x6433('0x2b')](respondWithResult(_0x8e1894,null))[_0x6433('0x4e')](handleError(_0x8e1894,null));};exports[_0x6433('0x53')]=function(_0x215831,_0x22a12e,_0xd08510){return db[_0x6433('0x54')][_0x6433('0x26')]({'where':{'ChatGroupId':_0x215831['params']['id'],'ToId':_0x215831[_0x6433('0x55')]['id'],'read':![]}})[_0x6433('0x2b')](function(_0x4ea2ce){return{'id':_['toInteger'](_0x215831[_0x6433('0x4a')]['id']),'count':_0x4ea2ce};})[_0x6433('0x2b')](respondWithResult(_0x22a12e,null))[_0x6433('0x4e')](handleError(_0x22a12e,null));};exports[_0x6433('0x56')]=function(_0x3323ff,_0x155330,_0x387c8a){return db[_0x6433('0x4b')]['find']({'where':{'id':_0x3323ff[_0x6433('0x4a')]['id']}})[_0x6433('0x2b')](handleEntityNotFound(_0x155330,null))[_0x6433('0x2b')](function(_0x37035c){if(_0x37035c){return _0x37035c['addMembers'](_0x3323ff['body'][_0x6433('0x57')],_[_0x6433('0x58')](_0x3323ff[_0x6433('0x50')],[_0x6433('0x57'),'id'])||{});}})[_0x6433('0x2b')](respondWithResult(_0x155330,null))[_0x6433('0x4e')](handleError(_0x155330,null));};exports[_0x6433('0x59')]=function(_0x1af68d,_0xb0521a,_0x3c5248){var _0x5d5d2d={};var _0x763e4f={};var _0x8c16;var _0xe1f5a3;return db[_0x6433('0x4b')][_0x6433('0x5a')]({'where':{'id':_0x1af68d['params']['id']}})['then'](handleEntityNotFound(_0xb0521a,null))['then'](function(_0x2d34ee){if(_0x2d34ee){_0x8c16=_0x2d34ee;_0x763e4f['model']=_[_0x6433('0x36')](db[_0x6433('0x5b')][_0x6433('0x32')]);_0x763e4f[_0x6433('0x37')]=_[_0x6433('0x36')](_0x1af68d[_0x6433('0x37')]);_0x763e4f[_0x6433('0x38')]=_['intersection'](_0x763e4f[_0x6433('0x34')],_0x763e4f[_0x6433('0x37')]);_0x5d5d2d[_0x6433('0x3a')]=_[_0x6433('0x39')](_0x763e4f[_0x6433('0x34')],qs[_0x6433('0x3b')](_0x1af68d[_0x6433('0x37')][_0x6433('0x3b')]));_0x5d5d2d[_0x6433('0x3a')]=_0x5d5d2d[_0x6433('0x3a')][_0x6433('0x3c')]?_0x5d5d2d[_0x6433('0x3a')]:_0x763e4f[_0x6433('0x34')];_0x5d5d2d[_0x6433('0x5c')]=qs['sort'](_0x1af68d[_0x6433('0x37')][_0x6433('0x3e')]);_0x5d5d2d[_0x6433('0x3f')]=qs[_0x6433('0x38')](_[_0x6433('0x40')](_0x1af68d['query'],_0x763e4f['filters']));if(_0x1af68d['query'][_0x6433('0x41')]){_0x5d5d2d[_0x6433('0x3f')]=_[_0x6433('0x42')](_0x5d5d2d['where'],{'$or':_[_0x6433('0x35')](_0x5d5d2d[_0x6433('0x3a')],function(_0x386f69){var _0x3a35ee={};_0x3a35ee[_0x386f69]={'$like':'%'+_0x1af68d[_0x6433('0x37')]['filter']+'%'};return _0x3a35ee;})});}_0x5d5d2d=_['merge']({},_0x5d5d2d,_0x1af68d[_0x6433('0x45')]);return _0x8c16[_0x6433('0x59')](_0x5d5d2d);}})[_0x6433('0x2b')](function(_0x218b40){if(_0x218b40){_0xe1f5a3=_0x218b40[_0x6433('0x3c')];if(!_0x1af68d[_0x6433('0x37')]['hasOwnProperty'](_0x6433('0x5d'))){_0x5d5d2d[_0x6433('0x24')]=qs[_0x6433('0x24')](_0x1af68d[_0x6433('0x37')][_0x6433('0x24')]);_0x5d5d2d[_0x6433('0x23')]=qs[_0x6433('0x23')](_0x1af68d[_0x6433('0x37')][_0x6433('0x23')]);}return _0x8c16['getMembers'](_0x5d5d2d);}})[_0x6433('0x2b')](function(_0x2f7cc6){if(_0x2f7cc6){return _0x2f7cc6?{'count':_0xe1f5a3,'rows':_0x2f7cc6}:null;}})[_0x6433('0x2b')](respondWithResult(_0xb0521a,null))[_0x6433('0x4e')](handleError(_0xb0521a,null));};exports['removeMembers']=function(_0xa4d1f7,_0x4205c4,_0x58e6ec){return db['ChatGroup']['find']({'where':{'id':_0xa4d1f7[_0x6433('0x4a')]['id']}})[_0x6433('0x2b')](handleEntityNotFound(_0x4205c4,null))[_0x6433('0x2b')](function(_0x3b6ee3){if(_0x3b6ee3){return _0x3b6ee3['removeMembers'](_0xa4d1f7[_0x6433('0x37')]['ids']);}})[_0x6433('0x2b')](respondWithStatusCode(_0x4205c4,null))[_0x6433('0x4e')](handleError(_0x4205c4,null));};exports[_0x6433('0x5e')]=function(_0x52037d,_0x47268e,_0x4d7f1f){if(_0x52037d['body']['id']){delete _0x52037d[_0x6433('0x50')]['id'];}return db[_0x6433('0x4b')][_0x6433('0x4d')]({'where':{'id':_0x52037d['params']['id']}})['then'](handleEntityNotFound(_0x47268e,null))[_0x6433('0x2b')](function(_0x4dcbbd){if(_0x4dcbbd){_0x52037d[_0x6433('0x50')][_0x6433('0x5f')]=_0x4dcbbd['id'];return db[_0x6433('0x54')][_0x6433('0x4f')](_0x52037d[_0x6433('0x50')]);}})[_0x6433('0x2b')](respondWithResult(_0x47268e,null))['catch'](handleError(_0x47268e,null));};exports[_0x6433('0x60')]=function(_0x22d8f5,_0x47b7c5,_0x56c7fa){var _0x549f7c={};var _0x534707={};var _0xc19be7;var _0x2282a0;return db[_0x6433('0x4b')][_0x6433('0x5a')]({'where':{'id':_0x22d8f5[_0x6433('0x4a')]['id']}})['then'](handleEntityNotFound(_0x47b7c5,null))[_0x6433('0x2b')](function(_0x41b38d){if(_0x41b38d){_0xc19be7=_0x41b38d;_0x534707[_0x6433('0x34')]=_['keys'](db[_0x6433('0x54')][_0x6433('0x32')]);_0x534707['query']=_[_0x6433('0x36')](_0x22d8f5['query']);_0x534707[_0x6433('0x38')]=_[_0x6433('0x39')](_0x534707[_0x6433('0x34')],_0x534707[_0x6433('0x37')]);_0x549f7c['attributes']=_[_0x6433('0x39')](_0x534707['model'],qs[_0x6433('0x3b')](_0x22d8f5[_0x6433('0x37')][_0x6433('0x3b')]));_0x549f7c[_0x6433('0x3a')]=_0x549f7c[_0x6433('0x3a')][_0x6433('0x3c')]?_0x549f7c[_0x6433('0x3a')]:_0x534707['model'];_0x549f7c[_0x6433('0x5c')]=qs[_0x6433('0x3e')](_0x22d8f5[_0x6433('0x37')][_0x6433('0x3e')]);_0x549f7c['where']=qs['filters'](_[_0x6433('0x40')](_0x22d8f5[_0x6433('0x37')],_0x534707[_0x6433('0x38')]));if(_0x22d8f5[_0x6433('0x37')][_0x6433('0x41')]){_0x549f7c[_0x6433('0x3f')]=_['merge'](_0x549f7c['where'],{'$or':_[_0x6433('0x35')](_0x549f7c[_0x6433('0x3a')],function(_0xf6fce4){var _0xf5494={};_0xf5494[_0xf6fce4]={'$like':'%'+_0x22d8f5['query'][_0x6433('0x41')]+'%'};return _0xf5494;})});}if(_0x22d8f5[_0x6433('0x37')][_0x6433('0x61')]){var _0x37652d=_0x22d8f5[_0x6433('0x37')]['$gte'][_0x6433('0x62')](',');var _0x270c43={};_0x270c43[_0x37652d[0x0]]={'$gte':moment(_0x37652d[0x1])[_0x6433('0x63')](_0x6433('0x64'))};_0x549f7c[_0x6433('0x3f')]=_[_0x6433('0x42')](_0x549f7c[_0x6433('0x3f')],_0x270c43);}_0x549f7c=_[_0x6433('0x42')]({},_0x549f7c,_0x22d8f5['options']);return _0xc19be7[_0x6433('0x60')](_0x549f7c);}})['then'](function(_0x599a7c){if(_0x599a7c){_0x2282a0=_0x599a7c[_0x6433('0x3c')];if(!_0x22d8f5[_0x6433('0x37')][_0x6433('0x3d')](_0x6433('0x5d'))){_0x549f7c[_0x6433('0x24')]=qs[_0x6433('0x24')](_0x22d8f5[_0x6433('0x37')][_0x6433('0x24')]);_0x549f7c['offset']=qs['offset'](_0x22d8f5['query'][_0x6433('0x23')]);}return _0xc19be7['getMessages'](_0x549f7c);}})[_0x6433('0x2b')](function(_0x514a82){if(_0x514a82){return _0x514a82?{'count':_0x2282a0,'rows':_0x514a82}:null;}})[_0x6433('0x2b')](respondWithResult(_0x47b7c5,null))[_0x6433('0x4e')](handleError(_0x47b7c5,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index a4ccde8..977fb78 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 _0x33aa=['hasOwnProperty','hook','exports','events','../../mysqldb','ChatGroup','setMaxListeners','save','update','remove','emit'];(function(_0x428f01,_0x1aa22c){var _0x3aa144=function(_0x29699c){while(--_0x29699c){_0x428f01['push'](_0x428f01['shift']());}};_0x3aa144(++_0x1aa22c);}(_0x33aa,0xc9));var _0xa33a=function(_0x17ba85,_0x2db9e9){_0x17ba85=_0x17ba85-0x0;var _0x4c17ac=_0x33aa[_0x17ba85];return _0x4c17ac;};'use strict';var EventEmitter=require(_0xa33a('0x0'));var ChatGroup=require(_0xa33a('0x1'))['db'][_0xa33a('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xa33a('0x3')](0x0);var events={'afterCreate':_0xa33a('0x4'),'afterUpdate':_0xa33a('0x5'),'afterDestroy':_0xa33a('0x6')};function emitEvent(_0x31060d){return function(_0x530bf8,_0x5b8073,_0x1655fa){ChatGroupEvents[_0xa33a('0x7')](_0x31060d+':'+_0x530bf8['id'],_0x530bf8);ChatGroupEvents[_0xa33a('0x7')](_0x31060d,_0x530bf8);_0x1655fa(null);};}for(var e in events){if(events[_0xa33a('0x8')](e)){var event=events[e];ChatGroup[_0xa33a('0x9')](e,emitEvent(event));}}module[_0xa33a('0xa')]=ChatGroupEvents; \ No newline at end of file +var _0x5b1a=['setMaxListeners','save','remove','emit','hasOwnProperty','hook','events','../../mysqldb','ChatGroup'];(function(_0x59530a,_0x1d7143){var _0x4d67e6=function(_0x303687){while(--_0x303687){_0x59530a['push'](_0x59530a['shift']());}};_0x4d67e6(++_0x1d7143);}(_0x5b1a,0x8d));var _0xa5b1=function(_0x56e6e3,_0x10ac27){_0x56e6e3=_0x56e6e3-0x0;var _0xf47df1=_0x5b1a[_0x56e6e3];return _0xf47df1;};'use strict';var EventEmitter=require(_0xa5b1('0x0'));var ChatGroup=require(_0xa5b1('0x1'))['db'][_0xa5b1('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xa5b1('0x3')](0x0);var events={'afterCreate':_0xa5b1('0x4'),'afterUpdate':'update','afterDestroy':_0xa5b1('0x5')};function emitEvent(_0x244e42){return function(_0x2c4876,_0x5b61a7,_0x4310c6){ChatGroupEvents[_0xa5b1('0x6')](_0x244e42+':'+_0x2c4876['id'],_0x2c4876);ChatGroupEvents['emit'](_0x244e42,_0x2c4876);_0x4310c6(null);};}for(var e in events){if(events[_0xa5b1('0x7')](e)){var event=events[e];ChatGroup[_0xa5b1('0x8')](e,emitEvent(event));}}module['exports']=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index 0b1c09c..1421f4b 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 _0xdabc=['exports','ChatGroup','chat_groups','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./chatGroup.attributes'];(function(_0x49bfb7,_0x17225b){var _0x3354e3=function(_0x1fa7f3){while(--_0x1fa7f3){_0x49bfb7['push'](_0x49bfb7['shift']());}};_0x3354e3(++_0x17225b);}(_0xdabc,0x1e4));var _0xcdab=function(_0x5da27f,_0x504b76){_0x5da27f=_0x5da27f-0x0;var _0x54a3fb=_0xdabc[_0x5da27f];return _0x54a3fb;};'use strict';var _=require(_0xcdab('0x0'));var util=require(_0xcdab('0x1'));var logger=require(_0xcdab('0x2'))(_0xcdab('0x3'));var moment=require(_0xcdab('0x4'));var BPromise=require(_0xcdab('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcdab('0x6'));var rimraf=require(_0xcdab('0x7'));var config=require(_0xcdab('0x8'));var attributes=require(_0xcdab('0x9'));module[_0xcdab('0xa')]=function(_0x5c8feb,_0xed0dca){return _0x5c8feb['define'](_0xcdab('0xb'),attributes,{'tableName':_0xcdab('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xde78=['path','rimraf','./chatGroup.attributes','ChatGroup','chat_groups','util','../../config/logger','api','moment'];(function(_0x512bdc,_0x5897ba){var _0x1e09a1=function(_0x29a595){while(--_0x29a595){_0x512bdc['push'](_0x512bdc['shift']());}};_0x1e09a1(++_0x5897ba);}(_0xde78,0x68));var _0x8de7=function(_0x295a3d,_0x56d487){_0x295a3d=_0x295a3d-0x0;var _0x23a732=_0xde78[_0x295a3d];return _0x23a732;};'use strict';var _=require('lodash');var util=require(_0x8de7('0x0'));var logger=require(_0x8de7('0x1'))(_0x8de7('0x2'));var moment=require(_0x8de7('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x8de7('0x4'));var rimraf=require(_0x8de7('0x5'));var config=require('../../config/environment');var attributes=require(_0x8de7('0x6'));module['exports']=function(_0x24d80c,_0x2b3b0d){return _0x24d80c['define'](_0x8de7('0x7'),attributes,{'tableName':_0x8de7('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 3d71bb5..57e96c2 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 _0xf873=['then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','error','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./chatGroup.socket','request'];(function(_0x350aeb,_0x3d265a){var _0x3c5273=function(_0x32b417){while(--_0x32b417){_0x350aeb['push'](_0x350aeb['shift']());}};_0x3c5273(++_0x3d265a);}(_0xf873,0xb2));var _0x3f87=function(_0x86069d,_0x47a44f){_0x86069d=_0x86069d-0x0;var _0x4d1813=_0xf873[_0x86069d];return _0x4d1813;};'use strict';var _=require('lodash');var util=require(_0x3f87('0x0'));var moment=require(_0x3f87('0x1'));var BPromise=require(_0x3f87('0x2'));var rs=require(_0x3f87('0x3'));var fs=require('fs');var Redis=require(_0x3f87('0x4'));var db=require(_0x3f87('0x5'))['db'];var utils=require(_0x3f87('0x6'));var logger=require(_0x3f87('0x7'))(_0x3f87('0x8'));var config=require('../../config/environment');var jayson=require(_0x3f87('0x9'));var client=jayson[_0x3f87('0xa')][_0x3f87('0xb')]({'port':0x232a});config['redis']=_[_0x3f87('0xc')](config[_0x3f87('0xd')],{'host':_0x3f87('0xe'),'port':0x18eb});var socket=require(_0x3f87('0xf'))(new Redis(config[_0x3f87('0xd')]));require(_0x3f87('0x10'))['register'](socket);function respondWithRpcPromise(_0x1405ca,_0x435ca8,_0x32e236){return new BPromise(function(_0x3e6ca6,_0x1ad2a9){return client[_0x3f87('0x11')](_0x1405ca,_0x32e236)[_0x3f87('0x12')](function(_0x2b7ca0){logger[_0x3f87('0x13')](_0x3f87('0x14'),_0x435ca8,_0x3f87('0x15'));logger[_0x3f87('0x16')](_0x3f87('0x17'),_0x435ca8,_0x3f87('0x15'),JSON['stringify'](_0x2b7ca0));if(_0x2b7ca0[_0x3f87('0x18')]){if(_0x2b7ca0[_0x3f87('0x18')]['code']===0x1f4){logger[_0x3f87('0x18')](_0x3f87('0x14'),_0x435ca8,_0x2b7ca0[_0x3f87('0x18')][_0x3f87('0x19')]);return _0x1ad2a9(_0x2b7ca0[_0x3f87('0x18')][_0x3f87('0x19')]);}logger[_0x3f87('0x18')](_0x3f87('0x14'),_0x435ca8,_0x2b7ca0['error'][_0x3f87('0x19')]);return _0x3e6ca6(_0x2b7ca0[_0x3f87('0x18')][_0x3f87('0x19')]);}else{logger['info'](_0x3f87('0x14'),_0x435ca8,'request\x20sent');_0x3e6ca6(_0x2b7ca0[_0x3f87('0x1a')][_0x3f87('0x19')]);}})[_0x3f87('0x1b')](function(_0x279eba){logger[_0x3f87('0x18')]('ChatGroup,\x20%s,\x20%s',_0x435ca8,_0x279eba);_0x1ad2a9(_0x279eba);});});} \ No newline at end of file +var _0x2830=['then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./chatGroup.socket','register','request'];(function(_0x25e995,_0x143cdc){var _0x446a58=function(_0x545ebc){while(--_0x545ebc){_0x25e995['push'](_0x25e995['shift']());}};_0x446a58(++_0x143cdc);}(_0x2830,0x117));var _0x0283=function(_0xe9dec7,_0xc6abe5){_0xe9dec7=_0xe9dec7-0x0;var _0x571637=_0x2830[_0xe9dec7];return _0x571637;};'use strict';var _=require(_0x0283('0x0'));var util=require(_0x0283('0x1'));var moment=require(_0x0283('0x2'));var BPromise=require(_0x0283('0x3'));var rs=require(_0x0283('0x4'));var fs=require('fs');var Redis=require(_0x0283('0x5'));var db=require(_0x0283('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x0283('0x7'))('rpc');var config=require(_0x0283('0x8'));var jayson=require(_0x0283('0x9'));var client=jayson[_0x0283('0xa')][_0x0283('0xb')]({'port':0x232a});config[_0x0283('0xc')]=_[_0x0283('0xd')](config[_0x0283('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x0283('0xe'))(new Redis(config[_0x0283('0xc')]));require(_0x0283('0xf'))[_0x0283('0x10')](socket);function respondWithRpcPromise(_0x27bf23,_0x3bc546,_0x337cb7){return new BPromise(function(_0x2c912c,_0x5a5adb){return client[_0x0283('0x11')](_0x27bf23,_0x337cb7)[_0x0283('0x12')](function(_0x1d77cc){logger[_0x0283('0x13')](_0x0283('0x14'),_0x3bc546,_0x0283('0x15'));logger[_0x0283('0x16')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x3bc546,_0x0283('0x15'),JSON['stringify'](_0x1d77cc));if(_0x1d77cc['error']){if(_0x1d77cc[_0x0283('0x17')][_0x0283('0x18')]===0x1f4){logger[_0x0283('0x17')](_0x0283('0x14'),_0x3bc546,_0x1d77cc[_0x0283('0x17')]['message']);return _0x5a5adb(_0x1d77cc['error']['message']);}logger[_0x0283('0x17')](_0x0283('0x14'),_0x3bc546,_0x1d77cc[_0x0283('0x17')][_0x0283('0x19')]);return _0x2c912c(_0x1d77cc[_0x0283('0x17')][_0x0283('0x19')]);}else{logger[_0x0283('0x13')](_0x0283('0x14'),_0x3bc546,_0x0283('0x15'));_0x2c912c(_0x1d77cc[_0x0283('0x1a')][_0x0283('0x19')]);}})['catch'](function(_0x3bbb8c){logger[_0x0283('0x17')](_0x0283('0x14'),_0x3bc546,_0x3bbb8c);_0x5a5adb(_0x3bbb8c);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index 336c000..02ae5b1 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 _0x0fc7=['./chatGroup.events','save','emit','length','chatGroup:'];(function(_0x2296dd,_0x534a97){var _0x4df384=function(_0x147aa2){while(--_0x147aa2){_0x2296dd['push'](_0x2296dd['shift']());}};_0x4df384(++_0x534a97);}(_0x0fc7,0xf5));var _0x70fc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0fc7[_0x3dd15e];return _0x231fd0;};'use strict';var ChatGroupEvents=require(_0x70fc('0x0'));var events=[_0x70fc('0x1'),'remove','update'];function createListener(_0x18479c,_0x425cfc){return function(_0x542429){_0x425cfc[_0x70fc('0x2')](_0x18479c,_0x542429);};}function removeListener(_0x309846,_0xdba98a){return function(){ChatGroupEvents['removeListener'](_0x309846,_0xdba98a);};}exports['register']=function(_0x8a662){for(var _0x29c2cd=0x0,_0x347f14=events[_0x70fc('0x3')];_0x29c2cd<_0x347f14;_0x29c2cd++){var _0x3c80e4=events[_0x29c2cd];var _0x55744f=createListener(_0x70fc('0x4')+_0x3c80e4,_0x8a662);ChatGroupEvents['on'](_0x3c80e4,_0x55744f);}}; \ No newline at end of file +var _0x79d3=['removeListener','length','chatGroup:','./chatGroup.events','save','remove','update','emit'];(function(_0x2e5dcf,_0x3a88d6){var _0x5d45db=function(_0x5c9b2b){while(--_0x5c9b2b){_0x2e5dcf['push'](_0x2e5dcf['shift']());}};_0x5d45db(++_0x3a88d6);}(_0x79d3,0xe3));var _0x379d=function(_0x24f9d9,_0x6b4d81){_0x24f9d9=_0x24f9d9-0x0;var _0x392b6c=_0x79d3[_0x24f9d9];return _0x392b6c;};'use strict';var ChatGroupEvents=require(_0x379d('0x0'));var events=[_0x379d('0x1'),_0x379d('0x2'),_0x379d('0x3')];function createListener(_0x40627f,_0x44e2ff){return function(_0x5b3b7e){_0x44e2ff[_0x379d('0x4')](_0x40627f,_0x5b3b7e);};}function removeListener(_0x2ca4cb,_0x329566){return function(){ChatGroupEvents[_0x379d('0x5')](_0x2ca4cb,_0x329566);};}exports['register']=function(_0x10f234){for(var _0x283582=0x0,_0x13fa43=events[_0x379d('0x6')];_0x283582<_0x13fa43;_0x283582++){var _0x104c3a=events[_0x283582];var _0x208e6e=createListener(_0x379d('0x7')+_0x104c3a,_0x10f234);ChatGroupEvents['on'](_0x104c3a,_0x208e6e);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index 1ff7e36..3e0bef4 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 _0x8e57=['/describe','isAuthenticated','/:id','show','/:id/unread','getUnread','getMembers','/:id/messages','post','create','/:id/members','update','delete','destroy','util','express','Router','../../components/auth/service','../../components/interaction/service','./chatGroup.controller','get'];(function(_0x344a3f,_0x579a22){var _0x264712=function(_0x34c9f0){while(--_0x34c9f0){_0x344a3f['push'](_0x344a3f['shift']());}};_0x264712(++_0x579a22);}(_0x8e57,0x11f));var _0x78e5=function(_0x1a44e3,_0x5dd6ad){_0x1a44e3=_0x1a44e3-0x0;var _0x5f5cca=_0x8e57[_0x1a44e3];return _0x5f5cca;};'use strict';var multer=require('multer');var util=require(_0x78e5('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x78e5('0x1'));var router=express[_0x78e5('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x78e5('0x3'));var interaction=require(_0x78e5('0x4'));var config=require('../../config/environment');var controller=require(_0x78e5('0x5'));router[_0x78e5('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x78e5('0x6')](_0x78e5('0x7'),auth[_0x78e5('0x8')](),controller['describe']);router['get'](_0x78e5('0x9'),auth[_0x78e5('0x8')](),controller[_0x78e5('0xa')]);router[_0x78e5('0x6')](_0x78e5('0xb'),auth[_0x78e5('0x8')](),controller[_0x78e5('0xc')]);router[_0x78e5('0x6')]('/:id/members',auth['isAuthenticated'](),controller[_0x78e5('0xd')]);router[_0x78e5('0x6')](_0x78e5('0xe'),auth[_0x78e5('0x8')](),controller['getMessages']);router[_0x78e5('0xf')]('/',auth[_0x78e5('0x8')](),controller[_0x78e5('0x10')]);router['post'](_0x78e5('0x11'),auth[_0x78e5('0x8')](),controller['addMembers']);router['post']('/:id/messages',auth[_0x78e5('0x8')](),controller['addMessage']);router['put'](_0x78e5('0x9'),auth[_0x78e5('0x8')](),controller[_0x78e5('0x12')]);router[_0x78e5('0x13')](_0x78e5('0x9'),auth[_0x78e5('0x8')](),controller[_0x78e5('0x14')]);router[_0x78e5('0x13')](_0x78e5('0x11'),auth[_0x78e5('0x8')](),controller['removeMembers']);module['exports']=router; \ No newline at end of file +var _0x1b1a=['put','delete','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','getMessages','post','addMembers','addMessage'];(function(_0x281fcb,_0x373bd5){var _0x446e81=function(_0x44689c){while(--_0x44689c){_0x281fcb['push'](_0x281fcb['shift']());}};_0x446e81(++_0x373bd5);}(_0x1b1a,0x199));var _0xa1b1=function(_0x28fbbf,_0x11f896){_0x28fbbf=_0x28fbbf-0x0;var _0x543af6=_0x1b1a[_0x28fbbf];return _0x543af6;};'use strict';var multer=require(_0xa1b1('0x0'));var util=require('util');var path=require(_0xa1b1('0x1'));var timeout=require(_0xa1b1('0x2'));var express=require(_0xa1b1('0x3'));var router=express['Router']();var fs_extra=require(_0xa1b1('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xa1b1('0x5'));var config=require(_0xa1b1('0x6'));var controller=require(_0xa1b1('0x7'));router[_0xa1b1('0x8')]('/',auth[_0xa1b1('0x9')](),controller['index']);router[_0xa1b1('0x8')](_0xa1b1('0xa'),auth[_0xa1b1('0x9')](),controller[_0xa1b1('0xb')]);router[_0xa1b1('0x8')](_0xa1b1('0xc'),auth['isAuthenticated'](),controller[_0xa1b1('0xd')]);router[_0xa1b1('0x8')](_0xa1b1('0xe'),auth['isAuthenticated'](),controller[_0xa1b1('0xf')]);router[_0xa1b1('0x8')](_0xa1b1('0x10'),auth[_0xa1b1('0x9')](),controller[_0xa1b1('0x11')]);router[_0xa1b1('0x8')](_0xa1b1('0x12'),auth[_0xa1b1('0x9')](),controller[_0xa1b1('0x13')]);router[_0xa1b1('0x14')]('/',auth[_0xa1b1('0x9')](),controller['create']);router[_0xa1b1('0x14')](_0xa1b1('0x10'),auth[_0xa1b1('0x9')](),controller[_0xa1b1('0x15')]);router[_0xa1b1('0x14')]('/:id/messages',auth[_0xa1b1('0x9')](),controller[_0xa1b1('0x16')]);router[_0xa1b1('0x17')](_0xa1b1('0xc'),auth[_0xa1b1('0x9')](),controller['update']);router[_0xa1b1('0x18')](_0xa1b1('0xc'),auth[_0xa1b1('0x9')](),controller[_0xa1b1('0x19')]);router[_0xa1b1('0x18')](_0xa1b1('0x10'),auth['isAuthenticated'](),controller['removeMembers']);module[_0xa1b1('0x1a')]=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index 1881ab9..affd74e 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 _0x7be1=['ENUM','star','thumb','TEXT','STRING','DATE','out','sequelize','exports','BOOLEAN'];(function(_0x292c39,_0x46338b){var _0x56859d=function(_0x2a27f2){while(--_0x2a27f2){_0x292c39['push'](_0x292c39['shift']());}};_0x56859d(++_0x46338b);}(_0x7be1,0x165));var _0x17be=function(_0x2c9e61,_0x2d13f5){_0x2c9e61=_0x2c9e61-0x0;var _0x4d55d6=_0x7be1[_0x2c9e61];return _0x4d55d6;};'use strict';var Sequelize=require(_0x17be('0x0'));module[_0x17be('0x1')]={'closed':{'type':Sequelize[_0x17be('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0x17be('0x3')](_0x17be('0x4'),_0x17be('0x5')),'defaultValue':_0x17be('0x4')},'ratingMessage':{'type':Sequelize[_0x17be('0x6')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x17be('0x7')]},'secondDisposition':{'type':Sequelize[_0x17be('0x7')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x17be('0x7')]},'browserName':{'type':Sequelize[_0x17be('0x7')]},'browserVersion':{'type':Sequelize[_0x17be('0x7')]},'osName':{'type':Sequelize[_0x17be('0x7')]},'osVersion':{'type':Sequelize[_0x17be('0x7')]},'deviceModel':{'type':Sequelize[_0x17be('0x7')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize[_0x17be('0x7')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0x17be('0x7')]},'formData':{'type':Sequelize[_0x17be('0x6')]('long')},'read1stAt':{'type':Sequelize[_0x17be('0x8')]},'lastMsgAt':{'type':Sequelize[_0x17be('0x8')]},'lastMsgDirection':{'type':Sequelize[_0x17be('0x3')]('in',_0x17be('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0x17be('0x7')]},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize[_0x17be('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x7d25=['thumb','STRING','TEXT','long','DATE','out','exports','BOOLEAN','INTEGER','ENUM','star'];(function(_0xa990b7,_0x26c527){var _0x52c99c=function(_0xf94328){while(--_0xf94328){_0xa990b7['push'](_0xa990b7['shift']());}};_0x52c99c(++_0x26c527);}(_0x7d25,0x8a));var _0x57d2=function(_0x344a3f,_0x579a22){_0x344a3f=_0x344a3f-0x0;var _0x264712=_0x7d25[_0x344a3f];return _0x264712;};'use strict';var Sequelize=require('sequelize');module[_0x57d2('0x0')]={'closed':{'type':Sequelize[_0x57d2('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x57d2('0x2')]},'ratingType':{'type':Sequelize[_0x57d2('0x3')](_0x57d2('0x4'),_0x57d2('0x5')),'defaultValue':_0x57d2('0x4')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x57d2('0x6')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x57d2('0x6')]},'note':{'type':Sequelize[_0x57d2('0x6')]},'browserName':{'type':Sequelize[_0x57d2('0x6')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize[_0x57d2('0x6')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0x57d2('0x6')]},'deviceType':{'type':Sequelize[_0x57d2('0x6')]},'referer':{'type':Sequelize[_0x57d2('0x7')]},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0x57d2('0x7')](_0x57d2('0x8'))},'read1stAt':{'type':Sequelize[_0x57d2('0x9')]},'lastMsgAt':{'type':Sequelize[_0x57d2('0x9')]},'lastMsgDirection':{'type':Sequelize[_0x57d2('0x3')]('in',_0x57d2('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x57d2('0x6')]},'customerPort':{'type':Sequelize[_0x57d2('0x6')]},'vidaooSessionId':{'type':Sequelize[_0x57d2('0x7')]},'autoreplyExecuted':{'type':Sequelize[_0x57d2('0x1')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index 243f930..6064c17 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 _0x757a=['u.id','u.fullname','user_has_chat_interactions','left_join','users','u.id\x20=\x20ui.UserId','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','search','parseSearch','conditions','length','find','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','type','start','some','compact','isEmpty','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','Sequelize','QueryTypes','SELECT','clone','unreadMessages','contactName','DESC','t.id\x20IN\x20?','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','keyBy','a.key','Account.key','a.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','c.phone','Contact.phone','c.mobile','Contact.mobile','Owner.fullname','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','ChatInteractionId','all','show','params','rawAttributes','includeAll','include','options','create','findOne','ChatWebsite','vidaooApiKey','vidaooTopic','vidaooNote','vidaooMetadata','vidaooEscalation','fullname','email','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','metadata','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','customUpdate','CmContact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','UserId','Interaction\x20already\x20assigned','closed','AbandonInteraction','file','filename','mimetype','Attachment','attachmentDownload','Unauthorized','attachId','ChatOfflineMessageId','join','basename','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','Messages','%s%d','System','customer','Visitor','agentIdentifier','website_alias','agent_alias','alias','agent_fullname','agentAlias','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','MailAccount','MailServerOut','Smtp','service','host','port','authentication','auth','pass','SendMail','sendMail','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','mailTranscript','addMessage','ids','omit','getMessages','$gte','findAll','getMyMessages','secret','includeAgent','addTags','setTags','color','emit','chatInteractionTags:save','removeTags','download','server','files','tmp','root','attachments','transcript-%d-%s.zip','firstName','Account','Owner','get','mkdirSync','Chat','N.A.','closedAt','YYYY-MM-DD\x20HH:mm:ss','browserName','osName','referer','customerIp','customerPort','tail','existsSync','createReadStream','pipe','createWriteStream','lastName','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','log','err','unlinkSync','rimraf','zip-dir','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','redis','localhost','./chatInteraction.socket','register','jayson/promise','client','http','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','sendStatus','status','undefined','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','end','stack','name','send','render','merge','body','contact','agent','interaction','account','Users','map','TagIds','Tags','split','forEach','push','catch','index','ChatInteraction','fieldName','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','pick','select','field','from','tools_tags'];(function(_0x3efdc4,_0x1f962a){var _0x314b59=function(_0x404253){while(--_0x404253){_0x3efdc4['push'](_0x3efdc4['shift']());}};_0x314b59(++_0x1f962a);}(_0x757a,0xde));var _0xa757=function(_0x3a69cb,_0x27ef04){_0x3a69cb=_0x3a69cb-0x0;var _0x48cccb=_0x757a[_0x3a69cb];return _0x48cccb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa757('0x0'));var zipdir=require(_0xa757('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xa757('0x2'));var Mustache=require(_0xa757('0x3'));var util=require(_0xa757('0x4'));var path=require(_0xa757('0x5'));var sox=require(_0xa757('0x6'));var csv=require(_0xa757('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xa757('0x8'));var _=require(_0xa757('0x9'));var squel=require('squel');var crypto=require(_0xa757('0xa'));var jsforce=require(_0xa757('0xb'));var deskjs=require(_0xa757('0xc'));var toCsv=require(_0xa757('0x7'));var querystring=require(_0xa757('0xd'));var Papa=require('papaparse');var Redis=require(_0xa757('0xe'));var authService=require(_0xa757('0xf'));var qs=require(_0xa757('0x10'));var as=require(_0xa757('0x11'));var pdf=require(_0xa757('0x12'));var hardwareService=require(_0xa757('0x13'));var logger=require(_0xa757('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xa757('0x15')]=_['defaults'](config['redis'],{'host':_0xa757('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xa757('0x17'))[_0xa757('0x18')](socket);var jayson=require(_0xa757('0x19'));var client=jayson[_0xa757('0x1a')][_0xa757('0x1b')]({'port':0x232b});var client9004=jayson[_0xa757('0x1a')][_0xa757('0x1b')]({'port':0x232c});function respondWithRpcPromise(_0x2f7947,_0x185011,_0x3df1f9,_0x50aac1){return new BPromise(function(_0x2e195b,_0x44eab8){var _0xde8248=_0x50aac1||client;return _0xde8248['request'](_0x2f7947,_0x3df1f9)['then'](function(_0x151c04){logger[_0xa757('0x1c')](_0xa757('0x1d'),_0x185011,_0xa757('0x1e'));logger[_0xa757('0x1f')](_0xa757('0x20'),_0x185011,'request\x20sent',JSON[_0xa757('0x21')](_0x151c04));if(_0x151c04['error']){if(_0x151c04[_0xa757('0x22')][_0xa757('0x23')]===0x1f4){logger[_0xa757('0x22')](_0xa757('0x1d'),_0x185011,_0x151c04['error']['message']);return _0x44eab8(_0x151c04[_0xa757('0x22')][_0xa757('0x24')]);}logger[_0xa757('0x22')](_0xa757('0x1d'),_0x185011,_0x151c04[_0xa757('0x22')][_0xa757('0x24')]);return _0x2e195b(_0x151c04[_0xa757('0x22')][_0xa757('0x24')]);}else{logger[_0xa757('0x1c')]('ChatInteraction,\x20%s,\x20%s',_0x185011,_0xa757('0x1e'));_0x2e195b(_0x151c04['result'][_0xa757('0x24')]);}})['catch'](function(_0x40551d){logger[_0xa757('0x22')](_0xa757('0x1d'),_0x185011,_0x40551d);_0x44eab8(_0x40551d);});});}function respondWithStatusCode(_0x4d58a4,_0x2b19d5){_0x2b19d5=_0x2b19d5||0xcc;return function(_0xcd98bd){if(_0xcd98bd){return _0x4d58a4[_0xa757('0x25')](_0x2b19d5);}return _0x4d58a4[_0xa757('0x26')](_0x2b19d5)['end']();};}function respondWithResult(_0x449a7d,_0x54263b){_0x54263b=_0x54263b||0xc8;return function(_0x5a5664){if(_0x5a5664){return _0x449a7d['status'](_0x54263b)['json'](_0x5a5664);}};}function respondWithFilteredResult(_0xfdf69d,_0x596ae2){return function(_0x2208f9){if(_0x2208f9){var _0x3bc24c=typeof _0x596ae2['offset']===_0xa757('0x27')&&typeof _0x596ae2['limit']===_0xa757('0x27');var _0xa6d0f6=_0x2208f9['count'];var _0x235e54=_0x3bc24c?0x0:_0x596ae2['offset'];var _0x3a4a66=_0x3bc24c?_0x2208f9[_0xa757('0x28')]:_0x596ae2[_0xa757('0x29')]+_0x596ae2[_0xa757('0x2a')];var _0xcc87c0;if(_0x3a4a66>=_0xa6d0f6){_0x3a4a66=_0xa6d0f6;_0xcc87c0=0xc8;}else{_0xcc87c0=0xce;}_0xfdf69d[_0xa757('0x26')](_0xcc87c0);return _0xfdf69d[_0xa757('0x2b')](_0xa757('0x2c'),_0x235e54+'-'+_0x3a4a66+'/'+_0xa6d0f6)[_0xa757('0x2d')](_0x2208f9);}return null;};}function patchUpdates(_0x384424){return function(_0x1f5d5a){try{jsonpatch[_0xa757('0x2e')](_0x1f5d5a,_0x384424,!![]);}catch(_0x25dfbb){return BPromise[_0xa757('0x2f')](_0x25dfbb);}return _0x1f5d5a[_0xa757('0x30')]();};}function saveUpdates(_0xc1cc20,_0x3e64b7){return function(_0x1ad384){if(_0x1ad384){return _0x1ad384[_0xa757('0x31')](_0xc1cc20)[_0xa757('0x32')](function(_0x3de18f){return _0x3de18f;});}return null;};}function removeEntity(_0x170aa9,_0x379de7){return function(_0x3aae1e){if(_0x3aae1e){return _0x3aae1e['destroy']()[_0xa757('0x32')](function(){_0x170aa9[_0xa757('0x26')](0xcc)[_0xa757('0x33')]();});}};}function handleEntityNotFound(_0x1794a9,_0x1c4c40){return function(_0x51e2aa){if(!_0x51e2aa){_0x1794a9[_0xa757('0x25')](0x194);}return _0x51e2aa;};}function handleError(_0x2af470,_0x37b1a3){_0x37b1a3=_0x37b1a3||0x1f4;return function(_0x2c34b1){logger[_0xa757('0x22')](_0x2c34b1[_0xa757('0x34')]);if(_0x2c34b1['name']){delete _0x2c34b1[_0xa757('0x35')];}_0x2af470[_0xa757('0x26')](_0x37b1a3)[_0xa757('0x36')](_0x2c34b1);};}function getMustacheRender(_0xc34409,_0x3b5104){return Mustache[_0xa757('0x37')](_0xc34409,_[_0xa757('0x38')](_0x3b5104[_0xa757('0x39')],{'contact':_0x3b5104[_0xa757('0x3a')],'message':_0x3b5104['message'],'agent':_0x3b5104[_0xa757('0x3b')],'interaction':_0x3b5104[_0xa757('0x3c')],'account':_0x3b5104[_0xa757('0x3d')]}))||'';}function getInteractionUsers(_0x35c15a,_0x2531be){return new BPromise(function(_0x2fd99e,_0x501e26){try{if(_0x2531be[_0x35c15a['id']]){_0x35c15a[_0xa757('0x3e')]=_[_0xa757('0x3f')](_0x2531be[_0x35c15a['id']],function(_0x48cde9){return{'id':_0x48cde9['id'],'fullname':_0x48cde9['fullname']};});}}catch(_0x9607af){_0x501e26(_0x9607af);}_0x2fd99e(_0x35c15a);});}function getInteractionTags(_0x6193bf,_0x5b11fe){return new BPromise(function(_0x51c3d1,_0xcff7c4){try{if(_0x6193bf[_0xa757('0x40')]){_0x6193bf[_0xa757('0x41')]=[];_0x6193bf['TagIds'][_0xa757('0x42')](',')[_0xa757('0x43')](function(_0x26802c){_0x6193bf[_0xa757('0x41')][_0xa757('0x44')](_0x5b11fe[_0x26802c]);});}delete _0x6193bf['TagIds'];}catch(_0x1f9af){_0xcff7c4(_0x1f9af);}_0x51c3d1(_0x6193bf);});}function updateChatInteraction(_0x52c728,_0x564d40,_0x43329c){return new BPromise(function(_0x57298b,_0x373747){return getInteractionUsers(_0x52c728,_0x43329c)[_0xa757('0x32')](function(_0x9a0934){return getInteractionTags(_0x9a0934,_0x564d40);})['then'](function(_0x5d25bb){_0x57298b(_0x5d25bb);})[_0xa757('0x45')](function(_0x129d77){_0x373747(_0x129d77);});});}exports[_0xa757('0x46')]=function(_0xe03a3c,_0xc063db){var _0x3db5d5={},_0x4f12b1={},_0xd61628={'count':0x0,'rows':[]};var _0x364998=_['map'](db[_0xa757('0x47')]['rawAttributes'],function(_0x2d111e){return{'name':_0x2d111e[_0xa757('0x48')],'type':_0x2d111e['type'][_0xa757('0x49')]};});_0x4f12b1[_0xa757('0x4a')]=_['map'](_0x364998,_0xa757('0x35'));_0x4f12b1[_0xa757('0x4b')]=_[_0xa757('0x4c')](_0xe03a3c[_0xa757('0x4b')]);_0x4f12b1['filters']=_[_0xa757('0x4d')](_0x4f12b1[_0xa757('0x4a')],_0x4f12b1[_0xa757('0x4b')]);_0x3db5d5[_0xa757('0x4e')]=_['intersection'](_0x4f12b1[_0xa757('0x4a')],qs['fields'](_0xe03a3c['query'][_0xa757('0x4f')]));_0x3db5d5[_0xa757('0x4e')]=_0x3db5d5[_0xa757('0x4e')]['length']?_0x3db5d5[_0xa757('0x4e')]:_0x4f12b1['model'];if(!_0xe03a3c[_0xa757('0x4b')][_0xa757('0x50')](_0xa757('0x51'))){_0x3db5d5[_0xa757('0x2a')]=qs[_0xa757('0x2a')](_0xe03a3c[_0xa757('0x4b')][_0xa757('0x2a')]);_0x3db5d5[_0xa757('0x29')]=qs['offset'](_0xe03a3c[_0xa757('0x4b')][_0xa757('0x29')]);}_0x3db5d5[_0xa757('0x52')]=qs[_0xa757('0x53')](_0xe03a3c[_0xa757('0x4b')][_0xa757('0x53')]);_0x3db5d5[_0xa757('0x54')]=qs[_0xa757('0x55')](_[_0xa757('0x56')](_0xe03a3c[_0xa757('0x4b')],_0x4f12b1[_0xa757('0x55')]),_0x364998);var _0x19ceef=[];var _0x2367c7=squel[_0xa757('0x57')]()[_0xa757('0x58')]('id')[_0xa757('0x58')]('name')[_0xa757('0x58')]('color')[_0xa757('0x59')](_0xa757('0x5a'));var _0xa89d24=squel[_0xa757('0x57')]()['field'](_0xa757('0x5b'))[_0xa757('0x58')](_0xa757('0x5c'))[_0xa757('0x58')]('ui.ChatInteractionId')[_0xa757('0x59')](_0xa757('0x5d'),'ui')[_0xa757('0x5e')](_0xa757('0x5f'),'u',_0xa757('0x60'));var _0x291b26=squel['select']()['from']('chat_interactions','i')['left_join'](_0xa757('0x61'),'c',_0xa757('0x62'))[_0xa757('0x5e')](_0xa757('0x5f'),'o',_0xa757('0x63'))[_0xa757('0x5e')]('chat_websites','a',_0xa757('0x64'))[_0xa757('0x5e')](_0xa757('0x65'),'me',_0xa757('0x66'))['left_join'](_0xa757('0x67'),'it',_0xa757('0x68'))['left_join'](_0xa757('0x5a'),'t','t.id\x20=\x20it.TagId');var _0x211980=squel['expr']();var _0x51be6e=[];var _0x58633a=squel['expr']();var _0x367b48;if(_0xe03a3c[_0xa757('0x4b')][_0xa757('0x69')]){_0x367b48=as[_0xa757('0x6a')](_0xe03a3c[_0xa757('0x4b')][_0xa757('0x69')]);var _0x4c19a6=_0x367b48['sqlOperator'];for(var _0x201557=0x0;_0x201557<_0x367b48[_0xa757('0x6b')][_0xa757('0x6c')];_0x201557++){var _0x4a5ad5=_0x367b48['conditions'][_0x201557];var _0x18dff7='i';var _0x31c4cd=_[_0xa757('0x6d')](_0x364998,[_0xa757('0x35'),_0x4a5ad5[_0xa757('0x58')]]);if(!_0x31c4cd){switch(_0x4a5ad5[_0xa757('0x58')]){case'unreadMessages':if(_0x4a5ad5[_0xa757('0x6e')]==0x1){_0x291b26[_0xa757('0x6f')]('`'+_0x4a5ad5[_0xa757('0x58')]+_0xa757('0x70'));}else{_0x291b26[_0xa757('0x6f')]('`'+_0x4a5ad5[_0xa757('0x58')]+_0xa757('0x71'));}break;case _0xa757('0x72'):if(_0x4a5ad5[_0xa757('0x73')]===_0xa757('0x74')){if(_0x4a5ad5['value'][_0xa757('0x42')]('\x20')['length']>0x1){_0x211980[_0x4c19a6]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xa757('0x75')](_0x4a5ad5[_0xa757('0x6e')]),null);}else{var _0x432856='%'+_0x4a5ad5[_0xa757('0x6e')]+'%';_0x211980[_0x4c19a6](_0xa757('0x76'),_0x432856,_0x432856,_0x432856);}}else{_0x31c4cd=_[_0xa757('0x6d')](_0x364998,[_0xa757('0x35'),_0xa757('0x77')]);_0x4a5ad5[_0xa757('0x58')]=_0xa757('0x77');_0x423f3a=as[_0xa757('0x78')](_0x18dff7,_0x31c4cd['type'],_0x4a5ad5);_0x211980[_0x4c19a6](_0x423f3a[_0xa757('0x79')],_0x423f3a[_0xa757('0x6e')]['start'],_0x423f3a[_0xa757('0x6e')][_0xa757('0x33')]);}break;case _0xa757('0x7a'):var _0x180cec=_0x4a5ad5[_0xa757('0x6e')][_0xa757('0x42')](',')['map'](function(_0x413217){return Number(_0x413217);});_0x180cec['forEach'](function(_0xee5b78){_0x58633a['or'](_0xa757('0x7b'),'%,'+_0xee5b78+',%');});_0x51be6e=_[_0xa757('0x7c')](_0x51be6e,_0x180cec);break;case _0xa757('0x7d'):if(_0x4a5ad5[_0xa757('0x73')]==='$substring'){_0x211980[_0x4c19a6]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x4a5ad5[_0xa757('0x6e')]+'%',null);}else{_0x31c4cd=_[_0xa757('0x6d')](_0x364998,[_0xa757('0x35'),'UserId']);_0x4a5ad5[_0xa757('0x58')]='UserId';_0x423f3a=as[_0xa757('0x78')](_0x18dff7,_0x31c4cd[_0xa757('0x7e')],_0x4a5ad5);_0x211980[_0x4c19a6](_0x423f3a[_0xa757('0x79')],_0x423f3a[_0xa757('0x6e')][_0xa757('0x7f')],_0x423f3a[_0xa757('0x6e')]['end']);}break;case _0xa757('0x39'):_0x423f3a=as[_0xa757('0x78')]('me',null,_0x4a5ad5);_0x211980[_0x4c19a6](_0x423f3a[_0xa757('0x79')],_0x423f3a[_0xa757('0x6e')][_0xa757('0x7f')],_0x423f3a['value'][_0xa757('0x33')]);break;}}else{var _0x423f3a=as[_0xa757('0x78')](_0x18dff7,_0x31c4cd[_0xa757('0x7e')],_0x4a5ad5);_0x211980[_0x4c19a6](_0x423f3a[_0xa757('0x79')],_0x423f3a['value'][_0xa757('0x7f')],_0x423f3a[_0xa757('0x6e')][_0xa757('0x33')]);}}}else{var _0x529298=_(_0xe03a3c[_0xa757('0x4b')])[_0xa757('0x4c')]()[_0xa757('0x3f')](function(_0x60f518){return _[_0xa757('0x80')](_0x364998,[_0xa757('0x35'),_0x60f518])?_0x60f518:undefined;})[_0xa757('0x81')]()[_0xa757('0x6e')]();if(!_[_0xa757('0x82')](_0x529298)){_0x529298[_0xa757('0x43')](function(_0x1a868d){if(_0x1a868d===_0xa757('0x83')){_0x291b26[_0xa757('0x54')](_0xa757('0x84'),[]['concat'](_0xe03a3c[_0xa757('0x4b')][_0x1a868d]));}else if(_0x1a868d===_0xa757('0x85')){var _0x532ab5=JSON[_0xa757('0x86')](_0xe03a3c[_0xa757('0x4b')][_0x1a868d])['$gte'];var _0x29aea2=JSON[_0xa757('0x86')](_0xe03a3c[_0xa757('0x4b')][_0x1a868d])[_0xa757('0x87')];_0x291b26[_0xa757('0x54')](_0xa757('0x88'),_0x532ab5,_0x29aea2);}else{if(_0xe03a3c[_0xa757('0x4b')][_0x1a868d]===_0xa757('0x89')){_0x291b26[_0xa757('0x54')]('i.'+_0x1a868d+_0xa757('0x8a'));}else{_0x291b26[_0xa757('0x54')]('i.'+_0x1a868d+_0xa757('0x8b'),_0xe03a3c[_0xa757('0x4b')][_0x1a868d]);}}});}if(_0xe03a3c[_0xa757('0x4b')][_0xa757('0x8c')]){if(_0xe03a3c[_0xa757('0x4b')]['read']==0x1){_0x291b26[_0xa757('0x6f')]('`unreadMessages`\x20=\x200');}else{_0x291b26[_0xa757('0x6f')](_0xa757('0x8d'));}}if(_0xe03a3c[_0xa757('0x4b')][_0xa757('0x8e')]){_0x51be6e=_[_0xa757('0x8f')](_0xe03a3c['query'][_0xa757('0x8e')])?_0xe03a3c[_0xa757('0x4b')][_0xa757('0x8e')]:new Array(_0xe03a3c['query'][_0xa757('0x8e')]);_0x51be6e[_0xa757('0x43')](function(_0x2c05d5){_0x58633a['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x2c05d5+',%');});}if(_0xe03a3c['query'][_0xa757('0x90')]){var _0x351e0e=_0xe03a3c[_0xa757('0x4b')]['filter'][_0xa757('0x91')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs['isNumeric'](_0x351e0e)){_0x211980['or'](_0xa757('0x92'),_0x351e0e+'%');}else{_0x211980['or'](_0xa757('0x93'),qs[_0xa757('0x75')](_0x351e0e))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x351e0e+'%');}}}_0x291b26[_0xa757('0x54')](_0x211980);_0x291b26[_0xa757('0x94')](_0xa757('0x95'));var _0x199f75={'type':db[_0xa757('0x96')][_0xa757('0x97')][_0xa757('0x98')],'raw':!![]};var _0x44c681=_0x291b26[_0xa757('0x99')]();_0x44c681[_0xa757('0x58')](_0xa757('0x95'));_0x44c681[_0xa757('0x58')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xa757('0x9a'));if(_0x3db5d5[_0xa757('0x52')]){_0x3db5d5[_0xa757('0x52')][_0xa757('0x43')](function(_0x1a46d6){var _0x7440f6=_0x1a46d6[0x0]===_0xa757('0x9b')?_0x1a46d6[0x0]:'i.'+_0x1a46d6[0x0];_0x291b26[_0xa757('0x52')](_0x7440f6,_0x1a46d6[0x1]===_0xa757('0x9c')?![]:!![]);});}if(!_[_0xa757('0x82')](_0x51be6e)){_0x291b26[_0xa757('0x6f')](_0x58633a);_0x44c681[_0xa757('0x54')](_0xa757('0x9d'),_0x51be6e);}BPromise[_0xa757('0x9e')]()[_0xa757('0x32')](function(){if(!_0x367b48){if(_0xe03a3c[_0xa757('0x4b')][_0xa757('0x83')])return;_0x44c681[_0xa757('0x54')](_0xa757('0x9f'));_0x291b26[_0xa757('0x54')](_0xa757('0x9f'));return;}if(_0xe03a3c[_0xa757('0xa0')]['role']!==_0xa757('0x3b'))return;return _0xe03a3c[_0xa757('0xa0')]['getChatWebsites']({'attributes':['id'],'raw':!![]})[_0xa757('0x32')](function(_0x4c4b1a){if(_[_0xa757('0x82')](_0x4c4b1a)){_0x44c681[_0xa757('0x54')]('i.ChatWebsiteId\x20IS\x20NULL');_0x291b26[_0xa757('0x54')](_0xa757('0xa1'));}else{_0x44c681[_0xa757('0x54')](_0xa757('0x84'),_['map'](_0x4c4b1a,'id'));_0x291b26[_0xa757('0x54')](_0xa757('0x84'),_['map'](_0x4c4b1a,'id'));}});})[_0xa757('0x32')](function(){if(_0xe03a3c[_0xa757('0xa0')]['role']===_0xa757('0x3b')&&!_0x367b48&&!_0xe03a3c[_0xa757('0x4b')][_0xa757('0x83')])return[];return db[_0xa757('0xa2')][_0xa757('0x4b')](_0x44c681[_0xa757('0xa3')](),_0x199f75);})[_0xa757('0x32')](function(_0x2d6405){_0xd61628[_0xa757('0x28')]=_0x2d6405['length'];if(_0xd61628['count']===0x0)return[];return db[_0xa757('0xa2')][_0xa757('0x4b')](_0x2367c7[_0xa757('0xa3')](),_0x199f75)[_0xa757('0x32')](function(_0x38d0f8){_0x19ceef=_[_0xa757('0xa4')](_0x38d0f8,'id');_0x199f75=_[_0xa757('0x38')](_0x199f75,{'model':db['ChatInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0xe03a3c[_0xa757('0x4b')]['fields']){_0x3db5d5[_0xa757('0x4e')][_0xa757('0x43')](function(_0x365a0d){_0x291b26[_0xa757('0x58')]('i.'+_0x365a0d);});}else{_0x291b26[_0xa757('0x58')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xa757('0x9a'));_0x291b26['field'](_0xa757('0xa5'),_0xa757('0xa6'));_0x291b26[_0xa757('0x58')](_0xa757('0xa7'),'Account.mandatoryDisposition');_0x291b26[_0xa757('0x58')](_0xa757('0xa8'),_0xa757('0x9b'));_0x291b26[_0xa757('0x58')](_0xa757('0xa9'));_0x291b26[_0xa757('0x58')](_0xa757('0xaa'),_0xa757('0xab'));_0x291b26['field'](_0xa757('0xac'),_0xa757('0xad'));_0x291b26[_0xa757('0x58')](_0xa757('0xae'),'Contact.email');_0x291b26[_0xa757('0x58')](_0xa757('0xaf'),_0xa757('0xb0'));_0x291b26[_0xa757('0x58')](_0xa757('0xb1'),_0xa757('0xb2'));_0x291b26[_0xa757('0x58')]('c.fax','Contact.fax');_0x291b26[_0xa757('0x58')]('o.fullname',_0xa757('0xb3'));_0x291b26['field']('o.internal',_0xa757('0xb4'));_0x291b26[_0xa757('0x58')](_0xa757('0xb5'),_0xa757('0x40'));}if(_0x3db5d5[_0xa757('0x2a')])_0x291b26[_0xa757('0x2a')](_0x3db5d5[_0xa757('0x2a')]);if(_0x3db5d5[_0xa757('0x29')])_0x291b26[_0xa757('0x29')](_0x3db5d5[_0xa757('0x29')]);return db['sequelize'][_0xa757('0x4b')](_0x291b26['toString'](),_0x199f75);})[_0xa757('0x32')](function(_0x4e7280){if(_0x4e7280[_0xa757('0x6c')]>0x0)_0xa89d24[_0xa757('0x54')]('ui.ChatInteractionId\x20IN\x20?',_[_0xa757('0x3f')](_0x4e7280,'id'));return db[_0xa757('0xa2')][_0xa757('0x4b')](_0xa89d24[_0xa757('0xa3')](),_0x199f75)[_0xa757('0x32')](function(_0x162ff6){var _0x1c789c=_[_0xa757('0xb6')](_0x162ff6,_0xa757('0xb7'));var _0x358268=[];_0x4e7280[_0xa757('0x43')](function(_0x204489){_0x358268[_0xa757('0x44')](updateChatInteraction(_0x204489,_0x19ceef,_0x1c789c));});return BPromise[_0xa757('0xb8')](_0x358268);});});})[_0xa757('0x32')](function(_0x56a060){_0xd61628['rows']=_0x56a060;return _0xd61628;})[_0xa757('0x32')](respondWithFilteredResult(_0xc063db,_0x3db5d5))['catch'](handleError(_0xc063db,null));};exports[_0xa757('0xb9')]=function(_0x3404f1,_0x2edad2){var _0x1d03a7={'raw':![],'where':{'id':_0x3404f1[_0xa757('0xba')]['id']}},_0x48c52f={};_0x48c52f[_0xa757('0x4a')]=_[_0xa757('0x4c')](db[_0xa757('0x47')][_0xa757('0xbb')]);_0x48c52f[_0xa757('0x4b')]=_['keys'](_0x3404f1[_0xa757('0x4b')]);_0x48c52f[_0xa757('0x55')]=_[_0xa757('0x4d')](_0x48c52f[_0xa757('0x4a')],_0x48c52f[_0xa757('0x4b')]);_0x1d03a7['attributes']=_['intersection'](_0x48c52f[_0xa757('0x4a')],qs['fields'](_0x3404f1[_0xa757('0x4b')]['fields']));_0x1d03a7[_0xa757('0x4e')]=_0x1d03a7[_0xa757('0x4e')][_0xa757('0x6c')]?_0x1d03a7[_0xa757('0x4e')]:_0x48c52f[_0xa757('0x4a')];if(_0x3404f1[_0xa757('0x4b')][_0xa757('0xbc')]){_0x1d03a7[_0xa757('0xbd')]=[{'all':!![]}];}_0x1d03a7=_[_0xa757('0x38')]({},_0x1d03a7,_0x3404f1[_0xa757('0xbe')]);return db[_0xa757('0x47')]['find'](_0x1d03a7)[_0xa757('0x32')](handleEntityNotFound(_0x2edad2,null))[_0xa757('0x32')](respondWithResult(_0x2edad2,null))[_0xa757('0x45')](handleError(_0x2edad2,null));};exports[_0xa757('0xbf')]=function(_0x1f308f,_0x1ea6d7){return db['ChatInteraction'][_0xa757('0xbf')](_0x1f308f[_0xa757('0x39')],{})['then'](respondWithResult(_0x1ea6d7,0xc9))[_0xa757('0x45')](handleError(_0x1ea6d7,null));};exports[_0xa757('0x31')]=function(_0x1f4782,_0x5e6171){if(_0x1f4782[_0xa757('0x39')]['id']){delete _0x1f4782[_0xa757('0x39')]['id'];}return db[_0xa757('0x47')][_0xa757('0x6d')]({'where':{'id':_0x1f4782[_0xa757('0xba')]['id']}})['then'](handleEntityNotFound(_0x5e6171,null))[_0xa757('0x32')](saveUpdates(_0x1f4782['body'],null))['then'](respondWithResult(_0x5e6171,null))[_0xa757('0x45')](handleError(_0x5e6171,null));};exports['destroy']=function(_0x5d9102,_0x44023e){return db[_0xa757('0x47')][_0xa757('0x6d')]({'where':{'id':_0x5d9102[_0xa757('0xba')]['id']}})[_0xa757('0x32')](handleEntityNotFound(_0x44023e,null))[_0xa757('0x32')](removeEntity(_0x44023e,null))['catch'](handleError(_0x44023e,null));};exports['describe']=function(_0x556b78,_0x4b4a87){return db['ChatInteraction']['describe']()['then'](respondWithResult(_0x4b4a87,null))[_0xa757('0x45')](handleError(_0x4b4a87,null));};exports['createVidaooSession']=function(_0x1ba0df,_0xccb91e){var _0x146305=_0x1ba0df[_0xa757('0xba')]['id'];var _0x46fd6b;var _0xc0a523;var _0x399952;return db[_0xa757('0x47')][_0xa757('0xc0')]({'where':{'id':_0x146305}})['then'](function(_0x4dd40a){_0x46fd6b=_0x4dd40a;return db[_0xa757('0xc1')][_0xa757('0xc0')]({'where':{'id':_0x4dd40a[_0xa757('0x83')]},'attributes':['id',_0xa757('0xc2'),'vidaooEscalation',_0xa757('0xc3'),_0xa757('0xc4'),_0xa757('0xc5')],'raw':!![]});})[_0xa757('0x32')](function(_0x30c170){if(_0x30c170&&_0x30c170[_0xa757('0xc2')]&&_0x30c170[_0xa757('0xc6')]){_0xc0a523=_0x30c170;var _0x4e552d={'interaction':{'id':_0x146305},'agent':{'id':_0x1ba0df[_0xa757('0xa0')]['id'],'name':_0x1ba0df[_0xa757('0xa0')]['name'],'fullname':_0x1ba0df[_0xa757('0xa0')][_0xa757('0xc7')],'email':_0x1ba0df[_0xa757('0xa0')][_0xa757('0xc8')]},'contact':_0x1ba0df[_0xa757('0x39')]['contact'],'account':_0x1ba0df[_0xa757('0x39')][_0xa757('0x3d')]};var _0x3d031d={'rejectUnauthorized':![],'method':'POST','url':_0xa757('0xc9'),'headers':{'X-APIKEY':_0x30c170[_0xa757('0xc2')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x1ba0df[_0xa757('0xa0')]['email']],'buttons':null,'topic':_0xc0a523[_0xa757('0xc3')],'note':_[_0xa757('0xca')](_0xc0a523[_0xa757('0xc4')])?null:getMustacheRender(_0xc0a523[_0xa757('0xc4')],_0x4e552d),'metadata':null},'redirect':_0xa757('0xcb'),'json':!![]};try{if(!_['isNull'](_0xc0a523[_0xa757('0xc5')])){var _0x4b440e=getMustacheRender(_0xc0a523['vidaooMetadata'],_0x4e552d);var _0x6e9075=JSON[_0xa757('0x86')](_0x4b440e);_0x3d031d[_0xa757('0x39')][_0xa757('0xcc')]=_0x6e9075;}}catch(_0x4d3423){throw new db[(_0xa757('0x96'))][(_0xa757('0xcd'))](_0xa757('0xce'));}return rp(_0x3d031d);}else{throw new db[(_0xa757('0x96'))][(_0xa757('0xcd'))](_0xa757('0xcf'));}})[_0xa757('0x32')](function(_0xad41e1){_0x399952=_0xad41e1;if(_0x399952['id']){var _0x564db3={'body':_0x399952[_0xa757('0xd0')],'ChatWebsiteId':_0xc0a523['id'],'ChatInteractionId':_0x46fd6b['id'],'direction':_0xa757('0xd1'),'UserId':_0x1ba0df[_0xa757('0xa0')]['id']};return db[_0xa757('0xd2')][_0xa757('0xbf')](_0x564db3,{});}else{throw new db[(_0xa757('0x96'))][(_0xa757('0xcd'))](_0xa757('0xd3'));}})[_0xa757('0x32')](function(){return _0x46fd6b['updateAttributes']({'vidaooSessionId':_0x399952['id']});})['then'](respondWithResult(_0xccb91e,null))[_0xa757('0x45')](handleError(_0xccb91e,null));};exports[_0xa757('0xd4')]=function(_0x542faf,_0x3e7174){if(_0x542faf['body']['id']){delete _0x542faf[_0xa757('0x39')]['id'];}return db[_0xa757('0x47')][_0xa757('0x6d')]({'where':{'id':_0x542faf[_0xa757('0xba')]['id']},'include':[{'model':db[_0xa757('0xd5')],'as':_0xa757('0x72')}]})[_0xa757('0x32')](handleEntityNotFound(_0x3e7174,null))[_0xa757('0x32')](saveUpdates(_0x542faf[_0xa757('0x39')],null))['then'](respondWithResult(_0x3e7174,null))[_0xa757('0x45')](handleError(_0x3e7174,null));};exports[_0xa757('0xd6')]=function(_0x4a7a69,_0xea878b,_0x434c4b){if(_0x4a7a69[_0xa757('0x39')]['id']){delete _0x4a7a69[_0xa757('0x39')]['id'];}return db[_0xa757('0x47')][_0xa757('0x6d')]({'where':{'id':_0x4a7a69[_0xa757('0xba')]['id']}})[_0xa757('0x32')](function(_0x2ea80d){if(!_0x2ea80d){logger[_0xa757('0x22')](_0xa757('0xd7'),_0xa757('0xd6'),0x194,'entity\x20not\x20found');_0xea878b[_0xa757('0x25')](0x194);}else{if(_0x2ea80d[_0xa757('0xd8')]){throw new db['Sequelize'][(_0xa757('0xcd'))](_0xa757('0xd9'));}}return _0x2ea80d;})['then'](function(_0x124eff){if(_0x124eff){return _0x124eff[_0xa757('0x31')]({'closed':_0x4a7a69[_0xa757('0x39')][_0xa757('0xda')],'disposition':_0x4a7a69['body']['disposition']})[_0xa757('0x32')](function(_0x48a9d0){return _0x48a9d0;});}})[_0xa757('0x32')](function(_0x551930){return respondWithRpcPromise(_0xa757('0xdb'),_0xa757('0xd6'),_0x4a7a69[_0xa757('0x39')],client9004);})[_0xa757('0x32')](respondWithResult(_0xea878b,null))[_0xa757('0x45')](handleError(_0xea878b,null));};exports['attachmentUpload']=function(_0x54385d,_0xa77319,_0x7c238d){_0x54385d[_0xa757('0x39')][_0xa757('0x35')]=_0x54385d['file']['originalname'];_0x54385d[_0xa757('0x39')]['basename']=_0x54385d[_0xa757('0xdc')][_0xa757('0xdd')];_0x54385d[_0xa757('0x39')][_0xa757('0x7e')]=_0x54385d[_0xa757('0xdc')][_0xa757('0xde')];return db[_0xa757('0xdf')]['create'](_0x54385d[_0xa757('0x39')])[_0xa757('0x32')](respondWithResult(_0xa77319,0xc9))[_0xa757('0x45')](handleError(_0xa77319,null));};exports[_0xa757('0xe0')]=function(_0x177db5,_0x1f678e,_0x377663){return db['ChatInteraction']['findOne']({'where':{'id':_0x177db5[_0xa757('0xba')]['id']},'raw':!![]})[_0xa757('0x32')](handleEntityNotFound(_0x1f678e,null))[_0xa757('0x32')](function(_0x54da87){if(_0x54da87){if(_0x54da87[_0xa757('0xda')]){return _0x1f678e[_0xa757('0x26')](0x193)['json']({'status':0x193,'message':_0xa757('0xe1')});}return db['Attachment'][_0xa757('0xc0')]({'where':{'id':_0x177db5[_0xa757('0x4b')][_0xa757('0xe2')]},'raw':!![]})[_0xa757('0x32')](handleEntityNotFound(_0x1f678e,null));}})[_0xa757('0x32')](function(_0x1b4e62){if(_0x1b4e62){var _0x42e409=_0x1b4e62[_0xa757('0xe3')]!==null;var _0x19f834=path[_0xa757('0xe4')](config['root'],'server/files/attachments/');if(_0x42e409){_0x19f834=path[_0xa757('0xe4')](_0x19f834,'offline-chat/');}var _0x4bd0a6=path[_0xa757('0xe4')](_0x19f834,_0x1b4e62[_0xa757('0xe5')]);return _0x1f678e['download'](_0x4bd0a6);}})[_0xa757('0x45')](handleError(_0x1f678e,null));};exports['close']=function(_0x334f77,_0x45dc56){var _0x2fe93c=null;var _0x101410=null;var _0x2cc39e=null;var _0x1aa70d=null;if(_0x334f77[_0xa757('0x39')]['id']){delete _0x334f77[_0xa757('0x39')]['id'];}if(_0x334f77['body']['mailTranscript']){_0x1aa70d=path[_0xa757('0xe4')](config['root'],_0xa757('0xe6'),util[_0xa757('0xe7')](_0xa757('0xe8'),Date[_0xa757('0xe9')]()));_0x334f77[_0xa757('0x39')][_0xa757('0xea')]=_0x1aa70d;}return db[_0xa757('0x47')][_0xa757('0x6d')]({'where':{'id':_0x334f77['params']['id']},'include':[{'model':db[_0xa757('0xd2')],'as':'Messages','include':[{'model':db['User'],'as':_0xa757('0x7d')}]}]})[_0xa757('0x32')](handleEntityNotFound(_0x45dc56,null))[_0xa757('0x32')](saveUpdates(_0x334f77[_0xa757('0x39')],null))['then'](function(_0xce5af4){if(_0xce5af4){_0x2fe93c=_0xce5af4;return db['ChatWebsite'][_0xa757('0x6d')]({'where':{'id':_0x2fe93c['ChatWebsiteId']}});}})[_0xa757('0x32')](function(_0x3e9009){if(_0x3e9009){_0x2cc39e=_0x3e9009;return db['CmContact'][_0xa757('0x6d')]({'where':{'id':_0x2fe93c[_0xa757('0x77')]}});}})['then'](function(_0x2a5b41){if(_0x2a5b41){_0x101410=_0x2a5b41;if(_0x1aa70d){var _0x1ec56a=null;for(var _0xa09d83=0x1;_0xa09d83<_0x2fe93c[_0xa757('0xeb')][_0xa757('0x6c')];++_0xa09d83){_0x1ec56a=_0x2fe93c[_0xa757('0xeb')][_0xa09d83];var _0x2439f9=_0x1ec56a['UserId']?util[_0xa757('0xe7')](_0xa757('0xec'),_0x2cc39e['agentAlias'],_0x1ec56a['UserId']):_0xa757('0xed');var _0x30f2da=_0x334f77[_0xa757('0x39')][_0xa757('0xee')]||util[_0xa757('0xe7')](_0xa757('0xec'),_0xa757('0xef'),_0x1ec56a[_0xa757('0x77')]);switch(_0x2cc39e[_0xa757('0xf0')]){case _0xa757('0xf1'):_0x2439f9=_0x1ec56a[_0xa757('0xd8')]?util[_0xa757('0xe7')](_0xa757('0xec'),_0x2cc39e['agentAlias'],_0x1ec56a[_0xa757('0xd8')]):_0xa757('0xed');break;case _0xa757('0xf2'):_0x2439f9=_0x1ec56a['UserId']?_0x1ec56a['User'][_0xa757('0xf3')]||_0x1ec56a[_0xa757('0x7d')]['fullname']:_0xa757('0xed');break;case _0xa757('0xf4'):_0x2439f9=_0x1ec56a['UserId']?_0x1ec56a[_0xa757('0x7d')]['fullname']:_0xa757('0xed');break;default:_0x2439f9=_0x1ec56a[_0xa757('0xd8')]?util[_0xa757('0xe7')](_0xa757('0xec'),_0x2cc39e[_0xa757('0xf5')],_0x1ec56a[_0xa757('0xd8')]):_0xa757('0xed');}var _0x69af1f=util['format'](_0xa757('0xf6'),moment(_0x1ec56a['createdAt'])['format'](_0xa757('0xf7')),_0x1ec56a[_0xa757('0xf8')]==='in'?_0x30f2da:_0x2439f9,_0x1ec56a['body']);if(!_0x1ec56a['secret']){fs['appendFileSync'](_0x1aa70d,_0x69af1f);}}return db[_0xa757('0xf9')][_0xa757('0xc0')]({'where':{'service':!![]},'include':[{'model':db[_0xa757('0xfa')],'as':'Smtp','raw':!![]}]});}}})[_0xa757('0x32')](function(_0x2e76e5){if(_0x2e76e5&&_0x2e76e5[_0xa757('0xfb')]&&_0x334f77[_0xa757('0x39')]){var _0x1caccc={'tls':{'rejectUnauthorized':![]}};if(_0x2e76e5[_0xa757('0xfb')][_0xa757('0xfc')]){_0x1caccc[_0xa757('0xfc')]=_0x2e76e5['Smtp'][_0xa757('0xfc')];}else{_0x1caccc['host']=_0x2e76e5[_0xa757('0xfb')][_0xa757('0xfd')];_0x1caccc[_0xa757('0xfe')]=_0x2e76e5[_0xa757('0xfb')][_0xa757('0xfe')];_0x1caccc['secure']=_0x2e76e5[_0xa757('0xfb')]['secure'];}if(_0x2e76e5[_0xa757('0xfb')][_0xa757('0xff')]){_0x1caccc[_0xa757('0x100')]={'user':_0x2e76e5[_0xa757('0xfb')][_0xa757('0xa0')],'pass':_0x2e76e5[_0xa757('0xfb')][_0xa757('0x101')]};}return respondWithRpcPromise(_0xa757('0x102'),_0xa757('0x103'),{'account':_0x1caccc,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0x2e76e5[_0xa757('0x35')],_0x2e76e5[_0xa757('0xc8')]||_0x2e76e5['Smtp'][_0xa757('0xa0')]),'to':_0x334f77[_0xa757('0x39')]['mailTranscript'],'subject':_0xa757('0x104'),'text':util['format'](_0xa757('0x105'),_0x334f77[_0xa757('0x39')][_0xa757('0x106')]),'attachments':[{'path':_0x1aa70d}]}})[_0xa757('0x32')](function(){return _0x2fe93c;})[_0xa757('0x45')](function(_0xa285fa){console[_0xa757('0x22')](_0xa285fa);});}else{return _0x2fe93c;}})[_0xa757('0x32')](respondWithStatusCode(_0x45dc56,0xc8))[_0xa757('0x45')](handleError(_0x45dc56,null));};exports[_0xa757('0x107')]=function(_0x379660,_0x36643f,_0xe704f0){return db['ChatMessage']['find']({'where':{'id':_0x379660[_0xa757('0xba')]['id']}})[_0xa757('0x32')](handleEntityNotFound(_0x36643f,null))[_0xa757('0x32')](function(_0x4f1a01){if(_0x4f1a01){return _0x4f1a01[_0xa757('0x107')](_0x379660[_0xa757('0x39')][_0xa757('0x108')],_[_0xa757('0x109')](_0x379660[_0xa757('0x39')],['ids','id'])||{});}})['then'](respondWithResult(_0x36643f,null))[_0xa757('0x45')](handleError(_0x36643f,null));};exports[_0xa757('0x10a')]=function(_0xada3bd,_0x566095,_0x25c4da){var _0x35b41e={'raw':![],'where':{}};var _0x4b60b9={};var _0x2d7d24={'count':0x0,'rows':[]};return db[_0xa757('0x47')][_0xa757('0xc0')]({'where':{'id':_0xada3bd['params']['id']}})[_0xa757('0x32')](handleEntityNotFound(_0x566095,null))[_0xa757('0x32')](function(_0x1b702f){if(_0x1b702f){_0x4b60b9[_0xa757('0x4a')]=_[_0xa757('0x4c')](db[_0xa757('0xd2')][_0xa757('0xbb')]);_0x4b60b9['query']=_[_0xa757('0x4c')](_0xada3bd['query']);_0x4b60b9[_0xa757('0x55')]=_[_0xa757('0x4d')](_0x4b60b9[_0xa757('0x4a')],_0x4b60b9[_0xa757('0x4b')]);_0x35b41e['attributes']=_['intersection'](_0x4b60b9[_0xa757('0x4a')],qs[_0xa757('0x4f')](_0xada3bd[_0xa757('0x4b')][_0xa757('0x4f')]));_0x35b41e[_0xa757('0x4e')]=_0x35b41e['attributes']['length']?_0x35b41e[_0xa757('0x4e')]:_0x4b60b9[_0xa757('0x4a')];if(!_0xada3bd[_0xa757('0x4b')][_0xa757('0x50')](_0xa757('0x51'))){_0x35b41e[_0xa757('0x2a')]=qs['limit'](_0xada3bd[_0xa757('0x4b')][_0xa757('0x2a')]);_0x35b41e[_0xa757('0x29')]=qs['offset'](_0xada3bd[_0xa757('0x4b')][_0xa757('0x29')]);}_0x35b41e[_0xa757('0x52')]=qs[_0xa757('0x53')](_0xada3bd[_0xa757('0x4b')][_0xa757('0x53')]);_0x35b41e[_0xa757('0x54')]=qs['filters'](_[_0xa757('0x56')](_0xada3bd[_0xa757('0x4b')],_0x4b60b9[_0xa757('0x55')]));_0x35b41e[_0xa757('0x54')][_0xa757('0xb7')]=_0x1b702f['id'];if(_0xada3bd[_0xa757('0x4b')][_0xa757('0x90')]){_0x35b41e['where']=_[_0xa757('0x38')](_0x35b41e['where'],{'$or':_[_0xa757('0x3f')](_0x35b41e['attributes'],function(_0x4438ec){var _0x1491c7={};_0x1491c7[_0x4438ec]={'$like':'%'+_0xada3bd[_0xa757('0x4b')]['filter']+'%'};return _0x1491c7;})});}if(_0xada3bd['query']['$gte']){var _0xa89e07=_0xada3bd[_0xa757('0x4b')][_0xa757('0x10b')][_0xa757('0x42')](',');var _0x560b05={};_0x560b05[_0xa89e07[0x0]]={'$gte':moment(_0xa89e07[0x1])[_0xa757('0xe7')]('YYYY-MM-DD\x20HH:mm:ss')};_0x35b41e[_0xa757('0x54')]=_[_0xa757('0x38')](_0x35b41e[_0xa757('0x54')],_0x560b05);}_0x35b41e=_['merge']({},_0x35b41e,_0xada3bd[_0xa757('0xbe')]);return db['ChatMessage'][_0xa757('0x28')]({'where':_0x35b41e[_0xa757('0x54')]})['then'](function(_0x31c25e){_0x2d7d24[_0xa757('0x28')]=_0x31c25e;if(_0xada3bd[_0xa757('0x4b')]['includeAll']){_0x35b41e['include']=[{'all':!![]}];}return db['ChatMessage'][_0xa757('0x10c')](_0x35b41e);})[_0xa757('0x32')](function(_0x4867c8){_0x2d7d24['rows']=_0x4867c8;return _0x2d7d24;});}})[_0xa757('0x32')](respondWithFilteredResult(_0x566095,_0x35b41e))[_0xa757('0x45')](handleError(_0x566095,null));};exports[_0xa757('0x10d')]=function(_0x4da912,_0x4b0e40,_0x4fe6f5){var _0x3cf8d3={'where':{}},_0x1a1605={},_0x4074a3={'count':0x0,'rows':[]};return db[_0xa757('0x47')][_0xa757('0xc0')]({'where':{'id':_0x4da912[_0xa757('0xba')]['id']}})[_0xa757('0x32')](handleEntityNotFound(_0x4b0e40,null))[_0xa757('0x32')](function(_0x4b3270){if(_0x4b3270){_0x1a1605[_0xa757('0x4a')]=_[_0xa757('0x4c')](db['ChatMessage'][_0xa757('0xbb')]);_0x1a1605[_0xa757('0x4b')]=_[_0xa757('0x4c')](_0x4da912[_0xa757('0x4b')]);_0x1a1605[_0xa757('0x55')]=_[_0xa757('0x4d')](_0x1a1605[_0xa757('0x4a')],_0x1a1605[_0xa757('0x4b')]);_0x3cf8d3[_0xa757('0x4e')]=_[_0xa757('0x4d')](_0x1a1605[_0xa757('0x4a')],qs[_0xa757('0x4f')](_0x4da912['query']['fields']));_0x3cf8d3[_0xa757('0x4e')]=_0x3cf8d3[_0xa757('0x4e')][_0xa757('0x6c')]?_0x3cf8d3[_0xa757('0x4e')]:_0x1a1605[_0xa757('0x4a')];if(!_0x4da912[_0xa757('0x4b')][_0xa757('0x50')]('nolimit')){_0x3cf8d3[_0xa757('0x2a')]=qs[_0xa757('0x2a')](_0x4da912[_0xa757('0x4b')][_0xa757('0x2a')]);_0x3cf8d3[_0xa757('0x29')]=qs[_0xa757('0x29')](_0x4da912[_0xa757('0x4b')]['offset']);}_0x3cf8d3[_0xa757('0x52')]=qs[_0xa757('0x53')](_0x4da912['query']['sort']);_0x3cf8d3['where']=qs[_0xa757('0x55')](_['pick'](_0x4da912['query'],_0x1a1605[_0xa757('0x55')]));_0x3cf8d3[_0xa757('0x54')][_0xa757('0xb7')]=_0x4b3270['id'];if(_0x4da912[_0xa757('0x4b')]['filter']){_0x3cf8d3[_0xa757('0x54')]=_[_0xa757('0x38')](_0x3cf8d3['where'],{'$or':_[_0xa757('0x3f')](_0x3cf8d3[_0xa757('0x4e')],function(_0x2782e3){var _0x2f8045={};_0x2f8045[_0x2782e3]={'$like':'%'+_0x4da912['query'][_0xa757('0x90')]+'%'};return _0x2f8045;})});}_0x3cf8d3[_0xa757('0x54')][_0xa757('0x10e')]=![];if(_0x4da912[_0xa757('0x4b')]['id']){_0x3cf8d3[_0xa757('0x54')]['id']={'$gt':_0x4da912[_0xa757('0x4b')]['id']};}_0x3cf8d3=_[_0xa757('0x38')]({},_0x3cf8d3,_0x4da912[_0xa757('0xbe')]);return db[_0xa757('0xd2')]['count']({'where':_0x3cf8d3[_0xa757('0x54')]})[_0xa757('0x32')](function(_0x409ae1){_0x4074a3[_0xa757('0x28')]=_0x409ae1;_0x3cf8d3[_0xa757('0xbd')]=[];if(_0x4da912[_0xa757('0x4b')][_0xa757('0x10f')]){_0x3cf8d3['include'][_0xa757('0x44')]({'model':db[_0xa757('0x7d')],'as':_0xa757('0x7d'),'attributes':['id',_0xa757('0xc7'),_0xa757('0xf3')]});}if(_0x4da912[_0xa757('0x4b')][_0xa757('0xbc')]){_0x3cf8d3[_0xa757('0xbd')]=[{'all':!![]}];}return db[_0xa757('0xd2')]['findAll'](_0x3cf8d3);})[_0xa757('0x32')](function(_0x4c86fd){_0x4074a3['rows']=_0x4c86fd;return _0x4074a3;});}})[_0xa757('0x32')](respondWithFilteredResult(_0x4b0e40,_0x3cf8d3))['catch'](handleError(_0x4b0e40,null));};exports[_0xa757('0x110')]=function(_0x40e0df,_0x54f4ca,_0x4152da){return db['ChatInteraction']['find']({'where':{'id':_0x40e0df[_0xa757('0xba')]['id']}})['then'](handleEntityNotFound(_0x54f4ca,null))['then'](function(_0x59ff48){if(_0x59ff48){return _0x59ff48[_0xa757('0x111')](_0x40e0df['body'][_0xa757('0x108')],_[_0xa757('0x109')](_0x40e0df[_0xa757('0x39')],[_0xa757('0x108'),'id'])||{})['spread'](function(){return db[_0xa757('0x7a')][_0xa757('0x10c')]({'attributes':['id',_0xa757('0x35'),_0xa757('0x112')],'where':{'id':_0x40e0df[_0xa757('0x39')][_0xa757('0x108')]}});})[_0xa757('0x32')](function(_0x5d2063){socket[_0xa757('0x113')](_0xa757('0x114'),{'id':Number(_0x40e0df['params']['id']),'tags':_0x5d2063||[]});return{'id':Number(_0x40e0df[_0xa757('0xba')]['id']),'tags':_0x5d2063||[]};});}})[_0xa757('0x32')](respondWithResult(_0x54f4ca,null))['catch'](handleError(_0x54f4ca,null));};exports[_0xa757('0x115')]=function(_0x1474f7,_0x1449d4,_0x2aaf2a){return db[_0xa757('0x47')][_0xa757('0x6d')]({'where':{'id':_0x1474f7[_0xa757('0xba')]['id']}})['then'](handleEntityNotFound(_0x1449d4,null))[_0xa757('0x32')](function(_0x1ba7d0){if(_0x1ba7d0){return _0x1ba7d0[_0xa757('0x115')](_0x1474f7[_0xa757('0x4b')]['ids']);}})[_0xa757('0x32')](respondWithStatusCode(_0x1449d4,null))[_0xa757('0x45')](handleError(_0x1449d4,null));};exports[_0xa757('0x116')]=function(_0x563988,_0x43e9cb){var _0xaf7112=moment()['unix']()[_0xa757('0xa3')]();var _0x5ea526=path[_0xa757('0xe4')](config['root'],_0xa757('0x117'),_0xa757('0x118'),_0xa757('0x119'));var _0x58f20d=path[_0xa757('0xe4')](config[_0xa757('0x11a')],_0xa757('0x117'),_0xa757('0x118'),_0xa757('0x11b'));var _0x4b274f=path[_0xa757('0xe4')](_0x5ea526,_0xaf7112);var _0x225b14=util[_0xa757('0xe7')](_0xa757('0x11c'),_0x563988[_0xa757('0xba')]['id'],_0xaf7112);var _0x14d04e=path['join'](_0x5ea526,_0x225b14);var _0x3798ea=[];_0x3798ea[_0xa757('0x44')]({'model':db[_0xa757('0x7d')],'as':_0xa757('0x7d'),'attributes':['id',_0xa757('0xc7')],'raw':!![]});_0x3798ea[_0xa757('0x44')]({'model':db[_0xa757('0xd5')],'as':'Contact','attributes':['id',_0xa757('0x11d'),'lastName'],'raw':!![]});if(_0x563988['query'][_0xa757('0x11b')]){_0x3798ea[_0xa757('0x44')]({'model':db[_0xa757('0xdf')],'as':'Attachment','raw':!![]});}var _0x3bd69c=[{'model':db['ChatMessage'],'as':_0xa757('0xeb'),'attributes':['id',_0xa757('0x39'),'createdAt',_0xa757('0xf8'),'secret',_0xa757('0x8c')],'include':_0x3798ea}];_0x3bd69c[_0xa757('0x44')]({'model':db[_0xa757('0xc1')],'as':_0xa757('0x11e'),'attributes':['id',_0xa757('0x35')]});_0x3bd69c[_0xa757('0x44')]({'model':db[_0xa757('0x7d')],'as':_0xa757('0x11f'),'attributes':['id',_0xa757('0xc7')]});return db[_0xa757('0x47')][_0xa757('0x6d')]({'where':{'id':_0x563988['params']['id']},'include':_0x3bd69c})[_0xa757('0x32')](handleEntityNotFound(_0x43e9cb,null))[_0xa757('0x32')](function(_0x374216){if(_0x374216){var _0x1a8c73=_0x374216[_0xa757('0x120')]({'plain':!![]});fs[_0xa757('0x121')](_0x4b274f);var _0xd20b89={'channel':_0xa757('0x122'),'account':_0x1a8c73['Account'][_0xa757('0x35')],'agent':_0x1a8c73['Owner']?_0x1a8c73[_0xa757('0x11f')][_0xa757('0xc7')]:_0xa757('0x123'),'createdAt':moment(_0x1a8c73[_0xa757('0x85')])[_0xa757('0xe7')]('YYYY-MM-DD\x20HH:mm:ss')[_0xa757('0xa3')](),'closedAt':_0x1a8c73[_0xa757('0xda')]?moment(_0x1a8c73[_0xa757('0x124')])['format'](_0xa757('0x125'))['toString']():'','disposition':_0x1a8c73['disposition'],'chatInfo':{'browser':_0x1a8c73[_0xa757('0x126')],'os':_0x1a8c73[_0xa757('0x127')],'referer':_0x1a8c73[_0xa757('0x128')],'customerIp':_0x1a8c73[_0xa757('0x129')],'customerPort':_0x1a8c73['customerPort']?_0x1a8c73[_0xa757('0x12a')]:_0xa757('0x123')},'messages':_(_0x1a8c73[_0xa757('0xeb')])[_0xa757('0x12b')]()[_0xa757('0x90')]({'secret':![]})['map'](function(_0x535599){if(_0x535599['Attachment']){var _0x56c9b9=path[_0xa757('0xe4')](_0x58f20d,_0x535599['Attachment'][_0xa757('0xe5')]);if(fs[_0xa757('0x12c')](_0x56c9b9)){fs[_0xa757('0x12d')](_0x56c9b9)[_0xa757('0x12e')](fs[_0xa757('0x12f')](path[_0xa757('0xe4')](_0x4b274f,_0x535599[_0xa757('0xdf')][_0xa757('0xe5')])));}}return{'date':moment(_0x535599[_0xa757('0x85')])[_0xa757('0xe7')](_0xa757('0x125'))[_0xa757('0xa3')](),'sender':_0x535599[_0xa757('0xf8')]===_0xa757('0xd1')?_0x535599[_0xa757('0x7d')]?_0x535599[_0xa757('0x7d')][_0xa757('0xc7')]:_0xa757('0xed'):_0x535599[_0xa757('0x72')][_0xa757('0x11d')]+(_0x535599[_0xa757('0x72')][_0xa757('0x130')]?'\x20'+_0x535599[_0xa757('0x72')][_0xa757('0x130')]:''),'body':_0x535599[_0xa757('0xdf')]?_0x535599[_0xa757('0xdf')][_0xa757('0xe5')]:_0x535599[_0xa757('0x39')],'direction':_0x535599['direction']===_0xa757('0xd1')?'A':'C','secret':_0x535599[_0xa757('0x10e')],'read':_0x535599[_0xa757('0x8c')],'attachment':_0x535599[_0xa757('0xdf')]};})['value']()};return ejs[_0xa757('0x131')](path[_0xa757('0xe4')](config[_0xa757('0x11a')],_0xa757('0x117'),_0xa757('0x132'),_0xa757('0x133')),{'interaction':_0xd20b89})[_0xa757('0x32')](function(_0xd7df6f){var _0x7e03ff=path[_0xa757('0xe4')](_0x4b274f,_0xa757('0x134')+_0x1a8c73['id']+'-'+_0xaf7112+_0xa757('0x135'));var _0x1d21e7={'path':_0x7e03ff,'channel':_0xa757('0x122'),'interactionId':_0x1a8c73['id']};return pdf['createPdfFromHTML'](_0xd7df6f,_0x1d21e7);})[_0xa757('0x32')](function(){return new BPromise(function(_0xacfa4b,_0x567517){zipdir(_0x4b274f,{'saveTo':_0x14d04e},function(_0x22e7f5,_0x435552){if(_0x22e7f5)return _0x567517(_0x22e7f5);return _0xacfa4b(_0x435552);});})[_0xa757('0x32')](function(){return new BPromise(function(_0x466f7b,_0x4f5ae1){rimraf(_0x4b274f,function(_0x404003){if(_0x404003)_0x4f5ae1(_0x404003);return _0x466f7b();});});})[_0xa757('0x32')](function(){return _0x43e9cb[_0xa757('0x116')](_0x14d04e,_0x225b14,function(_0x34f745){if(_0x34f745){console[_0xa757('0x136')](_0xa757('0x137'),_0x34f745);}else{fs[_0xa757('0x138')](_0x14d04e);}});});});}else{return _0x43e9cb[_0xa757('0x25')](0xc8);}})[_0xa757('0x45')](handleError(_0x43e9cb,null));}; \ No newline at end of file +var _0xbaf0=['../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','http','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','destroy','stack','name','body','contact','agent','interaction','account','Users','map','fullname','TagIds','Tags','split','forEach','push','index','ChatInteraction','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','tools_tags','u.id','u.fullname','ui.ChatInteractionId','from','user_has_chat_interactions','left_join','users','chat_interactions','cm_contacts','o.id\x20=\x20i.UserId','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','having','`\x20=\x200','`\x20>\x200','Contact','operator','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','value','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','find','UserId','compact','isEmpty','ChatWebsiteId','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','contactName','DESC','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','role','user','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','i.ChatWebsiteId\x20IN\x20?','sequelize','toString','merge','a.key','Account.key','a.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','Contact.firstName','c.lastName','Contact.lastName','c.email','c.phone','c.mobile','Contact.mobile','c.fax','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','all','rows','show','params','rawAttributes','includeAll','include','options','create','describe','createVidaooSession','findOne','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooMetadata','email','POST','isNull','vidaooNote','follow','Sequelize','ValidationError','Error\x20in\x20Vidaoo\x20configuration','join_url','out','updateAttributes','CmContact','abandon','entity\x20not\x20found','Interaction\x20already\x20assigned','closed','AbandonInteraction','file','originalname','basename','filename','mimetype','attachId','join','root','server/files/attachments/','offline-chat/','download','close','mailTranscript','format','transcript-%s.txt','pathTranscript','ChatMessage','Messages','User','%s%d','agentAlias','System','customer','website_alias','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','service','host','port','secure','authentication','auth','pass','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','findAll','getMyMessages','includeAgent','addTags','setTags','emit','chatInteractionTags:save','removeTags','unix','tmp','server','files','attachments','firstName','lastName','Attachment','Owner','get','mkdirSync','Chat','YYYY-MM-DD\x20HH:mm:ss','disposition','browserName','osName','referer','customerIp','customerPort','N.A.','tail','existsSync','createReadStream','pipe','createWriteStream','renderFile','views','downloadInteraction.ejs','.pdf','createPdfFromHTML','log','err','unlinkSync','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x41e75d,_0x16a460){var _0xca346d=function(_0x522168){while(--_0x522168){_0x41e75d['push'](_0x41e75d['shift']());}};_0xca346d(++_0x16a460);}(_0xbaf0,0x12a));var _0x0baf=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xbaf0[_0x5b644e];return _0x49c6bf;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0baf('0x0'));var zipdir=require(_0x0baf('0x1'));var jsonpatch=require(_0x0baf('0x2'));var rp=require(_0x0baf('0x3'));var moment=require(_0x0baf('0x4'));var BPromise=require(_0x0baf('0x5'));var Mustache=require('mustache');var util=require(_0x0baf('0x6'));var path=require(_0x0baf('0x7'));var sox=require(_0x0baf('0x8'));var csv=require(_0x0baf('0x9'));var ejs=require(_0x0baf('0xa'));var fs=require('fs');var fs_extra=require(_0x0baf('0xb'));var _=require(_0x0baf('0xc'));var squel=require(_0x0baf('0xd'));var crypto=require(_0x0baf('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x0baf('0xf'));var toCsv=require('to-csv');var querystring=require(_0x0baf('0x10'));var Papa=require(_0x0baf('0x11'));var Redis=require(_0x0baf('0x12'));var authService=require(_0x0baf('0x13'));var qs=require(_0x0baf('0x14'));var as=require(_0x0baf('0x15'));var pdf=require(_0x0baf('0x16'));var hardwareService=require(_0x0baf('0x17'));var logger=require(_0x0baf('0x18'))(_0x0baf('0x19'));var utils=require(_0x0baf('0x1a'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x0baf('0x1b'))['db'];config[_0x0baf('0x1c')]=_[_0x0baf('0x1d')](config[_0x0baf('0x1c')],{'host':'localhost','port':0x18eb});var socket=require(_0x0baf('0x1e'))(new Redis(config['redis']));require(_0x0baf('0x1f'))[_0x0baf('0x20')](socket);var jayson=require(_0x0baf('0x21'));var client=jayson[_0x0baf('0x22')][_0x0baf('0x23')]({'port':0x232b});var client9004=jayson[_0x0baf('0x22')]['http']({'port':0x232c});function respondWithRpcPromise(_0x4cd79d,_0x2312c7,_0x38395b,_0x283408){return new BPromise(function(_0x3d83a3,_0x2cf7da){var _0x288a98=_0x283408||client;return _0x288a98['request'](_0x4cd79d,_0x38395b)[_0x0baf('0x24')](function(_0xfbecec){logger[_0x0baf('0x25')](_0x0baf('0x26'),_0x2312c7,_0x0baf('0x27'));logger[_0x0baf('0x28')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x2312c7,'request\x20sent',JSON[_0x0baf('0x29')](_0xfbecec));if(_0xfbecec[_0x0baf('0x2a')]){if(_0xfbecec[_0x0baf('0x2a')][_0x0baf('0x2b')]===0x1f4){logger[_0x0baf('0x2a')](_0x0baf('0x26'),_0x2312c7,_0xfbecec[_0x0baf('0x2a')][_0x0baf('0x2c')]);return _0x2cf7da(_0xfbecec[_0x0baf('0x2a')][_0x0baf('0x2c')]);}logger['error'](_0x0baf('0x26'),_0x2312c7,_0xfbecec['error'][_0x0baf('0x2c')]);return _0x3d83a3(_0xfbecec['error']['message']);}else{logger[_0x0baf('0x25')]('ChatInteraction,\x20%s,\x20%s',_0x2312c7,'request\x20sent');_0x3d83a3(_0xfbecec[_0x0baf('0x2d')][_0x0baf('0x2c')]);}})[_0x0baf('0x2e')](function(_0x19d9fd){logger[_0x0baf('0x2a')]('ChatInteraction,\x20%s,\x20%s',_0x2312c7,_0x19d9fd);_0x2cf7da(_0x19d9fd);});});}function respondWithStatusCode(_0x448617,_0x4681c5){_0x4681c5=_0x4681c5||0xcc;return function(_0x1ca35a){if(_0x1ca35a){return _0x448617[_0x0baf('0x2f')](_0x4681c5);}return _0x448617[_0x0baf('0x30')](_0x4681c5)[_0x0baf('0x31')]();};}function respondWithResult(_0x453525,_0x549fd0){_0x549fd0=_0x549fd0||0xc8;return function(_0x1590b4){if(_0x1590b4){return _0x453525[_0x0baf('0x30')](_0x549fd0)[_0x0baf('0x32')](_0x1590b4);}};}function respondWithFilteredResult(_0x265915,_0x55c715){return function(_0x29dbdf){if(_0x29dbdf){var _0x34a58a=typeof _0x55c715['offset']===_0x0baf('0x33')&&typeof _0x55c715[_0x0baf('0x34')]===_0x0baf('0x33');var _0xb4dbb1=_0x29dbdf[_0x0baf('0x35')];var _0x366924=_0x34a58a?0x0:_0x55c715[_0x0baf('0x36')];var _0x57476f=_0x34a58a?_0x29dbdf[_0x0baf('0x35')]:_0x55c715[_0x0baf('0x36')]+_0x55c715[_0x0baf('0x34')];var _0x3ed995;if(_0x57476f>=_0xb4dbb1){_0x57476f=_0xb4dbb1;_0x3ed995=0xc8;}else{_0x3ed995=0xce;}_0x265915[_0x0baf('0x30')](_0x3ed995);return _0x265915[_0x0baf('0x37')](_0x0baf('0x38'),_0x366924+'-'+_0x57476f+'/'+_0xb4dbb1)[_0x0baf('0x32')](_0x29dbdf);}return null;};}function patchUpdates(_0x59431b){return function(_0x3ded64){try{jsonpatch[_0x0baf('0x39')](_0x3ded64,_0x59431b,!![]);}catch(_0x165d14){return BPromise[_0x0baf('0x3a')](_0x165d14);}return _0x3ded64[_0x0baf('0x3b')]();};}function saveUpdates(_0x57a6bb,_0x2fd426){return function(_0x53ae1d){if(_0x53ae1d){return _0x53ae1d[_0x0baf('0x3c')](_0x57a6bb)[_0x0baf('0x24')](function(_0x35e534){return _0x35e534;});}return null;};}function removeEntity(_0x3d65f2,_0x5300a5){return function(_0x1a2b03){if(_0x1a2b03){return _0x1a2b03[_0x0baf('0x3d')]()['then'](function(){_0x3d65f2[_0x0baf('0x30')](0xcc)[_0x0baf('0x31')]();});}};}function handleEntityNotFound(_0x62a2ed,_0xbaa9a7){return function(_0x1f60bd){if(!_0x1f60bd){_0x62a2ed[_0x0baf('0x2f')](0x194);}return _0x1f60bd;};}function handleError(_0xe03d82,_0x675461){_0x675461=_0x675461||0x1f4;return function(_0x4aa6ed){logger[_0x0baf('0x2a')](_0x4aa6ed[_0x0baf('0x3e')]);if(_0x4aa6ed['name']){delete _0x4aa6ed[_0x0baf('0x3f')];}_0xe03d82['status'](_0x675461)['send'](_0x4aa6ed);};}function getMustacheRender(_0x11bc49,_0x81af83){return Mustache['render'](_0x11bc49,_['merge'](_0x81af83[_0x0baf('0x40')],{'contact':_0x81af83[_0x0baf('0x41')],'message':_0x81af83[_0x0baf('0x2c')],'agent':_0x81af83[_0x0baf('0x42')],'interaction':_0x81af83[_0x0baf('0x43')],'account':_0x81af83[_0x0baf('0x44')]}))||'';}function getInteractionUsers(_0x290464,_0x37c038){return new BPromise(function(_0x631f74,_0x36c6d2){try{if(_0x37c038[_0x290464['id']]){_0x290464[_0x0baf('0x45')]=_[_0x0baf('0x46')](_0x37c038[_0x290464['id']],function(_0x354cb1){return{'id':_0x354cb1['id'],'fullname':_0x354cb1[_0x0baf('0x47')]};});}}catch(_0x53d6b7){_0x36c6d2(_0x53d6b7);}_0x631f74(_0x290464);});}function getInteractionTags(_0x3573ce,_0x1435d5){return new BPromise(function(_0x4f1de9,_0x38006a){try{if(_0x3573ce[_0x0baf('0x48')]){_0x3573ce[_0x0baf('0x49')]=[];_0x3573ce[_0x0baf('0x48')][_0x0baf('0x4a')](',')[_0x0baf('0x4b')](function(_0x57b581){_0x3573ce[_0x0baf('0x49')][_0x0baf('0x4c')](_0x1435d5[_0x57b581]);});}delete _0x3573ce['TagIds'];}catch(_0x35d442){_0x38006a(_0x35d442);}_0x4f1de9(_0x3573ce);});}function updateChatInteraction(_0x412e6f,_0x45c6aa,_0x57903e){return new BPromise(function(_0x504031,_0x193fd3){return getInteractionUsers(_0x412e6f,_0x57903e)[_0x0baf('0x24')](function(_0x301412){return getInteractionTags(_0x301412,_0x45c6aa);})[_0x0baf('0x24')](function(_0x2b6d54){_0x504031(_0x2b6d54);})[_0x0baf('0x2e')](function(_0x33da34){_0x193fd3(_0x33da34);});});}exports[_0x0baf('0x4d')]=function(_0xce1bf0,_0x355033){var _0x56270e={},_0x2a2a7c={},_0x2bc755={'count':0x0,'rows':[]};var _0x1daf1d=_[_0x0baf('0x46')](db[_0x0baf('0x4e')]['rawAttributes'],function(_0x1e7364){return{'name':_0x1e7364[_0x0baf('0x4f')],'type':_0x1e7364[_0x0baf('0x50')][_0x0baf('0x51')]};});_0x2a2a7c[_0x0baf('0x52')]=_['map'](_0x1daf1d,_0x0baf('0x3f'));_0x2a2a7c[_0x0baf('0x53')]=_[_0x0baf('0x54')](_0xce1bf0[_0x0baf('0x53')]);_0x2a2a7c[_0x0baf('0x55')]=_[_0x0baf('0x56')](_0x2a2a7c[_0x0baf('0x52')],_0x2a2a7c['query']);_0x56270e[_0x0baf('0x57')]=_[_0x0baf('0x56')](_0x2a2a7c[_0x0baf('0x52')],qs['fields'](_0xce1bf0[_0x0baf('0x53')][_0x0baf('0x58')]));_0x56270e[_0x0baf('0x57')]=_0x56270e[_0x0baf('0x57')][_0x0baf('0x59')]?_0x56270e[_0x0baf('0x57')]:_0x2a2a7c[_0x0baf('0x52')];if(!_0xce1bf0['query'][_0x0baf('0x5a')](_0x0baf('0x5b'))){_0x56270e[_0x0baf('0x34')]=qs[_0x0baf('0x34')](_0xce1bf0[_0x0baf('0x53')][_0x0baf('0x34')]);_0x56270e[_0x0baf('0x36')]=qs[_0x0baf('0x36')](_0xce1bf0[_0x0baf('0x53')][_0x0baf('0x36')]);}_0x56270e[_0x0baf('0x5c')]=qs['sort'](_0xce1bf0['query'][_0x0baf('0x5d')]);_0x56270e[_0x0baf('0x5e')]=qs[_0x0baf('0x55')](_[_0x0baf('0x5f')](_0xce1bf0[_0x0baf('0x53')],_0x2a2a7c[_0x0baf('0x55')]),_0x1daf1d);var _0x3403d5=[];var _0x4b492c=squel[_0x0baf('0x60')]()[_0x0baf('0x61')]('id')[_0x0baf('0x61')](_0x0baf('0x3f'))[_0x0baf('0x61')](_0x0baf('0x62'))['from'](_0x0baf('0x63'));var _0x5f123c=squel[_0x0baf('0x60')]()['field'](_0x0baf('0x64'))['field'](_0x0baf('0x65'))['field'](_0x0baf('0x66'))[_0x0baf('0x67')](_0x0baf('0x68'),'ui')[_0x0baf('0x69')](_0x0baf('0x6a'),'u','u.id\x20=\x20ui.UserId');var _0x21f179=squel[_0x0baf('0x60')]()[_0x0baf('0x67')](_0x0baf('0x6b'),'i')[_0x0baf('0x69')](_0x0baf('0x6c'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x0baf('0x69')](_0x0baf('0x6a'),'o',_0x0baf('0x6d'))[_0x0baf('0x69')](_0x0baf('0x6e'),'a',_0x0baf('0x6f'))[_0x0baf('0x69')]('chat_messages','me','me.ChatInteractionId\x20=\x20i.id')[_0x0baf('0x69')](_0x0baf('0x70'),'it',_0x0baf('0x71'))[_0x0baf('0x69')](_0x0baf('0x63'),'t',_0x0baf('0x72'));var _0xaa4293=squel[_0x0baf('0x73')]();var _0x3d9a32=[];var _0x585969=squel[_0x0baf('0x73')]();var _0x268be8;if(_0xce1bf0[_0x0baf('0x53')][_0x0baf('0x74')]){_0x268be8=as[_0x0baf('0x75')](_0xce1bf0[_0x0baf('0x53')][_0x0baf('0x74')]);var _0x51d75f=_0x268be8[_0x0baf('0x76')];for(var _0x27f580=0x0;_0x27f580<_0x268be8[_0x0baf('0x77')][_0x0baf('0x59')];_0x27f580++){var _0x1c7d88=_0x268be8[_0x0baf('0x77')][_0x27f580];var _0x14e6d0='i';var _0x12543e=_['find'](_0x1daf1d,[_0x0baf('0x3f'),_0x1c7d88['field']]);if(!_0x12543e){switch(_0x1c7d88[_0x0baf('0x61')]){case'unreadMessages':if(_0x1c7d88['value']==0x1){_0x21f179[_0x0baf('0x78')]('`'+_0x1c7d88['field']+_0x0baf('0x79'));}else{_0x21f179[_0x0baf('0x78')]('`'+_0x1c7d88['field']+_0x0baf('0x7a'));}break;case _0x0baf('0x7b'):if(_0x1c7d88[_0x0baf('0x7c')]==='$substring'){if(_0x1c7d88['value'][_0x0baf('0x4a')]('\x20')[_0x0baf('0x59')]>0x1){_0xaa4293[_0x51d75f](_0x0baf('0x7d'),qs[_0x0baf('0x7e')](_0x1c7d88[_0x0baf('0x7f')]),null);}else{var _0x588b88='%'+_0x1c7d88[_0x0baf('0x7f')]+'%';_0xaa4293[_0x51d75f]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x588b88,_0x588b88,_0x588b88);}}else{_0x12543e=_['find'](_0x1daf1d,['name',_0x0baf('0x80')]);_0x1c7d88['field']='ContactId';_0xf45ec3=as[_0x0baf('0x81')](_0x14e6d0,_0x12543e[_0x0baf('0x50')],_0x1c7d88);_0xaa4293[_0x51d75f](_0xf45ec3[_0x0baf('0x82')],_0xf45ec3[_0x0baf('0x7f')][_0x0baf('0x83')],_0xf45ec3[_0x0baf('0x7f')]['end']);}break;case _0x0baf('0x84'):var _0x1a0a67=_0x1c7d88[_0x0baf('0x7f')][_0x0baf('0x4a')](',')[_0x0baf('0x46')](function(_0x1273f4){return Number(_0x1273f4);});_0x1a0a67['forEach'](function(_0x42e8ad){_0x585969['or'](_0x0baf('0x85'),'%,'+_0x42e8ad+',%');});_0x3d9a32=_[_0x0baf('0x86')](_0x3d9a32,_0x1a0a67);break;case'User':if(_0x1c7d88[_0x0baf('0x7c')]===_0x0baf('0x87')){_0xaa4293[_0x51d75f](_0x0baf('0x88'),'%'+_0x1c7d88[_0x0baf('0x7f')]+'%',null);}else{_0x12543e=_[_0x0baf('0x89')](_0x1daf1d,[_0x0baf('0x3f'),_0x0baf('0x8a')]);_0x1c7d88['field']='UserId';_0xf45ec3=as['buildExpression'](_0x14e6d0,_0x12543e[_0x0baf('0x50')],_0x1c7d88);_0xaa4293[_0x51d75f](_0xf45ec3[_0x0baf('0x82')],_0xf45ec3[_0x0baf('0x7f')][_0x0baf('0x83')],_0xf45ec3[_0x0baf('0x7f')][_0x0baf('0x31')]);}break;case'body':_0xf45ec3=as['buildExpression']('me',null,_0x1c7d88);_0xaa4293[_0x51d75f](_0xf45ec3[_0x0baf('0x82')],_0xf45ec3['value'][_0x0baf('0x83')],_0xf45ec3[_0x0baf('0x7f')]['end']);break;}}else{var _0xf45ec3=as[_0x0baf('0x81')](_0x14e6d0,_0x12543e[_0x0baf('0x50')],_0x1c7d88);_0xaa4293[_0x51d75f](_0xf45ec3[_0x0baf('0x82')],_0xf45ec3[_0x0baf('0x7f')][_0x0baf('0x83')],_0xf45ec3[_0x0baf('0x7f')][_0x0baf('0x31')]);}}}else{var _0xfcc697=_(_0xce1bf0['query'])['keys']()['map'](function(_0x493784){return _['some'](_0x1daf1d,[_0x0baf('0x3f'),_0x493784])?_0x493784:undefined;})[_0x0baf('0x8b')]()[_0x0baf('0x7f')]();if(!_[_0x0baf('0x8c')](_0xfcc697)){_0xfcc697['forEach'](function(_0x1be7f2){if(_0x1be7f2===_0x0baf('0x8d')){_0x21f179['where']('i.ChatWebsiteId\x20IN\x20?',[][_0x0baf('0x8e')](_0xce1bf0[_0x0baf('0x53')][_0x1be7f2]));}else if(_0x1be7f2===_0x0baf('0x8f')){var _0x442e5f=JSON[_0x0baf('0x90')](_0xce1bf0[_0x0baf('0x53')][_0x1be7f2])[_0x0baf('0x91')];var _0x399f40=JSON['parse'](_0xce1bf0[_0x0baf('0x53')][_0x1be7f2])[_0x0baf('0x92')];_0x21f179['where'](_0x0baf('0x93'),_0x442e5f,_0x399f40);}else{if(_0xce1bf0[_0x0baf('0x53')][_0x1be7f2]==='null'){_0x21f179[_0x0baf('0x5e')]('i.'+_0x1be7f2+_0x0baf('0x94'));}else{_0x21f179[_0x0baf('0x5e')]('i.'+_0x1be7f2+_0x0baf('0x95'),_0xce1bf0[_0x0baf('0x53')][_0x1be7f2]);}}});}if(_0xce1bf0['query']['read']){if(_0xce1bf0[_0x0baf('0x53')][_0x0baf('0x96')]==0x1){_0x21f179['having'](_0x0baf('0x97'));}else{_0x21f179[_0x0baf('0x78')](_0x0baf('0x98'));}}if(_0xce1bf0['query'][_0x0baf('0x99')]){_0x3d9a32=_[_0x0baf('0x9a')](_0xce1bf0[_0x0baf('0x53')]['tag'])?_0xce1bf0[_0x0baf('0x53')]['tag']:new Array(_0xce1bf0[_0x0baf('0x53')][_0x0baf('0x99')]);_0x3d9a32[_0x0baf('0x4b')](function(_0x2f009f){_0x585969['or'](_0x0baf('0x85'),'%,'+_0x2f009f+',%');});}if(_0xce1bf0['query'][_0x0baf('0x9b')]){var _0x57f33c=_0xce1bf0['query'][_0x0baf('0x9b')][_0x0baf('0x9c')]('\x5c','\x5c\x5c')[_0x0baf('0x9c')](/'/g,'\x27\x27');if(qs[_0x0baf('0x9d')](_0x57f33c)){_0xaa4293['or'](_0x0baf('0x9e'),_0x57f33c+'%');}else{_0xaa4293['or'](_0x0baf('0x9f'),qs[_0x0baf('0x7e')](_0x57f33c))['or'](_0x0baf('0xa0'),_0x57f33c+'%');}}}_0x21f179[_0x0baf('0x5e')](_0xaa4293);_0x21f179[_0x0baf('0xa1')](_0x0baf('0xa2'));var _0x2c2f09={'type':db['Sequelize']['QueryTypes'][_0x0baf('0xa3')],'raw':!![]};var _0x322a09=_0x21f179[_0x0baf('0xa4')]();_0x322a09['field']('i.id');_0x322a09[_0x0baf('0x61')](_0x0baf('0xa5'),_0x0baf('0xa6'));if(_0x56270e[_0x0baf('0x5c')]){_0x56270e[_0x0baf('0x5c')][_0x0baf('0x4b')](function(_0x191d35){var _0xa2d315=_0x191d35[0x0]===_0x0baf('0xa7')?_0x191d35[0x0]:'i.'+_0x191d35[0x0];_0x21f179['order'](_0xa2d315,_0x191d35[0x1]===_0x0baf('0xa8')?![]:!![]);});}if(!_[_0x0baf('0x8c')](_0x3d9a32)){_0x21f179[_0x0baf('0x78')](_0x585969);_0x322a09[_0x0baf('0x5e')]('t.id\x20IN\x20?',_0x3d9a32);}BPromise['resolve']()['then'](function(){if(!_0x268be8){if(_0xce1bf0[_0x0baf('0x53')][_0x0baf('0x8d')])return;_0x322a09['where']('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');_0x21f179[_0x0baf('0x5e')](_0x0baf('0xa9'));return;}if(_0xce1bf0['user'][_0x0baf('0xaa')]!==_0x0baf('0x42'))return;return _0xce1bf0[_0x0baf('0xab')][_0x0baf('0xac')]({'attributes':['id'],'raw':!![]})[_0x0baf('0x24')](function(_0x25081e){if(_[_0x0baf('0x8c')](_0x25081e)){_0x322a09[_0x0baf('0x5e')](_0x0baf('0xad'));_0x21f179[_0x0baf('0x5e')](_0x0baf('0xad'));}else{_0x322a09[_0x0baf('0x5e')]('i.ChatWebsiteId\x20IN\x20?',_[_0x0baf('0x46')](_0x25081e,'id'));_0x21f179[_0x0baf('0x5e')](_0x0baf('0xae'),_[_0x0baf('0x46')](_0x25081e,'id'));}});})[_0x0baf('0x24')](function(){if(_0xce1bf0[_0x0baf('0xab')]['role']===_0x0baf('0x42')&&!_0x268be8&&!_0xce1bf0[_0x0baf('0x53')][_0x0baf('0x8d')])return[];return db[_0x0baf('0xaf')][_0x0baf('0x53')](_0x322a09['toString'](),_0x2c2f09);})[_0x0baf('0x24')](function(_0x30eac8){_0x2bc755[_0x0baf('0x35')]=_0x30eac8[_0x0baf('0x59')];if(_0x2bc755[_0x0baf('0x35')]===0x0)return[];return db['sequelize']['query'](_0x4b492c[_0x0baf('0xb0')](),_0x2c2f09)['then'](function(_0x477cd5){_0x3403d5=_['keyBy'](_0x477cd5,'id');_0x2c2f09=_[_0x0baf('0xb1')](_0x2c2f09,{'model':db[_0x0baf('0x4e')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0xce1bf0[_0x0baf('0x53')][_0x0baf('0x58')]){_0x56270e['attributes'][_0x0baf('0x4b')](function(_0x106ffa){_0x21f179[_0x0baf('0x61')]('i.'+_0x106ffa);});}else{_0x21f179['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');_0x21f179['field'](_0x0baf('0xb2'),_0x0baf('0xb3'));_0x21f179[_0x0baf('0x61')](_0x0baf('0xb4'),'Account.mandatoryDisposition');_0x21f179[_0x0baf('0x61')](_0x0baf('0xb5'),_0x0baf('0xa7'));_0x21f179['field'](_0x0baf('0xb6'));_0x21f179[_0x0baf('0x61')]('c.firstName',_0x0baf('0xb7'));_0x21f179['field'](_0x0baf('0xb8'),_0x0baf('0xb9'));_0x21f179[_0x0baf('0x61')](_0x0baf('0xba'),'Contact.email');_0x21f179['field'](_0x0baf('0xbb'),'Contact.phone');_0x21f179[_0x0baf('0x61')](_0x0baf('0xbc'),_0x0baf('0xbd'));_0x21f179[_0x0baf('0x61')](_0x0baf('0xbe'),'Contact.fax');_0x21f179[_0x0baf('0x61')]('o.fullname',_0x0baf('0xbf'));_0x21f179['field'](_0x0baf('0xc0'),'Owner.internal');_0x21f179[_0x0baf('0x61')](_0x0baf('0xc1'),_0x0baf('0x48'));}if(_0x56270e['limit'])_0x21f179['limit'](_0x56270e[_0x0baf('0x34')]);if(_0x56270e[_0x0baf('0x36')])_0x21f179[_0x0baf('0x36')](_0x56270e[_0x0baf('0x36')]);return db[_0x0baf('0xaf')][_0x0baf('0x53')](_0x21f179['toString'](),_0x2c2f09);})[_0x0baf('0x24')](function(_0x5ee37f){if(_0x5ee37f[_0x0baf('0x59')]>0x0)_0x5f123c['where'](_0x0baf('0xc2'),_[_0x0baf('0x46')](_0x5ee37f,'id'));return db[_0x0baf('0xaf')]['query'](_0x5f123c[_0x0baf('0xb0')](),_0x2c2f09)[_0x0baf('0x24')](function(_0x4879b4){var _0x544498=_[_0x0baf('0xc3')](_0x4879b4,_0x0baf('0xc4'));var _0x20dd04=[];_0x5ee37f[_0x0baf('0x4b')](function(_0x4823a3){_0x20dd04['push'](updateChatInteraction(_0x4823a3,_0x3403d5,_0x544498));});return BPromise[_0x0baf('0xc5')](_0x20dd04);});});})[_0x0baf('0x24')](function(_0x116d52){_0x2bc755[_0x0baf('0xc6')]=_0x116d52;return _0x2bc755;})[_0x0baf('0x24')](respondWithFilteredResult(_0x355033,_0x56270e))[_0x0baf('0x2e')](handleError(_0x355033,null));};exports[_0x0baf('0xc7')]=function(_0xe0b67c,_0x205de6){var _0x2369f0={'raw':![],'where':{'id':_0xe0b67c[_0x0baf('0xc8')]['id']}},_0x58f95c={};_0x58f95c['model']=_[_0x0baf('0x54')](db[_0x0baf('0x4e')][_0x0baf('0xc9')]);_0x58f95c[_0x0baf('0x53')]=_['keys'](_0xe0b67c[_0x0baf('0x53')]);_0x58f95c[_0x0baf('0x55')]=_[_0x0baf('0x56')](_0x58f95c[_0x0baf('0x52')],_0x58f95c[_0x0baf('0x53')]);_0x2369f0[_0x0baf('0x57')]=_[_0x0baf('0x56')](_0x58f95c[_0x0baf('0x52')],qs[_0x0baf('0x58')](_0xe0b67c['query'][_0x0baf('0x58')]));_0x2369f0[_0x0baf('0x57')]=_0x2369f0['attributes'][_0x0baf('0x59')]?_0x2369f0[_0x0baf('0x57')]:_0x58f95c[_0x0baf('0x52')];if(_0xe0b67c[_0x0baf('0x53')][_0x0baf('0xca')]){_0x2369f0[_0x0baf('0xcb')]=[{'all':!![]}];}_0x2369f0=_[_0x0baf('0xb1')]({},_0x2369f0,_0xe0b67c[_0x0baf('0xcc')]);return db[_0x0baf('0x4e')]['find'](_0x2369f0)[_0x0baf('0x24')](handleEntityNotFound(_0x205de6,null))[_0x0baf('0x24')](respondWithResult(_0x205de6,null))[_0x0baf('0x2e')](handleError(_0x205de6,null));};exports[_0x0baf('0xcd')]=function(_0x4328d5,_0x270d69){return db['ChatInteraction'][_0x0baf('0xcd')](_0x4328d5[_0x0baf('0x40')],{})[_0x0baf('0x24')](respondWithResult(_0x270d69,0xc9))['catch'](handleError(_0x270d69,null));};exports['update']=function(_0x5adbd9,_0x1adb84){if(_0x5adbd9[_0x0baf('0x40')]['id']){delete _0x5adbd9['body']['id'];}return db[_0x0baf('0x4e')]['find']({'where':{'id':_0x5adbd9[_0x0baf('0xc8')]['id']}})['then'](handleEntityNotFound(_0x1adb84,null))[_0x0baf('0x24')](saveUpdates(_0x5adbd9[_0x0baf('0x40')],null))['then'](respondWithResult(_0x1adb84,null))[_0x0baf('0x2e')](handleError(_0x1adb84,null));};exports[_0x0baf('0x3d')]=function(_0x25d25e,_0x4494de){return db[_0x0baf('0x4e')][_0x0baf('0x89')]({'where':{'id':_0x25d25e[_0x0baf('0xc8')]['id']}})['then'](handleEntityNotFound(_0x4494de,null))[_0x0baf('0x24')](removeEntity(_0x4494de,null))[_0x0baf('0x2e')](handleError(_0x4494de,null));};exports[_0x0baf('0xce')]=function(_0x2e1629,_0x275cc4){return db[_0x0baf('0x4e')][_0x0baf('0xce')]()[_0x0baf('0x24')](respondWithResult(_0x275cc4,null))[_0x0baf('0x2e')](handleError(_0x275cc4,null));};exports[_0x0baf('0xcf')]=function(_0x308b3f,_0xae8bc2){var _0x1390cd=_0x308b3f[_0x0baf('0xc8')]['id'];var _0x59dd6c;var _0x57b64b;var _0x1cd215;return db[_0x0baf('0x4e')][_0x0baf('0xd0')]({'where':{'id':_0x1390cd}})[_0x0baf('0x24')](function(_0x52e98a){_0x59dd6c=_0x52e98a;return db[_0x0baf('0xd1')][_0x0baf('0xd0')]({'where':{'id':_0x52e98a[_0x0baf('0x8d')]},'attributes':['id',_0x0baf('0xd2'),_0x0baf('0xd3'),_0x0baf('0xd4'),'vidaooNote',_0x0baf('0xd5')],'raw':!![]});})[_0x0baf('0x24')](function(_0x347c39){if(_0x347c39&&_0x347c39['vidaooApiKey']&&_0x347c39[_0x0baf('0xd3')]){_0x57b64b=_0x347c39;var _0x106c6e={'interaction':{'id':_0x1390cd},'agent':{'id':_0x308b3f[_0x0baf('0xab')]['id'],'name':_0x308b3f['user']['name'],'fullname':_0x308b3f['user'][_0x0baf('0x47')],'email':_0x308b3f['user'][_0x0baf('0xd6')]},'contact':_0x308b3f[_0x0baf('0x40')]['contact'],'account':_0x308b3f[_0x0baf('0x40')]['account']};var _0x5737b0={'rejectUnauthorized':![],'method':_0x0baf('0xd7'),'url':'https://api-vidaoo.xcally.com/api/v1/meetings','headers':{'X-APIKEY':_0x347c39[_0x0baf('0xd2')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x308b3f['user']['email']],'buttons':null,'topic':_0x57b64b['vidaooTopic'],'note':_[_0x0baf('0xd8')](_0x57b64b[_0x0baf('0xd9')])?null:getMustacheRender(_0x57b64b[_0x0baf('0xd9')],_0x106c6e),'metadata':null},'redirect':_0x0baf('0xda'),'json':!![]};try{if(!_[_0x0baf('0xd8')](_0x57b64b[_0x0baf('0xd5')])){var _0x20582a=getMustacheRender(_0x57b64b['vidaooMetadata'],_0x106c6e);var _0x36cd08=JSON[_0x0baf('0x90')](_0x20582a);_0x5737b0[_0x0baf('0x40')]['metadata']=_0x36cd08;}}catch(_0x24672f){throw new db[(_0x0baf('0xdb'))][(_0x0baf('0xdc'))]('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x5737b0);}else{throw new db[(_0x0baf('0xdb'))]['ValidationError'](_0x0baf('0xdd'));}})[_0x0baf('0x24')](function(_0x57846e){_0x1cd215=_0x57846e;if(_0x1cd215['id']){var _0xd4ed40={'body':_0x1cd215[_0x0baf('0xde')],'ChatWebsiteId':_0x57b64b['id'],'ChatInteractionId':_0x59dd6c['id'],'direction':_0x0baf('0xdf'),'UserId':_0x308b3f[_0x0baf('0xab')]['id']};return db['ChatMessage'][_0x0baf('0xcd')](_0xd4ed40,{});}else{throw new db[(_0x0baf('0xdb'))]['ValidationError']('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0x0baf('0x24')](function(){return _0x59dd6c[_0x0baf('0xe0')]({'vidaooSessionId':_0x1cd215['id']});})[_0x0baf('0x24')](respondWithResult(_0xae8bc2,null))[_0x0baf('0x2e')](handleError(_0xae8bc2,null));};exports['customUpdate']=function(_0x5571d4,_0x16579f){if(_0x5571d4[_0x0baf('0x40')]['id']){delete _0x5571d4[_0x0baf('0x40')]['id'];}return db[_0x0baf('0x4e')][_0x0baf('0x89')]({'where':{'id':_0x5571d4['params']['id']},'include':[{'model':db[_0x0baf('0xe1')],'as':_0x0baf('0x7b')}]})['then'](handleEntityNotFound(_0x16579f,null))[_0x0baf('0x24')](saveUpdates(_0x5571d4[_0x0baf('0x40')],null))['then'](respondWithResult(_0x16579f,null))[_0x0baf('0x2e')](handleError(_0x16579f,null));};exports[_0x0baf('0xe2')]=function(_0x19457c,_0x1f0b00,_0x2484d4){if(_0x19457c[_0x0baf('0x40')]['id']){delete _0x19457c[_0x0baf('0x40')]['id'];}return db[_0x0baf('0x4e')]['find']({'where':{'id':_0x19457c[_0x0baf('0xc8')]['id']}})[_0x0baf('0x24')](function(_0x226edd){if(!_0x226edd){logger[_0x0baf('0x2a')]('abandonInteraction,\x20%s,\x20%s,\x20%s',_0x0baf('0xe2'),0x194,_0x0baf('0xe3'));_0x1f0b00['sendStatus'](0x194);}else{if(_0x226edd[_0x0baf('0x8a')]){throw new db[(_0x0baf('0xdb'))][(_0x0baf('0xdc'))](_0x0baf('0xe4'));}}return _0x226edd;})['then'](function(_0x3ca1a6){if(_0x3ca1a6){return _0x3ca1a6[_0x0baf('0x3c')]({'closed':_0x19457c[_0x0baf('0x40')][_0x0baf('0xe5')],'disposition':_0x19457c[_0x0baf('0x40')]['disposition']})[_0x0baf('0x24')](function(_0xc5ec1a){return _0xc5ec1a;});}})[_0x0baf('0x24')](function(_0x5d33b4){return respondWithRpcPromise(_0x0baf('0xe6'),_0x0baf('0xe2'),_0x19457c[_0x0baf('0x40')],client9004);})[_0x0baf('0x24')](respondWithResult(_0x1f0b00,null))[_0x0baf('0x2e')](handleError(_0x1f0b00,null));};exports['attachmentUpload']=function(_0x553084,_0x19898e,_0x315ada){_0x553084[_0x0baf('0x40')]['name']=_0x553084[_0x0baf('0xe7')][_0x0baf('0xe8')];_0x553084[_0x0baf('0x40')][_0x0baf('0xe9')]=_0x553084[_0x0baf('0xe7')][_0x0baf('0xea')];_0x553084[_0x0baf('0x40')][_0x0baf('0x50')]=_0x553084[_0x0baf('0xe7')][_0x0baf('0xeb')];return db['Attachment'][_0x0baf('0xcd')](_0x553084[_0x0baf('0x40')])[_0x0baf('0x24')](respondWithResult(_0x19898e,0xc9))[_0x0baf('0x2e')](handleError(_0x19898e,null));};exports['attachmentDownload']=function(_0x413d0d,_0x3d7667,_0x386928){return db['ChatInteraction'][_0x0baf('0xd0')]({'where':{'id':_0x413d0d[_0x0baf('0xc8')]['id']},'raw':!![]})[_0x0baf('0x24')](handleEntityNotFound(_0x3d7667,null))[_0x0baf('0x24')](function(_0x1e4bf1){if(_0x1e4bf1){if(_0x1e4bf1['closed']){return _0x3d7667[_0x0baf('0x30')](0x193)[_0x0baf('0x32')]({'status':0x193,'message':'Unauthorized'});}return db['Attachment'][_0x0baf('0xd0')]({'where':{'id':_0x413d0d[_0x0baf('0x53')][_0x0baf('0xec')]},'raw':!![]})[_0x0baf('0x24')](handleEntityNotFound(_0x3d7667,null));}})[_0x0baf('0x24')](function(_0xb22125){if(_0xb22125){var _0x37c83a=_0xb22125['ChatOfflineMessageId']!==null;var _0x5deb7b=path[_0x0baf('0xed')](config[_0x0baf('0xee')],_0x0baf('0xef'));if(_0x37c83a){_0x5deb7b=path['join'](_0x5deb7b,_0x0baf('0xf0'));}var _0x3a6bf8=path['join'](_0x5deb7b,_0xb22125[_0x0baf('0xe9')]);return _0x3d7667[_0x0baf('0xf1')](_0x3a6bf8);}})['catch'](handleError(_0x3d7667,null));};exports[_0x0baf('0xf2')]=function(_0x9d6974,_0x939365){var _0x4d6ac4=null;var _0x1d86c9=null;var _0x95fe84=null;var _0x2a7138=null;if(_0x9d6974[_0x0baf('0x40')]['id']){delete _0x9d6974[_0x0baf('0x40')]['id'];}if(_0x9d6974[_0x0baf('0x40')][_0x0baf('0xf3')]){_0x2a7138=path['join'](config[_0x0baf('0xee')],'server/files/chat/upload/',util[_0x0baf('0xf4')](_0x0baf('0xf5'),Date['now']()));_0x9d6974['body'][_0x0baf('0xf6')]=_0x2a7138;}return db[_0x0baf('0x4e')][_0x0baf('0x89')]({'where':{'id':_0x9d6974['params']['id']},'include':[{'model':db[_0x0baf('0xf7')],'as':_0x0baf('0xf8'),'include':[{'model':db[_0x0baf('0xf9')],'as':_0x0baf('0xf9')}]}]})[_0x0baf('0x24')](handleEntityNotFound(_0x939365,null))[_0x0baf('0x24')](saveUpdates(_0x9d6974[_0x0baf('0x40')],null))[_0x0baf('0x24')](function(_0x5f3691){if(_0x5f3691){_0x4d6ac4=_0x5f3691;return db['ChatWebsite'][_0x0baf('0x89')]({'where':{'id':_0x4d6ac4[_0x0baf('0x8d')]}});}})['then'](function(_0x210047){if(_0x210047){_0x95fe84=_0x210047;return db[_0x0baf('0xe1')][_0x0baf('0x89')]({'where':{'id':_0x4d6ac4[_0x0baf('0x80')]}});}})[_0x0baf('0x24')](function(_0x8806f9){if(_0x8806f9){_0x1d86c9=_0x8806f9;if(_0x2a7138){var _0x1cb69a=null;for(var _0x4bc31f=0x1;_0x4bc31f<_0x4d6ac4[_0x0baf('0xf8')]['length'];++_0x4bc31f){_0x1cb69a=_0x4d6ac4[_0x0baf('0xf8')][_0x4bc31f];var _0x32abf2=_0x1cb69a['UserId']?util['format'](_0x0baf('0xfa'),_0x95fe84[_0x0baf('0xfb')],_0x1cb69a[_0x0baf('0x8a')]):_0x0baf('0xfc');var _0x4759d5=_0x9d6974[_0x0baf('0x40')][_0x0baf('0xfd')]||util['format']('%s%d','Visitor',_0x1cb69a[_0x0baf('0x80')]);switch(_0x95fe84['agentIdentifier']){case _0x0baf('0xfe'):_0x32abf2=_0x1cb69a[_0x0baf('0x8a')]?util['format']('%s%d',_0x95fe84[_0x0baf('0xfb')],_0x1cb69a[_0x0baf('0x8a')]):_0x0baf('0xfc');break;case _0x0baf('0xff'):_0x32abf2=_0x1cb69a[_0x0baf('0x8a')]?_0x1cb69a['User'][_0x0baf('0x100')]||_0x1cb69a[_0x0baf('0xf9')][_0x0baf('0x47')]:_0x0baf('0xfc');break;case _0x0baf('0x101'):_0x32abf2=_0x1cb69a[_0x0baf('0x8a')]?_0x1cb69a['User'][_0x0baf('0x47')]:_0x0baf('0xfc');break;default:_0x32abf2=_0x1cb69a[_0x0baf('0x8a')]?util['format'](_0x0baf('0xfa'),_0x95fe84[_0x0baf('0xfb')],_0x1cb69a['UserId']):_0x0baf('0xfc');}var _0xe93008=util[_0x0baf('0xf4')](_0x0baf('0x102'),moment(_0x1cb69a['createdAt'])['format'](_0x0baf('0x103')),_0x1cb69a[_0x0baf('0x104')]==='in'?_0x4759d5:_0x32abf2,_0x1cb69a['body']);if(!_0x1cb69a[_0x0baf('0x105')]){fs[_0x0baf('0x106')](_0x2a7138,_0xe93008);}}return db[_0x0baf('0x107')][_0x0baf('0xd0')]({'where':{'service':!![]},'include':[{'model':db[_0x0baf('0x108')],'as':'Smtp','raw':!![]}]});}}})[_0x0baf('0x24')](function(_0x1fe362){if(_0x1fe362&&_0x1fe362[_0x0baf('0x109')]&&_0x9d6974[_0x0baf('0x40')]){var _0x51287e={'tls':{'rejectUnauthorized':![]}};if(_0x1fe362[_0x0baf('0x109')]['service']){_0x51287e[_0x0baf('0x10a')]=_0x1fe362[_0x0baf('0x109')][_0x0baf('0x10a')];}else{_0x51287e['host']=_0x1fe362[_0x0baf('0x109')][_0x0baf('0x10b')];_0x51287e[_0x0baf('0x10c')]=_0x1fe362[_0x0baf('0x109')][_0x0baf('0x10c')];_0x51287e[_0x0baf('0x10d')]=_0x1fe362[_0x0baf('0x109')][_0x0baf('0x10d')];}if(_0x1fe362[_0x0baf('0x109')][_0x0baf('0x10e')]){_0x51287e[_0x0baf('0x10f')]={'user':_0x1fe362[_0x0baf('0x109')]['user'],'pass':_0x1fe362['Smtp'][_0x0baf('0x110')]};}return respondWithRpcPromise('SendMail','sendMail',{'account':_0x51287e,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0x1fe362[_0x0baf('0x3f')],_0x1fe362[_0x0baf('0xd6')]||_0x1fe362['Smtp']['user']),'to':_0x9d6974['body']['mailTranscript'],'subject':_0x0baf('0x111'),'text':util['format'](_0x0baf('0x112'),_0x9d6974[_0x0baf('0x40')][_0x0baf('0xf3')]),'attachments':[{'path':_0x2a7138}]}})[_0x0baf('0x24')](function(){return _0x4d6ac4;})[_0x0baf('0x2e')](function(_0x292469){console[_0x0baf('0x2a')](_0x292469);});}else{return _0x4d6ac4;}})[_0x0baf('0x24')](respondWithStatusCode(_0x939365,0xc8))['catch'](handleError(_0x939365,null));};exports['addMessage']=function(_0x2d7ec3,_0x2a4d79,_0x5ebcad){return db[_0x0baf('0xf7')]['find']({'where':{'id':_0x2d7ec3[_0x0baf('0xc8')]['id']}})['then'](handleEntityNotFound(_0x2a4d79,null))['then'](function(_0x4621ba){if(_0x4621ba){return _0x4621ba[_0x0baf('0x113')](_0x2d7ec3[_0x0baf('0x40')][_0x0baf('0x114')],_[_0x0baf('0x115')](_0x2d7ec3[_0x0baf('0x40')],[_0x0baf('0x114'),'id'])||{});}})[_0x0baf('0x24')](respondWithResult(_0x2a4d79,null))[_0x0baf('0x2e')](handleError(_0x2a4d79,null));};exports[_0x0baf('0x116')]=function(_0x425869,_0x4059e1,_0x2c94ff){var _0x738da0={'raw':![],'where':{}};var _0x268a1c={};var _0x34cb32={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x0baf('0xd0')]({'where':{'id':_0x425869[_0x0baf('0xc8')]['id']}})['then'](handleEntityNotFound(_0x4059e1,null))[_0x0baf('0x24')](function(_0x39526b){if(_0x39526b){_0x268a1c['model']=_[_0x0baf('0x54')](db['ChatMessage'][_0x0baf('0xc9')]);_0x268a1c['query']=_[_0x0baf('0x54')](_0x425869['query']);_0x268a1c[_0x0baf('0x55')]=_[_0x0baf('0x56')](_0x268a1c[_0x0baf('0x52')],_0x268a1c[_0x0baf('0x53')]);_0x738da0['attributes']=_[_0x0baf('0x56')](_0x268a1c[_0x0baf('0x52')],qs[_0x0baf('0x58')](_0x425869[_0x0baf('0x53')]['fields']));_0x738da0['attributes']=_0x738da0[_0x0baf('0x57')][_0x0baf('0x59')]?_0x738da0[_0x0baf('0x57')]:_0x268a1c[_0x0baf('0x52')];if(!_0x425869['query'][_0x0baf('0x5a')](_0x0baf('0x5b'))){_0x738da0[_0x0baf('0x34')]=qs['limit'](_0x425869['query'][_0x0baf('0x34')]);_0x738da0['offset']=qs[_0x0baf('0x36')](_0x425869['query'][_0x0baf('0x36')]);}_0x738da0[_0x0baf('0x5c')]=qs[_0x0baf('0x5d')](_0x425869['query'][_0x0baf('0x5d')]);_0x738da0[_0x0baf('0x5e')]=qs['filters'](_['pick'](_0x425869[_0x0baf('0x53')],_0x268a1c['filters']));_0x738da0[_0x0baf('0x5e')][_0x0baf('0xc4')]=_0x39526b['id'];if(_0x425869['query']['filter']){_0x738da0[_0x0baf('0x5e')]=_[_0x0baf('0xb1')](_0x738da0['where'],{'$or':_[_0x0baf('0x46')](_0x738da0['attributes'],function(_0x309220){var _0x376eb3={};_0x376eb3[_0x309220]={'$like':'%'+_0x425869['query'][_0x0baf('0x9b')]+'%'};return _0x376eb3;})});}if(_0x425869[_0x0baf('0x53')][_0x0baf('0x91')]){var _0x2ef76b=_0x425869[_0x0baf('0x53')]['$gte'][_0x0baf('0x4a')](',');var _0x4ca9ea={};_0x4ca9ea[_0x2ef76b[0x0]]={'$gte':moment(_0x2ef76b[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x738da0[_0x0baf('0x5e')]=_[_0x0baf('0xb1')](_0x738da0['where'],_0x4ca9ea);}_0x738da0=_[_0x0baf('0xb1')]({},_0x738da0,_0x425869[_0x0baf('0xcc')]);return db['ChatMessage'][_0x0baf('0x35')]({'where':_0x738da0[_0x0baf('0x5e')]})[_0x0baf('0x24')](function(_0x3d6ece){_0x34cb32[_0x0baf('0x35')]=_0x3d6ece;if(_0x425869[_0x0baf('0x53')][_0x0baf('0xca')]){_0x738da0[_0x0baf('0xcb')]=[{'all':!![]}];}return db[_0x0baf('0xf7')][_0x0baf('0x117')](_0x738da0);})['then'](function(_0x19727f){_0x34cb32[_0x0baf('0xc6')]=_0x19727f;return _0x34cb32;});}})[_0x0baf('0x24')](respondWithFilteredResult(_0x4059e1,_0x738da0))[_0x0baf('0x2e')](handleError(_0x4059e1,null));};exports[_0x0baf('0x118')]=function(_0x57b26e,_0x3a0a2f,_0x5b676d){var _0x298155={'where':{}},_0xff9b69={},_0x5398c6={'count':0x0,'rows':[]};return db[_0x0baf('0x4e')][_0x0baf('0xd0')]({'where':{'id':_0x57b26e[_0x0baf('0xc8')]['id']}})[_0x0baf('0x24')](handleEntityNotFound(_0x3a0a2f,null))['then'](function(_0x2edcf9){if(_0x2edcf9){_0xff9b69[_0x0baf('0x52')]=_[_0x0baf('0x54')](db[_0x0baf('0xf7')][_0x0baf('0xc9')]);_0xff9b69[_0x0baf('0x53')]=_[_0x0baf('0x54')](_0x57b26e[_0x0baf('0x53')]);_0xff9b69[_0x0baf('0x55')]=_[_0x0baf('0x56')](_0xff9b69[_0x0baf('0x52')],_0xff9b69[_0x0baf('0x53')]);_0x298155[_0x0baf('0x57')]=_[_0x0baf('0x56')](_0xff9b69[_0x0baf('0x52')],qs[_0x0baf('0x58')](_0x57b26e[_0x0baf('0x53')][_0x0baf('0x58')]));_0x298155['attributes']=_0x298155[_0x0baf('0x57')][_0x0baf('0x59')]?_0x298155[_0x0baf('0x57')]:_0xff9b69[_0x0baf('0x52')];if(!_0x57b26e[_0x0baf('0x53')][_0x0baf('0x5a')](_0x0baf('0x5b'))){_0x298155['limit']=qs[_0x0baf('0x34')](_0x57b26e[_0x0baf('0x53')][_0x0baf('0x34')]);_0x298155[_0x0baf('0x36')]=qs[_0x0baf('0x36')](_0x57b26e[_0x0baf('0x53')][_0x0baf('0x36')]);}_0x298155['order']=qs[_0x0baf('0x5d')](_0x57b26e[_0x0baf('0x53')][_0x0baf('0x5d')]);_0x298155[_0x0baf('0x5e')]=qs[_0x0baf('0x55')](_[_0x0baf('0x5f')](_0x57b26e['query'],_0xff9b69[_0x0baf('0x55')]));_0x298155[_0x0baf('0x5e')][_0x0baf('0xc4')]=_0x2edcf9['id'];if(_0x57b26e[_0x0baf('0x53')][_0x0baf('0x9b')]){_0x298155['where']=_['merge'](_0x298155[_0x0baf('0x5e')],{'$or':_[_0x0baf('0x46')](_0x298155[_0x0baf('0x57')],function(_0x2d43ac){var _0x34126b={};_0x34126b[_0x2d43ac]={'$like':'%'+_0x57b26e[_0x0baf('0x53')][_0x0baf('0x9b')]+'%'};return _0x34126b;})});}_0x298155[_0x0baf('0x5e')][_0x0baf('0x105')]=![];if(_0x57b26e[_0x0baf('0x53')]['id']){_0x298155[_0x0baf('0x5e')]['id']={'$gt':_0x57b26e[_0x0baf('0x53')]['id']};}_0x298155=_[_0x0baf('0xb1')]({},_0x298155,_0x57b26e[_0x0baf('0xcc')]);return db[_0x0baf('0xf7')][_0x0baf('0x35')]({'where':_0x298155[_0x0baf('0x5e')]})[_0x0baf('0x24')](function(_0x18d219){_0x5398c6[_0x0baf('0x35')]=_0x18d219;_0x298155[_0x0baf('0xcb')]=[];if(_0x57b26e[_0x0baf('0x53')][_0x0baf('0x119')]){_0x298155[_0x0baf('0xcb')][_0x0baf('0x4c')]({'model':db[_0x0baf('0xf9')],'as':_0x0baf('0xf9'),'attributes':['id','fullname',_0x0baf('0x100')]});}if(_0x57b26e[_0x0baf('0x53')][_0x0baf('0xca')]){_0x298155[_0x0baf('0xcb')]=[{'all':!![]}];}return db[_0x0baf('0xf7')]['findAll'](_0x298155);})[_0x0baf('0x24')](function(_0x344fef){_0x5398c6[_0x0baf('0xc6')]=_0x344fef;return _0x5398c6;});}})[_0x0baf('0x24')](respondWithFilteredResult(_0x3a0a2f,_0x298155))[_0x0baf('0x2e')](handleError(_0x3a0a2f,null));};exports[_0x0baf('0x11a')]=function(_0x3358f5,_0x237a20,_0x26dd4c){return db[_0x0baf('0x4e')][_0x0baf('0x89')]({'where':{'id':_0x3358f5[_0x0baf('0xc8')]['id']}})[_0x0baf('0x24')](handleEntityNotFound(_0x237a20,null))[_0x0baf('0x24')](function(_0x2867b7){if(_0x2867b7){return _0x2867b7[_0x0baf('0x11b')](_0x3358f5[_0x0baf('0x40')][_0x0baf('0x114')],_['omit'](_0x3358f5[_0x0baf('0x40')],['ids','id'])||{})['spread'](function(){return db[_0x0baf('0x84')][_0x0baf('0x117')]({'attributes':['id',_0x0baf('0x3f'),'color'],'where':{'id':_0x3358f5[_0x0baf('0x40')][_0x0baf('0x114')]}});})[_0x0baf('0x24')](function(_0x24bc8f){socket[_0x0baf('0x11c')](_0x0baf('0x11d'),{'id':Number(_0x3358f5['params']['id']),'tags':_0x24bc8f||[]});return{'id':Number(_0x3358f5[_0x0baf('0xc8')]['id']),'tags':_0x24bc8f||[]};});}})[_0x0baf('0x24')](respondWithResult(_0x237a20,null))[_0x0baf('0x2e')](handleError(_0x237a20,null));};exports[_0x0baf('0x11e')]=function(_0x262063,_0x216897,_0x4c2bae){return db[_0x0baf('0x4e')]['find']({'where':{'id':_0x262063[_0x0baf('0xc8')]['id']}})[_0x0baf('0x24')](handleEntityNotFound(_0x216897,null))['then'](function(_0x56da3e){if(_0x56da3e){return _0x56da3e[_0x0baf('0x11e')](_0x262063[_0x0baf('0x53')][_0x0baf('0x114')]);}})['then'](respondWithStatusCode(_0x216897,null))[_0x0baf('0x2e')](handleError(_0x216897,null));};exports[_0x0baf('0xf1')]=function(_0x51d2aa,_0x26d73d){var _0x20cc18=moment()[_0x0baf('0x11f')]()[_0x0baf('0xb0')]();var _0x3fa8eb=path[_0x0baf('0xed')](config[_0x0baf('0xee')],'server','files',_0x0baf('0x120'));var _0x1bd67f=path[_0x0baf('0xed')](config[_0x0baf('0xee')],_0x0baf('0x121'),_0x0baf('0x122'),_0x0baf('0x123'));var _0x4316c5=path[_0x0baf('0xed')](_0x3fa8eb,_0x20cc18);var _0x1d5b73=util['format']('transcript-%d-%s.zip',_0x51d2aa[_0x0baf('0xc8')]['id'],_0x20cc18);var _0x2a84f8=path[_0x0baf('0xed')](_0x3fa8eb,_0x1d5b73);var _0x552504=[];_0x552504['push']({'model':db[_0x0baf('0xf9')],'as':_0x0baf('0xf9'),'attributes':['id',_0x0baf('0x47')],'raw':!![]});_0x552504[_0x0baf('0x4c')]({'model':db['CmContact'],'as':_0x0baf('0x7b'),'attributes':['id',_0x0baf('0x124'),_0x0baf('0x125')],'raw':!![]});if(_0x51d2aa[_0x0baf('0x53')][_0x0baf('0x123')]){_0x552504[_0x0baf('0x4c')]({'model':db[_0x0baf('0x126')],'as':_0x0baf('0x126'),'raw':!![]});}var _0x5bbd33=[{'model':db[_0x0baf('0xf7')],'as':_0x0baf('0xf8'),'attributes':['id',_0x0baf('0x40'),_0x0baf('0x8f'),_0x0baf('0x104'),_0x0baf('0x105'),'read'],'include':_0x552504}];_0x5bbd33[_0x0baf('0x4c')]({'model':db[_0x0baf('0xd1')],'as':'Account','attributes':['id','name']});_0x5bbd33[_0x0baf('0x4c')]({'model':db['User'],'as':_0x0baf('0x127'),'attributes':['id',_0x0baf('0x47')]});return db[_0x0baf('0x4e')][_0x0baf('0x89')]({'where':{'id':_0x51d2aa['params']['id']},'include':_0x5bbd33})[_0x0baf('0x24')](handleEntityNotFound(_0x26d73d,null))[_0x0baf('0x24')](function(_0x32c2a8){if(_0x32c2a8){var _0x58fea2=_0x32c2a8[_0x0baf('0x128')]({'plain':!![]});fs[_0x0baf('0x129')](_0x4316c5);var _0x5f5d45={'channel':_0x0baf('0x12a'),'account':_0x58fea2['Account'][_0x0baf('0x3f')],'agent':_0x58fea2[_0x0baf('0x127')]?_0x58fea2[_0x0baf('0x127')][_0x0baf('0x47')]:'N.A.','createdAt':moment(_0x58fea2[_0x0baf('0x8f')])[_0x0baf('0xf4')]('YYYY-MM-DD\x20HH:mm:ss')[_0x0baf('0xb0')](),'closedAt':_0x58fea2[_0x0baf('0xe5')]?moment(_0x58fea2['closedAt'])[_0x0baf('0xf4')](_0x0baf('0x12b'))['toString']():'','disposition':_0x58fea2[_0x0baf('0x12c')],'chatInfo':{'browser':_0x58fea2[_0x0baf('0x12d')],'os':_0x58fea2[_0x0baf('0x12e')],'referer':_0x58fea2[_0x0baf('0x12f')],'customerIp':_0x58fea2[_0x0baf('0x130')],'customerPort':_0x58fea2[_0x0baf('0x131')]?_0x58fea2['customerPort']:_0x0baf('0x132')},'messages':_(_0x58fea2[_0x0baf('0xf8')])[_0x0baf('0x133')]()[_0x0baf('0x9b')]({'secret':![]})[_0x0baf('0x46')](function(_0x1ca912){if(_0x1ca912[_0x0baf('0x126')]){var _0x70e2e=path[_0x0baf('0xed')](_0x1bd67f,_0x1ca912[_0x0baf('0x126')][_0x0baf('0xe9')]);if(fs[_0x0baf('0x134')](_0x70e2e)){fs[_0x0baf('0x135')](_0x70e2e)[_0x0baf('0x136')](fs[_0x0baf('0x137')](path[_0x0baf('0xed')](_0x4316c5,_0x1ca912[_0x0baf('0x126')][_0x0baf('0xe9')])));}}return{'date':moment(_0x1ca912[_0x0baf('0x8f')])[_0x0baf('0xf4')](_0x0baf('0x12b'))[_0x0baf('0xb0')](),'sender':_0x1ca912['direction']===_0x0baf('0xdf')?_0x1ca912[_0x0baf('0xf9')]?_0x1ca912['User']['fullname']:'System':_0x1ca912[_0x0baf('0x7b')]['firstName']+(_0x1ca912['Contact']['lastName']?'\x20'+_0x1ca912[_0x0baf('0x7b')][_0x0baf('0x125')]:''),'body':_0x1ca912[_0x0baf('0x126')]?_0x1ca912['Attachment'][_0x0baf('0xe9')]:_0x1ca912['body'],'direction':_0x1ca912['direction']===_0x0baf('0xdf')?'A':'C','secret':_0x1ca912[_0x0baf('0x105')],'read':_0x1ca912[_0x0baf('0x96')],'attachment':_0x1ca912['Attachment']};})['value']()};return ejs[_0x0baf('0x138')](path[_0x0baf('0xed')](config[_0x0baf('0xee')],_0x0baf('0x121'),_0x0baf('0x139'),_0x0baf('0x13a')),{'interaction':_0x5f5d45})['then'](function(_0x4c1f01){var _0x217cd8=path[_0x0baf('0xed')](_0x4316c5,'transcript-'+_0x58fea2['id']+'-'+_0x20cc18+_0x0baf('0x13b'));var _0x223d32={'path':_0x217cd8,'channel':_0x0baf('0x12a'),'interactionId':_0x58fea2['id']};return pdf[_0x0baf('0x13c')](_0x4c1f01,_0x223d32);})['then'](function(){return new BPromise(function(_0xcca408,_0x557ec9){zipdir(_0x4316c5,{'saveTo':_0x2a84f8},function(_0x479231,_0x320409){if(_0x479231)return _0x557ec9(_0x479231);return _0xcca408(_0x320409);});})['then'](function(){return new BPromise(function(_0x4a0f32,_0xc6fc4d){rimraf(_0x4316c5,function(_0x46b904){if(_0x46b904)_0xc6fc4d(_0x46b904);return _0x4a0f32();});});})['then'](function(){return _0x26d73d[_0x0baf('0xf1')](_0x2a84f8,_0x1d5b73,function(_0x2dea20){if(_0x2dea20){console[_0x0baf('0x13d')](_0x0baf('0x13e'),_0x2dea20);}else{fs[_0x0baf('0x13f')](_0x2a84f8);}});});});}else{return _0x26d73d[_0x0baf('0x2f')](0xc8);}})['catch'](handleError(_0x26d73d,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index 446c824..40db884 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 _0x47de=['getUsers','setDataValue','map','findAll','then','unreadMessages','length','emit','catch','events','ChatInteraction','../../mysqldb','ChatMessage','setMaxListeners','save','update','remove'];(function(_0x1f4995,_0x43c894){var _0x1b6ed6=function(_0x24ac0f){while(--_0x24ac0f){_0x1f4995['push'](_0x1f4995['shift']());}};_0x1b6ed6(++_0x43c894);}(_0x47de,0x1a1));var _0xe47d=function(_0x225d9a,_0x289707){_0x225d9a=_0x225d9a-0x0;var _0x5b8859=_0x47de[_0x225d9a];return _0x5b8859;};'use strict';var EventEmitter=require(_0xe47d('0x0'));var ChatInteraction=require('../../mysqldb')['db'][_0xe47d('0x1')];var ChatMessage=require(_0xe47d('0x2'))['db'][_0xe47d('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xe47d('0x4')](0x0);var events={'afterCreate':_0xe47d('0x5'),'afterUpdate':_0xe47d('0x6'),'afterDestroy':_0xe47d('0x7')};function emitEvent(_0xa9f909){return function(_0x3da759,_0x46633a,_0x191c45){_0x3da759[_0xe47d('0x8')]({'attributes':['id'],'raw':!![]})['then'](function(_0x351a44){_0x3da759[_0xe47d('0x9')]('Users',_0x351a44[_0xe47d('0xa')](function(_0x172a5b){return{'id':_0x172a5b['id']};}));return ChatMessage[_0xe47d('0xb')]({'where':{'ChatInteractionId':_0x3da759['id'],'direction':'in','read':![]},'raw':!![]});})[_0xe47d('0xc')](function(_0x5bb091){_0x3da759[_0xe47d('0x9')](_0xe47d('0xd'),_0x5bb091[_0xe47d('0xe')]);ChatInteractionEvents[_0xe47d('0xf')](_0xa9f909+':'+_0x3da759['id'],_0x3da759);ChatInteractionEvents[_0xe47d('0xf')](_0xa9f909,_0x3da759);_0x191c45(null);})[_0xe47d('0x10')](_0x191c45(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module['exports']=ChatInteractionEvents; \ No newline at end of file +var _0x4ea8=['getUsers','then','setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','exports','events','../../mysqldb','ChatMessage','setMaxListeners','save','update','remove'];(function(_0x35979f,_0xcb2c22){var _0x445384=function(_0x53e700){while(--_0x53e700){_0x35979f['push'](_0x35979f['shift']());}};_0x445384(++_0xcb2c22);}(_0x4ea8,0x107));var _0x84ea=function(_0x376a34,_0x434e46){_0x376a34=_0x376a34-0x0;var _0x35ba39=_0x4ea8[_0x376a34];return _0x35ba39;};'use strict';var EventEmitter=require(_0x84ea('0x0'));var ChatInteraction=require(_0x84ea('0x1'))['db']['ChatInteraction'];var ChatMessage=require(_0x84ea('0x1'))['db'][_0x84ea('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x84ea('0x3')](0x0);var events={'afterCreate':_0x84ea('0x4'),'afterUpdate':_0x84ea('0x5'),'afterDestroy':_0x84ea('0x6')};function emitEvent(_0x2ea2b2){return function(_0x42f617,_0x334641,_0x4596c1){_0x42f617[_0x84ea('0x7')]({'attributes':['id'],'raw':!![]})[_0x84ea('0x8')](function(_0xcd6597){_0x42f617[_0x84ea('0x9')](_0x84ea('0xa'),_0xcd6597[_0x84ea('0xb')](function(_0x2a555b){return{'id':_0x2a555b['id']};}));return ChatMessage[_0x84ea('0xc')]({'where':{'ChatInteractionId':_0x42f617['id'],'direction':'in','read':![]},'raw':!![]});})[_0x84ea('0x8')](function(_0x45b586){_0x42f617['setDataValue'](_0x84ea('0xd'),_0x45b586[_0x84ea('0xe')]);ChatInteractionEvents[_0x84ea('0xf')](_0x2ea2b2+':'+_0x42f617['id'],_0x42f617);ChatInteractionEvents['emit'](_0x2ea2b2,_0x42f617);_0x4596c1(null);})[_0x84ea('0x10')](_0x4596c1(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0x84ea('0x11')]=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index a33eea5..5020015 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 _0xe064=['./chatInteraction.attributes','exports','define','chat_interactions','changed','closed','closedAt','format','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xe064,0x1a7));var _0x4e06=function(_0x9c173a,_0x461c9c){_0x9c173a=_0x9c173a-0x0;var _0x88d611=_0xe064[_0x9c173a];return _0x88d611;};'use strict';var _=require(_0x4e06('0x0'));var util=require(_0x4e06('0x1'));var logger=require(_0x4e06('0x2'))(_0x4e06('0x3'));var moment=require(_0x4e06('0x4'));var BPromise=require(_0x4e06('0x5'));var rp=require(_0x4e06('0x6'));var fs=require('fs');var path=require(_0x4e06('0x7'));var rimraf=require(_0x4e06('0x8'));var config=require('../../config/environment');var attributes=require(_0x4e06('0x9'));module[_0x4e06('0xa')]=function(_0x36217c,_0x13a907){return _0x36217c[_0x4e06('0xb')]('ChatInteraction',attributes,{'tableName':_0x4e06('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2568df,_0x353e2a,_0x25f4be){if(_0x2568df[_0x4e06('0xd')](_0x4e06('0xe'))){_0x2568df[_0x4e06('0xf')]=moment()[_0x4e06('0x10')]('YYYY-MM-DD\x20HH:mm:ss');}_0x25f4be(null,_0x2568df);}},'charset':_0x4e06('0x11'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x69e4=['bluebird','request-promise','path','./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions','changed','closedAt','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment'];(function(_0x109fca,_0x2b848a){var _0x5781ef=function(_0x3ed7ff){while(--_0x3ed7ff){_0x109fca['push'](_0x109fca['shift']());}};_0x5781ef(++_0x2b848a);}(_0x69e4,0x187));var _0x469e=function(_0x58ef68,_0x275204){_0x58ef68=_0x58ef68-0x0;var _0x169a7f=_0x69e4[_0x58ef68];return _0x169a7f;};'use strict';var _=require(_0x469e('0x0'));var util=require(_0x469e('0x1'));var logger=require(_0x469e('0x2'))(_0x469e('0x3'));var moment=require(_0x469e('0x4'));var BPromise=require(_0x469e('0x5'));var rp=require(_0x469e('0x6'));var fs=require('fs');var path=require(_0x469e('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x469e('0x8'));module[_0x469e('0x9')]=function(_0x3c9e66,_0xadb3ad){return _0x3c9e66[_0x469e('0xa')](_0x469e('0xb'),attributes,{'tableName':_0x469e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x17d54d,_0x4eb7da,_0x41230c){if(_0x17d54d[_0x469e('0xd')]('closed')){_0x17d54d[_0x469e('0xe')]=moment()['format'](_0x469e('0xf'));}_0x41230c(null,_0x17d54d);}},'charset':_0x469e('0x10'),'collate':_0x469e('0x11')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index 01aa655..83c511c 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 _0x53d4=['../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','./chatInteraction.socket','register','request','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','UpdateChatInteraction','ChatInteraction','update','body','options','where','attributes','limit','then','debug','AddTagsToChatInteraction','find','addTags','ids','omit','spread','AddTags','catch','lodash','util','randomstring','../../mysqldb','../../config/utils'];(function(_0xb47dc0,_0x407032){var _0x57f0b0=function(_0x11c030){while(--_0x11c030){_0xb47dc0['push'](_0xb47dc0['shift']());}};_0x57f0b0(++_0x407032);}(_0x53d4,0xc8));var _0x453d=function(_0x133c28,_0x37a7a9){_0x133c28=_0x133c28-0x0;var _0x34e64b=_0x53d4[_0x133c28];return _0x34e64b;};'use strict';var _=require(_0x453d('0x0'));var util=require(_0x453d('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x453d('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x453d('0x3'))['db'];var utils=require(_0x453d('0x4'));var logger=require(_0x453d('0x5'))(_0x453d('0x6'));var config=require(_0x453d('0x7'));var jayson=require(_0x453d('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0x453d('0x9')]=_[_0x453d('0xa')](config['redis'],{'host':_0x453d('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x453d('0x9')]));require(_0x453d('0xc'))[_0x453d('0xd')](socket);function respondWithRpcPromise(_0x70883a,_0x2c0404,_0x1a177c){return new BPromise(function(_0xb91b8e,_0x13011a){return client[_0x453d('0xe')](_0x70883a,_0x1a177c)['then'](function(_0xf54366){logger[_0x453d('0xf')](_0x453d('0x10'),_0x2c0404,_0x453d('0x11'));logger['debug'](_0x453d('0x12'),_0x2c0404,'request\x20sent',JSON[_0x453d('0x13')](_0xf54366));if(_0xf54366[_0x453d('0x14')]){if(_0xf54366[_0x453d('0x14')][_0x453d('0x15')]===0x1f4){logger[_0x453d('0x14')](_0x453d('0x10'),_0x2c0404,_0xf54366[_0x453d('0x14')][_0x453d('0x16')]);return _0x13011a(_0xf54366[_0x453d('0x14')][_0x453d('0x16')]);}logger[_0x453d('0x14')]('ChatInteraction,\x20%s,\x20%s',_0x2c0404,_0xf54366[_0x453d('0x14')]['message']);return _0xb91b8e(_0xf54366[_0x453d('0x14')][_0x453d('0x16')]);}else{logger[_0x453d('0xf')](_0x453d('0x10'),_0x2c0404,'request\x20sent');_0xb91b8e(_0xf54366['result'][_0x453d('0x16')]);}})['catch'](function(_0x71d99c){logger[_0x453d('0x14')](_0x453d('0x10'),_0x2c0404,_0x71d99c);_0x13011a(_0x71d99c);});});}exports[_0x453d('0x17')]=function(_0x50de7f){var _0x25f034=this;return new Promise(function(_0x1bcf8d,_0x1d7116){return db[_0x453d('0x18')][_0x453d('0x19')](_0x50de7f[_0x453d('0x1a')],{'raw':_0x50de7f[_0x453d('0x1b')]?_0x50de7f[_0x453d('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x50de7f[_0x453d('0x1b')]?_0x50de7f[_0x453d('0x1b')][_0x453d('0x1c')]||null:null,'attributes':_0x50de7f[_0x453d('0x1b')]?_0x50de7f[_0x453d('0x1b')][_0x453d('0x1d')]||null:null,'limit':_0x50de7f['options']?_0x50de7f[_0x453d('0x1b')][_0x453d('0x1e')]||null:null})[_0x453d('0x1f')](function(_0x41eb81){logger[_0x453d('0xf')]('UpdateChatInteraction',_0x50de7f);logger[_0x453d('0x20')](_0x453d('0x17'),_0x50de7f,JSON['stringify'](_0x41eb81));_0x1bcf8d(_0x41eb81);})['catch'](function(_0x258d14){logger[_0x453d('0x14')](_0x453d('0x17'),_0x258d14[_0x453d('0x16')],_0x50de7f);_0x1d7116(_0x25f034[_0x453d('0x14')](0x1f4,_0x258d14[_0x453d('0x16')]));});});};exports[_0x453d('0x21')]=function(_0x193ade){return new Promise(function(_0x52e49c,_0x39efc1){return db[_0x453d('0x18')][_0x453d('0x22')]({'where':_0x193ade['options']?_0x193ade[_0x453d('0x1b')]['where']||null:null})[_0x453d('0x1f')](function(_0xeb6ae3){if(_0xeb6ae3){return _0xeb6ae3[_0x453d('0x23')](_0x193ade[_0x453d('0x1a')][_0x453d('0x24')],_[_0x453d('0x25')](_0x193ade[_0x453d('0x1a')],[_0x453d('0x24'),'id'])||{});}})[_0x453d('0x26')](function(_0x532c64){logger[_0x453d('0xf')]('AddTags',_0x193ade);logger[_0x453d('0x20')](_0x453d('0x27'),_0x193ade,JSON[_0x453d('0x13')](_0x532c64));_0x52e49c(_0x532c64);})[_0x453d('0x28')](function(_0x494589){logger[_0x453d('0x14')](_0x453d('0x27'),_0x494589[_0x453d('0x16')],_0x193ade);_0x39efc1(_this[_0x453d('0x14')](0x1f4,_0x494589[_0x453d('0x16')]));});});}; \ No newline at end of file +var _0x5ab8=['util','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','http','redis','defaults','socket.io-emitter','register','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','update','body','options','attributes','UpdateChatInteraction','ChatInteraction','spread','AddTags','lodash'];(function(_0x16b7cf,_0x19f08d){var _0x274331=function(_0x4e9e50){while(--_0x4e9e50){_0x16b7cf['push'](_0x16b7cf['shift']());}};_0x274331(++_0x19f08d);}(_0x5ab8,0x175));var _0x85ab=function(_0x2435ed,_0x900355){_0x2435ed=_0x2435ed-0x0;var _0x5852da=_0x5ab8[_0x2435ed];return _0x5852da;};'use strict';var _=require(_0x85ab('0x0'));var util=require(_0x85ab('0x1'));var moment=require(_0x85ab('0x2'));var BPromise=require(_0x85ab('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x85ab('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x85ab('0x5'));var logger=require(_0x85ab('0x6'))('rpc');var config=require(_0x85ab('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x85ab('0x8')]({'port':0x232a});config[_0x85ab('0x9')]=_[_0x85ab('0xa')](config[_0x85ab('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x85ab('0xb'))(new Redis(config['redis']));require('./chatInteraction.socket')[_0x85ab('0xc')](socket);function respondWithRpcPromise(_0x320516,_0x13ddd9,_0x49d897){return new BPromise(function(_0x3f6868,_0x163851){return client[_0x85ab('0xd')](_0x320516,_0x49d897)[_0x85ab('0xe')](function(_0x1a4491){logger[_0x85ab('0xf')](_0x85ab('0x10'),_0x13ddd9,_0x85ab('0x11'));logger[_0x85ab('0x12')](_0x85ab('0x13'),_0x13ddd9,_0x85ab('0x11'),JSON[_0x85ab('0x14')](_0x1a4491));if(_0x1a4491[_0x85ab('0x15')]){if(_0x1a4491[_0x85ab('0x15')][_0x85ab('0x16')]===0x1f4){logger[_0x85ab('0x15')](_0x85ab('0x10'),_0x13ddd9,_0x1a4491[_0x85ab('0x15')][_0x85ab('0x17')]);return _0x163851(_0x1a4491['error'][_0x85ab('0x17')]);}logger['error'](_0x85ab('0x10'),_0x13ddd9,_0x1a4491[_0x85ab('0x15')][_0x85ab('0x17')]);return _0x3f6868(_0x1a4491['error']['message']);}else{logger[_0x85ab('0xf')](_0x85ab('0x10'),_0x13ddd9,'request\x20sent');_0x3f6868(_0x1a4491[_0x85ab('0x18')][_0x85ab('0x17')]);}})[_0x85ab('0x19')](function(_0x5888df){logger[_0x85ab('0x15')](_0x85ab('0x10'),_0x13ddd9,_0x5888df);_0x163851(_0x5888df);});});}exports['UpdateChatInteraction']=function(_0x1a8a6c){var _0x281e2d=this;return new Promise(function(_0x184b6c,_0x10d2fe){return db['ChatInteraction'][_0x85ab('0x1a')](_0x1a8a6c[_0x85ab('0x1b')],{'raw':_0x1a8a6c[_0x85ab('0x1c')]?_0x1a8a6c[_0x85ab('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1a8a6c['options']?_0x1a8a6c['options']['where']||null:null,'attributes':_0x1a8a6c[_0x85ab('0x1c')]?_0x1a8a6c[_0x85ab('0x1c')][_0x85ab('0x1d')]||null:null,'limit':_0x1a8a6c[_0x85ab('0x1c')]?_0x1a8a6c[_0x85ab('0x1c')]['limit']||null:null})[_0x85ab('0xe')](function(_0x2231c9){logger[_0x85ab('0xf')]('UpdateChatInteraction',_0x1a8a6c);logger[_0x85ab('0x12')](_0x85ab('0x1e'),_0x1a8a6c,JSON[_0x85ab('0x14')](_0x2231c9));_0x184b6c(_0x2231c9);})[_0x85ab('0x19')](function(_0x490b32){logger[_0x85ab('0x15')]('UpdateChatInteraction',_0x490b32['message'],_0x1a8a6c);_0x10d2fe(_0x281e2d[_0x85ab('0x15')](0x1f4,_0x490b32[_0x85ab('0x17')]));});});};exports['AddTagsToChatInteraction']=function(_0x385b27){return new Promise(function(_0xe9745f,_0xafe5b6){return db[_0x85ab('0x1f')]['find']({'where':_0x385b27[_0x85ab('0x1c')]?_0x385b27[_0x85ab('0x1c')]['where']||null:null})[_0x85ab('0xe')](function(_0x4a960d){if(_0x4a960d){return _0x4a960d['addTags'](_0x385b27[_0x85ab('0x1b')]['ids'],_['omit'](_0x385b27[_0x85ab('0x1b')],['ids','id'])||{});}})[_0x85ab('0x20')](function(_0x3175cd){logger[_0x85ab('0xf')]('AddTags',_0x385b27);logger[_0x85ab('0x12')]('AddTags',_0x385b27,JSON['stringify'](_0x3175cd));_0xe9745f(_0x3175cd);})[_0x85ab('0x19')](function(_0x22bd8c){logger[_0x85ab('0x15')](_0x85ab('0x21'),_0x22bd8c[_0x85ab('0x17')],_0x385b27);_0xafe5b6(_this['error'](0x1f4,_0x22bd8c[_0x85ab('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index 20f494c..95cafc9 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 _0xeb6c=['update','emit','removeListener','length','chatInteraction:','./chatInteraction.events','save','remove'];(function(_0x34d677,_0x434206){var _0x452303=function(_0xd3836){while(--_0xd3836){_0x34d677['push'](_0x34d677['shift']());}};_0x452303(++_0x434206);}(_0xeb6c,0x85));var _0xceb6=function(_0x5efaac,_0x15dd05){_0x5efaac=_0x5efaac-0x0;var _0x142221=_0xeb6c[_0x5efaac];return _0x142221;};'use strict';var ChatInteractionEvents=require(_0xceb6('0x0'));var events=[_0xceb6('0x1'),_0xceb6('0x2'),_0xceb6('0x3')];function createListener(_0x25a035,_0x16a36e){return function(_0x9f4e9e){_0x16a36e[_0xceb6('0x4')](_0x25a035,_0x9f4e9e);};}function removeListener(_0x34689d,_0x30b90e){return function(){ChatInteractionEvents[_0xceb6('0x5')](_0x34689d,_0x30b90e);};}exports['register']=function(_0x349b66){for(var _0x4984e2=0x0,_0x34a2e2=events[_0xceb6('0x6')];_0x4984e2<_0x34a2e2;_0x4984e2++){var _0x439b39=events[_0x4984e2];var _0x35e98f=createListener(_0xceb6('0x7')+_0x439b39,_0x349b66);ChatInteractionEvents['on'](_0x439b39,_0x35e98f);}}; \ No newline at end of file +var _0xd5a2=['chatInteraction:','save','remove','update','removeListener','register'];(function(_0x454c08,_0x91a425){var _0x5ef9b0=function(_0x3c4d43){while(--_0x3c4d43){_0x454c08['push'](_0x454c08['shift']());}};_0x5ef9b0(++_0x91a425);}(_0xd5a2,0x79));var _0x2d5a=function(_0x31c9c1,_0x4648f0){_0x31c9c1=_0x31c9c1-0x0;var _0x5cf0b2=_0xd5a2[_0x31c9c1];return _0x5cf0b2;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=[_0x2d5a('0x0'),_0x2d5a('0x1'),_0x2d5a('0x2')];function createListener(_0x2cdb1b,_0x15638d){return function(_0x3ac9b0){_0x15638d['emit'](_0x2cdb1b,_0x3ac9b0);};}function removeListener(_0x2d0408,_0x5f5c46){return function(){ChatInteractionEvents[_0x2d5a('0x3')](_0x2d0408,_0x5f5c46);};}exports[_0x2d5a('0x4')]=function(_0x3b3db4){for(var _0x5d152e=0x0,_0x30b0ff=events['length'];_0x5d152e<_0x30b0ff;_0x5d152e++){var _0x847944=events[_0x5d152e];var _0x333bbe=createListener(_0x2d5a('0x5')+_0x847944,_0x3b3db4);ChatInteractionEvents['on'](_0x847944,_0x333bbe);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index 8e7efff..7216ca2 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 _0xe883=['server/files/attachments/','format','%s-%s','now','originalname','replace','single','file','attachmentUpload','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','put','/:id','chatinteraction:update','customUpdate','/:id/abandon','abandon','/:id/close','close','chatinteraction:destroy','removeTags','exports','connect-timeout','../../components/auth/service','./chatInteraction.controller','isAuthenticated','index','get','/describe','isChatInteractionAuthorized','show','/:id/attachment_download','/:id/messages','getMessages','/:id/my_messages','download','post','createVidaooSession','diskStorage','join','root'];(function(_0x4a095b,_0x561d99){var _0x2f5394=function(_0xeeb84c){while(--_0xeeb84c){_0x4a095b['push'](_0x4a095b['shift']());}};_0x2f5394(++_0x561d99);}(_0xe883,0xfb));var _0x3e88=function(_0x26f702,_0x3919bf){_0x26f702=_0x26f702-0x0;var _0x11417d=_0xe883[_0x26f702];return _0x11417d;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x3e88('0x0'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x3e88('0x1'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x3e88('0x2'));router['get']('/',auth[_0x3e88('0x3')](),controller[_0x3e88('0x4')]);router[_0x3e88('0x5')](_0x3e88('0x6'),auth[_0x3e88('0x3')](),controller['describe']);router[_0x3e88('0x5')]('/:id',auth[_0x3e88('0x7')](),controller[_0x3e88('0x8')]);router[_0x3e88('0x5')](_0x3e88('0x9'),auth['isChatInteractionAuthorized'](),controller['attachmentDownload']);router[_0x3e88('0x5')](_0x3e88('0xa'),auth[_0x3e88('0x3')](),controller[_0x3e88('0xb')]);router['get'](_0x3e88('0xc'),auth[_0x3e88('0x7')](),controller['getMyMessages']);router['get']('/:id/download',auth[_0x3e88('0x3')](),controller[_0x3e88('0xd')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x3e88('0xe')]('/:id/vidaoo',auth[_0x3e88('0x3')](),controller[_0x3e88('0xf')]);var upload=multer({'storage':multer[_0x3e88('0x10')]({'destination':function(_0x2514e2,_0x45826f,_0x331033){_0x331033(null,path[_0x3e88('0x11')](config[_0x3e88('0x12')],_0x3e88('0x13')));},'filename':function(_0x2e77f0,_0x3b5f1b,_0x4a5de5){_0x4a5de5(null,util[_0x3e88('0x14')](_0x3e88('0x15'),Date[_0x3e88('0x16')](),_0x3b5f1b[_0x3e88('0x17')][_0x3e88('0x18')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x3e88('0xe')]('/:id/attachment_upload',upload[_0x3e88('0x19')](_0x3e88('0x1a')),controller[_0x3e88('0x1b')]);router[_0x3e88('0xe')](_0x3e88('0xa'),auth[_0x3e88('0x7')](),controller[_0x3e88('0x1c')]);router[_0x3e88('0xe')](_0x3e88('0x1d'),auth[_0x3e88('0x3')](),interaction[_0x3e88('0x1e')](_0x3e88('0x1f'),_0x3e88('0x20')),controller[_0x3e88('0x21')]);router[_0x3e88('0x22')](_0x3e88('0x23'),auth[_0x3e88('0x3')](),interaction[_0x3e88('0x1e')]('chat',_0x3e88('0x24')),controller['update']);router['put']('/:id/custom_update',controller[_0x3e88('0x25')]);router[_0x3e88('0x22')](_0x3e88('0x26'),auth[_0x3e88('0x7')](),controller[_0x3e88('0x27')]);router['put'](_0x3e88('0x28'),controller[_0x3e88('0x29')]);router['delete'](_0x3e88('0x23'),auth['isAuthenticated'](),interaction[_0x3e88('0x1e')](_0x3e88('0x1f'),_0x3e88('0x2a')),controller['destroy']);router['delete']('/:id/tags',auth[_0x3e88('0x3')](),controller[_0x3e88('0x2b')]);module[_0x3e88('0x2c')]=router; \ No newline at end of file +var _0xcf54=['replace','attachmentUpload','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','chatinteraction:update','update','put','/:id/custom_update','/:id/abandon','close','delete','removeTags','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','index','/describe','isAuthenticated','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','/:id/download','download','post','create','/:id/vidaoo','join','server/files/attachments/','format','%s-%s','originalname'];(function(_0x40cafc,_0xb54650){var _0x24b614=function(_0x5e0ca8){while(--_0x5e0ca8){_0x40cafc['push'](_0x40cafc['shift']());}};_0x24b614(++_0xb54650);}(_0xcf54,0xd4));var _0x4cf5=function(_0x81dcac,_0x8ff7db){_0x81dcac=_0x81dcac-0x0;var _0xc7803b=_0xcf54[_0x81dcac];return _0xc7803b;};'use strict';var multer=require(_0x4cf5('0x0'));var util=require(_0x4cf5('0x1'));var path=require('path');var timeout=require(_0x4cf5('0x2'));var express=require(_0x4cf5('0x3'));var router=express[_0x4cf5('0x4')]();var fs_extra=require(_0x4cf5('0x5'));var auth=require(_0x4cf5('0x6'));var interaction=require(_0x4cf5('0x7'));var config=require(_0x4cf5('0x8'));var controller=require(_0x4cf5('0x9'));router[_0x4cf5('0xa')]('/',auth['isAuthenticated'](),controller[_0x4cf5('0xb')]);router[_0x4cf5('0xa')](_0x4cf5('0xc'),auth[_0x4cf5('0xd')](),controller[_0x4cf5('0xe')]);router[_0x4cf5('0xa')](_0x4cf5('0xf'),auth[_0x4cf5('0x10')](),controller[_0x4cf5('0x11')]);router[_0x4cf5('0xa')](_0x4cf5('0x12'),auth[_0x4cf5('0x10')](),controller[_0x4cf5('0x13')]);router['get'](_0x4cf5('0x14'),auth[_0x4cf5('0xd')](),controller[_0x4cf5('0x15')]);router[_0x4cf5('0xa')](_0x4cf5('0x16'),auth[_0x4cf5('0x10')](),controller['getMyMessages']);router['get'](_0x4cf5('0x17'),auth[_0x4cf5('0xd')](),controller[_0x4cf5('0x18')]);router[_0x4cf5('0x19')]('/',auth['isAuthenticated'](),controller[_0x4cf5('0x1a')]);router['post'](_0x4cf5('0x1b'),auth['isAuthenticated'](),controller['createVidaooSession']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5c059b,_0x38d32d,_0xb6c66e){_0xb6c66e(null,path[_0x4cf5('0x1c')](config['root'],_0x4cf5('0x1d')));},'filename':function(_0x1b9e07,_0x3112fb,_0x18f94f){_0x18f94f(null,util[_0x4cf5('0x1e')](_0x4cf5('0x1f'),Date['now'](),_0x3112fb[_0x4cf5('0x20')][_0x4cf5('0x21')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x4cf5('0x19')]('/:id/attachment_upload',upload['single']('file'),controller[_0x4cf5('0x22')]);router[_0x4cf5('0x19')](_0x4cf5('0x14'),auth[_0x4cf5('0x10')](),controller['addMessage']);router[_0x4cf5('0x19')](_0x4cf5('0x23'),auth[_0x4cf5('0xd')](),interaction[_0x4cf5('0x24')](_0x4cf5('0x25'),_0x4cf5('0x26')),controller[_0x4cf5('0x27')]);router['put'](_0x4cf5('0xf'),auth[_0x4cf5('0xd')](),interaction[_0x4cf5('0x24')](_0x4cf5('0x25'),_0x4cf5('0x28')),controller[_0x4cf5('0x29')]);router[_0x4cf5('0x2a')](_0x4cf5('0x2b'),controller['customUpdate']);router['put'](_0x4cf5('0x2c'),auth[_0x4cf5('0x10')](),controller['abandon']);router[_0x4cf5('0x2a')]('/:id/close',controller[_0x4cf5('0x2d')]);router['delete'](_0x4cf5('0xf'),auth['isAuthenticated'](),interaction['tracked'](_0x4cf5('0x25'),'chatinteraction:destroy'),controller['destroy']);router[_0x4cf5('0x2e')]('/:id/tags',auth[_0x4cf5('0xd')](),controller[_0x4cf5('0x2f')]);module[_0x4cf5('0x30')]=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index 757f449..d8df8ef 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 _0x1f37=['sequelize','medium','BOOLEAN'];(function(_0x42e7ce,_0x812fb3){var _0x2e35a8=function(_0x463be8){while(--_0x463be8){_0x42e7ce['push'](_0x42e7ce['shift']());}};_0x2e35a8(++_0x812fb3);}(_0x1f37,0x16e));var _0x71f3=function(_0xf71120,_0x25b7f9){_0xf71120=_0xf71120-0x0;var _0xbe2fd3=_0x1f37[_0xf71120];return _0xbe2fd3;};'use strict';var Sequelize=require(_0x71f3('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0x71f3('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x71f3('0x2')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x39ea=['medium','BOOLEAN','sequelize'];(function(_0x57cf27,_0x5e705c){var _0xfbb453=function(_0x52be41){while(--_0x52be41){_0x57cf27['push'](_0x57cf27['shift']());}};_0xfbb453(++_0x5e705c);}(_0x39ea,0xe3));var _0xa39e=function(_0x4db016,_0x39d40d){_0x4db016=_0x4db016-0x0;var _0x16554f=_0x39ea[_0x4db016];return _0x16554f;};'use strict';var Sequelize=require(_0xa39e('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0xa39e('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0xa39e('0x2')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index 7af69d7..33bcfa0 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 _0x732c=['moment','bluebird','mustache','util','path','sox','lodash','crypto','jsforce','desk.js','to-csv','querystring','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','redis','defaults','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','end','json','undefined','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','ChatInternalMessage','rawAttributes','fieldName','type','key','model','map','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','get','messages','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','admin','user','fullname','role','userpic','internal','online','lastLoginAt','allowmessenger','-online','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','Agents','autoAssociation','UserProfileResource','resourceId','push','FromId','ToId','read','-createdAt','all','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x386e7c,_0x3cf6b9){var _0x16b2b0=function(_0x191952){while(--_0x191952){_0x386e7c['push'](_0x386e7c['shift']());}};_0x16b2b0(++_0x3cf6b9);}(_0x732c,0x1b4));var _0xc732=function(_0x3e96f6,_0x427022){_0x3e96f6=_0x3e96f6-0x0;var _0x454296=_0x732c[_0x3e96f6];return _0x454296;};'use strict';var emlformat=require(_0xc732('0x0'));var rimraf=require(_0xc732('0x1'));var zipdir=require(_0xc732('0x2'));var jsonpatch=require(_0xc732('0x3'));var rp=require('request-promise');var moment=require(_0xc732('0x4'));var BPromise=require(_0xc732('0x5'));var Mustache=require(_0xc732('0x6'));var util=require(_0xc732('0x7'));var path=require(_0xc732('0x8'));var sox=require(_0xc732('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc732('0xa'));var squel=require('squel');var crypto=require(_0xc732('0xb'));var jsforce=require(_0xc732('0xc'));var deskjs=require(_0xc732('0xd'));var toCsv=require(_0xc732('0xe'));var querystring=require(_0xc732('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xc732('0x10'));var hardwareService=require(_0xc732('0x11'));var logger=require(_0xc732('0x12'))('api');var utils=require(_0xc732('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xc732('0x14'))['db'];config[_0xc732('0x15')]=_[_0xc732('0x16')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xc732('0x17'))(new Redis(config[_0xc732('0x15')]));require(_0xc732('0x18'))[_0xc732('0x19')](socket);function respondWithStatusCode(_0x37be2a,_0xb2c875){_0xb2c875=_0xb2c875||0xcc;return function(_0x41b586){if(_0x41b586){return _0x37be2a[_0xc732('0x1a')](_0xb2c875);}return _0x37be2a[_0xc732('0x1b')](_0xb2c875)[_0xc732('0x1c')]();};}function respondWithResult(_0x10c29c,_0x23f8d8){_0x23f8d8=_0x23f8d8||0xc8;return function(_0x2b349d){if(_0x2b349d){return _0x10c29c[_0xc732('0x1b')](_0x23f8d8)[_0xc732('0x1d')](_0x2b349d);}};}function respondWithFilteredResult(_0x521b20,_0x45d683){return function(_0x2719bf){if(_0x2719bf){var _0x29d7c4=typeof _0x45d683['offset']===_0xc732('0x1e')&&typeof _0x45d683['limit']===_0xc732('0x1e');var _0x12d74b=_0x2719bf[_0xc732('0x1f')];var _0x5c8ff7=_0x29d7c4?0x0:_0x45d683[_0xc732('0x20')];var _0x4d7639=_0x29d7c4?_0x2719bf[_0xc732('0x1f')]:_0x45d683[_0xc732('0x20')]+_0x45d683[_0xc732('0x21')];var _0x48b692;if(_0x4d7639>=_0x12d74b){_0x4d7639=_0x12d74b;_0x48b692=0xc8;}else{_0x48b692=0xce;}_0x521b20['status'](_0x48b692);return _0x521b20[_0xc732('0x22')](_0xc732('0x23'),_0x5c8ff7+'-'+_0x4d7639+'/'+_0x12d74b)['json'](_0x2719bf);}return null;};}function patchUpdates(_0x28b253){return function(_0x2caae6){try{jsonpatch[_0xc732('0x24')](_0x2caae6,_0x28b253,!![]);}catch(_0x5d31c4){return BPromise[_0xc732('0x25')](_0x5d31c4);}return _0x2caae6[_0xc732('0x26')]();};}function saveUpdates(_0xffa310,_0x5be607){return function(_0x2b57e8){if(_0x2b57e8){return _0x2b57e8[_0xc732('0x27')](_0xffa310)[_0xc732('0x28')](function(_0x8ed855){return _0x8ed855;});}return null;};}function removeEntity(_0x4d8c19,_0x1f21a9){return function(_0xdcf377){if(_0xdcf377){return _0xdcf377[_0xc732('0x29')]()[_0xc732('0x28')](function(){_0x4d8c19['status'](0xcc)[_0xc732('0x1c')]();});}};}function handleEntityNotFound(_0x5d1602,_0x2a00ed){return function(_0x4313f3){if(!_0x4313f3){_0x5d1602[_0xc732('0x1a')](0x194);}return _0x4313f3;};}function handleError(_0x19d3ca,_0x1cdb76){_0x1cdb76=_0x1cdb76||0x1f4;return function(_0x13e283){logger['error'](_0x13e283[_0xc732('0x2a')]);if(_0x13e283[_0xc732('0x2b')]){delete _0x13e283[_0xc732('0x2b')];}_0x19d3ca[_0xc732('0x1b')](_0x1cdb76)[_0xc732('0x2c')](_0x13e283);};}exports['index']=function(_0x4091b0,_0x27ec43){var _0x273168={},_0x35904c={},_0x4169af={'count':0x0,'rows':[]};var _0x3b2ae1=_['map'](db[_0xc732('0x2d')][_0xc732('0x2e')],function(_0xf2f6ce){return{'name':_0xf2f6ce[_0xc732('0x2f')],'type':_0xf2f6ce[_0xc732('0x30')][_0xc732('0x31')]};});_0x35904c[_0xc732('0x32')]=_[_0xc732('0x33')](_0x3b2ae1,_0xc732('0x2b'));_0x35904c['query']=_[_0xc732('0x34')](_0x4091b0[_0xc732('0x35')]);_0x35904c['filters']=_[_0xc732('0x36')](_0x35904c['model'],_0x35904c['query']);_0x273168[_0xc732('0x37')]=_[_0xc732('0x36')](_0x35904c[_0xc732('0x32')],qs[_0xc732('0x38')](_0x4091b0[_0xc732('0x35')][_0xc732('0x38')]));_0x273168[_0xc732('0x37')]=_0x273168[_0xc732('0x37')][_0xc732('0x39')]?_0x273168[_0xc732('0x37')]:_0x35904c[_0xc732('0x32')];if(!_0x4091b0['query'][_0xc732('0x3a')](_0xc732('0x3b'))){_0x273168[_0xc732('0x21')]=qs[_0xc732('0x21')](_0x4091b0[_0xc732('0x35')][_0xc732('0x21')]);_0x273168[_0xc732('0x20')]=qs[_0xc732('0x20')](_0x4091b0[_0xc732('0x35')]['offset']);}_0x273168['order']=qs[_0xc732('0x3c')](_0x4091b0[_0xc732('0x35')][_0xc732('0x3c')]);_0x273168[_0xc732('0x3d')]=qs[_0xc732('0x3e')](_[_0xc732('0x3f')](_0x4091b0[_0xc732('0x35')],_0x35904c[_0xc732('0x3e')]),_0x3b2ae1);if(_0x4091b0['query'][_0xc732('0x40')]){_0x273168['where']=_['merge'](_0x273168[_0xc732('0x3d')],{'$or':_[_0xc732('0x33')](_0x3b2ae1,function(_0x17816c){if(_0x17816c[_0xc732('0x30')]!=='VIRTUAL'){var _0xdf1fed={};_0xdf1fed[_0x17816c['name']]={'$like':'%'+_0x4091b0['query'][_0xc732('0x40')]+'%'};return _0xdf1fed;}})});}_0x273168=_['merge']({},_0x273168,_0x4091b0[_0xc732('0x41')]);var _0x4ba138={'where':_0x273168[_0xc732('0x3d')]};return db['ChatInternalMessage'][_0xc732('0x1f')](_0x4ba138)[_0xc732('0x28')](function(_0x242cd9){_0x4169af[_0xc732('0x1f')]=_0x242cd9;if(_0x4091b0[_0xc732('0x35')][_0xc732('0x42')]){_0x273168[_0xc732('0x43')]=[{'all':!![]}];}return db[_0xc732('0x2d')][_0xc732('0x44')](_0x273168);})['then'](function(_0x92ca5f){_0x4169af[_0xc732('0x45')]=_0x92ca5f;return _0x4169af;})['then'](respondWithFilteredResult(_0x27ec43,_0x273168))[_0xc732('0x46')](handleError(_0x27ec43,null));};exports[_0xc732('0x47')]=function(_0x1a5b97,_0x40892d){var _0x42757e={'raw':!![],'where':{'id':_0x1a5b97[_0xc732('0x48')]['id']}},_0x218960={};_0x218960[_0xc732('0x32')]=_[_0xc732('0x34')](db[_0xc732('0x2d')][_0xc732('0x2e')]);_0x218960[_0xc732('0x35')]=_[_0xc732('0x34')](_0x1a5b97[_0xc732('0x35')]);_0x218960[_0xc732('0x3e')]=_['intersection'](_0x218960[_0xc732('0x32')],_0x218960['query']);_0x42757e['attributes']=_['intersection'](_0x218960[_0xc732('0x32')],qs[_0xc732('0x38')](_0x1a5b97['query']['fields']));_0x42757e[_0xc732('0x37')]=_0x42757e[_0xc732('0x37')][_0xc732('0x39')]?_0x42757e['attributes']:_0x218960[_0xc732('0x32')];if(_0x1a5b97[_0xc732('0x35')][_0xc732('0x42')]){_0x42757e[_0xc732('0x43')]=[{'all':!![]}];}_0x42757e=_['merge']({},_0x42757e,_0x1a5b97['options']);return db[_0xc732('0x2d')][_0xc732('0x49')](_0x42757e)[_0xc732('0x28')](handleEntityNotFound(_0x40892d,null))[_0xc732('0x28')](respondWithResult(_0x40892d,null))[_0xc732('0x46')](handleError(_0x40892d,null));};exports[_0xc732('0x4a')]=function(_0x50335e,_0x3d4677){return db[_0xc732('0x2d')]['create'](_0x50335e[_0xc732('0x4b')],{})[_0xc732('0x28')](respondWithResult(_0x3d4677,0xc9))['catch'](handleError(_0x3d4677,null));};exports[_0xc732('0x27')]=function(_0x2a4ee8,_0x4e4173){if(_0x2a4ee8['body']['id']){delete _0x2a4ee8['body']['id'];}return db[_0xc732('0x2d')][_0xc732('0x49')]({'where':{'id':_0x2a4ee8['params']['id']}})[_0xc732('0x28')](handleEntityNotFound(_0x4e4173,null))[_0xc732('0x28')](saveUpdates(_0x2a4ee8[_0xc732('0x4b')],null))[_0xc732('0x28')](respondWithResult(_0x4e4173,null))['catch'](handleError(_0x4e4173,null));};exports['destroy']=function(_0x5be00e,_0x273ecb){return db['ChatInternalMessage'][_0xc732('0x49')]({'where':{'id':_0x5be00e[_0xc732('0x48')]['id']}})['then'](handleEntityNotFound(_0x273ecb,null))[_0xc732('0x28')](removeEntity(_0x273ecb,null))[_0xc732('0x46')](handleError(_0x273ecb,null));};exports['describe']=function(_0x19e28b,_0x46c7bf){return db['ChatInternalMessage'][_0xc732('0x4c')]()[_0xc732('0x28')](respondWithResult(_0x46c7bf,null))[_0xc732('0x46')](handleError(_0x46c7bf,null));};function wrapUser(_0xc7f5ef){return function(_0x547934){var _0xb06ee9=_0xc7f5ef[_0xc732('0x4d')]({'plain':!![]});_0xb06ee9[_0xc732('0x4e')]=[];if(_0x547934){_0xb06ee9[_0xc732('0x4f')]=_0x547934[_0xc732('0x50')];_0xb06ee9[_0xc732('0x51')]=_0x547934;}else{_0xb06ee9[_0xc732('0x4f')]=moment(0x0)[_0xc732('0x52')](_0xc732('0x53'));_0xb06ee9[_0xc732('0x51')]={};}return _0xb06ee9;};}exports[_0xc732('0x54')]=function(_0x869538,_0x3c37c2,_0x25661e){var _0x4d77cd=[];return db[_0xc732('0x55')]['findAll']({'where':{'role':[_0xc732('0x56'),_0xc732('0x57'),_0xc732('0x58')]},'attributes':['id',_0xc732('0x59'),_0xc732('0x2b'),_0xc732('0x5a'),_0xc732('0x5b'),_0xc732('0x5c'),_0xc732('0x5d'),_0xc732('0x5e'),_0xc732('0x5f'),'showWebBar'],'order':qs['sort'](_0xc732('0x60')),'include':[{'model':db[_0xc732('0x61')],'as':_0xc732('0x62'),'attributes':['id',_0xc732('0x2b'),_0xc732('0x30')],'through':{'attributes':[]}}]})[_0xc732('0x28')](function(_0x3c73f0){if(_0x3c73f0){var _0x30a860=_0x869538[_0xc732('0x58')][_0xc732('0x4d')]({'plain':!![]});if(!_0x30a860)throw new Error(_0xc732('0x63'));if(_0x30a860['role']===_0xc732('0x58')){return db['UserProfileSection'][_0xc732('0x49')]({'where':{'name':_0xc732('0x64'),'userProfileId':_0x30a860['userProfileId']},'raw':!![]})['then'](function(_0x360052){if(_0x360052){if(_0x360052[_0xc732('0x65')]===0x0){return db[_0xc732('0x66')]['findAll']({'where':{'sectionId':_0x360052['id']},'raw':!![]})[_0xc732('0x28')](function(_0x587d0d){var _0x31775e=[];if(_['isEmpty'](_0x587d0d)){_0x31775e=_[_0xc732('0x40')](_0x3c73f0,function(_0x3fab79){if(_0x3fab79[_0xc732('0x5a')]!=='agent'){return _0x3fab79;}});return _0x31775e;}else{for(var _0x1bf2cb=0x0;_0x1bf2cb<_0x3c73f0['length'];_0x1bf2cb++){var _0x3b3cae=_0x3c73f0[_0x1bf2cb];if(_0x3b3cae[_0xc732('0x5a')]===_0xc732('0x56')){var _0x2e4adb=_[_0xc732('0x49')](_0x587d0d,function(_0x34ee62){return _0x34ee62[_0xc732('0x67')]===_0x3b3cae['id'];});if(_0x2e4adb)_0x31775e[_0xc732('0x68')](_0x3b3cae);}else{_0x31775e['push'](_0x3b3cae);}}return _0x31775e;}});}else{return _0x3c73f0;}}else{var _0x5a5a45=_[_0xc732('0x40')](_0x3c73f0,function(_0x54a1e0){if(_0x54a1e0[_0xc732('0x5a')]!==_0xc732('0x56')){return _0x54a1e0;}});return _0x5a5a45;}});}else{return _0x3c73f0;}}})[_0xc732('0x28')](function(_0xf07b58){var _0x29bbd9=[];if(_0xf07b58){_0x4d77cd=_0xf07b58;for(var _0x28bfc9=0x0;_0x28bfc9<_0xf07b58[_0xc732('0x39')];_0x28bfc9+=0x1){_0x4d77cd[_0x28bfc9]['messages']=[];_0x29bbd9[_0xc732('0x68')](db['ChatInternalMessage']['find']({'where':{'FromId':[_0x869538['user']['id'],_0xf07b58[_0x28bfc9]['id']],'ToId':[_0x869538[_0xc732('0x58')]['id'],_0xf07b58[_0x28bfc9]['id']],'ChatGroupId':null},'attributes':['id',_0xc732('0x50'),_0xc732('0x69'),_0xc732('0x6a'),_0xc732('0x6b'),_0xc732('0x4b')],'order':qs[_0xc732('0x3c')](_0xc732('0x6c')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xc732('0x28')](wrapUser(_0xf07b58[_0x28bfc9])));}return BPromise[_0xc732('0x6d')](_0x29bbd9);}return[];})['then'](function(_0x28d978){return{'rows':_0x28d978,'count':_0x28d978['length']};})[_0xc732('0x28')](respondWithResult(_0x3c37c2,null))['catch'](handleError(_0x3c37c2,null));}; \ No newline at end of file +var _0x05c7=['length','hasOwnProperty','nolimit','sort','where','pick','merge','type','VIRTUAL','options','includeAll','findAll','catch','params','include','find','create','body','describe','messages','createdAt','lastMessage','lastMessageAt','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','user','fullname','role','internal','online','lastLoginAt','showWebBar','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','autoAssociation','isEmpty','filter','resourceId','push','FromId','ToId','-createdAt','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','save','update','then','destroy','error','stack','name','map','ChatInternalMessage','rawAttributes','fieldName','key','query','keys','filters','intersection','model','fields','attributes'];(function(_0x4f862c,_0xcd428e){var _0x357200=function(_0x3ce787){while(--_0x3ce787){_0x4f862c['push'](_0x4f862c['shift']());}};_0x357200(++_0xcd428e);}(_0x05c7,0x1e4));var _0x705c=function(_0x319fa0,_0x31377a){_0x319fa0=_0x319fa0-0x0;var _0x464fee=_0x05c7[_0x319fa0];return _0x464fee;};'use strict';var emlformat=require(_0x705c('0x0'));var rimraf=require(_0x705c('0x1'));var zipdir=require(_0x705c('0x2'));var jsonpatch=require(_0x705c('0x3'));var rp=require(_0x705c('0x4'));var moment=require(_0x705c('0x5'));var BPromise=require(_0x705c('0x6'));var Mustache=require(_0x705c('0x7'));var util=require(_0x705c('0x8'));var path=require('path');var sox=require(_0x705c('0x9'));var csv=require(_0x705c('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x705c('0xb'));var _=require(_0x705c('0xc'));var squel=require(_0x705c('0xd'));var crypto=require(_0x705c('0xe'));var jsforce=require(_0x705c('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x705c('0x10'));var Papa=require(_0x705c('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x705c('0x12'));var as=require(_0x705c('0x13'));var hardwareService=require(_0x705c('0x14'));var logger=require(_0x705c('0x15'))('api');var utils=require(_0x705c('0x16'));var config=require(_0x705c('0x17'));var licenseUtil=require(_0x705c('0x18'));var db=require(_0x705c('0x19'))['db'];config[_0x705c('0x1a')]=_[_0x705c('0x1b')](config[_0x705c('0x1a')],{'host':_0x705c('0x1c'),'port':0x18eb});var socket=require(_0x705c('0x1d'))(new Redis(config[_0x705c('0x1a')]));require(_0x705c('0x1e'))['register'](socket);function respondWithStatusCode(_0x279d0a,_0xb99aee){_0xb99aee=_0xb99aee||0xcc;return function(_0x434478){if(_0x434478){return _0x279d0a[_0x705c('0x1f')](_0xb99aee);}return _0x279d0a[_0x705c('0x20')](_0xb99aee)[_0x705c('0x21')]();};}function respondWithResult(_0x1d274e,_0xc862cc){_0xc862cc=_0xc862cc||0xc8;return function(_0x395206){if(_0x395206){return _0x1d274e['status'](_0xc862cc)[_0x705c('0x22')](_0x395206);}};}function respondWithFilteredResult(_0x58886a,_0x4ab7aa){return function(_0x553f20){if(_0x553f20){var _0x5e22f6=typeof _0x4ab7aa['offset']===_0x705c('0x23')&&typeof _0x4ab7aa[_0x705c('0x24')]===_0x705c('0x23');var _0x42868b=_0x553f20[_0x705c('0x25')];var _0x2365f7=_0x5e22f6?0x0:_0x4ab7aa[_0x705c('0x26')];var _0x239fbb=_0x5e22f6?_0x553f20[_0x705c('0x25')]:_0x4ab7aa[_0x705c('0x26')]+_0x4ab7aa[_0x705c('0x24')];var _0x27d088;if(_0x239fbb>=_0x42868b){_0x239fbb=_0x42868b;_0x27d088=0xc8;}else{_0x27d088=0xce;}_0x58886a[_0x705c('0x20')](_0x27d088);return _0x58886a[_0x705c('0x27')]('Content-Range',_0x2365f7+'-'+_0x239fbb+'/'+_0x42868b)[_0x705c('0x22')](_0x553f20);}return null;};}function patchUpdates(_0x4117bc){return function(_0x5cafb5){try{jsonpatch[_0x705c('0x28')](_0x5cafb5,_0x4117bc,!![]);}catch(_0x18398f){return BPromise[_0x705c('0x29')](_0x18398f);}return _0x5cafb5[_0x705c('0x2a')]();};}function saveUpdates(_0x2891cf,_0x38d3a1){return function(_0x2cd7b0){if(_0x2cd7b0){return _0x2cd7b0[_0x705c('0x2b')](_0x2891cf)[_0x705c('0x2c')](function(_0x4c3238){return _0x4c3238;});}return null;};}function removeEntity(_0x2971f9,_0x5a3b1f){return function(_0x5b65e8){if(_0x5b65e8){return _0x5b65e8[_0x705c('0x2d')]()[_0x705c('0x2c')](function(){_0x2971f9[_0x705c('0x20')](0xcc)[_0x705c('0x21')]();});}};}function handleEntityNotFound(_0x26372a,_0x462c68){return function(_0x7a5f50){if(!_0x7a5f50){_0x26372a[_0x705c('0x1f')](0x194);}return _0x7a5f50;};}function handleError(_0x109ae1,_0x3daaa6){_0x3daaa6=_0x3daaa6||0x1f4;return function(_0x292912){logger[_0x705c('0x2e')](_0x292912[_0x705c('0x2f')]);if(_0x292912[_0x705c('0x30')]){delete _0x292912[_0x705c('0x30')];}_0x109ae1[_0x705c('0x20')](_0x3daaa6)['send'](_0x292912);};}exports['index']=function(_0x266a85,_0x24975b){var _0x5c08a9={},_0x5c59db={},_0x2b0e96={'count':0x0,'rows':[]};var _0x3e9cb6=_[_0x705c('0x31')](db[_0x705c('0x32')][_0x705c('0x33')],function(_0x3f971f){return{'name':_0x3f971f[_0x705c('0x34')],'type':_0x3f971f['type'][_0x705c('0x35')]};});_0x5c59db['model']=_[_0x705c('0x31')](_0x3e9cb6,'name');_0x5c59db[_0x705c('0x36')]=_[_0x705c('0x37')](_0x266a85[_0x705c('0x36')]);_0x5c59db[_0x705c('0x38')]=_[_0x705c('0x39')](_0x5c59db[_0x705c('0x3a')],_0x5c59db[_0x705c('0x36')]);_0x5c08a9['attributes']=_[_0x705c('0x39')](_0x5c59db['model'],qs[_0x705c('0x3b')](_0x266a85[_0x705c('0x36')][_0x705c('0x3b')]));_0x5c08a9[_0x705c('0x3c')]=_0x5c08a9[_0x705c('0x3c')][_0x705c('0x3d')]?_0x5c08a9['attributes']:_0x5c59db[_0x705c('0x3a')];if(!_0x266a85[_0x705c('0x36')][_0x705c('0x3e')](_0x705c('0x3f'))){_0x5c08a9['limit']=qs['limit'](_0x266a85[_0x705c('0x36')][_0x705c('0x24')]);_0x5c08a9[_0x705c('0x26')]=qs[_0x705c('0x26')](_0x266a85['query']['offset']);}_0x5c08a9['order']=qs['sort'](_0x266a85[_0x705c('0x36')][_0x705c('0x40')]);_0x5c08a9[_0x705c('0x41')]=qs[_0x705c('0x38')](_[_0x705c('0x42')](_0x266a85[_0x705c('0x36')],_0x5c59db[_0x705c('0x38')]),_0x3e9cb6);if(_0x266a85['query']['filter']){_0x5c08a9[_0x705c('0x41')]=_[_0x705c('0x43')](_0x5c08a9['where'],{'$or':_['map'](_0x3e9cb6,function(_0x2cf1ec){if(_0x2cf1ec[_0x705c('0x44')]!==_0x705c('0x45')){var _0x3d6d53={};_0x3d6d53[_0x2cf1ec['name']]={'$like':'%'+_0x266a85[_0x705c('0x36')]['filter']+'%'};return _0x3d6d53;}})});}_0x5c08a9=_['merge']({},_0x5c08a9,_0x266a85[_0x705c('0x46')]);var _0x472624={'where':_0x5c08a9[_0x705c('0x41')]};return db[_0x705c('0x32')][_0x705c('0x25')](_0x472624)[_0x705c('0x2c')](function(_0x319285){_0x2b0e96[_0x705c('0x25')]=_0x319285;if(_0x266a85[_0x705c('0x36')][_0x705c('0x47')]){_0x5c08a9['include']=[{'all':!![]}];}return db[_0x705c('0x32')][_0x705c('0x48')](_0x5c08a9);})[_0x705c('0x2c')](function(_0x502f52){_0x2b0e96['rows']=_0x502f52;return _0x2b0e96;})[_0x705c('0x2c')](respondWithFilteredResult(_0x24975b,_0x5c08a9))[_0x705c('0x49')](handleError(_0x24975b,null));};exports['show']=function(_0x4a083f,_0x180a11){var _0x2b244c={'raw':!![],'where':{'id':_0x4a083f[_0x705c('0x4a')]['id']}},_0x42379e={};_0x42379e[_0x705c('0x3a')]=_['keys'](db[_0x705c('0x32')][_0x705c('0x33')]);_0x42379e['query']=_['keys'](_0x4a083f[_0x705c('0x36')]);_0x42379e[_0x705c('0x38')]=_[_0x705c('0x39')](_0x42379e[_0x705c('0x3a')],_0x42379e[_0x705c('0x36')]);_0x2b244c[_0x705c('0x3c')]=_['intersection'](_0x42379e[_0x705c('0x3a')],qs[_0x705c('0x3b')](_0x4a083f[_0x705c('0x36')][_0x705c('0x3b')]));_0x2b244c[_0x705c('0x3c')]=_0x2b244c[_0x705c('0x3c')]['length']?_0x2b244c['attributes']:_0x42379e[_0x705c('0x3a')];if(_0x4a083f[_0x705c('0x36')][_0x705c('0x47')]){_0x2b244c[_0x705c('0x4b')]=[{'all':!![]}];}_0x2b244c=_['merge']({},_0x2b244c,_0x4a083f[_0x705c('0x46')]);return db[_0x705c('0x32')][_0x705c('0x4c')](_0x2b244c)[_0x705c('0x2c')](handleEntityNotFound(_0x180a11,null))[_0x705c('0x2c')](respondWithResult(_0x180a11,null))[_0x705c('0x49')](handleError(_0x180a11,null));};exports[_0x705c('0x4d')]=function(_0x2dd835,_0x3134e7){return db[_0x705c('0x32')][_0x705c('0x4d')](_0x2dd835[_0x705c('0x4e')],{})[_0x705c('0x2c')](respondWithResult(_0x3134e7,0xc9))[_0x705c('0x49')](handleError(_0x3134e7,null));};exports[_0x705c('0x2b')]=function(_0x49843b,_0x41ca11){if(_0x49843b[_0x705c('0x4e')]['id']){delete _0x49843b['body']['id'];}return db[_0x705c('0x32')][_0x705c('0x4c')]({'where':{'id':_0x49843b[_0x705c('0x4a')]['id']}})[_0x705c('0x2c')](handleEntityNotFound(_0x41ca11,null))[_0x705c('0x2c')](saveUpdates(_0x49843b[_0x705c('0x4e')],null))['then'](respondWithResult(_0x41ca11,null))['catch'](handleError(_0x41ca11,null));};exports[_0x705c('0x2d')]=function(_0x15bc4a,_0x19d15c){return db['ChatInternalMessage']['find']({'where':{'id':_0x15bc4a[_0x705c('0x4a')]['id']}})['then'](handleEntityNotFound(_0x19d15c,null))[_0x705c('0x2c')](removeEntity(_0x19d15c,null))[_0x705c('0x49')](handleError(_0x19d15c,null));};exports['describe']=function(_0xa256ab,_0x32a292){return db[_0x705c('0x32')][_0x705c('0x4f')]()[_0x705c('0x2c')](respondWithResult(_0x32a292,null))[_0x705c('0x49')](handleError(_0x32a292,null));};function wrapUser(_0x11ce09){return function(_0x3b3d47){var _0x327009=_0x11ce09['get']({'plain':!![]});_0x327009[_0x705c('0x50')]=[];if(_0x3b3d47){_0x327009['lastMessageAt']=_0x3b3d47[_0x705c('0x51')];_0x327009[_0x705c('0x52')]=_0x3b3d47;}else{_0x327009[_0x705c('0x53')]=moment(0x0)[_0x705c('0x54')](_0x705c('0x55'));_0x327009['lastMessage']={};}return _0x327009;};}exports[_0x705c('0x56')]=function(_0x2a3b25,_0xf9b3a9,_0x338525){var _0x128894=[];return db[_0x705c('0x57')][_0x705c('0x48')]({'where':{'role':['agent','admin',_0x705c('0x58')]},'attributes':['id',_0x705c('0x59'),_0x705c('0x30'),_0x705c('0x5a'),'userpic',_0x705c('0x5b'),_0x705c('0x5c'),_0x705c('0x5d'),'allowmessenger',_0x705c('0x5e')],'order':qs[_0x705c('0x40')]('-online'),'include':[{'model':db[_0x705c('0x5f')],'as':_0x705c('0x60'),'attributes':['id',_0x705c('0x30'),_0x705c('0x44')],'through':{'attributes':[]}}]})[_0x705c('0x2c')](function(_0x37e4fc){if(_0x37e4fc){var _0xaf1646=_0x2a3b25['user']['get']({'plain':!![]});if(!_0xaf1646)throw new Error(_0x705c('0x61'));if(_0xaf1646[_0x705c('0x5a')]===_0x705c('0x58')){return db[_0x705c('0x62')]['find']({'where':{'name':_0x705c('0x63'),'userProfileId':_0xaf1646[_0x705c('0x64')]},'raw':!![]})[_0x705c('0x2c')](function(_0x483320){if(_0x483320){if(_0x483320[_0x705c('0x65')]===0x0){return db['UserProfileResource']['findAll']({'where':{'sectionId':_0x483320['id']},'raw':!![]})[_0x705c('0x2c')](function(_0x47af6f){var _0x41b6be=[];if(_[_0x705c('0x66')](_0x47af6f)){_0x41b6be=_[_0x705c('0x67')](_0x37e4fc,function(_0x53d2fa){if(_0x53d2fa[_0x705c('0x5a')]!=='agent'){return _0x53d2fa;}});return _0x41b6be;}else{for(var _0x3c81fc=0x0;_0x3c81fc<_0x37e4fc[_0x705c('0x3d')];_0x3c81fc++){var _0xaabfd=_0x37e4fc[_0x3c81fc];if(_0xaabfd[_0x705c('0x5a')]==='agent'){var _0x352e91=_[_0x705c('0x4c')](_0x47af6f,function(_0x42f2ae){return _0x42f2ae[_0x705c('0x68')]===_0xaabfd['id'];});if(_0x352e91)_0x41b6be[_0x705c('0x69')](_0xaabfd);}else{_0x41b6be[_0x705c('0x69')](_0xaabfd);}}return _0x41b6be;}});}else{return _0x37e4fc;}}else{var _0x33fc6c=_['filter'](_0x37e4fc,function(_0x166206){if(_0x166206[_0x705c('0x5a')]!=='agent'){return _0x166206;}});return _0x33fc6c;}});}else{return _0x37e4fc;}}})[_0x705c('0x2c')](function(_0x24fd45){var _0x9dbb3a=[];if(_0x24fd45){_0x128894=_0x24fd45;for(var _0x3c64d4=0x0;_0x3c64d4<_0x24fd45[_0x705c('0x3d')];_0x3c64d4+=0x1){_0x128894[_0x3c64d4]['messages']=[];_0x9dbb3a[_0x705c('0x69')](db['ChatInternalMessage'][_0x705c('0x4c')]({'where':{'FromId':[_0x2a3b25['user']['id'],_0x24fd45[_0x3c64d4]['id']],'ToId':[_0x2a3b25[_0x705c('0x58')]['id'],_0x24fd45[_0x3c64d4]['id']],'ChatGroupId':null},'attributes':['id',_0x705c('0x51'),_0x705c('0x6a'),_0x705c('0x6b'),'read','body'],'order':qs['sort'](_0x705c('0x6c')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x705c('0x2c')](wrapUser(_0x24fd45[_0x3c64d4])));}return BPromise['all'](_0x9dbb3a);}return[];})['then'](function(_0x4247b4){return{'rows':_0x4247b4,'count':_0x4247b4['length']};})['then'](respondWithResult(_0xf9b3a9,null))['catch'](handleError(_0xf9b3a9,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index af1d364..963d237 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 _0xff7c=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x4f295e,_0xa0e6b9){var _0x276fd5=function(_0x52fec9){while(--_0x52fec9){_0x4f295e['push'](_0x4f295e['shift']());}};_0x276fd5(++_0xa0e6b9);}(_0xff7c,0x1d4));var _0xcff7=function(_0x2adbeb,_0x5581be){_0x2adbeb=_0x2adbeb-0x0;var _0x5e18a6=_0xff7c[_0x2adbeb];return _0x5e18a6;};'use strict';var EventEmitter=require(_0xcff7('0x0'));var ChatInternalMessage=require(_0xcff7('0x1'))['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xcff7('0x2')](0x0);var events={'afterCreate':_0xcff7('0x3'),'afterUpdate':_0xcff7('0x4'),'afterDestroy':_0xcff7('0x5')};function emitEvent(_0x4c06dc){return function(_0x5a8ff2,_0x19739b,_0x513d1b){ChatInternalMessageEvents['emit'](_0x4c06dc+':'+_0x5a8ff2['id'],_0x5a8ff2);ChatInternalMessageEvents[_0xcff7('0x6')](_0x4c06dc,_0x5a8ff2);_0x513d1b(null);};}for(var e in events){if(events[_0xcff7('0x7')](e)){var event=events[e];ChatInternalMessage[_0xcff7('0x8')](e,emitEvent(event));}}module[_0xcff7('0x9')]=ChatInternalMessageEvents; \ No newline at end of file +var _0x5c21=['../../mysqldb','ChatInternalMessage','setMaxListeners','save','remove','emit','hasOwnProperty','exports'];(function(_0x351e27,_0x530335){var _0x197477=function(_0x4da285){while(--_0x4da285){_0x351e27['push'](_0x351e27['shift']());}};_0x197477(++_0x530335);}(_0x5c21,0x90));var _0x15c2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5c21[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0x15c2('0x0'))['db'][_0x15c2('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x15c2('0x2')](0x0);var events={'afterCreate':_0x15c2('0x3'),'afterUpdate':'update','afterDestroy':_0x15c2('0x4')};function emitEvent(_0x159d71){return function(_0x42629e,_0x17a2a7,_0x19000d){ChatInternalMessageEvents[_0x15c2('0x5')](_0x159d71+':'+_0x42629e['id'],_0x42629e);ChatInternalMessageEvents['emit'](_0x159d71,_0x42629e);_0x19000d(null);};}for(var e in events){if(events[_0x15c2('0x6')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0x15c2('0x7')]=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index c8af305..16a20b3 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 _0xe61e=['util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x22e0f2,_0x1e029a){var _0x54fafc=function(_0x3e9071){while(--_0x3e9071){_0x22e0f2['push'](_0x22e0f2['shift']());}};_0x54fafc(++_0x1e029a);}(_0xe61e,0xef));var _0xee61=function(_0x21d1c7,_0x335222){_0x21d1c7=_0x21d1c7-0x0;var _0xdb87b0=_0xe61e[_0x21d1c7];return _0xdb87b0;};'use strict';var _=require(_0xee61('0x0'));var util=require(_0xee61('0x1'));var logger=require(_0xee61('0x2'))('api');var moment=require(_0xee61('0x3'));var BPromise=require(_0xee61('0x4'));var rp=require(_0xee61('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xee61('0x6'));var config=require(_0xee61('0x7'));var attributes=require(_0xee61('0x8'));module[_0xee61('0x9')]=function(_0x57b6d1,_0x230eaf){return _0x57b6d1[_0xee61('0xa')](_0xee61('0xb'),attributes,{'tableName':_0xee61('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xee61('0xd'),'collate':_0xee61('0xe')});}; \ No newline at end of file +var _0x229e=['lodash','util','api','moment','request-promise','path','rimraf','../../config/environment','define','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci'];(function(_0x3f6cd0,_0x5e8c51){var _0x5e3e05=function(_0x583f38){while(--_0x583f38){_0x3f6cd0['push'](_0x3f6cd0['shift']());}};_0x5e3e05(++_0x5e8c51);}(_0x229e,0xa8));var _0xe229=function(_0x5373e8,_0x29efa3){_0x5373e8=_0x5373e8-0x0;var _0x38c2d3=_0x229e[_0x5373e8];return _0x38c2d3;};'use strict';var _=require(_0xe229('0x0'));var util=require(_0xe229('0x1'));var logger=require('../../config/logger')(_0xe229('0x2'));var moment=require(_0xe229('0x3'));var BPromise=require('bluebird');var rp=require(_0xe229('0x4'));var fs=require('fs');var path=require(_0xe229('0x5'));var rimraf=require(_0xe229('0x6'));var config=require(_0xe229('0x7'));var attributes=require('./chatInternalMessage.attributes');module['exports']=function(_0x5ba24c,_0x3c6759){return _0x5ba24c[_0xe229('0x8')]('ChatInternalMessage',attributes,{'tableName':_0xe229('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe229('0xa'),'collate':_0xe229('0xb')});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index 0d30bcd..ed73370 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 _0xe644=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','register','then','ChatInternalMessage,\x20%s,\x20%s','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x82e939,_0x3b4198){var _0x575d90=function(_0x23f1e9){while(--_0x23f1e9){_0x82e939['push'](_0x82e939['shift']());}};_0x575d90(++_0x3b4198);}(_0xe644,0x159));var _0x4e64=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe644[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x4e64('0x0'));var util=require(_0x4e64('0x1'));var moment=require(_0x4e64('0x2'));var BPromise=require(_0x4e64('0x3'));var rs=require(_0x4e64('0x4'));var fs=require('fs');var Redis=require(_0x4e64('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x4e64('0x6'));var logger=require(_0x4e64('0x7'))(_0x4e64('0x8'));var config=require(_0x4e64('0x9'));var jayson=require(_0x4e64('0xa'));var client=jayson[_0x4e64('0xb')]['http']({'port':0x232a});config[_0x4e64('0xc')]=_[_0x4e64('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x4e64('0xe'))(new Redis(config['redis']));require('./chatInternalMessage.socket')[_0x4e64('0xf')](socket);function respondWithRpcPromise(_0x43ba47,_0x4323bb,_0x30ed02){return new BPromise(function(_0x21d454,_0xcbcafb){return client['request'](_0x43ba47,_0x30ed02)[_0x4e64('0x10')](function(_0x1b2b5f){logger['info'](_0x4e64('0x11'),_0x4323bb,'request\x20sent');logger['debug'](_0x4e64('0x12'),_0x4323bb,'request\x20sent',JSON[_0x4e64('0x13')](_0x1b2b5f));if(_0x1b2b5f[_0x4e64('0x14')]){if(_0x1b2b5f[_0x4e64('0x14')][_0x4e64('0x15')]===0x1f4){logger[_0x4e64('0x14')](_0x4e64('0x11'),_0x4323bb,_0x1b2b5f[_0x4e64('0x14')]['message']);return _0xcbcafb(_0x1b2b5f[_0x4e64('0x14')][_0x4e64('0x16')]);}logger[_0x4e64('0x14')]('ChatInternalMessage,\x20%s,\x20%s',_0x4323bb,_0x1b2b5f[_0x4e64('0x14')][_0x4e64('0x16')]);return _0x21d454(_0x1b2b5f[_0x4e64('0x14')][_0x4e64('0x16')]);}else{logger[_0x4e64('0x17')](_0x4e64('0x11'),_0x4323bb,_0x4e64('0x18'));_0x21d454(_0x1b2b5f[_0x4e64('0x19')][_0x4e64('0x16')]);}})[_0x4e64('0x1a')](function(_0x54d0ca){logger[_0x4e64('0x14')](_0x4e64('0x11'),_0x4323bb,_0x54d0ca);_0xcbcafb(_0x54d0ca);});});} \ No newline at end of file +var _0x4680=['rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','./chatInternalMessage.socket','register','then','info','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatInternalMessage,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0xde11a1,_0x3b934f){var _0x2aaabb=function(_0x4bd90b){while(--_0x4bd90b){_0xde11a1['push'](_0xde11a1['shift']());}};_0x2aaabb(++_0x3b934f);}(_0x4680,0x106));var _0x0468=function(_0x5151fa,_0x5a3183){_0x5151fa=_0x5151fa-0x0;var _0x11c315=_0x4680[_0x5151fa];return _0x11c315;};'use strict';var _=require(_0x0468('0x0'));var util=require(_0x0468('0x1'));var moment=require(_0x0468('0x2'));var BPromise=require(_0x0468('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0468('0x4'));var db=require(_0x0468('0x5'))['db'];var utils=require(_0x0468('0x6'));var logger=require(_0x0468('0x7'))(_0x0468('0x8'));var config=require(_0x0468('0x9'));var jayson=require(_0x0468('0xa'));var client=jayson[_0x0468('0xb')][_0x0468('0xc')]({'port':0x232a});config['redis']=_[_0x0468('0xd')](config[_0x0468('0xe')],{'host':_0x0468('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0468('0xe')]));require(_0x0468('0x10'))[_0x0468('0x11')](socket);function respondWithRpcPromise(_0x352ba2,_0x21bc87,_0x4c3723){return new BPromise(function(_0x32e53f,_0x401709){return client['request'](_0x352ba2,_0x4c3723)[_0x0468('0x12')](function(_0x4fef6a){logger[_0x0468('0x13')]('ChatInternalMessage,\x20%s,\x20%s',_0x21bc87,_0x0468('0x14'));logger[_0x0468('0x15')](_0x0468('0x16'),_0x21bc87,_0x0468('0x14'),JSON[_0x0468('0x17')](_0x4fef6a));if(_0x4fef6a[_0x0468('0x18')]){if(_0x4fef6a[_0x0468('0x18')][_0x0468('0x19')]===0x1f4){logger[_0x0468('0x18')](_0x0468('0x1a'),_0x21bc87,_0x4fef6a[_0x0468('0x18')][_0x0468('0x1b')]);return _0x401709(_0x4fef6a['error'][_0x0468('0x1b')]);}logger[_0x0468('0x18')]('ChatInternalMessage,\x20%s,\x20%s',_0x21bc87,_0x4fef6a[_0x0468('0x18')][_0x0468('0x1b')]);return _0x32e53f(_0x4fef6a[_0x0468('0x18')][_0x0468('0x1b')]);}else{logger['info'](_0x0468('0x1a'),_0x21bc87,_0x0468('0x14'));_0x32e53f(_0x4fef6a[_0x0468('0x1c')][_0x0468('0x1b')]);}})[_0x0468('0x1d')](function(_0xd17aab){logger[_0x0468('0x18')]('ChatInternalMessage,\x20%s,\x20%s',_0x21bc87,_0xd17aab);_0x401709(_0xd17aab);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index b498cf0..275fcc6 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 _0xb2f5=['remove','update','emit','removeListener','register','length','chatInternalMessage:','save'];(function(_0x243158,_0x554df0){var _0x142fa9=function(_0x23b2e5){while(--_0x23b2e5){_0x243158['push'](_0x243158['shift']());}};_0x142fa9(++_0x554df0);}(_0xb2f5,0x1e7));var _0x5b2f=function(_0xd09668,_0x1435b2){_0xd09668=_0xd09668-0x0;var _0x68726=_0xb2f5[_0xd09668];return _0x68726;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=[_0x5b2f('0x0'),_0x5b2f('0x1'),_0x5b2f('0x2')];function createListener(_0x86bf65,_0x1bee99){return function(_0x147dd1){_0x1bee99[_0x5b2f('0x3')](_0x86bf65,_0x147dd1);};}function removeListener(_0x1add8d,_0x73957d){return function(){ChatInternalMessageEvents[_0x5b2f('0x4')](_0x1add8d,_0x73957d);};}exports[_0x5b2f('0x5')]=function(_0x2db5fc){for(var _0x1e97bb=0x0,_0x524aa3=events[_0x5b2f('0x6')];_0x1e97bb<_0x524aa3;_0x1e97bb++){var _0x471e71=events[_0x1e97bb];var _0x5d2287=createListener(_0x5b2f('0x7')+_0x471e71,_0x2db5fc);ChatInternalMessageEvents['on'](_0x471e71,_0x5d2287);}}; \ No newline at end of file +var _0xcfa6=['./chatInternalMessage.events','save','update','length','chatInternalMessage:'];(function(_0x12a5a7,_0x3f04d4){var _0x5e868e=function(_0x221c26){while(--_0x221c26){_0x12a5a7['push'](_0x12a5a7['shift']());}};_0x5e868e(++_0x3f04d4);}(_0xcfa6,0x9b));var _0x6cfa=function(_0x3ff454,_0x564d83){_0x3ff454=_0x3ff454-0x0;var _0x40f602=_0xcfa6[_0x3ff454];return _0x40f602;};'use strict';var ChatInternalMessageEvents=require(_0x6cfa('0x0'));var events=[_0x6cfa('0x1'),'remove',_0x6cfa('0x2')];function createListener(_0xf11ac9,_0xdd5cc9){return function(_0x2c43c8){_0xdd5cc9['emit'](_0xf11ac9,_0x2c43c8);};}function removeListener(_0x52b8bb,_0x4b5026){return function(){ChatInternalMessageEvents['removeListener'](_0x52b8bb,_0x4b5026);};}exports['register']=function(_0x1e5f05){for(var _0x2026d6=0x0,_0x52812c=events[_0x6cfa('0x3')];_0x2026d6<_0x52812c;_0x2026d6++){var _0x3367cd=events[_0x2026d6];var _0x25ca15=createListener(_0x6cfa('0x4')+_0x3367cd,_0x1e5f05);ChatInternalMessageEvents['on'](_0x3367cd,_0x25ca15);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index 4a68a76..0daba8f 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 _0xb19e=['show','create','put','update','delete','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','describe','/users','getUsers','/:id'];(function(_0x17f50e,_0xdc24a){var _0x365e53=function(_0x373c66){while(--_0x373c66){_0x17f50e['push'](_0x17f50e['shift']());}};_0x365e53(++_0xdc24a);}(_0xb19e,0x92));var _0xeb19=function(_0x555069,_0x23d66a){_0x555069=_0x555069-0x0;var _0x100af7=_0xb19e[_0x555069];return _0x100af7;};'use strict';var multer=require(_0xeb19('0x0'));var util=require(_0xeb19('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xeb19('0x2'));var router=express[_0xeb19('0x3')]();var fs_extra=require(_0xeb19('0x4'));var auth=require(_0xeb19('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xeb19('0x6'));var controller=require(_0xeb19('0x7'));router[_0xeb19('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xeb19('0x8')]('/describe',auth[_0xeb19('0x9')](),controller[_0xeb19('0xa')]);router[_0xeb19('0x8')](_0xeb19('0xb'),auth['isAuthenticated'](),controller[_0xeb19('0xc')]);router['get'](_0xeb19('0xd'),auth[_0xeb19('0x9')](),controller[_0xeb19('0xe')]);router['post']('/',auth[_0xeb19('0x9')](),controller[_0xeb19('0xf')]);router[_0xeb19('0x10')](_0xeb19('0xd'),controller[_0xeb19('0x11')]);router[_0xeb19('0x12')](_0xeb19('0xd'),auth[_0xeb19('0x9')](),controller['destroy']);module[_0xeb19('0x13')]=router; \ No newline at end of file +var _0xbd61=['destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','describe','post','create','put','update','/:id'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0xbd61,0xc9));var _0x1bd6=function(_0x46a535,_0x861afb){_0x46a535=_0x46a535-0x0;var _0x1ae880=_0xbd61[_0x46a535];return _0x1ae880;};'use strict';var multer=require(_0x1bd6('0x0'));var util=require(_0x1bd6('0x1'));var path=require(_0x1bd6('0x2'));var timeout=require(_0x1bd6('0x3'));var express=require(_0x1bd6('0x4'));var router=express[_0x1bd6('0x5')]();var fs_extra=require(_0x1bd6('0x6'));var auth=require(_0x1bd6('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x1bd6('0x8'));var controller=require('./chatInternalMessage.controller');router[_0x1bd6('0x9')]('/',auth[_0x1bd6('0xa')](),controller[_0x1bd6('0xb')]);router[_0x1bd6('0x9')](_0x1bd6('0xc'),auth['isAuthenticated'](),controller[_0x1bd6('0xd')]);router[_0x1bd6('0x9')]('/users',auth[_0x1bd6('0xa')](),controller['getUsers']);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0x1bd6('0xe')]('/',auth[_0x1bd6('0xa')](),controller[_0x1bd6('0xf')]);router[_0x1bd6('0x10')]('/:id',controller[_0x1bd6('0x11')]);router['delete'](_0x1bd6('0x12'),auth[_0x1bd6('0xa')](),controller[_0x1bd6('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index 0eeb9f6..3c9a65c 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 _0x5eef=['TEXT','BOOLEAN','ENUM','out','DATE','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5eef,0x9c));var _0xf5ee=function(_0x1f1e4b,_0x9892de){_0x1f1e4b=_0x1f1e4b-0x0;var _0x56a635=_0x5eef[_0x1f1e4b];return _0x56a635;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize[_0xf5ee('0x0')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xf5ee('0x1')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xf5ee('0x2')]('in',_0xf5ee('0x3')),'defaultValue':_0xf5ee('0x3'),'allowNull':![]},'readAt':{'type':Sequelize[_0xf5ee('0x4')]},'providerName':{'type':Sequelize[_0xf5ee('0x5')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x6f59=['BOOLEAN','ENUM','out','DATE','STRING','sequelize','exports','TEXT','medium'];(function(_0x18752c,_0x2c1351){var _0x2d9a23=function(_0x228785){while(--_0x228785){_0x18752c['push'](_0x18752c['shift']());}};_0x2d9a23(++_0x2c1351);}(_0x6f59,0x1be));var _0x96f5=function(_0x4fb523,_0x3960de){_0x4fb523=_0x4fb523-0x0;var _0x297105=_0x6f59[_0x4fb523];return _0x297105;};'use strict';var Sequelize=require(_0x96f5('0x0'));module[_0x96f5('0x1')]={'body':{'type':Sequelize[_0x96f5('0x2')](_0x96f5('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x96f5('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0x96f5('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x96f5('0x5')]('in',_0x96f5('0x6')),'defaultValue':_0x96f5('0x6'),'allowNull':![]},'readAt':{'type':Sequelize[_0x96f5('0x7')]},'providerName':{'type':Sequelize[_0x96f5('0x8')]},'providerResponse':{'type':Sequelize[_0x96f5('0x2')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index 3ebcdf5..18b22c3 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 _0xc8c4=['[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','contact','User','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','parse','ChatInteraction','ChatInteractionId','rejectMessage','QueryTypes','SELECT','fullname','eml-format','fast-json-patch','request-promise','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','../../config/license/util','redis','defaults','localhost','./chatMessage.socket','client','request','then','info','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','ChatMessage,\x20%s,\x20%s','message','result','catch','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','update','destroy','status','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','fields','length','hasOwnProperty','order','sort','filter','where','merge','VIRTUAL','options','ChatMessage','includeAll','include','findAll','rows','show','params','intersection','create','body','find','accept','chat','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','read1stAt','interaction'];(function(_0x1af7b8,_0xe3c8c7){var _0x480ef8=function(_0xa92b89){while(--_0xa92b89){_0x1af7b8['push'](_0x1af7b8['shift']());}};_0x480ef8(++_0xe3c8c7);}(_0xc8c4,0x193));var _0x4c8c=function(_0x20a573,_0x3328b4){_0x20a573=_0x20a573-0x0;var _0x399adf=_0xc8c4[_0x20a573];return _0x399adf;};'use strict';var emlformat=require(_0x4c8c('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x4c8c('0x1'));var rp=require(_0x4c8c('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4c8c('0x3'));var path=require(_0x4c8c('0x4'));var sox=require(_0x4c8c('0x5'));var csv=require(_0x4c8c('0x6'));var ejs=require(_0x4c8c('0x7'));var fs=require('fs');var fs_extra=require(_0x4c8c('0x8'));var _=require('lodash');var squel=require(_0x4c8c('0x9'));var crypto=require(_0x4c8c('0xa'));var jsforce=require(_0x4c8c('0xb'));var deskjs=require(_0x4c8c('0xc'));var toCsv=require('to-csv');var querystring=require(_0x4c8c('0xd'));var Papa=require(_0x4c8c('0xe'));var Redis=require(_0x4c8c('0xf'));var authService=require(_0x4c8c('0x10'));var qs=require(_0x4c8c('0x11'));var as=require(_0x4c8c('0x12'));var hardwareService=require(_0x4c8c('0x13'));var logger=require(_0x4c8c('0x14'))(_0x4c8c('0x15'));var utils=require('../../config/utils');var config=require(_0x4c8c('0x16'));var licenseUtil=require(_0x4c8c('0x17'));var db=require('../../mysqldb')['db'];config[_0x4c8c('0x18')]=_[_0x4c8c('0x19')](config[_0x4c8c('0x18')],{'host':_0x4c8c('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4c8c('0x18')]));require(_0x4c8c('0x1b'))['register'](socket);var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0x4c8c('0x1c')]['http']({'port':0x232a});function respondWithRpcPromise(_0xce524,_0x83c1f0,_0x407229,_0x150030){return new BPromise(function(_0x208ce1,_0x1071ff){var _0x5784b2=_0x150030||client;return _0x5784b2[_0x4c8c('0x1d')](_0xce524,_0x407229)[_0x4c8c('0x1e')](function(_0x2d4347){logger[_0x4c8c('0x1f')]('ChatMessage,\x20%s,\x20%s',_0x83c1f0,_0x4c8c('0x20'));logger[_0x4c8c('0x21')](_0x4c8c('0x22'),_0x83c1f0,_0x4c8c('0x20'),JSON[_0x4c8c('0x23')](_0x2d4347));if(_0x2d4347[_0x4c8c('0x24')]){if(_0x2d4347[_0x4c8c('0x24')]['code']===0x1f4){logger[_0x4c8c('0x24')](_0x4c8c('0x25'),_0x83c1f0,_0x2d4347[_0x4c8c('0x24')][_0x4c8c('0x26')]);return _0x1071ff(_0x2d4347['error']['message']);}logger[_0x4c8c('0x24')](_0x4c8c('0x25'),_0x83c1f0,_0x2d4347[_0x4c8c('0x24')][_0x4c8c('0x26')]);return _0x208ce1(_0x2d4347[_0x4c8c('0x24')][_0x4c8c('0x26')]);}else{logger[_0x4c8c('0x1f')](_0x4c8c('0x25'),_0x83c1f0,'request\x20sent');_0x208ce1(_0x2d4347[_0x4c8c('0x27')]['message']);}})[_0x4c8c('0x28')](function(_0x4f805d){logger[_0x4c8c('0x24')](_0x4c8c('0x25'),_0x83c1f0,_0x4f805d);_0x1071ff(_0x4f805d);});});}function respondWithStatusCode(_0x5be6b0,_0x38035c){_0x38035c=_0x38035c||0xcc;return function(_0x99359b){if(_0x99359b){return _0x5be6b0['sendStatus'](_0x38035c);}return _0x5be6b0['status'](_0x38035c)[_0x4c8c('0x29')]();};}function respondWithResult(_0xbaec20,_0x385e59){_0x385e59=_0x385e59||0xc8;return function(_0x585b4e){if(_0x585b4e){return _0xbaec20['status'](_0x385e59)[_0x4c8c('0x2a')](_0x585b4e);}};}function respondWithFilteredResult(_0xe8f3d,_0x1bfb16){return function(_0x268a04){if(_0x268a04){var _0x31e20e=typeof _0x1bfb16['offset']==='undefined'&&typeof _0x1bfb16[_0x4c8c('0x2b')]===_0x4c8c('0x2c');var _0x412891=_0x268a04[_0x4c8c('0x2d')];var _0x100774=_0x31e20e?0x0:_0x1bfb16['offset'];var _0x44326d=_0x31e20e?_0x268a04[_0x4c8c('0x2d')]:_0x1bfb16[_0x4c8c('0x2e')]+_0x1bfb16['limit'];var _0x488a7d;if(_0x44326d>=_0x412891){_0x44326d=_0x412891;_0x488a7d=0xc8;}else{_0x488a7d=0xce;}_0xe8f3d['status'](_0x488a7d);return _0xe8f3d[_0x4c8c('0x2f')](_0x4c8c('0x30'),_0x100774+'-'+_0x44326d+'/'+_0x412891)['json'](_0x268a04);}return null;};}function patchUpdates(_0x12b5e9){return function(_0x3f9b12){try{jsonpatch[_0x4c8c('0x31')](_0x3f9b12,_0x12b5e9,!![]);}catch(_0x70bec0){return BPromise[_0x4c8c('0x32')](_0x70bec0);}return _0x3f9b12[_0x4c8c('0x33')]();};}function saveUpdates(_0x55a809,_0x53c074){return function(_0x15574a){if(_0x15574a){return _0x15574a[_0x4c8c('0x34')](_0x55a809)[_0x4c8c('0x1e')](function(_0x2b78a4){return _0x2b78a4;});}return null;};}function removeEntity(_0x2bfd1b,_0x5bced3){return function(_0x24074f){if(_0x24074f){return _0x24074f[_0x4c8c('0x35')]()['then'](function(){_0x2bfd1b[_0x4c8c('0x36')](0xcc)[_0x4c8c('0x29')]();});}};}function handleEntityNotFound(_0xf672fa,_0x134be7){return function(_0x5c1b96){if(!_0x5c1b96){_0xf672fa['sendStatus'](0x194);}return _0x5c1b96;};}function handleError(_0x524a78,_0x49f072){_0x49f072=_0x49f072||0x1f4;return function(_0x4bd144){logger['error'](_0x4bd144[_0x4c8c('0x37')]);if(_0x4bd144[_0x4c8c('0x38')]){delete _0x4bd144[_0x4c8c('0x38')];}_0x524a78['status'](_0x49f072)[_0x4c8c('0x39')](_0x4bd144);};}exports[_0x4c8c('0x3a')]=function(_0x26828e,_0x4460f6){var _0x524825={},_0x2403d2={},_0xbe6ca0={'count':0x0,'rows':[]};var _0x4a483c=_[_0x4c8c('0x3b')](db['ChatMessage'][_0x4c8c('0x3c')],function(_0x371831){return{'name':_0x371831[_0x4c8c('0x3d')],'type':_0x371831[_0x4c8c('0x3e')][_0x4c8c('0x3f')]};});_0x2403d2['model']=_[_0x4c8c('0x3b')](_0x4a483c,_0x4c8c('0x38'));_0x2403d2[_0x4c8c('0x40')]=_[_0x4c8c('0x41')](_0x26828e[_0x4c8c('0x40')]);_0x2403d2[_0x4c8c('0x42')]=_['intersection'](_0x2403d2[_0x4c8c('0x43')],_0x2403d2[_0x4c8c('0x40')]);_0x524825[_0x4c8c('0x44')]=_['intersection'](_0x2403d2[_0x4c8c('0x43')],qs[_0x4c8c('0x45')](_0x26828e[_0x4c8c('0x40')][_0x4c8c('0x45')]));_0x524825[_0x4c8c('0x44')]=_0x524825[_0x4c8c('0x44')][_0x4c8c('0x46')]?_0x524825[_0x4c8c('0x44')]:_0x2403d2[_0x4c8c('0x43')];if(!_0x26828e['query'][_0x4c8c('0x47')]('nolimit')){_0x524825['limit']=qs['limit'](_0x26828e['query']['limit']);_0x524825[_0x4c8c('0x2e')]=qs[_0x4c8c('0x2e')](_0x26828e['query'][_0x4c8c('0x2e')]);}_0x524825[_0x4c8c('0x48')]=qs[_0x4c8c('0x49')](_0x26828e[_0x4c8c('0x40')][_0x4c8c('0x49')]);_0x524825['where']=qs[_0x4c8c('0x42')](_['pick'](_0x26828e[_0x4c8c('0x40')],_0x2403d2[_0x4c8c('0x42')]),_0x4a483c);if(_0x26828e[_0x4c8c('0x40')][_0x4c8c('0x4a')]){_0x524825[_0x4c8c('0x4b')]=_[_0x4c8c('0x4c')](_0x524825['where'],{'$or':_[_0x4c8c('0x3b')](_0x4a483c,function(_0xe3e7e){if(_0xe3e7e[_0x4c8c('0x3e')]!==_0x4c8c('0x4d')){var _0x1e9c85={};_0x1e9c85[_0xe3e7e[_0x4c8c('0x38')]]={'$like':'%'+_0x26828e[_0x4c8c('0x40')]['filter']+'%'};return _0x1e9c85;}})});}_0x524825=_[_0x4c8c('0x4c')]({},_0x524825,_0x26828e[_0x4c8c('0x4e')]);var _0x286ca0={'where':_0x524825['where']};return db[_0x4c8c('0x4f')][_0x4c8c('0x2d')](_0x286ca0)[_0x4c8c('0x1e')](function(_0x345e1d){_0xbe6ca0[_0x4c8c('0x2d')]=_0x345e1d;if(_0x26828e[_0x4c8c('0x40')][_0x4c8c('0x50')]){_0x524825[_0x4c8c('0x51')]=[{'all':!![]}];}return db['ChatMessage'][_0x4c8c('0x52')](_0x524825);})[_0x4c8c('0x1e')](function(_0x3c0df7){_0xbe6ca0[_0x4c8c('0x53')]=_0x3c0df7;return _0xbe6ca0;})[_0x4c8c('0x1e')](respondWithFilteredResult(_0x4460f6,_0x524825))['catch'](handleError(_0x4460f6,null));};exports[_0x4c8c('0x54')]=function(_0x456a3c,_0x4f1a47){var _0x18cc5d={'raw':!![],'where':{'id':_0x456a3c[_0x4c8c('0x55')]['id']}},_0x198e8c={};_0x198e8c[_0x4c8c('0x43')]=_[_0x4c8c('0x41')](db['ChatMessage'][_0x4c8c('0x3c')]);_0x198e8c['query']=_[_0x4c8c('0x41')](_0x456a3c[_0x4c8c('0x40')]);_0x198e8c['filters']=_[_0x4c8c('0x56')](_0x198e8c[_0x4c8c('0x43')],_0x198e8c[_0x4c8c('0x40')]);_0x18cc5d[_0x4c8c('0x44')]=_['intersection'](_0x198e8c[_0x4c8c('0x43')],qs[_0x4c8c('0x45')](_0x456a3c[_0x4c8c('0x40')][_0x4c8c('0x45')]));_0x18cc5d['attributes']=_0x18cc5d[_0x4c8c('0x44')][_0x4c8c('0x46')]?_0x18cc5d[_0x4c8c('0x44')]:_0x198e8c[_0x4c8c('0x43')];if(_0x456a3c[_0x4c8c('0x40')]['includeAll']){_0x18cc5d[_0x4c8c('0x51')]=[{'all':!![]}];}_0x18cc5d=_[_0x4c8c('0x4c')]({},_0x18cc5d,_0x456a3c[_0x4c8c('0x4e')]);return db[_0x4c8c('0x4f')]['find'](_0x18cc5d)[_0x4c8c('0x1e')](handleEntityNotFound(_0x4f1a47,null))['then'](respondWithResult(_0x4f1a47,null))[_0x4c8c('0x28')](handleError(_0x4f1a47,null));};exports[_0x4c8c('0x57')]=function(_0x58bfff,_0x494e2e){return db[_0x4c8c('0x4f')][_0x4c8c('0x57')](_0x58bfff[_0x4c8c('0x58')],{})[_0x4c8c('0x1e')](respondWithResult(_0x494e2e,0xc9))[_0x4c8c('0x28')](handleError(_0x494e2e,null));};exports[_0x4c8c('0x34')]=function(_0x3c9833,_0x5bf0e2){if(_0x3c9833[_0x4c8c('0x58')]['id']){delete _0x3c9833['body']['id'];}return db[_0x4c8c('0x4f')]['find']({'where':{'id':_0x3c9833[_0x4c8c('0x55')]['id']}})[_0x4c8c('0x1e')](handleEntityNotFound(_0x5bf0e2,null))[_0x4c8c('0x1e')](saveUpdates(_0x3c9833[_0x4c8c('0x58')],null))[_0x4c8c('0x1e')](respondWithResult(_0x5bf0e2,null))[_0x4c8c('0x28')](handleError(_0x5bf0e2,null));};exports[_0x4c8c('0x35')]=function(_0x420dbd,_0xbfb461){return db[_0x4c8c('0x4f')][_0x4c8c('0x59')]({'where':{'id':_0x420dbd['params']['id']}})[_0x4c8c('0x1e')](handleEntityNotFound(_0xbfb461,null))[_0x4c8c('0x1e')](removeEntity(_0xbfb461,null))[_0x4c8c('0x28')](handleError(_0xbfb461,null));};exports['describe']=function(_0xa6148f,_0x4db957){return db[_0x4c8c('0x4f')]['describe']()['then'](respondWithResult(_0x4db957,null))[_0x4c8c('0x28')](handleError(_0x4db957,null));};var interaction_log=require('../../config/logger')('chat-interactions');exports[_0x4c8c('0x5a')]=function(_0x2ee236,_0x5ed2c7,_0x487d1a){var _0x436ad3={'agent':{},'channel':_0x4c8c('0x5b')};if(_0x2ee236['body']['id']){delete _0x2ee236[_0x4c8c('0x58')]['id'];}_0x2ee236[_0x4c8c('0x58')][_0x4c8c('0x5c')]=!![];_0x2ee236[_0x4c8c('0x58')]['readAt']=moment()[_0x4c8c('0x5d')](_0x4c8c('0x5e'));_0x2ee236[_0x4c8c('0x58')]['UserId']=_0x2ee236['body'][_0x4c8c('0x5f')]||_0x2ee236[_0x4c8c('0x60')]['id'];_0x436ad3[_0x4c8c('0x61')]['id']=_0x2ee236[_0x4c8c('0x58')][_0x4c8c('0x5f')];return db[_0x4c8c('0x4f')]['find']({'where':{'id':_0x2ee236[_0x4c8c('0x55')]['id'],'UserId':null}})[_0x4c8c('0x1e')](handleEntityNotFound(_0x5ed2c7,null))[_0x4c8c('0x1e')](saveUpdates(_0x2ee236[_0x4c8c('0x58')],null))[_0x4c8c('0x1e')](function(_0x2c45ba){if(_0x2c45ba){_0x436ad3[_0x4c8c('0x26')]=_0x2c45ba[_0x4c8c('0x62')]({'plain':!![]});return db['ChatInteraction'][_0x4c8c('0x59')]({'where':{'id':_0x2c45ba['ChatInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x5ed2c7,null))['then'](function(_0x589073){if(_0x589073){return _0x589073['update']({'UserId':_0x2ee236[_0x4c8c('0x58')]['UserId'],'read1stAt':_['isNil'](_0x589073[_0x4c8c('0x63')])?moment()[_0x4c8c('0x5d')](_0x4c8c('0x5e')):undefined});}return null;})[_0x4c8c('0x1e')](function(_0x27cebb){if(_0x27cebb){_0x436ad3[_0x4c8c('0x64')]=_0x27cebb[_0x4c8c('0x62')]({'plain':!![]});interaction_log[_0x4c8c('0x1f')](_0x4c8c('0x65'),_0x2ee236[_0x4c8c('0x60')]['id'],_0x2ee236['user']['name'],_0x2ee236['user'][_0x4c8c('0x66')],_0x436ad3['interaction']['id'],_0x2ee236[_0x4c8c('0x58')]?JSON[_0x4c8c('0x23')](_0x2ee236[_0x4c8c('0x58')]):'null');return respondWithRpcPromise('AcceptMessage',_0x4c8c('0x67'),_0x436ad3);}return null;})['then'](function(_0x309c79){var _0x17ae6a=_0x4c8c('0x68')+_0x309c79[_0x4c8c('0x26')][_0x4c8c('0x69')];return db[_0x4c8c('0x6a')][_0x4c8c('0x40')](_0x17ae6a,{'type':db[_0x4c8c('0x6b')]['QueryTypes']['SELECT'],'raw':!![]})['then'](function(_0x89df30){return _0x89df30;});})[_0x4c8c('0x1e')](function(_0x4c8e00){if(_0x4c8e00){_0x436ad3[_0x4c8c('0x26')][_0x4c8c('0x6c')]=_0x4c8e00[0x0];if(!_0x2ee236[_0x4c8c('0x58')]['UserId'])return;return db[_0x4c8c('0x6d')][_0x4c8c('0x59')]({'where':{'id':_0x2ee236['body'][_0x4c8c('0x5f')],'role':'agent'},'attributes':['id',_0x4c8c('0x38'),'fullname',_0x4c8c('0x6e'),_0x4c8c('0x6f')],'raw':!![]});}return null;})[_0x4c8c('0x1e')](function(_0x2503e7){if(!_0x2503e7)return null;_0x436ad3['message'][_0x4c8c('0x61')]=_0x2503e7;return _0x436ad3;})[_0x4c8c('0x1e')](function(_0xa05ffc){if(_0xa05ffc){if(_0x2ee236[_0x4c8c('0x58')][_0x4c8c('0x70')]){_0x436ad3[_0x4c8c('0x26')][_0x4c8c('0x71')]=util[_0x4c8c('0x5d')](_0x4c8c('0x72'),_0x2ee236[_0x4c8c('0x60')][_0x4c8c('0x38')]);_0x436ad3[_0x4c8c('0x26')][_0x4c8c('0x73')]=_0x436ad3[_0x4c8c('0x73')];_0x436ad3['message'][_0x4c8c('0x74')]=_0x436ad3[_0x4c8c('0x73')];_0x436ad3[_0x4c8c('0x26')][_0x4c8c('0x75')]=_0x4c8c('0x5a');return respondWithRpcPromise(_0x4c8c('0x76'),_0x4c8c('0x76'),{'event':'acceptmessage','message':_[_0x4c8c('0x4c')](_0x436ad3['message'],JSON[_0x4c8c('0x77')](_0x436ad3['interaction']['formData']))},client9002)[_0x4c8c('0x1e')](function(){return _0x436ad3;});}return _0x436ad3;}return null;})[_0x4c8c('0x1e')](respondWithResult(_0x5ed2c7,null))[_0x4c8c('0x28')](handleError(_0x5ed2c7,null));};var interaction_log=require(_0x4c8c('0x14'))('chat-interactions');exports['reject']=function(_0x1c1896,_0x4bf5fd,_0x676f83){var _0x33ce93={'agent':{},'channel':'chat'};if(_0x1c1896[_0x4c8c('0x58')]['id']){delete _0x1c1896[_0x4c8c('0x58')]['id'];}_0x1c1896[_0x4c8c('0x58')][_0x4c8c('0x5f')]=_0x1c1896[_0x4c8c('0x58')][_0x4c8c('0x5f')]||_0x1c1896[_0x4c8c('0x60')]['id'];_0x33ce93[_0x4c8c('0x61')]['id']=_0x1c1896[_0x4c8c('0x58')][_0x4c8c('0x5f')];return db['ChatMessage'][_0x4c8c('0x59')]({'where':{'id':_0x1c1896['params']['id'],'UserId':null}})[_0x4c8c('0x1e')](handleEntityNotFound(_0x4bf5fd,null))['then'](function(_0x4f6114){if(_0x4f6114){_0x33ce93[_0x4c8c('0x26')]=_0x4f6114[_0x4c8c('0x62')]({'plain':!![]});return db[_0x4c8c('0x78')][_0x4c8c('0x59')]({'where':{'id':_0x4f6114[_0x4c8c('0x79')]}});}return null;})[_0x4c8c('0x1e')](handleEntityNotFound(_0x4bf5fd,null))['then'](function(_0x5f1553){if(_0x5f1553){_0x33ce93[_0x4c8c('0x64')]=_0x5f1553[_0x4c8c('0x62')]({'plain':!![]});interaction_log[_0x4c8c('0x1f')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x1c1896[_0x4c8c('0x60')]['id'],_0x1c1896[_0x4c8c('0x60')][_0x4c8c('0x38')],_0x1c1896['user'][_0x4c8c('0x66')],_0x33ce93[_0x4c8c('0x64')]['id'],_0x1c1896[_0x4c8c('0x58')]?JSON[_0x4c8c('0x23')](_0x1c1896['body']):'null');return respondWithRpcPromise('RejectMessage',_0x4c8c('0x7a'),_0x33ce93);}return null;})[_0x4c8c('0x1e')](function(_0x260699){var _0x2475e1=_0x4c8c('0x68')+_0x260699[_0x4c8c('0x26')][_0x4c8c('0x69')];return db[_0x4c8c('0x6a')][_0x4c8c('0x40')](_0x2475e1,{'type':db['Sequelize'][_0x4c8c('0x7b')][_0x4c8c('0x7c')],'raw':!![]})[_0x4c8c('0x1e')](function(_0x4635bb){return _0x4635bb;});})[_0x4c8c('0x1e')](function(_0x409f6c){if(_0x409f6c){_0x33ce93[_0x4c8c('0x26')][_0x4c8c('0x6c')]=_0x409f6c[0x0];if(!_0x1c1896[_0x4c8c('0x58')]['UserId'])return;return db[_0x4c8c('0x6d')]['find']({'where':{'id':_0x1c1896[_0x4c8c('0x58')]['UserId'],'role':_0x4c8c('0x61')},'attributes':['id',_0x4c8c('0x38'),_0x4c8c('0x7d'),_0x4c8c('0x6e'),_0x4c8c('0x6f')],'raw':!![]});}return null;})[_0x4c8c('0x1e')](function(_0x71e685){if(!_0x71e685)return null;_0x33ce93[_0x4c8c('0x26')][_0x4c8c('0x61')]=_0x71e685;return _0x33ce93;})[_0x4c8c('0x1e')](function(_0x421c63){if(_0x421c63){_0x421c63[_0x4c8c('0x26')][_0x4c8c('0x71')]=util[_0x4c8c('0x5d')](_0x4c8c('0x72'),_0x1c1896[_0x4c8c('0x60')][_0x4c8c('0x38')]);_0x421c63[_0x4c8c('0x26')]['channel']=_0x33ce93[_0x4c8c('0x73')];_0x421c63[_0x4c8c('0x26')]['motionChannel']=_0x33ce93[_0x4c8c('0x73')];_0x421c63[_0x4c8c('0x26')]['event']='reject';respondWithRpcPromise('EventManager',_0x4c8c('0x76'),{'event':'rejectmessage','message':_[_0x4c8c('0x4c')](_0x33ce93[_0x4c8c('0x26')],JSON['parse'](_0x33ce93[_0x4c8c('0x64')]['formData']))},client9002);return _0x33ce93;}return null;})[_0x4c8c('0x1e')](respondWithResult(_0x4bf5fd,null))[_0x4c8c('0x28')](handleError(_0x4bf5fd,null));}; \ No newline at end of file +var _0x1794=['limit','offset','count','set','Content-Range','apply','reject','save','destroy','stack','name','send','index','map','ChatMessage','rawAttributes','fieldName','type','query','filters','model','attributes','intersection','fields','length','nolimit','sort','pick','filter','where','merge','options','include','findAll','rows','show','params','keys','find','body','update','describe','../../config/logger','chat-interactions','accept','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','read1stAt','interaction','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','Sequelize','contact','User','fullname','email','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','formData','ChatInteraction','ChatInteractionId','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','stringify','RejectMessage','rejectMessage','ContactId','QueryTypes','SELECT','internal','rejectmessage','parse','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatMessage.socket','register','client','http','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','sendStatus','status','end','json','undefined'];(function(_0x14acbd,_0x3b2502){var _0x4f51c8=function(_0x2264c9){while(--_0x2264c9){_0x14acbd['push'](_0x14acbd['shift']());}};_0x4f51c8(++_0x3b2502);}(_0x1794,0x1f3));var _0x4179=function(_0xb78d17,_0x1f9915){_0xb78d17=_0xb78d17-0x0;var _0x37328b=_0x1794[_0xb78d17];return _0x37328b;};'use strict';var emlformat=require(_0x4179('0x0'));var rimraf=require(_0x4179('0x1'));var zipdir=require(_0x4179('0x2'));var jsonpatch=require(_0x4179('0x3'));var rp=require(_0x4179('0x4'));var moment=require(_0x4179('0x5'));var BPromise=require(_0x4179('0x6'));var Mustache=require(_0x4179('0x7'));var util=require(_0x4179('0x8'));var path=require(_0x4179('0x9'));var sox=require(_0x4179('0xa'));var csv=require('to-csv');var ejs=require(_0x4179('0xb'));var fs=require('fs');var fs_extra=require(_0x4179('0xc'));var _=require(_0x4179('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x4179('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x4179('0xf'));var querystring=require(_0x4179('0x10'));var Papa=require('papaparse');var Redis=require(_0x4179('0x11'));var authService=require(_0x4179('0x12'));var qs=require(_0x4179('0x13'));var as=require(_0x4179('0x14'));var hardwareService=require(_0x4179('0x15'));var logger=require('../../config/logger')(_0x4179('0x16'));var utils=require(_0x4179('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x4179('0x18'));var db=require(_0x4179('0x19'))['db'];config[_0x4179('0x1a')]=_[_0x4179('0x1b')](config[_0x4179('0x1a')],{'host':_0x4179('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4179('0x1a')]));require(_0x4179('0x1d'))[_0x4179('0x1e')](socket);var jayson=require('jayson/promise');var client=jayson[_0x4179('0x1f')][_0x4179('0x20')]({'port':0x232c});var client9002=jayson[_0x4179('0x1f')][_0x4179('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x1a0c50,_0x663bb4,_0x135928,_0x589354){return new BPromise(function(_0x248967,_0x287c2b){var _0x50c9da=_0x589354||client;return _0x50c9da[_0x4179('0x21')](_0x1a0c50,_0x135928)[_0x4179('0x22')](function(_0x43d4db){logger[_0x4179('0x23')](_0x4179('0x24'),_0x663bb4,_0x4179('0x25'));logger[_0x4179('0x26')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x663bb4,_0x4179('0x25'),JSON['stringify'](_0x43d4db));if(_0x43d4db[_0x4179('0x27')]){if(_0x43d4db[_0x4179('0x27')][_0x4179('0x28')]===0x1f4){logger[_0x4179('0x27')](_0x4179('0x24'),_0x663bb4,_0x43d4db[_0x4179('0x27')][_0x4179('0x29')]);return _0x287c2b(_0x43d4db[_0x4179('0x27')]['message']);}logger[_0x4179('0x27')](_0x4179('0x24'),_0x663bb4,_0x43d4db[_0x4179('0x27')][_0x4179('0x29')]);return _0x248967(_0x43d4db[_0x4179('0x27')]['message']);}else{logger['info'](_0x4179('0x24'),_0x663bb4,'request\x20sent');_0x248967(_0x43d4db[_0x4179('0x2a')][_0x4179('0x29')]);}})[_0x4179('0x2b')](function(_0x4c8c1b){logger[_0x4179('0x27')](_0x4179('0x24'),_0x663bb4,_0x4c8c1b);_0x287c2b(_0x4c8c1b);});});}function respondWithStatusCode(_0x37d08f,_0x5c8c6a){_0x5c8c6a=_0x5c8c6a||0xcc;return function(_0x462793){if(_0x462793){return _0x37d08f[_0x4179('0x2c')](_0x5c8c6a);}return _0x37d08f[_0x4179('0x2d')](_0x5c8c6a)[_0x4179('0x2e')]();};}function respondWithResult(_0x3b8b9e,_0x58c8cb){_0x58c8cb=_0x58c8cb||0xc8;return function(_0x5d53a4){if(_0x5d53a4){return _0x3b8b9e['status'](_0x58c8cb)[_0x4179('0x2f')](_0x5d53a4);}};}function respondWithFilteredResult(_0x48e6fb,_0x381f43){return function(_0x1a51ac){if(_0x1a51ac){var _0x558464=typeof _0x381f43['offset']===_0x4179('0x30')&&typeof _0x381f43[_0x4179('0x31')]===_0x4179('0x30');var _0x2c4d79=_0x1a51ac['count'];var _0x31691e=_0x558464?0x0:_0x381f43[_0x4179('0x32')];var _0x12b668=_0x558464?_0x1a51ac[_0x4179('0x33')]:_0x381f43['offset']+_0x381f43[_0x4179('0x31')];var _0x260a5e;if(_0x12b668>=_0x2c4d79){_0x12b668=_0x2c4d79;_0x260a5e=0xc8;}else{_0x260a5e=0xce;}_0x48e6fb[_0x4179('0x2d')](_0x260a5e);return _0x48e6fb[_0x4179('0x34')](_0x4179('0x35'),_0x31691e+'-'+_0x12b668+'/'+_0x2c4d79)[_0x4179('0x2f')](_0x1a51ac);}return null;};}function patchUpdates(_0x547291){return function(_0xf053ae){try{jsonpatch[_0x4179('0x36')](_0xf053ae,_0x547291,!![]);}catch(_0x2925c1){return BPromise[_0x4179('0x37')](_0x2925c1);}return _0xf053ae[_0x4179('0x38')]();};}function saveUpdates(_0x49e9e9,_0xc109a5){return function(_0x26e731){if(_0x26e731){return _0x26e731['update'](_0x49e9e9)[_0x4179('0x22')](function(_0x17d606){return _0x17d606;});}return null;};}function removeEntity(_0x4109b8,_0x54c3f1){return function(_0x4a9762){if(_0x4a9762){return _0x4a9762[_0x4179('0x39')]()[_0x4179('0x22')](function(){_0x4109b8[_0x4179('0x2d')](0xcc)[_0x4179('0x2e')]();});}};}function handleEntityNotFound(_0x53a327,_0x5025d8){return function(_0x460d59){if(!_0x460d59){_0x53a327[_0x4179('0x2c')](0x194);}return _0x460d59;};}function handleError(_0x57961b,_0x2e7098){_0x2e7098=_0x2e7098||0x1f4;return function(_0x83212c){logger['error'](_0x83212c[_0x4179('0x3a')]);if(_0x83212c[_0x4179('0x3b')]){delete _0x83212c[_0x4179('0x3b')];}_0x57961b['status'](_0x2e7098)[_0x4179('0x3c')](_0x83212c);};}exports[_0x4179('0x3d')]=function(_0x261245,_0x98da3){var _0x487ab4={},_0x2c8054={},_0x2cea44={'count':0x0,'rows':[]};var _0xd098c6=_[_0x4179('0x3e')](db[_0x4179('0x3f')][_0x4179('0x40')],function(_0xc47071){return{'name':_0xc47071[_0x4179('0x41')],'type':_0xc47071[_0x4179('0x42')]['key']};});_0x2c8054['model']=_[_0x4179('0x3e')](_0xd098c6,_0x4179('0x3b'));_0x2c8054[_0x4179('0x43')]=_['keys'](_0x261245['query']);_0x2c8054[_0x4179('0x44')]=_['intersection'](_0x2c8054[_0x4179('0x45')],_0x2c8054[_0x4179('0x43')]);_0x487ab4[_0x4179('0x46')]=_[_0x4179('0x47')](_0x2c8054[_0x4179('0x45')],qs[_0x4179('0x48')](_0x261245[_0x4179('0x43')][_0x4179('0x48')]));_0x487ab4[_0x4179('0x46')]=_0x487ab4[_0x4179('0x46')][_0x4179('0x49')]?_0x487ab4[_0x4179('0x46')]:_0x2c8054[_0x4179('0x45')];if(!_0x261245['query']['hasOwnProperty'](_0x4179('0x4a'))){_0x487ab4[_0x4179('0x31')]=qs[_0x4179('0x31')](_0x261245[_0x4179('0x43')][_0x4179('0x31')]);_0x487ab4[_0x4179('0x32')]=qs[_0x4179('0x32')](_0x261245['query'][_0x4179('0x32')]);}_0x487ab4['order']=qs[_0x4179('0x4b')](_0x261245[_0x4179('0x43')][_0x4179('0x4b')]);_0x487ab4['where']=qs[_0x4179('0x44')](_[_0x4179('0x4c')](_0x261245[_0x4179('0x43')],_0x2c8054[_0x4179('0x44')]),_0xd098c6);if(_0x261245['query'][_0x4179('0x4d')]){_0x487ab4[_0x4179('0x4e')]=_['merge'](_0x487ab4[_0x4179('0x4e')],{'$or':_[_0x4179('0x3e')](_0xd098c6,function(_0x18abb4){if(_0x18abb4[_0x4179('0x42')]!=='VIRTUAL'){var _0x3c23f4={};_0x3c23f4[_0x18abb4[_0x4179('0x3b')]]={'$like':'%'+_0x261245[_0x4179('0x43')][_0x4179('0x4d')]+'%'};return _0x3c23f4;}})});}_0x487ab4=_[_0x4179('0x4f')]({},_0x487ab4,_0x261245[_0x4179('0x50')]);var _0xf6989d={'where':_0x487ab4[_0x4179('0x4e')]};return db[_0x4179('0x3f')][_0x4179('0x33')](_0xf6989d)[_0x4179('0x22')](function(_0x4bce01){_0x2cea44[_0x4179('0x33')]=_0x4bce01;if(_0x261245[_0x4179('0x43')]['includeAll']){_0x487ab4[_0x4179('0x51')]=[{'all':!![]}];}return db['ChatMessage'][_0x4179('0x52')](_0x487ab4);})[_0x4179('0x22')](function(_0x30c524){_0x2cea44[_0x4179('0x53')]=_0x30c524;return _0x2cea44;})[_0x4179('0x22')](respondWithFilteredResult(_0x98da3,_0x487ab4))[_0x4179('0x2b')](handleError(_0x98da3,null));};exports[_0x4179('0x54')]=function(_0x404c31,_0x41c049){var _0xf8d643={'raw':!![],'where':{'id':_0x404c31[_0x4179('0x55')]['id']}},_0x9137cc={};_0x9137cc[_0x4179('0x45')]=_[_0x4179('0x56')](db[_0x4179('0x3f')][_0x4179('0x40')]);_0x9137cc[_0x4179('0x43')]=_[_0x4179('0x56')](_0x404c31[_0x4179('0x43')]);_0x9137cc[_0x4179('0x44')]=_[_0x4179('0x47')](_0x9137cc['model'],_0x9137cc[_0x4179('0x43')]);_0xf8d643[_0x4179('0x46')]=_[_0x4179('0x47')](_0x9137cc[_0x4179('0x45')],qs['fields'](_0x404c31['query'][_0x4179('0x48')]));_0xf8d643['attributes']=_0xf8d643[_0x4179('0x46')][_0x4179('0x49')]?_0xf8d643[_0x4179('0x46')]:_0x9137cc['model'];if(_0x404c31['query']['includeAll']){_0xf8d643[_0x4179('0x51')]=[{'all':!![]}];}_0xf8d643=_[_0x4179('0x4f')]({},_0xf8d643,_0x404c31['options']);return db[_0x4179('0x3f')][_0x4179('0x57')](_0xf8d643)['then'](handleEntityNotFound(_0x41c049,null))[_0x4179('0x22')](respondWithResult(_0x41c049,null))[_0x4179('0x2b')](handleError(_0x41c049,null));};exports['create']=function(_0x297200,_0x5a08a4){return db['ChatMessage']['create'](_0x297200[_0x4179('0x58')],{})[_0x4179('0x22')](respondWithResult(_0x5a08a4,0xc9))[_0x4179('0x2b')](handleError(_0x5a08a4,null));};exports[_0x4179('0x59')]=function(_0x116519,_0x374aa4){if(_0x116519[_0x4179('0x58')]['id']){delete _0x116519[_0x4179('0x58')]['id'];}return db[_0x4179('0x3f')][_0x4179('0x57')]({'where':{'id':_0x116519[_0x4179('0x55')]['id']}})[_0x4179('0x22')](handleEntityNotFound(_0x374aa4,null))[_0x4179('0x22')](saveUpdates(_0x116519[_0x4179('0x58')],null))['then'](respondWithResult(_0x374aa4,null))[_0x4179('0x2b')](handleError(_0x374aa4,null));};exports['destroy']=function(_0x585ef4,_0x133cb6){return db[_0x4179('0x3f')][_0x4179('0x57')]({'where':{'id':_0x585ef4['params']['id']}})['then'](handleEntityNotFound(_0x133cb6,null))['then'](removeEntity(_0x133cb6,null))['catch'](handleError(_0x133cb6,null));};exports[_0x4179('0x5a')]=function(_0x1e9886,_0x24db3a){return db[_0x4179('0x3f')][_0x4179('0x5a')]()[_0x4179('0x22')](respondWithResult(_0x24db3a,null))[_0x4179('0x2b')](handleError(_0x24db3a,null));};var interaction_log=require(_0x4179('0x5b'))(_0x4179('0x5c'));exports[_0x4179('0x5d')]=function(_0x8d60c6,_0xd3d2dc,_0x487589){var _0x1f63fa={'agent':{},'channel':_0x4179('0x5e')};if(_0x8d60c6['body']['id']){delete _0x8d60c6[_0x4179('0x58')]['id'];}_0x8d60c6[_0x4179('0x58')][_0x4179('0x5f')]=!![];_0x8d60c6[_0x4179('0x58')][_0x4179('0x60')]=moment()[_0x4179('0x61')](_0x4179('0x62'));_0x8d60c6[_0x4179('0x58')][_0x4179('0x63')]=_0x8d60c6[_0x4179('0x58')]['UserId']||_0x8d60c6[_0x4179('0x64')]['id'];_0x1f63fa[_0x4179('0x65')]['id']=_0x8d60c6[_0x4179('0x58')][_0x4179('0x63')];return db['ChatMessage'][_0x4179('0x57')]({'where':{'id':_0x8d60c6['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0xd3d2dc,null))[_0x4179('0x22')](saveUpdates(_0x8d60c6['body'],null))[_0x4179('0x22')](function(_0x4c4989){if(_0x4c4989){_0x1f63fa[_0x4179('0x29')]=_0x4c4989[_0x4179('0x66')]({'plain':!![]});return db['ChatInteraction'][_0x4179('0x57')]({'where':{'id':_0x4c4989['ChatInteractionId']}});}return null;})['then'](handleEntityNotFound(_0xd3d2dc,null))['then'](function(_0x1af0fe){if(_0x1af0fe){return _0x1af0fe[_0x4179('0x59')]({'UserId':_0x8d60c6[_0x4179('0x58')][_0x4179('0x63')],'read1stAt':_['isNil'](_0x1af0fe[_0x4179('0x67')])?moment()[_0x4179('0x61')](_0x4179('0x62')):undefined});}return null;})[_0x4179('0x22')](function(_0x1b2f07){if(_0x1b2f07){_0x1f63fa[_0x4179('0x68')]=_0x1b2f07[_0x4179('0x66')]({'plain':!![]});interaction_log[_0x4179('0x23')]('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x8d60c6[_0x4179('0x64')]['id'],_0x8d60c6[_0x4179('0x64')][_0x4179('0x3b')],_0x8d60c6[_0x4179('0x64')][_0x4179('0x69')],_0x1f63fa['interaction']['id'],_0x8d60c6[_0x4179('0x58')]?JSON['stringify'](_0x8d60c6[_0x4179('0x58')]):_0x4179('0x6a'));return respondWithRpcPromise(_0x4179('0x6b'),_0x4179('0x6c'),_0x1f63fa);}return null;})['then'](function(_0x3beb02){var _0x1c921d=_0x4179('0x6d')+_0x3beb02[_0x4179('0x29')]['ContactId'];return db[_0x4179('0x6e')][_0x4179('0x43')](_0x1c921d,{'type':db[_0x4179('0x6f')]['QueryTypes']['SELECT'],'raw':!![]})[_0x4179('0x22')](function(_0x1865c3){return _0x1865c3;});})['then'](function(_0xff298c){if(_0xff298c){_0x1f63fa[_0x4179('0x29')][_0x4179('0x70')]=_0xff298c[0x0];if(!_0x8d60c6['body'][_0x4179('0x63')])return;return db[_0x4179('0x71')][_0x4179('0x57')]({'where':{'id':_0x8d60c6[_0x4179('0x58')][_0x4179('0x63')],'role':_0x4179('0x65')},'attributes':['id',_0x4179('0x3b'),_0x4179('0x72'),_0x4179('0x73'),'internal'],'raw':!![]});}return null;})[_0x4179('0x22')](function(_0x18633a){if(!_0x18633a)return null;_0x1f63fa[_0x4179('0x29')][_0x4179('0x65')]=_0x18633a;return _0x1f63fa;})[_0x4179('0x22')](function(_0x374b13){if(_0x374b13){if(_0x8d60c6[_0x4179('0x58')][_0x4179('0x74')]){_0x1f63fa[_0x4179('0x29')][_0x4179('0x75')]=util[_0x4179('0x61')](_0x4179('0x76'),_0x8d60c6[_0x4179('0x64')][_0x4179('0x3b')]);_0x1f63fa['message'][_0x4179('0x77')]=_0x1f63fa[_0x4179('0x77')];_0x1f63fa[_0x4179('0x29')][_0x4179('0x78')]=_0x1f63fa[_0x4179('0x77')];_0x1f63fa['message'][_0x4179('0x79')]=_0x4179('0x5d');return respondWithRpcPromise(_0x4179('0x7a'),_0x4179('0x7a'),{'event':_0x4179('0x7b'),'message':_[_0x4179('0x4f')](_0x1f63fa['message'],JSON['parse'](_0x1f63fa['interaction'][_0x4179('0x7c')]))},client9002)[_0x4179('0x22')](function(){return _0x1f63fa;});}return _0x1f63fa;}return null;})['then'](respondWithResult(_0xd3d2dc,null))[_0x4179('0x2b')](handleError(_0xd3d2dc,null));};var interaction_log=require(_0x4179('0x5b'))(_0x4179('0x5c'));exports[_0x4179('0x37')]=function(_0x434e13,_0x368cb2,_0x5897ae){var _0x581402={'agent':{},'channel':_0x4179('0x5e')};if(_0x434e13['body']['id']){delete _0x434e13[_0x4179('0x58')]['id'];}_0x434e13[_0x4179('0x58')][_0x4179('0x63')]=_0x434e13[_0x4179('0x58')][_0x4179('0x63')]||_0x434e13[_0x4179('0x64')]['id'];_0x581402[_0x4179('0x65')]['id']=_0x434e13[_0x4179('0x58')][_0x4179('0x63')];return db[_0x4179('0x3f')]['find']({'where':{'id':_0x434e13[_0x4179('0x55')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x368cb2,null))[_0x4179('0x22')](function(_0x1288aa){if(_0x1288aa){_0x581402['message']=_0x1288aa[_0x4179('0x66')]({'plain':!![]});return db[_0x4179('0x7d')][_0x4179('0x57')]({'where':{'id':_0x1288aa[_0x4179('0x7e')]}});}return null;})[_0x4179('0x22')](handleEntityNotFound(_0x368cb2,null))[_0x4179('0x22')](function(_0x3e4b5e){if(_0x3e4b5e){_0x581402['interaction']=_0x3e4b5e[_0x4179('0x66')]({'plain':!![]});interaction_log[_0x4179('0x23')](_0x4179('0x7f'),_0x434e13[_0x4179('0x64')]['id'],_0x434e13[_0x4179('0x64')][_0x4179('0x3b')],_0x434e13['user'][_0x4179('0x69')],_0x581402[_0x4179('0x68')]['id'],_0x434e13['body']?JSON[_0x4179('0x80')](_0x434e13[_0x4179('0x58')]):_0x4179('0x6a'));return respondWithRpcPromise(_0x4179('0x81'),_0x4179('0x82'),_0x581402);}return null;})[_0x4179('0x22')](function(_0x4992a8){var _0x3549d5=_0x4179('0x6d')+_0x4992a8['message'][_0x4179('0x83')];return db['sequelize'][_0x4179('0x43')](_0x3549d5,{'type':db[_0x4179('0x6f')][_0x4179('0x84')][_0x4179('0x85')],'raw':!![]})[_0x4179('0x22')](function(_0x4b4b21){return _0x4b4b21;});})['then'](function(_0x56c345){if(_0x56c345){_0x581402[_0x4179('0x29')][_0x4179('0x70')]=_0x56c345[0x0];if(!_0x434e13[_0x4179('0x58')]['UserId'])return;return db['User']['find']({'where':{'id':_0x434e13[_0x4179('0x58')][_0x4179('0x63')],'role':_0x4179('0x65')},'attributes':['id','name',_0x4179('0x72'),_0x4179('0x73'),_0x4179('0x86')],'raw':!![]});}return null;})['then'](function(_0x31c040){if(!_0x31c040)return null;_0x581402[_0x4179('0x29')]['agent']=_0x31c040;return _0x581402;})[_0x4179('0x22')](function(_0x4227ad){if(_0x4227ad){_0x4227ad[_0x4179('0x29')][_0x4179('0x75')]=util[_0x4179('0x61')](_0x4179('0x76'),_0x434e13['user'][_0x4179('0x3b')]);_0x4227ad[_0x4179('0x29')]['channel']=_0x581402[_0x4179('0x77')];_0x4227ad[_0x4179('0x29')][_0x4179('0x78')]=_0x581402[_0x4179('0x77')];_0x4227ad[_0x4179('0x29')][_0x4179('0x79')]=_0x4179('0x37');respondWithRpcPromise('EventManager',_0x4179('0x7a'),{'event':_0x4179('0x87'),'message':_[_0x4179('0x4f')](_0x581402[_0x4179('0x29')],JSON[_0x4179('0x88')](_0x581402[_0x4179('0x68')]['formData']))},client9002);return _0x581402;}return null;})[_0x4179('0x22')](respondWithResult(_0x368cb2,null))[_0x4179('0x2b')](handleError(_0x368cb2,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index 5ef3087..860753f 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 _0x4f06=['events','ChatMessage','setMaxListeners','update','emit','hasOwnProperty','hook','exports'];(function(_0x4d53ad,_0x5a8c2b){var _0x1bf121=function(_0x4f88c1){while(--_0x4f88c1){_0x4d53ad['push'](_0x4d53ad['shift']());}};_0x1bf121(++_0x5a8c2b);}(_0x4f06,0x130));var _0x64f0=function(_0x2e6326,_0x108461){_0x2e6326=_0x2e6326-0x0;var _0x4e3465=_0x4f06[_0x2e6326];return _0x4e3465;};'use strict';var EventEmitter=require(_0x64f0('0x0'));var ChatMessage=require('../../mysqldb')['db'][_0x64f0('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x64f0('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x64f0('0x3'),'afterDestroy':'remove'};function emitEvent(_0x5126af){return function(_0x23aa57,_0x1b7360,_0x3893da){ChatMessageEvents[_0x64f0('0x4')](_0x5126af+':'+_0x23aa57['id'],_0x23aa57);ChatMessageEvents[_0x64f0('0x4')](_0x5126af,_0x23aa57);_0x3893da(null);};}for(var e in events){if(events[_0x64f0('0x5')](e)){var event=events[e];ChatMessage[_0x64f0('0x6')](e,emitEvent(event));}}module[_0x64f0('0x7')]=ChatMessageEvents; \ No newline at end of file +var _0x5107=['events','../../mysqldb','setMaxListeners','update','remove','emit','hasOwnProperty','hook'];(function(_0xa265db,_0x2f1de8){var _0x4a6b20=function(_0x283fc8){while(--_0x283fc8){_0xa265db['push'](_0xa265db['shift']());}};_0x4a6b20(++_0x2f1de8);}(_0x5107,0x78));var _0x7510=function(_0x2fdde3,_0x55f3e3){_0x2fdde3=_0x2fdde3-0x0;var _0x38ba5d=_0x5107[_0x2fdde3];return _0x38ba5d;};'use strict';var EventEmitter=require(_0x7510('0x0'));var ChatMessage=require(_0x7510('0x1'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x7510('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7510('0x3'),'afterDestroy':_0x7510('0x4')};function emitEvent(_0x4cc0c0){return function(_0x1c208b,_0xf749a7,_0x5bac2c){ChatMessageEvents[_0x7510('0x5')](_0x4cc0c0+':'+_0x1c208b['id'],_0x1c208b);ChatMessageEvents[_0x7510('0x5')](_0x4cc0c0,_0x1c208b);_0x5bac2c(null);};}for(var e in events){if(events[_0x7510('0x6')](e)){var event=events[e];ChatMessage[_0x7510('0x7')](e,emitEvent(event));}}module['exports']=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index 8b11dd0..d643628 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 _0x2402=['./chatMessage.attributes','exports','define','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','isNil','ChatInteraction','ChatInteractionId','then','update','createdAt','error','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0xbf15fb,_0xbf8e46){var _0x2a1941=function(_0x44451d){while(--_0x44451d){_0xbf15fb['push'](_0xbf15fb['shift']());}};_0x2a1941(++_0xbf8e46);}(_0x2402,0xc9));var _0x2240=function(_0x13be0f,_0x31f0d7){_0x13be0f=_0x13be0f-0x0;var _0x834c3c=_0x2402[_0x13be0f];return _0x834c3c;};'use strict';var _=require(_0x2240('0x0'));var util=require(_0x2240('0x1'));var logger=require(_0x2240('0x2'))(_0x2240('0x3'));var moment=require('moment');var BPromise=require(_0x2240('0x4'));var rp=require(_0x2240('0x5'));var fs=require('fs');var path=require(_0x2240('0x6'));var rimraf=require(_0x2240('0x7'));var config=require(_0x2240('0x8'));var attributes=require(_0x2240('0x9'));module[_0x2240('0xa')]=function(_0x311e37,_0x1e588c){return _0x311e37[_0x2240('0xb')](_0x2240('0xc'),attributes,{'tableName':_0x2240('0xd'),'paranoid':![],'indexes':[{'name':_0x2240('0xe'),'fields':[_0x2240('0xf')],'type':_0x2240('0x10')}],'timestamps':!![],'hooks':{'afterCreate':function(_0xa6bffc,_0x2616ec,_0x4a7b78){var _0x20fdec=_0x311e37[_0x2240('0x11')];var _0x5c3dc3=_0xa6bffc[_0x2240('0x12')]({'plain':!![]});if(_0x5c3dc3[_0x2240('0x13')][_0x2240('0x14')]()==='in'||_0x5c3dc3[_0x2240('0x13')]['toLowerCase']()===_0x2240('0x15')&&!_0x5c3dc3['secret']&&!_[_0x2240('0x16')](_0x5c3dc3['UserId'])){_0x20fdec[_0x2240('0x17')]['findOne']({'where':{'id':_0x5c3dc3[_0x2240('0x18')]}})[_0x2240('0x19')](function(_0x10a971){if(_0x10a971){_0x10a971[_0x2240('0x1a')]({'lastMsgAt':_0x5c3dc3[_0x2240('0x1b')],'lastMsgDirection':_0x5c3dc3[_0x2240('0x13')][_0x2240('0x14')]()});}})['catch'](function(_0x34b640){console[_0x2240('0x1c')](_0x34b640);});}_0x4a7b78();}},'charset':'utf8mb4','collate':_0x2240('0x1d')});}; \ No newline at end of file +var _0x2174=['fti_chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','secret','isNil','UserId','findOne','ChatInteractionId','then','createdAt','catch','error','utf8mb4','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./chatMessage.attributes','exports','define','ChatMessage','chat_messages'];(function(_0x20275f,_0x4528c5){var _0x5a5457=function(_0x2bd2cc){while(--_0x2bd2cc){_0x20275f['push'](_0x20275f['shift']());}};_0x5a5457(++_0x4528c5);}(_0x2174,0xe3));var _0x4217=function(_0x594b54,_0x5eef9b){_0x594b54=_0x594b54-0x0;var _0x5de685=_0x2174[_0x594b54];return _0x5de685;};'use strict';var _=require(_0x4217('0x0'));var util=require(_0x4217('0x1'));var logger=require(_0x4217('0x2'))(_0x4217('0x3'));var moment=require('moment');var BPromise=require(_0x4217('0x4'));var rp=require(_0x4217('0x5'));var fs=require('fs');var path=require(_0x4217('0x6'));var rimraf=require(_0x4217('0x7'));var config=require('../../config/environment');var attributes=require(_0x4217('0x8'));module[_0x4217('0x9')]=function(_0x529d98,_0x5a41f6){return _0x529d98[_0x4217('0xa')](_0x4217('0xb'),attributes,{'tableName':_0x4217('0xc'),'paranoid':![],'indexes':[{'name':_0x4217('0xd'),'fields':[_0x4217('0xe')],'type':_0x4217('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2f243d,_0x2c5e20,_0x5db64f){var _0x2e4967=_0x529d98[_0x4217('0x10')];var _0x58676e=_0x2f243d[_0x4217('0x11')]({'plain':!![]});if(_0x58676e['direction']['toLowerCase']()==='in'||_0x58676e[_0x4217('0x12')][_0x4217('0x13')]()==='out'&&!_0x58676e[_0x4217('0x14')]&&!_[_0x4217('0x15')](_0x58676e[_0x4217('0x16')])){_0x2e4967['ChatInteraction'][_0x4217('0x17')]({'where':{'id':_0x58676e[_0x4217('0x18')]}})[_0x4217('0x19')](function(_0x262587){if(_0x262587){_0x262587['update']({'lastMsgAt':_0x58676e[_0x4217('0x1a')],'lastMsgDirection':_0x58676e['direction'][_0x4217('0x13')]()});}})[_0x4217('0x1b')](function(_0x3bbe1f){console[_0x4217('0x1c')](_0x3bbe1f);});}_0x5db64f();}},'charset':_0x4217('0x1d'),'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 5db24f7..e8e9884 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 _0x964c=['body','options','raw','lodash','util','moment','ioredis','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','localhost','./chatMessage.socket','register','then','info','request\x20sent','debug','stringify','error','message','ChatMessage,\x20%s,\x20%s','catch','CreateChatMessage','create'];(function(_0x3f88bc,_0xe38cf5){var _0x4df1c4=function(_0x111de1){while(--_0x111de1){_0x3f88bc['push'](_0x3f88bc['shift']());}};_0x4df1c4(++_0xe38cf5);}(_0x964c,0x162));var _0xc964=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x964c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xc964('0x0'));var util=require(_0xc964('0x1'));var moment=require(_0xc964('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc964('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xc964('0x4'))('rpc');var config=require(_0xc964('0x5'));var jayson=require(_0xc964('0x6'));var client=jayson[_0xc964('0x7')]['http']({'port':0x232a});config[_0xc964('0x8')]=_[_0xc964('0x9')](config[_0xc964('0x8')],{'host':_0xc964('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc964('0x8')]));require(_0xc964('0xb'))[_0xc964('0xc')](socket);function respondWithRpcPromise(_0x1ac77c,_0x432b78,_0x4cde08){return new BPromise(function(_0x1be00b,_0x112bcd){return client['request'](_0x1ac77c,_0x4cde08)[_0xc964('0xd')](function(_0x243c7c){logger[_0xc964('0xe')]('ChatMessage,\x20%s,\x20%s',_0x432b78,_0xc964('0xf'));logger[_0xc964('0x10')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x432b78,_0xc964('0xf'),JSON[_0xc964('0x11')](_0x243c7c));if(_0x243c7c['error']){if(_0x243c7c[_0xc964('0x12')]['code']===0x1f4){logger['error']('ChatMessage,\x20%s,\x20%s',_0x432b78,_0x243c7c[_0xc964('0x12')][_0xc964('0x13')]);return _0x112bcd(_0x243c7c[_0xc964('0x12')]['message']);}logger[_0xc964('0x12')](_0xc964('0x14'),_0x432b78,_0x243c7c[_0xc964('0x12')][_0xc964('0x13')]);return _0x1be00b(_0x243c7c[_0xc964('0x12')][_0xc964('0x13')]);}else{logger[_0xc964('0xe')](_0xc964('0x14'),_0x432b78,'request\x20sent');_0x1be00b(_0x243c7c['result'][_0xc964('0x13')]);}})[_0xc964('0x15')](function(_0x34c93c){logger[_0xc964('0x12')](_0xc964('0x14'),_0x432b78,_0x34c93c);_0x112bcd(_0x34c93c);});});}exports[_0xc964('0x16')]=function(_0x38573f){var _0x5b7cfa=this;return new Promise(function(_0x12e5cb,_0x53a647){return db['ChatMessage'][_0xc964('0x17')](_0x38573f[_0xc964('0x18')],{'raw':_0x38573f[_0xc964('0x19')]?_0x38573f[_0xc964('0x19')][_0xc964('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x45ed8b){logger[_0xc964('0xe')](_0xc964('0x16'),_0x38573f);logger['debug'](_0xc964('0x16'),_0x38573f,JSON[_0xc964('0x11')](_0x45ed8b));_0x12e5cb(_0x45ed8b);})['catch'](function(_0x4ca324){logger[_0xc964('0x12')](_0xc964('0x16'),_0x4ca324[_0xc964('0x13')],_0x38573f);_0x53a647(_0x5b7cfa[_0xc964('0x12')](0x1f4,_0x4ca324['message']));});});}; \ No newline at end of file +var _0x72bb=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','then','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','error','ChatMessage,\x20%s,\x20%s','message','info','result','catch','CreateChatMessage','create','body','options','raw','stringify'];(function(_0x3f91d5,_0x37727a){var _0x3437e0=function(_0x9c06ab){while(--_0x9c06ab){_0x3f91d5['push'](_0x3f91d5['shift']());}};_0x3437e0(++_0x37727a);}(_0x72bb,0x14a));var _0xb72b=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0x72bb[_0x29b609];return _0x54c952;};'use strict';var _=require(_0xb72b('0x0'));var util=require(_0xb72b('0x1'));var moment=require(_0xb72b('0x2'));var BPromise=require(_0xb72b('0x3'));var rs=require(_0xb72b('0x4'));var fs=require('fs');var Redis=require(_0xb72b('0x5'));var db=require(_0xb72b('0x6'))['db'];var utils=require(_0xb72b('0x7'));var logger=require(_0xb72b('0x8'))(_0xb72b('0x9'));var config=require(_0xb72b('0xa'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0xb72b('0xb')]=_[_0xb72b('0xc')](config[_0xb72b('0xb')],{'host':_0xb72b('0xd'),'port':0x18eb});var socket=require(_0xb72b('0xe'))(new Redis(config[_0xb72b('0xb')]));require(_0xb72b('0xf'))[_0xb72b('0x10')](socket);function respondWithRpcPromise(_0x4efaad,_0x1c5d27,_0x17b9e7){return new BPromise(function(_0x6fa33e,_0x18c404){return client['request'](_0x4efaad,_0x17b9e7)[_0xb72b('0x11')](function(_0x4be4f7){logger['info']('ChatMessage,\x20%s,\x20%s',_0x1c5d27,_0xb72b('0x12'));logger[_0xb72b('0x13')](_0xb72b('0x14'),_0x1c5d27,_0xb72b('0x12'),JSON['stringify'](_0x4be4f7));if(_0x4be4f7[_0xb72b('0x15')]){if(_0x4be4f7[_0xb72b('0x15')]['code']===0x1f4){logger[_0xb72b('0x15')](_0xb72b('0x16'),_0x1c5d27,_0x4be4f7[_0xb72b('0x15')][_0xb72b('0x17')]);return _0x18c404(_0x4be4f7[_0xb72b('0x15')][_0xb72b('0x17')]);}logger[_0xb72b('0x15')](_0xb72b('0x16'),_0x1c5d27,_0x4be4f7[_0xb72b('0x15')][_0xb72b('0x17')]);return _0x6fa33e(_0x4be4f7['error'][_0xb72b('0x17')]);}else{logger[_0xb72b('0x18')](_0xb72b('0x16'),_0x1c5d27,'request\x20sent');_0x6fa33e(_0x4be4f7[_0xb72b('0x19')][_0xb72b('0x17')]);}})[_0xb72b('0x1a')](function(_0x3c4648){logger['error'](_0xb72b('0x16'),_0x1c5d27,_0x3c4648);_0x18c404(_0x3c4648);});});}exports[_0xb72b('0x1b')]=function(_0x1f75cf){var _0x1b973b=this;return new Promise(function(_0x11229a,_0x160616){return db['ChatMessage'][_0xb72b('0x1c')](_0x1f75cf[_0xb72b('0x1d')],{'raw':_0x1f75cf['options']?_0x1f75cf[_0xb72b('0x1e')][_0xb72b('0x1f')]===undefined?!![]:![]:!![]})[_0xb72b('0x11')](function(_0xefdf34){logger[_0xb72b('0x18')](_0xb72b('0x1b'),_0x1f75cf);logger['debug'](_0xb72b('0x1b'),_0x1f75cf,JSON[_0xb72b('0x20')](_0xefdf34));_0x11229a(_0xefdf34);})[_0xb72b('0x1a')](function(_0x5cf429){logger['error'](_0xb72b('0x1b'),_0x5cf429[_0xb72b('0x17')],_0x1f75cf);_0x160616(_0x1b973b[_0xb72b('0x15')](0x1f4,_0x5cf429[_0xb72b('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index 3abe425..ee1a73c 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 _0xc474=['removeListener','register','length','chatMessage:','./chatMessage.events','save','remove','emit'];(function(_0xfc4b96,_0x16acc3){var _0x52cc38=function(_0xe04b32){while(--_0xe04b32){_0xfc4b96['push'](_0xfc4b96['shift']());}};_0x52cc38(++_0x16acc3);}(_0xc474,0xfc));var _0x4c47=function(_0x500419,_0x549162){_0x500419=_0x500419-0x0;var _0x241c1a=_0xc474[_0x500419];return _0x241c1a;};'use strict';var ChatMessageEvents=require(_0x4c47('0x0'));var events=[_0x4c47('0x1'),_0x4c47('0x2'),'update'];function createListener(_0x29e5bf,_0x15bc09){return function(_0x1703cd){_0x15bc09[_0x4c47('0x3')](_0x29e5bf,_0x1703cd);};}function removeListener(_0x2b2443,_0x40b979){return function(){ChatMessageEvents[_0x4c47('0x4')](_0x2b2443,_0x40b979);};}exports[_0x4c47('0x5')]=function(_0x58db78){for(var _0x5aaf0e=0x0,_0x6aeef8=events[_0x4c47('0x6')];_0x5aaf0e<_0x6aeef8;_0x5aaf0e++){var _0x275a64=events[_0x5aaf0e];var _0x35a093=createListener(_0x4c47('0x7')+_0x275a64,_0x58db78);ChatMessageEvents['on'](_0x275a64,_0x35a093);}}; \ No newline at end of file +var _0x3bd7=['update','emit','removeListener','length','remove'];(function(_0x277999,_0x5ddf96){var _0x24b3d9=function(_0x332002){while(--_0x332002){_0x277999['push'](_0x277999['shift']());}};_0x24b3d9(++_0x5ddf96);}(_0x3bd7,0x199));var _0x73bd=function(_0x170772,_0x1f1ee7){_0x170772=_0x170772-0x0;var _0x3ef69c=_0x3bd7[_0x170772];return _0x3ef69c;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=['save',_0x73bd('0x0'),_0x73bd('0x1')];function createListener(_0x22da7f,_0x4f66a5){return function(_0x4242ff){_0x4f66a5[_0x73bd('0x2')](_0x22da7f,_0x4242ff);};}function removeListener(_0x1b4214,_0x56fbc2){return function(){ChatMessageEvents[_0x73bd('0x3')](_0x1b4214,_0x56fbc2);};}exports['register']=function(_0xe20fe9){for(var _0x1aa5e1=0x0,_0x4bca41=events[_0x73bd('0x4')];_0x1aa5e1<_0x4bca41;_0x1aa5e1++){var _0x4c1254=events[_0x1aa5e1];var _0x569bef=createListener('chatMessage:'+_0x4c1254,_0xe20fe9);ChatMessageEvents['on'](_0x4c1254,_0x569bef);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index 85b03e8..f9788a8 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 _0xe6e8=['show','post','chat','create','put','update','/:id/accept','accept','/:id/reject','delete','exports','multer','util','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','/describe','/:id'];(function(_0x495c9e,_0x398e3d){var _0x1a11b2=function(_0x10a4f6){while(--_0x10a4f6){_0x495c9e['push'](_0x495c9e['shift']());}};_0x1a11b2(++_0x398e3d);}(_0xe6e8,0x7e));var _0x8e6e=function(_0x46e8a6,_0x593b44){_0x46e8a6=_0x46e8a6-0x0;var _0x47e3ce=_0xe6e8[_0x46e8a6];return _0x47e3ce;};'use strict';var multer=require(_0x8e6e('0x0'));var util=require(_0x8e6e('0x1'));var path=require('path');var timeout=require(_0x8e6e('0x2'));var express=require(_0x8e6e('0x3'));var router=express['Router']();var fs_extra=require(_0x8e6e('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x8e6e('0x5'));var config=require(_0x8e6e('0x6'));var controller=require(_0x8e6e('0x7'));router[_0x8e6e('0x8')]('/',auth[_0x8e6e('0x9')](),controller['index']);router[_0x8e6e('0x8')](_0x8e6e('0xa'),auth[_0x8e6e('0x9')](),controller['describe']);router[_0x8e6e('0x8')](_0x8e6e('0xb'),auth[_0x8e6e('0x9')](),controller[_0x8e6e('0xc')]);router[_0x8e6e('0xd')]('/',auth[_0x8e6e('0x9')](),interaction['tracked'](_0x8e6e('0xe'),'chatmessage:create'),controller[_0x8e6e('0xf')]);router[_0x8e6e('0x10')]('/:id',controller[_0x8e6e('0x11')]);router[_0x8e6e('0x10')](_0x8e6e('0x12'),auth[_0x8e6e('0x9')](),controller[_0x8e6e('0x13')]);router[_0x8e6e('0x10')](_0x8e6e('0x14'),auth['isAuthenticated'](),controller['reject']);router[_0x8e6e('0x15')]('/:id',auth[_0x8e6e('0x9')](),controller['destroy']);module[_0x8e6e('0x16')]=router; \ No newline at end of file +var _0x0181=['util','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','describe','/:id','show','post','tracked','chat','create','put','update','/:id/accept','destroy'];(function(_0x49a1a0,_0x48f776){var _0x518a4f=function(_0x313633){while(--_0x313633){_0x49a1a0['push'](_0x49a1a0['shift']());}};_0x518a4f(++_0x48f776);}(_0x0181,0x1a4));var _0x1018=function(_0x1b70e3,_0x3a15b1){_0x1b70e3=_0x1b70e3-0x0;var _0x1452ab=_0x0181[_0x1b70e3];return _0x1452ab;};'use strict';var multer=require('multer');var util=require(_0x1018('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x1018('0x1'));var router=express['Router']();var fs_extra=require(_0x1018('0x2'));var auth=require(_0x1018('0x3'));var interaction=require(_0x1018('0x4'));var config=require(_0x1018('0x5'));var controller=require(_0x1018('0x6'));router[_0x1018('0x7')]('/',auth[_0x1018('0x8')](),controller['index']);router[_0x1018('0x7')]('/describe',auth[_0x1018('0x8')](),controller[_0x1018('0x9')]);router[_0x1018('0x7')](_0x1018('0xa'),auth[_0x1018('0x8')](),controller[_0x1018('0xb')]);router[_0x1018('0xc')]('/',auth[_0x1018('0x8')](),interaction[_0x1018('0xd')](_0x1018('0xe'),'chatmessage:create'),controller[_0x1018('0xf')]);router[_0x1018('0x10')]('/:id',controller[_0x1018('0x11')]);router['put'](_0x1018('0x12'),auth['isAuthenticated'](),controller['accept']);router['put']('/:id/reject',auth[_0x1018('0x8')](),controller['reject']);router['delete'](_0x1018('0xa'),auth['isAuthenticated'](),controller[_0x1018('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index 195be09..13ffccf 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 _0xf016=['TEXT','exports'];(function(_0x50a448,_0x3d1a4d){var _0x5da8c6=function(_0x3310a6){while(--_0x3310a6){_0x50a448['push'](_0x50a448['shift']());}};_0x5da8c6(++_0x3d1a4d);}(_0xf016,0x13f));var _0x6f01=function(_0x485142,_0x13f9bc){_0x485142=_0x485142-0x0;var _0x5df234=_0xf016[_0x485142];return _0x5df234;};'use strict';var Sequelize=require('sequelize');module[_0x6f01('0x0')]={'body':{'type':Sequelize[_0x6f01('0x1')]('medium'),'allowNull':![]}}; \ No newline at end of file +var _0x975e=['TEXT','medium','sequelize'];(function(_0x562362,_0x5d54f4){var _0x3a18ce=function(_0x4b96ed){while(--_0x4b96ed){_0x562362['push'](_0x562362['shift']());}};_0x3a18ce(++_0x5d54f4);}(_0x975e,0xcb));var _0xe975=function(_0x10ca6f,_0x2906b6){_0x10ca6f=_0x10ca6f-0x0;var _0x4a284f=_0x975e[_0x10ca6f];return _0x4a284f;};'use strict';var Sequelize=require(_0xe975('0x0'));module['exports']={'body':{'type':Sequelize[_0xe975('0x1')](_0xe975('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 db9e6ec..ad3dcf2 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(_0x295ee0,_0x4a1afe){var _0x443a03=function(_0x1b015f){while(--_0x1b015f){_0x295ee0['push'](_0x295ee0['shift']());}};_0x443a03(++_0x4a1afe);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));}; \ No newline at end of file +var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x1c546c,_0x5c57cb){var _0x2cc384=function(_0x4dee11){while(--_0x4dee11){_0x1c546c['push'](_0x1c546c['shift']());}};_0x2cc384(++_0x5c57cb);}(_0x7a54,0x106));var _0x47a5=function(_0x2d247b,_0x5e3f41){_0x2d247b=_0x2d247b-0x0;var _0x533a73=_0x7a54[_0x2d247b];return _0x533a73;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index 803a89e..1b3db62 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 _0x41b1=['moment','request-promise','path','../../config/environment','./chatOfflineMessage.attributes','exports','define','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x41b1,0x112));var _0x141b=function(_0x10e8ed,_0x384a0d){_0x10e8ed=_0x10e8ed-0x0;var _0x4aea4a=_0x41b1[_0x10e8ed];return _0x4aea4a;};'use strict';var _=require(_0x141b('0x0'));var util=require(_0x141b('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x141b('0x2'));var BPromise=require('bluebird');var rp=require(_0x141b('0x3'));var fs=require('fs');var path=require(_0x141b('0x4'));var rimraf=require('rimraf');var config=require(_0x141b('0x5'));var attributes=require(_0x141b('0x6'));module[_0x141b('0x7')]=function(_0x302d3d,_0x3614a8){return _0x302d3d[_0x141b('0x8')]('ChatOfflineMessage',attributes,{'tableName':_0x141b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x141b('0xa'),'collate':_0x141b('0xb')});}; \ No newline at end of file +var _0x98ba=['./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x29df9a,_0x42aff3){var _0x3a8e96=function(_0x70fbe7){while(--_0x70fbe7){_0x29df9a['push'](_0x29df9a['shift']());}};_0x3a8e96(++_0x42aff3);}(_0x98ba,0x1e7));var _0xa98b=function(_0x3443ad,_0x99b42f){_0x3443ad=_0x3443ad-0x0;var _0xd51860=_0x98ba[_0x3443ad];return _0xd51860;};'use strict';var _=require(_0xa98b('0x0'));var util=require(_0xa98b('0x1'));var logger=require(_0xa98b('0x2'))('api');var moment=require(_0xa98b('0x3'));var BPromise=require(_0xa98b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa98b('0x5'));var rimraf=require(_0xa98b('0x6'));var config=require(_0xa98b('0x7'));var attributes=require(_0xa98b('0x8'));module[_0xa98b('0x9')]=function(_0x4323bc,_0x234cdf){return _0x4323bc[_0xa98b('0xa')](_0xa98b('0xb'),attributes,{'tableName':_0xa98b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa98b('0xd'),'collate':_0xa98b('0xe')});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index 851d908..c1cc3b4 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 _0xd33e=['client','http','request','then','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0xd33e,0x1b7));var _0xed33=function(_0x590cd0,_0x11bfd4){_0x590cd0=_0x590cd0-0x0;var _0x208eb0=_0xd33e[_0x590cd0];return _0x208eb0;};'use strict';var _=require(_0xed33('0x0'));var util=require('util');var moment=require(_0xed33('0x1'));var BPromise=require(_0xed33('0x2'));var rs=require(_0xed33('0x3'));var fs=require('fs');var Redis=require(_0xed33('0x4'));var db=require(_0xed33('0x5'))['db'];var utils=require(_0xed33('0x6'));var logger=require(_0xed33('0x7'))(_0xed33('0x8'));var config=require(_0xed33('0x9'));var jayson=require(_0xed33('0xa'));var client=jayson[_0xed33('0xb')][_0xed33('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x57d0e7,_0x136d9d,_0x30ee8b){return new BPromise(function(_0x2587c9,_0x484227){return client[_0xed33('0xd')](_0x57d0e7,_0x30ee8b)[_0xed33('0xe')](function(_0xbea503){logger['info'](_0xed33('0xf'),_0x136d9d,_0xed33('0x10'));logger[_0xed33('0x11')](_0xed33('0x12'),_0x136d9d,_0xed33('0x10'),JSON[_0xed33('0x13')](_0xbea503));if(_0xbea503[_0xed33('0x14')]){if(_0xbea503['error']['code']===0x1f4){logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0x136d9d,_0xbea503['error']['message']);return _0x484227(_0xbea503[_0xed33('0x14')][_0xed33('0x15')]);}logger[_0xed33('0x14')](_0xed33('0xf'),_0x136d9d,_0xbea503[_0xed33('0x14')]['message']);return _0x2587c9(_0xbea503[_0xed33('0x14')][_0xed33('0x15')]);}else{logger[_0xed33('0x16')](_0xed33('0xf'),_0x136d9d,_0xed33('0x10'));_0x2587c9(_0xbea503[_0xed33('0x17')][_0xed33('0x15')]);}})[_0xed33('0x18')](function(_0xc5c97b){logger['error'](_0xed33('0xf'),_0x136d9d,_0xc5c97b);_0x484227(_0xc5c97b);});});} \ No newline at end of file +var _0x7940=['http','then','info','request\x20sent','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatOfflineMessage,\x20%s,\x20%s','message','result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x4ce050,_0x13941e){var _0x5211d8=function(_0x227b16){while(--_0x227b16){_0x4ce050['push'](_0x4ce050['shift']());}};_0x5211d8(++_0x13941e);}(_0x7940,0x1ee));var _0x0794=function(_0x5c2618,_0x688bdc){_0x5c2618=_0x5c2618-0x0;var _0x4cde44=_0x7940[_0x5c2618];return _0x4cde44;};'use strict';var _=require(_0x0794('0x0'));var util=require('util');var moment=require(_0x0794('0x1'));var BPromise=require(_0x0794('0x2'));var rs=require(_0x0794('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0794('0x4'))['db'];var utils=require(_0x0794('0x5'));var logger=require(_0x0794('0x6'))(_0x0794('0x7'));var config=require('../../config/environment');var jayson=require(_0x0794('0x8'));var client=jayson[_0x0794('0x9')][_0x0794('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xc61194,_0x10b4e9,_0x46f141){return new BPromise(function(_0xbdc4ac,_0x597be5){return client['request'](_0xc61194,_0x46f141)[_0x0794('0xb')](function(_0x46c26a){logger[_0x0794('0xc')]('ChatOfflineMessage,\x20%s,\x20%s',_0x10b4e9,_0x0794('0xd'));logger['debug'](_0x0794('0xe'),_0x10b4e9,_0x0794('0xd'),JSON[_0x0794('0xf')](_0x46c26a));if(_0x46c26a[_0x0794('0x10')]){if(_0x46c26a[_0x0794('0x10')][_0x0794('0x11')]===0x1f4){logger[_0x0794('0x10')](_0x0794('0x12'),_0x10b4e9,_0x46c26a[_0x0794('0x10')][_0x0794('0x13')]);return _0x597be5(_0x46c26a[_0x0794('0x10')]['message']);}logger[_0x0794('0x10')](_0x0794('0x12'),_0x10b4e9,_0x46c26a[_0x0794('0x10')][_0x0794('0x13')]);return _0xbdc4ac(_0x46c26a[_0x0794('0x10')][_0x0794('0x13')]);}else{logger['info'](_0x0794('0x12'),_0x10b4e9,'request\x20sent');_0xbdc4ac(_0x46c26a[_0x0794('0x14')][_0x0794('0x13')]);}})['catch'](function(_0x66d7dd){logger[_0x0794('0x10')](_0x0794('0x12'),_0x10b4e9,_0x66d7dd);_0x597be5(_0x66d7dd);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index 0b20c84..282c062 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 _0x8463=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatOfflineMessage.controller','get','isAuthenticated','index','/describe','describe','show','post','create','put','/:id','delete','destroy','util','path','connect-timeout'];(function(_0x3ef5e9,_0x309745){var _0x3d12b5=function(_0x2bcde4){while(--_0x2bcde4){_0x3ef5e9['push'](_0x3ef5e9['shift']());}};_0x3d12b5(++_0x309745);}(_0x8463,0x18c));var _0x3846=function(_0x27bfd2,_0x54c745){_0x27bfd2=_0x27bfd2-0x0;var _0x578a86=_0x8463[_0x27bfd2];return _0x578a86;};'use strict';var multer=require('multer');var util=require(_0x3846('0x0'));var path=require(_0x3846('0x1'));var timeout=require(_0x3846('0x2'));var express=require(_0x3846('0x3'));var router=express[_0x3846('0x4')]();var fs_extra=require(_0x3846('0x5'));var auth=require(_0x3846('0x6'));var interaction=require(_0x3846('0x7'));var config=require('../../config/environment');var controller=require(_0x3846('0x8'));router[_0x3846('0x9')]('/',auth[_0x3846('0xa')](),controller[_0x3846('0xb')]);router[_0x3846('0x9')](_0x3846('0xc'),auth['isAuthenticated'](),controller[_0x3846('0xd')]);router['get']('/:id',auth[_0x3846('0xa')](),controller[_0x3846('0xe')]);router[_0x3846('0xf')]('/',auth[_0x3846('0xa')](),controller[_0x3846('0x10')]);router[_0x3846('0x11')](_0x3846('0x12'),auth[_0x3846('0xa')](),controller['update']);router[_0x3846('0x13')](_0x3846('0x12'),auth[_0x3846('0xa')](),controller[_0x3846('0x14')]);module['exports']=router; \ No newline at end of file +var _0x1769=['/:id','update','delete','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','isAuthenticated','index','get','/describe','post','create','put'];(function(_0x2aaab1,_0x24d92a){var _0x3a5635=function(_0x10d430){while(--_0x10d430){_0x2aaab1['push'](_0x2aaab1['shift']());}};_0x3a5635(++_0x24d92a);}(_0x1769,0xad));var _0x9176=function(_0x4b8012,_0x50d4e5){_0x4b8012=_0x4b8012-0x0;var _0xb36d5f=_0x1769[_0x4b8012];return _0xb36d5f;};'use strict';var multer=require(_0x9176('0x0'));var util=require(_0x9176('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x9176('0x2'));var router=express[_0x9176('0x3')]();var fs_extra=require(_0x9176('0x4'));var auth=require(_0x9176('0x5'));var interaction=require(_0x9176('0x6'));var config=require(_0x9176('0x7'));var controller=require(_0x9176('0x8'));router['get']('/',auth[_0x9176('0x9')](),controller[_0x9176('0xa')]);router[_0x9176('0xb')](_0x9176('0xc'),auth[_0x9176('0x9')](),controller['describe']);router[_0x9176('0xb')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x9176('0xd')]('/',auth[_0x9176('0x9')](),controller[_0x9176('0xe')]);router[_0x9176('0xf')](_0x9176('0x10'),auth[_0x9176('0x9')](),controller[_0x9176('0x11')]);router[_0x9176('0x12')](_0x9176('0x10'),auth['isAuthenticated'](),controller[_0x9176('0x13')]);module[_0x9176('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 afd2eee..92bc435 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 _0x7f8a=['timeout','mouseOver','sequelize','STRING','ENUM'];(function(_0x1127ea,_0x1bb829){var _0x3c8008=function(_0x446150){while(--_0x446150){_0x1127ea['push'](_0x1127ea['shift']());}};_0x3c8008(++_0x1bb829);}(_0x7f8a,0xbb));var _0xa7f8=function(_0x4ffaa0,_0x2c494b){_0x4ffaa0=_0x4ffaa0-0x0;var _0x37e66c=_0x7f8a[_0x4ffaa0];return _0x37e66c;};'use strict';var Sequelize=require(_0xa7f8('0x0'));module['exports']={'name':{'type':Sequelize[_0xa7f8('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xa7f8('0x2')]('mouseOver',_0xa7f8('0x3')),'defaultValue':_0xa7f8('0x4')},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x43bf=['ENUM','mouseOver','INTEGER','sequelize','exports'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x43bf,0xd5));var _0xf43b=function(_0x51d8b2,_0x3796da){_0x51d8b2=_0x51d8b2-0x0;var _0x2db8db=_0x43bf[_0x51d8b2];return _0x2db8db;};'use strict';var Sequelize=require(_0xf43b('0x0'));module[_0xf43b('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xf43b('0x2')](_0xf43b('0x3'),'timeout'),'defaultValue':_0xf43b('0x3')},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xf43b('0x4')]}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index 3275738..ef41f05 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 _0x2bd8=['count','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','show','ChatProactiveAction','rawAttributes','query','intersection','model','attributes','fields','length','includeAll','include','merge','options','find','catch','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','../../components/auth/service','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit'];(function(_0x13187a,_0x2fcec4){var _0x65b85f=function(_0x33bf1f){while(--_0x33bf1f){_0x13187a['push'](_0x13187a['shift']());}};_0x65b85f(++_0x2fcec4);}(_0x2bd8,0x130));var _0x82bd=function(_0x4519eb,_0x320dea){_0x4519eb=_0x4519eb-0x0;var _0x3198a5=_0x2bd8[_0x4519eb];return _0x3198a5;};'use strict';var emlformat=require(_0x82bd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x82bd('0x1'));var jsonpatch=require(_0x82bd('0x2'));var rp=require(_0x82bd('0x3'));var moment=require(_0x82bd('0x4'));var BPromise=require(_0x82bd('0x5'));var Mustache=require(_0x82bd('0x6'));var util=require(_0x82bd('0x7'));var path=require('path');var sox=require(_0x82bd('0x8'));var csv=require(_0x82bd('0x9'));var ejs=require(_0x82bd('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x82bd('0xb'));var squel=require(_0x82bd('0xc'));var crypto=require(_0x82bd('0xd'));var jsforce=require(_0x82bd('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x82bd('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x82bd('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x82bd('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0x82bd('0x11'));var config=require(_0x82bd('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x82bd('0x13'))['db'];function respondWithStatusCode(_0x5f1ab9,_0xfaccf7){_0xfaccf7=_0xfaccf7||0xcc;return function(_0x51e17e){if(_0x51e17e){return _0x5f1ab9[_0x82bd('0x14')](_0xfaccf7);}return _0x5f1ab9[_0x82bd('0x15')](_0xfaccf7)[_0x82bd('0x16')]();};}function respondWithResult(_0x2ca530,_0x58d82b){_0x58d82b=_0x58d82b||0xc8;return function(_0x446ffc){if(_0x446ffc){return _0x2ca530[_0x82bd('0x15')](_0x58d82b)['json'](_0x446ffc);}};}function respondWithFilteredResult(_0x3667ef,_0x4db39d){return function(_0x35dd09){if(_0x35dd09){var _0x433e7d=typeof _0x4db39d[_0x82bd('0x17')]===_0x82bd('0x18')&&typeof _0x4db39d[_0x82bd('0x19')]===_0x82bd('0x18');var _0x387d21=_0x35dd09[_0x82bd('0x1a')];var _0x31a350=_0x433e7d?0x0:_0x4db39d[_0x82bd('0x17')];var _0x390107=_0x433e7d?_0x35dd09[_0x82bd('0x1a')]:_0x4db39d[_0x82bd('0x17')]+_0x4db39d[_0x82bd('0x19')];var _0x4a1e62;if(_0x390107>=_0x387d21){_0x390107=_0x387d21;_0x4a1e62=0xc8;}else{_0x4a1e62=0xce;}_0x3667ef['status'](_0x4a1e62);return _0x3667ef[_0x82bd('0x1b')](_0x82bd('0x1c'),_0x31a350+'-'+_0x390107+'/'+_0x387d21)[_0x82bd('0x1d')](_0x35dd09);}return null;};}function patchUpdates(_0xc9fcdf){return function(_0x34899b){try{jsonpatch[_0x82bd('0x1e')](_0x34899b,_0xc9fcdf,!![]);}catch(_0x2c1810){return BPromise[_0x82bd('0x1f')](_0x2c1810);}return _0x34899b[_0x82bd('0x20')]();};}function saveUpdates(_0x3291cd,_0x2caa29){return function(_0x177025){if(_0x177025){return _0x177025[_0x82bd('0x21')](_0x3291cd)[_0x82bd('0x22')](function(_0x3d9f03){return _0x3d9f03;});}return null;};}function removeEntity(_0x2d9d95,_0x13a42a){return function(_0x3b6b93){if(_0x3b6b93){return _0x3b6b93[_0x82bd('0x23')]()['then'](function(){_0x2d9d95['status'](0xcc)[_0x82bd('0x16')]();});}};}function handleEntityNotFound(_0x436ecd,_0x1cb292){return function(_0x3eb6a5){if(!_0x3eb6a5){_0x436ecd[_0x82bd('0x14')](0x194);}return _0x3eb6a5;};}function handleError(_0x10d101,_0x3c7751){_0x3c7751=_0x3c7751||0x1f4;return function(_0xbef23b){logger[_0x82bd('0x24')](_0xbef23b[_0x82bd('0x25')]);if(_0xbef23b['name']){delete _0xbef23b['name'];}_0x10d101['status'](_0x3c7751)['send'](_0xbef23b);};}exports[_0x82bd('0x26')]=function(_0x52bcd8,_0x351d3d){var _0x190bca={'raw':!![],'where':{'id':_0x52bcd8['params']['id']}},_0x363ef9={};_0x363ef9['model']=_['keys'](db[_0x82bd('0x27')][_0x82bd('0x28')]);_0x363ef9[_0x82bd('0x29')]=_['keys'](_0x52bcd8[_0x82bd('0x29')]);_0x363ef9['filters']=_[_0x82bd('0x2a')](_0x363ef9[_0x82bd('0x2b')],_0x363ef9[_0x82bd('0x29')]);_0x190bca[_0x82bd('0x2c')]=_[_0x82bd('0x2a')](_0x363ef9[_0x82bd('0x2b')],qs['fields'](_0x52bcd8[_0x82bd('0x29')][_0x82bd('0x2d')]));_0x190bca[_0x82bd('0x2c')]=_0x190bca['attributes'][_0x82bd('0x2e')]?_0x190bca['attributes']:_0x363ef9['model'];if(_0x52bcd8[_0x82bd('0x29')][_0x82bd('0x2f')]){_0x190bca[_0x82bd('0x30')]=[{'all':!![]}];}_0x190bca=_[_0x82bd('0x31')]({},_0x190bca,_0x52bcd8[_0x82bd('0x32')]);return db[_0x82bd('0x27')][_0x82bd('0x33')](_0x190bca)[_0x82bd('0x22')](handleEntityNotFound(_0x351d3d,null))[_0x82bd('0x22')](respondWithResult(_0x351d3d,null))[_0x82bd('0x34')](handleError(_0x351d3d,null));};exports[_0x82bd('0x35')]=function(_0xe666bd,_0x29813b){return db[_0x82bd('0x27')][_0x82bd('0x35')](_0xe666bd[_0x82bd('0x36')],{})[_0x82bd('0x22')](respondWithResult(_0x29813b,0xc9))['catch'](handleError(_0x29813b,null));};exports['update']=function(_0x59319d,_0x3fea10){if(_0x59319d[_0x82bd('0x36')]['id']){delete _0x59319d['body']['id'];}return db[_0x82bd('0x27')]['find']({'where':{'id':_0x59319d['params']['id']}})['then'](handleEntityNotFound(_0x3fea10,null))[_0x82bd('0x22')](saveUpdates(_0x59319d[_0x82bd('0x36')],null))[_0x82bd('0x22')](respondWithResult(_0x3fea10,null))[_0x82bd('0x34')](handleError(_0x3fea10,null));};exports[_0x82bd('0x23')]=function(_0x4c3c38,_0x54e33f){return db['ChatProactiveAction'][_0x82bd('0x33')]({'where':{'id':_0x4c3c38['params']['id']}})['then'](handleEntityNotFound(_0x54e33f,null))[_0x82bd('0x22')](removeEntity(_0x54e33f,null))[_0x82bd('0x34')](handleError(_0x54e33f,null));}; \ No newline at end of file +var _0xbc8d=['apply','reject','save','update','then','destroy','stack','name','send','params','keys','ChatProactiveAction','rawAttributes','query','filters','intersection','model','fields','attributes','length','includeAll','include','options','catch','create','body','find','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','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','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range'];(function(_0x879e31,_0x139d02){var _0x3467e8=function(_0x544fc6){while(--_0x544fc6){_0x879e31['push'](_0x879e31['shift']());}};_0x3467e8(++_0x139d02);}(_0xbc8d,0x15b));var _0xdbc8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbc8d[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xdbc8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdbc8('0x1'));var jsonpatch=require(_0xdbc8('0x2'));var rp=require(_0xdbc8('0x3'));var moment=require(_0xdbc8('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xdbc8('0x5'));var util=require(_0xdbc8('0x6'));var path=require(_0xdbc8('0x7'));var sox=require('sox');var csv=require(_0xdbc8('0x8'));var ejs=require(_0xdbc8('0x9'));var fs=require('fs');var fs_extra=require(_0xdbc8('0xa'));var _=require('lodash');var squel=require(_0xdbc8('0xb'));var crypto=require('crypto');var jsforce=require(_0xdbc8('0xc'));var deskjs=require(_0xdbc8('0xd'));var toCsv=require('to-csv');var querystring=require(_0xdbc8('0xe'));var Papa=require(_0xdbc8('0xf'));var Redis=require(_0xdbc8('0x10'));var authService=require(_0xdbc8('0x11'));var qs=require(_0xdbc8('0x12'));var as=require(_0xdbc8('0x13'));var hardwareService=require(_0xdbc8('0x14'));var logger=require(_0xdbc8('0x15'))(_0xdbc8('0x16'));var utils=require(_0xdbc8('0x17'));var config=require(_0xdbc8('0x18'));var licenseUtil=require(_0xdbc8('0x19'));var db=require(_0xdbc8('0x1a'))['db'];function respondWithStatusCode(_0xa3a8c9,_0x2920a7){_0x2920a7=_0x2920a7||0xcc;return function(_0x4a6595){if(_0x4a6595){return _0xa3a8c9[_0xdbc8('0x1b')](_0x2920a7);}return _0xa3a8c9['status'](_0x2920a7)[_0xdbc8('0x1c')]();};}function respondWithResult(_0x40e6cf,_0x43765f){_0x43765f=_0x43765f||0xc8;return function(_0x3a7698){if(_0x3a7698){return _0x40e6cf[_0xdbc8('0x1d')](_0x43765f)[_0xdbc8('0x1e')](_0x3a7698);}};}function respondWithFilteredResult(_0x1d5d7e,_0x32c678){return function(_0x2f15c8){if(_0x2f15c8){var _0x34ccb8=typeof _0x32c678[_0xdbc8('0x1f')]===_0xdbc8('0x20')&&typeof _0x32c678[_0xdbc8('0x21')]===_0xdbc8('0x20');var _0x4cdb17=_0x2f15c8[_0xdbc8('0x22')];var _0x587b67=_0x34ccb8?0x0:_0x32c678['offset'];var _0x4b2ff3=_0x34ccb8?_0x2f15c8['count']:_0x32c678[_0xdbc8('0x1f')]+_0x32c678[_0xdbc8('0x21')];var _0x2a6c05;if(_0x4b2ff3>=_0x4cdb17){_0x4b2ff3=_0x4cdb17;_0x2a6c05=0xc8;}else{_0x2a6c05=0xce;}_0x1d5d7e[_0xdbc8('0x1d')](_0x2a6c05);return _0x1d5d7e[_0xdbc8('0x23')](_0xdbc8('0x24'),_0x587b67+'-'+_0x4b2ff3+'/'+_0x4cdb17)[_0xdbc8('0x1e')](_0x2f15c8);}return null;};}function patchUpdates(_0xd6f423){return function(_0x2f0b08){try{jsonpatch[_0xdbc8('0x25')](_0x2f0b08,_0xd6f423,!![]);}catch(_0x1fa280){return BPromise[_0xdbc8('0x26')](_0x1fa280);}return _0x2f0b08[_0xdbc8('0x27')]();};}function saveUpdates(_0x4c038b,_0x2af87d){return function(_0x4664f9){if(_0x4664f9){return _0x4664f9[_0xdbc8('0x28')](_0x4c038b)[_0xdbc8('0x29')](function(_0x15b996){return _0x15b996;});}return null;};}function removeEntity(_0x52a331,_0x2794fa){return function(_0x2126c2){if(_0x2126c2){return _0x2126c2[_0xdbc8('0x2a')]()[_0xdbc8('0x29')](function(){_0x52a331[_0xdbc8('0x1d')](0xcc)[_0xdbc8('0x1c')]();});}};}function handleEntityNotFound(_0xb7c29c,_0xbc557a){return function(_0x144d1c){if(!_0x144d1c){_0xb7c29c[_0xdbc8('0x1b')](0x194);}return _0x144d1c;};}function handleError(_0x139bca,_0x19886c){_0x19886c=_0x19886c||0x1f4;return function(_0x26064a){logger['error'](_0x26064a[_0xdbc8('0x2b')]);if(_0x26064a[_0xdbc8('0x2c')]){delete _0x26064a[_0xdbc8('0x2c')];}_0x139bca[_0xdbc8('0x1d')](_0x19886c)[_0xdbc8('0x2d')](_0x26064a);};}exports['show']=function(_0x27ef0e,_0x4f3bb8){var _0x137c8e={'raw':!![],'where':{'id':_0x27ef0e[_0xdbc8('0x2e')]['id']}},_0x372454={};_0x372454['model']=_[_0xdbc8('0x2f')](db[_0xdbc8('0x30')][_0xdbc8('0x31')]);_0x372454['query']=_[_0xdbc8('0x2f')](_0x27ef0e[_0xdbc8('0x32')]);_0x372454[_0xdbc8('0x33')]=_[_0xdbc8('0x34')](_0x372454[_0xdbc8('0x35')],_0x372454['query']);_0x137c8e['attributes']=_[_0xdbc8('0x34')](_0x372454['model'],qs[_0xdbc8('0x36')](_0x27ef0e['query']['fields']));_0x137c8e[_0xdbc8('0x37')]=_0x137c8e['attributes'][_0xdbc8('0x38')]?_0x137c8e[_0xdbc8('0x37')]:_0x372454[_0xdbc8('0x35')];if(_0x27ef0e[_0xdbc8('0x32')][_0xdbc8('0x39')]){_0x137c8e[_0xdbc8('0x3a')]=[{'all':!![]}];}_0x137c8e=_['merge']({},_0x137c8e,_0x27ef0e[_0xdbc8('0x3b')]);return db[_0xdbc8('0x30')]['find'](_0x137c8e)[_0xdbc8('0x29')](handleEntityNotFound(_0x4f3bb8,null))[_0xdbc8('0x29')](respondWithResult(_0x4f3bb8,null))[_0xdbc8('0x3c')](handleError(_0x4f3bb8,null));};exports['create']=function(_0x150cae,_0x14a105){return db[_0xdbc8('0x30')][_0xdbc8('0x3d')](_0x150cae[_0xdbc8('0x3e')],{})['then'](respondWithResult(_0x14a105,0xc9))['catch'](handleError(_0x14a105,null));};exports[_0xdbc8('0x28')]=function(_0x2a557e,_0x6eb2b7){if(_0x2a557e[_0xdbc8('0x3e')]['id']){delete _0x2a557e[_0xdbc8('0x3e')]['id'];}return db['ChatProactiveAction'][_0xdbc8('0x3f')]({'where':{'id':_0x2a557e[_0xdbc8('0x2e')]['id']}})[_0xdbc8('0x29')](handleEntityNotFound(_0x6eb2b7,null))[_0xdbc8('0x29')](saveUpdates(_0x2a557e['body'],null))[_0xdbc8('0x29')](respondWithResult(_0x6eb2b7,null))['catch'](handleError(_0x6eb2b7,null));};exports['destroy']=function(_0x5031e2,_0x4a67a4){return db[_0xdbc8('0x30')][_0xdbc8('0x3f')]({'where':{'id':_0x5031e2['params']['id']}})[_0xdbc8('0x29')](handleEntityNotFound(_0x4a67a4,null))[_0xdbc8('0x29')](removeEntity(_0x4a67a4,null))[_0xdbc8('0x3c')](handleError(_0x4a67a4,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index 703e457..baa5f9b 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 _0xbfb6=['../../config/environment','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','chat_proactive_actions','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x1b0b78,_0x7783e5){var _0x5b41c4=function(_0x5024e1){while(--_0x5024e1){_0x1b0b78['push'](_0x1b0b78['shift']());}};_0x5b41c4(++_0x7783e5);}(_0xbfb6,0x19c));var _0x6bfb=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xbfb6[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require('lodash');var util=require(_0x6bfb('0x0'));var logger=require(_0x6bfb('0x1'))(_0x6bfb('0x2'));var moment=require(_0x6bfb('0x3'));var BPromise=require(_0x6bfb('0x4'));var rp=require(_0x6bfb('0x5'));var fs=require('fs');var path=require(_0x6bfb('0x6'));var rimraf=require(_0x6bfb('0x7'));var config=require(_0x6bfb('0x8'));var attributes=require(_0x6bfb('0x9'));module[_0x6bfb('0xa')]=function(_0x2a25ca,_0x50d053){return _0x2a25ca[_0x6bfb('0xb')](_0x6bfb('0xc'),attributes,{'tableName':_0x6bfb('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc5f8=['./chatProactiveAction.attributes','exports','define','ChatProactiveAction','lodash','util','../../config/logger','moment','request-promise','path','rimraf'];(function(_0x30c57f,_0x306255){var _0x2efd7b=function(_0x28bbb2){while(--_0x28bbb2){_0x30c57f['push'](_0x30c57f['shift']());}};_0x2efd7b(++_0x306255);}(_0xc5f8,0x10c));var _0x8c5f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc5f8[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x8c5f('0x0'));var util=require(_0x8c5f('0x1'));var logger=require(_0x8c5f('0x2'))('api');var moment=require(_0x8c5f('0x3'));var BPromise=require('bluebird');var rp=require(_0x8c5f('0x4'));var fs=require('fs');var path=require(_0x8c5f('0x5'));var rimraf=require(_0x8c5f('0x6'));var config=require('../../config/environment');var attributes=require(_0x8c5f('0x7'));module[_0x8c5f('0x8')]=function(_0x105a71,_0x52ce04){return _0x105a71[_0x8c5f('0x9')](_0x8c5f('0xa'),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 86e1b70..32f57da 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 _0x7b3d=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird'];(function(_0x4baae2,_0x487ab6){var _0x1a2285=function(_0x1cea47){while(--_0x1cea47){_0x4baae2['push'](_0x4baae2['shift']());}};_0x1a2285(++_0x487ab6);}(_0x7b3d,0x19a));var _0xd7b3=function(_0x5d2a66,_0x5387a3){_0x5d2a66=_0x5d2a66-0x0;var _0x52a709=_0x7b3d[_0x5d2a66];return _0x52a709;};'use strict';var _=require(_0xd7b3('0x0'));var util=require(_0xd7b3('0x1'));var moment=require(_0xd7b3('0x2'));var BPromise=require(_0xd7b3('0x3'));var rs=require(_0xd7b3('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd7b3('0x5'))['db'];var utils=require(_0xd7b3('0x6'));var logger=require(_0xd7b3('0x7'))(_0xd7b3('0x8'));var config=require('../../config/environment');var jayson=require(_0xd7b3('0x9'));var client=jayson[_0xd7b3('0xa')][_0xd7b3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xb41ad1,_0x52bf2f,_0x9e09a3){return new BPromise(function(_0x220526,_0x24903f){return client['request'](_0xb41ad1,_0x9e09a3)[_0xd7b3('0xc')](function(_0x2190c1){logger[_0xd7b3('0xd')](_0xd7b3('0xe'),_0x52bf2f,_0xd7b3('0xf'));logger[_0xd7b3('0x10')](_0xd7b3('0x11'),_0x52bf2f,_0xd7b3('0xf'),JSON[_0xd7b3('0x12')](_0x2190c1));if(_0x2190c1[_0xd7b3('0x13')]){if(_0x2190c1[_0xd7b3('0x13')][_0xd7b3('0x14')]===0x1f4){logger[_0xd7b3('0x13')](_0xd7b3('0xe'),_0x52bf2f,_0x2190c1[_0xd7b3('0x13')][_0xd7b3('0x15')]);return _0x24903f(_0x2190c1[_0xd7b3('0x13')][_0xd7b3('0x15')]);}logger[_0xd7b3('0x13')](_0xd7b3('0xe'),_0x52bf2f,_0x2190c1[_0xd7b3('0x13')][_0xd7b3('0x15')]);return _0x220526(_0x2190c1['error'][_0xd7b3('0x15')]);}else{logger[_0xd7b3('0xd')](_0xd7b3('0xe'),_0x52bf2f,_0xd7b3('0xf'));_0x220526(_0x2190c1['result']['message']);}})[_0xd7b3('0x16')](function(_0x4d605e){logger[_0xd7b3('0x13')](_0xd7b3('0xe'),_0x52bf2f,_0x4d605e);_0x24903f(_0x4d605e);});});} \ No newline at end of file +var _0xce21=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatProactiveAction,\x20%s,\x20%s','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x363879,_0x4a5e1f){var _0x225b41=function(_0x124b95){while(--_0x124b95){_0x363879['push'](_0x363879['shift']());}};_0x225b41(++_0x4a5e1f);}(_0xce21,0x1a1));var _0x1ce2=function(_0x513aa5,_0x1fba79){_0x513aa5=_0x513aa5-0x0;var _0x1a1a7c=_0xce21[_0x513aa5];return _0x1a1a7c;};'use strict';var _=require(_0x1ce2('0x0'));var util=require(_0x1ce2('0x1'));var moment=require(_0x1ce2('0x2'));var BPromise=require(_0x1ce2('0x3'));var rs=require(_0x1ce2('0x4'));var fs=require('fs');var Redis=require(_0x1ce2('0x5'));var db=require(_0x1ce2('0x6'))['db'];var utils=require(_0x1ce2('0x7'));var logger=require(_0x1ce2('0x8'))(_0x1ce2('0x9'));var config=require(_0x1ce2('0xa'));var jayson=require(_0x1ce2('0xb'));var client=jayson[_0x1ce2('0xc')][_0x1ce2('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x4f8f74,_0x5c9859,_0x3ea589){return new BPromise(function(_0x43a2e2,_0x1cf6cd){return client[_0x1ce2('0xe')](_0x4f8f74,_0x3ea589)[_0x1ce2('0xf')](function(_0xc82add){logger[_0x1ce2('0x10')](_0x1ce2('0x11'),_0x5c9859,'request\x20sent');logger[_0x1ce2('0x12')](_0x1ce2('0x13'),_0x5c9859,_0x1ce2('0x14'),JSON['stringify'](_0xc82add));if(_0xc82add[_0x1ce2('0x15')]){if(_0xc82add[_0x1ce2('0x15')][_0x1ce2('0x16')]===0x1f4){logger[_0x1ce2('0x15')]('ChatProactiveAction,\x20%s,\x20%s',_0x5c9859,_0xc82add[_0x1ce2('0x15')][_0x1ce2('0x17')]);return _0x1cf6cd(_0xc82add[_0x1ce2('0x15')][_0x1ce2('0x17')]);}logger['error'](_0x1ce2('0x11'),_0x5c9859,_0xc82add['error'][_0x1ce2('0x17')]);return _0x43a2e2(_0xc82add[_0x1ce2('0x15')][_0x1ce2('0x17')]);}else{logger[_0x1ce2('0x10')]('ChatProactiveAction,\x20%s,\x20%s',_0x5c9859,'request\x20sent');_0x43a2e2(_0xc82add[_0x1ce2('0x18')][_0x1ce2('0x17')]);}})['catch'](function(_0x5d6462){logger[_0x1ce2('0x15')](_0x1ce2('0x11'),_0x5c9859,_0x5d6462);_0x1cf6cd(_0x5d6462);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index 5e7beba..0579660 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 _0xac9d=['get','/:id','isAuthenticated','show','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x2c6e27,_0x437207){var _0xe7808e=function(_0x59b9ae){while(--_0x59b9ae){_0x2c6e27['push'](_0x2c6e27['shift']());}};_0xe7808e(++_0x437207);}(_0xac9d,0x14d));var _0xdac9=function(_0x3dc1c6,_0x8529a1){_0x3dc1c6=_0x3dc1c6-0x0;var _0x3c82ce=_0xac9d[_0x3dc1c6];return _0x3c82ce;};'use strict';var multer=require(_0xdac9('0x0'));var util=require(_0xdac9('0x1'));var path=require(_0xdac9('0x2'));var timeout=require(_0xdac9('0x3'));var express=require(_0xdac9('0x4'));var router=express[_0xdac9('0x5')]();var fs_extra=require(_0xdac9('0x6'));var auth=require(_0xdac9('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xdac9('0x8'));var controller=require('./chatProactiveAction.controller');router[_0xdac9('0x9')](_0xdac9('0xa'),auth[_0xdac9('0xb')](),controller[_0xdac9('0xc')]);router[_0xdac9('0xd')]('/',auth[_0xdac9('0xb')](),controller['create']);router[_0xdac9('0xe')]('/:id',auth[_0xdac9('0xb')](),controller[_0xdac9('0xf')]);router[_0xdac9('0x10')](_0xdac9('0xa'),auth[_0xdac9('0xb')](),controller[_0xdac9('0x11')]);module[_0xdac9('0x12')]=router; \ No newline at end of file +var _0xb138=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','/:id','isAuthenticated','post','create','destroy','exports','multer','util','path'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0xb138,0x1dd));var _0x8b13=function(_0x142048,_0x5c8831){_0x142048=_0x142048-0x0;var _0x43f0fe=_0xb138[_0x142048];return _0x43f0fe;};'use strict';var multer=require(_0x8b13('0x0'));var util=require(_0x8b13('0x1'));var path=require(_0x8b13('0x2'));var timeout=require(_0x8b13('0x3'));var express=require(_0x8b13('0x4'));var router=express[_0x8b13('0x5')]();var fs_extra=require(_0x8b13('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x8b13('0x7'));var config=require(_0x8b13('0x8'));var controller=require(_0x8b13('0x9'));router['get'](_0x8b13('0xa'),auth[_0x8b13('0xb')](),controller['show']);router[_0x8b13('0xc')]('/',auth[_0x8b13('0xb')](),controller[_0x8b13('0xd')]);router['put'](_0x8b13('0xa'),auth[_0x8b13('0xb')](),controller['update']);router['delete'](_0x8b13('0xa'),auth[_0x8b13('0xb')](),controller[_0x8b13('0xe')]);module[_0x8b13('0xf')]=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index a4c342f..31a454e 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 _0xff0d=['roundrobin','exports','STRING','name','INTEGER','ENUM','rrmemory','beepall'];(function(_0x491a7f,_0x28bb80){var _0x3d8f44=function(_0xdaa716){while(--_0xdaa716){_0x491a7f['push'](_0x491a7f['shift']());}};_0x3d8f44(++_0x28bb80);}(_0xff0d,0x109));var _0xdff0=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0xff0d[_0x3e5086];return _0xfeb102;};'use strict';var Sequelize=require('sequelize');module[_0xdff0('0x0')]={'name':{'type':Sequelize[_0xdff0('0x1')],'unique':_0xdff0('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xdff0('0x1')]},'timeout':{'type':Sequelize[_0xdff0('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xdff0('0x4')](_0xdff0('0x5'),_0xdff0('0x6'),_0xdff0('0x7'))}}; \ No newline at end of file +var _0xa71b=['sequelize','exports','STRING','name','beepall'];(function(_0x2d259a,_0x31068e){var _0x16f9d5=function(_0xfdf4af){while(--_0xfdf4af){_0x2d259a['push'](_0x2d259a['shift']());}};_0x16f9d5(++_0x31068e);}(_0xa71b,0x17c));var _0xba71=function(_0x4978f9,_0x47fddb){_0x4978f9=_0x4978f9-0x0;var _0x500a2=_0xa71b[_0x4978f9];return _0x500a2;};'use strict';var Sequelize=require(_0xba71('0x0'));module[_0xba71('0x1')]={'name':{'type':Sequelize[_0xba71('0x2')],'unique':_0xba71('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory',_0xba71('0x4'),'roundrobin')}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index 4d61895..6f76d4e 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 _0x0ee9=['Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','describe','getMembers','findOne','ChatQueueId','UserChatQueue','User','UserId','agent','chatPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','addTeams','ids','Agents','online','interface','flatMap','params','sequelize','transaction','forEach','emit','userChatQueue:save','select','tq.TeamId','from','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','push','toString','QueryTypes','SELECT','TeamId','includes','all','union','value','removeTeams','isEmpty','removeAgents','userChatQueue:remove','addAgents','omit','spread','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','jayson/promise','http','then','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','end','status','json','limit','undefined','count','offset','set','Content-Range','apply','reject','update','destroy','get','ChatQueues','UserProfileResource','stack','name','send','index','ChatQueue','fieldName','type','map','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','rawAttributes','create','body','user'];(function(_0x39d25b,_0x1aa143){var _0x48ceaf=function(_0x417281){while(--_0x417281){_0x39d25b['push'](_0x39d25b['shift']());}};_0x48ceaf(++_0x1aa143);}(_0x0ee9,0xd1));var _0x90ee=function(_0xbdae1c,_0x64a4c6){_0xbdae1c=_0xbdae1c-0x0;var _0x1bfa84=_0x0ee9[_0xbdae1c];return _0x1bfa84;};'use strict';var emlformat=require(_0x90ee('0x0'));var rimraf=require(_0x90ee('0x1'));var zipdir=require(_0x90ee('0x2'));var jsonpatch=require(_0x90ee('0x3'));var rp=require('request-promise');var moment=require(_0x90ee('0x4'));var BPromise=require(_0x90ee('0x5'));var Mustache=require('mustache');var util=require(_0x90ee('0x6'));var path=require('path');var sox=require(_0x90ee('0x7'));var csv=require(_0x90ee('0x8'));var ejs=require(_0x90ee('0x9'));var fs=require('fs');var fs_extra=require(_0x90ee('0xa'));var _=require(_0x90ee('0xb'));var squel=require('squel');var crypto=require(_0x90ee('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x90ee('0xd'));var toCsv=require('to-csv');var querystring=require(_0x90ee('0xe'));var Papa=require(_0x90ee('0xf'));var Redis=require(_0x90ee('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x90ee('0x11'));var as=require(_0x90ee('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x90ee('0x13'))(_0x90ee('0x14'));var utils=require('../../config/utils');var config=require(_0x90ee('0x15'));var licenseUtil=require(_0x90ee('0x16'));var db=require(_0x90ee('0x17'))['db'];config[_0x90ee('0x18')]=_[_0x90ee('0x19')](config['redis'],{'host':_0x90ee('0x1a'),'port':0x18eb});var socket=require(_0x90ee('0x1b'))(new Redis(config[_0x90ee('0x18')]));require(_0x90ee('0x1c'))[_0x90ee('0x1d')](socket);var jayson=require(_0x90ee('0x1e'));var client=jayson['client'][_0x90ee('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x58cdfe,_0x109523,_0x964822,_0x2700bb){return new BPromise(function(_0x1125f9,_0x5ef26d){var _0x306af7=_0x2700bb||client;return _0x306af7['request'](_0x58cdfe,_0x964822)[_0x90ee('0x20')](function(_0x5b7bd7){logger['info'](_0x90ee('0x21'),_0x109523,_0x90ee('0x22'));logger['debug'](_0x90ee('0x23'),_0x109523,_0x90ee('0x22'),JSON['stringify'](_0x5b7bd7));if(_0x5b7bd7[_0x90ee('0x24')]){if(_0x5b7bd7[_0x90ee('0x24')][_0x90ee('0x25')]===0x1f4){logger[_0x90ee('0x24')](_0x90ee('0x21'),_0x109523,_0x5b7bd7[_0x90ee('0x24')][_0x90ee('0x26')]);return _0x5ef26d(_0x5b7bd7[_0x90ee('0x24')]['message']);}logger[_0x90ee('0x24')]('ChatQueue,\x20%s,\x20%s',_0x109523,_0x5b7bd7[_0x90ee('0x24')][_0x90ee('0x26')]);return _0x1125f9(_0x5b7bd7[_0x90ee('0x24')][_0x90ee('0x26')]);}else{logger['info']('ChatQueue,\x20%s,\x20%s',_0x109523,_0x90ee('0x22'));_0x1125f9(_0x5b7bd7[_0x90ee('0x27')]['message']);}})[_0x90ee('0x28')](function(_0x58e205){logger[_0x90ee('0x24')](_0x90ee('0x21'),_0x109523,_0x58e205);_0x5ef26d(_0x58e205);});});}function respondWithStatusCode(_0x132db1,_0x4bfa51){_0x4bfa51=_0x4bfa51||0xcc;return function(_0x62a19f){if(_0x62a19f){return _0x132db1[_0x90ee('0x29')](_0x4bfa51);}return _0x132db1['status'](_0x4bfa51)[_0x90ee('0x2a')]();};}function respondWithResult(_0x1d061b,_0x4c2add){_0x4c2add=_0x4c2add||0xc8;return function(_0xa9647f){if(_0xa9647f){return _0x1d061b[_0x90ee('0x2b')](_0x4c2add)[_0x90ee('0x2c')](_0xa9647f);}};}function respondWithFilteredResult(_0x4feb0b,_0x19c81b){return function(_0x559962){if(_0x559962){var _0x8c1bc2=typeof _0x19c81b['offset']==='undefined'&&typeof _0x19c81b[_0x90ee('0x2d')]===_0x90ee('0x2e');var _0x256feb=_0x559962[_0x90ee('0x2f')];var _0x22bf31=_0x8c1bc2?0x0:_0x19c81b['offset'];var _0x3dec8e=_0x8c1bc2?_0x559962[_0x90ee('0x2f')]:_0x19c81b[_0x90ee('0x30')]+_0x19c81b[_0x90ee('0x2d')];var _0x24beec;if(_0x3dec8e>=_0x256feb){_0x3dec8e=_0x256feb;_0x24beec=0xc8;}else{_0x24beec=0xce;}_0x4feb0b[_0x90ee('0x2b')](_0x24beec);return _0x4feb0b[_0x90ee('0x31')](_0x90ee('0x32'),_0x22bf31+'-'+_0x3dec8e+'/'+_0x256feb)['json'](_0x559962);}return null;};}function patchUpdates(_0xca9db6){return function(_0xb3b747){try{jsonpatch[_0x90ee('0x33')](_0xb3b747,_0xca9db6,!![]);}catch(_0x115eef){return BPromise[_0x90ee('0x34')](_0x115eef);}return _0xb3b747['save']();};}function saveUpdates(_0x11d5a8,_0x3a8cf7){return function(_0x16784d){if(_0x16784d){return _0x16784d[_0x90ee('0x35')](_0x11d5a8)[_0x90ee('0x20')](function(_0x4b110c){return _0x4b110c;});}return null;};}function removeEntity(_0x3a06d4,_0x48cc02){return function(_0x4aa2dc){if(_0x4aa2dc){return _0x4aa2dc[_0x90ee('0x36')]()[_0x90ee('0x20')](function(){var _0x1bee7e=_0x4aa2dc[_0x90ee('0x37')]({'plain':!![]});var _0x53a588=_0x90ee('0x38');return db[_0x90ee('0x39')][_0x90ee('0x36')]({'where':{'type':_0x53a588,'resourceId':_0x1bee7e['id']}})[_0x90ee('0x20')](function(){return _0x4aa2dc;});})[_0x90ee('0x20')](function(){_0x3a06d4[_0x90ee('0x2b')](0xcc)[_0x90ee('0x2a')]();});}};}function handleEntityNotFound(_0x26d77d,_0x23e079){return function(_0x2313e7){if(!_0x2313e7){_0x26d77d[_0x90ee('0x29')](0x194);}return _0x2313e7;};}function handleError(_0x454800,_0x56159c){_0x56159c=_0x56159c||0x1f4;return function(_0x55ba3d){logger['error'](_0x55ba3d[_0x90ee('0x3a')]);if(_0x55ba3d['name']){delete _0x55ba3d[_0x90ee('0x3b')];}_0x454800[_0x90ee('0x2b')](_0x56159c)[_0x90ee('0x3c')](_0x55ba3d);};}exports[_0x90ee('0x3d')]=function(_0x2aacbc,_0x526741){var _0x9da004={},_0xdbbdd8={},_0x4d2c11={'count':0x0,'rows':[]};var _0xce8854=_['map'](db[_0x90ee('0x3e')]['rawAttributes'],function(_0x2eb06f){return{'name':_0x2eb06f[_0x90ee('0x3f')],'type':_0x2eb06f[_0x90ee('0x40')]['key']};});_0xdbbdd8['model']=_[_0x90ee('0x41')](_0xce8854,_0x90ee('0x3b'));_0xdbbdd8[_0x90ee('0x42')]=_[_0x90ee('0x43')](_0x2aacbc[_0x90ee('0x42')]);_0xdbbdd8[_0x90ee('0x44')]=_[_0x90ee('0x45')](_0xdbbdd8[_0x90ee('0x46')],_0xdbbdd8[_0x90ee('0x42')]);_0x9da004['attributes']=_[_0x90ee('0x45')](_0xdbbdd8['model'],qs[_0x90ee('0x47')](_0x2aacbc['query'][_0x90ee('0x47')]));_0x9da004[_0x90ee('0x48')]=_0x9da004['attributes'][_0x90ee('0x49')]?_0x9da004[_0x90ee('0x48')]:_0xdbbdd8[_0x90ee('0x46')];if(!_0x2aacbc[_0x90ee('0x42')][_0x90ee('0x4a')](_0x90ee('0x4b'))){_0x9da004[_0x90ee('0x2d')]=qs[_0x90ee('0x2d')](_0x2aacbc[_0x90ee('0x42')][_0x90ee('0x2d')]);_0x9da004[_0x90ee('0x30')]=qs[_0x90ee('0x30')](_0x2aacbc['query'][_0x90ee('0x30')]);}_0x9da004[_0x90ee('0x4c')]=qs[_0x90ee('0x4d')](_0x2aacbc[_0x90ee('0x42')][_0x90ee('0x4d')]);_0x9da004[_0x90ee('0x4e')]=qs[_0x90ee('0x44')](_[_0x90ee('0x4f')](_0x2aacbc[_0x90ee('0x42')],_0xdbbdd8['filters']),_0xce8854);if(_0x2aacbc[_0x90ee('0x42')][_0x90ee('0x50')]){_0x9da004[_0x90ee('0x4e')]=_[_0x90ee('0x51')](_0x9da004[_0x90ee('0x4e')],{'$or':_['map'](_0xce8854,function(_0x28c24e){if(_0x28c24e[_0x90ee('0x40')]!==_0x90ee('0x52')){var _0x46c61a={};_0x46c61a[_0x28c24e['name']]={'$like':'%'+_0x2aacbc[_0x90ee('0x42')]['filter']+'%'};return _0x46c61a;}})});}_0x9da004=_[_0x90ee('0x51')]({},_0x9da004,_0x2aacbc[_0x90ee('0x53')]);var _0xd183e3={'where':_0x9da004[_0x90ee('0x4e')]};return db[_0x90ee('0x3e')][_0x90ee('0x2f')](_0xd183e3)[_0x90ee('0x20')](function(_0x5cc567){_0x4d2c11[_0x90ee('0x2f')]=_0x5cc567;if(_0x2aacbc[_0x90ee('0x42')][_0x90ee('0x54')]){_0x9da004[_0x90ee('0x55')]=[{'all':!![]}];}return db[_0x90ee('0x3e')][_0x90ee('0x56')](_0x9da004);})[_0x90ee('0x20')](function(_0x43c39b){_0x4d2c11[_0x90ee('0x57')]=_0x43c39b;return _0x4d2c11;})['then'](respondWithFilteredResult(_0x526741,_0x9da004))['catch'](handleError(_0x526741,null));};exports[_0x90ee('0x58')]=function(_0x31d689,_0x45cde7){var _0xa1277c={'raw':!![],'where':{'id':_0x31d689['params']['id']}},_0x41904a={};_0x41904a['model']=_[_0x90ee('0x43')](db[_0x90ee('0x3e')][_0x90ee('0x59')]);_0x41904a['query']=_[_0x90ee('0x43')](_0x31d689[_0x90ee('0x42')]);_0x41904a[_0x90ee('0x44')]=_['intersection'](_0x41904a[_0x90ee('0x46')],_0x41904a['query']);_0xa1277c[_0x90ee('0x48')]=_['intersection'](_0x41904a['model'],qs[_0x90ee('0x47')](_0x31d689[_0x90ee('0x42')][_0x90ee('0x47')]));_0xa1277c[_0x90ee('0x48')]=_0xa1277c['attributes']['length']?_0xa1277c[_0x90ee('0x48')]:_0x41904a[_0x90ee('0x46')];if(_0x31d689[_0x90ee('0x42')][_0x90ee('0x54')]){_0xa1277c[_0x90ee('0x55')]=[{'all':!![]}];}_0xa1277c=_[_0x90ee('0x51')]({},_0xa1277c,_0x31d689['options']);return db[_0x90ee('0x3e')]['find'](_0xa1277c)['then'](handleEntityNotFound(_0x45cde7,null))[_0x90ee('0x20')](respondWithResult(_0x45cde7,null))[_0x90ee('0x28')](handleError(_0x45cde7,null));};exports[_0x90ee('0x5a')]=function(_0x2d098a,_0x5e765d){return db[_0x90ee('0x3e')][_0x90ee('0x5a')](_0x2d098a[_0x90ee('0x5b')],{})[_0x90ee('0x20')](function(_0x4d63cb){var _0x2123b9=_0x2d098a[_0x90ee('0x5c')][_0x90ee('0x37')]({'plain':!![]});if(!_0x2123b9)throw new Error(_0x90ee('0x5d'));if(_0x2123b9[_0x90ee('0x5e')]===_0x90ee('0x5c')){var _0x3185b1=_0x4d63cb[_0x90ee('0x37')]({'plain':!![]});var _0x303d19=_0x90ee('0x38');return db[_0x90ee('0x5f')]['find']({'where':{'name':_0x303d19,'userProfileId':_0x2123b9[_0x90ee('0x60')]},'raw':!![]})[_0x90ee('0x20')](function(_0x1d9c9b){if(_0x1d9c9b&&_0x1d9c9b['autoAssociation']===0x0){return db[_0x90ee('0x39')]['create']({'name':_0x3185b1['name'],'resourceId':_0x3185b1['id'],'type':_0x1d9c9b[_0x90ee('0x3b')],'sectionId':_0x1d9c9b['id']},{})[_0x90ee('0x20')](function(){return _0x4d63cb;});}else{return _0x4d63cb;}})['catch'](function(_0x260228){logger['error'](_0x90ee('0x61'),_0x260228);throw _0x260228;});}return _0x4d63cb;})[_0x90ee('0x20')](respondWithResult(_0x5e765d,0xc9))['catch'](handleError(_0x5e765d,null));};exports[_0x90ee('0x35')]=function(_0x22ab2a,_0xbbfed2){if(_0x22ab2a['body']['id']){delete _0x22ab2a[_0x90ee('0x5b')]['id'];}return db[_0x90ee('0x3e')][_0x90ee('0x62')]({'where':{'id':_0x22ab2a['params']['id']}})[_0x90ee('0x20')](handleEntityNotFound(_0xbbfed2,null))[_0x90ee('0x20')](saveUpdates(_0x22ab2a['body'],null))['then'](respondWithResult(_0xbbfed2,null))[_0x90ee('0x28')](handleError(_0xbbfed2,null));};exports[_0x90ee('0x36')]=function(_0x402803,_0x479689){return db[_0x90ee('0x3e')]['find']({'where':{'id':_0x402803['params']['id']}})['then'](handleEntityNotFound(_0x479689,null))[_0x90ee('0x20')](removeEntity(_0x479689,null))[_0x90ee('0x28')](handleError(_0x479689,null));};exports[_0x90ee('0x63')]=function(_0x9550fb,_0x2a2e3f){return db[_0x90ee('0x3e')][_0x90ee('0x63')]()[_0x90ee('0x20')](respondWithResult(_0x2a2e3f,null))[_0x90ee('0x28')](handleError(_0x2a2e3f,null));};exports[_0x90ee('0x64')]=function(_0x914cb0,_0x2f65d9,_0x1f440b){var _0x5b3280={'raw':!![],'where':{}},_0x14af19={},_0x47b9eb;return db[_0x90ee('0x3e')][_0x90ee('0x65')]({'where':{'id':_0x914cb0['params']['id']}})[_0x90ee('0x20')](handleEntityNotFound(_0x2f65d9,null))['then'](function(_0x3e0452){if(_0x3e0452){_0x47b9eb=_0x3e0452['get']({'plain':!![]});_0x14af19[_0x90ee('0x46')]=_['keys'](db['UserChatQueue'][_0x90ee('0x59')]);_0x14af19['query']=_[_0x90ee('0x43')](_0x914cb0[_0x90ee('0x42')]);_0x14af19['filters']=_[_0x90ee('0x45')](_0x14af19['model'],_0x14af19[_0x90ee('0x42')]);_0x5b3280[_0x90ee('0x48')]=_['intersection'](_0x14af19[_0x90ee('0x46')],qs[_0x90ee('0x47')](_0x914cb0[_0x90ee('0x42')][_0x90ee('0x47')]));_0x5b3280['attributes']=_0x5b3280['attributes'][_0x90ee('0x49')]?_0x5b3280['attributes']:_0x14af19['model'];if(!_0x914cb0[_0x90ee('0x42')][_0x90ee('0x4a')](_0x90ee('0x4b'))){_0x5b3280[_0x90ee('0x2d')]=qs[_0x90ee('0x2d')](_0x914cb0[_0x90ee('0x42')][_0x90ee('0x2d')]);_0x5b3280[_0x90ee('0x30')]=qs[_0x90ee('0x30')](_0x914cb0[_0x90ee('0x42')][_0x90ee('0x30')]);}_0x5b3280[_0x90ee('0x4c')]=qs['sort'](_0x914cb0[_0x90ee('0x42')][_0x90ee('0x4d')]);_0x5b3280[_0x90ee('0x4e')]=qs[_0x90ee('0x44')](_['pick'](_0x914cb0['query'],_0x14af19['filters']));_0x5b3280['where'][_0x90ee('0x66')]=_0x3e0452['id'];if(_0x914cb0[_0x90ee('0x42')][_0x90ee('0x50')]){_0x5b3280[_0x90ee('0x4e')]=_[_0x90ee('0x51')](_0x5b3280['where'],{'$or':_[_0x90ee('0x41')](_0x5b3280['attributes'],function(_0x280680){var _0x5098b3={};_0x5098b3[_0x280680]={'$like':'%'+_0x914cb0[_0x90ee('0x42')]['filter']+'%'};return _0x5098b3;})});}_0x5b3280=_[_0x90ee('0x51')]({},_0x5b3280,_0x914cb0['options']);return db[_0x90ee('0x67')][_0x90ee('0x56')](_0x5b3280);}})[_0x90ee('0x20')](function(_0x7b8dcf){if(_0x7b8dcf){return db[_0x90ee('0x68')]['findAndCountAll']({'where':{'id':_[_0x90ee('0x41')](_0x7b8dcf,_0x90ee('0x69')),'role':_0x90ee('0x6a')},'attributes':['id',_0x90ee('0x3b'),_0x90ee('0x6b'),_0x90ee('0x6c'),_0x90ee('0x6d')]});}})[_0x90ee('0x20')](function(_0x4684ff){if(_0x4684ff){return{'count':_0x4684ff[_0x90ee('0x2f')],'rows':_['map'](_0x4684ff['rows'],function(_0x466d21){return{'membername':_0x466d21['name'],'UserId':_0x466d21['id'],'queue_name':_0x47b9eb['name'],'ChatQueueId':_0x47b9eb['id'],'interface':util[_0x90ee('0x6e')](_0x90ee('0x6f'),_0x90ee('0x70'),_0x466d21[_0x90ee('0x3b')]),'penalty':0x0,'paused':_0x466d21['chatPause'],'createdAt':_0x466d21[_0x90ee('0x6d')],'updatedAt':_0x466d21[_0x90ee('0x6c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x90ee('0x20')](respondWithFilteredResult(_0x2f65d9,_0x5b3280))['catch'](handleError(_0x2f65d9,null));};exports[_0x90ee('0x71')]=function(_0x194c8a,_0x211c4b,_0xf245cf){var _0x5f515e={};var _0x44b4a9={};var _0x1c0777;var _0x5ee8de;return db['ChatQueue'][_0x90ee('0x65')]({'where':{'id':_0x194c8a['params']['id']}})[_0x90ee('0x20')](handleEntityNotFound(_0x211c4b,null))[_0x90ee('0x20')](function(_0x2fdea2){if(_0x2fdea2){_0x1c0777=_0x2fdea2;_0x44b4a9[_0x90ee('0x46')]=_['keys'](db[_0x90ee('0x72')][_0x90ee('0x59')]);_0x44b4a9[_0x90ee('0x42')]=_['keys'](_0x194c8a[_0x90ee('0x42')]);_0x44b4a9[_0x90ee('0x44')]=_[_0x90ee('0x45')](_0x44b4a9[_0x90ee('0x46')],_0x44b4a9['query']);_0x5f515e['attributes']=_[_0x90ee('0x45')](_0x44b4a9[_0x90ee('0x46')],qs['fields'](_0x194c8a[_0x90ee('0x42')][_0x90ee('0x47')]));_0x5f515e[_0x90ee('0x48')]=_0x5f515e[_0x90ee('0x48')]['length']?_0x5f515e[_0x90ee('0x48')]:_0x44b4a9[_0x90ee('0x46')];_0x5f515e[_0x90ee('0x4c')]=qs[_0x90ee('0x4d')](_0x194c8a[_0x90ee('0x42')][_0x90ee('0x4d')]);_0x5f515e['where']=qs[_0x90ee('0x44')](_[_0x90ee('0x4f')](_0x194c8a[_0x90ee('0x42')],_0x44b4a9[_0x90ee('0x44')]));if(_0x194c8a[_0x90ee('0x42')][_0x90ee('0x50')]){_0x5f515e[_0x90ee('0x4e')]=_[_0x90ee('0x51')](_0x5f515e['where'],{'$or':_[_0x90ee('0x41')](_0x5f515e[_0x90ee('0x48')],function(_0x333966){var _0x2f8402={};_0x2f8402[_0x333966]={'$like':'%'+_0x194c8a[_0x90ee('0x42')][_0x90ee('0x50')]+'%'};return _0x2f8402;})});}_0x5f515e=_[_0x90ee('0x51')]({},_0x5f515e,_0x194c8a[_0x90ee('0x53')]);return _0x1c0777[_0x90ee('0x71')](_0x5f515e);}})['then'](function(_0x34987c){if(_0x34987c){_0x5ee8de=_0x34987c[_0x90ee('0x49')];if(!_0x194c8a[_0x90ee('0x42')][_0x90ee('0x4a')]('nolimit')){_0x5f515e[_0x90ee('0x2d')]=qs[_0x90ee('0x2d')](_0x194c8a['query'][_0x90ee('0x2d')]);_0x5f515e[_0x90ee('0x30')]=qs[_0x90ee('0x30')](_0x194c8a[_0x90ee('0x42')][_0x90ee('0x30')]);}return _0x1c0777[_0x90ee('0x71')](_0x5f515e);}})[_0x90ee('0x20')](function(_0x18b473){if(_0x18b473){return _0x18b473?{'count':_0x5ee8de,'rows':_0x18b473}:null;}})[_0x90ee('0x20')](respondWithResult(_0x211c4b,null))[_0x90ee('0x28')](handleError(_0x211c4b,null));};exports[_0x90ee('0x73')]=function(_0x4fef92,_0x7b5208,_0x313bf6){var _0x2a5583=_0x4fef92['body'][_0x90ee('0x74')];return db[_0x90ee('0x72')][_0x90ee('0x56')]({'where':{'id':_0x2a5583},'attributes':['id'],'include':[{'model':db[_0x90ee('0x68')],'as':_0x90ee('0x75'),'attributes':['id',_0x90ee('0x3b'),_0x90ee('0x76'),'voicePause',_0x90ee('0x77')],'raw':!![]}]})['then'](function(_0x48abb1){if(_0x48abb1){var _0x5177d4=_[_0x90ee('0x78')](_0x48abb1,function(_0x4e98f0){var _0x356311=_0x4e98f0[_0x90ee('0x37')]({'plain':!![]});return _0x356311['Agents'];});return db['ChatQueue'][_0x90ee('0x62')]({'where':{'id':_0x4fef92[_0x90ee('0x79')]['id']}})[_0x90ee('0x20')](function(_0x43f1c5){return db[_0x90ee('0x7a')][_0x90ee('0x7b')](function(_0x125391){return _0x43f1c5['addTeams'](_0x2a5583,{'transaction':_0x125391})[_0x90ee('0x20')](function(){return BPromise['each'](_0x5177d4,function(_0x119101){return db[_0x90ee('0x67')]['findOrCreate']({'where':{'UserId':_0x119101['id'],'ChatQueueId':_0x4fef92[_0x90ee('0x79')]['id']},'transaction':_0x125391});});})['then'](function(){_0x5177d4[_0x90ee('0x7c')](function(_0xdab8ba){socket[_0x90ee('0x7d')](_0x90ee('0x7e'),{'UserId':_0xdab8ba['id'],'ChatQueueId':_0x43f1c5['id']});});});});});}})['then'](respondWithStatusCode(_0x7b5208,null))['catch'](handleError(_0x7b5208,null));};exports['removeTeams']=function(_0x30ce54,_0x4703db,_0x16211c){return db[_0x90ee('0x72')][_0x90ee('0x56')]({'where':{'id':_0x30ce54[_0x90ee('0x42')][_0x90ee('0x74')]},'attributes':['id'],'include':[{'model':db[_0x90ee('0x68')],'as':_0x90ee('0x75'),'attributes':['id'],'raw':!![]}]})[_0x90ee('0x20')](handleEntityNotFound(_0x4703db,null))[_0x90ee('0x20')](function(_0x4532d5){var _0x447f84=_[_0x90ee('0x41')](_0x4532d5,'id');var _0x321b1f=[];var _0x562dcf=[];var _0x1ade86=squel[_0x90ee('0x7f')]();_0x1ade86['field'](_0x90ee('0x80'))[_0x90ee('0x81')]('team_has_chat_queues','tq')['join'](_0x90ee('0x82'),'ut',_0x90ee('0x83'))[_0x90ee('0x4e')](_0x90ee('0x84'),_0x30ce54[_0x90ee('0x79')]['id']);for(var _0x3ed068=0x0;_0x3ed068<_0x4532d5[_0x90ee('0x49')];_0x3ed068+=0x1){let _0x1f4939=_0x4532d5[_0x3ed068];for(var _0x3b6192=0x0;_0x3b6192<_0x1f4939[_0x90ee('0x75')][_0x90ee('0x49')];_0x3b6192+=0x1){let _0xfaa285=_0x1f4939[_0x90ee('0x75')][_0x3b6192];var _0x5a9353=_0x1ade86[_0x90ee('0x85')]();_0x5a9353[_0x90ee('0x4e')]('ut.UserId\x20=\x20?',_0xfaa285['id']);_0x562dcf[_0x90ee('0x86')](db[_0x90ee('0x7a')]['query'](_0x5a9353[_0x90ee('0x87')](),{'type':db[_0x90ee('0x7a')][_0x90ee('0x88')][_0x90ee('0x89')]})[_0x90ee('0x20')](function(_0x1030cf){if(_0x1030cf['length']===0x1){return _0xfaa285['id'];}else{var _0x5bfa1c=_['every'](_[_0x90ee('0x41')](_0x1030cf,_0x90ee('0x8a')),function(_0x527f19){return _[_0x90ee('0x8b')](_0x447f84,_0x527f19);});if(_0x5bfa1c){return _0xfaa285['id'];}}}));}}return BPromise[_0x90ee('0x8c')](_0x562dcf)[_0x90ee('0x20')](function(_0x515303){_0x321b1f=_(_0x321b1f)[_0x90ee('0x8d')](_0x515303)['compact']()[_0x90ee('0x8e')]();return db[_0x90ee('0x3e')][_0x90ee('0x62')]({'where':{'id':_0x30ce54[_0x90ee('0x79')]['id']}})['then'](function(_0x30ed24){return db[_0x90ee('0x7a')][_0x90ee('0x7b')](function(_0x1769ac){return _0x30ed24[_0x90ee('0x8f')](_0x30ce54[_0x90ee('0x42')]['ids'],{'transaction':_0x1769ac})[_0x90ee('0x20')](function(){if(!_[_0x90ee('0x90')](_0x321b1f)){return _0x30ed24[_0x90ee('0x91')](_0x321b1f,{'transaction':_0x1769ac});}})['then'](function(){_0x321b1f[_0x90ee('0x7c')](function(_0x77804d){socket['emit'](_0x90ee('0x92'),{'UserId':_0x77804d,'ChatQueueId':_0x30ed24['id']});});});});});});})[_0x90ee('0x20')](respondWithStatusCode(_0x4703db,null))[_0x90ee('0x28')](handleError(_0x4703db,null));};exports[_0x90ee('0x93')]=function(_0x268930,_0x4ed087,_0x45c384){return db[_0x90ee('0x3e')][_0x90ee('0x62')]({'where':{'id':_0x268930['params']['id']}})[_0x90ee('0x20')](handleEntityNotFound(_0x4ed087,null))[_0x90ee('0x20')](function(_0x4fb1ec){if(_0x4fb1ec){return _0x4fb1ec[_0x90ee('0x93')](_0x268930[_0x90ee('0x5b')]['ids'],_[_0x90ee('0x94')](_0x268930[_0x90ee('0x5b')],[_0x90ee('0x74'),'id'])||{})[_0x90ee('0x95')](function(_0x4d3838){for(var _0x558e43=0x0;_0x558e43<_0x268930[_0x90ee('0x5b')][_0x90ee('0x74')]['length'];_0x558e43+=0x1){socket[_0x90ee('0x7d')](_0x90ee('0x7e'),{'UserId':Number(_0x268930[_0x90ee('0x5b')][_0x90ee('0x74')][_0x558e43]),'ChatQueueId':Number(_0x268930[_0x90ee('0x79')]['id'])});}return _0x4d3838;});}})['then'](respondWithResult(_0x4ed087,null))['catch'](handleError(_0x4ed087,null));};exports[_0x90ee('0x91')]=function(_0x41ce83,_0x4aef1f,_0x3d6a16){return db[_0x90ee('0x3e')]['find']({'where':{'id':_0x41ce83[_0x90ee('0x79')]['id']}})[_0x90ee('0x20')](handleEntityNotFound(_0x4aef1f,null))['then'](function(_0x2d5f4c){if(_0x2d5f4c){return _0x2d5f4c[_0x90ee('0x91')](_0x41ce83[_0x90ee('0x42')][_0x90ee('0x74')])[_0x90ee('0x20')](function(){if(_['isArray'](_0x41ce83[_0x90ee('0x42')][_0x90ee('0x74')])){for(var _0x58b553=0x0;_0x58b553<_0x41ce83['query']['ids'][_0x90ee('0x49')];_0x58b553+=0x1){socket[_0x90ee('0x7d')]('userChatQueue:remove',{'UserId':Number(_0x41ce83[_0x90ee('0x42')][_0x90ee('0x74')][_0x58b553]),'ChatQueueId':Number(_0x41ce83[_0x90ee('0x79')]['id'])});}}else{socket[_0x90ee('0x7d')](_0x90ee('0x92'),{'UserId':Number(_0x41ce83[_0x90ee('0x42')]['ids']),'ChatQueueId':Number(_0x41ce83[_0x90ee('0x79')]['id'])});}});}})[_0x90ee('0x20')](respondWithStatusCode(_0x4aef1f,null))['catch'](handleError(_0x4aef1f,null));};exports[_0x90ee('0x96')]=function(_0x3a8213,_0x2c816d,_0x29dea6){var _0x1d93fb={};var _0x383030={};var _0xd2591b;var _0x355adf;return db[_0x90ee('0x3e')][_0x90ee('0x65')]({'where':{'id':_0x3a8213[_0x90ee('0x79')]['id']}})[_0x90ee('0x20')](handleEntityNotFound(_0x2c816d,null))[_0x90ee('0x20')](function(_0x4ade30){if(_0x4ade30){_0xd2591b=_0x4ade30;_0x383030[_0x90ee('0x46')]=_['keys'](db['User']['rawAttributes']);_0x383030['query']=_['keys'](_0x3a8213[_0x90ee('0x42')]);_0x383030[_0x90ee('0x44')]=_['intersection'](_0x383030[_0x90ee('0x46')],_0x383030[_0x90ee('0x42')]);_0x1d93fb[_0x90ee('0x48')]=_[_0x90ee('0x45')](_0x383030['model'],qs[_0x90ee('0x47')](_0x3a8213['query']['fields']));_0x1d93fb['attributes']=_0x1d93fb[_0x90ee('0x48')][_0x90ee('0x49')]?_0x1d93fb[_0x90ee('0x48')]:_0x383030[_0x90ee('0x46')];_0x1d93fb[_0x90ee('0x4c')]=qs[_0x90ee('0x4d')](_0x3a8213[_0x90ee('0x42')]['sort']);_0x1d93fb[_0x90ee('0x4e')]=qs[_0x90ee('0x44')](_[_0x90ee('0x4f')](_0x3a8213[_0x90ee('0x42')],_0x383030[_0x90ee('0x44')]));if(_0x3a8213[_0x90ee('0x42')][_0x90ee('0x50')]){_0x1d93fb[_0x90ee('0x4e')]=_[_0x90ee('0x51')](_0x1d93fb[_0x90ee('0x4e')],{'$or':_[_0x90ee('0x41')](_0x1d93fb[_0x90ee('0x48')],function(_0x5c027d){var _0xd7a54f={};_0xd7a54f[_0x5c027d]={'$like':'%'+_0x3a8213[_0x90ee('0x42')]['filter']+'%'};return _0xd7a54f;})});}_0x1d93fb=_[_0x90ee('0x51')]({},_0x1d93fb,_0x3a8213['options']);return _0xd2591b[_0x90ee('0x96')](_0x1d93fb);}})[_0x90ee('0x20')](function(_0x3bbc4e){if(_0x3bbc4e){_0x355adf=_0x3bbc4e['length'];if(!_0x3a8213[_0x90ee('0x42')][_0x90ee('0x4a')](_0x90ee('0x4b'))){_0x1d93fb[_0x90ee('0x2d')]=qs[_0x90ee('0x2d')](_0x3a8213['query'][_0x90ee('0x2d')]);_0x1d93fb[_0x90ee('0x30')]=qs[_0x90ee('0x30')](_0x3a8213[_0x90ee('0x42')][_0x90ee('0x30')]);}return _0xd2591b[_0x90ee('0x96')](_0x1d93fb);}})[_0x90ee('0x20')](function(_0x2efa4f){if(_0x2efa4f){return _0x2efa4f?{'count':_0x355adf,'rows':_0x2efa4f}:null;}})[_0x90ee('0x20')](respondWithResult(_0x2c816d,null))[_0x90ee('0x28')](handleError(_0x2c816d,null));}; \ No newline at end of file +var _0xe28f=['body','user','get','role','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','getMembers','findOne','UserChatQueue','hasOwnProperty','ChatQueueId','User','findAndCountAll','UserId','updatedAt','createdAt','format','%s/%s','SIP','chatPause','Team','getTeams','Agents','online','voicePause','interface','flatMap','sequelize','transaction','addTeams','findOrCreate','emit','userChatQueue:save','removeTeams','ids','select','field','from','team_has_chat_queues','join','user_has_teams','clone','ut.UserId\x20=\x20?','push','toString','SELECT','every','TeamId','includes','all','union','compact','isEmpty','removeAgents','userChatQueue:remove','addAgents','spread','isArray','getAgents','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','redis','defaults','./chatQueue.socket','jayson/promise','client','http','request','then','info','ChatQueue,\x20%s,\x20%s','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','sendStatus','status','end','offset','undefined','count','set','Content-Range','json','apply','reject','save','ChatQueues','UserProfileResource','destroy','name','send','index','ChatQueue','rawAttributes','fieldName','type','key','model','map','query','intersection','attributes','fields','length','nolimit','limit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','create'];(function(_0x358e0c,_0x47f819){var _0x5b328d=function(_0x4d0d8e){while(--_0x4d0d8e){_0x358e0c['push'](_0x358e0c['shift']());}};_0x5b328d(++_0x47f819);}(_0xe28f,0x16f));var _0xfe28=function(_0x11c8d8,_0x3ef7ba){_0x11c8d8=_0x11c8d8-0x0;var _0x37478c=_0xe28f[_0x11c8d8];return _0x37478c;};'use strict';var emlformat=require(_0xfe28('0x0'));var rimraf=require(_0xfe28('0x1'));var zipdir=require(_0xfe28('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfe28('0x3'));var moment=require('moment');var BPromise=require(_0xfe28('0x4'));var Mustache=require(_0xfe28('0x5'));var util=require('util');var path=require(_0xfe28('0x6'));var sox=require(_0xfe28('0x7'));var csv=require(_0xfe28('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfe28('0x9'));var _=require(_0xfe28('0xa'));var squel=require(_0xfe28('0xb'));var crypto=require(_0xfe28('0xc'));var jsforce=require(_0xfe28('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xfe28('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xfe28('0xe'));var authService=require(_0xfe28('0xf'));var qs=require(_0xfe28('0x10'));var as=require(_0xfe28('0x11'));var hardwareService=require(_0xfe28('0x12'));var logger=require('../../config/logger')(_0xfe28('0x13'));var utils=require(_0xfe28('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xfe28('0x15'));var db=require('../../mysqldb')['db'];config[_0xfe28('0x16')]=_[_0xfe28('0x17')](config[_0xfe28('0x16')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfe28('0x16')]));require(_0xfe28('0x18'))['register'](socket);var jayson=require(_0xfe28('0x19'));var client=jayson[_0xfe28('0x1a')][_0xfe28('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x3e8529,_0x4ac03b,_0x1da09d,_0x28fd16){return new BPromise(function(_0x135258,_0xdbeaa2){var _0x45dad2=_0x28fd16||client;return _0x45dad2[_0xfe28('0x1c')](_0x3e8529,_0x1da09d)[_0xfe28('0x1d')](function(_0x705b4a){logger[_0xfe28('0x1e')](_0xfe28('0x1f'),_0x4ac03b,'request\x20sent');logger[_0xfe28('0x20')](_0xfe28('0x21'),_0x4ac03b,_0xfe28('0x22'),JSON[_0xfe28('0x23')](_0x705b4a));if(_0x705b4a[_0xfe28('0x24')]){if(_0x705b4a[_0xfe28('0x24')]['code']===0x1f4){logger[_0xfe28('0x24')](_0xfe28('0x1f'),_0x4ac03b,_0x705b4a['error'][_0xfe28('0x25')]);return _0xdbeaa2(_0x705b4a[_0xfe28('0x24')][_0xfe28('0x25')]);}logger[_0xfe28('0x24')](_0xfe28('0x1f'),_0x4ac03b,_0x705b4a[_0xfe28('0x24')][_0xfe28('0x25')]);return _0x135258(_0x705b4a[_0xfe28('0x24')][_0xfe28('0x25')]);}else{logger['info'](_0xfe28('0x1f'),_0x4ac03b,_0xfe28('0x22'));_0x135258(_0x705b4a[_0xfe28('0x26')][_0xfe28('0x25')]);}})['catch'](function(_0x3d98a0){logger[_0xfe28('0x24')]('ChatQueue,\x20%s,\x20%s',_0x4ac03b,_0x3d98a0);_0xdbeaa2(_0x3d98a0);});});}function respondWithStatusCode(_0x239d62,_0x383bfa){_0x383bfa=_0x383bfa||0xcc;return function(_0x361662){if(_0x361662){return _0x239d62[_0xfe28('0x27')](_0x383bfa);}return _0x239d62[_0xfe28('0x28')](_0x383bfa)[_0xfe28('0x29')]();};}function respondWithResult(_0xc23db9,_0x4f2892){_0x4f2892=_0x4f2892||0xc8;return function(_0x238836){if(_0x238836){return _0xc23db9[_0xfe28('0x28')](_0x4f2892)['json'](_0x238836);}};}function respondWithFilteredResult(_0xfb6106,_0x35b5f8){return function(_0x49f004){if(_0x49f004){var _0x5b6a21=typeof _0x35b5f8[_0xfe28('0x2a')]==='undefined'&&typeof _0x35b5f8['limit']===_0xfe28('0x2b');var _0x4d020d=_0x49f004[_0xfe28('0x2c')];var _0x2740b1=_0x5b6a21?0x0:_0x35b5f8[_0xfe28('0x2a')];var _0x290342=_0x5b6a21?_0x49f004[_0xfe28('0x2c')]:_0x35b5f8[_0xfe28('0x2a')]+_0x35b5f8['limit'];var _0x411cad;if(_0x290342>=_0x4d020d){_0x290342=_0x4d020d;_0x411cad=0xc8;}else{_0x411cad=0xce;}_0xfb6106[_0xfe28('0x28')](_0x411cad);return _0xfb6106[_0xfe28('0x2d')](_0xfe28('0x2e'),_0x2740b1+'-'+_0x290342+'/'+_0x4d020d)[_0xfe28('0x2f')](_0x49f004);}return null;};}function patchUpdates(_0x1ce1eb){return function(_0xa2be82){try{jsonpatch[_0xfe28('0x30')](_0xa2be82,_0x1ce1eb,!![]);}catch(_0x356a6d){return BPromise[_0xfe28('0x31')](_0x356a6d);}return _0xa2be82[_0xfe28('0x32')]();};}function saveUpdates(_0x23e816,_0x5e0bee){return function(_0x14c8ab){if(_0x14c8ab){return _0x14c8ab['update'](_0x23e816)['then'](function(_0x467505){return _0x467505;});}return null;};}function removeEntity(_0x2a8cb5,_0x528664){return function(_0x4cdc0a){if(_0x4cdc0a){return _0x4cdc0a['destroy']()[_0xfe28('0x1d')](function(){var _0x294213=_0x4cdc0a['get']({'plain':!![]});var _0x5df51a=_0xfe28('0x33');return db[_0xfe28('0x34')][_0xfe28('0x35')]({'where':{'type':_0x5df51a,'resourceId':_0x294213['id']}})[_0xfe28('0x1d')](function(){return _0x4cdc0a;});})[_0xfe28('0x1d')](function(){_0x2a8cb5[_0xfe28('0x28')](0xcc)[_0xfe28('0x29')]();});}};}function handleEntityNotFound(_0x412e06,_0x4adde3){return function(_0x2ae829){if(!_0x2ae829){_0x412e06[_0xfe28('0x27')](0x194);}return _0x2ae829;};}function handleError(_0x543686,_0x32e9a4){_0x32e9a4=_0x32e9a4||0x1f4;return function(_0x319825){logger['error'](_0x319825['stack']);if(_0x319825[_0xfe28('0x36')]){delete _0x319825[_0xfe28('0x36')];}_0x543686[_0xfe28('0x28')](_0x32e9a4)[_0xfe28('0x37')](_0x319825);};}exports[_0xfe28('0x38')]=function(_0x4e7d18,_0x459f84){var _0x1d27cb={},_0x348214={},_0x26ebb1={'count':0x0,'rows':[]};var _0x3a2010=_['map'](db[_0xfe28('0x39')][_0xfe28('0x3a')],function(_0x517ef3){return{'name':_0x517ef3[_0xfe28('0x3b')],'type':_0x517ef3[_0xfe28('0x3c')][_0xfe28('0x3d')]};});_0x348214[_0xfe28('0x3e')]=_[_0xfe28('0x3f')](_0x3a2010,_0xfe28('0x36'));_0x348214[_0xfe28('0x40')]=_['keys'](_0x4e7d18['query']);_0x348214['filters']=_[_0xfe28('0x41')](_0x348214[_0xfe28('0x3e')],_0x348214['query']);_0x1d27cb[_0xfe28('0x42')]=_[_0xfe28('0x41')](_0x348214[_0xfe28('0x3e')],qs[_0xfe28('0x43')](_0x4e7d18[_0xfe28('0x40')][_0xfe28('0x43')]));_0x1d27cb[_0xfe28('0x42')]=_0x1d27cb[_0xfe28('0x42')][_0xfe28('0x44')]?_0x1d27cb['attributes']:_0x348214[_0xfe28('0x3e')];if(!_0x4e7d18[_0xfe28('0x40')]['hasOwnProperty'](_0xfe28('0x45'))){_0x1d27cb[_0xfe28('0x46')]=qs['limit'](_0x4e7d18[_0xfe28('0x40')][_0xfe28('0x46')]);_0x1d27cb[_0xfe28('0x2a')]=qs['offset'](_0x4e7d18[_0xfe28('0x40')]['offset']);}_0x1d27cb[_0xfe28('0x47')]=qs[_0xfe28('0x48')](_0x4e7d18[_0xfe28('0x40')]['sort']);_0x1d27cb['where']=qs[_0xfe28('0x49')](_[_0xfe28('0x4a')](_0x4e7d18['query'],_0x348214[_0xfe28('0x49')]),_0x3a2010);if(_0x4e7d18[_0xfe28('0x40')][_0xfe28('0x4b')]){_0x1d27cb[_0xfe28('0x4c')]=_[_0xfe28('0x4d')](_0x1d27cb[_0xfe28('0x4c')],{'$or':_[_0xfe28('0x3f')](_0x3a2010,function(_0x3682bf){if(_0x3682bf[_0xfe28('0x3c')]!==_0xfe28('0x4e')){var _0x2b74ba={};_0x2b74ba[_0x3682bf[_0xfe28('0x36')]]={'$like':'%'+_0x4e7d18['query'][_0xfe28('0x4b')]+'%'};return _0x2b74ba;}})});}_0x1d27cb=_['merge']({},_0x1d27cb,_0x4e7d18[_0xfe28('0x4f')]);var _0x57a8bf={'where':_0x1d27cb[_0xfe28('0x4c')]};return db[_0xfe28('0x39')][_0xfe28('0x2c')](_0x57a8bf)[_0xfe28('0x1d')](function(_0x4d1b5a){_0x26ebb1[_0xfe28('0x2c')]=_0x4d1b5a;if(_0x4e7d18[_0xfe28('0x40')][_0xfe28('0x50')]){_0x1d27cb[_0xfe28('0x51')]=[{'all':!![]}];}return db['ChatQueue'][_0xfe28('0x52')](_0x1d27cb);})['then'](function(_0xa80da2){_0x26ebb1[_0xfe28('0x53')]=_0xa80da2;return _0x26ebb1;})[_0xfe28('0x1d')](respondWithFilteredResult(_0x459f84,_0x1d27cb))[_0xfe28('0x54')](handleError(_0x459f84,null));};exports[_0xfe28('0x55')]=function(_0x2cad9f,_0x5dc826){var _0x3453b5={'raw':!![],'where':{'id':_0x2cad9f[_0xfe28('0x56')]['id']}},_0x5d53be={};_0x5d53be[_0xfe28('0x3e')]=_[_0xfe28('0x57')](db[_0xfe28('0x39')][_0xfe28('0x3a')]);_0x5d53be[_0xfe28('0x40')]=_['keys'](_0x2cad9f[_0xfe28('0x40')]);_0x5d53be['filters']=_[_0xfe28('0x41')](_0x5d53be[_0xfe28('0x3e')],_0x5d53be[_0xfe28('0x40')]);_0x3453b5[_0xfe28('0x42')]=_[_0xfe28('0x41')](_0x5d53be[_0xfe28('0x3e')],qs[_0xfe28('0x43')](_0x2cad9f['query']['fields']));_0x3453b5[_0xfe28('0x42')]=_0x3453b5['attributes'][_0xfe28('0x44')]?_0x3453b5[_0xfe28('0x42')]:_0x5d53be[_0xfe28('0x3e')];if(_0x2cad9f[_0xfe28('0x40')][_0xfe28('0x50')]){_0x3453b5[_0xfe28('0x51')]=[{'all':!![]}];}_0x3453b5=_[_0xfe28('0x4d')]({},_0x3453b5,_0x2cad9f['options']);return db['ChatQueue']['find'](_0x3453b5)[_0xfe28('0x1d')](handleEntityNotFound(_0x5dc826,null))[_0xfe28('0x1d')](respondWithResult(_0x5dc826,null))[_0xfe28('0x54')](handleError(_0x5dc826,null));};exports[_0xfe28('0x58')]=function(_0x44a8ef,_0xc5a654){return db['ChatQueue'][_0xfe28('0x58')](_0x44a8ef[_0xfe28('0x59')],{})['then'](function(_0x420a5f){var _0xe1162=_0x44a8ef[_0xfe28('0x5a')][_0xfe28('0x5b')]({'plain':!![]});if(!_0xe1162)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xe1162[_0xfe28('0x5c')]===_0xfe28('0x5a')){var _0x43c572=_0x420a5f[_0xfe28('0x5b')]({'plain':!![]});var _0x219ddb=_0xfe28('0x33');return db[_0xfe28('0x5d')][_0xfe28('0x5e')]({'where':{'name':_0x219ddb,'userProfileId':_0xe1162[_0xfe28('0x5f')]},'raw':!![]})[_0xfe28('0x1d')](function(_0x32d175){if(_0x32d175&&_0x32d175['autoAssociation']===0x0){return db[_0xfe28('0x34')]['create']({'name':_0x43c572[_0xfe28('0x36')],'resourceId':_0x43c572['id'],'type':_0x32d175['name'],'sectionId':_0x32d175['id']},{})['then'](function(){return _0x420a5f;});}else{return _0x420a5f;}})['catch'](function(_0x415f89){logger[_0xfe28('0x24')](_0xfe28('0x60'),_0x415f89);throw _0x415f89;});}return _0x420a5f;})[_0xfe28('0x1d')](respondWithResult(_0xc5a654,0xc9))[_0xfe28('0x54')](handleError(_0xc5a654,null));};exports[_0xfe28('0x61')]=function(_0x54d08d,_0x3680b1){if(_0x54d08d[_0xfe28('0x59')]['id']){delete _0x54d08d[_0xfe28('0x59')]['id'];}return db[_0xfe28('0x39')][_0xfe28('0x5e')]({'where':{'id':_0x54d08d[_0xfe28('0x56')]['id']}})[_0xfe28('0x1d')](handleEntityNotFound(_0x3680b1,null))[_0xfe28('0x1d')](saveUpdates(_0x54d08d[_0xfe28('0x59')],null))[_0xfe28('0x1d')](respondWithResult(_0x3680b1,null))[_0xfe28('0x54')](handleError(_0x3680b1,null));};exports[_0xfe28('0x35')]=function(_0x361d6c,_0x4b3d7d){return db['ChatQueue'][_0xfe28('0x5e')]({'where':{'id':_0x361d6c[_0xfe28('0x56')]['id']}})[_0xfe28('0x1d')](handleEntityNotFound(_0x4b3d7d,null))[_0xfe28('0x1d')](removeEntity(_0x4b3d7d,null))[_0xfe28('0x54')](handleError(_0x4b3d7d,null));};exports[_0xfe28('0x62')]=function(_0xea2d9b,_0x4533f7){return db[_0xfe28('0x39')][_0xfe28('0x62')]()['then'](respondWithResult(_0x4533f7,null))[_0xfe28('0x54')](handleError(_0x4533f7,null));};exports[_0xfe28('0x63')]=function(_0x2dcebb,_0x103537,_0x14bc06){var _0x6e1715={'raw':!![],'where':{}},_0x5bf6c1={},_0x25bb5d;return db['ChatQueue'][_0xfe28('0x64')]({'where':{'id':_0x2dcebb[_0xfe28('0x56')]['id']}})[_0xfe28('0x1d')](handleEntityNotFound(_0x103537,null))['then'](function(_0x371036){if(_0x371036){_0x25bb5d=_0x371036[_0xfe28('0x5b')]({'plain':!![]});_0x5bf6c1['model']=_['keys'](db[_0xfe28('0x65')][_0xfe28('0x3a')]);_0x5bf6c1[_0xfe28('0x40')]=_['keys'](_0x2dcebb[_0xfe28('0x40')]);_0x5bf6c1[_0xfe28('0x49')]=_[_0xfe28('0x41')](_0x5bf6c1[_0xfe28('0x3e')],_0x5bf6c1[_0xfe28('0x40')]);_0x6e1715[_0xfe28('0x42')]=_['intersection'](_0x5bf6c1['model'],qs[_0xfe28('0x43')](_0x2dcebb[_0xfe28('0x40')][_0xfe28('0x43')]));_0x6e1715[_0xfe28('0x42')]=_0x6e1715['attributes'][_0xfe28('0x44')]?_0x6e1715[_0xfe28('0x42')]:_0x5bf6c1[_0xfe28('0x3e')];if(!_0x2dcebb[_0xfe28('0x40')][_0xfe28('0x66')](_0xfe28('0x45'))){_0x6e1715[_0xfe28('0x46')]=qs['limit'](_0x2dcebb[_0xfe28('0x40')]['limit']);_0x6e1715[_0xfe28('0x2a')]=qs[_0xfe28('0x2a')](_0x2dcebb[_0xfe28('0x40')][_0xfe28('0x2a')]);}_0x6e1715['order']=qs['sort'](_0x2dcebb[_0xfe28('0x40')][_0xfe28('0x48')]);_0x6e1715[_0xfe28('0x4c')]=qs[_0xfe28('0x49')](_['pick'](_0x2dcebb['query'],_0x5bf6c1['filters']));_0x6e1715['where'][_0xfe28('0x67')]=_0x371036['id'];if(_0x2dcebb[_0xfe28('0x40')][_0xfe28('0x4b')]){_0x6e1715[_0xfe28('0x4c')]=_[_0xfe28('0x4d')](_0x6e1715['where'],{'$or':_[_0xfe28('0x3f')](_0x6e1715['attributes'],function(_0x4e4832){var _0x200acb={};_0x200acb[_0x4e4832]={'$like':'%'+_0x2dcebb[_0xfe28('0x40')][_0xfe28('0x4b')]+'%'};return _0x200acb;})});}_0x6e1715=_[_0xfe28('0x4d')]({},_0x6e1715,_0x2dcebb['options']);return db[_0xfe28('0x65')][_0xfe28('0x52')](_0x6e1715);}})[_0xfe28('0x1d')](function(_0x3c3701){if(_0x3c3701){return db[_0xfe28('0x68')][_0xfe28('0x69')]({'where':{'id':_[_0xfe28('0x3f')](_0x3c3701,_0xfe28('0x6a')),'role':'agent'},'attributes':['id',_0xfe28('0x36'),'chatPause',_0xfe28('0x6b'),_0xfe28('0x6c')]});}})['then'](function(_0x387fd9){if(_0x387fd9){return{'count':_0x387fd9[_0xfe28('0x2c')],'rows':_[_0xfe28('0x3f')](_0x387fd9['rows'],function(_0x25a273){return{'membername':_0x25a273[_0xfe28('0x36')],'UserId':_0x25a273['id'],'queue_name':_0x25bb5d[_0xfe28('0x36')],'ChatQueueId':_0x25bb5d['id'],'interface':util[_0xfe28('0x6d')](_0xfe28('0x6e'),_0xfe28('0x6f'),_0x25a273[_0xfe28('0x36')]),'penalty':0x0,'paused':_0x25a273[_0xfe28('0x70')],'createdAt':_0x25a273[_0xfe28('0x6c')],'updatedAt':_0x25a273['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xfe28('0x1d')](respondWithFilteredResult(_0x103537,_0x6e1715))['catch'](handleError(_0x103537,null));};exports['getTeams']=function(_0xf20b0f,_0x37e602,_0x42f887){var _0x2442c3={};var _0x2897bd={};var _0x1c44de;var _0x583bca;return db[_0xfe28('0x39')][_0xfe28('0x64')]({'where':{'id':_0xf20b0f[_0xfe28('0x56')]['id']}})[_0xfe28('0x1d')](handleEntityNotFound(_0x37e602,null))['then'](function(_0xf463d5){if(_0xf463d5){_0x1c44de=_0xf463d5;_0x2897bd[_0xfe28('0x3e')]=_[_0xfe28('0x57')](db[_0xfe28('0x71')][_0xfe28('0x3a')]);_0x2897bd[_0xfe28('0x40')]=_[_0xfe28('0x57')](_0xf20b0f[_0xfe28('0x40')]);_0x2897bd[_0xfe28('0x49')]=_[_0xfe28('0x41')](_0x2897bd[_0xfe28('0x3e')],_0x2897bd[_0xfe28('0x40')]);_0x2442c3[_0xfe28('0x42')]=_[_0xfe28('0x41')](_0x2897bd[_0xfe28('0x3e')],qs[_0xfe28('0x43')](_0xf20b0f[_0xfe28('0x40')][_0xfe28('0x43')]));_0x2442c3['attributes']=_0x2442c3[_0xfe28('0x42')]['length']?_0x2442c3['attributes']:_0x2897bd[_0xfe28('0x3e')];_0x2442c3[_0xfe28('0x47')]=qs['sort'](_0xf20b0f[_0xfe28('0x40')][_0xfe28('0x48')]);_0x2442c3[_0xfe28('0x4c')]=qs[_0xfe28('0x49')](_[_0xfe28('0x4a')](_0xf20b0f[_0xfe28('0x40')],_0x2897bd[_0xfe28('0x49')]));if(_0xf20b0f[_0xfe28('0x40')][_0xfe28('0x4b')]){_0x2442c3[_0xfe28('0x4c')]=_[_0xfe28('0x4d')](_0x2442c3[_0xfe28('0x4c')],{'$or':_[_0xfe28('0x3f')](_0x2442c3['attributes'],function(_0x256992){var _0x4dfbac={};_0x4dfbac[_0x256992]={'$like':'%'+_0xf20b0f[_0xfe28('0x40')][_0xfe28('0x4b')]+'%'};return _0x4dfbac;})});}_0x2442c3=_[_0xfe28('0x4d')]({},_0x2442c3,_0xf20b0f[_0xfe28('0x4f')]);return _0x1c44de[_0xfe28('0x72')](_0x2442c3);}})['then'](function(_0x21d6f0){if(_0x21d6f0){_0x583bca=_0x21d6f0['length'];if(!_0xf20b0f[_0xfe28('0x40')][_0xfe28('0x66')](_0xfe28('0x45'))){_0x2442c3['limit']=qs[_0xfe28('0x46')](_0xf20b0f['query'][_0xfe28('0x46')]);_0x2442c3[_0xfe28('0x2a')]=qs['offset'](_0xf20b0f[_0xfe28('0x40')][_0xfe28('0x2a')]);}return _0x1c44de['getTeams'](_0x2442c3);}})[_0xfe28('0x1d')](function(_0x483dd8){if(_0x483dd8){return _0x483dd8?{'count':_0x583bca,'rows':_0x483dd8}:null;}})[_0xfe28('0x1d')](respondWithResult(_0x37e602,null))[_0xfe28('0x54')](handleError(_0x37e602,null));};exports['addTeams']=function(_0x1fcda6,_0x41d7d1,_0x35a3d6){var _0x24e669=_0x1fcda6[_0xfe28('0x59')]['ids'];return db[_0xfe28('0x71')][_0xfe28('0x52')]({'where':{'id':_0x24e669},'attributes':['id'],'include':[{'model':db[_0xfe28('0x68')],'as':_0xfe28('0x73'),'attributes':['id',_0xfe28('0x36'),_0xfe28('0x74'),_0xfe28('0x75'),_0xfe28('0x76')],'raw':!![]}]})['then'](function(_0x49f4fd){if(_0x49f4fd){var _0x14e6f5=_[_0xfe28('0x77')](_0x49f4fd,function(_0x33b20a){var _0x522d55=_0x33b20a[_0xfe28('0x5b')]({'plain':!![]});return _0x522d55[_0xfe28('0x73')];});return db[_0xfe28('0x39')][_0xfe28('0x5e')]({'where':{'id':_0x1fcda6[_0xfe28('0x56')]['id']}})[_0xfe28('0x1d')](function(_0x40595b){return db[_0xfe28('0x78')][_0xfe28('0x79')](function(_0x396c40){return _0x40595b[_0xfe28('0x7a')](_0x24e669,{'transaction':_0x396c40})['then'](function(){return BPromise['each'](_0x14e6f5,function(_0x2f5987){return db['UserChatQueue'][_0xfe28('0x7b')]({'where':{'UserId':_0x2f5987['id'],'ChatQueueId':_0x1fcda6[_0xfe28('0x56')]['id']},'transaction':_0x396c40});});})[_0xfe28('0x1d')](function(){_0x14e6f5['forEach'](function(_0x3622eb){socket[_0xfe28('0x7c')](_0xfe28('0x7d'),{'UserId':_0x3622eb['id'],'ChatQueueId':_0x40595b['id']});});});});});}})[_0xfe28('0x1d')](respondWithStatusCode(_0x41d7d1,null))[_0xfe28('0x54')](handleError(_0x41d7d1,null));};exports[_0xfe28('0x7e')]=function(_0xef59dc,_0x36cfa7,_0x305a27){return db[_0xfe28('0x71')][_0xfe28('0x52')]({'where':{'id':_0xef59dc['query'][_0xfe28('0x7f')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xfe28('0x73'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x36cfa7,null))[_0xfe28('0x1d')](function(_0x59030c){var _0x10cc0b=_[_0xfe28('0x3f')](_0x59030c,'id');var _0x2050ff=[];var _0x4a4deb=[];var _0x799bf4=squel[_0xfe28('0x80')]();_0x799bf4[_0xfe28('0x81')]('tq.TeamId')[_0xfe28('0x82')](_0xfe28('0x83'),'tq')[_0xfe28('0x84')](_0xfe28('0x85'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xfe28('0x4c')]('ChatQueueId\x20=\x20?',_0xef59dc[_0xfe28('0x56')]['id']);for(var _0x389659=0x0;_0x389659<_0x59030c[_0xfe28('0x44')];_0x389659+=0x1){let _0x40de7b=_0x59030c[_0x389659];for(var _0x57f1df=0x0;_0x57f1df<_0x40de7b[_0xfe28('0x73')][_0xfe28('0x44')];_0x57f1df+=0x1){let _0x3dbc0b=_0x40de7b[_0xfe28('0x73')][_0x57f1df];var _0x36a9d8=_0x799bf4[_0xfe28('0x86')]();_0x36a9d8['where'](_0xfe28('0x87'),_0x3dbc0b['id']);_0x4a4deb[_0xfe28('0x88')](db['sequelize'][_0xfe28('0x40')](_0x36a9d8[_0xfe28('0x89')](),{'type':db['sequelize']['QueryTypes'][_0xfe28('0x8a')]})[_0xfe28('0x1d')](function(_0x22c052){if(_0x22c052['length']===0x1){return _0x3dbc0b['id'];}else{var _0x2aff0d=_[_0xfe28('0x8b')](_[_0xfe28('0x3f')](_0x22c052,_0xfe28('0x8c')),function(_0x125f8d){return _[_0xfe28('0x8d')](_0x10cc0b,_0x125f8d);});if(_0x2aff0d){return _0x3dbc0b['id'];}}}));}}return BPromise[_0xfe28('0x8e')](_0x4a4deb)[_0xfe28('0x1d')](function(_0x27b43e){_0x2050ff=_(_0x2050ff)[_0xfe28('0x8f')](_0x27b43e)[_0xfe28('0x90')]()['value']();return db[_0xfe28('0x39')]['find']({'where':{'id':_0xef59dc[_0xfe28('0x56')]['id']}})[_0xfe28('0x1d')](function(_0x5d4b69){return db[_0xfe28('0x78')][_0xfe28('0x79')](function(_0x57a618){return _0x5d4b69['removeTeams'](_0xef59dc[_0xfe28('0x40')][_0xfe28('0x7f')],{'transaction':_0x57a618})[_0xfe28('0x1d')](function(){if(!_[_0xfe28('0x91')](_0x2050ff)){return _0x5d4b69[_0xfe28('0x92')](_0x2050ff,{'transaction':_0x57a618});}})['then'](function(){_0x2050ff['forEach'](function(_0x367633){socket[_0xfe28('0x7c')](_0xfe28('0x93'),{'UserId':_0x367633,'ChatQueueId':_0x5d4b69['id']});});});});});});})[_0xfe28('0x1d')](respondWithStatusCode(_0x36cfa7,null))[_0xfe28('0x54')](handleError(_0x36cfa7,null));};exports['addAgents']=function(_0x59057b,_0x36889e,_0x5d4efe){return db['ChatQueue'][_0xfe28('0x5e')]({'where':{'id':_0x59057b[_0xfe28('0x56')]['id']}})['then'](handleEntityNotFound(_0x36889e,null))[_0xfe28('0x1d')](function(_0x57028b){if(_0x57028b){return _0x57028b[_0xfe28('0x94')](_0x59057b[_0xfe28('0x59')][_0xfe28('0x7f')],_['omit'](_0x59057b['body'],['ids','id'])||{})[_0xfe28('0x95')](function(_0x17ac83){for(var _0x4e6716=0x0;_0x4e6716<_0x59057b[_0xfe28('0x59')][_0xfe28('0x7f')][_0xfe28('0x44')];_0x4e6716+=0x1){socket[_0xfe28('0x7c')]('userChatQueue:save',{'UserId':Number(_0x59057b[_0xfe28('0x59')][_0xfe28('0x7f')][_0x4e6716]),'ChatQueueId':Number(_0x59057b[_0xfe28('0x56')]['id'])});}return _0x17ac83;});}})[_0xfe28('0x1d')](respondWithResult(_0x36889e,null))[_0xfe28('0x54')](handleError(_0x36889e,null));};exports[_0xfe28('0x92')]=function(_0x4b0ad8,_0x428377,_0x3efda8){return db['ChatQueue'][_0xfe28('0x5e')]({'where':{'id':_0x4b0ad8['params']['id']}})[_0xfe28('0x1d')](handleEntityNotFound(_0x428377,null))['then'](function(_0x1e015a){if(_0x1e015a){return _0x1e015a[_0xfe28('0x92')](_0x4b0ad8[_0xfe28('0x40')][_0xfe28('0x7f')])[_0xfe28('0x1d')](function(){if(_[_0xfe28('0x96')](_0x4b0ad8['query'][_0xfe28('0x7f')])){for(var _0x161bd3=0x0;_0x161bd3<_0x4b0ad8[_0xfe28('0x40')][_0xfe28('0x7f')][_0xfe28('0x44')];_0x161bd3+=0x1){socket['emit']('userChatQueue:remove',{'UserId':Number(_0x4b0ad8[_0xfe28('0x40')][_0xfe28('0x7f')][_0x161bd3]),'ChatQueueId':Number(_0x4b0ad8[_0xfe28('0x56')]['id'])});}}else{socket[_0xfe28('0x7c')](_0xfe28('0x93'),{'UserId':Number(_0x4b0ad8[_0xfe28('0x40')][_0xfe28('0x7f')]),'ChatQueueId':Number(_0x4b0ad8[_0xfe28('0x56')]['id'])});}});}})[_0xfe28('0x1d')](respondWithStatusCode(_0x428377,null))[_0xfe28('0x54')](handleError(_0x428377,null));};exports[_0xfe28('0x97')]=function(_0x22a639,_0x34d4b6,_0x36fff7){var _0x1e6b50={};var _0x29f634={};var _0x124baa;var _0x2624f5;return db[_0xfe28('0x39')][_0xfe28('0x64')]({'where':{'id':_0x22a639[_0xfe28('0x56')]['id']}})['then'](handleEntityNotFound(_0x34d4b6,null))[_0xfe28('0x1d')](function(_0x1cf491){if(_0x1cf491){_0x124baa=_0x1cf491;_0x29f634[_0xfe28('0x3e')]=_[_0xfe28('0x57')](db[_0xfe28('0x68')]['rawAttributes']);_0x29f634[_0xfe28('0x40')]=_[_0xfe28('0x57')](_0x22a639[_0xfe28('0x40')]);_0x29f634['filters']=_[_0xfe28('0x41')](_0x29f634[_0xfe28('0x3e')],_0x29f634[_0xfe28('0x40')]);_0x1e6b50[_0xfe28('0x42')]=_['intersection'](_0x29f634[_0xfe28('0x3e')],qs['fields'](_0x22a639[_0xfe28('0x40')][_0xfe28('0x43')]));_0x1e6b50[_0xfe28('0x42')]=_0x1e6b50[_0xfe28('0x42')]['length']?_0x1e6b50[_0xfe28('0x42')]:_0x29f634[_0xfe28('0x3e')];_0x1e6b50['order']=qs[_0xfe28('0x48')](_0x22a639[_0xfe28('0x40')][_0xfe28('0x48')]);_0x1e6b50['where']=qs['filters'](_[_0xfe28('0x4a')](_0x22a639[_0xfe28('0x40')],_0x29f634[_0xfe28('0x49')]));if(_0x22a639['query'][_0xfe28('0x4b')]){_0x1e6b50[_0xfe28('0x4c')]=_['merge'](_0x1e6b50[_0xfe28('0x4c')],{'$or':_[_0xfe28('0x3f')](_0x1e6b50[_0xfe28('0x42')],function(_0x3fdc81){var _0x4d8674={};_0x4d8674[_0x3fdc81]={'$like':'%'+_0x22a639['query'][_0xfe28('0x4b')]+'%'};return _0x4d8674;})});}_0x1e6b50=_[_0xfe28('0x4d')]({},_0x1e6b50,_0x22a639[_0xfe28('0x4f')]);return _0x124baa['getAgents'](_0x1e6b50);}})['then'](function(_0x32001a){if(_0x32001a){_0x2624f5=_0x32001a[_0xfe28('0x44')];if(!_0x22a639[_0xfe28('0x40')][_0xfe28('0x66')](_0xfe28('0x45'))){_0x1e6b50['limit']=qs[_0xfe28('0x46')](_0x22a639[_0xfe28('0x40')]['limit']);_0x1e6b50[_0xfe28('0x2a')]=qs[_0xfe28('0x2a')](_0x22a639[_0xfe28('0x40')][_0xfe28('0x2a')]);}return _0x124baa['getAgents'](_0x1e6b50);}})[_0xfe28('0x1d')](function(_0x5f2e54){if(_0x5f2e54){return _0x5f2e54?{'count':_0x2624f5,'rows':_0x5f2e54}:null;}})['then'](respondWithResult(_0x34d4b6,null))[_0xfe28('0x54')](handleError(_0x34d4b6,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index 47a1652..95ea4e5 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 _0xeb64=['emit','hasOwnProperty','hook','../../mysqldb','setMaxListeners','save','update'];(function(_0x4c260a,_0x148241){var _0x17bbdd=function(_0x4f3e9f){while(--_0x4f3e9f){_0x4c260a['push'](_0x4c260a['shift']());}};_0x17bbdd(++_0x148241);}(_0xeb64,0x130));var _0x4eb6=function(_0x1b90f4,_0x43959d){_0x1b90f4=_0x1b90f4-0x0;var _0x332b46=_0xeb64[_0x1b90f4];return _0x332b46;};'use strict';var EventEmitter=require('events');var ChatQueue=require(_0x4eb6('0x0'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x4eb6('0x1')](0x0);var events={'afterCreate':_0x4eb6('0x2'),'afterUpdate':_0x4eb6('0x3'),'afterDestroy':'remove'};function emitEvent(_0x3b4905){return function(_0x44b72a,_0x193057,_0x3061d6){ChatQueueEvents[_0x4eb6('0x4')](_0x3b4905+':'+_0x44b72a['id'],_0x44b72a);ChatQueueEvents['emit'](_0x3b4905,_0x44b72a);_0x3061d6(null);};}for(var e in events){if(events[_0x4eb6('0x5')](e)){var event=events[e];ChatQueue[_0x4eb6('0x6')](e,emitEvent(event));}}module['exports']=ChatQueueEvents; \ No newline at end of file +var _0xe350=['../../mysqldb','setMaxListeners','save','update','remove','hook','exports','events'];(function(_0xde0c8a,_0x10f672){var _0x596290=function(_0x314413){while(--_0x314413){_0xde0c8a['push'](_0xde0c8a['shift']());}};_0x596290(++_0x10f672);}(_0xe350,0x1b7));var _0x0e35=function(_0x4869d8,_0x3cbe36){_0x4869d8=_0x4869d8-0x0;var _0x47e27c=_0xe350[_0x4869d8];return _0x47e27c;};'use strict';var EventEmitter=require(_0x0e35('0x0'));var ChatQueue=require(_0x0e35('0x1'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x0e35('0x2')](0x0);var events={'afterCreate':_0x0e35('0x3'),'afterUpdate':_0x0e35('0x4'),'afterDestroy':_0x0e35('0x5')};function emitEvent(_0x40be70){return function(_0xd272e,_0x2d51c5,_0x2d882d){ChatQueueEvents['emit'](_0x40be70+':'+_0xd272e['id'],_0xd272e);ChatQueueEvents['emit'](_0x40be70,_0xd272e);_0x2d882d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0x0e35('0x6')](e,emitEvent(event));}}module[_0x0e35('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 b1798a6..29c8355 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 _0xdaf2=['ChatQueue','chat_queues','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./chatQueue.attributes','define'];(function(_0x4c2623,_0x4838bb){var _0x2be431=function(_0x55829d){while(--_0x55829d){_0x4c2623['push'](_0x4c2623['shift']());}};_0x2be431(++_0x4838bb);}(_0xdaf2,0x12e));var _0x2daf=function(_0x4c5c97,_0x4f85bf){_0x4c5c97=_0x4c5c97-0x0;var _0xd5d2cb=_0xdaf2[_0x4c5c97];return _0xd5d2cb;};'use strict';var _=require(_0x2daf('0x0'));var util=require(_0x2daf('0x1'));var logger=require(_0x2daf('0x2'))(_0x2daf('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x2daf('0x4'));var fs=require('fs');var path=require(_0x2daf('0x5'));var rimraf=require(_0x2daf('0x6'));var config=require(_0x2daf('0x7'));var attributes=require(_0x2daf('0x8'));module['exports']=function(_0xb57b82,_0x80ce42){return _0xb57b82[_0x2daf('0x9')](_0x2daf('0xa'),attributes,{'tableName':_0x2daf('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x05de=['../../config/environment','./chatQueue.attributes','define','ChatQueue','chat_queues','util','api','bluebird','request-promise','path'];(function(_0x278679,_0x1eb219){var _0x4874aa=function(_0x2806b8){while(--_0x2806b8){_0x278679['push'](_0x278679['shift']());}};_0x4874aa(++_0x1eb219);}(_0x05de,0xc3));var _0xe05d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x05de[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0xe05d('0x0'));var logger=require('../../config/logger')(_0xe05d('0x1'));var moment=require('moment');var BPromise=require(_0xe05d('0x2'));var rp=require(_0xe05d('0x3'));var fs=require('fs');var path=require(_0xe05d('0x4'));var rimraf=require('rimraf');var config=require(_0xe05d('0x5'));var attributes=require(_0xe05d('0x6'));module['exports']=function(_0x3dd227,_0x39ba11){return _0x3dd227[_0xe05d('0x7')](_0xe05d('0x8'),attributes,{'tableName':_0xe05d('0x9'),'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 eea3d29..9ca010f 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 _0x7e56=['redis','./chatQueue.socket','register','request','then','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetChatQueue','ChatQueue','findAll','options','where','attributes','limit','map','include','model','debug','ShowChatQueue','find','raw','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client'];(function(_0x3d7e29,_0x4b19b9){var _0x480345=function(_0x512148){while(--_0x512148){_0x3d7e29['push'](_0x3d7e29['shift']());}};_0x480345(++_0x4b19b9);}(_0x7e56,0x107));var _0x67e5=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x7e56[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x67e5('0x0'));var util=require(_0x67e5('0x1'));var moment=require(_0x67e5('0x2'));var BPromise=require('bluebird');var rs=require(_0x67e5('0x3'));var fs=require('fs');var Redis=require(_0x67e5('0x4'));var db=require(_0x67e5('0x5'))['db'];var utils=require(_0x67e5('0x6'));var logger=require(_0x67e5('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x67e5('0x8'));var client=jayson[_0x67e5('0x9')]['http']({'port':0x232a});config[_0x67e5('0xa')]=_['defaults'](config[_0x67e5('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x67e5('0xa')]));require(_0x67e5('0xb'))[_0x67e5('0xc')](socket);function respondWithRpcPromise(_0x4682e1,_0x43da28,_0x111988){return new BPromise(function(_0x4edc9c,_0x4fc3fd){return client[_0x67e5('0xd')](_0x4682e1,_0x111988)[_0x67e5('0xe')](function(_0x55f070){logger['info'](_0x67e5('0xf'),_0x43da28,_0x67e5('0x10'));logger['debug'](_0x67e5('0x11'),_0x43da28,'request\x20sent',JSON[_0x67e5('0x12')](_0x55f070));if(_0x55f070[_0x67e5('0x13')]){if(_0x55f070[_0x67e5('0x13')][_0x67e5('0x14')]===0x1f4){logger[_0x67e5('0x13')](_0x67e5('0xf'),_0x43da28,_0x55f070['error']['message']);return _0x4fc3fd(_0x55f070[_0x67e5('0x13')][_0x67e5('0x15')]);}logger[_0x67e5('0x13')]('ChatQueue,\x20%s,\x20%s',_0x43da28,_0x55f070[_0x67e5('0x13')][_0x67e5('0x15')]);return _0x4edc9c(_0x55f070[_0x67e5('0x13')][_0x67e5('0x15')]);}else{logger[_0x67e5('0x16')](_0x67e5('0xf'),_0x43da28,_0x67e5('0x10'));_0x4edc9c(_0x55f070[_0x67e5('0x17')]['message']);}})[_0x67e5('0x18')](function(_0x2182d5){logger[_0x67e5('0x13')](_0x67e5('0xf'),_0x43da28,_0x2182d5);_0x4fc3fd(_0x2182d5);});});}exports[_0x67e5('0x19')]=function(_0x5de872){var _0x1c8891=this;return new Promise(function(_0x557d6a,_0x2143ff){return db[_0x67e5('0x1a')][_0x67e5('0x1b')]({'raw':_0x5de872['options']?_0x5de872[_0x67e5('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x5de872[_0x67e5('0x1c')]?_0x5de872[_0x67e5('0x1c')][_0x67e5('0x1d')]||null:null,'attributes':_0x5de872[_0x67e5('0x1c')]?_0x5de872['options'][_0x67e5('0x1e')]||null:null,'limit':_0x5de872[_0x67e5('0x1c')]?_0x5de872[_0x67e5('0x1c')][_0x67e5('0x1f')]||null:null,'include':_0x5de872[_0x67e5('0x1c')]?_0x5de872['options']['include']?_[_0x67e5('0x20')](_0x5de872[_0x67e5('0x1c')][_0x67e5('0x21')],function(_0x4b3120){return{'model':db[_0x4b3120[_0x67e5('0x22')]],'as':_0x4b3120['as'],'attributes':_0x4b3120['attributes'],'include':_0x4b3120[_0x67e5('0x21')]?_[_0x67e5('0x20')](_0x4b3120[_0x67e5('0x21')],function(_0x133e49){return{'model':db[_0x133e49[_0x67e5('0x22')]],'as':_0x133e49['as'],'attributes':_0x133e49[_0x67e5('0x1e')],'include':_0x133e49[_0x67e5('0x21')]?_[_0x67e5('0x20')](_0x133e49[_0x67e5('0x21')],function(_0x55c7f2){return{'model':db[_0x55c7f2[_0x67e5('0x22')]],'as':_0x55c7f2['as'],'attributes':_0x55c7f2[_0x67e5('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x67e5('0xe')](function(_0x33c506){logger[_0x67e5('0x16')]('GetChatQueue',_0x5de872);logger[_0x67e5('0x23')]('GetChatQueue',_0x5de872,JSON[_0x67e5('0x12')](_0x33c506));_0x557d6a(_0x33c506);})[_0x67e5('0x18')](function(_0xe1a2e4){logger[_0x67e5('0x13')]('GetChatQueue',_0xe1a2e4['message'],_0x5de872);_0x2143ff(_0x1c8891[_0x67e5('0x13')](0x1f4,_0xe1a2e4['message']));});});};exports[_0x67e5('0x24')]=function(_0x53a49d){var _0x2815aa=this;return new Promise(function(_0x1682c5,_0x573136){return db[_0x67e5('0x1a')][_0x67e5('0x25')]({'raw':_0x53a49d[_0x67e5('0x1c')]?_0x53a49d[_0x67e5('0x1c')][_0x67e5('0x26')]===undefined?!![]:![]:!![],'where':_0x53a49d['options']?_0x53a49d[_0x67e5('0x1c')]['where']||null:null,'attributes':_0x53a49d[_0x67e5('0x1c')]?_0x53a49d[_0x67e5('0x1c')][_0x67e5('0x1e')]||null:null,'include':_0x53a49d['options']?_0x53a49d['options'][_0x67e5('0x21')]?_[_0x67e5('0x20')](_0x53a49d[_0x67e5('0x1c')][_0x67e5('0x21')],function(_0x1ebe59){return{'model':db[_0x1ebe59[_0x67e5('0x22')]],'as':_0x1ebe59['as'],'attributes':_0x1ebe59['attributes'],'include':_0x1ebe59[_0x67e5('0x21')]?_['map'](_0x1ebe59[_0x67e5('0x21')],function(_0x18231b){return{'model':db[_0x18231b['model']],'as':_0x18231b['as'],'attributes':_0x18231b['attributes'],'include':_0x18231b[_0x67e5('0x21')]?_[_0x67e5('0x20')](_0x18231b[_0x67e5('0x21')],function(_0x3ec08e){return{'model':db[_0x3ec08e[_0x67e5('0x22')]],'as':_0x3ec08e['as'],'attributes':_0x3ec08e[_0x67e5('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x67e5('0xe')](function(_0x35c5e5){logger[_0x67e5('0x16')](_0x67e5('0x24'),_0x53a49d);logger[_0x67e5('0x23')](_0x67e5('0x24'),_0x53a49d,JSON[_0x67e5('0x12')](_0x35c5e5));_0x1682c5(_0x35c5e5);})[_0x67e5('0x18')](function(_0x5c5df2){logger[_0x67e5('0x13')]('ShowChatQueue',_0x5c5df2[_0x67e5('0x15')],_0x53a49d);_0x573136(_0x2815aa[_0x67e5('0x13')](0x1f4,_0x5c5df2[_0x67e5('0x15')]));});});}; \ No newline at end of file +var _0xd48a=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','redis','localhost','socket.io-emitter','./chatQueue.socket','register','request','then','info','ChatQueue,\x20%s,\x20%s','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','GetChatQueue','ChatQueue','options','raw','where','attributes','limit','include','map','model','debug','stringify','ShowChatQueue','lodash','moment'];(function(_0x3a94b6,_0x175b0e){var _0x3943c5=function(_0x3c2cc1){while(--_0x3c2cc1){_0x3a94b6['push'](_0x3a94b6['shift']());}};_0x3943c5(++_0x175b0e);}(_0xd48a,0x96));var _0xad48=function(_0x101d84,_0xfa55af){_0x101d84=_0x101d84-0x0;var _0x43c337=_0xd48a[_0x101d84];return _0x43c337;};'use strict';var _=require(_0xad48('0x0'));var util=require('util');var moment=require(_0xad48('0x1'));var BPromise=require(_0xad48('0x2'));var rs=require(_0xad48('0x3'));var fs=require('fs');var Redis=require(_0xad48('0x4'));var db=require(_0xad48('0x5'))['db'];var utils=require(_0xad48('0x6'));var logger=require('../../config/logger')(_0xad48('0x7'));var config=require(_0xad48('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xad48('0x9')]['http']({'port':0x232a});config['redis']=_['defaults'](config[_0xad48('0xa')],{'host':_0xad48('0xb'),'port':0x18eb});var socket=require(_0xad48('0xc'))(new Redis(config[_0xad48('0xa')]));require(_0xad48('0xd'))[_0xad48('0xe')](socket);function respondWithRpcPromise(_0xfd61fd,_0x1187a1,_0x4a2096){return new BPromise(function(_0x412ef4,_0x537419){return client[_0xad48('0xf')](_0xfd61fd,_0x4a2096)[_0xad48('0x10')](function(_0x56f398){logger[_0xad48('0x11')](_0xad48('0x12'),_0x1187a1,'request\x20sent');logger['debug'](_0xad48('0x13'),_0x1187a1,_0xad48('0x14'),JSON['stringify'](_0x56f398));if(_0x56f398[_0xad48('0x15')]){if(_0x56f398[_0xad48('0x15')]['code']===0x1f4){logger[_0xad48('0x15')](_0xad48('0x12'),_0x1187a1,_0x56f398[_0xad48('0x15')][_0xad48('0x16')]);return _0x537419(_0x56f398['error'][_0xad48('0x16')]);}logger['error']('ChatQueue,\x20%s,\x20%s',_0x1187a1,_0x56f398['error'][_0xad48('0x16')]);return _0x412ef4(_0x56f398[_0xad48('0x15')][_0xad48('0x16')]);}else{logger[_0xad48('0x11')]('ChatQueue,\x20%s,\x20%s',_0x1187a1,_0xad48('0x14'));_0x412ef4(_0x56f398[_0xad48('0x17')][_0xad48('0x16')]);}})[_0xad48('0x18')](function(_0x58e684){logger['error'](_0xad48('0x12'),_0x1187a1,_0x58e684);_0x537419(_0x58e684);});});}exports[_0xad48('0x19')]=function(_0x595e0c){var _0x2c2996=this;return new Promise(function(_0xfecf2f,_0x1014cc){return db[_0xad48('0x1a')]['findAll']({'raw':_0x595e0c[_0xad48('0x1b')]?_0x595e0c[_0xad48('0x1b')][_0xad48('0x1c')]===undefined?!![]:![]:!![],'where':_0x595e0c['options']?_0x595e0c[_0xad48('0x1b')][_0xad48('0x1d')]||null:null,'attributes':_0x595e0c[_0xad48('0x1b')]?_0x595e0c[_0xad48('0x1b')][_0xad48('0x1e')]||null:null,'limit':_0x595e0c['options']?_0x595e0c[_0xad48('0x1b')][_0xad48('0x1f')]||null:null,'include':_0x595e0c[_0xad48('0x1b')]?_0x595e0c[_0xad48('0x1b')][_0xad48('0x20')]?_[_0xad48('0x21')](_0x595e0c[_0xad48('0x1b')][_0xad48('0x20')],function(_0x13589d){return{'model':db[_0x13589d['model']],'as':_0x13589d['as'],'attributes':_0x13589d[_0xad48('0x1e')],'include':_0x13589d[_0xad48('0x20')]?_[_0xad48('0x21')](_0x13589d[_0xad48('0x20')],function(_0x48a021){return{'model':db[_0x48a021[_0xad48('0x22')]],'as':_0x48a021['as'],'attributes':_0x48a021[_0xad48('0x1e')],'include':_0x48a021[_0xad48('0x20')]?_['map'](_0x48a021[_0xad48('0x20')],function(_0x4158c3){return{'model':db[_0x4158c3[_0xad48('0x22')]],'as':_0x4158c3['as'],'attributes':_0x4158c3['attributes']};}):[]};}):[]};}):[]:[]})[_0xad48('0x10')](function(_0x539d3e){logger[_0xad48('0x11')](_0xad48('0x19'),_0x595e0c);logger[_0xad48('0x23')](_0xad48('0x19'),_0x595e0c,JSON[_0xad48('0x24')](_0x539d3e));_0xfecf2f(_0x539d3e);})['catch'](function(_0x1ef71a){logger[_0xad48('0x15')](_0xad48('0x19'),_0x1ef71a['message'],_0x595e0c);_0x1014cc(_0x2c2996['error'](0x1f4,_0x1ef71a[_0xad48('0x16')]));});});};exports[_0xad48('0x25')]=function(_0x4b0081){var _0x26f0be=this;return new Promise(function(_0x36f407,_0x1cacfc){return db[_0xad48('0x1a')]['find']({'raw':_0x4b0081[_0xad48('0x1b')]?_0x4b0081['options'][_0xad48('0x1c')]===undefined?!![]:![]:!![],'where':_0x4b0081[_0xad48('0x1b')]?_0x4b0081[_0xad48('0x1b')]['where']||null:null,'attributes':_0x4b0081[_0xad48('0x1b')]?_0x4b0081[_0xad48('0x1b')]['attributes']||null:null,'include':_0x4b0081[_0xad48('0x1b')]?_0x4b0081[_0xad48('0x1b')][_0xad48('0x20')]?_[_0xad48('0x21')](_0x4b0081[_0xad48('0x1b')][_0xad48('0x20')],function(_0x50ce77){return{'model':db[_0x50ce77[_0xad48('0x22')]],'as':_0x50ce77['as'],'attributes':_0x50ce77[_0xad48('0x1e')],'include':_0x50ce77[_0xad48('0x20')]?_['map'](_0x50ce77[_0xad48('0x20')],function(_0x24d022){return{'model':db[_0x24d022[_0xad48('0x22')]],'as':_0x24d022['as'],'attributes':_0x24d022[_0xad48('0x1e')],'include':_0x24d022['include']?_['map'](_0x24d022[_0xad48('0x20')],function(_0x5ed8d5){return{'model':db[_0x5ed8d5[_0xad48('0x22')]],'as':_0x5ed8d5['as'],'attributes':_0x5ed8d5[_0xad48('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xad48('0x10')](function(_0x3b3306){logger[_0xad48('0x11')]('ShowChatQueue',_0x4b0081);logger[_0xad48('0x23')]('ShowChatQueue',_0x4b0081,JSON[_0xad48('0x24')](_0x3b3306));_0x36f407(_0x3b3306);})[_0xad48('0x18')](function(_0x340255){logger[_0xad48('0x15')](_0xad48('0x25'),_0x340255[_0xad48('0x16')],_0x4b0081);_0x1cacfc(_0x26f0be[_0xad48('0x15')](0x1f4,_0x340255['message']));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index 56915fa..513b4ab 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 _0x826a=['update','emit','removeListener','register','length','chatQueue:','save'];(function(_0x5f18dc,_0x1958a6){var _0x35bada=function(_0x391de7){while(--_0x391de7){_0x5f18dc['push'](_0x5f18dc['shift']());}};_0x35bada(++_0x1958a6);}(_0x826a,0x1aa));var _0xa826=function(_0x327202,_0x43df14){_0x327202=_0x327202-0x0;var _0x141f77=_0x826a[_0x327202];return _0x141f77;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=[_0xa826('0x0'),'remove',_0xa826('0x1')];function createListener(_0x50c70e,_0x376d53){return function(_0x19ba11){_0x376d53[_0xa826('0x2')](_0x50c70e,_0x19ba11);};}function removeListener(_0x34e1ad,_0x5372ab){return function(){ChatQueueEvents[_0xa826('0x3')](_0x34e1ad,_0x5372ab);};}exports[_0xa826('0x4')]=function(_0x3929d4){for(var _0x34327b=0x0,_0x45154f=events[_0xa826('0x5')];_0x34327b<_0x45154f;_0x34327b++){var _0x4339f9=events[_0x34327b];var _0x14c2ba=createListener(_0xa826('0x6')+_0x4339f9,_0x3929d4);ChatQueueEvents['on'](_0x4339f9,_0x14c2ba);}}; \ No newline at end of file +var _0xd2ea=['./chatQueue.events','save','remove','update','emit','removeListener','register','length','chatQueue:'];(function(_0xe48d50,_0xc9bd4c){var _0x5ceae8=function(_0x5b10b5){while(--_0x5b10b5){_0xe48d50['push'](_0xe48d50['shift']());}};_0x5ceae8(++_0xc9bd4c);}(_0xd2ea,0x15f));var _0xad2e=function(_0x2186df,_0x44bc52){_0x2186df=_0x2186df-0x0;var _0x4c7f83=_0xd2ea[_0x2186df];return _0x4c7f83;};'use strict';var ChatQueueEvents=require(_0xad2e('0x0'));var events=[_0xad2e('0x1'),_0xad2e('0x2'),_0xad2e('0x3')];function createListener(_0x44b30d,_0x5c9fa9){return function(_0x3a9d11){_0x5c9fa9[_0xad2e('0x4')](_0x44b30d,_0x3a9d11);};}function removeListener(_0xcba7cb,_0x3e0741){return function(){ChatQueueEvents[_0xad2e('0x5')](_0xcba7cb,_0x3e0741);};}exports[_0xad2e('0x6')]=function(_0x29e97f){for(var _0x592e8b=0x0,_0x3b5170=events[_0xad2e('0x7')];_0x592e8b<_0x3b5170;_0x592e8b++){var _0x2ff7b2=events[_0x592e8b];var _0x5710ac=createListener(_0xad2e('0x8')+_0x2ff7b2,_0x29e97f);ChatQueueEvents['on'](_0x2ff7b2,_0x5710ac);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index 8785c73..8356542 100644 --- a/server/api/chatQueue/index.js +++ b/server/api/chatQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','show','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','/:id/teams','removeTeams','multer','util','path'];(function(_0x21a7c6,_0x296a2f){var _0x397342=function(_0x3b127e){while(--_0x3b127e){_0x21a7c6['push'](_0x21a7c6['shift']());}};_0x397342(++_0x296a2f);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/teams',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x14')]('/:id/teams',auth['isAuthenticated'](),controller[_0x7995('0x16')]);router[_0x7995('0x14')](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x17')]);router[_0x7995('0x18')](_0x7995('0x19'),auth[_0x7995('0xa')](),controller['update']);router[_0x7995('0x1a')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0x1b')]);router[_0x7995('0x1a')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x1d')]);router['delete']('/:id/users',auth[_0x7995('0xa')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0x008c=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','show','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','addAgents','update','delete','/:id','removeTeams','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x226936,_0xc9f2f5){var _0x34ab81=function(_0x147ed1){while(--_0x147ed1){_0x226936['push'](_0x226936['shift']());}};_0x34ab81(++_0xc9f2f5);}(_0x008c,0x188));var _0xc008=function(_0xd76edb,_0x1583c4){_0xd76edb=_0xd76edb-0x0;var _0x528c9b=_0x008c[_0xd76edb];return _0x528c9b;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var fs_extra=require(_0xc008('0x5'));var auth=require(_0xc008('0x6'));var interaction=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var controller=require(_0xc008('0x9'));router[_0xc008('0xa')]('/',auth[_0xc008('0xb')](),controller[_0xc008('0xc')]);router[_0xc008('0xa')]('/describe',auth[_0xc008('0xb')](),controller['describe']);router[_0xc008('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xc008('0xd')]);router[_0xc008('0xa')]('/:id/members',auth['isAuthenticated'](),controller['getMembers']);router[_0xc008('0xa')](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0xf')]);router[_0xc008('0xa')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x11')]);router[_0xc008('0x12')]('/',auth[_0xc008('0xb')](),controller['create']);router['post'](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0x13')]);router[_0xc008('0x12')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x14')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xc008('0x15')]);router[_0xc008('0x16')](_0xc008('0x17'),auth[_0xc008('0xb')](),controller['destroy']);router['delete']('/:id/teams',auth['isAuthenticated'](),controller[_0xc008('0x18')]);router[_0xc008('0x16')]('/:id/users',auth[_0xc008('0xb')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index cbcd7d6..6bf35a0 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 _0x6cc9=['STRING','DATE','moment'];(function(_0x34bf97,_0xc60f9d){var _0x292719=function(_0x31354e){while(--_0x31354e){_0x34bf97['push'](_0x34bf97['shift']());}};_0x292719(++_0xc60f9d);}(_0x6cc9,0x188));var _0x96cc=function(_0x4cdbcc,_0x88dd08){_0x4cdbcc=_0x4cdbcc-0x0;var _0x459841=_0x6cc9[_0x4cdbcc];return _0x459841;};'use strict';var moment=require(_0x96cc('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x96cc('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x96cc('0x1')]},'joinAt':{'type':Sequelize[_0x96cc('0x2')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x96cc('0x2')]},'exitAt':{'type':Sequelize[_0x96cc('0x2')]},'reason':{'type':Sequelize[_0x96cc('0x1')]}}; \ No newline at end of file +var _0x6de8=['DATE','sequelize','exports','STRING'];(function(_0x5a20d7,_0x390d78){var _0x5f2430=function(_0x1835a2){while(--_0x1835a2){_0x5a20d7['push'](_0x5a20d7['shift']());}};_0x5f2430(++_0x390d78);}(_0x6de8,0xa1));var _0x86de=function(_0x2fd0f0,_0x4b634e){_0x2fd0f0=_0x2fd0f0-0x0;var _0x57f71a=_0x6de8[_0x2fd0f0];return _0x57f71a;};'use strict';var moment=require('moment');var Sequelize=require(_0x86de('0x0'));module[_0x86de('0x1')]={'uniqueid':{'type':Sequelize[_0x86de('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x86de('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x86de('0x3')]},'exitAt':{'type':Sequelize[_0x86de('0x3')]},'reason':{'type':Sequelize[_0x86de('0x2')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index b6d186a..b5f3ad2 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 _0xbd18=['undefined','count','set','Content-Range','apply','reject','save','update','then','destroy','name','ChatQueueReport','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','options','find','catch','create','body','describe','eml-format','rimraf','zip-dir','request-promise','util','path','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','limit'];(function(_0x37c8ef,_0x334449){var _0x5eaee9=function(_0x4b1b98){while(--_0x4b1b98){_0x37c8ef['push'](_0x37c8ef['shift']());}};_0x5eaee9(++_0x334449);}(_0xbd18,0x195));var _0x8bd1=function(_0xd9c344,_0x3e424b){_0xd9c344=_0xd9c344-0x0;var _0x470d66=_0xbd18[_0xd9c344];return _0x470d66;};'use strict';var emlformat=require(_0x8bd1('0x0'));var rimraf=require(_0x8bd1('0x1'));var zipdir=require(_0x8bd1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8bd1('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x8bd1('0x4'));var path=require(_0x8bd1('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x8bd1('0x6'));var fs=require('fs');var fs_extra=require(_0x8bd1('0x7'));var _=require(_0x8bd1('0x8'));var squel=require(_0x8bd1('0x9'));var crypto=require('crypto');var jsforce=require(_0x8bd1('0xa'));var deskjs=require(_0x8bd1('0xb'));var toCsv=require(_0x8bd1('0xc'));var querystring=require('querystring');var Papa=require(_0x8bd1('0xd'));var Redis=require(_0x8bd1('0xe'));var authService=require(_0x8bd1('0xf'));var qs=require(_0x8bd1('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8bd1('0x11'));var logger=require('../../config/logger')(_0x8bd1('0x12'));var utils=require(_0x8bd1('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x8bd1('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x186943,_0x37639b){_0x37639b=_0x37639b||0xcc;return function(_0x11d80a){if(_0x11d80a){return _0x186943[_0x8bd1('0x15')](_0x37639b);}return _0x186943[_0x8bd1('0x16')](_0x37639b)[_0x8bd1('0x17')]();};}function respondWithResult(_0x194812,_0x322d06){_0x322d06=_0x322d06||0xc8;return function(_0x44a6cd){if(_0x44a6cd){return _0x194812['status'](_0x322d06)[_0x8bd1('0x18')](_0x44a6cd);}};}function respondWithFilteredResult(_0x1d446d,_0x65d556){return function(_0x41b595){if(_0x41b595){var _0x63b01a=typeof _0x65d556[_0x8bd1('0x19')]==='undefined'&&typeof _0x65d556[_0x8bd1('0x1a')]===_0x8bd1('0x1b');var _0xcef42a=_0x41b595['count'];var _0x48a9d0=_0x63b01a?0x0:_0x65d556[_0x8bd1('0x19')];var _0x3ef8aa=_0x63b01a?_0x41b595[_0x8bd1('0x1c')]:_0x65d556[_0x8bd1('0x19')]+_0x65d556[_0x8bd1('0x1a')];var _0x2d7217;if(_0x3ef8aa>=_0xcef42a){_0x3ef8aa=_0xcef42a;_0x2d7217=0xc8;}else{_0x2d7217=0xce;}_0x1d446d[_0x8bd1('0x16')](_0x2d7217);return _0x1d446d[_0x8bd1('0x1d')](_0x8bd1('0x1e'),_0x48a9d0+'-'+_0x3ef8aa+'/'+_0xcef42a)[_0x8bd1('0x18')](_0x41b595);}return null;};}function patchUpdates(_0x58d428){return function(_0x24a4c9){try{jsonpatch[_0x8bd1('0x1f')](_0x24a4c9,_0x58d428,!![]);}catch(_0x3e1a43){return BPromise[_0x8bd1('0x20')](_0x3e1a43);}return _0x24a4c9[_0x8bd1('0x21')]();};}function saveUpdates(_0x3d51fb,_0x460f09){return function(_0x407a49){if(_0x407a49){return _0x407a49[_0x8bd1('0x22')](_0x3d51fb)[_0x8bd1('0x23')](function(_0x22dd62){return _0x22dd62;});}return null;};}function removeEntity(_0x19fb04,_0x59f54e){return function(_0xbe9080){if(_0xbe9080){return _0xbe9080[_0x8bd1('0x24')]()['then'](function(){_0x19fb04[_0x8bd1('0x16')](0xcc)[_0x8bd1('0x17')]();});}};}function handleEntityNotFound(_0x5aa02d,_0x1ea0dc){return function(_0x2394c5){if(!_0x2394c5){_0x5aa02d[_0x8bd1('0x15')](0x194);}return _0x2394c5;};}function handleError(_0x553a9c,_0x205f67){_0x205f67=_0x205f67||0x1f4;return function(_0x1963dc){logger['error'](_0x1963dc['stack']);if(_0x1963dc[_0x8bd1('0x25')]){delete _0x1963dc['name'];}_0x553a9c[_0x8bd1('0x16')](_0x205f67)['send'](_0x1963dc);};}exports['index']=function(_0x46e8bd,_0x1e9389){var _0x34401e={},_0x38d8a0={},_0x15b332={'count':0x0,'rows':[]};var _0xdf3834=_['map'](db[_0x8bd1('0x26')][_0x8bd1('0x27')],function(_0x13e0e0){return{'name':_0x13e0e0[_0x8bd1('0x28')],'type':_0x13e0e0[_0x8bd1('0x29')][_0x8bd1('0x2a')]};});_0x38d8a0[_0x8bd1('0x2b')]=_[_0x8bd1('0x2c')](_0xdf3834,'name');_0x38d8a0[_0x8bd1('0x2d')]=_[_0x8bd1('0x2e')](_0x46e8bd['query']);_0x38d8a0[_0x8bd1('0x2f')]=_[_0x8bd1('0x30')](_0x38d8a0[_0x8bd1('0x2b')],_0x38d8a0[_0x8bd1('0x2d')]);_0x34401e[_0x8bd1('0x31')]=_['intersection'](_0x38d8a0[_0x8bd1('0x2b')],qs['fields'](_0x46e8bd['query'][_0x8bd1('0x32')]));_0x34401e[_0x8bd1('0x31')]=_0x34401e['attributes'][_0x8bd1('0x33')]?_0x34401e['attributes']:_0x38d8a0[_0x8bd1('0x2b')];if(!_0x46e8bd[_0x8bd1('0x2d')][_0x8bd1('0x34')]('nolimit')){_0x34401e['limit']=qs[_0x8bd1('0x1a')](_0x46e8bd[_0x8bd1('0x2d')][_0x8bd1('0x1a')]);_0x34401e[_0x8bd1('0x19')]=qs[_0x8bd1('0x19')](_0x46e8bd[_0x8bd1('0x2d')][_0x8bd1('0x19')]);}_0x34401e[_0x8bd1('0x35')]=qs[_0x8bd1('0x36')](_0x46e8bd['query']['sort']);_0x34401e[_0x8bd1('0x37')]=qs[_0x8bd1('0x2f')](_[_0x8bd1('0x38')](_0x46e8bd[_0x8bd1('0x2d')],_0x38d8a0[_0x8bd1('0x2f')]),_0xdf3834);if(_0x46e8bd[_0x8bd1('0x2d')][_0x8bd1('0x39')]){_0x34401e[_0x8bd1('0x37')]=_[_0x8bd1('0x3a')](_0x34401e['where'],{'$or':_[_0x8bd1('0x2c')](_0xdf3834,function(_0x225c14){if(_0x225c14[_0x8bd1('0x29')]!==_0x8bd1('0x3b')){var _0x56f8e3={};_0x56f8e3[_0x225c14['name']]={'$like':'%'+_0x46e8bd[_0x8bd1('0x2d')][_0x8bd1('0x39')]+'%'};return _0x56f8e3;}})});}_0x34401e=_['merge']({},_0x34401e,_0x46e8bd['options']);var _0x2bf417={'where':_0x34401e[_0x8bd1('0x37')]};return db[_0x8bd1('0x26')]['count'](_0x2bf417)[_0x8bd1('0x23')](function(_0x339e2a){_0x15b332['count']=_0x339e2a;if(_0x46e8bd[_0x8bd1('0x2d')][_0x8bd1('0x3c')]){_0x34401e[_0x8bd1('0x3d')]=[{'all':!![]}];}return db[_0x8bd1('0x26')][_0x8bd1('0x3e')](_0x34401e);})['then'](function(_0xa03ed9){_0x15b332[_0x8bd1('0x3f')]=_0xa03ed9;return _0x15b332;})[_0x8bd1('0x23')](respondWithFilteredResult(_0x1e9389,_0x34401e))['catch'](handleError(_0x1e9389,null));};exports[_0x8bd1('0x40')]=function(_0x380599,_0x30375e){var _0x48a808={'raw':!![],'where':{'id':_0x380599[_0x8bd1('0x41')]['id']}},_0x3d6628={};_0x3d6628[_0x8bd1('0x2b')]=_['keys'](db[_0x8bd1('0x26')][_0x8bd1('0x27')]);_0x3d6628[_0x8bd1('0x2d')]=_['keys'](_0x380599[_0x8bd1('0x2d')]);_0x3d6628[_0x8bd1('0x2f')]=_[_0x8bd1('0x30')](_0x3d6628['model'],_0x3d6628[_0x8bd1('0x2d')]);_0x48a808[_0x8bd1('0x31')]=_[_0x8bd1('0x30')](_0x3d6628[_0x8bd1('0x2b')],qs[_0x8bd1('0x32')](_0x380599['query']['fields']));_0x48a808['attributes']=_0x48a808[_0x8bd1('0x31')][_0x8bd1('0x33')]?_0x48a808[_0x8bd1('0x31')]:_0x3d6628[_0x8bd1('0x2b')];if(_0x380599[_0x8bd1('0x2d')]['includeAll']){_0x48a808['include']=[{'all':!![]}];}_0x48a808=_[_0x8bd1('0x3a')]({},_0x48a808,_0x380599[_0x8bd1('0x42')]);return db[_0x8bd1('0x26')][_0x8bd1('0x43')](_0x48a808)[_0x8bd1('0x23')](handleEntityNotFound(_0x30375e,null))[_0x8bd1('0x23')](respondWithResult(_0x30375e,null))[_0x8bd1('0x44')](handleError(_0x30375e,null));};exports[_0x8bd1('0x45')]=function(_0x346514,_0x3abf0d){return db[_0x8bd1('0x26')][_0x8bd1('0x45')](_0x346514[_0x8bd1('0x46')],{})[_0x8bd1('0x23')](respondWithResult(_0x3abf0d,0xc9))['catch'](handleError(_0x3abf0d,null));};exports[_0x8bd1('0x22')]=function(_0x4983e4,_0x354a63){if(_0x4983e4[_0x8bd1('0x46')]['id']){delete _0x4983e4[_0x8bd1('0x46')]['id'];}return db[_0x8bd1('0x26')]['find']({'where':{'id':_0x4983e4[_0x8bd1('0x41')]['id']}})['then'](handleEntityNotFound(_0x354a63,null))[_0x8bd1('0x23')](saveUpdates(_0x4983e4[_0x8bd1('0x46')],null))[_0x8bd1('0x23')](respondWithResult(_0x354a63,null))[_0x8bd1('0x44')](handleError(_0x354a63,null));};exports[_0x8bd1('0x24')]=function(_0x553f1e,_0x5a4c58){return db[_0x8bd1('0x26')][_0x8bd1('0x43')]({'where':{'id':_0x553f1e[_0x8bd1('0x41')]['id']}})['then'](handleEntityNotFound(_0x5a4c58,null))[_0x8bd1('0x23')](removeEntity(_0x5a4c58,null))[_0x8bd1('0x44')](handleError(_0x5a4c58,null));};exports[_0x8bd1('0x47')]=function(_0x6e8691,_0x239ef2){return db['ChatQueueReport'][_0x8bd1('0x47')]()[_0x8bd1('0x23')](respondWithResult(_0x239ef2,null))['catch'](handleError(_0x239ef2,null));}; \ No newline at end of file +var _0x9261=['rows','show','params','rawAttributes','find','catch','create','body','destroy','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','stack','name','send','index','map','ChatQueueReport','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','nolimit','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll'];(function(_0x3b8f2e,_0x5a99a8){var _0x1433d5=function(_0x5e0353){while(--_0x5e0353){_0x3b8f2e['push'](_0x3b8f2e['shift']());}};_0x1433d5(++_0x5a99a8);}(_0x9261,0x1de));var _0x1926=function(_0x26e727,_0x3e65be){_0x26e727=_0x26e727-0x0;var _0x563800=_0x9261[_0x26e727];return _0x563800;};'use strict';var emlformat=require(_0x1926('0x0'));var rimraf=require(_0x1926('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1926('0x2'));var rp=require(_0x1926('0x3'));var moment=require(_0x1926('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x1926('0x5'));var util=require(_0x1926('0x6'));var path=require(_0x1926('0x7'));var sox=require(_0x1926('0x8'));var csv=require(_0x1926('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1926('0xa'));var _=require('lodash');var squel=require(_0x1926('0xb'));var crypto=require(_0x1926('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x1926('0xd'));var toCsv=require(_0x1926('0x9'));var querystring=require(_0x1926('0xe'));var Papa=require(_0x1926('0xf'));var Redis=require(_0x1926('0x10'));var authService=require(_0x1926('0x11'));var qs=require(_0x1926('0x12'));var as=require(_0x1926('0x13'));var hardwareService=require(_0x1926('0x14'));var logger=require(_0x1926('0x15'))(_0x1926('0x16'));var utils=require(_0x1926('0x17'));var config=require(_0x1926('0x18'));var licenseUtil=require(_0x1926('0x19'));var db=require(_0x1926('0x1a'))['db'];function respondWithStatusCode(_0x3d4817,_0x10a758){_0x10a758=_0x10a758||0xcc;return function(_0x41f84d){if(_0x41f84d){return _0x3d4817[_0x1926('0x1b')](_0x10a758);}return _0x3d4817[_0x1926('0x1c')](_0x10a758)[_0x1926('0x1d')]();};}function respondWithResult(_0x33779c,_0x2ed996){_0x2ed996=_0x2ed996||0xc8;return function(_0x4ff9ff){if(_0x4ff9ff){return _0x33779c[_0x1926('0x1c')](_0x2ed996)[_0x1926('0x1e')](_0x4ff9ff);}};}function respondWithFilteredResult(_0x53f820,_0xe13cde){return function(_0x348117){if(_0x348117){var _0x42a80b=typeof _0xe13cde['offset']===_0x1926('0x1f')&&typeof _0xe13cde[_0x1926('0x20')]==='undefined';var _0x21e214=_0x348117[_0x1926('0x21')];var _0xdfa757=_0x42a80b?0x0:_0xe13cde[_0x1926('0x22')];var _0x1b8d73=_0x42a80b?_0x348117[_0x1926('0x21')]:_0xe13cde[_0x1926('0x22')]+_0xe13cde[_0x1926('0x20')];var _0x1e4b49;if(_0x1b8d73>=_0x21e214){_0x1b8d73=_0x21e214;_0x1e4b49=0xc8;}else{_0x1e4b49=0xce;}_0x53f820[_0x1926('0x1c')](_0x1e4b49);return _0x53f820[_0x1926('0x23')](_0x1926('0x24'),_0xdfa757+'-'+_0x1b8d73+'/'+_0x21e214)[_0x1926('0x1e')](_0x348117);}return null;};}function patchUpdates(_0x4e4657){return function(_0x4866f5){try{jsonpatch[_0x1926('0x25')](_0x4866f5,_0x4e4657,!![]);}catch(_0x32fb7a){return BPromise[_0x1926('0x26')](_0x32fb7a);}return _0x4866f5[_0x1926('0x27')]();};}function saveUpdates(_0x2361e2,_0x31d906){return function(_0x32bd70){if(_0x32bd70){return _0x32bd70[_0x1926('0x28')](_0x2361e2)[_0x1926('0x29')](function(_0x3e0ab0){return _0x3e0ab0;});}return null;};}function removeEntity(_0x328aa9,_0x49d367){return function(_0x5d00c7){if(_0x5d00c7){return _0x5d00c7['destroy']()['then'](function(){_0x328aa9[_0x1926('0x1c')](0xcc)[_0x1926('0x1d')]();});}};}function handleEntityNotFound(_0x11e28e,_0x462c85){return function(_0x4fc645){if(!_0x4fc645){_0x11e28e['sendStatus'](0x194);}return _0x4fc645;};}function handleError(_0x561b3a,_0x3659fa){_0x3659fa=_0x3659fa||0x1f4;return function(_0x142f45){logger['error'](_0x142f45[_0x1926('0x2a')]);if(_0x142f45[_0x1926('0x2b')]){delete _0x142f45[_0x1926('0x2b')];}_0x561b3a[_0x1926('0x1c')](_0x3659fa)[_0x1926('0x2c')](_0x142f45);};}exports[_0x1926('0x2d')]=function(_0x267513,_0xd60129){var _0x1c8290={},_0x521645={},_0x22e16e={'count':0x0,'rows':[]};var _0x42e41e=_[_0x1926('0x2e')](db[_0x1926('0x2f')]['rawAttributes'],function(_0x391915){return{'name':_0x391915[_0x1926('0x30')],'type':_0x391915[_0x1926('0x31')][_0x1926('0x32')]};});_0x521645[_0x1926('0x33')]=_['map'](_0x42e41e,_0x1926('0x2b'));_0x521645['query']=_[_0x1926('0x34')](_0x267513[_0x1926('0x35')]);_0x521645[_0x1926('0x36')]=_[_0x1926('0x37')](_0x521645['model'],_0x521645[_0x1926('0x35')]);_0x1c8290[_0x1926('0x38')]=_[_0x1926('0x37')](_0x521645['model'],qs[_0x1926('0x39')](_0x267513[_0x1926('0x35')][_0x1926('0x39')]));_0x1c8290[_0x1926('0x38')]=_0x1c8290[_0x1926('0x38')]['length']?_0x1c8290['attributes']:_0x521645[_0x1926('0x33')];if(!_0x267513['query']['hasOwnProperty'](_0x1926('0x3a'))){_0x1c8290['limit']=qs[_0x1926('0x20')](_0x267513[_0x1926('0x35')][_0x1926('0x20')]);_0x1c8290['offset']=qs[_0x1926('0x22')](_0x267513[_0x1926('0x35')]['offset']);}_0x1c8290['order']=qs[_0x1926('0x3b')](_0x267513[_0x1926('0x35')][_0x1926('0x3b')]);_0x1c8290[_0x1926('0x3c')]=qs[_0x1926('0x36')](_['pick'](_0x267513[_0x1926('0x35')],_0x521645[_0x1926('0x36')]),_0x42e41e);if(_0x267513[_0x1926('0x35')]['filter']){_0x1c8290[_0x1926('0x3c')]=_[_0x1926('0x3d')](_0x1c8290[_0x1926('0x3c')],{'$or':_[_0x1926('0x2e')](_0x42e41e,function(_0x44f157){if(_0x44f157[_0x1926('0x31')]!==_0x1926('0x3e')){var _0x436ed7={};_0x436ed7[_0x44f157[_0x1926('0x2b')]]={'$like':'%'+_0x267513[_0x1926('0x35')][_0x1926('0x3f')]+'%'};return _0x436ed7;}})});}_0x1c8290=_[_0x1926('0x3d')]({},_0x1c8290,_0x267513[_0x1926('0x40')]);var _0x372204={'where':_0x1c8290[_0x1926('0x3c')]};return db[_0x1926('0x2f')][_0x1926('0x21')](_0x372204)['then'](function(_0x285a2f){_0x22e16e[_0x1926('0x21')]=_0x285a2f;if(_0x267513['query'][_0x1926('0x41')]){_0x1c8290[_0x1926('0x42')]=[{'all':!![]}];}return db['ChatQueueReport'][_0x1926('0x43')](_0x1c8290);})[_0x1926('0x29')](function(_0x362df6){_0x22e16e[_0x1926('0x44')]=_0x362df6;return _0x22e16e;})[_0x1926('0x29')](respondWithFilteredResult(_0xd60129,_0x1c8290))['catch'](handleError(_0xd60129,null));};exports[_0x1926('0x45')]=function(_0x313632,_0x54efec){var _0x164c26={'raw':!![],'where':{'id':_0x313632[_0x1926('0x46')]['id']}},_0x5cff82={};_0x5cff82['model']=_[_0x1926('0x34')](db[_0x1926('0x2f')][_0x1926('0x47')]);_0x5cff82[_0x1926('0x35')]=_[_0x1926('0x34')](_0x313632['query']);_0x5cff82[_0x1926('0x36')]=_[_0x1926('0x37')](_0x5cff82[_0x1926('0x33')],_0x5cff82[_0x1926('0x35')]);_0x164c26[_0x1926('0x38')]=_[_0x1926('0x37')](_0x5cff82[_0x1926('0x33')],qs[_0x1926('0x39')](_0x313632[_0x1926('0x35')]['fields']));_0x164c26['attributes']=_0x164c26[_0x1926('0x38')]['length']?_0x164c26[_0x1926('0x38')]:_0x5cff82['model'];if(_0x313632[_0x1926('0x35')][_0x1926('0x41')]){_0x164c26[_0x1926('0x42')]=[{'all':!![]}];}_0x164c26=_[_0x1926('0x3d')]({},_0x164c26,_0x313632['options']);return db[_0x1926('0x2f')][_0x1926('0x48')](_0x164c26)[_0x1926('0x29')](handleEntityNotFound(_0x54efec,null))[_0x1926('0x29')](respondWithResult(_0x54efec,null))[_0x1926('0x49')](handleError(_0x54efec,null));};exports[_0x1926('0x4a')]=function(_0x503e40,_0x12c3a1){return db['ChatQueueReport'][_0x1926('0x4a')](_0x503e40[_0x1926('0x4b')],{})[_0x1926('0x29')](respondWithResult(_0x12c3a1,0xc9))[_0x1926('0x49')](handleError(_0x12c3a1,null));};exports[_0x1926('0x28')]=function(_0x5dfd39,_0x9fb405){if(_0x5dfd39[_0x1926('0x4b')]['id']){delete _0x5dfd39[_0x1926('0x4b')]['id'];}return db[_0x1926('0x2f')][_0x1926('0x48')]({'where':{'id':_0x5dfd39['params']['id']}})[_0x1926('0x29')](handleEntityNotFound(_0x9fb405,null))[_0x1926('0x29')](saveUpdates(_0x5dfd39[_0x1926('0x4b')],null))['then'](respondWithResult(_0x9fb405,null))['catch'](handleError(_0x9fb405,null));};exports[_0x1926('0x4c')]=function(_0x44c541,_0x5ecc18){return db[_0x1926('0x2f')][_0x1926('0x48')]({'where':{'id':_0x44c541[_0x1926('0x46')]['id']}})['then'](handleEntityNotFound(_0x5ecc18,null))[_0x1926('0x29')](removeEntity(_0x5ecc18,null))[_0x1926('0x49')](handleError(_0x5ecc18,null));};exports[_0x1926('0x4d')]=function(_0x3cca11,_0x47f9da){return db[_0x1926('0x2f')][_0x1926('0x4d')]()[_0x1926('0x29')](respondWithResult(_0x47f9da,null))[_0x1926('0x49')](handleError(_0x47f9da,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index dccba8b..273eddc 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(_0x55b0bf,_0x483cc8){var _0x29da3a=function(_0x2e7332){while(--_0x2e7332){_0x55b0bf['push'](_0x55b0bf['shift']());}};_0x29da3a(++_0x483cc8);}(_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 _0x757a=['report_chat_queue','uniqueid','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define'];(function(_0x126460,_0xcf263d){var _0x370094=function(_0x3af08a){while(--_0x3af08a){_0x126460['push'](_0x126460['shift']());}};_0x370094(++_0xcf263d);}(_0x757a,0xde));var _0xa757=function(_0x140e51,_0x42c106){_0x140e51=_0x140e51-0x0;var _0x416e36=_0x757a[_0x140e51];return _0x416e36;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var logger=require(_0xa757('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa757('0x2'));var fs=require('fs');var path=require(_0xa757('0x3'));var rimraf=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var attributes=require(_0xa757('0x6'));module[_0xa757('0x7')]=function(_0x5edca8,_0xae0e7c){return _0x5edca8[_0xa757('0x8')]('ChatQueueReport',attributes,{'tableName':_0xa757('0x9'),'paranoid':![],'indexes':[{'name':_0xa757('0xa'),'fields':[_0xa757('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index fdc38fc..a5d7c24 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 _0x0d87=['UpdateChatQueueReport','update','attributes','limit','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','info','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','then'];(function(_0x3c0fc7,_0x462074){var _0x509859=function(_0x7af9eb){while(--_0x7af9eb){_0x3c0fc7['push'](_0x3c0fc7['shift']());}};_0x509859(++_0x462074);}(_0x0d87,0xca));var _0x70d8=function(_0x1c25de,_0xf7ef95){_0x1c25de=_0x1c25de-0x0;var _0x36553c=_0x0d87[_0x1c25de];return _0x36553c;};'use strict';var _=require('lodash');var util=require(_0x70d8('0x0'));var moment=require(_0x70d8('0x1'));var BPromise=require(_0x70d8('0x2'));var rs=require(_0x70d8('0x3'));var fs=require('fs');var Redis=require(_0x70d8('0x4'));var db=require(_0x70d8('0x5'))['db'];var utils=require(_0x70d8('0x6'));var logger=require(_0x70d8('0x7'))('rpc');var config=require(_0x70d8('0x8'));var jayson=require(_0x70d8('0x9'));var client=jayson[_0x70d8('0xa')][_0x70d8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2ffb61,_0x58ffea,_0x169ba8){return new BPromise(function(_0x4a93ea,_0x2e7d35){return client['request'](_0x2ffb61,_0x169ba8)['then'](function(_0x5b382d){logger[_0x70d8('0xc')]('ChatQueueReport,\x20%s,\x20%s',_0x58ffea,'request\x20sent');logger[_0x70d8('0xd')](_0x70d8('0xe'),_0x58ffea,_0x70d8('0xf'),JSON[_0x70d8('0x10')](_0x5b382d));if(_0x5b382d[_0x70d8('0x11')]){if(_0x5b382d['error'][_0x70d8('0x12')]===0x1f4){logger[_0x70d8('0x11')]('ChatQueueReport,\x20%s,\x20%s',_0x58ffea,_0x5b382d[_0x70d8('0x11')]['message']);return _0x2e7d35(_0x5b382d[_0x70d8('0x11')][_0x70d8('0x13')]);}logger[_0x70d8('0x11')]('ChatQueueReport,\x20%s,\x20%s',_0x58ffea,_0x5b382d[_0x70d8('0x11')][_0x70d8('0x13')]);return _0x4a93ea(_0x5b382d[_0x70d8('0x11')][_0x70d8('0x13')]);}else{logger[_0x70d8('0xc')]('ChatQueueReport,\x20%s,\x20%s',_0x58ffea,'request\x20sent');_0x4a93ea(_0x5b382d[_0x70d8('0x14')]['message']);}})[_0x70d8('0x15')](function(_0x45c726){logger[_0x70d8('0x11')]('ChatQueueReport,\x20%s,\x20%s',_0x58ffea,_0x45c726);_0x2e7d35(_0x45c726);});});}exports[_0x70d8('0x16')]=function(_0x1d6908){var _0x5541e5=this;return new Promise(function(_0x538e87,_0x1f86c5){return db[_0x70d8('0x17')][_0x70d8('0x18')](_0x1d6908[_0x70d8('0x19')],{'raw':_0x1d6908[_0x70d8('0x1a')]?_0x1d6908[_0x70d8('0x1a')][_0x70d8('0x1b')]===undefined?!![]:![]:!![]})[_0x70d8('0x1c')](function(_0x12d069){logger[_0x70d8('0xc')](_0x70d8('0x16'),_0x1d6908);logger[_0x70d8('0xd')](_0x70d8('0x16'),_0x1d6908,JSON[_0x70d8('0x10')](_0x12d069));_0x538e87(_0x12d069);})[_0x70d8('0x15')](function(_0x34967a){logger[_0x70d8('0x11')]('CreateChatQueueReport',_0x34967a[_0x70d8('0x13')],_0x1d6908);_0x1f86c5(_0x5541e5[_0x70d8('0x11')](0x1f4,_0x34967a[_0x70d8('0x13')]));});});};exports[_0x70d8('0x1d')]=function(_0x15eb27){var _0x4c5501=this;return new Promise(function(_0x565ce3,_0x549a84){return db['ChatQueueReport'][_0x70d8('0x1e')](_0x15eb27[_0x70d8('0x19')],{'raw':_0x15eb27[_0x70d8('0x1a')]?_0x15eb27['options'][_0x70d8('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x15eb27[_0x70d8('0x1a')]?_0x15eb27[_0x70d8('0x1a')]['where']||null:null,'attributes':_0x15eb27['options']?_0x15eb27[_0x70d8('0x1a')][_0x70d8('0x1f')]||null:null,'limit':_0x15eb27[_0x70d8('0x1a')]?_0x15eb27[_0x70d8('0x1a')][_0x70d8('0x20')]||null:null})[_0x70d8('0x1c')](function(_0xa826a8){logger[_0x70d8('0xc')](_0x70d8('0x1d'),_0x15eb27);logger[_0x70d8('0xd')](_0x70d8('0x1d'),_0x15eb27,JSON['stringify'](_0xa826a8));_0x565ce3(_0xa826a8);})[_0x70d8('0x15')](function(_0x4836a9){logger[_0x70d8('0x11')]('UpdateChatQueueReport',_0x4836a9[_0x70d8('0x13')],_0x15eb27);_0x549a84(_0x4c5501[_0x70d8('0x11')](0x1f4,_0x4836a9[_0x70d8('0x13')]));});});}; \ No newline at end of file +var _0xeb43=['ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatQueueReport,\x20%s,\x20%s','message','result','catch','ChatQueueReport','create','body','options','raw','CreateChatQueueReport','debug','UpdateChatQueueReport','where','attributes','limit','lodash','util','moment','randomstring','../../config/utils','../../config/logger','jayson/promise','client','request','then','info','request\x20sent'];(function(_0x5f09c5,_0x2bfca0){var _0x426ad9=function(_0x18fe5f){while(--_0x18fe5f){_0x5f09c5['push'](_0x5f09c5['shift']());}};_0x426ad9(++_0x2bfca0);}(_0xeb43,0x149));var _0x3eb4=function(_0x119629,_0x246787){_0x119629=_0x119629-0x0;var _0x49a771=_0xeb43[_0x119629];return _0x49a771;};'use strict';var _=require(_0x3eb4('0x0'));var util=require(_0x3eb4('0x1'));var moment=require(_0x3eb4('0x2'));var BPromise=require('bluebird');var rs=require(_0x3eb4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x3eb4('0x4'));var logger=require(_0x3eb4('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x3eb4('0x6'));var client=jayson[_0x3eb4('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x45b9b8,_0x5d8f80,_0x14f2c3){return new BPromise(function(_0x557a28,_0x43570f){return client[_0x3eb4('0x8')](_0x45b9b8,_0x14f2c3)[_0x3eb4('0x9')](function(_0x10f337){logger[_0x3eb4('0xa')]('ChatQueueReport,\x20%s,\x20%s',_0x5d8f80,_0x3eb4('0xb'));logger['debug'](_0x3eb4('0xc'),_0x5d8f80,_0x3eb4('0xb'),JSON[_0x3eb4('0xd')](_0x10f337));if(_0x10f337[_0x3eb4('0xe')]){if(_0x10f337['error'][_0x3eb4('0xf')]===0x1f4){logger[_0x3eb4('0xe')](_0x3eb4('0x10'),_0x5d8f80,_0x10f337[_0x3eb4('0xe')][_0x3eb4('0x11')]);return _0x43570f(_0x10f337[_0x3eb4('0xe')]['message']);}logger[_0x3eb4('0xe')]('ChatQueueReport,\x20%s,\x20%s',_0x5d8f80,_0x10f337['error'][_0x3eb4('0x11')]);return _0x557a28(_0x10f337['error'][_0x3eb4('0x11')]);}else{logger[_0x3eb4('0xa')](_0x3eb4('0x10'),_0x5d8f80,_0x3eb4('0xb'));_0x557a28(_0x10f337[_0x3eb4('0x12')][_0x3eb4('0x11')]);}})[_0x3eb4('0x13')](function(_0x3fdd27){logger[_0x3eb4('0xe')](_0x3eb4('0x10'),_0x5d8f80,_0x3fdd27);_0x43570f(_0x3fdd27);});});}exports['CreateChatQueueReport']=function(_0x3fb1c0){var _0x427e80=this;return new Promise(function(_0x1fcc85,_0x414fd1){return db[_0x3eb4('0x14')][_0x3eb4('0x15')](_0x3fb1c0[_0x3eb4('0x16')],{'raw':_0x3fb1c0[_0x3eb4('0x17')]?_0x3fb1c0[_0x3eb4('0x17')][_0x3eb4('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x55fe47){logger[_0x3eb4('0xa')](_0x3eb4('0x19'),_0x3fb1c0);logger[_0x3eb4('0x1a')](_0x3eb4('0x19'),_0x3fb1c0,JSON[_0x3eb4('0xd')](_0x55fe47));_0x1fcc85(_0x55fe47);})['catch'](function(_0x35c4ec){logger['error'](_0x3eb4('0x19'),_0x35c4ec['message'],_0x3fb1c0);_0x414fd1(_0x427e80[_0x3eb4('0xe')](0x1f4,_0x35c4ec[_0x3eb4('0x11')]));});});};exports[_0x3eb4('0x1b')]=function(_0x1c2f04){var _0x93a567=this;return new Promise(function(_0x54f5e7,_0x1b4c97){return db[_0x3eb4('0x14')]['update'](_0x1c2f04[_0x3eb4('0x16')],{'raw':_0x1c2f04[_0x3eb4('0x17')]?_0x1c2f04[_0x3eb4('0x17')][_0x3eb4('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1c2f04['options']?_0x1c2f04[_0x3eb4('0x17')][_0x3eb4('0x1c')]||null:null,'attributes':_0x1c2f04[_0x3eb4('0x17')]?_0x1c2f04['options'][_0x3eb4('0x1d')]||null:null,'limit':_0x1c2f04[_0x3eb4('0x17')]?_0x1c2f04[_0x3eb4('0x17')][_0x3eb4('0x1e')]||null:null})['then'](function(_0x558d6d){logger[_0x3eb4('0xa')]('UpdateChatQueueReport',_0x1c2f04);logger[_0x3eb4('0x1a')]('UpdateChatQueueReport',_0x1c2f04,JSON['stringify'](_0x558d6d));_0x54f5e7(_0x558d6d);})[_0x3eb4('0x13')](function(_0x5975e4){logger[_0x3eb4('0xe')](_0x3eb4('0x1b'),_0x5975e4[_0x3eb4('0x11')],_0x1c2f04);_0x1b4c97(_0x93a567[_0x3eb4('0xe')](0x1f4,_0x5975e4[_0x3eb4('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index e14540d..b2be753 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 _0x94e6=['Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','describe','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x21adfa,_0x42692b){var _0x15c9b7=function(_0x722296){while(--_0x722296){_0x21adfa['push'](_0x21adfa['shift']());}};_0x15c9b7(++_0x42692b);}(_0x94e6,0x127));var _0x694e=function(_0x33f994,_0x23fda2){_0x33f994=_0x33f994-0x0;var _0xfaf084=_0x94e6[_0x33f994];return _0xfaf084;};'use strict';var multer=require(_0x694e('0x0'));var util=require(_0x694e('0x1'));var path=require(_0x694e('0x2'));var timeout=require(_0x694e('0x3'));var express=require(_0x694e('0x4'));var router=express[_0x694e('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x694e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x694e('0x7'));var controller=require('./chatQueueReport.controller');router[_0x694e('0x8')]('/',auth[_0x694e('0x9')](),controller[_0x694e('0xa')]);router['get']('/describe',auth[_0x694e('0x9')](),controller[_0x694e('0xb')]);router[_0x694e('0x8')]('/:id',auth[_0x694e('0x9')](),controller[_0x694e('0xc')]);router[_0x694e('0xd')]('/',auth[_0x694e('0x9')](),controller[_0x694e('0xe')]);router[_0x694e('0xf')]('/:id',auth[_0x694e('0x9')](),controller[_0x694e('0x10')]);router[_0x694e('0x11')]('/:id',auth[_0x694e('0x9')](),controller[_0x694e('0x12')]);module[_0x694e('0x13')]=router; \ No newline at end of file +var _0x21fd=['describe','/:id','show','post','update','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','/describe'];(function(_0xacca8b,_0x51ea6a){var _0x3ded45=function(_0x2c348d){while(--_0x2c348d){_0xacca8b['push'](_0xacca8b['shift']());}};_0x3ded45(++_0x51ea6a);}(_0x21fd,0xa7));var _0xd21f=function(_0x545d79,_0x363c72){_0x545d79=_0x545d79-0x0;var _0x94ebc5=_0x21fd[_0x545d79];return _0x94ebc5;};'use strict';var multer=require(_0xd21f('0x0'));var util=require(_0xd21f('0x1'));var path=require(_0xd21f('0x2'));var timeout=require('connect-timeout');var express=require(_0xd21f('0x3'));var router=express[_0xd21f('0x4')]();var fs_extra=require(_0xd21f('0x5'));var auth=require(_0xd21f('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd21f('0x7'));var controller=require(_0xd21f('0x8'));router[_0xd21f('0x9')]('/',auth[_0xd21f('0xa')](),controller[_0xd21f('0xb')]);router[_0xd21f('0x9')](_0xd21f('0xc'),auth['isAuthenticated'](),controller[_0xd21f('0xd')]);router['get'](_0xd21f('0xe'),auth[_0xd21f('0xa')](),controller[_0xd21f('0xf')]);router[_0xd21f('0x10')]('/',auth[_0xd21f('0xa')](),controller['create']);router['put'](_0xd21f('0xe'),auth['isAuthenticated'](),controller[_0xd21f('0x11')]);router['delete'](_0xd21f('0xe'),auth[_0xd21f('0xa')](),controller[_0xd21f('0x12')]);module[_0xd21f('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 98ce7c0..6174519 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 _0xf4eb=['NOW','moment','account','queue','DATE'];(function(_0x641b62,_0x49432c){var _0x346d0c=function(_0x45413f){while(--_0x45413f){_0x641b62['push'](_0x641b62['shift']());}};_0x346d0c(++_0x49432c);}(_0xf4eb,0xec));var _0xbf4e=function(_0x1a49ca,_0x406f70){_0x1a49ca=_0x1a49ca-0x0;var _0x232d53=_0xf4eb[_0x1a49ca];return _0x232d53;};'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 _0x9c44=['ENUM','account','agent','queue','NOW','exports','STRING'];(function(_0x487496,_0x249683){var _0x539dc8=function(_0x2c38e1){while(--_0x2c38e1){_0x487496['push'](_0x487496['shift']());}};_0x539dc8(++_0x249683);}(_0x9c44,0x178));var _0x49c4=function(_0x2e4aa2,_0x11956a){_0x2e4aa2=_0x2e4aa2-0x0;var _0x5e6092=_0x9c44[_0x2e4aa2];return _0x5e6092;};'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 46ae1bc..f1dbdcf 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 _0x157e=['query','keys','filters','intersection','attributes','model','fields','hasOwnProperty','nolimit','offset','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','map','ChatTransferReport','rawAttributes','type','key'];(function(_0x1c9e28,_0x436dcf){var _0x201d1f=function(_0x5cf9f7){while(--_0x5cf9f7){_0x1c9e28['push'](_0x1c9e28['shift']());}};_0x201d1f(++_0x436dcf);}(_0x157e,0x66));var _0xe157=function(_0x56e80c,_0xd0f2eb){_0x56e80c=_0x56e80c-0x0;var _0x2ece80=_0x157e[_0x56e80c];return _0x2ece80;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe157('0x0'));var zipdir=require(_0xe157('0x1'));var jsonpatch=require(_0xe157('0x2'));var rp=require(_0xe157('0x3'));var moment=require(_0xe157('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xe157('0x5'));var path=require(_0xe157('0x6'));var sox=require('sox');var csv=require(_0xe157('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe157('0x8'));var _=require(_0xe157('0x9'));var squel=require(_0xe157('0xa'));var crypto=require(_0xe157('0xb'));var jsforce=require(_0xe157('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xe157('0x7'));var querystring=require(_0xe157('0xd'));var Papa=require(_0xe157('0xe'));var Redis=require(_0xe157('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xe157('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe157('0x11'));var logger=require(_0xe157('0x12'))(_0xe157('0x13'));var utils=require(_0xe157('0x14'));var config=require(_0xe157('0x15'));var licenseUtil=require(_0xe157('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x508fad,_0x108984){_0x108984=_0x108984||0xcc;return function(_0x4a1cad){if(_0x4a1cad){return _0x508fad[_0xe157('0x17')](_0x108984);}return _0x508fad[_0xe157('0x18')](_0x108984)[_0xe157('0x19')]();};}function respondWithResult(_0x1fcef1,_0xe8a55c){_0xe8a55c=_0xe8a55c||0xc8;return function(_0x1e1562){if(_0x1e1562){return _0x1fcef1['status'](_0xe8a55c)[_0xe157('0x1a')](_0x1e1562);}};}function respondWithFilteredResult(_0x56a043,_0x237346){return function(_0x536161){if(_0x536161){var _0x457ac2=typeof _0x237346['offset']===_0xe157('0x1b')&&typeof _0x237346[_0xe157('0x1c')]===_0xe157('0x1b');var _0x5ee816=_0x536161[_0xe157('0x1d')];var _0x596325=_0x457ac2?0x0:_0x237346['offset'];var _0x3d3b6d=_0x457ac2?_0x536161[_0xe157('0x1d')]:_0x237346['offset']+_0x237346['limit'];var _0x11e973;if(_0x3d3b6d>=_0x5ee816){_0x3d3b6d=_0x5ee816;_0x11e973=0xc8;}else{_0x11e973=0xce;}_0x56a043['status'](_0x11e973);return _0x56a043['set'](_0xe157('0x1e'),_0x596325+'-'+_0x3d3b6d+'/'+_0x5ee816)['json'](_0x536161);}return null;};}function patchUpdates(_0x495716){return function(_0x4392cb){try{jsonpatch[_0xe157('0x1f')](_0x4392cb,_0x495716,!![]);}catch(_0x329a91){return BPromise[_0xe157('0x20')](_0x329a91);}return _0x4392cb['save']();};}function saveUpdates(_0x53be75,_0x318774){return function(_0x293bfc){if(_0x293bfc){return _0x293bfc[_0xe157('0x21')](_0x53be75)[_0xe157('0x22')](function(_0x42429b){return _0x42429b;});}return null;};}function removeEntity(_0xae21c7,_0x4e5b50){return function(_0x5a1060){if(_0x5a1060){return _0x5a1060[_0xe157('0x23')]()[_0xe157('0x22')](function(){_0xae21c7[_0xe157('0x18')](0xcc)[_0xe157('0x19')]();});}};}function handleEntityNotFound(_0xf9b7e4,_0x33e4db){return function(_0x5c1a0e){if(!_0x5c1a0e){_0xf9b7e4[_0xe157('0x17')](0x194);}return _0x5c1a0e;};}function handleError(_0x5be602,_0x40f0bc){_0x40f0bc=_0x40f0bc||0x1f4;return function(_0x3431a9){logger[_0xe157('0x24')](_0x3431a9[_0xe157('0x25')]);if(_0x3431a9['name']){delete _0x3431a9[_0xe157('0x26')];}_0x5be602[_0xe157('0x18')](_0x40f0bc)[_0xe157('0x27')](_0x3431a9);};}exports[_0xe157('0x28')]=function(_0x584f28,_0x1f92ed){var _0x22266a={},_0x1a7935={},_0x16a070={'count':0x0,'rows':[]};var _0x5df6e2=_[_0xe157('0x29')](db[_0xe157('0x2a')][_0xe157('0x2b')],function(_0x3f830a){return{'name':_0x3f830a['fieldName'],'type':_0x3f830a[_0xe157('0x2c')][_0xe157('0x2d')]};});_0x1a7935['model']=_['map'](_0x5df6e2,_0xe157('0x26'));_0x1a7935[_0xe157('0x2e')]=_[_0xe157('0x2f')](_0x584f28[_0xe157('0x2e')]);_0x1a7935[_0xe157('0x30')]=_[_0xe157('0x31')](_0x1a7935['model'],_0x1a7935['query']);_0x22266a[_0xe157('0x32')]=_[_0xe157('0x31')](_0x1a7935[_0xe157('0x33')],qs[_0xe157('0x34')](_0x584f28[_0xe157('0x2e')][_0xe157('0x34')]));_0x22266a['attributes']=_0x22266a['attributes']['length']?_0x22266a[_0xe157('0x32')]:_0x1a7935[_0xe157('0x33')];if(!_0x584f28[_0xe157('0x2e')][_0xe157('0x35')](_0xe157('0x36'))){_0x22266a[_0xe157('0x1c')]=qs[_0xe157('0x1c')](_0x584f28['query'][_0xe157('0x1c')]);_0x22266a[_0xe157('0x37')]=qs[_0xe157('0x37')](_0x584f28['query'][_0xe157('0x37')]);}_0x22266a[_0xe157('0x38')]=qs[_0xe157('0x39')](_0x584f28[_0xe157('0x2e')][_0xe157('0x39')]);_0x22266a[_0xe157('0x3a')]=qs[_0xe157('0x30')](_['pick'](_0x584f28[_0xe157('0x2e')],_0x1a7935[_0xe157('0x30')]),_0x5df6e2);if(_0x584f28['query'][_0xe157('0x3b')]){_0x22266a[_0xe157('0x3a')]=_[_0xe157('0x3c')](_0x22266a[_0xe157('0x3a')],{'$or':_[_0xe157('0x29')](_0x5df6e2,function(_0x4f9035){if(_0x4f9035[_0xe157('0x2c')]!==_0xe157('0x3d')){var _0x229e3d={};_0x229e3d[_0x4f9035[_0xe157('0x26')]]={'$like':'%'+_0x584f28[_0xe157('0x2e')][_0xe157('0x3b')]+'%'};return _0x229e3d;}})});}_0x22266a=_[_0xe157('0x3c')]({},_0x22266a,_0x584f28[_0xe157('0x3e')]);var _0x12e9c1={'where':_0x22266a[_0xe157('0x3a')]};return db[_0xe157('0x2a')][_0xe157('0x1d')](_0x12e9c1)[_0xe157('0x22')](function(_0x59c6d5){_0x16a070[_0xe157('0x1d')]=_0x59c6d5;if(_0x584f28[_0xe157('0x2e')][_0xe157('0x3f')]){_0x22266a[_0xe157('0x40')]=[{'all':!![]}];}return db[_0xe157('0x2a')][_0xe157('0x41')](_0x22266a);})[_0xe157('0x22')](function(_0x25eabe){_0x16a070[_0xe157('0x42')]=_0x25eabe;return _0x16a070;})[_0xe157('0x22')](respondWithFilteredResult(_0x1f92ed,_0x22266a))[_0xe157('0x43')](handleError(_0x1f92ed,null));};exports[_0xe157('0x44')]=function(_0x3a2fe4,_0x5d1eac){var _0x313e51={'raw':!![],'where':{'id':_0x3a2fe4['params']['id']}},_0x4bedf6={};_0x4bedf6[_0xe157('0x33')]=_[_0xe157('0x2f')](db[_0xe157('0x2a')][_0xe157('0x2b')]);_0x4bedf6[_0xe157('0x2e')]=_[_0xe157('0x2f')](_0x3a2fe4['query']);_0x4bedf6[_0xe157('0x30')]=_['intersection'](_0x4bedf6[_0xe157('0x33')],_0x4bedf6[_0xe157('0x2e')]);_0x313e51['attributes']=_[_0xe157('0x31')](_0x4bedf6[_0xe157('0x33')],qs[_0xe157('0x34')](_0x3a2fe4[_0xe157('0x2e')][_0xe157('0x34')]));_0x313e51[_0xe157('0x32')]=_0x313e51[_0xe157('0x32')]['length']?_0x313e51[_0xe157('0x32')]:_0x4bedf6[_0xe157('0x33')];if(_0x3a2fe4['query'][_0xe157('0x3f')]){_0x313e51[_0xe157('0x40')]=[{'all':!![]}];}_0x313e51=_[_0xe157('0x3c')]({},_0x313e51,_0x3a2fe4['options']);return db[_0xe157('0x2a')][_0xe157('0x45')](_0x313e51)['then'](handleEntityNotFound(_0x5d1eac,null))[_0xe157('0x22')](respondWithResult(_0x5d1eac,null))[_0xe157('0x43')](handleError(_0x5d1eac,null));};exports[_0xe157('0x46')]=function(_0x566a24,_0x1f962c){return db[_0xe157('0x2a')]['create'](_0x566a24[_0xe157('0x47')],{})['then'](respondWithResult(_0x1f962c,0xc9))[_0xe157('0x43')](handleError(_0x1f962c,null));};exports[_0xe157('0x21')]=function(_0x44d195,_0x10ae28){if(_0x44d195[_0xe157('0x47')]['id']){delete _0x44d195[_0xe157('0x47')]['id'];}return db[_0xe157('0x2a')][_0xe157('0x45')]({'where':{'id':_0x44d195[_0xe157('0x48')]['id']}})[_0xe157('0x22')](handleEntityNotFound(_0x10ae28,null))[_0xe157('0x22')](saveUpdates(_0x44d195[_0xe157('0x47')],null))[_0xe157('0x22')](respondWithResult(_0x10ae28,null))[_0xe157('0x43')](handleError(_0x10ae28,null));};exports[_0xe157('0x23')]=function(_0x44840e,_0x29d44c){return db[_0xe157('0x2a')][_0xe157('0x45')]({'where':{'id':_0x44840e[_0xe157('0x48')]['id']}})[_0xe157('0x22')](handleEntityNotFound(_0x29d44c,null))['then'](removeEntity(_0x29d44c,null))[_0xe157('0x43')](handleError(_0x29d44c,null));};exports[_0xe157('0x49')]=function(_0x4a762e,_0x27fed7){return db[_0xe157('0x2a')][_0xe157('0x49')]()['then'](respondWithResult(_0x27fed7,null))[_0xe157('0x43')](handleError(_0x27fed7,null));}; \ No newline at end of file +var _0xbcc9=['limit','count','set','Content-Range','reject','save','update','then','end','error','stack','name','map','ChatTransferReport','rawAttributes','fieldName','model','query','intersection','fields','attributes','order','sort','where','filters','pick','type','VIRTUAL','options','include','findAll','rows','show','keys','includeAll','find','catch','body','destroy','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined'];(function(_0x4d0505,_0xc9c1b){var _0x25e543=function(_0x12b76b){while(--_0x12b76b){_0x4d0505['push'](_0x4d0505['shift']());}};_0x25e543(++_0xc9c1b);}(_0xbcc9,0x149));var _0x9bcc=function(_0x458972,_0x2b24e7){_0x458972=_0x458972-0x0;var _0x1a6d55=_0xbcc9[_0x458972];return _0x1a6d55;};'use strict';var emlformat=require(_0x9bcc('0x0'));var rimraf=require(_0x9bcc('0x1'));var zipdir=require(_0x9bcc('0x2'));var jsonpatch=require(_0x9bcc('0x3'));var rp=require('request-promise');var moment=require(_0x9bcc('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x9bcc('0x5'));var path=require(_0x9bcc('0x6'));var sox=require('sox');var csv=require(_0x9bcc('0x7'));var ejs=require(_0x9bcc('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9bcc('0x9'));var squel=require(_0x9bcc('0xa'));var crypto=require(_0x9bcc('0xb'));var jsforce=require(_0x9bcc('0xc'));var deskjs=require(_0x9bcc('0xd'));var toCsv=require('to-csv');var querystring=require(_0x9bcc('0xe'));var Papa=require(_0x9bcc('0xf'));var Redis=require(_0x9bcc('0x10'));var authService=require(_0x9bcc('0x11'));var qs=require(_0x9bcc('0x12'));var as=require(_0x9bcc('0x13'));var hardwareService=require(_0x9bcc('0x14'));var logger=require(_0x9bcc('0x15'))(_0x9bcc('0x16'));var utils=require('../../config/utils');var config=require(_0x9bcc('0x17'));var licenseUtil=require(_0x9bcc('0x18'));var db=require(_0x9bcc('0x19'))['db'];function respondWithStatusCode(_0xc2e345,_0xb384dd){_0xb384dd=_0xb384dd||0xcc;return function(_0x549f0b){if(_0x549f0b){return _0xc2e345[_0x9bcc('0x1a')](_0xb384dd);}return _0xc2e345[_0x9bcc('0x1b')](_0xb384dd)['end']();};}function respondWithResult(_0x2f04e5,_0x4be1e4){_0x4be1e4=_0x4be1e4||0xc8;return function(_0x27e1c5){if(_0x27e1c5){return _0x2f04e5[_0x9bcc('0x1b')](_0x4be1e4)[_0x9bcc('0x1c')](_0x27e1c5);}};}function respondWithFilteredResult(_0x4f5101,_0x572541){return function(_0x4f93dc){if(_0x4f93dc){var _0x5b18ca=typeof _0x572541[_0x9bcc('0x1d')]===_0x9bcc('0x1e')&&typeof _0x572541[_0x9bcc('0x1f')]==='undefined';var _0x4a58ad=_0x4f93dc[_0x9bcc('0x20')];var _0x43591b=_0x5b18ca?0x0:_0x572541[_0x9bcc('0x1d')];var _0xc75f6=_0x5b18ca?_0x4f93dc[_0x9bcc('0x20')]:_0x572541['offset']+_0x572541['limit'];var _0x3bedde;if(_0xc75f6>=_0x4a58ad){_0xc75f6=_0x4a58ad;_0x3bedde=0xc8;}else{_0x3bedde=0xce;}_0x4f5101['status'](_0x3bedde);return _0x4f5101[_0x9bcc('0x21')](_0x9bcc('0x22'),_0x43591b+'-'+_0xc75f6+'/'+_0x4a58ad)['json'](_0x4f93dc);}return null;};}function patchUpdates(_0x337704){return function(_0x5cdae1){try{jsonpatch['apply'](_0x5cdae1,_0x337704,!![]);}catch(_0x6fa342){return BPromise[_0x9bcc('0x23')](_0x6fa342);}return _0x5cdae1[_0x9bcc('0x24')]();};}function saveUpdates(_0x521358,_0x45379d){return function(_0x4be5be){if(_0x4be5be){return _0x4be5be[_0x9bcc('0x25')](_0x521358)['then'](function(_0x3ba2ef){return _0x3ba2ef;});}return null;};}function removeEntity(_0x1f79b9,_0x26f53f){return function(_0x2f4388){if(_0x2f4388){return _0x2f4388['destroy']()[_0x9bcc('0x26')](function(){_0x1f79b9[_0x9bcc('0x1b')](0xcc)[_0x9bcc('0x27')]();});}};}function handleEntityNotFound(_0xcdcc94,_0x5ea989){return function(_0x3c6acb){if(!_0x3c6acb){_0xcdcc94['sendStatus'](0x194);}return _0x3c6acb;};}function handleError(_0x53ff0f,_0x468548){_0x468548=_0x468548||0x1f4;return function(_0x1f3891){logger[_0x9bcc('0x28')](_0x1f3891[_0x9bcc('0x29')]);if(_0x1f3891[_0x9bcc('0x2a')]){delete _0x1f3891[_0x9bcc('0x2a')];}_0x53ff0f[_0x9bcc('0x1b')](_0x468548)['send'](_0x1f3891);};}exports['index']=function(_0xf83dd4,_0x179829){var _0x256793={},_0x3696e5={},_0x3ca71c={'count':0x0,'rows':[]};var _0x219e30=_[_0x9bcc('0x2b')](db[_0x9bcc('0x2c')][_0x9bcc('0x2d')],function(_0x4f1787){return{'name':_0x4f1787[_0x9bcc('0x2e')],'type':_0x4f1787['type']['key']};});_0x3696e5[_0x9bcc('0x2f')]=_[_0x9bcc('0x2b')](_0x219e30,'name');_0x3696e5[_0x9bcc('0x30')]=_['keys'](_0xf83dd4[_0x9bcc('0x30')]);_0x3696e5['filters']=_[_0x9bcc('0x31')](_0x3696e5[_0x9bcc('0x2f')],_0x3696e5['query']);_0x256793['attributes']=_['intersection'](_0x3696e5[_0x9bcc('0x2f')],qs['fields'](_0xf83dd4['query'][_0x9bcc('0x32')]));_0x256793[_0x9bcc('0x33')]=_0x256793[_0x9bcc('0x33')]['length']?_0x256793[_0x9bcc('0x33')]:_0x3696e5['model'];if(!_0xf83dd4[_0x9bcc('0x30')]['hasOwnProperty']('nolimit')){_0x256793[_0x9bcc('0x1f')]=qs['limit'](_0xf83dd4[_0x9bcc('0x30')][_0x9bcc('0x1f')]);_0x256793[_0x9bcc('0x1d')]=qs[_0x9bcc('0x1d')](_0xf83dd4[_0x9bcc('0x30')][_0x9bcc('0x1d')]);}_0x256793[_0x9bcc('0x34')]=qs[_0x9bcc('0x35')](_0xf83dd4['query'][_0x9bcc('0x35')]);_0x256793[_0x9bcc('0x36')]=qs[_0x9bcc('0x37')](_[_0x9bcc('0x38')](_0xf83dd4['query'],_0x3696e5[_0x9bcc('0x37')]),_0x219e30);if(_0xf83dd4['query']['filter']){_0x256793[_0x9bcc('0x36')]=_['merge'](_0x256793[_0x9bcc('0x36')],{'$or':_[_0x9bcc('0x2b')](_0x219e30,function(_0x411584){if(_0x411584[_0x9bcc('0x39')]!==_0x9bcc('0x3a')){var _0x156c34={};_0x156c34[_0x411584[_0x9bcc('0x2a')]]={'$like':'%'+_0xf83dd4[_0x9bcc('0x30')]['filter']+'%'};return _0x156c34;}})});}_0x256793=_['merge']({},_0x256793,_0xf83dd4[_0x9bcc('0x3b')]);var _0x2f34ca={'where':_0x256793['where']};return db['ChatTransferReport'][_0x9bcc('0x20')](_0x2f34ca)['then'](function(_0x1c3084){_0x3ca71c[_0x9bcc('0x20')]=_0x1c3084;if(_0xf83dd4['query']['includeAll']){_0x256793[_0x9bcc('0x3c')]=[{'all':!![]}];}return db['ChatTransferReport'][_0x9bcc('0x3d')](_0x256793);})[_0x9bcc('0x26')](function(_0x482aa1){_0x3ca71c[_0x9bcc('0x3e')]=_0x482aa1;return _0x3ca71c;})[_0x9bcc('0x26')](respondWithFilteredResult(_0x179829,_0x256793))['catch'](handleError(_0x179829,null));};exports[_0x9bcc('0x3f')]=function(_0x1a987d,_0x1b17ea){var _0xbddce3={'raw':!![],'where':{'id':_0x1a987d['params']['id']}},_0x44d6da={};_0x44d6da[_0x9bcc('0x2f')]=_[_0x9bcc('0x40')](db[_0x9bcc('0x2c')][_0x9bcc('0x2d')]);_0x44d6da['query']=_[_0x9bcc('0x40')](_0x1a987d[_0x9bcc('0x30')]);_0x44d6da[_0x9bcc('0x37')]=_[_0x9bcc('0x31')](_0x44d6da[_0x9bcc('0x2f')],_0x44d6da[_0x9bcc('0x30')]);_0xbddce3[_0x9bcc('0x33')]=_['intersection'](_0x44d6da[_0x9bcc('0x2f')],qs['fields'](_0x1a987d['query'][_0x9bcc('0x32')]));_0xbddce3[_0x9bcc('0x33')]=_0xbddce3[_0x9bcc('0x33')]['length']?_0xbddce3[_0x9bcc('0x33')]:_0x44d6da[_0x9bcc('0x2f')];if(_0x1a987d[_0x9bcc('0x30')][_0x9bcc('0x41')]){_0xbddce3[_0x9bcc('0x3c')]=[{'all':!![]}];}_0xbddce3=_['merge']({},_0xbddce3,_0x1a987d[_0x9bcc('0x3b')]);return db['ChatTransferReport'][_0x9bcc('0x42')](_0xbddce3)[_0x9bcc('0x26')](handleEntityNotFound(_0x1b17ea,null))[_0x9bcc('0x26')](respondWithResult(_0x1b17ea,null))[_0x9bcc('0x43')](handleError(_0x1b17ea,null));};exports['create']=function(_0x3c63c8,_0x119ef1){return db[_0x9bcc('0x2c')]['create'](_0x3c63c8[_0x9bcc('0x44')],{})[_0x9bcc('0x26')](respondWithResult(_0x119ef1,0xc9))['catch'](handleError(_0x119ef1,null));};exports['update']=function(_0x526fba,_0x42d901){if(_0x526fba[_0x9bcc('0x44')]['id']){delete _0x526fba[_0x9bcc('0x44')]['id'];}return db['ChatTransferReport'][_0x9bcc('0x42')]({'where':{'id':_0x526fba['params']['id']}})[_0x9bcc('0x26')](handleEntityNotFound(_0x42d901,null))['then'](saveUpdates(_0x526fba['body'],null))['then'](respondWithResult(_0x42d901,null))[_0x9bcc('0x43')](handleError(_0x42d901,null));};exports[_0x9bcc('0x45')]=function(_0x424600,_0x965cce){return db[_0x9bcc('0x2c')][_0x9bcc('0x42')]({'where':{'id':_0x424600[_0x9bcc('0x46')]['id']}})[_0x9bcc('0x26')](handleEntityNotFound(_0x965cce,null))[_0x9bcc('0x26')](removeEntity(_0x965cce,null))[_0x9bcc('0x43')](handleError(_0x965cce,null));};exports[_0x9bcc('0x47')]=function(_0x56e269,_0x485822){return db[_0x9bcc('0x2c')][_0x9bcc('0x47')]()[_0x9bcc('0x26')](respondWithResult(_0x485822,null))[_0x9bcc('0x43')](handleError(_0x485822,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index 6cb720f..1d1e45a 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 _0x3ede=['uniqueid','lodash','util','moment','request-promise','path','../../config/environment','exports','define','ChatTransferReport','report_chat_transfer'];(function(_0x147b6b,_0x23c714){var _0x8da7ac=function(_0x282beb){while(--_0x282beb){_0x147b6b['push'](_0x147b6b['shift']());}};_0x8da7ac(++_0x23c714);}(_0x3ede,0x85));var _0xe3ed=function(_0x1ef547,_0x31bfdb){_0x1ef547=_0x1ef547-0x0;var _0x1d697b=_0x3ede[_0x1ef547];return _0x1d697b;};'use strict';var _=require(_0xe3ed('0x0'));var util=require(_0xe3ed('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xe3ed('0x2'));var BPromise=require('bluebird');var rp=require(_0xe3ed('0x3'));var fs=require('fs');var path=require(_0xe3ed('0x4'));var rimraf=require('rimraf');var config=require(_0xe3ed('0x5'));var attributes=require('./chatTransferReport.attributes');module[_0xe3ed('0x6')]=function(_0x1a48da,_0x505ede){return _0x1a48da[_0xe3ed('0x7')](_0xe3ed('0x8'),attributes,{'tableName':_0xe3ed('0x9'),'paranoid':![],'indexes':[{'name':_0xe3ed('0xa'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xe23a=['define','ChatTransferReport','report_chat_transfer','uniqueid','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','./chatTransferReport.attributes','exports'];(function(_0x557209,_0x354087){var _0x3cba21=function(_0x389d50){while(--_0x389d50){_0x557209['push'](_0x557209['shift']());}};_0x3cba21(++_0x354087);}(_0xe23a,0xd4));var _0xae23=function(_0x3dc68d,_0x1c1951){_0x3dc68d=_0x3dc68d-0x0;var _0xdf7f94=_0xe23a[_0x3dc68d];return _0xdf7f94;};'use strict';var _=require(_0xae23('0x0'));var util=require('util');var logger=require(_0xae23('0x1'))('api');var moment=require(_0xae23('0x2'));var BPromise=require(_0xae23('0x3'));var rp=require(_0xae23('0x4'));var fs=require('fs');var path=require(_0xae23('0x5'));var rimraf=require(_0xae23('0x6'));var config=require('../../config/environment');var attributes=require(_0xae23('0x7'));module[_0xae23('0x8')]=function(_0xc4a7de,_0x173fbf){return _0xc4a7de[_0xae23('0x9')](_0xae23('0xa'),attributes,{'tableName':_0xae23('0xb'),'paranoid':![],'indexes':[{'name':_0xae23('0xc'),'fields':[_0xae23('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index 2bdccd8..ef254db 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 _0xf387=['message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','then','info','ChatTransferReport,\x20%s,\x20%s','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x96f0dd,_0x5b7305){var _0x2b3fd5=function(_0x4b6dc6){while(--_0x4b6dc6){_0x96f0dd['push'](_0x96f0dd['shift']());}};_0x2b3fd5(++_0x5b7305);}(_0xf387,0x154));var _0x7f38=function(_0x13ac6c,_0x41abd0){_0x13ac6c=_0x13ac6c-0x0;var _0x5331ea=_0xf387[_0x13ac6c];return _0x5331ea;};'use strict';var _=require(_0x7f38('0x0'));var util=require(_0x7f38('0x1'));var moment=require(_0x7f38('0x2'));var BPromise=require('bluebird');var rs=require(_0x7f38('0x3'));var fs=require('fs');var Redis=require(_0x7f38('0x4'));var db=require(_0x7f38('0x5'))['db'];var utils=require(_0x7f38('0x6'));var logger=require(_0x7f38('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x7f38('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x207b3f,_0x25ecdd,_0x33ea1d){return new BPromise(function(_0x2caab6,_0x2cec7f){return client['request'](_0x207b3f,_0x33ea1d)[_0x7f38('0x9')](function(_0x18e089){logger[_0x7f38('0xa')](_0x7f38('0xb'),_0x25ecdd,'request\x20sent');logger[_0x7f38('0xc')](_0x7f38('0xd'),_0x25ecdd,'request\x20sent',JSON[_0x7f38('0xe')](_0x18e089));if(_0x18e089[_0x7f38('0xf')]){if(_0x18e089[_0x7f38('0xf')][_0x7f38('0x10')]===0x1f4){logger[_0x7f38('0xf')](_0x7f38('0xb'),_0x25ecdd,_0x18e089['error'][_0x7f38('0x11')]);return _0x2cec7f(_0x18e089['error'][_0x7f38('0x11')]);}logger['error'](_0x7f38('0xb'),_0x25ecdd,_0x18e089[_0x7f38('0xf')]['message']);return _0x2caab6(_0x18e089['error']['message']);}else{logger[_0x7f38('0xa')](_0x7f38('0xb'),_0x25ecdd,_0x7f38('0x12'));_0x2caab6(_0x18e089[_0x7f38('0x13')][_0x7f38('0x11')]);}})[_0x7f38('0x14')](function(_0x33adb4){logger[_0x7f38('0xf')]('ChatTransferReport,\x20%s,\x20%s',_0x25ecdd,_0x33adb4);_0x2cec7f(_0x33adb4);});});} \ No newline at end of file +var _0x98ff=['catch','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','then','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x98ff,0x169));var _0xf98f=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0x98ff[_0x56482c];return _0x5aae7a;};'use strict';var _=require('lodash');var util=require(_0xf98f('0x0'));var moment=require(_0xf98f('0x1'));var BPromise=require(_0xf98f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf98f('0x3'))['db'];var utils=require(_0xf98f('0x4'));var logger=require(_0xf98f('0x5'))(_0xf98f('0x6'));var config=require(_0xf98f('0x7'));var jayson=require(_0xf98f('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xcc6e51,_0x572525,_0x4a62f3){return new BPromise(function(_0x7ebc14,_0x3c6c02){return client['request'](_0xcc6e51,_0x4a62f3)[_0xf98f('0x9')](function(_0x2d7bdd){logger['info'](_0xf98f('0xa'),_0x572525,_0xf98f('0xb'));logger[_0xf98f('0xc')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x572525,_0xf98f('0xb'),JSON[_0xf98f('0xd')](_0x2d7bdd));if(_0x2d7bdd[_0xf98f('0xe')]){if(_0x2d7bdd[_0xf98f('0xe')]['code']===0x1f4){logger[_0xf98f('0xe')](_0xf98f('0xa'),_0x572525,_0x2d7bdd['error'][_0xf98f('0xf')]);return _0x3c6c02(_0x2d7bdd[_0xf98f('0xe')][_0xf98f('0xf')]);}logger[_0xf98f('0xe')]('ChatTransferReport,\x20%s,\x20%s',_0x572525,_0x2d7bdd[_0xf98f('0xe')][_0xf98f('0xf')]);return _0x7ebc14(_0x2d7bdd['error'][_0xf98f('0xf')]);}else{logger[_0xf98f('0x10')](_0xf98f('0xa'),_0x572525,_0xf98f('0xb'));_0x7ebc14(_0x2d7bdd['result'][_0xf98f('0xf')]);}})[_0xf98f('0x11')](function(_0x20fa9b){logger[_0xf98f('0xe')](_0xf98f('0xa'),_0x572525,_0x20fa9b);_0x3c6c02(_0x20fa9b);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index a1a89b2..4ad6a87 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 _0x11e7=['delete','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post','create','put','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x11e7,0x86));var _0x711e=function(_0x40ce27,_0x27c747){_0x40ce27=_0x40ce27-0x0;var _0xf54b4b=_0x11e7[_0x40ce27];return _0xf54b4b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x711e('0x0'));var timeout=require(_0x711e('0x1'));var express=require(_0x711e('0x2'));var router=express[_0x711e('0x3')]();var fs_extra=require(_0x711e('0x4'));var auth=require(_0x711e('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x711e('0x6'));var controller=require(_0x711e('0x7'));router[_0x711e('0x8')]('/',auth[_0x711e('0x9')](),controller[_0x711e('0xa')]);router[_0x711e('0x8')](_0x711e('0xb'),auth[_0x711e('0x9')](),controller[_0x711e('0xc')]);router[_0x711e('0x8')](_0x711e('0xd'),auth[_0x711e('0x9')](),controller['show']);router[_0x711e('0xe')]('/',auth[_0x711e('0x9')](),controller[_0x711e('0xf')]);router[_0x711e('0x10')](_0x711e('0xd'),auth[_0x711e('0x9')](),controller[_0x711e('0x11')]);router[_0x711e('0x12')]('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xece1=['util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','index','get','/describe','isAuthenticated','describe','/:id','post','create','put','update','delete','destroy','exports','multer'];(function(_0x1b6186,_0x1ec7f2){var _0x186121=function(_0x1748a8){while(--_0x1748a8){_0x1b6186['push'](_0x1b6186['shift']());}};_0x186121(++_0x1ec7f2);}(_0xece1,0x1e3));var _0x1ece=function(_0x290863,_0x20ac33){_0x290863=_0x290863-0x0;var _0xb27c3c=_0xece1[_0x290863];return _0xb27c3c;};'use strict';var multer=require(_0x1ece('0x0'));var util=require(_0x1ece('0x1'));var path=require(_0x1ece('0x2'));var timeout=require(_0x1ece('0x3'));var express=require(_0x1ece('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x1ece('0x5'));var interaction=require(_0x1ece('0x6'));var config=require(_0x1ece('0x7'));var controller=require(_0x1ece('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x1ece('0x9')]);router[_0x1ece('0xa')](_0x1ece('0xb'),auth[_0x1ece('0xc')](),controller[_0x1ece('0xd')]);router[_0x1ece('0xa')](_0x1ece('0xe'),auth['isAuthenticated'](),controller['show']);router[_0x1ece('0xf')]('/',auth[_0x1ece('0xc')](),controller[_0x1ece('0x10')]);router[_0x1ece('0x11')](_0x1ece('0xe'),auth[_0x1ece('0xc')](),controller[_0x1ece('0x12')]);router[_0x1ece('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x1ece('0x14')]);module[_0x1ece('0x15')]=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index c0a0cf8..f3cd343 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 _0xbd39=['Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','We\x20are\x20here!','Chat','Contact\x20us','TEXT','Note','Send','Feedback','thumb','name','text','input','onlineForm','parse','getDataValue','stringify','textarea','Leave\x20your\x20comments','offlineForm','setDataValue','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','alternate','#fafafa','System'];(function(_0x31a783,_0x211d45){var _0x24ff25=function(_0x649d79){while(--_0x649d79){_0x31a783['push'](_0x31a783['shift']());}};_0x24ff25(++_0x211d45);}(_0xbd39,0xea));var _0x9bd3=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0xbd39[_0x4709c0];return _0x13348b;};'use strict';var Sequelize=require(_0x9bd3('0x0'));var rs=require(_0x9bd3('0x1'));module['exports']={'name':{'type':Sequelize[_0x9bd3('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0x9bd3('0x2')],'allowNull':![],'unique':_0x9bd3('0x3')},'description':{'type':Sequelize[_0x9bd3('0x2')]},'mapKey':{'type':Sequelize[_0x9bd3('0x2')],'defaultValue':_0x9bd3('0x4')},'mapKeyOffline':{'type':Sequelize[_0x9bd3('0x2')],'defaultValue':_0x9bd3('0x4')},'key':{'type':Sequelize[_0x9bd3('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x9bd3('0x2')],'defaultValue':_0x9bd3('0x5')},'customerAlias':{'type':Sequelize[_0x9bd3('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x9bd3('0x2')],'allowNull':![],'defaultValue':_0x9bd3('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x9bd3('0x2')],'allowNull':![],'defaultValue':_0x9bd3('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x9bd3('0x2')],'allowNull':![],'defaultValue':_0x9bd3('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x9bd3('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x9bd3('0x2')]},'animation':{'type':Sequelize[_0x9bd3('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x9bd3('0xa')](_0x9bd3('0xb'),'squared'),'defaultValue':'rounded'},'header_online':{'type':Sequelize[_0x9bd3('0x2')],'defaultValue':_0x9bd3('0xc')},'start_chat_button':{'type':Sequelize[_0x9bd3('0x2')],'defaultValue':_0x9bd3('0xd')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':'Send'},'header_offline':{'type':Sequelize[_0x9bd3('0x2')],'defaultValue':_0x9bd3('0xe')},'download_transcript':{'type':Sequelize[_0x9bd3('0x9')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x9bd3('0x2')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0x9bd3('0x9')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x9bd3('0xf')]},'closingQuestion':{'type':Sequelize[_0x9bd3('0x2')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0x9bd3('0x2')],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0x9bd3('0x2')],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0x9bd3('0x2')],'defaultValue':_0x9bd3('0x10')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0x9bd3('0x2')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x9bd3('0x11')},'skipMessageButton':{'type':Sequelize[_0x9bd3('0x2')],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize[_0x9bd3('0x9')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x9bd3('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x9bd3('0x9')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x9bd3('0x9')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x9bd3('0x2')],'defaultValue':_0x9bd3('0x12')},'ratingType':{'type':Sequelize[_0x9bd3('0xa')]('star',_0x9bd3('0x13')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0x9bd3('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x9bd3('0xf')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':'input','variable':null,'config':{'placeholder':_0x9bd3('0x14'),'type':_0x9bd3('0x15'),'required':!![]},'props':{'title':_0x9bd3('0x14'),'helpText':''}},{'type':_0x9bd3('0x16'),'props':{'title':_0x9bd3('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x9bd3('0x4'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0x9bd3('0x17'))?JSON[_0x9bd3('0x18')](this[_0x9bd3('0x19')]('onlineForm')):{};},'set':function(_0x1ada2a){return this['setDataValue'](_0x9bd3('0x17'),JSON['stringify'](_0x1ada2a));}},'offlineForm':{'type':Sequelize[_0x9bd3('0xf')],'defaultValue':function(){return JSON[_0x9bd3('0x1a')]({'items':[{'type':'input','props':{'title':_0x9bd3('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x9bd3('0x4'),'type':_0x9bd3('0x4')},'variable':null},{'type':_0x9bd3('0x1b'),'config':{'placeholder':'Comments'},'props':{'title':'Comments','helpText':_0x9bd3('0x1c')}}],'fromKey':0x0});},'get':function(){return this['getDataValue'](_0x9bd3('0x1d'))?JSON['parse'](this[_0x9bd3('0x19')]('offlineForm')):{};},'set':function(_0x39a914){return this[_0x9bd3('0x1e')]('offlineForm',JSON[_0x9bd3('0x1a')](_0x39a914));}},'token':{'type':Sequelize[_0x9bd3('0x2')],'defaultValue':function(){return rs[_0x9bd3('0x1f')]();}},'autoclose':{'type':Sequelize[_0x9bd3('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x9bd3('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x9bd3('0x2')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x9bd3('0x2')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0x9bd3('0x20')},'waitingMessage':{'type':Sequelize[_0x9bd3('0x2')],'defaultValue':_0x9bd3('0x21')},'offlineMessageSubject':{'type':Sequelize[_0x9bd3('0x2')],'defaultValue':_0x9bd3('0x22')},'offlineMessageBody':{'type':Sequelize[_0x9bd3('0x2')],'defaultValue':_0x9bd3('0x23')},'enableUnmanagedNote':{'type':Sequelize[_0x9bd3('0x9')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x9bd3('0x2')],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize[_0x9bd3('0x2')],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x9bd3('0x11')},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x9bd3('0x9')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x9bd3('0xf')]},'showAgentAvatar':{'type':Sequelize[_0x9bd3('0x9')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x9bd3('0x2')]},'notificationTemplate':{'type':Sequelize[_0x9bd3('0xf')],'defaultValue':function(){return _0x9bd3('0x24');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x9bd3('0x2')],'defaultValue':_0x9bd3('0x25')},'waitForTheAssignedAgent':{'type':Sequelize[_0x9bd3('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':_0x9bd3('0x26')},'verticalAlignment':{'type':Sequelize[_0x9bd3('0x8')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0x9bd3('0x27')},'defaultTitle':{'type':Sequelize[_0x9bd3('0x2')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize[_0x9bd3('0x9')],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x9bd3('0x2')],'allowNull':![],'defaultValue':_0x9bd3('0x28'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x9bd3('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x9bd3('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x9bd3('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x9bd3('0x2')],'defaultValue':_0x9bd3('0x29')},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x9bd3('0x2a'),'set':function(_0x4a8733){if(!_0x4a8733)this[_0x9bd3('0x1e')](_0x9bd3('0x2b'),null);this[_0x9bd3('0x1e')](_0x9bd3('0x2c'),_0x4a8733);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x9bd3('0x2')]},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize[_0x9bd3('0x2')],'defaultValue':function(){return _0x9bd3('0x2d');}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x9bd3('0x9')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x9bd3('0xf')]}}; \ No newline at end of file +var _0x68b8=['BOOLEAN','ENUM','rounded','We\x20are\x20here!','Chat','INTEGER','Powered\x20by\x20xCALLY','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Send','Skip','star','TEXT','stringify','input','text','name','getDataValue','onlineForm','parse','setDataValue','Comments','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','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','alternate','#fafafa','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','address','email','Agent','#011F6A','#ffffff'];(function(_0x2e2910,_0x3b06e0){var _0x22e05c=function(_0x2a0e31){while(--_0x2a0e31){_0x2e2910['push'](_0x2e2910['shift']());}};_0x22e05c(++_0x3b06e0);}(_0x68b8,0x187));var _0x868b=function(_0x3e5bc8,_0x457d89){_0x3e5bc8=_0x3e5bc8-0x0;var _0xfd84bc=_0x68b8[_0x3e5bc8];return _0xfd84bc;};'use strict';var Sequelize=require(_0x868b('0x0'));var rs=require(_0x868b('0x1'));module[_0x868b('0x2')]={'name':{'type':Sequelize[_0x868b('0x3')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x868b('0x4')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize[_0x868b('0x3')],'defaultValue':_0x868b('0x5')},'mapKeyOffline':{'type':Sequelize[_0x868b('0x3')],'defaultValue':_0x868b('0x5')},'key':{'type':Sequelize[_0x868b('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x868b('0x3')],'defaultValue':_0x868b('0x6')},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize[_0x868b('0x3')],'allowNull':![],'defaultValue':_0x868b('0x7'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x868b('0x3')],'allowNull':![],'defaultValue':_0x868b('0x7'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x868b('0x8'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize[_0x868b('0x3')]},'animation':{'type':Sequelize[_0x868b('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x868b('0xa')]('rounded','squared'),'defaultValue':_0x868b('0xb')},'header_online':{'type':Sequelize[_0x868b('0x3')],'defaultValue':_0x868b('0xc')},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x868b('0xd')},'offline_chat_button':{'type':Sequelize[_0x868b('0x3')],'defaultValue':'Send'},'header_offline':{'type':Sequelize[_0x868b('0x3')],'defaultValue':'Contact\x20us'},'download_transcript':{'type':Sequelize[_0x868b('0x9')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x868b('0xe')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x868b('0x3')],'defaultValue':_0x868b('0xf')},'defaultWhiteLabel':{'type':Sequelize[_0x868b('0x9')],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0x868b('0x10')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':_0x868b('0x11')},'formSubmitFailureMessage':{'type':Sequelize[_0x868b('0x3')],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0x868b('0x3')],'defaultValue':_0x868b('0x12')},'placeholderMessage':{'type':Sequelize[_0x868b('0x3')],'defaultValue':_0x868b('0x13')},'closingMessage':{'type':Sequelize[_0x868b('0x3')],'defaultValue':_0x868b('0x14')},'closingMessageButton':{'type':Sequelize[_0x868b('0x3')],'defaultValue':_0x868b('0x15')},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x868b('0x16')},'conditionAgreement':{'type':Sequelize[_0x868b('0x9')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x868b('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x868b('0x9')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x868b('0x3')],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize[_0x868b('0xa')](_0x868b('0x17'),'thumb'),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0x868b('0xe')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x868b('0x18')],'defaultValue':function(){return JSON[_0x868b('0x19')]({'items':[{'type':_0x868b('0x1a'),'variable':null,'config':{'placeholder':'name','type':_0x868b('0x1b'),'required':!![]},'props':{'title':_0x868b('0x1c'),'helpText':''}},{'type':_0x868b('0x1a'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':'email','type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x868b('0x1d')](_0x868b('0x1e'))?JSON[_0x868b('0x1f')](this[_0x868b('0x1d')](_0x868b('0x1e'))):{};},'set':function(_0x48af79){return this[_0x868b('0x20')](_0x868b('0x1e'),JSON['stringify'](_0x48af79));}},'offlineForm':{'type':Sequelize[_0x868b('0x18')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x868b('0x1a'),'props':{'title':_0x868b('0x5'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x868b('0x5')},'variable':null},{'type':'textarea','config':{'placeholder':_0x868b('0x21')},'props':{'title':_0x868b('0x21'),'helpText':_0x868b('0x22')}}],'fromKey':0x0});},'get':function(){return this[_0x868b('0x1d')](_0x868b('0x23'))?JSON[_0x868b('0x1f')](this['getDataValue']('offlineForm')):{};},'set':function(_0x11aebd){return this[_0x868b('0x20')](_0x868b('0x23'),JSON[_0x868b('0x19')](_0x11aebd));}},'token':{'type':Sequelize[_0x868b('0x3')],'defaultValue':function(){return rs[_0x868b('0x24')]();}},'autoclose':{'type':Sequelize[_0x868b('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x868b('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x868b('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize[_0x868b('0x9')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x868b('0x3')]},'waitingTitle':{'type':Sequelize[_0x868b('0x3')],'defaultValue':_0x868b('0x25')},'waitingMessage':{'type':Sequelize[_0x868b('0x3')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0x868b('0x3')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0x868b('0x3')],'defaultValue':_0x868b('0x26')},'enableUnmanagedNote':{'type':Sequelize[_0x868b('0x9')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x868b('0x3')],'defaultValue':_0x868b('0x27')},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x868b('0x16')},'sendUnmanaged':{'type':Sequelize[_0x868b('0x3')],'defaultValue':_0x868b('0x15')},'enableCustomerAttachment':{'type':Sequelize[_0x868b('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x868b('0x9')],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x868b('0x28');}},'notificationSound':{'type':Sequelize[_0x868b('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x868b('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x868b('0x3')],'defaultValue':_0x868b('0x29')},'waitForTheAssignedAgent':{'type':Sequelize[_0x868b('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':_0x868b('0x2a')},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0x868b('0x3')],'defaultValue':_0x868b('0x2b')},'defaultTitle':{'type':Sequelize[_0x868b('0x3')]},'customerAvatar':{'type':Sequelize[_0x868b('0x18')]},'showCustomerAvatar':{'type':Sequelize[_0x868b('0x9')],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x868b('0x3')],'allowNull':![],'defaultValue':_0x868b('0x2c'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x868b('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x868b('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':'System'},'systemAvatar':{'type':Sequelize[_0x868b('0x18')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x868b('0x2d')},'mandatoryDisposition':{'type':Sequelize[_0x868b('0x9')],'defaultValue':![],'comment':_0x868b('0x2e'),'set':function(_0xfb019){if(!_0xfb019)this[_0x868b('0x20')]('mandatoryDispositionPauseId',null);this[_0x868b('0x20')](_0x868b('0x2f'),_0xfb019);}},'vidaooEscalation':{'type':Sequelize[_0x868b('0x9')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x868b('0x3')]},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x868b('0x30')},'vidaooNote':{'type':Sequelize[_0x868b('0x3')],'defaultValue':function(){return _0x868b('0x31');}},'vidaooMetadata':{'type':Sequelize[_0x868b('0x18')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x868b('0x9')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x868b('0x18')]}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index 9413a94..781853d 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 _0xbe99=['x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','messageId','created','autoclose','push','close','*,*,*,*','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','notify','offline','CmContact','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','defaults','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','toPairs','ChatOfflineMessage','originalname','mimetype','server','files','attachments','offline-chat','basename','openNewInteraction','sequelize','Attachment','bulkCreate','MailServerOut','forwardOffline','forwardOfflineAddress','Smtp','service','host','port','secure','auth','pass','sendMail','\x22%s\x22\x20<%s>','email','subjectOffline','toPairsIn','offlineMessageSubject','MailAccountId','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','tag','Command','getSnippet','interval','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','OFFLINE','timezone','No\x20timezone','inspect','Interval','getProactiveActions','getLicense','virtual','custom','License','increment','Intervals','all','some','server/files/chat/iframe.ejs','remote','x-real-ip','connection','remoteAddress','render','alignment','color','textColor','color_button','backgroundColor','addApplications','transaction','findAndCountAll','priority','getApplications','chatProactiveAction','addProactiveActions','getFields','online','false','onlineForm','fromKey','getOfflineMessages','Attachments','addAgents','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./chatWebsite.socket','jayson/promise','client','http','info','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','set','apply','reject','save','update','then','destroy','get','ChatWebsites','UserProfileResource','stack','name','send','index','map','ChatWebsite','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','filters','pick','merge','where','filter','count','includeAll','include','Pause','mandatoryDispositionPause','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','ChatWebsiteId','getDispositions','findOne','Disposition','order','options','findAll','rows','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','filename','addAvatar','agentAvatar','file','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','server/files/images/logos/default_logo.svg','sitepic','../../config/license/util','isNil','root','server/files/images/logos/','getAvatar','server/files/images/avatars/default_avatar.png','existsSync','server/files/images/avatars/','download','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','user-agent-parser','setUA','headers','user-agent','getResult','chat','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList','List','Contacts','DESC','ChatApplication','Applications','account','applications','list','asc','contact','customerIp','cf-connecting-ip','first','x-forwarded-for','split','firstName','lastName'];(function(_0x29510f,_0x3bf281){var _0x53cd1a=function(_0x16cd04){while(--_0x16cd04){_0x29510f['push'](_0x29510f['shift']());}};_0x53cd1a(++_0x3bf281);}(_0xbe99,0x1ca));var _0x9be9=function(_0x56eabf,_0x122249){_0x56eabf=_0x56eabf-0x0;var _0x5daa57=_0xbe99[_0x56eabf];return _0x5daa57;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9be9('0x0'));var zipdir=require(_0x9be9('0x1'));var jsonpatch=require(_0x9be9('0x2'));var rp=require('request-promise');var moment=require(_0x9be9('0x3'));var BPromise=require(_0x9be9('0x4'));var Mustache=require(_0x9be9('0x5'));var util=require(_0x9be9('0x6'));var path=require(_0x9be9('0x7'));var sox=require(_0x9be9('0x8'));var csv=require('to-csv');var ejs=require(_0x9be9('0x9'));var fs=require('fs');var fs_extra=require(_0x9be9('0xa'));var _=require(_0x9be9('0xb'));var squel=require('squel');var crypto=require(_0x9be9('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x9be9('0xd'));var querystring=require(_0x9be9('0xe'));var Papa=require(_0x9be9('0xf'));var Redis=require(_0x9be9('0x10'));var authService=require(_0x9be9('0x11'));var qs=require(_0x9be9('0x12'));var as=require(_0x9be9('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9be9('0x14'))(_0x9be9('0x15'));var utils=require(_0x9be9('0x16'));var config=require(_0x9be9('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x9be9('0x18'))['db'];config[_0x9be9('0x19')]=_['defaults'](config['redis'],{'host':_0x9be9('0x1a'),'port':0x18eb});var socket=require(_0x9be9('0x1b'))(new Redis(config[_0x9be9('0x19')]));require(_0x9be9('0x1c'))['register'](socket);var jayson=require(_0x9be9('0x1d'));var client=jayson[_0x9be9('0x1e')][_0x9be9('0x1f')]({'port':0x232c});var client9002=jayson[_0x9be9('0x1e')][_0x9be9('0x1f')]({'port':0x232a});var client9003=jayson[_0x9be9('0x1e')][_0x9be9('0x1f')]({'port':0x232b});var client9001=jayson[_0x9be9('0x1e')][_0x9be9('0x1f')]({'port':0x2329});function respondWithRpcPromise(_0x1d8e4b,_0x16717b,_0x43578e,_0x3b97de){return new BPromise(function(_0x21747e,_0x4fd6e3){var _0x48abe0=_0x3b97de||client;return _0x48abe0['request'](_0x1d8e4b,_0x43578e)['then'](function(_0x533dd0){logger[_0x9be9('0x20')]('ChatWebsite,\x20%s,\x20%s',_0x16717b,_0x9be9('0x21'));logger['debug'](_0x9be9('0x22'),_0x16717b,_0x9be9('0x21'),JSON[_0x9be9('0x23')](_0x533dd0));if(_0x533dd0['error']){if(_0x533dd0[_0x9be9('0x24')][_0x9be9('0x25')]===0x1f4){logger[_0x9be9('0x24')]('ChatWebsite,\x20%s,\x20%s',_0x16717b,_0x533dd0['error']['message']);return _0x4fd6e3(_0x533dd0[_0x9be9('0x24')]['message']);}logger[_0x9be9('0x24')](_0x9be9('0x26'),_0x16717b,_0x533dd0['error']['message']);return _0x21747e(_0x533dd0['error'][_0x9be9('0x27')]);}else{logger[_0x9be9('0x20')](_0x9be9('0x26'),_0x16717b,'request\x20sent');_0x21747e(_0x533dd0[_0x9be9('0x28')]['message']);}})[_0x9be9('0x29')](function(_0x3411b2){logger[_0x9be9('0x24')](_0x9be9('0x26'),_0x16717b,_0x3411b2);_0x4fd6e3(_0x3411b2);});});}function respondWithStatusCode(_0x445658,_0x42e925){_0x42e925=_0x42e925||0xcc;return function(_0x333072){if(_0x333072){return _0x445658[_0x9be9('0x2a')](_0x42e925);}return _0x445658[_0x9be9('0x2b')](_0x42e925)[_0x9be9('0x2c')]();};}function respondWithResult(_0x53bbdd,_0x3341e1){_0x3341e1=_0x3341e1||0xc8;return function(_0x3a1931){if(_0x3a1931){return _0x53bbdd[_0x9be9('0x2b')](_0x3341e1)[_0x9be9('0x2d')](_0x3a1931);}};}function respondWithFilteredResult(_0x2e50ac,_0x14e58e){return function(_0x22545d){if(_0x22545d){var _0x426d01=typeof _0x14e58e[_0x9be9('0x2e')]===_0x9be9('0x2f')&&typeof _0x14e58e[_0x9be9('0x30')]==='undefined';var _0xa0529b=_0x22545d['count'];var _0x327912=_0x426d01?0x0:_0x14e58e['offset'];var _0x19a5e7=_0x426d01?_0x22545d['count']:_0x14e58e['offset']+_0x14e58e[_0x9be9('0x30')];var _0x19dcf9;if(_0x19a5e7>=_0xa0529b){_0x19a5e7=_0xa0529b;_0x19dcf9=0xc8;}else{_0x19dcf9=0xce;}_0x2e50ac[_0x9be9('0x2b')](_0x19dcf9);return _0x2e50ac[_0x9be9('0x31')]('Content-Range',_0x327912+'-'+_0x19a5e7+'/'+_0xa0529b)[_0x9be9('0x2d')](_0x22545d);}return null;};}function patchUpdates(_0x2f73ea){return function(_0x323f31){try{jsonpatch[_0x9be9('0x32')](_0x323f31,_0x2f73ea,!![]);}catch(_0xe1123){return BPromise[_0x9be9('0x33')](_0xe1123);}return _0x323f31[_0x9be9('0x34')]();};}function saveUpdates(_0x4de1c3,_0x12544c){return function(_0x30f335){if(_0x30f335){return _0x30f335[_0x9be9('0x35')](_0x4de1c3)[_0x9be9('0x36')](function(_0x219912){return _0x219912;});}return null;};}function removeEntity(_0x3e7b14,_0x29a922){return function(_0x5427b2){if(_0x5427b2){return _0x5427b2[_0x9be9('0x37')]()[_0x9be9('0x36')](function(){var _0x53d07b=_0x5427b2[_0x9be9('0x38')]({'plain':!![]});var _0x5cbcb2=_0x9be9('0x39');return db[_0x9be9('0x3a')][_0x9be9('0x37')]({'where':{'type':_0x5cbcb2,'resourceId':_0x53d07b['id']}})[_0x9be9('0x36')](function(){return _0x5427b2;});})[_0x9be9('0x36')](function(){_0x3e7b14[_0x9be9('0x2b')](0xcc)[_0x9be9('0x2c')]();});}};}function handleEntityNotFound(_0x1409fd,_0xaa031c){return function(_0xe768f0){if(!_0xe768f0){_0x1409fd[_0x9be9('0x2a')](0x194);}return _0xe768f0;};}function handleError(_0x57ec15,_0x361090){_0x361090=_0x361090||0x1f4;return function(_0x306a37){logger[_0x9be9('0x24')](_0x306a37[_0x9be9('0x3b')]);if(_0x306a37['name']){delete _0x306a37[_0x9be9('0x3c')];}_0x57ec15[_0x9be9('0x2b')](_0x361090)[_0x9be9('0x3d')](_0x306a37);};}exports[_0x9be9('0x3e')]=function(_0x7335b1,_0x10236c){var _0x466211={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x1761d5={},_0x3e6a7d={'count':0x0,'rows':[]};var _0x337556=_[_0x9be9('0x3f')](db[_0x9be9('0x40')][_0x9be9('0x41')],function(_0x58d1ee){return{'name':_0x58d1ee[_0x9be9('0x42')],'type':_0x58d1ee[_0x9be9('0x43')][_0x9be9('0x44')]};});_0x1761d5[_0x9be9('0x45')]=_[_0x9be9('0x3f')](_0x337556,_0x9be9('0x3c'));_0x1761d5[_0x9be9('0x46')]=_[_0x9be9('0x47')](_0x7335b1[_0x9be9('0x46')]);_0x1761d5['filters']=_[_0x9be9('0x48')](_0x1761d5[_0x9be9('0x45')],_0x1761d5['query']);_0x466211[_0x9be9('0x49')]=_[_0x9be9('0x48')](_0x1761d5['model'],qs[_0x9be9('0x4a')](_0x7335b1[_0x9be9('0x46')][_0x9be9('0x4a')]));_0x466211['attributes']=_0x466211[_0x9be9('0x49')][_0x9be9('0x4b')]?_0x466211['attributes']:_0x1761d5[_0x9be9('0x45')];if(!_0x7335b1['query'][_0x9be9('0x4c')](_0x9be9('0x4d'))){_0x466211[_0x9be9('0x30')]=qs[_0x9be9('0x30')](_0x7335b1[_0x9be9('0x46')][_0x9be9('0x30')]);_0x466211[_0x9be9('0x2e')]=qs[_0x9be9('0x2e')](_0x7335b1[_0x9be9('0x46')][_0x9be9('0x2e')]);}_0x466211['order']=qs[_0x9be9('0x4e')](_0x7335b1[_0x9be9('0x46')][_0x9be9('0x4e')]);_0x466211['where']=qs[_0x9be9('0x4f')](_[_0x9be9('0x50')](_0x7335b1['query'],_0x1761d5[_0x9be9('0x4f')]),_0x337556);if(_0x7335b1['query']['filter']){_0x466211['where']=_[_0x9be9('0x51')](_0x466211[_0x9be9('0x52')],{'$or':_['map'](_0x337556,function(_0x5bd22e){if(_0x5bd22e[_0x9be9('0x43')]!=='VIRTUAL'){var _0x135ac0={};_0x135ac0[_0x5bd22e[_0x9be9('0x3c')]]={'$like':'%'+_0x7335b1['query'][_0x9be9('0x53')]+'%'};return _0x135ac0;}})});}_0x466211=_['merge']({},_0x466211,_0x7335b1['options']);var _0x1ff482={'where':_0x466211[_0x9be9('0x52')]};return db[_0x9be9('0x40')][_0x9be9('0x54')](_0x1ff482)['then'](function(_0x3e23b2){_0x3e6a7d['count']=_0x3e23b2;if(_0x7335b1[_0x9be9('0x46')][_0x9be9('0x55')]){_0x466211[_0x9be9('0x56')]=[{'all':!![]}];}return db[_0x9be9('0x40')]['findAll'](_0x466211);})[_0x9be9('0x36')](function(_0x8436db){_0x3e6a7d['rows']=_0x8436db;return _0x3e6a7d;})['then'](respondWithFilteredResult(_0x10236c,_0x466211))['catch'](handleError(_0x10236c,null));};exports['show']=function(_0x3b2cea,_0x2d4abf){var _0x5b3cea={'raw':![],'where':{'id':_0x3b2cea['params']['id']},'include':[{'model':db[_0x9be9('0x57')],'as':_0x9be9('0x58')}]},_0x429153={};_0x429153[_0x9be9('0x45')]=_['keys'](db[_0x9be9('0x40')][_0x9be9('0x41')]);_0x429153['query']=_[_0x9be9('0x47')](_0x3b2cea[_0x9be9('0x46')]);_0x429153[_0x9be9('0x4f')]=_[_0x9be9('0x48')](_0x429153[_0x9be9('0x45')],_0x429153['query']);_0x5b3cea[_0x9be9('0x49')]=_[_0x9be9('0x48')](_0x429153[_0x9be9('0x45')],qs[_0x9be9('0x4a')](_0x3b2cea[_0x9be9('0x46')][_0x9be9('0x4a')]));_0x5b3cea['attributes']=_0x5b3cea[_0x9be9('0x49')]['length']?_0x5b3cea[_0x9be9('0x49')]:_0x429153[_0x9be9('0x45')];if(_0x3b2cea[_0x9be9('0x46')]['includeAll']){_0x5b3cea[_0x9be9('0x56')]=[{'all':!![]}];}_0x5b3cea=_['merge']({},_0x5b3cea,_0x3b2cea['options']);return db[_0x9be9('0x40')][_0x9be9('0x59')](_0x5b3cea)[_0x9be9('0x36')](handleEntityNotFound(_0x2d4abf,null))['then'](respondWithResult(_0x2d4abf,null))[_0x9be9('0x29')](handleError(_0x2d4abf,null));};exports[_0x9be9('0x5a')]=function(_0x216215,_0x57a84d){return db[_0x9be9('0x40')][_0x9be9('0x5a')](_0x216215[_0x9be9('0x5b')],{})[_0x9be9('0x36')](function(_0x194cf5){var _0x4006d1=_0x216215['user'][_0x9be9('0x38')]({'plain':!![]});if(!_0x4006d1)throw new Error(_0x9be9('0x5c'));if(_0x4006d1[_0x9be9('0x5d')]===_0x9be9('0x5e')){var _0x37c62f=_0x194cf5['get']({'plain':!![]});var _0x41be91=_0x9be9('0x39');return db[_0x9be9('0x5f')]['find']({'where':{'name':_0x41be91,'userProfileId':_0x4006d1[_0x9be9('0x60')]},'raw':!![]})[_0x9be9('0x36')](function(_0x467d24){if(_0x467d24&&_0x467d24[_0x9be9('0x61')]===0x0){return db[_0x9be9('0x3a')]['create']({'name':_0x37c62f['name'],'resourceId':_0x37c62f['id'],'type':_0x467d24[_0x9be9('0x3c')],'sectionId':_0x467d24['id']},{})[_0x9be9('0x36')](function(){return _0x194cf5;});}else{return _0x194cf5;}})[_0x9be9('0x29')](function(_0x2c7154){logger[_0x9be9('0x24')](_0x9be9('0x62'),_0x2c7154);throw _0x2c7154;});}return _0x194cf5;})[_0x9be9('0x36')](respondWithResult(_0x57a84d,0xc9))[_0x9be9('0x29')](handleError(_0x57a84d,null));};exports['update']=function(_0x51fdfd,_0x56f1ee){if(_0x51fdfd[_0x9be9('0x5b')]['id']){delete _0x51fdfd[_0x9be9('0x5b')]['id'];}return db['ChatWebsite']['find']({'where':{'id':_0x51fdfd[_0x9be9('0x63')]['id']},'include':[{'model':db[_0x9be9('0x57')],'as':_0x9be9('0x58')}]})[_0x9be9('0x36')](handleEntityNotFound(_0x56f1ee,null))[_0x9be9('0x36')](saveUpdates(_0x51fdfd[_0x9be9('0x5b')],null))['then'](respondWithResult(_0x56f1ee,null))[_0x9be9('0x29')](handleError(_0x56f1ee,null));};exports[_0x9be9('0x37')]=function(_0x51875c,_0x35e2a2){return db[_0x9be9('0x40')][_0x9be9('0x59')]({'where':{'id':_0x51875c[_0x9be9('0x63')]['id']}})[_0x9be9('0x36')](handleEntityNotFound(_0x35e2a2,null))[_0x9be9('0x36')](removeEntity(_0x35e2a2,null))[_0x9be9('0x29')](handleError(_0x35e2a2,null));};exports[_0x9be9('0x64')]=function(_0x5aa45b,_0x529360){return db['ChatWebsite']['describe']()[_0x9be9('0x36')](respondWithResult(_0x529360,null))['catch'](handleError(_0x529360,null));};exports[_0x9be9('0x65')]=function(_0x3be552,_0x55e7da,_0x3a5e13){if(_0x3be552[_0x9be9('0x5b')]['id']){delete _0x3be552[_0x9be9('0x5b')]['id'];}return db[_0x9be9('0x40')][_0x9be9('0x59')]({'where':{'id':_0x3be552[_0x9be9('0x63')]['id']}})['then'](handleEntityNotFound(_0x55e7da,null))[_0x9be9('0x36')](function(_0x21fd96){if(_0x21fd96){_0x3be552[_0x9be9('0x5b')][_0x9be9('0x66')]=_0x21fd96['id'];return db['Disposition'][_0x9be9('0x5a')](_0x3be552['body']);}})[_0x9be9('0x36')](respondWithResult(_0x55e7da,null))[_0x9be9('0x29')](handleError(_0x55e7da,null));};exports[_0x9be9('0x67')]=function(_0x2ad8fa,_0x289b10,_0x3a4404){var _0x718f49={'raw':![],'where':{}};var _0x32eb27={};var _0x5aeade={'count':0x0,'rows':[]};return db[_0x9be9('0x40')][_0x9be9('0x68')]({'where':{'id':_0x2ad8fa[_0x9be9('0x63')]['id']}})['then'](handleEntityNotFound(_0x289b10,null))[_0x9be9('0x36')](function(_0x16ebc2){if(_0x16ebc2){_0x32eb27[_0x9be9('0x45')]=_['keys'](db[_0x9be9('0x69')][_0x9be9('0x41')]);_0x32eb27['query']=_['keys'](_0x2ad8fa[_0x9be9('0x46')]);_0x32eb27[_0x9be9('0x4f')]=_['intersection'](_0x32eb27[_0x9be9('0x45')],_0x32eb27[_0x9be9('0x46')]);_0x718f49[_0x9be9('0x49')]=_['intersection'](_0x32eb27[_0x9be9('0x45')],qs[_0x9be9('0x4a')](_0x2ad8fa[_0x9be9('0x46')]['fields']));_0x718f49[_0x9be9('0x49')]=_0x718f49['attributes'][_0x9be9('0x4b')]?_0x718f49['attributes']:_0x32eb27['model'];if(!_0x2ad8fa['query'][_0x9be9('0x4c')](_0x9be9('0x4d'))){_0x718f49[_0x9be9('0x30')]=qs['limit'](_0x2ad8fa['query'][_0x9be9('0x30')]);_0x718f49[_0x9be9('0x2e')]=qs[_0x9be9('0x2e')](_0x2ad8fa[_0x9be9('0x46')][_0x9be9('0x2e')]);}_0x718f49[_0x9be9('0x6a')]=qs[_0x9be9('0x4e')](_0x2ad8fa[_0x9be9('0x46')][_0x9be9('0x4e')]);_0x718f49[_0x9be9('0x52')]=qs['filters'](_[_0x9be9('0x50')](_0x2ad8fa[_0x9be9('0x46')],_0x32eb27[_0x9be9('0x4f')]));_0x718f49['where'][_0x9be9('0x66')]=_0x16ebc2['id'];if(_0x2ad8fa[_0x9be9('0x46')][_0x9be9('0x53')]){_0x718f49[_0x9be9('0x52')]=_['merge'](_0x718f49[_0x9be9('0x52')],{'$or':_[_0x9be9('0x3f')](_0x718f49[_0x9be9('0x49')],function(_0x472912){var _0x446c44={};_0x446c44[_0x472912]={'$like':'%'+_0x2ad8fa['query'][_0x9be9('0x53')]+'%'};return _0x446c44;})});}_0x718f49=_[_0x9be9('0x51')]({},_0x718f49,_0x2ad8fa[_0x9be9('0x6b')]);return db[_0x9be9('0x69')][_0x9be9('0x54')]({'where':_0x718f49[_0x9be9('0x52')]})[_0x9be9('0x36')](function(_0x508efe){_0x5aeade[_0x9be9('0x54')]=_0x508efe;if(_0x2ad8fa['query'][_0x9be9('0x55')]){_0x718f49[_0x9be9('0x56')]=[{'all':!![]}];}return db[_0x9be9('0x69')][_0x9be9('0x6c')](_0x718f49);})[_0x9be9('0x36')](function(_0x24e8cc){_0x5aeade[_0x9be9('0x6d')]=_0x24e8cc;return _0x5aeade;});}})[_0x9be9('0x36')](respondWithFilteredResult(_0x289b10,_0x718f49))['catch'](handleError(_0x289b10,null));};exports[_0x9be9('0x6e')]=function(_0x574c32,_0x247ced,_0x389eec){return db[_0x9be9('0x40')][_0x9be9('0x59')]({'where':{'id':_0x574c32[_0x9be9('0x63')]['id']}})[_0x9be9('0x36')](handleEntityNotFound(_0x247ced,null))[_0x9be9('0x36')](function(_0x6e3625){if(_0x6e3625){return _0x6e3625[_0x9be9('0x6e')](_0x574c32['query'][_0x9be9('0x6f')]);}})[_0x9be9('0x36')](respondWithStatusCode(_0x247ced,null))['catch'](handleError(_0x247ced,null));};exports[_0x9be9('0x70')]=function(_0x568d58,_0x52ee11,_0x4888b9){if(_0x568d58[_0x9be9('0x5b')]['id']){delete _0x568d58['body']['id'];}return db[_0x9be9('0x40')][_0x9be9('0x59')]({'where':{'id':_0x568d58['params']['id']}})[_0x9be9('0x36')](handleEntityNotFound(_0x52ee11,null))['then'](function(_0x493c44){if(_0x493c44){_0x568d58[_0x9be9('0x5b')]['ChatWebsiteId']=_0x493c44['id'];return db[_0x9be9('0x71')]['create'](_0x568d58[_0x9be9('0x5b')]);}})['then'](respondWithResult(_0x52ee11,null))[_0x9be9('0x29')](handleError(_0x52ee11,null));};exports[_0x9be9('0x72')]=function(_0x2a8fbf,_0x4c7191,_0x24410d){var _0x470078={'raw':![],'where':{}};var _0x16da8d={};var _0x3741a6={'count':0x0,'rows':[]};return db[_0x9be9('0x40')][_0x9be9('0x68')]({'where':{'id':_0x2a8fbf[_0x9be9('0x63')]['id']}})[_0x9be9('0x36')](handleEntityNotFound(_0x4c7191,null))[_0x9be9('0x36')](function(_0x4aa35d){if(_0x4aa35d){_0x16da8d['model']=_[_0x9be9('0x47')](db[_0x9be9('0x71')]['rawAttributes']);_0x16da8d['query']=_[_0x9be9('0x47')](_0x2a8fbf[_0x9be9('0x46')]);_0x16da8d[_0x9be9('0x4f')]=_[_0x9be9('0x48')](_0x16da8d[_0x9be9('0x45')],_0x16da8d[_0x9be9('0x46')]);_0x470078[_0x9be9('0x49')]=_[_0x9be9('0x48')](_0x16da8d['model'],qs[_0x9be9('0x4a')](_0x2a8fbf[_0x9be9('0x46')][_0x9be9('0x4a')]));_0x470078[_0x9be9('0x49')]=_0x470078[_0x9be9('0x49')][_0x9be9('0x4b')]?_0x470078[_0x9be9('0x49')]:_0x16da8d[_0x9be9('0x45')];if(!_0x2a8fbf['query']['hasOwnProperty'](_0x9be9('0x4d'))){_0x470078[_0x9be9('0x30')]=qs[_0x9be9('0x30')](_0x2a8fbf[_0x9be9('0x46')][_0x9be9('0x30')]);_0x470078['offset']=qs[_0x9be9('0x2e')](_0x2a8fbf[_0x9be9('0x46')][_0x9be9('0x2e')]);}_0x470078[_0x9be9('0x6a')]=qs[_0x9be9('0x4e')](_0x2a8fbf['query']['sort']);_0x470078[_0x9be9('0x52')]=qs[_0x9be9('0x4f')](_[_0x9be9('0x50')](_0x2a8fbf[_0x9be9('0x46')],_0x16da8d[_0x9be9('0x4f')]));_0x470078[_0x9be9('0x52')][_0x9be9('0x66')]=_0x4aa35d['id'];if(_0x2a8fbf[_0x9be9('0x46')][_0x9be9('0x53')]){_0x470078[_0x9be9('0x52')]=_[_0x9be9('0x51')](_0x470078[_0x9be9('0x52')],{'$or':_[_0x9be9('0x3f')](_0x470078[_0x9be9('0x49')],function(_0x210269){var _0x1984b3={};_0x1984b3[_0x210269]={'$like':'%'+_0x2a8fbf[_0x9be9('0x46')][_0x9be9('0x53')]+'%'};return _0x1984b3;})});}_0x470078=_[_0x9be9('0x51')]({},_0x470078,_0x2a8fbf[_0x9be9('0x6b')]);return db[_0x9be9('0x71')][_0x9be9('0x54')]({'where':_0x470078[_0x9be9('0x52')]})[_0x9be9('0x36')](function(_0x4b2b7f){_0x3741a6['count']=_0x4b2b7f;if(_0x2a8fbf[_0x9be9('0x46')][_0x9be9('0x55')]){_0x470078['include']=[{'all':!![]}];}return db[_0x9be9('0x71')][_0x9be9('0x6c')](_0x470078);})[_0x9be9('0x36')](function(_0x1b741a){_0x3741a6[_0x9be9('0x6d')]=_0x1b741a;return _0x3741a6;});}})[_0x9be9('0x36')](respondWithFilteredResult(_0x4c7191,_0x470078))[_0x9be9('0x29')](handleError(_0x4c7191,null));};exports[_0x9be9('0x73')]=function(_0x3f7e0a,_0x1438e7,_0x1f1577){return db[_0x9be9('0x40')]['find']({'where':{'id':_0x3f7e0a[_0x9be9('0x63')]['id']}})[_0x9be9('0x36')](handleEntityNotFound(_0x1438e7,null))[_0x9be9('0x36')](function(_0x1be6ec){if(_0x1be6ec){return _0x1be6ec[_0x9be9('0x73')](_0x3f7e0a[_0x9be9('0x46')][_0x9be9('0x6f')]);}})[_0x9be9('0x36')](respondWithStatusCode(_0x1438e7,null))[_0x9be9('0x29')](handleError(_0x1438e7,null));};exports['addLogo']=function(_0x45ce95,_0x3c1c12,_0x294282){_0x45ce95[_0x9be9('0x5b')]['sitepic']=_0x45ce95['file'][_0x9be9('0x74')];return db[_0x9be9('0x40')][_0x9be9('0x59')]({'where':{'id':_0x45ce95['params']['id']}})[_0x9be9('0x36')](handleEntityNotFound(_0x3c1c12,null))[_0x9be9('0x36')](saveUpdates(_0x45ce95[_0x9be9('0x5b')],null))[_0x9be9('0x36')](respondWithResult(_0x3c1c12,null))[_0x9be9('0x29')](handleError(_0x3c1c12,null));};exports[_0x9be9('0x75')]=function(_0x928976,_0x10d329,_0x41d0d4){_0x928976[_0x9be9('0x5b')][_0x9be9('0x76')]=_0x928976[_0x9be9('0x77')][_0x9be9('0x74')];return db[_0x9be9('0x40')][_0x9be9('0x59')]({'where':{'id':_0x928976[_0x9be9('0x63')]['id']}})['then'](handleEntityNotFound(_0x10d329,null))[_0x9be9('0x36')](saveUpdates(_0x928976[_0x9be9('0x5b')],null))[_0x9be9('0x36')](respondWithResult(_0x10d329,null))[_0x9be9('0x29')](handleError(_0x10d329,null));};exports[_0x9be9('0x78')]=function(_0x551ac5,_0x43313e,_0x57f1ee){_0x551ac5[_0x9be9('0x5b')][_0x9be9('0x79')]=_0x551ac5[_0x9be9('0x77')]['filename'];return db['ChatWebsite']['find']({'where':{'id':_0x551ac5['params']['id']}})[_0x9be9('0x36')](handleEntityNotFound(_0x43313e,null))[_0x9be9('0x36')](saveUpdates(_0x551ac5[_0x9be9('0x5b')],null))[_0x9be9('0x36')](respondWithResult(_0x43313e,null))[_0x9be9('0x29')](handleError(_0x43313e,null));};exports[_0x9be9('0x7a')]=function(_0x49bf1c,_0x434130,_0x3e51e8){_0x49bf1c[_0x9be9('0x5b')][_0x9be9('0x7b')]=_0x49bf1c['file'][_0x9be9('0x74')];return db[_0x9be9('0x40')]['find']({'where':{'id':_0x49bf1c[_0x9be9('0x63')]['id']}})[_0x9be9('0x36')](handleEntityNotFound(_0x434130,null))[_0x9be9('0x36')](saveUpdates(_0x49bf1c['body'],null))[_0x9be9('0x36')](respondWithResult(_0x434130,null))[_0x9be9('0x29')](handleError(_0x434130,null));};exports[_0x9be9('0x7c')]=function(_0x34e12b,_0x1102b6,_0x578184){var _0x1eee74=path[_0x9be9('0x7d')](config['root'],_0x9be9('0x7e'));var _0x330abf={'where':{'id':_0x34e12b['params']['id']},'attributes':['id',_0x9be9('0x7f')],'raw':!![]};var _0x8390a=![];return require(_0x9be9('0x80'))['getLicense']()[_0x9be9('0x36')](function(_0x970f16){if(_0x970f16){_0x8390a=_0x970f16['custom'];}})['then'](function(){return db[_0x9be9('0x40')]['find'](_0x330abf);})[_0x9be9('0x36')](handleEntityNotFound(_0x1102b6,null))[_0x9be9('0x36')](function(_0x10c4e2){if(_0x10c4e2){if(!_[_0x9be9('0x81')](_0x10c4e2['sitepic'])){if(fs['existsSync'](path[_0x9be9('0x7d')](config[_0x9be9('0x82')],'server/files/images/logos/',_0x10c4e2['sitepic']))&&_0x8390a){_0x1eee74=path[_0x9be9('0x7d')](config[_0x9be9('0x82')],_0x9be9('0x83'),_0x10c4e2[_0x9be9('0x7f')]);}}return _0x1102b6['download'](_0x1eee74);}})[_0x9be9('0x29')](handleError(_0x1102b6,null));};exports[_0x9be9('0x84')]=function(_0x1c476c,_0x13bb07,_0x36ad45){var _0x1c16e5=path['join'](config[_0x9be9('0x82')],_0x9be9('0x85'));var _0x5d663e={'where':{'id':_0x1c476c[_0x9be9('0x63')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0x9be9('0x40')][_0x9be9('0x59')](_0x5d663e)['then'](handleEntityNotFound(_0x13bb07,null))[_0x9be9('0x36')](function(_0x1d1c89){if(_0x1d1c89){if(!_[_0x9be9('0x81')](_0x1d1c89[_0x9be9('0x76')])){if(fs[_0x9be9('0x86')](path[_0x9be9('0x7d')](config[_0x9be9('0x82')],'server/files/images/avatars/',_0x1d1c89[_0x9be9('0x76')]))){_0x1c16e5=path[_0x9be9('0x7d')](config['root'],_0x9be9('0x87'),_0x1d1c89['agentAvatar']);}}return _0x13bb07[_0x9be9('0x88')](_0x1c16e5);}})[_0x9be9('0x29')](handleError(_0x13bb07,null));};exports[_0x9be9('0x89')]=function(_0x56cbac,_0x333bb7,_0x83de1b){var _0x7bf1dd=path['join'](config[_0x9be9('0x82')],_0x9be9('0x8a'));var _0x4565ef={'where':{'id':_0x56cbac[_0x9be9('0x63')]['id']},'attributes':['id',_0x9be9('0x79'),'showCustomerAvatar'],'raw':!![]};return db[_0x9be9('0x40')][_0x9be9('0x59')](_0x4565ef)['then'](handleEntityNotFound(_0x333bb7,null))[_0x9be9('0x36')](function(_0x26b777){if(_0x26b777){if(!_[_0x9be9('0x81')](_0x26b777[_0x9be9('0x79')])){if(fs[_0x9be9('0x86')](path['join'](config[_0x9be9('0x82')],_0x9be9('0x87'),_0x26b777[_0x9be9('0x79')]))&&_0x26b777[_0x9be9('0x8b')]){_0x7bf1dd=path[_0x9be9('0x7d')](config[_0x9be9('0x82')],_0x9be9('0x87'),_0x26b777['customerAvatar']);}}return _0x333bb7[_0x9be9('0x88')](_0x7bf1dd);}})[_0x9be9('0x29')](handleError(_0x333bb7,null));};exports[_0x9be9('0x8c')]=function(_0x3515b1,_0x536c64,_0xcd9fbe){var _0xd1b779=path[_0x9be9('0x7d')](config[_0x9be9('0x82')],_0x9be9('0x8d'));var _0x53486b={'where':{'id':_0x3515b1[_0x9be9('0x63')]['id']},'attributes':['id',_0x9be9('0x7b')],'raw':!![]};return db[_0x9be9('0x40')][_0x9be9('0x59')](_0x53486b)[_0x9be9('0x36')](handleEntityNotFound(_0x536c64,null))[_0x9be9('0x36')](function(_0x254642){if(_0x254642){if(!_[_0x9be9('0x81')](_0x254642[_0x9be9('0x7b')])){if(fs['existsSync'](path[_0x9be9('0x7d')](config[_0x9be9('0x82')],_0x9be9('0x87'),_0x254642[_0x9be9('0x7b')]))){_0xd1b779=path[_0x9be9('0x7d')](config[_0x9be9('0x82')],_0x9be9('0x87'),_0x254642[_0x9be9('0x7b')]);}}return _0x536c64[_0x9be9('0x88')](_0xd1b779);}})[_0x9be9('0x29')](handleError(_0x536c64,null));};exports['notify']=function(_0x97bb54,_0x2044b6,_0x2d8395){var _0x412c68=require(_0x9be9('0x8e'));var _0x48aa15=new _0x412c68();var _0x1960f8=_0x48aa15[_0x9be9('0x8f')](_0x97bb54[_0x9be9('0x90')][_0x9be9('0x91')])[_0x9be9('0x92')]();var _0x4c8b9b={'body':_0x97bb54[_0x9be9('0x5b')],'channel':_0x9be9('0x93')};var _0x27d101=[];var _0x43f4bb=[];var _0x286a4a={};var _0x39dca3=![];return db['CmContact'][_0x9be9('0x64')]()['then'](function(_0x264361){if(!_0x264361){throw new db[(_0x9be9('0x94'))][(_0x9be9('0x95'))](_0x9be9('0x96'));}_0x27d101=_[_0x9be9('0x97')](_[_0x9be9('0x47')](_0x264361),[_0x9be9('0x98'),_0x9be9('0x99')]);_0x43f4bb=_[_0x9be9('0x97')](_[_0x9be9('0x47')](_0x264361),[_0x9be9('0x98'),_0x9be9('0x99'),_0x9be9('0x9a'),_0x9be9('0x9b')]);if(_0x97bb54[_0x9be9('0x5b')]['id']){delete _0x97bb54['body']['id'];}if(_[_0x9be9('0x81')](_0x97bb54[_0x9be9('0x5b')][_0x9be9('0x9c')])){throw new db['Sequelize']['ValidationError'](_0x9be9('0x9d'));}if(_[_0x9be9('0x81')](_0x97bb54[_0x9be9('0x5b')]['body'])||_0x97bb54[_0x9be9('0x5b')][_0x9be9('0x5b')]===''){throw new db[(_0x9be9('0x94'))][(_0x9be9('0x95'))](_0x9be9('0x9e'));}if(_['isNil'](_0x97bb54[_0x9be9('0x5b')][_0x9be9('0x9f')])){throw new db[(_0x9be9('0x94'))][(_0x9be9('0x95'))](_0x9be9('0xa0')+_0x43f4bb);}if(!_[_0x9be9('0xa1')](_0x43f4bb,_0x97bb54['body'][_0x9be9('0x9f')])){throw new db[(_0x9be9('0x94'))][(_0x9be9('0x95'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x43f4bb);}_0x286a4a[_0x97bb54[_0x9be9('0x5b')][_0x9be9('0x9f')]]=_0x97bb54[_0x9be9('0x5b')][_0x9be9('0x9c')];})[_0x9be9('0x36')](function(){return db[_0x9be9('0x40')]['find']({'where':{'id':_0x97bb54[_0x9be9('0x63')]['id']},'include':[{'model':db[_0x9be9('0xa2')],'as':_0x9be9('0xa3'),'include':[{'model':db['CmContact'],'as':_0x9be9('0xa4'),'where':_0x286a4a,'limit':0x1,'order':[['updatedAt',_0x9be9('0xa5')]]}]},{'model':db[_0x9be9('0xa6')],'as':_0x9be9('0xa7')}]});})[_0x9be9('0x36')](handleEntityNotFound(_0x2044b6,null))['then'](function(_0x3564e6){if(_0x3564e6&&_0x3564e6[_0x9be9('0xa3')]){_0x4c8b9b[_0x9be9('0xa8')]=_0x3564e6;_0x4c8b9b[_0x9be9('0xa9')]=_0x3564e6[_0x9be9('0xa7')];_0x4c8b9b[_0x9be9('0xaa')]=_0x3564e6[_0x9be9('0xa3')];_0x4c8b9b[_0x9be9('0xa9')]=_['orderBy'](_0x4c8b9b['applications'],['priority'],[_0x9be9('0xab')]);if(_0x4c8b9b[_0x9be9('0xa8')][_0x9be9('0xa7')]){delete _0x4c8b9b[_0x9be9('0xa8')][_0x9be9('0xa7')];}if(_0x4c8b9b[_0x9be9('0xa8')][_0x9be9('0xa3')]&&_0x4c8b9b['account'][_0x9be9('0xa3')][_0x9be9('0xa4')][_0x9be9('0x4b')]){return _0x4c8b9b[_0x9be9('0xa8')]['List']['Contacts'][0x0];}var _0x327ddf=_['defaults'](_0x97bb54[_0x9be9('0x5b')],{'firstName':_0x97bb54[_0x9be9('0x5b')][_0x9be9('0x9c')],'ListId':_0x3564e6[_0x9be9('0x9b')]});_0x327ddf[_0x97bb54[_0x9be9('0x5b')][_0x9be9('0x9f')]]=_0x97bb54[_0x9be9('0x5b')][_0x9be9('0x9c')];return db['CmContact'][_0x9be9('0x5a')](_0x327ddf,{'fields':_0x27d101,'raw':!![]});}})[_0x9be9('0x36')](handleEntityNotFound(_0x2044b6,null))[_0x9be9('0x36')](function(_0x3b324d){_0x4c8b9b[_0x9be9('0xac')]=_0x3b324d;var _0xf2658a=_0x97bb54[_0x9be9('0x5b')][_0x9be9('0xad')];if(_0x97bb54[_0x9be9('0x90')][_0x9be9('0xae')]){_0xf2658a=_0x97bb54[_0x9be9('0x90')][_0x9be9('0xae')];}else if(_0x97bb54[_0x9be9('0x90')]['x-forwarded-for']){_0xf2658a=_[_0x9be9('0xaf')](_0x97bb54[_0x9be9('0x90')][_0x9be9('0xb0')][_0x9be9('0xb1')](','));}if(_0x3b324d){var _0x33da00={'ContactId':_0x3b324d['id'],'ChatWebsiteId':_0x97bb54[_0x9be9('0x63')]['id'],'from':(_0x3b324d[_0x9be9('0xb2')]||'')+'\x20'+(_0x3b324d[_0x9be9('0xb3')]||''),'customerIp':_0xf2658a,'customerPort':_0x97bb54[_0x9be9('0x90')][_0x9be9('0xb4')]?_0x97bb54[_0x9be9('0x90')][_0x9be9('0xb4')]:null,'referer':_0x97bb54[_0x9be9('0x5b')][_0x9be9('0xb5')],'browserName':_0x1960f8[_0x9be9('0xb6')][_0x9be9('0x3c')]&&_0x1960f8[_0x9be9('0xb6')][_0x9be9('0xb7')]?util[_0x9be9('0xb8')](_0x9be9('0xb9'),_0x1960f8[_0x9be9('0xb6')][_0x9be9('0x3c')],_0x1960f8['browser'][_0x9be9('0xb7')]):'unknown','browserVersion':_0x1960f8['browser'][_0x9be9('0xb7')]||_0x9be9('0xba'),'osName':util[_0x9be9('0xb8')](_0x9be9('0xb9'),_0x1960f8['os'][_0x9be9('0x3c')],_0x1960f8['os'][_0x9be9('0xb7')]),'osVersion':_0x1960f8['os'][_0x9be9('0xb7')],'deviceModel':_0x1960f8['device']['model']&&_0x1960f8[_0x9be9('0xbb')][_0x9be9('0xbc')]?util[_0x9be9('0xb8')](_0x9be9('0xbd'),_0x1960f8[_0x9be9('0xbb')][_0x9be9('0x45')],_0x1960f8[_0x9be9('0xbb')][_0x9be9('0xbc')],_0x1960f8['device']['type']):null,'deviceVendor':_0x1960f8[_0x9be9('0xbb')][_0x9be9('0xbc')],'deviceType':_0x1960f8[_0x9be9('0xbb')][_0x9be9('0x43')],'formData':JSON['stringify'](_0x97bb54[_0x9be9('0x5b')])};var _0x54a08d={'ChatWebsiteId':_0x97bb54[_0x9be9('0x63')]['id'],'closed':![]};if(_0x97bb54[_0x9be9('0x5b')]['threadId']){_0x54a08d[_0x9be9('0xbe')]=_0x97bb54[_0x9be9('0x5b')][_0x9be9('0xbe')];return db[_0x9be9('0xbf')][_0x9be9('0x59')]({'where':_0x54a08d})['then'](function(_0x33e021){if(_0x33e021){return[_0x33e021,![]];}_0x33da00[_0x9be9('0xbe')]=_0x97bb54[_0x9be9('0x5b')][_0x9be9('0xbe')];_0x33da00[_0x9be9('0xc0')]=_0x97bb54[_0x9be9('0x5b')][_0x9be9('0xc0')];return db[_0x9be9('0xbf')][_0x9be9('0x5a')](_0x33da00)[_0x9be9('0x36')](function(_0x5c0259){return[_0x5c0259,!![]];});});}_0x54a08d[_0x9be9('0xc1')]=_0x3b324d['id'];if(_0x97bb54['body']['interaction']&&_0x97bb54[_0x9be9('0x5b')]['interaction']['id']){_0x54a08d['id']=_0x97bb54[_0x9be9('0x5b')][_0x9be9('0xc2')]['id'];return db[_0x9be9('0xbf')][_0x9be9('0x59')]({'where':_0x54a08d})['then'](function(_0xb93d8a){if(_0xb93d8a){return[_0xb93d8a,![]];}return db[_0x9be9('0xbf')][_0x9be9('0x5a')](_0x33da00)[_0x9be9('0x36')](function(_0x557b24){return[_0x557b24,!![]];});});}return db['ChatInteraction']['create'](_0x33da00)[_0x9be9('0x36')](function(_0x4b3838){return[_0x4b3838,!![]];});}})[_0x9be9('0xc3')](function(_0x1ea19b,_0x3ec850){if(_0x1ea19b){_0x39dca3=_0x3ec850;if(!_0x3ec850){var _0x371ca1={'from':(_0x4c8b9b[_0x9be9('0xac')][_0x9be9('0xb2')]||'')+'\x20'+(_0x4c8b9b['contact'][_0x9be9('0xb3')]||'')};if(_0x97bb54[_0x9be9('0x5b')]['threadId']&&_0x97bb54[_0x9be9('0x5b')]['messageId']&&_0x97bb54['body']['threadId']!=_0x97bb54[_0x9be9('0x5b')][_0x9be9('0xc4')]){_0x371ca1[_0x9be9('0xbe')]=_0x97bb54[_0x9be9('0x5b')][_0x9be9('0xc4')];}return _0x1ea19b[_0x9be9('0x35')](_0x371ca1);}else{return _0x1ea19b;}}})['then'](function(_0x24b7b2){_0x4c8b9b[_0x9be9('0xc2')]=_0x24b7b2[_0x9be9('0x38')]({'plain':!![]});_0x4c8b9b[_0x9be9('0xc2')][_0x9be9('0xc5')]=_0x39dca3;if(_0x4c8b9b[_0x9be9('0xc2')][_0x9be9('0xc5')]){if(_0x4c8b9b[_0x9be9('0xa8')][_0x9be9('0xc6')]){_0x4c8b9b[_0x9be9('0xa9')][_0x9be9('0xc7')]({'id':0x0,'priority':_0x4c8b9b['applications'][_0x9be9('0x4b')]+0x1,'app':_0x9be9('0xc8'),'appdata':'unmanaged','interval':_0x9be9('0xc9')});}}return db['ChatMessage'][_0x9be9('0x5a')]({'body':_0x97bb54[_0x9be9('0x5b')][_0x9be9('0x5b')],'ChatWebsiteId':_0x97bb54[_0x9be9('0x63')]['id'],'ChatInteractionId':_0x24b7b2['id'],'direction':'in','ContactId':_0x4c8b9b[_0x9be9('0xac')]['id'],'AttachmentId':_0x97bb54[_0x9be9('0x5b')]['AttachmentId']});})[_0x9be9('0x36')](function(_0x3afa4d){_0x4c8b9b[_0x9be9('0x27')]=_0x3afa4d;if(_0x4c8b9b[_0x9be9('0xc2')][_0x9be9('0xca')]){return db[_0x9be9('0xcb')]['find']({'attributes':['id',_0x9be9('0x3c')],'where':{'id':_0x4c8b9b[_0x9be9('0xc2')][_0x9be9('0xca')]}})[_0x9be9('0x36')](function(_0x428f25){if(_0x428f25){_0x4c8b9b[_0x9be9('0xa9')][_0x9be9('0xcc')]({'id':0x0,'priority':0x0,'app':_0x9be9('0xcd'),'appdata':_0x428f25['name']+','+(_0x4c8b9b[_0x9be9('0xa8')][_0x9be9('0xce')]||0xa),'interval':_0x9be9('0xc9')});_0x4c8b9b[_0x9be9('0xcf')]=!![];}return respondWithRpcPromise(_0x9be9('0xd0'),'startRouting',_0x4c8b9b);});}return respondWithRpcPromise(_0x9be9('0xd0'),_0x9be9('0xd1'),_0x4c8b9b);})[_0x9be9('0x36')](function(_0x21cb8f){respondWithRpcPromise(_0x9be9('0xd2'),_0x9be9('0xd2'),{'event':_0x9be9('0xd3'),'message':_0x21cb8f},client9002);return _0x21cb8f;})[_0x9be9('0x36')](respondWithResult(_0x2044b6,null))[_0x9be9('0x29')](handleError(_0x2044b6,null));};exports[_0x9be9('0xd4')]=function(_0x4b205c,_0x2bd7d9,_0x42482e){var _0x12a6a4,_0x440cde,_0x3abb8f;var _0x23ddc9=[];var _0x5df8ed=[];var _0x411bb2={};var _0x2d9d85=_0x4b205c['files']||[];var _0x17cbfc=[];var _0x2a95db;return db[_0x9be9('0xd5')][_0x9be9('0x64')]()[_0x9be9('0x36')](function(_0x4537e5){if(!_0x4537e5){throw new db[(_0x9be9('0x94'))][(_0x9be9('0x95'))](_0x9be9('0x96'));}_0x5df8ed=_[_0x9be9('0x97')](_[_0x9be9('0x47')](_0x4537e5),['createdAt',_0x9be9('0x99')]);_0x23ddc9=_[_0x9be9('0x97')](_[_0x9be9('0x47')](_0x4537e5),[_0x9be9('0x98'),_0x9be9('0x99'),_0x9be9('0x9a'),_0x9be9('0x9b')]);if(_0x4b205c[_0x9be9('0x5b')]['id']){delete _0x4b205c[_0x9be9('0x5b')]['id'];}if(_['isNil'](_0x4b205c['body'][_0x9be9('0x9c')])){throw _0x2bd7d9[_0x9be9('0x2b')](0x1f4)[_0x9be9('0x3d')](new db[(_0x9be9('0x94'))][(_0x9be9('0x95'))](_0x9be9('0x9d')));}if(_[_0x9be9('0x81')](_0x4b205c[_0x9be9('0x5b')]['body'])||_0x4b205c[_0x9be9('0x5b')][_0x9be9('0x5b')]===''){throw _0x2bd7d9[_0x9be9('0x2b')](0x1f4)[_0x9be9('0x3d')](new db[(_0x9be9('0x94'))][(_0x9be9('0x95'))]('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0x9be9('0x81')](_0x4b205c[_0x9be9('0x5b')][_0x9be9('0xd6')])){throw _0x2bd7d9[_0x9be9('0x2b')](0x1f4)['send'](new db[(_0x9be9('0x94'))]['ValidationError'](_0x9be9('0xd7')+_0x23ddc9));}if(!_[_0x9be9('0xa1')](_0x23ddc9,_0x4b205c[_0x9be9('0x5b')][_0x9be9('0xd6')])){throw _0x2bd7d9[_0x9be9('0x2b')](0x1f4)[_0x9be9('0x3d')](new db[(_0x9be9('0x94'))][(_0x9be9('0x95'))](_0x9be9('0xd8')+_0x23ddc9));}_0x411bb2[_0x4b205c['body'][_0x9be9('0xd6')]]=_0x4b205c[_0x9be9('0x5b')][_0x9be9('0x9c')];})[_0x9be9('0x36')](function(){return db[_0x9be9('0x40')][_0x9be9('0x59')]({'where':{'id':_0x4b205c[_0x9be9('0x63')]['id']},'include':[{'model':db[_0x9be9('0xa2')],'as':_0x9be9('0xa3')},{'model':db[_0x9be9('0xd9')],'as':_0x9be9('0xd9')}]});})['then'](handleEntityNotFound(_0x2bd7d9,null))[_0x9be9('0x36')](function(_0x27e1dc){if(_0x27e1dc&&_0x27e1dc[_0x9be9('0xa3')]){_0x440cde=_0x27e1dc;var _0x165a41=_[_0x9be9('0xda')](_0x4b205c[_0x9be9('0x5b')],{'firstName':_0x4b205c[_0x9be9('0x5b')]['from'],'phone':_0x4b205c[_0x9be9('0x5b')]['from'],'ListId':_0x27e1dc[_0x9be9('0x9b')]});_0x165a41[_0x4b205c['body'][_0x9be9('0xd6')]]=_0x4b205c[_0x9be9('0x5b')]['from'];return db[_0x9be9('0xd5')][_0x9be9('0xdb')]({'where':_0x411bb2,'defaults':_0x165a41});}})[_0x9be9('0xc3')](function(_0x1a9bf4){if(_0x1a9bf4){_0x3abb8f=_0x1a9bf4;var _0x4e306c=fs[_0x9be9('0xdc')](path[_0x9be9('0x7d')](config['root'],_0x9be9('0xdd')),_0x9be9('0xde'));var _0x269f14=ejs['render'](_0x4e306c,{'body':_[_0x9be9('0xdf')](_0x4b205c[_0x9be9('0x5b')]['body']),'bodyTitle':_0x440cde['offlineMessageBody']});return db[_0x9be9('0xe0')]['create']({'body':_0x269f14,'ContactId':_0x1a9bf4['id'],'ChatWebsiteId':_0x440cde['id']});}})['then'](function(_0x3ccc1e){_0x2a95db=_0x3ccc1e;if(_0x2d9d85[_0x9be9('0x4b')]){var _0xa597fe=_0x2d9d85[_0x9be9('0x3f')](function(_0x1aa1d7){return{'name':_0x1aa1d7[_0x9be9('0xe1')],'basename':_0x1aa1d7['filename'],'type':_0x1aa1d7[_0x9be9('0xe2')],'ChatOfflineMessageId':_0x3ccc1e['id']};});_0x17cbfc=_0xa597fe[_0x9be9('0x3f')](_0x235a78=>{var _0x356e80={'filename':_0x235a78[_0x9be9('0x3c')],'path':path[_0x9be9('0x7d')](config[_0x9be9('0x82')],_0x9be9('0xe3'),_0x9be9('0xe4'),_0x9be9('0xe5'),_0x9be9('0xe6'),_0x235a78[_0x9be9('0xe7')])};return _0x356e80;});if(!_0x440cde[_0x9be9('0xe8')]){return db[_0x9be9('0xe9')]['transaction'](function(_0xfb86fd){return db[_0x9be9('0xea')][_0x9be9('0xeb')](_0xa597fe,{'transaction':_0xfb86fd});});}}})[_0x9be9('0x36')](function(){if(_0x2a95db){_0x12a6a4=_0x2a95db;return db[_0x9be9('0xd9')][_0x9be9('0x68')]({'where':{'active':!![]},'include':[{'model':db[_0x9be9('0xec')],'as':'Smtp','raw':!![]}]});}})[_0x9be9('0x36')](function(_0x23e95f){if(_0x23e95f&&_0x23e95f['Smtp']&&_0x440cde[_0x9be9('0xed')]&&_0x440cde[_0x9be9('0xee')]){var _0x4a2fbb={'tls':{'rejectUnauthorized':![]}};if(_0x23e95f[_0x9be9('0xef')][_0x9be9('0xf0')]){_0x4a2fbb['service']=_0x23e95f['Smtp'][_0x9be9('0xf0')];}else{_0x4a2fbb[_0x9be9('0xf1')]=_0x23e95f[_0x9be9('0xef')][_0x9be9('0xf1')];_0x4a2fbb['port']=_0x23e95f['Smtp'][_0x9be9('0xf2')];_0x4a2fbb[_0x9be9('0xf3')]=_0x23e95f[_0x9be9('0xef')][_0x9be9('0xf3')];}if(_0x23e95f[_0x9be9('0xef')]['authentication']){_0x4a2fbb[_0x9be9('0xf4')]={'user':_0x23e95f[_0x9be9('0xef')]['user'],'pass':_0x23e95f['Smtp'][_0x9be9('0xf5')]};}return respondWithRpcPromise('SendMail',_0x9be9('0xf6'),{'account':_0x4a2fbb,'message':{'from':util['format'](_0x9be9('0xf7'),_0x23e95f[_0x9be9('0x3c')],_0x23e95f[_0x9be9('0xf8')]||_0x23e95f['Smtp'][_0x9be9('0x5e')]),'to':_0x440cde[_0x9be9('0xee')],'subject':_0x440cde['offlineMessageSubject'],'html':_0x12a6a4[_0x9be9('0x5b')],'attachments':_0x17cbfc}},client9003)[_0x9be9('0x36')](function(){return _0x12a6a4;})[_0x9be9('0x29')](function(_0x530b58){console[_0x9be9('0x24')](_0x530b58);});}})[_0x9be9('0x36')](function(){if(_0x440cde&&_0x440cde[_0x9be9('0xe8')]&&_0x440cde['MailAccountId']){var _0x1d9c1c=[];if(_0x2d9d85[_0x9be9('0x4b')]){_0x1d9c1c=_0x2d9d85[_0x9be9('0x3f')](function(_0x394a4e){return{'name':_0x394a4e[_0x9be9('0xe1')],'basename':_0x394a4e[_0x9be9('0x74')],'type':_0x394a4e[_0x9be9('0xe2')],'ChatOfflineMessageId':_0x2a95db['id']};});}var _0x4c6964;if(!_[_0x9be9('0x81')](_0x440cde[_0x9be9('0xf9')])){var _0x25f6c7=_[_0x9be9('0x3f')](_0x4b205c['body'],function(_0x56e090){return _0x56e090;});var _0x2db9e3=_[_0x9be9('0xfa')](_0x25f6c7)[0x0];var _0x1f8b2f=_['mapValues'](_0x2db9e3,function(_0x2f95b8){return _0x2f95b8;});_0x4c6964=_0x1f8b2f[0x1][_0x440cde['subjectOffline']];}var _0x30ddbf={'from':_0x3abb8f['email'],'firstName':_0x3abb8f[_0x9be9('0xb2')],'lastName':_0x3abb8f[_0x9be9('0xb3')],'mapKey':'email','message':{'from':_0x3abb8f[_0x9be9('0xf8')],'to':_0x440cde['MailAccount'][_0x9be9('0xf8')],'cc':'','subject':_['isNil'](_0x4c6964)?_0x440cde[_0x9be9('0xfb')]:_0x4c6964,'messageId':'','sentAt':new Date(),'attach':_0x1d9c1c['length'],'attachments':_0x1d9c1c,'originChannel':'Chat','ChatWebsiteId':_0x440cde['id'],'ChatOfflineMessageId':_0x12a6a4['id'],'originTo':_0x440cde[_0x9be9('0xd9')]['email']},'body':_0x12a6a4['body']};var _0x3d485={'account':{'id':_0x440cde[_0x9be9('0xfc')]},'body':_0x30ddbf,'log':'NotifyMailAccount'};return respondWithRpcPromise(_0x9be9('0xfd'),_0x9be9('0xfe'),_0x3d485,client9001)['then'](function(){return _0x12a6a4;})['catch'](function(_0x318006){console[_0x9be9('0x24')](_0x318006);});}return;})['then'](function(){if(_0x12a6a4){return _0x12a6a4;}})[_0x9be9('0x36')](respondWithResult(_0x2bd7d9,null))[_0x9be9('0x29')](function(_0x5a852b){console['error']('catch',_0x5a852b);for(var _0x5e6295 of _0x2d9d85){var _0x2decf2=path['join'](config[_0x9be9('0x82')],_0x9be9('0xe3'),_0x9be9('0xe4'),_0x9be9('0xe5'),'offline-chat',_0x5e6295['filename']);fs_extra[_0x9be9('0xff')](_0x2decf2)[_0x9be9('0x29')](function(_0x4db58e){console[_0x9be9('0x24')](_0x9be9('0x100'),_0x2decf2,_0x4db58e);});}});};exports['addInteraction']=function(_0x18ca89,_0x51c59b,_0x25dcc0){return db['ChatInteraction'][_0x9be9('0x59')]({'where':{'id':_0x18ca89[_0x9be9('0x63')]['id']}})['then'](handleEntityNotFound(_0x51c59b,null))[_0x9be9('0x36')](function(_0x4102fb){if(_0x4102fb){return _0x4102fb[_0x9be9('0x101')](_0x18ca89[_0x9be9('0x5b')]['ids'],_[_0x9be9('0x102')](_0x18ca89[_0x9be9('0x5b')],[_0x9be9('0x6f'),'id'])||{});}})[_0x9be9('0x36')](respondWithResult(_0x51c59b,null))[_0x9be9('0x29')](handleError(_0x51c59b,null));};exports[_0x9be9('0x103')]=function(_0x2f2009,_0x8dd88,_0x2abd16){var _0x4b66ba={'raw':![],'where':{}};var _0x272393={};var _0x35d55b={'count':0x0,'rows':[]};return db[_0x9be9('0x40')]['findOne']({'where':{'id':_0x2f2009[_0x9be9('0x63')]['id']}})[_0x9be9('0x36')](handleEntityNotFound(_0x8dd88,null))[_0x9be9('0x36')](function(_0x489d08){if(_0x489d08){_0x272393[_0x9be9('0x45')]=_[_0x9be9('0x47')](db[_0x9be9('0xbf')]['rawAttributes']);_0x272393[_0x9be9('0x46')]=_['keys'](_0x2f2009[_0x9be9('0x46')]);_0x272393[_0x9be9('0x4f')]=_['intersection'](_0x272393[_0x9be9('0x45')],_0x272393[_0x9be9('0x46')]);_0x4b66ba[_0x9be9('0x49')]=_[_0x9be9('0x48')](_0x272393[_0x9be9('0x45')],qs[_0x9be9('0x4a')](_0x2f2009[_0x9be9('0x46')][_0x9be9('0x4a')]));_0x4b66ba[_0x9be9('0x49')]=_0x4b66ba[_0x9be9('0x49')]['length']?_0x4b66ba[_0x9be9('0x49')]:_0x272393[_0x9be9('0x45')];if(!_0x2f2009[_0x9be9('0x46')]['hasOwnProperty']('nolimit')){_0x4b66ba[_0x9be9('0x30')]=qs[_0x9be9('0x30')](_0x2f2009[_0x9be9('0x46')][_0x9be9('0x30')]);_0x4b66ba[_0x9be9('0x2e')]=qs[_0x9be9('0x2e')](_0x2f2009[_0x9be9('0x46')][_0x9be9('0x2e')]);}_0x4b66ba['order']=qs['sort'](_0x2f2009[_0x9be9('0x46')][_0x9be9('0x4e')]);_0x4b66ba['where']=qs['filters'](_[_0x9be9('0x50')](_0x2f2009[_0x9be9('0x46')],_0x272393[_0x9be9('0x4f')]));_0x4b66ba[_0x9be9('0x52')][_0x9be9('0x66')]=_0x489d08['id'];if(_0x2f2009[_0x9be9('0x46')]['filter']){_0x4b66ba[_0x9be9('0x52')]=_['merge'](_0x4b66ba[_0x9be9('0x52')],{'$or':_['map'](_0x4b66ba[_0x9be9('0x49')],function(_0x4a492e){var _0x23c966={};_0x23c966[_0x4a492e]={'$like':'%'+_0x2f2009['query'][_0x9be9('0x53')]+'%'};return _0x23c966;})});}_0x4b66ba=_[_0x9be9('0x51')]({},_0x4b66ba,_0x2f2009[_0x9be9('0x6b')]);return db['ChatInteraction']['count']({'where':_0x4b66ba[_0x9be9('0x52')]})['then'](function(_0x524f59){_0x35d55b[_0x9be9('0x54')]=_0x524f59;if(_0x2f2009['query'][_0x9be9('0x55')]){_0x4b66ba['include']=[{'model':db['CmContact'],'as':_0x9be9('0x104'),'required':![]},{'model':db['User'],'as':_0x9be9('0x105'),'attributes':[_0x9be9('0x3c'),_0x9be9('0x106'),_0x9be9('0x107')],'required':![]},{'model':db[_0x9be9('0x108')],'as':_0x9be9('0x109'),'attributes':['id',_0x9be9('0x3c'),'color'],'where':_0x2f2009[_0x9be9('0x46')][_0x9be9('0x10a')]?{'id':_0x2f2009[_0x9be9('0x46')][_0x9be9('0x10a')]}:undefined,'required':_0x2f2009['query'][_0x9be9('0x10a')]?!![]:![]}];}return db['ChatInteraction'][_0x9be9('0x6c')](_0x4b66ba);})['then'](function(_0x3eccfc){_0x35d55b[_0x9be9('0x6d')]=_0x3eccfc;return _0x35d55b;});}})['then'](respondWithFilteredResult(_0x8dd88,_0x4b66ba))[_0x9be9('0x29')](handleError(_0x8dd88,null));};function iftimePromise(_0x224218,_0x11cb0b){return respondWithRpcPromise(_0x9be9('0x10b'),_0x9be9('0x10c'),{'command':_0x11cb0b['timezone']?util[_0x9be9('0xb8')]('iftime\x20%s,%s',_0x224218[_0x9be9('0x10d')],_0x11cb0b['timezone']):util['format'](_0x9be9('0x10e'),_0x224218['interval'])},client9002)[_0x9be9('0x36')](function(_0x5e4964){var _0x3e56a1=_0x5e4964&&_0x5e4964[_0x9be9('0x10f')](_0x9be9('0x110'))>=0x0?!![]:![];logger[_0x9be9('0x20')](_0x9be9('0x111'),_0x11cb0b['id'],_0x224218['id'],_0x224218[_0x9be9('0x10d')],_0x3e56a1?'ONLINE':_0x9be9('0x112'),_0x11cb0b[_0x9be9('0x113')]?_0x11cb0b[_0x9be9('0x113')]:_0x9be9('0x114'));return _0x3e56a1;})[_0x9be9('0x29')](function(_0x11b754){logger['error'](_0x9be9('0x111'),_0x11cb0b['id'],_0x224218['id'],_0x224218[_0x9be9('0x10d')],util[_0x9be9('0x115')](_0x11b754,{'showHidden':![],'depth':null}),_0x11cb0b['timezone']?_0x11cb0b[_0x9be9('0x113')]:'No\x20timezone');return![];});}exports['getSnippet']=function(_0x50bd8c,_0x303523,_0x23f8db){var _0x9b2508=0x0;var _0x3e2c04=0x0;var _0x32b68e=![];var _0x141c12;var _0x419129;return db[_0x9be9('0x40')]['find']({'where':{'id':_0x50bd8c['params']['id']},'include':[{'model':db[_0x9be9('0x116')],'as':_0x9be9('0x116'),'include':[{'model':db[_0x9be9('0x116')],'as':'Intervals','attributes':['id',_0x9be9('0x10d')],'raw':!![]}]}]})[_0x9be9('0x36')](handleEntityNotFound(_0x303523,null))[_0x9be9('0x36')](function(_0x475f40){if(_0x475f40){_0x141c12=_0x475f40;return _0x475f40[_0x9be9('0x117')]({'raw':!![]});}})[_0x9be9('0x36')](function(_0x3b29e4){if(_0x141c12){if(_0x3b29e4){_0x419129=_0x3b29e4;}}return require(_0x9be9('0x80'))[_0x9be9('0x118')]();})[_0x9be9('0x36')](function(_0x817346){if(_0x817346){_0x3e2c04=_0x817346[_0x9be9('0x119')];_0x32b68e=_0x817346[_0x9be9('0x11a')];}})[_0x9be9('0x36')](function(){return db[_0x9be9('0xbf')][_0x9be9('0x54')]({'where':{'closed':![]}});})[_0x9be9('0x36')](function(_0x495eb9){_0x9b2508=_0x495eb9;if(_0x3e2c04&&_0x495eb9>_0x3e2c04){return db[_0x9be9('0x11b')][_0x9be9('0x68')]({'where':{'id':0x1}})[_0x9be9('0x36')](function(_0x5192f4){if(_0x5192f4){_0x5192f4[_0x9be9('0x11c')]('chatLicenseExceeded');}});}})['then'](function(){if(_0x141c12[_0x9be9('0x116')]&&_0x141c12[_0x9be9('0x116')][_0x9be9('0x11d')]){var _0xe7e464=[];for(var _0x333079=0x0;_0x333079<_0x141c12[_0x9be9('0x116')]['Intervals'][_0x9be9('0x4b')];_0x333079++){var _0x16a461=_0x141c12[_0x9be9('0x116')][_0x9be9('0x11d')][_0x333079][_0x9be9('0x38')]({'plain':!![]});_0xe7e464[_0x9be9('0xc7')](iftimePromise(_0x16a461,_0x141c12));}return BPromise[_0x9be9('0x11e')](_0xe7e464)[_0x9be9('0x36')](function(_0x459b46){return _[_0x9be9('0x11f')](_0x459b46);});}else{return!![];}})[_0x9be9('0x36')](function(_0x1c0bc9){var _0x2d9db5=fs[_0x9be9('0xdc')](path[_0x9be9('0x7d')](config[_0x9be9('0x82')],_0x9be9('0x120')),_0x9be9('0xde'));var _0x4bfc93={'remote':_0x141c12[_0x9be9('0x121')],'query':querystring['stringify'](_[_0x9be9('0x51')](_0x141c12['get']({'plain':!![]}),{'customerIp':_0x50bd8c[_0x9be9('0x90')][_0x9be9('0xb0')]||_0x50bd8c[_0x9be9('0x90')][_0x9be9('0x122')]||_0x50bd8c[_0x9be9('0x123')][_0x9be9('0x124')]||_0x50bd8c['ip'],'referer':_0x50bd8c[_0x9be9('0x90')]['referer'],'openedInteractions':_0x9b2508,'maxInteractions':_0x3e2c04,'virtual':_0x32b68e[_0x9be9('0x119')],'online':_0x1c0bc9,'custom':_0x32b68e}))['replace'](/'/g,'\x5c\x27')};_0x303523['send'](ejs[_0x9be9('0x125')](Mustache[_0x9be9('0x125')](_0x2d9db5,_0x4bfc93),{'proactiveActions':_0x419129,'alignment':_0x141c12[_0x9be9('0x126')],'verticalAlignment':_0x141c12['verticalAlignment'],'div_color':_0x141c12[_0x9be9('0x127')],'text_color':_0x141c12[_0x9be9('0x128')],'button_color':_0x141c12[_0x9be9('0x129')],'background_color':_0x141c12[_0x9be9('0x12a')]}));})[_0x9be9('0x29')](handleError(_0x303523,null));};exports[_0x9be9('0x12b')]=function(_0x23c267,_0x4a4044,_0x47662f){return db[_0x9be9('0x40')][_0x9be9('0x68')]({'where':{'id':_0x23c267[_0x9be9('0x63')]['id']}})[_0x9be9('0x36')](handleEntityNotFound(_0x4a4044,null))[_0x9be9('0x36')](function(_0x1a9ed9){if(_0x1a9ed9){return db[_0x9be9('0xe9')][_0x9be9('0x12c')](function(_0x5f1155){return db[_0x9be9('0xa6')]['destroy']({'where':{'ChatWebsiteId':_0x23c267[_0x9be9('0x63')]['id']},'transaction':_0x5f1155})[_0x9be9('0x36')](function(_0x48c087){var _0x333180=_['map'](_0x23c267['body'],function(_0x180458){_0x180458[_0x9be9('0x66')]=_0x23c267[_0x9be9('0x63')]['id'];return _0x180458;});return db[_0x9be9('0xa6')][_0x9be9('0xeb')](_0x333180,{'transaction':_0x5f1155});});})['then'](function(){return db[_0x9be9('0xa6')][_0x9be9('0x12d')]({'where':{'ChatWebsiteId':_0x23c267[_0x9be9('0x63')]['id']},'order':_0x9be9('0x12e')});});}})[_0x9be9('0x36')](respondWithResult(_0x4a4044,null))['catch'](handleError(_0x4a4044,null));};exports[_0x9be9('0x12f')]=function(_0x110176,_0x5ad96f,_0x5f2e52){var _0x3d900c={};var _0x2de644={};var _0x2b493c;var _0x511b77;return db[_0x9be9('0x40')]['findOne']({'where':{'id':_0x110176[_0x9be9('0x63')]['id']}})[_0x9be9('0x36')](handleEntityNotFound(_0x5ad96f,null))[_0x9be9('0x36')](function(_0x1bb6d8){if(_0x1bb6d8){_0x2b493c=_0x1bb6d8;_0x2de644[_0x9be9('0x45')]=_[_0x9be9('0x47')](db[_0x9be9('0xa6')][_0x9be9('0x41')]);_0x2de644[_0x9be9('0x46')]=_['keys'](_0x110176[_0x9be9('0x46')]);_0x2de644['filters']=_[_0x9be9('0x48')](_0x2de644[_0x9be9('0x45')],_0x2de644[_0x9be9('0x46')]);_0x3d900c[_0x9be9('0x49')]=_[_0x9be9('0x48')](_0x2de644[_0x9be9('0x45')],qs[_0x9be9('0x4a')](_0x110176['query']['fields']));_0x3d900c['attributes']=_0x3d900c[_0x9be9('0x49')]['length']?_0x3d900c[_0x9be9('0x49')]:_0x2de644['model'];_0x3d900c['order']=qs[_0x9be9('0x4e')](_0x110176[_0x9be9('0x46')][_0x9be9('0x4e')]);_0x3d900c[_0x9be9('0x52')]=qs[_0x9be9('0x4f')](_[_0x9be9('0x50')](_0x110176[_0x9be9('0x46')],_0x2de644[_0x9be9('0x4f')]));if(_0x110176[_0x9be9('0x46')][_0x9be9('0x53')]){_0x3d900c[_0x9be9('0x52')]=_[_0x9be9('0x51')](_0x3d900c['where'],{'$or':_[_0x9be9('0x3f')](_0x3d900c[_0x9be9('0x49')],function(_0x4e2708){var _0x23ec28={};_0x23ec28[_0x4e2708]={'$like':'%'+_0x110176[_0x9be9('0x46')][_0x9be9('0x53')]+'%'};return _0x23ec28;})});}_0x3d900c=_['merge']({},_0x3d900c,_0x110176['options']);return _0x2b493c['getApplications'](_0x3d900c);}})['then'](function(_0x4fc2f1){if(_0x4fc2f1){_0x511b77=_0x4fc2f1[_0x9be9('0x4b')];if(!_0x110176[_0x9be9('0x46')][_0x9be9('0x4c')](_0x9be9('0x4d'))){_0x3d900c['limit']=qs[_0x9be9('0x30')](_0x110176[_0x9be9('0x46')][_0x9be9('0x30')]);_0x3d900c['offset']=qs[_0x9be9('0x2e')](_0x110176[_0x9be9('0x46')]['offset']);}return _0x2b493c[_0x9be9('0x12f')](_0x3d900c);}})['then'](function(_0x3e666b){if(_0x3e666b){return _0x3e666b?{'count':_0x511b77,'rows':_0x3e666b}:null;}})[_0x9be9('0x36')](respondWithResult(_0x5ad96f,null))['catch'](handleError(_0x5ad96f,null));};exports['addProactiveActions']=function(_0x4af8f5,_0xa65e23,_0xd7ecdc){return db[_0x9be9('0x130')]['find']({'where':{'id':_0x4af8f5['params']['id']}})[_0x9be9('0x36')](handleEntityNotFound(_0xa65e23,null))[_0x9be9('0x36')](function(_0x516ae4){if(_0x516ae4){return _0x516ae4[_0x9be9('0x131')](_0x4af8f5[_0x9be9('0x5b')][_0x9be9('0x6f')],_[_0x9be9('0x102')](_0x4af8f5[_0x9be9('0x5b')],[_0x9be9('0x6f'),'id'])||{});}})[_0x9be9('0x36')](respondWithResult(_0xa65e23,null))[_0x9be9('0x29')](handleError(_0xa65e23,null));};exports[_0x9be9('0x117')]=function(_0x2784b8,_0xc7ac46,_0x17cfbe){var _0x358ceb={};var _0x168a0e={};var _0x397200;var _0x144436;return db['ChatWebsite']['findOne']({'where':{'id':_0x2784b8[_0x9be9('0x63')]['id']}})[_0x9be9('0x36')](handleEntityNotFound(_0xc7ac46,null))[_0x9be9('0x36')](function(_0x4b4236){if(_0x4b4236){_0x397200=_0x4b4236;_0x168a0e[_0x9be9('0x45')]=_['keys'](db['ChatProactiveAction']['rawAttributes']);_0x168a0e['query']=_['keys'](_0x2784b8[_0x9be9('0x46')]);_0x168a0e['filters']=_[_0x9be9('0x48')](_0x168a0e['model'],_0x168a0e[_0x9be9('0x46')]);_0x358ceb['attributes']=_[_0x9be9('0x48')](_0x168a0e[_0x9be9('0x45')],qs[_0x9be9('0x4a')](_0x2784b8[_0x9be9('0x46')]['fields']));_0x358ceb[_0x9be9('0x49')]=_0x358ceb[_0x9be9('0x49')][_0x9be9('0x4b')]?_0x358ceb[_0x9be9('0x49')]:_0x168a0e[_0x9be9('0x45')];_0x358ceb[_0x9be9('0x6a')]=qs[_0x9be9('0x4e')](_0x2784b8[_0x9be9('0x46')][_0x9be9('0x4e')]);_0x358ceb[_0x9be9('0x52')]=qs[_0x9be9('0x4f')](_[_0x9be9('0x50')](_0x2784b8[_0x9be9('0x46')],_0x168a0e[_0x9be9('0x4f')]));if(_0x2784b8[_0x9be9('0x46')][_0x9be9('0x53')]){_0x358ceb[_0x9be9('0x52')]=_[_0x9be9('0x51')](_0x358ceb[_0x9be9('0x52')],{'$or':_[_0x9be9('0x3f')](_0x358ceb['attributes'],function(_0xd7d520){var _0x678d71={};_0x678d71[_0xd7d520]={'$like':'%'+_0x2784b8[_0x9be9('0x46')]['filter']+'%'};return _0x678d71;})});}_0x358ceb=_[_0x9be9('0x51')]({},_0x358ceb,_0x2784b8[_0x9be9('0x6b')]);return _0x397200[_0x9be9('0x117')](_0x358ceb);}})[_0x9be9('0x36')](function(_0x46571a){if(_0x46571a){_0x144436=_0x46571a[_0x9be9('0x4b')];if(!_0x2784b8[_0x9be9('0x46')][_0x9be9('0x4c')]('nolimit')){_0x358ceb[_0x9be9('0x30')]=qs['limit'](_0x2784b8[_0x9be9('0x46')]['limit']);_0x358ceb[_0x9be9('0x2e')]=qs[_0x9be9('0x2e')](_0x2784b8['query'][_0x9be9('0x2e')]);}return _0x397200[_0x9be9('0x117')](_0x358ceb);}})[_0x9be9('0x36')](function(_0xb44127){if(_0xb44127){return _0xb44127?{'count':_0x144436,'rows':_0xb44127}:null;}})[_0x9be9('0x36')](respondWithResult(_0xc7ac46,null))[_0x9be9('0x29')](handleError(_0xc7ac46,null));};exports[_0x9be9('0x132')]=function(_0x124044,_0x18ac58,_0x1cba61){var _0x512c59=_0x124044['query'][_0x9be9('0x133')]===_0x9be9('0x134')?'offlineForm':_0x9be9('0x135');return db['ChatWebsite']['find']({'attributes':['id',_0x512c59],'where':{'id':_0x124044[_0x9be9('0x63')]['id']}})[_0x9be9('0x36')](handleEntityNotFound(_0x18ac58,null))['then'](function(_0x1eb3bc){if(_0x1eb3bc){var _0x4fd12b=_0x1eb3bc[_0x512c59];var _0x3fd53e=_0x4fd12b&&_0x4fd12b['items']?_0x4fd12b['items']:[];_0x18ac58[_0x9be9('0x3d')]({'fromKey':_[_0x9be9('0x81')](_0x4fd12b[_0x9be9('0x136')])?undefined:_0x4fd12b[_0x9be9('0x136')],'count':_0x3fd53e[_0x9be9('0x4b')],'rows':_0x3fd53e});}})[_0x9be9('0x29')](handleError(_0x18ac58,null));};exports[_0x9be9('0x137')]=function(_0x320ef0,_0x26184e,_0x5a4af6){var _0x345cda={'raw':![],'where':{}};var _0x280522={};var _0x293e45={'count':0x0,'rows':[]};return db[_0x9be9('0x40')]['findOne']({'where':{'id':_0x320ef0[_0x9be9('0x63')]['id']}})['then'](handleEntityNotFound(_0x26184e,null))[_0x9be9('0x36')](function(_0x286623){if(_0x286623){_0x280522['model']=_[_0x9be9('0x47')](db[_0x9be9('0xe0')][_0x9be9('0x41')]);_0x280522[_0x9be9('0x46')]=_[_0x9be9('0x47')](_0x320ef0[_0x9be9('0x46')]);_0x280522[_0x9be9('0x4f')]=_['intersection'](_0x280522[_0x9be9('0x45')],_0x280522[_0x9be9('0x46')]);_0x345cda[_0x9be9('0x49')]=_['intersection'](_0x280522[_0x9be9('0x45')],qs[_0x9be9('0x4a')](_0x320ef0[_0x9be9('0x46')][_0x9be9('0x4a')]));_0x345cda[_0x9be9('0x49')]=_0x345cda['attributes'][_0x9be9('0x4b')]?_0x345cda[_0x9be9('0x49')]:_0x280522[_0x9be9('0x45')];if(!_0x320ef0['query'][_0x9be9('0x4c')](_0x9be9('0x4d'))){_0x345cda[_0x9be9('0x30')]=qs[_0x9be9('0x30')](_0x320ef0['query'][_0x9be9('0x30')]);_0x345cda[_0x9be9('0x2e')]=qs[_0x9be9('0x2e')](_0x320ef0[_0x9be9('0x46')][_0x9be9('0x2e')]);}_0x345cda[_0x9be9('0x6a')]=qs[_0x9be9('0x4e')](_0x320ef0[_0x9be9('0x46')]['sort']);_0x345cda['where']=qs[_0x9be9('0x4f')](_[_0x9be9('0x50')](_0x320ef0['query'],_0x280522[_0x9be9('0x4f')]));_0x345cda[_0x9be9('0x52')][_0x9be9('0x66')]=_0x286623['id'];if(_0x320ef0[_0x9be9('0x46')][_0x9be9('0x53')]){_0x345cda[_0x9be9('0x52')]=_[_0x9be9('0x51')](_0x345cda[_0x9be9('0x52')],{'$or':_[_0x9be9('0x3f')](_0x345cda[_0x9be9('0x49')],function(_0x144cf7){var _0x287475={};_0x287475[_0x144cf7]={'$like':'%'+_0x320ef0[_0x9be9('0x46')]['filter']+'%'};return _0x287475;})});}_0x345cda=_[_0x9be9('0x51')]({},_0x345cda,_0x320ef0[_0x9be9('0x6b')]);return db['ChatOfflineMessage'][_0x9be9('0x54')]({'where':_0x345cda['where']})[_0x9be9('0x36')](function(_0x153c06){_0x293e45[_0x9be9('0x54')]=_0x153c06;if(_0x320ef0['query'][_0x9be9('0x55')]){_0x345cda[_0x9be9('0x56')]=[{'all':!![]}];}else{_0x345cda[_0x9be9('0x56')]=[{'model':db[_0x9be9('0xd5')],'as':_0x9be9('0x104'),'required':![]},{'model':db[_0x9be9('0xea')],'as':_0x9be9('0x138'),'required':![]}];}return db[_0x9be9('0xe0')][_0x9be9('0x6c')](_0x345cda);})[_0x9be9('0x36')](function(_0x450986){_0x293e45[_0x9be9('0x6d')]=_0x450986;return _0x293e45;});}})['then'](respondWithFilteredResult(_0x26184e,_0x345cda))[_0x9be9('0x29')](handleError(_0x26184e,null));};exports[_0x9be9('0x139')]=function(_0x57afb4,_0x46d3dd,_0x1d5078){return db['ChatWebsite']['find']({'where':{'id':_0x57afb4[_0x9be9('0x63')]['id']}})['then'](handleEntityNotFound(_0x46d3dd,null))[_0x9be9('0x36')](function(_0x425923){if(_0x425923){return _0x425923[_0x9be9('0x139')](_0x57afb4[_0x9be9('0x5b')]['ids'],_[_0x9be9('0x102')](_0x57afb4[_0x9be9('0x5b')],['ids','id'])||{})[_0x9be9('0xc3')](function(_0x3995c6){for(var _0x3bfa88=0x0;_0x3bfa88<_0x57afb4[_0x9be9('0x5b')][_0x9be9('0x6f')][_0x9be9('0x4b')];_0x3bfa88+=0x1){socket['emit'](_0x9be9('0x13a'),{'UserId':Number(_0x57afb4[_0x9be9('0x5b')][_0x9be9('0x6f')][_0x3bfa88]),'ChatWebsiteId':Number(_0x57afb4[_0x9be9('0x63')]['id'])});}return _0x3995c6;});}})[_0x9be9('0x36')](respondWithResult(_0x46d3dd,null))[_0x9be9('0x29')](handleError(_0x46d3dd,null));};exports[_0x9be9('0x13b')]=function(_0x3a0364,_0x3d5ba0,_0x3634a2){return db[_0x9be9('0x40')][_0x9be9('0x59')]({'where':{'id':_0x3a0364[_0x9be9('0x63')]['id']}})[_0x9be9('0x36')](handleEntityNotFound(_0x3d5ba0,null))[_0x9be9('0x36')](function(_0x151d85){if(_0x151d85){return _0x151d85[_0x9be9('0x13b')](_0x3a0364[_0x9be9('0x46')][_0x9be9('0x6f')])[_0x9be9('0x36')](function(){if(_[_0x9be9('0x13c')](_0x3a0364[_0x9be9('0x46')]['ids'])){for(var _0x2f9222=0x0;_0x2f9222<_0x3a0364[_0x9be9('0x46')][_0x9be9('0x6f')][_0x9be9('0x4b')];_0x2f9222+=0x1){socket['emit'](_0x9be9('0x13d'),{'UserId':Number(_0x3a0364[_0x9be9('0x46')][_0x9be9('0x6f')][_0x2f9222]),'ChatWebsiteId':Number(_0x3a0364[_0x9be9('0x63')]['id'])});}}else{socket['emit'](_0x9be9('0x13d'),{'UserId':Number(_0x3a0364['query'][_0x9be9('0x6f')]),'ChatWebsiteId':Number(_0x3a0364[_0x9be9('0x63')]['id'])});}});}})[_0x9be9('0x36')](respondWithStatusCode(_0x3d5ba0,null))[_0x9be9('0x29')](handleError(_0x3d5ba0,null));};exports[_0x9be9('0x13e')]=function(_0xe3bb8c,_0xedff3a,_0x26b473){var _0x553006={};var _0x37a8f0={};var _0x585434;var _0x522148;return db['ChatWebsite'][_0x9be9('0x68')]({'where':{'id':_0xe3bb8c[_0x9be9('0x63')]['id']}})['then'](handleEntityNotFound(_0xedff3a,null))[_0x9be9('0x36')](function(_0x2c6dee){if(_0x2c6dee){_0x585434=_0x2c6dee;_0x37a8f0[_0x9be9('0x45')]=_[_0x9be9('0x47')](db[_0x9be9('0xcb')][_0x9be9('0x41')]);_0x37a8f0['query']=_['keys'](_0xe3bb8c[_0x9be9('0x46')]);_0x37a8f0[_0x9be9('0x4f')]=_[_0x9be9('0x48')](_0x37a8f0[_0x9be9('0x45')],_0x37a8f0[_0x9be9('0x46')]);_0x553006['attributes']=_[_0x9be9('0x48')](_0x37a8f0[_0x9be9('0x45')],qs[_0x9be9('0x4a')](_0xe3bb8c[_0x9be9('0x46')]['fields']));_0x553006[_0x9be9('0x49')]=_0x553006[_0x9be9('0x49')][_0x9be9('0x4b')]?_0x553006[_0x9be9('0x49')]:_0x37a8f0['model'];_0x553006['order']=qs[_0x9be9('0x4e')](_0xe3bb8c[_0x9be9('0x46')][_0x9be9('0x4e')]);_0x553006[_0x9be9('0x52')]=qs['filters'](_['pick'](_0xe3bb8c[_0x9be9('0x46')],_0x37a8f0['filters']));if(_0xe3bb8c[_0x9be9('0x46')][_0x9be9('0x53')]){_0x553006[_0x9be9('0x52')]=_['merge'](_0x553006[_0x9be9('0x52')],{'$or':_[_0x9be9('0x3f')](_0x553006['attributes'],function(_0x194c23){var _0x2fc85f={};_0x2fc85f[_0x194c23]={'$like':'%'+_0xe3bb8c[_0x9be9('0x46')][_0x9be9('0x53')]+'%'};return _0x2fc85f;})});}_0x553006=_[_0x9be9('0x51')]({},_0x553006,_0xe3bb8c['options']);return _0x585434[_0x9be9('0x13e')](_0x553006);}})[_0x9be9('0x36')](function(_0x5f13a3){if(_0x5f13a3){_0x522148=_0x5f13a3[_0x9be9('0x4b')];if(!_0xe3bb8c['query'][_0x9be9('0x4c')](_0x9be9('0x4d'))){_0x553006[_0x9be9('0x30')]=qs[_0x9be9('0x30')](_0xe3bb8c[_0x9be9('0x46')][_0x9be9('0x30')]);_0x553006[_0x9be9('0x2e')]=qs[_0x9be9('0x2e')](_0xe3bb8c[_0x9be9('0x46')][_0x9be9('0x2e')]);}return _0x585434[_0x9be9('0x13e')](_0x553006);}})[_0x9be9('0x36')](function(_0x40a4cc){if(_0x40a4cc){return _0x40a4cc?{'count':_0x522148,'rows':_0x40a4cc}:null;}})[_0x9be9('0x36')](respondWithResult(_0xedff3a,null))[_0x9be9('0x29')](handleError(_0xedff3a,null));}; \ No newline at end of file +var _0xcb73=['forcedOwnership','Start','startRouting','EventManager','offline','files','CmContact','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','spread','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','originalname','mimetype','attachments','offline-chat','sequelize','transaction','Attachment','MailServerOut','Smtp','forwardOffline','service','host','port','secure','sendMail','\x22%s\x22\x20<%s>','email','forwardOfflineAddress','offlineMessageSubject','openNewInteraction','MailAccountId','toPairsIn','mapValues','Chat','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','getInteractions','Contact','Owner','fullname','internal','Tags','color','tag','iftime\x20%s,%s','timezone','iftime\x20%s','interval','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','No\x20timezone','inspect','getSnippet','Interval','Intervals','getProactiveActions','virtual','License','increment','some','server/files/chat/iframe.ejs','remote','x-real-ip','connection','replace','alignment','verticalAlignment','color_button','addApplications','bulkCreate','findAndCountAll','getApplications','addProactiveActions','chatProactiveAction','omit','getFields','online','false','offlineForm','onlineForm','items','fromKey','addAgents','emit','userChatWebsite:save','removeAgents','userChatWebsite:remove','eml-format','rimraf','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','client','http','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','undefined','count','offset','set','Content-Range','apply','reject','save','then','destroy','get','UserProfileResource','stack','name','send','index','map','ChatWebsite','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','merge','filter','options','includeAll','findAll','rows','show','params','Pause','keys','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChatWebsites','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','mandatoryDispositionPause','describe','ChatWebsiteId','getDispositions','findOne','Disposition','pick','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addLogo','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','server/files/images/logos/default_logo.svg','getLicense','custom','existsSync','root','server/files/images/logos/','getAvatar','server/files/images/avatars/default_avatar.png','isNil','server/files/images/avatars/','download','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','setUA','headers','user-agent','getResult','chat','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','DESC','ChatApplication','Applications','account','applications','orderBy','priority','asc','Contacts','contact','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName','x-real-port','referer','browser','format','version','unknown','device','vendor','%s\x20%s\x20%s','threadId','externalUrl','ChatInteraction','ContactId','interaction','messageId','created','autoclose','push','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent'];(function(_0x28bb5e,_0x29da00){var _0x4e10ac=function(_0x50054e){while(--_0x50054e){_0x28bb5e['push'](_0x28bb5e['shift']());}};_0x4e10ac(++_0x29da00);}(_0xcb73,0x65));var _0x3cb7=function(_0x3a855f,_0x20dbe3){_0x3a855f=_0x3a855f-0x0;var _0x1c3ee0=_0xcb73[_0x3a855f];return _0x1c3ee0;};'use strict';var emlformat=require(_0x3cb7('0x0'));var rimraf=require(_0x3cb7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x3cb7('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x3cb7('0x3'));var path=require(_0x3cb7('0x4'));var sox=require(_0x3cb7('0x5'));var csv=require(_0x3cb7('0x6'));var ejs=require(_0x3cb7('0x7'));var fs=require('fs');var fs_extra=require(_0x3cb7('0x8'));var _=require(_0x3cb7('0x9'));var squel=require(_0x3cb7('0xa'));var crypto=require(_0x3cb7('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x3cb7('0xc'));var toCsv=require(_0x3cb7('0x6'));var querystring=require(_0x3cb7('0xd'));var Papa=require(_0x3cb7('0xe'));var Redis=require('ioredis');var authService=require(_0x3cb7('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3cb7('0x10'));var logger=require(_0x3cb7('0x11'))(_0x3cb7('0x12'));var utils=require(_0x3cb7('0x13'));var config=require(_0x3cb7('0x14'));var licenseUtil=require(_0x3cb7('0x15'));var db=require(_0x3cb7('0x16'))['db'];config[_0x3cb7('0x17')]=_[_0x3cb7('0x18')](config[_0x3cb7('0x17')],{'host':_0x3cb7('0x19'),'port':0x18eb});var socket=require(_0x3cb7('0x1a'))(new Redis(config[_0x3cb7('0x17')]));require('./chatWebsite.socket')[_0x3cb7('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson[_0x3cb7('0x1c')][_0x3cb7('0x1d')]({'port':0x232c});var client9002=jayson[_0x3cb7('0x1c')][_0x3cb7('0x1d')]({'port':0x232a});var client9003=jayson[_0x3cb7('0x1c')][_0x3cb7('0x1d')]({'port':0x232b});var client9001=jayson[_0x3cb7('0x1c')][_0x3cb7('0x1d')]({'port':0x2329});function respondWithRpcPromise(_0xf9f59d,_0x346886,_0x383f0a,_0xaed76){return new BPromise(function(_0x2d6ae8,_0x36ea56){var _0x28ccff=_0xaed76||client;return _0x28ccff['request'](_0xf9f59d,_0x383f0a)['then'](function(_0x2c7e75){logger[_0x3cb7('0x1e')](_0x3cb7('0x1f'),_0x346886,_0x3cb7('0x20'));logger['debug'](_0x3cb7('0x21'),_0x346886,_0x3cb7('0x20'),JSON[_0x3cb7('0x22')](_0x2c7e75));if(_0x2c7e75[_0x3cb7('0x23')]){if(_0x2c7e75[_0x3cb7('0x23')][_0x3cb7('0x24')]===0x1f4){logger[_0x3cb7('0x23')](_0x3cb7('0x1f'),_0x346886,_0x2c7e75[_0x3cb7('0x23')]['message']);return _0x36ea56(_0x2c7e75[_0x3cb7('0x23')][_0x3cb7('0x25')]);}logger['error'](_0x3cb7('0x1f'),_0x346886,_0x2c7e75[_0x3cb7('0x23')]['message']);return _0x2d6ae8(_0x2c7e75['error'][_0x3cb7('0x25')]);}else{logger[_0x3cb7('0x1e')]('ChatWebsite,\x20%s,\x20%s',_0x346886,_0x3cb7('0x20'));_0x2d6ae8(_0x2c7e75[_0x3cb7('0x26')][_0x3cb7('0x25')]);}})[_0x3cb7('0x27')](function(_0x8baba9){logger['error'](_0x3cb7('0x1f'),_0x346886,_0x8baba9);_0x36ea56(_0x8baba9);});});}function respondWithStatusCode(_0x3daa5b,_0x5e0bed){_0x5e0bed=_0x5e0bed||0xcc;return function(_0x609f7){if(_0x609f7){return _0x3daa5b[_0x3cb7('0x28')](_0x5e0bed);}return _0x3daa5b[_0x3cb7('0x29')](_0x5e0bed)[_0x3cb7('0x2a')]();};}function respondWithResult(_0x2640ce,_0xd93d09){_0xd93d09=_0xd93d09||0xc8;return function(_0x56fd92){if(_0x56fd92){return _0x2640ce[_0x3cb7('0x29')](_0xd93d09)['json'](_0x56fd92);}};}function respondWithFilteredResult(_0x1a94ed,_0x40da44){return function(_0x530cde){if(_0x530cde){var _0x222433=typeof _0x40da44['offset']===_0x3cb7('0x2b')&&typeof _0x40da44['limit']===_0x3cb7('0x2b');var _0x2f6151=_0x530cde[_0x3cb7('0x2c')];var _0x4aed2d=_0x222433?0x0:_0x40da44[_0x3cb7('0x2d')];var _0x3602d5=_0x222433?_0x530cde[_0x3cb7('0x2c')]:_0x40da44[_0x3cb7('0x2d')]+_0x40da44['limit'];var _0x3c1ff1;if(_0x3602d5>=_0x2f6151){_0x3602d5=_0x2f6151;_0x3c1ff1=0xc8;}else{_0x3c1ff1=0xce;}_0x1a94ed[_0x3cb7('0x29')](_0x3c1ff1);return _0x1a94ed[_0x3cb7('0x2e')](_0x3cb7('0x2f'),_0x4aed2d+'-'+_0x3602d5+'/'+_0x2f6151)['json'](_0x530cde);}return null;};}function patchUpdates(_0x1933cf){return function(_0x56ceca){try{jsonpatch[_0x3cb7('0x30')](_0x56ceca,_0x1933cf,!![]);}catch(_0x501910){return BPromise[_0x3cb7('0x31')](_0x501910);}return _0x56ceca[_0x3cb7('0x32')]();};}function saveUpdates(_0x298918,_0x2947cc){return function(_0x5439e1){if(_0x5439e1){return _0x5439e1['update'](_0x298918)[_0x3cb7('0x33')](function(_0x343c5e){return _0x343c5e;});}return null;};}function removeEntity(_0x1961f1,_0xa02f56){return function(_0x3eb6d4){if(_0x3eb6d4){return _0x3eb6d4[_0x3cb7('0x34')]()[_0x3cb7('0x33')](function(){var _0x3da898=_0x3eb6d4[_0x3cb7('0x35')]({'plain':!![]});var _0x58eb01='ChatWebsites';return db[_0x3cb7('0x36')][_0x3cb7('0x34')]({'where':{'type':_0x58eb01,'resourceId':_0x3da898['id']}})[_0x3cb7('0x33')](function(){return _0x3eb6d4;});})[_0x3cb7('0x33')](function(){_0x1961f1['status'](0xcc)[_0x3cb7('0x2a')]();});}};}function handleEntityNotFound(_0x1d489a,_0x5db828){return function(_0x2ea151){if(!_0x2ea151){_0x1d489a[_0x3cb7('0x28')](0x194);}return _0x2ea151;};}function handleError(_0x56fc67,_0x384be1){_0x384be1=_0x384be1||0x1f4;return function(_0x4fa48d){logger['error'](_0x4fa48d[_0x3cb7('0x37')]);if(_0x4fa48d[_0x3cb7('0x38')]){delete _0x4fa48d[_0x3cb7('0x38')];}_0x56fc67[_0x3cb7('0x29')](_0x384be1)[_0x3cb7('0x39')](_0x4fa48d);};}exports[_0x3cb7('0x3a')]=function(_0x3067b8,_0x304a63){var _0x19baa7={'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x42dbe9={},_0x29dea1={'count':0x0,'rows':[]};var _0x4ee682=_[_0x3cb7('0x3b')](db[_0x3cb7('0x3c')][_0x3cb7('0x3d')],function(_0x3701bf){return{'name':_0x3701bf[_0x3cb7('0x3e')],'type':_0x3701bf[_0x3cb7('0x3f')][_0x3cb7('0x40')]};});_0x42dbe9[_0x3cb7('0x41')]=_[_0x3cb7('0x3b')](_0x4ee682,_0x3cb7('0x38'));_0x42dbe9[_0x3cb7('0x42')]=_['keys'](_0x3067b8['query']);_0x42dbe9['filters']=_[_0x3cb7('0x43')](_0x42dbe9[_0x3cb7('0x41')],_0x42dbe9['query']);_0x19baa7[_0x3cb7('0x44')]=_[_0x3cb7('0x43')](_0x42dbe9[_0x3cb7('0x41')],qs['fields'](_0x3067b8[_0x3cb7('0x42')][_0x3cb7('0x45')]));_0x19baa7['attributes']=_0x19baa7['attributes'][_0x3cb7('0x46')]?_0x19baa7[_0x3cb7('0x44')]:_0x42dbe9[_0x3cb7('0x41')];if(!_0x3067b8[_0x3cb7('0x42')][_0x3cb7('0x47')](_0x3cb7('0x48'))){_0x19baa7[_0x3cb7('0x49')]=qs[_0x3cb7('0x49')](_0x3067b8[_0x3cb7('0x42')][_0x3cb7('0x49')]);_0x19baa7[_0x3cb7('0x2d')]=qs['offset'](_0x3067b8[_0x3cb7('0x42')][_0x3cb7('0x2d')]);}_0x19baa7[_0x3cb7('0x4a')]=qs[_0x3cb7('0x4b')](_0x3067b8[_0x3cb7('0x42')][_0x3cb7('0x4b')]);_0x19baa7[_0x3cb7('0x4c')]=qs[_0x3cb7('0x4d')](_['pick'](_0x3067b8[_0x3cb7('0x42')],_0x42dbe9[_0x3cb7('0x4d')]),_0x4ee682);if(_0x3067b8[_0x3cb7('0x42')]['filter']){_0x19baa7['where']=_[_0x3cb7('0x4e')](_0x19baa7['where'],{'$or':_['map'](_0x4ee682,function(_0x55676f){if(_0x55676f[_0x3cb7('0x3f')]!=='VIRTUAL'){var _0x1552e5={};_0x1552e5[_0x55676f[_0x3cb7('0x38')]]={'$like':'%'+_0x3067b8['query'][_0x3cb7('0x4f')]+'%'};return _0x1552e5;}})});}_0x19baa7=_[_0x3cb7('0x4e')]({},_0x19baa7,_0x3067b8[_0x3cb7('0x50')]);var _0x3e9137={'where':_0x19baa7[_0x3cb7('0x4c')]};return db['ChatWebsite'][_0x3cb7('0x2c')](_0x3e9137)[_0x3cb7('0x33')](function(_0x552cab){_0x29dea1[_0x3cb7('0x2c')]=_0x552cab;if(_0x3067b8[_0x3cb7('0x42')][_0x3cb7('0x51')]){_0x19baa7['include']=[{'all':!![]}];}return db[_0x3cb7('0x3c')][_0x3cb7('0x52')](_0x19baa7);})[_0x3cb7('0x33')](function(_0x157b4e){_0x29dea1[_0x3cb7('0x53')]=_0x157b4e;return _0x29dea1;})[_0x3cb7('0x33')](respondWithFilteredResult(_0x304a63,_0x19baa7))[_0x3cb7('0x27')](handleError(_0x304a63,null));};exports[_0x3cb7('0x54')]=function(_0x4cc88f,_0x38c677){var _0x451c6d={'raw':![],'where':{'id':_0x4cc88f[_0x3cb7('0x55')]['id']},'include':[{'model':db[_0x3cb7('0x56')],'as':'mandatoryDispositionPause'}]},_0x331473={};_0x331473['model']=_[_0x3cb7('0x57')](db[_0x3cb7('0x3c')][_0x3cb7('0x3d')]);_0x331473[_0x3cb7('0x42')]=_[_0x3cb7('0x57')](_0x4cc88f['query']);_0x331473[_0x3cb7('0x4d')]=_[_0x3cb7('0x43')](_0x331473[_0x3cb7('0x41')],_0x331473['query']);_0x451c6d[_0x3cb7('0x44')]=_['intersection'](_0x331473[_0x3cb7('0x41')],qs[_0x3cb7('0x45')](_0x4cc88f[_0x3cb7('0x42')]['fields']));_0x451c6d[_0x3cb7('0x44')]=_0x451c6d[_0x3cb7('0x44')][_0x3cb7('0x46')]?_0x451c6d[_0x3cb7('0x44')]:_0x331473['model'];if(_0x4cc88f['query'][_0x3cb7('0x51')]){_0x451c6d[_0x3cb7('0x58')]=[{'all':!![]}];}_0x451c6d=_[_0x3cb7('0x4e')]({},_0x451c6d,_0x4cc88f[_0x3cb7('0x50')]);return db[_0x3cb7('0x3c')][_0x3cb7('0x59')](_0x451c6d)[_0x3cb7('0x33')](handleEntityNotFound(_0x38c677,null))[_0x3cb7('0x33')](respondWithResult(_0x38c677,null))[_0x3cb7('0x27')](handleError(_0x38c677,null));};exports[_0x3cb7('0x5a')]=function(_0x174a58,_0x1a192b){return db[_0x3cb7('0x3c')][_0x3cb7('0x5a')](_0x174a58[_0x3cb7('0x5b')],{})['then'](function(_0x43c7af){var _0x20129f=_0x174a58[_0x3cb7('0x5c')]['get']({'plain':!![]});if(!_0x20129f)throw new Error(_0x3cb7('0x5d'));if(_0x20129f[_0x3cb7('0x5e')]===_0x3cb7('0x5c')){var _0x5bc3e9=_0x43c7af['get']({'plain':!![]});var _0x59414d=_0x3cb7('0x5f');return db[_0x3cb7('0x60')][_0x3cb7('0x59')]({'where':{'name':_0x59414d,'userProfileId':_0x20129f[_0x3cb7('0x61')]},'raw':!![]})[_0x3cb7('0x33')](function(_0x23c7a5){if(_0x23c7a5&&_0x23c7a5[_0x3cb7('0x62')]===0x0){return db['UserProfileResource'][_0x3cb7('0x5a')]({'name':_0x5bc3e9[_0x3cb7('0x38')],'resourceId':_0x5bc3e9['id'],'type':_0x23c7a5[_0x3cb7('0x38')],'sectionId':_0x23c7a5['id']},{})[_0x3cb7('0x33')](function(){return _0x43c7af;});}else{return _0x43c7af;}})[_0x3cb7('0x27')](function(_0x58c0f7){logger[_0x3cb7('0x23')](_0x3cb7('0x63'),_0x58c0f7);throw _0x58c0f7;});}return _0x43c7af;})[_0x3cb7('0x33')](respondWithResult(_0x1a192b,0xc9))[_0x3cb7('0x27')](handleError(_0x1a192b,null));};exports[_0x3cb7('0x64')]=function(_0x227f56,_0x36eae1){if(_0x227f56[_0x3cb7('0x5b')]['id']){delete _0x227f56['body']['id'];}return db[_0x3cb7('0x3c')]['find']({'where':{'id':_0x227f56['params']['id']},'include':[{'model':db[_0x3cb7('0x56')],'as':_0x3cb7('0x65')}]})[_0x3cb7('0x33')](handleEntityNotFound(_0x36eae1,null))[_0x3cb7('0x33')](saveUpdates(_0x227f56['body'],null))[_0x3cb7('0x33')](respondWithResult(_0x36eae1,null))[_0x3cb7('0x27')](handleError(_0x36eae1,null));};exports[_0x3cb7('0x34')]=function(_0x38ae49,_0x15ccfc){return db[_0x3cb7('0x3c')][_0x3cb7('0x59')]({'where':{'id':_0x38ae49[_0x3cb7('0x55')]['id']}})[_0x3cb7('0x33')](handleEntityNotFound(_0x15ccfc,null))[_0x3cb7('0x33')](removeEntity(_0x15ccfc,null))[_0x3cb7('0x27')](handleError(_0x15ccfc,null));};exports[_0x3cb7('0x66')]=function(_0x5e32d3,_0x13ec5d){return db[_0x3cb7('0x3c')]['describe']()['then'](respondWithResult(_0x13ec5d,null))['catch'](handleError(_0x13ec5d,null));};exports['addDisposition']=function(_0x90f6e8,_0x527169,_0xa0e6f6){if(_0x90f6e8[_0x3cb7('0x5b')]['id']){delete _0x90f6e8[_0x3cb7('0x5b')]['id'];}return db[_0x3cb7('0x3c')][_0x3cb7('0x59')]({'where':{'id':_0x90f6e8[_0x3cb7('0x55')]['id']}})[_0x3cb7('0x33')](handleEntityNotFound(_0x527169,null))[_0x3cb7('0x33')](function(_0x2a77fe){if(_0x2a77fe){_0x90f6e8['body'][_0x3cb7('0x67')]=_0x2a77fe['id'];return db['Disposition'][_0x3cb7('0x5a')](_0x90f6e8[_0x3cb7('0x5b')]);}})[_0x3cb7('0x33')](respondWithResult(_0x527169,null))[_0x3cb7('0x27')](handleError(_0x527169,null));};exports[_0x3cb7('0x68')]=function(_0x31ca56,_0x1d031b,_0x4dff7e){var _0x371ead={'raw':![],'where':{}};var _0x1d88e4={};var _0x19a853={'count':0x0,'rows':[]};return db[_0x3cb7('0x3c')][_0x3cb7('0x69')]({'where':{'id':_0x31ca56['params']['id']}})['then'](handleEntityNotFound(_0x1d031b,null))[_0x3cb7('0x33')](function(_0x5cda23){if(_0x5cda23){_0x1d88e4['model']=_[_0x3cb7('0x57')](db[_0x3cb7('0x6a')]['rawAttributes']);_0x1d88e4[_0x3cb7('0x42')]=_[_0x3cb7('0x57')](_0x31ca56[_0x3cb7('0x42')]);_0x1d88e4[_0x3cb7('0x4d')]=_['intersection'](_0x1d88e4[_0x3cb7('0x41')],_0x1d88e4[_0x3cb7('0x42')]);_0x371ead['attributes']=_[_0x3cb7('0x43')](_0x1d88e4[_0x3cb7('0x41')],qs['fields'](_0x31ca56[_0x3cb7('0x42')][_0x3cb7('0x45')]));_0x371ead['attributes']=_0x371ead[_0x3cb7('0x44')][_0x3cb7('0x46')]?_0x371ead[_0x3cb7('0x44')]:_0x1d88e4[_0x3cb7('0x41')];if(!_0x31ca56[_0x3cb7('0x42')][_0x3cb7('0x47')](_0x3cb7('0x48'))){_0x371ead[_0x3cb7('0x49')]=qs[_0x3cb7('0x49')](_0x31ca56['query'][_0x3cb7('0x49')]);_0x371ead['offset']=qs[_0x3cb7('0x2d')](_0x31ca56[_0x3cb7('0x42')][_0x3cb7('0x2d')]);}_0x371ead[_0x3cb7('0x4a')]=qs['sort'](_0x31ca56[_0x3cb7('0x42')]['sort']);_0x371ead[_0x3cb7('0x4c')]=qs[_0x3cb7('0x4d')](_[_0x3cb7('0x6b')](_0x31ca56[_0x3cb7('0x42')],_0x1d88e4['filters']));_0x371ead[_0x3cb7('0x4c')][_0x3cb7('0x67')]=_0x5cda23['id'];if(_0x31ca56[_0x3cb7('0x42')][_0x3cb7('0x4f')]){_0x371ead[_0x3cb7('0x4c')]=_[_0x3cb7('0x4e')](_0x371ead[_0x3cb7('0x4c')],{'$or':_[_0x3cb7('0x3b')](_0x371ead[_0x3cb7('0x44')],function(_0x1634ab){var _0x1302d8={};_0x1302d8[_0x1634ab]={'$like':'%'+_0x31ca56[_0x3cb7('0x42')][_0x3cb7('0x4f')]+'%'};return _0x1302d8;})});}_0x371ead=_[_0x3cb7('0x4e')]({},_0x371ead,_0x31ca56[_0x3cb7('0x50')]);return db[_0x3cb7('0x6a')]['count']({'where':_0x371ead['where']})[_0x3cb7('0x33')](function(_0x47796b){_0x19a853['count']=_0x47796b;if(_0x31ca56[_0x3cb7('0x42')]['includeAll']){_0x371ead[_0x3cb7('0x58')]=[{'all':!![]}];}return db['Disposition'][_0x3cb7('0x52')](_0x371ead);})[_0x3cb7('0x33')](function(_0x189118){_0x19a853[_0x3cb7('0x53')]=_0x189118;return _0x19a853;});}})[_0x3cb7('0x33')](respondWithFilteredResult(_0x1d031b,_0x371ead))[_0x3cb7('0x27')](handleError(_0x1d031b,null));};exports[_0x3cb7('0x6c')]=function(_0x403451,_0x2573ef,_0x14668d){return db['ChatWebsite']['find']({'where':{'id':_0x403451[_0x3cb7('0x55')]['id']}})['then'](handleEntityNotFound(_0x2573ef,null))[_0x3cb7('0x33')](function(_0xc8bd1e){if(_0xc8bd1e){return _0xc8bd1e[_0x3cb7('0x6c')](_0x403451['query'][_0x3cb7('0x6d')]);}})['then'](respondWithStatusCode(_0x2573ef,null))['catch'](handleError(_0x2573ef,null));};exports[_0x3cb7('0x6e')]=function(_0x4fac59,_0x3cf11b,_0x3bec0e){if(_0x4fac59['body']['id']){delete _0x4fac59[_0x3cb7('0x5b')]['id'];}return db['ChatWebsite'][_0x3cb7('0x59')]({'where':{'id':_0x4fac59[_0x3cb7('0x55')]['id']}})[_0x3cb7('0x33')](handleEntityNotFound(_0x3cf11b,null))[_0x3cb7('0x33')](function(_0x38fec1){if(_0x38fec1){_0x4fac59[_0x3cb7('0x5b')][_0x3cb7('0x67')]=_0x38fec1['id'];return db[_0x3cb7('0x6f')][_0x3cb7('0x5a')](_0x4fac59['body']);}})[_0x3cb7('0x33')](respondWithResult(_0x3cf11b,null))['catch'](handleError(_0x3cf11b,null));};exports[_0x3cb7('0x70')]=function(_0x3f11e3,_0x32afa1,_0x99b4b){var _0x44e6eb={'raw':![],'where':{}};var _0x23410a={};var _0x1c2977={'count':0x0,'rows':[]};return db[_0x3cb7('0x3c')][_0x3cb7('0x69')]({'where':{'id':_0x3f11e3['params']['id']}})[_0x3cb7('0x33')](handleEntityNotFound(_0x32afa1,null))['then'](function(_0x163a35){if(_0x163a35){_0x23410a['model']=_[_0x3cb7('0x57')](db['CannedAnswer']['rawAttributes']);_0x23410a['query']=_[_0x3cb7('0x57')](_0x3f11e3[_0x3cb7('0x42')]);_0x23410a[_0x3cb7('0x4d')]=_['intersection'](_0x23410a['model'],_0x23410a[_0x3cb7('0x42')]);_0x44e6eb[_0x3cb7('0x44')]=_[_0x3cb7('0x43')](_0x23410a[_0x3cb7('0x41')],qs[_0x3cb7('0x45')](_0x3f11e3[_0x3cb7('0x42')]['fields']));_0x44e6eb['attributes']=_0x44e6eb[_0x3cb7('0x44')]['length']?_0x44e6eb[_0x3cb7('0x44')]:_0x23410a[_0x3cb7('0x41')];if(!_0x3f11e3[_0x3cb7('0x42')][_0x3cb7('0x47')]('nolimit')){_0x44e6eb[_0x3cb7('0x49')]=qs[_0x3cb7('0x49')](_0x3f11e3[_0x3cb7('0x42')][_0x3cb7('0x49')]);_0x44e6eb['offset']=qs[_0x3cb7('0x2d')](_0x3f11e3['query'][_0x3cb7('0x2d')]);}_0x44e6eb['order']=qs['sort'](_0x3f11e3[_0x3cb7('0x42')]['sort']);_0x44e6eb['where']=qs[_0x3cb7('0x4d')](_[_0x3cb7('0x6b')](_0x3f11e3[_0x3cb7('0x42')],_0x23410a[_0x3cb7('0x4d')]));_0x44e6eb[_0x3cb7('0x4c')][_0x3cb7('0x67')]=_0x163a35['id'];if(_0x3f11e3['query'][_0x3cb7('0x4f')]){_0x44e6eb[_0x3cb7('0x4c')]=_[_0x3cb7('0x4e')](_0x44e6eb[_0x3cb7('0x4c')],{'$or':_['map'](_0x44e6eb[_0x3cb7('0x44')],function(_0x33e131){var _0x476a32={};_0x476a32[_0x33e131]={'$like':'%'+_0x3f11e3[_0x3cb7('0x42')][_0x3cb7('0x4f')]+'%'};return _0x476a32;})});}_0x44e6eb=_[_0x3cb7('0x4e')]({},_0x44e6eb,_0x3f11e3[_0x3cb7('0x50')]);return db['CannedAnswer'][_0x3cb7('0x2c')]({'where':_0x44e6eb['where']})[_0x3cb7('0x33')](function(_0x39a8cc){_0x1c2977['count']=_0x39a8cc;if(_0x3f11e3['query'][_0x3cb7('0x51')]){_0x44e6eb[_0x3cb7('0x58')]=[{'all':!![]}];}return db['CannedAnswer'][_0x3cb7('0x52')](_0x44e6eb);})[_0x3cb7('0x33')](function(_0x55dbcc){_0x1c2977['rows']=_0x55dbcc;return _0x1c2977;});}})['then'](respondWithFilteredResult(_0x32afa1,_0x44e6eb))[_0x3cb7('0x27')](handleError(_0x32afa1,null));};exports['removeAnswers']=function(_0x3e6dd4,_0x594c9d,_0x48a568){return db[_0x3cb7('0x3c')][_0x3cb7('0x59')]({'where':{'id':_0x3e6dd4['params']['id']}})['then'](handleEntityNotFound(_0x594c9d,null))[_0x3cb7('0x33')](function(_0x1d3c69){if(_0x1d3c69){return _0x1d3c69[_0x3cb7('0x71')](_0x3e6dd4[_0x3cb7('0x42')]['ids']);}})[_0x3cb7('0x33')](respondWithStatusCode(_0x594c9d,null))[_0x3cb7('0x27')](handleError(_0x594c9d,null));};exports[_0x3cb7('0x72')]=function(_0x3a0fd3,_0x2dffd4,_0x24621a){_0x3a0fd3['body'][_0x3cb7('0x73')]=_0x3a0fd3[_0x3cb7('0x74')][_0x3cb7('0x75')];return db[_0x3cb7('0x3c')][_0x3cb7('0x59')]({'where':{'id':_0x3a0fd3[_0x3cb7('0x55')]['id']}})[_0x3cb7('0x33')](handleEntityNotFound(_0x2dffd4,null))[_0x3cb7('0x33')](saveUpdates(_0x3a0fd3[_0x3cb7('0x5b')],null))[_0x3cb7('0x33')](respondWithResult(_0x2dffd4,null))[_0x3cb7('0x27')](handleError(_0x2dffd4,null));};exports[_0x3cb7('0x76')]=function(_0x1ebbdc,_0x114685,_0x42e5d9){_0x1ebbdc[_0x3cb7('0x5b')][_0x3cb7('0x77')]=_0x1ebbdc[_0x3cb7('0x74')][_0x3cb7('0x75')];return db['ChatWebsite'][_0x3cb7('0x59')]({'where':{'id':_0x1ebbdc[_0x3cb7('0x55')]['id']}})[_0x3cb7('0x33')](handleEntityNotFound(_0x114685,null))[_0x3cb7('0x33')](saveUpdates(_0x1ebbdc[_0x3cb7('0x5b')],null))[_0x3cb7('0x33')](respondWithResult(_0x114685,null))[_0x3cb7('0x27')](handleError(_0x114685,null));};exports[_0x3cb7('0x78')]=function(_0x556a4e,_0x28dbf5,_0x156a71){_0x556a4e['body'][_0x3cb7('0x79')]=_0x556a4e[_0x3cb7('0x74')]['filename'];return db[_0x3cb7('0x3c')][_0x3cb7('0x59')]({'where':{'id':_0x556a4e[_0x3cb7('0x55')]['id']}})['then'](handleEntityNotFound(_0x28dbf5,null))[_0x3cb7('0x33')](saveUpdates(_0x556a4e[_0x3cb7('0x5b')],null))['then'](respondWithResult(_0x28dbf5,null))[_0x3cb7('0x27')](handleError(_0x28dbf5,null));};exports[_0x3cb7('0x7a')]=function(_0x505fd0,_0x344b57,_0x2139d8){_0x505fd0[_0x3cb7('0x5b')][_0x3cb7('0x7b')]=_0x505fd0[_0x3cb7('0x74')][_0x3cb7('0x75')];return db[_0x3cb7('0x3c')][_0x3cb7('0x59')]({'where':{'id':_0x505fd0['params']['id']}})[_0x3cb7('0x33')](handleEntityNotFound(_0x344b57,null))[_0x3cb7('0x33')](saveUpdates(_0x505fd0[_0x3cb7('0x5b')],null))[_0x3cb7('0x33')](respondWithResult(_0x344b57,null))[_0x3cb7('0x27')](handleError(_0x344b57,null));};exports[_0x3cb7('0x7c')]=function(_0x59a2f0,_0x3d26c6,_0x5eca35){var _0x391b1e=path[_0x3cb7('0x7d')](config['root'],_0x3cb7('0x7e'));var _0x2b83ac={'where':{'id':_0x59a2f0[_0x3cb7('0x55')]['id']},'attributes':['id',_0x3cb7('0x73')],'raw':!![]};var _0x577d79=![];return require('../../config/license/util')[_0x3cb7('0x7f')]()['then'](function(_0xb7d95f){if(_0xb7d95f){_0x577d79=_0xb7d95f[_0x3cb7('0x80')];}})['then'](function(){return db[_0x3cb7('0x3c')][_0x3cb7('0x59')](_0x2b83ac);})[_0x3cb7('0x33')](handleEntityNotFound(_0x3d26c6,null))['then'](function(_0x130cfb){if(_0x130cfb){if(!_['isNil'](_0x130cfb['sitepic'])){if(fs[_0x3cb7('0x81')](path['join'](config[_0x3cb7('0x82')],_0x3cb7('0x83'),_0x130cfb['sitepic']))&&_0x577d79){_0x391b1e=path[_0x3cb7('0x7d')](config[_0x3cb7('0x82')],_0x3cb7('0x83'),_0x130cfb[_0x3cb7('0x73')]);}}return _0x3d26c6['download'](_0x391b1e);}})[_0x3cb7('0x27')](handleError(_0x3d26c6,null));};exports[_0x3cb7('0x84')]=function(_0x3c44fb,_0x525981,_0x53d317){var _0x47d11e=path[_0x3cb7('0x7d')](config['root'],_0x3cb7('0x85'));var _0x355148={'where':{'id':_0x3c44fb[_0x3cb7('0x55')]['id']},'attributes':['id',_0x3cb7('0x77')],'raw':!![]};return db[_0x3cb7('0x3c')][_0x3cb7('0x59')](_0x355148)[_0x3cb7('0x33')](handleEntityNotFound(_0x525981,null))[_0x3cb7('0x33')](function(_0x4cd519){if(_0x4cd519){if(!_[_0x3cb7('0x86')](_0x4cd519[_0x3cb7('0x77')])){if(fs['existsSync'](path[_0x3cb7('0x7d')](config[_0x3cb7('0x82')],_0x3cb7('0x87'),_0x4cd519['agentAvatar']))){_0x47d11e=path[_0x3cb7('0x7d')](config[_0x3cb7('0x82')],'server/files/images/avatars/',_0x4cd519['agentAvatar']);}}return _0x525981[_0x3cb7('0x88')](_0x47d11e);}})[_0x3cb7('0x27')](handleError(_0x525981,null));};exports['getCustomerAvatar']=function(_0x564272,_0x1eb9c7,_0x276c85){var _0x5f16d5=path[_0x3cb7('0x7d')](config['root'],'server/files/images/avatars/customer_avatar.png');var _0x2a4ac5={'where':{'id':_0x564272[_0x3cb7('0x55')]['id']},'attributes':['id',_0x3cb7('0x79'),_0x3cb7('0x89')],'raw':!![]};return db[_0x3cb7('0x3c')]['find'](_0x2a4ac5)[_0x3cb7('0x33')](handleEntityNotFound(_0x1eb9c7,null))[_0x3cb7('0x33')](function(_0x2d4ac8){if(_0x2d4ac8){if(!_[_0x3cb7('0x86')](_0x2d4ac8[_0x3cb7('0x79')])){if(fs['existsSync'](path[_0x3cb7('0x7d')](config[_0x3cb7('0x82')],_0x3cb7('0x87'),_0x2d4ac8[_0x3cb7('0x79')]))&&_0x2d4ac8['showCustomerAvatar']){_0x5f16d5=path[_0x3cb7('0x7d')](config['root'],_0x3cb7('0x87'),_0x2d4ac8[_0x3cb7('0x79')]);}}return _0x1eb9c7[_0x3cb7('0x88')](_0x5f16d5);}})[_0x3cb7('0x27')](handleError(_0x1eb9c7,null));};exports[_0x3cb7('0x8a')]=function(_0x2ad0a1,_0x3420ba,_0x4dc877){var _0x21746a=path['join'](config[_0x3cb7('0x82')],_0x3cb7('0x8b'));var _0x348f65={'where':{'id':_0x2ad0a1[_0x3cb7('0x55')]['id']},'attributes':['id',_0x3cb7('0x7b')],'raw':!![]};return db[_0x3cb7('0x3c')][_0x3cb7('0x59')](_0x348f65)[_0x3cb7('0x33')](handleEntityNotFound(_0x3420ba,null))[_0x3cb7('0x33')](function(_0x2fb644){if(_0x2fb644){if(!_[_0x3cb7('0x86')](_0x2fb644[_0x3cb7('0x7b')])){if(fs['existsSync'](path[_0x3cb7('0x7d')](config[_0x3cb7('0x82')],_0x3cb7('0x87'),_0x2fb644[_0x3cb7('0x7b')]))){_0x21746a=path[_0x3cb7('0x7d')](config[_0x3cb7('0x82')],'server/files/images/avatars/',_0x2fb644[_0x3cb7('0x7b')]);}}return _0x3420ba[_0x3cb7('0x88')](_0x21746a);}})[_0x3cb7('0x27')](handleError(_0x3420ba,null));};exports[_0x3cb7('0x8c')]=function(_0x25d6c6,_0x2ccab2,_0x56ad72){var _0x572ea6=require('user-agent-parser');var _0x168f2d=new _0x572ea6();var _0x27613d=_0x168f2d[_0x3cb7('0x8d')](_0x25d6c6[_0x3cb7('0x8e')][_0x3cb7('0x8f')])[_0x3cb7('0x90')]();var _0x454d95={'body':_0x25d6c6[_0x3cb7('0x5b')],'channel':_0x3cb7('0x91')};var _0x285fde=[];var _0x8c2a13=[];var _0x53e629={};var _0x4308e5=![];return db['CmContact'][_0x3cb7('0x66')]()[_0x3cb7('0x33')](function(_0x9200d2){if(!_0x9200d2){throw new db[(_0x3cb7('0x92'))][(_0x3cb7('0x93'))](_0x3cb7('0x94'));}_0x285fde=_[_0x3cb7('0x95')](_[_0x3cb7('0x57')](_0x9200d2),[_0x3cb7('0x96'),_0x3cb7('0x97')]);_0x8c2a13=_[_0x3cb7('0x95')](_[_0x3cb7('0x57')](_0x9200d2),[_0x3cb7('0x96'),_0x3cb7('0x97'),'CompanyId',_0x3cb7('0x98')]);if(_0x25d6c6[_0x3cb7('0x5b')]['id']){delete _0x25d6c6[_0x3cb7('0x5b')]['id'];}if(_[_0x3cb7('0x86')](_0x25d6c6[_0x3cb7('0x5b')][_0x3cb7('0x99')])){throw new db[(_0x3cb7('0x92'))][(_0x3cb7('0x93'))](_0x3cb7('0x9a'));}if(_[_0x3cb7('0x86')](_0x25d6c6['body'][_0x3cb7('0x5b')])||_0x25d6c6[_0x3cb7('0x5b')][_0x3cb7('0x5b')]===''){throw new db['Sequelize'][(_0x3cb7('0x93'))](_0x3cb7('0x9b'));}if(_['isNil'](_0x25d6c6[_0x3cb7('0x5b')][_0x3cb7('0x9c')])){throw new db[(_0x3cb7('0x92'))][(_0x3cb7('0x93'))](_0x3cb7('0x9d')+_0x8c2a13);}if(!_[_0x3cb7('0x9e')](_0x8c2a13,_0x25d6c6[_0x3cb7('0x5b')][_0x3cb7('0x9c')])){throw new db['Sequelize']['ValidationError'](_0x3cb7('0x9f')+_0x8c2a13);}_0x53e629[_0x25d6c6[_0x3cb7('0x5b')][_0x3cb7('0x9c')]]=_0x25d6c6[_0x3cb7('0x5b')][_0x3cb7('0x99')];})[_0x3cb7('0x33')](function(){return db['ChatWebsite'][_0x3cb7('0x59')]({'where':{'id':_0x25d6c6[_0x3cb7('0x55')]['id']},'include':[{'model':db[_0x3cb7('0xa0')],'as':_0x3cb7('0xa1'),'include':[{'model':db['CmContact'],'as':'Contacts','where':_0x53e629,'limit':0x1,'order':[[_0x3cb7('0x97'),_0x3cb7('0xa2')]]}]},{'model':db[_0x3cb7('0xa3')],'as':_0x3cb7('0xa4')}]});})[_0x3cb7('0x33')](handleEntityNotFound(_0x2ccab2,null))['then'](function(_0x5955db){if(_0x5955db&&_0x5955db[_0x3cb7('0xa1')]){_0x454d95[_0x3cb7('0xa5')]=_0x5955db;_0x454d95[_0x3cb7('0xa6')]=_0x5955db['Applications'];_0x454d95['list']=_0x5955db[_0x3cb7('0xa1')];_0x454d95[_0x3cb7('0xa6')]=_[_0x3cb7('0xa7')](_0x454d95[_0x3cb7('0xa6')],[_0x3cb7('0xa8')],[_0x3cb7('0xa9')]);if(_0x454d95[_0x3cb7('0xa5')][_0x3cb7('0xa4')]){delete _0x454d95[_0x3cb7('0xa5')][_0x3cb7('0xa4')];}if(_0x454d95[_0x3cb7('0xa5')][_0x3cb7('0xa1')]&&_0x454d95[_0x3cb7('0xa5')][_0x3cb7('0xa1')][_0x3cb7('0xaa')][_0x3cb7('0x46')]){return _0x454d95[_0x3cb7('0xa5')][_0x3cb7('0xa1')][_0x3cb7('0xaa')][0x0];}var _0x49b2ae=_['defaults'](_0x25d6c6[_0x3cb7('0x5b')],{'firstName':_0x25d6c6[_0x3cb7('0x5b')][_0x3cb7('0x99')],'ListId':_0x5955db[_0x3cb7('0x98')]});_0x49b2ae[_0x25d6c6['body']['mapKey']]=_0x25d6c6[_0x3cb7('0x5b')][_0x3cb7('0x99')];return db['CmContact'][_0x3cb7('0x5a')](_0x49b2ae,{'fields':_0x285fde,'raw':!![]});}})['then'](handleEntityNotFound(_0x2ccab2,null))['then'](function(_0x94cf74){_0x454d95[_0x3cb7('0xab')]=_0x94cf74;var _0x398d6d=_0x25d6c6['body']['customerIp'];if(_0x25d6c6[_0x3cb7('0x8e')]['cf-connecting-ip']){_0x398d6d=_0x25d6c6[_0x3cb7('0x8e')][_0x3cb7('0xac')];}else if(_0x25d6c6[_0x3cb7('0x8e')][_0x3cb7('0xad')]){_0x398d6d=_[_0x3cb7('0xae')](_0x25d6c6[_0x3cb7('0x8e')][_0x3cb7('0xad')][_0x3cb7('0xaf')](','));}if(_0x94cf74){var _0x5ec69e={'ContactId':_0x94cf74['id'],'ChatWebsiteId':_0x25d6c6[_0x3cb7('0x55')]['id'],'from':(_0x94cf74[_0x3cb7('0xb0')]||'')+'\x20'+(_0x94cf74[_0x3cb7('0xb1')]||''),'customerIp':_0x398d6d,'customerPort':_0x25d6c6[_0x3cb7('0x8e')]['x-real-port']?_0x25d6c6['headers'][_0x3cb7('0xb2')]:null,'referer':_0x25d6c6[_0x3cb7('0x5b')][_0x3cb7('0xb3')],'browserName':_0x27613d[_0x3cb7('0xb4')][_0x3cb7('0x38')]&&_0x27613d[_0x3cb7('0xb4')]['version']?util[_0x3cb7('0xb5')]('%s\x20%s',_0x27613d['browser'][_0x3cb7('0x38')],_0x27613d[_0x3cb7('0xb4')][_0x3cb7('0xb6')]):_0x3cb7('0xb7'),'browserVersion':_0x27613d[_0x3cb7('0xb4')][_0x3cb7('0xb6')]||_0x3cb7('0xb7'),'osName':util['format']('%s\x20%s',_0x27613d['os'][_0x3cb7('0x38')],_0x27613d['os'][_0x3cb7('0xb6')]),'osVersion':_0x27613d['os'][_0x3cb7('0xb6')],'deviceModel':_0x27613d[_0x3cb7('0xb8')][_0x3cb7('0x41')]&&_0x27613d[_0x3cb7('0xb8')][_0x3cb7('0xb9')]?util[_0x3cb7('0xb5')](_0x3cb7('0xba'),_0x27613d[_0x3cb7('0xb8')]['model'],_0x27613d[_0x3cb7('0xb8')]['vendor'],_0x27613d[_0x3cb7('0xb8')][_0x3cb7('0x3f')]):null,'deviceVendor':_0x27613d[_0x3cb7('0xb8')]['vendor'],'deviceType':_0x27613d[_0x3cb7('0xb8')][_0x3cb7('0x3f')],'formData':JSON[_0x3cb7('0x22')](_0x25d6c6[_0x3cb7('0x5b')])};var _0x3096e2={'ChatWebsiteId':_0x25d6c6[_0x3cb7('0x55')]['id'],'closed':![]};if(_0x25d6c6[_0x3cb7('0x5b')][_0x3cb7('0xbb')]){_0x3096e2[_0x3cb7('0xbb')]=_0x25d6c6[_0x3cb7('0x5b')][_0x3cb7('0xbb')];return db['ChatInteraction']['find']({'where':_0x3096e2})[_0x3cb7('0x33')](function(_0x39eb48){if(_0x39eb48){return[_0x39eb48,![]];}_0x5ec69e['threadId']=_0x25d6c6[_0x3cb7('0x5b')][_0x3cb7('0xbb')];_0x5ec69e[_0x3cb7('0xbc')]=_0x25d6c6[_0x3cb7('0x5b')][_0x3cb7('0xbc')];return db[_0x3cb7('0xbd')]['create'](_0x5ec69e)[_0x3cb7('0x33')](function(_0x5b4a8b){return[_0x5b4a8b,!![]];});});}_0x3096e2[_0x3cb7('0xbe')]=_0x94cf74['id'];if(_0x25d6c6[_0x3cb7('0x5b')][_0x3cb7('0xbf')]&&_0x25d6c6['body'][_0x3cb7('0xbf')]['id']){_0x3096e2['id']=_0x25d6c6[_0x3cb7('0x5b')][_0x3cb7('0xbf')]['id'];return db['ChatInteraction'][_0x3cb7('0x59')]({'where':_0x3096e2})[_0x3cb7('0x33')](function(_0x7c9627){if(_0x7c9627){return[_0x7c9627,![]];}return db[_0x3cb7('0xbd')][_0x3cb7('0x5a')](_0x5ec69e)[_0x3cb7('0x33')](function(_0x14c31d){return[_0x14c31d,!![]];});});}return db[_0x3cb7('0xbd')]['create'](_0x5ec69e)[_0x3cb7('0x33')](function(_0x41d706){return[_0x41d706,!![]];});}})['spread'](function(_0x30975b,_0x5a74ee){if(_0x30975b){_0x4308e5=_0x5a74ee;if(!_0x5a74ee){var _0x5cbf8f={'from':(_0x454d95[_0x3cb7('0xab')][_0x3cb7('0xb0')]||'')+'\x20'+(_0x454d95['contact'][_0x3cb7('0xb1')]||'')};if(_0x25d6c6[_0x3cb7('0x5b')][_0x3cb7('0xbb')]&&_0x25d6c6[_0x3cb7('0x5b')]['messageId']&&_0x25d6c6[_0x3cb7('0x5b')][_0x3cb7('0xbb')]!=_0x25d6c6[_0x3cb7('0x5b')][_0x3cb7('0xc0')]){_0x5cbf8f[_0x3cb7('0xbb')]=_0x25d6c6[_0x3cb7('0x5b')][_0x3cb7('0xc0')];}return _0x30975b[_0x3cb7('0x64')](_0x5cbf8f);}else{return _0x30975b;}}})[_0x3cb7('0x33')](function(_0x46df66){_0x454d95['interaction']=_0x46df66[_0x3cb7('0x35')]({'plain':!![]});_0x454d95[_0x3cb7('0xbf')][_0x3cb7('0xc1')]=_0x4308e5;if(_0x454d95[_0x3cb7('0xbf')][_0x3cb7('0xc1')]){if(_0x454d95[_0x3cb7('0xa5')][_0x3cb7('0xc2')]){_0x454d95['applications'][_0x3cb7('0xc3')]({'id':0x0,'priority':_0x454d95['applications']['length']+0x1,'app':_0x3cb7('0xc4'),'appdata':_0x3cb7('0xc5'),'interval':_0x3cb7('0xc6')});}}return db[_0x3cb7('0xc7')]['create']({'body':_0x25d6c6['body'][_0x3cb7('0x5b')],'ChatWebsiteId':_0x25d6c6[_0x3cb7('0x55')]['id'],'ChatInteractionId':_0x46df66['id'],'direction':'in','ContactId':_0x454d95[_0x3cb7('0xab')]['id'],'AttachmentId':_0x25d6c6[_0x3cb7('0x5b')][_0x3cb7('0xc8')]});})[_0x3cb7('0x33')](function(_0x15b9b1){_0x454d95['message']=_0x15b9b1;if(_0x454d95[_0x3cb7('0xbf')][_0x3cb7('0xc9')]){return db[_0x3cb7('0xca')][_0x3cb7('0x59')]({'attributes':['id','name'],'where':{'id':_0x454d95[_0x3cb7('0xbf')][_0x3cb7('0xc9')]}})['then'](function(_0x458fef){if(_0x458fef){_0x454d95['applications'][_0x3cb7('0xcb')]({'id':0x0,'priority':0x0,'app':_0x3cb7('0xcc'),'appdata':_0x458fef[_0x3cb7('0x38')]+','+(_0x454d95['account'][_0x3cb7('0xcd')]||0xa),'interval':_0x3cb7('0xc6')});_0x454d95[_0x3cb7('0xce')]=!![];}return respondWithRpcPromise(_0x3cb7('0xcf'),_0x3cb7('0xd0'),_0x454d95);});}return respondWithRpcPromise(_0x3cb7('0xcf'),'startRouting',_0x454d95);})[_0x3cb7('0x33')](function(_0x2fa2cf){respondWithRpcPromise(_0x3cb7('0xd1'),_0x3cb7('0xd1'),{'event':_0x3cb7('0x8c'),'message':_0x2fa2cf},client9002);return _0x2fa2cf;})[_0x3cb7('0x33')](respondWithResult(_0x2ccab2,null))[_0x3cb7('0x27')](handleError(_0x2ccab2,null));};exports[_0x3cb7('0xd2')]=function(_0x3b4ae4,_0x37919f,_0x5afd80){var _0x5bd3a6,_0x265cac,_0x2ea5a3;var _0x46a11e=[];var _0x4b17e4=[];var _0x567466={};var _0x1ce47e=_0x3b4ae4[_0x3cb7('0xd3')]||[];var _0x5898=[];var _0x4f3792;return db[_0x3cb7('0xd4')]['describe']()[_0x3cb7('0x33')](function(_0x4653ad){if(!_0x4653ad){throw new db[(_0x3cb7('0x92'))][(_0x3cb7('0x93'))](_0x3cb7('0x94'));}_0x4b17e4=_[_0x3cb7('0x95')](_[_0x3cb7('0x57')](_0x4653ad),[_0x3cb7('0x96'),'updatedAt']);_0x46a11e=_[_0x3cb7('0x95')](_[_0x3cb7('0x57')](_0x4653ad),[_0x3cb7('0x96'),_0x3cb7('0x97'),'CompanyId',_0x3cb7('0x98')]);if(_0x3b4ae4[_0x3cb7('0x5b')]['id']){delete _0x3b4ae4['body']['id'];}if(_[_0x3cb7('0x86')](_0x3b4ae4[_0x3cb7('0x5b')][_0x3cb7('0x99')])){throw _0x37919f[_0x3cb7('0x29')](0x1f4)['send'](new db[(_0x3cb7('0x92'))][(_0x3cb7('0x93'))](_0x3cb7('0x9a')));}if(_[_0x3cb7('0x86')](_0x3b4ae4[_0x3cb7('0x5b')]['body'])||_0x3b4ae4[_0x3cb7('0x5b')][_0x3cb7('0x5b')]===''){throw _0x37919f[_0x3cb7('0x29')](0x1f4)['send'](new db['Sequelize'][(_0x3cb7('0x93'))](_0x3cb7('0x9b')));}if(_[_0x3cb7('0x86')](_0x3b4ae4[_0x3cb7('0x5b')][_0x3cb7('0xd5')])){throw _0x37919f[_0x3cb7('0x29')](0x1f4)[_0x3cb7('0x39')](new db['Sequelize'][(_0x3cb7('0x93'))](_0x3cb7('0xd6')+_0x46a11e));}if(!_[_0x3cb7('0x9e')](_0x46a11e,_0x3b4ae4[_0x3cb7('0x5b')][_0x3cb7('0xd5')])){throw _0x37919f['status'](0x1f4)['send'](new db[(_0x3cb7('0x92'))][(_0x3cb7('0x93'))](_0x3cb7('0xd7')+_0x46a11e));}_0x567466[_0x3b4ae4['body'][_0x3cb7('0xd5')]]=_0x3b4ae4[_0x3cb7('0x5b')][_0x3cb7('0x99')];})['then'](function(){return db[_0x3cb7('0x3c')][_0x3cb7('0x59')]({'where':{'id':_0x3b4ae4[_0x3cb7('0x55')]['id']},'include':[{'model':db['CmList'],'as':_0x3cb7('0xa1')},{'model':db[_0x3cb7('0xd8')],'as':_0x3cb7('0xd8')}]});})[_0x3cb7('0x33')](handleEntityNotFound(_0x37919f,null))[_0x3cb7('0x33')](function(_0x3c1395){if(_0x3c1395&&_0x3c1395[_0x3cb7('0xa1')]){_0x265cac=_0x3c1395;var _0xf49d6f=_[_0x3cb7('0x18')](_0x3b4ae4[_0x3cb7('0x5b')],{'firstName':_0x3b4ae4[_0x3cb7('0x5b')][_0x3cb7('0x99')],'phone':_0x3b4ae4['body'][_0x3cb7('0x99')],'ListId':_0x3c1395[_0x3cb7('0x98')]});_0xf49d6f[_0x3b4ae4[_0x3cb7('0x5b')]['mapKeyOffline']]=_0x3b4ae4[_0x3cb7('0x5b')][_0x3cb7('0x99')];return db[_0x3cb7('0xd4')][_0x3cb7('0xd9')]({'where':_0x567466,'defaults':_0xf49d6f});}})[_0x3cb7('0xda')](function(_0x1b301d){if(_0x1b301d){_0x2ea5a3=_0x1b301d;var _0x1360c9=fs[_0x3cb7('0xdb')](path[_0x3cb7('0x7d')](config[_0x3cb7('0x82')],_0x3cb7('0xdc')),_0x3cb7('0xdd'));var _0x3ff228=ejs[_0x3cb7('0xde')](_0x1360c9,{'body':_[_0x3cb7('0xdf')](_0x3b4ae4['body'][_0x3cb7('0x5b')]),'bodyTitle':_0x265cac[_0x3cb7('0xe0')]});return db[_0x3cb7('0xe1')][_0x3cb7('0x5a')]({'body':_0x3ff228,'ContactId':_0x1b301d['id'],'ChatWebsiteId':_0x265cac['id']});}})[_0x3cb7('0x33')](function(_0x1130cf){_0x4f3792=_0x1130cf;if(_0x1ce47e[_0x3cb7('0x46')]){var _0x37a33d=_0x1ce47e[_0x3cb7('0x3b')](function(_0x253065){return{'name':_0x253065[_0x3cb7('0xe2')],'basename':_0x253065[_0x3cb7('0x75')],'type':_0x253065[_0x3cb7('0xe3')],'ChatOfflineMessageId':_0x1130cf['id']};});_0x5898=_0x37a33d[_0x3cb7('0x3b')](_0x369598=>{var _0x2959f9={'filename':_0x369598[_0x3cb7('0x38')],'path':path[_0x3cb7('0x7d')](config[_0x3cb7('0x82')],'server',_0x3cb7('0xd3'),_0x3cb7('0xe4'),_0x3cb7('0xe5'),_0x369598['basename'])};return _0x2959f9;});if(!_0x265cac['openNewInteraction']){return db[_0x3cb7('0xe6')][_0x3cb7('0xe7')](function(_0xc7e1fb){return db[_0x3cb7('0xe8')]['bulkCreate'](_0x37a33d,{'transaction':_0xc7e1fb});});}}})[_0x3cb7('0x33')](function(){if(_0x4f3792){_0x5bd3a6=_0x4f3792;return db[_0x3cb7('0xd8')][_0x3cb7('0x69')]({'where':{'active':!![]},'include':[{'model':db[_0x3cb7('0xe9')],'as':_0x3cb7('0xea'),'raw':!![]}]});}})['then'](function(_0xbbadb2){if(_0xbbadb2&&_0xbbadb2['Smtp']&&_0x265cac[_0x3cb7('0xeb')]&&_0x265cac['forwardOfflineAddress']){var _0x1bcac8={'tls':{'rejectUnauthorized':![]}};if(_0xbbadb2['Smtp'][_0x3cb7('0xec')]){_0x1bcac8[_0x3cb7('0xec')]=_0xbbadb2[_0x3cb7('0xea')][_0x3cb7('0xec')];}else{_0x1bcac8[_0x3cb7('0xed')]=_0xbbadb2[_0x3cb7('0xea')][_0x3cb7('0xed')];_0x1bcac8[_0x3cb7('0xee')]=_0xbbadb2[_0x3cb7('0xea')][_0x3cb7('0xee')];_0x1bcac8[_0x3cb7('0xef')]=_0xbbadb2[_0x3cb7('0xea')][_0x3cb7('0xef')];}if(_0xbbadb2['Smtp']['authentication']){_0x1bcac8['auth']={'user':_0xbbadb2[_0x3cb7('0xea')][_0x3cb7('0x5c')],'pass':_0xbbadb2[_0x3cb7('0xea')]['pass']};}return respondWithRpcPromise('SendMail',_0x3cb7('0xf0'),{'account':_0x1bcac8,'message':{'from':util['format'](_0x3cb7('0xf1'),_0xbbadb2[_0x3cb7('0x38')],_0xbbadb2[_0x3cb7('0xf2')]||_0xbbadb2['Smtp'][_0x3cb7('0x5c')]),'to':_0x265cac[_0x3cb7('0xf3')],'subject':_0x265cac[_0x3cb7('0xf4')],'html':_0x5bd3a6[_0x3cb7('0x5b')],'attachments':_0x5898}},client9003)[_0x3cb7('0x33')](function(){return _0x5bd3a6;})[_0x3cb7('0x27')](function(_0x22d8de){console[_0x3cb7('0x23')](_0x22d8de);});}})[_0x3cb7('0x33')](function(){if(_0x265cac&&_0x265cac[_0x3cb7('0xf5')]&&_0x265cac[_0x3cb7('0xf6')]){var _0x3ffb22=[];if(_0x1ce47e[_0x3cb7('0x46')]){_0x3ffb22=_0x1ce47e[_0x3cb7('0x3b')](function(_0x552ea4){return{'name':_0x552ea4[_0x3cb7('0xe2')],'basename':_0x552ea4['filename'],'type':_0x552ea4['mimetype'],'ChatOfflineMessageId':_0x4f3792['id']};});}var _0x5e9c65;if(!_[_0x3cb7('0x86')](_0x265cac['subjectOffline'])){var _0x88ea94=_[_0x3cb7('0x3b')](_0x3b4ae4[_0x3cb7('0x5b')],function(_0x4f4948){return _0x4f4948;});var _0xb353f7=_[_0x3cb7('0xf7')](_0x88ea94)[0x0];var _0x37b4cd=_[_0x3cb7('0xf8')](_0xb353f7,function(_0x531eab){return _0x531eab;});_0x5e9c65=_0x37b4cd[0x1][_0x265cac['subjectOffline']];}var _0x168102={'from':_0x2ea5a3[_0x3cb7('0xf2')],'firstName':_0x2ea5a3['firstName'],'lastName':_0x2ea5a3['lastName'],'mapKey':_0x3cb7('0xf2'),'message':{'from':_0x2ea5a3[_0x3cb7('0xf2')],'to':_0x265cac['MailAccount'][_0x3cb7('0xf2')],'cc':'','subject':_[_0x3cb7('0x86')](_0x5e9c65)?_0x265cac[_0x3cb7('0xf4')]:_0x5e9c65,'messageId':'','sentAt':new Date(),'attach':_0x3ffb22[_0x3cb7('0x46')],'attachments':_0x3ffb22,'originChannel':_0x3cb7('0xf9'),'ChatWebsiteId':_0x265cac['id'],'ChatOfflineMessageId':_0x5bd3a6['id'],'originTo':_0x265cac[_0x3cb7('0xd8')]['email']},'body':_0x5bd3a6[_0x3cb7('0x5b')]};var _0x412ca3={'account':{'id':_0x265cac[_0x3cb7('0xf6')]},'body':_0x168102,'log':_0x3cb7('0xfa')};return respondWithRpcPromise(_0x3cb7('0xfa'),_0x3cb7('0xfb'),_0x412ca3,client9001)[_0x3cb7('0x33')](function(){return _0x5bd3a6;})[_0x3cb7('0x27')](function(_0x196f0d){console[_0x3cb7('0x23')](_0x196f0d);});}return;})[_0x3cb7('0x33')](function(){if(_0x5bd3a6){return _0x5bd3a6;}})[_0x3cb7('0x33')](respondWithResult(_0x37919f,null))[_0x3cb7('0x27')](function(_0x12d3f8){console[_0x3cb7('0x23')](_0x3cb7('0x27'),_0x12d3f8);for(var _0x35d74a of _0x1ce47e){var _0x88aace=path[_0x3cb7('0x7d')](config[_0x3cb7('0x82')],'server',_0x3cb7('0xd3'),'attachments',_0x3cb7('0xe5'),_0x35d74a[_0x3cb7('0x75')]);fs_extra[_0x3cb7('0xfc')](_0x88aace)[_0x3cb7('0x27')](function(_0x177cf6){console[_0x3cb7('0x23')](_0x3cb7('0xfd'),_0x88aace,_0x177cf6);});}});};exports[_0x3cb7('0xfe')]=function(_0x4cd237,_0x5c6eda,_0x1932a8){return db[_0x3cb7('0xbd')][_0x3cb7('0x59')]({'where':{'id':_0x4cd237[_0x3cb7('0x55')]['id']}})[_0x3cb7('0x33')](handleEntityNotFound(_0x5c6eda,null))[_0x3cb7('0x33')](function(_0x284ee3){if(_0x284ee3){return _0x284ee3[_0x3cb7('0xfe')](_0x4cd237[_0x3cb7('0x5b')][_0x3cb7('0x6d')],_['omit'](_0x4cd237['body'],[_0x3cb7('0x6d'),'id'])||{});}})[_0x3cb7('0x33')](respondWithResult(_0x5c6eda,null))[_0x3cb7('0x27')](handleError(_0x5c6eda,null));};exports[_0x3cb7('0xff')]=function(_0x11bf46,_0x30593e,_0x219fa1){var _0x1b580f={'raw':![],'where':{}};var _0x4c7fb0={};var _0x5a3b9c={'count':0x0,'rows':[]};return db[_0x3cb7('0x3c')][_0x3cb7('0x69')]({'where':{'id':_0x11bf46['params']['id']}})[_0x3cb7('0x33')](handleEntityNotFound(_0x30593e,null))[_0x3cb7('0x33')](function(_0x2d75bb){if(_0x2d75bb){_0x4c7fb0[_0x3cb7('0x41')]=_[_0x3cb7('0x57')](db['ChatInteraction'][_0x3cb7('0x3d')]);_0x4c7fb0['query']=_[_0x3cb7('0x57')](_0x11bf46[_0x3cb7('0x42')]);_0x4c7fb0[_0x3cb7('0x4d')]=_[_0x3cb7('0x43')](_0x4c7fb0[_0x3cb7('0x41')],_0x4c7fb0[_0x3cb7('0x42')]);_0x1b580f[_0x3cb7('0x44')]=_['intersection'](_0x4c7fb0[_0x3cb7('0x41')],qs[_0x3cb7('0x45')](_0x11bf46[_0x3cb7('0x42')]['fields']));_0x1b580f[_0x3cb7('0x44')]=_0x1b580f[_0x3cb7('0x44')][_0x3cb7('0x46')]?_0x1b580f[_0x3cb7('0x44')]:_0x4c7fb0[_0x3cb7('0x41')];if(!_0x11bf46['query'][_0x3cb7('0x47')](_0x3cb7('0x48'))){_0x1b580f[_0x3cb7('0x49')]=qs[_0x3cb7('0x49')](_0x11bf46[_0x3cb7('0x42')][_0x3cb7('0x49')]);_0x1b580f[_0x3cb7('0x2d')]=qs[_0x3cb7('0x2d')](_0x11bf46[_0x3cb7('0x42')][_0x3cb7('0x2d')]);}_0x1b580f[_0x3cb7('0x4a')]=qs['sort'](_0x11bf46[_0x3cb7('0x42')][_0x3cb7('0x4b')]);_0x1b580f['where']=qs[_0x3cb7('0x4d')](_[_0x3cb7('0x6b')](_0x11bf46['query'],_0x4c7fb0[_0x3cb7('0x4d')]));_0x1b580f[_0x3cb7('0x4c')][_0x3cb7('0x67')]=_0x2d75bb['id'];if(_0x11bf46[_0x3cb7('0x42')][_0x3cb7('0x4f')]){_0x1b580f['where']=_['merge'](_0x1b580f[_0x3cb7('0x4c')],{'$or':_[_0x3cb7('0x3b')](_0x1b580f[_0x3cb7('0x44')],function(_0x161aa4){var _0x52d584={};_0x52d584[_0x161aa4]={'$like':'%'+_0x11bf46[_0x3cb7('0x42')]['filter']+'%'};return _0x52d584;})});}_0x1b580f=_[_0x3cb7('0x4e')]({},_0x1b580f,_0x11bf46[_0x3cb7('0x50')]);return db[_0x3cb7('0xbd')][_0x3cb7('0x2c')]({'where':_0x1b580f[_0x3cb7('0x4c')]})[_0x3cb7('0x33')](function(_0x42ff5a){_0x5a3b9c['count']=_0x42ff5a;if(_0x11bf46[_0x3cb7('0x42')][_0x3cb7('0x51')]){_0x1b580f[_0x3cb7('0x58')]=[{'model':db[_0x3cb7('0xd4')],'as':_0x3cb7('0x100'),'required':![]},{'model':db['User'],'as':_0x3cb7('0x101'),'attributes':['name',_0x3cb7('0x102'),_0x3cb7('0x103')],'required':![]},{'model':db['Tag'],'as':_0x3cb7('0x104'),'attributes':['id','name',_0x3cb7('0x105')],'where':_0x11bf46[_0x3cb7('0x42')]['tag']?{'id':_0x11bf46[_0x3cb7('0x42')][_0x3cb7('0x106')]}:undefined,'required':_0x11bf46[_0x3cb7('0x42')][_0x3cb7('0x106')]?!![]:![]}];}return db['ChatInteraction'][_0x3cb7('0x52')](_0x1b580f);})[_0x3cb7('0x33')](function(_0x55bee0){_0x5a3b9c[_0x3cb7('0x53')]=_0x55bee0;return _0x5a3b9c;});}})[_0x3cb7('0x33')](respondWithFilteredResult(_0x30593e,_0x1b580f))[_0x3cb7('0x27')](handleError(_0x30593e,null));};function iftimePromise(_0x2a8f47,_0xfbc907){return respondWithRpcPromise('Command','getSnippet',{'command':_0xfbc907['timezone']?util[_0x3cb7('0xb5')](_0x3cb7('0x107'),_0x2a8f47['interval'],_0xfbc907[_0x3cb7('0x108')]):util[_0x3cb7('0xb5')](_0x3cb7('0x109'),_0x2a8f47[_0x3cb7('0x10a')])},client9002)[_0x3cb7('0x33')](function(_0x32172b){var _0x21525f=_0x32172b&&_0x32172b['indexOf'](_0x3cb7('0x10b'))>=0x0?!![]:![];logger[_0x3cb7('0x1e')](_0x3cb7('0x10c'),_0xfbc907['id'],_0x2a8f47['id'],_0x2a8f47[_0x3cb7('0x10a')],_0x21525f?_0x3cb7('0x10d'):'OFFLINE',_0xfbc907[_0x3cb7('0x108')]?_0xfbc907['timezone']:_0x3cb7('0x10e'));return _0x21525f;})[_0x3cb7('0x27')](function(_0x3fd7b2){logger[_0x3cb7('0x23')](_0x3cb7('0x10c'),_0xfbc907['id'],_0x2a8f47['id'],_0x2a8f47['interval'],util[_0x3cb7('0x10f')](_0x3fd7b2,{'showHidden':![],'depth':null}),_0xfbc907[_0x3cb7('0x108')]?_0xfbc907['timezone']:'No\x20timezone');return![];});}exports[_0x3cb7('0x110')]=function(_0x884543,_0x21f0e9,_0x371c99){var _0x4ae07f=0x0;var _0x1a5c1b=0x0;var _0x1301ce=![];var _0x115d21;var _0x2ab66a;return db[_0x3cb7('0x3c')][_0x3cb7('0x59')]({'where':{'id':_0x884543[_0x3cb7('0x55')]['id']},'include':[{'model':db[_0x3cb7('0x111')],'as':_0x3cb7('0x111'),'include':[{'model':db['Interval'],'as':_0x3cb7('0x112'),'attributes':['id',_0x3cb7('0x10a')],'raw':!![]}]}]})['then'](handleEntityNotFound(_0x21f0e9,null))[_0x3cb7('0x33')](function(_0x3817c8){if(_0x3817c8){_0x115d21=_0x3817c8;return _0x3817c8[_0x3cb7('0x113')]({'raw':!![]});}})[_0x3cb7('0x33')](function(_0x26ab4d){if(_0x115d21){if(_0x26ab4d){_0x2ab66a=_0x26ab4d;}}return require(_0x3cb7('0x15'))[_0x3cb7('0x7f')]();})[_0x3cb7('0x33')](function(_0x282ba4){if(_0x282ba4){_0x1a5c1b=_0x282ba4[_0x3cb7('0x114')];_0x1301ce=_0x282ba4[_0x3cb7('0x80')];}})['then'](function(){return db[_0x3cb7('0xbd')]['count']({'where':{'closed':![]}});})[_0x3cb7('0x33')](function(_0x16e500){_0x4ae07f=_0x16e500;if(_0x1a5c1b&&_0x16e500>_0x1a5c1b){return db[_0x3cb7('0x115')]['findOne']({'where':{'id':0x1}})['then'](function(_0x20e9ca){if(_0x20e9ca){_0x20e9ca[_0x3cb7('0x116')]('chatLicenseExceeded');}});}})[_0x3cb7('0x33')](function(){if(_0x115d21[_0x3cb7('0x111')]&&_0x115d21[_0x3cb7('0x111')][_0x3cb7('0x112')]){var _0x3c37f0=[];for(var _0x3a5793=0x0;_0x3a5793<_0x115d21['Interval'][_0x3cb7('0x112')][_0x3cb7('0x46')];_0x3a5793++){var _0x2744b9=_0x115d21[_0x3cb7('0x111')][_0x3cb7('0x112')][_0x3a5793][_0x3cb7('0x35')]({'plain':!![]});_0x3c37f0['push'](iftimePromise(_0x2744b9,_0x115d21));}return BPromise['all'](_0x3c37f0)[_0x3cb7('0x33')](function(_0x4c6da2){return _[_0x3cb7('0x117')](_0x4c6da2);});}else{return!![];}})[_0x3cb7('0x33')](function(_0x18ddcc){var _0x45a046=fs[_0x3cb7('0xdb')](path[_0x3cb7('0x7d')](config[_0x3cb7('0x82')],_0x3cb7('0x118')),_0x3cb7('0xdd'));var _0x8396a5={'remote':_0x115d21[_0x3cb7('0x119')],'query':querystring[_0x3cb7('0x22')](_[_0x3cb7('0x4e')](_0x115d21['get']({'plain':!![]}),{'customerIp':_0x884543[_0x3cb7('0x8e')][_0x3cb7('0xad')]||_0x884543['headers'][_0x3cb7('0x11a')]||_0x884543[_0x3cb7('0x11b')]['remoteAddress']||_0x884543['ip'],'referer':_0x884543[_0x3cb7('0x8e')][_0x3cb7('0xb3')],'openedInteractions':_0x4ae07f,'maxInteractions':_0x1a5c1b,'virtual':_0x1301ce['virtual'],'online':_0x18ddcc,'custom':_0x1301ce}))[_0x3cb7('0x11c')](/'/g,'\x5c\x27')};_0x21f0e9[_0x3cb7('0x39')](ejs[_0x3cb7('0xde')](Mustache[_0x3cb7('0xde')](_0x45a046,_0x8396a5),{'proactiveActions':_0x2ab66a,'alignment':_0x115d21[_0x3cb7('0x11d')],'verticalAlignment':_0x115d21[_0x3cb7('0x11e')],'div_color':_0x115d21[_0x3cb7('0x105')],'text_color':_0x115d21['textColor'],'button_color':_0x115d21[_0x3cb7('0x11f')],'background_color':_0x115d21['backgroundColor']}));})[_0x3cb7('0x27')](handleError(_0x21f0e9,null));};exports[_0x3cb7('0x120')]=function(_0x261503,_0x3f8690,_0x2a3f94){return db[_0x3cb7('0x3c')][_0x3cb7('0x69')]({'where':{'id':_0x261503[_0x3cb7('0x55')]['id']}})[_0x3cb7('0x33')](handleEntityNotFound(_0x3f8690,null))[_0x3cb7('0x33')](function(_0x2203be){if(_0x2203be){return db[_0x3cb7('0xe6')]['transaction'](function(_0x504177){return db[_0x3cb7('0xa3')][_0x3cb7('0x34')]({'where':{'ChatWebsiteId':_0x261503[_0x3cb7('0x55')]['id']},'transaction':_0x504177})[_0x3cb7('0x33')](function(_0x3c1da8){var _0x438e85=_[_0x3cb7('0x3b')](_0x261503[_0x3cb7('0x5b')],function(_0x47a0ab){_0x47a0ab[_0x3cb7('0x67')]=_0x261503[_0x3cb7('0x55')]['id'];return _0x47a0ab;});return db[_0x3cb7('0xa3')][_0x3cb7('0x121')](_0x438e85,{'transaction':_0x504177});});})[_0x3cb7('0x33')](function(){return db[_0x3cb7('0xa3')][_0x3cb7('0x122')]({'where':{'ChatWebsiteId':_0x261503[_0x3cb7('0x55')]['id']},'order':'priority'});});}})[_0x3cb7('0x33')](respondWithResult(_0x3f8690,null))['catch'](handleError(_0x3f8690,null));};exports[_0x3cb7('0x123')]=function(_0x3e31e9,_0x2106a3,_0x5e5d95){var _0x337ae7={};var _0x21f91c={};var _0x139fdd;var _0x3a9ff1;return db[_0x3cb7('0x3c')]['findOne']({'where':{'id':_0x3e31e9[_0x3cb7('0x55')]['id']}})[_0x3cb7('0x33')](handleEntityNotFound(_0x2106a3,null))[_0x3cb7('0x33')](function(_0x2fe4ba){if(_0x2fe4ba){_0x139fdd=_0x2fe4ba;_0x21f91c[_0x3cb7('0x41')]=_[_0x3cb7('0x57')](db[_0x3cb7('0xa3')][_0x3cb7('0x3d')]);_0x21f91c['query']=_['keys'](_0x3e31e9[_0x3cb7('0x42')]);_0x21f91c[_0x3cb7('0x4d')]=_['intersection'](_0x21f91c[_0x3cb7('0x41')],_0x21f91c[_0x3cb7('0x42')]);_0x337ae7[_0x3cb7('0x44')]=_[_0x3cb7('0x43')](_0x21f91c[_0x3cb7('0x41')],qs[_0x3cb7('0x45')](_0x3e31e9[_0x3cb7('0x42')]['fields']));_0x337ae7[_0x3cb7('0x44')]=_0x337ae7[_0x3cb7('0x44')][_0x3cb7('0x46')]?_0x337ae7['attributes']:_0x21f91c[_0x3cb7('0x41')];_0x337ae7[_0x3cb7('0x4a')]=qs['sort'](_0x3e31e9['query'][_0x3cb7('0x4b')]);_0x337ae7['where']=qs[_0x3cb7('0x4d')](_[_0x3cb7('0x6b')](_0x3e31e9[_0x3cb7('0x42')],_0x21f91c['filters']));if(_0x3e31e9[_0x3cb7('0x42')]['filter']){_0x337ae7[_0x3cb7('0x4c')]=_[_0x3cb7('0x4e')](_0x337ae7['where'],{'$or':_[_0x3cb7('0x3b')](_0x337ae7[_0x3cb7('0x44')],function(_0x23cdcb){var _0x19b4be={};_0x19b4be[_0x23cdcb]={'$like':'%'+_0x3e31e9[_0x3cb7('0x42')][_0x3cb7('0x4f')]+'%'};return _0x19b4be;})});}_0x337ae7=_[_0x3cb7('0x4e')]({},_0x337ae7,_0x3e31e9['options']);return _0x139fdd['getApplications'](_0x337ae7);}})[_0x3cb7('0x33')](function(_0x490811){if(_0x490811){_0x3a9ff1=_0x490811[_0x3cb7('0x46')];if(!_0x3e31e9[_0x3cb7('0x42')][_0x3cb7('0x47')](_0x3cb7('0x48'))){_0x337ae7[_0x3cb7('0x49')]=qs[_0x3cb7('0x49')](_0x3e31e9['query'][_0x3cb7('0x49')]);_0x337ae7[_0x3cb7('0x2d')]=qs[_0x3cb7('0x2d')](_0x3e31e9[_0x3cb7('0x42')][_0x3cb7('0x2d')]);}return _0x139fdd[_0x3cb7('0x123')](_0x337ae7);}})[_0x3cb7('0x33')](function(_0x3590ce){if(_0x3590ce){return _0x3590ce?{'count':_0x3a9ff1,'rows':_0x3590ce}:null;}})[_0x3cb7('0x33')](respondWithResult(_0x2106a3,null))['catch'](handleError(_0x2106a3,null));};exports[_0x3cb7('0x124')]=function(_0x2b6a84,_0x358118,_0x3248a3){return db[_0x3cb7('0x125')][_0x3cb7('0x59')]({'where':{'id':_0x2b6a84[_0x3cb7('0x55')]['id']}})[_0x3cb7('0x33')](handleEntityNotFound(_0x358118,null))['then'](function(_0x47625c){if(_0x47625c){return _0x47625c['addProactiveActions'](_0x2b6a84[_0x3cb7('0x5b')][_0x3cb7('0x6d')],_[_0x3cb7('0x126')](_0x2b6a84[_0x3cb7('0x5b')],[_0x3cb7('0x6d'),'id'])||{});}})[_0x3cb7('0x33')](respondWithResult(_0x358118,null))[_0x3cb7('0x27')](handleError(_0x358118,null));};exports[_0x3cb7('0x113')]=function(_0x2c8edd,_0x520ed5,_0x54136c){var _0x11b434={};var _0x11d0d8={};var _0x2e835e;var _0x2b3d05;return db['ChatWebsite']['findOne']({'where':{'id':_0x2c8edd[_0x3cb7('0x55')]['id']}})['then'](handleEntityNotFound(_0x520ed5,null))[_0x3cb7('0x33')](function(_0x477f14){if(_0x477f14){_0x2e835e=_0x477f14;_0x11d0d8[_0x3cb7('0x41')]=_[_0x3cb7('0x57')](db['ChatProactiveAction']['rawAttributes']);_0x11d0d8[_0x3cb7('0x42')]=_[_0x3cb7('0x57')](_0x2c8edd[_0x3cb7('0x42')]);_0x11d0d8[_0x3cb7('0x4d')]=_['intersection'](_0x11d0d8[_0x3cb7('0x41')],_0x11d0d8[_0x3cb7('0x42')]);_0x11b434['attributes']=_['intersection'](_0x11d0d8[_0x3cb7('0x41')],qs[_0x3cb7('0x45')](_0x2c8edd[_0x3cb7('0x42')][_0x3cb7('0x45')]));_0x11b434[_0x3cb7('0x44')]=_0x11b434[_0x3cb7('0x44')][_0x3cb7('0x46')]?_0x11b434['attributes']:_0x11d0d8[_0x3cb7('0x41')];_0x11b434[_0x3cb7('0x4a')]=qs[_0x3cb7('0x4b')](_0x2c8edd[_0x3cb7('0x42')][_0x3cb7('0x4b')]);_0x11b434[_0x3cb7('0x4c')]=qs[_0x3cb7('0x4d')](_[_0x3cb7('0x6b')](_0x2c8edd[_0x3cb7('0x42')],_0x11d0d8['filters']));if(_0x2c8edd[_0x3cb7('0x42')][_0x3cb7('0x4f')]){_0x11b434[_0x3cb7('0x4c')]=_[_0x3cb7('0x4e')](_0x11b434['where'],{'$or':_[_0x3cb7('0x3b')](_0x11b434[_0x3cb7('0x44')],function(_0x37e14c){var _0x3ac3a8={};_0x3ac3a8[_0x37e14c]={'$like':'%'+_0x2c8edd[_0x3cb7('0x42')]['filter']+'%'};return _0x3ac3a8;})});}_0x11b434=_[_0x3cb7('0x4e')]({},_0x11b434,_0x2c8edd['options']);return _0x2e835e['getProactiveActions'](_0x11b434);}})[_0x3cb7('0x33')](function(_0x387d2f){if(_0x387d2f){_0x2b3d05=_0x387d2f[_0x3cb7('0x46')];if(!_0x2c8edd[_0x3cb7('0x42')]['hasOwnProperty']('nolimit')){_0x11b434['limit']=qs['limit'](_0x2c8edd[_0x3cb7('0x42')][_0x3cb7('0x49')]);_0x11b434[_0x3cb7('0x2d')]=qs[_0x3cb7('0x2d')](_0x2c8edd[_0x3cb7('0x42')][_0x3cb7('0x2d')]);}return _0x2e835e[_0x3cb7('0x113')](_0x11b434);}})['then'](function(_0x3c17f7){if(_0x3c17f7){return _0x3c17f7?{'count':_0x2b3d05,'rows':_0x3c17f7}:null;}})[_0x3cb7('0x33')](respondWithResult(_0x520ed5,null))['catch'](handleError(_0x520ed5,null));};exports[_0x3cb7('0x127')]=function(_0x2228e5,_0x144533,_0x5a872a){var _0x1d09e6=_0x2228e5[_0x3cb7('0x42')][_0x3cb7('0x128')]===_0x3cb7('0x129')?_0x3cb7('0x12a'):_0x3cb7('0x12b');return db[_0x3cb7('0x3c')][_0x3cb7('0x59')]({'attributes':['id',_0x1d09e6],'where':{'id':_0x2228e5[_0x3cb7('0x55')]['id']}})[_0x3cb7('0x33')](handleEntityNotFound(_0x144533,null))['then'](function(_0x34dbbb){if(_0x34dbbb){var _0x1ba897=_0x34dbbb[_0x1d09e6];var _0x2fc03b=_0x1ba897&&_0x1ba897[_0x3cb7('0x12c')]?_0x1ba897['items']:[];_0x144533['send']({'fromKey':_[_0x3cb7('0x86')](_0x1ba897[_0x3cb7('0x12d')])?undefined:_0x1ba897['fromKey'],'count':_0x2fc03b[_0x3cb7('0x46')],'rows':_0x2fc03b});}})[_0x3cb7('0x27')](handleError(_0x144533,null));};exports['getOfflineMessages']=function(_0x287c90,_0x3f1aa1,_0x1cbc6a){var _0x155cf2={'raw':![],'where':{}};var _0x5f1503={};var _0x7b879a={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x287c90[_0x3cb7('0x55')]['id']}})[_0x3cb7('0x33')](handleEntityNotFound(_0x3f1aa1,null))[_0x3cb7('0x33')](function(_0x26f1fa){if(_0x26f1fa){_0x5f1503[_0x3cb7('0x41')]=_[_0x3cb7('0x57')](db[_0x3cb7('0xe1')][_0x3cb7('0x3d')]);_0x5f1503[_0x3cb7('0x42')]=_['keys'](_0x287c90[_0x3cb7('0x42')]);_0x5f1503['filters']=_[_0x3cb7('0x43')](_0x5f1503[_0x3cb7('0x41')],_0x5f1503[_0x3cb7('0x42')]);_0x155cf2[_0x3cb7('0x44')]=_[_0x3cb7('0x43')](_0x5f1503['model'],qs[_0x3cb7('0x45')](_0x287c90[_0x3cb7('0x42')]['fields']));_0x155cf2[_0x3cb7('0x44')]=_0x155cf2[_0x3cb7('0x44')][_0x3cb7('0x46')]?_0x155cf2[_0x3cb7('0x44')]:_0x5f1503[_0x3cb7('0x41')];if(!_0x287c90[_0x3cb7('0x42')]['hasOwnProperty']('nolimit')){_0x155cf2['limit']=qs[_0x3cb7('0x49')](_0x287c90[_0x3cb7('0x42')][_0x3cb7('0x49')]);_0x155cf2[_0x3cb7('0x2d')]=qs['offset'](_0x287c90[_0x3cb7('0x42')]['offset']);}_0x155cf2[_0x3cb7('0x4a')]=qs[_0x3cb7('0x4b')](_0x287c90[_0x3cb7('0x42')][_0x3cb7('0x4b')]);_0x155cf2['where']=qs['filters'](_[_0x3cb7('0x6b')](_0x287c90[_0x3cb7('0x42')],_0x5f1503[_0x3cb7('0x4d')]));_0x155cf2[_0x3cb7('0x4c')][_0x3cb7('0x67')]=_0x26f1fa['id'];if(_0x287c90[_0x3cb7('0x42')][_0x3cb7('0x4f')]){_0x155cf2['where']=_['merge'](_0x155cf2[_0x3cb7('0x4c')],{'$or':_[_0x3cb7('0x3b')](_0x155cf2[_0x3cb7('0x44')],function(_0x73ab9b){var _0x347a1f={};_0x347a1f[_0x73ab9b]={'$like':'%'+_0x287c90[_0x3cb7('0x42')][_0x3cb7('0x4f')]+'%'};return _0x347a1f;})});}_0x155cf2=_[_0x3cb7('0x4e')]({},_0x155cf2,_0x287c90[_0x3cb7('0x50')]);return db[_0x3cb7('0xe1')][_0x3cb7('0x2c')]({'where':_0x155cf2[_0x3cb7('0x4c')]})['then'](function(_0x42a5ce){_0x7b879a[_0x3cb7('0x2c')]=_0x42a5ce;if(_0x287c90[_0x3cb7('0x42')]['includeAll']){_0x155cf2[_0x3cb7('0x58')]=[{'all':!![]}];}else{_0x155cf2['include']=[{'model':db[_0x3cb7('0xd4')],'as':_0x3cb7('0x100'),'required':![]},{'model':db[_0x3cb7('0xe8')],'as':'Attachments','required':![]}];}return db[_0x3cb7('0xe1')][_0x3cb7('0x52')](_0x155cf2);})[_0x3cb7('0x33')](function(_0x39154e){_0x7b879a[_0x3cb7('0x53')]=_0x39154e;return _0x7b879a;});}})[_0x3cb7('0x33')](respondWithFilteredResult(_0x3f1aa1,_0x155cf2))[_0x3cb7('0x27')](handleError(_0x3f1aa1,null));};exports[_0x3cb7('0x12e')]=function(_0x50e658,_0x5280d5,_0x48b1fa){return db[_0x3cb7('0x3c')][_0x3cb7('0x59')]({'where':{'id':_0x50e658['params']['id']}})['then'](handleEntityNotFound(_0x5280d5,null))[_0x3cb7('0x33')](function(_0x2ef218){if(_0x2ef218){return _0x2ef218[_0x3cb7('0x12e')](_0x50e658[_0x3cb7('0x5b')][_0x3cb7('0x6d')],_[_0x3cb7('0x126')](_0x50e658[_0x3cb7('0x5b')],[_0x3cb7('0x6d'),'id'])||{})[_0x3cb7('0xda')](function(_0x3c84ef){for(var _0x1bbb85=0x0;_0x1bbb85<_0x50e658[_0x3cb7('0x5b')][_0x3cb7('0x6d')]['length'];_0x1bbb85+=0x1){socket[_0x3cb7('0x12f')](_0x3cb7('0x130'),{'UserId':Number(_0x50e658['body'][_0x3cb7('0x6d')][_0x1bbb85]),'ChatWebsiteId':Number(_0x50e658[_0x3cb7('0x55')]['id'])});}return _0x3c84ef;});}})[_0x3cb7('0x33')](respondWithResult(_0x5280d5,null))['catch'](handleError(_0x5280d5,null));};exports[_0x3cb7('0x131')]=function(_0x14264b,_0x2a17f3,_0x24dd66){return db[_0x3cb7('0x3c')]['find']({'where':{'id':_0x14264b[_0x3cb7('0x55')]['id']}})[_0x3cb7('0x33')](handleEntityNotFound(_0x2a17f3,null))[_0x3cb7('0x33')](function(_0x5549d0){if(_0x5549d0){return _0x5549d0[_0x3cb7('0x131')](_0x14264b[_0x3cb7('0x42')]['ids'])[_0x3cb7('0x33')](function(){if(_['isArray'](_0x14264b[_0x3cb7('0x42')][_0x3cb7('0x6d')])){for(var _0xceaafa=0x0;_0xceaafa<_0x14264b[_0x3cb7('0x42')]['ids'][_0x3cb7('0x46')];_0xceaafa+=0x1){socket[_0x3cb7('0x12f')](_0x3cb7('0x132'),{'UserId':Number(_0x14264b[_0x3cb7('0x42')][_0x3cb7('0x6d')][_0xceaafa]),'ChatWebsiteId':Number(_0x14264b['params']['id'])});}}else{socket[_0x3cb7('0x12f')]('userChatWebsite:remove',{'UserId':Number(_0x14264b[_0x3cb7('0x42')][_0x3cb7('0x6d')]),'ChatWebsiteId':Number(_0x14264b['params']['id'])});}});}})[_0x3cb7('0x33')](respondWithStatusCode(_0x2a17f3,null))[_0x3cb7('0x27')](handleError(_0x2a17f3,null));};exports['getAgents']=function(_0x439a89,_0x17daa6,_0x554038){var _0x1b9eb2={};var _0x5434b3={};var _0x3b35c6;var _0x419766;return db[_0x3cb7('0x3c')][_0x3cb7('0x69')]({'where':{'id':_0x439a89[_0x3cb7('0x55')]['id']}})[_0x3cb7('0x33')](handleEntityNotFound(_0x17daa6,null))[_0x3cb7('0x33')](function(_0x44a1db){if(_0x44a1db){_0x3b35c6=_0x44a1db;_0x5434b3[_0x3cb7('0x41')]=_[_0x3cb7('0x57')](db[_0x3cb7('0xca')][_0x3cb7('0x3d')]);_0x5434b3[_0x3cb7('0x42')]=_[_0x3cb7('0x57')](_0x439a89[_0x3cb7('0x42')]);_0x5434b3['filters']=_[_0x3cb7('0x43')](_0x5434b3[_0x3cb7('0x41')],_0x5434b3[_0x3cb7('0x42')]);_0x1b9eb2[_0x3cb7('0x44')]=_['intersection'](_0x5434b3['model'],qs['fields'](_0x439a89[_0x3cb7('0x42')]['fields']));_0x1b9eb2['attributes']=_0x1b9eb2[_0x3cb7('0x44')]['length']?_0x1b9eb2[_0x3cb7('0x44')]:_0x5434b3[_0x3cb7('0x41')];_0x1b9eb2[_0x3cb7('0x4a')]=qs[_0x3cb7('0x4b')](_0x439a89[_0x3cb7('0x42')][_0x3cb7('0x4b')]);_0x1b9eb2[_0x3cb7('0x4c')]=qs[_0x3cb7('0x4d')](_[_0x3cb7('0x6b')](_0x439a89[_0x3cb7('0x42')],_0x5434b3[_0x3cb7('0x4d')]));if(_0x439a89[_0x3cb7('0x42')]['filter']){_0x1b9eb2[_0x3cb7('0x4c')]=_['merge'](_0x1b9eb2[_0x3cb7('0x4c')],{'$or':_[_0x3cb7('0x3b')](_0x1b9eb2['attributes'],function(_0x236935){var _0x32bd55={};_0x32bd55[_0x236935]={'$like':'%'+_0x439a89[_0x3cb7('0x42')][_0x3cb7('0x4f')]+'%'};return _0x32bd55;})});}_0x1b9eb2=_[_0x3cb7('0x4e')]({},_0x1b9eb2,_0x439a89[_0x3cb7('0x50')]);return _0x3b35c6['getAgents'](_0x1b9eb2);}})['then'](function(_0x320c44){if(_0x320c44){_0x419766=_0x320c44[_0x3cb7('0x46')];if(!_0x439a89[_0x3cb7('0x42')][_0x3cb7('0x47')]('nolimit')){_0x1b9eb2['limit']=qs['limit'](_0x439a89[_0x3cb7('0x42')][_0x3cb7('0x49')]);_0x1b9eb2[_0x3cb7('0x2d')]=qs['offset'](_0x439a89['query'][_0x3cb7('0x2d')]);}return _0x3b35c6['getAgents'](_0x1b9eb2);}})[_0x3cb7('0x33')](function(_0x497661){if(_0x497661){return _0x497661?{'count':_0x419766,'rows':_0x497661}:null;}})[_0x3cb7('0x33')](respondWithResult(_0x17daa6,null))[_0x3cb7('0x27')](handleError(_0x17daa6,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index 2d5e64b..b742658 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 _0x72b1=['save','update','remove','emit','hasOwnProperty','exports','events','ChatWebsite','setMaxListeners'];(function(_0x5d3ba8,_0x4b340a){var _0x479625=function(_0x3176e5){while(--_0x3176e5){_0x5d3ba8['push'](_0x5d3ba8['shift']());}};_0x479625(++_0x4b340a);}(_0x72b1,0x16e));var _0x172b=function(_0x475276,_0xa01d05){_0x475276=_0x475276-0x0;var _0x58ab90=_0x72b1[_0x475276];return _0x58ab90;};'use strict';var EventEmitter=require(_0x172b('0x0'));var ChatWebsite=require('../../mysqldb')['db'][_0x172b('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x172b('0x2')](0x0);var events={'afterCreate':_0x172b('0x3'),'afterUpdate':_0x172b('0x4'),'afterDestroy':_0x172b('0x5')};function emitEvent(_0x3fa10d){return function(_0x2c1d6e,_0x558038,_0x3781f3){ChatWebsiteEvents[_0x172b('0x6')](_0x3fa10d+':'+_0x2c1d6e['id'],_0x2c1d6e);ChatWebsiteEvents[_0x172b('0x6')](_0x3fa10d,_0x2c1d6e);_0x3781f3(null);};}for(var e in events){if(events[_0x172b('0x7')](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module[_0x172b('0x8')]=ChatWebsiteEvents; \ No newline at end of file +var _0x62da=['hasOwnProperty','hook','exports','events','ChatWebsite','setMaxListeners','save','update','emit'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x62da,0xc0));var _0xa62d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x62da[_0x20a584];return _0x4b41a8;};'use strict';var EventEmitter=require(_0xa62d('0x0'));var ChatWebsite=require('../../mysqldb')['db'][_0xa62d('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xa62d('0x2')](0x0);var events={'afterCreate':_0xa62d('0x3'),'afterUpdate':_0xa62d('0x4'),'afterDestroy':'remove'};function emitEvent(_0x3ef284){return function(_0x3911f7,_0x11821d,_0x41182c){ChatWebsiteEvents[_0xa62d('0x5')](_0x3ef284+':'+_0x3911f7['id'],_0x3911f7);ChatWebsiteEvents[_0xa62d('0x5')](_0x3ef284,_0x3911f7);_0x41182c(null);};}for(var e in events){if(events[_0xa62d('0x6')](e)){var event=events[e];ChatWebsite[_0xa62d('0x7')](e,emitEvent(event));}}module[_0xa62d('0x8')]=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index f1a92da..e7552b0 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 _0x303c=['./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x57cadb,_0x12813d){var _0x4eb70d=function(_0x4946dc){while(--_0x4946dc){_0x57cadb['push'](_0x57cadb['shift']());}};_0x4eb70d(++_0x12813d);}(_0x303c,0x6d));var _0xc303=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0x303c[_0x45e98e];return _0x374dba;};'use strict';var _=require(_0xc303('0x0'));var util=require(_0xc303('0x1'));var logger=require(_0xc303('0x2'))('api');var moment=require(_0xc303('0x3'));var BPromise=require(_0xc303('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc303('0x5'));var rimraf=require(_0xc303('0x6'));var config=require(_0xc303('0x7'));var attributes=require(_0xc303('0x8'));module[_0xc303('0x9')]=function(_0x23187c,_0xdde2a6){return _0x23187c[_0xc303('0xa')](_0xc303('0xb'),attributes,{'tableName':_0xc303('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfbc4=['../../config/environment','./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites','lodash','util','api','bluebird','request-promise','path'];(function(_0x30e963,_0x10a31d){var _0x22c675=function(_0x3983c4){while(--_0x3983c4){_0x30e963['push'](_0x30e963['shift']());}};_0x22c675(++_0x10a31d);}(_0xfbc4,0x1f2));var _0x4fbc=function(_0x51eb4a,_0x1da2f7){_0x51eb4a=_0x51eb4a-0x0;var _0x382101=_0xfbc4[_0x51eb4a];return _0x382101;};'use strict';var _=require(_0x4fbc('0x0'));var util=require(_0x4fbc('0x1'));var logger=require('../../config/logger')(_0x4fbc('0x2'));var moment=require('moment');var BPromise=require(_0x4fbc('0x3'));var rp=require(_0x4fbc('0x4'));var fs=require('fs');var path=require(_0x4fbc('0x5'));var rimraf=require('rimraf');var config=require(_0x4fbc('0x6'));var attributes=require(_0x4fbc('0x7'));module[_0x4fbc('0x8')]=function(_0x3d867e,_0x1d732c){return _0x3d867e[_0x4fbc('0x9')](_0x4fbc('0xa'),attributes,{'tableName':_0x4fbc('0xb'),'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 6e73ec2..d88ce67 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 _0xb7e3=['request','then','info','ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter'];(function(_0x1bfccb,_0x2a5d55){var _0x4e7f15=function(_0x22e8b5){while(--_0x22e8b5){_0x1bfccb['push'](_0x1bfccb['shift']());}};_0x4e7f15(++_0x2a5d55);}(_0xb7e3,0xf4));var _0x3b7e=function(_0x4be774,_0x5b2d48){_0x4be774=_0x4be774-0x0;var _0x31d1c9=_0xb7e3[_0x4be774];return _0x31d1c9;};'use strict';var _=require('lodash');var util=require(_0x3b7e('0x0'));var moment=require(_0x3b7e('0x1'));var BPromise=require(_0x3b7e('0x2'));var rs=require(_0x3b7e('0x3'));var fs=require('fs');var Redis=require(_0x3b7e('0x4'));var db=require(_0x3b7e('0x5'))['db'];var utils=require(_0x3b7e('0x6'));var logger=require(_0x3b7e('0x7'))(_0x3b7e('0x8'));var config=require(_0x3b7e('0x9'));var jayson=require(_0x3b7e('0xa'));var client=jayson[_0x3b7e('0xb')][_0x3b7e('0xc')]({'port':0x232a});config[_0x3b7e('0xd')]=_[_0x3b7e('0xe')](config[_0x3b7e('0xd')],{'host':_0x3b7e('0xf'),'port':0x18eb});var socket=require(_0x3b7e('0x10'))(new Redis(config[_0x3b7e('0xd')]));require('./chatWebsite.socket')['register'](socket);function respondWithRpcPromise(_0x43b1f6,_0x48dc5c,_0x2a02ed){return new BPromise(function(_0x4cedec,_0x3ff5c0){return client[_0x3b7e('0x11')](_0x43b1f6,_0x2a02ed)[_0x3b7e('0x12')](function(_0xc0541f){logger[_0x3b7e('0x13')](_0x3b7e('0x14'),_0x48dc5c,'request\x20sent');logger[_0x3b7e('0x15')](_0x3b7e('0x16'),_0x48dc5c,_0x3b7e('0x17'),JSON['stringify'](_0xc0541f));if(_0xc0541f[_0x3b7e('0x18')]){if(_0xc0541f['error'][_0x3b7e('0x19')]===0x1f4){logger[_0x3b7e('0x18')](_0x3b7e('0x14'),_0x48dc5c,_0xc0541f[_0x3b7e('0x18')][_0x3b7e('0x1a')]);return _0x3ff5c0(_0xc0541f[_0x3b7e('0x18')][_0x3b7e('0x1a')]);}logger[_0x3b7e('0x18')]('ChatWebsite,\x20%s,\x20%s',_0x48dc5c,_0xc0541f[_0x3b7e('0x18')][_0x3b7e('0x1a')]);return _0x4cedec(_0xc0541f['error'][_0x3b7e('0x1a')]);}else{logger[_0x3b7e('0x13')]('ChatWebsite,\x20%s,\x20%s',_0x48dc5c,_0x3b7e('0x17'));_0x4cedec(_0xc0541f[_0x3b7e('0x1b')][_0x3b7e('0x1a')]);}})[_0x3b7e('0x1c')](function(_0x1cdb06){logger['error']('ChatWebsite,\x20%s,\x20%s',_0x48dc5c,_0x1cdb06);_0x3ff5c0(_0x1cdb06);});});} \ No newline at end of file +var _0xbc1f=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','./chatWebsite.socket','register','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis'];(function(_0x4a3e92,_0x548ffb){var _0x5bcad2=function(_0x1c7c8a){while(--_0x1c7c8a){_0x4a3e92['push'](_0x4a3e92['shift']());}};_0x5bcad2(++_0x548ffb);}(_0xbc1f,0x83));var _0xfbc1=function(_0x20b3cf,_0x51f34d){_0x20b3cf=_0x20b3cf-0x0;var _0x8872ec=_0xbc1f[_0x20b3cf];return _0x8872ec;};'use strict';var _=require(_0xfbc1('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xfbc1('0x1'));var rs=require(_0xfbc1('0x2'));var fs=require('fs');var Redis=require(_0xfbc1('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xfbc1('0x4'));var logger=require('../../config/logger')(_0xfbc1('0x5'));var config=require(_0xfbc1('0x6'));var jayson=require(_0xfbc1('0x7'));var client=jayson[_0xfbc1('0x8')][_0xfbc1('0x9')]({'port':0x232a});config['redis']=_[_0xfbc1('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfbc1('0xb')]));require(_0xfbc1('0xc'))[_0xfbc1('0xd')](socket);function respondWithRpcPromise(_0x2bbac7,_0x4917ba,_0x2f688c){return new BPromise(function(_0x157a52,_0x2ae2fb){return client[_0xfbc1('0xe')](_0x2bbac7,_0x2f688c)[_0xfbc1('0xf')](function(_0x44b5c3){logger[_0xfbc1('0x10')](_0xfbc1('0x11'),_0x4917ba,_0xfbc1('0x12'));logger[_0xfbc1('0x13')](_0xfbc1('0x14'),_0x4917ba,'request\x20sent',JSON[_0xfbc1('0x15')](_0x44b5c3));if(_0x44b5c3[_0xfbc1('0x16')]){if(_0x44b5c3[_0xfbc1('0x16')][_0xfbc1('0x17')]===0x1f4){logger[_0xfbc1('0x16')](_0xfbc1('0x11'),_0x4917ba,_0x44b5c3[_0xfbc1('0x16')]['message']);return _0x2ae2fb(_0x44b5c3[_0xfbc1('0x16')]['message']);}logger[_0xfbc1('0x16')](_0xfbc1('0x11'),_0x4917ba,_0x44b5c3[_0xfbc1('0x16')][_0xfbc1('0x18')]);return _0x157a52(_0x44b5c3['error']['message']);}else{logger[_0xfbc1('0x10')](_0xfbc1('0x11'),_0x4917ba,_0xfbc1('0x12'));_0x157a52(_0x44b5c3[_0xfbc1('0x19')]['message']);}})[_0xfbc1('0x1a')](function(_0xcd4724){logger['error'](_0xfbc1('0x11'),_0x4917ba,_0xcd4724);_0x2ae2fb(_0xcd4724);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index 3a2f0d1..2cfb9b4 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 _0x1de3=['./chatWebsite.events','save','update','removeListener','register','chatWebsite:'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x1de3,0x14a));var _0x31de=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0x1de3[_0x92c450];return _0x2a9599;};'use strict';var ChatWebsiteEvents=require(_0x31de('0x0'));var events=[_0x31de('0x1'),'remove',_0x31de('0x2')];function createListener(_0x188675,_0x18b580){return function(_0x36f4e4){_0x18b580['emit'](_0x188675,_0x36f4e4);};}function removeListener(_0x532b6d,_0x560e05){return function(){ChatWebsiteEvents[_0x31de('0x3')](_0x532b6d,_0x560e05);};}exports[_0x31de('0x4')]=function(_0xfc3240){for(var _0x32c55d=0x0,_0x4f6511=events['length'];_0x32c55d<_0x4f6511;_0x32c55d++){var _0x4d7bd5=events[_0x32c55d];var _0x159465=createListener(_0x31de('0x5')+_0x4d7bd5,_0xfc3240);ChatWebsiteEvents['on'](_0x4d7bd5,_0x159465);}}; \ No newline at end of file +var _0x4fab=['save','remove','register','length','chatWebsite:','./chatWebsite.events'];(function(_0x1aeba6,_0x2ca4a3){var _0x31f61c=function(_0x39772b){while(--_0x39772b){_0x1aeba6['push'](_0x1aeba6['shift']());}};_0x31f61c(++_0x2ca4a3);}(_0x4fab,0x65));var _0xb4fa=function(_0x291bcc,_0x469c18){_0x291bcc=_0x291bcc-0x0;var _0x5d20f6=_0x4fab[_0x291bcc];return _0x5d20f6;};'use strict';var ChatWebsiteEvents=require(_0xb4fa('0x0'));var events=[_0xb4fa('0x1'),_0xb4fa('0x2'),'update'];function createListener(_0x2a42c1,_0x8e5770){return function(_0x54460c){_0x8e5770['emit'](_0x2a42c1,_0x54460c);};}function removeListener(_0x23515f,_0xbd67ff){return function(){ChatWebsiteEvents['removeListener'](_0x23515f,_0xbd67ff);};}exports[_0xb4fa('0x3')]=function(_0x16efa8){for(var _0x251ff7=0x0,_0x189854=events[_0xb4fa('0x4')];_0x251ff7<_0x189854;_0x251ff7++){var _0x52418b=events[_0x251ff7];var _0x1a8d83=createListener(_0xb4fa('0x5')+_0x52418b,_0x16efa8);ChatWebsiteEvents['on'](_0x52418b,_0x1a8d83);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index 42c4c73..05e5ba4 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 _0xda89=['/:id/notify','server/files','attachments','offline-chat','ensureDir','replace','/:id/offline','any','addInteraction','addApplications','addProactiveActions','addAgents','put','update','delete','destroy','removeAnswers','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','isAuthenticated','index','get','/describe','describe','/:id','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','post','create','/:id/dispositions','addDisposition','addAnswer','diskStorage','join','root','server/files/images/logos/','format','now','originalname','single','file','addLogo','server/files/images/avatars/','addAvatar','%s-%s','addCustomerAvatar','addSystemAvatar'];(function(_0x53db50,_0x36dce2){var _0x28cbe2=function(_0x17c950){while(--_0x17c950){_0x53db50['push'](_0x53db50['shift']());}};_0x28cbe2(++_0x36dce2);}(_0xda89,0x179));var _0x9da8=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0xda89[_0xbd08b4];return _0x314f1e;};'use strict';var multer=require(_0x9da8('0x0'));var util=require('util');var path=require(_0x9da8('0x1'));var timeout=require(_0x9da8('0x2'));var express=require('express');var router=express[_0x9da8('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x9da8('0x4'));var interaction=require(_0x9da8('0x5'));var config=require(_0x9da8('0x6'));var controller=require(_0x9da8('0x7'));router['get']('/',auth[_0x9da8('0x8')](),controller[_0x9da8('0x9')]);router[_0x9da8('0xa')](_0x9da8('0xb'),auth[_0x9da8('0x8')](),controller[_0x9da8('0xc')]);router[_0x9da8('0xa')](_0x9da8('0xd'),auth[_0x9da8('0x8')](),controller['show']);router['get']('/:id/dispositions',auth[_0x9da8('0x8')](),controller[_0x9da8('0xe')]);router['get'](_0x9da8('0xf'),auth[_0x9da8('0x8')](),controller[_0x9da8('0x10')]);router['get'](_0x9da8('0x11'),controller['getLogo']);router['get'](_0x9da8('0x12'),controller[_0x9da8('0x13')]);router[_0x9da8('0xa')](_0x9da8('0x14'),controller[_0x9da8('0x15')]);router[_0x9da8('0xa')](_0x9da8('0x16'),controller[_0x9da8('0x17')]);router[_0x9da8('0xa')](_0x9da8('0x18'),auth[_0x9da8('0x8')](),controller[_0x9da8('0x19')]);router[_0x9da8('0xa')]('/:id/snippet',controller[_0x9da8('0x1a')]);router[_0x9da8('0xa')](_0x9da8('0x1b'),auth['isAuthenticated'](),controller[_0x9da8('0x1c')]);router[_0x9da8('0xa')](_0x9da8('0x1d'),auth[_0x9da8('0x8')](),controller[_0x9da8('0x1e')]);router[_0x9da8('0xa')]('/:id/fields',controller[_0x9da8('0x1f')]);router[_0x9da8('0xa')](_0x9da8('0x20'),auth[_0x9da8('0x8')](),controller[_0x9da8('0x21')]);router['get'](_0x9da8('0x22'),auth[_0x9da8('0x8')](),controller['getAgents']);router[_0x9da8('0x23')]('/',auth['isAuthenticated'](),controller[_0x9da8('0x24')]);router[_0x9da8('0x23')](_0x9da8('0x25'),auth['isAuthenticated'](),controller[_0x9da8('0x26')]);router[_0x9da8('0x23')](_0x9da8('0xf'),auth[_0x9da8('0x8')](),controller[_0x9da8('0x27')]);var upload=multer({'storage':multer[_0x9da8('0x28')]({'destination':function(_0x48763b,_0x25973f,_0x1c4463){_0x1c4463(null,path[_0x9da8('0x29')](config[_0x9da8('0x2a')],_0x9da8('0x2b')));},'filename':function(_0x45277a,_0x4dd763,_0x1100ec){_0x1100ec(null,util[_0x9da8('0x2c')]('%s-%s',Date[_0x9da8('0x2d')](),_0x4dd763[_0x9da8('0x2e')]));}})});router[_0x9da8('0x23')](_0x9da8('0x11'),upload[_0x9da8('0x2f')](_0x9da8('0x30')),controller[_0x9da8('0x31')]);var upload=multer({'storage':multer[_0x9da8('0x28')]({'destination':function(_0x585c1d,_0x13583a,_0x834898){_0x834898(null,path[_0x9da8('0x29')](config['root'],_0x9da8('0x32')));},'filename':function(_0x443357,_0x1acd2d,_0x30f3a9){_0x30f3a9(null,util[_0x9da8('0x2c')]('%s-%s',Date['now'](),_0x1acd2d[_0x9da8('0x2e')]));}})});router[_0x9da8('0x23')](_0x9da8('0x12'),upload[_0x9da8('0x2f')](_0x9da8('0x30')),controller[_0x9da8('0x33')]);var upload=multer({'storage':multer[_0x9da8('0x28')]({'destination':function(_0x1a7742,_0x136a43,_0x46bdc3){_0x46bdc3(null,path[_0x9da8('0x29')](config[_0x9da8('0x2a')],'server/files/images/avatars/'));},'filename':function(_0x420a5d,_0x22a553,_0x30c507){_0x30c507(null,util[_0x9da8('0x2c')](_0x9da8('0x34'),Date['now'](),_0x22a553[_0x9da8('0x2e')]));}})});router[_0x9da8('0x23')](_0x9da8('0x14'),upload['single'](_0x9da8('0x30')),controller[_0x9da8('0x35')]);var upload=multer({'storage':multer[_0x9da8('0x28')]({'destination':function(_0xc9a327,_0x5a9609,_0x69688f){_0x69688f(null,path[_0x9da8('0x29')](config['root'],'server/files/images/avatars/'));},'filename':function(_0xcbef5e,_0x1f8f3e,_0x1e62b6){_0x1e62b6(null,util[_0x9da8('0x2c')](_0x9da8('0x34'),Date[_0x9da8('0x2d')](),_0x1f8f3e[_0x9da8('0x2e')]));}})});router[_0x9da8('0x23')](_0x9da8('0x16'),upload[_0x9da8('0x2f')]('file'),controller[_0x9da8('0x36')]);router[_0x9da8('0x23')](_0x9da8('0x37'),controller['notify']);const offlineUploadMulter=multer({'storage':multer[_0x9da8('0x28')]({'destination':function(_0x4e2854,_0x37c95d,_0x1c3119){const _0x236aa3=path['join'](config['root'],_0x9da8('0x38'),_0x9da8('0x39'),_0x9da8('0x3a'));fs_extra[_0x9da8('0x3b')](_0x236aa3,function(){_0x1c3119(null,_0x236aa3);});},'filename':function(_0x2ee433,_0x5574e1,_0x2f955e){const _0x27de2b=_0x5574e1[_0x9da8('0x2e')][_0x9da8('0x3c')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x655430=path['extname'](_0x27de2b);const _0x42a6f2=Date[_0x9da8('0x2d')]()+'-'+_0x27de2b[_0x9da8('0x3c')](_0x655430,'')+_0x655430;_0x2f955e(null,_0x42a6f2);}})});router[_0x9da8('0x23')](_0x9da8('0x3d'),offlineUploadMulter[_0x9da8('0x3e')](),controller['offline']);router[_0x9da8('0x23')](_0x9da8('0x18'),auth[_0x9da8('0x8')](),controller[_0x9da8('0x3f')]);router['post']('/:id/applications',auth[_0x9da8('0x8')](),controller[_0x9da8('0x40')]);router[_0x9da8('0x23')](_0x9da8('0x1d'),auth['isAuthenticated'](),controller[_0x9da8('0x41')]);router[_0x9da8('0x23')](_0x9da8('0x22'),auth[_0x9da8('0x8')](),controller[_0x9da8('0x42')]);router[_0x9da8('0x43')](_0x9da8('0xd'),auth[_0x9da8('0x8')](),controller[_0x9da8('0x44')]);router[_0x9da8('0x45')](_0x9da8('0xd'),auth[_0x9da8('0x8')](),controller[_0x9da8('0x46')]);router[_0x9da8('0x45')](_0x9da8('0x25'),auth[_0x9da8('0x8')](),controller['removeDispositions']);router[_0x9da8('0x45')](_0x9da8('0xf'),auth['isAuthenticated'](),controller[_0x9da8('0x47')]);router[_0x9da8('0x45')](_0x9da8('0x22'),auth[_0x9da8('0x8')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file +var _0x240d=['/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','/:id/offline_messages','getOfflineMessages','getAgents','post','create','addDisposition','addAnswer','join','root','server/files/images/logos/','format','%s-%s','now','originalname','single','file','addLogo','diskStorage','server/files/images/avatars/','addAvatar','addCustomerAvatar','addSystemAvatar','/:id/notify','server/files','attachments','offline-chat','ensureDir','replace','extname','/:id/offline','any','offline','addInteraction','addApplications','addProactiveActions','put','delete','destroy','removeDispositions','/:id/users','removeAgents','exports','multer','util','express','Router','fs-extra','../../components/interaction/service','./chatWebsite.controller','get','index','isAuthenticated','describe','/:id','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/logo','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','getSnippet'];(function(_0x7d44ec,_0x21801e){var _0x207eef=function(_0x2d73ed){while(--_0x2d73ed){_0x7d44ec['push'](_0x7d44ec['shift']());}};_0x207eef(++_0x21801e);}(_0x240d,0x1df));var _0xd240=function(_0x1a77e0,_0x444a32){_0x1a77e0=_0x1a77e0-0x0;var _0x4eb905=_0x240d[_0x1a77e0];return _0x4eb905;};'use strict';var multer=require(_0xd240('0x0'));var util=require(_0xd240('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xd240('0x2'));var router=express[_0xd240('0x3')]();var fs_extra=require(_0xd240('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xd240('0x5'));var config=require('../../config/environment');var controller=require(_0xd240('0x6'));router[_0xd240('0x7')]('/',auth['isAuthenticated'](),controller[_0xd240('0x8')]);router['get']('/describe',auth[_0xd240('0x9')](),controller[_0xd240('0xa')]);router[_0xd240('0x7')](_0xd240('0xb'),auth['isAuthenticated'](),controller[_0xd240('0xc')]);router[_0xd240('0x7')](_0xd240('0xd'),auth[_0xd240('0x9')](),controller['getDispositions']);router[_0xd240('0x7')](_0xd240('0xe'),auth['isAuthenticated'](),controller[_0xd240('0xf')]);router[_0xd240('0x7')](_0xd240('0x10'),controller['getLogo']);router[_0xd240('0x7')]('/:id/avatar',controller[_0xd240('0x11')]);router[_0xd240('0x7')](_0xd240('0x12'),controller[_0xd240('0x13')]);router[_0xd240('0x7')](_0xd240('0x14'),controller[_0xd240('0x15')]);router[_0xd240('0x7')](_0xd240('0x16'),auth[_0xd240('0x9')](),controller[_0xd240('0x17')]);router[_0xd240('0x7')]('/:id/snippet',controller[_0xd240('0x18')]);router['get'](_0xd240('0x19'),auth[_0xd240('0x9')](),controller[_0xd240('0x1a')]);router['get'](_0xd240('0x1b'),auth['isAuthenticated'](),controller[_0xd240('0x1c')]);router[_0xd240('0x7')](_0xd240('0x1d'),controller['getFields']);router['get'](_0xd240('0x1e'),auth['isAuthenticated'](),controller[_0xd240('0x1f')]);router[_0xd240('0x7')]('/:id/users',auth[_0xd240('0x9')](),controller[_0xd240('0x20')]);router[_0xd240('0x21')]('/',auth[_0xd240('0x9')](),controller[_0xd240('0x22')]);router[_0xd240('0x21')](_0xd240('0xd'),auth['isAuthenticated'](),controller[_0xd240('0x23')]);router[_0xd240('0x21')](_0xd240('0xe'),auth[_0xd240('0x9')](),controller[_0xd240('0x24')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1f22d1,_0x2389f2,_0x263128){_0x263128(null,path[_0xd240('0x25')](config[_0xd240('0x26')],_0xd240('0x27')));},'filename':function(_0xbc38b9,_0x210834,_0x206dc0){_0x206dc0(null,util[_0xd240('0x28')](_0xd240('0x29'),Date[_0xd240('0x2a')](),_0x210834[_0xd240('0x2b')]));}})});router[_0xd240('0x21')](_0xd240('0x10'),upload[_0xd240('0x2c')](_0xd240('0x2d')),controller[_0xd240('0x2e')]);var upload=multer({'storage':multer[_0xd240('0x2f')]({'destination':function(_0xcc9bba,_0xa6b19f,_0x12af28){_0x12af28(null,path[_0xd240('0x25')](config[_0xd240('0x26')],_0xd240('0x30')));},'filename':function(_0x301014,_0x5f4b9f,_0x5775b2){_0x5775b2(null,util[_0xd240('0x28')]('%s-%s',Date[_0xd240('0x2a')](),_0x5f4b9f[_0xd240('0x2b')]));}})});router[_0xd240('0x21')]('/:id/avatar',upload[_0xd240('0x2c')](_0xd240('0x2d')),controller[_0xd240('0x31')]);var upload=multer({'storage':multer[_0xd240('0x2f')]({'destination':function(_0x1e8752,_0xb3a39d,_0x581415){_0x581415(null,path['join'](config['root'],_0xd240('0x30')));},'filename':function(_0x525612,_0x36dfdd,_0x421daf){_0x421daf(null,util[_0xd240('0x28')](_0xd240('0x29'),Date['now'](),_0x36dfdd[_0xd240('0x2b')]));}})});router[_0xd240('0x21')]('/:id/customer_avatar',upload['single'](_0xd240('0x2d')),controller[_0xd240('0x32')]);var upload=multer({'storage':multer[_0xd240('0x2f')]({'destination':function(_0x73903b,_0x5dff23,_0x55f2a1){_0x55f2a1(null,path[_0xd240('0x25')](config[_0xd240('0x26')],_0xd240('0x30')));},'filename':function(_0x20c1ce,_0x534097,_0x1235c9){_0x1235c9(null,util['format'](_0xd240('0x29'),Date[_0xd240('0x2a')](),_0x534097['originalname']));}})});router[_0xd240('0x21')](_0xd240('0x14'),upload[_0xd240('0x2c')](_0xd240('0x2d')),controller[_0xd240('0x33')]);router[_0xd240('0x21')](_0xd240('0x34'),controller['notify']);const offlineUploadMulter=multer({'storage':multer[_0xd240('0x2f')]({'destination':function(_0x367706,_0x28f2d1,_0x37afef){const _0x5d2163=path[_0xd240('0x25')](config[_0xd240('0x26')],_0xd240('0x35'),_0xd240('0x36'),_0xd240('0x37'));fs_extra[_0xd240('0x38')](_0x5d2163,function(){_0x37afef(null,_0x5d2163);});},'filename':function(_0x4192ff,_0x3570ea,_0x5d23a0){const _0x28465a=_0x3570ea['originalname'][_0xd240('0x39')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x3aedee=path[_0xd240('0x3a')](_0x28465a);const _0x5168a6=Date[_0xd240('0x2a')]()+'-'+_0x28465a[_0xd240('0x39')](_0x3aedee,'')+_0x3aedee;_0x5d23a0(null,_0x5168a6);}})});router[_0xd240('0x21')](_0xd240('0x3b'),offlineUploadMulter[_0xd240('0x3c')](),controller[_0xd240('0x3d')]);router['post'](_0xd240('0x16'),auth[_0xd240('0x9')](),controller[_0xd240('0x3e')]);router[_0xd240('0x21')](_0xd240('0x19'),auth[_0xd240('0x9')](),controller[_0xd240('0x3f')]);router[_0xd240('0x21')](_0xd240('0x1b'),auth[_0xd240('0x9')](),controller[_0xd240('0x40')]);router[_0xd240('0x21')]('/:id/users',auth[_0xd240('0x9')](),controller['addAgents']);router[_0xd240('0x41')](_0xd240('0xb'),auth[_0xd240('0x9')](),controller['update']);router[_0xd240('0x42')](_0xd240('0xb'),auth['isAuthenticated'](),controller[_0xd240('0x43')]);router[_0xd240('0x42')](_0xd240('0xd'),auth[_0xd240('0x9')](),controller[_0xd240('0x44')]);router[_0xd240('0x42')](_0xd240('0xe'),auth['isAuthenticated'](),controller['removeAnswers']);router['delete'](_0xd240('0x45'),auth[_0xd240('0x9')](),controller[_0xd240('0x46')]);module[_0xd240('0x47')]=router; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js index 1fa213c..984bc40 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 _0x553a=['AmazonAWS','Google','exports','ENUM'];(function(_0x26d386,_0x1660c0){var _0x4ef9a8=function(_0x55e2d3){while(--_0x55e2d3){_0x26d386['push'](_0x26d386['shift']());}};_0x4ef9a8(++_0x1660c0);}(_0x553a,0x192));var _0xa553=function(_0x3890f8,_0x1b39df){_0x3890f8=_0x3890f8-0x0;var _0x40713e=_0x553a[_0x3890f8];return _0x40713e;};'use strict';var Sequelize=require('sequelize');module[_0xa553('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xa553('0x1')](_0xa553('0x2'),_0xa553('0x3')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xaee6=['Google','sequelize','exports','STRING','ENUM','AmazonAWS'];(function(_0x306414,_0x335bd2){var _0x2e87d7=function(_0x2de836){while(--_0x2de836){_0x306414['push'](_0x306414['shift']());}};_0x2e87d7(++_0x335bd2);}(_0xaee6,0x187));var _0x6aee=function(_0x22bab2,_0x174177){_0x22bab2=_0x22bab2-0x0;var _0x46a7be=_0xaee6[_0x22bab2];return _0x46a7be;};'use strict';var Sequelize=require(_0x6aee('0x0'));module[_0x6aee('0x1')]={'name':{'type':Sequelize[_0x6aee('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x6aee('0x3')](_0x6aee('0x4'),_0x6aee('0x5')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize[_0x6aee('0x2')]}}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js index 9fe555b..4e7139e 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 _0x7a54=['offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','CloudProvider','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json'];(function(_0x2b2a12,_0x3f9ede){var _0x31fe03=function(_0x19945e){while(--_0x19945e){_0x2b2a12['push'](_0x2b2a12['shift']());}};_0x31fe03(++_0x3f9ede);}(_0x7a54,0x106));var _0x47a5=function(_0xd9e698,_0x1ed5fa){_0xd9e698=_0xd9e698-0x0;var _0x4226f0=_0x7a54[_0xd9e698];return _0x4226f0;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['CloudProvider'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['CloudProvider']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['CloudProvider']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));}; \ No newline at end of file +var _0x2ef3=['update','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','CloudProvider','then','includeAll','include','findAll','catch','show','params','keys','create','body','find','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save'];(function(_0x3b67e4,_0x2a5d46){var _0x21adcf=function(_0x3b0243){while(--_0x3b0243){_0x3b67e4['push'](_0x3b67e4['shift']());}};_0x21adcf(++_0x2a5d46);}(_0x2ef3,0xba));var _0x32ef=function(_0x4d40c6,_0x3eb906){_0x4d40c6=_0x4d40c6-0x0;var _0x4284d0=_0x2ef3[_0x4d40c6];return _0x4284d0;};'use strict';var emlformat=require(_0x32ef('0x0'));var rimraf=require(_0x32ef('0x1'));var zipdir=require(_0x32ef('0x2'));var jsonpatch=require(_0x32ef('0x3'));var rp=require(_0x32ef('0x4'));var moment=require(_0x32ef('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x32ef('0x6'));var util=require(_0x32ef('0x7'));var path=require('path');var sox=require(_0x32ef('0x8'));var csv=require(_0x32ef('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x32ef('0xa'));var squel=require(_0x32ef('0xb'));var crypto=require(_0x32ef('0xc'));var jsforce=require(_0x32ef('0xd'));var deskjs=require(_0x32ef('0xe'));var toCsv=require(_0x32ef('0x9'));var querystring=require(_0x32ef('0xf'));var Papa=require(_0x32ef('0x10'));var Redis=require(_0x32ef('0x11'));var authService=require(_0x32ef('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x32ef('0x13'));var logger=require(_0x32ef('0x14'))(_0x32ef('0x15'));var utils=require(_0x32ef('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x32ef('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1a5106,_0x49d590){_0x49d590=_0x49d590||0xcc;return function(_0x3e98df){if(_0x3e98df){return _0x1a5106[_0x32ef('0x18')](_0x49d590);}return _0x1a5106['status'](_0x49d590)['end']();};}function respondWithResult(_0x19ce1,_0x4d8009){_0x4d8009=_0x4d8009||0xc8;return function(_0x326fce){if(_0x326fce){return _0x19ce1[_0x32ef('0x19')](_0x4d8009)[_0x32ef('0x1a')](_0x326fce);}};}function respondWithFilteredResult(_0x54c7f5,_0x57aff1){return function(_0x55bf0b){if(_0x55bf0b){var _0x531e30=typeof _0x57aff1[_0x32ef('0x1b')]===_0x32ef('0x1c')&&typeof _0x57aff1[_0x32ef('0x1d')]==='undefined';var _0x5d559b=_0x55bf0b[_0x32ef('0x1e')];var _0x1a9476=_0x531e30?0x0:_0x57aff1[_0x32ef('0x1b')];var _0x57863c=_0x531e30?_0x55bf0b[_0x32ef('0x1e')]:_0x57aff1[_0x32ef('0x1b')]+_0x57aff1['limit'];var _0x304505;if(_0x57863c>=_0x5d559b){_0x57863c=_0x5d559b;_0x304505=0xc8;}else{_0x304505=0xce;}_0x54c7f5[_0x32ef('0x19')](_0x304505);return _0x54c7f5[_0x32ef('0x1f')](_0x32ef('0x20'),_0x1a9476+'-'+_0x57863c+'/'+_0x5d559b)[_0x32ef('0x1a')](_0x55bf0b);}return null;};}function patchUpdates(_0x3aec05){return function(_0x4de441){try{jsonpatch[_0x32ef('0x21')](_0x4de441,_0x3aec05,!![]);}catch(_0x5cc3ef){return BPromise[_0x32ef('0x22')](_0x5cc3ef);}return _0x4de441[_0x32ef('0x23')]();};}function saveUpdates(_0x49f2d8,_0x1af371){return function(_0x97780){if(_0x97780){return _0x97780[_0x32ef('0x24')](_0x49f2d8)['then'](function(_0x57f5e5){return _0x57f5e5;});}return null;};}function removeEntity(_0x22f2d7,_0xb30fab){return function(_0x225feb){if(_0x225feb){return _0x225feb['destroy']()['then'](function(){_0x22f2d7[_0x32ef('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51a412,_0x278495){return function(_0x14d4b3){if(!_0x14d4b3){_0x51a412[_0x32ef('0x18')](0x194);}return _0x14d4b3;};}function handleError(_0x1dbe98,_0x15ce54){_0x15ce54=_0x15ce54||0x1f4;return function(_0x234175){logger[_0x32ef('0x25')](_0x234175[_0x32ef('0x26')]);if(_0x234175[_0x32ef('0x27')]){delete _0x234175[_0x32ef('0x27')];}_0x1dbe98[_0x32ef('0x19')](_0x15ce54)[_0x32ef('0x28')](_0x234175);};}exports['index']=function(_0xd65fde,_0x2f5d06){var _0x5a04cd={},_0x12de1a={},_0x3c569d={'count':0x0,'rows':[]};var _0x30b250=_[_0x32ef('0x29')](db['CloudProvider'][_0x32ef('0x2a')],function(_0x22bf86){return{'name':_0x22bf86[_0x32ef('0x2b')],'type':_0x22bf86[_0x32ef('0x2c')][_0x32ef('0x2d')]};});_0x12de1a[_0x32ef('0x2e')]=_[_0x32ef('0x29')](_0x30b250,'name');_0x12de1a[_0x32ef('0x2f')]=_['keys'](_0xd65fde[_0x32ef('0x2f')]);_0x12de1a[_0x32ef('0x30')]=_['intersection'](_0x12de1a[_0x32ef('0x2e')],_0x12de1a[_0x32ef('0x2f')]);_0x5a04cd[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0x12de1a[_0x32ef('0x2e')],qs['fields'](_0xd65fde['query'][_0x32ef('0x33')]));_0x5a04cd['attributes']=_0x5a04cd[_0x32ef('0x31')][_0x32ef('0x34')]?_0x5a04cd[_0x32ef('0x31')]:_0x12de1a[_0x32ef('0x2e')];if(!_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x35')]('nolimit')){_0x5a04cd['limit']=qs['limit'](_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x1d')]);_0x5a04cd[_0x32ef('0x1b')]=qs['offset'](_0xd65fde['query'][_0x32ef('0x1b')]);}_0x5a04cd[_0x32ef('0x36')]=qs[_0x32ef('0x37')](_0xd65fde['query']['sort']);_0x5a04cd[_0x32ef('0x38')]=qs[_0x32ef('0x30')](_[_0x32ef('0x39')](_0xd65fde[_0x32ef('0x2f')],_0x12de1a[_0x32ef('0x30')]),_0x30b250);if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]){_0x5a04cd[_0x32ef('0x38')]=_[_0x32ef('0x3b')](_0x5a04cd['where'],{'$or':_[_0x32ef('0x29')](_0x30b250,function(_0x36e374){if(_0x36e374[_0x32ef('0x2c')]!=='VIRTUAL'){var _0x365125={};_0x365125[_0x36e374[_0x32ef('0x27')]]={'$like':'%'+_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3a')]+'%'};return _0x365125;}})});}_0x5a04cd=_[_0x32ef('0x3b')]({},_0x5a04cd,_0xd65fde[_0x32ef('0x3c')]);var _0x256c40={'where':_0x5a04cd[_0x32ef('0x38')]};return db[_0x32ef('0x3d')][_0x32ef('0x1e')](_0x256c40)[_0x32ef('0x3e')](function(_0x4615b4){_0x3c569d['count']=_0x4615b4;if(_0xd65fde[_0x32ef('0x2f')][_0x32ef('0x3f')]){_0x5a04cd[_0x32ef('0x40')]=[{'all':!![]}];}return db[_0x32ef('0x3d')][_0x32ef('0x41')](_0x5a04cd);})[_0x32ef('0x3e')](function(_0x3c0e44){_0x3c569d['rows']=_0x3c0e44;return _0x3c569d;})['then'](respondWithFilteredResult(_0x2f5d06,_0x5a04cd))[_0x32ef('0x42')](handleError(_0x2f5d06,null));};exports[_0x32ef('0x43')]=function(_0x2a33dd,_0x765c63){var _0x5dca14={'raw':!![],'where':{'id':_0x2a33dd[_0x32ef('0x44')]['id']}},_0x2901a1={};_0x2901a1['model']=_[_0x32ef('0x45')](db['CloudProvider'][_0x32ef('0x2a')]);_0x2901a1[_0x32ef('0x2f')]=_[_0x32ef('0x45')](_0x2a33dd[_0x32ef('0x2f')]);_0x2901a1[_0x32ef('0x30')]=_[_0x32ef('0x32')](_0x2901a1[_0x32ef('0x2e')],_0x2901a1[_0x32ef('0x2f')]);_0x5dca14[_0x32ef('0x31')]=_[_0x32ef('0x32')](_0x2901a1['model'],qs[_0x32ef('0x33')](_0x2a33dd['query'][_0x32ef('0x33')]));_0x5dca14[_0x32ef('0x31')]=_0x5dca14[_0x32ef('0x31')]['length']?_0x5dca14[_0x32ef('0x31')]:_0x2901a1[_0x32ef('0x2e')];if(_0x2a33dd[_0x32ef('0x2f')][_0x32ef('0x3f')]){_0x5dca14[_0x32ef('0x40')]=[{'all':!![]}];}_0x5dca14=_[_0x32ef('0x3b')]({},_0x5dca14,_0x2a33dd[_0x32ef('0x3c')]);return db['CloudProvider']['find'](_0x5dca14)[_0x32ef('0x3e')](handleEntityNotFound(_0x765c63,null))[_0x32ef('0x3e')](respondWithResult(_0x765c63,null))[_0x32ef('0x42')](handleError(_0x765c63,null));};exports[_0x32ef('0x46')]=function(_0x209361,_0xd67dc9){return db[_0x32ef('0x3d')][_0x32ef('0x46')](_0x209361[_0x32ef('0x47')],{})[_0x32ef('0x3e')](respondWithResult(_0xd67dc9,0xc9))[_0x32ef('0x42')](handleError(_0xd67dc9,null));};exports[_0x32ef('0x24')]=function(_0x36a65c,_0x4c2534){if(_0x36a65c[_0x32ef('0x47')]['id']){delete _0x36a65c[_0x32ef('0x47')]['id'];}return db[_0x32ef('0x3d')][_0x32ef('0x48')]({'where':{'id':_0x36a65c[_0x32ef('0x44')]['id']}})[_0x32ef('0x3e')](handleEntityNotFound(_0x4c2534,null))[_0x32ef('0x3e')](saveUpdates(_0x36a65c[_0x32ef('0x47')],null))[_0x32ef('0x3e')](respondWithResult(_0x4c2534,null))[_0x32ef('0x42')](handleError(_0x4c2534,null));};exports[_0x32ef('0x49')]=function(_0x29d456,_0x272377){return db[_0x32ef('0x3d')][_0x32ef('0x48')]({'where':{'id':_0x29d456[_0x32ef('0x44')]['id']}})[_0x32ef('0x3e')](handleEntityNotFound(_0x272377,null))[_0x32ef('0x3e')](removeEntity(_0x272377,null))['catch'](handleError(_0x272377,null));}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js index 32df621..2192386 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 _0x8ebc=['moment','bluebird','request-promise','path','../../config/environment','./cloudProvider.attributes','exports','define','CloudProvider','cloud_providers','../../config/logger'];(function(_0xa6238d,_0x78ab8a){var _0x1cc8b6=function(_0x35e9cd){while(--_0x35e9cd){_0xa6238d['push'](_0xa6238d['shift']());}};_0x1cc8b6(++_0x78ab8a);}(_0x8ebc,0x196));var _0xc8eb=function(_0x38cf13,_0x44f6af){_0x38cf13=_0x38cf13-0x0;var _0x29b1a1=_0x8ebc[_0x38cf13];return _0x29b1a1;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xc8eb('0x0'))('api');var moment=require(_0xc8eb('0x1'));var BPromise=require(_0xc8eb('0x2'));var rp=require(_0xc8eb('0x3'));var fs=require('fs');var path=require(_0xc8eb('0x4'));var rimraf=require('rimraf');var config=require(_0xc8eb('0x5'));var attributes=require(_0xc8eb('0x6'));module[_0xc8eb('0x7')]=function(_0x47db71,_0x41f249){return _0x47db71[_0xc8eb('0x8')](_0xc8eb('0x9'),attributes,{'tableName':_0xc8eb('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8ac9=['lodash','util','../../config/logger','bluebird','request-promise','../../config/environment','exports','define','CloudProvider','cloud_providers'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x8ac9,0x1ea));var _0x98ac=function(_0x4ebace,_0x5d4195){_0x4ebace=_0x4ebace-0x0;var _0x2d1ed5=_0x8ac9[_0x4ebace];return _0x2d1ed5;};'use strict';var _=require(_0x98ac('0x0'));var util=require(_0x98ac('0x1'));var logger=require(_0x98ac('0x2'))('api');var moment=require('moment');var BPromise=require(_0x98ac('0x3'));var rp=require(_0x98ac('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x98ac('0x5'));var attributes=require('./cloudProvider.attributes');module[_0x98ac('0x6')]=function(_0x436da8,_0x41adcc){return _0x436da8[_0x98ac('0x7')](_0x98ac('0x8'),attributes,{'tableName':_0x98ac('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js index 2e8fcab..15d8cca 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 _0x1a37=['rpc','jayson/promise','http','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x32c00e,_0x3578af){var _0x23e55e=function(_0x468f64){while(--_0x468f64){_0x32c00e['push'](_0x32c00e['shift']());}};_0x23e55e(++_0x3578af);}(_0x1a37,0xb4));var _0x71a3=function(_0x4f9b18,_0x2cb5ca){_0x4f9b18=_0x4f9b18-0x0;var _0x29f20c=_0x1a37[_0x4f9b18];return _0x29f20c;};'use strict';var _=require(_0x71a3('0x0'));var util=require(_0x71a3('0x1'));var moment=require(_0x71a3('0x2'));var BPromise=require(_0x71a3('0x3'));var rs=require(_0x71a3('0x4'));var fs=require('fs');var Redis=require(_0x71a3('0x5'));var db=require(_0x71a3('0x6'))['db'];var utils=require(_0x71a3('0x7'));var logger=require(_0x71a3('0x8'))(_0x71a3('0x9'));var config=require('../../config/environment');var jayson=require(_0x71a3('0xa'));var client=jayson['client'][_0x71a3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x45050a,_0x231ea7,_0x2bb6a2){return new BPromise(function(_0x4a9ab2,_0x53b893){return client['request'](_0x45050a,_0x2bb6a2)['then'](function(_0x89da86){logger[_0x71a3('0xc')](_0x71a3('0xd'),_0x231ea7,_0x71a3('0xe'));logger[_0x71a3('0xf')](_0x71a3('0x10'),_0x231ea7,_0x71a3('0xe'),JSON[_0x71a3('0x11')](_0x89da86));if(_0x89da86['error']){if(_0x89da86['error']['code']===0x1f4){logger[_0x71a3('0x12')](_0x71a3('0xd'),_0x231ea7,_0x89da86[_0x71a3('0x12')][_0x71a3('0x13')]);return _0x53b893(_0x89da86[_0x71a3('0x12')][_0x71a3('0x13')]);}logger[_0x71a3('0x12')](_0x71a3('0xd'),_0x231ea7,_0x89da86[_0x71a3('0x12')][_0x71a3('0x13')]);return _0x4a9ab2(_0x89da86[_0x71a3('0x12')]['message']);}else{logger[_0x71a3('0xc')](_0x71a3('0xd'),_0x231ea7,'request\x20sent');_0x4a9ab2(_0x89da86['result'][_0x71a3('0x13')]);}})[_0x71a3('0x14')](function(_0xee797f){logger[_0x71a3('0x12')](_0x71a3('0xd'),_0x231ea7,_0xee797f);_0x53b893(_0xee797f);});});} \ No newline at end of file +var _0xa5d7=['info','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','CloudProvider,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','jayson/promise','client','http','then'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0xa5d7,0x1c3));var _0x7a5d=function(_0x497d8e,_0x3a2dae){_0x497d8e=_0x497d8e-0x0;var _0x3a4344=_0xa5d7[_0x497d8e];return _0x3a4344;};'use strict';var _=require(_0x7a5d('0x0'));var util=require(_0x7a5d('0x1'));var moment=require(_0x7a5d('0x2'));var BPromise=require(_0x7a5d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7a5d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7a5d('0x5'));var logger=require('../../config/logger')(_0x7a5d('0x6'));var config=require('../../config/environment');var jayson=require(_0x7a5d('0x7'));var client=jayson[_0x7a5d('0x8')][_0x7a5d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4cb015,_0x2092de,_0xc34a6a){return new BPromise(function(_0x5e6442,_0x33aeaa){return client['request'](_0x4cb015,_0xc34a6a)[_0x7a5d('0xa')](function(_0x1057e5){logger[_0x7a5d('0xb')]('CloudProvider,\x20%s,\x20%s',_0x2092de,_0x7a5d('0xc'));logger[_0x7a5d('0xd')](_0x7a5d('0xe'),_0x2092de,_0x7a5d('0xc'),JSON[_0x7a5d('0xf')](_0x1057e5));if(_0x1057e5[_0x7a5d('0x10')]){if(_0x1057e5[_0x7a5d('0x10')][_0x7a5d('0x11')]===0x1f4){logger[_0x7a5d('0x10')](_0x7a5d('0x12'),_0x2092de,_0x1057e5[_0x7a5d('0x10')][_0x7a5d('0x13')]);return _0x33aeaa(_0x1057e5['error']['message']);}logger[_0x7a5d('0x10')]('CloudProvider,\x20%s,\x20%s',_0x2092de,_0x1057e5[_0x7a5d('0x10')][_0x7a5d('0x13')]);return _0x5e6442(_0x1057e5[_0x7a5d('0x10')][_0x7a5d('0x13')]);}else{logger[_0x7a5d('0xb')](_0x7a5d('0x12'),_0x2092de,'request\x20sent');_0x5e6442(_0x1057e5[_0x7a5d('0x14')][_0x7a5d('0x13')]);}})[_0x7a5d('0x15')](function(_0xc57403){logger[_0x7a5d('0x10')]('CloudProvider,\x20%s,\x20%s',_0x2092de,_0xc57403);_0x33aeaa(_0xc57403);});});} \ No newline at end of file diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js index 5de7a17..0ae3f94 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 _0xba38=['exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cloudProvider.controller','get','isAuthenticated','index','/:id','show','post','create','put','delete','destroy'];(function(_0x9f34bc,_0x3fb4ce){var _0x4c353e=function(_0x5b3007){while(--_0x5b3007){_0x9f34bc['push'](_0x9f34bc['shift']());}};_0x4c353e(++_0x3fb4ce);}(_0xba38,0x190));var _0x8ba3=function(_0x1d6510,_0x3ada4c){_0x1d6510=_0x1d6510-0x0;var _0x45bceb=_0xba38[_0x1d6510];return _0x45bceb;};'use strict';var multer=require('multer');var util=require(_0x8ba3('0x0'));var path=require(_0x8ba3('0x1'));var timeout=require(_0x8ba3('0x2'));var express=require('express');var router=express[_0x8ba3('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x8ba3('0x4'));var interaction=require(_0x8ba3('0x5'));var config=require(_0x8ba3('0x6'));var controller=require(_0x8ba3('0x7'));router[_0x8ba3('0x8')]('/',auth[_0x8ba3('0x9')](),controller[_0x8ba3('0xa')]);router[_0x8ba3('0x8')](_0x8ba3('0xb'),auth[_0x8ba3('0x9')](),controller[_0x8ba3('0xc')]);router[_0x8ba3('0xd')]('/',auth['isAuthenticated'](),controller[_0x8ba3('0xe')]);router[_0x8ba3('0xf')]('/:id',auth[_0x8ba3('0x9')](),controller['update']);router[_0x8ba3('0x10')](_0x8ba3('0xb'),auth[_0x8ba3('0x9')](),controller[_0x8ba3('0x11')]);module[_0x8ba3('0x12')]=router; \ No newline at end of file +var _0xef49=['delete','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','index','/:id','post'];(function(_0x3d2d6f,_0x368872){var _0x5c0022=function(_0x408819){while(--_0x408819){_0x3d2d6f['push'](_0x3d2d6f['shift']());}};_0x5c0022(++_0x368872);}(_0xef49,0x144));var _0x9ef4=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0xef49[_0x565c49];return _0x20ca34;};'use strict';var multer=require(_0x9ef4('0x0'));var util=require('util');var path=require(_0x9ef4('0x1'));var timeout=require('connect-timeout');var express=require(_0x9ef4('0x2'));var router=express[_0x9ef4('0x3')]();var fs_extra=require(_0x9ef4('0x4'));var auth=require(_0x9ef4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x9ef4('0x6'));router[_0x9ef4('0x7')]('/',auth[_0x9ef4('0x8')](),controller[_0x9ef4('0x9')]);router[_0x9ef4('0x7')](_0x9ef4('0xa'),auth[_0x9ef4('0x8')](),controller['show']);router[_0x9ef4('0xb')]('/',auth[_0x9ef4('0x8')](),controller['create']);router['put'](_0x9ef4('0xa'),auth[_0x9ef4('0x8')](),controller['update']);router[_0x9ef4('0xc')](_0x9ef4('0xa'),auth[_0x9ef4('0x8')](),controller[_0x9ef4('0xd')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index 6a37554..2c22dc4 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 _0xee74=['STRING','name','exports'];(function(_0x2f0bf6,_0x386ca6){var _0x24025c=function(_0x3a9263){while(--_0x3a9263){_0x2f0bf6['push'](_0x2f0bf6['shift']());}};_0x24025c(++_0x386ca6);}(_0xee74,0x1eb));var _0x4ee7=function(_0x29fa89,_0x47b1db){_0x29fa89=_0x29fa89-0x0;var _0x3dd71e=_0xee74[_0x29fa89];return _0x3dd71e;};'use strict';var Sequelize=require('sequelize');module[_0x4ee7('0x0')]={'name':{'type':Sequelize[_0x4ee7('0x1')],'unique':_0x4ee7('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x4ee7('0x1')]},'companyId':{'type':Sequelize[_0x4ee7('0x1')]},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x4ee7('0x1')]},'fax':{'type':Sequelize[_0x4ee7('0x1')]},'type':{'type':Sequelize[_0x4ee7('0x1')]},'street':{'type':Sequelize[_0x4ee7('0x1')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x4ee7('0x1')]},'country':{'type':Sequelize[_0x4ee7('0x1')]},'email':{'type':Sequelize[_0x4ee7('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x4ee7('0x1')]},'sStreet':{'type':Sequelize[_0x4ee7('0x1')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0x4ee7('0x1')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xc719=['exports','STRING','name'];(function(_0x4e881e,_0x4de023){var _0x5b5535=function(_0x3526d9){while(--_0x3526d9){_0x4e881e['push'](_0x4e881e['shift']());}};_0x5b5535(++_0x4de023);}(_0xc719,0x138));var _0x9c71=function(_0x29d4b5,_0x1913e2){_0x29d4b5=_0x29d4b5-0x0;var _0x3fbb01=_0xc719[_0x29d4b5];return _0x3fbb01;};'use strict';var Sequelize=require('sequelize');module[_0x9c71('0x0')]={'name':{'type':Sequelize[_0x9c71('0x1')],'unique':_0x9c71('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x9c71('0x1')]},'companyId':{'type':Sequelize[_0x9c71('0x1')]},'website':{'type':Sequelize[_0x9c71('0x1')]},'phone':{'type':Sequelize[_0x9c71('0x1')]},'fax':{'type':Sequelize[_0x9c71('0x1')]},'type':{'type':Sequelize[_0x9c71('0x1')]},'street':{'type':Sequelize[_0x9c71('0x1')]},'postalCode':{'type':Sequelize[_0x9c71('0x1')]},'city':{'type':Sequelize[_0x9c71('0x1')]},'country':{'type':Sequelize[_0x9c71('0x1')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0x9c71('0x1')]},'sPostalCode':{'type':Sequelize[_0x9c71('0x1')]},'sCity':{'type':Sequelize[_0x9c71('0x1')]},'sCountry':{'type':Sequelize[_0x9c71('0x1')]},'description':{'type':Sequelize[_0x9c71('0x1')]}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index be845ca..02132e1 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 _0x62cd=['Companies','UserProfileResource','error','name','send','index','CmCompany','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','map','options','count','includeAll','findAll','rows','catch','show','params','rawAttributes','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','describe','addContacts','CmContact','ids','omit','findOne','pick','nolimit','getContacts','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/license/util','../../mysqldb','end','status','json','offset','limit','undefined','Content-Range','save','then','destroy','get'];(function(_0x1436c5,_0x599841){var _0x112ded=function(_0x196590){while(--_0x196590){_0x1436c5['push'](_0x1436c5['shift']());}};_0x112ded(++_0x599841);}(_0x62cd,0xda));var _0xd62c=function(_0x4a7f8a,_0x46ea56){_0x4a7f8a=_0x4a7f8a-0x0;var _0x373b5f=_0x62cd[_0x4a7f8a];return _0x373b5f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd62c('0x0'));var zipdir=require(_0xd62c('0x1'));var jsonpatch=require(_0xd62c('0x2'));var rp=require('request-promise');var moment=require(_0xd62c('0x3'));var BPromise=require(_0xd62c('0x4'));var Mustache=require(_0xd62c('0x5'));var util=require(_0xd62c('0x6'));var path=require(_0xd62c('0x7'));var sox=require(_0xd62c('0x8'));var csv=require(_0xd62c('0x9'));var ejs=require(_0xd62c('0xa'));var fs=require('fs');var fs_extra=require(_0xd62c('0xb'));var _=require(_0xd62c('0xc'));var squel=require(_0xd62c('0xd'));var crypto=require(_0xd62c('0xe'));var jsforce=require(_0xd62c('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xd62c('0x9'));var querystring=require(_0xd62c('0x10'));var Papa=require(_0xd62c('0x11'));var Redis=require('ioredis');var authService=require(_0xd62c('0x12'));var qs=require(_0xd62c('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd62c('0x14'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xd62c('0x15'));var db=require(_0xd62c('0x16'))['db'];function respondWithStatusCode(_0x5733a3,_0x39dde3){_0x39dde3=_0x39dde3||0xcc;return function(_0x8281de){if(_0x8281de){return _0x5733a3['sendStatus'](_0x39dde3);}return _0x5733a3['status'](_0x39dde3)[_0xd62c('0x17')]();};}function respondWithResult(_0x4e290f,_0x1253f0){_0x1253f0=_0x1253f0||0xc8;return function(_0x320032){if(_0x320032){return _0x4e290f[_0xd62c('0x18')](_0x1253f0)[_0xd62c('0x19')](_0x320032);}};}function respondWithFilteredResult(_0x1f7d1b,_0x4738f9){return function(_0x1f0095){if(_0x1f0095){var _0xe93df8=typeof _0x4738f9[_0xd62c('0x1a')]==='undefined'&&typeof _0x4738f9[_0xd62c('0x1b')]===_0xd62c('0x1c');var _0x54fda1=_0x1f0095['count'];var _0x4d9aa5=_0xe93df8?0x0:_0x4738f9[_0xd62c('0x1a')];var _0x1dbe21=_0xe93df8?_0x1f0095['count']:_0x4738f9['offset']+_0x4738f9[_0xd62c('0x1b')];var _0x10b13b;if(_0x1dbe21>=_0x54fda1){_0x1dbe21=_0x54fda1;_0x10b13b=0xc8;}else{_0x10b13b=0xce;}_0x1f7d1b[_0xd62c('0x18')](_0x10b13b);return _0x1f7d1b['set'](_0xd62c('0x1d'),_0x4d9aa5+'-'+_0x1dbe21+'/'+_0x54fda1)['json'](_0x1f0095);}return null;};}function patchUpdates(_0x585a7f){return function(_0x359337){try{jsonpatch['apply'](_0x359337,_0x585a7f,!![]);}catch(_0x5c4949){return BPromise['reject'](_0x5c4949);}return _0x359337[_0xd62c('0x1e')]();};}function saveUpdates(_0x5cd53d,_0x3e8c9d){return function(_0x55c41e){if(_0x55c41e){return _0x55c41e['update'](_0x5cd53d)[_0xd62c('0x1f')](function(_0x35dfc1){return _0x35dfc1;});}return null;};}function removeEntity(_0x5069a9,_0x32dbc3){return function(_0x34dd6b){if(_0x34dd6b){return _0x34dd6b[_0xd62c('0x20')]()['then'](function(){var _0x5d2438=_0x34dd6b[_0xd62c('0x21')]({'plain':!![]});var _0x27a925=_0xd62c('0x22');return db[_0xd62c('0x23')][_0xd62c('0x20')]({'where':{'type':_0x27a925,'resourceId':_0x5d2438['id']}})['then'](function(){return _0x34dd6b;});})['then'](function(){_0x5069a9[_0xd62c('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x548b16,_0x35387b){return function(_0x378a1a){if(!_0x378a1a){_0x548b16['sendStatus'](0x194);}return _0x378a1a;};}function handleError(_0xbd8dd8,_0x4882d8){_0x4882d8=_0x4882d8||0x1f4;return function(_0x480919){logger[_0xd62c('0x24')](_0x480919['stack']);if(_0x480919[_0xd62c('0x25')]){delete _0x480919['name'];}_0xbd8dd8[_0xd62c('0x18')](_0x4882d8)[_0xd62c('0x26')](_0x480919);};}exports[_0xd62c('0x27')]=function(_0x1113d5,_0x15b0a9){var _0x1394f1={},_0x593f32={},_0x28d98e={'count':0x0,'rows':[]};return db[_0xd62c('0x28')]['describe']()[_0xd62c('0x1f')](function(_0xddb107){_0x593f32[_0xd62c('0x29')]=_[_0xd62c('0x2a')](_0xddb107);_0x593f32[_0xd62c('0x2b')]=_[_0xd62c('0x2a')](_0x1113d5[_0xd62c('0x2b')]);_0x593f32[_0xd62c('0x2c')]=_[_0xd62c('0x2d')](_0x593f32[_0xd62c('0x29')],_0x593f32[_0xd62c('0x2b')]);_0x1394f1[_0xd62c('0x2e')]=_[_0xd62c('0x2d')](_0x593f32[_0xd62c('0x29')],qs['fields'](_0x1113d5[_0xd62c('0x2b')][_0xd62c('0x2f')]));_0x1394f1[_0xd62c('0x2e')]=_0x1394f1['attributes'][_0xd62c('0x30')]?_0x1394f1[_0xd62c('0x2e')]:_0x593f32[_0xd62c('0x29')];if(!_0x1113d5[_0xd62c('0x2b')][_0xd62c('0x31')]('nolimit')){_0x1394f1[_0xd62c('0x1b')]=qs[_0xd62c('0x1b')](_0x1113d5[_0xd62c('0x2b')][_0xd62c('0x1b')]);_0x1394f1['offset']=qs['offset'](_0x1113d5[_0xd62c('0x2b')][_0xd62c('0x1a')]);}_0x1394f1[_0xd62c('0x32')]=qs['sort'](_0x1113d5[_0xd62c('0x2b')][_0xd62c('0x33')]);_0x1394f1[_0xd62c('0x34')]=qs[_0xd62c('0x2c')](_['pick'](_0x1113d5['query'],_0x593f32[_0xd62c('0x2c')]),_0xddb107);if(_0x1113d5['query'][_0xd62c('0x35')]){_0x1394f1['where']=_[_0xd62c('0x36')](_0x1394f1[_0xd62c('0x34')],{'$or':_[_0xd62c('0x37')](_0x1394f1[_0xd62c('0x2e')],function(_0x131d21){var _0x4edd62={};_0x4edd62[_0x131d21]={'$like':'%'+_0x1113d5[_0xd62c('0x2b')]['filter']+'%'};return _0x4edd62;})});}_0x1394f1=_[_0xd62c('0x36')]({},_0x1394f1,_0x1113d5[_0xd62c('0x38')]);var _0x7c3dab={'where':_0x1394f1[_0xd62c('0x34')]};return db[_0xd62c('0x28')][_0xd62c('0x39')](_0x7c3dab)[_0xd62c('0x1f')](function(_0x734ac6){_0x28d98e[_0xd62c('0x39')]=_0x734ac6;if(_0x1113d5[_0xd62c('0x2b')][_0xd62c('0x3a')]){_0x1394f1['include']=[{'all':!![]}];}return db[_0xd62c('0x28')][_0xd62c('0x3b')](_0x1394f1);})[_0xd62c('0x1f')](function(_0x98fac2){_0x28d98e[_0xd62c('0x3c')]=_0x98fac2;return _0x28d98e;})['then'](respondWithFilteredResult(_0x15b0a9,_0x1394f1))[_0xd62c('0x3d')](handleError(_0x15b0a9,null));})[_0xd62c('0x3d')](handleError(_0x15b0a9,null));};exports[_0xd62c('0x3e')]=function(_0x55ca6c,_0x5c3b4d){var _0x5955cc={'raw':![],'where':{'id':_0x55ca6c[_0xd62c('0x3f')]['id']}},_0x5c16de={};_0x5c16de[_0xd62c('0x29')]=_['keys'](db[_0xd62c('0x28')][_0xd62c('0x40')]);_0x5c16de[_0xd62c('0x2b')]=_['keys'](_0x55ca6c[_0xd62c('0x2b')]);_0x5c16de[_0xd62c('0x2c')]=_[_0xd62c('0x2d')](_0x5c16de[_0xd62c('0x29')],_0x5c16de[_0xd62c('0x2b')]);_0x5955cc[_0xd62c('0x2e')]=_['intersection'](_0x5c16de[_0xd62c('0x29')],qs['fields'](_0x55ca6c[_0xd62c('0x2b')][_0xd62c('0x2f')]));_0x5955cc['attributes']=_0x5955cc[_0xd62c('0x2e')]['length']?_0x5955cc[_0xd62c('0x2e')]:_0x5c16de[_0xd62c('0x29')];if(_0x55ca6c[_0xd62c('0x2b')][_0xd62c('0x3a')]){_0x5955cc['include']=[{'all':!![]}];}_0x5955cc=_['merge']({},_0x5955cc,_0x55ca6c['options']);return db[_0xd62c('0x28')][_0xd62c('0x41')](_0x5955cc)[_0xd62c('0x1f')](handleEntityNotFound(_0x5c3b4d,null))[_0xd62c('0x1f')](respondWithResult(_0x5c3b4d,null))[_0xd62c('0x3d')](handleError(_0x5c3b4d,null));};exports[_0xd62c('0x42')]=function(_0x54c40e,_0x14fe62){return db[_0xd62c('0x28')]['create'](_0x54c40e['body'],{})[_0xd62c('0x1f')](function(_0x299dc3){var _0x4b2262=_0x54c40e[_0xd62c('0x43')][_0xd62c('0x21')]({'plain':!![]});if(!_0x4b2262)throw new Error(_0xd62c('0x44'));if(_0x4b2262['role']===_0xd62c('0x43')){var _0x50deb4=_0x299dc3[_0xd62c('0x21')]({'plain':!![]});var _0x587ee7='Companies';return db[_0xd62c('0x45')]['find']({'where':{'name':_0x587ee7,'userProfileId':_0x4b2262[_0xd62c('0x46')]},'raw':!![]})[_0xd62c('0x1f')](function(_0xe49d2c){if(_0xe49d2c&&_0xe49d2c[_0xd62c('0x47')]===0x0){return db[_0xd62c('0x23')][_0xd62c('0x42')]({'name':_0x50deb4[_0xd62c('0x25')],'resourceId':_0x50deb4['id'],'type':_0xe49d2c[_0xd62c('0x25')],'sectionId':_0xe49d2c['id']},{})[_0xd62c('0x1f')](function(){return _0x299dc3;});}else{return _0x299dc3;}})[_0xd62c('0x3d')](function(_0x397de2){logger[_0xd62c('0x24')](_0xd62c('0x48'),_0x397de2);throw _0x397de2;});}return _0x299dc3;})[_0xd62c('0x1f')](respondWithResult(_0x14fe62,0xc9))[_0xd62c('0x3d')](handleError(_0x14fe62,null));};exports[_0xd62c('0x49')]=function(_0x337d0c,_0x7da848){if(_0x337d0c[_0xd62c('0x4a')]['id']){delete _0x337d0c[_0xd62c('0x4a')]['id'];}return db[_0xd62c('0x28')][_0xd62c('0x41')]({'where':{'id':_0x337d0c['params']['id']}})[_0xd62c('0x1f')](handleEntityNotFound(_0x7da848,null))[_0xd62c('0x1f')](saveUpdates(_0x337d0c[_0xd62c('0x4a')],null))[_0xd62c('0x1f')](respondWithResult(_0x7da848,null))[_0xd62c('0x3d')](handleError(_0x7da848,null));};exports[_0xd62c('0x20')]=function(_0x34616d,_0x1d6732){return db[_0xd62c('0x28')][_0xd62c('0x41')]({'where':{'id':_0x34616d['params']['id']}})[_0xd62c('0x1f')](handleEntityNotFound(_0x1d6732,null))[_0xd62c('0x1f')](removeEntity(_0x1d6732,null))[_0xd62c('0x3d')](handleError(_0x1d6732,null));};exports[_0xd62c('0x4b')]=function(_0x487d71,_0x10f3de){return db[_0xd62c('0x28')]['describe']()['then'](respondWithResult(_0x10f3de,null))[_0xd62c('0x3d')](handleError(_0x10f3de,null));};exports[_0xd62c('0x4c')]=function(_0x2ab930,_0x2cc94d,_0x3b71d6){return db[_0xd62c('0x4d')][_0xd62c('0x41')]({'where':{'id':_0x2ab930[_0xd62c('0x3f')]['id']}})[_0xd62c('0x1f')](handleEntityNotFound(_0x2cc94d,null))['then'](function(_0x38b709){if(_0x38b709){return _0x38b709['addContacts'](_0x2ab930[_0xd62c('0x4a')][_0xd62c('0x4e')],_[_0xd62c('0x4f')](_0x2ab930[_0xd62c('0x4a')],[_0xd62c('0x4e'),'id'])||{});}})['then'](respondWithResult(_0x2cc94d,null))[_0xd62c('0x3d')](handleError(_0x2cc94d,null));};exports['getContacts']=function(_0x32b784,_0x4f30ea,_0x464b5d){var _0x38ee35={};var _0x2b8c59={};var _0x113354;var _0x28db09;return db['CmCompany'][_0xd62c('0x50')]({'where':{'id':_0x32b784['params']['id']}})[_0xd62c('0x1f')](handleEntityNotFound(_0x4f30ea,null))[_0xd62c('0x1f')](function(_0x48f805){if(_0x48f805){_0x113354=_0x48f805;_0x2b8c59[_0xd62c('0x29')]=_['keys'](db[_0xd62c('0x4d')]['rawAttributes']);_0x2b8c59[_0xd62c('0x2b')]=_[_0xd62c('0x2a')](_0x32b784['query']);_0x2b8c59['filters']=_[_0xd62c('0x2d')](_0x2b8c59[_0xd62c('0x29')],_0x2b8c59[_0xd62c('0x2b')]);_0x38ee35[_0xd62c('0x2e')]=_[_0xd62c('0x2d')](_0x2b8c59[_0xd62c('0x29')],qs[_0xd62c('0x2f')](_0x32b784[_0xd62c('0x2b')][_0xd62c('0x2f')]));_0x38ee35[_0xd62c('0x2e')]=_0x38ee35[_0xd62c('0x2e')][_0xd62c('0x30')]?_0x38ee35['attributes']:_0x2b8c59[_0xd62c('0x29')];_0x38ee35[_0xd62c('0x32')]=qs['sort'](_0x32b784[_0xd62c('0x2b')][_0xd62c('0x33')]);_0x38ee35[_0xd62c('0x34')]=qs[_0xd62c('0x2c')](_[_0xd62c('0x51')](_0x32b784['query'],_0x2b8c59[_0xd62c('0x2c')]));if(_0x32b784[_0xd62c('0x2b')][_0xd62c('0x35')]){_0x38ee35['where']=_[_0xd62c('0x36')](_0x38ee35[_0xd62c('0x34')],{'$or':_[_0xd62c('0x37')](_0x38ee35['attributes'],function(_0x2efd68){var _0x8be342={};_0x8be342[_0x2efd68]={'$like':'%'+_0x32b784[_0xd62c('0x2b')][_0xd62c('0x35')]+'%'};return _0x8be342;})});}_0x38ee35=_[_0xd62c('0x36')]({},_0x38ee35,_0x32b784[_0xd62c('0x38')]);return _0x113354['getContacts'](_0x38ee35);}})[_0xd62c('0x1f')](function(_0x38044c){if(_0x38044c){_0x28db09=_0x38044c[_0xd62c('0x30')];if(!_0x32b784[_0xd62c('0x2b')][_0xd62c('0x31')](_0xd62c('0x52'))){_0x38ee35[_0xd62c('0x1b')]=qs[_0xd62c('0x1b')](_0x32b784[_0xd62c('0x2b')][_0xd62c('0x1b')]);_0x38ee35[_0xd62c('0x1a')]=qs[_0xd62c('0x1a')](_0x32b784['query'][_0xd62c('0x1a')]);}return _0x113354[_0xd62c('0x53')](_0x38ee35);}})[_0xd62c('0x1f')](function(_0x54bea1){if(_0x54bea1){return _0x54bea1?{'count':_0x28db09,'rows':_0x54bea1}:null;}})['then'](respondWithResult(_0x4f30ea,null))['catch'](handleError(_0x4f30ea,null));}; \ No newline at end of file +var _0x886c=['find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','CmContact','addContacts','ids','omit','options','getContacts','hasOwnProperty','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','save','then','get','Companies','destroy','error','stack','name','CmCompany','describe','keys','query','model','intersection','fields','attributes','length','nolimit','order','sort','filters','pick','filter','where','map','includeAll','include','rows','catch','show','params','rawAttributes','merge'];(function(_0x8477bd,_0x2c648c){var _0x4ef500=function(_0x1e3670){while(--_0x1e3670){_0x8477bd['push'](_0x8477bd['shift']());}};_0x4ef500(++_0x2c648c);}(_0x886c,0x1b5));var _0xc886=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x886c[_0x3b380d];return _0x54502b;};'use strict';var emlformat=require(_0xc886('0x0'));var rimraf=require(_0xc886('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc886('0x2'));var rp=require(_0xc886('0x3'));var moment=require(_0xc886('0x4'));var BPromise=require(_0xc886('0x5'));var Mustache=require(_0xc886('0x6'));var util=require('util');var path=require(_0xc886('0x7'));var sox=require('sox');var csv=require(_0xc886('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc886('0x9'));var squel=require('squel');var crypto=require(_0xc886('0xa'));var jsforce=require(_0xc886('0xb'));var deskjs=require(_0xc886('0xc'));var toCsv=require(_0xc886('0x8'));var querystring=require(_0xc886('0xd'));var Papa=require(_0xc886('0xe'));var Redis=require(_0xc886('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xc886('0x10'));var as=require(_0xc886('0x11'));var hardwareService=require(_0xc886('0x12'));var logger=require('../../config/logger')(_0xc886('0x13'));var utils=require('../../config/utils');var config=require(_0xc886('0x14'));var licenseUtil=require(_0xc886('0x15'));var db=require(_0xc886('0x16'))['db'];function respondWithStatusCode(_0x42c2c,_0x328fa7){_0x328fa7=_0x328fa7||0xcc;return function(_0x27fd19){if(_0x27fd19){return _0x42c2c[_0xc886('0x17')](_0x328fa7);}return _0x42c2c['status'](_0x328fa7)[_0xc886('0x18')]();};}function respondWithResult(_0x554db4,_0x427031){_0x427031=_0x427031||0xc8;return function(_0x4c2d5b){if(_0x4c2d5b){return _0x554db4[_0xc886('0x19')](_0x427031)['json'](_0x4c2d5b);}};}function respondWithFilteredResult(_0x37ec4d,_0x505812){return function(_0x13e809){if(_0x13e809){var _0x2901b9=typeof _0x505812[_0xc886('0x1a')]===_0xc886('0x1b')&&typeof _0x505812[_0xc886('0x1c')]===_0xc886('0x1b');var _0x566b28=_0x13e809['count'];var _0x4b672e=_0x2901b9?0x0:_0x505812[_0xc886('0x1a')];var _0xa3aa27=_0x2901b9?_0x13e809[_0xc886('0x1d')]:_0x505812[_0xc886('0x1a')]+_0x505812[_0xc886('0x1c')];var _0x1e51d6;if(_0xa3aa27>=_0x566b28){_0xa3aa27=_0x566b28;_0x1e51d6=0xc8;}else{_0x1e51d6=0xce;}_0x37ec4d['status'](_0x1e51d6);return _0x37ec4d[_0xc886('0x1e')](_0xc886('0x1f'),_0x4b672e+'-'+_0xa3aa27+'/'+_0x566b28)[_0xc886('0x20')](_0x13e809);}return null;};}function patchUpdates(_0x5f4b13){return function(_0x4152d8){try{jsonpatch[_0xc886('0x21')](_0x4152d8,_0x5f4b13,!![]);}catch(_0x36d3ed){return BPromise['reject'](_0x36d3ed);}return _0x4152d8[_0xc886('0x22')]();};}function saveUpdates(_0x26f115,_0x1a5224){return function(_0x4821e6){if(_0x4821e6){return _0x4821e6['update'](_0x26f115)['then'](function(_0x127a82){return _0x127a82;});}return null;};}function removeEntity(_0x2251ff,_0x28f629){return function(_0x31a5b8){if(_0x31a5b8){return _0x31a5b8['destroy']()[_0xc886('0x23')](function(){var _0x476e2a=_0x31a5b8[_0xc886('0x24')]({'plain':!![]});var _0x1c013=_0xc886('0x25');return db['UserProfileResource'][_0xc886('0x26')]({'where':{'type':_0x1c013,'resourceId':_0x476e2a['id']}})['then'](function(){return _0x31a5b8;});})[_0xc886('0x23')](function(){_0x2251ff[_0xc886('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c1971,_0x5cf0a6){return function(_0x150345){if(!_0x150345){_0x2c1971['sendStatus'](0x194);}return _0x150345;};}function handleError(_0x3fe793,_0x3166cf){_0x3166cf=_0x3166cf||0x1f4;return function(_0x5cc97b){logger[_0xc886('0x27')](_0x5cc97b[_0xc886('0x28')]);if(_0x5cc97b[_0xc886('0x29')]){delete _0x5cc97b[_0xc886('0x29')];}_0x3fe793[_0xc886('0x19')](_0x3166cf)['send'](_0x5cc97b);};}exports['index']=function(_0x411dcd,_0x5b8b41){var _0x27ec42={},_0x2a8667={},_0x49620c={'count':0x0,'rows':[]};return db[_0xc886('0x2a')][_0xc886('0x2b')]()['then'](function(_0x338445){_0x2a8667['model']=_['keys'](_0x338445);_0x2a8667['query']=_[_0xc886('0x2c')](_0x411dcd[_0xc886('0x2d')]);_0x2a8667['filters']=_['intersection'](_0x2a8667[_0xc886('0x2e')],_0x2a8667[_0xc886('0x2d')]);_0x27ec42['attributes']=_[_0xc886('0x2f')](_0x2a8667['model'],qs[_0xc886('0x30')](_0x411dcd[_0xc886('0x2d')][_0xc886('0x30')]));_0x27ec42[_0xc886('0x31')]=_0x27ec42[_0xc886('0x31')][_0xc886('0x32')]?_0x27ec42['attributes']:_0x2a8667[_0xc886('0x2e')];if(!_0x411dcd['query']['hasOwnProperty'](_0xc886('0x33'))){_0x27ec42['limit']=qs[_0xc886('0x1c')](_0x411dcd[_0xc886('0x2d')][_0xc886('0x1c')]);_0x27ec42['offset']=qs[_0xc886('0x1a')](_0x411dcd[_0xc886('0x2d')]['offset']);}_0x27ec42[_0xc886('0x34')]=qs[_0xc886('0x35')](_0x411dcd[_0xc886('0x2d')][_0xc886('0x35')]);_0x27ec42['where']=qs[_0xc886('0x36')](_[_0xc886('0x37')](_0x411dcd[_0xc886('0x2d')],_0x2a8667[_0xc886('0x36')]),_0x338445);if(_0x411dcd[_0xc886('0x2d')][_0xc886('0x38')]){_0x27ec42[_0xc886('0x39')]=_['merge'](_0x27ec42[_0xc886('0x39')],{'$or':_[_0xc886('0x3a')](_0x27ec42[_0xc886('0x31')],function(_0x31fb7e){var _0x57ec90={};_0x57ec90[_0x31fb7e]={'$like':'%'+_0x411dcd[_0xc886('0x2d')][_0xc886('0x38')]+'%'};return _0x57ec90;})});}_0x27ec42=_['merge']({},_0x27ec42,_0x411dcd['options']);var _0x6c6b41={'where':_0x27ec42[_0xc886('0x39')]};return db[_0xc886('0x2a')][_0xc886('0x1d')](_0x6c6b41)['then'](function(_0x5956d6){_0x49620c[_0xc886('0x1d')]=_0x5956d6;if(_0x411dcd[_0xc886('0x2d')][_0xc886('0x3b')]){_0x27ec42[_0xc886('0x3c')]=[{'all':!![]}];}return db[_0xc886('0x2a')]['findAll'](_0x27ec42);})['then'](function(_0x411b05){_0x49620c[_0xc886('0x3d')]=_0x411b05;return _0x49620c;})[_0xc886('0x23')](respondWithFilteredResult(_0x5b8b41,_0x27ec42))[_0xc886('0x3e')](handleError(_0x5b8b41,null));})[_0xc886('0x3e')](handleError(_0x5b8b41,null));};exports[_0xc886('0x3f')]=function(_0x43df59,_0x298751){var _0x26587a={'raw':![],'where':{'id':_0x43df59[_0xc886('0x40')]['id']}},_0x36edee={};_0x36edee[_0xc886('0x2e')]=_[_0xc886('0x2c')](db[_0xc886('0x2a')][_0xc886('0x41')]);_0x36edee[_0xc886('0x2d')]=_[_0xc886('0x2c')](_0x43df59[_0xc886('0x2d')]);_0x36edee[_0xc886('0x36')]=_['intersection'](_0x36edee[_0xc886('0x2e')],_0x36edee[_0xc886('0x2d')]);_0x26587a[_0xc886('0x31')]=_[_0xc886('0x2f')](_0x36edee['model'],qs[_0xc886('0x30')](_0x43df59[_0xc886('0x2d')]['fields']));_0x26587a[_0xc886('0x31')]=_0x26587a[_0xc886('0x31')][_0xc886('0x32')]?_0x26587a[_0xc886('0x31')]:_0x36edee[_0xc886('0x2e')];if(_0x43df59['query'][_0xc886('0x3b')]){_0x26587a['include']=[{'all':!![]}];}_0x26587a=_[_0xc886('0x42')]({},_0x26587a,_0x43df59['options']);return db[_0xc886('0x2a')][_0xc886('0x43')](_0x26587a)[_0xc886('0x23')](handleEntityNotFound(_0x298751,null))[_0xc886('0x23')](respondWithResult(_0x298751,null))[_0xc886('0x3e')](handleError(_0x298751,null));};exports[_0xc886('0x44')]=function(_0x311f18,_0x3956cd){return db[_0xc886('0x2a')][_0xc886('0x44')](_0x311f18['body'],{})[_0xc886('0x23')](function(_0xf1bc3d){var _0x50647a=_0x311f18[_0xc886('0x45')][_0xc886('0x24')]({'plain':!![]});if(!_0x50647a)throw new Error(_0xc886('0x46'));if(_0x50647a[_0xc886('0x47')]===_0xc886('0x45')){var _0x3a2706=_0xf1bc3d[_0xc886('0x24')]({'plain':!![]});var _0xb16ad9=_0xc886('0x25');return db[_0xc886('0x48')]['find']({'where':{'name':_0xb16ad9,'userProfileId':_0x50647a['userProfileId']},'raw':!![]})[_0xc886('0x23')](function(_0x4e29d6){if(_0x4e29d6&&_0x4e29d6[_0xc886('0x49')]===0x0){return db[_0xc886('0x4a')][_0xc886('0x44')]({'name':_0x3a2706[_0xc886('0x29')],'resourceId':_0x3a2706['id'],'type':_0x4e29d6['name'],'sectionId':_0x4e29d6['id']},{})[_0xc886('0x23')](function(){return _0xf1bc3d;});}else{return _0xf1bc3d;}})[_0xc886('0x3e')](function(_0x529573){logger[_0xc886('0x27')](_0xc886('0x4b'),_0x529573);throw _0x529573;});}return _0xf1bc3d;})[_0xc886('0x23')](respondWithResult(_0x3956cd,0xc9))[_0xc886('0x3e')](handleError(_0x3956cd,null));};exports['update']=function(_0x51c781,_0x16eebf){if(_0x51c781['body']['id']){delete _0x51c781[_0xc886('0x4c')]['id'];}return db[_0xc886('0x2a')][_0xc886('0x43')]({'where':{'id':_0x51c781['params']['id']}})[_0xc886('0x23')](handleEntityNotFound(_0x16eebf,null))['then'](saveUpdates(_0x51c781[_0xc886('0x4c')],null))[_0xc886('0x23')](respondWithResult(_0x16eebf,null))[_0xc886('0x3e')](handleError(_0x16eebf,null));};exports[_0xc886('0x26')]=function(_0x14a82e,_0x14c2aa){return db['CmCompany'][_0xc886('0x43')]({'where':{'id':_0x14a82e[_0xc886('0x40')]['id']}})['then'](handleEntityNotFound(_0x14c2aa,null))[_0xc886('0x23')](removeEntity(_0x14c2aa,null))[_0xc886('0x3e')](handleError(_0x14c2aa,null));};exports['describe']=function(_0x832f5,_0x35282d){return db[_0xc886('0x2a')][_0xc886('0x2b')]()[_0xc886('0x23')](respondWithResult(_0x35282d,null))[_0xc886('0x3e')](handleError(_0x35282d,null));};exports['addContacts']=function(_0x42bec0,_0x43736e,_0x5a7cbe){return db[_0xc886('0x4d')][_0xc886('0x43')]({'where':{'id':_0x42bec0['params']['id']}})['then'](handleEntityNotFound(_0x43736e,null))['then'](function(_0xa21f67){if(_0xa21f67){return _0xa21f67[_0xc886('0x4e')](_0x42bec0[_0xc886('0x4c')][_0xc886('0x4f')],_[_0xc886('0x50')](_0x42bec0[_0xc886('0x4c')],[_0xc886('0x4f'),'id'])||{});}})[_0xc886('0x23')](respondWithResult(_0x43736e,null))[_0xc886('0x3e')](handleError(_0x43736e,null));};exports['getContacts']=function(_0x3fb979,_0x3622c6,_0x26e023){var _0x2f1a25={};var _0x31cc3e={};var _0x3e8068;var _0x3f63e6;return db[_0xc886('0x2a')]['findOne']({'where':{'id':_0x3fb979[_0xc886('0x40')]['id']}})[_0xc886('0x23')](handleEntityNotFound(_0x3622c6,null))[_0xc886('0x23')](function(_0x121a8a){if(_0x121a8a){_0x3e8068=_0x121a8a;_0x31cc3e[_0xc886('0x2e')]=_[_0xc886('0x2c')](db['CmContact'][_0xc886('0x41')]);_0x31cc3e[_0xc886('0x2d')]=_[_0xc886('0x2c')](_0x3fb979[_0xc886('0x2d')]);_0x31cc3e['filters']=_[_0xc886('0x2f')](_0x31cc3e['model'],_0x31cc3e[_0xc886('0x2d')]);_0x2f1a25[_0xc886('0x31')]=_[_0xc886('0x2f')](_0x31cc3e[_0xc886('0x2e')],qs['fields'](_0x3fb979['query'][_0xc886('0x30')]));_0x2f1a25[_0xc886('0x31')]=_0x2f1a25[_0xc886('0x31')][_0xc886('0x32')]?_0x2f1a25[_0xc886('0x31')]:_0x31cc3e[_0xc886('0x2e')];_0x2f1a25['order']=qs[_0xc886('0x35')](_0x3fb979[_0xc886('0x2d')][_0xc886('0x35')]);_0x2f1a25['where']=qs[_0xc886('0x36')](_[_0xc886('0x37')](_0x3fb979[_0xc886('0x2d')],_0x31cc3e[_0xc886('0x36')]));if(_0x3fb979['query'][_0xc886('0x38')]){_0x2f1a25['where']=_['merge'](_0x2f1a25[_0xc886('0x39')],{'$or':_[_0xc886('0x3a')](_0x2f1a25[_0xc886('0x31')],function(_0x2a2527){var _0xe57146={};_0xe57146[_0x2a2527]={'$like':'%'+_0x3fb979[_0xc886('0x2d')][_0xc886('0x38')]+'%'};return _0xe57146;})});}_0x2f1a25=_[_0xc886('0x42')]({},_0x2f1a25,_0x3fb979[_0xc886('0x51')]);return _0x3e8068[_0xc886('0x52')](_0x2f1a25);}})['then'](function(_0x6363bc){if(_0x6363bc){_0x3f63e6=_0x6363bc[_0xc886('0x32')];if(!_0x3fb979['query'][_0xc886('0x53')](_0xc886('0x33'))){_0x2f1a25[_0xc886('0x1c')]=qs[_0xc886('0x1c')](_0x3fb979[_0xc886('0x2d')][_0xc886('0x1c')]);_0x2f1a25[_0xc886('0x1a')]=qs[_0xc886('0x1a')](_0x3fb979[_0xc886('0x2d')][_0xc886('0x1a')]);}return _0x3e8068[_0xc886('0x52')](_0x2f1a25);}})[_0xc886('0x23')](function(_0xd917bb){if(_0xd917bb){return _0xd917bb?{'count':_0x3f63e6,'rows':_0xd917bb}:null;}})[_0xc886('0x23')](respondWithResult(_0x3622c6,null))[_0xc886('0x3e')](handleError(_0x3622c6,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index 10f9ffa..ff19d05 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 _0x6769=['CmCompany','cm_companies','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x53a85b,_0x269718){var _0x10296f=function(_0x55ef17){while(--_0x55ef17){_0x53a85b['push'](_0x53a85b['shift']());}};_0x10296f(++_0x269718);}(_0x6769,0xde));var _0x9676=function(_0x437bf9,_0x1a5817){_0x437bf9=_0x437bf9-0x0;var _0x5c8602=_0x6769[_0x437bf9];return _0x5c8602;};'use strict';var _=require(_0x9676('0x0'));var util=require(_0x9676('0x1'));var logger=require('../../config/logger')(_0x9676('0x2'));var moment=require(_0x9676('0x3'));var BPromise=require('bluebird');var rp=require(_0x9676('0x4'));var fs=require('fs');var path=require(_0x9676('0x5'));var rimraf=require(_0x9676('0x6'));var config=require(_0x9676('0x7'));var attributes=require('./cmCompany.attributes');module['exports']=function(_0x3739a9,_0x27baf2){return _0x3739a9['define'](_0x9676('0x8'),attributes,{'tableName':_0x9676('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc991=['path','../../config/environment','exports','define','cm_companies','lodash','util','api','moment','bluebird','request-promise'];(function(_0x4bce63,_0x546672){var _0x27ae47=function(_0x374693){while(--_0x374693){_0x4bce63['push'](_0x4bce63['shift']());}};_0x27ae47(++_0x546672);}(_0xc991,0x1f4));var _0x1c99=function(_0x2ea7c4,_0x488ec6){_0x2ea7c4=_0x2ea7c4-0x0;var _0x4098a1=_0xc991[_0x2ea7c4];return _0x4098a1;};'use strict';var _=require(_0x1c99('0x0'));var util=require(_0x1c99('0x1'));var logger=require('../../config/logger')(_0x1c99('0x2'));var moment=require(_0x1c99('0x3'));var BPromise=require(_0x1c99('0x4'));var rp=require(_0x1c99('0x5'));var fs=require('fs');var path=require(_0x1c99('0x6'));var rimraf=require('rimraf');var config=require(_0x1c99('0x7'));var attributes=require('./cmCompany.attributes');module[_0x1c99('0x8')]=function(_0x393c3f,_0x50642a){return _0x393c3f[_0x1c99('0x9')]('CmCompany',attributes,{'tableName':_0x1c99('0xa'),'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 5335b32..7ef9550 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 _0x74ea=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','request','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash'];(function(_0x503c66,_0x253c79){var _0x4b38d3=function(_0x75807c){while(--_0x75807c){_0x503c66['push'](_0x503c66['shift']());}};_0x4b38d3(++_0x253c79);}(_0x74ea,0xb3));var _0xa74e=function(_0x14e5a1,_0x239131){_0x14e5a1=_0x14e5a1-0x0;var _0x4e6c40=_0x74ea[_0x14e5a1];return _0x4e6c40;};'use strict';var _=require(_0xa74e('0x0'));var util=require(_0xa74e('0x1'));var moment=require('moment');var BPromise=require(_0xa74e('0x2'));var rs=require(_0xa74e('0x3'));var fs=require('fs');var Redis=require(_0xa74e('0x4'));var db=require(_0xa74e('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xa74e('0x6'))(_0xa74e('0x7'));var config=require(_0xa74e('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5a7cf4,_0x3afcc0,_0xccbb6f){return new BPromise(function(_0x556a4e,_0x2584dc){return client[_0xa74e('0x9')](_0x5a7cf4,_0xccbb6f)['then'](function(_0x27d2f0){logger[_0xa74e('0xa')](_0xa74e('0xb'),_0x3afcc0,_0xa74e('0xc'));logger[_0xa74e('0xd')](_0xa74e('0xe'),_0x3afcc0,'request\x20sent',JSON['stringify'](_0x27d2f0));if(_0x27d2f0[_0xa74e('0xf')]){if(_0x27d2f0[_0xa74e('0xf')][_0xa74e('0x10')]===0x1f4){logger[_0xa74e('0xf')]('CmCompany,\x20%s,\x20%s',_0x3afcc0,_0x27d2f0[_0xa74e('0xf')][_0xa74e('0x11')]);return _0x2584dc(_0x27d2f0[_0xa74e('0xf')]['message']);}logger[_0xa74e('0xf')](_0xa74e('0xb'),_0x3afcc0,_0x27d2f0[_0xa74e('0xf')]['message']);return _0x556a4e(_0x27d2f0[_0xa74e('0xf')][_0xa74e('0x11')]);}else{logger[_0xa74e('0xa')]('CmCompany,\x20%s,\x20%s',_0x3afcc0,_0xa74e('0xc'));_0x556a4e(_0x27d2f0[_0xa74e('0x12')][_0xa74e('0x11')]);}})[_0xa74e('0x13')](function(_0x460e99){logger[_0xa74e('0xf')](_0xa74e('0xb'),_0x3afcc0,_0x460e99);_0x2584dc(_0x460e99);});});} \ No newline at end of file +var _0x6bd3=['../../config/environment','client','http','request','then','info','CmCompany,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc'];(function(_0x4792c8,_0x5158a1){var _0x35edb1=function(_0x2472d3){while(--_0x2472d3){_0x4792c8['push'](_0x4792c8['shift']());}};_0x35edb1(++_0x5158a1);}(_0x6bd3,0x13a));var _0x36bd=function(_0x45c673,_0x573b01){_0x45c673=_0x45c673-0x0;var _0x38e5e5=_0x6bd3[_0x45c673];return _0x38e5e5;};'use strict';var _=require(_0x36bd('0x0'));var util=require(_0x36bd('0x1'));var moment=require(_0x36bd('0x2'));var BPromise=require(_0x36bd('0x3'));var rs=require(_0x36bd('0x4'));var fs=require('fs');var Redis=require(_0x36bd('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x36bd('0x6'))(_0x36bd('0x7'));var config=require(_0x36bd('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x36bd('0x9')][_0x36bd('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x487944,_0x5db7c3,_0x34536a){return new BPromise(function(_0x16056d,_0x2bec3a){return client[_0x36bd('0xb')](_0x487944,_0x34536a)[_0x36bd('0xc')](function(_0x17a7c8){logger[_0x36bd('0xd')](_0x36bd('0xe'),_0x5db7c3,'request\x20sent');logger[_0x36bd('0xf')]('CmCompany,\x20%s,\x20%s,\x20%s',_0x5db7c3,_0x36bd('0x10'),JSON[_0x36bd('0x11')](_0x17a7c8));if(_0x17a7c8[_0x36bd('0x12')]){if(_0x17a7c8[_0x36bd('0x12')][_0x36bd('0x13')]===0x1f4){logger['error'](_0x36bd('0xe'),_0x5db7c3,_0x17a7c8[_0x36bd('0x12')]['message']);return _0x2bec3a(_0x17a7c8['error'][_0x36bd('0x14')]);}logger[_0x36bd('0x12')](_0x36bd('0xe'),_0x5db7c3,_0x17a7c8[_0x36bd('0x12')]['message']);return _0x16056d(_0x17a7c8['error'][_0x36bd('0x14')]);}else{logger['info'](_0x36bd('0xe'),_0x5db7c3,'request\x20sent');_0x16056d(_0x17a7c8[_0x36bd('0x15')][_0x36bd('0x14')]);}})[_0x36bd('0x16')](function(_0xf5e593){logger[_0x36bd('0x12')](_0x36bd('0xe'),_0x5db7c3,_0xf5e593);_0x2bec3a(_0xf5e593);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index 1671c4a..f98d340 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 _0x923e=['update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/contacts','post','create','addContacts'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x923e,0x93));var _0xe923=function(_0x4f4679,_0x713087){_0x4f4679=_0x4f4679-0x0;var _0x2f7cd0=_0x923e[_0x4f4679];return _0x2f7cd0;};'use strict';var multer=require(_0xe923('0x0'));var util=require(_0xe923('0x1'));var path=require(_0xe923('0x2'));var timeout=require(_0xe923('0x3'));var express=require(_0xe923('0x4'));var router=express[_0xe923('0x5')]();var fs_extra=require(_0xe923('0x6'));var auth=require(_0xe923('0x7'));var interaction=require(_0xe923('0x8'));var config=require(_0xe923('0x9'));var controller=require(_0xe923('0xa'));router[_0xe923('0xb')]('/',auth[_0xe923('0xc')](),controller['index']);router[_0xe923('0xb')](_0xe923('0xd'),auth[_0xe923('0xc')](),controller[_0xe923('0xe')]);router['get'](_0xe923('0xf'),auth[_0xe923('0xc')](),controller[_0xe923('0x10')]);router['get'](_0xe923('0x11'),auth[_0xe923('0xc')](),controller['getContacts']);router[_0xe923('0x12')]('/',auth[_0xe923('0xc')](),controller[_0xe923('0x13')]);router[_0xe923('0x12')](_0xe923('0x11'),auth[_0xe923('0xc')](),controller[_0xe923('0x14')]);router['put']('/:id',auth[_0xe923('0xc')](),controller[_0xe923('0x15')]);router[_0xe923('0x16')](_0xe923('0xf'),auth[_0xe923('0xc')](),controller[_0xe923('0x17')]);module['exports']=router; \ No newline at end of file +var _0xa750=['addContacts','put','update','delete','destroy','exports','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/contacts','getContacts','post'];(function(_0x59e862,_0x477bf2){var _0x1a25ee=function(_0xc61e64){while(--_0xc61e64){_0x59e862['push'](_0x59e862['shift']());}};_0x1a25ee(++_0x477bf2);}(_0xa750,0x13a));var _0x0a75=function(_0x599bc6,_0x2602cb){_0x599bc6=_0x599bc6-0x0;var _0x23011a=_0xa750[_0x599bc6];return _0x23011a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x0a75('0x0'));var timeout=require(_0x0a75('0x1'));var express=require('express');var router=express[_0x0a75('0x2')]();var fs_extra=require(_0x0a75('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x0a75('0x4'));var config=require(_0x0a75('0x5'));var controller=require(_0x0a75('0x6'));router[_0x0a75('0x7')]('/',auth[_0x0a75('0x8')](),controller['index']);router[_0x0a75('0x7')](_0x0a75('0x9'),auth[_0x0a75('0x8')](),controller[_0x0a75('0xa')]);router[_0x0a75('0x7')](_0x0a75('0xb'),auth[_0x0a75('0x8')](),controller[_0x0a75('0xc')]);router[_0x0a75('0x7')](_0x0a75('0xd'),auth[_0x0a75('0x8')](),controller[_0x0a75('0xe')]);router[_0x0a75('0xf')]('/',auth[_0x0a75('0x8')](),controller['create']);router[_0x0a75('0xf')](_0x0a75('0xd'),auth[_0x0a75('0x8')](),controller[_0x0a75('0x10')]);router[_0x0a75('0x11')]('/:id',auth[_0x0a75('0x8')](),controller[_0x0a75('0x12')]);router[_0x0a75('0x13')](_0x0a75('0xb'),auth[_0x0a75('0x8')](),controller[_0x0a75('0x14')]);module[_0x0a75('0x15')]=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index 745c87f..56be2ff 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 _0x4577=['NOW','lodash','sequelize','exports','STRING','TEXT','INTEGER','UNSIGNED'];(function(_0xed3799,_0x4b0606){var _0x20aca9=function(_0x24976c){while(--_0x24976c){_0xed3799['push'](_0xed3799['shift']());}};_0x20aca9(++_0x4b0606);}(_0x4577,0xd9));var _0x7457=function(_0x9686e3,_0x205f24){_0x9686e3=_0x9686e3-0x0;var _0x4d6220=_0x4577[_0x9686e3];return _0x4d6220;};'use strict';var _=require(_0x7457('0x0'));var Sequelize=require(_0x7457('0x1'));module[_0x7457('0x2')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0x7457('0x3')]},'street':{'type':Sequelize[_0x7457('0x3')]},'postalCode':{'type':Sequelize[_0x7457('0x3')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x7457('0x3')]},'dateOfBirth':{'type':Sequelize[_0x7457('0x3')]},'description':{'type':Sequelize[_0x7457('0x4')]},'phone':{'type':Sequelize[_0x7457('0x3')]},'mobile':{'type':Sequelize[_0x7457('0x3')]},'fax':{'type':Sequelize[_0x7457('0x3')]},'email':{'type':Sequelize[_0x7457('0x3')]},'url':{'type':Sequelize[_0x7457('0x3')]},'facebook':{'type':Sequelize[_0x7457('0x3')]},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize[_0x7457('0x3')]},'skype':{'type':Sequelize[_0x7457('0x3')]},'teams':{'type':Sequelize[_0x7457('0x3')]},'viber':{'type':Sequelize[_0x7457('0x3')]},'line':{'type':Sequelize[_0x7457('0x3')]},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize[_0x7457('0x3')]},'UserId':{'type':Sequelize[_0x7457('0x5')]},'priority':{'type':Sequelize[_0x7457('0x5')](0x2)[_0x7457('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0x7457('0x7')]}}; \ No newline at end of file +var _0x1ccd=['DATE','NOW','lodash','sequelize','STRING','TEXT','INTEGER','UNSIGNED'];(function(_0x10a07d,_0x551aca){var _0x2cf702=function(_0x4d85c0){while(--_0x4d85c0){_0x10a07d['push'](_0x10a07d['shift']());}};_0x2cf702(++_0x551aca);}(_0x1ccd,0x142));var _0xd1cc=function(_0x6aad74,_0x32ecf4){_0x6aad74=_0x6aad74-0x0;var _0x5b1c38=_0x1ccd[_0x6aad74];return _0x5b1c38;};'use strict';var _=require(_0xd1cc('0x0'));var Sequelize=require(_0xd1cc('0x1'));module['exports']={'firstName':{'type':Sequelize[_0xd1cc('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0xd1cc('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0xd1cc('0x2')]},'city':{'type':Sequelize[_0xd1cc('0x2')]},'country':{'type':Sequelize[_0xd1cc('0x2')]},'dateOfBirth':{'type':Sequelize[_0xd1cc('0x2')]},'description':{'type':Sequelize[_0xd1cc('0x3')]},'phone':{'type':Sequelize[_0xd1cc('0x2')]},'mobile':{'type':Sequelize[_0xd1cc('0x2')]},'fax':{'type':Sequelize[_0xd1cc('0x2')]},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize[_0xd1cc('0x2')]},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize[_0xd1cc('0x2')]},'twitter':{'type':Sequelize[_0xd1cc('0x2')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize[_0xd1cc('0x2')]},'line':{'type':Sequelize[_0xd1cc('0x2')]},'wechat':{'type':Sequelize[_0xd1cc('0x2')]},'telegram':{'type':Sequelize[_0xd1cc('0x2')]},'UserId':{'type':Sequelize[_0xd1cc('0x4')]},'priority':{'type':Sequelize[_0xd1cc('0x4')](0x2)[_0xd1cc('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xd1cc('0x6')],'defaultValue':Sequelize[_0xd1cc('0x7')]}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index 18a4e16..c0f8e8c 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 _0xe285=['rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','redis','defaults','localhost','./cmContact.socket','sendStatus','status','offset','undefined','limit','count','Content-Range','json','reject','save','update','then','destroy','end','error','name','send','CmContact','describe','length','startsWith','cf_','push','CmCustomField','trimStart','all','fieldType','type','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','from','tools_tags','left_join','uc.CmContactId\x20=\x20c.id','cm_contact_has_tags','t.id\x20=\x20ct.TagId','expr','search','parseSearch','sqlOperator','conditions','find','Tag','value','split','map','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','and','dateOfBirth','datetime','castTo','DATE','buildExpression','text','filter','isNil','Contact','isEmpty','c.ListId\x20IN\x20?','concat','\x20=\x20?','tag','isArray','replace','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','isNumeric','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.lastName\x20LIKE\x20?','group','QueryTypes','SELECT','DESC','resolve','agent','some','c.ListId\x20IS\x20NULL','user','role','ListId','sequelize','toString','keyBy','merge','c.id','c.phone','c.mobile','c.ListId','c.createdAt','c.deletedAt','c.CompanyId','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','Tags','rows','catch','params','tags','columnName','findAll','displayName','custom','values','body','get','join','info','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','create','ChatInteraction','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','OpenchannelInteraction','OpenchannelMessage','CmHopperHistory','ReportAgentPreview','VoiceCallReport','ChatQueueReport','MailQueueReport','OpenchannelQueueReport','WhatsappInteraction','WhatsappQueueReport','bulkCreate','duplicates','findOrCreate','spread','show','$and','omit','format','cf_%d','table','cm_contacts','setFields','toParam','phone','getTags','findOne','options','setTags','ids','getHoppers','includeAll','include','rawAttributes','ContactId','CmHopperFinal','getJscriptySessions','JscriptySessionReport','No\x20ListId\x20specified','binding_keys','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','server/files/tmp','filename','chmodSync','child_process','fork','../../components/import/cm/csv','File\x20uploaded\x20correctly!','pid','createReadStream','parse','meta','import','binding','../../components/import/cm/csv2','stringify','message','error\x20child\x20process','getJourney','mail','chat','sms','openchannel','fax','whatsapp','voice','channel','includes','toLowerCase','Invalid\x20channel','range','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','uniqueid','source','destination','callerid','endtime','duration','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','alias','fullname','startCase','Account','closed','closedAt','disposition','secondDisposition','thirdDisposition','UserId','key','Owner','browserName','customerIp','customerPort','deviceModel','osName','ratingType','ratingValue','referer','substatus','externalUrl','Interaction','findAndCountAll','reverse','eml-format'];(function(_0x483e3a,_0x568361){var _0x43fca9=function(_0x273d7e){while(--_0x273d7e){_0x483e3a['push'](_0x483e3a['shift']());}};_0x43fca9(++_0x568361);}(_0xe285,0x11c));var _0x5e28=function(_0x15bc81,_0x4d4f77){_0x15bc81=_0x15bc81-0x0;var _0x59440e=_0xe285[_0x15bc81];return _0x59440e;};'use strict';var emlformat=require(_0x5e28('0x0'));var rimraf=require(_0x5e28('0x1'));var zipdir=require(_0x5e28('0x2'));var jsonpatch=require(_0x5e28('0x3'));var rp=require(_0x5e28('0x4'));var moment=require(_0x5e28('0x5'));var BPromise=require(_0x5e28('0x6'));var Mustache=require(_0x5e28('0x7'));var util=require(_0x5e28('0x8'));var path=require(_0x5e28('0x9'));var sox=require(_0x5e28('0xa'));var csv=require(_0x5e28('0xb'));var ejs=require(_0x5e28('0xc'));var fs=require('fs');var fs_extra=require(_0x5e28('0xd'));var _=require('lodash');var squel=require(_0x5e28('0xe'));var crypto=require(_0x5e28('0xf'));var jsforce=require(_0x5e28('0x10'));var deskjs=require(_0x5e28('0x11'));var toCsv=require('to-csv');var querystring=require(_0x5e28('0x12'));var Papa=require('papaparse');var Redis=require(_0x5e28('0x13'));var authService=require(_0x5e28('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x5e28('0x15'));var hardwareService=require(_0x5e28('0x16'));var logger=require('../../config/logger')(_0x5e28('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5e28('0x18'));var db=require('../../mysqldb')['db'];config[_0x5e28('0x19')]=_[_0x5e28('0x1a')](config[_0x5e28('0x19')],{'host':_0x5e28('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5e28('0x19')]));require(_0x5e28('0x1c'))['register'](socket);function respondWithStatusCode(_0x130023,_0x4dac9c){_0x4dac9c=_0x4dac9c||0xcc;return function(_0x1f581f){if(_0x1f581f){return _0x130023[_0x5e28('0x1d')](_0x4dac9c);}return _0x130023[_0x5e28('0x1e')](_0x4dac9c)['end']();};}function respondWithResult(_0x256548,_0x2fb670){_0x2fb670=_0x2fb670||0xc8;return function(_0x32c91e){if(_0x32c91e){return _0x256548[_0x5e28('0x1e')](_0x2fb670)['json'](_0x32c91e);}};}function respondWithFilteredResult(_0x2b583f,_0x3ed87c){return function(_0x27b9df){if(_0x27b9df){var _0x48d52b=typeof _0x3ed87c[_0x5e28('0x1f')]===_0x5e28('0x20')&&typeof _0x3ed87c[_0x5e28('0x21')]===_0x5e28('0x20');var _0x2effa6=_0x27b9df[_0x5e28('0x22')];var _0x262081=_0x48d52b?0x0:_0x3ed87c[_0x5e28('0x1f')];var _0x5b8dac=_0x48d52b?_0x27b9df[_0x5e28('0x22')]:_0x3ed87c['offset']+_0x3ed87c['limit'];var _0xfd3e6;if(_0x5b8dac>=_0x2effa6){_0x5b8dac=_0x2effa6;_0xfd3e6=0xc8;}else{_0xfd3e6=0xce;}_0x2b583f[_0x5e28('0x1e')](_0xfd3e6);return _0x2b583f['set'](_0x5e28('0x23'),_0x262081+'-'+_0x5b8dac+'/'+_0x2effa6)[_0x5e28('0x24')](_0x27b9df);}return null;};}function patchUpdates(_0x40fe4b){return function(_0x1064e7){try{jsonpatch['apply'](_0x1064e7,_0x40fe4b,!![]);}catch(_0x731856){return BPromise[_0x5e28('0x25')](_0x731856);}return _0x1064e7[_0x5e28('0x26')]();};}function saveUpdates(_0x16510d,_0x3f6840){return function(_0x102642){if(_0x102642){return _0x102642[_0x5e28('0x27')](_0x16510d)[_0x5e28('0x28')](function(_0xcb22cf){return _0xcb22cf;});}return null;};}function removeEntity(_0x14f1b8,_0x4f56db){return function(_0x1b4238){if(_0x1b4238){return _0x1b4238[_0x5e28('0x29')]()[_0x5e28('0x28')](function(){_0x14f1b8[_0x5e28('0x1e')](0xcc)[_0x5e28('0x2a')]();});}};}function handleEntityNotFound(_0x3c3956,_0x3d5c87){return function(_0x55598a){if(!_0x55598a){_0x3c3956['sendStatus'](0x194);}return _0x55598a;};}function handleError(_0x33eb78,_0x58c926){_0x58c926=_0x58c926||0x1f4;return function(_0x710d9b){logger[_0x5e28('0x2b')](_0x710d9b['stack']);if(_0x710d9b[_0x5e28('0x2c')]){delete _0x710d9b[_0x5e28('0x2c')];}_0x33eb78[_0x5e28('0x1e')](_0x58c926)[_0x5e28('0x2d')](_0x710d9b);};}exports['index']=function(_0x361717,_0x288a2e){var _0x3a241b={},_0x389492={},_0xaa0d8c={'count':0x0,'rows':[]};return db[_0x5e28('0x2e')][_0x5e28('0x2f')]()[_0x5e28('0x28')](function(_0x3967ec){var _0xa13ecd=[];for(var _0x485958=0x0;_0x4859580x1){_0x5ae3fe['or'](_0x5e28('0x6e'),qs['getFullTextValue'](_0x6fd7b0),null);}else{if(qs[_0x5e28('0x6f')](_0x6fd7b0)){_0x5ae3fe['or']('c.id\x20LIKE\x20?',_0x6fd7b0+'%');_0x5ae3fe['or']('c.phone\x20LIKE\x20?',_0x6fd7b0+'%');_0x5ae3fe['or'](_0x5e28('0x70'),_0x6fd7b0+'%');_0x5ae3fe['or'](_0x5e28('0x71'),_0x6fd7b0+'%');}else if(qs[_0x5e28('0x72')](_0x6fd7b0)){_0x5ae3fe['or'](_0x5e28('0x73'),_0x6fd7b0+'%');}else{_0x5ae3fe['or']('c.firstName\x20LIKE\x20?','%'+_0x6fd7b0+'%');_0x5ae3fe['or'](_0x5e28('0x74'),'%'+_0x6fd7b0+'%');_0x5ae3fe['or'](_0x5e28('0x73'),'%'+_0x6fd7b0+'%');}}}}_0x56c43e['where'](_0x5ae3fe);_0x56c43e[_0x5e28('0x75')]('c.id');var _0x5a3a82={'type':db['Sequelize'][_0x5e28('0x76')][_0x5e28('0x77')],'raw':!![]};var _0x5c3436=_0x56c43e['clone']()[_0x5e28('0x47')]('c.id');if(_0x3a241b[_0x5e28('0x42')]){_0x3a241b[_0x5e28('0x42')][_0x5e28('0x59')](function(_0x2d240c){_0x56c43e[_0x5e28('0x42')]('c.'+_0x2d240c[0x0],_0x2d240c[0x1]===_0x5e28('0x78')?![]:!![]);});}if(!_[_0x5e28('0x67')](_0x1602a5)){_0x56c43e['having'](_0x199ad8);_0x5c3436['where']('t.id\x20IN\x20?',_0x1602a5);}BPromise[_0x5e28('0x79')]()[_0x5e28('0x28')](function(){if(!_0x371851)return;if(_0x361717['user']['role']!==_0x5e28('0x7a'))return;if(!_[_0x5e28('0x7b')](_0x371851[_0x5e28('0x53')],[_0x5e28('0x47'),_0x5e28('0x5c')])){return _0x361717['user']['getLists']({'attributes':['id'],'raw':!![]})[_0x5e28('0x28')](function(_0x430be4){if(_[_0x5e28('0x67')](_0x430be4)){_0x5c3436[_0x5e28('0x44')](_0x5e28('0x7c'));_0x56c43e[_0x5e28('0x44')](_0x5e28('0x7c'));}else{_0x5c3436[_0x5e28('0x44')](_0x5e28('0x68'),_['map'](_0x430be4,'id'));_0x56c43e['where']('c.ListId\x20IN\x20?',_['map'](_0x430be4,'id'));}});}})[_0x5e28('0x28')](function(){if(_0x361717[_0x5e28('0x7d')][_0x5e28('0x7e')]===_0x5e28('0x7a')&&!_0x371851&&!_0x361717[_0x5e28('0x3b')][_0x5e28('0x7f')])return[];return db[_0x5e28('0x80')][_0x5e28('0x3b')](_0x5c3436[_0x5e28('0x81')](),_0x5a3a82);})['then'](function(_0x1b0c0a){_0xaa0d8c['count']=_0x1b0c0a[_0x5e28('0x30')];if(_0xaa0d8c[_0x5e28('0x22')]===0x0)return[];return db['sequelize'][_0x5e28('0x3b')](_0x4910bc[_0x5e28('0x81')](),_0x5a3a82)[_0x5e28('0x28')](function(_0x2446b2){_0xdcda3b=_[_0x5e28('0x82')](_0x2446b2,'id');_0x5a3a82=_[_0x5e28('0x83')](_0x5a3a82,{'model':db[_0x5e28('0x2e')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x361717[_0x5e28('0x3b')][_0x5e28('0x3f')]){_0x3a241b[_0x5e28('0x3e')][_0x5e28('0x59')](function(_0x44ad96){_0x56c43e['field']('c.'+_0x44ad96);});}else{_0x56c43e[_0x5e28('0x47')](_0x5e28('0x84'));_0x56c43e[_0x5e28('0x47')]('c.firstName');_0x56c43e[_0x5e28('0x47')]('c.lastName');_0x56c43e[_0x5e28('0x47')](_0x5e28('0x85'));_0x56c43e['field'](_0x5e28('0x86'));_0x56c43e[_0x5e28('0x47')]('c.fax');_0x56c43e['field']('c.email');_0x56c43e[_0x5e28('0x47')](_0x5e28('0x87'));_0x56c43e[_0x5e28('0x47')](_0x5e28('0x88'));_0x56c43e['field'](_0x5e28('0x89'));_0x56c43e[_0x5e28('0x47')](_0x5e28('0x8a'));_0x56c43e[_0x5e28('0x47')](_0x5e28('0x8b'),_0x5e28('0x8c'));}if(_0x3a241b['limit'])_0x56c43e[_0x5e28('0x21')](_0x3a241b[_0x5e28('0x21')]);if(_0x3a241b[_0x5e28('0x1f')])_0x56c43e['offset'](_0x3a241b[_0x5e28('0x1f')]);return db[_0x5e28('0x80')]['query'](_0x56c43e[_0x5e28('0x81')](),_0x5a3a82);});})[_0x5e28('0x28')](function(_0x2af0db){_0x2af0db['forEach'](function(_0x1445c0){if(_0x1445c0[_0x5e28('0x8c')]){_0x1445c0[_0x5e28('0x8d')]=[];_0x1445c0[_0x5e28('0x8c')][_0x5e28('0x57')](',')[_0x5e28('0x59')](function(_0x49c687){_0x1445c0[_0x5e28('0x8d')][_0x5e28('0x33')](_0xdcda3b[_0x49c687]);});}delete _0x1445c0[_0x5e28('0x8c')];});_0xaa0d8c[_0x5e28('0x8e')]=_0x2af0db;return _0xaa0d8c;})[_0x5e28('0x28')](respondWithFilteredResult(_0x288a2e,_0x3a241b));})[_0x5e28('0x8f')](handleError(_0x288a2e,null));};exports[_0x5e28('0x29')]=function(_0x5492ac,_0x590592){return db[_0x5e28('0x2e')]['find']({'where':{'id':_0x5492ac[_0x5e28('0x90')]['id']}})[_0x5e28('0x28')](handleEntityNotFound(_0x590592,null))['then'](removeEntity(_0x590592,null))[_0x5e28('0x8f')](handleError(_0x590592,null));};exports['describe']=function(_0x147783,_0x5c3b8a){return db[_0x5e28('0x2e')][_0x5e28('0x2f')]()[_0x5e28('0x28')](function(_0x3a2e4f){delete _0x3a2e4f[_0x5e28('0x91')];for(var _0x11a961=0x0;_0x11a961=_0x44a0e3){_0x51ec72=_0x44a0e3;_0x18e697=0xc8;}else{_0x18e697=0xce;}_0x25ae62[_0xfdcc('0x1f')](_0x18e697);return _0x25ae62[_0xfdcc('0x25')](_0xfdcc('0x26'),_0x496e85+'-'+_0x51ec72+'/'+_0x44a0e3)[_0xfdcc('0x20')](_0x33c0d4);}return null;};}function patchUpdates(_0x2704c9){return function(_0x389af3){try{jsonpatch[_0xfdcc('0x27')](_0x389af3,_0x2704c9,!![]);}catch(_0x4ba2b7){return BPromise[_0xfdcc('0x28')](_0x4ba2b7);}return _0x389af3[_0xfdcc('0x29')]();};}function saveUpdates(_0x4d5047,_0x11a89a){return function(_0xaf2852){if(_0xaf2852){return _0xaf2852[_0xfdcc('0x2a')](_0x4d5047)[_0xfdcc('0x2b')](function(_0x3af29b){return _0x3af29b;});}return null;};}function removeEntity(_0x37cc78,_0x4247b7){return function(_0x177b57){if(_0x177b57){return _0x177b57[_0xfdcc('0x2c')]()[_0xfdcc('0x2b')](function(){_0x37cc78[_0xfdcc('0x1f')](0xcc)[_0xfdcc('0x1e')]();});}};}function handleEntityNotFound(_0x19860b,_0x21ea83){return function(_0x5cc7ce){if(!_0x5cc7ce){_0x19860b['sendStatus'](0x194);}return _0x5cc7ce;};}function handleError(_0xd98382,_0x4e81cd){_0x4e81cd=_0x4e81cd||0x1f4;return function(_0x1cd6a3){logger[_0xfdcc('0x2d')](_0x1cd6a3[_0xfdcc('0x2e')]);if(_0x1cd6a3['name']){delete _0x1cd6a3[_0xfdcc('0x2f')];}_0xd98382[_0xfdcc('0x1f')](_0x4e81cd)[_0xfdcc('0x30')](_0x1cd6a3);};}exports[_0xfdcc('0x31')]=function(_0x5085d1,_0x2e938e){var _0x28fc8a={},_0x3fc14={},_0x19fd34={'count':0x0,'rows':[]};return db['CmContact'][_0xfdcc('0x32')]()[_0xfdcc('0x2b')](function(_0x40848b){var _0x26a8d9=[];for(var _0x1da12a=0x0;_0x1da12a0x1){_0xaef454['or'](_0xfdcc('0x74'),qs[_0xfdcc('0x75')](_0x409edc),null);}else{if(qs[_0xfdcc('0x76')](_0x409edc)){_0xaef454['or'](_0xfdcc('0x77'),_0x409edc+'%');_0xaef454['or'](_0xfdcc('0x78'),_0x409edc+'%');_0xaef454['or'](_0xfdcc('0x79'),_0x409edc+'%');_0xaef454['or'](_0xfdcc('0x7a'),_0x409edc+'%');}else if(qs[_0xfdcc('0x7b')](_0x409edc)){_0xaef454['or'](_0xfdcc('0x7c'),_0x409edc+'%');}else{_0xaef454['or']('c.firstName\x20LIKE\x20?','%'+_0x409edc+'%');_0xaef454['or'](_0xfdcc('0x7d'),'%'+_0x409edc+'%');_0xaef454['or'](_0xfdcc('0x7c'),'%'+_0x409edc+'%');}}}}_0x22ebca['where'](_0xaef454);_0x22ebca[_0xfdcc('0x7e')](_0xfdcc('0x7f'));var _0x3970e8={'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]};var _0x2dd92d=_0x22ebca[_0xfdcc('0x80')]()[_0xfdcc('0x47')](_0xfdcc('0x7f'));if(_0x28fc8a[_0xfdcc('0x81')]){_0x28fc8a[_0xfdcc('0x81')]['forEach'](function(_0x526328){_0x22ebca[_0xfdcc('0x81')]('c.'+_0x526328[0x0],_0x526328[0x1]==='DESC'?![]:!![]);});}if(!_['isEmpty'](_0x52bc46)){_0x22ebca['having'](_0x2eb39d);_0x2dd92d['where'](_0xfdcc('0x82'),_0x52bc46);}BPromise[_0xfdcc('0x83')]()[_0xfdcc('0x2b')](function(){if(!_0x15bab0)return;if(_0x5085d1[_0xfdcc('0x84')][_0xfdcc('0x85')]!==_0xfdcc('0x86'))return;if(!_['some'](_0x15bab0[_0xfdcc('0x57')],[_0xfdcc('0x47'),_0xfdcc('0x5d')])){return _0x5085d1[_0xfdcc('0x84')][_0xfdcc('0x87')]({'attributes':['id'],'raw':!![]})[_0xfdcc('0x2b')](function(_0x1a53e6){if(_[_0xfdcc('0x68')](_0x1a53e6)){_0x2dd92d[_0xfdcc('0x52')](_0xfdcc('0x88'));_0x22ebca[_0xfdcc('0x52')]('c.ListId\x20IS\x20NULL');}else{_0x2dd92d[_0xfdcc('0x52')]('c.ListId\x20IN\x20?',_['map'](_0x1a53e6,'id'));_0x22ebca[_0xfdcc('0x52')](_0xfdcc('0x6b'),_['map'](_0x1a53e6,'id'));}});}})[_0xfdcc('0x2b')](function(){if(_0x5085d1['user'][_0xfdcc('0x85')]===_0xfdcc('0x86')&&!_0x15bab0&&!_0x5085d1[_0xfdcc('0x3f')][_0xfdcc('0x6a')])return[];return db[_0xfdcc('0x89')][_0xfdcc('0x3f')](_0x2dd92d[_0xfdcc('0x8a')](),_0x3970e8);})[_0xfdcc('0x2b')](function(_0x17c6eb){_0x19fd34['count']=_0x17c6eb[_0xfdcc('0x34')];if(_0x19fd34[_0xfdcc('0x23')]===0x0)return[];return db[_0xfdcc('0x89')][_0xfdcc('0x3f')](_0x1a831a[_0xfdcc('0x8a')](),_0x3970e8)[_0xfdcc('0x2b')](function(_0x25be61){_0x18c22c=_['keyBy'](_0x25be61,'id');_0x3970e8=_[_0xfdcc('0x8b')](_0x3970e8,{'model':db[_0xfdcc('0x8c')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x5085d1[_0xfdcc('0x3f')][_0xfdcc('0x41')]){_0x28fc8a[_0xfdcc('0x42')][_0xfdcc('0x69')](function(_0x5ba486){_0x22ebca[_0xfdcc('0x47')]('c.'+_0x5ba486);});}else{_0x22ebca[_0xfdcc('0x47')]('c.id');_0x22ebca[_0xfdcc('0x47')](_0xfdcc('0x8d'));_0x22ebca[_0xfdcc('0x47')](_0xfdcc('0x8e'));_0x22ebca[_0xfdcc('0x47')](_0xfdcc('0x8f'));_0x22ebca['field'](_0xfdcc('0x90'));_0x22ebca[_0xfdcc('0x47')](_0xfdcc('0x91'));_0x22ebca[_0xfdcc('0x47')](_0xfdcc('0x92'));_0x22ebca[_0xfdcc('0x47')]('c.ListId');_0x22ebca[_0xfdcc('0x47')](_0xfdcc('0x93'));_0x22ebca['field']('c.deletedAt');_0x22ebca[_0xfdcc('0x47')](_0xfdcc('0x94'));_0x22ebca[_0xfdcc('0x47')](_0xfdcc('0x95'),_0xfdcc('0x96'));}if(_0x28fc8a[_0xfdcc('0x21')])_0x22ebca[_0xfdcc('0x21')](_0x28fc8a[_0xfdcc('0x21')]);if(_0x28fc8a[_0xfdcc('0x24')])_0x22ebca[_0xfdcc('0x24')](_0x28fc8a[_0xfdcc('0x24')]);return db[_0xfdcc('0x89')][_0xfdcc('0x3f')](_0x22ebca['toString'](),_0x3970e8);});})[_0xfdcc('0x2b')](function(_0x4e0c16){_0x4e0c16['forEach'](function(_0x4db7ce){if(_0x4db7ce['TagIds']){_0x4db7ce[_0xfdcc('0x97')]=[];_0x4db7ce[_0xfdcc('0x96')][_0xfdcc('0x5a')](',')['forEach'](function(_0x2d2b5c){_0x4db7ce[_0xfdcc('0x97')][_0xfdcc('0x37')](_0x18c22c[_0x2d2b5c]);});}delete _0x4db7ce[_0xfdcc('0x96')];});_0x19fd34['rows']=_0x4e0c16;return _0x19fd34;})[_0xfdcc('0x2b')](respondWithFilteredResult(_0x2e938e,_0x28fc8a));})[_0xfdcc('0x98')](handleError(_0x2e938e,null));};exports['destroy']=function(_0x24c8aa,_0x210f63){return db[_0xfdcc('0x8c')][_0xfdcc('0x99')]({'where':{'id':_0x24c8aa['params']['id']}})[_0xfdcc('0x2b')](handleEntityNotFound(_0x210f63,null))[_0xfdcc('0x2b')](removeEntity(_0x210f63,null))[_0xfdcc('0x98')](handleError(_0x210f63,null));};exports[_0xfdcc('0x32')]=function(_0x27975c,_0x57b3ff){return db[_0xfdcc('0x8c')][_0xfdcc('0x32')]()[_0xfdcc('0x2b')](function(_0x522ade){delete _0x522ade[_0xfdcc('0x9a')];for(var _0x4e29e2=0x0;_0x4e29e2{}\s\\|]/g,'-');_0x590580(null,util[_0xb51a('0x24')](_0xb51a('0x25'),path[_0xb51a('0x26')](_0x844fcf[_0xb51a('0x22')],path[_0xb51a('0x27')](_0x844fcf['originalname'])),Date[_0xb51a('0x28')](),path[_0xb51a('0x27')](_0x844fcf[_0xb51a('0x22')])));}})});router[_0xb51a('0x18')](_0xb51a('0x29'),upload['single'](_0xb51a('0x2a')),controller[_0xb51a('0x2b')]);var upload=multer({'storage':multer[_0xb51a('0x1e')]({'destination':function(_0x4386d5,_0xf14c8b,_0x13ba5a){_0x13ba5a(null,path['join'](config[_0xb51a('0x20')],_0xb51a('0x21')));},'filename':function(_0x11b8d6,_0x17f1bf,_0x6b5da1){_0x17f1bf[_0xb51a('0x22')]=_0x17f1bf[_0xb51a('0x22')][_0xb51a('0x23')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x6b5da1(null,util[_0xb51a('0x24')](_0xb51a('0x25'),path[_0xb51a('0x26')](_0x17f1bf[_0xb51a('0x22')],path[_0xb51a('0x27')](_0x17f1bf['originalname'])),Date['now'](),path[_0xb51a('0x27')](_0x17f1bf[_0xb51a('0x22')])));}})});router[_0xb51a('0x18')]('/upload',upload['single'](_0xb51a('0x2a')),controller[_0xb51a('0x2c')]);router[_0xb51a('0x18')](_0xb51a('0x2d'),auth[_0xb51a('0x9')](),controller[_0xb51a('0x2e')]);router[_0xb51a('0x2f')](_0xb51a('0xb'),auth[_0xb51a('0x9')](),controller[_0xb51a('0x30')]);router[_0xb51a('0x31')](_0xb51a('0xb'),auth['isAuthenticated'](),controller[_0xb51a('0x32')]);module[_0xb51a('0x33')]=router; \ No newline at end of file +var _0x1d30=['exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmContact.controller','get','isAuthenticated','index','describe','/:id','show','/:id/tags','/:id/hoppers','getHoppers','/:id/hopper_finals','getHopperFinals','/:id/jscripty_sessions','getJourney','/merge','merge','post','create','/create_many','bulkCreate','setTags','join','root','originalname','format','%s-%s%s','basename','extname','/csv','single','file','uploadCsv','server/files/tmp','replace','now','/upload','upload','put','update','delete'];(function(_0xdbe48d,_0x225ec3){var _0x2afeab=function(_0x3826d8){while(--_0x3826d8){_0xdbe48d['push'](_0xdbe48d['shift']());}};_0x2afeab(++_0x225ec3);}(_0x1d30,0x191));var _0x01d3=function(_0x161356,_0x3b41a5){_0x161356=_0x161356-0x0;var _0x3e8e6d=_0x1d30[_0x161356];return _0x3e8e6d;};'use strict';var multer=require(_0x01d3('0x0'));var util=require(_0x01d3('0x1'));var path=require(_0x01d3('0x2'));var timeout=require(_0x01d3('0x3'));var express=require(_0x01d3('0x4'));var router=express['Router']();var fs_extra=require(_0x01d3('0x5'));var auth=require(_0x01d3('0x6'));var interaction=require(_0x01d3('0x7'));var config=require(_0x01d3('0x8'));var controller=require(_0x01d3('0x9'));router[_0x01d3('0xa')]('/',auth[_0x01d3('0xb')](),controller[_0x01d3('0xc')]);router[_0x01d3('0xa')]('/describe',auth[_0x01d3('0xb')](),controller[_0x01d3('0xd')]);router[_0x01d3('0xa')](_0x01d3('0xe'),auth[_0x01d3('0xb')](),controller[_0x01d3('0xf')]);router[_0x01d3('0xa')](_0x01d3('0x10'),auth[_0x01d3('0xb')](),controller['getTags']);router[_0x01d3('0xa')](_0x01d3('0x11'),auth[_0x01d3('0xb')](),controller[_0x01d3('0x12')]);router[_0x01d3('0xa')]('/:id/hopper_histories',auth[_0x01d3('0xb')](),controller['getHopperHistories']);router[_0x01d3('0xa')](_0x01d3('0x13'),auth['isAuthenticated'](),controller[_0x01d3('0x14')]);router[_0x01d3('0xa')](_0x01d3('0x15'),auth[_0x01d3('0xb')](),controller['getJscriptySessions']);router[_0x01d3('0xa')]('/:id/journey',auth[_0x01d3('0xb')](),controller[_0x01d3('0x16')]);router['post'](_0x01d3('0x17'),auth[_0x01d3('0xb')](),controller[_0x01d3('0x18')]);router[_0x01d3('0x19')]('/',auth[_0x01d3('0xb')](),controller[_0x01d3('0x1a')]);router[_0x01d3('0x19')](_0x01d3('0x1b'),auth[_0x01d3('0xb')](),controller[_0x01d3('0x1c')]);router[_0x01d3('0x19')](_0x01d3('0x10'),auth[_0x01d3('0xb')](),controller[_0x01d3('0x1d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2ee3f0,_0x569741,_0x51d032){_0x51d032(null,path[_0x01d3('0x1e')](config[_0x01d3('0x1f')],'server/files/tmp'));},'filename':function(_0x10cbf2,_0x3575eb,_0x5c7ef0){_0x3575eb['originalname']=_0x3575eb[_0x01d3('0x20')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x5c7ef0(null,util[_0x01d3('0x21')](_0x01d3('0x22'),path[_0x01d3('0x23')](_0x3575eb[_0x01d3('0x20')],path[_0x01d3('0x24')](_0x3575eb[_0x01d3('0x20')])),Date['now'](),path[_0x01d3('0x24')](_0x3575eb[_0x01d3('0x20')])));}})});router[_0x01d3('0x19')](_0x01d3('0x25'),upload[_0x01d3('0x26')](_0x01d3('0x27')),controller[_0x01d3('0x28')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2db641,_0x3d0913,_0x111c4f){_0x111c4f(null,path[_0x01d3('0x1e')](config[_0x01d3('0x1f')],_0x01d3('0x29')));},'filename':function(_0x56650e,_0x1cad4b,_0x51f3fe){_0x1cad4b[_0x01d3('0x20')]=_0x1cad4b[_0x01d3('0x20')][_0x01d3('0x2a')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x51f3fe(null,util[_0x01d3('0x21')]('%s-%s%s',path['basename'](_0x1cad4b[_0x01d3('0x20')],path[_0x01d3('0x24')](_0x1cad4b[_0x01d3('0x20')])),Date[_0x01d3('0x2b')](),path[_0x01d3('0x24')](_0x1cad4b[_0x01d3('0x20')])));}})});router[_0x01d3('0x19')](_0x01d3('0x2c'),upload[_0x01d3('0x26')](_0x01d3('0x27')),controller[_0x01d3('0x2d')]);router[_0x01d3('0x19')]('/upload/:id',auth[_0x01d3('0xb')](),controller['import']);router[_0x01d3('0x2e')](_0x01d3('0xe'),auth['isAuthenticated'](),controller[_0x01d3('0x2f')]);router[_0x01d3('0x30')](_0x01d3('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0x01d3('0x31')]=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index bad965c..b7f6058 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 _0xdde9=['parse','values','isArray','setDataValue','BOOLEAN','ENUM','voice','sequelize','VIRTUAL','getDataValue','alias','STRING','name','TEXT','long','type','select'];(function(_0x1cd962,_0x669f7){var _0x46d68d=function(_0x1fbd83){while(--_0x1fbd83){_0x1cd962['push'](_0x1cd962['shift']());}};_0x46d68d(++_0x669f7);}(_0xdde9,0x17d));var _0x9dde=function(_0x75a5,_0x38165a){_0x75a5=_0x75a5-0x0;var _0x111343=_0xdde9[_0x75a5];return _0x111343;};'use strict';var Sequelize=require(_0x9dde('0x0'));var _=require('lodash');module['exports']={'name':{'type':Sequelize[_0x9dde('0x1')],'get':function(_0x927325){return this[_0x9dde('0x2')](_0x9dde('0x3'));}},'alias':{'type':Sequelize[_0x9dde('0x4')],'allowNull':![],'set':function(_0x3a5d4c){this['setDataValue'](_0x9dde('0x3'),_0x3a5d4c?_0x3a5d4c:this[_0x9dde('0x2')](_0x9dde('0x5')));}},'type':{'type':Sequelize[_0x9dde('0x4')],'allowNull':![]},'values':{'type':Sequelize[_0x9dde('0x6')](_0x9dde('0x7')),'get':function(){if(this[_0x9dde('0x2')](_0x9dde('0x8'))===_0x9dde('0x9')){return JSON[_0x9dde('0xa')](this[_0x9dde('0x2')](_0x9dde('0xb')));}else{return this[_0x9dde('0x2')](_0x9dde('0xb'));}},'set':function(_0x1874eb){if(Array[_0x9dde('0xc')](_0x1874eb)){this[_0x9dde('0xd')](_0x9dde('0xb'),JSON['stringify'](_0x1874eb));}else{this['setDataValue'](_0x9dde('0xb'),_0x1874eb);}}},'required':{'type':Sequelize[_0x9dde('0xe')],'defaultValue':![]},'clickToAction':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'actionType':{'type':Sequelize[_0x9dde('0xf')](_0x9dde('0x10'))}}; \ No newline at end of file +var _0x9f38=['setDataValue','name','STRING','TEXT','long','type','select','parse','values','isArray','stringify','BOOLEAN','ENUM','voice','sequelize','lodash','exports','getDataValue','alias'];(function(_0x9a7ea6,_0x1807a2){var _0x1c2040=function(_0x55b7ec){while(--_0x55b7ec){_0x9a7ea6['push'](_0x9a7ea6['shift']());}};_0x1c2040(++_0x1807a2);}(_0x9f38,0x105));var _0x89f3=function(_0x9d2f1e,_0x55d3d3){_0x9d2f1e=_0x9d2f1e-0x0;var _0x2886a4=_0x9f38[_0x9d2f1e];return _0x2886a4;};'use strict';var Sequelize=require(_0x89f3('0x0'));var _=require(_0x89f3('0x1'));module[_0x89f3('0x2')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x51262a){return this[_0x89f3('0x3')](_0x89f3('0x4'));}},'alias':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x5c64d3){this[_0x89f3('0x5')](_0x89f3('0x4'),_0x5c64d3?_0x5c64d3:this['getDataValue'](_0x89f3('0x6')));}},'type':{'type':Sequelize[_0x89f3('0x7')],'allowNull':![]},'values':{'type':Sequelize[_0x89f3('0x8')](_0x89f3('0x9')),'get':function(){if(this[_0x89f3('0x3')](_0x89f3('0xa'))===_0x89f3('0xb')){return JSON[_0x89f3('0xc')](this[_0x89f3('0x3')]('values'));}else{return this[_0x89f3('0x3')](_0x89f3('0xd'));}},'set':function(_0x4043da){if(Array[_0x89f3('0xe')](_0x4043da)){this[_0x89f3('0x5')](_0x89f3('0xd'),JSON[_0x89f3('0xf')](_0x4043da));}else{this[_0x89f3('0x5')](_0x89f3('0xd'),_0x4043da);}}},'required':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'clickToAction':{'type':Sequelize[_0x89f3('0x10')],'defaultValue':![]},'actionType':{'type':Sequelize[_0x89f3('0x11')](_0x89f3('0x12'))}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index a6b5a9b..1ca05a6 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 _0xbc2b=['body','destroy','create','sequelize','transaction','TEXT','Sequelize','number','INTEGER','switch','BOOLEAN','defaultValue','addColumn','cf_%d','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','then','error','stack','name','send','index','map','CmCustomField','fieldName','type','key','differenceBy','keys','query','filters','intersection','model','attributes','fields','nolimit','sort','where','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','length','find','update'];(function(_0xae7c2f,_0xf31e04){var _0x5d7001=function(_0x4eeadb){while(--_0x4eeadb){_0xae7c2f['push'](_0xae7c2f['shift']());}};_0x5d7001(++_0xf31e04);}(_0xbc2b,0x1b2));var _0xbbc2=function(_0x56f591,_0xd3e156){_0x56f591=_0x56f591-0x0;var _0x486bb7=_0xbc2b[_0x56f591];return _0x486bb7;};'use strict';var emlformat=require(_0xbbc2('0x0'));var rimraf=require(_0xbbc2('0x1'));var zipdir=require(_0xbbc2('0x2'));var jsonpatch=require(_0xbbc2('0x3'));var rp=require(_0xbbc2('0x4'));var moment=require(_0xbbc2('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xbbc2('0x6'));var util=require('util');var path=require(_0xbbc2('0x7'));var sox=require(_0xbbc2('0x8'));var csv=require(_0xbbc2('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbbc2('0xa'));var _=require(_0xbbc2('0xb'));var squel=require(_0xbbc2('0xc'));var crypto=require(_0xbbc2('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xbbc2('0xe'));var toCsv=require(_0xbbc2('0x9'));var querystring=require(_0xbbc2('0xf'));var Papa=require(_0xbbc2('0x10'));var Redis=require(_0xbbc2('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xbbc2('0x12'));var as=require(_0xbbc2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbbc2('0x14'))('api');var utils=require(_0xbbc2('0x15'));var config=require(_0xbbc2('0x16'));var licenseUtil=require(_0xbbc2('0x17'));var db=require(_0xbbc2('0x18'))['db'];function respondWithStatusCode(_0xb0ff64,_0x312530){_0x312530=_0x312530||0xcc;return function(_0xb49711){if(_0xb49711){return _0xb0ff64[_0xbbc2('0x19')](_0x312530);}return _0xb0ff64[_0xbbc2('0x1a')](_0x312530)[_0xbbc2('0x1b')]();};}function respondWithResult(_0x2140d6,_0x2a95cf){_0x2a95cf=_0x2a95cf||0xc8;return function(_0xf4b413){if(_0xf4b413){return _0x2140d6[_0xbbc2('0x1a')](_0x2a95cf)[_0xbbc2('0x1c')](_0xf4b413);}};}function respondWithFilteredResult(_0x5eb080,_0x29c32f){return function(_0x3f0373){if(_0x3f0373){var _0x206bcd=typeof _0x29c32f[_0xbbc2('0x1d')]===_0xbbc2('0x1e')&&typeof _0x29c32f[_0xbbc2('0x1f')]===_0xbbc2('0x1e');var _0x4f98ae=_0x3f0373[_0xbbc2('0x20')];var _0x4565b9=_0x206bcd?0x0:_0x29c32f[_0xbbc2('0x1d')];var _0x62dd07=_0x206bcd?_0x3f0373[_0xbbc2('0x20')]:_0x29c32f[_0xbbc2('0x1d')]+_0x29c32f[_0xbbc2('0x1f')];var _0x6b0799;if(_0x62dd07>=_0x4f98ae){_0x62dd07=_0x4f98ae;_0x6b0799=0xc8;}else{_0x6b0799=0xce;}_0x5eb080['status'](_0x6b0799);return _0x5eb080[_0xbbc2('0x21')]('Content-Range',_0x4565b9+'-'+_0x62dd07+'/'+_0x4f98ae)[_0xbbc2('0x1c')](_0x3f0373);}return null;};}function patchUpdates(_0x1383f3){return function(_0x17d6b8){try{jsonpatch[_0xbbc2('0x22')](_0x17d6b8,_0x1383f3,!![]);}catch(_0x5b7436){return BPromise[_0xbbc2('0x23')](_0x5b7436);}return _0x17d6b8['save']();};}function saveUpdates(_0xeead5d,_0x682b){return function(_0x28063a){if(_0x28063a){return _0x28063a['update'](_0xeead5d)[_0xbbc2('0x24')](function(_0x2a1972){return _0x2a1972;});}return null;};}function removeEntity(_0x1ac477,_0x46b14c){return function(_0x4eec87){if(_0x4eec87){return _0x4eec87['destroy']()['then'](function(){_0x1ac477[_0xbbc2('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0xf93786,_0x12c679){return function(_0x5bd990){if(!_0x5bd990){_0xf93786[_0xbbc2('0x19')](0x194);}return _0x5bd990;};}function handleError(_0x387e4e,_0x3c5c1f){_0x3c5c1f=_0x3c5c1f||0x1f4;return function(_0x1b7a89){logger[_0xbbc2('0x25')](_0x1b7a89[_0xbbc2('0x26')]);if(_0x1b7a89[_0xbbc2('0x27')]){delete _0x1b7a89['name'];}_0x387e4e[_0xbbc2('0x1a')](_0x3c5c1f)[_0xbbc2('0x28')](_0x1b7a89);};}exports[_0xbbc2('0x29')]=function(_0x6996ed,_0x36a6a2){var _0x1a3356={},_0x2a7569={},_0x1f48e6={'count':0x0,'rows':[]};var _0x177a13=_[_0xbbc2('0x2a')](db[_0xbbc2('0x2b')]['rawAttributes'],function(_0x52d4cf){return{'name':_0x52d4cf[_0xbbc2('0x2c')],'type':_0x52d4cf[_0xbbc2('0x2d')][_0xbbc2('0x2e')]};});_0x2a7569['model']=_[_0xbbc2('0x2f')](_['map'](_0x177a13,_0xbbc2('0x27')),['name']);_0x2a7569['query']=_[_0xbbc2('0x30')](_0x6996ed[_0xbbc2('0x31')]);_0x2a7569[_0xbbc2('0x32')]=_[_0xbbc2('0x33')](_0x2a7569[_0xbbc2('0x34')],_0x2a7569[_0xbbc2('0x31')]);_0x1a3356[_0xbbc2('0x35')]=_[_0xbbc2('0x33')](_0x2a7569['model'],qs[_0xbbc2('0x36')](_0x6996ed[_0xbbc2('0x31')][_0xbbc2('0x36')]));_0x1a3356[_0xbbc2('0x35')]=_0x1a3356[_0xbbc2('0x35')]['length']?_0x1a3356[_0xbbc2('0x35')]:_0x2a7569[_0xbbc2('0x34')];if(!_0x6996ed['query']['hasOwnProperty'](_0xbbc2('0x37'))){_0x1a3356[_0xbbc2('0x1f')]=qs[_0xbbc2('0x1f')](_0x6996ed[_0xbbc2('0x31')][_0xbbc2('0x1f')]);_0x1a3356[_0xbbc2('0x1d')]=qs[_0xbbc2('0x1d')](_0x6996ed[_0xbbc2('0x31')][_0xbbc2('0x1d')]);}_0x1a3356['order']=qs[_0xbbc2('0x38')](_0x6996ed['query'][_0xbbc2('0x38')]);_0x1a3356[_0xbbc2('0x39')]=qs[_0xbbc2('0x32')](_['pick'](_0x6996ed['query'],_0x2a7569[_0xbbc2('0x32')]),_0x177a13);if(_0x6996ed['query']['filter']){_0x1a3356[_0xbbc2('0x39')]=_['merge'](_0x1a3356[_0xbbc2('0x39')],{'$or':_[_0xbbc2('0x2a')](_0x177a13,function(_0x22eebd){if(_0x22eebd['type']!==_0xbbc2('0x3a')){var _0x35dcb0={};_0x35dcb0[_0x22eebd[_0xbbc2('0x27')]]={'$like':'%'+_0x6996ed[_0xbbc2('0x31')]['filter']+'%'};return _0x35dcb0;}})});}_0x1a3356=_[_0xbbc2('0x3b')]({},_0x1a3356,_0x6996ed['options']);var _0x49f433={'where':_0x1a3356[_0xbbc2('0x39')]};return db['CmCustomField'][_0xbbc2('0x20')](_0x49f433)['then'](function(_0x32c5ea){_0x1f48e6[_0xbbc2('0x20')]=_0x32c5ea;if(_0x6996ed[_0xbbc2('0x31')][_0xbbc2('0x3c')]){_0x1a3356[_0xbbc2('0x3d')]=[{'all':!![]}];}return db['CmCustomField'][_0xbbc2('0x3e')](_0x1a3356);})[_0xbbc2('0x24')](function(_0xa752de){_0x1f48e6[_0xbbc2('0x3f')]=_0xa752de;return _0x1f48e6;})[_0xbbc2('0x24')](respondWithFilteredResult(_0x36a6a2,_0x1a3356))[_0xbbc2('0x40')](handleError(_0x36a6a2,null));};exports[_0xbbc2('0x41')]=function(_0x5c6761,_0x47c369){var _0x5f48be={'raw':!![],'where':{'id':_0x5c6761[_0xbbc2('0x42')]['id']}},_0x54ded1={};_0x54ded1[_0xbbc2('0x34')]=_[_0xbbc2('0x30')](db[_0xbbc2('0x2b')]['rawAttributes']);_0x54ded1['query']=_['keys'](_0x5c6761[_0xbbc2('0x31')]);_0x54ded1['filters']=_[_0xbbc2('0x33')](_0x54ded1[_0xbbc2('0x34')],_0x54ded1['query']);_0x5f48be[_0xbbc2('0x35')]=_[_0xbbc2('0x33')](_0x54ded1[_0xbbc2('0x34')],qs[_0xbbc2('0x36')](_0x5c6761[_0xbbc2('0x31')]['fields']));_0x5f48be[_0xbbc2('0x35')]=_0x5f48be[_0xbbc2('0x35')][_0xbbc2('0x43')]?_0x5f48be['attributes']:_0x54ded1[_0xbbc2('0x34')];if(_0x5c6761[_0xbbc2('0x31')][_0xbbc2('0x3c')]){_0x5f48be[_0xbbc2('0x3d')]=[{'all':!![]}];}_0x5f48be=_['merge']({},_0x5f48be,_0x5c6761['options']);return db[_0xbbc2('0x2b')][_0xbbc2('0x44')](_0x5f48be)[_0xbbc2('0x24')](handleEntityNotFound(_0x47c369,null))[_0xbbc2('0x24')](respondWithResult(_0x47c369,null))[_0xbbc2('0x40')](handleError(_0x47c369,null));};exports[_0xbbc2('0x45')]=function(_0x3ac9e4,_0x1bc3bb){if(_0x3ac9e4[_0xbbc2('0x46')]['id']){delete _0x3ac9e4['body']['id'];}return db[_0xbbc2('0x2b')][_0xbbc2('0x44')]({'where':{'id':_0x3ac9e4[_0xbbc2('0x42')]['id']}})['then'](handleEntityNotFound(_0x1bc3bb,null))['then'](saveUpdates(_0x3ac9e4['body'],null))['then'](respondWithResult(_0x1bc3bb,null))['catch'](handleError(_0x1bc3bb,null));};exports[_0xbbc2('0x47')]=function(_0x476c9b,_0x5b98c3){return db[_0xbbc2('0x2b')][_0xbbc2('0x44')]({'where':{'id':_0x476c9b[_0xbbc2('0x42')]['id']}})[_0xbbc2('0x24')](handleEntityNotFound(_0x5b98c3,null))['then'](removeEntity(_0x5b98c3,null))[_0xbbc2('0x40')](handleError(_0x5b98c3,null));};exports[_0xbbc2('0x48')]=function(_0x3cfd6a,_0x2078ca){var _0x4fe366;return db[_0xbbc2('0x49')][_0xbbc2('0x4a')](function(_0x2f64d3){return db[_0xbbc2('0x2b')]['create'](_0x3cfd6a[_0xbbc2('0x46')],{'transaction':_0x2f64d3})['then'](function(_0x296c49){_0x4fe366=_0x296c49;var _0x1d959d={'type':db['Sequelize'][_0xbbc2('0x4b')],'transaction':_0x2f64d3};switch(_0x3cfd6a[_0xbbc2('0x46')][_0xbbc2('0x2d')]){case'text':_0x1d959d[_0xbbc2('0x2d')]=db[_0xbbc2('0x4c')][_0xbbc2('0x4b')];break;case _0xbbc2('0x4d'):_0x1d959d[_0xbbc2('0x2d')]=db['Sequelize'][_0xbbc2('0x4e')];break;case _0xbbc2('0x4f'):_0x1d959d['type']=db[_0xbbc2('0x4c')][_0xbbc2('0x50')];_0x1d959d[_0xbbc2('0x51')]=![];break;default:}return db[_0xbbc2('0x49')]['queryInterface'][_0xbbc2('0x52')]('cm_contacts',util['format'](_0xbbc2('0x53'),_0x4fe366['id']),_0x1d959d);})[_0xbbc2('0x24')](function(){return _0x4fe366;});})[_0xbbc2('0x24')](respondWithResult(_0x2078ca,0xc9))['catch'](handleError(_0x2078ca,null));}; \ No newline at end of file +var _0xd84f=['lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','error','stack','name','index','map','CmCustomField','rawAttributes','key','model','differenceBy','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','type','merge','options','then','include','findAll','catch','params','keys','find','body','sequelize','transaction','Sequelize','TEXT','text','INTEGER','switch','BOOLEAN','defaultValue','addColumn','cm_contacts','format','cf_%d','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra'];(function(_0x3301b1,_0x4f92e2){var _0x744174=function(_0x5d2929){while(--_0x5d2929){_0x3301b1['push'](_0x3301b1['shift']());}};_0x744174(++_0x4f92e2);}(_0xd84f,0x199));var _0xfd84=function(_0x106814,_0x44b5bb){_0x106814=_0x106814-0x0;var _0x47b887=_0xd84f[_0x106814];return _0x47b887;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfd84('0x0'));var zipdir=require(_0xfd84('0x1'));var jsonpatch=require(_0xfd84('0x2'));var rp=require('request-promise');var moment=require(_0xfd84('0x3'));var BPromise=require(_0xfd84('0x4'));var Mustache=require(_0xfd84('0x5'));var util=require('util');var path=require(_0xfd84('0x6'));var sox=require(_0xfd84('0x7'));var csv=require(_0xfd84('0x8'));var ejs=require(_0xfd84('0x9'));var fs=require('fs');var fs_extra=require(_0xfd84('0xa'));var _=require(_0xfd84('0xb'));var squel=require(_0xfd84('0xc'));var crypto=require(_0xfd84('0xd'));var jsforce=require(_0xfd84('0xe'));var deskjs=require(_0xfd84('0xf'));var toCsv=require(_0xfd84('0x8'));var querystring=require(_0xfd84('0x10'));var Papa=require(_0xfd84('0x11'));var Redis=require('ioredis');var authService=require(_0xfd84('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xfd84('0x13'));var hardwareService=require(_0xfd84('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xfd84('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xfd84('0x16'));var db=require(_0xfd84('0x17'))['db'];function respondWithStatusCode(_0x565073,_0x566431){_0x566431=_0x566431||0xcc;return function(_0x3982f8){if(_0x3982f8){return _0x565073[_0xfd84('0x18')](_0x566431);}return _0x565073[_0xfd84('0x19')](_0x566431)[_0xfd84('0x1a')]();};}function respondWithResult(_0x140ca1,_0x10e68f){_0x10e68f=_0x10e68f||0xc8;return function(_0x5ae6b4){if(_0x5ae6b4){return _0x140ca1[_0xfd84('0x19')](_0x10e68f)[_0xfd84('0x1b')](_0x5ae6b4);}};}function respondWithFilteredResult(_0x1718b3,_0x1dfa9d){return function(_0x300b24){if(_0x300b24){var _0xee93df=typeof _0x1dfa9d[_0xfd84('0x1c')]===_0xfd84('0x1d')&&typeof _0x1dfa9d[_0xfd84('0x1e')]===_0xfd84('0x1d');var _0x11a431=_0x300b24['count'];var _0x44ffcc=_0xee93df?0x0:_0x1dfa9d[_0xfd84('0x1c')];var _0x250a3a=_0xee93df?_0x300b24[_0xfd84('0x1f')]:_0x1dfa9d['offset']+_0x1dfa9d['limit'];var _0x2733a1;if(_0x250a3a>=_0x11a431){_0x250a3a=_0x11a431;_0x2733a1=0xc8;}else{_0x2733a1=0xce;}_0x1718b3[_0xfd84('0x19')](_0x2733a1);return _0x1718b3[_0xfd84('0x20')](_0xfd84('0x21'),_0x44ffcc+'-'+_0x250a3a+'/'+_0x11a431)[_0xfd84('0x1b')](_0x300b24);}return null;};}function patchUpdates(_0x132ae0){return function(_0x591a68){try{jsonpatch[_0xfd84('0x22')](_0x591a68,_0x132ae0,!![]);}catch(_0x377f61){return BPromise[_0xfd84('0x23')](_0x377f61);}return _0x591a68[_0xfd84('0x24')]();};}function saveUpdates(_0x2cf206,_0x577637){return function(_0x3cb874){if(_0x3cb874){return _0x3cb874[_0xfd84('0x25')](_0x2cf206)['then'](function(_0x26072c){return _0x26072c;});}return null;};}function removeEntity(_0xfa0eee,_0x419109){return function(_0x45346c){if(_0x45346c){return _0x45346c[_0xfd84('0x26')]()['then'](function(){_0xfa0eee[_0xfd84('0x19')](0xcc)[_0xfd84('0x1a')]();});}};}function handleEntityNotFound(_0x2dcda4,_0x273f5c){return function(_0x5d7832){if(!_0x5d7832){_0x2dcda4['sendStatus'](0x194);}return _0x5d7832;};}function handleError(_0x11f6bf,_0x8ce688){_0x8ce688=_0x8ce688||0x1f4;return function(_0x4ba6b4){logger[_0xfd84('0x27')](_0x4ba6b4[_0xfd84('0x28')]);if(_0x4ba6b4[_0xfd84('0x29')]){delete _0x4ba6b4[_0xfd84('0x29')];}_0x11f6bf[_0xfd84('0x19')](_0x8ce688)['send'](_0x4ba6b4);};}exports[_0xfd84('0x2a')]=function(_0x552c5b,_0x51f8b5){var _0x471515={},_0x48d75b={},_0x3594b4={'count':0x0,'rows':[]};var _0xa30e93=_[_0xfd84('0x2b')](db[_0xfd84('0x2c')][_0xfd84('0x2d')],function(_0x39bacd){return{'name':_0x39bacd['fieldName'],'type':_0x39bacd['type'][_0xfd84('0x2e')]};});_0x48d75b[_0xfd84('0x2f')]=_[_0xfd84('0x30')](_['map'](_0xa30e93,_0xfd84('0x29')),['name']);_0x48d75b[_0xfd84('0x31')]=_['keys'](_0x552c5b[_0xfd84('0x31')]);_0x48d75b[_0xfd84('0x32')]=_['intersection'](_0x48d75b[_0xfd84('0x2f')],_0x48d75b[_0xfd84('0x31')]);_0x471515[_0xfd84('0x33')]=_[_0xfd84('0x34')](_0x48d75b['model'],qs[_0xfd84('0x35')](_0x552c5b[_0xfd84('0x31')][_0xfd84('0x35')]));_0x471515[_0xfd84('0x33')]=_0x471515[_0xfd84('0x33')][_0xfd84('0x36')]?_0x471515[_0xfd84('0x33')]:_0x48d75b[_0xfd84('0x2f')];if(!_0x552c5b[_0xfd84('0x31')][_0xfd84('0x37')](_0xfd84('0x38'))){_0x471515['limit']=qs[_0xfd84('0x1e')](_0x552c5b[_0xfd84('0x31')][_0xfd84('0x1e')]);_0x471515[_0xfd84('0x1c')]=qs[_0xfd84('0x1c')](_0x552c5b[_0xfd84('0x31')][_0xfd84('0x1c')]);}_0x471515[_0xfd84('0x39')]=qs[_0xfd84('0x3a')](_0x552c5b[_0xfd84('0x31')][_0xfd84('0x3a')]);_0x471515['where']=qs[_0xfd84('0x32')](_['pick'](_0x552c5b[_0xfd84('0x31')],_0x48d75b['filters']),_0xa30e93);if(_0x552c5b[_0xfd84('0x31')]['filter']){_0x471515['where']=_['merge'](_0x471515[_0xfd84('0x3b')],{'$or':_[_0xfd84('0x2b')](_0xa30e93,function(_0x1031da){if(_0x1031da[_0xfd84('0x3c')]!=='VIRTUAL'){var _0x21ced3={};_0x21ced3[_0x1031da[_0xfd84('0x29')]]={'$like':'%'+_0x552c5b[_0xfd84('0x31')]['filter']+'%'};return _0x21ced3;}})});}_0x471515=_[_0xfd84('0x3d')]({},_0x471515,_0x552c5b[_0xfd84('0x3e')]);var _0x339f77={'where':_0x471515[_0xfd84('0x3b')]};return db['CmCustomField'][_0xfd84('0x1f')](_0x339f77)[_0xfd84('0x3f')](function(_0x1c2f09){_0x3594b4[_0xfd84('0x1f')]=_0x1c2f09;if(_0x552c5b[_0xfd84('0x31')]['includeAll']){_0x471515[_0xfd84('0x40')]=[{'all':!![]}];}return db[_0xfd84('0x2c')][_0xfd84('0x41')](_0x471515);})[_0xfd84('0x3f')](function(_0x51b70b){_0x3594b4['rows']=_0x51b70b;return _0x3594b4;})[_0xfd84('0x3f')](respondWithFilteredResult(_0x51f8b5,_0x471515))[_0xfd84('0x42')](handleError(_0x51f8b5,null));};exports['show']=function(_0x1a45f4,_0x484735){var _0x119736={'raw':!![],'where':{'id':_0x1a45f4[_0xfd84('0x43')]['id']}},_0x41b28d={};_0x41b28d[_0xfd84('0x2f')]=_[_0xfd84('0x44')](db[_0xfd84('0x2c')][_0xfd84('0x2d')]);_0x41b28d[_0xfd84('0x31')]=_['keys'](_0x1a45f4['query']);_0x41b28d[_0xfd84('0x32')]=_[_0xfd84('0x34')](_0x41b28d[_0xfd84('0x2f')],_0x41b28d[_0xfd84('0x31')]);_0x119736[_0xfd84('0x33')]=_[_0xfd84('0x34')](_0x41b28d['model'],qs[_0xfd84('0x35')](_0x1a45f4[_0xfd84('0x31')]['fields']));_0x119736['attributes']=_0x119736[_0xfd84('0x33')][_0xfd84('0x36')]?_0x119736['attributes']:_0x41b28d[_0xfd84('0x2f')];if(_0x1a45f4[_0xfd84('0x31')]['includeAll']){_0x119736[_0xfd84('0x40')]=[{'all':!![]}];}_0x119736=_['merge']({},_0x119736,_0x1a45f4['options']);return db[_0xfd84('0x2c')][_0xfd84('0x45')](_0x119736)['then'](handleEntityNotFound(_0x484735,null))[_0xfd84('0x3f')](respondWithResult(_0x484735,null))[_0xfd84('0x42')](handleError(_0x484735,null));};exports['update']=function(_0x55815f,_0x396aec){if(_0x55815f['body']['id']){delete _0x55815f[_0xfd84('0x46')]['id'];}return db[_0xfd84('0x2c')]['find']({'where':{'id':_0x55815f[_0xfd84('0x43')]['id']}})[_0xfd84('0x3f')](handleEntityNotFound(_0x396aec,null))['then'](saveUpdates(_0x55815f['body'],null))['then'](respondWithResult(_0x396aec,null))['catch'](handleError(_0x396aec,null));};exports['destroy']=function(_0x47d1cc,_0x5615f3){return db[_0xfd84('0x2c')][_0xfd84('0x45')]({'where':{'id':_0x47d1cc['params']['id']}})[_0xfd84('0x3f')](handleEntityNotFound(_0x5615f3,null))['then'](removeEntity(_0x5615f3,null))[_0xfd84('0x42')](handleError(_0x5615f3,null));};exports['create']=function(_0x1ef8fc,_0x495647){var _0x5c1844;return db[_0xfd84('0x47')][_0xfd84('0x48')](function(_0x2a29e5){return db[_0xfd84('0x2c')]['create'](_0x1ef8fc[_0xfd84('0x46')],{'transaction':_0x2a29e5})['then'](function(_0x23d1de){_0x5c1844=_0x23d1de;var _0x11057a={'type':db[_0xfd84('0x49')][_0xfd84('0x4a')],'transaction':_0x2a29e5};switch(_0x1ef8fc[_0xfd84('0x46')]['type']){case _0xfd84('0x4b'):_0x11057a[_0xfd84('0x3c')]=db[_0xfd84('0x49')][_0xfd84('0x4a')];break;case'number':_0x11057a[_0xfd84('0x3c')]=db[_0xfd84('0x49')][_0xfd84('0x4c')];break;case _0xfd84('0x4d'):_0x11057a[_0xfd84('0x3c')]=db[_0xfd84('0x49')][_0xfd84('0x4e')];_0x11057a[_0xfd84('0x4f')]=![];break;default:}return db[_0xfd84('0x47')]['queryInterface'][_0xfd84('0x50')](_0xfd84('0x51'),util[_0xfd84('0x52')](_0xfd84('0x53'),_0x5c1844['id']),_0x11057a);})[_0xfd84('0x3f')](function(){return _0x5c1844;});})[_0xfd84('0x3f')](respondWithResult(_0x495647,0xc9))['catch'](handleError(_0x495647,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index b3c0aef..501431e 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 _0x22dd=['define','cm_custom_fields','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x284506,_0x191316){var _0x1e9ee5=function(_0xe7eaa){while(--_0xe7eaa){_0x284506['push'](_0x284506['shift']());}};_0x1e9ee5(++_0x191316);}(_0x22dd,0x188));var _0xd22d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x22dd[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd22d('0x0'));var util=require('util');var logger=require(_0xd22d('0x1'))(_0xd22d('0x2'));var moment=require('moment');var BPromise=require(_0xd22d('0x3'));var rp=require(_0xd22d('0x4'));var fs=require('fs');var path=require(_0xd22d('0x5'));var rimraf=require(_0xd22d('0x6'));var config=require(_0xd22d('0x7'));var attributes=require('./cmCustomField.attributes');module['exports']=function(_0x133df8,_0xd3e9aa){return _0x133df8[_0xd22d('0x8')]('CmCustomField',attributes,{'tableName':_0xd22d('0x9'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9bd7=['define','CmCustomField','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./cmCustomField.attributes'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x9bd7,0x9e));var _0x79bd=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9bd7[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0x79bd('0x0'));var util=require(_0x79bd('0x1'));var logger=require(_0x79bd('0x2'))(_0x79bd('0x3'));var moment=require('moment');var BPromise=require(_0x79bd('0x4'));var rp=require(_0x79bd('0x5'));var fs=require('fs');var path=require(_0x79bd('0x6'));var rimraf=require(_0x79bd('0x7'));var config=require(_0x79bd('0x8'));var attributes=require(_0x79bd('0x9'));module['exports']=function(_0x26d6c2,_0x51d85c){return _0x26d6c2[_0x79bd('0xa')](_0x79bd('0xb'),attributes,{'tableName':'cm_custom_fields','paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.rpc.js b/server/api/cmCustomField/cmCustomField.rpc.js index 9470f05..35f9e59 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 _0x843d=['error','CmCustomField,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','debug','CmCustomField,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0xd0b415,_0x149675){var _0x2bdf2c=function(_0x59fbfa){while(--_0x59fbfa){_0xd0b415['push'](_0xd0b415['shift']());}};_0x2bdf2c(++_0x149675);}(_0x843d,0x1a7));var _0xd843=function(_0x1944f2,_0x59fb78){_0x1944f2=_0x1944f2-0x0;var _0x282a6b=_0x843d[_0x1944f2];return _0x282a6b;};'use strict';var _=require(_0xd843('0x0'));var util=require('util');var moment=require(_0xd843('0x1'));var BPromise=require(_0xd843('0x2'));var rs=require(_0xd843('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd843('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xd843('0x5'))(_0xd843('0x6'));var config=require(_0xd843('0x7'));var jayson=require(_0xd843('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x423949,_0x40fd23,_0x400398){return new BPromise(function(_0xd3d586,_0x45f3df){return client[_0xd843('0x9')](_0x423949,_0x400398)[_0xd843('0xa')](function(_0x30878c){logger['info']('CmCustomField,\x20%s,\x20%s',_0x40fd23,'request\x20sent');logger[_0xd843('0xb')](_0xd843('0xc'),_0x40fd23,_0xd843('0xd'),JSON['stringify'](_0x30878c));if(_0x30878c[_0xd843('0xe')]){if(_0x30878c[_0xd843('0xe')]['code']===0x1f4){logger['error'](_0xd843('0xf'),_0x40fd23,_0x30878c[_0xd843('0xe')][_0xd843('0x10')]);return _0x45f3df(_0x30878c['error'][_0xd843('0x10')]);}logger['error'](_0xd843('0xf'),_0x40fd23,_0x30878c[_0xd843('0xe')]['message']);return _0xd3d586(_0x30878c[_0xd843('0xe')][_0xd843('0x10')]);}else{logger['info'](_0xd843('0xf'),_0x40fd23,_0xd843('0xd'));_0xd3d586(_0x30878c[_0xd843('0x11')][_0xd843('0x10')]);}})[_0xd843('0x12')](function(_0x2a901b){logger[_0xd843('0xe')](_0xd843('0xf'),_0x40fd23,_0x2a901b);_0x45f3df(_0x2a901b);});});} \ No newline at end of file +var _0x067d=['../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','CmCustomField,\x20%s,\x20%s','request\x20sent','CmCustomField,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x308351,_0x184653){var _0x2def07=function(_0x2a30a4){while(--_0x2a30a4){_0x308351['push'](_0x308351['shift']());}};_0x2def07(++_0x184653);}(_0x067d,0xc0));var _0xd067=function(_0x33a47b,_0x25022a){_0x33a47b=_0x33a47b-0x0;var _0x3164d0=_0x067d[_0x33a47b];return _0x3164d0;};'use strict';var _=require(_0xd067('0x0'));var util=require(_0xd067('0x1'));var moment=require(_0xd067('0x2'));var BPromise=require(_0xd067('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd067('0x4'));var db=require(_0xd067('0x5'))['db'];var utils=require(_0xd067('0x6'));var logger=require(_0xd067('0x7'))(_0xd067('0x8'));var config=require('../../config/environment');var jayson=require(_0xd067('0x9'));var client=jayson[_0xd067('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0xccdf42,_0x4516b4,_0x50c12b){return new BPromise(function(_0x274285,_0x44b50b){return client[_0xd067('0xb')](_0xccdf42,_0x50c12b)[_0xd067('0xc')](function(_0x552524){logger[_0xd067('0xd')](_0xd067('0xe'),_0x4516b4,_0xd067('0xf'));logger['debug'](_0xd067('0x10'),_0x4516b4,_0xd067('0xf'),JSON['stringify'](_0x552524));if(_0x552524[_0xd067('0x11')]){if(_0x552524['error'][_0xd067('0x12')]===0x1f4){logger['error'](_0xd067('0xe'),_0x4516b4,_0x552524[_0xd067('0x11')][_0xd067('0x13')]);return _0x44b50b(_0x552524['error'][_0xd067('0x13')]);}logger['error'](_0xd067('0xe'),_0x4516b4,_0x552524[_0xd067('0x11')]['message']);return _0x274285(_0x552524[_0xd067('0x11')][_0xd067('0x13')]);}else{logger['info'](_0xd067('0xe'),_0x4516b4,_0xd067('0xf'));_0x274285(_0x552524[_0xd067('0x14')]['message']);}})[_0xd067('0x15')](function(_0x3e9881){logger[_0xd067('0x11')]('CmCustomField,\x20%s,\x20%s',_0x4516b4,_0x3e9881);_0x44b50b(_0x3e9881);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index 1e47f94..00dc68a 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 _0x0967=['destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','put'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0967,0x100));var _0x7096=function(_0x3b4e50,_0x49143f){_0x3b4e50=_0x3b4e50-0x0;var _0x3975fa=_0x0967[_0x3b4e50];return _0x3975fa;};'use strict';var multer=require(_0x7096('0x0'));var util=require('util');var path=require(_0x7096('0x1'));var timeout=require(_0x7096('0x2'));var express=require(_0x7096('0x3'));var router=express[_0x7096('0x4')]();var fs_extra=require(_0x7096('0x5'));var auth=require(_0x7096('0x6'));var interaction=require(_0x7096('0x7'));var config=require(_0x7096('0x8'));var controller=require('./cmCustomField.controller');router[_0x7096('0x9')]('/',auth[_0x7096('0xa')](),controller[_0x7096('0xb')]);router[_0x7096('0x9')](_0x7096('0xc'),auth[_0x7096('0xa')](),controller[_0x7096('0xd')]);router[_0x7096('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x7096('0xf')](_0x7096('0xc'),auth[_0x7096('0xa')](),controller['update']);router['delete'](_0x7096('0xc'),auth[_0x7096('0xa')](),controller[_0x7096('0x10')]);module['exports']=router; \ No newline at end of file +var _0x1cfd=['fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x1dbfa3,_0x5717dd){var _0x4f8e54=function(_0x4320fc){while(--_0x4320fc){_0x1dbfa3['push'](_0x1dbfa3['shift']());}};_0x4f8e54(++_0x5717dd);}(_0x1cfd,0x1db));var _0xd1cf=function(_0xae38c7,_0x6a060a){_0xae38c7=_0xae38c7-0x0;var _0x542be0=_0x1cfd[_0xae38c7];return _0x542be0;};'use strict';var multer=require(_0xd1cf('0x0'));var util=require(_0xd1cf('0x1'));var path=require(_0xd1cf('0x2'));var timeout=require(_0xd1cf('0x3'));var express=require(_0xd1cf('0x4'));var router=express['Router']();var fs_extra=require(_0xd1cf('0x5'));var auth=require(_0xd1cf('0x6'));var interaction=require(_0xd1cf('0x7'));var config=require('../../config/environment');var controller=require('./cmCustomField.controller');router[_0xd1cf('0x8')]('/',auth[_0xd1cf('0x9')](),controller[_0xd1cf('0xa')]);router['get'](_0xd1cf('0xb'),auth[_0xd1cf('0x9')](),controller[_0xd1cf('0xc')]);router[_0xd1cf('0xd')]('/',auth['isAuthenticated'](),controller[_0xd1cf('0xe')]);router[_0xd1cf('0xf')](_0xd1cf('0xb'),auth[_0xd1cf('0x9')](),controller[_0xd1cf('0x10')]);router[_0xd1cf('0x11')](_0xd1cf('0xb'),auth['isAuthenticated'](),controller[_0xd1cf('0x12')]);module[_0xd1cf('0x13')]=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index fb508d5..b88d4eb 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 _0xd47d=['moment','sequelize','STRING','BOOLEAN','DATE','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','UNSIGNED','contactListQueue'];(function(_0x2086dd,_0x40c63f){var _0x52fb48=function(_0x28cc39){while(--_0x28cc39){_0x2086dd['push'](_0x2086dd['shift']());}};_0x52fb48(++_0x40c63f);}(_0xd47d,0x15e));var _0xdd47=function(_0x413727,_0x17adb1){_0x413727=_0x413727-0x0;var _0x5f46d7=_0xd47d[_0x413727];return _0x5f46d7;};'use strict';var moment=require(_0xdd47('0x0'));var Sequelize=require(_0xdd47('0x1'));module['exports']={'phone':{'type':Sequelize[_0xdd47('0x2')],'allowNull':![]},'active':{'type':Sequelize[_0xdd47('0x3')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0xdd47('0x4')],'defaultValue':moment()[_0xdd47('0x5')](_0xdd47('0x6'))},'countbusyretry':{'type':Sequelize[_0xdd47('0x7')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xdd47('0x7')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'callback':{'type':Sequelize[_0xdd47('0x3')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0xdd47('0x4')]},'priority':{'type':Sequelize[_0xdd47('0x7')](0x2)[_0xdd47('0x8')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0xdd47('0x3')],'defaultValue':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0xdd47('0x7')],'unique':_0xdd47('0x9')},'UserId':{'type':Sequelize['INTEGER']},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0xdd47('0x9')},'CampaignId':{'type':Sequelize[_0xdd47('0x7')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xdd47('0x7')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xdd47('0x7')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xdd47('0x7')],'defaultValue':0x0}}; \ No newline at end of file +var _0xa885=['YYYY-MM-DD\x20HH:mm:ss','INTEGER','STRING','UNSIGNED','contactListQueue','moment','sequelize','exports','BOOLEAN','format'];(function(_0x3bbadc,_0x5af751){var _0x52f1aa=function(_0x3391b9){while(--_0x3391b9){_0x3bbadc['push'](_0x3bbadc['shift']());}};_0x52f1aa(++_0x5af751);}(_0xa885,0x1ef));var _0x5a88=function(_0x2b0042,_0x21df49){_0x2b0042=_0x2b0042-0x0;var _0x19b810=_0xa885[_0x2b0042];return _0x19b810;};'use strict';var moment=require(_0x5a88('0x0'));var Sequelize=require(_0x5a88('0x1'));module[_0x5a88('0x2')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'active':{'type':Sequelize[_0x5a88('0x3')],'defaultValue':![]},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()[_0x5a88('0x4')](_0x5a88('0x5'))},'countbusyretry':{'type':Sequelize[_0x5a88('0x6')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x5a88('0x6')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x5a88('0x6')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x5a88('0x3')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x5a88('0x7')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x5a88('0x8')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x5a88('0x3')],'defaultValue':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0x5a88('0x9')},'ListId':{'type':Sequelize[_0x5a88('0x6')],'unique':_0x5a88('0x9')},'UserId':{'type':Sequelize[_0x5a88('0x6')]},'VoiceQueueId':{'type':Sequelize[_0x5a88('0x6')],'unique':'contactListQueue'},'CampaignId':{'type':Sequelize['INTEGER']},'countnosuchnumberretry':{'type':Sequelize[_0x5a88('0x6')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x5a88('0x6')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x5a88('0x6')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x5a88('0x6')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.controller.js b/server/api/cmHopper/cmHopper.controller.js index 3c4c177..9286619 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 _0x2666=['then','destroy','name','send','index','map','CmHopper','rawAttributes','fieldName','type','model','query','keys','filters','intersection','concat','$and','$gt','$gte','$lt','$lte','$ne','$eq','$between','$notBetween','$in','$like','$iLike','$notILike','$overlap','$contained','$any','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','merge','includeAll','include','findAll','rows','catch','show','find','create','body','params','describe','VoiceQueueId','CampaignId','omit','createdAt','updatedAt','state','deleted','user','UserId','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','phone','campaigntype','queue','ivr','CmContact','firstName','lastName','calleridname','isNil','finally','CmHopperFinal','getPreview','getVoiceQueues','preview','dialOrderByScheduledAt','transaction','direction','isEmpty','hopperIds','priority','ASC','DESC','sequelize','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','scheduledAt','findOne','scheduledat','UPDATE','Contact','Company','CmList','VoiceQueue','Queue','update','getOpenContacts','outbound','error','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','rimraf','zip-dir','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','json','undefined','count','offset','set','Content-Range','reject','save'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0x2666,0x184));var _0x6266=function(_0x3502c9,_0xce749e){_0x3502c9=_0x3502c9-0x0;var _0x472dc4=_0x2666[_0x3502c9];return _0x472dc4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6266('0x0'));var zipdir=require(_0x6266('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6266('0x2'));var moment=require('moment');var BPromise=require(_0x6266('0x3'));var Mustache=require('mustache');var util=require(_0x6266('0x4'));var path=require(_0x6266('0x5'));var sox=require(_0x6266('0x6'));var csv=require(_0x6266('0x7'));var ejs=require(_0x6266('0x8'));var fs=require('fs');var fs_extra=require(_0x6266('0x9'));var _=require(_0x6266('0xa'));var squel=require(_0x6266('0xb'));var crypto=require(_0x6266('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x6266('0xd'));var toCsv=require(_0x6266('0x7'));var querystring=require(_0x6266('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x6266('0xf'));var qs=require(_0x6266('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6266('0x11'));var logger=require(_0x6266('0x12'))(_0x6266('0x13'));var utils=require('../../config/utils');var config=require(_0x6266('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x247a16,_0x6f76ef){_0x6f76ef=_0x6f76ef||0xcc;return function(_0x582192){if(_0x582192){return _0x247a16[_0x6266('0x15')](_0x6f76ef);}return _0x247a16[_0x6266('0x16')](_0x6f76ef)[_0x6266('0x17')]();};}function respondWithResult(_0x3f5fac,_0x4deba0){_0x4deba0=_0x4deba0||0xc8;return function(_0x35c597){if(_0x35c597){return _0x3f5fac['status'](_0x4deba0)[_0x6266('0x18')](_0x35c597);}};}function respondWithFilteredResult(_0x2249c8,_0x3ee541){return function(_0x47c9a2){if(_0x47c9a2){var _0xa6f5f=typeof _0x3ee541['offset']===_0x6266('0x19')&&typeof _0x3ee541['limit']==='undefined';var _0x3d6d4f=_0x47c9a2['count'];var _0x570339=_0xa6f5f?0x0:_0x3ee541['offset'];var _0x571dad=_0xa6f5f?_0x47c9a2[_0x6266('0x1a')]:_0x3ee541[_0x6266('0x1b')]+_0x3ee541['limit'];var _0xf6e0a7;if(_0x571dad>=_0x3d6d4f){_0x571dad=_0x3d6d4f;_0xf6e0a7=0xc8;}else{_0xf6e0a7=0xce;}_0x2249c8[_0x6266('0x16')](_0xf6e0a7);return _0x2249c8[_0x6266('0x1c')](_0x6266('0x1d'),_0x570339+'-'+_0x571dad+'/'+_0x3d6d4f)[_0x6266('0x18')](_0x47c9a2);}return null;};}function patchUpdates(_0x3f3ef0){return function(_0x45c227){try{jsonpatch['apply'](_0x45c227,_0x3f3ef0,!![]);}catch(_0x28b750){return BPromise[_0x6266('0x1e')](_0x28b750);}return _0x45c227[_0x6266('0x1f')]();};}function saveUpdates(_0x274f72,_0x6f514){return function(_0x2542ab){if(_0x2542ab){return _0x2542ab['update'](_0x274f72)[_0x6266('0x20')](function(_0x4bca44){return _0x4bca44;});}return null;};}function removeEntity(_0x37c253,_0x5b89be){return function(_0x26963d){if(_0x26963d){return _0x26963d[_0x6266('0x21')]()['then'](function(){_0x37c253[_0x6266('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4dce20,_0xb1c72c){return function(_0x340b54){if(!_0x340b54){_0x4dce20[_0x6266('0x15')](0x194);}return _0x340b54;};}function handleError(_0x39e3b4,_0x43e860){_0x43e860=_0x43e860||0x1f4;return function(_0x3e0f4a){logger['error'](_0x3e0f4a['stack']);if(_0x3e0f4a[_0x6266('0x22')]){delete _0x3e0f4a[_0x6266('0x22')];}_0x39e3b4['status'](_0x43e860)[_0x6266('0x23')](_0x3e0f4a);};}exports[_0x6266('0x24')]=function(_0x1ff248,_0x45a15c){var _0x3d2377={},_0xc24edc={},_0x36b97b={'count':0x0,'rows':[]};var _0x24dc14=_[_0x6266('0x25')](db[_0x6266('0x26')][_0x6266('0x27')],function(_0xea05a4){return{'name':_0xea05a4[_0x6266('0x28')],'type':_0xea05a4[_0x6266('0x29')]['key']};});_0xc24edc[_0x6266('0x2a')]=_[_0x6266('0x25')](_0x24dc14,'name');_0xc24edc[_0x6266('0x2b')]=_[_0x6266('0x2c')](_0x1ff248['query']);_0xc24edc[_0x6266('0x2d')]=_[_0x6266('0x2e')](_0xc24edc['model'],_0xc24edc['query']);_0xc24edc[_0x6266('0x2d')]=_[_0x6266('0x2f')](_0xc24edc[_0x6266('0x2d')],[_0x6266('0x30'),'$or',_0x6266('0x31'),_0x6266('0x32'),_0x6266('0x33'),_0x6266('0x34'),_0x6266('0x35'),_0x6266('0x36'),'$not',_0x6266('0x37'),_0x6266('0x38'),_0x6266('0x39'),'$notIn',_0x6266('0x3a'),'$notLike',_0x6266('0x3b'),_0x6266('0x3c'),_0x6266('0x3a'),_0x6266('0x3d'),'$contains',_0x6266('0x3e'),_0x6266('0x3f')]);_0x3d2377[_0x6266('0x40')]=_[_0x6266('0x2e')](_0xc24edc[_0x6266('0x2a')],qs[_0x6266('0x41')](_0x1ff248[_0x6266('0x2b')][_0x6266('0x41')]));_0x3d2377[_0x6266('0x40')]=_0x3d2377[_0x6266('0x40')][_0x6266('0x42')]?_0x3d2377[_0x6266('0x40')]:_0xc24edc[_0x6266('0x2a')];if(!_0x1ff248[_0x6266('0x2b')][_0x6266('0x43')](_0x6266('0x44'))){_0x3d2377[_0x6266('0x45')]=qs[_0x6266('0x45')](_0x1ff248[_0x6266('0x2b')][_0x6266('0x45')]);_0x3d2377['offset']=qs[_0x6266('0x1b')](_0x1ff248[_0x6266('0x2b')][_0x6266('0x1b')]);}_0x3d2377[_0x6266('0x46')]=qs[_0x6266('0x47')](_0x1ff248[_0x6266('0x2b')][_0x6266('0x47')]);_0x3d2377['where']=qs[_0x6266('0x2d')](_[_0x6266('0x48')](_0x1ff248[_0x6266('0x2b')],_0xc24edc[_0x6266('0x2d')]),_0x24dc14);if(_0x1ff248[_0x6266('0x2b')][_0x6266('0x49')]){_0x3d2377[_0x6266('0x4a')]=_[_0x6266('0x4b')](_0x3d2377[_0x6266('0x4a')],{'$or':_[_0x6266('0x25')](_0x24dc14,function(_0x92ec50){if(_0x92ec50[_0x6266('0x29')]!=='VIRTUAL'){var _0x24286f={};_0x24286f[_0x92ec50[_0x6266('0x22')]]={'$like':'%'+_0x1ff248[_0x6266('0x2b')][_0x6266('0x49')]+'%'};return _0x24286f;}})});}_0x3d2377=_[_0x6266('0x4b')]({},_0x3d2377,_0x1ff248['options']);var _0x528d99={'where':_0x3d2377[_0x6266('0x4a')]};return db[_0x6266('0x26')][_0x6266('0x1a')](_0x528d99)[_0x6266('0x20')](function(_0x26e490){_0x36b97b['count']=_0x26e490;if(_0x1ff248[_0x6266('0x2b')][_0x6266('0x4c')]){_0x3d2377[_0x6266('0x4d')]=[{'all':!![]}];}return db[_0x6266('0x26')][_0x6266('0x4e')](_0x3d2377);})[_0x6266('0x20')](function(_0xf8abc){_0x36b97b[_0x6266('0x4f')]=_0xf8abc;return _0x36b97b;})[_0x6266('0x20')](respondWithFilteredResult(_0x45a15c,_0x3d2377))[_0x6266('0x50')](handleError(_0x45a15c,null));};exports[_0x6266('0x51')]=function(_0x1f5789,_0x539a31){var _0x5e672b={'raw':!![],'where':{'id':_0x1f5789['params']['id']}},_0x574837={};_0x574837[_0x6266('0x2a')]=_[_0x6266('0x2c')](db[_0x6266('0x26')][_0x6266('0x27')]);_0x574837[_0x6266('0x2b')]=_[_0x6266('0x2c')](_0x1f5789[_0x6266('0x2b')]);_0x574837[_0x6266('0x2d')]=_[_0x6266('0x2e')](_0x574837['model'],_0x574837['query']);_0x5e672b['attributes']=_[_0x6266('0x2e')](_0x574837[_0x6266('0x2a')],qs[_0x6266('0x41')](_0x1f5789['query'][_0x6266('0x41')]));_0x5e672b[_0x6266('0x40')]=_0x5e672b[_0x6266('0x40')]['length']?_0x5e672b[_0x6266('0x40')]:_0x574837['model'];if(_0x1f5789[_0x6266('0x2b')][_0x6266('0x4c')]){_0x5e672b[_0x6266('0x4d')]=[{'all':!![]}];}_0x5e672b=_[_0x6266('0x4b')]({},_0x5e672b,_0x1f5789['options']);return db[_0x6266('0x26')][_0x6266('0x52')](_0x5e672b)[_0x6266('0x20')](handleEntityNotFound(_0x539a31,null))['then'](respondWithResult(_0x539a31,null))[_0x6266('0x50')](handleError(_0x539a31,null));};exports[_0x6266('0x53')]=function(_0x1dec8f,_0x1ca4c9){return db[_0x6266('0x26')][_0x6266('0x53')](_0x1dec8f[_0x6266('0x54')],{})['then'](respondWithResult(_0x1ca4c9,0xc9))['catch'](handleError(_0x1ca4c9,null));};exports['update']=function(_0x6dffe5,_0xc07eec){if(_0x6dffe5[_0x6266('0x54')]['id']){delete _0x6dffe5[_0x6266('0x54')]['id'];}return db[_0x6266('0x26')]['find']({'where':{'id':_0x6dffe5[_0x6266('0x55')]['id']}})[_0x6266('0x20')](handleEntityNotFound(_0xc07eec,null))[_0x6266('0x20')](saveUpdates(_0x6dffe5['body'],null))[_0x6266('0x20')](respondWithResult(_0xc07eec,null))['catch'](handleError(_0xc07eec,null));};exports[_0x6266('0x56')]=function(_0x610ef5,_0x541169){return db[_0x6266('0x26')]['describe']()[_0x6266('0x20')](respondWithResult(_0x541169,null))['catch'](handleError(_0x541169,null));};exports['destroy']=function(_0x1a3938,_0x4164e2){var _0x2ac2c2;return db[_0x6266('0x26')][_0x6266('0x52')]({'where':{'id':_0x1a3938[_0x6266('0x55')]['id']}})[_0x6266('0x20')](handleEntityNotFound(_0x4164e2,null))[_0x6266('0x20')](function(_0x43591d){if(_0x43591d){return _0x43591d[_0x6266('0x21')]()[_0x6266('0x20')](function(_0x1d4304){return _0x1d4304;});}})[_0x6266('0x20')](function(_0x24baa3){_0x2ac2c2=_0x24baa3;if(_0x24baa3){if(_0x24baa3[_0x6266('0x57')]||_0x24baa3['CampaignId']){return db[_0x24baa3['VoiceQueueId']?'VoiceQueue':'Campaign'][_0x6266('0x52')]({'where':{'id':_0x24baa3[_0x6266('0x57')]?_0x24baa3['VoiceQueueId']:_0x24baa3[_0x6266('0x58')]},'attributes':['id',_0x6266('0x22')],'raw':!![]});}}})[_0x6266('0x20')](function(_0xb6522a){var _0x5940a1={};if(_0xb6522a){_['merge'](_0x5940a1,_[_0x6266('0x59')](_0x2ac2c2['dataValues'],[_0x6266('0x5a'),_0x6266('0x5b'),'id']));_0x5940a1[_0x6266('0x5c')]=0x15;_0x5940a1['statedesc']=_0x6266('0x5d');_0x5940a1['campaign']=_0xb6522a[_0x6266('0x22')];_0x5940a1['membername']=_0x1a3938[_0x6266('0x5e')][_0x6266('0x22')];_0x5940a1[_0x6266('0x5f')]=_0x1a3938[_0x6266('0x5e')]['id'];_0x5940a1[_0x6266('0x5d')]=!![];_0x5940a1[_0x6266('0x60')]=moment()[_0x6266('0x61')](_0x6266('0x62'));_0x5940a1[_0x6266('0x63')]=_0x2ac2c2[_0x6266('0x64')];_0x5940a1[_0x6266('0x65')]=_0x2ac2c2[_0x6266('0x57')]?_0x6266('0x66'):_0x6266('0x67');return db[_0x6266('0x68')][_0x6266('0x52')]({'where':{'id':_0x5940a1['ContactId']},'attributes':[_0x6266('0x69'),_0x6266('0x6a')]})[_0x6266('0x20')](function(_0x490a56){if(!_['isNil'](_0x4164e2)&&!_['isNil'](_0x490a56[_0x6266('0x69')])){_0x5940a1[_0x6266('0x6b')]=_0x490a56[_0x6266('0x69')];if(!_[_0x6266('0x6c')](_0x490a56['lastName'])){_0x5940a1[_0x6266('0x6b')]+='\x20'+_0x490a56[_0x6266('0x6a')];}}})[_0x6266('0x6d')](function(){return db[_0x6266('0x6e')]['create'](_0x5940a1);});}})[_0x6266('0x20')](function(){return _0x4164e2['status'](0xcc)[_0x6266('0x17')]();})[_0x6266('0x50')](handleError(_0x4164e2,null));};exports[_0x6266('0x6f')]=function(_0x1a86bf,_0x56ba94,_0x5d9473){var _0x28eb0e=[];return db[_0x6266('0x68')][_0x6266('0x56')]()[_0x6266('0x20')](function(_0x3d7c7b){_0x28eb0e=_['keys'](_0x3d7c7b);return _0x1a86bf['user'][_0x6266('0x70')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0x6266('0x71')},'attributes':['id',_0x6266('0x72')],'raw':!![]});})['then'](function(_0x365afd){if(_0x365afd&&_0x365afd[_0x6266('0x42')]){return db['sequelize'][_0x6266('0x73')](function(_0x3f831c){var _0x307e0b={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0x6266('0x62'))},'VoiceQueueId':{'$in':_[_0x6266('0x25')](_0x365afd,'id')},'$or':[{'UserId':null},{'UserId':_0x1a86bf['user']['id']}]};var _0x1639a3=[];if(_0x1a86bf[_0x6266('0x54')][_0x6266('0x74')]&&_0x1a86bf[_0x6266('0x54')][_0x6266('0x74')]==='prev'){if(!_[_0x6266('0x75')](_0x1a86bf[_0x6266('0x54')][_0x6266('0x76')])){_0x307e0b['id']={'$in':_0x1a86bf[_0x6266('0x54')][_0x6266('0x76')]};}_0x1639a3=[[_0x6266('0x77'),_0x6266('0x78')],['scheduledAt',_0x365afd[0x0][_0x6266('0x72')]==='ASC'?_0x6266('0x79'):_0x6266('0x78')],db[_0x6266('0x7a')][_0x6266('0x7b')](_0x6266('0x7c')),['id',_0x6266('0x79')]];}else{if(!_[_0x6266('0x75')](_0x1a86bf[_0x6266('0x54')]['hopperIds'])){_0x307e0b['id']={'$notIn':_0x1a86bf['body'][_0x6266('0x76')]};}_0x1639a3=[[_0x6266('0x77'),_0x6266('0x79')],[_0x6266('0x7d'),_0x365afd[0x0][_0x6266('0x72')]],db[_0x6266('0x7a')][_0x6266('0x7b')]('COALESCE(CmHopper.UserId,\x200)\x20DESC'),['id','ASC']];}return db[_0x6266('0x26')][_0x6266('0x7e')]({'attributes':['id',_0x6266('0x7f')],'where':_0x307e0b,'order':_0x1639a3,'transaction':_0x3f831c,'lock':_0x3f831c['LOCK'][_0x6266('0x80')],'include':[{'model':db[_0x6266('0x68')],'as':_0x6266('0x81'),'attributes':_0x28eb0e,'include':[{'model':db['CmCompany'],'as':_0x6266('0x82'),'attributes':['id',_0x6266('0x22')]}]},{'model':db[_0x6266('0x83')],'as':'List','attributes':['id',_0x6266('0x22')]},{'model':db[_0x6266('0x84')],'as':_0x6266('0x85'),'attributes':['id',_0x6266('0x22'),'dialActive']}]})['then'](function(_0x452b27){if(_0x452b27){return _0x452b27[_0x6266('0x86')]({'UserId':_0x1a86bf[_0x6266('0x5e')]['id']},{'transaction':_0x3f831c});}});});}})['then'](handleEntityNotFound(_0x56ba94,null))[_0x6266('0x20')](respondWithResult(_0x56ba94,null))['catch'](handleError(_0x56ba94,null));};exports[_0x6266('0x87')]=function(_0x46dbde,_0x6e3951,_0x4cc0b4){return _0x46dbde[_0x6266('0x5e')]['getVoiceQueues']({'where':{'type':_0x6266('0x88'),'dialActive':!![],'dialMethod':_0x6266('0x71')},'attributes':['id'],'raw':!![]})[_0x6266('0x20')](function(_0x1d6c20){if(_0x1d6c20&&_0x1d6c20[_0x6266('0x42')]){return db[_0x6266('0x26')]['count']({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x6266('0x61')]('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0x6266('0x25')](_0x1d6c20,'id')},'$or':[{'UserId':null},{'UserId':_0x46dbde[_0x6266('0x5e')]['id']}]}});}return 0x0;})['then'](function(_0x511e32){if(!_['isNil'](_0x511e32)&&_['isNumber'](_0x511e32)){return _0x6e3951[_0x6266('0x16')](0xc8)[_0x6266('0x18')]({'contacts':_0x511e32});}else{logger[_0x6266('0x89')](_0x6266('0x8a'),'getOpenContacts',0x194,_0x6266('0x8b'));_0x6e3951[_0x6266('0x15')](0x194);}})['catch'](handleError(_0x6e3951,null));}; \ No newline at end of file +var _0x994a=['hopperIds','priority','ASC','DESC','literal','scheduledAt','COALESCE(CmHopper.UserId,\x200)\x20DESC','scheduledat','LOCK','UPDATE','Company','CmList','List','VoiceQueue','Queue','dialActive','getOpenContacts','getVoiceQueues','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','sendStatus','status','json','undefined','limit','count','offset','Content-Range','reject','update','then','destroy','end','error','stack','index','map','CmHopper','fieldName','key','model','name','query','keys','filters','intersection','concat','$and','$or','$lt','$eq','$not','$between','$notIn','$notLike','$iLike','$like','$overlap','$contains','$contained','$any','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','include','find','create','body','describe','params','CampaignId','VoiceQueueId','Campaign','omit','dataValues','updatedAt','state','statedesc','deleted','campaign','user','YYYY-MM-DD\x20HH:mm:ss','phone','campaigntype','queue','ivr','CmContact','ContactId','firstName','lastName','isNil','calleridname','CmHopperFinal','getPreview','outbound','preview','dialOrderByScheduledAt','sequelize','transaction','format','direction','isEmpty'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x994a,0x1ad));var _0xa994=function(_0x233a7c,_0x35d1a2){_0x233a7c=_0x233a7c-0x0;var _0x3c474a=_0x994a[_0x233a7c];return _0x3c474a;};'use strict';var emlformat=require(_0xa994('0x0'));var rimraf=require(_0xa994('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa994('0x2'));var rp=require('request-promise');var moment=require(_0xa994('0x3'));var BPromise=require(_0xa994('0x4'));var Mustache=require(_0xa994('0x5'));var util=require('util');var path=require('path');var sox=require(_0xa994('0x6'));var csv=require(_0xa994('0x7'));var ejs=require(_0xa994('0x8'));var fs=require('fs');var fs_extra=require(_0xa994('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xa994('0xa'));var jsforce=require(_0xa994('0xb'));var deskjs=require(_0xa994('0xc'));var toCsv=require(_0xa994('0x7'));var querystring=require(_0xa994('0xd'));var Papa=require('papaparse');var Redis=require(_0xa994('0xe'));var authService=require(_0xa994('0xf'));var qs=require(_0xa994('0x10'));var as=require(_0xa994('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xa994('0x12'));var utils=require(_0xa994('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0xa994('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x286fb0,_0x2e4659){_0x2e4659=_0x2e4659||0xcc;return function(_0x1ae06c){if(_0x1ae06c){return _0x286fb0[_0xa994('0x15')](_0x2e4659);}return _0x286fb0[_0xa994('0x16')](_0x2e4659)['end']();};}function respondWithResult(_0x58bdcd,_0x587554){_0x587554=_0x587554||0xc8;return function(_0x118ba5){if(_0x118ba5){return _0x58bdcd[_0xa994('0x16')](_0x587554)[_0xa994('0x17')](_0x118ba5);}};}function respondWithFilteredResult(_0x364368,_0x54bccf){return function(_0x4835c1){if(_0x4835c1){var _0x9a0d3d=typeof _0x54bccf['offset']===_0xa994('0x18')&&typeof _0x54bccf[_0xa994('0x19')]===_0xa994('0x18');var _0xd21068=_0x4835c1[_0xa994('0x1a')];var _0x46d602=_0x9a0d3d?0x0:_0x54bccf[_0xa994('0x1b')];var _0x1539f8=_0x9a0d3d?_0x4835c1['count']:_0x54bccf['offset']+_0x54bccf[_0xa994('0x19')];var _0x387921;if(_0x1539f8>=_0xd21068){_0x1539f8=_0xd21068;_0x387921=0xc8;}else{_0x387921=0xce;}_0x364368['status'](_0x387921);return _0x364368['set'](_0xa994('0x1c'),_0x46d602+'-'+_0x1539f8+'/'+_0xd21068)[_0xa994('0x17')](_0x4835c1);}return null;};}function patchUpdates(_0x2a2259){return function(_0x5a8c2d){try{jsonpatch['apply'](_0x5a8c2d,_0x2a2259,!![]);}catch(_0x2a2747){return BPromise[_0xa994('0x1d')](_0x2a2747);}return _0x5a8c2d['save']();};}function saveUpdates(_0x309e00,_0x1dac64){return function(_0x3549ca){if(_0x3549ca){return _0x3549ca[_0xa994('0x1e')](_0x309e00)[_0xa994('0x1f')](function(_0x196d2a){return _0x196d2a;});}return null;};}function removeEntity(_0x3f5d04,_0xc2601d){return function(_0x50ea4b){if(_0x50ea4b){return _0x50ea4b[_0xa994('0x20')]()[_0xa994('0x1f')](function(){_0x3f5d04['status'](0xcc)[_0xa994('0x21')]();});}};}function handleEntityNotFound(_0x271dcf,_0x2ddb78){return function(_0xcb284d){if(!_0xcb284d){_0x271dcf[_0xa994('0x15')](0x194);}return _0xcb284d;};}function handleError(_0x5e373c,_0xf00427){_0xf00427=_0xf00427||0x1f4;return function(_0x3314ad){logger[_0xa994('0x22')](_0x3314ad[_0xa994('0x23')]);if(_0x3314ad['name']){delete _0x3314ad['name'];}_0x5e373c[_0xa994('0x16')](_0xf00427)['send'](_0x3314ad);};}exports[_0xa994('0x24')]=function(_0x1287bb,_0x2c8453){var _0x2c3732={},_0x7cfcc4={},_0x1b2b2a={'count':0x0,'rows':[]};var _0x395a76=_[_0xa994('0x25')](db[_0xa994('0x26')]['rawAttributes'],function(_0x17ad98){return{'name':_0x17ad98[_0xa994('0x27')],'type':_0x17ad98['type'][_0xa994('0x28')]};});_0x7cfcc4[_0xa994('0x29')]=_['map'](_0x395a76,_0xa994('0x2a'));_0x7cfcc4[_0xa994('0x2b')]=_[_0xa994('0x2c')](_0x1287bb[_0xa994('0x2b')]);_0x7cfcc4[_0xa994('0x2d')]=_[_0xa994('0x2e')](_0x7cfcc4[_0xa994('0x29')],_0x7cfcc4[_0xa994('0x2b')]);_0x7cfcc4['filters']=_[_0xa994('0x2f')](_0x7cfcc4[_0xa994('0x2d')],[_0xa994('0x30'),_0xa994('0x31'),'$gt','$gte',_0xa994('0x32'),'$lte','$ne',_0xa994('0x33'),_0xa994('0x34'),_0xa994('0x35'),'$notBetween','$in',_0xa994('0x36'),'$like',_0xa994('0x37'),_0xa994('0x38'),'$notILike',_0xa994('0x39'),_0xa994('0x3a'),_0xa994('0x3b'),_0xa994('0x3c'),_0xa994('0x3d')]);_0x2c3732[_0xa994('0x3e')]=_[_0xa994('0x2e')](_0x7cfcc4[_0xa994('0x29')],qs[_0xa994('0x3f')](_0x1287bb[_0xa994('0x2b')]['fields']));_0x2c3732[_0xa994('0x3e')]=_0x2c3732[_0xa994('0x3e')][_0xa994('0x40')]?_0x2c3732['attributes']:_0x7cfcc4[_0xa994('0x29')];if(!_0x1287bb['query'][_0xa994('0x41')]('nolimit')){_0x2c3732[_0xa994('0x19')]=qs['limit'](_0x1287bb['query'][_0xa994('0x19')]);_0x2c3732['offset']=qs['offset'](_0x1287bb[_0xa994('0x2b')]['offset']);}_0x2c3732['order']=qs[_0xa994('0x42')](_0x1287bb[_0xa994('0x2b')][_0xa994('0x42')]);_0x2c3732[_0xa994('0x43')]=qs[_0xa994('0x2d')](_[_0xa994('0x44')](_0x1287bb['query'],_0x7cfcc4[_0xa994('0x2d')]),_0x395a76);if(_0x1287bb['query'][_0xa994('0x45')]){_0x2c3732[_0xa994('0x43')]=_[_0xa994('0x46')](_0x2c3732['where'],{'$or':_[_0xa994('0x25')](_0x395a76,function(_0x3476c1){if(_0x3476c1['type']!==_0xa994('0x47')){var _0x32fc85={};_0x32fc85[_0x3476c1[_0xa994('0x2a')]]={'$like':'%'+_0x1287bb[_0xa994('0x2b')][_0xa994('0x45')]+'%'};return _0x32fc85;}})});}_0x2c3732=_[_0xa994('0x46')]({},_0x2c3732,_0x1287bb[_0xa994('0x48')]);var _0x3975cf={'where':_0x2c3732[_0xa994('0x43')]};return db[_0xa994('0x26')][_0xa994('0x1a')](_0x3975cf)[_0xa994('0x1f')](function(_0x8041a8){_0x1b2b2a[_0xa994('0x1a')]=_0x8041a8;if(_0x1287bb['query'][_0xa994('0x49')]){_0x2c3732['include']=[{'all':!![]}];}return db[_0xa994('0x26')][_0xa994('0x4a')](_0x2c3732);})[_0xa994('0x1f')](function(_0x10bb21){_0x1b2b2a[_0xa994('0x4b')]=_0x10bb21;return _0x1b2b2a;})['then'](respondWithFilteredResult(_0x2c8453,_0x2c3732))[_0xa994('0x4c')](handleError(_0x2c8453,null));};exports['show']=function(_0x4a81a8,_0x24bba5){var _0x563cd6={'raw':!![],'where':{'id':_0x4a81a8['params']['id']}},_0x2e439f={};_0x2e439f[_0xa994('0x29')]=_[_0xa994('0x2c')](db['CmHopper']['rawAttributes']);_0x2e439f[_0xa994('0x2b')]=_['keys'](_0x4a81a8[_0xa994('0x2b')]);_0x2e439f['filters']=_['intersection'](_0x2e439f[_0xa994('0x29')],_0x2e439f[_0xa994('0x2b')]);_0x563cd6[_0xa994('0x3e')]=_[_0xa994('0x2e')](_0x2e439f[_0xa994('0x29')],qs['fields'](_0x4a81a8['query'][_0xa994('0x3f')]));_0x563cd6['attributes']=_0x563cd6[_0xa994('0x3e')][_0xa994('0x40')]?_0x563cd6['attributes']:_0x2e439f[_0xa994('0x29')];if(_0x4a81a8['query']['includeAll']){_0x563cd6[_0xa994('0x4d')]=[{'all':!![]}];}_0x563cd6=_[_0xa994('0x46')]({},_0x563cd6,_0x4a81a8[_0xa994('0x48')]);return db[_0xa994('0x26')][_0xa994('0x4e')](_0x563cd6)[_0xa994('0x1f')](handleEntityNotFound(_0x24bba5,null))[_0xa994('0x1f')](respondWithResult(_0x24bba5,null))[_0xa994('0x4c')](handleError(_0x24bba5,null));};exports[_0xa994('0x4f')]=function(_0x1b1653,_0x1838fc){return db[_0xa994('0x26')][_0xa994('0x4f')](_0x1b1653[_0xa994('0x50')],{})['then'](respondWithResult(_0x1838fc,0xc9))[_0xa994('0x4c')](handleError(_0x1838fc,null));};exports[_0xa994('0x1e')]=function(_0x1515f4,_0x228a08){if(_0x1515f4['body']['id']){delete _0x1515f4[_0xa994('0x50')]['id'];}return db[_0xa994('0x26')][_0xa994('0x4e')]({'where':{'id':_0x1515f4['params']['id']}})[_0xa994('0x1f')](handleEntityNotFound(_0x228a08,null))[_0xa994('0x1f')](saveUpdates(_0x1515f4[_0xa994('0x50')],null))[_0xa994('0x1f')](respondWithResult(_0x228a08,null))['catch'](handleError(_0x228a08,null));};exports[_0xa994('0x51')]=function(_0x5e3b50,_0x266f1f){return db[_0xa994('0x26')][_0xa994('0x51')]()[_0xa994('0x1f')](respondWithResult(_0x266f1f,null))[_0xa994('0x4c')](handleError(_0x266f1f,null));};exports['destroy']=function(_0x23cfe6,_0x5360a9){var _0x17d336;return db[_0xa994('0x26')][_0xa994('0x4e')]({'where':{'id':_0x23cfe6[_0xa994('0x52')]['id']}})[_0xa994('0x1f')](handleEntityNotFound(_0x5360a9,null))[_0xa994('0x1f')](function(_0x15d578){if(_0x15d578){return _0x15d578[_0xa994('0x20')]()[_0xa994('0x1f')](function(_0x1e8642){return _0x1e8642;});}})[_0xa994('0x1f')](function(_0x3a639f){_0x17d336=_0x3a639f;if(_0x3a639f){if(_0x3a639f['VoiceQueueId']||_0x3a639f[_0xa994('0x53')]){return db[_0x3a639f[_0xa994('0x54')]?'VoiceQueue':_0xa994('0x55')][_0xa994('0x4e')]({'where':{'id':_0x3a639f[_0xa994('0x54')]?_0x3a639f[_0xa994('0x54')]:_0x3a639f[_0xa994('0x53')]},'attributes':['id',_0xa994('0x2a')],'raw':!![]});}}})[_0xa994('0x1f')](function(_0x353886){var _0x20ced2={};if(_0x353886){_['merge'](_0x20ced2,_[_0xa994('0x56')](_0x17d336[_0xa994('0x57')],['createdAt',_0xa994('0x58'),'id']));_0x20ced2[_0xa994('0x59')]=0x15;_0x20ced2[_0xa994('0x5a')]=_0xa994('0x5b');_0x20ced2[_0xa994('0x5c')]=_0x353886['name'];_0x20ced2['membername']=_0x23cfe6[_0xa994('0x5d')][_0xa994('0x2a')];_0x20ced2['UserId']=_0x23cfe6[_0xa994('0x5d')]['id'];_0x20ced2[_0xa994('0x5b')]=!![];_0x20ced2['deletedat']=moment()['format'](_0xa994('0x5e'));_0x20ced2['calleridnum']=_0x17d336[_0xa994('0x5f')];_0x20ced2[_0xa994('0x60')]=_0x17d336[_0xa994('0x54')]?_0xa994('0x61'):_0xa994('0x62');return db[_0xa994('0x63')]['find']({'where':{'id':_0x20ced2[_0xa994('0x64')]},'attributes':[_0xa994('0x65'),_0xa994('0x66')]})[_0xa994('0x1f')](function(_0x57a9c3){if(!_[_0xa994('0x67')](_0x5360a9)&&!_[_0xa994('0x67')](_0x57a9c3[_0xa994('0x65')])){_0x20ced2[_0xa994('0x68')]=_0x57a9c3[_0xa994('0x65')];if(!_['isNil'](_0x57a9c3[_0xa994('0x66')])){_0x20ced2['calleridname']+='\x20'+_0x57a9c3[_0xa994('0x66')];}}})['finally'](function(){return db[_0xa994('0x69')][_0xa994('0x4f')](_0x20ced2);});}})[_0xa994('0x1f')](function(){return _0x5360a9[_0xa994('0x16')](0xcc)[_0xa994('0x21')]();})[_0xa994('0x4c')](handleError(_0x5360a9,null));};exports[_0xa994('0x6a')]=function(_0x356f3a,_0x4ee154,_0x2ca2e2){var _0x1bc56b=[];return db['CmContact'][_0xa994('0x51')]()['then'](function(_0x2f09bf){_0x1bc56b=_[_0xa994('0x2c')](_0x2f09bf);return _0x356f3a[_0xa994('0x5d')]['getVoiceQueues']({'where':{'type':_0xa994('0x6b'),'dialActive':!![],'dialMethod':_0xa994('0x6c')},'attributes':['id',_0xa994('0x6d')],'raw':!![]});})['then'](function(_0x22fac4){if(_0x22fac4&&_0x22fac4[_0xa994('0x40')]){return db[_0xa994('0x6e')][_0xa994('0x6f')](function(_0x56e327){var _0x63257a={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xa994('0x70')](_0xa994('0x5e'))},'VoiceQueueId':{'$in':_[_0xa994('0x25')](_0x22fac4,'id')},'$or':[{'UserId':null},{'UserId':_0x356f3a[_0xa994('0x5d')]['id']}]};var _0x36ea92=[];if(_0x356f3a[_0xa994('0x50')][_0xa994('0x71')]&&_0x356f3a[_0xa994('0x50')][_0xa994('0x71')]==='prev'){if(!_[_0xa994('0x72')](_0x356f3a[_0xa994('0x50')][_0xa994('0x73')])){_0x63257a['id']={'$in':_0x356f3a[_0xa994('0x50')][_0xa994('0x73')]};}_0x36ea92=[[_0xa994('0x74'),_0xa994('0x75')],['scheduledAt',_0x22fac4[0x0]['dialOrderByScheduledAt']===_0xa994('0x75')?_0xa994('0x76'):_0xa994('0x75')],db[_0xa994('0x6e')][_0xa994('0x77')]('COALESCE(CmHopper.UserId,\x200)\x20ASC'),['id',_0xa994('0x76')]];}else{if(!_[_0xa994('0x72')](_0x356f3a[_0xa994('0x50')][_0xa994('0x73')])){_0x63257a['id']={'$notIn':_0x356f3a['body'][_0xa994('0x73')]};}_0x36ea92=[[_0xa994('0x74'),_0xa994('0x76')],[_0xa994('0x78'),_0x22fac4[0x0][_0xa994('0x6d')]],db['sequelize'][_0xa994('0x77')](_0xa994('0x79')),['id','ASC']];}return db[_0xa994('0x26')]['findOne']({'attributes':['id',_0xa994('0x7a')],'where':_0x63257a,'order':_0x36ea92,'transaction':_0x56e327,'lock':_0x56e327[_0xa994('0x7b')][_0xa994('0x7c')],'include':[{'model':db[_0xa994('0x63')],'as':'Contact','attributes':_0x1bc56b,'include':[{'model':db['CmCompany'],'as':_0xa994('0x7d'),'attributes':['id',_0xa994('0x2a')]}]},{'model':db[_0xa994('0x7e')],'as':_0xa994('0x7f'),'attributes':['id','name']},{'model':db[_0xa994('0x80')],'as':_0xa994('0x81'),'attributes':['id',_0xa994('0x2a'),_0xa994('0x82')]}]})[_0xa994('0x1f')](function(_0xc09d24){if(_0xc09d24){return _0xc09d24[_0xa994('0x1e')]({'UserId':_0x356f3a[_0xa994('0x5d')]['id']},{'transaction':_0x56e327});}});});}})['then'](handleEntityNotFound(_0x4ee154,null))[_0xa994('0x1f')](respondWithResult(_0x4ee154,null))['catch'](handleError(_0x4ee154,null));};exports[_0xa994('0x83')]=function(_0x93616b,_0x1f36fd,_0x1186b8){return _0x93616b[_0xa994('0x5d')][_0xa994('0x84')]({'where':{'type':_0xa994('0x6b'),'dialActive':!![],'dialMethod':_0xa994('0x6c')},'attributes':['id'],'raw':!![]})['then'](function(_0xc004f0){if(_0xc004f0&&_0xc004f0['length']){return db['CmHopper']['count']({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xa994('0x70')](_0xa994('0x5e'))},'VoiceQueueId':{'$in':_[_0xa994('0x25')](_0xc004f0,'id')},'$or':[{'UserId':null},{'UserId':_0x93616b['user']['id']}]}});}return 0x0;})[_0xa994('0x1f')](function(_0x4e0593){if(!_[_0xa994('0x67')](_0x4e0593)&&_[_0xa994('0x85')](_0x4e0593)){return _0x1f36fd[_0xa994('0x16')](0xc8)[_0xa994('0x17')]({'contacts':_0x4e0593});}else{logger['error'](_0xa994('0x86'),_0xa994('0x83'),0x194,_0xa994('0x87'));_0x1f36fd[_0xa994('0x15')](0x194);}})['catch'](handleError(_0x1f36fd,null));}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index 883c240..9656bcb 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 _0x7a54=['bluebird','path','rimraf','../../config/environment','./cmHopper.attributes','exports','CmHopper','cm_hopper','scheduledat','priority','lodash','util','../../config/logger','moment'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x7a54,0x106));var _0x47a5=function(_0x98947a,_0x5ba4fe){_0x98947a=_0x98947a-0x0;var _0x6f3519=_0x7a54[_0x98947a];return _0x6f3519;};'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':'scheduledat','fields':[_0x47a5('0xc')]},{'name':'phone','fields':['phone']},{'name':'priority','fields':[_0x47a5('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7c09=['scheduledat','phone','priority','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopper.attributes','define','CmHopper','cm_hopper'];(function(_0x3378f8,_0x53ba2d){var _0x23cb3b=function(_0x4cecee){while(--_0x4cecee){_0x3378f8['push'](_0x3378f8['shift']());}};_0x23cb3b(++_0x53ba2d);}(_0x7c09,0x102));var _0x97c0=function(_0x4fb585,_0x500147){_0x4fb585=_0x4fb585-0x0;var _0x3b9e2c=_0x7c09[_0x4fb585];return _0x3b9e2c;};'use strict';var _=require('lodash');var util=require(_0x97c0('0x0'));var logger=require(_0x97c0('0x1'))('api');var moment=require(_0x97c0('0x2'));var BPromise=require(_0x97c0('0x3'));var rp=require(_0x97c0('0x4'));var fs=require('fs');var path=require(_0x97c0('0x5'));var rimraf=require(_0x97c0('0x6'));var config=require(_0x97c0('0x7'));var attributes=require(_0x97c0('0x8'));module['exports']=function(_0x4b2f81,_0x590368){return _0x4b2f81[_0x97c0('0x9')](_0x97c0('0xa'),attributes,{'tableName':_0x97c0('0xb'),'paranoid':![],'indexes':[{'name':_0x97c0('0xc'),'fields':[_0x97c0('0xc')]},{'name':'phone','fields':[_0x97c0('0xd')]},{'name':'priority','fields':[_0x97c0('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index 14910d9..49c167c 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 _0x0ef4=['find','map','body','CreateCmHopper','UpdateCmHopper','update','where','DestroyCmHopper','GetContactDialer','CmContact','describe','sequelize','transaction','order','Contact','User','Agent','name','voicePause','UserId','push','includes','all','CmHopperFinal','create','destroy','MoveContactManagedDialer','CountReScheduled','COUNT','literal','`scheduledat`\x20>=\x20','format','\x22%s\x22','\x20,\x201,\x20null','contactsRescheduled','LOCK','UPDATE','length','GetContactRecallMe','keys','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','stringify','error','code','CmHopper,\x20%s,\x20%s','message','result','catch','GetCmHopper','findAll','raw','options','attributes','limit','include','model','debug','ShowCmHopper','CmHopper'];(function(_0x2b5eae,_0x55010d){var _0x5f3ac9=function(_0x397bfc){while(--_0x397bfc){_0x2b5eae['push'](_0x2b5eae['shift']());}};_0x5f3ac9(++_0x55010d);}(_0x0ef4,0x1e4));var _0x40ef=function(_0x412342,_0x180734){_0x412342=_0x412342-0x0;var _0x3e62cb=_0x0ef4[_0x412342];return _0x3e62cb;};'use strict';var _=require(_0x40ef('0x0'));var util=require(_0x40ef('0x1'));var moment=require(_0x40ef('0x2'));var BPromise=require(_0x40ef('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x40ef('0x4'));var db=require(_0x40ef('0x5'))['db'];var utils=require(_0x40ef('0x6'));var logger=require(_0x40ef('0x7'))(_0x40ef('0x8'));var config=require('../../config/environment');var jayson=require(_0x40ef('0x9'));var client=jayson[_0x40ef('0xa')][_0x40ef('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x20b7e4,_0x57e6d6,_0x750da1){return new BPromise(function(_0x272d2d,_0xd3651f){return client[_0x40ef('0xc')](_0x20b7e4,_0x750da1)[_0x40ef('0xd')](function(_0x404cae){logger[_0x40ef('0xe')]('CmHopper,\x20%s,\x20%s',_0x57e6d6,_0x40ef('0xf'));logger['debug']('CmHopper,\x20%s,\x20%s,\x20%s',_0x57e6d6,_0x40ef('0xf'),JSON[_0x40ef('0x10')](_0x404cae));if(_0x404cae[_0x40ef('0x11')]){if(_0x404cae['error'][_0x40ef('0x12')]===0x1f4){logger[_0x40ef('0x11')](_0x40ef('0x13'),_0x57e6d6,_0x404cae[_0x40ef('0x11')][_0x40ef('0x14')]);return _0xd3651f(_0x404cae[_0x40ef('0x11')][_0x40ef('0x14')]);}logger[_0x40ef('0x11')]('CmHopper,\x20%s,\x20%s',_0x57e6d6,_0x404cae['error']['message']);return _0x272d2d(_0x404cae['error'][_0x40ef('0x14')]);}else{logger[_0x40ef('0xe')](_0x40ef('0x13'),_0x57e6d6,_0x40ef('0xf'));_0x272d2d(_0x404cae[_0x40ef('0x15')][_0x40ef('0x14')]);}})[_0x40ef('0x16')](function(_0x396a6b){logger[_0x40ef('0x11')](_0x40ef('0x13'),_0x57e6d6,_0x396a6b);_0xd3651f(_0x396a6b);});});}exports[_0x40ef('0x17')]=function(_0x3d1134){var _0x39f3b6=this;return new Promise(function(_0x2395e4,_0x551d4f){return db['CmHopper'][_0x40ef('0x18')]({'raw':_0x3d1134['options']?_0x3d1134['options'][_0x40ef('0x19')]===undefined?!![]:![]:!![],'where':_0x3d1134[_0x40ef('0x1a')]?_0x3d1134[_0x40ef('0x1a')]['where']||null:null,'attributes':_0x3d1134[_0x40ef('0x1a')]?_0x3d1134[_0x40ef('0x1a')][_0x40ef('0x1b')]||null:null,'limit':_0x3d1134['options']?_0x3d1134[_0x40ef('0x1a')][_0x40ef('0x1c')]||null:null,'include':_0x3d1134[_0x40ef('0x1a')]?_0x3d1134[_0x40ef('0x1a')][_0x40ef('0x1d')]?_['map'](_0x3d1134[_0x40ef('0x1a')][_0x40ef('0x1d')],function(_0x188518){return{'model':db[_0x188518[_0x40ef('0x1e')]],'as':_0x188518['as'],'attributes':_0x188518['attributes'],'include':_0x188518[_0x40ef('0x1d')]?_['map'](_0x188518['include'],function(_0x86efc9){return{'model':db[_0x86efc9[_0x40ef('0x1e')]],'as':_0x86efc9['as'],'attributes':_0x86efc9['attributes'],'include':_0x86efc9[_0x40ef('0x1d')]?_['map'](_0x86efc9['include'],function(_0x2474cf){return{'model':db[_0x2474cf[_0x40ef('0x1e')]],'as':_0x2474cf['as'],'attributes':_0x2474cf[_0x40ef('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x40ef('0xd')](function(_0x471f12){logger[_0x40ef('0xe')]('GetCmHopper',_0x3d1134);logger[_0x40ef('0x1f')](_0x40ef('0x17'),_0x3d1134,JSON[_0x40ef('0x10')](_0x471f12));_0x2395e4(_0x471f12);})[_0x40ef('0x16')](function(_0x17413d){logger[_0x40ef('0x11')](_0x40ef('0x17'),_0x17413d[_0x40ef('0x14')],_0x3d1134);_0x551d4f(_0x39f3b6[_0x40ef('0x11')](0x1f4,_0x17413d[_0x40ef('0x14')]));});});};exports[_0x40ef('0x20')]=function(_0x2eae01){var _0x306bc0=this;return new Promise(function(_0x56e9d7,_0x549801){return db[_0x40ef('0x21')][_0x40ef('0x22')]({'raw':_0x2eae01[_0x40ef('0x1a')]?_0x2eae01[_0x40ef('0x1a')][_0x40ef('0x19')]===undefined?!![]:![]:!![],'where':_0x2eae01[_0x40ef('0x1a')]?_0x2eae01[_0x40ef('0x1a')]['where']||null:null,'attributes':_0x2eae01['options']?_0x2eae01[_0x40ef('0x1a')][_0x40ef('0x1b')]||null:null,'include':_0x2eae01[_0x40ef('0x1a')]?_0x2eae01[_0x40ef('0x1a')]['include']?_['map'](_0x2eae01['options']['include'],function(_0x5cc539){return{'model':db[_0x5cc539[_0x40ef('0x1e')]],'as':_0x5cc539['as'],'attributes':_0x5cc539[_0x40ef('0x1b')],'include':_0x5cc539[_0x40ef('0x1d')]?_[_0x40ef('0x23')](_0x5cc539[_0x40ef('0x1d')],function(_0x304601){return{'model':db[_0x304601[_0x40ef('0x1e')]],'as':_0x304601['as'],'attributes':_0x304601[_0x40ef('0x1b')],'include':_0x304601['include']?_[_0x40ef('0x23')](_0x304601[_0x40ef('0x1d')],function(_0x1355b2){return{'model':db[_0x1355b2[_0x40ef('0x1e')]],'as':_0x1355b2['as'],'attributes':_0x1355b2[_0x40ef('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x40ef('0xd')](function(_0x212b22){logger[_0x40ef('0xe')](_0x40ef('0x20'),_0x2eae01);logger[_0x40ef('0x1f')](_0x40ef('0x20'),_0x2eae01,JSON[_0x40ef('0x10')](_0x212b22));_0x56e9d7(_0x212b22);})[_0x40ef('0x16')](function(_0x4461cd){logger[_0x40ef('0x11')](_0x40ef('0x20'),_0x4461cd[_0x40ef('0x14')],_0x2eae01);_0x549801(_0x306bc0[_0x40ef('0x11')](0x1f4,_0x4461cd['message']));});});};exports['CreateCmHopper']=function(_0x25246e){var _0x39eda2=this;return new Promise(function(_0x23f167,_0x1b8be0){return db['CmHopper']['create'](_0x25246e[_0x40ef('0x24')],{'raw':_0x25246e[_0x40ef('0x1a')]?_0x25246e[_0x40ef('0x1a')][_0x40ef('0x19')]===undefined?!![]:![]:!![]})[_0x40ef('0xd')](function(_0xdbc68){logger['info'](_0x40ef('0x25'),_0x25246e);logger[_0x40ef('0x1f')](_0x40ef('0x25'),_0x25246e,JSON[_0x40ef('0x10')](_0xdbc68));_0x23f167(_0xdbc68);})['catch'](function(_0x4eabe7){logger[_0x40ef('0x11')]('CreateCmHopper',_0x4eabe7[_0x40ef('0x14')],_0x25246e);_0x1b8be0(_0x39eda2[_0x40ef('0x11')](0x1f4,_0x4eabe7['message']));});});};exports[_0x40ef('0x26')]=function(_0x1e8602){var _0x663c12=this;return new Promise(function(_0x544b2c,_0x3487b2){return db[_0x40ef('0x21')][_0x40ef('0x27')](_0x1e8602[_0x40ef('0x24')],{'raw':_0x1e8602[_0x40ef('0x1a')]?_0x1e8602[_0x40ef('0x1a')][_0x40ef('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1e8602[_0x40ef('0x1a')]?_0x1e8602['options'][_0x40ef('0x28')]||null:null,'attributes':_0x1e8602['options']?_0x1e8602[_0x40ef('0x1a')][_0x40ef('0x1b')]||null:null,'limit':_0x1e8602[_0x40ef('0x1a')]?_0x1e8602['options'][_0x40ef('0x1c')]||null:null})[_0x40ef('0xd')](function(_0xbca7c2){logger[_0x40ef('0xe')](_0x40ef('0x26'),_0x1e8602);logger[_0x40ef('0x1f')](_0x40ef('0x26'),_0x1e8602,JSON[_0x40ef('0x10')](_0xbca7c2));_0x544b2c(_0xbca7c2);})[_0x40ef('0x16')](function(_0x50e89c){logger[_0x40ef('0x11')](_0x40ef('0x26'),_0x50e89c[_0x40ef('0x14')],_0x1e8602);_0x3487b2(_0x663c12[_0x40ef('0x11')](0x1f4,_0x50e89c[_0x40ef('0x14')]));});});};exports[_0x40ef('0x29')]=function(_0x53dd0a){var _0x498ba7=this;return new Promise(function(_0x44a488,_0x475cc8){return db[_0x40ef('0x21')]['destroy']({'where':_0x53dd0a['options']?_0x53dd0a['options'][_0x40ef('0x28')]||null:null})['then'](function(_0x4653e4){logger[_0x40ef('0xe')](_0x40ef('0x29'),_0x53dd0a);logger[_0x40ef('0x1f')](_0x40ef('0x29'),_0x53dd0a,JSON[_0x40ef('0x10')](_0x4653e4));_0x44a488(_0x4653e4);})[_0x40ef('0x16')](function(_0x5cb16c){logger['error'](_0x40ef('0x29'),_0x5cb16c[_0x40ef('0x14')],_0x53dd0a);_0x475cc8(_0x498ba7[_0x40ef('0x11')](0x1f4,_0x5cb16c[_0x40ef('0x14')]));});});};exports[_0x40ef('0x2a')]=function(_0x28a643){var _0x3b28b6=this;return new Promise(function(_0x38c096,_0xd6e7de){return db[_0x40ef('0x2b')][_0x40ef('0x2c')]()[_0x40ef('0xd')](function(_0x13dc4c){return db[_0x40ef('0x2d')][_0x40ef('0x2e')](function(_0x422784){return db[_0x40ef('0x21')][_0x40ef('0x18')]({'where':_0x28a643[_0x40ef('0x1a')]?_0x28a643[_0x40ef('0x1a')]['where']||null:null,'attributes':_0x28a643[_0x40ef('0x1a')]?_0x28a643[_0x40ef('0x1a')][_0x40ef('0x1b')]||null:null,'limit':_0x28a643[_0x40ef('0x1a')]?_0x28a643[_0x40ef('0x1a')]['limit']||null:null,'order':_0x28a643['options']?_0x28a643[_0x40ef('0x1a')][_0x40ef('0x2f')]||null:null,'transaction':_0x422784,'lock':_0x422784['LOCK']['UPDATE'],'include':[{'model':db[_0x40ef('0x2b')],'as':_0x40ef('0x30'),'attributes':_['keys'](_0x13dc4c)},{'model':db[_0x40ef('0x31')],'as':_0x40ef('0x32'),'attributes':['id',_0x40ef('0x33'),_0x40ef('0x34')]}]})[_0x40ef('0xd')](function(_0x5b54fa){var _0xe371db=[];var _0x387e57=[];for(var _0x1b9096=0x0;_0x1b9096<_0x5b54fa['length'];_0x1b9096+=0x1){var _0x2c8645=_0x5b54fa[_0x1b9096][_0x40ef('0x35')];if(_0x2c8645===null){_0xe371db[_0x40ef('0x36')](_0x5b54fa[_0x1b9096]['update'](_0x28a643[_0x40ef('0x24')],{'transaction':_0x422784}));}else if(!_0x387e57[_0x40ef('0x37')](_0x2c8645)){_0x387e57['push'](_0x2c8645);_0xe371db[_0x40ef('0x36')](_0x5b54fa[_0x1b9096][_0x40ef('0x27')](_0x28a643[_0x40ef('0x24')],{'transaction':_0x422784}));}}return BPromise[_0x40ef('0x38')](_0xe371db);});})[_0x40ef('0xd')](function(_0x138af7){logger['info'](_0x40ef('0x2a'),_0x28a643);logger[_0x40ef('0x1f')]('GetContactDialer',_0x28a643,JSON['stringify'](_0x138af7));_0x38c096(_0x138af7);})[_0x40ef('0x16')](function(_0x20b417){logger[_0x40ef('0x11')](_0x40ef('0x2a'),_0x20b417[_0x40ef('0x14')],_0x28a643);_0xd6e7de(_0x3b28b6[_0x40ef('0x11')](0x1f4,_0x20b417['message']));});});});};exports['MoveContactManagedDialer']=function(_0x12e36f){var _0x3a91c0=this;return new Promise(function(_0x4c0142,_0x1fec99){return db['sequelize'][_0x40ef('0x2e')](function(_0x3a22a1){return db[_0x40ef('0x39')][_0x40ef('0x3a')](_0x12e36f[_0x40ef('0x24')],{'raw':_0x12e36f[_0x40ef('0x1a')]?_0x12e36f[_0x40ef('0x1a')][_0x40ef('0x19')]===undefined?!![]:![]:!![],'transaction':_0x3a22a1})[_0x40ef('0xd')](function(){return db[_0x40ef('0x21')][_0x40ef('0x3b')]({'where':_0x12e36f['options']?_0x12e36f['options'][_0x40ef('0x28')]||null:null,'transaction':_0x3a22a1});});})[_0x40ef('0xd')](function(_0x2e06f5){logger[_0x40ef('0xe')](_0x40ef('0x3c'),_0x12e36f);logger[_0x40ef('0x1f')]('MoveContactManagedDialer',_0x12e36f,JSON['stringify'](_0x2e06f5));_0x4c0142(_0x2e06f5);})[_0x40ef('0x16')](function(_0x3726dc){logger['error'](_0x40ef('0x3c'),_0x3726dc[_0x40ef('0x14')],_0x12e36f);_0x1fec99(_0x3a91c0[_0x40ef('0x11')](0x1f4,_0x3726dc[_0x40ef('0x14')]));});});};exports[_0x40ef('0x3d')]=function(_0x13a201){var _0x43d78c=this;return new Promise(function(_0x2221a2,_0x4a3567){return db['CmHopper'][_0x40ef('0x18')]({'raw':_0x13a201['options']?_0x13a201[_0x40ef('0x1a')][_0x40ef('0x19')]===undefined?!![]:![]:!![],'where':_0x13a201[_0x40ef('0x1a')]?_0x13a201[_0x40ef('0x1a')][_0x40ef('0x28')]||null:null,'attributes':[[db[_0x40ef('0x2d')]['fn'](_0x40ef('0x3e'),db[_0x40ef('0x2d')]['fn']('IF',db[_0x40ef('0x2d')][_0x40ef('0x3f')](_0x40ef('0x40')+util[_0x40ef('0x41')](_0x40ef('0x42'),moment()[_0x40ef('0x41')]('YYYY-MM-DD\x20HH:mm:ss'))+_0x40ef('0x43')))),_0x40ef('0x44')]]})[_0x40ef('0xd')](function(_0x371016){logger[_0x40ef('0xe')]('CountReScheduled',_0x13a201);logger[_0x40ef('0x1f')]('CountReScheduled',_0x13a201,JSON[_0x40ef('0x10')](_0x371016));_0x2221a2(_0x371016);})[_0x40ef('0x16')](function(_0x323976){logger[_0x40ef('0x11')](_0x40ef('0x3d'),_0x323976['message'],_0x13a201);_0x4a3567(_0x43d78c[_0x40ef('0x11')](0x1f4,_0x323976[_0x40ef('0x14')]));});});};exports['GetContactRecallMe']=function(_0x795397){var _0x5e9119=this;return new Promise(function(_0x362585,_0x4536c6){return db[_0x40ef('0x2b')][_0x40ef('0x2c')]()[_0x40ef('0xd')](function(_0x24e362){return db[_0x40ef('0x2d')]['transaction'](function(_0x267b47){return db[_0x40ef('0x21')][_0x40ef('0x18')]({'where':_0x795397[_0x40ef('0x1a')]?_0x795397[_0x40ef('0x1a')]['where']||null:null,'attributes':_0x795397[_0x40ef('0x1a')]?_0x795397[_0x40ef('0x1a')][_0x40ef('0x1b')]||null:null,'limit':0x1,'order':_0x795397[_0x40ef('0x1a')]?_0x795397[_0x40ef('0x1a')][_0x40ef('0x2f')]||null:null,'group':db[_0x40ef('0x21')][_0x40ef('0x35')],'transaction':_0x267b47,'lock':_0x267b47[_0x40ef('0x45')][_0x40ef('0x46')],'include':_0x795397[_0x40ef('0x1a')]?_0x795397[_0x40ef('0x1a')][_0x40ef('0x1d')]?_[_0x40ef('0x23')](_0x795397[_0x40ef('0x1a')][_0x40ef('0x1d')],function(_0x14489e){return{'model':db[_0x14489e[_0x40ef('0x1e')]],'as':_0x14489e['as'],'attributes':_0x14489e[_0x40ef('0x1b')],'include':_0x14489e[_0x40ef('0x1d')]?_[_0x40ef('0x23')](_0x14489e[_0x40ef('0x1d')],function(_0x4f79c2){return{'model':db[_0x4f79c2[_0x40ef('0x1e')]],'as':_0x4f79c2['as'],'attributes':_0x4f79c2[_0x40ef('0x1b')],'include':_0x4f79c2[_0x40ef('0x1d')]?_[_0x40ef('0x23')](_0x4f79c2[_0x40ef('0x1d')],function(_0x2becb0){return{'model':db[_0x2becb0[_0x40ef('0x1e')]],'as':_0x2becb0['as'],'attributes':_0x2becb0['attributes']};}):[]};}):[]};}):[]:[]})[_0x40ef('0xd')](function(_0x1b0ac2){var _0xc533aa=[];for(var _0x477f9f=0x0;_0x477f9f<_0x1b0ac2[_0x40ef('0x47')];_0x477f9f+=0x1){_0xc533aa[_0x40ef('0x36')](_0x1b0ac2[_0x477f9f][_0x40ef('0x27')](_0x795397['body'],{'transaction':_0x267b47}));}return BPromise[_0x40ef('0x38')](_0xc533aa);});})[_0x40ef('0xd')](function(_0x1caa34){logger[_0x40ef('0xe')]('GetContactRecallMe',_0x795397);logger[_0x40ef('0x1f')](_0x40ef('0x48'),_0x795397,JSON[_0x40ef('0x10')](_0x1caa34));_0x362585(_0x1caa34);})[_0x40ef('0x16')](function(_0x3029bf){logger[_0x40ef('0x11')](_0x40ef('0x48'),_0x3029bf[_0x40ef('0x14')],_0x795397);_0x4536c6(_0x5e9119[_0x40ef('0x11')](0x1f4,_0x3029bf[_0x40ef('0x14')]));});});});};exports['GetCmHopperPreview']=function(_0x29ef48){var _0x114627=this;return new Promise(function(_0x1fea47,_0x3b82e3){db[_0x40ef('0x2b')][_0x40ef('0x2c')]()[_0x40ef('0xd')](function(_0x54ee5c){return db['CmHopper']['findAll']({'raw':_0x29ef48['options']?_0x29ef48[_0x40ef('0x1a')][_0x40ef('0x19')]===undefined?!![]:![]:!![],'where':_0x29ef48[_0x40ef('0x1a')]?_0x29ef48[_0x40ef('0x1a')][_0x40ef('0x28')]||null:null,'attributes':_0x29ef48['options']?_0x29ef48[_0x40ef('0x1a')][_0x40ef('0x1b')]||null:null,'limit':_0x29ef48[_0x40ef('0x1a')]?_0x29ef48[_0x40ef('0x1a')]['limit']||null:null,'include':_0x29ef48[_0x40ef('0x1a')]?_0x29ef48[_0x40ef('0x1a')][_0x40ef('0x1d')]?_[_0x40ef('0x23')](_0x29ef48['options'][_0x40ef('0x1d')],function(_0x459f69){return{'model':db[_0x459f69[_0x40ef('0x1e')]],'as':_0x459f69['as'],'attributes':_0x459f69['as']===_0x40ef('0x30')?_[_0x40ef('0x49')](_0x54ee5c):_0x459f69[_0x40ef('0x1b')],'include':_0x459f69[_0x40ef('0x1d')]?_[_0x40ef('0x23')](_0x459f69[_0x40ef('0x1d')],function(_0x4747a3){return{'model':db[_0x4747a3[_0x40ef('0x1e')]],'as':_0x4747a3['as'],'attributes':_0x4747a3[_0x40ef('0x1b')],'include':_0x4747a3['include']?_[_0x40ef('0x23')](_0x4747a3['include'],function(_0x56e17a){return{'model':db[_0x56e17a[_0x40ef('0x1e')]],'as':_0x56e17a['as'],'attributes':_0x56e17a['attributes']};}):[]};}):[]};}):[]:[]})[_0x40ef('0xd')](function(_0x1afcdf){logger[_0x40ef('0xe')](_0x40ef('0x17'),_0x29ef48);logger[_0x40ef('0x1f')](_0x40ef('0x17'),_0x29ef48,JSON[_0x40ef('0x10')](_0x1afcdf));_0x1fea47(_0x1afcdf);})[_0x40ef('0x16')](function(_0xbad852){logger[_0x40ef('0x11')](_0x40ef('0x17'),_0xbad852[_0x40ef('0x14')],_0x29ef48);_0x3b82e3(_0x114627[_0x40ef('0x11')](0x1f4,_0xbad852[_0x40ef('0x14')]));});});});}; \ No newline at end of file +var _0x7165=['update','body','UpdateCmHopper','DestroyCmHopper','destroy','GetContactDialer','CmContact','describe','sequelize','transaction','order','LOCK','UPDATE','keys','name','push','includes','MoveContactManagedDialer','CmHopperFinal','CountReScheduled','COUNT','literal','`scheduledat`\x20>=\x20','format','\x22%s\x22','\x20,\x201,\x20null','contactsRescheduled','all','GetContactRecallMe','GetCmHopperPreview','Contact','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','info','CmHopper,\x20%s,\x20%s','debug','CmHopper,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','GetCmHopper','CmHopper','findAll','options','where','limit','include','map','model','attributes','then','ShowCmHopper','raw','stringify','CreateCmHopper','create'];(function(_0x109162,_0x277970){var _0x458fd2=function(_0x518f54){while(--_0x518f54){_0x109162['push'](_0x109162['shift']());}};_0x458fd2(++_0x277970);}(_0x7165,0xa7));var _0x5716=function(_0x5afa42,_0x30a006){_0x5afa42=_0x5afa42-0x0;var _0x10e567=_0x7165[_0x5afa42];return _0x10e567;};'use strict';var _=require('lodash');var util=require(_0x5716('0x0'));var moment=require(_0x5716('0x1'));var BPromise=require(_0x5716('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5716('0x3'));var db=require(_0x5716('0x4'))['db'];var utils=require(_0x5716('0x5'));var logger=require('../../config/logger')(_0x5716('0x6'));var config=require(_0x5716('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x5716('0x8')][_0x5716('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1d18d6,_0x4ea1d1,_0xfbc63d){return new BPromise(function(_0x2abe84,_0x477c79){return client[_0x5716('0xa')](_0x1d18d6,_0xfbc63d)['then'](function(_0x4a3f99){logger[_0x5716('0xb')](_0x5716('0xc'),_0x4ea1d1,'request\x20sent');logger[_0x5716('0xd')](_0x5716('0xe'),_0x4ea1d1,_0x5716('0xf'),JSON['stringify'](_0x4a3f99));if(_0x4a3f99[_0x5716('0x10')]){if(_0x4a3f99['error'][_0x5716('0x11')]===0x1f4){logger[_0x5716('0x10')](_0x5716('0xc'),_0x4ea1d1,_0x4a3f99[_0x5716('0x10')][_0x5716('0x12')]);return _0x477c79(_0x4a3f99['error'][_0x5716('0x12')]);}logger[_0x5716('0x10')](_0x5716('0xc'),_0x4ea1d1,_0x4a3f99[_0x5716('0x10')][_0x5716('0x12')]);return _0x2abe84(_0x4a3f99[_0x5716('0x10')][_0x5716('0x12')]);}else{logger[_0x5716('0xb')]('CmHopper,\x20%s,\x20%s',_0x4ea1d1,'request\x20sent');_0x2abe84(_0x4a3f99[_0x5716('0x13')]['message']);}})[_0x5716('0x14')](function(_0x1d5f51){logger[_0x5716('0x10')](_0x5716('0xc'),_0x4ea1d1,_0x1d5f51);_0x477c79(_0x1d5f51);});});}exports[_0x5716('0x15')]=function(_0xc32abe){var _0x3bde1d=this;return new Promise(function(_0x143b45,_0x4e722a){return db[_0x5716('0x16')][_0x5716('0x17')]({'raw':_0xc32abe[_0x5716('0x18')]?_0xc32abe[_0x5716('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0xc32abe[_0x5716('0x18')]?_0xc32abe[_0x5716('0x18')][_0x5716('0x19')]||null:null,'attributes':_0xc32abe[_0x5716('0x18')]?_0xc32abe['options']['attributes']||null:null,'limit':_0xc32abe[_0x5716('0x18')]?_0xc32abe[_0x5716('0x18')][_0x5716('0x1a')]||null:null,'include':_0xc32abe[_0x5716('0x18')]?_0xc32abe[_0x5716('0x18')][_0x5716('0x1b')]?_[_0x5716('0x1c')](_0xc32abe[_0x5716('0x18')][_0x5716('0x1b')],function(_0xb60a2a){return{'model':db[_0xb60a2a[_0x5716('0x1d')]],'as':_0xb60a2a['as'],'attributes':_0xb60a2a[_0x5716('0x1e')],'include':_0xb60a2a[_0x5716('0x1b')]?_['map'](_0xb60a2a['include'],function(_0x227f03){return{'model':db[_0x227f03[_0x5716('0x1d')]],'as':_0x227f03['as'],'attributes':_0x227f03[_0x5716('0x1e')],'include':_0x227f03[_0x5716('0x1b')]?_['map'](_0x227f03[_0x5716('0x1b')],function(_0x589bfe){return{'model':db[_0x589bfe[_0x5716('0x1d')]],'as':_0x589bfe['as'],'attributes':_0x589bfe[_0x5716('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x5716('0x1f')](function(_0xa2ca70){logger[_0x5716('0xb')]('GetCmHopper',_0xc32abe);logger['debug'](_0x5716('0x15'),_0xc32abe,JSON['stringify'](_0xa2ca70));_0x143b45(_0xa2ca70);})[_0x5716('0x14')](function(_0x563bdd){logger['error'](_0x5716('0x15'),_0x563bdd[_0x5716('0x12')],_0xc32abe);_0x4e722a(_0x3bde1d['error'](0x1f4,_0x563bdd[_0x5716('0x12')]));});});};exports[_0x5716('0x20')]=function(_0x3fc767){var _0x512efe=this;return new Promise(function(_0x5c9738,_0x7c3f52){return db[_0x5716('0x16')]['find']({'raw':_0x3fc767[_0x5716('0x18')]?_0x3fc767[_0x5716('0x18')][_0x5716('0x21')]===undefined?!![]:![]:!![],'where':_0x3fc767['options']?_0x3fc767[_0x5716('0x18')][_0x5716('0x19')]||null:null,'attributes':_0x3fc767[_0x5716('0x18')]?_0x3fc767['options'][_0x5716('0x1e')]||null:null,'include':_0x3fc767[_0x5716('0x18')]?_0x3fc767[_0x5716('0x18')]['include']?_[_0x5716('0x1c')](_0x3fc767['options']['include'],function(_0x47a33a){return{'model':db[_0x47a33a[_0x5716('0x1d')]],'as':_0x47a33a['as'],'attributes':_0x47a33a[_0x5716('0x1e')],'include':_0x47a33a['include']?_[_0x5716('0x1c')](_0x47a33a['include'],function(_0x34c84e){return{'model':db[_0x34c84e[_0x5716('0x1d')]],'as':_0x34c84e['as'],'attributes':_0x34c84e[_0x5716('0x1e')],'include':_0x34c84e['include']?_[_0x5716('0x1c')](_0x34c84e[_0x5716('0x1b')],function(_0x53c85c){return{'model':db[_0x53c85c[_0x5716('0x1d')]],'as':_0x53c85c['as'],'attributes':_0x53c85c[_0x5716('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x5716('0x1f')](function(_0x57a21d){logger[_0x5716('0xb')](_0x5716('0x20'),_0x3fc767);logger[_0x5716('0xd')](_0x5716('0x20'),_0x3fc767,JSON[_0x5716('0x22')](_0x57a21d));_0x5c9738(_0x57a21d);})[_0x5716('0x14')](function(_0x40f771){logger[_0x5716('0x10')](_0x5716('0x20'),_0x40f771[_0x5716('0x12')],_0x3fc767);_0x7c3f52(_0x512efe[_0x5716('0x10')](0x1f4,_0x40f771[_0x5716('0x12')]));});});};exports[_0x5716('0x23')]=function(_0x1b34d5){var _0x1ec405=this;return new Promise(function(_0x2d0ddf,_0x4d85d6){return db[_0x5716('0x16')][_0x5716('0x24')](_0x1b34d5['body'],{'raw':_0x1b34d5['options']?_0x1b34d5[_0x5716('0x18')][_0x5716('0x21')]===undefined?!![]:![]:!![]})[_0x5716('0x1f')](function(_0x41d7a5){logger[_0x5716('0xb')](_0x5716('0x23'),_0x1b34d5);logger[_0x5716('0xd')](_0x5716('0x23'),_0x1b34d5,JSON['stringify'](_0x41d7a5));_0x2d0ddf(_0x41d7a5);})['catch'](function(_0x3ce44c){logger[_0x5716('0x10')](_0x5716('0x23'),_0x3ce44c[_0x5716('0x12')],_0x1b34d5);_0x4d85d6(_0x1ec405[_0x5716('0x10')](0x1f4,_0x3ce44c[_0x5716('0x12')]));});});};exports['UpdateCmHopper']=function(_0x36045f){var _0x23d6a9=this;return new Promise(function(_0x559d92,_0x284a89){return db[_0x5716('0x16')][_0x5716('0x25')](_0x36045f[_0x5716('0x26')],{'raw':_0x36045f[_0x5716('0x18')]?_0x36045f[_0x5716('0x18')][_0x5716('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x36045f[_0x5716('0x18')]?_0x36045f['options'][_0x5716('0x19')]||null:null,'attributes':_0x36045f[_0x5716('0x18')]?_0x36045f[_0x5716('0x18')][_0x5716('0x1e')]||null:null,'limit':_0x36045f[_0x5716('0x18')]?_0x36045f[_0x5716('0x18')]['limit']||null:null})['then'](function(_0xf76c3f){logger[_0x5716('0xb')]('UpdateCmHopper',_0x36045f);logger['debug'](_0x5716('0x27'),_0x36045f,JSON['stringify'](_0xf76c3f));_0x559d92(_0xf76c3f);})[_0x5716('0x14')](function(_0x100241){logger[_0x5716('0x10')](_0x5716('0x27'),_0x100241[_0x5716('0x12')],_0x36045f);_0x284a89(_0x23d6a9[_0x5716('0x10')](0x1f4,_0x100241[_0x5716('0x12')]));});});};exports[_0x5716('0x28')]=function(_0x46ce86){var _0x3f9cd2=this;return new Promise(function(_0xe7485,_0xc047f3){return db[_0x5716('0x16')][_0x5716('0x29')]({'where':_0x46ce86[_0x5716('0x18')]?_0x46ce86[_0x5716('0x18')][_0x5716('0x19')]||null:null})['then'](function(_0x5bf77b){logger[_0x5716('0xb')](_0x5716('0x28'),_0x46ce86);logger[_0x5716('0xd')](_0x5716('0x28'),_0x46ce86,JSON[_0x5716('0x22')](_0x5bf77b));_0xe7485(_0x5bf77b);})[_0x5716('0x14')](function(_0xa45464){logger[_0x5716('0x10')](_0x5716('0x28'),_0xa45464[_0x5716('0x12')],_0x46ce86);_0xc047f3(_0x3f9cd2['error'](0x1f4,_0xa45464[_0x5716('0x12')]));});});};exports[_0x5716('0x2a')]=function(_0x2c4ffc){var _0x1508b8=this;return new Promise(function(_0x36980c,_0x3f1459){return db[_0x5716('0x2b')][_0x5716('0x2c')]()[_0x5716('0x1f')](function(_0x2254ec){return db[_0x5716('0x2d')][_0x5716('0x2e')](function(_0x6f2f4c){return db['CmHopper'][_0x5716('0x17')]({'where':_0x2c4ffc[_0x5716('0x18')]?_0x2c4ffc[_0x5716('0x18')]['where']||null:null,'attributes':_0x2c4ffc[_0x5716('0x18')]?_0x2c4ffc[_0x5716('0x18')][_0x5716('0x1e')]||null:null,'limit':_0x2c4ffc[_0x5716('0x18')]?_0x2c4ffc['options'][_0x5716('0x1a')]||null:null,'order':_0x2c4ffc[_0x5716('0x18')]?_0x2c4ffc['options'][_0x5716('0x2f')]||null:null,'transaction':_0x6f2f4c,'lock':_0x6f2f4c[_0x5716('0x30')][_0x5716('0x31')],'include':[{'model':db[_0x5716('0x2b')],'as':'Contact','attributes':_[_0x5716('0x32')](_0x2254ec)},{'model':db['User'],'as':'Agent','attributes':['id',_0x5716('0x33'),'voicePause']}]})[_0x5716('0x1f')](function(_0x1dc32c){var _0x1b6a7a=[];var _0x1b592b=[];for(var _0x3ad292=0x0;_0x3ad292<_0x1dc32c['length'];_0x3ad292+=0x1){var _0x48242d=_0x1dc32c[_0x3ad292]['UserId'];if(_0x48242d===null){_0x1b6a7a[_0x5716('0x34')](_0x1dc32c[_0x3ad292][_0x5716('0x25')](_0x2c4ffc[_0x5716('0x26')],{'transaction':_0x6f2f4c}));}else if(!_0x1b592b[_0x5716('0x35')](_0x48242d)){_0x1b592b[_0x5716('0x34')](_0x48242d);_0x1b6a7a['push'](_0x1dc32c[_0x3ad292][_0x5716('0x25')](_0x2c4ffc[_0x5716('0x26')],{'transaction':_0x6f2f4c}));}}return BPromise['all'](_0x1b6a7a);});})[_0x5716('0x1f')](function(_0x3f2411){logger[_0x5716('0xb')](_0x5716('0x2a'),_0x2c4ffc);logger['debug'](_0x5716('0x2a'),_0x2c4ffc,JSON[_0x5716('0x22')](_0x3f2411));_0x36980c(_0x3f2411);})['catch'](function(_0x31498a){logger[_0x5716('0x10')](_0x5716('0x2a'),_0x31498a[_0x5716('0x12')],_0x2c4ffc);_0x3f1459(_0x1508b8[_0x5716('0x10')](0x1f4,_0x31498a[_0x5716('0x12')]));});});});};exports[_0x5716('0x36')]=function(_0x2d918a){var _0x5a3755=this;return new Promise(function(_0xb92708,_0x5dae0a){return db[_0x5716('0x2d')]['transaction'](function(_0x5b2af2){return db[_0x5716('0x37')][_0x5716('0x24')](_0x2d918a[_0x5716('0x26')],{'raw':_0x2d918a[_0x5716('0x18')]?_0x2d918a[_0x5716('0x18')][_0x5716('0x21')]===undefined?!![]:![]:!![],'transaction':_0x5b2af2})['then'](function(){return db[_0x5716('0x16')][_0x5716('0x29')]({'where':_0x2d918a[_0x5716('0x18')]?_0x2d918a[_0x5716('0x18')][_0x5716('0x19')]||null:null,'transaction':_0x5b2af2});});})[_0x5716('0x1f')](function(_0x235c14){logger[_0x5716('0xb')](_0x5716('0x36'),_0x2d918a);logger['debug'](_0x5716('0x36'),_0x2d918a,JSON[_0x5716('0x22')](_0x235c14));_0xb92708(_0x235c14);})['catch'](function(_0x1c6432){logger['error']('MoveContactManagedDialer',_0x1c6432[_0x5716('0x12')],_0x2d918a);_0x5dae0a(_0x5a3755[_0x5716('0x10')](0x1f4,_0x1c6432[_0x5716('0x12')]));});});};exports[_0x5716('0x38')]=function(_0x1f5671){var _0x5e4e63=this;return new Promise(function(_0x23b6c3,_0x2fbc15){return db['CmHopper']['findAll']({'raw':_0x1f5671[_0x5716('0x18')]?_0x1f5671[_0x5716('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x1f5671[_0x5716('0x18')]?_0x1f5671[_0x5716('0x18')][_0x5716('0x19')]||null:null,'attributes':[[db[_0x5716('0x2d')]['fn'](_0x5716('0x39'),db[_0x5716('0x2d')]['fn']('IF',db['sequelize'][_0x5716('0x3a')](_0x5716('0x3b')+util[_0x5716('0x3c')](_0x5716('0x3d'),moment()['format']('YYYY-MM-DD\x20HH:mm:ss'))+_0x5716('0x3e')))),_0x5716('0x3f')]]})[_0x5716('0x1f')](function(_0x576f83){logger[_0x5716('0xb')](_0x5716('0x38'),_0x1f5671);logger[_0x5716('0xd')]('CountReScheduled',_0x1f5671,JSON[_0x5716('0x22')](_0x576f83));_0x23b6c3(_0x576f83);})[_0x5716('0x14')](function(_0x169f16){logger[_0x5716('0x10')](_0x5716('0x38'),_0x169f16[_0x5716('0x12')],_0x1f5671);_0x2fbc15(_0x5e4e63[_0x5716('0x10')](0x1f4,_0x169f16[_0x5716('0x12')]));});});};exports['GetContactRecallMe']=function(_0x111a2b){var _0x381161=this;return new Promise(function(_0xb35b45,_0x3f0f1d){return db[_0x5716('0x2b')][_0x5716('0x2c')]()[_0x5716('0x1f')](function(_0xc5f96d){return db[_0x5716('0x2d')][_0x5716('0x2e')](function(_0x21880a){return db[_0x5716('0x16')][_0x5716('0x17')]({'where':_0x111a2b['options']?_0x111a2b[_0x5716('0x18')][_0x5716('0x19')]||null:null,'attributes':_0x111a2b['options']?_0x111a2b[_0x5716('0x18')]['attributes']||null:null,'limit':0x1,'order':_0x111a2b[_0x5716('0x18')]?_0x111a2b[_0x5716('0x18')][_0x5716('0x2f')]||null:null,'group':db[_0x5716('0x16')]['UserId'],'transaction':_0x21880a,'lock':_0x21880a[_0x5716('0x30')]['UPDATE'],'include':_0x111a2b[_0x5716('0x18')]?_0x111a2b['options'][_0x5716('0x1b')]?_['map'](_0x111a2b[_0x5716('0x18')][_0x5716('0x1b')],function(_0x28689b){return{'model':db[_0x28689b[_0x5716('0x1d')]],'as':_0x28689b['as'],'attributes':_0x28689b[_0x5716('0x1e')],'include':_0x28689b[_0x5716('0x1b')]?_[_0x5716('0x1c')](_0x28689b[_0x5716('0x1b')],function(_0x2d99ae){return{'model':db[_0x2d99ae[_0x5716('0x1d')]],'as':_0x2d99ae['as'],'attributes':_0x2d99ae['attributes'],'include':_0x2d99ae[_0x5716('0x1b')]?_[_0x5716('0x1c')](_0x2d99ae[_0x5716('0x1b')],function(_0x3c02a3){return{'model':db[_0x3c02a3[_0x5716('0x1d')]],'as':_0x3c02a3['as'],'attributes':_0x3c02a3[_0x5716('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x5716('0x1f')](function(_0x1824b2){var _0x1ac3b6=[];for(var _0x384cf6=0x0;_0x384cf6<_0x1824b2['length'];_0x384cf6+=0x1){_0x1ac3b6[_0x5716('0x34')](_0x1824b2[_0x384cf6]['update'](_0x111a2b[_0x5716('0x26')],{'transaction':_0x21880a}));}return BPromise[_0x5716('0x40')](_0x1ac3b6);});})['then'](function(_0x3e980f){logger[_0x5716('0xb')]('GetContactRecallMe',_0x111a2b);logger[_0x5716('0xd')](_0x5716('0x41'),_0x111a2b,JSON[_0x5716('0x22')](_0x3e980f));_0xb35b45(_0x3e980f);})['catch'](function(_0x22eb63){logger['error'](_0x5716('0x41'),_0x22eb63[_0x5716('0x12')],_0x111a2b);_0x3f0f1d(_0x381161['error'](0x1f4,_0x22eb63[_0x5716('0x12')]));});});});};exports[_0x5716('0x42')]=function(_0x311b83){var _0x3f7e02=this;return new Promise(function(_0x3055ad,_0x1a0774){db['CmContact'][_0x5716('0x2c')]()['then'](function(_0x4d0d64){return db['CmHopper'][_0x5716('0x17')]({'raw':_0x311b83['options']?_0x311b83[_0x5716('0x18')][_0x5716('0x21')]===undefined?!![]:![]:!![],'where':_0x311b83[_0x5716('0x18')]?_0x311b83[_0x5716('0x18')][_0x5716('0x19')]||null:null,'attributes':_0x311b83['options']?_0x311b83[_0x5716('0x18')][_0x5716('0x1e')]||null:null,'limit':_0x311b83[_0x5716('0x18')]?_0x311b83[_0x5716('0x18')][_0x5716('0x1a')]||null:null,'include':_0x311b83['options']?_0x311b83['options'][_0x5716('0x1b')]?_[_0x5716('0x1c')](_0x311b83[_0x5716('0x18')][_0x5716('0x1b')],function(_0x3a6f84){return{'model':db[_0x3a6f84[_0x5716('0x1d')]],'as':_0x3a6f84['as'],'attributes':_0x3a6f84['as']===_0x5716('0x43')?_['keys'](_0x4d0d64):_0x3a6f84['attributes'],'include':_0x3a6f84[_0x5716('0x1b')]?_[_0x5716('0x1c')](_0x3a6f84[_0x5716('0x1b')],function(_0x1d505f){return{'model':db[_0x1d505f['model']],'as':_0x1d505f['as'],'attributes':_0x1d505f[_0x5716('0x1e')],'include':_0x1d505f['include']?_[_0x5716('0x1c')](_0x1d505f[_0x5716('0x1b')],function(_0x2b9658){return{'model':db[_0x2b9658[_0x5716('0x1d')]],'as':_0x2b9658['as'],'attributes':_0x2b9658[_0x5716('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x5716('0x1f')](function(_0x5d4158){logger[_0x5716('0xb')]('GetCmHopper',_0x311b83);logger[_0x5716('0xd')]('GetCmHopper',_0x311b83,JSON['stringify'](_0x5d4158));_0x3055ad(_0x5d4158);})[_0x5716('0x14')](function(_0x4c35f4){logger['error']('GetCmHopper',_0x4c35f4[_0x5716('0x12')],_0x311b83);_0x1a0774(_0x3f7e02[_0x5716('0x10')](0x1f4,_0x4c35f4[_0x5716('0x12')]));});});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index 6eb7e8e..9cae6eb 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 _0x44a1=['./cmHopper.controller','get','index','/describe','isAuthenticated','describe','/opencontacts','getOpenContacts','/:id','show','getPreview','put','update','exports','path','express','Router','../../components/auth/service','../../config/environment'];(function(_0x35c5a8,_0x8ecb48){var _0x34782c=function(_0x1b23ec){while(--_0x1b23ec){_0x35c5a8['push'](_0x35c5a8['shift']());}};_0x34782c(++_0x8ecb48);}(_0x44a1,0x164));var _0x144a=function(_0x8f60d1,_0x15d9cd){_0x8f60d1=_0x8f60d1-0x0;var _0x25d617=_0x44a1[_0x8f60d1];return _0x25d617;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x144a('0x0'));var timeout=require('connect-timeout');var express=require(_0x144a('0x1'));var router=express[_0x144a('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x144a('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x144a('0x4'));var controller=require(_0x144a('0x5'));router[_0x144a('0x6')]('/',auth['isAuthenticated'](),controller[_0x144a('0x7')]);router['get'](_0x144a('0x8'),auth[_0x144a('0x9')](),controller[_0x144a('0xa')]);router['get'](_0x144a('0xb'),auth[_0x144a('0x9')](),controller[_0x144a('0xc')]);router[_0x144a('0x6')](_0x144a('0xd'),auth[_0x144a('0x9')](),controller[_0x144a('0xe')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['post']('/preview',auth[_0x144a('0x9')](),controller[_0x144a('0xf')]);router[_0x144a('0x10')]('/:id',auth[_0x144a('0x9')](),controller[_0x144a('0x11')]);router['delete'](_0x144a('0xd'),auth[_0x144a('0x9')](),controller['destroy']);module[_0x144a('0x12')]=router; \ No newline at end of file +var _0x13f6=['destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','index','/describe','describe','get','/:id','post','create','/preview','getPreview','put','update','delete'];(function(_0x24d2ee,_0x55fe1d){var _0x554421=function(_0x58a9c5){while(--_0x58a9c5){_0x24d2ee['push'](_0x24d2ee['shift']());}};_0x554421(++_0x55fe1d);}(_0x13f6,0x85));var _0x613f=function(_0x1f2491,_0x24297b){_0x1f2491=_0x1f2491-0x0;var _0x14b335=_0x13f6[_0x1f2491];return _0x14b335;};'use strict';var multer=require(_0x613f('0x0'));var util=require(_0x613f('0x1'));var path=require(_0x613f('0x2'));var timeout=require(_0x613f('0x3'));var express=require('express');var router=express[_0x613f('0x4')]();var fs_extra=require(_0x613f('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x613f('0x6'));var config=require(_0x613f('0x7'));var controller=require('./cmHopper.controller');router['get']('/',auth[_0x613f('0x8')](),controller[_0x613f('0x9')]);router['get'](_0x613f('0xa'),auth[_0x613f('0x8')](),controller[_0x613f('0xb')]);router[_0x613f('0xc')]('/opencontacts',auth['isAuthenticated'](),controller['getOpenContacts']);router[_0x613f('0xc')](_0x613f('0xd'),auth[_0x613f('0x8')](),controller['show']);router[_0x613f('0xe')]('/',auth[_0x613f('0x8')](),controller[_0x613f('0xf')]);router[_0x613f('0xe')](_0x613f('0x10'),auth['isAuthenticated'](),controller[_0x613f('0x11')]);router[_0x613f('0x12')](_0x613f('0xd'),auth['isAuthenticated'](),controller[_0x613f('0x13')]);router[_0x613f('0x14')](_0x613f('0xd'),auth[_0x613f('0x8')](),controller[_0x613f('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index 32fa7a8..2647923 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 _0x8147=['INTEGER','contactListQueue','moment','sequelize','STRING'];(function(_0x348184,_0x1526ba){var _0x2dfd4f=function(_0x3999da){while(--_0x3999da){_0x348184['push'](_0x348184['shift']());}};_0x2dfd4f(++_0x1526ba);}(_0x8147,0x179));var _0x7814=function(_0x3069cb,_0x1929df){_0x3069cb=_0x3069cb-0x0;var _0x163c3c=_0x8147[_0x3069cb];return _0x163c3c;};'use strict';var moment=require(_0x7814('0x0'));var Sequelize=require(_0x7814('0x1'));module['exports']={'phone':{'type':Sequelize[_0x7814('0x2')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x7814('0x3')],'unique':_0x7814('0x4')},'ListId':{'type':Sequelize['INTEGER'],'unique':_0x7814('0x4')},'VoiceQueueId':{'type':Sequelize[_0x7814('0x3')],'unique':'contactListQueue'}}; \ No newline at end of file +var _0x9de1=['sequelize','exports','INTEGER','contactListQueue'];(function(_0x3ad9b3,_0x5c76e9){var _0x4ef8d1=function(_0x239036){while(--_0x239036){_0x3ad9b3['push'](_0x3ad9b3['shift']());}};_0x4ef8d1(++_0x5c76e9);}(_0x9de1,0xc4));var _0x19de=function(_0x3ea367,_0x2f2298){_0x3ea367=_0x3ea367-0x0;var _0xbd9607=_0x9de1[_0x3ea367];return _0xbd9607;};'use strict';var moment=require('moment');var Sequelize=require(_0x19de('0x0'));module[_0x19de('0x1')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'ContactId':{'type':Sequelize[_0x19de('0x2')],'unique':_0x19de('0x3')},'ListId':{'type':Sequelize[_0x19de('0x2')],'unique':_0x19de('0x3')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0x19de('0x3')}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index 30b2917..21594b1 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 _0x65fe=['destroy','sendStatus','error','stack','name','index','map','CmHopperBlack','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','include','catch','show','length','includeAll','find','body','params','rimraf','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','end','status','json','offset','count','limit','Content-Range','apply','save','update','then'];(function(_0x3d1dbd,_0x5300f3){var _0xc9b900=function(_0x1ef8f4){while(--_0x1ef8f4){_0x3d1dbd['push'](_0x3d1dbd['shift']());}};_0xc9b900(++_0x5300f3);}(_0x65fe,0x16c));var _0xe65f=function(_0x538d45,_0x2d953){_0x538d45=_0x538d45-0x0;var _0x5d91e5=_0x65fe[_0x538d45];return _0x5d91e5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe65f('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe65f('0x1'));var rp=require(_0xe65f('0x2'));var moment=require(_0xe65f('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xe65f('0x4'));var util=require('util');var path=require(_0xe65f('0x5'));var sox=require(_0xe65f('0x6'));var csv=require(_0xe65f('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe65f('0x8'));var _=require('lodash');var squel=require(_0xe65f('0x9'));var crypto=require(_0xe65f('0xa'));var jsforce=require(_0xe65f('0xb'));var deskjs=require(_0xe65f('0xc'));var toCsv=require(_0xe65f('0x7'));var querystring=require(_0xe65f('0xd'));var Papa=require(_0xe65f('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xe65f('0xf'));var as=require(_0xe65f('0x10'));var hardwareService=require(_0xe65f('0x11'));var logger=require('../../config/logger')(_0xe65f('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xe65f('0x13'));var db=require(_0xe65f('0x14'))['db'];function respondWithStatusCode(_0x1bc227,_0x33c92d){_0x33c92d=_0x33c92d||0xcc;return function(_0x59e718){if(_0x59e718){return _0x1bc227['sendStatus'](_0x33c92d);}return _0x1bc227['status'](_0x33c92d)[_0xe65f('0x15')]();};}function respondWithResult(_0x404b48,_0x2e882e){_0x2e882e=_0x2e882e||0xc8;return function(_0x28213e){if(_0x28213e){return _0x404b48[_0xe65f('0x16')](_0x2e882e)[_0xe65f('0x17')](_0x28213e);}};}function respondWithFilteredResult(_0x2cad72,_0x520489){return function(_0x3b976b){if(_0x3b976b){var _0x3f2a12=typeof _0x520489[_0xe65f('0x18')]==='undefined'&&typeof _0x520489['limit']==='undefined';var _0xb6095a=_0x3b976b[_0xe65f('0x19')];var _0x46fd24=_0x3f2a12?0x0:_0x520489['offset'];var _0x14aa81=_0x3f2a12?_0x3b976b[_0xe65f('0x19')]:_0x520489['offset']+_0x520489[_0xe65f('0x1a')];var _0x54feb2;if(_0x14aa81>=_0xb6095a){_0x14aa81=_0xb6095a;_0x54feb2=0xc8;}else{_0x54feb2=0xce;}_0x2cad72[_0xe65f('0x16')](_0x54feb2);return _0x2cad72['set'](_0xe65f('0x1b'),_0x46fd24+'-'+_0x14aa81+'/'+_0xb6095a)[_0xe65f('0x17')](_0x3b976b);}return null;};}function patchUpdates(_0x1ea409){return function(_0xa1e2bb){try{jsonpatch[_0xe65f('0x1c')](_0xa1e2bb,_0x1ea409,!![]);}catch(_0xe3f438){return BPromise['reject'](_0xe3f438);}return _0xa1e2bb[_0xe65f('0x1d')]();};}function saveUpdates(_0x5ca71d,_0x34f830){return function(_0x5c8df1){if(_0x5c8df1){return _0x5c8df1[_0xe65f('0x1e')](_0x5ca71d)[_0xe65f('0x1f')](function(_0x490696){return _0x490696;});}return null;};}function removeEntity(_0xe26edf,_0x16b885){return function(_0x35be5c){if(_0x35be5c){return _0x35be5c[_0xe65f('0x20')]()[_0xe65f('0x1f')](function(){_0xe26edf[_0xe65f('0x16')](0xcc)[_0xe65f('0x15')]();});}};}function handleEntityNotFound(_0x3309b6,_0x51188c){return function(_0x5c1115){if(!_0x5c1115){_0x3309b6[_0xe65f('0x21')](0x194);}return _0x5c1115;};}function handleError(_0x58b8ae,_0x52b494){_0x52b494=_0x52b494||0x1f4;return function(_0x5e2b08){logger[_0xe65f('0x22')](_0x5e2b08[_0xe65f('0x23')]);if(_0x5e2b08[_0xe65f('0x24')]){delete _0x5e2b08['name'];}_0x58b8ae[_0xe65f('0x16')](_0x52b494)['send'](_0x5e2b08);};}exports[_0xe65f('0x25')]=function(_0x3674e7,_0xbef71){var _0x31b133={},_0x596a12={},_0x36ba07={'count':0x0,'rows':[]};var _0x183e5c=_[_0xe65f('0x26')](db[_0xe65f('0x27')][_0xe65f('0x28')],function(_0x2999b0){return{'name':_0x2999b0[_0xe65f('0x29')],'type':_0x2999b0['type']['key']};});_0x596a12[_0xe65f('0x2a')]=_[_0xe65f('0x26')](_0x183e5c,'name');_0x596a12[_0xe65f('0x2b')]=_[_0xe65f('0x2c')](_0x3674e7[_0xe65f('0x2b')]);_0x596a12[_0xe65f('0x2d')]=_[_0xe65f('0x2e')](_0x596a12[_0xe65f('0x2a')],_0x596a12[_0xe65f('0x2b')]);_0x31b133[_0xe65f('0x2f')]=_[_0xe65f('0x2e')](_0x596a12['model'],qs[_0xe65f('0x30')](_0x3674e7['query']['fields']));_0x31b133[_0xe65f('0x2f')]=_0x31b133[_0xe65f('0x2f')]['length']?_0x31b133[_0xe65f('0x2f')]:_0x596a12[_0xe65f('0x2a')];if(!_0x3674e7[_0xe65f('0x2b')][_0xe65f('0x31')](_0xe65f('0x32'))){_0x31b133[_0xe65f('0x1a')]=qs[_0xe65f('0x1a')](_0x3674e7['query']['limit']);_0x31b133[_0xe65f('0x18')]=qs[_0xe65f('0x18')](_0x3674e7[_0xe65f('0x2b')][_0xe65f('0x18')]);}_0x31b133[_0xe65f('0x33')]=qs[_0xe65f('0x34')](_0x3674e7[_0xe65f('0x2b')][_0xe65f('0x34')]);_0x31b133['where']=qs[_0xe65f('0x2d')](_[_0xe65f('0x35')](_0x3674e7[_0xe65f('0x2b')],_0x596a12[_0xe65f('0x2d')]),_0x183e5c);if(_0x3674e7[_0xe65f('0x2b')][_0xe65f('0x36')]){_0x31b133[_0xe65f('0x37')]=_[_0xe65f('0x38')](_0x31b133['where'],{'$or':_[_0xe65f('0x26')](_0x183e5c,function(_0x19e9b5){if(_0x19e9b5['type']!=='VIRTUAL'){var _0xecc0b7={};_0xecc0b7[_0x19e9b5['name']]={'$like':'%'+_0x3674e7[_0xe65f('0x2b')][_0xe65f('0x36')]+'%'};return _0xecc0b7;}})});}_0x31b133=_[_0xe65f('0x38')]({},_0x31b133,_0x3674e7[_0xe65f('0x39')]);var _0x39ef7f={'where':_0x31b133[_0xe65f('0x37')]};return db[_0xe65f('0x27')][_0xe65f('0x19')](_0x39ef7f)[_0xe65f('0x1f')](function(_0x5b3021){_0x36ba07[_0xe65f('0x19')]=_0x5b3021;if(_0x3674e7['query']['includeAll']){_0x31b133[_0xe65f('0x3a')]=[{'all':!![]}];}return db['CmHopperBlack']['findAll'](_0x31b133);})['then'](function(_0x2cf09c){_0x36ba07['rows']=_0x2cf09c;return _0x36ba07;})['then'](respondWithFilteredResult(_0xbef71,_0x31b133))[_0xe65f('0x3b')](handleError(_0xbef71,null));};exports[_0xe65f('0x3c')]=function(_0x13eaf9,_0x38291f){var _0x473553={'raw':!![],'where':{'id':_0x13eaf9['params']['id']}},_0x1e9d96={};_0x1e9d96[_0xe65f('0x2a')]=_[_0xe65f('0x2c')](db['CmHopperBlack'][_0xe65f('0x28')]);_0x1e9d96[_0xe65f('0x2b')]=_['keys'](_0x13eaf9[_0xe65f('0x2b')]);_0x1e9d96['filters']=_[_0xe65f('0x2e')](_0x1e9d96[_0xe65f('0x2a')],_0x1e9d96[_0xe65f('0x2b')]);_0x473553[_0xe65f('0x2f')]=_[_0xe65f('0x2e')](_0x1e9d96['model'],qs[_0xe65f('0x30')](_0x13eaf9['query'][_0xe65f('0x30')]));_0x473553[_0xe65f('0x2f')]=_0x473553[_0xe65f('0x2f')][_0xe65f('0x3d')]?_0x473553['attributes']:_0x1e9d96['model'];if(_0x13eaf9[_0xe65f('0x2b')][_0xe65f('0x3e')]){_0x473553[_0xe65f('0x3a')]=[{'all':!![]}];}_0x473553=_[_0xe65f('0x38')]({},_0x473553,_0x13eaf9['options']);return db[_0xe65f('0x27')][_0xe65f('0x3f')](_0x473553)[_0xe65f('0x1f')](handleEntityNotFound(_0x38291f,null))[_0xe65f('0x1f')](respondWithResult(_0x38291f,null))['catch'](handleError(_0x38291f,null));};exports[_0xe65f('0x1e')]=function(_0x315a26,_0x154332){if(_0x315a26[_0xe65f('0x40')]['id']){delete _0x315a26[_0xe65f('0x40')]['id'];}return db[_0xe65f('0x27')][_0xe65f('0x3f')]({'where':{'id':_0x315a26['params']['id']}})[_0xe65f('0x1f')](handleEntityNotFound(_0x154332,null))[_0xe65f('0x1f')](saveUpdates(_0x315a26[_0xe65f('0x40')],null))['then'](respondWithResult(_0x154332,null))[_0xe65f('0x3b')](handleError(_0x154332,null));};exports[_0xe65f('0x20')]=function(_0x5c6111,_0x389596){return db[_0xe65f('0x27')][_0xe65f('0x3f')]({'where':{'id':_0x5c6111[_0xe65f('0x41')]['id']}})[_0xe65f('0x1f')](handleEntityNotFound(_0x389596,null))[_0xe65f('0x1f')](removeEntity(_0x389596,null))[_0xe65f('0x3b')](handleError(_0x389596,null));};exports['describe']=function(_0x3ad5e5,_0x5903e8){return db[_0xe65f('0x27')]['describe']()[_0xe65f('0x1f')](respondWithResult(_0x5903e8,null))['catch'](handleError(_0x5903e8,null));}; \ No newline at end of file +var _0x27f5=['mustache','util','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','undefined','limit','offset','count','Content-Range','json','apply','reject','save','then','destroy','sendStatus','error','name','send','map','CmHopperBlack','rawAttributes','query','keys','filters','intersection','model','fields','attributes','nolimit','order','sort','where','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','length','update','body','find','eml-format','rimraf','zip-dir','fast-json-patch','bluebird'];(function(_0x2454ec,_0xd09694){var _0x301164=function(_0x5e81e1){while(--_0x5e81e1){_0x2454ec['push'](_0x2454ec['shift']());}};_0x301164(++_0xd09694);}(_0x27f5,0x85));var _0x527f=function(_0x45c9f4,_0x2eec90){_0x45c9f4=_0x45c9f4-0x0;var _0x1f9be9=_0x27f5[_0x45c9f4];return _0x1f9be9;};'use strict';var emlformat=require(_0x527f('0x0'));var rimraf=require(_0x527f('0x1'));var zipdir=require(_0x527f('0x2'));var jsonpatch=require(_0x527f('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x527f('0x4'));var Mustache=require(_0x527f('0x5'));var util=require(_0x527f('0x6'));var path=require('path');var sox=require(_0x527f('0x7'));var csv=require(_0x527f('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x527f('0x9'));var _=require('lodash');var squel=require(_0x527f('0xa'));var crypto=require(_0x527f('0xb'));var jsforce=require(_0x527f('0xc'));var deskjs=require(_0x527f('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x527f('0xe'));var Redis=require('ioredis');var authService=require(_0x527f('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x527f('0x10'));var logger=require(_0x527f('0x11'))(_0x527f('0x12'));var utils=require(_0x527f('0x13'));var config=require(_0x527f('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x527f('0x15'))['db'];function respondWithStatusCode(_0x4d9650,_0x49de95){_0x49de95=_0x49de95||0xcc;return function(_0xf2da1e){if(_0xf2da1e){return _0x4d9650['sendStatus'](_0x49de95);}return _0x4d9650[_0x527f('0x16')](_0x49de95)[_0x527f('0x17')]();};}function respondWithResult(_0x434f58,_0x41258f){_0x41258f=_0x41258f||0xc8;return function(_0x5c711f){if(_0x5c711f){return _0x434f58[_0x527f('0x16')](_0x41258f)['json'](_0x5c711f);}};}function respondWithFilteredResult(_0x3b8303,_0x405cc7){return function(_0x168ba6){if(_0x168ba6){var _0x534564=typeof _0x405cc7['offset']===_0x527f('0x18')&&typeof _0x405cc7[_0x527f('0x19')]===_0x527f('0x18');var _0x1f421c=_0x168ba6['count'];var _0x2c8ad8=_0x534564?0x0:_0x405cc7[_0x527f('0x1a')];var _0x3fe96f=_0x534564?_0x168ba6[_0x527f('0x1b')]:_0x405cc7[_0x527f('0x1a')]+_0x405cc7[_0x527f('0x19')];var _0x57a769;if(_0x3fe96f>=_0x1f421c){_0x3fe96f=_0x1f421c;_0x57a769=0xc8;}else{_0x57a769=0xce;}_0x3b8303['status'](_0x57a769);return _0x3b8303['set'](_0x527f('0x1c'),_0x2c8ad8+'-'+_0x3fe96f+'/'+_0x1f421c)[_0x527f('0x1d')](_0x168ba6);}return null;};}function patchUpdates(_0x181dd5){return function(_0x30144b){try{jsonpatch[_0x527f('0x1e')](_0x30144b,_0x181dd5,!![]);}catch(_0x5c72cd){return BPromise[_0x527f('0x1f')](_0x5c72cd);}return _0x30144b[_0x527f('0x20')]();};}function saveUpdates(_0x55446b,_0x5da97e){return function(_0x44a872){if(_0x44a872){return _0x44a872['update'](_0x55446b)[_0x527f('0x21')](function(_0x255804){return _0x255804;});}return null;};}function removeEntity(_0x4520e3,_0xb79982){return function(_0x522bde){if(_0x522bde){return _0x522bde[_0x527f('0x22')]()[_0x527f('0x21')](function(){_0x4520e3[_0x527f('0x16')](0xcc)[_0x527f('0x17')]();});}};}function handleEntityNotFound(_0x3c79ba,_0x597504){return function(_0x3f829a){if(!_0x3f829a){_0x3c79ba[_0x527f('0x23')](0x194);}return _0x3f829a;};}function handleError(_0x36cc,_0xe36d84){_0xe36d84=_0xe36d84||0x1f4;return function(_0x10614b){logger[_0x527f('0x24')](_0x10614b['stack']);if(_0x10614b[_0x527f('0x25')]){delete _0x10614b[_0x527f('0x25')];}_0x36cc[_0x527f('0x16')](_0xe36d84)[_0x527f('0x26')](_0x10614b);};}exports['index']=function(_0x671f47,_0x32a8ff){var _0xd07e5a={},_0xf7f43d={},_0x46b175={'count':0x0,'rows':[]};var _0x429b6c=_[_0x527f('0x27')](db[_0x527f('0x28')][_0x527f('0x29')],function(_0x42e6e3){return{'name':_0x42e6e3['fieldName'],'type':_0x42e6e3['type']['key']};});_0xf7f43d['model']=_[_0x527f('0x27')](_0x429b6c,_0x527f('0x25'));_0xf7f43d[_0x527f('0x2a')]=_[_0x527f('0x2b')](_0x671f47[_0x527f('0x2a')]);_0xf7f43d[_0x527f('0x2c')]=_[_0x527f('0x2d')](_0xf7f43d[_0x527f('0x2e')],_0xf7f43d[_0x527f('0x2a')]);_0xd07e5a['attributes']=_['intersection'](_0xf7f43d[_0x527f('0x2e')],qs[_0x527f('0x2f')](_0x671f47[_0x527f('0x2a')][_0x527f('0x2f')]));_0xd07e5a[_0x527f('0x30')]=_0xd07e5a[_0x527f('0x30')]['length']?_0xd07e5a[_0x527f('0x30')]:_0xf7f43d[_0x527f('0x2e')];if(!_0x671f47[_0x527f('0x2a')]['hasOwnProperty'](_0x527f('0x31'))){_0xd07e5a['limit']=qs[_0x527f('0x19')](_0x671f47[_0x527f('0x2a')][_0x527f('0x19')]);_0xd07e5a['offset']=qs[_0x527f('0x1a')](_0x671f47[_0x527f('0x2a')]['offset']);}_0xd07e5a[_0x527f('0x32')]=qs[_0x527f('0x33')](_0x671f47[_0x527f('0x2a')]['sort']);_0xd07e5a['where']=qs[_0x527f('0x2c')](_['pick'](_0x671f47[_0x527f('0x2a')],_0xf7f43d['filters']),_0x429b6c);if(_0x671f47[_0x527f('0x2a')]['filter']){_0xd07e5a[_0x527f('0x34')]=_[_0x527f('0x35')](_0xd07e5a[_0x527f('0x34')],{'$or':_[_0x527f('0x27')](_0x429b6c,function(_0xa4c8e8){if(_0xa4c8e8[_0x527f('0x36')]!==_0x527f('0x37')){var _0x349338={};_0x349338[_0xa4c8e8[_0x527f('0x25')]]={'$like':'%'+_0x671f47['query'][_0x527f('0x38')]+'%'};return _0x349338;}})});}_0xd07e5a=_[_0x527f('0x35')]({},_0xd07e5a,_0x671f47[_0x527f('0x39')]);var _0x50a51d={'where':_0xd07e5a[_0x527f('0x34')]};return db['CmHopperBlack']['count'](_0x50a51d)[_0x527f('0x21')](function(_0xb6e006){_0x46b175[_0x527f('0x1b')]=_0xb6e006;if(_0x671f47[_0x527f('0x2a')][_0x527f('0x3a')]){_0xd07e5a[_0x527f('0x3b')]=[{'all':!![]}];}return db['CmHopperBlack'][_0x527f('0x3c')](_0xd07e5a);})[_0x527f('0x21')](function(_0xd4919){_0x46b175[_0x527f('0x3d')]=_0xd4919;return _0x46b175;})[_0x527f('0x21')](respondWithFilteredResult(_0x32a8ff,_0xd07e5a))[_0x527f('0x3e')](handleError(_0x32a8ff,null));};exports[_0x527f('0x3f')]=function(_0x25a0b5,_0x5141c6){var _0x2728fa={'raw':!![],'where':{'id':_0x25a0b5[_0x527f('0x40')]['id']}},_0x50b03e={};_0x50b03e[_0x527f('0x2e')]=_[_0x527f('0x2b')](db[_0x527f('0x28')][_0x527f('0x29')]);_0x50b03e[_0x527f('0x2a')]=_[_0x527f('0x2b')](_0x25a0b5[_0x527f('0x2a')]);_0x50b03e['filters']=_['intersection'](_0x50b03e[_0x527f('0x2e')],_0x50b03e[_0x527f('0x2a')]);_0x2728fa['attributes']=_[_0x527f('0x2d')](_0x50b03e[_0x527f('0x2e')],qs[_0x527f('0x2f')](_0x25a0b5[_0x527f('0x2a')][_0x527f('0x2f')]));_0x2728fa[_0x527f('0x30')]=_0x2728fa[_0x527f('0x30')][_0x527f('0x41')]?_0x2728fa[_0x527f('0x30')]:_0x50b03e[_0x527f('0x2e')];if(_0x25a0b5[_0x527f('0x2a')][_0x527f('0x3a')]){_0x2728fa[_0x527f('0x3b')]=[{'all':!![]}];}_0x2728fa=_[_0x527f('0x35')]({},_0x2728fa,_0x25a0b5['options']);return db[_0x527f('0x28')]['find'](_0x2728fa)[_0x527f('0x21')](handleEntityNotFound(_0x5141c6,null))['then'](respondWithResult(_0x5141c6,null))[_0x527f('0x3e')](handleError(_0x5141c6,null));};exports[_0x527f('0x42')]=function(_0x17b1da,_0xb363a4){if(_0x17b1da[_0x527f('0x43')]['id']){delete _0x17b1da[_0x527f('0x43')]['id'];}return db['CmHopperBlack'][_0x527f('0x44')]({'where':{'id':_0x17b1da[_0x527f('0x40')]['id']}})['then'](handleEntityNotFound(_0xb363a4,null))['then'](saveUpdates(_0x17b1da[_0x527f('0x43')],null))['then'](respondWithResult(_0xb363a4,null))[_0x527f('0x3e')](handleError(_0xb363a4,null));};exports[_0x527f('0x22')]=function(_0x5a26dd,_0x253e87){return db[_0x527f('0x28')][_0x527f('0x44')]({'where':{'id':_0x5a26dd['params']['id']}})[_0x527f('0x21')](handleEntityNotFound(_0x253e87,null))[_0x527f('0x21')](removeEntity(_0x253e87,null))[_0x527f('0x3e')](handleError(_0x253e87,null));};exports['describe']=function(_0x5af6f1,_0x22184e){return db['CmHopperBlack']['describe']()[_0x527f('0x21')](respondWithResult(_0x22184e,null))['catch'](handleError(_0x22184e,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index ab2c199..1353d2f 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 _0x72d0=['lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./cmHopperBlack.attributes','exports','define','cm_hopper_black'];(function(_0x17ce0a,_0x206be5){var _0x3b5cd8=function(_0x54204c){while(--_0x54204c){_0x17ce0a['push'](_0x17ce0a['shift']());}};_0x3b5cd8(++_0x206be5);}(_0x72d0,0x1ad));var _0x072d=function(_0x3a9635,_0x1ab817){_0x3a9635=_0x3a9635-0x0;var _0x10d08c=_0x72d0[_0x3a9635];return _0x10d08c;};'use strict';var _=require(_0x072d('0x0'));var util=require(_0x072d('0x1'));var logger=require(_0x072d('0x2'))(_0x072d('0x3'));var moment=require(_0x072d('0x4'));var BPromise=require(_0x072d('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x072d('0x6'));var rimraf=require(_0x072d('0x7'));var config=require(_0x072d('0x8'));var attributes=require(_0x072d('0x9'));module[_0x072d('0xa')]=function(_0x208318,_0x309ec9){return _0x208318[_0x072d('0xb')]('CmHopperBlack',attributes,{'tableName':_0x072d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcd8c=['define','CmHopperBlack','cm_hopper_black','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','exports'];(function(_0x92c11b,_0x4fa10e){var _0x419c83=function(_0x88539c){while(--_0x88539c){_0x92c11b['push'](_0x92c11b['shift']());}};_0x419c83(++_0x4fa10e);}(_0xcd8c,0x11b));var _0xccd8=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0xcd8c[_0x5b78e8];return _0xf2c321;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xccd8('0x0'))('api');var moment=require(_0xccd8('0x1'));var BPromise=require(_0xccd8('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xccd8('0x3'));var rimraf=require(_0xccd8('0x4'));var config=require(_0xccd8('0x5'));var attributes=require('./cmHopperBlack.attributes');module[_0xccd8('0x6')]=function(_0x1029c3,_0x46c136){return _0x1029c3[_0xccd8('0x7')](_0xccd8('0x8'),attributes,{'tableName':_0xccd8('0x9'),'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 070b2d8..45c2b12 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 _0x91f0=['map','include','model','info','UpdateCmHopperBlack','update','body','raw','DestroyCmHopperBlack','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','GetCmHopperBlack','CmHopperBlack','findAll','options','where','attributes','limit'];(function(_0x433a86,_0x175b5c){var _0x23000c=function(_0x4b1fa0){while(--_0x4b1fa0){_0x433a86['push'](_0x433a86['shift']());}};_0x23000c(++_0x175b5c);}(_0x91f0,0x1b6));var _0x091f=function(_0x41538b,_0x2b79a3){_0x41538b=_0x41538b-0x0;var _0x5b43b1=_0x91f0[_0x41538b];return _0x5b43b1;};'use strict';var _=require(_0x091f('0x0'));var util=require(_0x091f('0x1'));var moment=require(_0x091f('0x2'));var BPromise=require(_0x091f('0x3'));var rs=require(_0x091f('0x4'));var fs=require('fs');var Redis=require(_0x091f('0x5'));var db=require(_0x091f('0x6'))['db'];var utils=require(_0x091f('0x7'));var logger=require(_0x091f('0x8'))(_0x091f('0x9'));var config=require(_0x091f('0xa'));var jayson=require(_0x091f('0xb'));var client=jayson[_0x091f('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2bc0e5,_0x405b0e,_0x29d4d1){return new BPromise(function(_0x1fe632,_0x1e988c){return client[_0x091f('0xd')](_0x2bc0e5,_0x29d4d1)[_0x091f('0xe')](function(_0x58a41d){logger['info'](_0x091f('0xf'),_0x405b0e,_0x091f('0x10'));logger[_0x091f('0x11')]('CmHopperBlack,\x20%s,\x20%s,\x20%s',_0x405b0e,'request\x20sent',JSON[_0x091f('0x12')](_0x58a41d));if(_0x58a41d[_0x091f('0x13')]){if(_0x58a41d['error']['code']===0x1f4){logger[_0x091f('0x13')]('CmHopperBlack,\x20%s,\x20%s',_0x405b0e,_0x58a41d[_0x091f('0x13')][_0x091f('0x14')]);return _0x1e988c(_0x58a41d['error'][_0x091f('0x14')]);}logger[_0x091f('0x13')](_0x091f('0xf'),_0x405b0e,_0x58a41d[_0x091f('0x13')][_0x091f('0x14')]);return _0x1fe632(_0x58a41d['error'][_0x091f('0x14')]);}else{logger['info']('CmHopperBlack,\x20%s,\x20%s',_0x405b0e,'request\x20sent');_0x1fe632(_0x58a41d[_0x091f('0x15')][_0x091f('0x14')]);}})[_0x091f('0x16')](function(_0x3e1325){logger[_0x091f('0x13')]('CmHopperBlack,\x20%s,\x20%s',_0x405b0e,_0x3e1325);_0x1e988c(_0x3e1325);});});}exports[_0x091f('0x17')]=function(_0x35b712){var _0x5c6e84=this;return new Promise(function(_0x59a1ed,_0x1f7137){return db[_0x091f('0x18')][_0x091f('0x19')]({'raw':_0x35b712[_0x091f('0x1a')]?_0x35b712['options']['raw']===undefined?!![]:![]:!![],'where':_0x35b712[_0x091f('0x1a')]?_0x35b712[_0x091f('0x1a')][_0x091f('0x1b')]||null:null,'attributes':_0x35b712[_0x091f('0x1a')]?_0x35b712['options'][_0x091f('0x1c')]||null:null,'limit':_0x35b712[_0x091f('0x1a')]?_0x35b712[_0x091f('0x1a')][_0x091f('0x1d')]||null:null,'include':_0x35b712[_0x091f('0x1a')]?_0x35b712['options']['include']?_[_0x091f('0x1e')](_0x35b712[_0x091f('0x1a')]['include'],function(_0x52e0f2){return{'model':db[_0x52e0f2['model']],'as':_0x52e0f2['as'],'attributes':_0x52e0f2[_0x091f('0x1c')],'include':_0x52e0f2[_0x091f('0x1f')]?_[_0x091f('0x1e')](_0x52e0f2['include'],function(_0x3b3d82){return{'model':db[_0x3b3d82[_0x091f('0x20')]],'as':_0x3b3d82['as'],'attributes':_0x3b3d82[_0x091f('0x1c')],'include':_0x3b3d82[_0x091f('0x1f')]?_[_0x091f('0x1e')](_0x3b3d82[_0x091f('0x1f')],function(_0x329f9c){return{'model':db[_0x329f9c[_0x091f('0x20')]],'as':_0x329f9c['as'],'attributes':_0x329f9c['attributes']};}):[]};}):[]};}):[]:[]})[_0x091f('0xe')](function(_0x134891){logger[_0x091f('0x21')](_0x091f('0x17'),_0x35b712);logger['debug']('GetCmHopperBlack',_0x35b712,JSON['stringify'](_0x134891));_0x59a1ed(_0x134891);})[_0x091f('0x16')](function(_0x33b281){logger[_0x091f('0x13')](_0x091f('0x17'),_0x33b281[_0x091f('0x14')],_0x35b712);_0x1f7137(_0x5c6e84[_0x091f('0x13')](0x1f4,_0x33b281[_0x091f('0x14')]));});});};exports[_0x091f('0x22')]=function(_0x57ed02){var _0x13686d=this;return new Promise(function(_0xd47c97,_0x53436b){return db[_0x091f('0x18')][_0x091f('0x23')](_0x57ed02[_0x091f('0x24')],{'raw':_0x57ed02[_0x091f('0x1a')]?_0x57ed02[_0x091f('0x1a')][_0x091f('0x25')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x57ed02['options']?_0x57ed02[_0x091f('0x1a')][_0x091f('0x1b')]||null:null,'attributes':_0x57ed02[_0x091f('0x1a')]?_0x57ed02[_0x091f('0x1a')][_0x091f('0x1c')]||null:null,'limit':_0x57ed02[_0x091f('0x1a')]?_0x57ed02[_0x091f('0x1a')][_0x091f('0x1d')]||null:null})[_0x091f('0xe')](function(_0x33c468){logger[_0x091f('0x21')]('UpdateCmHopperBlack',_0x57ed02);logger['debug'](_0x091f('0x22'),_0x57ed02,JSON[_0x091f('0x12')](_0x33c468));_0xd47c97(_0x33c468);})[_0x091f('0x16')](function(_0x6dbdc2){logger[_0x091f('0x13')](_0x091f('0x22'),_0x6dbdc2[_0x091f('0x14')],_0x57ed02);_0x53436b(_0x13686d[_0x091f('0x13')](0x1f4,_0x6dbdc2['message']));});});};exports['DestroyCmHopperBlack']=function(_0x1b0dcd){var _0x3f2002=this;return new Promise(function(_0x29cd36,_0x31a27f){return db[_0x091f('0x18')]['destroy']({'where':_0x1b0dcd[_0x091f('0x1a')]?_0x1b0dcd['options'][_0x091f('0x1b')]||null:null})[_0x091f('0xe')](function(_0x1746c2){logger[_0x091f('0x21')]('DestroyCmHopperBlack',_0x1b0dcd);logger[_0x091f('0x11')](_0x091f('0x26'),_0x1b0dcd,JSON[_0x091f('0x12')](_0x1746c2));_0x29cd36(_0x1746c2);})[_0x091f('0x16')](function(_0x392dc6){logger[_0x091f('0x13')]('DestroyCmHopperBlack',_0x392dc6[_0x091f('0x14')],_0x1b0dcd);_0x31a27f(_0x3f2002[_0x091f('0x13')](0x1f4,_0x392dc6[_0x091f('0x14')]));});});}; \ No newline at end of file +var _0x410f=['DestroyCmHopperBlack','destroy','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','error','code','CmHopperBlack,\x20%s,\x20%s','message','catch','GetCmHopperBlack','CmHopperBlack','options','raw','where','attributes','limit','include','model','map','stringify','UpdateCmHopperBlack','update','body'];(function(_0x15be92,_0x4c9b9e){var _0x6dbea1=function(_0x54cb72){while(--_0x54cb72){_0x15be92['push'](_0x15be92['shift']());}};_0x6dbea1(++_0x4c9b9e);}(_0x410f,0x96));var _0xf410=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x410f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xf410('0x0'));var moment=require(_0xf410('0x1'));var BPromise=require(_0xf410('0x2'));var rs=require(_0xf410('0x3'));var fs=require('fs');var Redis=require(_0xf410('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf410('0x5'));var logger=require(_0xf410('0x6'))(_0xf410('0x7'));var config=require(_0xf410('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xf410('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x29c352,_0x1203ee,_0x236974){return new BPromise(function(_0x2d3112,_0x5f52a2){return client[_0xf410('0xa')](_0x29c352,_0x236974)[_0xf410('0xb')](function(_0x1e52aa){logger[_0xf410('0xc')]('CmHopperBlack,\x20%s,\x20%s',_0x1203ee,_0xf410('0xd'));logger[_0xf410('0xe')](_0xf410('0xf'),_0x1203ee,_0xf410('0xd'),JSON['stringify'](_0x1e52aa));if(_0x1e52aa[_0xf410('0x10')]){if(_0x1e52aa[_0xf410('0x10')][_0xf410('0x11')]===0x1f4){logger[_0xf410('0x10')](_0xf410('0x12'),_0x1203ee,_0x1e52aa[_0xf410('0x10')]['message']);return _0x5f52a2(_0x1e52aa[_0xf410('0x10')]['message']);}logger['error'](_0xf410('0x12'),_0x1203ee,_0x1e52aa[_0xf410('0x10')][_0xf410('0x13')]);return _0x2d3112(_0x1e52aa[_0xf410('0x10')]['message']);}else{logger['info'](_0xf410('0x12'),_0x1203ee,'request\x20sent');_0x2d3112(_0x1e52aa['result']['message']);}})[_0xf410('0x14')](function(_0x4e6987){logger[_0xf410('0x10')](_0xf410('0x12'),_0x1203ee,_0x4e6987);_0x5f52a2(_0x4e6987);});});}exports[_0xf410('0x15')]=function(_0x5ba07d){var _0x175d07=this;return new Promise(function(_0x60f16a,_0x577e21){return db[_0xf410('0x16')]['findAll']({'raw':_0x5ba07d['options']?_0x5ba07d[_0xf410('0x17')][_0xf410('0x18')]===undefined?!![]:![]:!![],'where':_0x5ba07d[_0xf410('0x17')]?_0x5ba07d['options'][_0xf410('0x19')]||null:null,'attributes':_0x5ba07d[_0xf410('0x17')]?_0x5ba07d['options'][_0xf410('0x1a')]||null:null,'limit':_0x5ba07d[_0xf410('0x17')]?_0x5ba07d[_0xf410('0x17')][_0xf410('0x1b')]||null:null,'include':_0x5ba07d[_0xf410('0x17')]?_0x5ba07d[_0xf410('0x17')][_0xf410('0x1c')]?_['map'](_0x5ba07d[_0xf410('0x17')][_0xf410('0x1c')],function(_0xceb9e8){return{'model':db[_0xceb9e8[_0xf410('0x1d')]],'as':_0xceb9e8['as'],'attributes':_0xceb9e8[_0xf410('0x1a')],'include':_0xceb9e8[_0xf410('0x1c')]?_[_0xf410('0x1e')](_0xceb9e8[_0xf410('0x1c')],function(_0x1b67d1){return{'model':db[_0x1b67d1[_0xf410('0x1d')]],'as':_0x1b67d1['as'],'attributes':_0x1b67d1[_0xf410('0x1a')],'include':_0x1b67d1[_0xf410('0x1c')]?_[_0xf410('0x1e')](_0x1b67d1[_0xf410('0x1c')],function(_0x8251ff){return{'model':db[_0x8251ff[_0xf410('0x1d')]],'as':_0x8251ff['as'],'attributes':_0x8251ff[_0xf410('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xf410('0xb')](function(_0x18e81d){logger['info'](_0xf410('0x15'),_0x5ba07d);logger[_0xf410('0xe')]('GetCmHopperBlack',_0x5ba07d,JSON[_0xf410('0x1f')](_0x18e81d));_0x60f16a(_0x18e81d);})[_0xf410('0x14')](function(_0xcbd79a){logger[_0xf410('0x10')](_0xf410('0x15'),_0xcbd79a['message'],_0x5ba07d);_0x577e21(_0x175d07['error'](0x1f4,_0xcbd79a[_0xf410('0x13')]));});});};exports[_0xf410('0x20')]=function(_0x361b54){var _0x1d2444=this;return new Promise(function(_0xfb266b,_0x45f7f5){return db[_0xf410('0x16')][_0xf410('0x21')](_0x361b54[_0xf410('0x22')],{'raw':_0x361b54[_0xf410('0x17')]?_0x361b54[_0xf410('0x17')][_0xf410('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x361b54[_0xf410('0x17')]?_0x361b54[_0xf410('0x17')][_0xf410('0x19')]||null:null,'attributes':_0x361b54[_0xf410('0x17')]?_0x361b54[_0xf410('0x17')][_0xf410('0x1a')]||null:null,'limit':_0x361b54[_0xf410('0x17')]?_0x361b54[_0xf410('0x17')]['limit']||null:null})[_0xf410('0xb')](function(_0x4ebe67){logger[_0xf410('0xc')](_0xf410('0x20'),_0x361b54);logger['debug']('UpdateCmHopperBlack',_0x361b54,JSON[_0xf410('0x1f')](_0x4ebe67));_0xfb266b(_0x4ebe67);})[_0xf410('0x14')](function(_0x13725a){logger['error'](_0xf410('0x20'),_0x13725a[_0xf410('0x13')],_0x361b54);_0x45f7f5(_0x1d2444[_0xf410('0x10')](0x1f4,_0x13725a['message']));});});};exports[_0xf410('0x23')]=function(_0x590cc3){var _0x444514=this;return new Promise(function(_0x2a4bfd,_0x5a3f9b){return db['CmHopperBlack'][_0xf410('0x24')]({'where':_0x590cc3[_0xf410('0x17')]?_0x590cc3[_0xf410('0x17')]['where']||null:null})['then'](function(_0x4420ff){logger[_0xf410('0xc')](_0xf410('0x23'),_0x590cc3);logger['debug']('DestroyCmHopperBlack',_0x590cc3,JSON[_0xf410('0x1f')](_0x4420ff));_0x2a4bfd(_0x4420ff);})[_0xf410('0x14')](function(_0x2c3a04){logger['error'](_0xf410('0x23'),_0x2c3a04[_0xf410('0x13')],_0x590cc3);_0x5a3f9b(_0x444514[_0xf410('0x10')](0x1f4,_0x2c3a04[_0xf410('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index b96b49b..66de580 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 _0x3831=['get','isAuthenticated','describe','/:id','show','put','update','delete','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./cmHopperBlack.controller'];(function(_0x294667,_0x34b308){var _0x2db709=function(_0x3ece1a){while(--_0x3ece1a){_0x294667['push'](_0x294667['shift']());}};_0x2db709(++_0x34b308);}(_0x3831,0x14c));var _0x1383=function(_0x289fd4,_0xd34ba6){_0x289fd4=_0x289fd4-0x0;var _0x3d4a88=_0x3831[_0x289fd4];return _0x3d4a88;};'use strict';var multer=require(_0x1383('0x0'));var util=require('util');var path=require(_0x1383('0x1'));var timeout=require(_0x1383('0x2'));var express=require(_0x1383('0x3'));var router=express[_0x1383('0x4')]();var fs_extra=require(_0x1383('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x1383('0x6'));var config=require('../../config/environment');var controller=require(_0x1383('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x1383('0x8')]('/describe',auth[_0x1383('0x9')](),controller[_0x1383('0xa')]);router[_0x1383('0x8')](_0x1383('0xb'),auth[_0x1383('0x9')](),controller[_0x1383('0xc')]);router[_0x1383('0xd')](_0x1383('0xb'),auth['isAuthenticated'](),controller[_0x1383('0xe')]);router[_0x1383('0xf')](_0x1383('0xb'),auth[_0x1383('0x9')](),controller[_0x1383('0x10')]);module['exports']=router; \ No newline at end of file +var _0x7278=['../../config/environment','./cmHopperBlack.controller','get','isAuthenticated','/describe','describe','put','/:id','update','delete','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x25f805,_0x59caf3){var _0xf6628f=function(_0x3cb938){while(--_0x3cb938){_0x25f805['push'](_0x25f805['shift']());}};_0xf6628f(++_0x59caf3);}(_0x7278,0x161));var _0x8727=function(_0x99577a,_0x5d0715){_0x99577a=_0x99577a-0x0;var _0x39fa52=_0x7278[_0x99577a];return _0x39fa52;};'use strict';var multer=require(_0x8727('0x0'));var util=require(_0x8727('0x1'));var path=require(_0x8727('0x2'));var timeout=require(_0x8727('0x3'));var express=require(_0x8727('0x4'));var router=express['Router']();var fs_extra=require(_0x8727('0x5'));var auth=require(_0x8727('0x6'));var interaction=require(_0x8727('0x7'));var config=require(_0x8727('0x8'));var controller=require(_0x8727('0x9'));router[_0x8727('0xa')]('/',auth[_0x8727('0xb')](),controller['index']);router[_0x8727('0xa')](_0x8727('0xc'),auth[_0x8727('0xb')](),controller[_0x8727('0xd')]);router[_0x8727('0xa')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x8727('0xe')](_0x8727('0xf'),auth[_0x8727('0xb')](),controller[_0x8727('0x10')]);router[_0x8727('0x11')](_0x8727('0xf'),auth[_0x8727('0xb')](),controller[_0x8727('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index f3538ab..860a0d4 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 _0x77be=['seconds','dispositionat','BOOLEAN','exports','INTEGER','STRING','DATE','endtime','setDataValue','followuptime','diff'];(function(_0x46b848,_0x1443e9){var _0x407e7e=function(_0x35cc9f){while(--_0x35cc9f){_0x46b848['push'](_0x46b848['shift']());}};_0x407e7e(++_0x1443e9);}(_0x77be,0x18f));var _0xe77b=function(_0x4f9bc2,_0x47a2b5){_0x4f9bc2=_0x4f9bc2-0x0;var _0xc33c6d=_0x77be[_0x4f9bc2];return _0xc33c6d;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0xe77b('0x0')]={'state':{'type':Sequelize[_0xe77b('0x1')](0x2)},'statedesc':{'type':Sequelize[_0xe77b('0x2')]},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xe77b('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xe77b('0x1')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xe77b('0x1')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0xe77b('0x2')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xe77b('0x2')]},'calleridname':{'type':Sequelize[_0xe77b('0x2')]},'starttime':{'type':Sequelize[_0xe77b('0x3')]},'responsetime':{'type':Sequelize[_0xe77b('0x3')]},'answertime':{'type':Sequelize[_0xe77b('0x3')]},'droptime':{'type':Sequelize[_0xe77b('0x3')]},'endtime':{'type':Sequelize[_0xe77b('0x3')]},'ringtime':{'type':Sequelize[_0xe77b('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xe77b('0x1')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xe77b('0x1')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xe77b('0x2')]},'campaign':{'type':Sequelize[_0xe77b('0x2')]},'campaigntype':{'type':Sequelize[_0xe77b('0x2')]},'membername':{'type':Sequelize[_0xe77b('0x2')]},'reason':{'type':Sequelize[_0xe77b('0x2')]},'disposition':{'type':Sequelize[_0xe77b('0x2')]},'secondDisposition':{'type':Sequelize[_0xe77b('0x2')]},'thirdDisposition':{'type':Sequelize[_0xe77b('0x2')]},'dispositionat':{'type':Sequelize[_0xe77b('0x3')],'set':function(_0xbc5270){var _0x2e146f=this['getDataValue'](_0xe77b('0x4'));if(_0x2e146f&&_0xbc5270){this[_0xe77b('0x5')](_0xe77b('0x6'),moment(_0xbc5270)[_0xe77b('0x7')](moment(_0x2e146f),_0xe77b('0x8')));}return this[_0xe77b('0x5')](_0xe77b('0x9'),_0xbc5270);}},'amd':{'type':Sequelize[_0xe77b('0xa')],'defaultValue':![]},'fax':{'type':Sequelize[_0xe77b('0xa')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0xe77b('0xa')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0xe77b('0xa')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0xe77b('0x3')]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'deleted':{'type':Sequelize[_0xe77b('0x2')],'defaultValue':null},'deletedat':{'type':Sequelize[_0xe77b('0x3')]},'recallme':{'type':Sequelize[_0xe77b('0xa')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0xe77b('0x3')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xe77b('0x1')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xe77b('0x1')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xe77b('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0xe77b('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x6a1e=['STRING','DATE','getDataValue','endtime','setDataValue','diff','seconds','BOOLEAN','sequelize','moment','INTEGER'];(function(_0x45adb4,_0x2abb06){var _0x137296=function(_0x552ec9){while(--_0x552ec9){_0x45adb4['push'](_0x45adb4['shift']());}};_0x137296(++_0x2abb06);}(_0x6a1e,0x189));var _0xe6a1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6a1e[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xe6a1('0x0'));var moment=require(_0xe6a1('0x1'));module['exports']={'state':{'type':Sequelize[_0xe6a1('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xe6a1('0x3')]},'scheduledat':{'type':Sequelize[_0xe6a1('0x4')]},'countbusyretry':{'type':Sequelize[_0xe6a1('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xe6a1('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xe6a1('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xe6a1('0x3')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0xe6a1('0x3')]},'calleridnum':{'type':Sequelize[_0xe6a1('0x3')]},'calleridname':{'type':Sequelize[_0xe6a1('0x3')]},'starttime':{'type':Sequelize[_0xe6a1('0x4')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0xe6a1('0x4')]},'droptime':{'type':Sequelize[_0xe6a1('0x4')]},'endtime':{'type':Sequelize[_0xe6a1('0x4')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xe6a1('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xe6a1('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xe6a1('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xe6a1('0x3')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0xe6a1('0x3')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0xe6a1('0x3')]},'secondDisposition':{'type':Sequelize[_0xe6a1('0x3')]},'thirdDisposition':{'type':Sequelize[_0xe6a1('0x3')]},'dispositionat':{'type':Sequelize[_0xe6a1('0x4')],'set':function(_0x30b78f){var _0x349481=this[_0xe6a1('0x5')](_0xe6a1('0x6'));if(_0x349481&&_0x30b78f){this[_0xe6a1('0x7')]('followuptime',moment(_0x30b78f)[_0xe6a1('0x8')](moment(_0x349481),_0xe6a1('0x9')));}return this[_0xe6a1('0x7')]('dispositionat',_0x30b78f);}},'amd':{'type':Sequelize[_0xe6a1('0xa')],'defaultValue':![]},'fax':{'type':Sequelize[_0xe6a1('0xa')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0xe6a1('0xa')],'defaultValue':![]},'rescheduled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0xe6a1('0x4')]},'callback':{'type':Sequelize[_0xe6a1('0xa')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xe6a1('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xe6a1('0x4')]},'deleted':{'type':Sequelize['STRING'],'defaultValue':null},'deletedat':{'type':Sequelize[_0xe6a1('0x4')]},'recallme':{'type':Sequelize[_0xe6a1('0xa')],'defaultValue':![]},'agiafterat':{'type':Sequelize['DATE']},'countnosuchnumberretry':{'type':Sequelize[_0xe6a1('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xe6a1('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xe6a1('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'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 1d9d5d2..1137153 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 _0x0295=['ejs','fs-extra','lodash','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','CmHopperFinal','includeAll','rows','catch','show','params','intersection','include','find','describe','body','uniqueid','findAll','sequelize','literal','noSuchContacts','COUNT','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','`state`\x20=\x200,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2022,\x201,\x20null','moveContactsQueueCampaignHopperFinal','cm_hopper','fromQuery','phone','scheduledAt','ListId','VoiceQueueId','updatedAt','select','field','NOW()','ANY_VALUE(ContactId)','ContactId','ANY_VALUE(ListId)','createdAt','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','state','calleridnum\x20NOT\x20IN\x20(?)','from','calleridnum','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign','insert','into','CampaignId','ANY_VALUE(calleridnum)','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','CmHopper','findOne','eml-format','fast-json-patch','bluebird','mustache','util','path','sox','to-csv'];(function(_0x3c40f7,_0x1644bb){var _0x27238a=function(_0x4205c6){while(--_0x4205c6){_0x3c40f7['push'](_0x3c40f7['shift']());}};_0x27238a(++_0x1644bb);}(_0x0295,0x1f0));var _0x5029=function(_0x432044,_0x35d99b){_0x432044=_0x432044-0x0;var _0x108d8d=_0x0295[_0x432044];return _0x108d8d;};'use strict';var emlformat=require(_0x5029('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5029('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5029('0x2'));var Mustache=require(_0x5029('0x3'));var util=require(_0x5029('0x4'));var path=require(_0x5029('0x5'));var sox=require(_0x5029('0x6'));var csv=require(_0x5029('0x7'));var ejs=require(_0x5029('0x8'));var fs=require('fs');var fs_extra=require(_0x5029('0x9'));var _=require(_0x5029('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5029('0xb'));var toCsv=require('to-csv');var querystring=require(_0x5029('0xc'));var Papa=require('papaparse');var Redis=require(_0x5029('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x5029('0xe'));var as=require(_0x5029('0xf'));var hardwareService=require(_0x5029('0x10'));var logger=require('../../config/logger')(_0x5029('0x11'));var utils=require(_0x5029('0x12'));var config=require(_0x5029('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x5029('0x14'))['db'];function respondWithStatusCode(_0x2442b2,_0x4cced9){_0x4cced9=_0x4cced9||0xcc;return function(_0x4fa22d){if(_0x4fa22d){return _0x2442b2['sendStatus'](_0x4cced9);}return _0x2442b2['status'](_0x4cced9)[_0x5029('0x15')]();};}function respondWithResult(_0x2e0369,_0x12c237){_0x12c237=_0x12c237||0xc8;return function(_0x434630){if(_0x434630){return _0x2e0369[_0x5029('0x16')](_0x12c237)[_0x5029('0x17')](_0x434630);}};}function respondWithFilteredResult(_0xe278b7,_0x317c20){return function(_0x10bf55){if(_0x10bf55){var _0x326923=typeof _0x317c20[_0x5029('0x18')]===_0x5029('0x19')&&typeof _0x317c20[_0x5029('0x1a')]===_0x5029('0x19');var _0x343918=_0x10bf55['count'];var _0x1ed567=_0x326923?0x0:_0x317c20[_0x5029('0x18')];var _0x35de81=_0x326923?_0x10bf55[_0x5029('0x1b')]:_0x317c20[_0x5029('0x18')]+_0x317c20[_0x5029('0x1a')];var _0xaba461;if(_0x35de81>=_0x343918){_0x35de81=_0x343918;_0xaba461=0xc8;}else{_0xaba461=0xce;}_0xe278b7['status'](_0xaba461);return _0xe278b7[_0x5029('0x1c')]('Content-Range',_0x1ed567+'-'+_0x35de81+'/'+_0x343918)[_0x5029('0x17')](_0x10bf55);}return null;};}function patchUpdates(_0x8a414c){return function(_0x2710aa){try{jsonpatch[_0x5029('0x1d')](_0x2710aa,_0x8a414c,!![]);}catch(_0x4b5854){return BPromise['reject'](_0x4b5854);}return _0x2710aa[_0x5029('0x1e')]();};}function saveUpdates(_0x4a49b6,_0x3f657d){return function(_0x853a34){if(_0x853a34){return _0x853a34[_0x5029('0x1f')](_0x4a49b6)[_0x5029('0x20')](function(_0x16bd22){return _0x16bd22;});}return null;};}function removeEntity(_0x3a3e52,_0x125c26){return function(_0x356dac){if(_0x356dac){return _0x356dac[_0x5029('0x21')]()['then'](function(){_0x3a3e52['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x588d90,_0x45666c){return function(_0x51093c){if(!_0x51093c){_0x588d90['sendStatus'](0x194);}return _0x51093c;};}function handleError(_0x181da0,_0x1e7e61){_0x1e7e61=_0x1e7e61||0x1f4;return function(_0x36d810){logger['error'](_0x36d810[_0x5029('0x22')]);if(_0x36d810[_0x5029('0x23')]){delete _0x36d810['name'];}_0x181da0[_0x5029('0x16')](_0x1e7e61)[_0x5029('0x24')](_0x36d810);};}exports[_0x5029('0x25')]=function(_0x4a24b9,_0x32da06){var _0x251f99={},_0xe5313e={},_0x4b6f92={'count':0x0,'rows':[]};var _0x2cedf6=_[_0x5029('0x26')](db['CmHopperFinal'][_0x5029('0x27')],function(_0x25032b){return{'name':_0x25032b[_0x5029('0x28')],'type':_0x25032b[_0x5029('0x29')][_0x5029('0x2a')]};});_0xe5313e[_0x5029('0x2b')]=_[_0x5029('0x26')](_0x2cedf6,_0x5029('0x23'));_0xe5313e[_0x5029('0x2c')]=_[_0x5029('0x2d')](_0x4a24b9[_0x5029('0x2c')]);_0xe5313e[_0x5029('0x2e')]=_['intersection'](_0xe5313e[_0x5029('0x2b')],_0xe5313e['query']);_0x251f99[_0x5029('0x2f')]=_['intersection'](_0xe5313e['model'],qs[_0x5029('0x30')](_0x4a24b9[_0x5029('0x2c')][_0x5029('0x30')]));_0x251f99['attributes']=_0x251f99[_0x5029('0x2f')][_0x5029('0x31')]?_0x251f99[_0x5029('0x2f')]:_0xe5313e[_0x5029('0x2b')];if(!_0x4a24b9[_0x5029('0x2c')][_0x5029('0x32')](_0x5029('0x33'))){_0x251f99[_0x5029('0x1a')]=qs[_0x5029('0x1a')](_0x4a24b9['query'][_0x5029('0x1a')]);_0x251f99[_0x5029('0x18')]=qs[_0x5029('0x18')](_0x4a24b9[_0x5029('0x2c')]['offset']);}_0x251f99[_0x5029('0x34')]=qs[_0x5029('0x35')](_0x4a24b9[_0x5029('0x2c')]['sort']);_0x251f99['where']=qs[_0x5029('0x2e')](_[_0x5029('0x36')](_0x4a24b9['query'],_0xe5313e['filters']),_0x2cedf6);if(_0x4a24b9[_0x5029('0x2c')][_0x5029('0x37')]){_0x251f99[_0x5029('0x38')]=_[_0x5029('0x39')](_0x251f99[_0x5029('0x38')],{'$or':_[_0x5029('0x26')](_0x2cedf6,function(_0x3cb84e){if(_0x3cb84e[_0x5029('0x29')]!==_0x5029('0x3a')){var _0x3effa4={};_0x3effa4[_0x3cb84e[_0x5029('0x23')]]={'$like':'%'+_0x4a24b9[_0x5029('0x2c')][_0x5029('0x37')]+'%'};return _0x3effa4;}})});}_0x251f99=_[_0x5029('0x39')]({},_0x251f99,_0x4a24b9['options']);var _0x57c2b5={'where':_0x251f99[_0x5029('0x38')]};return db[_0x5029('0x3b')][_0x5029('0x1b')](_0x57c2b5)['then'](function(_0x32d8a3){_0x4b6f92[_0x5029('0x1b')]=_0x32d8a3;if(_0x4a24b9['query'][_0x5029('0x3c')]){_0x251f99['include']=[{'all':!![]}];}return db[_0x5029('0x3b')]['findAll'](_0x251f99);})[_0x5029('0x20')](function(_0x359838){_0x4b6f92[_0x5029('0x3d')]=_0x359838;return _0x4b6f92;})[_0x5029('0x20')](respondWithFilteredResult(_0x32da06,_0x251f99))[_0x5029('0x3e')](handleError(_0x32da06,null));};exports[_0x5029('0x3f')]=function(_0x4b2219,_0x1021ea){var _0x2ae047={'raw':!![],'where':{'id':_0x4b2219[_0x5029('0x40')]['id']}},_0x5a3e4d={};_0x5a3e4d[_0x5029('0x2b')]=_[_0x5029('0x2d')](db[_0x5029('0x3b')][_0x5029('0x27')]);_0x5a3e4d[_0x5029('0x2c')]=_['keys'](_0x4b2219[_0x5029('0x2c')]);_0x5a3e4d[_0x5029('0x2e')]=_[_0x5029('0x41')](_0x5a3e4d[_0x5029('0x2b')],_0x5a3e4d[_0x5029('0x2c')]);_0x2ae047['attributes']=_[_0x5029('0x41')](_0x5a3e4d[_0x5029('0x2b')],qs[_0x5029('0x30')](_0x4b2219[_0x5029('0x2c')][_0x5029('0x30')]));_0x2ae047[_0x5029('0x2f')]=_0x2ae047[_0x5029('0x2f')][_0x5029('0x31')]?_0x2ae047[_0x5029('0x2f')]:_0x5a3e4d['model'];if(_0x4b2219[_0x5029('0x2c')][_0x5029('0x3c')]){_0x2ae047[_0x5029('0x42')]=[{'all':!![]}];}_0x2ae047=_[_0x5029('0x39')]({},_0x2ae047,_0x4b2219['options']);return db['CmHopperFinal'][_0x5029('0x43')](_0x2ae047)[_0x5029('0x20')](handleEntityNotFound(_0x1021ea,null))[_0x5029('0x20')](respondWithResult(_0x1021ea,null))[_0x5029('0x3e')](handleError(_0x1021ea,null));};exports[_0x5029('0x44')]=function(_0x3dfc08,_0x2bb7fc){return db[_0x5029('0x3b')][_0x5029('0x44')]()[_0x5029('0x20')](respondWithResult(_0x2bb7fc,null))[_0x5029('0x3e')](handleError(_0x2bb7fc,null));};exports[_0x5029('0x1f')]=function(_0x449ef5,_0x18f1f5){if(_0x449ef5[_0x5029('0x45')][_0x5029('0x46')]){delete _0x449ef5[_0x5029('0x45')][_0x5029('0x46')];}return db[_0x5029('0x3b')][_0x5029('0x43')]({'where':{'uniqueid':_0x449ef5[_0x5029('0x40')]['id']}})['then'](handleEntityNotFound(_0x18f1f5,null))[_0x5029('0x20')](saveUpdates(_0x449ef5['body'],null))[_0x5029('0x20')](respondWithResult(_0x18f1f5,null))[_0x5029('0x3e')](handleError(_0x18f1f5,null));};exports['countContactsQueueCampaignHopperFinal']=function(_0x5343c6,_0x319bff,_0x5e739d){return db['CmHopperFinal'][_0x5029('0x47')]({'raw':![],'where':{'VoiceQueueId':_0x5343c6[_0x5029('0x40')]['id']},'attributes':[[db[_0x5029('0x48')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x5029('0x48')][_0x5029('0x49')]('`state`\x20=\x200,\x201,\x20null'))),_0x5029('0x4a')],[db['sequelize']['fn'](_0x5029('0x4b'),db['sequelize']['fn']('IF',db[_0x5029('0x48')][_0x5029('0x49')](_0x5029('0x4c')))),_0x5029('0x4d')],[db[_0x5029('0x48')]['fn'](_0x5029('0x4b'),db[_0x5029('0x48')]['fn']('IF',db[_0x5029('0x48')]['literal'](_0x5029('0x4e')))),'busyContacts'],[db[_0x5029('0x48')]['fn'](_0x5029('0x4b'),db['sequelize']['fn']('IF',db[_0x5029('0x48')]['literal']('`state`\x20=\x208,\x201,\x20null'))),'congestionContacts'],[db[_0x5029('0x48')]['fn']('COUNT',db[_0x5029('0x48')]['fn']('IF',db[_0x5029('0x48')][_0x5029('0x49')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x5029('0x4f')],[db['sequelize']['fn']('COUNT',db[_0x5029('0x48')]['fn']('IF',db[_0x5029('0x48')][_0x5029('0x49')](_0x5029('0x50')))),_0x5029('0x51')],[db['sequelize']['fn'](_0x5029('0x4b'),db[_0x5029('0x48')]['fn']('IF',db[_0x5029('0x48')][_0x5029('0x49')]('`state`\x20=\x2022,\x201,\x20null'))),_0x5029('0x52')],[db[_0x5029('0x48')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x5029('0x48')][_0x5029('0x49')](_0x5029('0x53')))),_0x5029('0x54')]]})['then'](handleEntityNotFound(_0x319bff,null))[_0x5029('0x20')](respondWithResult(_0x319bff,null))[_0x5029('0x3e')](handleError(_0x319bff,null));};exports[_0x5029('0x55')]=function(_0x2aebb3,_0x3a82f7,_0x26f56f){return db['CmHopperFinal']['findAll']({'raw':![],'where':{'CampaignId':_0x2aebb3[_0x5029('0x40')]['id']},'attributes':[[db[_0x5029('0x48')]['fn'](_0x5029('0x4b'),db['sequelize']['fn']('IF',db[_0x5029('0x48')][_0x5029('0x49')](_0x5029('0x56')))),_0x5029('0x4a')],[db[_0x5029('0x48')]['fn']('COUNT',db[_0x5029('0x48')]['fn']('IF',db[_0x5029('0x48')][_0x5029('0x49')]('`state`\x20=\x203,\x201,\x20null'))),_0x5029('0x4d')],[db['sequelize']['fn'](_0x5029('0x4b'),db['sequelize']['fn']('IF',db[_0x5029('0x48')][_0x5029('0x49')](_0x5029('0x4e')))),_0x5029('0x57')],[db[_0x5029('0x48')]['fn'](_0x5029('0x4b'),db['sequelize']['fn']('IF',db[_0x5029('0x48')][_0x5029('0x49')](_0x5029('0x58')))),_0x5029('0x59')],[db[_0x5029('0x48')]['fn']('COUNT',db[_0x5029('0x48')]['fn']('IF',db['sequelize'][_0x5029('0x49')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x5029('0x4f')],[db['sequelize']['fn'](_0x5029('0x4b'),db['sequelize']['fn']('IF',db['sequelize'][_0x5029('0x49')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x5029('0x51')],[db[_0x5029('0x48')]['fn'](_0x5029('0x4b'),db['sequelize']['fn']('IF',db[_0x5029('0x48')]['literal'](_0x5029('0x5a')))),_0x5029('0x52')],[db[_0x5029('0x48')]['fn'](_0x5029('0x4b'),db[_0x5029('0x48')]['fn']('IF',db['sequelize'][_0x5029('0x49')](_0x5029('0x53')))),'answeringMachine']]})[_0x5029('0x20')](handleEntityNotFound(_0x3a82f7,null))[_0x5029('0x20')](respondWithResult(_0x3a82f7,null))[_0x5029('0x3e')](handleError(_0x3a82f7,null));};exports[_0x5029('0x5b')]=function(_0x9b1c13,_0x1bd1c6,_0x5bd84e){return db['VoiceQueue'][_0x5029('0x43')]({'where':{'id':_0x9b1c13['params']['id']}})[_0x5029('0x20')](handleEntityNotFound(_0x1bd1c6,null))[_0x5029('0x20')](function(_0x58db57){var _0x181956;if(_0x58db57){_0x181956=squel['insert']()['into'](_0x5029('0x5c'))[_0x5029('0x5d')]([_0x5029('0x5e'),_0x5029('0x5f'),'ContactId',_0x5029('0x60'),_0x5029('0x61'),'createdAt',_0x5029('0x62')],squel[_0x5029('0x63')]()['field']('ANY_VALUE(calleridnum)','phone')[_0x5029('0x64')](_0x5029('0x65'),_0x5029('0x5f'))[_0x5029('0x64')](_0x5029('0x66'),_0x5029('0x67'))[_0x5029('0x64')](_0x5029('0x68'),_0x5029('0x60'))['field']('ANY_VALUE(VoiceQueueId)',_0x5029('0x61'))[_0x5029('0x64')](_0x5029('0x65'),_0x5029('0x69'))[_0x5029('0x64')](_0x5029('0x65'),_0x5029('0x62'))['from'](_0x5029('0x6a'))[_0x5029('0x38')](_0x5029('0x6b'),_0x9b1c13['params']['id'][_0x5029('0x6c')]())[_0x5029('0x38')](_0x5029('0x6d'),_0x9b1c13['body'][_0x5029('0x6e')][_0x5029('0x6c')]())[_0x5029('0x38')]('calleridnum\x20IS\x20NOT\x20NULL')[_0x5029('0x38')](_0x5029('0x6f'),squel['select']()[_0x5029('0x64')](_0x5029('0x5e'))[_0x5029('0x70')](_0x5029('0x5c'))[_0x5029('0x38')]('VoiceQueueId\x20=\x20?',_0x9b1c13[_0x5029('0x40')]['id'][_0x5029('0x6c')]()))[_0x5029('0x38')](_0x5029('0x6f'),squel[_0x5029('0x63')]()['field'](_0x5029('0x71'))[_0x5029('0x70')](_0x5029('0x6a'))['where'](_0x5029('0x6b'),_0x9b1c13[_0x5029('0x40')]['id'][_0x5029('0x6c')]())[_0x5029('0x38')](_0x5029('0x72')))[_0x5029('0x73')](_0x5029('0x67')))['toString']();return db[_0x5029('0x48')][_0x5029('0x2c')](_0x181956);}return[];})[_0x5029('0x20')](respondWithResult(_0x1bd1c6,null))[_0x5029('0x3e')](handleError(_0x1bd1c6,null));};exports[_0x5029('0x74')]=function(_0x4c40d1,_0x209c83,_0x443070){return db[_0x5029('0x75')]['find']({'where':{'id':_0x4c40d1[_0x5029('0x40')]['id']}})[_0x5029('0x20')](handleEntityNotFound(_0x209c83,null))['then'](function(_0x5c8bd4){var _0x524825;if(_0x5c8bd4){_0x524825=squel[_0x5029('0x76')]()[_0x5029('0x77')](_0x5029('0x5c'))[_0x5029('0x5d')]([_0x5029('0x5e'),'scheduledAt',_0x5029('0x67'),_0x5029('0x60'),_0x5029('0x78'),'createdAt','updatedAt'],squel[_0x5029('0x63')]()[_0x5029('0x64')](_0x5029('0x79'),_0x5029('0x5e'))['field'](_0x5029('0x65'),_0x5029('0x5f'))[_0x5029('0x64')](_0x5029('0x66'),_0x5029('0x67'))[_0x5029('0x64')](_0x5029('0x68'),_0x5029('0x60'))['field'](_0x5029('0x7a'),'CampaignId')['field'](_0x5029('0x65'),'createdAt')[_0x5029('0x64')](_0x5029('0x65'),_0x5029('0x62'))[_0x5029('0x70')](_0x5029('0x6a'))[_0x5029('0x38')](_0x5029('0x7b'),_0x4c40d1[_0x5029('0x40')]['id']['toString']())['where'](_0x5029('0x6d'),_0x4c40d1['body']['state'][_0x5029('0x6c')]())['where']('calleridnum\x20IS\x20NOT\x20NULL')[_0x5029('0x38')](_0x5029('0x6f'),squel[_0x5029('0x63')]()[_0x5029('0x64')](_0x5029('0x5e'))['from'](_0x5029('0x5c'))[_0x5029('0x38')](_0x5029('0x7b'),_0x4c40d1['params']['id'][_0x5029('0x6c')]()))[_0x5029('0x38')](_0x5029('0x6f'),squel[_0x5029('0x63')]()[_0x5029('0x64')]('calleridnum')['from'](_0x5029('0x6a'))[_0x5029('0x38')]('CampaignId\x20=\x20?',_0x4c40d1[_0x5029('0x40')]['id'][_0x5029('0x6c')]())[_0x5029('0x38')](_0x5029('0x72')))[_0x5029('0x73')](_0x5029('0x67')))[_0x5029('0x6c')]();return db[_0x5029('0x48')]['query'](_0x524825);}return[];})['then'](respondWithResult(_0x209c83,null))[_0x5029('0x3e')](handleError(_0x209c83,null));};exports['checkContactHopper']=function(_0x20a259,_0x5e5f88,_0x36fdce){return db[_0x5029('0x7c')][_0x5029('0x7d')]({'where':{'VoiceQueueId':_0x20a259['body'][_0x5029('0x61')],'CampaignId':_0x20a259[_0x5029('0x45')][_0x5029('0x78')],'ContactId':_0x20a259['body'][_0x5029('0x67')]}})[_0x5029('0x20')](handleEntityNotFound(_0x5e5f88,null))[_0x5029('0x20')](function(_0x4421bd){if(_0x4421bd){return _0x4421bd;}return null;})[_0x5029('0x20')](respondWithResult(_0x5e5f88,null))[_0x5029('0x3e')](handleError(_0x5e5f88,null));}; \ No newline at end of file +var _0xacf4=['reject','update','then','destroy','error','stack','name','send','index','map','CmHopperFinal','rawAttributes','fieldName','key','model','query','keys','filters','attributes','fields','hasOwnProperty','sort','where','pick','filter','type','VIRTUAL','merge','options','include','findAll','rows','catch','show','params','intersection','length','includeAll','find','describe','body','uniqueid','countContactsQueueCampaignHopperFinal','sequelize','COUNT','literal','noSuchContacts','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','`state`\x20=\x208,\x201,\x20null','congestionContacts','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','`state`\x20=\x200,\x201,\x20null','busyContacts','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2022,\x201,\x20null','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','createdAt','updatedAt','field','ANY_VALUE(calleridnum)','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','VoiceQueueId','from','cm_hopper_final','VoiceQueueId\x20=\x20?','state\x20=\x20?','state','toString','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign','CampaignId','select','ANY_VALUE(ContactId)','ANY_VALUE(CampaignId)','NOW()','CampaignId\x20=\x20?','checkContactHopper','CmHopper','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range'];(function(_0x4a8166,_0x1d3cbc){var _0x4e16db=function(_0x3b459c){while(--_0x3b459c){_0x4a8166['push'](_0x4a8166['shift']());}};_0x4e16db(++_0x1d3cbc);}(_0xacf4,0xe7));var _0x4acf=function(_0x5deb8e,_0x11b3d2){_0x5deb8e=_0x5deb8e-0x0;var _0x3afbc9=_0xacf4[_0x5deb8e];return _0x3afbc9;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x4acf('0x0'));var jsonpatch=require(_0x4acf('0x1'));var rp=require(_0x4acf('0x2'));var moment=require(_0x4acf('0x3'));var BPromise=require(_0x4acf('0x4'));var Mustache=require(_0x4acf('0x5'));var util=require(_0x4acf('0x6'));var path=require('path');var sox=require(_0x4acf('0x7'));var csv=require(_0x4acf('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4acf('0x9'));var _=require(_0x4acf('0xa'));var squel=require(_0x4acf('0xb'));var crypto=require(_0x4acf('0xc'));var jsforce=require(_0x4acf('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4acf('0xe'));var Papa=require('papaparse');var Redis=require(_0x4acf('0xf'));var authService=require(_0x4acf('0x10'));var qs=require(_0x4acf('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4acf('0x12'));var logger=require(_0x4acf('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x4acf('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1783d2,_0x979f49){_0x979f49=_0x979f49||0xcc;return function(_0x3734e1){if(_0x3734e1){return _0x1783d2[_0x4acf('0x15')](_0x979f49);}return _0x1783d2[_0x4acf('0x16')](_0x979f49)[_0x4acf('0x17')]();};}function respondWithResult(_0x7ab3ea,_0x15386a){_0x15386a=_0x15386a||0xc8;return function(_0x2025ca){if(_0x2025ca){return _0x7ab3ea[_0x4acf('0x16')](_0x15386a)[_0x4acf('0x18')](_0x2025ca);}};}function respondWithFilteredResult(_0x5f0260,_0x1b584a){return function(_0x57d8e0){if(_0x57d8e0){var _0x34cec1=typeof _0x1b584a[_0x4acf('0x19')]===_0x4acf('0x1a')&&typeof _0x1b584a['limit']==='undefined';var _0x13d10e=_0x57d8e0[_0x4acf('0x1b')];var _0x240c00=_0x34cec1?0x0:_0x1b584a['offset'];var _0x2a678b=_0x34cec1?_0x57d8e0[_0x4acf('0x1b')]:_0x1b584a[_0x4acf('0x19')]+_0x1b584a[_0x4acf('0x1c')];var _0x2f0cec;if(_0x2a678b>=_0x13d10e){_0x2a678b=_0x13d10e;_0x2f0cec=0xc8;}else{_0x2f0cec=0xce;}_0x5f0260[_0x4acf('0x16')](_0x2f0cec);return _0x5f0260[_0x4acf('0x1d')](_0x4acf('0x1e'),_0x240c00+'-'+_0x2a678b+'/'+_0x13d10e)[_0x4acf('0x18')](_0x57d8e0);}return null;};}function patchUpdates(_0x2feb89){return function(_0x1a3118){try{jsonpatch['apply'](_0x1a3118,_0x2feb89,!![]);}catch(_0x28d698){return BPromise[_0x4acf('0x1f')](_0x28d698);}return _0x1a3118['save']();};}function saveUpdates(_0x41e5d2,_0x17775f){return function(_0x569d9e){if(_0x569d9e){return _0x569d9e[_0x4acf('0x20')](_0x41e5d2)[_0x4acf('0x21')](function(_0x433b7a){return _0x433b7a;});}return null;};}function removeEntity(_0x454555,_0x53885f){return function(_0x1a2286){if(_0x1a2286){return _0x1a2286[_0x4acf('0x22')]()['then'](function(){_0x454555[_0x4acf('0x16')](0xcc)[_0x4acf('0x17')]();});}};}function handleEntityNotFound(_0x52a84a,_0x126522){return function(_0x7ebb){if(!_0x7ebb){_0x52a84a[_0x4acf('0x15')](0x194);}return _0x7ebb;};}function handleError(_0x16458f,_0x571a30){_0x571a30=_0x571a30||0x1f4;return function(_0x50236d){logger[_0x4acf('0x23')](_0x50236d[_0x4acf('0x24')]);if(_0x50236d[_0x4acf('0x25')]){delete _0x50236d[_0x4acf('0x25')];}_0x16458f[_0x4acf('0x16')](_0x571a30)[_0x4acf('0x26')](_0x50236d);};}exports[_0x4acf('0x27')]=function(_0x7a1e79,_0x382c41){var _0x2a3830={},_0x57989e={},_0x3521c2={'count':0x0,'rows':[]};var _0x3f5614=_[_0x4acf('0x28')](db[_0x4acf('0x29')][_0x4acf('0x2a')],function(_0x28570f){return{'name':_0x28570f[_0x4acf('0x2b')],'type':_0x28570f['type'][_0x4acf('0x2c')]};});_0x57989e[_0x4acf('0x2d')]=_[_0x4acf('0x28')](_0x3f5614,'name');_0x57989e[_0x4acf('0x2e')]=_[_0x4acf('0x2f')](_0x7a1e79[_0x4acf('0x2e')]);_0x57989e[_0x4acf('0x30')]=_['intersection'](_0x57989e[_0x4acf('0x2d')],_0x57989e[_0x4acf('0x2e')]);_0x2a3830[_0x4acf('0x31')]=_['intersection'](_0x57989e[_0x4acf('0x2d')],qs[_0x4acf('0x32')](_0x7a1e79[_0x4acf('0x2e')][_0x4acf('0x32')]));_0x2a3830[_0x4acf('0x31')]=_0x2a3830[_0x4acf('0x31')]['length']?_0x2a3830[_0x4acf('0x31')]:_0x57989e[_0x4acf('0x2d')];if(!_0x7a1e79['query'][_0x4acf('0x33')]('nolimit')){_0x2a3830['limit']=qs['limit'](_0x7a1e79['query']['limit']);_0x2a3830['offset']=qs['offset'](_0x7a1e79[_0x4acf('0x2e')][_0x4acf('0x19')]);}_0x2a3830['order']=qs[_0x4acf('0x34')](_0x7a1e79[_0x4acf('0x2e')][_0x4acf('0x34')]);_0x2a3830[_0x4acf('0x35')]=qs[_0x4acf('0x30')](_[_0x4acf('0x36')](_0x7a1e79[_0x4acf('0x2e')],_0x57989e[_0x4acf('0x30')]),_0x3f5614);if(_0x7a1e79[_0x4acf('0x2e')][_0x4acf('0x37')]){_0x2a3830['where']=_['merge'](_0x2a3830[_0x4acf('0x35')],{'$or':_[_0x4acf('0x28')](_0x3f5614,function(_0x4859b6){if(_0x4859b6[_0x4acf('0x38')]!==_0x4acf('0x39')){var _0x43a2ea={};_0x43a2ea[_0x4859b6[_0x4acf('0x25')]]={'$like':'%'+_0x7a1e79['query']['filter']+'%'};return _0x43a2ea;}})});}_0x2a3830=_[_0x4acf('0x3a')]({},_0x2a3830,_0x7a1e79[_0x4acf('0x3b')]);var _0x3d5529={'where':_0x2a3830[_0x4acf('0x35')]};return db['CmHopperFinal'][_0x4acf('0x1b')](_0x3d5529)[_0x4acf('0x21')](function(_0x4e9370){_0x3521c2['count']=_0x4e9370;if(_0x7a1e79['query']['includeAll']){_0x2a3830[_0x4acf('0x3c')]=[{'all':!![]}];}return db[_0x4acf('0x29')][_0x4acf('0x3d')](_0x2a3830);})['then'](function(_0x1015e3){_0x3521c2[_0x4acf('0x3e')]=_0x1015e3;return _0x3521c2;})[_0x4acf('0x21')](respondWithFilteredResult(_0x382c41,_0x2a3830))[_0x4acf('0x3f')](handleError(_0x382c41,null));};exports[_0x4acf('0x40')]=function(_0xea75e4,_0x7cf2a){var _0x17d5e9={'raw':!![],'where':{'id':_0xea75e4[_0x4acf('0x41')]['id']}},_0x461547={};_0x461547[_0x4acf('0x2d')]=_['keys'](db[_0x4acf('0x29')][_0x4acf('0x2a')]);_0x461547[_0x4acf('0x2e')]=_[_0x4acf('0x2f')](_0xea75e4[_0x4acf('0x2e')]);_0x461547['filters']=_['intersection'](_0x461547[_0x4acf('0x2d')],_0x461547[_0x4acf('0x2e')]);_0x17d5e9[_0x4acf('0x31')]=_[_0x4acf('0x42')](_0x461547[_0x4acf('0x2d')],qs[_0x4acf('0x32')](_0xea75e4['query'][_0x4acf('0x32')]));_0x17d5e9['attributes']=_0x17d5e9[_0x4acf('0x31')][_0x4acf('0x43')]?_0x17d5e9['attributes']:_0x461547['model'];if(_0xea75e4[_0x4acf('0x2e')][_0x4acf('0x44')]){_0x17d5e9[_0x4acf('0x3c')]=[{'all':!![]}];}_0x17d5e9=_[_0x4acf('0x3a')]({},_0x17d5e9,_0xea75e4['options']);return db[_0x4acf('0x29')][_0x4acf('0x45')](_0x17d5e9)[_0x4acf('0x21')](handleEntityNotFound(_0x7cf2a,null))[_0x4acf('0x21')](respondWithResult(_0x7cf2a,null))[_0x4acf('0x3f')](handleError(_0x7cf2a,null));};exports[_0x4acf('0x46')]=function(_0x1bd7d0,_0x2d946c){return db['CmHopperFinal']['describe']()[_0x4acf('0x21')](respondWithResult(_0x2d946c,null))[_0x4acf('0x3f')](handleError(_0x2d946c,null));};exports[_0x4acf('0x20')]=function(_0x33bc52,_0x287406){if(_0x33bc52[_0x4acf('0x47')][_0x4acf('0x48')]){delete _0x33bc52[_0x4acf('0x47')][_0x4acf('0x48')];}return db[_0x4acf('0x29')][_0x4acf('0x45')]({'where':{'uniqueid':_0x33bc52[_0x4acf('0x41')]['id']}})['then'](handleEntityNotFound(_0x287406,null))[_0x4acf('0x21')](saveUpdates(_0x33bc52[_0x4acf('0x47')],null))[_0x4acf('0x21')](respondWithResult(_0x287406,null))[_0x4acf('0x3f')](handleError(_0x287406,null));};exports[_0x4acf('0x49')]=function(_0x3cf54a,_0x2785b9,_0x2d0561){return db[_0x4acf('0x29')][_0x4acf('0x3d')]({'raw':![],'where':{'VoiceQueueId':_0x3cf54a[_0x4acf('0x41')]['id']},'attributes':[[db[_0x4acf('0x4a')]['fn'](_0x4acf('0x4b'),db[_0x4acf('0x4a')]['fn']('IF',db[_0x4acf('0x4a')][_0x4acf('0x4c')]('`state`\x20=\x200,\x201,\x20null'))),_0x4acf('0x4d')],[db[_0x4acf('0x4a')]['fn'](_0x4acf('0x4b'),db['sequelize']['fn']('IF',db[_0x4acf('0x4a')][_0x4acf('0x4c')](_0x4acf('0x4e')))),_0x4acf('0x4f')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x4acf('0x4a')][_0x4acf('0x4c')](_0x4acf('0x50')))),'busyContacts'],[db[_0x4acf('0x4a')]['fn'](_0x4acf('0x4b'),db['sequelize']['fn']('IF',db[_0x4acf('0x4a')][_0x4acf('0x4c')](_0x4acf('0x51')))),_0x4acf('0x52')],[db['sequelize']['fn'](_0x4acf('0x4b'),db[_0x4acf('0x4a')]['fn']('IF',db[_0x4acf('0x4a')][_0x4acf('0x4c')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x4acf('0x53')],[db['sequelize']['fn'](_0x4acf('0x4b'),db['sequelize']['fn']('IF',db[_0x4acf('0x4a')][_0x4acf('0x4c')](_0x4acf('0x54')))),_0x4acf('0x55')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x4acf('0x4a')][_0x4acf('0x4c')]('`state`\x20=\x2022,\x201,\x20null'))),_0x4acf('0x56')],[db[_0x4acf('0x4a')]['fn']('COUNT',db[_0x4acf('0x4a')]['fn']('IF',db[_0x4acf('0x4a')]['literal'](_0x4acf('0x57')))),_0x4acf('0x58')]]})[_0x4acf('0x21')](handleEntityNotFound(_0x2785b9,null))['then'](respondWithResult(_0x2785b9,null))[_0x4acf('0x3f')](handleError(_0x2785b9,null));};exports[_0x4acf('0x59')]=function(_0xb5bd81,_0x452ee6,_0x54b093){return db[_0x4acf('0x29')][_0x4acf('0x3d')]({'raw':![],'where':{'CampaignId':_0xb5bd81[_0x4acf('0x41')]['id']},'attributes':[[db['sequelize']['fn'](_0x4acf('0x4b'),db[_0x4acf('0x4a')]['fn']('IF',db[_0x4acf('0x4a')][_0x4acf('0x4c')](_0x4acf('0x5a')))),_0x4acf('0x4d')],[db[_0x4acf('0x4a')]['fn'](_0x4acf('0x4b'),db[_0x4acf('0x4a')]['fn']('IF',db[_0x4acf('0x4a')][_0x4acf('0x4c')](_0x4acf('0x4e')))),_0x4acf('0x4f')],[db[_0x4acf('0x4a')]['fn'](_0x4acf('0x4b'),db['sequelize']['fn']('IF',db[_0x4acf('0x4a')][_0x4acf('0x4c')](_0x4acf('0x50')))),_0x4acf('0x5b')],[db[_0x4acf('0x4a')]['fn'](_0x4acf('0x4b'),db[_0x4acf('0x4a')]['fn']('IF',db[_0x4acf('0x4a')]['literal']('`state`\x20=\x208,\x201,\x20null'))),_0x4acf('0x52')],[db['sequelize']['fn'](_0x4acf('0x4b'),db['sequelize']['fn']('IF',db['sequelize']['literal'](_0x4acf('0x5c')))),_0x4acf('0x53')],[db[_0x4acf('0x4a')]['fn'](_0x4acf('0x4b'),db[_0x4acf('0x4a')]['fn']('IF',db[_0x4acf('0x4a')]['literal']('`state`\x20=\x2011\x20,\x201,\x20null'))),'abandonedContacts'],[db[_0x4acf('0x4a')]['fn'](_0x4acf('0x4b'),db[_0x4acf('0x4a')]['fn']('IF',db['sequelize'][_0x4acf('0x4c')](_0x4acf('0x5d')))),_0x4acf('0x56')],[db[_0x4acf('0x4a')]['fn'](_0x4acf('0x4b'),db[_0x4acf('0x4a')]['fn']('IF',db['sequelize'][_0x4acf('0x4c')]('`state`\x20=\x2019,\x201,\x20null'))),_0x4acf('0x58')]]})[_0x4acf('0x21')](handleEntityNotFound(_0x452ee6,null))[_0x4acf('0x21')](respondWithResult(_0x452ee6,null))[_0x4acf('0x3f')](handleError(_0x452ee6,null));};exports[_0x4acf('0x5e')]=function(_0x173655,_0x1f2dbc,_0xc0d942){return db[_0x4acf('0x5f')][_0x4acf('0x45')]({'where':{'id':_0x173655[_0x4acf('0x41')]['id']}})[_0x4acf('0x21')](handleEntityNotFound(_0x1f2dbc,null))['then'](function(_0x11f356){var _0xacca91;if(_0x11f356){_0xacca91=squel[_0x4acf('0x60')]()[_0x4acf('0x61')](_0x4acf('0x62'))[_0x4acf('0x63')]([_0x4acf('0x64'),_0x4acf('0x65'),_0x4acf('0x66'),_0x4acf('0x67'),'VoiceQueueId',_0x4acf('0x68'),_0x4acf('0x69')],squel['select']()[_0x4acf('0x6a')](_0x4acf('0x6b'),'phone')[_0x4acf('0x6a')]('NOW()','scheduledAt')[_0x4acf('0x6a')]('ANY_VALUE(ContactId)',_0x4acf('0x66'))[_0x4acf('0x6a')](_0x4acf('0x6c'),_0x4acf('0x67'))['field'](_0x4acf('0x6d'),_0x4acf('0x6e'))['field']('NOW()','createdAt')[_0x4acf('0x6a')]('NOW()',_0x4acf('0x69'))[_0x4acf('0x6f')](_0x4acf('0x70'))['where'](_0x4acf('0x71'),_0x173655[_0x4acf('0x41')]['id']['toString']())[_0x4acf('0x35')](_0x4acf('0x72'),_0x173655['body'][_0x4acf('0x73')][_0x4acf('0x74')]())[_0x4acf('0x35')](_0x4acf('0x75'))[_0x4acf('0x35')](_0x4acf('0x76'),squel['select']()[_0x4acf('0x6a')]('phone')[_0x4acf('0x6f')](_0x4acf('0x62'))['where']('VoiceQueueId\x20=\x20?',_0x173655['params']['id'][_0x4acf('0x74')]()))['where']('calleridnum\x20NOT\x20IN\x20(?)',squel['select']()[_0x4acf('0x6a')]('calleridnum')[_0x4acf('0x6f')](_0x4acf('0x70'))[_0x4acf('0x35')](_0x4acf('0x71'),_0x173655[_0x4acf('0x41')]['id']['toString']())['where'](_0x4acf('0x77')))[_0x4acf('0x78')](_0x4acf('0x66')))[_0x4acf('0x74')]();return db[_0x4acf('0x4a')]['query'](_0xacca91);}return[];})[_0x4acf('0x21')](respondWithResult(_0x1f2dbc,null))[_0x4acf('0x3f')](handleError(_0x1f2dbc,null));};exports[_0x4acf('0x79')]=function(_0x453c6d,_0x1a82e7,_0x3d02c7){return db[_0x4acf('0x7a')]['find']({'where':{'id':_0x453c6d[_0x4acf('0x41')]['id']}})['then'](handleEntityNotFound(_0x1a82e7,null))[_0x4acf('0x21')](function(_0x1bbe6d){var _0x2a36e2;if(_0x1bbe6d){_0x2a36e2=squel[_0x4acf('0x60')]()[_0x4acf('0x61')]('cm_hopper')[_0x4acf('0x63')](['phone',_0x4acf('0x65'),_0x4acf('0x66'),'ListId',_0x4acf('0x7b'),_0x4acf('0x68'),_0x4acf('0x69')],squel[_0x4acf('0x7c')]()[_0x4acf('0x6a')]('ANY_VALUE(calleridnum)',_0x4acf('0x64'))['field']('NOW()',_0x4acf('0x65'))[_0x4acf('0x6a')](_0x4acf('0x7d'),_0x4acf('0x66'))['field']('ANY_VALUE(ListId)',_0x4acf('0x67'))[_0x4acf('0x6a')](_0x4acf('0x7e'),_0x4acf('0x7b'))[_0x4acf('0x6a')](_0x4acf('0x7f'),_0x4acf('0x68'))[_0x4acf('0x6a')]('NOW()','updatedAt')[_0x4acf('0x6f')](_0x4acf('0x70'))[_0x4acf('0x35')](_0x4acf('0x80'),_0x453c6d[_0x4acf('0x41')]['id'][_0x4acf('0x74')]())[_0x4acf('0x35')](_0x4acf('0x72'),_0x453c6d[_0x4acf('0x47')]['state'][_0x4acf('0x74')]())[_0x4acf('0x35')](_0x4acf('0x75'))[_0x4acf('0x35')](_0x4acf('0x76'),squel[_0x4acf('0x7c')]()[_0x4acf('0x6a')](_0x4acf('0x64'))[_0x4acf('0x6f')](_0x4acf('0x62'))[_0x4acf('0x35')](_0x4acf('0x80'),_0x453c6d[_0x4acf('0x41')]['id']['toString']()))[_0x4acf('0x35')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x4acf('0x7c')]()[_0x4acf('0x6a')]('calleridnum')[_0x4acf('0x6f')](_0x4acf('0x70'))['where']('CampaignId\x20=\x20?',_0x453c6d[_0x4acf('0x41')]['id'][_0x4acf('0x74')]())['where']('state\x20=\x204'))[_0x4acf('0x78')](_0x4acf('0x66')))[_0x4acf('0x74')]();return db[_0x4acf('0x4a')]['query'](_0x2a36e2);}return[];})[_0x4acf('0x21')](respondWithResult(_0x1a82e7,null))[_0x4acf('0x3f')](handleError(_0x1a82e7,null));};exports[_0x4acf('0x81')]=function(_0x34e1ea,_0x43e9bf,_0x367ad4){return db[_0x4acf('0x82')]['findOne']({'where':{'VoiceQueueId':_0x34e1ea[_0x4acf('0x47')][_0x4acf('0x6e')],'CampaignId':_0x34e1ea[_0x4acf('0x47')]['CampaignId'],'ContactId':_0x34e1ea[_0x4acf('0x47')][_0x4acf('0x66')]}})[_0x4acf('0x21')](handleEntityNotFound(_0x43e9bf,null))[_0x4acf('0x21')](function(_0x37ffab){if(_0x37ffab){return _0x37ffab;}return null;})[_0x4acf('0x21')](respondWithResult(_0x43e9bf,null))[_0x4acf('0x3f')](handleError(_0x43e9bf,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index a08fe8c..091ac19 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 _0x4f24=['exports','define','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','lodash','api','moment','path','rimraf','../../config/environment','./cmHopperFinal.attributes'];(function(_0x3f64d5,_0x200567){var _0x476cbf=function(_0x5b49fe){while(--_0x5b49fe){_0x3f64d5['push'](_0x3f64d5['shift']());}};_0x476cbf(++_0x200567);}(_0x4f24,0x165));var _0x44f2=function(_0x4bb145,_0x3e7d33){_0x4bb145=_0x4bb145-0x0;var _0x4db596=_0x4f24[_0x4bb145];return _0x4db596;};'use strict';var _=require(_0x44f2('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x44f2('0x1'));var moment=require(_0x44f2('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x44f2('0x3'));var rimraf=require(_0x44f2('0x4'));var config=require(_0x44f2('0x5'));var attributes=require(_0x44f2('0x6'));module[_0x44f2('0x7')]=function(_0x53e010,_0x4e49b9){return _0x53e010[_0x44f2('0x8')](_0x44f2('0x9'),attributes,{'tableName':_0x44f2('0xa'),'paranoid':![],'indexes':[{'name':_0x44f2('0xb'),'fields':[_0x44f2('0xb')]},{'name':_0x44f2('0xc'),'fields':[_0x44f2('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x985e=['cm_hopper_final','calleridnum','uniqueid','lodash','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./cmHopperFinal.attributes','exports','define','CmHopperFinal'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x985e,0x1ed));var _0xe985=function(_0x94306f,_0x2b3a79){_0x94306f=_0x94306f-0x0;var _0x4ce98d=_0x985e[_0x94306f];return _0x4ce98d;};'use strict';var _=require(_0xe985('0x0'));var util=require('util');var logger=require(_0xe985('0x1'))(_0xe985('0x2'));var moment=require(_0xe985('0x3'));var BPromise=require(_0xe985('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xe985('0x5'));var config=require(_0xe985('0x6'));var attributes=require(_0xe985('0x7'));module[_0xe985('0x8')]=function(_0x59f5ec,_0x52748c){return _0x59f5ec[_0xe985('0x9')](_0xe985('0xa'),attributes,{'tableName':_0xe985('0xb'),'paranoid':![],'indexes':[{'name':_0xe985('0xc'),'fields':['calleridnum']},{'name':_0xe985('0xd'),'fields':[_0xe985('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index b8d1879..62074d1 100644 --- a/server/api/cmHopperFinal/cmHopperFinal.rpc.js +++ b/server/api/cmHopperFinal/cmHopperFinal.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['../../config/environment','jayson/promise','http','info','CmHopperFinal,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','CmHopperFinal','create','body','options','raw','CreateCmHopperFinal','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x501477,_0x3250dd){var _0x100d62=function(_0x1c3269){while(--_0x1c3269){_0x501477['push'](_0x501477['shift']());}};_0x100d62(++_0x3250dd);}(_0x7a54,0x106));var _0x47a5=function(_0x20fc31,_0x3f25e4){_0x20fc31=_0x20fc31-0x0;var _0x3b0d81=_0x7a54[_0x20fc31];return _0x3b0d81;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('CmHopperFinal,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}exports['CreateCmHopperFinal']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')](_0x5247fd[_0x47a5('0x17')],{'raw':_0x5247fd[_0x47a5('0x18')]?_0x5247fd[_0x47a5('0x18')][_0x47a5('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x1570bc){logger[_0x47a5('0xb')]('CreateCmHopperFinal',_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1a'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1570bc));_0xaf70a6(_0x1570bc);})['catch'](function(_0xb8ae6c){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xb8ae6c[_0x47a5('0x11')],_0x5247fd);_0x2ce454(_0x423a81['error'](0x1f4,_0xb8ae6c[_0x47a5('0x11')]));});});}; \ No newline at end of file +var _0xb10b=['debug','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopperFinal,\x20%s,\x20%s','CmHopperFinal,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateCmHopperFinal','CmHopperFinal','create','options','raw'];(function(_0x14a65e,_0x5deaa8){var _0xdf1a9=function(_0x21eec4){while(--_0x21eec4){_0x14a65e['push'](_0x14a65e['shift']());}};_0xdf1a9(++_0x5deaa8);}(_0xb10b,0x12a));var _0xbb10=function(_0x469a3c,_0x5ebc10){_0x469a3c=_0x469a3c-0x0;var _0x968f4=_0xb10b[_0x469a3c];return _0x968f4;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')](_0x378da8['body'],{'raw':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![]})[_0xbb10('0xc')](function(_0xdf237d){logger[_0xbb10('0xd')]('CreateCmHopperFinal',_0x378da8);logger[_0xbb10('0x1a')](_0xbb10('0x15'),_0x378da8,JSON['stringify'](_0xdf237d));_0x575cca(_0xdf237d);})['catch'](function(_0x8e2b97){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x8e2b97[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x8e2b97[_0xbb10('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/index.js b/server/api/cmHopperFinal/index.js index 14b82f6..551aef4 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 _0x9149=['moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper','put','update','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','get','isAuthenticated','index','/describe','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id'];(function(_0x5099c0,_0x1fd583){var _0x3ccdfe=function(_0x325294){while(--_0x325294){_0x5099c0['push'](_0x5099c0['shift']());}};_0x3ccdfe(++_0x1fd583);}(_0x9149,0x1d7));var _0x9914=function(_0x382bef,_0x1fd4f5){_0x382bef=_0x382bef-0x0;var _0x55ade0=_0x9149[_0x382bef];return _0x55ade0;};'use strict';var multer=require(_0x9914('0x0'));var util=require(_0x9914('0x1'));var path=require(_0x9914('0x2'));var timeout=require(_0x9914('0x3'));var express=require(_0x9914('0x4'));var router=express[_0x9914('0x5')]();var fs_extra=require(_0x9914('0x6'));var auth=require(_0x9914('0x7'));var interaction=require(_0x9914('0x8'));var config=require(_0x9914('0x9'));var controller=require(_0x9914('0xa'));router[_0x9914('0xb')]('/',auth[_0x9914('0xc')](),controller[_0x9914('0xd')]);router[_0x9914('0xb')](_0x9914('0xe'),auth[_0x9914('0xc')](),controller['describe']);router[_0x9914('0xb')]('/:id',auth[_0x9914('0xc')](),controller[_0x9914('0xf')]);router['get'](_0x9914('0x10'),auth[_0x9914('0xc')](),controller[_0x9914('0x11')]);router[_0x9914('0xb')](_0x9914('0x12'),auth[_0x9914('0xc')](),controller[_0x9914('0x13')]);router[_0x9914('0x14')](_0x9914('0x15'),auth[_0x9914('0xc')](),controller[_0x9914('0x16')]);router[_0x9914('0x14')](_0x9914('0x17'),auth['isAuthenticated'](),controller[_0x9914('0x18')]);router[_0x9914('0x14')](_0x9914('0x19'),auth[_0x9914('0xc')](),controller[_0x9914('0x1a')]);router[_0x9914('0x1b')]('/:id',auth['isAuthenticated'](),controller[_0x9914('0x1c')]);module['exports']=router; \ No newline at end of file +var _0xc542=['put','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','./cmHopperFinal.controller','isAuthenticated','get','/describe','describe','/:id','show','countContactsIvrCampaignHopperFinal','post','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper'];(function(_0x10a45d,_0x5981cc){var _0x24ede4=function(_0x3a2838){while(--_0x3a2838){_0x10a45d['push'](_0x10a45d['shift']());}};_0x24ede4(++_0x5981cc);}(_0xc542,0xd1));var _0x2c54=function(_0x4d8ed9,_0x2ae284){_0x4d8ed9=_0x4d8ed9-0x0;var _0x1e2140=_0xc542[_0x4d8ed9];return _0x1e2140;};'use strict';var multer=require(_0x2c54('0x0'));var util=require(_0x2c54('0x1'));var path=require(_0x2c54('0x2'));var timeout=require(_0x2c54('0x3'));var express=require(_0x2c54('0x4'));var router=express[_0x2c54('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x2c54('0x6'));var controller=require(_0x2c54('0x7'));router['get']('/',auth[_0x2c54('0x8')](),controller['index']);router[_0x2c54('0x9')](_0x2c54('0xa'),auth[_0x2c54('0x8')](),controller[_0x2c54('0xb')]);router['get'](_0x2c54('0xc'),auth[_0x2c54('0x8')](),controller[_0x2c54('0xd')]);router[_0x2c54('0x9')]('/voice/queue/countAttributes/:id',auth[_0x2c54('0x8')](),controller['countContactsQueueCampaignHopperFinal']);router[_0x2c54('0x9')]('/campaign/countAttributes/:id',auth[_0x2c54('0x8')](),controller[_0x2c54('0xe')]);router[_0x2c54('0xf')]('/voice/queue/moveContacts/:id',auth[_0x2c54('0x8')](),controller[_0x2c54('0x10')]);router[_0x2c54('0xf')](_0x2c54('0x11'),auth[_0x2c54('0x8')](),controller[_0x2c54('0x12')]);router[_0x2c54('0xf')](_0x2c54('0x13'),auth[_0x2c54('0x8')](),controller[_0x2c54('0x14')]);router[_0x2c54('0x15')](_0x2c54('0xc'),auth[_0x2c54('0x8')](),controller['update']);module[_0x2c54('0x16')]=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index aeec1c5..66231d8 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 _0x6ed8=['BOOLEAN','sequelize','exports','STRING','DATE','INTEGER'];(function(_0x3d5437,_0x339d5d){var _0x260503=function(_0x75b633){while(--_0x75b633){_0x3d5437['push'](_0x3d5437['shift']());}};_0x260503(++_0x339d5d);}(_0x6ed8,0x6d));var _0x86ed=function(_0x2799b2,_0x3d0279){_0x2799b2=_0x2799b2-0x0;var _0x4af7f9=_0x6ed8[_0x2799b2];return _0x4af7f9;};'use strict';var Sequelize=require(_0x86ed('0x0'));module[_0x86ed('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x86ed('0x2')]},'scheduledat':{'type':Sequelize[_0x86ed('0x3')]},'countbusyretry':{'type':Sequelize[_0x86ed('0x4')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x86ed('0x4')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x86ed('0x4')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x86ed('0x4')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x86ed('0x2')]},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0x86ed('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x86ed('0x3')]},'responsetime':{'type':Sequelize[_0x86ed('0x3')]},'answertime':{'type':Sequelize[_0x86ed('0x3')]},'droptime':{'type':Sequelize[_0x86ed('0x3')]},'endtime':{'type':Sequelize[_0x86ed('0x3')]},'ringtime':{'type':Sequelize[_0x86ed('0x4')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x86ed('0x4')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x86ed('0x4')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x86ed('0x4')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x86ed('0x2')]},'campaign':{'type':Sequelize[_0x86ed('0x2')]},'campaigntype':{'type':Sequelize[_0x86ed('0x2')]},'membername':{'type':Sequelize[_0x86ed('0x2')]},'reason':{'type':Sequelize[_0x86ed('0x2')]},'amd':{'type':Sequelize[_0x86ed('0x5')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callback':{'type':Sequelize[_0x86ed('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x86ed('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x86ed('0x3')]},'recallme':{'type':Sequelize[_0x86ed('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x86ed('0x3')]},'edited':{'type':Sequelize[_0x86ed('0x5')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x86ed('0x4')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x86ed('0x4')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x4541=['INTEGER','STRING','BOOLEAN','sequelize','exports','DATE'];(function(_0x4baae2,_0x487ab6){var _0x1a2285=function(_0x1cea47){while(--_0x1cea47){_0x4baae2['push'](_0x4baae2['shift']());}};_0x1a2285(++_0x487ab6);}(_0x4541,0x1cb));var _0x1454=function(_0x370218,_0x178f98){_0x370218=_0x370218-0x0;var _0x38e62c=_0x4541[_0x370218];return _0x38e62c;};'use strict';var Sequelize=require(_0x1454('0x0'));module[_0x1454('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x1454('0x2')]},'countbusyretry':{'type':Sequelize[_0x1454('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x1454('0x3')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x1454('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x1454('0x4')]},'originatecalleridnum':{'type':Sequelize[_0x1454('0x4')]},'originatecalleridname':{'type':Sequelize[_0x1454('0x4')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0x1454('0x2')]},'answertime':{'type':Sequelize[_0x1454('0x2')]},'droptime':{'type':Sequelize[_0x1454('0x2')]},'endtime':{'type':Sequelize[_0x1454('0x2')]},'ringtime':{'type':Sequelize[_0x1454('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x1454('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x1454('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0x1454('0x4')]},'campaigntype':{'type':Sequelize[_0x1454('0x4')]},'membername':{'type':Sequelize[_0x1454('0x4')]},'reason':{'type':Sequelize[_0x1454('0x4')]},'amd':{'type':Sequelize[_0x1454('0x5')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callback':{'type':Sequelize[_0x1454('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x1454('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x1454('0x2')]},'recallme':{'type':Sequelize[_0x1454('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x1454('0x2')]},'edited':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x1454('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x1454('0x3')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x1454('0x3')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x1454('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index 2df54cc..452910c 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 _0x1328=['moment','bluebird','util','path','sox','to-csv','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','end','status','offset','undefined','count','set','json','apply','reject','update','destroy','then','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','options','includeAll','include','CmHopperHistory','params','keys','merge','find','catch','create','body','describe','uniqueid','eml-format','rimraf','zip-dir','request-promise'];(function(_0x20a590,_0x1e8a6d){var _0x2e1b41=function(_0x48359f){while(--_0x48359f){_0x20a590['push'](_0x20a590['shift']());}};_0x2e1b41(++_0x1e8a6d);}(_0x1328,0x169));var _0x8132=function(_0x412e27,_0x20a978){_0x412e27=_0x412e27-0x0;var _0x53da42=_0x1328[_0x412e27];return _0x53da42;};'use strict';var emlformat=require(_0x8132('0x0'));var rimraf=require(_0x8132('0x1'));var zipdir=require(_0x8132('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8132('0x3'));var moment=require(_0x8132('0x4'));var BPromise=require(_0x8132('0x5'));var Mustache=require('mustache');var util=require(_0x8132('0x6'));var path=require(_0x8132('0x7'));var sox=require(_0x8132('0x8'));var csv=require(_0x8132('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8132('0xa'));var crypto=require('crypto');var jsforce=require(_0x8132('0xb'));var deskjs=require(_0x8132('0xc'));var toCsv=require(_0x8132('0x9'));var querystring=require(_0x8132('0xd'));var Papa=require(_0x8132('0xe'));var Redis=require(_0x8132('0xf'));var authService=require(_0x8132('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x8132('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x8132('0x12'));var utils=require(_0x8132('0x13'));var config=require(_0x8132('0x14'));var licenseUtil=require(_0x8132('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2e46f0,_0x4d9f35){_0x4d9f35=_0x4d9f35||0xcc;return function(_0x5b7eb7){if(_0x5b7eb7){return _0x2e46f0['sendStatus'](_0x4d9f35);}return _0x2e46f0['status'](_0x4d9f35)[_0x8132('0x16')]();};}function respondWithResult(_0x3aa6ce,_0x535e3c){_0x535e3c=_0x535e3c||0xc8;return function(_0x13729b){if(_0x13729b){return _0x3aa6ce[_0x8132('0x17')](_0x535e3c)['json'](_0x13729b);}};}function respondWithFilteredResult(_0xeeae2a,_0xccdf37){return function(_0xb5db){if(_0xb5db){var _0x4c5439=typeof _0xccdf37[_0x8132('0x18')]===_0x8132('0x19')&&typeof _0xccdf37['limit']===_0x8132('0x19');var _0x4adc0b=_0xb5db[_0x8132('0x1a')];var _0x37e4bb=_0x4c5439?0x0:_0xccdf37[_0x8132('0x18')];var _0x4651c1=_0x4c5439?_0xb5db[_0x8132('0x1a')]:_0xccdf37['offset']+_0xccdf37['limit'];var _0x5391be;if(_0x4651c1>=_0x4adc0b){_0x4651c1=_0x4adc0b;_0x5391be=0xc8;}else{_0x5391be=0xce;}_0xeeae2a[_0x8132('0x17')](_0x5391be);return _0xeeae2a[_0x8132('0x1b')]('Content-Range',_0x37e4bb+'-'+_0x4651c1+'/'+_0x4adc0b)[_0x8132('0x1c')](_0xb5db);}return null;};}function patchUpdates(_0x492d88){return function(_0x458fbc){try{jsonpatch[_0x8132('0x1d')](_0x458fbc,_0x492d88,!![]);}catch(_0x1d7150){return BPromise[_0x8132('0x1e')](_0x1d7150);}return _0x458fbc['save']();};}function saveUpdates(_0x5c7c2c,_0x408208){return function(_0x2e46cb){if(_0x2e46cb){return _0x2e46cb[_0x8132('0x1f')](_0x5c7c2c)['then'](function(_0x3b4137){return _0x3b4137;});}return null;};}function removeEntity(_0x1021f7,_0x46b22f){return function(_0x461edc){if(_0x461edc){return _0x461edc[_0x8132('0x20')]()[_0x8132('0x21')](function(){_0x1021f7[_0x8132('0x17')](0xcc)[_0x8132('0x16')]();});}};}function handleEntityNotFound(_0x3bfd9f,_0x2929db){return function(_0x434eff){if(!_0x434eff){_0x3bfd9f[_0x8132('0x22')](0x194);}return _0x434eff;};}function handleError(_0x532ebe,_0x301451){_0x301451=_0x301451||0x1f4;return function(_0x3a6d54){logger[_0x8132('0x23')](_0x3a6d54[_0x8132('0x24')]);if(_0x3a6d54['name']){delete _0x3a6d54[_0x8132('0x25')];}_0x532ebe[_0x8132('0x17')](_0x301451)[_0x8132('0x26')](_0x3a6d54);};}exports[_0x8132('0x27')]=function(_0x405e30,_0x1c087e){var _0x3dc1d4={},_0x19b9ad={},_0x1d4e7d={'count':0x0,'rows':[]};var _0x2c270a=_[_0x8132('0x28')](db['CmHopperHistory'][_0x8132('0x29')],function(_0x215993){return{'name':_0x215993[_0x8132('0x2a')],'type':_0x215993[_0x8132('0x2b')][_0x8132('0x2c')]};});_0x19b9ad[_0x8132('0x2d')]=_[_0x8132('0x28')](_0x2c270a,_0x8132('0x25'));_0x19b9ad[_0x8132('0x2e')]=_['keys'](_0x405e30[_0x8132('0x2e')]);_0x19b9ad[_0x8132('0x2f')]=_['intersection'](_0x19b9ad['model'],_0x19b9ad[_0x8132('0x2e')]);_0x3dc1d4[_0x8132('0x30')]=_[_0x8132('0x31')](_0x19b9ad[_0x8132('0x2d')],qs[_0x8132('0x32')](_0x405e30[_0x8132('0x2e')][_0x8132('0x32')]));_0x3dc1d4[_0x8132('0x30')]=_0x3dc1d4[_0x8132('0x30')][_0x8132('0x33')]?_0x3dc1d4['attributes']:_0x19b9ad[_0x8132('0x2d')];if(!_0x405e30[_0x8132('0x2e')][_0x8132('0x34')](_0x8132('0x35'))){_0x3dc1d4[_0x8132('0x36')]=qs[_0x8132('0x36')](_0x405e30[_0x8132('0x2e')][_0x8132('0x36')]);_0x3dc1d4[_0x8132('0x18')]=qs[_0x8132('0x18')](_0x405e30[_0x8132('0x2e')][_0x8132('0x18')]);}_0x3dc1d4[_0x8132('0x37')]=qs[_0x8132('0x38')](_0x405e30[_0x8132('0x2e')][_0x8132('0x38')]);_0x3dc1d4[_0x8132('0x39')]=qs[_0x8132('0x2f')](_[_0x8132('0x3a')](_0x405e30[_0x8132('0x2e')],_0x19b9ad[_0x8132('0x2f')]),_0x2c270a);if(_0x405e30[_0x8132('0x2e')][_0x8132('0x3b')]){_0x3dc1d4[_0x8132('0x39')]=_['merge'](_0x3dc1d4[_0x8132('0x39')],{'$or':_['map'](_0x2c270a,function(_0x589985){if(_0x589985[_0x8132('0x2b')]!=='VIRTUAL'){var _0x528c68={};_0x528c68[_0x589985[_0x8132('0x25')]]={'$like':'%'+_0x405e30[_0x8132('0x2e')][_0x8132('0x3b')]+'%'};return _0x528c68;}})});}_0x3dc1d4=_['merge']({},_0x3dc1d4,_0x405e30[_0x8132('0x3c')]);var _0x1c892f={'where':_0x3dc1d4['where']};return db['CmHopperHistory'][_0x8132('0x1a')](_0x1c892f)['then'](function(_0x3f2a18){_0x1d4e7d[_0x8132('0x1a')]=_0x3f2a18;if(_0x405e30[_0x8132('0x2e')][_0x8132('0x3d')]){_0x3dc1d4[_0x8132('0x3e')]=[{'all':!![]}];}return db[_0x8132('0x3f')]['findAll'](_0x3dc1d4);})['then'](function(_0x8b3487){_0x1d4e7d['rows']=_0x8b3487;return _0x1d4e7d;})[_0x8132('0x21')](respondWithFilteredResult(_0x1c087e,_0x3dc1d4))['catch'](handleError(_0x1c087e,null));};exports['show']=function(_0xd48a30,_0x2383b4){var _0x264581={'raw':!![],'where':{'id':_0xd48a30[_0x8132('0x40')]['id']}},_0x3884c5={};_0x3884c5['model']=_[_0x8132('0x41')](db[_0x8132('0x3f')][_0x8132('0x29')]);_0x3884c5[_0x8132('0x2e')]=_[_0x8132('0x41')](_0xd48a30['query']);_0x3884c5[_0x8132('0x2f')]=_[_0x8132('0x31')](_0x3884c5['model'],_0x3884c5[_0x8132('0x2e')]);_0x264581[_0x8132('0x30')]=_['intersection'](_0x3884c5[_0x8132('0x2d')],qs[_0x8132('0x32')](_0xd48a30[_0x8132('0x2e')]['fields']));_0x264581[_0x8132('0x30')]=_0x264581[_0x8132('0x30')][_0x8132('0x33')]?_0x264581[_0x8132('0x30')]:_0x3884c5[_0x8132('0x2d')];if(_0xd48a30[_0x8132('0x2e')][_0x8132('0x3d')]){_0x264581[_0x8132('0x3e')]=[{'all':!![]}];}_0x264581=_[_0x8132('0x42')]({},_0x264581,_0xd48a30['options']);return db['CmHopperHistory'][_0x8132('0x43')](_0x264581)[_0x8132('0x21')](handleEntityNotFound(_0x2383b4,null))[_0x8132('0x21')](respondWithResult(_0x2383b4,null))[_0x8132('0x44')](handleError(_0x2383b4,null));};exports[_0x8132('0x45')]=function(_0x12bd36,_0x5be250){return db['CmHopperHistory'][_0x8132('0x45')](_0x12bd36[_0x8132('0x46')],{})[_0x8132('0x21')](respondWithResult(_0x5be250,0xc9))[_0x8132('0x44')](handleError(_0x5be250,null));};exports[_0x8132('0x47')]=function(_0x3bb07c,_0xff56a8){return db[_0x8132('0x3f')][_0x8132('0x47')]()[_0x8132('0x21')](respondWithResult(_0xff56a8,null))[_0x8132('0x44')](handleError(_0xff56a8,null));};exports[_0x8132('0x1f')]=function(_0x1e4cd7,_0x421f90){if(_0x1e4cd7['body'][_0x8132('0x48')]){delete _0x1e4cd7[_0x8132('0x46')][_0x8132('0x48')];}return db[_0x8132('0x3f')][_0x8132('0x43')]({'where':{'uniqueid':_0x1e4cd7[_0x8132('0x40')]['id']}})[_0x8132('0x21')](handleEntityNotFound(_0x421f90,null))['then'](saveUpdates(_0x1e4cd7[_0x8132('0x46')],null))[_0x8132('0x21')](respondWithResult(_0x421f90,null))[_0x8132('0x44')](handleError(_0x421f90,null));}; \ No newline at end of file +var _0x038a=['rimraf','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','undefined','count','offset','set','Content-Range','json','reject','save','update','then','destroy','sendStatus','error','stack','name','index','map','CmHopperHistory','fieldName','key','model','query','filters','intersection','attributes','fields','length','nolimit','limit','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','show','params','rawAttributes','keys','find','create','catch','describe','uniqueid','body'];(function(_0x30dd7e,_0x45b226){var _0x5916f4=function(_0x410fcf){while(--_0x410fcf){_0x30dd7e['push'](_0x30dd7e['shift']());}};_0x5916f4(++_0x45b226);}(_0x038a,0x1ea));var _0xa038=function(_0x17928f,_0x4ad33f){_0x17928f=_0x17928f-0x0;var _0x500b63=_0x038a[_0x17928f];return _0x500b63;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa038('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa038('0x1'));var rp=require('request-promise');var moment=require(_0xa038('0x2'));var BPromise=require(_0xa038('0x3'));var Mustache=require(_0xa038('0x4'));var util=require('util');var path=require(_0xa038('0x5'));var sox=require(_0xa038('0x6'));var csv=require(_0xa038('0x7'));var ejs=require(_0xa038('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa038('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xa038('0xa'));var toCsv=require(_0xa038('0x7'));var querystring=require('querystring');var Papa=require(_0xa038('0xb'));var Redis=require(_0xa038('0xc'));var authService=require('../../components/auth/service');var qs=require(_0xa038('0xd'));var as=require(_0xa038('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa038('0xf'))(_0xa038('0x10'));var utils=require(_0xa038('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0xa038('0x12'));var db=require(_0xa038('0x13'))['db'];function respondWithStatusCode(_0xa3df75,_0x2e8fa0){_0x2e8fa0=_0x2e8fa0||0xcc;return function(_0x2731b4){if(_0x2731b4){return _0xa3df75['sendStatus'](_0x2e8fa0);}return _0xa3df75[_0xa038('0x14')](_0x2e8fa0)[_0xa038('0x15')]();};}function respondWithResult(_0x373ded,_0x460acc){_0x460acc=_0x460acc||0xc8;return function(_0x19b989){if(_0x19b989){return _0x373ded['status'](_0x460acc)['json'](_0x19b989);}};}function respondWithFilteredResult(_0x20810f,_0x5c3f9f){return function(_0x524feb){if(_0x524feb){var _0x10a26e=typeof _0x5c3f9f['offset']===_0xa038('0x16')&&typeof _0x5c3f9f['limit']===_0xa038('0x16');var _0x5ed9ca=_0x524feb[_0xa038('0x17')];var _0x3651a9=_0x10a26e?0x0:_0x5c3f9f[_0xa038('0x18')];var _0x51d0d5=_0x10a26e?_0x524feb[_0xa038('0x17')]:_0x5c3f9f[_0xa038('0x18')]+_0x5c3f9f['limit'];var _0x1db679;if(_0x51d0d5>=_0x5ed9ca){_0x51d0d5=_0x5ed9ca;_0x1db679=0xc8;}else{_0x1db679=0xce;}_0x20810f[_0xa038('0x14')](_0x1db679);return _0x20810f[_0xa038('0x19')](_0xa038('0x1a'),_0x3651a9+'-'+_0x51d0d5+'/'+_0x5ed9ca)[_0xa038('0x1b')](_0x524feb);}return null;};}function patchUpdates(_0x2299f1){return function(_0x39440f){try{jsonpatch['apply'](_0x39440f,_0x2299f1,!![]);}catch(_0x1675b3){return BPromise[_0xa038('0x1c')](_0x1675b3);}return _0x39440f[_0xa038('0x1d')]();};}function saveUpdates(_0x50b700,_0x15f443){return function(_0x1e1a00){if(_0x1e1a00){return _0x1e1a00[_0xa038('0x1e')](_0x50b700)[_0xa038('0x1f')](function(_0x2c023b){return _0x2c023b;});}return null;};}function removeEntity(_0x5e6e55,_0x8393ec){return function(_0x296f37){if(_0x296f37){return _0x296f37[_0xa038('0x20')]()[_0xa038('0x1f')](function(){_0x5e6e55[_0xa038('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x23faeb,_0x7abc49){return function(_0x5e9baa){if(!_0x5e9baa){_0x23faeb[_0xa038('0x21')](0x194);}return _0x5e9baa;};}function handleError(_0x3acd9d,_0x42d408){_0x42d408=_0x42d408||0x1f4;return function(_0x47c1ed){logger[_0xa038('0x22')](_0x47c1ed[_0xa038('0x23')]);if(_0x47c1ed[_0xa038('0x24')]){delete _0x47c1ed[_0xa038('0x24')];}_0x3acd9d[_0xa038('0x14')](_0x42d408)['send'](_0x47c1ed);};}exports[_0xa038('0x25')]=function(_0x570daf,_0x3249f8){var _0x2a905c={},_0x3d97b1={},_0x3d2609={'count':0x0,'rows':[]};var _0x19698c=_[_0xa038('0x26')](db[_0xa038('0x27')]['rawAttributes'],function(_0x22eb74){return{'name':_0x22eb74[_0xa038('0x28')],'type':_0x22eb74['type'][_0xa038('0x29')]};});_0x3d97b1[_0xa038('0x2a')]=_['map'](_0x19698c,_0xa038('0x24'));_0x3d97b1[_0xa038('0x2b')]=_['keys'](_0x570daf[_0xa038('0x2b')]);_0x3d97b1[_0xa038('0x2c')]=_[_0xa038('0x2d')](_0x3d97b1[_0xa038('0x2a')],_0x3d97b1[_0xa038('0x2b')]);_0x2a905c[_0xa038('0x2e')]=_['intersection'](_0x3d97b1[_0xa038('0x2a')],qs[_0xa038('0x2f')](_0x570daf[_0xa038('0x2b')]['fields']));_0x2a905c[_0xa038('0x2e')]=_0x2a905c[_0xa038('0x2e')][_0xa038('0x30')]?_0x2a905c[_0xa038('0x2e')]:_0x3d97b1['model'];if(!_0x570daf[_0xa038('0x2b')]['hasOwnProperty'](_0xa038('0x31'))){_0x2a905c[_0xa038('0x32')]=qs[_0xa038('0x32')](_0x570daf[_0xa038('0x2b')][_0xa038('0x32')]);_0x2a905c['offset']=qs['offset'](_0x570daf['query'][_0xa038('0x18')]);}_0x2a905c['order']=qs[_0xa038('0x33')](_0x570daf[_0xa038('0x2b')][_0xa038('0x33')]);_0x2a905c[_0xa038('0x34')]=qs[_0xa038('0x2c')](_[_0xa038('0x35')](_0x570daf[_0xa038('0x2b')],_0x3d97b1['filters']),_0x19698c);if(_0x570daf['query'][_0xa038('0x36')]){_0x2a905c['where']=_[_0xa038('0x37')](_0x2a905c['where'],{'$or':_[_0xa038('0x26')](_0x19698c,function(_0x4506e5){if(_0x4506e5['type']!==_0xa038('0x38')){var _0x42b2a1={};_0x42b2a1[_0x4506e5[_0xa038('0x24')]]={'$like':'%'+_0x570daf[_0xa038('0x2b')][_0xa038('0x36')]+'%'};return _0x42b2a1;}})});}_0x2a905c=_['merge']({},_0x2a905c,_0x570daf[_0xa038('0x39')]);var _0x3d61f0={'where':_0x2a905c[_0xa038('0x34')]};return db[_0xa038('0x27')][_0xa038('0x17')](_0x3d61f0)[_0xa038('0x1f')](function(_0x30eb86){_0x3d2609[_0xa038('0x17')]=_0x30eb86;if(_0x570daf[_0xa038('0x2b')]['includeAll']){_0x2a905c[_0xa038('0x3a')]=[{'all':!![]}];}return db[_0xa038('0x27')][_0xa038('0x3b')](_0x2a905c);})[_0xa038('0x1f')](function(_0x5e3b63){_0x3d2609['rows']=_0x5e3b63;return _0x3d2609;})['then'](respondWithFilteredResult(_0x3249f8,_0x2a905c))['catch'](handleError(_0x3249f8,null));};exports[_0xa038('0x3c')]=function(_0x433df7,_0x13c953){var _0x3a0651={'raw':!![],'where':{'id':_0x433df7[_0xa038('0x3d')]['id']}},_0x4af81a={};_0x4af81a['model']=_['keys'](db['CmHopperHistory'][_0xa038('0x3e')]);_0x4af81a[_0xa038('0x2b')]=_[_0xa038('0x3f')](_0x433df7[_0xa038('0x2b')]);_0x4af81a[_0xa038('0x2c')]=_[_0xa038('0x2d')](_0x4af81a[_0xa038('0x2a')],_0x4af81a['query']);_0x3a0651['attributes']=_[_0xa038('0x2d')](_0x4af81a['model'],qs[_0xa038('0x2f')](_0x433df7[_0xa038('0x2b')][_0xa038('0x2f')]));_0x3a0651[_0xa038('0x2e')]=_0x3a0651[_0xa038('0x2e')]['length']?_0x3a0651[_0xa038('0x2e')]:_0x4af81a[_0xa038('0x2a')];if(_0x433df7['query']['includeAll']){_0x3a0651[_0xa038('0x3a')]=[{'all':!![]}];}_0x3a0651=_[_0xa038('0x37')]({},_0x3a0651,_0x433df7[_0xa038('0x39')]);return db['CmHopperHistory'][_0xa038('0x40')](_0x3a0651)[_0xa038('0x1f')](handleEntityNotFound(_0x13c953,null))[_0xa038('0x1f')](respondWithResult(_0x13c953,null))['catch'](handleError(_0x13c953,null));};exports['create']=function(_0x3b64cf,_0x5e6ee8){return db[_0xa038('0x27')][_0xa038('0x41')](_0x3b64cf['body'],{})['then'](respondWithResult(_0x5e6ee8,0xc9))[_0xa038('0x42')](handleError(_0x5e6ee8,null));};exports[_0xa038('0x43')]=function(_0x33e6f9,_0x24c2dc){return db[_0xa038('0x27')]['describe']()[_0xa038('0x1f')](respondWithResult(_0x24c2dc,null))[_0xa038('0x42')](handleError(_0x24c2dc,null));};exports[_0xa038('0x1e')]=function(_0xa715bd,_0x397c97){if(_0xa715bd['body'][_0xa038('0x44')]){delete _0xa715bd[_0xa038('0x45')][_0xa038('0x44')];}return db[_0xa038('0x27')][_0xa038('0x40')]({'where':{'uniqueid':_0xa715bd[_0xa038('0x3d')]['id']}})['then'](handleEntityNotFound(_0x397c97,null))[_0xa038('0x1f')](saveUpdates(_0xa715bd[_0xa038('0x45')],null))[_0xa038('0x1f')](respondWithResult(_0x397c97,null))[_0xa038('0x42')](handleError(_0x397c97,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index d567db3..fe704ed 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 _0xed20=['bluebird','request-promise','path','rimraf','../../config/environment','exports','define','CmHopperHistory','cm_hopper_history','endtime','uniqueid','lodash','util','../../config/logger','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xed20,0xce));var _0x0ed2=function(_0x1f5bf7,_0x580aa7){_0x1f5bf7=_0x1f5bf7-0x0;var _0xe0f1c9=_0xed20[_0x1f5bf7];return _0xe0f1c9;};'use strict';var _=require(_0x0ed2('0x0'));var util=require(_0x0ed2('0x1'));var logger=require(_0x0ed2('0x2'))('api');var moment=require(_0x0ed2('0x3'));var BPromise=require(_0x0ed2('0x4'));var rp=require(_0x0ed2('0x5'));var fs=require('fs');var path=require(_0x0ed2('0x6'));var rimraf=require(_0x0ed2('0x7'));var config=require(_0x0ed2('0x8'));var attributes=require('./cmHopperHistory.attributes');module[_0x0ed2('0x9')]=function(_0x88640a,_0x5c686a){return _0x88640a[_0x0ed2('0xa')](_0x0ed2('0xb'),attributes,{'tableName':_0x0ed2('0xc'),'paranoid':![],'indexes':[{'name':_0x0ed2('0xd'),'fields':['endtime']},{'name':_0x0ed2('0xe'),'fields':[_0x0ed2('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1c77=['cm_hopper_history','endtime','uniqueid','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./cmHopperHistory.attributes','exports'];(function(_0x3dd932,_0x536a16){var _0x1b9624=function(_0x2775f2){while(--_0x2775f2){_0x3dd932['push'](_0x3dd932['shift']());}};_0x1b9624(++_0x536a16);}(_0x1c77,0xed));var _0x71c7=function(_0x3c0dcc,_0x18c419){_0x3c0dcc=_0x3c0dcc-0x0;var _0x1a224c=_0x1c77[_0x3c0dcc];return _0x1a224c;};'use strict';var _=require('lodash');var util=require(_0x71c7('0x0'));var logger=require(_0x71c7('0x1'))(_0x71c7('0x2'));var moment=require(_0x71c7('0x3'));var BPromise=require(_0x71c7('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x71c7('0x5'));var rimraf=require(_0x71c7('0x6'));var config=require(_0x71c7('0x7'));var attributes=require(_0x71c7('0x8'));module[_0x71c7('0x9')]=function(_0x1ee344,_0x2fb422){return _0x1ee344['define']('CmHopperHistory',attributes,{'tableName':_0x71c7('0xa'),'paranoid':![],'indexes':[{'name':_0x71c7('0xb'),'fields':[_0x71c7('0xb')]},{'name':_0x71c7('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index 5f176c3..92b5d4c 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 _0xe9e2=['where','sequelize','col','predictiveIntervalTotalCalls','COUNT','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','literal','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','AVG','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','findAll','name','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','outboundUnknownCallsDay','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','campaign','GetCampaignHopperHistory','ivrAnswerCallsDay','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateCmHopperHistory','body','options','raw','catch','AvgHandleTime','CmHopperHistory'];(function(_0x1a62fa,_0x245b12){var _0x5404ea=function(_0x53d354){while(--_0x53d354){_0x1a62fa['push'](_0x1a62fa['shift']());}};_0x5404ea(++_0x245b12);}(_0xe9e2,0x13a));var _0x2e9e=function(_0x130719,_0x2a7018){_0x130719=_0x130719-0x0;var _0x159865=_0xe9e2[_0x130719];return _0x159865;};'use strict';var _=require(_0x2e9e('0x0'));var util=require(_0x2e9e('0x1'));var moment=require(_0x2e9e('0x2'));var BPromise=require(_0x2e9e('0x3'));var rs=require(_0x2e9e('0x4'));var fs=require('fs');var Redis=require(_0x2e9e('0x5'));var db=require(_0x2e9e('0x6'))['db'];var utils=require(_0x2e9e('0x7'));var logger=require(_0x2e9e('0x8'))(_0x2e9e('0x9'));var config=require('../../config/environment');var jayson=require(_0x2e9e('0xa'));var client=jayson[_0x2e9e('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x217435,_0x22a519,_0x1e70c0){return new BPromise(function(_0x51dcdc,_0xbfc54){return client[_0x2e9e('0xc')](_0x217435,_0x1e70c0)[_0x2e9e('0xd')](function(_0x55691f){logger[_0x2e9e('0xe')](_0x2e9e('0xf'),_0x22a519,_0x2e9e('0x10'));logger[_0x2e9e('0x11')](_0x2e9e('0x12'),_0x22a519,'request\x20sent',JSON[_0x2e9e('0x13')](_0x55691f));if(_0x55691f[_0x2e9e('0x14')]){if(_0x55691f[_0x2e9e('0x14')][_0x2e9e('0x15')]===0x1f4){logger['error'](_0x2e9e('0xf'),_0x22a519,_0x55691f[_0x2e9e('0x14')]['message']);return _0xbfc54(_0x55691f[_0x2e9e('0x14')][_0x2e9e('0x16')]);}logger[_0x2e9e('0x14')](_0x2e9e('0xf'),_0x22a519,_0x55691f['error'][_0x2e9e('0x16')]);return _0x51dcdc(_0x55691f[_0x2e9e('0x14')][_0x2e9e('0x16')]);}else{logger[_0x2e9e('0xe')](_0x2e9e('0xf'),_0x22a519,'request\x20sent');_0x51dcdc(_0x55691f[_0x2e9e('0x17')][_0x2e9e('0x16')]);}})['catch'](function(_0x319c2c){logger['error'](_0x2e9e('0xf'),_0x22a519,_0x319c2c);_0xbfc54(_0x319c2c);});});}exports[_0x2e9e('0x18')]=function(_0x49379c){var _0x88ca93=this;return new Promise(function(_0x15d12f,_0x4e954f){return db['CmHopperHistory']['create'](_0x49379c[_0x2e9e('0x19')],{'raw':_0x49379c[_0x2e9e('0x1a')]?_0x49379c[_0x2e9e('0x1a')][_0x2e9e('0x1b')]===undefined?!![]:![]:!![]})[_0x2e9e('0xd')](function(_0x3013f7){logger['info'](_0x2e9e('0x18'),_0x49379c);logger[_0x2e9e('0x11')]('CreateCmHopperHistory',_0x49379c,JSON[_0x2e9e('0x13')](_0x3013f7));_0x15d12f(_0x3013f7);})[_0x2e9e('0x1c')](function(_0x649b59){logger[_0x2e9e('0x14')](_0x2e9e('0x18'),_0x649b59[_0x2e9e('0x16')],_0x49379c);_0x4e954f(_0x88ca93[_0x2e9e('0x14')](0x1f4,_0x649b59['message']));});});};exports[_0x2e9e('0x1d')]=function(_0x5951ae){var _0x408e18=this;return new Promise(function(_0x17d24b,_0x3f3a72){return db[_0x2e9e('0x1e')]['findAll']({'raw':_0x5951ae['options']?_0x5951ae['options'][_0x2e9e('0x1b')]===undefined?!![]:![]:!![],'where':_0x5951ae[_0x2e9e('0x1a')]?_0x5951ae[_0x2e9e('0x1a')][_0x2e9e('0x1f')]||null:null,'attributes':[[db[_0x2e9e('0x20')]['fn']('COUNT',db[_0x2e9e('0x20')][_0x2e9e('0x21')]('id')),_0x2e9e('0x22')],[db['sequelize']['fn'](_0x2e9e('0x23'),db[_0x2e9e('0x20')]['fn']('IF',db['sequelize']['literal'](_0x2e9e('0x24')))),_0x2e9e('0x25')],[db[_0x2e9e('0x20')]['fn'](_0x2e9e('0x23'),db[_0x2e9e('0x20')]['fn']('IF',db[_0x2e9e('0x20')][_0x2e9e('0x26')](_0x2e9e('0x27')))),_0x2e9e('0x28')],[db[_0x2e9e('0x20')]['fn'](_0x2e9e('0x23'),db[_0x2e9e('0x20')]['fn']('IF',db[_0x2e9e('0x20')][_0x2e9e('0x26')]('`state`\x20=\x2011,\x201,\x20null'))),_0x2e9e('0x29')],[db['sequelize']['fn'](_0x2e9e('0x2a'),db['sequelize']['fn']('IF',db[_0x2e9e('0x20')][_0x2e9e('0x26')]('`state`\x20=\x204,\x20`holdtime`,\x20null'))),_0x2e9e('0x2b')],[db[_0x2e9e('0x20')]['fn'](_0x2e9e('0x2a'),db['sequelize']['fn']('IF',db[_0x2e9e('0x20')][_0x2e9e('0x26')]('`state`\x20=\x204,\x20`talktime`,\x20null'))),_0x2e9e('0x2c')]]})['then'](function(_0x57095a){logger[_0x2e9e('0xe')]('AvgHandleTime',_0x5951ae);logger[_0x2e9e('0x11')](_0x2e9e('0x1d'),_0x5951ae,JSON[_0x2e9e('0x13')](_0x57095a));_0x17d24b(_0x57095a);})[_0x2e9e('0x1c')](function(_0x3bfeb3){logger[_0x2e9e('0x14')]('AvgHandleTime',_0x3bfeb3[_0x2e9e('0x16')],_0x5951ae);_0x3f3a72(_0x408e18[_0x2e9e('0x14')](0x1f4,_0x3bfeb3[_0x2e9e('0x16')]));});});};exports[_0x2e9e('0x2d')]=function(_0x49bfae){var _0xea41a9=this;return new Promise(function(_0x569509,_0x5c283f){return db[_0x2e9e('0x1e')][_0x2e9e('0x2e')]({'raw':_0x49bfae['options']?_0x49bfae[_0x2e9e('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x49bfae[_0x2e9e('0x1a')]?_0x49bfae[_0x2e9e('0x1a')][_0x2e9e('0x1f')]||null:null,'attributes':[['campaign',_0x2e9e('0x2f')],[db[_0x2e9e('0x20')]['fn']('COUNT',db[_0x2e9e('0x20')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x200,\x201,\x20null'))),'outboundNoSuchCallsDay'],[db[_0x2e9e('0x20')]['fn'](_0x2e9e('0x23'),db[_0x2e9e('0x20')]['fn']('IF',db[_0x2e9e('0x20')]['literal']('`state`\x20=\x203,\x201,\x20null'))),_0x2e9e('0x30')],[db['sequelize']['fn'](_0x2e9e('0x23'),db[_0x2e9e('0x20')]['fn']('IF',db['sequelize'][_0x2e9e('0x26')](_0x2e9e('0x24')))),_0x2e9e('0x31')],[db[_0x2e9e('0x20')]['fn'](_0x2e9e('0x23'),db[_0x2e9e('0x20')]['fn']('IF',db['sequelize'][_0x2e9e('0x26')](_0x2e9e('0x32')))),_0x2e9e('0x33')],[db[_0x2e9e('0x20')]['fn'](_0x2e9e('0x23'),db[_0x2e9e('0x20')]['fn']('IF',db['sequelize']['literal'](_0x2e9e('0x34')))),_0x2e9e('0x35')],[db['sequelize']['fn'](_0x2e9e('0x23'),db[_0x2e9e('0x20')]['fn']('IF',db[_0x2e9e('0x20')][_0x2e9e('0x26')](_0x2e9e('0x36')))),'outboundDropCallsDayTimeout'],[db[_0x2e9e('0x20')]['fn'](_0x2e9e('0x23'),db[_0x2e9e('0x20')]['fn']('IF',db[_0x2e9e('0x20')]['literal'](_0x2e9e('0x37')))),'outboundDropCallsDayCallersExit'],[db[_0x2e9e('0x20')]['fn'](_0x2e9e('0x23'),db[_0x2e9e('0x20')]['fn']('IF',db[_0x2e9e('0x20')][_0x2e9e('0x26')]('`state`\x20=\x2012,\x201,\x20null'))),_0x2e9e('0x38')],[db['sequelize']['fn'](_0x2e9e('0x23'),db[_0x2e9e('0x20')]['fn']('IF',db[_0x2e9e('0x20')][_0x2e9e('0x26')]('`state`\x20=\x2013,\x201,\x20null'))),_0x2e9e('0x39')],[db[_0x2e9e('0x20')]['fn']('COUNT',db[_0x2e9e('0x20')]['fn']('IF',db[_0x2e9e('0x20')]['literal'](_0x2e9e('0x3a')))),_0x2e9e('0x3b')],[db['sequelize']['fn']('COUNT',db[_0x2e9e('0x20')]['fn']('IF',db['sequelize'][_0x2e9e('0x26')](_0x2e9e('0x3c')))),_0x2e9e('0x3d')],[db[_0x2e9e('0x20')]['fn'](_0x2e9e('0x23'),db[_0x2e9e('0x20')]['fn']('IF',db[_0x2e9e('0x20')][_0x2e9e('0x26')](_0x2e9e('0x3e')))),_0x2e9e('0x3f')],[db[_0x2e9e('0x20')]['fn'](_0x2e9e('0x23'),db['sequelize']['fn']('IF',db[_0x2e9e('0x20')][_0x2e9e('0x26')](_0x2e9e('0x40')))),'outboundRejectCallsDay'],[db['sequelize']['fn']('COUNT',db[_0x2e9e('0x20')]['fn']('IF',db['sequelize'][_0x2e9e('0x26')](_0x2e9e('0x41')))),'outboundReCallsDay']],'group':[_0x2e9e('0x42')]})['then'](function(_0x489215){logger[_0x2e9e('0xe')](_0x2e9e('0x2d'),_0x49bfae);logger[_0x2e9e('0x11')]('GetVoiceQueueHopperHistory',_0x49bfae,JSON['stringify'](_0x489215));_0x569509(_0x489215);})[_0x2e9e('0x1c')](function(_0x322915){logger[_0x2e9e('0x14')]('GetVoiceQueueHopperHistory',_0x322915['message'],_0x49bfae);_0x5c283f(_0xea41a9[_0x2e9e('0x14')](0x1f4,_0x322915['message']));});});};exports[_0x2e9e('0x43')]=function(_0x399e9a){var _0x2dd24e=this;return new Promise(function(_0x23c207,_0x1b791b){return db[_0x2e9e('0x1e')][_0x2e9e('0x2e')]({'raw':_0x399e9a['options']?_0x399e9a[_0x2e9e('0x1a')][_0x2e9e('0x1b')]===undefined?!![]:![]:!![],'where':_0x399e9a[_0x2e9e('0x1a')]?_0x399e9a[_0x2e9e('0x1a')]['where']||null:null,'attributes':[['campaign',_0x2e9e('0x2f')],[db['sequelize']['fn'](_0x2e9e('0x23'),db['sequelize'][_0x2e9e('0x21')]('id')),'ivrTotalCallsDays'],[db['sequelize']['fn'](_0x2e9e('0x23'),db[_0x2e9e('0x20')]['fn']('IF',db['sequelize'][_0x2e9e('0x26')](_0x2e9e('0x24')))),_0x2e9e('0x44')]],'group':['campaign']})[_0x2e9e('0xd')](function(_0x5d0247){logger[_0x2e9e('0xe')](_0x2e9e('0x43'),_0x399e9a);logger[_0x2e9e('0x11')]('GetCampaignHopperHistory',_0x399e9a,JSON[_0x2e9e('0x13')](_0x5d0247));_0x23c207(_0x5d0247);})['catch'](function(_0x1b8cfa){logger['error']('GetCampaignHopperHistory',_0x1b8cfa[_0x2e9e('0x16')],_0x399e9a);_0x1b791b(_0x2dd24e[_0x2e9e('0x14')](0x1f4,_0x1b8cfa['message']));});});}; \ No newline at end of file +var _0x7314=['CmHopperHistory,\x20%s,\x20%s','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateCmHopperHistory','create','body','options','raw','then','AvgHandleTime','CmHopperHistory','findAll','where','sequelize','COUNT','col','predictiveIntervalTotalCalls','`state`\x20=\x204,\x201,\x20null','literal','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','`state`\x20=\x204,\x20`holdtime`,\x20null','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','name','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundReCallsDay','campaign','GetCampaignHopperHistory','ivrAnswerCallsDay','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','info'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7314,0x100));var _0x4731=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x7314[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x4731('0x0'));var util=require(_0x4731('0x1'));var moment=require('moment');var BPromise=require(_0x4731('0x2'));var rs=require(_0x4731('0x3'));var fs=require('fs');var Redis=require(_0x4731('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4731('0x5'));var logger=require(_0x4731('0x6'))(_0x4731('0x7'));var config=require('../../config/environment');var jayson=require(_0x4731('0x8'));var client=jayson[_0x4731('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xb73308,_0x3d181e,_0x3635a6){return new BPromise(function(_0x2f76d0,_0x5389b5){return client[_0x4731('0xa')](_0xb73308,_0x3635a6)['then'](function(_0x2087ca){logger[_0x4731('0xb')](_0x4731('0xc'),_0x3d181e,'request\x20sent');logger[_0x4731('0xd')](_0x4731('0xe'),_0x3d181e,_0x4731('0xf'),JSON[_0x4731('0x10')](_0x2087ca));if(_0x2087ca[_0x4731('0x11')]){if(_0x2087ca[_0x4731('0x11')][_0x4731('0x12')]===0x1f4){logger[_0x4731('0x11')](_0x4731('0xc'),_0x3d181e,_0x2087ca[_0x4731('0x11')][_0x4731('0x13')]);return _0x5389b5(_0x2087ca['error']['message']);}logger[_0x4731('0x11')](_0x4731('0xc'),_0x3d181e,_0x2087ca['error'][_0x4731('0x13')]);return _0x2f76d0(_0x2087ca[_0x4731('0x11')][_0x4731('0x13')]);}else{logger[_0x4731('0xb')]('CmHopperHistory,\x20%s,\x20%s',_0x3d181e,_0x4731('0xf'));_0x2f76d0(_0x2087ca[_0x4731('0x14')]['message']);}})[_0x4731('0x15')](function(_0x1597ac){logger['error'](_0x4731('0xc'),_0x3d181e,_0x1597ac);_0x5389b5(_0x1597ac);});});}exports[_0x4731('0x16')]=function(_0x48764e){var _0x1398b4=this;return new Promise(function(_0x562505,_0x4a4475){return db['CmHopperHistory'][_0x4731('0x17')](_0x48764e[_0x4731('0x18')],{'raw':_0x48764e[_0x4731('0x19')]?_0x48764e['options'][_0x4731('0x1a')]===undefined?!![]:![]:!![]})[_0x4731('0x1b')](function(_0xc6efce){logger[_0x4731('0xb')](_0x4731('0x16'),_0x48764e);logger[_0x4731('0xd')](_0x4731('0x16'),_0x48764e,JSON[_0x4731('0x10')](_0xc6efce));_0x562505(_0xc6efce);})[_0x4731('0x15')](function(_0x31aa48){logger[_0x4731('0x11')](_0x4731('0x16'),_0x31aa48[_0x4731('0x13')],_0x48764e);_0x4a4475(_0x1398b4[_0x4731('0x11')](0x1f4,_0x31aa48[_0x4731('0x13')]));});});};exports[_0x4731('0x1c')]=function(_0x2540f6){var _0x4bdc9a=this;return new Promise(function(_0xcae8df,_0x19c733){return db[_0x4731('0x1d')][_0x4731('0x1e')]({'raw':_0x2540f6['options']?_0x2540f6[_0x4731('0x19')][_0x4731('0x1a')]===undefined?!![]:![]:!![],'where':_0x2540f6[_0x4731('0x19')]?_0x2540f6[_0x4731('0x19')][_0x4731('0x1f')]||null:null,'attributes':[[db[_0x4731('0x20')]['fn'](_0x4731('0x21'),db['sequelize'][_0x4731('0x22')]('id')),_0x4731('0x23')],[db[_0x4731('0x20')]['fn'](_0x4731('0x21'),db[_0x4731('0x20')]['fn']('IF',db[_0x4731('0x20')]['literal'](_0x4731('0x24')))),'predictiveIntervalAnsweredCalls'],[db['sequelize']['fn'](_0x4731('0x21'),db['sequelize']['fn']('IF',db[_0x4731('0x20')][_0x4731('0x25')](_0x4731('0x26')))),_0x4731('0x27')],[db[_0x4731('0x20')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x4731('0x20')][_0x4731('0x25')](_0x4731('0x28')))),_0x4731('0x29')],[db['sequelize']['fn']('AVG',db[_0x4731('0x20')]['fn']('IF',db[_0x4731('0x20')][_0x4731('0x25')](_0x4731('0x2a')))),'predictiveIntervalAvgHoldtime'],[db[_0x4731('0x20')]['fn']('AVG',db[_0x4731('0x20')]['fn']('IF',db['sequelize'][_0x4731('0x25')](_0x4731('0x2b')))),_0x4731('0x2c')]]})[_0x4731('0x1b')](function(_0x11054b){logger[_0x4731('0xb')](_0x4731('0x1c'),_0x2540f6);logger[_0x4731('0xd')](_0x4731('0x1c'),_0x2540f6,JSON[_0x4731('0x10')](_0x11054b));_0xcae8df(_0x11054b);})[_0x4731('0x15')](function(_0x583e5a){logger[_0x4731('0x11')](_0x4731('0x1c'),_0x583e5a[_0x4731('0x13')],_0x2540f6);_0x19c733(_0x4bdc9a[_0x4731('0x11')](0x1f4,_0x583e5a[_0x4731('0x13')]));});});};exports[_0x4731('0x2d')]=function(_0x483faa){var _0x57b04e=this;return new Promise(function(_0x32148c,_0x4fb932){return db[_0x4731('0x1d')][_0x4731('0x1e')]({'raw':_0x483faa[_0x4731('0x19')]?_0x483faa['options'][_0x4731('0x1a')]===undefined?!![]:![]:!![],'where':_0x483faa[_0x4731('0x19')]?_0x483faa[_0x4731('0x19')][_0x4731('0x1f')]||null:null,'attributes':[['campaign',_0x4731('0x2e')],[db[_0x4731('0x20')]['fn'](_0x4731('0x21'),db['sequelize']['fn']('IF',db['sequelize'][_0x4731('0x25')]('`state`\x20=\x200,\x201,\x20null'))),'outboundNoSuchCallsDay'],[db[_0x4731('0x20')]['fn']('COUNT',db[_0x4731('0x20')]['fn']('IF',db['sequelize'][_0x4731('0x25')](_0x4731('0x2f')))),_0x4731('0x30')],[db[_0x4731('0x20')]['fn'](_0x4731('0x21'),db['sequelize']['fn']('IF',db[_0x4731('0x20')][_0x4731('0x25')](_0x4731('0x24')))),'outboundAnswerCallsDay'],[db[_0x4731('0x20')]['fn'](_0x4731('0x21'),db[_0x4731('0x20')]['fn']('IF',db[_0x4731('0x20')][_0x4731('0x25')]('`state`\x20=\x205,\x201,\x20null'))),'outboundBusyCallsDay'],[db[_0x4731('0x20')]['fn'](_0x4731('0x21'),db[_0x4731('0x20')]['fn']('IF',db[_0x4731('0x20')][_0x4731('0x25')](_0x4731('0x31')))),_0x4731('0x32')],[db[_0x4731('0x20')]['fn'](_0x4731('0x21'),db[_0x4731('0x20')]['fn']('IF',db[_0x4731('0x20')][_0x4731('0x25')](_0x4731('0x33')))),_0x4731('0x34')],[db[_0x4731('0x20')]['fn'](_0x4731('0x21'),db['sequelize']['fn']('IF',db['sequelize'][_0x4731('0x25')](_0x4731('0x35')))),_0x4731('0x36')],[db[_0x4731('0x20')]['fn'](_0x4731('0x21'),db['sequelize']['fn']('IF',db[_0x4731('0x20')][_0x4731('0x25')](_0x4731('0x37')))),'outboundUnknownCallsDay'],[db[_0x4731('0x20')]['fn'](_0x4731('0x21'),db[_0x4731('0x20')]['fn']('IF',db[_0x4731('0x20')]['literal'](_0x4731('0x38')))),_0x4731('0x39')],[db[_0x4731('0x20')]['fn'](_0x4731('0x21'),db[_0x4731('0x20')]['fn']('IF',db[_0x4731('0x20')]['literal'](_0x4731('0x3a')))),_0x4731('0x3b')],[db[_0x4731('0x20')]['fn'](_0x4731('0x21'),db[_0x4731('0x20')]['fn']('IF',db['sequelize'][_0x4731('0x25')](_0x4731('0x3c')))),_0x4731('0x3d')],[db[_0x4731('0x20')]['fn'](_0x4731('0x21'),db['sequelize']['fn']('IF',db['sequelize']['literal'](_0x4731('0x3e')))),'outboundAnswerAgiCallsDay'],[db[_0x4731('0x20')]['fn']('COUNT',db[_0x4731('0x20')]['fn']('IF',db[_0x4731('0x20')][_0x4731('0x25')]('`state`\x20=\x2020,\x201,\x20null'))),_0x4731('0x3d')],[db[_0x4731('0x20')]['fn'](_0x4731('0x21'),db[_0x4731('0x20')]['fn']('IF',db['sequelize'][_0x4731('0x25')]('`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null'))),_0x4731('0x3f')]],'group':[_0x4731('0x40')]})[_0x4731('0x1b')](function(_0x40ae04){logger[_0x4731('0xb')](_0x4731('0x2d'),_0x483faa);logger[_0x4731('0xd')](_0x4731('0x2d'),_0x483faa,JSON[_0x4731('0x10')](_0x40ae04));_0x32148c(_0x40ae04);})[_0x4731('0x15')](function(_0x529bbe){logger[_0x4731('0x11')](_0x4731('0x2d'),_0x529bbe['message'],_0x483faa);_0x4fb932(_0x57b04e[_0x4731('0x11')](0x1f4,_0x529bbe[_0x4731('0x13')]));});});};exports[_0x4731('0x41')]=function(_0x5b36b9){var _0xf3680=this;return new Promise(function(_0x52fc51,_0x473e2a){return db[_0x4731('0x1d')]['findAll']({'raw':_0x5b36b9[_0x4731('0x19')]?_0x5b36b9[_0x4731('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x5b36b9[_0x4731('0x19')]?_0x5b36b9[_0x4731('0x19')][_0x4731('0x1f')]||null:null,'attributes':[[_0x4731('0x40'),_0x4731('0x2e')],[db[_0x4731('0x20')]['fn'](_0x4731('0x21'),db[_0x4731('0x20')][_0x4731('0x22')]('id')),'ivrTotalCallsDays'],[db[_0x4731('0x20')]['fn'](_0x4731('0x21'),db[_0x4731('0x20')]['fn']('IF',db['sequelize']['literal']('`state`\x20=\x204,\x201,\x20null'))),_0x4731('0x42')]],'group':['campaign']})['then'](function(_0x4c765e){logger['info'](_0x4731('0x41'),_0x5b36b9);logger[_0x4731('0xd')](_0x4731('0x41'),_0x5b36b9,JSON[_0x4731('0x10')](_0x4c765e));_0x52fc51(_0x4c765e);})[_0x4731('0x15')](function(_0x18df31){logger[_0x4731('0x11')](_0x4731('0x41'),_0x18df31[_0x4731('0x13')],_0x5b36b9);_0x473e2a(_0xf3680[_0x4731('0x11')](0x1f4,_0x18df31[_0x4731('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index dc0634e..5d2056e 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 _0x5b38=['post','create','/:id','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','get','isAuthenticated','/describe','describe','show'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x5b38,0x194));var _0x85b3=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x5b38[_0x1facfa];return _0x9ec701;};'use strict';var multer=require(_0x85b3('0x0'));var util=require(_0x85b3('0x1'));var path=require(_0x85b3('0x2'));var timeout=require(_0x85b3('0x3'));var express=require(_0x85b3('0x4'));var router=express[_0x85b3('0x5')]();var fs_extra=require(_0x85b3('0x6'));var auth=require(_0x85b3('0x7'));var interaction=require(_0x85b3('0x8'));var config=require(_0x85b3('0x9'));var controller=require(_0x85b3('0xa'));router[_0x85b3('0xb')]('/',auth[_0x85b3('0xc')](),controller['index']);router[_0x85b3('0xb')](_0x85b3('0xd'),auth['isAuthenticated'](),controller[_0x85b3('0xe')]);router[_0x85b3('0xb')]('/:id',auth['isAuthenticated'](),controller[_0x85b3('0xf')]);router[_0x85b3('0x10')]('/',auth['isAuthenticated'](),controller[_0x85b3('0x11')]);router['put'](_0x85b3('0x12'),auth[_0x85b3('0xc')](),controller[_0x85b3('0x13')]);module[_0x85b3('0x14')]=router; \ No newline at end of file +var _0x4cbc=['update','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','create'];(function(_0x4fc9e6,_0xc51915){var _0x551d28=function(_0x1a603b){while(--_0x1a603b){_0x4fc9e6['push'](_0x4fc9e6['shift']());}};_0x551d28(++_0xc51915);}(_0x4cbc,0x113));var _0xc4cb=function(_0x9fbe5b,_0xded2ab){_0x9fbe5b=_0x9fbe5b-0x0;var _0x23f73e=_0x4cbc[_0x9fbe5b];return _0x23f73e;};'use strict';var multer=require(_0xc4cb('0x0'));var util=require(_0xc4cb('0x1'));var path=require(_0xc4cb('0x2'));var timeout=require(_0xc4cb('0x3'));var express=require(_0xc4cb('0x4'));var router=express['Router']();var fs_extra=require(_0xc4cb('0x5'));var auth=require(_0xc4cb('0x6'));var interaction=require(_0xc4cb('0x7'));var config=require(_0xc4cb('0x8'));var controller=require(_0xc4cb('0x9'));router[_0xc4cb('0xa')]('/',auth['isAuthenticated'](),controller[_0xc4cb('0xb')]);router[_0xc4cb('0xa')](_0xc4cb('0xc'),auth[_0xc4cb('0xd')](),controller[_0xc4cb('0xe')]);router[_0xc4cb('0xa')](_0xc4cb('0xf'),auth[_0xc4cb('0xd')](),controller[_0xc4cb('0x10')]);router[_0xc4cb('0x11')]('/',auth[_0xc4cb('0xd')](),controller[_0xc4cb('0x12')]);router['put'](_0xc4cb('0xf'),auth['isAuthenticated'](),controller[_0xc4cb('0x13')]);module[_0xc4cb('0x14')]=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index dccc8e4..eb57a25 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 _0x946e=['sequelize','STRING'];(function(_0x32c48c,_0x5d669e){var _0x133729=function(_0x369daa){while(--_0x369daa){_0x32c48c['push'](_0x32c48c['shift']());}};_0x133729(++_0x5d669e);}(_0x946e,0x1d0));var _0xe946=function(_0x4b4ab8,_0x193fa1){_0x4b4ab8=_0x4b4ab8-0x0;var _0x437c00=_0x946e[_0x4b4ab8];return _0x437c00;};'use strict';var Sequelize=require(_0xe946('0x0'));module['exports']={'name':{'type':Sequelize[_0xe946('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xe946('0x1')]},'dialPrefix':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x8388=['name','sequelize','exports','STRING'];(function(_0x3c3d5f,_0x99c8e6){var _0x5d745e=function(_0x509b97){while(--_0x509b97){_0x3c3d5f['push'](_0x3c3d5f['shift']());}};_0x5d745e(++_0x99c8e6);}(_0x8388,0x18d));var _0x8838=function(_0x553a87,_0x1d621f){_0x553a87=_0x553a87-0x0;var _0x12d1e6=_0x8388[_0x553a87];return _0x12d1e6;};'use strict';var Sequelize=require(_0x8838('0x0'));module[_0x8838('0x1')]={'name':{'type':Sequelize[_0x8838('0x2')],'unique':_0x8838('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'dialPrefix':{'type':Sequelize[_0x8838('0x2')]}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index a65a528..953e99d 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 _0x05af=['offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','get','Lists','UserProfileResource','error','stack','name','send','index','CmList','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','merge','options','includeAll','include','findAll','rows','catch','show','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','ListId','Disposition','getDispositions','findOne','nolimit','filter','removeDispositions','ids','CmContact','describe','tags','isArray','join','push','omit','success','dataValues','errors','message','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','format','cf_%d','raw','getContactsCsv','concat','pick','isEmpty','now','writeFileSync','setHeader','attachment;\x20filename=','Content-type','text/csv','download','/tmp/list_%d_%s.csv','addCustomField','sequelize','transaction','addCustomFields','text','TEXT','INTEGER','switch','queryInterface','addColumn','cm_contacts','cf_%s','getCustomFields','findAndCountAll','addAgents','spread','userCmList:save','removeAgents','emit','userCmList:remove','getAgents','zip-dir','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./cmList.socket','register','sendStatus','end','status','json'];(function(_0x18a436,_0x1dbe06){var _0x5c2cf8=function(_0x4712d1){while(--_0x4712d1){_0x18a436['push'](_0x18a436['shift']());}};_0x5c2cf8(++_0x1dbe06);}(_0x05af,0x70));var _0xf05a=function(_0x3712e2,_0x32d752){_0x3712e2=_0x3712e2-0x0;var _0x1faff4=_0x05af[_0x3712e2];return _0x1faff4;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xf05a('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf05a('0x1'));var moment=require(_0xf05a('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xf05a('0x3'));var util=require(_0xf05a('0x4'));var path=require('path');var sox=require(_0xf05a('0x5'));var csv=require(_0xf05a('0x6'));var ejs=require(_0xf05a('0x7'));var fs=require('fs');var fs_extra=require(_0xf05a('0x8'));var _=require(_0xf05a('0x9'));var squel=require(_0xf05a('0xa'));var crypto=require(_0xf05a('0xb'));var jsforce=require(_0xf05a('0xc'));var deskjs=require(_0xf05a('0xd'));var toCsv=require('to-csv');var querystring=require(_0xf05a('0xe'));var Papa=require(_0xf05a('0xf'));var Redis=require(_0xf05a('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xf05a('0x11'));var as=require(_0xf05a('0x12'));var hardwareService=require(_0xf05a('0x13'));var logger=require('../../config/logger')(_0xf05a('0x14'));var utils=require(_0xf05a('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xf05a('0x16'));var db=require(_0xf05a('0x17'))['db'];config[_0xf05a('0x18')]=_[_0xf05a('0x19')](config[_0xf05a('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0xf05a('0x1a'))(new Redis(config[_0xf05a('0x18')]));require(_0xf05a('0x1b'))[_0xf05a('0x1c')](socket);function respondWithStatusCode(_0x4d05fd,_0x5eaeac){_0x5eaeac=_0x5eaeac||0xcc;return function(_0x4848ea){if(_0x4848ea){return _0x4d05fd[_0xf05a('0x1d')](_0x5eaeac);}return _0x4d05fd['status'](_0x5eaeac)[_0xf05a('0x1e')]();};}function respondWithResult(_0x229d29,_0x886e03){_0x886e03=_0x886e03||0xc8;return function(_0x4934ae){if(_0x4934ae){return _0x229d29[_0xf05a('0x1f')](_0x886e03)[_0xf05a('0x20')](_0x4934ae);}};}function respondWithFilteredResult(_0x5e797c,_0xb41223){return function(_0x52a372){if(_0x52a372){var _0x3de067=typeof _0xb41223[_0xf05a('0x21')]===_0xf05a('0x22')&&typeof _0xb41223[_0xf05a('0x23')]===_0xf05a('0x22');var _0x5b61bf=_0x52a372[_0xf05a('0x24')];var _0x42eb47=_0x3de067?0x0:_0xb41223[_0xf05a('0x21')];var _0x1ea773=_0x3de067?_0x52a372[_0xf05a('0x24')]:_0xb41223['offset']+_0xb41223['limit'];var _0x478b00;if(_0x1ea773>=_0x5b61bf){_0x1ea773=_0x5b61bf;_0x478b00=0xc8;}else{_0x478b00=0xce;}_0x5e797c['status'](_0x478b00);return _0x5e797c[_0xf05a('0x25')](_0xf05a('0x26'),_0x42eb47+'-'+_0x1ea773+'/'+_0x5b61bf)['json'](_0x52a372);}return null;};}function patchUpdates(_0x3d92ab){return function(_0x11a039){try{jsonpatch['apply'](_0x11a039,_0x3d92ab,!![]);}catch(_0x229da3){return BPromise['reject'](_0x229da3);}return _0x11a039[_0xf05a('0x27')]();};}function saveUpdates(_0x1e10d6,_0x4b9a65){return function(_0x451b85){if(_0x451b85){return _0x451b85[_0xf05a('0x28')](_0x1e10d6)[_0xf05a('0x29')](function(_0x3133db){return _0x3133db;});}return null;};}function removeEntity(_0x11993a,_0x1a4970){return function(_0x3d4afc){if(_0x3d4afc){return _0x3d4afc[_0xf05a('0x2a')]()[_0xf05a('0x29')](function(){var _0x1fbfb5=_0x3d4afc[_0xf05a('0x2b')]({'plain':!![]});var _0x1917f3=_0xf05a('0x2c');return db[_0xf05a('0x2d')][_0xf05a('0x2a')]({'where':{'type':_0x1917f3,'resourceId':_0x1fbfb5['id']}})[_0xf05a('0x29')](function(){return _0x3d4afc;});})['then'](function(){_0x11993a[_0xf05a('0x1f')](0xcc)[_0xf05a('0x1e')]();});}};}function handleEntityNotFound(_0x27eb35,_0x18a551){return function(_0x4557ca){if(!_0x4557ca){_0x27eb35[_0xf05a('0x1d')](0x194);}return _0x4557ca;};}function handleError(_0x4a0b13,_0x4c49d8){_0x4c49d8=_0x4c49d8||0x1f4;return function(_0x34f85a){logger[_0xf05a('0x2e')](_0x34f85a[_0xf05a('0x2f')]);if(_0x34f85a[_0xf05a('0x30')]){delete _0x34f85a[_0xf05a('0x30')];}_0x4a0b13[_0xf05a('0x1f')](_0x4c49d8)[_0xf05a('0x31')](_0x34f85a);};}exports[_0xf05a('0x32')]=function(_0xe754ec,_0xa8e41c){var _0x3f6256={},_0x3d6d6d={},_0x31f658={'count':0x0,'rows':[]};var _0x1392e2=_['map'](db[_0xf05a('0x33')][_0xf05a('0x34')],function(_0x31d47d){return{'name':_0x31d47d[_0xf05a('0x35')],'type':_0x31d47d[_0xf05a('0x36')][_0xf05a('0x37')]};});_0x3d6d6d[_0xf05a('0x38')]=_[_0xf05a('0x39')](_0x1392e2,_0xf05a('0x30'));_0x3d6d6d['query']=_[_0xf05a('0x3a')](_0xe754ec[_0xf05a('0x3b')]);_0x3d6d6d[_0xf05a('0x3c')]=_[_0xf05a('0x3d')](_0x3d6d6d[_0xf05a('0x38')],_0x3d6d6d[_0xf05a('0x3b')]);_0x3f6256[_0xf05a('0x3e')]=_[_0xf05a('0x3d')](_0x3d6d6d[_0xf05a('0x38')],qs[_0xf05a('0x3f')](_0xe754ec[_0xf05a('0x3b')][_0xf05a('0x3f')]));_0x3f6256[_0xf05a('0x3e')]=_0x3f6256[_0xf05a('0x3e')][_0xf05a('0x40')]?_0x3f6256[_0xf05a('0x3e')]:_0x3d6d6d[_0xf05a('0x38')];if(!_0xe754ec[_0xf05a('0x3b')][_0xf05a('0x41')]('nolimit')){_0x3f6256['limit']=qs[_0xf05a('0x23')](_0xe754ec[_0xf05a('0x3b')]['limit']);_0x3f6256['offset']=qs[_0xf05a('0x21')](_0xe754ec[_0xf05a('0x3b')][_0xf05a('0x21')]);}_0x3f6256[_0xf05a('0x42')]=qs['sort'](_0xe754ec[_0xf05a('0x3b')][_0xf05a('0x43')]);_0x3f6256[_0xf05a('0x44')]=qs[_0xf05a('0x3c')](_['pick'](_0xe754ec['query'],_0x3d6d6d[_0xf05a('0x3c')]),_0x1392e2);if(_0xe754ec['query']['filter']){_0x3f6256[_0xf05a('0x44')]=_[_0xf05a('0x45')](_0x3f6256[_0xf05a('0x44')],{'$or':_[_0xf05a('0x39')](_0x1392e2,function(_0x9e31c5){if(_0x9e31c5[_0xf05a('0x36')]!=='VIRTUAL'){var _0x5e0d40={};_0x5e0d40[_0x9e31c5['name']]={'$like':'%'+_0xe754ec['query']['filter']+'%'};return _0x5e0d40;}})});}_0x3f6256=_[_0xf05a('0x45')]({},_0x3f6256,_0xe754ec[_0xf05a('0x46')]);var _0x4c9f17={'where':_0x3f6256['where']};return db['CmList'][_0xf05a('0x24')](_0x4c9f17)[_0xf05a('0x29')](function(_0x37fbb3){_0x31f658[_0xf05a('0x24')]=_0x37fbb3;if(_0xe754ec['query'][_0xf05a('0x47')]){_0x3f6256[_0xf05a('0x48')]=[{'all':!![]}];}return db[_0xf05a('0x33')][_0xf05a('0x49')](_0x3f6256);})[_0xf05a('0x29')](function(_0x58b763){_0x31f658[_0xf05a('0x4a')]=_0x58b763;return _0x31f658;})[_0xf05a('0x29')](respondWithFilteredResult(_0xa8e41c,_0x3f6256))[_0xf05a('0x4b')](handleError(_0xa8e41c,null));};exports[_0xf05a('0x4c')]=function(_0x1715e2,_0x32e41f){var _0x458ff6={'raw':![],'where':{'id':_0x1715e2['params']['id']}},_0xdb4463={};_0xdb4463[_0xf05a('0x38')]=_['keys'](db[_0xf05a('0x33')]['rawAttributes']);_0xdb4463['query']=_[_0xf05a('0x3a')](_0x1715e2[_0xf05a('0x3b')]);_0xdb4463[_0xf05a('0x3c')]=_[_0xf05a('0x3d')](_0xdb4463['model'],_0xdb4463[_0xf05a('0x3b')]);_0x458ff6[_0xf05a('0x3e')]=_[_0xf05a('0x3d')](_0xdb4463[_0xf05a('0x38')],qs[_0xf05a('0x3f')](_0x1715e2[_0xf05a('0x3b')][_0xf05a('0x3f')]));_0x458ff6[_0xf05a('0x3e')]=_0x458ff6[_0xf05a('0x3e')][_0xf05a('0x40')]?_0x458ff6[_0xf05a('0x3e')]:_0xdb4463[_0xf05a('0x38')];if(_0x1715e2['query'][_0xf05a('0x47')]){_0x458ff6['include']=[{'all':!![]}];}_0x458ff6=_[_0xf05a('0x45')]({},_0x458ff6,_0x1715e2[_0xf05a('0x46')]);return db['CmList']['find'](_0x458ff6)[_0xf05a('0x29')](handleEntityNotFound(_0x32e41f,null))[_0xf05a('0x29')](respondWithResult(_0x32e41f,null))[_0xf05a('0x4b')](handleError(_0x32e41f,null));};exports[_0xf05a('0x4d')]=function(_0x4587b6,_0x21cd1f){return db[_0xf05a('0x33')]['create'](_0x4587b6['body'],{})['then'](function(_0x35325d){var _0x3fc5ab=_0x4587b6[_0xf05a('0x4e')]['get']({'plain':!![]});if(!_0x3fc5ab)throw new Error(_0xf05a('0x4f'));if(_0x3fc5ab[_0xf05a('0x50')]==='user'){var _0x487418=_0x35325d[_0xf05a('0x2b')]({'plain':!![]});var _0x145d30='Lists';return db['UserProfileSection'][_0xf05a('0x51')]({'where':{'name':_0x145d30,'userProfileId':_0x3fc5ab[_0xf05a('0x52')]},'raw':!![]})[_0xf05a('0x29')](function(_0x577b84){if(_0x577b84&&_0x577b84['autoAssociation']===0x0){return db['UserProfileResource'][_0xf05a('0x4d')]({'name':_0x487418[_0xf05a('0x30')],'resourceId':_0x487418['id'],'type':_0x577b84[_0xf05a('0x30')],'sectionId':_0x577b84['id']},{})[_0xf05a('0x29')](function(){return _0x35325d;});}else{return _0x35325d;}})[_0xf05a('0x4b')](function(_0x568eae){logger['error'](_0xf05a('0x53'),_0x568eae);throw _0x568eae;});}return _0x35325d;})[_0xf05a('0x29')](respondWithResult(_0x21cd1f,0xc9))[_0xf05a('0x4b')](handleError(_0x21cd1f,null));};exports[_0xf05a('0x28')]=function(_0x5b01bf,_0x4a52bc){if(_0x5b01bf['body']['id']){delete _0x5b01bf[_0xf05a('0x54')]['id'];}return db[_0xf05a('0x33')][_0xf05a('0x51')]({'where':{'id':_0x5b01bf[_0xf05a('0x55')]['id']}})[_0xf05a('0x29')](handleEntityNotFound(_0x4a52bc,null))[_0xf05a('0x29')](saveUpdates(_0x5b01bf['body'],null))['then'](respondWithResult(_0x4a52bc,null))[_0xf05a('0x4b')](handleError(_0x4a52bc,null));};exports[_0xf05a('0x2a')]=function(_0x331088,_0x40e3eb){return db[_0xf05a('0x33')][_0xf05a('0x51')]({'where':{'id':_0x331088['params']['id']}})[_0xf05a('0x29')](handleEntityNotFound(_0x40e3eb,null))[_0xf05a('0x29')](removeEntity(_0x40e3eb,null))[_0xf05a('0x4b')](handleError(_0x40e3eb,null));};exports['describe']=function(_0x14122b,_0x2a2581){return db[_0xf05a('0x33')]['describe']()['then'](respondWithResult(_0x2a2581,null))[_0xf05a('0x4b')](handleError(_0x2a2581,null));};exports['addDisposition']=function(_0x35a30e,_0x1c73b5,_0x4d353f){if(_0x35a30e['body']['id']){delete _0x35a30e[_0xf05a('0x54')]['id'];}return db[_0xf05a('0x33')][_0xf05a('0x51')]({'where':{'id':_0x35a30e[_0xf05a('0x55')]['id']}})[_0xf05a('0x29')](handleEntityNotFound(_0x1c73b5,null))[_0xf05a('0x29')](function(_0x562041){if(_0x562041){_0x35a30e[_0xf05a('0x54')][_0xf05a('0x56')]=_0x562041['id'];return db[_0xf05a('0x57')][_0xf05a('0x4d')](_0x35a30e[_0xf05a('0x54')]);}})['then'](respondWithResult(_0x1c73b5,null))['catch'](handleError(_0x1c73b5,null));};exports[_0xf05a('0x58')]=function(_0x4d511a,_0x114d9f,_0x472502){var _0x5d2947={'raw':![],'where':{}};var _0x14b01a={};var _0x5a4a68={'count':0x0,'rows':[]};return db[_0xf05a('0x33')][_0xf05a('0x59')]({'where':{'id':_0x4d511a[_0xf05a('0x55')]['id']}})[_0xf05a('0x29')](handleEntityNotFound(_0x114d9f,null))[_0xf05a('0x29')](function(_0x3b6a16){if(_0x3b6a16){_0x14b01a[_0xf05a('0x38')]=_[_0xf05a('0x3a')](db[_0xf05a('0x57')][_0xf05a('0x34')]);_0x14b01a[_0xf05a('0x3b')]=_['keys'](_0x4d511a[_0xf05a('0x3b')]);_0x14b01a[_0xf05a('0x3c')]=_[_0xf05a('0x3d')](_0x14b01a[_0xf05a('0x38')],_0x14b01a[_0xf05a('0x3b')]);_0x5d2947[_0xf05a('0x3e')]=_[_0xf05a('0x3d')](_0x14b01a[_0xf05a('0x38')],qs['fields'](_0x4d511a[_0xf05a('0x3b')][_0xf05a('0x3f')]));_0x5d2947[_0xf05a('0x3e')]=_0x5d2947['attributes'][_0xf05a('0x40')]?_0x5d2947[_0xf05a('0x3e')]:_0x14b01a[_0xf05a('0x38')];if(!_0x4d511a['query'][_0xf05a('0x41')](_0xf05a('0x5a'))){_0x5d2947['limit']=qs[_0xf05a('0x23')](_0x4d511a[_0xf05a('0x3b')][_0xf05a('0x23')]);_0x5d2947['offset']=qs[_0xf05a('0x21')](_0x4d511a[_0xf05a('0x3b')][_0xf05a('0x21')]);}_0x5d2947[_0xf05a('0x42')]=qs[_0xf05a('0x43')](_0x4d511a[_0xf05a('0x3b')][_0xf05a('0x43')]);_0x5d2947[_0xf05a('0x44')]=qs[_0xf05a('0x3c')](_['pick'](_0x4d511a['query'],_0x14b01a[_0xf05a('0x3c')]));_0x5d2947[_0xf05a('0x44')][_0xf05a('0x56')]=_0x3b6a16['id'];if(_0x4d511a[_0xf05a('0x3b')][_0xf05a('0x5b')]){_0x5d2947[_0xf05a('0x44')]=_[_0xf05a('0x45')](_0x5d2947[_0xf05a('0x44')],{'$or':_[_0xf05a('0x39')](_0x5d2947[_0xf05a('0x3e')],function(_0x4e315e){var _0x1a88ff={};_0x1a88ff[_0x4e315e]={'$like':'%'+_0x4d511a[_0xf05a('0x3b')]['filter']+'%'};return _0x1a88ff;})});}_0x5d2947=_[_0xf05a('0x45')]({},_0x5d2947,_0x4d511a[_0xf05a('0x46')]);return db[_0xf05a('0x57')][_0xf05a('0x24')]({'where':_0x5d2947[_0xf05a('0x44')]})[_0xf05a('0x29')](function(_0xd93881){_0x5a4a68[_0xf05a('0x24')]=_0xd93881;if(_0x4d511a[_0xf05a('0x3b')][_0xf05a('0x47')]){_0x5d2947[_0xf05a('0x48')]=[{'all':!![]}];}return db[_0xf05a('0x57')][_0xf05a('0x49')](_0x5d2947);})[_0xf05a('0x29')](function(_0x2ecdf7){_0x5a4a68[_0xf05a('0x4a')]=_0x2ecdf7;return _0x5a4a68;});}})[_0xf05a('0x29')](respondWithFilteredResult(_0x114d9f,_0x5d2947))['catch'](handleError(_0x114d9f,null));};exports['removeDispositions']=function(_0x19e1bf,_0x429469,_0x19714d){return db[_0xf05a('0x33')]['find']({'where':{'id':_0x19e1bf[_0xf05a('0x55')]['id']}})[_0xf05a('0x29')](handleEntityNotFound(_0x429469,null))[_0xf05a('0x29')](function(_0x4fa148){if(_0x4fa148){return _0x4fa148[_0xf05a('0x5c')](_0x19e1bf[_0xf05a('0x3b')][_0xf05a('0x5d')]);}})[_0xf05a('0x29')](respondWithStatusCode(_0x429469,null))[_0xf05a('0x4b')](handleError(_0x429469,null));};exports['addContacts']=function(_0x13dd3a,_0x159b3a,_0x4ea87b){return db[_0xf05a('0x33')][_0xf05a('0x51')]({'where':{'id':_0x13dd3a[_0xf05a('0x55')]['id']}})[_0xf05a('0x29')](handleEntityNotFound(_0x159b3a,null))[_0xf05a('0x29')](function(_0xdf5a3){if(_0xdf5a3){var _0x17239a=[];var _0x8ec934={'success':[],'errors':[]};return db[_0xf05a('0x5e')][_0xf05a('0x5f')]()['then'](function(_0x3a8197){if(_0x13dd3a[_0xf05a('0x54')][_0xf05a('0x60')]&&_[_0xf05a('0x61')](_0x13dd3a[_0xf05a('0x54')][_0xf05a('0x60')])){if(_0x13dd3a['body'][_0xf05a('0x60')][_0xf05a('0x40')]){_0x13dd3a['body'][_0xf05a('0x60')]=_0x13dd3a[_0xf05a('0x54')]['tags'][_0xf05a('0x62')](';')+';';}else{_0x13dd3a[_0xf05a('0x54')][_0xf05a('0x60')]=null;}}else{_0x13dd3a[_0xf05a('0x54')][_0xf05a('0x60')]=null;}if(_0x13dd3a[_0xf05a('0x54')]&&_[_0xf05a('0x61')](_0x13dd3a[_0xf05a('0x54')])){for(var _0x2974b6=0x0;_0x2974b6<_0x13dd3a[_0xf05a('0x54')][_0xf05a('0x40')];_0x2974b6+=0x1){_0x13dd3a[_0xf05a('0x54')][_0x2974b6][_0xf05a('0x56')]=_0x13dd3a[_0xf05a('0x55')]['id'];_0x17239a[_0xf05a('0x63')](_0x13dd3a[_0xf05a('0x54')][_0x2974b6]);}return BPromise['each'](_0x17239a,function(_0x53e333){return db[_0xf05a('0x5e')][_0xf05a('0x4d')](_[_0xf05a('0x64')](_0x53e333,[_0xf05a('0x5d'),'id'])||{},{'fields':_[_0xf05a('0x3a')](_0x3a8197),'raw':!![]})[_0xf05a('0x29')](function(_0x52e3ce){_0x8ec934[_0xf05a('0x65')]['push'](_0x52e3ce[_0xf05a('0x66')]);})['catch'](function(_0x67746){_0x8ec934[_0xf05a('0x67')]['push']({'data':_0x53e333,'error':_0x67746[_0xf05a('0x68')]});});})[_0xf05a('0x29')](function(_0x3f6455){return _0x8ec934;})[_0xf05a('0x4b')](function(_0x8a5c27){return _0x8a5c27;});}else{_0x159b3a[_0xf05a('0x1f')](0x190)[_0xf05a('0x20')]({'message':_0xf05a('0x69')});}});}})['then'](respondWithResult(_0x159b3a,null))['catch'](handleError(_0x159b3a,null));};exports[_0xf05a('0x6a')]=function(_0x1fd88a,_0x1e9cc3,_0x3f6b6f){var _0x49e935;return db[_0xf05a('0x33')]['find']({'where':{'id':_0x1fd88a['params']['id']},'include':[{'model':db[_0xf05a('0x6b')],'as':_0xf05a('0x6c')}]})[_0xf05a('0x29')](handleEntityNotFound(_0x1e9cc3,null))['then'](function(_0x576f3e){if(_0x576f3e){_0x49e935=_0x576f3e;return db['CmContact'][_0xf05a('0x34')];}})[_0xf05a('0x29')](function(_0x3bd719){if(_0x3bd719){var _0x1c9cce={};var _0x3477d4={};_0x3477d4[_0xf05a('0x38')]=_['concat'](_[_0xf05a('0x3a')](_0x3bd719),_[_0xf05a('0x39')](_0x49e935[_0xf05a('0x6c')],function(_0xa0400f){return util[_0xf05a('0x6d')](_0xf05a('0x6e'),_0xa0400f['id']);}));_0x3477d4[_0xf05a('0x3b')]=_[_0xf05a('0x3a')](_0x1fd88a['query']);_0x3477d4[_0xf05a('0x3c')]=_[_0xf05a('0x3d')](_0x3477d4[_0xf05a('0x38')],_0x3477d4[_0xf05a('0x3b')]);_0x1c9cce[_0xf05a('0x3e')]=_[_0xf05a('0x3d')](_0x3477d4['model'],qs[_0xf05a('0x3f')](_0x1fd88a[_0xf05a('0x3b')]['fields']));_0x1c9cce['attributes']=_0x1c9cce[_0xf05a('0x3e')][_0xf05a('0x40')]?_0x1c9cce[_0xf05a('0x3e')]:_0x3477d4['model'];if(!_0x1fd88a['query'][_0xf05a('0x41')](_0xf05a('0x5a'))){_0x1c9cce[_0xf05a('0x23')]=qs[_0xf05a('0x23')](_0x1fd88a[_0xf05a('0x3b')][_0xf05a('0x23')]);_0x1c9cce['offset']=qs['offset'](_0x1fd88a[_0xf05a('0x3b')]['offset']);}_0x1c9cce['order']=qs[_0xf05a('0x43')](_0x1fd88a[_0xf05a('0x3b')][_0xf05a('0x43')]);_0x1c9cce[_0xf05a('0x44')]=qs[_0xf05a('0x3c')](_['pick'](_0x1fd88a['query'],_0x3477d4[_0xf05a('0x3c')]));_0x1c9cce[_0xf05a('0x6f')]=!![];if(_0x1fd88a[_0xf05a('0x3b')][_0xf05a('0x5b')]){_0x1c9cce[_0xf05a('0x44')]=_[_0xf05a('0x45')](_0x1c9cce[_0xf05a('0x44')],{'$or':_[_0xf05a('0x39')](_0x1c9cce[_0xf05a('0x3e')],function(_0x2a8034){var _0x556f76={};_0x556f76[_0x2a8034]={'$like':'%'+_0x1fd88a[_0xf05a('0x3b')][_0xf05a('0x5b')]+'%'};return _0x556f76;})});}_0x1c9cce=_[_0xf05a('0x45')]({},_0x1c9cce,_0x1fd88a['options']);return _0x49e935[_0xf05a('0x6a')](_0x1c9cce);}})['then'](respondWithResult(_0x1e9cc3,null))[_0xf05a('0x4b')](handleError(_0x1e9cc3,null));};exports[_0xf05a('0x70')]=function(_0x2ce1fe,_0x52bf2a,_0x5451cb){var _0x2b70d5;return db[_0xf05a('0x33')][_0xf05a('0x51')]({'where':{'id':_0x2ce1fe[_0xf05a('0x55')]['id']},'include':[{'model':db[_0xf05a('0x6b')],'as':'CustomFields'}]})[_0xf05a('0x29')](handleEntityNotFound(_0x52bf2a,null))[_0xf05a('0x29')](function(_0x5987ef){if(_0x5987ef){_0x2b70d5=_0x5987ef;return db['CmContact'][_0xf05a('0x34')];}})[_0xf05a('0x29')](function(_0x30dc9e){if(_0x30dc9e){var _0x9ef79b={};var _0x115d91={};_0x115d91['model']=_[_0xf05a('0x71')](_[_0xf05a('0x3a')](_0x30dc9e),_[_0xf05a('0x39')](_0x2b70d5['CustomFields'],function(_0x4fc538){return util[_0xf05a('0x6d')]('cf_%d',_0x4fc538['id']);}));_0x115d91[_0xf05a('0x3b')]=_[_0xf05a('0x3a')](_0x2ce1fe[_0xf05a('0x3b')]);_0x115d91[_0xf05a('0x3c')]=_[_0xf05a('0x3d')](_0x115d91['model'],_0x115d91[_0xf05a('0x3b')]);_0x9ef79b[_0xf05a('0x3e')]=_[_0xf05a('0x3d')](_0x115d91[_0xf05a('0x38')],qs[_0xf05a('0x3f')](_0x2ce1fe['query'][_0xf05a('0x3f')]));_0x9ef79b['attributes']=_0x9ef79b[_0xf05a('0x3e')][_0xf05a('0x40')]?_0x9ef79b[_0xf05a('0x3e')]:_0x115d91[_0xf05a('0x38')];if(!_0x2ce1fe['query'][_0xf05a('0x41')](_0xf05a('0x5a'))){_0x9ef79b['limit']=qs[_0xf05a('0x23')](_0x2ce1fe[_0xf05a('0x3b')][_0xf05a('0x23')]);_0x9ef79b[_0xf05a('0x21')]=qs[_0xf05a('0x21')](_0x2ce1fe[_0xf05a('0x3b')][_0xf05a('0x21')]);}_0x9ef79b['order']=qs[_0xf05a('0x43')](_0x2ce1fe[_0xf05a('0x3b')][_0xf05a('0x43')]);_0x9ef79b['where']=qs[_0xf05a('0x3c')](_[_0xf05a('0x72')](_0x2ce1fe[_0xf05a('0x3b')],_0x115d91[_0xf05a('0x3c')]));_0x9ef79b['raw']=!![];if(_0x2ce1fe[_0xf05a('0x3b')][_0xf05a('0x5b')]){_0x9ef79b[_0xf05a('0x44')]=_[_0xf05a('0x45')](_0x9ef79b[_0xf05a('0x44')],{'$or':_['map'](_0x9ef79b[_0xf05a('0x3e')],function(_0xf68fec){var _0x409485={};_0x409485[_0xf68fec]={'$like':'%'+_0x2ce1fe[_0xf05a('0x3b')][_0xf05a('0x5b')]+'%'};return _0x409485;})});}_0x9ef79b=_[_0xf05a('0x45')]({},_0x9ef79b,_0x2ce1fe[_0xf05a('0x46')]);return _0x2b70d5['getContacts'](_0x9ef79b);}})[_0xf05a('0x29')](function(_0x143070){if(!_[_0xf05a('0x73')](_0x143070)){var _0x39d8a7=toCsv(_0x143070);var _0xc4c1fc=Date[_0xf05a('0x74')]();fs[_0xf05a('0x75')](util[_0xf05a('0x6d')]('/tmp/list_%d_%s.csv',_0x2b70d5['id'],_0xc4c1fc),_0x39d8a7);_0x52bf2a[_0xf05a('0x76')]('Content-disposition',_0xf05a('0x77')+util['format']('list_%d_%s.csv',_0x2b70d5['id'],_0xc4c1fc));_0x52bf2a[_0xf05a('0x76')](_0xf05a('0x78'),_0xf05a('0x79'));return _0x52bf2a[_0xf05a('0x7a')](util[_0xf05a('0x6d')](_0xf05a('0x7b'),_0x2b70d5['id'],_0xc4c1fc));}else{return _0x52bf2a[_0xf05a('0x1d')](0xcc);}})[_0xf05a('0x4b')](handleError(_0x52bf2a,null));};exports[_0xf05a('0x7c')]=function(_0x34d37f,_0x2c20f4,_0x426a39){var _0x23122a;delete _0x34d37f[_0xf05a('0x54')]['id'];return db[_0xf05a('0x33')][_0xf05a('0x59')]({'where':{'id':_0x34d37f[_0xf05a('0x55')]['id']}})[_0xf05a('0x29')](handleEntityNotFound(_0x2c20f4,null))['then'](function(_0x331401){if(_0x331401){return db[_0xf05a('0x7d')][_0xf05a('0x7e')](function(_0x4d0b59){return db[_0xf05a('0x6b')][_0xf05a('0x4d')](_0x34d37f[_0xf05a('0x54')],{'transaction':_0x4d0b59})[_0xf05a('0x29')](function(_0xea8ead){_0x23122a=_0xea8ead;return _0x331401[_0xf05a('0x7f')](_0xea8ead,{'transaction':_0x4d0b59});})['then'](function(){var _0x2d4757={'type':db['Sequelize']['TEXT'],'transaction':_0x4d0b59};switch(_0x34d37f['body'][_0xf05a('0x36')]){case _0xf05a('0x80'):_0x2d4757[_0xf05a('0x36')]=db['Sequelize'][_0xf05a('0x81')];break;case'number':_0x2d4757['type']=db['Sequelize'][_0xf05a('0x82')];break;case _0xf05a('0x83'):_0x2d4757[_0xf05a('0x36')]=db['Sequelize']['BOOLEAN'];_0x2d4757['defaultValue']=![];break;default:}return db[_0xf05a('0x7d')][_0xf05a('0x84')][_0xf05a('0x85')](_0xf05a('0x86'),util[_0xf05a('0x6d')](_0xf05a('0x87'),_0x23122a['id']),_0x2d4757);})[_0xf05a('0x29')](function(){return _0x23122a;});});}})[_0xf05a('0x29')](respondWithResult(_0x2c20f4,null))[_0xf05a('0x4b')](handleError(_0x2c20f4,null));};exports[_0xf05a('0x88')]=function(_0x465c43,_0x1fbc87,_0x545057){var _0xa6bf2c={};var _0x291684={};var _0xdf3e8c;var _0x156bfd;return db[_0xf05a('0x33')]['findOne']({'where':{'id':_0x465c43[_0xf05a('0x55')]['id']}})[_0xf05a('0x29')](handleEntityNotFound(_0x1fbc87,null))[_0xf05a('0x29')](function(_0xe63171){if(_0xe63171){_0xdf3e8c=_0xe63171;_0x291684[_0xf05a('0x38')]=_[_0xf05a('0x3a')](db[_0xf05a('0x6b')][_0xf05a('0x34')]);_0x291684[_0xf05a('0x3b')]=_['keys'](_0x465c43[_0xf05a('0x3b')]);_0x291684[_0xf05a('0x3c')]=_[_0xf05a('0x3d')](_0x291684['model'],_0x291684[_0xf05a('0x3b')]);_0xa6bf2c[_0xf05a('0x3e')]=_[_0xf05a('0x3d')](_0x291684['model'],qs['fields'](_0x465c43[_0xf05a('0x3b')][_0xf05a('0x3f')]));_0xa6bf2c[_0xf05a('0x3e')]=_0xa6bf2c[_0xf05a('0x3e')][_0xf05a('0x40')]?_0xa6bf2c[_0xf05a('0x3e')]:_0x291684[_0xf05a('0x38')];_0xa6bf2c['order']=qs['sort'](_0x465c43[_0xf05a('0x3b')][_0xf05a('0x43')]);_0xa6bf2c[_0xf05a('0x44')]=qs['filters'](_[_0xf05a('0x72')](_0x465c43[_0xf05a('0x3b')],_0x291684[_0xf05a('0x3c')]));_0xa6bf2c[_0xf05a('0x44')]=_['merge'](_0xa6bf2c['where'],{'$or':[{'ListId':_0xe63171['id']},{'ListId':null}]});if(_0x465c43[_0xf05a('0x3b')]['filter']){_0xa6bf2c[_0xf05a('0x44')]=_['merge'](_0xa6bf2c[_0xf05a('0x44')],{'$or':_['map'](_0xa6bf2c['attributes'],function(_0x3701e4){var _0x25813c={};_0x25813c[_0x3701e4]={'$like':'%'+_0x465c43[_0xf05a('0x3b')]['filter']+'%'};return _0x25813c;})});}_0xa6bf2c=_['merge']({},_0xa6bf2c,_0x465c43[_0xf05a('0x46')]);return db['CmCustomField'][_0xf05a('0x89')](_0xa6bf2c);}})[_0xf05a('0x29')](respondWithResult(_0x1fbc87,null))['catch'](handleError(_0x1fbc87,null));};exports[_0xf05a('0x8a')]=function(_0x37badd,_0x4c83a4,_0xc1bb94){return db[_0xf05a('0x33')][_0xf05a('0x51')]({'where':{'id':_0x37badd[_0xf05a('0x55')]['id']}})['then'](handleEntityNotFound(_0x4c83a4,null))[_0xf05a('0x29')](function(_0x4d00ad){if(_0x4d00ad){return _0x4d00ad['addAgents'](_0x37badd['body'][_0xf05a('0x5d')],_[_0xf05a('0x64')](_0x37badd['body'],[_0xf05a('0x5d'),'id'])||{})[_0xf05a('0x8b')](function(_0x218b1d){for(var _0x335873=0x0;_0x335873<_0x37badd[_0xf05a('0x54')][_0xf05a('0x5d')][_0xf05a('0x40')];_0x335873+=0x1){socket['emit'](_0xf05a('0x8c'),{'UserId':Number(_0x37badd[_0xf05a('0x54')][_0xf05a('0x5d')][_0x335873]),'CmListId':Number(_0x37badd[_0xf05a('0x55')]['id'])});}return _0x218b1d;});}})[_0xf05a('0x29')](respondWithResult(_0x4c83a4,null))[_0xf05a('0x4b')](handleError(_0x4c83a4,null));};exports['removeAgents']=function(_0x1f0c3a,_0x28b2dc,_0x3bc0e4){return db[_0xf05a('0x33')]['find']({'where':{'id':_0x1f0c3a[_0xf05a('0x55')]['id']}})[_0xf05a('0x29')](handleEntityNotFound(_0x28b2dc,null))[_0xf05a('0x29')](function(_0x10efbb){if(_0x10efbb){return _0x10efbb[_0xf05a('0x8d')](_0x1f0c3a['query'][_0xf05a('0x5d')])[_0xf05a('0x29')](function(){if(_['isArray'](_0x1f0c3a[_0xf05a('0x3b')][_0xf05a('0x5d')])){for(var _0xee3953=0x0;_0xee3953<_0x1f0c3a['query']['ids']['length'];_0xee3953+=0x1){socket[_0xf05a('0x8e')](_0xf05a('0x8f'),{'UserId':Number(_0x1f0c3a['query'][_0xf05a('0x5d')][_0xee3953]),'CmListId':Number(_0x1f0c3a[_0xf05a('0x55')]['id'])});}}else{socket['emit'](_0xf05a('0x8f'),{'UserId':Number(_0x1f0c3a[_0xf05a('0x3b')][_0xf05a('0x5d')]),'CmListId':Number(_0x1f0c3a[_0xf05a('0x55')]['id'])});}});}})['then'](respondWithStatusCode(_0x28b2dc,null))['catch'](handleError(_0x28b2dc,null));};exports[_0xf05a('0x90')]=function(_0x3b6650,_0x594734,_0x4af546){var _0xf6b0fe={};var _0x3ddda5={};var _0x5b5d93;var _0x5b3f2b;return db[_0xf05a('0x33')][_0xf05a('0x59')]({'where':{'id':_0x3b6650['params']['id']}})['then'](handleEntityNotFound(_0x594734,null))[_0xf05a('0x29')](function(_0x445bbf){if(_0x445bbf){_0x5b5d93=_0x445bbf;_0x3ddda5[_0xf05a('0x38')]=_[_0xf05a('0x3a')](db['User']['rawAttributes']);_0x3ddda5[_0xf05a('0x3b')]=_[_0xf05a('0x3a')](_0x3b6650[_0xf05a('0x3b')]);_0x3ddda5['filters']=_['intersection'](_0x3ddda5[_0xf05a('0x38')],_0x3ddda5[_0xf05a('0x3b')]);_0xf6b0fe[_0xf05a('0x3e')]=_['intersection'](_0x3ddda5[_0xf05a('0x38')],qs[_0xf05a('0x3f')](_0x3b6650[_0xf05a('0x3b')][_0xf05a('0x3f')]));_0xf6b0fe[_0xf05a('0x3e')]=_0xf6b0fe[_0xf05a('0x3e')][_0xf05a('0x40')]?_0xf6b0fe[_0xf05a('0x3e')]:_0x3ddda5[_0xf05a('0x38')];_0xf6b0fe['order']=qs[_0xf05a('0x43')](_0x3b6650[_0xf05a('0x3b')][_0xf05a('0x43')]);_0xf6b0fe[_0xf05a('0x44')]=qs[_0xf05a('0x3c')](_[_0xf05a('0x72')](_0x3b6650[_0xf05a('0x3b')],_0x3ddda5[_0xf05a('0x3c')]));if(_0x3b6650[_0xf05a('0x3b')][_0xf05a('0x5b')]){_0xf6b0fe['where']=_[_0xf05a('0x45')](_0xf6b0fe['where'],{'$or':_[_0xf05a('0x39')](_0xf6b0fe[_0xf05a('0x3e')],function(_0x55b17e){var _0x2f552c={};_0x2f552c[_0x55b17e]={'$like':'%'+_0x3b6650[_0xf05a('0x3b')][_0xf05a('0x5b')]+'%'};return _0x2f552c;})});}_0xf6b0fe=_[_0xf05a('0x45')]({},_0xf6b0fe,_0x3b6650[_0xf05a('0x46')]);return _0x5b5d93['getAgents'](_0xf6b0fe);}})['then'](function(_0x14dba7){if(_0x14dba7){_0x5b3f2b=_0x14dba7[_0xf05a('0x40')];if(!_0x3b6650[_0xf05a('0x3b')][_0xf05a('0x41')](_0xf05a('0x5a'))){_0xf6b0fe[_0xf05a('0x23')]=qs[_0xf05a('0x23')](_0x3b6650[_0xf05a('0x3b')]['limit']);_0xf6b0fe['offset']=qs[_0xf05a('0x21')](_0x3b6650[_0xf05a('0x3b')][_0xf05a('0x21')]);}return _0x5b5d93[_0xf05a('0x90')](_0xf6b0fe);}})[_0xf05a('0x29')](function(_0x4b9df7){if(_0x4b9df7){return _0x4b9df7?{'count':_0x5b3f2b,'rows':_0x4b9df7}:null;}})['then'](respondWithResult(_0x594734,null))[_0xf05a('0x4b')](handleError(_0x594734,null));}; \ No newline at end of file +var _0xb374=['../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./cmList.socket','register','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','save','then','destroy','Lists','UserProfileResource','sendStatus','error','stack','name','send','index','map','CmList','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','sort','pick','filter','where','merge','includeAll','include','findAll','rows','catch','show','params','options','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','addDisposition','ListId','Disposition','getDispositions','hasOwnProperty','order','removeDispositions','ids','addContacts','CmContact','describe','isArray','tags','join','push','each','omit','success','dataValues','Malformed\x20request\x20syntax','getContacts','CmCustomField','concat','CustomFields','format','cf_%d','raw','getContactsCsv','isEmpty','now','writeFileSync','/tmp/list_%d_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','text/csv','addCustomField','findOne','sequelize','transaction','addCustomFields','TEXT','Sequelize','switch','BOOLEAN','queryInterface','cm_contacts','cf_%s','findAndCountAll','addAgents','emit','userCmList:save','removeAgents','userCmList:remove','User','getAgents','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0xb50f29,_0xbdf53f){var _0x1a629b=function(_0x4f2de3){while(--_0x4f2de3){_0xb50f29['push'](_0xb50f29['shift']());}};_0x1a629b(++_0xbdf53f);}(_0xb374,0x113));var _0x4b37=function(_0x4434d4,_0x2989a5){_0x4434d4=_0x4434d4-0x0;var _0x3f1866=_0xb374[_0x4434d4];return _0x3f1866;};'use strict';var emlformat=require(_0x4b37('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x4b37('0x1'));var rp=require(_0x4b37('0x2'));var moment=require(_0x4b37('0x3'));var BPromise=require(_0x4b37('0x4'));var Mustache=require(_0x4b37('0x5'));var util=require(_0x4b37('0x6'));var path=require('path');var sox=require(_0x4b37('0x7'));var csv=require(_0x4b37('0x8'));var ejs=require(_0x4b37('0x9'));var fs=require('fs');var fs_extra=require(_0x4b37('0xa'));var _=require('lodash');var squel=require(_0x4b37('0xb'));var crypto=require(_0x4b37('0xc'));var jsforce=require(_0x4b37('0xd'));var deskjs=require(_0x4b37('0xe'));var toCsv=require(_0x4b37('0x8'));var querystring=require(_0x4b37('0xf'));var Papa=require(_0x4b37('0x10'));var Redis=require(_0x4b37('0x11'));var authService=require(_0x4b37('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x4b37('0x13'));var hardwareService=require(_0x4b37('0x14'));var logger=require(_0x4b37('0x15'))(_0x4b37('0x16'));var utils=require(_0x4b37('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4b37('0x18'))['db'];config[_0x4b37('0x19')]=_[_0x4b37('0x1a')](config[_0x4b37('0x19')],{'host':_0x4b37('0x1b'),'port':0x18eb});var socket=require(_0x4b37('0x1c'))(new Redis(config[_0x4b37('0x19')]));require(_0x4b37('0x1d'))[_0x4b37('0x1e')](socket);function respondWithStatusCode(_0x286638,_0x377de3){_0x377de3=_0x377de3||0xcc;return function(_0x407148){if(_0x407148){return _0x286638['sendStatus'](_0x377de3);}return _0x286638[_0x4b37('0x1f')](_0x377de3)[_0x4b37('0x20')]();};}function respondWithResult(_0x5be30f,_0x10ad3a){_0x10ad3a=_0x10ad3a||0xc8;return function(_0x413f16){if(_0x413f16){return _0x5be30f['status'](_0x10ad3a)['json'](_0x413f16);}};}function respondWithFilteredResult(_0x13ccb8,_0x2518fc){return function(_0x43ee1d){if(_0x43ee1d){var _0x1a5ebc=typeof _0x2518fc[_0x4b37('0x21')]===_0x4b37('0x22')&&typeof _0x2518fc[_0x4b37('0x23')]===_0x4b37('0x22');var _0x5a07ac=_0x43ee1d[_0x4b37('0x24')];var _0x5ed34f=_0x1a5ebc?0x0:_0x2518fc[_0x4b37('0x21')];var _0x2754c9=_0x1a5ebc?_0x43ee1d[_0x4b37('0x24')]:_0x2518fc['offset']+_0x2518fc[_0x4b37('0x23')];var _0x1af77b;if(_0x2754c9>=_0x5a07ac){_0x2754c9=_0x5a07ac;_0x1af77b=0xc8;}else{_0x1af77b=0xce;}_0x13ccb8[_0x4b37('0x1f')](_0x1af77b);return _0x13ccb8[_0x4b37('0x25')](_0x4b37('0x26'),_0x5ed34f+'-'+_0x2754c9+'/'+_0x5a07ac)[_0x4b37('0x27')](_0x43ee1d);}return null;};}function patchUpdates(_0x21b685){return function(_0x2df596){try{jsonpatch[_0x4b37('0x28')](_0x2df596,_0x21b685,!![]);}catch(_0x2b304e){return BPromise['reject'](_0x2b304e);}return _0x2df596[_0x4b37('0x29')]();};}function saveUpdates(_0xeb58bf,_0x36dea5){return function(_0x3dfd63){if(_0x3dfd63){return _0x3dfd63['update'](_0xeb58bf)[_0x4b37('0x2a')](function(_0x16e3bc){return _0x16e3bc;});}return null;};}function removeEntity(_0x2b266a,_0x94b990){return function(_0x20a4ee){if(_0x20a4ee){return _0x20a4ee[_0x4b37('0x2b')]()[_0x4b37('0x2a')](function(){var _0xdbe1e1=_0x20a4ee['get']({'plain':!![]});var _0x90a081=_0x4b37('0x2c');return db[_0x4b37('0x2d')]['destroy']({'where':{'type':_0x90a081,'resourceId':_0xdbe1e1['id']}})['then'](function(){return _0x20a4ee;});})[_0x4b37('0x2a')](function(){_0x2b266a[_0x4b37('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x499978,_0x11bf22){return function(_0x58fd41){if(!_0x58fd41){_0x499978[_0x4b37('0x2e')](0x194);}return _0x58fd41;};}function handleError(_0x1c223f,_0x51cb7b){_0x51cb7b=_0x51cb7b||0x1f4;return function(_0x4367b0){logger[_0x4b37('0x2f')](_0x4367b0[_0x4b37('0x30')]);if(_0x4367b0[_0x4b37('0x31')]){delete _0x4367b0[_0x4b37('0x31')];}_0x1c223f[_0x4b37('0x1f')](_0x51cb7b)[_0x4b37('0x32')](_0x4367b0);};}exports[_0x4b37('0x33')]=function(_0x1242d9,_0x3db522){var _0x2f8414={},_0x354d4a={},_0x11718a={'count':0x0,'rows':[]};var _0x35d165=_[_0x4b37('0x34')](db[_0x4b37('0x35')][_0x4b37('0x36')],function(_0x4bcd76){return{'name':_0x4bcd76[_0x4b37('0x37')],'type':_0x4bcd76[_0x4b37('0x38')][_0x4b37('0x39')]};});_0x354d4a['model']=_[_0x4b37('0x34')](_0x35d165,_0x4b37('0x31'));_0x354d4a[_0x4b37('0x3a')]=_[_0x4b37('0x3b')](_0x1242d9['query']);_0x354d4a[_0x4b37('0x3c')]=_[_0x4b37('0x3d')](_0x354d4a[_0x4b37('0x3e')],_0x354d4a['query']);_0x2f8414[_0x4b37('0x3f')]=_[_0x4b37('0x3d')](_0x354d4a[_0x4b37('0x3e')],qs[_0x4b37('0x40')](_0x1242d9[_0x4b37('0x3a')]['fields']));_0x2f8414[_0x4b37('0x3f')]=_0x2f8414[_0x4b37('0x3f')][_0x4b37('0x41')]?_0x2f8414['attributes']:_0x354d4a[_0x4b37('0x3e')];if(!_0x1242d9[_0x4b37('0x3a')]['hasOwnProperty'](_0x4b37('0x42'))){_0x2f8414[_0x4b37('0x23')]=qs[_0x4b37('0x23')](_0x1242d9[_0x4b37('0x3a')][_0x4b37('0x23')]);_0x2f8414[_0x4b37('0x21')]=qs[_0x4b37('0x21')](_0x1242d9[_0x4b37('0x3a')][_0x4b37('0x21')]);}_0x2f8414['order']=qs[_0x4b37('0x43')](_0x1242d9[_0x4b37('0x3a')]['sort']);_0x2f8414['where']=qs[_0x4b37('0x3c')](_[_0x4b37('0x44')](_0x1242d9['query'],_0x354d4a[_0x4b37('0x3c')]),_0x35d165);if(_0x1242d9['query'][_0x4b37('0x45')]){_0x2f8414[_0x4b37('0x46')]=_['merge'](_0x2f8414[_0x4b37('0x46')],{'$or':_[_0x4b37('0x34')](_0x35d165,function(_0xc10b24){if(_0xc10b24[_0x4b37('0x38')]!=='VIRTUAL'){var _0x4bd138={};_0x4bd138[_0xc10b24['name']]={'$like':'%'+_0x1242d9[_0x4b37('0x3a')][_0x4b37('0x45')]+'%'};return _0x4bd138;}})});}_0x2f8414=_[_0x4b37('0x47')]({},_0x2f8414,_0x1242d9['options']);var _0xe71c6f={'where':_0x2f8414['where']};return db[_0x4b37('0x35')][_0x4b37('0x24')](_0xe71c6f)[_0x4b37('0x2a')](function(_0xb049b7){_0x11718a[_0x4b37('0x24')]=_0xb049b7;if(_0x1242d9[_0x4b37('0x3a')][_0x4b37('0x48')]){_0x2f8414[_0x4b37('0x49')]=[{'all':!![]}];}return db[_0x4b37('0x35')][_0x4b37('0x4a')](_0x2f8414);})['then'](function(_0x1232ba){_0x11718a[_0x4b37('0x4b')]=_0x1232ba;return _0x11718a;})['then'](respondWithFilteredResult(_0x3db522,_0x2f8414))[_0x4b37('0x4c')](handleError(_0x3db522,null));};exports[_0x4b37('0x4d')]=function(_0x18d806,_0x4bddde){var _0x342951={'raw':![],'where':{'id':_0x18d806[_0x4b37('0x4e')]['id']}},_0x480b24={};_0x480b24[_0x4b37('0x3e')]=_[_0x4b37('0x3b')](db[_0x4b37('0x35')][_0x4b37('0x36')]);_0x480b24[_0x4b37('0x3a')]=_['keys'](_0x18d806[_0x4b37('0x3a')]);_0x480b24[_0x4b37('0x3c')]=_['intersection'](_0x480b24[_0x4b37('0x3e')],_0x480b24[_0x4b37('0x3a')]);_0x342951['attributes']=_['intersection'](_0x480b24[_0x4b37('0x3e')],qs['fields'](_0x18d806[_0x4b37('0x3a')]['fields']));_0x342951[_0x4b37('0x3f')]=_0x342951['attributes']['length']?_0x342951[_0x4b37('0x3f')]:_0x480b24[_0x4b37('0x3e')];if(_0x18d806[_0x4b37('0x3a')][_0x4b37('0x48')]){_0x342951[_0x4b37('0x49')]=[{'all':!![]}];}_0x342951=_[_0x4b37('0x47')]({},_0x342951,_0x18d806[_0x4b37('0x4f')]);return db[_0x4b37('0x35')]['find'](_0x342951)[_0x4b37('0x2a')](handleEntityNotFound(_0x4bddde,null))[_0x4b37('0x2a')](respondWithResult(_0x4bddde,null))[_0x4b37('0x4c')](handleError(_0x4bddde,null));};exports[_0x4b37('0x50')]=function(_0x4c4e10,_0x5a09b6){return db['CmList']['create'](_0x4c4e10[_0x4b37('0x51')],{})[_0x4b37('0x2a')](function(_0xad44a5){var _0x3407dd=_0x4c4e10[_0x4b37('0x52')][_0x4b37('0x53')]({'plain':!![]});if(!_0x3407dd)throw new Error(_0x4b37('0x54'));if(_0x3407dd[_0x4b37('0x55')]===_0x4b37('0x52')){var _0x4a458f=_0xad44a5[_0x4b37('0x53')]({'plain':!![]});var _0x5b3ace=_0x4b37('0x2c');return db[_0x4b37('0x56')][_0x4b37('0x57')]({'where':{'name':_0x5b3ace,'userProfileId':_0x3407dd[_0x4b37('0x58')]},'raw':!![]})['then'](function(_0x3e1fd7){if(_0x3e1fd7&&_0x3e1fd7[_0x4b37('0x59')]===0x0){return db[_0x4b37('0x2d')][_0x4b37('0x50')]({'name':_0x4a458f[_0x4b37('0x31')],'resourceId':_0x4a458f['id'],'type':_0x3e1fd7[_0x4b37('0x31')],'sectionId':_0x3e1fd7['id']},{})[_0x4b37('0x2a')](function(){return _0xad44a5;});}else{return _0xad44a5;}})[_0x4b37('0x4c')](function(_0x4fa6ab){logger[_0x4b37('0x2f')](_0x4b37('0x5a'),_0x4fa6ab);throw _0x4fa6ab;});}return _0xad44a5;})[_0x4b37('0x2a')](respondWithResult(_0x5a09b6,0xc9))[_0x4b37('0x4c')](handleError(_0x5a09b6,null));};exports[_0x4b37('0x5b')]=function(_0x32d45e,_0x22e7fb){if(_0x32d45e['body']['id']){delete _0x32d45e[_0x4b37('0x51')]['id'];}return db[_0x4b37('0x35')][_0x4b37('0x57')]({'where':{'id':_0x32d45e[_0x4b37('0x4e')]['id']}})[_0x4b37('0x2a')](handleEntityNotFound(_0x22e7fb,null))[_0x4b37('0x2a')](saveUpdates(_0x32d45e[_0x4b37('0x51')],null))[_0x4b37('0x2a')](respondWithResult(_0x22e7fb,null))[_0x4b37('0x4c')](handleError(_0x22e7fb,null));};exports[_0x4b37('0x2b')]=function(_0x3dda5a,_0x2c0607){return db[_0x4b37('0x35')][_0x4b37('0x57')]({'where':{'id':_0x3dda5a[_0x4b37('0x4e')]['id']}})[_0x4b37('0x2a')](handleEntityNotFound(_0x2c0607,null))[_0x4b37('0x2a')](removeEntity(_0x2c0607,null))[_0x4b37('0x4c')](handleError(_0x2c0607,null));};exports['describe']=function(_0x36bfd0,_0x143d79){return db[_0x4b37('0x35')]['describe']()[_0x4b37('0x2a')](respondWithResult(_0x143d79,null))['catch'](handleError(_0x143d79,null));};exports[_0x4b37('0x5c')]=function(_0x5bb5b0,_0x59c491,_0x7499e6){if(_0x5bb5b0[_0x4b37('0x51')]['id']){delete _0x5bb5b0['body']['id'];}return db[_0x4b37('0x35')][_0x4b37('0x57')]({'where':{'id':_0x5bb5b0[_0x4b37('0x4e')]['id']}})[_0x4b37('0x2a')](handleEntityNotFound(_0x59c491,null))[_0x4b37('0x2a')](function(_0x32a173){if(_0x32a173){_0x5bb5b0[_0x4b37('0x51')][_0x4b37('0x5d')]=_0x32a173['id'];return db[_0x4b37('0x5e')][_0x4b37('0x50')](_0x5bb5b0['body']);}})[_0x4b37('0x2a')](respondWithResult(_0x59c491,null))[_0x4b37('0x4c')](handleError(_0x59c491,null));};exports[_0x4b37('0x5f')]=function(_0x18263b,_0x26c0b2,_0x56713c){var _0x2d50f1={'raw':![],'where':{}};var _0x313541={};var _0x32c266={'count':0x0,'rows':[]};return db[_0x4b37('0x35')]['findOne']({'where':{'id':_0x18263b[_0x4b37('0x4e')]['id']}})['then'](handleEntityNotFound(_0x26c0b2,null))[_0x4b37('0x2a')](function(_0x128505){if(_0x128505){_0x313541[_0x4b37('0x3e')]=_['keys'](db[_0x4b37('0x5e')][_0x4b37('0x36')]);_0x313541[_0x4b37('0x3a')]=_['keys'](_0x18263b[_0x4b37('0x3a')]);_0x313541[_0x4b37('0x3c')]=_[_0x4b37('0x3d')](_0x313541[_0x4b37('0x3e')],_0x313541[_0x4b37('0x3a')]);_0x2d50f1[_0x4b37('0x3f')]=_[_0x4b37('0x3d')](_0x313541['model'],qs['fields'](_0x18263b[_0x4b37('0x3a')][_0x4b37('0x40')]));_0x2d50f1[_0x4b37('0x3f')]=_0x2d50f1[_0x4b37('0x3f')][_0x4b37('0x41')]?_0x2d50f1['attributes']:_0x313541[_0x4b37('0x3e')];if(!_0x18263b[_0x4b37('0x3a')][_0x4b37('0x60')](_0x4b37('0x42'))){_0x2d50f1[_0x4b37('0x23')]=qs['limit'](_0x18263b[_0x4b37('0x3a')][_0x4b37('0x23')]);_0x2d50f1[_0x4b37('0x21')]=qs[_0x4b37('0x21')](_0x18263b[_0x4b37('0x3a')][_0x4b37('0x21')]);}_0x2d50f1[_0x4b37('0x61')]=qs[_0x4b37('0x43')](_0x18263b[_0x4b37('0x3a')][_0x4b37('0x43')]);_0x2d50f1[_0x4b37('0x46')]=qs['filters'](_[_0x4b37('0x44')](_0x18263b['query'],_0x313541['filters']));_0x2d50f1[_0x4b37('0x46')]['ListId']=_0x128505['id'];if(_0x18263b['query'][_0x4b37('0x45')]){_0x2d50f1[_0x4b37('0x46')]=_[_0x4b37('0x47')](_0x2d50f1[_0x4b37('0x46')],{'$or':_[_0x4b37('0x34')](_0x2d50f1['attributes'],function(_0x8b5fd){var _0xd3d503={};_0xd3d503[_0x8b5fd]={'$like':'%'+_0x18263b[_0x4b37('0x3a')][_0x4b37('0x45')]+'%'};return _0xd3d503;})});}_0x2d50f1=_[_0x4b37('0x47')]({},_0x2d50f1,_0x18263b[_0x4b37('0x4f')]);return db['Disposition'][_0x4b37('0x24')]({'where':_0x2d50f1[_0x4b37('0x46')]})[_0x4b37('0x2a')](function(_0x4a71be){_0x32c266['count']=_0x4a71be;if(_0x18263b[_0x4b37('0x3a')][_0x4b37('0x48')]){_0x2d50f1[_0x4b37('0x49')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x2d50f1);})[_0x4b37('0x2a')](function(_0x58858e){_0x32c266[_0x4b37('0x4b')]=_0x58858e;return _0x32c266;});}})[_0x4b37('0x2a')](respondWithFilteredResult(_0x26c0b2,_0x2d50f1))[_0x4b37('0x4c')](handleError(_0x26c0b2,null));};exports[_0x4b37('0x62')]=function(_0x50331a,_0x23abcb,_0x548536){return db['CmList'][_0x4b37('0x57')]({'where':{'id':_0x50331a[_0x4b37('0x4e')]['id']}})[_0x4b37('0x2a')](handleEntityNotFound(_0x23abcb,null))[_0x4b37('0x2a')](function(_0x3f5f1f){if(_0x3f5f1f){return _0x3f5f1f[_0x4b37('0x62')](_0x50331a[_0x4b37('0x3a')][_0x4b37('0x63')]);}})['then'](respondWithStatusCode(_0x23abcb,null))[_0x4b37('0x4c')](handleError(_0x23abcb,null));};exports[_0x4b37('0x64')]=function(_0x3333ba,_0x2d9f90,_0x43adb9){return db[_0x4b37('0x35')]['find']({'where':{'id':_0x3333ba['params']['id']}})[_0x4b37('0x2a')](handleEntityNotFound(_0x2d9f90,null))[_0x4b37('0x2a')](function(_0x2a8691){if(_0x2a8691){var _0x24eace=[];var _0x589c1f={'success':[],'errors':[]};return db[_0x4b37('0x65')][_0x4b37('0x66')]()[_0x4b37('0x2a')](function(_0x10e09b){if(_0x3333ba[_0x4b37('0x51')]['tags']&&_[_0x4b37('0x67')](_0x3333ba[_0x4b37('0x51')][_0x4b37('0x68')])){if(_0x3333ba[_0x4b37('0x51')][_0x4b37('0x68')]['length']){_0x3333ba[_0x4b37('0x51')][_0x4b37('0x68')]=_0x3333ba[_0x4b37('0x51')][_0x4b37('0x68')][_0x4b37('0x69')](';')+';';}else{_0x3333ba[_0x4b37('0x51')][_0x4b37('0x68')]=null;}}else{_0x3333ba[_0x4b37('0x51')][_0x4b37('0x68')]=null;}if(_0x3333ba['body']&&_[_0x4b37('0x67')](_0x3333ba[_0x4b37('0x51')])){for(var _0x303717=0x0;_0x303717<_0x3333ba['body'][_0x4b37('0x41')];_0x303717+=0x1){_0x3333ba[_0x4b37('0x51')][_0x303717]['ListId']=_0x3333ba[_0x4b37('0x4e')]['id'];_0x24eace[_0x4b37('0x6a')](_0x3333ba[_0x4b37('0x51')][_0x303717]);}return BPromise[_0x4b37('0x6b')](_0x24eace,function(_0x2ee249){return db[_0x4b37('0x65')][_0x4b37('0x50')](_[_0x4b37('0x6c')](_0x2ee249,[_0x4b37('0x63'),'id'])||{},{'fields':_[_0x4b37('0x3b')](_0x10e09b),'raw':!![]})['then'](function(_0x24ea00){_0x589c1f[_0x4b37('0x6d')]['push'](_0x24ea00[_0x4b37('0x6e')]);})[_0x4b37('0x4c')](function(_0x19cdb8){_0x589c1f['errors']['push']({'data':_0x2ee249,'error':_0x19cdb8['message']});});})[_0x4b37('0x2a')](function(_0x5bb410){return _0x589c1f;})[_0x4b37('0x4c')](function(_0x2a770a){return _0x2a770a;});}else{_0x2d9f90[_0x4b37('0x1f')](0x190)[_0x4b37('0x27')]({'message':_0x4b37('0x6f')});}});}})[_0x4b37('0x2a')](respondWithResult(_0x2d9f90,null))['catch'](handleError(_0x2d9f90,null));};exports[_0x4b37('0x70')]=function(_0x598c60,_0x5dd8e9,_0x22a416){var _0x2c327f;return db[_0x4b37('0x35')][_0x4b37('0x57')]({'where':{'id':_0x598c60[_0x4b37('0x4e')]['id']},'include':[{'model':db[_0x4b37('0x71')],'as':'CustomFields'}]})[_0x4b37('0x2a')](handleEntityNotFound(_0x5dd8e9,null))['then'](function(_0x4d50c2){if(_0x4d50c2){_0x2c327f=_0x4d50c2;return db['CmContact']['rawAttributes'];}})[_0x4b37('0x2a')](function(_0x508374){if(_0x508374){var _0x393975={};var _0x475a86={};_0x475a86[_0x4b37('0x3e')]=_[_0x4b37('0x72')](_['keys'](_0x508374),_[_0x4b37('0x34')](_0x2c327f[_0x4b37('0x73')],function(_0x3fbb76){return util[_0x4b37('0x74')](_0x4b37('0x75'),_0x3fbb76['id']);}));_0x475a86[_0x4b37('0x3a')]=_[_0x4b37('0x3b')](_0x598c60[_0x4b37('0x3a')]);_0x475a86[_0x4b37('0x3c')]=_[_0x4b37('0x3d')](_0x475a86['model'],_0x475a86[_0x4b37('0x3a')]);_0x393975[_0x4b37('0x3f')]=_['intersection'](_0x475a86[_0x4b37('0x3e')],qs['fields'](_0x598c60[_0x4b37('0x3a')][_0x4b37('0x40')]));_0x393975[_0x4b37('0x3f')]=_0x393975[_0x4b37('0x3f')][_0x4b37('0x41')]?_0x393975['attributes']:_0x475a86[_0x4b37('0x3e')];if(!_0x598c60[_0x4b37('0x3a')][_0x4b37('0x60')](_0x4b37('0x42'))){_0x393975[_0x4b37('0x23')]=qs[_0x4b37('0x23')](_0x598c60[_0x4b37('0x3a')][_0x4b37('0x23')]);_0x393975[_0x4b37('0x21')]=qs[_0x4b37('0x21')](_0x598c60[_0x4b37('0x3a')][_0x4b37('0x21')]);}_0x393975[_0x4b37('0x61')]=qs['sort'](_0x598c60[_0x4b37('0x3a')]['sort']);_0x393975[_0x4b37('0x46')]=qs[_0x4b37('0x3c')](_['pick'](_0x598c60[_0x4b37('0x3a')],_0x475a86['filters']));_0x393975[_0x4b37('0x76')]=!![];if(_0x598c60[_0x4b37('0x3a')][_0x4b37('0x45')]){_0x393975[_0x4b37('0x46')]=_['merge'](_0x393975[_0x4b37('0x46')],{'$or':_['map'](_0x393975[_0x4b37('0x3f')],function(_0x54e686){var _0x40612d={};_0x40612d[_0x54e686]={'$like':'%'+_0x598c60[_0x4b37('0x3a')][_0x4b37('0x45')]+'%'};return _0x40612d;})});}_0x393975=_[_0x4b37('0x47')]({},_0x393975,_0x598c60[_0x4b37('0x4f')]);return _0x2c327f[_0x4b37('0x70')](_0x393975);}})[_0x4b37('0x2a')](respondWithResult(_0x5dd8e9,null))[_0x4b37('0x4c')](handleError(_0x5dd8e9,null));};exports[_0x4b37('0x77')]=function(_0x25ee00,_0x3cf2a9,_0x3e5e97){var _0x256ae4;return db[_0x4b37('0x35')][_0x4b37('0x57')]({'where':{'id':_0x25ee00[_0x4b37('0x4e')]['id']},'include':[{'model':db['CmCustomField'],'as':_0x4b37('0x73')}]})[_0x4b37('0x2a')](handleEntityNotFound(_0x3cf2a9,null))[_0x4b37('0x2a')](function(_0x12f330){if(_0x12f330){_0x256ae4=_0x12f330;return db[_0x4b37('0x65')][_0x4b37('0x36')];}})[_0x4b37('0x2a')](function(_0x4b09b5){if(_0x4b09b5){var _0x306c67={};var _0xf30e61={};_0xf30e61[_0x4b37('0x3e')]=_[_0x4b37('0x72')](_[_0x4b37('0x3b')](_0x4b09b5),_[_0x4b37('0x34')](_0x256ae4[_0x4b37('0x73')],function(_0xabea4d){return util[_0x4b37('0x74')](_0x4b37('0x75'),_0xabea4d['id']);}));_0xf30e61[_0x4b37('0x3a')]=_['keys'](_0x25ee00['query']);_0xf30e61['filters']=_['intersection'](_0xf30e61[_0x4b37('0x3e')],_0xf30e61[_0x4b37('0x3a')]);_0x306c67[_0x4b37('0x3f')]=_['intersection'](_0xf30e61[_0x4b37('0x3e')],qs[_0x4b37('0x40')](_0x25ee00[_0x4b37('0x3a')]['fields']));_0x306c67[_0x4b37('0x3f')]=_0x306c67[_0x4b37('0x3f')][_0x4b37('0x41')]?_0x306c67[_0x4b37('0x3f')]:_0xf30e61[_0x4b37('0x3e')];if(!_0x25ee00[_0x4b37('0x3a')]['hasOwnProperty']('nolimit')){_0x306c67['limit']=qs[_0x4b37('0x23')](_0x25ee00[_0x4b37('0x3a')][_0x4b37('0x23')]);_0x306c67[_0x4b37('0x21')]=qs[_0x4b37('0x21')](_0x25ee00[_0x4b37('0x3a')][_0x4b37('0x21')]);}_0x306c67[_0x4b37('0x61')]=qs[_0x4b37('0x43')](_0x25ee00[_0x4b37('0x3a')][_0x4b37('0x43')]);_0x306c67[_0x4b37('0x46')]=qs[_0x4b37('0x3c')](_['pick'](_0x25ee00['query'],_0xf30e61['filters']));_0x306c67[_0x4b37('0x76')]=!![];if(_0x25ee00['query']['filter']){_0x306c67[_0x4b37('0x46')]=_[_0x4b37('0x47')](_0x306c67[_0x4b37('0x46')],{'$or':_[_0x4b37('0x34')](_0x306c67[_0x4b37('0x3f')],function(_0x3cb38c){var _0x48c180={};_0x48c180[_0x3cb38c]={'$like':'%'+_0x25ee00[_0x4b37('0x3a')]['filter']+'%'};return _0x48c180;})});}_0x306c67=_[_0x4b37('0x47')]({},_0x306c67,_0x25ee00[_0x4b37('0x4f')]);return _0x256ae4[_0x4b37('0x70')](_0x306c67);}})['then'](function(_0x447ec9){if(!_[_0x4b37('0x78')](_0x447ec9)){var _0x5e1fe1=toCsv(_0x447ec9);var _0x285799=Date[_0x4b37('0x79')]();fs[_0x4b37('0x7a')](util['format'](_0x4b37('0x7b'),_0x256ae4['id'],_0x285799),_0x5e1fe1);_0x3cf2a9[_0x4b37('0x7c')](_0x4b37('0x7d'),_0x4b37('0x7e')+util[_0x4b37('0x74')]('list_%d_%s.csv',_0x256ae4['id'],_0x285799));_0x3cf2a9['setHeader']('Content-type',_0x4b37('0x7f'));return _0x3cf2a9['download'](util[_0x4b37('0x74')](_0x4b37('0x7b'),_0x256ae4['id'],_0x285799));}else{return _0x3cf2a9['sendStatus'](0xcc);}})[_0x4b37('0x4c')](handleError(_0x3cf2a9,null));};exports[_0x4b37('0x80')]=function(_0x2b31e8,_0x2615de,_0x4cca8d){var _0x2f7852;delete _0x2b31e8[_0x4b37('0x51')]['id'];return db[_0x4b37('0x35')][_0x4b37('0x81')]({'where':{'id':_0x2b31e8[_0x4b37('0x4e')]['id']}})[_0x4b37('0x2a')](handleEntityNotFound(_0x2615de,null))[_0x4b37('0x2a')](function(_0x3f0a70){if(_0x3f0a70){return db[_0x4b37('0x82')][_0x4b37('0x83')](function(_0x550c45){return db['CmCustomField']['create'](_0x2b31e8[_0x4b37('0x51')],{'transaction':_0x550c45})[_0x4b37('0x2a')](function(_0x164681){_0x2f7852=_0x164681;return _0x3f0a70[_0x4b37('0x84')](_0x164681,{'transaction':_0x550c45});})[_0x4b37('0x2a')](function(){var _0x42926a={'type':db['Sequelize'][_0x4b37('0x85')],'transaction':_0x550c45};switch(_0x2b31e8[_0x4b37('0x51')][_0x4b37('0x38')]){case'text':_0x42926a[_0x4b37('0x38')]=db[_0x4b37('0x86')][_0x4b37('0x85')];break;case'number':_0x42926a[_0x4b37('0x38')]=db[_0x4b37('0x86')]['INTEGER'];break;case _0x4b37('0x87'):_0x42926a['type']=db[_0x4b37('0x86')][_0x4b37('0x88')];_0x42926a['defaultValue']=![];break;default:}return db[_0x4b37('0x82')][_0x4b37('0x89')]['addColumn'](_0x4b37('0x8a'),util['format'](_0x4b37('0x8b'),_0x2f7852['id']),_0x42926a);})[_0x4b37('0x2a')](function(){return _0x2f7852;});});}})[_0x4b37('0x2a')](respondWithResult(_0x2615de,null))['catch'](handleError(_0x2615de,null));};exports['getCustomFields']=function(_0x5ab7d7,_0x29c11d,_0x59f571){var _0x237aab={};var _0x3b745b={};var _0x5b72e3;var _0xdb257e;return db[_0x4b37('0x35')][_0x4b37('0x81')]({'where':{'id':_0x5ab7d7[_0x4b37('0x4e')]['id']}})[_0x4b37('0x2a')](handleEntityNotFound(_0x29c11d,null))[_0x4b37('0x2a')](function(_0x7ac787){if(_0x7ac787){_0x5b72e3=_0x7ac787;_0x3b745b[_0x4b37('0x3e')]=_['keys'](db['CmCustomField'][_0x4b37('0x36')]);_0x3b745b['query']=_[_0x4b37('0x3b')](_0x5ab7d7[_0x4b37('0x3a')]);_0x3b745b[_0x4b37('0x3c')]=_[_0x4b37('0x3d')](_0x3b745b['model'],_0x3b745b['query']);_0x237aab[_0x4b37('0x3f')]=_['intersection'](_0x3b745b[_0x4b37('0x3e')],qs[_0x4b37('0x40')](_0x5ab7d7[_0x4b37('0x3a')][_0x4b37('0x40')]));_0x237aab[_0x4b37('0x3f')]=_0x237aab['attributes'][_0x4b37('0x41')]?_0x237aab['attributes']:_0x3b745b[_0x4b37('0x3e')];_0x237aab['order']=qs['sort'](_0x5ab7d7['query']['sort']);_0x237aab['where']=qs[_0x4b37('0x3c')](_[_0x4b37('0x44')](_0x5ab7d7[_0x4b37('0x3a')],_0x3b745b[_0x4b37('0x3c')]));_0x237aab[_0x4b37('0x46')]=_['merge'](_0x237aab[_0x4b37('0x46')],{'$or':[{'ListId':_0x7ac787['id']},{'ListId':null}]});if(_0x5ab7d7[_0x4b37('0x3a')][_0x4b37('0x45')]){_0x237aab[_0x4b37('0x46')]=_[_0x4b37('0x47')](_0x237aab[_0x4b37('0x46')],{'$or':_[_0x4b37('0x34')](_0x237aab[_0x4b37('0x3f')],function(_0x581e84){var _0x1ae4ca={};_0x1ae4ca[_0x581e84]={'$like':'%'+_0x5ab7d7['query'][_0x4b37('0x45')]+'%'};return _0x1ae4ca;})});}_0x237aab=_['merge']({},_0x237aab,_0x5ab7d7['options']);return db['CmCustomField'][_0x4b37('0x8c')](_0x237aab);}})['then'](respondWithResult(_0x29c11d,null))[_0x4b37('0x4c')](handleError(_0x29c11d,null));};exports['addAgents']=function(_0x5dd72d,_0xd5b936,_0x596408){return db['CmList'][_0x4b37('0x57')]({'where':{'id':_0x5dd72d[_0x4b37('0x4e')]['id']}})[_0x4b37('0x2a')](handleEntityNotFound(_0xd5b936,null))[_0x4b37('0x2a')](function(_0xfb4d7c){if(_0xfb4d7c){return _0xfb4d7c[_0x4b37('0x8d')](_0x5dd72d[_0x4b37('0x51')]['ids'],_[_0x4b37('0x6c')](_0x5dd72d[_0x4b37('0x51')],['ids','id'])||{})['spread'](function(_0x1aef6c){for(var _0x5e72ee=0x0;_0x5e72ee<_0x5dd72d[_0x4b37('0x51')]['ids']['length'];_0x5e72ee+=0x1){socket[_0x4b37('0x8e')](_0x4b37('0x8f'),{'UserId':Number(_0x5dd72d['body'][_0x4b37('0x63')][_0x5e72ee]),'CmListId':Number(_0x5dd72d[_0x4b37('0x4e')]['id'])});}return _0x1aef6c;});}})[_0x4b37('0x2a')](respondWithResult(_0xd5b936,null))['catch'](handleError(_0xd5b936,null));};exports[_0x4b37('0x90')]=function(_0x434ff7,_0x2efb6f,_0x26ee9d){return db['CmList'][_0x4b37('0x57')]({'where':{'id':_0x434ff7[_0x4b37('0x4e')]['id']}})['then'](handleEntityNotFound(_0x2efb6f,null))[_0x4b37('0x2a')](function(_0x1e03b2){if(_0x1e03b2){return _0x1e03b2[_0x4b37('0x90')](_0x434ff7['query'][_0x4b37('0x63')])[_0x4b37('0x2a')](function(){if(_['isArray'](_0x434ff7[_0x4b37('0x3a')][_0x4b37('0x63')])){for(var _0x3b3713=0x0;_0x3b3713<_0x434ff7[_0x4b37('0x3a')]['ids']['length'];_0x3b3713+=0x1){socket['emit'](_0x4b37('0x91'),{'UserId':Number(_0x434ff7[_0x4b37('0x3a')][_0x4b37('0x63')][_0x3b3713]),'CmListId':Number(_0x434ff7[_0x4b37('0x4e')]['id'])});}}else{socket[_0x4b37('0x8e')](_0x4b37('0x91'),{'UserId':Number(_0x434ff7[_0x4b37('0x3a')][_0x4b37('0x63')]),'CmListId':Number(_0x434ff7[_0x4b37('0x4e')]['id'])});}});}})[_0x4b37('0x2a')](respondWithStatusCode(_0x2efb6f,null))[_0x4b37('0x4c')](handleError(_0x2efb6f,null));};exports['getAgents']=function(_0x58d737,_0x149e04,_0x3aafe3){var _0x449710={};var _0x50ffd0={};var _0x187832;var _0x536383;return db[_0x4b37('0x35')][_0x4b37('0x81')]({'where':{'id':_0x58d737['params']['id']}})[_0x4b37('0x2a')](handleEntityNotFound(_0x149e04,null))[_0x4b37('0x2a')](function(_0x31b12f){if(_0x31b12f){_0x187832=_0x31b12f;_0x50ffd0[_0x4b37('0x3e')]=_[_0x4b37('0x3b')](db[_0x4b37('0x92')][_0x4b37('0x36')]);_0x50ffd0[_0x4b37('0x3a')]=_[_0x4b37('0x3b')](_0x58d737[_0x4b37('0x3a')]);_0x50ffd0[_0x4b37('0x3c')]=_[_0x4b37('0x3d')](_0x50ffd0[_0x4b37('0x3e')],_0x50ffd0['query']);_0x449710[_0x4b37('0x3f')]=_[_0x4b37('0x3d')](_0x50ffd0[_0x4b37('0x3e')],qs[_0x4b37('0x40')](_0x58d737[_0x4b37('0x3a')][_0x4b37('0x40')]));_0x449710[_0x4b37('0x3f')]=_0x449710[_0x4b37('0x3f')][_0x4b37('0x41')]?_0x449710[_0x4b37('0x3f')]:_0x50ffd0[_0x4b37('0x3e')];_0x449710[_0x4b37('0x61')]=qs[_0x4b37('0x43')](_0x58d737[_0x4b37('0x3a')][_0x4b37('0x43')]);_0x449710['where']=qs[_0x4b37('0x3c')](_[_0x4b37('0x44')](_0x58d737[_0x4b37('0x3a')],_0x50ffd0[_0x4b37('0x3c')]));if(_0x58d737[_0x4b37('0x3a')]['filter']){_0x449710['where']=_[_0x4b37('0x47')](_0x449710[_0x4b37('0x46')],{'$or':_[_0x4b37('0x34')](_0x449710['attributes'],function(_0x3e10bb){var _0x38228f={};_0x38228f[_0x3e10bb]={'$like':'%'+_0x58d737[_0x4b37('0x3a')][_0x4b37('0x45')]+'%'};return _0x38228f;})});}_0x449710=_[_0x4b37('0x47')]({},_0x449710,_0x58d737[_0x4b37('0x4f')]);return _0x187832[_0x4b37('0x93')](_0x449710);}})[_0x4b37('0x2a')](function(_0x1b319a){if(_0x1b319a){_0x536383=_0x1b319a[_0x4b37('0x41')];if(!_0x58d737[_0x4b37('0x3a')][_0x4b37('0x60')]('nolimit')){_0x449710[_0x4b37('0x23')]=qs[_0x4b37('0x23')](_0x58d737[_0x4b37('0x3a')][_0x4b37('0x23')]);_0x449710[_0x4b37('0x21')]=qs[_0x4b37('0x21')](_0x58d737['query'][_0x4b37('0x21')]);}return _0x187832['getAgents'](_0x449710);}})[_0x4b37('0x2a')](function(_0x118b2f){if(_0x118b2f){return _0x118b2f?{'count':_0x536383,'rows':_0x118b2f}:null;}})[_0x4b37('0x2a')](respondWithResult(_0x149e04,null))[_0x4b37('0x4c')](handleError(_0x149e04,null));}; \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index 307f4da..716178d 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 _0x814b=['update','emit','hook','exports','events','../../mysqldb','CmList','setMaxListeners','save'];(function(_0x2c96f6,_0x877207){var _0x6d4808=function(_0x567e0c){while(--_0x567e0c){_0x2c96f6['push'](_0x2c96f6['shift']());}};_0x6d4808(++_0x877207);}(_0x814b,0x1a2));var _0xb814=function(_0x1b8e60,_0x21b885){_0x1b8e60=_0x1b8e60-0x0;var _0x363363=_0x814b[_0x1b8e60];return _0x363363;};'use strict';var EventEmitter=require(_0xb814('0x0'));var CmList=require(_0xb814('0x1'))['db'][_0xb814('0x2')];var CmListEvents=new EventEmitter();CmListEvents[_0xb814('0x3')](0x0);var events={'afterCreate':_0xb814('0x4'),'afterUpdate':_0xb814('0x5'),'afterDestroy':'remove'};function emitEvent(_0x38c21a){return function(_0x3e1e9,_0x258866,_0x4237bc){CmListEvents[_0xb814('0x6')](_0x38c21a+':'+_0x3e1e9['id'],_0x3e1e9);CmListEvents[_0xb814('0x6')](_0x38c21a,_0x3e1e9);_0x4237bc(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];CmList[_0xb814('0x7')](e,emitEvent(event));}}module[_0xb814('0x8')]=CmListEvents; \ No newline at end of file +var _0x7217=['emit','hasOwnProperty','hook','exports','events','CmList','setMaxListeners','save','update','remove'];(function(_0x4529b3,_0x390ebb){var _0x21e907=function(_0x1c19dc){while(--_0x1c19dc){_0x4529b3['push'](_0x4529b3['shift']());}};_0x21e907(++_0x390ebb);}(_0x7217,0x19e));var _0x7721=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0x7217[_0x4fc9e6];return _0x551d28;};'use strict';var EventEmitter=require(_0x7721('0x0'));var CmList=require('../../mysqldb')['db'][_0x7721('0x1')];var CmListEvents=new EventEmitter();CmListEvents[_0x7721('0x2')](0x0);var events={'afterCreate':_0x7721('0x3'),'afterUpdate':_0x7721('0x4'),'afterDestroy':_0x7721('0x5')};function emitEvent(_0x4d6446){return function(_0x5bf160,_0x472a96,_0xce17f9){CmListEvents[_0x7721('0x6')](_0x4d6446+':'+_0x5bf160['id'],_0x5bf160);CmListEvents[_0x7721('0x6')](_0x4d6446,_0x5bf160);_0xce17f9(null);};}for(var e in events){if(events[_0x7721('0x7')](e)){var event=events[e];CmList[_0x7721('0x8')](e,emitEvent(event));}}module[_0x7721('0x9')]=CmListEvents; \ No newline at end of file diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index 308aa86..045af91 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 _0xaa88=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./cmList.attributes','CmList','cm_lists','lodash'];(function(_0x361ea5,_0x34c89a){var _0x1a6d9b=function(_0x56f417){while(--_0x56f417){_0x361ea5['push'](_0x361ea5['shift']());}};_0x1a6d9b(++_0x34c89a);}(_0xaa88,0x137));var _0x8aa8=function(_0x307086,_0x3bfe4e){_0x307086=_0x307086-0x0;var _0x699043=_0xaa88[_0x307086];return _0x699043;};'use strict';var _=require(_0x8aa8('0x0'));var util=require(_0x8aa8('0x1'));var logger=require(_0x8aa8('0x2'))(_0x8aa8('0x3'));var moment=require('moment');var BPromise=require(_0x8aa8('0x4'));var rp=require(_0x8aa8('0x5'));var fs=require('fs');var path=require(_0x8aa8('0x6'));var rimraf=require(_0x8aa8('0x7'));var config=require(_0x8aa8('0x8'));var attributes=require(_0x8aa8('0x9'));module['exports']=function(_0x5bda0d,_0x460042){return _0x5bda0d['define'](_0x8aa8('0xa'),attributes,{'tableName':_0x8aa8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0713=['moment','bluebird','request-promise','rimraf','../../config/environment','./cmList.attributes','exports','define','CmList','cm_lists','../../config/logger','api'];(function(_0x4344a4,_0x4cb1bc){var _0x31d528=function(_0x45846e){while(--_0x45846e){_0x4344a4['push'](_0x4344a4['shift']());}};_0x31d528(++_0x4cb1bc);}(_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':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmList/cmList.rpc.js b/server/api/cmList/cmList.rpc.js index cb0677d..fe50185 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 _0xdedf=['code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','defaults','localhost','socket.io-emitter','redis','./cmList.socket','register','request','then','CmList,\x20%s,\x20%s','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','error'];(function(_0x396fcd,_0x2d0edf){var _0x4905b1=function(_0x452604){while(--_0x452604){_0x396fcd['push'](_0x396fcd['shift']());}};_0x4905b1(++_0x2d0edf);}(_0xdedf,0x1b7));var _0xfded=function(_0x40a12a,_0x3340ef){_0x40a12a=_0x40a12a-0x0;var _0x41ed92=_0xdedf[_0x40a12a];return _0x41ed92;};'use strict';var _=require(_0xfded('0x0'));var util=require(_0xfded('0x1'));var moment=require(_0xfded('0x2'));var BPromise=require(_0xfded('0x3'));var rs=require(_0xfded('0x4'));var fs=require('fs');var Redis=require(_0xfded('0x5'));var db=require(_0xfded('0x6'))['db'];var utils=require(_0xfded('0x7'));var logger=require(_0xfded('0x8'))(_0xfded('0x9'));var config=require('../../config/environment');var jayson=require(_0xfded('0xa'));var client=jayson['client'][_0xfded('0xb')]({'port':0x232a});config['redis']=_[_0xfded('0xc')](config['redis'],{'host':_0xfded('0xd'),'port':0x18eb});var socket=require(_0xfded('0xe'))(new Redis(config[_0xfded('0xf')]));require(_0xfded('0x10'))[_0xfded('0x11')](socket);function respondWithRpcPromise(_0x5400d7,_0xe0217,_0x2b076b){return new BPromise(function(_0x2c6dd4,_0x20835a){return client[_0xfded('0x12')](_0x5400d7,_0x2b076b)[_0xfded('0x13')](function(_0x5200c2){logger['info'](_0xfded('0x14'),_0xe0217,_0xfded('0x15'));logger[_0xfded('0x16')](_0xfded('0x17'),_0xe0217,_0xfded('0x15'),JSON['stringify'](_0x5200c2));if(_0x5200c2[_0xfded('0x18')]){if(_0x5200c2[_0xfded('0x18')][_0xfded('0x19')]===0x1f4){logger['error']('CmList,\x20%s,\x20%s',_0xe0217,_0x5200c2[_0xfded('0x18')][_0xfded('0x1a')]);return _0x20835a(_0x5200c2[_0xfded('0x18')]['message']);}logger[_0xfded('0x18')]('CmList,\x20%s,\x20%s',_0xe0217,_0x5200c2[_0xfded('0x18')][_0xfded('0x1a')]);return _0x2c6dd4(_0x5200c2['error']['message']);}else{logger['info'](_0xfded('0x14'),_0xe0217,_0xfded('0x15'));_0x2c6dd4(_0x5200c2[_0xfded('0x1b')][_0xfded('0x1a')]);}})[_0xfded('0x1c')](function(_0x1ca6d3){logger['error'](_0xfded('0x14'),_0xe0217,_0x1ca6d3);_0x20835a(_0x1ca6d3);});});} \ No newline at end of file +var _0xb0a9=['redis','defaults','localhost','./cmList.socket','register','request','info','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','stringify','error','code','CmList,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http'];(function(_0x3b4f21,_0x5a491c){var _0x4437ef=function(_0x1bf141){while(--_0x1bf141){_0x3b4f21['push'](_0x3b4f21['shift']());}};_0x4437ef(++_0x5a491c);}(_0xb0a9,0x68));var _0x9b0a=function(_0x52666e,_0x5b3776){_0x52666e=_0x52666e-0x0;var _0x515330=_0xb0a9[_0x52666e];return _0x515330;};'use strict';var _=require(_0x9b0a('0x0'));var util=require(_0x9b0a('0x1'));var moment=require(_0x9b0a('0x2'));var BPromise=require(_0x9b0a('0x3'));var rs=require(_0x9b0a('0x4'));var fs=require('fs');var Redis=require(_0x9b0a('0x5'));var db=require(_0x9b0a('0x6'))['db'];var utils=require(_0x9b0a('0x7'));var logger=require(_0x9b0a('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x9b0a('0x9'));var client=jayson[_0x9b0a('0xa')][_0x9b0a('0xb')]({'port':0x232a});config[_0x9b0a('0xc')]=_[_0x9b0a('0xd')](config['redis'],{'host':_0x9b0a('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x9b0a('0xf'))[_0x9b0a('0x10')](socket);function respondWithRpcPromise(_0x575bec,_0x5f08a5,_0x1aa364){return new BPromise(function(_0x87a78f,_0x84d0d8){return client[_0x9b0a('0x11')](_0x575bec,_0x1aa364)['then'](function(_0x32e17a){logger[_0x9b0a('0x12')]('CmList,\x20%s,\x20%s',_0x5f08a5,_0x9b0a('0x13'));logger[_0x9b0a('0x14')](_0x9b0a('0x15'),_0x5f08a5,'request\x20sent',JSON[_0x9b0a('0x16')](_0x32e17a));if(_0x32e17a[_0x9b0a('0x17')]){if(_0x32e17a[_0x9b0a('0x17')][_0x9b0a('0x18')]===0x1f4){logger['error'](_0x9b0a('0x19'),_0x5f08a5,_0x32e17a[_0x9b0a('0x17')][_0x9b0a('0x1a')]);return _0x84d0d8(_0x32e17a[_0x9b0a('0x17')][_0x9b0a('0x1a')]);}logger[_0x9b0a('0x17')]('CmList,\x20%s,\x20%s',_0x5f08a5,_0x32e17a[_0x9b0a('0x17')][_0x9b0a('0x1a')]);return _0x87a78f(_0x32e17a['error'][_0x9b0a('0x1a')]);}else{logger[_0x9b0a('0x12')](_0x9b0a('0x19'),_0x5f08a5,_0x9b0a('0x13'));_0x87a78f(_0x32e17a[_0x9b0a('0x1b')][_0x9b0a('0x1a')]);}})[_0x9b0a('0x1c')](function(_0xb60fdb){logger[_0x9b0a('0x17')](_0x9b0a('0x19'),_0x5f08a5,_0xb60fdb);_0x84d0d8(_0xb60fdb);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index d80402f..a111a72 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 _0x94c1=['remove','update','emit','register','length','cmList:','./cmList.events','save'];(function(_0x17b751,_0x28856e){var _0x91c642=function(_0x1ed460){while(--_0x1ed460){_0x17b751['push'](_0x17b751['shift']());}};_0x91c642(++_0x28856e);}(_0x94c1,0x6e));var _0x194c=function(_0x8a61cd,_0x233652){_0x8a61cd=_0x8a61cd-0x0;var _0x1816b6=_0x94c1[_0x8a61cd];return _0x1816b6;};'use strict';var CmListEvents=require(_0x194c('0x0'));var events=[_0x194c('0x1'),_0x194c('0x2'),_0x194c('0x3')];function createListener(_0x458dc4,_0x32963d){return function(_0x9a608d){_0x32963d[_0x194c('0x4')](_0x458dc4,_0x9a608d);};}function removeListener(_0x2f0262,_0x29b71c){return function(){CmListEvents['removeListener'](_0x2f0262,_0x29b71c);};}exports[_0x194c('0x5')]=function(_0x4dc971){for(var _0x48bcaf=0x0,_0x4b7efa=events[_0x194c('0x6')];_0x48bcaf<_0x4b7efa;_0x48bcaf++){var _0x3d3e35=events[_0x48bcaf];var _0x1d26e7=createListener(_0x194c('0x7')+_0x3d3e35,_0x4dc971);CmListEvents['on'](_0x3d3e35,_0x1d26e7);}}; \ No newline at end of file +var _0x9cce=['save','update','removeListener','register','cmList:','./cmList.events'];(function(_0x216ed5,_0x44357d){var _0x3ffbc8=function(_0x47d872){while(--_0x47d872){_0x216ed5['push'](_0x216ed5['shift']());}};_0x3ffbc8(++_0x44357d);}(_0x9cce,0x143));var _0xe9cc=function(_0x17f1ea,_0x5a815f){_0x17f1ea=_0x17f1ea-0x0;var _0x494db7=_0x9cce[_0x17f1ea];return _0x494db7;};'use strict';var CmListEvents=require(_0xe9cc('0x0'));var events=[_0xe9cc('0x1'),'remove',_0xe9cc('0x2')];function createListener(_0x488166,_0x309bd1){return function(_0x3a3633){_0x309bd1['emit'](_0x488166,_0x3a3633);};}function removeListener(_0x45f940,_0x2f1970){return function(){CmListEvents[_0xe9cc('0x3')](_0x45f940,_0x2f1970);};}exports[_0xe9cc('0x4')]=function(_0x417a78){for(var _0x2186d6=0x0,_0x162cdf=events['length'];_0x2186d6<_0x162cdf;_0x2186d6++){var _0x5c04b4=events[_0x2186d6];var _0x57ec08=createListener(_0xe9cc('0x5')+_0x5c04b4,_0x417a78);CmListEvents['on'](_0x5c04b4,_0x57ec08);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index dc7b37e..5f1b6ce 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 _0xcb67=['util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmList.controller','isAuthenticated','index','get','/describe','describe','/:id','show','getDispositions','/:id/contacts','getContacts','getContactsCsv','getCustomFields','/:id/users','post','create','/:id/dispositions','addDisposition','addContacts','/:id/fields','addCustomField','addAgents','update','delete','destroy','removeDispositions','removeAgents','exports','multer'];(function(_0x1ef7a2,_0x44e828){var _0x80cf67=function(_0xec03df){while(--_0xec03df){_0x1ef7a2['push'](_0x1ef7a2['shift']());}};_0x80cf67(++_0x44e828);}(_0xcb67,0x93));var _0x7cb6=function(_0x2459fd,_0x575d9b){_0x2459fd=_0x2459fd-0x0;var _0x364cd2=_0xcb67[_0x2459fd];return _0x364cd2;};'use strict';var multer=require(_0x7cb6('0x0'));var util=require(_0x7cb6('0x1'));var path=require(_0x7cb6('0x2'));var timeout=require(_0x7cb6('0x3'));var express=require('express');var router=express[_0x7cb6('0x4')]();var fs_extra=require(_0x7cb6('0x5'));var auth=require(_0x7cb6('0x6'));var interaction=require(_0x7cb6('0x7'));var config=require(_0x7cb6('0x8'));var controller=require(_0x7cb6('0x9'));router['get']('/',auth[_0x7cb6('0xa')](),controller[_0x7cb6('0xb')]);router[_0x7cb6('0xc')](_0x7cb6('0xd'),auth[_0x7cb6('0xa')](),controller[_0x7cb6('0xe')]);router[_0x7cb6('0xc')](_0x7cb6('0xf'),auth[_0x7cb6('0xa')](),controller[_0x7cb6('0x10')]);router[_0x7cb6('0xc')]('/:id/dispositions',auth[_0x7cb6('0xa')](),controller[_0x7cb6('0x11')]);router[_0x7cb6('0xc')](_0x7cb6('0x12'),auth[_0x7cb6('0xa')](),controller[_0x7cb6('0x13')]);router[_0x7cb6('0xc')]('/:id/contacts/csv',auth[_0x7cb6('0xa')](),controller[_0x7cb6('0x14')]);router[_0x7cb6('0xc')]('/:id/fields',auth[_0x7cb6('0xa')](),controller[_0x7cb6('0x15')]);router[_0x7cb6('0xc')](_0x7cb6('0x16'),auth[_0x7cb6('0xa')](),controller['getAgents']);router[_0x7cb6('0x17')]('/',auth[_0x7cb6('0xa')](),controller[_0x7cb6('0x18')]);router[_0x7cb6('0x17')](_0x7cb6('0x19'),auth[_0x7cb6('0xa')](),controller[_0x7cb6('0x1a')]);router[_0x7cb6('0x17')]('/:id/contacts',auth[_0x7cb6('0xa')](),controller[_0x7cb6('0x1b')]);router[_0x7cb6('0x17')](_0x7cb6('0x1c'),auth[_0x7cb6('0xa')](),controller[_0x7cb6('0x1d')]);router['post'](_0x7cb6('0x16'),auth[_0x7cb6('0xa')](),controller[_0x7cb6('0x1e')]);router['put'](_0x7cb6('0xf'),auth['isAuthenticated'](),controller[_0x7cb6('0x1f')]);router[_0x7cb6('0x20')]('/:id',auth[_0x7cb6('0xa')](),controller[_0x7cb6('0x21')]);router[_0x7cb6('0x20')](_0x7cb6('0x19'),auth[_0x7cb6('0xa')](),controller[_0x7cb6('0x22')]);router['delete'](_0x7cb6('0x16'),auth['isAuthenticated'](),controller[_0x7cb6('0x23')]);module[_0x7cb6('0x24')]=router; \ No newline at end of file +var _0x1749=['getContactsCsv','/:id/fields','getCustomFields','/:id/users','getAgents','post','create','addDisposition','addContacts','addCustomField','addAgents','put','update','delete','/:id','destroy','removeDispositions','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmList.controller','isAuthenticated','index','/describe','show','/:id/dispositions','getDispositions','get','/:id/contacts','getContacts'];(function(_0x41f8a6,_0x3eaabf){var _0x204589=function(_0x510905){while(--_0x510905){_0x41f8a6['push'](_0x41f8a6['shift']());}};_0x204589(++_0x3eaabf);}(_0x1749,0x1e6));var _0x9174=function(_0x32dbb4,_0x48d11c){_0x32dbb4=_0x32dbb4-0x0;var _0x33d557=_0x1749[_0x32dbb4];return _0x33d557;};'use strict';var multer=require(_0x9174('0x0'));var util=require(_0x9174('0x1'));var path=require(_0x9174('0x2'));var timeout=require(_0x9174('0x3'));var express=require(_0x9174('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x9174('0x5'));var interaction=require(_0x9174('0x6'));var config=require(_0x9174('0x7'));var controller=require(_0x9174('0x8'));router['get']('/',auth[_0x9174('0x9')](),controller[_0x9174('0xa')]);router['get'](_0x9174('0xb'),auth[_0x9174('0x9')](),controller['describe']);router['get']('/:id',auth[_0x9174('0x9')](),controller[_0x9174('0xc')]);router['get'](_0x9174('0xd'),auth[_0x9174('0x9')](),controller[_0x9174('0xe')]);router[_0x9174('0xf')](_0x9174('0x10'),auth[_0x9174('0x9')](),controller[_0x9174('0x11')]);router[_0x9174('0xf')]('/:id/contacts/csv',auth[_0x9174('0x9')](),controller[_0x9174('0x12')]);router[_0x9174('0xf')](_0x9174('0x13'),auth[_0x9174('0x9')](),controller[_0x9174('0x14')]);router[_0x9174('0xf')](_0x9174('0x15'),auth[_0x9174('0x9')](),controller[_0x9174('0x16')]);router[_0x9174('0x17')]('/',auth['isAuthenticated'](),controller[_0x9174('0x18')]);router[_0x9174('0x17')](_0x9174('0xd'),auth[_0x9174('0x9')](),controller[_0x9174('0x19')]);router[_0x9174('0x17')]('/:id/contacts',auth[_0x9174('0x9')](),controller[_0x9174('0x1a')]);router[_0x9174('0x17')]('/:id/fields',auth[_0x9174('0x9')](),controller[_0x9174('0x1b')]);router[_0x9174('0x17')]('/:id/users',auth['isAuthenticated'](),controller[_0x9174('0x1c')]);router[_0x9174('0x1d')]('/:id',auth[_0x9174('0x9')](),controller[_0x9174('0x1e')]);router[_0x9174('0x1f')](_0x9174('0x20'),auth['isAuthenticated'](),controller[_0x9174('0x21')]);router['delete'](_0x9174('0xd'),auth[_0x9174('0x9')](),controller[_0x9174('0x22')]);router[_0x9174('0x1f')](_0x9174('0x15'),auth[_0x9174('0x9')](),controller['removeAgents']);module[_0x9174('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 4b0f859..1cfb476 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 _0xc757=['STRING','exports','VIRTUAL','getDataValue','field'];(function(_0x58df6c,_0x2c8f1c){var _0x1e3790=function(_0x47f471){while(--_0x47f471){_0x58df6c['push'](_0x58df6c['shift']());}};_0x1e3790(++_0x2c8f1c);}(_0xc757,0x10f));var _0x7c75=function(_0x264664,_0x335c30){_0x264664=_0x264664-0x0;var _0x3fb5ca=_0xc757[_0x264664];return _0x3fb5ca;};'use strict';var Sequelize=require('sequelize');module[_0x7c75('0x0')]={'name':{'type':Sequelize[_0x7c75('0x1')],'get':function(_0x2dd3cb){return this[_0x7c75('0x2')](_0x7c75('0x3'));}},'field':{'type':Sequelize[_0x7c75('0x4')],'allowNull':![]},'operator':{'type':Sequelize[_0x7c75('0x4')],'allowNull':![]},'value':{'type':Sequelize[_0x7c75('0x4')],'allowNull':![]}}; \ No newline at end of file +var _0xdf11=['sequelize','exports','VIRTUAL','getDataValue','STRING'];(function(_0x5b2f23,_0x20c02a){var _0x19800d=function(_0x5bcd06){while(--_0x5bcd06){_0x5b2f23['push'](_0x5b2f23['shift']());}};_0x19800d(++_0x20c02a);}(_0xdf11,0x154));var _0x1df1=function(_0xaacd09,_0x2232f2){_0xaacd09=_0xaacd09-0x0;var _0x3c4eca=_0xdf11[_0xaacd09];return _0x3c4eca;};'use strict';var Sequelize=require(_0x1df1('0x0'));module[_0x1df1('0x1')]={'name':{'type':Sequelize[_0x1df1('0x2')],'get':function(_0x505c33){return this[_0x1df1('0x3')]('field');}},'field':{'type':Sequelize['STRING'],'allowNull':![]},'operator':{'type':Sequelize[_0x1df1('0x4')],'allowNull':![]},'value':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index b785b1f..22bd4f4 100644 --- a/server/api/condition/condition.controller.js +++ b/server/api/condition/condition.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','body','Condition','find','catch','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path'];(function(_0x14d6ea,_0x770f63){var _0x538820=function(_0x1cef55){while(--_0x1cef55){_0x14d6ea['push'](_0x14d6ea['shift']());}};_0x538820(++_0x770f63);}(_0x7a54,0x106));var _0x47a5=function(_0x304fe6,_0xaf6c00){_0x304fe6=_0x304fe6-0x0;var _0x483766=_0x7a54[_0x304fe6];return _0x483766;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x22')]=function(_0x136b14,_0x16631f){if(_0x136b14[_0x47a5('0x29')]['id']){delete _0x136b14[_0x47a5('0x29')]['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x136b14['params']['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x16631f,null))['then'](saveUpdates(_0x136b14[_0x47a5('0x29')],null))[_0x47a5('0x23')](respondWithResult(_0x16631f,null))[_0x47a5('0x2c')](handleError(_0x16631f,null));};exports['destroy']=function(_0x256650,_0x625952){return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x256650['params']['id']}})['then'](handleEntityNotFound(_0x625952,null))[_0x47a5('0x23')](removeEntity(_0x625952,null))[_0x47a5('0x2c')](handleError(_0x625952,null));}; \ No newline at end of file +var _0x7a54=['sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','body','Condition','find','catch','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path'];(function(_0x34dde4,_0xf98e2f){var _0x99c4db=function(_0x362805){while(--_0x362805){_0x34dde4['push'](_0x34dde4['shift']());}};_0x99c4db(++_0xf98e2f);}(_0x7a54,0x106));var _0x47a5=function(_0x39da0f,_0x46d22e){_0x39da0f=_0x39da0f-0x0;var _0x129d7f=_0x7a54[_0x39da0f];return _0x129d7f;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x22')]=function(_0x136b14,_0x16631f){if(_0x136b14[_0x47a5('0x29')]['id']){delete _0x136b14[_0x47a5('0x29')]['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x136b14['params']['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x16631f,null))['then'](saveUpdates(_0x136b14[_0x47a5('0x29')],null))[_0x47a5('0x23')](respondWithResult(_0x16631f,null))[_0x47a5('0x2c')](handleError(_0x16631f,null));};exports['destroy']=function(_0x256650,_0x625952){return db[_0x47a5('0x2a')][_0x47a5('0x2b')]({'where':{'id':_0x256650['params']['id']}})['then'](handleEntityNotFound(_0x625952,null))[_0x47a5('0x23')](removeEntity(_0x625952,null))[_0x47a5('0x2c')](handleError(_0x625952,null));}; \ No newline at end of file diff --git a/server/api/condition/condition.model.js b/server/api/condition/condition.model.js index 91dfc56..ae84e5f 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 _0xa36e=['define','tools_conditions','lodash','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./condition.attributes','exports'];(function(_0x305832,_0x11b3e0){var _0x127bbd=function(_0x2139f0){while(--_0x2139f0){_0x305832['push'](_0x305832['shift']());}};_0x127bbd(++_0x11b3e0);}(_0xa36e,0x1f1));var _0xea36=function(_0x356a00,_0x5e00c9){_0x356a00=_0x356a00-0x0;var _0x18946f=_0xa36e[_0x356a00];return _0x18946f;};'use strict';var _=require(_0xea36('0x0'));var util=require('util');var logger=require(_0xea36('0x1'))(_0xea36('0x2'));var moment=require(_0xea36('0x3'));var BPromise=require('bluebird');var rp=require(_0xea36('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xea36('0x5'));var config=require(_0xea36('0x6'));var attributes=require(_0xea36('0x7'));module[_0xea36('0x8')]=function(_0x11be7e,_0x203392){return _0x11be7e[_0xea36('0x9')]('Condition',attributes,{'tableName':_0xea36('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0fe5=['path','rimraf','./condition.attributes','exports','define','Condition','lodash','util','api','moment','request-promise'];(function(_0x24e72f,_0x318724){var _0x3f4c5d=function(_0xa1ee6a){while(--_0xa1ee6a){_0x24e72f['push'](_0x24e72f['shift']());}};_0x3f4c5d(++_0x318724);}(_0x0fe5,0x150));var _0x50fe=function(_0x2e5915,_0x1425a7){_0x2e5915=_0x2e5915-0x0;var _0x4a897a=_0x0fe5[_0x2e5915];return _0x4a897a;};'use strict';var _=require(_0x50fe('0x0'));var util=require(_0x50fe('0x1'));var logger=require('../../config/logger')(_0x50fe('0x2'));var moment=require(_0x50fe('0x3'));var BPromise=require('bluebird');var rp=require(_0x50fe('0x4'));var fs=require('fs');var path=require(_0x50fe('0x5'));var rimraf=require(_0x50fe('0x6'));var config=require('../../config/environment');var attributes=require(_0x50fe('0x7'));module[_0x50fe('0x8')]=function(_0x6c4d56,_0x1cc8fb){return _0x6c4d56[_0x50fe('0x9')](_0x50fe('0xa'),attributes,{'tableName':'tools_conditions','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 f26b3cc..9d89f93 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 _0x4e02=['Condition,\x20%s,\x20%s','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info'];(function(_0x34e752,_0x32e2a2){var _0x7c6347=function(_0x4db671){while(--_0x4db671){_0x34e752['push'](_0x34e752['shift']());}};_0x7c6347(++_0x32e2a2);}(_0x4e02,0x1ee));var _0x24e0=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0x4e02[_0x32d457];return _0x338386;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x24e0('0x0'));var BPromise=require('bluebird');var rs=require(_0x24e0('0x1'));var fs=require('fs');var Redis=require(_0x24e0('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x24e0('0x3'));var logger=require(_0x24e0('0x4'))(_0x24e0('0x5'));var config=require(_0x24e0('0x6'));var jayson=require(_0x24e0('0x7'));var client=jayson[_0x24e0('0x8')][_0x24e0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x450f12,_0x2de4cc,_0x1d0467){return new BPromise(function(_0x46a0af,_0x168943){return client['request'](_0x450f12,_0x1d0467)[_0x24e0('0xa')](function(_0x4db258){logger[_0x24e0('0xb')](_0x24e0('0xc'),_0x2de4cc,_0x24e0('0xd'));logger[_0x24e0('0xe')](_0x24e0('0xf'),_0x2de4cc,'request\x20sent',JSON[_0x24e0('0x10')](_0x4db258));if(_0x4db258[_0x24e0('0x11')]){if(_0x4db258[_0x24e0('0x11')][_0x24e0('0x12')]===0x1f4){logger[_0x24e0('0x11')]('Condition,\x20%s,\x20%s',_0x2de4cc,_0x4db258[_0x24e0('0x11')]['message']);return _0x168943(_0x4db258[_0x24e0('0x11')][_0x24e0('0x13')]);}logger['error']('Condition,\x20%s,\x20%s',_0x2de4cc,_0x4db258[_0x24e0('0x11')][_0x24e0('0x13')]);return _0x46a0af(_0x4db258[_0x24e0('0x11')][_0x24e0('0x13')]);}else{logger[_0x24e0('0xb')]('Condition,\x20%s,\x20%s',_0x2de4cc,_0x24e0('0xd'));_0x46a0af(_0x4db258[_0x24e0('0x14')][_0x24e0('0x13')]);}})[_0x24e0('0x15')](function(_0x285fc4){logger[_0x24e0('0x11')]('Condition,\x20%s,\x20%s',_0x2de4cc,_0x285fc4);_0x168943(_0x285fc4);});});} \ No newline at end of file +var _0x5de0=['moment','ioredis','../../mysqldb','../../config/logger','../../config/environment','client','http','request','info','Condition,\x20%s,\x20%s','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util'];(function(_0x19b41f,_0xc37bec){var _0x429006=function(_0x3f86fe){while(--_0x3f86fe){_0x19b41f['push'](_0x19b41f['shift']());}};_0x429006(++_0xc37bec);}(_0x5de0,0x12e));var _0x05de=function(_0x264134,_0x5d6478){_0x264134=_0x264134-0x0;var _0x44d25a=_0x5de0[_0x264134];return _0x44d25a;};'use strict';var _=require(_0x05de('0x0'));var util=require(_0x05de('0x1'));var moment=require(_0x05de('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x05de('0x3'));var db=require(_0x05de('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x05de('0x5'))('rpc');var config=require(_0x05de('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x05de('0x7')][_0x05de('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x25f020,_0x6da8f3,_0x51042c){return new BPromise(function(_0x24e461,_0x212cb1){return client[_0x05de('0x9')](_0x25f020,_0x51042c)['then'](function(_0xd8e9b2){logger[_0x05de('0xa')](_0x05de('0xb'),_0x6da8f3,_0x05de('0xc'));logger[_0x05de('0xd')](_0x05de('0xe'),_0x6da8f3,'request\x20sent',JSON['stringify'](_0xd8e9b2));if(_0xd8e9b2['error']){if(_0xd8e9b2[_0x05de('0xf')]['code']===0x1f4){logger[_0x05de('0xf')](_0x05de('0xb'),_0x6da8f3,_0xd8e9b2[_0x05de('0xf')][_0x05de('0x10')]);return _0x212cb1(_0xd8e9b2[_0x05de('0xf')][_0x05de('0x10')]);}logger[_0x05de('0xf')](_0x05de('0xb'),_0x6da8f3,_0xd8e9b2[_0x05de('0xf')][_0x05de('0x10')]);return _0x24e461(_0xd8e9b2[_0x05de('0xf')][_0x05de('0x10')]);}else{logger[_0x05de('0xa')]('Condition,\x20%s,\x20%s',_0x6da8f3,'request\x20sent');_0x24e461(_0xd8e9b2[_0x05de('0x11')][_0x05de('0x10')]);}})[_0x05de('0x12')](function(_0x11b665){logger['error'](_0x05de('0xb'),_0x6da8f3,_0x11b665);_0x212cb1(_0x11b665);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index 90a6e4d..2ccbb78 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 _0xf296=['update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./condition.controller','put','/:id','isAuthenticated'];(function(_0xc08ffe,_0x26f43f){var _0x52c452=function(_0x571984){while(--_0x571984){_0xc08ffe['push'](_0xc08ffe['shift']());}};_0x52c452(++_0x26f43f);}(_0xf296,0x1a8));var _0x6f29=function(_0x504e8c,_0x563d11){_0x504e8c=_0x504e8c-0x0;var _0xcae156=_0xf296[_0x504e8c];return _0xcae156;};'use strict';var multer=require(_0x6f29('0x0'));var util=require(_0x6f29('0x1'));var path=require(_0x6f29('0x2'));var timeout=require(_0x6f29('0x3'));var express=require('express');var router=express[_0x6f29('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x6f29('0x5'));var config=require(_0x6f29('0x6'));var controller=require(_0x6f29('0x7'));router[_0x6f29('0x8')](_0x6f29('0x9'),auth[_0x6f29('0xa')](),controller[_0x6f29('0xb')]);router[_0x6f29('0xc')](_0x6f29('0x9'),auth[_0x6f29('0xa')](),controller[_0x6f29('0xd')]);module[_0x6f29('0xe')]=router; \ No newline at end of file +var _0x35c1=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./condition.controller','/:id','isAuthenticated','update','delete','destroy','exports','multer','util','path'];(function(_0x530191,_0x52edef){var _0x212d5d=function(_0x3388f0){while(--_0x3388f0){_0x530191['push'](_0x530191['shift']());}};_0x212d5d(++_0x52edef);}(_0x35c1,0x17d));var _0x135c=function(_0x1414b3,_0x477031){_0x1414b3=_0x1414b3-0x0;var _0x5761ab=_0x35c1[_0x1414b3];return _0x5761ab;};'use strict';var multer=require(_0x135c('0x0'));var util=require(_0x135c('0x1'));var path=require(_0x135c('0x2'));var timeout=require(_0x135c('0x3'));var express=require(_0x135c('0x4'));var router=express[_0x135c('0x5')]();var fs_extra=require(_0x135c('0x6'));var auth=require(_0x135c('0x7'));var interaction=require(_0x135c('0x8'));var config=require('../../config/environment');var controller=require(_0x135c('0x9'));router['put'](_0x135c('0xa'),auth[_0x135c('0xb')](),controller[_0x135c('0xc')]);router[_0x135c('0xd')](_0x135c('0xa'),auth[_0x135c('0xb')](),controller[_0x135c('0xe')]);module[_0x135c('0xf')]=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index d2c1637..f954a31 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(_0x397484,_0x1a833e){var _0xe1f53d=function(_0x469f36){while(--_0x469f36){_0x397484['push'](_0x397484['shift']());}};_0xe1f53d(++_0x1a833e);}(_0x2032,0xd9));var _0x2203=function(_0x308ea3,_0xbe9c4){_0x308ea3=_0x308ea3-0x0;var _0x5aaaea=_0x2032[_0x308ea3];return _0x5aaaea;};'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 _0xbaf0=['name','exports','STRING'];(function(_0xfbdff6,_0x2af690){var _0x4cb9be=function(_0x4022d8){while(--_0x4022d8){_0xfbdff6['push'](_0xfbdff6['shift']());}};_0x4cb9be(++_0x2af690);}(_0xbaf0,0x12a));var _0x0baf=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xbaf0[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'name':{'type':Sequelize[_0x0baf('0x1')],'allowNull':![],'unique':_0x0baf('0x2')},'description':{'type':Sequelize[_0x0baf('0x1')]}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index ec95037..16eae31 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 _0x0cd2=['redis','defaults','localhost','register','sendStatus','status','json','offset','undefined','count','set','Content-Range','reject','update','then','destroy','get','CustomDashboards','error','stack','name','index','map','Dashboard','fieldName','type','keys','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','VIRTUAL','merge','options','findAll','rows','catch','params','rawAttributes','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','include','omit','createdAt','updatedAt','iframe','attrUrl','attrs','value','https://','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','total','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardId','DashboardItem','getItems','findOne','order','eml-format','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util'];(function(_0x91d9f1,_0x2ace8d){var _0x539d87=function(_0x5180a8){while(--_0x5180a8){_0x91d9f1['push'](_0x91d9f1['shift']());}};_0x539d87(++_0x2ace8d);}(_0x0cd2,0x1cb));var _0x20cd=function(_0x4acdf,_0x480f4c){_0x4acdf=_0x4acdf-0x0;var _0x3a5423=_0x0cd2[_0x4acdf];return _0x3a5423;};'use strict';var emlformat=require(_0x20cd('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x20cd('0x1'));var rp=require(_0x20cd('0x2'));var moment=require(_0x20cd('0x3'));var BPromise=require(_0x20cd('0x4'));var Mustache=require('mustache');var util=require(_0x20cd('0x5'));var path=require(_0x20cd('0x6'));var sox=require('sox');var csv=require(_0x20cd('0x7'));var ejs=require(_0x20cd('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x20cd('0x9'));var squel=require(_0x20cd('0xa'));var crypto=require(_0x20cd('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x20cd('0xc'));var toCsv=require(_0x20cd('0x7'));var querystring=require('querystring');var Papa=require(_0x20cd('0xd'));var Redis=require(_0x20cd('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x20cd('0xf'));var as=require(_0x20cd('0x10'));var hardwareService=require(_0x20cd('0x11'));var logger=require('../../config/logger')(_0x20cd('0x12'));var utils=require(_0x20cd('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x20cd('0x14'));var db=require('../../mysqldb')['db'];config[_0x20cd('0x15')]=_[_0x20cd('0x16')](config[_0x20cd('0x15')],{'host':_0x20cd('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./dashboard.socket')[_0x20cd('0x18')](socket);function respondWithStatusCode(_0x5ad831,_0x301cc8){_0x301cc8=_0x301cc8||0xcc;return function(_0x5f6151){if(_0x5f6151){return _0x5ad831[_0x20cd('0x19')](_0x301cc8);}return _0x5ad831[_0x20cd('0x1a')](_0x301cc8)['end']();};}function respondWithResult(_0x41e4b3,_0x1d105c){_0x1d105c=_0x1d105c||0xc8;return function(_0x183f85){if(_0x183f85){return _0x41e4b3[_0x20cd('0x1a')](_0x1d105c)[_0x20cd('0x1b')](_0x183f85);}};}function respondWithFilteredResult(_0x1a6d46,_0x582df2){return function(_0x26135b){if(_0x26135b){var _0x5e0237=typeof _0x582df2[_0x20cd('0x1c')]===_0x20cd('0x1d')&&typeof _0x582df2['limit']===_0x20cd('0x1d');var _0x7916af=_0x26135b[_0x20cd('0x1e')];var _0x291072=_0x5e0237?0x0:_0x582df2['offset'];var _0x19fadb=_0x5e0237?_0x26135b[_0x20cd('0x1e')]:_0x582df2[_0x20cd('0x1c')]+_0x582df2['limit'];var _0x50e536;if(_0x19fadb>=_0x7916af){_0x19fadb=_0x7916af;_0x50e536=0xc8;}else{_0x50e536=0xce;}_0x1a6d46[_0x20cd('0x1a')](_0x50e536);return _0x1a6d46[_0x20cd('0x1f')](_0x20cd('0x20'),_0x291072+'-'+_0x19fadb+'/'+_0x7916af)[_0x20cd('0x1b')](_0x26135b);}return null;};}function patchUpdates(_0x4c1c49){return function(_0x4ee728){try{jsonpatch['apply'](_0x4ee728,_0x4c1c49,!![]);}catch(_0x5a0617){return BPromise[_0x20cd('0x21')](_0x5a0617);}return _0x4ee728['save']();};}function saveUpdates(_0x2231f1,_0xaa3c7e){return function(_0x54b2cd){if(_0x54b2cd){return _0x54b2cd[_0x20cd('0x22')](_0x2231f1)[_0x20cd('0x23')](function(_0x103931){return _0x103931;});}return null;};}function removeEntity(_0x21a563,_0x2264c0){return function(_0x319095){if(_0x319095){return _0x319095[_0x20cd('0x24')]()['then'](function(){var _0x31c773=_0x319095[_0x20cd('0x25')]({'plain':!![]});var _0x2651e9=_0x20cd('0x26');return db['UserProfileResource'][_0x20cd('0x24')]({'where':{'type':_0x2651e9,'resourceId':_0x31c773['id']}})['then'](function(){return _0x319095;});})[_0x20cd('0x23')](function(){_0x21a563['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x506d7,_0x2364b4){return function(_0x2ac336){if(!_0x2ac336){_0x506d7[_0x20cd('0x19')](0x194);}return _0x2ac336;};}function handleError(_0x332372,_0x5309ed){_0x5309ed=_0x5309ed||0x1f4;return function(_0x87e4b2){logger[_0x20cd('0x27')](_0x87e4b2[_0x20cd('0x28')]);if(_0x87e4b2[_0x20cd('0x29')]){delete _0x87e4b2[_0x20cd('0x29')];}_0x332372['status'](_0x5309ed)['send'](_0x87e4b2);};}exports[_0x20cd('0x2a')]=function(_0x40469b,_0x527e57){var _0x1b3302={},_0x4fc02a={},_0x4a6f7b={'count':0x0,'rows':[]};var _0x23027c=_[_0x20cd('0x2b')](db[_0x20cd('0x2c')]['rawAttributes'],function(_0x1f38f9){return{'name':_0x1f38f9[_0x20cd('0x2d')],'type':_0x1f38f9[_0x20cd('0x2e')]['key']};});_0x4fc02a['model']=_[_0x20cd('0x2b')](_0x23027c,_0x20cd('0x29'));_0x4fc02a['query']=_[_0x20cd('0x2f')](_0x40469b[_0x20cd('0x30')]);_0x4fc02a[_0x20cd('0x31')]=_['intersection'](_0x4fc02a[_0x20cd('0x32')],_0x4fc02a[_0x20cd('0x30')]);_0x1b3302[_0x20cd('0x33')]=_[_0x20cd('0x34')](_0x4fc02a[_0x20cd('0x32')],qs[_0x20cd('0x35')](_0x40469b[_0x20cd('0x30')][_0x20cd('0x35')]));_0x1b3302[_0x20cd('0x33')]=_0x1b3302['attributes'][_0x20cd('0x36')]?_0x1b3302[_0x20cd('0x33')]:_0x4fc02a[_0x20cd('0x32')];if(!_0x40469b['query'][_0x20cd('0x37')](_0x20cd('0x38'))){_0x1b3302['limit']=qs[_0x20cd('0x39')](_0x40469b[_0x20cd('0x30')][_0x20cd('0x39')]);_0x1b3302[_0x20cd('0x1c')]=qs['offset'](_0x40469b['query']['offset']);}_0x1b3302['order']=qs[_0x20cd('0x3a')](_0x40469b[_0x20cd('0x30')]['sort']);_0x1b3302[_0x20cd('0x3b')]=qs[_0x20cd('0x31')](_[_0x20cd('0x3c')](_0x40469b[_0x20cd('0x30')],_0x4fc02a['filters']),_0x23027c);if(_0x40469b[_0x20cd('0x30')][_0x20cd('0x3d')]){_0x1b3302[_0x20cd('0x3b')]=_['merge'](_0x1b3302[_0x20cd('0x3b')],{'$or':_['map'](_0x23027c,function(_0x46446d){if(_0x46446d[_0x20cd('0x2e')]!==_0x20cd('0x3e')){var _0x228c7b={};_0x228c7b[_0x46446d[_0x20cd('0x29')]]={'$like':'%'+_0x40469b[_0x20cd('0x30')][_0x20cd('0x3d')]+'%'};return _0x228c7b;}})});}_0x1b3302=_[_0x20cd('0x3f')]({},_0x1b3302,_0x40469b[_0x20cd('0x40')]);var _0x2f3963={'where':_0x1b3302['where']};return db[_0x20cd('0x2c')]['count'](_0x2f3963)[_0x20cd('0x23')](function(_0x29ea29){_0x4a6f7b[_0x20cd('0x1e')]=_0x29ea29;if(_0x40469b[_0x20cd('0x30')]['includeAll']){_0x1b3302['include']=[{'all':!![]}];}return db[_0x20cd('0x2c')][_0x20cd('0x41')](_0x1b3302);})[_0x20cd('0x23')](function(_0x1ca473){_0x4a6f7b[_0x20cd('0x42')]=_0x1ca473;return _0x4a6f7b;})[_0x20cd('0x23')](respondWithFilteredResult(_0x527e57,_0x1b3302))[_0x20cd('0x43')](handleError(_0x527e57,null));};exports['show']=function(_0x4fe634,_0x9aeb45){var _0x46a751={'raw':![],'where':{'id':_0x4fe634[_0x20cd('0x44')]['id']}},_0x1cdec8={};_0x1cdec8[_0x20cd('0x32')]=_['keys'](db[_0x20cd('0x2c')][_0x20cd('0x45')]);_0x1cdec8['query']=_[_0x20cd('0x2f')](_0x4fe634['query']);_0x1cdec8[_0x20cd('0x31')]=_[_0x20cd('0x34')](_0x1cdec8[_0x20cd('0x32')],_0x1cdec8[_0x20cd('0x30')]);_0x46a751[_0x20cd('0x33')]=_[_0x20cd('0x34')](_0x1cdec8[_0x20cd('0x32')],qs[_0x20cd('0x35')](_0x4fe634[_0x20cd('0x30')][_0x20cd('0x35')]));_0x46a751[_0x20cd('0x33')]=_0x46a751['attributes'][_0x20cd('0x36')]?_0x46a751[_0x20cd('0x33')]:_0x1cdec8[_0x20cd('0x32')];if(_0x4fe634[_0x20cd('0x30')][_0x20cd('0x46')]){_0x46a751['include']=[{'all':!![]}];}_0x46a751=_[_0x20cd('0x3f')]({},_0x46a751,_0x4fe634['options']);return db[_0x20cd('0x2c')][_0x20cd('0x47')](_0x46a751)[_0x20cd('0x23')](handleEntityNotFound(_0x9aeb45,null))[_0x20cd('0x23')](respondWithResult(_0x9aeb45,null))[_0x20cd('0x43')](handleError(_0x9aeb45,null));};exports[_0x20cd('0x48')]=function(_0x5b7ed0,_0x491535){return db[_0x20cd('0x2c')][_0x20cd('0x48')](_0x5b7ed0[_0x20cd('0x49')],{})[_0x20cd('0x23')](function(_0x502281){var _0x5502d9=_0x5b7ed0[_0x20cd('0x4a')]['get']({'plain':!![]});if(!_0x5502d9)throw new Error(_0x20cd('0x4b'));if(_0x5502d9[_0x20cd('0x4c')]===_0x20cd('0x4a')){var _0x1b221e=_0x502281[_0x20cd('0x25')]({'plain':!![]});var _0x16d962=_0x20cd('0x26');return db[_0x20cd('0x4d')][_0x20cd('0x47')]({'where':{'name':_0x16d962,'userProfileId':_0x5502d9[_0x20cd('0x4e')]},'raw':!![]})[_0x20cd('0x23')](function(_0x2c969b){if(_0x2c969b&&_0x2c969b[_0x20cd('0x4f')]===0x0){return db[_0x20cd('0x50')][_0x20cd('0x48')]({'name':_0x1b221e[_0x20cd('0x29')],'resourceId':_0x1b221e['id'],'type':_0x2c969b[_0x20cd('0x29')],'sectionId':_0x2c969b['id']},{})[_0x20cd('0x23')](function(){return _0x502281;});}else{return _0x502281;}})[_0x20cd('0x43')](function(_0x40ade6){logger['error'](_0x20cd('0x51'),_0x40ade6);throw _0x40ade6;});}return _0x502281;})['then'](respondWithResult(_0x491535,0xc9))[_0x20cd('0x43')](handleError(_0x491535,null));};exports[_0x20cd('0x52')]=function(_0xfb547c,_0xaa2a72){var _0x1f4998={'where':{'id':_0xfb547c[_0x20cd('0x44')]['id']}},_0xd5ffd={};_0xd5ffd[_0x20cd('0x32')]=_['keys'](db[_0x20cd('0x2c')][_0x20cd('0x45')]);_0x1f4998['attributes']=_['intersection'](_0xd5ffd[_0x20cd('0x32')],qs['fields'](_0xfb547c[_0x20cd('0x30')][_0x20cd('0x35')]));_0x1f4998[_0x20cd('0x33')]=_0x1f4998[_0x20cd('0x33')]['length']?_0x1f4998['attributes']:_0xd5ffd['model'];if(_0xfb547c['query'][_0x20cd('0x46')]){_0x1f4998[_0x20cd('0x53')]=[{'all':!![]}];}_0x1f4998=_['merge']({},_0x1f4998,_0xfb547c['options']);return db[_0x20cd('0x2c')][_0x20cd('0x47')](_0x1f4998)[_0x20cd('0x23')](handleEntityNotFound(_0xaa2a72,null))[_0x20cd('0x23')](function(_0xcf7119){if(_0xcf7119){var _0x19d68f=_0xcf7119[_0x20cd('0x25')]({'plain':!![]});_0x19d68f=qs[_0x20cd('0x54')](_0x19d68f,['id',_0x20cd('0x55'),'updatedAt']);_0xfb547c[_0x20cd('0x49')]=_[_0x20cd('0x54')](_0xfb547c['body'],['id',_0x20cd('0x55'),_0x20cd('0x56')]);return db[_0x20cd('0x2c')][_0x20cd('0x48')](_[_0x20cd('0x3f')](_0x19d68f,_0xfb547c[_0x20cd('0x49')]),{'include':_0xfb547c[_0x20cd('0x30')][_0x20cd('0x46')]?[{'all':!![]}]:undefined})[_0x20cd('0x23')](function(_0x10e97c){var _0x229fd7=_0xfb547c[_0x20cd('0x4a')][_0x20cd('0x25')]({'plain':!![]});if(!_0x229fd7)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x229fd7[_0x20cd('0x4c')]==='user'){var _0x41ef6c=_0x10e97c[_0x20cd('0x25')]({'plain':!![]});var _0x35b25d=_0x20cd('0x26');return db[_0x20cd('0x4d')]['find']({'where':{'name':_0x35b25d,'userProfileId':_0x229fd7['userProfileId']},'raw':!![]})[_0x20cd('0x23')](function(_0x7e284a){if(_0x7e284a&&_0x7e284a[_0x20cd('0x4f')]===0x0){return db['UserProfileResource'][_0x20cd('0x48')]({'name':_0x41ef6c[_0x20cd('0x29')],'resourceId':_0x41ef6c['id'],'type':_0x7e284a[_0x20cd('0x29')],'sectionId':_0x7e284a['id']},{})['then'](function(){return _0x10e97c;});}else{return _0x10e97c;}})['catch'](function(_0x62612){logger[_0x20cd('0x27')](_0x20cd('0x51'),_0x62612);throw _0x62612;});}return _0x10e97c;});}})[_0x20cd('0x23')](respondWithResult(_0xaa2a72,0xc9))[_0x20cd('0x43')](handleError(_0xaa2a72,null));};exports['update']=function(_0xc5b661,_0x2dd8eb){if(_0xc5b661[_0x20cd('0x49')]['id']){delete _0xc5b661['body']['id'];}return db[_0x20cd('0x2c')]['find']({'where':{'id':_0xc5b661[_0x20cd('0x44')]['id']}})['then'](handleEntityNotFound(_0x2dd8eb,null))[_0x20cd('0x23')](saveUpdates(_0xc5b661[_0x20cd('0x49')],null))[_0x20cd('0x23')](respondWithResult(_0x2dd8eb,null))[_0x20cd('0x43')](handleError(_0x2dd8eb,null));};exports[_0x20cd('0x24')]=function(_0x4cddce,_0x443093){return db[_0x20cd('0x2c')][_0x20cd('0x47')]({'where':{'id':_0x4cddce['params']['id']}})['then'](handleEntityNotFound(_0x443093,null))[_0x20cd('0x23')](removeEntity(_0x443093,null))[_0x20cd('0x43')](handleError(_0x443093,null));};function widgetAttributes(_0x6843ea){try{switch(_0x6843ea['type']){case _0x20cd('0x57'):return[{'name':_0x20cd('0x58'),'value':_0x6843ea['attrUrl']||(_0x6843ea['attrs']&&_0x6843ea['attrs'][0x0]?_0x6843ea[_0x20cd('0x59')][0x0][_0x20cd('0x5a')]:undefined)||_0x20cd('0x5b')}];case'custom':return[{'name':_0x20cd('0x5c'),'value':_0x6843ea['attrPath']||(_0x6843ea[_0x20cd('0x59')]&&_0x6843ea[_0x20cd('0x59')][0x0]?_0x6843ea[_0x20cd('0x59')][0x0][_0x20cd('0x5a')]:undefined)||''}];case _0x20cd('0x5d'):return[{'name':'attrHourFormat','value':_0x6843ea[_0x20cd('0x5e')]||(_0x6843ea[_0x20cd('0x59')]&&_0x6843ea[_0x20cd('0x59')][0x0]?_0x6843ea[_0x20cd('0x59')][0x0][_0x20cd('0x5a')]:undefined)||_0x20cd('0x5f')},{'name':_0x20cd('0x60'),'value':_0x6843ea[_0x20cd('0x60')]||(_0x6843ea[_0x20cd('0x59')]&&_0x6843ea['attrs'][0x1]?_0x6843ea[_0x20cd('0x59')][0x1][_0x20cd('0x5a')]:undefined)||_0x20cd('0x61')},{'name':_0x20cd('0x62'),'value':_0x6843ea[_0x20cd('0x62')]||(_0x6843ea[_0x20cd('0x59')]&&_0x6843ea[_0x20cd('0x59')][0x2]?_0x6843ea['attrs'][0x2][_0x20cd('0x5a')]:undefined)||0xc}];case _0x20cd('0x63'):return[{'name':'attrMetric','value':_0x6843ea[_0x20cd('0x64')]||(_0x6843ea[_0x20cd('0x59')]&&_0x6843ea['attrs'][0x0]?_0x6843ea[_0x20cd('0x59')][0x0][_0x20cd('0x5a')]:undefined)||'total'},{'name':_0x20cd('0x65'),'value':_0x6843ea[_0x20cd('0x65')]||(_0x6843ea['attrs']&&_0x6843ea[_0x20cd('0x59')][0x1]?_0x6843ea[_0x20cd('0x59')][0x1][_0x20cd('0x5a')]:undefined)||[]},{'name':_0x20cd('0x62'),'value':_0x6843ea[_0x20cd('0x62')]||(_0x6843ea[_0x20cd('0x59')]&&_0x6843ea[_0x20cd('0x59')][0x2]?_0x6843ea[_0x20cd('0x59')][0x2]['value']:undefined)||0x14}];case _0x20cd('0x66'):case _0x20cd('0x67'):return[{'name':_0x20cd('0x68'),'value':_0x6843ea[_0x20cd('0x68')]||(_0x6843ea[_0x20cd('0x59')]&&_0x6843ea['attrs'][0x0]?_0x6843ea[_0x20cd('0x59')][0x0][_0x20cd('0x5a')]:undefined)||_0x20cd('0x69')},{'name':_0x20cd('0x6a'),'value':_0x6843ea[_0x20cd('0x6a')]||(_0x6843ea[_0x20cd('0x59')]&&_0x6843ea[_0x20cd('0x59')][0x1]?_0x6843ea[_0x20cd('0x59')][0x1]['value']:undefined)||null},{'name':_0x20cd('0x6b'),'value':_0x6843ea[_0x20cd('0x6b')]||(_0x6843ea[_0x20cd('0x59')]&&_0x6843ea[_0x20cd('0x59')][0x2]?_0x6843ea[_0x20cd('0x59')][0x2]['value']:undefined)||null},{'name':_0x20cd('0x65'),'value':_0x6843ea[_0x20cd('0x65')]||(_0x6843ea[_0x20cd('0x59')]&&_0x6843ea['attrs'][0x3]?_0x6843ea[_0x20cd('0x59')][0x3][_0x20cd('0x5a')]:undefined)||[]}];case _0x20cd('0x6c'):return[{'name':_0x20cd('0x6d'),'type':_0x6843ea[_0x20cd('0x6e')]||(_0x6843ea['attrs']&&_0x6843ea['attrs'][0x0]?_0x6843ea['attrs'][0x0][_0x20cd('0x2e')]:undefined)||null,'value':_0x6843ea[_0x20cd('0x6d')]||(_0x6843ea[_0x20cd('0x59')]&&_0x6843ea[_0x20cd('0x59')][0x0]?_0x6843ea[_0x20cd('0x59')][0x0][_0x20cd('0x5a')]:undefined)||null},{'name':'attrRefresh','value':_0x6843ea[_0x20cd('0x6f')]||(_0x6843ea['attrs']&&_0x6843ea[_0x20cd('0x59')][0x1]?_0x6843ea['attrs'][0x1][_0x20cd('0x5a')]:undefined)||0x0}];default:return[];}}catch(_0x17560c){logger[_0x20cd('0x27')](_0x20cd('0x70'),JSON[_0x20cd('0x71')](_0x17560c));return[];}}exports[_0x20cd('0x72')]=function(_0x58f218,_0x279f4e,_0x275144){if(_0x58f218['body']['id']){delete _0x58f218['body']['id'];}return db[_0x20cd('0x2c')][_0x20cd('0x47')]({'where':{'id':_0x58f218[_0x20cd('0x44')]['id']}})[_0x20cd('0x23')](handleEntityNotFound(_0x279f4e,null))[_0x20cd('0x23')](function(_0xe00a42){if(_0xe00a42){_0x58f218[_0x20cd('0x49')][_0x20cd('0x73')]=_0xe00a42['id'];_0x58f218['body'][_0x20cd('0x59')]=widgetAttributes(_0x58f218[_0x20cd('0x49')]);return db[_0x20cd('0x74')][_0x20cd('0x48')](_0x58f218[_0x20cd('0x49')]);}})['then'](respondWithResult(_0x279f4e,null))['catch'](handleError(_0x279f4e,null));};exports[_0x20cd('0x75')]=function(_0x26baa2,_0x5046c8,_0x24cb93){var _0x168650={};var _0x4aa600={};var _0x49752e;var _0x5a17b5;return db[_0x20cd('0x2c')][_0x20cd('0x76')]({'where':{'id':_0x26baa2[_0x20cd('0x44')]['id']}})[_0x20cd('0x23')](handleEntityNotFound(_0x5046c8,null))[_0x20cd('0x23')](function(_0x392810){if(_0x392810){_0x49752e=_0x392810;_0x4aa600['model']=_['keys'](db[_0x20cd('0x74')]['rawAttributes']);_0x4aa600[_0x20cd('0x30')]=_[_0x20cd('0x2f')](_0x26baa2['query']);_0x4aa600[_0x20cd('0x31')]=_[_0x20cd('0x34')](_0x4aa600[_0x20cd('0x32')],_0x4aa600[_0x20cd('0x30')]);_0x168650[_0x20cd('0x33')]=_[_0x20cd('0x34')](_0x4aa600[_0x20cd('0x32')],qs[_0x20cd('0x35')](_0x26baa2[_0x20cd('0x30')][_0x20cd('0x35')]));_0x168650['attributes']=_0x168650[_0x20cd('0x33')][_0x20cd('0x36')]?_0x168650['attributes']:_0x4aa600['model'];_0x168650[_0x20cd('0x77')]=qs[_0x20cd('0x3a')](_0x26baa2[_0x20cd('0x30')][_0x20cd('0x3a')]);_0x168650[_0x20cd('0x3b')]=qs[_0x20cd('0x31')](_['pick'](_0x26baa2[_0x20cd('0x30')],_0x4aa600[_0x20cd('0x31')]));if(_0x26baa2[_0x20cd('0x30')][_0x20cd('0x3d')]){_0x168650[_0x20cd('0x3b')]=_[_0x20cd('0x3f')](_0x168650[_0x20cd('0x3b')],{'$or':_[_0x20cd('0x2b')](_0x168650[_0x20cd('0x33')],function(_0xcce0e1){var _0x391c74={};_0x391c74[_0xcce0e1]={'$like':'%'+_0x26baa2['query']['filter']+'%'};return _0x391c74;})});}_0x168650=_[_0x20cd('0x3f')]({},_0x168650,_0x26baa2['options']);return _0x49752e[_0x20cd('0x75')](_0x168650);}})[_0x20cd('0x23')](function(_0x5bdc3d){if(_0x5bdc3d){_0x5a17b5=_0x5bdc3d['length'];if(!_0x26baa2['query']['hasOwnProperty'](_0x20cd('0x38'))){_0x168650[_0x20cd('0x39')]=qs[_0x20cd('0x39')](_0x26baa2['query'][_0x20cd('0x39')]);_0x168650[_0x20cd('0x1c')]=qs[_0x20cd('0x1c')](_0x26baa2[_0x20cd('0x30')][_0x20cd('0x1c')]);}return _0x49752e[_0x20cd('0x75')](_0x168650);}})['then'](function(_0x1d36b4){if(_0x1d36b4){return _0x1d36b4?{'count':_0x5a17b5,'rows':_0x1d36b4}:null;}})[_0x20cd('0x23')](respondWithResult(_0x5046c8,null))[_0x20cd('0x43')](handleError(_0x5046c8,null));}; \ No newline at end of file +var _0xb94f=['util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','redis','defaults','localhost','./dashboard.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','get','CustomDashboards','UserProfileResource','destroy','error','stack','name','send','index','map','rawAttributes','type','key','query','keys','attributes','intersection','model','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','Dashboard','findAll','rows','catch','show','params','fields','includeAll','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','createdAt','body','updatedAt','UserProfileSection','iframe','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','multibar-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardId','DashboardItem','getItems','order','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x105d36,_0x115ef9){var _0xab48ad=function(_0x121522){while(--_0x121522){_0x105d36['push'](_0x105d36['shift']());}};_0xab48ad(++_0x115ef9);}(_0xb94f,0x76));var _0xfb94=function(_0x22663b,_0xc8c6e3){_0x22663b=_0x22663b-0x0;var _0x310d0a=_0xb94f[_0x22663b];return _0x310d0a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfb94('0x0'));var zipdir=require(_0xfb94('0x1'));var jsonpatch=require(_0xfb94('0x2'));var rp=require(_0xfb94('0x3'));var moment=require(_0xfb94('0x4'));var BPromise=require(_0xfb94('0x5'));var Mustache=require(_0xfb94('0x6'));var util=require(_0xfb94('0x7'));var path=require(_0xfb94('0x8'));var sox=require(_0xfb94('0x9'));var csv=require(_0xfb94('0xa'));var ejs=require(_0xfb94('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfb94('0xc'));var squel=require(_0xfb94('0xd'));var crypto=require(_0xfb94('0xe'));var jsforce=require(_0xfb94('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xfb94('0x10'));var Papa=require(_0xfb94('0x11'));var Redis=require(_0xfb94('0x12'));var authService=require(_0xfb94('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xfb94('0x14'));var hardwareService=require(_0xfb94('0x15'));var logger=require(_0xfb94('0x16'))(_0xfb94('0x17'));var utils=require(_0xfb94('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xfb94('0x19')]=_[_0xfb94('0x1a')](config['redis'],{'host':_0xfb94('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfb94('0x19')]));require(_0xfb94('0x1c'))[_0xfb94('0x1d')](socket);function respondWithStatusCode(_0x27a34c,_0x51bda8){_0x51bda8=_0x51bda8||0xcc;return function(_0x1348c4){if(_0x1348c4){return _0x27a34c[_0xfb94('0x1e')](_0x51bda8);}return _0x27a34c[_0xfb94('0x1f')](_0x51bda8)[_0xfb94('0x20')]();};}function respondWithResult(_0x17da2c,_0x52ea19){_0x52ea19=_0x52ea19||0xc8;return function(_0x2aadfe){if(_0x2aadfe){return _0x17da2c['status'](_0x52ea19)[_0xfb94('0x21')](_0x2aadfe);}};}function respondWithFilteredResult(_0x1078fe,_0x29bde5){return function(_0x246cfc){if(_0x246cfc){var _0x38deef=typeof _0x29bde5[_0xfb94('0x22')]===_0xfb94('0x23')&&typeof _0x29bde5[_0xfb94('0x24')]===_0xfb94('0x23');var _0x5363c6=_0x246cfc[_0xfb94('0x25')];var _0x778350=_0x38deef?0x0:_0x29bde5[_0xfb94('0x22')];var _0x2318e9=_0x38deef?_0x246cfc[_0xfb94('0x25')]:_0x29bde5[_0xfb94('0x22')]+_0x29bde5[_0xfb94('0x24')];var _0x2b7442;if(_0x2318e9>=_0x5363c6){_0x2318e9=_0x5363c6;_0x2b7442=0xc8;}else{_0x2b7442=0xce;}_0x1078fe[_0xfb94('0x1f')](_0x2b7442);return _0x1078fe[_0xfb94('0x26')](_0xfb94('0x27'),_0x778350+'-'+_0x2318e9+'/'+_0x5363c6)[_0xfb94('0x21')](_0x246cfc);}return null;};}function patchUpdates(_0x1f8063){return function(_0x134bc0){try{jsonpatch['apply'](_0x134bc0,_0x1f8063,!![]);}catch(_0x15a759){return BPromise[_0xfb94('0x28')](_0x15a759);}return _0x134bc0[_0xfb94('0x29')]();};}function saveUpdates(_0x28e1b9,_0xeb6104){return function(_0x4e68be){if(_0x4e68be){return _0x4e68be[_0xfb94('0x2a')](_0x28e1b9)[_0xfb94('0x2b')](function(_0x35894e){return _0x35894e;});}return null;};}function removeEntity(_0x24f4b9,_0x4e2ca5){return function(_0x14e8cd){if(_0x14e8cd){return _0x14e8cd['destroy']()[_0xfb94('0x2b')](function(){var _0x31b472=_0x14e8cd[_0xfb94('0x2c')]({'plain':!![]});var _0x3b2926=_0xfb94('0x2d');return db[_0xfb94('0x2e')][_0xfb94('0x2f')]({'where':{'type':_0x3b2926,'resourceId':_0x31b472['id']}})[_0xfb94('0x2b')](function(){return _0x14e8cd;});})[_0xfb94('0x2b')](function(){_0x24f4b9[_0xfb94('0x1f')](0xcc)[_0xfb94('0x20')]();});}};}function handleEntityNotFound(_0x4b7e77,_0x6ce9ec){return function(_0x4b8c52){if(!_0x4b8c52){_0x4b7e77['sendStatus'](0x194);}return _0x4b8c52;};}function handleError(_0x67fc56,_0x5b4439){_0x5b4439=_0x5b4439||0x1f4;return function(_0x515e0a){logger[_0xfb94('0x30')](_0x515e0a[_0xfb94('0x31')]);if(_0x515e0a[_0xfb94('0x32')]){delete _0x515e0a['name'];}_0x67fc56[_0xfb94('0x1f')](_0x5b4439)[_0xfb94('0x33')](_0x515e0a);};}exports[_0xfb94('0x34')]=function(_0x1e1100,_0x27cd78){var _0x3fb1f3={},_0x2d6255={},_0x78e4b6={'count':0x0,'rows':[]};var _0x1d0f2f=_[_0xfb94('0x35')](db['Dashboard'][_0xfb94('0x36')],function(_0x3cfb07){return{'name':_0x3cfb07['fieldName'],'type':_0x3cfb07[_0xfb94('0x37')][_0xfb94('0x38')]};});_0x2d6255['model']=_[_0xfb94('0x35')](_0x1d0f2f,'name');_0x2d6255[_0xfb94('0x39')]=_[_0xfb94('0x3a')](_0x1e1100[_0xfb94('0x39')]);_0x2d6255['filters']=_['intersection'](_0x2d6255['model'],_0x2d6255[_0xfb94('0x39')]);_0x3fb1f3[_0xfb94('0x3b')]=_[_0xfb94('0x3c')](_0x2d6255[_0xfb94('0x3d')],qs['fields'](_0x1e1100[_0xfb94('0x39')]['fields']));_0x3fb1f3[_0xfb94('0x3b')]=_0x3fb1f3[_0xfb94('0x3b')][_0xfb94('0x3e')]?_0x3fb1f3[_0xfb94('0x3b')]:_0x2d6255[_0xfb94('0x3d')];if(!_0x1e1100[_0xfb94('0x39')][_0xfb94('0x3f')](_0xfb94('0x40'))){_0x3fb1f3[_0xfb94('0x24')]=qs[_0xfb94('0x24')](_0x1e1100[_0xfb94('0x39')][_0xfb94('0x24')]);_0x3fb1f3[_0xfb94('0x22')]=qs[_0xfb94('0x22')](_0x1e1100['query']['offset']);}_0x3fb1f3['order']=qs[_0xfb94('0x41')](_0x1e1100[_0xfb94('0x39')]['sort']);_0x3fb1f3[_0xfb94('0x42')]=qs[_0xfb94('0x43')](_[_0xfb94('0x44')](_0x1e1100['query'],_0x2d6255[_0xfb94('0x43')]),_0x1d0f2f);if(_0x1e1100['query'][_0xfb94('0x45')]){_0x3fb1f3[_0xfb94('0x42')]=_[_0xfb94('0x46')](_0x3fb1f3[_0xfb94('0x42')],{'$or':_[_0xfb94('0x35')](_0x1d0f2f,function(_0x504a6e){if(_0x504a6e[_0xfb94('0x37')]!==_0xfb94('0x47')){var _0x2fc479={};_0x2fc479[_0x504a6e[_0xfb94('0x32')]]={'$like':'%'+_0x1e1100[_0xfb94('0x39')]['filter']+'%'};return _0x2fc479;}})});}_0x3fb1f3=_['merge']({},_0x3fb1f3,_0x1e1100[_0xfb94('0x48')]);var _0x40eae8={'where':_0x3fb1f3[_0xfb94('0x42')]};return db['Dashboard'][_0xfb94('0x25')](_0x40eae8)[_0xfb94('0x2b')](function(_0x62305b){_0x78e4b6[_0xfb94('0x25')]=_0x62305b;if(_0x1e1100[_0xfb94('0x39')]['includeAll']){_0x3fb1f3[_0xfb94('0x49')]=[{'all':!![]}];}return db[_0xfb94('0x4a')][_0xfb94('0x4b')](_0x3fb1f3);})['then'](function(_0x16b9d8){_0x78e4b6[_0xfb94('0x4c')]=_0x16b9d8;return _0x78e4b6;})[_0xfb94('0x2b')](respondWithFilteredResult(_0x27cd78,_0x3fb1f3))[_0xfb94('0x4d')](handleError(_0x27cd78,null));};exports[_0xfb94('0x4e')]=function(_0x28c906,_0x1b1932){var _0x5ec5b8={'raw':![],'where':{'id':_0x28c906[_0xfb94('0x4f')]['id']}},_0x28b524={};_0x28b524[_0xfb94('0x3d')]=_['keys'](db['Dashboard'][_0xfb94('0x36')]);_0x28b524[_0xfb94('0x39')]=_[_0xfb94('0x3a')](_0x28c906['query']);_0x28b524[_0xfb94('0x43')]=_[_0xfb94('0x3c')](_0x28b524[_0xfb94('0x3d')],_0x28b524[_0xfb94('0x39')]);_0x5ec5b8['attributes']=_[_0xfb94('0x3c')](_0x28b524[_0xfb94('0x3d')],qs['fields'](_0x28c906[_0xfb94('0x39')][_0xfb94('0x50')]));_0x5ec5b8[_0xfb94('0x3b')]=_0x5ec5b8['attributes'][_0xfb94('0x3e')]?_0x5ec5b8[_0xfb94('0x3b')]:_0x28b524[_0xfb94('0x3d')];if(_0x28c906[_0xfb94('0x39')][_0xfb94('0x51')]){_0x5ec5b8[_0xfb94('0x49')]=[{'all':!![]}];}_0x5ec5b8=_[_0xfb94('0x46')]({},_0x5ec5b8,_0x28c906[_0xfb94('0x48')]);return db[_0xfb94('0x4a')][_0xfb94('0x52')](_0x5ec5b8)['then'](handleEntityNotFound(_0x1b1932,null))[_0xfb94('0x2b')](respondWithResult(_0x1b1932,null))['catch'](handleError(_0x1b1932,null));};exports[_0xfb94('0x53')]=function(_0xf1edee,_0x5111cf){return db[_0xfb94('0x4a')]['create'](_0xf1edee['body'],{})[_0xfb94('0x2b')](function(_0x36ffce){var _0x3cfbc8=_0xf1edee['user'][_0xfb94('0x2c')]({'plain':!![]});if(!_0x3cfbc8)throw new Error(_0xfb94('0x54'));if(_0x3cfbc8[_0xfb94('0x55')]===_0xfb94('0x56')){var _0x2e3ad6=_0x36ffce[_0xfb94('0x2c')]({'plain':!![]});var _0x3ff9cc='CustomDashboards';return db['UserProfileSection'][_0xfb94('0x52')]({'where':{'name':_0x3ff9cc,'userProfileId':_0x3cfbc8['userProfileId']},'raw':!![]})[_0xfb94('0x2b')](function(_0x390457){if(_0x390457&&_0x390457[_0xfb94('0x57')]===0x0){return db[_0xfb94('0x2e')]['create']({'name':_0x2e3ad6[_0xfb94('0x32')],'resourceId':_0x2e3ad6['id'],'type':_0x390457[_0xfb94('0x32')],'sectionId':_0x390457['id']},{})[_0xfb94('0x2b')](function(){return _0x36ffce;});}else{return _0x36ffce;}})['catch'](function(_0x533918){logger['error'](_0xfb94('0x58'),_0x533918);throw _0x533918;});}return _0x36ffce;})[_0xfb94('0x2b')](respondWithResult(_0x5111cf,0xc9))['catch'](handleError(_0x5111cf,null));};exports['clone']=function(_0x19e09c,_0x36f583){var _0xce3cbb={'where':{'id':_0x19e09c[_0xfb94('0x4f')]['id']}},_0xa643d9={};_0xa643d9[_0xfb94('0x3d')]=_['keys'](db[_0xfb94('0x4a')][_0xfb94('0x36')]);_0xce3cbb[_0xfb94('0x3b')]=_[_0xfb94('0x3c')](_0xa643d9[_0xfb94('0x3d')],qs[_0xfb94('0x50')](_0x19e09c[_0xfb94('0x39')][_0xfb94('0x50')]));_0xce3cbb[_0xfb94('0x3b')]=_0xce3cbb[_0xfb94('0x3b')][_0xfb94('0x3e')]?_0xce3cbb['attributes']:_0xa643d9[_0xfb94('0x3d')];if(_0x19e09c[_0xfb94('0x39')][_0xfb94('0x51')]){_0xce3cbb[_0xfb94('0x49')]=[{'all':!![]}];}_0xce3cbb=_['merge']({},_0xce3cbb,_0x19e09c['options']);return db['Dashboard']['find'](_0xce3cbb)['then'](handleEntityNotFound(_0x36f583,null))['then'](function(_0x1af40a){if(_0x1af40a){var _0x50cc3c=_0x1af40a[_0xfb94('0x2c')]({'plain':!![]});_0x50cc3c=qs[_0xfb94('0x59')](_0x50cc3c,['id',_0xfb94('0x5a'),'updatedAt']);_0x19e09c[_0xfb94('0x5b')]=_[_0xfb94('0x59')](_0x19e09c[_0xfb94('0x5b')],['id','createdAt',_0xfb94('0x5c')]);return db[_0xfb94('0x4a')]['create'](_[_0xfb94('0x46')](_0x50cc3c,_0x19e09c[_0xfb94('0x5b')]),{'include':_0x19e09c[_0xfb94('0x39')][_0xfb94('0x51')]?[{'all':!![]}]:undefined})[_0xfb94('0x2b')](function(_0x357879){var _0x4b97ec=_0x19e09c[_0xfb94('0x56')][_0xfb94('0x2c')]({'plain':!![]});if(!_0x4b97ec)throw new Error(_0xfb94('0x54'));if(_0x4b97ec[_0xfb94('0x55')]===_0xfb94('0x56')){var _0x27b276=_0x357879['get']({'plain':!![]});var _0x270af0=_0xfb94('0x2d');return db[_0xfb94('0x5d')][_0xfb94('0x52')]({'where':{'name':_0x270af0,'userProfileId':_0x4b97ec['userProfileId']},'raw':!![]})[_0xfb94('0x2b')](function(_0x5a1fd7){if(_0x5a1fd7&&_0x5a1fd7['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x27b276['name'],'resourceId':_0x27b276['id'],'type':_0x5a1fd7['name'],'sectionId':_0x5a1fd7['id']},{})[_0xfb94('0x2b')](function(){return _0x357879;});}else{return _0x357879;}})['catch'](function(_0x5ac75e){logger['error'](_0xfb94('0x58'),_0x5ac75e);throw _0x5ac75e;});}return _0x357879;});}})[_0xfb94('0x2b')](respondWithResult(_0x36f583,0xc9))[_0xfb94('0x4d')](handleError(_0x36f583,null));};exports[_0xfb94('0x2a')]=function(_0x2d71af,_0x1ed288){if(_0x2d71af[_0xfb94('0x5b')]['id']){delete _0x2d71af['body']['id'];}return db[_0xfb94('0x4a')][_0xfb94('0x52')]({'where':{'id':_0x2d71af['params']['id']}})[_0xfb94('0x2b')](handleEntityNotFound(_0x1ed288,null))['then'](saveUpdates(_0x2d71af['body'],null))[_0xfb94('0x2b')](respondWithResult(_0x1ed288,null))[_0xfb94('0x4d')](handleError(_0x1ed288,null));};exports[_0xfb94('0x2f')]=function(_0x14b472,_0x553b43){return db[_0xfb94('0x4a')][_0xfb94('0x52')]({'where':{'id':_0x14b472[_0xfb94('0x4f')]['id']}})[_0xfb94('0x2b')](handleEntityNotFound(_0x553b43,null))[_0xfb94('0x2b')](removeEntity(_0x553b43,null))[_0xfb94('0x4d')](handleError(_0x553b43,null));};function widgetAttributes(_0x493cd8){try{switch(_0x493cd8[_0xfb94('0x37')]){case _0xfb94('0x5e'):return[{'name':_0xfb94('0x5f'),'value':_0x493cd8['attrUrl']||(_0x493cd8[_0xfb94('0x60')]&&_0x493cd8[_0xfb94('0x60')][0x0]?_0x493cd8[_0xfb94('0x60')][0x0][_0xfb94('0x61')]:undefined)||_0xfb94('0x62')}];case _0xfb94('0x63'):return[{'name':'attrPath','value':_0x493cd8[_0xfb94('0x64')]||(_0x493cd8[_0xfb94('0x60')]&&_0x493cd8['attrs'][0x0]?_0x493cd8['attrs'][0x0]['value']:undefined)||''}];case _0xfb94('0x65'):return[{'name':_0xfb94('0x66'),'value':_0x493cd8[_0xfb94('0x66')]||(_0x493cd8[_0xfb94('0x60')]&&_0x493cd8['attrs'][0x0]?_0x493cd8[_0xfb94('0x60')][0x0][_0xfb94('0x61')]:undefined)||'HH:mm:ss'},{'name':_0xfb94('0x67'),'value':_0x493cd8[_0xfb94('0x67')]||(_0x493cd8[_0xfb94('0x60')]&&_0x493cd8['attrs'][0x1]?_0x493cd8[_0xfb94('0x60')][0x1]['value']:undefined)||_0xfb94('0x68')},{'name':_0xfb94('0x69'),'value':_0x493cd8['attrFontSize']||(_0x493cd8['attrs']&&_0x493cd8[_0xfb94('0x60')][0x2]?_0x493cd8['attrs'][0x2][_0xfb94('0x61')]:undefined)||0xc}];case _0xfb94('0x6a'):return[{'name':_0xfb94('0x6b'),'value':_0x493cd8[_0xfb94('0x6b')]||(_0x493cd8[_0xfb94('0x60')]&&_0x493cd8[_0xfb94('0x60')][0x0]?_0x493cd8[_0xfb94('0x60')][0x0][_0xfb94('0x61')]:undefined)||_0xfb94('0x6c')},{'name':_0xfb94('0x6d'),'value':_0x493cd8['attrVoiceQueues']||(_0x493cd8[_0xfb94('0x60')]&&_0x493cd8[_0xfb94('0x60')][0x1]?_0x493cd8[_0xfb94('0x60')][0x1]['value']:undefined)||[]},{'name':_0xfb94('0x69'),'value':_0x493cd8['attrFontSize']||(_0x493cd8[_0xfb94('0x60')]&&_0x493cd8[_0xfb94('0x60')][0x2]?_0x493cd8[_0xfb94('0x60')][0x2][_0xfb94('0x61')]:undefined)||0x14}];case _0xfb94('0x6e'):case'pie-chart':return[{'name':_0xfb94('0x6f'),'value':_0x493cd8[_0xfb94('0x6f')]||(_0x493cd8[_0xfb94('0x60')]&&_0x493cd8[_0xfb94('0x60')][0x0]?_0x493cd8[_0xfb94('0x60')][0x0][_0xfb94('0x61')]:undefined)||'total'},{'name':_0xfb94('0x70'),'value':_0x493cd8['attrSerie2']||(_0x493cd8[_0xfb94('0x60')]&&_0x493cd8[_0xfb94('0x60')][0x1]?_0x493cd8[_0xfb94('0x60')][0x1][_0xfb94('0x61')]:undefined)||null},{'name':_0xfb94('0x71'),'value':_0x493cd8[_0xfb94('0x71')]||(_0x493cd8[_0xfb94('0x60')]&&_0x493cd8[_0xfb94('0x60')][0x2]?_0x493cd8['attrs'][0x2][_0xfb94('0x61')]:undefined)||null},{'name':_0xfb94('0x6d'),'value':_0x493cd8[_0xfb94('0x6d')]||(_0x493cd8['attrs']&&_0x493cd8['attrs'][0x3]?_0x493cd8[_0xfb94('0x60')][0x3][_0xfb94('0x61')]:undefined)||[]}];case _0xfb94('0x72'):return[{'name':_0xfb94('0x73'),'type':_0x493cd8[_0xfb94('0x74')]||(_0x493cd8[_0xfb94('0x60')]&&_0x493cd8['attrs'][0x0]?_0x493cd8[_0xfb94('0x60')][0x0]['type']:undefined)||null,'value':_0x493cd8[_0xfb94('0x73')]||(_0x493cd8[_0xfb94('0x60')]&&_0x493cd8['attrs'][0x0]?_0x493cd8[_0xfb94('0x60')][0x0][_0xfb94('0x61')]:undefined)||null},{'name':_0xfb94('0x75'),'value':_0x493cd8[_0xfb94('0x75')]||(_0x493cd8[_0xfb94('0x60')]&&_0x493cd8[_0xfb94('0x60')][0x1]?_0x493cd8[_0xfb94('0x60')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x504f4c){logger[_0xfb94('0x30')](_0xfb94('0x76'),JSON[_0xfb94('0x77')](_0x504f4c));return[];}}exports[_0xfb94('0x78')]=function(_0x4696b0,_0x287724,_0x52f827){if(_0x4696b0[_0xfb94('0x5b')]['id']){delete _0x4696b0[_0xfb94('0x5b')]['id'];}return db['Dashboard'][_0xfb94('0x52')]({'where':{'id':_0x4696b0[_0xfb94('0x4f')]['id']}})[_0xfb94('0x2b')](handleEntityNotFound(_0x287724,null))[_0xfb94('0x2b')](function(_0x2f51ef){if(_0x2f51ef){_0x4696b0['body'][_0xfb94('0x79')]=_0x2f51ef['id'];_0x4696b0[_0xfb94('0x5b')][_0xfb94('0x60')]=widgetAttributes(_0x4696b0['body']);return db[_0xfb94('0x7a')][_0xfb94('0x53')](_0x4696b0['body']);}})[_0xfb94('0x2b')](respondWithResult(_0x287724,null))['catch'](handleError(_0x287724,null));};exports[_0xfb94('0x7b')]=function(_0x3adbe0,_0x22af6f,_0x3abe79){var _0x3a020a={};var _0x501e63={};var _0x1b362a;var _0x14ae1b;return db['Dashboard']['findOne']({'where':{'id':_0x3adbe0[_0xfb94('0x4f')]['id']}})[_0xfb94('0x2b')](handleEntityNotFound(_0x22af6f,null))[_0xfb94('0x2b')](function(_0x58db3d){if(_0x58db3d){_0x1b362a=_0x58db3d;_0x501e63['model']=_[_0xfb94('0x3a')](db[_0xfb94('0x7a')][_0xfb94('0x36')]);_0x501e63['query']=_[_0xfb94('0x3a')](_0x3adbe0['query']);_0x501e63[_0xfb94('0x43')]=_[_0xfb94('0x3c')](_0x501e63[_0xfb94('0x3d')],_0x501e63['query']);_0x3a020a[_0xfb94('0x3b')]=_['intersection'](_0x501e63['model'],qs['fields'](_0x3adbe0['query'][_0xfb94('0x50')]));_0x3a020a[_0xfb94('0x3b')]=_0x3a020a[_0xfb94('0x3b')]['length']?_0x3a020a[_0xfb94('0x3b')]:_0x501e63[_0xfb94('0x3d')];_0x3a020a[_0xfb94('0x7c')]=qs[_0xfb94('0x41')](_0x3adbe0[_0xfb94('0x39')][_0xfb94('0x41')]);_0x3a020a['where']=qs[_0xfb94('0x43')](_[_0xfb94('0x44')](_0x3adbe0[_0xfb94('0x39')],_0x501e63[_0xfb94('0x43')]));if(_0x3adbe0[_0xfb94('0x39')][_0xfb94('0x45')]){_0x3a020a[_0xfb94('0x42')]=_[_0xfb94('0x46')](_0x3a020a[_0xfb94('0x42')],{'$or':_[_0xfb94('0x35')](_0x3a020a[_0xfb94('0x3b')],function(_0x39659e){var _0x5989c0={};_0x5989c0[_0x39659e]={'$like':'%'+_0x3adbe0[_0xfb94('0x39')][_0xfb94('0x45')]+'%'};return _0x5989c0;})});}_0x3a020a=_[_0xfb94('0x46')]({},_0x3a020a,_0x3adbe0[_0xfb94('0x48')]);return _0x1b362a[_0xfb94('0x7b')](_0x3a020a);}})[_0xfb94('0x2b')](function(_0x12fff6){if(_0x12fff6){_0x14ae1b=_0x12fff6[_0xfb94('0x3e')];if(!_0x3adbe0[_0xfb94('0x39')][_0xfb94('0x3f')]('nolimit')){_0x3a020a['limit']=qs[_0xfb94('0x24')](_0x3adbe0[_0xfb94('0x39')]['limit']);_0x3a020a[_0xfb94('0x22')]=qs[_0xfb94('0x22')](_0x3adbe0[_0xfb94('0x39')][_0xfb94('0x22')]);}return _0x1b362a[_0xfb94('0x7b')](_0x3a020a);}})[_0xfb94('0x2b')](function(_0xc8bacd){if(_0xc8bacd){return _0xc8bacd?{'count':_0x14ae1b,'rows':_0xc8bacd}:null;}})[_0xfb94('0x2b')](respondWithResult(_0x22af6f,null))['catch'](handleError(_0x22af6f,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index b545da8..f77f357 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 _0xa909=['../../mysqldb','Dashboard','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x85a751,_0x406baf){var _0x5ec101=function(_0x53f6b4){while(--_0x53f6b4){_0x85a751['push'](_0x85a751['shift']());}};_0x5ec101(++_0x406baf);}(_0xa909,0x95));var _0x9a90=function(_0x5d21c0,_0x288257){_0x5d21c0=_0x5d21c0-0x0;var _0x33ef40=_0xa909[_0x5d21c0];return _0x33ef40;};'use strict';var EventEmitter=require(_0x9a90('0x0'));var Dashboard=require(_0x9a90('0x1'))['db'][_0x9a90('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9a90('0x3'),'afterUpdate':_0x9a90('0x4'),'afterDestroy':_0x9a90('0x5')};function emitEvent(_0x43d9e8){return function(_0x5ad5b3,_0xa6810,_0x4ba0f8){DashboardEvents[_0x9a90('0x6')](_0x43d9e8+':'+_0x5ad5b3['id'],_0x5ad5b3);DashboardEvents[_0x9a90('0x6')](_0x43d9e8,_0x5ad5b3);_0x4ba0f8(null);};}for(var e in events){if(events[_0x9a90('0x7')](e)){var event=events[e];Dashboard[_0x9a90('0x8')](e,emitEvent(event));}}module[_0x9a90('0x9')]=DashboardEvents; \ No newline at end of file +var _0x8ebd=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','Dashboard','save'];(function(_0x2dae26,_0x4208a7){var _0x59f49b=function(_0x1f9718){while(--_0x1f9718){_0x2dae26['push'](_0x2dae26['shift']());}};_0x59f49b(++_0x4208a7);}(_0x8ebd,0x16d));var _0xd8eb=function(_0x4fde08,_0x463a36){_0x4fde08=_0x4fde08-0x0;var _0x12e725=_0x8ebd[_0x4fde08];return _0x12e725;};'use strict';var EventEmitter=require(_0xd8eb('0x0'));var Dashboard=require(_0xd8eb('0x1'))['db'][_0xd8eb('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xd8eb('0x3'),'afterUpdate':'update','afterDestroy':_0xd8eb('0x4')};function emitEvent(_0x211f1e){return function(_0x2374b4,_0x3d3bdf,_0x17e849){DashboardEvents[_0xd8eb('0x5')](_0x211f1e+':'+_0x2374b4['id'],_0x2374b4);DashboardEvents[_0xd8eb('0x5')](_0x211f1e,_0x2374b4);_0x17e849(null);};}for(var e in events){if(events[_0xd8eb('0x6')](e)){var event=events[e];Dashboard[_0xd8eb('0x7')](e,emitEvent(event));}}module[_0xd8eb('0x8')]=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index da8c353..3684670 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 _0x5f7a=['path','rimraf','../../config/environment','exports','define','Dashboard','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x5f7a,0x88));var _0xa5f7=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x5f7a[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0xa5f7('0x0'));var util=require(_0xa5f7('0x1'));var logger=require(_0xa5f7('0x2'))(_0xa5f7('0x3'));var moment=require(_0xa5f7('0x4'));var BPromise=require(_0xa5f7('0x5'));var rp=require(_0xa5f7('0x6'));var fs=require('fs');var path=require(_0xa5f7('0x7'));var rimraf=require(_0xa5f7('0x8'));var config=require(_0xa5f7('0x9'));var attributes=require('./dashboard.attributes');module[_0xa5f7('0xa')]=function(_0x35fb56,_0x314571){return _0x35fb56[_0xa5f7('0xb')](_0xa5f7('0xc'),attributes,{'tableName':'dashboards','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x276e=['rimraf','./dashboard.attributes','define','Dashboard','dashboards','lodash','util','../../config/logger','moment','bluebird','path'];(function(_0x52f385,_0x26265d){var _0xea58c8=function(_0x37a52e){while(--_0x37a52e){_0x52f385['push'](_0x52f385['shift']());}};_0xea58c8(++_0x26265d);}(_0x276e,0xec));var _0xe276=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0x276e[_0x47e7cb];return _0x2a8874;};'use strict';var _=require(_0xe276('0x0'));var util=require(_0xe276('0x1'));var logger=require(_0xe276('0x2'))('api');var moment=require(_0xe276('0x3'));var BPromise=require(_0xe276('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe276('0x5'));var rimraf=require(_0xe276('0x6'));var config=require('../../config/environment');var attributes=require(_0xe276('0x7'));module['exports']=function(_0x572bea,_0x216565){return _0x572bea[_0xe276('0x8')](_0xe276('0x9'),attributes,{'tableName':_0xe276('0xa'),'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 ef5ce7c..16c9300 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 _0xcec2=['Dashboard,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','defaults','redis','socket.io-emitter','./dashboard.socket','register','request','then','info'];(function(_0x74a76c,_0x87c60d){var _0x3d8e25=function(_0x17fa8b){while(--_0x17fa8b){_0x74a76c['push'](_0x74a76c['shift']());}};_0x3d8e25(++_0x87c60d);}(_0xcec2,0xd8));var _0x2cec=function(_0x3cfb25,_0x5d88e9){_0x3cfb25=_0x3cfb25-0x0;var _0x388a2b=_0xcec2[_0x3cfb25];return _0x388a2b;};'use strict';var _=require(_0x2cec('0x0'));var util=require('util');var moment=require(_0x2cec('0x1'));var BPromise=require(_0x2cec('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2cec('0x3'));var db=require(_0x2cec('0x4'))['db'];var utils=require(_0x2cec('0x5'));var logger=require(_0x2cec('0x6'))('rpc');var config=require(_0x2cec('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x2cec('0x8')][_0x2cec('0x9')]({'port':0x232a});config['redis']=_[_0x2cec('0xa')](config[_0x2cec('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x2cec('0xc'))(new Redis(config[_0x2cec('0xb')]));require(_0x2cec('0xd'))[_0x2cec('0xe')](socket);function respondWithRpcPromise(_0x2d4e4e,_0x4afcf6,_0x3acff4){return new BPromise(function(_0x49f2cd,_0x32fea1){return client[_0x2cec('0xf')](_0x2d4e4e,_0x3acff4)[_0x2cec('0x10')](function(_0x37b40c){logger[_0x2cec('0x11')](_0x2cec('0x12'),_0x4afcf6,_0x2cec('0x13'));logger[_0x2cec('0x14')]('Dashboard,\x20%s,\x20%s,\x20%s',_0x4afcf6,_0x2cec('0x13'),JSON[_0x2cec('0x15')](_0x37b40c));if(_0x37b40c[_0x2cec('0x16')]){if(_0x37b40c[_0x2cec('0x16')][_0x2cec('0x17')]===0x1f4){logger[_0x2cec('0x16')](_0x2cec('0x12'),_0x4afcf6,_0x37b40c[_0x2cec('0x16')][_0x2cec('0x18')]);return _0x32fea1(_0x37b40c[_0x2cec('0x16')][_0x2cec('0x18')]);}logger[_0x2cec('0x16')](_0x2cec('0x12'),_0x4afcf6,_0x37b40c[_0x2cec('0x16')]['message']);return _0x49f2cd(_0x37b40c[_0x2cec('0x16')][_0x2cec('0x18')]);}else{logger[_0x2cec('0x11')](_0x2cec('0x12'),_0x4afcf6,_0x2cec('0x13'));_0x49f2cd(_0x37b40c[_0x2cec('0x19')]['message']);}})['catch'](function(_0x36fc14){logger['error'](_0x2cec('0x12'),_0x4afcf6,_0x36fc14);_0x32fea1(_0x36fc14);});});} \ No newline at end of file +var _0x0a2e=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./dashboard.socket','request','then','info','Dashboard,\x20%s,\x20%s','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util'];(function(_0x402731,_0x43c115){var _0x111736=function(_0x5a7044){while(--_0x5a7044){_0x402731['push'](_0x402731['shift']());}};_0x111736(++_0x43c115);}(_0x0a2e,0x14e));var _0xe0a2=function(_0x70fd53,_0x2a95a6){_0x70fd53=_0x70fd53-0x0;var _0x4b71c5=_0x0a2e[_0x70fd53];return _0x4b71c5;};'use strict';var _=require(_0xe0a2('0x0'));var util=require(_0xe0a2('0x1'));var moment=require(_0xe0a2('0x2'));var BPromise=require(_0xe0a2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe0a2('0x4'));var db=require(_0xe0a2('0x5'))['db'];var utils=require(_0xe0a2('0x6'));var logger=require(_0xe0a2('0x7'))(_0xe0a2('0x8'));var config=require(_0xe0a2('0x9'));var jayson=require(_0xe0a2('0xa'));var client=jayson['client'][_0xe0a2('0xb')]({'port':0x232a});config[_0xe0a2('0xc')]=_['defaults'](config[_0xe0a2('0xc')],{'host':_0xe0a2('0xd'),'port':0x18eb});var socket=require(_0xe0a2('0xe'))(new Redis(config[_0xe0a2('0xc')]));require(_0xe0a2('0xf'))['register'](socket);function respondWithRpcPromise(_0xb9b5a1,_0x334850,_0x353108){return new BPromise(function(_0x53396c,_0x437be4){return client[_0xe0a2('0x10')](_0xb9b5a1,_0x353108)[_0xe0a2('0x11')](function(_0x3a3214){logger[_0xe0a2('0x12')](_0xe0a2('0x13'),_0x334850,_0xe0a2('0x14'));logger[_0xe0a2('0x15')](_0xe0a2('0x16'),_0x334850,_0xe0a2('0x14'),JSON[_0xe0a2('0x17')](_0x3a3214));if(_0x3a3214['error']){if(_0x3a3214[_0xe0a2('0x18')]['code']===0x1f4){logger['error'](_0xe0a2('0x13'),_0x334850,_0x3a3214[_0xe0a2('0x18')][_0xe0a2('0x19')]);return _0x437be4(_0x3a3214[_0xe0a2('0x18')][_0xe0a2('0x19')]);}logger['error'](_0xe0a2('0x13'),_0x334850,_0x3a3214['error']['message']);return _0x53396c(_0x3a3214['error']['message']);}else{logger[_0xe0a2('0x12')](_0xe0a2('0x13'),_0x334850,_0xe0a2('0x14'));_0x53396c(_0x3a3214[_0xe0a2('0x1a')]['message']);}})[_0xe0a2('0x1b')](function(_0x10c38c){logger['error'](_0xe0a2('0x13'),_0x334850,_0x10c38c);_0x437be4(_0x10c38c);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index 9b8e40f..e41b3f6 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 _0xbd72=['update','register','length','dashboard:','save'];(function(_0x21c614,_0x1644ac){var _0x2cac53=function(_0x250086){while(--_0x250086){_0x21c614['push'](_0x21c614['shift']());}};_0x2cac53(++_0x1644ac);}(_0xbd72,0xf9));var _0x2bd7=function(_0x2714ec,_0x36daa4){_0x2714ec=_0x2714ec-0x0;var _0x2608e5=_0xbd72[_0x2714ec];return _0x2608e5;};'use strict';var DashboardEvents=require('./dashboard.events');var events=[_0x2bd7('0x0'),'remove',_0x2bd7('0x1')];function createListener(_0x1e0ad8,_0x46df76){return function(_0x5a7a13){_0x46df76['emit'](_0x1e0ad8,_0x5a7a13);};}function removeListener(_0x5cfcd5,_0xc279d2){return function(){DashboardEvents['removeListener'](_0x5cfcd5,_0xc279d2);};}exports[_0x2bd7('0x2')]=function(_0x25871a){for(var _0x26bfce=0x0,_0x158d48=events[_0x2bd7('0x3')];_0x26bfce<_0x158d48;_0x26bfce++){var _0x804ebd=events[_0x26bfce];var _0x492d59=createListener(_0x2bd7('0x4')+_0x804ebd,_0x25871a);DashboardEvents['on'](_0x804ebd,_0x492d59);}}; \ No newline at end of file +var _0x37d9=['removeListener','register','length','dashboard:','./dashboard.events','save','update','emit'];(function(_0x5de2a9,_0x37004a){var _0x27c8be=function(_0x3614fd){while(--_0x3614fd){_0x5de2a9['push'](_0x5de2a9['shift']());}};_0x27c8be(++_0x37004a);}(_0x37d9,0xb4));var _0x937d=function(_0x13663e,_0x32a740){_0x13663e=_0x13663e-0x0;var _0x51694c=_0x37d9[_0x13663e];return _0x51694c;};'use strict';var DashboardEvents=require(_0x937d('0x0'));var events=[_0x937d('0x1'),'remove',_0x937d('0x2')];function createListener(_0x371c08,_0x22cd63){return function(_0x102f53){_0x22cd63[_0x937d('0x3')](_0x371c08,_0x102f53);};}function removeListener(_0x3c3564,_0x5e33d3){return function(){DashboardEvents[_0x937d('0x4')](_0x3c3564,_0x5e33d3);};}exports[_0x937d('0x5')]=function(_0x2a108e){for(var _0x5b935f=0x0,_0x4ed6e5=events[_0x937d('0x6')];_0x5b935f<_0x4ed6e5;_0x5b935f++){var _0x34ee67=events[_0x5b935f];var _0x23716d=createListener(_0x937d('0x7')+_0x34ee67,_0x2a108e);DashboardEvents['on'](_0x34ee67,_0x23716d);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index 406ecf9..851fe5d 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 _0x0f77=['destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboard.controller','get','/:id','isAuthenticated','show','/:id/items','getItems','post','create','/:id/clone','clone','addItem','put','delete'];(function(_0x4360c9,_0x69b183){var _0x4846dd=function(_0x12d760){while(--_0x12d760){_0x4360c9['push'](_0x4360c9['shift']());}};_0x4846dd(++_0x69b183);}(_0x0f77,0x65));var _0x70f7=function(_0x2ed60b,_0x216d5e){_0x2ed60b=_0x2ed60b-0x0;var _0x68a427=_0x0f77[_0x2ed60b];return _0x68a427;};'use strict';var multer=require(_0x70f7('0x0'));var util=require(_0x70f7('0x1'));var path=require(_0x70f7('0x2'));var timeout=require(_0x70f7('0x3'));var express=require(_0x70f7('0x4'));var router=express[_0x70f7('0x5')]();var fs_extra=require(_0x70f7('0x6'));var auth=require(_0x70f7('0x7'));var interaction=require(_0x70f7('0x8'));var config=require(_0x70f7('0x9'));var controller=require(_0x70f7('0xa'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x70f7('0xb')](_0x70f7('0xc'),auth[_0x70f7('0xd')](),controller[_0x70f7('0xe')]);router[_0x70f7('0xb')](_0x70f7('0xf'),auth[_0x70f7('0xd')](),controller[_0x70f7('0x10')]);router[_0x70f7('0x11')]('/',auth[_0x70f7('0xd')](),controller[_0x70f7('0x12')]);router['post'](_0x70f7('0x13'),auth['isAuthenticated'](),controller[_0x70f7('0x14')]);router[_0x70f7('0x11')](_0x70f7('0xf'),auth[_0x70f7('0xd')](),controller[_0x70f7('0x15')]);router[_0x70f7('0x16')](_0x70f7('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x70f7('0x17')](_0x70f7('0xc'),auth[_0x70f7('0xd')](),controller[_0x70f7('0x18')]);module['exports']=router; \ No newline at end of file +var _0xba27=['/:id/clone','post','addItem','put','/:id','update','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','show','/:id/items','getItems','create'];(function(_0x25dbfe,_0x41c774){var _0x13d34f=function(_0x110986){while(--_0x110986){_0x25dbfe['push'](_0x25dbfe['shift']());}};_0x13d34f(++_0x41c774);}(_0xba27,0x125));var _0x7ba2=function(_0x3918a3,_0x3e3db8){_0x3918a3=_0x3918a3-0x0;var _0x4f252f=_0xba27[_0x3918a3];return _0x4f252f;};'use strict';var multer=require(_0x7ba2('0x0'));var util=require(_0x7ba2('0x1'));var path=require(_0x7ba2('0x2'));var timeout=require(_0x7ba2('0x3'));var express=require(_0x7ba2('0x4'));var router=express[_0x7ba2('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x7ba2('0x6'));var interaction=require(_0x7ba2('0x7'));var config=require(_0x7ba2('0x8'));var controller=require('./dashboard.controller');router['get']('/',auth[_0x7ba2('0x9')](),controller['index']);router[_0x7ba2('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x7ba2('0xb')]);router['get'](_0x7ba2('0xc'),auth[_0x7ba2('0x9')](),controller[_0x7ba2('0xd')]);router['post']('/',auth[_0x7ba2('0x9')](),controller[_0x7ba2('0xe')]);router['post'](_0x7ba2('0xf'),auth['isAuthenticated'](),controller['clone']);router[_0x7ba2('0x10')]('/:id/items',auth[_0x7ba2('0x9')](),controller[_0x7ba2('0x11')]);router[_0x7ba2('0x12')](_0x7ba2('0x13'),auth[_0x7ba2('0x9')](),controller[_0x7ba2('0x14')]);router['delete']('/:id',auth[_0x7ba2('0x9')](),controller['destroy']);module[_0x7ba2('0x15')]=router; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index fa1a281..2aeaaf4 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 _0x53ec=['getDataValue','attrs','stringify','setDataValue','INTEGER','#ffffff','sequelize','squel','lodash','exports','STRING','long'];(function(_0x4b2494,_0x494d41){var _0x2c1436=function(_0x3eaf82){while(--_0x3eaf82){_0x4b2494['push'](_0x4b2494['shift']());}};_0x2c1436(++_0x494d41);}(_0x53ec,0x192));var _0xc53e=function(_0x4f027d,_0x3f9587){_0x4f027d=_0x4f027d-0x0;var _0xc46890=_0x53ec[_0x4f027d];return _0xc46890;};'use strict';var Sequelize=require(_0xc53e('0x0'));var squel=require(_0xc53e('0x1'));var _=require(_0xc53e('0x2'));module[_0xc53e('0x3')]={'title':{'type':Sequelize[_0xc53e('0x4')],'allowNull':![]},'type':{'type':Sequelize[_0xc53e('0x4')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize['TEXT'](_0xc53e('0x5')),'get':function(){try{return JSON['parse'](this[_0xc53e('0x6')](_0xc53e('0x7')));}catch(_0x4a9c59){return[];}},'set':function(_0x2f1414){try{this['setDataValue'](_0xc53e('0x7'),JSON[_0xc53e('0x8')](_0x2f1414));}catch(_0x5d3b28){this[_0xc53e('0x9')](_0xc53e('0x7'),JSON[_0xc53e('0x8')]([]));}}},'sizeX':{'type':Sequelize[_0xc53e('0xa')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0xc53e('0xa')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0xc53e('0xa')]},'col':{'type':Sequelize[_0xc53e('0xa')]},'background':{'type':Sequelize[_0xc53e('0x4')],'allowNull':![],'defaultValue':_0xc53e('0xb'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#2196f3','validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0xc53e('0x4')]},'titleFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc}}; \ No newline at end of file +var _0x01d9=['INTEGER','#ffffff','#2196f3','sequelize','squel','lodash','exports','STRING','TEXT','long','parse','getDataValue','attrs','setDataValue','stringify'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x01d9,0x6c));var _0x901d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x01d9[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x901d('0x0'));var squel=require(_0x901d('0x1'));var _=require(_0x901d('0x2'));module[_0x901d('0x3')]={'title':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x901d('0x4')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x901d('0x5')](_0x901d('0x6')),'get':function(){try{return JSON[_0x901d('0x7')](this[_0x901d('0x8')](_0x901d('0x9')));}catch(_0xb96b86){return[];}},'set':function(_0x4e7842){try{this[_0x901d('0xa')](_0x901d('0x9'),JSON[_0x901d('0xb')](_0x4e7842));}catch(_0x12c39f){this[_0x901d('0xa')](_0x901d('0x9'),JSON[_0x901d('0xb')]([]));}}},'sizeX':{'type':Sequelize[_0x901d('0xc')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x901d('0xc')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x901d('0xc')]},'col':{'type':Sequelize[_0x901d('0xc')]},'background':{'type':Sequelize[_0x901d('0x4')],'allowNull':![],'defaultValue':_0x901d('0xd'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x901d('0xe'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize['STRING']},'titleFontSize':{'type':Sequelize[_0x901d('0xc')],'defaultValue':0xc}}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.controller.js b/server/api/dashboardItem/dashboardItem.controller.js index 00db952..11b6f6b 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 _0xa845=['moment','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../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','./dashboardItem.socket','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','error','stack','name','send','show','params','model','query','keys','intersection','fields','attributes','length','includeAll','merge','options','DashboardItem','find','catch','type','iframe','attrUrl','attrs','value','attrPath','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','attrVoiceQueues','multibar-chart','pie-chart','total','attrSerie2','attrSerie3','reportType','attrRefresh','widgetAttributes:\x20%s','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise'];(function(_0x411b54,_0x47ce64){var _0x1f1dbe=function(_0x19218a){while(--_0x19218a){_0x411b54['push'](_0x411b54['shift']());}};_0x1f1dbe(++_0x47ce64);}(_0xa845,0x163));var _0x5a84=function(_0x5017af,_0x300c05){_0x5017af=_0x5017af-0x0;var _0x521a1a=_0xa845[_0x5017af];return _0x521a1a;};'use strict';var emlformat=require(_0x5a84('0x0'));var rimraf=require(_0x5a84('0x1'));var zipdir=require(_0x5a84('0x2'));var jsonpatch=require(_0x5a84('0x3'));var rp=require(_0x5a84('0x4'));var moment=require(_0x5a84('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x5a84('0x6'));var util=require(_0x5a84('0x7'));var path=require(_0x5a84('0x8'));var sox=require(_0x5a84('0x9'));var csv=require('to-csv');var ejs=require(_0x5a84('0xa'));var fs=require('fs');var fs_extra=require(_0x5a84('0xb'));var _=require(_0x5a84('0xc'));var squel=require(_0x5a84('0xd'));var crypto=require(_0x5a84('0xe'));var jsforce=require(_0x5a84('0xf'));var deskjs=require(_0x5a84('0x10'));var toCsv=require(_0x5a84('0x11'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x5a84('0x12'));var authService=require(_0x5a84('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x5a84('0x14'));var hardwareService=require(_0x5a84('0x15'));var logger=require(_0x5a84('0x16'))(_0x5a84('0x17'));var utils=require(_0x5a84('0x18'));var config=require(_0x5a84('0x19'));var licenseUtil=require(_0x5a84('0x1a'));var db=require(_0x5a84('0x1b'))['db'];config[_0x5a84('0x1c')]=_['defaults'](config[_0x5a84('0x1c')],{'host':_0x5a84('0x1d'),'port':0x18eb});var socket=require(_0x5a84('0x1e'))(new Redis(config[_0x5a84('0x1c')]));require(_0x5a84('0x1f'))['register'](socket);function respondWithStatusCode(_0x211c6d,_0x3e5203){_0x3e5203=_0x3e5203||0xcc;return function(_0x4885a2){if(_0x4885a2){return _0x211c6d[_0x5a84('0x20')](_0x3e5203);}return _0x211c6d[_0x5a84('0x21')](_0x3e5203)[_0x5a84('0x22')]();};}function respondWithResult(_0x3fc079,_0x29a8a1){_0x29a8a1=_0x29a8a1||0xc8;return function(_0x2e9f8c){if(_0x2e9f8c){return _0x3fc079[_0x5a84('0x21')](_0x29a8a1)[_0x5a84('0x23')](_0x2e9f8c);}};}function respondWithFilteredResult(_0x350c7f,_0x1decc9){return function(_0x4277eb){if(_0x4277eb){var _0x1c80a0=typeof _0x1decc9[_0x5a84('0x24')]===_0x5a84('0x25')&&typeof _0x1decc9[_0x5a84('0x26')]===_0x5a84('0x25');var _0x280f74=_0x4277eb[_0x5a84('0x27')];var _0x39bfe0=_0x1c80a0?0x0:_0x1decc9[_0x5a84('0x24')];var _0x16a3d6=_0x1c80a0?_0x4277eb['count']:_0x1decc9[_0x5a84('0x24')]+_0x1decc9[_0x5a84('0x26')];var _0x49bcf6;if(_0x16a3d6>=_0x280f74){_0x16a3d6=_0x280f74;_0x49bcf6=0xc8;}else{_0x49bcf6=0xce;}_0x350c7f['status'](_0x49bcf6);return _0x350c7f[_0x5a84('0x28')]('Content-Range',_0x39bfe0+'-'+_0x16a3d6+'/'+_0x280f74)['json'](_0x4277eb);}return null;};}function patchUpdates(_0x14eb61){return function(_0x5d8816){try{jsonpatch[_0x5a84('0x29')](_0x5d8816,_0x14eb61,!![]);}catch(_0x478c86){return BPromise[_0x5a84('0x2a')](_0x478c86);}return _0x5d8816[_0x5a84('0x2b')]();};}function saveUpdates(_0x38ebac,_0x2e7866){return function(_0x343736){if(_0x343736){return _0x343736[_0x5a84('0x2c')](_0x38ebac)[_0x5a84('0x2d')](function(_0x4690fa){return _0x4690fa;});}return null;};}function removeEntity(_0x295461,_0x17ac6a){return function(_0x4e5b23){if(_0x4e5b23){return _0x4e5b23[_0x5a84('0x2e')]()[_0x5a84('0x2d')](function(){_0x295461[_0x5a84('0x21')](0xcc)[_0x5a84('0x22')]();});}};}function handleEntityNotFound(_0x3b03c0,_0x50b39e){return function(_0xde04e4){if(!_0xde04e4){_0x3b03c0[_0x5a84('0x20')](0x194);}return _0xde04e4;};}function handleError(_0x20a5dc,_0xe899a5){_0xe899a5=_0xe899a5||0x1f4;return function(_0x1e1c1b){logger[_0x5a84('0x2f')](_0x1e1c1b[_0x5a84('0x30')]);if(_0x1e1c1b[_0x5a84('0x31')]){delete _0x1e1c1b[_0x5a84('0x31')];}_0x20a5dc['status'](_0xe899a5)[_0x5a84('0x32')](_0x1e1c1b);};}exports[_0x5a84('0x33')]=function(_0x3d30b6,_0x4a506b){var _0x3e2c8e={'raw':![],'where':{'id':_0x3d30b6[_0x5a84('0x34')]['id']}},_0x3633c1={};_0x3633c1[_0x5a84('0x35')]=_['keys'](db['DashboardItem']['rawAttributes']);_0x3633c1[_0x5a84('0x36')]=_[_0x5a84('0x37')](_0x3d30b6[_0x5a84('0x36')]);_0x3633c1['filters']=_[_0x5a84('0x38')](_0x3633c1['model'],_0x3633c1['query']);_0x3e2c8e['attributes']=_[_0x5a84('0x38')](_0x3633c1['model'],qs[_0x5a84('0x39')](_0x3d30b6[_0x5a84('0x36')][_0x5a84('0x39')]));_0x3e2c8e['attributes']=_0x3e2c8e[_0x5a84('0x3a')][_0x5a84('0x3b')]?_0x3e2c8e[_0x5a84('0x3a')]:_0x3633c1[_0x5a84('0x35')];if(_0x3d30b6[_0x5a84('0x36')][_0x5a84('0x3c')]){_0x3e2c8e['include']=[{'all':!![]}];}_0x3e2c8e=_[_0x5a84('0x3d')]({},_0x3e2c8e,_0x3d30b6[_0x5a84('0x3e')]);return db[_0x5a84('0x3f')][_0x5a84('0x40')](_0x3e2c8e)[_0x5a84('0x2d')](handleEntityNotFound(_0x4a506b,null))[_0x5a84('0x2d')](respondWithResult(_0x4a506b,null))['catch'](handleError(_0x4a506b,null));};exports[_0x5a84('0x2e')]=function(_0x3fb659,_0x4f33e9){return db[_0x5a84('0x3f')][_0x5a84('0x40')]({'where':{'id':_0x3fb659[_0x5a84('0x34')]['id']}})['then'](handleEntityNotFound(_0x4f33e9,null))[_0x5a84('0x2d')](removeEntity(_0x4f33e9,null))[_0x5a84('0x41')](handleError(_0x4f33e9,null));};function widgetAttributes(_0x3e852d){try{switch(_0x3e852d[_0x5a84('0x42')]){case _0x5a84('0x43'):return[{'name':_0x5a84('0x44'),'value':_0x3e852d[_0x5a84('0x44')]||(_0x3e852d[_0x5a84('0x45')]&&_0x3e852d[_0x5a84('0x45')][0x0]?_0x3e852d[_0x5a84('0x45')][0x0][_0x5a84('0x46')]:undefined)||'https://'}];case'custom':return[{'name':'attrPath','value':_0x3e852d[_0x5a84('0x47')]||(_0x3e852d['attrs']&&_0x3e852d['attrs'][0x0]?_0x3e852d[_0x5a84('0x45')][0x0]['value']:undefined)||''}];case'clock':return[{'name':_0x5a84('0x48'),'value':_0x3e852d[_0x5a84('0x48')]||(_0x3e852d[_0x5a84('0x45')]&&_0x3e852d[_0x5a84('0x45')][0x0]?_0x3e852d[_0x5a84('0x45')][0x0]['value']:undefined)||_0x5a84('0x49')},{'name':'attrTimezone','value':_0x3e852d[_0x5a84('0x4a')]||(_0x3e852d[_0x5a84('0x45')]&&_0x3e852d[_0x5a84('0x45')][0x1]?_0x3e852d['attrs'][0x1][_0x5a84('0x46')]:undefined)||_0x5a84('0x4b')},{'name':_0x5a84('0x4c'),'value':_0x3e852d[_0x5a84('0x4c')]||(_0x3e852d[_0x5a84('0x45')]&&_0x3e852d[_0x5a84('0x45')][0x2]?_0x3e852d[_0x5a84('0x45')][0x2][_0x5a84('0x46')]:undefined)||0xc}];case _0x5a84('0x4d'):return[{'name':'attrMetric','value':_0x3e852d[_0x5a84('0x4e')]||(_0x3e852d[_0x5a84('0x45')]&&_0x3e852d[_0x5a84('0x45')][0x0]?_0x3e852d[_0x5a84('0x45')][0x0][_0x5a84('0x46')]:undefined)||'total'},{'name':_0x5a84('0x4f'),'value':_0x3e852d[_0x5a84('0x4f')]||(_0x3e852d[_0x5a84('0x45')]&&_0x3e852d[_0x5a84('0x45')][0x1]?_0x3e852d[_0x5a84('0x45')][0x1][_0x5a84('0x46')]:undefined)||[]},{'name':_0x5a84('0x4c'),'value':_0x3e852d[_0x5a84('0x4c')]||(_0x3e852d[_0x5a84('0x45')]&&_0x3e852d[_0x5a84('0x45')][0x2]?_0x3e852d[_0x5a84('0x45')][0x2][_0x5a84('0x46')]:undefined)||0x14}];case _0x5a84('0x50'):case _0x5a84('0x51'):return[{'name':'attrSerie1','value':_0x3e852d['attrSerie1']||(_0x3e852d['attrs']&&_0x3e852d[_0x5a84('0x45')][0x0]?_0x3e852d['attrs'][0x0][_0x5a84('0x46')]:undefined)||_0x5a84('0x52')},{'name':_0x5a84('0x53'),'value':_0x3e852d[_0x5a84('0x53')]||(_0x3e852d[_0x5a84('0x45')]&&_0x3e852d[_0x5a84('0x45')][0x1]?_0x3e852d[_0x5a84('0x45')][0x1]['value']:undefined)||null},{'name':_0x5a84('0x54'),'value':_0x3e852d[_0x5a84('0x54')]||(_0x3e852d[_0x5a84('0x45')]&&_0x3e852d['attrs'][0x2]?_0x3e852d[_0x5a84('0x45')][0x2][_0x5a84('0x46')]:undefined)||null},{'name':_0x5a84('0x4f'),'value':_0x3e852d[_0x5a84('0x4f')]||(_0x3e852d[_0x5a84('0x45')]&&_0x3e852d[_0x5a84('0x45')][0x3]?_0x3e852d[_0x5a84('0x45')][0x3][_0x5a84('0x46')]:undefined)||[]}];case'web-report':return[{'name':'attrReport','type':_0x3e852d[_0x5a84('0x55')]||(_0x3e852d['attrs']&&_0x3e852d[_0x5a84('0x45')][0x0]?_0x3e852d[_0x5a84('0x45')][0x0][_0x5a84('0x42')]:undefined)||null,'value':_0x3e852d['attrReport']||(_0x3e852d[_0x5a84('0x45')]&&_0x3e852d['attrs'][0x0]?_0x3e852d[_0x5a84('0x45')][0x0][_0x5a84('0x46')]:undefined)||null},{'name':_0x5a84('0x56'),'value':_0x3e852d[_0x5a84('0x56')]||(_0x3e852d[_0x5a84('0x45')]&&_0x3e852d[_0x5a84('0x45')][0x1]?_0x3e852d[_0x5a84('0x45')][0x1][_0x5a84('0x46')]:undefined)||0x0}];default:return[];}}catch(_0x47ca04){logger['error'](_0x5a84('0x57'),JSON['stringify'](_0x47ca04));return[];}}exports[_0x5a84('0x58')]=function(_0x24b617,_0x2365f5){if(_0x24b617[_0x5a84('0x59')]){_0x24b617[_0x5a84('0x59')][_0x5a84('0x45')]=widgetAttributes(_0x24b617[_0x5a84('0x59')]);}return db['DashboardItem'][_0x5a84('0x58')](_0x24b617['body'],{})[_0x5a84('0x2d')](respondWithResult(_0x2365f5,0xc9))[_0x5a84('0x41')](handleError(_0x2365f5,null));};exports['update']=function(_0x3d7c7d,_0x43f5b2){if(_0x3d7c7d['body']['id']){delete _0x3d7c7d[_0x5a84('0x59')]['id'];}_0x3d7c7d['body'][_0x5a84('0x45')]=widgetAttributes(_0x3d7c7d[_0x5a84('0x59')]);return db[_0x5a84('0x3f')][_0x5a84('0x40')]({'where':{'id':_0x3d7c7d[_0x5a84('0x34')]['id']}})[_0x5a84('0x2d')](handleEntityNotFound(_0x43f5b2,null))[_0x5a84('0x2d')](saveUpdates(_0x3d7c7d['body'],null))['then'](respondWithResult(_0x43f5b2,null))['catch'](handleError(_0x43f5b2,null));}; \ No newline at end of file +var _0x0537=['../../mysqldb','redis','localhost','socket.io-emitter','register','status','end','json','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','show','params','model','keys','rawAttributes','query','filters','intersection','fields','attributes','length','includeAll','merge','options','DashboardItem','find','catch','type','iframe','attrUrl','attrs','value','https://','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','attrVoiceQueues','attrSerie1','total','attrSerie2','attrSerie3','web-report','reportType','attrReport','attrRefresh','error','widgetAttributes:\x20%s','body','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x31c588,_0x1adc0c){var _0x1cde9d=function(_0x5f28bd){while(--_0x5f28bd){_0x31c588['push'](_0x31c588['shift']());}};_0x1cde9d(++_0x1adc0c);}(_0x0537,0xf0));var _0x7053=function(_0x2fe5f0,_0x576333){_0x2fe5f0=_0x2fe5f0-0x0;var _0x5bae6b=_0x0537[_0x2fe5f0];return _0x5bae6b;};'use strict';var emlformat=require(_0x7053('0x0'));var rimraf=require(_0x7053('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7053('0x2'));var rp=require(_0x7053('0x3'));var moment=require(_0x7053('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x7053('0x5'));var util=require(_0x7053('0x6'));var path=require('path');var sox=require(_0x7053('0x7'));var csv=require(_0x7053('0x8'));var ejs=require(_0x7053('0x9'));var fs=require('fs');var fs_extra=require(_0x7053('0xa'));var _=require('lodash');var squel=require(_0x7053('0xb'));var crypto=require(_0x7053('0xc'));var jsforce=require(_0x7053('0xd'));var deskjs=require(_0x7053('0xe'));var toCsv=require('to-csv');var querystring=require(_0x7053('0xf'));var Papa=require(_0x7053('0x10'));var Redis=require(_0x7053('0x11'));var authService=require(_0x7053('0x12'));var qs=require(_0x7053('0x13'));var as=require(_0x7053('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x7053('0x15'));var config=require(_0x7053('0x16'));var licenseUtil=require(_0x7053('0x17'));var db=require(_0x7053('0x18'))['db'];config[_0x7053('0x19')]=_['defaults'](config['redis'],{'host':_0x7053('0x1a'),'port':0x18eb});var socket=require(_0x7053('0x1b'))(new Redis(config['redis']));require('./dashboardItem.socket')[_0x7053('0x1c')](socket);function respondWithStatusCode(_0x5335cd,_0x35dc6e){_0x35dc6e=_0x35dc6e||0xcc;return function(_0x939ecd){if(_0x939ecd){return _0x5335cd['sendStatus'](_0x35dc6e);}return _0x5335cd[_0x7053('0x1d')](_0x35dc6e)[_0x7053('0x1e')]();};}function respondWithResult(_0x4cff88,_0xb4278c){_0xb4278c=_0xb4278c||0xc8;return function(_0x24bf37){if(_0x24bf37){return _0x4cff88[_0x7053('0x1d')](_0xb4278c)[_0x7053('0x1f')](_0x24bf37);}};}function respondWithFilteredResult(_0xb2841a,_0x1477ba){return function(_0xc0e6fd){if(_0xc0e6fd){var _0x423d95=typeof _0x1477ba['offset']===_0x7053('0x20')&&typeof _0x1477ba[_0x7053('0x21')]===_0x7053('0x20');var _0x10fb08=_0xc0e6fd[_0x7053('0x22')];var _0x148255=_0x423d95?0x0:_0x1477ba['offset'];var _0x284d36=_0x423d95?_0xc0e6fd[_0x7053('0x22')]:_0x1477ba['offset']+_0x1477ba[_0x7053('0x21')];var _0x5c24a9;if(_0x284d36>=_0x10fb08){_0x284d36=_0x10fb08;_0x5c24a9=0xc8;}else{_0x5c24a9=0xce;}_0xb2841a[_0x7053('0x1d')](_0x5c24a9);return _0xb2841a['set'](_0x7053('0x23'),_0x148255+'-'+_0x284d36+'/'+_0x10fb08)[_0x7053('0x1f')](_0xc0e6fd);}return null;};}function patchUpdates(_0x3384d4){return function(_0xdfadda){try{jsonpatch[_0x7053('0x24')](_0xdfadda,_0x3384d4,!![]);}catch(_0x2aa948){return BPromise[_0x7053('0x25')](_0x2aa948);}return _0xdfadda[_0x7053('0x26')]();};}function saveUpdates(_0x2af697,_0x2dacff){return function(_0x5c7fe4){if(_0x5c7fe4){return _0x5c7fe4[_0x7053('0x27')](_0x2af697)[_0x7053('0x28')](function(_0x892c94){return _0x892c94;});}return null;};}function removeEntity(_0x584725,_0x16e8d7){return function(_0x1072f1){if(_0x1072f1){return _0x1072f1[_0x7053('0x29')]()[_0x7053('0x28')](function(){_0x584725[_0x7053('0x1d')](0xcc)[_0x7053('0x1e')]();});}};}function handleEntityNotFound(_0x201365,_0x1acc0c){return function(_0x627423){if(!_0x627423){_0x201365['sendStatus'](0x194);}return _0x627423;};}function handleError(_0x297ba2,_0x5c955a){_0x5c955a=_0x5c955a||0x1f4;return function(_0x28a75d){logger['error'](_0x28a75d[_0x7053('0x2a')]);if(_0x28a75d['name']){delete _0x28a75d[_0x7053('0x2b')];}_0x297ba2[_0x7053('0x1d')](_0x5c955a)[_0x7053('0x2c')](_0x28a75d);};}exports[_0x7053('0x2d')]=function(_0x2ce32b,_0x8fafd5){var _0x466b48={'raw':![],'where':{'id':_0x2ce32b[_0x7053('0x2e')]['id']}},_0x927e76={};_0x927e76[_0x7053('0x2f')]=_[_0x7053('0x30')](db['DashboardItem'][_0x7053('0x31')]);_0x927e76[_0x7053('0x32')]=_[_0x7053('0x30')](_0x2ce32b[_0x7053('0x32')]);_0x927e76[_0x7053('0x33')]=_[_0x7053('0x34')](_0x927e76[_0x7053('0x2f')],_0x927e76[_0x7053('0x32')]);_0x466b48['attributes']=_[_0x7053('0x34')](_0x927e76[_0x7053('0x2f')],qs['fields'](_0x2ce32b[_0x7053('0x32')][_0x7053('0x35')]));_0x466b48['attributes']=_0x466b48[_0x7053('0x36')][_0x7053('0x37')]?_0x466b48[_0x7053('0x36')]:_0x927e76[_0x7053('0x2f')];if(_0x2ce32b[_0x7053('0x32')][_0x7053('0x38')]){_0x466b48['include']=[{'all':!![]}];}_0x466b48=_[_0x7053('0x39')]({},_0x466b48,_0x2ce32b[_0x7053('0x3a')]);return db[_0x7053('0x3b')][_0x7053('0x3c')](_0x466b48)[_0x7053('0x28')](handleEntityNotFound(_0x8fafd5,null))[_0x7053('0x28')](respondWithResult(_0x8fafd5,null))[_0x7053('0x3d')](handleError(_0x8fafd5,null));};exports[_0x7053('0x29')]=function(_0x3d5cda,_0x28b004){return db[_0x7053('0x3b')][_0x7053('0x3c')]({'where':{'id':_0x3d5cda[_0x7053('0x2e')]['id']}})['then'](handleEntityNotFound(_0x28b004,null))[_0x7053('0x28')](removeEntity(_0x28b004,null))[_0x7053('0x3d')](handleError(_0x28b004,null));};function widgetAttributes(_0x5c6ac2){try{switch(_0x5c6ac2[_0x7053('0x3e')]){case _0x7053('0x3f'):return[{'name':_0x7053('0x40'),'value':_0x5c6ac2[_0x7053('0x40')]||(_0x5c6ac2[_0x7053('0x41')]&&_0x5c6ac2[_0x7053('0x41')][0x0]?_0x5c6ac2['attrs'][0x0][_0x7053('0x42')]:undefined)||_0x7053('0x43')}];case'custom':return[{'name':'attrPath','value':_0x5c6ac2['attrPath']||(_0x5c6ac2[_0x7053('0x41')]&&_0x5c6ac2[_0x7053('0x41')][0x0]?_0x5c6ac2[_0x7053('0x41')][0x0][_0x7053('0x42')]:undefined)||''}];case _0x7053('0x44'):return[{'name':_0x7053('0x45'),'value':_0x5c6ac2['attrHourFormat']||(_0x5c6ac2[_0x7053('0x41')]&&_0x5c6ac2[_0x7053('0x41')][0x0]?_0x5c6ac2['attrs'][0x0][_0x7053('0x42')]:undefined)||_0x7053('0x46')},{'name':_0x7053('0x47'),'value':_0x5c6ac2[_0x7053('0x47')]||(_0x5c6ac2['attrs']&&_0x5c6ac2[_0x7053('0x41')][0x1]?_0x5c6ac2[_0x7053('0x41')][0x1][_0x7053('0x42')]:undefined)||_0x7053('0x48')},{'name':_0x7053('0x49'),'value':_0x5c6ac2[_0x7053('0x49')]||(_0x5c6ac2['attrs']&&_0x5c6ac2['attrs'][0x2]?_0x5c6ac2[_0x7053('0x41')][0x2][_0x7053('0x42')]:undefined)||0xc}];case _0x7053('0x4a'):return[{'name':_0x7053('0x4b'),'value':_0x5c6ac2[_0x7053('0x4b')]||(_0x5c6ac2[_0x7053('0x41')]&&_0x5c6ac2[_0x7053('0x41')][0x0]?_0x5c6ac2[_0x7053('0x41')][0x0][_0x7053('0x42')]:undefined)||'total'},{'name':_0x7053('0x4c'),'value':_0x5c6ac2[_0x7053('0x4c')]||(_0x5c6ac2[_0x7053('0x41')]&&_0x5c6ac2[_0x7053('0x41')][0x1]?_0x5c6ac2[_0x7053('0x41')][0x1][_0x7053('0x42')]:undefined)||[]},{'name':'attrFontSize','value':_0x5c6ac2[_0x7053('0x49')]||(_0x5c6ac2[_0x7053('0x41')]&&_0x5c6ac2[_0x7053('0x41')][0x2]?_0x5c6ac2['attrs'][0x2][_0x7053('0x42')]:undefined)||0x14}];case'multibar-chart':case'pie-chart':return[{'name':'attrSerie1','value':_0x5c6ac2[_0x7053('0x4d')]||(_0x5c6ac2[_0x7053('0x41')]&&_0x5c6ac2['attrs'][0x0]?_0x5c6ac2[_0x7053('0x41')][0x0][_0x7053('0x42')]:undefined)||_0x7053('0x4e')},{'name':_0x7053('0x4f'),'value':_0x5c6ac2[_0x7053('0x4f')]||(_0x5c6ac2['attrs']&&_0x5c6ac2[_0x7053('0x41')][0x1]?_0x5c6ac2[_0x7053('0x41')][0x1][_0x7053('0x42')]:undefined)||null},{'name':_0x7053('0x50'),'value':_0x5c6ac2[_0x7053('0x50')]||(_0x5c6ac2['attrs']&&_0x5c6ac2['attrs'][0x2]?_0x5c6ac2['attrs'][0x2]['value']:undefined)||null},{'name':_0x7053('0x4c'),'value':_0x5c6ac2[_0x7053('0x4c')]||(_0x5c6ac2['attrs']&&_0x5c6ac2[_0x7053('0x41')][0x3]?_0x5c6ac2[_0x7053('0x41')][0x3][_0x7053('0x42')]:undefined)||[]}];case _0x7053('0x51'):return[{'name':'attrReport','type':_0x5c6ac2[_0x7053('0x52')]||(_0x5c6ac2[_0x7053('0x41')]&&_0x5c6ac2[_0x7053('0x41')][0x0]?_0x5c6ac2[_0x7053('0x41')][0x0][_0x7053('0x3e')]:undefined)||null,'value':_0x5c6ac2[_0x7053('0x53')]||(_0x5c6ac2[_0x7053('0x41')]&&_0x5c6ac2[_0x7053('0x41')][0x0]?_0x5c6ac2[_0x7053('0x41')][0x0]['value']:undefined)||null},{'name':'attrRefresh','value':_0x5c6ac2[_0x7053('0x54')]||(_0x5c6ac2['attrs']&&_0x5c6ac2[_0x7053('0x41')][0x1]?_0x5c6ac2[_0x7053('0x41')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x1ee5b6){logger[_0x7053('0x55')](_0x7053('0x56'),JSON['stringify'](_0x1ee5b6));return[];}}exports['create']=function(_0x250385,_0xf6f4bb){if(_0x250385[_0x7053('0x57')]){_0x250385[_0x7053('0x57')]['attrs']=widgetAttributes(_0x250385[_0x7053('0x57')]);}return db['DashboardItem']['create'](_0x250385[_0x7053('0x57')],{})[_0x7053('0x28')](respondWithResult(_0xf6f4bb,0xc9))[_0x7053('0x3d')](handleError(_0xf6f4bb,null));};exports[_0x7053('0x27')]=function(_0x14b6ea,_0x5e0e58){if(_0x14b6ea[_0x7053('0x57')]['id']){delete _0x14b6ea['body']['id'];}_0x14b6ea[_0x7053('0x57')][_0x7053('0x41')]=widgetAttributes(_0x14b6ea[_0x7053('0x57')]);return db[_0x7053('0x3b')][_0x7053('0x3c')]({'where':{'id':_0x14b6ea[_0x7053('0x2e')]['id']}})[_0x7053('0x28')](handleEntityNotFound(_0x5e0e58,null))[_0x7053('0x28')](saveUpdates(_0x14b6ea[_0x7053('0x57')],null))[_0x7053('0x28')](respondWithResult(_0x5e0e58,null))[_0x7053('0x3d')](handleError(_0x5e0e58,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index 06894db..fb9fa73 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 _0x5253=['events','../../mysqldb','DashboardItem','setMaxListeners','remove','emit','hasOwnProperty','hook','exports'];(function(_0x4f09ce,_0xb38621){var _0x329014=function(_0x518fcb){while(--_0x518fcb){_0x4f09ce['push'](_0x4f09ce['shift']());}};_0x329014(++_0xb38621);}(_0x5253,0xb4));var _0x3525=function(_0x57c15d,_0x2157a2){_0x57c15d=_0x57c15d-0x0;var _0x54ec26=_0x5253[_0x57c15d];return _0x54ec26;};'use strict';var EventEmitter=require(_0x3525('0x0'));var DashboardItem=require(_0x3525('0x1'))['db'][_0x3525('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x3525('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x3525('0x4')};function emitEvent(_0x3e10ab){return function(_0x83aa22,_0x59a29d,_0x16e66b){DashboardItemEvents[_0x3525('0x5')](_0x3e10ab+':'+_0x83aa22['id'],_0x83aa22);DashboardItemEvents['emit'](_0x3e10ab,_0x83aa22);_0x16e66b(null);};}for(var e in events){if(events[_0x3525('0x6')](e)){var event=events[e];DashboardItem[_0x3525('0x7')](e,emitEvent(event));}}module[_0x3525('0x8')]=DashboardItemEvents; \ No newline at end of file +var _0x3b3d=['remove','emit','hook','events','DashboardItem','setMaxListeners','save','update'];(function(_0x415335,_0x5c5100){var _0x300fa7=function(_0x4809e2){while(--_0x4809e2){_0x415335['push'](_0x415335['shift']());}};_0x300fa7(++_0x5c5100);}(_0x3b3d,0x93));var _0xd3b3=function(_0x60dc8a,_0x144e7e){_0x60dc8a=_0x60dc8a-0x0;var _0x19ba48=_0x3b3d[_0x60dc8a];return _0x19ba48;};'use strict';var EventEmitter=require(_0xd3b3('0x0'));var DashboardItem=require('../../mysqldb')['db'][_0xd3b3('0x1')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0xd3b3('0x2')](0x0);var events={'afterCreate':_0xd3b3('0x3'),'afterUpdate':_0xd3b3('0x4'),'afterDestroy':_0xd3b3('0x5')};function emitEvent(_0x142518){return function(_0x3578d3,_0x28721e,_0x29923e){DashboardItemEvents[_0xd3b3('0x6')](_0x142518+':'+_0x3578d3['id'],_0x3578d3);DashboardItemEvents['emit'](_0x142518,_0x3578d3);_0x29923e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];DashboardItem[_0xd3b3('0x7')](e,emitEvent(event));}}module['exports']=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index 20bc98c..0081a4a 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 _0x30d2=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./dashboardItem.attributes','exports','define','DashboardItem','lodash','../../config/logger','api'];(function(_0x1129a5,_0x55b919){var _0x2845ac=function(_0x3e213a){while(--_0x3e213a){_0x1129a5['push'](_0x1129a5['shift']());}};_0x2845ac(++_0x55b919);}(_0x30d2,0x190));var _0x230d=function(_0x426cad,_0x45810d){_0x426cad=_0x426cad-0x0;var _0x50c00f=_0x30d2[_0x426cad];return _0x50c00f;};'use strict';var _=require(_0x230d('0x0'));var util=require('util');var logger=require(_0x230d('0x1'))(_0x230d('0x2'));var moment=require(_0x230d('0x3'));var BPromise=require(_0x230d('0x4'));var rp=require(_0x230d('0x5'));var fs=require('fs');var path=require(_0x230d('0x6'));var rimraf=require(_0x230d('0x7'));var config=require(_0x230d('0x8'));var attributes=require(_0x230d('0x9'));module[_0x230d('0xa')]=function(_0x469a0c,_0x3b550c){return _0x469a0c[_0x230d('0xb')](_0x230d('0xc'),attributes,{'tableName':'dashboard_items','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x48d7=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./dashboardItem.attributes','exports','define','DashboardItem','dashboard_items','lodash'];(function(_0x1b599d,_0x3fd3b8){var _0x3085e6=function(_0x196fd1){while(--_0x196fd1){_0x1b599d['push'](_0x1b599d['shift']());}};_0x3085e6(++_0x3fd3b8);}(_0x48d7,0xfb));var _0x748d=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x48d7[_0x17d9e3];return _0x14192d;};'use strict';var _=require(_0x748d('0x0'));var util=require(_0x748d('0x1'));var logger=require(_0x748d('0x2'))('api');var moment=require(_0x748d('0x3'));var BPromise=require(_0x748d('0x4'));var rp=require(_0x748d('0x5'));var fs=require('fs');var path=require(_0x748d('0x6'));var rimraf=require(_0x748d('0x7'));var config=require(_0x748d('0x8'));var attributes=require(_0x748d('0x9'));module[_0x748d('0xa')]=function(_0x591eb9,_0x23a5ed){return _0x591eb9[_0x748d('0xb')](_0x748d('0xc'),attributes,{'tableName':_0x748d('0xd'),'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 f7e5419..5e79d62 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 _0xcc96=['code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','request','info','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x17f3df,_0xdc212b){var _0x1163d8=function(_0x3ef3b9){while(--_0x3ef3b9){_0x17f3df['push'](_0x17f3df['shift']());}};_0x1163d8(++_0xdc212b);}(_0xcc96,0x18c));var _0x6cc9=function(_0x37fe88,_0x39c460){_0x37fe88=_0x37fe88-0x0;var _0x4cedd6=_0xcc96[_0x37fe88];return _0x4cedd6;};'use strict';var _=require(_0x6cc9('0x0'));var util=require(_0x6cc9('0x1'));var moment=require(_0x6cc9('0x2'));var BPromise=require(_0x6cc9('0x3'));var rs=require(_0x6cc9('0x4'));var fs=require('fs');var Redis=require(_0x6cc9('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x6cc9('0x6'));var logger=require(_0x6cc9('0x7'))(_0x6cc9('0x8'));var config=require(_0x6cc9('0x9'));var jayson=require(_0x6cc9('0xa'));var client=jayson['client'][_0x6cc9('0xb')]({'port':0x232a});config[_0x6cc9('0xc')]=_[_0x6cc9('0xd')](config[_0x6cc9('0xc')],{'host':_0x6cc9('0xe'),'port':0x18eb});var socket=require(_0x6cc9('0xf'))(new Redis(config[_0x6cc9('0xc')]));require(_0x6cc9('0x10'))['register'](socket);function respondWithRpcPromise(_0x4ab554,_0x11d6a2,_0x401108){return new BPromise(function(_0x56114f,_0x5ea7fa){return client[_0x6cc9('0x11')](_0x4ab554,_0x401108)['then'](function(_0x535cde){logger[_0x6cc9('0x12')](_0x6cc9('0x13'),_0x11d6a2,_0x6cc9('0x14'));logger[_0x6cc9('0x15')]('DashboardItem,\x20%s,\x20%s,\x20%s',_0x11d6a2,_0x6cc9('0x14'),JSON[_0x6cc9('0x16')](_0x535cde));if(_0x535cde[_0x6cc9('0x17')]){if(_0x535cde[_0x6cc9('0x17')][_0x6cc9('0x18')]===0x1f4){logger[_0x6cc9('0x17')](_0x6cc9('0x13'),_0x11d6a2,_0x535cde[_0x6cc9('0x17')]['message']);return _0x5ea7fa(_0x535cde['error'][_0x6cc9('0x19')]);}logger[_0x6cc9('0x17')](_0x6cc9('0x13'),_0x11d6a2,_0x535cde[_0x6cc9('0x17')][_0x6cc9('0x19')]);return _0x56114f(_0x535cde[_0x6cc9('0x17')]['message']);}else{logger[_0x6cc9('0x12')](_0x6cc9('0x13'),_0x11d6a2,_0x6cc9('0x14'));_0x56114f(_0x535cde[_0x6cc9('0x1a')][_0x6cc9('0x19')]);}})[_0x6cc9('0x1b')](function(_0x418dbd){logger[_0x6cc9('0x17')](_0x6cc9('0x13'),_0x11d6a2,_0x418dbd);_0x5ea7fa(_0x418dbd);});});} \ No newline at end of file +var _0xff53=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','localhost','socket.io-emitter','request','DashboardItem,\x20%s,\x20%s','request\x20sent','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','util','moment'];(function(_0x4e2148,_0x382a2c){var _0x323345=function(_0x426339){while(--_0x426339){_0x4e2148['push'](_0x4e2148['shift']());}};_0x323345(++_0x382a2c);}(_0xff53,0x8e));var _0x3ff5=function(_0x53aac7,_0x4e9447){_0x53aac7=_0x53aac7-0x0;var _0x44dbe2=_0xff53[_0x53aac7];return _0x44dbe2;};'use strict';var _=require('lodash');var util=require(_0x3ff5('0x0'));var moment=require(_0x3ff5('0x1'));var BPromise=require(_0x3ff5('0x2'));var rs=require(_0x3ff5('0x3'));var fs=require('fs');var Redis=require(_0x3ff5('0x4'));var db=require(_0x3ff5('0x5'))['db'];var utils=require(_0x3ff5('0x6'));var logger=require(_0x3ff5('0x7'))('rpc');var config=require(_0x3ff5('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x3ff5('0x9')][_0x3ff5('0xa')]({'port':0x232a});config[_0x3ff5('0xb')]=_['defaults'](config[_0x3ff5('0xb')],{'host':_0x3ff5('0xc'),'port':0x18eb});var socket=require(_0x3ff5('0xd'))(new Redis(config[_0x3ff5('0xb')]));require('./dashboardItem.socket')['register'](socket);function respondWithRpcPromise(_0x2f0b07,_0xda98ca,_0x1535e3){return new BPromise(function(_0x4bf40a,_0x1fc5e9){return client[_0x3ff5('0xe')](_0x2f0b07,_0x1535e3)['then'](function(_0x5cb548){logger['info'](_0x3ff5('0xf'),_0xda98ca,_0x3ff5('0x10'));logger['debug'](_0x3ff5('0x11'),_0xda98ca,_0x3ff5('0x10'),JSON[_0x3ff5('0x12')](_0x5cb548));if(_0x5cb548['error']){if(_0x5cb548[_0x3ff5('0x13')][_0x3ff5('0x14')]===0x1f4){logger[_0x3ff5('0x13')]('DashboardItem,\x20%s,\x20%s',_0xda98ca,_0x5cb548[_0x3ff5('0x13')]['message']);return _0x1fc5e9(_0x5cb548['error'][_0x3ff5('0x15')]);}logger['error'](_0x3ff5('0xf'),_0xda98ca,_0x5cb548[_0x3ff5('0x13')]['message']);return _0x4bf40a(_0x5cb548[_0x3ff5('0x13')]['message']);}else{logger[_0x3ff5('0x16')](_0x3ff5('0xf'),_0xda98ca,_0x3ff5('0x10'));_0x4bf40a(_0x5cb548[_0x3ff5('0x17')]['message']);}})['catch'](function(_0x1b3f50){logger[_0x3ff5('0x13')](_0x3ff5('0xf'),_0xda98ca,_0x1b3f50);_0x1fc5e9(_0x1b3f50);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index 52ec0e8..825f3da 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 _0xe887=['emit','register','length','dashboardItem:','save','remove','update'];(function(_0x167fcf,_0x321323){var _0x178875=function(_0x1e9810){while(--_0x1e9810){_0x167fcf['push'](_0x167fcf['shift']());}};_0x178875(++_0x321323);}(_0xe887,0xeb));var _0x7e88=function(_0x5ae8eb,_0x1be007){_0x5ae8eb=_0x5ae8eb-0x0;var _0x34ea12=_0xe887[_0x5ae8eb];return _0x34ea12;};'use strict';var DashboardItemEvents=require('./dashboardItem.events');var events=[_0x7e88('0x0'),_0x7e88('0x1'),_0x7e88('0x2')];function createListener(_0x1f00dc,_0x50614d){return function(_0x2d318a){_0x50614d[_0x7e88('0x3')](_0x1f00dc,_0x2d318a);};}function removeListener(_0x1884e3,_0x12d76d){return function(){DashboardItemEvents['removeListener'](_0x1884e3,_0x12d76d);};}exports[_0x7e88('0x4')]=function(_0x282c0b){for(var _0x4ef309=0x0,_0x1a3e79=events[_0x7e88('0x5')];_0x4ef309<_0x1a3e79;_0x4ef309++){var _0x5db251=events[_0x4ef309];var _0x1eb996=createListener(_0x7e88('0x6')+_0x5db251,_0x282c0b);DashboardItemEvents['on'](_0x5db251,_0x1eb996);}}; \ No newline at end of file +var _0xd04a=['update','emit','removeListener','register','length','dashboardItem:','./dashboardItem.events','save'];(function(_0xa5179d,_0x3fdef5){var _0x14fe92=function(_0x69c38b){while(--_0x69c38b){_0xa5179d['push'](_0xa5179d['shift']());}};_0x14fe92(++_0x3fdef5);}(_0xd04a,0x156));var _0xad04=function(_0x5c80ae,_0x1e7fd0){_0x5c80ae=_0x5c80ae-0x0;var _0x21845b=_0xd04a[_0x5c80ae];return _0x21845b;};'use strict';var DashboardItemEvents=require(_0xad04('0x0'));var events=[_0xad04('0x1'),'remove',_0xad04('0x2')];function createListener(_0x445897,_0x5decca){return function(_0x123672){_0x5decca[_0xad04('0x3')](_0x445897,_0x123672);};}function removeListener(_0x31edeb,_0x10ae92){return function(){DashboardItemEvents[_0xad04('0x4')](_0x31edeb,_0x10ae92);};}exports[_0xad04('0x5')]=function(_0x3b6d91){for(var _0x4abbcb=0x0,_0x14ba45=events[_0xad04('0x6')];_0x4abbcb<_0x14ba45;_0x4abbcb++){var _0x9a02ea=events[_0x4abbcb];var _0xdb34f6=createListener(_0xad04('0x7')+_0x9a02ea,_0x3b6d91);DashboardItemEvents['on'](_0x9a02ea,_0xdb34f6);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index c493d74..5638cfe 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 _0xc04b=['util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboardItem.controller','get','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports'];(function(_0x21ecc8,_0x2bdead){var _0x510c1d=function(_0x3b6862){while(--_0x3b6862){_0x21ecc8['push'](_0x21ecc8['shift']());}};_0x510c1d(++_0x2bdead);}(_0xc04b,0xdc));var _0xbc04=function(_0x184f06,_0x573ead){_0x184f06=_0x184f06-0x0;var _0x49b7e0=_0xc04b[_0x184f06];return _0x49b7e0;};'use strict';var multer=require('multer');var util=require(_0xbc04('0x0'));var path=require(_0xbc04('0x1'));var timeout=require(_0xbc04('0x2'));var express=require('express');var router=express[_0xbc04('0x3')]();var fs_extra=require(_0xbc04('0x4'));var auth=require(_0xbc04('0x5'));var interaction=require(_0xbc04('0x6'));var config=require(_0xbc04('0x7'));var controller=require(_0xbc04('0x8'));router[_0xbc04('0x9')](_0xbc04('0xa'),auth[_0xbc04('0xb')](),controller[_0xbc04('0xc')]);router[_0xbc04('0xd')]('/',auth[_0xbc04('0xb')](),controller[_0xbc04('0xe')]);router[_0xbc04('0xf')](_0xbc04('0xa'),auth[_0xbc04('0xb')](),controller[_0xbc04('0x10')]);router[_0xbc04('0x11')](_0xbc04('0xa'),auth['isAuthenticated'](),controller[_0xbc04('0x12')]);module[_0xbc04('0x13')]=router; \ No newline at end of file +var _0xe5b2=['express','Router','fs-extra','../../components/auth/service','../../config/environment','./dashboardItem.controller','get','/:id','isAuthenticated','post','create','put','update','delete','destroy','exports','path','connect-timeout'];(function(_0xa70ff3,_0x890208){var _0x2a117a=function(_0x49d8a6){while(--_0x49d8a6){_0xa70ff3['push'](_0xa70ff3['shift']());}};_0x2a117a(++_0x890208);}(_0xe5b2,0x1c0));var _0x2e5b=function(_0x5488cc,_0x57b187){_0x5488cc=_0x5488cc-0x0;var _0xa8962e=_0xe5b2[_0x5488cc];return _0xa8962e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x2e5b('0x0'));var timeout=require(_0x2e5b('0x1'));var express=require(_0x2e5b('0x2'));var router=express[_0x2e5b('0x3')]();var fs_extra=require(_0x2e5b('0x4'));var auth=require(_0x2e5b('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x2e5b('0x6'));var controller=require(_0x2e5b('0x7'));router[_0x2e5b('0x8')](_0x2e5b('0x9'),auth[_0x2e5b('0xa')](),controller['show']);router[_0x2e5b('0xb')]('/',auth['isAuthenticated'](),controller[_0x2e5b('0xc')]);router[_0x2e5b('0xd')](_0x2e5b('0x9'),auth['isAuthenticated'](),controller[_0x2e5b('0xe')]);router[_0x2e5b('0xf')]('/:id',auth[_0x2e5b('0xa')](),controller[_0x2e5b('0x10')]);module[_0x2e5b('0x11')]=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index 87b1b38..735bac5 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 _0xaaca=['exports','second','third','STRING','sequelize'];(function(_0x3c42ff,_0x45ee1f){var _0x4c0f6d=function(_0x3ec265){while(--_0x3ec265){_0x3c42ff['push'](_0x3c42ff['shift']());}};_0x4c0f6d(++_0x45ee1f);}(_0xaaca,0x72));var _0xaaac=function(_0x5e4563,_0x3ff918){_0x5e4563=_0x5e4563-0x0;var _0x8d1bf5=_0xaaca[_0x5e4563];return _0x8d1bf5;};'use strict';var Sequelize=require(_0xaaac('0x0'));module[_0xaaac('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'level':{'type':Sequelize['ENUM']('first',_0xaaac('0x2'),_0xaaac('0x3')),'allowNull':![],'defaultValue':'first'},'description':{'type':Sequelize[_0xaaac('0x4')]}}; \ No newline at end of file +var _0x54a1=['exports','ENUM','third'];(function(_0x119b4a,_0x553699){var _0x423f95=function(_0x18c922){while(--_0x18c922){_0x119b4a['push'](_0x119b4a['shift']());}};_0x423f95(++_0x553699);}(_0x54a1,0x1c2));var _0x154a=function(_0x1cb18a,_0x33167a){_0x1cb18a=_0x1cb18a-0x0;var _0x22442e=_0x54a1[_0x1cb18a];return _0x22442e;};'use strict';var Sequelize=require('sequelize');module[_0x154a('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'level':{'type':Sequelize[_0x154a('0x1')]('first','second',_0x154a('0x2')),'allowNull':![],'defaultValue':'first'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index 0aeee0a..01e8e11 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 _0x6868=['../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','json','limit','count','offset','Content-Range','apply','save','update','then','destroy','UserProfileResource','error','stack','name','send','index','map','Disposition','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','nolimit','sort','where','filters','pick','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Dispositions','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','fast-json-patch','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse'];(function(_0x1bc36b,_0x9422d3){var _0x7e5a2f=function(_0x2a0689){while(--_0x2a0689){_0x1bc36b['push'](_0x1bc36b['shift']());}};_0x7e5a2f(++_0x9422d3);}(_0x6868,0x90));var _0x8686=function(_0x22ac68,_0x4b95f3){_0x22ac68=_0x22ac68-0x0;var _0x2a0e44=_0x6868[_0x22ac68];return _0x2a0e44;};'use strict';var emlformat=require(_0x8686('0x0'));var rimraf=require(_0x8686('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8686('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x8686('0x3'));var util=require(_0x8686('0x4'));var path=require('path');var sox=require(_0x8686('0x5'));var csv=require(_0x8686('0x6'));var ejs=require(_0x8686('0x7'));var fs=require('fs');var fs_extra=require(_0x8686('0x8'));var _=require('lodash');var squel=require(_0x8686('0x9'));var crypto=require(_0x8686('0xa'));var jsforce=require(_0x8686('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x8686('0x6'));var querystring=require(_0x8686('0xc'));var Papa=require(_0x8686('0xd'));var Redis=require('ioredis');var authService=require(_0x8686('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x8686('0xf'));var hardwareService=require(_0x8686('0x10'));var logger=require(_0x8686('0x11'))(_0x8686('0x12'));var utils=require('../../config/utils');var config=require(_0x8686('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3b6076,_0x1ea71f){_0x1ea71f=_0x1ea71f||0xcc;return function(_0x5a7100){if(_0x5a7100){return _0x3b6076[_0x8686('0x14')](_0x1ea71f);}return _0x3b6076[_0x8686('0x15')](_0x1ea71f)[_0x8686('0x16')]();};}function respondWithResult(_0x4f4c12,_0x181312){_0x181312=_0x181312||0xc8;return function(_0x1cfbb3){if(_0x1cfbb3){return _0x4f4c12[_0x8686('0x15')](_0x181312)[_0x8686('0x17')](_0x1cfbb3);}};}function respondWithFilteredResult(_0x1d1927,_0x2b16ab){return function(_0x7c94d4){if(_0x7c94d4){var _0x301aaa=typeof _0x2b16ab['offset']==='undefined'&&typeof _0x2b16ab[_0x8686('0x18')]==='undefined';var _0x45533b=_0x7c94d4[_0x8686('0x19')];var _0x3397eb=_0x301aaa?0x0:_0x2b16ab['offset'];var _0x263e64=_0x301aaa?_0x7c94d4[_0x8686('0x19')]:_0x2b16ab[_0x8686('0x1a')]+_0x2b16ab[_0x8686('0x18')];var _0x491a37;if(_0x263e64>=_0x45533b){_0x263e64=_0x45533b;_0x491a37=0xc8;}else{_0x491a37=0xce;}_0x1d1927[_0x8686('0x15')](_0x491a37);return _0x1d1927['set'](_0x8686('0x1b'),_0x3397eb+'-'+_0x263e64+'/'+_0x45533b)[_0x8686('0x17')](_0x7c94d4);}return null;};}function patchUpdates(_0x5beeb7){return function(_0x19ad0d){try{jsonpatch[_0x8686('0x1c')](_0x19ad0d,_0x5beeb7,!![]);}catch(_0x3afd00){return BPromise['reject'](_0x3afd00);}return _0x19ad0d[_0x8686('0x1d')]();};}function saveUpdates(_0x4b2fd3,_0x428922){return function(_0x4a2faf){if(_0x4a2faf){return _0x4a2faf[_0x8686('0x1e')](_0x4b2fd3)[_0x8686('0x1f')](function(_0x5ca7ca){return _0x5ca7ca;});}return null;};}function removeEntity(_0x92a1f0,_0x3605bd){return function(_0x2f0ed9){if(_0x2f0ed9){return _0x2f0ed9[_0x8686('0x20')]()[_0x8686('0x1f')](function(){var _0x190dbc=_0x2f0ed9['get']({'plain':!![]});var _0x58e11e='Dispositions';return db[_0x8686('0x21')][_0x8686('0x20')]({'where':{'type':_0x58e11e,'resourceId':_0x190dbc['id']}})[_0x8686('0x1f')](function(){return _0x2f0ed9;});})[_0x8686('0x1f')](function(){_0x92a1f0[_0x8686('0x15')](0xcc)[_0x8686('0x16')]();});}};}function handleEntityNotFound(_0x1c5d90,_0x47aad6){return function(_0x156305){if(!_0x156305){_0x1c5d90[_0x8686('0x14')](0x194);}return _0x156305;};}function handleError(_0x6e8fbb,_0x5367ca){_0x5367ca=_0x5367ca||0x1f4;return function(_0x383722){logger[_0x8686('0x22')](_0x383722[_0x8686('0x23')]);if(_0x383722['name']){delete _0x383722[_0x8686('0x24')];}_0x6e8fbb['status'](_0x5367ca)[_0x8686('0x25')](_0x383722);};}exports[_0x8686('0x26')]=function(_0x48efae,_0x50a2d5){var _0x4387af={},_0x5862f5={},_0x53e7ce={'count':0x0,'rows':[]};var _0x3e6d02=_[_0x8686('0x27')](db[_0x8686('0x28')][_0x8686('0x29')],function(_0x37c89b){return{'name':_0x37c89b[_0x8686('0x2a')],'type':_0x37c89b['type'][_0x8686('0x2b')]};});_0x5862f5[_0x8686('0x2c')]=_[_0x8686('0x27')](_0x3e6d02,_0x8686('0x24'));_0x5862f5[_0x8686('0x2d')]=_[_0x8686('0x2e')](_0x48efae[_0x8686('0x2d')]);_0x5862f5['filters']=_[_0x8686('0x2f')](_0x5862f5[_0x8686('0x2c')],_0x5862f5[_0x8686('0x2d')]);_0x4387af[_0x8686('0x30')]=_[_0x8686('0x2f')](_0x5862f5['model'],qs[_0x8686('0x31')](_0x48efae[_0x8686('0x2d')][_0x8686('0x31')]));_0x4387af[_0x8686('0x30')]=_0x4387af[_0x8686('0x30')][_0x8686('0x32')]?_0x4387af[_0x8686('0x30')]:_0x5862f5[_0x8686('0x2c')];if(!_0x48efae['query']['hasOwnProperty'](_0x8686('0x33'))){_0x4387af[_0x8686('0x18')]=qs[_0x8686('0x18')](_0x48efae[_0x8686('0x2d')][_0x8686('0x18')]);_0x4387af[_0x8686('0x1a')]=qs[_0x8686('0x1a')](_0x48efae[_0x8686('0x2d')]['offset']);}_0x4387af['order']=qs[_0x8686('0x34')](_0x48efae[_0x8686('0x2d')][_0x8686('0x34')]);_0x4387af[_0x8686('0x35')]=qs[_0x8686('0x36')](_[_0x8686('0x37')](_0x48efae[_0x8686('0x2d')],_0x5862f5[_0x8686('0x36')]),_0x3e6d02);if(_0x48efae[_0x8686('0x2d')][_0x8686('0x38')]){_0x4387af[_0x8686('0x35')]=_['merge'](_0x4387af[_0x8686('0x35')],{'$or':_[_0x8686('0x27')](_0x3e6d02,function(_0x544b6f){if(_0x544b6f[_0x8686('0x39')]!==_0x8686('0x3a')){var _0x44032d={};_0x44032d[_0x544b6f[_0x8686('0x24')]]={'$like':'%'+_0x48efae[_0x8686('0x2d')][_0x8686('0x38')]+'%'};return _0x44032d;}})});}_0x4387af=_[_0x8686('0x3b')]({},_0x4387af,_0x48efae[_0x8686('0x3c')]);var _0x1312b9={'where':_0x4387af[_0x8686('0x35')]};return db[_0x8686('0x28')]['count'](_0x1312b9)[_0x8686('0x1f')](function(_0x37ee99){_0x53e7ce[_0x8686('0x19')]=_0x37ee99;if(_0x48efae[_0x8686('0x2d')][_0x8686('0x3d')]){_0x4387af[_0x8686('0x3e')]=[{'all':!![]}];}return db['Disposition'][_0x8686('0x3f')](_0x4387af);})['then'](function(_0x264675){_0x53e7ce[_0x8686('0x40')]=_0x264675;return _0x53e7ce;})[_0x8686('0x1f')](respondWithFilteredResult(_0x50a2d5,_0x4387af))[_0x8686('0x41')](handleError(_0x50a2d5,null));};exports['show']=function(_0x44542c,_0x761d88){var _0x337acd={'raw':!![],'where':{'id':_0x44542c['params']['id']}},_0x110141={};_0x110141[_0x8686('0x2c')]=_[_0x8686('0x2e')](db['Disposition']['rawAttributes']);_0x110141[_0x8686('0x2d')]=_['keys'](_0x44542c[_0x8686('0x2d')]);_0x110141[_0x8686('0x36')]=_['intersection'](_0x110141[_0x8686('0x2c')],_0x110141[_0x8686('0x2d')]);_0x337acd['attributes']=_['intersection'](_0x110141['model'],qs[_0x8686('0x31')](_0x44542c['query']['fields']));_0x337acd[_0x8686('0x30')]=_0x337acd[_0x8686('0x30')]['length']?_0x337acd[_0x8686('0x30')]:_0x110141['model'];if(_0x44542c[_0x8686('0x2d')][_0x8686('0x3d')]){_0x337acd[_0x8686('0x3e')]=[{'all':!![]}];}_0x337acd=_['merge']({},_0x337acd,_0x44542c[_0x8686('0x3c')]);return db[_0x8686('0x28')][_0x8686('0x42')](_0x337acd)[_0x8686('0x1f')](handleEntityNotFound(_0x761d88,null))[_0x8686('0x1f')](respondWithResult(_0x761d88,null))['catch'](handleError(_0x761d88,null));};exports[_0x8686('0x43')]=function(_0x3a73ef,_0x611b22){return db['Disposition'][_0x8686('0x43')](_0x3a73ef[_0x8686('0x44')],{})[_0x8686('0x1f')](function(_0x3b37ed){var _0x397afb=_0x3a73ef[_0x8686('0x45')][_0x8686('0x46')]({'plain':!![]});if(!_0x397afb)throw new Error(_0x8686('0x47'));if(_0x397afb[_0x8686('0x48')]==='user'){var _0x45a2e1=_0x3b37ed['get']({'plain':!![]});var _0x50a81a=_0x8686('0x49');return db[_0x8686('0x4a')][_0x8686('0x42')]({'where':{'name':_0x50a81a,'userProfileId':_0x397afb[_0x8686('0x4b')]},'raw':!![]})['then'](function(_0x1b7941){if(_0x1b7941&&_0x1b7941[_0x8686('0x4c')]===0x0){return db[_0x8686('0x21')][_0x8686('0x43')]({'name':_0x45a2e1[_0x8686('0x24')],'resourceId':_0x45a2e1['id'],'type':_0x1b7941['name'],'sectionId':_0x1b7941['id']},{})[_0x8686('0x1f')](function(){return _0x3b37ed;});}else{return _0x3b37ed;}})[_0x8686('0x41')](function(_0x456525){logger[_0x8686('0x22')](_0x8686('0x4d'),_0x456525);throw _0x456525;});}return _0x3b37ed;})['then'](respondWithResult(_0x611b22,0xc9))['catch'](handleError(_0x611b22,null));};exports[_0x8686('0x1e')]=function(_0x523a7b,_0x58b0fc){if(_0x523a7b[_0x8686('0x44')]['id']){delete _0x523a7b[_0x8686('0x44')]['id'];}return db[_0x8686('0x28')][_0x8686('0x42')]({'where':{'id':_0x523a7b[_0x8686('0x4e')]['id']}})[_0x8686('0x1f')](handleEntityNotFound(_0x58b0fc,null))[_0x8686('0x1f')](saveUpdates(_0x523a7b[_0x8686('0x44')],null))[_0x8686('0x1f')](respondWithResult(_0x58b0fc,null))[_0x8686('0x41')](handleError(_0x58b0fc,null));};exports[_0x8686('0x20')]=function(_0x16aee1,_0x536749){return db[_0x8686('0x28')][_0x8686('0x42')]({'where':{'id':_0x16aee1[_0x8686('0x4e')]['id']}})[_0x8686('0x1f')](handleEntityNotFound(_0x536749,null))[_0x8686('0x1f')](removeEntity(_0x536749,null))['catch'](handleError(_0x536749,null));}; \ No newline at end of file +var _0xdbcd=['desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','update','destroy','Dispositions','UserProfileResource','then','stack','name','index','map','Disposition','rawAttributes','fieldName','key','model','query','keys','filters','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','catch','show','params','length','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','find','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','request-promise','moment','bluebird','util','path','fs-extra'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0xdbcd,0x1ba));var _0xddbc=function(_0xfb009,_0x792dcf){_0xfb009=_0xfb009-0x0;var _0x3533d6=_0xdbcd[_0xfb009];return _0x3533d6;};'use strict';var emlformat=require(_0xddbc('0x0'));var rimraf=require(_0xddbc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xddbc('0x2'));var moment=require(_0xddbc('0x3'));var BPromise=require(_0xddbc('0x4'));var Mustache=require('mustache');var util=require(_0xddbc('0x5'));var path=require(_0xddbc('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xddbc('0x7'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xddbc('0x8'));var toCsv=require(_0xddbc('0x9'));var querystring=require(_0xddbc('0xa'));var Papa=require(_0xddbc('0xb'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xddbc('0xc'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xddbc('0xd'));var logger=require('../../config/logger')(_0xddbc('0xe'));var utils=require(_0xddbc('0xf'));var config=require(_0xddbc('0x10'));var licenseUtil=require(_0xddbc('0x11'));var db=require(_0xddbc('0x12'))['db'];function respondWithStatusCode(_0x3fb6bb,_0x2e0a84){_0x2e0a84=_0x2e0a84||0xcc;return function(_0x4754ca){if(_0x4754ca){return _0x3fb6bb[_0xddbc('0x13')](_0x2e0a84);}return _0x3fb6bb[_0xddbc('0x14')](_0x2e0a84)[_0xddbc('0x15')]();};}function respondWithResult(_0x36bb31,_0x55f959){_0x55f959=_0x55f959||0xc8;return function(_0x57c81f){if(_0x57c81f){return _0x36bb31[_0xddbc('0x14')](_0x55f959)[_0xddbc('0x16')](_0x57c81f);}};}function respondWithFilteredResult(_0x4ecb2e,_0x5c1d50){return function(_0x464f3d){if(_0x464f3d){var _0x2d4a9b=typeof _0x5c1d50[_0xddbc('0x17')]===_0xddbc('0x18')&&typeof _0x5c1d50['limit']==='undefined';var _0x356afe=_0x464f3d[_0xddbc('0x19')];var _0x5d0a34=_0x2d4a9b?0x0:_0x5c1d50['offset'];var _0x4cf7ea=_0x2d4a9b?_0x464f3d[_0xddbc('0x19')]:_0x5c1d50['offset']+_0x5c1d50[_0xddbc('0x1a')];var _0xedd271;if(_0x4cf7ea>=_0x356afe){_0x4cf7ea=_0x356afe;_0xedd271=0xc8;}else{_0xedd271=0xce;}_0x4ecb2e[_0xddbc('0x14')](_0xedd271);return _0x4ecb2e[_0xddbc('0x1b')](_0xddbc('0x1c'),_0x5d0a34+'-'+_0x4cf7ea+'/'+_0x356afe)[_0xddbc('0x16')](_0x464f3d);}return null;};}function patchUpdates(_0x500048){return function(_0x3bcded){try{jsonpatch['apply'](_0x3bcded,_0x500048,!![]);}catch(_0x52426a){return BPromise[_0xddbc('0x1d')](_0x52426a);}return _0x3bcded['save']();};}function saveUpdates(_0xd31251,_0x155f53){return function(_0x1cac88){if(_0x1cac88){return _0x1cac88[_0xddbc('0x1e')](_0xd31251)['then'](function(_0x1e677a){return _0x1e677a;});}return null;};}function removeEntity(_0x1fac5d,_0x1d0dfc){return function(_0x1d44a7){if(_0x1d44a7){return _0x1d44a7[_0xddbc('0x1f')]()['then'](function(){var _0x4bccd1=_0x1d44a7['get']({'plain':!![]});var _0x302120=_0xddbc('0x20');return db[_0xddbc('0x21')][_0xddbc('0x1f')]({'where':{'type':_0x302120,'resourceId':_0x4bccd1['id']}})[_0xddbc('0x22')](function(){return _0x1d44a7;});})[_0xddbc('0x22')](function(){_0x1fac5d[_0xddbc('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2a7e0b,_0x136f64){return function(_0x12bf5b){if(!_0x12bf5b){_0x2a7e0b[_0xddbc('0x13')](0x194);}return _0x12bf5b;};}function handleError(_0x3b1f06,_0xb4f6f5){_0xb4f6f5=_0xb4f6f5||0x1f4;return function(_0x16a720){logger['error'](_0x16a720[_0xddbc('0x23')]);if(_0x16a720[_0xddbc('0x24')]){delete _0x16a720[_0xddbc('0x24')];}_0x3b1f06[_0xddbc('0x14')](_0xb4f6f5)['send'](_0x16a720);};}exports[_0xddbc('0x25')]=function(_0x56042c,_0x49cc11){var _0x95a9c6={},_0x4d6329={},_0x19d2f0={'count':0x0,'rows':[]};var _0x2e261e=_[_0xddbc('0x26')](db[_0xddbc('0x27')][_0xddbc('0x28')],function(_0x58c10a){return{'name':_0x58c10a[_0xddbc('0x29')],'type':_0x58c10a['type'][_0xddbc('0x2a')]};});_0x4d6329[_0xddbc('0x2b')]=_[_0xddbc('0x26')](_0x2e261e,_0xddbc('0x24'));_0x4d6329[_0xddbc('0x2c')]=_[_0xddbc('0x2d')](_0x56042c[_0xddbc('0x2c')]);_0x4d6329[_0xddbc('0x2e')]=_['intersection'](_0x4d6329[_0xddbc('0x2b')],_0x4d6329[_0xddbc('0x2c')]);_0x95a9c6[_0xddbc('0x2f')]=_['intersection'](_0x4d6329[_0xddbc('0x2b')],qs['fields'](_0x56042c[_0xddbc('0x2c')][_0xddbc('0x30')]));_0x95a9c6['attributes']=_0x95a9c6[_0xddbc('0x2f')]['length']?_0x95a9c6[_0xddbc('0x2f')]:_0x4d6329['model'];if(!_0x56042c['query'][_0xddbc('0x31')]('nolimit')){_0x95a9c6['limit']=qs[_0xddbc('0x1a')](_0x56042c[_0xddbc('0x2c')][_0xddbc('0x1a')]);_0x95a9c6['offset']=qs['offset'](_0x56042c[_0xddbc('0x2c')]['offset']);}_0x95a9c6[_0xddbc('0x32')]=qs[_0xddbc('0x33')](_0x56042c[_0xddbc('0x2c')][_0xddbc('0x33')]);_0x95a9c6[_0xddbc('0x34')]=qs[_0xddbc('0x2e')](_[_0xddbc('0x35')](_0x56042c[_0xddbc('0x2c')],_0x4d6329[_0xddbc('0x2e')]),_0x2e261e);if(_0x56042c[_0xddbc('0x2c')][_0xddbc('0x36')]){_0x95a9c6[_0xddbc('0x34')]=_[_0xddbc('0x37')](_0x95a9c6[_0xddbc('0x34')],{'$or':_['map'](_0x2e261e,function(_0x71896c){if(_0x71896c[_0xddbc('0x38')]!==_0xddbc('0x39')){var _0x3a49bc={};_0x3a49bc[_0x71896c[_0xddbc('0x24')]]={'$like':'%'+_0x56042c['query']['filter']+'%'};return _0x3a49bc;}})});}_0x95a9c6=_[_0xddbc('0x37')]({},_0x95a9c6,_0x56042c[_0xddbc('0x3a')]);var _0x468089={'where':_0x95a9c6[_0xddbc('0x34')]};return db['Disposition'][_0xddbc('0x19')](_0x468089)[_0xddbc('0x22')](function(_0x1d88e7){_0x19d2f0[_0xddbc('0x19')]=_0x1d88e7;if(_0x56042c[_0xddbc('0x2c')][_0xddbc('0x3b')]){_0x95a9c6[_0xddbc('0x3c')]=[{'all':!![]}];}return db[_0xddbc('0x27')]['findAll'](_0x95a9c6);})[_0xddbc('0x22')](function(_0xad04fc){_0x19d2f0['rows']=_0xad04fc;return _0x19d2f0;})['then'](respondWithFilteredResult(_0x49cc11,_0x95a9c6))[_0xddbc('0x3d')](handleError(_0x49cc11,null));};exports[_0xddbc('0x3e')]=function(_0x949bb7,_0x462c93){var _0x4409eb={'raw':!![],'where':{'id':_0x949bb7[_0xddbc('0x3f')]['id']}},_0x575c18={};_0x575c18['model']=_[_0xddbc('0x2d')](db[_0xddbc('0x27')]['rawAttributes']);_0x575c18[_0xddbc('0x2c')]=_[_0xddbc('0x2d')](_0x949bb7[_0xddbc('0x2c')]);_0x575c18['filters']=_['intersection'](_0x575c18['model'],_0x575c18[_0xddbc('0x2c')]);_0x4409eb['attributes']=_['intersection'](_0x575c18['model'],qs[_0xddbc('0x30')](_0x949bb7[_0xddbc('0x2c')][_0xddbc('0x30')]));_0x4409eb[_0xddbc('0x2f')]=_0x4409eb[_0xddbc('0x2f')][_0xddbc('0x40')]?_0x4409eb[_0xddbc('0x2f')]:_0x575c18[_0xddbc('0x2b')];if(_0x949bb7[_0xddbc('0x2c')]['includeAll']){_0x4409eb[_0xddbc('0x3c')]=[{'all':!![]}];}_0x4409eb=_[_0xddbc('0x37')]({},_0x4409eb,_0x949bb7[_0xddbc('0x3a')]);return db[_0xddbc('0x27')]['find'](_0x4409eb)[_0xddbc('0x22')](handleEntityNotFound(_0x462c93,null))[_0xddbc('0x22')](respondWithResult(_0x462c93,null))[_0xddbc('0x3d')](handleError(_0x462c93,null));};exports['create']=function(_0x2115ea,_0x1fa0bd){return db[_0xddbc('0x27')][_0xddbc('0x41')](_0x2115ea[_0xddbc('0x42')],{})['then'](function(_0x2a5f36){var _0x286284=_0x2115ea[_0xddbc('0x43')]['get']({'plain':!![]});if(!_0x286284)throw new Error(_0xddbc('0x44'));if(_0x286284[_0xddbc('0x45')]===_0xddbc('0x43')){var _0x3cc229=_0x2a5f36[_0xddbc('0x46')]({'plain':!![]});var _0x2fb977='Dispositions';return db['UserProfileSection'][_0xddbc('0x47')]({'where':{'name':_0x2fb977,'userProfileId':_0x286284['userProfileId']},'raw':!![]})[_0xddbc('0x22')](function(_0x3c3e40){if(_0x3c3e40&&_0x3c3e40[_0xddbc('0x48')]===0x0){return db[_0xddbc('0x21')]['create']({'name':_0x3cc229[_0xddbc('0x24')],'resourceId':_0x3cc229['id'],'type':_0x3c3e40[_0xddbc('0x24')],'sectionId':_0x3c3e40['id']},{})[_0xddbc('0x22')](function(){return _0x2a5f36;});}else{return _0x2a5f36;}})[_0xddbc('0x3d')](function(_0x51e262){logger[_0xddbc('0x49')](_0xddbc('0x4a'),_0x51e262);throw _0x51e262;});}return _0x2a5f36;})[_0xddbc('0x22')](respondWithResult(_0x1fa0bd,0xc9))[_0xddbc('0x3d')](handleError(_0x1fa0bd,null));};exports[_0xddbc('0x1e')]=function(_0x1ca700,_0x1c59c6){if(_0x1ca700['body']['id']){delete _0x1ca700[_0xddbc('0x42')]['id'];}return db[_0xddbc('0x27')][_0xddbc('0x47')]({'where':{'id':_0x1ca700[_0xddbc('0x3f')]['id']}})['then'](handleEntityNotFound(_0x1c59c6,null))[_0xddbc('0x22')](saveUpdates(_0x1ca700[_0xddbc('0x42')],null))['then'](respondWithResult(_0x1c59c6,null))[_0xddbc('0x3d')](handleError(_0x1c59c6,null));};exports[_0xddbc('0x1f')]=function(_0xb1279b,_0x1cbd25){return db[_0xddbc('0x27')][_0xddbc('0x47')]({'where':{'id':_0xb1279b['params']['id']}})[_0xddbc('0x22')](handleEntityNotFound(_0x1cbd25,null))[_0xddbc('0x22')](removeEntity(_0x1cbd25,null))['catch'](handleError(_0x1cbd25,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index cbecf8e..dc44e89 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 _0xe4df=['ListId','name_chat','ChatWebsiteId','name_mail','MailAccountId','name_sms','name_fax','FaxAccountId','name_whatsapp','WhatsappAccountId','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./disposition.attributes','exports','define','Disposition','tools_dispositions','name_voice','name'];(function(_0x11df6d,_0x41e593){var _0x4ceeac=function(_0x10df85){while(--_0x10df85){_0x11df6d['push'](_0x11df6d['shift']());}};_0x4ceeac(++_0x41e593);}(_0xe4df,0x6e));var _0xfe4d=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xe4df[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0xfe4d('0x0'));var util=require('util');var logger=require(_0xfe4d('0x1'))(_0xfe4d('0x2'));var moment=require('moment');var BPromise=require(_0xfe4d('0x3'));var rp=require(_0xfe4d('0x4'));var fs=require('fs');var path=require(_0xfe4d('0x5'));var rimraf=require(_0xfe4d('0x6'));var config=require(_0xfe4d('0x7'));var attributes=require(_0xfe4d('0x8'));module[_0xfe4d('0x9')]=function(_0x1a7d82,_0x38e01c){return _0x1a7d82[_0xfe4d('0xa')](_0xfe4d('0xb'),attributes,{'tableName':_0xfe4d('0xc'),'paranoid':![],'indexes':[{'unique':!![],'name':_0xfe4d('0xd'),'fields':[_0xfe4d('0xe'),_0xfe4d('0xf')]},{'unique':!![],'name':_0xfe4d('0x10'),'fields':[_0xfe4d('0xe'),_0xfe4d('0x11')]},{'unique':!![],'name':_0xfe4d('0x12'),'fields':[_0xfe4d('0xe'),_0xfe4d('0x13')]},{'unique':!![],'name':_0xfe4d('0x14'),'fields':[_0xfe4d('0xe'),'SmsAccountId']},{'unique':!![],'name':_0xfe4d('0x15'),'fields':[_0xfe4d('0xe'),_0xfe4d('0x16')]},{'unique':!![],'name':'name_openchannel','fields':[_0xfe4d('0xe'),'OpenchannelAccountId']},{'unique':!![],'name':_0xfe4d('0x17'),'fields':[_0xfe4d('0xe'),_0xfe4d('0x18')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe4b8=['name_whatsapp','lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./disposition.attributes','exports','Disposition','tools_dispositions','name_voice','name','ListId','name_chat','name_mail','MailAccountId','SmsAccountId','name_fax','name_openchannel','OpenchannelAccountId'];(function(_0x1cf629,_0x4a070a){var _0x581d42=function(_0x58a87b){while(--_0x58a87b){_0x1cf629['push'](_0x1cf629['shift']());}};_0x581d42(++_0x4a070a);}(_0xe4b8,0x1e4));var _0x8e4b=function(_0x263a74,_0xc31414){_0x263a74=_0x263a74-0x0;var _0x2aa86c=_0xe4b8[_0x263a74];return _0x2aa86c;};'use strict';var _=require(_0x8e4b('0x0'));var util=require(_0x8e4b('0x1'));var logger=require('../../config/logger')(_0x8e4b('0x2'));var moment=require('moment');var BPromise=require(_0x8e4b('0x3'));var rp=require(_0x8e4b('0x4'));var fs=require('fs');var path=require(_0x8e4b('0x5'));var rimraf=require(_0x8e4b('0x6'));var config=require(_0x8e4b('0x7'));var attributes=require(_0x8e4b('0x8'));module[_0x8e4b('0x9')]=function(_0x45e3a8,_0xab2be6){return _0x45e3a8['define'](_0x8e4b('0xa'),attributes,{'tableName':_0x8e4b('0xb'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x8e4b('0xc'),'fields':[_0x8e4b('0xd'),_0x8e4b('0xe')]},{'unique':!![],'name':_0x8e4b('0xf'),'fields':[_0x8e4b('0xd'),'ChatWebsiteId']},{'unique':!![],'name':_0x8e4b('0x10'),'fields':['name',_0x8e4b('0x11')]},{'unique':!![],'name':'name_sms','fields':[_0x8e4b('0xd'),_0x8e4b('0x12')]},{'unique':!![],'name':_0x8e4b('0x13'),'fields':[_0x8e4b('0xd'),'FaxAccountId']},{'unique':!![],'name':_0x8e4b('0x14'),'fields':[_0x8e4b('0xd'),_0x8e4b('0x15')]},{'unique':!![],'name':_0x8e4b('0x16'),'fields':['name','WhatsappAccountId']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index c543f6d..c6cc3a7 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(_0x2196d2,_0x2ed45d){var _0x19061f=function(_0x2d6162){while(--_0x2d6162){_0x2196d2['push'](_0x2196d2['shift']());}};_0x19061f(++_0x2ed45d);}(_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 _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(_0x40ec27,_0x40fb2c){var _0x3c86a2=function(_0x3b4736){while(--_0x3b4736){_0x40ec27['push'](_0x40ec27['shift']());}};_0x3c86a2(++_0x40fb2c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x411add,_0x1aed38){_0x411add=_0x411add-0x0;var _0x238242=_0xa9e0[_0x411add];return _0x238242;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var 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 be37c57..d8d5478 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 _0xf14d=['delete','/:id','destroy','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','./disposition.controller','get','isAuthenticated','index','show','post','create','update'];(function(_0x231b24,_0x15d434){var _0x157b60=function(_0xbc2301){while(--_0xbc2301){_0x231b24['push'](_0x231b24['shift']());}};_0x157b60(++_0x15d434);}(_0xf14d,0x1a1));var _0xdf14=function(_0x2591f0,_0x2272bc){_0x2591f0=_0x2591f0-0x0;var _0x4a51ba=_0xf14d[_0x2591f0];return _0x4a51ba;};'use strict';var multer=require(_0xdf14('0x0'));var util=require(_0xdf14('0x1'));var path=require(_0xdf14('0x2'));var timeout=require('connect-timeout');var express=require(_0xdf14('0x3'));var router=express['Router']();var fs_extra=require(_0xdf14('0x4'));var auth=require(_0xdf14('0x5'));var interaction=require(_0xdf14('0x6'));var config=require('../../config/environment');var controller=require(_0xdf14('0x7'));router[_0xdf14('0x8')]('/',auth[_0xdf14('0x9')](),controller[_0xdf14('0xa')]);router[_0xdf14('0x8')]('/:id',auth[_0xdf14('0x9')](),controller[_0xdf14('0xb')]);router[_0xdf14('0xc')]('/',auth[_0xdf14('0x9')](),controller[_0xdf14('0xd')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xdf14('0xe')]);router[_0xdf14('0xf')](_0xdf14('0x10'),auth[_0xdf14('0x9')](),controller[_0xdf14('0x11')]);module['exports']=router; \ No newline at end of file +var _0xaf55=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./disposition.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0xaf55,0x1e0));var _0x5af5=function(_0x485b5a,_0x2b289b){_0x485b5a=_0x485b5a-0x0;var _0xd2b34d=_0xaf55[_0x485b5a];return _0xd2b34d;};'use strict';var multer=require(_0x5af5('0x0'));var util=require(_0x5af5('0x1'));var path=require(_0x5af5('0x2'));var timeout=require(_0x5af5('0x3'));var express=require(_0x5af5('0x4'));var router=express[_0x5af5('0x5')]();var fs_extra=require(_0x5af5('0x6'));var auth=require(_0x5af5('0x7'));var interaction=require(_0x5af5('0x8'));var config=require(_0x5af5('0x9'));var controller=require(_0x5af5('0xa'));router[_0x5af5('0xb')]('/',auth[_0x5af5('0xc')](),controller[_0x5af5('0xd')]);router[_0x5af5('0xb')](_0x5af5('0xe'),auth[_0x5af5('0xc')](),controller[_0x5af5('0xf')]);router[_0x5af5('0x10')]('/',auth[_0x5af5('0xc')](),controller['create']);router[_0x5af5('0x11')](_0x5af5('0xe'),auth[_0x5af5('0xc')](),controller[_0x5af5('0x12')]);router[_0x5af5('0x13')](_0x5af5('0xe'),auth[_0x5af5('0xc')](),controller[_0x5af5('0x14')]);module[_0x5af5('0x15')]=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index d3a319f..98dbc2e 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 _0x70e2=['9600','12000','14400','v17,v27,v29','INTEGER','IAX','DADHI','KHOMP','TEXT','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','xCALLY\x20Motion\x20Fax','localstationid','ENUM','2400','4800','7200'];(function(_0x446853,_0x287af6){var _0x5912d7=function(_0x504567){while(--_0x504567){_0x446853['push'](_0x446853['shift']());}};_0x5912d7(++_0x287af6);}(_0x70e2,0x150));var _0x270e=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x70e2[_0x1ac595];return _0x455fff;};'use strict';var Sequelize=require(_0x270e('0x0'));module[_0x270e('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x270e('0x2')]},'ecm':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'yes'},'headerinfo':{'type':Sequelize['STRING'],'defaultValue':_0x270e('0x3')},'localstationid':{'type':Sequelize[_0x270e('0x2')],'unique':_0x270e('0x4')},'minrate':{'type':Sequelize[_0x270e('0x5')](_0x270e('0x6'),_0x270e('0x7'),_0x270e('0x8'),_0x270e('0x9'),_0x270e('0xa'),_0x270e('0xb')),'defaultValue':'4800'},'maxrate':{'type':Sequelize['ENUM'](_0x270e('0x6'),_0x270e('0x7'),'7200','9600',_0x270e('0xa'),_0x270e('0xb')),'defaultValue':_0x270e('0xb')},'modem':{'type':Sequelize[_0x270e('0x2')],'defaultValue':_0x270e('0xc')},'gateway':{'type':Sequelize[_0x270e('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x270e('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x270e('0xd')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x270e('0x5')]('SIP',_0x270e('0xe'),_0x270e('0xf'),_0x270e('0x10')),'defaultValue':'SIP'},'key':{'type':Sequelize[_0x270e('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x270e('0x11')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x270e('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x270e('0x12')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x270e('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x270e('0x12')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x270e('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x270e('0xd')],'allowNull':!![],'defaultValue':null,'comment':_0x270e('0x13')},'mandatoryDisposition':{'type':Sequelize[_0x270e('0x12')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x11feb7){if(!_0x11feb7)this[_0x270e('0x14')](_0x270e('0x15'),null);this[_0x270e('0x14')](_0x270e('0x16'),_0x11feb7);}}}; \ No newline at end of file +var _0x6e82=['Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','exports','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid','7200','9600','14400','4800','12000','v17,v27,v29','INTEGER','SIP','IAX','DADHI','KHOMP'];(function(_0x21e597,_0x4c5d93){var _0xcb1e6e=function(_0x31811a){while(--_0x31811a){_0x21e597['push'](_0x21e597['shift']());}};_0xcb1e6e(++_0x4c5d93);}(_0x6e82,0x1a7));var _0x26e8=function(_0x2a4c2b,_0x1ce4a3){_0x2a4c2b=_0x2a4c2b-0x0;var _0x5c5cd1=_0x6e82[_0x2a4c2b];return _0x5c5cd1;};'use strict';var Sequelize=require('sequelize');module[_0x26e8('0x0')]={'name':{'type':Sequelize[_0x26e8('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x26e8('0x1')]},'ecm':{'type':Sequelize[_0x26e8('0x2')](_0x26e8('0x3'),'no'),'defaultValue':_0x26e8('0x3')},'headerinfo':{'type':Sequelize[_0x26e8('0x1')],'defaultValue':_0x26e8('0x4')},'localstationid':{'type':Sequelize[_0x26e8('0x1')],'unique':_0x26e8('0x5')},'minrate':{'type':Sequelize[_0x26e8('0x2')]('2400','4800',_0x26e8('0x6'),_0x26e8('0x7'),'12000',_0x26e8('0x8')),'defaultValue':'4800'},'maxrate':{'type':Sequelize['ENUM']('2400',_0x26e8('0x9'),_0x26e8('0x6'),'9600',_0x26e8('0xa'),_0x26e8('0x8')),'defaultValue':_0x26e8('0x8')},'modem':{'type':Sequelize[_0x26e8('0x1')],'defaultValue':_0x26e8('0xb')},'gateway':{'type':Sequelize[_0x26e8('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x26e8('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x26e8('0xc')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x26e8('0x2')](_0x26e8('0xd'),_0x26e8('0xe'),_0x26e8('0xf'),_0x26e8('0x10')),'defaultValue':_0x26e8('0xd')},'key':{'type':Sequelize[_0x26e8('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x26e8('0x11');}},'notificationSound':{'type':Sequelize[_0x26e8('0x12')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x26e8('0x12')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x26e8('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x26e8('0x12')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x26e8('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x26e8('0x12')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x26e8('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x26e8('0xc')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x26e8('0x12')],'defaultValue':![],'comment':_0x26e8('0x13'),'set':function(_0x32ec20){if(!_0x32ec20)this[_0x26e8('0x14')]('mandatoryDispositionPauseId',null);this[_0x26e8('0x14')](_0x26e8('0x15'),_0x32ec20);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index 212a3ee..c16e41e 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 _0x9983=['format','List\x20not\x20found','Send\x20Fax\x20failed','out','filename','Messages','Contact\x20not\x20found','spread','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','emit','removeAgents','userFaxAccount:remove','getAgents','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','http','client','info','FaxAccount,\x20%s,\x20%s','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','json','undefined','limit','count','offset','Content-Range','apply','save','update','then','destroy','get','UserProfileResource','name','send','index','Pause','mandatoryDispositionPause','map','FaxAccount','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','VIRTUAL','merge','include','show','params','includeAll','options','find','create','user','role','FaxAccounts','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','FaxAccountId','Disposition','findOne','rawAttributes','findAll','removeDispositions','addAnswer','CannedAnswer','rows','removeAnswers','ids','addInteraction','FaxInteraction','omit','getInteractions','order','CmContact','Contact','User','fullname','internal','Tag','Tags','color','tag','addApplications','sequelize','transaction','FaxApplication','bulkCreate','findAndCountAll','getApplications','context','from-voip-provider','exten','app','appdata','push','Answer','CDR(type)=inbound-fax','Set','ecm','localstationid','gateway','headerinfo','maxrate','modem','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','updateAccountApplications','createdAt','updatedAt','TrunkId','ListId','findById','getMessages','FaxMessage','$gte','split','CmList','List','Contacts','attachments','join','root','basename','CheckAfterSend','isNil','from'];(function(_0x3760d5,_0x118479){var _0x91783c=function(_0x396a8e){while(--_0x396a8e){_0x3760d5['push'](_0x3760d5['shift']());}};_0x91783c(++_0x118479);}(_0x9983,0xcb));var _0x3998=function(_0x309293,_0x1c1e8c){_0x309293=_0x309293-0x0;var _0x359ab3=_0x9983[_0x309293];return _0x359ab3;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3998('0x0'));var jsonpatch=require(_0x3998('0x1'));var rp=require(_0x3998('0x2'));var moment=require(_0x3998('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x3998('0x4'));var util=require(_0x3998('0x5'));var path=require(_0x3998('0x6'));var sox=require(_0x3998('0x7'));var csv=require(_0x3998('0x8'));var ejs=require(_0x3998('0x9'));var fs=require('fs');var fs_extra=require(_0x3998('0xa'));var _=require(_0x3998('0xb'));var squel=require(_0x3998('0xc'));var crypto=require(_0x3998('0xd'));var jsforce=require(_0x3998('0xe'));var deskjs=require(_0x3998('0xf'));var toCsv=require(_0x3998('0x8'));var querystring=require('querystring');var Papa=require(_0x3998('0x10'));var Redis=require(_0x3998('0x11'));var authService=require(_0x3998('0x12'));var qs=require(_0x3998('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3998('0x14'));var logger=require(_0x3998('0x15'))(_0x3998('0x16'));var utils=require('../../config/utils');var config=require(_0x3998('0x17'));var licenseUtil=require(_0x3998('0x18'));var db=require(_0x3998('0x19'))['db'];config[_0x3998('0x1a')]=_[_0x3998('0x1b')](config[_0x3998('0x1a')],{'host':_0x3998('0x1c'),'port':0x18eb});var socket=require(_0x3998('0x1d'))(new Redis(config[_0x3998('0x1a')]));require(_0x3998('0x1e'))[_0x3998('0x1f')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x3998('0x20')]({'port':0x232c});var client9002=jayson[_0x3998('0x21')][_0x3998('0x20')]({'port':0x232a});function respondWithRpcPromise(_0x57ccd0,_0x124015,_0x4f9f7e,_0xd9797b){return new BPromise(function(_0x532e5f,_0x514b1a){var _0x16339d=_0xd9797b||client;return _0x16339d['request'](_0x57ccd0,_0x4f9f7e)['then'](function(_0x588d2b){logger[_0x3998('0x22')](_0x3998('0x23'),_0x124015,'request\x20sent');logger[_0x3998('0x24')](_0x3998('0x25'),_0x124015,'request\x20sent',JSON[_0x3998('0x26')](_0x588d2b));if(_0x588d2b[_0x3998('0x27')]){if(_0x588d2b[_0x3998('0x27')][_0x3998('0x28')]===0x1f4){logger[_0x3998('0x27')](_0x3998('0x23'),_0x124015,_0x588d2b['error'][_0x3998('0x29')]);return _0x514b1a(_0x588d2b[_0x3998('0x27')][_0x3998('0x29')]);}logger['error']('FaxAccount,\x20%s,\x20%s',_0x124015,_0x588d2b['error'][_0x3998('0x29')]);return _0x532e5f(_0x588d2b[_0x3998('0x27')]['message']);}else{logger[_0x3998('0x22')]('FaxAccount,\x20%s,\x20%s',_0x124015,'request\x20sent');_0x532e5f(_0x588d2b[_0x3998('0x2a')][_0x3998('0x29')]);}})[_0x3998('0x2b')](function(_0x5279ca){logger[_0x3998('0x27')](_0x3998('0x23'),_0x124015,_0x5279ca);_0x514b1a(_0x5279ca);});});}function respondWithStatusCode(_0x22470e,_0x3ca02b){_0x3ca02b=_0x3ca02b||0xcc;return function(_0x167fcf){if(_0x167fcf){return _0x22470e[_0x3998('0x2c')](_0x3ca02b);}return _0x22470e[_0x3998('0x2d')](_0x3ca02b)['end']();};}function respondWithResult(_0x1a807e,_0x3a2e58){_0x3a2e58=_0x3a2e58||0xc8;return function(_0x5a6148){if(_0x5a6148){return _0x1a807e[_0x3998('0x2d')](_0x3a2e58)[_0x3998('0x2e')](_0x5a6148);}};}function respondWithFilteredResult(_0x4cbf18,_0x553911){return function(_0xd4c7f0){if(_0xd4c7f0){var _0x46630c=typeof _0x553911['offset']===_0x3998('0x2f')&&typeof _0x553911[_0x3998('0x30')]==='undefined';var _0x4b2960=_0xd4c7f0[_0x3998('0x31')];var _0x3a5d42=_0x46630c?0x0:_0x553911[_0x3998('0x32')];var _0x139ed7=_0x46630c?_0xd4c7f0['count']:_0x553911[_0x3998('0x32')]+_0x553911[_0x3998('0x30')];var _0x30d4f2;if(_0x139ed7>=_0x4b2960){_0x139ed7=_0x4b2960;_0x30d4f2=0xc8;}else{_0x30d4f2=0xce;}_0x4cbf18[_0x3998('0x2d')](_0x30d4f2);return _0x4cbf18['set'](_0x3998('0x33'),_0x3a5d42+'-'+_0x139ed7+'/'+_0x4b2960)[_0x3998('0x2e')](_0xd4c7f0);}return null;};}function patchUpdates(_0x1683e7){return function(_0x1415d8){try{jsonpatch[_0x3998('0x34')](_0x1415d8,_0x1683e7,!![]);}catch(_0x3b82d6){return BPromise['reject'](_0x3b82d6);}return _0x1415d8[_0x3998('0x35')]();};}function saveUpdates(_0x10fc22,_0x721ddd){return function(_0x53755c){if(_0x53755c){return _0x53755c[_0x3998('0x36')](_0x10fc22)[_0x3998('0x37')](function(_0x267d3a){return _0x267d3a;});}return null;};}function removeEntity(_0x1f87bb,_0x2ae989){return function(_0x2f8f89){if(_0x2f8f89){return _0x2f8f89[_0x3998('0x38')]()['then'](function(){var _0x3a7c86=_0x2f8f89[_0x3998('0x39')]({'plain':!![]});var _0x5bf4bb='FaxAccounts';return db[_0x3998('0x3a')]['destroy']({'where':{'type':_0x5bf4bb,'resourceId':_0x3a7c86['id']}})[_0x3998('0x37')](function(){return _0x2f8f89;});})[_0x3998('0x37')](function(){_0x1f87bb[_0x3998('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x223283,_0x2d595e){return function(_0x45bca1){if(!_0x45bca1){_0x223283[_0x3998('0x2c')](0x194);}return _0x45bca1;};}function handleError(_0x29ea5a,_0x5bf336){_0x5bf336=_0x5bf336||0x1f4;return function(_0x578571){logger[_0x3998('0x27')](_0x578571['stack']);if(_0x578571[_0x3998('0x3b')]){delete _0x578571['name'];}_0x29ea5a[_0x3998('0x2d')](_0x5bf336)[_0x3998('0x3c')](_0x578571);};}exports[_0x3998('0x3d')]=function(_0x2db8c9,_0x547ad0){var _0x3bd4cf={'include':[{'model':db[_0x3998('0x3e')],'as':_0x3998('0x3f')}]},_0x353f51={},_0x154d51={'count':0x0,'rows':[]};var _0xa8fad1=_[_0x3998('0x40')](db[_0x3998('0x41')]['rawAttributes'],function(_0x1cff77){return{'name':_0x1cff77['fieldName'],'type':_0x1cff77[_0x3998('0x42')][_0x3998('0x43')]};});_0x353f51['model']=_[_0x3998('0x40')](_0xa8fad1,_0x3998('0x3b'));_0x353f51[_0x3998('0x44')]=_[_0x3998('0x45')](_0x2db8c9[_0x3998('0x44')]);_0x353f51['filters']=_[_0x3998('0x46')](_0x353f51[_0x3998('0x47')],_0x353f51[_0x3998('0x44')]);_0x3bd4cf[_0x3998('0x48')]=_[_0x3998('0x46')](_0x353f51[_0x3998('0x47')],qs['fields'](_0x2db8c9[_0x3998('0x44')][_0x3998('0x49')]));_0x3bd4cf['attributes']=_0x3bd4cf[_0x3998('0x48')][_0x3998('0x4a')]?_0x3bd4cf['attributes']:_0x353f51[_0x3998('0x47')];if(!_0x2db8c9['query'][_0x3998('0x4b')](_0x3998('0x4c'))){_0x3bd4cf['limit']=qs[_0x3998('0x30')](_0x2db8c9[_0x3998('0x44')][_0x3998('0x30')]);_0x3bd4cf[_0x3998('0x32')]=qs[_0x3998('0x32')](_0x2db8c9[_0x3998('0x44')]['offset']);}_0x3bd4cf['order']=qs[_0x3998('0x4d')](_0x2db8c9[_0x3998('0x44')][_0x3998('0x4d')]);_0x3bd4cf[_0x3998('0x4e')]=qs[_0x3998('0x4f')](_[_0x3998('0x50')](_0x2db8c9[_0x3998('0x44')],_0x353f51[_0x3998('0x4f')]),_0xa8fad1);if(_0x2db8c9['query'][_0x3998('0x51')]){_0x3bd4cf[_0x3998('0x4e')]=_['merge'](_0x3bd4cf[_0x3998('0x4e')],{'$or':_[_0x3998('0x40')](_0xa8fad1,function(_0x48cdba){if(_0x48cdba[_0x3998('0x42')]!==_0x3998('0x52')){var _0x28e64c={};_0x28e64c[_0x48cdba[_0x3998('0x3b')]]={'$like':'%'+_0x2db8c9[_0x3998('0x44')][_0x3998('0x51')]+'%'};return _0x28e64c;}})});}_0x3bd4cf=_[_0x3998('0x53')]({},_0x3bd4cf,_0x2db8c9['options']);var _0x1c115d={'where':_0x3bd4cf['where']};return db['FaxAccount'][_0x3998('0x31')](_0x1c115d)[_0x3998('0x37')](function(_0x38c398){_0x154d51[_0x3998('0x31')]=_0x38c398;if(_0x2db8c9[_0x3998('0x44')]['includeAll']){_0x3bd4cf[_0x3998('0x54')]=[{'all':!![]}];}return db[_0x3998('0x41')]['findAll'](_0x3bd4cf);})['then'](function(_0x36f6e4){_0x154d51['rows']=_0x36f6e4;return _0x154d51;})['then'](respondWithFilteredResult(_0x547ad0,_0x3bd4cf))[_0x3998('0x2b')](handleError(_0x547ad0,null));};exports[_0x3998('0x55')]=function(_0x5851f2,_0x153e09){var _0x4a5a4d={'raw':![],'where':{'id':_0x5851f2[_0x3998('0x56')]['id']},'include':[{'model':db[_0x3998('0x3e')],'as':_0x3998('0x3f')}]},_0x22ee07={};_0x22ee07[_0x3998('0x47')]=_['keys'](db['FaxAccount']['rawAttributes']);_0x22ee07[_0x3998('0x44')]=_[_0x3998('0x45')](_0x5851f2['query']);_0x22ee07[_0x3998('0x4f')]=_[_0x3998('0x46')](_0x22ee07['model'],_0x22ee07[_0x3998('0x44')]);_0x4a5a4d[_0x3998('0x48')]=_[_0x3998('0x46')](_0x22ee07['model'],qs[_0x3998('0x49')](_0x5851f2[_0x3998('0x44')][_0x3998('0x49')]));_0x4a5a4d[_0x3998('0x48')]=_0x4a5a4d[_0x3998('0x48')]['length']?_0x4a5a4d[_0x3998('0x48')]:_0x22ee07['model'];if(_0x5851f2[_0x3998('0x44')][_0x3998('0x57')]){_0x4a5a4d[_0x3998('0x54')]=[{'all':!![]}];}_0x4a5a4d=_[_0x3998('0x53')]({},_0x4a5a4d,_0x5851f2[_0x3998('0x58')]);return db[_0x3998('0x41')][_0x3998('0x59')](_0x4a5a4d)['then'](handleEntityNotFound(_0x153e09,null))['then'](respondWithResult(_0x153e09,null))[_0x3998('0x2b')](handleError(_0x153e09,null));};exports[_0x3998('0x5a')]=function(_0x5a2e3e,_0x3d2769){return db[_0x3998('0x41')][_0x3998('0x5a')](_0x5a2e3e['body'],{})['then'](function(_0x12ed52){var _0xbe3c6=_0x5a2e3e[_0x3998('0x5b')][_0x3998('0x39')]({'plain':!![]});if(!_0xbe3c6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xbe3c6[_0x3998('0x5c')]===_0x3998('0x5b')){var _0x16316a=_0x12ed52[_0x3998('0x39')]({'plain':!![]});var _0x3191f4=_0x3998('0x5d');return db['UserProfileSection'][_0x3998('0x59')]({'where':{'name':_0x3191f4,'userProfileId':_0xbe3c6[_0x3998('0x5e')]},'raw':!![]})[_0x3998('0x37')](function(_0x5c7f0d){if(_0x5c7f0d&&_0x5c7f0d[_0x3998('0x5f')]===0x0){return db['UserProfileResource'][_0x3998('0x5a')]({'name':_0x16316a['name'],'resourceId':_0x16316a['id'],'type':_0x5c7f0d[_0x3998('0x3b')],'sectionId':_0x5c7f0d['id']},{})['then'](function(){return _0x12ed52;});}else{return _0x12ed52;}})['catch'](function(_0x52b022){logger[_0x3998('0x27')](_0x3998('0x60'),_0x52b022);throw _0x52b022;});}return _0x12ed52;})[_0x3998('0x37')](respondWithResult(_0x3d2769,0xc9))[_0x3998('0x2b')](handleError(_0x3d2769,null));};exports[_0x3998('0x36')]=function(_0x2b54bf,_0x5bb33a){if(_0x2b54bf[_0x3998('0x61')]['id']){delete _0x2b54bf['body']['id'];}return db['FaxAccount'][_0x3998('0x59')]({'where':{'id':_0x2b54bf[_0x3998('0x56')]['id']},'include':[{'model':db[_0x3998('0x3e')],'as':_0x3998('0x3f')}]})['then'](handleEntityNotFound(_0x5bb33a,null))[_0x3998('0x37')](saveUpdates(_0x2b54bf['body'],null))[_0x3998('0x37')](respondWithResult(_0x5bb33a,null))[_0x3998('0x2b')](handleError(_0x5bb33a,null));};exports['destroy']=function(_0x5a60c1,_0x4cd001){return db['FaxAccount'][_0x3998('0x59')]({'where':{'id':_0x5a60c1[_0x3998('0x56')]['id']}})['then'](handleEntityNotFound(_0x4cd001,null))[_0x3998('0x37')](removeEntity(_0x4cd001,null))[_0x3998('0x2b')](handleError(_0x4cd001,null));};exports['describe']=function(_0x34ec35,_0x1a33af){return db[_0x3998('0x41')][_0x3998('0x62')]()['then'](respondWithResult(_0x1a33af,null))['catch'](handleError(_0x1a33af,null));};exports[_0x3998('0x63')]=function(_0x2e014c,_0x430a41,_0x318b23){if(_0x2e014c['body']['id']){delete _0x2e014c[_0x3998('0x61')]['id'];}return db[_0x3998('0x41')][_0x3998('0x59')]({'where':{'id':_0x2e014c['params']['id']}})[_0x3998('0x37')](handleEntityNotFound(_0x430a41,null))[_0x3998('0x37')](function(_0x31fca6){if(_0x31fca6){_0x2e014c['body'][_0x3998('0x64')]=_0x31fca6['id'];return db[_0x3998('0x65')][_0x3998('0x5a')](_0x2e014c[_0x3998('0x61')]);}})[_0x3998('0x37')](respondWithResult(_0x430a41,null))[_0x3998('0x2b')](handleError(_0x430a41,null));};exports['getDispositions']=function(_0x3eba57,_0x3bfb44,_0xbc4db4){var _0x2c15f8={'raw':![],'where':{}};var _0x41c460={};var _0x502987={'count':0x0,'rows':[]};return db['FaxAccount'][_0x3998('0x66')]({'where':{'id':_0x3eba57[_0x3998('0x56')]['id']}})[_0x3998('0x37')](handleEntityNotFound(_0x3bfb44,null))[_0x3998('0x37')](function(_0x2deb54){if(_0x2deb54){_0x41c460[_0x3998('0x47')]=_['keys'](db['Disposition'][_0x3998('0x67')]);_0x41c460[_0x3998('0x44')]=_['keys'](_0x3eba57[_0x3998('0x44')]);_0x41c460[_0x3998('0x4f')]=_[_0x3998('0x46')](_0x41c460[_0x3998('0x47')],_0x41c460[_0x3998('0x44')]);_0x2c15f8[_0x3998('0x48')]=_[_0x3998('0x46')](_0x41c460[_0x3998('0x47')],qs['fields'](_0x3eba57[_0x3998('0x44')][_0x3998('0x49')]));_0x2c15f8[_0x3998('0x48')]=_0x2c15f8[_0x3998('0x48')][_0x3998('0x4a')]?_0x2c15f8[_0x3998('0x48')]:_0x41c460[_0x3998('0x47')];if(!_0x3eba57[_0x3998('0x44')]['hasOwnProperty'](_0x3998('0x4c'))){_0x2c15f8['limit']=qs[_0x3998('0x30')](_0x3eba57[_0x3998('0x44')][_0x3998('0x30')]);_0x2c15f8[_0x3998('0x32')]=qs[_0x3998('0x32')](_0x3eba57[_0x3998('0x44')]['offset']);}_0x2c15f8['order']=qs[_0x3998('0x4d')](_0x3eba57[_0x3998('0x44')]['sort']);_0x2c15f8[_0x3998('0x4e')]=qs['filters'](_[_0x3998('0x50')](_0x3eba57[_0x3998('0x44')],_0x41c460['filters']));_0x2c15f8['where'][_0x3998('0x64')]=_0x2deb54['id'];if(_0x3eba57[_0x3998('0x44')][_0x3998('0x51')]){_0x2c15f8['where']=_[_0x3998('0x53')](_0x2c15f8[_0x3998('0x4e')],{'$or':_[_0x3998('0x40')](_0x2c15f8[_0x3998('0x48')],function(_0x1bd197){var _0x2f6554={};_0x2f6554[_0x1bd197]={'$like':'%'+_0x3eba57['query'][_0x3998('0x51')]+'%'};return _0x2f6554;})});}_0x2c15f8=_[_0x3998('0x53')]({},_0x2c15f8,_0x3eba57[_0x3998('0x58')]);return db[_0x3998('0x65')][_0x3998('0x31')]({'where':_0x2c15f8[_0x3998('0x4e')]})['then'](function(_0x3b5d57){_0x502987[_0x3998('0x31')]=_0x3b5d57;if(_0x3eba57['query'][_0x3998('0x57')]){_0x2c15f8['include']=[{'all':!![]}];}return db[_0x3998('0x65')][_0x3998('0x68')](_0x2c15f8);})[_0x3998('0x37')](function(_0x278927){_0x502987['rows']=_0x278927;return _0x502987;});}})[_0x3998('0x37')](respondWithFilteredResult(_0x3bfb44,_0x2c15f8))[_0x3998('0x2b')](handleError(_0x3bfb44,null));};exports[_0x3998('0x69')]=function(_0x58ebf6,_0x5a3f38,_0x1306f5){return db['FaxAccount']['find']({'where':{'id':_0x58ebf6['params']['id']}})[_0x3998('0x37')](handleEntityNotFound(_0x5a3f38,null))['then'](function(_0x5b341f){if(_0x5b341f){return _0x5b341f[_0x3998('0x69')](_0x58ebf6['query']['ids']);}})[_0x3998('0x37')](respondWithStatusCode(_0x5a3f38,null))[_0x3998('0x2b')](handleError(_0x5a3f38,null));};exports[_0x3998('0x6a')]=function(_0x4b7380,_0x507d3d,_0xe4465f){if(_0x4b7380[_0x3998('0x61')]['id']){delete _0x4b7380[_0x3998('0x61')]['id'];}return db['FaxAccount']['find']({'where':{'id':_0x4b7380[_0x3998('0x56')]['id']}})[_0x3998('0x37')](handleEntityNotFound(_0x507d3d,null))[_0x3998('0x37')](function(_0x3a897e){if(_0x3a897e){_0x4b7380['body'][_0x3998('0x64')]=_0x3a897e['id'];return db[_0x3998('0x6b')]['create'](_0x4b7380[_0x3998('0x61')]);}})['then'](respondWithResult(_0x507d3d,null))[_0x3998('0x2b')](handleError(_0x507d3d,null));};exports['getAnswers']=function(_0x9f9a7f,_0x2880ba,_0x255d47){var _0x2c8beb={'raw':![],'where':{}};var _0x23d995={};var _0x59efe2={'count':0x0,'rows':[]};return db[_0x3998('0x41')][_0x3998('0x66')]({'where':{'id':_0x9f9a7f[_0x3998('0x56')]['id']}})[_0x3998('0x37')](handleEntityNotFound(_0x2880ba,null))[_0x3998('0x37')](function(_0x129455){if(_0x129455){_0x23d995[_0x3998('0x47')]=_[_0x3998('0x45')](db[_0x3998('0x6b')][_0x3998('0x67')]);_0x23d995[_0x3998('0x44')]=_[_0x3998('0x45')](_0x9f9a7f[_0x3998('0x44')]);_0x23d995[_0x3998('0x4f')]=_[_0x3998('0x46')](_0x23d995[_0x3998('0x47')],_0x23d995[_0x3998('0x44')]);_0x2c8beb[_0x3998('0x48')]=_[_0x3998('0x46')](_0x23d995[_0x3998('0x47')],qs['fields'](_0x9f9a7f[_0x3998('0x44')][_0x3998('0x49')]));_0x2c8beb['attributes']=_0x2c8beb['attributes'][_0x3998('0x4a')]?_0x2c8beb[_0x3998('0x48')]:_0x23d995[_0x3998('0x47')];if(!_0x9f9a7f['query']['hasOwnProperty']('nolimit')){_0x2c8beb[_0x3998('0x30')]=qs['limit'](_0x9f9a7f[_0x3998('0x44')][_0x3998('0x30')]);_0x2c8beb['offset']=qs[_0x3998('0x32')](_0x9f9a7f[_0x3998('0x44')][_0x3998('0x32')]);}_0x2c8beb['order']=qs[_0x3998('0x4d')](_0x9f9a7f[_0x3998('0x44')][_0x3998('0x4d')]);_0x2c8beb[_0x3998('0x4e')]=qs[_0x3998('0x4f')](_[_0x3998('0x50')](_0x9f9a7f[_0x3998('0x44')],_0x23d995[_0x3998('0x4f')]));_0x2c8beb[_0x3998('0x4e')]['FaxAccountId']=_0x129455['id'];if(_0x9f9a7f[_0x3998('0x44')][_0x3998('0x51')]){_0x2c8beb[_0x3998('0x4e')]=_[_0x3998('0x53')](_0x2c8beb['where'],{'$or':_[_0x3998('0x40')](_0x2c8beb[_0x3998('0x48')],function(_0x1cc1ad){var _0x4bb5e7={};_0x4bb5e7[_0x1cc1ad]={'$like':'%'+_0x9f9a7f[_0x3998('0x44')][_0x3998('0x51')]+'%'};return _0x4bb5e7;})});}_0x2c8beb=_[_0x3998('0x53')]({},_0x2c8beb,_0x9f9a7f[_0x3998('0x58')]);return db[_0x3998('0x6b')][_0x3998('0x31')]({'where':_0x2c8beb[_0x3998('0x4e')]})['then'](function(_0x4c91a1){_0x59efe2[_0x3998('0x31')]=_0x4c91a1;if(_0x9f9a7f['query'][_0x3998('0x57')]){_0x2c8beb[_0x3998('0x54')]=[{'all':!![]}];}return db['CannedAnswer'][_0x3998('0x68')](_0x2c8beb);})[_0x3998('0x37')](function(_0x57e4b3){_0x59efe2[_0x3998('0x6c')]=_0x57e4b3;return _0x59efe2;});}})[_0x3998('0x37')](respondWithFilteredResult(_0x2880ba,_0x2c8beb))[_0x3998('0x2b')](handleError(_0x2880ba,null));};exports[_0x3998('0x6d')]=function(_0x10ffd5,_0x3195a1,_0x261245){return db[_0x3998('0x41')][_0x3998('0x59')]({'where':{'id':_0x10ffd5[_0x3998('0x56')]['id']}})['then'](handleEntityNotFound(_0x3195a1,null))[_0x3998('0x37')](function(_0x2ef403){if(_0x2ef403){return _0x2ef403[_0x3998('0x6d')](_0x10ffd5[_0x3998('0x44')][_0x3998('0x6e')]);}})[_0x3998('0x37')](respondWithStatusCode(_0x3195a1,null))[_0x3998('0x2b')](handleError(_0x3195a1,null));};exports[_0x3998('0x6f')]=function(_0x6720fa,_0x5948ec,_0x334246){return db[_0x3998('0x70')][_0x3998('0x59')]({'where':{'id':_0x6720fa[_0x3998('0x56')]['id']}})[_0x3998('0x37')](handleEntityNotFound(_0x5948ec,null))['then'](function(_0x1b16cd){if(_0x1b16cd){return _0x1b16cd[_0x3998('0x6f')](_0x6720fa[_0x3998('0x61')][_0x3998('0x6e')],_[_0x3998('0x71')](_0x6720fa[_0x3998('0x61')],['ids','id'])||{});}})['then'](respondWithResult(_0x5948ec,null))['catch'](handleError(_0x5948ec,null));};exports[_0x3998('0x72')]=function(_0x579d7d,_0x55bdad,_0x2b0d3f){var _0x402804={'raw':![],'where':{}};var _0x409739={};var _0x1dc904={'count':0x0,'rows':[]};return db[_0x3998('0x41')]['findOne']({'where':{'id':_0x579d7d[_0x3998('0x56')]['id']}})['then'](handleEntityNotFound(_0x55bdad,null))['then'](function(_0xaffaec){if(_0xaffaec){_0x409739[_0x3998('0x47')]=_['keys'](db['FaxInteraction'][_0x3998('0x67')]);_0x409739['query']=_[_0x3998('0x45')](_0x579d7d['query']);_0x409739[_0x3998('0x4f')]=_['intersection'](_0x409739[_0x3998('0x47')],_0x409739[_0x3998('0x44')]);_0x402804[_0x3998('0x48')]=_['intersection'](_0x409739['model'],qs[_0x3998('0x49')](_0x579d7d[_0x3998('0x44')][_0x3998('0x49')]));_0x402804['attributes']=_0x402804['attributes'][_0x3998('0x4a')]?_0x402804['attributes']:_0x409739[_0x3998('0x47')];if(!_0x579d7d[_0x3998('0x44')][_0x3998('0x4b')](_0x3998('0x4c'))){_0x402804[_0x3998('0x30')]=qs['limit'](_0x579d7d[_0x3998('0x44')]['limit']);_0x402804['offset']=qs[_0x3998('0x32')](_0x579d7d[_0x3998('0x44')][_0x3998('0x32')]);}_0x402804[_0x3998('0x73')]=qs[_0x3998('0x4d')](_0x579d7d[_0x3998('0x44')][_0x3998('0x4d')]);_0x402804['where']=qs[_0x3998('0x4f')](_[_0x3998('0x50')](_0x579d7d[_0x3998('0x44')],_0x409739['filters']));_0x402804[_0x3998('0x4e')][_0x3998('0x64')]=_0xaffaec['id'];if(_0x579d7d[_0x3998('0x44')][_0x3998('0x51')]){_0x402804['where']=_[_0x3998('0x53')](_0x402804[_0x3998('0x4e')],{'$or':_[_0x3998('0x40')](_0x402804[_0x3998('0x48')],function(_0x4199a){var _0x1521fb={};_0x1521fb[_0x4199a]={'$like':'%'+_0x579d7d[_0x3998('0x44')][_0x3998('0x51')]+'%'};return _0x1521fb;})});}_0x402804=_[_0x3998('0x53')]({},_0x402804,_0x579d7d[_0x3998('0x58')]);return db['FaxInteraction'][_0x3998('0x31')]({'where':_0x402804[_0x3998('0x4e')]})[_0x3998('0x37')](function(_0x5830aa){_0x1dc904['count']=_0x5830aa;if(_0x579d7d['query'][_0x3998('0x57')]){_0x402804['include']=[{'model':db[_0x3998('0x74')],'as':_0x3998('0x75'),'required':![]},{'model':db[_0x3998('0x76')],'as':'Owner','attributes':[_0x3998('0x3b'),_0x3998('0x77'),_0x3998('0x78')],'required':![]},{'model':db[_0x3998('0x79')],'as':_0x3998('0x7a'),'attributes':['id',_0x3998('0x3b'),_0x3998('0x7b')],'where':_0x579d7d[_0x3998('0x44')][_0x3998('0x7c')]?{'id':_0x579d7d['query'][_0x3998('0x7c')]}:undefined,'required':_0x579d7d[_0x3998('0x44')][_0x3998('0x7c')]?!![]:![]}];}return db['FaxInteraction'][_0x3998('0x68')](_0x402804);})['then'](function(_0x353763){_0x1dc904[_0x3998('0x6c')]=_0x353763;return _0x1dc904;});}})[_0x3998('0x37')](respondWithFilteredResult(_0x55bdad,_0x402804))[_0x3998('0x2b')](handleError(_0x55bdad,null));};exports[_0x3998('0x7d')]=function(_0x291d17,_0x4cee78,_0x1b32ad){return db[_0x3998('0x41')][_0x3998('0x66')]({'where':{'id':_0x291d17['params']['id']}})['then'](handleEntityNotFound(_0x4cee78,null))[_0x3998('0x37')](function(_0x51565a){if(_0x51565a){return db[_0x3998('0x7e')][_0x3998('0x7f')](function(_0x2c876d){return db[_0x3998('0x80')][_0x3998('0x38')]({'where':{'FaxAccountId':_0x291d17[_0x3998('0x56')]['id']},'transaction':_0x2c876d})['then'](function(_0x54b560){var _0x2b1c6a=_[_0x3998('0x40')](_0x291d17['body'],function(_0x46b013){_0x46b013[_0x3998('0x64')]=_0x291d17[_0x3998('0x56')]['id'];return _0x46b013;});return db[_0x3998('0x80')][_0x3998('0x81')](_0x2b1c6a,{'transaction':_0x2c876d});});})['then'](function(){return db['FaxApplication'][_0x3998('0x82')]({'where':{'FaxAccountId':_0x291d17[_0x3998('0x56')]['id']},'order':'priority'});});}})[_0x3998('0x37')](respondWithResult(_0x4cee78,null))[_0x3998('0x2b')](handleError(_0x4cee78,null));};exports[_0x3998('0x83')]=function(_0x3b3b8b,_0x20321f,_0x2cdd35){var _0x53e344={};var _0x5e0546={};var _0x195d54;var _0x37758c;return db[_0x3998('0x41')][_0x3998('0x66')]({'where':{'id':_0x3b3b8b['params']['id']}})['then'](handleEntityNotFound(_0x20321f,null))[_0x3998('0x37')](function(_0xf4a84e){if(_0xf4a84e){_0x195d54=_0xf4a84e;_0x5e0546[_0x3998('0x47')]=_[_0x3998('0x45')](db[_0x3998('0x80')][_0x3998('0x67')]);_0x5e0546['query']=_[_0x3998('0x45')](_0x3b3b8b[_0x3998('0x44')]);_0x5e0546[_0x3998('0x4f')]=_['intersection'](_0x5e0546[_0x3998('0x47')],_0x5e0546[_0x3998('0x44')]);_0x53e344[_0x3998('0x48')]=_['intersection'](_0x5e0546[_0x3998('0x47')],qs[_0x3998('0x49')](_0x3b3b8b[_0x3998('0x44')]['fields']));_0x53e344[_0x3998('0x48')]=_0x53e344['attributes'][_0x3998('0x4a')]?_0x53e344[_0x3998('0x48')]:_0x5e0546[_0x3998('0x47')];_0x53e344[_0x3998('0x73')]=qs[_0x3998('0x4d')](_0x3b3b8b[_0x3998('0x44')][_0x3998('0x4d')]);_0x53e344['where']=qs[_0x3998('0x4f')](_[_0x3998('0x50')](_0x3b3b8b['query'],_0x5e0546['filters']));if(_0x3b3b8b[_0x3998('0x44')][_0x3998('0x51')]){_0x53e344['where']=_[_0x3998('0x53')](_0x53e344['where'],{'$or':_['map'](_0x53e344['attributes'],function(_0x17412d){var _0x2fffa3={};_0x2fffa3[_0x17412d]={'$like':'%'+_0x3b3b8b[_0x3998('0x44')][_0x3998('0x51')]+'%'};return _0x2fffa3;})});}_0x53e344=_[_0x3998('0x53')]({},_0x53e344,_0x3b3b8b['options']);return _0x195d54[_0x3998('0x83')](_0x53e344);}})['then'](function(_0x2f1363){if(_0x2f1363){_0x37758c=_0x2f1363[_0x3998('0x4a')];if(!_0x3b3b8b[_0x3998('0x44')][_0x3998('0x4b')](_0x3998('0x4c'))){_0x53e344[_0x3998('0x30')]=qs[_0x3998('0x30')](_0x3b3b8b['query'][_0x3998('0x30')]);_0x53e344[_0x3998('0x32')]=qs[_0x3998('0x32')](_0x3b3b8b['query'][_0x3998('0x32')]);}return _0x195d54[_0x3998('0x83')](_0x53e344);}})[_0x3998('0x37')](function(_0x5920bd){if(_0x5920bd){return _0x5920bd?{'count':_0x37758c,'rows':_0x5920bd}:null;}})['then'](respondWithResult(_0x20321f,null))[_0x3998('0x2b')](handleError(_0x20321f,null));};function Extension(_0x3c0e88,_0x9bda70,_0x5d94d6,_0x80b287){this[_0x3998('0x84')]=_0x3998('0x85');this[_0x3998('0x86')]=_0x3c0e88['localstationid'];this[_0x3998('0x87')]=_0x80b287;this['type']='system';this['description']='Fax\x20Extension';this[_0x3998('0x64')]=_0x3c0e88['id'];this['priority']=_0x9bda70;this[_0x3998('0x88')]=_0x5d94d6;}function createExtensionsReciveFax(_0x223aca){var _0x1d611a=0x1;var _0x5476e8=[];_0x5476e8[_0x3998('0x89')](new Extension(_0x223aca,_0x1d611a,'',_0x3998('0x8a')));_0x1d611a+=0x1;_0x5476e8['push'](new Extension(_0x223aca,_0x1d611a,_0x3998('0x8b'),_0x3998('0x8c')));_0x1d611a+=0x1;for(var _0x2494e4 in _0x223aca){if(_0x223aca[_0x3998('0x4b')](_0x2494e4)&&(_0x2494e4===_0x3998('0x8d')||_0x2494e4===_0x3998('0x8e')||_0x2494e4===_0x3998('0x8f')||_0x2494e4==='faxdetect'||_0x2494e4===_0x3998('0x90')||_0x2494e4===_0x3998('0x91')||_0x2494e4==='minrate'||_0x2494e4===_0x3998('0x92')||_0x2494e4==='t38timeout')){_0x5476e8[_0x3998('0x89')](new Extension(_0x223aca,_0x1d611a,_0x3998('0x93')+_0x2494e4+')='+_0x223aca[_0x2494e4],_0x3998('0x8c')));_0x1d611a+=0x1;}}_0x5476e8[_0x3998('0x89')](new Extension(_0x223aca,_0x1d611a,'6','Wait'));_0x1d611a+=0x1;_0x5476e8[_0x3998('0x89')](new Extension(_0x223aca,_0x1d611a,_0x3998('0x94'),_0x3998('0x95')));_0x1d611a=0x0;return _0x5476e8;}exports['addAccountApplications']=function(_0x2a8239,_0x5d0ede,_0xab9fdb){var _0x14952;return db[_0x3998('0x7e')]['transaction'](function(_0x117cdb){return db['FaxAccount'][_0x3998('0x5a')](_0x2a8239[_0x3998('0x61')],{'transaction':_0x117cdb})[_0x3998('0x37')](function(_0x554ae3){_0x14952=_0x554ae3[_0x3998('0x39')]({'plain':!![]});return db[_0x3998('0x96')][_0x3998('0x81')](createExtensionsReciveFax(_0x14952),{'transaction':_0x117cdb});});})['then'](function(){return _0x14952;})[_0x3998('0x37')](respondWithResult(_0x5d0ede,null))[_0x3998('0x2b')](handleError(_0x5d0ede,null));};exports[_0x3998('0x97')]=function(_0x36b8f,_0x37da04,_0x252785){var _0x28eee4;return db[_0x3998('0x7e')][_0x3998('0x7f')](function(_0x342905){return db[_0x3998('0x41')]['update'](_0x36b8f[_0x3998('0x61')],{'where':{'id':_0x36b8f[_0x3998('0x61')]['id']},'transaction':_0x342905})[_0x3998('0x37')](function(_0x442d62){return db['VoiceExtension'][_0x3998('0x38')]({'where':{'FaxAccountId':_0x36b8f['body']['id']},'transaction':_0x342905})['then'](function(_0xcdd83f){return db[_0x3998('0x96')][_0x3998('0x81')](createExtensionsReciveFax(_[_0x3998('0x71')](_0x36b8f[_0x3998('0x61')],['tech',_0x3998('0x43'),_0x3998('0x98'),_0x3998('0x99'),_0x3998('0x9a'),_0x3998('0x9b')])),{'transaction':_0x342905});});});})[_0x3998('0x37')](function(){return db[_0x3998('0x41')][_0x3998('0x9c')](_0x36b8f[_0x3998('0x61')]['id']);})[_0x3998('0x37')](respondWithResult(_0x37da04,null))[_0x3998('0x2b')](handleError(_0x37da04,null));};exports[_0x3998('0x9d')]=function(_0x553549,_0x3a22cb,_0x122ad6){var _0x39a640={'raw':!![],'where':{}};var _0x36cd42={};var _0x1a8fd5={'count':0x0,'rows':[]};return db[_0x3998('0x41')]['findOne']({'where':{'id':_0x553549[_0x3998('0x56')]['id']}})[_0x3998('0x37')](handleEntityNotFound(_0x3a22cb,null))[_0x3998('0x37')](function(_0x4af520){if(_0x4af520){_0x36cd42[_0x3998('0x47')]=_[_0x3998('0x45')](db[_0x3998('0x9e')][_0x3998('0x67')]);_0x36cd42[_0x3998('0x44')]=_['keys'](_0x553549['query']);_0x36cd42[_0x3998('0x4f')]=_[_0x3998('0x46')](_0x36cd42[_0x3998('0x47')],_0x36cd42[_0x3998('0x44')]);_0x39a640[_0x3998('0x48')]=_[_0x3998('0x46')](_0x36cd42[_0x3998('0x47')],qs[_0x3998('0x49')](_0x553549['query'][_0x3998('0x49')]));_0x39a640[_0x3998('0x48')]=_0x39a640['attributes']['length']?_0x39a640[_0x3998('0x48')]:_0x36cd42[_0x3998('0x47')];if(!_0x553549[_0x3998('0x44')][_0x3998('0x4b')](_0x3998('0x4c'))){_0x39a640[_0x3998('0x30')]=qs[_0x3998('0x30')](_0x553549[_0x3998('0x44')][_0x3998('0x30')]);_0x39a640[_0x3998('0x32')]=qs[_0x3998('0x32')](_0x553549[_0x3998('0x44')][_0x3998('0x32')]);}_0x39a640['order']=qs[_0x3998('0x4d')](_0x553549[_0x3998('0x44')][_0x3998('0x4d')]);_0x39a640['where']=qs[_0x3998('0x4f')](_[_0x3998('0x50')](_0x553549[_0x3998('0x44')],_0x36cd42[_0x3998('0x4f')]));_0x39a640[_0x3998('0x4e')][_0x3998('0x64')]=_0x4af520['id'];if(_0x553549[_0x3998('0x44')]['filter']){_0x39a640['where']=_[_0x3998('0x53')](_0x39a640['where'],{'$or':_[_0x3998('0x40')](_0x39a640[_0x3998('0x48')],function(_0x2319fd){var _0xdc794c={};_0xdc794c[_0x2319fd]={'$like':'%'+_0x553549[_0x3998('0x44')][_0x3998('0x51')]+'%'};return _0xdc794c;})});}if(_0x553549['query'][_0x3998('0x9f')]){var _0x4cc62e=_0x553549[_0x3998('0x44')]['$gte'][_0x3998('0xa0')](',');var _0x412d51={};_0x412d51[_0x4cc62e[0x0]]={'$gte':moment(_0x4cc62e[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x39a640[_0x3998('0x4e')]=_[_0x3998('0x53')](_0x39a640[_0x3998('0x4e')],_0x412d51);}_0x39a640=_[_0x3998('0x53')]({},_0x39a640,_0x553549[_0x3998('0x58')]);return db[_0x3998('0x9e')][_0x3998('0x31')]({'where':_0x39a640[_0x3998('0x4e')]})[_0x3998('0x37')](function(_0x724d5){_0x1a8fd5[_0x3998('0x31')]=_0x724d5;if(_0x553549[_0x3998('0x44')][_0x3998('0x57')]){_0x39a640[_0x3998('0x54')]=[{'all':!![]}];}return db['FaxMessage']['findAll'](_0x39a640);})[_0x3998('0x37')](function(_0x3139ef){_0x1a8fd5[_0x3998('0x6c')]=_0x3139ef;return _0x1a8fd5;});}})['then'](respondWithFilteredResult(_0x3a22cb,_0x39a640))['catch'](handleError(_0x3a22cb,null));};exports[_0x3998('0x3c')]=function(_0x41ee09,_0x23c26c,_0x3d7281){var _0x156f40,_0x41d200={},_0x214ba5;if(_0x41ee09[_0x3998('0x61')]['to']){_0x214ba5=_0x41ee09[_0x3998('0x61')]['to'][0x0];}return db[_0x3998('0x41')][_0x3998('0x59')]({'where':{'id':_0x41ee09[_0x3998('0x56')]['id']},'include':[{'model':db[_0x3998('0xa1')],'as':_0x3998('0xa2'),'include':[{'model':db['CmContact'],'as':_0x3998('0xa3'),'where':{'fax':_0x214ba5},'limit':0x1,'order':[['updatedAt','DESC']]}]}]})['then'](handleEntityNotFound(_0x23c26c,null))[_0x3998('0x37')](function(_0x54dfd8){_0x156f40=_0x54dfd8;if(_0x41ee09['body'][_0x3998('0xa4')]&&_0x41ee09[_0x3998('0x61')]['attachments'][_0x3998('0x4a')]){for(var _0x20e069=0x0;_0x20e069<_0x41ee09[_0x3998('0x61')][_0x3998('0xa4')][_0x3998('0x4a')];_0x20e069+=0x1){_0x41ee09['body'][_0x3998('0xa4')][_0x20e069]={'filename':_0x41ee09[_0x3998('0x61')][_0x3998('0xa4')][_0x20e069][_0x3998('0x3b')],'id':_0x41ee09[_0x3998('0x61')][_0x3998('0xa4')][_0x20e069]['id'],'path':path[_0x3998('0xa5')](config[_0x3998('0xa6')],'server/files/attachments',_0x41ee09[_0x3998('0x61')]['attachments'][_0x20e069][_0x3998('0xa7')])};}}return respondWithRpcPromise(_0x3998('0xa8'),_0x3998('0xa8'),{'FaxAccountId':_['isNil'](_0x41ee09[_0x3998('0x56')]['id'])?undefined:_0x41ee09['params']['id'],'path':_['isNil'](_0x41ee09[_0x3998('0x61')][_0x3998('0xa4')][0x0][_0x3998('0x6')])?undefined:_0x41ee09['body'][_0x3998('0xa4')][0x0][_0x3998('0x6')],'fax':_[_0x3998('0xa9')](_0x41ee09[_0x3998('0x61')]['to'][0x0])?undefined:_0x41ee09[_0x3998('0x61')]['to'][0x0]},client9002);})[_0x3998('0x37')](function(){if(_0x156f40){if(_[_0x3998('0xa9')](_0x41ee09['body'][_0x3998('0xaa')])){_0x41ee09[_0x3998('0x61')]['from']=util[_0x3998('0xab')]('\x22%s\x22\x20<%s>',_0x156f40[_0x3998('0x3b')],_0x156f40['fax']);}if(_0x156f40['List']){if(_0x156f40[_0x3998('0xa2')][_0x3998('0xa3')][_0x3998('0x4a')]){return _0x156f40[_0x3998('0xa2')][_0x3998('0xa3')][0x0];}else{return db[_0x3998('0x74')][_0x3998('0x5a')](_[_0x3998('0x1b')](_0x41ee09['body'],{'firstName':_0x41ee09[_0x3998('0x61')]['to'][0x0],'phone':_0x41ee09[_0x3998('0x61')]['to'][0x0],'fax':_0x41ee09[_0x3998('0x61')]['to'][0x0],'ListId':_0x156f40[_0x3998('0x9b')]}));}}else{throw new Error(_0x3998('0xac'));}}else{throw new Error(_0x3998('0xad'));}})[_0x3998('0x37')](function(_0x3470a2){if(_0x3470a2){return db[_0x3998('0x70')][_0x3998('0x59')]({'where':{'ContactId':_0x3470a2['id'],'closed':![],'FaxAccountId':_0x156f40['id']}})[_0x3998('0x37')](function(_0x105424){if(_0x105424){return[_0x105424,![]];}return db[_0x3998('0x70')][_0x3998('0x5a')]({'UserId':_0x41ee09[_0x3998('0x5b')]['id'],'ContactId':_0x3470a2['id'],'FaxAccountId':_0x156f40['id'],'fax':_0x41ee09['body']['to'][0x0],'firstMsgDirection':_0x3998('0xae'),'Messages':[_[_0x3998('0x53')](_0x41ee09[_0x3998('0x61')],{'read':![],'body':_0x41ee09[_0x3998('0x61')][_0x3998('0xa4')][0x0][_0x3998('0xaf')],'FaxAccountId':_0x156f40['id'],'UserId':_0x41ee09[_0x3998('0x5b')]['id'],'ContactId':_0x3470a2['id'],'AttachmentId':_0x41ee09[_0x3998('0x61')][_0x3998('0xa4')][0x0]['id']})]},{'include':[{'model':db[_0x3998('0x9e')],'as':_0x3998('0xb0')}]})[_0x3998('0x37')](function(_0x5ded6c){return[_0x5ded6c,!![]];});});}else{throw new Error(_0x3998('0xb1'));}})[_0x3998('0xb2')](function(_0xc10977,_0x893918){if(_0x893918){return _0xc10977;}return db['FaxMessage']['create']({'direction':_0x3998('0xae'),'read':![],'body':_0x41ee09[_0x3998('0x61')][_0x3998('0xa4')][0x0]['filename'],'FaxAccountId':_0x156f40['id'],'FaxInteractionId':_0xc10977['id'],'UserId':_0x41ee09['user']['id'],'ContactId':_0xc10977[_0x3998('0xb3')],'AttachmentId':_0x41ee09[_0x3998('0x61')][_0x3998('0xa4')][0x0]['id']})[_0x3998('0x37')](function(_0x5ab869){_0xc10977[_0x3998('0xb4')]['Messages']=[];_0xc10977[_0x3998('0xb4')][_0x3998('0xb0')]['push'](_0x5ab869[_0x3998('0xb4')]);return _0xc10977;});})[_0x3998('0x37')](function(_0x1a4201){respondWithRpcPromise(_0x3998('0xb5'),_0x3998('0xb5'),{'FaxAccountId':_[_0x3998('0xa9')](_0x41ee09['params']['id'])?undefined:_0x41ee09[_0x3998('0x56')]['id'],'path':_['isNil'](_0x41ee09[_0x3998('0x61')][_0x3998('0xa4')][0x0][_0x3998('0x6')])?undefined:_0x41ee09['body']['attachments'][0x0][_0x3998('0x6')],'fax':_[_0x3998('0xa9')](_0x41ee09['body']['to'][0x0])?undefined:_0x41ee09['body']['to'][0x0],'AttachmentId':_0x41ee09[_0x3998('0x61')][_0x3998('0xa4')][0x0]['id']},client9002)['then'](function(_0x4bee07){logger[_0x3998('0x22')]('SendFaxRpc,\x20%s',_0x4bee07);})[_0x3998('0x2b')](function(_0x3e42f3){logger['info'](_0x3998('0xb6'),_0x3e42f3);});return _0x1a4201;})[_0x3998('0x37')](respondWithResult(_0x23c26c,null))[_0x3998('0x2b')](handleError(_0x23c26c,null));};exports['addAgents']=function(_0x4db54d,_0xb9590b,_0x3b082c){return db[_0x3998('0x41')][_0x3998('0x59')]({'where':{'id':_0x4db54d[_0x3998('0x56')]['id']}})['then'](handleEntityNotFound(_0xb9590b,null))[_0x3998('0x37')](function(_0x60ee2e){if(_0x60ee2e){return _0x60ee2e['addAgents'](_0x4db54d['body'][_0x3998('0x6e')],_[_0x3998('0x71')](_0x4db54d[_0x3998('0x61')],[_0x3998('0x6e'),'id'])||{})[_0x3998('0xb2')](function(_0x29983c){for(var _0x303190=0x0;_0x303190<_0x4db54d[_0x3998('0x61')]['ids'][_0x3998('0x4a')];_0x303190+=0x1){socket[_0x3998('0xb7')]('userFaxAccount:save',{'UserId':Number(_0x4db54d[_0x3998('0x61')]['ids'][_0x303190]),'FaxAccountId':Number(_0x4db54d['params']['id'])});}return _0x29983c;});}})[_0x3998('0x37')](respondWithResult(_0xb9590b,null))['catch'](handleError(_0xb9590b,null));};exports[_0x3998('0xb8')]=function(_0x37bdf7,_0x59f3b0,_0x3b0d9a){return db[_0x3998('0x41')]['find']({'where':{'id':_0x37bdf7[_0x3998('0x56')]['id']}})['then'](handleEntityNotFound(_0x59f3b0,null))[_0x3998('0x37')](function(_0x382113){if(_0x382113){return _0x382113[_0x3998('0xb8')](_0x37bdf7[_0x3998('0x44')][_0x3998('0x6e')])[_0x3998('0x37')](function(){if(_['isArray'](_0x37bdf7[_0x3998('0x44')][_0x3998('0x6e')])){for(var _0x450525=0x0;_0x450525<_0x37bdf7[_0x3998('0x44')][_0x3998('0x6e')]['length'];_0x450525+=0x1){socket[_0x3998('0xb7')](_0x3998('0xb9'),{'UserId':Number(_0x37bdf7['query'][_0x3998('0x6e')][_0x450525]),'FaxAccountId':Number(_0x37bdf7[_0x3998('0x56')]['id'])});}}else{socket[_0x3998('0xb7')]('userFaxAccount:remove',{'UserId':Number(_0x37bdf7[_0x3998('0x44')]['ids']),'FaxAccountId':Number(_0x37bdf7[_0x3998('0x56')]['id'])});}});}})[_0x3998('0x37')](respondWithStatusCode(_0x59f3b0,null))[_0x3998('0x2b')](handleError(_0x59f3b0,null));};exports[_0x3998('0xba')]=function(_0x1f15cb,_0x33964a,_0x332c3d){var _0x665ec6={};var _0x4e6b3a={};var _0x480636;var _0x5c664e;return db[_0x3998('0x41')][_0x3998('0x66')]({'where':{'id':_0x1f15cb[_0x3998('0x56')]['id']}})[_0x3998('0x37')](handleEntityNotFound(_0x33964a,null))['then'](function(_0x4bf597){if(_0x4bf597){_0x480636=_0x4bf597;_0x4e6b3a['model']=_[_0x3998('0x45')](db[_0x3998('0x76')][_0x3998('0x67')]);_0x4e6b3a[_0x3998('0x44')]=_['keys'](_0x1f15cb[_0x3998('0x44')]);_0x4e6b3a['filters']=_['intersection'](_0x4e6b3a[_0x3998('0x47')],_0x4e6b3a[_0x3998('0x44')]);_0x665ec6[_0x3998('0x48')]=_[_0x3998('0x46')](_0x4e6b3a[_0x3998('0x47')],qs[_0x3998('0x49')](_0x1f15cb[_0x3998('0x44')][_0x3998('0x49')]));_0x665ec6[_0x3998('0x48')]=_0x665ec6[_0x3998('0x48')][_0x3998('0x4a')]?_0x665ec6[_0x3998('0x48')]:_0x4e6b3a['model'];_0x665ec6[_0x3998('0x73')]=qs[_0x3998('0x4d')](_0x1f15cb['query'][_0x3998('0x4d')]);_0x665ec6[_0x3998('0x4e')]=qs[_0x3998('0x4f')](_[_0x3998('0x50')](_0x1f15cb[_0x3998('0x44')],_0x4e6b3a['filters']));if(_0x1f15cb[_0x3998('0x44')][_0x3998('0x51')]){_0x665ec6[_0x3998('0x4e')]=_[_0x3998('0x53')](_0x665ec6['where'],{'$or':_[_0x3998('0x40')](_0x665ec6[_0x3998('0x48')],function(_0x46270a){var _0x12d955={};_0x12d955[_0x46270a]={'$like':'%'+_0x1f15cb['query'][_0x3998('0x51')]+'%'};return _0x12d955;})});}_0x665ec6=_[_0x3998('0x53')]({},_0x665ec6,_0x1f15cb[_0x3998('0x58')]);return _0x480636[_0x3998('0xba')](_0x665ec6);}})[_0x3998('0x37')](function(_0x30b642){if(_0x30b642){_0x5c664e=_0x30b642[_0x3998('0x4a')];if(!_0x1f15cb[_0x3998('0x44')][_0x3998('0x4b')](_0x3998('0x4c'))){_0x665ec6[_0x3998('0x30')]=qs[_0x3998('0x30')](_0x1f15cb[_0x3998('0x44')][_0x3998('0x30')]);_0x665ec6[_0x3998('0x32')]=qs[_0x3998('0x32')](_0x1f15cb[_0x3998('0x44')][_0x3998('0x32')]);}return _0x480636[_0x3998('0xba')](_0x665ec6);}})['then'](function(_0x28bcde){if(_0x28bcde){return _0x28bcde?{'count':_0x5c664e,'rows':_0x28bcde}:null;}})[_0x3998('0x37')](respondWithResult(_0x33964a,null))[_0x3998('0x2b')](handleError(_0x33964a,null));}; \ No newline at end of file +var _0x4dd5=['Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','FaxAccountId','Disposition','findOne','hasOwnProperty','findAll','rows','removeDispositions','addAnswer','CannedAnswer','getAnswers','removeAnswers','ids','FaxInteraction','addInteraction','omit','getInteractions','CmContact','Contact','User','Owner','fullname','internal','Tag','Tags','tag','addApplications','sequelize','transaction','FaxApplication','context','from-voip-provider','localstationid','app','system','description','Fax\x20Extension','appdata','Answer','push','Set','faxdetect','headerinfo','maxrate','minrate','modem','FAXOPT(','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','addAccountApplications','bulkCreate','updateAccountApplications','VoiceExtension','tech','TrunkId','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','FaxMessage','CmList','Contacts','updatedAt','DESC','attachments','join','root','server/files/attachments','basename','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','fax','List','List\x20not\x20found','Send\x20Fax\x20failed','out','filename','Contact\x20not\x20found','spread','dataValues','Messages','SendFax','SendFaxRpc,\x20%s','emit','userFaxAccount:save','userFaxAccount:remove','getAgents','eml-format','fast-json-patch','moment','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./faxAccount.socket','register','client','http','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','end','json','undefined','count','limit','Content-Range','save','update','get','FaxAccounts','destroy','stack','name','send','index','mandatoryDispositionPause','map','FaxAccount','fieldName','key','query','keys','intersection','model','attributes','fields','length','nolimit','offset','order','sort','filters','pick','filter','where','type','merge','options','include','show','params','Pause','rawAttributes','includeAll','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','UserProfileResource'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x4dd5,0x1d2));var _0x54dd=function(_0x50433c,_0x110cfb){_0x50433c=_0x50433c-0x0;var _0x198c76=_0x4dd5[_0x50433c];return _0x198c76;};'use strict';var emlformat=require(_0x54dd('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x54dd('0x1'));var rp=require('request-promise');var moment=require(_0x54dd('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x54dd('0x3'));var path=require(_0x54dd('0x4'));var sox=require(_0x54dd('0x5'));var csv=require(_0x54dd('0x6'));var ejs=require(_0x54dd('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x54dd('0x8'));var squel=require(_0x54dd('0x9'));var crypto=require(_0x54dd('0xa'));var jsforce=require(_0x54dd('0xb'));var deskjs=require(_0x54dd('0xc'));var toCsv=require(_0x54dd('0x6'));var querystring=require(_0x54dd('0xd'));var Papa=require(_0x54dd('0xe'));var Redis=require(_0x54dd('0xf'));var authService=require(_0x54dd('0x10'));var qs=require(_0x54dd('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x54dd('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x54dd('0x13'));var licenseUtil=require(_0x54dd('0x14'));var db=require(_0x54dd('0x15'))['db'];config['redis']=_[_0x54dd('0x16')](config[_0x54dd('0x17')],{'host':_0x54dd('0x18'),'port':0x18eb});var socket=require(_0x54dd('0x19'))(new Redis(config[_0x54dd('0x17')]));require(_0x54dd('0x1a'))[_0x54dd('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson[_0x54dd('0x1c')][_0x54dd('0x1d')]({'port':0x232c});var client9002=jayson['client'][_0x54dd('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x31762c,_0x1de437,_0x403e3c,_0x2b80c4){return new BPromise(function(_0x38a990,_0xd18f5){var _0x130aa7=_0x2b80c4||client;return _0x130aa7['request'](_0x31762c,_0x403e3c)[_0x54dd('0x1e')](function(_0x4b38e2){logger[_0x54dd('0x1f')](_0x54dd('0x20'),_0x1de437,_0x54dd('0x21'));logger[_0x54dd('0x22')](_0x54dd('0x23'),_0x1de437,_0x54dd('0x21'),JSON[_0x54dd('0x24')](_0x4b38e2));if(_0x4b38e2['error']){if(_0x4b38e2['error']['code']===0x1f4){logger['error'](_0x54dd('0x20'),_0x1de437,_0x4b38e2[_0x54dd('0x25')][_0x54dd('0x26')]);return _0xd18f5(_0x4b38e2[_0x54dd('0x25')][_0x54dd('0x26')]);}logger[_0x54dd('0x25')](_0x54dd('0x20'),_0x1de437,_0x4b38e2[_0x54dd('0x25')][_0x54dd('0x26')]);return _0x38a990(_0x4b38e2[_0x54dd('0x25')]['message']);}else{logger[_0x54dd('0x1f')](_0x54dd('0x20'),_0x1de437,'request\x20sent');_0x38a990(_0x4b38e2[_0x54dd('0x27')][_0x54dd('0x26')]);}})[_0x54dd('0x28')](function(_0x5ee303){logger[_0x54dd('0x25')](_0x54dd('0x20'),_0x1de437,_0x5ee303);_0xd18f5(_0x5ee303);});});}function respondWithStatusCode(_0x52fb65,_0x8c1c27){_0x8c1c27=_0x8c1c27||0xcc;return function(_0x1960b9){if(_0x1960b9){return _0x52fb65[_0x54dd('0x29')](_0x8c1c27);}return _0x52fb65[_0x54dd('0x2a')](_0x8c1c27)[_0x54dd('0x2b')]();};}function respondWithResult(_0x2f9b26,_0x5bc624){_0x5bc624=_0x5bc624||0xc8;return function(_0x2aacfb){if(_0x2aacfb){return _0x2f9b26['status'](_0x5bc624)[_0x54dd('0x2c')](_0x2aacfb);}};}function respondWithFilteredResult(_0x4bf590,_0x5288a9){return function(_0x2d29a5){if(_0x2d29a5){var _0x476107=typeof _0x5288a9['offset']===_0x54dd('0x2d')&&typeof _0x5288a9['limit']===_0x54dd('0x2d');var _0x1da48d=_0x2d29a5[_0x54dd('0x2e')];var _0x4211ca=_0x476107?0x0:_0x5288a9['offset'];var _0x3f51ea=_0x476107?_0x2d29a5[_0x54dd('0x2e')]:_0x5288a9['offset']+_0x5288a9[_0x54dd('0x2f')];var _0x3e3d85;if(_0x3f51ea>=_0x1da48d){_0x3f51ea=_0x1da48d;_0x3e3d85=0xc8;}else{_0x3e3d85=0xce;}_0x4bf590['status'](_0x3e3d85);return _0x4bf590['set'](_0x54dd('0x30'),_0x4211ca+'-'+_0x3f51ea+'/'+_0x1da48d)[_0x54dd('0x2c')](_0x2d29a5);}return null;};}function patchUpdates(_0x166c4a){return function(_0x5b33fc){try{jsonpatch['apply'](_0x5b33fc,_0x166c4a,!![]);}catch(_0xa3878f){return BPromise['reject'](_0xa3878f);}return _0x5b33fc[_0x54dd('0x31')]();};}function saveUpdates(_0x377fcf,_0x14e4c4){return function(_0x22f739){if(_0x22f739){return _0x22f739[_0x54dd('0x32')](_0x377fcf)[_0x54dd('0x1e')](function(_0x4303b7){return _0x4303b7;});}return null;};}function removeEntity(_0x83cb35,_0x26d238){return function(_0x1694f1){if(_0x1694f1){return _0x1694f1['destroy']()[_0x54dd('0x1e')](function(){var _0x3e3256=_0x1694f1[_0x54dd('0x33')]({'plain':!![]});var _0x156c1c=_0x54dd('0x34');return db['UserProfileResource'][_0x54dd('0x35')]({'where':{'type':_0x156c1c,'resourceId':_0x3e3256['id']}})[_0x54dd('0x1e')](function(){return _0x1694f1;});})[_0x54dd('0x1e')](function(){_0x83cb35[_0x54dd('0x2a')](0xcc)[_0x54dd('0x2b')]();});}};}function handleEntityNotFound(_0x26e103,_0xe0bf40){return function(_0xa947c9){if(!_0xa947c9){_0x26e103[_0x54dd('0x29')](0x194);}return _0xa947c9;};}function handleError(_0x496f11,_0x1a489f){_0x1a489f=_0x1a489f||0x1f4;return function(_0x41583a){logger[_0x54dd('0x25')](_0x41583a[_0x54dd('0x36')]);if(_0x41583a[_0x54dd('0x37')]){delete _0x41583a['name'];}_0x496f11[_0x54dd('0x2a')](_0x1a489f)[_0x54dd('0x38')](_0x41583a);};}exports[_0x54dd('0x39')]=function(_0x423f2e,_0x560b13){var _0x4ad7de={'include':[{'model':db['Pause'],'as':_0x54dd('0x3a')}]},_0xa8a2da={},_0x4e2e15={'count':0x0,'rows':[]};var _0x3dc37e=_[_0x54dd('0x3b')](db[_0x54dd('0x3c')]['rawAttributes'],function(_0x325f91){return{'name':_0x325f91[_0x54dd('0x3d')],'type':_0x325f91['type'][_0x54dd('0x3e')]};});_0xa8a2da['model']=_[_0x54dd('0x3b')](_0x3dc37e,'name');_0xa8a2da[_0x54dd('0x3f')]=_[_0x54dd('0x40')](_0x423f2e[_0x54dd('0x3f')]);_0xa8a2da['filters']=_[_0x54dd('0x41')](_0xa8a2da[_0x54dd('0x42')],_0xa8a2da['query']);_0x4ad7de[_0x54dd('0x43')]=_['intersection'](_0xa8a2da[_0x54dd('0x42')],qs[_0x54dd('0x44')](_0x423f2e[_0x54dd('0x3f')][_0x54dd('0x44')]));_0x4ad7de['attributes']=_0x4ad7de['attributes'][_0x54dd('0x45')]?_0x4ad7de[_0x54dd('0x43')]:_0xa8a2da[_0x54dd('0x42')];if(!_0x423f2e[_0x54dd('0x3f')]['hasOwnProperty'](_0x54dd('0x46'))){_0x4ad7de[_0x54dd('0x2f')]=qs[_0x54dd('0x2f')](_0x423f2e['query'][_0x54dd('0x2f')]);_0x4ad7de[_0x54dd('0x47')]=qs['offset'](_0x423f2e[_0x54dd('0x3f')][_0x54dd('0x47')]);}_0x4ad7de[_0x54dd('0x48')]=qs[_0x54dd('0x49')](_0x423f2e[_0x54dd('0x3f')][_0x54dd('0x49')]);_0x4ad7de['where']=qs[_0x54dd('0x4a')](_[_0x54dd('0x4b')](_0x423f2e['query'],_0xa8a2da['filters']),_0x3dc37e);if(_0x423f2e[_0x54dd('0x3f')][_0x54dd('0x4c')]){_0x4ad7de[_0x54dd('0x4d')]=_['merge'](_0x4ad7de[_0x54dd('0x4d')],{'$or':_['map'](_0x3dc37e,function(_0x1abb0a){if(_0x1abb0a[_0x54dd('0x4e')]!=='VIRTUAL'){var _0x596a8c={};_0x596a8c[_0x1abb0a[_0x54dd('0x37')]]={'$like':'%'+_0x423f2e[_0x54dd('0x3f')][_0x54dd('0x4c')]+'%'};return _0x596a8c;}})});}_0x4ad7de=_[_0x54dd('0x4f')]({},_0x4ad7de,_0x423f2e[_0x54dd('0x50')]);var _0x15f70c={'where':_0x4ad7de[_0x54dd('0x4d')]};return db[_0x54dd('0x3c')][_0x54dd('0x2e')](_0x15f70c)['then'](function(_0xe67ac4){_0x4e2e15['count']=_0xe67ac4;if(_0x423f2e[_0x54dd('0x3f')]['includeAll']){_0x4ad7de[_0x54dd('0x51')]=[{'all':!![]}];}return db[_0x54dd('0x3c')]['findAll'](_0x4ad7de);})[_0x54dd('0x1e')](function(_0x5e1583){_0x4e2e15['rows']=_0x5e1583;return _0x4e2e15;})[_0x54dd('0x1e')](respondWithFilteredResult(_0x560b13,_0x4ad7de))[_0x54dd('0x28')](handleError(_0x560b13,null));};exports[_0x54dd('0x52')]=function(_0x2dc312,_0x43b4c8){var _0x43b97e={'raw':![],'where':{'id':_0x2dc312[_0x54dd('0x53')]['id']},'include':[{'model':db[_0x54dd('0x54')],'as':'mandatoryDispositionPause'}]},_0xe904c7={};_0xe904c7[_0x54dd('0x42')]=_[_0x54dd('0x40')](db[_0x54dd('0x3c')][_0x54dd('0x55')]);_0xe904c7[_0x54dd('0x3f')]=_['keys'](_0x2dc312[_0x54dd('0x3f')]);_0xe904c7[_0x54dd('0x4a')]=_['intersection'](_0xe904c7['model'],_0xe904c7[_0x54dd('0x3f')]);_0x43b97e[_0x54dd('0x43')]=_[_0x54dd('0x41')](_0xe904c7['model'],qs[_0x54dd('0x44')](_0x2dc312[_0x54dd('0x3f')][_0x54dd('0x44')]));_0x43b97e[_0x54dd('0x43')]=_0x43b97e[_0x54dd('0x43')][_0x54dd('0x45')]?_0x43b97e[_0x54dd('0x43')]:_0xe904c7[_0x54dd('0x42')];if(_0x2dc312[_0x54dd('0x3f')][_0x54dd('0x56')]){_0x43b97e[_0x54dd('0x51')]=[{'all':!![]}];}_0x43b97e=_[_0x54dd('0x4f')]({},_0x43b97e,_0x2dc312['options']);return db[_0x54dd('0x3c')][_0x54dd('0x57')](_0x43b97e)['then'](handleEntityNotFound(_0x43b4c8,null))[_0x54dd('0x1e')](respondWithResult(_0x43b4c8,null))[_0x54dd('0x28')](handleError(_0x43b4c8,null));};exports[_0x54dd('0x58')]=function(_0x17818a,_0x55932c){return db[_0x54dd('0x3c')][_0x54dd('0x58')](_0x17818a[_0x54dd('0x59')],{})[_0x54dd('0x1e')](function(_0xda3c82){var _0x33aa2f=_0x17818a['user'][_0x54dd('0x33')]({'plain':!![]});if(!_0x33aa2f)throw new Error(_0x54dd('0x5a'));if(_0x33aa2f[_0x54dd('0x5b')]===_0x54dd('0x5c')){var _0x3782e9=_0xda3c82[_0x54dd('0x33')]({'plain':!![]});var _0x411097=_0x54dd('0x34');return db[_0x54dd('0x5d')][_0x54dd('0x57')]({'where':{'name':_0x411097,'userProfileId':_0x33aa2f['userProfileId']},'raw':!![]})[_0x54dd('0x1e')](function(_0x155187){if(_0x155187&&_0x155187['autoAssociation']===0x0){return db[_0x54dd('0x5e')]['create']({'name':_0x3782e9[_0x54dd('0x37')],'resourceId':_0x3782e9['id'],'type':_0x155187[_0x54dd('0x37')],'sectionId':_0x155187['id']},{})[_0x54dd('0x1e')](function(){return _0xda3c82;});}else{return _0xda3c82;}})[_0x54dd('0x28')](function(_0x4f8b30){logger[_0x54dd('0x25')](_0x54dd('0x5f'),_0x4f8b30);throw _0x4f8b30;});}return _0xda3c82;})[_0x54dd('0x1e')](respondWithResult(_0x55932c,0xc9))['catch'](handleError(_0x55932c,null));};exports[_0x54dd('0x32')]=function(_0x518899,_0xeb2377){if(_0x518899[_0x54dd('0x59')]['id']){delete _0x518899['body']['id'];}return db[_0x54dd('0x3c')][_0x54dd('0x57')]({'where':{'id':_0x518899[_0x54dd('0x53')]['id']},'include':[{'model':db[_0x54dd('0x54')],'as':_0x54dd('0x3a')}]})[_0x54dd('0x1e')](handleEntityNotFound(_0xeb2377,null))[_0x54dd('0x1e')](saveUpdates(_0x518899[_0x54dd('0x59')],null))[_0x54dd('0x1e')](respondWithResult(_0xeb2377,null))[_0x54dd('0x28')](handleError(_0xeb2377,null));};exports['destroy']=function(_0x4c0338,_0x2414a5){return db[_0x54dd('0x3c')][_0x54dd('0x57')]({'where':{'id':_0x4c0338['params']['id']}})[_0x54dd('0x1e')](handleEntityNotFound(_0x2414a5,null))['then'](removeEntity(_0x2414a5,null))[_0x54dd('0x28')](handleError(_0x2414a5,null));};exports[_0x54dd('0x60')]=function(_0x443dcd,_0x19bdf5){return db['FaxAccount'][_0x54dd('0x60')]()['then'](respondWithResult(_0x19bdf5,null))[_0x54dd('0x28')](handleError(_0x19bdf5,null));};exports[_0x54dd('0x61')]=function(_0x3b30c8,_0x23851f,_0x261c12){if(_0x3b30c8[_0x54dd('0x59')]['id']){delete _0x3b30c8[_0x54dd('0x59')]['id'];}return db['FaxAccount'][_0x54dd('0x57')]({'where':{'id':_0x3b30c8[_0x54dd('0x53')]['id']}})[_0x54dd('0x1e')](handleEntityNotFound(_0x23851f,null))['then'](function(_0x4d98d9){if(_0x4d98d9){_0x3b30c8[_0x54dd('0x59')][_0x54dd('0x62')]=_0x4d98d9['id'];return db[_0x54dd('0x63')][_0x54dd('0x58')](_0x3b30c8[_0x54dd('0x59')]);}})[_0x54dd('0x1e')](respondWithResult(_0x23851f,null))[_0x54dd('0x28')](handleError(_0x23851f,null));};exports['getDispositions']=function(_0x480d13,_0xc019e5,_0x518d1a){var _0x42b7a6={'raw':![],'where':{}};var _0x150cf4={};var _0x3bfc0e={'count':0x0,'rows':[]};return db['FaxAccount'][_0x54dd('0x64')]({'where':{'id':_0x480d13['params']['id']}})[_0x54dd('0x1e')](handleEntityNotFound(_0xc019e5,null))['then'](function(_0x1c3df2){if(_0x1c3df2){_0x150cf4[_0x54dd('0x42')]=_['keys'](db[_0x54dd('0x63')][_0x54dd('0x55')]);_0x150cf4['query']=_[_0x54dd('0x40')](_0x480d13['query']);_0x150cf4[_0x54dd('0x4a')]=_['intersection'](_0x150cf4[_0x54dd('0x42')],_0x150cf4[_0x54dd('0x3f')]);_0x42b7a6[_0x54dd('0x43')]=_[_0x54dd('0x41')](_0x150cf4[_0x54dd('0x42')],qs[_0x54dd('0x44')](_0x480d13[_0x54dd('0x3f')][_0x54dd('0x44')]));_0x42b7a6['attributes']=_0x42b7a6[_0x54dd('0x43')]['length']?_0x42b7a6['attributes']:_0x150cf4[_0x54dd('0x42')];if(!_0x480d13['query'][_0x54dd('0x65')](_0x54dd('0x46'))){_0x42b7a6[_0x54dd('0x2f')]=qs[_0x54dd('0x2f')](_0x480d13['query'][_0x54dd('0x2f')]);_0x42b7a6[_0x54dd('0x47')]=qs[_0x54dd('0x47')](_0x480d13[_0x54dd('0x3f')][_0x54dd('0x47')]);}_0x42b7a6[_0x54dd('0x48')]=qs[_0x54dd('0x49')](_0x480d13['query']['sort']);_0x42b7a6[_0x54dd('0x4d')]=qs[_0x54dd('0x4a')](_[_0x54dd('0x4b')](_0x480d13[_0x54dd('0x3f')],_0x150cf4[_0x54dd('0x4a')]));_0x42b7a6[_0x54dd('0x4d')]['FaxAccountId']=_0x1c3df2['id'];if(_0x480d13[_0x54dd('0x3f')][_0x54dd('0x4c')]){_0x42b7a6[_0x54dd('0x4d')]=_[_0x54dd('0x4f')](_0x42b7a6[_0x54dd('0x4d')],{'$or':_[_0x54dd('0x3b')](_0x42b7a6[_0x54dd('0x43')],function(_0x22a5da){var _0x4a4436={};_0x4a4436[_0x22a5da]={'$like':'%'+_0x480d13[_0x54dd('0x3f')][_0x54dd('0x4c')]+'%'};return _0x4a4436;})});}_0x42b7a6=_['merge']({},_0x42b7a6,_0x480d13[_0x54dd('0x50')]);return db[_0x54dd('0x63')][_0x54dd('0x2e')]({'where':_0x42b7a6[_0x54dd('0x4d')]})[_0x54dd('0x1e')](function(_0x1d366b){_0x3bfc0e[_0x54dd('0x2e')]=_0x1d366b;if(_0x480d13[_0x54dd('0x3f')][_0x54dd('0x56')]){_0x42b7a6[_0x54dd('0x51')]=[{'all':!![]}];}return db[_0x54dd('0x63')][_0x54dd('0x66')](_0x42b7a6);})['then'](function(_0x368be7){_0x3bfc0e[_0x54dd('0x67')]=_0x368be7;return _0x3bfc0e;});}})[_0x54dd('0x1e')](respondWithFilteredResult(_0xc019e5,_0x42b7a6))[_0x54dd('0x28')](handleError(_0xc019e5,null));};exports[_0x54dd('0x68')]=function(_0x307677,_0xe7f503,_0x3d483e){return db['FaxAccount'][_0x54dd('0x57')]({'where':{'id':_0x307677[_0x54dd('0x53')]['id']}})[_0x54dd('0x1e')](handleEntityNotFound(_0xe7f503,null))[_0x54dd('0x1e')](function(_0x4ac974){if(_0x4ac974){return _0x4ac974['removeDispositions'](_0x307677[_0x54dd('0x3f')]['ids']);}})[_0x54dd('0x1e')](respondWithStatusCode(_0xe7f503,null))[_0x54dd('0x28')](handleError(_0xe7f503,null));};exports[_0x54dd('0x69')]=function(_0x25aef1,_0x33a0fd,_0x2edfb3){if(_0x25aef1[_0x54dd('0x59')]['id']){delete _0x25aef1[_0x54dd('0x59')]['id'];}return db[_0x54dd('0x3c')]['find']({'where':{'id':_0x25aef1['params']['id']}})[_0x54dd('0x1e')](handleEntityNotFound(_0x33a0fd,null))[_0x54dd('0x1e')](function(_0x5cbc1a){if(_0x5cbc1a){_0x25aef1[_0x54dd('0x59')][_0x54dd('0x62')]=_0x5cbc1a['id'];return db[_0x54dd('0x6a')]['create'](_0x25aef1[_0x54dd('0x59')]);}})[_0x54dd('0x1e')](respondWithResult(_0x33a0fd,null))[_0x54dd('0x28')](handleError(_0x33a0fd,null));};exports[_0x54dd('0x6b')]=function(_0x4af274,_0xf43762,_0x1c8257){var _0x14793b={'raw':![],'where':{}};var _0x4aba37={};var _0x4255d3={'count':0x0,'rows':[]};return db['FaxAccount']['findOne']({'where':{'id':_0x4af274[_0x54dd('0x53')]['id']}})[_0x54dd('0x1e')](handleEntityNotFound(_0xf43762,null))[_0x54dd('0x1e')](function(_0x50632f){if(_0x50632f){_0x4aba37['model']=_[_0x54dd('0x40')](db[_0x54dd('0x6a')][_0x54dd('0x55')]);_0x4aba37['query']=_['keys'](_0x4af274['query']);_0x4aba37['filters']=_[_0x54dd('0x41')](_0x4aba37[_0x54dd('0x42')],_0x4aba37[_0x54dd('0x3f')]);_0x14793b['attributes']=_[_0x54dd('0x41')](_0x4aba37[_0x54dd('0x42')],qs[_0x54dd('0x44')](_0x4af274['query'][_0x54dd('0x44')]));_0x14793b[_0x54dd('0x43')]=_0x14793b['attributes']['length']?_0x14793b[_0x54dd('0x43')]:_0x4aba37[_0x54dd('0x42')];if(!_0x4af274[_0x54dd('0x3f')]['hasOwnProperty'](_0x54dd('0x46'))){_0x14793b[_0x54dd('0x2f')]=qs[_0x54dd('0x2f')](_0x4af274[_0x54dd('0x3f')]['limit']);_0x14793b['offset']=qs[_0x54dd('0x47')](_0x4af274[_0x54dd('0x3f')][_0x54dd('0x47')]);}_0x14793b[_0x54dd('0x48')]=qs['sort'](_0x4af274['query'][_0x54dd('0x49')]);_0x14793b[_0x54dd('0x4d')]=qs[_0x54dd('0x4a')](_['pick'](_0x4af274[_0x54dd('0x3f')],_0x4aba37[_0x54dd('0x4a')]));_0x14793b[_0x54dd('0x4d')][_0x54dd('0x62')]=_0x50632f['id'];if(_0x4af274[_0x54dd('0x3f')][_0x54dd('0x4c')]){_0x14793b[_0x54dd('0x4d')]=_[_0x54dd('0x4f')](_0x14793b['where'],{'$or':_[_0x54dd('0x3b')](_0x14793b[_0x54dd('0x43')],function(_0x485aca){var _0x5dfc85={};_0x5dfc85[_0x485aca]={'$like':'%'+_0x4af274[_0x54dd('0x3f')][_0x54dd('0x4c')]+'%'};return _0x5dfc85;})});}_0x14793b=_[_0x54dd('0x4f')]({},_0x14793b,_0x4af274['options']);return db['CannedAnswer']['count']({'where':_0x14793b[_0x54dd('0x4d')]})[_0x54dd('0x1e')](function(_0x15b25f){_0x4255d3[_0x54dd('0x2e')]=_0x15b25f;if(_0x4af274[_0x54dd('0x3f')][_0x54dd('0x56')]){_0x14793b[_0x54dd('0x51')]=[{'all':!![]}];}return db[_0x54dd('0x6a')][_0x54dd('0x66')](_0x14793b);})[_0x54dd('0x1e')](function(_0x3cc90f){_0x4255d3[_0x54dd('0x67')]=_0x3cc90f;return _0x4255d3;});}})[_0x54dd('0x1e')](respondWithFilteredResult(_0xf43762,_0x14793b))[_0x54dd('0x28')](handleError(_0xf43762,null));};exports[_0x54dd('0x6c')]=function(_0x338a10,_0x466a40,_0x47aa39){return db[_0x54dd('0x3c')][_0x54dd('0x57')]({'where':{'id':_0x338a10[_0x54dd('0x53')]['id']}})[_0x54dd('0x1e')](handleEntityNotFound(_0x466a40,null))['then'](function(_0x44403e){if(_0x44403e){return _0x44403e[_0x54dd('0x6c')](_0x338a10[_0x54dd('0x3f')][_0x54dd('0x6d')]);}})[_0x54dd('0x1e')](respondWithStatusCode(_0x466a40,null))[_0x54dd('0x28')](handleError(_0x466a40,null));};exports['addInteraction']=function(_0x31b376,_0x27e36a,_0x4734d4){return db[_0x54dd('0x6e')][_0x54dd('0x57')]({'where':{'id':_0x31b376['params']['id']}})[_0x54dd('0x1e')](handleEntityNotFound(_0x27e36a,null))[_0x54dd('0x1e')](function(_0x10a032){if(_0x10a032){return _0x10a032[_0x54dd('0x6f')](_0x31b376[_0x54dd('0x59')][_0x54dd('0x6d')],_[_0x54dd('0x70')](_0x31b376[_0x54dd('0x59')],['ids','id'])||{});}})[_0x54dd('0x1e')](respondWithResult(_0x27e36a,null))['catch'](handleError(_0x27e36a,null));};exports[_0x54dd('0x71')]=function(_0x55e37d,_0x357f96,_0x23cfed){var _0x55eee7={'raw':![],'where':{}};var _0x7196ef={};var _0x39b6e5={'count':0x0,'rows':[]};return db[_0x54dd('0x3c')][_0x54dd('0x64')]({'where':{'id':_0x55e37d[_0x54dd('0x53')]['id']}})[_0x54dd('0x1e')](handleEntityNotFound(_0x357f96,null))[_0x54dd('0x1e')](function(_0x173a44){if(_0x173a44){_0x7196ef[_0x54dd('0x42')]=_[_0x54dd('0x40')](db[_0x54dd('0x6e')]['rawAttributes']);_0x7196ef[_0x54dd('0x3f')]=_['keys'](_0x55e37d['query']);_0x7196ef['filters']=_[_0x54dd('0x41')](_0x7196ef['model'],_0x7196ef[_0x54dd('0x3f')]);_0x55eee7[_0x54dd('0x43')]=_[_0x54dd('0x41')](_0x7196ef[_0x54dd('0x42')],qs[_0x54dd('0x44')](_0x55e37d['query'][_0x54dd('0x44')]));_0x55eee7[_0x54dd('0x43')]=_0x55eee7[_0x54dd('0x43')][_0x54dd('0x45')]?_0x55eee7['attributes']:_0x7196ef['model'];if(!_0x55e37d[_0x54dd('0x3f')][_0x54dd('0x65')]('nolimit')){_0x55eee7[_0x54dd('0x2f')]=qs[_0x54dd('0x2f')](_0x55e37d[_0x54dd('0x3f')]['limit']);_0x55eee7[_0x54dd('0x47')]=qs['offset'](_0x55e37d[_0x54dd('0x3f')]['offset']);}_0x55eee7[_0x54dd('0x48')]=qs[_0x54dd('0x49')](_0x55e37d[_0x54dd('0x3f')][_0x54dd('0x49')]);_0x55eee7['where']=qs[_0x54dd('0x4a')](_[_0x54dd('0x4b')](_0x55e37d[_0x54dd('0x3f')],_0x7196ef['filters']));_0x55eee7[_0x54dd('0x4d')]['FaxAccountId']=_0x173a44['id'];if(_0x55e37d['query'][_0x54dd('0x4c')]){_0x55eee7[_0x54dd('0x4d')]=_[_0x54dd('0x4f')](_0x55eee7[_0x54dd('0x4d')],{'$or':_[_0x54dd('0x3b')](_0x55eee7[_0x54dd('0x43')],function(_0x3a37f5){var _0x4fdbfd={};_0x4fdbfd[_0x3a37f5]={'$like':'%'+_0x55e37d[_0x54dd('0x3f')][_0x54dd('0x4c')]+'%'};return _0x4fdbfd;})});}_0x55eee7=_['merge']({},_0x55eee7,_0x55e37d['options']);return db[_0x54dd('0x6e')][_0x54dd('0x2e')]({'where':_0x55eee7[_0x54dd('0x4d')]})['then'](function(_0x3fa124){_0x39b6e5['count']=_0x3fa124;if(_0x55e37d['query']['includeAll']){_0x55eee7[_0x54dd('0x51')]=[{'model':db[_0x54dd('0x72')],'as':_0x54dd('0x73'),'required':![]},{'model':db[_0x54dd('0x74')],'as':_0x54dd('0x75'),'attributes':['name',_0x54dd('0x76'),_0x54dd('0x77')],'required':![]},{'model':db[_0x54dd('0x78')],'as':_0x54dd('0x79'),'attributes':['id',_0x54dd('0x37'),'color'],'where':_0x55e37d[_0x54dd('0x3f')][_0x54dd('0x7a')]?{'id':_0x55e37d[_0x54dd('0x3f')][_0x54dd('0x7a')]}:undefined,'required':_0x55e37d[_0x54dd('0x3f')]['tag']?!![]:![]}];}return db['FaxInteraction'][_0x54dd('0x66')](_0x55eee7);})[_0x54dd('0x1e')](function(_0x4bc43c){_0x39b6e5[_0x54dd('0x67')]=_0x4bc43c;return _0x39b6e5;});}})[_0x54dd('0x1e')](respondWithFilteredResult(_0x357f96,_0x55eee7))['catch'](handleError(_0x357f96,null));};exports[_0x54dd('0x7b')]=function(_0x5d1fe2,_0xfd5ce,_0x2ad0b5){return db[_0x54dd('0x3c')][_0x54dd('0x64')]({'where':{'id':_0x5d1fe2[_0x54dd('0x53')]['id']}})['then'](handleEntityNotFound(_0xfd5ce,null))[_0x54dd('0x1e')](function(_0x1f59bc){if(_0x1f59bc){return db[_0x54dd('0x7c')][_0x54dd('0x7d')](function(_0x5e97df){return db[_0x54dd('0x7e')][_0x54dd('0x35')]({'where':{'FaxAccountId':_0x5d1fe2[_0x54dd('0x53')]['id']},'transaction':_0x5e97df})[_0x54dd('0x1e')](function(_0x432ba0){var _0x11562c=_['map'](_0x5d1fe2[_0x54dd('0x59')],function(_0x4f5b93){_0x4f5b93['FaxAccountId']=_0x5d1fe2[_0x54dd('0x53')]['id'];return _0x4f5b93;});return db[_0x54dd('0x7e')]['bulkCreate'](_0x11562c,{'transaction':_0x5e97df});});})[_0x54dd('0x1e')](function(){return db[_0x54dd('0x7e')]['findAndCountAll']({'where':{'FaxAccountId':_0x5d1fe2[_0x54dd('0x53')]['id']},'order':'priority'});});}})[_0x54dd('0x1e')](respondWithResult(_0xfd5ce,null))['catch'](handleError(_0xfd5ce,null));};exports['getApplications']=function(_0x364227,_0x5a811c,_0xadb5f9){var _0x504338={};var _0x2bba98={};var _0x525395;var _0x30506;return db[_0x54dd('0x3c')][_0x54dd('0x64')]({'where':{'id':_0x364227[_0x54dd('0x53')]['id']}})[_0x54dd('0x1e')](handleEntityNotFound(_0x5a811c,null))[_0x54dd('0x1e')](function(_0x16f583){if(_0x16f583){_0x525395=_0x16f583;_0x2bba98['model']=_['keys'](db['FaxApplication'][_0x54dd('0x55')]);_0x2bba98[_0x54dd('0x3f')]=_[_0x54dd('0x40')](_0x364227['query']);_0x2bba98[_0x54dd('0x4a')]=_[_0x54dd('0x41')](_0x2bba98[_0x54dd('0x42')],_0x2bba98[_0x54dd('0x3f')]);_0x504338['attributes']=_[_0x54dd('0x41')](_0x2bba98[_0x54dd('0x42')],qs[_0x54dd('0x44')](_0x364227[_0x54dd('0x3f')][_0x54dd('0x44')]));_0x504338[_0x54dd('0x43')]=_0x504338[_0x54dd('0x43')][_0x54dd('0x45')]?_0x504338[_0x54dd('0x43')]:_0x2bba98[_0x54dd('0x42')];_0x504338['order']=qs[_0x54dd('0x49')](_0x364227[_0x54dd('0x3f')][_0x54dd('0x49')]);_0x504338['where']=qs[_0x54dd('0x4a')](_['pick'](_0x364227[_0x54dd('0x3f')],_0x2bba98[_0x54dd('0x4a')]));if(_0x364227['query'][_0x54dd('0x4c')]){_0x504338[_0x54dd('0x4d')]=_[_0x54dd('0x4f')](_0x504338[_0x54dd('0x4d')],{'$or':_[_0x54dd('0x3b')](_0x504338[_0x54dd('0x43')],function(_0x134052){var _0x2eae11={};_0x2eae11[_0x134052]={'$like':'%'+_0x364227[_0x54dd('0x3f')][_0x54dd('0x4c')]+'%'};return _0x2eae11;})});}_0x504338=_[_0x54dd('0x4f')]({},_0x504338,_0x364227[_0x54dd('0x50')]);return _0x525395['getApplications'](_0x504338);}})['then'](function(_0x4476b0){if(_0x4476b0){_0x30506=_0x4476b0['length'];if(!_0x364227['query'][_0x54dd('0x65')]('nolimit')){_0x504338['limit']=qs[_0x54dd('0x2f')](_0x364227['query']['limit']);_0x504338[_0x54dd('0x47')]=qs[_0x54dd('0x47')](_0x364227['query'][_0x54dd('0x47')]);}return _0x525395['getApplications'](_0x504338);}})[_0x54dd('0x1e')](function(_0x3c9fcc){if(_0x3c9fcc){return _0x3c9fcc?{'count':_0x30506,'rows':_0x3c9fcc}:null;}})[_0x54dd('0x1e')](respondWithResult(_0x5a811c,null))[_0x54dd('0x28')](handleError(_0x5a811c,null));};function Extension(_0x5e19ca,_0x301954,_0x179244,_0xe028c4){this[_0x54dd('0x7f')]=_0x54dd('0x80');this['exten']=_0x5e19ca[_0x54dd('0x81')];this[_0x54dd('0x82')]=_0xe028c4;this[_0x54dd('0x4e')]=_0x54dd('0x83');this[_0x54dd('0x84')]=_0x54dd('0x85');this['FaxAccountId']=_0x5e19ca['id'];this['priority']=_0x301954;this[_0x54dd('0x86')]=_0x179244;}function createExtensionsReciveFax(_0x68197d){var _0x1b8024=0x1;var _0x5aed3f=[];_0x5aed3f['push'](new Extension(_0x68197d,_0x1b8024,'',_0x54dd('0x87')));_0x1b8024+=0x1;_0x5aed3f[_0x54dd('0x88')](new Extension(_0x68197d,_0x1b8024,'CDR(type)=inbound-fax',_0x54dd('0x89')));_0x1b8024+=0x1;for(var _0x4975ea in _0x68197d){if(_0x68197d[_0x54dd('0x65')](_0x4975ea)&&(_0x4975ea==='ecm'||_0x4975ea===_0x54dd('0x81')||_0x4975ea==='gateway'||_0x4975ea===_0x54dd('0x8a')||_0x4975ea===_0x54dd('0x8b')||_0x4975ea===_0x54dd('0x8c')||_0x4975ea===_0x54dd('0x8d')||_0x4975ea===_0x54dd('0x8e')||_0x4975ea==='t38timeout')){_0x5aed3f[_0x54dd('0x88')](new Extension(_0x68197d,_0x1b8024,_0x54dd('0x8f')+_0x4975ea+')='+_0x68197d[_0x4975ea],_0x54dd('0x89')));_0x1b8024+=0x1;}}_0x5aed3f[_0x54dd('0x88')](new Extension(_0x68197d,_0x1b8024,'6',_0x54dd('0x90')));_0x1b8024+=0x1;_0x5aed3f['push'](new Extension(_0x68197d,_0x1b8024,_0x54dd('0x91'),_0x54dd('0x92')));_0x1b8024=0x0;return _0x5aed3f;}exports[_0x54dd('0x93')]=function(_0x52c6d0,_0x2b2aa8,_0x12661d){var _0x10d953;return db[_0x54dd('0x7c')]['transaction'](function(_0x4bd759){return db[_0x54dd('0x3c')][_0x54dd('0x58')](_0x52c6d0[_0x54dd('0x59')],{'transaction':_0x4bd759})['then'](function(_0x1288c2){_0x10d953=_0x1288c2[_0x54dd('0x33')]({'plain':!![]});return db['VoiceExtension'][_0x54dd('0x94')](createExtensionsReciveFax(_0x10d953),{'transaction':_0x4bd759});});})[_0x54dd('0x1e')](function(){return _0x10d953;})['then'](respondWithResult(_0x2b2aa8,null))['catch'](handleError(_0x2b2aa8,null));};exports[_0x54dd('0x95')]=function(_0x2bc1db,_0x27bf26,_0x3de533){var _0x32b458;return db[_0x54dd('0x7c')]['transaction'](function(_0x20d20c){return db[_0x54dd('0x3c')][_0x54dd('0x32')](_0x2bc1db[_0x54dd('0x59')],{'where':{'id':_0x2bc1db[_0x54dd('0x59')]['id']},'transaction':_0x20d20c})['then'](function(_0x3eaf8d){return db[_0x54dd('0x96')][_0x54dd('0x35')]({'where':{'FaxAccountId':_0x2bc1db[_0x54dd('0x59')]['id']},'transaction':_0x20d20c})[_0x54dd('0x1e')](function(_0x58a152){return db[_0x54dd('0x96')][_0x54dd('0x94')](createExtensionsReciveFax(_[_0x54dd('0x70')](_0x2bc1db['body'],[_0x54dd('0x97'),'key','createdAt','updatedAt',_0x54dd('0x98'),'ListId'])),{'transaction':_0x20d20c});});});})['then'](function(){return db[_0x54dd('0x3c')]['findById'](_0x2bc1db[_0x54dd('0x59')]['id']);})['then'](respondWithResult(_0x27bf26,null))[_0x54dd('0x28')](handleError(_0x27bf26,null));};exports['getMessages']=function(_0x5cb187,_0x5691cf,_0x2a18d1){var _0x542a76={'raw':!![],'where':{}};var _0x3660a3={};var _0x54e172={'count':0x0,'rows':[]};return db[_0x54dd('0x3c')][_0x54dd('0x64')]({'where':{'id':_0x5cb187[_0x54dd('0x53')]['id']}})[_0x54dd('0x1e')](handleEntityNotFound(_0x5691cf,null))['then'](function(_0x2284fd){if(_0x2284fd){_0x3660a3[_0x54dd('0x42')]=_[_0x54dd('0x40')](db['FaxMessage'][_0x54dd('0x55')]);_0x3660a3[_0x54dd('0x3f')]=_[_0x54dd('0x40')](_0x5cb187[_0x54dd('0x3f')]);_0x3660a3[_0x54dd('0x4a')]=_[_0x54dd('0x41')](_0x3660a3[_0x54dd('0x42')],_0x3660a3[_0x54dd('0x3f')]);_0x542a76[_0x54dd('0x43')]=_[_0x54dd('0x41')](_0x3660a3[_0x54dd('0x42')],qs[_0x54dd('0x44')](_0x5cb187['query']['fields']));_0x542a76[_0x54dd('0x43')]=_0x542a76[_0x54dd('0x43')][_0x54dd('0x45')]?_0x542a76['attributes']:_0x3660a3[_0x54dd('0x42')];if(!_0x5cb187[_0x54dd('0x3f')][_0x54dd('0x65')](_0x54dd('0x46'))){_0x542a76[_0x54dd('0x2f')]=qs[_0x54dd('0x2f')](_0x5cb187[_0x54dd('0x3f')]['limit']);_0x542a76[_0x54dd('0x47')]=qs[_0x54dd('0x47')](_0x5cb187[_0x54dd('0x3f')][_0x54dd('0x47')]);}_0x542a76[_0x54dd('0x48')]=qs[_0x54dd('0x49')](_0x5cb187[_0x54dd('0x3f')][_0x54dd('0x49')]);_0x542a76['where']=qs[_0x54dd('0x4a')](_[_0x54dd('0x4b')](_0x5cb187[_0x54dd('0x3f')],_0x3660a3[_0x54dd('0x4a')]));_0x542a76[_0x54dd('0x4d')][_0x54dd('0x62')]=_0x2284fd['id'];if(_0x5cb187[_0x54dd('0x3f')][_0x54dd('0x4c')]){_0x542a76[_0x54dd('0x4d')]=_['merge'](_0x542a76[_0x54dd('0x4d')],{'$or':_[_0x54dd('0x3b')](_0x542a76[_0x54dd('0x43')],function(_0x553333){var _0x408157={};_0x408157[_0x553333]={'$like':'%'+_0x5cb187[_0x54dd('0x3f')][_0x54dd('0x4c')]+'%'};return _0x408157;})});}if(_0x5cb187['query'][_0x54dd('0x99')]){var _0x9f5442=_0x5cb187['query'][_0x54dd('0x99')][_0x54dd('0x9a')](',');var _0x833345={};_0x833345[_0x9f5442[0x0]]={'$gte':moment(_0x9f5442[0x1])[_0x54dd('0x9b')](_0x54dd('0x9c'))};_0x542a76['where']=_[_0x54dd('0x4f')](_0x542a76[_0x54dd('0x4d')],_0x833345);}_0x542a76=_[_0x54dd('0x4f')]({},_0x542a76,_0x5cb187[_0x54dd('0x50')]);return db[_0x54dd('0x9d')]['count']({'where':_0x542a76[_0x54dd('0x4d')]})['then'](function(_0x550e37){_0x54e172[_0x54dd('0x2e')]=_0x550e37;if(_0x5cb187[_0x54dd('0x3f')][_0x54dd('0x56')]){_0x542a76[_0x54dd('0x51')]=[{'all':!![]}];}return db[_0x54dd('0x9d')][_0x54dd('0x66')](_0x542a76);})[_0x54dd('0x1e')](function(_0x380e46){_0x54e172[_0x54dd('0x67')]=_0x380e46;return _0x54e172;});}})[_0x54dd('0x1e')](respondWithFilteredResult(_0x5691cf,_0x542a76))[_0x54dd('0x28')](handleError(_0x5691cf,null));};exports['send']=function(_0x4148ca,_0x1be5a5,_0x3e2db0){var _0x321c43,_0x5b4a3e={},_0x52a01c;if(_0x4148ca[_0x54dd('0x59')]['to']){_0x52a01c=_0x4148ca[_0x54dd('0x59')]['to'][0x0];}return db['FaxAccount'][_0x54dd('0x57')]({'where':{'id':_0x4148ca[_0x54dd('0x53')]['id']},'include':[{'model':db[_0x54dd('0x9e')],'as':'List','include':[{'model':db[_0x54dd('0x72')],'as':_0x54dd('0x9f'),'where':{'fax':_0x52a01c},'limit':0x1,'order':[[_0x54dd('0xa0'),_0x54dd('0xa1')]]}]}]})[_0x54dd('0x1e')](handleEntityNotFound(_0x1be5a5,null))[_0x54dd('0x1e')](function(_0x38b7bb){_0x321c43=_0x38b7bb;if(_0x4148ca[_0x54dd('0x59')]['attachments']&&_0x4148ca[_0x54dd('0x59')]['attachments'][_0x54dd('0x45')]){for(var _0x3ebb1a=0x0;_0x3ebb1a<_0x4148ca[_0x54dd('0x59')]['attachments'][_0x54dd('0x45')];_0x3ebb1a+=0x1){_0x4148ca[_0x54dd('0x59')][_0x54dd('0xa2')][_0x3ebb1a]={'filename':_0x4148ca[_0x54dd('0x59')][_0x54dd('0xa2')][_0x3ebb1a]['name'],'id':_0x4148ca[_0x54dd('0x59')][_0x54dd('0xa2')][_0x3ebb1a]['id'],'path':path[_0x54dd('0xa3')](config[_0x54dd('0xa4')],_0x54dd('0xa5'),_0x4148ca[_0x54dd('0x59')][_0x54dd('0xa2')][_0x3ebb1a][_0x54dd('0xa6')])};}}return respondWithRpcPromise(_0x54dd('0xa7'),_0x54dd('0xa7'),{'FaxAccountId':_[_0x54dd('0xa8')](_0x4148ca[_0x54dd('0x53')]['id'])?undefined:_0x4148ca['params']['id'],'path':_[_0x54dd('0xa8')](_0x4148ca['body']['attachments'][0x0][_0x54dd('0x4')])?undefined:_0x4148ca[_0x54dd('0x59')]['attachments'][0x0][_0x54dd('0x4')],'fax':_['isNil'](_0x4148ca[_0x54dd('0x59')]['to'][0x0])?undefined:_0x4148ca[_0x54dd('0x59')]['to'][0x0]},client9002);})['then'](function(){if(_0x321c43){if(_[_0x54dd('0xa8')](_0x4148ca[_0x54dd('0x59')][_0x54dd('0xa9')])){_0x4148ca[_0x54dd('0x59')][_0x54dd('0xa9')]=util['format'](_0x54dd('0xaa'),_0x321c43[_0x54dd('0x37')],_0x321c43[_0x54dd('0xab')]);}if(_0x321c43[_0x54dd('0xac')]){if(_0x321c43[_0x54dd('0xac')]['Contacts'][_0x54dd('0x45')]){return _0x321c43['List'][_0x54dd('0x9f')][0x0];}else{return db[_0x54dd('0x72')][_0x54dd('0x58')](_['defaults'](_0x4148ca[_0x54dd('0x59')],{'firstName':_0x4148ca[_0x54dd('0x59')]['to'][0x0],'phone':_0x4148ca[_0x54dd('0x59')]['to'][0x0],'fax':_0x4148ca['body']['to'][0x0],'ListId':_0x321c43['ListId']}));}}else{throw new Error(_0x54dd('0xad'));}}else{throw new Error(_0x54dd('0xae'));}})[_0x54dd('0x1e')](function(_0xb9870a){if(_0xb9870a){return db['FaxInteraction'][_0x54dd('0x57')]({'where':{'ContactId':_0xb9870a['id'],'closed':![],'FaxAccountId':_0x321c43['id']}})[_0x54dd('0x1e')](function(_0x20e5d5){if(_0x20e5d5){return[_0x20e5d5,![]];}return db[_0x54dd('0x6e')][_0x54dd('0x58')]({'UserId':_0x4148ca['user']['id'],'ContactId':_0xb9870a['id'],'FaxAccountId':_0x321c43['id'],'fax':_0x4148ca[_0x54dd('0x59')]['to'][0x0],'firstMsgDirection':_0x54dd('0xaf'),'Messages':[_[_0x54dd('0x4f')](_0x4148ca[_0x54dd('0x59')],{'read':![],'body':_0x4148ca[_0x54dd('0x59')][_0x54dd('0xa2')][0x0][_0x54dd('0xb0')],'FaxAccountId':_0x321c43['id'],'UserId':_0x4148ca[_0x54dd('0x5c')]['id'],'ContactId':_0xb9870a['id'],'AttachmentId':_0x4148ca[_0x54dd('0x59')][_0x54dd('0xa2')][0x0]['id']})]},{'include':[{'model':db[_0x54dd('0x9d')],'as':'Messages'}]})[_0x54dd('0x1e')](function(_0x486b4c){return[_0x486b4c,!![]];});});}else{throw new Error(_0x54dd('0xb1'));}})[_0x54dd('0xb2')](function(_0x4e4230,_0x4749af){if(_0x4749af){return _0x4e4230;}return db[_0x54dd('0x9d')][_0x54dd('0x58')]({'direction':_0x54dd('0xaf'),'read':![],'body':_0x4148ca[_0x54dd('0x59')][_0x54dd('0xa2')][0x0][_0x54dd('0xb0')],'FaxAccountId':_0x321c43['id'],'FaxInteractionId':_0x4e4230['id'],'UserId':_0x4148ca[_0x54dd('0x5c')]['id'],'ContactId':_0x4e4230['ContactId'],'AttachmentId':_0x4148ca[_0x54dd('0x59')][_0x54dd('0xa2')][0x0]['id']})[_0x54dd('0x1e')](function(_0x4e7ceb){_0x4e4230['dataValues']['Messages']=[];_0x4e4230[_0x54dd('0xb3')][_0x54dd('0xb4')]['push'](_0x4e7ceb[_0x54dd('0xb3')]);return _0x4e4230;});})['then'](function(_0x5d2058){respondWithRpcPromise('SendFax',_0x54dd('0xb5'),{'FaxAccountId':_[_0x54dd('0xa8')](_0x4148ca[_0x54dd('0x53')]['id'])?undefined:_0x4148ca[_0x54dd('0x53')]['id'],'path':_[_0x54dd('0xa8')](_0x4148ca[_0x54dd('0x59')]['attachments'][0x0][_0x54dd('0x4')])?undefined:_0x4148ca[_0x54dd('0x59')][_0x54dd('0xa2')][0x0][_0x54dd('0x4')],'fax':_['isNil'](_0x4148ca['body']['to'][0x0])?undefined:_0x4148ca[_0x54dd('0x59')]['to'][0x0],'AttachmentId':_0x4148ca[_0x54dd('0x59')][_0x54dd('0xa2')][0x0]['id']},client9002)[_0x54dd('0x1e')](function(_0x387cc2){logger[_0x54dd('0x1f')](_0x54dd('0xb6'),_0x387cc2);})['catch'](function(_0x50272b){logger[_0x54dd('0x1f')]('SendFaxRpc,\x20%s',_0x50272b);});return _0x5d2058;})[_0x54dd('0x1e')](respondWithResult(_0x1be5a5,null))[_0x54dd('0x28')](handleError(_0x1be5a5,null));};exports['addAgents']=function(_0x33d105,_0x4c5cbf,_0x3488d1){return db[_0x54dd('0x3c')]['find']({'where':{'id':_0x33d105[_0x54dd('0x53')]['id']}})[_0x54dd('0x1e')](handleEntityNotFound(_0x4c5cbf,null))[_0x54dd('0x1e')](function(_0x1ef5bd){if(_0x1ef5bd){return _0x1ef5bd['addAgents'](_0x33d105[_0x54dd('0x59')][_0x54dd('0x6d')],_[_0x54dd('0x70')](_0x33d105[_0x54dd('0x59')],[_0x54dd('0x6d'),'id'])||{})[_0x54dd('0xb2')](function(_0x3354ce){for(var _0x5d0a6f=0x0;_0x5d0a6f<_0x33d105['body'][_0x54dd('0x6d')][_0x54dd('0x45')];_0x5d0a6f+=0x1){socket[_0x54dd('0xb7')](_0x54dd('0xb8'),{'UserId':Number(_0x33d105['body'][_0x54dd('0x6d')][_0x5d0a6f]),'FaxAccountId':Number(_0x33d105['params']['id'])});}return _0x3354ce;});}})['then'](respondWithResult(_0x4c5cbf,null))['catch'](handleError(_0x4c5cbf,null));};exports['removeAgents']=function(_0xc45a75,_0x29571b,_0x467114){return db['FaxAccount'][_0x54dd('0x57')]({'where':{'id':_0xc45a75[_0x54dd('0x53')]['id']}})[_0x54dd('0x1e')](handleEntityNotFound(_0x29571b,null))[_0x54dd('0x1e')](function(_0x33f3a6){if(_0x33f3a6){return _0x33f3a6['removeAgents'](_0xc45a75[_0x54dd('0x3f')][_0x54dd('0x6d')])[_0x54dd('0x1e')](function(){if(_['isArray'](_0xc45a75[_0x54dd('0x3f')][_0x54dd('0x6d')])){for(var _0x12e4a6=0x0;_0x12e4a6<_0xc45a75[_0x54dd('0x3f')][_0x54dd('0x6d')][_0x54dd('0x45')];_0x12e4a6+=0x1){socket['emit'](_0x54dd('0xb9'),{'UserId':Number(_0xc45a75[_0x54dd('0x3f')][_0x54dd('0x6d')][_0x12e4a6]),'FaxAccountId':Number(_0xc45a75[_0x54dd('0x53')]['id'])});}}else{socket[_0x54dd('0xb7')](_0x54dd('0xb9'),{'UserId':Number(_0xc45a75[_0x54dd('0x3f')]['ids']),'FaxAccountId':Number(_0xc45a75[_0x54dd('0x53')]['id'])});}});}})[_0x54dd('0x1e')](respondWithStatusCode(_0x29571b,null))[_0x54dd('0x28')](handleError(_0x29571b,null));};exports[_0x54dd('0xba')]=function(_0x194bb2,_0x2256bb,_0x2bab4a){var _0x388126={};var _0x10c803={};var _0x5e82a3;var _0x32acfa;return db[_0x54dd('0x3c')][_0x54dd('0x64')]({'where':{'id':_0x194bb2[_0x54dd('0x53')]['id']}})[_0x54dd('0x1e')](handleEntityNotFound(_0x2256bb,null))['then'](function(_0x22d1d9){if(_0x22d1d9){_0x5e82a3=_0x22d1d9;_0x10c803['model']=_[_0x54dd('0x40')](db[_0x54dd('0x74')][_0x54dd('0x55')]);_0x10c803[_0x54dd('0x3f')]=_[_0x54dd('0x40')](_0x194bb2['query']);_0x10c803[_0x54dd('0x4a')]=_['intersection'](_0x10c803[_0x54dd('0x42')],_0x10c803[_0x54dd('0x3f')]);_0x388126[_0x54dd('0x43')]=_[_0x54dd('0x41')](_0x10c803['model'],qs[_0x54dd('0x44')](_0x194bb2[_0x54dd('0x3f')][_0x54dd('0x44')]));_0x388126['attributes']=_0x388126[_0x54dd('0x43')]['length']?_0x388126['attributes']:_0x10c803[_0x54dd('0x42')];_0x388126['order']=qs[_0x54dd('0x49')](_0x194bb2[_0x54dd('0x3f')]['sort']);_0x388126[_0x54dd('0x4d')]=qs[_0x54dd('0x4a')](_['pick'](_0x194bb2[_0x54dd('0x3f')],_0x10c803['filters']));if(_0x194bb2[_0x54dd('0x3f')]['filter']){_0x388126[_0x54dd('0x4d')]=_[_0x54dd('0x4f')](_0x388126[_0x54dd('0x4d')],{'$or':_['map'](_0x388126[_0x54dd('0x43')],function(_0x507932){var _0x257b59={};_0x257b59[_0x507932]={'$like':'%'+_0x194bb2[_0x54dd('0x3f')]['filter']+'%'};return _0x257b59;})});}_0x388126=_[_0x54dd('0x4f')]({},_0x388126,_0x194bb2[_0x54dd('0x50')]);return _0x5e82a3[_0x54dd('0xba')](_0x388126);}})[_0x54dd('0x1e')](function(_0xcedbb6){if(_0xcedbb6){_0x32acfa=_0xcedbb6['length'];if(!_0x194bb2[_0x54dd('0x3f')][_0x54dd('0x65')](_0x54dd('0x46'))){_0x388126['limit']=qs[_0x54dd('0x2f')](_0x194bb2['query'][_0x54dd('0x2f')]);_0x388126[_0x54dd('0x47')]=qs['offset'](_0x194bb2[_0x54dd('0x3f')][_0x54dd('0x47')]);}return _0x5e82a3[_0x54dd('0xba')](_0x388126);}})[_0x54dd('0x1e')](function(_0x8f8e2f){if(_0x8f8e2f){return _0x8f8e2f?{'count':_0x32acfa,'rows':_0x8f8e2f}:null;}})[_0x54dd('0x1e')](respondWithResult(_0x2256bb,null))[_0x54dd('0x28')](handleError(_0x2256bb,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index 76ede3d..d06899e 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 _0xe16a=['emit','hook','events','../../mysqldb','FaxAccount','save','update','remove'];(function(_0x452985,_0x1ca4af){var _0x115294=function(_0x38a74d){while(--_0x38a74d){_0x452985['push'](_0x452985['shift']());}};_0x115294(++_0x1ca4af);}(_0xe16a,0x122));var _0xae16=function(_0x45e039,_0x13c2da){_0x45e039=_0x45e039-0x0;var _0x490903=_0xe16a[_0x45e039];return _0x490903;};'use strict';var EventEmitter=require(_0xae16('0x0'));var FaxAccount=require(_0xae16('0x1'))['db'][_0xae16('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xae16('0x3'),'afterUpdate':_0xae16('0x4'),'afterDestroy':_0xae16('0x5')};function emitEvent(_0x21a9c1){return function(_0x2cc3fa,_0x4c4707,_0x3cf20e){FaxAccountEvents[_0xae16('0x6')](_0x21a9c1+':'+_0x2cc3fa['id'],_0x2cc3fa);FaxAccountEvents[_0xae16('0x6')](_0x21a9c1,_0x2cc3fa);_0x3cf20e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxAccount[_0xae16('0x7')](e,emitEvent(event));}}module['exports']=FaxAccountEvents; \ No newline at end of file +var _0xe746=['remove','emit','hasOwnProperty','hook','exports','../../mysqldb','FaxAccount','setMaxListeners','save'];(function(_0x1d065d,_0x3f5dec){var _0x22cfc8=function(_0x1c6c4d){while(--_0x1c6c4d){_0x1d065d['push'](_0x1d065d['shift']());}};_0x22cfc8(++_0x3f5dec);}(_0xe746,0x1eb));var _0x6e74=function(_0x2692ed,_0x2587fe){_0x2692ed=_0x2692ed-0x0;var _0x121cdd=_0xe746[_0x2692ed];return _0x121cdd;};'use strict';var EventEmitter=require('events');var FaxAccount=require(_0x6e74('0x0'))['db'][_0x6e74('0x1')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x6e74('0x2')](0x0);var events={'afterCreate':_0x6e74('0x3'),'afterUpdate':'update','afterDestroy':_0x6e74('0x4')};function emitEvent(_0x568ca6){return function(_0x1af726,_0x652c54,_0x10423a){FaxAccountEvents[_0x6e74('0x5')](_0x568ca6+':'+_0x1af726['id'],_0x1af726);FaxAccountEvents['emit'](_0x568ca6,_0x1af726);_0x10423a(null);};}for(var e in events){if(events[_0x6e74('0x6')](e)){var event=events[e];FaxAccount[_0x6e74('0x7')](e,emitEvent(event));}}module[_0x6e74('0x8')]=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index bea83f2..eb7775b 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 _0x3792=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxAccount.attributes','FaxAccount','fax_accounts'];(function(_0x2da803,_0x10fbe1){var _0x4d20f4=function(_0xaad48d){while(--_0xaad48d){_0x2da803['push'](_0x2da803['shift']());}};_0x4d20f4(++_0x10fbe1);}(_0x3792,0x1d4));var _0x2379=function(_0x383b70,_0x4b0e90){_0x383b70=_0x383b70-0x0;var _0x354f5b=_0x3792[_0x383b70];return _0x354f5b;};'use strict';var _=require(_0x2379('0x0'));var util=require(_0x2379('0x1'));var logger=require(_0x2379('0x2'))('api');var moment=require(_0x2379('0x3'));var BPromise=require(_0x2379('0x4'));var rp=require(_0x2379('0x5'));var fs=require('fs');var path=require(_0x2379('0x6'));var rimraf=require(_0x2379('0x7'));var config=require(_0x2379('0x8'));var attributes=require(_0x2379('0x9'));module['exports']=function(_0x20e573,_0x3204ea){return _0x20e573['define'](_0x2379('0xa'),attributes,{'tableName':_0x2379('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5265=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./faxAccount.attributes','exports','fax_accounts','lodash'];(function(_0x42bc91,_0x41f40a){var _0x3f5507=function(_0x20cfaf){while(--_0x20cfaf){_0x42bc91['push'](_0x42bc91['shift']());}};_0x3f5507(++_0x41f40a);}(_0x5265,0x1ac));var _0x5526=function(_0x181d3f,_0x4d43d1){_0x181d3f=_0x181d3f-0x0;var _0x1fff24=_0x5265[_0x181d3f];return _0x1fff24;};'use strict';var _=require(_0x5526('0x0'));var util=require('util');var logger=require(_0x5526('0x1'))(_0x5526('0x2'));var moment=require(_0x5526('0x3'));var BPromise=require(_0x5526('0x4'));var rp=require(_0x5526('0x5'));var fs=require('fs');var path=require(_0x5526('0x6'));var rimraf=require(_0x5526('0x7'));var config=require('../../config/environment');var attributes=require(_0x5526('0x8'));module[_0x5526('0x9')]=function(_0x41b602,_0x418390){return _0x41b602['define']('FaxAccount',attributes,{'tableName':_0x5526('0xa'),'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 54aa004..b04738e 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 _0x6b1d=['spread','autoclose','close','unmanaged','*,*,*,*','created','interaction','FaxMessage','ContactId','AttachmentId','UserId','User','unshift','agent','name','waitForTheAssignedAgent','Start','startRouting','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./faxAccount.socket','register','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetFaxAccount','FaxAccount','findAll','options','raw','attributes','limit','include','map','model','stringify','NotifyFaxAccount','body','fax','describe','Sequelize','ValidationError','updatedAt','difference','createdAt','ListId','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','CmList','List','CmContact','FaxApplication','get','applications','Applications','list','orderBy','priority','asc','length','Contacts','defaults','create','contact','find','FaxInteraction','Contact\x20not\x20found'];(function(_0x15377a,_0x339f29){var _0x5d72e4=function(_0x308272){while(--_0x308272){_0x15377a['push'](_0x15377a['shift']());}};_0x5d72e4(++_0x339f29);}(_0x6b1d,0x192));var _0xd6b1=function(_0x11314c,_0x2ca8d7){_0x11314c=_0x11314c-0x0;var _0x12cb4a=_0x6b1d[_0x11314c];return _0x12cb4a;};'use strict';var _=require(_0xd6b1('0x0'));var util=require(_0xd6b1('0x1'));var moment=require(_0xd6b1('0x2'));var BPromise=require('bluebird');var rs=require(_0xd6b1('0x3'));var fs=require('fs');var Redis=require(_0xd6b1('0x4'));var db=require(_0xd6b1('0x5'))['db'];var utils=require(_0xd6b1('0x6'));var logger=require(_0xd6b1('0x7'))(_0xd6b1('0x8'));var config=require(_0xd6b1('0x9'));var jayson=require(_0xd6b1('0xa'));var client=jayson[_0xd6b1('0xb')][_0xd6b1('0xc')]({'port':0x232c});config[_0xd6b1('0xd')]=_['defaults'](config[_0xd6b1('0xd')],{'host':_0xd6b1('0xe'),'port':0x18eb});var socket=require(_0xd6b1('0xf'))(new Redis(config[_0xd6b1('0xd')]));require(_0xd6b1('0x10'))[_0xd6b1('0x11')](socket);function respondWithRpcPromise(_0x5c2f71,_0x5e5a60,_0x4981f8){return new BPromise(function(_0x29188a,_0x2a2689){return client[_0xd6b1('0x12')](_0x5c2f71,_0x4981f8)[_0xd6b1('0x13')](function(_0x2beea4){logger[_0xd6b1('0x14')](_0xd6b1('0x15'),_0x5e5a60,_0xd6b1('0x16'));logger[_0xd6b1('0x17')](_0xd6b1('0x18'),_0x5e5a60,'request\x20sent',JSON['stringify'](_0x2beea4));if(_0x2beea4[_0xd6b1('0x19')]){if(_0x2beea4[_0xd6b1('0x19')][_0xd6b1('0x1a')]===0x1f4){logger[_0xd6b1('0x19')](_0xd6b1('0x15'),_0x5e5a60,_0x2beea4['error'][_0xd6b1('0x1b')]);return _0x2a2689(_0x2beea4[_0xd6b1('0x19')][_0xd6b1('0x1b')]);}logger[_0xd6b1('0x19')](_0xd6b1('0x15'),_0x5e5a60,_0x2beea4['error'][_0xd6b1('0x1b')]);return _0x29188a(_0x2beea4[_0xd6b1('0x19')][_0xd6b1('0x1b')]);}else{logger[_0xd6b1('0x14')](_0xd6b1('0x15'),_0x5e5a60,_0xd6b1('0x16'));_0x29188a(_0x2beea4[_0xd6b1('0x1c')][_0xd6b1('0x1b')]);}})[_0xd6b1('0x1d')](function(_0x252434){logger[_0xd6b1('0x19')]('FaxAccount,\x20%s,\x20%s',_0x5e5a60,_0x252434);_0x2a2689(_0x252434);});});}exports[_0xd6b1('0x1e')]=function(_0x5ed649){var _0x913af4=this;return new Promise(function(_0x5455e8,_0x1efbd6){return db[_0xd6b1('0x1f')][_0xd6b1('0x20')]({'raw':_0x5ed649[_0xd6b1('0x21')]?_0x5ed649[_0xd6b1('0x21')][_0xd6b1('0x22')]===undefined?!![]:![]:!![],'where':_0x5ed649[_0xd6b1('0x21')]?_0x5ed649[_0xd6b1('0x21')]['where']||null:null,'attributes':_0x5ed649['options']?_0x5ed649[_0xd6b1('0x21')][_0xd6b1('0x23')]||null:null,'limit':_0x5ed649[_0xd6b1('0x21')]?_0x5ed649[_0xd6b1('0x21')][_0xd6b1('0x24')]||null:null,'include':_0x5ed649[_0xd6b1('0x21')]?_0x5ed649[_0xd6b1('0x21')][_0xd6b1('0x25')]?_[_0xd6b1('0x26')](_0x5ed649[_0xd6b1('0x21')]['include'],function(_0x7d0534){return{'model':db[_0x7d0534['model']],'as':_0x7d0534['as'],'attributes':_0x7d0534[_0xd6b1('0x23')],'include':_0x7d0534[_0xd6b1('0x25')]?_[_0xd6b1('0x26')](_0x7d0534[_0xd6b1('0x25')],function(_0x3fff6c){return{'model':db[_0x3fff6c['model']],'as':_0x3fff6c['as'],'attributes':_0x3fff6c[_0xd6b1('0x23')],'include':_0x3fff6c[_0xd6b1('0x25')]?_[_0xd6b1('0x26')](_0x3fff6c[_0xd6b1('0x25')],function(_0x4fbf30){return{'model':db[_0x4fbf30[_0xd6b1('0x27')]],'as':_0x4fbf30['as'],'attributes':_0x4fbf30[_0xd6b1('0x23')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x182688){logger[_0xd6b1('0x14')](_0xd6b1('0x1e'),_0x5ed649);logger['debug'](_0xd6b1('0x1e'),_0x5ed649,JSON[_0xd6b1('0x28')](_0x182688));_0x5455e8(_0x182688);})[_0xd6b1('0x1d')](function(_0x4055e4){logger[_0xd6b1('0x19')](_0xd6b1('0x1e'),_0x4055e4['message'],_0x5ed649);_0x1efbd6(_0x913af4['error'](0x1f4,_0x4055e4['message']));});});};exports[_0xd6b1('0x29')]=function(_0x130bd3,_0x579fe5,_0x400eec){var _0x4e44e9=this;return new Promise(function(_0x349251,_0x1a21f3){var _0x1a2d22={'body':_0x130bd3[_0xd6b1('0x2a')],'channel':_0xd6b1('0x2b')};var _0x234264=[];var _0xe40ae1=[];var _0x4831a8={};return db['CmContact'][_0xd6b1('0x2c')]()[_0xd6b1('0x13')](function(_0x258025){if(!_0x258025){throw new db[(_0xd6b1('0x2d'))][(_0xd6b1('0x2e'))]('no\x20available\x20attributes');}_0x234264=_['difference'](_['keys'](_0x258025),['createdAt',_0xd6b1('0x2f')]);_0xe40ae1=_[_0xd6b1('0x30')](_['keys'](_0x258025),[_0xd6b1('0x31'),_0xd6b1('0x2f'),'CompanyId',_0xd6b1('0x32')]);if(_0x130bd3[_0xd6b1('0x2a')]['id']){delete _0x130bd3[_0xd6b1('0x2a')]['id'];}if(_['isNil'](_0x130bd3[_0xd6b1('0x2a')][_0xd6b1('0x33')])){throw new db[(_0xd6b1('0x2d'))][(_0xd6b1('0x2e'))](_0xd6b1('0x34'));}if(_['isNil'](_0x130bd3[_0xd6b1('0x2a')][_0xd6b1('0x2a')])||_0x130bd3['body'][_0xd6b1('0x2a')]===''){throw new db[(_0xd6b1('0x2d'))][(_0xd6b1('0x2e'))](_0xd6b1('0x35'));}if(_[_0xd6b1('0x36')](_0x130bd3[_0xd6b1('0x2a')][_0xd6b1('0x37')])){throw new db[(_0xd6b1('0x2d'))][(_0xd6b1('0x2e'))](_0xd6b1('0x38')+_0xe40ae1);}if(!_['includes'](_0xe40ae1,_0x130bd3[_0xd6b1('0x2a')]['mapKey'])){throw new db[(_0xd6b1('0x2d'))][(_0xd6b1('0x2e'))](_0xd6b1('0x39')+_0xe40ae1);}_0x4831a8[_0x130bd3[_0xd6b1('0x2a')][_0xd6b1('0x37')]]=_0x130bd3[_0xd6b1('0x2a')][_0xd6b1('0x33')];})['then'](function(){return db[_0xd6b1('0x1f')]['find']({'where':{'id':_0x130bd3[_0xd6b1('0x3a')]['id']},'include':[{'model':db[_0xd6b1('0x3b')],'as':_0xd6b1('0x3c'),'include':[{'model':db[_0xd6b1('0x3d')],'as':'Contacts','where':_0x4831a8,'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db[_0xd6b1('0x3e')],'as':'Applications'}]});})[_0xd6b1('0x13')](function(_0x4f6d90){if(_0x4f6d90&&_0x4f6d90[_0xd6b1('0x3c')]){var _0x3b2cac=_0x4f6d90[_0xd6b1('0x3f')]({'plain':!![]});_0x1a2d22['account']=_0x3b2cac;_0x1a2d22[_0xd6b1('0x40')]=_0x3b2cac[_0xd6b1('0x41')];_0x1a2d22[_0xd6b1('0x42')]=_0x3b2cac['List'];_0x1a2d22['applications']=_[_0xd6b1('0x43')](_0x1a2d22[_0xd6b1('0x40')],[_0xd6b1('0x44')],[_0xd6b1('0x45')]);if(_0x1a2d22[_0xd6b1('0x3a')][_0xd6b1('0x41')]){delete _0x1a2d22[_0xd6b1('0x3a')]['Applications'];}if(_0x1a2d22[_0xd6b1('0x3a')][_0xd6b1('0x3c')]&&_0x1a2d22[_0xd6b1('0x3a')]['List']['Contacts'][_0xd6b1('0x46')]){return _0x1a2d22[_0xd6b1('0x3a')][_0xd6b1('0x3c')][_0xd6b1('0x47')][0x0];}var _0xcf8f40=_[_0xd6b1('0x48')](_0x130bd3[_0xd6b1('0x2a')],{'firstName':_0x130bd3['body'][_0xd6b1('0x33')],'ListId':_0x3b2cac['ListId']});_0xcf8f40[_0x130bd3['body']['mapKey']]=_0x130bd3['body'][_0xd6b1('0x33')];return db[_0xd6b1('0x3d')][_0xd6b1('0x49')](_0xcf8f40,{'fields':_0x234264,'raw':!![]});}})[_0xd6b1('0x13')](function(_0x23bf32){_0x1a2d22[_0xd6b1('0x4a')]=_0x23bf32;if(_0x23bf32){var _0x23a440={'ContactId':_0x23bf32['id'],'FaxAccountId':_0x130bd3[_0xd6b1('0x3a')]['id'],'fax':_0x23bf32['fax']};return db['FaxInteraction'][_0xd6b1('0x4b')]({'where':{'ContactId':_0x23bf32['id'],'closed':![],'FaxAccountId':_0x130bd3[_0xd6b1('0x3a')]['id']}})[_0xd6b1('0x13')](function(_0x2cb68b){if(_0x2cb68b){return[_0x2cb68b,![]];}return db[_0xd6b1('0x4c')]['create'](_0x23a440)[_0xd6b1('0x13')](function(_0x4f1366){return[_0x4f1366,!![]];});});}else{throw new Error(_0xd6b1('0x4d'));}})[_0xd6b1('0x4e')](function(_0x1a3e98,_0x10382c){var _0x3c6c3f=_0x1a3e98[_0xd6b1('0x3f')]({'plain':!![]});if(_0x10382c){if(_0x1a2d22['account'][_0xd6b1('0x4f')]){_0x1a2d22['applications']['push']({'id':0x0,'priority':_0x1a2d22['applications'][_0xd6b1('0x46')]+0x1,'app':_0xd6b1('0x50'),'appdata':_0xd6b1('0x51'),'interval':_0xd6b1('0x52')});}_0x3c6c3f['created']=!![];}else{_0x3c6c3f[_0xd6b1('0x53')]=![];}_0x1a2d22[_0xd6b1('0x54')]=_0x3c6c3f;return db[_0xd6b1('0x55')][_0xd6b1('0x49')]({'body':_0x130bd3['body']['body'],'FaxAccountId':_0x130bd3[_0xd6b1('0x3a')]['id'],'FaxInteractionId':_0x1a3e98['id'],'direction':'in','ContactId':_0x1a3e98[_0xd6b1('0x56')],'AttachmentId':_0x130bd3[_0xd6b1('0x2a')][_0xd6b1('0x57')]});})['then'](function(_0x1ca26a){_0x1a2d22[_0xd6b1('0x1b')]=_0x1ca26a;if(_0x1a2d22['interaction'][_0xd6b1('0x58')]){return db[_0xd6b1('0x59')]['find']({'attributes':['id','name'],'where':{'id':_0x1a2d22['interaction']['UserId']}})[_0xd6b1('0x13')](function(_0x3892e3){if(_0x3892e3){_0x1a2d22[_0xd6b1('0x40')][_0xd6b1('0x5a')]({'id':0x0,'priority':0x0,'app':_0xd6b1('0x5b'),'appdata':_0x3892e3[_0xd6b1('0x5c')]+','+(_0x1a2d22['account'][_0xd6b1('0x5d')]||0xa),'interval':_0xd6b1('0x52')});}return respondWithRpcPromise(_0xd6b1('0x5e'),'startRouting',_0x1a2d22);});}return respondWithRpcPromise(_0xd6b1('0x5e'),_0xd6b1('0x5f'),_0x1a2d22);})[_0xd6b1('0x13')](function(_0x444a2b){_0x349251(_0x444a2b);})[_0xd6b1('0x1d')](function(_0x261d7b){_0x1a21f3(_0x4e44e9[_0xd6b1('0x19')](0x1f4,_0x261d7b[_0xd6b1('0x1b')]));});});}; \ No newline at end of file +var _0x3af3=['CompanyId','ListId','isNil','from','from\x20is\x20mandatory','Sequelize','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','CmList','List','DESC','FaxApplication','Applications','get','list','applications','orderBy','priority','asc','account','Contacts','length','CmContact','contact','FaxInteraction','create','Contact\x20not\x20found','autoclose','close','unmanaged','created','interaction','FaxMessage','ContactId','UserId','User','name','unshift','waitForTheAssignedAgent','*,*,*,*','startRouting','Start','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','redis','socket.io-emitter','./faxAccount.socket','register','then','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','FaxAccount','findAll','options','raw','where','attributes','limit','include','map','model','GetFaxAccount','body','fax','describe','ValidationError','difference','createdAt','updatedAt'];(function(_0x268cbc,_0x2bece3){var _0x2f3302=function(_0x289a7f){while(--_0x289a7f){_0x268cbc['push'](_0x268cbc['shift']());}};_0x2f3302(++_0x2bece3);}(_0x3af3,0x89));var _0x33af=function(_0x32358b,_0x5c7c35){_0x32358b=_0x32358b-0x0;var _0x58c21d=_0x3af3[_0x32358b];return _0x58c21d;};'use strict';var _=require(_0x33af('0x0'));var util=require(_0x33af('0x1'));var moment=require(_0x33af('0x2'));var BPromise=require('bluebird');var rs=require(_0x33af('0x3'));var fs=require('fs');var Redis=require(_0x33af('0x4'));var db=require(_0x33af('0x5'))['db'];var utils=require(_0x33af('0x6'));var logger=require(_0x33af('0x7'))(_0x33af('0x8'));var config=require(_0x33af('0x9'));var jayson=require(_0x33af('0xa'));var client=jayson[_0x33af('0xb')]['http']({'port':0x232c});config['redis']=_[_0x33af('0xc')](config[_0x33af('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x33af('0xe'))(new Redis(config['redis']));require(_0x33af('0xf'))[_0x33af('0x10')](socket);function respondWithRpcPromise(_0x3e914b,_0x4f9fe6,_0x2fc687){return new BPromise(function(_0x5e0ad1,_0x585978){return client['request'](_0x3e914b,_0x2fc687)[_0x33af('0x11')](function(_0x565e77){logger['info'](_0x33af('0x12'),_0x4f9fe6,_0x33af('0x13'));logger[_0x33af('0x14')](_0x33af('0x15'),_0x4f9fe6,_0x33af('0x13'),JSON[_0x33af('0x16')](_0x565e77));if(_0x565e77[_0x33af('0x17')]){if(_0x565e77[_0x33af('0x17')][_0x33af('0x18')]===0x1f4){logger[_0x33af('0x17')](_0x33af('0x12'),_0x4f9fe6,_0x565e77['error']['message']);return _0x585978(_0x565e77[_0x33af('0x17')]['message']);}logger[_0x33af('0x17')](_0x33af('0x12'),_0x4f9fe6,_0x565e77[_0x33af('0x17')][_0x33af('0x19')]);return _0x5e0ad1(_0x565e77[_0x33af('0x17')]['message']);}else{logger[_0x33af('0x1a')](_0x33af('0x12'),_0x4f9fe6,_0x33af('0x13'));_0x5e0ad1(_0x565e77[_0x33af('0x1b')]['message']);}})[_0x33af('0x1c')](function(_0x22612f){logger[_0x33af('0x17')](_0x33af('0x12'),_0x4f9fe6,_0x22612f);_0x585978(_0x22612f);});});}exports['GetFaxAccount']=function(_0x459f6a){var _0x43aa30=this;return new Promise(function(_0x24ef66,_0x302d47){return db[_0x33af('0x1d')][_0x33af('0x1e')]({'raw':_0x459f6a[_0x33af('0x1f')]?_0x459f6a[_0x33af('0x1f')][_0x33af('0x20')]===undefined?!![]:![]:!![],'where':_0x459f6a[_0x33af('0x1f')]?_0x459f6a['options'][_0x33af('0x21')]||null:null,'attributes':_0x459f6a[_0x33af('0x1f')]?_0x459f6a[_0x33af('0x1f')][_0x33af('0x22')]||null:null,'limit':_0x459f6a[_0x33af('0x1f')]?_0x459f6a['options'][_0x33af('0x23')]||null:null,'include':_0x459f6a[_0x33af('0x1f')]?_0x459f6a[_0x33af('0x1f')][_0x33af('0x24')]?_[_0x33af('0x25')](_0x459f6a[_0x33af('0x1f')][_0x33af('0x24')],function(_0x2e0ef0){return{'model':db[_0x2e0ef0[_0x33af('0x26')]],'as':_0x2e0ef0['as'],'attributes':_0x2e0ef0[_0x33af('0x22')],'include':_0x2e0ef0[_0x33af('0x24')]?_['map'](_0x2e0ef0[_0x33af('0x24')],function(_0x4481f5){return{'model':db[_0x4481f5[_0x33af('0x26')]],'as':_0x4481f5['as'],'attributes':_0x4481f5['attributes'],'include':_0x4481f5['include']?_[_0x33af('0x25')](_0x4481f5[_0x33af('0x24')],function(_0xbc9e49){return{'model':db[_0xbc9e49[_0x33af('0x26')]],'as':_0xbc9e49['as'],'attributes':_0xbc9e49[_0x33af('0x22')]};}):[]};}):[]};}):[]:[]})[_0x33af('0x11')](function(_0x121405){logger[_0x33af('0x1a')](_0x33af('0x27'),_0x459f6a);logger['debug'](_0x33af('0x27'),_0x459f6a,JSON[_0x33af('0x16')](_0x121405));_0x24ef66(_0x121405);})['catch'](function(_0x4dbe14){logger['error']('GetFaxAccount',_0x4dbe14['message'],_0x459f6a);_0x302d47(_0x43aa30[_0x33af('0x17')](0x1f4,_0x4dbe14[_0x33af('0x19')]));});});};exports['NotifyFaxAccount']=function(_0x38aa23,_0x5e84fa,_0x4615f5){var _0xe7da83=this;return new Promise(function(_0x513a52,_0x29fdc9){var _0x3f7e79={'body':_0x38aa23[_0x33af('0x28')],'channel':_0x33af('0x29')};var _0x30f24d=[];var _0x59580b=[];var _0x2406c3={};return db['CmContact'][_0x33af('0x2a')]()[_0x33af('0x11')](function(_0x2b69f5){if(!_0x2b69f5){throw new db['Sequelize'][(_0x33af('0x2b'))]('no\x20available\x20attributes');}_0x30f24d=_[_0x33af('0x2c')](_['keys'](_0x2b69f5),[_0x33af('0x2d'),'updatedAt']);_0x59580b=_[_0x33af('0x2c')](_['keys'](_0x2b69f5),['createdAt',_0x33af('0x2e'),_0x33af('0x2f'),_0x33af('0x30')]);if(_0x38aa23['body']['id']){delete _0x38aa23[_0x33af('0x28')]['id'];}if(_[_0x33af('0x31')](_0x38aa23[_0x33af('0x28')][_0x33af('0x32')])){throw new db['Sequelize'][(_0x33af('0x2b'))](_0x33af('0x33'));}if(_[_0x33af('0x31')](_0x38aa23['body'][_0x33af('0x28')])||_0x38aa23[_0x33af('0x28')][_0x33af('0x28')]===''){throw new db[(_0x33af('0x34'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x38aa23[_0x33af('0x28')][_0x33af('0x35')])){throw new db['Sequelize'][(_0x33af('0x2b'))](_0x33af('0x36')+_0x59580b);}if(!_[_0x33af('0x37')](_0x59580b,_0x38aa23[_0x33af('0x28')][_0x33af('0x35')])){throw new db['Sequelize'][(_0x33af('0x2b'))](_0x33af('0x38')+_0x59580b);}_0x2406c3[_0x38aa23[_0x33af('0x28')][_0x33af('0x35')]]=_0x38aa23[_0x33af('0x28')]['from'];})[_0x33af('0x11')](function(){return db[_0x33af('0x1d')][_0x33af('0x39')]({'where':{'id':_0x38aa23['account']['id']},'include':[{'model':db[_0x33af('0x3a')],'as':_0x33af('0x3b'),'include':[{'model':db['CmContact'],'as':'Contacts','where':_0x2406c3,'limit':0x1,'order':[[_0x33af('0x2e'),_0x33af('0x3c')]]}]},{'model':db[_0x33af('0x3d')],'as':_0x33af('0x3e')}]});})[_0x33af('0x11')](function(_0x455e01){if(_0x455e01&&_0x455e01[_0x33af('0x3b')]){var _0x58bcf0=_0x455e01[_0x33af('0x3f')]({'plain':!![]});_0x3f7e79['account']=_0x58bcf0;_0x3f7e79['applications']=_0x58bcf0[_0x33af('0x3e')];_0x3f7e79[_0x33af('0x40')]=_0x58bcf0[_0x33af('0x3b')];_0x3f7e79[_0x33af('0x41')]=_[_0x33af('0x42')](_0x3f7e79[_0x33af('0x41')],[_0x33af('0x43')],[_0x33af('0x44')]);if(_0x3f7e79[_0x33af('0x45')]['Applications']){delete _0x3f7e79[_0x33af('0x45')][_0x33af('0x3e')];}if(_0x3f7e79[_0x33af('0x45')]['List']&&_0x3f7e79[_0x33af('0x45')][_0x33af('0x3b')][_0x33af('0x46')][_0x33af('0x47')]){return _0x3f7e79[_0x33af('0x45')][_0x33af('0x3b')][_0x33af('0x46')][0x0];}var _0x381afe=_[_0x33af('0xc')](_0x38aa23[_0x33af('0x28')],{'firstName':_0x38aa23[_0x33af('0x28')][_0x33af('0x32')],'ListId':_0x58bcf0[_0x33af('0x30')]});_0x381afe[_0x38aa23['body'][_0x33af('0x35')]]=_0x38aa23[_0x33af('0x28')][_0x33af('0x32')];return db[_0x33af('0x48')]['create'](_0x381afe,{'fields':_0x30f24d,'raw':!![]});}})[_0x33af('0x11')](function(_0x332ae4){_0x3f7e79[_0x33af('0x49')]=_0x332ae4;if(_0x332ae4){var _0x235b01={'ContactId':_0x332ae4['id'],'FaxAccountId':_0x38aa23[_0x33af('0x45')]['id'],'fax':_0x332ae4[_0x33af('0x29')]};return db[_0x33af('0x4a')][_0x33af('0x39')]({'where':{'ContactId':_0x332ae4['id'],'closed':![],'FaxAccountId':_0x38aa23['account']['id']}})[_0x33af('0x11')](function(_0x3dd0f9){if(_0x3dd0f9){return[_0x3dd0f9,![]];}return db[_0x33af('0x4a')][_0x33af('0x4b')](_0x235b01)[_0x33af('0x11')](function(_0x5c8b17){return[_0x5c8b17,!![]];});});}else{throw new Error(_0x33af('0x4c'));}})['spread'](function(_0x1ed8eb,_0x5748e7){var _0x4b44fa=_0x1ed8eb['get']({'plain':!![]});if(_0x5748e7){if(_0x3f7e79[_0x33af('0x45')][_0x33af('0x4d')]){_0x3f7e79[_0x33af('0x41')]['push']({'id':0x0,'priority':_0x3f7e79[_0x33af('0x41')][_0x33af('0x47')]+0x1,'app':_0x33af('0x4e'),'appdata':_0x33af('0x4f'),'interval':'*,*,*,*'});}_0x4b44fa[_0x33af('0x50')]=!![];}else{_0x4b44fa[_0x33af('0x50')]=![];}_0x3f7e79[_0x33af('0x51')]=_0x4b44fa;return db[_0x33af('0x52')][_0x33af('0x4b')]({'body':_0x38aa23[_0x33af('0x28')][_0x33af('0x28')],'FaxAccountId':_0x38aa23['account']['id'],'FaxInteractionId':_0x1ed8eb['id'],'direction':'in','ContactId':_0x1ed8eb[_0x33af('0x53')],'AttachmentId':_0x38aa23[_0x33af('0x28')]['AttachmentId']});})['then'](function(_0x995b50){_0x3f7e79[_0x33af('0x19')]=_0x995b50;if(_0x3f7e79[_0x33af('0x51')][_0x33af('0x54')]){return db[_0x33af('0x55')][_0x33af('0x39')]({'attributes':['id',_0x33af('0x56')],'where':{'id':_0x3f7e79[_0x33af('0x51')][_0x33af('0x54')]}})['then'](function(_0x471cb2){if(_0x471cb2){_0x3f7e79[_0x33af('0x41')][_0x33af('0x57')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x471cb2[_0x33af('0x56')]+','+(_0x3f7e79[_0x33af('0x45')][_0x33af('0x58')]||0xa),'interval':_0x33af('0x59')});}return respondWithRpcPromise('Start',_0x33af('0x5a'),_0x3f7e79);});}return respondWithRpcPromise(_0x33af('0x5b'),_0x33af('0x5a'),_0x3f7e79);})[_0x33af('0x11')](function(_0x2b4523){_0x513a52(_0x2b4523);})['catch'](function(_0x207a51){_0x29fdc9(_0xe7da83[_0x33af('0x17')](0x1f4,_0x207a51[_0x33af('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index 0f283da..f31e3ce 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 _0x2cc6=['remove','update','emit','register','length','faxAccount:','save'];(function(_0x2a4da6,_0x5e7f66){var _0x21f384=function(_0x1d2b45){while(--_0x1d2b45){_0x2a4da6['push'](_0x2a4da6['shift']());}};_0x21f384(++_0x5e7f66);}(_0x2cc6,0xca));var _0x62cc=function(_0x426267,_0x422e6e){_0x426267=_0x426267-0x0;var _0x59e163=_0x2cc6[_0x426267];return _0x59e163;};'use strict';var FaxAccountEvents=require('./faxAccount.events');var events=[_0x62cc('0x0'),_0x62cc('0x1'),_0x62cc('0x2')];function createListener(_0x2fae0d,_0x29fb76){return function(_0x45e1ac){_0x29fb76[_0x62cc('0x3')](_0x2fae0d,_0x45e1ac);};}function removeListener(_0x40de80,_0x744ed6){return function(){FaxAccountEvents['removeListener'](_0x40de80,_0x744ed6);};}exports[_0x62cc('0x4')]=function(_0x9076fb){for(var _0x1ec607=0x0,_0x199ea2=events[_0x62cc('0x5')];_0x1ec607<_0x199ea2;_0x1ec607++){var _0x336d81=events[_0x1ec607];var _0x3fde6c=createListener(_0x62cc('0x6')+_0x336d81,_0x9076fb);FaxAccountEvents['on'](_0x336d81,_0x3fde6c);}}; \ No newline at end of file +var _0x544c=['update','emit','removeListener','faxAccount:','./faxAccount.events','remove'];(function(_0x19943c,_0x4544aa){var _0x4ef155=function(_0x5b6eb3){while(--_0x5b6eb3){_0x19943c['push'](_0x19943c['shift']());}};_0x4ef155(++_0x4544aa);}(_0x544c,0x1a2));var _0xc544=function(_0x1d7bc0,_0x50a455){_0x1d7bc0=_0x1d7bc0-0x0;var _0x15a179=_0x544c[_0x1d7bc0];return _0x15a179;};'use strict';var FaxAccountEvents=require(_0xc544('0x0'));var events=['save',_0xc544('0x1'),_0xc544('0x2')];function createListener(_0x31d249,_0x2c71c5){return function(_0x18fd60){_0x2c71c5[_0xc544('0x3')](_0x31d249,_0x18fd60);};}function removeListener(_0xf7f0f0,_0x11f538){return function(){FaxAccountEvents[_0xc544('0x4')](_0xf7f0f0,_0x11f538);};}exports['register']=function(_0x47bd6a){for(var _0x2b4f2f=0x0,_0x3b0f13=events['length'];_0x2b4f2f<_0x3b0f13;_0x2b4f2f++){var _0x8fda90=events[_0x2b4f2f];var _0x4f8156=createListener(_0xc544('0x5')+_0x8fda90,_0x47bd6a);FaxAccountEvents['on'](_0x8fda90,_0x4f8156);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index e2fbc2b..113188f 100644 --- a/server/api/faxAccount/index.js +++ b/server/api/faxAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxAccount.controller','get','index','/describe','show','/:id/dispositions','isAuthenticated','getDispositions','/:id/interactions','getInteractions','/:id/applications','/:id/messages','getMessages','/:id/users','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','addInteraction','addApplications','addAccountApplications','/updateaccountapplications','/:id/send','send','addAgents','put','/:id','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path'];(function(_0x196bbf,_0x3a0d24){var _0x155966=function(_0x37323f){while(--_0x37323f){_0x196bbf['push'](_0x196bbf['shift']());}};_0x155966(++_0x3a0d24);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xa9e0[_0x6c993a];return _0x27f547;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/canned_answers',auth['isAuthenticated'](),controller['getAnswers']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getApplications']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['post']('/',auth[_0x0a9e('0xd')](),controller['create']);router[_0x0a9e('0x16')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router['post'](_0x0a9e('0x18'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x16')](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1a')]);router[_0x0a9e('0x16')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x16')]('/addaccountapplications',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router['post'](_0x0a9e('0x1d'),auth['isAuthenticated'](),controller['updateAccountApplications']);router[_0x0a9e('0x16')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['post'](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0x22'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x24')]);router[_0x0a9e('0x25')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x26')]);router['delete'](_0x0a9e('0x18'),auth['isAuthenticated'](),controller[_0x0a9e('0x27')]);router[_0x0a9e('0x25')](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x28')]);module[_0x0a9e('0x29')]=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxAccount.controller','get','index','/describe','show','/:id/dispositions','isAuthenticated','getDispositions','/:id/interactions','getInteractions','/:id/applications','/:id/messages','getMessages','/:id/users','getAgents','post','addDisposition','/:id/canned_answers','addAnswer','addInteraction','addApplications','addAccountApplications','/updateaccountapplications','/:id/send','send','addAgents','put','/:id','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path'];(function(_0x3877e8,_0x155bcb){var _0x552c52=function(_0x5a10bd){while(--_0x5a10bd){_0x3877e8['push'](_0x3877e8['shift']());}};_0x552c52(++_0x155bcb);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0xa9e0[_0x2763f2];return _0x3ef471;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0x8')]('/:id/canned_answers',auth['isAuthenticated'](),controller['getAnswers']);router['get'](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x8')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller['getApplications']);router[_0x0a9e('0x8')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router[_0x0a9e('0x8')](_0x0a9e('0x14'),auth['isAuthenticated'](),controller[_0x0a9e('0x15')]);router['post']('/',auth[_0x0a9e('0xd')](),controller['create']);router[_0x0a9e('0x16')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x17')]);router['post'](_0x0a9e('0x18'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x19')]);router[_0x0a9e('0x16')](_0x0a9e('0xf'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1a')]);router[_0x0a9e('0x16')](_0x0a9e('0x11'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1b')]);router[_0x0a9e('0x16')]('/addaccountapplications',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1c')]);router['post'](_0x0a9e('0x1d'),auth['isAuthenticated'](),controller['updateAccountApplications']);router[_0x0a9e('0x16')](_0x0a9e('0x1e'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x1f')]);router['post'](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x20')]);router[_0x0a9e('0x21')](_0x0a9e('0x22'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x23')]);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x24')]);router[_0x0a9e('0x25')](_0x0a9e('0xc'),auth['isAuthenticated'](),controller[_0x0a9e('0x26')]);router['delete'](_0x0a9e('0x18'),auth['isAuthenticated'](),controller[_0x0a9e('0x27')]);router[_0x0a9e('0x25')](_0x0a9e('0x14'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x28')]);module[_0x0a9e('0x29')]=router; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.attributes.js b/server/api/faxApplication/faxApplication.attributes.js index 36021e2..5316cae 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 _0xfffa=['TEXT','STRING','INTEGER','noop'];(function(_0x3e2952,_0x546a1b){var _0x1641c6=function(_0x412c55){while(--_0x412c55){_0x3e2952['push'](_0x3e2952['shift']());}};_0x1641c6(++_0x546a1b);}(_0xfffa,0x15e));var _0xafff=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xfffa[_0x57b54c];return _0x59cc19;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize[_0xafff('0x0')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xafff('0x1')},'appdata':{'type':Sequelize[_0xafff('0x2')]()},'description':{'type':Sequelize[_0xafff('0x3')]},'interval':{'type':Sequelize[_0xafff('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x33fa=['noop','TEXT','*,*,*,*','sequelize','exports','INTEGER','STRING'];(function(_0x31d6c2,_0x422dcd){var _0x295dd0=function(_0x2b5dd1){while(--_0x2b5dd1){_0x31d6c2['push'](_0x31d6c2['shift']());}};_0x295dd0(++_0x422dcd);}(_0x33fa,0xce));var _0xa33f=function(_0x1780f8,_0x11ba93){_0x1780f8=_0x1780f8-0x0;var _0x33a410=_0x33fa[_0x1780f8];return _0x33a410;};'use strict';var Sequelize=require(_0xa33f('0x0'));module[_0xa33f('0x1')]={'priority':{'type':Sequelize[_0xa33f('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xa33f('0x3')],'allowNull':![],'defaultValue':_0xa33f('0x4')},'appdata':{'type':Sequelize[_0xa33f('0x5')]()},'description':{'type':Sequelize[_0xa33f('0x3')]},'interval':{'type':Sequelize[_0xa33f('0x3')],'defaultValue':_0xa33f('0x6')}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index 04c9c29..f3941dc 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 _0x0a7c=['filters','intersection','fields','attributes','length','nolimit','order','sort','filter','where','merge','options','includeAll','include','rows','catch','show','params','create','body','update','find','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','error','stack','name','send','index','map','FaxApplication','rawAttributes','fieldName','type','key','model','keys','query'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x0a7c,0xa8));var _0xc0a7=function(_0x11dde4,_0x1d4852){_0x11dde4=_0x11dde4-0x0;var _0x6eea94=_0x0a7c[_0x11dde4];return _0x6eea94;};'use strict';var emlformat=require(_0xc0a7('0x0'));var rimraf=require(_0xc0a7('0x1'));var zipdir=require(_0xc0a7('0x2'));var jsonpatch=require(_0xc0a7('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xc0a7('0x4'));var util=require(_0xc0a7('0x5'));var path=require(_0xc0a7('0x6'));var sox=require(_0xc0a7('0x7'));var csv=require(_0xc0a7('0x8'));var ejs=require(_0xc0a7('0x9'));var fs=require('fs');var fs_extra=require(_0xc0a7('0xa'));var _=require('lodash');var squel=require(_0xc0a7('0xb'));var crypto=require(_0xc0a7('0xc'));var jsforce=require(_0xc0a7('0xd'));var deskjs=require(_0xc0a7('0xe'));var toCsv=require(_0xc0a7('0x8'));var querystring=require(_0xc0a7('0xf'));var Papa=require(_0xc0a7('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xc0a7('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc0a7('0x12'));var logger=require(_0xc0a7('0x13'))(_0xc0a7('0x14'));var utils=require(_0xc0a7('0x15'));var config=require(_0xc0a7('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xc0a7('0x17'))['db'];function respondWithStatusCode(_0x33831a,_0x1a6be5){_0x1a6be5=_0x1a6be5||0xcc;return function(_0x3a3935){if(_0x3a3935){return _0x33831a[_0xc0a7('0x18')](_0x1a6be5);}return _0x33831a[_0xc0a7('0x19')](_0x1a6be5)[_0xc0a7('0x1a')]();};}function respondWithResult(_0xb139bc,_0x2d5ea3){_0x2d5ea3=_0x2d5ea3||0xc8;return function(_0x3e0453){if(_0x3e0453){return _0xb139bc['status'](_0x2d5ea3)['json'](_0x3e0453);}};}function respondWithFilteredResult(_0x3d5c47,_0x2f9c61){return function(_0x46686c){if(_0x46686c){var _0x5d4015=typeof _0x2f9c61[_0xc0a7('0x1b')]===_0xc0a7('0x1c')&&typeof _0x2f9c61[_0xc0a7('0x1d')]===_0xc0a7('0x1c');var _0x560818=_0x46686c['count'];var _0x492df7=_0x5d4015?0x0:_0x2f9c61[_0xc0a7('0x1b')];var _0x4b6999=_0x5d4015?_0x46686c[_0xc0a7('0x1e')]:_0x2f9c61[_0xc0a7('0x1b')]+_0x2f9c61[_0xc0a7('0x1d')];var _0x113e82;if(_0x4b6999>=_0x560818){_0x4b6999=_0x560818;_0x113e82=0xc8;}else{_0x113e82=0xce;}_0x3d5c47[_0xc0a7('0x19')](_0x113e82);return _0x3d5c47[_0xc0a7('0x1f')](_0xc0a7('0x20'),_0x492df7+'-'+_0x4b6999+'/'+_0x560818)['json'](_0x46686c);}return null;};}function patchUpdates(_0x1e5367){return function(_0x1a2416){try{jsonpatch['apply'](_0x1a2416,_0x1e5367,!![]);}catch(_0x24f954){return BPromise[_0xc0a7('0x21')](_0x24f954);}return _0x1a2416[_0xc0a7('0x22')]();};}function saveUpdates(_0x4ecefe,_0x2ad5fb){return function(_0x56acad){if(_0x56acad){return _0x56acad['update'](_0x4ecefe)[_0xc0a7('0x23')](function(_0x326f0c){return _0x326f0c;});}return null;};}function removeEntity(_0x20843c,_0x5ec028){return function(_0x4c2aff){if(_0x4c2aff){return _0x4c2aff[_0xc0a7('0x24')]()[_0xc0a7('0x23')](function(){_0x20843c[_0xc0a7('0x19')](0xcc)[_0xc0a7('0x1a')]();});}};}function handleEntityNotFound(_0x578c81,_0x5a5dae){return function(_0x47f752){if(!_0x47f752){_0x578c81[_0xc0a7('0x18')](0x194);}return _0x47f752;};}function handleError(_0x1658f7,_0x114bff){_0x114bff=_0x114bff||0x1f4;return function(_0x4e4912){logger[_0xc0a7('0x25')](_0x4e4912[_0xc0a7('0x26')]);if(_0x4e4912[_0xc0a7('0x27')]){delete _0x4e4912[_0xc0a7('0x27')];}_0x1658f7['status'](_0x114bff)[_0xc0a7('0x28')](_0x4e4912);};}exports[_0xc0a7('0x29')]=function(_0x1e39c8,_0x2de615){var _0x14b432={},_0x5e82ed={},_0x1b9942={'count':0x0,'rows':[]};var _0x26bab5=_[_0xc0a7('0x2a')](db[_0xc0a7('0x2b')][_0xc0a7('0x2c')],function(_0xcd7db3){return{'name':_0xcd7db3[_0xc0a7('0x2d')],'type':_0xcd7db3[_0xc0a7('0x2e')][_0xc0a7('0x2f')]};});_0x5e82ed[_0xc0a7('0x30')]=_[_0xc0a7('0x2a')](_0x26bab5,_0xc0a7('0x27'));_0x5e82ed['query']=_[_0xc0a7('0x31')](_0x1e39c8[_0xc0a7('0x32')]);_0x5e82ed[_0xc0a7('0x33')]=_['intersection'](_0x5e82ed[_0xc0a7('0x30')],_0x5e82ed['query']);_0x14b432['attributes']=_[_0xc0a7('0x34')](_0x5e82ed[_0xc0a7('0x30')],qs['fields'](_0x1e39c8['query'][_0xc0a7('0x35')]));_0x14b432[_0xc0a7('0x36')]=_0x14b432['attributes'][_0xc0a7('0x37')]?_0x14b432['attributes']:_0x5e82ed['model'];if(!_0x1e39c8[_0xc0a7('0x32')]['hasOwnProperty'](_0xc0a7('0x38'))){_0x14b432[_0xc0a7('0x1d')]=qs[_0xc0a7('0x1d')](_0x1e39c8['query'][_0xc0a7('0x1d')]);_0x14b432[_0xc0a7('0x1b')]=qs[_0xc0a7('0x1b')](_0x1e39c8[_0xc0a7('0x32')][_0xc0a7('0x1b')]);}_0x14b432[_0xc0a7('0x39')]=qs[_0xc0a7('0x3a')](_0x1e39c8[_0xc0a7('0x32')][_0xc0a7('0x3a')]);_0x14b432['where']=qs[_0xc0a7('0x33')](_['pick'](_0x1e39c8[_0xc0a7('0x32')],_0x5e82ed[_0xc0a7('0x33')]),_0x26bab5);if(_0x1e39c8['query'][_0xc0a7('0x3b')]){_0x14b432[_0xc0a7('0x3c')]=_[_0xc0a7('0x3d')](_0x14b432[_0xc0a7('0x3c')],{'$or':_['map'](_0x26bab5,function(_0x5bb1c4){if(_0x5bb1c4[_0xc0a7('0x2e')]!=='VIRTUAL'){var _0x33123b={};_0x33123b[_0x5bb1c4[_0xc0a7('0x27')]]={'$like':'%'+_0x1e39c8[_0xc0a7('0x32')][_0xc0a7('0x3b')]+'%'};return _0x33123b;}})});}_0x14b432=_[_0xc0a7('0x3d')]({},_0x14b432,_0x1e39c8[_0xc0a7('0x3e')]);var _0x2e1315={'where':_0x14b432['where']};return db[_0xc0a7('0x2b')][_0xc0a7('0x1e')](_0x2e1315)[_0xc0a7('0x23')](function(_0x502440){_0x1b9942[_0xc0a7('0x1e')]=_0x502440;if(_0x1e39c8[_0xc0a7('0x32')][_0xc0a7('0x3f')]){_0x14b432[_0xc0a7('0x40')]=[{'all':!![]}];}return db[_0xc0a7('0x2b')]['findAll'](_0x14b432);})[_0xc0a7('0x23')](function(_0x41c066){_0x1b9942[_0xc0a7('0x41')]=_0x41c066;return _0x1b9942;})[_0xc0a7('0x23')](respondWithFilteredResult(_0x2de615,_0x14b432))[_0xc0a7('0x42')](handleError(_0x2de615,null));};exports[_0xc0a7('0x43')]=function(_0x337a32,_0x207c08){var _0x37904a={'raw':!![],'where':{'id':_0x337a32[_0xc0a7('0x44')]['id']}},_0x46eb3e={};_0x46eb3e['model']=_[_0xc0a7('0x31')](db[_0xc0a7('0x2b')][_0xc0a7('0x2c')]);_0x46eb3e[_0xc0a7('0x32')]=_[_0xc0a7('0x31')](_0x337a32[_0xc0a7('0x32')]);_0x46eb3e[_0xc0a7('0x33')]=_[_0xc0a7('0x34')](_0x46eb3e[_0xc0a7('0x30')],_0x46eb3e[_0xc0a7('0x32')]);_0x37904a[_0xc0a7('0x36')]=_[_0xc0a7('0x34')](_0x46eb3e[_0xc0a7('0x30')],qs[_0xc0a7('0x35')](_0x337a32[_0xc0a7('0x32')]['fields']));_0x37904a[_0xc0a7('0x36')]=_0x37904a[_0xc0a7('0x36')][_0xc0a7('0x37')]?_0x37904a['attributes']:_0x46eb3e[_0xc0a7('0x30')];if(_0x337a32[_0xc0a7('0x32')][_0xc0a7('0x3f')]){_0x37904a['include']=[{'all':!![]}];}_0x37904a=_[_0xc0a7('0x3d')]({},_0x37904a,_0x337a32[_0xc0a7('0x3e')]);return db['FaxApplication']['find'](_0x37904a)['then'](handleEntityNotFound(_0x207c08,null))['then'](respondWithResult(_0x207c08,null))[_0xc0a7('0x42')](handleError(_0x207c08,null));};exports['create']=function(_0x26dbd6,_0x514e05){return db[_0xc0a7('0x2b')][_0xc0a7('0x45')](_0x26dbd6[_0xc0a7('0x46')],{})['then'](respondWithResult(_0x514e05,0xc9))[_0xc0a7('0x42')](handleError(_0x514e05,null));};exports[_0xc0a7('0x47')]=function(_0x1cd852,_0xe28fdf){if(_0x1cd852[_0xc0a7('0x46')]['id']){delete _0x1cd852[_0xc0a7('0x46')]['id'];}return db[_0xc0a7('0x2b')][_0xc0a7('0x48')]({'where':{'id':_0x1cd852[_0xc0a7('0x44')]['id']}})[_0xc0a7('0x23')](handleEntityNotFound(_0xe28fdf,null))[_0xc0a7('0x23')](saveUpdates(_0x1cd852[_0xc0a7('0x46')],null))[_0xc0a7('0x23')](respondWithResult(_0xe28fdf,null))[_0xc0a7('0x42')](handleError(_0xe28fdf,null));};exports[_0xc0a7('0x24')]=function(_0x45129c,_0x433c3c){return db[_0xc0a7('0x2b')][_0xc0a7('0x48')]({'where':{'id':_0x45129c[_0xc0a7('0x44')]['id']}})['then'](handleEntityNotFound(_0x433c3c,null))['then'](removeEntity(_0x433c3c,null))[_0xc0a7('0x42')](handleError(_0x433c3c,null));}; \ No newline at end of file +var _0x10e4=['ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','offset','undefined','count','limit','status','set','apply','reject','update','destroy','then','error','stack','name','send','map','FaxApplication','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','filter','merge','type','includeAll','include','findAll','rows','show','params','options','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring'];(function(_0x1ee0f7,_0x540c64){var _0x264c61=function(_0x31d76d){while(--_0x31d76d){_0x1ee0f7['push'](_0x1ee0f7['shift']());}};_0x264c61(++_0x540c64);}(_0x10e4,0x158));var _0x410e=function(_0x25af95,_0x325dcc){_0x25af95=_0x25af95-0x0;var _0x47b39b=_0x10e4[_0x25af95];return _0x47b39b;};'use strict';var emlformat=require(_0x410e('0x0'));var rimraf=require(_0x410e('0x1'));var zipdir=require(_0x410e('0x2'));var jsonpatch=require(_0x410e('0x3'));var rp=require(_0x410e('0x4'));var moment=require('moment');var BPromise=require(_0x410e('0x5'));var Mustache=require(_0x410e('0x6'));var util=require(_0x410e('0x7'));var path=require(_0x410e('0x8'));var sox=require('sox');var csv=require(_0x410e('0x9'));var ejs=require(_0x410e('0xa'));var fs=require('fs');var fs_extra=require(_0x410e('0xb'));var _=require('lodash');var squel=require(_0x410e('0xc'));var crypto=require(_0x410e('0xd'));var jsforce=require(_0x410e('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x410e('0xf'));var Papa=require('papaparse');var Redis=require(_0x410e('0x10'));var authService=require(_0x410e('0x11'));var qs=require(_0x410e('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x410e('0x13'));var logger=require(_0x410e('0x14'))(_0x410e('0x15'));var utils=require(_0x410e('0x16'));var config=require(_0x410e('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x155537,_0x4bfc43){_0x4bfc43=_0x4bfc43||0xcc;return function(_0x20d875){if(_0x20d875){return _0x155537[_0x410e('0x18')](_0x4bfc43);}return _0x155537['status'](_0x4bfc43)[_0x410e('0x19')]();};}function respondWithResult(_0x115891,_0x56cc95){_0x56cc95=_0x56cc95||0xc8;return function(_0x333207){if(_0x333207){return _0x115891['status'](_0x56cc95)['json'](_0x333207);}};}function respondWithFilteredResult(_0x342aba,_0x2063e2){return function(_0x15aee8){if(_0x15aee8){var _0x5d17c6=typeof _0x2063e2[_0x410e('0x1a')]==='undefined'&&typeof _0x2063e2['limit']===_0x410e('0x1b');var _0x2d1899=_0x15aee8[_0x410e('0x1c')];var _0x24f8c0=_0x5d17c6?0x0:_0x2063e2['offset'];var _0x45e85d=_0x5d17c6?_0x15aee8['count']:_0x2063e2['offset']+_0x2063e2[_0x410e('0x1d')];var _0x172e05;if(_0x45e85d>=_0x2d1899){_0x45e85d=_0x2d1899;_0x172e05=0xc8;}else{_0x172e05=0xce;}_0x342aba[_0x410e('0x1e')](_0x172e05);return _0x342aba[_0x410e('0x1f')]('Content-Range',_0x24f8c0+'-'+_0x45e85d+'/'+_0x2d1899)['json'](_0x15aee8);}return null;};}function patchUpdates(_0x3aaf23){return function(_0x7e49c4){try{jsonpatch[_0x410e('0x20')](_0x7e49c4,_0x3aaf23,!![]);}catch(_0x29ac10){return BPromise[_0x410e('0x21')](_0x29ac10);}return _0x7e49c4['save']();};}function saveUpdates(_0x351a99,_0x529068){return function(_0x31fb88){if(_0x31fb88){return _0x31fb88[_0x410e('0x22')](_0x351a99)['then'](function(_0x9fcafd){return _0x9fcafd;});}return null;};}function removeEntity(_0x59283f,_0x51ee71){return function(_0x5b3135){if(_0x5b3135){return _0x5b3135[_0x410e('0x23')]()[_0x410e('0x24')](function(){_0x59283f[_0x410e('0x1e')](0xcc)[_0x410e('0x19')]();});}};}function handleEntityNotFound(_0x44c379,_0x106ba9){return function(_0x443ea2){if(!_0x443ea2){_0x44c379[_0x410e('0x18')](0x194);}return _0x443ea2;};}function handleError(_0x4a7f98,_0x3b5c62){_0x3b5c62=_0x3b5c62||0x1f4;return function(_0x4d5bd4){logger[_0x410e('0x25')](_0x4d5bd4[_0x410e('0x26')]);if(_0x4d5bd4[_0x410e('0x27')]){delete _0x4d5bd4['name'];}_0x4a7f98[_0x410e('0x1e')](_0x3b5c62)[_0x410e('0x28')](_0x4d5bd4);};}exports['index']=function(_0x3adc9e,_0x1f14a9){var _0x5b7539={},_0x22c1c2={},_0x19b104={'count':0x0,'rows':[]};var _0x39f782=_[_0x410e('0x29')](db[_0x410e('0x2a')][_0x410e('0x2b')],function(_0x357070){return{'name':_0x357070[_0x410e('0x2c')],'type':_0x357070['type'][_0x410e('0x2d')]};});_0x22c1c2[_0x410e('0x2e')]=_['map'](_0x39f782,_0x410e('0x27'));_0x22c1c2[_0x410e('0x2f')]=_[_0x410e('0x30')](_0x3adc9e[_0x410e('0x2f')]);_0x22c1c2['filters']=_[_0x410e('0x31')](_0x22c1c2[_0x410e('0x2e')],_0x22c1c2[_0x410e('0x2f')]);_0x5b7539[_0x410e('0x32')]=_[_0x410e('0x31')](_0x22c1c2[_0x410e('0x2e')],qs['fields'](_0x3adc9e[_0x410e('0x2f')][_0x410e('0x33')]));_0x5b7539[_0x410e('0x32')]=_0x5b7539['attributes'][_0x410e('0x34')]?_0x5b7539['attributes']:_0x22c1c2[_0x410e('0x2e')];if(!_0x3adc9e[_0x410e('0x2f')][_0x410e('0x35')]('nolimit')){_0x5b7539[_0x410e('0x1d')]=qs['limit'](_0x3adc9e['query'][_0x410e('0x1d')]);_0x5b7539[_0x410e('0x1a')]=qs[_0x410e('0x1a')](_0x3adc9e[_0x410e('0x2f')][_0x410e('0x1a')]);}_0x5b7539[_0x410e('0x36')]=qs[_0x410e('0x37')](_0x3adc9e[_0x410e('0x2f')][_0x410e('0x37')]);_0x5b7539[_0x410e('0x38')]=qs[_0x410e('0x39')](_['pick'](_0x3adc9e['query'],_0x22c1c2[_0x410e('0x39')]),_0x39f782);if(_0x3adc9e[_0x410e('0x2f')][_0x410e('0x3a')]){_0x5b7539['where']=_[_0x410e('0x3b')](_0x5b7539[_0x410e('0x38')],{'$or':_[_0x410e('0x29')](_0x39f782,function(_0x58994b){if(_0x58994b[_0x410e('0x3c')]!=='VIRTUAL'){var _0x42faff={};_0x42faff[_0x58994b[_0x410e('0x27')]]={'$like':'%'+_0x3adc9e[_0x410e('0x2f')][_0x410e('0x3a')]+'%'};return _0x42faff;}})});}_0x5b7539=_[_0x410e('0x3b')]({},_0x5b7539,_0x3adc9e['options']);var _0x5f2467={'where':_0x5b7539[_0x410e('0x38')]};return db[_0x410e('0x2a')][_0x410e('0x1c')](_0x5f2467)[_0x410e('0x24')](function(_0x3287f7){_0x19b104[_0x410e('0x1c')]=_0x3287f7;if(_0x3adc9e[_0x410e('0x2f')][_0x410e('0x3d')]){_0x5b7539[_0x410e('0x3e')]=[{'all':!![]}];}return db[_0x410e('0x2a')][_0x410e('0x3f')](_0x5b7539);})[_0x410e('0x24')](function(_0x932aab){_0x19b104[_0x410e('0x40')]=_0x932aab;return _0x19b104;})['then'](respondWithFilteredResult(_0x1f14a9,_0x5b7539))['catch'](handleError(_0x1f14a9,null));};exports[_0x410e('0x41')]=function(_0x2698b1,_0x7ffdc6){var _0x1dd2b7={'raw':!![],'where':{'id':_0x2698b1[_0x410e('0x42')]['id']}},_0x504fbc={};_0x504fbc['model']=_[_0x410e('0x30')](db[_0x410e('0x2a')]['rawAttributes']);_0x504fbc['query']=_['keys'](_0x2698b1[_0x410e('0x2f')]);_0x504fbc[_0x410e('0x39')]=_[_0x410e('0x31')](_0x504fbc['model'],_0x504fbc[_0x410e('0x2f')]);_0x1dd2b7['attributes']=_['intersection'](_0x504fbc['model'],qs[_0x410e('0x33')](_0x2698b1['query'][_0x410e('0x33')]));_0x1dd2b7[_0x410e('0x32')]=_0x1dd2b7[_0x410e('0x32')][_0x410e('0x34')]?_0x1dd2b7['attributes']:_0x504fbc[_0x410e('0x2e')];if(_0x2698b1['query']['includeAll']){_0x1dd2b7['include']=[{'all':!![]}];}_0x1dd2b7=_['merge']({},_0x1dd2b7,_0x2698b1[_0x410e('0x43')]);return db['FaxApplication'][_0x410e('0x44')](_0x1dd2b7)[_0x410e('0x24')](handleEntityNotFound(_0x7ffdc6,null))[_0x410e('0x24')](respondWithResult(_0x7ffdc6,null))[_0x410e('0x45')](handleError(_0x7ffdc6,null));};exports[_0x410e('0x46')]=function(_0x20bd3c,_0x122bce){return db[_0x410e('0x2a')]['create'](_0x20bd3c[_0x410e('0x47')],{})[_0x410e('0x24')](respondWithResult(_0x122bce,0xc9))[_0x410e('0x45')](handleError(_0x122bce,null));};exports[_0x410e('0x22')]=function(_0x48884c,_0x2ecb40){if(_0x48884c[_0x410e('0x47')]['id']){delete _0x48884c['body']['id'];}return db[_0x410e('0x2a')][_0x410e('0x44')]({'where':{'id':_0x48884c['params']['id']}})[_0x410e('0x24')](handleEntityNotFound(_0x2ecb40,null))[_0x410e('0x24')](saveUpdates(_0x48884c[_0x410e('0x47')],null))['then'](respondWithResult(_0x2ecb40,null))[_0x410e('0x45')](handleError(_0x2ecb40,null));};exports[_0x410e('0x23')]=function(_0x353a09,_0x79979){return db[_0x410e('0x2a')][_0x410e('0x44')]({'where':{'id':_0x353a09['params']['id']}})['then'](handleEntityNotFound(_0x79979,null))['then'](removeEntity(_0x79979,null))[_0x410e('0x45')](handleError(_0x79979,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index 570928c..8d38cee 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 _0xd106=['request-promise','path','rimraf','./faxApplication.attributes','exports','define','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xd106,0xcb));var _0x6d10=function(_0x597220,_0x1405f4){_0x597220=_0x597220-0x0;var _0x25bfca=_0xd106[_0x597220];return _0x25bfca;};'use strict';var _=require(_0x6d10('0x0'));var util=require(_0x6d10('0x1'));var logger=require(_0x6d10('0x2'))('api');var moment=require(_0x6d10('0x3'));var BPromise=require(_0x6d10('0x4'));var rp=require(_0x6d10('0x5'));var fs=require('fs');var path=require(_0x6d10('0x6'));var rimraf=require(_0x6d10('0x7'));var config=require('../../config/environment');var attributes=require(_0x6d10('0x8'));module[_0x6d10('0x9')]=function(_0x4e34d7,_0x3202ba){return _0x4e34d7[_0x6d10('0xa')]('FaxApplication',attributes,{'tableName':'fax_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6d10('0xb'),'collate':_0x6d10('0xc')});}; \ No newline at end of file +var _0x4c78=['utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxApplication.attributes','exports','define','FaxApplication','fax_applications','utf8mb4'];(function(_0x48c213,_0x1f8dd6){var _0x114a1a=function(_0x54832c){while(--_0x54832c){_0x48c213['push'](_0x48c213['shift']());}};_0x114a1a(++_0x1f8dd6);}(_0x4c78,0xd1));var _0x84c7=function(_0x477b24,_0x5ed7b3){_0x477b24=_0x477b24-0x0;var _0x5ca26f=_0x4c78[_0x477b24];return _0x5ca26f;};'use strict';var _=require('lodash');var util=require(_0x84c7('0x0'));var logger=require(_0x84c7('0x1'))(_0x84c7('0x2'));var moment=require(_0x84c7('0x3'));var BPromise=require(_0x84c7('0x4'));var rp=require(_0x84c7('0x5'));var fs=require('fs');var path=require(_0x84c7('0x6'));var rimraf=require(_0x84c7('0x7'));var config=require(_0x84c7('0x8'));var attributes=require(_0x84c7('0x9'));module[_0x84c7('0xa')]=function(_0x315558,_0x189c0a){return _0x315558[_0x84c7('0xb')](_0x84c7('0xc'),attributes,{'tableName':_0x84c7('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x84c7('0xe'),'collate':_0x84c7('0xf')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index 9f6dc36..4029881 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 _0x84cc=['body','options','where','attributes','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','FaxApplication,\x20%s,\x20%s','debug','FaxApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','UpdateFaxApplication','FaxApplication','update'];(function(_0x238bda,_0x4503b9){var _0x264bc5=function(_0x4efe8d){while(--_0x4efe8d){_0x238bda['push'](_0x238bda['shift']());}};_0x264bc5(++_0x4503b9);}(_0x84cc,0x1c6));var _0xc84c=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x84cc[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0xc84c('0x0'));var util=require('util');var moment=require(_0xc84c('0x1'));var BPromise=require(_0xc84c('0x2'));var rs=require(_0xc84c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc84c('0x4'))['db'];var utils=require(_0xc84c('0x5'));var logger=require(_0xc84c('0x6'))('rpc');var config=require(_0xc84c('0x7'));var jayson=require(_0xc84c('0x8'));var client=jayson[_0xc84c('0x9')][_0xc84c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2895f6,_0x1f0951,_0x2276b6){return new BPromise(function(_0x3f4ffd,_0x435163){return client[_0xc84c('0xb')](_0x2895f6,_0x2276b6)[_0xc84c('0xc')](function(_0x4c24eb){logger['info'](_0xc84c('0xd'),_0x1f0951,'request\x20sent');logger[_0xc84c('0xe')](_0xc84c('0xf'),_0x1f0951,_0xc84c('0x10'),JSON[_0xc84c('0x11')](_0x4c24eb));if(_0x4c24eb['error']){if(_0x4c24eb[_0xc84c('0x12')][_0xc84c('0x13')]===0x1f4){logger[_0xc84c('0x12')](_0xc84c('0xd'),_0x1f0951,_0x4c24eb[_0xc84c('0x12')][_0xc84c('0x14')]);return _0x435163(_0x4c24eb[_0xc84c('0x12')][_0xc84c('0x14')]);}logger[_0xc84c('0x12')]('FaxApplication,\x20%s,\x20%s',_0x1f0951,_0x4c24eb['error'][_0xc84c('0x14')]);return _0x3f4ffd(_0x4c24eb[_0xc84c('0x12')][_0xc84c('0x14')]);}else{logger[_0xc84c('0x15')](_0xc84c('0xd'),_0x1f0951,_0xc84c('0x10'));_0x3f4ffd(_0x4c24eb['result'][_0xc84c('0x14')]);}})[_0xc84c('0x16')](function(_0x11deb4){logger[_0xc84c('0x12')](_0xc84c('0xd'),_0x1f0951,_0x11deb4);_0x435163(_0x11deb4);});});}exports[_0xc84c('0x17')]=function(_0x51c938){var _0x1709e5=this;return new Promise(function(_0x34c30c,_0x57bcfe){return db[_0xc84c('0x18')][_0xc84c('0x19')](_0x51c938[_0xc84c('0x1a')],{'raw':_0x51c938[_0xc84c('0x1b')]?_0x51c938['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x51c938['options']?_0x51c938[_0xc84c('0x1b')][_0xc84c('0x1c')]||null:null,'attributes':_0x51c938['options']?_0x51c938[_0xc84c('0x1b')][_0xc84c('0x1d')]||null:null,'limit':_0x51c938[_0xc84c('0x1b')]?_0x51c938[_0xc84c('0x1b')]['limit']||null:null})[_0xc84c('0xc')](function(_0x5eb63d){logger['info']('UpdateFaxApplication',_0x51c938);logger[_0xc84c('0xe')]('UpdateFaxApplication',_0x51c938,JSON[_0xc84c('0x11')](_0x5eb63d));_0x34c30c(_0x5eb63d);})[_0xc84c('0x16')](function(_0x1f3ce4){logger[_0xc84c('0x12')](_0xc84c('0x17'),_0x1f3ce4[_0xc84c('0x14')],_0x51c938);_0x57bcfe(_0x1709e5[_0xc84c('0x12')](0x1f4,_0x1f3ce4[_0xc84c('0x14')]));});});}; \ No newline at end of file +var _0xee4d=['then','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateFaxApplication','raw','options','limit'];(function(_0x1a4ffc,_0x4ba1ed){var _0x293676=function(_0x223505){while(--_0x223505){_0x1a4ffc['push'](_0x1a4ffc['shift']());}};_0x293676(++_0x4ba1ed);}(_0xee4d,0x1a1));var _0xdee4=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0xee4d[_0x334841];return _0x5beb4b;};'use strict';var _=require(_0xdee4('0x0'));var util=require('util');var moment=require(_0xdee4('0x1'));var BPromise=require('bluebird');var rs=require(_0xdee4('0x2'));var fs=require('fs');var Redis=require(_0xdee4('0x3'));var db=require(_0xdee4('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xdee4('0x5'))(_0xdee4('0x6'));var config=require(_0xdee4('0x7'));var jayson=require(_0xdee4('0x8'));var client=jayson['client'][_0xdee4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x68b949,_0x502fd0,_0x7c68d){return new BPromise(function(_0x12252a,_0x1ca641){return client['request'](_0x68b949,_0x7c68d)['then'](function(_0x5b9882){logger[_0xdee4('0xa')](_0xdee4('0xb'),_0x502fd0,_0xdee4('0xc'));logger[_0xdee4('0xd')](_0xdee4('0xe'),_0x502fd0,_0xdee4('0xc'),JSON[_0xdee4('0xf')](_0x5b9882));if(_0x5b9882['error']){if(_0x5b9882[_0xdee4('0x10')][_0xdee4('0x11')]===0x1f4){logger['error'](_0xdee4('0xb'),_0x502fd0,_0x5b9882['error'][_0xdee4('0x12')]);return _0x1ca641(_0x5b9882[_0xdee4('0x10')]['message']);}logger['error']('FaxApplication,\x20%s,\x20%s',_0x502fd0,_0x5b9882[_0xdee4('0x10')][_0xdee4('0x12')]);return _0x12252a(_0x5b9882[_0xdee4('0x10')][_0xdee4('0x12')]);}else{logger[_0xdee4('0xa')](_0xdee4('0xb'),_0x502fd0,'request\x20sent');_0x12252a(_0x5b9882[_0xdee4('0x13')][_0xdee4('0x12')]);}})[_0xdee4('0x14')](function(_0x3c9544){logger[_0xdee4('0x10')](_0xdee4('0xb'),_0x502fd0,_0x3c9544);_0x1ca641(_0x3c9544);});});}exports[_0xdee4('0x15')]=function(_0x220977){var _0x2c23ab=this;return new Promise(function(_0x56133a,_0x516ae9){return db['FaxApplication']['update'](_0x220977['body'],{'raw':_0x220977['options']?_0x220977['options'][_0xdee4('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x220977[_0xdee4('0x17')]?_0x220977[_0xdee4('0x17')]['where']||null:null,'attributes':_0x220977['options']?_0x220977[_0xdee4('0x17')]['attributes']||null:null,'limit':_0x220977[_0xdee4('0x17')]?_0x220977[_0xdee4('0x17')][_0xdee4('0x18')]||null:null})[_0xdee4('0x19')](function(_0x13bb5a){logger[_0xdee4('0xa')](_0xdee4('0x15'),_0x220977);logger[_0xdee4('0xd')](_0xdee4('0x15'),_0x220977,JSON[_0xdee4('0xf')](_0x13bb5a));_0x56133a(_0x13bb5a);})[_0xdee4('0x14')](function(_0x5920bb){logger['error'](_0xdee4('0x15'),_0x5920bb[_0xdee4('0x12')],_0x220977);_0x516ae9(_0x2c23ab[_0xdee4('0x10')](0x1f4,_0x5920bb[_0xdee4('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index d76c117..351a79c 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 _0x4213=['post','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./faxApplication.controller','get','isAuthenticated','index','/:id','show'];(function(_0x1dc3e0,_0x5f15e0){var _0x2918cd=function(_0x44474d){while(--_0x44474d){_0x1dc3e0['push'](_0x1dc3e0['shift']());}};_0x2918cd(++_0x5f15e0);}(_0x4213,0x77));var _0x3421=function(_0x84b14c,_0x13f0c5){_0x84b14c=_0x84b14c-0x0;var _0x4c92a7=_0x4213[_0x84b14c];return _0x4c92a7;};'use strict';var multer=require(_0x3421('0x0'));var util=require(_0x3421('0x1'));var path=require(_0x3421('0x2'));var timeout=require(_0x3421('0x3'));var express=require(_0x3421('0x4'));var router=express[_0x3421('0x5')]();var fs_extra=require(_0x3421('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x3421('0x7'));var config=require('../../config/environment');var controller=require(_0x3421('0x8'));router[_0x3421('0x9')]('/',auth[_0x3421('0xa')](),controller[_0x3421('0xb')]);router['get'](_0x3421('0xc'),auth[_0x3421('0xa')](),controller[_0x3421('0xd')]);router[_0x3421('0xe')]('/',auth[_0x3421('0xa')](),controller['create']);router[_0x3421('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x3421('0x10')]);router['delete'](_0x3421('0xc'),auth[_0x3421('0xa')](),controller[_0x3421('0x11')]);module[_0x3421('0x12')]=router; \ No newline at end of file +var _0x7916=['/:id','show','create','put','update','delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./faxApplication.controller','isAuthenticated','index'];(function(_0x4265f4,_0x44b225){var _0x4048a4=function(_0x33a761){while(--_0x33a761){_0x4265f4['push'](_0x4265f4['shift']());}};_0x4048a4(++_0x44b225);}(_0x7916,0x128));var _0x6791=function(_0x475176,_0x2f1e39){_0x475176=_0x475176-0x0;var _0x590219=_0x7916[_0x475176];return _0x590219;};'use strict';var multer=require(_0x6791('0x0'));var util=require('util');var path=require(_0x6791('0x1'));var timeout=require(_0x6791('0x2'));var express=require('express');var router=express[_0x6791('0x3')]();var fs_extra=require(_0x6791('0x4'));var auth=require(_0x6791('0x5'));var interaction=require(_0x6791('0x6'));var config=require('../../config/environment');var controller=require(_0x6791('0x7'));router['get']('/',auth[_0x6791('0x8')](),controller[_0x6791('0x9')]);router['get'](_0x6791('0xa'),auth['isAuthenticated'](),controller[_0x6791('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0x6791('0xc')]);router[_0x6791('0xd')]('/:id',auth[_0x6791('0x8')](),controller[_0x6791('0xe')]);router[_0x6791('0xf')]('/:id',auth[_0x6791('0x8')](),controller[_0x6791('0x10')]);module[_0x6791('0x11')]=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index 29dac06..776ae1b 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 _0x6801=['DATE','STRING','ENUM','out','sequelize','exports','BOOLEAN'];(function(_0xbc2974,_0xec3342){var _0x3a5b4f=function(_0x5ec5b5){while(--_0x5ec5b5){_0xbc2974['push'](_0xbc2974['shift']());}};_0x3a5b4f(++_0xec3342);}(_0x6801,0xa5));var _0x1680=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6801[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x1680('0x0'));module[_0x1680('0x1')]={'closed':{'type':Sequelize[_0x1680('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x1680('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x1680('0x4')]},'thirdDisposition':{'type':Sequelize[_0x1680('0x4')]},'note':{'type':Sequelize[_0x1680('0x4')]},'read1stAt':{'type':Sequelize[_0x1680('0x3')]},'fax':{'type':Sequelize[_0x1680('0x4')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x1680('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x1680('0x5')]('in',_0x1680('0x6')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0x6a93=['BOOLEAN','DATE','STRING','ENUM','out','sequelize','exports'];(function(_0x131585,_0x1abd33){var _0x1fcca2=function(_0x8f165b){while(--_0x8f165b){_0x131585['push'](_0x131585['shift']());}};_0x1fcca2(++_0x1abd33);}(_0x6a93,0x12b));var _0x36a9=function(_0x1d42ab,_0x448d18){_0x1d42ab=_0x1d42ab-0x0;var _0x1ec97c=_0x6a93[_0x1d42ab];return _0x1ec97c;};'use strict';var Sequelize=require(_0x36a9('0x0'));module[_0x36a9('0x1')]={'closed':{'type':Sequelize[_0x36a9('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x36a9('0x3')]},'disposition':{'type':Sequelize[_0x36a9('0x4')]},'secondDisposition':{'type':Sequelize[_0x36a9('0x4')]},'thirdDisposition':{'type':Sequelize[_0x36a9('0x4')]},'note':{'type':Sequelize[_0x36a9('0x4')]},'read1stAt':{'type':Sequelize['DATE']},'fax':{'type':Sequelize[_0x36a9('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x36a9('0x5')]('in',_0x36a9('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x36a9('0x5')]('in',_0x36a9('0x6')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.controller.js b/server/api/faxInteraction/faxInteraction.controller.js index 62befba..677dd6f 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 _0x4ae6=['t.id\x20=\x20it.TagId','expr','search','parseSearch','conditions','length','unreadMessages','having','`\x20=\x200','`\x20>\x200','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','value','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','text','start','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','UserId','body','buildExpression','compact','isEmpty','FaxAccountId','where','i.FaxAccountId\x20IN\x20?','concat','parse','$gte','$lte','null','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','filter','isNumeric','i.fax\x20LIKE\x20?','group','i.id','Sequelize','SELECT','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','contactName','DESC','t.id\x20IN\x20?','resolve','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','role','agent','i.FaxAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.phone','Contact.phone','c.mobile','Contact.mobile','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','ui.FaxInteractionId\x20IN\x20?','groupBy','push','all','rows','show','params','include','options','describe','addMessage','FaxMessage','omit','getMessages','findOne','YYYY-MM-DD\x20HH:mm:ss','includeAll','findAll','addTags','setTags','ids','Tag','color','faxInteractionTags:save','removeTags','join','server','files','tmp','root','attachments','transcript-%d-%s.zip','Messages','get','mkdirSync','Attachment','basename','existsSync','createWriteStream','download','log','err','unlinkSync','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','ejs','fs-extra','squel','crypto','to-csv','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','localhost','redis','register','status','end','json','undefined','limit','count','offset','Content-Range','reject','save','update','destroy','sendStatus','error','stack','name','Users','map','fullname','Tags','split','forEach','then','catch','FaxInteraction','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort','filters','pick','select','field','from','tools_tags','u.id','u.fullname','user_has_fax_interactions','users','fax_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','left_join','fax_accounts','fax_messages','me.FaxInteractionId\x20=\x20i.id','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id'];(function(_0x3a7a9c,_0x24f7d6){var _0x59156e=function(_0x5bc930){while(--_0x5bc930){_0x3a7a9c['push'](_0x3a7a9c['shift']());}};_0x59156e(++_0x24f7d6);}(_0x4ae6,0x14e));var _0x64ae=function(_0x331da2,_0x348571){_0x331da2=_0x331da2-0x0;var _0x294ffd=_0x4ae6[_0x331da2];return _0x294ffd;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x64ae('0x0'));var zipdir=require(_0x64ae('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x64ae('0x2'));var moment=require(_0x64ae('0x3'));var BPromise=require(_0x64ae('0x4'));var Mustache=require(_0x64ae('0x5'));var util=require(_0x64ae('0x6'));var path=require(_0x64ae('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x64ae('0x8'));var fs=require('fs');var fs_extra=require(_0x64ae('0x9'));var _=require('lodash');var squel=require(_0x64ae('0xa'));var crypto=require(_0x64ae('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x64ae('0xc'));var querystring=require(_0x64ae('0xd'));var Papa=require('papaparse');var Redis=require(_0x64ae('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x64ae('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x64ae('0x10'));var logger=require(_0x64ae('0x11'))('api');var utils=require(_0x64ae('0x12'));var config=require(_0x64ae('0x13'));var licenseUtil=require(_0x64ae('0x14'));var db=require(_0x64ae('0x15'))['db'];config['redis']=_[_0x64ae('0x16')](config['redis'],{'host':_0x64ae('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x64ae('0x18')]));require('./faxInteraction.socket')[_0x64ae('0x19')](socket);function respondWithStatusCode(_0x2a3cc8,_0x1c6e46){_0x1c6e46=_0x1c6e46||0xcc;return function(_0x12d62d){if(_0x12d62d){return _0x2a3cc8['sendStatus'](_0x1c6e46);}return _0x2a3cc8[_0x64ae('0x1a')](_0x1c6e46)[_0x64ae('0x1b')]();};}function respondWithResult(_0xdab106,_0x3a0cb9){_0x3a0cb9=_0x3a0cb9||0xc8;return function(_0x3265d7){if(_0x3265d7){return _0xdab106['status'](_0x3a0cb9)[_0x64ae('0x1c')](_0x3265d7);}};}function respondWithFilteredResult(_0x43727e,_0x2a3a7b){return function(_0x373722){if(_0x373722){var _0xf98982=typeof _0x2a3a7b['offset']===_0x64ae('0x1d')&&typeof _0x2a3a7b[_0x64ae('0x1e')]===_0x64ae('0x1d');var _0x465646=_0x373722[_0x64ae('0x1f')];var _0x4be4b5=_0xf98982?0x0:_0x2a3a7b[_0x64ae('0x20')];var _0x3f2f06=_0xf98982?_0x373722[_0x64ae('0x1f')]:_0x2a3a7b[_0x64ae('0x20')]+_0x2a3a7b['limit'];var _0x43e8a4;if(_0x3f2f06>=_0x465646){_0x3f2f06=_0x465646;_0x43e8a4=0xc8;}else{_0x43e8a4=0xce;}_0x43727e[_0x64ae('0x1a')](_0x43e8a4);return _0x43727e['set'](_0x64ae('0x21'),_0x4be4b5+'-'+_0x3f2f06+'/'+_0x465646)[_0x64ae('0x1c')](_0x373722);}return null;};}function patchUpdates(_0x45ca94){return function(_0x54f99c){try{jsonpatch['apply'](_0x54f99c,_0x45ca94,!![]);}catch(_0x49901a){return BPromise[_0x64ae('0x22')](_0x49901a);}return _0x54f99c[_0x64ae('0x23')]();};}function saveUpdates(_0x4f035c,_0x199f43){return function(_0x356b00){if(_0x356b00){return _0x356b00[_0x64ae('0x24')](_0x4f035c)['then'](function(_0x323801){return _0x323801;});}return null;};}function removeEntity(_0xee2d75,_0x295a88){return function(_0x5a8eaf){if(_0x5a8eaf){return _0x5a8eaf[_0x64ae('0x25')]()['then'](function(){_0xee2d75[_0x64ae('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x300d5b,_0x3911d6){return function(_0x403915){if(!_0x403915){_0x300d5b[_0x64ae('0x26')](0x194);}return _0x403915;};}function handleError(_0xce6548,_0x3d696b){_0x3d696b=_0x3d696b||0x1f4;return function(_0x27c6a0){logger[_0x64ae('0x27')](_0x27c6a0[_0x64ae('0x28')]);if(_0x27c6a0[_0x64ae('0x29')]){delete _0x27c6a0[_0x64ae('0x29')];}_0xce6548[_0x64ae('0x1a')](_0x3d696b)['send'](_0x27c6a0);};}function getInteractionUsers(_0x57085b,_0xc87eca){return new BPromise(function(_0x51c807,_0x3c9b28){try{if(_0xc87eca[_0x57085b['id']]){_0x57085b[_0x64ae('0x2a')]=_[_0x64ae('0x2b')](_0xc87eca[_0x57085b['id']],function(_0x5441a8){return{'id':_0x5441a8['id'],'fullname':_0x5441a8[_0x64ae('0x2c')]};});}}catch(_0xc31e1d){_0x3c9b28(_0xc31e1d);}_0x51c807(_0x57085b);});}function getInteractionTags(_0x50af8d,_0x5f0ac4){return new BPromise(function(_0x5409ae,_0x224e84){try{if(_0x50af8d['TagIds']){_0x50af8d[_0x64ae('0x2d')]=[];_0x50af8d['TagIds'][_0x64ae('0x2e')](',')[_0x64ae('0x2f')](function(_0x469c64){_0x50af8d[_0x64ae('0x2d')]['push'](_0x5f0ac4[_0x469c64]);});}delete _0x50af8d['TagIds'];}catch(_0x49e109){_0x224e84(_0x49e109);}_0x5409ae(_0x50af8d);});}function updateFaxInteraction(_0x2ca15d,_0x28dfd1,_0x5d1902){return new BPromise(function(_0x4e79cf,_0x28c7d5){return getInteractionUsers(_0x2ca15d,_0x5d1902)[_0x64ae('0x30')](function(_0xdc477b){return getInteractionTags(_0xdc477b,_0x28dfd1);})[_0x64ae('0x30')](function(_0x1d1bb2){_0x4e79cf(_0x1d1bb2);})[_0x64ae('0x31')](function(_0x535728){_0x28c7d5(_0x535728);});});}exports['index']=function(_0x241cc2,_0x2844f1){var _0x39aaed={},_0x35880e={},_0x56b526={'count':0x0,'rows':[]};var _0x12e95d=_[_0x64ae('0x2b')](db[_0x64ae('0x32')][_0x64ae('0x33')],function(_0x4e9edb){return{'name':_0x4e9edb[_0x64ae('0x34')],'type':_0x4e9edb[_0x64ae('0x35')][_0x64ae('0x36')]};});_0x35880e['model']=_[_0x64ae('0x2b')](_0x12e95d,_0x64ae('0x29'));_0x35880e[_0x64ae('0x37')]=_[_0x64ae('0x38')](_0x241cc2[_0x64ae('0x37')]);_0x35880e['filters']=_[_0x64ae('0x39')](_0x35880e[_0x64ae('0x3a')],_0x35880e[_0x64ae('0x37')]);_0x39aaed[_0x64ae('0x3b')]=_[_0x64ae('0x39')](_0x35880e[_0x64ae('0x3a')],qs[_0x64ae('0x3c')](_0x241cc2['query'][_0x64ae('0x3c')]));_0x39aaed[_0x64ae('0x3b')]=_0x39aaed[_0x64ae('0x3b')]['length']?_0x39aaed[_0x64ae('0x3b')]:_0x35880e[_0x64ae('0x3a')];if(!_0x241cc2[_0x64ae('0x37')][_0x64ae('0x3d')](_0x64ae('0x3e'))){_0x39aaed[_0x64ae('0x1e')]=qs[_0x64ae('0x1e')](_0x241cc2[_0x64ae('0x37')][_0x64ae('0x1e')]);_0x39aaed['offset']=qs['offset'](_0x241cc2[_0x64ae('0x37')][_0x64ae('0x20')]);}_0x39aaed['order']=qs[_0x64ae('0x3f')](_0x241cc2['query']['sort']);_0x39aaed['where']=qs[_0x64ae('0x40')](_[_0x64ae('0x41')](_0x241cc2['query'],_0x35880e['filters']),_0x12e95d);var _0x4587c1=[];var _0x4885fd=squel[_0x64ae('0x42')]()[_0x64ae('0x43')]('id')[_0x64ae('0x43')]('name')[_0x64ae('0x43')]('color')[_0x64ae('0x44')](_0x64ae('0x45'));var _0x5aae97=squel[_0x64ae('0x42')]()[_0x64ae('0x43')](_0x64ae('0x46'))[_0x64ae('0x43')](_0x64ae('0x47'))[_0x64ae('0x43')]('ui.FaxInteractionId')[_0x64ae('0x44')](_0x64ae('0x48'),'ui')['left_join'](_0x64ae('0x49'),'u','u.id\x20=\x20ui.UserId');var _0x5b3b0c=squel[_0x64ae('0x42')]()['from'](_0x64ae('0x4a'),'i')['left_join'](_0x64ae('0x4b'),'c',_0x64ae('0x4c'))['left_join'](_0x64ae('0x49'),'o',_0x64ae('0x4d'))[_0x64ae('0x4e')](_0x64ae('0x4f'),'a','a.id\x20=\x20i.FaxAccountId')['left_join'](_0x64ae('0x50'),'me',_0x64ae('0x51'))[_0x64ae('0x4e')](_0x64ae('0x52'),'it',_0x64ae('0x53'))['left_join']('tools_tags','t',_0x64ae('0x54'));var _0x32fed9=squel[_0x64ae('0x55')]();var _0xad2718=[];var _0x29036c=squel[_0x64ae('0x55')]();var _0x3bc143;if(_0x241cc2['query'][_0x64ae('0x56')]){_0x3bc143=as[_0x64ae('0x57')](_0x241cc2[_0x64ae('0x37')][_0x64ae('0x56')]);var _0x519e73=_0x3bc143['sqlOperator'];for(var _0x19a5c7=0x0;_0x19a5c7<_0x3bc143[_0x64ae('0x58')][_0x64ae('0x59')];_0x19a5c7++){var _0x18f404=_0x3bc143[_0x64ae('0x58')][_0x19a5c7];var _0x2da46b='i';var _0x504ea8=_['find'](_0x12e95d,[_0x64ae('0x29'),_0x18f404[_0x64ae('0x43')]]);if(!_0x504ea8){switch(_0x18f404[_0x64ae('0x43')]){case _0x64ae('0x5a'):if(_0x18f404['value']==0x1){_0x5b3b0c[_0x64ae('0x5b')]('`'+_0x18f404[_0x64ae('0x43')]+_0x64ae('0x5c'));}else{_0x5b3b0c[_0x64ae('0x5b')]('`'+_0x18f404['field']+_0x64ae('0x5d'));}break;case'Contact':if(_0x18f404[_0x64ae('0x5e')]===_0x64ae('0x5f')){if(_0x18f404['value'][_0x64ae('0x2e')]('\x20')[_0x64ae('0x59')]>0x1){_0x32fed9[_0x519e73](_0x64ae('0x60'),qs[_0x64ae('0x61')](_0x18f404[_0x64ae('0x62')]),null);}else{var _0xc2c2d7='%'+_0x18f404[_0x64ae('0x62')]+'%';_0x32fed9[_0x519e73](_0x64ae('0x63'),_0xc2c2d7,_0xc2c2d7,_0xc2c2d7);}}else{_0x504ea8=_[_0x64ae('0x64')](_0x12e95d,[_0x64ae('0x29'),'ContactId']);_0x18f404['field']='ContactId';_0x5a3183=as['buildExpression'](_0x2da46b,_0x504ea8['type'],_0x18f404);_0x32fed9[_0x519e73](_0x5a3183[_0x64ae('0x65')],_0x5a3183['value'][_0x64ae('0x66')],_0x5a3183[_0x64ae('0x62')][_0x64ae('0x1b')]);}break;case'Tag':var _0x473e0d=_0x18f404[_0x64ae('0x62')][_0x64ae('0x2e')](',')[_0x64ae('0x2b')](function(_0x26ff44){return Number(_0x26ff44);});_0x473e0d[_0x64ae('0x2f')](function(_0x430a96){_0x29036c['or'](_0x64ae('0x67'),'%,'+_0x430a96+',%');});_0xad2718=_[_0x64ae('0x68')](_0xad2718,_0x473e0d);break;case _0x64ae('0x69'):if(_0x18f404[_0x64ae('0x5e')]==='$substring'){_0x32fed9[_0x519e73]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x18f404[_0x64ae('0x62')]+'%',null);}else{_0x504ea8=_[_0x64ae('0x64')](_0x12e95d,[_0x64ae('0x29'),_0x64ae('0x6a')]);_0x18f404['field']=_0x64ae('0x6a');_0x5a3183=as['buildExpression'](_0x2da46b,_0x504ea8[_0x64ae('0x35')],_0x18f404);_0x32fed9[_0x519e73](_0x5a3183['text'],_0x5a3183[_0x64ae('0x62')][_0x64ae('0x66')],_0x5a3183[_0x64ae('0x62')][_0x64ae('0x1b')]);}break;case _0x64ae('0x6b'):_0x5a3183=as[_0x64ae('0x6c')]('me',null,_0x18f404);_0x32fed9[_0x519e73](_0x5a3183[_0x64ae('0x65')],_0x5a3183[_0x64ae('0x62')]['start'],_0x5a3183[_0x64ae('0x62')][_0x64ae('0x1b')]);break;}}else{var _0x5a3183=as['buildExpression'](_0x2da46b,_0x504ea8[_0x64ae('0x35')],_0x18f404);_0x32fed9[_0x519e73](_0x5a3183[_0x64ae('0x65')],_0x5a3183['value'][_0x64ae('0x66')],_0x5a3183[_0x64ae('0x62')][_0x64ae('0x1b')]);}}}else{var _0x8159bd=_(_0x241cc2[_0x64ae('0x37')])[_0x64ae('0x38')]()[_0x64ae('0x2b')](function(_0x5eec47){return _['some'](_0x12e95d,[_0x64ae('0x29'),_0x5eec47])?_0x5eec47:undefined;})[_0x64ae('0x6d')]()[_0x64ae('0x62')]();if(!_[_0x64ae('0x6e')](_0x8159bd)){_0x8159bd[_0x64ae('0x2f')](function(_0x41f1f4){if(_0x41f1f4===_0x64ae('0x6f')){_0x5b3b0c[_0x64ae('0x70')](_0x64ae('0x71'),[][_0x64ae('0x72')](_0x241cc2[_0x64ae('0x37')][_0x41f1f4]));}else if(_0x41f1f4==='createdAt'){var _0xc428ef=JSON[_0x64ae('0x73')](_0x241cc2[_0x64ae('0x37')][_0x41f1f4])[_0x64ae('0x74')];var _0x3a3436=JSON[_0x64ae('0x73')](_0x241cc2[_0x64ae('0x37')][_0x41f1f4])[_0x64ae('0x75')];_0x5b3b0c[_0x64ae('0x70')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0xc428ef,_0x3a3436);}else{if(_0x241cc2['query'][_0x41f1f4]===_0x64ae('0x76')){_0x5b3b0c[_0x64ae('0x70')]('i.'+_0x41f1f4+'\x20IS\x20NULL');}else{_0x5b3b0c[_0x64ae('0x70')]('i.'+_0x41f1f4+_0x64ae('0x77'),_0x241cc2[_0x64ae('0x37')][_0x41f1f4]);}}});}if(_0x241cc2[_0x64ae('0x37')]['read']){if(_0x241cc2['query'][_0x64ae('0x78')]==0x1){_0x5b3b0c['having'](_0x64ae('0x79'));}else{_0x5b3b0c[_0x64ae('0x5b')](_0x64ae('0x7a'));}}if(_0x241cc2[_0x64ae('0x37')][_0x64ae('0x7b')]){_0xad2718=_['isArray'](_0x241cc2[_0x64ae('0x37')][_0x64ae('0x7b')])?_0x241cc2['query'][_0x64ae('0x7b')]:new Array(_0x241cc2[_0x64ae('0x37')]['tag']);_0xad2718[_0x64ae('0x2f')](function(_0x298833){_0x29036c['or'](_0x64ae('0x67'),'%,'+_0x298833+',%');});}if(_0x241cc2[_0x64ae('0x37')][_0x64ae('0x7c')]){var _0x189989=_0x241cc2[_0x64ae('0x37')][_0x64ae('0x7c')]['replace']('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0x64ae('0x7d')](_0x189989)){_0x32fed9['or']('i.id\x20LIKE\x20?',_0x189989+'%')['or'](_0x64ae('0x7e'),_0x189989+'%');}_0x32fed9['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x189989+'%');}}_0x5b3b0c[_0x64ae('0x70')](_0x32fed9);_0x5b3b0c[_0x64ae('0x7f')](_0x64ae('0x80'));var _0x2ef91f={'type':db[_0x64ae('0x81')]['QueryTypes'][_0x64ae('0x82')],'raw':!![]};var _0x511cd2=_0x5b3b0c['clone']();_0x511cd2[_0x64ae('0x43')](_0x64ae('0x80'));_0x511cd2[_0x64ae('0x43')](_0x64ae('0x83'),_0x64ae('0x5a'));if(_0x39aaed[_0x64ae('0x84')]){_0x39aaed[_0x64ae('0x84')][_0x64ae('0x2f')](function(_0x1ffdb1){var _0x22676a=_0x1ffdb1[0x0]===_0x64ae('0x85')?_0x1ffdb1[0x0]:'i.'+_0x1ffdb1[0x0];_0x5b3b0c[_0x64ae('0x84')](_0x22676a,_0x1ffdb1[0x1]===_0x64ae('0x86')?![]:!![]);});}if(!_[_0x64ae('0x6e')](_0xad2718)){_0x5b3b0c['having'](_0x29036c);_0x511cd2[_0x64ae('0x70')](_0x64ae('0x87'),_0xad2718);}BPromise[_0x64ae('0x88')]()[_0x64ae('0x30')](function(){if(!_0x3bc143){if(_0x241cc2['query']['FaxAccountId'])return;_0x511cd2[_0x64ae('0x70')](_0x64ae('0x89'));_0x5b3b0c[_0x64ae('0x70')](_0x64ae('0x89'));return;}if(_0x241cc2[_0x64ae('0x8a')][_0x64ae('0x8b')]!==_0x64ae('0x8c'))return;return _0x241cc2[_0x64ae('0x8a')]['getFaxAccounts']({'attributes':['id'],'raw':!![]})[_0x64ae('0x30')](function(_0x3b9458){if(_[_0x64ae('0x6e')](_0x3b9458)){_0x511cd2[_0x64ae('0x70')](_0x64ae('0x8d'));_0x5b3b0c[_0x64ae('0x70')](_0x64ae('0x8d'));}else{_0x511cd2[_0x64ae('0x70')]('i.FaxAccountId\x20IN\x20?',_[_0x64ae('0x2b')](_0x3b9458,'id'));_0x5b3b0c[_0x64ae('0x70')](_0x64ae('0x71'),_['map'](_0x3b9458,'id'));}});})[_0x64ae('0x30')](function(){if(_0x241cc2['user']['role']===_0x64ae('0x8c')&&!_0x3bc143&&!_0x241cc2[_0x64ae('0x37')][_0x64ae('0x6f')])return[];return db[_0x64ae('0x8e')]['query'](_0x511cd2[_0x64ae('0x8f')](),_0x2ef91f);})[_0x64ae('0x30')](function(_0x50d10b){_0x56b526['count']=_0x50d10b[_0x64ae('0x59')];if(_0x56b526['count']===0x0)return[];return db['sequelize'][_0x64ae('0x37')](_0x4885fd[_0x64ae('0x8f')](),_0x2ef91f)[_0x64ae('0x30')](function(_0x13e4c5){_0x4587c1=_[_0x64ae('0x90')](_0x13e4c5,'id');_0x2ef91f=_[_0x64ae('0x91')](_0x2ef91f,{'model':db[_0x64ae('0x32')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x241cc2[_0x64ae('0x37')][_0x64ae('0x3c')]){_0x39aaed[_0x64ae('0x3b')]['forEach'](function(_0x40f3e1){_0x5b3b0c[_0x64ae('0x43')]('i.'+_0x40f3e1);});}else{_0x5b3b0c[_0x64ae('0x43')](_0x64ae('0x83'),'unreadMessages');_0x5b3b0c['field'](_0x64ae('0x92'),_0x64ae('0x93'));_0x5b3b0c[_0x64ae('0x43')](_0x64ae('0x94'),'Account.mandatoryDisposition');_0x5b3b0c['field'](_0x64ae('0x95'),_0x64ae('0x85'));_0x5b3b0c[_0x64ae('0x43')](_0x64ae('0x96'));_0x5b3b0c[_0x64ae('0x43')](_0x64ae('0x97'),_0x64ae('0x98'));_0x5b3b0c['field'](_0x64ae('0x99'),_0x64ae('0x9a'));_0x5b3b0c[_0x64ae('0x43')]('c.email','Contact.email');_0x5b3b0c[_0x64ae('0x43')](_0x64ae('0x9b'),_0x64ae('0x9c'));_0x5b3b0c[_0x64ae('0x43')](_0x64ae('0x9d'),_0x64ae('0x9e'));_0x5b3b0c[_0x64ae('0x43')]('c.fax',_0x64ae('0x9f'));_0x5b3b0c['field'](_0x64ae('0xa0'),_0x64ae('0xa1'));_0x5b3b0c[_0x64ae('0x43')](_0x64ae('0xa2'),_0x64ae('0xa3'));_0x5b3b0c[_0x64ae('0x43')](_0x64ae('0xa4'),_0x64ae('0xa5'));}if(_0x39aaed[_0x64ae('0x1e')])_0x5b3b0c[_0x64ae('0x1e')](_0x39aaed[_0x64ae('0x1e')]);if(_0x39aaed[_0x64ae('0x20')])_0x5b3b0c['offset'](_0x39aaed[_0x64ae('0x20')]);return db['sequelize'][_0x64ae('0x37')](_0x5b3b0c['toString'](),_0x2ef91f);})['then'](function(_0x3c67d2){if(_0x3c67d2[_0x64ae('0x59')]>0x0)_0x5aae97[_0x64ae('0x70')](_0x64ae('0xa6'),_[_0x64ae('0x2b')](_0x3c67d2,'id'));return db['sequelize'][_0x64ae('0x37')](_0x5aae97['toString'](),_0x2ef91f)[_0x64ae('0x30')](function(_0x99cd9d){var _0x2ff550=_[_0x64ae('0xa7')](_0x99cd9d,'FaxInteractionId');var _0x1bb7bc=[];_0x3c67d2[_0x64ae('0x2f')](function(_0x59cece){_0x1bb7bc[_0x64ae('0xa8')](updateFaxInteraction(_0x59cece,_0x4587c1,_0x2ff550));});return BPromise[_0x64ae('0xa9')](_0x1bb7bc);});});})[_0x64ae('0x30')](function(_0x5abd25){_0x56b526[_0x64ae('0xaa')]=_0x5abd25;return _0x56b526;})[_0x64ae('0x30')](respondWithFilteredResult(_0x2844f1,_0x39aaed))[_0x64ae('0x31')](handleError(_0x2844f1,null));};exports[_0x64ae('0xab')]=function(_0x453841,_0x43e72c){var _0x2f2792={'raw':![],'where':{'id':_0x453841[_0x64ae('0xac')]['id']}},_0x3dee04={};_0x3dee04[_0x64ae('0x3a')]=_[_0x64ae('0x38')](db[_0x64ae('0x32')][_0x64ae('0x33')]);_0x3dee04[_0x64ae('0x37')]=_[_0x64ae('0x38')](_0x453841[_0x64ae('0x37')]);_0x3dee04[_0x64ae('0x40')]=_['intersection'](_0x3dee04[_0x64ae('0x3a')],_0x3dee04['query']);_0x2f2792[_0x64ae('0x3b')]=_[_0x64ae('0x39')](_0x3dee04[_0x64ae('0x3a')],qs[_0x64ae('0x3c')](_0x453841[_0x64ae('0x37')][_0x64ae('0x3c')]));_0x2f2792[_0x64ae('0x3b')]=_0x2f2792[_0x64ae('0x3b')][_0x64ae('0x59')]?_0x2f2792[_0x64ae('0x3b')]:_0x3dee04[_0x64ae('0x3a')];if(_0x453841[_0x64ae('0x37')]['includeAll']){_0x2f2792[_0x64ae('0xad')]=[{'all':!![]}];}_0x2f2792=_[_0x64ae('0x91')]({},_0x2f2792,_0x453841[_0x64ae('0xae')]);return db['FaxInteraction'][_0x64ae('0x64')](_0x2f2792)[_0x64ae('0x30')](handleEntityNotFound(_0x43e72c,null))[_0x64ae('0x30')](respondWithResult(_0x43e72c,null))[_0x64ae('0x31')](handleError(_0x43e72c,null));};exports['create']=function(_0x3a3262,_0x29feb0){return db[_0x64ae('0x32')]['create'](_0x3a3262[_0x64ae('0x6b')],{})[_0x64ae('0x30')](respondWithResult(_0x29feb0,0xc9))[_0x64ae('0x31')](handleError(_0x29feb0,null));};exports[_0x64ae('0x24')]=function(_0x3f8fa2,_0xf42701){if(_0x3f8fa2['body']['id']){delete _0x3f8fa2[_0x64ae('0x6b')]['id'];}return db[_0x64ae('0x32')][_0x64ae('0x64')]({'where':{'id':_0x3f8fa2[_0x64ae('0xac')]['id']}})[_0x64ae('0x30')](handleEntityNotFound(_0xf42701,null))[_0x64ae('0x30')](saveUpdates(_0x3f8fa2['body'],null))[_0x64ae('0x30')](respondWithResult(_0xf42701,null))[_0x64ae('0x31')](handleError(_0xf42701,null));};exports[_0x64ae('0x25')]=function(_0x240aee,_0x262119){return db[_0x64ae('0x32')][_0x64ae('0x64')]({'where':{'id':_0x240aee['params']['id']}})[_0x64ae('0x30')](handleEntityNotFound(_0x262119,null))['then'](removeEntity(_0x262119,null))['catch'](handleError(_0x262119,null));};exports[_0x64ae('0xaf')]=function(_0x4feff6,_0x17d293){return db['FaxInteraction']['describe']()[_0x64ae('0x30')](respondWithResult(_0x17d293,null))[_0x64ae('0x31')](handleError(_0x17d293,null));};exports[_0x64ae('0xb0')]=function(_0x24d040,_0x358f05,_0xc84213){return db[_0x64ae('0xb1')][_0x64ae('0x64')]({'where':{'id':_0x24d040[_0x64ae('0xac')]['id']}})[_0x64ae('0x30')](handleEntityNotFound(_0x358f05,null))[_0x64ae('0x30')](function(_0x262b3d){if(_0x262b3d){return _0x262b3d['addMessage'](_0x24d040['body']['ids'],_[_0x64ae('0xb2')](_0x24d040[_0x64ae('0x6b')],['ids','id'])||{});}})[_0x64ae('0x30')](respondWithResult(_0x358f05,null))[_0x64ae('0x31')](handleError(_0x358f05,null));};exports[_0x64ae('0xb3')]=function(_0x82c9e6,_0xf9acd6,_0x78723d){var _0x15c517={'raw':![],'where':{}};var _0x181b65={};var _0x1c17e0={'count':0x0,'rows':[]};return db[_0x64ae('0x32')][_0x64ae('0xb4')]({'where':{'id':_0x82c9e6[_0x64ae('0xac')]['id']}})['then'](handleEntityNotFound(_0xf9acd6,null))['then'](function(_0x52f2a6){if(_0x52f2a6){_0x181b65[_0x64ae('0x3a')]=_[_0x64ae('0x38')](db['FaxMessage'][_0x64ae('0x33')]);_0x181b65[_0x64ae('0x37')]=_['keys'](_0x82c9e6[_0x64ae('0x37')]);_0x181b65[_0x64ae('0x40')]=_[_0x64ae('0x39')](_0x181b65['model'],_0x181b65['query']);_0x15c517[_0x64ae('0x3b')]=_[_0x64ae('0x39')](_0x181b65['model'],qs[_0x64ae('0x3c')](_0x82c9e6['query']['fields']));_0x15c517[_0x64ae('0x3b')]=_0x15c517[_0x64ae('0x3b')][_0x64ae('0x59')]?_0x15c517[_0x64ae('0x3b')]:_0x181b65[_0x64ae('0x3a')];if(!_0x82c9e6[_0x64ae('0x37')][_0x64ae('0x3d')]('nolimit')){_0x15c517[_0x64ae('0x1e')]=qs['limit'](_0x82c9e6[_0x64ae('0x37')]['limit']);_0x15c517[_0x64ae('0x20')]=qs[_0x64ae('0x20')](_0x82c9e6[_0x64ae('0x37')][_0x64ae('0x20')]);}_0x15c517[_0x64ae('0x84')]=qs['sort'](_0x82c9e6[_0x64ae('0x37')]['sort']);_0x15c517[_0x64ae('0x70')]=qs[_0x64ae('0x40')](_[_0x64ae('0x41')](_0x82c9e6['query'],_0x181b65['filters']));_0x15c517[_0x64ae('0x70')]['FaxInteractionId']=_0x52f2a6['id'];if(_0x82c9e6['query']['filter']){_0x15c517['where']=_[_0x64ae('0x91')](_0x15c517[_0x64ae('0x70')],{'$or':_['map'](_0x15c517[_0x64ae('0x3b')],function(_0x3afd6c){var _0x1ca017={};_0x1ca017[_0x3afd6c]={'$like':'%'+_0x82c9e6[_0x64ae('0x37')][_0x64ae('0x7c')]+'%'};return _0x1ca017;})});}if(_0x82c9e6[_0x64ae('0x37')]['$gte']){var _0x5135cb=_0x82c9e6['query']['$gte'][_0x64ae('0x2e')](',');var _0x3a5561={};_0x3a5561[_0x5135cb[0x0]]={'$gte':moment(_0x5135cb[0x1])['format'](_0x64ae('0xb5'))};_0x15c517['where']=_['merge'](_0x15c517['where'],_0x3a5561);}_0x15c517=_[_0x64ae('0x91')]({},_0x15c517,_0x82c9e6[_0x64ae('0xae')]);return db[_0x64ae('0xb1')]['count']({'where':_0x15c517[_0x64ae('0x70')]})[_0x64ae('0x30')](function(_0x1568dc){_0x1c17e0[_0x64ae('0x1f')]=_0x1568dc;if(_0x82c9e6[_0x64ae('0x37')][_0x64ae('0xb6')]){_0x15c517[_0x64ae('0xad')]=[{'all':!![]}];}return db[_0x64ae('0xb1')][_0x64ae('0xb7')](_0x15c517);})[_0x64ae('0x30')](function(_0x4e43a1){_0x1c17e0['rows']=_0x4e43a1;return _0x1c17e0;});}})[_0x64ae('0x30')](respondWithFilteredResult(_0xf9acd6,_0x15c517))[_0x64ae('0x31')](handleError(_0xf9acd6,null));};exports[_0x64ae('0xb8')]=function(_0x34d31d,_0x2fc955,_0x1f8613){return db['FaxInteraction']['find']({'where':{'id':_0x34d31d[_0x64ae('0xac')]['id']}})[_0x64ae('0x30')](handleEntityNotFound(_0x2fc955,null))[_0x64ae('0x30')](function(_0xb4162d){if(_0xb4162d){return _0xb4162d[_0x64ae('0xb9')](_0x34d31d[_0x64ae('0x6b')][_0x64ae('0xba')],_[_0x64ae('0xb2')](_0x34d31d[_0x64ae('0x6b')],[_0x64ae('0xba'),'id'])||{})['spread'](function(){return db[_0x64ae('0xbb')][_0x64ae('0xb7')]({'attributes':['id','name',_0x64ae('0xbc')],'where':{'id':_0x34d31d[_0x64ae('0x6b')][_0x64ae('0xba')]}});})['then'](function(_0x1e0672){socket['emit'](_0x64ae('0xbd'),{'id':Number(_0x34d31d[_0x64ae('0xac')]['id']),'tags':_0x1e0672||[]});return{'id':Number(_0x34d31d['params']['id']),'tags':_0x1e0672||[]};});}})[_0x64ae('0x30')](respondWithResult(_0x2fc955,null))[_0x64ae('0x31')](handleError(_0x2fc955,null));};exports[_0x64ae('0xbe')]=function(_0x3a577e,_0x153acd,_0x5f3c30){return db[_0x64ae('0x32')]['find']({'where':{'id':_0x3a577e['params']['id']}})[_0x64ae('0x30')](handleEntityNotFound(_0x153acd,null))[_0x64ae('0x30')](function(_0x23d9e2){if(_0x23d9e2){return _0x23d9e2[_0x64ae('0xbe')](_0x3a577e[_0x64ae('0x37')][_0x64ae('0xba')]);}})[_0x64ae('0x30')](respondWithStatusCode(_0x153acd,null))[_0x64ae('0x31')](handleError(_0x153acd,null));};exports['download']=function(_0x433175,_0x5a71e6){var _0x48d654=moment()['unix']()[_0x64ae('0x8f')]();var _0x5556f8=path[_0x64ae('0xbf')](config['root'],_0x64ae('0xc0'),_0x64ae('0xc1'),_0x64ae('0xc2'));var _0x5ce687=path[_0x64ae('0xbf')](config[_0x64ae('0xc3')],'server',_0x64ae('0xc1'),_0x64ae('0xc4'));var _0x381c0e=path[_0x64ae('0xbf')](_0x5556f8,_0x48d654);var _0xe8e438=util['format'](_0x64ae('0xc5'),_0x433175[_0x64ae('0xac')]['id'],_0x48d654);var _0x38eb2b=path['join'](_0x5556f8,_0xe8e438);var _0x9ae352=[];_0x9ae352['push']({'model':db['Attachment'],'as':'Attachment','raw':!![]});var _0x3ae475=[{'model':db[_0x64ae('0xb1')],'as':_0x64ae('0xc6'),'attributes':['id',_0x64ae('0x6b'),'createdAt'],'include':_0x9ae352}];return db[_0x64ae('0x32')]['find']({'where':{'id':_0x433175[_0x64ae('0xac')]['id']},'include':_0x3ae475})[_0x64ae('0x30')](handleEntityNotFound(_0x5a71e6,null))[_0x64ae('0x30')](function(_0x2e3d16){if(_0x2e3d16&&_0x2e3d16[_0x64ae('0xc6')]){var _0x2a933=_0x2e3d16[_0x64ae('0xc7')]({'plain':!![]});fs[_0x64ae('0xc8')](_0x381c0e);for(var _0x5d87b2=0x0;_0x5d87b2<_0x2a933['Messages'][_0x64ae('0x59')];_0x5d87b2++){var _0x12bce5=_0x2a933['Messages'][_0x5d87b2][_0x64ae('0xc9')];if(_0x12bce5){var _0x1257e0=path['join'](_0x5ce687,_0x12bce5[_0x64ae('0xca')]);if(fs[_0x64ae('0xcb')](_0x1257e0)){fs['createReadStream'](_0x1257e0)['pipe'](fs[_0x64ae('0xcc')](path[_0x64ae('0xbf')](_0x381c0e,_0x12bce5[_0x64ae('0xca')])));}}}return BPromise[_0x64ae('0x88')]()['then'](function(){return new BPromise(function(_0xf4c60b,_0x26b304){zipdir(_0x381c0e,{'saveTo':_0x38eb2b},function(_0x5f1241,_0x32f6be){if(_0x5f1241)return _0x26b304(_0x5f1241);return _0xf4c60b(_0x32f6be);});})[_0x64ae('0x30')](function(){return new BPromise(function(_0x20ccbd,_0x2ba311){rimraf(_0x381c0e,function(_0x8ac296){if(_0x8ac296)_0x2ba311(_0x8ac296);return _0x20ccbd();});});})[_0x64ae('0x30')](function(){return _0x5a71e6[_0x64ae('0xcd')](_0x38eb2b,_0xe8e438,function(_0x37a2c5){if(_0x37a2c5){console[_0x64ae('0xce')](_0x64ae('0xcf'),_0x37a2c5);}else{fs[_0x64ae('0xd0')](_0x38eb2b);}});});});}else{return _0x5a71e6[_0x64ae('0x26')](0xc8);}})[_0x64ae('0x31')](handleError(_0x5a71e6,null));}; \ No newline at end of file +var _0xd462=['format','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags','ids','emit','faxInteractionTags:save','removeTags','unix','join','root','files','tmp','server','attachments','transcript-%d-%s.zip','Attachment','Messages','get','mkdirSync','basename','existsSync','createReadStream','pipe','err','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./faxInteraction.socket','sendStatus','status','end','offset','undefined','count','set','json','apply','reject','update','then','error','stack','name','send','TagIds','Tags','split','forEach','push','catch','index','map','FaxInteraction','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','select','field','color','from','tools_tags','u.id','u.fullname','user_has_fax_interactions','fax_interactions','cm_contacts','users','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id','left_join','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','type','text','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','operator','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','buildExpression','body','start','some','compact','isEmpty','FaxAccountId','concat','createdAt','parse','$gte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.fax\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','SELECT','clone','order','contactName','t.id\x20IN\x20?','resolve','i.FaxAccountId\x20IS\x20NOT\x20NULL','agent','getFaxAccounts','i.FaxAccountId\x20IS\x20NULL','i.FaxAccountId\x20IN\x20?','user','toString','sequelize','keyBy','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.FaxInteractionId\x20IN\x20?','groupBy','FaxInteractionId','show','includeAll','include','options','create','params','describe','addMessage','FaxMessage','omit','getMessages','findOne'];(function(_0x3740fe,_0x6c543c){var _0x55492b=function(_0x1f851f){while(--_0x1f851f){_0x3740fe['push'](_0x3740fe['shift']());}};_0x55492b(++_0x6c543c);}(_0xd462,0x1c2));var _0x2d46=function(_0x58965a,_0x2e71db){_0x58965a=_0x58965a-0x0;var _0x254efc=_0xd462[_0x58965a];return _0x254efc;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2d46('0x0'));var zipdir=require(_0x2d46('0x1'));var jsonpatch=require(_0x2d46('0x2'));var rp=require(_0x2d46('0x3'));var moment=require(_0x2d46('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2d46('0x5'));var util=require(_0x2d46('0x6'));var path=require(_0x2d46('0x7'));var sox=require(_0x2d46('0x8'));var csv=require(_0x2d46('0x9'));var ejs=require(_0x2d46('0xa'));var fs=require('fs');var fs_extra=require(_0x2d46('0xb'));var _=require(_0x2d46('0xc'));var squel=require(_0x2d46('0xd'));var crypto=require(_0x2d46('0xe'));var jsforce=require(_0x2d46('0xf'));var deskjs=require(_0x2d46('0x10'));var toCsv=require(_0x2d46('0x9'));var querystring=require(_0x2d46('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x2d46('0x12'));var qs=require(_0x2d46('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2d46('0x14'));var logger=require(_0x2d46('0x15'))(_0x2d46('0x16'));var utils=require(_0x2d46('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x2d46('0x18'));var db=require(_0x2d46('0x19'))['db'];config[_0x2d46('0x1a')]=_[_0x2d46('0x1b')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x2d46('0x1c'))(new Redis(config['redis']));require(_0x2d46('0x1d'))['register'](socket);function respondWithStatusCode(_0x20d3a9,_0x2a2726){_0x2a2726=_0x2a2726||0xcc;return function(_0x4f0619){if(_0x4f0619){return _0x20d3a9[_0x2d46('0x1e')](_0x2a2726);}return _0x20d3a9[_0x2d46('0x1f')](_0x2a2726)[_0x2d46('0x20')]();};}function respondWithResult(_0x213a88,_0x541b65){_0x541b65=_0x541b65||0xc8;return function(_0xba6d83){if(_0xba6d83){return _0x213a88[_0x2d46('0x1f')](_0x541b65)['json'](_0xba6d83);}};}function respondWithFilteredResult(_0x5eb4d7,_0x4e7e16){return function(_0x12b348){if(_0x12b348){var _0x5e8708=typeof _0x4e7e16[_0x2d46('0x21')]==='undefined'&&typeof _0x4e7e16['limit']===_0x2d46('0x22');var _0x58ee80=_0x12b348[_0x2d46('0x23')];var _0x1a9bbb=_0x5e8708?0x0:_0x4e7e16[_0x2d46('0x21')];var _0x5876f4=_0x5e8708?_0x12b348[_0x2d46('0x23')]:_0x4e7e16[_0x2d46('0x21')]+_0x4e7e16['limit'];var _0x23a448;if(_0x5876f4>=_0x58ee80){_0x5876f4=_0x58ee80;_0x23a448=0xc8;}else{_0x23a448=0xce;}_0x5eb4d7[_0x2d46('0x1f')](_0x23a448);return _0x5eb4d7[_0x2d46('0x24')]('Content-Range',_0x1a9bbb+'-'+_0x5876f4+'/'+_0x58ee80)[_0x2d46('0x25')](_0x12b348);}return null;};}function patchUpdates(_0x28c63d){return function(_0x3e833f){try{jsonpatch[_0x2d46('0x26')](_0x3e833f,_0x28c63d,!![]);}catch(_0x5f0aa3){return BPromise[_0x2d46('0x27')](_0x5f0aa3);}return _0x3e833f['save']();};}function saveUpdates(_0x4ae652,_0x11a628){return function(_0x20d078){if(_0x20d078){return _0x20d078[_0x2d46('0x28')](_0x4ae652)[_0x2d46('0x29')](function(_0x1ffe68){return _0x1ffe68;});}return null;};}function removeEntity(_0x2c5f90,_0x446853){return function(_0x3b783a){if(_0x3b783a){return _0x3b783a['destroy']()[_0x2d46('0x29')](function(){_0x2c5f90[_0x2d46('0x1f')](0xcc)[_0x2d46('0x20')]();});}};}function handleEntityNotFound(_0x145ea9,_0x367c1e){return function(_0x51f3e6){if(!_0x51f3e6){_0x145ea9['sendStatus'](0x194);}return _0x51f3e6;};}function handleError(_0x4a44fc,_0x52122){_0x52122=_0x52122||0x1f4;return function(_0x45317d){logger[_0x2d46('0x2a')](_0x45317d[_0x2d46('0x2b')]);if(_0x45317d['name']){delete _0x45317d[_0x2d46('0x2c')];}_0x4a44fc[_0x2d46('0x1f')](_0x52122)[_0x2d46('0x2d')](_0x45317d);};}function getInteractionUsers(_0x59b470,_0x25e00b){return new BPromise(function(_0x434e8d,_0x1305a7){try{if(_0x25e00b[_0x59b470['id']]){_0x59b470['Users']=_['map'](_0x25e00b[_0x59b470['id']],function(_0x319f28){return{'id':_0x319f28['id'],'fullname':_0x319f28['fullname']};});}}catch(_0x50f499){_0x1305a7(_0x50f499);}_0x434e8d(_0x59b470);});}function getInteractionTags(_0x4e7327,_0x591ab6){return new BPromise(function(_0x195a55,_0x2ea7b1){try{if(_0x4e7327[_0x2d46('0x2e')]){_0x4e7327[_0x2d46('0x2f')]=[];_0x4e7327[_0x2d46('0x2e')][_0x2d46('0x30')](',')[_0x2d46('0x31')](function(_0xdebd77){_0x4e7327[_0x2d46('0x2f')][_0x2d46('0x32')](_0x591ab6[_0xdebd77]);});}delete _0x4e7327['TagIds'];}catch(_0x2ab9d2){_0x2ea7b1(_0x2ab9d2);}_0x195a55(_0x4e7327);});}function updateFaxInteraction(_0x40fc88,_0x3bc410,_0x582702){return new BPromise(function(_0x2b8970,_0x5c7b4c){return getInteractionUsers(_0x40fc88,_0x582702)[_0x2d46('0x29')](function(_0x137cad){return getInteractionTags(_0x137cad,_0x3bc410);})[_0x2d46('0x29')](function(_0x2abdd9){_0x2b8970(_0x2abdd9);})[_0x2d46('0x33')](function(_0x33d0ca){_0x5c7b4c(_0x33d0ca);});});}exports[_0x2d46('0x34')]=function(_0x2b02c4,_0x5e758d){var _0x57603f={},_0x4d0804={},_0x594345={'count':0x0,'rows':[]};var _0x5c7788=_[_0x2d46('0x35')](db[_0x2d46('0x36')][_0x2d46('0x37')],function(_0x149610){return{'name':_0x149610['fieldName'],'type':_0x149610['type']['key']};});_0x4d0804[_0x2d46('0x38')]=_[_0x2d46('0x35')](_0x5c7788,_0x2d46('0x2c'));_0x4d0804[_0x2d46('0x39')]=_[_0x2d46('0x3a')](_0x2b02c4[_0x2d46('0x39')]);_0x4d0804[_0x2d46('0x3b')]=_[_0x2d46('0x3c')](_0x4d0804[_0x2d46('0x38')],_0x4d0804[_0x2d46('0x39')]);_0x57603f[_0x2d46('0x3d')]=_[_0x2d46('0x3c')](_0x4d0804['model'],qs[_0x2d46('0x3e')](_0x2b02c4['query']['fields']));_0x57603f[_0x2d46('0x3d')]=_0x57603f['attributes'][_0x2d46('0x3f')]?_0x57603f['attributes']:_0x4d0804[_0x2d46('0x38')];if(!_0x2b02c4[_0x2d46('0x39')][_0x2d46('0x40')](_0x2d46('0x41'))){_0x57603f[_0x2d46('0x42')]=qs['limit'](_0x2b02c4[_0x2d46('0x39')][_0x2d46('0x42')]);_0x57603f[_0x2d46('0x21')]=qs[_0x2d46('0x21')](_0x2b02c4[_0x2d46('0x39')][_0x2d46('0x21')]);}_0x57603f['order']=qs[_0x2d46('0x43')](_0x2b02c4[_0x2d46('0x39')][_0x2d46('0x43')]);_0x57603f[_0x2d46('0x44')]=qs['filters'](_[_0x2d46('0x45')](_0x2b02c4[_0x2d46('0x39')],_0x4d0804[_0x2d46('0x3b')]),_0x5c7788);var _0x102853=[];var _0x21ec17=squel[_0x2d46('0x46')]()[_0x2d46('0x47')]('id')['field']('name')[_0x2d46('0x47')](_0x2d46('0x48'))[_0x2d46('0x49')](_0x2d46('0x4a'));var _0x2e4f96=squel[_0x2d46('0x46')]()[_0x2d46('0x47')](_0x2d46('0x4b'))[_0x2d46('0x47')](_0x2d46('0x4c'))[_0x2d46('0x47')]('ui.FaxInteractionId')[_0x2d46('0x49')](_0x2d46('0x4d'),'ui')['left_join']('users','u','u.id\x20=\x20ui.UserId');var _0x2624c3=squel[_0x2d46('0x46')]()[_0x2d46('0x49')](_0x2d46('0x4e'),'i')['left_join'](_0x2d46('0x4f'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join'](_0x2d46('0x50'),'o','o.id\x20=\x20i.UserId')['left_join']('fax_accounts','a','a.id\x20=\x20i.FaxAccountId')['left_join']('fax_messages','me','me.FaxInteractionId\x20=\x20i.id')['left_join'](_0x2d46('0x51'),'it',_0x2d46('0x52'))[_0x2d46('0x53')](_0x2d46('0x4a'),'t','t.id\x20=\x20it.TagId');var _0x4f9d67=squel[_0x2d46('0x54')]();var _0x109e9b=[];var _0x465cdf=squel['expr']();var _0x4446a0;if(_0x2b02c4['query'][_0x2d46('0x55')]){_0x4446a0=as[_0x2d46('0x56')](_0x2b02c4['query'][_0x2d46('0x55')]);var _0x70a71f=_0x4446a0[_0x2d46('0x57')];for(var _0x1b1034=0x0;_0x1b1034<_0x4446a0[_0x2d46('0x58')]['length'];_0x1b1034++){var _0x56f828=_0x4446a0['conditions'][_0x1b1034];var _0x1d16cd='i';var _0x3cb1d9=_[_0x2d46('0x59')](_0x5c7788,['name',_0x56f828[_0x2d46('0x47')]]);if(!_0x3cb1d9){switch(_0x56f828[_0x2d46('0x47')]){case _0x2d46('0x5a'):if(_0x56f828[_0x2d46('0x5b')]==0x1){_0x2624c3[_0x2d46('0x5c')]('`'+_0x56f828[_0x2d46('0x47')]+_0x2d46('0x5d'));}else{_0x2624c3[_0x2d46('0x5c')]('`'+_0x56f828[_0x2d46('0x47')]+_0x2d46('0x5e'));}break;case _0x2d46('0x5f'):if(_0x56f828['operator']==='$substring'){if(_0x56f828[_0x2d46('0x5b')][_0x2d46('0x30')]('\x20')[_0x2d46('0x3f')]>0x1){_0x4f9d67[_0x70a71f]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x56f828[_0x2d46('0x5b')]),null);}else{var _0x1acb5c='%'+_0x56f828[_0x2d46('0x5b')]+'%';_0x4f9d67[_0x70a71f](_0x2d46('0x60'),_0x1acb5c,_0x1acb5c,_0x1acb5c);}}else{_0x3cb1d9=_[_0x2d46('0x59')](_0x5c7788,[_0x2d46('0x2c'),_0x2d46('0x61')]);_0x56f828[_0x2d46('0x47')]=_0x2d46('0x61');_0x4c9811=as['buildExpression'](_0x1d16cd,_0x3cb1d9[_0x2d46('0x62')],_0x56f828);_0x4f9d67[_0x70a71f](_0x4c9811[_0x2d46('0x63')],_0x4c9811[_0x2d46('0x5b')]['start'],_0x4c9811['value'][_0x2d46('0x20')]);}break;case _0x2d46('0x64'):var _0x270d87=_0x56f828[_0x2d46('0x5b')][_0x2d46('0x30')](',')[_0x2d46('0x35')](function(_0x1fa5e6){return Number(_0x1fa5e6);});_0x270d87[_0x2d46('0x31')](function(_0x5c396e){_0x465cdf['or'](_0x2d46('0x65'),'%,'+_0x5c396e+',%');});_0x109e9b=_[_0x2d46('0x66')](_0x109e9b,_0x270d87);break;case _0x2d46('0x67'):if(_0x56f828[_0x2d46('0x68')]===_0x2d46('0x69')){_0x4f9d67[_0x70a71f](_0x2d46('0x6a'),'%'+_0x56f828['value']+'%',null);}else{_0x3cb1d9=_[_0x2d46('0x59')](_0x5c7788,['name',_0x2d46('0x6b')]);_0x56f828[_0x2d46('0x47')]=_0x2d46('0x6b');_0x4c9811=as[_0x2d46('0x6c')](_0x1d16cd,_0x3cb1d9[_0x2d46('0x62')],_0x56f828);_0x4f9d67[_0x70a71f](_0x4c9811[_0x2d46('0x63')],_0x4c9811[_0x2d46('0x5b')]['start'],_0x4c9811[_0x2d46('0x5b')][_0x2d46('0x20')]);}break;case _0x2d46('0x6d'):_0x4c9811=as['buildExpression']('me',null,_0x56f828);_0x4f9d67[_0x70a71f](_0x4c9811[_0x2d46('0x63')],_0x4c9811[_0x2d46('0x5b')][_0x2d46('0x6e')],_0x4c9811[_0x2d46('0x5b')][_0x2d46('0x20')]);break;}}else{var _0x4c9811=as[_0x2d46('0x6c')](_0x1d16cd,_0x3cb1d9[_0x2d46('0x62')],_0x56f828);_0x4f9d67[_0x70a71f](_0x4c9811[_0x2d46('0x63')],_0x4c9811['value'][_0x2d46('0x6e')],_0x4c9811[_0x2d46('0x5b')][_0x2d46('0x20')]);}}}else{var _0x82a96=_(_0x2b02c4[_0x2d46('0x39')])['keys']()['map'](function(_0x409d71){return _[_0x2d46('0x6f')](_0x5c7788,[_0x2d46('0x2c'),_0x409d71])?_0x409d71:undefined;})[_0x2d46('0x70')]()[_0x2d46('0x5b')]();if(!_[_0x2d46('0x71')](_0x82a96)){_0x82a96['forEach'](function(_0x248f1b){if(_0x248f1b===_0x2d46('0x72')){_0x2624c3[_0x2d46('0x44')]('i.FaxAccountId\x20IN\x20?',[][_0x2d46('0x73')](_0x2b02c4['query'][_0x248f1b]));}else if(_0x248f1b===_0x2d46('0x74')){var _0x17a302=JSON[_0x2d46('0x75')](_0x2b02c4[_0x2d46('0x39')][_0x248f1b])[_0x2d46('0x76')];var _0x20ee91=JSON[_0x2d46('0x75')](_0x2b02c4['query'][_0x248f1b])['$lte'];_0x2624c3['where'](_0x2d46('0x77'),_0x17a302,_0x20ee91);}else{if(_0x2b02c4[_0x2d46('0x39')][_0x248f1b]===_0x2d46('0x78')){_0x2624c3['where']('i.'+_0x248f1b+_0x2d46('0x79'));}else{_0x2624c3[_0x2d46('0x44')]('i.'+_0x248f1b+'\x20=\x20?',_0x2b02c4['query'][_0x248f1b]);}}});}if(_0x2b02c4[_0x2d46('0x39')][_0x2d46('0x7a')]){if(_0x2b02c4[_0x2d46('0x39')][_0x2d46('0x7a')]==0x1){_0x2624c3[_0x2d46('0x5c')](_0x2d46('0x7b'));}else{_0x2624c3['having']('`unreadMessages`\x20>\x200');}}if(_0x2b02c4[_0x2d46('0x39')]['tag']){_0x109e9b=_['isArray'](_0x2b02c4['query']['tag'])?_0x2b02c4['query'][_0x2d46('0x7c')]:new Array(_0x2b02c4[_0x2d46('0x39')][_0x2d46('0x7c')]);_0x109e9b[_0x2d46('0x31')](function(_0x325058){_0x465cdf['or'](_0x2d46('0x65'),'%,'+_0x325058+',%');});}if(_0x2b02c4[_0x2d46('0x39')]['filter']){var _0x3480de=_0x2b02c4[_0x2d46('0x39')][_0x2d46('0x7d')][_0x2d46('0x7e')]('\x5c','\x5c\x5c')[_0x2d46('0x7e')](/'/g,'\x27\x27');if(qs[_0x2d46('0x7f')](_0x3480de)){_0x4f9d67['or'](_0x2d46('0x80'),_0x3480de+'%')['or'](_0x2d46('0x81'),_0x3480de+'%');}_0x4f9d67['or'](_0x2d46('0x82'),_0x3480de+'%');}}_0x2624c3[_0x2d46('0x44')](_0x4f9d67);_0x2624c3[_0x2d46('0x83')](_0x2d46('0x84'));var _0x47de21={'type':db[_0x2d46('0x85')]['QueryTypes'][_0x2d46('0x86')],'raw':!![]};var _0x52e185=_0x2624c3[_0x2d46('0x87')]();_0x52e185[_0x2d46('0x47')](_0x2d46('0x84'));_0x52e185[_0x2d46('0x47')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x2d46('0x5a'));if(_0x57603f[_0x2d46('0x88')]){_0x57603f[_0x2d46('0x88')][_0x2d46('0x31')](function(_0xe8a170){var _0x5aeca7=_0xe8a170[0x0]===_0x2d46('0x89')?_0xe8a170[0x0]:'i.'+_0xe8a170[0x0];_0x2624c3[_0x2d46('0x88')](_0x5aeca7,_0xe8a170[0x1]==='DESC'?![]:!![]);});}if(!_[_0x2d46('0x71')](_0x109e9b)){_0x2624c3['having'](_0x465cdf);_0x52e185['where'](_0x2d46('0x8a'),_0x109e9b);}BPromise[_0x2d46('0x8b')]()[_0x2d46('0x29')](function(){if(!_0x4446a0){if(_0x2b02c4[_0x2d46('0x39')]['FaxAccountId'])return;_0x52e185[_0x2d46('0x44')](_0x2d46('0x8c'));_0x2624c3[_0x2d46('0x44')]('i.FaxAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x2b02c4['user']['role']!==_0x2d46('0x8d'))return;return _0x2b02c4['user'][_0x2d46('0x8e')]({'attributes':['id'],'raw':!![]})[_0x2d46('0x29')](function(_0xe461c2){if(_[_0x2d46('0x71')](_0xe461c2)){_0x52e185[_0x2d46('0x44')](_0x2d46('0x8f'));_0x2624c3[_0x2d46('0x44')](_0x2d46('0x8f'));}else{_0x52e185['where'](_0x2d46('0x90'),_['map'](_0xe461c2,'id'));_0x2624c3['where']('i.FaxAccountId\x20IN\x20?',_[_0x2d46('0x35')](_0xe461c2,'id'));}});})[_0x2d46('0x29')](function(){if(_0x2b02c4[_0x2d46('0x91')]['role']===_0x2d46('0x8d')&&!_0x4446a0&&!_0x2b02c4[_0x2d46('0x39')][_0x2d46('0x72')])return[];return db['sequelize']['query'](_0x52e185[_0x2d46('0x92')](),_0x47de21);})['then'](function(_0x3c8cbb){_0x594345['count']=_0x3c8cbb[_0x2d46('0x3f')];if(_0x594345[_0x2d46('0x23')]===0x0)return[];return db[_0x2d46('0x93')][_0x2d46('0x39')](_0x21ec17[_0x2d46('0x92')](),_0x47de21)[_0x2d46('0x29')](function(_0x89b9ad){_0x102853=_[_0x2d46('0x94')](_0x89b9ad,'id');_0x47de21=_[_0x2d46('0x95')](_0x47de21,{'model':db['FaxInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2b02c4['query'][_0x2d46('0x3e')]){_0x57603f[_0x2d46('0x3d')][_0x2d46('0x31')](function(_0x38fa58){_0x2624c3[_0x2d46('0x47')]('i.'+_0x38fa58);});}else{_0x2624c3[_0x2d46('0x47')](_0x2d46('0x96'),_0x2d46('0x5a'));_0x2624c3['field']('a.key',_0x2d46('0x97'));_0x2624c3['field'](_0x2d46('0x98'),_0x2d46('0x99'));_0x2624c3[_0x2d46('0x47')](_0x2d46('0x9a'),'contactName');_0x2624c3[_0x2d46('0x47')](_0x2d46('0x9b'));_0x2624c3['field'](_0x2d46('0x9c'),_0x2d46('0x9d'));_0x2624c3[_0x2d46('0x47')]('c.lastName',_0x2d46('0x9e'));_0x2624c3['field'](_0x2d46('0x9f'),_0x2d46('0xa0'));_0x2624c3[_0x2d46('0x47')](_0x2d46('0xa1'),_0x2d46('0xa2'));_0x2624c3[_0x2d46('0x47')](_0x2d46('0xa3'),_0x2d46('0xa4'));_0x2624c3[_0x2d46('0x47')](_0x2d46('0xa5'),_0x2d46('0xa6'));_0x2624c3['field']('o.fullname',_0x2d46('0xa7'));_0x2624c3[_0x2d46('0x47')](_0x2d46('0xa8'),_0x2d46('0xa9'));_0x2624c3[_0x2d46('0x47')](_0x2d46('0xaa'),_0x2d46('0x2e'));}if(_0x57603f['limit'])_0x2624c3['limit'](_0x57603f[_0x2d46('0x42')]);if(_0x57603f[_0x2d46('0x21')])_0x2624c3[_0x2d46('0x21')](_0x57603f[_0x2d46('0x21')]);return db[_0x2d46('0x93')][_0x2d46('0x39')](_0x2624c3['toString'](),_0x47de21);})[_0x2d46('0x29')](function(_0x2d5780){if(_0x2d5780[_0x2d46('0x3f')]>0x0)_0x2e4f96[_0x2d46('0x44')](_0x2d46('0xab'),_['map'](_0x2d5780,'id'));return db[_0x2d46('0x93')][_0x2d46('0x39')](_0x2e4f96['toString'](),_0x47de21)[_0x2d46('0x29')](function(_0x3a9bb4){var _0xb8e930=_[_0x2d46('0xac')](_0x3a9bb4,_0x2d46('0xad'));var _0x446ef8=[];_0x2d5780[_0x2d46('0x31')](function(_0x1d1512){_0x446ef8['push'](updateFaxInteraction(_0x1d1512,_0x102853,_0xb8e930));});return BPromise['all'](_0x446ef8);});});})[_0x2d46('0x29')](function(_0x2bc969){_0x594345['rows']=_0x2bc969;return _0x594345;})[_0x2d46('0x29')](respondWithFilteredResult(_0x5e758d,_0x57603f))[_0x2d46('0x33')](handleError(_0x5e758d,null));};exports[_0x2d46('0xae')]=function(_0x2b7254,_0x8aec0b){var _0x28b5ea={'raw':![],'where':{'id':_0x2b7254['params']['id']}},_0x244dbc={};_0x244dbc[_0x2d46('0x38')]=_['keys'](db[_0x2d46('0x36')]['rawAttributes']);_0x244dbc['query']=_[_0x2d46('0x3a')](_0x2b7254['query']);_0x244dbc['filters']=_[_0x2d46('0x3c')](_0x244dbc[_0x2d46('0x38')],_0x244dbc[_0x2d46('0x39')]);_0x28b5ea[_0x2d46('0x3d')]=_[_0x2d46('0x3c')](_0x244dbc['model'],qs[_0x2d46('0x3e')](_0x2b7254[_0x2d46('0x39')]['fields']));_0x28b5ea[_0x2d46('0x3d')]=_0x28b5ea[_0x2d46('0x3d')][_0x2d46('0x3f')]?_0x28b5ea[_0x2d46('0x3d')]:_0x244dbc[_0x2d46('0x38')];if(_0x2b7254[_0x2d46('0x39')][_0x2d46('0xaf')]){_0x28b5ea[_0x2d46('0xb0')]=[{'all':!![]}];}_0x28b5ea=_['merge']({},_0x28b5ea,_0x2b7254[_0x2d46('0xb1')]);return db[_0x2d46('0x36')]['find'](_0x28b5ea)[_0x2d46('0x29')](handleEntityNotFound(_0x8aec0b,null))[_0x2d46('0x29')](respondWithResult(_0x8aec0b,null))[_0x2d46('0x33')](handleError(_0x8aec0b,null));};exports[_0x2d46('0xb2')]=function(_0x5a02c4,_0x407188){return db[_0x2d46('0x36')][_0x2d46('0xb2')](_0x5a02c4[_0x2d46('0x6d')],{})['then'](respondWithResult(_0x407188,0xc9))[_0x2d46('0x33')](handleError(_0x407188,null));};exports['update']=function(_0x227af5,_0x434640){if(_0x227af5[_0x2d46('0x6d')]['id']){delete _0x227af5[_0x2d46('0x6d')]['id'];}return db['FaxInteraction'][_0x2d46('0x59')]({'where':{'id':_0x227af5[_0x2d46('0xb3')]['id']}})['then'](handleEntityNotFound(_0x434640,null))['then'](saveUpdates(_0x227af5['body'],null))[_0x2d46('0x29')](respondWithResult(_0x434640,null))[_0x2d46('0x33')](handleError(_0x434640,null));};exports['destroy']=function(_0x240751,_0x17c97b){return db[_0x2d46('0x36')][_0x2d46('0x59')]({'where':{'id':_0x240751[_0x2d46('0xb3')]['id']}})[_0x2d46('0x29')](handleEntityNotFound(_0x17c97b,null))[_0x2d46('0x29')](removeEntity(_0x17c97b,null))[_0x2d46('0x33')](handleError(_0x17c97b,null));};exports['describe']=function(_0x3431e9,_0x19fe7d){return db[_0x2d46('0x36')][_0x2d46('0xb4')]()['then'](respondWithResult(_0x19fe7d,null))[_0x2d46('0x33')](handleError(_0x19fe7d,null));};exports[_0x2d46('0xb5')]=function(_0x74be73,_0x2f954a,_0x8141e0){return db[_0x2d46('0xb6')][_0x2d46('0x59')]({'where':{'id':_0x74be73[_0x2d46('0xb3')]['id']}})['then'](handleEntityNotFound(_0x2f954a,null))[_0x2d46('0x29')](function(_0x32a145){if(_0x32a145){return _0x32a145['addMessage'](_0x74be73[_0x2d46('0x6d')]['ids'],_[_0x2d46('0xb7')](_0x74be73[_0x2d46('0x6d')],['ids','id'])||{});}})['then'](respondWithResult(_0x2f954a,null))[_0x2d46('0x33')](handleError(_0x2f954a,null));};exports[_0x2d46('0xb8')]=function(_0x701ea6,_0x508f9f,_0x3028d9){var _0x2f1699={'raw':![],'where':{}};var _0x3eb474={};var _0x4abf9c={'count':0x0,'rows':[]};return db['FaxInteraction'][_0x2d46('0xb9')]({'where':{'id':_0x701ea6['params']['id']}})[_0x2d46('0x29')](handleEntityNotFound(_0x508f9f,null))['then'](function(_0x4f8798){if(_0x4f8798){_0x3eb474[_0x2d46('0x38')]=_[_0x2d46('0x3a')](db[_0x2d46('0xb6')][_0x2d46('0x37')]);_0x3eb474[_0x2d46('0x39')]=_['keys'](_0x701ea6[_0x2d46('0x39')]);_0x3eb474['filters']=_['intersection'](_0x3eb474['model'],_0x3eb474['query']);_0x2f1699['attributes']=_['intersection'](_0x3eb474[_0x2d46('0x38')],qs[_0x2d46('0x3e')](_0x701ea6[_0x2d46('0x39')][_0x2d46('0x3e')]));_0x2f1699[_0x2d46('0x3d')]=_0x2f1699[_0x2d46('0x3d')][_0x2d46('0x3f')]?_0x2f1699[_0x2d46('0x3d')]:_0x3eb474[_0x2d46('0x38')];if(!_0x701ea6['query'][_0x2d46('0x40')]('nolimit')){_0x2f1699[_0x2d46('0x42')]=qs[_0x2d46('0x42')](_0x701ea6['query'][_0x2d46('0x42')]);_0x2f1699[_0x2d46('0x21')]=qs[_0x2d46('0x21')](_0x701ea6['query'][_0x2d46('0x21')]);}_0x2f1699[_0x2d46('0x88')]=qs[_0x2d46('0x43')](_0x701ea6['query'][_0x2d46('0x43')]);_0x2f1699[_0x2d46('0x44')]=qs[_0x2d46('0x3b')](_['pick'](_0x701ea6['query'],_0x3eb474[_0x2d46('0x3b')]));_0x2f1699['where'][_0x2d46('0xad')]=_0x4f8798['id'];if(_0x701ea6[_0x2d46('0x39')]['filter']){_0x2f1699[_0x2d46('0x44')]=_['merge'](_0x2f1699[_0x2d46('0x44')],{'$or':_['map'](_0x2f1699[_0x2d46('0x3d')],function(_0x54505f){var _0x58d9fc={};_0x58d9fc[_0x54505f]={'$like':'%'+_0x701ea6[_0x2d46('0x39')][_0x2d46('0x7d')]+'%'};return _0x58d9fc;})});}if(_0x701ea6[_0x2d46('0x39')][_0x2d46('0x76')]){var _0x4ff459=_0x701ea6[_0x2d46('0x39')][_0x2d46('0x76')][_0x2d46('0x30')](',');var _0x140c44={};_0x140c44[_0x4ff459[0x0]]={'$gte':moment(_0x4ff459[0x1])[_0x2d46('0xba')](_0x2d46('0xbb'))};_0x2f1699[_0x2d46('0x44')]=_['merge'](_0x2f1699['where'],_0x140c44);}_0x2f1699=_[_0x2d46('0x95')]({},_0x2f1699,_0x701ea6['options']);return db[_0x2d46('0xb6')]['count']({'where':_0x2f1699[_0x2d46('0x44')]})[_0x2d46('0x29')](function(_0x3f8e4c){_0x4abf9c['count']=_0x3f8e4c;if(_0x701ea6[_0x2d46('0x39')][_0x2d46('0xaf')]){_0x2f1699[_0x2d46('0xb0')]=[{'all':!![]}];}return db[_0x2d46('0xb6')][_0x2d46('0xbc')](_0x2f1699);})[_0x2d46('0x29')](function(_0x3cb1fb){_0x4abf9c['rows']=_0x3cb1fb;return _0x4abf9c;});}})[_0x2d46('0x29')](respondWithFilteredResult(_0x508f9f,_0x2f1699))[_0x2d46('0x33')](handleError(_0x508f9f,null));};exports[_0x2d46('0xbd')]=function(_0x434875,_0x481e10,_0x5362f2){return db[_0x2d46('0x36')]['find']({'where':{'id':_0x434875[_0x2d46('0xb3')]['id']}})['then'](handleEntityNotFound(_0x481e10,null))[_0x2d46('0x29')](function(_0x2f064d){if(_0x2f064d){return _0x2f064d[_0x2d46('0xbe')](_0x434875[_0x2d46('0x6d')][_0x2d46('0xbf')],_['omit'](_0x434875[_0x2d46('0x6d')],['ids','id'])||{})['spread'](function(){return db[_0x2d46('0x64')][_0x2d46('0xbc')]({'attributes':['id',_0x2d46('0x2c'),_0x2d46('0x48')],'where':{'id':_0x434875[_0x2d46('0x6d')]['ids']}});})[_0x2d46('0x29')](function(_0x27aa7b){socket[_0x2d46('0xc0')](_0x2d46('0xc1'),{'id':Number(_0x434875[_0x2d46('0xb3')]['id']),'tags':_0x27aa7b||[]});return{'id':Number(_0x434875[_0x2d46('0xb3')]['id']),'tags':_0x27aa7b||[]};});}})[_0x2d46('0x29')](respondWithResult(_0x481e10,null))[_0x2d46('0x33')](handleError(_0x481e10,null));};exports[_0x2d46('0xc2')]=function(_0x448c31,_0x4608cf,_0x5b2b2e){return db[_0x2d46('0x36')][_0x2d46('0x59')]({'where':{'id':_0x448c31[_0x2d46('0xb3')]['id']}})[_0x2d46('0x29')](handleEntityNotFound(_0x4608cf,null))[_0x2d46('0x29')](function(_0x47d966){if(_0x47d966){return _0x47d966[_0x2d46('0xc2')](_0x448c31['query'][_0x2d46('0xbf')]);}})[_0x2d46('0x29')](respondWithStatusCode(_0x4608cf,null))['catch'](handleError(_0x4608cf,null));};exports['download']=function(_0xa1f066,_0x1c3e35){var _0x413189=moment()[_0x2d46('0xc3')]()[_0x2d46('0x92')]();var _0x25e513=path[_0x2d46('0xc4')](config[_0x2d46('0xc5')],'server',_0x2d46('0xc6'),_0x2d46('0xc7'));var _0x8d0015=path[_0x2d46('0xc4')](config[_0x2d46('0xc5')],_0x2d46('0xc8'),_0x2d46('0xc6'),_0x2d46('0xc9'));var _0x5d1c8b=path['join'](_0x25e513,_0x413189);var _0x57e240=util['format'](_0x2d46('0xca'),_0xa1f066[_0x2d46('0xb3')]['id'],_0x413189);var _0x120197=path[_0x2d46('0xc4')](_0x25e513,_0x57e240);var _0x5031fe=[];_0x5031fe[_0x2d46('0x32')]({'model':db[_0x2d46('0xcb')],'as':'Attachment','raw':!![]});var _0x39de68=[{'model':db[_0x2d46('0xb6')],'as':_0x2d46('0xcc'),'attributes':['id','body',_0x2d46('0x74')],'include':_0x5031fe}];return db[_0x2d46('0x36')][_0x2d46('0x59')]({'where':{'id':_0xa1f066[_0x2d46('0xb3')]['id']},'include':_0x39de68})[_0x2d46('0x29')](handleEntityNotFound(_0x1c3e35,null))[_0x2d46('0x29')](function(_0x2e9f){if(_0x2e9f&&_0x2e9f[_0x2d46('0xcc')]){var _0x27f62d=_0x2e9f[_0x2d46('0xcd')]({'plain':!![]});fs[_0x2d46('0xce')](_0x5d1c8b);for(var _0x2c036a=0x0;_0x2c036a<_0x27f62d[_0x2d46('0xcc')][_0x2d46('0x3f')];_0x2c036a++){var _0x20793b=_0x27f62d[_0x2d46('0xcc')][_0x2c036a][_0x2d46('0xcb')];if(_0x20793b){var _0x2dcd78=path['join'](_0x8d0015,_0x20793b[_0x2d46('0xcf')]);if(fs[_0x2d46('0xd0')](_0x2dcd78)){fs[_0x2d46('0xd1')](_0x2dcd78)[_0x2d46('0xd2')](fs['createWriteStream'](path['join'](_0x5d1c8b,_0x20793b[_0x2d46('0xcf')])));}}}return BPromise[_0x2d46('0x8b')]()[_0x2d46('0x29')](function(){return new BPromise(function(_0x46a1e0,_0x4d69cc){zipdir(_0x5d1c8b,{'saveTo':_0x120197},function(_0x5d89f7,_0x4ad74b){if(_0x5d89f7)return _0x4d69cc(_0x5d89f7);return _0x46a1e0(_0x4ad74b);});})[_0x2d46('0x29')](function(){return new BPromise(function(_0x4955f2,_0x3556ba){rimraf(_0x5d1c8b,function(_0x221ca6){if(_0x221ca6)_0x3556ba(_0x221ca6);return _0x4955f2();});});})[_0x2d46('0x29')](function(){return _0x1c3e35['download'](_0x120197,_0x57e240,function(_0x576c6f){if(_0x576c6f){console['log'](_0x2d46('0xd3'),_0x576c6f);}else{fs['unlinkSync'](_0x120197);}});});});}else{return _0x1c3e35[_0x2d46('0x1e')](0xc8);}})[_0x2d46('0x33')](handleError(_0x1c3e35,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index e99f27c..fd5d595 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 _0x153d=['remove','getUsers','then','Users','map','findAll','setDataValue','unreadMessages','length','emit','hasOwnProperty','hook','exports','events','../../mysqldb','FaxInteraction','setMaxListeners','save','update'];(function(_0xf489a7,_0x48445b){var _0x4ee42c=function(_0x543e0e){while(--_0x543e0e){_0xf489a7['push'](_0xf489a7['shift']());}};_0x4ee42c(++_0x48445b);}(_0x153d,0x19c));var _0xd153=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x153d[_0x3bf83f];return _0x22c4a9;};'use strict';var EventEmitter=require(_0xd153('0x0'));var FaxInteraction=require(_0xd153('0x1'))['db'][_0xd153('0x2')];var FaxMessage=require(_0xd153('0x1'))['db']['FaxMessage'];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0xd153('0x3')](0x0);var events={'afterCreate':_0xd153('0x4'),'afterUpdate':_0xd153('0x5'),'afterDestroy':_0xd153('0x6')};function emitEvent(_0xe565eb){return function(_0x467bfd,_0x2ef1e0,_0x56b65b){_0x467bfd[_0xd153('0x7')]({'attributes':['id'],'raw':!![]})[_0xd153('0x8')](function(_0x25440a){_0x467bfd['setDataValue'](_0xd153('0x9'),_0x25440a[_0xd153('0xa')](function(_0x53f892){return{'id':_0x53f892['id']};}));return FaxMessage[_0xd153('0xb')]({'where':{'FaxInteractionId':_0x467bfd['id'],'direction':'in','read':![]},'raw':!![]});})[_0xd153('0x8')](function(_0x1fbd90){_0x467bfd[_0xd153('0xc')](_0xd153('0xd'),_0x1fbd90[_0xd153('0xe')]);FaxInteractionEvents[_0xd153('0xf')](_0xe565eb+':'+_0x467bfd['id'],_0x467bfd);FaxInteractionEvents['emit'](_0xe565eb,_0x467bfd);_0x56b65b(null);})['catch'](_0x56b65b(null));};}for(var e in events){if(events[_0xd153('0x10')](e)){var event=events[e];FaxInteraction[_0xd153('0x11')](e,emitEvent(event));}}module[_0xd153('0x12')]=FaxInteractionEvents; \ No newline at end of file +var _0x37ca=['map','findAll','length','hasOwnProperty','hook','events','../../mysqldb','FaxMessage','setMaxListeners','update','remove','then','setDataValue','Users'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x37ca,0x91));var _0xa37c=function(_0x4d5d58,_0x1de88b){_0x4d5d58=_0x4d5d58-0x0;var _0x437327=_0x37ca[_0x4d5d58];return _0x437327;};'use strict';var EventEmitter=require(_0xa37c('0x0'));var FaxInteraction=require('../../mysqldb')['db']['FaxInteraction'];var FaxMessage=require(_0xa37c('0x1'))['db'][_0xa37c('0x2')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0xa37c('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xa37c('0x4'),'afterDestroy':_0xa37c('0x5')};function emitEvent(_0x4b9f8d){return function(_0x1261a1,_0x3546dc,_0xaa8af6){_0x1261a1['getUsers']({'attributes':['id'],'raw':!![]})[_0xa37c('0x6')](function(_0x1f741e){_0x1261a1[_0xa37c('0x7')](_0xa37c('0x8'),_0x1f741e[_0xa37c('0x9')](function(_0x5971d2){return{'id':_0x5971d2['id']};}));return FaxMessage[_0xa37c('0xa')]({'where':{'FaxInteractionId':_0x1261a1['id'],'direction':'in','read':![]},'raw':!![]});})[_0xa37c('0x6')](function(_0x126415){_0x1261a1[_0xa37c('0x7')]('unreadMessages',_0x126415[_0xa37c('0xb')]);FaxInteractionEvents['emit'](_0x4b9f8d+':'+_0x1261a1['id'],_0x1261a1);FaxInteractionEvents['emit'](_0x4b9f8d,_0x1261a1);_0xaa8af6(null);})['catch'](_0xaa8af6(null));};}for(var e in events){if(events[_0xa37c('0xc')](e)){var event=events[e];FaxInteraction[_0xa37c('0xd')](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 c671fa5..f51fca0 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 _0x9905=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./faxInteraction.attributes','exports','define','FaxInteraction','fax_interactions','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util'];(function(_0x206839,_0x4494e5){var _0x3dfebd=function(_0x566b91){while(--_0x566b91){_0x206839['push'](_0x206839['shift']());}};_0x3dfebd(++_0x4494e5);}(_0x9905,0x130));var _0x5990=function(_0x57c076,_0x51bda7){_0x57c076=_0x57c076-0x0;var _0x42ce8c=_0x9905[_0x57c076];return _0x42ce8c;};'use strict';var _=require(_0x5990('0x0'));var util=require(_0x5990('0x1'));var logger=require(_0x5990('0x2'))(_0x5990('0x3'));var moment=require(_0x5990('0x4'));var BPromise=require(_0x5990('0x5'));var rp=require(_0x5990('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5990('0x7'));var config=require(_0x5990('0x8'));var attributes=require(_0x5990('0x9'));module[_0x5990('0xa')]=function(_0x92e917,_0x497a45){return _0x92e917[_0x5990('0xb')](_0x5990('0xc'),attributes,{'tableName':_0x5990('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x371b29,_0x4c0d43,_0x54cfba){if(_0x371b29[_0x5990('0xe')](_0x5990('0xf'))){_0x371b29['closedAt']=moment()[_0x5990('0x10')](_0x5990('0x11'));}_0x54cfba(null,_0x371b29);}}});}; \ No newline at end of file +var _0x5a87=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxInteraction.attributes','FaxInteraction','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','util'];(function(_0x542d6b,_0x1615bd){var _0x22d616=function(_0x1db71f){while(--_0x1db71f){_0x542d6b['push'](_0x542d6b['shift']());}};_0x22d616(++_0x1615bd);}(_0x5a87,0x194));var _0x75a8=function(_0x2718bb,_0x155d3e){_0x2718bb=_0x2718bb-0x0;var _0x403075=_0x5a87[_0x2718bb];return _0x403075;};'use strict';var _=require('lodash');var util=require(_0x75a8('0x0'));var logger=require(_0x75a8('0x1'))(_0x75a8('0x2'));var moment=require(_0x75a8('0x3'));var BPromise=require(_0x75a8('0x4'));var rp=require(_0x75a8('0x5'));var fs=require('fs');var path=require(_0x75a8('0x6'));var rimraf=require(_0x75a8('0x7'));var config=require(_0x75a8('0x8'));var attributes=require(_0x75a8('0x9'));module['exports']=function(_0x2f5ea7,_0x1d3a29){return _0x2f5ea7['define'](_0x75a8('0xa'),attributes,{'tableName':'fax_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x174ffa,_0x9b4554,_0x4a242a){if(_0x174ffa['changed'](_0x75a8('0xb'))){_0x174ffa[_0x75a8('0xc')]=moment()[_0x75a8('0xd')](_0x75a8('0xe'));}_0x4a242a(null,_0x174ffa);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index 59f3050..9636352 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 _0xb225=['register','request','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','result','catch','body','options','raw','where','attributes','limit','UpdateFaxInteraction','AddTagsToFaxInteraction','find','addTags','ids','omit','spread','AddTags','lodash','util','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket'];(function(_0x497e22,_0x339077){var _0x170ec9=function(_0x19d105){while(--_0x19d105){_0x497e22['push'](_0x497e22['shift']());}};_0x170ec9(++_0x339077);}(_0xb225,0x1e9));var _0x5b22=function(_0x4db46b,_0xadcb1a){_0x4db46b=_0x4db46b-0x0;var _0x565be8=_0xb225[_0x4db46b];return _0x565be8;};'use strict';var _=require(_0x5b22('0x0'));var util=require(_0x5b22('0x1'));var moment=require('moment');var BPromise=require(_0x5b22('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5b22('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x5b22('0x4'))(_0x5b22('0x5'));var config=require(_0x5b22('0x6'));var jayson=require(_0x5b22('0x7'));var client=jayson[_0x5b22('0x8')][_0x5b22('0x9')]({'port':0x232a});config[_0x5b22('0xa')]=_[_0x5b22('0xb')](config[_0x5b22('0xa')],{'host':_0x5b22('0xc'),'port':0x18eb});var socket=require(_0x5b22('0xd'))(new Redis(config[_0x5b22('0xa')]));require(_0x5b22('0xe'))[_0x5b22('0xf')](socket);function respondWithRpcPromise(_0x556783,_0x343dfc,_0x53fb68){return new BPromise(function(_0x56bc8d,_0x222f71){return client[_0x5b22('0x10')](_0x556783,_0x53fb68)[_0x5b22('0x11')](function(_0x1b8fc2){logger[_0x5b22('0x12')](_0x5b22('0x13'),_0x343dfc,_0x5b22('0x14'));logger[_0x5b22('0x15')]('FaxInteraction,\x20%s,\x20%s,\x20%s',_0x343dfc,_0x5b22('0x14'),JSON[_0x5b22('0x16')](_0x1b8fc2));if(_0x1b8fc2['error']){if(_0x1b8fc2['error'][_0x5b22('0x17')]===0x1f4){logger[_0x5b22('0x18')](_0x5b22('0x13'),_0x343dfc,_0x1b8fc2[_0x5b22('0x18')]['message']);return _0x222f71(_0x1b8fc2[_0x5b22('0x18')][_0x5b22('0x19')]);}logger[_0x5b22('0x18')](_0x5b22('0x13'),_0x343dfc,_0x1b8fc2[_0x5b22('0x18')][_0x5b22('0x19')]);return _0x56bc8d(_0x1b8fc2[_0x5b22('0x18')][_0x5b22('0x19')]);}else{logger[_0x5b22('0x12')](_0x5b22('0x13'),_0x343dfc,'request\x20sent');_0x56bc8d(_0x1b8fc2[_0x5b22('0x1a')][_0x5b22('0x19')]);}})[_0x5b22('0x1b')](function(_0x2a3b8d){logger['error']('FaxInteraction,\x20%s,\x20%s',_0x343dfc,_0x2a3b8d);_0x222f71(_0x2a3b8d);});});}exports['UpdateFaxInteraction']=function(_0x231e17){var _0x3886f3=this;return new Promise(function(_0x75c20e,_0x1c3420){return db['FaxInteraction']['update'](_0x231e17[_0x5b22('0x1c')],{'raw':_0x231e17[_0x5b22('0x1d')]?_0x231e17[_0x5b22('0x1d')][_0x5b22('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x231e17['options']?_0x231e17[_0x5b22('0x1d')][_0x5b22('0x1f')]||null:null,'attributes':_0x231e17[_0x5b22('0x1d')]?_0x231e17[_0x5b22('0x1d')][_0x5b22('0x20')]||null:null,'limit':_0x231e17['options']?_0x231e17['options'][_0x5b22('0x21')]||null:null})['then'](function(_0x1a197a){logger[_0x5b22('0x12')]('UpdateFaxInteraction',_0x231e17);logger['debug'](_0x5b22('0x22'),_0x231e17,JSON[_0x5b22('0x16')](_0x1a197a));_0x75c20e(_0x1a197a);})['catch'](function(_0x420865){logger[_0x5b22('0x18')](_0x5b22('0x22'),_0x420865[_0x5b22('0x19')],_0x231e17);_0x1c3420(_0x3886f3[_0x5b22('0x18')](0x1f4,_0x420865[_0x5b22('0x19')]));});});};exports[_0x5b22('0x23')]=function(_0x590e7d){return new Promise(function(_0x5206d5,_0x188935){return db['FaxInteraction'][_0x5b22('0x24')]({'where':_0x590e7d[_0x5b22('0x1d')]?_0x590e7d[_0x5b22('0x1d')][_0x5b22('0x1f')]||null:null})[_0x5b22('0x11')](function(_0x31d768){if(_0x31d768){return _0x31d768[_0x5b22('0x25')](_0x590e7d[_0x5b22('0x1c')][_0x5b22('0x26')],_[_0x5b22('0x27')](_0x590e7d[_0x5b22('0x1c')],['ids','id'])||{});}})[_0x5b22('0x28')](function(_0x168f57){logger[_0x5b22('0x12')](_0x5b22('0x29'),_0x590e7d);logger['debug'](_0x5b22('0x29'),_0x590e7d,JSON['stringify'](_0x168f57));_0x5206d5(_0x168f57);})[_0x5b22('0x1b')](function(_0x48dbb8){logger[_0x5b22('0x18')](_0x5b22('0x29'),_0x48dbb8[_0x5b22('0x19')],_0x590e7d);_0x188935(_this['error'](0x1f4,_0x48dbb8[_0x5b22('0x19')]));});});}; \ No newline at end of file +var _0xda26=['then','info','FaxInteraction,\x20%s,\x20%s','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','UpdateFaxInteraction','FaxInteraction','update','options','raw','where','attributes','limit','AddTagsToFaxInteraction','find','body','ids','omit','spread','AddTags','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','request'];(function(_0x149a47,_0x3fe326){var _0x5315ff=function(_0x172bcf){while(--_0x172bcf){_0x149a47['push'](_0x149a47['shift']());}};_0x5315ff(++_0x3fe326);}(_0xda26,0x6a));var _0x6da2=function(_0x39c5f,_0x410ea6){_0x39c5f=_0x39c5f-0x0;var _0x51a800=_0xda26[_0x39c5f];return _0x51a800;};'use strict';var _=require('lodash');var util=require(_0x6da2('0x0'));var moment=require(_0x6da2('0x1'));var BPromise=require(_0x6da2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6da2('0x3'));var db=require(_0x6da2('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x6da2('0x5'))(_0x6da2('0x6'));var config=require('../../config/environment');var jayson=require(_0x6da2('0x7'));var client=jayson[_0x6da2('0x8')][_0x6da2('0x9')]({'port':0x232a});config[_0x6da2('0xa')]=_[_0x6da2('0xb')](config[_0x6da2('0xa')],{'host':_0x6da2('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./faxInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x301991,_0x29c3b7,_0x357435){return new BPromise(function(_0x3475cc,_0x1812a1){return client[_0x6da2('0xd')](_0x301991,_0x357435)[_0x6da2('0xe')](function(_0x27db10){logger[_0x6da2('0xf')](_0x6da2('0x10'),_0x29c3b7,'request\x20sent');logger[_0x6da2('0x11')](_0x6da2('0x12'),_0x29c3b7,_0x6da2('0x13'),JSON[_0x6da2('0x14')](_0x27db10));if(_0x27db10['error']){if(_0x27db10[_0x6da2('0x15')][_0x6da2('0x16')]===0x1f4){logger['error']('FaxInteraction,\x20%s,\x20%s',_0x29c3b7,_0x27db10[_0x6da2('0x15')][_0x6da2('0x17')]);return _0x1812a1(_0x27db10['error'][_0x6da2('0x17')]);}logger[_0x6da2('0x15')](_0x6da2('0x10'),_0x29c3b7,_0x27db10[_0x6da2('0x15')][_0x6da2('0x17')]);return _0x3475cc(_0x27db10[_0x6da2('0x15')][_0x6da2('0x17')]);}else{logger['info'](_0x6da2('0x10'),_0x29c3b7,_0x6da2('0x13'));_0x3475cc(_0x27db10[_0x6da2('0x18')][_0x6da2('0x17')]);}})['catch'](function(_0x5e4d33){logger[_0x6da2('0x15')](_0x6da2('0x10'),_0x29c3b7,_0x5e4d33);_0x1812a1(_0x5e4d33);});});}exports[_0x6da2('0x19')]=function(_0x4b00ab){var _0x259f3b=this;return new Promise(function(_0x5d3a0e,_0x1bec1e){return db[_0x6da2('0x1a')][_0x6da2('0x1b')](_0x4b00ab['body'],{'raw':_0x4b00ab[_0x6da2('0x1c')]?_0x4b00ab[_0x6da2('0x1c')][_0x6da2('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4b00ab[_0x6da2('0x1c')]?_0x4b00ab[_0x6da2('0x1c')][_0x6da2('0x1e')]||null:null,'attributes':_0x4b00ab[_0x6da2('0x1c')]?_0x4b00ab[_0x6da2('0x1c')][_0x6da2('0x1f')]||null:null,'limit':_0x4b00ab[_0x6da2('0x1c')]?_0x4b00ab[_0x6da2('0x1c')][_0x6da2('0x20')]||null:null})[_0x6da2('0xe')](function(_0x1c57a6){logger[_0x6da2('0xf')](_0x6da2('0x19'),_0x4b00ab);logger['debug'](_0x6da2('0x19'),_0x4b00ab,JSON['stringify'](_0x1c57a6));_0x5d3a0e(_0x1c57a6);})['catch'](function(_0x4b49cf){logger['error'](_0x6da2('0x19'),_0x4b49cf['message'],_0x4b00ab);_0x1bec1e(_0x259f3b['error'](0x1f4,_0x4b49cf[_0x6da2('0x17')]));});});};exports[_0x6da2('0x21')]=function(_0x143fa6){return new Promise(function(_0x1c86e3,_0x4dceb3){return db[_0x6da2('0x1a')][_0x6da2('0x22')]({'where':_0x143fa6[_0x6da2('0x1c')]?_0x143fa6[_0x6da2('0x1c')][_0x6da2('0x1e')]||null:null})[_0x6da2('0xe')](function(_0x5e724d){if(_0x5e724d){return _0x5e724d['addTags'](_0x143fa6[_0x6da2('0x23')][_0x6da2('0x24')],_[_0x6da2('0x25')](_0x143fa6[_0x6da2('0x23')],[_0x6da2('0x24'),'id'])||{});}})[_0x6da2('0x26')](function(_0x5a64c4){logger[_0x6da2('0xf')](_0x6da2('0x27'),_0x143fa6);logger[_0x6da2('0x11')]('AddTags',_0x143fa6,JSON[_0x6da2('0x14')](_0x5a64c4));_0x1c86e3(_0x5a64c4);})['catch'](function(_0x19e15a){logger['error'](_0x6da2('0x27'),_0x19e15a[_0x6da2('0x17')],_0x143fa6);_0x4dceb3(_this['error'](0x1f4,_0x19e15a[_0x6da2('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index e39a1cb..6ce8f22 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 _0xdc19=['save','remove','update','emit','removeListener','register','length','./faxInteraction.events'];(function(_0x35a974,_0x56c92f){var _0x5b234e=function(_0x294098){while(--_0x294098){_0x35a974['push'](_0x35a974['shift']());}};_0x5b234e(++_0x56c92f);}(_0xdc19,0xcf));var _0x9dc1=function(_0x29bff8,_0x9c3132){_0x29bff8=_0x29bff8-0x0;var _0x1d9289=_0xdc19[_0x29bff8];return _0x1d9289;};'use strict';var FaxInteractionEvents=require(_0x9dc1('0x0'));var events=[_0x9dc1('0x1'),_0x9dc1('0x2'),_0x9dc1('0x3')];function createListener(_0x3ea339,_0x50a363){return function(_0x2d2480){_0x50a363[_0x9dc1('0x4')](_0x3ea339,_0x2d2480);};}function removeListener(_0x3c8831,_0x5fa129){return function(){FaxInteractionEvents[_0x9dc1('0x5')](_0x3c8831,_0x5fa129);};}exports[_0x9dc1('0x6')]=function(_0x5aa905){for(var _0x147b75=0x0,_0x5122bb=events[_0x9dc1('0x7')];_0x147b75<_0x5122bb;_0x147b75++){var _0x108d33=events[_0x147b75];var _0x2b4d73=createListener('faxInteraction:'+_0x108d33,_0x5aa905);FaxInteractionEvents['on'](_0x108d33,_0x2b4d73);}}; \ No newline at end of file +var _0x9c27=['remove','update','emit','removeListener','register','length','faxInteraction:','save'];(function(_0x218b15,_0x391ec7){var _0x1fcc0c=function(_0x379741){while(--_0x379741){_0x218b15['push'](_0x218b15['shift']());}};_0x1fcc0c(++_0x391ec7);}(_0x9c27,0x1df));var _0x79c2=function(_0x21774b,_0x4a6d2b){_0x21774b=_0x21774b-0x0;var _0x4675b2=_0x9c27[_0x21774b];return _0x4675b2;};'use strict';var FaxInteractionEvents=require('./faxInteraction.events');var events=[_0x79c2('0x0'),_0x79c2('0x1'),_0x79c2('0x2')];function createListener(_0x3c376c,_0x459f44){return function(_0x42d376){_0x459f44[_0x79c2('0x3')](_0x3c376c,_0x42d376);};}function removeListener(_0x5d88aa,_0x122d49){return function(){FaxInteractionEvents[_0x79c2('0x4')](_0x5d88aa,_0x122d49);};}exports[_0x79c2('0x5')]=function(_0x116d23){for(var _0x1bab08=0x0,_0x4888f5=events[_0x79c2('0x6')];_0x1bab08<_0x4888f5;_0x1bab08++){var _0x37ed43=events[_0x1bab08];var _0x255bd3=createListener(_0x79c2('0x7')+_0x37ed43,_0x116d23);FaxInteractionEvents['on'](_0x37ed43,_0x255bd3);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index c79b8cd..e18609e 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 _0xe033=['faxinteraction:addtags','addTags','put','fax','faxinteraction:update','update','delete','faxinteraction:destroy','exports','util','path','express','../../config/environment','isAuthenticated','describe','get','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','/:id/tags','tracked'];(function(_0x2160a9,_0x3cbd9e){var _0xa88cf7=function(_0x51ab6f){while(--_0x51ab6f){_0x2160a9['push'](_0x2160a9['shift']());}};_0xa88cf7(++_0x3cbd9e);}(_0xe033,0x8b));var _0x3e03=function(_0xc8b0c7,_0x1da5ee){_0xc8b0c7=_0xc8b0c7-0x0;var _0x285276=_0xe033[_0xc8b0c7];return _0x285276;};'use strict';var multer=require('multer');var util=require(_0x3e03('0x0'));var path=require(_0x3e03('0x1'));var timeout=require('connect-timeout');var express=require(_0x3e03('0x2'));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(_0x3e03('0x3'));var controller=require('./faxInteraction.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router['get']('/describe',auth[_0x3e03('0x4')](),controller[_0x3e03('0x5')]);router[_0x3e03('0x6')](_0x3e03('0x7'),auth['isAuthenticated'](),controller[_0x3e03('0x8')]);router[_0x3e03('0x6')](_0x3e03('0x9'),auth[_0x3e03('0x4')](),controller[_0x3e03('0xa')]);router[_0x3e03('0x6')](_0x3e03('0xb'),auth[_0x3e03('0x4')](),controller[_0x3e03('0xc')]);router[_0x3e03('0xd')]('/',auth[_0x3e03('0x4')](),controller[_0x3e03('0xe')]);router[_0x3e03('0xd')](_0x3e03('0x9'),auth[_0x3e03('0x4')](),controller['addMessage']);router[_0x3e03('0xd')](_0x3e03('0xf'),auth[_0x3e03('0x4')](),interaction[_0x3e03('0x10')]('fax',_0x3e03('0x11')),controller[_0x3e03('0x12')]);router[_0x3e03('0x13')](_0x3e03('0x7'),auth['isAuthenticated'](),interaction['tracked'](_0x3e03('0x14'),_0x3e03('0x15')),controller[_0x3e03('0x16')]);router[_0x3e03('0x17')](_0x3e03('0x7'),auth[_0x3e03('0x4')](),interaction[_0x3e03('0x10')](_0x3e03('0x14'),_0x3e03('0x18')),controller['destroy']);router[_0x3e03('0x17')]('/:id/tags',auth[_0x3e03('0x4')](),controller['removeTags']);module[_0x3e03('0x19')]=router; \ No newline at end of file +var _0xe5e7=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxInteraction.controller','index','/describe','isAuthenticated','describe','get','/:id','/:id/messages','/:id/download','create','post','addMessage','/:id/tags','tracked','fax','put','faxinteraction:update','update','delete','faxinteraction:destroy','removeTags','exports','path'];(function(_0xc88d1,_0xe2e567){var _0xbb6ecb=function(_0xac9703){while(--_0xac9703){_0xc88d1['push'](_0xc88d1['shift']());}};_0xbb6ecb(++_0xe2e567);}(_0xe5e7,0x10d));var _0x7e5e=function(_0x55e8ba,_0x26d424){_0x55e8ba=_0x55e8ba-0x0;var _0x3bce19=_0xe5e7[_0x55e8ba];return _0x3bce19;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x7e5e('0x0'));var timeout=require(_0x7e5e('0x1'));var express=require(_0x7e5e('0x2'));var router=express[_0x7e5e('0x3')]();var fs_extra=require(_0x7e5e('0x4'));var auth=require(_0x7e5e('0x5'));var interaction=require(_0x7e5e('0x6'));var config=require(_0x7e5e('0x7'));var controller=require(_0x7e5e('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x7e5e('0x9')]);router['get'](_0x7e5e('0xa'),auth[_0x7e5e('0xb')](),controller[_0x7e5e('0xc')]);router[_0x7e5e('0xd')](_0x7e5e('0xe'),auth['isAuthenticated'](),controller['show']);router[_0x7e5e('0xd')](_0x7e5e('0xf'),auth[_0x7e5e('0xb')](),controller['getMessages']);router[_0x7e5e('0xd')](_0x7e5e('0x10'),auth['isAuthenticated'](),controller['download']);router['post']('/',auth['isAuthenticated'](),controller[_0x7e5e('0x11')]);router[_0x7e5e('0x12')](_0x7e5e('0xf'),auth[_0x7e5e('0xb')](),controller[_0x7e5e('0x13')]);router[_0x7e5e('0x12')](_0x7e5e('0x14'),auth['isAuthenticated'](),interaction[_0x7e5e('0x15')](_0x7e5e('0x16'),'faxinteraction:addtags'),controller['addTags']);router[_0x7e5e('0x17')](_0x7e5e('0xe'),auth[_0x7e5e('0xb')](),interaction[_0x7e5e('0x15')]('fax',_0x7e5e('0x18')),controller[_0x7e5e('0x19')]);router[_0x7e5e('0x1a')]('/:id',auth['isAuthenticated'](),interaction[_0x7e5e('0x15')](_0x7e5e('0x16'),_0x7e5e('0x1b')),controller['destroy']);router[_0x7e5e('0x1a')](_0x7e5e('0x14'),auth[_0x7e5e('0xb')](),controller[_0x7e5e('0x1c')]);module[_0x7e5e('0x1d')]=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index 92aad9b..f9c38f9 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 _0x5ff3=['TEXT','exports','medium','ENUM','out'];(function(_0xdf072d,_0x1f67ef){var _0x4f3802=function(_0x1a5e4f){while(--_0x1a5e4f){_0xdf072d['push'](_0xdf072d['shift']());}};_0x4f3802(++_0x1f67ef);}(_0x5ff3,0x17d));var _0x35ff=function(_0x2cacdc,_0x19b5ac){_0x2cacdc=_0x2cacdc-0x0;var _0xf435c4=_0x5ff3[_0x2cacdc];return _0xf435c4;};'use strict';var Sequelize=require('sequelize');module[_0x35ff('0x0')]={'body':{'type':Sequelize['TEXT'](_0x35ff('0x1')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x35ff('0x2')]('in',_0x35ff('0x3')),'defaultValue':_0x35ff('0x3'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x35ff('0x4')],'defaultValue':null},'readAt':{'type':Sequelize['DATE']}}; \ No newline at end of file +var _0x032a=['TEXT','DATE','exports','medium','BOOLEAN','ENUM','out'];(function(_0x20977e,_0x365932){var _0x541c53=function(_0x2e3384){while(--_0x2e3384){_0x20977e['push'](_0x20977e['shift']());}};_0x541c53(++_0x365932);}(_0x032a,0xf0));var _0xa032=function(_0x737a1f,_0x235fef){_0x737a1f=_0x737a1f-0x0;var _0x16eba1=_0x032a[_0x737a1f];return _0x16eba1;};'use strict';var Sequelize=require('sequelize');module[_0xa032('0x0')]={'body':{'type':Sequelize['TEXT'](_0xa032('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0xa032('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0xa032('0x3')]('in',_0xa032('0x4')),'defaultValue':_0xa032('0x4'),'allowNull':![]},'failMessage':{'type':Sequelize[_0xa032('0x5')],'defaultValue':null},'readAt':{'type':Sequelize[_0xa032('0x6')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index 8669af4..66ca718 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 _0xdd06=['defaults','redis','./faxMessage.socket','jayson/promise','client','http','request','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','FaxMessage,\x20%s,\x20%s','info','result','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','end','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','filter','merge','VIRTUAL','options','FaxMessage','includeAll','include','findAll','then','rows','params','keys','find','body','catch','describe','../../config/logger','fax-interactions','accept','fax','read','format','UserId','user','agent','get','FaxInteraction','read1stAt','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','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','EventManager','acceptmessage','FaxInteractionId','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','sequelize','email','rejectmessage','create','findOne','isNil','Attachment','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','download','join','root','server','files','attachments','eml-format','zip-dir','request-promise','bluebird','mustache','path','to-csv','lodash','desk.js','papaparse','ioredis','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb'];(function(_0x2aced2,_0x251671){var _0x144be2=function(_0x597f99){while(--_0x597f99){_0x2aced2['push'](_0x2aced2['shift']());}};_0x144be2(++_0x251671);}(_0xdd06,0x7a));var _0x6dd0=function(_0x28cef5,_0x5ed280){_0x28cef5=_0x28cef5-0x0;var _0x5b4cf3=_0xdd06[_0x28cef5];return _0x5b4cf3;};'use strict';var emlformat=require(_0x6dd0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6dd0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6dd0('0x2'));var moment=require('moment');var BPromise=require(_0x6dd0('0x3'));var Mustache=require(_0x6dd0('0x4'));var util=require('util');var path=require(_0x6dd0('0x5'));var sox=require('sox');var csv=require(_0x6dd0('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6dd0('0x7'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x6dd0('0x8'));var toCsv=require(_0x6dd0('0x6'));var querystring=require('querystring');var Papa=require(_0x6dd0('0x9'));var Redis=require(_0x6dd0('0xa'));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')('api');var utils=require(_0x6dd0('0xb'));var config=require(_0x6dd0('0xc'));var licenseUtil=require(_0x6dd0('0xd'));var db=require(_0x6dd0('0xe'))['db'];config['redis']=_[_0x6dd0('0xf')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6dd0('0x10')]));require(_0x6dd0('0x11'))['register'](socket);var jayson=require(_0x6dd0('0x12'));var client=jayson[_0x6dd0('0x13')]['http']({'port':0x232c});var client9002=jayson[_0x6dd0('0x13')][_0x6dd0('0x14')]({'port':0x232a});function respondWithRpcPromise(_0x30731e,_0x525f54,_0x29e35f,_0x5dd37a){return new BPromise(function(_0x5d1f3c,_0x1dcb3f){var _0x35c6ed=_0x5dd37a||client;return _0x35c6ed[_0x6dd0('0x15')](_0x30731e,_0x29e35f)['then'](function(_0x12155c){logger['info']('FaxMessage,\x20%s,\x20%s',_0x525f54,_0x6dd0('0x16'));logger[_0x6dd0('0x17')](_0x6dd0('0x18'),_0x525f54,_0x6dd0('0x16'),JSON[_0x6dd0('0x19')](_0x12155c));if(_0x12155c[_0x6dd0('0x1a')]){if(_0x12155c[_0x6dd0('0x1a')][_0x6dd0('0x1b')]===0x1f4){logger[_0x6dd0('0x1a')]('FaxMessage,\x20%s,\x20%s',_0x525f54,_0x12155c[_0x6dd0('0x1a')]['message']);return _0x1dcb3f(_0x12155c['error'][_0x6dd0('0x1c')]);}logger[_0x6dd0('0x1a')](_0x6dd0('0x1d'),_0x525f54,_0x12155c[_0x6dd0('0x1a')][_0x6dd0('0x1c')]);return _0x5d1f3c(_0x12155c[_0x6dd0('0x1a')][_0x6dd0('0x1c')]);}else{logger[_0x6dd0('0x1e')](_0x6dd0('0x1d'),_0x525f54,_0x6dd0('0x16'));_0x5d1f3c(_0x12155c[_0x6dd0('0x1f')][_0x6dd0('0x1c')]);}})['catch'](function(_0x1f94b0){logger['error'](_0x6dd0('0x1d'),_0x525f54,_0x1f94b0);_0x1dcb3f(_0x1f94b0);});});}function respondWithStatusCode(_0x382a3a,_0x482c04){_0x482c04=_0x482c04||0xcc;return function(_0x2eb39a){if(_0x2eb39a){return _0x382a3a[_0x6dd0('0x20')](_0x482c04);}return _0x382a3a[_0x6dd0('0x21')](_0x482c04)['end']();};}function respondWithResult(_0x1f51ed,_0xa89b3){_0xa89b3=_0xa89b3||0xc8;return function(_0x54b2c5){if(_0x54b2c5){return _0x1f51ed[_0x6dd0('0x21')](_0xa89b3)[_0x6dd0('0x22')](_0x54b2c5);}};}function respondWithFilteredResult(_0xbbe27e,_0xaba88){return function(_0x50d659){if(_0x50d659){var _0x3b22e1=typeof _0xaba88[_0x6dd0('0x23')]===_0x6dd0('0x24')&&typeof _0xaba88[_0x6dd0('0x25')]===_0x6dd0('0x24');var _0x186cea=_0x50d659[_0x6dd0('0x26')];var _0x37b786=_0x3b22e1?0x0:_0xaba88['offset'];var _0x4bf645=_0x3b22e1?_0x50d659[_0x6dd0('0x26')]:_0xaba88['offset']+_0xaba88[_0x6dd0('0x25')];var _0x4c59f1;if(_0x4bf645>=_0x186cea){_0x4bf645=_0x186cea;_0x4c59f1=0xc8;}else{_0x4c59f1=0xce;}_0xbbe27e[_0x6dd0('0x21')](_0x4c59f1);return _0xbbe27e[_0x6dd0('0x27')](_0x6dd0('0x28'),_0x37b786+'-'+_0x4bf645+'/'+_0x186cea)[_0x6dd0('0x22')](_0x50d659);}return null;};}function patchUpdates(_0x1bc2fa){return function(_0x31b398){try{jsonpatch['apply'](_0x31b398,_0x1bc2fa,!![]);}catch(_0x12697e){return BPromise[_0x6dd0('0x29')](_0x12697e);}return _0x31b398[_0x6dd0('0x2a')]();};}function saveUpdates(_0x3e287f,_0x271a89){return function(_0x1236c0){if(_0x1236c0){return _0x1236c0[_0x6dd0('0x2b')](_0x3e287f)['then'](function(_0x21d52b){return _0x21d52b;});}return null;};}function removeEntity(_0x426b41,_0x2357ae){return function(_0x238b78){if(_0x238b78){return _0x238b78[_0x6dd0('0x2c')]()['then'](function(){_0x426b41[_0x6dd0('0x21')](0xcc)[_0x6dd0('0x2d')]();});}};}function handleEntityNotFound(_0x353a2b,_0x28f86e){return function(_0x2b91d2){if(!_0x2b91d2){_0x353a2b['sendStatus'](0x194);}return _0x2b91d2;};}function handleError(_0x226dd2,_0x32caac){_0x32caac=_0x32caac||0x1f4;return function(_0x5d3f17){logger['error'](_0x5d3f17[_0x6dd0('0x2e')]);if(_0x5d3f17[_0x6dd0('0x2f')]){delete _0x5d3f17['name'];}_0x226dd2['status'](_0x32caac)['send'](_0x5d3f17);};}exports[_0x6dd0('0x30')]=function(_0x50d75f,_0x285d30){var _0x5ba7c1={},_0x557097={},_0x949d63={'count':0x0,'rows':[]};var _0x19c48c=_[_0x6dd0('0x31')](db['FaxMessage'][_0x6dd0('0x32')],function(_0x54021e){return{'name':_0x54021e[_0x6dd0('0x33')],'type':_0x54021e[_0x6dd0('0x34')][_0x6dd0('0x35')]};});_0x557097[_0x6dd0('0x36')]=_['map'](_0x19c48c,_0x6dd0('0x2f'));_0x557097['query']=_['keys'](_0x50d75f[_0x6dd0('0x37')]);_0x557097[_0x6dd0('0x38')]=_[_0x6dd0('0x39')](_0x557097['model'],_0x557097[_0x6dd0('0x37')]);_0x5ba7c1['attributes']=_[_0x6dd0('0x39')](_0x557097['model'],qs[_0x6dd0('0x3a')](_0x50d75f['query']['fields']));_0x5ba7c1[_0x6dd0('0x3b')]=_0x5ba7c1[_0x6dd0('0x3b')][_0x6dd0('0x3c')]?_0x5ba7c1[_0x6dd0('0x3b')]:_0x557097['model'];if(!_0x50d75f[_0x6dd0('0x37')]['hasOwnProperty'](_0x6dd0('0x3d'))){_0x5ba7c1[_0x6dd0('0x25')]=qs[_0x6dd0('0x25')](_0x50d75f[_0x6dd0('0x37')]['limit']);_0x5ba7c1[_0x6dd0('0x23')]=qs[_0x6dd0('0x23')](_0x50d75f[_0x6dd0('0x37')][_0x6dd0('0x23')]);}_0x5ba7c1[_0x6dd0('0x3e')]=qs[_0x6dd0('0x3f')](_0x50d75f['query'][_0x6dd0('0x3f')]);_0x5ba7c1[_0x6dd0('0x40')]=qs[_0x6dd0('0x38')](_['pick'](_0x50d75f['query'],_0x557097[_0x6dd0('0x38')]),_0x19c48c);if(_0x50d75f[_0x6dd0('0x37')][_0x6dd0('0x41')]){_0x5ba7c1[_0x6dd0('0x40')]=_[_0x6dd0('0x42')](_0x5ba7c1['where'],{'$or':_[_0x6dd0('0x31')](_0x19c48c,function(_0x36ab7e){if(_0x36ab7e[_0x6dd0('0x34')]!==_0x6dd0('0x43')){var _0x2124d5={};_0x2124d5[_0x36ab7e['name']]={'$like':'%'+_0x50d75f[_0x6dd0('0x37')][_0x6dd0('0x41')]+'%'};return _0x2124d5;}})});}_0x5ba7c1=_[_0x6dd0('0x42')]({},_0x5ba7c1,_0x50d75f[_0x6dd0('0x44')]);var _0x419679={'where':_0x5ba7c1[_0x6dd0('0x40')]};return db[_0x6dd0('0x45')][_0x6dd0('0x26')](_0x419679)['then'](function(_0x28cd0c){_0x949d63[_0x6dd0('0x26')]=_0x28cd0c;if(_0x50d75f[_0x6dd0('0x37')][_0x6dd0('0x46')]){_0x5ba7c1[_0x6dd0('0x47')]=[{'all':!![]}];}return db[_0x6dd0('0x45')][_0x6dd0('0x48')](_0x5ba7c1);})[_0x6dd0('0x49')](function(_0x5b3833){_0x949d63[_0x6dd0('0x4a')]=_0x5b3833;return _0x949d63;})[_0x6dd0('0x49')](respondWithFilteredResult(_0x285d30,_0x5ba7c1))['catch'](handleError(_0x285d30,null));};exports['show']=function(_0x243474,_0x5c691e){var _0x51d081={'raw':!![],'where':{'id':_0x243474[_0x6dd0('0x4b')]['id']}},_0x1a88fb={};_0x1a88fb['model']=_[_0x6dd0('0x4c')](db[_0x6dd0('0x45')][_0x6dd0('0x32')]);_0x1a88fb[_0x6dd0('0x37')]=_[_0x6dd0('0x4c')](_0x243474['query']);_0x1a88fb[_0x6dd0('0x38')]=_[_0x6dd0('0x39')](_0x1a88fb[_0x6dd0('0x36')],_0x1a88fb[_0x6dd0('0x37')]);_0x51d081[_0x6dd0('0x3b')]=_[_0x6dd0('0x39')](_0x1a88fb['model'],qs[_0x6dd0('0x3a')](_0x243474['query'][_0x6dd0('0x3a')]));_0x51d081[_0x6dd0('0x3b')]=_0x51d081[_0x6dd0('0x3b')][_0x6dd0('0x3c')]?_0x51d081[_0x6dd0('0x3b')]:_0x1a88fb['model'];if(_0x243474[_0x6dd0('0x37')][_0x6dd0('0x46')]){_0x51d081['include']=[{'all':!![]}];}_0x51d081=_[_0x6dd0('0x42')]({},_0x51d081,_0x243474[_0x6dd0('0x44')]);return db['FaxMessage'][_0x6dd0('0x4d')](_0x51d081)['then'](handleEntityNotFound(_0x5c691e,null))[_0x6dd0('0x49')](respondWithResult(_0x5c691e,null))['catch'](handleError(_0x5c691e,null));};exports['update']=function(_0x3370e0,_0x36587a){if(_0x3370e0[_0x6dd0('0x4e')]['id']){delete _0x3370e0[_0x6dd0('0x4e')]['id'];}return db['FaxMessage'][_0x6dd0('0x4d')]({'where':{'id':_0x3370e0[_0x6dd0('0x4b')]['id']}})[_0x6dd0('0x49')](handleEntityNotFound(_0x36587a,null))[_0x6dd0('0x49')](saveUpdates(_0x3370e0[_0x6dd0('0x4e')],null))[_0x6dd0('0x49')](respondWithResult(_0x36587a,null))[_0x6dd0('0x4f')](handleError(_0x36587a,null));};exports[_0x6dd0('0x2c')]=function(_0x551e13,_0x15ed5d){return db['FaxMessage'][_0x6dd0('0x4d')]({'where':{'id':_0x551e13['params']['id']}})['then'](handleEntityNotFound(_0x15ed5d,null))[_0x6dd0('0x49')](removeEntity(_0x15ed5d,null))[_0x6dd0('0x4f')](handleError(_0x15ed5d,null));};exports['describe']=function(_0x43c551,_0x8b9691){return db[_0x6dd0('0x45')][_0x6dd0('0x50')]()[_0x6dd0('0x49')](respondWithResult(_0x8b9691,null))['catch'](handleError(_0x8b9691,null));};var interaction_log=require(_0x6dd0('0x51'))(_0x6dd0('0x52'));exports[_0x6dd0('0x53')]=function(_0x54c8e5,_0x1180fe,_0x3ab6d0){var _0x254416={'agent':{},'channel':_0x6dd0('0x54')};if(_0x54c8e5[_0x6dd0('0x4e')]['id']){delete _0x54c8e5[_0x6dd0('0x4e')]['id'];}_0x54c8e5[_0x6dd0('0x4e')][_0x6dd0('0x55')]=!![];_0x54c8e5['body']['readAt']=moment()[_0x6dd0('0x56')]('YYYY-MM-DD\x20HH:mm:ss');_0x54c8e5['body'][_0x6dd0('0x57')]=_0x54c8e5[_0x6dd0('0x4e')][_0x6dd0('0x57')]||_0x54c8e5[_0x6dd0('0x58')]['id'];_0x254416[_0x6dd0('0x59')]['id']=_0x54c8e5[_0x6dd0('0x4e')][_0x6dd0('0x57')];return db[_0x6dd0('0x45')][_0x6dd0('0x4d')]({'where':{'id':_0x54c8e5[_0x6dd0('0x4b')]['id'],'UserId':null}})[_0x6dd0('0x49')](handleEntityNotFound(_0x1180fe,null))[_0x6dd0('0x49')](saveUpdates(_0x54c8e5[_0x6dd0('0x4e')],null))[_0x6dd0('0x49')](function(_0xa8abd1){if(_0xa8abd1){_0x254416[_0x6dd0('0x1c')]=_0xa8abd1[_0x6dd0('0x5a')]({'plain':!![]});return db[_0x6dd0('0x5b')][_0x6dd0('0x4d')]({'where':{'id':_0xa8abd1['FaxInteractionId']}});}return null;})[_0x6dd0('0x49')](handleEntityNotFound(_0x1180fe,null))[_0x6dd0('0x49')](function(_0x5e6c39){if(_0x5e6c39){return _0x5e6c39[_0x6dd0('0x2b')]({'UserId':_0x54c8e5[_0x6dd0('0x4e')][_0x6dd0('0x57')],'read1stAt':_['isNil'](_0x5e6c39[_0x6dd0('0x5c')])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x6dd0('0x49')](function(_0x9c4c2e){if(_0x9c4c2e){_0x254416['interaction']=_0x9c4c2e[_0x6dd0('0x5a')]({'plain':!![]});interaction_log[_0x6dd0('0x1e')](_0x6dd0('0x5d'),_0x54c8e5[_0x6dd0('0x58')]['id'],_0x54c8e5[_0x6dd0('0x58')][_0x6dd0('0x2f')],_0x54c8e5['user'][_0x6dd0('0x5e')],_0x254416[_0x6dd0('0x5f')]['id'],_0x54c8e5['body']?JSON[_0x6dd0('0x19')](_0x54c8e5[_0x6dd0('0x4e')]):_0x6dd0('0x60'));return respondWithRpcPromise(_0x6dd0('0x61'),_0x6dd0('0x62'),_0x254416);}return null;})['then'](function(_0x1dac33){var _0x5ca01e=_0x6dd0('0x63')+_0x1dac33[_0x6dd0('0x1c')][_0x6dd0('0x64')];return db['sequelize']['query'](_0x5ca01e,{'type':db[_0x6dd0('0x65')][_0x6dd0('0x66')][_0x6dd0('0x67')],'raw':!![]})['then'](function(_0x47c0f3){return _0x47c0f3;});})[_0x6dd0('0x49')](function(_0x702c5){if(_0x702c5){_0x254416[_0x6dd0('0x1c')][_0x6dd0('0x68')]=_0x702c5[0x0];if(!_0x54c8e5[_0x6dd0('0x4e')][_0x6dd0('0x57')])return;return db[_0x6dd0('0x69')][_0x6dd0('0x4d')]({'where':{'id':_0x54c8e5['body']['UserId'],'role':'agent'},'attributes':['id',_0x6dd0('0x2f'),_0x6dd0('0x6a'),'email',_0x6dd0('0x6b')],'raw':!![]});}return null;})['then'](function(_0x1eaa78){if(!_0x1eaa78)return null;_0x254416[_0x6dd0('0x1c')][_0x6dd0('0x59')]=_0x1eaa78;return _0x254416;})[_0x6dd0('0x49')](function(_0x35eae5){if(_0x35eae5){if(_0x54c8e5['body'][_0x6dd0('0x6c')]){_0x254416[_0x6dd0('0x1c')][_0x6dd0('0x6d')]=util[_0x6dd0('0x56')](_0x6dd0('0x6e'),_0x54c8e5[_0x6dd0('0x58')]['name']);_0x254416[_0x6dd0('0x1c')][_0x6dd0('0x6f')]=_0x254416['channel'];_0x254416[_0x6dd0('0x1c')][_0x6dd0('0x70')]=_0x254416['channel'];_0x254416['message'][_0x6dd0('0x71')]=_0x6dd0('0x53');return respondWithRpcPromise(_0x6dd0('0x72'),_0x6dd0('0x72'),{'event':_0x6dd0('0x73'),'message':_0x254416[_0x6dd0('0x1c')]},client9002)[_0x6dd0('0x49')](function(){return _0x254416;});}return _0x254416;}return null;})[_0x6dd0('0x49')](respondWithResult(_0x1180fe,null))[_0x6dd0('0x4f')](handleError(_0x1180fe,null));};var interaction_log=require('../../config/logger')(_0x6dd0('0x52'));exports[_0x6dd0('0x29')]=function(_0x55a2ee,_0x4030eb,_0xeb8571){var _0x2510e0={'agent':{},'channel':'fax'};if(_0x55a2ee['body']['id']){delete _0x55a2ee[_0x6dd0('0x4e')]['id'];}_0x55a2ee['body'][_0x6dd0('0x57')]=_0x55a2ee[_0x6dd0('0x4e')]['UserId']||_0x55a2ee[_0x6dd0('0x58')]['id'];_0x2510e0[_0x6dd0('0x59')]['id']=_0x55a2ee['body'][_0x6dd0('0x57')];return db['FaxMessage']['find']({'where':{'id':_0x55a2ee[_0x6dd0('0x4b')]['id'],'UserId':null}})[_0x6dd0('0x49')](handleEntityNotFound(_0x4030eb,null))[_0x6dd0('0x49')](function(_0x1160f7){if(_0x1160f7){_0x2510e0[_0x6dd0('0x1c')]=_0x1160f7[_0x6dd0('0x5a')]({'plain':!![]});return db[_0x6dd0('0x5b')][_0x6dd0('0x4d')]({'where':{'id':_0x1160f7[_0x6dd0('0x74')]}});}return null;})[_0x6dd0('0x49')](handleEntityNotFound(_0x4030eb,null))[_0x6dd0('0x49')](function(_0x14d40c){if(_0x14d40c){_0x2510e0[_0x6dd0('0x5f')]=_0x14d40c[_0x6dd0('0x5a')]({'plain':!![]});interaction_log[_0x6dd0('0x1e')](_0x6dd0('0x75'),_0x55a2ee[_0x6dd0('0x58')]['id'],_0x55a2ee['user']['name'],_0x55a2ee[_0x6dd0('0x58')][_0x6dd0('0x5e')],_0x2510e0[_0x6dd0('0x5f')]['id'],_0x55a2ee['body']?JSON['stringify'](_0x55a2ee[_0x6dd0('0x4e')]):_0x6dd0('0x60'));return respondWithRpcPromise(_0x6dd0('0x76'),_0x6dd0('0x77'),_0x2510e0);}return null;})[_0x6dd0('0x49')](function(_0x2b05e0){var _0x15fc61='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x2b05e0[_0x6dd0('0x1c')][_0x6dd0('0x64')];return db[_0x6dd0('0x78')][_0x6dd0('0x37')](_0x15fc61,{'type':db[_0x6dd0('0x65')][_0x6dd0('0x66')][_0x6dd0('0x67')],'raw':!![]})[_0x6dd0('0x49')](function(_0x1a4c44){return _0x1a4c44;});})['then'](function(_0x57a3e1){if(_0x57a3e1){_0x2510e0[_0x6dd0('0x1c')][_0x6dd0('0x68')]=_0x57a3e1[0x0];if(!_0x55a2ee[_0x6dd0('0x4e')]['UserId'])return;return db[_0x6dd0('0x69')][_0x6dd0('0x4d')]({'where':{'id':_0x55a2ee[_0x6dd0('0x4e')][_0x6dd0('0x57')],'role':'agent'},'attributes':['id',_0x6dd0('0x2f'),_0x6dd0('0x6a'),_0x6dd0('0x79'),'internal'],'raw':!![]});}return null;})[_0x6dd0('0x49')](function(_0x4051d9){if(!_0x4051d9)return null;_0x2510e0[_0x6dd0('0x1c')]['agent']=_0x4051d9;return _0x2510e0;})[_0x6dd0('0x49')](function(_0x21b44c){if(_0x21b44c){_0x21b44c[_0x6dd0('0x1c')][_0x6dd0('0x6d')]=util[_0x6dd0('0x56')](_0x6dd0('0x6e'),_0x55a2ee[_0x6dd0('0x58')][_0x6dd0('0x2f')]);_0x21b44c[_0x6dd0('0x1c')][_0x6dd0('0x6f')]=_0x2510e0[_0x6dd0('0x6f')];_0x21b44c[_0x6dd0('0x1c')]['motionChannel']=_0x2510e0[_0x6dd0('0x6f')];_0x21b44c['message'][_0x6dd0('0x71')]=_0x6dd0('0x29');respondWithRpcPromise(_0x6dd0('0x72'),_0x6dd0('0x72'),{'event':_0x6dd0('0x7a'),'message':_0x21b44c[_0x6dd0('0x1c')]},client9002);return _0x2510e0;}return null;})[_0x6dd0('0x49')](respondWithResult(_0x4030eb,null))[_0x6dd0('0x4f')](handleError(_0x4030eb,null));};exports[_0x6dd0('0x7b')]=function(_0x48c61c,_0xd6866c){var _0x2e226d;return db[_0x6dd0('0x45')][_0x6dd0('0x7b')](_0x48c61c['body'],{})['then'](function(_0xeb39bc){_0x2e226d=_0xeb39bc;return db['CmContact'][_0x6dd0('0x7c')]({'where':{'id':_0x2e226d[_0x6dd0('0x64')]}});})[_0x6dd0('0x49')](function(_0x64e430){if(_[_0x6dd0('0x7d')](_0x64e430)){return;}else{_0x2e226d[_0x6dd0('0x54')]=_0x64e430[_0x6dd0('0x54')];return db[_0x6dd0('0x7e')][_0x6dd0('0x7c')]({'where':{'id':_0x2e226d['AttachmentId']}});}})[_0x6dd0('0x49')](function(_0x69202e){return respondWithRpcPromise(_0x6dd0('0x7f'),'SendFax',{'FaxAccountId':_['isNil'](_0x48c61c[_0x6dd0('0x4e')])?undefined:_0x48c61c[_0x6dd0('0x4e')][_0x6dd0('0x80')],'path':_[_0x6dd0('0x7d')](_0x69202e)?undefined:util[_0x6dd0('0x56')](_0x6dd0('0x81'),_0x69202e[_0x6dd0('0x82')]),'fax':_[_0x6dd0('0x7d')](_0x2e226d[_0x6dd0('0x54')])?undefined:_0x2e226d[_0x6dd0('0x54')],'AttachmentId':_0x2e226d['AttachmentId']},client9002);})[_0x6dd0('0x49')](respondWithResult(_0xd6866c,0xc9))[_0x6dd0('0x4f')](handleError(_0xd6866c,null));};exports[_0x6dd0('0x83')]=function(_0x32301d,_0xf62b12){var _0x13d029=path[_0x6dd0('0x84')](config[_0x6dd0('0x85')],_0x6dd0('0x86'),_0x6dd0('0x87'),_0x6dd0('0x88'));return db[_0x6dd0('0x45')]['find']({'where':{'id':_0x32301d[_0x6dd0('0x4b')]['id']},'include':[{'model':db['Attachment'],'as':_0x6dd0('0x7e')}]})[_0x6dd0('0x49')](handleEntityNotFound(_0xf62b12,null))[_0x6dd0('0x49')](function(_0x2c6bba){if(_0x2c6bba){return _0xf62b12[_0x6dd0('0x83')](path[_0x6dd0('0x84')](_0x13d029,_0x2c6bba[_0x6dd0('0x7e')][_0x6dd0('0x82')]));}})['catch'](handleError(_0xf62b12,null));}; \ No newline at end of file +var _0x2199=['agent','FaxInteraction','FaxInteractionId','isNil','read1stAt','interaction','get','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','stringify','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','contact','User','email','internal','manual','SIP/%s','channel','motionChannel','event','EventManager','fax','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','Sequelize','fullname','interface','reject','CmContact','findOne','Attachment','AttachmentId','SendFax','basename','join','server','files','attachments','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','fs-extra','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','socket.io-emitter','register','http','request','then','info','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','error','FaxMessage,\x20%s,\x20%s','message','result','catch','sendStatus','status','json','offset','limit','undefined','count','set','Content-Range','update','destroy','end','stack','name','index','map','FaxMessage','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','keys','include','find','body','describe','../../config/logger','fax-interactions','accept','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user'];(function(_0x27b187,_0x2b576f){var _0x37f8f9=function(_0x253599){while(--_0x253599){_0x27b187['push'](_0x27b187['shift']());}};_0x37f8f9(++_0x2b576f);}(_0x2199,0x13b));var _0x9219=function(_0x1c4c7c,_0x2d38c8){_0x1c4c7c=_0x1c4c7c-0x0;var _0x2b6043=_0x2199[_0x1c4c7c];return _0x2b6043;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9219('0x0'));var zipdir=require(_0x9219('0x1'));var jsonpatch=require(_0x9219('0x2'));var rp=require(_0x9219('0x3'));var moment=require(_0x9219('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9219('0x5'));var util=require(_0x9219('0x6'));var path=require(_0x9219('0x7'));var sox=require('sox');var csv=require(_0x9219('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9219('0x9'));var _=require(_0x9219('0xa'));var squel=require('squel');var crypto=require(_0x9219('0xb'));var jsforce=require(_0x9219('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x9219('0x8'));var querystring=require(_0x9219('0xd'));var Papa=require(_0x9219('0xe'));var Redis=require(_0x9219('0xf'));var authService=require(_0x9219('0x10'));var qs=require(_0x9219('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9219('0x12'));var logger=require('../../config/logger')(_0x9219('0x13'));var utils=require(_0x9219('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x9219('0x15'));var db=require(_0x9219('0x16'))['db'];config[_0x9219('0x17')]=_['defaults'](config[_0x9219('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x9219('0x18'))(new Redis(config[_0x9219('0x17')]));require('./faxMessage.socket')[_0x9219('0x19')](socket);var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232c});var client9002=jayson['client'][_0x9219('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x595da0,_0x4b2ebe,_0x1fe01e,_0xb3fbcd){return new BPromise(function(_0x5a506b,_0xd605ab){var _0x23a0d8=_0xb3fbcd||client;return _0x23a0d8[_0x9219('0x1b')](_0x595da0,_0x1fe01e)[_0x9219('0x1c')](function(_0x105a80){logger[_0x9219('0x1d')]('FaxMessage,\x20%s,\x20%s',_0x4b2ebe,_0x9219('0x1e'));logger[_0x9219('0x1f')](_0x9219('0x20'),_0x4b2ebe,'request\x20sent',JSON['stringify'](_0x105a80));if(_0x105a80[_0x9219('0x21')]){if(_0x105a80[_0x9219('0x21')]['code']===0x1f4){logger[_0x9219('0x21')](_0x9219('0x22'),_0x4b2ebe,_0x105a80[_0x9219('0x21')]['message']);return _0xd605ab(_0x105a80[_0x9219('0x21')][_0x9219('0x23')]);}logger[_0x9219('0x21')]('FaxMessage,\x20%s,\x20%s',_0x4b2ebe,_0x105a80[_0x9219('0x21')][_0x9219('0x23')]);return _0x5a506b(_0x105a80[_0x9219('0x21')][_0x9219('0x23')]);}else{logger['info'](_0x9219('0x22'),_0x4b2ebe,_0x9219('0x1e'));_0x5a506b(_0x105a80[_0x9219('0x24')][_0x9219('0x23')]);}})[_0x9219('0x25')](function(_0x29e66a){logger[_0x9219('0x21')](_0x9219('0x22'),_0x4b2ebe,_0x29e66a);_0xd605ab(_0x29e66a);});});}function respondWithStatusCode(_0x5e8ab5,_0x4bb907){_0x4bb907=_0x4bb907||0xcc;return function(_0x2b2f19){if(_0x2b2f19){return _0x5e8ab5[_0x9219('0x26')](_0x4bb907);}return _0x5e8ab5[_0x9219('0x27')](_0x4bb907)['end']();};}function respondWithResult(_0x5d5ddd,_0x1dd63a){_0x1dd63a=_0x1dd63a||0xc8;return function(_0x2057b5){if(_0x2057b5){return _0x5d5ddd[_0x9219('0x27')](_0x1dd63a)[_0x9219('0x28')](_0x2057b5);}};}function respondWithFilteredResult(_0x48bdcd,_0x36f6eb){return function(_0x50c26a){if(_0x50c26a){var _0x1124f6=typeof _0x36f6eb[_0x9219('0x29')]==='undefined'&&typeof _0x36f6eb[_0x9219('0x2a')]===_0x9219('0x2b');var _0x110187=_0x50c26a['count'];var _0x2657b6=_0x1124f6?0x0:_0x36f6eb[_0x9219('0x29')];var _0xc0c8ed=_0x1124f6?_0x50c26a[_0x9219('0x2c')]:_0x36f6eb[_0x9219('0x29')]+_0x36f6eb[_0x9219('0x2a')];var _0x323118;if(_0xc0c8ed>=_0x110187){_0xc0c8ed=_0x110187;_0x323118=0xc8;}else{_0x323118=0xce;}_0x48bdcd['status'](_0x323118);return _0x48bdcd[_0x9219('0x2d')](_0x9219('0x2e'),_0x2657b6+'-'+_0xc0c8ed+'/'+_0x110187)[_0x9219('0x28')](_0x50c26a);}return null;};}function patchUpdates(_0x346312){return function(_0x588e51){try{jsonpatch['apply'](_0x588e51,_0x346312,!![]);}catch(_0x2efd3f){return BPromise['reject'](_0x2efd3f);}return _0x588e51['save']();};}function saveUpdates(_0x5360ae,_0x18b548){return function(_0x2c36f4){if(_0x2c36f4){return _0x2c36f4[_0x9219('0x2f')](_0x5360ae)[_0x9219('0x1c')](function(_0x52a520){return _0x52a520;});}return null;};}function removeEntity(_0x46a957,_0x4ba7a3){return function(_0x12c207){if(_0x12c207){return _0x12c207[_0x9219('0x30')]()[_0x9219('0x1c')](function(){_0x46a957[_0x9219('0x27')](0xcc)[_0x9219('0x31')]();});}};}function handleEntityNotFound(_0x2b5e7e,_0x1c39a5){return function(_0x1fe0dd){if(!_0x1fe0dd){_0x2b5e7e[_0x9219('0x26')](0x194);}return _0x1fe0dd;};}function handleError(_0x16bb42,_0x511170){_0x511170=_0x511170||0x1f4;return function(_0x273b52){logger[_0x9219('0x21')](_0x273b52[_0x9219('0x32')]);if(_0x273b52[_0x9219('0x33')]){delete _0x273b52[_0x9219('0x33')];}_0x16bb42[_0x9219('0x27')](_0x511170)['send'](_0x273b52);};}exports[_0x9219('0x34')]=function(_0x1f46b0,_0x2e576c){var _0x1a1842={},_0x3eb3fd={},_0x22bb38={'count':0x0,'rows':[]};var _0x1b4ffa=_[_0x9219('0x35')](db[_0x9219('0x36')][_0x9219('0x37')],function(_0x45be92){return{'name':_0x45be92[_0x9219('0x38')],'type':_0x45be92[_0x9219('0x39')][_0x9219('0x3a')]};});_0x3eb3fd[_0x9219('0x3b')]=_[_0x9219('0x35')](_0x1b4ffa,_0x9219('0x33'));_0x3eb3fd[_0x9219('0x3c')]=_['keys'](_0x1f46b0['query']);_0x3eb3fd[_0x9219('0x3d')]=_[_0x9219('0x3e')](_0x3eb3fd[_0x9219('0x3b')],_0x3eb3fd[_0x9219('0x3c')]);_0x1a1842['attributes']=_[_0x9219('0x3e')](_0x3eb3fd[_0x9219('0x3b')],qs['fields'](_0x1f46b0[_0x9219('0x3c')][_0x9219('0x3f')]));_0x1a1842[_0x9219('0x40')]=_0x1a1842[_0x9219('0x40')][_0x9219('0x41')]?_0x1a1842[_0x9219('0x40')]:_0x3eb3fd[_0x9219('0x3b')];if(!_0x1f46b0['query']['hasOwnProperty'](_0x9219('0x42'))){_0x1a1842['limit']=qs[_0x9219('0x2a')](_0x1f46b0['query'][_0x9219('0x2a')]);_0x1a1842[_0x9219('0x29')]=qs[_0x9219('0x29')](_0x1f46b0[_0x9219('0x3c')][_0x9219('0x29')]);}_0x1a1842[_0x9219('0x43')]=qs[_0x9219('0x44')](_0x1f46b0[_0x9219('0x3c')][_0x9219('0x44')]);_0x1a1842[_0x9219('0x45')]=qs[_0x9219('0x3d')](_[_0x9219('0x46')](_0x1f46b0[_0x9219('0x3c')],_0x3eb3fd[_0x9219('0x3d')]),_0x1b4ffa);if(_0x1f46b0[_0x9219('0x3c')][_0x9219('0x47')]){_0x1a1842[_0x9219('0x45')]=_[_0x9219('0x48')](_0x1a1842[_0x9219('0x45')],{'$or':_[_0x9219('0x35')](_0x1b4ffa,function(_0x33190c){if(_0x33190c[_0x9219('0x39')]!==_0x9219('0x49')){var _0x551b15={};_0x551b15[_0x33190c[_0x9219('0x33')]]={'$like':'%'+_0x1f46b0[_0x9219('0x3c')]['filter']+'%'};return _0x551b15;}})});}_0x1a1842=_[_0x9219('0x48')]({},_0x1a1842,_0x1f46b0[_0x9219('0x4a')]);var _0x1677bf={'where':_0x1a1842[_0x9219('0x45')]};return db[_0x9219('0x36')][_0x9219('0x2c')](_0x1677bf)[_0x9219('0x1c')](function(_0x1bebb0){_0x22bb38[_0x9219('0x2c')]=_0x1bebb0;if(_0x1f46b0[_0x9219('0x3c')][_0x9219('0x4b')]){_0x1a1842['include']=[{'all':!![]}];}return db[_0x9219('0x36')][_0x9219('0x4c')](_0x1a1842);})[_0x9219('0x1c')](function(_0x38d40e){_0x22bb38[_0x9219('0x4d')]=_0x38d40e;return _0x22bb38;})['then'](respondWithFilteredResult(_0x2e576c,_0x1a1842))['catch'](handleError(_0x2e576c,null));};exports[_0x9219('0x4e')]=function(_0xa578c,_0x1d5e88){var _0x256477={'raw':!![],'where':{'id':_0xa578c[_0x9219('0x4f')]['id']}},_0x136194={};_0x136194[_0x9219('0x3b')]=_[_0x9219('0x50')](db[_0x9219('0x36')][_0x9219('0x37')]);_0x136194[_0x9219('0x3c')]=_[_0x9219('0x50')](_0xa578c[_0x9219('0x3c')]);_0x136194[_0x9219('0x3d')]=_[_0x9219('0x3e')](_0x136194['model'],_0x136194[_0x9219('0x3c')]);_0x256477['attributes']=_[_0x9219('0x3e')](_0x136194['model'],qs[_0x9219('0x3f')](_0xa578c[_0x9219('0x3c')]['fields']));_0x256477[_0x9219('0x40')]=_0x256477[_0x9219('0x40')]['length']?_0x256477[_0x9219('0x40')]:_0x136194[_0x9219('0x3b')];if(_0xa578c['query'][_0x9219('0x4b')]){_0x256477[_0x9219('0x51')]=[{'all':!![]}];}_0x256477=_[_0x9219('0x48')]({},_0x256477,_0xa578c[_0x9219('0x4a')]);return db[_0x9219('0x36')][_0x9219('0x52')](_0x256477)[_0x9219('0x1c')](handleEntityNotFound(_0x1d5e88,null))[_0x9219('0x1c')](respondWithResult(_0x1d5e88,null))[_0x9219('0x25')](handleError(_0x1d5e88,null));};exports[_0x9219('0x2f')]=function(_0x23c8fc,_0x5c6b1c){if(_0x23c8fc[_0x9219('0x53')]['id']){delete _0x23c8fc[_0x9219('0x53')]['id'];}return db[_0x9219('0x36')][_0x9219('0x52')]({'where':{'id':_0x23c8fc['params']['id']}})[_0x9219('0x1c')](handleEntityNotFound(_0x5c6b1c,null))[_0x9219('0x1c')](saveUpdates(_0x23c8fc[_0x9219('0x53')],null))[_0x9219('0x1c')](respondWithResult(_0x5c6b1c,null))[_0x9219('0x25')](handleError(_0x5c6b1c,null));};exports[_0x9219('0x30')]=function(_0x6f0e43,_0x242268){return db[_0x9219('0x36')]['find']({'where':{'id':_0x6f0e43[_0x9219('0x4f')]['id']}})['then'](handleEntityNotFound(_0x242268,null))[_0x9219('0x1c')](removeEntity(_0x242268,null))[_0x9219('0x25')](handleError(_0x242268,null));};exports[_0x9219('0x54')]=function(_0x2ecf76,_0x172ab3){return db['FaxMessage'][_0x9219('0x54')]()[_0x9219('0x1c')](respondWithResult(_0x172ab3,null))[_0x9219('0x25')](handleError(_0x172ab3,null));};var interaction_log=require(_0x9219('0x55'))(_0x9219('0x56'));exports[_0x9219('0x57')]=function(_0x49bb4a,_0x39846c,_0x184226){var _0x375807={'agent':{},'channel':'fax'};if(_0x49bb4a[_0x9219('0x53')]['id']){delete _0x49bb4a['body']['id'];}_0x49bb4a[_0x9219('0x53')]['read']=!![];_0x49bb4a['body'][_0x9219('0x58')]=moment()[_0x9219('0x59')](_0x9219('0x5a'));_0x49bb4a[_0x9219('0x53')]['UserId']=_0x49bb4a[_0x9219('0x53')][_0x9219('0x5b')]||_0x49bb4a[_0x9219('0x5c')]['id'];_0x375807[_0x9219('0x5d')]['id']=_0x49bb4a[_0x9219('0x53')][_0x9219('0x5b')];return db[_0x9219('0x36')][_0x9219('0x52')]({'where':{'id':_0x49bb4a[_0x9219('0x4f')]['id'],'UserId':null}})[_0x9219('0x1c')](handleEntityNotFound(_0x39846c,null))[_0x9219('0x1c')](saveUpdates(_0x49bb4a['body'],null))[_0x9219('0x1c')](function(_0x29208a){if(_0x29208a){_0x375807[_0x9219('0x23')]=_0x29208a['get']({'plain':!![]});return db[_0x9219('0x5e')][_0x9219('0x52')]({'where':{'id':_0x29208a[_0x9219('0x5f')]}});}return null;})[_0x9219('0x1c')](handleEntityNotFound(_0x39846c,null))[_0x9219('0x1c')](function(_0x50f50b){if(_0x50f50b){return _0x50f50b[_0x9219('0x2f')]({'UserId':_0x49bb4a[_0x9219('0x53')]['UserId'],'read1stAt':_[_0x9219('0x60')](_0x50f50b[_0x9219('0x61')])?moment()[_0x9219('0x59')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x9219('0x1c')](function(_0x22ba30){if(_0x22ba30){_0x375807[_0x9219('0x62')]=_0x22ba30[_0x9219('0x63')]({'plain':!![]});interaction_log[_0x9219('0x1d')](_0x9219('0x64'),_0x49bb4a[_0x9219('0x5c')]['id'],_0x49bb4a[_0x9219('0x5c')][_0x9219('0x33')],_0x49bb4a[_0x9219('0x5c')]['role'],_0x375807[_0x9219('0x62')]['id'],_0x49bb4a[_0x9219('0x53')]?JSON[_0x9219('0x65')](_0x49bb4a['body']):_0x9219('0x66'));return respondWithRpcPromise(_0x9219('0x67'),'acceptMessage',_0x375807);}return null;})[_0x9219('0x1c')](function(_0x5e6637){var _0x2ae64a=_0x9219('0x68')+_0x5e6637[_0x9219('0x23')][_0x9219('0x69')];return db[_0x9219('0x6a')]['query'](_0x2ae64a,{'type':db['Sequelize'][_0x9219('0x6b')][_0x9219('0x6c')],'raw':!![]})['then'](function(_0x54d185){return _0x54d185;});})[_0x9219('0x1c')](function(_0x5e7b29){if(_0x5e7b29){_0x375807[_0x9219('0x23')][_0x9219('0x6d')]=_0x5e7b29[0x0];if(!_0x49bb4a[_0x9219('0x53')][_0x9219('0x5b')])return;return db[_0x9219('0x6e')]['find']({'where':{'id':_0x49bb4a[_0x9219('0x53')][_0x9219('0x5b')],'role':'agent'},'attributes':['id',_0x9219('0x33'),'fullname',_0x9219('0x6f'),_0x9219('0x70')],'raw':!![]});}return null;})[_0x9219('0x1c')](function(_0x25a4fe){if(!_0x25a4fe)return null;_0x375807[_0x9219('0x23')][_0x9219('0x5d')]=_0x25a4fe;return _0x375807;})[_0x9219('0x1c')](function(_0x5ea01e){if(_0x5ea01e){if(_0x49bb4a[_0x9219('0x53')][_0x9219('0x71')]){_0x375807['message']['interface']=util[_0x9219('0x59')](_0x9219('0x72'),_0x49bb4a['user'][_0x9219('0x33')]);_0x375807[_0x9219('0x23')]['channel']=_0x375807[_0x9219('0x73')];_0x375807[_0x9219('0x23')][_0x9219('0x74')]=_0x375807[_0x9219('0x73')];_0x375807[_0x9219('0x23')][_0x9219('0x75')]=_0x9219('0x57');return respondWithRpcPromise('EventManager',_0x9219('0x76'),{'event':'acceptmessage','message':_0x375807[_0x9219('0x23')]},client9002)['then'](function(){return _0x375807;});}return _0x375807;}return null;})[_0x9219('0x1c')](respondWithResult(_0x39846c,null))[_0x9219('0x25')](handleError(_0x39846c,null));};var interaction_log=require('../../config/logger')(_0x9219('0x56'));exports['reject']=function(_0x566bbd,_0x52d7ca,_0x31cc5a){var _0x295bf0={'agent':{},'channel':_0x9219('0x77')};if(_0x566bbd[_0x9219('0x53')]['id']){delete _0x566bbd['body']['id'];}_0x566bbd[_0x9219('0x53')][_0x9219('0x5b')]=_0x566bbd['body'][_0x9219('0x5b')]||_0x566bbd[_0x9219('0x5c')]['id'];_0x295bf0['agent']['id']=_0x566bbd[_0x9219('0x53')][_0x9219('0x5b')];return db[_0x9219('0x36')][_0x9219('0x52')]({'where':{'id':_0x566bbd[_0x9219('0x4f')]['id'],'UserId':null}})[_0x9219('0x1c')](handleEntityNotFound(_0x52d7ca,null))[_0x9219('0x1c')](function(_0x49db75){if(_0x49db75){_0x295bf0[_0x9219('0x23')]=_0x49db75[_0x9219('0x63')]({'plain':!![]});return db[_0x9219('0x5e')][_0x9219('0x52')]({'where':{'id':_0x49db75[_0x9219('0x5f')]}});}return null;})['then'](handleEntityNotFound(_0x52d7ca,null))[_0x9219('0x1c')](function(_0x527348){if(_0x527348){_0x295bf0[_0x9219('0x62')]=_0x527348[_0x9219('0x63')]({'plain':!![]});interaction_log[_0x9219('0x1d')](_0x9219('0x78'),_0x566bbd[_0x9219('0x5c')]['id'],_0x566bbd[_0x9219('0x5c')][_0x9219('0x33')],_0x566bbd[_0x9219('0x5c')][_0x9219('0x79')],_0x295bf0[_0x9219('0x62')]['id'],_0x566bbd[_0x9219('0x53')]?JSON[_0x9219('0x65')](_0x566bbd[_0x9219('0x53')]):_0x9219('0x66'));return respondWithRpcPromise('RejectMessage','rejectMessage',_0x295bf0);}return null;})[_0x9219('0x1c')](function(_0x54fb1b){var _0x4b3f50='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x54fb1b[_0x9219('0x23')]['ContactId'];return db[_0x9219('0x6a')][_0x9219('0x3c')](_0x4b3f50,{'type':db[_0x9219('0x7a')][_0x9219('0x6b')]['SELECT'],'raw':!![]})[_0x9219('0x1c')](function(_0x5a4e9f){return _0x5a4e9f;});})['then'](function(_0x4ea06f){if(_0x4ea06f){_0x295bf0[_0x9219('0x23')][_0x9219('0x6d')]=_0x4ea06f[0x0];if(!_0x566bbd[_0x9219('0x53')][_0x9219('0x5b')])return;return db[_0x9219('0x6e')][_0x9219('0x52')]({'where':{'id':_0x566bbd[_0x9219('0x53')]['UserId'],'role':_0x9219('0x5d')},'attributes':['id',_0x9219('0x33'),_0x9219('0x7b'),_0x9219('0x6f'),_0x9219('0x70')],'raw':!![]});}return null;})[_0x9219('0x1c')](function(_0x484e91){if(!_0x484e91)return null;_0x295bf0[_0x9219('0x23')][_0x9219('0x5d')]=_0x484e91;return _0x295bf0;})[_0x9219('0x1c')](function(_0xc29db1){if(_0xc29db1){_0xc29db1[_0x9219('0x23')][_0x9219('0x7c')]=util['format'](_0x9219('0x72'),_0x566bbd[_0x9219('0x5c')][_0x9219('0x33')]);_0xc29db1[_0x9219('0x23')][_0x9219('0x73')]=_0x295bf0[_0x9219('0x73')];_0xc29db1[_0x9219('0x23')][_0x9219('0x74')]=_0x295bf0[_0x9219('0x73')];_0xc29db1[_0x9219('0x23')][_0x9219('0x75')]=_0x9219('0x7d');respondWithRpcPromise(_0x9219('0x76'),_0x9219('0x76'),{'event':'rejectmessage','message':_0xc29db1[_0x9219('0x23')]},client9002);return _0x295bf0;}return null;})[_0x9219('0x1c')](respondWithResult(_0x52d7ca,null))[_0x9219('0x25')](handleError(_0x52d7ca,null));};exports['create']=function(_0x104406,_0x4cfae0){var _0x2c5c41;return db[_0x9219('0x36')]['create'](_0x104406[_0x9219('0x53')],{})[_0x9219('0x1c')](function(_0x1d6e93){_0x2c5c41=_0x1d6e93;return db[_0x9219('0x7e')][_0x9219('0x7f')]({'where':{'id':_0x2c5c41[_0x9219('0x69')]}});})[_0x9219('0x1c')](function(_0x5a3f1c){if(_['isNil'](_0x5a3f1c)){return;}else{_0x2c5c41['fax']=_0x5a3f1c['fax'];return db[_0x9219('0x80')][_0x9219('0x7f')]({'where':{'id':_0x2c5c41[_0x9219('0x81')]}});}})[_0x9219('0x1c')](function(_0xe78661){return respondWithRpcPromise(_0x9219('0x82'),_0x9219('0x82'),{'FaxAccountId':_['isNil'](_0x104406[_0x9219('0x53')])?undefined:_0x104406[_0x9219('0x53')]['FaxAccountId'],'path':_[_0x9219('0x60')](_0xe78661)?undefined:util[_0x9219('0x59')]('/var/opt/motion2/server/files/attachments/%s',_0xe78661[_0x9219('0x83')]),'fax':_[_0x9219('0x60')](_0x2c5c41[_0x9219('0x77')])?undefined:_0x2c5c41[_0x9219('0x77')],'AttachmentId':_0x2c5c41['AttachmentId']},client9002);})[_0x9219('0x1c')](respondWithResult(_0x4cfae0,0xc9))[_0x9219('0x25')](handleError(_0x4cfae0,null));};exports['download']=function(_0x371ea5,_0x4b08fb){var _0x58de99=path[_0x9219('0x84')](config['root'],_0x9219('0x85'),_0x9219('0x86'),_0x9219('0x87'));return db[_0x9219('0x36')][_0x9219('0x52')]({'where':{'id':_0x371ea5[_0x9219('0x4f')]['id']},'include':[{'model':db[_0x9219('0x80')],'as':_0x9219('0x80')}]})['then'](handleEntityNotFound(_0x4b08fb,null))[_0x9219('0x1c')](function(_0x8e7dc1){if(_0x8e7dc1){return _0x4b08fb['download'](path[_0x9219('0x84')](_0x58de99,_0x8e7dc1[_0x9219('0x80')][_0x9219('0x83')]));}})['catch'](handleError(_0x4b08fb,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index 16a00a0..23e0cfa 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 _0xd69e=['events','../../mysqldb','FaxMessage','save','update','hasOwnProperty','hook','exports'];(function(_0xe3bf5c,_0x4a07ee){var _0x335a53=function(_0x43a2bb){while(--_0x43a2bb){_0xe3bf5c['push'](_0xe3bf5c['shift']());}};_0x335a53(++_0x4a07ee);}(_0xd69e,0xa0));var _0xed69=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0xd69e[_0x2c7618];return _0x5ce3f0;};'use strict';var EventEmitter=require(_0xed69('0x0'));var FaxMessage=require(_0xed69('0x1'))['db'][_0xed69('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xed69('0x3'),'afterUpdate':_0xed69('0x4'),'afterDestroy':'remove'};function emitEvent(_0x5c00fe){return function(_0x5b941a,_0x5afae1,_0x3b30c5){FaxMessageEvents['emit'](_0x5c00fe+':'+_0x5b941a['id'],_0x5b941a);FaxMessageEvents['emit'](_0x5c00fe,_0x5b941a);_0x3b30c5(null);};}for(var e in events){if(events[_0xed69('0x5')](e)){var event=events[e];FaxMessage[_0xed69('0x6')](e,emitEvent(event));}}module[_0xed69('0x7')]=FaxMessageEvents; \ No newline at end of file +var _0x9d56=['events','../../mysqldb','FaxMessage','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x3d57e9,_0x179377){var _0x435d0a=function(_0x56d7af){while(--_0x56d7af){_0x3d57e9['push'](_0x3d57e9['shift']());}};_0x435d0a(++_0x179377);}(_0x9d56,0x122));var _0x69d5=function(_0x56cd52,_0xe9931d){_0x56cd52=_0x56cd52-0x0;var _0x2c05e9=_0x9d56[_0x56cd52];return _0x2c05e9;};'use strict';var EventEmitter=require(_0x69d5('0x0'));var FaxMessage=require(_0x69d5('0x1'))['db'][_0x69d5('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x69d5('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x69d5('0x4'),'afterDestroy':_0x69d5('0x5')};function emitEvent(_0x19fdd4){return function(_0x447f18,_0x2d665e,_0x54d947){FaxMessageEvents[_0x69d5('0x6')](_0x19fdd4+':'+_0x447f18['id'],_0x447f18);FaxMessageEvents[_0x69d5('0x6')](_0x19fdd4,_0x447f18);_0x54d947(null);};}for(var e in events){if(events[_0x69d5('0x7')](e)){var event=events[e];FaxMessage[_0x69d5('0x8')](e,emitEvent(event));}}module[_0x69d5('0x9')]=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index d7bf698..8507950 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 _0xe78d=['path','rimraf','./faxMessage.attributes','exports','define','FaxMessage','fax_messages','fti_fax_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','isNil','FaxInteraction','findOne','FaxInteractionId','then','update','catch','error','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xe78d,0x1d9));var _0xde78=function(_0x2e4e19,_0x493b50){_0x2e4e19=_0x2e4e19-0x0;var _0x9ba20b=_0xe78d[_0x2e4e19];return _0x9ba20b;};'use strict';var _=require(_0xde78('0x0'));var util=require(_0xde78('0x1'));var logger=require(_0xde78('0x2'))(_0xde78('0x3'));var moment=require(_0xde78('0x4'));var BPromise=require(_0xde78('0x5'));var rp=require(_0xde78('0x6'));var fs=require('fs');var path=require(_0xde78('0x7'));var rimraf=require(_0xde78('0x8'));var config=require('../../config/environment');var attributes=require(_0xde78('0x9'));module[_0xde78('0xa')]=function(_0x56f19c,_0x57b003){return _0x56f19c[_0xde78('0xb')](_0xde78('0xc'),attributes,{'tableName':_0xde78('0xd'),'paranoid':![],'indexes':[{'name':_0xde78('0xe'),'fields':[_0xde78('0xf')],'type':_0xde78('0x10')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x6b79aa,_0x47401c,_0xbde05b){var _0x53a53b=_0x56f19c[_0xde78('0x11')];var _0x3ce2a0=_0x6b79aa[_0xde78('0x12')]({'plain':!![]});if(_0x3ce2a0[_0xde78('0x13')][_0xde78('0x14')]()==='in'||_0x3ce2a0[_0xde78('0x13')]['toLowerCase']()===_0xde78('0x15')&&!_0x3ce2a0['secret']&&!_[_0xde78('0x16')](_0x3ce2a0['UserId'])){_0x53a53b[_0xde78('0x17')][_0xde78('0x18')]({'where':{'id':_0x3ce2a0[_0xde78('0x19')]}})[_0xde78('0x1a')](function(_0x4c9791){if(_0x4c9791){_0x4c9791[_0xde78('0x1b')]({'lastMsgAt':_0x3ce2a0['createdAt'],'lastMsgDirection':_0x3ce2a0[_0xde78('0x13')]['toLowerCase']()});}})[_0xde78('0x1c')](function(_0x7bb03d){console[_0xde78('0x1d')](_0x7bb03d);});}_0xbde05b();}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x95cd=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./faxMessage.attributes','define','FaxMessage','fax_messages','fti_fax_messages','body','FULLTEXT','models','direction','toLowerCase','out','secret','UserId','FaxInteraction','findOne','FaxInteractionId','then','update','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x36b037,_0x2b234e){var _0x409194=function(_0xddc9dc){while(--_0xddc9dc){_0x36b037['push'](_0x36b037['shift']());}};_0x409194(++_0x2b234e);}(_0x95cd,0x148));var _0xd95c=function(_0x1c3da4,_0x40c1dc){_0x1c3da4=_0x1c3da4-0x0;var _0x18b9de=_0x95cd[_0x1c3da4];return _0x18b9de;};'use strict';var _=require(_0xd95c('0x0'));var util=require(_0xd95c('0x1'));var logger=require(_0xd95c('0x2'))('api');var moment=require(_0xd95c('0x3'));var BPromise=require(_0xd95c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd95c('0x5'));var rimraf=require(_0xd95c('0x6'));var config=require(_0xd95c('0x7'));var attributes=require(_0xd95c('0x8'));module['exports']=function(_0xae8fcb,_0x2ab3c1){return _0xae8fcb[_0xd95c('0x9')](_0xd95c('0xa'),attributes,{'tableName':_0xd95c('0xb'),'paranoid':![],'indexes':[{'name':_0xd95c('0xc'),'fields':[_0xd95c('0xd')],'type':_0xd95c('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x39c512,_0x472560,_0x1d2a41){var _0x2343b7=_0xae8fcb[_0xd95c('0xf')];var _0x384ab2=_0x39c512['get']({'plain':!![]});if(_0x384ab2[_0xd95c('0x10')][_0xd95c('0x11')]()==='in'||_0x384ab2['direction']['toLowerCase']()===_0xd95c('0x12')&&!_0x384ab2[_0xd95c('0x13')]&&!_['isNil'](_0x384ab2[_0xd95c('0x14')])){_0x2343b7[_0xd95c('0x15')][_0xd95c('0x16')]({'where':{'id':_0x384ab2[_0xd95c('0x17')]}})[_0xd95c('0x18')](function(_0x9737d5){if(_0x9737d5){_0x9737d5[_0xd95c('0x19')]({'lastMsgAt':_0x384ab2['createdAt'],'lastMsgDirection':_0x384ab2[_0xd95c('0x10')][_0xd95c('0x11')]()});}})[_0xd95c('0x1a')](function(_0x519af2){console[_0xd95c('0x1b')](_0x519af2);});}_0x1d2a41();}},'charset':_0xd95c('0x1c'),'collate':_0xd95c('0x1d')});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index 11693d9..afc4442 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 _0x6f0d=['../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost','./faxMessage.socket','register','request','then','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateFaxMessage','FaxMessage','body','options','raw','UpdateFaxMessage','update','attributes','limit','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x3d6db1,_0x4358f8){var _0x5e1cc3=function(_0x3ad5af){while(--_0x3ad5af){_0x3d6db1['push'](_0x3d6db1['shift']());}};_0x5e1cc3(++_0x4358f8);}(_0x6f0d,0x16c));var _0xd6f0=function(_0x2723ca,_0x2a1013){_0x2723ca=_0x2723ca-0x0;var _0x7d9040=_0x6f0d[_0x2723ca];return _0x7d9040;};'use strict';var _=require('lodash');var util=require(_0xd6f0('0x0'));var moment=require(_0xd6f0('0x1'));var BPromise=require(_0xd6f0('0x2'));var rs=require(_0xd6f0('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd6f0('0x4'))['db'];var utils=require(_0xd6f0('0x5'));var logger=require(_0xd6f0('0x6'))(_0xd6f0('0x7'));var config=require(_0xd6f0('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd6f0('0x9')]['http']({'port':0x232a});config[_0xd6f0('0xa')]=_[_0xd6f0('0xb')](config[_0xd6f0('0xa')],{'host':_0xd6f0('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xd6f0('0xd'))[_0xd6f0('0xe')](socket);function respondWithRpcPromise(_0x2854cd,_0x382a2e,_0x225dcf){return new BPromise(function(_0x4db64a,_0x136eee){return client[_0xd6f0('0xf')](_0x2854cd,_0x225dcf)[_0xd6f0('0x10')](function(_0x44bba6){logger['info'](_0xd6f0('0x11'),_0x382a2e,_0xd6f0('0x12'));logger[_0xd6f0('0x13')](_0xd6f0('0x14'),_0x382a2e,_0xd6f0('0x12'),JSON[_0xd6f0('0x15')](_0x44bba6));if(_0x44bba6[_0xd6f0('0x16')]){if(_0x44bba6[_0xd6f0('0x16')][_0xd6f0('0x17')]===0x1f4){logger['error'](_0xd6f0('0x11'),_0x382a2e,_0x44bba6[_0xd6f0('0x16')]['message']);return _0x136eee(_0x44bba6[_0xd6f0('0x16')]['message']);}logger[_0xd6f0('0x16')](_0xd6f0('0x11'),_0x382a2e,_0x44bba6[_0xd6f0('0x16')][_0xd6f0('0x18')]);return _0x4db64a(_0x44bba6[_0xd6f0('0x16')][_0xd6f0('0x18')]);}else{logger[_0xd6f0('0x19')](_0xd6f0('0x11'),_0x382a2e,_0xd6f0('0x12'));_0x4db64a(_0x44bba6[_0xd6f0('0x1a')][_0xd6f0('0x18')]);}})[_0xd6f0('0x1b')](function(_0x327231){logger[_0xd6f0('0x16')](_0xd6f0('0x11'),_0x382a2e,_0x327231);_0x136eee(_0x327231);});});}exports[_0xd6f0('0x1c')]=function(_0x5cd367){var _0x48ac38=this;return new Promise(function(_0x3939aa,_0x264104){return db[_0xd6f0('0x1d')]['create'](_0x5cd367[_0xd6f0('0x1e')],{'raw':_0x5cd367[_0xd6f0('0x1f')]?_0x5cd367['options'][_0xd6f0('0x20')]===undefined?!![]:![]:!![]})['then'](function(_0x1ee584){logger[_0xd6f0('0x19')]('CreateFaxMessage',_0x5cd367);logger[_0xd6f0('0x13')](_0xd6f0('0x1c'),_0x5cd367,JSON['stringify'](_0x1ee584));_0x3939aa(_0x1ee584);})[_0xd6f0('0x1b')](function(_0x402070){logger[_0xd6f0('0x16')]('CreateFaxMessage',_0x402070[_0xd6f0('0x18')],_0x5cd367);_0x264104(_0x48ac38[_0xd6f0('0x16')](0x1f4,_0x402070['message']));});});};exports[_0xd6f0('0x21')]=function(_0x551be8){var _0x2042d5=this;return new Promise(function(_0x3fb5c3,_0x1630dc){return db[_0xd6f0('0x1d')][_0xd6f0('0x22')](_0x551be8[_0xd6f0('0x1e')],{'raw':_0x551be8[_0xd6f0('0x1f')]?_0x551be8[_0xd6f0('0x1f')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x551be8[_0xd6f0('0x1f')]?_0x551be8[_0xd6f0('0x1f')]['where']||null:null,'attributes':_0x551be8[_0xd6f0('0x1f')]?_0x551be8[_0xd6f0('0x1f')][_0xd6f0('0x23')]||null:null,'limit':_0x551be8[_0xd6f0('0x1f')]?_0x551be8[_0xd6f0('0x1f')][_0xd6f0('0x24')]||null:null})[_0xd6f0('0x10')](function(_0x3151f8){logger[_0xd6f0('0x19')](_0xd6f0('0x21'),_0x551be8);logger[_0xd6f0('0x13')](_0xd6f0('0x21'),_0x551be8,JSON[_0xd6f0('0x15')](_0x3151f8));_0x3fb5c3(_0x3151f8);})[_0xd6f0('0x1b')](function(_0xbdd223){logger[_0xd6f0('0x16')](_0xd6f0('0x21'),_0xbdd223[_0xd6f0('0x18')],_0x551be8);_0x1630dc(_0x2042d5[_0xd6f0('0x16')](0x1f4,_0xbdd223[_0xd6f0('0x18')]));});});}; \ No newline at end of file +var _0xd6d6=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','then','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxMessage,\x20%s,\x20%s','message','result','catch','FaxMessage','create','body','options','raw','info','CreateFaxMessage','update','where','limit','UpdateFaxMessage'];(function(_0x22aa70,_0x6e7a62){var _0x47e5f3=function(_0x4ea902){while(--_0x4ea902){_0x22aa70['push'](_0x22aa70['shift']());}};_0x47e5f3(++_0x6e7a62);}(_0xd6d6,0xbe));var _0x6d6d=function(_0x5a986e,_0x220d83){_0x5a986e=_0x5a986e-0x0;var _0x375a3c=_0xd6d6[_0x5a986e];return _0x375a3c;};'use strict';var _=require(_0x6d6d('0x0'));var util=require(_0x6d6d('0x1'));var moment=require(_0x6d6d('0x2'));var BPromise=require(_0x6d6d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6d6d('0x4'));var db=require(_0x6d6d('0x5'))['db'];var utils=require(_0x6d6d('0x6'));var logger=require(_0x6d6d('0x7'))(_0x6d6d('0x8'));var config=require(_0x6d6d('0x9'));var jayson=require(_0x6d6d('0xa'));var client=jayson['client'][_0x6d6d('0xb')]({'port':0x232a});config[_0x6d6d('0xc')]=_[_0x6d6d('0xd')](config[_0x6d6d('0xc')],{'host':_0x6d6d('0xe'),'port':0x18eb});var socket=require(_0x6d6d('0xf'))(new Redis(config[_0x6d6d('0xc')]));require('./faxMessage.socket')['register'](socket);function respondWithRpcPromise(_0x404c88,_0x1fa46d,_0x23b18a){return new BPromise(function(_0x290dfb,_0xf84314){return client['request'](_0x404c88,_0x23b18a)[_0x6d6d('0x10')](function(_0x158f82){logger['info']('FaxMessage,\x20%s,\x20%s',_0x1fa46d,_0x6d6d('0x11'));logger[_0x6d6d('0x12')](_0x6d6d('0x13'),_0x1fa46d,_0x6d6d('0x11'),JSON[_0x6d6d('0x14')](_0x158f82));if(_0x158f82[_0x6d6d('0x15')]){if(_0x158f82[_0x6d6d('0x15')][_0x6d6d('0x16')]===0x1f4){logger['error'](_0x6d6d('0x17'),_0x1fa46d,_0x158f82[_0x6d6d('0x15')][_0x6d6d('0x18')]);return _0xf84314(_0x158f82[_0x6d6d('0x15')][_0x6d6d('0x18')]);}logger['error'](_0x6d6d('0x17'),_0x1fa46d,_0x158f82['error'][_0x6d6d('0x18')]);return _0x290dfb(_0x158f82[_0x6d6d('0x15')][_0x6d6d('0x18')]);}else{logger['info']('FaxMessage,\x20%s,\x20%s',_0x1fa46d,_0x6d6d('0x11'));_0x290dfb(_0x158f82[_0x6d6d('0x19')][_0x6d6d('0x18')]);}})[_0x6d6d('0x1a')](function(_0x51fff6){logger['error'](_0x6d6d('0x17'),_0x1fa46d,_0x51fff6);_0xf84314(_0x51fff6);});});}exports['CreateFaxMessage']=function(_0x26f631){var _0xb8590d=this;return new Promise(function(_0x30d87d,_0x450352){return db[_0x6d6d('0x1b')][_0x6d6d('0x1c')](_0x26f631[_0x6d6d('0x1d')],{'raw':_0x26f631[_0x6d6d('0x1e')]?_0x26f631[_0x6d6d('0x1e')][_0x6d6d('0x1f')]===undefined?!![]:![]:!![]})[_0x6d6d('0x10')](function(_0x6e58e3){logger[_0x6d6d('0x20')](_0x6d6d('0x21'),_0x26f631);logger[_0x6d6d('0x12')](_0x6d6d('0x21'),_0x26f631,JSON[_0x6d6d('0x14')](_0x6e58e3));_0x30d87d(_0x6e58e3);})['catch'](function(_0x3b73e5){logger[_0x6d6d('0x15')](_0x6d6d('0x21'),_0x3b73e5[_0x6d6d('0x18')],_0x26f631);_0x450352(_0xb8590d[_0x6d6d('0x15')](0x1f4,_0x3b73e5[_0x6d6d('0x18')]));});});};exports['UpdateFaxMessage']=function(_0x2851dd){var _0x2b5e31=this;return new Promise(function(_0x235451,_0x126ac8){return db[_0x6d6d('0x1b')][_0x6d6d('0x22')](_0x2851dd[_0x6d6d('0x1d')],{'raw':_0x2851dd['options']?_0x2851dd[_0x6d6d('0x1e')][_0x6d6d('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2851dd['options']?_0x2851dd['options'][_0x6d6d('0x23')]||null:null,'attributes':_0x2851dd[_0x6d6d('0x1e')]?_0x2851dd[_0x6d6d('0x1e')]['attributes']||null:null,'limit':_0x2851dd[_0x6d6d('0x1e')]?_0x2851dd[_0x6d6d('0x1e')][_0x6d6d('0x24')]||null:null})[_0x6d6d('0x10')](function(_0x64d1f7){logger[_0x6d6d('0x20')](_0x6d6d('0x25'),_0x2851dd);logger[_0x6d6d('0x12')](_0x6d6d('0x25'),_0x2851dd,JSON[_0x6d6d('0x14')](_0x64d1f7));_0x235451(_0x64d1f7);})['catch'](function(_0x1f9469){logger['error'](_0x6d6d('0x25'),_0x1f9469[_0x6d6d('0x18')],_0x2851dd);_0x126ac8(_0x2b5e31[_0x6d6d('0x15')](0x1f4,_0x1f9469[_0x6d6d('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index d7a40ba..0e3458b 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 _0xc08b=['removeListener','length','save'];(function(_0x329696,_0x1bc80e){var _0x529b15=function(_0x23c36d){while(--_0x23c36d){_0x329696['push'](_0x329696['shift']());}};_0x529b15(++_0x1bc80e);}(_0xc08b,0x1c4));var _0xbc08=function(_0x2a450f,_0x45193e){_0x2a450f=_0x2a450f-0x0;var _0x1f978e=_0xc08b[_0x2a450f];return _0x1f978e;};'use strict';var FaxMessageEvents=require('./faxMessage.events');var events=[_0xbc08('0x0'),'remove','update'];function createListener(_0x2a3f39,_0x4ca563){return function(_0x325815){_0x4ca563['emit'](_0x2a3f39,_0x325815);};}function removeListener(_0x4cda1b,_0xcd0825){return function(){FaxMessageEvents[_0xbc08('0x1')](_0x4cda1b,_0xcd0825);};}exports['register']=function(_0x416317){for(var _0x2403bc=0x0,_0x528d37=events[_0xbc08('0x2')];_0x2403bc<_0x528d37;_0x2403bc++){var _0x2e8a77=events[_0x2403bc];var _0x335254=createListener('faxMessage:'+_0x2e8a77,_0x416317);FaxMessageEvents['on'](_0x2e8a77,_0x335254);}}; \ No newline at end of file +var _0xf90e=['remove','emit','removeListener','register','length','faxMessage:','./faxMessage.events'];(function(_0x5bf9de,_0x534ff0){var _0x3f9bd2=function(_0x158094){while(--_0x158094){_0x5bf9de['push'](_0x5bf9de['shift']());}};_0x3f9bd2(++_0x534ff0);}(_0xf90e,0xa7));var _0xef90=function(_0x20cdcd,_0x2ebb94){_0x20cdcd=_0x20cdcd-0x0;var _0x51d468=_0xf90e[_0x20cdcd];return _0x51d468;};'use strict';var FaxMessageEvents=require(_0xef90('0x0'));var events=['save',_0xef90('0x1'),'update'];function createListener(_0x545d60,_0x8cc7ad){return function(_0x107b55){_0x8cc7ad[_0xef90('0x2')](_0x545d60,_0x107b55);};}function removeListener(_0x1c7786,_0x5ae80f){return function(){FaxMessageEvents[_0xef90('0x3')](_0x1c7786,_0x5ae80f);};}exports[_0xef90('0x4')]=function(_0x3f5673){for(var _0x558b82=0x0,_0x2a8a59=events[_0xef90('0x5')];_0x558b82<_0x2a8a59;_0x558b82++){var _0x9c0b43=events[_0x558b82];var _0x2f4751=createListener(_0xef90('0x6')+_0x9c0b43,_0x3f5673);FaxMessageEvents['on'](_0x9c0b43,_0x2f4751);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index 9a03fa8..389f97c 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 _0x3667=['/describe','describe','/:id','show','/:id/download','download','post','tracked','fax','faxmessage:create','create','put','update','/:id/accept','accept','/:id/reject','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./faxMessage.controller','get','isAuthenticated','index'];(function(_0x8c3228,_0xcdcfc4){var _0x1cf5e5=function(_0xf3b35f){while(--_0xf3b35f){_0x8c3228['push'](_0x8c3228['shift']());}};_0x1cf5e5(++_0xcdcfc4);}(_0x3667,0xcd));var _0x7366=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3667[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x7366('0x0'));var util=require(_0x7366('0x1'));var path=require(_0x7366('0x2'));var timeout=require(_0x7366('0x3'));var express=require(_0x7366('0x4'));var router=express['Router']();var fs_extra=require(_0x7366('0x5'));var auth=require(_0x7366('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x7366('0x7'));var controller=require(_0x7366('0x8'));router[_0x7366('0x9')]('/',auth[_0x7366('0xa')](),controller[_0x7366('0xb')]);router['get'](_0x7366('0xc'),auth[_0x7366('0xa')](),controller[_0x7366('0xd')]);router[_0x7366('0x9')](_0x7366('0xe'),auth[_0x7366('0xa')](),controller[_0x7366('0xf')]);router[_0x7366('0x9')](_0x7366('0x10'),auth[_0x7366('0xa')](),controller[_0x7366('0x11')]);router[_0x7366('0x12')]('/',auth[_0x7366('0xa')](),interaction[_0x7366('0x13')](_0x7366('0x14'),_0x7366('0x15')),controller[_0x7366('0x16')]);router[_0x7366('0x17')](_0x7366('0xe'),auth[_0x7366('0xa')](),controller[_0x7366('0x18')]);router[_0x7366('0x17')](_0x7366('0x19'),auth[_0x7366('0xa')](),controller[_0x7366('0x1a')]);router[_0x7366('0x17')](_0x7366('0x1b'),auth[_0x7366('0xa')](),controller['reject']);router[_0x7366('0x1c')](_0x7366('0xe'),auth[_0x7366('0xa')](),controller[_0x7366('0x1d')]);module[_0x7366('0x1e')]=router; \ No newline at end of file +var _0xa5fa=['accept','/:id/reject','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./faxMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','download','tracked','faxmessage:create','create','put'];(function(_0x297d01,_0x60e198){var _0x57ad48=function(_0x2d18eb){while(--_0x2d18eb){_0x297d01['push'](_0x297d01['shift']());}};_0x57ad48(++_0x60e198);}(_0xa5fa,0xc4));var _0xaa5f=function(_0x46352f,_0xdf0ce1){_0x46352f=_0x46352f-0x0;var _0x3721eb=_0xa5fa[_0x46352f];return _0x3721eb;};'use strict';var multer=require('multer');var util=require(_0xaa5f('0x0'));var path=require(_0xaa5f('0x1'));var timeout=require(_0xaa5f('0x2'));var express=require(_0xaa5f('0x3'));var router=express['Router']();var fs_extra=require(_0xaa5f('0x4'));var auth=require(_0xaa5f('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xaa5f('0x6'));var controller=require(_0xaa5f('0x7'));router[_0xaa5f('0x8')]('/',auth[_0xaa5f('0x9')](),controller[_0xaa5f('0xa')]);router[_0xaa5f('0x8')](_0xaa5f('0xb'),auth[_0xaa5f('0x9')](),controller[_0xaa5f('0xc')]);router[_0xaa5f('0x8')](_0xaa5f('0xd'),auth['isAuthenticated'](),controller[_0xaa5f('0xe')]);router[_0xaa5f('0x8')]('/:id/download',auth['isAuthenticated'](),controller[_0xaa5f('0xf')]);router['post']('/',auth['isAuthenticated'](),interaction[_0xaa5f('0x10')]('fax',_0xaa5f('0x11')),controller[_0xaa5f('0x12')]);router[_0xaa5f('0x13')](_0xaa5f('0xd'),auth[_0xaa5f('0x9')](),controller['update']);router[_0xaa5f('0x13')]('/:id/accept',auth[_0xaa5f('0x9')](),controller[_0xaa5f('0x14')]);router[_0xaa5f('0x13')](_0xaa5f('0x15'),auth[_0xaa5f('0x9')](),controller['reject']);router['delete'](_0xaa5f('0xd'),auth[_0xaa5f('0x9')](),controller[_0xaa5f('0x16')]);module[_0xaa5f('0x17')]=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index 68128c7..1e4a3d2 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 _0x834c=['ENUM','beepall','roundrobin','sequelize','exports','name','STRING','INTEGER'];(function(_0x1bb672,_0x40baa8){var _0x3b4b88=function(_0x46c8e1){while(--_0x46c8e1){_0x1bb672['push'](_0x1bb672['shift']());}};_0x3b4b88(++_0x40baa8);}(_0x834c,0x73));var _0xc834=function(_0x48cb1f,_0x5ca68d){_0x48cb1f=_0x48cb1f-0x0;var _0x172c4d=_0x834c[_0x48cb1f];return _0x172c4d;};'use strict';var Sequelize=require(_0xc834('0x0'));module[_0xc834('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xc834('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xc834('0x3')]},'timeout':{'type':Sequelize[_0xc834('0x4')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xc834('0x5')]('rrmemory',_0xc834('0x6'),_0xc834('0x7')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0xc834('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0xe67e=['beepall','roundrobin','sequelize','exports','STRING','INTEGER','ENUM','rrmemory'];(function(_0x2f6816,_0x3b76fe){var _0x275636=function(_0x421038){while(--_0x421038){_0x2f6816['push'](_0x2f6816['shift']());}};_0x275636(++_0x3b76fe);}(_0xe67e,0x1ca));var _0xee67=function(_0x408bcd,_0x3f1310){_0x408bcd=_0x408bcd-0x0;var _0x5d1150=_0xe67e[_0x408bcd];return _0x5d1150;};'use strict';var Sequelize=require(_0xee67('0x0'));module[_0xee67('0x1')]={'name':{'type':Sequelize[_0xee67('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xee67('0x2')]},'timeout':{'type':Sequelize[_0xee67('0x3')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xee67('0x4')](_0xee67('0x5'),_0xee67('0x6'),_0xee67('0x7')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0xee67('0x3')],'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 cc558e4..159b63a 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 _0x72c1=['forEach','emit','removeTeams','select','field','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','TeamId','all','union','compact','value','isEmpty','removeAgents','userFaxQueue:remove','addAgents','omit','spread','userFaxQueue:save','isArray','getAgents','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','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','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','save','update','FaxQueues','destroy','then','error','stack','index','map','FaxQueue','rawAttributes','type','name','query','filters','intersection','model','attributes','fields','hasOwnProperty','order','sort','where','VIRTUAL','filter','options','include','findAll','rows','catch','params','keys','length','includeAll','find','create','body','user','get','role','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserFaxQueue','nolimit','pick','FaxQueueId','merge','User','findAndCountAll','UserId','faxPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','ids','online','voicePause','interface','Agents','sequelize','transaction','addTeams','each'];(function(_0x5a91d9,_0x47cedb){var _0x5275e2=function(_0x15de79){while(--_0x15de79){_0x5a91d9['push'](_0x5a91d9['shift']());}};_0x5275e2(++_0x47cedb);}(_0x72c1,0x1cb));var _0x172c=function(_0x3f271b,_0x647c39){_0x3f271b=_0x3f271b-0x0;var _0x45519e=_0x72c1[_0x3f271b];return _0x45519e;};'use strict';var emlformat=require(_0x172c('0x0'));var rimraf=require(_0x172c('0x1'));var zipdir=require(_0x172c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x172c('0x3'));var BPromise=require(_0x172c('0x4'));var Mustache=require(_0x172c('0x5'));var util=require(_0x172c('0x6'));var path=require(_0x172c('0x7'));var sox=require(_0x172c('0x8'));var csv=require(_0x172c('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x172c('0xa'));var _=require('lodash');var squel=require(_0x172c('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x172c('0xc'));var toCsv=require(_0x172c('0x9'));var querystring=require(_0x172c('0xd'));var Papa=require(_0x172c('0xe'));var Redis=require(_0x172c('0xf'));var authService=require(_0x172c('0x10'));var qs=require(_0x172c('0x11'));var as=require(_0x172c('0x12'));var hardwareService=require(_0x172c('0x13'));var logger=require(_0x172c('0x14'))(_0x172c('0x15'));var utils=require(_0x172c('0x16'));var config=require(_0x172c('0x17'));var licenseUtil=require(_0x172c('0x18'));var db=require(_0x172c('0x19'))['db'];config[_0x172c('0x1a')]=_[_0x172c('0x1b')](config[_0x172c('0x1a')],{'host':_0x172c('0x1c'),'port':0x18eb});var socket=require(_0x172c('0x1d'))(new Redis(config[_0x172c('0x1a')]));require(_0x172c('0x1e'))[_0x172c('0x1f')](socket);function respondWithStatusCode(_0x44ae1f,_0x3c029d){_0x3c029d=_0x3c029d||0xcc;return function(_0x1c0248){if(_0x1c0248){return _0x44ae1f[_0x172c('0x20')](_0x3c029d);}return _0x44ae1f[_0x172c('0x21')](_0x3c029d)[_0x172c('0x22')]();};}function respondWithResult(_0x228642,_0x321417){_0x321417=_0x321417||0xc8;return function(_0x25ebc6){if(_0x25ebc6){return _0x228642[_0x172c('0x21')](_0x321417)[_0x172c('0x23')](_0x25ebc6);}};}function respondWithFilteredResult(_0x145ea9,_0x4aea0c){return function(_0x4eecfa){if(_0x4eecfa){var _0x53c7b9=typeof _0x4aea0c[_0x172c('0x24')]===_0x172c('0x25')&&typeof _0x4aea0c[_0x172c('0x26')]===_0x172c('0x25');var _0x323fee=_0x4eecfa['count'];var _0x572969=_0x53c7b9?0x0:_0x4aea0c[_0x172c('0x24')];var _0x45e9ca=_0x53c7b9?_0x4eecfa[_0x172c('0x27')]:_0x4aea0c[_0x172c('0x24')]+_0x4aea0c['limit'];var _0x38adc8;if(_0x45e9ca>=_0x323fee){_0x45e9ca=_0x323fee;_0x38adc8=0xc8;}else{_0x38adc8=0xce;}_0x145ea9[_0x172c('0x21')](_0x38adc8);return _0x145ea9['set'](_0x172c('0x28'),_0x572969+'-'+_0x45e9ca+'/'+_0x323fee)[_0x172c('0x23')](_0x4eecfa);}return null;};}function patchUpdates(_0x9e7f27){return function(_0x3a2804){try{jsonpatch['apply'](_0x3a2804,_0x9e7f27,!![]);}catch(_0x107439){return BPromise['reject'](_0x107439);}return _0x3a2804[_0x172c('0x29')]();};}function saveUpdates(_0x528a2b,_0x136e58){return function(_0x227a72){if(_0x227a72){return _0x227a72[_0x172c('0x2a')](_0x528a2b)['then'](function(_0x69ce4d){return _0x69ce4d;});}return null;};}function removeEntity(_0x15baf5,_0x41281e){return function(_0x3a0436){if(_0x3a0436){return _0x3a0436['destroy']()['then'](function(){var _0x4b90fa=_0x3a0436['get']({'plain':!![]});var _0x223173=_0x172c('0x2b');return db['UserProfileResource'][_0x172c('0x2c')]({'where':{'type':_0x223173,'resourceId':_0x4b90fa['id']}})[_0x172c('0x2d')](function(){return _0x3a0436;});})[_0x172c('0x2d')](function(){_0x15baf5['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1ad535,_0x3f2a58){return function(_0x1f1319){if(!_0x1f1319){_0x1ad535[_0x172c('0x20')](0x194);}return _0x1f1319;};}function handleError(_0x3fdce8,_0x5dab09){_0x5dab09=_0x5dab09||0x1f4;return function(_0x35a814){logger[_0x172c('0x2e')](_0x35a814[_0x172c('0x2f')]);if(_0x35a814['name']){delete _0x35a814['name'];}_0x3fdce8[_0x172c('0x21')](_0x5dab09)['send'](_0x35a814);};}exports[_0x172c('0x30')]=function(_0x58d63c,_0x2f4b3f){var _0x24a2d2={},_0x300900={},_0x350479={'count':0x0,'rows':[]};var _0x5f00e7=_[_0x172c('0x31')](db[_0x172c('0x32')][_0x172c('0x33')],function(_0x4509a0){return{'name':_0x4509a0['fieldName'],'type':_0x4509a0[_0x172c('0x34')]['key']};});_0x300900['model']=_[_0x172c('0x31')](_0x5f00e7,_0x172c('0x35'));_0x300900[_0x172c('0x36')]=_['keys'](_0x58d63c[_0x172c('0x36')]);_0x300900[_0x172c('0x37')]=_[_0x172c('0x38')](_0x300900[_0x172c('0x39')],_0x300900['query']);_0x24a2d2[_0x172c('0x3a')]=_['intersection'](_0x300900[_0x172c('0x39')],qs[_0x172c('0x3b')](_0x58d63c[_0x172c('0x36')][_0x172c('0x3b')]));_0x24a2d2[_0x172c('0x3a')]=_0x24a2d2[_0x172c('0x3a')]['length']?_0x24a2d2[_0x172c('0x3a')]:_0x300900[_0x172c('0x39')];if(!_0x58d63c[_0x172c('0x36')][_0x172c('0x3c')]('nolimit')){_0x24a2d2[_0x172c('0x26')]=qs[_0x172c('0x26')](_0x58d63c[_0x172c('0x36')][_0x172c('0x26')]);_0x24a2d2['offset']=qs[_0x172c('0x24')](_0x58d63c[_0x172c('0x36')][_0x172c('0x24')]);}_0x24a2d2[_0x172c('0x3d')]=qs['sort'](_0x58d63c[_0x172c('0x36')][_0x172c('0x3e')]);_0x24a2d2['where']=qs[_0x172c('0x37')](_['pick'](_0x58d63c[_0x172c('0x36')],_0x300900[_0x172c('0x37')]),_0x5f00e7);if(_0x58d63c[_0x172c('0x36')]['filter']){_0x24a2d2['where']=_['merge'](_0x24a2d2[_0x172c('0x3f')],{'$or':_[_0x172c('0x31')](_0x5f00e7,function(_0x473c5){if(_0x473c5[_0x172c('0x34')]!==_0x172c('0x40')){var _0x577c56={};_0x577c56[_0x473c5['name']]={'$like':'%'+_0x58d63c[_0x172c('0x36')][_0x172c('0x41')]+'%'};return _0x577c56;}})});}_0x24a2d2=_['merge']({},_0x24a2d2,_0x58d63c[_0x172c('0x42')]);var _0x8a3cfd={'where':_0x24a2d2[_0x172c('0x3f')]};return db['FaxQueue']['count'](_0x8a3cfd)[_0x172c('0x2d')](function(_0x21b0a0){_0x350479[_0x172c('0x27')]=_0x21b0a0;if(_0x58d63c[_0x172c('0x36')]['includeAll']){_0x24a2d2[_0x172c('0x43')]=[{'all':!![]}];}return db[_0x172c('0x32')][_0x172c('0x44')](_0x24a2d2);})['then'](function(_0x3863ec){_0x350479[_0x172c('0x45')]=_0x3863ec;return _0x350479;})[_0x172c('0x2d')](respondWithFilteredResult(_0x2f4b3f,_0x24a2d2))[_0x172c('0x46')](handleError(_0x2f4b3f,null));};exports['show']=function(_0x399a36,_0x5ab9c9){var _0x3f4769={'raw':!![],'where':{'id':_0x399a36[_0x172c('0x47')]['id']}},_0x14ccec={};_0x14ccec[_0x172c('0x39')]=_[_0x172c('0x48')](db['FaxQueue']['rawAttributes']);_0x14ccec[_0x172c('0x36')]=_[_0x172c('0x48')](_0x399a36[_0x172c('0x36')]);_0x14ccec['filters']=_[_0x172c('0x38')](_0x14ccec[_0x172c('0x39')],_0x14ccec[_0x172c('0x36')]);_0x3f4769[_0x172c('0x3a')]=_[_0x172c('0x38')](_0x14ccec[_0x172c('0x39')],qs[_0x172c('0x3b')](_0x399a36['query'][_0x172c('0x3b')]));_0x3f4769[_0x172c('0x3a')]=_0x3f4769['attributes'][_0x172c('0x49')]?_0x3f4769[_0x172c('0x3a')]:_0x14ccec['model'];if(_0x399a36[_0x172c('0x36')][_0x172c('0x4a')]){_0x3f4769[_0x172c('0x43')]=[{'all':!![]}];}_0x3f4769=_['merge']({},_0x3f4769,_0x399a36[_0x172c('0x42')]);return db[_0x172c('0x32')][_0x172c('0x4b')](_0x3f4769)[_0x172c('0x2d')](handleEntityNotFound(_0x5ab9c9,null))[_0x172c('0x2d')](respondWithResult(_0x5ab9c9,null))['catch'](handleError(_0x5ab9c9,null));};exports[_0x172c('0x4c')]=function(_0x1c4ee8,_0x2e6e88){return db['FaxQueue'][_0x172c('0x4c')](_0x1c4ee8[_0x172c('0x4d')],{})[_0x172c('0x2d')](function(_0x156dcf){var _0x2de425=_0x1c4ee8[_0x172c('0x4e')][_0x172c('0x4f')]({'plain':!![]});if(!_0x2de425)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2de425[_0x172c('0x50')]===_0x172c('0x4e')){var _0x150f9a=_0x156dcf['get']({'plain':!![]});var _0x212a85='FaxQueues';return db[_0x172c('0x51')]['find']({'where':{'name':_0x212a85,'userProfileId':_0x2de425[_0x172c('0x52')]},'raw':!![]})[_0x172c('0x2d')](function(_0xf1830f){if(_0xf1830f&&_0xf1830f['autoAssociation']===0x0){return db[_0x172c('0x53')]['create']({'name':_0x150f9a[_0x172c('0x35')],'resourceId':_0x150f9a['id'],'type':_0xf1830f['name'],'sectionId':_0xf1830f['id']},{})[_0x172c('0x2d')](function(){return _0x156dcf;});}else{return _0x156dcf;}})[_0x172c('0x46')](function(_0x540b1b){logger[_0x172c('0x2e')](_0x172c('0x54'),_0x540b1b);throw _0x540b1b;});}return _0x156dcf;})[_0x172c('0x2d')](respondWithResult(_0x2e6e88,0xc9))[_0x172c('0x46')](handleError(_0x2e6e88,null));};exports[_0x172c('0x2a')]=function(_0x43917a,_0x3af84e){if(_0x43917a['body']['id']){delete _0x43917a['body']['id'];}return db[_0x172c('0x32')][_0x172c('0x4b')]({'where':{'id':_0x43917a[_0x172c('0x47')]['id']}})[_0x172c('0x2d')](handleEntityNotFound(_0x3af84e,null))[_0x172c('0x2d')](saveUpdates(_0x43917a[_0x172c('0x4d')],null))[_0x172c('0x2d')](respondWithResult(_0x3af84e,null))[_0x172c('0x46')](handleError(_0x3af84e,null));};exports[_0x172c('0x2c')]=function(_0x4f6848,_0x23ac18){return db[_0x172c('0x32')][_0x172c('0x4b')]({'where':{'id':_0x4f6848[_0x172c('0x47')]['id']}})[_0x172c('0x2d')](handleEntityNotFound(_0x23ac18,null))[_0x172c('0x2d')](removeEntity(_0x23ac18,null))[_0x172c('0x46')](handleError(_0x23ac18,null));};exports['describe']=function(_0x96c148,_0x593786){return db['FaxQueue'][_0x172c('0x55')]()['then'](respondWithResult(_0x593786,null))['catch'](handleError(_0x593786,null));};exports[_0x172c('0x56')]=function(_0x1efc66,_0x583294,_0xddbfc){var _0xd6b350={'raw':!![],'where':{}},_0x3c27d2={},_0x59f618;return db[_0x172c('0x32')][_0x172c('0x57')]({'where':{'id':_0x1efc66['params']['id']}})[_0x172c('0x2d')](handleEntityNotFound(_0x583294,null))['then'](function(_0x4a7030){if(_0x4a7030){_0x59f618=_0x4a7030[_0x172c('0x4f')]({'plain':!![]});_0x3c27d2[_0x172c('0x39')]=_[_0x172c('0x48')](db[_0x172c('0x58')]['rawAttributes']);_0x3c27d2[_0x172c('0x36')]=_[_0x172c('0x48')](_0x1efc66[_0x172c('0x36')]);_0x3c27d2['filters']=_[_0x172c('0x38')](_0x3c27d2[_0x172c('0x39')],_0x3c27d2[_0x172c('0x36')]);_0xd6b350[_0x172c('0x3a')]=_[_0x172c('0x38')](_0x3c27d2['model'],qs[_0x172c('0x3b')](_0x1efc66[_0x172c('0x36')][_0x172c('0x3b')]));_0xd6b350[_0x172c('0x3a')]=_0xd6b350['attributes']['length']?_0xd6b350[_0x172c('0x3a')]:_0x3c27d2[_0x172c('0x39')];if(!_0x1efc66['query'][_0x172c('0x3c')](_0x172c('0x59'))){_0xd6b350['limit']=qs[_0x172c('0x26')](_0x1efc66[_0x172c('0x36')][_0x172c('0x26')]);_0xd6b350['offset']=qs[_0x172c('0x24')](_0x1efc66['query'][_0x172c('0x24')]);}_0xd6b350[_0x172c('0x3d')]=qs[_0x172c('0x3e')](_0x1efc66['query'][_0x172c('0x3e')]);_0xd6b350[_0x172c('0x3f')]=qs[_0x172c('0x37')](_[_0x172c('0x5a')](_0x1efc66['query'],_0x3c27d2['filters']));_0xd6b350[_0x172c('0x3f')][_0x172c('0x5b')]=_0x4a7030['id'];if(_0x1efc66[_0x172c('0x36')][_0x172c('0x41')]){_0xd6b350['where']=_[_0x172c('0x5c')](_0xd6b350[_0x172c('0x3f')],{'$or':_[_0x172c('0x31')](_0xd6b350[_0x172c('0x3a')],function(_0x1e3130){var _0x4de5d4={};_0x4de5d4[_0x1e3130]={'$like':'%'+_0x1efc66[_0x172c('0x36')][_0x172c('0x41')]+'%'};return _0x4de5d4;})});}_0xd6b350=_[_0x172c('0x5c')]({},_0xd6b350,_0x1efc66[_0x172c('0x42')]);return db[_0x172c('0x58')][_0x172c('0x44')](_0xd6b350);}})['then'](function(_0x200737){if(_0x200737){return db[_0x172c('0x5d')][_0x172c('0x5e')]({'where':{'id':_['map'](_0x200737,_0x172c('0x5f')),'role':'agent'},'attributes':['id',_0x172c('0x35'),_0x172c('0x60'),_0x172c('0x61'),_0x172c('0x62')]});}})[_0x172c('0x2d')](function(_0x4fe94c){if(_0x4fe94c){return{'count':_0x4fe94c[_0x172c('0x27')],'rows':_[_0x172c('0x31')](_0x4fe94c['rows'],function(_0x6385cb){return{'membername':_0x6385cb['name'],'UserId':_0x6385cb['id'],'queue_name':_0x59f618[_0x172c('0x35')],'FaxQueueId':_0x59f618['id'],'interface':util[_0x172c('0x63')](_0x172c('0x64'),_0x172c('0x65'),_0x6385cb[_0x172c('0x35')]),'penalty':0x0,'paused':_0x6385cb[_0x172c('0x60')],'createdAt':_0x6385cb[_0x172c('0x62')],'updatedAt':_0x6385cb[_0x172c('0x61')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x172c('0x2d')](respondWithFilteredResult(_0x583294,_0xd6b350))['catch'](handleError(_0x583294,null));};exports[_0x172c('0x66')]=function(_0x4cdfbd,_0x3012c7,_0x3a4d2d){var _0xf225ac={};var _0x270543={};var _0x47d0f9;var _0x2f3ec1;return db[_0x172c('0x32')][_0x172c('0x57')]({'where':{'id':_0x4cdfbd['params']['id']}})['then'](handleEntityNotFound(_0x3012c7,null))[_0x172c('0x2d')](function(_0xa24888){if(_0xa24888){_0x47d0f9=_0xa24888;_0x270543[_0x172c('0x39')]=_[_0x172c('0x48')](db[_0x172c('0x67')][_0x172c('0x33')]);_0x270543[_0x172c('0x36')]=_[_0x172c('0x48')](_0x4cdfbd['query']);_0x270543[_0x172c('0x37')]=_[_0x172c('0x38')](_0x270543[_0x172c('0x39')],_0x270543[_0x172c('0x36')]);_0xf225ac[_0x172c('0x3a')]=_['intersection'](_0x270543[_0x172c('0x39')],qs[_0x172c('0x3b')](_0x4cdfbd[_0x172c('0x36')][_0x172c('0x3b')]));_0xf225ac['attributes']=_0xf225ac[_0x172c('0x3a')][_0x172c('0x49')]?_0xf225ac[_0x172c('0x3a')]:_0x270543[_0x172c('0x39')];_0xf225ac[_0x172c('0x3d')]=qs[_0x172c('0x3e')](_0x4cdfbd[_0x172c('0x36')]['sort']);_0xf225ac[_0x172c('0x3f')]=qs['filters'](_[_0x172c('0x5a')](_0x4cdfbd['query'],_0x270543[_0x172c('0x37')]));if(_0x4cdfbd['query'][_0x172c('0x41')]){_0xf225ac[_0x172c('0x3f')]=_[_0x172c('0x5c')](_0xf225ac['where'],{'$or':_[_0x172c('0x31')](_0xf225ac[_0x172c('0x3a')],function(_0x7c6e59){var _0x2983b2={};_0x2983b2[_0x7c6e59]={'$like':'%'+_0x4cdfbd['query'][_0x172c('0x41')]+'%'};return _0x2983b2;})});}_0xf225ac=_[_0x172c('0x5c')]({},_0xf225ac,_0x4cdfbd[_0x172c('0x42')]);return _0x47d0f9[_0x172c('0x66')](_0xf225ac);}})[_0x172c('0x2d')](function(_0x3c150c){if(_0x3c150c){_0x2f3ec1=_0x3c150c[_0x172c('0x49')];if(!_0x4cdfbd['query']['hasOwnProperty'](_0x172c('0x59'))){_0xf225ac['limit']=qs['limit'](_0x4cdfbd[_0x172c('0x36')][_0x172c('0x26')]);_0xf225ac[_0x172c('0x24')]=qs[_0x172c('0x24')](_0x4cdfbd['query'][_0x172c('0x24')]);}return _0x47d0f9[_0x172c('0x66')](_0xf225ac);}})['then'](function(_0x2234ae){if(_0x2234ae){return _0x2234ae?{'count':_0x2f3ec1,'rows':_0x2234ae}:null;}})[_0x172c('0x2d')](respondWithResult(_0x3012c7,null))[_0x172c('0x46')](handleError(_0x3012c7,null));};exports['addTeams']=function(_0xe6a037,_0x5c161e,_0x9da24e){var _0xf21ea7=_0xe6a037[_0x172c('0x4d')][_0x172c('0x68')];return db[_0x172c('0x67')][_0x172c('0x44')]({'where':{'id':_0xf21ea7},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0x172c('0x35'),_0x172c('0x69'),_0x172c('0x6a'),_0x172c('0x6b')],'raw':!![]}]})[_0x172c('0x2d')](function(_0x5d382e){if(_0x5d382e){var _0x33daff=_['flatMap'](_0x5d382e,function(_0x4d73ef){var _0x1589ae=_0x4d73ef[_0x172c('0x4f')]({'plain':!![]});return _0x1589ae[_0x172c('0x6c')];});return db['FaxQueue'][_0x172c('0x4b')]({'where':{'id':_0xe6a037[_0x172c('0x47')]['id']}})[_0x172c('0x2d')](function(_0x1fb5e9){return db[_0x172c('0x6d')][_0x172c('0x6e')](function(_0x263ed3){return _0x1fb5e9[_0x172c('0x6f')](_0xf21ea7,{'transaction':_0x263ed3})[_0x172c('0x2d')](function(){return BPromise[_0x172c('0x70')](_0x33daff,function(_0x2a9328){return db[_0x172c('0x58')]['findOrCreate']({'where':{'UserId':_0x2a9328['id'],'FaxQueueId':_0xe6a037[_0x172c('0x47')]['id']},'transaction':_0x263ed3});});})[_0x172c('0x2d')](function(){_0x33daff[_0x172c('0x71')](function(_0xc1cfa7){socket[_0x172c('0x72')]('userFaxQueue:save',{'UserId':_0xc1cfa7['id'],'FaxQueueId':_0x1fb5e9['id']});});});});});}})[_0x172c('0x2d')](respondWithStatusCode(_0x5c161e,null))['catch'](handleError(_0x5c161e,null));};exports[_0x172c('0x73')]=function(_0x1c0be0,_0x2ed8f4,_0x2aabdd){return db['Team'][_0x172c('0x44')]({'where':{'id':_0x1c0be0[_0x172c('0x36')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0x172c('0x6c'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x2ed8f4,null))[_0x172c('0x2d')](function(_0x5a710e){var _0x3e24f3=_[_0x172c('0x31')](_0x5a710e,'id');var _0x26f1d0=[];var _0x171c6c=[];var _0xa2c20=squel[_0x172c('0x74')]();_0xa2c20[_0x172c('0x75')](_0x172c('0x76'))[_0x172c('0x77')]('team_has_fax_queues','tq')[_0x172c('0x78')](_0x172c('0x79'),'ut',_0x172c('0x7a'))[_0x172c('0x3f')](_0x172c('0x7b'),_0x1c0be0[_0x172c('0x47')]['id']);for(var _0x1e153d=0x0;_0x1e153d<_0x5a710e[_0x172c('0x49')];_0x1e153d+=0x1){let _0x334b05=_0x5a710e[_0x1e153d];for(var _0x117e2b=0x0;_0x117e2b<_0x334b05[_0x172c('0x6c')][_0x172c('0x49')];_0x117e2b+=0x1){let _0xa1f30f=_0x334b05[_0x172c('0x6c')][_0x117e2b];var _0x3fa01e=_0xa2c20[_0x172c('0x7c')]();_0x3fa01e[_0x172c('0x3f')](_0x172c('0x7d'),_0xa1f30f['id']);_0x171c6c[_0x172c('0x7e')](db[_0x172c('0x6d')][_0x172c('0x36')](_0x3fa01e[_0x172c('0x7f')](),{'type':db['sequelize'][_0x172c('0x80')]['SELECT']})['then'](function(_0x3ab983){if(_0x3ab983['length']===0x1){return _0xa1f30f['id'];}else{var _0x20ac69=_['every'](_[_0x172c('0x31')](_0x3ab983,_0x172c('0x81')),function(_0x3145e6){return _['includes'](_0x3e24f3,_0x3145e6);});if(_0x20ac69){return _0xa1f30f['id'];}}}));}}return BPromise[_0x172c('0x82')](_0x171c6c)['then'](function(_0x105878){_0x26f1d0=_(_0x26f1d0)[_0x172c('0x83')](_0x105878)[_0x172c('0x84')]()[_0x172c('0x85')]();return db[_0x172c('0x32')][_0x172c('0x4b')]({'where':{'id':_0x1c0be0['params']['id']}})[_0x172c('0x2d')](function(_0x35d7d1){return db[_0x172c('0x6d')][_0x172c('0x6e')](function(_0x19392c){return _0x35d7d1[_0x172c('0x73')](_0x1c0be0['query'][_0x172c('0x68')],{'transaction':_0x19392c})[_0x172c('0x2d')](function(){if(!_[_0x172c('0x86')](_0x26f1d0)){return _0x35d7d1[_0x172c('0x87')](_0x26f1d0,{'transaction':_0x19392c});}})[_0x172c('0x2d')](function(){_0x26f1d0[_0x172c('0x71')](function(_0x781379){socket['emit'](_0x172c('0x88'),{'UserId':_0x781379,'FaxQueueId':_0x35d7d1['id']});});});});});});})[_0x172c('0x2d')](respondWithStatusCode(_0x2ed8f4,null))[_0x172c('0x46')](handleError(_0x2ed8f4,null));};exports[_0x172c('0x89')]=function(_0x2f5bf2,_0x1625eb,_0x28498d){return db[_0x172c('0x32')][_0x172c('0x4b')]({'where':{'id':_0x2f5bf2[_0x172c('0x47')]['id']}})[_0x172c('0x2d')](handleEntityNotFound(_0x1625eb,null))[_0x172c('0x2d')](function(_0x27ceb6){if(_0x27ceb6){return _0x27ceb6[_0x172c('0x89')](_0x2f5bf2[_0x172c('0x4d')][_0x172c('0x68')],_[_0x172c('0x8a')](_0x2f5bf2['body'],['ids','id'])||{})[_0x172c('0x8b')](function(_0x2eb7c3){for(var _0xa9167d=0x0;_0xa9167d<_0x2f5bf2[_0x172c('0x4d')][_0x172c('0x68')][_0x172c('0x49')];_0xa9167d+=0x1){socket[_0x172c('0x72')](_0x172c('0x8c'),{'UserId':Number(_0x2f5bf2[_0x172c('0x4d')][_0x172c('0x68')][_0xa9167d]),'FaxQueueId':Number(_0x2f5bf2[_0x172c('0x47')]['id'])});}return _0x2eb7c3;});}})[_0x172c('0x2d')](respondWithResult(_0x1625eb,null))[_0x172c('0x46')](handleError(_0x1625eb,null));};exports[_0x172c('0x87')]=function(_0x4702c6,_0x4c4f63,_0x113cc8){return db[_0x172c('0x32')][_0x172c('0x4b')]({'where':{'id':_0x4702c6[_0x172c('0x47')]['id']}})[_0x172c('0x2d')](handleEntityNotFound(_0x4c4f63,null))[_0x172c('0x2d')](function(_0x5576f8){if(_0x5576f8){return _0x5576f8[_0x172c('0x87')](_0x4702c6['query']['ids'])[_0x172c('0x2d')](function(){if(_[_0x172c('0x8d')](_0x4702c6[_0x172c('0x36')]['ids'])){for(var _0x1af72e=0x0;_0x1af72e<_0x4702c6[_0x172c('0x36')][_0x172c('0x68')][_0x172c('0x49')];_0x1af72e+=0x1){socket[_0x172c('0x72')](_0x172c('0x88'),{'UserId':Number(_0x4702c6[_0x172c('0x36')][_0x172c('0x68')][_0x1af72e]),'FaxQueueId':Number(_0x4702c6[_0x172c('0x47')]['id'])});}}else{socket['emit'](_0x172c('0x88'),{'UserId':Number(_0x4702c6[_0x172c('0x36')][_0x172c('0x68')]),'FaxQueueId':Number(_0x4702c6['params']['id'])});}});}})[_0x172c('0x2d')](respondWithStatusCode(_0x4c4f63,null))[_0x172c('0x46')](handleError(_0x4c4f63,null));};exports['getAgents']=function(_0x176551,_0x41d9e1,_0x5163bd){var _0x515fba={};var _0x26aea7={};var _0xb1ac92;var _0x37f8e3;return db[_0x172c('0x32')][_0x172c('0x57')]({'where':{'id':_0x176551['params']['id']}})[_0x172c('0x2d')](handleEntityNotFound(_0x41d9e1,null))[_0x172c('0x2d')](function(_0x3c6f75){if(_0x3c6f75){_0xb1ac92=_0x3c6f75;_0x26aea7[_0x172c('0x39')]=_[_0x172c('0x48')](db['User'][_0x172c('0x33')]);_0x26aea7[_0x172c('0x36')]=_['keys'](_0x176551[_0x172c('0x36')]);_0x26aea7['filters']=_['intersection'](_0x26aea7[_0x172c('0x39')],_0x26aea7[_0x172c('0x36')]);_0x515fba[_0x172c('0x3a')]=_[_0x172c('0x38')](_0x26aea7['model'],qs['fields'](_0x176551['query'][_0x172c('0x3b')]));_0x515fba['attributes']=_0x515fba['attributes'][_0x172c('0x49')]?_0x515fba[_0x172c('0x3a')]:_0x26aea7[_0x172c('0x39')];_0x515fba[_0x172c('0x3d')]=qs['sort'](_0x176551[_0x172c('0x36')][_0x172c('0x3e')]);_0x515fba[_0x172c('0x3f')]=qs[_0x172c('0x37')](_['pick'](_0x176551[_0x172c('0x36')],_0x26aea7[_0x172c('0x37')]));if(_0x176551[_0x172c('0x36')][_0x172c('0x41')]){_0x515fba[_0x172c('0x3f')]=_[_0x172c('0x5c')](_0x515fba[_0x172c('0x3f')],{'$or':_['map'](_0x515fba[_0x172c('0x3a')],function(_0x1367c4){var _0x40b54f={};_0x40b54f[_0x1367c4]={'$like':'%'+_0x176551[_0x172c('0x36')][_0x172c('0x41')]+'%'};return _0x40b54f;})});}_0x515fba=_[_0x172c('0x5c')]({},_0x515fba,_0x176551[_0x172c('0x42')]);return _0xb1ac92[_0x172c('0x8e')](_0x515fba);}})[_0x172c('0x2d')](function(_0x5a3c7a){if(_0x5a3c7a){_0x37f8e3=_0x5a3c7a[_0x172c('0x49')];if(!_0x176551[_0x172c('0x36')][_0x172c('0x3c')](_0x172c('0x59'))){_0x515fba[_0x172c('0x26')]=qs[_0x172c('0x26')](_0x176551[_0x172c('0x36')][_0x172c('0x26')]);_0x515fba['offset']=qs[_0x172c('0x24')](_0x176551['query'][_0x172c('0x24')]);}return _0xb1ac92['getAgents'](_0x515fba);}})[_0x172c('0x2d')](function(_0x368127){if(_0x368127){return _0x368127?{'count':_0x37f8e3,'rows':_0x368127}:null;}})[_0x172c('0x2d')](respondWithResult(_0x41d9e1,null))[_0x172c('0x46')](handleError(_0x41d9e1,null));}; \ No newline at end of file +var _0x22f9=['desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/license/util','redis','defaults','socket.io-emitter','./faxQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','then','get','UserProfileResource','destroy','error','name','send','index','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','where','pick','filter','merge','map','VIRTUAL','options','FaxQueue','includeAll','include','findAll','rows','catch','show','params','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','FaxQueues','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','findOne','UserFaxQueue','nolimit','order','sort','FaxQueueId','User','findAndCountAll','UserId','agent','faxPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','emit','userFaxQueue:save','removeTeams','select','field','team_has_fax_queues','join','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','includes','all','compact','isEmpty','removeAgents','forEach','userFaxQueue:remove','omit','spread','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce'];(function(_0x4dd6e2,_0x39aea1){var _0x29a04c=function(_0x2fa165){while(--_0x2fa165){_0x4dd6e2['push'](_0x4dd6e2['shift']());}};_0x29a04c(++_0x39aea1);}(_0x22f9,0x193));var _0x922f=function(_0xa6f3ff,_0x243953){_0xa6f3ff=_0xa6f3ff-0x0;var _0xdbacc9=_0x22f9[_0xa6f3ff];return _0xdbacc9;};'use strict';var emlformat=require(_0x922f('0x0'));var rimraf=require(_0x922f('0x1'));var zipdir=require(_0x922f('0x2'));var jsonpatch=require(_0x922f('0x3'));var rp=require(_0x922f('0x4'));var moment=require(_0x922f('0x5'));var BPromise=require(_0x922f('0x6'));var Mustache=require(_0x922f('0x7'));var util=require(_0x922f('0x8'));var path=require(_0x922f('0x9'));var sox=require('sox');var csv=require(_0x922f('0xa'));var ejs=require(_0x922f('0xb'));var fs=require('fs');var fs_extra=require(_0x922f('0xc'));var _=require(_0x922f('0xd'));var squel=require(_0x922f('0xe'));var crypto=require(_0x922f('0xf'));var jsforce=require(_0x922f('0x10'));var deskjs=require(_0x922f('0x11'));var toCsv=require(_0x922f('0xa'));var querystring=require(_0x922f('0x12'));var Papa=require('papaparse');var Redis=require(_0x922f('0x13'));var authService=require(_0x922f('0x14'));var qs=require(_0x922f('0x15'));var as=require(_0x922f('0x16'));var hardwareService=require(_0x922f('0x17'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x922f('0x18'));var db=require('../../mysqldb')['db'];config[_0x922f('0x19')]=_[_0x922f('0x1a')](config[_0x922f('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x922f('0x1b'))(new Redis(config[_0x922f('0x19')]));require(_0x922f('0x1c'))[_0x922f('0x1d')](socket);function respondWithStatusCode(_0x176fae,_0x20ffa1){_0x20ffa1=_0x20ffa1||0xcc;return function(_0x4de28f){if(_0x4de28f){return _0x176fae[_0x922f('0x1e')](_0x20ffa1);}return _0x176fae[_0x922f('0x1f')](_0x20ffa1)[_0x922f('0x20')]();};}function respondWithResult(_0x45b2c5,_0x5c859a){_0x5c859a=_0x5c859a||0xc8;return function(_0x59c922){if(_0x59c922){return _0x45b2c5['status'](_0x5c859a)[_0x922f('0x21')](_0x59c922);}};}function respondWithFilteredResult(_0x3d5d73,_0x267230){return function(_0x35574a){if(_0x35574a){var _0x327f98=typeof _0x267230[_0x922f('0x22')]===_0x922f('0x23')&&typeof _0x267230[_0x922f('0x24')]==='undefined';var _0x1f96c7=_0x35574a[_0x922f('0x25')];var _0x89f445=_0x327f98?0x0:_0x267230[_0x922f('0x22')];var _0x2978e6=_0x327f98?_0x35574a['count']:_0x267230['offset']+_0x267230[_0x922f('0x24')];var _0x491793;if(_0x2978e6>=_0x1f96c7){_0x2978e6=_0x1f96c7;_0x491793=0xc8;}else{_0x491793=0xce;}_0x3d5d73[_0x922f('0x1f')](_0x491793);return _0x3d5d73[_0x922f('0x26')](_0x922f('0x27'),_0x89f445+'-'+_0x2978e6+'/'+_0x1f96c7)[_0x922f('0x21')](_0x35574a);}return null;};}function patchUpdates(_0x6e6cd1){return function(_0x23ec67){try{jsonpatch[_0x922f('0x28')](_0x23ec67,_0x6e6cd1,!![]);}catch(_0x39566b){return BPromise[_0x922f('0x29')](_0x39566b);}return _0x23ec67['save']();};}function saveUpdates(_0x409514,_0x9bfdd0){return function(_0x58068d){if(_0x58068d){return _0x58068d['update'](_0x409514)['then'](function(_0x4e520f){return _0x4e520f;});}return null;};}function removeEntity(_0x1abd8f,_0x31fd1a){return function(_0x2e993e){if(_0x2e993e){return _0x2e993e['destroy']()[_0x922f('0x2a')](function(){var _0x38ed25=_0x2e993e[_0x922f('0x2b')]({'plain':!![]});var _0x1d588b='FaxQueues';return db[_0x922f('0x2c')][_0x922f('0x2d')]({'where':{'type':_0x1d588b,'resourceId':_0x38ed25['id']}})['then'](function(){return _0x2e993e;});})[_0x922f('0x2a')](function(){_0x1abd8f[_0x922f('0x1f')](0xcc)[_0x922f('0x20')]();});}};}function handleEntityNotFound(_0x104af3,_0x5702d9){return function(_0x110922){if(!_0x110922){_0x104af3[_0x922f('0x1e')](0x194);}return _0x110922;};}function handleError(_0x8428e4,_0x475d2a){_0x475d2a=_0x475d2a||0x1f4;return function(_0x14e16d){logger[_0x922f('0x2e')](_0x14e16d['stack']);if(_0x14e16d[_0x922f('0x2f')]){delete _0x14e16d['name'];}_0x8428e4['status'](_0x475d2a)[_0x922f('0x30')](_0x14e16d);};}exports[_0x922f('0x31')]=function(_0x3917f3,_0x19a6bc){var _0x68d860={},_0x13ae94={},_0x31e521={'count':0x0,'rows':[]};var _0x1c962d=_['map'](db['FaxQueue'][_0x922f('0x32')],function(_0x43137f){return{'name':_0x43137f[_0x922f('0x33')],'type':_0x43137f[_0x922f('0x34')]['key']};});_0x13ae94[_0x922f('0x35')]=_['map'](_0x1c962d,'name');_0x13ae94[_0x922f('0x36')]=_[_0x922f('0x37')](_0x3917f3[_0x922f('0x36')]);_0x13ae94[_0x922f('0x38')]=_['intersection'](_0x13ae94['model'],_0x13ae94[_0x922f('0x36')]);_0x68d860['attributes']=_[_0x922f('0x39')](_0x13ae94[_0x922f('0x35')],qs[_0x922f('0x3a')](_0x3917f3[_0x922f('0x36')][_0x922f('0x3a')]));_0x68d860['attributes']=_0x68d860[_0x922f('0x3b')][_0x922f('0x3c')]?_0x68d860[_0x922f('0x3b')]:_0x13ae94[_0x922f('0x35')];if(!_0x3917f3[_0x922f('0x36')][_0x922f('0x3d')]('nolimit')){_0x68d860[_0x922f('0x24')]=qs['limit'](_0x3917f3[_0x922f('0x36')][_0x922f('0x24')]);_0x68d860['offset']=qs[_0x922f('0x22')](_0x3917f3[_0x922f('0x36')][_0x922f('0x22')]);}_0x68d860['order']=qs['sort'](_0x3917f3['query']['sort']);_0x68d860[_0x922f('0x3e')]=qs[_0x922f('0x38')](_[_0x922f('0x3f')](_0x3917f3[_0x922f('0x36')],_0x13ae94['filters']),_0x1c962d);if(_0x3917f3[_0x922f('0x36')][_0x922f('0x40')]){_0x68d860['where']=_[_0x922f('0x41')](_0x68d860[_0x922f('0x3e')],{'$or':_[_0x922f('0x42')](_0x1c962d,function(_0xd7c534){if(_0xd7c534[_0x922f('0x34')]!==_0x922f('0x43')){var _0x4aa078={};_0x4aa078[_0xd7c534[_0x922f('0x2f')]]={'$like':'%'+_0x3917f3['query']['filter']+'%'};return _0x4aa078;}})});}_0x68d860=_[_0x922f('0x41')]({},_0x68d860,_0x3917f3[_0x922f('0x44')]);var _0x34423d={'where':_0x68d860['where']};return db[_0x922f('0x45')][_0x922f('0x25')](_0x34423d)[_0x922f('0x2a')](function(_0x2c9a6c){_0x31e521[_0x922f('0x25')]=_0x2c9a6c;if(_0x3917f3[_0x922f('0x36')][_0x922f('0x46')]){_0x68d860[_0x922f('0x47')]=[{'all':!![]}];}return db['FaxQueue'][_0x922f('0x48')](_0x68d860);})[_0x922f('0x2a')](function(_0x40e670){_0x31e521[_0x922f('0x49')]=_0x40e670;return _0x31e521;})[_0x922f('0x2a')](respondWithFilteredResult(_0x19a6bc,_0x68d860))[_0x922f('0x4a')](handleError(_0x19a6bc,null));};exports[_0x922f('0x4b')]=function(_0x4de1a7,_0x22c5aa){var _0x3e3b1a={'raw':!![],'where':{'id':_0x4de1a7[_0x922f('0x4c')]['id']}},_0x28c75f={};_0x28c75f['model']=_['keys'](db[_0x922f('0x45')][_0x922f('0x32')]);_0x28c75f[_0x922f('0x36')]=_[_0x922f('0x37')](_0x4de1a7[_0x922f('0x36')]);_0x28c75f['filters']=_[_0x922f('0x39')](_0x28c75f['model'],_0x28c75f['query']);_0x3e3b1a[_0x922f('0x3b')]=_[_0x922f('0x39')](_0x28c75f[_0x922f('0x35')],qs[_0x922f('0x3a')](_0x4de1a7[_0x922f('0x36')]['fields']));_0x3e3b1a[_0x922f('0x3b')]=_0x3e3b1a[_0x922f('0x3b')][_0x922f('0x3c')]?_0x3e3b1a['attributes']:_0x28c75f[_0x922f('0x35')];if(_0x4de1a7[_0x922f('0x36')]['includeAll']){_0x3e3b1a['include']=[{'all':!![]}];}_0x3e3b1a=_[_0x922f('0x41')]({},_0x3e3b1a,_0x4de1a7[_0x922f('0x44')]);return db[_0x922f('0x45')]['find'](_0x3e3b1a)['then'](handleEntityNotFound(_0x22c5aa,null))[_0x922f('0x2a')](respondWithResult(_0x22c5aa,null))['catch'](handleError(_0x22c5aa,null));};exports['create']=function(_0x3d9f04,_0x17a255){return db['FaxQueue'][_0x922f('0x4d')](_0x3d9f04['body'],{})[_0x922f('0x2a')](function(_0x414776){var _0x3793aa=_0x3d9f04['user'][_0x922f('0x2b')]({'plain':!![]});if(!_0x3793aa)throw new Error(_0x922f('0x4e'));if(_0x3793aa[_0x922f('0x4f')]==='user'){var _0x9cbd66=_0x414776['get']({'plain':!![]});var _0x3a954e=_0x922f('0x50');return db['UserProfileSection'][_0x922f('0x51')]({'where':{'name':_0x3a954e,'userProfileId':_0x3793aa['userProfileId']},'raw':!![]})[_0x922f('0x2a')](function(_0x22b8e3){if(_0x22b8e3&&_0x22b8e3[_0x922f('0x52')]===0x0){return db['UserProfileResource']['create']({'name':_0x9cbd66[_0x922f('0x2f')],'resourceId':_0x9cbd66['id'],'type':_0x22b8e3[_0x922f('0x2f')],'sectionId':_0x22b8e3['id']},{})[_0x922f('0x2a')](function(){return _0x414776;});}else{return _0x414776;}})['catch'](function(_0x231dc3){logger[_0x922f('0x2e')](_0x922f('0x53'),_0x231dc3);throw _0x231dc3;});}return _0x414776;})[_0x922f('0x2a')](respondWithResult(_0x17a255,0xc9))[_0x922f('0x4a')](handleError(_0x17a255,null));};exports[_0x922f('0x54')]=function(_0x4177c4,_0xc36e8c){if(_0x4177c4[_0x922f('0x55')]['id']){delete _0x4177c4[_0x922f('0x55')]['id'];}return db['FaxQueue'][_0x922f('0x51')]({'where':{'id':_0x4177c4[_0x922f('0x4c')]['id']}})[_0x922f('0x2a')](handleEntityNotFound(_0xc36e8c,null))[_0x922f('0x2a')](saveUpdates(_0x4177c4['body'],null))[_0x922f('0x2a')](respondWithResult(_0xc36e8c,null))[_0x922f('0x4a')](handleError(_0xc36e8c,null));};exports[_0x922f('0x2d')]=function(_0x6a2f50,_0x3f6258){return db[_0x922f('0x45')][_0x922f('0x51')]({'where':{'id':_0x6a2f50[_0x922f('0x4c')]['id']}})[_0x922f('0x2a')](handleEntityNotFound(_0x3f6258,null))[_0x922f('0x2a')](removeEntity(_0x3f6258,null))[_0x922f('0x4a')](handleError(_0x3f6258,null));};exports['describe']=function(_0x5b0230,_0x1ea06b){return db[_0x922f('0x45')]['describe']()[_0x922f('0x2a')](respondWithResult(_0x1ea06b,null))[_0x922f('0x4a')](handleError(_0x1ea06b,null));};exports['getMembers']=function(_0x439354,_0x323246,_0x5ec3b2){var _0x4413df={'raw':!![],'where':{}},_0x5826b6={},_0x47464a;return db[_0x922f('0x45')][_0x922f('0x56')]({'where':{'id':_0x439354[_0x922f('0x4c')]['id']}})['then'](handleEntityNotFound(_0x323246,null))[_0x922f('0x2a')](function(_0x4e94ff){if(_0x4e94ff){_0x47464a=_0x4e94ff[_0x922f('0x2b')]({'plain':!![]});_0x5826b6[_0x922f('0x35')]=_['keys'](db[_0x922f('0x57')][_0x922f('0x32')]);_0x5826b6[_0x922f('0x36')]=_[_0x922f('0x37')](_0x439354['query']);_0x5826b6['filters']=_['intersection'](_0x5826b6[_0x922f('0x35')],_0x5826b6['query']);_0x4413df[_0x922f('0x3b')]=_[_0x922f('0x39')](_0x5826b6[_0x922f('0x35')],qs['fields'](_0x439354['query']['fields']));_0x4413df[_0x922f('0x3b')]=_0x4413df[_0x922f('0x3b')][_0x922f('0x3c')]?_0x4413df[_0x922f('0x3b')]:_0x5826b6[_0x922f('0x35')];if(!_0x439354[_0x922f('0x36')][_0x922f('0x3d')](_0x922f('0x58'))){_0x4413df['limit']=qs[_0x922f('0x24')](_0x439354['query'][_0x922f('0x24')]);_0x4413df[_0x922f('0x22')]=qs['offset'](_0x439354[_0x922f('0x36')][_0x922f('0x22')]);}_0x4413df[_0x922f('0x59')]=qs['sort'](_0x439354[_0x922f('0x36')][_0x922f('0x5a')]);_0x4413df[_0x922f('0x3e')]=qs['filters'](_[_0x922f('0x3f')](_0x439354['query'],_0x5826b6['filters']));_0x4413df['where'][_0x922f('0x5b')]=_0x4e94ff['id'];if(_0x439354[_0x922f('0x36')][_0x922f('0x40')]){_0x4413df[_0x922f('0x3e')]=_[_0x922f('0x41')](_0x4413df[_0x922f('0x3e')],{'$or':_['map'](_0x4413df['attributes'],function(_0x14c922){var _0x25f9bb={};_0x25f9bb[_0x14c922]={'$like':'%'+_0x439354['query']['filter']+'%'};return _0x25f9bb;})});}_0x4413df=_['merge']({},_0x4413df,_0x439354[_0x922f('0x44')]);return db[_0x922f('0x57')][_0x922f('0x48')](_0x4413df);}})[_0x922f('0x2a')](function(_0x130976){if(_0x130976){return db[_0x922f('0x5c')][_0x922f('0x5d')]({'where':{'id':_[_0x922f('0x42')](_0x130976,_0x922f('0x5e')),'role':_0x922f('0x5f')},'attributes':['id',_0x922f('0x2f'),_0x922f('0x60'),_0x922f('0x61'),_0x922f('0x62')]});}})['then'](function(_0x39260e){if(_0x39260e){return{'count':_0x39260e['count'],'rows':_[_0x922f('0x42')](_0x39260e[_0x922f('0x49')],function(_0x1aaa2b){return{'membername':_0x1aaa2b[_0x922f('0x2f')],'UserId':_0x1aaa2b['id'],'queue_name':_0x47464a[_0x922f('0x2f')],'FaxQueueId':_0x47464a['id'],'interface':util[_0x922f('0x63')](_0x922f('0x64'),_0x922f('0x65'),_0x1aaa2b['name']),'penalty':0x0,'paused':_0x1aaa2b['faxPause'],'createdAt':_0x1aaa2b[_0x922f('0x62')],'updatedAt':_0x1aaa2b[_0x922f('0x61')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x922f('0x2a')](respondWithFilteredResult(_0x323246,_0x4413df))[_0x922f('0x4a')](handleError(_0x323246,null));};exports[_0x922f('0x66')]=function(_0x4d2be7,_0x540bf8,_0x4fbae4){var _0x2ffc6f={};var _0x323cd3={};var _0x484fd9;var _0x2bc2cf;return db[_0x922f('0x45')][_0x922f('0x56')]({'where':{'id':_0x4d2be7[_0x922f('0x4c')]['id']}})['then'](handleEntityNotFound(_0x540bf8,null))[_0x922f('0x2a')](function(_0x38e567){if(_0x38e567){_0x484fd9=_0x38e567;_0x323cd3['model']=_[_0x922f('0x37')](db[_0x922f('0x67')][_0x922f('0x32')]);_0x323cd3[_0x922f('0x36')]=_[_0x922f('0x37')](_0x4d2be7[_0x922f('0x36')]);_0x323cd3[_0x922f('0x38')]=_[_0x922f('0x39')](_0x323cd3[_0x922f('0x35')],_0x323cd3['query']);_0x2ffc6f[_0x922f('0x3b')]=_[_0x922f('0x39')](_0x323cd3['model'],qs['fields'](_0x4d2be7[_0x922f('0x36')][_0x922f('0x3a')]));_0x2ffc6f['attributes']=_0x2ffc6f[_0x922f('0x3b')][_0x922f('0x3c')]?_0x2ffc6f[_0x922f('0x3b')]:_0x323cd3[_0x922f('0x35')];_0x2ffc6f[_0x922f('0x59')]=qs['sort'](_0x4d2be7[_0x922f('0x36')][_0x922f('0x5a')]);_0x2ffc6f['where']=qs[_0x922f('0x38')](_[_0x922f('0x3f')](_0x4d2be7[_0x922f('0x36')],_0x323cd3[_0x922f('0x38')]));if(_0x4d2be7[_0x922f('0x36')]['filter']){_0x2ffc6f[_0x922f('0x3e')]=_[_0x922f('0x41')](_0x2ffc6f['where'],{'$or':_[_0x922f('0x42')](_0x2ffc6f['attributes'],function(_0x301e73){var _0x53fb55={};_0x53fb55[_0x301e73]={'$like':'%'+_0x4d2be7['query'][_0x922f('0x40')]+'%'};return _0x53fb55;})});}_0x2ffc6f=_[_0x922f('0x41')]({},_0x2ffc6f,_0x4d2be7['options']);return _0x484fd9['getTeams'](_0x2ffc6f);}})[_0x922f('0x2a')](function(_0x1add11){if(_0x1add11){_0x2bc2cf=_0x1add11[_0x922f('0x3c')];if(!_0x4d2be7[_0x922f('0x36')]['hasOwnProperty']('nolimit')){_0x2ffc6f[_0x922f('0x24')]=qs['limit'](_0x4d2be7['query']['limit']);_0x2ffc6f[_0x922f('0x22')]=qs['offset'](_0x4d2be7['query']['offset']);}return _0x484fd9['getTeams'](_0x2ffc6f);}})[_0x922f('0x2a')](function(_0x16f35a){if(_0x16f35a){return _0x16f35a?{'count':_0x2bc2cf,'rows':_0x16f35a}:null;}})[_0x922f('0x2a')](respondWithResult(_0x540bf8,null))[_0x922f('0x4a')](handleError(_0x540bf8,null));};exports[_0x922f('0x68')]=function(_0x453b05,_0x5b052f,_0x288780){var _0x29134d=_0x453b05['body'][_0x922f('0x69')];return db['Team'][_0x922f('0x48')]({'where':{'id':_0x29134d},'attributes':['id'],'include':[{'model':db['User'],'as':_0x922f('0x6a'),'attributes':['id',_0x922f('0x2f'),_0x922f('0x6b'),_0x922f('0x6c'),_0x922f('0x6d')],'raw':!![]}]})[_0x922f('0x2a')](function(_0x43e414){if(_0x43e414){var _0x2ccc89=_[_0x922f('0x6e')](_0x43e414,function(_0x3575f9){var _0x1d8567=_0x3575f9['get']({'plain':!![]});return _0x1d8567[_0x922f('0x6a')];});return db[_0x922f('0x45')][_0x922f('0x51')]({'where':{'id':_0x453b05[_0x922f('0x4c')]['id']}})['then'](function(_0x600fe7){return db[_0x922f('0x6f')][_0x922f('0x70')](function(_0x5b2426){return _0x600fe7[_0x922f('0x68')](_0x29134d,{'transaction':_0x5b2426})['then'](function(){return BPromise[_0x922f('0x71')](_0x2ccc89,function(_0x6e2df4){return db['UserFaxQueue'][_0x922f('0x72')]({'where':{'UserId':_0x6e2df4['id'],'FaxQueueId':_0x453b05[_0x922f('0x4c')]['id']},'transaction':_0x5b2426});});})[_0x922f('0x2a')](function(){_0x2ccc89['forEach'](function(_0x2a3622){socket[_0x922f('0x73')](_0x922f('0x74'),{'UserId':_0x2a3622['id'],'FaxQueueId':_0x600fe7['id']});});});});});}})[_0x922f('0x2a')](respondWithStatusCode(_0x5b052f,null))[_0x922f('0x4a')](handleError(_0x5b052f,null));};exports[_0x922f('0x75')]=function(_0x241b7f,_0x26cc10,_0x1cb454){return db[_0x922f('0x67')][_0x922f('0x48')]({'where':{'id':_0x241b7f[_0x922f('0x36')][_0x922f('0x69')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x922f('0x6a'),'attributes':['id'],'raw':!![]}]})[_0x922f('0x2a')](handleEntityNotFound(_0x26cc10,null))['then'](function(_0x3ecd57){var _0x457ca8=_[_0x922f('0x42')](_0x3ecd57,'id');var _0x2b91e8=[];var _0x240e78=[];var _0x3f6c42=squel[_0x922f('0x76')]();_0x3f6c42[_0x922f('0x77')]('tq.TeamId')['from'](_0x922f('0x78'),'tq')[_0x922f('0x79')]('user_has_teams','ut',_0x922f('0x7a'))[_0x922f('0x3e')]('FaxQueueId\x20=\x20?',_0x241b7f[_0x922f('0x4c')]['id']);for(var _0x4f0309=0x0;_0x4f0309<_0x3ecd57[_0x922f('0x3c')];_0x4f0309+=0x1){let _0x42b6ee=_0x3ecd57[_0x4f0309];for(var _0x1dc74a=0x0;_0x1dc74a<_0x42b6ee[_0x922f('0x6a')][_0x922f('0x3c')];_0x1dc74a+=0x1){let _0x4f9606=_0x42b6ee[_0x922f('0x6a')][_0x1dc74a];var _0x12c00f=_0x3f6c42[_0x922f('0x7b')]();_0x12c00f[_0x922f('0x3e')](_0x922f('0x7c'),_0x4f9606['id']);_0x240e78[_0x922f('0x7d')](db[_0x922f('0x6f')][_0x922f('0x36')](_0x12c00f['toString'](),{'type':db[_0x922f('0x6f')][_0x922f('0x7e')][_0x922f('0x7f')]})['then'](function(_0x30a373){if(_0x30a373[_0x922f('0x3c')]===0x1){return _0x4f9606['id'];}else{var _0x504ab2=_[_0x922f('0x80')](_[_0x922f('0x42')](_0x30a373,'TeamId'),function(_0x9900a0){return _[_0x922f('0x81')](_0x457ca8,_0x9900a0);});if(_0x504ab2){return _0x4f9606['id'];}}}));}}return BPromise[_0x922f('0x82')](_0x240e78)['then'](function(_0x5812d7){_0x2b91e8=_(_0x2b91e8)['union'](_0x5812d7)[_0x922f('0x83')]()['value']();return db[_0x922f('0x45')][_0x922f('0x51')]({'where':{'id':_0x241b7f[_0x922f('0x4c')]['id']}})[_0x922f('0x2a')](function(_0x5b58e2){return db[_0x922f('0x6f')][_0x922f('0x70')](function(_0x4a6bdc){return _0x5b58e2[_0x922f('0x75')](_0x241b7f[_0x922f('0x36')][_0x922f('0x69')],{'transaction':_0x4a6bdc})[_0x922f('0x2a')](function(){if(!_[_0x922f('0x84')](_0x2b91e8)){return _0x5b58e2[_0x922f('0x85')](_0x2b91e8,{'transaction':_0x4a6bdc});}})['then'](function(){_0x2b91e8[_0x922f('0x86')](function(_0x358243){socket['emit'](_0x922f('0x87'),{'UserId':_0x358243,'FaxQueueId':_0x5b58e2['id']});});});});});});})[_0x922f('0x2a')](respondWithStatusCode(_0x26cc10,null))[_0x922f('0x4a')](handleError(_0x26cc10,null));};exports['addAgents']=function(_0x5a9463,_0x18aed8,_0x531a40){return db[_0x922f('0x45')]['find']({'where':{'id':_0x5a9463[_0x922f('0x4c')]['id']}})[_0x922f('0x2a')](handleEntityNotFound(_0x18aed8,null))[_0x922f('0x2a')](function(_0x4f9714){if(_0x4f9714){return _0x4f9714['addAgents'](_0x5a9463[_0x922f('0x55')]['ids'],_[_0x922f('0x88')](_0x5a9463['body'],[_0x922f('0x69'),'id'])||{})[_0x922f('0x89')](function(_0x5eeaa2){for(var _0x5e9ca0=0x0;_0x5e9ca0<_0x5a9463[_0x922f('0x55')][_0x922f('0x69')][_0x922f('0x3c')];_0x5e9ca0+=0x1){socket[_0x922f('0x73')](_0x922f('0x74'),{'UserId':Number(_0x5a9463[_0x922f('0x55')][_0x922f('0x69')][_0x5e9ca0]),'FaxQueueId':Number(_0x5a9463[_0x922f('0x4c')]['id'])});}return _0x5eeaa2;});}})[_0x922f('0x2a')](respondWithResult(_0x18aed8,null))['catch'](handleError(_0x18aed8,null));};exports[_0x922f('0x85')]=function(_0x5a8b03,_0x348e91,_0x4e01fb){return db[_0x922f('0x45')][_0x922f('0x51')]({'where':{'id':_0x5a8b03['params']['id']}})['then'](handleEntityNotFound(_0x348e91,null))[_0x922f('0x2a')](function(_0x2feda5){if(_0x2feda5){return _0x2feda5[_0x922f('0x85')](_0x5a8b03[_0x922f('0x36')][_0x922f('0x69')])[_0x922f('0x2a')](function(){if(_[_0x922f('0x8a')](_0x5a8b03['query']['ids'])){for(var _0x1ac432=0x0;_0x1ac432<_0x5a8b03[_0x922f('0x36')][_0x922f('0x69')][_0x922f('0x3c')];_0x1ac432+=0x1){socket['emit']('userFaxQueue:remove',{'UserId':Number(_0x5a8b03[_0x922f('0x36')]['ids'][_0x1ac432]),'FaxQueueId':Number(_0x5a8b03[_0x922f('0x4c')]['id'])});}}else{socket[_0x922f('0x73')](_0x922f('0x87'),{'UserId':Number(_0x5a8b03['query'][_0x922f('0x69')]),'FaxQueueId':Number(_0x5a8b03['params']['id'])});}});}})[_0x922f('0x2a')](respondWithStatusCode(_0x348e91,null))[_0x922f('0x4a')](handleError(_0x348e91,null));};exports[_0x922f('0x8b')]=function(_0x4b5b33,_0x14dfa8,_0x54e11b){var _0x5054dd={};var _0x345af8={};var _0x3e4b18;var _0x5b9dcc;return db[_0x922f('0x45')][_0x922f('0x56')]({'where':{'id':_0x4b5b33[_0x922f('0x4c')]['id']}})['then'](handleEntityNotFound(_0x14dfa8,null))['then'](function(_0x4c7a1b){if(_0x4c7a1b){_0x3e4b18=_0x4c7a1b;_0x345af8[_0x922f('0x35')]=_[_0x922f('0x37')](db['User']['rawAttributes']);_0x345af8['query']=_[_0x922f('0x37')](_0x4b5b33[_0x922f('0x36')]);_0x345af8[_0x922f('0x38')]=_['intersection'](_0x345af8[_0x922f('0x35')],_0x345af8['query']);_0x5054dd[_0x922f('0x3b')]=_[_0x922f('0x39')](_0x345af8[_0x922f('0x35')],qs[_0x922f('0x3a')](_0x4b5b33['query']['fields']));_0x5054dd['attributes']=_0x5054dd[_0x922f('0x3b')][_0x922f('0x3c')]?_0x5054dd['attributes']:_0x345af8[_0x922f('0x35')];_0x5054dd[_0x922f('0x59')]=qs[_0x922f('0x5a')](_0x4b5b33[_0x922f('0x36')][_0x922f('0x5a')]);_0x5054dd[_0x922f('0x3e')]=qs[_0x922f('0x38')](_[_0x922f('0x3f')](_0x4b5b33['query'],_0x345af8[_0x922f('0x38')]));if(_0x4b5b33[_0x922f('0x36')][_0x922f('0x40')]){_0x5054dd[_0x922f('0x3e')]=_[_0x922f('0x41')](_0x5054dd[_0x922f('0x3e')],{'$or':_[_0x922f('0x42')](_0x5054dd[_0x922f('0x3b')],function(_0x49431d){var _0x50b75c={};_0x50b75c[_0x49431d]={'$like':'%'+_0x4b5b33[_0x922f('0x36')][_0x922f('0x40')]+'%'};return _0x50b75c;})});}_0x5054dd=_['merge']({},_0x5054dd,_0x4b5b33[_0x922f('0x44')]);return _0x3e4b18[_0x922f('0x8b')](_0x5054dd);}})[_0x922f('0x2a')](function(_0x3e543d){if(_0x3e543d){_0x5b9dcc=_0x3e543d['length'];if(!_0x4b5b33[_0x922f('0x36')][_0x922f('0x3d')]('nolimit')){_0x5054dd['limit']=qs[_0x922f('0x24')](_0x4b5b33['query']['limit']);_0x5054dd[_0x922f('0x22')]=qs[_0x922f('0x22')](_0x4b5b33[_0x922f('0x36')][_0x922f('0x22')]);}return _0x3e4b18[_0x922f('0x8b')](_0x5054dd);}})[_0x922f('0x2a')](function(_0x20dddd){if(_0x20dddd){return _0x20dddd?{'count':_0x5b9dcc,'rows':_0x20dddd}:null;}})['then'](respondWithResult(_0x14dfa8,null))[_0x922f('0x4a')](handleError(_0x14dfa8,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index 6e75c08..c903b2c 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 _0xe702=['hasOwnProperty','hook','exports','../../mysqldb','update','remove','emit'];(function(_0x38b3cb,_0x4ad7b3){var _0x5a9a84=function(_0x237634){while(--_0x237634){_0x38b3cb['push'](_0x38b3cb['shift']());}};_0x5a9a84(++_0x4ad7b3);}(_0xe702,0x96));var _0x2e70=function(_0x42245d,_0x51758f){_0x42245d=_0x42245d-0x0;var _0x4b211a=_0xe702[_0x42245d];return _0x4b211a;};'use strict';var EventEmitter=require('events');var FaxQueue=require(_0x2e70('0x0'))['db']['FaxQueue'];var FaxQueueEvents=new EventEmitter();FaxQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x2e70('0x1'),'afterDestroy':_0x2e70('0x2')};function emitEvent(_0x24de44){return function(_0x109c29,_0x4266fd,_0x4a0a36){FaxQueueEvents[_0x2e70('0x3')](_0x24de44+':'+_0x109c29['id'],_0x109c29);FaxQueueEvents[_0x2e70('0x3')](_0x24de44,_0x109c29);_0x4a0a36(null);};}for(var e in events){if(events[_0x2e70('0x4')](e)){var event=events[e];FaxQueue[_0x2e70('0x5')](e,emitEvent(event));}}module[_0x2e70('0x6')]=FaxQueueEvents; \ No newline at end of file +var _0x1dae=['../../mysqldb','FaxQueue','setMaxListeners','save','remove','hasOwnProperty','hook','exports','events'];(function(_0x43f881,_0xd6e5a2){var _0x365c14=function(_0x50d386){while(--_0x50d386){_0x43f881['push'](_0x43f881['shift']());}};_0x365c14(++_0xd6e5a2);}(_0x1dae,0xa1));var _0xe1da=function(_0x6d6c33,_0x45f6fe){_0x6d6c33=_0x6d6c33-0x0;var _0x3fd9c0=_0x1dae[_0x6d6c33];return _0x3fd9c0;};'use strict';var EventEmitter=require(_0xe1da('0x0'));var FaxQueue=require(_0xe1da('0x1'))['db'][_0xe1da('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0xe1da('0x3')](0x0);var events={'afterCreate':_0xe1da('0x4'),'afterUpdate':'update','afterDestroy':_0xe1da('0x5')};function emitEvent(_0x3ec18c){return function(_0x9cc60e,_0x2ee140,_0x25a6ca){FaxQueueEvents['emit'](_0x3ec18c+':'+_0x9cc60e['id'],_0x9cc60e);FaxQueueEvents['emit'](_0x3ec18c,_0x9cc60e);_0x25a6ca(null);};}for(var e in events){if(events[_0xe1da('0x6')](e)){var event=events[e];FaxQueue[_0xe1da('0x7')](e,emitEvent(event));}}module[_0xe1da('0x8')]=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index 188df0e..f44e9dc 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 _0xb1bf=['exports','define','fax_queues','../../config/logger','api','moment','request-promise','path','rimraf','./faxQueue.attributes'];(function(_0x250a27,_0x392265){var _0x11d3d9=function(_0x4847c2){while(--_0x4847c2){_0x250a27['push'](_0x250a27['shift']());}};_0x11d3d9(++_0x392265);}(_0xb1bf,0x175));var _0xfb1b=function(_0x93714c,_0x5906d2){_0x93714c=_0x93714c-0x0;var _0x5bc167=_0xb1bf[_0x93714c];return _0x5bc167;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xfb1b('0x0'))(_0xfb1b('0x1'));var moment=require(_0xfb1b('0x2'));var BPromise=require('bluebird');var rp=require(_0xfb1b('0x3'));var fs=require('fs');var path=require(_0xfb1b('0x4'));var rimraf=require(_0xfb1b('0x5'));var config=require('../../config/environment');var attributes=require(_0xfb1b('0x6'));module[_0xfb1b('0x7')]=function(_0x252697,_0x1021d2){return _0x252697[_0xfb1b('0x8')]('FaxQueue',attributes,{'tableName':_0xfb1b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfa11=['../../config/environment','./faxQueue.attributes','exports','define','FaxQueue','fax_queues','../../config/logger','api','bluebird','request-promise','rimraf'];(function(_0x4f162c,_0x5184f1){var _0x12d0c8=function(_0x54bc6e){while(--_0x54bc6e){_0x4f162c['push'](_0x4f162c['shift']());}};_0x12d0c8(++_0x5184f1);}(_0xfa11,0xcc));var _0x1fa1=function(_0x3341b1,_0x428e38){_0x3341b1=_0x3341b1-0x0;var _0x2260bd=_0xfa11[_0x3341b1];return _0x2260bd;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1fa1('0x0'))(_0x1fa1('0x1'));var moment=require('moment');var BPromise=require(_0x1fa1('0x2'));var rp=require(_0x1fa1('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1fa1('0x4'));var config=require(_0x1fa1('0x5'));var attributes=require(_0x1fa1('0x6'));module[_0x1fa1('0x7')]=function(_0x29d547,_0x11d1b4){return _0x29d547[_0x1fa1('0x8')](_0x1fa1('0x9'),attributes,{'tableName':_0x1fa1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.rpc.js b/server/api/faxQueue/faxQueue.rpc.js index daaeee7..6cc83de 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 _0x406b=['client','http','socket.io-emitter','redis','then','info','FaxQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','GetFaxQueue','FaxQueue','findAll','options','raw','attributes','limit','include','map','model','debug','ShowFaxQueue','find','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x3c0000,_0x2f9529){var _0x61b963=function(_0x369757){while(--_0x369757){_0x3c0000['push'](_0x3c0000['shift']());}};_0x61b963(++_0x2f9529);}(_0x406b,0x13a));var _0xb406=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0x406b[_0x311c35];return _0x5cc50c;};'use strict';var _=require(_0xb406('0x0'));var util=require(_0xb406('0x1'));var moment=require(_0xb406('0x2'));var BPromise=require('bluebird');var rs=require(_0xb406('0x3'));var fs=require('fs');var Redis=require(_0xb406('0x4'));var db=require(_0xb406('0x5'))['db'];var utils=require(_0xb406('0x6'));var logger=require('../../config/logger')(_0xb406('0x7'));var config=require(_0xb406('0x8'));var jayson=require(_0xb406('0x9'));var client=jayson[_0xb406('0xa')][_0xb406('0xb')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xb406('0xc'))(new Redis(config[_0xb406('0xd')]));require('./faxQueue.socket')['register'](socket);function respondWithRpcPromise(_0x28dbc7,_0xaae289,_0x4d7427){return new BPromise(function(_0x54293b,_0x1ce583){return client['request'](_0x28dbc7,_0x4d7427)[_0xb406('0xe')](function(_0x4f764c){logger[_0xb406('0xf')](_0xb406('0x10'),_0xaae289,_0xb406('0x11'));logger['debug']('FaxQueue,\x20%s,\x20%s,\x20%s',_0xaae289,_0xb406('0x11'),JSON[_0xb406('0x12')](_0x4f764c));if(_0x4f764c[_0xb406('0x13')]){if(_0x4f764c[_0xb406('0x13')][_0xb406('0x14')]===0x1f4){logger[_0xb406('0x13')](_0xb406('0x10'),_0xaae289,_0x4f764c[_0xb406('0x13')][_0xb406('0x15')]);return _0x1ce583(_0x4f764c['error'][_0xb406('0x15')]);}logger['error']('FaxQueue,\x20%s,\x20%s',_0xaae289,_0x4f764c[_0xb406('0x13')][_0xb406('0x15')]);return _0x54293b(_0x4f764c['error'][_0xb406('0x15')]);}else{logger['info']('FaxQueue,\x20%s,\x20%s',_0xaae289,_0xb406('0x11'));_0x54293b(_0x4f764c['result'][_0xb406('0x15')]);}})[_0xb406('0x16')](function(_0x235e3d){logger['error']('FaxQueue,\x20%s,\x20%s',_0xaae289,_0x235e3d);_0x1ce583(_0x235e3d);});});}exports[_0xb406('0x17')]=function(_0x2da0a8){var _0x3371aa=this;return new Promise(function(_0x2263c1,_0x4e9130){return db[_0xb406('0x18')][_0xb406('0x19')]({'raw':_0x2da0a8['options']?_0x2da0a8[_0xb406('0x1a')][_0xb406('0x1b')]===undefined?!![]:![]:!![],'where':_0x2da0a8[_0xb406('0x1a')]?_0x2da0a8[_0xb406('0x1a')]['where']||null:null,'attributes':_0x2da0a8[_0xb406('0x1a')]?_0x2da0a8[_0xb406('0x1a')][_0xb406('0x1c')]||null:null,'limit':_0x2da0a8[_0xb406('0x1a')]?_0x2da0a8[_0xb406('0x1a')][_0xb406('0x1d')]||null:null,'include':_0x2da0a8[_0xb406('0x1a')]?_0x2da0a8[_0xb406('0x1a')][_0xb406('0x1e')]?_[_0xb406('0x1f')](_0x2da0a8[_0xb406('0x1a')][_0xb406('0x1e')],function(_0x268c11){return{'model':db[_0x268c11['model']],'as':_0x268c11['as'],'attributes':_0x268c11[_0xb406('0x1c')],'include':_0x268c11[_0xb406('0x1e')]?_[_0xb406('0x1f')](_0x268c11[_0xb406('0x1e')],function(_0x5416d5){return{'model':db[_0x5416d5['model']],'as':_0x5416d5['as'],'attributes':_0x5416d5[_0xb406('0x1c')],'include':_0x5416d5[_0xb406('0x1e')]?_[_0xb406('0x1f')](_0x5416d5[_0xb406('0x1e')],function(_0x4169f5){return{'model':db[_0x4169f5[_0xb406('0x20')]],'as':_0x4169f5['as'],'attributes':_0x4169f5[_0xb406('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xb406('0xe')](function(_0x3a0eaf){logger[_0xb406('0xf')]('GetFaxQueue',_0x2da0a8);logger[_0xb406('0x21')]('GetFaxQueue',_0x2da0a8,JSON['stringify'](_0x3a0eaf));_0x2263c1(_0x3a0eaf);})[_0xb406('0x16')](function(_0x252f9e){logger[_0xb406('0x13')]('GetFaxQueue',_0x252f9e[_0xb406('0x15')],_0x2da0a8);_0x4e9130(_0x3371aa['error'](0x1f4,_0x252f9e['message']));});});};exports[_0xb406('0x22')]=function(_0x2c4239){var _0x3ead0a=this;return new Promise(function(_0x2c66dd,_0x10266d){return db['FaxQueue'][_0xb406('0x23')]({'raw':_0x2c4239[_0xb406('0x1a')]?_0x2c4239[_0xb406('0x1a')][_0xb406('0x1b')]===undefined?!![]:![]:!![],'where':_0x2c4239['options']?_0x2c4239['options']['where']||null:null,'attributes':_0x2c4239[_0xb406('0x1a')]?_0x2c4239[_0xb406('0x1a')][_0xb406('0x1c')]||null:null,'include':_0x2c4239[_0xb406('0x1a')]?_0x2c4239[_0xb406('0x1a')][_0xb406('0x1e')]?_[_0xb406('0x1f')](_0x2c4239[_0xb406('0x1a')][_0xb406('0x1e')],function(_0x2e2210){return{'model':db[_0x2e2210[_0xb406('0x20')]],'as':_0x2e2210['as'],'attributes':_0x2e2210['attributes'],'include':_0x2e2210[_0xb406('0x1e')]?_['map'](_0x2e2210['include'],function(_0x1ebefb){return{'model':db[_0x1ebefb['model']],'as':_0x1ebefb['as'],'attributes':_0x1ebefb[_0xb406('0x1c')],'include':_0x1ebefb[_0xb406('0x1e')]?_[_0xb406('0x1f')](_0x1ebefb[_0xb406('0x1e')],function(_0x324703){return{'model':db[_0x324703[_0xb406('0x20')]],'as':_0x324703['as'],'attributes':_0x324703['attributes']};}):[]};}):[]};}):[]:[]})[_0xb406('0xe')](function(_0xf40762){logger[_0xb406('0xf')](_0xb406('0x22'),_0x2c4239);logger['debug'](_0xb406('0x22'),_0x2c4239,JSON[_0xb406('0x12')](_0xf40762));_0x2c66dd(_0xf40762);})[_0xb406('0x16')](function(_0x384819){logger[_0xb406('0x13')](_0xb406('0x22'),_0x384819[_0xb406('0x15')],_0x2c4239);_0x10266d(_0x3ead0a[_0xb406('0x13')](0x1f4,_0x384819[_0xb406('0x15')]));});});}; \ No newline at end of file +var _0x4a3e=['lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','localhost','request','then','info','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','error','code','message','FaxQueue,\x20%s,\x20%s','result','catch','findAll','options','raw','where','limit','include','map','model','attributes','GetFaxQueue','stringify','ShowFaxQueue','FaxQueue','find'];(function(_0x20714b,_0x4619da){var _0x3c4e68=function(_0x199a3e){while(--_0x199a3e){_0x20714b['push'](_0x20714b['shift']());}};_0x3c4e68(++_0x4619da);}(_0x4a3e,0xc3));var _0xe4a3=function(_0x4d7196,_0x17991e){_0x4d7196=_0x4d7196-0x0;var _0x254b78=_0x4a3e[_0x4d7196];return _0x254b78;};'use strict';var _=require(_0xe4a3('0x0'));var util=require(_0xe4a3('0x1'));var moment=require(_0xe4a3('0x2'));var BPromise=require(_0xe4a3('0x3'));var rs=require(_0xe4a3('0x4'));var fs=require('fs');var Redis=require(_0xe4a3('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xe4a3('0x6'));var logger=require(_0xe4a3('0x7'))(_0xe4a3('0x8'));var config=require(_0xe4a3('0x9'));var jayson=require(_0xe4a3('0xa'));var client=jayson['client']['http']({'port':0x232a});config[_0xe4a3('0xb')]=_['defaults'](config[_0xe4a3('0xb')],{'host':_0xe4a3('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe4a3('0xb')]));require('./faxQueue.socket')['register'](socket);function respondWithRpcPromise(_0x5b81c6,_0x5e9c70,_0x23efa3){return new BPromise(function(_0x305f44,_0x356270){return client[_0xe4a3('0xd')](_0x5b81c6,_0x23efa3)[_0xe4a3('0xe')](function(_0x1c313c){logger[_0xe4a3('0xf')]('FaxQueue,\x20%s,\x20%s',_0x5e9c70,_0xe4a3('0x10'));logger[_0xe4a3('0x11')](_0xe4a3('0x12'),_0x5e9c70,_0xe4a3('0x10'),JSON['stringify'](_0x1c313c));if(_0x1c313c[_0xe4a3('0x13')]){if(_0x1c313c[_0xe4a3('0x13')][_0xe4a3('0x14')]===0x1f4){logger[_0xe4a3('0x13')]('FaxQueue,\x20%s,\x20%s',_0x5e9c70,_0x1c313c[_0xe4a3('0x13')][_0xe4a3('0x15')]);return _0x356270(_0x1c313c[_0xe4a3('0x13')][_0xe4a3('0x15')]);}logger[_0xe4a3('0x13')](_0xe4a3('0x16'),_0x5e9c70,_0x1c313c[_0xe4a3('0x13')][_0xe4a3('0x15')]);return _0x305f44(_0x1c313c[_0xe4a3('0x13')]['message']);}else{logger[_0xe4a3('0xf')](_0xe4a3('0x16'),_0x5e9c70,'request\x20sent');_0x305f44(_0x1c313c[_0xe4a3('0x17')][_0xe4a3('0x15')]);}})[_0xe4a3('0x18')](function(_0x3925ba){logger[_0xe4a3('0x13')](_0xe4a3('0x16'),_0x5e9c70,_0x3925ba);_0x356270(_0x3925ba);});});}exports['GetFaxQueue']=function(_0x4378d4){var _0x3047a=this;return new Promise(function(_0x3b249b,_0x56d9a2){return db['FaxQueue'][_0xe4a3('0x19')]({'raw':_0x4378d4[_0xe4a3('0x1a')]?_0x4378d4[_0xe4a3('0x1a')][_0xe4a3('0x1b')]===undefined?!![]:![]:!![],'where':_0x4378d4[_0xe4a3('0x1a')]?_0x4378d4[_0xe4a3('0x1a')][_0xe4a3('0x1c')]||null:null,'attributes':_0x4378d4[_0xe4a3('0x1a')]?_0x4378d4[_0xe4a3('0x1a')]['attributes']||null:null,'limit':_0x4378d4[_0xe4a3('0x1a')]?_0x4378d4[_0xe4a3('0x1a')][_0xe4a3('0x1d')]||null:null,'include':_0x4378d4[_0xe4a3('0x1a')]?_0x4378d4['options'][_0xe4a3('0x1e')]?_[_0xe4a3('0x1f')](_0x4378d4[_0xe4a3('0x1a')][_0xe4a3('0x1e')],function(_0x28413d){return{'model':db[_0x28413d[_0xe4a3('0x20')]],'as':_0x28413d['as'],'attributes':_0x28413d['attributes'],'include':_0x28413d['include']?_['map'](_0x28413d[_0xe4a3('0x1e')],function(_0x38187a){return{'model':db[_0x38187a[_0xe4a3('0x20')]],'as':_0x38187a['as'],'attributes':_0x38187a[_0xe4a3('0x21')],'include':_0x38187a[_0xe4a3('0x1e')]?_[_0xe4a3('0x1f')](_0x38187a['include'],function(_0x23eed2){return{'model':db[_0x23eed2[_0xe4a3('0x20')]],'as':_0x23eed2['as'],'attributes':_0x23eed2['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x3cfafa){logger[_0xe4a3('0xf')](_0xe4a3('0x22'),_0x4378d4);logger['debug'](_0xe4a3('0x22'),_0x4378d4,JSON[_0xe4a3('0x23')](_0x3cfafa));_0x3b249b(_0x3cfafa);})[_0xe4a3('0x18')](function(_0x35b35a){logger[_0xe4a3('0x13')](_0xe4a3('0x22'),_0x35b35a[_0xe4a3('0x15')],_0x4378d4);_0x56d9a2(_0x3047a[_0xe4a3('0x13')](0x1f4,_0x35b35a[_0xe4a3('0x15')]));});});};exports[_0xe4a3('0x24')]=function(_0x75a41f){var _0x14cd73=this;return new Promise(function(_0x3b038b,_0x348476){return db[_0xe4a3('0x25')][_0xe4a3('0x26')]({'raw':_0x75a41f['options']?_0x75a41f[_0xe4a3('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x75a41f[_0xe4a3('0x1a')]?_0x75a41f[_0xe4a3('0x1a')][_0xe4a3('0x1c')]||null:null,'attributes':_0x75a41f[_0xe4a3('0x1a')]?_0x75a41f[_0xe4a3('0x1a')]['attributes']||null:null,'include':_0x75a41f['options']?_0x75a41f['options'][_0xe4a3('0x1e')]?_['map'](_0x75a41f[_0xe4a3('0x1a')][_0xe4a3('0x1e')],function(_0x559a44){return{'model':db[_0x559a44[_0xe4a3('0x20')]],'as':_0x559a44['as'],'attributes':_0x559a44[_0xe4a3('0x21')],'include':_0x559a44[_0xe4a3('0x1e')]?_[_0xe4a3('0x1f')](_0x559a44['include'],function(_0x6fb9d4){return{'model':db[_0x6fb9d4[_0xe4a3('0x20')]],'as':_0x6fb9d4['as'],'attributes':_0x6fb9d4[_0xe4a3('0x21')],'include':_0x6fb9d4['include']?_['map'](_0x6fb9d4[_0xe4a3('0x1e')],function(_0x525b15){return{'model':db[_0x525b15[_0xe4a3('0x20')]],'as':_0x525b15['as'],'attributes':_0x525b15[_0xe4a3('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x19f1a5){logger[_0xe4a3('0xf')]('ShowFaxQueue',_0x75a41f);logger[_0xe4a3('0x11')]('ShowFaxQueue',_0x75a41f,JSON[_0xe4a3('0x23')](_0x19f1a5));_0x3b038b(_0x19f1a5);})['catch'](function(_0x244178){logger[_0xe4a3('0x13')](_0xe4a3('0x24'),_0x244178['message'],_0x75a41f);_0x348476(_0x14cd73['error'](0x1f4,_0x244178[_0xe4a3('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index 9db07d8..fb1ab05 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 _0x781c=['register','length','save','remove','update','emit','removeListener'];(function(_0x3e186f,_0x2eb7be){var _0x3595bf=function(_0x5cb578){while(--_0x5cb578){_0x3e186f['push'](_0x3e186f['shift']());}};_0x3595bf(++_0x2eb7be);}(_0x781c,0x105));var _0xc781=function(_0x5b7911,_0xca8bbd){_0x5b7911=_0x5b7911-0x0;var _0x3353a9=_0x781c[_0x5b7911];return _0x3353a9;};'use strict';var FaxQueueEvents=require('./faxQueue.events');var events=[_0xc781('0x0'),_0xc781('0x1'),_0xc781('0x2')];function createListener(_0x2ff709,_0x3c73fa){return function(_0x39ec17){_0x3c73fa[_0xc781('0x3')](_0x2ff709,_0x39ec17);};}function removeListener(_0x3b01fb,_0x10272c){return function(){FaxQueueEvents[_0xc781('0x4')](_0x3b01fb,_0x10272c);};}exports[_0xc781('0x5')]=function(_0x279353){for(var _0x11adbe=0x0,_0x263c5c=events[_0xc781('0x6')];_0x11adbe<_0x263c5c;_0x11adbe++){var _0x1b4dd5=events[_0x11adbe];var _0x159ede=createListener('faxQueue:'+_0x1b4dd5,_0x279353);FaxQueueEvents['on'](_0x1b4dd5,_0x159ede);}}; \ No newline at end of file +var _0xe441=['removeListener','length','faxQueue:','./faxQueue.events','save','remove','update','emit'];(function(_0x3a5bdd,_0x34c85c){var _0x5a6fe9=function(_0x5dffcf){while(--_0x5dffcf){_0x3a5bdd['push'](_0x3a5bdd['shift']());}};_0x5a6fe9(++_0x34c85c);}(_0xe441,0xeb));var _0x1e44=function(_0x221c41,_0x4984e5){_0x221c41=_0x221c41-0x0;var _0x21e9b0=_0xe441[_0x221c41];return _0x21e9b0;};'use strict';var FaxQueueEvents=require(_0x1e44('0x0'));var events=[_0x1e44('0x1'),_0x1e44('0x2'),_0x1e44('0x3')];function createListener(_0x14e618,_0x59ee79){return function(_0x262ce7){_0x59ee79[_0x1e44('0x4')](_0x14e618,_0x262ce7);};}function removeListener(_0x1d2b7d,_0x1d1775){return function(){FaxQueueEvents[_0x1e44('0x5')](_0x1d2b7d,_0x1d1775);};}exports['register']=function(_0x388174){for(var _0x243187=0x0,_0x577851=events[_0x1e44('0x6')];_0x243187<_0x577851;_0x243187++){var _0x6fee61=events[_0x243187];var _0x55422c=createListener(_0x1e44('0x7')+_0x6fee61,_0x388174);FaxQueueEvents['on'](_0x6fee61,_0x55422c);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index f582441..e0c3874 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 _0x9536=['put','update','delete','removeTeams','removeAgents','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueue.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','create','post','addTeams','addAgents'];(function(_0x2e498d,_0x39acdf){var _0x1d3656=function(_0x1d14ea){while(--_0x1d14ea){_0x2e498d['push'](_0x2e498d['shift']());}};_0x1d3656(++_0x39acdf);}(_0x9536,0x179));var _0x6953=function(_0x4ca333,_0x1218a3){_0x4ca333=_0x4ca333-0x0;var _0x13b2e1=_0x9536[_0x4ca333];return _0x13b2e1;};'use strict';var multer=require(_0x6953('0x0'));var util=require(_0x6953('0x1'));var path=require(_0x6953('0x2'));var timeout=require(_0x6953('0x3'));var express=require('express');var router=express[_0x6953('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x6953('0x5'));var interaction=require(_0x6953('0x6'));var config=require(_0x6953('0x7'));var controller=require(_0x6953('0x8'));router[_0x6953('0x9')]('/',auth['isAuthenticated'](),controller[_0x6953('0xa')]);router[_0x6953('0x9')](_0x6953('0xb'),auth[_0x6953('0xc')](),controller[_0x6953('0xd')]);router['get'](_0x6953('0xe'),auth[_0x6953('0xc')](),controller[_0x6953('0xf')]);router['get'](_0x6953('0x10'),auth[_0x6953('0xc')](),controller[_0x6953('0x11')]);router[_0x6953('0x9')](_0x6953('0x12'),auth[_0x6953('0xc')](),controller[_0x6953('0x13')]);router[_0x6953('0x9')](_0x6953('0x14'),auth['isAuthenticated'](),controller[_0x6953('0x15')]);router['post']('/',auth[_0x6953('0xc')](),controller[_0x6953('0x16')]);router[_0x6953('0x17')](_0x6953('0x12'),auth[_0x6953('0xc')](),controller[_0x6953('0x18')]);router[_0x6953('0x17')](_0x6953('0x14'),auth[_0x6953('0xc')](),controller[_0x6953('0x19')]);router[_0x6953('0x1a')]('/:id',auth['isAuthenticated'](),controller[_0x6953('0x1b')]);router[_0x6953('0x1c')](_0x6953('0xe'),auth[_0x6953('0xc')](),controller['destroy']);router[_0x6953('0x1c')](_0x6953('0x12'),auth['isAuthenticated'](),controller[_0x6953('0x1d')]);router[_0x6953('0x1c')](_0x6953('0x14'),auth[_0x6953('0xc')](),controller[_0x6953('0x1e')]);module['exports']=router; \ No newline at end of file +var _0x15ef=['isAuthenticated','show','/:id/teams','/:id/users','getAgents','create','post','addTeams','addAgents','put','update','delete','destroy','removeTeams','removeAgents','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./faxQueue.controller','get','/describe','describe','/:id'];(function(_0xfd58ac,_0x47c86a){var _0x16f468=function(_0x2e0c7d){while(--_0x2e0c7d){_0xfd58ac['push'](_0xfd58ac['shift']());}};_0x16f468(++_0x47c86a);}(_0x15ef,0x80));var _0xf15e=function(_0xda974f,_0x228e93){_0xda974f=_0xda974f-0x0;var _0x1c01cf=_0x15ef[_0xda974f];return _0x1c01cf;};'use strict';var multer=require('multer');var util=require(_0xf15e('0x0'));var path=require(_0xf15e('0x1'));var timeout=require('connect-timeout');var express=require(_0xf15e('0x2'));var router=express[_0xf15e('0x3')]();var fs_extra=require(_0xf15e('0x4'));var auth=require(_0xf15e('0x5'));var interaction=require(_0xf15e('0x6'));var config=require('../../config/environment');var controller=require(_0xf15e('0x7'));router[_0xf15e('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xf15e('0x8')](_0xf15e('0x9'),auth['isAuthenticated'](),controller[_0xf15e('0xa')]);router['get'](_0xf15e('0xb'),auth[_0xf15e('0xc')](),controller[_0xf15e('0xd')]);router[_0xf15e('0x8')]('/:id/members',auth['isAuthenticated'](),controller['getMembers']);router[_0xf15e('0x8')](_0xf15e('0xe'),auth['isAuthenticated'](),controller['getTeams']);router['get'](_0xf15e('0xf'),auth[_0xf15e('0xc')](),controller[_0xf15e('0x10')]);router['post']('/',auth[_0xf15e('0xc')](),controller[_0xf15e('0x11')]);router[_0xf15e('0x12')]('/:id/teams',auth[_0xf15e('0xc')](),controller[_0xf15e('0x13')]);router[_0xf15e('0x12')](_0xf15e('0xf'),auth[_0xf15e('0xc')](),controller[_0xf15e('0x14')]);router[_0xf15e('0x15')](_0xf15e('0xb'),auth['isAuthenticated'](),controller[_0xf15e('0x16')]);router[_0xf15e('0x17')]('/:id',auth[_0xf15e('0xc')](),controller[_0xf15e('0x18')]);router[_0xf15e('0x17')]('/:id/teams',auth['isAuthenticated'](),controller[_0xf15e('0x19')]);router[_0xf15e('0x17')]('/:id/users',auth[_0xf15e('0xc')](),controller[_0xf15e('0x1a')]);module[_0xf15e('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 26e38bc..b811fd5 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 _0x65c4=['DATE','moment','STRING'];(function(_0x68016,_0x90d27a){var _0x3ab6ad=function(_0x3976d8){while(--_0x3976d8){_0x68016['push'](_0x68016['shift']());}};_0x3ab6ad(++_0x90d27a);}(_0x65c4,0x19f));var _0x465c=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0x65c4[_0x298ed3];return _0x5aad28;};'use strict';var moment=require(_0x465c('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x465c('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x465c('0x1')]},'joinAt':{'type':Sequelize[_0x465c('0x2')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x465c('0x2')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x365f=['sequelize','exports','STRING','DATE','moment'];(function(_0x4a747d,_0x3b747f){var _0x3a5b5c=function(_0x4b3e81){while(--_0x4b3e81){_0x4a747d['push'](_0x4a747d['shift']());}};_0x3a5b5c(++_0x3b747f);}(_0x365f,0x7c));var _0xf365=function(_0x4c7b1c,_0x4cfe4a){_0x4c7b1c=_0x4c7b1c-0x0;var _0x5a7e26=_0x365f[_0x4c7b1c];return _0x5a7e26;};'use strict';var moment=require(_0xf365('0x0'));var Sequelize=require(_0xf365('0x1'));module[_0xf365('0x2')]={'uniqueid':{'type':Sequelize[_0xf365('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xf365('0x3')]},'joinAt':{'type':Sequelize[_0xf365('0x4')]},'leaveAt':{'type':Sequelize[_0xf365('0x4')]},'acceptAt':{'type':Sequelize[_0xf365('0x4')]},'exitAt':{'type':Sequelize[_0xf365('0x4')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index a3c7d30..9d84382 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 _0x8f7d=['type','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','create','body','update','describe','eml-format','rimraf','fast-json-patch','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','destroy','error','stack','send','index','map','FaxQueueReport','rawAttributes','fieldName','model','name','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge'];(function(_0x133f81,_0x550e62){var _0x2eef30=function(_0x48e9bf){while(--_0x48e9bf){_0x133f81['push'](_0x133f81['shift']());}};_0x2eef30(++_0x550e62);}(_0x8f7d,0xf5));var _0xd8f7=function(_0x4fb4ec,_0x1278c2){_0x4fb4ec=_0x4fb4ec-0x0;var _0x3fa7e3=_0x8f7d[_0x4fb4ec];return _0x3fa7e3;};'use strict';var emlformat=require(_0xd8f7('0x0'));var rimraf=require(_0xd8f7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd8f7('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xd8f7('0x3'));var Mustache=require('mustache');var util=require(_0xd8f7('0x4'));var path=require(_0xd8f7('0x5'));var sox=require(_0xd8f7('0x6'));var csv=require(_0xd8f7('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xd8f7('0x8'));var _=require(_0xd8f7('0x9'));var squel=require(_0xd8f7('0xa'));var crypto=require(_0xd8f7('0xb'));var jsforce=require(_0xd8f7('0xc'));var deskjs=require(_0xd8f7('0xd'));var toCsv=require(_0xd8f7('0x7'));var querystring=require(_0xd8f7('0xe'));var Papa=require('papaparse');var Redis=require(_0xd8f7('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xd8f7('0x10'));var as=require(_0xd8f7('0x11'));var hardwareService=require(_0xd8f7('0x12'));var logger=require(_0xd8f7('0x13'))(_0xd8f7('0x14'));var utils=require(_0xd8f7('0x15'));var config=require(_0xd8f7('0x16'));var licenseUtil=require(_0xd8f7('0x17'));var db=require(_0xd8f7('0x18'))['db'];function respondWithStatusCode(_0x41ebd3,_0x29467b){_0x29467b=_0x29467b||0xcc;return function(_0x21ee60){if(_0x21ee60){return _0x41ebd3[_0xd8f7('0x19')](_0x29467b);}return _0x41ebd3[_0xd8f7('0x1a')](_0x29467b)[_0xd8f7('0x1b')]();};}function respondWithResult(_0x4406c7,_0x4b4114){_0x4b4114=_0x4b4114||0xc8;return function(_0x5c1177){if(_0x5c1177){return _0x4406c7['status'](_0x4b4114)[_0xd8f7('0x1c')](_0x5c1177);}};}function respondWithFilteredResult(_0x2b58c1,_0x341152){return function(_0x109488){if(_0x109488){var _0x299208=typeof _0x341152[_0xd8f7('0x1d')]===_0xd8f7('0x1e')&&typeof _0x341152[_0xd8f7('0x1f')]==='undefined';var _0x478e46=_0x109488['count'];var _0x202298=_0x299208?0x0:_0x341152[_0xd8f7('0x1d')];var _0x5d31c5=_0x299208?_0x109488[_0xd8f7('0x20')]:_0x341152[_0xd8f7('0x1d')]+_0x341152[_0xd8f7('0x1f')];var _0x48a97b;if(_0x5d31c5>=_0x478e46){_0x5d31c5=_0x478e46;_0x48a97b=0xc8;}else{_0x48a97b=0xce;}_0x2b58c1[_0xd8f7('0x1a')](_0x48a97b);return _0x2b58c1['set'](_0xd8f7('0x21'),_0x202298+'-'+_0x5d31c5+'/'+_0x478e46)[_0xd8f7('0x1c')](_0x109488);}return null;};}function patchUpdates(_0x4e0ec4){return function(_0xcbc2a5){try{jsonpatch[_0xd8f7('0x22')](_0xcbc2a5,_0x4e0ec4,!![]);}catch(_0x57bf17){return BPromise[_0xd8f7('0x23')](_0x57bf17);}return _0xcbc2a5[_0xd8f7('0x24')]();};}function saveUpdates(_0x54bc78,_0x2fc6cb){return function(_0x58469a){if(_0x58469a){return _0x58469a['update'](_0x54bc78)[_0xd8f7('0x25')](function(_0x4e1e10){return _0x4e1e10;});}return null;};}function removeEntity(_0x148d6f,_0x1bbe84){return function(_0x4d84bb){if(_0x4d84bb){return _0x4d84bb[_0xd8f7('0x26')]()[_0xd8f7('0x25')](function(){_0x148d6f[_0xd8f7('0x1a')](0xcc)[_0xd8f7('0x1b')]();});}};}function handleEntityNotFound(_0x8874d4,_0x380247){return function(_0x3ca18a){if(!_0x3ca18a){_0x8874d4[_0xd8f7('0x19')](0x194);}return _0x3ca18a;};}function handleError(_0x424b91,_0x8a8403){_0x8a8403=_0x8a8403||0x1f4;return function(_0x4ba0f){logger[_0xd8f7('0x27')](_0x4ba0f[_0xd8f7('0x28')]);if(_0x4ba0f['name']){delete _0x4ba0f['name'];}_0x424b91[_0xd8f7('0x1a')](_0x8a8403)[_0xd8f7('0x29')](_0x4ba0f);};}exports[_0xd8f7('0x2a')]=function(_0x20ef3a,_0x35ef58){var _0x101935={},_0x5d54b9={},_0x480635={'count':0x0,'rows':[]};var _0x12bf13=_[_0xd8f7('0x2b')](db[_0xd8f7('0x2c')][_0xd8f7('0x2d')],function(_0x3e2f76){return{'name':_0x3e2f76[_0xd8f7('0x2e')],'type':_0x3e2f76['type']['key']};});_0x5d54b9[_0xd8f7('0x2f')]=_['map'](_0x12bf13,_0xd8f7('0x30'));_0x5d54b9['query']=_[_0xd8f7('0x31')](_0x20ef3a[_0xd8f7('0x32')]);_0x5d54b9[_0xd8f7('0x33')]=_[_0xd8f7('0x34')](_0x5d54b9[_0xd8f7('0x2f')],_0x5d54b9[_0xd8f7('0x32')]);_0x101935['attributes']=_['intersection'](_0x5d54b9[_0xd8f7('0x2f')],qs[_0xd8f7('0x35')](_0x20ef3a['query'][_0xd8f7('0x35')]));_0x101935[_0xd8f7('0x36')]=_0x101935[_0xd8f7('0x36')][_0xd8f7('0x37')]?_0x101935[_0xd8f7('0x36')]:_0x5d54b9[_0xd8f7('0x2f')];if(!_0x20ef3a[_0xd8f7('0x32')][_0xd8f7('0x38')](_0xd8f7('0x39'))){_0x101935[_0xd8f7('0x1f')]=qs[_0xd8f7('0x1f')](_0x20ef3a['query']['limit']);_0x101935[_0xd8f7('0x1d')]=qs['offset'](_0x20ef3a['query'][_0xd8f7('0x1d')]);}_0x101935[_0xd8f7('0x3a')]=qs[_0xd8f7('0x3b')](_0x20ef3a[_0xd8f7('0x32')][_0xd8f7('0x3b')]);_0x101935[_0xd8f7('0x3c')]=qs['filters'](_['pick'](_0x20ef3a[_0xd8f7('0x32')],_0x5d54b9['filters']),_0x12bf13);if(_0x20ef3a[_0xd8f7('0x32')][_0xd8f7('0x3d')]){_0x101935[_0xd8f7('0x3c')]=_[_0xd8f7('0x3e')](_0x101935[_0xd8f7('0x3c')],{'$or':_[_0xd8f7('0x2b')](_0x12bf13,function(_0x40a26c){if(_0x40a26c[_0xd8f7('0x3f')]!==_0xd8f7('0x40')){var _0x41c08c={};_0x41c08c[_0x40a26c[_0xd8f7('0x30')]]={'$like':'%'+_0x20ef3a[_0xd8f7('0x32')][_0xd8f7('0x3d')]+'%'};return _0x41c08c;}})});}_0x101935=_['merge']({},_0x101935,_0x20ef3a[_0xd8f7('0x41')]);var _0x143e1a={'where':_0x101935[_0xd8f7('0x3c')]};return db[_0xd8f7('0x2c')][_0xd8f7('0x20')](_0x143e1a)[_0xd8f7('0x25')](function(_0x153ff0){_0x480635[_0xd8f7('0x20')]=_0x153ff0;if(_0x20ef3a['query'][_0xd8f7('0x42')]){_0x101935[_0xd8f7('0x43')]=[{'all':!![]}];}return db[_0xd8f7('0x2c')][_0xd8f7('0x44')](_0x101935);})[_0xd8f7('0x25')](function(_0x254c15){_0x480635['rows']=_0x254c15;return _0x480635;})[_0xd8f7('0x25')](respondWithFilteredResult(_0x35ef58,_0x101935))[_0xd8f7('0x45')](handleError(_0x35ef58,null));};exports[_0xd8f7('0x46')]=function(_0x51d5a2,_0x265429){var _0x244d12={'raw':!![],'where':{'id':_0x51d5a2[_0xd8f7('0x47')]['id']}},_0x5cadee={};_0x5cadee[_0xd8f7('0x2f')]=_['keys'](db['FaxQueueReport']['rawAttributes']);_0x5cadee[_0xd8f7('0x32')]=_[_0xd8f7('0x31')](_0x51d5a2[_0xd8f7('0x32')]);_0x5cadee[_0xd8f7('0x33')]=_['intersection'](_0x5cadee[_0xd8f7('0x2f')],_0x5cadee[_0xd8f7('0x32')]);_0x244d12[_0xd8f7('0x36')]=_[_0xd8f7('0x34')](_0x5cadee[_0xd8f7('0x2f')],qs[_0xd8f7('0x35')](_0x51d5a2[_0xd8f7('0x32')][_0xd8f7('0x35')]));_0x244d12[_0xd8f7('0x36')]=_0x244d12[_0xd8f7('0x36')][_0xd8f7('0x37')]?_0x244d12[_0xd8f7('0x36')]:_0x5cadee[_0xd8f7('0x2f')];if(_0x51d5a2[_0xd8f7('0x32')][_0xd8f7('0x42')]){_0x244d12[_0xd8f7('0x43')]=[{'all':!![]}];}_0x244d12=_['merge']({},_0x244d12,_0x51d5a2['options']);return db[_0xd8f7('0x2c')][_0xd8f7('0x48')](_0x244d12)[_0xd8f7('0x25')](handleEntityNotFound(_0x265429,null))['then'](respondWithResult(_0x265429,null))[_0xd8f7('0x45')](handleError(_0x265429,null));};exports[_0xd8f7('0x49')]=function(_0x20832d,_0x1e8343){return db['FaxQueueReport'][_0xd8f7('0x49')](_0x20832d[_0xd8f7('0x4a')],{})[_0xd8f7('0x25')](respondWithResult(_0x1e8343,0xc9))[_0xd8f7('0x45')](handleError(_0x1e8343,null));};exports[_0xd8f7('0x4b')]=function(_0x3a317c,_0x522fb2){if(_0x3a317c[_0xd8f7('0x4a')]['id']){delete _0x3a317c[_0xd8f7('0x4a')]['id'];}return db[_0xd8f7('0x2c')][_0xd8f7('0x48')]({'where':{'id':_0x3a317c[_0xd8f7('0x47')]['id']}})[_0xd8f7('0x25')](handleEntityNotFound(_0x522fb2,null))[_0xd8f7('0x25')](saveUpdates(_0x3a317c['body'],null))[_0xd8f7('0x25')](respondWithResult(_0x522fb2,null))['catch'](handleError(_0x522fb2,null));};exports[_0xd8f7('0x26')]=function(_0x2a797d,_0x19ccef){return db['FaxQueueReport']['find']({'where':{'id':_0x2a797d['params']['id']}})['then'](handleEntityNotFound(_0x19ccef,null))['then'](removeEntity(_0x19ccef,null))['catch'](handleError(_0x19ccef,null));};exports[_0xd8f7('0x4c')]=function(_0x14a307,_0x2bca2b){return db[_0xd8f7('0x2c')][_0xd8f7('0x4c')]()[_0xd8f7('0x25')](respondWithResult(_0x2bca2b,null))[_0xd8f7('0x45')](handleError(_0x2bca2b,null));}; \ No newline at end of file +var _0x0fd9=['includeAll','include','rows','catch','show','params','create','body','find','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','error','stack','name','index','map','FaxQueueReport','rawAttributes','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','merge','options'];(function(_0x27385,_0x535783){var _0x3c6568=function(_0x4fe0d4){while(--_0x4fe0d4){_0x27385['push'](_0x27385['shift']());}};_0x3c6568(++_0x535783);}(_0x0fd9,0xa3));var _0x90fd=function(_0x5f1cf8,_0x5e0923){_0x5f1cf8=_0x5f1cf8-0x0;var _0x27d0fa=_0x0fd9[_0x5f1cf8];return _0x27d0fa;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x90fd('0x0'));var zipdir=require(_0x90fd('0x1'));var jsonpatch=require(_0x90fd('0x2'));var rp=require(_0x90fd('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x90fd('0x4'));var util=require(_0x90fd('0x5'));var path=require(_0x90fd('0x6'));var sox=require(_0x90fd('0x7'));var csv=require(_0x90fd('0x8'));var ejs=require(_0x90fd('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x90fd('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x90fd('0xb'));var toCsv=require(_0x90fd('0x8'));var querystring=require('querystring');var Papa=require(_0x90fd('0xc'));var Redis=require(_0x90fd('0xd'));var authService=require(_0x90fd('0xe'));var qs=require(_0x90fd('0xf'));var as=require(_0x90fd('0x10'));var hardwareService=require(_0x90fd('0x11'));var logger=require(_0x90fd('0x12'))(_0x90fd('0x13'));var utils=require(_0x90fd('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x90fd('0x15'));var db=require(_0x90fd('0x16'))['db'];function respondWithStatusCode(_0x4e8b99,_0x1439ed){_0x1439ed=_0x1439ed||0xcc;return function(_0x37a0f8){if(_0x37a0f8){return _0x4e8b99[_0x90fd('0x17')](_0x1439ed);}return _0x4e8b99['status'](_0x1439ed)[_0x90fd('0x18')]();};}function respondWithResult(_0x48e701,_0x1cae40){_0x1cae40=_0x1cae40||0xc8;return function(_0xb402d9){if(_0xb402d9){return _0x48e701[_0x90fd('0x19')](_0x1cae40)[_0x90fd('0x1a')](_0xb402d9);}};}function respondWithFilteredResult(_0x3c5da8,_0x442a19){return function(_0x296a64){if(_0x296a64){var _0x4eb953=typeof _0x442a19['offset']===_0x90fd('0x1b')&&typeof _0x442a19[_0x90fd('0x1c')]==='undefined';var _0x130489=_0x296a64[_0x90fd('0x1d')];var _0x1fcc87=_0x4eb953?0x0:_0x442a19['offset'];var _0x3f9c76=_0x4eb953?_0x296a64[_0x90fd('0x1d')]:_0x442a19[_0x90fd('0x1e')]+_0x442a19[_0x90fd('0x1c')];var _0x251957;if(_0x3f9c76>=_0x130489){_0x3f9c76=_0x130489;_0x251957=0xc8;}else{_0x251957=0xce;}_0x3c5da8[_0x90fd('0x19')](_0x251957);return _0x3c5da8[_0x90fd('0x1f')](_0x90fd('0x20'),_0x1fcc87+'-'+_0x3f9c76+'/'+_0x130489)[_0x90fd('0x1a')](_0x296a64);}return null;};}function patchUpdates(_0x90197e){return function(_0x19e79b){try{jsonpatch[_0x90fd('0x21')](_0x19e79b,_0x90197e,!![]);}catch(_0x1fb31a){return BPromise[_0x90fd('0x22')](_0x1fb31a);}return _0x19e79b[_0x90fd('0x23')]();};}function saveUpdates(_0x493c26,_0x35ce4e){return function(_0xc4e4e2){if(_0xc4e4e2){return _0xc4e4e2[_0x90fd('0x24')](_0x493c26)[_0x90fd('0x25')](function(_0x411a6a){return _0x411a6a;});}return null;};}function removeEntity(_0x3ad6c6,_0x30f67e){return function(_0x300262){if(_0x300262){return _0x300262['destroy']()[_0x90fd('0x25')](function(){_0x3ad6c6['status'](0xcc)[_0x90fd('0x18')]();});}};}function handleEntityNotFound(_0x18d5b3,_0x2ffea2){return function(_0x31667c){if(!_0x31667c){_0x18d5b3[_0x90fd('0x17')](0x194);}return _0x31667c;};}function handleError(_0x4c962f,_0x35c38d){_0x35c38d=_0x35c38d||0x1f4;return function(_0xe333f0){logger[_0x90fd('0x26')](_0xe333f0[_0x90fd('0x27')]);if(_0xe333f0[_0x90fd('0x28')]){delete _0xe333f0[_0x90fd('0x28')];}_0x4c962f['status'](_0x35c38d)['send'](_0xe333f0);};}exports[_0x90fd('0x29')]=function(_0x170cfb,_0x2924e9){var _0x404971={},_0x397aaf={},_0x59b3e8={'count':0x0,'rows':[]};var _0x4f69e7=_[_0x90fd('0x2a')](db[_0x90fd('0x2b')][_0x90fd('0x2c')],function(_0x3a0102){return{'name':_0x3a0102['fieldName'],'type':_0x3a0102['type'][_0x90fd('0x2d')]};});_0x397aaf[_0x90fd('0x2e')]=_[_0x90fd('0x2a')](_0x4f69e7,_0x90fd('0x28'));_0x397aaf['query']=_[_0x90fd('0x2f')](_0x170cfb[_0x90fd('0x30')]);_0x397aaf[_0x90fd('0x31')]=_[_0x90fd('0x32')](_0x397aaf[_0x90fd('0x2e')],_0x397aaf[_0x90fd('0x30')]);_0x404971[_0x90fd('0x33')]=_[_0x90fd('0x32')](_0x397aaf[_0x90fd('0x2e')],qs[_0x90fd('0x34')](_0x170cfb[_0x90fd('0x30')][_0x90fd('0x34')]));_0x404971[_0x90fd('0x33')]=_0x404971[_0x90fd('0x33')][_0x90fd('0x35')]?_0x404971[_0x90fd('0x33')]:_0x397aaf['model'];if(!_0x170cfb[_0x90fd('0x30')][_0x90fd('0x36')](_0x90fd('0x37'))){_0x404971[_0x90fd('0x1c')]=qs[_0x90fd('0x1c')](_0x170cfb[_0x90fd('0x30')][_0x90fd('0x1c')]);_0x404971[_0x90fd('0x1e')]=qs[_0x90fd('0x1e')](_0x170cfb[_0x90fd('0x30')][_0x90fd('0x1e')]);}_0x404971[_0x90fd('0x38')]=qs[_0x90fd('0x39')](_0x170cfb['query'][_0x90fd('0x39')]);_0x404971[_0x90fd('0x3a')]=qs[_0x90fd('0x31')](_[_0x90fd('0x3b')](_0x170cfb['query'],_0x397aaf[_0x90fd('0x31')]),_0x4f69e7);if(_0x170cfb[_0x90fd('0x30')][_0x90fd('0x3c')]){_0x404971['where']=_['merge'](_0x404971[_0x90fd('0x3a')],{'$or':_[_0x90fd('0x2a')](_0x4f69e7,function(_0x377319){if(_0x377319[_0x90fd('0x3d')]!==_0x90fd('0x3e')){var _0x254200={};_0x254200[_0x377319[_0x90fd('0x28')]]={'$like':'%'+_0x170cfb[_0x90fd('0x30')][_0x90fd('0x3c')]+'%'};return _0x254200;}})});}_0x404971=_[_0x90fd('0x3f')]({},_0x404971,_0x170cfb[_0x90fd('0x40')]);var _0x43c84c={'where':_0x404971[_0x90fd('0x3a')]};return db[_0x90fd('0x2b')][_0x90fd('0x1d')](_0x43c84c)[_0x90fd('0x25')](function(_0x2717ca){_0x59b3e8[_0x90fd('0x1d')]=_0x2717ca;if(_0x170cfb['query'][_0x90fd('0x41')]){_0x404971[_0x90fd('0x42')]=[{'all':!![]}];}return db[_0x90fd('0x2b')]['findAll'](_0x404971);})['then'](function(_0x47b8c8){_0x59b3e8[_0x90fd('0x43')]=_0x47b8c8;return _0x59b3e8;})[_0x90fd('0x25')](respondWithFilteredResult(_0x2924e9,_0x404971))[_0x90fd('0x44')](handleError(_0x2924e9,null));};exports[_0x90fd('0x45')]=function(_0x1361d9,_0x311c7e){var _0x363365={'raw':!![],'where':{'id':_0x1361d9[_0x90fd('0x46')]['id']}},_0x733d4d={};_0x733d4d[_0x90fd('0x2e')]=_[_0x90fd('0x2f')](db[_0x90fd('0x2b')][_0x90fd('0x2c')]);_0x733d4d[_0x90fd('0x30')]=_[_0x90fd('0x2f')](_0x1361d9['query']);_0x733d4d['filters']=_[_0x90fd('0x32')](_0x733d4d[_0x90fd('0x2e')],_0x733d4d[_0x90fd('0x30')]);_0x363365['attributes']=_['intersection'](_0x733d4d[_0x90fd('0x2e')],qs[_0x90fd('0x34')](_0x1361d9['query']['fields']));_0x363365[_0x90fd('0x33')]=_0x363365[_0x90fd('0x33')]['length']?_0x363365['attributes']:_0x733d4d[_0x90fd('0x2e')];if(_0x1361d9[_0x90fd('0x30')][_0x90fd('0x41')]){_0x363365['include']=[{'all':!![]}];}_0x363365=_[_0x90fd('0x3f')]({},_0x363365,_0x1361d9[_0x90fd('0x40')]);return db['FaxQueueReport']['find'](_0x363365)['then'](handleEntityNotFound(_0x311c7e,null))[_0x90fd('0x25')](respondWithResult(_0x311c7e,null))[_0x90fd('0x44')](handleError(_0x311c7e,null));};exports['create']=function(_0x2d42b3,_0x2b73f7){return db[_0x90fd('0x2b')][_0x90fd('0x47')](_0x2d42b3[_0x90fd('0x48')],{})['then'](respondWithResult(_0x2b73f7,0xc9))['catch'](handleError(_0x2b73f7,null));};exports[_0x90fd('0x24')]=function(_0x326e4d,_0x125874){if(_0x326e4d[_0x90fd('0x48')]['id']){delete _0x326e4d[_0x90fd('0x48')]['id'];}return db[_0x90fd('0x2b')][_0x90fd('0x49')]({'where':{'id':_0x326e4d[_0x90fd('0x46')]['id']}})[_0x90fd('0x25')](handleEntityNotFound(_0x125874,null))[_0x90fd('0x25')](saveUpdates(_0x326e4d['body'],null))[_0x90fd('0x25')](respondWithResult(_0x125874,null))[_0x90fd('0x44')](handleError(_0x125874,null));};exports[_0x90fd('0x4a')]=function(_0x38021b,_0x4b47bc){return db['FaxQueueReport'][_0x90fd('0x49')]({'where':{'id':_0x38021b['params']['id']}})['then'](handleEntityNotFound(_0x4b47bc,null))[_0x90fd('0x25')](removeEntity(_0x4b47bc,null))[_0x90fd('0x44')](handleError(_0x4b47bc,null));};exports[_0x90fd('0x4b')]=function(_0xb8a2af,_0x13c428){return db[_0x90fd('0x2b')][_0x90fd('0x4b')]()['then'](respondWithResult(_0x13c428,null))['catch'](handleError(_0x13c428,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index 0f5364e..fb22240 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 _0x7a54=['report_fax_queue','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','FaxQueueReport'];(function(_0x5c3720,_0x662f3b){var _0x21bf2d=function(_0x293f25){while(--_0x293f25){_0x5c3720['push'](_0x5c3720['shift']());}};_0x21bf2d(++_0x662f3b);}(_0x7a54,0x106));var _0x47a5=function(_0x21de59,_0x23b3a7){_0x21de59=_0x21de59-0x0;var _0x31f6de=_0x7a54[_0x21de59];return _0x31f6de;};'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':'uniqueid','fields':[_0x47a5('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1261=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueueReport.attributes','define','report_fax_queue','uniqueid','util'];(function(_0x7393dd,_0x3cc168){var _0x3663d7=function(_0xcbbe5c){while(--_0xcbbe5c){_0x7393dd['push'](_0x7393dd['shift']());}};_0x3663d7(++_0x3cc168);}(_0x1261,0x144));var _0x1126=function(_0x7e2eb0,_0x17cd58){_0x7e2eb0=_0x7e2eb0-0x0;var _0xd92de4=_0x1261[_0x7e2eb0];return _0xd92de4;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var logger=require(_0x1126('0x1'))(_0x1126('0x2'));var moment=require(_0x1126('0x3'));var BPromise=require(_0x1126('0x4'));var rp=require(_0x1126('0x5'));var fs=require('fs');var path=require(_0x1126('0x6'));var rimraf=require(_0x1126('0x7'));var config=require(_0x1126('0x8'));var attributes=require(_0x1126('0x9'));module['exports']=function(_0x5c68c8,_0x40ba58){return _0x5c68c8[_0x1126('0xa')]('FaxQueueReport',attributes,{'tableName':_0x1126('0xb'),'paranoid':![],'indexes':[{'name':_0x1126('0xc'),'fields':[_0x1126('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index 31ccd03..1a5889b 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 _0x6bfd=['info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','CreateFaxQueueReport','FaxQueueReport','create','options','catch','update','body','raw','where','attributes','limit','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then'];(function(_0x390a19,_0x5dd137){var _0x5d8230=function(_0x2e6234){while(--_0x2e6234){_0x390a19['push'](_0x390a19['shift']());}};_0x5d8230(++_0x5dd137);}(_0x6bfd,0x13d));var _0xd6bf=function(_0x42bfd5,_0x26c47c){_0x42bfd5=_0x42bfd5-0x0;var _0x351cae=_0x6bfd[_0x42bfd5];return _0x351cae;};'use strict';var _=require(_0xd6bf('0x0'));var util=require('util');var moment=require(_0xd6bf('0x1'));var BPromise=require(_0xd6bf('0x2'));var rs=require(_0xd6bf('0x3'));var fs=require('fs');var Redis=require(_0xd6bf('0x4'));var db=require(_0xd6bf('0x5'))['db'];var utils=require(_0xd6bf('0x6'));var logger=require(_0xd6bf('0x7'))(_0xd6bf('0x8'));var config=require(_0xd6bf('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xd6bf('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41efd3,_0x3f9a92,_0x209177){return new BPromise(function(_0x4fe11e,_0x3fdd62){return client[_0xd6bf('0xb')](_0x41efd3,_0x209177)[_0xd6bf('0xc')](function(_0x2fc47d){logger[_0xd6bf('0xd')](_0xd6bf('0xe'),_0x3f9a92,_0xd6bf('0xf'));logger[_0xd6bf('0x10')](_0xd6bf('0x11'),_0x3f9a92,_0xd6bf('0xf'),JSON[_0xd6bf('0x12')](_0x2fc47d));if(_0x2fc47d[_0xd6bf('0x13')]){if(_0x2fc47d['error']['code']===0x1f4){logger['error'](_0xd6bf('0xe'),_0x3f9a92,_0x2fc47d[_0xd6bf('0x13')][_0xd6bf('0x14')]);return _0x3fdd62(_0x2fc47d[_0xd6bf('0x13')][_0xd6bf('0x14')]);}logger[_0xd6bf('0x13')](_0xd6bf('0xe'),_0x3f9a92,_0x2fc47d['error'][_0xd6bf('0x14')]);return _0x4fe11e(_0x2fc47d[_0xd6bf('0x13')][_0xd6bf('0x14')]);}else{logger['info'](_0xd6bf('0xe'),_0x3f9a92,_0xd6bf('0xf'));_0x4fe11e(_0x2fc47d[_0xd6bf('0x15')][_0xd6bf('0x14')]);}})['catch'](function(_0x384275){logger[_0xd6bf('0x13')](_0xd6bf('0xe'),_0x3f9a92,_0x384275);_0x3fdd62(_0x384275);});});}exports[_0xd6bf('0x16')]=function(_0x2f131a){var _0x2dbfd1=this;return new Promise(function(_0x80f338,_0x3f7d7a){return db[_0xd6bf('0x17')][_0xd6bf('0x18')](_0x2f131a['body'],{'raw':_0x2f131a[_0xd6bf('0x19')]?_0x2f131a[_0xd6bf('0x19')]['raw']===undefined?!![]:![]:!![]})[_0xd6bf('0xc')](function(_0x2d9318){logger[_0xd6bf('0xd')](_0xd6bf('0x16'),_0x2f131a);logger[_0xd6bf('0x10')](_0xd6bf('0x16'),_0x2f131a,JSON['stringify'](_0x2d9318));_0x80f338(_0x2d9318);})[_0xd6bf('0x1a')](function(_0x37ff69){logger[_0xd6bf('0x13')]('CreateFaxQueueReport',_0x37ff69['message'],_0x2f131a);_0x3f7d7a(_0x2dbfd1[_0xd6bf('0x13')](0x1f4,_0x37ff69['message']));});});};exports['UpdateFaxQueueReport']=function(_0x74b5cf){var _0x463e3b=this;return new Promise(function(_0x59adee,_0x755933){return db['FaxQueueReport'][_0xd6bf('0x1b')](_0x74b5cf[_0xd6bf('0x1c')],{'raw':_0x74b5cf[_0xd6bf('0x19')]?_0x74b5cf[_0xd6bf('0x19')][_0xd6bf('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x74b5cf[_0xd6bf('0x19')]?_0x74b5cf[_0xd6bf('0x19')][_0xd6bf('0x1e')]||null:null,'attributes':_0x74b5cf['options']?_0x74b5cf[_0xd6bf('0x19')][_0xd6bf('0x1f')]||null:null,'limit':_0x74b5cf[_0xd6bf('0x19')]?_0x74b5cf['options'][_0xd6bf('0x20')]||null:null})[_0xd6bf('0xc')](function(_0x3dc9df){logger['info']('UpdateFaxQueueReport',_0x74b5cf);logger[_0xd6bf('0x10')]('UpdateFaxQueueReport',_0x74b5cf,JSON[_0xd6bf('0x12')](_0x3dc9df));_0x59adee(_0x3dc9df);})['catch'](function(_0x118d3d){logger[_0xd6bf('0x13')]('UpdateFaxQueueReport',_0x118d3d[_0xd6bf('0x14')],_0x74b5cf);_0x755933(_0x463e3b[_0xd6bf('0x13')](0x1f4,_0x118d3d[_0xd6bf('0x14')]));});});}; \ No newline at end of file +var _0xe2ae=['create','body','options','raw','where','attributes','limit','UpdateFaxQueueReport','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CreateFaxQueueReport'];(function(_0x154983,_0xc29edf){var _0x3d1243=function(_0x5cb7a4){while(--_0x5cb7a4){_0x154983['push'](_0x154983['shift']());}};_0x3d1243(++_0xc29edf);}(_0xe2ae,0x128));var _0xee2a=function(_0x1ee9c7,_0x312621){_0x1ee9c7=_0x1ee9c7-0x0;var _0x7f3187=_0xe2ae[_0x1ee9c7];return _0x7f3187;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xee2a('0x0'));var BPromise=require(_0xee2a('0x1'));var rs=require(_0xee2a('0x2'));var fs=require('fs');var Redis=require(_0xee2a('0x3'));var db=require(_0xee2a('0x4'))['db'];var utils=require(_0xee2a('0x5'));var logger=require(_0xee2a('0x6'))(_0xee2a('0x7'));var config=require(_0xee2a('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xee2a('0x9')][_0xee2a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4b6a36,_0x5c7867,_0x59b1b7){return new BPromise(function(_0x2352f6,_0x2ed154){return client[_0xee2a('0xb')](_0x4b6a36,_0x59b1b7)[_0xee2a('0xc')](function(_0x4e2ccf){logger[_0xee2a('0xd')](_0xee2a('0xe'),_0x5c7867,_0xee2a('0xf'));logger[_0xee2a('0x10')]('FaxQueueReport,\x20%s,\x20%s,\x20%s',_0x5c7867,_0xee2a('0xf'),JSON[_0xee2a('0x11')](_0x4e2ccf));if(_0x4e2ccf[_0xee2a('0x12')]){if(_0x4e2ccf[_0xee2a('0x12')][_0xee2a('0x13')]===0x1f4){logger['error'](_0xee2a('0xe'),_0x5c7867,_0x4e2ccf[_0xee2a('0x12')]['message']);return _0x2ed154(_0x4e2ccf['error'][_0xee2a('0x14')]);}logger[_0xee2a('0x12')](_0xee2a('0xe'),_0x5c7867,_0x4e2ccf[_0xee2a('0x12')][_0xee2a('0x14')]);return _0x2352f6(_0x4e2ccf[_0xee2a('0x12')][_0xee2a('0x14')]);}else{logger['info'](_0xee2a('0xe'),_0x5c7867,_0xee2a('0xf'));_0x2352f6(_0x4e2ccf[_0xee2a('0x15')]['message']);}})[_0xee2a('0x16')](function(_0x34d5df){logger[_0xee2a('0x12')](_0xee2a('0xe'),_0x5c7867,_0x34d5df);_0x2ed154(_0x34d5df);});});}exports[_0xee2a('0x17')]=function(_0x577f23){var _0x202d4c=this;return new Promise(function(_0x4a5dac,_0x55ece8){return db['FaxQueueReport'][_0xee2a('0x18')](_0x577f23[_0xee2a('0x19')],{'raw':_0x577f23['options']?_0x577f23['options']['raw']===undefined?!![]:![]:!![]})[_0xee2a('0xc')](function(_0x3384cf){logger[_0xee2a('0xd')](_0xee2a('0x17'),_0x577f23);logger[_0xee2a('0x10')](_0xee2a('0x17'),_0x577f23,JSON[_0xee2a('0x11')](_0x3384cf));_0x4a5dac(_0x3384cf);})['catch'](function(_0x5942c7){logger[_0xee2a('0x12')](_0xee2a('0x17'),_0x5942c7['message'],_0x577f23);_0x55ece8(_0x202d4c[_0xee2a('0x12')](0x1f4,_0x5942c7['message']));});});};exports['UpdateFaxQueueReport']=function(_0x28b044){var _0x414024=this;return new Promise(function(_0x578bbc,_0x3cd8c9){return db['FaxQueueReport']['update'](_0x28b044[_0xee2a('0x19')],{'raw':_0x28b044[_0xee2a('0x1a')]?_0x28b044[_0xee2a('0x1a')][_0xee2a('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x28b044[_0xee2a('0x1a')]?_0x28b044[_0xee2a('0x1a')][_0xee2a('0x1c')]||null:null,'attributes':_0x28b044['options']?_0x28b044[_0xee2a('0x1a')][_0xee2a('0x1d')]||null:null,'limit':_0x28b044['options']?_0x28b044[_0xee2a('0x1a')][_0xee2a('0x1e')]||null:null})[_0xee2a('0xc')](function(_0x1d28e6){logger[_0xee2a('0xd')](_0xee2a('0x1f'),_0x28b044);logger[_0xee2a('0x10')]('UpdateFaxQueueReport',_0x28b044,JSON[_0xee2a('0x11')](_0x1d28e6));_0x578bbc(_0x1d28e6);})[_0xee2a('0x16')](function(_0x3117d4){logger[_0xee2a('0x12')](_0xee2a('0x1f'),_0x3117d4[_0xee2a('0x14')],_0x28b044);_0x3cd8c9(_0x414024[_0xee2a('0x12')](0x1f4,_0x3117d4[_0xee2a('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index 8717f31..97cfdfd 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 _0x2d73=['describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./faxQueueReport.controller','get','isAuthenticated','/describe'];(function(_0x2638ab,_0x5bd48d){var _0x7b4e36=function(_0x5cd418){while(--_0x5cd418){_0x2638ab['push'](_0x2638ab['shift']());}};_0x7b4e36(++_0x5bd48d);}(_0x2d73,0x1ed));var _0x32d7=function(_0x1da448,_0x565a9f){_0x1da448=_0x1da448-0x0;var _0xdb7a13=_0x2d73[_0x1da448];return _0xdb7a13;};'use strict';var multer=require(_0x32d7('0x0'));var util=require(_0x32d7('0x1'));var path=require('path');var timeout=require(_0x32d7('0x2'));var express=require(_0x32d7('0x3'));var router=express[_0x32d7('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x32d7('0x5'));var interaction=require(_0x32d7('0x6'));var config=require('../../config/environment');var controller=require(_0x32d7('0x7'));router[_0x32d7('0x8')]('/',auth[_0x32d7('0x9')](),controller['index']);router[_0x32d7('0x8')](_0x32d7('0xa'),auth['isAuthenticated'](),controller[_0x32d7('0xb')]);router[_0x32d7('0x8')](_0x32d7('0xc'),auth['isAuthenticated'](),controller[_0x32d7('0xd')]);router[_0x32d7('0xe')]('/',auth['isAuthenticated'](),controller[_0x32d7('0xf')]);router[_0x32d7('0x10')]('/:id',auth[_0x32d7('0x9')](),controller[_0x32d7('0x11')]);router[_0x32d7('0x12')](_0x32d7('0xc'),auth['isAuthenticated'](),controller[_0x32d7('0x13')]);module[_0x32d7('0x14')]=router; \ No newline at end of file +var _0xe7cb=['create','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x1ed4b3,_0x3af87f){var _0x37afcd=function(_0x164e9d){while(--_0x164e9d){_0x1ed4b3['push'](_0x1ed4b3['shift']());}};_0x37afcd(++_0x3af87f);}(_0xe7cb,0x176));var _0xbe7c=function(_0x504676,_0x1edaab){_0x504676=_0x504676-0x0;var _0x27d823=_0xe7cb[_0x504676];return _0x27d823;};'use strict';var multer=require(_0xbe7c('0x0'));var util=require(_0xbe7c('0x1'));var path=require(_0xbe7c('0x2'));var timeout=require('connect-timeout');var express=require(_0xbe7c('0x3'));var router=express[_0xbe7c('0x4')]();var fs_extra=require(_0xbe7c('0x5'));var auth=require(_0xbe7c('0x6'));var interaction=require(_0xbe7c('0x7'));var config=require(_0xbe7c('0x8'));var controller=require(_0xbe7c('0x9'));router[_0xbe7c('0xa')]('/',auth[_0xbe7c('0xb')](),controller[_0xbe7c('0xc')]);router[_0xbe7c('0xa')](_0xbe7c('0xd'),auth[_0xbe7c('0xb')](),controller[_0xbe7c('0xe')]);router[_0xbe7c('0xa')](_0xbe7c('0xf'),auth[_0xbe7c('0xb')](),controller[_0xbe7c('0x10')]);router['post']('/',auth[_0xbe7c('0xb')](),controller[_0xbe7c('0x11')]);router[_0xbe7c('0x12')](_0xbe7c('0xf'),auth[_0xbe7c('0xb')](),controller[_0xbe7c('0x13')]);router[_0xbe7c('0x14')](_0xbe7c('0xf'),auth['isAuthenticated'](),controller[_0xbe7c('0x15')]);module[_0xbe7c('0x16')]=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index 4eced0a..e7757f5 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 _0xf3cd=['exports','STRING','ENUM','account','queue','DATE','moment','sequelize'];(function(_0x4c4953,_0xe0f6c2){var _0x5cfc83=function(_0x17ed87){while(--_0x17ed87){_0x4c4953['push'](_0x4c4953['shift']());}};_0x5cfc83(++_0xe0f6c2);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x45c61e,_0x59694d){_0x45c61e=_0x45c61e-0x0;var _0x19033c=_0xf3cd[_0x45c61e];return _0x19033c;};'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 _0xa9e0=['account','queue','DATE','NOW','moment','sequelize','exports'];(function(_0x2aec52,_0x59d962){var _0x3b8835=function(_0x3e2604){while(--_0x3e2604){_0x2aec52['push'](_0x2aec52['shift']());}};_0x3b8835(++_0x59d962);}(_0xa9e0,0x123));var _0x0a9e=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xa9e0[_0x19e35c];return _0x3e1fe8;};'use strict';var moment=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x3'),'agent',_0x0a9e('0x4')),'allowNull':![],'defaultValue':_0x0a9e('0x4')},'transferredAt':{'type':Sequelize[_0x0a9e('0x5')],'allowNull':![],'defaultValue':Sequelize[_0x0a9e('0x6')]}}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index 6980ddd..7309789 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 _0x6365=['bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','status','stack','name','index','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','map','VIRTUAL','merge','includeAll','include','FaxTransferReport','rows','catch','params','keys','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x1d2b67,_0x48a393){var _0x5ea408=function(_0x9f7786){while(--_0x9f7786){_0x1d2b67['push'](_0x1d2b67['shift']());}};_0x5ea408(++_0x48a393);}(_0x6365,0x12a));var _0x5636=function(_0x5238d0,_0x4fcd82){_0x5238d0=_0x5238d0-0x0;var _0x216758=_0x6365[_0x5238d0];return _0x216758;};'use strict';var emlformat=require(_0x5636('0x0'));var rimraf=require(_0x5636('0x1'));var zipdir=require(_0x5636('0x2'));var jsonpatch=require(_0x5636('0x3'));var rp=require(_0x5636('0x4'));var moment=require(_0x5636('0x5'));var BPromise=require(_0x5636('0x6'));var Mustache=require(_0x5636('0x7'));var util=require(_0x5636('0x8'));var path=require(_0x5636('0x9'));var sox=require(_0x5636('0xa'));var csv=require(_0x5636('0xb'));var ejs=require(_0x5636('0xc'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x5636('0xd'));var crypto=require(_0x5636('0xe'));var jsforce=require(_0x5636('0xf'));var deskjs=require(_0x5636('0x10'));var toCsv=require(_0x5636('0xb'));var querystring=require(_0x5636('0x11'));var Papa=require(_0x5636('0x12'));var Redis=require(_0x5636('0x13'));var authService=require(_0x5636('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x5636('0x15'));var hardwareService=require(_0x5636('0x16'));var logger=require(_0x5636('0x17'))(_0x5636('0x18'));var utils=require('../../config/utils');var config=require(_0x5636('0x19'));var licenseUtil=require(_0x5636('0x1a'));var db=require(_0x5636('0x1b'))['db'];function respondWithStatusCode(_0xe973b7,_0x179971){_0x179971=_0x179971||0xcc;return function(_0x4147bd){if(_0x4147bd){return _0xe973b7['sendStatus'](_0x179971);}return _0xe973b7['status'](_0x179971)[_0x5636('0x1c')]();};}function respondWithResult(_0x10063f,_0x24e449){_0x24e449=_0x24e449||0xc8;return function(_0x19245c){if(_0x19245c){return _0x10063f['status'](_0x24e449)[_0x5636('0x1d')](_0x19245c);}};}function respondWithFilteredResult(_0x47e404,_0x36e2bf){return function(_0x4714d4){if(_0x4714d4){var _0x4b0da5=typeof _0x36e2bf[_0x5636('0x1e')]===_0x5636('0x1f')&&typeof _0x36e2bf[_0x5636('0x20')]===_0x5636('0x1f');var _0x356b7c=_0x4714d4[_0x5636('0x21')];var _0x5dd9b8=_0x4b0da5?0x0:_0x36e2bf[_0x5636('0x1e')];var _0xcee1c3=_0x4b0da5?_0x4714d4['count']:_0x36e2bf['offset']+_0x36e2bf['limit'];var _0x373a69;if(_0xcee1c3>=_0x356b7c){_0xcee1c3=_0x356b7c;_0x373a69=0xc8;}else{_0x373a69=0xce;}_0x47e404['status'](_0x373a69);return _0x47e404['set'](_0x5636('0x22'),_0x5dd9b8+'-'+_0xcee1c3+'/'+_0x356b7c)[_0x5636('0x1d')](_0x4714d4);}return null;};}function patchUpdates(_0x29b224){return function(_0x37cdc6){try{jsonpatch['apply'](_0x37cdc6,_0x29b224,!![]);}catch(_0x258340){return BPromise[_0x5636('0x23')](_0x258340);}return _0x37cdc6[_0x5636('0x24')]();};}function saveUpdates(_0x32e793,_0x3b9d76){return function(_0x5082d7){if(_0x5082d7){return _0x5082d7[_0x5636('0x25')](_0x32e793)[_0x5636('0x26')](function(_0x446ee1){return _0x446ee1;});}return null;};}function removeEntity(_0x382403,_0x4a60bb){return function(_0x1ed95a){if(_0x1ed95a){return _0x1ed95a[_0x5636('0x27')]()[_0x5636('0x26')](function(){_0x382403[_0x5636('0x28')](0xcc)[_0x5636('0x1c')]();});}};}function handleEntityNotFound(_0x18a650,_0x5e8f93){return function(_0x515f32){if(!_0x515f32){_0x18a650['sendStatus'](0x194);}return _0x515f32;};}function handleError(_0x25c14e,_0x365402){_0x365402=_0x365402||0x1f4;return function(_0x42a241){logger['error'](_0x42a241[_0x5636('0x29')]);if(_0x42a241[_0x5636('0x2a')]){delete _0x42a241[_0x5636('0x2a')];}_0x25c14e[_0x5636('0x28')](_0x365402)['send'](_0x42a241);};}exports[_0x5636('0x2b')]=function(_0x539378,_0x2b2b60){var _0x488c47={},_0xaaa8cc={},_0x43f580={'count':0x0,'rows':[]};var _0x571638=_['map'](db['FaxTransferReport'][_0x5636('0x2c')],function(_0x2ff1dd){return{'name':_0x2ff1dd[_0x5636('0x2d')],'type':_0x2ff1dd[_0x5636('0x2e')][_0x5636('0x2f')]};});_0xaaa8cc[_0x5636('0x30')]=_['map'](_0x571638,_0x5636('0x2a'));_0xaaa8cc[_0x5636('0x31')]=_['keys'](_0x539378['query']);_0xaaa8cc['filters']=_[_0x5636('0x32')](_0xaaa8cc[_0x5636('0x30')],_0xaaa8cc[_0x5636('0x31')]);_0x488c47[_0x5636('0x33')]=_[_0x5636('0x32')](_0xaaa8cc['model'],qs[_0x5636('0x34')](_0x539378[_0x5636('0x31')][_0x5636('0x34')]));_0x488c47[_0x5636('0x33')]=_0x488c47[_0x5636('0x33')][_0x5636('0x35')]?_0x488c47['attributes']:_0xaaa8cc['model'];if(!_0x539378[_0x5636('0x31')][_0x5636('0x36')](_0x5636('0x37'))){_0x488c47[_0x5636('0x20')]=qs[_0x5636('0x20')](_0x539378[_0x5636('0x31')][_0x5636('0x20')]);_0x488c47['offset']=qs[_0x5636('0x1e')](_0x539378[_0x5636('0x31')][_0x5636('0x1e')]);}_0x488c47[_0x5636('0x38')]=qs[_0x5636('0x39')](_0x539378['query']['sort']);_0x488c47[_0x5636('0x3a')]=qs[_0x5636('0x3b')](_[_0x5636('0x3c')](_0x539378[_0x5636('0x31')],_0xaaa8cc[_0x5636('0x3b')]),_0x571638);if(_0x539378[_0x5636('0x31')][_0x5636('0x3d')]){_0x488c47[_0x5636('0x3a')]=_['merge'](_0x488c47[_0x5636('0x3a')],{'$or':_[_0x5636('0x3e')](_0x571638,function(_0x395cb8){if(_0x395cb8['type']!==_0x5636('0x3f')){var _0x4c5dff={};_0x4c5dff[_0x395cb8[_0x5636('0x2a')]]={'$like':'%'+_0x539378[_0x5636('0x31')][_0x5636('0x3d')]+'%'};return _0x4c5dff;}})});}_0x488c47=_[_0x5636('0x40')]({},_0x488c47,_0x539378['options']);var _0x245867={'where':_0x488c47[_0x5636('0x3a')]};return db['FaxTransferReport'][_0x5636('0x21')](_0x245867)[_0x5636('0x26')](function(_0x42635b){_0x43f580[_0x5636('0x21')]=_0x42635b;if(_0x539378['query'][_0x5636('0x41')]){_0x488c47[_0x5636('0x42')]=[{'all':!![]}];}return db[_0x5636('0x43')]['findAll'](_0x488c47);})[_0x5636('0x26')](function(_0x390667){_0x43f580[_0x5636('0x44')]=_0x390667;return _0x43f580;})[_0x5636('0x26')](respondWithFilteredResult(_0x2b2b60,_0x488c47))[_0x5636('0x45')](handleError(_0x2b2b60,null));};exports['show']=function(_0x4315a9,_0x6cfe01){var _0x30a104={'raw':!![],'where':{'id':_0x4315a9[_0x5636('0x46')]['id']}},_0x5da6fa={};_0x5da6fa[_0x5636('0x30')]=_[_0x5636('0x47')](db['FaxTransferReport']['rawAttributes']);_0x5da6fa[_0x5636('0x31')]=_[_0x5636('0x47')](_0x4315a9[_0x5636('0x31')]);_0x5da6fa[_0x5636('0x3b')]=_[_0x5636('0x32')](_0x5da6fa['model'],_0x5da6fa[_0x5636('0x31')]);_0x30a104[_0x5636('0x33')]=_['intersection'](_0x5da6fa['model'],qs['fields'](_0x4315a9[_0x5636('0x31')]['fields']));_0x30a104['attributes']=_0x30a104[_0x5636('0x33')][_0x5636('0x35')]?_0x30a104[_0x5636('0x33')]:_0x5da6fa[_0x5636('0x30')];if(_0x4315a9[_0x5636('0x31')][_0x5636('0x41')]){_0x30a104[_0x5636('0x42')]=[{'all':!![]}];}_0x30a104=_[_0x5636('0x40')]({},_0x30a104,_0x4315a9['options']);return db[_0x5636('0x43')][_0x5636('0x48')](_0x30a104)[_0x5636('0x26')](handleEntityNotFound(_0x6cfe01,null))['then'](respondWithResult(_0x6cfe01,null))['catch'](handleError(_0x6cfe01,null));};exports[_0x5636('0x49')]=function(_0x255383,_0x2d6da7){return db[_0x5636('0x43')][_0x5636('0x49')](_0x255383[_0x5636('0x4a')],{})[_0x5636('0x26')](respondWithResult(_0x2d6da7,0xc9))[_0x5636('0x45')](handleError(_0x2d6da7,null));};exports[_0x5636('0x25')]=function(_0x3013dd,_0x3f100f){if(_0x3013dd[_0x5636('0x4a')]['id']){delete _0x3013dd[_0x5636('0x4a')]['id'];}return db[_0x5636('0x43')][_0x5636('0x48')]({'where':{'id':_0x3013dd['params']['id']}})[_0x5636('0x26')](handleEntityNotFound(_0x3f100f,null))[_0x5636('0x26')](saveUpdates(_0x3013dd[_0x5636('0x4a')],null))[_0x5636('0x26')](respondWithResult(_0x3f100f,null))[_0x5636('0x45')](handleError(_0x3f100f,null));};exports[_0x5636('0x27')]=function(_0x8f8814,_0x5beb61){return db[_0x5636('0x43')][_0x5636('0x48')]({'where':{'id':_0x8f8814['params']['id']}})['then'](handleEntityNotFound(_0x5beb61,null))[_0x5636('0x26')](removeEntity(_0x5beb61,null))[_0x5636('0x45')](handleError(_0x5beb61,null));};exports['describe']=function(_0x2d9fe7,_0x41cf95){return db['FaxTransferReport'][_0x5636('0x4b')]()[_0x5636('0x26')](respondWithResult(_0x41cf95,null))['catch'](handleError(_0x41cf95,null));}; \ No newline at end of file +var _0xc77d=['sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','save','then','destroy','error','stack','name','send','index','map','FaxTransferReport','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','rawAttributes','options','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../mysqldb'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0xc77d,0x15c));var _0xdc77=function(_0x657e65,_0x307cb8){_0x657e65=_0x657e65-0x0;var _0x24c8ea=_0xc77d[_0x657e65];return _0x24c8ea;};'use strict';var emlformat=require(_0xdc77('0x0'));var rimraf=require(_0xdc77('0x1'));var zipdir=require(_0xdc77('0x2'));var jsonpatch=require(_0xdc77('0x3'));var rp=require(_0xdc77('0x4'));var moment=require(_0xdc77('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xdc77('0x6'));var util=require(_0xdc77('0x7'));var path=require(_0xdc77('0x8'));var sox=require(_0xdc77('0x9'));var csv=require(_0xdc77('0xa'));var ejs=require(_0xdc77('0xb'));var fs=require('fs');var fs_extra=require(_0xdc77('0xc'));var _=require(_0xdc77('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xdc77('0xe'));var toCsv=require(_0xdc77('0xa'));var querystring=require(_0xdc77('0xf'));var Papa=require('papaparse');var Redis=require(_0xdc77('0x10'));var authService=require(_0xdc77('0x11'));var qs=require(_0xdc77('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xdc77('0x13'));var utils=require(_0xdc77('0x14'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xdc77('0x15'))['db'];function respondWithStatusCode(_0x1ca1b4,_0x126073){_0x126073=_0x126073||0xcc;return function(_0x1f55cc){if(_0x1f55cc){return _0x1ca1b4[_0xdc77('0x16')](_0x126073);}return _0x1ca1b4[_0xdc77('0x17')](_0x126073)[_0xdc77('0x18')]();};}function respondWithResult(_0x450392,_0x63e450){_0x63e450=_0x63e450||0xc8;return function(_0x46510f){if(_0x46510f){return _0x450392[_0xdc77('0x17')](_0x63e450)['json'](_0x46510f);}};}function respondWithFilteredResult(_0x1275f2,_0x368058){return function(_0x3cfda){if(_0x3cfda){var _0x18633c=typeof _0x368058[_0xdc77('0x19')]===_0xdc77('0x1a')&&typeof _0x368058[_0xdc77('0x1b')]===_0xdc77('0x1a');var _0xc49fbc=_0x3cfda[_0xdc77('0x1c')];var _0x4dfdf5=_0x18633c?0x0:_0x368058['offset'];var _0x374ce0=_0x18633c?_0x3cfda[_0xdc77('0x1c')]:_0x368058[_0xdc77('0x19')]+_0x368058[_0xdc77('0x1b')];var _0x363b49;if(_0x374ce0>=_0xc49fbc){_0x374ce0=_0xc49fbc;_0x363b49=0xc8;}else{_0x363b49=0xce;}_0x1275f2[_0xdc77('0x17')](_0x363b49);return _0x1275f2['set'](_0xdc77('0x1d'),_0x4dfdf5+'-'+_0x374ce0+'/'+_0xc49fbc)[_0xdc77('0x1e')](_0x3cfda);}return null;};}function patchUpdates(_0x446664){return function(_0x4d39b6){try{jsonpatch[_0xdc77('0x1f')](_0x4d39b6,_0x446664,!![]);}catch(_0x4d61f0){return BPromise['reject'](_0x4d61f0);}return _0x4d39b6[_0xdc77('0x20')]();};}function saveUpdates(_0x13df8e,_0x24a734){return function(_0x26fee0){if(_0x26fee0){return _0x26fee0['update'](_0x13df8e)[_0xdc77('0x21')](function(_0x38b91e){return _0x38b91e;});}return null;};}function removeEntity(_0x5c87a4,_0xccc46b){return function(_0x312a35){if(_0x312a35){return _0x312a35[_0xdc77('0x22')]()['then'](function(){_0x5c87a4[_0xdc77('0x17')](0xcc)[_0xdc77('0x18')]();});}};}function handleEntityNotFound(_0x29bc56,_0x636a20){return function(_0xc7179c){if(!_0xc7179c){_0x29bc56[_0xdc77('0x16')](0x194);}return _0xc7179c;};}function handleError(_0x2d49cd,_0x1b3297){_0x1b3297=_0x1b3297||0x1f4;return function(_0x30b7c4){logger[_0xdc77('0x23')](_0x30b7c4[_0xdc77('0x24')]);if(_0x30b7c4[_0xdc77('0x25')]){delete _0x30b7c4[_0xdc77('0x25')];}_0x2d49cd['status'](_0x1b3297)[_0xdc77('0x26')](_0x30b7c4);};}exports[_0xdc77('0x27')]=function(_0x210dd5,_0x365abe){var _0x564078={},_0x196516={},_0x484e3f={'count':0x0,'rows':[]};var _0x58dd0a=_[_0xdc77('0x28')](db[_0xdc77('0x29')]['rawAttributes'],function(_0x3cd841){return{'name':_0x3cd841[_0xdc77('0x2a')],'type':_0x3cd841[_0xdc77('0x2b')][_0xdc77('0x2c')]};});_0x196516[_0xdc77('0x2d')]=_[_0xdc77('0x28')](_0x58dd0a,_0xdc77('0x25'));_0x196516[_0xdc77('0x2e')]=_[_0xdc77('0x2f')](_0x210dd5[_0xdc77('0x2e')]);_0x196516[_0xdc77('0x30')]=_[_0xdc77('0x31')](_0x196516[_0xdc77('0x2d')],_0x196516['query']);_0x564078[_0xdc77('0x32')]=_[_0xdc77('0x31')](_0x196516[_0xdc77('0x2d')],qs[_0xdc77('0x33')](_0x210dd5['query'][_0xdc77('0x33')]));_0x564078['attributes']=_0x564078['attributes'][_0xdc77('0x34')]?_0x564078[_0xdc77('0x32')]:_0x196516[_0xdc77('0x2d')];if(!_0x210dd5[_0xdc77('0x2e')][_0xdc77('0x35')](_0xdc77('0x36'))){_0x564078[_0xdc77('0x1b')]=qs['limit'](_0x210dd5[_0xdc77('0x2e')][_0xdc77('0x1b')]);_0x564078[_0xdc77('0x19')]=qs[_0xdc77('0x19')](_0x210dd5[_0xdc77('0x2e')][_0xdc77('0x19')]);}_0x564078[_0xdc77('0x37')]=qs[_0xdc77('0x38')](_0x210dd5['query'][_0xdc77('0x38')]);_0x564078[_0xdc77('0x39')]=qs[_0xdc77('0x30')](_[_0xdc77('0x3a')](_0x210dd5[_0xdc77('0x2e')],_0x196516[_0xdc77('0x30')]),_0x58dd0a);if(_0x210dd5['query'][_0xdc77('0x3b')]){_0x564078[_0xdc77('0x39')]=_[_0xdc77('0x3c')](_0x564078['where'],{'$or':_[_0xdc77('0x28')](_0x58dd0a,function(_0x26fdfb){if(_0x26fdfb[_0xdc77('0x2b')]!==_0xdc77('0x3d')){var _0x40a148={};_0x40a148[_0x26fdfb['name']]={'$like':'%'+_0x210dd5['query'][_0xdc77('0x3b')]+'%'};return _0x40a148;}})});}_0x564078=_[_0xdc77('0x3c')]({},_0x564078,_0x210dd5['options']);var _0x455e19={'where':_0x564078[_0xdc77('0x39')]};return db[_0xdc77('0x29')][_0xdc77('0x1c')](_0x455e19)[_0xdc77('0x21')](function(_0x25a698){_0x484e3f[_0xdc77('0x1c')]=_0x25a698;if(_0x210dd5[_0xdc77('0x2e')][_0xdc77('0x3e')]){_0x564078[_0xdc77('0x3f')]=[{'all':!![]}];}return db[_0xdc77('0x29')][_0xdc77('0x40')](_0x564078);})[_0xdc77('0x21')](function(_0x127a50){_0x484e3f[_0xdc77('0x41')]=_0x127a50;return _0x484e3f;})['then'](respondWithFilteredResult(_0x365abe,_0x564078))[_0xdc77('0x42')](handleError(_0x365abe,null));};exports[_0xdc77('0x43')]=function(_0x47f893,_0x3e2bec){var _0x35ba42={'raw':!![],'where':{'id':_0x47f893[_0xdc77('0x44')]['id']}},_0x27d732={};_0x27d732[_0xdc77('0x2d')]=_[_0xdc77('0x2f')](db[_0xdc77('0x29')][_0xdc77('0x45')]);_0x27d732[_0xdc77('0x2e')]=_[_0xdc77('0x2f')](_0x47f893[_0xdc77('0x2e')]);_0x27d732[_0xdc77('0x30')]=_[_0xdc77('0x31')](_0x27d732[_0xdc77('0x2d')],_0x27d732[_0xdc77('0x2e')]);_0x35ba42['attributes']=_[_0xdc77('0x31')](_0x27d732[_0xdc77('0x2d')],qs[_0xdc77('0x33')](_0x47f893['query'][_0xdc77('0x33')]));_0x35ba42[_0xdc77('0x32')]=_0x35ba42['attributes']['length']?_0x35ba42[_0xdc77('0x32')]:_0x27d732[_0xdc77('0x2d')];if(_0x47f893[_0xdc77('0x2e')][_0xdc77('0x3e')]){_0x35ba42[_0xdc77('0x3f')]=[{'all':!![]}];}_0x35ba42=_[_0xdc77('0x3c')]({},_0x35ba42,_0x47f893[_0xdc77('0x46')]);return db['FaxTransferReport'][_0xdc77('0x47')](_0x35ba42)['then'](handleEntityNotFound(_0x3e2bec,null))['then'](respondWithResult(_0x3e2bec,null))[_0xdc77('0x42')](handleError(_0x3e2bec,null));};exports[_0xdc77('0x48')]=function(_0x4a47b4,_0xaf6a05){return db['FaxTransferReport']['create'](_0x4a47b4[_0xdc77('0x49')],{})[_0xdc77('0x21')](respondWithResult(_0xaf6a05,0xc9))['catch'](handleError(_0xaf6a05,null));};exports['update']=function(_0x2b0254,_0x2753b3){if(_0x2b0254[_0xdc77('0x49')]['id']){delete _0x2b0254[_0xdc77('0x49')]['id'];}return db[_0xdc77('0x29')]['find']({'where':{'id':_0x2b0254[_0xdc77('0x44')]['id']}})[_0xdc77('0x21')](handleEntityNotFound(_0x2753b3,null))[_0xdc77('0x21')](saveUpdates(_0x2b0254[_0xdc77('0x49')],null))[_0xdc77('0x21')](respondWithResult(_0x2753b3,null))[_0xdc77('0x42')](handleError(_0x2753b3,null));};exports['destroy']=function(_0x1b58fe,_0x17f2a0){return db[_0xdc77('0x29')][_0xdc77('0x47')]({'where':{'id':_0x1b58fe[_0xdc77('0x44')]['id']}})[_0xdc77('0x21')](handleEntityNotFound(_0x17f2a0,null))[_0xdc77('0x21')](removeEntity(_0x17f2a0,null))[_0xdc77('0x42')](handleError(_0x17f2a0,null));};exports['describe']=function(_0x4bdce6,_0x1afb5c){return db[_0xdc77('0x29')]['describe']()['then'](respondWithResult(_0x1afb5c,null))['catch'](handleError(_0x1afb5c,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index 7516173..9f97a3f 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 _0x63c7=['./faxTransferReport.attributes','report_fax_transfer','uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x177d4e,_0x2958cf){var _0x457974=function(_0xecd480){while(--_0xecd480){_0x177d4e['push'](_0x177d4e['shift']());}};_0x457974(++_0x2958cf);}(_0x63c7,0x1b0));var _0x763c=function(_0x397fb5,_0x4ce2c2){_0x397fb5=_0x397fb5-0x0;var _0x347bf8=_0x63c7[_0x397fb5];return _0x347bf8;};'use strict';var _=require(_0x763c('0x0'));var util=require(_0x763c('0x1'));var logger=require(_0x763c('0x2'))('api');var moment=require(_0x763c('0x3'));var BPromise=require(_0x763c('0x4'));var rp=require(_0x763c('0x5'));var fs=require('fs');var path=require(_0x763c('0x6'));var rimraf=require('rimraf');var config=require(_0x763c('0x7'));var attributes=require(_0x763c('0x8'));module['exports']=function(_0x32acb8,_0x1695d1){return _0x32acb8['define']('FaxTransferReport',attributes,{'tableName':_0x763c('0x9'),'paranoid':![],'indexes':[{'name':_0x763c('0xa'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x60d7=['path','rimraf','exports','define','FaxTransferReport','report_fax_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x233d86,_0x5a0db2){var _0x51388d=function(_0x5c244b){while(--_0x5c244b){_0x233d86['push'](_0x233d86['shift']());}};_0x51388d(++_0x5a0db2);}(_0x60d7,0x149));var _0x760d=function(_0x505fd7,_0x2c8098){_0x505fd7=_0x505fd7-0x0;var _0x20a663=_0x60d7[_0x505fd7];return _0x20a663;};'use strict';var _=require(_0x760d('0x0'));var util=require(_0x760d('0x1'));var logger=require(_0x760d('0x2'))(_0x760d('0x3'));var moment=require(_0x760d('0x4'));var BPromise=require(_0x760d('0x5'));var rp=require(_0x760d('0x6'));var fs=require('fs');var path=require(_0x760d('0x7'));var rimraf=require(_0x760d('0x8'));var config=require('../../config/environment');var attributes=require('./faxTransferReport.attributes');module[_0x760d('0x9')]=function(_0x42473d,_0x13cb45){return _0x42473d[_0x760d('0xa')](_0x760d('0xb'),attributes,{'tableName':_0x760d('0xc'),'paranoid':![],'indexes':[{'name':_0x760d('0xd'),'fields':[_0x760d('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 4d81a5f..4483845 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 _0xbc8f=['debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent'];(function(_0x17f403,_0x240058){var _0x5e1c42=function(_0x50f40b){while(--_0x50f40b){_0x17f403['push'](_0x17f403['shift']());}};_0x5e1c42(++_0x240058);}(_0xbc8f,0x17d));var _0xfbc8=function(_0x398e1c,_0x4e7020){_0x398e1c=_0x398e1c-0x0;var _0x33bb40=_0xbc8f[_0x398e1c];return _0x33bb40;};'use strict';var _=require(_0xfbc8('0x0'));var util=require(_0xfbc8('0x1'));var moment=require(_0xfbc8('0x2'));var BPromise=require(_0xfbc8('0x3'));var rs=require(_0xfbc8('0x4'));var fs=require('fs');var Redis=require(_0xfbc8('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xfbc8('0x6'));var logger=require('../../config/logger')(_0xfbc8('0x7'));var config=require(_0xfbc8('0x8'));var jayson=require(_0xfbc8('0x9'));var client=jayson[_0xfbc8('0xa')][_0xfbc8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x241527,_0x46e92c,_0x5e1f25){return new BPromise(function(_0x5d1f6d,_0x237f9f){return client['request'](_0x241527,_0x5e1f25)['then'](function(_0x390ff4){logger[_0xfbc8('0xc')](_0xfbc8('0xd'),_0x46e92c,_0xfbc8('0xe'));logger[_0xfbc8('0xf')](_0xfbc8('0x10'),_0x46e92c,_0xfbc8('0xe'),JSON[_0xfbc8('0x11')](_0x390ff4));if(_0x390ff4[_0xfbc8('0x12')]){if(_0x390ff4['error'][_0xfbc8('0x13')]===0x1f4){logger[_0xfbc8('0x12')](_0xfbc8('0xd'),_0x46e92c,_0x390ff4[_0xfbc8('0x12')][_0xfbc8('0x14')]);return _0x237f9f(_0x390ff4['error'][_0xfbc8('0x14')]);}logger[_0xfbc8('0x12')](_0xfbc8('0xd'),_0x46e92c,_0x390ff4[_0xfbc8('0x12')][_0xfbc8('0x14')]);return _0x5d1f6d(_0x390ff4[_0xfbc8('0x12')][_0xfbc8('0x14')]);}else{logger[_0xfbc8('0xc')]('FaxTransferReport,\x20%s,\x20%s',_0x46e92c,_0xfbc8('0xe'));_0x5d1f6d(_0x390ff4[_0xfbc8('0x15')][_0xfbc8('0x14')]);}})['catch'](function(_0xb9d1d){logger[_0xfbc8('0x12')]('FaxTransferReport,\x20%s,\x20%s',_0x46e92c,_0xb9d1d);_0x237f9f(_0xb9d1d);});});} \ No newline at end of file +var _0xf1d6=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','request','then','info','request\x20sent','stringify','error','message','FaxTransferReport,\x20%s,\x20%s','lodash','moment','bluebird','randomstring'];(function(_0x470be7,_0x181dfe){var _0x32063c=function(_0x3cda08){while(--_0x3cda08){_0x470be7['push'](_0x470be7['shift']());}};_0x32063c(++_0x181dfe);}(_0xf1d6,0xe6));var _0x6f1d=function(_0x5c431c,_0x3f1b8c){_0x5c431c=_0x5c431c-0x0;var _0x3ce6fb=_0xf1d6[_0x5c431c];return _0x3ce6fb;};'use strict';var _=require(_0x6f1d('0x0'));var util=require('util');var moment=require(_0x6f1d('0x1'));var BPromise=require(_0x6f1d('0x2'));var rs=require(_0x6f1d('0x3'));var fs=require('fs');var Redis=require(_0x6f1d('0x4'));var db=require(_0x6f1d('0x5'))['db'];var utils=require(_0x6f1d('0x6'));var logger=require('../../config/logger')(_0x6f1d('0x7'));var config=require(_0x6f1d('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x6f1d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x648710,_0x2b9369,_0xbf3e7b){return new BPromise(function(_0x1134c3,_0x5d584b){return client[_0x6f1d('0xa')](_0x648710,_0xbf3e7b)[_0x6f1d('0xb')](function(_0x1dc362){logger[_0x6f1d('0xc')]('FaxTransferReport,\x20%s,\x20%s',_0x2b9369,_0x6f1d('0xd'));logger['debug']('FaxTransferReport,\x20%s,\x20%s,\x20%s',_0x2b9369,_0x6f1d('0xd'),JSON[_0x6f1d('0xe')](_0x1dc362));if(_0x1dc362[_0x6f1d('0xf')]){if(_0x1dc362[_0x6f1d('0xf')]['code']===0x1f4){logger['error']('FaxTransferReport,\x20%s,\x20%s',_0x2b9369,_0x1dc362[_0x6f1d('0xf')][_0x6f1d('0x10')]);return _0x5d584b(_0x1dc362[_0x6f1d('0xf')][_0x6f1d('0x10')]);}logger[_0x6f1d('0xf')](_0x6f1d('0x11'),_0x2b9369,_0x1dc362[_0x6f1d('0xf')][_0x6f1d('0x10')]);return _0x1134c3(_0x1dc362['error'][_0x6f1d('0x10')]);}else{logger['info'](_0x6f1d('0x11'),_0x2b9369,_0x6f1d('0xd'));_0x1134c3(_0x1dc362['result'][_0x6f1d('0x10')]);}})['catch'](function(_0x5b3c99){logger[_0x6f1d('0xf')](_0x6f1d('0x11'),_0x2b9369,_0x5b3c99);_0x5d584b(_0x5b3c99);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index 0e678b1..e5da4d3 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 _0xc12a=['../../components/auth/service','../../config/environment','./faxTransferReport.controller','index','/describe','get','/:id','isAuthenticated','show','post','create','put','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra'];(function(_0x22431e,_0x5af0a3){var _0xd978e9=function(_0x2bbdd7){while(--_0x2bbdd7){_0x22431e['push'](_0x22431e['shift']());}};_0xd978e9(++_0x5af0a3);}(_0xc12a,0xeb));var _0xac12=function(_0x6ee7c2,_0x4e5c43){_0x6ee7c2=_0x6ee7c2-0x0;var _0x2f52fe=_0xc12a[_0x6ee7c2];return _0x2f52fe;};'use strict';var multer=require(_0xac12('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xac12('0x1'));var express=require(_0xac12('0x2'));var router=express[_0xac12('0x3')]();var fs_extra=require(_0xac12('0x4'));var auth=require(_0xac12('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xac12('0x6'));var controller=require(_0xac12('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xac12('0x8')]);router['get'](_0xac12('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0xac12('0xa')](_0xac12('0xb'),auth[_0xac12('0xc')](),controller[_0xac12('0xd')]);router[_0xac12('0xe')]('/',auth['isAuthenticated'](),controller[_0xac12('0xf')]);router[_0xac12('0x10')](_0xac12('0xb'),auth[_0xac12('0xc')](),controller['update']);router[_0xac12('0x11')](_0xac12('0xb'),auth[_0xac12('0xc')](),controller[_0xac12('0x12')]);module[_0xac12('0x13')]=router; \ No newline at end of file +var _0x3aa1=['isAuthenticated','index','/describe','describe','/:id','show','post','update','delete','destroy','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./faxTransferReport.controller','get'];(function(_0x3bddf6,_0xf25ba3){var _0xe9ac51=function(_0x4f751f){while(--_0x4f751f){_0x3bddf6['push'](_0x3bddf6['shift']());}};_0xe9ac51(++_0xf25ba3);}(_0x3aa1,0x10e));var _0x13aa=function(_0x2bd628,_0x5063e9){_0x2bd628=_0x2bd628-0x0;var _0x571fb7=_0x3aa1[_0x2bd628];return _0x571fb7;};'use strict';var multer=require('multer');var util=require(_0x13aa('0x0'));var path=require(_0x13aa('0x1'));var timeout=require(_0x13aa('0x2'));var express=require(_0x13aa('0x3'));var router=express[_0x13aa('0x4')]();var fs_extra=require(_0x13aa('0x5'));var auth=require(_0x13aa('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x13aa('0x7'));var controller=require(_0x13aa('0x8'));router[_0x13aa('0x9')]('/',auth[_0x13aa('0xa')](),controller[_0x13aa('0xb')]);router[_0x13aa('0x9')](_0x13aa('0xc'),auth['isAuthenticated'](),controller[_0x13aa('0xd')]);router[_0x13aa('0x9')](_0x13aa('0xe'),auth['isAuthenticated'](),controller[_0x13aa('0xf')]);router[_0x13aa('0x10')]('/',auth[_0x13aa('0xa')](),controller['create']);router['put'](_0x13aa('0xe'),auth[_0x13aa('0xa')](),controller[_0x13aa('0x11')]);router[_0x13aa('0x12')](_0x13aa('0xe'),auth[_0x13aa('0xa')](),controller[_0x13aa('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index 87001b6..1dacd57 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 _0x4f37=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','get','index','/:id','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration'];(function(_0x220dbb,_0x99328d){var _0x2b77de=function(_0x15e966){while(--_0x15e966){_0x220dbb['push'](_0x220dbb['shift']());}};_0x2b77de(++_0x99328d);}(_0x4f37,0x149));var _0x74f3=function(_0x6ab156,_0x54824f){_0x6ab156=_0x6ab156-0x0;var _0x55b335=_0x4f37[_0x6ab156];return _0x55b335;};'use strict';var multer=require(_0x74f3('0x0'));var util=require(_0x74f3('0x1'));var path=require(_0x74f3('0x2'));var timeout=require(_0x74f3('0x3'));var express=require(_0x74f3('0x4'));var router=express[_0x74f3('0x5')]();var fs_extra=require(_0x74f3('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x74f3('0x7'));var config=require(_0x74f3('0x8'));var controller=require(_0x74f3('0x9'));router[_0x74f3('0xa')]('/',auth['isAuthenticated'](),controller[_0x74f3('0xb')]);router[_0x74f3('0xa')](_0x74f3('0xc'),auth[_0x74f3('0xd')](),controller[_0x74f3('0xe')]);router[_0x74f3('0xa')](_0x74f3('0xf'),auth[_0x74f3('0xd')](),controller[_0x74f3('0x10')]);router[_0x74f3('0xa')](_0x74f3('0x11'),auth[_0x74f3('0xd')](),controller[_0x74f3('0x12')]);router[_0x74f3('0x13')]('/',auth[_0x74f3('0xd')](),controller[_0x74f3('0x14')]);router[_0x74f3('0x13')]('/:id/configurations',auth[_0x74f3('0xd')](),controller[_0x74f3('0x15')]);router[_0x74f3('0x16')](_0x74f3('0xc'),auth['isAuthenticated'](),controller[_0x74f3('0x17')]);router[_0x74f3('0x18')](_0x74f3('0xc'),auth[_0x74f3('0xd')](),controller[_0x74f3('0x19')]);module[_0x74f3('0x1a')]=router; \ No newline at end of file +var _0xfcca=['Router','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','get','isAuthenticated','index','show','/:id/configurations','getConfigurations','/:id/fields','post','create','addConfiguration','put','/:id','update','delete','destroy','exports','util','path','connect-timeout'];(function(_0x1203f,_0x554bbc){var _0x365f0a=function(_0x3531d0){while(--_0x3531d0){_0x1203f['push'](_0x1203f['shift']());}};_0x365f0a(++_0x554bbc);}(_0xfcca,0x1e0));var _0xafcc=function(_0x4835ea,_0xc7a2c1){_0x4835ea=_0x4835ea-0x0;var _0x16ff41=_0xfcca[_0x4835ea];return _0x16ff41;};'use strict';var multer=require('multer');var util=require(_0xafcc('0x0'));var path=require(_0xafcc('0x1'));var timeout=require(_0xafcc('0x2'));var express=require('express');var router=express[_0xafcc('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xafcc('0x4'));var config=require(_0xafcc('0x5'));var controller=require(_0xafcc('0x6'));router[_0xafcc('0x7')]('/',auth[_0xafcc('0x8')](),controller[_0xafcc('0x9')]);router[_0xafcc('0x7')]('/:id',auth[_0xafcc('0x8')](),controller[_0xafcc('0xa')]);router[_0xafcc('0x7')](_0xafcc('0xb'),auth[_0xafcc('0x8')](),controller[_0xafcc('0xc')]);router[_0xafcc('0x7')](_0xafcc('0xd'),auth[_0xafcc('0x8')](),controller['getFields']);router[_0xafcc('0xe')]('/',auth[_0xafcc('0x8')](),controller[_0xafcc('0xf')]);router['post']('/:id/configurations',auth[_0xafcc('0x8')](),controller[_0xafcc('0x10')]);router[_0xafcc('0x11')](_0xafcc('0x12'),auth[_0xafcc('0x8')](),controller[_0xafcc('0x13')]);router[_0xafcc('0x14')](_0xafcc('0x12'),auth[_0xafcc('0x8')](),controller[_0xafcc('0x15')]);module[_0xafcc('0x16')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index e73065f..ac53cac 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 _0x6ce6=['ENUM','basic','integrationTab','newTab','sequelize','exports','STRING'];(function(_0x575a31,_0x56336f){var _0x5d7dad=function(_0x2c8c09){while(--_0x2c8c09){_0x575a31['push'](_0x575a31['shift']());}};_0x5d7dad(++_0x56336f);}(_0x6ce6,0x146));var _0x66ce=function(_0x5e7b9b,_0x559763){_0x5e7b9b=_0x5e7b9b-0x0;var _0x37678b=_0x6ce6[_0x5e7b9b];return _0x37678b;};'use strict';var Sequelize=require(_0x66ce('0x0'));module[_0x66ce('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x66ce('0x2')]},'username':{'type':Sequelize[_0x66ce('0x2')]},'remoteUri':{'type':Sequelize[_0x66ce('0x2')]},'authType':{'type':Sequelize[_0x66ce('0x3')]('basic'),'defaultValue':_0x66ce('0x4')},'password':{'type':Sequelize['STRING']},'consumerKey':{'type':Sequelize[_0x66ce('0x2')]},'consumerSecret':{'type':Sequelize[_0x66ce('0x2')]},'token':{'type':Sequelize[_0x66ce('0x2')]},'tokenSecret':{'type':Sequelize[_0x66ce('0x2')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x66ce('0x3')](_0x66ce('0x5'),_0x66ce('0x6')),'defaultValue':_0x66ce('0x5')}}; \ No newline at end of file +var _0x3b46=['exports','STRING','ENUM','basic','integrationTab','newTab','sequelize'];(function(_0xcf5c50,_0x4884e2){var _0x2f3fdd=function(_0x38550a){while(--_0x38550a){_0xcf5c50['push'](_0xcf5c50['shift']());}};_0x2f3fdd(++_0x4884e2);}(_0x3b46,0x110));var _0x63b4=function(_0x1c510a,_0x1413a9){_0x1c510a=_0x1c510a-0x0;var _0x23cedd=_0x3b46[_0x1c510a];return _0x23cedd;};'use strict';var Sequelize=require(_0x63b4('0x0'));module[_0x63b4('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x63b4('0x2')]},'username':{'type':Sequelize[_0x63b4('0x2')]},'remoteUri':{'type':Sequelize['STRING']},'authType':{'type':Sequelize[_0x63b4('0x3')](_0x63b4('0x4')),'defaultValue':_0x63b4('0x4')},'password':{'type':Sequelize[_0x63b4('0x2')]},'consumerKey':{'type':Sequelize['STRING']},'consumerSecret':{'type':Sequelize[_0x63b4('0x2')]},'token':{'type':Sequelize[_0x63b4('0x2')]},'tokenSecret':{'type':Sequelize[_0x63b4('0x2')]},'serverUrl':{'type':Sequelize[_0x63b4('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x63b4('0x3')](_0x63b4('0x5'),_0x63b4('0x6')),'defaultValue':_0x63b4('0x5')}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index bafa796..50293c5 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 _0x4435=['type','key','model','query','keys','filters','attributes','intersection','length','hasOwnProperty','order','sort','where','filter','merge','options','includeAll','include','findAll','catch','show','fields','find','body','getConfigurations','findOne','params','DeskConfiguration','pick','map','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','create','DeskField','getFields','priority','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','slice','substring','lastIndexOf','GET','format','%s/custom_fields','application/json','basic','headers','Basic\x20%s','%s:%s','concat','_embedded','active','label','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','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','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','stack','name','send','index','DeskAccount','rawAttributes'];(function(_0xdc4d1d,_0x313c69){var _0x58e9ad=function(_0x372848){while(--_0x372848){_0xdc4d1d['push'](_0xdc4d1d['shift']());}};_0x58e9ad(++_0x313c69);}(_0x4435,0x19a));var _0x5443=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0x4435[_0x565c49];return _0x20ca34;};'use strict';var emlformat=require(_0x5443('0x0'));var rimraf=require(_0x5443('0x1'));var zipdir=require(_0x5443('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x5443('0x3'));var BPromise=require(_0x5443('0x4'));var Mustache=require(_0x5443('0x5'));var util=require(_0x5443('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x5443('0x7'));var ejs=require(_0x5443('0x8'));var fs=require('fs');var fs_extra=require(_0x5443('0x9'));var _=require('lodash');var squel=require(_0x5443('0xa'));var crypto=require(_0x5443('0xb'));var jsforce=require(_0x5443('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x5443('0x7'));var querystring=require(_0x5443('0xd'));var Papa=require(_0x5443('0xe'));var Redis=require(_0x5443('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x5443('0x10'));var as=require(_0x5443('0x11'));var hardwareService=require(_0x5443('0x12'));var logger=require(_0x5443('0x13'))(_0x5443('0x14'));var utils=require(_0x5443('0x15'));var config=require(_0x5443('0x16'));var licenseUtil=require(_0x5443('0x17'));var db=require(_0x5443('0x18'))['db'];var integrations=require(_0x5443('0x19'));function respondWithStatusCode(_0x5af348,_0x1071dd){_0x1071dd=_0x1071dd||0xcc;return function(_0x5f3b70){if(_0x5f3b70){return _0x5af348[_0x5443('0x1a')](_0x1071dd);}return _0x5af348[_0x5443('0x1b')](_0x1071dd)[_0x5443('0x1c')]();};}function respondWithResult(_0x589511,_0x27f60c){_0x27f60c=_0x27f60c||0xc8;return function(_0x4d75e4){if(_0x4d75e4){return _0x589511[_0x5443('0x1b')](_0x27f60c)[_0x5443('0x1d')](_0x4d75e4);}};}function respondWithFilteredResult(_0x18cdd1,_0x5c9bf8){return function(_0x46e608){if(_0x46e608){var _0x48c486=typeof _0x5c9bf8[_0x5443('0x1e')]===_0x5443('0x1f')&&typeof _0x5c9bf8[_0x5443('0x20')]==='undefined';var _0x5d3ba6=_0x46e608[_0x5443('0x21')];var _0x4e71c3=_0x48c486?0x0:_0x5c9bf8[_0x5443('0x1e')];var _0x554d4b=_0x48c486?_0x46e608[_0x5443('0x21')]:_0x5c9bf8['offset']+_0x5c9bf8[_0x5443('0x20')];var _0x93af03;if(_0x554d4b>=_0x5d3ba6){_0x554d4b=_0x5d3ba6;_0x93af03=0xc8;}else{_0x93af03=0xce;}_0x18cdd1[_0x5443('0x1b')](_0x93af03);return _0x18cdd1[_0x5443('0x22')](_0x5443('0x23'),_0x4e71c3+'-'+_0x554d4b+'/'+_0x5d3ba6)[_0x5443('0x1d')](_0x46e608);}return null;};}function patchUpdates(_0x31168c){return function(_0x2e3331){try{jsonpatch['apply'](_0x2e3331,_0x31168c,!![]);}catch(_0x3dd557){return BPromise[_0x5443('0x24')](_0x3dd557);}return _0x2e3331['save']();};}function saveUpdates(_0x2cd22e,_0x524d4f){return function(_0x244a6f){if(_0x244a6f){return _0x244a6f[_0x5443('0x25')](_0x2cd22e)[_0x5443('0x26')](function(_0x55c9ec){return _0x55c9ec;});}return null;};}function removeEntity(_0x9747e9,_0x44040c){return function(_0x3c7f0c){if(_0x3c7f0c){return _0x3c7f0c[_0x5443('0x27')]()[_0x5443('0x26')](function(){_0x9747e9[_0x5443('0x1b')](0xcc)[_0x5443('0x1c')]();});}};}function handleEntityNotFound(_0x1ab27a,_0x840dc3){return function(_0x23e1b3){if(!_0x23e1b3){_0x1ab27a['sendStatus'](0x194);}return _0x23e1b3;};}function handleError(_0x505d40,_0x233dc6){_0x233dc6=_0x233dc6||0x1f4;return function(_0x371725){logger['error'](_0x371725[_0x5443('0x28')]);if(_0x371725[_0x5443('0x29')]){delete _0x371725[_0x5443('0x29')];}_0x505d40[_0x5443('0x1b')](_0x233dc6)[_0x5443('0x2a')](_0x371725);};}exports[_0x5443('0x2b')]=function(_0x29029a,_0x535167){var _0x4d41f0={},_0x5d202e={},_0x5aa169={'count':0x0,'rows':[]};var _0x3a8dd0=_['map'](db[_0x5443('0x2c')][_0x5443('0x2d')],function(_0x55cacc){return{'name':_0x55cacc['fieldName'],'type':_0x55cacc[_0x5443('0x2e')][_0x5443('0x2f')]};});_0x5d202e[_0x5443('0x30')]=_['map'](_0x3a8dd0,_0x5443('0x29'));_0x5d202e[_0x5443('0x31')]=_[_0x5443('0x32')](_0x29029a[_0x5443('0x31')]);_0x5d202e[_0x5443('0x33')]=_['intersection'](_0x5d202e[_0x5443('0x30')],_0x5d202e[_0x5443('0x31')]);_0x4d41f0[_0x5443('0x34')]=_[_0x5443('0x35')](_0x5d202e[_0x5443('0x30')],qs['fields'](_0x29029a[_0x5443('0x31')]['fields']));_0x4d41f0['attributes']=_0x4d41f0['attributes'][_0x5443('0x36')]?_0x4d41f0[_0x5443('0x34')]:_0x5d202e[_0x5443('0x30')];if(!_0x29029a[_0x5443('0x31')][_0x5443('0x37')]('nolimit')){_0x4d41f0[_0x5443('0x20')]=qs[_0x5443('0x20')](_0x29029a[_0x5443('0x31')][_0x5443('0x20')]);_0x4d41f0[_0x5443('0x1e')]=qs[_0x5443('0x1e')](_0x29029a[_0x5443('0x31')]['offset']);}_0x4d41f0[_0x5443('0x38')]=qs[_0x5443('0x39')](_0x29029a[_0x5443('0x31')][_0x5443('0x39')]);_0x4d41f0[_0x5443('0x3a')]=qs[_0x5443('0x33')](_['pick'](_0x29029a[_0x5443('0x31')],_0x5d202e[_0x5443('0x33')]),_0x3a8dd0);if(_0x29029a[_0x5443('0x31')][_0x5443('0x3b')]){_0x4d41f0[_0x5443('0x3a')]=_[_0x5443('0x3c')](_0x4d41f0[_0x5443('0x3a')],{'$or':_['map'](_0x3a8dd0,function(_0x20741b){if(_0x20741b[_0x5443('0x2e')]!=='VIRTUAL'){var _0x51366f={};_0x51366f[_0x20741b[_0x5443('0x29')]]={'$like':'%'+_0x29029a['query']['filter']+'%'};return _0x51366f;}})});}_0x4d41f0=_[_0x5443('0x3c')]({},_0x4d41f0,_0x29029a[_0x5443('0x3d')]);var _0x3b7929={'where':_0x4d41f0[_0x5443('0x3a')]};return db[_0x5443('0x2c')]['count'](_0x3b7929)[_0x5443('0x26')](function(_0x5c427d){_0x5aa169[_0x5443('0x21')]=_0x5c427d;if(_0x29029a[_0x5443('0x31')][_0x5443('0x3e')]){_0x4d41f0[_0x5443('0x3f')]=[{'all':!![]}];}return db[_0x5443('0x2c')][_0x5443('0x40')](_0x4d41f0);})[_0x5443('0x26')](function(_0x53f1ba){_0x5aa169['rows']=_0x53f1ba;return _0x5aa169;})[_0x5443('0x26')](respondWithFilteredResult(_0x535167,_0x4d41f0))[_0x5443('0x41')](handleError(_0x535167,null));};exports[_0x5443('0x42')]=function(_0x3bee74,_0x150c6a){var _0x21fbcf={'raw':![],'where':{'id':_0x3bee74['params']['id']}},_0x22a1ab={};_0x22a1ab[_0x5443('0x30')]=_[_0x5443('0x32')](db[_0x5443('0x2c')]['rawAttributes']);_0x22a1ab[_0x5443('0x31')]=_['keys'](_0x3bee74['query']);_0x22a1ab[_0x5443('0x33')]=_[_0x5443('0x35')](_0x22a1ab['model'],_0x22a1ab['query']);_0x21fbcf['attributes']=_[_0x5443('0x35')](_0x22a1ab[_0x5443('0x30')],qs['fields'](_0x3bee74['query'][_0x5443('0x43')]));_0x21fbcf[_0x5443('0x34')]=_0x21fbcf[_0x5443('0x34')][_0x5443('0x36')]?_0x21fbcf[_0x5443('0x34')]:_0x22a1ab[_0x5443('0x30')];if(_0x3bee74['query']['includeAll']){_0x21fbcf[_0x5443('0x3f')]=[{'all':!![]}];}_0x21fbcf=_[_0x5443('0x3c')]({},_0x21fbcf,_0x3bee74['options']);return db[_0x5443('0x2c')][_0x5443('0x44')](_0x21fbcf)['then'](handleEntityNotFound(_0x150c6a,null))['then'](respondWithResult(_0x150c6a,null))[_0x5443('0x41')](handleError(_0x150c6a,null));};exports['create']=function(_0x3d4c51,_0xb30d11){return db[_0x5443('0x2c')]['create'](_0x3d4c51[_0x5443('0x45')],{})[_0x5443('0x26')](respondWithResult(_0xb30d11,0xc9))[_0x5443('0x41')](handleError(_0xb30d11,null));};exports[_0x5443('0x25')]=function(_0x348201,_0x22b7af){if(_0x348201[_0x5443('0x45')]['id']){delete _0x348201[_0x5443('0x45')]['id'];}return db[_0x5443('0x2c')][_0x5443('0x44')]({'where':{'id':_0x348201['params']['id']}})['then'](handleEntityNotFound(_0x22b7af,null))[_0x5443('0x26')](saveUpdates(_0x348201[_0x5443('0x45')],null))[_0x5443('0x26')](respondWithResult(_0x22b7af,null))[_0x5443('0x41')](handleError(_0x22b7af,null));};exports[_0x5443('0x27')]=function(_0x1336cf,_0x1e00d3){return db[_0x5443('0x2c')][_0x5443('0x44')]({'where':{'id':_0x1336cf['params']['id']}})['then'](handleEntityNotFound(_0x1e00d3,null))['then'](removeEntity(_0x1e00d3,null))['catch'](handleError(_0x1e00d3,null));};exports[_0x5443('0x46')]=function(_0x5f45c5,_0xe98522,_0x1af3f8){var _0x373aff={};var _0x2a422a={};var _0x48f8b9;var _0x8a792;return db[_0x5443('0x2c')][_0x5443('0x47')]({'where':{'id':_0x5f45c5[_0x5443('0x48')]['id']}})[_0x5443('0x26')](handleEntityNotFound(_0xe98522,null))[_0x5443('0x26')](function(_0x39d67a){if(_0x39d67a){_0x48f8b9=_0x39d67a;_0x2a422a[_0x5443('0x30')]=_[_0x5443('0x32')](db[_0x5443('0x49')][_0x5443('0x2d')]);_0x2a422a[_0x5443('0x31')]=_[_0x5443('0x32')](_0x5f45c5[_0x5443('0x31')]);_0x2a422a[_0x5443('0x33')]=_[_0x5443('0x35')](_0x2a422a[_0x5443('0x30')],_0x2a422a[_0x5443('0x31')]);_0x373aff[_0x5443('0x34')]=_['intersection'](_0x2a422a[_0x5443('0x30')],qs[_0x5443('0x43')](_0x5f45c5[_0x5443('0x31')][_0x5443('0x43')]));_0x373aff[_0x5443('0x34')]=_0x373aff[_0x5443('0x34')][_0x5443('0x36')]?_0x373aff[_0x5443('0x34')]:_0x2a422a['model'];_0x373aff[_0x5443('0x38')]=qs['sort'](_0x5f45c5[_0x5443('0x31')][_0x5443('0x39')]);_0x373aff['where']=qs[_0x5443('0x33')](_[_0x5443('0x4a')](_0x5f45c5[_0x5443('0x31')],_0x2a422a[_0x5443('0x33')]));if(_0x5f45c5[_0x5443('0x31')][_0x5443('0x3b')]){_0x373aff[_0x5443('0x3a')]=_[_0x5443('0x3c')](_0x373aff['where'],{'$or':_[_0x5443('0x4b')](_0x373aff[_0x5443('0x34')],function(_0xd63701){var _0xfd66a4={};_0xfd66a4[_0xd63701]={'$like':'%'+_0x5f45c5[_0x5443('0x31')][_0x5443('0x3b')]+'%'};return _0xfd66a4;})});}_0x373aff=_['merge']({},_0x373aff,_0x5f45c5[_0x5443('0x3d')]);return _0x48f8b9[_0x5443('0x46')](_0x373aff);}})['then'](function(_0x100023){if(_0x100023){_0x8a792=_0x100023[_0x5443('0x36')];if(!_0x5f45c5[_0x5443('0x31')][_0x5443('0x37')]('nolimit')){_0x373aff[_0x5443('0x20')]=qs[_0x5443('0x20')](_0x5f45c5[_0x5443('0x31')]['limit']);_0x373aff[_0x5443('0x1e')]=qs[_0x5443('0x1e')](_0x5f45c5[_0x5443('0x31')]['offset']);}return _0x48f8b9[_0x5443('0x46')](_0x373aff);}})[_0x5443('0x26')](function(_0x49724a){if(_0x49724a){return _0x49724a?{'count':_0x8a792,'rows':_0x49724a}:null;}})[_0x5443('0x26')](respondWithResult(_0xe98522,null))[_0x5443('0x41')](handleError(_0xe98522,null));};exports[_0x5443('0x4c')]=function(_0x188649,_0x2c6dd7,_0x283eeb){if(_0x188649['body']['id']){delete _0x188649[_0x5443('0x45')]['id'];}return db[_0x5443('0x2c')]['findOne']({'where':{'id':_0x188649[_0x5443('0x48')]['id']}})['then'](handleEntityNotFound(_0x2c6dd7,null))[_0x5443('0x26')](function(_0x440711){if(_0x440711){_0x188649[_0x5443('0x45')][_0x5443('0x4d')]=_0x440711['id'];_0x188649[_0x5443('0x45')][_0x5443('0x4e')]=integrations[_0x5443('0x4f')](_0x188649[_0x5443('0x45')][_0x5443('0x50')],_0x188649[_0x5443('0x45')][_0x5443('0x2e')]);_0x188649[_0x5443('0x45')][_0x5443('0x51')]=integrations[_0x5443('0x52')](_0x188649[_0x5443('0x45')][_0x5443('0x50')],_0x188649['body'][_0x5443('0x2e')]);return db['DeskConfiguration'][_0x5443('0x53')](_0x188649[_0x5443('0x45')],{'include':[{'model':db[_0x5443('0x54')],'as':'Subjects'},{'model':db[_0x5443('0x54')],'as':_0x5443('0x51')}]});}return null;})[_0x5443('0x26')](respondWithResult(_0x2c6dd7,null))[_0x5443('0x41')](handleError(_0x2c6dd7,null));};exports[_0x5443('0x55')]=function(_0x15ba8c,_0x207041,_0x35e862){var _0x48ef22=[{'name':_0x5443('0x56'),'label':_0x5443('0x56'),'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 _0x43e8e8='';return db[_0x5443('0x2c')][_0x5443('0x47')]({'where':{'id':_0x15ba8c[_0x5443('0x48')]['id']},'attributes':['id',_0x5443('0x57'),_0x5443('0x58'),'username',_0x5443('0x59'),_0x5443('0x5a'),_0x5443('0x5b'),_0x5443('0x5c'),_0x5443('0x5d')]})[_0x5443('0x26')](handleEntityNotFound(_0x207041,null))['then'](function(_0x395445){if(_0x395445){_0x43e8e8=_0x395445[_0x5443('0x57')];var _0x2e672f=_0x43e8e8[_0x5443('0x5e')](-0x1);if(_0x2e672f==='/'){_0x43e8e8=_0x43e8e8[_0x5443('0x5f')](0x0,_0x43e8e8[_0x5443('0x60')](_0x2e672f));}var _0x38f4d7={'method':_0x5443('0x61'),'uri':util[_0x5443('0x62')](_0x5443('0x63'),_0x43e8e8),'headers':{'Content-Type':_0x5443('0x64'),'Accept':_0x5443('0x64')},'json':!![]};if(_0x395445[_0x5443('0x58')]===_0x5443('0x65')){_0x38f4d7[_0x5443('0x66')]['Authorization']=util[_0x5443('0x62')](_0x5443('0x67'),new Buffer(util[_0x5443('0x62')](_0x5443('0x68'),_0x395445['username'],_0x395445[_0x5443('0x59')]))['toString']('base64'));}return rp(_0x38f4d7)[_0x5443('0x26')](function(_0x466715){return _0x48ef22[_0x5443('0x69')](_[_0x5443('0x4b')](_0x466715[_0x5443('0x6a')]['entries'],function(_0x31923e){return{'id':_0x31923e[_0x5443('0x29')],'name':_0x31923e[_0x5443('0x29')],'type':_0x31923e[_0x5443('0x2e')],'active':_0x31923e[_0x5443('0x6b')],'label':_0x31923e[_0x5443('0x6c')],'custom':!![]};}));});}})['then'](function(_0x1570b6){return{'count':_0x1570b6['length'],'rows':_0x1570b6};})[_0x5443('0x26')](respondWithResult(_0x207041,null))[_0x5443('0x41')](function(_0x441a1d){var _0x4cff84=_0x15ba8c[_0x5443('0x31')][_0x5443('0x6d')]?0x1f4:_0x441a1d[_0x5443('0x6e')]||0x1f4;logger[_0x5443('0x6f')](_0x5443('0x70'),_0x5443('0x55'),_0x4cff84,JSON['stringify'](_0x441a1d));delete _0x441a1d[_0x5443('0x29')];if(_0x4cff84===0x191){_0x4cff84=0x190;}_0x207041[_0x5443('0x1b')](_0x4cff84)[_0x5443('0x2a')](_0x15ba8c[_0x5443('0x31')]['test']?{'message':_0x5443('0x71'),'statusCode':_0x441a1d[_0x5443('0x6e')]}:_0x441a1d);});}; \ No newline at end of file +var _0xc3b0=['AccountId','Subjects','Descriptions','getDescriptions','channel','DeskConfiguration','create','DeskField','priority','authType','username','consumerKey','slice','substring','%s/custom_fields','application/json','basic','headers','Authorization','Basic\x20%s','format','%s:%s','password','toString','concat','_embedded','active','label','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','test','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','squel','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','DeskAccount','include','findAll','rows','catch','show','params','length','find','body','findOne','getConfigurations','addConfiguration'];(function(_0x2c805f,_0x208f07){var _0x100634=function(_0x1aa9d0){while(--_0x1aa9d0){_0x2c805f['push'](_0x2c805f['shift']());}};_0x100634(++_0x208f07);}(_0xc3b0,0x16e));var _0x0c3b=function(_0x199d04,_0x3045e9){_0x199d04=_0x199d04-0x0;var _0x5f10fd=_0xc3b0[_0x199d04];return _0x5f10fd;};'use strict';var emlformat=require(_0x0c3b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0c3b('0x1'));var jsonpatch=require(_0x0c3b('0x2'));var rp=require(_0x0c3b('0x3'));var moment=require(_0x0c3b('0x4'));var BPromise=require(_0x0c3b('0x5'));var Mustache=require(_0x0c3b('0x6'));var util=require(_0x0c3b('0x7'));var path=require('path');var sox=require(_0x0c3b('0x8'));var csv=require(_0x0c3b('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0c3b('0xa'));var _=require('lodash');var squel=require(_0x0c3b('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x0c3b('0x9'));var querystring=require(_0x0c3b('0xc'));var Papa=require(_0x0c3b('0xd'));var Redis=require(_0x0c3b('0xe'));var authService=require(_0x0c3b('0xf'));var qs=require(_0x0c3b('0x10'));var as=require(_0x0c3b('0x11'));var hardwareService=require(_0x0c3b('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x0c3b('0x13'));var config=require(_0x0c3b('0x14'));var licenseUtil=require(_0x0c3b('0x15'));var db=require(_0x0c3b('0x16'))['db'];var integrations=require(_0x0c3b('0x17'));function respondWithStatusCode(_0x7a8b81,_0x12963a){_0x12963a=_0x12963a||0xcc;return function(_0x47f669){if(_0x47f669){return _0x7a8b81[_0x0c3b('0x18')](_0x12963a);}return _0x7a8b81['status'](_0x12963a)['end']();};}function respondWithResult(_0x42f453,_0x58769b){_0x58769b=_0x58769b||0xc8;return function(_0x4cecb9){if(_0x4cecb9){return _0x42f453[_0x0c3b('0x19')](_0x58769b)['json'](_0x4cecb9);}};}function respondWithFilteredResult(_0x472666,_0x1ab620){return function(_0x21c824){if(_0x21c824){var _0x5a2757=typeof _0x1ab620[_0x0c3b('0x1a')]===_0x0c3b('0x1b')&&typeof _0x1ab620[_0x0c3b('0x1c')]===_0x0c3b('0x1b');var _0x442cc8=_0x21c824[_0x0c3b('0x1d')];var _0x32f596=_0x5a2757?0x0:_0x1ab620[_0x0c3b('0x1a')];var _0x3edb6b=_0x5a2757?_0x21c824['count']:_0x1ab620['offset']+_0x1ab620['limit'];var _0x524d4c;if(_0x3edb6b>=_0x442cc8){_0x3edb6b=_0x442cc8;_0x524d4c=0xc8;}else{_0x524d4c=0xce;}_0x472666[_0x0c3b('0x19')](_0x524d4c);return _0x472666[_0x0c3b('0x1e')](_0x0c3b('0x1f'),_0x32f596+'-'+_0x3edb6b+'/'+_0x442cc8)['json'](_0x21c824);}return null;};}function patchUpdates(_0xe01a8e){return function(_0x1ec12d){try{jsonpatch[_0x0c3b('0x20')](_0x1ec12d,_0xe01a8e,!![]);}catch(_0x230fa5){return BPromise[_0x0c3b('0x21')](_0x230fa5);}return _0x1ec12d[_0x0c3b('0x22')]();};}function saveUpdates(_0x5e17fb,_0x4aa035){return function(_0x34c74d){if(_0x34c74d){return _0x34c74d[_0x0c3b('0x23')](_0x5e17fb)[_0x0c3b('0x24')](function(_0x1cbc82){return _0x1cbc82;});}return null;};}function removeEntity(_0x2faa0d,_0xc51330){return function(_0x53480c){if(_0x53480c){return _0x53480c[_0x0c3b('0x25')]()[_0x0c3b('0x24')](function(){_0x2faa0d['status'](0xcc)[_0x0c3b('0x26')]();});}};}function handleEntityNotFound(_0x305f4c,_0x16cb5f){return function(_0x46cf53){if(!_0x46cf53){_0x305f4c['sendStatus'](0x194);}return _0x46cf53;};}function handleError(_0x44d495,_0x20cb01){_0x20cb01=_0x20cb01||0x1f4;return function(_0x5826e7){logger[_0x0c3b('0x27')](_0x5826e7[_0x0c3b('0x28')]);if(_0x5826e7[_0x0c3b('0x29')]){delete _0x5826e7['name'];}_0x44d495[_0x0c3b('0x19')](_0x20cb01)[_0x0c3b('0x2a')](_0x5826e7);};}exports[_0x0c3b('0x2b')]=function(_0xdf207,_0x225651){var _0x3efdce={},_0x6e33d1={},_0x47efd1={'count':0x0,'rows':[]};var _0x409983=_['map'](db['DeskAccount'][_0x0c3b('0x2c')],function(_0x31826e){return{'name':_0x31826e[_0x0c3b('0x2d')],'type':_0x31826e[_0x0c3b('0x2e')][_0x0c3b('0x2f')]};});_0x6e33d1[_0x0c3b('0x30')]=_[_0x0c3b('0x31')](_0x409983,_0x0c3b('0x29'));_0x6e33d1[_0x0c3b('0x32')]=_[_0x0c3b('0x33')](_0xdf207[_0x0c3b('0x32')]);_0x6e33d1[_0x0c3b('0x34')]=_[_0x0c3b('0x35')](_0x6e33d1['model'],_0x6e33d1[_0x0c3b('0x32')]);_0x3efdce[_0x0c3b('0x36')]=_[_0x0c3b('0x35')](_0x6e33d1[_0x0c3b('0x30')],qs[_0x0c3b('0x37')](_0xdf207['query'][_0x0c3b('0x37')]));_0x3efdce[_0x0c3b('0x36')]=_0x3efdce[_0x0c3b('0x36')]['length']?_0x3efdce[_0x0c3b('0x36')]:_0x6e33d1[_0x0c3b('0x30')];if(!_0xdf207['query'][_0x0c3b('0x38')](_0x0c3b('0x39'))){_0x3efdce['limit']=qs['limit'](_0xdf207[_0x0c3b('0x32')][_0x0c3b('0x1c')]);_0x3efdce[_0x0c3b('0x1a')]=qs[_0x0c3b('0x1a')](_0xdf207[_0x0c3b('0x32')][_0x0c3b('0x1a')]);}_0x3efdce['order']=qs[_0x0c3b('0x3a')](_0xdf207[_0x0c3b('0x32')][_0x0c3b('0x3a')]);_0x3efdce[_0x0c3b('0x3b')]=qs['filters'](_[_0x0c3b('0x3c')](_0xdf207[_0x0c3b('0x32')],_0x6e33d1[_0x0c3b('0x34')]),_0x409983);if(_0xdf207['query'][_0x0c3b('0x3d')]){_0x3efdce['where']=_[_0x0c3b('0x3e')](_0x3efdce[_0x0c3b('0x3b')],{'$or':_[_0x0c3b('0x31')](_0x409983,function(_0x4d90f8){if(_0x4d90f8[_0x0c3b('0x2e')]!==_0x0c3b('0x3f')){var _0x1baef4={};_0x1baef4[_0x4d90f8[_0x0c3b('0x29')]]={'$like':'%'+_0xdf207[_0x0c3b('0x32')][_0x0c3b('0x3d')]+'%'};return _0x1baef4;}})});}_0x3efdce=_[_0x0c3b('0x3e')]({},_0x3efdce,_0xdf207[_0x0c3b('0x40')]);var _0x4d62bd={'where':_0x3efdce['where']};return db[_0x0c3b('0x41')]['count'](_0x4d62bd)[_0x0c3b('0x24')](function(_0x499724){_0x47efd1[_0x0c3b('0x1d')]=_0x499724;if(_0xdf207[_0x0c3b('0x32')]['includeAll']){_0x3efdce[_0x0c3b('0x42')]=[{'all':!![]}];}return db['DeskAccount'][_0x0c3b('0x43')](_0x3efdce);})['then'](function(_0x5b648b){_0x47efd1[_0x0c3b('0x44')]=_0x5b648b;return _0x47efd1;})[_0x0c3b('0x24')](respondWithFilteredResult(_0x225651,_0x3efdce))[_0x0c3b('0x45')](handleError(_0x225651,null));};exports[_0x0c3b('0x46')]=function(_0x285d5d,_0x3a4ae3){var _0x3b7c4b={'raw':![],'where':{'id':_0x285d5d[_0x0c3b('0x47')]['id']}},_0x3e9c9f={};_0x3e9c9f[_0x0c3b('0x30')]=_[_0x0c3b('0x33')](db[_0x0c3b('0x41')]['rawAttributes']);_0x3e9c9f[_0x0c3b('0x32')]=_[_0x0c3b('0x33')](_0x285d5d[_0x0c3b('0x32')]);_0x3e9c9f[_0x0c3b('0x34')]=_[_0x0c3b('0x35')](_0x3e9c9f[_0x0c3b('0x30')],_0x3e9c9f[_0x0c3b('0x32')]);_0x3b7c4b[_0x0c3b('0x36')]=_[_0x0c3b('0x35')](_0x3e9c9f['model'],qs[_0x0c3b('0x37')](_0x285d5d['query'][_0x0c3b('0x37')]));_0x3b7c4b[_0x0c3b('0x36')]=_0x3b7c4b['attributes'][_0x0c3b('0x48')]?_0x3b7c4b['attributes']:_0x3e9c9f[_0x0c3b('0x30')];if(_0x285d5d['query']['includeAll']){_0x3b7c4b[_0x0c3b('0x42')]=[{'all':!![]}];}_0x3b7c4b=_[_0x0c3b('0x3e')]({},_0x3b7c4b,_0x285d5d['options']);return db['DeskAccount'][_0x0c3b('0x49')](_0x3b7c4b)['then'](handleEntityNotFound(_0x3a4ae3,null))['then'](respondWithResult(_0x3a4ae3,null))[_0x0c3b('0x45')](handleError(_0x3a4ae3,null));};exports['create']=function(_0x4d324c,_0x5af931){return db[_0x0c3b('0x41')]['create'](_0x4d324c[_0x0c3b('0x4a')],{})[_0x0c3b('0x24')](respondWithResult(_0x5af931,0xc9))[_0x0c3b('0x45')](handleError(_0x5af931,null));};exports[_0x0c3b('0x23')]=function(_0x1bc786,_0x3c2fcc){if(_0x1bc786[_0x0c3b('0x4a')]['id']){delete _0x1bc786[_0x0c3b('0x4a')]['id'];}return db[_0x0c3b('0x41')][_0x0c3b('0x49')]({'where':{'id':_0x1bc786[_0x0c3b('0x47')]['id']}})[_0x0c3b('0x24')](handleEntityNotFound(_0x3c2fcc,null))['then'](saveUpdates(_0x1bc786[_0x0c3b('0x4a')],null))[_0x0c3b('0x24')](respondWithResult(_0x3c2fcc,null))[_0x0c3b('0x45')](handleError(_0x3c2fcc,null));};exports[_0x0c3b('0x25')]=function(_0x2fbe5e,_0x107043){return db['DeskAccount'][_0x0c3b('0x49')]({'where':{'id':_0x2fbe5e[_0x0c3b('0x47')]['id']}})[_0x0c3b('0x24')](handleEntityNotFound(_0x107043,null))['then'](removeEntity(_0x107043,null))[_0x0c3b('0x45')](handleError(_0x107043,null));};exports['getConfigurations']=function(_0x1627a9,_0x28a6a0,_0x3802e4){var _0x403e49={};var _0x4fa161={};var _0x4a5d3a;var _0xec2b4f;return db['DeskAccount'][_0x0c3b('0x4b')]({'where':{'id':_0x1627a9['params']['id']}})['then'](handleEntityNotFound(_0x28a6a0,null))[_0x0c3b('0x24')](function(_0x3b8da3){if(_0x3b8da3){_0x4a5d3a=_0x3b8da3;_0x4fa161['model']=_[_0x0c3b('0x33')](db['DeskConfiguration'][_0x0c3b('0x2c')]);_0x4fa161[_0x0c3b('0x32')]=_[_0x0c3b('0x33')](_0x1627a9['query']);_0x4fa161[_0x0c3b('0x34')]=_['intersection'](_0x4fa161[_0x0c3b('0x30')],_0x4fa161[_0x0c3b('0x32')]);_0x403e49['attributes']=_['intersection'](_0x4fa161[_0x0c3b('0x30')],qs[_0x0c3b('0x37')](_0x1627a9[_0x0c3b('0x32')][_0x0c3b('0x37')]));_0x403e49[_0x0c3b('0x36')]=_0x403e49[_0x0c3b('0x36')][_0x0c3b('0x48')]?_0x403e49['attributes']:_0x4fa161[_0x0c3b('0x30')];_0x403e49['order']=qs['sort'](_0x1627a9[_0x0c3b('0x32')][_0x0c3b('0x3a')]);_0x403e49['where']=qs[_0x0c3b('0x34')](_['pick'](_0x1627a9[_0x0c3b('0x32')],_0x4fa161[_0x0c3b('0x34')]));if(_0x1627a9[_0x0c3b('0x32')]['filter']){_0x403e49['where']=_[_0x0c3b('0x3e')](_0x403e49[_0x0c3b('0x3b')],{'$or':_[_0x0c3b('0x31')](_0x403e49[_0x0c3b('0x36')],function(_0x4c9eb4){var _0x3dfb0d={};_0x3dfb0d[_0x4c9eb4]={'$like':'%'+_0x1627a9[_0x0c3b('0x32')][_0x0c3b('0x3d')]+'%'};return _0x3dfb0d;})});}_0x403e49=_['merge']({},_0x403e49,_0x1627a9['options']);return _0x4a5d3a[_0x0c3b('0x4c')](_0x403e49);}})[_0x0c3b('0x24')](function(_0x1b7d38){if(_0x1b7d38){_0xec2b4f=_0x1b7d38[_0x0c3b('0x48')];if(!_0x1627a9[_0x0c3b('0x32')][_0x0c3b('0x38')](_0x0c3b('0x39'))){_0x403e49[_0x0c3b('0x1c')]=qs['limit'](_0x1627a9[_0x0c3b('0x32')]['limit']);_0x403e49['offset']=qs[_0x0c3b('0x1a')](_0x1627a9[_0x0c3b('0x32')][_0x0c3b('0x1a')]);}return _0x4a5d3a[_0x0c3b('0x4c')](_0x403e49);}})[_0x0c3b('0x24')](function(_0xbffeb){if(_0xbffeb){return _0xbffeb?{'count':_0xec2b4f,'rows':_0xbffeb}:null;}})[_0x0c3b('0x24')](respondWithResult(_0x28a6a0,null))[_0x0c3b('0x45')](handleError(_0x28a6a0,null));};exports[_0x0c3b('0x4d')]=function(_0x520127,_0xd32e6b,_0x1788dc){if(_0x520127[_0x0c3b('0x4a')]['id']){delete _0x520127[_0x0c3b('0x4a')]['id'];}return db[_0x0c3b('0x41')][_0x0c3b('0x4b')]({'where':{'id':_0x520127['params']['id']}})[_0x0c3b('0x24')](handleEntityNotFound(_0xd32e6b,null))['then'](function(_0x49dc7a){if(_0x49dc7a){_0x520127['body'][_0x0c3b('0x4e')]=_0x49dc7a['id'];_0x520127[_0x0c3b('0x4a')][_0x0c3b('0x4f')]=integrations['getSubjects'](_0x520127[_0x0c3b('0x4a')]['channel'],_0x520127[_0x0c3b('0x4a')][_0x0c3b('0x2e')]);_0x520127['body'][_0x0c3b('0x50')]=integrations[_0x0c3b('0x51')](_0x520127['body'][_0x0c3b('0x52')],_0x520127[_0x0c3b('0x4a')][_0x0c3b('0x2e')]);return db[_0x0c3b('0x53')][_0x0c3b('0x54')](_0x520127[_0x0c3b('0x4a')],{'include':[{'model':db[_0x0c3b('0x55')],'as':_0x0c3b('0x4f')},{'model':db['DeskField'],'as':_0x0c3b('0x50')}]});}return null;})['then'](respondWithResult(_0xd32e6b,null))[_0x0c3b('0x45')](handleError(_0xd32e6b,null));};exports['getFields']=function(_0x542dab,_0x57dd26,_0x2080d7){var _0x5bc748=[{'name':_0x0c3b('0x56'),'label':_0x0c3b('0x56'),'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 _0x5d6a71='';return db[_0x0c3b('0x41')]['findOne']({'where':{'id':_0x542dab[_0x0c3b('0x47')]['id']},'attributes':['id','remoteUri',_0x0c3b('0x57'),_0x0c3b('0x58'),'password',_0x0c3b('0x59'),'consumerSecret','token','tokenSecret']})[_0x0c3b('0x24')](handleEntityNotFound(_0x57dd26,null))[_0x0c3b('0x24')](function(_0x15826c){if(_0x15826c){_0x5d6a71=_0x15826c['remoteUri'];var _0x56b0a6=_0x5d6a71[_0x0c3b('0x5a')](-0x1);if(_0x56b0a6==='/'){_0x5d6a71=_0x5d6a71[_0x0c3b('0x5b')](0x0,_0x5d6a71['lastIndexOf'](_0x56b0a6));}var _0x124859={'method':'GET','uri':util['format'](_0x0c3b('0x5c'),_0x5d6a71),'headers':{'Content-Type':_0x0c3b('0x5d'),'Accept':'application/json'},'json':!![]};if(_0x15826c[_0x0c3b('0x57')]===_0x0c3b('0x5e')){_0x124859[_0x0c3b('0x5f')][_0x0c3b('0x60')]=util['format'](_0x0c3b('0x61'),new Buffer(util[_0x0c3b('0x62')](_0x0c3b('0x63'),_0x15826c[_0x0c3b('0x58')],_0x15826c[_0x0c3b('0x64')]))[_0x0c3b('0x65')]('base64'));}return rp(_0x124859)[_0x0c3b('0x24')](function(_0xc1fb32){return _0x5bc748[_0x0c3b('0x66')](_[_0x0c3b('0x31')](_0xc1fb32[_0x0c3b('0x67')]['entries'],function(_0x19f189){return{'id':_0x19f189[_0x0c3b('0x29')],'name':_0x19f189[_0x0c3b('0x29')],'type':_0x19f189['type'],'active':_0x19f189[_0x0c3b('0x68')],'label':_0x19f189[_0x0c3b('0x69')],'custom':!![]};}));});}})[_0x0c3b('0x24')](function(_0x3feedd){return{'count':_0x3feedd[_0x0c3b('0x48')],'rows':_0x3feedd};})[_0x0c3b('0x24')](respondWithResult(_0x57dd26,null))[_0x0c3b('0x45')](function(_0x1154a3){var _0x922d08=_0x542dab[_0x0c3b('0x32')]['test']?0x1f4:_0x1154a3[_0x0c3b('0x6a')]||0x1f4;logger[_0x0c3b('0x27')](_0x0c3b('0x6b'),_0x0c3b('0x6c'),_0x922d08,JSON['stringify'](_0x1154a3));delete _0x1154a3[_0x0c3b('0x29')];if(_0x922d08===0x191){_0x922d08=0x190;}_0x57dd26[_0x0c3b('0x19')](_0x922d08)['send'](_0x542dab['query'][_0x0c3b('0x6d')]?{'message':_0x0c3b('0x6e'),'statusCode':_0x1154a3['statusCode']}:_0x1154a3);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index e2b42d6..0b0b1b2 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 _0x9876=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDeskAccount.attributes','../../components/integrations/configuration','exports','define','int_desk_accounts','lodash','util'];(function(_0x3b4b1d,_0x15029e){var _0x488c36=function(_0x56c8b3){while(--_0x56c8b3){_0x3b4b1d['push'](_0x3b4b1d['shift']());}};_0x488c36(++_0x15029e);}(_0x9876,0xee));var _0x6987=function(_0x263d39,_0x4c13e5){_0x263d39=_0x263d39-0x0;var _0x4bbd1c=_0x9876[_0x263d39];return _0x4bbd1c;};'use strict';var _=require(_0x6987('0x0'));var util=require(_0x6987('0x1'));var logger=require(_0x6987('0x2'))(_0x6987('0x3'));var moment=require(_0x6987('0x4'));var BPromise=require(_0x6987('0x5'));var rp=require(_0x6987('0x6'));var fs=require('fs');var path=require(_0x6987('0x7'));var rimraf=require(_0x6987('0x8'));var config=require(_0x6987('0x9'));var attributes=require(_0x6987('0xa'));var integrations=require(_0x6987('0xb'));module[_0x6987('0xc')]=function(_0x127e1b,_0xa6e6b2){return _0x127e1b[_0x6987('0xd')]('DeskAccount',attributes,{'tableName':_0x6987('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x75ec=['api','bluebird','path','rimraf','./intDeskAccount.attributes','../../components/integrations/configuration','DeskAccount','int_desk_accounts','lodash','util','../../config/logger'];(function(_0x120178,_0x100db6){var _0x50e1e0=function(_0xea314a){while(--_0xea314a){_0x120178['push'](_0x120178['shift']());}};_0x50e1e0(++_0x100db6);}(_0x75ec,0x6b));var _0xc75e=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x75ec[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0xc75e('0x0'));var util=require(_0xc75e('0x1'));var logger=require(_0xc75e('0x2'))(_0xc75e('0x3'));var moment=require('moment');var BPromise=require(_0xc75e('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc75e('0x5'));var rimraf=require(_0xc75e('0x6'));var config=require('../../config/environment');var attributes=require(_0xc75e('0x7'));var integrations=require(_0xc75e('0x8'));module['exports']=function(_0x9b11b2,_0x2956f2){return _0x9b11b2['define'](_0xc75e('0x9'),attributes,{'tableName':_0xc75e('0xa'),'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 496536c..cd3db87 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 _0x71ac=['options','raw','where','attributes','limit','include','map','model','debug','stringify','ShowDeskAccount','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','DeskAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetDeskAccount','DeskAccount','findAll'];(function(_0x538b27,_0x5af68f){var _0x4b4cc3=function(_0x4db032){while(--_0x4db032){_0x538b27['push'](_0x538b27['shift']());}};_0x4b4cc3(++_0x5af68f);}(_0x71ac,0x8f));var _0xc71a=function(_0x2053ea,_0x1ab2d4){_0x2053ea=_0x2053ea-0x0;var _0x2232c4=_0x71ac[_0x2053ea];return _0x2232c4;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xc71a('0x0'));var rs=require(_0xc71a('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc71a('0x2'))['db'];var utils=require(_0xc71a('0x3'));var logger=require(_0xc71a('0x4'))(_0xc71a('0x5'));var config=require(_0xc71a('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0xc71a('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1de592,_0x32ed61,_0x45f3fb){return new BPromise(function(_0x5d9d64,_0x1a1c6f){return client[_0xc71a('0x8')](_0x1de592,_0x45f3fb)[_0xc71a('0x9')](function(_0x5e23af){logger[_0xc71a('0xa')](_0xc71a('0xb'),_0x32ed61,_0xc71a('0xc'));logger['debug'](_0xc71a('0xd'),_0x32ed61,_0xc71a('0xc'),JSON['stringify'](_0x5e23af));if(_0x5e23af[_0xc71a('0xe')]){if(_0x5e23af['error'][_0xc71a('0xf')]===0x1f4){logger['error'](_0xc71a('0xb'),_0x32ed61,_0x5e23af['error'][_0xc71a('0x10')]);return _0x1a1c6f(_0x5e23af[_0xc71a('0xe')]['message']);}logger[_0xc71a('0xe')](_0xc71a('0xb'),_0x32ed61,_0x5e23af[_0xc71a('0xe')][_0xc71a('0x10')]);return _0x5d9d64(_0x5e23af['error'][_0xc71a('0x10')]);}else{logger[_0xc71a('0xa')](_0xc71a('0xb'),_0x32ed61,'request\x20sent');_0x5d9d64(_0x5e23af[_0xc71a('0x11')][_0xc71a('0x10')]);}})[_0xc71a('0x12')](function(_0x140dfc){logger[_0xc71a('0xe')](_0xc71a('0xb'),_0x32ed61,_0x140dfc);_0x1a1c6f(_0x140dfc);});});}exports[_0xc71a('0x13')]=function(_0x284440){var _0x29e7b8=this;return new Promise(function(_0x5efa7d,_0xbaecf3){return db[_0xc71a('0x14')][_0xc71a('0x15')]({'raw':_0x284440['options']?_0x284440[_0xc71a('0x16')][_0xc71a('0x17')]===undefined?!![]:![]:!![],'where':_0x284440[_0xc71a('0x16')]?_0x284440[_0xc71a('0x16')][_0xc71a('0x18')]||null:null,'attributes':_0x284440[_0xc71a('0x16')]?_0x284440[_0xc71a('0x16')][_0xc71a('0x19')]||null:null,'limit':_0x284440[_0xc71a('0x16')]?_0x284440['options'][_0xc71a('0x1a')]||null:null,'include':_0x284440[_0xc71a('0x16')]?_0x284440[_0xc71a('0x16')][_0xc71a('0x1b')]?_['map'](_0x284440[_0xc71a('0x16')][_0xc71a('0x1b')],function(_0x5d67c7){return{'model':db[_0x5d67c7['model']],'as':_0x5d67c7['as'],'attributes':_0x5d67c7[_0xc71a('0x19')],'include':_0x5d67c7[_0xc71a('0x1b')]?_[_0xc71a('0x1c')](_0x5d67c7[_0xc71a('0x1b')],function(_0x4ead4f){return{'model':db[_0x4ead4f[_0xc71a('0x1d')]],'as':_0x4ead4f['as'],'attributes':_0x4ead4f[_0xc71a('0x19')],'include':_0x4ead4f[_0xc71a('0x1b')]?_[_0xc71a('0x1c')](_0x4ead4f[_0xc71a('0x1b')],function(_0x530c06){return{'model':db[_0x530c06['model']],'as':_0x530c06['as'],'attributes':_0x530c06['attributes']};}):[]};}):[]};}):[]:[]})[_0xc71a('0x9')](function(_0x2e86c4){logger['info'](_0xc71a('0x13'),_0x284440);logger[_0xc71a('0x1e')](_0xc71a('0x13'),_0x284440,JSON[_0xc71a('0x1f')](_0x2e86c4));_0x5efa7d(_0x2e86c4);})[_0xc71a('0x12')](function(_0x1f4b79){logger[_0xc71a('0xe')](_0xc71a('0x13'),_0x1f4b79['message'],_0x284440);_0xbaecf3(_0x29e7b8[_0xc71a('0xe')](0x1f4,_0x1f4b79[_0xc71a('0x10')]));});});};exports[_0xc71a('0x20')]=function(_0x8f3299){var _0x397c2c=this;return new Promise(function(_0x36fe13,_0x783fe4){return db[_0xc71a('0x14')]['find']({'raw':_0x8f3299[_0xc71a('0x16')]?_0x8f3299[_0xc71a('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x8f3299[_0xc71a('0x16')]?_0x8f3299[_0xc71a('0x16')][_0xc71a('0x18')]||null:null,'attributes':_0x8f3299[_0xc71a('0x16')]?_0x8f3299['options'][_0xc71a('0x19')]||null:null,'include':_0x8f3299[_0xc71a('0x16')]?_0x8f3299[_0xc71a('0x16')][_0xc71a('0x1b')]?_['map'](_0x8f3299[_0xc71a('0x16')][_0xc71a('0x1b')],function(_0x2883ea){return{'model':db[_0x2883ea['model']],'as':_0x2883ea['as'],'attributes':_0x2883ea[_0xc71a('0x19')],'include':_0x2883ea[_0xc71a('0x1b')]?_[_0xc71a('0x1c')](_0x2883ea[_0xc71a('0x1b')],function(_0x1bffa5){return{'model':db[_0x1bffa5['model']],'as':_0x1bffa5['as'],'attributes':_0x1bffa5['attributes'],'include':_0x1bffa5[_0xc71a('0x1b')]?_[_0xc71a('0x1c')](_0x1bffa5[_0xc71a('0x1b')],function(_0x1c8858){return{'model':db[_0x1c8858[_0xc71a('0x1d')]],'as':_0x1c8858['as'],'attributes':_0x1c8858[_0xc71a('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3241ee){logger[_0xc71a('0xa')](_0xc71a('0x20'),_0x8f3299);logger[_0xc71a('0x1e')](_0xc71a('0x20'),_0x8f3299,JSON['stringify'](_0x3241ee));_0x36fe13(_0x3241ee);})[_0xc71a('0x12')](function(_0x557710){logger['error'](_0xc71a('0x20'),_0x557710['message'],_0x8f3299);_0x783fe4(_0x397c2c[_0xc71a('0xe')](0x1f4,_0x557710['message']));});});}; \ No newline at end of file +var _0x00c2=['attributes','include','model','map','GetDeskAccount','stringify','ShowDeskAccount','lodash','moment','ioredis','../../config/logger','rpc','then','info','DeskAccount,\x20%s,\x20%s','debug','DeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','DeskAccount','options','raw','where'];(function(_0x16bd3d,_0x161559){var _0x4c4c2a=function(_0x4e8f1f){while(--_0x4e8f1f){_0x16bd3d['push'](_0x16bd3d['shift']());}};_0x4c4c2a(++_0x161559);}(_0x00c2,0x73));var _0x200c=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x00c2[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x200c('0x0'));var util=require('util');var moment=require(_0x200c('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x200c('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x200c('0x3'))(_0x200c('0x4'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4bb94f,_0xd5c638,_0x10ecca){return new BPromise(function(_0x4064bb,_0x589080){return client['request'](_0x4bb94f,_0x10ecca)[_0x200c('0x5')](function(_0x5f58ce){logger[_0x200c('0x6')](_0x200c('0x7'),_0xd5c638,'request\x20sent');logger[_0x200c('0x8')](_0x200c('0x9'),_0xd5c638,_0x200c('0xa'),JSON['stringify'](_0x5f58ce));if(_0x5f58ce[_0x200c('0xb')]){if(_0x5f58ce['error'][_0x200c('0xc')]===0x1f4){logger[_0x200c('0xb')](_0x200c('0x7'),_0xd5c638,_0x5f58ce[_0x200c('0xb')][_0x200c('0xd')]);return _0x589080(_0x5f58ce[_0x200c('0xb')]['message']);}logger[_0x200c('0xb')](_0x200c('0x7'),_0xd5c638,_0x5f58ce[_0x200c('0xb')][_0x200c('0xd')]);return _0x4064bb(_0x5f58ce[_0x200c('0xb')]['message']);}else{logger[_0x200c('0x6')](_0x200c('0x7'),_0xd5c638,_0x200c('0xa'));_0x4064bb(_0x5f58ce[_0x200c('0xe')][_0x200c('0xd')]);}})[_0x200c('0xf')](function(_0x4fb382){logger['error']('DeskAccount,\x20%s,\x20%s',_0xd5c638,_0x4fb382);_0x589080(_0x4fb382);});});}exports['GetDeskAccount']=function(_0x5646a3){var _0x3a5c4f=this;return new Promise(function(_0xf64fed,_0x4ef299){return db[_0x200c('0x10')]['findAll']({'raw':_0x5646a3['options']?_0x5646a3[_0x200c('0x11')][_0x200c('0x12')]===undefined?!![]:![]:!![],'where':_0x5646a3[_0x200c('0x11')]?_0x5646a3['options'][_0x200c('0x13')]||null:null,'attributes':_0x5646a3['options']?_0x5646a3[_0x200c('0x11')][_0x200c('0x14')]||null:null,'limit':_0x5646a3[_0x200c('0x11')]?_0x5646a3[_0x200c('0x11')]['limit']||null:null,'include':_0x5646a3[_0x200c('0x11')]?_0x5646a3[_0x200c('0x11')][_0x200c('0x15')]?_['map'](_0x5646a3[_0x200c('0x11')][_0x200c('0x15')],function(_0x4ae407){return{'model':db[_0x4ae407[_0x200c('0x16')]],'as':_0x4ae407['as'],'attributes':_0x4ae407[_0x200c('0x14')],'include':_0x4ae407[_0x200c('0x15')]?_[_0x200c('0x17')](_0x4ae407[_0x200c('0x15')],function(_0x181d04){return{'model':db[_0x181d04[_0x200c('0x16')]],'as':_0x181d04['as'],'attributes':_0x181d04[_0x200c('0x14')],'include':_0x181d04['include']?_[_0x200c('0x17')](_0x181d04[_0x200c('0x15')],function(_0x56b58e){return{'model':db[_0x56b58e[_0x200c('0x16')]],'as':_0x56b58e['as'],'attributes':_0x56b58e[_0x200c('0x14')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4b6e2e){logger[_0x200c('0x6')]('GetDeskAccount',_0x5646a3);logger[_0x200c('0x8')](_0x200c('0x18'),_0x5646a3,JSON[_0x200c('0x19')](_0x4b6e2e));_0xf64fed(_0x4b6e2e);})[_0x200c('0xf')](function(_0x48d446){logger[_0x200c('0xb')](_0x200c('0x18'),_0x48d446[_0x200c('0xd')],_0x5646a3);_0x4ef299(_0x3a5c4f['error'](0x1f4,_0x48d446['message']));});});};exports['ShowDeskAccount']=function(_0x2813af){var _0xa43f61=this;return new Promise(function(_0x437686,_0x10f249){return db['DeskAccount']['find']({'raw':_0x2813af[_0x200c('0x11')]?_0x2813af['options'][_0x200c('0x12')]===undefined?!![]:![]:!![],'where':_0x2813af[_0x200c('0x11')]?_0x2813af[_0x200c('0x11')][_0x200c('0x13')]||null:null,'attributes':_0x2813af[_0x200c('0x11')]?_0x2813af[_0x200c('0x11')]['attributes']||null:null,'include':_0x2813af['options']?_0x2813af[_0x200c('0x11')][_0x200c('0x15')]?_[_0x200c('0x17')](_0x2813af[_0x200c('0x11')]['include'],function(_0x286a5e){return{'model':db[_0x286a5e[_0x200c('0x16')]],'as':_0x286a5e['as'],'attributes':_0x286a5e[_0x200c('0x14')],'include':_0x286a5e[_0x200c('0x15')]?_['map'](_0x286a5e['include'],function(_0x25f4fa){return{'model':db[_0x25f4fa[_0x200c('0x16')]],'as':_0x25f4fa['as'],'attributes':_0x25f4fa[_0x200c('0x14')],'include':_0x25f4fa['include']?_[_0x200c('0x17')](_0x25f4fa[_0x200c('0x15')],function(_0x384108){return{'model':db[_0x384108[_0x200c('0x16')]],'as':_0x384108['as'],'attributes':_0x384108[_0x200c('0x14')]};}):[]};}):[]};}):[]:[]})[_0x200c('0x5')](function(_0x54b432){logger[_0x200c('0x6')]('ShowDeskAccount',_0x2813af);logger[_0x200c('0x8')](_0x200c('0x1a'),_0x2813af,JSON[_0x200c('0x19')](_0x54b432));_0x437686(_0x54b432);})[_0x200c('0xf')](function(_0x770979){logger[_0x200c('0xb')]('ShowDeskAccount',_0x770979[_0x200c('0xd')],_0x2813af);_0x10f249(_0xa43f61['error'](0x1f4,_0x770979['message']));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index d63f906..8e86f4f 100644 --- a/server/api/intDeskConfiguration/index.js +++ b/server/api/intDeskConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xedd9=['getTags','post','create','setTags','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getSubjects','/:id/descriptions','/:id/tags'];(function(_0x58b2a,_0x128376){var _0x4e4495=function(_0x527109){while(--_0x527109){_0x58b2a['push'](_0x58b2a['shift']());}};_0x4e4495(++_0x128376);}(_0xedd9,0xfc));var _0x9edd=function(_0x789604,_0x1a336e){_0x789604=_0x789604-0x0;var _0x5c32c3=_0xedd9[_0x789604];return _0x5c32c3;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var fs_extra=require(_0x9edd('0x5'));var auth=require(_0x9edd('0x6'));var interaction=require(_0x9edd('0x7'));var config=require('../../config/environment');var controller=require(_0x9edd('0x8'));router[_0x9edd('0x9')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0xb')]);router['get'](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0xd')]);router[_0x9edd('0x9')](_0x9edd('0xe'),auth[_0x9edd('0xa')](),controller['getFields']);router[_0x9edd('0x9')]('/:id/subjects',auth[_0x9edd('0xa')](),controller[_0x9edd('0xf')]);router['get'](_0x9edd('0x10'),auth[_0x9edd('0xa')](),controller['getDescriptions']);router[_0x9edd('0x9')](_0x9edd('0x11'),auth[_0x9edd('0xa')](),controller[_0x9edd('0x12')]);router[_0x9edd('0x13')]('/',auth[_0x9edd('0xa')](),controller[_0x9edd('0x14')]);router[_0x9edd('0x13')]('/:id/tags',auth[_0x9edd('0xa')](),controller[_0x9edd('0x15')]);router[_0x9edd('0x16')](_0x9edd('0xc'),auth[_0x9edd('0xa')](),controller[_0x9edd('0x17')]);router[_0x9edd('0x18')](_0x9edd('0xc'),auth['isAuthenticated'](),controller[_0x9edd('0x19')]);module[_0x9edd('0x1a')]=router; \ No newline at end of file +var _0x7217=['getDescriptions','/:id/tags','post','setTags','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions'];(function(_0x1800c5,_0x61b30d){var _0x31a368=function(_0x125a6d){while(--_0x125a6d){_0x1800c5['push'](_0x1800c5['shift']());}};_0x31a368(++_0x61b30d);}(_0x7217,0x19e));var _0x7721=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0x7217[_0x45e98e];return _0x374dba;};'use strict';var multer=require(_0x7721('0x0'));var util=require('util');var path=require(_0x7721('0x1'));var timeout=require(_0x7721('0x2'));var express=require(_0x7721('0x3'));var router=express[_0x7721('0x4')]();var fs_extra=require(_0x7721('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7721('0x6'));var controller=require(_0x7721('0x7'));router[_0x7721('0x8')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xa')]);router[_0x7721('0x8')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0xc')]);router[_0x7721('0x8')](_0x7721('0xd'),auth[_0x7721('0x9')](),controller[_0x7721('0xe')]);router[_0x7721('0x8')](_0x7721('0xf'),auth['isAuthenticated'](),controller[_0x7721('0x10')]);router[_0x7721('0x8')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x12')]);router[_0x7721('0x8')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller['getTags']);router[_0x7721('0x14')]('/',auth[_0x7721('0x9')](),controller['create']);router[_0x7721('0x14')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller[_0x7721('0x15')]);router['put'](_0x7721('0xb'),auth[_0x7721('0x9')](),controller['update']);router['delete']('/:id',auth[_0x7721('0x9')](),controller[_0x7721('0x16')]);module[_0x7721('0x17')]=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index 4b8a61b..09697b8 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 _0x1026=['STRING','sequelize','exports'];(function(_0x35defc,_0x29d28a){var _0x38da7c=function(_0x21522a){while(--_0x21522a){_0x35defc['push'](_0x35defc['shift']());}};_0x38da7c(++_0x29d28a);}(_0x1026,0x19f));var _0x6102=function(_0x454e6d,_0x1e1f38){_0x454e6d=_0x454e6d-0x0;var _0x4bc294=_0x1026[_0x454e6d];return _0x4bc294;};'use strict';var Sequelize=require(_0x6102('0x0'));module[_0x6102('0x1')]={'name':{'type':Sequelize[_0x6102('0x2')]},'description':{'type':Sequelize[_0x6102('0x2')]}}; \ No newline at end of file +var _0xf99f=['sequelize','exports','STRING'];(function(_0x333798,_0x1f095d){var _0x5ed715=function(_0x132a99){while(--_0x132a99){_0x333798['push'](_0x333798['shift']());}};_0x5ed715(++_0x1f095d);}(_0xf99f,0x198));var _0xff99=function(_0xf2628e,_0x521bf7){_0xf2628e=_0xf2628e-0x0;var _0x13863a=_0xf99f[_0xf2628e];return _0x13863a;};'use strict';var Sequelize=require(_0xff99('0x0'));module[_0xff99('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xff99('0x2')]}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index e3f22e2..e14bab3 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 _0x908c=['where','merge','VIRTUAL','options','count','includeAll','findAll','rows','catch','show','include','create','body','find','params','getFields','findOne','DeskField','order','getSubjects','nolimit','getDescriptions','getTags','Tag','setTags','ids','rimraf','zip-dir','request-promise','moment','bluebird','util','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','offset','undefined','set','Content-Range','json','apply','reject','save','update','destroy','then','sendStatus','error','stack','name','send','index','map','DeskConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','limit','sort','pick','filter'];(function(_0x4057ea,_0x83c248){var _0x2f75ee=function(_0x4ee3a3){while(--_0x4ee3a3){_0x4057ea['push'](_0x4057ea['shift']());}};_0x2f75ee(++_0x83c248);}(_0x908c,0xc4));var _0xc908=function(_0x1a5689,_0x4920ea){_0x1a5689=_0x1a5689-0x0;var _0x1dbd8a=_0x908c[_0x1a5689];return _0x1dbd8a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc908('0x0'));var zipdir=require(_0xc908('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc908('0x2'));var moment=require(_0xc908('0x3'));var BPromise=require(_0xc908('0x4'));var Mustache=require('mustache');var util=require(_0xc908('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0xc908('0x6'));var ejs=require(_0xc908('0x7'));var fs=require('fs');var fs_extra=require(_0xc908('0x8'));var _=require(_0xc908('0x9'));var squel=require(_0xc908('0xa'));var crypto=require(_0xc908('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xc908('0x6'));var querystring=require(_0xc908('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xc908('0xd'));var as=require(_0xc908('0xe'));var hardwareService=require(_0xc908('0xf'));var logger=require(_0xc908('0x10'))('api');var utils=require(_0xc908('0x11'));var config=require(_0xc908('0x12'));var licenseUtil=require(_0xc908('0x13'));var db=require(_0xc908('0x14'))['db'];function respondWithStatusCode(_0x5151a3,_0x1b783d){_0x1b783d=_0x1b783d||0xcc;return function(_0x427859){if(_0x427859){return _0x5151a3['sendStatus'](_0x1b783d);}return _0x5151a3['status'](_0x1b783d)[_0xc908('0x15')]();};}function respondWithResult(_0xada5b7,_0x1aa2ce){_0x1aa2ce=_0x1aa2ce||0xc8;return function(_0x5dd323){if(_0x5dd323){return _0xada5b7[_0xc908('0x16')](_0x1aa2ce)['json'](_0x5dd323);}};}function respondWithFilteredResult(_0x4ebf2e,_0x170aa8){return function(_0x3cb9d1){if(_0x3cb9d1){var _0x52954e=typeof _0x170aa8[_0xc908('0x17')]===_0xc908('0x18')&&typeof _0x170aa8['limit']===_0xc908('0x18');var _0x24e788=_0x3cb9d1['count'];var _0x461b69=_0x52954e?0x0:_0x170aa8['offset'];var _0x529c5f=_0x52954e?_0x3cb9d1['count']:_0x170aa8[_0xc908('0x17')]+_0x170aa8['limit'];var _0x448ff;if(_0x529c5f>=_0x24e788){_0x529c5f=_0x24e788;_0x448ff=0xc8;}else{_0x448ff=0xce;}_0x4ebf2e[_0xc908('0x16')](_0x448ff);return _0x4ebf2e[_0xc908('0x19')](_0xc908('0x1a'),_0x461b69+'-'+_0x529c5f+'/'+_0x24e788)[_0xc908('0x1b')](_0x3cb9d1);}return null;};}function patchUpdates(_0xad1bef){return function(_0x3d5d92){try{jsonpatch[_0xc908('0x1c')](_0x3d5d92,_0xad1bef,!![]);}catch(_0x30a531){return BPromise[_0xc908('0x1d')](_0x30a531);}return _0x3d5d92[_0xc908('0x1e')]();};}function saveUpdates(_0x47c33a,_0x505a8c){return function(_0x2af27a){if(_0x2af27a){return _0x2af27a[_0xc908('0x1f')](_0x47c33a)['then'](function(_0x24027d){return _0x24027d;});}return null;};}function removeEntity(_0x263b4a,_0x13910c){return function(_0x5441dd){if(_0x5441dd){return _0x5441dd[_0xc908('0x20')]()[_0xc908('0x21')](function(){_0x263b4a[_0xc908('0x16')](0xcc)[_0xc908('0x15')]();});}};}function handleEntityNotFound(_0x2129e4,_0x18fbe7){return function(_0x28516c){if(!_0x28516c){_0x2129e4[_0xc908('0x22')](0x194);}return _0x28516c;};}function handleError(_0x4358fa,_0x3fafc4){_0x3fafc4=_0x3fafc4||0x1f4;return function(_0x5b1234){logger[_0xc908('0x23')](_0x5b1234[_0xc908('0x24')]);if(_0x5b1234[_0xc908('0x25')]){delete _0x5b1234['name'];}_0x4358fa[_0xc908('0x16')](_0x3fafc4)[_0xc908('0x26')](_0x5b1234);};}exports[_0xc908('0x27')]=function(_0x30eb71,_0x294f8b){var _0x19fad7={},_0x357870={},_0x5d6056={'count':0x0,'rows':[]};var _0x23c14e=_[_0xc908('0x28')](db[_0xc908('0x29')][_0xc908('0x2a')],function(_0x40b491){return{'name':_0x40b491[_0xc908('0x2b')],'type':_0x40b491[_0xc908('0x2c')][_0xc908('0x2d')]};});_0x357870[_0xc908('0x2e')]=_['map'](_0x23c14e,_0xc908('0x25'));_0x357870[_0xc908('0x2f')]=_[_0xc908('0x30')](_0x30eb71[_0xc908('0x2f')]);_0x357870[_0xc908('0x31')]=_['intersection'](_0x357870[_0xc908('0x2e')],_0x357870[_0xc908('0x2f')]);_0x19fad7[_0xc908('0x32')]=_[_0xc908('0x33')](_0x357870[_0xc908('0x2e')],qs[_0xc908('0x34')](_0x30eb71[_0xc908('0x2f')]['fields']));_0x19fad7[_0xc908('0x32')]=_0x19fad7[_0xc908('0x32')][_0xc908('0x35')]?_0x19fad7['attributes']:_0x357870[_0xc908('0x2e')];if(!_0x30eb71['query'][_0xc908('0x36')]('nolimit')){_0x19fad7[_0xc908('0x37')]=qs['limit'](_0x30eb71['query']['limit']);_0x19fad7[_0xc908('0x17')]=qs[_0xc908('0x17')](_0x30eb71[_0xc908('0x2f')][_0xc908('0x17')]);}_0x19fad7['order']=qs['sort'](_0x30eb71['query'][_0xc908('0x38')]);_0x19fad7['where']=qs[_0xc908('0x31')](_[_0xc908('0x39')](_0x30eb71[_0xc908('0x2f')],_0x357870[_0xc908('0x31')]),_0x23c14e);if(_0x30eb71[_0xc908('0x2f')][_0xc908('0x3a')]){_0x19fad7[_0xc908('0x3b')]=_[_0xc908('0x3c')](_0x19fad7[_0xc908('0x3b')],{'$or':_[_0xc908('0x28')](_0x23c14e,function(_0x194208){if(_0x194208[_0xc908('0x2c')]!==_0xc908('0x3d')){var _0x16582b={};_0x16582b[_0x194208[_0xc908('0x25')]]={'$like':'%'+_0x30eb71[_0xc908('0x2f')]['filter']+'%'};return _0x16582b;}})});}_0x19fad7=_[_0xc908('0x3c')]({},_0x19fad7,_0x30eb71[_0xc908('0x3e')]);var _0x4355d7={'where':_0x19fad7[_0xc908('0x3b')]};return db[_0xc908('0x29')]['count'](_0x4355d7)[_0xc908('0x21')](function(_0x5a8bf3){_0x5d6056[_0xc908('0x3f')]=_0x5a8bf3;if(_0x30eb71[_0xc908('0x2f')][_0xc908('0x40')]){_0x19fad7['include']=[{'all':!![]}];}return db[_0xc908('0x29')][_0xc908('0x41')](_0x19fad7);})[_0xc908('0x21')](function(_0x4436cb){_0x5d6056[_0xc908('0x42')]=_0x4436cb;return _0x5d6056;})[_0xc908('0x21')](respondWithFilteredResult(_0x294f8b,_0x19fad7))[_0xc908('0x43')](handleError(_0x294f8b,null));};exports[_0xc908('0x44')]=function(_0x49f5d0,_0x1620b1){var _0x3f4c9a={'raw':![],'where':{'id':_0x49f5d0['params']['id']}},_0x12af31={};_0x12af31[_0xc908('0x2e')]=_[_0xc908('0x30')](db[_0xc908('0x29')]['rawAttributes']);_0x12af31[_0xc908('0x2f')]=_[_0xc908('0x30')](_0x49f5d0['query']);_0x12af31['filters']=_[_0xc908('0x33')](_0x12af31[_0xc908('0x2e')],_0x12af31['query']);_0x3f4c9a['attributes']=_[_0xc908('0x33')](_0x12af31[_0xc908('0x2e')],qs[_0xc908('0x34')](_0x49f5d0[_0xc908('0x2f')][_0xc908('0x34')]));_0x3f4c9a[_0xc908('0x32')]=_0x3f4c9a['attributes'][_0xc908('0x35')]?_0x3f4c9a[_0xc908('0x32')]:_0x12af31[_0xc908('0x2e')];if(_0x49f5d0[_0xc908('0x2f')][_0xc908('0x40')]){_0x3f4c9a[_0xc908('0x45')]=[{'all':!![]}];}_0x3f4c9a=_[_0xc908('0x3c')]({},_0x3f4c9a,_0x49f5d0['options']);return db['DeskConfiguration']['find'](_0x3f4c9a)[_0xc908('0x21')](handleEntityNotFound(_0x1620b1,null))[_0xc908('0x21')](respondWithResult(_0x1620b1,null))[_0xc908('0x43')](handleError(_0x1620b1,null));};exports[_0xc908('0x46')]=function(_0x4cbfa7,_0x579ca2){return db[_0xc908('0x29')][_0xc908('0x46')](_0x4cbfa7[_0xc908('0x47')],{})[_0xc908('0x21')](respondWithResult(_0x579ca2,0xc9))[_0xc908('0x43')](handleError(_0x579ca2,null));};exports['update']=function(_0x3c7065,_0x1ac56b){if(_0x3c7065[_0xc908('0x47')]['id']){delete _0x3c7065['body']['id'];}return db[_0xc908('0x29')][_0xc908('0x48')]({'where':{'id':_0x3c7065[_0xc908('0x49')]['id']}})[_0xc908('0x21')](handleEntityNotFound(_0x1ac56b,null))[_0xc908('0x21')](saveUpdates(_0x3c7065['body'],null))[_0xc908('0x21')](respondWithResult(_0x1ac56b,null))[_0xc908('0x43')](handleError(_0x1ac56b,null));};exports[_0xc908('0x20')]=function(_0x5ba486,_0x43c8ba){return db[_0xc908('0x29')][_0xc908('0x48')]({'where':{'id':_0x5ba486[_0xc908('0x49')]['id']}})['then'](handleEntityNotFound(_0x43c8ba,null))[_0xc908('0x21')](removeEntity(_0x43c8ba,null))[_0xc908('0x43')](handleError(_0x43c8ba,null));};exports[_0xc908('0x4a')]=function(_0x394637,_0x4aa331,_0x2211b6){var _0x2c90a6={};var _0x36da55={};var _0xb5fb6f;var _0x42c62b;return db[_0xc908('0x29')][_0xc908('0x4b')]({'where':{'id':_0x394637[_0xc908('0x49')]['id']}})['then'](handleEntityNotFound(_0x4aa331,null))[_0xc908('0x21')](function(_0x56db1d){if(_0x56db1d){_0xb5fb6f=_0x56db1d;_0x36da55[_0xc908('0x2e')]=_['keys'](db[_0xc908('0x4c')][_0xc908('0x2a')]);_0x36da55[_0xc908('0x2f')]=_['keys'](_0x394637[_0xc908('0x2f')]);_0x36da55['filters']=_[_0xc908('0x33')](_0x36da55[_0xc908('0x2e')],_0x36da55['query']);_0x2c90a6[_0xc908('0x32')]=_[_0xc908('0x33')](_0x36da55['model'],qs['fields'](_0x394637[_0xc908('0x2f')][_0xc908('0x34')]));_0x2c90a6[_0xc908('0x32')]=_0x2c90a6[_0xc908('0x32')][_0xc908('0x35')]?_0x2c90a6[_0xc908('0x32')]:_0x36da55[_0xc908('0x2e')];_0x2c90a6[_0xc908('0x4d')]=qs[_0xc908('0x38')](_0x394637['query']['sort']);_0x2c90a6[_0xc908('0x3b')]=qs['filters'](_[_0xc908('0x39')](_0x394637[_0xc908('0x2f')],_0x36da55[_0xc908('0x31')]));if(_0x394637[_0xc908('0x2f')][_0xc908('0x3a')]){_0x2c90a6['where']=_['merge'](_0x2c90a6[_0xc908('0x3b')],{'$or':_[_0xc908('0x28')](_0x2c90a6[_0xc908('0x32')],function(_0x34751c){var _0x583563={};_0x583563[_0x34751c]={'$like':'%'+_0x394637[_0xc908('0x2f')]['filter']+'%'};return _0x583563;})});}_0x2c90a6=_['merge']({},_0x2c90a6,_0x394637[_0xc908('0x3e')]);return _0xb5fb6f['getFields'](_0x2c90a6);}})['then'](function(_0x559ce9){if(_0x559ce9){_0x42c62b=_0x559ce9[_0xc908('0x35')];if(!_0x394637[_0xc908('0x2f')][_0xc908('0x36')]('nolimit')){_0x2c90a6['limit']=qs['limit'](_0x394637[_0xc908('0x2f')][_0xc908('0x37')]);_0x2c90a6[_0xc908('0x17')]=qs[_0xc908('0x17')](_0x394637['query'][_0xc908('0x17')]);}return _0xb5fb6f['getFields'](_0x2c90a6);}})[_0xc908('0x21')](function(_0xd35ffe){if(_0xd35ffe){return _0xd35ffe?{'count':_0x42c62b,'rows':_0xd35ffe}:null;}})[_0xc908('0x21')](respondWithResult(_0x4aa331,null))[_0xc908('0x43')](handleError(_0x4aa331,null));};exports[_0xc908('0x4e')]=function(_0x3e1f50,_0x3808a7,_0x286184){var _0x150ec3={};var _0x51d0a4={};var _0x25b4aa;var _0x3cad59;return db['DeskConfiguration'][_0xc908('0x4b')]({'where':{'id':_0x3e1f50['params']['id']}})['then'](handleEntityNotFound(_0x3808a7,null))[_0xc908('0x21')](function(_0x265d26){if(_0x265d26){_0x25b4aa=_0x265d26;_0x51d0a4[_0xc908('0x2e')]=_[_0xc908('0x30')](db[_0xc908('0x4c')][_0xc908('0x2a')]);_0x51d0a4[_0xc908('0x2f')]=_[_0xc908('0x30')](_0x3e1f50['query']);_0x51d0a4[_0xc908('0x31')]=_[_0xc908('0x33')](_0x51d0a4['model'],_0x51d0a4[_0xc908('0x2f')]);_0x150ec3['attributes']=_[_0xc908('0x33')](_0x51d0a4[_0xc908('0x2e')],qs[_0xc908('0x34')](_0x3e1f50[_0xc908('0x2f')][_0xc908('0x34')]));_0x150ec3['attributes']=_0x150ec3[_0xc908('0x32')][_0xc908('0x35')]?_0x150ec3['attributes']:_0x51d0a4['model'];_0x150ec3[_0xc908('0x4d')]=qs[_0xc908('0x38')](_0x3e1f50['query']['sort']);_0x150ec3[_0xc908('0x3b')]=qs[_0xc908('0x31')](_['pick'](_0x3e1f50[_0xc908('0x2f')],_0x51d0a4[_0xc908('0x31')]));if(_0x3e1f50['query'][_0xc908('0x3a')]){_0x150ec3[_0xc908('0x3b')]=_[_0xc908('0x3c')](_0x150ec3[_0xc908('0x3b')],{'$or':_[_0xc908('0x28')](_0x150ec3[_0xc908('0x32')],function(_0x8006f8){var _0x45b776={};_0x45b776[_0x8006f8]={'$like':'%'+_0x3e1f50[_0xc908('0x2f')]['filter']+'%'};return _0x45b776;})});}_0x150ec3=_[_0xc908('0x3c')]({},_0x150ec3,_0x3e1f50[_0xc908('0x3e')]);return _0x25b4aa[_0xc908('0x4e')](_0x150ec3);}})[_0xc908('0x21')](function(_0x3090fa){if(_0x3090fa){_0x3cad59=_0x3090fa['length'];if(!_0x3e1f50[_0xc908('0x2f')]['hasOwnProperty'](_0xc908('0x4f'))){_0x150ec3['limit']=qs[_0xc908('0x37')](_0x3e1f50[_0xc908('0x2f')]['limit']);_0x150ec3[_0xc908('0x17')]=qs[_0xc908('0x17')](_0x3e1f50[_0xc908('0x2f')][_0xc908('0x17')]);}return _0x25b4aa[_0xc908('0x4e')](_0x150ec3);}})[_0xc908('0x21')](function(_0x52b07b){if(_0x52b07b){return _0x52b07b?{'count':_0x3cad59,'rows':_0x52b07b}:null;}})[_0xc908('0x21')](respondWithResult(_0x3808a7,null))[_0xc908('0x43')](handleError(_0x3808a7,null));};exports[_0xc908('0x50')]=function(_0x321110,_0x377f49,_0xaa2083){var _0x1714ba={};var _0xd2468e={};var _0xe5a020;var _0x5db3d7;return db[_0xc908('0x29')][_0xc908('0x4b')]({'where':{'id':_0x321110[_0xc908('0x49')]['id']}})[_0xc908('0x21')](handleEntityNotFound(_0x377f49,null))[_0xc908('0x21')](function(_0x6fb1fd){if(_0x6fb1fd){_0xe5a020=_0x6fb1fd;_0xd2468e[_0xc908('0x2e')]=_[_0xc908('0x30')](db['DeskField'][_0xc908('0x2a')]);_0xd2468e[_0xc908('0x2f')]=_[_0xc908('0x30')](_0x321110['query']);_0xd2468e['filters']=_['intersection'](_0xd2468e[_0xc908('0x2e')],_0xd2468e[_0xc908('0x2f')]);_0x1714ba[_0xc908('0x32')]=_[_0xc908('0x33')](_0xd2468e[_0xc908('0x2e')],qs[_0xc908('0x34')](_0x321110[_0xc908('0x2f')]['fields']));_0x1714ba['attributes']=_0x1714ba['attributes'][_0xc908('0x35')]?_0x1714ba[_0xc908('0x32')]:_0xd2468e[_0xc908('0x2e')];_0x1714ba[_0xc908('0x4d')]=qs[_0xc908('0x38')](_0x321110[_0xc908('0x2f')][_0xc908('0x38')]);_0x1714ba['where']=qs[_0xc908('0x31')](_['pick'](_0x321110[_0xc908('0x2f')],_0xd2468e['filters']));if(_0x321110[_0xc908('0x2f')][_0xc908('0x3a')]){_0x1714ba[_0xc908('0x3b')]=_[_0xc908('0x3c')](_0x1714ba['where'],{'$or':_['map'](_0x1714ba['attributes'],function(_0x29ae9a){var _0x492031={};_0x492031[_0x29ae9a]={'$like':'%'+_0x321110[_0xc908('0x2f')][_0xc908('0x3a')]+'%'};return _0x492031;})});}_0x1714ba=_[_0xc908('0x3c')]({},_0x1714ba,_0x321110['options']);return _0xe5a020[_0xc908('0x50')](_0x1714ba);}})[_0xc908('0x21')](function(_0x1df86e){if(_0x1df86e){_0x5db3d7=_0x1df86e['length'];if(!_0x321110[_0xc908('0x2f')][_0xc908('0x36')](_0xc908('0x4f'))){_0x1714ba[_0xc908('0x37')]=qs['limit'](_0x321110[_0xc908('0x2f')][_0xc908('0x37')]);_0x1714ba[_0xc908('0x17')]=qs[_0xc908('0x17')](_0x321110[_0xc908('0x2f')][_0xc908('0x17')]);}return _0xe5a020[_0xc908('0x50')](_0x1714ba);}})['then'](function(_0x2d95f3){if(_0x2d95f3){return _0x2d95f3?{'count':_0x5db3d7,'rows':_0x2d95f3}:null;}})[_0xc908('0x21')](respondWithResult(_0x377f49,null))[_0xc908('0x43')](handleError(_0x377f49,null));};exports[_0xc908('0x51')]=function(_0x3af729,_0x22d7f0,_0x2eea5d){var _0x10397e={};var _0x4dc4fd={};var _0x26209b;var _0x33925e;return db[_0xc908('0x29')][_0xc908('0x4b')]({'where':{'id':_0x3af729['params']['id']}})[_0xc908('0x21')](handleEntityNotFound(_0x22d7f0,null))['then'](function(_0x4ff522){if(_0x4ff522){_0x26209b=_0x4ff522;_0x4dc4fd[_0xc908('0x2e')]=_[_0xc908('0x30')](db[_0xc908('0x52')][_0xc908('0x2a')]);_0x4dc4fd[_0xc908('0x2f')]=_[_0xc908('0x30')](_0x3af729[_0xc908('0x2f')]);_0x4dc4fd[_0xc908('0x31')]=_[_0xc908('0x33')](_0x4dc4fd[_0xc908('0x2e')],_0x4dc4fd[_0xc908('0x2f')]);_0x10397e[_0xc908('0x32')]=_[_0xc908('0x33')](_0x4dc4fd['model'],qs[_0xc908('0x34')](_0x3af729[_0xc908('0x2f')][_0xc908('0x34')]));_0x10397e['attributes']=_0x10397e['attributes'][_0xc908('0x35')]?_0x10397e['attributes']:_0x4dc4fd[_0xc908('0x2e')];_0x10397e[_0xc908('0x4d')]=qs[_0xc908('0x38')](_0x3af729[_0xc908('0x2f')][_0xc908('0x38')]);_0x10397e['where']=qs['filters'](_[_0xc908('0x39')](_0x3af729['query'],_0x4dc4fd['filters']));if(_0x3af729['query'][_0xc908('0x3a')]){_0x10397e['where']=_[_0xc908('0x3c')](_0x10397e[_0xc908('0x3b')],{'$or':_[_0xc908('0x28')](_0x10397e[_0xc908('0x32')],function(_0x138bdf){var _0x3ae181={};_0x3ae181[_0x138bdf]={'$like':'%'+_0x3af729[_0xc908('0x2f')][_0xc908('0x3a')]+'%'};return _0x3ae181;})});}_0x10397e=_[_0xc908('0x3c')]({},_0x10397e,_0x3af729['options']);return _0x26209b[_0xc908('0x51')](_0x10397e);}})[_0xc908('0x21')](function(_0x34002e){if(_0x34002e){_0x33925e=_0x34002e['length'];if(!_0x3af729['query'][_0xc908('0x36')](_0xc908('0x4f'))){_0x10397e[_0xc908('0x37')]=qs[_0xc908('0x37')](_0x3af729['query']['limit']);_0x10397e[_0xc908('0x17')]=qs[_0xc908('0x17')](_0x3af729[_0xc908('0x2f')][_0xc908('0x17')]);}return _0x26209b[_0xc908('0x51')](_0x10397e);}})[_0xc908('0x21')](function(_0x180981){if(_0x180981){return _0x180981?{'count':_0x33925e,'rows':_0x180981}:null;}})[_0xc908('0x21')](respondWithResult(_0x22d7f0,null))[_0xc908('0x43')](handleError(_0x22d7f0,null));};exports[_0xc908('0x53')]=function(_0x28bc21,_0x363d4a,_0x2a9be3){if(_0x28bc21['body']['id']){delete _0x28bc21['body']['id'];}return db['DeskConfiguration'][_0xc908('0x4b')]({'where':{'id':_0x28bc21['params']['id']}})[_0xc908('0x21')](handleEntityNotFound(_0x363d4a,null))[_0xc908('0x21')](function(_0x327e15){if(_0x327e15){return _0x327e15[_0xc908('0x53')](_0x28bc21[_0xc908('0x47')][_0xc908('0x54')]||[]);}return null;})[_0xc908('0x21')](respondWithResult(_0x363d4a,null))['catch'](handleError(_0x363d4a,null));}; \ No newline at end of file +var _0x2b25=['reject','save','update','then','destroy','error','name','map','DeskConfiguration','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','length','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','getFields','getSubjects','findOne','DeskField','getDescriptions','getTags','Tag','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','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','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x2b25,0x133));var _0x52b2=function(_0x1e5cc0,_0x5260ec){_0x1e5cc0=_0x1e5cc0-0x0;var _0x3b6f1b=_0x2b25[_0x1e5cc0];return _0x3b6f1b;};'use strict';var emlformat=require(_0x52b2('0x0'));var rimraf=require(_0x52b2('0x1'));var zipdir=require(_0x52b2('0x2'));var jsonpatch=require(_0x52b2('0x3'));var rp=require(_0x52b2('0x4'));var moment=require('moment');var BPromise=require(_0x52b2('0x5'));var Mustache=require('mustache');var util=require(_0x52b2('0x6'));var path=require(_0x52b2('0x7'));var sox=require(_0x52b2('0x8'));var csv=require(_0x52b2('0x9'));var ejs=require(_0x52b2('0xa'));var fs=require('fs');var fs_extra=require(_0x52b2('0xb'));var _=require(_0x52b2('0xc'));var squel=require(_0x52b2('0xd'));var crypto=require(_0x52b2('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x52b2('0xf'));var toCsv=require(_0x52b2('0x9'));var querystring=require(_0x52b2('0x10'));var Papa=require(_0x52b2('0x11'));var Redis=require(_0x52b2('0x12'));var authService=require(_0x52b2('0x13'));var qs=require(_0x52b2('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x52b2('0x15'));var logger=require(_0x52b2('0x16'))(_0x52b2('0x17'));var utils=require('../../config/utils');var config=require(_0x52b2('0x18'));var licenseUtil=require(_0x52b2('0x19'));var db=require(_0x52b2('0x1a'))['db'];function respondWithStatusCode(_0x28f4d1,_0x1b8909){_0x1b8909=_0x1b8909||0xcc;return function(_0x3fda2f){if(_0x3fda2f){return _0x28f4d1[_0x52b2('0x1b')](_0x1b8909);}return _0x28f4d1[_0x52b2('0x1c')](_0x1b8909)[_0x52b2('0x1d')]();};}function respondWithResult(_0xbcb5f6,_0x5d8b0b){_0x5d8b0b=_0x5d8b0b||0xc8;return function(_0x5b3e80){if(_0x5b3e80){return _0xbcb5f6[_0x52b2('0x1c')](_0x5d8b0b)[_0x52b2('0x1e')](_0x5b3e80);}};}function respondWithFilteredResult(_0x304ec4,_0x181c3d){return function(_0x204402){if(_0x204402){var _0x1017ae=typeof _0x181c3d[_0x52b2('0x1f')]==='undefined'&&typeof _0x181c3d[_0x52b2('0x20')]==='undefined';var _0x2d7613=_0x204402[_0x52b2('0x21')];var _0x62f76=_0x1017ae?0x0:_0x181c3d[_0x52b2('0x1f')];var _0x15919f=_0x1017ae?_0x204402[_0x52b2('0x21')]:_0x181c3d[_0x52b2('0x1f')]+_0x181c3d[_0x52b2('0x20')];var _0x2b5ae6;if(_0x15919f>=_0x2d7613){_0x15919f=_0x2d7613;_0x2b5ae6=0xc8;}else{_0x2b5ae6=0xce;}_0x304ec4[_0x52b2('0x1c')](_0x2b5ae6);return _0x304ec4[_0x52b2('0x22')](_0x52b2('0x23'),_0x62f76+'-'+_0x15919f+'/'+_0x2d7613)[_0x52b2('0x1e')](_0x204402);}return null;};}function patchUpdates(_0x811098){return function(_0x36bec7){try{jsonpatch[_0x52b2('0x24')](_0x36bec7,_0x811098,!![]);}catch(_0xa8b8ef){return BPromise[_0x52b2('0x25')](_0xa8b8ef);}return _0x36bec7[_0x52b2('0x26')]();};}function saveUpdates(_0x552a42,_0x3a6a88){return function(_0x39bf99){if(_0x39bf99){return _0x39bf99[_0x52b2('0x27')](_0x552a42)[_0x52b2('0x28')](function(_0x1d95c2){return _0x1d95c2;});}return null;};}function removeEntity(_0x3d8328,_0x385d82){return function(_0x5aed49){if(_0x5aed49){return _0x5aed49[_0x52b2('0x29')]()[_0x52b2('0x28')](function(){_0x3d8328[_0x52b2('0x1c')](0xcc)[_0x52b2('0x1d')]();});}};}function handleEntityNotFound(_0x226d32,_0x4eac4f){return function(_0x12bd60){if(!_0x12bd60){_0x226d32[_0x52b2('0x1b')](0x194);}return _0x12bd60;};}function handleError(_0x175678,_0x158c5a){_0x158c5a=_0x158c5a||0x1f4;return function(_0x5eb4e1){logger[_0x52b2('0x2a')](_0x5eb4e1['stack']);if(_0x5eb4e1[_0x52b2('0x2b')]){delete _0x5eb4e1[_0x52b2('0x2b')];}_0x175678[_0x52b2('0x1c')](_0x158c5a)['send'](_0x5eb4e1);};}exports['index']=function(_0x5c8006,_0x52dfba){var _0x2562cc={},_0x59a2b9={},_0x181a09={'count':0x0,'rows':[]};var _0x350b6f=_[_0x52b2('0x2c')](db[_0x52b2('0x2d')][_0x52b2('0x2e')],function(_0x14a79c){return{'name':_0x14a79c[_0x52b2('0x2f')],'type':_0x14a79c[_0x52b2('0x30')][_0x52b2('0x31')]};});_0x59a2b9['model']=_['map'](_0x350b6f,_0x52b2('0x2b'));_0x59a2b9[_0x52b2('0x32')]=_[_0x52b2('0x33')](_0x5c8006['query']);_0x59a2b9[_0x52b2('0x34')]=_[_0x52b2('0x35')](_0x59a2b9[_0x52b2('0x36')],_0x59a2b9['query']);_0x2562cc['attributes']=_[_0x52b2('0x35')](_0x59a2b9['model'],qs['fields'](_0x5c8006[_0x52b2('0x32')][_0x52b2('0x37')]));_0x2562cc['attributes']=_0x2562cc['attributes'][_0x52b2('0x38')]?_0x2562cc[_0x52b2('0x39')]:_0x59a2b9[_0x52b2('0x36')];if(!_0x5c8006[_0x52b2('0x32')][_0x52b2('0x3a')](_0x52b2('0x3b'))){_0x2562cc['limit']=qs['limit'](_0x5c8006['query']['limit']);_0x2562cc[_0x52b2('0x1f')]=qs[_0x52b2('0x1f')](_0x5c8006[_0x52b2('0x32')]['offset']);}_0x2562cc[_0x52b2('0x3c')]=qs[_0x52b2('0x3d')](_0x5c8006[_0x52b2('0x32')][_0x52b2('0x3d')]);_0x2562cc[_0x52b2('0x3e')]=qs[_0x52b2('0x34')](_[_0x52b2('0x3f')](_0x5c8006[_0x52b2('0x32')],_0x59a2b9[_0x52b2('0x34')]),_0x350b6f);if(_0x5c8006['query'][_0x52b2('0x40')]){_0x2562cc[_0x52b2('0x3e')]=_[_0x52b2('0x41')](_0x2562cc['where'],{'$or':_[_0x52b2('0x2c')](_0x350b6f,function(_0x158c01){if(_0x158c01[_0x52b2('0x30')]!==_0x52b2('0x42')){var _0x464b27={};_0x464b27[_0x158c01[_0x52b2('0x2b')]]={'$like':'%'+_0x5c8006[_0x52b2('0x32')][_0x52b2('0x40')]+'%'};return _0x464b27;}})});}_0x2562cc=_[_0x52b2('0x41')]({},_0x2562cc,_0x5c8006[_0x52b2('0x43')]);var _0x5e8955={'where':_0x2562cc[_0x52b2('0x3e')]};return db[_0x52b2('0x2d')][_0x52b2('0x21')](_0x5e8955)['then'](function(_0x19955c){_0x181a09['count']=_0x19955c;if(_0x5c8006['query'][_0x52b2('0x44')]){_0x2562cc[_0x52b2('0x45')]=[{'all':!![]}];}return db[_0x52b2('0x2d')][_0x52b2('0x46')](_0x2562cc);})[_0x52b2('0x28')](function(_0xc2b893){_0x181a09[_0x52b2('0x47')]=_0xc2b893;return _0x181a09;})[_0x52b2('0x28')](respondWithFilteredResult(_0x52dfba,_0x2562cc))[_0x52b2('0x48')](handleError(_0x52dfba,null));};exports[_0x52b2('0x49')]=function(_0x2fbed8,_0x251e5c){var _0x3e3bfb={'raw':![],'where':{'id':_0x2fbed8[_0x52b2('0x4a')]['id']}},_0x4b79d0={};_0x4b79d0[_0x52b2('0x36')]=_[_0x52b2('0x33')](db[_0x52b2('0x2d')][_0x52b2('0x2e')]);_0x4b79d0[_0x52b2('0x32')]=_[_0x52b2('0x33')](_0x2fbed8['query']);_0x4b79d0[_0x52b2('0x34')]=_[_0x52b2('0x35')](_0x4b79d0[_0x52b2('0x36')],_0x4b79d0[_0x52b2('0x32')]);_0x3e3bfb[_0x52b2('0x39')]=_[_0x52b2('0x35')](_0x4b79d0[_0x52b2('0x36')],qs['fields'](_0x2fbed8['query'][_0x52b2('0x37')]));_0x3e3bfb[_0x52b2('0x39')]=_0x3e3bfb[_0x52b2('0x39')][_0x52b2('0x38')]?_0x3e3bfb[_0x52b2('0x39')]:_0x4b79d0[_0x52b2('0x36')];if(_0x2fbed8[_0x52b2('0x32')][_0x52b2('0x44')]){_0x3e3bfb[_0x52b2('0x45')]=[{'all':!![]}];}_0x3e3bfb=_['merge']({},_0x3e3bfb,_0x2fbed8[_0x52b2('0x43')]);return db[_0x52b2('0x2d')][_0x52b2('0x4b')](_0x3e3bfb)[_0x52b2('0x28')](handleEntityNotFound(_0x251e5c,null))[_0x52b2('0x28')](respondWithResult(_0x251e5c,null))['catch'](handleError(_0x251e5c,null));};exports[_0x52b2('0x4c')]=function(_0x86e6c8,_0x93e54d){return db[_0x52b2('0x2d')]['create'](_0x86e6c8[_0x52b2('0x4d')],{})['then'](respondWithResult(_0x93e54d,0xc9))[_0x52b2('0x48')](handleError(_0x93e54d,null));};exports[_0x52b2('0x27')]=function(_0x3de936,_0x4e2496){if(_0x3de936['body']['id']){delete _0x3de936[_0x52b2('0x4d')]['id'];}return db['DeskConfiguration'][_0x52b2('0x4b')]({'where':{'id':_0x3de936[_0x52b2('0x4a')]['id']}})[_0x52b2('0x28')](handleEntityNotFound(_0x4e2496,null))[_0x52b2('0x28')](saveUpdates(_0x3de936[_0x52b2('0x4d')],null))[_0x52b2('0x28')](respondWithResult(_0x4e2496,null))['catch'](handleError(_0x4e2496,null));};exports[_0x52b2('0x29')]=function(_0x5d0738,_0x53f3eb){return db['DeskConfiguration'][_0x52b2('0x4b')]({'where':{'id':_0x5d0738['params']['id']}})['then'](handleEntityNotFound(_0x53f3eb,null))[_0x52b2('0x28')](removeEntity(_0x53f3eb,null))[_0x52b2('0x48')](handleError(_0x53f3eb,null));};exports[_0x52b2('0x4e')]=function(_0x363e9f,_0x369ba3,_0x1b8641){var _0x49002d={};var _0x3f8b91={};var _0x58fb76;var _0x35e69a;return db[_0x52b2('0x2d')]['findOne']({'where':{'id':_0x363e9f[_0x52b2('0x4a')]['id']}})[_0x52b2('0x28')](handleEntityNotFound(_0x369ba3,null))['then'](function(_0x5d288e){if(_0x5d288e){_0x58fb76=_0x5d288e;_0x3f8b91['model']=_['keys'](db['DeskField'][_0x52b2('0x2e')]);_0x3f8b91[_0x52b2('0x32')]=_[_0x52b2('0x33')](_0x363e9f[_0x52b2('0x32')]);_0x3f8b91['filters']=_[_0x52b2('0x35')](_0x3f8b91[_0x52b2('0x36')],_0x3f8b91['query']);_0x49002d['attributes']=_[_0x52b2('0x35')](_0x3f8b91['model'],qs[_0x52b2('0x37')](_0x363e9f[_0x52b2('0x32')][_0x52b2('0x37')]));_0x49002d['attributes']=_0x49002d[_0x52b2('0x39')]['length']?_0x49002d[_0x52b2('0x39')]:_0x3f8b91[_0x52b2('0x36')];_0x49002d[_0x52b2('0x3c')]=qs[_0x52b2('0x3d')](_0x363e9f[_0x52b2('0x32')][_0x52b2('0x3d')]);_0x49002d[_0x52b2('0x3e')]=qs[_0x52b2('0x34')](_[_0x52b2('0x3f')](_0x363e9f['query'],_0x3f8b91['filters']));if(_0x363e9f[_0x52b2('0x32')][_0x52b2('0x40')]){_0x49002d[_0x52b2('0x3e')]=_[_0x52b2('0x41')](_0x49002d['where'],{'$or':_[_0x52b2('0x2c')](_0x49002d['attributes'],function(_0x518b1c){var _0x14bf49={};_0x14bf49[_0x518b1c]={'$like':'%'+_0x363e9f[_0x52b2('0x32')][_0x52b2('0x40')]+'%'};return _0x14bf49;})});}_0x49002d=_[_0x52b2('0x41')]({},_0x49002d,_0x363e9f['options']);return _0x58fb76[_0x52b2('0x4e')](_0x49002d);}})[_0x52b2('0x28')](function(_0x4d674e){if(_0x4d674e){_0x35e69a=_0x4d674e[_0x52b2('0x38')];if(!_0x363e9f[_0x52b2('0x32')][_0x52b2('0x3a')](_0x52b2('0x3b'))){_0x49002d[_0x52b2('0x20')]=qs[_0x52b2('0x20')](_0x363e9f['query'][_0x52b2('0x20')]);_0x49002d['offset']=qs[_0x52b2('0x1f')](_0x363e9f['query'][_0x52b2('0x1f')]);}return _0x58fb76[_0x52b2('0x4e')](_0x49002d);}})[_0x52b2('0x28')](function(_0x1b3c5b){if(_0x1b3c5b){return _0x1b3c5b?{'count':_0x35e69a,'rows':_0x1b3c5b}:null;}})[_0x52b2('0x28')](respondWithResult(_0x369ba3,null))['catch'](handleError(_0x369ba3,null));};exports['getSubjects']=function(_0x2d26bb,_0xf0da9a,_0x4c3787){var _0x103672={};var _0x86884b={};var _0x1c08ac;var _0x1c9c33;return db[_0x52b2('0x2d')]['findOne']({'where':{'id':_0x2d26bb[_0x52b2('0x4a')]['id']}})[_0x52b2('0x28')](handleEntityNotFound(_0xf0da9a,null))['then'](function(_0xc00cf){if(_0xc00cf){_0x1c08ac=_0xc00cf;_0x86884b[_0x52b2('0x36')]=_[_0x52b2('0x33')](db['DeskField']['rawAttributes']);_0x86884b[_0x52b2('0x32')]=_[_0x52b2('0x33')](_0x2d26bb[_0x52b2('0x32')]);_0x86884b[_0x52b2('0x34')]=_[_0x52b2('0x35')](_0x86884b['model'],_0x86884b['query']);_0x103672[_0x52b2('0x39')]=_[_0x52b2('0x35')](_0x86884b['model'],qs[_0x52b2('0x37')](_0x2d26bb[_0x52b2('0x32')][_0x52b2('0x37')]));_0x103672[_0x52b2('0x39')]=_0x103672['attributes'][_0x52b2('0x38')]?_0x103672[_0x52b2('0x39')]:_0x86884b[_0x52b2('0x36')];_0x103672[_0x52b2('0x3c')]=qs[_0x52b2('0x3d')](_0x2d26bb[_0x52b2('0x32')][_0x52b2('0x3d')]);_0x103672[_0x52b2('0x3e')]=qs['filters'](_[_0x52b2('0x3f')](_0x2d26bb[_0x52b2('0x32')],_0x86884b['filters']));if(_0x2d26bb[_0x52b2('0x32')]['filter']){_0x103672[_0x52b2('0x3e')]=_['merge'](_0x103672[_0x52b2('0x3e')],{'$or':_['map'](_0x103672[_0x52b2('0x39')],function(_0x2c8569){var _0x3ca48c={};_0x3ca48c[_0x2c8569]={'$like':'%'+_0x2d26bb[_0x52b2('0x32')][_0x52b2('0x40')]+'%'};return _0x3ca48c;})});}_0x103672=_[_0x52b2('0x41')]({},_0x103672,_0x2d26bb[_0x52b2('0x43')]);return _0x1c08ac['getSubjects'](_0x103672);}})['then'](function(_0xcdf919){if(_0xcdf919){_0x1c9c33=_0xcdf919[_0x52b2('0x38')];if(!_0x2d26bb['query'][_0x52b2('0x3a')](_0x52b2('0x3b'))){_0x103672[_0x52b2('0x20')]=qs['limit'](_0x2d26bb[_0x52b2('0x32')][_0x52b2('0x20')]);_0x103672[_0x52b2('0x1f')]=qs[_0x52b2('0x1f')](_0x2d26bb['query']['offset']);}return _0x1c08ac[_0x52b2('0x4f')](_0x103672);}})[_0x52b2('0x28')](function(_0x103c14){if(_0x103c14){return _0x103c14?{'count':_0x1c9c33,'rows':_0x103c14}:null;}})[_0x52b2('0x28')](respondWithResult(_0xf0da9a,null))['catch'](handleError(_0xf0da9a,null));};exports['getDescriptions']=function(_0x253606,_0x475945,_0x2898ae){var _0x5f214b={};var _0x17f142={};var _0x11d24a;var _0x230f78;return db[_0x52b2('0x2d')][_0x52b2('0x50')]({'where':{'id':_0x253606[_0x52b2('0x4a')]['id']}})[_0x52b2('0x28')](handleEntityNotFound(_0x475945,null))[_0x52b2('0x28')](function(_0x33174b){if(_0x33174b){_0x11d24a=_0x33174b;_0x17f142[_0x52b2('0x36')]=_[_0x52b2('0x33')](db[_0x52b2('0x51')][_0x52b2('0x2e')]);_0x17f142[_0x52b2('0x32')]=_['keys'](_0x253606['query']);_0x17f142['filters']=_['intersection'](_0x17f142[_0x52b2('0x36')],_0x17f142['query']);_0x5f214b['attributes']=_[_0x52b2('0x35')](_0x17f142[_0x52b2('0x36')],qs[_0x52b2('0x37')](_0x253606[_0x52b2('0x32')][_0x52b2('0x37')]));_0x5f214b[_0x52b2('0x39')]=_0x5f214b['attributes'][_0x52b2('0x38')]?_0x5f214b[_0x52b2('0x39')]:_0x17f142[_0x52b2('0x36')];_0x5f214b[_0x52b2('0x3c')]=qs[_0x52b2('0x3d')](_0x253606[_0x52b2('0x32')]['sort']);_0x5f214b[_0x52b2('0x3e')]=qs[_0x52b2('0x34')](_[_0x52b2('0x3f')](_0x253606['query'],_0x17f142[_0x52b2('0x34')]));if(_0x253606[_0x52b2('0x32')][_0x52b2('0x40')]){_0x5f214b[_0x52b2('0x3e')]=_[_0x52b2('0x41')](_0x5f214b['where'],{'$or':_[_0x52b2('0x2c')](_0x5f214b[_0x52b2('0x39')],function(_0x51e97b){var _0x310fca={};_0x310fca[_0x51e97b]={'$like':'%'+_0x253606[_0x52b2('0x32')][_0x52b2('0x40')]+'%'};return _0x310fca;})});}_0x5f214b=_[_0x52b2('0x41')]({},_0x5f214b,_0x253606['options']);return _0x11d24a[_0x52b2('0x52')](_0x5f214b);}})[_0x52b2('0x28')](function(_0x39b57f){if(_0x39b57f){_0x230f78=_0x39b57f[_0x52b2('0x38')];if(!_0x253606[_0x52b2('0x32')][_0x52b2('0x3a')](_0x52b2('0x3b'))){_0x5f214b[_0x52b2('0x20')]=qs[_0x52b2('0x20')](_0x253606[_0x52b2('0x32')][_0x52b2('0x20')]);_0x5f214b['offset']=qs[_0x52b2('0x1f')](_0x253606['query'][_0x52b2('0x1f')]);}return _0x11d24a[_0x52b2('0x52')](_0x5f214b);}})['then'](function(_0x5a18e6){if(_0x5a18e6){return _0x5a18e6?{'count':_0x230f78,'rows':_0x5a18e6}:null;}})[_0x52b2('0x28')](respondWithResult(_0x475945,null))[_0x52b2('0x48')](handleError(_0x475945,null));};exports[_0x52b2('0x53')]=function(_0x1c12ba,_0x4ac53d,_0xccc969){var _0x87adef={};var _0x41a6db={};var _0x186bfd;var _0x6cdf83;return db[_0x52b2('0x2d')]['findOne']({'where':{'id':_0x1c12ba[_0x52b2('0x4a')]['id']}})[_0x52b2('0x28')](handleEntityNotFound(_0x4ac53d,null))[_0x52b2('0x28')](function(_0x56da45){if(_0x56da45){_0x186bfd=_0x56da45;_0x41a6db[_0x52b2('0x36')]=_['keys'](db[_0x52b2('0x54')][_0x52b2('0x2e')]);_0x41a6db[_0x52b2('0x32')]=_[_0x52b2('0x33')](_0x1c12ba['query']);_0x41a6db[_0x52b2('0x34')]=_[_0x52b2('0x35')](_0x41a6db[_0x52b2('0x36')],_0x41a6db[_0x52b2('0x32')]);_0x87adef[_0x52b2('0x39')]=_[_0x52b2('0x35')](_0x41a6db[_0x52b2('0x36')],qs[_0x52b2('0x37')](_0x1c12ba[_0x52b2('0x32')][_0x52b2('0x37')]));_0x87adef['attributes']=_0x87adef['attributes'][_0x52b2('0x38')]?_0x87adef[_0x52b2('0x39')]:_0x41a6db[_0x52b2('0x36')];_0x87adef[_0x52b2('0x3c')]=qs[_0x52b2('0x3d')](_0x1c12ba[_0x52b2('0x32')][_0x52b2('0x3d')]);_0x87adef[_0x52b2('0x3e')]=qs['filters'](_['pick'](_0x1c12ba['query'],_0x41a6db['filters']));if(_0x1c12ba[_0x52b2('0x32')][_0x52b2('0x40')]){_0x87adef[_0x52b2('0x3e')]=_[_0x52b2('0x41')](_0x87adef[_0x52b2('0x3e')],{'$or':_[_0x52b2('0x2c')](_0x87adef[_0x52b2('0x39')],function(_0x1608a3){var _0x4cbf58={};_0x4cbf58[_0x1608a3]={'$like':'%'+_0x1c12ba['query'][_0x52b2('0x40')]+'%'};return _0x4cbf58;})});}_0x87adef=_['merge']({},_0x87adef,_0x1c12ba[_0x52b2('0x43')]);return _0x186bfd[_0x52b2('0x53')](_0x87adef);}})[_0x52b2('0x28')](function(_0x4192f5){if(_0x4192f5){_0x6cdf83=_0x4192f5[_0x52b2('0x38')];if(!_0x1c12ba['query'][_0x52b2('0x3a')]('nolimit')){_0x87adef[_0x52b2('0x20')]=qs[_0x52b2('0x20')](_0x1c12ba['query']['limit']);_0x87adef['offset']=qs['offset'](_0x1c12ba[_0x52b2('0x32')]['offset']);}return _0x186bfd[_0x52b2('0x53')](_0x87adef);}})[_0x52b2('0x28')](function(_0x1ee8a4){if(_0x1ee8a4){return _0x1ee8a4?{'count':_0x6cdf83,'rows':_0x1ee8a4}:null;}})[_0x52b2('0x28')](respondWithResult(_0x4ac53d,null))[_0x52b2('0x48')](handleError(_0x4ac53d,null));};exports['setTags']=function(_0x2f1a99,_0x5a982e,_0x522812){if(_0x2f1a99[_0x52b2('0x4d')]['id']){delete _0x2f1a99[_0x52b2('0x4d')]['id'];}return db[_0x52b2('0x2d')][_0x52b2('0x50')]({'where':{'id':_0x2f1a99[_0x52b2('0x4a')]['id']}})[_0x52b2('0x28')](handleEntityNotFound(_0x5a982e,null))[_0x52b2('0x28')](function(_0x307c91){if(_0x307c91){return _0x307c91['setTags'](_0x2f1a99[_0x52b2('0x4d')][_0x52b2('0x55')]||[]);}return null;})['then'](respondWithResult(_0x5a982e,null))[_0x52b2('0x48')](handleError(_0x5a982e,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index 903845b..93c26ef 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 _0x871b=['define','int_desk_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intDeskConfiguration.attributes','exports'];(function(_0x408706,_0x3a9d00){var _0x35cce9=function(_0xe3b21f){while(--_0xe3b21f){_0x408706['push'](_0x408706['shift']());}};_0x35cce9(++_0x3a9d00);}(_0x871b,0x77));var _0xb871=function(_0x51c3fe,_0x56b258){_0x51c3fe=_0x51c3fe-0x0;var _0x1cf67b=_0x871b[_0x51c3fe];return _0x1cf67b;};'use strict';var _=require(_0xb871('0x0'));var util=require(_0xb871('0x1'));var logger=require(_0xb871('0x2'))(_0xb871('0x3'));var moment=require(_0xb871('0x4'));var BPromise=require(_0xb871('0x5'));var rp=require(_0xb871('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb871('0x7'));var config=require(_0xb871('0x8'));var attributes=require(_0xb871('0x9'));module[_0xb871('0xa')]=function(_0x428c0c,_0x77a713){return _0x428c0c[_0xb871('0xb')]('DeskConfiguration',attributes,{'tableName':_0xb871('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xadd8=['exports','define','DeskConfiguration','int_desk_configurations','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./intDeskConfiguration.attributes'];(function(_0x26462c,_0xd20a35){var _0x509a42=function(_0x1b22c9){while(--_0x1b22c9){_0x26462c['push'](_0x26462c['shift']());}};_0x509a42(++_0xd20a35);}(_0xadd8,0x19c));var _0x8add=function(_0x267f9a,_0xf8e165){_0x267f9a=_0x267f9a-0x0;var _0xe4ec45=_0xadd8[_0x267f9a];return _0xe4ec45;};'use strict';var _=require('lodash');var util=require(_0x8add('0x0'));var logger=require(_0x8add('0x1'))(_0x8add('0x2'));var moment=require(_0x8add('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x8add('0x4'));var rimraf=require(_0x8add('0x5'));var config=require(_0x8add('0x6'));var attributes=require(_0x8add('0x7'));module[_0x8add('0x8')]=function(_0x411631,_0x51a40f){return _0x411631[_0x8add('0x9')](_0x8add('0xa'),attributes,{'tableName':_0x8add('0xb'),'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 e76b9e1..4532a28 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 _0x1678=['stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0x3c4737,_0x2329ec){var _0x2bb926=function(_0x3b9605){while(--_0x3b9605){_0x3c4737['push'](_0x3c4737['shift']());}};_0x2bb926(++_0x2329ec);}(_0x1678,0x17b));var _0x8167=function(_0xd28266,_0x26a211){_0xd28266=_0xd28266-0x0;var _0x52559f=_0x1678[_0xd28266];return _0x52559f;};'use strict';var _=require(_0x8167('0x0'));var util=require(_0x8167('0x1'));var moment=require(_0x8167('0x2'));var BPromise=require(_0x8167('0x3'));var rs=require(_0x8167('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x8167('0x5'));var logger=require(_0x8167('0x6'))(_0x8167('0x7'));var config=require(_0x8167('0x8'));var jayson=require(_0x8167('0x9'));var client=jayson[_0x8167('0xa')][_0x8167('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4ce075,_0x34768e,_0x267746){return new BPromise(function(_0x1aab13,_0x58b220){return client['request'](_0x4ce075,_0x267746)[_0x8167('0xc')](function(_0x381a87){logger['info'](_0x8167('0xd'),_0x34768e,_0x8167('0xe'));logger[_0x8167('0xf')](_0x8167('0x10'),_0x34768e,_0x8167('0xe'),JSON[_0x8167('0x11')](_0x381a87));if(_0x381a87[_0x8167('0x12')]){if(_0x381a87['error']['code']===0x1f4){logger[_0x8167('0x12')]('DeskConfiguration,\x20%s,\x20%s',_0x34768e,_0x381a87[_0x8167('0x12')][_0x8167('0x13')]);return _0x58b220(_0x381a87[_0x8167('0x12')][_0x8167('0x13')]);}logger[_0x8167('0x12')]('DeskConfiguration,\x20%s,\x20%s',_0x34768e,_0x381a87[_0x8167('0x12')]['message']);return _0x1aab13(_0x381a87['error']['message']);}else{logger['info'](_0x8167('0xd'),_0x34768e,_0x8167('0xe'));_0x1aab13(_0x381a87[_0x8167('0x14')][_0x8167('0x13')]);}})[_0x8167('0x15')](function(_0x3927ad){logger[_0x8167('0x12')](_0x8167('0xd'),_0x34768e,_0x3927ad);_0x58b220(_0x3927ad);});});} \ No newline at end of file +var _0x6a47=['http','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x26c599,_0x32f158){var _0x55ed90=function(_0x3c071b){while(--_0x3c071b){_0x26c599['push'](_0x26c599['shift']());}};_0x55ed90(++_0x32f158);}(_0x6a47,0x84));var _0x76a4=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x6a47[_0x5d6456];return _0x4d66c1;};'use strict';var _=require(_0x76a4('0x0'));var util=require(_0x76a4('0x1'));var moment=require(_0x76a4('0x2'));var BPromise=require(_0x76a4('0x3'));var rs=require(_0x76a4('0x4'));var fs=require('fs');var Redis=require(_0x76a4('0x5'));var db=require(_0x76a4('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x76a4('0x7'))(_0x76a4('0x8'));var config=require(_0x76a4('0x9'));var jayson=require(_0x76a4('0xa'));var client=jayson[_0x76a4('0xb')][_0x76a4('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x481862,_0x1b5cf6,_0x46c86b){return new BPromise(function(_0x5a7cda,_0x3ced93){return client['request'](_0x481862,_0x46c86b)[_0x76a4('0xd')](function(_0x2475c5){logger[_0x76a4('0xe')](_0x76a4('0xf'),_0x1b5cf6,_0x76a4('0x10'));logger['debug'](_0x76a4('0x11'),_0x1b5cf6,_0x76a4('0x10'),JSON[_0x76a4('0x12')](_0x2475c5));if(_0x2475c5[_0x76a4('0x13')]){if(_0x2475c5[_0x76a4('0x13')][_0x76a4('0x14')]===0x1f4){logger[_0x76a4('0x13')](_0x76a4('0xf'),_0x1b5cf6,_0x2475c5[_0x76a4('0x13')]['message']);return _0x3ced93(_0x2475c5[_0x76a4('0x13')][_0x76a4('0x15')]);}logger[_0x76a4('0x13')](_0x76a4('0xf'),_0x1b5cf6,_0x2475c5['error'][_0x76a4('0x15')]);return _0x5a7cda(_0x2475c5[_0x76a4('0x13')][_0x76a4('0x15')]);}else{logger[_0x76a4('0xe')](_0x76a4('0xf'),_0x1b5cf6,_0x76a4('0x10'));_0x5a7cda(_0x2475c5[_0x76a4('0x16')][_0x76a4('0x15')]);}})[_0x76a4('0x17')](function(_0xa964aa){logger[_0x76a4('0x13')](_0x76a4('0xf'),_0x1b5cf6,_0xa964aa);_0x3ced93(_0xa964aa);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index 3734b7d..deea942 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 _0x25a9=['delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','index','/:id','isAuthenticated','show','post','put'];(function(_0x4bff6b,_0xf1721e){var _0x423c5b=function(_0xe2401){while(--_0xe2401){_0x4bff6b['push'](_0x4bff6b['shift']());}};_0x423c5b(++_0xf1721e);}(_0x25a9,0xf1));var _0x925a=function(_0x3f4315,_0xd6ec89){_0x3f4315=_0x3f4315-0x0;var _0x5842e3=_0x25a9[_0x3f4315];return _0x5842e3;};'use strict';var multer=require('multer');var util=require(_0x925a('0x0'));var path=require(_0x925a('0x1'));var timeout=require(_0x925a('0x2'));var express=require(_0x925a('0x3'));var router=express[_0x925a('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x925a('0x5'));var interaction=require(_0x925a('0x6'));var config=require('../../config/environment');var controller=require('./intDeskField.controller');router[_0x925a('0x7')]('/',auth['isAuthenticated'](),controller[_0x925a('0x8')]);router[_0x925a('0x7')](_0x925a('0x9'),auth[_0x925a('0xa')](),controller[_0x925a('0xb')]);router[_0x925a('0xc')]('/',auth[_0x925a('0xa')](),controller['create']);router[_0x925a('0xd')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x925a('0xe')]('/:id',auth[_0x925a('0xa')](),controller[_0x925a('0xf')]);module[_0x925a('0x10')]=router; \ No newline at end of file +var _0xf846=['../../components/interaction/service','./intDeskField.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service'];(function(_0x3a15a3,_0x258361){var _0x3ce900=function(_0x336ec8){while(--_0x336ec8){_0x3a15a3['push'](_0x3a15a3['shift']());}};_0x3ce900(++_0x258361);}(_0xf846,0x85));var _0x6f84=function(_0x49340e,_0x491492){_0x49340e=_0x49340e-0x0;var _0x434b2b=_0xf846[_0x49340e];return _0x434b2b;};'use strict';var multer=require(_0x6f84('0x0'));var util=require(_0x6f84('0x1'));var path=require(_0x6f84('0x2'));var timeout=require(_0x6f84('0x3'));var express=require('express');var router=express[_0x6f84('0x4')]();var fs_extra=require(_0x6f84('0x5'));var auth=require(_0x6f84('0x6'));var interaction=require(_0x6f84('0x7'));var config=require('../../config/environment');var controller=require(_0x6f84('0x8'));router[_0x6f84('0x9')]('/',auth[_0x6f84('0xa')](),controller[_0x6f84('0xb')]);router[_0x6f84('0x9')](_0x6f84('0xc'),auth['isAuthenticated'](),controller[_0x6f84('0xd')]);router[_0x6f84('0xe')]('/',auth[_0x6f84('0xa')](),controller['create']);router[_0x6f84('0xf')](_0x6f84('0xc'),auth['isAuthenticated'](),controller[_0x6f84('0x10')]);router[_0x6f84('0x11')](_0x6f84('0xc'),auth[_0x6f84('0xa')](),controller[_0x6f84('0x12')]);module[_0x6f84('0x13')]=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index ca4387b..624df9f 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 _0x2614=['exports','ENUM','variable','customVariable','keyValue','picklist','STRING','string','sequelize'];(function(_0xbe7b54,_0x43273a){var _0x59d96e=function(_0x20cbad){while(--_0x20cbad){_0xbe7b54['push'](_0xbe7b54['shift']());}};_0x59d96e(++_0x43273a);}(_0x2614,0x143));var _0x4261=function(_0x6a7d1f,_0x543a2f){_0x6a7d1f=_0x6a7d1f-0x0;var _0x55a840=_0x2614[_0x6a7d1f];return _0x55a840;};'use strict';var Sequelize=require(_0x4261('0x0'));module[_0x4261('0x1')]={'type':{'type':Sequelize[_0x4261('0x2')]('string',_0x4261('0x3'),_0x4261('0x4'),_0x4261('0x5'),_0x4261('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0x4261('0x7')]},'key':{'type':Sequelize[_0x4261('0x7')]},'keyType':{'type':Sequelize[_0x4261('0x2')](_0x4261('0x8'),_0x4261('0x3'),_0x4261('0x4'))},'keyContent':{'type':Sequelize[_0x4261('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x4261('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x4261('0x7')]}}; \ No newline at end of file +var _0xf7e9=['ENUM','string','variable','customVariable','STRING','BOOLEAN','sequelize'];(function(_0x18a53d,_0x522283){var _0x573236=function(_0x3abfae){while(--_0x3abfae){_0x18a53d['push'](_0x18a53d['shift']());}};_0x573236(++_0x522283);}(_0xf7e9,0x99));var _0x9f7e=function(_0x2265da,_0xfbbd2e){_0x2265da=_0x2265da-0x0;var _0x430c2b=_0xf7e9[_0x2265da];return _0x430c2b;};'use strict';var Sequelize=require(_0x9f7e('0x0'));module['exports']={'type':{'type':Sequelize[_0x9f7e('0x1')](_0x9f7e('0x2'),_0x9f7e('0x3'),_0x9f7e('0x4'),'keyValue','picklist'),'defaultValue':_0x9f7e('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x9f7e('0x5')]},'keyType':{'type':Sequelize['ENUM'](_0x9f7e('0x2'),_0x9f7e('0x3'),_0x9f7e('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x9f7e('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x9f7e('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x9f7e('0x5')]}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index 9401add..88cb282 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 _0x6003=['length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','show','params','keys','intersection','includeAll','find','create','catch','body','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','to-csv','fs-extra','crypto','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','end','status','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','DeskField','rawAttributes','type','model','query','filters','attributes','fields'];(function(_0x5b7a3f,_0x4ab8ad){var _0x164e85=function(_0x230aa4){while(--_0x230aa4){_0x5b7a3f['push'](_0x5b7a3f['shift']());}};_0x164e85(++_0x4ab8ad);}(_0x6003,0xae));var _0x3600=function(_0x28075c,_0x253aa2){_0x28075c=_0x28075c-0x0;var _0x44d99b=_0x6003[_0x28075c];return _0x44d99b;};'use strict';var emlformat=require(_0x3600('0x0'));var rimraf=require(_0x3600('0x1'));var zipdir=require(_0x3600('0x2'));var jsonpatch=require(_0x3600('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3600('0x4'));var Mustache=require(_0x3600('0x5'));var util=require(_0x3600('0x6'));var path=require('path');var sox=require(_0x3600('0x7'));var csv=require(_0x3600('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3600('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x3600('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x3600('0xb'));var toCsv=require('to-csv');var querystring=require(_0x3600('0xc'));var Papa=require(_0x3600('0xd'));var Redis=require(_0x3600('0xe'));var authService=require(_0x3600('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x3600('0x10'));var hardwareService=require(_0x3600('0x11'));var logger=require(_0x3600('0x12'))(_0x3600('0x13'));var utils=require(_0x3600('0x14'));var config=require(_0x3600('0x15'));var licenseUtil=require(_0x3600('0x16'));var db=require(_0x3600('0x17'))['db'];function respondWithStatusCode(_0x430281,_0x156265){_0x156265=_0x156265||0xcc;return function(_0x29cefd){if(_0x29cefd){return _0x430281[_0x3600('0x18')](_0x156265);}return _0x430281['status'](_0x156265)[_0x3600('0x19')]();};}function respondWithResult(_0x5704a0,_0x4faefa){_0x4faefa=_0x4faefa||0xc8;return function(_0x298f6d){if(_0x298f6d){return _0x5704a0[_0x3600('0x1a')](_0x4faefa)[_0x3600('0x1b')](_0x298f6d);}};}function respondWithFilteredResult(_0x4d40a1,_0xe9eb7c){return function(_0x486fbb){if(_0x486fbb){var _0x10bdd3=typeof _0xe9eb7c['offset']===_0x3600('0x1c')&&typeof _0xe9eb7c[_0x3600('0x1d')]===_0x3600('0x1c');var _0x533e79=_0x486fbb['count'];var _0x680b80=_0x10bdd3?0x0:_0xe9eb7c[_0x3600('0x1e')];var _0xcb98b5=_0x10bdd3?_0x486fbb[_0x3600('0x1f')]:_0xe9eb7c['offset']+_0xe9eb7c[_0x3600('0x1d')];var _0x4be7e2;if(_0xcb98b5>=_0x533e79){_0xcb98b5=_0x533e79;_0x4be7e2=0xc8;}else{_0x4be7e2=0xce;}_0x4d40a1[_0x3600('0x1a')](_0x4be7e2);return _0x4d40a1[_0x3600('0x20')](_0x3600('0x21'),_0x680b80+'-'+_0xcb98b5+'/'+_0x533e79)['json'](_0x486fbb);}return null;};}function patchUpdates(_0x8390c1){return function(_0x47a48e){try{jsonpatch[_0x3600('0x22')](_0x47a48e,_0x8390c1,!![]);}catch(_0x1414c6){return BPromise[_0x3600('0x23')](_0x1414c6);}return _0x47a48e[_0x3600('0x24')]();};}function saveUpdates(_0x29edc6,_0x47d58c){return function(_0x7e30a0){if(_0x7e30a0){return _0x7e30a0[_0x3600('0x25')](_0x29edc6)[_0x3600('0x26')](function(_0x708430){return _0x708430;});}return null;};}function removeEntity(_0x782224,_0x148155){return function(_0x1e5492){if(_0x1e5492){return _0x1e5492[_0x3600('0x27')]()[_0x3600('0x26')](function(){_0x782224[_0x3600('0x1a')](0xcc)[_0x3600('0x19')]();});}};}function handleEntityNotFound(_0x51bdb8,_0x2ad736){return function(_0x50a222){if(!_0x50a222){_0x51bdb8[_0x3600('0x18')](0x194);}return _0x50a222;};}function handleError(_0x532fe7,_0x35d6f3){_0x35d6f3=_0x35d6f3||0x1f4;return function(_0x1c6b74){logger[_0x3600('0x28')](_0x1c6b74[_0x3600('0x29')]);if(_0x1c6b74[_0x3600('0x2a')]){delete _0x1c6b74[_0x3600('0x2a')];}_0x532fe7['status'](_0x35d6f3)[_0x3600('0x2b')](_0x1c6b74);};}exports[_0x3600('0x2c')]=function(_0x5580b9,_0x3bfd60){var _0x8fc4c6={},_0x2854cd={},_0x861d1={'count':0x0,'rows':[]};var _0x3e3ce0=_[_0x3600('0x2d')](db[_0x3600('0x2e')][_0x3600('0x2f')],function(_0x516005){return{'name':_0x516005['fieldName'],'type':_0x516005[_0x3600('0x30')]['key']};});_0x2854cd[_0x3600('0x31')]=_[_0x3600('0x2d')](_0x3e3ce0,_0x3600('0x2a'));_0x2854cd['query']=_['keys'](_0x5580b9[_0x3600('0x32')]);_0x2854cd[_0x3600('0x33')]=_['intersection'](_0x2854cd[_0x3600('0x31')],_0x2854cd[_0x3600('0x32')]);_0x8fc4c6[_0x3600('0x34')]=_['intersection'](_0x2854cd[_0x3600('0x31')],qs[_0x3600('0x35')](_0x5580b9[_0x3600('0x32')][_0x3600('0x35')]));_0x8fc4c6[_0x3600('0x34')]=_0x8fc4c6[_0x3600('0x34')][_0x3600('0x36')]?_0x8fc4c6[_0x3600('0x34')]:_0x2854cd[_0x3600('0x31')];if(!_0x5580b9[_0x3600('0x32')][_0x3600('0x37')](_0x3600('0x38'))){_0x8fc4c6[_0x3600('0x1d')]=qs['limit'](_0x5580b9[_0x3600('0x32')]['limit']);_0x8fc4c6[_0x3600('0x1e')]=qs['offset'](_0x5580b9[_0x3600('0x32')]['offset']);}_0x8fc4c6[_0x3600('0x39')]=qs[_0x3600('0x3a')](_0x5580b9[_0x3600('0x32')][_0x3600('0x3a')]);_0x8fc4c6[_0x3600('0x3b')]=qs[_0x3600('0x33')](_[_0x3600('0x3c')](_0x5580b9[_0x3600('0x32')],_0x2854cd['filters']),_0x3e3ce0);if(_0x5580b9['query'][_0x3600('0x3d')]){_0x8fc4c6[_0x3600('0x3b')]=_[_0x3600('0x3e')](_0x8fc4c6['where'],{'$or':_[_0x3600('0x2d')](_0x3e3ce0,function(_0x511595){if(_0x511595[_0x3600('0x30')]!==_0x3600('0x3f')){var _0x4bd2be={};_0x4bd2be[_0x511595[_0x3600('0x2a')]]={'$like':'%'+_0x5580b9[_0x3600('0x32')][_0x3600('0x3d')]+'%'};return _0x4bd2be;}})});}_0x8fc4c6=_[_0x3600('0x3e')]({},_0x8fc4c6,_0x5580b9[_0x3600('0x40')]);var _0x3bd1e4={'where':_0x8fc4c6['where']};return db['DeskField'][_0x3600('0x1f')](_0x3bd1e4)[_0x3600('0x26')](function(_0x538d3c){_0x861d1['count']=_0x538d3c;if(_0x5580b9[_0x3600('0x32')]['includeAll']){_0x8fc4c6[_0x3600('0x41')]=[{'all':!![]}];}return db[_0x3600('0x2e')][_0x3600('0x42')](_0x8fc4c6);})[_0x3600('0x26')](function(_0x279fe5){_0x861d1['rows']=_0x279fe5;return _0x861d1;})['then'](respondWithFilteredResult(_0x3bfd60,_0x8fc4c6))['catch'](handleError(_0x3bfd60,null));};exports[_0x3600('0x43')]=function(_0x5a6365,_0x48c02b){var _0x289b76={'raw':!![],'where':{'id':_0x5a6365[_0x3600('0x44')]['id']}},_0x1040a4={};_0x1040a4[_0x3600('0x31')]=_[_0x3600('0x45')](db['DeskField'][_0x3600('0x2f')]);_0x1040a4[_0x3600('0x32')]=_[_0x3600('0x45')](_0x5a6365[_0x3600('0x32')]);_0x1040a4[_0x3600('0x33')]=_[_0x3600('0x46')](_0x1040a4[_0x3600('0x31')],_0x1040a4[_0x3600('0x32')]);_0x289b76[_0x3600('0x34')]=_[_0x3600('0x46')](_0x1040a4[_0x3600('0x31')],qs[_0x3600('0x35')](_0x5a6365[_0x3600('0x32')][_0x3600('0x35')]));_0x289b76['attributes']=_0x289b76[_0x3600('0x34')][_0x3600('0x36')]?_0x289b76['attributes']:_0x1040a4[_0x3600('0x31')];if(_0x5a6365['query'][_0x3600('0x47')]){_0x289b76[_0x3600('0x41')]=[{'all':!![]}];}_0x289b76=_[_0x3600('0x3e')]({},_0x289b76,_0x5a6365['options']);return db[_0x3600('0x2e')][_0x3600('0x48')](_0x289b76)[_0x3600('0x26')](handleEntityNotFound(_0x48c02b,null))[_0x3600('0x26')](respondWithResult(_0x48c02b,null))['catch'](handleError(_0x48c02b,null));};exports[_0x3600('0x49')]=function(_0x5a877c,_0x52ebf4){return db['DeskField'][_0x3600('0x49')](_0x5a877c['body'],{})[_0x3600('0x26')](respondWithResult(_0x52ebf4,0xc9))[_0x3600('0x4a')](handleError(_0x52ebf4,null));};exports['update']=function(_0x40c5a4,_0x2b1946){if(_0x40c5a4[_0x3600('0x4b')]['id']){delete _0x40c5a4[_0x3600('0x4b')]['id'];}return db['DeskField'][_0x3600('0x48')]({'where':{'id':_0x40c5a4[_0x3600('0x44')]['id']}})[_0x3600('0x26')](handleEntityNotFound(_0x2b1946,null))[_0x3600('0x26')](saveUpdates(_0x40c5a4[_0x3600('0x4b')],null))[_0x3600('0x26')](respondWithResult(_0x2b1946,null))[_0x3600('0x4a')](handleError(_0x2b1946,null));};exports['destroy']=function(_0xbf015a,_0x2f09d9){return db['DeskField'][_0x3600('0x48')]({'where':{'id':_0xbf015a[_0x3600('0x44')]['id']}})[_0x3600('0x26')](handleEntityNotFound(_0x2f09d9,null))[_0x3600('0x26')](removeEntity(_0x2f09d9,null))[_0x3600('0x4a')](handleError(_0x2f09d9,null));}; \ No newline at end of file +var _0xf70f=['length','body','destroy','find','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','end','status','json','offset','limit','undefined','count','set','Content-Range','apply','update','then','sendStatus','error','stack','name','send','index','map','DeskField','rawAttributes','fieldName','type','key','keys','query','filters','model','attributes','intersection','fields','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params'];(function(_0x131b72,_0x567c99){var _0x1751ea=function(_0x43f358){while(--_0x43f358){_0x131b72['push'](_0x131b72['shift']());}};_0x1751ea(++_0x567c99);}(_0xf70f,0x9c));var _0xff70=function(_0x17eba5,_0x434f32){_0x17eba5=_0x17eba5-0x0;var _0x1aa6f1=_0xf70f[_0x17eba5];return _0x1aa6f1;};'use strict';var emlformat=require(_0xff70('0x0'));var rimraf=require(_0xff70('0x1'));var zipdir=require(_0xff70('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xff70('0x3'));var moment=require(_0xff70('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xff70('0x5'));var util=require(_0xff70('0x6'));var path=require(_0xff70('0x7'));var sox=require(_0xff70('0x8'));var csv=require(_0xff70('0x9'));var ejs=require(_0xff70('0xa'));var fs=require('fs');var fs_extra=require(_0xff70('0xb'));var _=require('lodash');var squel=require(_0xff70('0xc'));var crypto=require(_0xff70('0xd'));var jsforce=require(_0xff70('0xe'));var deskjs=require(_0xff70('0xf'));var toCsv=require(_0xff70('0x9'));var querystring=require('querystring');var Papa=require(_0xff70('0x10'));var Redis=require(_0xff70('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xff70('0x12'));var as=require(_0xff70('0x13'));var hardwareService=require(_0xff70('0x14'));var logger=require(_0xff70('0x15'))(_0xff70('0x16'));var utils=require(_0xff70('0x17'));var config=require(_0xff70('0x18'));var licenseUtil=require(_0xff70('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xb32668,_0x5e4651){_0x5e4651=_0x5e4651||0xcc;return function(_0x415c80){if(_0x415c80){return _0xb32668['sendStatus'](_0x5e4651);}return _0xb32668['status'](_0x5e4651)[_0xff70('0x1a')]();};}function respondWithResult(_0x93dd6d,_0x49e3d9){_0x49e3d9=_0x49e3d9||0xc8;return function(_0x5e1e6b){if(_0x5e1e6b){return _0x93dd6d[_0xff70('0x1b')](_0x49e3d9)[_0xff70('0x1c')](_0x5e1e6b);}};}function respondWithFilteredResult(_0x4d2a73,_0x59a31d){return function(_0x1a97bb){if(_0x1a97bb){var _0x90ca33=typeof _0x59a31d[_0xff70('0x1d')]==='undefined'&&typeof _0x59a31d[_0xff70('0x1e')]===_0xff70('0x1f');var _0x10a707=_0x1a97bb[_0xff70('0x20')];var _0x5f0c5a=_0x90ca33?0x0:_0x59a31d[_0xff70('0x1d')];var _0xe164b9=_0x90ca33?_0x1a97bb[_0xff70('0x20')]:_0x59a31d[_0xff70('0x1d')]+_0x59a31d[_0xff70('0x1e')];var _0x4330bd;if(_0xe164b9>=_0x10a707){_0xe164b9=_0x10a707;_0x4330bd=0xc8;}else{_0x4330bd=0xce;}_0x4d2a73[_0xff70('0x1b')](_0x4330bd);return _0x4d2a73[_0xff70('0x21')](_0xff70('0x22'),_0x5f0c5a+'-'+_0xe164b9+'/'+_0x10a707)[_0xff70('0x1c')](_0x1a97bb);}return null;};}function patchUpdates(_0x138013){return function(_0x19af3b){try{jsonpatch[_0xff70('0x23')](_0x19af3b,_0x138013,!![]);}catch(_0x192aab){return BPromise['reject'](_0x192aab);}return _0x19af3b['save']();};}function saveUpdates(_0x448a82,_0x302064){return function(_0x2fbe7f){if(_0x2fbe7f){return _0x2fbe7f[_0xff70('0x24')](_0x448a82)[_0xff70('0x25')](function(_0x123aae){return _0x123aae;});}return null;};}function removeEntity(_0x1214cc,_0x1237e4){return function(_0x4347c7){if(_0x4347c7){return _0x4347c7['destroy']()['then'](function(){_0x1214cc[_0xff70('0x1b')](0xcc)[_0xff70('0x1a')]();});}};}function handleEntityNotFound(_0x572b7a,_0x49f58d){return function(_0x131a7a){if(!_0x131a7a){_0x572b7a[_0xff70('0x26')](0x194);}return _0x131a7a;};}function handleError(_0x4af324,_0x97028f){_0x97028f=_0x97028f||0x1f4;return function(_0x575378){logger[_0xff70('0x27')](_0x575378[_0xff70('0x28')]);if(_0x575378[_0xff70('0x29')]){delete _0x575378[_0xff70('0x29')];}_0x4af324[_0xff70('0x1b')](_0x97028f)[_0xff70('0x2a')](_0x575378);};}exports[_0xff70('0x2b')]=function(_0x57e17f,_0x4121b6){var _0x2809ad={},_0x26b80a={},_0x4ae2af={'count':0x0,'rows':[]};var _0x2d8d0c=_[_0xff70('0x2c')](db[_0xff70('0x2d')][_0xff70('0x2e')],function(_0x3a3251){return{'name':_0x3a3251[_0xff70('0x2f')],'type':_0x3a3251[_0xff70('0x30')][_0xff70('0x31')]};});_0x26b80a['model']=_['map'](_0x2d8d0c,_0xff70('0x29'));_0x26b80a['query']=_[_0xff70('0x32')](_0x57e17f[_0xff70('0x33')]);_0x26b80a[_0xff70('0x34')]=_['intersection'](_0x26b80a[_0xff70('0x35')],_0x26b80a[_0xff70('0x33')]);_0x2809ad[_0xff70('0x36')]=_[_0xff70('0x37')](_0x26b80a[_0xff70('0x35')],qs['fields'](_0x57e17f['query'][_0xff70('0x38')]));_0x2809ad['attributes']=_0x2809ad['attributes']['length']?_0x2809ad['attributes']:_0x26b80a[_0xff70('0x35')];if(!_0x57e17f['query']['hasOwnProperty']('nolimit')){_0x2809ad[_0xff70('0x1e')]=qs[_0xff70('0x1e')](_0x57e17f[_0xff70('0x33')][_0xff70('0x1e')]);_0x2809ad[_0xff70('0x1d')]=qs[_0xff70('0x1d')](_0x57e17f[_0xff70('0x33')][_0xff70('0x1d')]);}_0x2809ad[_0xff70('0x39')]=qs[_0xff70('0x3a')](_0x57e17f[_0xff70('0x33')]['sort']);_0x2809ad[_0xff70('0x3b')]=qs[_0xff70('0x34')](_[_0xff70('0x3c')](_0x57e17f['query'],_0x26b80a[_0xff70('0x34')]),_0x2d8d0c);if(_0x57e17f[_0xff70('0x33')][_0xff70('0x3d')]){_0x2809ad['where']=_[_0xff70('0x3e')](_0x2809ad['where'],{'$or':_[_0xff70('0x2c')](_0x2d8d0c,function(_0x261f94){if(_0x261f94[_0xff70('0x30')]!==_0xff70('0x3f')){var _0x59deeb={};_0x59deeb[_0x261f94[_0xff70('0x29')]]={'$like':'%'+_0x57e17f[_0xff70('0x33')][_0xff70('0x3d')]+'%'};return _0x59deeb;}})});}_0x2809ad=_[_0xff70('0x3e')]({},_0x2809ad,_0x57e17f[_0xff70('0x40')]);var _0x4b676c={'where':_0x2809ad['where']};return db[_0xff70('0x2d')][_0xff70('0x20')](_0x4b676c)[_0xff70('0x25')](function(_0x3dbefa){_0x4ae2af[_0xff70('0x20')]=_0x3dbefa;if(_0x57e17f[_0xff70('0x33')][_0xff70('0x41')]){_0x2809ad[_0xff70('0x42')]=[{'all':!![]}];}return db[_0xff70('0x2d')][_0xff70('0x43')](_0x2809ad);})[_0xff70('0x25')](function(_0x3ce10b){_0x4ae2af[_0xff70('0x44')]=_0x3ce10b;return _0x4ae2af;})[_0xff70('0x25')](respondWithFilteredResult(_0x4121b6,_0x2809ad))[_0xff70('0x45')](handleError(_0x4121b6,null));};exports[_0xff70('0x46')]=function(_0x3abf53,_0x36e6d7){var _0x264f4b={'raw':!![],'where':{'id':_0x3abf53[_0xff70('0x47')]['id']}},_0x3ddf19={};_0x3ddf19['model']=_['keys'](db[_0xff70('0x2d')]['rawAttributes']);_0x3ddf19[_0xff70('0x33')]=_[_0xff70('0x32')](_0x3abf53[_0xff70('0x33')]);_0x3ddf19['filters']=_[_0xff70('0x37')](_0x3ddf19[_0xff70('0x35')],_0x3ddf19[_0xff70('0x33')]);_0x264f4b[_0xff70('0x36')]=_[_0xff70('0x37')](_0x3ddf19[_0xff70('0x35')],qs[_0xff70('0x38')](_0x3abf53[_0xff70('0x33')][_0xff70('0x38')]));_0x264f4b[_0xff70('0x36')]=_0x264f4b[_0xff70('0x36')][_0xff70('0x48')]?_0x264f4b[_0xff70('0x36')]:_0x3ddf19['model'];if(_0x3abf53[_0xff70('0x33')][_0xff70('0x41')]){_0x264f4b[_0xff70('0x42')]=[{'all':!![]}];}_0x264f4b=_[_0xff70('0x3e')]({},_0x264f4b,_0x3abf53['options']);return db['DeskField']['find'](_0x264f4b)[_0xff70('0x25')](handleEntityNotFound(_0x36e6d7,null))[_0xff70('0x25')](respondWithResult(_0x36e6d7,null))[_0xff70('0x45')](handleError(_0x36e6d7,null));};exports['create']=function(_0x4d472b,_0x2ed209){return db['DeskField']['create'](_0x4d472b['body'],{})['then'](respondWithResult(_0x2ed209,0xc9))[_0xff70('0x45')](handleError(_0x2ed209,null));};exports[_0xff70('0x24')]=function(_0x1b0359,_0x1a0738){if(_0x1b0359[_0xff70('0x49')]['id']){delete _0x1b0359[_0xff70('0x49')]['id'];}return db[_0xff70('0x2d')]['find']({'where':{'id':_0x1b0359[_0xff70('0x47')]['id']}})['then'](handleEntityNotFound(_0x1a0738,null))[_0xff70('0x25')](saveUpdates(_0x1b0359[_0xff70('0x49')],null))[_0xff70('0x25')](respondWithResult(_0x1a0738,null))['catch'](handleError(_0x1a0738,null));};exports[_0xff70('0x4a')]=function(_0x2770db,_0x39040b){return db[_0xff70('0x2d')][_0xff70('0x4b')]({'where':{'id':_0x2770db[_0xff70('0x47')]['id']}})['then'](handleEntityNotFound(_0x39040b,null))[_0xff70('0x25')](removeEntity(_0x39040b,null))[_0xff70('0x45')](handleError(_0x39040b,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index fec9235..f61d610 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 _0x2145=['int_desk_fields','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','path','./intDeskField.attributes','exports','define'];(function(_0x34f701,_0x37e407){var _0x3e2429=function(_0x20c0c3){while(--_0x20c0c3){_0x34f701['push'](_0x34f701['shift']());}};_0x3e2429(++_0x37e407);}(_0x2145,0x85));var _0x5214=function(_0x18f1e6,_0x429411){_0x18f1e6=_0x18f1e6-0x0;var _0x5bd88e=_0x2145[_0x18f1e6];return _0x5bd88e;};'use strict';var _=require(_0x5214('0x0'));var util=require(_0x5214('0x1'));var logger=require(_0x5214('0x2'))(_0x5214('0x3'));var moment=require(_0x5214('0x4'));var BPromise=require(_0x5214('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5214('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x5214('0x7'));module[_0x5214('0x8')]=function(_0x4ab128,_0x16352e){return _0x4ab128[_0x5214('0x9')]('DeskField',attributes,{'tableName':_0x5214('0xa'),'paranoid':![],'indexes':[{'name':'desk_unique_index','fields':[_0x5214('0xb'),_0x5214('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6ce6=['define','DeskField','idField','FieldId','lodash','moment','request-promise','rimraf','../../config/environment','./intDeskField.attributes'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x6ce6,0x1ee));var _0x66ce=function(_0x524d35,_0x4ab58a){_0x524d35=_0x524d35-0x0;var _0xe526ba=_0x6ce6[_0x524d35];return _0xe526ba;};'use strict';var _=require(_0x66ce('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x66ce('0x1'));var BPromise=require('bluebird');var rp=require(_0x66ce('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x66ce('0x3'));var config=require(_0x66ce('0x4'));var attributes=require(_0x66ce('0x5'));module['exports']=function(_0x32b91a,_0x4f226a){return _0x32b91a[_0x66ce('0x6')](_0x66ce('0x7'),attributes,{'tableName':'int_desk_fields','paranoid':![],'indexes':[{'name':'desk_unique_index','fields':[_0x66ce('0x8'),_0x66ce('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 24f8ddd..fdda515 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 _0xfd9b=['request\x20sent','stringify','error','message','result','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','request','info','DeskField,\x20%s,\x20%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfd9b,0x8d));var _0xbfd9=function(_0x78693d,_0x5a6c05){_0x78693d=_0x78693d-0x0;var _0x17b6fd=_0xfd9b[_0x78693d];return _0x17b6fd;};'use strict';var _=require('lodash');var util=require(_0xbfd9('0x0'));var moment=require(_0xbfd9('0x1'));var BPromise=require('bluebird');var rs=require(_0xbfd9('0x2'));var fs=require('fs');var Redis=require(_0xbfd9('0x3'));var db=require(_0xbfd9('0x4'))['db'];var utils=require(_0xbfd9('0x5'));var logger=require('../../config/logger')(_0xbfd9('0x6'));var config=require(_0xbfd9('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xbfd9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x371c02,_0x41207e,_0x46d048){return new BPromise(function(_0x18a9b7,_0x318e05){return client[_0xbfd9('0x9')](_0x371c02,_0x46d048)['then'](function(_0x2923bd){logger[_0xbfd9('0xa')](_0xbfd9('0xb'),_0x41207e,_0xbfd9('0xc'));logger['debug']('DeskField,\x20%s,\x20%s,\x20%s',_0x41207e,_0xbfd9('0xc'),JSON[_0xbfd9('0xd')](_0x2923bd));if(_0x2923bd['error']){if(_0x2923bd[_0xbfd9('0xe')]['code']===0x1f4){logger[_0xbfd9('0xe')](_0xbfd9('0xb'),_0x41207e,_0x2923bd['error'][_0xbfd9('0xf')]);return _0x318e05(_0x2923bd[_0xbfd9('0xe')][_0xbfd9('0xf')]);}logger[_0xbfd9('0xe')]('DeskField,\x20%s,\x20%s',_0x41207e,_0x2923bd[_0xbfd9('0xe')][_0xbfd9('0xf')]);return _0x18a9b7(_0x2923bd['error']['message']);}else{logger[_0xbfd9('0xa')](_0xbfd9('0xb'),_0x41207e,_0xbfd9('0xc'));_0x18a9b7(_0x2923bd[_0xbfd9('0x10')]['message']);}})['catch'](function(_0x195456){logger[_0xbfd9('0xe')](_0xbfd9('0xb'),_0x41207e,_0x195456);_0x318e05(_0x195456);});});} \ No newline at end of file +var _0x5bb5=['request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','DeskField,\x20%s,\x20%s'];(function(_0x304e8b,_0x2f3686){var _0xc69db0=function(_0x394c30){while(--_0x394c30){_0x304e8b['push'](_0x304e8b['shift']());}};_0xc69db0(++_0x2f3686);}(_0x5bb5,0x1d6));var _0x55bb=function(_0xb82f1b,_0x412bde){_0xb82f1b=_0xb82f1b-0x0;var _0x35cdbf=_0x5bb5[_0xb82f1b];return _0x35cdbf;};'use strict';var _=require('lodash');var util=require(_0x55bb('0x0'));var moment=require('moment');var BPromise=require(_0x55bb('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x55bb('0x2'));var db=require(_0x55bb('0x3'))['db'];var utils=require(_0x55bb('0x4'));var logger=require('../../config/logger')(_0x55bb('0x5'));var config=require(_0x55bb('0x6'));var jayson=require(_0x55bb('0x7'));var client=jayson[_0x55bb('0x8')][_0x55bb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3e0416,_0x2fd94a,_0x5d58d4){return new BPromise(function(_0x267438,_0x38bf3e){return client['request'](_0x3e0416,_0x5d58d4)[_0x55bb('0xa')](function(_0x2be25c){logger[_0x55bb('0xb')](_0x55bb('0xc'),_0x2fd94a,_0x55bb('0xd'));logger[_0x55bb('0xe')](_0x55bb('0xf'),_0x2fd94a,_0x55bb('0xd'),JSON['stringify'](_0x2be25c));if(_0x2be25c[_0x55bb('0x10')]){if(_0x2be25c[_0x55bb('0x10')][_0x55bb('0x11')]===0x1f4){logger[_0x55bb('0x10')]('DeskField,\x20%s,\x20%s',_0x2fd94a,_0x2be25c[_0x55bb('0x10')][_0x55bb('0x12')]);return _0x38bf3e(_0x2be25c[_0x55bb('0x10')][_0x55bb('0x12')]);}logger['error'](_0x55bb('0xc'),_0x2fd94a,_0x2be25c[_0x55bb('0x10')][_0x55bb('0x12')]);return _0x267438(_0x2be25c['error']['message']);}else{logger[_0x55bb('0xb')](_0x55bb('0xc'),_0x2fd94a,_0x55bb('0xd'));_0x267438(_0x2be25c[_0x55bb('0x13')][_0x55bb('0x12')]);}})[_0x55bb('0x14')](function(_0x5e3cf7){logger[_0x55bb('0x10')](_0x55bb('0xc'),_0x2fd94a,_0x5e3cf7);_0x38bf3e(_0x5e3cf7);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index dc46a2a..448eb32 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 _0xaa54=['index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','delete','destroy','exports','path','connect-timeout','fs-extra','../../components/auth/service','../../config/environment','./intDynamics365Account.controller','get','isAuthenticated'];(function(_0x12c6f2,_0x5cefbf){var _0x9d6b8d=function(_0x43a910){while(--_0x43a910){_0x12c6f2['push'](_0x12c6f2['shift']());}};_0x9d6b8d(++_0x5cefbf);}(_0xaa54,0x7d));var _0x4aa5=function(_0x178e48,_0x3c9509){_0x178e48=_0x178e48-0x0;var _0x440d7e=_0xaa54[_0x178e48];return _0x440d7e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4aa5('0x0'));var timeout=require(_0x4aa5('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x4aa5('0x2'));var auth=require(_0x4aa5('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x4aa5('0x4'));var controller=require(_0x4aa5('0x5'));router[_0x4aa5('0x6')]('/',auth[_0x4aa5('0x7')](),controller[_0x4aa5('0x8')]);router['get'](_0x4aa5('0x9'),auth[_0x4aa5('0x7')](),controller[_0x4aa5('0xa')]);router[_0x4aa5('0x6')](_0x4aa5('0xb'),auth[_0x4aa5('0x7')](),controller[_0x4aa5('0xc')]);router[_0x4aa5('0x6')](_0x4aa5('0xd'),auth[_0x4aa5('0x7')](),controller[_0x4aa5('0xe')]);router['post']('/',auth[_0x4aa5('0x7')](),controller['create']);router[_0x4aa5('0xf')](_0x4aa5('0xb'),auth[_0x4aa5('0x7')](),controller['addConfiguration']);router['put'](_0x4aa5('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x4aa5('0x10')](_0x4aa5('0x9'),auth[_0x4aa5('0x7')](),controller[_0x4aa5('0x11')]);module[_0x4aa5('0x12')]=router; \ No newline at end of file +var _0x5fc9=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','getFields','post','create'];(function(_0x4521e3,_0x10a8a4){var _0x46a272=function(_0x2f4c64){while(--_0x2f4c64){_0x4521e3['push'](_0x4521e3['shift']());}};_0x46a272(++_0x10a8a4);}(_0x5fc9,0x190));var _0x95fc=function(_0x789409,_0x57d06f){_0x789409=_0x789409-0x0;var _0x5648fc=_0x5fc9[_0x789409];return _0x5648fc;};'use strict';var multer=require(_0x95fc('0x0'));var util=require(_0x95fc('0x1'));var path=require(_0x95fc('0x2'));var timeout=require(_0x95fc('0x3'));var express=require(_0x95fc('0x4'));var router=express[_0x95fc('0x5')]();var fs_extra=require(_0x95fc('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x95fc('0x7'));var controller=require('./intDynamics365Account.controller');router[_0x95fc('0x8')]('/',auth[_0x95fc('0x9')](),controller[_0x95fc('0xa')]);router[_0x95fc('0x8')](_0x95fc('0xb'),auth[_0x95fc('0x9')](),controller[_0x95fc('0xc')]);router[_0x95fc('0x8')](_0x95fc('0xd'),auth['isAuthenticated'](),controller[_0x95fc('0xe')]);router[_0x95fc('0x8')]('/:id/fields',auth[_0x95fc('0x9')](),controller[_0x95fc('0xf')]);router[_0x95fc('0x10')]('/',auth[_0x95fc('0x9')](),controller[_0x95fc('0x11')]);router[_0x95fc('0x10')](_0x95fc('0xd'),auth[_0x95fc('0x9')](),controller['addConfiguration']);router['put'](_0x95fc('0xb'),auth[_0x95fc('0x9')](),controller[_0x95fc('0x12')]);router[_0x95fc('0x13')](_0x95fc('0xb'),auth[_0x95fc('0x9')](),controller[_0x95fc('0x14')]);module[_0x95fc('0x15')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index 08527b7..6b653bd 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 _0x9b6b=['STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9b6b,0xe5));var _0xb9b6=function(_0x5eddd5,_0x29091f){_0x5eddd5=_0x5eddd5-0x0;var _0x1fc10e=_0x9b6b[_0x5eddd5];return _0x1fc10e;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xb9b6('0x0')]},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xb9b6('0x0')]},'tenantId':{'type':Sequelize[_0xb9b6('0x0')]},'clientId':{'type':Sequelize[_0xb9b6('0x0')]},'clientSecret':{'type':Sequelize[_0xb9b6('0x0')]},'serverUrl':{'type':Sequelize[_0xb9b6('0x0')],'allowNull':![]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x7471=['STRING','sequelize'];(function(_0x1dc31b,_0x3b6f80){var _0x2ddb8f=function(_0x323487){while(--_0x323487){_0x1dc31b['push'](_0x1dc31b['shift']());}};_0x2ddb8f(++_0x3b6f80);}(_0x7471,0x137));var _0x1747=function(_0x33c32d,_0x27254f){_0x33c32d=_0x33c32d-0x0;var _0x31c346=_0x7471[_0x33c32d];return _0x31c346;};'use strict';var Sequelize=require(_0x1747('0x0'));module['exports']={'name':{'type':Sequelize[_0x1747('0x1')]},'username':{'type':Sequelize[_0x1747('0x1')]},'password':{'type':Sequelize[_0x1747('0x1')]},'remoteUri':{'type':Sequelize[_0x1747('0x1')]},'tenantId':{'type':Sequelize[_0x1747('0x1')]},'clientId':{'type':Sequelize[_0x1747('0x1')]},'clientSecret':{'type':Sequelize[_0x1747('0x1')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index 77d6660..36a0280 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 _0x6dfa=['pick','addConfiguration','AccountId','getSubjects','channel','Descriptions','Subjects','ticketType','Incident','PhoneCall','caseorigincode','phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','actualserviceunits','billedserviceunits','contactidname','contractdetailidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridtype','customeridyominame','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','kbarticleidname','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_iotalertname','numberofchildincidents','onholdtime','owneridname','owneridtype','owneridyominame','parentcaseidname','primarycontactidname','primarycontactidyominame','prioritycodename','productidname','productserialnumber','resolvebykpiidname','responseby','responsiblecontactidname','sentimentvalue','slainvokedidname','slaname','socialprofileidname','statecode','statuscode','subjectidname','ticketnumber','transactioncurrencyidname','utcconversiontimezonecode','versionnumber','concat','username','password','tenantId','clientId','clientSecret','slice','substring','lastIndexOf','format','%s/api/data/v9.0/','https://login.microsoftonline.com/','/oauth2/token','access_token','Bearer\x20','4.0','value','MetadataId','GET','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','remove','LogicalName','forEach','@odata.type','PicklistAttributeMetadata','BooleanAttributeMetadata','push','StringAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','all','test','statusCode','stack','Wrong\x20credentials','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Label','UserLocalizedLabel','Value','DisplayName',')/Attributes(',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','TrueOption','true',')/Microsoft.Dynamics.CRM.','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../components/integrations/configuration','sendStatus','status','offset','limit','undefined','count','Content-Range','json','apply','reject','save','update','destroy','then','error','name','send','index','map','rawAttributes','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','filter','merge','options','Dynamics365Account','include','findAll','rows','catch','show','params','find','create','body','getConfigurations','findOne','Dynamics365Configuration','order'];(function(_0x51dda5,_0x69168e){var _0x4b42d4=function(_0x18c55d){while(--_0x18c55d){_0x51dda5['push'](_0x51dda5['shift']());}};_0x4b42d4(++_0x69168e);}(_0x6dfa,0x7b));var _0xa6df=function(_0x44dc35,_0x2e5d1b){_0x44dc35=_0x44dc35-0x0;var _0x3c6729=_0x6dfa[_0x44dc35];return _0x3c6729;};'use strict';var emlformat=require(_0xa6df('0x0'));var rimraf=require(_0xa6df('0x1'));var zipdir=require(_0xa6df('0x2'));var jsonpatch=require(_0xa6df('0x3'));var rp=require(_0xa6df('0x4'));var moment=require('moment');var BPromise=require(_0xa6df('0x5'));var Mustache=require('mustache');var util=require(_0xa6df('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xa6df('0x7'));var ejs=require(_0xa6df('0x8'));var fs=require('fs');var fs_extra=require(_0xa6df('0x9'));var _=require(_0xa6df('0xa'));var squel=require(_0xa6df('0xb'));var crypto=require(_0xa6df('0xc'));var jsforce=require(_0xa6df('0xd'));var deskjs=require(_0xa6df('0xe'));var toCsv=require(_0xa6df('0x7'));var querystring=require(_0xa6df('0xf'));var Papa=require('papaparse');var Redis=require(_0xa6df('0x10'));var authService=require(_0xa6df('0x11'));var qs=require(_0xa6df('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa6df('0x13'));var logger=require('../../config/logger')(_0xa6df('0x14'));var utils=require(_0xa6df('0x15'));var config=require(_0xa6df('0x16'));var licenseUtil=require(_0xa6df('0x17'));var db=require('../../mysqldb')['db'];var integrations=require(_0xa6df('0x18'));function respondWithStatusCode(_0x500e77,_0x1540f1){_0x1540f1=_0x1540f1||0xcc;return function(_0x18e6d3){if(_0x18e6d3){return _0x500e77[_0xa6df('0x19')](_0x1540f1);}return _0x500e77[_0xa6df('0x1a')](_0x1540f1)['end']();};}function respondWithResult(_0x1e536d,_0x5bbd9e){_0x5bbd9e=_0x5bbd9e||0xc8;return function(_0x4f0494){if(_0x4f0494){return _0x1e536d[_0xa6df('0x1a')](_0x5bbd9e)['json'](_0x4f0494);}};}function respondWithFilteredResult(_0x300a72,_0x414cae){return function(_0x23f4c1){if(_0x23f4c1){var _0x3e268f=typeof _0x414cae[_0xa6df('0x1b')]==='undefined'&&typeof _0x414cae[_0xa6df('0x1c')]===_0xa6df('0x1d');var _0x1b7870=_0x23f4c1[_0xa6df('0x1e')];var _0x4d6d2f=_0x3e268f?0x0:_0x414cae[_0xa6df('0x1b')];var _0x2d01dc=_0x3e268f?_0x23f4c1[_0xa6df('0x1e')]:_0x414cae[_0xa6df('0x1b')]+_0x414cae['limit'];var _0x59f65a;if(_0x2d01dc>=_0x1b7870){_0x2d01dc=_0x1b7870;_0x59f65a=0xc8;}else{_0x59f65a=0xce;}_0x300a72[_0xa6df('0x1a')](_0x59f65a);return _0x300a72['set'](_0xa6df('0x1f'),_0x4d6d2f+'-'+_0x2d01dc+'/'+_0x1b7870)[_0xa6df('0x20')](_0x23f4c1);}return null;};}function patchUpdates(_0x297e0f){return function(_0x378f1f){try{jsonpatch[_0xa6df('0x21')](_0x378f1f,_0x297e0f,!![]);}catch(_0x5e9799){return BPromise[_0xa6df('0x22')](_0x5e9799);}return _0x378f1f[_0xa6df('0x23')]();};}function saveUpdates(_0x3c09de,_0x10fb11){return function(_0x46d0c4){if(_0x46d0c4){return _0x46d0c4[_0xa6df('0x24')](_0x3c09de)['then'](function(_0x4be3e0){return _0x4be3e0;});}return null;};}function removeEntity(_0xcaa3a1,_0x111659){return function(_0x38fa51){if(_0x38fa51){return _0x38fa51[_0xa6df('0x25')]()[_0xa6df('0x26')](function(){_0xcaa3a1[_0xa6df('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51e836,_0x1f138b){return function(_0x2838f5){if(!_0x2838f5){_0x51e836[_0xa6df('0x19')](0x194);}return _0x2838f5;};}function handleError(_0x50e7b8,_0x54ff44){_0x54ff44=_0x54ff44||0x1f4;return function(_0x564e30){logger[_0xa6df('0x27')](_0x564e30['stack']);if(_0x564e30[_0xa6df('0x28')]){delete _0x564e30[_0xa6df('0x28')];}_0x50e7b8[_0xa6df('0x1a')](_0x54ff44)[_0xa6df('0x29')](_0x564e30);};}exports[_0xa6df('0x2a')]=function(_0x25a36a,_0x55161d){var _0x42fa1b={},_0x417c8a={},_0x42fa29={'count':0x0,'rows':[]};var _0x1257b2=_[_0xa6df('0x2b')](db['Dynamics365Account'][_0xa6df('0x2c')],function(_0xd56e14){return{'name':_0xd56e14['fieldName'],'type':_0xd56e14[_0xa6df('0x2d')][_0xa6df('0x2e')]};});_0x417c8a['model']=_[_0xa6df('0x2b')](_0x1257b2,_0xa6df('0x28'));_0x417c8a[_0xa6df('0x2f')]=_[_0xa6df('0x30')](_0x25a36a[_0xa6df('0x2f')]);_0x417c8a['filters']=_[_0xa6df('0x31')](_0x417c8a[_0xa6df('0x32')],_0x417c8a[_0xa6df('0x2f')]);_0x42fa1b[_0xa6df('0x33')]=_['intersection'](_0x417c8a[_0xa6df('0x32')],qs['fields'](_0x25a36a[_0xa6df('0x2f')][_0xa6df('0x34')]));_0x42fa1b[_0xa6df('0x33')]=_0x42fa1b[_0xa6df('0x33')][_0xa6df('0x35')]?_0x42fa1b[_0xa6df('0x33')]:_0x417c8a[_0xa6df('0x32')];if(!_0x25a36a[_0xa6df('0x2f')][_0xa6df('0x36')](_0xa6df('0x37'))){_0x42fa1b[_0xa6df('0x1c')]=qs['limit'](_0x25a36a['query'][_0xa6df('0x1c')]);_0x42fa1b[_0xa6df('0x1b')]=qs[_0xa6df('0x1b')](_0x25a36a[_0xa6df('0x2f')][_0xa6df('0x1b')]);}_0x42fa1b['order']=qs[_0xa6df('0x38')](_0x25a36a[_0xa6df('0x2f')][_0xa6df('0x38')]);_0x42fa1b[_0xa6df('0x39')]=qs[_0xa6df('0x3a')](_['pick'](_0x25a36a[_0xa6df('0x2f')],_0x417c8a[_0xa6df('0x3a')]),_0x1257b2);if(_0x25a36a[_0xa6df('0x2f')]['filter']){_0x42fa1b[_0xa6df('0x39')]=_['merge'](_0x42fa1b['where'],{'$or':_['map'](_0x1257b2,function(_0x2cf537){if(_0x2cf537[_0xa6df('0x2d')]!=='VIRTUAL'){var _0x493e91={};_0x493e91[_0x2cf537[_0xa6df('0x28')]]={'$like':'%'+_0x25a36a[_0xa6df('0x2f')][_0xa6df('0x3b')]+'%'};return _0x493e91;}})});}_0x42fa1b=_[_0xa6df('0x3c')]({},_0x42fa1b,_0x25a36a[_0xa6df('0x3d')]);var _0x47a460={'where':_0x42fa1b[_0xa6df('0x39')]};return db[_0xa6df('0x3e')][_0xa6df('0x1e')](_0x47a460)['then'](function(_0xe63116){_0x42fa29[_0xa6df('0x1e')]=_0xe63116;if(_0x25a36a[_0xa6df('0x2f')]['includeAll']){_0x42fa1b[_0xa6df('0x3f')]=[{'all':!![]}];}return db['Dynamics365Account'][_0xa6df('0x40')](_0x42fa1b);})['then'](function(_0x2bd695){_0x42fa29[_0xa6df('0x41')]=_0x2bd695;return _0x42fa29;})[_0xa6df('0x26')](respondWithFilteredResult(_0x55161d,_0x42fa1b))[_0xa6df('0x42')](handleError(_0x55161d,null));};exports[_0xa6df('0x43')]=function(_0x4f99a0,_0x3ea622){var _0x5e277f={'raw':![],'where':{'id':_0x4f99a0[_0xa6df('0x44')]['id']}},_0x38ac07={};_0x38ac07[_0xa6df('0x32')]=_['keys'](db[_0xa6df('0x3e')][_0xa6df('0x2c')]);_0x38ac07[_0xa6df('0x2f')]=_[_0xa6df('0x30')](_0x4f99a0[_0xa6df('0x2f')]);_0x38ac07['filters']=_[_0xa6df('0x31')](_0x38ac07[_0xa6df('0x32')],_0x38ac07[_0xa6df('0x2f')]);_0x5e277f['attributes']=_['intersection'](_0x38ac07['model'],qs[_0xa6df('0x34')](_0x4f99a0[_0xa6df('0x2f')][_0xa6df('0x34')]));_0x5e277f[_0xa6df('0x33')]=_0x5e277f[_0xa6df('0x33')]['length']?_0x5e277f[_0xa6df('0x33')]:_0x38ac07[_0xa6df('0x32')];if(_0x4f99a0[_0xa6df('0x2f')]['includeAll']){_0x5e277f['include']=[{'all':!![]}];}_0x5e277f=_['merge']({},_0x5e277f,_0x4f99a0[_0xa6df('0x3d')]);return db[_0xa6df('0x3e')][_0xa6df('0x45')](_0x5e277f)['then'](handleEntityNotFound(_0x3ea622,null))[_0xa6df('0x26')](respondWithResult(_0x3ea622,null))['catch'](handleError(_0x3ea622,null));};exports[_0xa6df('0x46')]=function(_0x1278b3,_0x53b4f2){return db[_0xa6df('0x3e')][_0xa6df('0x46')](_0x1278b3[_0xa6df('0x47')],{})[_0xa6df('0x26')](respondWithResult(_0x53b4f2,0xc9))['catch'](handleError(_0x53b4f2,null));};exports[_0xa6df('0x24')]=function(_0xdb3379,_0x4bc4d5){if(_0xdb3379['body']['id']){delete _0xdb3379['body']['id'];}return db[_0xa6df('0x3e')][_0xa6df('0x45')]({'where':{'id':_0xdb3379[_0xa6df('0x44')]['id']}})[_0xa6df('0x26')](handleEntityNotFound(_0x4bc4d5,null))[_0xa6df('0x26')](saveUpdates(_0xdb3379[_0xa6df('0x47')],null))['then'](respondWithResult(_0x4bc4d5,null))[_0xa6df('0x42')](handleError(_0x4bc4d5,null));};exports[_0xa6df('0x25')]=function(_0x415417,_0x130c0e){return db[_0xa6df('0x3e')][_0xa6df('0x45')]({'where':{'id':_0x415417[_0xa6df('0x44')]['id']}})[_0xa6df('0x26')](handleEntityNotFound(_0x130c0e,null))[_0xa6df('0x26')](removeEntity(_0x130c0e,null))[_0xa6df('0x42')](handleError(_0x130c0e,null));};exports[_0xa6df('0x48')]=function(_0x3c7f40,_0x8f7801,_0x3b45ae){var _0x2e7575={};var _0xa011d={};var _0x4e92a;var _0x5efea2;return db[_0xa6df('0x3e')][_0xa6df('0x49')]({'where':{'id':_0x3c7f40[_0xa6df('0x44')]['id']}})[_0xa6df('0x26')](handleEntityNotFound(_0x8f7801,null))[_0xa6df('0x26')](function(_0x2c11f7){if(_0x2c11f7){_0x4e92a=_0x2c11f7;_0xa011d[_0xa6df('0x32')]=_[_0xa6df('0x30')](db[_0xa6df('0x4a')][_0xa6df('0x2c')]);_0xa011d[_0xa6df('0x2f')]=_['keys'](_0x3c7f40[_0xa6df('0x2f')]);_0xa011d[_0xa6df('0x3a')]=_[_0xa6df('0x31')](_0xa011d[_0xa6df('0x32')],_0xa011d[_0xa6df('0x2f')]);_0x2e7575['attributes']=_[_0xa6df('0x31')](_0xa011d['model'],qs[_0xa6df('0x34')](_0x3c7f40[_0xa6df('0x2f')][_0xa6df('0x34')]));_0x2e7575[_0xa6df('0x33')]=_0x2e7575[_0xa6df('0x33')][_0xa6df('0x35')]?_0x2e7575[_0xa6df('0x33')]:_0xa011d[_0xa6df('0x32')];_0x2e7575[_0xa6df('0x4b')]=qs[_0xa6df('0x38')](_0x3c7f40[_0xa6df('0x2f')][_0xa6df('0x38')]);_0x2e7575[_0xa6df('0x39')]=qs[_0xa6df('0x3a')](_[_0xa6df('0x4c')](_0x3c7f40[_0xa6df('0x2f')],_0xa011d[_0xa6df('0x3a')]));if(_0x3c7f40[_0xa6df('0x2f')][_0xa6df('0x3b')]){_0x2e7575[_0xa6df('0x39')]=_[_0xa6df('0x3c')](_0x2e7575[_0xa6df('0x39')],{'$or':_[_0xa6df('0x2b')](_0x2e7575[_0xa6df('0x33')],function(_0x3ad81a){var _0x18d0ae={};_0x18d0ae[_0x3ad81a]={'$like':'%'+_0x3c7f40['query'][_0xa6df('0x3b')]+'%'};return _0x18d0ae;})});}_0x2e7575=_[_0xa6df('0x3c')]({},_0x2e7575,_0x3c7f40[_0xa6df('0x3d')]);return _0x4e92a[_0xa6df('0x48')](_0x2e7575);}})[_0xa6df('0x26')](function(_0x309718){if(_0x309718){_0x5efea2=_0x309718['length'];if(!_0x3c7f40[_0xa6df('0x2f')][_0xa6df('0x36')](_0xa6df('0x37'))){_0x2e7575[_0xa6df('0x1c')]=qs[_0xa6df('0x1c')](_0x3c7f40[_0xa6df('0x2f')][_0xa6df('0x1c')]);_0x2e7575[_0xa6df('0x1b')]=qs[_0xa6df('0x1b')](_0x3c7f40['query'][_0xa6df('0x1b')]);}return _0x4e92a[_0xa6df('0x48')](_0x2e7575);}})[_0xa6df('0x26')](function(_0x1c15cd){if(_0x1c15cd){return _0x1c15cd?{'count':_0x5efea2,'rows':_0x1c15cd}:null;}})[_0xa6df('0x26')](respondWithResult(_0x8f7801,null))[_0xa6df('0x42')](handleError(_0x8f7801,null));};exports[_0xa6df('0x4d')]=function(_0x442ca0,_0x3635ef,_0x2fa7d8){if(_0x442ca0[_0xa6df('0x47')]['id']){delete _0x442ca0[_0xa6df('0x47')]['id'];}return db['Dynamics365Account'][_0xa6df('0x49')]({'where':{'id':_0x442ca0[_0xa6df('0x44')]['id']}})[_0xa6df('0x26')](handleEntityNotFound(_0x3635ef,null))[_0xa6df('0x26')](function(_0x579176){if(_0x579176){_0x442ca0[_0xa6df('0x47')][_0xa6df('0x4e')]=_0x579176['id'];_0x442ca0['body']['Subjects']=integrations[_0xa6df('0x4f')](_0x442ca0['body'][_0xa6df('0x50')],_0x442ca0[_0xa6df('0x47')][_0xa6df('0x2d')]);_0x442ca0[_0xa6df('0x47')][_0xa6df('0x51')]=integrations['getDescriptions'](_0x442ca0[_0xa6df('0x47')][_0xa6df('0x50')],_0x442ca0[_0xa6df('0x47')][_0xa6df('0x2d')]);return db['Dynamics365Configuration'][_0xa6df('0x46')](_0x442ca0[_0xa6df('0x47')],{'include':[{'model':db['Dynamics365Field'],'as':_0xa6df('0x52')},{'model':db['Dynamics365Field'],'as':_0xa6df('0x51')}]});}return null;})[_0xa6df('0x26')](respondWithResult(_0x3635ef,null))[_0xa6df('0x42')](handleError(_0x3635ef,null));};exports['getFields']=function(_0x34da54,_0xfd6bde,_0x20bea9){var _0x340e3b=_0x34da54[_0xa6df('0x2f')][_0xa6df('0x53')];var _0x3ac955=_0x340e3b==='incident'?_0xa6df('0x54'):_0xa6df('0x55');var _0x239dc0='';var _0x5cdce7='';var _0x578c14='';var _0x56d19f='';var _0x3d934c='';var _0x4c3245='';var _0x50e17a='';var _0x3977c8='';var _0x31633a=['title','description','customerid','ownerid',_0xa6df('0x56'),'subject',_0xa6df('0x57'),_0xa6df('0x58'),_0xa6df('0x59'),_0xa6df('0x5a')];var _0x3ed015=[_0xa6df('0x5b'),'accountidyominame',_0xa6df('0x5c'),_0xa6df('0x5d'),_0xa6df('0x5e'),'contactidyominame',_0xa6df('0x5f'),'contractidname',_0xa6df('0x60'),_0xa6df('0x61'),'createdbyname','createdbyyominame',_0xa6df('0x62'),_0xa6df('0x63'),_0xa6df('0x64'),'customeridname',_0xa6df('0x65'),_0xa6df('0x66'),'emailaddress',_0xa6df('0x67'),_0xa6df('0x68'),_0xa6df('0x69'),_0xa6df('0x6a'),_0xa6df('0x6b'),_0xa6df('0x6c'),_0xa6df('0x6d'),_0xa6df('0x6e'),_0xa6df('0x6f'),_0xa6df('0x70'),_0xa6df('0x71'),_0xa6df('0x72'),_0xa6df('0x73'),_0xa6df('0x74'),'modifiedbyname',_0xa6df('0x75'),_0xa6df('0x76'),_0xa6df('0x77'),_0xa6df('0x78'),'msdyn_incidenttypename',_0xa6df('0x79'),_0xa6df('0x7a'),_0xa6df('0x7b'),'overriddencreatedon',_0xa6df('0x7c'),_0xa6df('0x7d'),_0xa6df('0x7e'),_0xa6df('0x7f'),_0xa6df('0x80'),_0xa6df('0x81'),_0xa6df('0x82'),_0xa6df('0x83'),_0xa6df('0x84'),'resolveby',_0xa6df('0x85'),_0xa6df('0x86'),_0xa6df('0x87'),'responsiblecontactidyominame',_0xa6df('0x88'),_0xa6df('0x89'),_0xa6df('0x8a'),_0xa6df('0x8b'),_0xa6df('0x8c'),_0xa6df('0x8d'),_0xa6df('0x8e'),_0xa6df('0x8f'),'timezoneruleversionnumber',_0xa6df('0x90'),'traversedpath',_0xa6df('0x91'),_0xa6df('0x92')];var _0x87baa9=_0x31633a[_0xa6df('0x93')](_0x3ed015);return db[_0xa6df('0x3e')][_0xa6df('0x49')]({'where':{'id':_0x34da54[_0xa6df('0x44')]['id']},'attributes':['id',_0xa6df('0x94'),_0xa6df('0x95'),'remoteUri',_0xa6df('0x96'),_0xa6df('0x97'),_0xa6df('0x98')]})['then'](handleEntityNotFound(_0xfd6bde,null))[_0xa6df('0x26')](function(_0x14b0eb){if(_0x14b0eb){_0x3977c8=_0x14b0eb['remoteUri'];var _0x36d98e=_0x3977c8[_0xa6df('0x99')](-0x1);if(_0x36d98e==='/'){_0x3977c8=_0x3977c8[_0xa6df('0x9a')](0x0,_0x3977c8[_0xa6df('0x9b')](_0x36d98e));}_0x50e17a=util[_0xa6df('0x9c')](_0xa6df('0x9d'),_0x3977c8);var _0x249b22={'method':'POST','uri':_0xa6df('0x9e')+_0x14b0eb[_0xa6df('0x96')]+_0xa6df('0x9f'),'form':{'client_id':_0x14b0eb['clientId'],'resource':_0x3977c8,'username':_0x14b0eb[_0xa6df('0x94')],'password':_0x14b0eb[_0xa6df('0x95')],'grant_type':'password','client_secret':_0x14b0eb['clientSecret']},'json':!![]};return rp(_0x249b22);}})[_0xa6df('0x26')](function(_0x1e0d0d){_0x4c3245=_0x1e0d0d[_0xa6df('0xa0')];var _0x54e8dc={'method':'GET','uri':encodeURI(_0x50e17a+'EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27'+_0x3ac955+'\x27'),'headers':{'Authorization':_0xa6df('0xa1')+_0x4c3245,'If-None-Match':null,'OData-Version':_0xa6df('0xa2')},'json':!![]};return rp(_0x54e8dc);})[_0xa6df('0x26')](function(_0x22d52c){var _0x28edb1=_0x22d52c[_0xa6df('0xa3')][0x0];var _0x48924f=_0x28edb1[_0xa6df('0xa4')];var _0x332452={'method':_0xa6df('0xa5'),'uri':_0x50e17a+_0xa6df('0xa6')+_0x48924f+_0xa6df('0xa7'),'headers':{'Authorization':'Bearer\x20'+_0x4c3245,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x332452);})['then'](function(_0x1b2fd4){_0x239dc0=_0x1b2fd4;_0x5cdce7=_0x239dc0['Attributes'];_0x5cdce7=_[_0xa6df('0xa8')](_0x5cdce7,function(_0x473331){return!_0x87baa9['includes'](_0x473331[_0xa6df('0xa9')]);});var _0x31bc83=[];var _0x1172cf=[];_0x5cdce7[_0xa6df('0xaa')](function(_0x2007a3){if(_0x2007a3['@odata.type']){var _0x2fbc12=_0x2007a3[_0xa6df('0xab')][_0xa6df('0x9a')](_0x2007a3[_0xa6df('0xab')]['lastIndexOf']('.')+0x1);if(_0x2fbc12===_0xa6df('0xac')){_0x31bc83['push'](getSelectList(_0x50e17a,_0x340e3b,_0x1172cf,_0x239dc0[_0xa6df('0xa4')],_0x2007a3[_0xa6df('0xa4')],_0x4c3245));}}});return Promise['all'](_0x31bc83);})[_0xa6df('0x26')](function(_0x54bae4){_0x578c14=_0x54bae4[0x0];var _0x2d5d88=[];var _0x4acff5=[];_0x5cdce7[_0xa6df('0xaa')](function(_0x117903){if(!_['isNil'](_0x117903[_0xa6df('0xab')])){var _0x41018c=_0x117903['@odata.type'][_0xa6df('0x9a')](_0x117903[_0xa6df('0xab')][_0xa6df('0x9b')]('.')+0x1);if(_0x41018c===_0xa6df('0xad')){_0x2d5d88[_0xa6df('0xae')](getBooleanList(_0x50e17a,_0x340e3b,_0x4acff5,_0x239dc0[_0xa6df('0xa4')],_0x117903[_0xa6df('0xa4')],_0x4c3245));}}});return Promise['all'](_0x2d5d88);})[_0xa6df('0x26')](function(_0x36636b){_0x56d19f=_0x36636b[0x0];var _0x3ed813=[];var _0x566287=[];_0x5cdce7[_0xa6df('0xaa')](function(_0x26ab8d){if(_0x26ab8d[_0xa6df('0xab')]){var _0x2d2724=_0x26ab8d[_0xa6df('0xab')]['substring'](_0x26ab8d[_0xa6df('0xab')][_0xa6df('0x9b')]('.')+0x1);if(_0x2d2724===_0xa6df('0xaf')||_0x2d2724==='DoubleAttributeMetadata'||_0x2d2724===_0xa6df('0xb0')||_0x2d2724===_0xa6df('0xb1')||_0x2d2724===_0xa6df('0xb2')||_0x2d2724===_0xa6df('0xb3')||_0x2d2724==='StatusAttributeMetadata'||_0x2d2724===_0xa6df('0xb4')||_0x2d2724===_0xa6df('0xb5')||_0x2d2724===_0xa6df('0xb6')){_0x3ed813[_0xa6df('0xae')](getInputList(_0x50e17a,_0x340e3b,_0x2d2724,_0x566287,_0x239dc0['MetadataId'],_0x26ab8d[_0xa6df('0xa4')],_0x4c3245));}}});return Promise[_0xa6df('0xb7')](_0x3ed813);})['then'](function(_0x3dfae1){_0x3d934c=_0x3dfae1[0x0];var _0xf22efa=_0x578c14[_0xa6df('0x93')](_0x56d19f)['concat'](_0x3d934c);var _0x17272b={'count':_0xf22efa['length'],'rows':_0xf22efa};return _0x17272b;})['then'](respondWithResult(_0xfd6bde,null))['catch'](function(_0x38b4a6){var _0x5a7f15=_0x34da54[_0xa6df('0x2f')][_0xa6df('0xb8')]?0x1f4:_0x38b4a6[_0xa6df('0xb9')]||0x1f4;logger[_0xa6df('0x27')](_0x38b4a6[_0xa6df('0xba')]);delete _0x38b4a6['name'];if(_0x5a7f15===0x191){_0x5a7f15=0x190;}_0xfd6bde[_0xa6df('0x1a')](_0x5a7f15)[_0xa6df('0x29')](_0x34da54[_0xa6df('0x2f')][_0xa6df('0xb8')]?{'message':_0xa6df('0xbb'),'statusCode':_0x38b4a6['statusCode']}:_0x38b4a6);});};function getSelectList(_0x58b0e4,_0x162cc2,_0x48a79a,_0x453f81,_0x58f83d,_0x25e5a5){var _0x8da4fe={'method':'GET','uri':_0x58b0e4+'EntityDefinitions('+_0x453f81+')/Attributes('+_0x58f83d+')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?'+_0xa6df('0xbc'),'headers':{'Authorization':_0xa6df('0xa1')+_0x25e5a5,'If-None-Match':null,'OData-Version':_0xa6df('0xa2')},'json':!![]};return rp(_0x8da4fe)[_0xa6df('0x26')](function(_0x9d338c){var _0x129137=[];var _0xd34c0b=_0x9d338c[_0xa6df('0xbd')]['Options'];_0xd34c0b[_0xa6df('0xaa')](function(_0x23da8d){_0x129137[_0xa6df('0xae')]({'name':_0x23da8d[_0xa6df('0xbe')][_0xa6df('0xbf')][_0xa6df('0xbe')],'value':String(_0x23da8d[_0xa6df('0xc0')])});});var _0xe6ca07={'id':_0x162cc2+'_'+_0x9d338c[_0xa6df('0xa9')],'name':_0x9d338c[_0xa6df('0xc1')]['UserLocalizedLabel'][_0xa6df('0xbe')],'custom':![],'options':_0x129137};_0x48a79a[_0xa6df('0xae')](_0xe6ca07);return _0x48a79a;});}function getBooleanList(_0x35cc97,_0x5490f6,_0x536a44,_0x227552,_0x5d7dc3,_0x3886f7){var _0x516974={'method':_0xa6df('0xa5'),'uri':_0x35cc97+_0xa6df('0xa6')+_0x227552+_0xa6df('0xc2')+_0x5d7dc3+_0xa6df('0xc3'),'headers':{'Authorization':_0xa6df('0xa1')+_0x3886f7,'If-None-Match':null,'OData-Version':_0xa6df('0xa2')},'json':!![]};return rp(_0x516974)[_0xa6df('0x26')](function(_0x4d24d8){var _0x1754c4=[];_0x1754c4['push']({'name':_0x4d24d8[_0xa6df('0xbd')][_0xa6df('0xc4')][_0xa6df('0xbe')][_0xa6df('0xbf')]['Label'],'value':_0xa6df('0xc5')},{'name':_0x4d24d8[_0xa6df('0xbd')]['FalseOption'][_0xa6df('0xbe')][_0xa6df('0xbf')][_0xa6df('0xbe')],'value':'false'});var _0x4eeaf7={'id':_0x5490f6+'_'+_0x4d24d8[_0xa6df('0xa9')],'name':_0x4d24d8['DisplayName']['UserLocalizedLabel'][_0xa6df('0xbe')],'custom':![],'options':_0x1754c4};_0x536a44[_0xa6df('0xae')](_0x4eeaf7);return _0x536a44;});}function getInputList(_0x58d0b1,_0x486bfa,_0x3daaca,_0x41a554,_0x29487d,_0x423d72,_0x3b6947){var _0x166d54={'method':_0xa6df('0xa5'),'uri':_0x58d0b1+_0xa6df('0xa6')+_0x29487d+')/Attributes('+_0x423d72+_0xa6df('0xc6')+_0x3daaca+'?$select=DisplayName,LogicalName','headers':{'Authorization':_0xa6df('0xa1')+_0x3b6947,'If-None-Match':null,'OData-Version':_0xa6df('0xa2')},'json':!![]};return rp(_0x166d54)['then'](function(_0x315a25){var _0x589300={'id':_0x486bfa+'_'+_0x315a25[_0xa6df('0xa9')],'name':_0x315a25[_0xa6df('0xc1')][_0xa6df('0xbf')]?_0x315a25[_0xa6df('0xc1')][_0xa6df('0xbf')][_0xa6df('0xbe')]:_0x315a25['LogicalName'],'custom':![],'options':[]};_0x41a554[_0xa6df('0xae')](_0x589300);return _0x41a554;});} \ No newline at end of file +var _0x279d=['masteridname','modifiedbyexternalpartyname','modifiedon','modifiedonbehalfbyname','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','onholdtime','owneridname','owneridtype','parentcaseidname','primarycontactidname','primarycontactidyominame','prioritycodename','resolveby','resolvebykpiidname','responsiblecontactidyominame','sentimentvalue','slaname','socialprofileidname','statecode','statuscode','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','versionnumber','concat','username','password','remoteUri','tenantId','clientId','clientSecret','slice','lastIndexOf','format','%s/api/data/v9.0/','POST','https://login.microsoftonline.com/','access_token','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','value','MetadataId',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','includes','LogicalName','@odata.type','substring','PicklistAttributeMetadata','push','all','isNil','forEach','BigIntAttributeMetadata','MemoAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','test','statusCode','send','Wrong\x20credentials',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','OptionSet','Options','Label','UserLocalizedLabel','Value','GET','EntityDefinitions(','TrueOption','true','false','DisplayName','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','Content-Range','apply','reject','then','destroy','error','stack','name','index','map','Dynamics365Account','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','rows','catch','find','create','body','update','params','findOne','length','getConfigurations','hasOwnProperty','addConfiguration','AccountId','Subjects','channel','getDescriptions','Dynamics365Configuration','Dynamics365Field','Descriptions','getFields','ticketType','incident','Incident','description','ownerid','caseorigincode','subject','phonenumber','directioncode','phonecall_activity_parties','accountidyominame','actualserviceunits','billedserviceunits','contactidname','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdon','createdonbehalfbyname','createdonbehalfbyyominame','emailaddress','entitlementidname','entityimage_timestamp','exchangerate','firstresponsebykpiidname','followupby','influencescore','kbarticleidname','lastonholdtime'];(function(_0x479f47,_0x3d619a){var _0xc3fac2=function(_0x351634){while(--_0x351634){_0x479f47['push'](_0x479f47['shift']());}};_0xc3fac2(++_0x3d619a);}(_0x279d,0x1d8));var _0xd279=function(_0x9fd887,_0x47f76c){_0x9fd887=_0x9fd887-0x0;var _0x1a54ab=_0x279d[_0x9fd887];return _0x1a54ab;};'use strict';var emlformat=require(_0xd279('0x0'));var rimraf=require(_0xd279('0x1'));var zipdir=require(_0xd279('0x2'));var jsonpatch=require(_0xd279('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xd279('0x4'));var Mustache=require(_0xd279('0x5'));var util=require('util');var path=require(_0xd279('0x6'));var sox=require(_0xd279('0x7'));var csv=require(_0xd279('0x8'));var ejs=require(_0xd279('0x9'));var fs=require('fs');var fs_extra=require(_0xd279('0xa'));var _=require(_0xd279('0xb'));var squel=require(_0xd279('0xc'));var crypto=require('crypto');var jsforce=require(_0xd279('0xd'));var deskjs=require(_0xd279('0xe'));var toCsv=require(_0xd279('0x8'));var querystring=require(_0xd279('0xf'));var Papa=require(_0xd279('0x10'));var Redis=require(_0xd279('0x11'));var authService=require(_0xd279('0x12'));var qs=require(_0xd279('0x13'));var as=require(_0xd279('0x14'));var hardwareService=require(_0xd279('0x15'));var logger=require(_0xd279('0x16'))('api');var utils=require(_0xd279('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xd279('0x18'));var db=require(_0xd279('0x19'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0xeb0828,_0x54f78b){_0x54f78b=_0x54f78b||0xcc;return function(_0x590646){if(_0x590646){return _0xeb0828[_0xd279('0x1a')](_0x54f78b);}return _0xeb0828['status'](_0x54f78b)[_0xd279('0x1b')]();};}function respondWithResult(_0x5c3b48,_0x2bf8e3){_0x2bf8e3=_0x2bf8e3||0xc8;return function(_0x3f3514){if(_0x3f3514){return _0x5c3b48[_0xd279('0x1c')](_0x2bf8e3)[_0xd279('0x1d')](_0x3f3514);}};}function respondWithFilteredResult(_0x5c1c0f,_0x55b3c5){return function(_0x20db5d){if(_0x20db5d){var _0x440e80=typeof _0x55b3c5[_0xd279('0x1e')]===_0xd279('0x1f')&&typeof _0x55b3c5['limit']===_0xd279('0x1f');var _0x591f5f=_0x20db5d['count'];var _0x544e01=_0x440e80?0x0:_0x55b3c5[_0xd279('0x1e')];var _0x2a5d61=_0x440e80?_0x20db5d['count']:_0x55b3c5[_0xd279('0x1e')]+_0x55b3c5[_0xd279('0x20')];var _0x281040;if(_0x2a5d61>=_0x591f5f){_0x2a5d61=_0x591f5f;_0x281040=0xc8;}else{_0x281040=0xce;}_0x5c1c0f[_0xd279('0x1c')](_0x281040);return _0x5c1c0f['set'](_0xd279('0x21'),_0x544e01+'-'+_0x2a5d61+'/'+_0x591f5f)[_0xd279('0x1d')](_0x20db5d);}return null;};}function patchUpdates(_0x5577fc){return function(_0x1509bc){try{jsonpatch[_0xd279('0x22')](_0x1509bc,_0x5577fc,!![]);}catch(_0x1c1d6e){return BPromise[_0xd279('0x23')](_0x1c1d6e);}return _0x1509bc['save']();};}function saveUpdates(_0x36fd44,_0x2716f4){return function(_0x13180f){if(_0x13180f){return _0x13180f['update'](_0x36fd44)[_0xd279('0x24')](function(_0x1a06e7){return _0x1a06e7;});}return null;};}function removeEntity(_0x3a9e73,_0x307599){return function(_0x251de4){if(_0x251de4){return _0x251de4[_0xd279('0x25')]()[_0xd279('0x24')](function(){_0x3a9e73[_0xd279('0x1c')](0xcc)[_0xd279('0x1b')]();});}};}function handleEntityNotFound(_0x48f1b1,_0x53e0f6){return function(_0x38686c){if(!_0x38686c){_0x48f1b1[_0xd279('0x1a')](0x194);}return _0x38686c;};}function handleError(_0x563637,_0x46a162){_0x46a162=_0x46a162||0x1f4;return function(_0x26bd72){logger[_0xd279('0x26')](_0x26bd72[_0xd279('0x27')]);if(_0x26bd72['name']){delete _0x26bd72[_0xd279('0x28')];}_0x563637[_0xd279('0x1c')](_0x46a162)['send'](_0x26bd72);};}exports[_0xd279('0x29')]=function(_0x577102,_0x159ea4){var _0x2347ed={},_0x3e64f6={},_0x47175a={'count':0x0,'rows':[]};var _0x2dd41e=_[_0xd279('0x2a')](db[_0xd279('0x2b')][_0xd279('0x2c')],function(_0x3c95fb){return{'name':_0x3c95fb['fieldName'],'type':_0x3c95fb[_0xd279('0x2d')][_0xd279('0x2e')]};});_0x3e64f6[_0xd279('0x2f')]=_[_0xd279('0x2a')](_0x2dd41e,_0xd279('0x28'));_0x3e64f6[_0xd279('0x30')]=_[_0xd279('0x31')](_0x577102[_0xd279('0x30')]);_0x3e64f6[_0xd279('0x32')]=_['intersection'](_0x3e64f6['model'],_0x3e64f6[_0xd279('0x30')]);_0x2347ed[_0xd279('0x33')]=_[_0xd279('0x34')](_0x3e64f6[_0xd279('0x2f')],qs['fields'](_0x577102[_0xd279('0x30')][_0xd279('0x35')]));_0x2347ed[_0xd279('0x33')]=_0x2347ed[_0xd279('0x33')]['length']?_0x2347ed[_0xd279('0x33')]:_0x3e64f6[_0xd279('0x2f')];if(!_0x577102[_0xd279('0x30')]['hasOwnProperty'](_0xd279('0x36'))){_0x2347ed['limit']=qs[_0xd279('0x20')](_0x577102['query'][_0xd279('0x20')]);_0x2347ed[_0xd279('0x1e')]=qs['offset'](_0x577102[_0xd279('0x30')][_0xd279('0x1e')]);}_0x2347ed[_0xd279('0x37')]=qs['sort'](_0x577102[_0xd279('0x30')][_0xd279('0x38')]);_0x2347ed[_0xd279('0x39')]=qs[_0xd279('0x32')](_[_0xd279('0x3a')](_0x577102[_0xd279('0x30')],_0x3e64f6['filters']),_0x2dd41e);if(_0x577102['query'][_0xd279('0x3b')]){_0x2347ed[_0xd279('0x39')]=_[_0xd279('0x3c')](_0x2347ed[_0xd279('0x39')],{'$or':_[_0xd279('0x2a')](_0x2dd41e,function(_0x1c7cd1){if(_0x1c7cd1['type']!==_0xd279('0x3d')){var _0x5c41d9={};_0x5c41d9[_0x1c7cd1[_0xd279('0x28')]]={'$like':'%'+_0x577102[_0xd279('0x30')]['filter']+'%'};return _0x5c41d9;}})});}_0x2347ed=_['merge']({},_0x2347ed,_0x577102[_0xd279('0x3e')]);var _0x3996ea={'where':_0x2347ed[_0xd279('0x39')]};return db[_0xd279('0x2b')]['count'](_0x3996ea)[_0xd279('0x24')](function(_0x584748){_0x47175a[_0xd279('0x3f')]=_0x584748;if(_0x577102[_0xd279('0x30')][_0xd279('0x40')]){_0x2347ed[_0xd279('0x41')]=[{'all':!![]}];}return db['Dynamics365Account']['findAll'](_0x2347ed);})[_0xd279('0x24')](function(_0x46c899){_0x47175a[_0xd279('0x42')]=_0x46c899;return _0x47175a;})[_0xd279('0x24')](respondWithFilteredResult(_0x159ea4,_0x2347ed))[_0xd279('0x43')](handleError(_0x159ea4,null));};exports['show']=function(_0x580b30,_0x10ae13){var _0x3acc04={'raw':![],'where':{'id':_0x580b30['params']['id']}},_0x3353d8={};_0x3353d8['model']=_[_0xd279('0x31')](db['Dynamics365Account'][_0xd279('0x2c')]);_0x3353d8[_0xd279('0x30')]=_['keys'](_0x580b30[_0xd279('0x30')]);_0x3353d8[_0xd279('0x32')]=_[_0xd279('0x34')](_0x3353d8[_0xd279('0x2f')],_0x3353d8[_0xd279('0x30')]);_0x3acc04[_0xd279('0x33')]=_[_0xd279('0x34')](_0x3353d8[_0xd279('0x2f')],qs['fields'](_0x580b30[_0xd279('0x30')][_0xd279('0x35')]));_0x3acc04[_0xd279('0x33')]=_0x3acc04[_0xd279('0x33')]['length']?_0x3acc04[_0xd279('0x33')]:_0x3353d8[_0xd279('0x2f')];if(_0x580b30[_0xd279('0x30')][_0xd279('0x40')]){_0x3acc04[_0xd279('0x41')]=[{'all':!![]}];}_0x3acc04=_[_0xd279('0x3c')]({},_0x3acc04,_0x580b30[_0xd279('0x3e')]);return db[_0xd279('0x2b')][_0xd279('0x44')](_0x3acc04)[_0xd279('0x24')](handleEntityNotFound(_0x10ae13,null))[_0xd279('0x24')](respondWithResult(_0x10ae13,null))['catch'](handleError(_0x10ae13,null));};exports['create']=function(_0x4f2a56,_0x469db5){return db[_0xd279('0x2b')][_0xd279('0x45')](_0x4f2a56[_0xd279('0x46')],{})[_0xd279('0x24')](respondWithResult(_0x469db5,0xc9))[_0xd279('0x43')](handleError(_0x469db5,null));};exports[_0xd279('0x47')]=function(_0x55b189,_0x247c09){if(_0x55b189[_0xd279('0x46')]['id']){delete _0x55b189[_0xd279('0x46')]['id'];}return db[_0xd279('0x2b')][_0xd279('0x44')]({'where':{'id':_0x55b189[_0xd279('0x48')]['id']}})[_0xd279('0x24')](handleEntityNotFound(_0x247c09,null))[_0xd279('0x24')](saveUpdates(_0x55b189[_0xd279('0x46')],null))[_0xd279('0x24')](respondWithResult(_0x247c09,null))[_0xd279('0x43')](handleError(_0x247c09,null));};exports[_0xd279('0x25')]=function(_0x341d92,_0x496e2f){return db[_0xd279('0x2b')]['find']({'where':{'id':_0x341d92[_0xd279('0x48')]['id']}})[_0xd279('0x24')](handleEntityNotFound(_0x496e2f,null))[_0xd279('0x24')](removeEntity(_0x496e2f,null))[_0xd279('0x43')](handleError(_0x496e2f,null));};exports['getConfigurations']=function(_0x18c54a,_0x6bad4b,_0x1e7ee){var _0x17d0e5={};var _0x2409ec={};var _0x2279d2;var _0xeb52c3;return db[_0xd279('0x2b')][_0xd279('0x49')]({'where':{'id':_0x18c54a[_0xd279('0x48')]['id']}})['then'](handleEntityNotFound(_0x6bad4b,null))[_0xd279('0x24')](function(_0x2224af){if(_0x2224af){_0x2279d2=_0x2224af;_0x2409ec[_0xd279('0x2f')]=_['keys'](db['Dynamics365Configuration'][_0xd279('0x2c')]);_0x2409ec[_0xd279('0x30')]=_[_0xd279('0x31')](_0x18c54a[_0xd279('0x30')]);_0x2409ec[_0xd279('0x32')]=_['intersection'](_0x2409ec[_0xd279('0x2f')],_0x2409ec[_0xd279('0x30')]);_0x17d0e5[_0xd279('0x33')]=_[_0xd279('0x34')](_0x2409ec['model'],qs[_0xd279('0x35')](_0x18c54a[_0xd279('0x30')][_0xd279('0x35')]));_0x17d0e5[_0xd279('0x33')]=_0x17d0e5['attributes'][_0xd279('0x4a')]?_0x17d0e5[_0xd279('0x33')]:_0x2409ec['model'];_0x17d0e5[_0xd279('0x37')]=qs[_0xd279('0x38')](_0x18c54a[_0xd279('0x30')][_0xd279('0x38')]);_0x17d0e5['where']=qs[_0xd279('0x32')](_[_0xd279('0x3a')](_0x18c54a[_0xd279('0x30')],_0x2409ec[_0xd279('0x32')]));if(_0x18c54a[_0xd279('0x30')][_0xd279('0x3b')]){_0x17d0e5[_0xd279('0x39')]=_[_0xd279('0x3c')](_0x17d0e5[_0xd279('0x39')],{'$or':_[_0xd279('0x2a')](_0x17d0e5['attributes'],function(_0xf42a38){var _0x3e5aab={};_0x3e5aab[_0xf42a38]={'$like':'%'+_0x18c54a[_0xd279('0x30')][_0xd279('0x3b')]+'%'};return _0x3e5aab;})});}_0x17d0e5=_[_0xd279('0x3c')]({},_0x17d0e5,_0x18c54a['options']);return _0x2279d2[_0xd279('0x4b')](_0x17d0e5);}})['then'](function(_0x29506f){if(_0x29506f){_0xeb52c3=_0x29506f['length'];if(!_0x18c54a[_0xd279('0x30')][_0xd279('0x4c')]('nolimit')){_0x17d0e5[_0xd279('0x20')]=qs[_0xd279('0x20')](_0x18c54a['query'][_0xd279('0x20')]);_0x17d0e5[_0xd279('0x1e')]=qs[_0xd279('0x1e')](_0x18c54a['query'][_0xd279('0x1e')]);}return _0x2279d2[_0xd279('0x4b')](_0x17d0e5);}})['then'](function(_0xd08d87){if(_0xd08d87){return _0xd08d87?{'count':_0xeb52c3,'rows':_0xd08d87}:null;}})['then'](respondWithResult(_0x6bad4b,null))['catch'](handleError(_0x6bad4b,null));};exports[_0xd279('0x4d')]=function(_0x5a8719,_0x2b96a4,_0xd89985){if(_0x5a8719[_0xd279('0x46')]['id']){delete _0x5a8719[_0xd279('0x46')]['id'];}return db['Dynamics365Account'][_0xd279('0x49')]({'where':{'id':_0x5a8719['params']['id']}})[_0xd279('0x24')](handleEntityNotFound(_0x2b96a4,null))[_0xd279('0x24')](function(_0x2f9219){if(_0x2f9219){_0x5a8719[_0xd279('0x46')][_0xd279('0x4e')]=_0x2f9219['id'];_0x5a8719[_0xd279('0x46')][_0xd279('0x4f')]=integrations['getSubjects'](_0x5a8719[_0xd279('0x46')][_0xd279('0x50')],_0x5a8719['body']['type']);_0x5a8719[_0xd279('0x46')]['Descriptions']=integrations[_0xd279('0x51')](_0x5a8719[_0xd279('0x46')][_0xd279('0x50')],_0x5a8719[_0xd279('0x46')]['type']);return db[_0xd279('0x52')][_0xd279('0x45')](_0x5a8719[_0xd279('0x46')],{'include':[{'model':db['Dynamics365Field'],'as':_0xd279('0x4f')},{'model':db[_0xd279('0x53')],'as':_0xd279('0x54')}]});}return null;})[_0xd279('0x24')](respondWithResult(_0x2b96a4,null))[_0xd279('0x43')](handleError(_0x2b96a4,null));};exports[_0xd279('0x55')]=function(_0x19d408,_0x485be9,_0x39c4bf){var _0x32219c=_0x19d408[_0xd279('0x30')][_0xd279('0x56')];var _0xa3f8fc=_0x32219c===_0xd279('0x57')?_0xd279('0x58'):'PhoneCall';var _0x33318f='';var _0x59f62b='';var _0xddb8e3='';var _0x43f8b8='';var _0x5a8d15='';var _0x5b97ff='';var _0x500cd7='';var _0x3f8e25='';var _0x2153c3=['title',_0xd279('0x59'),'customerid',_0xd279('0x5a'),_0xd279('0x5b'),_0xd279('0x5c'),_0xd279('0x5d'),'regardingobjectid',_0xd279('0x5e'),_0xd279('0x5f')];var _0x4e3320=['accountidname',_0xd279('0x60'),_0xd279('0x61'),_0xd279('0x62'),_0xd279('0x63'),'contactidyominame','contractdetailidname',_0xd279('0x64'),_0xd279('0x65'),_0xd279('0x66'),_0xd279('0x67'),'createdbyyominame',_0xd279('0x68'),_0xd279('0x69'),_0xd279('0x6a'),'customeridname','customeridtype','customeridyominame',_0xd279('0x6b'),_0xd279('0x6c'),_0xd279('0x6d'),'entityimage_url','escalatedon',_0xd279('0x6e'),_0xd279('0x6f'),_0xd279('0x70'),'importsequencenumber',_0xd279('0x71'),_0xd279('0x72'),_0xd279('0x73'),_0xd279('0x74'),_0xd279('0x75'),'modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame',_0xd279('0x76'),_0xd279('0x77'),'modifiedonbehalfbyyominame',_0xd279('0x78'),_0xd279('0x79'),_0xd279('0x7a'),_0xd279('0x7b'),'overriddencreatedon',_0xd279('0x7c'),_0xd279('0x7d'),'owneridyominame',_0xd279('0x7e'),_0xd279('0x7f'),_0xd279('0x80'),_0xd279('0x81'),'productidname','productserialnumber',_0xd279('0x82'),_0xd279('0x83'),'responseby','responsiblecontactidname',_0xd279('0x84'),_0xd279('0x85'),'slainvokedidname',_0xd279('0x86'),_0xd279('0x87'),_0xd279('0x88'),_0xd279('0x89'),'subjectidname',_0xd279('0x8a'),_0xd279('0x8b'),_0xd279('0x8c'),_0xd279('0x8d'),_0xd279('0x8e'),_0xd279('0x8f')];var _0x59dc6d=_0x2153c3[_0xd279('0x90')](_0x4e3320);return db[_0xd279('0x2b')]['findOne']({'where':{'id':_0x19d408[_0xd279('0x48')]['id']},'attributes':['id',_0xd279('0x91'),_0xd279('0x92'),_0xd279('0x93'),_0xd279('0x94'),_0xd279('0x95'),_0xd279('0x96')]})[_0xd279('0x24')](handleEntityNotFound(_0x485be9,null))['then'](function(_0xea4003){if(_0xea4003){_0x3f8e25=_0xea4003[_0xd279('0x93')];var _0x4eb876=_0x3f8e25[_0xd279('0x97')](-0x1);if(_0x4eb876==='/'){_0x3f8e25=_0x3f8e25['substring'](0x0,_0x3f8e25[_0xd279('0x98')](_0x4eb876));}_0x500cd7=util[_0xd279('0x99')](_0xd279('0x9a'),_0x3f8e25);var _0x5087d3={'method':_0xd279('0x9b'),'uri':_0xd279('0x9c')+_0xea4003[_0xd279('0x94')]+'/oauth2/token','form':{'client_id':_0xea4003[_0xd279('0x95')],'resource':_0x3f8e25,'username':_0xea4003[_0xd279('0x91')],'password':_0xea4003[_0xd279('0x92')],'grant_type':_0xd279('0x92'),'client_secret':_0xea4003['clientSecret']},'json':!![]};return rp(_0x5087d3);}})[_0xd279('0x24')](function(_0x3efa28){_0x5b97ff=_0x3efa28[_0xd279('0x9d')];var _0x18ab62={'method':'GET','uri':encodeURI(_0x500cd7+_0xd279('0x9e')+_0xa3f8fc+'\x27'),'headers':{'Authorization':_0xd279('0x9f')+_0x5b97ff,'If-None-Match':null,'OData-Version':_0xd279('0xa0')},'json':!![]};return rp(_0x18ab62);})[_0xd279('0x24')](function(_0x4e9e4d){var _0x2f161b=_0x4e9e4d[_0xd279('0xa1')][0x0];var _0x33bf64=_0x2f161b[_0xd279('0xa2')];var _0x9a1037={'method':'GET','uri':_0x500cd7+'EntityDefinitions('+_0x33bf64+_0xd279('0xa3'),'headers':{'Authorization':_0xd279('0x9f')+_0x5b97ff,'If-None-Match':null,'OData-Version':_0xd279('0xa0')},'json':!![]};return rp(_0x9a1037);})[_0xd279('0x24')](function(_0xbde294){_0x33318f=_0xbde294;_0x59f62b=_0x33318f['Attributes'];_0x59f62b=_['remove'](_0x59f62b,function(_0x2d55c7){return!_0x59dc6d[_0xd279('0xa4')](_0x2d55c7[_0xd279('0xa5')]);});var _0xacc31f=[];var _0x53a5d0=[];_0x59f62b['forEach'](function(_0x4afc81){if(_0x4afc81['@odata.type']){var _0x251947=_0x4afc81[_0xd279('0xa6')][_0xd279('0xa7')](_0x4afc81['@odata.type'][_0xd279('0x98')]('.')+0x1);if(_0x251947===_0xd279('0xa8')){_0xacc31f[_0xd279('0xa9')](getSelectList(_0x500cd7,_0x32219c,_0x53a5d0,_0x33318f[_0xd279('0xa2')],_0x4afc81[_0xd279('0xa2')],_0x5b97ff));}}});return Promise[_0xd279('0xaa')](_0xacc31f);})['then'](function(_0x57f64b){_0xddb8e3=_0x57f64b[0x0];var _0x2a03bd=[];var _0x7ee60=[];_0x59f62b['forEach'](function(_0xfe7851){if(!_[_0xd279('0xab')](_0xfe7851[_0xd279('0xa6')])){var _0x295709=_0xfe7851[_0xd279('0xa6')][_0xd279('0xa7')](_0xfe7851['@odata.type'][_0xd279('0x98')]('.')+0x1);if(_0x295709==='BooleanAttributeMetadata'){_0x2a03bd[_0xd279('0xa9')](getBooleanList(_0x500cd7,_0x32219c,_0x7ee60,_0x33318f[_0xd279('0xa2')],_0xfe7851[_0xd279('0xa2')],_0x5b97ff));}}});return Promise[_0xd279('0xaa')](_0x2a03bd);})[_0xd279('0x24')](function(_0x572171){_0x43f8b8=_0x572171[0x0];var _0x365213=[];var _0xfa401d=[];_0x59f62b[_0xd279('0xac')](function(_0x161afe){if(_0x161afe[_0xd279('0xa6')]){var _0x28a06b=_0x161afe[_0xd279('0xa6')]['substring'](_0x161afe[_0xd279('0xa6')][_0xd279('0x98')]('.')+0x1);if(_0x28a06b==='StringAttributeMetadata'||_0x28a06b==='DoubleAttributeMetadata'||_0x28a06b===_0xd279('0xad')||_0x28a06b==='IntegerAttributeMetadata'||_0x28a06b===_0xd279('0xae')||_0x28a06b==='DateTimeAttributeMetadata'||_0x28a06b===_0xd279('0xaf')||_0x28a06b===_0xd279('0xb0')||_0x28a06b===_0xd279('0xb1')||_0x28a06b===_0xd279('0xb2')){_0x365213[_0xd279('0xa9')](getInputList(_0x500cd7,_0x32219c,_0x28a06b,_0xfa401d,_0x33318f[_0xd279('0xa2')],_0x161afe[_0xd279('0xa2')],_0x5b97ff));}}});return Promise[_0xd279('0xaa')](_0x365213);})['then'](function(_0x21983c){_0x5a8d15=_0x21983c[0x0];var _0x365338=_0xddb8e3[_0xd279('0x90')](_0x43f8b8)[_0xd279('0x90')](_0x5a8d15);var _0x12a443={'count':_0x365338[_0xd279('0x4a')],'rows':_0x365338};return _0x12a443;})[_0xd279('0x24')](respondWithResult(_0x485be9,null))[_0xd279('0x43')](function(_0x4466d3){var _0x2e6f02=_0x19d408['query'][_0xd279('0xb3')]?0x1f4:_0x4466d3[_0xd279('0xb4')]||0x1f4;logger[_0xd279('0x26')](_0x4466d3[_0xd279('0x27')]);delete _0x4466d3[_0xd279('0x28')];if(_0x2e6f02===0x191){_0x2e6f02=0x190;}_0x485be9[_0xd279('0x1c')](_0x2e6f02)[_0xd279('0xb5')](_0x19d408['query']['test']?{'message':_0xd279('0xb6'),'statusCode':_0x4466d3[_0xd279('0xb4')]}:_0x4466d3);});};function getSelectList(_0x4d0c98,_0x59e766,_0x2c31b3,_0x4dd740,_0x4947a2,_0x35d2d3){var _0x49582d={'method':'GET','uri':_0x4d0c98+'EntityDefinitions('+_0x4dd740+_0xd279('0xb7')+_0x4947a2+_0xd279('0xb8')+'$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','headers':{'Authorization':'Bearer\x20'+_0x35d2d3,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x49582d)[_0xd279('0x24')](function(_0x4b521a){var _0x1b6c0d=[];var _0x1521f2=_0x4b521a[_0xd279('0xb9')][_0xd279('0xba')];_0x1521f2['forEach'](function(_0x514891){_0x1b6c0d[_0xd279('0xa9')]({'name':_0x514891[_0xd279('0xbb')][_0xd279('0xbc')][_0xd279('0xbb')],'value':String(_0x514891[_0xd279('0xbd')])});});var _0x3ca053={'id':_0x59e766+'_'+_0x4b521a['LogicalName'],'name':_0x4b521a['DisplayName']['UserLocalizedLabel']['Label'],'custom':![],'options':_0x1b6c0d};_0x2c31b3[_0xd279('0xa9')](_0x3ca053);return _0x2c31b3;});}function getBooleanList(_0x3eb92a,_0x139334,_0x46d0cd,_0x411710,_0x3ad9b4,_0x2aaff2){var _0x17adc0={'method':_0xd279('0xbe'),'uri':_0x3eb92a+_0xd279('0xbf')+_0x411710+')/Attributes('+_0x3ad9b4+')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','headers':{'Authorization':_0xd279('0x9f')+_0x2aaff2,'If-None-Match':null,'OData-Version':_0xd279('0xa0')},'json':!![]};return rp(_0x17adc0)[_0xd279('0x24')](function(_0x17255d){var _0x553d4d=[];_0x553d4d['push']({'name':_0x17255d[_0xd279('0xb9')][_0xd279('0xc0')][_0xd279('0xbb')][_0xd279('0xbc')][_0xd279('0xbb')],'value':_0xd279('0xc1')},{'name':_0x17255d[_0xd279('0xb9')]['FalseOption'][_0xd279('0xbb')]['UserLocalizedLabel'][_0xd279('0xbb')],'value':_0xd279('0xc2')});var _0x38bbbf={'id':_0x139334+'_'+_0x17255d[_0xd279('0xa5')],'name':_0x17255d['DisplayName'][_0xd279('0xbc')]['Label'],'custom':![],'options':_0x553d4d};_0x46d0cd[_0xd279('0xa9')](_0x38bbbf);return _0x46d0cd;});}function getInputList(_0x4a221f,_0x5b3188,_0x1563fc,_0xc82b50,_0x28a7f8,_0x450596,_0x1aec7c){var _0x3e3476={'method':'GET','uri':_0x4a221f+_0xd279('0xbf')+_0x28a7f8+_0xd279('0xb7')+_0x450596+')/Microsoft.Dynamics.CRM.'+_0x1563fc+'?$select=DisplayName,LogicalName','headers':{'Authorization':_0xd279('0x9f')+_0x1aec7c,'If-None-Match':null,'OData-Version':_0xd279('0xa0')},'json':!![]};return rp(_0x3e3476)[_0xd279('0x24')](function(_0x1a0afe){var _0x1e9909={'id':_0x5b3188+'_'+_0x1a0afe[_0xd279('0xa5')],'name':_0x1a0afe['DisplayName'][_0xd279('0xbc')]?_0x1a0afe[_0xd279('0xc3')][_0xd279('0xbc')][_0xd279('0xbb')]:_0x1a0afe[_0xd279('0xa5')],'custom':![],'options':[]};_0xc82b50[_0xd279('0xa9')](_0x1e9909);return _0xc82b50;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index 2ed7662..92b6aec 100644 --- a/server/api/intDynamics365Account/intDynamics365Account.model.js +++ b/server/api/intDynamics365Account/intDynamics365Account.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbaf0=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','util'];(function(_0x1d74b4,_0x5522ae){var _0x245c95=function(_0x511b1a){while(--_0x511b1a){_0x1d74b4['push'](_0x1d74b4['shift']());}};_0x245c95(++_0x5522ae);}(_0xbaf0,0x12a));var _0x0baf=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xbaf0[_0xa464c9];return _0x3d73c4;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));var integrations=require(_0x0baf('0x9'));module[_0x0baf('0xa')]=function(_0x335e24,_0x1a10b1){return _0x335e24[_0x0baf('0xb')](_0x0baf('0xc'),attributes,{'tableName':'int_dynamics365_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0713=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports','define','Dynamics365Account','int_dynamics365_accounts'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var moment=require(_0x3071('0x2'));var BPromise=require(_0x3071('0x3'));var rp=require(_0x3071('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));var attributes=require(_0x3071('0x7'));var integrations=require(_0x3071('0x8'));module[_0x3071('0x9')]=function(_0x41cf76,_0x1d3dd6){return _0x41cf76[_0x3071('0xa')](_0x3071('0xb'),attributes,{'tableName':_0x3071('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.rpc.js b/server/api/intDynamics365Account/intDynamics365Account.rpc.js index 2cf3db5..fe9b0f5 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 _0x4d46=['client','http','request','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetDynamics365Account','Dynamics365Account','findAll','options','raw','attributes','limit','include','map','model','stringify','find','ShowDynamics365Account','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x406519,_0x4b5703){var _0x35d221=function(_0x38f6f1){while(--_0x38f6f1){_0x406519['push'](_0x406519['shift']());}};_0x35d221(++_0x4b5703);}(_0x4d46,0x18d));var _0x64d4=function(_0x455d3b,_0x274d8b){_0x455d3b=_0x455d3b-0x0;var _0x49cb51=_0x4d46[_0x455d3b];return _0x49cb51;};'use strict';var _=require('lodash');var util=require(_0x64d4('0x0'));var moment=require(_0x64d4('0x1'));var BPromise=require(_0x64d4('0x2'));var rs=require(_0x64d4('0x3'));var fs=require('fs');var Redis=require(_0x64d4('0x4'));var db=require(_0x64d4('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x64d4('0x6'))(_0x64d4('0x7'));var config=require(_0x64d4('0x8'));var jayson=require(_0x64d4('0x9'));var client=jayson[_0x64d4('0xa')][_0x64d4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xcbdff2,_0x1d64d7,_0x3fd904){return new BPromise(function(_0x2f2dfc,_0xd8f441){return client[_0x64d4('0xc')](_0xcbdff2,_0x3fd904)[_0x64d4('0xd')](function(_0x34ea5c){logger[_0x64d4('0xe')](_0x64d4('0xf'),_0x1d64d7,_0x64d4('0x10'));logger[_0x64d4('0x11')](_0x64d4('0x12'),_0x1d64d7,_0x64d4('0x10'),JSON['stringify'](_0x34ea5c));if(_0x34ea5c[_0x64d4('0x13')]){if(_0x34ea5c[_0x64d4('0x13')][_0x64d4('0x14')]===0x1f4){logger[_0x64d4('0x13')](_0x64d4('0xf'),_0x1d64d7,_0x34ea5c[_0x64d4('0x13')][_0x64d4('0x15')]);return _0xd8f441(_0x34ea5c[_0x64d4('0x13')][_0x64d4('0x15')]);}logger[_0x64d4('0x13')](_0x64d4('0xf'),_0x1d64d7,_0x34ea5c[_0x64d4('0x13')][_0x64d4('0x15')]);return _0x2f2dfc(_0x34ea5c[_0x64d4('0x13')][_0x64d4('0x15')]);}else{logger['info'](_0x64d4('0xf'),_0x1d64d7,_0x64d4('0x10'));_0x2f2dfc(_0x34ea5c[_0x64d4('0x16')][_0x64d4('0x15')]);}})[_0x64d4('0x17')](function(_0x2e159c){logger['error']('Dynamics365Account,\x20%s,\x20%s',_0x1d64d7,_0x2e159c);_0xd8f441(_0x2e159c);});});}exports[_0x64d4('0x18')]=function(_0x54c829){var _0x23f4cc=this;return new Promise(function(_0x5e4fe1,_0x327392){return db[_0x64d4('0x19')][_0x64d4('0x1a')]({'raw':_0x54c829[_0x64d4('0x1b')]?_0x54c829['options'][_0x64d4('0x1c')]===undefined?!![]:![]:!![],'where':_0x54c829['options']?_0x54c829[_0x64d4('0x1b')]['where']||null:null,'attributes':_0x54c829[_0x64d4('0x1b')]?_0x54c829['options'][_0x64d4('0x1d')]||null:null,'limit':_0x54c829[_0x64d4('0x1b')]?_0x54c829[_0x64d4('0x1b')][_0x64d4('0x1e')]||null:null,'include':_0x54c829[_0x64d4('0x1b')]?_0x54c829['options'][_0x64d4('0x1f')]?_[_0x64d4('0x20')](_0x54c829[_0x64d4('0x1b')][_0x64d4('0x1f')],function(_0x41baf9){return{'model':db[_0x41baf9[_0x64d4('0x21')]],'as':_0x41baf9['as'],'attributes':_0x41baf9['attributes'],'include':_0x41baf9[_0x64d4('0x1f')]?_[_0x64d4('0x20')](_0x41baf9[_0x64d4('0x1f')],function(_0x499697){return{'model':db[_0x499697[_0x64d4('0x21')]],'as':_0x499697['as'],'attributes':_0x499697[_0x64d4('0x1d')],'include':_0x499697[_0x64d4('0x1f')]?_['map'](_0x499697[_0x64d4('0x1f')],function(_0x5a52e8){return{'model':db[_0x5a52e8[_0x64d4('0x21')]],'as':_0x5a52e8['as'],'attributes':_0x5a52e8[_0x64d4('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x64d4('0xd')](function(_0x3097b6){logger[_0x64d4('0xe')]('GetDynamics365Account',_0x54c829);logger['debug'](_0x64d4('0x18'),_0x54c829,JSON[_0x64d4('0x22')](_0x3097b6));_0x5e4fe1(_0x3097b6);})[_0x64d4('0x17')](function(_0x5817e5){logger[_0x64d4('0x13')]('GetDynamics365Account',_0x5817e5[_0x64d4('0x15')],_0x54c829);_0x327392(_0x23f4cc[_0x64d4('0x13')](0x1f4,_0x5817e5[_0x64d4('0x15')]));});});};exports['ShowDynamics365Account']=function(_0x32cb0f){var _0x156d18=this;return new Promise(function(_0x51ebc9,_0x71d4e5){return db['Dynamics365Account'][_0x64d4('0x23')]({'raw':_0x32cb0f['options']?_0x32cb0f[_0x64d4('0x1b')][_0x64d4('0x1c')]===undefined?!![]:![]:!![],'where':_0x32cb0f[_0x64d4('0x1b')]?_0x32cb0f[_0x64d4('0x1b')]['where']||null:null,'attributes':_0x32cb0f[_0x64d4('0x1b')]?_0x32cb0f[_0x64d4('0x1b')]['attributes']||null:null,'include':_0x32cb0f[_0x64d4('0x1b')]?_0x32cb0f[_0x64d4('0x1b')][_0x64d4('0x1f')]?_['map'](_0x32cb0f[_0x64d4('0x1b')][_0x64d4('0x1f')],function(_0x13bd7c){return{'model':db[_0x13bd7c[_0x64d4('0x21')]],'as':_0x13bd7c['as'],'attributes':_0x13bd7c[_0x64d4('0x1d')],'include':_0x13bd7c[_0x64d4('0x1f')]?_[_0x64d4('0x20')](_0x13bd7c['include'],function(_0x422282){return{'model':db[_0x422282[_0x64d4('0x21')]],'as':_0x422282['as'],'attributes':_0x422282[_0x64d4('0x1d')],'include':_0x422282[_0x64d4('0x1f')]?_[_0x64d4('0x20')](_0x422282[_0x64d4('0x1f')],function(_0x4fc502){return{'model':db[_0x4fc502[_0x64d4('0x21')]],'as':_0x4fc502['as'],'attributes':_0x4fc502[_0x64d4('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x64d4('0xd')](function(_0x5af5db){logger[_0x64d4('0xe')]('ShowDynamics365Account',_0x32cb0f);logger[_0x64d4('0x11')](_0x64d4('0x24'),_0x32cb0f,JSON['stringify'](_0x5af5db));_0x51ebc9(_0x5af5db);})[_0x64d4('0x17')](function(_0x533924){logger['error'](_0x64d4('0x24'),_0x533924[_0x64d4('0x15')],_0x32cb0f);_0x71d4e5(_0x156d18[_0x64d4('0x13')](0x1f4,_0x533924[_0x64d4('0x15')]));});});}; \ No newline at end of file +var _0x9625=['then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetDynamics365Account','Dynamics365Account','findAll','options','where','limit','include','model','attributes','map','raw','ShowDynamics365Account','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','client','http','request'];(function(_0x23b792,_0x1312bd){var _0x2378bb=function(_0x57a4d0){while(--_0x57a4d0){_0x23b792['push'](_0x23b792['shift']());}};_0x2378bb(++_0x1312bd);}(_0x9625,0x81));var _0x5962=function(_0x2cc6d2,_0x5a818f){_0x2cc6d2=_0x2cc6d2-0x0;var _0x214fcb=_0x9625[_0x2cc6d2];return _0x214fcb;};'use strict';var _=require(_0x5962('0x0'));var util=require(_0x5962('0x1'));var moment=require(_0x5962('0x2'));var BPromise=require(_0x5962('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5962('0x4'));var db=require(_0x5962('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5962('0x6'));var config=require(_0x5962('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x5962('0x8')][_0x5962('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x33f8f5,_0x148e98,_0x6b9c8b){return new BPromise(function(_0x11e1f0,_0x3c5c30){return client[_0x5962('0xa')](_0x33f8f5,_0x6b9c8b)[_0x5962('0xb')](function(_0x444d35){logger[_0x5962('0xc')](_0x5962('0xd'),_0x148e98,_0x5962('0xe'));logger[_0x5962('0xf')](_0x5962('0x10'),_0x148e98,'request\x20sent',JSON[_0x5962('0x11')](_0x444d35));if(_0x444d35[_0x5962('0x12')]){if(_0x444d35['error'][_0x5962('0x13')]===0x1f4){logger[_0x5962('0x12')](_0x5962('0xd'),_0x148e98,_0x444d35[_0x5962('0x12')][_0x5962('0x14')]);return _0x3c5c30(_0x444d35[_0x5962('0x12')][_0x5962('0x14')]);}logger[_0x5962('0x12')](_0x5962('0xd'),_0x148e98,_0x444d35[_0x5962('0x12')]['message']);return _0x11e1f0(_0x444d35[_0x5962('0x12')][_0x5962('0x14')]);}else{logger['info'](_0x5962('0xd'),_0x148e98,_0x5962('0xe'));_0x11e1f0(_0x444d35[_0x5962('0x15')]['message']);}})[_0x5962('0x16')](function(_0x21ce39){logger[_0x5962('0x12')](_0x5962('0xd'),_0x148e98,_0x21ce39);_0x3c5c30(_0x21ce39);});});}exports[_0x5962('0x17')]=function(_0x3f9601){var _0x1c9d73=this;return new Promise(function(_0x455f2f,_0x533220){return db[_0x5962('0x18')][_0x5962('0x19')]({'raw':_0x3f9601[_0x5962('0x1a')]?_0x3f9601[_0x5962('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x3f9601[_0x5962('0x1a')]?_0x3f9601[_0x5962('0x1a')][_0x5962('0x1b')]||null:null,'attributes':_0x3f9601[_0x5962('0x1a')]?_0x3f9601[_0x5962('0x1a')]['attributes']||null:null,'limit':_0x3f9601[_0x5962('0x1a')]?_0x3f9601[_0x5962('0x1a')][_0x5962('0x1c')]||null:null,'include':_0x3f9601[_0x5962('0x1a')]?_0x3f9601[_0x5962('0x1a')][_0x5962('0x1d')]?_['map'](_0x3f9601[_0x5962('0x1a')]['include'],function(_0x24cde3){return{'model':db[_0x24cde3[_0x5962('0x1e')]],'as':_0x24cde3['as'],'attributes':_0x24cde3[_0x5962('0x1f')],'include':_0x24cde3['include']?_[_0x5962('0x20')](_0x24cde3['include'],function(_0x2d313f){return{'model':db[_0x2d313f[_0x5962('0x1e')]],'as':_0x2d313f['as'],'attributes':_0x2d313f[_0x5962('0x1f')],'include':_0x2d313f['include']?_[_0x5962('0x20')](_0x2d313f[_0x5962('0x1d')],function(_0x477e38){return{'model':db[_0x477e38[_0x5962('0x1e')]],'as':_0x477e38['as'],'attributes':_0x477e38[_0x5962('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x5962('0xb')](function(_0x81252b){logger[_0x5962('0xc')](_0x5962('0x17'),_0x3f9601);logger[_0x5962('0xf')]('GetDynamics365Account',_0x3f9601,JSON[_0x5962('0x11')](_0x81252b));_0x455f2f(_0x81252b);})[_0x5962('0x16')](function(_0x66c661){logger[_0x5962('0x12')](_0x5962('0x17'),_0x66c661[_0x5962('0x14')],_0x3f9601);_0x533220(_0x1c9d73['error'](0x1f4,_0x66c661[_0x5962('0x14')]));});});};exports['ShowDynamics365Account']=function(_0x1225aa){var _0x572977=this;return new Promise(function(_0x4abbd7,_0x2327a0){return db['Dynamics365Account']['find']({'raw':_0x1225aa[_0x5962('0x1a')]?_0x1225aa[_0x5962('0x1a')][_0x5962('0x21')]===undefined?!![]:![]:!![],'where':_0x1225aa[_0x5962('0x1a')]?_0x1225aa[_0x5962('0x1a')]['where']||null:null,'attributes':_0x1225aa[_0x5962('0x1a')]?_0x1225aa[_0x5962('0x1a')][_0x5962('0x1f')]||null:null,'include':_0x1225aa['options']?_0x1225aa[_0x5962('0x1a')]['include']?_[_0x5962('0x20')](_0x1225aa[_0x5962('0x1a')]['include'],function(_0x306fce){return{'model':db[_0x306fce[_0x5962('0x1e')]],'as':_0x306fce['as'],'attributes':_0x306fce[_0x5962('0x1f')],'include':_0x306fce[_0x5962('0x1d')]?_['map'](_0x306fce[_0x5962('0x1d')],function(_0x4e09f5){return{'model':db[_0x4e09f5[_0x5962('0x1e')]],'as':_0x4e09f5['as'],'attributes':_0x4e09f5[_0x5962('0x1f')],'include':_0x4e09f5[_0x5962('0x1d')]?_['map'](_0x4e09f5[_0x5962('0x1d')],function(_0x15e8d8){return{'model':db[_0x15e8d8[_0x5962('0x1e')]],'as':_0x15e8d8['as'],'attributes':_0x15e8d8['attributes']};}):[]};}):[]};}):[]:[]})[_0x5962('0xb')](function(_0x3493fa){logger[_0x5962('0xc')](_0x5962('0x22'),_0x1225aa);logger[_0x5962('0xf')]('ShowDynamics365Account',_0x1225aa,JSON[_0x5962('0x11')](_0x3493fa));_0x4abbd7(_0x3493fa);})[_0x5962('0x16')](function(_0x5ccc45){logger[_0x5962('0x12')](_0x5962('0x22'),_0x5ccc45[_0x5962('0x14')],_0x1225aa);_0x2327a0(_0x572977['error'](0x1f4,_0x5ccc45[_0x5962('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index 55d4853..b79f03d 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 _0xcf3d=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','get','isAuthenticated','show','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','create','/:id','update','delete','destroy','multer','util','path','connect-timeout'];(function(_0x21090b,_0x39dd3b){var _0x3c68d7=function(_0x28ecd4){while(--_0x28ecd4){_0x21090b['push'](_0x21090b['shift']());}};_0x3c68d7(++_0x39dd3b);}(_0xcf3d,0x19e));var _0xdcf3=function(_0x4ee75d,_0x4f8071){_0x4ee75d=_0x4ee75d-0x0;var _0x50de26=_0xcf3d[_0x4ee75d];return _0x50de26;};'use strict';var multer=require(_0xdcf3('0x0'));var util=require(_0xdcf3('0x1'));var path=require(_0xdcf3('0x2'));var timeout=require(_0xdcf3('0x3'));var express=require('express');var router=express[_0xdcf3('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xdcf3('0x5'));var interaction=require(_0xdcf3('0x6'));var config=require(_0xdcf3('0x7'));var controller=require(_0xdcf3('0x8'));router[_0xdcf3('0x9')]('/',auth[_0xdcf3('0xa')](),controller['index']);router[_0xdcf3('0x9')]('/:id',auth[_0xdcf3('0xa')](),controller[_0xdcf3('0xb')]);router['get']('/:id/fields',auth['isAuthenticated'](),controller[_0xdcf3('0xc')]);router[_0xdcf3('0x9')](_0xdcf3('0xd'),auth[_0xdcf3('0xa')](),controller[_0xdcf3('0xe')]);router[_0xdcf3('0x9')](_0xdcf3('0xf'),auth[_0xdcf3('0xa')](),controller[_0xdcf3('0x10')]);router['post']('/',auth[_0xdcf3('0xa')](),controller[_0xdcf3('0x11')]);router['put'](_0xdcf3('0x12'),auth[_0xdcf3('0xa')](),controller[_0xdcf3('0x13')]);router[_0xdcf3('0x14')]('/:id',auth[_0xdcf3('0xa')](),controller[_0xdcf3('0x15')]);module['exports']=router; \ No newline at end of file +var _0xf5e2=['create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post'];(function(_0x1992f1,_0x5c61f0){var _0x413dfe=function(_0x2136e5){while(--_0x2136e5){_0x1992f1['push'](_0x1992f1['shift']());}};_0x413dfe(++_0x5c61f0);}(_0xf5e2,0xa7));var _0x2f5e=function(_0x1c71a7,_0x367542){_0x1c71a7=_0x1c71a7-0x0;var _0x388805=_0xf5e2[_0x1c71a7];return _0x388805;};'use strict';var multer=require(_0x2f5e('0x0'));var util=require(_0x2f5e('0x1'));var path=require(_0x2f5e('0x2'));var timeout=require(_0x2f5e('0x3'));var express=require(_0x2f5e('0x4'));var router=express['Router']();var fs_extra=require(_0x2f5e('0x5'));var auth=require(_0x2f5e('0x6'));var interaction=require(_0x2f5e('0x7'));var config=require(_0x2f5e('0x8'));var controller=require(_0x2f5e('0x9'));router[_0x2f5e('0xa')]('/',auth[_0x2f5e('0xb')](),controller[_0x2f5e('0xc')]);router[_0x2f5e('0xa')](_0x2f5e('0xd'),auth[_0x2f5e('0xb')](),controller[_0x2f5e('0xe')]);router[_0x2f5e('0xa')](_0x2f5e('0xf'),auth['isAuthenticated'](),controller[_0x2f5e('0x10')]);router[_0x2f5e('0xa')](_0x2f5e('0x11'),auth['isAuthenticated'](),controller[_0x2f5e('0x12')]);router[_0x2f5e('0xa')](_0x2f5e('0x13'),auth[_0x2f5e('0xb')](),controller[_0x2f5e('0x14')]);router[_0x2f5e('0x15')]('/',auth[_0x2f5e('0xb')](),controller[_0x2f5e('0x16')]);router['put'](_0x2f5e('0xd'),auth['isAuthenticated'](),controller[_0x2f5e('0x17')]);router[_0x2f5e('0x18')](_0x2f5e('0xd'),auth[_0x2f5e('0xb')](),controller[_0x2f5e('0x19')]);module[_0x2f5e('0x1a')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index 19037c1..fcfb71a 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 _0x32d8=['incident','phonecall','sequelize','exports','STRING','ENUM'];(function(_0x31ecd2,_0x39b17d){var _0x5ef9f2=function(_0x4478b6){while(--_0x4478b6){_0x31ecd2['push'](_0x31ecd2['shift']());}};_0x5ef9f2(++_0x39b17d);}(_0x32d8,0x19a));var _0x832d=function(_0x44d34f,_0x4f98f9){_0x44d34f=_0x44d34f-0x0;var _0x2eb329=_0x32d8[_0x44d34f];return _0x2eb329;};'use strict';var Sequelize=require(_0x832d('0x0'));module[_0x832d('0x1')]={'name':{'type':Sequelize[_0x832d('0x2')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0x832d('0x3')](_0x832d('0x4'),_0x832d('0x5')),'defaultValue':'incident'}}; \ No newline at end of file +var _0x7621=['ENUM','incident','STRING'];(function(_0x3da67b,_0x6584){var _0x2d2e44=function(_0x1adb50){while(--_0x1adb50){_0x3da67b['push'](_0x3da67b['shift']());}};_0x2d2e44(++_0x6584);}(_0x7621,0x7a));var _0x1762=function(_0x1a2efa,_0x3e7401){_0x1a2efa=_0x1a2efa-0x0;var _0x29f101=_0x7621[_0x1a2efa];return _0x29f101;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x1762('0x0')]},'description':{'type':Sequelize[_0x1762('0x0')]},'ticketType':{'type':Sequelize[_0x1762('0x1')](_0x1762('0x2'),'phonecall'),'defaultValue':_0x1762('0x2')}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index c7f943d..5c11313 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 _0x23ab=['filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','Dynamics365Configuration','includeAll','include','findAll','rows','params','rawAttributes','find','catch','create','body','getFields','findOne','Dynamics365Field','order','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','offset','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','fieldName','type','key','model','map','query','keys'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x23ab,0x167));var _0xb23a=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x23ab[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0xb23a('0x0'));var rimraf=require(_0xb23a('0x1'));var zipdir=require(_0xb23a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xb23a('0x3'));var BPromise=require(_0xb23a('0x4'));var Mustache=require(_0xb23a('0x5'));var util=require(_0xb23a('0x6'));var path=require(_0xb23a('0x7'));var sox=require(_0xb23a('0x8'));var csv=require(_0xb23a('0x9'));var ejs=require(_0xb23a('0xa'));var fs=require('fs');var fs_extra=require(_0xb23a('0xb'));var _=require(_0xb23a('0xc'));var squel=require(_0xb23a('0xd'));var crypto=require(_0xb23a('0xe'));var jsforce=require(_0xb23a('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xb23a('0x9'));var querystring=require(_0xb23a('0x10'));var Papa=require('papaparse');var Redis=require(_0xb23a('0x11'));var authService=require(_0xb23a('0x12'));var qs=require(_0xb23a('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb23a('0x14'));var logger=require('../../config/logger')(_0xb23a('0x15'));var utils=require(_0xb23a('0x16'));var config=require(_0xb23a('0x17'));var licenseUtil=require(_0xb23a('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3d8e57,_0x17fe58){_0x17fe58=_0x17fe58||0xcc;return function(_0x503827){if(_0x503827){return _0x3d8e57[_0xb23a('0x19')](_0x17fe58);}return _0x3d8e57['status'](_0x17fe58)['end']();};}function respondWithResult(_0x5d9e22,_0x23d9f8){_0x23d9f8=_0x23d9f8||0xc8;return function(_0x45e555){if(_0x45e555){return _0x5d9e22[_0xb23a('0x1a')](_0x23d9f8)['json'](_0x45e555);}};}function respondWithFilteredResult(_0x358f25,_0x2ed6ab){return function(_0x1f43da){if(_0x1f43da){var _0x55f0d4=typeof _0x2ed6ab[_0xb23a('0x1b')]==='undefined'&&typeof _0x2ed6ab[_0xb23a('0x1c')]==='undefined';var _0x3112b2=_0x1f43da[_0xb23a('0x1d')];var _0x411a2d=_0x55f0d4?0x0:_0x2ed6ab[_0xb23a('0x1b')];var _0x341dd6=_0x55f0d4?_0x1f43da[_0xb23a('0x1d')]:_0x2ed6ab[_0xb23a('0x1b')]+_0x2ed6ab[_0xb23a('0x1c')];var _0x285769;if(_0x341dd6>=_0x3112b2){_0x341dd6=_0x3112b2;_0x285769=0xc8;}else{_0x285769=0xce;}_0x358f25[_0xb23a('0x1a')](_0x285769);return _0x358f25[_0xb23a('0x1e')](_0xb23a('0x1f'),_0x411a2d+'-'+_0x341dd6+'/'+_0x3112b2)['json'](_0x1f43da);}return null;};}function patchUpdates(_0x36422a){return function(_0x33e7bb){try{jsonpatch[_0xb23a('0x20')](_0x33e7bb,_0x36422a,!![]);}catch(_0x77d111){return BPromise[_0xb23a('0x21')](_0x77d111);}return _0x33e7bb[_0xb23a('0x22')]();};}function saveUpdates(_0x1ee94f,_0x2b3094){return function(_0x26d42a){if(_0x26d42a){return _0x26d42a[_0xb23a('0x23')](_0x1ee94f)[_0xb23a('0x24')](function(_0xbec222){return _0xbec222;});}return null;};}function removeEntity(_0x26d6de,_0x3b011f){return function(_0x1687a3){if(_0x1687a3){return _0x1687a3[_0xb23a('0x25')]()[_0xb23a('0x24')](function(){_0x26d6de[_0xb23a('0x1a')](0xcc)[_0xb23a('0x26')]();});}};}function handleEntityNotFound(_0x5becd0,_0xafb539){return function(_0x2ec365){if(!_0x2ec365){_0x5becd0[_0xb23a('0x19')](0x194);}return _0x2ec365;};}function handleError(_0x121b3f,_0x17ff81){_0x17ff81=_0x17ff81||0x1f4;return function(_0x594716){logger[_0xb23a('0x27')](_0x594716[_0xb23a('0x28')]);if(_0x594716[_0xb23a('0x29')]){delete _0x594716[_0xb23a('0x29')];}_0x121b3f['status'](_0x17ff81)[_0xb23a('0x2a')](_0x594716);};}exports[_0xb23a('0x2b')]=function(_0x4aa981,_0x394b0a){var _0x3f45b7={},_0x2fb44e={},_0x38f9dc={'count':0x0,'rows':[]};var _0x118c4f=_['map'](db['Dynamics365Configuration']['rawAttributes'],function(_0x86627e){return{'name':_0x86627e[_0xb23a('0x2c')],'type':_0x86627e[_0xb23a('0x2d')][_0xb23a('0x2e')]};});_0x2fb44e[_0xb23a('0x2f')]=_[_0xb23a('0x30')](_0x118c4f,_0xb23a('0x29'));_0x2fb44e[_0xb23a('0x31')]=_[_0xb23a('0x32')](_0x4aa981[_0xb23a('0x31')]);_0x2fb44e[_0xb23a('0x33')]=_[_0xb23a('0x34')](_0x2fb44e[_0xb23a('0x2f')],_0x2fb44e['query']);_0x3f45b7[_0xb23a('0x35')]=_[_0xb23a('0x34')](_0x2fb44e['model'],qs[_0xb23a('0x36')](_0x4aa981[_0xb23a('0x31')]['fields']));_0x3f45b7[_0xb23a('0x35')]=_0x3f45b7[_0xb23a('0x35')][_0xb23a('0x37')]?_0x3f45b7[_0xb23a('0x35')]:_0x2fb44e[_0xb23a('0x2f')];if(!_0x4aa981[_0xb23a('0x31')][_0xb23a('0x38')](_0xb23a('0x39'))){_0x3f45b7[_0xb23a('0x1c')]=qs['limit'](_0x4aa981['query'][_0xb23a('0x1c')]);_0x3f45b7[_0xb23a('0x1b')]=qs[_0xb23a('0x1b')](_0x4aa981['query'][_0xb23a('0x1b')]);}_0x3f45b7['order']=qs['sort'](_0x4aa981[_0xb23a('0x31')][_0xb23a('0x3a')]);_0x3f45b7['where']=qs[_0xb23a('0x33')](_[_0xb23a('0x3b')](_0x4aa981[_0xb23a('0x31')],_0x2fb44e[_0xb23a('0x33')]),_0x118c4f);if(_0x4aa981['query'][_0xb23a('0x3c')]){_0x3f45b7[_0xb23a('0x3d')]=_[_0xb23a('0x3e')](_0x3f45b7[_0xb23a('0x3d')],{'$or':_[_0xb23a('0x30')](_0x118c4f,function(_0x21ecfb){if(_0x21ecfb[_0xb23a('0x2d')]!==_0xb23a('0x3f')){var _0x2a2c10={};_0x2a2c10[_0x21ecfb[_0xb23a('0x29')]]={'$like':'%'+_0x4aa981[_0xb23a('0x31')][_0xb23a('0x3c')]+'%'};return _0x2a2c10;}})});}_0x3f45b7=_[_0xb23a('0x3e')]({},_0x3f45b7,_0x4aa981[_0xb23a('0x40')]);var _0xe3dd62={'where':_0x3f45b7[_0xb23a('0x3d')]};return db[_0xb23a('0x41')][_0xb23a('0x1d')](_0xe3dd62)[_0xb23a('0x24')](function(_0x1cc941){_0x38f9dc[_0xb23a('0x1d')]=_0x1cc941;if(_0x4aa981[_0xb23a('0x31')][_0xb23a('0x42')]){_0x3f45b7[_0xb23a('0x43')]=[{'all':!![]}];}return db['Dynamics365Configuration'][_0xb23a('0x44')](_0x3f45b7);})[_0xb23a('0x24')](function(_0x27e9eb){_0x38f9dc[_0xb23a('0x45')]=_0x27e9eb;return _0x38f9dc;})[_0xb23a('0x24')](respondWithFilteredResult(_0x394b0a,_0x3f45b7))['catch'](handleError(_0x394b0a,null));};exports['show']=function(_0x55d0f2,_0x538c05){var _0x57fc7a={'raw':![],'where':{'id':_0x55d0f2[_0xb23a('0x46')]['id']}},_0x35e6d4={};_0x35e6d4[_0xb23a('0x2f')]=_[_0xb23a('0x32')](db[_0xb23a('0x41')][_0xb23a('0x47')]);_0x35e6d4[_0xb23a('0x31')]=_[_0xb23a('0x32')](_0x55d0f2[_0xb23a('0x31')]);_0x35e6d4[_0xb23a('0x33')]=_[_0xb23a('0x34')](_0x35e6d4[_0xb23a('0x2f')],_0x35e6d4['query']);_0x57fc7a[_0xb23a('0x35')]=_['intersection'](_0x35e6d4[_0xb23a('0x2f')],qs[_0xb23a('0x36')](_0x55d0f2[_0xb23a('0x31')][_0xb23a('0x36')]));_0x57fc7a['attributes']=_0x57fc7a[_0xb23a('0x35')][_0xb23a('0x37')]?_0x57fc7a['attributes']:_0x35e6d4['model'];if(_0x55d0f2[_0xb23a('0x31')][_0xb23a('0x42')]){_0x57fc7a[_0xb23a('0x43')]=[{'all':!![]}];}_0x57fc7a=_[_0xb23a('0x3e')]({},_0x57fc7a,_0x55d0f2[_0xb23a('0x40')]);return db[_0xb23a('0x41')][_0xb23a('0x48')](_0x57fc7a)[_0xb23a('0x24')](handleEntityNotFound(_0x538c05,null))['then'](respondWithResult(_0x538c05,null))[_0xb23a('0x49')](handleError(_0x538c05,null));};exports[_0xb23a('0x4a')]=function(_0x9d897,_0x3b8d19){return db[_0xb23a('0x41')][_0xb23a('0x4a')](_0x9d897['body'],{})['then'](respondWithResult(_0x3b8d19,0xc9))[_0xb23a('0x49')](handleError(_0x3b8d19,null));};exports[_0xb23a('0x23')]=function(_0x118df3,_0xaf4438){if(_0x118df3[_0xb23a('0x4b')]['id']){delete _0x118df3[_0xb23a('0x4b')]['id'];}return db[_0xb23a('0x41')][_0xb23a('0x48')]({'where':{'id':_0x118df3[_0xb23a('0x46')]['id']}})[_0xb23a('0x24')](handleEntityNotFound(_0xaf4438,null))['then'](saveUpdates(_0x118df3[_0xb23a('0x4b')],null))[_0xb23a('0x24')](respondWithResult(_0xaf4438,null))[_0xb23a('0x49')](handleError(_0xaf4438,null));};exports[_0xb23a('0x25')]=function(_0x4e8131,_0xdf5a93){return db['Dynamics365Configuration']['find']({'where':{'id':_0x4e8131[_0xb23a('0x46')]['id']}})[_0xb23a('0x24')](handleEntityNotFound(_0xdf5a93,null))[_0xb23a('0x24')](removeEntity(_0xdf5a93,null))['catch'](handleError(_0xdf5a93,null));};exports[_0xb23a('0x4c')]=function(_0x2ad74e,_0xd3c8a6,_0x37da80){var _0x296938={};var _0x5749b3={};var _0xd417af;var _0x238eb6;return db[_0xb23a('0x41')][_0xb23a('0x4d')]({'where':{'id':_0x2ad74e[_0xb23a('0x46')]['id']}})['then'](handleEntityNotFound(_0xd3c8a6,null))[_0xb23a('0x24')](function(_0x5581d4){if(_0x5581d4){_0xd417af=_0x5581d4;_0x5749b3[_0xb23a('0x2f')]=_[_0xb23a('0x32')](db[_0xb23a('0x4e')][_0xb23a('0x47')]);_0x5749b3['query']=_[_0xb23a('0x32')](_0x2ad74e[_0xb23a('0x31')]);_0x5749b3[_0xb23a('0x33')]=_[_0xb23a('0x34')](_0x5749b3[_0xb23a('0x2f')],_0x5749b3[_0xb23a('0x31')]);_0x296938[_0xb23a('0x35')]=_[_0xb23a('0x34')](_0x5749b3['model'],qs['fields'](_0x2ad74e[_0xb23a('0x31')][_0xb23a('0x36')]));_0x296938[_0xb23a('0x35')]=_0x296938['attributes']['length']?_0x296938[_0xb23a('0x35')]:_0x5749b3[_0xb23a('0x2f')];_0x296938[_0xb23a('0x4f')]=qs['sort'](_0x2ad74e[_0xb23a('0x31')][_0xb23a('0x3a')]);_0x296938['where']=qs[_0xb23a('0x33')](_['pick'](_0x2ad74e[_0xb23a('0x31')],_0x5749b3[_0xb23a('0x33')]));if(_0x2ad74e['query'][_0xb23a('0x3c')]){_0x296938['where']=_[_0xb23a('0x3e')](_0x296938[_0xb23a('0x3d')],{'$or':_['map'](_0x296938[_0xb23a('0x35')],function(_0x226fd9){var _0x1aff86={};_0x1aff86[_0x226fd9]={'$like':'%'+_0x2ad74e[_0xb23a('0x31')][_0xb23a('0x3c')]+'%'};return _0x1aff86;})});}_0x296938=_[_0xb23a('0x3e')]({},_0x296938,_0x2ad74e[_0xb23a('0x40')]);return _0xd417af[_0xb23a('0x4c')](_0x296938);}})[_0xb23a('0x24')](function(_0x5bd5df){if(_0x5bd5df){_0x238eb6=_0x5bd5df[_0xb23a('0x37')];if(!_0x2ad74e[_0xb23a('0x31')][_0xb23a('0x38')](_0xb23a('0x39'))){_0x296938[_0xb23a('0x1c')]=qs[_0xb23a('0x1c')](_0x2ad74e[_0xb23a('0x31')][_0xb23a('0x1c')]);_0x296938['offset']=qs[_0xb23a('0x1b')](_0x2ad74e['query']['offset']);}return _0xd417af[_0xb23a('0x4c')](_0x296938);}})[_0xb23a('0x24')](function(_0x324047){if(_0x324047){return _0x324047?{'count':_0x238eb6,'rows':_0x324047}:null;}})[_0xb23a('0x24')](respondWithResult(_0xd3c8a6,null))['catch'](handleError(_0xd3c8a6,null));};exports[_0xb23a('0x50')]=function(_0x52bb72,_0x5444b8,_0x2d20e2){var _0x1e2c89={};var _0x12cac2={};var _0x56b9a0;var _0x1aca99;return db['Dynamics365Configuration']['findOne']({'where':{'id':_0x52bb72[_0xb23a('0x46')]['id']}})[_0xb23a('0x24')](handleEntityNotFound(_0x5444b8,null))[_0xb23a('0x24')](function(_0x4e2a7f){if(_0x4e2a7f){_0x56b9a0=_0x4e2a7f;_0x12cac2['model']=_[_0xb23a('0x32')](db[_0xb23a('0x4e')][_0xb23a('0x47')]);_0x12cac2[_0xb23a('0x31')]=_['keys'](_0x52bb72[_0xb23a('0x31')]);_0x12cac2[_0xb23a('0x33')]=_['intersection'](_0x12cac2['model'],_0x12cac2['query']);_0x1e2c89[_0xb23a('0x35')]=_[_0xb23a('0x34')](_0x12cac2[_0xb23a('0x2f')],qs[_0xb23a('0x36')](_0x52bb72[_0xb23a('0x31')]['fields']));_0x1e2c89[_0xb23a('0x35')]=_0x1e2c89[_0xb23a('0x35')][_0xb23a('0x37')]?_0x1e2c89[_0xb23a('0x35')]:_0x12cac2[_0xb23a('0x2f')];_0x1e2c89['order']=qs[_0xb23a('0x3a')](_0x52bb72['query']['sort']);_0x1e2c89[_0xb23a('0x3d')]=qs[_0xb23a('0x33')](_[_0xb23a('0x3b')](_0x52bb72[_0xb23a('0x31')],_0x12cac2['filters']));if(_0x52bb72[_0xb23a('0x31')][_0xb23a('0x3c')]){_0x1e2c89[_0xb23a('0x3d')]=_[_0xb23a('0x3e')](_0x1e2c89[_0xb23a('0x3d')],{'$or':_[_0xb23a('0x30')](_0x1e2c89[_0xb23a('0x35')],function(_0x5e9c0a){var _0x3878cb={};_0x3878cb[_0x5e9c0a]={'$like':'%'+_0x52bb72[_0xb23a('0x31')][_0xb23a('0x3c')]+'%'};return _0x3878cb;})});}_0x1e2c89=_[_0xb23a('0x3e')]({},_0x1e2c89,_0x52bb72['options']);return _0x56b9a0[_0xb23a('0x50')](_0x1e2c89);}})[_0xb23a('0x24')](function(_0x32e9f8){if(_0x32e9f8){_0x1aca99=_0x32e9f8[_0xb23a('0x37')];if(!_0x52bb72[_0xb23a('0x31')][_0xb23a('0x38')]('nolimit')){_0x1e2c89[_0xb23a('0x1c')]=qs[_0xb23a('0x1c')](_0x52bb72[_0xb23a('0x31')][_0xb23a('0x1c')]);_0x1e2c89['offset']=qs[_0xb23a('0x1b')](_0x52bb72['query'][_0xb23a('0x1b')]);}return _0x56b9a0[_0xb23a('0x50')](_0x1e2c89);}})[_0xb23a('0x24')](function(_0x32619b){if(_0x32619b){return _0x32619b?{'count':_0x1aca99,'rows':_0x32619b}:null;}})['then'](respondWithResult(_0x5444b8,null))['catch'](handleError(_0x5444b8,null));};exports[_0xb23a('0x51')]=function(_0x3badf5,_0x59a30e,_0x20c3b7){var _0x2622db={};var _0x1ee597={};var _0x19b2c8;var _0x5562ae;return db[_0xb23a('0x41')][_0xb23a('0x4d')]({'where':{'id':_0x3badf5[_0xb23a('0x46')]['id']}})[_0xb23a('0x24')](handleEntityNotFound(_0x59a30e,null))[_0xb23a('0x24')](function(_0x23801c){if(_0x23801c){_0x19b2c8=_0x23801c;_0x1ee597[_0xb23a('0x2f')]=_[_0xb23a('0x32')](db[_0xb23a('0x4e')][_0xb23a('0x47')]);_0x1ee597['query']=_[_0xb23a('0x32')](_0x3badf5['query']);_0x1ee597[_0xb23a('0x33')]=_['intersection'](_0x1ee597[_0xb23a('0x2f')],_0x1ee597[_0xb23a('0x31')]);_0x2622db['attributes']=_[_0xb23a('0x34')](_0x1ee597['model'],qs[_0xb23a('0x36')](_0x3badf5['query'][_0xb23a('0x36')]));_0x2622db[_0xb23a('0x35')]=_0x2622db[_0xb23a('0x35')][_0xb23a('0x37')]?_0x2622db[_0xb23a('0x35')]:_0x1ee597[_0xb23a('0x2f')];_0x2622db[_0xb23a('0x4f')]=qs[_0xb23a('0x3a')](_0x3badf5['query'][_0xb23a('0x3a')]);_0x2622db[_0xb23a('0x3d')]=qs[_0xb23a('0x33')](_[_0xb23a('0x3b')](_0x3badf5[_0xb23a('0x31')],_0x1ee597[_0xb23a('0x33')]));if(_0x3badf5[_0xb23a('0x31')]['filter']){_0x2622db['where']=_[_0xb23a('0x3e')](_0x2622db[_0xb23a('0x3d')],{'$or':_[_0xb23a('0x30')](_0x2622db[_0xb23a('0x35')],function(_0x57b797){var _0x41e94b={};_0x41e94b[_0x57b797]={'$like':'%'+_0x3badf5['query']['filter']+'%'};return _0x41e94b;})});}_0x2622db=_[_0xb23a('0x3e')]({},_0x2622db,_0x3badf5[_0xb23a('0x40')]);return _0x19b2c8['getDescriptions'](_0x2622db);}})[_0xb23a('0x24')](function(_0xee0426){if(_0xee0426){_0x5562ae=_0xee0426[_0xb23a('0x37')];if(!_0x3badf5['query'][_0xb23a('0x38')](_0xb23a('0x39'))){_0x2622db['limit']=qs[_0xb23a('0x1c')](_0x3badf5[_0xb23a('0x31')][_0xb23a('0x1c')]);_0x2622db[_0xb23a('0x1b')]=qs['offset'](_0x3badf5[_0xb23a('0x31')][_0xb23a('0x1b')]);}return _0x19b2c8[_0xb23a('0x51')](_0x2622db);}})[_0xb23a('0x24')](function(_0x2fe2fb){if(_0x2fe2fb){return _0x2fe2fb?{'count':_0x5562ae,'rows':_0x2fe2fb}:null;}})[_0xb23a('0x24')](respondWithResult(_0x59a30e,null))['catch'](handleError(_0x59a30e,null));}; \ No newline at end of file +var _0x4da5=['type','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','find','create','body','getFields','findOne','params','Dynamics365Field','hasOwnProperty','getSubjects','nolimit','getDescriptions','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','lodash','squel','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','end','json','offset','undefined','count','limit','status','set','apply','reject','save','update','then','destroy','error','stack','name','send','map','Dynamics365Configuration','rawAttributes','fieldName'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x4da5,0x119));var _0x54da=function(_0x439680,_0x5a47e8){_0x439680=_0x439680-0x0;var _0x29ad61=_0x4da5[_0x439680];return _0x29ad61;};'use strict';var emlformat=require(_0x54da('0x0'));var rimraf=require(_0x54da('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x54da('0x2'));var rp=require(_0x54da('0x3'));var moment=require('moment');var BPromise=require(_0x54da('0x4'));var Mustache=require('mustache');var util=require(_0x54da('0x5'));var path=require(_0x54da('0x6'));var sox=require(_0x54da('0x7'));var csv=require(_0x54da('0x8'));var ejs=require(_0x54da('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x54da('0xa'));var squel=require(_0x54da('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x54da('0xc'));var toCsv=require(_0x54da('0x8'));var querystring=require(_0x54da('0xd'));var Papa=require(_0x54da('0xe'));var Redis=require('ioredis');var authService=require(_0x54da('0xf'));var qs=require(_0x54da('0x10'));var as=require(_0x54da('0x11'));var hardwareService=require(_0x54da('0x12'));var logger=require(_0x54da('0x13'))(_0x54da('0x14'));var utils=require(_0x54da('0x15'));var config=require(_0x54da('0x16'));var licenseUtil=require(_0x54da('0x17'));var db=require(_0x54da('0x18'))['db'];function respondWithStatusCode(_0x23433d,_0x3d31fd){_0x3d31fd=_0x3d31fd||0xcc;return function(_0x1133d0){if(_0x1133d0){return _0x23433d['sendStatus'](_0x3d31fd);}return _0x23433d['status'](_0x3d31fd)[_0x54da('0x19')]();};}function respondWithResult(_0x14c10c,_0x4a7611){_0x4a7611=_0x4a7611||0xc8;return function(_0x3289c3){if(_0x3289c3){return _0x14c10c['status'](_0x4a7611)[_0x54da('0x1a')](_0x3289c3);}};}function respondWithFilteredResult(_0x56c16d,_0x377157){return function(_0x5c1a29){if(_0x5c1a29){var _0x3d297f=typeof _0x377157[_0x54da('0x1b')]===_0x54da('0x1c')&&typeof _0x377157['limit']===_0x54da('0x1c');var _0x550b64=_0x5c1a29[_0x54da('0x1d')];var _0x11363f=_0x3d297f?0x0:_0x377157['offset'];var _0x40fc08=_0x3d297f?_0x5c1a29[_0x54da('0x1d')]:_0x377157[_0x54da('0x1b')]+_0x377157[_0x54da('0x1e')];var _0x581c09;if(_0x40fc08>=_0x550b64){_0x40fc08=_0x550b64;_0x581c09=0xc8;}else{_0x581c09=0xce;}_0x56c16d[_0x54da('0x1f')](_0x581c09);return _0x56c16d[_0x54da('0x20')]('Content-Range',_0x11363f+'-'+_0x40fc08+'/'+_0x550b64)[_0x54da('0x1a')](_0x5c1a29);}return null;};}function patchUpdates(_0x1e0281){return function(_0x7d5e11){try{jsonpatch[_0x54da('0x21')](_0x7d5e11,_0x1e0281,!![]);}catch(_0x11462c){return BPromise[_0x54da('0x22')](_0x11462c);}return _0x7d5e11[_0x54da('0x23')]();};}function saveUpdates(_0x124574,_0x4550dd){return function(_0x5145da){if(_0x5145da){return _0x5145da[_0x54da('0x24')](_0x124574)[_0x54da('0x25')](function(_0x2c8c03){return _0x2c8c03;});}return null;};}function removeEntity(_0x512cdb,_0x4e6180){return function(_0x2dd4e8){if(_0x2dd4e8){return _0x2dd4e8[_0x54da('0x26')]()['then'](function(){_0x512cdb[_0x54da('0x1f')](0xcc)[_0x54da('0x19')]();});}};}function handleEntityNotFound(_0x1fc31d,_0x2c360c){return function(_0x4136fe){if(!_0x4136fe){_0x1fc31d['sendStatus'](0x194);}return _0x4136fe;};}function handleError(_0x25b754,_0x33bd04){_0x33bd04=_0x33bd04||0x1f4;return function(_0x5e3802){logger[_0x54da('0x27')](_0x5e3802[_0x54da('0x28')]);if(_0x5e3802[_0x54da('0x29')]){delete _0x5e3802['name'];}_0x25b754[_0x54da('0x1f')](_0x33bd04)[_0x54da('0x2a')](_0x5e3802);};}exports['index']=function(_0x5202d9,_0x36f415){var _0x256264={},_0x213f2c={},_0x2ccb93={'count':0x0,'rows':[]};var _0x1008f8=_[_0x54da('0x2b')](db[_0x54da('0x2c')][_0x54da('0x2d')],function(_0x29f7d9){return{'name':_0x29f7d9[_0x54da('0x2e')],'type':_0x29f7d9[_0x54da('0x2f')][_0x54da('0x30')]};});_0x213f2c[_0x54da('0x31')]=_['map'](_0x1008f8,_0x54da('0x29'));_0x213f2c[_0x54da('0x32')]=_[_0x54da('0x33')](_0x5202d9[_0x54da('0x32')]);_0x213f2c[_0x54da('0x34')]=_[_0x54da('0x35')](_0x213f2c[_0x54da('0x31')],_0x213f2c['query']);_0x256264[_0x54da('0x36')]=_[_0x54da('0x35')](_0x213f2c['model'],qs['fields'](_0x5202d9[_0x54da('0x32')][_0x54da('0x37')]));_0x256264['attributes']=_0x256264[_0x54da('0x36')][_0x54da('0x38')]?_0x256264['attributes']:_0x213f2c[_0x54da('0x31')];if(!_0x5202d9[_0x54da('0x32')]['hasOwnProperty']('nolimit')){_0x256264['limit']=qs[_0x54da('0x1e')](_0x5202d9[_0x54da('0x32')]['limit']);_0x256264['offset']=qs[_0x54da('0x1b')](_0x5202d9[_0x54da('0x32')][_0x54da('0x1b')]);}_0x256264[_0x54da('0x39')]=qs[_0x54da('0x3a')](_0x5202d9[_0x54da('0x32')]['sort']);_0x256264[_0x54da('0x3b')]=qs[_0x54da('0x34')](_[_0x54da('0x3c')](_0x5202d9[_0x54da('0x32')],_0x213f2c[_0x54da('0x34')]),_0x1008f8);if(_0x5202d9[_0x54da('0x32')][_0x54da('0x3d')]){_0x256264['where']=_['merge'](_0x256264[_0x54da('0x3b')],{'$or':_[_0x54da('0x2b')](_0x1008f8,function(_0x572e5c){if(_0x572e5c[_0x54da('0x2f')]!==_0x54da('0x3e')){var _0x1a6cf2={};_0x1a6cf2[_0x572e5c[_0x54da('0x29')]]={'$like':'%'+_0x5202d9[_0x54da('0x32')][_0x54da('0x3d')]+'%'};return _0x1a6cf2;}})});}_0x256264=_[_0x54da('0x3f')]({},_0x256264,_0x5202d9[_0x54da('0x40')]);var _0x41c1a6={'where':_0x256264[_0x54da('0x3b')]};return db['Dynamics365Configuration'][_0x54da('0x1d')](_0x41c1a6)[_0x54da('0x25')](function(_0x480eb8){_0x2ccb93['count']=_0x480eb8;if(_0x5202d9[_0x54da('0x32')][_0x54da('0x41')]){_0x256264[_0x54da('0x42')]=[{'all':!![]}];}return db[_0x54da('0x2c')][_0x54da('0x43')](_0x256264);})[_0x54da('0x25')](function(_0x109781){_0x2ccb93[_0x54da('0x44')]=_0x109781;return _0x2ccb93;})['then'](respondWithFilteredResult(_0x36f415,_0x256264))[_0x54da('0x45')](handleError(_0x36f415,null));};exports[_0x54da('0x46')]=function(_0x191767,_0x5e3096){var _0x20e51c={'raw':![],'where':{'id':_0x191767['params']['id']}},_0x11e3a4={};_0x11e3a4[_0x54da('0x31')]=_[_0x54da('0x33')](db[_0x54da('0x2c')][_0x54da('0x2d')]);_0x11e3a4[_0x54da('0x32')]=_['keys'](_0x191767[_0x54da('0x32')]);_0x11e3a4[_0x54da('0x34')]=_[_0x54da('0x35')](_0x11e3a4[_0x54da('0x31')],_0x11e3a4[_0x54da('0x32')]);_0x20e51c['attributes']=_[_0x54da('0x35')](_0x11e3a4[_0x54da('0x31')],qs[_0x54da('0x37')](_0x191767[_0x54da('0x32')][_0x54da('0x37')]));_0x20e51c[_0x54da('0x36')]=_0x20e51c[_0x54da('0x36')][_0x54da('0x38')]?_0x20e51c[_0x54da('0x36')]:_0x11e3a4[_0x54da('0x31')];if(_0x191767['query']['includeAll']){_0x20e51c[_0x54da('0x42')]=[{'all':!![]}];}_0x20e51c=_[_0x54da('0x3f')]({},_0x20e51c,_0x191767[_0x54da('0x40')]);return db[_0x54da('0x2c')][_0x54da('0x47')](_0x20e51c)[_0x54da('0x25')](handleEntityNotFound(_0x5e3096,null))[_0x54da('0x25')](respondWithResult(_0x5e3096,null))[_0x54da('0x45')](handleError(_0x5e3096,null));};exports[_0x54da('0x48')]=function(_0x254b99,_0x5b0902){return db[_0x54da('0x2c')]['create'](_0x254b99[_0x54da('0x49')],{})[_0x54da('0x25')](respondWithResult(_0x5b0902,0xc9))['catch'](handleError(_0x5b0902,null));};exports[_0x54da('0x24')]=function(_0x23c561,_0x2b5cb6){if(_0x23c561['body']['id']){delete _0x23c561['body']['id'];}return db['Dynamics365Configuration'][_0x54da('0x47')]({'where':{'id':_0x23c561['params']['id']}})[_0x54da('0x25')](handleEntityNotFound(_0x2b5cb6,null))[_0x54da('0x25')](saveUpdates(_0x23c561[_0x54da('0x49')],null))[_0x54da('0x25')](respondWithResult(_0x2b5cb6,null))[_0x54da('0x45')](handleError(_0x2b5cb6,null));};exports['destroy']=function(_0x51f9fe,_0x3f0b3e){return db['Dynamics365Configuration'][_0x54da('0x47')]({'where':{'id':_0x51f9fe['params']['id']}})[_0x54da('0x25')](handleEntityNotFound(_0x3f0b3e,null))[_0x54da('0x25')](removeEntity(_0x3f0b3e,null))[_0x54da('0x45')](handleError(_0x3f0b3e,null));};exports[_0x54da('0x4a')]=function(_0x3606f9,_0x2892b0,_0x3c258b){var _0x1e9576={};var _0x51c96b={};var _0x30a56f;var _0x326feb;return db[_0x54da('0x2c')][_0x54da('0x4b')]({'where':{'id':_0x3606f9[_0x54da('0x4c')]['id']}})[_0x54da('0x25')](handleEntityNotFound(_0x2892b0,null))['then'](function(_0x4adcaf){if(_0x4adcaf){_0x30a56f=_0x4adcaf;_0x51c96b['model']=_[_0x54da('0x33')](db[_0x54da('0x4d')][_0x54da('0x2d')]);_0x51c96b[_0x54da('0x32')]=_[_0x54da('0x33')](_0x3606f9['query']);_0x51c96b[_0x54da('0x34')]=_['intersection'](_0x51c96b[_0x54da('0x31')],_0x51c96b['query']);_0x1e9576[_0x54da('0x36')]=_['intersection'](_0x51c96b[_0x54da('0x31')],qs[_0x54da('0x37')](_0x3606f9[_0x54da('0x32')]['fields']));_0x1e9576[_0x54da('0x36')]=_0x1e9576[_0x54da('0x36')][_0x54da('0x38')]?_0x1e9576[_0x54da('0x36')]:_0x51c96b['model'];_0x1e9576['order']=qs[_0x54da('0x3a')](_0x3606f9[_0x54da('0x32')][_0x54da('0x3a')]);_0x1e9576[_0x54da('0x3b')]=qs[_0x54da('0x34')](_[_0x54da('0x3c')](_0x3606f9[_0x54da('0x32')],_0x51c96b[_0x54da('0x34')]));if(_0x3606f9['query']['filter']){_0x1e9576[_0x54da('0x3b')]=_[_0x54da('0x3f')](_0x1e9576[_0x54da('0x3b')],{'$or':_[_0x54da('0x2b')](_0x1e9576['attributes'],function(_0x4c420b){var _0x8e0316={};_0x8e0316[_0x4c420b]={'$like':'%'+_0x3606f9[_0x54da('0x32')]['filter']+'%'};return _0x8e0316;})});}_0x1e9576=_[_0x54da('0x3f')]({},_0x1e9576,_0x3606f9['options']);return _0x30a56f[_0x54da('0x4a')](_0x1e9576);}})['then'](function(_0x48ccf4){if(_0x48ccf4){_0x326feb=_0x48ccf4[_0x54da('0x38')];if(!_0x3606f9[_0x54da('0x32')][_0x54da('0x4e')]('nolimit')){_0x1e9576['limit']=qs[_0x54da('0x1e')](_0x3606f9[_0x54da('0x32')]['limit']);_0x1e9576['offset']=qs[_0x54da('0x1b')](_0x3606f9[_0x54da('0x32')][_0x54da('0x1b')]);}return _0x30a56f[_0x54da('0x4a')](_0x1e9576);}})[_0x54da('0x25')](function(_0x379aa3){if(_0x379aa3){return _0x379aa3?{'count':_0x326feb,'rows':_0x379aa3}:null;}})[_0x54da('0x25')](respondWithResult(_0x2892b0,null))[_0x54da('0x45')](handleError(_0x2892b0,null));};exports[_0x54da('0x4f')]=function(_0x2eb8df,_0x4699ac,_0x2d1852){var _0x2a073c={};var _0x2850d5={};var _0x1a02a0;var _0x188958;return db[_0x54da('0x2c')][_0x54da('0x4b')]({'where':{'id':_0x2eb8df['params']['id']}})[_0x54da('0x25')](handleEntityNotFound(_0x4699ac,null))['then'](function(_0x4ce7ff){if(_0x4ce7ff){_0x1a02a0=_0x4ce7ff;_0x2850d5[_0x54da('0x31')]=_['keys'](db[_0x54da('0x4d')]['rawAttributes']);_0x2850d5['query']=_['keys'](_0x2eb8df[_0x54da('0x32')]);_0x2850d5[_0x54da('0x34')]=_[_0x54da('0x35')](_0x2850d5[_0x54da('0x31')],_0x2850d5['query']);_0x2a073c[_0x54da('0x36')]=_[_0x54da('0x35')](_0x2850d5['model'],qs[_0x54da('0x37')](_0x2eb8df[_0x54da('0x32')][_0x54da('0x37')]));_0x2a073c[_0x54da('0x36')]=_0x2a073c['attributes'][_0x54da('0x38')]?_0x2a073c[_0x54da('0x36')]:_0x2850d5['model'];_0x2a073c[_0x54da('0x39')]=qs[_0x54da('0x3a')](_0x2eb8df[_0x54da('0x32')]['sort']);_0x2a073c[_0x54da('0x3b')]=qs[_0x54da('0x34')](_[_0x54da('0x3c')](_0x2eb8df[_0x54da('0x32')],_0x2850d5[_0x54da('0x34')]));if(_0x2eb8df['query']['filter']){_0x2a073c[_0x54da('0x3b')]=_['merge'](_0x2a073c[_0x54da('0x3b')],{'$or':_['map'](_0x2a073c['attributes'],function(_0x3fda2a){var _0x2a4b37={};_0x2a4b37[_0x3fda2a]={'$like':'%'+_0x2eb8df[_0x54da('0x32')][_0x54da('0x3d')]+'%'};return _0x2a4b37;})});}_0x2a073c=_[_0x54da('0x3f')]({},_0x2a073c,_0x2eb8df['options']);return _0x1a02a0[_0x54da('0x4f')](_0x2a073c);}})[_0x54da('0x25')](function(_0xcb9826){if(_0xcb9826){_0x188958=_0xcb9826['length'];if(!_0x2eb8df[_0x54da('0x32')]['hasOwnProperty'](_0x54da('0x50'))){_0x2a073c[_0x54da('0x1e')]=qs[_0x54da('0x1e')](_0x2eb8df[_0x54da('0x32')][_0x54da('0x1e')]);_0x2a073c[_0x54da('0x1b')]=qs[_0x54da('0x1b')](_0x2eb8df[_0x54da('0x32')][_0x54da('0x1b')]);}return _0x1a02a0[_0x54da('0x4f')](_0x2a073c);}})['then'](function(_0x24f2cd){if(_0x24f2cd){return _0x24f2cd?{'count':_0x188958,'rows':_0x24f2cd}:null;}})['then'](respondWithResult(_0x4699ac,null))[_0x54da('0x45')](handleError(_0x4699ac,null));};exports['getDescriptions']=function(_0x35f408,_0x3a8f7f,_0x4e3617){var _0x3c5e01={};var _0x3bdcd1={};var _0x17eee1;var _0x16f99e;return db[_0x54da('0x2c')]['findOne']({'where':{'id':_0x35f408['params']['id']}})[_0x54da('0x25')](handleEntityNotFound(_0x3a8f7f,null))[_0x54da('0x25')](function(_0x188fd0){if(_0x188fd0){_0x17eee1=_0x188fd0;_0x3bdcd1[_0x54da('0x31')]=_[_0x54da('0x33')](db[_0x54da('0x4d')][_0x54da('0x2d')]);_0x3bdcd1[_0x54da('0x32')]=_[_0x54da('0x33')](_0x35f408['query']);_0x3bdcd1[_0x54da('0x34')]=_[_0x54da('0x35')](_0x3bdcd1[_0x54da('0x31')],_0x3bdcd1['query']);_0x3c5e01['attributes']=_[_0x54da('0x35')](_0x3bdcd1[_0x54da('0x31')],qs[_0x54da('0x37')](_0x35f408[_0x54da('0x32')][_0x54da('0x37')]));_0x3c5e01[_0x54da('0x36')]=_0x3c5e01[_0x54da('0x36')][_0x54da('0x38')]?_0x3c5e01[_0x54da('0x36')]:_0x3bdcd1['model'];_0x3c5e01[_0x54da('0x39')]=qs[_0x54da('0x3a')](_0x35f408['query'][_0x54da('0x3a')]);_0x3c5e01[_0x54da('0x3b')]=qs[_0x54da('0x34')](_[_0x54da('0x3c')](_0x35f408[_0x54da('0x32')],_0x3bdcd1['filters']));if(_0x35f408[_0x54da('0x32')]['filter']){_0x3c5e01[_0x54da('0x3b')]=_[_0x54da('0x3f')](_0x3c5e01[_0x54da('0x3b')],{'$or':_[_0x54da('0x2b')](_0x3c5e01[_0x54da('0x36')],function(_0x541998){var _0x252f10={};_0x252f10[_0x541998]={'$like':'%'+_0x35f408['query']['filter']+'%'};return _0x252f10;})});}_0x3c5e01=_[_0x54da('0x3f')]({},_0x3c5e01,_0x35f408[_0x54da('0x40')]);return _0x17eee1[_0x54da('0x51')](_0x3c5e01);}})[_0x54da('0x25')](function(_0x51bada){if(_0x51bada){_0x16f99e=_0x51bada[_0x54da('0x38')];if(!_0x35f408['query'][_0x54da('0x4e')](_0x54da('0x50'))){_0x3c5e01[_0x54da('0x1e')]=qs['limit'](_0x35f408[_0x54da('0x32')][_0x54da('0x1e')]);_0x3c5e01[_0x54da('0x1b')]=qs[_0x54da('0x1b')](_0x35f408['query'][_0x54da('0x1b')]);}return _0x17eee1[_0x54da('0x51')](_0x3c5e01);}})[_0x54da('0x25')](function(_0x2dcd0b){if(_0x2dcd0b){return _0x2dcd0b?{'count':_0x16f99e,'rows':_0x2dcd0b}:null;}})[_0x54da('0x25')](respondWithResult(_0x3a8f7f,null))[_0x54da('0x45')](handleError(_0x3a8f7f,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index 567e167..f22d64e 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 _0x9a19=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports','define'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0x9a19,0x114));var _0x99a1=function(_0x2d4421,_0x15a84f){_0x2d4421=_0x2d4421-0x0;var _0x2d3b01=_0x9a19[_0x2d4421];return _0x2d3b01;};'use strict';var _=require(_0x99a1('0x0'));var util=require(_0x99a1('0x1'));var logger=require(_0x99a1('0x2'))('api');var moment=require(_0x99a1('0x3'));var BPromise=require(_0x99a1('0x4'));var rp=require(_0x99a1('0x5'));var fs=require('fs');var path=require(_0x99a1('0x6'));var rimraf=require(_0x99a1('0x7'));var config=require(_0x99a1('0x8'));var attributes=require(_0x99a1('0x9'));module[_0x99a1('0xa')]=function(_0x3eff4a,_0xff0240){return _0x3eff4a[_0x99a1('0xb')]('Dynamics365Configuration',attributes,{'tableName':'int_dynamics365_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa41a=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Configuration.attributes','int_dynamics365_configurations','lodash','util','api'];(function(_0x21c3d4,_0x43773e){var _0x509278=function(_0x404775){while(--_0x404775){_0x21c3d4['push'](_0x21c3d4['shift']());}};_0x509278(++_0x43773e);}(_0xa41a,0x6b));var _0xaa41=function(_0x22902b,_0x488009){_0x22902b=_0x22902b-0x0;var _0x2e38bc=_0xa41a[_0x22902b];return _0x2e38bc;};'use strict';var _=require(_0xaa41('0x0'));var util=require(_0xaa41('0x1'));var logger=require('../../config/logger')(_0xaa41('0x2'));var moment=require(_0xaa41('0x3'));var BPromise=require(_0xaa41('0x4'));var rp=require(_0xaa41('0x5'));var fs=require('fs');var path=require(_0xaa41('0x6'));var rimraf=require(_0xaa41('0x7'));var config=require(_0xaa41('0x8'));var attributes=require(_0xaa41('0x9'));module['exports']=function(_0x2122a0,_0x1ec9d4){return _0x2122a0['define']('Dynamics365Configuration',attributes,{'tableName':_0xaa41('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js index aa0a1e7..cefc4b6 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 _0x5bab=['then','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','http','request'];(function(_0x57fda8,_0x5e80a0){var _0x11c895=function(_0xd08d0e){while(--_0xd08d0e){_0x57fda8['push'](_0x57fda8['shift']());}};_0x11c895(++_0x5e80a0);}(_0x5bab,0x6e));var _0xb5ba=function(_0x4cff15,_0x57e987){_0x4cff15=_0x4cff15-0x0;var _0x105bcb=_0x5bab[_0x4cff15];return _0x105bcb;};'use strict';var _=require(_0xb5ba('0x0'));var util=require(_0xb5ba('0x1'));var moment=require(_0xb5ba('0x2'));var BPromise=require(_0xb5ba('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb5ba('0x4'));var db=require(_0xb5ba('0x5'))['db'];var utils=require(_0xb5ba('0x6'));var logger=require(_0xb5ba('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xb5ba('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x10be07,_0x57020b,_0x283263){return new BPromise(function(_0x2005ef,_0x10ca5e){return client[_0xb5ba('0x9')](_0x10be07,_0x283263)[_0xb5ba('0xa')](function(_0x54720d){logger[_0xb5ba('0xb')](_0xb5ba('0xc'),_0x57020b,_0xb5ba('0xd'));logger[_0xb5ba('0xe')](_0xb5ba('0xf'),_0x57020b,_0xb5ba('0xd'),JSON[_0xb5ba('0x10')](_0x54720d));if(_0x54720d['error']){if(_0x54720d[_0xb5ba('0x11')][_0xb5ba('0x12')]===0x1f4){logger[_0xb5ba('0x11')]('Dynamics365Configuration,\x20%s,\x20%s',_0x57020b,_0x54720d[_0xb5ba('0x11')][_0xb5ba('0x13')]);return _0x10ca5e(_0x54720d['error'][_0xb5ba('0x13')]);}logger[_0xb5ba('0x11')](_0xb5ba('0xc'),_0x57020b,_0x54720d[_0xb5ba('0x11')][_0xb5ba('0x13')]);return _0x2005ef(_0x54720d[_0xb5ba('0x11')][_0xb5ba('0x13')]);}else{logger['info'](_0xb5ba('0xc'),_0x57020b,'request\x20sent');_0x2005ef(_0x54720d['result'][_0xb5ba('0x13')]);}})['catch'](function(_0x20d571){logger[_0xb5ba('0x11')](_0xb5ba('0xc'),_0x57020b,_0x20d571);_0x10ca5e(_0x20d571);});});} \ No newline at end of file +var _0xa29a=['code','Dynamics365Configuration,\x20%s,\x20%s','message','result','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','then','info','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x319696,_0x477274){var _0x44085a=function(_0x33c51d){while(--_0x33c51d){_0x319696['push'](_0x319696['shift']());}};_0x44085a(++_0x477274);}(_0xa29a,0x115));var _0xaa29=function(_0xef88b3,_0xad2790){_0xef88b3=_0xef88b3-0x0;var _0x51ba0b=_0xa29a[_0xef88b3];return _0x51ba0b;};'use strict';var _=require(_0xaa29('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xaa29('0x1'));var rs=require(_0xaa29('0x2'));var fs=require('fs');var Redis=require(_0xaa29('0x3'));var db=require(_0xaa29('0x4'))['db'];var utils=require(_0xaa29('0x5'));var logger=require(_0xaa29('0x6'))(_0xaa29('0x7'));var config=require('../../config/environment');var jayson=require(_0xaa29('0x8'));var client=jayson[_0xaa29('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5e8276,_0x4507e6,_0x36ccbd){return new BPromise(function(_0x50c271,_0x454fba){return client['request'](_0x5e8276,_0x36ccbd)[_0xaa29('0xa')](function(_0x4ba850){logger[_0xaa29('0xb')]('Dynamics365Configuration,\x20%s,\x20%s',_0x4507e6,'request\x20sent');logger[_0xaa29('0xc')](_0xaa29('0xd'),_0x4507e6,_0xaa29('0xe'),JSON[_0xaa29('0xf')](_0x4ba850));if(_0x4ba850['error']){if(_0x4ba850[_0xaa29('0x10')][_0xaa29('0x11')]===0x1f4){logger[_0xaa29('0x10')](_0xaa29('0x12'),_0x4507e6,_0x4ba850[_0xaa29('0x10')][_0xaa29('0x13')]);return _0x454fba(_0x4ba850[_0xaa29('0x10')]['message']);}logger[_0xaa29('0x10')](_0xaa29('0x12'),_0x4507e6,_0x4ba850['error'][_0xaa29('0x13')]);return _0x50c271(_0x4ba850['error']['message']);}else{logger[_0xaa29('0xb')]('Dynamics365Configuration,\x20%s,\x20%s',_0x4507e6,_0xaa29('0xe'));_0x50c271(_0x4ba850[_0xaa29('0x14')][_0xaa29('0x13')]);}})['catch'](function(_0x11584f){logger['error']('Dynamics365Configuration,\x20%s,\x20%s',_0x4507e6,_0x11584f);_0x454fba(_0x11584f);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index 8c8dd4f..798bd29 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 _0xa2be=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','isAuthenticated','index','get','/:id','show','post','create','put','update','delete','destroy','path','connect-timeout','Router'];(function(_0x30c649,_0x2ebbac){var _0x3edfb9=function(_0xab82f5){while(--_0xab82f5){_0x30c649['push'](_0x30c649['shift']());}};_0x3edfb9(++_0x2ebbac);}(_0xa2be,0xe1));var _0xea2b=function(_0x10f0a3,_0x4a75a9){_0x10f0a3=_0x10f0a3-0x0;var _0x2af3cf=_0xa2be[_0x10f0a3];return _0x2af3cf;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xea2b('0x0'));var timeout=require(_0xea2b('0x1'));var express=require('express');var router=express[_0xea2b('0x2')]();var fs_extra=require(_0xea2b('0x3'));var auth=require(_0xea2b('0x4'));var interaction=require(_0xea2b('0x5'));var config=require(_0xea2b('0x6'));var controller=require(_0xea2b('0x7'));router['get']('/',auth[_0xea2b('0x8')](),controller[_0xea2b('0x9')]);router[_0xea2b('0xa')](_0xea2b('0xb'),auth['isAuthenticated'](),controller[_0xea2b('0xc')]);router[_0xea2b('0xd')]('/',auth[_0xea2b('0x8')](),controller[_0xea2b('0xe')]);router[_0xea2b('0xf')](_0xea2b('0xb'),auth[_0xea2b('0x8')](),controller[_0xea2b('0x10')]);router[_0xea2b('0x11')]('/:id',auth[_0xea2b('0x8')](),controller[_0xea2b('0x12')]);module['exports']=router; \ No newline at end of file +var _0x70c1=['update','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','get','index','/:id','show','post','put','isAuthenticated'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x70c1,0x1a4));var _0x170c=function(_0x343cd6,_0x205de3){_0x343cd6=_0x343cd6-0x0;var _0x159350=_0x70c1[_0x343cd6];return _0x159350;};'use strict';var multer=require(_0x170c('0x0'));var util=require(_0x170c('0x1'));var path=require(_0x170c('0x2'));var timeout=require(_0x170c('0x3'));var express=require(_0x170c('0x4'));var router=express[_0x170c('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x170c('0x6'));var interaction=require(_0x170c('0x7'));var config=require(_0x170c('0x8'));var controller=require(_0x170c('0x9'));router[_0x170c('0xa')]('/',auth['isAuthenticated'](),controller[_0x170c('0xb')]);router[_0x170c('0xa')](_0x170c('0xc'),auth['isAuthenticated'](),controller[_0x170c('0xd')]);router[_0x170c('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0x170c('0xf')](_0x170c('0xc'),auth[_0x170c('0x10')](),controller[_0x170c('0x11')]);router['delete'](_0x170c('0xc'),auth[_0x170c('0x10')](),controller[_0x170c('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index 8d94c95..7d4fad5 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 _0x4f7b=['BOOLEAN','sequelize','exports','ENUM','variable','customVariable','picklist','string','STRING'];(function(_0x8f73b0,_0x4d03b2){var _0x402d3a=function(_0x25db74){while(--_0x25db74){_0x8f73b0['push'](_0x8f73b0['shift']());}};_0x402d3a(++_0x4d03b2);}(_0x4f7b,0x157));var _0xb4f7=function(_0x504537,_0x51f615){_0x504537=_0x504537-0x0;var _0x2d7872=_0x4f7b[_0x504537];return _0x2d7872;};'use strict';var Sequelize=require(_0xb4f7('0x0'));module[_0xb4f7('0x1')]={'type':{'type':Sequelize[_0xb4f7('0x2')]('string',_0xb4f7('0x3'),_0xb4f7('0x4'),'keyValue',_0xb4f7('0x5')),'defaultValue':_0xb4f7('0x6')},'content':{'type':Sequelize[_0xb4f7('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0xb4f7('0x6'),'variable','customVariable')},'keyContent':{'type':Sequelize[_0xb4f7('0x7')]},'idField':{'type':Sequelize[_0xb4f7('0x7')]},'nameField':{'type':Sequelize[_0xb4f7('0x7')]},'customField':{'type':Sequelize[_0xb4f7('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xb4f7('0x7')]}}; \ No newline at end of file +var _0xca96=['STRING','ENUM','sequelize','string','variable','customVariable'];(function(_0x47c1e9,_0x5026c9){var _0x2227c0=function(_0x2053a2){while(--_0x2053a2){_0x47c1e9['push'](_0x47c1e9['shift']());}};_0x2227c0(++_0x5026c9);}(_0xca96,0x8c));var _0x6ca9=function(_0x1490ad,_0x5a8d77){_0x1490ad=_0x1490ad-0x0;var _0x12c9de=_0xca96[_0x1490ad];return _0x12c9de;};'use strict';var Sequelize=require(_0x6ca9('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0x6ca9('0x1'),_0x6ca9('0x2'),_0x6ca9('0x3'),'keyValue','picklist'),'defaultValue':_0x6ca9('0x1')},'content':{'type':Sequelize[_0x6ca9('0x4')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x6ca9('0x5')](_0x6ca9('0x1'),_0x6ca9('0x2'),_0x6ca9('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x6ca9('0x4')]},'nameField':{'type':Sequelize[_0x6ca9('0x4')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x6ca9('0x4')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index 1380f1a..a97e29c 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 _0x240c=['rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','include','findAll','rows','catch','params','length','includeAll','options','create','body','find','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','count','Content-Range','apply','update','then','destroy','stack','name','send','index','map','Dynamics365Field'];(function(_0x3edbf4,_0x1aa808){var _0x59f894=function(_0x333c07){while(--_0x333c07){_0x3edbf4['push'](_0x3edbf4['shift']());}};_0x59f894(++_0x1aa808);}(_0x240c,0xf5));var _0xc240=function(_0x274d29,_0x96add8){_0x274d29=_0x274d29-0x0;var _0x53b4d4=_0x240c[_0x274d29];return _0x53b4d4;};'use strict';var emlformat=require(_0xc240('0x0'));var rimraf=require(_0xc240('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc240('0x2'));var rp=require(_0xc240('0x3'));var moment=require(_0xc240('0x4'));var BPromise=require(_0xc240('0x5'));var Mustache=require(_0xc240('0x6'));var util=require(_0xc240('0x7'));var path=require(_0xc240('0x8'));var sox=require(_0xc240('0x9'));var csv=require('to-csv');var ejs=require(_0xc240('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xc240('0xb'));var crypto=require(_0xc240('0xc'));var jsforce=require(_0xc240('0xd'));var deskjs=require(_0xc240('0xe'));var toCsv=require(_0xc240('0xf'));var querystring=require(_0xc240('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xc240('0x11'));var qs=require(_0xc240('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc240('0x13'));var logger=require('../../config/logger')(_0xc240('0x14'));var utils=require(_0xc240('0x15'));var config=require(_0xc240('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xc240('0x17'))['db'];function respondWithStatusCode(_0x492de0,_0x28206a){_0x28206a=_0x28206a||0xcc;return function(_0x537d3d){if(_0x537d3d){return _0x492de0[_0xc240('0x18')](_0x28206a);}return _0x492de0['status'](_0x28206a)[_0xc240('0x19')]();};}function respondWithResult(_0x1d2251,_0x429e0a){_0x429e0a=_0x429e0a||0xc8;return function(_0x57b9fa){if(_0x57b9fa){return _0x1d2251[_0xc240('0x1a')](_0x429e0a)[_0xc240('0x1b')](_0x57b9fa);}};}function respondWithFilteredResult(_0x5c1dfe,_0x5a72a2){return function(_0x517ced){if(_0x517ced){var _0x4ef036=typeof _0x5a72a2['offset']===_0xc240('0x1c')&&typeof _0x5a72a2[_0xc240('0x1d')]===_0xc240('0x1c');var _0x38cebc=_0x517ced['count'];var _0x1a2ae=_0x4ef036?0x0:_0x5a72a2[_0xc240('0x1e')];var _0x4cf5f2=_0x4ef036?_0x517ced[_0xc240('0x1f')]:_0x5a72a2[_0xc240('0x1e')]+_0x5a72a2['limit'];var _0x29408b;if(_0x4cf5f2>=_0x38cebc){_0x4cf5f2=_0x38cebc;_0x29408b=0xc8;}else{_0x29408b=0xce;}_0x5c1dfe['status'](_0x29408b);return _0x5c1dfe['set'](_0xc240('0x20'),_0x1a2ae+'-'+_0x4cf5f2+'/'+_0x38cebc)[_0xc240('0x1b')](_0x517ced);}return null;};}function patchUpdates(_0x57a6ba){return function(_0x17c430){try{jsonpatch[_0xc240('0x21')](_0x17c430,_0x57a6ba,!![]);}catch(_0x22e6be){return BPromise['reject'](_0x22e6be);}return _0x17c430['save']();};}function saveUpdates(_0x545b92,_0x14e248){return function(_0x97903f){if(_0x97903f){return _0x97903f[_0xc240('0x22')](_0x545b92)[_0xc240('0x23')](function(_0xa31aaf){return _0xa31aaf;});}return null;};}function removeEntity(_0x5d012d,_0x53ee49){return function(_0x31e190){if(_0x31e190){return _0x31e190[_0xc240('0x24')]()[_0xc240('0x23')](function(){_0x5d012d[_0xc240('0x1a')](0xcc)[_0xc240('0x19')]();});}};}function handleEntityNotFound(_0x3806d5,_0x39230f){return function(_0x43cb63){if(!_0x43cb63){_0x3806d5[_0xc240('0x18')](0x194);}return _0x43cb63;};}function handleError(_0x3ca294,_0x335b0e){_0x335b0e=_0x335b0e||0x1f4;return function(_0x33916e){logger['error'](_0x33916e[_0xc240('0x25')]);if(_0x33916e['name']){delete _0x33916e[_0xc240('0x26')];}_0x3ca294[_0xc240('0x1a')](_0x335b0e)[_0xc240('0x27')](_0x33916e);};}exports[_0xc240('0x28')]=function(_0x1a535d,_0x46e532){var _0x5bb462={},_0x415b28={},_0x502c16={'count':0x0,'rows':[]};var _0x28c4fc=_[_0xc240('0x29')](db[_0xc240('0x2a')][_0xc240('0x2b')],function(_0xf81f6d){return{'name':_0xf81f6d[_0xc240('0x2c')],'type':_0xf81f6d[_0xc240('0x2d')][_0xc240('0x2e')]};});_0x415b28[_0xc240('0x2f')]=_['map'](_0x28c4fc,_0xc240('0x26'));_0x415b28[_0xc240('0x30')]=_[_0xc240('0x31')](_0x1a535d[_0xc240('0x30')]);_0x415b28[_0xc240('0x32')]=_[_0xc240('0x33')](_0x415b28[_0xc240('0x2f')],_0x415b28['query']);_0x5bb462[_0xc240('0x34')]=_[_0xc240('0x33')](_0x415b28[_0xc240('0x2f')],qs['fields'](_0x1a535d[_0xc240('0x30')][_0xc240('0x35')]));_0x5bb462[_0xc240('0x34')]=_0x5bb462[_0xc240('0x34')]['length']?_0x5bb462[_0xc240('0x34')]:_0x415b28[_0xc240('0x2f')];if(!_0x1a535d[_0xc240('0x30')][_0xc240('0x36')](_0xc240('0x37'))){_0x5bb462['limit']=qs[_0xc240('0x1d')](_0x1a535d[_0xc240('0x30')][_0xc240('0x1d')]);_0x5bb462['offset']=qs[_0xc240('0x1e')](_0x1a535d[_0xc240('0x30')]['offset']);}_0x5bb462['order']=qs[_0xc240('0x38')](_0x1a535d[_0xc240('0x30')][_0xc240('0x38')]);_0x5bb462[_0xc240('0x39')]=qs[_0xc240('0x32')](_[_0xc240('0x3a')](_0x1a535d['query'],_0x415b28['filters']),_0x28c4fc);if(_0x1a535d[_0xc240('0x30')]['filter']){_0x5bb462[_0xc240('0x39')]=_['merge'](_0x5bb462[_0xc240('0x39')],{'$or':_[_0xc240('0x29')](_0x28c4fc,function(_0x3dcf0c){if(_0x3dcf0c[_0xc240('0x2d')]!=='VIRTUAL'){var _0x2be382={};_0x2be382[_0x3dcf0c[_0xc240('0x26')]]={'$like':'%'+_0x1a535d[_0xc240('0x30')][_0xc240('0x3b')]+'%'};return _0x2be382;}})});}_0x5bb462=_[_0xc240('0x3c')]({},_0x5bb462,_0x1a535d['options']);var _0x4d7384={'where':_0x5bb462['where']};return db[_0xc240('0x2a')][_0xc240('0x1f')](_0x4d7384)[_0xc240('0x23')](function(_0x4224b2){_0x502c16[_0xc240('0x1f')]=_0x4224b2;if(_0x1a535d[_0xc240('0x30')]['includeAll']){_0x5bb462[_0xc240('0x3d')]=[{'all':!![]}];}return db['Dynamics365Field'][_0xc240('0x3e')](_0x5bb462);})[_0xc240('0x23')](function(_0x2506e3){_0x502c16[_0xc240('0x3f')]=_0x2506e3;return _0x502c16;})[_0xc240('0x23')](respondWithFilteredResult(_0x46e532,_0x5bb462))[_0xc240('0x40')](handleError(_0x46e532,null));};exports['show']=function(_0xc5e1f9,_0x231951){var _0x2ffbe5={'raw':!![],'where':{'id':_0xc5e1f9[_0xc240('0x41')]['id']}},_0x5bd39e={};_0x5bd39e['model']=_[_0xc240('0x31')](db[_0xc240('0x2a')][_0xc240('0x2b')]);_0x5bd39e[_0xc240('0x30')]=_[_0xc240('0x31')](_0xc5e1f9[_0xc240('0x30')]);_0x5bd39e[_0xc240('0x32')]=_[_0xc240('0x33')](_0x5bd39e[_0xc240('0x2f')],_0x5bd39e[_0xc240('0x30')]);_0x2ffbe5[_0xc240('0x34')]=_[_0xc240('0x33')](_0x5bd39e['model'],qs['fields'](_0xc5e1f9['query'][_0xc240('0x35')]));_0x2ffbe5['attributes']=_0x2ffbe5['attributes'][_0xc240('0x42')]?_0x2ffbe5[_0xc240('0x34')]:_0x5bd39e[_0xc240('0x2f')];if(_0xc5e1f9[_0xc240('0x30')][_0xc240('0x43')]){_0x2ffbe5[_0xc240('0x3d')]=[{'all':!![]}];}_0x2ffbe5=_[_0xc240('0x3c')]({},_0x2ffbe5,_0xc5e1f9[_0xc240('0x44')]);return db[_0xc240('0x2a')]['find'](_0x2ffbe5)[_0xc240('0x23')](handleEntityNotFound(_0x231951,null))['then'](respondWithResult(_0x231951,null))[_0xc240('0x40')](handleError(_0x231951,null));};exports[_0xc240('0x45')]=function(_0x2ac142,_0x44960f){return db[_0xc240('0x2a')]['create'](_0x2ac142[_0xc240('0x46')],{})[_0xc240('0x23')](respondWithResult(_0x44960f,0xc9))[_0xc240('0x40')](handleError(_0x44960f,null));};exports[_0xc240('0x22')]=function(_0x3aa232,_0xf46f98){if(_0x3aa232[_0xc240('0x46')]['id']){delete _0x3aa232[_0xc240('0x46')]['id'];}return db['Dynamics365Field']['find']({'where':{'id':_0x3aa232[_0xc240('0x41')]['id']}})['then'](handleEntityNotFound(_0xf46f98,null))[_0xc240('0x23')](saveUpdates(_0x3aa232[_0xc240('0x46')],null))['then'](respondWithResult(_0xf46f98,null))[_0xc240('0x40')](handleError(_0xf46f98,null));};exports[_0xc240('0x24')]=function(_0x52a3d4,_0x2ed092){return db[_0xc240('0x2a')][_0xc240('0x47')]({'where':{'id':_0x52a3d4['params']['id']}})['then'](handleEntityNotFound(_0x2ed092,null))[_0xc240('0x23')](removeEntity(_0x2ed092,null))['catch'](handleError(_0x2ed092,null));}; \ No newline at end of file +var _0x6019=['merge','VIRTUAL','options','Dynamics365Field','includeAll','findAll','rows','catch','show','params','rawAttributes','intersection','include','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','fs-extra','lodash','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','update','then','destroy','end','error','stack','name','map','fieldName','key','keys','query','filters','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter'];(function(_0xe1cfe1,_0x186630){var _0xc7e89f=function(_0x2d603e){while(--_0x2d603e){_0xe1cfe1['push'](_0xe1cfe1['shift']());}};_0xc7e89f(++_0x186630);}(_0x6019,0x9e));var _0x9601=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x6019[_0x2dafbe];return _0x58a45a;};'use strict';var emlformat=require(_0x9601('0x0'));var rimraf=require(_0x9601('0x1'));var zipdir=require(_0x9601('0x2'));var jsonpatch=require(_0x9601('0x3'));var rp=require(_0x9601('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x9601('0x5'));var path=require(_0x9601('0x6'));var sox=require(_0x9601('0x7'));var csv=require(_0x9601('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9601('0x9'));var _=require(_0x9601('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x9601('0xb'));var Papa=require(_0x9601('0xc'));var Redis=require(_0x9601('0xd'));var authService=require(_0x9601('0xe'));var qs=require(_0x9601('0xf'));var as=require(_0x9601('0x10'));var hardwareService=require(_0x9601('0x11'));var logger=require(_0x9601('0x12'))(_0x9601('0x13'));var utils=require(_0x9601('0x14'));var config=require(_0x9601('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x347fe3,_0x86a01c){_0x86a01c=_0x86a01c||0xcc;return function(_0x5de5c0){if(_0x5de5c0){return _0x347fe3[_0x9601('0x16')](_0x86a01c);}return _0x347fe3[_0x9601('0x17')](_0x86a01c)['end']();};}function respondWithResult(_0x181ab0,_0x28f583){_0x28f583=_0x28f583||0xc8;return function(_0x55078a){if(_0x55078a){return _0x181ab0['status'](_0x28f583)[_0x9601('0x18')](_0x55078a);}};}function respondWithFilteredResult(_0x5dac1c,_0x5091b0){return function(_0x1e1082){if(_0x1e1082){var _0x5a4118=typeof _0x5091b0['offset']===_0x9601('0x19')&&typeof _0x5091b0['limit']==='undefined';var _0x32f12a=_0x1e1082[_0x9601('0x1a')];var _0x339579=_0x5a4118?0x0:_0x5091b0[_0x9601('0x1b')];var _0x16e096=_0x5a4118?_0x1e1082[_0x9601('0x1a')]:_0x5091b0[_0x9601('0x1b')]+_0x5091b0[_0x9601('0x1c')];var _0x519ad9;if(_0x16e096>=_0x32f12a){_0x16e096=_0x32f12a;_0x519ad9=0xc8;}else{_0x519ad9=0xce;}_0x5dac1c[_0x9601('0x17')](_0x519ad9);return _0x5dac1c[_0x9601('0x1d')](_0x9601('0x1e'),_0x339579+'-'+_0x16e096+'/'+_0x32f12a)[_0x9601('0x18')](_0x1e1082);}return null;};}function patchUpdates(_0x31aa40){return function(_0x1d3019){try{jsonpatch['apply'](_0x1d3019,_0x31aa40,!![]);}catch(_0x5e6584){return BPromise['reject'](_0x5e6584);}return _0x1d3019['save']();};}function saveUpdates(_0x2d716f,_0x11d371){return function(_0x1dda6e){if(_0x1dda6e){return _0x1dda6e[_0x9601('0x1f')](_0x2d716f)[_0x9601('0x20')](function(_0x260962){return _0x260962;});}return null;};}function removeEntity(_0x524058,_0x417aff){return function(_0x1c83ec){if(_0x1c83ec){return _0x1c83ec[_0x9601('0x21')]()[_0x9601('0x20')](function(){_0x524058['status'](0xcc)[_0x9601('0x22')]();});}};}function handleEntityNotFound(_0x1428ad,_0x5b846a){return function(_0x19a355){if(!_0x19a355){_0x1428ad[_0x9601('0x16')](0x194);}return _0x19a355;};}function handleError(_0x51edcf,_0x3827d0){_0x3827d0=_0x3827d0||0x1f4;return function(_0x37a362){logger[_0x9601('0x23')](_0x37a362[_0x9601('0x24')]);if(_0x37a362[_0x9601('0x25')]){delete _0x37a362[_0x9601('0x25')];}_0x51edcf[_0x9601('0x17')](_0x3827d0)['send'](_0x37a362);};}exports['index']=function(_0x2fc101,_0x5354c2){var _0x18901b={},_0x2bee64={},_0x27bdaa={'count':0x0,'rows':[]};var _0x3401a6=_[_0x9601('0x26')](db['Dynamics365Field']['rawAttributes'],function(_0x280b6c){return{'name':_0x280b6c[_0x9601('0x27')],'type':_0x280b6c['type'][_0x9601('0x28')]};});_0x2bee64['model']=_[_0x9601('0x26')](_0x3401a6,_0x9601('0x25'));_0x2bee64['query']=_[_0x9601('0x29')](_0x2fc101[_0x9601('0x2a')]);_0x2bee64[_0x9601('0x2b')]=_['intersection'](_0x2bee64[_0x9601('0x2c')],_0x2bee64[_0x9601('0x2a')]);_0x18901b['attributes']=_['intersection'](_0x2bee64[_0x9601('0x2c')],qs['fields'](_0x2fc101[_0x9601('0x2a')][_0x9601('0x2d')]));_0x18901b[_0x9601('0x2e')]=_0x18901b[_0x9601('0x2e')][_0x9601('0x2f')]?_0x18901b[_0x9601('0x2e')]:_0x2bee64['model'];if(!_0x2fc101[_0x9601('0x2a')][_0x9601('0x30')](_0x9601('0x31'))){_0x18901b[_0x9601('0x1c')]=qs[_0x9601('0x1c')](_0x2fc101[_0x9601('0x2a')][_0x9601('0x1c')]);_0x18901b[_0x9601('0x1b')]=qs[_0x9601('0x1b')](_0x2fc101[_0x9601('0x2a')][_0x9601('0x1b')]);}_0x18901b[_0x9601('0x32')]=qs[_0x9601('0x33')](_0x2fc101[_0x9601('0x2a')]['sort']);_0x18901b[_0x9601('0x34')]=qs['filters'](_[_0x9601('0x35')](_0x2fc101[_0x9601('0x2a')],_0x2bee64[_0x9601('0x2b')]),_0x3401a6);if(_0x2fc101[_0x9601('0x2a')][_0x9601('0x36')]){_0x18901b[_0x9601('0x34')]=_[_0x9601('0x37')](_0x18901b[_0x9601('0x34')],{'$or':_[_0x9601('0x26')](_0x3401a6,function(_0x39e5ff){if(_0x39e5ff['type']!==_0x9601('0x38')){var _0x5822c0={};_0x5822c0[_0x39e5ff[_0x9601('0x25')]]={'$like':'%'+_0x2fc101[_0x9601('0x2a')][_0x9601('0x36')]+'%'};return _0x5822c0;}})});}_0x18901b=_[_0x9601('0x37')]({},_0x18901b,_0x2fc101[_0x9601('0x39')]);var _0x375bac={'where':_0x18901b[_0x9601('0x34')]};return db[_0x9601('0x3a')]['count'](_0x375bac)[_0x9601('0x20')](function(_0x1e2911){_0x27bdaa['count']=_0x1e2911;if(_0x2fc101[_0x9601('0x2a')][_0x9601('0x3b')]){_0x18901b['include']=[{'all':!![]}];}return db[_0x9601('0x3a')][_0x9601('0x3c')](_0x18901b);})[_0x9601('0x20')](function(_0x42cf3e){_0x27bdaa[_0x9601('0x3d')]=_0x42cf3e;return _0x27bdaa;})['then'](respondWithFilteredResult(_0x5354c2,_0x18901b))[_0x9601('0x3e')](handleError(_0x5354c2,null));};exports[_0x9601('0x3f')]=function(_0x538ef1,_0x234915){var _0x522852={'raw':!![],'where':{'id':_0x538ef1[_0x9601('0x40')]['id']}},_0x229b1a={};_0x229b1a[_0x9601('0x2c')]=_[_0x9601('0x29')](db[_0x9601('0x3a')][_0x9601('0x41')]);_0x229b1a[_0x9601('0x2a')]=_['keys'](_0x538ef1['query']);_0x229b1a[_0x9601('0x2b')]=_['intersection'](_0x229b1a[_0x9601('0x2c')],_0x229b1a[_0x9601('0x2a')]);_0x522852[_0x9601('0x2e')]=_[_0x9601('0x42')](_0x229b1a[_0x9601('0x2c')],qs[_0x9601('0x2d')](_0x538ef1[_0x9601('0x2a')][_0x9601('0x2d')]));_0x522852[_0x9601('0x2e')]=_0x522852[_0x9601('0x2e')][_0x9601('0x2f')]?_0x522852[_0x9601('0x2e')]:_0x229b1a[_0x9601('0x2c')];if(_0x538ef1[_0x9601('0x2a')][_0x9601('0x3b')]){_0x522852[_0x9601('0x43')]=[{'all':!![]}];}_0x522852=_[_0x9601('0x37')]({},_0x522852,_0x538ef1[_0x9601('0x39')]);return db[_0x9601('0x3a')][_0x9601('0x44')](_0x522852)[_0x9601('0x20')](handleEntityNotFound(_0x234915,null))[_0x9601('0x20')](respondWithResult(_0x234915,null))[_0x9601('0x3e')](handleError(_0x234915,null));};exports[_0x9601('0x45')]=function(_0x33adec,_0x1aca32){return db['Dynamics365Field'][_0x9601('0x45')](_0x33adec['body'],{})['then'](respondWithResult(_0x1aca32,0xc9))[_0x9601('0x3e')](handleError(_0x1aca32,null));};exports[_0x9601('0x1f')]=function(_0x346fba,_0xaffc98){if(_0x346fba[_0x9601('0x46')]['id']){delete _0x346fba[_0x9601('0x46')]['id'];}return db['Dynamics365Field'][_0x9601('0x44')]({'where':{'id':_0x346fba[_0x9601('0x40')]['id']}})[_0x9601('0x20')](handleEntityNotFound(_0xaffc98,null))['then'](saveUpdates(_0x346fba[_0x9601('0x46')],null))[_0x9601('0x20')](respondWithResult(_0xaffc98,null))[_0x9601('0x3e')](handleError(_0xaffc98,null));};exports['destroy']=function(_0x35cd10,_0x272d03){return db[_0x9601('0x3a')][_0x9601('0x44')]({'where':{'id':_0x35cd10[_0x9601('0x40')]['id']}})[_0x9601('0x20')](handleEntityNotFound(_0x272d03,null))['then'](removeEntity(_0x272d03,null))[_0x9601('0x3e')](handleError(_0x272d03,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index 7d06cb2..1abbe9b 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 _0xd32a=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Field.attributes','exports','define','int_dynamics365_fields','idField','FieldId'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd32a,0x1e0));var _0xad32=function(_0x556927,_0x34b53f){_0x556927=_0x556927-0x0;var _0x5f1235=_0xd32a[_0x556927];return _0x5f1235;};'use strict';var _=require('lodash');var util=require(_0xad32('0x0'));var logger=require(_0xad32('0x1'))(_0xad32('0x2'));var moment=require(_0xad32('0x3'));var BPromise=require(_0xad32('0x4'));var rp=require(_0xad32('0x5'));var fs=require('fs');var path=require(_0xad32('0x6'));var rimraf=require(_0xad32('0x7'));var config=require(_0xad32('0x8'));var attributes=require(_0xad32('0x9'));module[_0xad32('0xa')]=function(_0x93d76f,_0x2e5319){return _0x93d76f[_0xad32('0xb')]('Dynamics365Field',attributes,{'tableName':_0xad32('0xc'),'paranoid':![],'indexes':[{'name':'dynamics365_unique_index','fields':[_0xad32('0xd'),_0xad32('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x41e3=['util','../../config/logger','api','request-promise','path','../../config/environment','exports','define','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index','FieldId','lodash'];(function(_0x855a18,_0x2a4a83){var _0x70b082=function(_0x397d13){while(--_0x397d13){_0x855a18['push'](_0x855a18['shift']());}};_0x70b082(++_0x2a4a83);}(_0x41e3,0x185));var _0x341e=function(_0x41330c,_0x4ec801){_0x41330c=_0x41330c-0x0;var _0x2275f4=_0x41e3[_0x41330c];return _0x2275f4;};'use strict';var _=require(_0x341e('0x0'));var util=require(_0x341e('0x1'));var logger=require(_0x341e('0x2'))(_0x341e('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x341e('0x4'));var fs=require('fs');var path=require(_0x341e('0x5'));var rimraf=require('rimraf');var config=require(_0x341e('0x6'));var attributes=require('./intDynamics365Field.attributes');module[_0x341e('0x7')]=function(_0x1a208d,_0x2cded0){return _0x1a208d[_0x341e('0x8')](_0x341e('0x9'),attributes,{'tableName':_0x341e('0xa'),'paranoid':![],'indexes':[{'name':_0x341e('0xb'),'fields':['idField',_0x341e('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 ef14d59..a370bdc 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 _0xf851=['stringify','error','code','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','http','request','then','Dynamics365Field,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s'];(function(_0x215e65,_0x183f97){var _0xa85842=function(_0x43bf45){while(--_0x43bf45){_0x215e65['push'](_0x215e65['shift']());}};_0xa85842(++_0x183f97);}(_0xf851,0x11d));var _0x1f85=function(_0x2ee01d,_0x48f7a7){_0x2ee01d=_0x2ee01d-0x0;var _0x24bc9f=_0xf851[_0x2ee01d];return _0x24bc9f;};'use strict';var _=require('lodash');var util=require(_0x1f85('0x0'));var moment=require(_0x1f85('0x1'));var BPromise=require(_0x1f85('0x2'));var rs=require(_0x1f85('0x3'));var fs=require('fs');var Redis=require(_0x1f85('0x4'));var db=require(_0x1f85('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x1f85('0x6'));var config=require(_0x1f85('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1f85('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xf902c8,_0x336a26,_0x22b1c4){return new BPromise(function(_0x44bb4b,_0x1de042){return client[_0x1f85('0x9')](_0xf902c8,_0x22b1c4)[_0x1f85('0xa')](function(_0x1681ac){logger['info'](_0x1f85('0xb'),_0x336a26,_0x1f85('0xc'));logger[_0x1f85('0xd')](_0x1f85('0xe'),_0x336a26,_0x1f85('0xc'),JSON[_0x1f85('0xf')](_0x1681ac));if(_0x1681ac[_0x1f85('0x10')]){if(_0x1681ac[_0x1f85('0x10')][_0x1f85('0x11')]===0x1f4){logger['error']('Dynamics365Field,\x20%s,\x20%s',_0x336a26,_0x1681ac[_0x1f85('0x10')][_0x1f85('0x12')]);return _0x1de042(_0x1681ac['error']['message']);}logger[_0x1f85('0x10')](_0x1f85('0xb'),_0x336a26,_0x1681ac[_0x1f85('0x10')][_0x1f85('0x12')]);return _0x44bb4b(_0x1681ac[_0x1f85('0x10')][_0x1f85('0x12')]);}else{logger['info']('Dynamics365Field,\x20%s,\x20%s',_0x336a26,_0x1f85('0xc'));_0x44bb4b(_0x1681ac[_0x1f85('0x13')]['message']);}})['catch'](function(_0x6f4ec4){logger['error'](_0x1f85('0xb'),_0x336a26,_0x6f4ec4);_0x1de042(_0x6f4ec4);});});} \ No newline at end of file +var _0xcdb4=['rpc','jayson/promise','client','request','then','info','request\x20sent','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','Dynamics365Field,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x277b03,_0x1b1596){var _0x21452e=function(_0x1b7e76){while(--_0x1b7e76){_0x277b03['push'](_0x277b03['shift']());}};_0x21452e(++_0x1b1596);}(_0xcdb4,0x101));var _0x4cdb=function(_0x1f0b22,_0xf9061b){_0x1f0b22=_0x1f0b22-0x0;var _0x47cf3e=_0xcdb4[_0x1f0b22];return _0x47cf3e;};'use strict';var _=require('lodash');var util=require(_0x4cdb('0x0'));var moment=require(_0x4cdb('0x1'));var BPromise=require(_0x4cdb('0x2'));var rs=require(_0x4cdb('0x3'));var fs=require('fs');var Redis=require(_0x4cdb('0x4'));var db=require(_0x4cdb('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x4cdb('0x6'))(_0x4cdb('0x7'));var config=require('../../config/environment');var jayson=require(_0x4cdb('0x8'));var client=jayson[_0x4cdb('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2054bf,_0x384d0c,_0xb5c99a){return new BPromise(function(_0xa78655,_0x1d619a){return client[_0x4cdb('0xa')](_0x2054bf,_0xb5c99a)[_0x4cdb('0xb')](function(_0x36c655){logger[_0x4cdb('0xc')]('Dynamics365Field,\x20%s,\x20%s',_0x384d0c,_0x4cdb('0xd'));logger[_0x4cdb('0xe')](_0x4cdb('0xf'),_0x384d0c,_0x4cdb('0xd'),JSON[_0x4cdb('0x10')](_0x36c655));if(_0x36c655[_0x4cdb('0x11')]){if(_0x36c655[_0x4cdb('0x11')]['code']===0x1f4){logger[_0x4cdb('0x11')](_0x4cdb('0x12'),_0x384d0c,_0x36c655[_0x4cdb('0x11')][_0x4cdb('0x13')]);return _0x1d619a(_0x36c655['error'][_0x4cdb('0x13')]);}logger[_0x4cdb('0x11')]('Dynamics365Field,\x20%s,\x20%s',_0x384d0c,_0x36c655[_0x4cdb('0x11')]['message']);return _0xa78655(_0x36c655[_0x4cdb('0x11')][_0x4cdb('0x13')]);}else{logger['info'](_0x4cdb('0x12'),_0x384d0c,_0x4cdb('0xd'));_0xa78655(_0x36c655[_0x4cdb('0x14')][_0x4cdb('0x13')]);}})[_0x4cdb('0x15')](function(_0x4d57a2){logger[_0x4cdb('0x11')](_0x4cdb('0x12'),_0x384d0c,_0x4d57a2);_0x1d619a(_0x4d57a2);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index d73b4ea..311534d 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 _0x5381=['create','post','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','./intFreshdeskAccount.controller','get','isAuthenticated','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5381,0x8a));var _0x1538=function(_0x24ca09,_0x10bfac){_0x24ca09=_0x24ca09-0x0;var _0x19f1cc=_0x5381[_0x24ca09];return _0x19f1cc;};'use strict';var multer=require(_0x1538('0x0'));var util=require(_0x1538('0x1'));var path=require(_0x1538('0x2'));var timeout=require(_0x1538('0x3'));var express=require(_0x1538('0x4'));var router=express[_0x1538('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x1538('0x6'));var controller=require(_0x1538('0x7'));router[_0x1538('0x8')]('/',auth[_0x1538('0x9')](),controller['index']);router[_0x1538('0x8')](_0x1538('0xa'),auth[_0x1538('0x9')](),controller[_0x1538('0xb')]);router[_0x1538('0x8')](_0x1538('0xc'),auth[_0x1538('0x9')](),controller[_0x1538('0xd')]);router[_0x1538('0x8')](_0x1538('0xe'),auth[_0x1538('0x9')](),controller[_0x1538('0xf')]);router['post']('/',auth[_0x1538('0x9')](),controller[_0x1538('0x10')]);router[_0x1538('0x11')](_0x1538('0xc'),auth[_0x1538('0x9')](),controller['addConfiguration']);router[_0x1538('0x12')]('/:id',auth[_0x1538('0x9')](),controller[_0x1538('0x13')]);router['delete'](_0x1538('0xa'),auth['isAuthenticated'](),controller[_0x1538('0x14')]);module[_0x1538('0x15')]=router; \ No newline at end of file +var _0xd3c8=['/:id','show','getConfigurations','/:id/fields','getFields','post','create','/:id/configurations','update','delete','destroy','exports','connect-timeout','fs-extra','../../components/interaction/service','../../config/environment','./intFreshdeskAccount.controller','get','isAuthenticated'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0xd3c8,0x91));var _0x8d3c=function(_0x95ecac,_0x49d69){_0x95ecac=_0x95ecac-0x0;var _0x41fc8c=_0xd3c8[_0x95ecac];return _0x41fc8c;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x8d3c('0x0'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x8d3c('0x1'));var auth=require('../../components/auth/service');var interaction=require(_0x8d3c('0x2'));var config=require(_0x8d3c('0x3'));var controller=require(_0x8d3c('0x4'));router[_0x8d3c('0x5')]('/',auth[_0x8d3c('0x6')](),controller['index']);router[_0x8d3c('0x5')](_0x8d3c('0x7'),auth[_0x8d3c('0x6')](),controller[_0x8d3c('0x8')]);router[_0x8d3c('0x5')]('/:id/configurations',auth[_0x8d3c('0x6')](),controller[_0x8d3c('0x9')]);router[_0x8d3c('0x5')](_0x8d3c('0xa'),auth[_0x8d3c('0x6')](),controller[_0x8d3c('0xb')]);router[_0x8d3c('0xc')]('/',auth[_0x8d3c('0x6')](),controller[_0x8d3c('0xd')]);router[_0x8d3c('0xc')](_0x8d3c('0xe'),auth[_0x8d3c('0x6')](),controller['addConfiguration']);router['put'](_0x8d3c('0x7'),auth['isAuthenticated'](),controller[_0x8d3c('0xf')]);router[_0x8d3c('0x10')](_0x8d3c('0x7'),auth[_0x8d3c('0x6')](),controller[_0x8d3c('0x11')]);module[_0x8d3c('0x12')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index c605cd6..7610be0 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 _0xe820=['sequelize','STRING','username'];(function(_0x3e8287,_0x4c08b8){var _0x346da5=function(_0x198d46){while(--_0x198d46){_0x3e8287['push'](_0x3e8287['shift']());}};_0x346da5(++_0x4c08b8);}(_0xe820,0xd2));var _0x0e82=function(_0x45bec6,_0x3cf863){_0x45bec6=_0x45bec6-0x0;var _0x8c2b59=_0xe820[_0x45bec6];return _0x8c2b59;};'use strict';var Sequelize=require(_0x0e82('0x0'));module['exports']={'name':{'type':Sequelize[_0x0e82('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0x0e82('0x2')},'apiKey':{'type':Sequelize[_0x0e82('0x1')]},'remoteUri':{'type':Sequelize[_0x0e82('0x1')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x0e82('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x056b=['username','remoteUri','exports','STRING'];(function(_0x3658b7,_0x167cba){var _0x1ec223=function(_0x2c7376){while(--_0x2c7376){_0x3658b7['push'](_0x3658b7['shift']());}};_0x1ec223(++_0x167cba);}(_0x056b,0xb6));var _0xb056=function(_0xaba8e7,_0xe99f8e){_0xaba8e7=_0xaba8e7-0x0;var _0x5cc226=_0x056b[_0xaba8e7];return _0x5cc226;};'use strict';var Sequelize=require('sequelize');module[_0xb056('0x0')]={'name':{'type':Sequelize[_0xb056('0x1')]},'description':{'type':Sequelize[_0xb056('0x1')]},'username':{'type':Sequelize[_0xb056('0x1')],'unique':_0xb056('0x2')},'apiKey':{'type':Sequelize[_0xb056('0x1')]},'remoteUri':{'type':Sequelize[_0xb056('0x1')],'unique':_0xb056('0x3')},'serverUrl':{'type':Sequelize[_0xb056('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index 411a474..db561b8 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 _0x2116=['querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../components/integrations/configuration','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','update','destroy','then','error','stack','name','send','index','map','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','FreshdeskAccount','include','findAll','rows','catch','show','find','create','body','params','getConfigurations','findOne','FreshdeskConfiguration','hasOwnProperty','addConfiguration','AccountId','getSubjects','channel','Descriptions','getDescriptions','FreshdeskField','getFields','apiKey','remoteUri','slice','substring','lastIndexOf','GET','format','%s/%s','api/v2/ticket_fields','%s:X','toString','base64','requester','subject','agent','priority','group','company','remove','includes','default','custom_text','custom_dropdown','label','choices','capitalize','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2116,0x67));var _0x6211=function(_0x4a0953,_0x98b6f2){_0x4a0953=_0x4a0953-0x0;var _0x5c1af0=_0x2116[_0x4a0953];return _0x5c1af0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6211('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6211('0x1'));var rp=require(_0x6211('0x2'));var moment=require(_0x6211('0x3'));var BPromise=require(_0x6211('0x4'));var Mustache=require('mustache');var util=require(_0x6211('0x5'));var path=require(_0x6211('0x6'));var sox=require(_0x6211('0x7'));var csv=require(_0x6211('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6211('0x9'));var _=require('lodash');var squel=require(_0x6211('0xa'));var crypto=require(_0x6211('0xb'));var jsforce=require(_0x6211('0xc'));var deskjs=require(_0x6211('0xd'));var toCsv=require(_0x6211('0x8'));var querystring=require(_0x6211('0xe'));var Papa=require(_0x6211('0xf'));var Redis=require('ioredis');var authService=require(_0x6211('0x10'));var qs=require(_0x6211('0x11'));var as=require(_0x6211('0x12'));var hardwareService=require(_0x6211('0x13'));var logger=require(_0x6211('0x14'))(_0x6211('0x15'));var utils=require(_0x6211('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x6211('0x17'));var db=require('../../mysqldb')['db'];var integrations=require(_0x6211('0x18'));function respondWithStatusCode(_0x6661a7,_0x22963d){_0x22963d=_0x22963d||0xcc;return function(_0x4bf101){if(_0x4bf101){return _0x6661a7[_0x6211('0x19')](_0x22963d);}return _0x6661a7[_0x6211('0x1a')](_0x22963d)[_0x6211('0x1b')]();};}function respondWithResult(_0x509faa,_0x54a303){_0x54a303=_0x54a303||0xc8;return function(_0x1685eb){if(_0x1685eb){return _0x509faa[_0x6211('0x1a')](_0x54a303)[_0x6211('0x1c')](_0x1685eb);}};}function respondWithFilteredResult(_0xf69c79,_0xa23863){return function(_0x15adb6){if(_0x15adb6){var _0x16d6a3=typeof _0xa23863[_0x6211('0x1d')]==='undefined'&&typeof _0xa23863[_0x6211('0x1e')]===_0x6211('0x1f');var _0x431081=_0x15adb6[_0x6211('0x20')];var _0xecea40=_0x16d6a3?0x0:_0xa23863[_0x6211('0x1d')];var _0x460efc=_0x16d6a3?_0x15adb6['count']:_0xa23863[_0x6211('0x1d')]+_0xa23863[_0x6211('0x1e')];var _0x5af096;if(_0x460efc>=_0x431081){_0x460efc=_0x431081;_0x5af096=0xc8;}else{_0x5af096=0xce;}_0xf69c79[_0x6211('0x1a')](_0x5af096);return _0xf69c79[_0x6211('0x21')](_0x6211('0x22'),_0xecea40+'-'+_0x460efc+'/'+_0x431081)[_0x6211('0x1c')](_0x15adb6);}return null;};}function patchUpdates(_0x4d99bc){return function(_0x51a389){try{jsonpatch[_0x6211('0x23')](_0x51a389,_0x4d99bc,!![]);}catch(_0x3cc2cf){return BPromise['reject'](_0x3cc2cf);}return _0x51a389['save']();};}function saveUpdates(_0x15ca00,_0x1e6a53){return function(_0x3a39fb){if(_0x3a39fb){return _0x3a39fb[_0x6211('0x24')](_0x15ca00)['then'](function(_0x2c1c0a){return _0x2c1c0a;});}return null;};}function removeEntity(_0x311054,_0x16fb0c){return function(_0x49153f){if(_0x49153f){return _0x49153f[_0x6211('0x25')]()[_0x6211('0x26')](function(){_0x311054[_0x6211('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x532778,_0x4ebae9){return function(_0x4c0017){if(!_0x4c0017){_0x532778['sendStatus'](0x194);}return _0x4c0017;};}function handleError(_0x15a096,_0x2badd2){_0x2badd2=_0x2badd2||0x1f4;return function(_0x140496){logger[_0x6211('0x27')](_0x140496[_0x6211('0x28')]);if(_0x140496[_0x6211('0x29')]){delete _0x140496[_0x6211('0x29')];}_0x15a096[_0x6211('0x1a')](_0x2badd2)[_0x6211('0x2a')](_0x140496);};}exports[_0x6211('0x2b')]=function(_0x105721,_0x38f5f8){var _0x3564f2={},_0x26a8cc={},_0x20e576={'count':0x0,'rows':[]};var _0x424ce3=_[_0x6211('0x2c')](db['FreshdeskAccount'][_0x6211('0x2d')],function(_0x44404a){return{'name':_0x44404a[_0x6211('0x2e')],'type':_0x44404a['type']['key']};});_0x26a8cc[_0x6211('0x2f')]=_['map'](_0x424ce3,_0x6211('0x29'));_0x26a8cc[_0x6211('0x30')]=_[_0x6211('0x31')](_0x105721['query']);_0x26a8cc[_0x6211('0x32')]=_[_0x6211('0x33')](_0x26a8cc[_0x6211('0x2f')],_0x26a8cc[_0x6211('0x30')]);_0x3564f2[_0x6211('0x34')]=_['intersection'](_0x26a8cc['model'],qs[_0x6211('0x35')](_0x105721['query']['fields']));_0x3564f2['attributes']=_0x3564f2[_0x6211('0x34')][_0x6211('0x36')]?_0x3564f2[_0x6211('0x34')]:_0x26a8cc['model'];if(!_0x105721[_0x6211('0x30')]['hasOwnProperty'](_0x6211('0x37'))){_0x3564f2[_0x6211('0x1e')]=qs[_0x6211('0x1e')](_0x105721['query'][_0x6211('0x1e')]);_0x3564f2[_0x6211('0x1d')]=qs[_0x6211('0x1d')](_0x105721[_0x6211('0x30')][_0x6211('0x1d')]);}_0x3564f2[_0x6211('0x38')]=qs[_0x6211('0x39')](_0x105721[_0x6211('0x30')]['sort']);_0x3564f2[_0x6211('0x3a')]=qs[_0x6211('0x32')](_[_0x6211('0x3b')](_0x105721[_0x6211('0x30')],_0x26a8cc[_0x6211('0x32')]),_0x424ce3);if(_0x105721['query'][_0x6211('0x3c')]){_0x3564f2[_0x6211('0x3a')]=_[_0x6211('0x3d')](_0x3564f2[_0x6211('0x3a')],{'$or':_['map'](_0x424ce3,function(_0x457ff9){if(_0x457ff9[_0x6211('0x3e')]!==_0x6211('0x3f')){var _0x1f3a4a={};_0x1f3a4a[_0x457ff9[_0x6211('0x29')]]={'$like':'%'+_0x105721[_0x6211('0x30')][_0x6211('0x3c')]+'%'};return _0x1f3a4a;}})});}_0x3564f2=_['merge']({},_0x3564f2,_0x105721[_0x6211('0x40')]);var _0x4ed0c5={'where':_0x3564f2[_0x6211('0x3a')]};return db[_0x6211('0x41')]['count'](_0x4ed0c5)[_0x6211('0x26')](function(_0x1b5e1c){_0x20e576['count']=_0x1b5e1c;if(_0x105721['query']['includeAll']){_0x3564f2[_0x6211('0x42')]=[{'all':!![]}];}return db[_0x6211('0x41')][_0x6211('0x43')](_0x3564f2);})['then'](function(_0x132fb7){_0x20e576[_0x6211('0x44')]=_0x132fb7;return _0x20e576;})[_0x6211('0x26')](respondWithFilteredResult(_0x38f5f8,_0x3564f2))[_0x6211('0x45')](handleError(_0x38f5f8,null));};exports[_0x6211('0x46')]=function(_0x476456,_0x28721a){var _0x371956={'raw':![],'where':{'id':_0x476456['params']['id']}},_0x4e2c14={};_0x4e2c14[_0x6211('0x2f')]=_[_0x6211('0x31')](db[_0x6211('0x41')][_0x6211('0x2d')]);_0x4e2c14[_0x6211('0x30')]=_[_0x6211('0x31')](_0x476456['query']);_0x4e2c14[_0x6211('0x32')]=_[_0x6211('0x33')](_0x4e2c14[_0x6211('0x2f')],_0x4e2c14[_0x6211('0x30')]);_0x371956[_0x6211('0x34')]=_['intersection'](_0x4e2c14[_0x6211('0x2f')],qs['fields'](_0x476456[_0x6211('0x30')]['fields']));_0x371956[_0x6211('0x34')]=_0x371956[_0x6211('0x34')]['length']?_0x371956[_0x6211('0x34')]:_0x4e2c14[_0x6211('0x2f')];if(_0x476456[_0x6211('0x30')]['includeAll']){_0x371956[_0x6211('0x42')]=[{'all':!![]}];}_0x371956=_['merge']({},_0x371956,_0x476456[_0x6211('0x40')]);return db['FreshdeskAccount'][_0x6211('0x47')](_0x371956)['then'](handleEntityNotFound(_0x28721a,null))[_0x6211('0x26')](respondWithResult(_0x28721a,null))[_0x6211('0x45')](handleError(_0x28721a,null));};exports[_0x6211('0x48')]=function(_0x2111fd,_0x27eae4){return db[_0x6211('0x41')][_0x6211('0x48')](_0x2111fd[_0x6211('0x49')],{})[_0x6211('0x26')](respondWithResult(_0x27eae4,0xc9))[_0x6211('0x45')](handleError(_0x27eae4,null));};exports['update']=function(_0x2bc4ae,_0x40c8df){if(_0x2bc4ae[_0x6211('0x49')]['id']){delete _0x2bc4ae[_0x6211('0x49')]['id'];}return db['FreshdeskAccount'][_0x6211('0x47')]({'where':{'id':_0x2bc4ae[_0x6211('0x4a')]['id']}})['then'](handleEntityNotFound(_0x40c8df,null))[_0x6211('0x26')](saveUpdates(_0x2bc4ae['body'],null))['then'](respondWithResult(_0x40c8df,null))[_0x6211('0x45')](handleError(_0x40c8df,null));};exports[_0x6211('0x25')]=function(_0x5aae45,_0xa0485a){return db[_0x6211('0x41')][_0x6211('0x47')]({'where':{'id':_0x5aae45[_0x6211('0x4a')]['id']}})[_0x6211('0x26')](handleEntityNotFound(_0xa0485a,null))['then'](removeEntity(_0xa0485a,null))[_0x6211('0x45')](handleError(_0xa0485a,null));};exports[_0x6211('0x4b')]=function(_0x1901d7,_0x4d0acd,_0x1b264a){var _0x588ab7={};var _0x21e5e2={};var _0x4a15b0;var _0x4b1d8e;return db[_0x6211('0x41')][_0x6211('0x4c')]({'where':{'id':_0x1901d7['params']['id']}})[_0x6211('0x26')](handleEntityNotFound(_0x4d0acd,null))[_0x6211('0x26')](function(_0x41c86a){if(_0x41c86a){_0x4a15b0=_0x41c86a;_0x21e5e2[_0x6211('0x2f')]=_['keys'](db[_0x6211('0x4d')][_0x6211('0x2d')]);_0x21e5e2[_0x6211('0x30')]=_[_0x6211('0x31')](_0x1901d7[_0x6211('0x30')]);_0x21e5e2[_0x6211('0x32')]=_[_0x6211('0x33')](_0x21e5e2[_0x6211('0x2f')],_0x21e5e2['query']);_0x588ab7[_0x6211('0x34')]=_[_0x6211('0x33')](_0x21e5e2['model'],qs['fields'](_0x1901d7[_0x6211('0x30')][_0x6211('0x35')]));_0x588ab7[_0x6211('0x34')]=_0x588ab7['attributes'][_0x6211('0x36')]?_0x588ab7['attributes']:_0x21e5e2[_0x6211('0x2f')];_0x588ab7[_0x6211('0x38')]=qs['sort'](_0x1901d7['query'][_0x6211('0x39')]);_0x588ab7[_0x6211('0x3a')]=qs[_0x6211('0x32')](_[_0x6211('0x3b')](_0x1901d7[_0x6211('0x30')],_0x21e5e2['filters']));if(_0x1901d7[_0x6211('0x30')][_0x6211('0x3c')]){_0x588ab7['where']=_[_0x6211('0x3d')](_0x588ab7[_0x6211('0x3a')],{'$or':_[_0x6211('0x2c')](_0x588ab7[_0x6211('0x34')],function(_0x18f08a){var _0x509302={};_0x509302[_0x18f08a]={'$like':'%'+_0x1901d7[_0x6211('0x30')][_0x6211('0x3c')]+'%'};return _0x509302;})});}_0x588ab7=_[_0x6211('0x3d')]({},_0x588ab7,_0x1901d7[_0x6211('0x40')]);return _0x4a15b0['getConfigurations'](_0x588ab7);}})[_0x6211('0x26')](function(_0x5628ac){if(_0x5628ac){_0x4b1d8e=_0x5628ac[_0x6211('0x36')];if(!_0x1901d7[_0x6211('0x30')][_0x6211('0x4e')]('nolimit')){_0x588ab7[_0x6211('0x1e')]=qs['limit'](_0x1901d7[_0x6211('0x30')][_0x6211('0x1e')]);_0x588ab7['offset']=qs[_0x6211('0x1d')](_0x1901d7['query'][_0x6211('0x1d')]);}return _0x4a15b0[_0x6211('0x4b')](_0x588ab7);}})[_0x6211('0x26')](function(_0x10d8d1){if(_0x10d8d1){return _0x10d8d1?{'count':_0x4b1d8e,'rows':_0x10d8d1}:null;}})['then'](respondWithResult(_0x4d0acd,null))[_0x6211('0x45')](handleError(_0x4d0acd,null));};exports[_0x6211('0x4f')]=function(_0x2aec5d,_0x15cb0a,_0x5453fd){if(_0x2aec5d[_0x6211('0x49')]['id']){delete _0x2aec5d[_0x6211('0x49')]['id'];}return db['FreshdeskAccount'][_0x6211('0x4c')]({'where':{'id':_0x2aec5d[_0x6211('0x4a')]['id']}})[_0x6211('0x26')](handleEntityNotFound(_0x15cb0a,null))[_0x6211('0x26')](function(_0x191f84){if(_0x191f84){_0x2aec5d[_0x6211('0x49')][_0x6211('0x50')]=_0x191f84['id'];_0x2aec5d[_0x6211('0x49')]['Subjects']=integrations[_0x6211('0x51')](_0x2aec5d[_0x6211('0x49')][_0x6211('0x52')],_0x2aec5d[_0x6211('0x49')][_0x6211('0x3e')]);_0x2aec5d[_0x6211('0x49')][_0x6211('0x53')]=integrations[_0x6211('0x54')](_0x2aec5d[_0x6211('0x49')][_0x6211('0x52')],_0x2aec5d['body']['type']);return db['FreshdeskConfiguration'][_0x6211('0x48')](_0x2aec5d['body'],{'include':[{'model':db[_0x6211('0x55')],'as':'Subjects'},{'model':db[_0x6211('0x55')],'as':_0x6211('0x53')}]});}return null;})[_0x6211('0x26')](respondWithResult(_0x15cb0a,null))['catch'](handleError(_0x15cb0a,null));};exports[_0x6211('0x56')]=function(_0x361dd3,_0x1b6f09,_0xa90873){var _0x144620='';return db[_0x6211('0x41')]['findOne']({'where':{'id':_0x361dd3[_0x6211('0x4a')]['id']},'attributes':['id','remoteUri',_0x6211('0x57')]})['then'](handleEntityNotFound(_0x1b6f09,null))[_0x6211('0x26')](function(_0x370016){if(_0x370016){_0x144620=_0x370016[_0x6211('0x58')];var _0x58e51d=_0x144620[_0x6211('0x59')](-0x1);if(_0x58e51d==='/'){_0x144620=_0x144620[_0x6211('0x5a')](0x0,_0x144620[_0x6211('0x5b')](_0x58e51d));}return rp({'method':_0x6211('0x5c'),'uri':util[_0x6211('0x5d')](_0x6211('0x5e'),_0x144620,_0x6211('0x5f')),'headers':{'Authorization':util[_0x6211('0x5d')]('Basic\x20%s',new Buffer(util[_0x6211('0x5d')](_0x6211('0x60'),_0x370016['apiKey']))[_0x6211('0x61')](_0x6211('0x62')))},'json':!![]});}})[_0x6211('0x26')](function(_0x35e822){if(_0x35e822){var _0x40fad2=[_0x6211('0x63'),_0x6211('0x64'),_0x6211('0x65'),'description',_0x6211('0x1a'),_0x6211('0x66'),_0x6211('0x67'),'source','ticket_type',_0x6211('0x67'),_0x6211('0x68')];_[_0x6211('0x69')](_0x35e822,function(_0x4d7a5b){return _0x40fad2[_0x6211('0x6a')](_0x4d7a5b[_0x6211('0x29')])||!_0x4d7a5b[_0x6211('0x6b')]&&_0x4d7a5b[_0x6211('0x3e')]!==_0x6211('0x6c')&&_0x4d7a5b['type']!==_0x6211('0x6d');});return{'count':_0x35e822[_0x6211('0x36')],'rows':_['map'](_0x35e822,function(_0x2ad122){return{'id':_0x2ad122['name'],'name':_0x2ad122[_0x6211('0x6e')],'custom':!_0x2ad122['default'],'options':_0x2ad122[_0x6211('0x6f')]?_[_0x6211('0x2c')](_0x2ad122[_0x6211('0x6f')],function(_0xa5e9a){return{'name':_[_0x6211('0x70')](_0xa5e9a),'value':_0xa5e9a};}):[]};})};}})['then'](respondWithResult(_0x1b6f09,null))[_0x6211('0x45')](function(_0x12b48b){var _0x5526b5=_0x361dd3[_0x6211('0x30')][_0x6211('0x71')]?0x1f4:_0x12b48b[_0x6211('0x72')]||0x1f4;logger[_0x6211('0x27')](_0x6211('0x73'),_0x6211('0x56'),_0x5526b5,JSON[_0x6211('0x74')](_0x12b48b));delete _0x12b48b['name'];if(_0x5526b5===0x191){_0x5526b5=0x190;}_0x1b6f09[_0x6211('0x1a')](_0x5526b5)[_0x6211('0x2a')](_0x361dd3[_0x6211('0x30')][_0x6211('0x71')]?{'message':'Wrong\x20credentials','statusCode':_0x12b48b[_0x6211('0x72')]}:_0x12b48b);});}; \ No newline at end of file +var _0x131e=['VIRTUAL','filter','include','findAll','catch','show','params','keys','rawAttributes','includeAll','options','find','create','body','destroy','findOne','FreshdeskConfiguration','pick','getConfigurations','nolimit','AccountId','Subjects','getSubjects','Descriptions','channel','FreshdeskField','remoteUri','apiKey','slice','substring','lastIndexOf','GET','format','%s/%s','api/v2/ticket_fields','Basic\x20%s','toString','subject','agent','description','priority','group','source','ticket_type','company','remove','includes','default','label','choices','capitalize','test','statusCode','getFields','stringify','Wrong\x20credentials','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','then','error','stack','name','send','index','FreshdeskAccount','type','model','map','query','filters','intersection','attributes','fields','length','order','sort','where','merge'];(function(_0xbb091,_0x3fe7ee){var _0x467a04=function(_0x3a978d){while(--_0x3a978d){_0xbb091['push'](_0xbb091['shift']());}};_0x467a04(++_0x3fe7ee);}(_0x131e,0x1ec));var _0xe131=function(_0x4124ec,_0x50e856){_0x4124ec=_0x4124ec-0x0;var _0x10e46f=_0x131e[_0x4124ec];return _0x10e46f;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xe131('0x0'));var rp=require(_0xe131('0x1'));var moment=require(_0xe131('0x2'));var BPromise=require(_0xe131('0x3'));var Mustache=require(_0xe131('0x4'));var util=require(_0xe131('0x5'));var path=require('path');var sox=require(_0xe131('0x6'));var csv=require(_0xe131('0x7'));var ejs=require(_0xe131('0x8'));var fs=require('fs');var fs_extra=require(_0xe131('0x9'));var _=require(_0xe131('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xe131('0x7'));var querystring=require(_0xe131('0xb'));var Papa=require('papaparse');var Redis=require(_0xe131('0xc'));var authService=require('../../components/auth/service');var qs=require(_0xe131('0xd'));var as=require(_0xe131('0xe'));var hardwareService=require(_0xe131('0xf'));var logger=require(_0xe131('0x10'))(_0xe131('0x11'));var utils=require(_0xe131('0x12'));var config=require(_0xe131('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x5f0434,_0x14ed9a){_0x14ed9a=_0x14ed9a||0xcc;return function(_0x1714db){if(_0x1714db){return _0x5f0434[_0xe131('0x14')](_0x14ed9a);}return _0x5f0434[_0xe131('0x15')](_0x14ed9a)[_0xe131('0x16')]();};}function respondWithResult(_0x420cc2,_0x436549){_0x436549=_0x436549||0xc8;return function(_0x27120f){if(_0x27120f){return _0x420cc2[_0xe131('0x15')](_0x436549)['json'](_0x27120f);}};}function respondWithFilteredResult(_0x4aa1bf,_0x4dfbdf){return function(_0x5a6ca9){if(_0x5a6ca9){var _0x4987dc=typeof _0x4dfbdf[_0xe131('0x17')]===_0xe131('0x18')&&typeof _0x4dfbdf[_0xe131('0x19')]==='undefined';var _0x503e86=_0x5a6ca9[_0xe131('0x1a')];var _0x2e2bf8=_0x4987dc?0x0:_0x4dfbdf[_0xe131('0x17')];var _0x1a1e03=_0x4987dc?_0x5a6ca9[_0xe131('0x1a')]:_0x4dfbdf[_0xe131('0x17')]+_0x4dfbdf['limit'];var _0x4690b0;if(_0x1a1e03>=_0x503e86){_0x1a1e03=_0x503e86;_0x4690b0=0xc8;}else{_0x4690b0=0xce;}_0x4aa1bf[_0xe131('0x15')](_0x4690b0);return _0x4aa1bf[_0xe131('0x1b')](_0xe131('0x1c'),_0x2e2bf8+'-'+_0x1a1e03+'/'+_0x503e86)[_0xe131('0x1d')](_0x5a6ca9);}return null;};}function patchUpdates(_0x49b19e){return function(_0x4c24e5){try{jsonpatch[_0xe131('0x1e')](_0x4c24e5,_0x49b19e,!![]);}catch(_0x41c4e1){return BPromise['reject'](_0x41c4e1);}return _0x4c24e5[_0xe131('0x1f')]();};}function saveUpdates(_0x55b0c5,_0x49f304){return function(_0x19d141){if(_0x19d141){return _0x19d141[_0xe131('0x20')](_0x55b0c5)[_0xe131('0x21')](function(_0xecb533){return _0xecb533;});}return null;};}function removeEntity(_0x166409,_0x225278){return function(_0x2bcb68){if(_0x2bcb68){return _0x2bcb68['destroy']()[_0xe131('0x21')](function(){_0x166409[_0xe131('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4e7cb8,_0x330638){return function(_0x5b2f47){if(!_0x5b2f47){_0x4e7cb8[_0xe131('0x14')](0x194);}return _0x5b2f47;};}function handleError(_0x3b95bf,_0x51e109){_0x51e109=_0x51e109||0x1f4;return function(_0x44935b){logger[_0xe131('0x22')](_0x44935b[_0xe131('0x23')]);if(_0x44935b['name']){delete _0x44935b[_0xe131('0x24')];}_0x3b95bf[_0xe131('0x15')](_0x51e109)[_0xe131('0x25')](_0x44935b);};}exports[_0xe131('0x26')]=function(_0xb306b4,_0x2fce8c){var _0x1ff557={},_0x3414f1={},_0x9f8c66={'count':0x0,'rows':[]};var _0x341294=_['map'](db[_0xe131('0x27')]['rawAttributes'],function(_0x155c67){return{'name':_0x155c67['fieldName'],'type':_0x155c67[_0xe131('0x28')]['key']};});_0x3414f1[_0xe131('0x29')]=_[_0xe131('0x2a')](_0x341294,_0xe131('0x24'));_0x3414f1['query']=_['keys'](_0xb306b4[_0xe131('0x2b')]);_0x3414f1[_0xe131('0x2c')]=_[_0xe131('0x2d')](_0x3414f1[_0xe131('0x29')],_0x3414f1[_0xe131('0x2b')]);_0x1ff557[_0xe131('0x2e')]=_[_0xe131('0x2d')](_0x3414f1[_0xe131('0x29')],qs['fields'](_0xb306b4['query'][_0xe131('0x2f')]));_0x1ff557[_0xe131('0x2e')]=_0x1ff557[_0xe131('0x2e')][_0xe131('0x30')]?_0x1ff557[_0xe131('0x2e')]:_0x3414f1[_0xe131('0x29')];if(!_0xb306b4[_0xe131('0x2b')]['hasOwnProperty']('nolimit')){_0x1ff557[_0xe131('0x19')]=qs['limit'](_0xb306b4[_0xe131('0x2b')]['limit']);_0x1ff557[_0xe131('0x17')]=qs['offset'](_0xb306b4[_0xe131('0x2b')]['offset']);}_0x1ff557[_0xe131('0x31')]=qs[_0xe131('0x32')](_0xb306b4[_0xe131('0x2b')][_0xe131('0x32')]);_0x1ff557[_0xe131('0x33')]=qs[_0xe131('0x2c')](_['pick'](_0xb306b4[_0xe131('0x2b')],_0x3414f1['filters']),_0x341294);if(_0xb306b4[_0xe131('0x2b')]['filter']){_0x1ff557[_0xe131('0x33')]=_[_0xe131('0x34')](_0x1ff557[_0xe131('0x33')],{'$or':_[_0xe131('0x2a')](_0x341294,function(_0xd8cf9d){if(_0xd8cf9d[_0xe131('0x28')]!==_0xe131('0x35')){var _0x5a5498={};_0x5a5498[_0xd8cf9d[_0xe131('0x24')]]={'$like':'%'+_0xb306b4['query'][_0xe131('0x36')]+'%'};return _0x5a5498;}})});}_0x1ff557=_[_0xe131('0x34')]({},_0x1ff557,_0xb306b4['options']);var _0x5a9a34={'where':_0x1ff557[_0xe131('0x33')]};return db['FreshdeskAccount']['count'](_0x5a9a34)[_0xe131('0x21')](function(_0x5b82e5){_0x9f8c66[_0xe131('0x1a')]=_0x5b82e5;if(_0xb306b4[_0xe131('0x2b')]['includeAll']){_0x1ff557[_0xe131('0x37')]=[{'all':!![]}];}return db[_0xe131('0x27')][_0xe131('0x38')](_0x1ff557);})[_0xe131('0x21')](function(_0xa077dd){_0x9f8c66['rows']=_0xa077dd;return _0x9f8c66;})['then'](respondWithFilteredResult(_0x2fce8c,_0x1ff557))[_0xe131('0x39')](handleError(_0x2fce8c,null));};exports[_0xe131('0x3a')]=function(_0x2a9a07,_0x58fe5c){var _0x34f5ae={'raw':![],'where':{'id':_0x2a9a07[_0xe131('0x3b')]['id']}},_0x112e78={};_0x112e78['model']=_[_0xe131('0x3c')](db[_0xe131('0x27')][_0xe131('0x3d')]);_0x112e78['query']=_[_0xe131('0x3c')](_0x2a9a07[_0xe131('0x2b')]);_0x112e78[_0xe131('0x2c')]=_['intersection'](_0x112e78[_0xe131('0x29')],_0x112e78[_0xe131('0x2b')]);_0x34f5ae[_0xe131('0x2e')]=_[_0xe131('0x2d')](_0x112e78[_0xe131('0x29')],qs[_0xe131('0x2f')](_0x2a9a07[_0xe131('0x2b')]['fields']));_0x34f5ae['attributes']=_0x34f5ae[_0xe131('0x2e')][_0xe131('0x30')]?_0x34f5ae[_0xe131('0x2e')]:_0x112e78[_0xe131('0x29')];if(_0x2a9a07[_0xe131('0x2b')][_0xe131('0x3e')]){_0x34f5ae['include']=[{'all':!![]}];}_0x34f5ae=_[_0xe131('0x34')]({},_0x34f5ae,_0x2a9a07[_0xe131('0x3f')]);return db[_0xe131('0x27')][_0xe131('0x40')](_0x34f5ae)[_0xe131('0x21')](handleEntityNotFound(_0x58fe5c,null))[_0xe131('0x21')](respondWithResult(_0x58fe5c,null))['catch'](handleError(_0x58fe5c,null));};exports[_0xe131('0x41')]=function(_0x1ce9b7,_0x173a71){return db[_0xe131('0x27')][_0xe131('0x41')](_0x1ce9b7[_0xe131('0x42')],{})[_0xe131('0x21')](respondWithResult(_0x173a71,0xc9))[_0xe131('0x39')](handleError(_0x173a71,null));};exports[_0xe131('0x20')]=function(_0x320699,_0x442f06){if(_0x320699['body']['id']){delete _0x320699[_0xe131('0x42')]['id'];}return db['FreshdeskAccount']['find']({'where':{'id':_0x320699[_0xe131('0x3b')]['id']}})[_0xe131('0x21')](handleEntityNotFound(_0x442f06,null))[_0xe131('0x21')](saveUpdates(_0x320699[_0xe131('0x42')],null))[_0xe131('0x21')](respondWithResult(_0x442f06,null))[_0xe131('0x39')](handleError(_0x442f06,null));};exports[_0xe131('0x43')]=function(_0x398c39,_0x81206e){return db[_0xe131('0x27')][_0xe131('0x40')]({'where':{'id':_0x398c39['params']['id']}})['then'](handleEntityNotFound(_0x81206e,null))[_0xe131('0x21')](removeEntity(_0x81206e,null))[_0xe131('0x39')](handleError(_0x81206e,null));};exports['getConfigurations']=function(_0x56893d,_0x2b934b,_0x564a29){var _0x5b0ab5={};var _0xe0d786={};var _0x34404e;var _0x32e45d;return db[_0xe131('0x27')][_0xe131('0x44')]({'where':{'id':_0x56893d[_0xe131('0x3b')]['id']}})['then'](handleEntityNotFound(_0x2b934b,null))['then'](function(_0x40d0cb){if(_0x40d0cb){_0x34404e=_0x40d0cb;_0xe0d786[_0xe131('0x29')]=_['keys'](db[_0xe131('0x45')][_0xe131('0x3d')]);_0xe0d786[_0xe131('0x2b')]=_[_0xe131('0x3c')](_0x56893d[_0xe131('0x2b')]);_0xe0d786[_0xe131('0x2c')]=_['intersection'](_0xe0d786[_0xe131('0x29')],_0xe0d786['query']);_0x5b0ab5['attributes']=_[_0xe131('0x2d')](_0xe0d786[_0xe131('0x29')],qs['fields'](_0x56893d['query'][_0xe131('0x2f')]));_0x5b0ab5[_0xe131('0x2e')]=_0x5b0ab5[_0xe131('0x2e')]['length']?_0x5b0ab5[_0xe131('0x2e')]:_0xe0d786[_0xe131('0x29')];_0x5b0ab5[_0xe131('0x31')]=qs[_0xe131('0x32')](_0x56893d[_0xe131('0x2b')]['sort']);_0x5b0ab5[_0xe131('0x33')]=qs['filters'](_[_0xe131('0x46')](_0x56893d[_0xe131('0x2b')],_0xe0d786[_0xe131('0x2c')]));if(_0x56893d[_0xe131('0x2b')]['filter']){_0x5b0ab5['where']=_['merge'](_0x5b0ab5[_0xe131('0x33')],{'$or':_['map'](_0x5b0ab5[_0xe131('0x2e')],function(_0x44f69f){var _0x413b70={};_0x413b70[_0x44f69f]={'$like':'%'+_0x56893d[_0xe131('0x2b')][_0xe131('0x36')]+'%'};return _0x413b70;})});}_0x5b0ab5=_[_0xe131('0x34')]({},_0x5b0ab5,_0x56893d[_0xe131('0x3f')]);return _0x34404e[_0xe131('0x47')](_0x5b0ab5);}})[_0xe131('0x21')](function(_0x14d4b5){if(_0x14d4b5){_0x32e45d=_0x14d4b5['length'];if(!_0x56893d['query']['hasOwnProperty'](_0xe131('0x48'))){_0x5b0ab5[_0xe131('0x19')]=qs[_0xe131('0x19')](_0x56893d[_0xe131('0x2b')]['limit']);_0x5b0ab5[_0xe131('0x17')]=qs[_0xe131('0x17')](_0x56893d[_0xe131('0x2b')][_0xe131('0x17')]);}return _0x34404e[_0xe131('0x47')](_0x5b0ab5);}})[_0xe131('0x21')](function(_0x52143e){if(_0x52143e){return _0x52143e?{'count':_0x32e45d,'rows':_0x52143e}:null;}})['then'](respondWithResult(_0x2b934b,null))[_0xe131('0x39')](handleError(_0x2b934b,null));};exports['addConfiguration']=function(_0x484a2e,_0x537d66,_0x1c194a){if(_0x484a2e['body']['id']){delete _0x484a2e[_0xe131('0x42')]['id'];}return db['FreshdeskAccount'][_0xe131('0x44')]({'where':{'id':_0x484a2e[_0xe131('0x3b')]['id']}})[_0xe131('0x21')](handleEntityNotFound(_0x537d66,null))[_0xe131('0x21')](function(_0x47d96b){if(_0x47d96b){_0x484a2e[_0xe131('0x42')][_0xe131('0x49')]=_0x47d96b['id'];_0x484a2e[_0xe131('0x42')][_0xe131('0x4a')]=integrations[_0xe131('0x4b')](_0x484a2e[_0xe131('0x42')]['channel'],_0x484a2e[_0xe131('0x42')][_0xe131('0x28')]);_0x484a2e['body'][_0xe131('0x4c')]=integrations['getDescriptions'](_0x484a2e['body'][_0xe131('0x4d')],_0x484a2e['body'][_0xe131('0x28')]);return db[_0xe131('0x45')][_0xe131('0x41')](_0x484a2e['body'],{'include':[{'model':db[_0xe131('0x4e')],'as':_0xe131('0x4a')},{'model':db[_0xe131('0x4e')],'as':_0xe131('0x4c')}]});}return null;})[_0xe131('0x21')](respondWithResult(_0x537d66,null))[_0xe131('0x39')](handleError(_0x537d66,null));};exports['getFields']=function(_0x592750,_0x68f7c3,_0x50725b){var _0x10b7b9='';return db['FreshdeskAccount'][_0xe131('0x44')]({'where':{'id':_0x592750[_0xe131('0x3b')]['id']},'attributes':['id',_0xe131('0x4f'),_0xe131('0x50')]})[_0xe131('0x21')](handleEntityNotFound(_0x68f7c3,null))[_0xe131('0x21')](function(_0x59beee){if(_0x59beee){_0x10b7b9=_0x59beee[_0xe131('0x4f')];var _0x1a4bf2=_0x10b7b9[_0xe131('0x51')](-0x1);if(_0x1a4bf2==='/'){_0x10b7b9=_0x10b7b9[_0xe131('0x52')](0x0,_0x10b7b9[_0xe131('0x53')](_0x1a4bf2));}return rp({'method':_0xe131('0x54'),'uri':util[_0xe131('0x55')](_0xe131('0x56'),_0x10b7b9,_0xe131('0x57')),'headers':{'Authorization':util[_0xe131('0x55')](_0xe131('0x58'),new Buffer(util[_0xe131('0x55')]('%s:X',_0x59beee[_0xe131('0x50')]))[_0xe131('0x59')]('base64'))},'json':!![]});}})[_0xe131('0x21')](function(_0x34d77b){if(_0x34d77b){var _0x216901=['requester',_0xe131('0x5a'),_0xe131('0x5b'),_0xe131('0x5c'),_0xe131('0x15'),_0xe131('0x5d'),_0xe131('0x5e'),_0xe131('0x5f'),_0xe131('0x60'),_0xe131('0x5e'),_0xe131('0x61')];_[_0xe131('0x62')](_0x34d77b,function(_0xcc8cd7){return _0x216901[_0xe131('0x63')](_0xcc8cd7[_0xe131('0x24')])||!_0xcc8cd7[_0xe131('0x64')]&&_0xcc8cd7['type']!=='custom_text'&&_0xcc8cd7[_0xe131('0x28')]!=='custom_dropdown';});return{'count':_0x34d77b[_0xe131('0x30')],'rows':_[_0xe131('0x2a')](_0x34d77b,function(_0x885ea7){return{'id':_0x885ea7[_0xe131('0x24')],'name':_0x885ea7[_0xe131('0x65')],'custom':!_0x885ea7['default'],'options':_0x885ea7[_0xe131('0x66')]?_['map'](_0x885ea7[_0xe131('0x66')],function(_0x23f9a8){return{'name':_[_0xe131('0x67')](_0x23f9a8),'value':_0x23f9a8};}):[]};})};}})[_0xe131('0x21')](respondWithResult(_0x68f7c3,null))['catch'](function(_0x1642d6){var _0x2df523=_0x592750[_0xe131('0x2b')][_0xe131('0x68')]?0x1f4:_0x1642d6[_0xe131('0x69')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0xe131('0x6a'),_0x2df523,JSON[_0xe131('0x6b')](_0x1642d6));delete _0x1642d6[_0xe131('0x24')];if(_0x2df523===0x191){_0x2df523=0x190;}_0x68f7c3['status'](_0x2df523)['send'](_0x592750[_0xe131('0x2b')][_0xe131('0x68')]?{'message':_0xe131('0x6c'),'statusCode':_0x1642d6[_0xe131('0x69')]}:_0x1642d6);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index 73d55d7..e4a6f81 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 _0xd008=['../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./intFreshdeskAccount.attributes','exports','FreshdeskAccount','int_freshdesk_accounts','lodash','util'];(function(_0x4074d5,_0xa57194){var _0x502cfe=function(_0x345efa){while(--_0x345efa){_0x4074d5['push'](_0x4074d5['shift']());}};_0x502cfe(++_0xa57194);}(_0xd008,0xfa));var _0x8d00=function(_0x126e0b,_0x45c0b3){_0x126e0b=_0x126e0b-0x0;var _0x9061c5=_0xd008[_0x126e0b];return _0x9061c5;};'use strict';var _=require(_0x8d00('0x0'));var util=require(_0x8d00('0x1'));var logger=require(_0x8d00('0x2'))(_0x8d00('0x3'));var moment=require('moment');var BPromise=require(_0x8d00('0x4'));var rp=require(_0x8d00('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8d00('0x6'));var config=require(_0x8d00('0x7'));var attributes=require(_0x8d00('0x8'));var integrations=require('../../components/integrations/configuration');module[_0x8d00('0x9')]=function(_0x21ee15,_0x13405c){return _0x21ee15['define'](_0x8d00('0xa'),attributes,{'tableName':_0x8d00('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb936=['moment','bluebird','path','rimraf','../../config/environment','../../components/integrations/configuration','exports','define','int_freshdesk_accounts','lodash','../../config/logger','api'];(function(_0x2b3ee0,_0x226a0b){var _0x4b4be4=function(_0x153da7){while(--_0x153da7){_0x2b3ee0['push'](_0x2b3ee0['shift']());}};_0x4b4be4(++_0x226a0b);}(_0xb936,0xf9));var _0x6b93=function(_0x10504c,_0x1c7117){_0x10504c=_0x10504c-0x0;var _0x4722ac=_0xb936[_0x10504c];return _0x4722ac;};'use strict';var _=require(_0x6b93('0x0'));var util=require('util');var logger=require(_0x6b93('0x1'))(_0x6b93('0x2'));var moment=require(_0x6b93('0x3'));var BPromise=require(_0x6b93('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6b93('0x5'));var rimraf=require(_0x6b93('0x6'));var config=require(_0x6b93('0x7'));var attributes=require('./intFreshdeskAccount.attributes');var integrations=require(_0x6b93('0x8'));module[_0x6b93('0x9')]=function(_0x318069,_0x492b66){return _0x318069[_0x6b93('0xa')]('FreshdeskAccount',attributes,{'tableName':_0x6b93('0xb'),'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 9dac6de..903b374 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 _0xc900=['debug','request\x20sent','stringify','error','code','message','result','GetFreshdeskAccount','findAll','options','raw','attributes','include','map','model','catch','ShowFreshdeskAccount','FreshdeskAccount','where','lodash','util','bluebird','ioredis','../../config/utils','rpc','http','request','then','info','FreshdeskAccount,\x20%s,\x20%s'];(function(_0x1a6b49,_0x50ea79){var _0xf3badf=function(_0x5409f9){while(--_0x5409f9){_0x1a6b49['push'](_0x1a6b49['shift']());}};_0xf3badf(++_0x50ea79);}(_0xc900,0xc7));var _0x0c90=function(_0x228dff,_0x4d988d){_0x228dff=_0x228dff-0x0;var _0x55fde2=_0xc900[_0x228dff];return _0x55fde2;};'use strict';var _=require(_0x0c90('0x0'));var util=require(_0x0c90('0x1'));var moment=require('moment');var BPromise=require(_0x0c90('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0c90('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0c90('0x4'));var logger=require('../../config/logger')(_0x0c90('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x0c90('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x34b482,_0x3bf50c,_0x9d243e){return new BPromise(function(_0x5a43df,_0x12e6e0){return client[_0x0c90('0x7')](_0x34b482,_0x9d243e)[_0x0c90('0x8')](function(_0x406d55){logger[_0x0c90('0x9')](_0x0c90('0xa'),_0x3bf50c,'request\x20sent');logger[_0x0c90('0xb')]('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0x3bf50c,_0x0c90('0xc'),JSON[_0x0c90('0xd')](_0x406d55));if(_0x406d55[_0x0c90('0xe')]){if(_0x406d55[_0x0c90('0xe')][_0x0c90('0xf')]===0x1f4){logger[_0x0c90('0xe')]('FreshdeskAccount,\x20%s,\x20%s',_0x3bf50c,_0x406d55[_0x0c90('0xe')][_0x0c90('0x10')]);return _0x12e6e0(_0x406d55[_0x0c90('0xe')]['message']);}logger[_0x0c90('0xe')](_0x0c90('0xa'),_0x3bf50c,_0x406d55[_0x0c90('0xe')]['message']);return _0x5a43df(_0x406d55[_0x0c90('0xe')][_0x0c90('0x10')]);}else{logger[_0x0c90('0x9')](_0x0c90('0xa'),_0x3bf50c,_0x0c90('0xc'));_0x5a43df(_0x406d55[_0x0c90('0x11')][_0x0c90('0x10')]);}})['catch'](function(_0x3bf2a1){logger[_0x0c90('0xe')]('FreshdeskAccount,\x20%s,\x20%s',_0x3bf50c,_0x3bf2a1);_0x12e6e0(_0x3bf2a1);});});}exports[_0x0c90('0x12')]=function(_0x4e3a61){var _0x4b9383=this;return new Promise(function(_0x4a077c,_0x4596db){return db['FreshdeskAccount'][_0x0c90('0x13')]({'raw':_0x4e3a61[_0x0c90('0x14')]?_0x4e3a61[_0x0c90('0x14')][_0x0c90('0x15')]===undefined?!![]:![]:!![],'where':_0x4e3a61[_0x0c90('0x14')]?_0x4e3a61[_0x0c90('0x14')]['where']||null:null,'attributes':_0x4e3a61[_0x0c90('0x14')]?_0x4e3a61['options'][_0x0c90('0x16')]||null:null,'limit':_0x4e3a61[_0x0c90('0x14')]?_0x4e3a61[_0x0c90('0x14')]['limit']||null:null,'include':_0x4e3a61[_0x0c90('0x14')]?_0x4e3a61[_0x0c90('0x14')][_0x0c90('0x17')]?_[_0x0c90('0x18')](_0x4e3a61[_0x0c90('0x14')]['include'],function(_0x21fba6){return{'model':db[_0x21fba6['model']],'as':_0x21fba6['as'],'attributes':_0x21fba6[_0x0c90('0x16')],'include':_0x21fba6['include']?_[_0x0c90('0x18')](_0x21fba6[_0x0c90('0x17')],function(_0xae29b9){return{'model':db[_0xae29b9[_0x0c90('0x19')]],'as':_0xae29b9['as'],'attributes':_0xae29b9[_0x0c90('0x16')],'include':_0xae29b9['include']?_[_0x0c90('0x18')](_0xae29b9[_0x0c90('0x17')],function(_0x121d3a){return{'model':db[_0x121d3a[_0x0c90('0x19')]],'as':_0x121d3a['as'],'attributes':_0x121d3a[_0x0c90('0x16')]};}):[]};}):[]};}):[]:[]})[_0x0c90('0x8')](function(_0xfbed99){logger[_0x0c90('0x9')](_0x0c90('0x12'),_0x4e3a61);logger[_0x0c90('0xb')](_0x0c90('0x12'),_0x4e3a61,JSON[_0x0c90('0xd')](_0xfbed99));_0x4a077c(_0xfbed99);})[_0x0c90('0x1a')](function(_0x49ae1a){logger[_0x0c90('0xe')](_0x0c90('0x12'),_0x49ae1a[_0x0c90('0x10')],_0x4e3a61);_0x4596db(_0x4b9383[_0x0c90('0xe')](0x1f4,_0x49ae1a[_0x0c90('0x10')]));});});};exports[_0x0c90('0x1b')]=function(_0x3f88b1){var _0x16980a=this;return new Promise(function(_0x40304e,_0x27f3b3){return db[_0x0c90('0x1c')]['find']({'raw':_0x3f88b1['options']?_0x3f88b1[_0x0c90('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0x3f88b1[_0x0c90('0x14')]?_0x3f88b1[_0x0c90('0x14')][_0x0c90('0x1d')]||null:null,'attributes':_0x3f88b1['options']?_0x3f88b1[_0x0c90('0x14')][_0x0c90('0x16')]||null:null,'include':_0x3f88b1[_0x0c90('0x14')]?_0x3f88b1[_0x0c90('0x14')][_0x0c90('0x17')]?_[_0x0c90('0x18')](_0x3f88b1[_0x0c90('0x14')][_0x0c90('0x17')],function(_0x53873b){return{'model':db[_0x53873b[_0x0c90('0x19')]],'as':_0x53873b['as'],'attributes':_0x53873b[_0x0c90('0x16')],'include':_0x53873b[_0x0c90('0x17')]?_[_0x0c90('0x18')](_0x53873b[_0x0c90('0x17')],function(_0x30c48f){return{'model':db[_0x30c48f[_0x0c90('0x19')]],'as':_0x30c48f['as'],'attributes':_0x30c48f[_0x0c90('0x16')],'include':_0x30c48f[_0x0c90('0x17')]?_[_0x0c90('0x18')](_0x30c48f['include'],function(_0x390e55){return{'model':db[_0x390e55[_0x0c90('0x19')]],'as':_0x390e55['as'],'attributes':_0x390e55[_0x0c90('0x16')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xe2a8f8){logger[_0x0c90('0x9')](_0x0c90('0x1b'),_0x3f88b1);logger[_0x0c90('0xb')]('ShowFreshdeskAccount',_0x3f88b1,JSON[_0x0c90('0xd')](_0xe2a8f8));_0x40304e(_0xe2a8f8);})[_0x0c90('0x1a')](function(_0x5213af){logger[_0x0c90('0xe')](_0x0c90('0x1b'),_0x5213af[_0x0c90('0x10')],_0x3f88b1);_0x27f3b3(_0x16980a[_0x0c90('0xe')](0x1f4,_0x5213af[_0x0c90('0x10')]));});});}; \ No newline at end of file +var _0xe528=['request\x20sent','stringify','error','code','message','info','FreshdeskAccount,\x20%s,\x20%s','catch','GetFreshdeskAccount','findAll','options','raw','where','attributes','limit','include','map','model','ShowFreshdeskAccount','FreshdeskAccount','find','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s'];(function(_0x55ca56,_0x3c72fd){var _0x3d684e=function(_0x2a554d){while(--_0x2a554d){_0x55ca56['push'](_0x55ca56['shift']());}};_0x3d684e(++_0x3c72fd);}(_0xe528,0x9d));var _0x8e52=function(_0x51eaf9,_0x37fcc1){_0x51eaf9=_0x51eaf9-0x0;var _0x49da42=_0xe528[_0x51eaf9];return _0x49da42;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x8e52('0x0'));var BPromise=require(_0x8e52('0x1'));var rs=require(_0x8e52('0x2'));var fs=require('fs');var Redis=require(_0x8e52('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x8e52('0x4'))(_0x8e52('0x5'));var config=require(_0x8e52('0x6'));var jayson=require(_0x8e52('0x7'));var client=jayson['client'][_0x8e52('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2be5b8,_0xa7202a,_0xb3f277){return new BPromise(function(_0x8ef34f,_0x38ac36){return client[_0x8e52('0x9')](_0x2be5b8,_0xb3f277)[_0x8e52('0xa')](function(_0x594e8e){logger['info']('FreshdeskAccount,\x20%s,\x20%s',_0xa7202a,'request\x20sent');logger[_0x8e52('0xb')](_0x8e52('0xc'),_0xa7202a,_0x8e52('0xd'),JSON[_0x8e52('0xe')](_0x594e8e));if(_0x594e8e['error']){if(_0x594e8e[_0x8e52('0xf')][_0x8e52('0x10')]===0x1f4){logger[_0x8e52('0xf')]('FreshdeskAccount,\x20%s,\x20%s',_0xa7202a,_0x594e8e[_0x8e52('0xf')][_0x8e52('0x11')]);return _0x38ac36(_0x594e8e[_0x8e52('0xf')][_0x8e52('0x11')]);}logger[_0x8e52('0xf')]('FreshdeskAccount,\x20%s,\x20%s',_0xa7202a,_0x594e8e[_0x8e52('0xf')][_0x8e52('0x11')]);return _0x8ef34f(_0x594e8e[_0x8e52('0xf')][_0x8e52('0x11')]);}else{logger[_0x8e52('0x12')](_0x8e52('0x13'),_0xa7202a,_0x8e52('0xd'));_0x8ef34f(_0x594e8e['result'][_0x8e52('0x11')]);}})[_0x8e52('0x14')](function(_0xd3f736){logger[_0x8e52('0xf')](_0x8e52('0x13'),_0xa7202a,_0xd3f736);_0x38ac36(_0xd3f736);});});}exports[_0x8e52('0x15')]=function(_0x339bcf){var _0xbaeaac=this;return new Promise(function(_0x3eb8d6,_0x102bbe){return db['FreshdeskAccount'][_0x8e52('0x16')]({'raw':_0x339bcf[_0x8e52('0x17')]?_0x339bcf[_0x8e52('0x17')][_0x8e52('0x18')]===undefined?!![]:![]:!![],'where':_0x339bcf[_0x8e52('0x17')]?_0x339bcf[_0x8e52('0x17')][_0x8e52('0x19')]||null:null,'attributes':_0x339bcf[_0x8e52('0x17')]?_0x339bcf[_0x8e52('0x17')][_0x8e52('0x1a')]||null:null,'limit':_0x339bcf[_0x8e52('0x17')]?_0x339bcf['options'][_0x8e52('0x1b')]||null:null,'include':_0x339bcf[_0x8e52('0x17')]?_0x339bcf[_0x8e52('0x17')][_0x8e52('0x1c')]?_[_0x8e52('0x1d')](_0x339bcf[_0x8e52('0x17')][_0x8e52('0x1c')],function(_0x4b1fd4){return{'model':db[_0x4b1fd4[_0x8e52('0x1e')]],'as':_0x4b1fd4['as'],'attributes':_0x4b1fd4[_0x8e52('0x1a')],'include':_0x4b1fd4['include']?_[_0x8e52('0x1d')](_0x4b1fd4[_0x8e52('0x1c')],function(_0x37455a){return{'model':db[_0x37455a['model']],'as':_0x37455a['as'],'attributes':_0x37455a[_0x8e52('0x1a')],'include':_0x37455a[_0x8e52('0x1c')]?_[_0x8e52('0x1d')](_0x37455a[_0x8e52('0x1c')],function(_0x395972){return{'model':db[_0x395972[_0x8e52('0x1e')]],'as':_0x395972['as'],'attributes':_0x395972['attributes']};}):[]};}):[]};}):[]:[]})[_0x8e52('0xa')](function(_0x57c7fd){logger[_0x8e52('0x12')](_0x8e52('0x15'),_0x339bcf);logger[_0x8e52('0xb')](_0x8e52('0x15'),_0x339bcf,JSON['stringify'](_0x57c7fd));_0x3eb8d6(_0x57c7fd);})[_0x8e52('0x14')](function(_0x4e1338){logger[_0x8e52('0xf')](_0x8e52('0x15'),_0x4e1338['message'],_0x339bcf);_0x102bbe(_0xbaeaac[_0x8e52('0xf')](0x1f4,_0x4e1338[_0x8e52('0x11')]));});});};exports[_0x8e52('0x1f')]=function(_0xd45986){var _0x5d1428=this;return new Promise(function(_0x5e8d82,_0x32bbaf){return db[_0x8e52('0x20')][_0x8e52('0x21')]({'raw':_0xd45986['options']?_0xd45986[_0x8e52('0x17')][_0x8e52('0x18')]===undefined?!![]:![]:!![],'where':_0xd45986[_0x8e52('0x17')]?_0xd45986[_0x8e52('0x17')]['where']||null:null,'attributes':_0xd45986[_0x8e52('0x17')]?_0xd45986[_0x8e52('0x17')]['attributes']||null:null,'include':_0xd45986[_0x8e52('0x17')]?_0xd45986[_0x8e52('0x17')][_0x8e52('0x1c')]?_['map'](_0xd45986[_0x8e52('0x17')][_0x8e52('0x1c')],function(_0x26e2b7){return{'model':db[_0x26e2b7['model']],'as':_0x26e2b7['as'],'attributes':_0x26e2b7[_0x8e52('0x1a')],'include':_0x26e2b7[_0x8e52('0x1c')]?_['map'](_0x26e2b7[_0x8e52('0x1c')],function(_0x27daf5){return{'model':db[_0x27daf5[_0x8e52('0x1e')]],'as':_0x27daf5['as'],'attributes':_0x27daf5[_0x8e52('0x1a')],'include':_0x27daf5[_0x8e52('0x1c')]?_[_0x8e52('0x1d')](_0x27daf5[_0x8e52('0x1c')],function(_0x43e3c1){return{'model':db[_0x43e3c1[_0x8e52('0x1e')]],'as':_0x43e3c1['as'],'attributes':_0x43e3c1[_0x8e52('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x8e52('0xa')](function(_0x47cd9f){logger[_0x8e52('0x12')](_0x8e52('0x1f'),_0xd45986);logger[_0x8e52('0xb')](_0x8e52('0x1f'),_0xd45986,JSON[_0x8e52('0xe')](_0x47cd9f));_0x5e8d82(_0x47cd9f);})[_0x8e52('0x14')](function(_0x24ad07){logger[_0x8e52('0xf')]('ShowFreshdeskAccount',_0x24ad07[_0x8e52('0x11')],_0xd45986);_0x32bbaf(_0x5d1428[_0x8e52('0xf')](0x1f4,_0x24ad07['message']));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index a7bd013..bb968de 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 _0x673d=['../../config/environment','./intFreshdeskConfiguration.controller','get','isAuthenticated','index','/:id/fields','/:id/subjects','/:id/descriptions','getDescriptions','getTags','post','create','/:id/tags','put','/:id','update','delete','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0xfcbcb8,_0x35bf6b){var _0x1b1f97=function(_0x51e11d){while(--_0x51e11d){_0xfcbcb8['push'](_0xfcbcb8['shift']());}};_0x1b1f97(++_0x35bf6b);}(_0x673d,0x130));var _0xd673=function(_0x5bc6c7,_0x1cfb29){_0x5bc6c7=_0x5bc6c7-0x0;var _0x17aec5=_0x673d[_0x5bc6c7];return _0x17aec5;};'use strict';var multer=require(_0xd673('0x0'));var util=require(_0xd673('0x1'));var path=require(_0xd673('0x2'));var timeout=require('connect-timeout');var express=require(_0xd673('0x3'));var router=express[_0xd673('0x4')]();var fs_extra=require(_0xd673('0x5'));var auth=require(_0xd673('0x6'));var interaction=require(_0xd673('0x7'));var config=require(_0xd673('0x8'));var controller=require(_0xd673('0x9'));router[_0xd673('0xa')]('/',auth[_0xd673('0xb')](),controller[_0xd673('0xc')]);router[_0xd673('0xa')]('/:id',auth[_0xd673('0xb')](),controller['show']);router['get'](_0xd673('0xd'),auth[_0xd673('0xb')](),controller['getFields']);router['get'](_0xd673('0xe'),auth[_0xd673('0xb')](),controller['getSubjects']);router[_0xd673('0xa')](_0xd673('0xf'),auth[_0xd673('0xb')](),controller[_0xd673('0x10')]);router['get']('/:id/tags',auth[_0xd673('0xb')](),controller[_0xd673('0x11')]);router[_0xd673('0x12')]('/',auth[_0xd673('0xb')](),controller[_0xd673('0x13')]);router['post'](_0xd673('0x14'),auth[_0xd673('0xb')](),controller['setTags']);router[_0xd673('0x15')](_0xd673('0x16'),auth['isAuthenticated'](),controller[_0xd673('0x17')]);router[_0xd673('0x18')](_0xd673('0x16'),auth[_0xd673('0xb')](),controller['destroy']);module[_0xd673('0x19')]=router; \ No newline at end of file +var _0x7ba8=['put','/:id','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','./intFreshdeskConfiguration.controller','isAuthenticated','index','get','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','post','create','setTags'];(function(_0x2aefff,_0x26a24b){var _0x4e4534=function(_0x592416){while(--_0x592416){_0x2aefff['push'](_0x2aefff['shift']());}};_0x4e4534(++_0x26a24b);}(_0x7ba8,0x196));var _0x87ba=function(_0x6b10f2,_0x18c332){_0x6b10f2=_0x6b10f2-0x0;var _0x42e602=_0x7ba8[_0x6b10f2];return _0x42e602;};'use strict';var multer=require('multer');var util=require(_0x87ba('0x0'));var path=require(_0x87ba('0x1'));var timeout=require(_0x87ba('0x2'));var express=require(_0x87ba('0x3'));var router=express[_0x87ba('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x87ba('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x87ba('0x6'));router['get']('/',auth[_0x87ba('0x7')](),controller[_0x87ba('0x8')]);router['get']('/:id',auth[_0x87ba('0x7')](),controller['show']);router[_0x87ba('0x9')](_0x87ba('0xa'),auth[_0x87ba('0x7')](),controller[_0x87ba('0xb')]);router[_0x87ba('0x9')]('/:id/subjects',auth[_0x87ba('0x7')](),controller[_0x87ba('0xc')]);router[_0x87ba('0x9')](_0x87ba('0xd'),auth[_0x87ba('0x7')](),controller[_0x87ba('0xe')]);router['get'](_0x87ba('0xf'),auth[_0x87ba('0x7')](),controller['getTags']);router[_0x87ba('0x10')]('/',auth['isAuthenticated'](),controller[_0x87ba('0x11')]);router[_0x87ba('0x10')]('/:id/tags',auth[_0x87ba('0x7')](),controller[_0x87ba('0x12')]);router[_0x87ba('0x13')](_0x87ba('0x14'),auth[_0x87ba('0x7')](),controller[_0x87ba('0x15')]);router[_0x87ba('0x16')](_0x87ba('0x14'),auth[_0x87ba('0x7')](),controller[_0x87ba('0x17')]);module[_0x87ba('0x18')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index 2c5d333..e234b74 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 _0x5984=['exports','STRING','sequelize'];(function(_0x4b558b,_0x2d22c6){var _0x1b96f1=function(_0x3e3922){while(--_0x3e3922){_0x4b558b['push'](_0x4b558b['shift']());}};_0x1b96f1(++_0x2d22c6);}(_0x5984,0x1a0));var _0x4598=function(_0x4583c7,_0x480906){_0x4583c7=_0x4583c7-0x0;var _0x2d4016=_0x5984[_0x4583c7];return _0x2d4016;};'use strict';var Sequelize=require(_0x4598('0x0'));module[_0x4598('0x1')]={'name':{'type':Sequelize[_0x4598('0x2')]},'description':{'type':Sequelize[_0x4598('0x2')]}}; \ No newline at end of file +var _0x9246=['exports','STRING','sequelize'];(function(_0x562154,_0x516798){var _0x547974=function(_0x2b2aa5){while(--_0x2b2aa5){_0x562154['push'](_0x562154['shift']());}};_0x547974(++_0x516798);}(_0x9246,0x1a9));var _0x6924=function(_0x5627e1,_0x1b2dbf){_0x5627e1=_0x5627e1-0x0;var _0x2f013f=_0x9246[_0x5627e1];return _0x2f013f;};'use strict';var Sequelize=require(_0x6924('0x0'));module[_0x6924('0x1')]={'name':{'type':Sequelize[_0x6924('0x2')]},'description':{'type':Sequelize[_0x6924('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index bc2061c..78b6c6d 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 _0x2b5a=['../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','index','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','FreshdeskConfiguration','findAll','rows','catch','show','params','rawAttributes','includeAll','include','find','create','body','destroy','getFields','findOne','length','getSubjects','getDescriptions','Tag','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','ejs','fs-extra','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api'];(function(_0x35f8af,_0x3e3622){var _0x12280f=function(_0x1369e6){while(--_0x1369e6){_0x35f8af['push'](_0x35f8af['shift']());}};_0x12280f(++_0x3e3622);}(_0x2b5a,0x186));var _0xa2b5=function(_0x500e4a,_0x288db2){_0x500e4a=_0x500e4a-0x0;var _0x32952f=_0x2b5a[_0x500e4a];return _0x32952f;};'use strict';var emlformat=require(_0xa2b5('0x0'));var rimraf=require(_0xa2b5('0x1'));var zipdir=require(_0xa2b5('0x2'));var jsonpatch=require(_0xa2b5('0x3'));var rp=require(_0xa2b5('0x4'));var moment=require('moment');var BPromise=require(_0xa2b5('0x5'));var Mustache=require(_0xa2b5('0x6'));var util=require(_0xa2b5('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xa2b5('0x8'));var fs=require('fs');var fs_extra=require(_0xa2b5('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xa2b5('0xa'));var jsforce=require(_0xa2b5('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xa2b5('0xc'));var querystring=require(_0xa2b5('0xd'));var Papa=require(_0xa2b5('0xe'));var Redis=require(_0xa2b5('0xf'));var authService=require(_0xa2b5('0x10'));var qs=require(_0xa2b5('0x11'));var as=require(_0xa2b5('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xa2b5('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xa2b5('0x14'));var db=require(_0xa2b5('0x15'))['db'];function respondWithStatusCode(_0x3175c0,_0x1a068a){_0x1a068a=_0x1a068a||0xcc;return function(_0x12ffc9){if(_0x12ffc9){return _0x3175c0[_0xa2b5('0x16')](_0x1a068a);}return _0x3175c0[_0xa2b5('0x17')](_0x1a068a)[_0xa2b5('0x18')]();};}function respondWithResult(_0x25b9a5,_0x2b87d3){_0x2b87d3=_0x2b87d3||0xc8;return function(_0x57aa96){if(_0x57aa96){return _0x25b9a5[_0xa2b5('0x17')](_0x2b87d3)[_0xa2b5('0x19')](_0x57aa96);}};}function respondWithFilteredResult(_0x1778f9,_0x2a4db4){return function(_0x5ba6a2){if(_0x5ba6a2){var _0x16a3d2=typeof _0x2a4db4[_0xa2b5('0x1a')]==='undefined'&&typeof _0x2a4db4[_0xa2b5('0x1b')]==='undefined';var _0x36c119=_0x5ba6a2[_0xa2b5('0x1c')];var _0x4be742=_0x16a3d2?0x0:_0x2a4db4[_0xa2b5('0x1a')];var _0x234d6d=_0x16a3d2?_0x5ba6a2[_0xa2b5('0x1c')]:_0x2a4db4['offset']+_0x2a4db4[_0xa2b5('0x1b')];var _0x581484;if(_0x234d6d>=_0x36c119){_0x234d6d=_0x36c119;_0x581484=0xc8;}else{_0x581484=0xce;}_0x1778f9['status'](_0x581484);return _0x1778f9[_0xa2b5('0x1d')](_0xa2b5('0x1e'),_0x4be742+'-'+_0x234d6d+'/'+_0x36c119)[_0xa2b5('0x19')](_0x5ba6a2);}return null;};}function patchUpdates(_0x5a2d34){return function(_0x586905){try{jsonpatch[_0xa2b5('0x1f')](_0x586905,_0x5a2d34,!![]);}catch(_0x2dbac5){return BPromise[_0xa2b5('0x20')](_0x2dbac5);}return _0x586905[_0xa2b5('0x21')]();};}function saveUpdates(_0x55f586,_0x518366){return function(_0x24f3dd){if(_0x24f3dd){return _0x24f3dd[_0xa2b5('0x22')](_0x55f586)[_0xa2b5('0x23')](function(_0x35c4f0){return _0x35c4f0;});}return null;};}function removeEntity(_0x1a8943,_0x148adf){return function(_0x9f12ac){if(_0x9f12ac){return _0x9f12ac['destroy']()[_0xa2b5('0x23')](function(){_0x1a8943[_0xa2b5('0x17')](0xcc)[_0xa2b5('0x18')]();});}};}function handleEntityNotFound(_0x2fe1f5,_0x3818f7){return function(_0x284d67){if(!_0x284d67){_0x2fe1f5[_0xa2b5('0x16')](0x194);}return _0x284d67;};}function handleError(_0x2d7e68,_0x202e58){_0x202e58=_0x202e58||0x1f4;return function(_0xa3e2a0){logger[_0xa2b5('0x24')](_0xa3e2a0[_0xa2b5('0x25')]);if(_0xa3e2a0['name']){delete _0xa3e2a0[_0xa2b5('0x26')];}_0x2d7e68['status'](_0x202e58)['send'](_0xa3e2a0);};}exports[_0xa2b5('0x27')]=function(_0x5d78c9,_0x4d1bcb){var _0x25b3a9={},_0xee5143={},_0xe8f463={'count':0x0,'rows':[]};var _0x357c3f=_[_0xa2b5('0x28')](db['FreshdeskConfiguration']['rawAttributes'],function(_0xc192be){return{'name':_0xc192be[_0xa2b5('0x29')],'type':_0xc192be[_0xa2b5('0x2a')][_0xa2b5('0x2b')]};});_0xee5143[_0xa2b5('0x2c')]=_[_0xa2b5('0x28')](_0x357c3f,_0xa2b5('0x26'));_0xee5143[_0xa2b5('0x2d')]=_[_0xa2b5('0x2e')](_0x5d78c9[_0xa2b5('0x2d')]);_0xee5143[_0xa2b5('0x2f')]=_[_0xa2b5('0x30')](_0xee5143[_0xa2b5('0x2c')],_0xee5143[_0xa2b5('0x2d')]);_0x25b3a9[_0xa2b5('0x31')]=_[_0xa2b5('0x30')](_0xee5143[_0xa2b5('0x2c')],qs[_0xa2b5('0x32')](_0x5d78c9['query']['fields']));_0x25b3a9['attributes']=_0x25b3a9[_0xa2b5('0x31')]['length']?_0x25b3a9[_0xa2b5('0x31')]:_0xee5143[_0xa2b5('0x2c')];if(!_0x5d78c9['query'][_0xa2b5('0x33')](_0xa2b5('0x34'))){_0x25b3a9[_0xa2b5('0x1b')]=qs[_0xa2b5('0x1b')](_0x5d78c9[_0xa2b5('0x2d')][_0xa2b5('0x1b')]);_0x25b3a9[_0xa2b5('0x1a')]=qs[_0xa2b5('0x1a')](_0x5d78c9['query'][_0xa2b5('0x1a')]);}_0x25b3a9[_0xa2b5('0x35')]=qs[_0xa2b5('0x36')](_0x5d78c9['query'][_0xa2b5('0x36')]);_0x25b3a9[_0xa2b5('0x37')]=qs['filters'](_[_0xa2b5('0x38')](_0x5d78c9['query'],_0xee5143[_0xa2b5('0x2f')]),_0x357c3f);if(_0x5d78c9[_0xa2b5('0x2d')][_0xa2b5('0x39')]){_0x25b3a9['where']=_[_0xa2b5('0x3a')](_0x25b3a9[_0xa2b5('0x37')],{'$or':_[_0xa2b5('0x28')](_0x357c3f,function(_0x3f392d){if(_0x3f392d[_0xa2b5('0x2a')]!==_0xa2b5('0x3b')){var _0x55b41d={};_0x55b41d[_0x3f392d[_0xa2b5('0x26')]]={'$like':'%'+_0x5d78c9[_0xa2b5('0x2d')]['filter']+'%'};return _0x55b41d;}})});}_0x25b3a9=_[_0xa2b5('0x3a')]({},_0x25b3a9,_0x5d78c9[_0xa2b5('0x3c')]);var _0x227f10={'where':_0x25b3a9[_0xa2b5('0x37')]};return db['FreshdeskConfiguration']['count'](_0x227f10)[_0xa2b5('0x23')](function(_0x13aec1){_0xe8f463[_0xa2b5('0x1c')]=_0x13aec1;if(_0x5d78c9[_0xa2b5('0x2d')]['includeAll']){_0x25b3a9['include']=[{'all':!![]}];}return db[_0xa2b5('0x3d')][_0xa2b5('0x3e')](_0x25b3a9);})['then'](function(_0x16b7b5){_0xe8f463[_0xa2b5('0x3f')]=_0x16b7b5;return _0xe8f463;})[_0xa2b5('0x23')](respondWithFilteredResult(_0x4d1bcb,_0x25b3a9))[_0xa2b5('0x40')](handleError(_0x4d1bcb,null));};exports[_0xa2b5('0x41')]=function(_0x43177c,_0x50def0){var _0x1464fc={'raw':![],'where':{'id':_0x43177c[_0xa2b5('0x42')]['id']}},_0x15294d={};_0x15294d[_0xa2b5('0x2c')]=_[_0xa2b5('0x2e')](db[_0xa2b5('0x3d')][_0xa2b5('0x43')]);_0x15294d[_0xa2b5('0x2d')]=_[_0xa2b5('0x2e')](_0x43177c[_0xa2b5('0x2d')]);_0x15294d[_0xa2b5('0x2f')]=_[_0xa2b5('0x30')](_0x15294d['model'],_0x15294d[_0xa2b5('0x2d')]);_0x1464fc[_0xa2b5('0x31')]=_['intersection'](_0x15294d['model'],qs[_0xa2b5('0x32')](_0x43177c[_0xa2b5('0x2d')][_0xa2b5('0x32')]));_0x1464fc[_0xa2b5('0x31')]=_0x1464fc[_0xa2b5('0x31')]['length']?_0x1464fc[_0xa2b5('0x31')]:_0x15294d['model'];if(_0x43177c[_0xa2b5('0x2d')][_0xa2b5('0x44')]){_0x1464fc[_0xa2b5('0x45')]=[{'all':!![]}];}_0x1464fc=_[_0xa2b5('0x3a')]({},_0x1464fc,_0x43177c[_0xa2b5('0x3c')]);return db[_0xa2b5('0x3d')][_0xa2b5('0x46')](_0x1464fc)[_0xa2b5('0x23')](handleEntityNotFound(_0x50def0,null))[_0xa2b5('0x23')](respondWithResult(_0x50def0,null))['catch'](handleError(_0x50def0,null));};exports[_0xa2b5('0x47')]=function(_0x39ac30,_0x2e9ffc){return db[_0xa2b5('0x3d')]['create'](_0x39ac30[_0xa2b5('0x48')],{})[_0xa2b5('0x23')](respondWithResult(_0x2e9ffc,0xc9))[_0xa2b5('0x40')](handleError(_0x2e9ffc,null));};exports['update']=function(_0x102ee7,_0x4d7ae1){if(_0x102ee7[_0xa2b5('0x48')]['id']){delete _0x102ee7[_0xa2b5('0x48')]['id'];}return db[_0xa2b5('0x3d')]['find']({'where':{'id':_0x102ee7[_0xa2b5('0x42')]['id']}})[_0xa2b5('0x23')](handleEntityNotFound(_0x4d7ae1,null))[_0xa2b5('0x23')](saveUpdates(_0x102ee7[_0xa2b5('0x48')],null))[_0xa2b5('0x23')](respondWithResult(_0x4d7ae1,null))[_0xa2b5('0x40')](handleError(_0x4d7ae1,null));};exports[_0xa2b5('0x49')]=function(_0x5b1831,_0x1ee926){return db[_0xa2b5('0x3d')][_0xa2b5('0x46')]({'where':{'id':_0x5b1831['params']['id']}})['then'](handleEntityNotFound(_0x1ee926,null))[_0xa2b5('0x23')](removeEntity(_0x1ee926,null))[_0xa2b5('0x40')](handleError(_0x1ee926,null));};exports[_0xa2b5('0x4a')]=function(_0x23d872,_0x29537e,_0x46c2c0){var _0x5246f8={};var _0x9dfde9={};var _0x46f7fb;var _0x363fb9;return db[_0xa2b5('0x3d')][_0xa2b5('0x4b')]({'where':{'id':_0x23d872[_0xa2b5('0x42')]['id']}})[_0xa2b5('0x23')](handleEntityNotFound(_0x29537e,null))['then'](function(_0x9c5469){if(_0x9c5469){_0x46f7fb=_0x9c5469;_0x9dfde9[_0xa2b5('0x2c')]=_['keys'](db['FreshdeskField'][_0xa2b5('0x43')]);_0x9dfde9['query']=_[_0xa2b5('0x2e')](_0x23d872[_0xa2b5('0x2d')]);_0x9dfde9['filters']=_[_0xa2b5('0x30')](_0x9dfde9[_0xa2b5('0x2c')],_0x9dfde9['query']);_0x5246f8[_0xa2b5('0x31')]=_[_0xa2b5('0x30')](_0x9dfde9[_0xa2b5('0x2c')],qs[_0xa2b5('0x32')](_0x23d872[_0xa2b5('0x2d')]['fields']));_0x5246f8[_0xa2b5('0x31')]=_0x5246f8['attributes'][_0xa2b5('0x4c')]?_0x5246f8['attributes']:_0x9dfde9[_0xa2b5('0x2c')];_0x5246f8[_0xa2b5('0x35')]=qs[_0xa2b5('0x36')](_0x23d872[_0xa2b5('0x2d')][_0xa2b5('0x36')]);_0x5246f8[_0xa2b5('0x37')]=qs[_0xa2b5('0x2f')](_['pick'](_0x23d872[_0xa2b5('0x2d')],_0x9dfde9['filters']));if(_0x23d872[_0xa2b5('0x2d')][_0xa2b5('0x39')]){_0x5246f8[_0xa2b5('0x37')]=_[_0xa2b5('0x3a')](_0x5246f8[_0xa2b5('0x37')],{'$or':_[_0xa2b5('0x28')](_0x5246f8[_0xa2b5('0x31')],function(_0x3375d1){var _0x3c28a5={};_0x3c28a5[_0x3375d1]={'$like':'%'+_0x23d872[_0xa2b5('0x2d')]['filter']+'%'};return _0x3c28a5;})});}_0x5246f8=_[_0xa2b5('0x3a')]({},_0x5246f8,_0x23d872[_0xa2b5('0x3c')]);return _0x46f7fb[_0xa2b5('0x4a')](_0x5246f8);}})[_0xa2b5('0x23')](function(_0x1316d5){if(_0x1316d5){_0x363fb9=_0x1316d5[_0xa2b5('0x4c')];if(!_0x23d872[_0xa2b5('0x2d')][_0xa2b5('0x33')]('nolimit')){_0x5246f8[_0xa2b5('0x1b')]=qs[_0xa2b5('0x1b')](_0x23d872[_0xa2b5('0x2d')][_0xa2b5('0x1b')]);_0x5246f8['offset']=qs['offset'](_0x23d872[_0xa2b5('0x2d')][_0xa2b5('0x1a')]);}return _0x46f7fb[_0xa2b5('0x4a')](_0x5246f8);}})['then'](function(_0x4bd266){if(_0x4bd266){return _0x4bd266?{'count':_0x363fb9,'rows':_0x4bd266}:null;}})['then'](respondWithResult(_0x29537e,null))[_0xa2b5('0x40')](handleError(_0x29537e,null));};exports['getSubjects']=function(_0x16b0f9,_0x157462,_0x15212b){var _0x3ed37a={};var _0x4aaa7f={};var _0x278dcc;var _0x54a89d;return db[_0xa2b5('0x3d')][_0xa2b5('0x4b')]({'where':{'id':_0x16b0f9[_0xa2b5('0x42')]['id']}})['then'](handleEntityNotFound(_0x157462,null))[_0xa2b5('0x23')](function(_0x2f03a4){if(_0x2f03a4){_0x278dcc=_0x2f03a4;_0x4aaa7f[_0xa2b5('0x2c')]=_[_0xa2b5('0x2e')](db['FreshdeskField'][_0xa2b5('0x43')]);_0x4aaa7f['query']=_[_0xa2b5('0x2e')](_0x16b0f9[_0xa2b5('0x2d')]);_0x4aaa7f[_0xa2b5('0x2f')]=_['intersection'](_0x4aaa7f[_0xa2b5('0x2c')],_0x4aaa7f[_0xa2b5('0x2d')]);_0x3ed37a[_0xa2b5('0x31')]=_[_0xa2b5('0x30')](_0x4aaa7f[_0xa2b5('0x2c')],qs[_0xa2b5('0x32')](_0x16b0f9[_0xa2b5('0x2d')][_0xa2b5('0x32')]));_0x3ed37a['attributes']=_0x3ed37a[_0xa2b5('0x31')]['length']?_0x3ed37a['attributes']:_0x4aaa7f[_0xa2b5('0x2c')];_0x3ed37a['order']=qs['sort'](_0x16b0f9[_0xa2b5('0x2d')][_0xa2b5('0x36')]);_0x3ed37a[_0xa2b5('0x37')]=qs[_0xa2b5('0x2f')](_[_0xa2b5('0x38')](_0x16b0f9[_0xa2b5('0x2d')],_0x4aaa7f[_0xa2b5('0x2f')]));if(_0x16b0f9[_0xa2b5('0x2d')][_0xa2b5('0x39')]){_0x3ed37a[_0xa2b5('0x37')]=_['merge'](_0x3ed37a[_0xa2b5('0x37')],{'$or':_[_0xa2b5('0x28')](_0x3ed37a[_0xa2b5('0x31')],function(_0x297eec){var _0x3e6586={};_0x3e6586[_0x297eec]={'$like':'%'+_0x16b0f9['query']['filter']+'%'};return _0x3e6586;})});}_0x3ed37a=_[_0xa2b5('0x3a')]({},_0x3ed37a,_0x16b0f9['options']);return _0x278dcc[_0xa2b5('0x4d')](_0x3ed37a);}})[_0xa2b5('0x23')](function(_0x5e8ec8){if(_0x5e8ec8){_0x54a89d=_0x5e8ec8[_0xa2b5('0x4c')];if(!_0x16b0f9[_0xa2b5('0x2d')]['hasOwnProperty']('nolimit')){_0x3ed37a[_0xa2b5('0x1b')]=qs[_0xa2b5('0x1b')](_0x16b0f9[_0xa2b5('0x2d')][_0xa2b5('0x1b')]);_0x3ed37a[_0xa2b5('0x1a')]=qs[_0xa2b5('0x1a')](_0x16b0f9[_0xa2b5('0x2d')][_0xa2b5('0x1a')]);}return _0x278dcc[_0xa2b5('0x4d')](_0x3ed37a);}})['then'](function(_0x46465a){if(_0x46465a){return _0x46465a?{'count':_0x54a89d,'rows':_0x46465a}:null;}})[_0xa2b5('0x23')](respondWithResult(_0x157462,null))[_0xa2b5('0x40')](handleError(_0x157462,null));};exports['getDescriptions']=function(_0x5829c8,_0x374807,_0x2ca91d){var _0x40b4db={};var _0xc0620d={};var _0x4536f8;var _0x4d61c6;return db[_0xa2b5('0x3d')][_0xa2b5('0x4b')]({'where':{'id':_0x5829c8[_0xa2b5('0x42')]['id']}})[_0xa2b5('0x23')](handleEntityNotFound(_0x374807,null))[_0xa2b5('0x23')](function(_0x1e8e06){if(_0x1e8e06){_0x4536f8=_0x1e8e06;_0xc0620d[_0xa2b5('0x2c')]=_['keys'](db['FreshdeskField'][_0xa2b5('0x43')]);_0xc0620d[_0xa2b5('0x2d')]=_[_0xa2b5('0x2e')](_0x5829c8[_0xa2b5('0x2d')]);_0xc0620d['filters']=_[_0xa2b5('0x30')](_0xc0620d['model'],_0xc0620d[_0xa2b5('0x2d')]);_0x40b4db[_0xa2b5('0x31')]=_[_0xa2b5('0x30')](_0xc0620d[_0xa2b5('0x2c')],qs['fields'](_0x5829c8['query'][_0xa2b5('0x32')]));_0x40b4db[_0xa2b5('0x31')]=_0x40b4db[_0xa2b5('0x31')][_0xa2b5('0x4c')]?_0x40b4db[_0xa2b5('0x31')]:_0xc0620d[_0xa2b5('0x2c')];_0x40b4db[_0xa2b5('0x35')]=qs[_0xa2b5('0x36')](_0x5829c8[_0xa2b5('0x2d')][_0xa2b5('0x36')]);_0x40b4db[_0xa2b5('0x37')]=qs['filters'](_[_0xa2b5('0x38')](_0x5829c8[_0xa2b5('0x2d')],_0xc0620d[_0xa2b5('0x2f')]));if(_0x5829c8[_0xa2b5('0x2d')]['filter']){_0x40b4db[_0xa2b5('0x37')]=_[_0xa2b5('0x3a')](_0x40b4db[_0xa2b5('0x37')],{'$or':_[_0xa2b5('0x28')](_0x40b4db['attributes'],function(_0x17c949){var _0x179fb3={};_0x179fb3[_0x17c949]={'$like':'%'+_0x5829c8[_0xa2b5('0x2d')]['filter']+'%'};return _0x179fb3;})});}_0x40b4db=_[_0xa2b5('0x3a')]({},_0x40b4db,_0x5829c8[_0xa2b5('0x3c')]);return _0x4536f8[_0xa2b5('0x4e')](_0x40b4db);}})['then'](function(_0x2d2445){if(_0x2d2445){_0x4d61c6=_0x2d2445[_0xa2b5('0x4c')];if(!_0x5829c8[_0xa2b5('0x2d')][_0xa2b5('0x33')](_0xa2b5('0x34'))){_0x40b4db[_0xa2b5('0x1b')]=qs[_0xa2b5('0x1b')](_0x5829c8[_0xa2b5('0x2d')][_0xa2b5('0x1b')]);_0x40b4db[_0xa2b5('0x1a')]=qs[_0xa2b5('0x1a')](_0x5829c8[_0xa2b5('0x2d')][_0xa2b5('0x1a')]);}return _0x4536f8[_0xa2b5('0x4e')](_0x40b4db);}})['then'](function(_0x4d173f){if(_0x4d173f){return _0x4d173f?{'count':_0x4d61c6,'rows':_0x4d173f}:null;}})[_0xa2b5('0x23')](respondWithResult(_0x374807,null))[_0xa2b5('0x40')](handleError(_0x374807,null));};exports['getTags']=function(_0x119fe9,_0x5d71e7,_0x3823ca){var _0x319e9c={};var _0x24c31a={};var _0x238223;var _0xaf444b;return db[_0xa2b5('0x3d')]['findOne']({'where':{'id':_0x119fe9[_0xa2b5('0x42')]['id']}})['then'](handleEntityNotFound(_0x5d71e7,null))['then'](function(_0x68c890){if(_0x68c890){_0x238223=_0x68c890;_0x24c31a[_0xa2b5('0x2c')]=_['keys'](db[_0xa2b5('0x4f')][_0xa2b5('0x43')]);_0x24c31a['query']=_[_0xa2b5('0x2e')](_0x119fe9['query']);_0x24c31a[_0xa2b5('0x2f')]=_['intersection'](_0x24c31a['model'],_0x24c31a[_0xa2b5('0x2d')]);_0x319e9c['attributes']=_[_0xa2b5('0x30')](_0x24c31a[_0xa2b5('0x2c')],qs[_0xa2b5('0x32')](_0x119fe9[_0xa2b5('0x2d')]['fields']));_0x319e9c[_0xa2b5('0x31')]=_0x319e9c[_0xa2b5('0x31')][_0xa2b5('0x4c')]?_0x319e9c[_0xa2b5('0x31')]:_0x24c31a[_0xa2b5('0x2c')];_0x319e9c['order']=qs['sort'](_0x119fe9['query'][_0xa2b5('0x36')]);_0x319e9c[_0xa2b5('0x37')]=qs[_0xa2b5('0x2f')](_['pick'](_0x119fe9['query'],_0x24c31a['filters']));if(_0x119fe9[_0xa2b5('0x2d')][_0xa2b5('0x39')]){_0x319e9c['where']=_[_0xa2b5('0x3a')](_0x319e9c['where'],{'$or':_[_0xa2b5('0x28')](_0x319e9c[_0xa2b5('0x31')],function(_0x77298a){var _0xcf2425={};_0xcf2425[_0x77298a]={'$like':'%'+_0x119fe9[_0xa2b5('0x2d')][_0xa2b5('0x39')]+'%'};return _0xcf2425;})});}_0x319e9c=_['merge']({},_0x319e9c,_0x119fe9[_0xa2b5('0x3c')]);return _0x238223['getTags'](_0x319e9c);}})[_0xa2b5('0x23')](function(_0x1d2947){if(_0x1d2947){_0xaf444b=_0x1d2947[_0xa2b5('0x4c')];if(!_0x119fe9[_0xa2b5('0x2d')][_0xa2b5('0x33')](_0xa2b5('0x34'))){_0x319e9c[_0xa2b5('0x1b')]=qs[_0xa2b5('0x1b')](_0x119fe9[_0xa2b5('0x2d')]['limit']);_0x319e9c[_0xa2b5('0x1a')]=qs['offset'](_0x119fe9[_0xa2b5('0x2d')][_0xa2b5('0x1a')]);}return _0x238223['getTags'](_0x319e9c);}})['then'](function(_0x318461){if(_0x318461){return _0x318461?{'count':_0xaf444b,'rows':_0x318461}:null;}})[_0xa2b5('0x23')](respondWithResult(_0x5d71e7,null))[_0xa2b5('0x40')](handleError(_0x5d71e7,null));};exports[_0xa2b5('0x50')]=function(_0x5b3fda,_0x306956,_0x3ea22f){if(_0x5b3fda[_0xa2b5('0x48')]['id']){delete _0x5b3fda[_0xa2b5('0x48')]['id'];}return db[_0xa2b5('0x3d')][_0xa2b5('0x4b')]({'where':{'id':_0x5b3fda[_0xa2b5('0x42')]['id']}})[_0xa2b5('0x23')](handleEntityNotFound(_0x306956,null))['then'](function(_0x1935e4){if(_0x1935e4){return _0x1935e4[_0xa2b5('0x50')](_0x5b3fda[_0xa2b5('0x48')][_0xa2b5('0x51')]||[]);}return null;})[_0xa2b5('0x23')](respondWithResult(_0x306956,null))[_0xa2b5('0x40')](handleError(_0x306956,null));}; \ No newline at end of file +var _0xd831=['order','getSubjects','FreshdeskField','pick','hasOwnProperty','nolimit','getDescriptions','getTags','Tag','setTags','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','save','destroy','then','name','send','index','FreshdeskConfiguration','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','sort','where','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','update','getFields','findOne','rawAttributes'];(function(_0x39b68b,_0x4ad96d){var _0xae091f=function(_0x13b5e1){while(--_0x13b5e1){_0x39b68b['push'](_0x39b68b['shift']());}};_0xae091f(++_0x4ad96d);}(_0xd831,0xb6));var _0x1d83=function(_0x8420ad,_0x69d4db){_0x8420ad=_0x8420ad-0x0;var _0x52d8b4=_0xd831[_0x8420ad];return _0x52d8b4;};'use strict';var emlformat=require(_0x1d83('0x0'));var rimraf=require(_0x1d83('0x1'));var zipdir=require(_0x1d83('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1d83('0x3'));var moment=require(_0x1d83('0x4'));var BPromise=require(_0x1d83('0x5'));var Mustache=require(_0x1d83('0x6'));var util=require(_0x1d83('0x7'));var path=require('path');var sox=require(_0x1d83('0x8'));var csv=require(_0x1d83('0x9'));var ejs=require(_0x1d83('0xa'));var fs=require('fs');var fs_extra=require(_0x1d83('0xb'));var _=require(_0x1d83('0xc'));var squel=require(_0x1d83('0xd'));var crypto=require(_0x1d83('0xe'));var jsforce=require(_0x1d83('0xf'));var deskjs=require(_0x1d83('0x10'));var toCsv=require('to-csv');var querystring=require(_0x1d83('0x11'));var Papa=require('papaparse');var Redis=require(_0x1d83('0x12'));var authService=require(_0x1d83('0x13'));var qs=require(_0x1d83('0x14'));var as=require(_0x1d83('0x15'));var hardwareService=require(_0x1d83('0x16'));var logger=require(_0x1d83('0x17'))('api');var utils=require(_0x1d83('0x18'));var config=require(_0x1d83('0x19'));var licenseUtil=require(_0x1d83('0x1a'));var db=require(_0x1d83('0x1b'))['db'];function respondWithStatusCode(_0x52ebe6,_0x14c556){_0x14c556=_0x14c556||0xcc;return function(_0x1337d5){if(_0x1337d5){return _0x52ebe6[_0x1d83('0x1c')](_0x14c556);}return _0x52ebe6[_0x1d83('0x1d')](_0x14c556)[_0x1d83('0x1e')]();};}function respondWithResult(_0xddb018,_0x2d8c34){_0x2d8c34=_0x2d8c34||0xc8;return function(_0x113923){if(_0x113923){return _0xddb018['status'](_0x2d8c34)[_0x1d83('0x1f')](_0x113923);}};}function respondWithFilteredResult(_0x40894a,_0x4d72fc){return function(_0x4957e9){if(_0x4957e9){var _0x5cf824=typeof _0x4d72fc[_0x1d83('0x20')]===_0x1d83('0x21')&&typeof _0x4d72fc[_0x1d83('0x22')]===_0x1d83('0x21');var _0x342b62=_0x4957e9['count'];var _0x101719=_0x5cf824?0x0:_0x4d72fc[_0x1d83('0x20')];var _0x4461a5=_0x5cf824?_0x4957e9[_0x1d83('0x23')]:_0x4d72fc[_0x1d83('0x20')]+_0x4d72fc[_0x1d83('0x22')];var _0x1341c5;if(_0x4461a5>=_0x342b62){_0x4461a5=_0x342b62;_0x1341c5=0xc8;}else{_0x1341c5=0xce;}_0x40894a[_0x1d83('0x1d')](_0x1341c5);return _0x40894a['set'](_0x1d83('0x24'),_0x101719+'-'+_0x4461a5+'/'+_0x342b62)[_0x1d83('0x1f')](_0x4957e9);}return null;};}function patchUpdates(_0x3b2410){return function(_0x3d0091){try{jsonpatch['apply'](_0x3d0091,_0x3b2410,!![]);}catch(_0x419986){return BPromise['reject'](_0x419986);}return _0x3d0091[_0x1d83('0x25')]();};}function saveUpdates(_0x2786fc,_0x544014){return function(_0x5043c7){if(_0x5043c7){return _0x5043c7['update'](_0x2786fc)['then'](function(_0x29333e){return _0x29333e;});}return null;};}function removeEntity(_0x4b8a7e,_0x3a7a0e){return function(_0x93281d){if(_0x93281d){return _0x93281d[_0x1d83('0x26')]()[_0x1d83('0x27')](function(){_0x4b8a7e[_0x1d83('0x1d')](0xcc)[_0x1d83('0x1e')]();});}};}function handleEntityNotFound(_0x225be8,_0x4a287f){return function(_0x493092){if(!_0x493092){_0x225be8[_0x1d83('0x1c')](0x194);}return _0x493092;};}function handleError(_0x597fa0,_0x26e852){_0x26e852=_0x26e852||0x1f4;return function(_0x202bd7){logger['error'](_0x202bd7['stack']);if(_0x202bd7['name']){delete _0x202bd7[_0x1d83('0x28')];}_0x597fa0[_0x1d83('0x1d')](_0x26e852)[_0x1d83('0x29')](_0x202bd7);};}exports[_0x1d83('0x2a')]=function(_0x3dbc4d,_0xf12b87){var _0x370940={},_0x319f18={},_0x49a623={'count':0x0,'rows':[]};var _0x12afb5=_['map'](db[_0x1d83('0x2b')]['rawAttributes'],function(_0x2e2ac4){return{'name':_0x2e2ac4[_0x1d83('0x2c')],'type':_0x2e2ac4[_0x1d83('0x2d')][_0x1d83('0x2e')]};});_0x319f18['model']=_['map'](_0x12afb5,'name');_0x319f18[_0x1d83('0x2f')]=_[_0x1d83('0x30')](_0x3dbc4d['query']);_0x319f18[_0x1d83('0x31')]=_[_0x1d83('0x32')](_0x319f18[_0x1d83('0x33')],_0x319f18['query']);_0x370940['attributes']=_[_0x1d83('0x32')](_0x319f18[_0x1d83('0x33')],qs['fields'](_0x3dbc4d[_0x1d83('0x2f')][_0x1d83('0x34')]));_0x370940[_0x1d83('0x35')]=_0x370940[_0x1d83('0x35')]['length']?_0x370940['attributes']:_0x319f18['model'];if(!_0x3dbc4d[_0x1d83('0x2f')]['hasOwnProperty']('nolimit')){_0x370940[_0x1d83('0x22')]=qs[_0x1d83('0x22')](_0x3dbc4d[_0x1d83('0x2f')][_0x1d83('0x22')]);_0x370940[_0x1d83('0x20')]=qs[_0x1d83('0x20')](_0x3dbc4d[_0x1d83('0x2f')][_0x1d83('0x20')]);}_0x370940['order']=qs[_0x1d83('0x36')](_0x3dbc4d[_0x1d83('0x2f')][_0x1d83('0x36')]);_0x370940[_0x1d83('0x37')]=qs[_0x1d83('0x31')](_['pick'](_0x3dbc4d[_0x1d83('0x2f')],_0x319f18[_0x1d83('0x31')]),_0x12afb5);if(_0x3dbc4d[_0x1d83('0x2f')][_0x1d83('0x38')]){_0x370940[_0x1d83('0x37')]=_[_0x1d83('0x39')](_0x370940[_0x1d83('0x37')],{'$or':_[_0x1d83('0x3a')](_0x12afb5,function(_0x47dcd4){if(_0x47dcd4[_0x1d83('0x2d')]!==_0x1d83('0x3b')){var _0x4f8465={};_0x4f8465[_0x47dcd4[_0x1d83('0x28')]]={'$like':'%'+_0x3dbc4d['query']['filter']+'%'};return _0x4f8465;}})});}_0x370940=_['merge']({},_0x370940,_0x3dbc4d[_0x1d83('0x3c')]);var _0x4125db={'where':_0x370940[_0x1d83('0x37')]};return db[_0x1d83('0x2b')][_0x1d83('0x23')](_0x4125db)['then'](function(_0x1d54c1){_0x49a623[_0x1d83('0x23')]=_0x1d54c1;if(_0x3dbc4d['query'][_0x1d83('0x3d')]){_0x370940[_0x1d83('0x3e')]=[{'all':!![]}];}return db[_0x1d83('0x2b')][_0x1d83('0x3f')](_0x370940);})[_0x1d83('0x27')](function(_0x398a1f){_0x49a623[_0x1d83('0x40')]=_0x398a1f;return _0x49a623;})[_0x1d83('0x27')](respondWithFilteredResult(_0xf12b87,_0x370940))[_0x1d83('0x41')](handleError(_0xf12b87,null));};exports[_0x1d83('0x42')]=function(_0x2fe1cc,_0x1d3507){var _0x11f2f8={'raw':![],'where':{'id':_0x2fe1cc[_0x1d83('0x43')]['id']}},_0x5e710a={};_0x5e710a['model']=_[_0x1d83('0x30')](db[_0x1d83('0x2b')]['rawAttributes']);_0x5e710a['query']=_[_0x1d83('0x30')](_0x2fe1cc[_0x1d83('0x2f')]);_0x5e710a['filters']=_[_0x1d83('0x32')](_0x5e710a[_0x1d83('0x33')],_0x5e710a['query']);_0x11f2f8[_0x1d83('0x35')]=_[_0x1d83('0x32')](_0x5e710a[_0x1d83('0x33')],qs[_0x1d83('0x34')](_0x2fe1cc[_0x1d83('0x2f')][_0x1d83('0x34')]));_0x11f2f8['attributes']=_0x11f2f8[_0x1d83('0x35')][_0x1d83('0x44')]?_0x11f2f8[_0x1d83('0x35')]:_0x5e710a[_0x1d83('0x33')];if(_0x2fe1cc[_0x1d83('0x2f')][_0x1d83('0x3d')]){_0x11f2f8[_0x1d83('0x3e')]=[{'all':!![]}];}_0x11f2f8=_['merge']({},_0x11f2f8,_0x2fe1cc[_0x1d83('0x3c')]);return db[_0x1d83('0x2b')][_0x1d83('0x45')](_0x11f2f8)[_0x1d83('0x27')](handleEntityNotFound(_0x1d3507,null))[_0x1d83('0x27')](respondWithResult(_0x1d3507,null))['catch'](handleError(_0x1d3507,null));};exports[_0x1d83('0x46')]=function(_0xf963db,_0x3bdcf1){return db['FreshdeskConfiguration'][_0x1d83('0x46')](_0xf963db[_0x1d83('0x47')],{})['then'](respondWithResult(_0x3bdcf1,0xc9))[_0x1d83('0x41')](handleError(_0x3bdcf1,null));};exports[_0x1d83('0x48')]=function(_0x3e720a,_0x161322){if(_0x3e720a[_0x1d83('0x47')]['id']){delete _0x3e720a[_0x1d83('0x47')]['id'];}return db[_0x1d83('0x2b')]['find']({'where':{'id':_0x3e720a['params']['id']}})[_0x1d83('0x27')](handleEntityNotFound(_0x161322,null))[_0x1d83('0x27')](saveUpdates(_0x3e720a['body'],null))['then'](respondWithResult(_0x161322,null))[_0x1d83('0x41')](handleError(_0x161322,null));};exports[_0x1d83('0x26')]=function(_0x12bee9,_0x5c4af1){return db['FreshdeskConfiguration'][_0x1d83('0x45')]({'where':{'id':_0x12bee9['params']['id']}})[_0x1d83('0x27')](handleEntityNotFound(_0x5c4af1,null))[_0x1d83('0x27')](removeEntity(_0x5c4af1,null))[_0x1d83('0x41')](handleError(_0x5c4af1,null));};exports[_0x1d83('0x49')]=function(_0x969cb3,_0x2a7869,_0x370f59){var _0x2cc149={};var _0x748aa2={};var _0x41850c;var _0x426483;return db[_0x1d83('0x2b')][_0x1d83('0x4a')]({'where':{'id':_0x969cb3[_0x1d83('0x43')]['id']}})[_0x1d83('0x27')](handleEntityNotFound(_0x2a7869,null))[_0x1d83('0x27')](function(_0x51eb89){if(_0x51eb89){_0x41850c=_0x51eb89;_0x748aa2[_0x1d83('0x33')]=_['keys'](db['FreshdeskField'][_0x1d83('0x4b')]);_0x748aa2['query']=_['keys'](_0x969cb3[_0x1d83('0x2f')]);_0x748aa2[_0x1d83('0x31')]=_[_0x1d83('0x32')](_0x748aa2[_0x1d83('0x33')],_0x748aa2['query']);_0x2cc149[_0x1d83('0x35')]=_[_0x1d83('0x32')](_0x748aa2[_0x1d83('0x33')],qs[_0x1d83('0x34')](_0x969cb3[_0x1d83('0x2f')]['fields']));_0x2cc149[_0x1d83('0x35')]=_0x2cc149[_0x1d83('0x35')]['length']?_0x2cc149['attributes']:_0x748aa2[_0x1d83('0x33')];_0x2cc149[_0x1d83('0x4c')]=qs[_0x1d83('0x36')](_0x969cb3[_0x1d83('0x2f')][_0x1d83('0x36')]);_0x2cc149[_0x1d83('0x37')]=qs[_0x1d83('0x31')](_['pick'](_0x969cb3[_0x1d83('0x2f')],_0x748aa2[_0x1d83('0x31')]));if(_0x969cb3[_0x1d83('0x2f')]['filter']){_0x2cc149[_0x1d83('0x37')]=_[_0x1d83('0x39')](_0x2cc149['where'],{'$or':_[_0x1d83('0x3a')](_0x2cc149['attributes'],function(_0x1b78f3){var _0x74fa4b={};_0x74fa4b[_0x1b78f3]={'$like':'%'+_0x969cb3[_0x1d83('0x2f')][_0x1d83('0x38')]+'%'};return _0x74fa4b;})});}_0x2cc149=_[_0x1d83('0x39')]({},_0x2cc149,_0x969cb3[_0x1d83('0x3c')]);return _0x41850c[_0x1d83('0x49')](_0x2cc149);}})[_0x1d83('0x27')](function(_0xdddede){if(_0xdddede){_0x426483=_0xdddede[_0x1d83('0x44')];if(!_0x969cb3[_0x1d83('0x2f')]['hasOwnProperty']('nolimit')){_0x2cc149['limit']=qs[_0x1d83('0x22')](_0x969cb3[_0x1d83('0x2f')][_0x1d83('0x22')]);_0x2cc149[_0x1d83('0x20')]=qs[_0x1d83('0x20')](_0x969cb3[_0x1d83('0x2f')][_0x1d83('0x20')]);}return _0x41850c['getFields'](_0x2cc149);}})[_0x1d83('0x27')](function(_0x26f163){if(_0x26f163){return _0x26f163?{'count':_0x426483,'rows':_0x26f163}:null;}})[_0x1d83('0x27')](respondWithResult(_0x2a7869,null))[_0x1d83('0x41')](handleError(_0x2a7869,null));};exports[_0x1d83('0x4d')]=function(_0x2c74b6,_0x521a61,_0xbd5657){var _0x12123a={};var _0x5cf003={};var _0x36fd55;var _0x196dee;return db[_0x1d83('0x2b')][_0x1d83('0x4a')]({'where':{'id':_0x2c74b6[_0x1d83('0x43')]['id']}})[_0x1d83('0x27')](handleEntityNotFound(_0x521a61,null))[_0x1d83('0x27')](function(_0x5ae063){if(_0x5ae063){_0x36fd55=_0x5ae063;_0x5cf003[_0x1d83('0x33')]=_['keys'](db[_0x1d83('0x4e')][_0x1d83('0x4b')]);_0x5cf003[_0x1d83('0x2f')]=_[_0x1d83('0x30')](_0x2c74b6[_0x1d83('0x2f')]);_0x5cf003[_0x1d83('0x31')]=_[_0x1d83('0x32')](_0x5cf003[_0x1d83('0x33')],_0x5cf003[_0x1d83('0x2f')]);_0x12123a['attributes']=_[_0x1d83('0x32')](_0x5cf003[_0x1d83('0x33')],qs[_0x1d83('0x34')](_0x2c74b6[_0x1d83('0x2f')][_0x1d83('0x34')]));_0x12123a['attributes']=_0x12123a['attributes']['length']?_0x12123a[_0x1d83('0x35')]:_0x5cf003[_0x1d83('0x33')];_0x12123a[_0x1d83('0x4c')]=qs[_0x1d83('0x36')](_0x2c74b6['query'][_0x1d83('0x36')]);_0x12123a[_0x1d83('0x37')]=qs[_0x1d83('0x31')](_[_0x1d83('0x4f')](_0x2c74b6[_0x1d83('0x2f')],_0x5cf003[_0x1d83('0x31')]));if(_0x2c74b6[_0x1d83('0x2f')][_0x1d83('0x38')]){_0x12123a[_0x1d83('0x37')]=_[_0x1d83('0x39')](_0x12123a[_0x1d83('0x37')],{'$or':_['map'](_0x12123a[_0x1d83('0x35')],function(_0x15b17f){var _0x29d8e8={};_0x29d8e8[_0x15b17f]={'$like':'%'+_0x2c74b6[_0x1d83('0x2f')]['filter']+'%'};return _0x29d8e8;})});}_0x12123a=_[_0x1d83('0x39')]({},_0x12123a,_0x2c74b6[_0x1d83('0x3c')]);return _0x36fd55[_0x1d83('0x4d')](_0x12123a);}})['then'](function(_0x5c6fb7){if(_0x5c6fb7){_0x196dee=_0x5c6fb7[_0x1d83('0x44')];if(!_0x2c74b6[_0x1d83('0x2f')][_0x1d83('0x50')](_0x1d83('0x51'))){_0x12123a[_0x1d83('0x22')]=qs['limit'](_0x2c74b6[_0x1d83('0x2f')][_0x1d83('0x22')]);_0x12123a[_0x1d83('0x20')]=qs[_0x1d83('0x20')](_0x2c74b6[_0x1d83('0x2f')][_0x1d83('0x20')]);}return _0x36fd55[_0x1d83('0x4d')](_0x12123a);}})['then'](function(_0x1862f4){if(_0x1862f4){return _0x1862f4?{'count':_0x196dee,'rows':_0x1862f4}:null;}})['then'](respondWithResult(_0x521a61,null))[_0x1d83('0x41')](handleError(_0x521a61,null));};exports['getDescriptions']=function(_0x55d6f7,_0x584f79,_0x26c3d7){var _0x105f20={};var _0x4ecea5={};var _0x4e540c;var _0x2ef292;return db[_0x1d83('0x2b')][_0x1d83('0x4a')]({'where':{'id':_0x55d6f7['params']['id']}})['then'](handleEntityNotFound(_0x584f79,null))[_0x1d83('0x27')](function(_0x4276f8){if(_0x4276f8){_0x4e540c=_0x4276f8;_0x4ecea5['model']=_[_0x1d83('0x30')](db['FreshdeskField']['rawAttributes']);_0x4ecea5[_0x1d83('0x2f')]=_[_0x1d83('0x30')](_0x55d6f7[_0x1d83('0x2f')]);_0x4ecea5[_0x1d83('0x31')]=_[_0x1d83('0x32')](_0x4ecea5['model'],_0x4ecea5['query']);_0x105f20[_0x1d83('0x35')]=_[_0x1d83('0x32')](_0x4ecea5['model'],qs[_0x1d83('0x34')](_0x55d6f7[_0x1d83('0x2f')][_0x1d83('0x34')]));_0x105f20[_0x1d83('0x35')]=_0x105f20[_0x1d83('0x35')][_0x1d83('0x44')]?_0x105f20[_0x1d83('0x35')]:_0x4ecea5[_0x1d83('0x33')];_0x105f20[_0x1d83('0x4c')]=qs['sort'](_0x55d6f7[_0x1d83('0x2f')][_0x1d83('0x36')]);_0x105f20['where']=qs[_0x1d83('0x31')](_[_0x1d83('0x4f')](_0x55d6f7[_0x1d83('0x2f')],_0x4ecea5[_0x1d83('0x31')]));if(_0x55d6f7['query'][_0x1d83('0x38')]){_0x105f20[_0x1d83('0x37')]=_[_0x1d83('0x39')](_0x105f20[_0x1d83('0x37')],{'$or':_['map'](_0x105f20[_0x1d83('0x35')],function(_0x33a6d8){var _0x4a6c31={};_0x4a6c31[_0x33a6d8]={'$like':'%'+_0x55d6f7[_0x1d83('0x2f')][_0x1d83('0x38')]+'%'};return _0x4a6c31;})});}_0x105f20=_[_0x1d83('0x39')]({},_0x105f20,_0x55d6f7[_0x1d83('0x3c')]);return _0x4e540c[_0x1d83('0x52')](_0x105f20);}})[_0x1d83('0x27')](function(_0x375617){if(_0x375617){_0x2ef292=_0x375617[_0x1d83('0x44')];if(!_0x55d6f7['query'][_0x1d83('0x50')](_0x1d83('0x51'))){_0x105f20[_0x1d83('0x22')]=qs[_0x1d83('0x22')](_0x55d6f7[_0x1d83('0x2f')]['limit']);_0x105f20[_0x1d83('0x20')]=qs['offset'](_0x55d6f7[_0x1d83('0x2f')]['offset']);}return _0x4e540c[_0x1d83('0x52')](_0x105f20);}})[_0x1d83('0x27')](function(_0x246d50){if(_0x246d50){return _0x246d50?{'count':_0x2ef292,'rows':_0x246d50}:null;}})[_0x1d83('0x27')](respondWithResult(_0x584f79,null))[_0x1d83('0x41')](handleError(_0x584f79,null));};exports[_0x1d83('0x53')]=function(_0x1db40a,_0xfa5a5a,_0x31b935){var _0x1ccba8={};var _0x545db4={};var _0x29c141;var _0x40bc0d;return db[_0x1d83('0x2b')][_0x1d83('0x4a')]({'where':{'id':_0x1db40a['params']['id']}})[_0x1d83('0x27')](handleEntityNotFound(_0xfa5a5a,null))['then'](function(_0x487b49){if(_0x487b49){_0x29c141=_0x487b49;_0x545db4['model']=_['keys'](db[_0x1d83('0x54')][_0x1d83('0x4b')]);_0x545db4[_0x1d83('0x2f')]=_[_0x1d83('0x30')](_0x1db40a['query']);_0x545db4['filters']=_[_0x1d83('0x32')](_0x545db4[_0x1d83('0x33')],_0x545db4[_0x1d83('0x2f')]);_0x1ccba8[_0x1d83('0x35')]=_[_0x1d83('0x32')](_0x545db4[_0x1d83('0x33')],qs[_0x1d83('0x34')](_0x1db40a[_0x1d83('0x2f')][_0x1d83('0x34')]));_0x1ccba8[_0x1d83('0x35')]=_0x1ccba8[_0x1d83('0x35')]['length']?_0x1ccba8['attributes']:_0x545db4['model'];_0x1ccba8[_0x1d83('0x4c')]=qs[_0x1d83('0x36')](_0x1db40a[_0x1d83('0x2f')]['sort']);_0x1ccba8['where']=qs[_0x1d83('0x31')](_[_0x1d83('0x4f')](_0x1db40a[_0x1d83('0x2f')],_0x545db4[_0x1d83('0x31')]));if(_0x1db40a[_0x1d83('0x2f')][_0x1d83('0x38')]){_0x1ccba8['where']=_[_0x1d83('0x39')](_0x1ccba8[_0x1d83('0x37')],{'$or':_[_0x1d83('0x3a')](_0x1ccba8[_0x1d83('0x35')],function(_0x22b254){var _0xa2bb36={};_0xa2bb36[_0x22b254]={'$like':'%'+_0x1db40a[_0x1d83('0x2f')][_0x1d83('0x38')]+'%'};return _0xa2bb36;})});}_0x1ccba8=_[_0x1d83('0x39')]({},_0x1ccba8,_0x1db40a[_0x1d83('0x3c')]);return _0x29c141[_0x1d83('0x53')](_0x1ccba8);}})[_0x1d83('0x27')](function(_0x324be0){if(_0x324be0){_0x40bc0d=_0x324be0[_0x1d83('0x44')];if(!_0x1db40a[_0x1d83('0x2f')]['hasOwnProperty'](_0x1d83('0x51'))){_0x1ccba8[_0x1d83('0x22')]=qs['limit'](_0x1db40a[_0x1d83('0x2f')][_0x1d83('0x22')]);_0x1ccba8['offset']=qs['offset'](_0x1db40a[_0x1d83('0x2f')][_0x1d83('0x20')]);}return _0x29c141[_0x1d83('0x53')](_0x1ccba8);}})[_0x1d83('0x27')](function(_0x52d1c2){if(_0x52d1c2){return _0x52d1c2?{'count':_0x40bc0d,'rows':_0x52d1c2}:null;}})[_0x1d83('0x27')](respondWithResult(_0xfa5a5a,null))[_0x1d83('0x41')](handleError(_0xfa5a5a,null));};exports[_0x1d83('0x55')]=function(_0xb1bc98,_0x1cec09,_0x362d3a){if(_0xb1bc98[_0x1d83('0x47')]['id']){delete _0xb1bc98[_0x1d83('0x47')]['id'];}return db[_0x1d83('0x2b')]['findOne']({'where':{'id':_0xb1bc98[_0x1d83('0x43')]['id']}})[_0x1d83('0x27')](handleEntityNotFound(_0x1cec09,null))[_0x1d83('0x27')](function(_0x99058f){if(_0x99058f){return _0x99058f['setTags'](_0xb1bc98[_0x1d83('0x47')]['ids']||[]);}return null;})[_0x1d83('0x27')](respondWithResult(_0x1cec09,null))[_0x1d83('0x41')](handleError(_0x1cec09,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index cd96230..2a29a76 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 _0xd5e6=['exports','define','FreshdeskConfiguration','int_freshdesk_configurations','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intFreshdeskConfiguration.attributes'];(function(_0x2b79c2,_0x5a5afb){var _0x49bfd1=function(_0x283118){while(--_0x283118){_0x2b79c2['push'](_0x2b79c2['shift']());}};_0x49bfd1(++_0x5a5afb);}(_0xd5e6,0xfb));var _0x6d5e=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xd5e6[_0x19950b];return _0x3c6b41;};'use strict';var _=require(_0x6d5e('0x0'));var util=require('util');var logger=require(_0x6d5e('0x1'))(_0x6d5e('0x2'));var moment=require(_0x6d5e('0x3'));var BPromise=require(_0x6d5e('0x4'));var rp=require(_0x6d5e('0x5'));var fs=require('fs');var path=require(_0x6d5e('0x6'));var rimraf=require(_0x6d5e('0x7'));var config=require('../../config/environment');var attributes=require(_0x6d5e('0x8'));module[_0x6d5e('0x9')]=function(_0x1a0182,_0x36e031){return _0x1a0182[_0x6d5e('0xa')](_0x6d5e('0xb'),attributes,{'tableName':_0x6d5e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd087=['./intFreshdeskConfiguration.attributes','exports','define','FreshdeskConfiguration','int_freshdesk_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x1e4855,_0x35bb97){var _0x3c7f10=function(_0x1b73c8){while(--_0x1b73c8){_0x1e4855['push'](_0x1e4855['shift']());}};_0x3c7f10(++_0x35bb97);}(_0xd087,0x1e5));var _0x7d08=function(_0x6cbe6d,_0x37bba3){_0x6cbe6d=_0x6cbe6d-0x0;var _0x25e1c9=_0xd087[_0x6cbe6d];return _0x25e1c9;};'use strict';var _=require(_0x7d08('0x0'));var util=require(_0x7d08('0x1'));var logger=require(_0x7d08('0x2'))(_0x7d08('0x3'));var moment=require(_0x7d08('0x4'));var BPromise=require(_0x7d08('0x5'));var rp=require(_0x7d08('0x6'));var fs=require('fs');var path=require(_0x7d08('0x7'));var rimraf=require(_0x7d08('0x8'));var config=require(_0x7d08('0x9'));var attributes=require(_0x7d08('0xa'));module[_0x7d08('0xb')]=function(_0xc07164,_0x1bc019){return _0xc07164[_0x7d08('0xc')](_0x7d08('0xd'),attributes,{'tableName':_0x7d08('0xe'),'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 a966b38..d66367d 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 _0xd083=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xd083,0x1ba));var _0x3d08=function(_0x37fcda,_0x2f5aa1){_0x37fcda=_0x37fcda-0x0;var _0xf5ed91=_0xd083[_0x37fcda];return _0xf5ed91;};'use strict';var _=require(_0x3d08('0x0'));var util=require(_0x3d08('0x1'));var moment=require('moment');var BPromise=require(_0x3d08('0x2'));var rs=require(_0x3d08('0x3'));var fs=require('fs');var Redis=require(_0x3d08('0x4'));var db=require(_0x3d08('0x5'))['db'];var utils=require(_0x3d08('0x6'));var logger=require(_0x3d08('0x7'))(_0x3d08('0x8'));var config=require(_0x3d08('0x9'));var jayson=require(_0x3d08('0xa'));var client=jayson[_0x3d08('0xb')][_0x3d08('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1b8ad4,_0x3bb402,_0x33b86c){return new BPromise(function(_0x11d9de,_0x5837ef){return client[_0x3d08('0xd')](_0x1b8ad4,_0x33b86c)[_0x3d08('0xe')](function(_0x2506ba){logger[_0x3d08('0xf')](_0x3d08('0x10'),_0x3bb402,_0x3d08('0x11'));logger[_0x3d08('0x12')](_0x3d08('0x13'),_0x3bb402,_0x3d08('0x11'),JSON[_0x3d08('0x14')](_0x2506ba));if(_0x2506ba[_0x3d08('0x15')]){if(_0x2506ba['error']['code']===0x1f4){logger[_0x3d08('0x15')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x3bb402,_0x2506ba['error'][_0x3d08('0x16')]);return _0x5837ef(_0x2506ba[_0x3d08('0x15')][_0x3d08('0x16')]);}logger[_0x3d08('0x15')](_0x3d08('0x10'),_0x3bb402,_0x2506ba[_0x3d08('0x15')][_0x3d08('0x16')]);return _0x11d9de(_0x2506ba[_0x3d08('0x15')][_0x3d08('0x16')]);}else{logger[_0x3d08('0xf')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x3bb402,_0x3d08('0x11'));_0x11d9de(_0x2506ba[_0x3d08('0x17')]['message']);}})[_0x3d08('0x18')](function(_0x51a361){logger[_0x3d08('0x15')](_0x3d08('0x10'),_0x3bb402,_0x51a361);_0x5837ef(_0x51a361);});});} \ No newline at end of file +var _0x42ad=['error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x283a81,_0x42f033){var _0x57533f=function(_0x1bfe9e){while(--_0x1bfe9e){_0x283a81['push'](_0x283a81['shift']());}};_0x57533f(++_0x42f033);}(_0x42ad,0x15e));var _0xd42a=function(_0x5a9383,_0x169f18){_0x5a9383=_0x5a9383-0x0;var _0x551d0c=_0x42ad[_0x5a9383];return _0x551d0c;};'use strict';var _=require(_0xd42a('0x0'));var util=require(_0xd42a('0x1'));var moment=require(_0xd42a('0x2'));var BPromise=require('bluebird');var rs=require(_0xd42a('0x3'));var fs=require('fs');var Redis=require(_0xd42a('0x4'));var db=require(_0xd42a('0x5'))['db'];var utils=require(_0xd42a('0x6'));var logger=require(_0xd42a('0x7'))(_0xd42a('0x8'));var config=require(_0xd42a('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xd42a('0xa')][_0xd42a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x40d8b2,_0x2712d2,_0x151eb8){return new BPromise(function(_0x51064b,_0x268899){return client['request'](_0x40d8b2,_0x151eb8)[_0xd42a('0xc')](function(_0x25a66b){logger[_0xd42a('0xd')](_0xd42a('0xe'),_0x2712d2,_0xd42a('0xf'));logger['debug'](_0xd42a('0x10'),_0x2712d2,_0xd42a('0xf'),JSON[_0xd42a('0x11')](_0x25a66b));if(_0x25a66b[_0xd42a('0x12')]){if(_0x25a66b['error'][_0xd42a('0x13')]===0x1f4){logger[_0xd42a('0x12')](_0xd42a('0xe'),_0x2712d2,_0x25a66b[_0xd42a('0x12')][_0xd42a('0x14')]);return _0x268899(_0x25a66b['error'][_0xd42a('0x14')]);}logger['error'](_0xd42a('0xe'),_0x2712d2,_0x25a66b['error'][_0xd42a('0x14')]);return _0x51064b(_0x25a66b['error'][_0xd42a('0x14')]);}else{logger[_0xd42a('0xd')](_0xd42a('0xe'),_0x2712d2,'request\x20sent');_0x51064b(_0x25a66b[_0xd42a('0x15')][_0xd42a('0x14')]);}})[_0xd42a('0x16')](function(_0x4ada56){logger[_0xd42a('0x12')](_0xd42a('0xe'),_0x2712d2,_0x4ada56);_0x268899(_0x4ada56);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index 82e058b..ada66a9 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 _0x41e8=['put','/:id','update','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intFreshdeskField.controller','get','isAuthenticated','index','show','post'];(function(_0x49adfd,_0x136735){var _0x518e53=function(_0x5b472c){while(--_0x5b472c){_0x49adfd['push'](_0x49adfd['shift']());}};_0x518e53(++_0x136735);}(_0x41e8,0x148));var _0x841e=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0x41e8[_0x376b45];return _0x2341b3;};'use strict';var multer=require(_0x841e('0x0'));var util=require(_0x841e('0x1'));var path=require('path');var timeout=require(_0x841e('0x2'));var express=require(_0x841e('0x3'));var router=express[_0x841e('0x4')]();var fs_extra=require(_0x841e('0x5'));var auth=require(_0x841e('0x6'));var interaction=require(_0x841e('0x7'));var config=require('../../config/environment');var controller=require(_0x841e('0x8'));router[_0x841e('0x9')]('/',auth[_0x841e('0xa')](),controller[_0x841e('0xb')]);router[_0x841e('0x9')]('/:id',auth[_0x841e('0xa')](),controller[_0x841e('0xc')]);router[_0x841e('0xd')]('/',auth[_0x841e('0xa')](),controller['create']);router[_0x841e('0xe')](_0x841e('0xf'),auth[_0x841e('0xa')](),controller[_0x841e('0x10')]);router['delete'](_0x841e('0xf'),auth[_0x841e('0xa')](),controller[_0x841e('0x11')]);module['exports']=router; \ No newline at end of file +var _0x1f15=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','get','isAuthenticated','/:id','post','create','put','update','delete','exports','multer','util','express','Router'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x1f15,0xc8));var _0x51f1=function(_0xfba8d0,_0x34d350){_0xfba8d0=_0xfba8d0-0x0;var _0x1ec6da=_0x1f15[_0xfba8d0];return _0x1ec6da;};'use strict';var multer=require(_0x51f1('0x0'));var util=require(_0x51f1('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x51f1('0x2'));var router=express[_0x51f1('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x51f1('0x4'));var interaction=require(_0x51f1('0x5'));var config=require(_0x51f1('0x6'));var controller=require(_0x51f1('0x7'));router[_0x51f1('0x8')]('/',auth[_0x51f1('0x9')](),controller['index']);router[_0x51f1('0x8')](_0x51f1('0xa'),auth[_0x51f1('0x9')](),controller['show']);router[_0x51f1('0xb')]('/',auth['isAuthenticated'](),controller[_0x51f1('0xc')]);router[_0x51f1('0xd')](_0x51f1('0xa'),auth[_0x51f1('0x9')](),controller[_0x51f1('0xe')]);router[_0x51f1('0xf')]('/:id',auth[_0x51f1('0x9')](),controller['destroy']);module[_0x51f1('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 3866a6d..532757b 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 _0xab8d=['string','STRING','variable','sequelize','ENUM','customVariable','keyValue','picklist'];(function(_0x59d186,_0x415a9c){var _0x3a372a=function(_0x279acb){while(--_0x279acb){_0x59d186['push'](_0x59d186['shift']());}};_0x3a372a(++_0x415a9c);}(_0xab8d,0x1e3));var _0xdab8=function(_0xa8883,_0x1f107f){_0xa8883=_0xa8883-0x0;var _0x479426=_0xab8d[_0xa8883];return _0x479426;};'use strict';var Sequelize=require(_0xdab8('0x0'));module['exports']={'type':{'type':Sequelize[_0xdab8('0x1')]('string','variable',_0xdab8('0x2'),_0xdab8('0x3'),_0xdab8('0x4')),'defaultValue':_0xdab8('0x5')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xdab8('0x6')]},'keyType':{'type':Sequelize[_0xdab8('0x1')]('string',_0xdab8('0x7'),_0xdab8('0x2'))},'keyContent':{'type':Sequelize[_0xdab8('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xdab8('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xdab8('0x6')]}}; \ No newline at end of file +var _0x114b=['exports','ENUM','string','customVariable','keyValue','picklist','STRING','variable','sequelize'];(function(_0x345195,_0x25d342){var _0x4ae4c6=function(_0x528c95){while(--_0x528c95){_0x345195['push'](_0x345195['shift']());}};_0x4ae4c6(++_0x25d342);}(_0x114b,0x167));var _0xb114=function(_0x15d17a,_0x3298ab){_0x15d17a=_0x15d17a-0x0;var _0x1032ef=_0x114b[_0x15d17a];return _0x1032ef;};'use strict';var Sequelize=require(_0xb114('0x0'));module[_0xb114('0x1')]={'type':{'type':Sequelize[_0xb114('0x2')](_0xb114('0x3'),'variable',_0xb114('0x4'),_0xb114('0x5'),_0xb114('0x6')),'defaultValue':_0xb114('0x3')},'content':{'type':Sequelize[_0xb114('0x7')]},'key':{'type':Sequelize[_0xb114('0x7')]},'keyType':{'type':Sequelize[_0xb114('0x2')](_0xb114('0x3'),_0xb114('0x8'),'customVariable')},'keyContent':{'type':Sequelize[_0xb114('0x7')]},'idField':{'type':Sequelize[_0xb114('0x7')]},'nameField':{'type':Sequelize[_0xb114('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xb114('0x7')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index 9313cd1..f464c52 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 _0x5ec6=['../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map','FreshdeskField','rawAttributes','key','keys','query','filters','intersection','attributes','model','fields','length','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','catch','show','params','find','create','body','eml-format','rimraf','zip-dir','request-promise','bluebird','util','sox','ejs','fs-extra','squel','crypto','desk.js','to-csv','querystring','../../components/auth/service'];(function(_0x317da2,_0x52bd9b){var _0x2d33fc=function(_0x5834b9){while(--_0x5834b9){_0x317da2['push'](_0x317da2['shift']());}};_0x2d33fc(++_0x52bd9b);}(_0x5ec6,0x7f));var _0x65ec=function(_0x22c353,_0x457bfb){_0x22c353=_0x22c353-0x0;var _0x3065d4=_0x5ec6[_0x22c353];return _0x3065d4;};'use strict';var emlformat=require(_0x65ec('0x0'));var rimraf=require(_0x65ec('0x1'));var zipdir=require(_0x65ec('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x65ec('0x3'));var moment=require('moment');var BPromise=require(_0x65ec('0x4'));var Mustache=require('mustache');var util=require(_0x65ec('0x5'));var path=require('path');var sox=require(_0x65ec('0x6'));var csv=require('to-csv');var ejs=require(_0x65ec('0x7'));var fs=require('fs');var fs_extra=require(_0x65ec('0x8'));var _=require('lodash');var squel=require(_0x65ec('0x9'));var crypto=require(_0x65ec('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x65ec('0xb'));var toCsv=require(_0x65ec('0xc'));var querystring=require(_0x65ec('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x65ec('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x65ec('0xf'));var hardwareService=require(_0x65ec('0x10'));var logger=require('../../config/logger')(_0x65ec('0x11'));var utils=require(_0x65ec('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x65ec('0x13'));var db=require(_0x65ec('0x14'))['db'];function respondWithStatusCode(_0x53d62b,_0x3e52c8){_0x3e52c8=_0x3e52c8||0xcc;return function(_0x2af7d6){if(_0x2af7d6){return _0x53d62b[_0x65ec('0x15')](_0x3e52c8);}return _0x53d62b[_0x65ec('0x16')](_0x3e52c8)[_0x65ec('0x17')]();};}function respondWithResult(_0x434e20,_0x344724){_0x344724=_0x344724||0xc8;return function(_0x3edbfd){if(_0x3edbfd){return _0x434e20['status'](_0x344724)[_0x65ec('0x18')](_0x3edbfd);}};}function respondWithFilteredResult(_0x3ed6f7,_0x35d06b){return function(_0x4bbe88){if(_0x4bbe88){var _0x5a0442=typeof _0x35d06b[_0x65ec('0x19')]===_0x65ec('0x1a')&&typeof _0x35d06b[_0x65ec('0x1b')]==='undefined';var _0x25dae7=_0x4bbe88[_0x65ec('0x1c')];var _0x1254f8=_0x5a0442?0x0:_0x35d06b[_0x65ec('0x19')];var _0x29ebc4=_0x5a0442?_0x4bbe88[_0x65ec('0x1c')]:_0x35d06b[_0x65ec('0x19')]+_0x35d06b[_0x65ec('0x1b')];var _0x2127e2;if(_0x29ebc4>=_0x25dae7){_0x29ebc4=_0x25dae7;_0x2127e2=0xc8;}else{_0x2127e2=0xce;}_0x3ed6f7[_0x65ec('0x16')](_0x2127e2);return _0x3ed6f7[_0x65ec('0x1d')](_0x65ec('0x1e'),_0x1254f8+'-'+_0x29ebc4+'/'+_0x25dae7)[_0x65ec('0x18')](_0x4bbe88);}return null;};}function patchUpdates(_0x1467ac){return function(_0x3804a4){try{jsonpatch[_0x65ec('0x1f')](_0x3804a4,_0x1467ac,!![]);}catch(_0x15d4eb){return BPromise[_0x65ec('0x20')](_0x15d4eb);}return _0x3804a4[_0x65ec('0x21')]();};}function saveUpdates(_0x4ff93c,_0x170703){return function(_0x297fba){if(_0x297fba){return _0x297fba[_0x65ec('0x22')](_0x4ff93c)[_0x65ec('0x23')](function(_0x1d60fb){return _0x1d60fb;});}return null;};}function removeEntity(_0x163e55,_0x47288d){return function(_0x58239f){if(_0x58239f){return _0x58239f[_0x65ec('0x24')]()[_0x65ec('0x23')](function(){_0x163e55[_0x65ec('0x16')](0xcc)[_0x65ec('0x17')]();});}};}function handleEntityNotFound(_0x288e66,_0x156793){return function(_0x21426b){if(!_0x21426b){_0x288e66[_0x65ec('0x15')](0x194);}return _0x21426b;};}function handleError(_0x297e09,_0x4c846b){_0x4c846b=_0x4c846b||0x1f4;return function(_0x10baef){logger[_0x65ec('0x25')](_0x10baef[_0x65ec('0x26')]);if(_0x10baef[_0x65ec('0x27')]){delete _0x10baef['name'];}_0x297e09[_0x65ec('0x16')](_0x4c846b)['send'](_0x10baef);};}exports[_0x65ec('0x28')]=function(_0x1ada47,_0x1d0b5c){var _0x30366c={},_0x14431d={},_0x46d4c1={'count':0x0,'rows':[]};var _0x46bf66=_[_0x65ec('0x29')](db[_0x65ec('0x2a')][_0x65ec('0x2b')],function(_0x3c97e2){return{'name':_0x3c97e2['fieldName'],'type':_0x3c97e2['type'][_0x65ec('0x2c')]};});_0x14431d['model']=_[_0x65ec('0x29')](_0x46bf66,_0x65ec('0x27'));_0x14431d['query']=_[_0x65ec('0x2d')](_0x1ada47[_0x65ec('0x2e')]);_0x14431d[_0x65ec('0x2f')]=_[_0x65ec('0x30')](_0x14431d['model'],_0x14431d[_0x65ec('0x2e')]);_0x30366c[_0x65ec('0x31')]=_[_0x65ec('0x30')](_0x14431d[_0x65ec('0x32')],qs[_0x65ec('0x33')](_0x1ada47[_0x65ec('0x2e')][_0x65ec('0x33')]));_0x30366c[_0x65ec('0x31')]=_0x30366c[_0x65ec('0x31')][_0x65ec('0x34')]?_0x30366c['attributes']:_0x14431d[_0x65ec('0x32')];if(!_0x1ada47[_0x65ec('0x2e')]['hasOwnProperty'](_0x65ec('0x35'))){_0x30366c[_0x65ec('0x1b')]=qs[_0x65ec('0x1b')](_0x1ada47[_0x65ec('0x2e')][_0x65ec('0x1b')]);_0x30366c[_0x65ec('0x19')]=qs[_0x65ec('0x19')](_0x1ada47['query'][_0x65ec('0x19')]);}_0x30366c[_0x65ec('0x36')]=qs[_0x65ec('0x37')](_0x1ada47[_0x65ec('0x2e')]['sort']);_0x30366c[_0x65ec('0x38')]=qs[_0x65ec('0x2f')](_[_0x65ec('0x39')](_0x1ada47[_0x65ec('0x2e')],_0x14431d['filters']),_0x46bf66);if(_0x1ada47['query'][_0x65ec('0x3a')]){_0x30366c['where']=_[_0x65ec('0x3b')](_0x30366c[_0x65ec('0x38')],{'$or':_['map'](_0x46bf66,function(_0x16ef59){if(_0x16ef59[_0x65ec('0x3c')]!==_0x65ec('0x3d')){var _0x5357bf={};_0x5357bf[_0x16ef59[_0x65ec('0x27')]]={'$like':'%'+_0x1ada47[_0x65ec('0x2e')][_0x65ec('0x3a')]+'%'};return _0x5357bf;}})});}_0x30366c=_[_0x65ec('0x3b')]({},_0x30366c,_0x1ada47[_0x65ec('0x3e')]);var _0x2ce56f={'where':_0x30366c[_0x65ec('0x38')]};return db['FreshdeskField'][_0x65ec('0x1c')](_0x2ce56f)['then'](function(_0x2654b2){_0x46d4c1[_0x65ec('0x1c')]=_0x2654b2;if(_0x1ada47[_0x65ec('0x2e')][_0x65ec('0x3f')]){_0x30366c[_0x65ec('0x40')]=[{'all':!![]}];}return db[_0x65ec('0x2a')]['findAll'](_0x30366c);})[_0x65ec('0x23')](function(_0x4ba7df){_0x46d4c1['rows']=_0x4ba7df;return _0x46d4c1;})[_0x65ec('0x23')](respondWithFilteredResult(_0x1d0b5c,_0x30366c))[_0x65ec('0x41')](handleError(_0x1d0b5c,null));};exports[_0x65ec('0x42')]=function(_0x143a11,_0x1d475e){var _0x524235={'raw':!![],'where':{'id':_0x143a11[_0x65ec('0x43')]['id']}},_0x4843ca={};_0x4843ca[_0x65ec('0x32')]=_[_0x65ec('0x2d')](db[_0x65ec('0x2a')][_0x65ec('0x2b')]);_0x4843ca['query']=_['keys'](_0x143a11[_0x65ec('0x2e')]);_0x4843ca[_0x65ec('0x2f')]=_[_0x65ec('0x30')](_0x4843ca[_0x65ec('0x32')],_0x4843ca[_0x65ec('0x2e')]);_0x524235[_0x65ec('0x31')]=_[_0x65ec('0x30')](_0x4843ca['model'],qs[_0x65ec('0x33')](_0x143a11[_0x65ec('0x2e')][_0x65ec('0x33')]));_0x524235['attributes']=_0x524235[_0x65ec('0x31')][_0x65ec('0x34')]?_0x524235['attributes']:_0x4843ca[_0x65ec('0x32')];if(_0x143a11[_0x65ec('0x2e')][_0x65ec('0x3f')]){_0x524235[_0x65ec('0x40')]=[{'all':!![]}];}_0x524235=_[_0x65ec('0x3b')]({},_0x524235,_0x143a11['options']);return db[_0x65ec('0x2a')][_0x65ec('0x44')](_0x524235)[_0x65ec('0x23')](handleEntityNotFound(_0x1d475e,null))[_0x65ec('0x23')](respondWithResult(_0x1d475e,null))['catch'](handleError(_0x1d475e,null));};exports[_0x65ec('0x45')]=function(_0x509c28,_0x1ed0f9){return db[_0x65ec('0x2a')][_0x65ec('0x45')](_0x509c28['body'],{})['then'](respondWithResult(_0x1ed0f9,0xc9))[_0x65ec('0x41')](handleError(_0x1ed0f9,null));};exports[_0x65ec('0x22')]=function(_0xf5419,_0x2111af){if(_0xf5419[_0x65ec('0x46')]['id']){delete _0xf5419[_0x65ec('0x46')]['id'];}return db[_0x65ec('0x2a')][_0x65ec('0x44')]({'where':{'id':_0xf5419[_0x65ec('0x43')]['id']}})[_0x65ec('0x23')](handleEntityNotFound(_0x2111af,null))[_0x65ec('0x23')](saveUpdates(_0xf5419[_0x65ec('0x46')],null))[_0x65ec('0x23')](respondWithResult(_0x2111af,null))[_0x65ec('0x41')](handleError(_0x2111af,null));};exports[_0x65ec('0x24')]=function(_0x14eaef,_0x22c28c){return db['FreshdeskField'][_0x65ec('0x44')]({'where':{'id':_0x14eaef[_0x65ec('0x43')]['id']}})['then'](handleEntityNotFound(_0x22c28c,null))[_0x65ec('0x23')](removeEntity(_0x22c28c,null))[_0x65ec('0x41')](handleError(_0x22c28c,null));}; \ No newline at end of file +var _0x2356=['rimraf','zip-dir','moment','bluebird','path','ejs','fs-extra','lodash','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','undefined','limit','count','offset','json','reject','save','destroy','then','name','send','index','map','FreshdeskField','fieldName','key','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','pick','merge','where','type','VIRTUAL','filter','include','findAll','rows','catch','params','rawAttributes','length','includeAll','options','find','create','body','update'];(function(_0x7e2eb0,_0x17cd58){var _0xd92de4=function(_0x5d005b){while(--_0x5d005b){_0x7e2eb0['push'](_0x7e2eb0['shift']());}};_0xd92de4(++_0x17cd58);}(_0x2356,0x14f));var _0x6235=function(_0x3fb239,_0x468289){_0x3fb239=_0x3fb239-0x0;var _0x519d34=_0x2356[_0x3fb239];return _0x519d34;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6235('0x0'));var zipdir=require(_0x6235('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6235('0x2'));var BPromise=require(_0x6235('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0x6235('0x4'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x6235('0x5'));var fs=require('fs');var fs_extra=require(_0x6235('0x6'));var _=require(_0x6235('0x7'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x6235('0x8'));var toCsv=require('to-csv');var querystring=require(_0x6235('0x9'));var Papa=require(_0x6235('0xa'));var Redis=require(_0x6235('0xb'));var authService=require(_0x6235('0xc'));var qs=require('../../components/parsers/qs');var as=require(_0x6235('0xd'));var hardwareService=require(_0x6235('0xe'));var logger=require(_0x6235('0xf'))(_0x6235('0x10'));var utils=require(_0x6235('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0x6235('0x12'));var db=require(_0x6235('0x13'))['db'];function respondWithStatusCode(_0x1303e7,_0x6c422b){_0x6c422b=_0x6c422b||0xcc;return function(_0x48df2d){if(_0x48df2d){return _0x1303e7[_0x6235('0x14')](_0x6c422b);}return _0x1303e7[_0x6235('0x15')](_0x6c422b)['end']();};}function respondWithResult(_0x3f5b7d,_0x48e3a7){_0x48e3a7=_0x48e3a7||0xc8;return function(_0x35156f){if(_0x35156f){return _0x3f5b7d[_0x6235('0x15')](_0x48e3a7)['json'](_0x35156f);}};}function respondWithFilteredResult(_0x1cfd0b,_0x1f1c54){return function(_0x3f619b){if(_0x3f619b){var _0x3f32af=typeof _0x1f1c54['offset']===_0x6235('0x16')&&typeof _0x1f1c54[_0x6235('0x17')]===_0x6235('0x16');var _0x2e5a84=_0x3f619b[_0x6235('0x18')];var _0x2a3554=_0x3f32af?0x0:_0x1f1c54[_0x6235('0x19')];var _0x22f090=_0x3f32af?_0x3f619b[_0x6235('0x18')]:_0x1f1c54[_0x6235('0x19')]+_0x1f1c54['limit'];var _0x35103a;if(_0x22f090>=_0x2e5a84){_0x22f090=_0x2e5a84;_0x35103a=0xc8;}else{_0x35103a=0xce;}_0x1cfd0b[_0x6235('0x15')](_0x35103a);return _0x1cfd0b['set']('Content-Range',_0x2a3554+'-'+_0x22f090+'/'+_0x2e5a84)[_0x6235('0x1a')](_0x3f619b);}return null;};}function patchUpdates(_0x4f0aa2){return function(_0x5d3872){try{jsonpatch['apply'](_0x5d3872,_0x4f0aa2,!![]);}catch(_0x367207){return BPromise[_0x6235('0x1b')](_0x367207);}return _0x5d3872[_0x6235('0x1c')]();};}function saveUpdates(_0x1c60c7,_0x24c057){return function(_0x270c49){if(_0x270c49){return _0x270c49['update'](_0x1c60c7)['then'](function(_0x4663b3){return _0x4663b3;});}return null;};}function removeEntity(_0x5ac43d,_0x2189d0){return function(_0x1bed65){if(_0x1bed65){return _0x1bed65[_0x6235('0x1d')]()[_0x6235('0x1e')](function(){_0x5ac43d[_0x6235('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1e3d90,_0x1da380){return function(_0x168b01){if(!_0x168b01){_0x1e3d90[_0x6235('0x14')](0x194);}return _0x168b01;};}function handleError(_0x3eac45,_0x5a58d9){_0x5a58d9=_0x5a58d9||0x1f4;return function(_0x4b44f8){logger['error'](_0x4b44f8['stack']);if(_0x4b44f8[_0x6235('0x1f')]){delete _0x4b44f8[_0x6235('0x1f')];}_0x3eac45[_0x6235('0x15')](_0x5a58d9)[_0x6235('0x20')](_0x4b44f8);};}exports[_0x6235('0x21')]=function(_0x2acc8c,_0x59bb16){var _0x47e86b={},_0x5dc066={},_0x94db3c={'count':0x0,'rows':[]};var _0x50ea93=_[_0x6235('0x22')](db[_0x6235('0x23')]['rawAttributes'],function(_0x37580b){return{'name':_0x37580b[_0x6235('0x24')],'type':_0x37580b['type'][_0x6235('0x25')]};});_0x5dc066[_0x6235('0x26')]=_[_0x6235('0x22')](_0x50ea93,_0x6235('0x1f'));_0x5dc066[_0x6235('0x27')]=_[_0x6235('0x28')](_0x2acc8c[_0x6235('0x27')]);_0x5dc066[_0x6235('0x29')]=_[_0x6235('0x2a')](_0x5dc066[_0x6235('0x26')],_0x5dc066['query']);_0x47e86b[_0x6235('0x2b')]=_['intersection'](_0x5dc066['model'],qs[_0x6235('0x2c')](_0x2acc8c['query']['fields']));_0x47e86b[_0x6235('0x2b')]=_0x47e86b['attributes']['length']?_0x47e86b[_0x6235('0x2b')]:_0x5dc066[_0x6235('0x26')];if(!_0x2acc8c[_0x6235('0x27')]['hasOwnProperty'](_0x6235('0x2d'))){_0x47e86b[_0x6235('0x17')]=qs[_0x6235('0x17')](_0x2acc8c['query'][_0x6235('0x17')]);_0x47e86b['offset']=qs[_0x6235('0x19')](_0x2acc8c[_0x6235('0x27')][_0x6235('0x19')]);}_0x47e86b[_0x6235('0x2e')]=qs[_0x6235('0x2f')](_0x2acc8c['query'][_0x6235('0x2f')]);_0x47e86b['where']=qs[_0x6235('0x29')](_[_0x6235('0x30')](_0x2acc8c[_0x6235('0x27')],_0x5dc066[_0x6235('0x29')]),_0x50ea93);if(_0x2acc8c[_0x6235('0x27')]['filter']){_0x47e86b['where']=_[_0x6235('0x31')](_0x47e86b[_0x6235('0x32')],{'$or':_[_0x6235('0x22')](_0x50ea93,function(_0x41cdc2){if(_0x41cdc2[_0x6235('0x33')]!==_0x6235('0x34')){var _0xe277d0={};_0xe277d0[_0x41cdc2[_0x6235('0x1f')]]={'$like':'%'+_0x2acc8c[_0x6235('0x27')][_0x6235('0x35')]+'%'};return _0xe277d0;}})});}_0x47e86b=_['merge']({},_0x47e86b,_0x2acc8c['options']);var _0x4d1cac={'where':_0x47e86b['where']};return db['FreshdeskField'][_0x6235('0x18')](_0x4d1cac)[_0x6235('0x1e')](function(_0x290da6){_0x94db3c['count']=_0x290da6;if(_0x2acc8c[_0x6235('0x27')]['includeAll']){_0x47e86b[_0x6235('0x36')]=[{'all':!![]}];}return db[_0x6235('0x23')][_0x6235('0x37')](_0x47e86b);})[_0x6235('0x1e')](function(_0x36abb1){_0x94db3c[_0x6235('0x38')]=_0x36abb1;return _0x94db3c;})[_0x6235('0x1e')](respondWithFilteredResult(_0x59bb16,_0x47e86b))[_0x6235('0x39')](handleError(_0x59bb16,null));};exports['show']=function(_0x565c9f,_0x341fdc){var _0x54cbb1={'raw':!![],'where':{'id':_0x565c9f[_0x6235('0x3a')]['id']}},_0x173c62={};_0x173c62[_0x6235('0x26')]=_[_0x6235('0x28')](db[_0x6235('0x23')][_0x6235('0x3b')]);_0x173c62[_0x6235('0x27')]=_['keys'](_0x565c9f[_0x6235('0x27')]);_0x173c62[_0x6235('0x29')]=_[_0x6235('0x2a')](_0x173c62['model'],_0x173c62[_0x6235('0x27')]);_0x54cbb1[_0x6235('0x2b')]=_[_0x6235('0x2a')](_0x173c62[_0x6235('0x26')],qs[_0x6235('0x2c')](_0x565c9f[_0x6235('0x27')][_0x6235('0x2c')]));_0x54cbb1[_0x6235('0x2b')]=_0x54cbb1['attributes'][_0x6235('0x3c')]?_0x54cbb1[_0x6235('0x2b')]:_0x173c62[_0x6235('0x26')];if(_0x565c9f['query'][_0x6235('0x3d')]){_0x54cbb1[_0x6235('0x36')]=[{'all':!![]}];}_0x54cbb1=_[_0x6235('0x31')]({},_0x54cbb1,_0x565c9f[_0x6235('0x3e')]);return db[_0x6235('0x23')][_0x6235('0x3f')](_0x54cbb1)[_0x6235('0x1e')](handleEntityNotFound(_0x341fdc,null))[_0x6235('0x1e')](respondWithResult(_0x341fdc,null))[_0x6235('0x39')](handleError(_0x341fdc,null));};exports['create']=function(_0x148a78,_0x4f30c4){return db[_0x6235('0x23')][_0x6235('0x40')](_0x148a78[_0x6235('0x41')],{})['then'](respondWithResult(_0x4f30c4,0xc9))['catch'](handleError(_0x4f30c4,null));};exports[_0x6235('0x42')]=function(_0x433263,_0x4468d4){if(_0x433263[_0x6235('0x41')]['id']){delete _0x433263['body']['id'];}return db[_0x6235('0x23')][_0x6235('0x3f')]({'where':{'id':_0x433263['params']['id']}})[_0x6235('0x1e')](handleEntityNotFound(_0x4468d4,null))['then'](saveUpdates(_0x433263[_0x6235('0x41')],null))[_0x6235('0x1e')](respondWithResult(_0x4468d4,null))[_0x6235('0x39')](handleError(_0x4468d4,null));};exports['destroy']=function(_0x2aa5f9,_0x5bff03){return db['FreshdeskField']['find']({'where':{'id':_0x2aa5f9[_0x6235('0x3a')]['id']}})[_0x6235('0x1e')](handleEntityNotFound(_0x5bff03,null))[_0x6235('0x1e')](removeEntity(_0x5bff03,null))[_0x6235('0x39')](handleError(_0x5bff03,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index 15b9612..6a50715 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 _0x6135=['define','FreshdeskField','int_freshdesk_fields','idField','FieldId','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intFreshdeskField.attributes'];(function(_0xed8e01,_0x561850){var _0x2a13b5=function(_0x21a1b9){while(--_0x21a1b9){_0xed8e01['push'](_0xed8e01['shift']());}};_0x2a13b5(++_0x561850);}(_0x6135,0x18b));var _0x5613=function(_0x4e11d5,_0x1ce514){_0x4e11d5=_0x4e11d5-0x0;var _0x5e4e4c=_0x6135[_0x4e11d5];return _0x5e4e4c;};'use strict';var _=require(_0x5613('0x0'));var util=require(_0x5613('0x1'));var logger=require(_0x5613('0x2'))(_0x5613('0x3'));var moment=require(_0x5613('0x4'));var BPromise=require('bluebird');var rp=require(_0x5613('0x5'));var fs=require('fs');var path=require(_0x5613('0x6'));var rimraf=require(_0x5613('0x7'));var config=require(_0x5613('0x8'));var attributes=require(_0x5613('0x9'));module['exports']=function(_0x37a2af,_0x17604e){return _0x37a2af[_0x5613('0xa')](_0x5613('0xb'),attributes,{'tableName':_0x5613('0xc'),'paranoid':![],'indexes':[{'name':'freshdesk_unique_index','fields':[_0x5613('0xd'),_0x5613('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xaaf2=['bluebird','request-promise','rimraf','../../config/environment','./intFreshdeskField.attributes','define','FreshdeskField','int_freshdesk_fields','freshdesk_unique_index','idField','FieldId','util','../../config/logger','moment'];(function(_0x1cf7ce,_0x2d1da7){var _0xab4013=function(_0x473d4e){while(--_0x473d4e){_0x1cf7ce['push'](_0x1cf7ce['shift']());}};_0xab4013(++_0x2d1da7);}(_0xaaf2,0x169));var _0x2aaf=function(_0x2fc53e,_0x5fc5e3){_0x2fc53e=_0x2fc53e-0x0;var _0x1430af=_0xaaf2[_0x2fc53e];return _0x1430af;};'use strict';var _=require('lodash');var util=require(_0x2aaf('0x0'));var logger=require(_0x2aaf('0x1'))('api');var moment=require(_0x2aaf('0x2'));var BPromise=require(_0x2aaf('0x3'));var rp=require(_0x2aaf('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2aaf('0x5'));var config=require(_0x2aaf('0x6'));var attributes=require(_0x2aaf('0x7'));module['exports']=function(_0x12aac5,_0x3313ff){return _0x12aac5[_0x2aaf('0x8')](_0x2aaf('0x9'),attributes,{'tableName':_0x2aaf('0xa'),'paranoid':![],'indexes':[{'name':_0x2aaf('0xb'),'fields':[_0x2aaf('0xc'),_0x2aaf('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.rpc.js b/server/api/intFreshdeskField/intFreshdeskField.rpc.js index 05c4cbd..39e693e 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 _0x2725=['FreshdeskField,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','rpc','../../config/environment','jayson/promise','client','http','then','info'];(function(_0x2662d2,_0x5040bc){var _0x4f5aea=function(_0x2e52dc){while(--_0x2e52dc){_0x2662d2['push'](_0x2662d2['shift']());}};_0x4f5aea(++_0x5040bc);}(_0x2725,0xbc));var _0x5272=function(_0x4914e2,_0x48be8f){_0x4914e2=_0x4914e2-0x0;var _0x2dcd07=_0x2725[_0x4914e2];return _0x2dcd07;};'use strict';var _=require('lodash');var util=require(_0x5272('0x0'));var moment=require(_0x5272('0x1'));var BPromise=require(_0x5272('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('../../config/logger')(_0x5272('0x3'));var config=require(_0x5272('0x4'));var jayson=require(_0x5272('0x5'));var client=jayson[_0x5272('0x6')][_0x5272('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4ff56f,_0x12624a,_0x40fc69){return new BPromise(function(_0x918e74,_0x50b4ac){return client['request'](_0x4ff56f,_0x40fc69)[_0x5272('0x8')](function(_0x54514a){logger[_0x5272('0x9')](_0x5272('0xa'),_0x12624a,'request\x20sent');logger['debug']('FreshdeskField,\x20%s,\x20%s,\x20%s',_0x12624a,_0x5272('0xb'),JSON[_0x5272('0xc')](_0x54514a));if(_0x54514a[_0x5272('0xd')]){if(_0x54514a[_0x5272('0xd')][_0x5272('0xe')]===0x1f4){logger[_0x5272('0xd')](_0x5272('0xa'),_0x12624a,_0x54514a[_0x5272('0xd')][_0x5272('0xf')]);return _0x50b4ac(_0x54514a[_0x5272('0xd')][_0x5272('0xf')]);}logger[_0x5272('0xd')](_0x5272('0xa'),_0x12624a,_0x54514a[_0x5272('0xd')]['message']);return _0x918e74(_0x54514a[_0x5272('0xd')][_0x5272('0xf')]);}else{logger[_0x5272('0x9')](_0x5272('0xa'),_0x12624a,_0x5272('0xb'));_0x918e74(_0x54514a[_0x5272('0x10')][_0x5272('0xf')]);}})[_0x5272('0x11')](function(_0x1af2f8){logger['error']('FreshdeskField,\x20%s,\x20%s',_0x12624a,_0x1af2f8);_0x50b4ac(_0x1af2f8);});});} \ No newline at end of file +var _0x9037=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','FreshdeskField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','FreshdeskField,\x20%s,\x20%s','result','catch','util'];(function(_0x165d9e,_0x411eb4){var _0x344f36=function(_0x456fa4){while(--_0x456fa4){_0x165d9e['push'](_0x165d9e['shift']());}};_0x344f36(++_0x411eb4);}(_0x9037,0xbf));var _0x7903=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x9037[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0x7903('0x0'));var moment=require('moment');var BPromise=require(_0x7903('0x1'));var rs=require(_0x7903('0x2'));var fs=require('fs');var Redis=require(_0x7903('0x3'));var db=require(_0x7903('0x4'))['db'];var utils=require(_0x7903('0x5'));var logger=require(_0x7903('0x6'))(_0x7903('0x7'));var config=require(_0x7903('0x8'));var jayson=require(_0x7903('0x9'));var client=jayson[_0x7903('0xa')][_0x7903('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x12aca4,_0x5e9071,_0x334d94){return new BPromise(function(_0x36dcfa,_0x3ef2a0){return client[_0x7903('0xc')](_0x12aca4,_0x334d94)[_0x7903('0xd')](function(_0x8ef1c0){logger['info']('FreshdeskField,\x20%s,\x20%s',_0x5e9071,_0x7903('0xe'));logger[_0x7903('0xf')](_0x7903('0x10'),_0x5e9071,_0x7903('0xe'),JSON[_0x7903('0x11')](_0x8ef1c0));if(_0x8ef1c0[_0x7903('0x12')]){if(_0x8ef1c0[_0x7903('0x12')][_0x7903('0x13')]===0x1f4){logger[_0x7903('0x12')]('FreshdeskField,\x20%s,\x20%s',_0x5e9071,_0x8ef1c0[_0x7903('0x12')][_0x7903('0x14')]);return _0x3ef2a0(_0x8ef1c0['error'][_0x7903('0x14')]);}logger[_0x7903('0x12')](_0x7903('0x15'),_0x5e9071,_0x8ef1c0['error'][_0x7903('0x14')]);return _0x36dcfa(_0x8ef1c0['error'][_0x7903('0x14')]);}else{logger['info'](_0x7903('0x15'),_0x5e9071,_0x7903('0xe'));_0x36dcfa(_0x8ef1c0[_0x7903('0x16')][_0x7903('0x14')]);}})[_0x7903('0x17')](function(_0x59f56){logger[_0x7903('0x12')](_0x7903('0x15'),_0x5e9071,_0x59f56);_0x3ef2a0(_0x59f56);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index e94cdf2..c47bca4 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 _0x84a0=['isAuthenticated','index','get','/:id','/:id/configurations','getConfigurations','getFields','post','create','addConfiguration','put','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../config/environment','./intFreshsalesAccount.controller'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x84a0,0x66));var _0x084a=function(_0x43b764,_0x22af88){_0x43b764=_0x43b764-0x0;var _0x394e8a=_0x84a0[_0x43b764];return _0x394e8a;};'use strict';var multer=require(_0x084a('0x0'));var util=require(_0x084a('0x1'));var path=require(_0x084a('0x2'));var timeout=require(_0x084a('0x3'));var express=require('express');var router=express[_0x084a('0x4')]();var fs_extra=require(_0x084a('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x084a('0x6'));var controller=require(_0x084a('0x7'));router['get']('/',auth[_0x084a('0x8')](),controller[_0x084a('0x9')]);router[_0x084a('0xa')](_0x084a('0xb'),auth[_0x084a('0x8')](),controller['show']);router[_0x084a('0xa')](_0x084a('0xc'),auth[_0x084a('0x8')](),controller[_0x084a('0xd')]);router[_0x084a('0xa')]('/:id/fields',auth['isAuthenticated'](),controller[_0x084a('0xe')]);router[_0x084a('0xf')]('/',auth[_0x084a('0x8')](),controller[_0x084a('0x10')]);router[_0x084a('0xf')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x084a('0x11')]);router[_0x084a('0x12')](_0x084a('0xb'),auth[_0x084a('0x8')](),controller[_0x084a('0x13')]);router[_0x084a('0x14')](_0x084a('0xb'),auth[_0x084a('0x8')](),controller['destroy']);module[_0x084a('0x15')]=router; \ No newline at end of file +var _0x4483=['../../components/auth/service','../../components/interaction/service','./intFreshsalesAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','/:id/configurations','put','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra'];(function(_0x48732f,_0x3c0f88){var _0x57a296=function(_0x368ee0){while(--_0x368ee0){_0x48732f['push'](_0x48732f['shift']());}};_0x57a296(++_0x3c0f88);}(_0x4483,0x1a3));var _0x3448=function(_0x175b20,_0x29ccda){_0x175b20=_0x175b20-0x0;var _0x431b6a=_0x4483[_0x175b20];return _0x431b6a;};'use strict';var multer=require(_0x3448('0x0'));var util=require(_0x3448('0x1'));var path=require(_0x3448('0x2'));var timeout=require('connect-timeout');var express=require(_0x3448('0x3'));var router=express[_0x3448('0x4')]();var fs_extra=require(_0x3448('0x5'));var auth=require(_0x3448('0x6'));var interaction=require(_0x3448('0x7'));var config=require('../../config/environment');var controller=require(_0x3448('0x8'));router[_0x3448('0x9')]('/',auth[_0x3448('0xa')](),controller[_0x3448('0xb')]);router[_0x3448('0x9')](_0x3448('0xc'),auth[_0x3448('0xa')](),controller[_0x3448('0xd')]);router['get']('/:id/configurations',auth[_0x3448('0xa')](),controller[_0x3448('0xe')]);router[_0x3448('0x9')](_0x3448('0xf'),auth[_0x3448('0xa')](),controller[_0x3448('0x10')]);router[_0x3448('0x11')]('/',auth[_0x3448('0xa')](),controller[_0x3448('0x12')]);router[_0x3448('0x11')](_0x3448('0x13'),auth['isAuthenticated'](),controller['addConfiguration']);router[_0x3448('0x14')](_0x3448('0xc'),auth['isAuthenticated'](),controller[_0x3448('0x15')]);router[_0x3448('0x16')](_0x3448('0xc'),auth['isAuthenticated'](),controller[_0x3448('0x17')]);module[_0x3448('0x18')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index 49296be..3d5e33a 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 _0xfef3=['sequelize','STRING','username','remoteUri'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xfef3,0x118));var _0x3fef=function(_0x4b354f,_0x350965){_0x4b354f=_0x4b354f-0x0;var _0xe3f93c=_0xfef3[_0x4b354f];return _0xe3f93c;};'use strict';var Sequelize=require(_0x3fef('0x0'));module['exports']={'name':{'type':Sequelize[_0x3fef('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x3fef('0x1')],'unique':_0x3fef('0x2')},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x3fef('0x1')],'unique':_0x3fef('0x3')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x2a07=['sequelize','exports','STRING','remoteUri'];(function(_0x300464,_0x4bdf5c){var _0x100b81=function(_0x5ae8c7){while(--_0x5ae8c7){_0x300464['push'](_0x300464['shift']());}};_0x100b81(++_0x4bdf5c);}(_0x2a07,0x74));var _0x72a0=function(_0x1221e8,_0x2e7229){_0x1221e8=_0x1221e8-0x0;var _0x3f3041=_0x2a07[_0x1221e8];return _0x3f3041;};'use strict';var Sequelize=require(_0x72a0('0x0'));module[_0x72a0('0x1')]={'name':{'type':Sequelize[_0x72a0('0x2')]},'description':{'type':Sequelize[_0x72a0('0x2')]},'username':{'type':Sequelize[_0x72a0('0x2')],'unique':'username'},'apiKey':{'type':Sequelize[_0x72a0('0x2')]},'remoteUri':{'type':Sequelize[_0x72a0('0x2')],'unique':_0x72a0('0x3')},'serverUrl':{'type':Sequelize[_0x72a0('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js index c912b1d..1648691 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 _0x189f=['filter','merge','VIRTUAL','options','includeAll','include','rows','catch','params','create','body','find','FreshsalesConfiguration','addConfiguration','findOne','AccountId','Subjects','channel','Descriptions','FreshsalesField','getFields','username','apiKey','remoteUri','substring','lastIndexOf','GET','format','%s%s','Token\x20token=','users','Requested\x20Resource\x20not\x20Found','error','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','update','then','destroy','name','send','index','FreshsalesAccount','rawAttributes','fieldName','type','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x4af53a,_0x4f350f){var _0x232ccb=function(_0x35445d){while(--_0x35445d){_0x4af53a['push'](_0x4af53a['shift']());}};_0x232ccb(++_0x4f350f);}(_0x189f,0x1f4));var _0xf189=function(_0x2ee790,_0x5a8661){_0x2ee790=_0x2ee790-0x0;var _0x5a54a5=_0x189f[_0x2ee790];return _0x5a54a5;};'use strict';var emlformat=require(_0xf189('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf189('0x1'));var jsonpatch=require(_0xf189('0x2'));var rp=require(_0xf189('0x3'));var moment=require(_0xf189('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xf189('0x5'));var util=require(_0xf189('0x6'));var path=require('path');var sox=require(_0xf189('0x7'));var csv=require(_0xf189('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xf189('0x9'));var crypto=require('crypto');var jsforce=require(_0xf189('0xa'));var deskjs=require(_0xf189('0xb'));var toCsv=require(_0xf189('0x8'));var querystring=require(_0xf189('0xc'));var Papa=require(_0xf189('0xd'));var Redis=require(_0xf189('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xf189('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf189('0x10'));var logger=require('../../config/logger')(_0xf189('0x11'));var utils=require(_0xf189('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xf189('0x13'));var db=require(_0xf189('0x14'))['db'];var integrations=require(_0xf189('0x15'));function respondWithStatusCode(_0x1de3de,_0x35aa2a){_0x35aa2a=_0x35aa2a||0xcc;return function(_0x11aeae){if(_0x11aeae){return _0x1de3de[_0xf189('0x16')](_0x35aa2a);}return _0x1de3de[_0xf189('0x17')](_0x35aa2a)[_0xf189('0x18')]();};}function respondWithResult(_0x1a1b5b,_0x181628){_0x181628=_0x181628||0xc8;return function(_0x61d755){if(_0x61d755){return _0x1a1b5b[_0xf189('0x17')](_0x181628)[_0xf189('0x19')](_0x61d755);}};}function respondWithFilteredResult(_0x10ceca,_0x213289){return function(_0x31c515){if(_0x31c515){var _0x574cdc=typeof _0x213289[_0xf189('0x1a')]===_0xf189('0x1b')&&typeof _0x213289['limit']==='undefined';var _0x5c3322=_0x31c515[_0xf189('0x1c')];var _0x1c32bd=_0x574cdc?0x0:_0x213289[_0xf189('0x1a')];var _0x444e16=_0x574cdc?_0x31c515['count']:_0x213289[_0xf189('0x1a')]+_0x213289[_0xf189('0x1d')];var _0x43367;if(_0x444e16>=_0x5c3322){_0x444e16=_0x5c3322;_0x43367=0xc8;}else{_0x43367=0xce;}_0x10ceca[_0xf189('0x17')](_0x43367);return _0x10ceca[_0xf189('0x1e')](_0xf189('0x1f'),_0x1c32bd+'-'+_0x444e16+'/'+_0x5c3322)['json'](_0x31c515);}return null;};}function patchUpdates(_0x2718d3){return function(_0x23dd23){try{jsonpatch['apply'](_0x23dd23,_0x2718d3,!![]);}catch(_0x43668b){return BPromise[_0xf189('0x20')](_0x43668b);}return _0x23dd23['save']();};}function saveUpdates(_0x585908,_0x3fae94){return function(_0x1c24bc){if(_0x1c24bc){return _0x1c24bc[_0xf189('0x21')](_0x585908)[_0xf189('0x22')](function(_0x4df0b3){return _0x4df0b3;});}return null;};}function removeEntity(_0x566e8d,_0x42c0a5){return function(_0x27613f){if(_0x27613f){return _0x27613f[_0xf189('0x23')]()['then'](function(){_0x566e8d['status'](0xcc)[_0xf189('0x18')]();});}};}function handleEntityNotFound(_0x412eaf,_0x4e6424){return function(_0x5de176){if(!_0x5de176){_0x412eaf[_0xf189('0x16')](0x194);}return _0x5de176;};}function handleError(_0x3c010a,_0x254316){_0x254316=_0x254316||0x1f4;return function(_0x297813){logger['error'](_0x297813['stack']);if(_0x297813[_0xf189('0x24')]){delete _0x297813[_0xf189('0x24')];}_0x3c010a[_0xf189('0x17')](_0x254316)[_0xf189('0x25')](_0x297813);};}exports[_0xf189('0x26')]=function(_0x884abb,_0x26d8cc){var _0x52daf8={},_0x1bd4a0={},_0x3d5cad={'count':0x0,'rows':[]};var _0x3bba43=_['map'](db[_0xf189('0x27')][_0xf189('0x28')],function(_0x3377f0){return{'name':_0x3377f0[_0xf189('0x29')],'type':_0x3377f0[_0xf189('0x2a')]['key']};});_0x1bd4a0[_0xf189('0x2b')]=_[_0xf189('0x2c')](_0x3bba43,'name');_0x1bd4a0[_0xf189('0x2d')]=_[_0xf189('0x2e')](_0x884abb[_0xf189('0x2d')]);_0x1bd4a0[_0xf189('0x2f')]=_['intersection'](_0x1bd4a0['model'],_0x1bd4a0[_0xf189('0x2d')]);_0x52daf8[_0xf189('0x30')]=_[_0xf189('0x31')](_0x1bd4a0[_0xf189('0x2b')],qs[_0xf189('0x32')](_0x884abb['query'][_0xf189('0x32')]));_0x52daf8[_0xf189('0x30')]=_0x52daf8[_0xf189('0x30')][_0xf189('0x33')]?_0x52daf8[_0xf189('0x30')]:_0x1bd4a0[_0xf189('0x2b')];if(!_0x884abb[_0xf189('0x2d')][_0xf189('0x34')](_0xf189('0x35'))){_0x52daf8['limit']=qs['limit'](_0x884abb['query'][_0xf189('0x1d')]);_0x52daf8['offset']=qs[_0xf189('0x1a')](_0x884abb['query'][_0xf189('0x1a')]);}_0x52daf8[_0xf189('0x36')]=qs['sort'](_0x884abb['query'][_0xf189('0x37')]);_0x52daf8[_0xf189('0x38')]=qs[_0xf189('0x2f')](_[_0xf189('0x39')](_0x884abb[_0xf189('0x2d')],_0x1bd4a0[_0xf189('0x2f')]),_0x3bba43);if(_0x884abb[_0xf189('0x2d')][_0xf189('0x3a')]){_0x52daf8[_0xf189('0x38')]=_[_0xf189('0x3b')](_0x52daf8[_0xf189('0x38')],{'$or':_[_0xf189('0x2c')](_0x3bba43,function(_0x3e719e){if(_0x3e719e[_0xf189('0x2a')]!==_0xf189('0x3c')){var _0x8fa8d7={};_0x8fa8d7[_0x3e719e[_0xf189('0x24')]]={'$like':'%'+_0x884abb[_0xf189('0x2d')][_0xf189('0x3a')]+'%'};return _0x8fa8d7;}})});}_0x52daf8=_[_0xf189('0x3b')]({},_0x52daf8,_0x884abb[_0xf189('0x3d')]);var _0x5412a7={'where':_0x52daf8['where']};return db[_0xf189('0x27')]['count'](_0x5412a7)['then'](function(_0x51ce49){_0x3d5cad[_0xf189('0x1c')]=_0x51ce49;if(_0x884abb[_0xf189('0x2d')][_0xf189('0x3e')]){_0x52daf8[_0xf189('0x3f')]=[{'all':!![]}];}return db[_0xf189('0x27')]['findAll'](_0x52daf8);})[_0xf189('0x22')](function(_0x2c7d1e){_0x3d5cad[_0xf189('0x40')]=_0x2c7d1e;return _0x3d5cad;})[_0xf189('0x22')](respondWithFilteredResult(_0x26d8cc,_0x52daf8))[_0xf189('0x41')](handleError(_0x26d8cc,null));};exports['show']=function(_0x503470,_0x26d898){var _0x466bd8={'raw':![],'where':{'id':_0x503470[_0xf189('0x42')]['id']}},_0x585a1a={};_0x585a1a[_0xf189('0x2b')]=_[_0xf189('0x2e')](db[_0xf189('0x27')][_0xf189('0x28')]);_0x585a1a[_0xf189('0x2d')]=_['keys'](_0x503470[_0xf189('0x2d')]);_0x585a1a[_0xf189('0x2f')]=_[_0xf189('0x31')](_0x585a1a[_0xf189('0x2b')],_0x585a1a['query']);_0x466bd8['attributes']=_['intersection'](_0x585a1a[_0xf189('0x2b')],qs[_0xf189('0x32')](_0x503470['query'][_0xf189('0x32')]));_0x466bd8['attributes']=_0x466bd8[_0xf189('0x30')][_0xf189('0x33')]?_0x466bd8[_0xf189('0x30')]:_0x585a1a[_0xf189('0x2b')];if(_0x503470[_0xf189('0x2d')][_0xf189('0x3e')]){_0x466bd8['include']=[{'all':!![]}];}_0x466bd8=_[_0xf189('0x3b')]({},_0x466bd8,_0x503470[_0xf189('0x3d')]);return db[_0xf189('0x27')]['find'](_0x466bd8)[_0xf189('0x22')](handleEntityNotFound(_0x26d898,null))[_0xf189('0x22')](respondWithResult(_0x26d898,null))[_0xf189('0x41')](handleError(_0x26d898,null));};exports[_0xf189('0x43')]=function(_0x2e132d,_0x27f860){return db[_0xf189('0x27')][_0xf189('0x43')](_0x2e132d['body'],{})[_0xf189('0x22')](respondWithResult(_0x27f860,0xc9))['catch'](handleError(_0x27f860,null));};exports['update']=function(_0x5b74a9,_0x46e5a0){if(_0x5b74a9[_0xf189('0x44')]['id']){delete _0x5b74a9[_0xf189('0x44')]['id'];}return db[_0xf189('0x27')][_0xf189('0x45')]({'where':{'id':_0x5b74a9['params']['id']}})[_0xf189('0x22')](handleEntityNotFound(_0x46e5a0,null))['then'](saveUpdates(_0x5b74a9[_0xf189('0x44')],null))['then'](respondWithResult(_0x46e5a0,null))[_0xf189('0x41')](handleError(_0x46e5a0,null));};exports['destroy']=function(_0x10fda3,_0x1277f4){return db[_0xf189('0x27')][_0xf189('0x45')]({'where':{'id':_0x10fda3[_0xf189('0x42')]['id']}})[_0xf189('0x22')](handleEntityNotFound(_0x1277f4,null))[_0xf189('0x22')](removeEntity(_0x1277f4,null))[_0xf189('0x41')](handleError(_0x1277f4,null));};exports['getConfigurations']=function(_0x5b4325,_0x81830b,_0x426a44){var _0x4270bb={};var _0x1d0763={};var _0x34c4bd;var _0x36638d;return db[_0xf189('0x27')]['findOne']({'where':{'id':_0x5b4325['params']['id']}})[_0xf189('0x22')](handleEntityNotFound(_0x81830b,null))[_0xf189('0x22')](function(_0x326251){if(_0x326251){_0x34c4bd=_0x326251;_0x1d0763[_0xf189('0x2b')]=_[_0xf189('0x2e')](db[_0xf189('0x46')][_0xf189('0x28')]);_0x1d0763[_0xf189('0x2d')]=_[_0xf189('0x2e')](_0x5b4325[_0xf189('0x2d')]);_0x1d0763[_0xf189('0x2f')]=_[_0xf189('0x31')](_0x1d0763[_0xf189('0x2b')],_0x1d0763[_0xf189('0x2d')]);_0x4270bb['attributes']=_['intersection'](_0x1d0763[_0xf189('0x2b')],qs[_0xf189('0x32')](_0x5b4325[_0xf189('0x2d')][_0xf189('0x32')]));_0x4270bb[_0xf189('0x30')]=_0x4270bb[_0xf189('0x30')][_0xf189('0x33')]?_0x4270bb['attributes']:_0x1d0763[_0xf189('0x2b')];_0x4270bb[_0xf189('0x36')]=qs[_0xf189('0x37')](_0x5b4325[_0xf189('0x2d')][_0xf189('0x37')]);_0x4270bb[_0xf189('0x38')]=qs[_0xf189('0x2f')](_['pick'](_0x5b4325[_0xf189('0x2d')],_0x1d0763[_0xf189('0x2f')]));if(_0x5b4325[_0xf189('0x2d')][_0xf189('0x3a')]){_0x4270bb[_0xf189('0x38')]=_[_0xf189('0x3b')](_0x4270bb[_0xf189('0x38')],{'$or':_[_0xf189('0x2c')](_0x4270bb[_0xf189('0x30')],function(_0x3ff3cb){var _0x27eee6={};_0x27eee6[_0x3ff3cb]={'$like':'%'+_0x5b4325[_0xf189('0x2d')][_0xf189('0x3a')]+'%'};return _0x27eee6;})});}_0x4270bb=_[_0xf189('0x3b')]({},_0x4270bb,_0x5b4325[_0xf189('0x3d')]);return _0x34c4bd['getConfigurations'](_0x4270bb);}})['then'](function(_0x236312){if(_0x236312){_0x36638d=_0x236312[_0xf189('0x33')];if(!_0x5b4325[_0xf189('0x2d')][_0xf189('0x34')](_0xf189('0x35'))){_0x4270bb['limit']=qs['limit'](_0x5b4325['query'][_0xf189('0x1d')]);_0x4270bb[_0xf189('0x1a')]=qs[_0xf189('0x1a')](_0x5b4325['query'][_0xf189('0x1a')]);}return _0x34c4bd['getConfigurations'](_0x4270bb);}})['then'](function(_0x553eb2){if(_0x553eb2){return _0x553eb2?{'count':_0x36638d,'rows':_0x553eb2}:null;}})[_0xf189('0x22')](respondWithResult(_0x81830b,null))['catch'](handleError(_0x81830b,null));};exports[_0xf189('0x47')]=function(_0x2aea59,_0x51b64d,_0x1a8bb6){if(_0x2aea59[_0xf189('0x44')]['id']){delete _0x2aea59[_0xf189('0x44')]['id'];}return db[_0xf189('0x27')][_0xf189('0x48')]({'where':{'id':_0x2aea59[_0xf189('0x42')]['id']}})[_0xf189('0x22')](handleEntityNotFound(_0x51b64d,null))[_0xf189('0x22')](function(_0xa9a83d){if(_0xa9a83d){_0x2aea59[_0xf189('0x44')][_0xf189('0x49')]=_0xa9a83d['id'];_0x2aea59[_0xf189('0x44')][_0xf189('0x4a')]=integrations['getSubjects'](_0x2aea59['body'][_0xf189('0x4b')],_0x2aea59['body'][_0xf189('0x2a')]);_0x2aea59[_0xf189('0x44')][_0xf189('0x4c')]=integrations['getDescriptions'](_0x2aea59[_0xf189('0x44')]['channel'],_0x2aea59['body'][_0xf189('0x2a')]);return db[_0xf189('0x46')]['create'](_0x2aea59['body'],{'include':[{'model':db[_0xf189('0x4d')],'as':_0xf189('0x4a')},{'model':db['FreshsalesField'],'as':'Descriptions'}]});}return null;})[_0xf189('0x22')](respondWithResult(_0x51b64d,null))[_0xf189('0x41')](handleError(_0x51b64d,null));};exports[_0xf189('0x4e')]=function(_0x4d8fc9,_0x2a5b72,_0x34be3b){var _0xb7d31c='';var _0x20f5dc='';return db[_0xf189('0x27')]['findOne']({'where':{'id':_0x4d8fc9['params']['id']},'attributes':['id',_0xf189('0x4f'),'remoteUri',_0xf189('0x50')]})[_0xf189('0x22')](handleEntityNotFound(_0x2a5b72,null))['then'](function(_0x4d2cd7){if(_0x4d2cd7){_0x20f5dc=_0x4d2cd7[_0xf189('0x4f')];_0xb7d31c=_0x4d2cd7[_0xf189('0x51')];var _0x335b01=_0x4d2cd7[_0xf189('0x51')]['slice'](-0x1);if(_0x335b01==='/'){_0xb7d31c=_0xb7d31c[_0xf189('0x52')](0x0,_0xb7d31c[_0xf189('0x53')](_0x335b01));}return rp({'method':_0xf189('0x54'),'uri':util[_0xf189('0x55')](_0xf189('0x56'),_0xb7d31c,'/api/selector/owners'),'headers':{'Authorization':_0xf189('0x57')+_0x4d2cd7['apiKey']},'json':!![]});}})[_0xf189('0x22')](function(_0x2d2283){if(_0x2d2283){var _0x3394c2=_0x2d2283[_0xf189('0x58')];var _0x31f720=![];var _0x565f62=null;for(_0x565f62=0x0;_0x565f62<_0x3394c2['length'];_0x565f62++){if(_0x3394c2[_0x565f62]['email']===_0x20f5dc){_0x31f720=!![];}}if(_0x31f720){return!![];}else{throw new Error({'statusCode':0x194,'message':_0xf189('0x59')});}}})['then'](respondWithResult(_0x2a5b72,null))[_0xf189('0x41')](function(_0x23f521){var _0x1b4fc9=_0x4d8fc9[_0xf189('0x2d')]['test']?0x1f4:_0x23f521['statusCode']||0x1f4;logger[_0xf189('0x5a')](_0xf189('0x5b'),'getFields',_0x1b4fc9,JSON['stringify'](_0x23f521));delete _0x23f521[_0xf189('0x24')];if(_0x1b4fc9===0x191){_0x1b4fc9=0x190;}_0x2a5b72[_0xf189('0x17')](_0x1b4fc9)[_0xf189('0x25')](_0x4d8fc9[_0xf189('0x2d')]['test']?{'message':_0xf189('0x5c'),'statusCode':_0x23f521['statusCode']}:_0x23f521);});}; \ No newline at end of file +var _0x27fd=['AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshsalesField','getFields','username','apiKey','remoteUri','slice','substring','format','/api/selector/owners','email','Requested\x20Resource\x20not\x20Found','statusCode','error','stringify','send','Wrong\x20credentials','eml-format','fast-json-patch','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','then','stack','name','index','map','FreshsalesAccount','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','include','findAll','catch','keys','find','create','body','update','params','destroy','getConfigurations','FreshsalesConfiguration','pick','addConfiguration','findOne'];(function(_0x3460e3,_0x23d874){var _0x22a450=function(_0x2c1038){while(--_0x2c1038){_0x3460e3['push'](_0x3460e3['shift']());}};_0x22a450(++_0x23d874);}(_0x27fd,0xdc));var _0xd27f=function(_0x2fa21e,_0x49f072){_0x2fa21e=_0x2fa21e-0x0;var _0x19173a=_0x27fd[_0x2fa21e];return _0x19173a;};'use strict';var emlformat=require(_0xd27f('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xd27f('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xd27f('0x2'));var Mustache=require(_0xd27f('0x3'));var util=require(_0xd27f('0x4'));var path=require(_0xd27f('0x5'));var sox=require('sox');var csv=require(_0xd27f('0x6'));var ejs=require(_0xd27f('0x7'));var fs=require('fs');var fs_extra=require(_0xd27f('0x8'));var _=require(_0xd27f('0x9'));var squel=require(_0xd27f('0xa'));var crypto=require(_0xd27f('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xd27f('0xc'));var toCsv=require('to-csv');var querystring=require(_0xd27f('0xd'));var Papa=require(_0xd27f('0xe'));var Redis=require(_0xd27f('0xf'));var authService=require(_0xd27f('0x10'));var qs=require(_0xd27f('0x11'));var as=require(_0xd27f('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xd27f('0x13'));var utils=require(_0xd27f('0x14'));var config=require(_0xd27f('0x15'));var licenseUtil=require(_0xd27f('0x16'));var db=require(_0xd27f('0x17'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x98e489,_0x14e9d0){_0x14e9d0=_0x14e9d0||0xcc;return function(_0x4990db){if(_0x4990db){return _0x98e489[_0xd27f('0x18')](_0x14e9d0);}return _0x98e489[_0xd27f('0x19')](_0x14e9d0)[_0xd27f('0x1a')]();};}function respondWithResult(_0x2962eb,_0x494a6a){_0x494a6a=_0x494a6a||0xc8;return function(_0x43437b){if(_0x43437b){return _0x2962eb['status'](_0x494a6a)[_0xd27f('0x1b')](_0x43437b);}};}function respondWithFilteredResult(_0x2aab35,_0x202728){return function(_0x4db3f9){if(_0x4db3f9){var _0x24cde4=typeof _0x202728[_0xd27f('0x1c')]===_0xd27f('0x1d')&&typeof _0x202728[_0xd27f('0x1e')]===_0xd27f('0x1d');var _0x3f4f52=_0x4db3f9[_0xd27f('0x1f')];var _0x21b90a=_0x24cde4?0x0:_0x202728[_0xd27f('0x1c')];var _0x1ad487=_0x24cde4?_0x4db3f9[_0xd27f('0x1f')]:_0x202728[_0xd27f('0x1c')]+_0x202728[_0xd27f('0x1e')];var _0x1ef713;if(_0x1ad487>=_0x3f4f52){_0x1ad487=_0x3f4f52;_0x1ef713=0xc8;}else{_0x1ef713=0xce;}_0x2aab35['status'](_0x1ef713);return _0x2aab35[_0xd27f('0x20')](_0xd27f('0x21'),_0x21b90a+'-'+_0x1ad487+'/'+_0x3f4f52)['json'](_0x4db3f9);}return null;};}function patchUpdates(_0x85f49e){return function(_0xee56f1){try{jsonpatch[_0xd27f('0x22')](_0xee56f1,_0x85f49e,!![]);}catch(_0x56fd57){return BPromise[_0xd27f('0x23')](_0x56fd57);}return _0xee56f1[_0xd27f('0x24')]();};}function saveUpdates(_0x402461,_0x363660){return function(_0x27ceb1){if(_0x27ceb1){return _0x27ceb1['update'](_0x402461)[_0xd27f('0x25')](function(_0x5f3cc2){return _0x5f3cc2;});}return null;};}function removeEntity(_0x2fb449,_0x2e7dec){return function(_0x38c275){if(_0x38c275){return _0x38c275['destroy']()[_0xd27f('0x25')](function(){_0x2fb449[_0xd27f('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5f5d7e,_0x459f97){return function(_0x317070){if(!_0x317070){_0x5f5d7e[_0xd27f('0x18')](0x194);}return _0x317070;};}function handleError(_0x257eca,_0xefce){_0xefce=_0xefce||0x1f4;return function(_0xe8f312){logger['error'](_0xe8f312[_0xd27f('0x26')]);if(_0xe8f312[_0xd27f('0x27')]){delete _0xe8f312[_0xd27f('0x27')];}_0x257eca[_0xd27f('0x19')](_0xefce)['send'](_0xe8f312);};}exports[_0xd27f('0x28')]=function(_0x4c5810,_0x1f49cc){var _0x2570bf={},_0x35ab64={},_0x344045={'count':0x0,'rows':[]};var _0x873476=_[_0xd27f('0x29')](db[_0xd27f('0x2a')][_0xd27f('0x2b')],function(_0x4a12d5){return{'name':_0x4a12d5[_0xd27f('0x2c')],'type':_0x4a12d5[_0xd27f('0x2d')]['key']};});_0x35ab64[_0xd27f('0x2e')]=_[_0xd27f('0x29')](_0x873476,_0xd27f('0x27'));_0x35ab64['query']=_['keys'](_0x4c5810[_0xd27f('0x2f')]);_0x35ab64[_0xd27f('0x30')]=_[_0xd27f('0x31')](_0x35ab64[_0xd27f('0x2e')],_0x35ab64[_0xd27f('0x2f')]);_0x2570bf[_0xd27f('0x32')]=_[_0xd27f('0x31')](_0x35ab64['model'],qs[_0xd27f('0x33')](_0x4c5810[_0xd27f('0x2f')][_0xd27f('0x33')]));_0x2570bf[_0xd27f('0x32')]=_0x2570bf[_0xd27f('0x32')][_0xd27f('0x34')]?_0x2570bf['attributes']:_0x35ab64[_0xd27f('0x2e')];if(!_0x4c5810[_0xd27f('0x2f')][_0xd27f('0x35')](_0xd27f('0x36'))){_0x2570bf['limit']=qs[_0xd27f('0x1e')](_0x4c5810[_0xd27f('0x2f')][_0xd27f('0x1e')]);_0x2570bf['offset']=qs['offset'](_0x4c5810['query'][_0xd27f('0x1c')]);}_0x2570bf[_0xd27f('0x37')]=qs[_0xd27f('0x38')](_0x4c5810[_0xd27f('0x2f')][_0xd27f('0x38')]);_0x2570bf[_0xd27f('0x39')]=qs[_0xd27f('0x30')](_['pick'](_0x4c5810['query'],_0x35ab64['filters']),_0x873476);if(_0x4c5810['query'][_0xd27f('0x3a')]){_0x2570bf[_0xd27f('0x39')]=_[_0xd27f('0x3b')](_0x2570bf['where'],{'$or':_[_0xd27f('0x29')](_0x873476,function(_0x8649cf){if(_0x8649cf['type']!==_0xd27f('0x3c')){var _0x21ddc0={};_0x21ddc0[_0x8649cf[_0xd27f('0x27')]]={'$like':'%'+_0x4c5810[_0xd27f('0x2f')][_0xd27f('0x3a')]+'%'};return _0x21ddc0;}})});}_0x2570bf=_[_0xd27f('0x3b')]({},_0x2570bf,_0x4c5810[_0xd27f('0x3d')]);var _0x5794ed={'where':_0x2570bf[_0xd27f('0x39')]};return db[_0xd27f('0x2a')]['count'](_0x5794ed)[_0xd27f('0x25')](function(_0x22fdcb){_0x344045[_0xd27f('0x1f')]=_0x22fdcb;if(_0x4c5810[_0xd27f('0x2f')]['includeAll']){_0x2570bf[_0xd27f('0x3e')]=[{'all':!![]}];}return db[_0xd27f('0x2a')][_0xd27f('0x3f')](_0x2570bf);})[_0xd27f('0x25')](function(_0x19f6d3){_0x344045['rows']=_0x19f6d3;return _0x344045;})['then'](respondWithFilteredResult(_0x1f49cc,_0x2570bf))[_0xd27f('0x40')](handleError(_0x1f49cc,null));};exports['show']=function(_0x495190,_0x3c0630){var _0x5555f3={'raw':![],'where':{'id':_0x495190['params']['id']}},_0x465e9f={};_0x465e9f[_0xd27f('0x2e')]=_[_0xd27f('0x41')](db[_0xd27f('0x2a')][_0xd27f('0x2b')]);_0x465e9f['query']=_[_0xd27f('0x41')](_0x495190[_0xd27f('0x2f')]);_0x465e9f[_0xd27f('0x30')]=_[_0xd27f('0x31')](_0x465e9f[_0xd27f('0x2e')],_0x465e9f[_0xd27f('0x2f')]);_0x5555f3[_0xd27f('0x32')]=_[_0xd27f('0x31')](_0x465e9f[_0xd27f('0x2e')],qs['fields'](_0x495190['query'][_0xd27f('0x33')]));_0x5555f3['attributes']=_0x5555f3[_0xd27f('0x32')][_0xd27f('0x34')]?_0x5555f3[_0xd27f('0x32')]:_0x465e9f['model'];if(_0x495190['query']['includeAll']){_0x5555f3[_0xd27f('0x3e')]=[{'all':!![]}];}_0x5555f3=_[_0xd27f('0x3b')]({},_0x5555f3,_0x495190[_0xd27f('0x3d')]);return db['FreshsalesAccount'][_0xd27f('0x42')](_0x5555f3)['then'](handleEntityNotFound(_0x3c0630,null))['then'](respondWithResult(_0x3c0630,null))[_0xd27f('0x40')](handleError(_0x3c0630,null));};exports['create']=function(_0x33e69f,_0x17ca94){return db[_0xd27f('0x2a')][_0xd27f('0x43')](_0x33e69f[_0xd27f('0x44')],{})['then'](respondWithResult(_0x17ca94,0xc9))[_0xd27f('0x40')](handleError(_0x17ca94,null));};exports[_0xd27f('0x45')]=function(_0x3d6598,_0x584cf8){if(_0x3d6598[_0xd27f('0x44')]['id']){delete _0x3d6598[_0xd27f('0x44')]['id'];}return db[_0xd27f('0x2a')][_0xd27f('0x42')]({'where':{'id':_0x3d6598[_0xd27f('0x46')]['id']}})[_0xd27f('0x25')](handleEntityNotFound(_0x584cf8,null))['then'](saveUpdates(_0x3d6598[_0xd27f('0x44')],null))[_0xd27f('0x25')](respondWithResult(_0x584cf8,null))[_0xd27f('0x40')](handleError(_0x584cf8,null));};exports[_0xd27f('0x47')]=function(_0x42e08f,_0x43c736){return db[_0xd27f('0x2a')][_0xd27f('0x42')]({'where':{'id':_0x42e08f[_0xd27f('0x46')]['id']}})[_0xd27f('0x25')](handleEntityNotFound(_0x43c736,null))[_0xd27f('0x25')](removeEntity(_0x43c736,null))[_0xd27f('0x40')](handleError(_0x43c736,null));};exports[_0xd27f('0x48')]=function(_0x76002d,_0xc0077,_0x5609bd){var _0x116942={};var _0x4d0b6e={};var _0x169327;var _0x671a7b;return db['FreshsalesAccount']['findOne']({'where':{'id':_0x76002d[_0xd27f('0x46')]['id']}})[_0xd27f('0x25')](handleEntityNotFound(_0xc0077,null))[_0xd27f('0x25')](function(_0x54a119){if(_0x54a119){_0x169327=_0x54a119;_0x4d0b6e[_0xd27f('0x2e')]=_['keys'](db[_0xd27f('0x49')]['rawAttributes']);_0x4d0b6e[_0xd27f('0x2f')]=_[_0xd27f('0x41')](_0x76002d[_0xd27f('0x2f')]);_0x4d0b6e[_0xd27f('0x30')]=_['intersection'](_0x4d0b6e[_0xd27f('0x2e')],_0x4d0b6e[_0xd27f('0x2f')]);_0x116942['attributes']=_[_0xd27f('0x31')](_0x4d0b6e[_0xd27f('0x2e')],qs[_0xd27f('0x33')](_0x76002d['query']['fields']));_0x116942['attributes']=_0x116942[_0xd27f('0x32')][_0xd27f('0x34')]?_0x116942[_0xd27f('0x32')]:_0x4d0b6e['model'];_0x116942[_0xd27f('0x37')]=qs['sort'](_0x76002d[_0xd27f('0x2f')][_0xd27f('0x38')]);_0x116942[_0xd27f('0x39')]=qs[_0xd27f('0x30')](_[_0xd27f('0x4a')](_0x76002d[_0xd27f('0x2f')],_0x4d0b6e[_0xd27f('0x30')]));if(_0x76002d['query']['filter']){_0x116942[_0xd27f('0x39')]=_['merge'](_0x116942[_0xd27f('0x39')],{'$or':_['map'](_0x116942['attributes'],function(_0x26976c){var _0x3e1baf={};_0x3e1baf[_0x26976c]={'$like':'%'+_0x76002d[_0xd27f('0x2f')]['filter']+'%'};return _0x3e1baf;})});}_0x116942=_[_0xd27f('0x3b')]({},_0x116942,_0x76002d[_0xd27f('0x3d')]);return _0x169327[_0xd27f('0x48')](_0x116942);}})['then'](function(_0x510397){if(_0x510397){_0x671a7b=_0x510397[_0xd27f('0x34')];if(!_0x76002d[_0xd27f('0x2f')][_0xd27f('0x35')](_0xd27f('0x36'))){_0x116942[_0xd27f('0x1e')]=qs[_0xd27f('0x1e')](_0x76002d['query'][_0xd27f('0x1e')]);_0x116942[_0xd27f('0x1c')]=qs[_0xd27f('0x1c')](_0x76002d[_0xd27f('0x2f')][_0xd27f('0x1c')]);}return _0x169327['getConfigurations'](_0x116942);}})['then'](function(_0x33deb8){if(_0x33deb8){return _0x33deb8?{'count':_0x671a7b,'rows':_0x33deb8}:null;}})[_0xd27f('0x25')](respondWithResult(_0xc0077,null))[_0xd27f('0x40')](handleError(_0xc0077,null));};exports[_0xd27f('0x4b')]=function(_0x939d87,_0xc48db0,_0x1299d4){if(_0x939d87[_0xd27f('0x44')]['id']){delete _0x939d87[_0xd27f('0x44')]['id'];}return db[_0xd27f('0x2a')][_0xd27f('0x4c')]({'where':{'id':_0x939d87[_0xd27f('0x46')]['id']}})[_0xd27f('0x25')](handleEntityNotFound(_0xc48db0,null))[_0xd27f('0x25')](function(_0x12b024){if(_0x12b024){_0x939d87['body'][_0xd27f('0x4d')]=_0x12b024['id'];_0x939d87[_0xd27f('0x44')][_0xd27f('0x4e')]=integrations[_0xd27f('0x4f')](_0x939d87['body'][_0xd27f('0x50')],_0x939d87[_0xd27f('0x44')][_0xd27f('0x2d')]);_0x939d87[_0xd27f('0x44')][_0xd27f('0x51')]=integrations[_0xd27f('0x52')](_0x939d87[_0xd27f('0x44')]['channel'],_0x939d87[_0xd27f('0x44')][_0xd27f('0x2d')]);return db[_0xd27f('0x49')][_0xd27f('0x43')](_0x939d87['body'],{'include':[{'model':db[_0xd27f('0x53')],'as':_0xd27f('0x4e')},{'model':db['FreshsalesField'],'as':_0xd27f('0x51')}]});}return null;})[_0xd27f('0x25')](respondWithResult(_0xc48db0,null))['catch'](handleError(_0xc48db0,null));};exports[_0xd27f('0x54')]=function(_0xf61210,_0x5dcfc0,_0x2089e7){var _0x223bb6='';var _0x21a720='';return db[_0xd27f('0x2a')]['findOne']({'where':{'id':_0xf61210['params']['id']},'attributes':['id',_0xd27f('0x55'),'remoteUri',_0xd27f('0x56')]})['then'](handleEntityNotFound(_0x5dcfc0,null))['then'](function(_0x5bb082){if(_0x5bb082){_0x21a720=_0x5bb082[_0xd27f('0x55')];_0x223bb6=_0x5bb082['remoteUri'];var _0x1ca728=_0x5bb082[_0xd27f('0x57')][_0xd27f('0x58')](-0x1);if(_0x1ca728==='/'){_0x223bb6=_0x223bb6[_0xd27f('0x59')](0x0,_0x223bb6['lastIndexOf'](_0x1ca728));}return rp({'method':'GET','uri':util[_0xd27f('0x5a')]('%s%s',_0x223bb6,_0xd27f('0x5b')),'headers':{'Authorization':'Token\x20token='+_0x5bb082[_0xd27f('0x56')]},'json':!![]});}})[_0xd27f('0x25')](function(_0x1f574e){if(_0x1f574e){var _0x1f9f92=_0x1f574e['users'];var _0x40100c=![];var _0x542b59=null;for(_0x542b59=0x0;_0x542b59<_0x1f9f92['length'];_0x542b59++){if(_0x1f9f92[_0x542b59][_0xd27f('0x5c')]===_0x21a720){_0x40100c=!![];}}if(_0x40100c){return!![];}else{throw new Error({'statusCode':0x194,'message':_0xd27f('0x5d')});}}})[_0xd27f('0x25')](respondWithResult(_0x5dcfc0,null))['catch'](function(_0x56a459){var _0x119772=_0xf61210['query']['test']?0x1f4:_0x56a459[_0xd27f('0x5e')]||0x1f4;logger[_0xd27f('0x5f')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x119772,JSON[_0xd27f('0x60')](_0x56a459));delete _0x56a459[_0xd27f('0x27')];if(_0x119772===0x191){_0x119772=0x190;}_0x5dcfc0[_0xd27f('0x19')](_0x119772)[_0xd27f('0x61')](_0xf61210[_0xd27f('0x2f')]['test']?{'message':_0xd27f('0x62'),'statusCode':_0x56a459[_0xd27f('0x5e')]}:_0x56a459);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index 75f98bf..717fc0b 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 _0x9a5a=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intFreshsalesAccount.attributes','../../components/integrations/configuration','define','FreshsalesAccount','int_freshsales_accounts','lodash','util'];(function(_0x2b6593,_0x2c5e04){var _0x59ccf4=function(_0x371d5e){while(--_0x371d5e){_0x2b6593['push'](_0x2b6593['shift']());}};_0x59ccf4(++_0x2c5e04);}(_0x9a5a,0x194));var _0xa9a5=function(_0x5c4fb3,_0xc08426){_0x5c4fb3=_0x5c4fb3-0x0;var _0x5b57e6=_0x9a5a[_0x5c4fb3];return _0x5b57e6;};'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'));var integrations=require(_0xa9a5('0xa'));module['exports']=function(_0xb0ccd9,_0x37e93b){return _0xb0ccd9[_0xa9a5('0xb')](_0xa9a5('0xc'),attributes,{'tableName':_0xa9a5('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2272=['request-promise','path','rimraf','../../components/integrations/configuration','exports','define','FreshsalesAccount','int_freshsales_accounts','lodash','util','../../config/logger','api','moment'];(function(_0x15574c,_0x44373d){var _0x323d16=function(_0x246ba5){while(--_0x246ba5){_0x15574c['push'](_0x15574c['shift']());}};_0x323d16(++_0x44373d);}(_0x2272,0xd8));var _0x2227=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x2272[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x2227('0x0'));var util=require(_0x2227('0x1'));var logger=require(_0x2227('0x2'))(_0x2227('0x3'));var moment=require(_0x2227('0x4'));var BPromise=require('bluebird');var rp=require(_0x2227('0x5'));var fs=require('fs');var path=require(_0x2227('0x6'));var rimraf=require(_0x2227('0x7'));var config=require('../../config/environment');var attributes=require('./intFreshsalesAccount.attributes');var integrations=require(_0x2227('0x8'));module[_0x2227('0x9')]=function(_0xb33647,_0x2591db){return _0xb33647[_0x2227('0xa')](_0x2227('0xb'),attributes,{'tableName':_0x2227('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js index 068b638..c260041 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 _0x57ca=['then','debug','ShowFreshsalesAccount','find','stringify','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','FreshsalesAccount,\x20%s,\x20%s,\x20%s','error','code','FreshsalesAccount,\x20%s,\x20%s','message','result','catch','GetFreshsalesAccount','FreshsalesAccount','findAll','options','raw','where','attributes','limit','include','map','model'];(function(_0x1d5906,_0xdd3a39){var _0xe94622=function(_0x2a4681){while(--_0x2a4681){_0x1d5906['push'](_0x1d5906['shift']());}};_0xe94622(++_0xdd3a39);}(_0x57ca,0x108));var _0xa57c=function(_0x4d7167,_0x210618){_0x4d7167=_0x4d7167-0x0;var _0x15a303=_0x57ca[_0x4d7167];return _0x15a303;};'use strict';var _=require('lodash');var util=require(_0xa57c('0x0'));var moment=require(_0xa57c('0x1'));var BPromise=require('bluebird');var rs=require(_0xa57c('0x2'));var fs=require('fs');var Redis=require(_0xa57c('0x3'));var db=require(_0xa57c('0x4'))['db'];var utils=require(_0xa57c('0x5'));var logger=require(_0xa57c('0x6'))('rpc');var config=require(_0xa57c('0x7'));var jayson=require(_0xa57c('0x8'));var client=jayson[_0xa57c('0x9')][_0xa57c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xbdfffb,_0x314574,_0x19e28e){return new BPromise(function(_0x271ccc,_0x5e3962){return client[_0xa57c('0xb')](_0xbdfffb,_0x19e28e)['then'](function(_0x46ba92){logger[_0xa57c('0xc')]('FreshsalesAccount,\x20%s,\x20%s',_0x314574,_0xa57c('0xd'));logger['debug'](_0xa57c('0xe'),_0x314574,_0xa57c('0xd'),JSON['stringify'](_0x46ba92));if(_0x46ba92[_0xa57c('0xf')]){if(_0x46ba92['error'][_0xa57c('0x10')]===0x1f4){logger[_0xa57c('0xf')](_0xa57c('0x11'),_0x314574,_0x46ba92[_0xa57c('0xf')][_0xa57c('0x12')]);return _0x5e3962(_0x46ba92['error'][_0xa57c('0x12')]);}logger['error'](_0xa57c('0x11'),_0x314574,_0x46ba92[_0xa57c('0xf')][_0xa57c('0x12')]);return _0x271ccc(_0x46ba92[_0xa57c('0xf')][_0xa57c('0x12')]);}else{logger[_0xa57c('0xc')](_0xa57c('0x11'),_0x314574,'request\x20sent');_0x271ccc(_0x46ba92[_0xa57c('0x13')][_0xa57c('0x12')]);}})[_0xa57c('0x14')](function(_0x5a6024){logger[_0xa57c('0xf')]('FreshsalesAccount,\x20%s,\x20%s',_0x314574,_0x5a6024);_0x5e3962(_0x5a6024);});});}exports[_0xa57c('0x15')]=function(_0x3d781d){var _0x93462c=this;return new Promise(function(_0xe3d505,_0x1fd0d8){return db[_0xa57c('0x16')][_0xa57c('0x17')]({'raw':_0x3d781d[_0xa57c('0x18')]?_0x3d781d['options'][_0xa57c('0x19')]===undefined?!![]:![]:!![],'where':_0x3d781d['options']?_0x3d781d['options'][_0xa57c('0x1a')]||null:null,'attributes':_0x3d781d[_0xa57c('0x18')]?_0x3d781d[_0xa57c('0x18')][_0xa57c('0x1b')]||null:null,'limit':_0x3d781d['options']?_0x3d781d[_0xa57c('0x18')][_0xa57c('0x1c')]||null:null,'include':_0x3d781d[_0xa57c('0x18')]?_0x3d781d[_0xa57c('0x18')][_0xa57c('0x1d')]?_[_0xa57c('0x1e')](_0x3d781d[_0xa57c('0x18')][_0xa57c('0x1d')],function(_0x2e99ed){return{'model':db[_0x2e99ed[_0xa57c('0x1f')]],'as':_0x2e99ed['as'],'attributes':_0x2e99ed[_0xa57c('0x1b')],'include':_0x2e99ed[_0xa57c('0x1d')]?_[_0xa57c('0x1e')](_0x2e99ed[_0xa57c('0x1d')],function(_0x431bec){return{'model':db[_0x431bec['model']],'as':_0x431bec['as'],'attributes':_0x431bec[_0xa57c('0x1b')],'include':_0x431bec[_0xa57c('0x1d')]?_[_0xa57c('0x1e')](_0x431bec[_0xa57c('0x1d')],function(_0x315ad7){return{'model':db[_0x315ad7[_0xa57c('0x1f')]],'as':_0x315ad7['as'],'attributes':_0x315ad7[_0xa57c('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xa57c('0x20')](function(_0x337f97){logger[_0xa57c('0xc')]('GetFreshsalesAccount',_0x3d781d);logger[_0xa57c('0x21')]('GetFreshsalesAccount',_0x3d781d,JSON['stringify'](_0x337f97));_0xe3d505(_0x337f97);})[_0xa57c('0x14')](function(_0x7d10ec){logger['error'](_0xa57c('0x15'),_0x7d10ec[_0xa57c('0x12')],_0x3d781d);_0x1fd0d8(_0x93462c[_0xa57c('0xf')](0x1f4,_0x7d10ec['message']));});});};exports[_0xa57c('0x22')]=function(_0x58d46f){var _0xf5f70c=this;return new Promise(function(_0x5464f2,_0x2a3bbe){return db['FreshsalesAccount'][_0xa57c('0x23')]({'raw':_0x58d46f['options']?_0x58d46f[_0xa57c('0x18')][_0xa57c('0x19')]===undefined?!![]:![]:!![],'where':_0x58d46f[_0xa57c('0x18')]?_0x58d46f[_0xa57c('0x18')][_0xa57c('0x1a')]||null:null,'attributes':_0x58d46f[_0xa57c('0x18')]?_0x58d46f[_0xa57c('0x18')]['attributes']||null:null,'include':_0x58d46f[_0xa57c('0x18')]?_0x58d46f['options'][_0xa57c('0x1d')]?_[_0xa57c('0x1e')](_0x58d46f[_0xa57c('0x18')]['include'],function(_0x289174){return{'model':db[_0x289174['model']],'as':_0x289174['as'],'attributes':_0x289174[_0xa57c('0x1b')],'include':_0x289174['include']?_[_0xa57c('0x1e')](_0x289174['include'],function(_0x433116){return{'model':db[_0x433116[_0xa57c('0x1f')]],'as':_0x433116['as'],'attributes':_0x433116['attributes'],'include':_0x433116[_0xa57c('0x1d')]?_['map'](_0x433116[_0xa57c('0x1d')],function(_0x5c56d3){return{'model':db[_0x5c56d3[_0xa57c('0x1f')]],'as':_0x5c56d3['as'],'attributes':_0x5c56d3[_0xa57c('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xa57c('0x20')](function(_0x62f697){logger[_0xa57c('0xc')](_0xa57c('0x22'),_0x58d46f);logger['debug']('ShowFreshsalesAccount',_0x58d46f,JSON[_0xa57c('0x24')](_0x62f697));_0x5464f2(_0x62f697);})[_0xa57c('0x14')](function(_0x2c70d6){logger['error'](_0xa57c('0x22'),_0x2c70d6['message'],_0x58d46f);_0x2a3bbe(_0xf5f70c[_0xa57c('0xf')](0x1f4,_0x2c70d6[_0xa57c('0x12')]));});});}; \ No newline at end of file +var _0xc1c6=['then','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','findAll','options','raw','where','attributes','limit','include','map','model','GetFreshsalesAccount','FreshsalesAccount','find','ShowFreshsalesAccount','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http'];(function(_0x47808b,_0x1f4f85){var _0x5986bf=function(_0x8c0087){while(--_0x8c0087){_0x47808b['push'](_0x47808b['shift']());}};_0x5986bf(++_0x1f4f85);}(_0xc1c6,0xf7));var _0x6c1c=function(_0x5b716f,_0x575dbf){_0x5b716f=_0x5b716f-0x0;var _0x58fc6f=_0xc1c6[_0x5b716f];return _0x58fc6f;};'use strict';var _=require(_0x6c1c('0x0'));var util=require(_0x6c1c('0x1'));var moment=require(_0x6c1c('0x2'));var BPromise=require('bluebird');var rs=require(_0x6c1c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6c1c('0x4'))['db'];var utils=require(_0x6c1c('0x5'));var logger=require(_0x6c1c('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x6c1c('0x7'));var client=jayson['client'][_0x6c1c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x582bec,_0xe510ca,_0x2eb1ba){return new BPromise(function(_0x38369d,_0x2cec58){return client['request'](_0x582bec,_0x2eb1ba)[_0x6c1c('0x9')](function(_0x3ca985){logger['info'](_0x6c1c('0xa'),_0xe510ca,_0x6c1c('0xb'));logger[_0x6c1c('0xc')](_0x6c1c('0xd'),_0xe510ca,'request\x20sent',JSON[_0x6c1c('0xe')](_0x3ca985));if(_0x3ca985[_0x6c1c('0xf')]){if(_0x3ca985[_0x6c1c('0xf')]['code']===0x1f4){logger[_0x6c1c('0xf')](_0x6c1c('0xa'),_0xe510ca,_0x3ca985[_0x6c1c('0xf')]['message']);return _0x2cec58(_0x3ca985[_0x6c1c('0xf')]['message']);}logger[_0x6c1c('0xf')](_0x6c1c('0xa'),_0xe510ca,_0x3ca985[_0x6c1c('0xf')][_0x6c1c('0x10')]);return _0x38369d(_0x3ca985[_0x6c1c('0xf')][_0x6c1c('0x10')]);}else{logger[_0x6c1c('0x11')](_0x6c1c('0xa'),_0xe510ca,_0x6c1c('0xb'));_0x38369d(_0x3ca985['result'][_0x6c1c('0x10')]);}})[_0x6c1c('0x12')](function(_0x5214ee){logger[_0x6c1c('0xf')](_0x6c1c('0xa'),_0xe510ca,_0x5214ee);_0x2cec58(_0x5214ee);});});}exports['GetFreshsalesAccount']=function(_0x137770){var _0x4ede06=this;return new Promise(function(_0x338dc2,_0x1a0ab9){return db['FreshsalesAccount'][_0x6c1c('0x13')]({'raw':_0x137770['options']?_0x137770[_0x6c1c('0x14')][_0x6c1c('0x15')]===undefined?!![]:![]:!![],'where':_0x137770[_0x6c1c('0x14')]?_0x137770[_0x6c1c('0x14')][_0x6c1c('0x16')]||null:null,'attributes':_0x137770[_0x6c1c('0x14')]?_0x137770[_0x6c1c('0x14')][_0x6c1c('0x17')]||null:null,'limit':_0x137770[_0x6c1c('0x14')]?_0x137770[_0x6c1c('0x14')][_0x6c1c('0x18')]||null:null,'include':_0x137770[_0x6c1c('0x14')]?_0x137770[_0x6c1c('0x14')][_0x6c1c('0x19')]?_[_0x6c1c('0x1a')](_0x137770[_0x6c1c('0x14')][_0x6c1c('0x19')],function(_0x12c638){return{'model':db[_0x12c638[_0x6c1c('0x1b')]],'as':_0x12c638['as'],'attributes':_0x12c638[_0x6c1c('0x17')],'include':_0x12c638[_0x6c1c('0x19')]?_[_0x6c1c('0x1a')](_0x12c638[_0x6c1c('0x19')],function(_0x7ff10d){return{'model':db[_0x7ff10d[_0x6c1c('0x1b')]],'as':_0x7ff10d['as'],'attributes':_0x7ff10d[_0x6c1c('0x17')],'include':_0x7ff10d[_0x6c1c('0x19')]?_[_0x6c1c('0x1a')](_0x7ff10d[_0x6c1c('0x19')],function(_0x5f4568){return{'model':db[_0x5f4568[_0x6c1c('0x1b')]],'as':_0x5f4568['as'],'attributes':_0x5f4568['attributes']};}):[]};}):[]};}):[]:[]})[_0x6c1c('0x9')](function(_0x4c23f8){logger[_0x6c1c('0x11')]('GetFreshsalesAccount',_0x137770);logger[_0x6c1c('0xc')](_0x6c1c('0x1c'),_0x137770,JSON['stringify'](_0x4c23f8));_0x338dc2(_0x4c23f8);})[_0x6c1c('0x12')](function(_0x24da4c){logger['error'](_0x6c1c('0x1c'),_0x24da4c[_0x6c1c('0x10')],_0x137770);_0x1a0ab9(_0x4ede06[_0x6c1c('0xf')](0x1f4,_0x24da4c[_0x6c1c('0x10')]));});});};exports['ShowFreshsalesAccount']=function(_0x52c036){var _0x3cba17=this;return new Promise(function(_0x45128c,_0x21acef){return db[_0x6c1c('0x1d')][_0x6c1c('0x1e')]({'raw':_0x52c036[_0x6c1c('0x14')]?_0x52c036['options'][_0x6c1c('0x15')]===undefined?!![]:![]:!![],'where':_0x52c036[_0x6c1c('0x14')]?_0x52c036['options'][_0x6c1c('0x16')]||null:null,'attributes':_0x52c036[_0x6c1c('0x14')]?_0x52c036[_0x6c1c('0x14')][_0x6c1c('0x17')]||null:null,'include':_0x52c036['options']?_0x52c036[_0x6c1c('0x14')][_0x6c1c('0x19')]?_[_0x6c1c('0x1a')](_0x52c036['options'][_0x6c1c('0x19')],function(_0x4e5767){return{'model':db[_0x4e5767[_0x6c1c('0x1b')]],'as':_0x4e5767['as'],'attributes':_0x4e5767['attributes'],'include':_0x4e5767[_0x6c1c('0x19')]?_[_0x6c1c('0x1a')](_0x4e5767[_0x6c1c('0x19')],function(_0x54b8d3){return{'model':db[_0x54b8d3['model']],'as':_0x54b8d3['as'],'attributes':_0x54b8d3[_0x6c1c('0x17')],'include':_0x54b8d3[_0x6c1c('0x19')]?_[_0x6c1c('0x1a')](_0x54b8d3['include'],function(_0x1a9132){return{'model':db[_0x1a9132['model']],'as':_0x1a9132['as'],'attributes':_0x1a9132['attributes']};}):[]};}):[]};}):[]:[]})[_0x6c1c('0x9')](function(_0xbafcb3){logger[_0x6c1c('0x11')](_0x6c1c('0x1f'),_0x52c036);logger['debug'](_0x6c1c('0x1f'),_0x52c036,JSON[_0x6c1c('0xe')](_0xbafcb3));_0x45128c(_0xbafcb3);})[_0x6c1c('0x12')](function(_0x18da02){logger[_0x6c1c('0xf')](_0x6c1c('0x1f'),_0x18da02[_0x6c1c('0x10')],_0x52c036);_0x21acef(_0x3cba17[_0x6c1c('0xf')](0x1f4,_0x18da02[_0x6c1c('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index ae1b61a..2755345 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 _0x1bd1=['exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','getSubjects','/:id/descriptions','getDescriptions','/:id/fields','getFields','put','delete','destroy'];(function(_0x492445,_0x1454f9){var _0x34ca20=function(_0x33e606){while(--_0x33e606){_0x492445['push'](_0x492445['shift']());}};_0x34ca20(++_0x1454f9);}(_0x1bd1,0xd3));var _0x11bd=function(_0x18bd98,_0x56d69d){_0x18bd98=_0x18bd98-0x0;var _0x404e0c=_0x1bd1[_0x18bd98];return _0x404e0c;};'use strict';var multer=require(_0x11bd('0x0'));var util=require(_0x11bd('0x1'));var path=require(_0x11bd('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x11bd('0x3')]();var fs_extra=require(_0x11bd('0x4'));var auth=require(_0x11bd('0x5'));var interaction=require(_0x11bd('0x6'));var config=require(_0x11bd('0x7'));var controller=require('./intFreshsalesConfiguration.controller');router[_0x11bd('0x8')]('/',auth[_0x11bd('0x9')](),controller['index']);router['get'](_0x11bd('0xa'),auth[_0x11bd('0x9')](),controller[_0x11bd('0xb')]);router[_0x11bd('0x8')]('/:id/subjects',auth['isAuthenticated'](),controller[_0x11bd('0xc')]);router[_0x11bd('0x8')](_0x11bd('0xd'),auth[_0x11bd('0x9')](),controller[_0x11bd('0xe')]);router[_0x11bd('0x8')](_0x11bd('0xf'),auth[_0x11bd('0x9')](),controller[_0x11bd('0x10')]);router['post']('/',auth[_0x11bd('0x9')](),controller['create']);router[_0x11bd('0x11')](_0x11bd('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x11bd('0x12')]('/:id',auth[_0x11bd('0x9')](),controller[_0x11bd('0x13')]);module[_0x11bd('0x14')]=router; \ No newline at end of file +var _0xa23e=['/:id/subjects','getSubjects','isAuthenticated','getDescriptions','/:id/fields','getFields','post','create','/:id','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','get','index','show'];(function(_0x91ec40,_0xa1ec3b){var _0x428c7a=function(_0x196f25){while(--_0x196f25){_0x91ec40['push'](_0x91ec40['shift']());}};_0x428c7a(++_0xa1ec3b);}(_0xa23e,0x1a4));var _0xea23=function(_0x2c4dd4,_0x344407){_0x2c4dd4=_0x2c4dd4-0x0;var _0x84c199=_0xa23e[_0x2c4dd4];return _0x84c199;};'use strict';var multer=require(_0xea23('0x0'));var util=require(_0xea23('0x1'));var path=require(_0xea23('0x2'));var timeout=require(_0xea23('0x3'));var express=require(_0xea23('0x4'));var router=express[_0xea23('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xea23('0x6'));var config=require(_0xea23('0x7'));var controller=require(_0xea23('0x8'));router[_0xea23('0x9')]('/',auth['isAuthenticated'](),controller[_0xea23('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xea23('0xb')]);router[_0xea23('0x9')](_0xea23('0xc'),auth['isAuthenticated'](),controller[_0xea23('0xd')]);router[_0xea23('0x9')]('/:id/descriptions',auth[_0xea23('0xe')](),controller[_0xea23('0xf')]);router[_0xea23('0x9')](_0xea23('0x10'),auth[_0xea23('0xe')](),controller[_0xea23('0x11')]);router[_0xea23('0x12')]('/',auth[_0xea23('0xe')](),controller[_0xea23('0x13')]);router['put'](_0xea23('0x14'),auth[_0xea23('0xe')](),controller[_0xea23('0x15')]);router[_0xea23('0x16')]('/:id',auth['isAuthenticated'](),controller[_0xea23('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index e63f947..bb468b6 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 _0x1c0a=['STRING','exports'];(function(_0x26a427,_0x127e68){var _0x4bd45b=function(_0x41a6f8){while(--_0x41a6f8){_0x26a427['push'](_0x26a427['shift']());}};_0x4bd45b(++_0x127e68);}(_0x1c0a,0x99));var _0xa1c0=function(_0x55cbe6,_0x1dfa5a){_0x55cbe6=_0x55cbe6-0x0;var _0x26cb04=_0x1c0a[_0x55cbe6];return _0x26cb04;};'use strict';var Sequelize=require('sequelize');module[_0xa1c0('0x0')]={'name':{'type':Sequelize[_0xa1c0('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x8a01=['exports','STRING','sequelize'];(function(_0x31aaeb,_0x6194ef){var _0x2e97da=function(_0x17b1bd){while(--_0x17b1bd){_0x31aaeb['push'](_0x31aaeb['shift']());}};_0x2e97da(++_0x6194ef);}(_0x8a01,0x110));var _0x18a0=function(_0x4120bb,_0x119120){_0x4120bb=_0x4120bb-0x0;var _0x424c08=_0x8a01[_0x4120bb];return _0x424c08;};'use strict';var Sequelize=require(_0x18a0('0x0'));module[_0x18a0('0x1')]={'name':{'type':Sequelize[_0x18a0('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index 45cff67..bb1c40b 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 _0x1567=['pick','filter','merge','VIRTUAL','options','where','includeAll','rows','then','catch','show','params','include','find','create','body','getSubjects','findOne','order','getDescriptions','FreshsalesField','getFields','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','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/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','destroy','sendStatus','error','stack','name','send','index','map','FreshsalesConfiguration','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort'];(function(_0x1dfa70,_0x404788){var _0x18e9ce=function(_0x313cc0){while(--_0x313cc0){_0x1dfa70['push'](_0x1dfa70['shift']());}};_0x18e9ce(++_0x404788);}(_0x1567,0x1bf));var _0x7156=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x1567[_0x27af45];return _0x18df21;};'use strict';var emlformat=require(_0x7156('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x7156('0x1'));var jsonpatch=require(_0x7156('0x2'));var rp=require(_0x7156('0x3'));var moment=require(_0x7156('0x4'));var BPromise=require(_0x7156('0x5'));var Mustache=require(_0x7156('0x6'));var util=require('util');var path=require(_0x7156('0x7'));var sox=require(_0x7156('0x8'));var csv=require(_0x7156('0x9'));var ejs=require(_0x7156('0xa'));var fs=require('fs');var fs_extra=require(_0x7156('0xb'));var _=require('lodash');var squel=require(_0x7156('0xc'));var crypto=require('crypto');var jsforce=require(_0x7156('0xd'));var deskjs=require(_0x7156('0xe'));var toCsv=require('to-csv');var querystring=require(_0x7156('0xf'));var Papa=require(_0x7156('0x10'));var Redis=require(_0x7156('0x11'));var authService=require(_0x7156('0x12'));var qs=require(_0x7156('0x13'));var as=require(_0x7156('0x14'));var hardwareService=require(_0x7156('0x15'));var logger=require('../../config/logger')(_0x7156('0x16'));var utils=require(_0x7156('0x17'));var config=require(_0x7156('0x18'));var licenseUtil=require(_0x7156('0x19'));var db=require(_0x7156('0x1a'))['db'];function respondWithStatusCode(_0x430c76,_0x417f2c){_0x417f2c=_0x417f2c||0xcc;return function(_0x336735){if(_0x336735){return _0x430c76['sendStatus'](_0x417f2c);}return _0x430c76[_0x7156('0x1b')](_0x417f2c)[_0x7156('0x1c')]();};}function respondWithResult(_0x632cd6,_0x87e34c){_0x87e34c=_0x87e34c||0xc8;return function(_0x827100){if(_0x827100){return _0x632cd6['status'](_0x87e34c)['json'](_0x827100);}};}function respondWithFilteredResult(_0x45b047,_0x7f5fa1){return function(_0xf9871c){if(_0xf9871c){var _0x576461=typeof _0x7f5fa1[_0x7156('0x1d')]===_0x7156('0x1e')&&typeof _0x7f5fa1[_0x7156('0x1f')]===_0x7156('0x1e');var _0x5956ed=_0xf9871c[_0x7156('0x20')];var _0x195b46=_0x576461?0x0:_0x7f5fa1['offset'];var _0x3ea567=_0x576461?_0xf9871c[_0x7156('0x20')]:_0x7f5fa1[_0x7156('0x1d')]+_0x7f5fa1[_0x7156('0x1f')];var _0x18718e;if(_0x3ea567>=_0x5956ed){_0x3ea567=_0x5956ed;_0x18718e=0xc8;}else{_0x18718e=0xce;}_0x45b047['status'](_0x18718e);return _0x45b047[_0x7156('0x21')](_0x7156('0x22'),_0x195b46+'-'+_0x3ea567+'/'+_0x5956ed)[_0x7156('0x23')](_0xf9871c);}return null;};}function patchUpdates(_0x4a60ff){return function(_0x53cf9a){try{jsonpatch[_0x7156('0x24')](_0x53cf9a,_0x4a60ff,!![]);}catch(_0x2a8180){return BPromise[_0x7156('0x25')](_0x2a8180);}return _0x53cf9a[_0x7156('0x26')]();};}function saveUpdates(_0x1850ff,_0x21258c){return function(_0xd393f8){if(_0xd393f8){return _0xd393f8['update'](_0x1850ff)['then'](function(_0xdd97e8){return _0xdd97e8;});}return null;};}function removeEntity(_0x7769b9,_0x353afd){return function(_0x5be637){if(_0x5be637){return _0x5be637[_0x7156('0x27')]()['then'](function(){_0x7769b9[_0x7156('0x1b')](0xcc)[_0x7156('0x1c')]();});}};}function handleEntityNotFound(_0x231491,_0x52b58c){return function(_0x2e1dbd){if(!_0x2e1dbd){_0x231491[_0x7156('0x28')](0x194);}return _0x2e1dbd;};}function handleError(_0x4a8404,_0x1c8beb){_0x1c8beb=_0x1c8beb||0x1f4;return function(_0x3193da){logger[_0x7156('0x29')](_0x3193da[_0x7156('0x2a')]);if(_0x3193da[_0x7156('0x2b')]){delete _0x3193da['name'];}_0x4a8404[_0x7156('0x1b')](_0x1c8beb)[_0x7156('0x2c')](_0x3193da);};}exports[_0x7156('0x2d')]=function(_0xcf131d,_0xa18c36){var _0x47259d={},_0x2a0160={},_0x7685f0={'count':0x0,'rows':[]};var _0x37e96e=_[_0x7156('0x2e')](db[_0x7156('0x2f')][_0x7156('0x30')],function(_0x51e69a){return{'name':_0x51e69a[_0x7156('0x31')],'type':_0x51e69a[_0x7156('0x32')][_0x7156('0x33')]};});_0x2a0160['model']=_['map'](_0x37e96e,_0x7156('0x2b'));_0x2a0160[_0x7156('0x34')]=_[_0x7156('0x35')](_0xcf131d[_0x7156('0x34')]);_0x2a0160[_0x7156('0x36')]=_[_0x7156('0x37')](_0x2a0160[_0x7156('0x38')],_0x2a0160[_0x7156('0x34')]);_0x47259d[_0x7156('0x39')]=_[_0x7156('0x37')](_0x2a0160[_0x7156('0x38')],qs[_0x7156('0x3a')](_0xcf131d['query']['fields']));_0x47259d[_0x7156('0x39')]=_0x47259d['attributes'][_0x7156('0x3b')]?_0x47259d[_0x7156('0x39')]:_0x2a0160[_0x7156('0x38')];if(!_0xcf131d[_0x7156('0x34')][_0x7156('0x3c')](_0x7156('0x3d'))){_0x47259d[_0x7156('0x1f')]=qs[_0x7156('0x1f')](_0xcf131d[_0x7156('0x34')][_0x7156('0x1f')]);_0x47259d[_0x7156('0x1d')]=qs['offset'](_0xcf131d['query']['offset']);}_0x47259d['order']=qs['sort'](_0xcf131d[_0x7156('0x34')][_0x7156('0x3e')]);_0x47259d['where']=qs[_0x7156('0x36')](_[_0x7156('0x3f')](_0xcf131d[_0x7156('0x34')],_0x2a0160['filters']),_0x37e96e);if(_0xcf131d[_0x7156('0x34')][_0x7156('0x40')]){_0x47259d['where']=_[_0x7156('0x41')](_0x47259d['where'],{'$or':_[_0x7156('0x2e')](_0x37e96e,function(_0x3149b5){if(_0x3149b5['type']!==_0x7156('0x42')){var _0x56cfca={};_0x56cfca[_0x3149b5[_0x7156('0x2b')]]={'$like':'%'+_0xcf131d['query'][_0x7156('0x40')]+'%'};return _0x56cfca;}})});}_0x47259d=_[_0x7156('0x41')]({},_0x47259d,_0xcf131d[_0x7156('0x43')]);var _0x21d7ab={'where':_0x47259d[_0x7156('0x44')]};return db['FreshsalesConfiguration'][_0x7156('0x20')](_0x21d7ab)['then'](function(_0x251d11){_0x7685f0[_0x7156('0x20')]=_0x251d11;if(_0xcf131d[_0x7156('0x34')][_0x7156('0x45')]){_0x47259d['include']=[{'all':!![]}];}return db[_0x7156('0x2f')]['findAll'](_0x47259d);})['then'](function(_0x3e57d5){_0x7685f0[_0x7156('0x46')]=_0x3e57d5;return _0x7685f0;})[_0x7156('0x47')](respondWithFilteredResult(_0xa18c36,_0x47259d))[_0x7156('0x48')](handleError(_0xa18c36,null));};exports[_0x7156('0x49')]=function(_0x5bf7f4,_0x48fdf1){var _0x4848d2={'raw':![],'where':{'id':_0x5bf7f4[_0x7156('0x4a')]['id']}},_0x5377d6={};_0x5377d6[_0x7156('0x38')]=_[_0x7156('0x35')](db[_0x7156('0x2f')][_0x7156('0x30')]);_0x5377d6['query']=_['keys'](_0x5bf7f4[_0x7156('0x34')]);_0x5377d6[_0x7156('0x36')]=_['intersection'](_0x5377d6[_0x7156('0x38')],_0x5377d6[_0x7156('0x34')]);_0x4848d2[_0x7156('0x39')]=_[_0x7156('0x37')](_0x5377d6[_0x7156('0x38')],qs[_0x7156('0x3a')](_0x5bf7f4[_0x7156('0x34')][_0x7156('0x3a')]));_0x4848d2[_0x7156('0x39')]=_0x4848d2[_0x7156('0x39')][_0x7156('0x3b')]?_0x4848d2[_0x7156('0x39')]:_0x5377d6[_0x7156('0x38')];if(_0x5bf7f4[_0x7156('0x34')]['includeAll']){_0x4848d2[_0x7156('0x4b')]=[{'all':!![]}];}_0x4848d2=_[_0x7156('0x41')]({},_0x4848d2,_0x5bf7f4[_0x7156('0x43')]);return db[_0x7156('0x2f')][_0x7156('0x4c')](_0x4848d2)['then'](handleEntityNotFound(_0x48fdf1,null))[_0x7156('0x47')](respondWithResult(_0x48fdf1,null))[_0x7156('0x48')](handleError(_0x48fdf1,null));};exports[_0x7156('0x4d')]=function(_0x4184bf,_0x539199){return db[_0x7156('0x2f')][_0x7156('0x4d')](_0x4184bf[_0x7156('0x4e')],{})[_0x7156('0x47')](respondWithResult(_0x539199,0xc9))[_0x7156('0x48')](handleError(_0x539199,null));};exports['update']=function(_0x4fe0f3,_0xf9bd97){if(_0x4fe0f3[_0x7156('0x4e')]['id']){delete _0x4fe0f3[_0x7156('0x4e')]['id'];}return db[_0x7156('0x2f')][_0x7156('0x4c')]({'where':{'id':_0x4fe0f3['params']['id']}})['then'](handleEntityNotFound(_0xf9bd97,null))['then'](saveUpdates(_0x4fe0f3[_0x7156('0x4e')],null))[_0x7156('0x47')](respondWithResult(_0xf9bd97,null))['catch'](handleError(_0xf9bd97,null));};exports[_0x7156('0x27')]=function(_0xef7042,_0x3cfaaa){return db[_0x7156('0x2f')][_0x7156('0x4c')]({'where':{'id':_0xef7042[_0x7156('0x4a')]['id']}})[_0x7156('0x47')](handleEntityNotFound(_0x3cfaaa,null))['then'](removeEntity(_0x3cfaaa,null))['catch'](handleError(_0x3cfaaa,null));};exports[_0x7156('0x4f')]=function(_0x2e5020,_0x26577b,_0xe67ce7){var _0x8d3cdf={};var _0x36ef43={};var _0x41d878;var _0xf9d43c;return db[_0x7156('0x2f')][_0x7156('0x50')]({'where':{'id':_0x2e5020['params']['id']}})[_0x7156('0x47')](handleEntityNotFound(_0x26577b,null))[_0x7156('0x47')](function(_0xc29afe){if(_0xc29afe){_0x41d878=_0xc29afe;_0x36ef43[_0x7156('0x38')]=_[_0x7156('0x35')](db['FreshsalesField'][_0x7156('0x30')]);_0x36ef43['query']=_[_0x7156('0x35')](_0x2e5020[_0x7156('0x34')]);_0x36ef43['filters']=_[_0x7156('0x37')](_0x36ef43[_0x7156('0x38')],_0x36ef43[_0x7156('0x34')]);_0x8d3cdf[_0x7156('0x39')]=_[_0x7156('0x37')](_0x36ef43[_0x7156('0x38')],qs[_0x7156('0x3a')](_0x2e5020[_0x7156('0x34')][_0x7156('0x3a')]));_0x8d3cdf[_0x7156('0x39')]=_0x8d3cdf['attributes'][_0x7156('0x3b')]?_0x8d3cdf['attributes']:_0x36ef43[_0x7156('0x38')];_0x8d3cdf[_0x7156('0x51')]=qs[_0x7156('0x3e')](_0x2e5020[_0x7156('0x34')][_0x7156('0x3e')]);_0x8d3cdf['where']=qs[_0x7156('0x36')](_[_0x7156('0x3f')](_0x2e5020[_0x7156('0x34')],_0x36ef43['filters']));if(_0x2e5020[_0x7156('0x34')][_0x7156('0x40')]){_0x8d3cdf[_0x7156('0x44')]=_[_0x7156('0x41')](_0x8d3cdf[_0x7156('0x44')],{'$or':_[_0x7156('0x2e')](_0x8d3cdf[_0x7156('0x39')],function(_0x1a7030){var _0x23376f={};_0x23376f[_0x1a7030]={'$like':'%'+_0x2e5020['query']['filter']+'%'};return _0x23376f;})});}_0x8d3cdf=_['merge']({},_0x8d3cdf,_0x2e5020['options']);return _0x41d878[_0x7156('0x4f')](_0x8d3cdf);}})[_0x7156('0x47')](function(_0x52ebec){if(_0x52ebec){_0xf9d43c=_0x52ebec[_0x7156('0x3b')];if(!_0x2e5020[_0x7156('0x34')][_0x7156('0x3c')](_0x7156('0x3d'))){_0x8d3cdf['limit']=qs[_0x7156('0x1f')](_0x2e5020[_0x7156('0x34')]['limit']);_0x8d3cdf[_0x7156('0x1d')]=qs[_0x7156('0x1d')](_0x2e5020[_0x7156('0x34')][_0x7156('0x1d')]);}return _0x41d878[_0x7156('0x4f')](_0x8d3cdf);}})['then'](function(_0x5779d2){if(_0x5779d2){return _0x5779d2?{'count':_0xf9d43c,'rows':_0x5779d2}:null;}})[_0x7156('0x47')](respondWithResult(_0x26577b,null))[_0x7156('0x48')](handleError(_0x26577b,null));};exports[_0x7156('0x52')]=function(_0x4af9a8,_0x2a32ac,_0x4edee2){var _0x40eec0={};var _0x13e675={};var _0x5753d7;var _0x5997c3;return db[_0x7156('0x2f')][_0x7156('0x50')]({'where':{'id':_0x4af9a8['params']['id']}})['then'](handleEntityNotFound(_0x2a32ac,null))[_0x7156('0x47')](function(_0x2994f5){if(_0x2994f5){_0x5753d7=_0x2994f5;_0x13e675[_0x7156('0x38')]=_[_0x7156('0x35')](db[_0x7156('0x53')][_0x7156('0x30')]);_0x13e675[_0x7156('0x34')]=_['keys'](_0x4af9a8[_0x7156('0x34')]);_0x13e675[_0x7156('0x36')]=_[_0x7156('0x37')](_0x13e675[_0x7156('0x38')],_0x13e675[_0x7156('0x34')]);_0x40eec0[_0x7156('0x39')]=_['intersection'](_0x13e675[_0x7156('0x38')],qs[_0x7156('0x3a')](_0x4af9a8[_0x7156('0x34')]['fields']));_0x40eec0[_0x7156('0x39')]=_0x40eec0[_0x7156('0x39')]['length']?_0x40eec0[_0x7156('0x39')]:_0x13e675[_0x7156('0x38')];_0x40eec0[_0x7156('0x51')]=qs[_0x7156('0x3e')](_0x4af9a8['query'][_0x7156('0x3e')]);_0x40eec0[_0x7156('0x44')]=qs[_0x7156('0x36')](_[_0x7156('0x3f')](_0x4af9a8[_0x7156('0x34')],_0x13e675[_0x7156('0x36')]));if(_0x4af9a8['query'][_0x7156('0x40')]){_0x40eec0[_0x7156('0x44')]=_['merge'](_0x40eec0[_0x7156('0x44')],{'$or':_[_0x7156('0x2e')](_0x40eec0[_0x7156('0x39')],function(_0x931e31){var _0x537715={};_0x537715[_0x931e31]={'$like':'%'+_0x4af9a8['query'][_0x7156('0x40')]+'%'};return _0x537715;})});}_0x40eec0=_['merge']({},_0x40eec0,_0x4af9a8[_0x7156('0x43')]);return _0x5753d7[_0x7156('0x52')](_0x40eec0);}})[_0x7156('0x47')](function(_0x20d3cd){if(_0x20d3cd){_0x5997c3=_0x20d3cd['length'];if(!_0x4af9a8[_0x7156('0x34')][_0x7156('0x3c')](_0x7156('0x3d'))){_0x40eec0['limit']=qs[_0x7156('0x1f')](_0x4af9a8['query'][_0x7156('0x1f')]);_0x40eec0[_0x7156('0x1d')]=qs[_0x7156('0x1d')](_0x4af9a8[_0x7156('0x34')]['offset']);}return _0x5753d7[_0x7156('0x52')](_0x40eec0);}})[_0x7156('0x47')](function(_0x148f23){if(_0x148f23){return _0x148f23?{'count':_0x5997c3,'rows':_0x148f23}:null;}})[_0x7156('0x47')](respondWithResult(_0x2a32ac,null))[_0x7156('0x48')](handleError(_0x2a32ac,null));};exports['getFields']=function(_0x395bd9,_0x296aae,_0x7a12b5){var _0x539707={};var _0x55e1d1={};var _0x454d6d;var _0x5192d7;return db[_0x7156('0x2f')]['findOne']({'where':{'id':_0x395bd9[_0x7156('0x4a')]['id']}})[_0x7156('0x47')](handleEntityNotFound(_0x296aae,null))[_0x7156('0x47')](function(_0x196c39){if(_0x196c39){_0x454d6d=_0x196c39;_0x55e1d1[_0x7156('0x38')]=_[_0x7156('0x35')](db[_0x7156('0x53')][_0x7156('0x30')]);_0x55e1d1[_0x7156('0x34')]=_[_0x7156('0x35')](_0x395bd9[_0x7156('0x34')]);_0x55e1d1['filters']=_[_0x7156('0x37')](_0x55e1d1['model'],_0x55e1d1[_0x7156('0x34')]);_0x539707[_0x7156('0x39')]=_[_0x7156('0x37')](_0x55e1d1['model'],qs[_0x7156('0x3a')](_0x395bd9[_0x7156('0x34')]['fields']));_0x539707[_0x7156('0x39')]=_0x539707['attributes'][_0x7156('0x3b')]?_0x539707[_0x7156('0x39')]:_0x55e1d1[_0x7156('0x38')];_0x539707[_0x7156('0x51')]=qs[_0x7156('0x3e')](_0x395bd9[_0x7156('0x34')][_0x7156('0x3e')]);_0x539707['where']=qs[_0x7156('0x36')](_['pick'](_0x395bd9[_0x7156('0x34')],_0x55e1d1[_0x7156('0x36')]));if(_0x395bd9['query']['filter']){_0x539707['where']=_['merge'](_0x539707[_0x7156('0x44')],{'$or':_[_0x7156('0x2e')](_0x539707['attributes'],function(_0x5830cf){var _0x546da3={};_0x546da3[_0x5830cf]={'$like':'%'+_0x395bd9[_0x7156('0x34')]['filter']+'%'};return _0x546da3;})});}_0x539707=_['merge']({},_0x539707,_0x395bd9[_0x7156('0x43')]);return _0x454d6d['getFields'](_0x539707);}})[_0x7156('0x47')](function(_0x2cfddc){if(_0x2cfddc){_0x5192d7=_0x2cfddc[_0x7156('0x3b')];if(!_0x395bd9[_0x7156('0x34')][_0x7156('0x3c')]('nolimit')){_0x539707[_0x7156('0x1f')]=qs[_0x7156('0x1f')](_0x395bd9[_0x7156('0x34')][_0x7156('0x1f')]);_0x539707[_0x7156('0x1d')]=qs[_0x7156('0x1d')](_0x395bd9[_0x7156('0x34')]['offset']);}return _0x454d6d[_0x7156('0x54')](_0x539707);}})[_0x7156('0x47')](function(_0x565686){if(_0x565686){return _0x565686?{'count':_0x5192d7,'rows':_0x565686}:null;}})[_0x7156('0x47')](respondWithResult(_0x296aae,null))['catch'](handleError(_0x296aae,null));}; \ No newline at end of file +var _0xf59d=['body','update','findOne','sort','getSubjects','hasOwnProperty','getDescriptions','getFields','FreshsalesField','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','set','apply','save','then','destroy','error','stack','name','send','index','FreshsalesConfiguration','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','length','nolimit','order','where','pick','type','VIRTUAL','filter','merge','includeAll','findAll','rows','catch','show','params','options','find','create'];(function(_0x34246b,_0x1d5f54){var _0x314402=function(_0x1d4c61){while(--_0x1d4c61){_0x34246b['push'](_0x34246b['shift']());}};_0x314402(++_0x1d5f54);}(_0xf59d,0x19e));var _0xdf59=function(_0x53b07e,_0x3bc254){_0x53b07e=_0x53b07e-0x0;var _0x5490b7=_0xf59d[_0x53b07e];return _0x5490b7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xdf59('0x0'));var zipdir=require(_0xdf59('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xdf59('0x2'));var BPromise=require(_0xdf59('0x3'));var Mustache=require(_0xdf59('0x4'));var util=require(_0xdf59('0x5'));var path=require(_0xdf59('0x6'));var sox=require(_0xdf59('0x7'));var csv=require(_0xdf59('0x8'));var ejs=require(_0xdf59('0x9'));var fs=require('fs');var fs_extra=require(_0xdf59('0xa'));var _=require(_0xdf59('0xb'));var squel=require(_0xdf59('0xc'));var crypto=require('crypto');var jsforce=require(_0xdf59('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xdf59('0x8'));var querystring=require(_0xdf59('0xe'));var Papa=require(_0xdf59('0xf'));var Redis=require(_0xdf59('0x10'));var authService=require(_0xdf59('0x11'));var qs=require(_0xdf59('0x12'));var as=require(_0xdf59('0x13'));var hardwareService=require(_0xdf59('0x14'));var logger=require(_0xdf59('0x15'))(_0xdf59('0x16'));var utils=require('../../config/utils');var config=require(_0xdf59('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xdf59('0x18'))['db'];function respondWithStatusCode(_0x485f97,_0x497908){_0x497908=_0x497908||0xcc;return function(_0x1a1307){if(_0x1a1307){return _0x485f97[_0xdf59('0x19')](_0x497908);}return _0x485f97[_0xdf59('0x1a')](_0x497908)['end']();};}function respondWithResult(_0x4a43a0,_0x482c1c){_0x482c1c=_0x482c1c||0xc8;return function(_0x65e985){if(_0x65e985){return _0x4a43a0['status'](_0x482c1c)[_0xdf59('0x1b')](_0x65e985);}};}function respondWithFilteredResult(_0x13c074,_0x522a8a){return function(_0x3e87eb){if(_0x3e87eb){var _0x36238c=typeof _0x522a8a[_0xdf59('0x1c')]==='undefined'&&typeof _0x522a8a[_0xdf59('0x1d')]===_0xdf59('0x1e');var _0x2d9503=_0x3e87eb[_0xdf59('0x1f')];var _0x2bf4dc=_0x36238c?0x0:_0x522a8a[_0xdf59('0x1c')];var _0xb5edf4=_0x36238c?_0x3e87eb[_0xdf59('0x1f')]:_0x522a8a[_0xdf59('0x1c')]+_0x522a8a['limit'];var _0x7476cf;if(_0xb5edf4>=_0x2d9503){_0xb5edf4=_0x2d9503;_0x7476cf=0xc8;}else{_0x7476cf=0xce;}_0x13c074[_0xdf59('0x1a')](_0x7476cf);return _0x13c074[_0xdf59('0x20')]('Content-Range',_0x2bf4dc+'-'+_0xb5edf4+'/'+_0x2d9503)[_0xdf59('0x1b')](_0x3e87eb);}return null;};}function patchUpdates(_0x339b5e){return function(_0x3652ba){try{jsonpatch[_0xdf59('0x21')](_0x3652ba,_0x339b5e,!![]);}catch(_0x364db4){return BPromise['reject'](_0x364db4);}return _0x3652ba[_0xdf59('0x22')]();};}function saveUpdates(_0xbac7c3,_0x21238f){return function(_0x124142){if(_0x124142){return _0x124142['update'](_0xbac7c3)[_0xdf59('0x23')](function(_0x175c0e){return _0x175c0e;});}return null;};}function removeEntity(_0x4d2861,_0x294516){return function(_0xe91809){if(_0xe91809){return _0xe91809[_0xdf59('0x24')]()['then'](function(){_0x4d2861[_0xdf59('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x49839c,_0x49cb79){return function(_0x1f7ecf){if(!_0x1f7ecf){_0x49839c[_0xdf59('0x19')](0x194);}return _0x1f7ecf;};}function handleError(_0x5e1adf,_0xffa1a2){_0xffa1a2=_0xffa1a2||0x1f4;return function(_0x4405ff){logger[_0xdf59('0x25')](_0x4405ff[_0xdf59('0x26')]);if(_0x4405ff['name']){delete _0x4405ff[_0xdf59('0x27')];}_0x5e1adf[_0xdf59('0x1a')](_0xffa1a2)[_0xdf59('0x28')](_0x4405ff);};}exports[_0xdf59('0x29')]=function(_0x536489,_0x56657f){var _0x498c72={},_0x3a135a={},_0x3059ba={'count':0x0,'rows':[]};var _0x38bf95=_['map'](db[_0xdf59('0x2a')][_0xdf59('0x2b')],function(_0x3a1475){return{'name':_0x3a1475[_0xdf59('0x2c')],'type':_0x3a1475['type'][_0xdf59('0x2d')]};});_0x3a135a[_0xdf59('0x2e')]=_[_0xdf59('0x2f')](_0x38bf95,_0xdf59('0x27'));_0x3a135a[_0xdf59('0x30')]=_[_0xdf59('0x31')](_0x536489[_0xdf59('0x30')]);_0x3a135a[_0xdf59('0x32')]=_['intersection'](_0x3a135a[_0xdf59('0x2e')],_0x3a135a[_0xdf59('0x30')]);_0x498c72['attributes']=_[_0xdf59('0x33')](_0x3a135a[_0xdf59('0x2e')],qs[_0xdf59('0x34')](_0x536489['query'][_0xdf59('0x34')]));_0x498c72[_0xdf59('0x35')]=_0x498c72[_0xdf59('0x35')][_0xdf59('0x36')]?_0x498c72[_0xdf59('0x35')]:_0x3a135a[_0xdf59('0x2e')];if(!_0x536489[_0xdf59('0x30')]['hasOwnProperty'](_0xdf59('0x37'))){_0x498c72[_0xdf59('0x1d')]=qs[_0xdf59('0x1d')](_0x536489['query'][_0xdf59('0x1d')]);_0x498c72[_0xdf59('0x1c')]=qs['offset'](_0x536489['query']['offset']);}_0x498c72[_0xdf59('0x38')]=qs['sort'](_0x536489['query']['sort']);_0x498c72[_0xdf59('0x39')]=qs[_0xdf59('0x32')](_[_0xdf59('0x3a')](_0x536489[_0xdf59('0x30')],_0x3a135a[_0xdf59('0x32')]),_0x38bf95);if(_0x536489[_0xdf59('0x30')]['filter']){_0x498c72[_0xdf59('0x39')]=_['merge'](_0x498c72['where'],{'$or':_[_0xdf59('0x2f')](_0x38bf95,function(_0x3264de){if(_0x3264de[_0xdf59('0x3b')]!==_0xdf59('0x3c')){var _0x2c9d37={};_0x2c9d37[_0x3264de[_0xdf59('0x27')]]={'$like':'%'+_0x536489[_0xdf59('0x30')][_0xdf59('0x3d')]+'%'};return _0x2c9d37;}})});}_0x498c72=_[_0xdf59('0x3e')]({},_0x498c72,_0x536489['options']);var _0x267333={'where':_0x498c72['where']};return db[_0xdf59('0x2a')]['count'](_0x267333)[_0xdf59('0x23')](function(_0x1ad280){_0x3059ba[_0xdf59('0x1f')]=_0x1ad280;if(_0x536489[_0xdf59('0x30')][_0xdf59('0x3f')]){_0x498c72['include']=[{'all':!![]}];}return db[_0xdf59('0x2a')][_0xdf59('0x40')](_0x498c72);})[_0xdf59('0x23')](function(_0x1ef4e9){_0x3059ba[_0xdf59('0x41')]=_0x1ef4e9;return _0x3059ba;})[_0xdf59('0x23')](respondWithFilteredResult(_0x56657f,_0x498c72))[_0xdf59('0x42')](handleError(_0x56657f,null));};exports[_0xdf59('0x43')]=function(_0x30b006,_0x1605da){var _0x468a5e={'raw':![],'where':{'id':_0x30b006[_0xdf59('0x44')]['id']}},_0x2681dd={};_0x2681dd[_0xdf59('0x2e')]=_[_0xdf59('0x31')](db[_0xdf59('0x2a')][_0xdf59('0x2b')]);_0x2681dd[_0xdf59('0x30')]=_['keys'](_0x30b006[_0xdf59('0x30')]);_0x2681dd[_0xdf59('0x32')]=_[_0xdf59('0x33')](_0x2681dd[_0xdf59('0x2e')],_0x2681dd['query']);_0x468a5e[_0xdf59('0x35')]=_['intersection'](_0x2681dd[_0xdf59('0x2e')],qs[_0xdf59('0x34')](_0x30b006[_0xdf59('0x30')]['fields']));_0x468a5e[_0xdf59('0x35')]=_0x468a5e['attributes'][_0xdf59('0x36')]?_0x468a5e['attributes']:_0x2681dd['model'];if(_0x30b006['query'][_0xdf59('0x3f')]){_0x468a5e['include']=[{'all':!![]}];}_0x468a5e=_['merge']({},_0x468a5e,_0x30b006[_0xdf59('0x45')]);return db['FreshsalesConfiguration'][_0xdf59('0x46')](_0x468a5e)[_0xdf59('0x23')](handleEntityNotFound(_0x1605da,null))['then'](respondWithResult(_0x1605da,null))[_0xdf59('0x42')](handleError(_0x1605da,null));};exports['create']=function(_0x2aa003,_0x423d8e){return db['FreshsalesConfiguration'][_0xdf59('0x47')](_0x2aa003[_0xdf59('0x48')],{})['then'](respondWithResult(_0x423d8e,0xc9))[_0xdf59('0x42')](handleError(_0x423d8e,null));};exports[_0xdf59('0x49')]=function(_0x385659,_0x23a460){if(_0x385659['body']['id']){delete _0x385659[_0xdf59('0x48')]['id'];}return db[_0xdf59('0x2a')][_0xdf59('0x46')]({'where':{'id':_0x385659[_0xdf59('0x44')]['id']}})[_0xdf59('0x23')](handleEntityNotFound(_0x23a460,null))[_0xdf59('0x23')](saveUpdates(_0x385659[_0xdf59('0x48')],null))[_0xdf59('0x23')](respondWithResult(_0x23a460,null))[_0xdf59('0x42')](handleError(_0x23a460,null));};exports['destroy']=function(_0x4bd21b,_0x4bd65b){return db[_0xdf59('0x2a')][_0xdf59('0x46')]({'where':{'id':_0x4bd21b[_0xdf59('0x44')]['id']}})[_0xdf59('0x23')](handleEntityNotFound(_0x4bd65b,null))[_0xdf59('0x23')](removeEntity(_0x4bd65b,null))[_0xdf59('0x42')](handleError(_0x4bd65b,null));};exports['getSubjects']=function(_0x200bea,_0xf74523,_0x46434e){var _0x1910a6={};var _0x4c32ff={};var _0x20f6b2;var _0x2d6c7b;return db[_0xdf59('0x2a')][_0xdf59('0x4a')]({'where':{'id':_0x200bea[_0xdf59('0x44')]['id']}})[_0xdf59('0x23')](handleEntityNotFound(_0xf74523,null))[_0xdf59('0x23')](function(_0x405701){if(_0x405701){_0x20f6b2=_0x405701;_0x4c32ff[_0xdf59('0x2e')]=_[_0xdf59('0x31')](db['FreshsalesField']['rawAttributes']);_0x4c32ff['query']=_[_0xdf59('0x31')](_0x200bea['query']);_0x4c32ff['filters']=_[_0xdf59('0x33')](_0x4c32ff[_0xdf59('0x2e')],_0x4c32ff['query']);_0x1910a6[_0xdf59('0x35')]=_[_0xdf59('0x33')](_0x4c32ff['model'],qs['fields'](_0x200bea['query'][_0xdf59('0x34')]));_0x1910a6[_0xdf59('0x35')]=_0x1910a6[_0xdf59('0x35')][_0xdf59('0x36')]?_0x1910a6[_0xdf59('0x35')]:_0x4c32ff[_0xdf59('0x2e')];_0x1910a6[_0xdf59('0x38')]=qs[_0xdf59('0x4b')](_0x200bea[_0xdf59('0x30')][_0xdf59('0x4b')]);_0x1910a6['where']=qs[_0xdf59('0x32')](_[_0xdf59('0x3a')](_0x200bea[_0xdf59('0x30')],_0x4c32ff[_0xdf59('0x32')]));if(_0x200bea[_0xdf59('0x30')][_0xdf59('0x3d')]){_0x1910a6[_0xdf59('0x39')]=_['merge'](_0x1910a6[_0xdf59('0x39')],{'$or':_[_0xdf59('0x2f')](_0x1910a6[_0xdf59('0x35')],function(_0x3d4d83){var _0x2caa49={};_0x2caa49[_0x3d4d83]={'$like':'%'+_0x200bea[_0xdf59('0x30')]['filter']+'%'};return _0x2caa49;})});}_0x1910a6=_[_0xdf59('0x3e')]({},_0x1910a6,_0x200bea['options']);return _0x20f6b2[_0xdf59('0x4c')](_0x1910a6);}})[_0xdf59('0x23')](function(_0x37f1cc){if(_0x37f1cc){_0x2d6c7b=_0x37f1cc[_0xdf59('0x36')];if(!_0x200bea[_0xdf59('0x30')][_0xdf59('0x4d')](_0xdf59('0x37'))){_0x1910a6[_0xdf59('0x1d')]=qs[_0xdf59('0x1d')](_0x200bea['query']['limit']);_0x1910a6[_0xdf59('0x1c')]=qs[_0xdf59('0x1c')](_0x200bea['query'][_0xdf59('0x1c')]);}return _0x20f6b2[_0xdf59('0x4c')](_0x1910a6);}})[_0xdf59('0x23')](function(_0x43caf0){if(_0x43caf0){return _0x43caf0?{'count':_0x2d6c7b,'rows':_0x43caf0}:null;}})[_0xdf59('0x23')](respondWithResult(_0xf74523,null))[_0xdf59('0x42')](handleError(_0xf74523,null));};exports['getDescriptions']=function(_0x11366d,_0x48f93b,_0x55558c){var _0x10d2be={};var _0x16f12a={};var _0x331491;var _0x24f4f5;return db[_0xdf59('0x2a')][_0xdf59('0x4a')]({'where':{'id':_0x11366d[_0xdf59('0x44')]['id']}})[_0xdf59('0x23')](handleEntityNotFound(_0x48f93b,null))['then'](function(_0x48cfff){if(_0x48cfff){_0x331491=_0x48cfff;_0x16f12a[_0xdf59('0x2e')]=_[_0xdf59('0x31')](db['FreshsalesField']['rawAttributes']);_0x16f12a['query']=_[_0xdf59('0x31')](_0x11366d[_0xdf59('0x30')]);_0x16f12a[_0xdf59('0x32')]=_[_0xdf59('0x33')](_0x16f12a[_0xdf59('0x2e')],_0x16f12a[_0xdf59('0x30')]);_0x10d2be[_0xdf59('0x35')]=_[_0xdf59('0x33')](_0x16f12a['model'],qs['fields'](_0x11366d['query'][_0xdf59('0x34')]));_0x10d2be[_0xdf59('0x35')]=_0x10d2be[_0xdf59('0x35')][_0xdf59('0x36')]?_0x10d2be[_0xdf59('0x35')]:_0x16f12a[_0xdf59('0x2e')];_0x10d2be[_0xdf59('0x38')]=qs[_0xdf59('0x4b')](_0x11366d[_0xdf59('0x30')][_0xdf59('0x4b')]);_0x10d2be[_0xdf59('0x39')]=qs[_0xdf59('0x32')](_[_0xdf59('0x3a')](_0x11366d[_0xdf59('0x30')],_0x16f12a[_0xdf59('0x32')]));if(_0x11366d[_0xdf59('0x30')]['filter']){_0x10d2be['where']=_[_0xdf59('0x3e')](_0x10d2be[_0xdf59('0x39')],{'$or':_[_0xdf59('0x2f')](_0x10d2be[_0xdf59('0x35')],function(_0x2f78af){var _0x4df5c0={};_0x4df5c0[_0x2f78af]={'$like':'%'+_0x11366d[_0xdf59('0x30')][_0xdf59('0x3d')]+'%'};return _0x4df5c0;})});}_0x10d2be=_[_0xdf59('0x3e')]({},_0x10d2be,_0x11366d[_0xdf59('0x45')]);return _0x331491['getDescriptions'](_0x10d2be);}})[_0xdf59('0x23')](function(_0x42285a){if(_0x42285a){_0x24f4f5=_0x42285a[_0xdf59('0x36')];if(!_0x11366d[_0xdf59('0x30')][_0xdf59('0x4d')]('nolimit')){_0x10d2be[_0xdf59('0x1d')]=qs[_0xdf59('0x1d')](_0x11366d[_0xdf59('0x30')]['limit']);_0x10d2be['offset']=qs[_0xdf59('0x1c')](_0x11366d['query'][_0xdf59('0x1c')]);}return _0x331491[_0xdf59('0x4e')](_0x10d2be);}})[_0xdf59('0x23')](function(_0x1d2a18){if(_0x1d2a18){return _0x1d2a18?{'count':_0x24f4f5,'rows':_0x1d2a18}:null;}})[_0xdf59('0x23')](respondWithResult(_0x48f93b,null))[_0xdf59('0x42')](handleError(_0x48f93b,null));};exports[_0xdf59('0x4f')]=function(_0x45ac8f,_0x22e6f0,_0x235114){var _0x5e827e={};var _0x933fe6={};var _0x169809;var _0x106ec4;return db[_0xdf59('0x2a')][_0xdf59('0x4a')]({'where':{'id':_0x45ac8f[_0xdf59('0x44')]['id']}})[_0xdf59('0x23')](handleEntityNotFound(_0x22e6f0,null))[_0xdf59('0x23')](function(_0x2d442c){if(_0x2d442c){_0x169809=_0x2d442c;_0x933fe6[_0xdf59('0x2e')]=_['keys'](db[_0xdf59('0x50')]['rawAttributes']);_0x933fe6['query']=_[_0xdf59('0x31')](_0x45ac8f[_0xdf59('0x30')]);_0x933fe6[_0xdf59('0x32')]=_[_0xdf59('0x33')](_0x933fe6[_0xdf59('0x2e')],_0x933fe6[_0xdf59('0x30')]);_0x5e827e[_0xdf59('0x35')]=_[_0xdf59('0x33')](_0x933fe6[_0xdf59('0x2e')],qs[_0xdf59('0x34')](_0x45ac8f['query'][_0xdf59('0x34')]));_0x5e827e[_0xdf59('0x35')]=_0x5e827e[_0xdf59('0x35')]['length']?_0x5e827e[_0xdf59('0x35')]:_0x933fe6['model'];_0x5e827e[_0xdf59('0x38')]=qs[_0xdf59('0x4b')](_0x45ac8f[_0xdf59('0x30')][_0xdf59('0x4b')]);_0x5e827e[_0xdf59('0x39')]=qs[_0xdf59('0x32')](_['pick'](_0x45ac8f[_0xdf59('0x30')],_0x933fe6[_0xdf59('0x32')]));if(_0x45ac8f['query'][_0xdf59('0x3d')]){_0x5e827e[_0xdf59('0x39')]=_[_0xdf59('0x3e')](_0x5e827e[_0xdf59('0x39')],{'$or':_[_0xdf59('0x2f')](_0x5e827e[_0xdf59('0x35')],function(_0x4cf37d){var _0x2092ca={};_0x2092ca[_0x4cf37d]={'$like':'%'+_0x45ac8f[_0xdf59('0x30')][_0xdf59('0x3d')]+'%'};return _0x2092ca;})});}_0x5e827e=_[_0xdf59('0x3e')]({},_0x5e827e,_0x45ac8f[_0xdf59('0x45')]);return _0x169809[_0xdf59('0x4f')](_0x5e827e);}})[_0xdf59('0x23')](function(_0xa7b21f){if(_0xa7b21f){_0x106ec4=_0xa7b21f[_0xdf59('0x36')];if(!_0x45ac8f[_0xdf59('0x30')][_0xdf59('0x4d')]('nolimit')){_0x5e827e[_0xdf59('0x1d')]=qs['limit'](_0x45ac8f[_0xdf59('0x30')]['limit']);_0x5e827e[_0xdf59('0x1c')]=qs[_0xdf59('0x1c')](_0x45ac8f[_0xdf59('0x30')][_0xdf59('0x1c')]);}return _0x169809[_0xdf59('0x4f')](_0x5e827e);}})['then'](function(_0x342c1c){if(_0x342c1c){return _0x342c1c?{'count':_0x106ec4,'rows':_0x342c1c}:null;}})[_0xdf59('0x23')](respondWithResult(_0x22e6f0,null))['catch'](handleError(_0x22e6f0,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index fdaa7ea..53783ab 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 _0xa37f=['api','moment','request-promise','path','rimraf','../../config/environment','./intFreshsalesConfiguration.attributes','exports','define','FreshsalesConfiguration','lodash','util','../../config/logger'];(function(_0x3b0731,_0xcf9925){var _0x4204d7=function(_0x635ac5){while(--_0x635ac5){_0x3b0731['push'](_0x3b0731['shift']());}};_0x4204d7(++_0xcf9925);}(_0xa37f,0x135));var _0xfa37=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xa37f[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xfa37('0x0'));var util=require(_0xfa37('0x1'));var logger=require(_0xfa37('0x2'))(_0xfa37('0x3'));var moment=require(_0xfa37('0x4'));var BPromise=require('bluebird');var rp=require(_0xfa37('0x5'));var fs=require('fs');var path=require(_0xfa37('0x6'));var rimraf=require(_0xfa37('0x7'));var config=require(_0xfa37('0x8'));var attributes=require(_0xfa37('0x9'));module[_0xfa37('0xa')]=function(_0x30ea6d,_0x333cb4){return _0x30ea6d[_0xfa37('0xb')](_0xfa37('0xc'),attributes,{'tableName':'int_freshsales_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc530=['api','moment','bluebird','request-promise','path','../../config/environment','./intFreshsalesConfiguration.attributes','exports','int_freshsales_configurations','lodash','util','../../config/logger'];(function(_0x341e0f,_0x4a09d0){var _0x59555a=function(_0x4343a8){while(--_0x4343a8){_0x341e0f['push'](_0x341e0f['shift']());}};_0x59555a(++_0x4a09d0);}(_0xc530,0xed));var _0x0c53=function(_0x3e2fcf,_0x579110){_0x3e2fcf=_0x3e2fcf-0x0;var _0x497db7=_0xc530[_0x3e2fcf];return _0x497db7;};'use strict';var _=require(_0x0c53('0x0'));var util=require(_0x0c53('0x1'));var logger=require(_0x0c53('0x2'))(_0x0c53('0x3'));var moment=require(_0x0c53('0x4'));var BPromise=require(_0x0c53('0x5'));var rp=require(_0x0c53('0x6'));var fs=require('fs');var path=require(_0x0c53('0x7'));var rimraf=require('rimraf');var config=require(_0x0c53('0x8'));var attributes=require(_0x0c53('0x9'));module[_0x0c53('0xa')]=function(_0xf64872,_0xd2768d){return _0xf64872['define']('FreshsalesConfiguration',attributes,{'tableName':_0x0c53('0xb'),'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 48c58b7..071ab20 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 _0x2119=['request','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http'];(function(_0x382f15,_0x13d46b){var _0x354b45=function(_0xf523b5){while(--_0xf523b5){_0x382f15['push'](_0x382f15['shift']());}};_0x354b45(++_0x13d46b);}(_0x2119,0x8f));var _0x9211=function(_0x3d2541,_0x3ac09e){_0x3d2541=_0x3d2541-0x0;var _0x70fb21=_0x2119[_0x3d2541];return _0x70fb21;};'use strict';var _=require(_0x9211('0x0'));var util=require('util');var moment=require(_0x9211('0x1'));var BPromise=require(_0x9211('0x2'));var rs=require(_0x9211('0x3'));var fs=require('fs');var Redis=require(_0x9211('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9211('0x5'));var logger=require(_0x9211('0x6'))('rpc');var config=require(_0x9211('0x7'));var jayson=require(_0x9211('0x8'));var client=jayson[_0x9211('0x9')][_0x9211('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3f8f72,_0x14e674,_0x341dcf){return new BPromise(function(_0x2eb09c,_0x3702b2){return client[_0x9211('0xb')](_0x3f8f72,_0x341dcf)['then'](function(_0x46d9eb){logger[_0x9211('0xc')](_0x9211('0xd'),_0x14e674,_0x9211('0xe'));logger[_0x9211('0xf')](_0x9211('0x10'),_0x14e674,_0x9211('0xe'),JSON[_0x9211('0x11')](_0x46d9eb));if(_0x46d9eb[_0x9211('0x12')]){if(_0x46d9eb['error']['code']===0x1f4){logger[_0x9211('0x12')](_0x9211('0xd'),_0x14e674,_0x46d9eb[_0x9211('0x12')][_0x9211('0x13')]);return _0x3702b2(_0x46d9eb['error']['message']);}logger['error']('FreshsalesConfiguration,\x20%s,\x20%s',_0x14e674,_0x46d9eb[_0x9211('0x12')][_0x9211('0x13')]);return _0x2eb09c(_0x46d9eb[_0x9211('0x12')][_0x9211('0x13')]);}else{logger[_0x9211('0xc')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x14e674,'request\x20sent');_0x2eb09c(_0x46d9eb[_0x9211('0x14')]['message']);}})[_0x9211('0x15')](function(_0x35b2d9){logger[_0x9211('0x12')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x14e674,_0x35b2d9);_0x3702b2(_0x35b2d9);});});} \ No newline at end of file +var _0x367e=['request\x20sent','debug','stringify','error','code','message','result','lodash','util','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','FreshsalesConfiguration,\x20%s,\x20%s'];(function(_0x14c3ad,_0x2d12c4){var _0x15f72f=function(_0x2100b4){while(--_0x2100b4){_0x14c3ad['push'](_0x14c3ad['shift']());}};_0x15f72f(++_0x2d12c4);}(_0x367e,0x197));var _0xe367=function(_0x12885b,_0x4ce691){_0x12885b=_0x12885b-0x0;var _0x52625a=_0x367e[_0x12885b];return _0x52625a;};'use strict';var _=require(_0xe367('0x0'));var util=require(_0xe367('0x1'));var moment=require('moment');var BPromise=require(_0xe367('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe367('0x3'))['db'];var utils=require(_0xe367('0x4'));var logger=require('../../config/logger')(_0xe367('0x5'));var config=require(_0xe367('0x6'));var jayson=require(_0xe367('0x7'));var client=jayson[_0xe367('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x141c08,_0x2ebd0b,_0x2b1c33){return new BPromise(function(_0x1f6996,_0x3d4342){return client[_0xe367('0x9')](_0x141c08,_0x2b1c33)[_0xe367('0xa')](function(_0x494ec5){logger[_0xe367('0xb')](_0xe367('0xc'),_0x2ebd0b,_0xe367('0xd'));logger[_0xe367('0xe')]('FreshsalesConfiguration,\x20%s,\x20%s,\x20%s',_0x2ebd0b,_0xe367('0xd'),JSON[_0xe367('0xf')](_0x494ec5));if(_0x494ec5[_0xe367('0x10')]){if(_0x494ec5[_0xe367('0x10')][_0xe367('0x11')]===0x1f4){logger[_0xe367('0x10')](_0xe367('0xc'),_0x2ebd0b,_0x494ec5[_0xe367('0x10')][_0xe367('0x12')]);return _0x3d4342(_0x494ec5['error'][_0xe367('0x12')]);}logger[_0xe367('0x10')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x2ebd0b,_0x494ec5['error'][_0xe367('0x12')]);return _0x1f6996(_0x494ec5[_0xe367('0x10')]['message']);}else{logger['info'](_0xe367('0xc'),_0x2ebd0b,_0xe367('0xd'));_0x1f6996(_0x494ec5[_0xe367('0x13')][_0xe367('0x12')]);}})['catch'](function(_0x1aa765){logger[_0xe367('0x10')](_0xe367('0xc'),_0x2ebd0b,_0x1aa765);_0x3d4342(_0x1aa765);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index a56c217..1c13800 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 _0x4876=['put','delete','destroy','exports','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesField.controller','isAuthenticated','index','/:id','show','post','create'];(function(_0x3bfa0d,_0x2d84f0){var _0x49b7e0=function(_0x46fda2){while(--_0x46fda2){_0x3bfa0d['push'](_0x3bfa0d['shift']());}};_0x49b7e0(++_0x2d84f0);}(_0x4876,0x84));var _0x6487=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4876[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x6487('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x6487('0x1')]();var fs_extra=require('fs-extra');var auth=require(_0x6487('0x2'));var interaction=require(_0x6487('0x3'));var config=require(_0x6487('0x4'));var controller=require(_0x6487('0x5'));router['get']('/',auth[_0x6487('0x6')](),controller[_0x6487('0x7')]);router['get'](_0x6487('0x8'),auth[_0x6487('0x6')](),controller[_0x6487('0x9')]);router[_0x6487('0xa')]('/',auth[_0x6487('0x6')](),controller[_0x6487('0xb')]);router[_0x6487('0xc')](_0x6487('0x8'),auth[_0x6487('0x6')](),controller['update']);router[_0x6487('0xd')](_0x6487('0x8'),auth[_0x6487('0x6')](),controller[_0x6487('0xe')]);module[_0x6487('0xf')]=router; \ No newline at end of file +var _0xb7c8=['exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./intFreshsalesField.controller','get','isAuthenticated','index','/:id','show','post','create','update','delete','destroy'];(function(_0x4315ea,_0x2dfd7d){var _0x1ea51b=function(_0x30e9b6){while(--_0x30e9b6){_0x4315ea['push'](_0x4315ea['shift']());}};_0x1ea51b(++_0x2dfd7d);}(_0xb7c8,0x119));var _0x8b7c=function(_0xb349d3,_0x82900){_0xb349d3=_0xb349d3-0x0;var _0x22aa9e=_0xb7c8[_0xb349d3];return _0x22aa9e;};'use strict';var multer=require('multer');var util=require(_0x8b7c('0x0'));var path=require(_0x8b7c('0x1'));var timeout=require(_0x8b7c('0x2'));var express=require(_0x8b7c('0x3'));var router=express[_0x8b7c('0x4')]();var fs_extra=require(_0x8b7c('0x5'));var auth=require(_0x8b7c('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x8b7c('0x7'));var controller=require(_0x8b7c('0x8'));router[_0x8b7c('0x9')]('/',auth[_0x8b7c('0xa')](),controller[_0x8b7c('0xb')]);router[_0x8b7c('0x9')](_0x8b7c('0xc'),auth[_0x8b7c('0xa')](),controller[_0x8b7c('0xd')]);router[_0x8b7c('0xe')]('/',auth[_0x8b7c('0xa')](),controller[_0x8b7c('0xf')]);router['put'](_0x8b7c('0xc'),auth['isAuthenticated'](),controller[_0x8b7c('0x10')]);router[_0x8b7c('0x11')]('/:id',auth[_0x8b7c('0xa')](),controller[_0x8b7c('0x12')]);module[_0x8b7c('0x13')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js index 4deb7c5..7f1ebac 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 _0xcdf2=['STRING','ENUM','BOOLEAN','variable','customVariable','keyValue','picklist','string'];(function(_0x11dc3a,_0x59fa38){var _0x52a9a1=function(_0x1f6515){while(--_0x1f6515){_0x11dc3a['push'](_0x11dc3a['shift']());}};_0x52a9a1(++_0x59fa38);}(_0xcdf2,0x1db));var _0x2cdf=function(_0x119b3e,_0x588d50){_0x119b3e=_0x119b3e-0x0;var _0x1169ae=_0xcdf2[_0x119b3e];return _0x1169ae;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize['ENUM']('string',_0x2cdf('0x0'),_0x2cdf('0x1'),_0x2cdf('0x2'),_0x2cdf('0x3')),'defaultValue':_0x2cdf('0x4')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x2cdf('0x5')]},'keyType':{'type':Sequelize[_0x2cdf('0x6')](_0x2cdf('0x4'),_0x2cdf('0x0'),'customVariable')},'keyContent':{'type':Sequelize[_0x2cdf('0x5')]},'idField':{'type':Sequelize[_0x2cdf('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x2cdf('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2cdf('0x5')]}}; \ No newline at end of file +var _0x469e=['variable','customVariable','keyValue','picklist','STRING','sequelize','exports','ENUM','string'];(function(_0x41f120,_0x40c4e1){var _0x47853c=function(_0x536613){while(--_0x536613){_0x41f120['push'](_0x41f120['shift']());}};_0x47853c(++_0x40c4e1);}(_0x469e,0x7a));var _0xe469=function(_0x40d078,_0x210a77){_0x40d078=_0x40d078-0x0;var _0x46fc81=_0x469e[_0x40d078];return _0x46fc81;};'use strict';var Sequelize=require(_0xe469('0x0'));module[_0xe469('0x1')]={'type':{'type':Sequelize[_0xe469('0x2')](_0xe469('0x3'),_0xe469('0x4'),_0xe469('0x5'),_0xe469('0x6'),_0xe469('0x7')),'defaultValue':'string'},'content':{'type':Sequelize[_0xe469('0x8')]},'key':{'type':Sequelize[_0xe469('0x8')]},'keyType':{'type':Sequelize[_0xe469('0x2')](_0xe469('0x3'),_0xe469('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0xe469('0x8')]},'idField':{'type':Sequelize[_0xe469('0x8')]},'nameField':{'type':Sequelize[_0xe469('0x8')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index 089e721..05c86dd 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 _0xdaf0=['keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','name','options','includeAll','include','findAll','rows','catch','params','create','body','find','eml-format','zip-dir','fast-json-patch','moment','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','error','send','index','map','FreshsalesField','rawAttributes','type','model'];(function(_0x106cd8,_0xa2fd7f){var _0x109308=function(_0x3e8cd4){while(--_0x3e8cd4){_0x106cd8['push'](_0x106cd8['shift']());}};_0x109308(++_0xa2fd7f);}(_0xdaf0,0x1bc));var _0x0daf=function(_0x4372db,_0x3ac20e){_0x4372db=_0x4372db-0x0;var _0x4a34dc=_0xdaf0[_0x4372db];return _0x4a34dc;};'use strict';var emlformat=require(_0x0daf('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0daf('0x1'));var jsonpatch=require(_0x0daf('0x2'));var rp=require('request-promise');var moment=require(_0x0daf('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0daf('0x4'));var util=require(_0x0daf('0x5'));var path=require('path');var sox=require(_0x0daf('0x6'));var csv=require(_0x0daf('0x7'));var ejs=require(_0x0daf('0x8'));var fs=require('fs');var fs_extra=require(_0x0daf('0x9'));var _=require('lodash');var squel=require(_0x0daf('0xa'));var crypto=require(_0x0daf('0xb'));var jsforce=require(_0x0daf('0xc'));var deskjs=require(_0x0daf('0xd'));var toCsv=require('to-csv');var querystring=require(_0x0daf('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x0daf('0xf'));var qs=require(_0x0daf('0x10'));var as=require(_0x0daf('0x11'));var hardwareService=require(_0x0daf('0x12'));var logger=require('../../config/logger')(_0x0daf('0x13'));var utils=require('../../config/utils');var config=require(_0x0daf('0x14'));var licenseUtil=require(_0x0daf('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3a2a84,_0x39563f){_0x39563f=_0x39563f||0xcc;return function(_0xa19c0e){if(_0xa19c0e){return _0x3a2a84[_0x0daf('0x16')](_0x39563f);}return _0x3a2a84[_0x0daf('0x17')](_0x39563f)['end']();};}function respondWithResult(_0x1dea07,_0x3c5cff){_0x3c5cff=_0x3c5cff||0xc8;return function(_0x2aa9ef){if(_0x2aa9ef){return _0x1dea07['status'](_0x3c5cff)[_0x0daf('0x18')](_0x2aa9ef);}};}function respondWithFilteredResult(_0x1088b6,_0x19f674){return function(_0x26ccae){if(_0x26ccae){var _0x2add5b=typeof _0x19f674[_0x0daf('0x19')]===_0x0daf('0x1a')&&typeof _0x19f674['limit']===_0x0daf('0x1a');var _0x1d6f31=_0x26ccae[_0x0daf('0x1b')];var _0xec2f59=_0x2add5b?0x0:_0x19f674[_0x0daf('0x19')];var _0x2dfbf0=_0x2add5b?_0x26ccae[_0x0daf('0x1b')]:_0x19f674[_0x0daf('0x19')]+_0x19f674[_0x0daf('0x1c')];var _0xe20f8f;if(_0x2dfbf0>=_0x1d6f31){_0x2dfbf0=_0x1d6f31;_0xe20f8f=0xc8;}else{_0xe20f8f=0xce;}_0x1088b6['status'](_0xe20f8f);return _0x1088b6[_0x0daf('0x1d')](_0x0daf('0x1e'),_0xec2f59+'-'+_0x2dfbf0+'/'+_0x1d6f31)[_0x0daf('0x18')](_0x26ccae);}return null;};}function patchUpdates(_0x3683a7){return function(_0x496e8b){try{jsonpatch[_0x0daf('0x1f')](_0x496e8b,_0x3683a7,!![]);}catch(_0x202408){return BPromise[_0x0daf('0x20')](_0x202408);}return _0x496e8b[_0x0daf('0x21')]();};}function saveUpdates(_0x34fb11,_0x724638){return function(_0x50f7a6){if(_0x50f7a6){return _0x50f7a6[_0x0daf('0x22')](_0x34fb11)[_0x0daf('0x23')](function(_0x10ab5c){return _0x10ab5c;});}return null;};}function removeEntity(_0x9be1fa,_0x31780e){return function(_0x300386){if(_0x300386){return _0x300386[_0x0daf('0x24')]()[_0x0daf('0x23')](function(){_0x9be1fa[_0x0daf('0x17')](0xcc)[_0x0daf('0x25')]();});}};}function handleEntityNotFound(_0x200945,_0x1997d5){return function(_0x653085){if(!_0x653085){_0x200945[_0x0daf('0x16')](0x194);}return _0x653085;};}function handleError(_0x1736c6,_0x51f365){_0x51f365=_0x51f365||0x1f4;return function(_0x5c2922){logger[_0x0daf('0x26')](_0x5c2922['stack']);if(_0x5c2922['name']){delete _0x5c2922['name'];}_0x1736c6[_0x0daf('0x17')](_0x51f365)[_0x0daf('0x27')](_0x5c2922);};}exports[_0x0daf('0x28')]=function(_0x2a8db9,_0x762a3b){var _0x24a31a={},_0x3aec94={},_0x1a272e={'count':0x0,'rows':[]};var _0x27bec7=_[_0x0daf('0x29')](db[_0x0daf('0x2a')][_0x0daf('0x2b')],function(_0x451fa8){return{'name':_0x451fa8['fieldName'],'type':_0x451fa8[_0x0daf('0x2c')]['key']};});_0x3aec94[_0x0daf('0x2d')]=_[_0x0daf('0x29')](_0x27bec7,'name');_0x3aec94['query']=_[_0x0daf('0x2e')](_0x2a8db9[_0x0daf('0x2f')]);_0x3aec94[_0x0daf('0x30')]=_[_0x0daf('0x31')](_0x3aec94[_0x0daf('0x2d')],_0x3aec94['query']);_0x24a31a[_0x0daf('0x32')]=_[_0x0daf('0x31')](_0x3aec94['model'],qs[_0x0daf('0x33')](_0x2a8db9[_0x0daf('0x2f')][_0x0daf('0x33')]));_0x24a31a[_0x0daf('0x32')]=_0x24a31a['attributes'][_0x0daf('0x34')]?_0x24a31a[_0x0daf('0x32')]:_0x3aec94[_0x0daf('0x2d')];if(!_0x2a8db9[_0x0daf('0x2f')][_0x0daf('0x35')](_0x0daf('0x36'))){_0x24a31a[_0x0daf('0x1c')]=qs[_0x0daf('0x1c')](_0x2a8db9[_0x0daf('0x2f')][_0x0daf('0x1c')]);_0x24a31a[_0x0daf('0x19')]=qs[_0x0daf('0x19')](_0x2a8db9['query'][_0x0daf('0x19')]);}_0x24a31a['order']=qs[_0x0daf('0x37')](_0x2a8db9[_0x0daf('0x2f')]['sort']);_0x24a31a[_0x0daf('0x38')]=qs[_0x0daf('0x30')](_['pick'](_0x2a8db9['query'],_0x3aec94[_0x0daf('0x30')]),_0x27bec7);if(_0x2a8db9[_0x0daf('0x2f')][_0x0daf('0x39')]){_0x24a31a['where']=_[_0x0daf('0x3a')](_0x24a31a[_0x0daf('0x38')],{'$or':_[_0x0daf('0x29')](_0x27bec7,function(_0x412e7a){if(_0x412e7a[_0x0daf('0x2c')]!=='VIRTUAL'){var _0x53987c={};_0x53987c[_0x412e7a[_0x0daf('0x3b')]]={'$like':'%'+_0x2a8db9[_0x0daf('0x2f')]['filter']+'%'};return _0x53987c;}})});}_0x24a31a=_[_0x0daf('0x3a')]({},_0x24a31a,_0x2a8db9[_0x0daf('0x3c')]);var _0x426265={'where':_0x24a31a['where']};return db[_0x0daf('0x2a')]['count'](_0x426265)['then'](function(_0x1c55fc){_0x1a272e[_0x0daf('0x1b')]=_0x1c55fc;if(_0x2a8db9[_0x0daf('0x2f')][_0x0daf('0x3d')]){_0x24a31a[_0x0daf('0x3e')]=[{'all':!![]}];}return db[_0x0daf('0x2a')][_0x0daf('0x3f')](_0x24a31a);})[_0x0daf('0x23')](function(_0x4a2805){_0x1a272e[_0x0daf('0x40')]=_0x4a2805;return _0x1a272e;})[_0x0daf('0x23')](respondWithFilteredResult(_0x762a3b,_0x24a31a))[_0x0daf('0x41')](handleError(_0x762a3b,null));};exports['show']=function(_0x49c5e3,_0x437043){var _0x230cf3={'raw':!![],'where':{'id':_0x49c5e3[_0x0daf('0x42')]['id']}},_0x3d521d={};_0x3d521d[_0x0daf('0x2d')]=_[_0x0daf('0x2e')](db['FreshsalesField'][_0x0daf('0x2b')]);_0x3d521d['query']=_[_0x0daf('0x2e')](_0x49c5e3[_0x0daf('0x2f')]);_0x3d521d[_0x0daf('0x30')]=_['intersection'](_0x3d521d['model'],_0x3d521d[_0x0daf('0x2f')]);_0x230cf3['attributes']=_[_0x0daf('0x31')](_0x3d521d[_0x0daf('0x2d')],qs[_0x0daf('0x33')](_0x49c5e3[_0x0daf('0x2f')]['fields']));_0x230cf3[_0x0daf('0x32')]=_0x230cf3[_0x0daf('0x32')][_0x0daf('0x34')]?_0x230cf3[_0x0daf('0x32')]:_0x3d521d[_0x0daf('0x2d')];if(_0x49c5e3[_0x0daf('0x2f')][_0x0daf('0x3d')]){_0x230cf3['include']=[{'all':!![]}];}_0x230cf3=_[_0x0daf('0x3a')]({},_0x230cf3,_0x49c5e3[_0x0daf('0x3c')]);return db[_0x0daf('0x2a')]['find'](_0x230cf3)[_0x0daf('0x23')](handleEntityNotFound(_0x437043,null))[_0x0daf('0x23')](respondWithResult(_0x437043,null))['catch'](handleError(_0x437043,null));};exports[_0x0daf('0x43')]=function(_0x58e385,_0xffad6e){return db[_0x0daf('0x2a')][_0x0daf('0x43')](_0x58e385[_0x0daf('0x44')],{})['then'](respondWithResult(_0xffad6e,0xc9))[_0x0daf('0x41')](handleError(_0xffad6e,null));};exports['update']=function(_0x51bfc5,_0x49d49c){if(_0x51bfc5['body']['id']){delete _0x51bfc5[_0x0daf('0x44')]['id'];}return db[_0x0daf('0x2a')][_0x0daf('0x45')]({'where':{'id':_0x51bfc5[_0x0daf('0x42')]['id']}})['then'](handleEntityNotFound(_0x49d49c,null))[_0x0daf('0x23')](saveUpdates(_0x51bfc5['body'],null))[_0x0daf('0x23')](respondWithResult(_0x49d49c,null))[_0x0daf('0x41')](handleError(_0x49d49c,null));};exports[_0x0daf('0x24')]=function(_0x475ecc,_0x5077d2){return db[_0x0daf('0x2a')][_0x0daf('0x45')]({'where':{'id':_0x475ecc[_0x0daf('0x42')]['id']}})[_0x0daf('0x23')](handleEntityNotFound(_0x5077d2,null))['then'](removeEntity(_0x5077d2,null))[_0x0daf('0x41')](handleError(_0x5077d2,null));}; \ No newline at end of file +var _0x6559=['to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','destroy','error','stack','name','send','index','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','hasOwnProperty','order','sort','where','filter','merge','then','includeAll','include','FreshsalesField','findAll','rows','show','params','rawAttributes','fields','length','options','find','catch','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js'];(function(_0xf1e10f,_0x6ccfa8){var _0x277d74=function(_0x4fafad){while(--_0x4fafad){_0xf1e10f['push'](_0xf1e10f['shift']());}};_0x277d74(++_0x6ccfa8);}(_0x6559,0x17f));var _0x9655=function(_0x35f798,_0x5e6cea){_0x35f798=_0x35f798-0x0;var _0x29bd97=_0x6559[_0x35f798];return _0x29bd97;};'use strict';var emlformat=require(_0x9655('0x0'));var rimraf=require(_0x9655('0x1'));var zipdir=require(_0x9655('0x2'));var jsonpatch=require(_0x9655('0x3'));var rp=require(_0x9655('0x4'));var moment=require(_0x9655('0x5'));var BPromise=require(_0x9655('0x6'));var Mustache=require(_0x9655('0x7'));var util=require(_0x9655('0x8'));var path=require(_0x9655('0x9'));var sox=require(_0x9655('0xa'));var csv=require('to-csv');var ejs=require(_0x9655('0xb'));var fs=require('fs');var fs_extra=require(_0x9655('0xc'));var _=require(_0x9655('0xd'));var squel=require('squel');var crypto=require(_0x9655('0xe'));var jsforce=require(_0x9655('0xf'));var deskjs=require(_0x9655('0x10'));var toCsv=require(_0x9655('0x11'));var querystring=require(_0x9655('0x12'));var Papa=require(_0x9655('0x13'));var Redis=require(_0x9655('0x14'));var authService=require(_0x9655('0x15'));var qs=require(_0x9655('0x16'));var as=require(_0x9655('0x17'));var hardwareService=require(_0x9655('0x18'));var logger=require(_0x9655('0x19'))(_0x9655('0x1a'));var utils=require('../../config/utils');var config=require(_0x9655('0x1b'));var licenseUtil=require(_0x9655('0x1c'));var db=require(_0x9655('0x1d'))['db'];function respondWithStatusCode(_0x239019,_0x5e1240){_0x5e1240=_0x5e1240||0xcc;return function(_0x51f20e){if(_0x51f20e){return _0x239019[_0x9655('0x1e')](_0x5e1240);}return _0x239019[_0x9655('0x1f')](_0x5e1240)[_0x9655('0x20')]();};}function respondWithResult(_0x5c56a6,_0x11a7ef){_0x11a7ef=_0x11a7ef||0xc8;return function(_0x25fb57){if(_0x25fb57){return _0x5c56a6[_0x9655('0x1f')](_0x11a7ef)['json'](_0x25fb57);}};}function respondWithFilteredResult(_0x21c17b,_0x360f02){return function(_0xe176ff){if(_0xe176ff){var _0x228a2f=typeof _0x360f02[_0x9655('0x21')]===_0x9655('0x22')&&typeof _0x360f02[_0x9655('0x23')]===_0x9655('0x22');var _0x2f0e55=_0xe176ff['count'];var _0xc417a2=_0x228a2f?0x0:_0x360f02[_0x9655('0x21')];var _0x56a75a=_0x228a2f?_0xe176ff[_0x9655('0x24')]:_0x360f02[_0x9655('0x21')]+_0x360f02[_0x9655('0x23')];var _0x71d5fd;if(_0x56a75a>=_0x2f0e55){_0x56a75a=_0x2f0e55;_0x71d5fd=0xc8;}else{_0x71d5fd=0xce;}_0x21c17b[_0x9655('0x1f')](_0x71d5fd);return _0x21c17b[_0x9655('0x25')](_0x9655('0x26'),_0xc417a2+'-'+_0x56a75a+'/'+_0x2f0e55)[_0x9655('0x27')](_0xe176ff);}return null;};}function patchUpdates(_0x255774){return function(_0x3bff09){try{jsonpatch['apply'](_0x3bff09,_0x255774,!![]);}catch(_0x2adeec){return BPromise[_0x9655('0x28')](_0x2adeec);}return _0x3bff09['save']();};}function saveUpdates(_0x4b86f9,_0x332ee6){return function(_0x3c9136){if(_0x3c9136){return _0x3c9136['update'](_0x4b86f9)['then'](function(_0x202789){return _0x202789;});}return null;};}function removeEntity(_0x3f7889,_0x49f9a5){return function(_0x2b8701){if(_0x2b8701){return _0x2b8701[_0x9655('0x29')]()['then'](function(){_0x3f7889['status'](0xcc)[_0x9655('0x20')]();});}};}function handleEntityNotFound(_0x59f68d,_0x5836b0){return function(_0x5eb256){if(!_0x5eb256){_0x59f68d[_0x9655('0x1e')](0x194);}return _0x5eb256;};}function handleError(_0x5912ae,_0x3071eb){_0x3071eb=_0x3071eb||0x1f4;return function(_0x429835){logger[_0x9655('0x2a')](_0x429835[_0x9655('0x2b')]);if(_0x429835[_0x9655('0x2c')]){delete _0x429835[_0x9655('0x2c')];}_0x5912ae['status'](_0x3071eb)[_0x9655('0x2d')](_0x429835);};}exports[_0x9655('0x2e')]=function(_0x36bcca,_0x8c3661){var _0x2a48f0={},_0x4e671d={},_0x46d9bd={'count':0x0,'rows':[]};var _0x192427=_[_0x9655('0x2f')](db['FreshsalesField']['rawAttributes'],function(_0x233f34){return{'name':_0x233f34[_0x9655('0x30')],'type':_0x233f34[_0x9655('0x31')][_0x9655('0x32')]};});_0x4e671d[_0x9655('0x33')]=_[_0x9655('0x2f')](_0x192427,_0x9655('0x2c'));_0x4e671d[_0x9655('0x34')]=_[_0x9655('0x35')](_0x36bcca[_0x9655('0x34')]);_0x4e671d[_0x9655('0x36')]=_[_0x9655('0x37')](_0x4e671d[_0x9655('0x33')],_0x4e671d['query']);_0x2a48f0[_0x9655('0x38')]=_['intersection'](_0x4e671d[_0x9655('0x33')],qs['fields'](_0x36bcca[_0x9655('0x34')]['fields']));_0x2a48f0['attributes']=_0x2a48f0[_0x9655('0x38')]['length']?_0x2a48f0[_0x9655('0x38')]:_0x4e671d['model'];if(!_0x36bcca[_0x9655('0x34')][_0x9655('0x39')]('nolimit')){_0x2a48f0[_0x9655('0x23')]=qs[_0x9655('0x23')](_0x36bcca[_0x9655('0x34')][_0x9655('0x23')]);_0x2a48f0['offset']=qs[_0x9655('0x21')](_0x36bcca[_0x9655('0x34')]['offset']);}_0x2a48f0[_0x9655('0x3a')]=qs[_0x9655('0x3b')](_0x36bcca[_0x9655('0x34')][_0x9655('0x3b')]);_0x2a48f0[_0x9655('0x3c')]=qs[_0x9655('0x36')](_['pick'](_0x36bcca['query'],_0x4e671d[_0x9655('0x36')]),_0x192427);if(_0x36bcca[_0x9655('0x34')][_0x9655('0x3d')]){_0x2a48f0[_0x9655('0x3c')]=_[_0x9655('0x3e')](_0x2a48f0[_0x9655('0x3c')],{'$or':_[_0x9655('0x2f')](_0x192427,function(_0x45c7d0){if(_0x45c7d0[_0x9655('0x31')]!=='VIRTUAL'){var _0x130d5a={};_0x130d5a[_0x45c7d0[_0x9655('0x2c')]]={'$like':'%'+_0x36bcca[_0x9655('0x34')][_0x9655('0x3d')]+'%'};return _0x130d5a;}})});}_0x2a48f0=_[_0x9655('0x3e')]({},_0x2a48f0,_0x36bcca['options']);var _0x522806={'where':_0x2a48f0[_0x9655('0x3c')]};return db['FreshsalesField'][_0x9655('0x24')](_0x522806)[_0x9655('0x3f')](function(_0x264f24){_0x46d9bd[_0x9655('0x24')]=_0x264f24;if(_0x36bcca[_0x9655('0x34')][_0x9655('0x40')]){_0x2a48f0[_0x9655('0x41')]=[{'all':!![]}];}return db[_0x9655('0x42')][_0x9655('0x43')](_0x2a48f0);})[_0x9655('0x3f')](function(_0x950006){_0x46d9bd[_0x9655('0x44')]=_0x950006;return _0x46d9bd;})[_0x9655('0x3f')](respondWithFilteredResult(_0x8c3661,_0x2a48f0))['catch'](handleError(_0x8c3661,null));};exports[_0x9655('0x45')]=function(_0x9d9a56,_0x343144){var _0x5034ce={'raw':!![],'where':{'id':_0x9d9a56[_0x9655('0x46')]['id']}},_0xe13a5c={};_0xe13a5c[_0x9655('0x33')]=_[_0x9655('0x35')](db[_0x9655('0x42')][_0x9655('0x47')]);_0xe13a5c['query']=_[_0x9655('0x35')](_0x9d9a56['query']);_0xe13a5c['filters']=_[_0x9655('0x37')](_0xe13a5c[_0x9655('0x33')],_0xe13a5c[_0x9655('0x34')]);_0x5034ce['attributes']=_['intersection'](_0xe13a5c[_0x9655('0x33')],qs['fields'](_0x9d9a56['query'][_0x9655('0x48')]));_0x5034ce[_0x9655('0x38')]=_0x5034ce[_0x9655('0x38')][_0x9655('0x49')]?_0x5034ce[_0x9655('0x38')]:_0xe13a5c[_0x9655('0x33')];if(_0x9d9a56['query'][_0x9655('0x40')]){_0x5034ce[_0x9655('0x41')]=[{'all':!![]}];}_0x5034ce=_[_0x9655('0x3e')]({},_0x5034ce,_0x9d9a56[_0x9655('0x4a')]);return db[_0x9655('0x42')][_0x9655('0x4b')](_0x5034ce)[_0x9655('0x3f')](handleEntityNotFound(_0x343144,null))[_0x9655('0x3f')](respondWithResult(_0x343144,null))[_0x9655('0x4c')](handleError(_0x343144,null));};exports[_0x9655('0x4d')]=function(_0x471b12,_0x287bf2){return db[_0x9655('0x42')][_0x9655('0x4d')](_0x471b12[_0x9655('0x4e')],{})[_0x9655('0x3f')](respondWithResult(_0x287bf2,0xc9))['catch'](handleError(_0x287bf2,null));};exports[_0x9655('0x4f')]=function(_0x552360,_0x18d008){if(_0x552360[_0x9655('0x4e')]['id']){delete _0x552360[_0x9655('0x4e')]['id'];}return db['FreshsalesField'][_0x9655('0x4b')]({'where':{'id':_0x552360[_0x9655('0x46')]['id']}})[_0x9655('0x3f')](handleEntityNotFound(_0x18d008,null))[_0x9655('0x3f')](saveUpdates(_0x552360[_0x9655('0x4e')],null))['then'](respondWithResult(_0x18d008,null))['catch'](handleError(_0x18d008,null));};exports[_0x9655('0x29')]=function(_0x245bfe,_0x91741a){return db['FreshsalesField'][_0x9655('0x4b')]({'where':{'id':_0x245bfe[_0x9655('0x46')]['id']}})['then'](handleEntityNotFound(_0x91741a,null))['then'](removeEntity(_0x91741a,null))['catch'](handleError(_0x91741a,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index 220a615..e324bad 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 _0x4c99=['idField','FieldId','lodash','../../config/logger','request-promise','path','../../config/environment','./intFreshsalesField.attributes','int_freshsales_fields','freshsales_unique_index'];(function(_0x35d63e,_0x5cab15){var _0x34da15=function(_0x290925){while(--_0x290925){_0x35d63e['push'](_0x35d63e['shift']());}};_0x34da15(++_0x5cab15);}(_0x4c99,0x1ec));var _0x94c9=function(_0x2e4e19,_0x493b50){_0x2e4e19=_0x2e4e19-0x0;var _0x9ba20b=_0x4c99[_0x2e4e19];return _0x9ba20b;};'use strict';var _=require(_0x94c9('0x0'));var util=require('util');var logger=require(_0x94c9('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x94c9('0x2'));var fs=require('fs');var path=require(_0x94c9('0x3'));var rimraf=require('rimraf');var config=require(_0x94c9('0x4'));var attributes=require(_0x94c9('0x5'));module['exports']=function(_0x42d25e,_0x4e4ffd){return _0x42d25e['define']('FreshsalesField',attributes,{'tableName':_0x94c9('0x6'),'paranoid':![],'indexes':[{'name':_0x94c9('0x7'),'fields':[_0x94c9('0x8'),_0x94c9('0x9')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3f2e=['FieldId','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intFreshsalesField.attributes','freshsales_unique_index','idField'];(function(_0x1a3f6c,_0x2177cc){var _0x361953=function(_0x270019){while(--_0x270019){_0x1a3f6c['push'](_0x1a3f6c['shift']());}};_0x361953(++_0x2177cc);}(_0x3f2e,0x9d));var _0xe3f2=function(_0x4c5708,_0x34b1f9){_0x4c5708=_0x4c5708-0x0;var _0x37fa9b=_0x3f2e[_0x4c5708];return _0x37fa9b;};'use strict';var _=require(_0xe3f2('0x0'));var util=require('util');var logger=require(_0xe3f2('0x1'))(_0xe3f2('0x2'));var moment=require(_0xe3f2('0x3'));var BPromise=require(_0xe3f2('0x4'));var rp=require(_0xe3f2('0x5'));var fs=require('fs');var path=require(_0xe3f2('0x6'));var rimraf=require(_0xe3f2('0x7'));var config=require('../../config/environment');var attributes=require(_0xe3f2('0x8'));module['exports']=function(_0x7cdd2e,_0x2d6460){return _0x7cdd2e['define']('FreshsalesField',attributes,{'tableName':'int_freshsales_fields','paranoid':![],'indexes':[{'name':_0xe3f2('0x9'),'fields':[_0xe3f2('0xa'),_0xe3f2('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 8702663..6cd1bd7 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 _0xeff8=['util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','lodash'];(function(_0x71fe37,_0x35c623){var _0x1edffb=function(_0x24bc96){while(--_0x24bc96){_0x71fe37['push'](_0x71fe37['shift']());}};_0x1edffb(++_0x35c623);}(_0xeff8,0x186));var _0x8eff=function(_0xac151d,_0x4ea1d2){_0xac151d=_0xac151d-0x0;var _0x111dba=_0xeff8[_0xac151d];return _0x111dba;};'use strict';var _=require(_0x8eff('0x0'));var util=require(_0x8eff('0x1'));var moment=require('moment');var BPromise=require(_0x8eff('0x2'));var rs=require(_0x8eff('0x3'));var fs=require('fs');var Redis=require(_0x8eff('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x8eff('0x5'));var logger=require(_0x8eff('0x6'))(_0x8eff('0x7'));var config=require(_0x8eff('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x8eff('0x9')][_0x8eff('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3409bc,_0x323b2,_0x491f01){return new BPromise(function(_0x3fb9ee,_0x19557f){return client[_0x8eff('0xb')](_0x3409bc,_0x491f01)[_0x8eff('0xc')](function(_0x5bd403){logger['info'](_0x8eff('0xd'),_0x323b2,_0x8eff('0xe'));logger[_0x8eff('0xf')]('FreshsalesField,\x20%s,\x20%s,\x20%s',_0x323b2,_0x8eff('0xe'),JSON[_0x8eff('0x10')](_0x5bd403));if(_0x5bd403['error']){if(_0x5bd403[_0x8eff('0x11')][_0x8eff('0x12')]===0x1f4){logger['error']('FreshsalesField,\x20%s,\x20%s',_0x323b2,_0x5bd403[_0x8eff('0x11')][_0x8eff('0x13')]);return _0x19557f(_0x5bd403[_0x8eff('0x11')][_0x8eff('0x13')]);}logger[_0x8eff('0x11')]('FreshsalesField,\x20%s,\x20%s',_0x323b2,_0x5bd403[_0x8eff('0x11')][_0x8eff('0x13')]);return _0x3fb9ee(_0x5bd403[_0x8eff('0x11')][_0x8eff('0x13')]);}else{logger[_0x8eff('0x14')](_0x8eff('0xd'),_0x323b2,_0x8eff('0xe'));_0x3fb9ee(_0x5bd403[_0x8eff('0x15')][_0x8eff('0x13')]);}})[_0x8eff('0x16')](function(_0x137344){logger['error'](_0x8eff('0xd'),_0x323b2,_0x137344);_0x19557f(_0x137344);});});} \ No newline at end of file +var _0xeda8=['debug','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshsalesField,\x20%s,\x20%s','message','info','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent'];(function(_0x62364,_0x252bbc){var _0xd7de5a=function(_0x34b8da){while(--_0x34b8da){_0x62364['push'](_0x62364['shift']());}};_0xd7de5a(++_0x252bbc);}(_0xeda8,0x104));var _0x8eda=function(_0x3cef73,_0x3f43c5){_0x3cef73=_0x3cef73-0x0;var _0x5497d2=_0xeda8[_0x3cef73];return _0x5497d2;};'use strict';var _=require(_0x8eda('0x0'));var util=require(_0x8eda('0x1'));var moment=require('moment');var BPromise=require(_0x8eda('0x2'));var rs=require(_0x8eda('0x3'));var fs=require('fs');var Redis=require(_0x8eda('0x4'));var db=require(_0x8eda('0x5'))['db'];var utils=require(_0x8eda('0x6'));var logger=require(_0x8eda('0x7'))(_0x8eda('0x8'));var config=require(_0x8eda('0x9'));var jayson=require(_0x8eda('0xa'));var client=jayson[_0x8eda('0xb')][_0x8eda('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x32abe8,_0x4e2ebb,_0x28b721){return new BPromise(function(_0x1b6a1d,_0x5aa93d){return client[_0x8eda('0xd')](_0x32abe8,_0x28b721)['then'](function(_0x4f7893){logger['info']('FreshsalesField,\x20%s,\x20%s',_0x4e2ebb,_0x8eda('0xe'));logger[_0x8eda('0xf')](_0x8eda('0x10'),_0x4e2ebb,'request\x20sent',JSON[_0x8eda('0x11')](_0x4f7893));if(_0x4f7893['error']){if(_0x4f7893[_0x8eda('0x12')][_0x8eda('0x13')]===0x1f4){logger[_0x8eda('0x12')](_0x8eda('0x14'),_0x4e2ebb,_0x4f7893[_0x8eda('0x12')][_0x8eda('0x15')]);return _0x5aa93d(_0x4f7893[_0x8eda('0x12')][_0x8eda('0x15')]);}logger['error']('FreshsalesField,\x20%s,\x20%s',_0x4e2ebb,_0x4f7893[_0x8eda('0x12')][_0x8eda('0x15')]);return _0x1b6a1d(_0x4f7893['error'][_0x8eda('0x15')]);}else{logger[_0x8eda('0x16')](_0x8eda('0x14'),_0x4e2ebb,'request\x20sent');_0x1b6a1d(_0x4f7893[_0x8eda('0x17')]['message']);}})[_0x8eda('0x18')](function(_0x553382){logger[_0x8eda('0x12')]('FreshsalesField,\x20%s,\x20%s',_0x4e2ebb,_0x553382);_0x5aa93d(_0x553382);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index 9c00bdb..44649f0 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(_0x32f115,_0x56f838){var _0x2477df=function(_0x53dd22){while(--_0x53dd22){_0x32f115['push'](_0x32f115['shift']());}};_0x2477df(++_0x56f838);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file +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(_0x4a8941,_0x42af9c){var _0x4e8c67=function(_0x163f2a){while(--_0x163f2a){_0x4a8941['push'](_0x4a8941['shift']());}};_0x4e8c67(++_0x42af9c);}(_0xa9e0,0x123));var _0x0a9e=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0xa9e0[_0xae7c2f];return _0x5d7001;};'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 1b57ac4..c493976 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 _0x434a=['username','ENUM','integrationTab','sequelize','exports','STRING'];(function(_0x53fee4,_0x3c3021){var _0x3cdb68=function(_0x14a15f){while(--_0x14a15f){_0x53fee4['push'](_0x53fee4['shift']());}};_0x3cdb68(++_0x3c3021);}(_0x434a,0x9f));var _0xa434=function(_0x33330b,_0x5eb0c8){_0x33330b=_0x33330b-0x0;var _0x49a98c=_0x434a[_0x33330b];return _0x49a98c;};'use strict';var Sequelize=require(_0xa434('0x0'));module[_0xa434('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xa434('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0xa434('0x3')},'remoteUri':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xa434('0x2')]},'clientId':{'type':Sequelize[_0xa434('0x2')]},'clientSecret':{'type':Sequelize[_0xa434('0x2')]},'securityToken':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0xa434('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xa434('0x4')](_0xa434('0x5'),'newTab'),'defaultValue':_0xa434('0x5')}}; \ No newline at end of file +var _0x3445=['exports','STRING','username','ENUM','sequelize'];(function(_0x3baa7a,_0x3a97dc){var _0x3ff4fa=function(_0x2b60ce){while(--_0x2b60ce){_0x3baa7a['push'](_0x3baa7a['shift']());}};_0x3ff4fa(++_0x3a97dc);}(_0x3445,0x1b7));var _0x5344=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3445[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x5344('0x0'));module[_0x5344('0x1')]={'name':{'type':Sequelize[_0x5344('0x2')]},'description':{'type':Sequelize[_0x5344('0x2')]},'username':{'type':Sequelize[_0x5344('0x2')],'unique':_0x5344('0x3')},'remoteUri':{'type':Sequelize[_0x5344('0x2')]},'password':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0x5344('0x2')]},'securityToken':{'type':Sequelize[_0x5344('0x2')]},'serverUrl':{'type':Sequelize[_0x5344('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x5344('0x4')]('integrationTab','newTab'),'defaultValue':'integrationTab'}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index 2b42e97..37ad728 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 _0x8579=['status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','error','stack','name','send','index','map','SalesforceAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','then','includeAll','findAll','rows','catch','show','params','options','find','create','body','destroy','findOne','SalesforceConfiguration','order','getConfigurations','AccountId','getSubjects','channel','Descriptions','getDescriptions','Subjects','SalesforceField','getFields','Task','remoteUri','clientSecret','username','password','slice','substring','Connection','concat','securityToken','isNil','ticketType','sobject','describe','OwnerId','ActivityDate','IsRecurrence','Subject','Description','string','int','picklist','email','textarea','remove','includes','label','custom','picklistValues','value','boolean','True','true','False','false','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus'];(function(_0x1fa469,_0x5e19b1){var _0x22cc36=function(_0x4939bb){while(--_0x4939bb){_0x1fa469['push'](_0x1fa469['shift']());}};_0x22cc36(++_0x5e19b1);}(_0x8579,0x65));var _0x9857=function(_0x40b164,_0x47b205){_0x40b164=_0x40b164-0x0;var _0x3bde36=_0x8579[_0x40b164];return _0x3bde36;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9857('0x0'));var zipdir=require(_0x9857('0x1'));var jsonpatch=require(_0x9857('0x2'));var rp=require(_0x9857('0x3'));var moment=require(_0x9857('0x4'));var BPromise=require(_0x9857('0x5'));var Mustache=require(_0x9857('0x6'));var util=require(_0x9857('0x7'));var path=require(_0x9857('0x8'));var sox=require(_0x9857('0x9'));var csv=require(_0x9857('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9857('0xb'));var _=require('lodash');var squel=require(_0x9857('0xc'));var crypto=require(_0x9857('0xd'));var jsforce=require(_0x9857('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x9857('0xa'));var querystring=require(_0x9857('0xf'));var Papa=require(_0x9857('0x10'));var Redis=require(_0x9857('0x11'));var authService=require(_0x9857('0x12'));var qs=require(_0x9857('0x13'));var as=require(_0x9857('0x14'));var hardwareService=require(_0x9857('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x9857('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x9857('0x17'));var db=require(_0x9857('0x18'))['db'];var integrations=require(_0x9857('0x19'));function respondWithStatusCode(_0x22dad1,_0x1464dd){_0x1464dd=_0x1464dd||0xcc;return function(_0x41ebfb){if(_0x41ebfb){return _0x22dad1[_0x9857('0x1a')](_0x1464dd);}return _0x22dad1[_0x9857('0x1b')](_0x1464dd)[_0x9857('0x1c')]();};}function respondWithResult(_0x5ebb50,_0x14de48){_0x14de48=_0x14de48||0xc8;return function(_0x225001){if(_0x225001){return _0x5ebb50['status'](_0x14de48)[_0x9857('0x1d')](_0x225001);}};}function respondWithFilteredResult(_0x4032ea,_0x35f7a9){return function(_0x3f33d2){if(_0x3f33d2){var _0x1b733f=typeof _0x35f7a9[_0x9857('0x1e')]===_0x9857('0x1f')&&typeof _0x35f7a9['limit']==='undefined';var _0x3d9e96=_0x3f33d2[_0x9857('0x20')];var _0x29fc61=_0x1b733f?0x0:_0x35f7a9[_0x9857('0x1e')];var _0x3fe753=_0x1b733f?_0x3f33d2[_0x9857('0x20')]:_0x35f7a9[_0x9857('0x1e')]+_0x35f7a9[_0x9857('0x21')];var _0x1f6d6f;if(_0x3fe753>=_0x3d9e96){_0x3fe753=_0x3d9e96;_0x1f6d6f=0xc8;}else{_0x1f6d6f=0xce;}_0x4032ea[_0x9857('0x1b')](_0x1f6d6f);return _0x4032ea['set'](_0x9857('0x22'),_0x29fc61+'-'+_0x3fe753+'/'+_0x3d9e96)[_0x9857('0x1d')](_0x3f33d2);}return null;};}function patchUpdates(_0x3d5147){return function(_0xf7e567){try{jsonpatch[_0x9857('0x23')](_0xf7e567,_0x3d5147,!![]);}catch(_0x3bc0a7){return BPromise[_0x9857('0x24')](_0x3bc0a7);}return _0xf7e567[_0x9857('0x25')]();};}function saveUpdates(_0x2a753d,_0x17dd92){return function(_0x344c00){if(_0x344c00){return _0x344c00[_0x9857('0x26')](_0x2a753d)['then'](function(_0x59ebaf){return _0x59ebaf;});}return null;};}function removeEntity(_0x1f4d62,_0x3a8417){return function(_0x25105f){if(_0x25105f){return _0x25105f['destroy']()['then'](function(){_0x1f4d62['status'](0xcc)[_0x9857('0x1c')]();});}};}function handleEntityNotFound(_0x4d719e,_0x10fd16){return function(_0x1ef42d){if(!_0x1ef42d){_0x4d719e[_0x9857('0x1a')](0x194);}return _0x1ef42d;};}function handleError(_0x566b06,_0x5553fd){_0x5553fd=_0x5553fd||0x1f4;return function(_0x4b661a){logger[_0x9857('0x27')](_0x4b661a[_0x9857('0x28')]);if(_0x4b661a[_0x9857('0x29')]){delete _0x4b661a['name'];}_0x566b06[_0x9857('0x1b')](_0x5553fd)[_0x9857('0x2a')](_0x4b661a);};}exports[_0x9857('0x2b')]=function(_0x44a676,_0x2ef99e){var _0x3d88f7={},_0x4249a8={},_0x286072={'count':0x0,'rows':[]};var _0x208f57=_[_0x9857('0x2c')](db[_0x9857('0x2d')][_0x9857('0x2e')],function(_0x5f46e8){return{'name':_0x5f46e8[_0x9857('0x2f')],'type':_0x5f46e8[_0x9857('0x30')][_0x9857('0x31')]};});_0x4249a8[_0x9857('0x32')]=_[_0x9857('0x2c')](_0x208f57,'name');_0x4249a8[_0x9857('0x33')]=_[_0x9857('0x34')](_0x44a676['query']);_0x4249a8[_0x9857('0x35')]=_[_0x9857('0x36')](_0x4249a8['model'],_0x4249a8['query']);_0x3d88f7[_0x9857('0x37')]=_[_0x9857('0x36')](_0x4249a8[_0x9857('0x32')],qs[_0x9857('0x38')](_0x44a676[_0x9857('0x33')]['fields']));_0x3d88f7[_0x9857('0x37')]=_0x3d88f7[_0x9857('0x37')][_0x9857('0x39')]?_0x3d88f7[_0x9857('0x37')]:_0x4249a8[_0x9857('0x32')];if(!_0x44a676[_0x9857('0x33')][_0x9857('0x3a')]('nolimit')){_0x3d88f7[_0x9857('0x21')]=qs[_0x9857('0x21')](_0x44a676['query'][_0x9857('0x21')]);_0x3d88f7[_0x9857('0x1e')]=qs['offset'](_0x44a676[_0x9857('0x33')][_0x9857('0x1e')]);}_0x3d88f7['order']=qs['sort'](_0x44a676[_0x9857('0x33')][_0x9857('0x3b')]);_0x3d88f7[_0x9857('0x3c')]=qs[_0x9857('0x35')](_[_0x9857('0x3d')](_0x44a676[_0x9857('0x33')],_0x4249a8[_0x9857('0x35')]),_0x208f57);if(_0x44a676[_0x9857('0x33')][_0x9857('0x3e')]){_0x3d88f7[_0x9857('0x3c')]=_[_0x9857('0x3f')](_0x3d88f7['where'],{'$or':_[_0x9857('0x2c')](_0x208f57,function(_0x18b949){if(_0x18b949['type']!==_0x9857('0x40')){var _0x2ab53f={};_0x2ab53f[_0x18b949[_0x9857('0x29')]]={'$like':'%'+_0x44a676[_0x9857('0x33')][_0x9857('0x3e')]+'%'};return _0x2ab53f;}})});}_0x3d88f7=_[_0x9857('0x3f')]({},_0x3d88f7,_0x44a676['options']);var _0x4b4540={'where':_0x3d88f7[_0x9857('0x3c')]};return db[_0x9857('0x2d')][_0x9857('0x20')](_0x4b4540)[_0x9857('0x41')](function(_0x3d6f75){_0x286072['count']=_0x3d6f75;if(_0x44a676[_0x9857('0x33')][_0x9857('0x42')]){_0x3d88f7['include']=[{'all':!![]}];}return db[_0x9857('0x2d')][_0x9857('0x43')](_0x3d88f7);})[_0x9857('0x41')](function(_0x5142fa){_0x286072[_0x9857('0x44')]=_0x5142fa;return _0x286072;})[_0x9857('0x41')](respondWithFilteredResult(_0x2ef99e,_0x3d88f7))[_0x9857('0x45')](handleError(_0x2ef99e,null));};exports[_0x9857('0x46')]=function(_0x33eddd,_0x1a044){var _0x304e4e={'raw':![],'where':{'id':_0x33eddd[_0x9857('0x47')]['id']}},_0x4e0a6c={};_0x4e0a6c[_0x9857('0x32')]=_[_0x9857('0x34')](db[_0x9857('0x2d')][_0x9857('0x2e')]);_0x4e0a6c['query']=_[_0x9857('0x34')](_0x33eddd[_0x9857('0x33')]);_0x4e0a6c[_0x9857('0x35')]=_['intersection'](_0x4e0a6c[_0x9857('0x32')],_0x4e0a6c['query']);_0x304e4e[_0x9857('0x37')]=_[_0x9857('0x36')](_0x4e0a6c[_0x9857('0x32')],qs['fields'](_0x33eddd[_0x9857('0x33')][_0x9857('0x38')]));_0x304e4e['attributes']=_0x304e4e[_0x9857('0x37')][_0x9857('0x39')]?_0x304e4e['attributes']:_0x4e0a6c[_0x9857('0x32')];if(_0x33eddd[_0x9857('0x33')][_0x9857('0x42')]){_0x304e4e['include']=[{'all':!![]}];}_0x304e4e=_[_0x9857('0x3f')]({},_0x304e4e,_0x33eddd[_0x9857('0x48')]);return db[_0x9857('0x2d')][_0x9857('0x49')](_0x304e4e)['then'](handleEntityNotFound(_0x1a044,null))[_0x9857('0x41')](respondWithResult(_0x1a044,null))['catch'](handleError(_0x1a044,null));};exports[_0x9857('0x4a')]=function(_0x21ff06,_0x3f9f04){return db[_0x9857('0x2d')][_0x9857('0x4a')](_0x21ff06[_0x9857('0x4b')],{})[_0x9857('0x41')](respondWithResult(_0x3f9f04,0xc9))[_0x9857('0x45')](handleError(_0x3f9f04,null));};exports['update']=function(_0xc4e9b2,_0x2b13e3){if(_0xc4e9b2[_0x9857('0x4b')]['id']){delete _0xc4e9b2[_0x9857('0x4b')]['id'];}return db[_0x9857('0x2d')]['find']({'where':{'id':_0xc4e9b2[_0x9857('0x47')]['id']}})[_0x9857('0x41')](handleEntityNotFound(_0x2b13e3,null))[_0x9857('0x41')](saveUpdates(_0xc4e9b2[_0x9857('0x4b')],null))[_0x9857('0x41')](respondWithResult(_0x2b13e3,null))[_0x9857('0x45')](handleError(_0x2b13e3,null));};exports[_0x9857('0x4c')]=function(_0x1767cb,_0x460fc5){return db['SalesforceAccount'][_0x9857('0x49')]({'where':{'id':_0x1767cb['params']['id']}})[_0x9857('0x41')](handleEntityNotFound(_0x460fc5,null))[_0x9857('0x41')](removeEntity(_0x460fc5,null))['catch'](handleError(_0x460fc5,null));};exports['getConfigurations']=function(_0x3bc269,_0x398327,_0x4f9ed6){var _0x305113={};var _0x33a05c={};var _0x31b457;var _0x10c970;return db[_0x9857('0x2d')][_0x9857('0x4d')]({'where':{'id':_0x3bc269[_0x9857('0x47')]['id']}})[_0x9857('0x41')](handleEntityNotFound(_0x398327,null))[_0x9857('0x41')](function(_0x51656c){if(_0x51656c){_0x31b457=_0x51656c;_0x33a05c[_0x9857('0x32')]=_[_0x9857('0x34')](db[_0x9857('0x4e')][_0x9857('0x2e')]);_0x33a05c[_0x9857('0x33')]=_['keys'](_0x3bc269[_0x9857('0x33')]);_0x33a05c['filters']=_[_0x9857('0x36')](_0x33a05c['model'],_0x33a05c[_0x9857('0x33')]);_0x305113[_0x9857('0x37')]=_[_0x9857('0x36')](_0x33a05c[_0x9857('0x32')],qs[_0x9857('0x38')](_0x3bc269[_0x9857('0x33')][_0x9857('0x38')]));_0x305113[_0x9857('0x37')]=_0x305113[_0x9857('0x37')][_0x9857('0x39')]?_0x305113[_0x9857('0x37')]:_0x33a05c[_0x9857('0x32')];_0x305113[_0x9857('0x4f')]=qs[_0x9857('0x3b')](_0x3bc269['query'][_0x9857('0x3b')]);_0x305113[_0x9857('0x3c')]=qs['filters'](_['pick'](_0x3bc269[_0x9857('0x33')],_0x33a05c['filters']));if(_0x3bc269[_0x9857('0x33')]['filter']){_0x305113[_0x9857('0x3c')]=_[_0x9857('0x3f')](_0x305113[_0x9857('0x3c')],{'$or':_[_0x9857('0x2c')](_0x305113[_0x9857('0x37')],function(_0x2fceb1){var _0x4fedd8={};_0x4fedd8[_0x2fceb1]={'$like':'%'+_0x3bc269['query']['filter']+'%'};return _0x4fedd8;})});}_0x305113=_[_0x9857('0x3f')]({},_0x305113,_0x3bc269['options']);return _0x31b457[_0x9857('0x50')](_0x305113);}})[_0x9857('0x41')](function(_0x180ab6){if(_0x180ab6){_0x10c970=_0x180ab6[_0x9857('0x39')];if(!_0x3bc269[_0x9857('0x33')][_0x9857('0x3a')]('nolimit')){_0x305113[_0x9857('0x21')]=qs[_0x9857('0x21')](_0x3bc269[_0x9857('0x33')][_0x9857('0x21')]);_0x305113[_0x9857('0x1e')]=qs[_0x9857('0x1e')](_0x3bc269[_0x9857('0x33')][_0x9857('0x1e')]);}return _0x31b457['getConfigurations'](_0x305113);}})[_0x9857('0x41')](function(_0x55ecef){if(_0x55ecef){return _0x55ecef?{'count':_0x10c970,'rows':_0x55ecef}:null;}})[_0x9857('0x41')](respondWithResult(_0x398327,null))[_0x9857('0x45')](handleError(_0x398327,null));};exports['addConfiguration']=function(_0x44cfe9,_0x49d02d,_0x2ca72d){if(_0x44cfe9[_0x9857('0x4b')]['id']){delete _0x44cfe9[_0x9857('0x4b')]['id'];}return db[_0x9857('0x2d')][_0x9857('0x4d')]({'where':{'id':_0x44cfe9[_0x9857('0x47')]['id']}})['then'](handleEntityNotFound(_0x49d02d,null))[_0x9857('0x41')](function(_0x1394ed){if(_0x1394ed){_0x44cfe9['body'][_0x9857('0x51')]=_0x1394ed['id'];_0x44cfe9[_0x9857('0x4b')]['Subjects']=integrations[_0x9857('0x52')](_0x44cfe9[_0x9857('0x4b')][_0x9857('0x53')],_0x44cfe9[_0x9857('0x4b')][_0x9857('0x30')]);_0x44cfe9['body'][_0x9857('0x54')]=integrations[_0x9857('0x55')](_0x44cfe9[_0x9857('0x4b')]['channel'],_0x44cfe9[_0x9857('0x4b')][_0x9857('0x30')]);return db[_0x9857('0x4e')][_0x9857('0x4a')](_0x44cfe9['body'],{'include':[{'model':db['SalesforceField'],'as':_0x9857('0x56')},{'model':db[_0x9857('0x57')],'as':'Descriptions'}]});}return null;})[_0x9857('0x41')](respondWithResult(_0x49d02d,null))[_0x9857('0x45')](handleError(_0x49d02d,null));};exports[_0x9857('0x58')]=function(_0x2ea261,_0x22bf66,_0x5b5840){var _0xa8ab23;var _0x23d619='';var _0x37f949=_0x9857('0x59');return db['SalesforceAccount'][_0x9857('0x4d')]({'where':{'id':_0x2ea261['params']['id']},'attributes':['id',_0x9857('0x5a'),'clientId',_0x9857('0x5b'),_0x9857('0x5c'),_0x9857('0x5d'),'securityToken']})['then'](handleEntityNotFound(_0x22bf66,null))[_0x9857('0x41')](function(_0x33a43e){if(_0x33a43e){_0x23d619=_0x33a43e['remoteUri'];var _0x55afed=_0x23d619[_0x9857('0x5e')](-0x1);if(_0x55afed==='/'){_0x23d619=_0x23d619[_0x9857('0x5f')](0x0,_0x23d619['lastIndexOf'](_0x55afed));}_0xa8ab23=new jsforce[(_0x9857('0x60'))]({'oauth2':{'loginUrl':_0x23d619,'clientId':_0x33a43e['clientId'],'clientSecret':_0x33a43e[_0x9857('0x5b')]}});return _0xa8ab23['login'](_0x33a43e['username'],_0x33a43e['password'][_0x9857('0x61')](_0x33a43e[_0x9857('0x62')]));}})[_0x9857('0x41')](function(_0x1cfe83){if(_0x1cfe83){if(!_[_0x9857('0x63')](_0x2ea261[_0x9857('0x33')][_0x9857('0x64')])){_0x37f949=_0x2ea261[_0x9857('0x33')][_0x9857('0x64')];}return _0xa8ab23[_0x9857('0x65')](_0x37f949)[_0x9857('0x66')]();}})[_0x9857('0x41')](function(_0x28f5d8){var _0x296e6a=[_0x9857('0x67'),_0x9857('0x68'),'IsReminderSet',_0x9857('0x69'),_0x9857('0x6a'),_0x9857('0x6b')];var _0x57d59c=[_0x9857('0x6c'),_0x9857('0x6d'),_0x9857('0x6e'),'boolean',_0x9857('0x6f'),_0x9857('0x70'),'phone'];if(_0x28f5d8){_[_0x9857('0x71')](_0x28f5d8['fields'],function(_0x1299e0){return _0x296e6a[_0x9857('0x72')](_0x1299e0[_0x9857('0x29')])||!_0x57d59c['includes'](_0x1299e0['type']);});return{'count':_0x28f5d8[_0x9857('0x38')][_0x9857('0x39')],'rows':_[_0x9857('0x2c')](_0x28f5d8[_0x9857('0x38')],function(_0x153ea4){return{'id':_0x153ea4[_0x9857('0x29')],'name':_0x153ea4[_0x9857('0x73')],'custom':_0x153ea4[_0x9857('0x74')],'options':_0x153ea4[_0x9857('0x75')][_0x9857('0x39')]>0x0?_['map'](_0x153ea4[_0x9857('0x75')],function(_0x5ce153){return{'name':_0x5ce153[_0x9857('0x73')],'value':_0x5ce153[_0x9857('0x76')]};}):_0x153ea4[_0x9857('0x30')]==_0x9857('0x77')?[{'name':_0x9857('0x78'),'value':_0x9857('0x79')},{'name':_0x9857('0x7a'),'value':_0x9857('0x7b')}]:[]};})};}})[_0x9857('0x41')](respondWithResult(_0x22bf66,null))['catch'](function(_0x90448b){var _0xe5d23d=_0x2ea261['query'][_0x9857('0x7c')]?0x1f4:_0x90448b[_0x9857('0x7d')]||0x1f4;logger['error'](_0x9857('0x7e'),_0x9857('0x58'),_0xe5d23d,JSON['stringify'](_0x90448b));delete _0x90448b[_0x9857('0x29')];if(_0xe5d23d===0x191){_0xe5d23d=0x190;}_0x22bf66[_0x9857('0x1b')](_0xe5d23d)['send'](_0x2ea261['query'][_0x9857('0x7c')]?{'message':_0x9857('0x7f'),'statusCode':_0x90448b[_0x9857('0x7d')]}:_0x90448b);});}; \ No newline at end of file +var _0x07b3=['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','api','../../config/utils','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','reject','update','destroy','then','error','stack','name','index','map','SalesforceAccount','rawAttributes','fieldName','type','query','keys','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','pick','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','params','intersection','include','find','create','body','getConfigurations','findOne','SalesforceConfiguration','order','filter','getSubjects','Descriptions','getDescriptions','channel','Subjects','SalesforceField','getFields','Task','remoteUri','clientId','clientSecret','slice','substring','lastIndexOf','login','username','concat','securityToken','isNil','ticketType','describe','OwnerId','IsRecurrence','Subject','string','int','picklist','email','phone','remove','includes','label','custom','picklistValues','True','False','false','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','send','Wrong\x20credentials','eml-format'];(function(_0x134b89,_0x258dc3){var _0x864c08=function(_0xe01ef){while(--_0xe01ef){_0x134b89['push'](_0x134b89['shift']());}};_0x864c08(++_0x258dc3);}(_0x07b3,0x167));var _0x307b=function(_0x304976,_0x14432b){_0x304976=_0x304976-0x0;var _0xb73047=_0x07b3[_0x304976];return _0xb73047;};'use strict';var emlformat=require(_0x307b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x307b('0x1'));var jsonpatch=require(_0x307b('0x2'));var rp=require(_0x307b('0x3'));var moment=require(_0x307b('0x4'));var BPromise=require(_0x307b('0x5'));var Mustache=require('mustache');var util=require(_0x307b('0x6'));var path=require(_0x307b('0x7'));var sox=require(_0x307b('0x8'));var csv=require(_0x307b('0x9'));var ejs=require(_0x307b('0xa'));var fs=require('fs');var fs_extra=require(_0x307b('0xb'));var _=require(_0x307b('0xc'));var squel=require(_0x307b('0xd'));var crypto=require(_0x307b('0xe'));var jsforce=require(_0x307b('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x307b('0x9'));var querystring=require('querystring');var Papa=require(_0x307b('0x10'));var Redis=require('ioredis');var authService=require(_0x307b('0x11'));var qs=require(_0x307b('0x12'));var as=require(_0x307b('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x307b('0x14'));var utils=require(_0x307b('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x307b('0x16'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x583eaf,_0x326f88){_0x326f88=_0x326f88||0xcc;return function(_0x323fa5){if(_0x323fa5){return _0x583eaf[_0x307b('0x17')](_0x326f88);}return _0x583eaf[_0x307b('0x18')](_0x326f88)[_0x307b('0x19')]();};}function respondWithResult(_0xe023ac,_0x46258a){_0x46258a=_0x46258a||0xc8;return function(_0x145573){if(_0x145573){return _0xe023ac[_0x307b('0x18')](_0x46258a)['json'](_0x145573);}};}function respondWithFilteredResult(_0x20c721,_0x47570f){return function(_0x59c3d9){if(_0x59c3d9){var _0x316c2c=typeof _0x47570f['offset']===_0x307b('0x1a')&&typeof _0x47570f[_0x307b('0x1b')]===_0x307b('0x1a');var _0x457daa=_0x59c3d9[_0x307b('0x1c')];var _0x48e49d=_0x316c2c?0x0:_0x47570f[_0x307b('0x1d')];var _0x3e39d7=_0x316c2c?_0x59c3d9[_0x307b('0x1c')]:_0x47570f[_0x307b('0x1d')]+_0x47570f[_0x307b('0x1b')];var _0x3e86d2;if(_0x3e39d7>=_0x457daa){_0x3e39d7=_0x457daa;_0x3e86d2=0xc8;}else{_0x3e86d2=0xce;}_0x20c721['status'](_0x3e86d2);return _0x20c721[_0x307b('0x1e')](_0x307b('0x1f'),_0x48e49d+'-'+_0x3e39d7+'/'+_0x457daa)[_0x307b('0x20')](_0x59c3d9);}return null;};}function patchUpdates(_0xef5c1b){return function(_0x6e0151){try{jsonpatch[_0x307b('0x21')](_0x6e0151,_0xef5c1b,!![]);}catch(_0x5e936e){return BPromise[_0x307b('0x22')](_0x5e936e);}return _0x6e0151['save']();};}function saveUpdates(_0x2091b0,_0x14ead0){return function(_0x3e21fb){if(_0x3e21fb){return _0x3e21fb[_0x307b('0x23')](_0x2091b0)['then'](function(_0x1e355a){return _0x1e355a;});}return null;};}function removeEntity(_0x14a822,_0x466194){return function(_0x49653c){if(_0x49653c){return _0x49653c[_0x307b('0x24')]()[_0x307b('0x25')](function(){_0x14a822[_0x307b('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x37d0d6,_0x3a40a5){return function(_0x4f60fd){if(!_0x4f60fd){_0x37d0d6['sendStatus'](0x194);}return _0x4f60fd;};}function handleError(_0x1cd4a3,_0x22834b){_0x22834b=_0x22834b||0x1f4;return function(_0x33a3d4){logger[_0x307b('0x26')](_0x33a3d4[_0x307b('0x27')]);if(_0x33a3d4['name']){delete _0x33a3d4[_0x307b('0x28')];}_0x1cd4a3[_0x307b('0x18')](_0x22834b)['send'](_0x33a3d4);};}exports[_0x307b('0x29')]=function(_0x27dffc,_0x282f45){var _0x5a82e3={},_0x407258={},_0x3db254={'count':0x0,'rows':[]};var _0x2b47d5=_[_0x307b('0x2a')](db[_0x307b('0x2b')][_0x307b('0x2c')],function(_0x397965){return{'name':_0x397965[_0x307b('0x2d')],'type':_0x397965[_0x307b('0x2e')]['key']};});_0x407258['model']=_[_0x307b('0x2a')](_0x2b47d5,_0x307b('0x28'));_0x407258[_0x307b('0x2f')]=_[_0x307b('0x30')](_0x27dffc[_0x307b('0x2f')]);_0x407258['filters']=_['intersection'](_0x407258[_0x307b('0x31')],_0x407258[_0x307b('0x2f')]);_0x5a82e3['attributes']=_['intersection'](_0x407258['model'],qs[_0x307b('0x32')](_0x27dffc[_0x307b('0x2f')]['fields']));_0x5a82e3['attributes']=_0x5a82e3[_0x307b('0x33')][_0x307b('0x34')]?_0x5a82e3['attributes']:_0x407258[_0x307b('0x31')];if(!_0x27dffc['query'][_0x307b('0x35')](_0x307b('0x36'))){_0x5a82e3[_0x307b('0x1b')]=qs[_0x307b('0x1b')](_0x27dffc[_0x307b('0x2f')][_0x307b('0x1b')]);_0x5a82e3[_0x307b('0x1d')]=qs[_0x307b('0x1d')](_0x27dffc[_0x307b('0x2f')]['offset']);}_0x5a82e3['order']=qs['sort'](_0x27dffc[_0x307b('0x2f')][_0x307b('0x37')]);_0x5a82e3[_0x307b('0x38')]=qs[_0x307b('0x39')](_[_0x307b('0x3a')](_0x27dffc[_0x307b('0x2f')],_0x407258['filters']),_0x2b47d5);if(_0x27dffc[_0x307b('0x2f')]['filter']){_0x5a82e3[_0x307b('0x38')]=_['merge'](_0x5a82e3[_0x307b('0x38')],{'$or':_[_0x307b('0x2a')](_0x2b47d5,function(_0x593014){if(_0x593014[_0x307b('0x2e')]!==_0x307b('0x3b')){var _0x58f19c={};_0x58f19c[_0x593014[_0x307b('0x28')]]={'$like':'%'+_0x27dffc[_0x307b('0x2f')]['filter']+'%'};return _0x58f19c;}})});}_0x5a82e3=_[_0x307b('0x3c')]({},_0x5a82e3,_0x27dffc[_0x307b('0x3d')]);var _0x552069={'where':_0x5a82e3[_0x307b('0x38')]};return db['SalesforceAccount'][_0x307b('0x1c')](_0x552069)[_0x307b('0x25')](function(_0x596020){_0x3db254[_0x307b('0x1c')]=_0x596020;if(_0x27dffc[_0x307b('0x2f')][_0x307b('0x3e')]){_0x5a82e3['include']=[{'all':!![]}];}return db[_0x307b('0x2b')][_0x307b('0x3f')](_0x5a82e3);})[_0x307b('0x25')](function(_0xa9796e){_0x3db254[_0x307b('0x40')]=_0xa9796e;return _0x3db254;})[_0x307b('0x25')](respondWithFilteredResult(_0x282f45,_0x5a82e3))[_0x307b('0x41')](handleError(_0x282f45,null));};exports[_0x307b('0x42')]=function(_0x550f7d,_0x4db94d){var _0x3b145b={'raw':![],'where':{'id':_0x550f7d[_0x307b('0x43')]['id']}},_0x105231={};_0x105231[_0x307b('0x31')]=_[_0x307b('0x30')](db[_0x307b('0x2b')][_0x307b('0x2c')]);_0x105231['query']=_[_0x307b('0x30')](_0x550f7d[_0x307b('0x2f')]);_0x105231['filters']=_[_0x307b('0x44')](_0x105231['model'],_0x105231['query']);_0x3b145b[_0x307b('0x33')]=_[_0x307b('0x44')](_0x105231[_0x307b('0x31')],qs[_0x307b('0x32')](_0x550f7d[_0x307b('0x2f')][_0x307b('0x32')]));_0x3b145b[_0x307b('0x33')]=_0x3b145b[_0x307b('0x33')][_0x307b('0x34')]?_0x3b145b[_0x307b('0x33')]:_0x105231[_0x307b('0x31')];if(_0x550f7d[_0x307b('0x2f')][_0x307b('0x3e')]){_0x3b145b[_0x307b('0x45')]=[{'all':!![]}];}_0x3b145b=_['merge']({},_0x3b145b,_0x550f7d[_0x307b('0x3d')]);return db[_0x307b('0x2b')][_0x307b('0x46')](_0x3b145b)[_0x307b('0x25')](handleEntityNotFound(_0x4db94d,null))[_0x307b('0x25')](respondWithResult(_0x4db94d,null))[_0x307b('0x41')](handleError(_0x4db94d,null));};exports[_0x307b('0x47')]=function(_0x240f89,_0x149d1f){return db['SalesforceAccount'][_0x307b('0x47')](_0x240f89[_0x307b('0x48')],{})[_0x307b('0x25')](respondWithResult(_0x149d1f,0xc9))['catch'](handleError(_0x149d1f,null));};exports['update']=function(_0x58e91d,_0x3b2f99){if(_0x58e91d[_0x307b('0x48')]['id']){delete _0x58e91d[_0x307b('0x48')]['id'];}return db[_0x307b('0x2b')]['find']({'where':{'id':_0x58e91d[_0x307b('0x43')]['id']}})['then'](handleEntityNotFound(_0x3b2f99,null))[_0x307b('0x25')](saveUpdates(_0x58e91d['body'],null))[_0x307b('0x25')](respondWithResult(_0x3b2f99,null))[_0x307b('0x41')](handleError(_0x3b2f99,null));};exports[_0x307b('0x24')]=function(_0x37bb74,_0x2530c6){return db['SalesforceAccount']['find']({'where':{'id':_0x37bb74['params']['id']}})[_0x307b('0x25')](handleEntityNotFound(_0x2530c6,null))[_0x307b('0x25')](removeEntity(_0x2530c6,null))[_0x307b('0x41')](handleError(_0x2530c6,null));};exports[_0x307b('0x49')]=function(_0x4fb63b,_0x18dfa3,_0x3c7db8){var _0x1e3d89={};var _0x4365d4={};var _0x497962;var _0x629906;return db[_0x307b('0x2b')][_0x307b('0x4a')]({'where':{'id':_0x4fb63b[_0x307b('0x43')]['id']}})['then'](handleEntityNotFound(_0x18dfa3,null))[_0x307b('0x25')](function(_0xd7bac0){if(_0xd7bac0){_0x497962=_0xd7bac0;_0x4365d4[_0x307b('0x31')]=_[_0x307b('0x30')](db[_0x307b('0x4b')]['rawAttributes']);_0x4365d4['query']=_['keys'](_0x4fb63b[_0x307b('0x2f')]);_0x4365d4[_0x307b('0x39')]=_[_0x307b('0x44')](_0x4365d4['model'],_0x4365d4['query']);_0x1e3d89[_0x307b('0x33')]=_[_0x307b('0x44')](_0x4365d4['model'],qs[_0x307b('0x32')](_0x4fb63b[_0x307b('0x2f')]['fields']));_0x1e3d89['attributes']=_0x1e3d89[_0x307b('0x33')][_0x307b('0x34')]?_0x1e3d89[_0x307b('0x33')]:_0x4365d4[_0x307b('0x31')];_0x1e3d89[_0x307b('0x4c')]=qs[_0x307b('0x37')](_0x4fb63b[_0x307b('0x2f')][_0x307b('0x37')]);_0x1e3d89[_0x307b('0x38')]=qs[_0x307b('0x39')](_[_0x307b('0x3a')](_0x4fb63b['query'],_0x4365d4[_0x307b('0x39')]));if(_0x4fb63b['query'][_0x307b('0x4d')]){_0x1e3d89[_0x307b('0x38')]=_[_0x307b('0x3c')](_0x1e3d89[_0x307b('0x38')],{'$or':_[_0x307b('0x2a')](_0x1e3d89['attributes'],function(_0x514383){var _0x442c1d={};_0x442c1d[_0x514383]={'$like':'%'+_0x4fb63b[_0x307b('0x2f')]['filter']+'%'};return _0x442c1d;})});}_0x1e3d89=_[_0x307b('0x3c')]({},_0x1e3d89,_0x4fb63b[_0x307b('0x3d')]);return _0x497962[_0x307b('0x49')](_0x1e3d89);}})[_0x307b('0x25')](function(_0x9c64f1){if(_0x9c64f1){_0x629906=_0x9c64f1['length'];if(!_0x4fb63b[_0x307b('0x2f')][_0x307b('0x35')](_0x307b('0x36'))){_0x1e3d89[_0x307b('0x1b')]=qs[_0x307b('0x1b')](_0x4fb63b[_0x307b('0x2f')][_0x307b('0x1b')]);_0x1e3d89[_0x307b('0x1d')]=qs[_0x307b('0x1d')](_0x4fb63b[_0x307b('0x2f')][_0x307b('0x1d')]);}return _0x497962[_0x307b('0x49')](_0x1e3d89);}})[_0x307b('0x25')](function(_0x2e857e){if(_0x2e857e){return _0x2e857e?{'count':_0x629906,'rows':_0x2e857e}:null;}})['then'](respondWithResult(_0x18dfa3,null))[_0x307b('0x41')](handleError(_0x18dfa3,null));};exports['addConfiguration']=function(_0x2780c2,_0x364105,_0x461b02){if(_0x2780c2['body']['id']){delete _0x2780c2['body']['id'];}return db[_0x307b('0x2b')]['findOne']({'where':{'id':_0x2780c2[_0x307b('0x43')]['id']}})['then'](handleEntityNotFound(_0x364105,null))[_0x307b('0x25')](function(_0x1ea1d1){if(_0x1ea1d1){_0x2780c2[_0x307b('0x48')]['AccountId']=_0x1ea1d1['id'];_0x2780c2['body']['Subjects']=integrations[_0x307b('0x4e')](_0x2780c2[_0x307b('0x48')]['channel'],_0x2780c2[_0x307b('0x48')]['type']);_0x2780c2['body'][_0x307b('0x4f')]=integrations[_0x307b('0x50')](_0x2780c2[_0x307b('0x48')][_0x307b('0x51')],_0x2780c2[_0x307b('0x48')][_0x307b('0x2e')]);return db['SalesforceConfiguration'][_0x307b('0x47')](_0x2780c2['body'],{'include':[{'model':db['SalesforceField'],'as':_0x307b('0x52')},{'model':db[_0x307b('0x53')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x364105,null))[_0x307b('0x41')](handleError(_0x364105,null));};exports[_0x307b('0x54')]=function(_0x275978,_0x241e07,_0x378221){var _0x339c74;var _0x29092d='';var _0x5c9acf=_0x307b('0x55');return db[_0x307b('0x2b')][_0x307b('0x4a')]({'where':{'id':_0x275978[_0x307b('0x43')]['id']},'attributes':['id',_0x307b('0x56'),_0x307b('0x57'),_0x307b('0x58'),'username','password','securityToken']})[_0x307b('0x25')](handleEntityNotFound(_0x241e07,null))[_0x307b('0x25')](function(_0x40364f){if(_0x40364f){_0x29092d=_0x40364f[_0x307b('0x56')];var _0x2edc07=_0x29092d[_0x307b('0x59')](-0x1);if(_0x2edc07==='/'){_0x29092d=_0x29092d[_0x307b('0x5a')](0x0,_0x29092d[_0x307b('0x5b')](_0x2edc07));}_0x339c74=new jsforce['Connection']({'oauth2':{'loginUrl':_0x29092d,'clientId':_0x40364f[_0x307b('0x57')],'clientSecret':_0x40364f[_0x307b('0x58')]}});return _0x339c74[_0x307b('0x5c')](_0x40364f[_0x307b('0x5d')],_0x40364f['password'][_0x307b('0x5e')](_0x40364f[_0x307b('0x5f')]));}})[_0x307b('0x25')](function(_0x41c209){if(_0x41c209){if(!_[_0x307b('0x60')](_0x275978[_0x307b('0x2f')][_0x307b('0x61')])){_0x5c9acf=_0x275978[_0x307b('0x2f')]['ticketType'];}return _0x339c74['sobject'](_0x5c9acf)[_0x307b('0x62')]();}})[_0x307b('0x25')](function(_0xec367a){var _0x5146c6=[_0x307b('0x63'),'ActivityDate','IsReminderSet',_0x307b('0x64'),_0x307b('0x65'),'Description'];var _0x28250f=[_0x307b('0x66'),_0x307b('0x67'),_0x307b('0x68'),'boolean',_0x307b('0x69'),'textarea',_0x307b('0x6a')];if(_0xec367a){_[_0x307b('0x6b')](_0xec367a['fields'],function(_0x40dcbd){return _0x5146c6[_0x307b('0x6c')](_0x40dcbd[_0x307b('0x28')])||!_0x28250f[_0x307b('0x6c')](_0x40dcbd[_0x307b('0x2e')]);});return{'count':_0xec367a[_0x307b('0x32')][_0x307b('0x34')],'rows':_['map'](_0xec367a[_0x307b('0x32')],function(_0x47041e){return{'id':_0x47041e[_0x307b('0x28')],'name':_0x47041e[_0x307b('0x6d')],'custom':_0x47041e[_0x307b('0x6e')],'options':_0x47041e[_0x307b('0x6f')][_0x307b('0x34')]>0x0?_[_0x307b('0x2a')](_0x47041e[_0x307b('0x6f')],function(_0x4a0780){return{'name':_0x4a0780[_0x307b('0x6d')],'value':_0x4a0780['value']};}):_0x47041e[_0x307b('0x2e')]=='boolean'?[{'name':_0x307b('0x70'),'value':'true'},{'name':_0x307b('0x71'),'value':_0x307b('0x72')}]:[]};})};}})[_0x307b('0x25')](respondWithResult(_0x241e07,null))[_0x307b('0x41')](function(_0x389d3b){var _0xfa7ffe=_0x275978[_0x307b('0x2f')][_0x307b('0x73')]?0x1f4:_0x389d3b[_0x307b('0x74')]||0x1f4;logger[_0x307b('0x26')](_0x307b('0x75'),_0x307b('0x54'),_0xfa7ffe,JSON['stringify'](_0x389d3b));delete _0x389d3b['name'];if(_0xfa7ffe===0x191){_0xfa7ffe=0x190;}_0x241e07['status'](_0xfa7ffe)[_0x307b('0x76')](_0x275978[_0x307b('0x2f')][_0x307b('0x73')]?{'message':_0x307b('0x77'),'statusCode':_0x389d3b['statusCode']}:_0x389d3b);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index 14d3d87..e95321a 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 _0x0913=['define','SalesforceAccount','int_salesforce_accounts','lodash','util','../../config/logger','bluebird','request-promise','path','../../config/environment','./intSalesforceAccount.attributes','exports'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x0913,0x10b));var _0x3091=function(_0x2a223d,_0xb934f4){_0x2a223d=_0x2a223d-0x0;var _0x5217c2=_0x0913[_0x2a223d];return _0x5217c2;};'use strict';var _=require(_0x3091('0x0'));var util=require(_0x3091('0x1'));var logger=require(_0x3091('0x2'))('api');var moment=require('moment');var BPromise=require(_0x3091('0x3'));var rp=require(_0x3091('0x4'));var fs=require('fs');var path=require(_0x3091('0x5'));var rimraf=require('rimraf');var config=require(_0x3091('0x6'));var attributes=require(_0x3091('0x7'));var integrations=require('../../components/integrations/configuration');module[_0x3091('0x8')]=function(_0x47ab49,_0x5b8a9c){return _0x47ab49[_0x3091('0x9')](_0x3091('0xa'),attributes,{'tableName':_0x3091('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd51f=['lodash','util','api','moment','request-promise','path','../../config/environment','./intSalesforceAccount.attributes','exports','define','SalesforceAccount','int_salesforce_accounts'];(function(_0x6cfb8a,_0x53be6f){var _0x29ba1d=function(_0x104303){while(--_0x104303){_0x6cfb8a['push'](_0x6cfb8a['shift']());}};_0x29ba1d(++_0x53be6f);}(_0xd51f,0xf0));var _0xfd51=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xd51f[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0xfd51('0x0'));var util=require(_0xfd51('0x1'));var logger=require('../../config/logger')(_0xfd51('0x2'));var moment=require(_0xfd51('0x3'));var BPromise=require('bluebird');var rp=require(_0xfd51('0x4'));var fs=require('fs');var path=require(_0xfd51('0x5'));var rimraf=require('rimraf');var config=require(_0xfd51('0x6'));var attributes=require(_0xfd51('0x7'));var integrations=require('../../components/integrations/configuration');module[_0xfd51('0x8')]=function(_0x3a2cd4,_0x5dc337){return _0x3a2cd4[_0xfd51('0x9')](_0xfd51('0xa'),attributes,{'tableName':_0xfd51('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 c61e277..53b352c 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 _0x8a83=['http','request','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','GetSalesforceAccount','findAll','options','raw','where','limit','map','include','model','attributes','debug','catch','ShowSalesforceAccount','SalesforceAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x3199eb,_0x39132f){var _0x4a3b11=function(_0x13ac6a){while(--_0x13ac6a){_0x3199eb['push'](_0x3199eb['shift']());}};_0x4a3b11(++_0x39132f);}(_0x8a83,0x1b0));var _0x38a8=function(_0x3f94f9,_0x42774b){_0x3f94f9=_0x3f94f9-0x0;var _0x46f84f=_0x8a83[_0x3f94f9];return _0x46f84f;};'use strict';var _=require(_0x38a8('0x0'));var util=require(_0x38a8('0x1'));var moment=require(_0x38a8('0x2'));var BPromise=require(_0x38a8('0x3'));var rs=require(_0x38a8('0x4'));var fs=require('fs');var Redis=require(_0x38a8('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x38a8('0x6'));var logger=require(_0x38a8('0x7'))(_0x38a8('0x8'));var config=require(_0x38a8('0x9'));var jayson=require(_0x38a8('0xa'));var client=jayson[_0x38a8('0xb')][_0x38a8('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x395f81,_0x83f145,_0x2006ec){return new BPromise(function(_0x1cf4d0,_0x3aa21a){return client[_0x38a8('0xd')](_0x395f81,_0x2006ec)[_0x38a8('0xe')](function(_0x2ab7b7){logger[_0x38a8('0xf')](_0x38a8('0x10'),_0x83f145,_0x38a8('0x11'));logger['debug'](_0x38a8('0x12'),_0x83f145,_0x38a8('0x11'),JSON[_0x38a8('0x13')](_0x2ab7b7));if(_0x2ab7b7['error']){if(_0x2ab7b7[_0x38a8('0x14')][_0x38a8('0x15')]===0x1f4){logger[_0x38a8('0x14')](_0x38a8('0x10'),_0x83f145,_0x2ab7b7[_0x38a8('0x14')][_0x38a8('0x16')]);return _0x3aa21a(_0x2ab7b7['error']['message']);}logger[_0x38a8('0x14')](_0x38a8('0x10'),_0x83f145,_0x2ab7b7['error'][_0x38a8('0x16')]);return _0x1cf4d0(_0x2ab7b7[_0x38a8('0x14')][_0x38a8('0x16')]);}else{logger[_0x38a8('0xf')](_0x38a8('0x10'),_0x83f145,_0x38a8('0x11'));_0x1cf4d0(_0x2ab7b7['result'][_0x38a8('0x16')]);}})['catch'](function(_0x44a961){logger[_0x38a8('0x14')]('SalesforceAccount,\x20%s,\x20%s',_0x83f145,_0x44a961);_0x3aa21a(_0x44a961);});});}exports[_0x38a8('0x17')]=function(_0x5822fc){var _0x5a370b=this;return new Promise(function(_0x7f3ada,_0x425b47){return db['SalesforceAccount'][_0x38a8('0x18')]({'raw':_0x5822fc['options']?_0x5822fc[_0x38a8('0x19')][_0x38a8('0x1a')]===undefined?!![]:![]:!![],'where':_0x5822fc[_0x38a8('0x19')]?_0x5822fc[_0x38a8('0x19')][_0x38a8('0x1b')]||null:null,'attributes':_0x5822fc[_0x38a8('0x19')]?_0x5822fc['options']['attributes']||null:null,'limit':_0x5822fc['options']?_0x5822fc[_0x38a8('0x19')][_0x38a8('0x1c')]||null:null,'include':_0x5822fc[_0x38a8('0x19')]?_0x5822fc[_0x38a8('0x19')]['include']?_[_0x38a8('0x1d')](_0x5822fc[_0x38a8('0x19')][_0x38a8('0x1e')],function(_0x26659c){return{'model':db[_0x26659c[_0x38a8('0x1f')]],'as':_0x26659c['as'],'attributes':_0x26659c[_0x38a8('0x20')],'include':_0x26659c[_0x38a8('0x1e')]?_['map'](_0x26659c[_0x38a8('0x1e')],function(_0x19fd55){return{'model':db[_0x19fd55[_0x38a8('0x1f')]],'as':_0x19fd55['as'],'attributes':_0x19fd55[_0x38a8('0x20')],'include':_0x19fd55[_0x38a8('0x1e')]?_['map'](_0x19fd55[_0x38a8('0x1e')],function(_0x18ae35){return{'model':db[_0x18ae35[_0x38a8('0x1f')]],'as':_0x18ae35['as'],'attributes':_0x18ae35['attributes']};}):[]};}):[]};}):[]:[]})[_0x38a8('0xe')](function(_0x379397){logger['info'](_0x38a8('0x17'),_0x5822fc);logger[_0x38a8('0x21')](_0x38a8('0x17'),_0x5822fc,JSON['stringify'](_0x379397));_0x7f3ada(_0x379397);})[_0x38a8('0x22')](function(_0x27ede2){logger['error'](_0x38a8('0x17'),_0x27ede2[_0x38a8('0x16')],_0x5822fc);_0x425b47(_0x5a370b[_0x38a8('0x14')](0x1f4,_0x27ede2[_0x38a8('0x16')]));});});};exports[_0x38a8('0x23')]=function(_0x11e3eb){var _0x51a020=this;return new Promise(function(_0x53fb2d,_0x4aaa72){return db[_0x38a8('0x24')]['find']({'raw':_0x11e3eb['options']?_0x11e3eb[_0x38a8('0x19')][_0x38a8('0x1a')]===undefined?!![]:![]:!![],'where':_0x11e3eb[_0x38a8('0x19')]?_0x11e3eb[_0x38a8('0x19')][_0x38a8('0x1b')]||null:null,'attributes':_0x11e3eb['options']?_0x11e3eb['options'][_0x38a8('0x20')]||null:null,'include':_0x11e3eb[_0x38a8('0x19')]?_0x11e3eb[_0x38a8('0x19')][_0x38a8('0x1e')]?_[_0x38a8('0x1d')](_0x11e3eb[_0x38a8('0x19')][_0x38a8('0x1e')],function(_0x3b14e8){return{'model':db[_0x3b14e8['model']],'as':_0x3b14e8['as'],'attributes':_0x3b14e8['attributes'],'include':_0x3b14e8[_0x38a8('0x1e')]?_[_0x38a8('0x1d')](_0x3b14e8['include'],function(_0x3145ee){return{'model':db[_0x3145ee[_0x38a8('0x1f')]],'as':_0x3145ee['as'],'attributes':_0x3145ee[_0x38a8('0x20')],'include':_0x3145ee[_0x38a8('0x1e')]?_[_0x38a8('0x1d')](_0x3145ee['include'],function(_0x21a228){return{'model':db[_0x21a228[_0x38a8('0x1f')]],'as':_0x21a228['as'],'attributes':_0x21a228[_0x38a8('0x20')]};}):[]};}):[]};}):[]:[]})[_0x38a8('0xe')](function(_0x54dcd6){logger[_0x38a8('0xf')](_0x38a8('0x23'),_0x11e3eb);logger[_0x38a8('0x21')](_0x38a8('0x23'),_0x11e3eb,JSON[_0x38a8('0x13')](_0x54dcd6));_0x53fb2d(_0x54dcd6);})['catch'](function(_0x166826){logger[_0x38a8('0x14')](_0x38a8('0x23'),_0x166826[_0x38a8('0x16')],_0x11e3eb);_0x4aaa72(_0x51a020[_0x38a8('0x14')](0x1f4,_0x166826[_0x38a8('0x16')]));});});}; \ No newline at end of file +var _0xbdb5=['rpc','jayson/promise','client','http','then','info','request\x20sent','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SalesforceAccount,\x20%s,\x20%s','GetSalesforceAccount','SalesforceAccount','findAll','options','where','attributes','limit','include','map','model','debug','catch','ShowSalesforceAccount','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger'];(function(_0x400766,_0x368660){var _0x3ae58b=function(_0x4c6a6e){while(--_0x4c6a6e){_0x400766['push'](_0x400766['shift']());}};_0x3ae58b(++_0x368660);}(_0xbdb5,0x122));var _0x5bdb=function(_0x56637d,_0x55be59){_0x56637d=_0x56637d-0x0;var _0x3986a4=_0xbdb5[_0x56637d];return _0x3986a4;};'use strict';var _=require(_0x5bdb('0x0'));var util=require(_0x5bdb('0x1'));var moment=require(_0x5bdb('0x2'));var BPromise=require(_0x5bdb('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5bdb('0x4'));var db=require(_0x5bdb('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x5bdb('0x6'))(_0x5bdb('0x7'));var config=require('../../config/environment');var jayson=require(_0x5bdb('0x8'));var client=jayson[_0x5bdb('0x9')][_0x5bdb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3965d4,_0x475437,_0x32e340){return new BPromise(function(_0x2c348a,_0x9725d3){return client['request'](_0x3965d4,_0x32e340)[_0x5bdb('0xb')](function(_0x4e5a5f){logger[_0x5bdb('0xc')]('SalesforceAccount,\x20%s,\x20%s',_0x475437,_0x5bdb('0xd'));logger['debug'](_0x5bdb('0xe'),_0x475437,'request\x20sent',JSON[_0x5bdb('0xf')](_0x4e5a5f));if(_0x4e5a5f['error']){if(_0x4e5a5f[_0x5bdb('0x10')][_0x5bdb('0x11')]===0x1f4){logger[_0x5bdb('0x10')]('SalesforceAccount,\x20%s,\x20%s',_0x475437,_0x4e5a5f[_0x5bdb('0x10')][_0x5bdb('0x12')]);return _0x9725d3(_0x4e5a5f[_0x5bdb('0x10')][_0x5bdb('0x12')]);}logger[_0x5bdb('0x10')](_0x5bdb('0x13'),_0x475437,_0x4e5a5f['error'][_0x5bdb('0x12')]);return _0x2c348a(_0x4e5a5f[_0x5bdb('0x10')][_0x5bdb('0x12')]);}else{logger[_0x5bdb('0xc')](_0x5bdb('0x13'),_0x475437,_0x5bdb('0xd'));_0x2c348a(_0x4e5a5f['result'][_0x5bdb('0x12')]);}})['catch'](function(_0x5d4c1a){logger[_0x5bdb('0x10')](_0x5bdb('0x13'),_0x475437,_0x5d4c1a);_0x9725d3(_0x5d4c1a);});});}exports[_0x5bdb('0x14')]=function(_0x83a232){var _0x2fc5ee=this;return new Promise(function(_0x2faf6e,_0x2fa16e){return db[_0x5bdb('0x15')][_0x5bdb('0x16')]({'raw':_0x83a232[_0x5bdb('0x17')]?_0x83a232['options']['raw']===undefined?!![]:![]:!![],'where':_0x83a232[_0x5bdb('0x17')]?_0x83a232['options'][_0x5bdb('0x18')]||null:null,'attributes':_0x83a232['options']?_0x83a232[_0x5bdb('0x17')][_0x5bdb('0x19')]||null:null,'limit':_0x83a232[_0x5bdb('0x17')]?_0x83a232[_0x5bdb('0x17')][_0x5bdb('0x1a')]||null:null,'include':_0x83a232[_0x5bdb('0x17')]?_0x83a232[_0x5bdb('0x17')][_0x5bdb('0x1b')]?_[_0x5bdb('0x1c')](_0x83a232[_0x5bdb('0x17')]['include'],function(_0x30da0a){return{'model':db[_0x30da0a['model']],'as':_0x30da0a['as'],'attributes':_0x30da0a[_0x5bdb('0x19')],'include':_0x30da0a['include']?_['map'](_0x30da0a[_0x5bdb('0x1b')],function(_0x593c8a){return{'model':db[_0x593c8a[_0x5bdb('0x1d')]],'as':_0x593c8a['as'],'attributes':_0x593c8a['attributes'],'include':_0x593c8a[_0x5bdb('0x1b')]?_[_0x5bdb('0x1c')](_0x593c8a[_0x5bdb('0x1b')],function(_0x2390f4){return{'model':db[_0x2390f4[_0x5bdb('0x1d')]],'as':_0x2390f4['as'],'attributes':_0x2390f4[_0x5bdb('0x19')]};}):[]};}):[]};}):[]:[]})[_0x5bdb('0xb')](function(_0x490788){logger[_0x5bdb('0xc')](_0x5bdb('0x14'),_0x83a232);logger[_0x5bdb('0x1e')](_0x5bdb('0x14'),_0x83a232,JSON[_0x5bdb('0xf')](_0x490788));_0x2faf6e(_0x490788);})[_0x5bdb('0x1f')](function(_0x270e36){logger[_0x5bdb('0x10')](_0x5bdb('0x14'),_0x270e36['message'],_0x83a232);_0x2fa16e(_0x2fc5ee[_0x5bdb('0x10')](0x1f4,_0x270e36[_0x5bdb('0x12')]));});});};exports[_0x5bdb('0x20')]=function(_0x49c3fa){var _0x322250=this;return new Promise(function(_0x4e3f1e,_0x4f5a8d){return db[_0x5bdb('0x15')]['find']({'raw':_0x49c3fa['options']?_0x49c3fa[_0x5bdb('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x49c3fa['options']?_0x49c3fa[_0x5bdb('0x17')][_0x5bdb('0x18')]||null:null,'attributes':_0x49c3fa[_0x5bdb('0x17')]?_0x49c3fa['options']['attributes']||null:null,'include':_0x49c3fa[_0x5bdb('0x17')]?_0x49c3fa['options'][_0x5bdb('0x1b')]?_[_0x5bdb('0x1c')](_0x49c3fa[_0x5bdb('0x17')][_0x5bdb('0x1b')],function(_0x5e18e2){return{'model':db[_0x5e18e2['model']],'as':_0x5e18e2['as'],'attributes':_0x5e18e2['attributes'],'include':_0x5e18e2[_0x5bdb('0x1b')]?_['map'](_0x5e18e2[_0x5bdb('0x1b')],function(_0x891447){return{'model':db[_0x891447[_0x5bdb('0x1d')]],'as':_0x891447['as'],'attributes':_0x891447[_0x5bdb('0x19')],'include':_0x891447[_0x5bdb('0x1b')]?_[_0x5bdb('0x1c')](_0x891447[_0x5bdb('0x1b')],function(_0x4f6279){return{'model':db[_0x4f6279['model']],'as':_0x4f6279['as'],'attributes':_0x4f6279[_0x5bdb('0x19')]};}):[]};}):[]};}):[]:[]})[_0x5bdb('0xb')](function(_0x23ed50){logger[_0x5bdb('0xc')](_0x5bdb('0x20'),_0x49c3fa);logger[_0x5bdb('0x1e')](_0x5bdb('0x20'),_0x49c3fa,JSON[_0x5bdb('0xf')](_0x23ed50));_0x4e3f1e(_0x23ed50);})['catch'](function(_0x3a4b42){logger[_0x5bdb('0x10')](_0x5bdb('0x20'),_0x3a4b42[_0x5bdb('0x12')],_0x49c3fa);_0x4f5a8d(_0x322250[_0x5bdb('0x10')](0x1f4,_0x3a4b42[_0x5bdb('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index f8057d1..0c5921a 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 _0x0b0e=['post','create','put','/:id','update','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','/:id/subjects','getSubjects','getDescriptions'];(function(_0x1e2080,_0x53283b){var _0x260111=function(_0x15da5e){while(--_0x15da5e){_0x1e2080['push'](_0x1e2080['shift']());}};_0x260111(++_0x53283b);}(_0x0b0e,0x187));var _0xe0b0=function(_0x549b29,_0x2e2b00){_0x549b29=_0x549b29-0x0;var _0x2b813f=_0x0b0e[_0x549b29];return _0x2b813f;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var fs_extra=require(_0xe0b0('0x4'));var auth=require(_0xe0b0('0x5'));var interaction=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var controller=require(_0xe0b0('0x8'));router[_0xe0b0('0x9')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xb')]);router[_0xe0b0('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xe0b0('0xc')]);router[_0xe0b0('0x9')](_0xe0b0('0xd'),auth[_0xe0b0('0xa')](),controller['getFields']);router[_0xe0b0('0x9')](_0xe0b0('0xe'),auth['isAuthenticated'](),controller[_0xe0b0('0xf')]);router[_0xe0b0('0x9')]('/:id/descriptions',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x10')]);router[_0xe0b0('0x11')]('/',auth['isAuthenticated'](),controller[_0xe0b0('0x12')]);router[_0xe0b0('0x13')](_0xe0b0('0x14'),auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x15')]);router['delete'](_0xe0b0('0x14'),auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x16')]);module[_0xe0b0('0x17')]=router; \ No newline at end of file +var _0x2ef3=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intSalesforceConfiguration.controller','get','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','put','update','exports','multer','util','path'];(function(_0x3770b1,_0x289f7b){var _0x151ef6=function(_0x3f0463){while(--_0x3f0463){_0x3770b1['push'](_0x3770b1['shift']());}};_0x151ef6(++_0x289f7b);}(_0x2ef3,0xba));var _0x32ef=function(_0x3fff91,_0x533ec1){_0x3fff91=_0x3fff91-0x0;var _0x32ab97=_0x2ef3[_0x3fff91];return _0x32ab97;};'use strict';var multer=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var path=require(_0x32ef('0x2'));var timeout=require(_0x32ef('0x3'));var express=require(_0x32ef('0x4'));var router=express[_0x32ef('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x32ef('0x6'));var interaction=require(_0x32ef('0x7'));var config=require('../../config/environment');var controller=require(_0x32ef('0x8'));router[_0x32ef('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x32ef('0x9')](_0x32ef('0xa'),auth[_0x32ef('0xb')](),controller[_0x32ef('0xc')]);router[_0x32ef('0x9')](_0x32ef('0xd'),auth[_0x32ef('0xb')](),controller[_0x32ef('0xe')]);router[_0x32ef('0x9')](_0x32ef('0xf'),auth['isAuthenticated'](),controller['getSubjects']);router[_0x32ef('0x9')](_0x32ef('0x10'),auth[_0x32ef('0xb')](),controller[_0x32ef('0x11')]);router['post']('/',auth[_0x32ef('0xb')](),controller['create']);router[_0x32ef('0x12')]('/:id',auth[_0x32ef('0xb')](),controller[_0x32ef('0x13')]);router['delete']('/:id',auth[_0x32ef('0xb')](),controller['destroy']);module[_0x32ef('0x14')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index 0d1d2f0..679b5bb 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 _0xc041=['STRING','Case','Task','ENUM','contact_lead','contact','account_contact_lead','account','lead','exports'];(function(_0x3297a2,_0x2ec443){var _0x2f32ae=function(_0x3acf69){while(--_0x3acf69){_0x3297a2['push'](_0x3297a2['shift']());}};_0x2f32ae(++_0x2ec443);}(_0xc041,0x153));var _0x1c04=function(_0x403f5f,_0x283f67){_0x403f5f=_0x403f5f-0x0;var _0x15b1cd=_0xc041[_0x403f5f];return _0x15b1cd;};'use strict';var Sequelize=require('sequelize');module[_0x1c04('0x0')]={'name':{'type':Sequelize[_0x1c04('0x1')]},'description':{'type':Sequelize[_0x1c04('0x1')]},'ticketType':{'type':Sequelize['ENUM']('Task',_0x1c04('0x2')),'defaultValue':_0x1c04('0x3')},'moduleSearch':{'type':Sequelize[_0x1c04('0x4')](_0x1c04('0x5'),_0x1c04('0x6'),'lead',_0x1c04('0x7'),'account'),'defaultValue':'contact_lead'},'moduleCreate':{'type':Sequelize[_0x1c04('0x4')]('nothing',_0x1c04('0x6'),'lead',_0x1c04('0x8')),'defaultValue':_0x1c04('0x9')},'leadId':{'type':Sequelize[_0x1c04('0x1')]},'additionalSearchAccount':{'type':Sequelize[_0x1c04('0x1')]},'additionalSearchContact':{'type':Sequelize[_0x1c04('0x1')]},'additionalSearchLead':{'type':Sequelize[_0x1c04('0x1')]}}; \ No newline at end of file +var _0x55bf=['ENUM','Task','Case','contact_lead','contact','lead','account_contact_lead','account','nothing','sequelize','exports','STRING'];(function(_0x483e3a,_0x568361){var _0x43fca9=function(_0x273d7e){while(--_0x273d7e){_0x483e3a['push'](_0x483e3a['shift']());}};_0x43fca9(++_0x568361);}(_0x55bf,0xc9));var _0xf55b=function(_0xede1c7,_0x30acaf){_0xede1c7=_0xede1c7-0x0;var _0x272134=_0x55bf[_0xede1c7];return _0x272134;};'use strict';var Sequelize=require(_0xf55b('0x0'));module[_0xf55b('0x1')]={'name':{'type':Sequelize[_0xf55b('0x2')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0xf55b('0x3')](_0xf55b('0x4'),_0xf55b('0x5')),'defaultValue':'Task'},'moduleSearch':{'type':Sequelize['ENUM'](_0xf55b('0x6'),_0xf55b('0x7'),_0xf55b('0x8'),_0xf55b('0x9'),_0xf55b('0xa')),'defaultValue':'contact_lead'},'moduleCreate':{'type':Sequelize[_0xf55b('0x3')](_0xf55b('0xb'),'contact','lead',_0xf55b('0xa')),'defaultValue':_0xf55b('0x8')},'leadId':{'type':Sequelize[_0xf55b('0x2')]},'additionalSearchAccount':{'type':Sequelize[_0xf55b('0x2')]},'additionalSearchContact':{'type':Sequelize[_0xf55b('0x2')]},'additionalSearchLead':{'type':Sequelize[_0xf55b('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index 8dfcfd7..3821a6f 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 _0x038b=['save','update','then','error','name','index','map','SalesforceConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','findAll','catch','show','length','include','options','create','body','find','params','destroy','findOne','getFields','hasOwnProperty','nolimit','getSubjects','SalesforceField','getDescriptions','rimraf','zip-dir','fast-json-patch','moment','mustache','util','sox','to-csv','lodash','squel','crypto','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','reject'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x038b,0x114));var _0xb038=function(_0x11dbdf,_0x58d4d4){_0x11dbdf=_0x11dbdf-0x0;var _0x4277a2=_0x038b[_0x11dbdf];return _0x4277a2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb038('0x0'));var zipdir=require(_0xb038('0x1'));var jsonpatch=require(_0xb038('0x2'));var rp=require('request-promise');var moment=require(_0xb038('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xb038('0x4'));var util=require(_0xb038('0x5'));var path=require('path');var sox=require(_0xb038('0x6'));var csv=require(_0xb038('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb038('0x8'));var squel=require(_0xb038('0x9'));var crypto=require(_0xb038('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xb038('0x7'));var querystring=require(_0xb038('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xb038('0xc'));var qs=require(_0xb038('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb038('0xe'));var logger=require(_0xb038('0xf'))(_0xb038('0x10'));var utils=require(_0xb038('0x11'));var config=require(_0xb038('0x12'));var licenseUtil=require(_0xb038('0x13'));var db=require(_0xb038('0x14'))['db'];function respondWithStatusCode(_0x439751,_0x16e4a3){_0x16e4a3=_0x16e4a3||0xcc;return function(_0x57acd8){if(_0x57acd8){return _0x439751[_0xb038('0x15')](_0x16e4a3);}return _0x439751[_0xb038('0x16')](_0x16e4a3)[_0xb038('0x17')]();};}function respondWithResult(_0x3cc717,_0x3a71a6){_0x3a71a6=_0x3a71a6||0xc8;return function(_0x13acc7){if(_0x13acc7){return _0x3cc717[_0xb038('0x16')](_0x3a71a6)['json'](_0x13acc7);}};}function respondWithFilteredResult(_0xe8aa7c,_0x26e4f2){return function(_0x183141){if(_0x183141){var _0x39323e=typeof _0x26e4f2[_0xb038('0x18')]===_0xb038('0x19')&&typeof _0x26e4f2['limit']===_0xb038('0x19');var _0x3039b0=_0x183141[_0xb038('0x1a')];var _0x3b095a=_0x39323e?0x0:_0x26e4f2['offset'];var _0x49b237=_0x39323e?_0x183141[_0xb038('0x1a')]:_0x26e4f2[_0xb038('0x18')]+_0x26e4f2[_0xb038('0x1b')];var _0x31c348;if(_0x49b237>=_0x3039b0){_0x49b237=_0x3039b0;_0x31c348=0xc8;}else{_0x31c348=0xce;}_0xe8aa7c['status'](_0x31c348);return _0xe8aa7c[_0xb038('0x1c')](_0xb038('0x1d'),_0x3b095a+'-'+_0x49b237+'/'+_0x3039b0)[_0xb038('0x1e')](_0x183141);}return null;};}function patchUpdates(_0x33a377){return function(_0xc6cd61){try{jsonpatch['apply'](_0xc6cd61,_0x33a377,!![]);}catch(_0x2e0369){return BPromise[_0xb038('0x1f')](_0x2e0369);}return _0xc6cd61[_0xb038('0x20')]();};}function saveUpdates(_0x87b899,_0x5f123d){return function(_0x2812c9){if(_0x2812c9){return _0x2812c9[_0xb038('0x21')](_0x87b899)['then'](function(_0x1eb9cd){return _0x1eb9cd;});}return null;};}function removeEntity(_0x43d403,_0x573f93){return function(_0x241329){if(_0x241329){return _0x241329['destroy']()[_0xb038('0x22')](function(){_0x43d403[_0xb038('0x16')](0xcc)[_0xb038('0x17')]();});}};}function handleEntityNotFound(_0x1df7c4,_0x5d4343){return function(_0xe4ceda){if(!_0xe4ceda){_0x1df7c4[_0xb038('0x15')](0x194);}return _0xe4ceda;};}function handleError(_0x576be5,_0xb6d93f){_0xb6d93f=_0xb6d93f||0x1f4;return function(_0x33cf3c){logger[_0xb038('0x23')](_0x33cf3c['stack']);if(_0x33cf3c[_0xb038('0x24')]){delete _0x33cf3c[_0xb038('0x24')];}_0x576be5[_0xb038('0x16')](_0xb6d93f)['send'](_0x33cf3c);};}exports[_0xb038('0x25')]=function(_0x2855a6,_0x28a6a9){var _0x12b3b6={},_0xc387d={},_0x551b55={'count':0x0,'rows':[]};var _0x1783d4=_[_0xb038('0x26')](db[_0xb038('0x27')][_0xb038('0x28')],function(_0x1abe23){return{'name':_0x1abe23[_0xb038('0x29')],'type':_0x1abe23[_0xb038('0x2a')][_0xb038('0x2b')]};});_0xc387d[_0xb038('0x2c')]=_[_0xb038('0x26')](_0x1783d4,_0xb038('0x24'));_0xc387d[_0xb038('0x2d')]=_[_0xb038('0x2e')](_0x2855a6['query']);_0xc387d[_0xb038('0x2f')]=_['intersection'](_0xc387d[_0xb038('0x2c')],_0xc387d[_0xb038('0x2d')]);_0x12b3b6[_0xb038('0x30')]=_[_0xb038('0x31')](_0xc387d[_0xb038('0x2c')],qs[_0xb038('0x32')](_0x2855a6[_0xb038('0x2d')][_0xb038('0x32')]));_0x12b3b6[_0xb038('0x30')]=_0x12b3b6[_0xb038('0x30')]['length']?_0x12b3b6[_0xb038('0x30')]:_0xc387d[_0xb038('0x2c')];if(!_0x2855a6[_0xb038('0x2d')]['hasOwnProperty']('nolimit')){_0x12b3b6['limit']=qs[_0xb038('0x1b')](_0x2855a6[_0xb038('0x2d')][_0xb038('0x1b')]);_0x12b3b6[_0xb038('0x18')]=qs[_0xb038('0x18')](_0x2855a6[_0xb038('0x2d')]['offset']);}_0x12b3b6[_0xb038('0x33')]=qs[_0xb038('0x34')](_0x2855a6[_0xb038('0x2d')][_0xb038('0x34')]);_0x12b3b6['where']=qs[_0xb038('0x2f')](_[_0xb038('0x35')](_0x2855a6['query'],_0xc387d['filters']),_0x1783d4);if(_0x2855a6[_0xb038('0x2d')][_0xb038('0x36')]){_0x12b3b6[_0xb038('0x37')]=_[_0xb038('0x38')](_0x12b3b6[_0xb038('0x37')],{'$or':_['map'](_0x1783d4,function(_0x404f82){if(_0x404f82[_0xb038('0x2a')]!==_0xb038('0x39')){var _0x2d1e57={};_0x2d1e57[_0x404f82['name']]={'$like':'%'+_0x2855a6[_0xb038('0x2d')][_0xb038('0x36')]+'%'};return _0x2d1e57;}})});}_0x12b3b6=_[_0xb038('0x38')]({},_0x12b3b6,_0x2855a6['options']);var _0x412d71={'where':_0x12b3b6['where']};return db[_0xb038('0x27')][_0xb038('0x1a')](_0x412d71)[_0xb038('0x22')](function(_0x5ce40c){_0x551b55[_0xb038('0x1a')]=_0x5ce40c;if(_0x2855a6[_0xb038('0x2d')][_0xb038('0x3a')]){_0x12b3b6['include']=[{'all':!![]}];}return db[_0xb038('0x27')][_0xb038('0x3b')](_0x12b3b6);})[_0xb038('0x22')](function(_0x3c291e){_0x551b55['rows']=_0x3c291e;return _0x551b55;})[_0xb038('0x22')](respondWithFilteredResult(_0x28a6a9,_0x12b3b6))[_0xb038('0x3c')](handleError(_0x28a6a9,null));};exports[_0xb038('0x3d')]=function(_0x2a0436,_0x52e1d6){var _0x19dc7b={'raw':![],'where':{'id':_0x2a0436['params']['id']}},_0x269c7d={};_0x269c7d[_0xb038('0x2c')]=_[_0xb038('0x2e')](db[_0xb038('0x27')]['rawAttributes']);_0x269c7d[_0xb038('0x2d')]=_[_0xb038('0x2e')](_0x2a0436['query']);_0x269c7d['filters']=_[_0xb038('0x31')](_0x269c7d[_0xb038('0x2c')],_0x269c7d[_0xb038('0x2d')]);_0x19dc7b[_0xb038('0x30')]=_[_0xb038('0x31')](_0x269c7d[_0xb038('0x2c')],qs[_0xb038('0x32')](_0x2a0436[_0xb038('0x2d')]['fields']));_0x19dc7b['attributes']=_0x19dc7b['attributes'][_0xb038('0x3e')]?_0x19dc7b[_0xb038('0x30')]:_0x269c7d['model'];if(_0x2a0436[_0xb038('0x2d')][_0xb038('0x3a')]){_0x19dc7b[_0xb038('0x3f')]=[{'all':!![]}];}_0x19dc7b=_['merge']({},_0x19dc7b,_0x2a0436[_0xb038('0x40')]);return db['SalesforceConfiguration']['find'](_0x19dc7b)[_0xb038('0x22')](handleEntityNotFound(_0x52e1d6,null))[_0xb038('0x22')](respondWithResult(_0x52e1d6,null))[_0xb038('0x3c')](handleError(_0x52e1d6,null));};exports[_0xb038('0x41')]=function(_0x304515,_0x3b09e3){return db[_0xb038('0x27')][_0xb038('0x41')](_0x304515[_0xb038('0x42')],{})[_0xb038('0x22')](respondWithResult(_0x3b09e3,0xc9))['catch'](handleError(_0x3b09e3,null));};exports[_0xb038('0x21')]=function(_0x3ed968,_0x5c11d7){if(_0x3ed968[_0xb038('0x42')]['id']){delete _0x3ed968[_0xb038('0x42')]['id'];}return db['SalesforceConfiguration'][_0xb038('0x43')]({'where':{'id':_0x3ed968[_0xb038('0x44')]['id']}})[_0xb038('0x22')](handleEntityNotFound(_0x5c11d7,null))[_0xb038('0x22')](saveUpdates(_0x3ed968[_0xb038('0x42')],null))[_0xb038('0x22')](respondWithResult(_0x5c11d7,null))[_0xb038('0x3c')](handleError(_0x5c11d7,null));};exports[_0xb038('0x45')]=function(_0x3a291d,_0x54a826){return db[_0xb038('0x27')][_0xb038('0x43')]({'where':{'id':_0x3a291d[_0xb038('0x44')]['id']}})[_0xb038('0x22')](handleEntityNotFound(_0x54a826,null))[_0xb038('0x22')](removeEntity(_0x54a826,null))[_0xb038('0x3c')](handleError(_0x54a826,null));};exports['getFields']=function(_0x1f4997,_0x2f3622,_0x2b2b4d){var _0x1fa353={};var _0x2dfa96={};var _0x24198c;var _0xd7a862;return db['SalesforceConfiguration'][_0xb038('0x46')]({'where':{'id':_0x1f4997['params']['id']}})[_0xb038('0x22')](handleEntityNotFound(_0x2f3622,null))[_0xb038('0x22')](function(_0x2315db){if(_0x2315db){_0x24198c=_0x2315db;_0x2dfa96[_0xb038('0x2c')]=_[_0xb038('0x2e')](db['SalesforceField']['rawAttributes']);_0x2dfa96['query']=_[_0xb038('0x2e')](_0x1f4997[_0xb038('0x2d')]);_0x2dfa96[_0xb038('0x2f')]=_[_0xb038('0x31')](_0x2dfa96[_0xb038('0x2c')],_0x2dfa96[_0xb038('0x2d')]);_0x1fa353['attributes']=_[_0xb038('0x31')](_0x2dfa96[_0xb038('0x2c')],qs['fields'](_0x1f4997['query'][_0xb038('0x32')]));_0x1fa353['attributes']=_0x1fa353[_0xb038('0x30')]['length']?_0x1fa353[_0xb038('0x30')]:_0x2dfa96[_0xb038('0x2c')];_0x1fa353[_0xb038('0x33')]=qs[_0xb038('0x34')](_0x1f4997['query'][_0xb038('0x34')]);_0x1fa353[_0xb038('0x37')]=qs[_0xb038('0x2f')](_[_0xb038('0x35')](_0x1f4997[_0xb038('0x2d')],_0x2dfa96[_0xb038('0x2f')]));if(_0x1f4997[_0xb038('0x2d')][_0xb038('0x36')]){_0x1fa353[_0xb038('0x37')]=_[_0xb038('0x38')](_0x1fa353[_0xb038('0x37')],{'$or':_[_0xb038('0x26')](_0x1fa353['attributes'],function(_0x29e11e){var _0x2fc38d={};_0x2fc38d[_0x29e11e]={'$like':'%'+_0x1f4997[_0xb038('0x2d')][_0xb038('0x36')]+'%'};return _0x2fc38d;})});}_0x1fa353=_[_0xb038('0x38')]({},_0x1fa353,_0x1f4997['options']);return _0x24198c[_0xb038('0x47')](_0x1fa353);}})['then'](function(_0xfb3ce6){if(_0xfb3ce6){_0xd7a862=_0xfb3ce6[_0xb038('0x3e')];if(!_0x1f4997['query'][_0xb038('0x48')](_0xb038('0x49'))){_0x1fa353[_0xb038('0x1b')]=qs[_0xb038('0x1b')](_0x1f4997[_0xb038('0x2d')][_0xb038('0x1b')]);_0x1fa353[_0xb038('0x18')]=qs[_0xb038('0x18')](_0x1f4997[_0xb038('0x2d')][_0xb038('0x18')]);}return _0x24198c['getFields'](_0x1fa353);}})[_0xb038('0x22')](function(_0x4f69dc){if(_0x4f69dc){return _0x4f69dc?{'count':_0xd7a862,'rows':_0x4f69dc}:null;}})[_0xb038('0x22')](respondWithResult(_0x2f3622,null))[_0xb038('0x3c')](handleError(_0x2f3622,null));};exports[_0xb038('0x4a')]=function(_0x36568b,_0x1f5f3f,_0x23fb92){var _0x1d6cf5={};var _0x4c23b2={};var _0x572ad4;var _0x24ea03;return db[_0xb038('0x27')][_0xb038('0x46')]({'where':{'id':_0x36568b['params']['id']}})['then'](handleEntityNotFound(_0x1f5f3f,null))[_0xb038('0x22')](function(_0x4b807f){if(_0x4b807f){_0x572ad4=_0x4b807f;_0x4c23b2[_0xb038('0x2c')]=_['keys'](db[_0xb038('0x4b')]['rawAttributes']);_0x4c23b2[_0xb038('0x2d')]=_[_0xb038('0x2e')](_0x36568b[_0xb038('0x2d')]);_0x4c23b2[_0xb038('0x2f')]=_[_0xb038('0x31')](_0x4c23b2[_0xb038('0x2c')],_0x4c23b2['query']);_0x1d6cf5['attributes']=_[_0xb038('0x31')](_0x4c23b2['model'],qs[_0xb038('0x32')](_0x36568b[_0xb038('0x2d')][_0xb038('0x32')]));_0x1d6cf5['attributes']=_0x1d6cf5[_0xb038('0x30')]['length']?_0x1d6cf5[_0xb038('0x30')]:_0x4c23b2[_0xb038('0x2c')];_0x1d6cf5[_0xb038('0x33')]=qs[_0xb038('0x34')](_0x36568b[_0xb038('0x2d')][_0xb038('0x34')]);_0x1d6cf5[_0xb038('0x37')]=qs[_0xb038('0x2f')](_[_0xb038('0x35')](_0x36568b['query'],_0x4c23b2['filters']));if(_0x36568b['query'][_0xb038('0x36')]){_0x1d6cf5['where']=_[_0xb038('0x38')](_0x1d6cf5['where'],{'$or':_[_0xb038('0x26')](_0x1d6cf5[_0xb038('0x30')],function(_0x41c151){var _0x1294d7={};_0x1294d7[_0x41c151]={'$like':'%'+_0x36568b[_0xb038('0x2d')][_0xb038('0x36')]+'%'};return _0x1294d7;})});}_0x1d6cf5=_[_0xb038('0x38')]({},_0x1d6cf5,_0x36568b[_0xb038('0x40')]);return _0x572ad4[_0xb038('0x4a')](_0x1d6cf5);}})[_0xb038('0x22')](function(_0x1db407){if(_0x1db407){_0x24ea03=_0x1db407[_0xb038('0x3e')];if(!_0x36568b[_0xb038('0x2d')][_0xb038('0x48')](_0xb038('0x49'))){_0x1d6cf5[_0xb038('0x1b')]=qs[_0xb038('0x1b')](_0x36568b[_0xb038('0x2d')][_0xb038('0x1b')]);_0x1d6cf5['offset']=qs[_0xb038('0x18')](_0x36568b[_0xb038('0x2d')][_0xb038('0x18')]);}return _0x572ad4[_0xb038('0x4a')](_0x1d6cf5);}})[_0xb038('0x22')](function(_0x5ead21){if(_0x5ead21){return _0x5ead21?{'count':_0x24ea03,'rows':_0x5ead21}:null;}})[_0xb038('0x22')](respondWithResult(_0x1f5f3f,null))[_0xb038('0x3c')](handleError(_0x1f5f3f,null));};exports[_0xb038('0x4c')]=function(_0x80d720,_0x34e222,_0x468b41){var _0x2acbf6={};var _0x2d0313={};var _0xd5aa6d;var _0x4ce25a;return db['SalesforceConfiguration'][_0xb038('0x46')]({'where':{'id':_0x80d720['params']['id']}})[_0xb038('0x22')](handleEntityNotFound(_0x34e222,null))['then'](function(_0x5da505){if(_0x5da505){_0xd5aa6d=_0x5da505;_0x2d0313['model']=_[_0xb038('0x2e')](db[_0xb038('0x4b')]['rawAttributes']);_0x2d0313[_0xb038('0x2d')]=_[_0xb038('0x2e')](_0x80d720[_0xb038('0x2d')]);_0x2d0313[_0xb038('0x2f')]=_[_0xb038('0x31')](_0x2d0313[_0xb038('0x2c')],_0x2d0313[_0xb038('0x2d')]);_0x2acbf6[_0xb038('0x30')]=_[_0xb038('0x31')](_0x2d0313[_0xb038('0x2c')],qs['fields'](_0x80d720[_0xb038('0x2d')][_0xb038('0x32')]));_0x2acbf6[_0xb038('0x30')]=_0x2acbf6[_0xb038('0x30')][_0xb038('0x3e')]?_0x2acbf6[_0xb038('0x30')]:_0x2d0313[_0xb038('0x2c')];_0x2acbf6['order']=qs[_0xb038('0x34')](_0x80d720[_0xb038('0x2d')][_0xb038('0x34')]);_0x2acbf6['where']=qs['filters'](_[_0xb038('0x35')](_0x80d720[_0xb038('0x2d')],_0x2d0313[_0xb038('0x2f')]));if(_0x80d720['query'][_0xb038('0x36')]){_0x2acbf6[_0xb038('0x37')]=_['merge'](_0x2acbf6[_0xb038('0x37')],{'$or':_[_0xb038('0x26')](_0x2acbf6[_0xb038('0x30')],function(_0x2a41c8){var _0x24f810={};_0x24f810[_0x2a41c8]={'$like':'%'+_0x80d720[_0xb038('0x2d')][_0xb038('0x36')]+'%'};return _0x24f810;})});}_0x2acbf6=_[_0xb038('0x38')]({},_0x2acbf6,_0x80d720[_0xb038('0x40')]);return _0xd5aa6d[_0xb038('0x4c')](_0x2acbf6);}})[_0xb038('0x22')](function(_0x178a92){if(_0x178a92){_0x4ce25a=_0x178a92[_0xb038('0x3e')];if(!_0x80d720[_0xb038('0x2d')]['hasOwnProperty'](_0xb038('0x49'))){_0x2acbf6[_0xb038('0x1b')]=qs[_0xb038('0x1b')](_0x80d720[_0xb038('0x2d')][_0xb038('0x1b')]);_0x2acbf6[_0xb038('0x18')]=qs[_0xb038('0x18')](_0x80d720[_0xb038('0x2d')]['offset']);}return _0xd5aa6d[_0xb038('0x4c')](_0x2acbf6);}})[_0xb038('0x22')](function(_0x4d7537){if(_0x4d7537){return _0x4d7537?{'count':_0x4ce25a,'rows':_0x4d7537}:null;}})[_0xb038('0x22')](respondWithResult(_0x34e222,null))['catch'](handleError(_0x34e222,null));}; \ No newline at end of file +var _0x91d9=['fs-extra','lodash','squel','crypto','desk.js','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','offset','limit','count','status','set','Content-Range','json','apply','reject','save','then','error','stack','name','send','map','SalesforceConfiguration','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','options','include','findAll','rows','catch','params','intersection','merge','find','create','body','destroy','getFields','findOne','SalesforceField','getSubjects','getDescriptions','rimraf','request-promise','bluebird','path','ejs'];(function(_0x456ee5,_0x4d3336){var _0x38fbc8=function(_0x39f8e7){while(--_0x39f8e7){_0x456ee5['push'](_0x456ee5['shift']());}};_0x38fbc8(++_0x4d3336);}(_0x91d9,0x1ec));var _0x991d=function(_0x29cbbf,_0x20968a){_0x29cbbf=_0x29cbbf-0x0;var _0x5a9236=_0x91d9[_0x29cbbf];return _0x5a9236;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x991d('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x991d('0x1'));var moment=require('moment');var BPromise=require(_0x991d('0x2'));var Mustache=require('mustache');var util=require('util');var path=require(_0x991d('0x3'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x991d('0x4'));var fs=require('fs');var fs_extra=require(_0x991d('0x5'));var _=require(_0x991d('0x6'));var squel=require(_0x991d('0x7'));var crypto=require(_0x991d('0x8'));var jsforce=require('jsforce');var deskjs=require(_0x991d('0x9'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x991d('0xa'));var authService=require(_0x991d('0xb'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x991d('0xc'))(_0x991d('0xd'));var utils=require(_0x991d('0xe'));var config=require(_0x991d('0xf'));var licenseUtil=require('../../config/license/util');var db=require(_0x991d('0x10'))['db'];function respondWithStatusCode(_0x42b2d7,_0x120b9a){_0x120b9a=_0x120b9a||0xcc;return function(_0x295b15){if(_0x295b15){return _0x42b2d7[_0x991d('0x11')](_0x120b9a);}return _0x42b2d7['status'](_0x120b9a)[_0x991d('0x12')]();};}function respondWithResult(_0x1c0366,_0x47f968){_0x47f968=_0x47f968||0xc8;return function(_0x281fa3){if(_0x281fa3){return _0x1c0366['status'](_0x47f968)['json'](_0x281fa3);}};}function respondWithFilteredResult(_0x3c2284,_0x344f69){return function(_0x1cf6a5){if(_0x1cf6a5){var _0x977058=typeof _0x344f69[_0x991d('0x13')]==='undefined'&&typeof _0x344f69[_0x991d('0x14')]==='undefined';var _0x329d2b=_0x1cf6a5[_0x991d('0x15')];var _0x95737c=_0x977058?0x0:_0x344f69['offset'];var _0x4ce09a=_0x977058?_0x1cf6a5['count']:_0x344f69[_0x991d('0x13')]+_0x344f69[_0x991d('0x14')];var _0x304c8b;if(_0x4ce09a>=_0x329d2b){_0x4ce09a=_0x329d2b;_0x304c8b=0xc8;}else{_0x304c8b=0xce;}_0x3c2284[_0x991d('0x16')](_0x304c8b);return _0x3c2284[_0x991d('0x17')](_0x991d('0x18'),_0x95737c+'-'+_0x4ce09a+'/'+_0x329d2b)[_0x991d('0x19')](_0x1cf6a5);}return null;};}function patchUpdates(_0x547724){return function(_0x3ba316){try{jsonpatch[_0x991d('0x1a')](_0x3ba316,_0x547724,!![]);}catch(_0x628118){return BPromise[_0x991d('0x1b')](_0x628118);}return _0x3ba316[_0x991d('0x1c')]();};}function saveUpdates(_0x200b25,_0x20c3b6){return function(_0xee8c5){if(_0xee8c5){return _0xee8c5['update'](_0x200b25)[_0x991d('0x1d')](function(_0x3a20d3){return _0x3a20d3;});}return null;};}function removeEntity(_0x359284,_0x3f9f7c){return function(_0x321e36){if(_0x321e36){return _0x321e36['destroy']()[_0x991d('0x1d')](function(){_0x359284[_0x991d('0x16')](0xcc)[_0x991d('0x12')]();});}};}function handleEntityNotFound(_0x57c9c0,_0x13d144){return function(_0x592683){if(!_0x592683){_0x57c9c0[_0x991d('0x11')](0x194);}return _0x592683;};}function handleError(_0x279281,_0x5b9c21){_0x5b9c21=_0x5b9c21||0x1f4;return function(_0x269bae){logger[_0x991d('0x1e')](_0x269bae[_0x991d('0x1f')]);if(_0x269bae[_0x991d('0x20')]){delete _0x269bae['name'];}_0x279281[_0x991d('0x16')](_0x5b9c21)[_0x991d('0x21')](_0x269bae);};}exports['index']=function(_0x1dface,_0x322c2e){var _0x2e652a={},_0x25a108={},_0xa92683={'count':0x0,'rows':[]};var _0x2882cb=_[_0x991d('0x22')](db[_0x991d('0x23')][_0x991d('0x24')],function(_0x1b74c3){return{'name':_0x1b74c3[_0x991d('0x25')],'type':_0x1b74c3[_0x991d('0x26')][_0x991d('0x27')]};});_0x25a108[_0x991d('0x28')]=_['map'](_0x2882cb,'name');_0x25a108['query']=_[_0x991d('0x29')](_0x1dface[_0x991d('0x2a')]);_0x25a108[_0x991d('0x2b')]=_['intersection'](_0x25a108['model'],_0x25a108[_0x991d('0x2a')]);_0x2e652a[_0x991d('0x2c')]=_['intersection'](_0x25a108[_0x991d('0x28')],qs[_0x991d('0x2d')](_0x1dface[_0x991d('0x2a')]['fields']));_0x2e652a[_0x991d('0x2c')]=_0x2e652a[_0x991d('0x2c')][_0x991d('0x2e')]?_0x2e652a[_0x991d('0x2c')]:_0x25a108[_0x991d('0x28')];if(!_0x1dface[_0x991d('0x2a')][_0x991d('0x2f')](_0x991d('0x30'))){_0x2e652a['limit']=qs['limit'](_0x1dface[_0x991d('0x2a')]['limit']);_0x2e652a[_0x991d('0x13')]=qs[_0x991d('0x13')](_0x1dface[_0x991d('0x2a')][_0x991d('0x13')]);}_0x2e652a[_0x991d('0x31')]=qs[_0x991d('0x32')](_0x1dface[_0x991d('0x2a')][_0x991d('0x32')]);_0x2e652a[_0x991d('0x33')]=qs['filters'](_[_0x991d('0x34')](_0x1dface['query'],_0x25a108[_0x991d('0x2b')]),_0x2882cb);if(_0x1dface[_0x991d('0x2a')]['filter']){_0x2e652a[_0x991d('0x33')]=_['merge'](_0x2e652a['where'],{'$or':_[_0x991d('0x22')](_0x2882cb,function(_0x34663c){if(_0x34663c[_0x991d('0x26')]!=='VIRTUAL'){var _0x3ede5f={};_0x3ede5f[_0x34663c[_0x991d('0x20')]]={'$like':'%'+_0x1dface[_0x991d('0x2a')][_0x991d('0x35')]+'%'};return _0x3ede5f;}})});}_0x2e652a=_['merge']({},_0x2e652a,_0x1dface[_0x991d('0x36')]);var _0x1d59d2={'where':_0x2e652a[_0x991d('0x33')]};return db['SalesforceConfiguration'][_0x991d('0x15')](_0x1d59d2)[_0x991d('0x1d')](function(_0x5361e7){_0xa92683['count']=_0x5361e7;if(_0x1dface[_0x991d('0x2a')]['includeAll']){_0x2e652a[_0x991d('0x37')]=[{'all':!![]}];}return db[_0x991d('0x23')][_0x991d('0x38')](_0x2e652a);})[_0x991d('0x1d')](function(_0x27d5a1){_0xa92683[_0x991d('0x39')]=_0x27d5a1;return _0xa92683;})[_0x991d('0x1d')](respondWithFilteredResult(_0x322c2e,_0x2e652a))[_0x991d('0x3a')](handleError(_0x322c2e,null));};exports['show']=function(_0x13a475,_0x17fd55){var _0x4b98d6={'raw':![],'where':{'id':_0x13a475[_0x991d('0x3b')]['id']}},_0x58a69b={};_0x58a69b[_0x991d('0x28')]=_['keys'](db['SalesforceConfiguration'][_0x991d('0x24')]);_0x58a69b['query']=_[_0x991d('0x29')](_0x13a475['query']);_0x58a69b[_0x991d('0x2b')]=_[_0x991d('0x3c')](_0x58a69b[_0x991d('0x28')],_0x58a69b['query']);_0x4b98d6[_0x991d('0x2c')]=_[_0x991d('0x3c')](_0x58a69b[_0x991d('0x28')],qs[_0x991d('0x2d')](_0x13a475[_0x991d('0x2a')][_0x991d('0x2d')]));_0x4b98d6[_0x991d('0x2c')]=_0x4b98d6[_0x991d('0x2c')][_0x991d('0x2e')]?_0x4b98d6[_0x991d('0x2c')]:_0x58a69b[_0x991d('0x28')];if(_0x13a475[_0x991d('0x2a')]['includeAll']){_0x4b98d6[_0x991d('0x37')]=[{'all':!![]}];}_0x4b98d6=_[_0x991d('0x3d')]({},_0x4b98d6,_0x13a475[_0x991d('0x36')]);return db[_0x991d('0x23')][_0x991d('0x3e')](_0x4b98d6)[_0x991d('0x1d')](handleEntityNotFound(_0x17fd55,null))[_0x991d('0x1d')](respondWithResult(_0x17fd55,null))[_0x991d('0x3a')](handleError(_0x17fd55,null));};exports['create']=function(_0x3028ed,_0x35080e){return db[_0x991d('0x23')][_0x991d('0x3f')](_0x3028ed[_0x991d('0x40')],{})[_0x991d('0x1d')](respondWithResult(_0x35080e,0xc9))[_0x991d('0x3a')](handleError(_0x35080e,null));};exports['update']=function(_0x35c96e,_0x5a87cc){if(_0x35c96e[_0x991d('0x40')]['id']){delete _0x35c96e['body']['id'];}return db['SalesforceConfiguration'][_0x991d('0x3e')]({'where':{'id':_0x35c96e[_0x991d('0x3b')]['id']}})[_0x991d('0x1d')](handleEntityNotFound(_0x5a87cc,null))['then'](saveUpdates(_0x35c96e[_0x991d('0x40')],null))[_0x991d('0x1d')](respondWithResult(_0x5a87cc,null))['catch'](handleError(_0x5a87cc,null));};exports[_0x991d('0x41')]=function(_0x4f1236,_0x3adfb1){return db['SalesforceConfiguration'][_0x991d('0x3e')]({'where':{'id':_0x4f1236[_0x991d('0x3b')]['id']}})['then'](handleEntityNotFound(_0x3adfb1,null))[_0x991d('0x1d')](removeEntity(_0x3adfb1,null))[_0x991d('0x3a')](handleError(_0x3adfb1,null));};exports[_0x991d('0x42')]=function(_0x1ea7b7,_0x3b94c0,_0x2f6281){var _0x51d185={};var _0x49d79c={};var _0x3fd28b;var _0xe3e564;return db[_0x991d('0x23')][_0x991d('0x43')]({'where':{'id':_0x1ea7b7[_0x991d('0x3b')]['id']}})['then'](handleEntityNotFound(_0x3b94c0,null))[_0x991d('0x1d')](function(_0x1d16ff){if(_0x1d16ff){_0x3fd28b=_0x1d16ff;_0x49d79c[_0x991d('0x28')]=_[_0x991d('0x29')](db[_0x991d('0x44')][_0x991d('0x24')]);_0x49d79c[_0x991d('0x2a')]=_[_0x991d('0x29')](_0x1ea7b7[_0x991d('0x2a')]);_0x49d79c['filters']=_[_0x991d('0x3c')](_0x49d79c[_0x991d('0x28')],_0x49d79c[_0x991d('0x2a')]);_0x51d185['attributes']=_[_0x991d('0x3c')](_0x49d79c[_0x991d('0x28')],qs['fields'](_0x1ea7b7[_0x991d('0x2a')][_0x991d('0x2d')]));_0x51d185['attributes']=_0x51d185[_0x991d('0x2c')][_0x991d('0x2e')]?_0x51d185['attributes']:_0x49d79c[_0x991d('0x28')];_0x51d185[_0x991d('0x31')]=qs[_0x991d('0x32')](_0x1ea7b7[_0x991d('0x2a')][_0x991d('0x32')]);_0x51d185['where']=qs[_0x991d('0x2b')](_[_0x991d('0x34')](_0x1ea7b7[_0x991d('0x2a')],_0x49d79c[_0x991d('0x2b')]));if(_0x1ea7b7[_0x991d('0x2a')][_0x991d('0x35')]){_0x51d185[_0x991d('0x33')]=_['merge'](_0x51d185['where'],{'$or':_[_0x991d('0x22')](_0x51d185[_0x991d('0x2c')],function(_0x3035a9){var _0x730fdc={};_0x730fdc[_0x3035a9]={'$like':'%'+_0x1ea7b7[_0x991d('0x2a')]['filter']+'%'};return _0x730fdc;})});}_0x51d185=_[_0x991d('0x3d')]({},_0x51d185,_0x1ea7b7[_0x991d('0x36')]);return _0x3fd28b['getFields'](_0x51d185);}})['then'](function(_0x7af77f){if(_0x7af77f){_0xe3e564=_0x7af77f['length'];if(!_0x1ea7b7['query'][_0x991d('0x2f')](_0x991d('0x30'))){_0x51d185[_0x991d('0x14')]=qs[_0x991d('0x14')](_0x1ea7b7[_0x991d('0x2a')]['limit']);_0x51d185[_0x991d('0x13')]=qs['offset'](_0x1ea7b7[_0x991d('0x2a')][_0x991d('0x13')]);}return _0x3fd28b[_0x991d('0x42')](_0x51d185);}})[_0x991d('0x1d')](function(_0xc9c59){if(_0xc9c59){return _0xc9c59?{'count':_0xe3e564,'rows':_0xc9c59}:null;}})[_0x991d('0x1d')](respondWithResult(_0x3b94c0,null))['catch'](handleError(_0x3b94c0,null));};exports[_0x991d('0x45')]=function(_0x178daf,_0x441dfa,_0x2ee6d2){var _0x4c2878={};var _0x2133f0={};var _0x17ba54;var _0x49ced3;return db[_0x991d('0x23')][_0x991d('0x43')]({'where':{'id':_0x178daf['params']['id']}})[_0x991d('0x1d')](handleEntityNotFound(_0x441dfa,null))['then'](function(_0x5e29e8){if(_0x5e29e8){_0x17ba54=_0x5e29e8;_0x2133f0[_0x991d('0x28')]=_[_0x991d('0x29')](db['SalesforceField'][_0x991d('0x24')]);_0x2133f0[_0x991d('0x2a')]=_[_0x991d('0x29')](_0x178daf['query']);_0x2133f0[_0x991d('0x2b')]=_['intersection'](_0x2133f0['model'],_0x2133f0[_0x991d('0x2a')]);_0x4c2878[_0x991d('0x2c')]=_[_0x991d('0x3c')](_0x2133f0['model'],qs[_0x991d('0x2d')](_0x178daf[_0x991d('0x2a')][_0x991d('0x2d')]));_0x4c2878[_0x991d('0x2c')]=_0x4c2878[_0x991d('0x2c')][_0x991d('0x2e')]?_0x4c2878['attributes']:_0x2133f0[_0x991d('0x28')];_0x4c2878[_0x991d('0x31')]=qs[_0x991d('0x32')](_0x178daf[_0x991d('0x2a')][_0x991d('0x32')]);_0x4c2878[_0x991d('0x33')]=qs[_0x991d('0x2b')](_[_0x991d('0x34')](_0x178daf[_0x991d('0x2a')],_0x2133f0['filters']));if(_0x178daf[_0x991d('0x2a')][_0x991d('0x35')]){_0x4c2878[_0x991d('0x33')]=_[_0x991d('0x3d')](_0x4c2878[_0x991d('0x33')],{'$or':_[_0x991d('0x22')](_0x4c2878[_0x991d('0x2c')],function(_0x135f55){var _0x346d4d={};_0x346d4d[_0x135f55]={'$like':'%'+_0x178daf[_0x991d('0x2a')]['filter']+'%'};return _0x346d4d;})});}_0x4c2878=_[_0x991d('0x3d')]({},_0x4c2878,_0x178daf[_0x991d('0x36')]);return _0x17ba54['getSubjects'](_0x4c2878);}})[_0x991d('0x1d')](function(_0x43da14){if(_0x43da14){_0x49ced3=_0x43da14['length'];if(!_0x178daf[_0x991d('0x2a')][_0x991d('0x2f')](_0x991d('0x30'))){_0x4c2878[_0x991d('0x14')]=qs['limit'](_0x178daf[_0x991d('0x2a')][_0x991d('0x14')]);_0x4c2878[_0x991d('0x13')]=qs[_0x991d('0x13')](_0x178daf[_0x991d('0x2a')][_0x991d('0x13')]);}return _0x17ba54[_0x991d('0x45')](_0x4c2878);}})[_0x991d('0x1d')](function(_0x100bf7){if(_0x100bf7){return _0x100bf7?{'count':_0x49ced3,'rows':_0x100bf7}:null;}})[_0x991d('0x1d')](respondWithResult(_0x441dfa,null))[_0x991d('0x3a')](handleError(_0x441dfa,null));};exports[_0x991d('0x46')]=function(_0x29e8a9,_0xdba70a,_0x25e7ea){var _0x4954bf={};var _0x435c4a={};var _0x54623d;var _0xdeb35c;return db[_0x991d('0x23')]['findOne']({'where':{'id':_0x29e8a9[_0x991d('0x3b')]['id']}})[_0x991d('0x1d')](handleEntityNotFound(_0xdba70a,null))['then'](function(_0x59a518){if(_0x59a518){_0x54623d=_0x59a518;_0x435c4a[_0x991d('0x28')]=_[_0x991d('0x29')](db[_0x991d('0x44')][_0x991d('0x24')]);_0x435c4a[_0x991d('0x2a')]=_['keys'](_0x29e8a9[_0x991d('0x2a')]);_0x435c4a['filters']=_['intersection'](_0x435c4a[_0x991d('0x28')],_0x435c4a[_0x991d('0x2a')]);_0x4954bf['attributes']=_[_0x991d('0x3c')](_0x435c4a['model'],qs[_0x991d('0x2d')](_0x29e8a9[_0x991d('0x2a')]['fields']));_0x4954bf[_0x991d('0x2c')]=_0x4954bf[_0x991d('0x2c')]['length']?_0x4954bf[_0x991d('0x2c')]:_0x435c4a[_0x991d('0x28')];_0x4954bf[_0x991d('0x31')]=qs[_0x991d('0x32')](_0x29e8a9['query']['sort']);_0x4954bf[_0x991d('0x33')]=qs['filters'](_['pick'](_0x29e8a9[_0x991d('0x2a')],_0x435c4a['filters']));if(_0x29e8a9[_0x991d('0x2a')][_0x991d('0x35')]){_0x4954bf['where']=_['merge'](_0x4954bf['where'],{'$or':_['map'](_0x4954bf[_0x991d('0x2c')],function(_0x366b32){var _0x21756e={};_0x21756e[_0x366b32]={'$like':'%'+_0x29e8a9[_0x991d('0x2a')][_0x991d('0x35')]+'%'};return _0x21756e;})});}_0x4954bf=_[_0x991d('0x3d')]({},_0x4954bf,_0x29e8a9[_0x991d('0x36')]);return _0x54623d[_0x991d('0x46')](_0x4954bf);}})[_0x991d('0x1d')](function(_0x50a0cc){if(_0x50a0cc){_0xdeb35c=_0x50a0cc[_0x991d('0x2e')];if(!_0x29e8a9[_0x991d('0x2a')]['hasOwnProperty']('nolimit')){_0x4954bf[_0x991d('0x14')]=qs[_0x991d('0x14')](_0x29e8a9[_0x991d('0x2a')][_0x991d('0x14')]);_0x4954bf[_0x991d('0x13')]=qs[_0x991d('0x13')](_0x29e8a9[_0x991d('0x2a')][_0x991d('0x13')]);}return _0x54623d[_0x991d('0x46')](_0x4954bf);}})[_0x991d('0x1d')](function(_0x397628){if(_0x397628){return _0x397628?{'count':_0xdeb35c,'rows':_0x397628}:null;}})['then'](respondWithResult(_0xdba70a,null))[_0x991d('0x3a')](handleError(_0xdba70a,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index ea28c15..2d0de0c 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 _0x99cf=['../../config/logger','api','rimraf','../../config/environment','exports','define','lodash'];(function(_0x293e39,_0x34315f){var _0x118450=function(_0x1efd24){while(--_0x1efd24){_0x293e39['push'](_0x293e39['shift']());}};_0x118450(++_0x34315f);}(_0x99cf,0x11e));var _0xf99c=function(_0x31c626,_0x40467a){_0x31c626=_0x31c626-0x0;var _0x4bcda1=_0x99cf[_0x31c626];return _0x4bcda1;};'use strict';var _=require(_0xf99c('0x0'));var util=require('util');var logger=require(_0xf99c('0x1'))(_0xf99c('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(_0xf99c('0x3'));var config=require(_0xf99c('0x4'));var attributes=require('./intSalesforceConfiguration.attributes');module[_0xf99c('0x5')]=function(_0x5df4a2,_0x3f37ec){return _0x5df4a2[_0xf99c('0x6')]('SalesforceConfiguration',attributes,{'tableName':'int_salesforce_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xce5f=['bluebird','path','rimraf','../../config/environment','./intSalesforceConfiguration.attributes','define','lodash','util','../../config/logger','api'];(function(_0x20d64a,_0x33025a){var _0x15377d=function(_0x353ea7){while(--_0x353ea7){_0x20d64a['push'](_0x20d64a['shift']());}};_0x15377d(++_0x33025a);}(_0xce5f,0x1b4));var _0xfce5=function(_0x291772,_0x27123b){_0x291772=_0x291772-0x0;var _0x359d17=_0xce5f[_0x291772];return _0x359d17;};'use strict';var _=require(_0xfce5('0x0'));var util=require(_0xfce5('0x1'));var logger=require(_0xfce5('0x2'))(_0xfce5('0x3'));var moment=require('moment');var BPromise=require(_0xfce5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfce5('0x5'));var rimraf=require(_0xfce5('0x6'));var config=require(_0xfce5('0x7'));var attributes=require(_0xfce5('0x8'));module['exports']=function(_0x51824c,_0x580121){return _0x51824c[_0xfce5('0x9')]('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 131087a..d9a370c 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 _0xacff=['catch','lodash','util','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','SalesforceConfiguration,\x20%s,\x20%s','message','result'];(function(_0x2e752b,_0x5cb17d){var _0x40a0b4=function(_0x11365a){while(--_0x11365a){_0x2e752b['push'](_0x2e752b['shift']());}};_0x40a0b4(++_0x5cb17d);}(_0xacff,0xa9));var _0xfacf=function(_0x4d86d7,_0x42b0d2){_0x4d86d7=_0x4d86d7-0x0;var _0x49fc76=_0xacff[_0x4d86d7];return _0x49fc76;};'use strict';var _=require(_0xfacf('0x0'));var util=require(_0xfacf('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfacf('0x2'));var db=require(_0xfacf('0x3'))['db'];var utils=require(_0xfacf('0x4'));var logger=require('../../config/logger')(_0xfacf('0x5'));var config=require(_0xfacf('0x6'));var jayson=require(_0xfacf('0x7'));var client=jayson['client'][_0xfacf('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x58973e,_0x5b16bb,_0x1d33c1){return new BPromise(function(_0x26b027,_0x56f42b){return client[_0xfacf('0x9')](_0x58973e,_0x1d33c1)[_0xfacf('0xa')](function(_0x2fcef3){logger[_0xfacf('0xb')]('SalesforceConfiguration,\x20%s,\x20%s',_0x5b16bb,'request\x20sent');logger['debug'](_0xfacf('0xc'),_0x5b16bb,_0xfacf('0xd'),JSON[_0xfacf('0xe')](_0x2fcef3));if(_0x2fcef3[_0xfacf('0xf')]){if(_0x2fcef3[_0xfacf('0xf')][_0xfacf('0x10')]===0x1f4){logger[_0xfacf('0xf')]('SalesforceConfiguration,\x20%s,\x20%s',_0x5b16bb,_0x2fcef3[_0xfacf('0xf')]['message']);return _0x56f42b(_0x2fcef3['error']['message']);}logger[_0xfacf('0xf')](_0xfacf('0x11'),_0x5b16bb,_0x2fcef3[_0xfacf('0xf')][_0xfacf('0x12')]);return _0x26b027(_0x2fcef3[_0xfacf('0xf')][_0xfacf('0x12')]);}else{logger[_0xfacf('0xb')](_0xfacf('0x11'),_0x5b16bb,_0xfacf('0xd'));_0x26b027(_0x2fcef3[_0xfacf('0x13')][_0xfacf('0x12')]);}})[_0xfacf('0x14')](function(_0x24b486){logger['error'](_0xfacf('0x11'),_0x5b16bb,_0x24b486);_0x56f42b(_0x24b486);});});} \ No newline at end of file +var _0xdb96=['debug','error','code','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent'];(function(_0x3a0113,_0x3f2ade){var _0x13aa03=function(_0x24c0cd){while(--_0x24c0cd){_0x3a0113['push'](_0x3a0113['shift']());}};_0x13aa03(++_0x3f2ade);}(_0xdb96,0x89));var _0x6db9=function(_0x458d44,_0x45224c){_0x458d44=_0x458d44-0x0;var _0x5ac860=_0xdb96[_0x458d44];return _0x5ac860;};'use strict';var _=require(_0x6db9('0x0'));var util=require(_0x6db9('0x1'));var moment=require(_0x6db9('0x2'));var BPromise=require('bluebird');var rs=require(_0x6db9('0x3'));var fs=require('fs');var Redis=require(_0x6db9('0x4'));var db=require(_0x6db9('0x5'))['db'];var utils=require(_0x6db9('0x6'));var logger=require(_0x6db9('0x7'))(_0x6db9('0x8'));var config=require(_0x6db9('0x9'));var jayson=require(_0x6db9('0xa'));var client=jayson[_0x6db9('0xb')][_0x6db9('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x427fc4,_0x433f31,_0x2cce19){return new BPromise(function(_0x5b901a,_0x2d978c){return client[_0x6db9('0xd')](_0x427fc4,_0x2cce19)['then'](function(_0x1f7e30){logger[_0x6db9('0xe')](_0x6db9('0xf'),_0x433f31,_0x6db9('0x10'));logger[_0x6db9('0x11')]('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0x433f31,_0x6db9('0x10'),JSON['stringify'](_0x1f7e30));if(_0x1f7e30[_0x6db9('0x12')]){if(_0x1f7e30['error'][_0x6db9('0x13')]===0x1f4){logger[_0x6db9('0x12')](_0x6db9('0xf'),_0x433f31,_0x1f7e30[_0x6db9('0x12')][_0x6db9('0x14')]);return _0x2d978c(_0x1f7e30['error']['message']);}logger[_0x6db9('0x12')](_0x6db9('0xf'),_0x433f31,_0x1f7e30[_0x6db9('0x12')][_0x6db9('0x14')]);return _0x5b901a(_0x1f7e30[_0x6db9('0x12')][_0x6db9('0x14')]);}else{logger[_0x6db9('0xe')]('SalesforceConfiguration,\x20%s,\x20%s',_0x433f31,_0x6db9('0x10'));_0x5b901a(_0x1f7e30[_0x6db9('0x15')][_0x6db9('0x14')]);}})['catch'](function(_0xfd780){logger[_0x6db9('0x12')](_0x6db9('0xf'),_0x433f31,_0xfd780);_0x2d978c(_0xfd780);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index bfcf812..a81d54c 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 _0x3c14=['multer','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','get','isAuthenticated','index','create','update','destroy','exports'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0x3c14,0x186));var _0x43c1=function(_0x5d860f,_0x467498){_0x5d860f=_0x5d860f-0x0;var _0x236490=_0x3c14[_0x5d860f];return _0x236490;};'use strict';var multer=require(_0x43c1('0x0'));var util=require('util');var path=require(_0x43c1('0x1'));var timeout=require(_0x43c1('0x2'));var express=require(_0x43c1('0x3'));var router=express['Router']();var fs_extra=require(_0x43c1('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x43c1('0x5'));var config=require(_0x43c1('0x6'));var controller=require(_0x43c1('0x7'));router[_0x43c1('0x8')]('/',auth[_0x43c1('0x9')](),controller[_0x43c1('0xa')]);router[_0x43c1('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x43c1('0xb')]);router['put']('/:id',auth[_0x43c1('0x9')](),controller[_0x43c1('0xc')]);router['delete']('/:id',auth[_0x43c1('0x9')](),controller[_0x43c1('0xd')]);module[_0x43c1('0xe')]=router; \ No newline at end of file +var _0x267b=['create','put','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','get','isAuthenticated','index','/:id','show','post'];(function(_0x1b25c1,_0x2c6ce6){var _0x1e4447=function(_0xaaafca){while(--_0xaaafca){_0x1b25c1['push'](_0x1b25c1['shift']());}};_0x1e4447(++_0x2c6ce6);}(_0x267b,0x83));var _0xb267=function(_0x363731,_0x499baf){_0x363731=_0x363731-0x0;var _0x3c1172=_0x267b[_0x363731];return _0x3c1172;};'use strict';var multer=require(_0xb267('0x0'));var util=require('util');var path=require(_0xb267('0x1'));var timeout=require(_0xb267('0x2'));var express=require(_0xb267('0x3'));var router=express[_0xb267('0x4')]();var fs_extra=require(_0xb267('0x5'));var auth=require(_0xb267('0x6'));var interaction=require(_0xb267('0x7'));var config=require(_0xb267('0x8'));var controller=require(_0xb267('0x9'));router[_0xb267('0xa')]('/',auth[_0xb267('0xb')](),controller[_0xb267('0xc')]);router['get'](_0xb267('0xd'),auth[_0xb267('0xb')](),controller[_0xb267('0xe')]);router[_0xb267('0xf')]('/',auth['isAuthenticated'](),controller[_0xb267('0x10')]);router[_0xb267('0x11')](_0xb267('0xd'),auth[_0xb267('0xb')](),controller['update']);router[_0xb267('0x12')](_0xb267('0xd'),auth['isAuthenticated'](),controller[_0xb267('0x13')]);module[_0xb267('0x14')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index 0073f2e..005fb0d 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 _0xe057=['sequelize','exports','ENUM','string','variable','customVariable','picklist','STRING'];(function(_0x61e0e,_0x121e46){var _0x869704=function(_0x456142){while(--_0x456142){_0x61e0e['push'](_0x61e0e['shift']());}};_0x869704(++_0x121e46);}(_0xe057,0x170));var _0x7e05=function(_0x1d70d1,_0x2c74f4){_0x1d70d1=_0x1d70d1-0x0;var _0x4acc42=_0xe057[_0x1d70d1];return _0x4acc42;};'use strict';var Sequelize=require(_0x7e05('0x0'));module[_0x7e05('0x1')]={'type':{'type':Sequelize[_0x7e05('0x2')](_0x7e05('0x3'),_0x7e05('0x4'),_0x7e05('0x5'),'keyValue',_0x7e05('0x6')),'defaultValue':_0x7e05('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x7e05('0x7')]},'keyType':{'type':Sequelize[_0x7e05('0x2')]('string',_0x7e05('0x4'),_0x7e05('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x7e05('0x7')]},'variableName':{'type':Sequelize[_0x7e05('0x7')]}}; \ No newline at end of file +var _0x1f8f=['exports','ENUM','string','variable','keyValue','STRING','customVariable','sequelize'];(function(_0x49ec46,_0x5053f9){var _0x537d69=function(_0x1707fe){while(--_0x1707fe){_0x49ec46['push'](_0x49ec46['shift']());}};_0x537d69(++_0x5053f9);}(_0x1f8f,0x77));var _0xf1f8=function(_0x48ab92,_0x44747b){_0x48ab92=_0x48ab92-0x0;var _0x5e2d14=_0x1f8f[_0x48ab92];return _0x5e2d14;};'use strict';var Sequelize=require(_0xf1f8('0x0'));module[_0xf1f8('0x1')]={'type':{'type':Sequelize[_0xf1f8('0x2')](_0xf1f8('0x3'),_0xf1f8('0x4'),'customVariable',_0xf1f8('0x5'),'picklist'),'defaultValue':_0xf1f8('0x3')},'content':{'type':Sequelize[_0xf1f8('0x6')]},'key':{'type':Sequelize[_0xf1f8('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0xf1f8('0x3'),_0xf1f8('0x4'),_0xf1f8('0x7'))},'keyContent':{'type':Sequelize[_0xf1f8('0x6')]},'idField':{'type':Sequelize[_0xf1f8('0x6')]},'variableName':{'type':Sequelize[_0xf1f8('0x6')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index 7e25b7d..5aaed97 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 _0xcbca=['undefined','limit','count','offset','set','Content-Range','apply','reject','update','destroy','end','sendStatus','error','stack','name','send','index','map','SalesforceField','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filters','filter','merge','where','options','includeAll','include','findAll','then','rows','params','length','find','catch','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','to-csv','ejs','fs-extra','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json'];(function(_0x5a1c84,_0x4ab450){var _0x263303=function(_0x58d475){while(--_0x58d475){_0x5a1c84['push'](_0x5a1c84['shift']());}};_0x263303(++_0x4ab450);}(_0xcbca,0x14c));var _0xacbc=function(_0x25572c,_0x4e3621){_0x25572c=_0x25572c-0x0;var _0x59bd2e=_0xcbca[_0x25572c];return _0x59bd2e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xacbc('0x0'));var zipdir=require(_0xacbc('0x1'));var jsonpatch=require(_0xacbc('0x2'));var rp=require(_0xacbc('0x3'));var moment=require(_0xacbc('0x4'));var BPromise=require(_0xacbc('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xacbc('0x6'));var sox=require('sox');var csv=require(_0xacbc('0x7'));var ejs=require(_0xacbc('0x8'));var fs=require('fs');var fs_extra=require(_0xacbc('0x9'));var _=require('lodash');var squel=require(_0xacbc('0xa'));var crypto=require(_0xacbc('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xacbc('0xc'));var Papa=require(_0xacbc('0xd'));var Redis=require(_0xacbc('0xe'));var authService=require(_0xacbc('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xacbc('0x10'));var utils=require(_0xacbc('0x11'));var config=require(_0xacbc('0x12'));var licenseUtil=require(_0xacbc('0x13'));var db=require(_0xacbc('0x14'))['db'];function respondWithStatusCode(_0x2dc9ac,_0x563835){_0x563835=_0x563835||0xcc;return function(_0x2fb6a9){if(_0x2fb6a9){return _0x2dc9ac['sendStatus'](_0x563835);}return _0x2dc9ac[_0xacbc('0x15')](_0x563835)['end']();};}function respondWithResult(_0x18a3a0,_0x43b837){_0x43b837=_0x43b837||0xc8;return function(_0x104dc3){if(_0x104dc3){return _0x18a3a0[_0xacbc('0x15')](_0x43b837)[_0xacbc('0x16')](_0x104dc3);}};}function respondWithFilteredResult(_0x435617,_0x25f63b){return function(_0x361548){if(_0x361548){var _0x3466eb=typeof _0x25f63b['offset']===_0xacbc('0x17')&&typeof _0x25f63b[_0xacbc('0x18')]===_0xacbc('0x17');var _0x283d60=_0x361548[_0xacbc('0x19')];var _0x513350=_0x3466eb?0x0:_0x25f63b['offset'];var _0x348e81=_0x3466eb?_0x361548['count']:_0x25f63b[_0xacbc('0x1a')]+_0x25f63b[_0xacbc('0x18')];var _0x39e107;if(_0x348e81>=_0x283d60){_0x348e81=_0x283d60;_0x39e107=0xc8;}else{_0x39e107=0xce;}_0x435617['status'](_0x39e107);return _0x435617[_0xacbc('0x1b')](_0xacbc('0x1c'),_0x513350+'-'+_0x348e81+'/'+_0x283d60)['json'](_0x361548);}return null;};}function patchUpdates(_0x396c01){return function(_0x37d86c){try{jsonpatch[_0xacbc('0x1d')](_0x37d86c,_0x396c01,!![]);}catch(_0x179ac1){return BPromise[_0xacbc('0x1e')](_0x179ac1);}return _0x37d86c['save']();};}function saveUpdates(_0x1828ee,_0x50df7){return function(_0x312eb5){if(_0x312eb5){return _0x312eb5[_0xacbc('0x1f')](_0x1828ee)['then'](function(_0x16c190){return _0x16c190;});}return null;};}function removeEntity(_0x38cf0b,_0x92f54e){return function(_0x663d14){if(_0x663d14){return _0x663d14[_0xacbc('0x20')]()['then'](function(){_0x38cf0b['status'](0xcc)[_0xacbc('0x21')]();});}};}function handleEntityNotFound(_0x4587d1,_0x28083f){return function(_0x54f64a){if(!_0x54f64a){_0x4587d1[_0xacbc('0x22')](0x194);}return _0x54f64a;};}function handleError(_0x110c4b,_0x19af26){_0x19af26=_0x19af26||0x1f4;return function(_0x16fb97){logger[_0xacbc('0x23')](_0x16fb97[_0xacbc('0x24')]);if(_0x16fb97['name']){delete _0x16fb97[_0xacbc('0x25')];}_0x110c4b[_0xacbc('0x15')](_0x19af26)[_0xacbc('0x26')](_0x16fb97);};}exports[_0xacbc('0x27')]=function(_0x40986b,_0x19d82e){var _0x4b9959={},_0x20190b={},_0x40f19a={'count':0x0,'rows':[]};var _0x23fa4c=_[_0xacbc('0x28')](db[_0xacbc('0x29')][_0xacbc('0x2a')],function(_0x2a65d3){return{'name':_0x2a65d3['fieldName'],'type':_0x2a65d3[_0xacbc('0x2b')][_0xacbc('0x2c')]};});_0x20190b[_0xacbc('0x2d')]=_[_0xacbc('0x28')](_0x23fa4c,'name');_0x20190b[_0xacbc('0x2e')]=_[_0xacbc('0x2f')](_0x40986b[_0xacbc('0x2e')]);_0x20190b['filters']=_[_0xacbc('0x30')](_0x20190b['model'],_0x20190b[_0xacbc('0x2e')]);_0x4b9959[_0xacbc('0x31')]=_['intersection'](_0x20190b[_0xacbc('0x2d')],qs[_0xacbc('0x32')](_0x40986b['query'][_0xacbc('0x32')]));_0x4b9959[_0xacbc('0x31')]=_0x4b9959[_0xacbc('0x31')]['length']?_0x4b9959[_0xacbc('0x31')]:_0x20190b[_0xacbc('0x2d')];if(!_0x40986b[_0xacbc('0x2e')][_0xacbc('0x33')](_0xacbc('0x34'))){_0x4b9959[_0xacbc('0x18')]=qs[_0xacbc('0x18')](_0x40986b[_0xacbc('0x2e')][_0xacbc('0x18')]);_0x4b9959[_0xacbc('0x1a')]=qs[_0xacbc('0x1a')](_0x40986b[_0xacbc('0x2e')][_0xacbc('0x1a')]);}_0x4b9959[_0xacbc('0x35')]=qs[_0xacbc('0x36')](_0x40986b[_0xacbc('0x2e')][_0xacbc('0x36')]);_0x4b9959['where']=qs['filters'](_['pick'](_0x40986b[_0xacbc('0x2e')],_0x20190b[_0xacbc('0x37')]),_0x23fa4c);if(_0x40986b['query'][_0xacbc('0x38')]){_0x4b9959['where']=_[_0xacbc('0x39')](_0x4b9959[_0xacbc('0x3a')],{'$or':_[_0xacbc('0x28')](_0x23fa4c,function(_0x36e01b){if(_0x36e01b['type']!=='VIRTUAL'){var _0x3c252a={};_0x3c252a[_0x36e01b['name']]={'$like':'%'+_0x40986b[_0xacbc('0x2e')][_0xacbc('0x38')]+'%'};return _0x3c252a;}})});}_0x4b9959=_['merge']({},_0x4b9959,_0x40986b[_0xacbc('0x3b')]);var _0x2d5943={'where':_0x4b9959[_0xacbc('0x3a')]};return db[_0xacbc('0x29')][_0xacbc('0x19')](_0x2d5943)['then'](function(_0x3eca83){_0x40f19a[_0xacbc('0x19')]=_0x3eca83;if(_0x40986b[_0xacbc('0x2e')][_0xacbc('0x3c')]){_0x4b9959[_0xacbc('0x3d')]=[{'all':!![]}];}return db[_0xacbc('0x29')][_0xacbc('0x3e')](_0x4b9959);})[_0xacbc('0x3f')](function(_0x16cc2f){_0x40f19a[_0xacbc('0x40')]=_0x16cc2f;return _0x40f19a;})['then'](respondWithFilteredResult(_0x19d82e,_0x4b9959))['catch'](handleError(_0x19d82e,null));};exports['show']=function(_0x429f9e,_0x306f99){var _0x3b6c77={'raw':!![],'where':{'id':_0x429f9e[_0xacbc('0x41')]['id']}},_0x589a42={};_0x589a42[_0xacbc('0x2d')]=_[_0xacbc('0x2f')](db[_0xacbc('0x29')][_0xacbc('0x2a')]);_0x589a42['query']=_[_0xacbc('0x2f')](_0x429f9e[_0xacbc('0x2e')]);_0x589a42[_0xacbc('0x37')]=_['intersection'](_0x589a42[_0xacbc('0x2d')],_0x589a42[_0xacbc('0x2e')]);_0x3b6c77['attributes']=_['intersection'](_0x589a42['model'],qs[_0xacbc('0x32')](_0x429f9e[_0xacbc('0x2e')][_0xacbc('0x32')]));_0x3b6c77['attributes']=_0x3b6c77['attributes'][_0xacbc('0x42')]?_0x3b6c77['attributes']:_0x589a42[_0xacbc('0x2d')];if(_0x429f9e['query']['includeAll']){_0x3b6c77[_0xacbc('0x3d')]=[{'all':!![]}];}_0x3b6c77=_['merge']({},_0x3b6c77,_0x429f9e['options']);return db[_0xacbc('0x29')][_0xacbc('0x43')](_0x3b6c77)[_0xacbc('0x3f')](handleEntityNotFound(_0x306f99,null))['then'](respondWithResult(_0x306f99,null))[_0xacbc('0x44')](handleError(_0x306f99,null));};exports[_0xacbc('0x45')]=function(_0x3734ab,_0x54b574){return db[_0xacbc('0x29')][_0xacbc('0x45')](_0x3734ab[_0xacbc('0x46')],{})[_0xacbc('0x3f')](respondWithResult(_0x54b574,0xc9))[_0xacbc('0x44')](handleError(_0x54b574,null));};exports[_0xacbc('0x1f')]=function(_0x54496d,_0x112598){if(_0x54496d['body']['id']){delete _0x54496d['body']['id'];}return db[_0xacbc('0x29')][_0xacbc('0x43')]({'where':{'id':_0x54496d[_0xacbc('0x41')]['id']}})[_0xacbc('0x3f')](handleEntityNotFound(_0x112598,null))['then'](saveUpdates(_0x54496d[_0xacbc('0x46')],null))['then'](respondWithResult(_0x112598,null))[_0xacbc('0x44')](handleError(_0x112598,null));};exports['destroy']=function(_0x5a6c42,_0x47e80f){return db['SalesforceField'][_0xacbc('0x43')]({'where':{'id':_0x5a6c42['params']['id']}})[_0xacbc('0x3f')](handleEntityNotFound(_0x47e80f,null))[_0xacbc('0x3f')](removeEntity(_0x47e80f,null))['catch'](handleError(_0x47e80f,null));}; \ No newline at end of file +var _0x1cf7=['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','limit','count','offset','set','Content-Range','json','apply','save','update','then','destroy','error','name','send','map','SalesforceField','fieldName','type','key','keys','query','filters','intersection','fields','attributes','length','model','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','params','rawAttributes','find','create','body','catch','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring'];(function(_0x52d481,_0x5cef5c){var _0x3c4aa7=function(_0x4ba1a6){while(--_0x4ba1a6){_0x52d481['push'](_0x52d481['shift']());}};_0x3c4aa7(++_0x5cef5c);}(_0x1cf7,0x16a));var _0x71cf=function(_0x36a910,_0x2f992c){_0x36a910=_0x36a910-0x0;var _0x4e7ae7=_0x1cf7[_0x36a910];return _0x4e7ae7;};'use strict';var emlformat=require(_0x71cf('0x0'));var rimraf=require(_0x71cf('0x1'));var zipdir=require(_0x71cf('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x71cf('0x3'));var moment=require('moment');var BPromise=require(_0x71cf('0x4'));var Mustache=require(_0x71cf('0x5'));var util=require(_0x71cf('0x6'));var path=require(_0x71cf('0x7'));var sox=require(_0x71cf('0x8'));var csv=require(_0x71cf('0x9'));var ejs=require(_0x71cf('0xa'));var fs=require('fs');var fs_extra=require(_0x71cf('0xb'));var _=require(_0x71cf('0xc'));var squel=require(_0x71cf('0xd'));var crypto=require(_0x71cf('0xe'));var jsforce=require(_0x71cf('0xf'));var deskjs=require(_0x71cf('0x10'));var toCsv=require(_0x71cf('0x9'));var querystring=require(_0x71cf('0x11'));var Papa=require(_0x71cf('0x12'));var Redis=require(_0x71cf('0x13'));var authService=require(_0x71cf('0x14'));var qs=require(_0x71cf('0x15'));var as=require(_0x71cf('0x16'));var hardwareService=require(_0x71cf('0x17'));var logger=require(_0x71cf('0x18'))(_0x71cf('0x19'));var utils=require(_0x71cf('0x1a'));var config=require(_0x71cf('0x1b'));var licenseUtil=require(_0x71cf('0x1c'));var db=require(_0x71cf('0x1d'))['db'];function respondWithStatusCode(_0x5af78a,_0x370582){_0x370582=_0x370582||0xcc;return function(_0x159f30){if(_0x159f30){return _0x5af78a[_0x71cf('0x1e')](_0x370582);}return _0x5af78a[_0x71cf('0x1f')](_0x370582)[_0x71cf('0x20')]();};}function respondWithResult(_0x2ac9b6,_0x17ac21){_0x17ac21=_0x17ac21||0xc8;return function(_0x4beb3e){if(_0x4beb3e){return _0x2ac9b6['status'](_0x17ac21)['json'](_0x4beb3e);}};}function respondWithFilteredResult(_0x55209f,_0x1af3f4){return function(_0x3cd502){if(_0x3cd502){var _0x5bb690=typeof _0x1af3f4['offset']==='undefined'&&typeof _0x1af3f4[_0x71cf('0x21')]==='undefined';var _0x167356=_0x3cd502[_0x71cf('0x22')];var _0x1359f8=_0x5bb690?0x0:_0x1af3f4[_0x71cf('0x23')];var _0x514e87=_0x5bb690?_0x3cd502[_0x71cf('0x22')]:_0x1af3f4[_0x71cf('0x23')]+_0x1af3f4[_0x71cf('0x21')];var _0x35e1ae;if(_0x514e87>=_0x167356){_0x514e87=_0x167356;_0x35e1ae=0xc8;}else{_0x35e1ae=0xce;}_0x55209f['status'](_0x35e1ae);return _0x55209f[_0x71cf('0x24')](_0x71cf('0x25'),_0x1359f8+'-'+_0x514e87+'/'+_0x167356)[_0x71cf('0x26')](_0x3cd502);}return null;};}function patchUpdates(_0x548b2c){return function(_0x3f9bc6){try{jsonpatch[_0x71cf('0x27')](_0x3f9bc6,_0x548b2c,!![]);}catch(_0x21ee75){return BPromise['reject'](_0x21ee75);}return _0x3f9bc6[_0x71cf('0x28')]();};}function saveUpdates(_0x2349bf,_0x533dd4){return function(_0x4efa9c){if(_0x4efa9c){return _0x4efa9c[_0x71cf('0x29')](_0x2349bf)[_0x71cf('0x2a')](function(_0x27aad4){return _0x27aad4;});}return null;};}function removeEntity(_0x453cbc,_0x226b60){return function(_0x10cb1e){if(_0x10cb1e){return _0x10cb1e[_0x71cf('0x2b')]()['then'](function(){_0x453cbc[_0x71cf('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3885b2,_0x539c9b){return function(_0x20ca19){if(!_0x20ca19){_0x3885b2[_0x71cf('0x1e')](0x194);}return _0x20ca19;};}function handleError(_0x1e9aed,_0x1a83bb){_0x1a83bb=_0x1a83bb||0x1f4;return function(_0x16524a){logger[_0x71cf('0x2c')](_0x16524a['stack']);if(_0x16524a[_0x71cf('0x2d')]){delete _0x16524a[_0x71cf('0x2d')];}_0x1e9aed[_0x71cf('0x1f')](_0x1a83bb)[_0x71cf('0x2e')](_0x16524a);};}exports['index']=function(_0x43434d,_0x191988){var _0x22f991={},_0x3c5a30={},_0x5deba7={'count':0x0,'rows':[]};var _0x55f7ba=_[_0x71cf('0x2f')](db[_0x71cf('0x30')]['rawAttributes'],function(_0x224501){return{'name':_0x224501[_0x71cf('0x31')],'type':_0x224501[_0x71cf('0x32')][_0x71cf('0x33')]};});_0x3c5a30['model']=_[_0x71cf('0x2f')](_0x55f7ba,_0x71cf('0x2d'));_0x3c5a30['query']=_[_0x71cf('0x34')](_0x43434d[_0x71cf('0x35')]);_0x3c5a30[_0x71cf('0x36')]=_[_0x71cf('0x37')](_0x3c5a30['model'],_0x3c5a30[_0x71cf('0x35')]);_0x22f991['attributes']=_[_0x71cf('0x37')](_0x3c5a30['model'],qs[_0x71cf('0x38')](_0x43434d['query']['fields']));_0x22f991[_0x71cf('0x39')]=_0x22f991[_0x71cf('0x39')][_0x71cf('0x3a')]?_0x22f991[_0x71cf('0x39')]:_0x3c5a30[_0x71cf('0x3b')];if(!_0x43434d[_0x71cf('0x35')]['hasOwnProperty']('nolimit')){_0x22f991[_0x71cf('0x21')]=qs[_0x71cf('0x21')](_0x43434d[_0x71cf('0x35')][_0x71cf('0x21')]);_0x22f991[_0x71cf('0x23')]=qs[_0x71cf('0x23')](_0x43434d[_0x71cf('0x35')][_0x71cf('0x23')]);}_0x22f991['order']=qs[_0x71cf('0x3c')](_0x43434d['query'][_0x71cf('0x3c')]);_0x22f991[_0x71cf('0x3d')]=qs[_0x71cf('0x36')](_[_0x71cf('0x3e')](_0x43434d['query'],_0x3c5a30[_0x71cf('0x36')]),_0x55f7ba);if(_0x43434d[_0x71cf('0x35')][_0x71cf('0x3f')]){_0x22f991[_0x71cf('0x3d')]=_['merge'](_0x22f991[_0x71cf('0x3d')],{'$or':_[_0x71cf('0x2f')](_0x55f7ba,function(_0x4255fa){if(_0x4255fa[_0x71cf('0x32')]!==_0x71cf('0x40')){var _0x3f48ca={};_0x3f48ca[_0x4255fa['name']]={'$like':'%'+_0x43434d[_0x71cf('0x35')][_0x71cf('0x3f')]+'%'};return _0x3f48ca;}})});}_0x22f991=_[_0x71cf('0x41')]({},_0x22f991,_0x43434d[_0x71cf('0x42')]);var _0x1999be={'where':_0x22f991[_0x71cf('0x3d')]};return db[_0x71cf('0x30')][_0x71cf('0x22')](_0x1999be)[_0x71cf('0x2a')](function(_0xac1e6b){_0x5deba7[_0x71cf('0x22')]=_0xac1e6b;if(_0x43434d[_0x71cf('0x35')][_0x71cf('0x43')]){_0x22f991[_0x71cf('0x44')]=[{'all':!![]}];}return db['SalesforceField']['findAll'](_0x22f991);})[_0x71cf('0x2a')](function(_0x4e6598){_0x5deba7[_0x71cf('0x45')]=_0x4e6598;return _0x5deba7;})[_0x71cf('0x2a')](respondWithFilteredResult(_0x191988,_0x22f991))['catch'](handleError(_0x191988,null));};exports['show']=function(_0x790194,_0x56b6d1){var _0x4b11bc={'raw':!![],'where':{'id':_0x790194[_0x71cf('0x46')]['id']}},_0x454254={};_0x454254['model']=_[_0x71cf('0x34')](db[_0x71cf('0x30')][_0x71cf('0x47')]);_0x454254[_0x71cf('0x35')]=_['keys'](_0x790194[_0x71cf('0x35')]);_0x454254[_0x71cf('0x36')]=_[_0x71cf('0x37')](_0x454254[_0x71cf('0x3b')],_0x454254['query']);_0x4b11bc[_0x71cf('0x39')]=_[_0x71cf('0x37')](_0x454254[_0x71cf('0x3b')],qs[_0x71cf('0x38')](_0x790194[_0x71cf('0x35')][_0x71cf('0x38')]));_0x4b11bc[_0x71cf('0x39')]=_0x4b11bc['attributes'][_0x71cf('0x3a')]?_0x4b11bc[_0x71cf('0x39')]:_0x454254[_0x71cf('0x3b')];if(_0x790194[_0x71cf('0x35')][_0x71cf('0x43')]){_0x4b11bc[_0x71cf('0x44')]=[{'all':!![]}];}_0x4b11bc=_['merge']({},_0x4b11bc,_0x790194[_0x71cf('0x42')]);return db['SalesforceField'][_0x71cf('0x48')](_0x4b11bc)[_0x71cf('0x2a')](handleEntityNotFound(_0x56b6d1,null))[_0x71cf('0x2a')](respondWithResult(_0x56b6d1,null))['catch'](handleError(_0x56b6d1,null));};exports[_0x71cf('0x49')]=function(_0x191363,_0x1f6d97){return db[_0x71cf('0x30')]['create'](_0x191363[_0x71cf('0x4a')],{})[_0x71cf('0x2a')](respondWithResult(_0x1f6d97,0xc9))[_0x71cf('0x4b')](handleError(_0x1f6d97,null));};exports[_0x71cf('0x29')]=function(_0x36de84,_0xe61a2){if(_0x36de84['body']['id']){delete _0x36de84['body']['id'];}return db[_0x71cf('0x30')][_0x71cf('0x48')]({'where':{'id':_0x36de84[_0x71cf('0x46')]['id']}})['then'](handleEntityNotFound(_0xe61a2,null))[_0x71cf('0x2a')](saveUpdates(_0x36de84[_0x71cf('0x4a')],null))[_0x71cf('0x2a')](respondWithResult(_0xe61a2,null))['catch'](handleError(_0xe61a2,null));};exports[_0x71cf('0x2b')]=function(_0x2f9cf5,_0x227033){return db['SalesforceField'][_0x71cf('0x48')]({'where':{'id':_0x2f9cf5[_0x71cf('0x46')]['id']}})[_0x71cf('0x2a')](handleEntityNotFound(_0x227033,null))['then'](removeEntity(_0x227033,null))[_0x71cf('0x4b')](handleError(_0x227033,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index 09023a0..9ebbb2e 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 _0x2f03=['exports','define','SalesforceField','int_salesforce_fields','idField','FieldId','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./intSalesforceField.attributes'];(function(_0x2ef44b,_0x553359){var _0x2405b9=function(_0x278290){while(--_0x278290){_0x2ef44b['push'](_0x2ef44b['shift']());}};_0x2405b9(++_0x553359);}(_0x2f03,0x68));var _0x32f0=function(_0xa8a408,_0x1e3691){_0xa8a408=_0xa8a408-0x0;var _0x2fc86c=_0x2f03[_0xa8a408];return _0x2fc86c;};'use strict';var _=require('lodash');var util=require(_0x32f0('0x0'));var logger=require(_0x32f0('0x1'))(_0x32f0('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x32f0('0x3'));var fs=require('fs');var path=require(_0x32f0('0x4'));var rimraf=require(_0x32f0('0x5'));var config=require(_0x32f0('0x6'));var attributes=require(_0x32f0('0x7'));module[_0x32f0('0x8')]=function(_0x497648,_0x329e01){return _0x497648[_0x32f0('0x9')](_0x32f0('0xa'),attributes,{'tableName':_0x32f0('0xb'),'paranoid':![],'indexes':[{'name':'salesforce_unique_index','fields':[_0x32f0('0xc'),_0x32f0('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9f3e=['SalesforceField','int_salesforce_fields','idField','FieldId','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSalesforceField.attributes','exports','define'];(function(_0x4f32b4,_0x279b5d){var _0x2ce940=function(_0x146212){while(--_0x146212){_0x4f32b4['push'](_0x4f32b4['shift']());}};_0x2ce940(++_0x279b5d);}(_0x9f3e,0x18a));var _0xe9f3=function(_0x2cf8c5,_0x23a795){_0x2cf8c5=_0x2cf8c5-0x0;var _0x541120=_0x9f3e[_0x2cf8c5];return _0x541120;};'use strict';var _=require(_0xe9f3('0x0'));var util=require('util');var logger=require(_0xe9f3('0x1'))('api');var moment=require(_0xe9f3('0x2'));var BPromise=require(_0xe9f3('0x3'));var rp=require(_0xe9f3('0x4'));var fs=require('fs');var path=require(_0xe9f3('0x5'));var rimraf=require(_0xe9f3('0x6'));var config=require(_0xe9f3('0x7'));var attributes=require(_0xe9f3('0x8'));module[_0xe9f3('0x9')]=function(_0x1061e2,_0x31d9b1){return _0x1061e2[_0xe9f3('0xa')](_0xe9f3('0xb'),attributes,{'tableName':_0xe9f3('0xc'),'paranoid':![],'indexes':[{'name':'salesforce_unique_index','fields':[_0xe9f3('0xd'),_0xe9f3('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.rpc.js b/server/api/intSalesforceField/intSalesforceField.rpc.js index 2c22949..18be1cb 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 _0x9a35=['request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SalesforceField,\x20%s,\x20%s','info','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','request','then'];(function(_0x2e61f2,_0x346b06){var _0x2e1e3d=function(_0x3a56e9){while(--_0x3a56e9){_0x2e61f2['push'](_0x2e61f2['shift']());}};_0x2e1e3d(++_0x346b06);}(_0x9a35,0x8f));var _0x59a3=function(_0x2ba760,_0x5eaceb){_0x2ba760=_0x2ba760-0x0;var _0x32438a=_0x9a35[_0x2ba760];return _0x32438a;};'use strict';var _=require('lodash');var util=require(_0x59a3('0x0'));var moment=require(_0x59a3('0x1'));var BPromise=require(_0x59a3('0x2'));var rs=require(_0x59a3('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x59a3('0x4'))['db'];var utils=require(_0x59a3('0x5'));var logger=require(_0x59a3('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x59a3('0x7'));var client=jayson['client'][_0x59a3('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3c73a5,_0x2b117c,_0x27b4a9){return new BPromise(function(_0x34f6af,_0x4d745c){return client[_0x59a3('0x9')](_0x3c73a5,_0x27b4a9)[_0x59a3('0xa')](function(_0x3a7397){logger['info']('SalesforceField,\x20%s,\x20%s',_0x2b117c,_0x59a3('0xb'));logger[_0x59a3('0xc')](_0x59a3('0xd'),_0x2b117c,'request\x20sent',JSON[_0x59a3('0xe')](_0x3a7397));if(_0x3a7397[_0x59a3('0xf')]){if(_0x3a7397['error'][_0x59a3('0x10')]===0x1f4){logger[_0x59a3('0xf')]('SalesforceField,\x20%s,\x20%s',_0x2b117c,_0x3a7397[_0x59a3('0xf')]['message']);return _0x4d745c(_0x3a7397[_0x59a3('0xf')][_0x59a3('0x11')]);}logger[_0x59a3('0xf')](_0x59a3('0x12'),_0x2b117c,_0x3a7397[_0x59a3('0xf')][_0x59a3('0x11')]);return _0x34f6af(_0x3a7397['error'][_0x59a3('0x11')]);}else{logger[_0x59a3('0x13')]('SalesforceField,\x20%s,\x20%s',_0x2b117c,'request\x20sent');_0x34f6af(_0x3a7397[_0x59a3('0x14')][_0x59a3('0x11')]);}})[_0x59a3('0x15')](function(_0x400942){logger[_0x59a3('0xf')]('SalesforceField,\x20%s,\x20%s',_0x2b117c,_0x400942);_0x4d745c(_0x400942);});});} \ No newline at end of file +var _0x9624=['code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http','then','info','SalesforceField,\x20%s,\x20%s','request\x20sent','error'];(function(_0x3a0ebd,_0x47f368){var _0x51a660=function(_0x4023e6){while(--_0x4023e6){_0x3a0ebd['push'](_0x3a0ebd['shift']());}};_0x51a660(++_0x47f368);}(_0x9624,0x1a8));var _0x4962=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9624[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x4962('0x0'));var util=require(_0x4962('0x1'));var moment=require(_0x4962('0x2'));var BPromise=require(_0x4962('0x3'));var rs=require(_0x4962('0x4'));var fs=require('fs');var Redis=require(_0x4962('0x5'));var db=require(_0x4962('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x4962('0x7'));var config=require(_0x4962('0x8'));var jayson=require(_0x4962('0x9'));var client=jayson['client'][_0x4962('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x31956e,_0x3468bb,_0x1dde29){return new BPromise(function(_0x5679a2,_0x2eee22){return client['request'](_0x31956e,_0x1dde29)[_0x4962('0xb')](function(_0x5bf527){logger[_0x4962('0xc')](_0x4962('0xd'),_0x3468bb,_0x4962('0xe'));logger['debug']('SalesforceField,\x20%s,\x20%s,\x20%s',_0x3468bb,_0x4962('0xe'),JSON['stringify'](_0x5bf527));if(_0x5bf527['error']){if(_0x5bf527[_0x4962('0xf')][_0x4962('0x10')]===0x1f4){logger[_0x4962('0xf')](_0x4962('0xd'),_0x3468bb,_0x5bf527[_0x4962('0xf')][_0x4962('0x11')]);return _0x2eee22(_0x5bf527['error'][_0x4962('0x11')]);}logger['error'](_0x4962('0xd'),_0x3468bb,_0x5bf527[_0x4962('0xf')][_0x4962('0x11')]);return _0x5679a2(_0x5bf527[_0x4962('0xf')][_0x4962('0x11')]);}else{logger[_0x4962('0xc')]('SalesforceField,\x20%s,\x20%s',_0x3468bb,_0x4962('0xe'));_0x5679a2(_0x5bf527[_0x4962('0x12')][_0x4962('0x11')]);}})[_0x4962('0x13')](function(_0xa9fc35){logger[_0x4962('0xf')]('SalesforceField,\x20%s,\x20%s',_0x3468bb,_0xa9fc35);_0x2eee22(_0xa9fc35);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index 30cd387..5d04135 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 _0x4747=['update','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','isAuthenticated','index','/:id','show','get','/:id/configurations','/:id/fields','post','create','addConfiguration'];(function(_0x359405,_0x5e803c){var _0x1ea410=function(_0x5f1375){while(--_0x5f1375){_0x359405['push'](_0x359405['shift']());}};_0x1ea410(++_0x5e803c);}(_0x4747,0xc9));var _0x7474=function(_0x31a51b,_0x4775e8){_0x31a51b=_0x31a51b-0x0;var _0x38d5d8=_0x4747[_0x31a51b];return _0x38d5d8;};'use strict';var multer=require(_0x7474('0x0'));var util=require('util');var path=require(_0x7474('0x1'));var timeout=require(_0x7474('0x2'));var express=require(_0x7474('0x3'));var router=express[_0x7474('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x7474('0x5'));var interaction=require(_0x7474('0x6'));var config=require(_0x7474('0x7'));var controller=require(_0x7474('0x8'));router['get']('/',auth[_0x7474('0x9')](),controller[_0x7474('0xa')]);router['get'](_0x7474('0xb'),auth[_0x7474('0x9')](),controller[_0x7474('0xc')]);router[_0x7474('0xd')](_0x7474('0xe'),auth[_0x7474('0x9')](),controller['getConfigurations']);router['get'](_0x7474('0xf'),auth[_0x7474('0x9')](),controller['getFields']);router[_0x7474('0x10')]('/',auth[_0x7474('0x9')](),controller[_0x7474('0x11')]);router[_0x7474('0x10')](_0x7474('0xe'),auth['isAuthenticated'](),controller[_0x7474('0x12')]);router['put'](_0x7474('0xb'),auth['isAuthenticated'](),controller[_0x7474('0x13')]);router['delete']('/:id',auth[_0x7474('0x9')](),controller[_0x7474('0x14')]);module[_0x7474('0x15')]=router; \ No newline at end of file +var _0x8623=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','index','get','/:id','isAuthenticated','show','/:id/configurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','path','Router','fs-extra'];(function(_0x24a2fc,_0x43bf97){var _0x42478e=function(_0x14aa1d){while(--_0x14aa1d){_0x24a2fc['push'](_0x24a2fc['shift']());}};_0x42478e(++_0x43bf97);}(_0x8623,0x194));var _0x3862=function(_0x1817f7,_0x56a0db){_0x1817f7=_0x1817f7-0x0;var _0x4d1970=_0x8623[_0x1817f7];return _0x4d1970;};'use strict';var multer=require(_0x3862('0x0'));var util=require('util');var path=require(_0x3862('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x3862('0x2')]();var fs_extra=require(_0x3862('0x3'));var auth=require(_0x3862('0x4'));var interaction=require(_0x3862('0x5'));var config=require(_0x3862('0x6'));var controller=require(_0x3862('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x3862('0x8')]);router[_0x3862('0x9')](_0x3862('0xa'),auth[_0x3862('0xb')](),controller[_0x3862('0xc')]);router[_0x3862('0x9')](_0x3862('0xd'),auth[_0x3862('0xb')](),controller['getConfigurations']);router[_0x3862('0x9')](_0x3862('0xe'),auth[_0x3862('0xb')](),controller[_0x3862('0xf')]);router[_0x3862('0x10')]('/',auth[_0x3862('0xb')](),controller[_0x3862('0x11')]);router[_0x3862('0x10')](_0x3862('0xd'),auth['isAuthenticated'](),controller[_0x3862('0x12')]);router[_0x3862('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x3862('0x14')]);router[_0x3862('0x15')](_0x3862('0xa'),auth['isAuthenticated'](),controller[_0x3862('0x16')]);module[_0x3862('0x17')]=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index 68b70d3..5088119 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 _0xd96f=['remoteUri','exports','STRING'];(function(_0x30aa90,_0x47e9b3){var _0x2a7b4b=function(_0x2213aa){while(--_0x2213aa){_0x30aa90['push'](_0x30aa90['shift']());}};_0x2a7b4b(++_0x47e9b3);}(_0xd96f,0x11e));var _0xfd96=function(_0x69e2ac,_0x46e136){_0x69e2ac=_0x69e2ac-0x0;var _0x200154=_0xd96f[_0x69e2ac];return _0x200154;};'use strict';var Sequelize=require('sequelize');module[_0xfd96('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xfd96('0x1')],'unique':'username'},'password':{'type':Sequelize[_0xfd96('0x1')]},'email':{'type':Sequelize[_0xfd96('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0xfd96('0x2')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0xaf3c=['STRING','username','sequelize'];(function(_0xf50820,_0x56f041){var _0x2a9b10=function(_0x33f0f4){while(--_0x33f0f4){_0xf50820['push'](_0xf50820['shift']());}};_0x2a9b10(++_0x56f041);}(_0xaf3c,0xd4));var _0xcaf3=function(_0x3ab2ef,_0x3c4b8f){_0x3ab2ef=_0x3ab2ef-0x0;var _0x182238=_0xaf3c[_0x3ab2ef];return _0x182238;};'use strict';var Sequelize=require(_0xcaf3('0x0'));module['exports']={'name':{'type':Sequelize[_0xcaf3('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xcaf3('0x1')],'unique':_0xcaf3('0x2')},'password':{'type':Sequelize[_0xcaf3('0x1')]},'email':{'type':Sequelize[_0xcaf3('0x1')]},'remoteUri':{'type':Sequelize[_0xcaf3('0x1')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0xcaf3('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js index 0011197..99e8b1c 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 _0x12f2=['query','intersection','fields','attributes','length','sort','pick','filters','filter','where','VIRTUAL','includeAll','include','rows','catch','show','merge','find','create','body','params','getConfigurations','findOne','ServicenowConfiguration','options','hasOwnProperty','nolimit','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','ServicenowField','getFields','made_sla','hold_reason','close_code','incident_state','parent','watch_list','child_incidents','approval_history','sys_updated_by','opened_by','user_input','sys_created_on','state','sys_created_by','knowledge','order','cmdb_ci','delivery_plan','impact','active','work_notes_list','business_service','priority','sys_domain_path','rfc','time_worked','expected_start','opened_at','group_list','work_end','reopened_time','resolved_at','work_notes','short_description','correlation_display','delivery_task','work_start','additional_assignee_list','description','calendar_duration','notify','sys_class_name','close_notes','closed_by','follow_up','parent_incident','sys_id','urgency','company','activity_due','severity','approval','comments_and_work_notes','due_date','sys_tags','escalation','upon_approval','correlation_id','category','username','password','email','remoteUri','serverUrl','slice','substring','format','%s/api/now/doc/table/schema/','GET','incident?sysparm_display_value=all','result','assign','includes','forEach','internalType','push','log','TCL:\x20_object','remove','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','label','all','test','statusCode','Wrong\x20credentials','True','true','False','false','sys_choice?sysparm_query=name=incident^element=','inactive','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','sox','to-csv','ejs','fs-extra','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','ServicenowAccount','fieldName','type','key','model','keys'];(function(_0x239dfc,_0x2389ee){var _0x2fb1bf=function(_0x20d992){while(--_0x20d992){_0x239dfc['push'](_0x239dfc['shift']());}};_0x2fb1bf(++_0x2389ee);}(_0x12f2,0x7e));var _0x212f=function(_0x2ac8c5,_0x5a4d96){_0x2ac8c5=_0x2ac8c5-0x0;var _0x149647=_0x12f2[_0x2ac8c5];return _0x149647;};'use strict';var emlformat=require(_0x212f('0x0'));var rimraf=require(_0x212f('0x1'));var zipdir=require(_0x212f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x212f('0x3'));var moment=require('moment');var BPromise=require(_0x212f('0x4'));var Mustache=require(_0x212f('0x5'));var util=require('util');var path=require('path');var sox=require(_0x212f('0x6'));var csv=require(_0x212f('0x7'));var ejs=require(_0x212f('0x8'));var fs=require('fs');var fs_extra=require(_0x212f('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x212f('0xa'));var toCsv=require('to-csv');var querystring=require(_0x212f('0xb'));var Papa=require(_0x212f('0xc'));var Redis=require(_0x212f('0xd'));var authService=require(_0x212f('0xe'));var qs=require(_0x212f('0xf'));var as=require(_0x212f('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x212f('0x11'))('api');var utils=require(_0x212f('0x12'));var config=require(_0x212f('0x13'));var licenseUtil=require(_0x212f('0x14'));var db=require(_0x212f('0x15'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x45a320,_0x5dcf16){_0x5dcf16=_0x5dcf16||0xcc;return function(_0x328be2){if(_0x328be2){return _0x45a320['sendStatus'](_0x5dcf16);}return _0x45a320[_0x212f('0x16')](_0x5dcf16)[_0x212f('0x17')]();};}function respondWithResult(_0x5866b1,_0x1b963a){_0x1b963a=_0x1b963a||0xc8;return function(_0x369196){if(_0x369196){return _0x5866b1['status'](_0x1b963a)['json'](_0x369196);}};}function respondWithFilteredResult(_0x1094de,_0x5cd1d9){return function(_0xce64c){if(_0xce64c){var _0x5be212=typeof _0x5cd1d9[_0x212f('0x18')]===_0x212f('0x19')&&typeof _0x5cd1d9[_0x212f('0x1a')]===_0x212f('0x19');var _0x4fef35=_0xce64c['count'];var _0x26ebd2=_0x5be212?0x0:_0x5cd1d9[_0x212f('0x18')];var _0x5cf029=_0x5be212?_0xce64c[_0x212f('0x1b')]:_0x5cd1d9[_0x212f('0x18')]+_0x5cd1d9[_0x212f('0x1a')];var _0x25525e;if(_0x5cf029>=_0x4fef35){_0x5cf029=_0x4fef35;_0x25525e=0xc8;}else{_0x25525e=0xce;}_0x1094de['status'](_0x25525e);return _0x1094de[_0x212f('0x1c')](_0x212f('0x1d'),_0x26ebd2+'-'+_0x5cf029+'/'+_0x4fef35)['json'](_0xce64c);}return null;};}function patchUpdates(_0x182bea){return function(_0x1214f2){try{jsonpatch[_0x212f('0x1e')](_0x1214f2,_0x182bea,!![]);}catch(_0x38dd81){return BPromise['reject'](_0x38dd81);}return _0x1214f2[_0x212f('0x1f')]();};}function saveUpdates(_0x281e14,_0x2977dd){return function(_0x4ad008){if(_0x4ad008){return _0x4ad008[_0x212f('0x20')](_0x281e14)[_0x212f('0x21')](function(_0x52ad53){return _0x52ad53;});}return null;};}function removeEntity(_0x4d34e4,_0x534aae){return function(_0x466a33){if(_0x466a33){return _0x466a33[_0x212f('0x22')]()[_0x212f('0x21')](function(){_0x4d34e4[_0x212f('0x16')](0xcc)[_0x212f('0x17')]();});}};}function handleEntityNotFound(_0x5c5920,_0x1ee90a){return function(_0x59bb86){if(!_0x59bb86){_0x5c5920[_0x212f('0x23')](0x194);}return _0x59bb86;};}function handleError(_0x5cd002,_0x3b12bc){_0x3b12bc=_0x3b12bc||0x1f4;return function(_0x1e84c5){logger[_0x212f('0x24')](_0x1e84c5[_0x212f('0x25')]);if(_0x1e84c5[_0x212f('0x26')]){delete _0x1e84c5[_0x212f('0x26')];}_0x5cd002[_0x212f('0x16')](_0x3b12bc)[_0x212f('0x27')](_0x1e84c5);};}exports[_0x212f('0x28')]=function(_0x5a6cc3,_0x263a14){var _0x14a757={},_0x42bda0={},_0x42a752={'count':0x0,'rows':[]};var _0x3391eb=_[_0x212f('0x29')](db[_0x212f('0x2a')]['rawAttributes'],function(_0x158485){return{'name':_0x158485[_0x212f('0x2b')],'type':_0x158485[_0x212f('0x2c')][_0x212f('0x2d')]};});_0x42bda0[_0x212f('0x2e')]=_['map'](_0x3391eb,_0x212f('0x26'));_0x42bda0['query']=_[_0x212f('0x2f')](_0x5a6cc3[_0x212f('0x30')]);_0x42bda0['filters']=_[_0x212f('0x31')](_0x42bda0[_0x212f('0x2e')],_0x42bda0[_0x212f('0x30')]);_0x14a757['attributes']=_[_0x212f('0x31')](_0x42bda0[_0x212f('0x2e')],qs[_0x212f('0x32')](_0x5a6cc3[_0x212f('0x30')][_0x212f('0x32')]));_0x14a757[_0x212f('0x33')]=_0x14a757[_0x212f('0x33')][_0x212f('0x34')]?_0x14a757[_0x212f('0x33')]:_0x42bda0[_0x212f('0x2e')];if(!_0x5a6cc3['query']['hasOwnProperty']('nolimit')){_0x14a757[_0x212f('0x1a')]=qs[_0x212f('0x1a')](_0x5a6cc3[_0x212f('0x30')][_0x212f('0x1a')]);_0x14a757['offset']=qs['offset'](_0x5a6cc3[_0x212f('0x30')][_0x212f('0x18')]);}_0x14a757['order']=qs['sort'](_0x5a6cc3[_0x212f('0x30')][_0x212f('0x35')]);_0x14a757['where']=qs['filters'](_[_0x212f('0x36')](_0x5a6cc3[_0x212f('0x30')],_0x42bda0[_0x212f('0x37')]),_0x3391eb);if(_0x5a6cc3[_0x212f('0x30')][_0x212f('0x38')]){_0x14a757[_0x212f('0x39')]=_['merge'](_0x14a757['where'],{'$or':_[_0x212f('0x29')](_0x3391eb,function(_0x26e387){if(_0x26e387[_0x212f('0x2c')]!==_0x212f('0x3a')){var _0xeffdd3={};_0xeffdd3[_0x26e387['name']]={'$like':'%'+_0x5a6cc3[_0x212f('0x30')]['filter']+'%'};return _0xeffdd3;}})});}_0x14a757=_['merge']({},_0x14a757,_0x5a6cc3['options']);var _0x1c90e0={'where':_0x14a757[_0x212f('0x39')]};return db[_0x212f('0x2a')][_0x212f('0x1b')](_0x1c90e0)[_0x212f('0x21')](function(_0x41e3c5){_0x42a752[_0x212f('0x1b')]=_0x41e3c5;if(_0x5a6cc3['query'][_0x212f('0x3b')]){_0x14a757[_0x212f('0x3c')]=[{'all':!![]}];}return db[_0x212f('0x2a')]['findAll'](_0x14a757);})[_0x212f('0x21')](function(_0xe276d5){_0x42a752[_0x212f('0x3d')]=_0xe276d5;return _0x42a752;})['then'](respondWithFilteredResult(_0x263a14,_0x14a757))[_0x212f('0x3e')](handleError(_0x263a14,null));};exports[_0x212f('0x3f')]=function(_0x5c0dbc,_0x16a94a){var _0x3c7455={'raw':![],'where':{'id':_0x5c0dbc['params']['id']}},_0x1a1587={};_0x1a1587[_0x212f('0x2e')]=_[_0x212f('0x2f')](db[_0x212f('0x2a')]['rawAttributes']);_0x1a1587[_0x212f('0x30')]=_[_0x212f('0x2f')](_0x5c0dbc[_0x212f('0x30')]);_0x1a1587[_0x212f('0x37')]=_[_0x212f('0x31')](_0x1a1587[_0x212f('0x2e')],_0x1a1587[_0x212f('0x30')]);_0x3c7455[_0x212f('0x33')]=_[_0x212f('0x31')](_0x1a1587[_0x212f('0x2e')],qs[_0x212f('0x32')](_0x5c0dbc[_0x212f('0x30')][_0x212f('0x32')]));_0x3c7455['attributes']=_0x3c7455[_0x212f('0x33')][_0x212f('0x34')]?_0x3c7455[_0x212f('0x33')]:_0x1a1587[_0x212f('0x2e')];if(_0x5c0dbc['query'][_0x212f('0x3b')]){_0x3c7455[_0x212f('0x3c')]=[{'all':!![]}];}_0x3c7455=_[_0x212f('0x40')]({},_0x3c7455,_0x5c0dbc['options']);return db['ServicenowAccount'][_0x212f('0x41')](_0x3c7455)[_0x212f('0x21')](handleEntityNotFound(_0x16a94a,null))[_0x212f('0x21')](respondWithResult(_0x16a94a,null))[_0x212f('0x3e')](handleError(_0x16a94a,null));};exports[_0x212f('0x42')]=function(_0x12ec29,_0x1e0f42){return db['ServicenowAccount'][_0x212f('0x42')](_0x12ec29[_0x212f('0x43')],{})[_0x212f('0x21')](respondWithResult(_0x1e0f42,0xc9))[_0x212f('0x3e')](handleError(_0x1e0f42,null));};exports[_0x212f('0x20')]=function(_0x1005ce,_0x174e57){if(_0x1005ce[_0x212f('0x43')]['id']){delete _0x1005ce[_0x212f('0x43')]['id'];}return db[_0x212f('0x2a')][_0x212f('0x41')]({'where':{'id':_0x1005ce[_0x212f('0x44')]['id']}})[_0x212f('0x21')](handleEntityNotFound(_0x174e57,null))['then'](saveUpdates(_0x1005ce['body'],null))[_0x212f('0x21')](respondWithResult(_0x174e57,null))[_0x212f('0x3e')](handleError(_0x174e57,null));};exports[_0x212f('0x22')]=function(_0x4fda1f,_0x796cba){return db[_0x212f('0x2a')][_0x212f('0x41')]({'where':{'id':_0x4fda1f['params']['id']}})[_0x212f('0x21')](handleEntityNotFound(_0x796cba,null))[_0x212f('0x21')](removeEntity(_0x796cba,null))[_0x212f('0x3e')](handleError(_0x796cba,null));};exports[_0x212f('0x45')]=function(_0x1890fc,_0x398321,_0x2881d3){var _0x3f8db9={};var _0x43f9ac={};var _0x1b8fd6;var _0x24a735;return db[_0x212f('0x2a')][_0x212f('0x46')]({'where':{'id':_0x1890fc[_0x212f('0x44')]['id']}})[_0x212f('0x21')](handleEntityNotFound(_0x398321,null))['then'](function(_0x56c667){if(_0x56c667){_0x1b8fd6=_0x56c667;_0x43f9ac[_0x212f('0x2e')]=_[_0x212f('0x2f')](db[_0x212f('0x47')]['rawAttributes']);_0x43f9ac[_0x212f('0x30')]=_[_0x212f('0x2f')](_0x1890fc[_0x212f('0x30')]);_0x43f9ac[_0x212f('0x37')]=_[_0x212f('0x31')](_0x43f9ac[_0x212f('0x2e')],_0x43f9ac[_0x212f('0x30')]);_0x3f8db9[_0x212f('0x33')]=_['intersection'](_0x43f9ac['model'],qs[_0x212f('0x32')](_0x1890fc[_0x212f('0x30')]['fields']));_0x3f8db9[_0x212f('0x33')]=_0x3f8db9[_0x212f('0x33')][_0x212f('0x34')]?_0x3f8db9[_0x212f('0x33')]:_0x43f9ac[_0x212f('0x2e')];_0x3f8db9['order']=qs['sort'](_0x1890fc[_0x212f('0x30')][_0x212f('0x35')]);_0x3f8db9[_0x212f('0x39')]=qs[_0x212f('0x37')](_['pick'](_0x1890fc['query'],_0x43f9ac['filters']));if(_0x1890fc[_0x212f('0x30')][_0x212f('0x38')]){_0x3f8db9[_0x212f('0x39')]=_[_0x212f('0x40')](_0x3f8db9[_0x212f('0x39')],{'$or':_['map'](_0x3f8db9[_0x212f('0x33')],function(_0x52ead9){var _0x4a8d94={};_0x4a8d94[_0x52ead9]={'$like':'%'+_0x1890fc['query'][_0x212f('0x38')]+'%'};return _0x4a8d94;})});}_0x3f8db9=_[_0x212f('0x40')]({},_0x3f8db9,_0x1890fc[_0x212f('0x48')]);return _0x1b8fd6[_0x212f('0x45')](_0x3f8db9);}})['then'](function(_0x5494ba){if(_0x5494ba){_0x24a735=_0x5494ba['length'];if(!_0x1890fc[_0x212f('0x30')][_0x212f('0x49')](_0x212f('0x4a'))){_0x3f8db9[_0x212f('0x1a')]=qs[_0x212f('0x1a')](_0x1890fc[_0x212f('0x30')][_0x212f('0x1a')]);_0x3f8db9[_0x212f('0x18')]=qs[_0x212f('0x18')](_0x1890fc[_0x212f('0x30')][_0x212f('0x18')]);}return _0x1b8fd6[_0x212f('0x45')](_0x3f8db9);}})['then'](function(_0x5c640a){if(_0x5c640a){return _0x5c640a?{'count':_0x24a735,'rows':_0x5c640a}:null;}})['then'](respondWithResult(_0x398321,null))[_0x212f('0x3e')](handleError(_0x398321,null));};exports[_0x212f('0x4b')]=function(_0x24b511,_0x4223d6,_0x1b8625){if(_0x24b511[_0x212f('0x43')]['id']){delete _0x24b511[_0x212f('0x43')]['id'];}return db['ServicenowAccount'][_0x212f('0x46')]({'where':{'id':_0x24b511[_0x212f('0x44')]['id']}})[_0x212f('0x21')](handleEntityNotFound(_0x4223d6,null))[_0x212f('0x21')](function(_0x4d6192){if(_0x4d6192){_0x24b511[_0x212f('0x43')][_0x212f('0x4c')]=_0x4d6192['id'];_0x24b511[_0x212f('0x43')][_0x212f('0x4d')]=integrations[_0x212f('0x4e')](_0x24b511[_0x212f('0x43')][_0x212f('0x4f')],_0x24b511[_0x212f('0x43')]['type']);_0x24b511[_0x212f('0x43')][_0x212f('0x50')]=integrations['getDescriptions'](_0x24b511[_0x212f('0x43')][_0x212f('0x4f')],_0x24b511[_0x212f('0x43')][_0x212f('0x2c')]);return db[_0x212f('0x47')][_0x212f('0x42')](_0x24b511[_0x212f('0x43')],{'include':[{'model':db[_0x212f('0x51')],'as':_0x212f('0x4d')},{'model':db[_0x212f('0x51')],'as':_0x212f('0x50')}]});}return null;})[_0x212f('0x21')](respondWithResult(_0x4223d6,null))[_0x212f('0x3e')](handleError(_0x4223d6,null));};exports[_0x212f('0x52')]=function(_0x57b53e,_0x1109e0,_0x4008a3){var _0x16cd25=[_0x212f('0x53'),_0x212f('0x54'),'knowledge','subcategory',_0x212f('0x55'),'notify',_0x212f('0x56'),'severity','category'];var _0x3066fa=[_0x212f('0x57'),'made_sla','caused_by',_0x212f('0x58'),'upon_reject','sys_updated_on',_0x212f('0x59'),_0x212f('0x54'),_0x212f('0x5a'),'number','resolved_by',_0x212f('0x5b'),_0x212f('0x5c'),_0x212f('0x5d'),_0x212f('0x5e'),'sys_domain',_0x212f('0x5f'),_0x212f('0x60'),_0x212f('0x61'),_0x212f('0x62'),'calendar_stc','closed_at',_0x212f('0x63'),_0x212f('0x64'),_0x212f('0x65'),_0x212f('0x66'),_0x212f('0x67'),_0x212f('0x68'),_0x212f('0x69'),_0x212f('0x6a'),_0x212f('0x6b'),_0x212f('0x6c'),_0x212f('0x6d'),_0x212f('0x6e'),'business_duration',_0x212f('0x6f'),_0x212f('0x70'),_0x212f('0x71'),_0x212f('0x72'),'caller_id','approval_set','subcategory',_0x212f('0x73'),_0x212f('0x74'),_0x212f('0x55'),_0x212f('0x75'),_0x212f('0x76'),_0x212f('0x77'),'assignment_group','business_stc',_0x212f('0x78'),_0x212f('0x79'),_0x212f('0x7a'),_0x212f('0x7b'),_0x212f('0x7c'),_0x212f('0x7d'),_0x212f('0x7e'),_0x212f('0x7f'),_0x212f('0x80'),_0x212f('0x81'),'contact_type','reopened_by',_0x212f('0x56'),_0x212f('0x82'),'problem_id',_0x212f('0x83'),'reassignment_count',_0x212f('0x84'),'assigned_to',_0x212f('0x85'),'comments','sla_due',_0x212f('0x86'),_0x212f('0x87'),_0x212f('0x88'),'sys_mod_count','reopen_count',_0x212f('0x89'),_0x212f('0x8a'),_0x212f('0x8b'),_0x212f('0x8c'),'location',_0x212f('0x8d')];var _0x38e23f='';var _0x14ccf5='';var _0x1d42fe=[];var _0x1ff485='';var _0x20f49d='';var _0x3fc8b9=[];var _0xfc6e86='';var _0x42f703='';var _0x15770e={};var _0x4c6613='';return db[_0x212f('0x2a')][_0x212f('0x46')]({'where':{'id':_0x57b53e[_0x212f('0x44')]['id']},'attributes':['id',_0x212f('0x8e'),_0x212f('0x8f'),_0x212f('0x90'),_0x212f('0x91'),_0x212f('0x92')]})[_0x212f('0x21')](handleEntityNotFound(_0x1109e0,null))['then'](function(_0x13faf4){if(_0x13faf4){_0x4c6613=_0x13faf4[_0x212f('0x91')];var _0x9a991b=_0x4c6613[_0x212f('0x93')](-0x1);if(_0x9a991b==='/'){_0x4c6613=_0x4c6613[_0x212f('0x94')](0x0,_0x4c6613['lastIndexOf'](_0x9a991b));}_0x42f703=util[_0x212f('0x95')](_0x212f('0x96'),_0x4c6613);_0xfc6e86=util['format']('%s/api/now/table/',_0x4c6613);_0x15770e={'user':_0x13faf4['username'],'pass':_0x13faf4['password']};var _0x3afada={'method':_0x212f('0x97'),'uri':_0x42f703+_0x212f('0x98'),'auth':_0x15770e,'json':!![]};return rp(_0x3afada);}})[_0x212f('0x21')](function(_0x4b6189){if(_0x4b6189[_0x212f('0x99')][_0x212f('0x34')]>0x0){_0x38e23f=_0x4b6189[_0x212f('0x99')];}console['log']('incident\x20table\x20objects',_0x38e23f);_0x3fc8b9=[];_0x14ccf5=Object[_0x212f('0x9a')]([],_0x38e23f);_['remove'](_0x14ccf5,function(_0xa60cd7){return!_0x16cd25[_0x212f('0x9b')](_0xa60cd7[_0x212f('0x26')]);});_0x14ccf5[_0x212f('0x9c')](function(_0x4a771d){var _0x4083eb=createFieldObject(_0xfc6e86,_0x15770e,_0x4a771d[_0x212f('0x9d')],_0x4a771d[_0x212f('0x26')],_0x4a771d['label'],![]);_0x3fc8b9[_0x212f('0x9e')](_0x4083eb);});return Promise['all'](_0x3fc8b9);})['then'](function(_0x10c520){_0x1d42fe=_0x10c520;_0x1ff485=Object[_0x212f('0x9a')]([],_0x38e23f);console[_0x212f('0x9f')](_0x212f('0xa0'),_0x38e23f);_[_0x212f('0xa1')](_0x1ff485,function(_0x489f1e){return _0x3066fa[_0x212f('0x9b')](_0x489f1e[_0x212f('0x26')]);});console['log'](_0x212f('0xa2'),_0x1ff485);_0x3fc8b9=[];_0x1ff485[_0x212f('0x9c')](function(_0x53e777){var _0x2a7bb5=createFieldObject(_0xfc6e86,_0x15770e,_0x53e777[_0x212f('0x9d')],_0x53e777[_0x212f('0x26')],_0x53e777[_0x212f('0xa3')],!![]);_0x3fc8b9['push'](_0x2a7bb5);});return Promise[_0x212f('0xa4')](_0x3fc8b9);})[_0x212f('0x21')](function(_0x57f199){_0x20f49d=_0x57f199;var _0x1ffcd5=_0x1d42fe['concat'](_0x20f49d);return{'count':_0x1ffcd5[_0x212f('0x34')],'rows':_0x1ffcd5};})['then'](respondWithResult(_0x1109e0,null))[_0x212f('0x3e')](function(_0x148939){console[_0x212f('0x9f')]('ServiceNow\x20error:\x20'+_0x148939);var _0x4e1dc4=_0x57b53e[_0x212f('0x30')][_0x212f('0xa5')]?0x1f4:_0x148939[_0x212f('0xa6')]||0x1f4;logger['error'](_0x148939['stack']);delete _0x148939[_0x212f('0x26')];if(_0x4e1dc4===0x191){_0x4e1dc4=0x190;}_0x1109e0['status'](_0x4e1dc4)[_0x212f('0x27')](_0x57b53e[_0x212f('0x30')][_0x212f('0xa5')]?{'message':_0x212f('0xa7'),'statusCode':_0x148939[_0x212f('0xa6')]}:_0x148939);});};function createFieldObject(_0x27de51,_0xebc3b0,_0x185f07,_0x4b6d87,_0x3fcb4d,_0x2c3491){return new Promise(function(_0x237710,_0x262c66){var _0x2441bf={'id':_0x4b6d87,'name':_0x3fcb4d,'custom':_0x2c3491};if(_0x185f07==='boolean'){_0x2441bf['options']=[{'name':_0x212f('0xa8'),'value':_0x212f('0xa9')},{'name':_0x212f('0xaa'),'value':_0x212f('0xab')}];_0x237710(_0x2441bf);}else{var _0x27879a={'method':_0x212f('0x97'),'uri':_0x27de51+_0x212f('0xac')+_0x4b6d87,'auth':_0xebc3b0,'json':!![]};return rp(_0x27879a)[_0x212f('0x21')](function(_0x459af6){var _0x474722=[];if(_0x459af6[_0x212f('0x99')]['length']>0x0){_0x459af6[_0x212f('0x99')][_0x212f('0x9c')](function(_0x296cca){if(_0x296cca[_0x212f('0xad')]===_0x212f('0xab')){var _0xea1fc9={'name':_0x296cca[_0x212f('0xa3')],'value':_0x296cca['value']};_0x474722[_0x212f('0x9e')](_0xea1fc9);}});}_0x2441bf[_0x212f('0x48')]=_0x474722;if(_0x2441bf[_0x212f('0x48')]['length']>0x0){_0x237710(_0x2441bf);}else{if(_0x2c3491==![]){_0x237710();}else{_0x237710(_0x2441bf);}}});}});} \ No newline at end of file +var _0x5dfd=['true','False','false','sys_choice?sysparm_query=name=incident^element=','inactive','value','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','squel','crypto','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','offset','undefined','limit','count','json','update','then','destroy','sendStatus','error','name','send','map','ServicenowAccount','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','catch','show','find','create','body','params','getConfigurations','findOne','addConfiguration','AccountId','Descriptions','getDescriptions','channel','ServicenowField','hold_reason','knowledge','close_code','notify','category','made_sla','caused_by','watch_list','upon_reject','child_incidents','approval_history','resolved_by','sys_updated_by','user_input','sys_created_on','sys_domain','state','sys_created_by','calendar_stc','cmdb_ci','delivery_plan','impact','active','work_notes_list','business_service','priority','rfc','time_worked','opened_at','business_duration','group_list','work_end','resolved_at','caller_id','subcategory','work_notes','short_description','correlation_display','delivery_task','assignment_group','business_stc','description','calendar_duration','sys_class_name','close_notes','closed_by','follow_up','sys_id','contact_type','reopened_by','incident_state','urgency','company','activity_due','severity','comments','sla_due','approval','reopen_count','sys_tags','escalation','location','username','password','serverUrl','slice','lastIndexOf','format','%s/api/now/doc/table/schema/','%s/api/now/table/','GET','incident?sysparm_display_value=all','result','assign','forEach','push','all','log','remove','includes','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','label','ServiceNow\x20error:\x20','test','statusCode','Wrong\x20credentials','boolean','True'];(function(_0x35736e,_0x22a40b){var _0xc85687=function(_0x169320){while(--_0x169320){_0x35736e['push'](_0x35736e['shift']());}};_0xc85687(++_0x22a40b);}(_0x5dfd,0xb4));var _0xd5df=function(_0x33c9f8,_0x5aedbb){_0x33c9f8=_0x33c9f8-0x0;var _0x2d7004=_0x5dfd[_0x33c9f8];return _0x2d7004;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xd5df('0x0'));var jsonpatch=require(_0xd5df('0x1'));var rp=require(_0xd5df('0x2'));var moment=require(_0xd5df('0x3'));var BPromise=require(_0xd5df('0x4'));var Mustache=require(_0xd5df('0x5'));var util=require(_0xd5df('0x6'));var path=require(_0xd5df('0x7'));var sox=require(_0xd5df('0x8'));var csv=require('to-csv');var ejs=require(_0xd5df('0x9'));var fs=require('fs');var fs_extra=require(_0xd5df('0xa'));var _=require('lodash');var squel=require(_0xd5df('0xb'));var crypto=require(_0xd5df('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xd5df('0xd'));var querystring=require(_0xd5df('0xe'));var Papa=require(_0xd5df('0xf'));var Redis=require(_0xd5df('0x10'));var authService=require(_0xd5df('0x11'));var qs=require(_0xd5df('0x12'));var as=require(_0xd5df('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd5df('0x14'))(_0xd5df('0x15'));var utils=require(_0xd5df('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xd5df('0x17'));var db=require(_0xd5df('0x18'))['db'];var integrations=require(_0xd5df('0x19'));function respondWithStatusCode(_0x29a75e,_0x4ebebe){_0x4ebebe=_0x4ebebe||0xcc;return function(_0x1b252b){if(_0x1b252b){return _0x29a75e['sendStatus'](_0x4ebebe);}return _0x29a75e[_0xd5df('0x1a')](_0x4ebebe)[_0xd5df('0x1b')]();};}function respondWithResult(_0x1af43f,_0x5efe6f){_0x5efe6f=_0x5efe6f||0xc8;return function(_0x44ca23){if(_0x44ca23){return _0x1af43f[_0xd5df('0x1a')](_0x5efe6f)['json'](_0x44ca23);}};}function respondWithFilteredResult(_0x1cd389,_0x1feae9){return function(_0x357b07){if(_0x357b07){var _0xc22302=typeof _0x1feae9[_0xd5df('0x1c')]===_0xd5df('0x1d')&&typeof _0x1feae9[_0xd5df('0x1e')]==='undefined';var _0x52aa50=_0x357b07[_0xd5df('0x1f')];var _0x57fa1d=_0xc22302?0x0:_0x1feae9['offset'];var _0x382904=_0xc22302?_0x357b07['count']:_0x1feae9[_0xd5df('0x1c')]+_0x1feae9[_0xd5df('0x1e')];var _0x50f4a9;if(_0x382904>=_0x52aa50){_0x382904=_0x52aa50;_0x50f4a9=0xc8;}else{_0x50f4a9=0xce;}_0x1cd389[_0xd5df('0x1a')](_0x50f4a9);return _0x1cd389['set']('Content-Range',_0x57fa1d+'-'+_0x382904+'/'+_0x52aa50)[_0xd5df('0x20')](_0x357b07);}return null;};}function patchUpdates(_0x3f63e4){return function(_0x32d0e8){try{jsonpatch['apply'](_0x32d0e8,_0x3f63e4,!![]);}catch(_0x4dbd69){return BPromise['reject'](_0x4dbd69);}return _0x32d0e8['save']();};}function saveUpdates(_0x4983af,_0x372662){return function(_0x3b7380){if(_0x3b7380){return _0x3b7380[_0xd5df('0x21')](_0x4983af)[_0xd5df('0x22')](function(_0x2cebe8){return _0x2cebe8;});}return null;};}function removeEntity(_0x1ca0a3,_0x11a687){return function(_0x2e1576){if(_0x2e1576){return _0x2e1576[_0xd5df('0x23')]()[_0xd5df('0x22')](function(){_0x1ca0a3[_0xd5df('0x1a')](0xcc)[_0xd5df('0x1b')]();});}};}function handleEntityNotFound(_0x14a226,_0x284fa6){return function(_0x1793a3){if(!_0x1793a3){_0x14a226[_0xd5df('0x24')](0x194);}return _0x1793a3;};}function handleError(_0x4af794,_0x3eb2fa){_0x3eb2fa=_0x3eb2fa||0x1f4;return function(_0x825ed3){logger[_0xd5df('0x25')](_0x825ed3['stack']);if(_0x825ed3[_0xd5df('0x26')]){delete _0x825ed3[_0xd5df('0x26')];}_0x4af794[_0xd5df('0x1a')](_0x3eb2fa)[_0xd5df('0x27')](_0x825ed3);};}exports['index']=function(_0x4cdecb,_0x9f425f){var _0x2284c3={},_0x43fad2={},_0x1846bf={'count':0x0,'rows':[]};var _0x18c037=_[_0xd5df('0x28')](db[_0xd5df('0x29')][_0xd5df('0x2a')],function(_0x31b6ee){return{'name':_0x31b6ee[_0xd5df('0x2b')],'type':_0x31b6ee[_0xd5df('0x2c')]['key']};});_0x43fad2[_0xd5df('0x2d')]=_['map'](_0x18c037,'name');_0x43fad2[_0xd5df('0x2e')]=_[_0xd5df('0x2f')](_0x4cdecb[_0xd5df('0x2e')]);_0x43fad2[_0xd5df('0x30')]=_[_0xd5df('0x31')](_0x43fad2[_0xd5df('0x2d')],_0x43fad2[_0xd5df('0x2e')]);_0x2284c3[_0xd5df('0x32')]=_[_0xd5df('0x31')](_0x43fad2['model'],qs[_0xd5df('0x33')](_0x4cdecb['query'][_0xd5df('0x33')]));_0x2284c3[_0xd5df('0x32')]=_0x2284c3[_0xd5df('0x32')][_0xd5df('0x34')]?_0x2284c3[_0xd5df('0x32')]:_0x43fad2[_0xd5df('0x2d')];if(!_0x4cdecb[_0xd5df('0x2e')][_0xd5df('0x35')](_0xd5df('0x36'))){_0x2284c3[_0xd5df('0x1e')]=qs[_0xd5df('0x1e')](_0x4cdecb['query'][_0xd5df('0x1e')]);_0x2284c3[_0xd5df('0x1c')]=qs[_0xd5df('0x1c')](_0x4cdecb[_0xd5df('0x2e')][_0xd5df('0x1c')]);}_0x2284c3[_0xd5df('0x37')]=qs[_0xd5df('0x38')](_0x4cdecb[_0xd5df('0x2e')][_0xd5df('0x38')]);_0x2284c3[_0xd5df('0x39')]=qs[_0xd5df('0x30')](_[_0xd5df('0x3a')](_0x4cdecb[_0xd5df('0x2e')],_0x43fad2[_0xd5df('0x30')]),_0x18c037);if(_0x4cdecb[_0xd5df('0x2e')]['filter']){_0x2284c3[_0xd5df('0x39')]=_['merge'](_0x2284c3['where'],{'$or':_[_0xd5df('0x28')](_0x18c037,function(_0x1fa63c){if(_0x1fa63c['type']!==_0xd5df('0x3b')){var _0x4c7478={};_0x4c7478[_0x1fa63c[_0xd5df('0x26')]]={'$like':'%'+_0x4cdecb[_0xd5df('0x2e')][_0xd5df('0x3c')]+'%'};return _0x4c7478;}})});}_0x2284c3=_[_0xd5df('0x3d')]({},_0x2284c3,_0x4cdecb[_0xd5df('0x3e')]);var _0x4515d2={'where':_0x2284c3[_0xd5df('0x39')]};return db['ServicenowAccount'][_0xd5df('0x1f')](_0x4515d2)['then'](function(_0x22a431){_0x1846bf[_0xd5df('0x1f')]=_0x22a431;if(_0x4cdecb[_0xd5df('0x2e')][_0xd5df('0x3f')]){_0x2284c3[_0xd5df('0x40')]=[{'all':!![]}];}return db[_0xd5df('0x29')][_0xd5df('0x41')](_0x2284c3);})['then'](function(_0x5af232){_0x1846bf['rows']=_0x5af232;return _0x1846bf;})[_0xd5df('0x22')](respondWithFilteredResult(_0x9f425f,_0x2284c3))[_0xd5df('0x42')](handleError(_0x9f425f,null));};exports[_0xd5df('0x43')]=function(_0x6c4eb,_0x12e9ab){var _0x448dcd={'raw':![],'where':{'id':_0x6c4eb['params']['id']}},_0x3e07a2={};_0x3e07a2[_0xd5df('0x2d')]=_[_0xd5df('0x2f')](db['ServicenowAccount'][_0xd5df('0x2a')]);_0x3e07a2[_0xd5df('0x2e')]=_[_0xd5df('0x2f')](_0x6c4eb[_0xd5df('0x2e')]);_0x3e07a2[_0xd5df('0x30')]=_['intersection'](_0x3e07a2[_0xd5df('0x2d')],_0x3e07a2['query']);_0x448dcd[_0xd5df('0x32')]=_[_0xd5df('0x31')](_0x3e07a2[_0xd5df('0x2d')],qs[_0xd5df('0x33')](_0x6c4eb[_0xd5df('0x2e')]['fields']));_0x448dcd[_0xd5df('0x32')]=_0x448dcd[_0xd5df('0x32')][_0xd5df('0x34')]?_0x448dcd[_0xd5df('0x32')]:_0x3e07a2['model'];if(_0x6c4eb[_0xd5df('0x2e')]['includeAll']){_0x448dcd['include']=[{'all':!![]}];}_0x448dcd=_[_0xd5df('0x3d')]({},_0x448dcd,_0x6c4eb['options']);return db[_0xd5df('0x29')][_0xd5df('0x44')](_0x448dcd)['then'](handleEntityNotFound(_0x12e9ab,null))[_0xd5df('0x22')](respondWithResult(_0x12e9ab,null))[_0xd5df('0x42')](handleError(_0x12e9ab,null));};exports[_0xd5df('0x45')]=function(_0x94e4aa,_0x11e30d){return db[_0xd5df('0x29')][_0xd5df('0x45')](_0x94e4aa[_0xd5df('0x46')],{})[_0xd5df('0x22')](respondWithResult(_0x11e30d,0xc9))[_0xd5df('0x42')](handleError(_0x11e30d,null));};exports['update']=function(_0x5a21ed,_0x3fa233){if(_0x5a21ed[_0xd5df('0x46')]['id']){delete _0x5a21ed[_0xd5df('0x46')]['id'];}return db[_0xd5df('0x29')][_0xd5df('0x44')]({'where':{'id':_0x5a21ed[_0xd5df('0x47')]['id']}})[_0xd5df('0x22')](handleEntityNotFound(_0x3fa233,null))[_0xd5df('0x22')](saveUpdates(_0x5a21ed[_0xd5df('0x46')],null))[_0xd5df('0x22')](respondWithResult(_0x3fa233,null))[_0xd5df('0x42')](handleError(_0x3fa233,null));};exports[_0xd5df('0x23')]=function(_0x28b623,_0x5c14ff){return db['ServicenowAccount'][_0xd5df('0x44')]({'where':{'id':_0x28b623[_0xd5df('0x47')]['id']}})['then'](handleEntityNotFound(_0x5c14ff,null))[_0xd5df('0x22')](removeEntity(_0x5c14ff,null))[_0xd5df('0x42')](handleError(_0x5c14ff,null));};exports[_0xd5df('0x48')]=function(_0x42eb53,_0x242e66,_0x33a921){var _0x52f523={};var _0x4bc6f1={};var _0x2df4e0;var _0x57a657;return db[_0xd5df('0x29')][_0xd5df('0x49')]({'where':{'id':_0x42eb53['params']['id']}})['then'](handleEntityNotFound(_0x242e66,null))[_0xd5df('0x22')](function(_0x3eea19){if(_0x3eea19){_0x2df4e0=_0x3eea19;_0x4bc6f1[_0xd5df('0x2d')]=_[_0xd5df('0x2f')](db['ServicenowConfiguration']['rawAttributes']);_0x4bc6f1[_0xd5df('0x2e')]=_[_0xd5df('0x2f')](_0x42eb53[_0xd5df('0x2e')]);_0x4bc6f1[_0xd5df('0x30')]=_[_0xd5df('0x31')](_0x4bc6f1[_0xd5df('0x2d')],_0x4bc6f1[_0xd5df('0x2e')]);_0x52f523[_0xd5df('0x32')]=_['intersection'](_0x4bc6f1[_0xd5df('0x2d')],qs[_0xd5df('0x33')](_0x42eb53[_0xd5df('0x2e')][_0xd5df('0x33')]));_0x52f523[_0xd5df('0x32')]=_0x52f523[_0xd5df('0x32')][_0xd5df('0x34')]?_0x52f523[_0xd5df('0x32')]:_0x4bc6f1[_0xd5df('0x2d')];_0x52f523[_0xd5df('0x37')]=qs[_0xd5df('0x38')](_0x42eb53[_0xd5df('0x2e')]['sort']);_0x52f523[_0xd5df('0x39')]=qs[_0xd5df('0x30')](_[_0xd5df('0x3a')](_0x42eb53['query'],_0x4bc6f1['filters']));if(_0x42eb53[_0xd5df('0x2e')][_0xd5df('0x3c')]){_0x52f523['where']=_[_0xd5df('0x3d')](_0x52f523[_0xd5df('0x39')],{'$or':_[_0xd5df('0x28')](_0x52f523[_0xd5df('0x32')],function(_0xd313e2){var _0x235111={};_0x235111[_0xd313e2]={'$like':'%'+_0x42eb53[_0xd5df('0x2e')]['filter']+'%'};return _0x235111;})});}_0x52f523=_[_0xd5df('0x3d')]({},_0x52f523,_0x42eb53['options']);return _0x2df4e0[_0xd5df('0x48')](_0x52f523);}})[_0xd5df('0x22')](function(_0x1c2e09){if(_0x1c2e09){_0x57a657=_0x1c2e09[_0xd5df('0x34')];if(!_0x42eb53['query']['hasOwnProperty']('nolimit')){_0x52f523['limit']=qs[_0xd5df('0x1e')](_0x42eb53['query'][_0xd5df('0x1e')]);_0x52f523['offset']=qs[_0xd5df('0x1c')](_0x42eb53[_0xd5df('0x2e')][_0xd5df('0x1c')]);}return _0x2df4e0[_0xd5df('0x48')](_0x52f523);}})[_0xd5df('0x22')](function(_0x4f4c7e){if(_0x4f4c7e){return _0x4f4c7e?{'count':_0x57a657,'rows':_0x4f4c7e}:null;}})[_0xd5df('0x22')](respondWithResult(_0x242e66,null))[_0xd5df('0x42')](handleError(_0x242e66,null));};exports[_0xd5df('0x4a')]=function(_0x11acc4,_0xe941c5,_0x239bf4){if(_0x11acc4[_0xd5df('0x46')]['id']){delete _0x11acc4['body']['id'];}return db[_0xd5df('0x29')][_0xd5df('0x49')]({'where':{'id':_0x11acc4['params']['id']}})['then'](handleEntityNotFound(_0xe941c5,null))['then'](function(_0x3cea8a){if(_0x3cea8a){_0x11acc4[_0xd5df('0x46')][_0xd5df('0x4b')]=_0x3cea8a['id'];_0x11acc4[_0xd5df('0x46')]['Subjects']=integrations['getSubjects'](_0x11acc4[_0xd5df('0x46')]['channel'],_0x11acc4[_0xd5df('0x46')][_0xd5df('0x2c')]);_0x11acc4[_0xd5df('0x46')][_0xd5df('0x4c')]=integrations[_0xd5df('0x4d')](_0x11acc4['body'][_0xd5df('0x4e')],_0x11acc4[_0xd5df('0x46')][_0xd5df('0x2c')]);return db['ServicenowConfiguration'][_0xd5df('0x45')](_0x11acc4[_0xd5df('0x46')],{'include':[{'model':db[_0xd5df('0x4f')],'as':'Subjects'},{'model':db[_0xd5df('0x4f')],'as':_0xd5df('0x4c')}]});}return null;})[_0xd5df('0x22')](respondWithResult(_0xe941c5,null))[_0xd5df('0x42')](handleError(_0xe941c5,null));};exports['getFields']=function(_0x13e353,_0x4c7d17,_0x84cbdd){var _0x12b301=['made_sla',_0xd5df('0x50'),_0xd5df('0x51'),'subcategory',_0xd5df('0x52'),_0xd5df('0x53'),'incident_state','severity',_0xd5df('0x54')];var _0x2f2a1d=['parent',_0xd5df('0x55'),_0xd5df('0x56'),_0xd5df('0x57'),_0xd5df('0x58'),'sys_updated_on',_0xd5df('0x59'),'hold_reason',_0xd5df('0x5a'),'number',_0xd5df('0x5b'),_0xd5df('0x5c'),'opened_by',_0xd5df('0x5d'),_0xd5df('0x5e'),_0xd5df('0x5f'),_0xd5df('0x60'),_0xd5df('0x61'),_0xd5df('0x51'),'order',_0xd5df('0x62'),'closed_at',_0xd5df('0x63'),_0xd5df('0x64'),_0xd5df('0x65'),_0xd5df('0x66'),_0xd5df('0x67'),_0xd5df('0x68'),_0xd5df('0x69'),'sys_domain_path',_0xd5df('0x6a'),_0xd5df('0x6b'),'expected_start',_0xd5df('0x6c'),_0xd5df('0x6d'),_0xd5df('0x6e'),_0xd5df('0x6f'),'reopened_time',_0xd5df('0x70'),_0xd5df('0x71'),'approval_set',_0xd5df('0x72'),_0xd5df('0x73'),_0xd5df('0x74'),_0xd5df('0x52'),_0xd5df('0x75'),_0xd5df('0x76'),'work_start',_0xd5df('0x77'),_0xd5df('0x78'),'additional_assignee_list',_0xd5df('0x79'),_0xd5df('0x7a'),_0xd5df('0x53'),_0xd5df('0x7b'),_0xd5df('0x7c'),_0xd5df('0x7d'),_0xd5df('0x7e'),'parent_incident',_0xd5df('0x7f'),_0xd5df('0x80'),_0xd5df('0x81'),_0xd5df('0x82'),_0xd5df('0x83'),'problem_id',_0xd5df('0x84'),'reassignment_count',_0xd5df('0x85'),'assigned_to',_0xd5df('0x86'),_0xd5df('0x87'),_0xd5df('0x88'),_0xd5df('0x89'),'comments_and_work_notes','due_date','sys_mod_count',_0xd5df('0x8a'),_0xd5df('0x8b'),_0xd5df('0x8c'),'upon_approval','correlation_id',_0xd5df('0x8d'),_0xd5df('0x54')];var _0x4e2afd='';var _0x21990c='';var _0x4f251d=[];var _0x16a898='';var _0x51b52a='';var _0x6e6c17=[];var _0x40f17b='';var _0x12e27b='';var _0x18d7c8={};var _0x39de29='';return db[_0xd5df('0x29')]['findOne']({'where':{'id':_0x13e353[_0xd5df('0x47')]['id']},'attributes':['id',_0xd5df('0x8e'),_0xd5df('0x8f'),'email','remoteUri',_0xd5df('0x90')]})['then'](handleEntityNotFound(_0x4c7d17,null))['then'](function(_0x1317b9){if(_0x1317b9){_0x39de29=_0x1317b9['remoteUri'];var _0x480605=_0x39de29[_0xd5df('0x91')](-0x1);if(_0x480605==='/'){_0x39de29=_0x39de29['substring'](0x0,_0x39de29[_0xd5df('0x92')](_0x480605));}_0x12e27b=util[_0xd5df('0x93')](_0xd5df('0x94'),_0x39de29);_0x40f17b=util[_0xd5df('0x93')](_0xd5df('0x95'),_0x39de29);_0x18d7c8={'user':_0x1317b9[_0xd5df('0x8e')],'pass':_0x1317b9[_0xd5df('0x8f')]};var _0x3601bc={'method':_0xd5df('0x96'),'uri':_0x12e27b+_0xd5df('0x97'),'auth':_0x18d7c8,'json':!![]};return rp(_0x3601bc);}})['then'](function(_0x1ac9c2){if(_0x1ac9c2[_0xd5df('0x98')][_0xd5df('0x34')]>0x0){_0x4e2afd=_0x1ac9c2[_0xd5df('0x98')];}console['log']('incident\x20table\x20objects',_0x4e2afd);_0x6e6c17=[];_0x21990c=Object[_0xd5df('0x99')]([],_0x4e2afd);_['remove'](_0x21990c,function(_0x15698c){return!_0x12b301['includes'](_0x15698c['name']);});_0x21990c[_0xd5df('0x9a')](function(_0x24fe29){var _0x565e5c=createFieldObject(_0x40f17b,_0x18d7c8,_0x24fe29['internalType'],_0x24fe29[_0xd5df('0x26')],_0x24fe29['label'],![]);_0x6e6c17[_0xd5df('0x9b')](_0x565e5c);});return Promise[_0xd5df('0x9c')](_0x6e6c17);})[_0xd5df('0x22')](function(_0x5df0f4){_0x4f251d=_0x5df0f4;_0x16a898=Object[_0xd5df('0x99')]([],_0x4e2afd);console[_0xd5df('0x9d')]('TCL:\x20_object',_0x4e2afd);_[_0xd5df('0x9e')](_0x16a898,function(_0x4306fd){return _0x2f2a1d[_0xd5df('0x9f')](_0x4306fd[_0xd5df('0x26')]);});console[_0xd5df('0x9d')](_0xd5df('0xa0'),_0x16a898);_0x6e6c17=[];_0x16a898[_0xd5df('0x9a')](function(_0xc17a68){var _0x52d2fa=createFieldObject(_0x40f17b,_0x18d7c8,_0xc17a68['internalType'],_0xc17a68[_0xd5df('0x26')],_0xc17a68[_0xd5df('0xa1')],!![]);_0x6e6c17['push'](_0x52d2fa);});return Promise[_0xd5df('0x9c')](_0x6e6c17);})['then'](function(_0x3f407e){_0x51b52a=_0x3f407e;var _0x2152db=_0x4f251d['concat'](_0x51b52a);return{'count':_0x2152db[_0xd5df('0x34')],'rows':_0x2152db};})[_0xd5df('0x22')](respondWithResult(_0x4c7d17,null))[_0xd5df('0x42')](function(_0x1abfaf){console[_0xd5df('0x9d')](_0xd5df('0xa2')+_0x1abfaf);var _0x319c43=_0x13e353[_0xd5df('0x2e')][_0xd5df('0xa3')]?0x1f4:_0x1abfaf[_0xd5df('0xa4')]||0x1f4;logger[_0xd5df('0x25')](_0x1abfaf['stack']);delete _0x1abfaf['name'];if(_0x319c43===0x191){_0x319c43=0x190;}_0x4c7d17[_0xd5df('0x1a')](_0x319c43)[_0xd5df('0x27')](_0x13e353[_0xd5df('0x2e')][_0xd5df('0xa3')]?{'message':_0xd5df('0xa5'),'statusCode':_0x1abfaf[_0xd5df('0xa4')]}:_0x1abfaf);});};function createFieldObject(_0x4e6810,_0x1df85a,_0x1846f1,_0x1b0bc3,_0x3e41dc,_0x3d81fe){return new Promise(function(_0x4349ae,_0x2ca367){var _0x425fd8={'id':_0x1b0bc3,'name':_0x3e41dc,'custom':_0x3d81fe};if(_0x1846f1===_0xd5df('0xa6')){_0x425fd8[_0xd5df('0x3e')]=[{'name':_0xd5df('0xa7'),'value':_0xd5df('0xa8')},{'name':_0xd5df('0xa9'),'value':_0xd5df('0xaa')}];_0x4349ae(_0x425fd8);}else{var _0x428c0d={'method':_0xd5df('0x96'),'uri':_0x4e6810+_0xd5df('0xab')+_0x1b0bc3,'auth':_0x1df85a,'json':!![]};return rp(_0x428c0d)['then'](function(_0x5e7a23){var _0x320f13=[];if(_0x5e7a23['result'][_0xd5df('0x34')]>0x0){_0x5e7a23[_0xd5df('0x98')][_0xd5df('0x9a')](function(_0x709344){if(_0x709344[_0xd5df('0xac')]===_0xd5df('0xaa')){var _0x30a502={'name':_0x709344[_0xd5df('0xa1')],'value':_0x709344[_0xd5df('0xad')]};_0x320f13[_0xd5df('0x9b')](_0x30a502);}});}_0x425fd8[_0xd5df('0x3e')]=_0x320f13;if(_0x425fd8['options']['length']>0x0){_0x4349ae(_0x425fd8);}else{if(_0x3d81fe==![]){_0x4349ae();}else{_0x4349ae(_0x425fd8);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index 53d6f56..c39f08c 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 _0xba34=['./intServicenowAccount.attributes','../../components/integrations/configuration','exports','ServicenowAccount','int_servicenow_accounts','lodash','util','../../config/logger','api','moment','rimraf','../../config/environment'];(function(_0xb1ff7c,_0xed49e2){var _0x380c16=function(_0x15a842){while(--_0x15a842){_0xb1ff7c['push'](_0xb1ff7c['shift']());}};_0x380c16(++_0xed49e2);}(_0xba34,0x119));var _0x4ba3=function(_0x54595e,_0x3f9b46){_0x54595e=_0x54595e-0x0;var _0x4d36f8=_0xba34[_0x54595e];return _0x4d36f8;};'use strict';var _=require(_0x4ba3('0x0'));var util=require(_0x4ba3('0x1'));var logger=require(_0x4ba3('0x2'))(_0x4ba3('0x3'));var moment=require(_0x4ba3('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x4ba3('0x5'));var config=require(_0x4ba3('0x6'));var attributes=require(_0x4ba3('0x7'));var integrations=require(_0x4ba3('0x8'));module[_0x4ba3('0x9')]=function(_0xb88621,_0xe5f99a){return _0xb88621['define'](_0x4ba3('0xa'),attributes,{'tableName':_0x4ba3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb138=['int_servicenow_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intServicenowAccount.attributes','exports','define','ServicenowAccount'];(function(_0x1f55af,_0x3a2a0b){var _0x1b965f=function(_0xd47b1a){while(--_0xd47b1a){_0x1f55af['push'](_0x1f55af['shift']());}};_0x1b965f(++_0x3a2a0b);}(_0xb138,0x1dd));var _0x8b13=function(_0x2b2f86,_0x387bd9){_0x2b2f86=_0x2b2f86-0x0;var _0x78e050=_0xb138[_0x2b2f86];return _0x78e050;};'use strict';var _=require(_0x8b13('0x0'));var util=require(_0x8b13('0x1'));var logger=require(_0x8b13('0x2'))(_0x8b13('0x3'));var moment=require(_0x8b13('0x4'));var BPromise=require(_0x8b13('0x5'));var rp=require(_0x8b13('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8b13('0x7'));var config=require(_0x8b13('0x8'));var attributes=require(_0x8b13('0x9'));var integrations=require('../../components/integrations/configuration');module[_0x8b13('0xa')]=function(_0x13f7bd,_0x5d51b1){return _0x13f7bd[_0x8b13('0xb')](_0x8b13('0xc'),attributes,{'tableName':_0x8b13('0xd'),'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 c8f99fc..56a2e4b 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 _0x59ec=['error','code','message','catch','GetServicenowAccount','options','where','limit','include','map','model','attributes','debug','ShowServicenowAccount','ServicenowAccount','find','raw','lodash','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify'];(function(_0xfc9016,_0x296998){var _0x2190a9=function(_0x497c8f){while(--_0x497c8f){_0xfc9016['push'](_0xfc9016['shift']());}};_0x2190a9(++_0x296998);}(_0x59ec,0x77));var _0xc59e=function(_0x33529b,_0x2e40e5){_0x33529b=_0x33529b-0x0;var _0x3f8e12=_0x59ec[_0x33529b];return _0x3f8e12;};'use strict';var _=require(_0xc59e('0x0'));var util=require('util');var moment=require(_0xc59e('0x1'));var BPromise=require(_0xc59e('0x2'));var rs=require(_0xc59e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc59e('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xc59e('0x5'));var config=require(_0xc59e('0x6'));var jayson=require(_0xc59e('0x7'));var client=jayson[_0xc59e('0x8')][_0xc59e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xa2ec23,_0x1b1ca6,_0x5da18c){return new BPromise(function(_0x10d257,_0xb41b64){return client[_0xc59e('0xa')](_0xa2ec23,_0x5da18c)[_0xc59e('0xb')](function(_0x3a37bf){logger[_0xc59e('0xc')](_0xc59e('0xd'),_0x1b1ca6,_0xc59e('0xe'));logger['debug'](_0xc59e('0xf'),_0x1b1ca6,'request\x20sent',JSON[_0xc59e('0x10')](_0x3a37bf));if(_0x3a37bf[_0xc59e('0x11')]){if(_0x3a37bf[_0xc59e('0x11')][_0xc59e('0x12')]===0x1f4){logger[_0xc59e('0x11')](_0xc59e('0xd'),_0x1b1ca6,_0x3a37bf[_0xc59e('0x11')][_0xc59e('0x13')]);return _0xb41b64(_0x3a37bf['error']['message']);}logger[_0xc59e('0x11')](_0xc59e('0xd'),_0x1b1ca6,_0x3a37bf[_0xc59e('0x11')][_0xc59e('0x13')]);return _0x10d257(_0x3a37bf[_0xc59e('0x11')][_0xc59e('0x13')]);}else{logger[_0xc59e('0xc')](_0xc59e('0xd'),_0x1b1ca6,_0xc59e('0xe'));_0x10d257(_0x3a37bf['result']['message']);}})[_0xc59e('0x14')](function(_0x114bde){logger[_0xc59e('0x11')](_0xc59e('0xd'),_0x1b1ca6,_0x114bde);_0xb41b64(_0x114bde);});});}exports[_0xc59e('0x15')]=function(_0x24de85){var _0x5596f4=this;return new Promise(function(_0x3b4ff9,_0x1c5af3){return db['ServicenowAccount']['findAll']({'raw':_0x24de85['options']?_0x24de85[_0xc59e('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x24de85[_0xc59e('0x16')]?_0x24de85[_0xc59e('0x16')][_0xc59e('0x17')]||null:null,'attributes':_0x24de85[_0xc59e('0x16')]?_0x24de85[_0xc59e('0x16')]['attributes']||null:null,'limit':_0x24de85[_0xc59e('0x16')]?_0x24de85[_0xc59e('0x16')][_0xc59e('0x18')]||null:null,'include':_0x24de85['options']?_0x24de85[_0xc59e('0x16')][_0xc59e('0x19')]?_[_0xc59e('0x1a')](_0x24de85[_0xc59e('0x16')][_0xc59e('0x19')],function(_0x117bac){return{'model':db[_0x117bac[_0xc59e('0x1b')]],'as':_0x117bac['as'],'attributes':_0x117bac[_0xc59e('0x1c')],'include':_0x117bac[_0xc59e('0x19')]?_[_0xc59e('0x1a')](_0x117bac['include'],function(_0x5027ae){return{'model':db[_0x5027ae['model']],'as':_0x5027ae['as'],'attributes':_0x5027ae[_0xc59e('0x1c')],'include':_0x5027ae[_0xc59e('0x19')]?_[_0xc59e('0x1a')](_0x5027ae[_0xc59e('0x19')],function(_0x4e33da){return{'model':db[_0x4e33da[_0xc59e('0x1b')]],'as':_0x4e33da['as'],'attributes':_0x4e33da[_0xc59e('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4ae50d){logger[_0xc59e('0xc')](_0xc59e('0x15'),_0x24de85);logger[_0xc59e('0x1d')](_0xc59e('0x15'),_0x24de85,JSON[_0xc59e('0x10')](_0x4ae50d));_0x3b4ff9(_0x4ae50d);})[_0xc59e('0x14')](function(_0x3ef007){logger[_0xc59e('0x11')](_0xc59e('0x15'),_0x3ef007[_0xc59e('0x13')],_0x24de85);_0x1c5af3(_0x5596f4[_0xc59e('0x11')](0x1f4,_0x3ef007[_0xc59e('0x13')]));});});};exports[_0xc59e('0x1e')]=function(_0x2b823f){var _0x1f8658=this;return new Promise(function(_0x317130,_0x192eba){return db[_0xc59e('0x1f')][_0xc59e('0x20')]({'raw':_0x2b823f[_0xc59e('0x16')]?_0x2b823f[_0xc59e('0x16')][_0xc59e('0x21')]===undefined?!![]:![]:!![],'where':_0x2b823f[_0xc59e('0x16')]?_0x2b823f[_0xc59e('0x16')][_0xc59e('0x17')]||null:null,'attributes':_0x2b823f['options']?_0x2b823f[_0xc59e('0x16')]['attributes']||null:null,'include':_0x2b823f[_0xc59e('0x16')]?_0x2b823f[_0xc59e('0x16')][_0xc59e('0x19')]?_[_0xc59e('0x1a')](_0x2b823f['options']['include'],function(_0x591114){return{'model':db[_0x591114[_0xc59e('0x1b')]],'as':_0x591114['as'],'attributes':_0x591114[_0xc59e('0x1c')],'include':_0x591114[_0xc59e('0x19')]?_['map'](_0x591114[_0xc59e('0x19')],function(_0x21cd98){return{'model':db[_0x21cd98[_0xc59e('0x1b')]],'as':_0x21cd98['as'],'attributes':_0x21cd98['attributes'],'include':_0x21cd98[_0xc59e('0x19')]?_[_0xc59e('0x1a')](_0x21cd98[_0xc59e('0x19')],function(_0x231f2){return{'model':db[_0x231f2['model']],'as':_0x231f2['as'],'attributes':_0x231f2['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x136fc5){logger[_0xc59e('0xc')](_0xc59e('0x1e'),_0x2b823f);logger[_0xc59e('0x1d')]('ShowServicenowAccount',_0x2b823f,JSON[_0xc59e('0x10')](_0x136fc5));_0x317130(_0x136fc5);})[_0xc59e('0x14')](function(_0x1f445e){logger[_0xc59e('0x11')](_0xc59e('0x1e'),_0x1f445e[_0xc59e('0x13')],_0x2b823f);_0x192eba(_0x1f8658[_0xc59e('0x11')](0x1f4,_0x1f445e[_0xc59e('0x13')]));});});}; \ No newline at end of file +var _0x3c2e=['catch','ServicenowAccount','find','debug','ShowServicenowAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','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','findAll','options','raw','where','attributes','include','map','model','GetServicenowAccount'];(function(_0x163b63,_0x58ad7b){var _0x435f17=function(_0x2a20be){while(--_0x2a20be){_0x163b63['push'](_0x163b63['shift']());}};_0x435f17(++_0x58ad7b);}(_0x3c2e,0xa1));var _0xe3c2=function(_0x13017c,_0x529627){_0x13017c=_0x13017c-0x0;var _0x43c838=_0x3c2e[_0x13017c];return _0x43c838;};'use strict';var _=require(_0xe3c2('0x0'));var util=require(_0xe3c2('0x1'));var moment=require(_0xe3c2('0x2'));var BPromise=require(_0xe3c2('0x3'));var rs=require(_0xe3c2('0x4'));var fs=require('fs');var Redis=require(_0xe3c2('0x5'));var db=require(_0xe3c2('0x6'))['db'];var utils=require(_0xe3c2('0x7'));var logger=require(_0xe3c2('0x8'))(_0xe3c2('0x9'));var config=require(_0xe3c2('0xa'));var jayson=require(_0xe3c2('0xb'));var client=jayson[_0xe3c2('0xc')][_0xe3c2('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x5305bc,_0x7157ee,_0x27e391){return new BPromise(function(_0x39d354,_0x408a9b){return client[_0xe3c2('0xe')](_0x5305bc,_0x27e391)[_0xe3c2('0xf')](function(_0x561787){logger[_0xe3c2('0x10')](_0xe3c2('0x11'),_0x7157ee,'request\x20sent');logger['debug'](_0xe3c2('0x12'),_0x7157ee,_0xe3c2('0x13'),JSON[_0xe3c2('0x14')](_0x561787));if(_0x561787[_0xe3c2('0x15')]){if(_0x561787[_0xe3c2('0x15')][_0xe3c2('0x16')]===0x1f4){logger[_0xe3c2('0x15')](_0xe3c2('0x11'),_0x7157ee,_0x561787['error']['message']);return _0x408a9b(_0x561787[_0xe3c2('0x15')][_0xe3c2('0x17')]);}logger[_0xe3c2('0x15')](_0xe3c2('0x11'),_0x7157ee,_0x561787['error']['message']);return _0x39d354(_0x561787[_0xe3c2('0x15')][_0xe3c2('0x17')]);}else{logger['info'](_0xe3c2('0x11'),_0x7157ee,'request\x20sent');_0x39d354(_0x561787[_0xe3c2('0x18')][_0xe3c2('0x17')]);}})['catch'](function(_0x417b30){logger[_0xe3c2('0x15')](_0xe3c2('0x11'),_0x7157ee,_0x417b30);_0x408a9b(_0x417b30);});});}exports['GetServicenowAccount']=function(_0x3a377c){var _0x2c6254=this;return new Promise(function(_0x4ae719,_0x3aa492){return db['ServicenowAccount'][_0xe3c2('0x19')]({'raw':_0x3a377c['options']?_0x3a377c[_0xe3c2('0x1a')][_0xe3c2('0x1b')]===undefined?!![]:![]:!![],'where':_0x3a377c[_0xe3c2('0x1a')]?_0x3a377c['options'][_0xe3c2('0x1c')]||null:null,'attributes':_0x3a377c['options']?_0x3a377c[_0xe3c2('0x1a')][_0xe3c2('0x1d')]||null:null,'limit':_0x3a377c[_0xe3c2('0x1a')]?_0x3a377c[_0xe3c2('0x1a')]['limit']||null:null,'include':_0x3a377c['options']?_0x3a377c['options'][_0xe3c2('0x1e')]?_[_0xe3c2('0x1f')](_0x3a377c[_0xe3c2('0x1a')][_0xe3c2('0x1e')],function(_0x493f74){return{'model':db[_0x493f74['model']],'as':_0x493f74['as'],'attributes':_0x493f74['attributes'],'include':_0x493f74[_0xe3c2('0x1e')]?_[_0xe3c2('0x1f')](_0x493f74['include'],function(_0x418b80){return{'model':db[_0x418b80[_0xe3c2('0x20')]],'as':_0x418b80['as'],'attributes':_0x418b80[_0xe3c2('0x1d')],'include':_0x418b80[_0xe3c2('0x1e')]?_[_0xe3c2('0x1f')](_0x418b80['include'],function(_0x829d7b){return{'model':db[_0x829d7b[_0xe3c2('0x20')]],'as':_0x829d7b['as'],'attributes':_0x829d7b[_0xe3c2('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xe3c2('0xf')](function(_0x210c32){logger['info'](_0xe3c2('0x21'),_0x3a377c);logger['debug'](_0xe3c2('0x21'),_0x3a377c,JSON[_0xe3c2('0x14')](_0x210c32));_0x4ae719(_0x210c32);})[_0xe3c2('0x22')](function(_0x59e5ac){logger[_0xe3c2('0x15')](_0xe3c2('0x21'),_0x59e5ac[_0xe3c2('0x17')],_0x3a377c);_0x3aa492(_0x2c6254['error'](0x1f4,_0x59e5ac[_0xe3c2('0x17')]));});});};exports['ShowServicenowAccount']=function(_0x412c8d){var _0x14abc6=this;return new Promise(function(_0x2297ae,_0x125e5b){return db[_0xe3c2('0x23')][_0xe3c2('0x24')]({'raw':_0x412c8d[_0xe3c2('0x1a')]?_0x412c8d['options'][_0xe3c2('0x1b')]===undefined?!![]:![]:!![],'where':_0x412c8d['options']?_0x412c8d[_0xe3c2('0x1a')][_0xe3c2('0x1c')]||null:null,'attributes':_0x412c8d['options']?_0x412c8d[_0xe3c2('0x1a')][_0xe3c2('0x1d')]||null:null,'include':_0x412c8d[_0xe3c2('0x1a')]?_0x412c8d[_0xe3c2('0x1a')]['include']?_[_0xe3c2('0x1f')](_0x412c8d[_0xe3c2('0x1a')]['include'],function(_0x289ce9){return{'model':db[_0x289ce9[_0xe3c2('0x20')]],'as':_0x289ce9['as'],'attributes':_0x289ce9['attributes'],'include':_0x289ce9[_0xe3c2('0x1e')]?_[_0xe3c2('0x1f')](_0x289ce9[_0xe3c2('0x1e')],function(_0x4d127e){return{'model':db[_0x4d127e[_0xe3c2('0x20')]],'as':_0x4d127e['as'],'attributes':_0x4d127e[_0xe3c2('0x1d')],'include':_0x4d127e[_0xe3c2('0x1e')]?_[_0xe3c2('0x1f')](_0x4d127e[_0xe3c2('0x1e')],function(_0x4a5fcb){return{'model':db[_0x4a5fcb[_0xe3c2('0x20')]],'as':_0x4a5fcb['as'],'attributes':_0x4a5fcb[_0xe3c2('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xe3c2('0xf')](function(_0x41a873){logger['info']('ShowServicenowAccount',_0x412c8d);logger[_0xe3c2('0x25')](_0xe3c2('0x26'),_0x412c8d,JSON[_0xe3c2('0x14')](_0x41a873));_0x2297ae(_0x41a873);})['catch'](function(_0x4c1488){logger[_0xe3c2('0x15')](_0xe3c2('0x26'),_0x4c1488[_0xe3c2('0x17')],_0x412c8d);_0x125e5b(_0x14abc6[_0xe3c2('0x15')](0x1f4,_0x4c1488[_0xe3c2('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index 2a40d54..9a9c4bd 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 _0xd6bc=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intServicenowConfiguration.controller','get','isAuthenticated','index','show','/:id/subjects','/:id/descriptions','getDescriptions','post','/:id','destroy','exports','multer','util','path','connect-timeout'];(function(_0x75f869,_0x3690d6){var _0x10af8b=function(_0x22d3ff){while(--_0x22d3ff){_0x75f869['push'](_0x75f869['shift']());}};_0x10af8b(++_0x3690d6);}(_0xd6bc,0x88));var _0xcd6b=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0xd6bc[_0x27af45];return _0x18df21;};'use strict';var multer=require(_0xcd6b('0x0'));var util=require(_0xcd6b('0x1'));var path=require(_0xcd6b('0x2'));var timeout=require(_0xcd6b('0x3'));var express=require('express');var router=express[_0xcd6b('0x4')]();var fs_extra=require(_0xcd6b('0x5'));var auth=require(_0xcd6b('0x6'));var interaction=require(_0xcd6b('0x7'));var config=require('../../config/environment');var controller=require(_0xcd6b('0x8'));router[_0xcd6b('0x9')]('/',auth[_0xcd6b('0xa')](),controller[_0xcd6b('0xb')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xcd6b('0xc')]);router[_0xcd6b('0x9')]('/:id/fields',auth[_0xcd6b('0xa')](),controller['getFields']);router[_0xcd6b('0x9')](_0xcd6b('0xd'),auth[_0xcd6b('0xa')](),controller['getSubjects']);router[_0xcd6b('0x9')](_0xcd6b('0xe'),auth[_0xcd6b('0xa')](),controller[_0xcd6b('0xf')]);router[_0xcd6b('0x10')]('/',auth[_0xcd6b('0xa')](),controller['create']);router['put'](_0xcd6b('0x11'),auth[_0xcd6b('0xa')](),controller['update']);router['delete'](_0xcd6b('0x11'),auth['isAuthenticated'](),controller[_0xcd6b('0x12')]);module[_0xcd6b('0x13')]=router; \ No newline at end of file +var _0xac46=['fs-extra','./intServicenowConfiguration.controller','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','update','multer','util','path','connect-timeout','Router'];(function(_0x4a3a20,_0x265ad0){var _0xea052a=function(_0x4023ea){while(--_0x4023ea){_0x4a3a20['push'](_0x4a3a20['shift']());}};_0xea052a(++_0x265ad0);}(_0xac46,0x1d6));var _0x6ac4=function(_0x411205,_0x36cf0f){_0x411205=_0x411205-0x0;var _0x355fb0=_0xac46[_0x411205];return _0x355fb0;};'use strict';var multer=require(_0x6ac4('0x0'));var util=require(_0x6ac4('0x1'));var path=require(_0x6ac4('0x2'));var timeout=require(_0x6ac4('0x3'));var express=require('express');var router=express[_0x6ac4('0x4')]();var fs_extra=require(_0x6ac4('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x6ac4('0x6'));router[_0x6ac4('0x7')]('/',auth[_0x6ac4('0x8')](),controller['index']);router['get'](_0x6ac4('0x9'),auth[_0x6ac4('0x8')](),controller[_0x6ac4('0xa')]);router[_0x6ac4('0x7')](_0x6ac4('0xb'),auth['isAuthenticated'](),controller[_0x6ac4('0xc')]);router['get'](_0x6ac4('0xd'),auth[_0x6ac4('0x8')](),controller[_0x6ac4('0xe')]);router['get'](_0x6ac4('0xf'),auth[_0x6ac4('0x8')](),controller[_0x6ac4('0x10')]);router[_0x6ac4('0x11')]('/',auth[_0x6ac4('0x8')](),controller['create']);router['put']('/:id',auth[_0x6ac4('0x8')](),controller[_0x6ac4('0x12')]);router['delete'](_0x6ac4('0x9'),auth[_0x6ac4('0x8')](),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 b44152d..7b70513 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 _0xfa9e=['sequelize','exports','STRING'];(function(_0x7ea55a,_0x408ebd){var _0x1c75e0=function(_0x17f29f){while(--_0x17f29f){_0x7ea55a['push'](_0x7ea55a['shift']());}};_0x1c75e0(++_0x408ebd);}(_0xfa9e,0x1cb));var _0xefa9=function(_0x5d1624,_0x3e848a){_0x5d1624=_0x5d1624-0x0;var _0x32ca97=_0xfa9e[_0x5d1624];return _0x32ca97;};'use strict';var Sequelize=require(_0xefa9('0x0'));module[_0xefa9('0x1')]={'name':{'type':Sequelize[_0xefa9('0x2')]},'description':{'type':Sequelize[_0xefa9('0x2')]}}; \ No newline at end of file +var _0xe5cf=['sequelize','exports','STRING'];(function(_0x40efb6,_0x5ada54){var _0x4933fc=function(_0x2ba724){while(--_0x2ba724){_0x40efb6['push'](_0x40efb6['shift']());}};_0x4933fc(++_0x5ada54);}(_0xe5cf,0x13b));var _0xfe5c=function(_0xb0b610,_0x262078){_0xb0b610=_0xb0b610-0x0;var _0x4866e4=_0xe5cf[_0xb0b610];return _0x4866e4;};'use strict';var Sequelize=require(_0xfe5c('0x0'));module[_0xfe5c('0x1')]={'name':{'type':Sequelize[_0xfe5c('0x2')]},'description':{'type':Sequelize[_0xfe5c('0x2')]}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index d73acd0..0a469c1 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 _0x5634=['end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','then','destroy','sendStatus','error','stack','name','send','map','ServicenowConfiguration','rawAttributes','fieldName','type','key','keys','query','filters','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','intersection','length','find','create','body','findOne','ServicenowField','getFields','getSubjects','getDescriptions','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status'];(function(_0x5617dd,_0x15ad4f){var _0x92c09f=function(_0x24e678){while(--_0x24e678){_0x5617dd['push'](_0x5617dd['shift']());}};_0x92c09f(++_0x15ad4f);}(_0x5634,0xe1));var _0x4563=function(_0x7d930f,_0x1c6fcf){_0x7d930f=_0x7d930f-0x0;var _0x64c9fc=_0x5634[_0x7d930f];return _0x64c9fc;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4563('0x0'));var zipdir=require(_0x4563('0x1'));var jsonpatch=require(_0x4563('0x2'));var rp=require(_0x4563('0x3'));var moment=require(_0x4563('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4563('0x5'));var util=require(_0x4563('0x6'));var path=require(_0x4563('0x7'));var sox=require('sox');var csv=require(_0x4563('0x8'));var ejs=require(_0x4563('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x4563('0xa'));var crypto=require(_0x4563('0xb'));var jsforce=require(_0x4563('0xc'));var deskjs=require(_0x4563('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x4563('0xe'));var Redis=require(_0x4563('0xf'));var authService=require(_0x4563('0x10'));var qs=require(_0x4563('0x11'));var as=require(_0x4563('0x12'));var hardwareService=require(_0x4563('0x13'));var logger=require(_0x4563('0x14'))(_0x4563('0x15'));var utils=require(_0x4563('0x16'));var config=require(_0x4563('0x17'));var licenseUtil=require(_0x4563('0x18'));var db=require(_0x4563('0x19'))['db'];function respondWithStatusCode(_0x5a2a41,_0x45a90b){_0x45a90b=_0x45a90b||0xcc;return function(_0x229d43){if(_0x229d43){return _0x5a2a41['sendStatus'](_0x45a90b);}return _0x5a2a41[_0x4563('0x1a')](_0x45a90b)[_0x4563('0x1b')]();};}function respondWithResult(_0x1ba2a7,_0x3baa15){_0x3baa15=_0x3baa15||0xc8;return function(_0x206cf0){if(_0x206cf0){return _0x1ba2a7[_0x4563('0x1a')](_0x3baa15)[_0x4563('0x1c')](_0x206cf0);}};}function respondWithFilteredResult(_0x40dddb,_0x2db0f6){return function(_0x48d7aa){if(_0x48d7aa){var _0x4ffff4=typeof _0x2db0f6[_0x4563('0x1d')]==='undefined'&&typeof _0x2db0f6['limit']===_0x4563('0x1e');var _0x2c01c8=_0x48d7aa[_0x4563('0x1f')];var _0x5391c8=_0x4ffff4?0x0:_0x2db0f6[_0x4563('0x1d')];var _0x1aab5f=_0x4ffff4?_0x48d7aa[_0x4563('0x1f')]:_0x2db0f6[_0x4563('0x1d')]+_0x2db0f6[_0x4563('0x20')];var _0x6cc070;if(_0x1aab5f>=_0x2c01c8){_0x1aab5f=_0x2c01c8;_0x6cc070=0xc8;}else{_0x6cc070=0xce;}_0x40dddb['status'](_0x6cc070);return _0x40dddb[_0x4563('0x21')](_0x4563('0x22'),_0x5391c8+'-'+_0x1aab5f+'/'+_0x2c01c8)[_0x4563('0x1c')](_0x48d7aa);}return null;};}function patchUpdates(_0x3dd894){return function(_0x4e6e66){try{jsonpatch[_0x4563('0x23')](_0x4e6e66,_0x3dd894,!![]);}catch(_0x4313d9){return BPromise['reject'](_0x4313d9);}return _0x4e6e66[_0x4563('0x24')]();};}function saveUpdates(_0x3d1c50,_0x119e48){return function(_0xb89dbf){if(_0xb89dbf){return _0xb89dbf[_0x4563('0x25')](_0x3d1c50)[_0x4563('0x26')](function(_0x41b519){return _0x41b519;});}return null;};}function removeEntity(_0x5e4ca6,_0x4ef45d){return function(_0x3ceb1a){if(_0x3ceb1a){return _0x3ceb1a[_0x4563('0x27')]()[_0x4563('0x26')](function(){_0x5e4ca6[_0x4563('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x51632f,_0x1d8507){return function(_0x48fffc){if(!_0x48fffc){_0x51632f[_0x4563('0x28')](0x194);}return _0x48fffc;};}function handleError(_0x52bcb7,_0x274c2d){_0x274c2d=_0x274c2d||0x1f4;return function(_0x1d1c99){logger[_0x4563('0x29')](_0x1d1c99[_0x4563('0x2a')]);if(_0x1d1c99[_0x4563('0x2b')]){delete _0x1d1c99['name'];}_0x52bcb7[_0x4563('0x1a')](_0x274c2d)[_0x4563('0x2c')](_0x1d1c99);};}exports['index']=function(_0x5b0bc1,_0x338cad){var _0x2a2ef0={},_0x4113af={},_0x52040d={'count':0x0,'rows':[]};var _0x478e82=_[_0x4563('0x2d')](db[_0x4563('0x2e')][_0x4563('0x2f')],function(_0x2056c7){return{'name':_0x2056c7[_0x4563('0x30')],'type':_0x2056c7[_0x4563('0x31')][_0x4563('0x32')]};});_0x4113af['model']=_[_0x4563('0x2d')](_0x478e82,'name');_0x4113af['query']=_[_0x4563('0x33')](_0x5b0bc1[_0x4563('0x34')]);_0x4113af[_0x4563('0x35')]=_['intersection'](_0x4113af[_0x4563('0x36')],_0x4113af[_0x4563('0x34')]);_0x2a2ef0['attributes']=_['intersection'](_0x4113af[_0x4563('0x36')],qs[_0x4563('0x37')](_0x5b0bc1[_0x4563('0x34')]['fields']));_0x2a2ef0[_0x4563('0x38')]=_0x2a2ef0[_0x4563('0x38')]['length']?_0x2a2ef0['attributes']:_0x4113af[_0x4563('0x36')];if(!_0x5b0bc1[_0x4563('0x34')][_0x4563('0x39')](_0x4563('0x3a'))){_0x2a2ef0[_0x4563('0x20')]=qs[_0x4563('0x20')](_0x5b0bc1[_0x4563('0x34')]['limit']);_0x2a2ef0[_0x4563('0x1d')]=qs[_0x4563('0x1d')](_0x5b0bc1[_0x4563('0x34')]['offset']);}_0x2a2ef0[_0x4563('0x3b')]=qs[_0x4563('0x3c')](_0x5b0bc1[_0x4563('0x34')]['sort']);_0x2a2ef0[_0x4563('0x3d')]=qs[_0x4563('0x35')](_[_0x4563('0x3e')](_0x5b0bc1[_0x4563('0x34')],_0x4113af[_0x4563('0x35')]),_0x478e82);if(_0x5b0bc1[_0x4563('0x34')][_0x4563('0x3f')]){_0x2a2ef0[_0x4563('0x3d')]=_['merge'](_0x2a2ef0[_0x4563('0x3d')],{'$or':_[_0x4563('0x2d')](_0x478e82,function(_0x4097f9){if(_0x4097f9[_0x4563('0x31')]!==_0x4563('0x40')){var _0x2099dc={};_0x2099dc[_0x4097f9['name']]={'$like':'%'+_0x5b0bc1[_0x4563('0x34')]['filter']+'%'};return _0x2099dc;}})});}_0x2a2ef0=_[_0x4563('0x41')]({},_0x2a2ef0,_0x5b0bc1[_0x4563('0x42')]);var _0x31d122={'where':_0x2a2ef0['where']};return db[_0x4563('0x2e')][_0x4563('0x1f')](_0x31d122)[_0x4563('0x26')](function(_0x25a11c){_0x52040d[_0x4563('0x1f')]=_0x25a11c;if(_0x5b0bc1[_0x4563('0x34')][_0x4563('0x43')]){_0x2a2ef0[_0x4563('0x44')]=[{'all':!![]}];}return db[_0x4563('0x2e')][_0x4563('0x45')](_0x2a2ef0);})[_0x4563('0x26')](function(_0x598ed5){_0x52040d[_0x4563('0x46')]=_0x598ed5;return _0x52040d;})[_0x4563('0x26')](respondWithFilteredResult(_0x338cad,_0x2a2ef0))[_0x4563('0x47')](handleError(_0x338cad,null));};exports[_0x4563('0x48')]=function(_0x59e7d6,_0x69de93){var _0x3ebe50={'raw':![],'where':{'id':_0x59e7d6[_0x4563('0x49')]['id']}},_0x3e5007={};_0x3e5007[_0x4563('0x36')]=_['keys'](db['ServicenowConfiguration'][_0x4563('0x2f')]);_0x3e5007[_0x4563('0x34')]=_[_0x4563('0x33')](_0x59e7d6[_0x4563('0x34')]);_0x3e5007[_0x4563('0x35')]=_[_0x4563('0x4a')](_0x3e5007[_0x4563('0x36')],_0x3e5007[_0x4563('0x34')]);_0x3ebe50[_0x4563('0x38')]=_[_0x4563('0x4a')](_0x3e5007[_0x4563('0x36')],qs[_0x4563('0x37')](_0x59e7d6['query']['fields']));_0x3ebe50['attributes']=_0x3ebe50[_0x4563('0x38')][_0x4563('0x4b')]?_0x3ebe50[_0x4563('0x38')]:_0x3e5007[_0x4563('0x36')];if(_0x59e7d6[_0x4563('0x34')][_0x4563('0x43')]){_0x3ebe50[_0x4563('0x44')]=[{'all':!![]}];}_0x3ebe50=_['merge']({},_0x3ebe50,_0x59e7d6['options']);return db[_0x4563('0x2e')][_0x4563('0x4c')](_0x3ebe50)['then'](handleEntityNotFound(_0x69de93,null))[_0x4563('0x26')](respondWithResult(_0x69de93,null))['catch'](handleError(_0x69de93,null));};exports[_0x4563('0x4d')]=function(_0x1ff322,_0x36ddae){return db['ServicenowConfiguration'][_0x4563('0x4d')](_0x1ff322['body'],{})[_0x4563('0x26')](respondWithResult(_0x36ddae,0xc9))[_0x4563('0x47')](handleError(_0x36ddae,null));};exports[_0x4563('0x25')]=function(_0x630831,_0x21e2c9){if(_0x630831[_0x4563('0x4e')]['id']){delete _0x630831[_0x4563('0x4e')]['id'];}return db[_0x4563('0x2e')][_0x4563('0x4c')]({'where':{'id':_0x630831['params']['id']}})[_0x4563('0x26')](handleEntityNotFound(_0x21e2c9,null))[_0x4563('0x26')](saveUpdates(_0x630831[_0x4563('0x4e')],null))['then'](respondWithResult(_0x21e2c9,null))[_0x4563('0x47')](handleError(_0x21e2c9,null));};exports[_0x4563('0x27')]=function(_0x1688f9,_0x405efc){return db[_0x4563('0x2e')]['find']({'where':{'id':_0x1688f9[_0x4563('0x49')]['id']}})['then'](handleEntityNotFound(_0x405efc,null))[_0x4563('0x26')](removeEntity(_0x405efc,null))[_0x4563('0x47')](handleError(_0x405efc,null));};exports['getFields']=function(_0x551a91,_0x4e1800,_0x27acc2){var _0x5a5bfb={};var _0x78b1db={};var _0x110212;var _0x50ddc3;return db[_0x4563('0x2e')][_0x4563('0x4f')]({'where':{'id':_0x551a91[_0x4563('0x49')]['id']}})[_0x4563('0x26')](handleEntityNotFound(_0x4e1800,null))[_0x4563('0x26')](function(_0x2db024){if(_0x2db024){_0x110212=_0x2db024;_0x78b1db[_0x4563('0x36')]=_['keys'](db[_0x4563('0x50')][_0x4563('0x2f')]);_0x78b1db[_0x4563('0x34')]=_[_0x4563('0x33')](_0x551a91[_0x4563('0x34')]);_0x78b1db[_0x4563('0x35')]=_[_0x4563('0x4a')](_0x78b1db[_0x4563('0x36')],_0x78b1db[_0x4563('0x34')]);_0x5a5bfb[_0x4563('0x38')]=_[_0x4563('0x4a')](_0x78b1db[_0x4563('0x36')],qs[_0x4563('0x37')](_0x551a91[_0x4563('0x34')][_0x4563('0x37')]));_0x5a5bfb[_0x4563('0x38')]=_0x5a5bfb[_0x4563('0x38')]['length']?_0x5a5bfb[_0x4563('0x38')]:_0x78b1db[_0x4563('0x36')];_0x5a5bfb[_0x4563('0x3b')]=qs['sort'](_0x551a91[_0x4563('0x34')][_0x4563('0x3c')]);_0x5a5bfb[_0x4563('0x3d')]=qs[_0x4563('0x35')](_[_0x4563('0x3e')](_0x551a91[_0x4563('0x34')],_0x78b1db[_0x4563('0x35')]));if(_0x551a91[_0x4563('0x34')]['filter']){_0x5a5bfb[_0x4563('0x3d')]=_[_0x4563('0x41')](_0x5a5bfb[_0x4563('0x3d')],{'$or':_['map'](_0x5a5bfb[_0x4563('0x38')],function(_0x55f18e){var _0x313c1f={};_0x313c1f[_0x55f18e]={'$like':'%'+_0x551a91[_0x4563('0x34')][_0x4563('0x3f')]+'%'};return _0x313c1f;})});}_0x5a5bfb=_[_0x4563('0x41')]({},_0x5a5bfb,_0x551a91[_0x4563('0x42')]);return _0x110212[_0x4563('0x51')](_0x5a5bfb);}})[_0x4563('0x26')](function(_0x5448d1){if(_0x5448d1){_0x50ddc3=_0x5448d1[_0x4563('0x4b')];if(!_0x551a91[_0x4563('0x34')][_0x4563('0x39')](_0x4563('0x3a'))){_0x5a5bfb[_0x4563('0x20')]=qs['limit'](_0x551a91[_0x4563('0x34')][_0x4563('0x20')]);_0x5a5bfb[_0x4563('0x1d')]=qs['offset'](_0x551a91[_0x4563('0x34')][_0x4563('0x1d')]);}return _0x110212[_0x4563('0x51')](_0x5a5bfb);}})[_0x4563('0x26')](function(_0xf28a41){if(_0xf28a41){return _0xf28a41?{'count':_0x50ddc3,'rows':_0xf28a41}:null;}})[_0x4563('0x26')](respondWithResult(_0x4e1800,null))[_0x4563('0x47')](handleError(_0x4e1800,null));};exports[_0x4563('0x52')]=function(_0x8b1ba9,_0x38bfe5,_0x5c5c9d){var _0x1598f2={};var _0x16df7a={};var _0x24430d;var _0x57c2a0;return db['ServicenowConfiguration'][_0x4563('0x4f')]({'where':{'id':_0x8b1ba9[_0x4563('0x49')]['id']}})['then'](handleEntityNotFound(_0x38bfe5,null))[_0x4563('0x26')](function(_0x30a66c){if(_0x30a66c){_0x24430d=_0x30a66c;_0x16df7a[_0x4563('0x36')]=_[_0x4563('0x33')](db[_0x4563('0x50')]['rawAttributes']);_0x16df7a[_0x4563('0x34')]=_['keys'](_0x8b1ba9[_0x4563('0x34')]);_0x16df7a[_0x4563('0x35')]=_[_0x4563('0x4a')](_0x16df7a[_0x4563('0x36')],_0x16df7a['query']);_0x1598f2[_0x4563('0x38')]=_[_0x4563('0x4a')](_0x16df7a[_0x4563('0x36')],qs['fields'](_0x8b1ba9['query']['fields']));_0x1598f2[_0x4563('0x38')]=_0x1598f2[_0x4563('0x38')][_0x4563('0x4b')]?_0x1598f2[_0x4563('0x38')]:_0x16df7a['model'];_0x1598f2[_0x4563('0x3b')]=qs['sort'](_0x8b1ba9[_0x4563('0x34')][_0x4563('0x3c')]);_0x1598f2['where']=qs[_0x4563('0x35')](_[_0x4563('0x3e')](_0x8b1ba9[_0x4563('0x34')],_0x16df7a[_0x4563('0x35')]));if(_0x8b1ba9[_0x4563('0x34')]['filter']){_0x1598f2['where']=_[_0x4563('0x41')](_0x1598f2[_0x4563('0x3d')],{'$or':_[_0x4563('0x2d')](_0x1598f2[_0x4563('0x38')],function(_0x3923f8){var _0x97a3c8={};_0x97a3c8[_0x3923f8]={'$like':'%'+_0x8b1ba9[_0x4563('0x34')][_0x4563('0x3f')]+'%'};return _0x97a3c8;})});}_0x1598f2=_['merge']({},_0x1598f2,_0x8b1ba9[_0x4563('0x42')]);return _0x24430d[_0x4563('0x52')](_0x1598f2);}})['then'](function(_0x2ee402){if(_0x2ee402){_0x57c2a0=_0x2ee402['length'];if(!_0x8b1ba9[_0x4563('0x34')][_0x4563('0x39')](_0x4563('0x3a'))){_0x1598f2[_0x4563('0x20')]=qs[_0x4563('0x20')](_0x8b1ba9[_0x4563('0x34')][_0x4563('0x20')]);_0x1598f2[_0x4563('0x1d')]=qs[_0x4563('0x1d')](_0x8b1ba9[_0x4563('0x34')]['offset']);}return _0x24430d[_0x4563('0x52')](_0x1598f2);}})['then'](function(_0x4c96d3){if(_0x4c96d3){return _0x4c96d3?{'count':_0x57c2a0,'rows':_0x4c96d3}:null;}})[_0x4563('0x26')](respondWithResult(_0x38bfe5,null))[_0x4563('0x47')](handleError(_0x38bfe5,null));};exports[_0x4563('0x53')]=function(_0xa246a,_0x4ce85d,_0x4c3bbf){var _0x5a52cb={};var _0x465c28={};var _0x255785;var _0xa6fa3;return db[_0x4563('0x2e')][_0x4563('0x4f')]({'where':{'id':_0xa246a['params']['id']}})[_0x4563('0x26')](handleEntityNotFound(_0x4ce85d,null))[_0x4563('0x26')](function(_0x36c3f5){if(_0x36c3f5){_0x255785=_0x36c3f5;_0x465c28[_0x4563('0x36')]=_[_0x4563('0x33')](db[_0x4563('0x50')][_0x4563('0x2f')]);_0x465c28[_0x4563('0x34')]=_[_0x4563('0x33')](_0xa246a['query']);_0x465c28[_0x4563('0x35')]=_['intersection'](_0x465c28[_0x4563('0x36')],_0x465c28[_0x4563('0x34')]);_0x5a52cb[_0x4563('0x38')]=_['intersection'](_0x465c28[_0x4563('0x36')],qs[_0x4563('0x37')](_0xa246a[_0x4563('0x34')][_0x4563('0x37')]));_0x5a52cb['attributes']=_0x5a52cb[_0x4563('0x38')][_0x4563('0x4b')]?_0x5a52cb[_0x4563('0x38')]:_0x465c28['model'];_0x5a52cb[_0x4563('0x3b')]=qs[_0x4563('0x3c')](_0xa246a['query'][_0x4563('0x3c')]);_0x5a52cb[_0x4563('0x3d')]=qs['filters'](_[_0x4563('0x3e')](_0xa246a['query'],_0x465c28[_0x4563('0x35')]));if(_0xa246a[_0x4563('0x34')][_0x4563('0x3f')]){_0x5a52cb[_0x4563('0x3d')]=_[_0x4563('0x41')](_0x5a52cb[_0x4563('0x3d')],{'$or':_[_0x4563('0x2d')](_0x5a52cb[_0x4563('0x38')],function(_0x46b0a6){var _0x340551={};_0x340551[_0x46b0a6]={'$like':'%'+_0xa246a[_0x4563('0x34')][_0x4563('0x3f')]+'%'};return _0x340551;})});}_0x5a52cb=_[_0x4563('0x41')]({},_0x5a52cb,_0xa246a['options']);return _0x255785[_0x4563('0x53')](_0x5a52cb);}})[_0x4563('0x26')](function(_0x2b0efa){if(_0x2b0efa){_0xa6fa3=_0x2b0efa['length'];if(!_0xa246a[_0x4563('0x34')][_0x4563('0x39')]('nolimit')){_0x5a52cb[_0x4563('0x20')]=qs[_0x4563('0x20')](_0xa246a[_0x4563('0x34')][_0x4563('0x20')]);_0x5a52cb[_0x4563('0x1d')]=qs[_0x4563('0x1d')](_0xa246a[_0x4563('0x34')][_0x4563('0x1d')]);}return _0x255785[_0x4563('0x53')](_0x5a52cb);}})[_0x4563('0x26')](function(_0xda60fb){if(_0xda60fb){return _0xda60fb?{'count':_0xa6fa3,'rows':_0xda60fb}:null;}})['then'](respondWithResult(_0x4ce85d,null))['catch'](handleError(_0x4ce85d,null));}; \ No newline at end of file +var _0xfdd3=['ServicenowConfiguration','count','includeAll','include','rows','catch','show','params','options','find','create','body','getFields','getSubjects','order','getDescriptions','ServicenowField','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','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','sendStatus','status','end','json','undefined','limit','offset','set','Content-Range','reject','save','update','then','destroy','stack','name','send','index','map','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL'];(function(_0x1ed483,_0x37e0db){var _0x118560=function(_0x228531){while(--_0x228531){_0x1ed483['push'](_0x1ed483['shift']());}};_0x118560(++_0x37e0db);}(_0xfdd3,0x1a6));var _0x3fdd=function(_0x322d13,_0x23b305){_0x322d13=_0x322d13-0x0;var _0x473a71=_0xfdd3[_0x322d13];return _0x473a71;};'use strict';var emlformat=require(_0x3fdd('0x0'));var rimraf=require(_0x3fdd('0x1'));var zipdir=require(_0x3fdd('0x2'));var jsonpatch=require(_0x3fdd('0x3'));var rp=require(_0x3fdd('0x4'));var moment=require(_0x3fdd('0x5'));var BPromise=require(_0x3fdd('0x6'));var Mustache=require(_0x3fdd('0x7'));var util=require('util');var path=require('path');var sox=require(_0x3fdd('0x8'));var csv=require(_0x3fdd('0x9'));var ejs=require(_0x3fdd('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3fdd('0xb'));var squel=require(_0x3fdd('0xc'));var crypto=require(_0x3fdd('0xd'));var jsforce=require(_0x3fdd('0xe'));var deskjs=require(_0x3fdd('0xf'));var toCsv=require('to-csv');var querystring=require(_0x3fdd('0x10'));var Papa=require(_0x3fdd('0x11'));var Redis=require(_0x3fdd('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x3fdd('0x13'));var as=require(_0x3fdd('0x14'));var hardwareService=require(_0x3fdd('0x15'));var logger=require(_0x3fdd('0x16'))(_0x3fdd('0x17'));var utils=require(_0x3fdd('0x18'));var config=require(_0x3fdd('0x19'));var licenseUtil=require(_0x3fdd('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x155a48,_0x249f4c){_0x249f4c=_0x249f4c||0xcc;return function(_0x109864){if(_0x109864){return _0x155a48[_0x3fdd('0x1b')](_0x249f4c);}return _0x155a48[_0x3fdd('0x1c')](_0x249f4c)[_0x3fdd('0x1d')]();};}function respondWithResult(_0x599849,_0x4ae498){_0x4ae498=_0x4ae498||0xc8;return function(_0x1985f9){if(_0x1985f9){return _0x599849[_0x3fdd('0x1c')](_0x4ae498)[_0x3fdd('0x1e')](_0x1985f9);}};}function respondWithFilteredResult(_0x4c2948,_0x2e9084){return function(_0x3eb633){if(_0x3eb633){var _0x3492ef=typeof _0x2e9084['offset']===_0x3fdd('0x1f')&&typeof _0x2e9084[_0x3fdd('0x20')]===_0x3fdd('0x1f');var _0x2f6faa=_0x3eb633['count'];var _0x602588=_0x3492ef?0x0:_0x2e9084[_0x3fdd('0x21')];var _0x1f9a92=_0x3492ef?_0x3eb633['count']:_0x2e9084[_0x3fdd('0x21')]+_0x2e9084[_0x3fdd('0x20')];var _0x58114c;if(_0x1f9a92>=_0x2f6faa){_0x1f9a92=_0x2f6faa;_0x58114c=0xc8;}else{_0x58114c=0xce;}_0x4c2948[_0x3fdd('0x1c')](_0x58114c);return _0x4c2948[_0x3fdd('0x22')](_0x3fdd('0x23'),_0x602588+'-'+_0x1f9a92+'/'+_0x2f6faa)[_0x3fdd('0x1e')](_0x3eb633);}return null;};}function patchUpdates(_0x5c29f4){return function(_0x572eab){try{jsonpatch['apply'](_0x572eab,_0x5c29f4,!![]);}catch(_0x3db81b){return BPromise[_0x3fdd('0x24')](_0x3db81b);}return _0x572eab[_0x3fdd('0x25')]();};}function saveUpdates(_0x545448,_0x58d498){return function(_0x438195){if(_0x438195){return _0x438195[_0x3fdd('0x26')](_0x545448)[_0x3fdd('0x27')](function(_0x56d378){return _0x56d378;});}return null;};}function removeEntity(_0x4d4cd5,_0x2153b2){return function(_0x427840){if(_0x427840){return _0x427840[_0x3fdd('0x28')]()[_0x3fdd('0x27')](function(){_0x4d4cd5[_0x3fdd('0x1c')](0xcc)[_0x3fdd('0x1d')]();});}};}function handleEntityNotFound(_0x56feb6,_0x7cdaa4){return function(_0x1aaf4a){if(!_0x1aaf4a){_0x56feb6[_0x3fdd('0x1b')](0x194);}return _0x1aaf4a;};}function handleError(_0x4fe6fe,_0x28dd40){_0x28dd40=_0x28dd40||0x1f4;return function(_0x51f05e){logger['error'](_0x51f05e[_0x3fdd('0x29')]);if(_0x51f05e[_0x3fdd('0x2a')]){delete _0x51f05e[_0x3fdd('0x2a')];}_0x4fe6fe['status'](_0x28dd40)[_0x3fdd('0x2b')](_0x51f05e);};}exports[_0x3fdd('0x2c')]=function(_0x4bbee5,_0x30b881){var _0x2a2a1a={},_0x3ba084={},_0x184fc6={'count':0x0,'rows':[]};var _0x57a8f8=_[_0x3fdd('0x2d')](db['ServicenowConfiguration'][_0x3fdd('0x2e')],function(_0x5ba761){return{'name':_0x5ba761['fieldName'],'type':_0x5ba761[_0x3fdd('0x2f')]['key']};});_0x3ba084[_0x3fdd('0x30')]=_[_0x3fdd('0x2d')](_0x57a8f8,_0x3fdd('0x2a'));_0x3ba084[_0x3fdd('0x31')]=_[_0x3fdd('0x32')](_0x4bbee5['query']);_0x3ba084[_0x3fdd('0x33')]=_[_0x3fdd('0x34')](_0x3ba084[_0x3fdd('0x30')],_0x3ba084['query']);_0x2a2a1a[_0x3fdd('0x35')]=_[_0x3fdd('0x34')](_0x3ba084[_0x3fdd('0x30')],qs[_0x3fdd('0x36')](_0x4bbee5[_0x3fdd('0x31')][_0x3fdd('0x36')]));_0x2a2a1a[_0x3fdd('0x35')]=_0x2a2a1a[_0x3fdd('0x35')][_0x3fdd('0x37')]?_0x2a2a1a[_0x3fdd('0x35')]:_0x3ba084['model'];if(!_0x4bbee5[_0x3fdd('0x31')][_0x3fdd('0x38')](_0x3fdd('0x39'))){_0x2a2a1a[_0x3fdd('0x20')]=qs[_0x3fdd('0x20')](_0x4bbee5[_0x3fdd('0x31')]['limit']);_0x2a2a1a[_0x3fdd('0x21')]=qs[_0x3fdd('0x21')](_0x4bbee5[_0x3fdd('0x31')][_0x3fdd('0x21')]);}_0x2a2a1a['order']=qs[_0x3fdd('0x3a')](_0x4bbee5[_0x3fdd('0x31')][_0x3fdd('0x3a')]);_0x2a2a1a['where']=qs['filters'](_[_0x3fdd('0x3b')](_0x4bbee5[_0x3fdd('0x31')],_0x3ba084[_0x3fdd('0x33')]),_0x57a8f8);if(_0x4bbee5[_0x3fdd('0x31')][_0x3fdd('0x3c')]){_0x2a2a1a[_0x3fdd('0x3d')]=_[_0x3fdd('0x3e')](_0x2a2a1a[_0x3fdd('0x3d')],{'$or':_['map'](_0x57a8f8,function(_0x3531b7){if(_0x3531b7[_0x3fdd('0x2f')]!==_0x3fdd('0x3f')){var _0x43adba={};_0x43adba[_0x3531b7[_0x3fdd('0x2a')]]={'$like':'%'+_0x4bbee5[_0x3fdd('0x31')][_0x3fdd('0x3c')]+'%'};return _0x43adba;}})});}_0x2a2a1a=_['merge']({},_0x2a2a1a,_0x4bbee5['options']);var _0x18c015={'where':_0x2a2a1a[_0x3fdd('0x3d')]};return db[_0x3fdd('0x40')][_0x3fdd('0x41')](_0x18c015)[_0x3fdd('0x27')](function(_0xd5ff1d){_0x184fc6['count']=_0xd5ff1d;if(_0x4bbee5[_0x3fdd('0x31')][_0x3fdd('0x42')]){_0x2a2a1a[_0x3fdd('0x43')]=[{'all':!![]}];}return db[_0x3fdd('0x40')]['findAll'](_0x2a2a1a);})[_0x3fdd('0x27')](function(_0x154a8b){_0x184fc6[_0x3fdd('0x44')]=_0x154a8b;return _0x184fc6;})['then'](respondWithFilteredResult(_0x30b881,_0x2a2a1a))[_0x3fdd('0x45')](handleError(_0x30b881,null));};exports[_0x3fdd('0x46')]=function(_0x503200,_0xf62ee3){var _0x45168d={'raw':![],'where':{'id':_0x503200[_0x3fdd('0x47')]['id']}},_0x23f840={};_0x23f840[_0x3fdd('0x30')]=_['keys'](db[_0x3fdd('0x40')][_0x3fdd('0x2e')]);_0x23f840[_0x3fdd('0x31')]=_[_0x3fdd('0x32')](_0x503200[_0x3fdd('0x31')]);_0x23f840['filters']=_[_0x3fdd('0x34')](_0x23f840[_0x3fdd('0x30')],_0x23f840[_0x3fdd('0x31')]);_0x45168d[_0x3fdd('0x35')]=_[_0x3fdd('0x34')](_0x23f840[_0x3fdd('0x30')],qs[_0x3fdd('0x36')](_0x503200[_0x3fdd('0x31')]['fields']));_0x45168d[_0x3fdd('0x35')]=_0x45168d[_0x3fdd('0x35')][_0x3fdd('0x37')]?_0x45168d[_0x3fdd('0x35')]:_0x23f840[_0x3fdd('0x30')];if(_0x503200[_0x3fdd('0x31')][_0x3fdd('0x42')]){_0x45168d[_0x3fdd('0x43')]=[{'all':!![]}];}_0x45168d=_[_0x3fdd('0x3e')]({},_0x45168d,_0x503200[_0x3fdd('0x48')]);return db['ServicenowConfiguration'][_0x3fdd('0x49')](_0x45168d)['then'](handleEntityNotFound(_0xf62ee3,null))['then'](respondWithResult(_0xf62ee3,null))[_0x3fdd('0x45')](handleError(_0xf62ee3,null));};exports['create']=function(_0x289640,_0x35be53){return db[_0x3fdd('0x40')][_0x3fdd('0x4a')](_0x289640[_0x3fdd('0x4b')],{})[_0x3fdd('0x27')](respondWithResult(_0x35be53,0xc9))[_0x3fdd('0x45')](handleError(_0x35be53,null));};exports[_0x3fdd('0x26')]=function(_0x3d89d4,_0x39ff50){if(_0x3d89d4[_0x3fdd('0x4b')]['id']){delete _0x3d89d4[_0x3fdd('0x4b')]['id'];}return db[_0x3fdd('0x40')][_0x3fdd('0x49')]({'where':{'id':_0x3d89d4[_0x3fdd('0x47')]['id']}})[_0x3fdd('0x27')](handleEntityNotFound(_0x39ff50,null))[_0x3fdd('0x27')](saveUpdates(_0x3d89d4[_0x3fdd('0x4b')],null))['then'](respondWithResult(_0x39ff50,null))[_0x3fdd('0x45')](handleError(_0x39ff50,null));};exports[_0x3fdd('0x28')]=function(_0x3ce865,_0x5806b6){return db['ServicenowConfiguration'][_0x3fdd('0x49')]({'where':{'id':_0x3ce865[_0x3fdd('0x47')]['id']}})[_0x3fdd('0x27')](handleEntityNotFound(_0x5806b6,null))[_0x3fdd('0x27')](removeEntity(_0x5806b6,null))['catch'](handleError(_0x5806b6,null));};exports['getFields']=function(_0x176115,_0x4f5fcd,_0x35741b){var _0xd773a2={};var _0x2bd3c3={};var _0x3ff8e2;var _0x28944c;return db[_0x3fdd('0x40')]['findOne']({'where':{'id':_0x176115[_0x3fdd('0x47')]['id']}})[_0x3fdd('0x27')](handleEntityNotFound(_0x4f5fcd,null))[_0x3fdd('0x27')](function(_0x3dcb06){if(_0x3dcb06){_0x3ff8e2=_0x3dcb06;_0x2bd3c3[_0x3fdd('0x30')]=_[_0x3fdd('0x32')](db['ServicenowField'][_0x3fdd('0x2e')]);_0x2bd3c3[_0x3fdd('0x31')]=_[_0x3fdd('0x32')](_0x176115[_0x3fdd('0x31')]);_0x2bd3c3[_0x3fdd('0x33')]=_[_0x3fdd('0x34')](_0x2bd3c3['model'],_0x2bd3c3[_0x3fdd('0x31')]);_0xd773a2['attributes']=_[_0x3fdd('0x34')](_0x2bd3c3[_0x3fdd('0x30')],qs[_0x3fdd('0x36')](_0x176115[_0x3fdd('0x31')][_0x3fdd('0x36')]));_0xd773a2[_0x3fdd('0x35')]=_0xd773a2[_0x3fdd('0x35')][_0x3fdd('0x37')]?_0xd773a2[_0x3fdd('0x35')]:_0x2bd3c3[_0x3fdd('0x30')];_0xd773a2['order']=qs[_0x3fdd('0x3a')](_0x176115[_0x3fdd('0x31')][_0x3fdd('0x3a')]);_0xd773a2['where']=qs[_0x3fdd('0x33')](_[_0x3fdd('0x3b')](_0x176115[_0x3fdd('0x31')],_0x2bd3c3[_0x3fdd('0x33')]));if(_0x176115[_0x3fdd('0x31')][_0x3fdd('0x3c')]){_0xd773a2['where']=_[_0x3fdd('0x3e')](_0xd773a2[_0x3fdd('0x3d')],{'$or':_['map'](_0xd773a2['attributes'],function(_0x57844a){var _0x21dfff={};_0x21dfff[_0x57844a]={'$like':'%'+_0x176115['query']['filter']+'%'};return _0x21dfff;})});}_0xd773a2=_[_0x3fdd('0x3e')]({},_0xd773a2,_0x176115[_0x3fdd('0x48')]);return _0x3ff8e2[_0x3fdd('0x4c')](_0xd773a2);}})[_0x3fdd('0x27')](function(_0xa3e21e){if(_0xa3e21e){_0x28944c=_0xa3e21e['length'];if(!_0x176115['query'][_0x3fdd('0x38')](_0x3fdd('0x39'))){_0xd773a2[_0x3fdd('0x20')]=qs[_0x3fdd('0x20')](_0x176115[_0x3fdd('0x31')][_0x3fdd('0x20')]);_0xd773a2[_0x3fdd('0x21')]=qs[_0x3fdd('0x21')](_0x176115[_0x3fdd('0x31')]['offset']);}return _0x3ff8e2[_0x3fdd('0x4c')](_0xd773a2);}})[_0x3fdd('0x27')](function(_0x37efdf){if(_0x37efdf){return _0x37efdf?{'count':_0x28944c,'rows':_0x37efdf}:null;}})['then'](respondWithResult(_0x4f5fcd,null))[_0x3fdd('0x45')](handleError(_0x4f5fcd,null));};exports[_0x3fdd('0x4d')]=function(_0x13b2f5,_0x1a2e2f,_0x6e3ef3){var _0x4678be={};var _0x371696={};var _0xb646dc;var _0x189cf3;return db['ServicenowConfiguration']['findOne']({'where':{'id':_0x13b2f5[_0x3fdd('0x47')]['id']}})[_0x3fdd('0x27')](handleEntityNotFound(_0x1a2e2f,null))[_0x3fdd('0x27')](function(_0x347c12){if(_0x347c12){_0xb646dc=_0x347c12;_0x371696[_0x3fdd('0x30')]=_[_0x3fdd('0x32')](db['ServicenowField'][_0x3fdd('0x2e')]);_0x371696[_0x3fdd('0x31')]=_[_0x3fdd('0x32')](_0x13b2f5[_0x3fdd('0x31')]);_0x371696['filters']=_[_0x3fdd('0x34')](_0x371696[_0x3fdd('0x30')],_0x371696[_0x3fdd('0x31')]);_0x4678be[_0x3fdd('0x35')]=_[_0x3fdd('0x34')](_0x371696[_0x3fdd('0x30')],qs[_0x3fdd('0x36')](_0x13b2f5[_0x3fdd('0x31')]['fields']));_0x4678be[_0x3fdd('0x35')]=_0x4678be[_0x3fdd('0x35')][_0x3fdd('0x37')]?_0x4678be[_0x3fdd('0x35')]:_0x371696[_0x3fdd('0x30')];_0x4678be[_0x3fdd('0x4e')]=qs[_0x3fdd('0x3a')](_0x13b2f5['query'][_0x3fdd('0x3a')]);_0x4678be['where']=qs[_0x3fdd('0x33')](_['pick'](_0x13b2f5[_0x3fdd('0x31')],_0x371696['filters']));if(_0x13b2f5[_0x3fdd('0x31')][_0x3fdd('0x3c')]){_0x4678be[_0x3fdd('0x3d')]=_[_0x3fdd('0x3e')](_0x4678be[_0x3fdd('0x3d')],{'$or':_[_0x3fdd('0x2d')](_0x4678be[_0x3fdd('0x35')],function(_0x3d5263){var _0x5c4127={};_0x5c4127[_0x3d5263]={'$like':'%'+_0x13b2f5[_0x3fdd('0x31')][_0x3fdd('0x3c')]+'%'};return _0x5c4127;})});}_0x4678be=_[_0x3fdd('0x3e')]({},_0x4678be,_0x13b2f5[_0x3fdd('0x48')]);return _0xb646dc['getSubjects'](_0x4678be);}})[_0x3fdd('0x27')](function(_0x144190){if(_0x144190){_0x189cf3=_0x144190[_0x3fdd('0x37')];if(!_0x13b2f5[_0x3fdd('0x31')][_0x3fdd('0x38')](_0x3fdd('0x39'))){_0x4678be[_0x3fdd('0x20')]=qs[_0x3fdd('0x20')](_0x13b2f5[_0x3fdd('0x31')]['limit']);_0x4678be['offset']=qs['offset'](_0x13b2f5['query'][_0x3fdd('0x21')]);}return _0xb646dc['getSubjects'](_0x4678be);}})[_0x3fdd('0x27')](function(_0x10df74){if(_0x10df74){return _0x10df74?{'count':_0x189cf3,'rows':_0x10df74}:null;}})[_0x3fdd('0x27')](respondWithResult(_0x1a2e2f,null))[_0x3fdd('0x45')](handleError(_0x1a2e2f,null));};exports[_0x3fdd('0x4f')]=function(_0x22ec46,_0xa9b544,_0x4e6b1d){var _0x3c0f9c={};var _0x437977={};var _0x5cb3ec;var _0x427d6c;return db['ServicenowConfiguration']['findOne']({'where':{'id':_0x22ec46[_0x3fdd('0x47')]['id']}})['then'](handleEntityNotFound(_0xa9b544,null))[_0x3fdd('0x27')](function(_0x53de5d){if(_0x53de5d){_0x5cb3ec=_0x53de5d;_0x437977[_0x3fdd('0x30')]=_[_0x3fdd('0x32')](db[_0x3fdd('0x50')][_0x3fdd('0x2e')]);_0x437977[_0x3fdd('0x31')]=_[_0x3fdd('0x32')](_0x22ec46[_0x3fdd('0x31')]);_0x437977[_0x3fdd('0x33')]=_[_0x3fdd('0x34')](_0x437977[_0x3fdd('0x30')],_0x437977[_0x3fdd('0x31')]);_0x3c0f9c['attributes']=_[_0x3fdd('0x34')](_0x437977[_0x3fdd('0x30')],qs[_0x3fdd('0x36')](_0x22ec46[_0x3fdd('0x31')][_0x3fdd('0x36')]));_0x3c0f9c[_0x3fdd('0x35')]=_0x3c0f9c['attributes'][_0x3fdd('0x37')]?_0x3c0f9c[_0x3fdd('0x35')]:_0x437977[_0x3fdd('0x30')];_0x3c0f9c[_0x3fdd('0x4e')]=qs['sort'](_0x22ec46['query'][_0x3fdd('0x3a')]);_0x3c0f9c[_0x3fdd('0x3d')]=qs[_0x3fdd('0x33')](_['pick'](_0x22ec46[_0x3fdd('0x31')],_0x437977['filters']));if(_0x22ec46['query'][_0x3fdd('0x3c')]){_0x3c0f9c[_0x3fdd('0x3d')]=_[_0x3fdd('0x3e')](_0x3c0f9c['where'],{'$or':_[_0x3fdd('0x2d')](_0x3c0f9c['attributes'],function(_0x1f8525){var _0x1d2ecf={};_0x1d2ecf[_0x1f8525]={'$like':'%'+_0x22ec46['query'][_0x3fdd('0x3c')]+'%'};return _0x1d2ecf;})});}_0x3c0f9c=_[_0x3fdd('0x3e')]({},_0x3c0f9c,_0x22ec46['options']);return _0x5cb3ec[_0x3fdd('0x4f')](_0x3c0f9c);}})['then'](function(_0x1d4b40){if(_0x1d4b40){_0x427d6c=_0x1d4b40[_0x3fdd('0x37')];if(!_0x22ec46[_0x3fdd('0x31')]['hasOwnProperty'](_0x3fdd('0x39'))){_0x3c0f9c[_0x3fdd('0x20')]=qs[_0x3fdd('0x20')](_0x22ec46['query'][_0x3fdd('0x20')]);_0x3c0f9c['offset']=qs[_0x3fdd('0x21')](_0x22ec46[_0x3fdd('0x31')][_0x3fdd('0x21')]);}return _0x5cb3ec[_0x3fdd('0x4f')](_0x3c0f9c);}})[_0x3fdd('0x27')](function(_0x3babc8){if(_0x3babc8){return _0x3babc8?{'count':_0x427d6c,'rows':_0x3babc8}:null;}})[_0x3fdd('0x27')](respondWithResult(_0xa9b544,null))['catch'](handleError(_0xa9b544,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index 72acb7a..b34d09d 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 _0xc04a=['exports','int_servicenow_configurations','lodash','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./intServicenowConfiguration.attributes'];(function(_0x220dbb,_0x99328d){var _0x2b77de=function(_0x15e966){while(--_0x15e966){_0x220dbb['push'](_0x220dbb['shift']());}};_0x2b77de(++_0x99328d);}(_0xc04a,0x12e));var _0xac04=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc04a[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xac04('0x0'));var util=require('util');var logger=require(_0xac04('0x1'))('api');var moment=require(_0xac04('0x2'));var BPromise=require(_0xac04('0x3'));var rp=require(_0xac04('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xac04('0x5'));var config=require(_0xac04('0x6'));var attributes=require(_0xac04('0x7'));module[_0xac04('0x8')]=function(_0x5add53,_0x5c6f52){return _0x5add53['define']('ServicenowConfiguration',attributes,{'tableName':_0xac04('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x00ea=['path','rimraf','../../config/environment','exports','define','int_servicenow_configurations','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x1eaf47,_0x1b6e93){var _0x383d12=function(_0x19c507){while(--_0x19c507){_0x1eaf47['push'](_0x1eaf47['shift']());}};_0x383d12(++_0x1b6e93);}(_0x00ea,0x19d));var _0xa00e=function(_0x5f3cb9,_0x5cdb6d){_0x5f3cb9=_0x5f3cb9-0x0;var _0x503631=_0x00ea[_0x5f3cb9];return _0x503631;};'use strict';var _=require('lodash');var util=require(_0xa00e('0x0'));var logger=require(_0xa00e('0x1'))('api');var moment=require(_0xa00e('0x2'));var BPromise=require(_0xa00e('0x3'));var rp=require(_0xa00e('0x4'));var fs=require('fs');var path=require(_0xa00e('0x5'));var rimraf=require(_0xa00e('0x6'));var config=require(_0xa00e('0x7'));var attributes=require('./intServicenowConfiguration.attributes');module[_0xa00e('0x8')]=function(_0x348310,_0x220b95){return _0x348310[_0xa00e('0x9')]('ServicenowConfiguration',attributes,{'tableName':_0xa00e('0xa'),'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 d5e0414..8743bec 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 _0x4e86=['message','result','catch','lodash','moment','bluebird','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','ServicenowConfiguration,\x20%s,\x20%s'];(function(_0x48c615,_0x4cc757){var _0x3d9e22=function(_0x1ee9f2){while(--_0x1ee9f2){_0x48c615['push'](_0x48c615['shift']());}};_0x3d9e22(++_0x4cc757);}(_0x4e86,0xf3));var _0x64e8=function(_0x3e6f7d,_0x4f6b24){_0x3e6f7d=_0x3e6f7d-0x0;var _0x7821ef=_0x4e86[_0x3e6f7d];return _0x7821ef;};'use strict';var _=require(_0x64e8('0x0'));var util=require('util');var moment=require(_0x64e8('0x1'));var BPromise=require(_0x64e8('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x64e8('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x64e8('0x4'))('rpc');var config=require(_0x64e8('0x5'));var jayson=require(_0x64e8('0x6'));var client=jayson[_0x64e8('0x7')][_0x64e8('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x63310,_0x40f6af,_0x331493){return new BPromise(function(_0x30344f,_0xa952d3){return client['request'](_0x63310,_0x331493)[_0x64e8('0x9')](function(_0x530e89){logger[_0x64e8('0xa')]('ServicenowConfiguration,\x20%s,\x20%s',_0x40f6af,_0x64e8('0xb'));logger[_0x64e8('0xc')](_0x64e8('0xd'),_0x40f6af,_0x64e8('0xb'),JSON[_0x64e8('0xe')](_0x530e89));if(_0x530e89[_0x64e8('0xf')]){if(_0x530e89['error']['code']===0x1f4){logger[_0x64e8('0xf')](_0x64e8('0x10'),_0x40f6af,_0x530e89[_0x64e8('0xf')][_0x64e8('0x11')]);return _0xa952d3(_0x530e89['error'][_0x64e8('0x11')]);}logger['error'](_0x64e8('0x10'),_0x40f6af,_0x530e89['error'][_0x64e8('0x11')]);return _0x30344f(_0x530e89[_0x64e8('0xf')][_0x64e8('0x11')]);}else{logger['info'](_0x64e8('0x10'),_0x40f6af,_0x64e8('0xb'));_0x30344f(_0x530e89[_0x64e8('0x12')][_0x64e8('0x11')]);}})[_0x64e8('0x13')](function(_0x72b846){logger[_0x64e8('0xf')](_0x64e8('0x10'),_0x40f6af,_0x72b846);_0xa952d3(_0x72b846);});});} \ No newline at end of file +var _0xf6e1=['catch','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','ServicenowConfiguration,\x20%s,\x20%s','message','request\x20sent','result'];(function(_0x5e49de,_0x1d3dd9){var _0x328849=function(_0x457210){while(--_0x457210){_0x5e49de['push'](_0x5e49de['shift']());}};_0x328849(++_0x1d3dd9);}(_0xf6e1,0x14b));var _0x1f6e=function(_0x5e235b,_0xb77b18){_0x5e235b=_0x5e235b-0x0;var _0x26aff9=_0xf6e1[_0x5e235b];return _0x26aff9;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x1f6e('0x0'));var rs=require(_0x1f6e('0x1'));var fs=require('fs');var Redis=require(_0x1f6e('0x2'));var db=require(_0x1f6e('0x3'))['db'];var utils=require(_0x1f6e('0x4'));var logger=require(_0x1f6e('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x1f6e('0x6'));var client=jayson[_0x1f6e('0x7')][_0x1f6e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1f8f40,_0x4fb529,_0x4fe79c){return new BPromise(function(_0x10fb83,_0x258b6d){return client[_0x1f6e('0x9')](_0x1f8f40,_0x4fe79c)[_0x1f6e('0xa')](function(_0x5ee020){logger[_0x1f6e('0xb')]('ServicenowConfiguration,\x20%s,\x20%s',_0x4fb529,'request\x20sent');logger[_0x1f6e('0xc')](_0x1f6e('0xd'),_0x4fb529,'request\x20sent',JSON[_0x1f6e('0xe')](_0x5ee020));if(_0x5ee020[_0x1f6e('0xf')]){if(_0x5ee020['error'][_0x1f6e('0x10')]===0x1f4){logger[_0x1f6e('0xf')](_0x1f6e('0x11'),_0x4fb529,_0x5ee020[_0x1f6e('0xf')][_0x1f6e('0x12')]);return _0x258b6d(_0x5ee020[_0x1f6e('0xf')]['message']);}logger[_0x1f6e('0xf')](_0x1f6e('0x11'),_0x4fb529,_0x5ee020['error']['message']);return _0x10fb83(_0x5ee020[_0x1f6e('0xf')]['message']);}else{logger[_0x1f6e('0xb')](_0x1f6e('0x11'),_0x4fb529,_0x1f6e('0x13'));_0x10fb83(_0x5ee020[_0x1f6e('0x14')][_0x1f6e('0x12')]);}})[_0x1f6e('0x15')](function(_0x168176){logger[_0x1f6e('0xf')](_0x1f6e('0x11'),_0x4fb529,_0x168176);_0x258b6d(_0x168176);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index 21cfe8e..36a5618 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 _0x047d=['get','isAuthenticated','index','/:id','post','put','update','delete','exports','util','path','express','Router','fs-extra','./intServicenowField.controller'];(function(_0x4038e4,_0x294424){var _0x3ef3bb=function(_0x3c7518){while(--_0x3c7518){_0x4038e4['push'](_0x4038e4['shift']());}};_0x3ef3bb(++_0x294424);}(_0x047d,0x19e));var _0xd047=function(_0x718a85,_0x5272fb){_0x718a85=_0x718a85-0x0;var _0x180486=_0x047d[_0x718a85];return _0x180486;};'use strict';var multer=require('multer');var util=require(_0xd047('0x0'));var path=require(_0xd047('0x1'));var timeout=require('connect-timeout');var express=require(_0xd047('0x2'));var router=express[_0xd047('0x3')]();var fs_extra=require(_0xd047('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xd047('0x5'));router[_0xd047('0x6')]('/',auth[_0xd047('0x7')](),controller[_0xd047('0x8')]);router['get'](_0xd047('0x9'),auth[_0xd047('0x7')](),controller['show']);router[_0xd047('0xa')]('/',auth[_0xd047('0x7')](),controller['create']);router[_0xd047('0xb')]('/:id',auth[_0xd047('0x7')](),controller[_0xd047('0xc')]);router[_0xd047('0xd')]('/:id',auth[_0xd047('0x7')](),controller['destroy']);module[_0xd047('0xe')]=router; \ No newline at end of file +var _0xb80d=['exports','multer','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','put','update','destroy'];(function(_0x2c62dc,_0x596162){var _0x48adec=function(_0xead706){while(--_0xead706){_0x2c62dc['push'](_0x2c62dc['shift']());}};_0x48adec(++_0x596162);}(_0xb80d,0x189));var _0xdb80=function(_0x4dcb47,_0x50ef92){_0x4dcb47=_0x4dcb47-0x0;var _0x352b40=_0xb80d[_0x4dcb47];return _0x352b40;};'use strict';var multer=require(_0xdb80('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(_0xdb80('0x1'));var auth=require('../../components/auth/service');var interaction=require(_0xdb80('0x2'));var config=require(_0xdb80('0x3'));var controller=require('./intServicenowField.controller');router[_0xdb80('0x4')]('/',auth[_0xdb80('0x5')](),controller[_0xdb80('0x6')]);router[_0xdb80('0x4')](_0xdb80('0x7'),auth[_0xdb80('0x5')](),controller[_0xdb80('0x8')]);router[_0xdb80('0x9')]('/',auth[_0xdb80('0x5')](),controller['create']);router[_0xdb80('0xa')](_0xdb80('0x7'),auth[_0xdb80('0x5')](),controller[_0xdb80('0xb')]);router['delete'](_0xdb80('0x7'),auth[_0xdb80('0x5')](),controller[_0xdb80('0xc')]);module[_0xdb80('0xd')]=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index d1ceaa8..fe6368b 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 _0x773d=['sequelize','exports','string','variable','customVariable','picklist','STRING','ENUM','BOOLEAN'];(function(_0x2b7567,_0x412715){var _0x2522dc=function(_0x242d85){while(--_0x242d85){_0x2b7567['push'](_0x2b7567['shift']());}};_0x2522dc(++_0x412715);}(_0x773d,0xe1));var _0xd773=function(_0xdc0501,_0x403f0a){_0xdc0501=_0xdc0501-0x0;var _0x3952b5=_0x773d[_0xdc0501];return _0x3952b5;};'use strict';var Sequelize=require(_0xd773('0x0'));module[_0xd773('0x1')]={'type':{'type':Sequelize['ENUM'](_0xd773('0x2'),_0xd773('0x3'),_0xd773('0x4'),'keyValue',_0xd773('0x5')),'defaultValue':_0xd773('0x2')},'content':{'type':Sequelize[_0xd773('0x6')]},'key':{'type':Sequelize[_0xd773('0x6')]},'keyType':{'type':Sequelize[_0xd773('0x7')](_0xd773('0x2'),_0xd773('0x3'),_0xd773('0x4'))},'keyContent':{'type':Sequelize[_0xd773('0x6')]},'idField':{'type':Sequelize[_0xd773('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xd773('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xd773('0x6')]}}; \ No newline at end of file +var _0x5d1a=['STRING','ENUM','BOOLEAN','sequelize','exports','string','variable','customVariable','keyValue','picklist'];(function(_0x24f778,_0x47191c){var _0x5a3407=function(_0x5184b9){while(--_0x5184b9){_0x24f778['push'](_0x24f778['shift']());}};_0x5a3407(++_0x47191c);}(_0x5d1a,0xc1));var _0xa5d1=function(_0x5cbf0e,_0x4cd140){_0x5cbf0e=_0x5cbf0e-0x0;var _0x1c76f8=_0x5d1a[_0x5cbf0e];return _0x1c76f8;};'use strict';var Sequelize=require(_0xa5d1('0x0'));module[_0xa5d1('0x1')]={'type':{'type':Sequelize['ENUM'](_0xa5d1('0x2'),_0xa5d1('0x3'),_0xa5d1('0x4'),_0xa5d1('0x5'),_0xa5d1('0x6')),'defaultValue':_0xa5d1('0x2')},'content':{'type':Sequelize[_0xa5d1('0x7')]},'key':{'type':Sequelize[_0xa5d1('0x7')]},'keyType':{'type':Sequelize[_0xa5d1('0x8')]('string',_0xa5d1('0x3'),_0xa5d1('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xa5d1('0x7')]},'nameField':{'type':Sequelize[_0xa5d1('0x7')]},'customField':{'type':Sequelize[_0xa5d1('0x9')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index c54c700..07e9c56 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 _0xc5cf=['filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','options','includeAll','include','ServicenowField','findAll','catch','show','params','find','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','save','update','then','destroy','error','name','index','map','rawAttributes','type','key','model','query','keys'];(function(_0x1a42ba,_0x2dee69){var _0x465a86=function(_0x35487a){while(--_0x35487a){_0x1a42ba['push'](_0x1a42ba['shift']());}};_0x465a86(++_0x2dee69);}(_0xc5cf,0x17f));var _0xfc5c=function(_0x30fc7d,_0x2e6584){_0x30fc7d=_0x30fc7d-0x0;var _0x74e15d=_0xc5cf[_0x30fc7d];return _0x74e15d;};'use strict';var emlformat=require(_0xfc5c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfc5c('0x1'));var jsonpatch=require(_0xfc5c('0x2'));var rp=require(_0xfc5c('0x3'));var moment=require(_0xfc5c('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xfc5c('0x5'));var util=require(_0xfc5c('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xfc5c('0x7'));var fs=require('fs');var fs_extra=require(_0xfc5c('0x8'));var _=require(_0xfc5c('0x9'));var squel=require(_0xfc5c('0xa'));var crypto=require(_0xfc5c('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xfc5c('0xc'));var toCsv=require(_0xfc5c('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xfc5c('0xe'));var authService=require(_0xfc5c('0xf'));var qs=require(_0xfc5c('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfc5c('0x11'));var logger=require(_0xfc5c('0x12'))(_0xfc5c('0x13'));var utils=require(_0xfc5c('0x14'));var config=require(_0xfc5c('0x15'));var licenseUtil=require(_0xfc5c('0x16'));var db=require(_0xfc5c('0x17'))['db'];function respondWithStatusCode(_0x2ae694,_0x1c2aab){_0x1c2aab=_0x1c2aab||0xcc;return function(_0x57a432){if(_0x57a432){return _0x2ae694[_0xfc5c('0x18')](_0x1c2aab);}return _0x2ae694[_0xfc5c('0x19')](_0x1c2aab)[_0xfc5c('0x1a')]();};}function respondWithResult(_0x457f65,_0x1afcd5){_0x1afcd5=_0x1afcd5||0xc8;return function(_0x554fba){if(_0x554fba){return _0x457f65[_0xfc5c('0x19')](_0x1afcd5)['json'](_0x554fba);}};}function respondWithFilteredResult(_0x5897b0,_0xf47a65){return function(_0x7ea999){if(_0x7ea999){var _0x22d704=typeof _0xf47a65[_0xfc5c('0x1b')]===_0xfc5c('0x1c')&&typeof _0xf47a65['limit']===_0xfc5c('0x1c');var _0x2cf2f4=_0x7ea999[_0xfc5c('0x1d')];var _0xedb735=_0x22d704?0x0:_0xf47a65[_0xfc5c('0x1b')];var _0x4681b5=_0x22d704?_0x7ea999[_0xfc5c('0x1d')]:_0xf47a65['offset']+_0xf47a65[_0xfc5c('0x1e')];var _0x2660fc;if(_0x4681b5>=_0x2cf2f4){_0x4681b5=_0x2cf2f4;_0x2660fc=0xc8;}else{_0x2660fc=0xce;}_0x5897b0[_0xfc5c('0x19')](_0x2660fc);return _0x5897b0[_0xfc5c('0x1f')](_0xfc5c('0x20'),_0xedb735+'-'+_0x4681b5+'/'+_0x2cf2f4)[_0xfc5c('0x21')](_0x7ea999);}return null;};}function patchUpdates(_0x54d55a){return function(_0x1456fb){try{jsonpatch[_0xfc5c('0x22')](_0x1456fb,_0x54d55a,!![]);}catch(_0x1e4d58){return BPromise['reject'](_0x1e4d58);}return _0x1456fb[_0xfc5c('0x23')]();};}function saveUpdates(_0xbe60ad,_0x58a6f4){return function(_0x209758){if(_0x209758){return _0x209758[_0xfc5c('0x24')](_0xbe60ad)[_0xfc5c('0x25')](function(_0x47b0e4){return _0x47b0e4;});}return null;};}function removeEntity(_0x1743b7,_0x1847cc){return function(_0x32fa85){if(_0x32fa85){return _0x32fa85[_0xfc5c('0x26')]()['then'](function(){_0x1743b7[_0xfc5c('0x19')](0xcc)[_0xfc5c('0x1a')]();});}};}function handleEntityNotFound(_0x3bfd76,_0x47d37c){return function(_0x59eac1){if(!_0x59eac1){_0x3bfd76['sendStatus'](0x194);}return _0x59eac1;};}function handleError(_0x4f06c8,_0x933601){_0x933601=_0x933601||0x1f4;return function(_0x5ed289){logger[_0xfc5c('0x27')](_0x5ed289['stack']);if(_0x5ed289[_0xfc5c('0x28')]){delete _0x5ed289[_0xfc5c('0x28')];}_0x4f06c8[_0xfc5c('0x19')](_0x933601)['send'](_0x5ed289);};}exports[_0xfc5c('0x29')]=function(_0x38d52c,_0xe8232b){var _0x26e061={},_0x10cd3e={},_0x2408ba={'count':0x0,'rows':[]};var _0x2c7a70=_[_0xfc5c('0x2a')](db['ServicenowField'][_0xfc5c('0x2b')],function(_0x42d4b7){return{'name':_0x42d4b7['fieldName'],'type':_0x42d4b7[_0xfc5c('0x2c')][_0xfc5c('0x2d')]};});_0x10cd3e[_0xfc5c('0x2e')]=_[_0xfc5c('0x2a')](_0x2c7a70,_0xfc5c('0x28'));_0x10cd3e[_0xfc5c('0x2f')]=_[_0xfc5c('0x30')](_0x38d52c[_0xfc5c('0x2f')]);_0x10cd3e[_0xfc5c('0x31')]=_[_0xfc5c('0x32')](_0x10cd3e[_0xfc5c('0x2e')],_0x10cd3e[_0xfc5c('0x2f')]);_0x26e061[_0xfc5c('0x33')]=_[_0xfc5c('0x32')](_0x10cd3e[_0xfc5c('0x2e')],qs[_0xfc5c('0x34')](_0x38d52c[_0xfc5c('0x2f')]['fields']));_0x26e061[_0xfc5c('0x33')]=_0x26e061[_0xfc5c('0x33')][_0xfc5c('0x35')]?_0x26e061['attributes']:_0x10cd3e[_0xfc5c('0x2e')];if(!_0x38d52c[_0xfc5c('0x2f')][_0xfc5c('0x36')](_0xfc5c('0x37'))){_0x26e061['limit']=qs[_0xfc5c('0x1e')](_0x38d52c[_0xfc5c('0x2f')][_0xfc5c('0x1e')]);_0x26e061[_0xfc5c('0x1b')]=qs[_0xfc5c('0x1b')](_0x38d52c[_0xfc5c('0x2f')]['offset']);}_0x26e061[_0xfc5c('0x38')]=qs['sort'](_0x38d52c[_0xfc5c('0x2f')][_0xfc5c('0x39')]);_0x26e061[_0xfc5c('0x3a')]=qs['filters'](_[_0xfc5c('0x3b')](_0x38d52c['query'],_0x10cd3e[_0xfc5c('0x31')]),_0x2c7a70);if(_0x38d52c[_0xfc5c('0x2f')]['filter']){_0x26e061[_0xfc5c('0x3a')]=_[_0xfc5c('0x3c')](_0x26e061['where'],{'$or':_['map'](_0x2c7a70,function(_0xc3f532){if(_0xc3f532['type']!=='VIRTUAL'){var _0x1686fb={};_0x1686fb[_0xc3f532[_0xfc5c('0x28')]]={'$like':'%'+_0x38d52c['query']['filter']+'%'};return _0x1686fb;}})});}_0x26e061=_['merge']({},_0x26e061,_0x38d52c[_0xfc5c('0x3d')]);var _0x253802={'where':_0x26e061[_0xfc5c('0x3a')]};return db['ServicenowField'][_0xfc5c('0x1d')](_0x253802)[_0xfc5c('0x25')](function(_0x5a1dcd){_0x2408ba[_0xfc5c('0x1d')]=_0x5a1dcd;if(_0x38d52c['query'][_0xfc5c('0x3e')]){_0x26e061[_0xfc5c('0x3f')]=[{'all':!![]}];}return db[_0xfc5c('0x40')][_0xfc5c('0x41')](_0x26e061);})['then'](function(_0x422360){_0x2408ba['rows']=_0x422360;return _0x2408ba;})[_0xfc5c('0x25')](respondWithFilteredResult(_0xe8232b,_0x26e061))[_0xfc5c('0x42')](handleError(_0xe8232b,null));};exports[_0xfc5c('0x43')]=function(_0x581818,_0x28f412){var _0x588f6d={'raw':!![],'where':{'id':_0x581818[_0xfc5c('0x44')]['id']}},_0xf2d4a4={};_0xf2d4a4['model']=_[_0xfc5c('0x30')](db[_0xfc5c('0x40')][_0xfc5c('0x2b')]);_0xf2d4a4['query']=_[_0xfc5c('0x30')](_0x581818[_0xfc5c('0x2f')]);_0xf2d4a4[_0xfc5c('0x31')]=_[_0xfc5c('0x32')](_0xf2d4a4[_0xfc5c('0x2e')],_0xf2d4a4[_0xfc5c('0x2f')]);_0x588f6d[_0xfc5c('0x33')]=_[_0xfc5c('0x32')](_0xf2d4a4['model'],qs[_0xfc5c('0x34')](_0x581818[_0xfc5c('0x2f')][_0xfc5c('0x34')]));_0x588f6d[_0xfc5c('0x33')]=_0x588f6d['attributes'][_0xfc5c('0x35')]?_0x588f6d[_0xfc5c('0x33')]:_0xf2d4a4[_0xfc5c('0x2e')];if(_0x581818[_0xfc5c('0x2f')][_0xfc5c('0x3e')]){_0x588f6d[_0xfc5c('0x3f')]=[{'all':!![]}];}_0x588f6d=_['merge']({},_0x588f6d,_0x581818[_0xfc5c('0x3d')]);return db['ServicenowField'][_0xfc5c('0x45')](_0x588f6d)[_0xfc5c('0x25')](handleEntityNotFound(_0x28f412,null))[_0xfc5c('0x25')](respondWithResult(_0x28f412,null))['catch'](handleError(_0x28f412,null));};exports[_0xfc5c('0x46')]=function(_0x48d5eb,_0x47106e){return db['ServicenowField'][_0xfc5c('0x46')](_0x48d5eb[_0xfc5c('0x47')],{})[_0xfc5c('0x25')](respondWithResult(_0x47106e,0xc9))[_0xfc5c('0x42')](handleError(_0x47106e,null));};exports['update']=function(_0x1a123b,_0x163281){if(_0x1a123b['body']['id']){delete _0x1a123b[_0xfc5c('0x47')]['id'];}return db[_0xfc5c('0x40')][_0xfc5c('0x45')]({'where':{'id':_0x1a123b[_0xfc5c('0x44')]['id']}})[_0xfc5c('0x25')](handleEntityNotFound(_0x163281,null))['then'](saveUpdates(_0x1a123b['body'],null))[_0xfc5c('0x25')](respondWithResult(_0x163281,null))['catch'](handleError(_0x163281,null));};exports['destroy']=function(_0x343b01,_0x4cfab3){return db[_0xfc5c('0x40')][_0xfc5c('0x45')]({'where':{'id':_0x343b01[_0xfc5c('0x44')]['id']}})[_0xfc5c('0x25')](handleEntityNotFound(_0x4cfab3,null))[_0xfc5c('0x25')](removeEntity(_0x4cfab3,null))['catch'](handleError(_0x4cfab3,null));}; \ No newline at end of file +var _0x35a4=['path','sox','ejs','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','json','apply','reject','update','error','stack','name','send','index','map','ServicenowField','rawAttributes','fieldName','type','key','query','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','sort','pick','filter','VIRTUAL','merge','where','then','includeAll','include','findAll','rows','catch','show','params','keys','length','options','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util'];(function(_0xc7b78b,_0x1f852e){var _0x4b5e17=function(_0x2383a2){while(--_0x2383a2){_0xc7b78b['push'](_0xc7b78b['shift']());}};_0x4b5e17(++_0x1f852e);}(_0x35a4,0x128));var _0x435a=function(_0x124f88,_0x3ad501){_0x124f88=_0x124f88-0x0;var _0xed0e3b=_0x35a4[_0x124f88];return _0xed0e3b;};'use strict';var emlformat=require(_0x435a('0x0'));var rimraf=require(_0x435a('0x1'));var zipdir=require(_0x435a('0x2'));var jsonpatch=require(_0x435a('0x3'));var rp=require(_0x435a('0x4'));var moment=require(_0x435a('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x435a('0x6'));var util=require(_0x435a('0x7'));var path=require(_0x435a('0x8'));var sox=require(_0x435a('0x9'));var csv=require('to-csv');var ejs=require(_0x435a('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x435a('0xb'));var jsforce=require(_0x435a('0xc'));var deskjs=require(_0x435a('0xd'));var toCsv=require(_0x435a('0xe'));var querystring=require(_0x435a('0xf'));var Papa=require(_0x435a('0x10'));var Redis=require(_0x435a('0x11'));var authService=require(_0x435a('0x12'));var qs=require(_0x435a('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x435a('0x14'))(_0x435a('0x15'));var utils=require('../../config/utils');var config=require(_0x435a('0x16'));var licenseUtil=require(_0x435a('0x17'));var db=require(_0x435a('0x18'))['db'];function respondWithStatusCode(_0x442bae,_0x3e4d15){_0x3e4d15=_0x3e4d15||0xcc;return function(_0x50ef91){if(_0x50ef91){return _0x442bae[_0x435a('0x19')](_0x3e4d15);}return _0x442bae[_0x435a('0x1a')](_0x3e4d15)['end']();};}function respondWithResult(_0x55c50f,_0x2ca79b){_0x2ca79b=_0x2ca79b||0xc8;return function(_0x56b05e){if(_0x56b05e){return _0x55c50f[_0x435a('0x1a')](_0x2ca79b)['json'](_0x56b05e);}};}function respondWithFilteredResult(_0x14dbb9,_0x14b506){return function(_0x1e5e44){if(_0x1e5e44){var _0x4ab2e8=typeof _0x14b506[_0x435a('0x1b')]===_0x435a('0x1c')&&typeof _0x14b506[_0x435a('0x1d')]===_0x435a('0x1c');var _0x42d6f8=_0x1e5e44[_0x435a('0x1e')];var _0x12810f=_0x4ab2e8?0x0:_0x14b506['offset'];var _0x12b872=_0x4ab2e8?_0x1e5e44['count']:_0x14b506[_0x435a('0x1b')]+_0x14b506[_0x435a('0x1d')];var _0x28cfbf;if(_0x12b872>=_0x42d6f8){_0x12b872=_0x42d6f8;_0x28cfbf=0xc8;}else{_0x28cfbf=0xce;}_0x14dbb9['status'](_0x28cfbf);return _0x14dbb9[_0x435a('0x1f')]('Content-Range',_0x12810f+'-'+_0x12b872+'/'+_0x42d6f8)[_0x435a('0x20')](_0x1e5e44);}return null;};}function patchUpdates(_0x473223){return function(_0x353b13){try{jsonpatch[_0x435a('0x21')](_0x353b13,_0x473223,!![]);}catch(_0x2b530d){return BPromise[_0x435a('0x22')](_0x2b530d);}return _0x353b13['save']();};}function saveUpdates(_0x3b6727,_0x26ac9d){return function(_0x3b637c){if(_0x3b637c){return _0x3b637c[_0x435a('0x23')](_0x3b6727)['then'](function(_0x238666){return _0x238666;});}return null;};}function removeEntity(_0x58fc7a,_0x16d7c0){return function(_0xd1a9ea){if(_0xd1a9ea){return _0xd1a9ea['destroy']()['then'](function(){_0x58fc7a[_0x435a('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x440289,_0x244fd9){return function(_0x4e7d16){if(!_0x4e7d16){_0x440289[_0x435a('0x19')](0x194);}return _0x4e7d16;};}function handleError(_0x46fc58,_0x23202d){_0x23202d=_0x23202d||0x1f4;return function(_0x358dde){logger[_0x435a('0x24')](_0x358dde[_0x435a('0x25')]);if(_0x358dde['name']){delete _0x358dde[_0x435a('0x26')];}_0x46fc58[_0x435a('0x1a')](_0x23202d)[_0x435a('0x27')](_0x358dde);};}exports[_0x435a('0x28')]=function(_0x3c02db,_0x1be597){var _0x706ae8={},_0x41c802={},_0x415abb={'count':0x0,'rows':[]};var _0x28949e=_[_0x435a('0x29')](db[_0x435a('0x2a')][_0x435a('0x2b')],function(_0x1e0df2){return{'name':_0x1e0df2[_0x435a('0x2c')],'type':_0x1e0df2[_0x435a('0x2d')][_0x435a('0x2e')]};});_0x41c802['model']=_[_0x435a('0x29')](_0x28949e,'name');_0x41c802[_0x435a('0x2f')]=_['keys'](_0x3c02db[_0x435a('0x2f')]);_0x41c802[_0x435a('0x30')]=_[_0x435a('0x31')](_0x41c802[_0x435a('0x32')],_0x41c802[_0x435a('0x2f')]);_0x706ae8['attributes']=_[_0x435a('0x31')](_0x41c802[_0x435a('0x32')],qs[_0x435a('0x33')](_0x3c02db[_0x435a('0x2f')][_0x435a('0x33')]));_0x706ae8[_0x435a('0x34')]=_0x706ae8[_0x435a('0x34')]['length']?_0x706ae8[_0x435a('0x34')]:_0x41c802['model'];if(!_0x3c02db[_0x435a('0x2f')][_0x435a('0x35')](_0x435a('0x36'))){_0x706ae8['limit']=qs[_0x435a('0x1d')](_0x3c02db[_0x435a('0x2f')]['limit']);_0x706ae8[_0x435a('0x1b')]=qs[_0x435a('0x1b')](_0x3c02db[_0x435a('0x2f')][_0x435a('0x1b')]);}_0x706ae8['order']=qs[_0x435a('0x37')](_0x3c02db[_0x435a('0x2f')][_0x435a('0x37')]);_0x706ae8['where']=qs[_0x435a('0x30')](_[_0x435a('0x38')](_0x3c02db[_0x435a('0x2f')],_0x41c802[_0x435a('0x30')]),_0x28949e);if(_0x3c02db['query'][_0x435a('0x39')]){_0x706ae8['where']=_['merge'](_0x706ae8['where'],{'$or':_[_0x435a('0x29')](_0x28949e,function(_0x3b73a){if(_0x3b73a['type']!==_0x435a('0x3a')){var _0x1d74be={};_0x1d74be[_0x3b73a[_0x435a('0x26')]]={'$like':'%'+_0x3c02db[_0x435a('0x2f')][_0x435a('0x39')]+'%'};return _0x1d74be;}})});}_0x706ae8=_[_0x435a('0x3b')]({},_0x706ae8,_0x3c02db['options']);var _0x4763e7={'where':_0x706ae8[_0x435a('0x3c')]};return db[_0x435a('0x2a')][_0x435a('0x1e')](_0x4763e7)[_0x435a('0x3d')](function(_0x19e0fd){_0x415abb['count']=_0x19e0fd;if(_0x3c02db[_0x435a('0x2f')][_0x435a('0x3e')]){_0x706ae8[_0x435a('0x3f')]=[{'all':!![]}];}return db[_0x435a('0x2a')][_0x435a('0x40')](_0x706ae8);})[_0x435a('0x3d')](function(_0xb1a3f){_0x415abb[_0x435a('0x41')]=_0xb1a3f;return _0x415abb;})[_0x435a('0x3d')](respondWithFilteredResult(_0x1be597,_0x706ae8))[_0x435a('0x42')](handleError(_0x1be597,null));};exports[_0x435a('0x43')]=function(_0x4807b1,_0x2de0fa){var _0x45287f={'raw':!![],'where':{'id':_0x4807b1[_0x435a('0x44')]['id']}},_0x217f4d={};_0x217f4d['model']=_[_0x435a('0x45')](db[_0x435a('0x2a')][_0x435a('0x2b')]);_0x217f4d[_0x435a('0x2f')]=_['keys'](_0x4807b1[_0x435a('0x2f')]);_0x217f4d[_0x435a('0x30')]=_['intersection'](_0x217f4d['model'],_0x217f4d[_0x435a('0x2f')]);_0x45287f[_0x435a('0x34')]=_['intersection'](_0x217f4d[_0x435a('0x32')],qs[_0x435a('0x33')](_0x4807b1[_0x435a('0x2f')]['fields']));_0x45287f['attributes']=_0x45287f[_0x435a('0x34')][_0x435a('0x46')]?_0x45287f[_0x435a('0x34')]:_0x217f4d[_0x435a('0x32')];if(_0x4807b1['query']['includeAll']){_0x45287f[_0x435a('0x3f')]=[{'all':!![]}];}_0x45287f=_[_0x435a('0x3b')]({},_0x45287f,_0x4807b1[_0x435a('0x47')]);return db[_0x435a('0x2a')][_0x435a('0x48')](_0x45287f)[_0x435a('0x3d')](handleEntityNotFound(_0x2de0fa,null))[_0x435a('0x3d')](respondWithResult(_0x2de0fa,null))[_0x435a('0x42')](handleError(_0x2de0fa,null));};exports[_0x435a('0x49')]=function(_0x16f293,_0xc4ad2c){return db[_0x435a('0x2a')][_0x435a('0x49')](_0x16f293[_0x435a('0x4a')],{})[_0x435a('0x3d')](respondWithResult(_0xc4ad2c,0xc9))[_0x435a('0x42')](handleError(_0xc4ad2c,null));};exports[_0x435a('0x23')]=function(_0x169d77,_0x3904e2){if(_0x169d77[_0x435a('0x4a')]['id']){delete _0x169d77[_0x435a('0x4a')]['id'];}return db[_0x435a('0x2a')][_0x435a('0x48')]({'where':{'id':_0x169d77['params']['id']}})[_0x435a('0x3d')](handleEntityNotFound(_0x3904e2,null))[_0x435a('0x3d')](saveUpdates(_0x169d77['body'],null))['then'](respondWithResult(_0x3904e2,null))[_0x435a('0x42')](handleError(_0x3904e2,null));};exports[_0x435a('0x4b')]=function(_0x59e272,_0x3c49bb){return db[_0x435a('0x2a')][_0x435a('0x48')]({'where':{'id':_0x59e272[_0x435a('0x44')]['id']}})['then'](handleEntityNotFound(_0x3c49bb,null))[_0x435a('0x3d')](removeEntity(_0x3c49bb,null))[_0x435a('0x42')](handleError(_0x3c49bb,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index f93fcfd..eb81aa8 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 _0x7a7c=['servicenow_unique_index','idField','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','exports','ServicenowField'];(function(_0x79ecea,_0x51ae0c){var _0x3974a7=function(_0x595282){while(--_0x595282){_0x79ecea['push'](_0x79ecea['shift']());}};_0x3974a7(++_0x51ae0c);}(_0x7a7c,0xb6));var _0xc7a7=function(_0x331d26,_0x18e069){_0x331d26=_0x331d26-0x0;var _0x3f9959=_0x7a7c[_0x331d26];return _0x3f9959;};'use strict';var _=require(_0xc7a7('0x0'));var util=require(_0xc7a7('0x1'));var logger=require(_0xc7a7('0x2'))(_0xc7a7('0x3'));var moment=require(_0xc7a7('0x4'));var BPromise=require(_0xc7a7('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc7a7('0x6'));var rimraf=require(_0xc7a7('0x7'));var config=require('../../config/environment');var attributes=require('./intServicenowField.attributes');module[_0xc7a7('0x8')]=function(_0x112792,_0xe4039d){return _0x112792['define'](_0xc7a7('0x9'),attributes,{'tableName':'int_servicenow_fields','paranoid':![],'indexes':[{'name':_0xc7a7('0xa'),'fields':[_0xc7a7('0xb'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa785=['api','moment','request-promise','path','rimraf','../../config/environment','./intServicenowField.attributes','exports','define','ServicenowField','int_servicenow_fields','idField','FieldId','lodash','util','../../config/logger'];(function(_0x3d27ba,_0x2671a3){var _0xf01885=function(_0x311f5c){while(--_0x311f5c){_0x3d27ba['push'](_0x3d27ba['shift']());}};_0xf01885(++_0x2671a3);}(_0xa785,0xcd));var _0x5a78=function(_0x349367,_0x1cede2){_0x349367=_0x349367-0x0;var _0x14179b=_0xa785[_0x349367];return _0x14179b;};'use strict';var _=require(_0x5a78('0x0'));var util=require(_0x5a78('0x1'));var logger=require(_0x5a78('0x2'))(_0x5a78('0x3'));var moment=require(_0x5a78('0x4'));var BPromise=require('bluebird');var rp=require(_0x5a78('0x5'));var fs=require('fs');var path=require(_0x5a78('0x6'));var rimraf=require(_0x5a78('0x7'));var config=require(_0x5a78('0x8'));var attributes=require(_0x5a78('0x9'));module[_0x5a78('0xa')]=function(_0x10c37f,_0x5d1ddf){return _0x10c37f[_0x5a78('0xb')](_0x5a78('0xc'),attributes,{'tableName':_0x5a78('0xd'),'paranoid':![],'indexes':[{'name':'servicenow_unique_index','fields':[_0x5a78('0xe'),_0x5a78('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.rpc.js b/server/api/intServicenowField/intServicenowField.rpc.js index fb88d64..4097624 100644 --- a/server/api/intServicenowField/intServicenowField.rpc.js +++ b/server/api/intServicenowField/intServicenowField.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xac4a=['ServicenowField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','then','info','debug','ServicenowField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0xac4a,0x13f));var _0xaac4=function(_0x66084b,_0x32d4dd){_0x66084b=_0x66084b-0x0;var _0xb04b2f=_0xac4a[_0x66084b];return _0xb04b2f;};'use strict';var _=require(_0xaac4('0x0'));var util=require(_0xaac4('0x1'));var moment=require(_0xaac4('0x2'));var BPromise=require(_0xaac4('0x3'));var rs=require(_0xaac4('0x4'));var fs=require('fs');var Redis=require(_0xaac4('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xaac4('0x6'))(_0xaac4('0x7'));var config=require(_0xaac4('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xaac4('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1cdfc5,_0x5870e8,_0x1e4283){return new BPromise(function(_0x27354c,_0x567295){return client['request'](_0x1cdfc5,_0x1e4283)[_0xaac4('0xa')](function(_0x50d114){logger[_0xaac4('0xb')]('ServicenowField,\x20%s,\x20%s',_0x5870e8,'request\x20sent');logger[_0xaac4('0xc')](_0xaac4('0xd'),_0x5870e8,_0xaac4('0xe'),JSON[_0xaac4('0xf')](_0x50d114));if(_0x50d114[_0xaac4('0x10')]){if(_0x50d114['error']['code']===0x1f4){logger[_0xaac4('0x10')](_0xaac4('0x11'),_0x5870e8,_0x50d114[_0xaac4('0x10')]['message']);return _0x567295(_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);}logger['error'](_0xaac4('0x11'),_0x5870e8,_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);return _0x27354c(_0x50d114[_0xaac4('0x10')][_0xaac4('0x12')]);}else{logger[_0xaac4('0xb')](_0xaac4('0x11'),_0x5870e8,_0xaac4('0xe'));_0x27354c(_0x50d114[_0xaac4('0x13')][_0xaac4('0x12')]);}})[_0xaac4('0x14')](function(_0x1766c2){logger[_0xaac4('0x10')]('ServicenowField,\x20%s,\x20%s',_0x5870e8,_0x1766c2);_0x567295(_0x1766c2);});});} \ No newline at end of file +var _0xbdb7=['request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','info','ServicenowField,\x20%s,\x20%s'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x1fe8be,_0x5e7860){_0x1fe8be=_0x1fe8be-0x0;var _0x1449bb=_0xbdb7[_0x1fe8be];return _0x1449bb;};'use strict';var _=require(_0x7bdb('0x0'));var util=require(_0x7bdb('0x1'));var moment=require(_0x7bdb('0x2'));var BPromise=require(_0x7bdb('0x3'));var rs=require(_0x7bdb('0x4'));var fs=require('fs');var Redis=require(_0x7bdb('0x5'));var db=require(_0x7bdb('0x6'))['db'];var utils=require(_0x7bdb('0x7'));var logger=require(_0x7bdb('0x8'))('rpc');var config=require(_0x7bdb('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7bdb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1e23a3,_0x493bde,_0x513cba){return new BPromise(function(_0x468041,_0x11a877){return client['request'](_0x1e23a3,_0x513cba)['then'](function(_0xdc2ffc){logger[_0x7bdb('0xb')](_0x7bdb('0xc'),_0x493bde,_0x7bdb('0xd'));logger[_0x7bdb('0xe')](_0x7bdb('0xf'),_0x493bde,_0x7bdb('0xd'),JSON[_0x7bdb('0x10')](_0xdc2ffc));if(_0xdc2ffc['error']){if(_0xdc2ffc['error']['code']===0x1f4){logger[_0x7bdb('0x11')](_0x7bdb('0xc'),_0x493bde,_0xdc2ffc['error'][_0x7bdb('0x12')]);return _0x11a877(_0xdc2ffc['error']['message']);}logger[_0x7bdb('0x11')](_0x7bdb('0xc'),_0x493bde,_0xdc2ffc['error']['message']);return _0x468041(_0xdc2ffc['error'][_0x7bdb('0x12')]);}else{logger[_0x7bdb('0xb')](_0x7bdb('0xc'),_0x493bde,_0x7bdb('0xd'));_0x468041(_0xdc2ffc[_0x7bdb('0x13')][_0x7bdb('0x12')]);}})[_0x7bdb('0x14')](function(_0x1b2d9b){logger['error'](_0x7bdb('0xc'),_0x493bde,_0x1b2d9b);_0x11a877(_0x1b2d9b);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index 8786d59..19911a5 100644 --- a/server/api/intSugarcrmAccount/index.js +++ b/server/api/intSugarcrmAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./intSugarcrmAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','path'];(function(_0x3bf93b,_0x3aa6bd){var _0x242a01=function(_0x36a436){while(--_0x36a436){_0x3bf93b['push'](_0x3bf93b['shift']());}};_0x242a01(++_0x3aa6bd);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x11')]('/',auth['isAuthenticated'](),controller[_0x7995('0x12')]);router[_0x7995('0x11')]('/:id/configurations',auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xc'),auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7995('0x17')]);module[_0x7995('0x18')]=router; \ No newline at end of file +var _0xa9e0=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmAccount.controller','get','index','/:id','getConfigurations','/:id/fields','isAuthenticated','getFields','post','addConfiguration','put','update','destroy','exports','multer','util','path'];(function(_0x5c476c,_0x3b6663){var _0x1ddd15=function(_0x28c1f2){while(--_0x28c1f2){_0x5c476c['push'](_0x5c476c['shift']());}};_0x1ddd15(++_0x3b6663);}(_0xa9e0,0x123));var _0x0a9e=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0xa9e0[_0x481bf7];return _0x461787;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0x8')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0x8')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x12')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);module[_0x0a9e('0x14')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js index 395b35d..bc0e3ff 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(_0x254508,_0x5592c1){var _0x4ca20b=function(_0x16ffb3){while(--_0x16ffb3){_0x254508['push'](_0x254508['shift']());}};_0x4ca20b(++_0x5592c1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0xa9e0[_0x9aada2];return _0x196dff;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'name':{'type':Sequelize[_0x0a9e('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0x0a9e('0x3')},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x0a9e('0x2')],'unique':_0x0a9e('0x4')},'serverUrl':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xa9e0=['remoteUri','sequelize','exports','STRING','username'];(function(_0x5c90c6,_0x3e92b8){var _0x26cb55=function(_0x22dac9){while(--_0x22dac9){_0x5c90c6['push'](_0x5c90c6['shift']());}};_0x26cb55(++_0x3e92b8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0xa9e0[_0x2bf141];return _0x48277b;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'name':{'type':Sequelize[_0x0a9e('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0x0a9e('0x3')},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x0a9e('0x2')],'unique':_0x0a9e('0x4')},'serverUrl':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js index 73cf8ed..1a16ea0 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 _0xda73=['JSON','PLAIN','Password\x20Expired','stringify','Calls','remove','includes','endsWith','values','value','test','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','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','limit','undefined','offset','count','set','Content-Range','apply','save','update','then','error','stack','name','send','index','map','SugarcrmAccount','rawAttributes','type','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','rows','catch','show','params','find','create','body','getConfigurations','findOne','SugarcrmConfiguration','addConfiguration','Subjects','getSubjects','channel','getDescriptions','SugarcrmField','Descriptions','getFields','date_start','duration_hours','duration_minutes','parent_name','direction','username','password','remoteUri','slice','POST','format','%s%s','/service/v4_1/rest.php'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0xda73,0x160));var _0x3da7=function(_0x18d1d3,_0x238863){_0x18d1d3=_0x18d1d3-0x0;var _0x3287d6=_0xda73[_0x18d1d3];return _0x3287d6;};'use strict';var emlformat=require(_0x3da7('0x0'));var rimraf=require(_0x3da7('0x1'));var zipdir=require(_0x3da7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x3da7('0x3'));var BPromise=require(_0x3da7('0x4'));var Mustache=require(_0x3da7('0x5'));var util=require(_0x3da7('0x6'));var path=require(_0x3da7('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3da7('0x8'));var _=require(_0x3da7('0x9'));var squel=require(_0x3da7('0xa'));var crypto=require(_0x3da7('0xb'));var jsforce=require(_0x3da7('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x3da7('0xd'));var querystring=require(_0x3da7('0xe'));var Papa=require('papaparse');var Redis=require(_0x3da7('0xf'));var authService=require(_0x3da7('0x10'));var qs=require(_0x3da7('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3da7('0x12'));var logger=require(_0x3da7('0x13'))(_0x3da7('0x14'));var utils=require(_0x3da7('0x15'));var config=require(_0x3da7('0x16'));var licenseUtil=require(_0x3da7('0x17'));var db=require(_0x3da7('0x18'))['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x336bbd,_0x2d30d8){_0x2d30d8=_0x2d30d8||0xcc;return function(_0x2d0229){if(_0x2d0229){return _0x336bbd[_0x3da7('0x19')](_0x2d30d8);}return _0x336bbd['status'](_0x2d30d8)[_0x3da7('0x1a')]();};}function respondWithResult(_0x3ada21,_0xed7354){_0xed7354=_0xed7354||0xc8;return function(_0x4e2c83){if(_0x4e2c83){return _0x3ada21[_0x3da7('0x1b')](_0xed7354)[_0x3da7('0x1c')](_0x4e2c83);}};}function respondWithFilteredResult(_0x550275,_0x4f93c7){return function(_0xf4b9ba){if(_0xf4b9ba){var _0xce073d=typeof _0x4f93c7['offset']==='undefined'&&typeof _0x4f93c7[_0x3da7('0x1d')]===_0x3da7('0x1e');var _0x53c797=_0xf4b9ba['count'];var _0x1e9318=_0xce073d?0x0:_0x4f93c7[_0x3da7('0x1f')];var _0xa1b955=_0xce073d?_0xf4b9ba[_0x3da7('0x20')]:_0x4f93c7[_0x3da7('0x1f')]+_0x4f93c7['limit'];var _0x34db6c;if(_0xa1b955>=_0x53c797){_0xa1b955=_0x53c797;_0x34db6c=0xc8;}else{_0x34db6c=0xce;}_0x550275[_0x3da7('0x1b')](_0x34db6c);return _0x550275[_0x3da7('0x21')](_0x3da7('0x22'),_0x1e9318+'-'+_0xa1b955+'/'+_0x53c797)[_0x3da7('0x1c')](_0xf4b9ba);}return null;};}function patchUpdates(_0x2aecd9){return function(_0xb629e8){try{jsonpatch[_0x3da7('0x23')](_0xb629e8,_0x2aecd9,!![]);}catch(_0x362922){return BPromise['reject'](_0x362922);}return _0xb629e8[_0x3da7('0x24')]();};}function saveUpdates(_0x5868b4,_0x2320a9){return function(_0x4e901f){if(_0x4e901f){return _0x4e901f[_0x3da7('0x25')](_0x5868b4)[_0x3da7('0x26')](function(_0x1dfdf2){return _0x1dfdf2;});}return null;};}function removeEntity(_0x21eef6,_0x1cba93){return function(_0x415503){if(_0x415503){return _0x415503['destroy']()[_0x3da7('0x26')](function(){_0x21eef6[_0x3da7('0x1b')](0xcc)[_0x3da7('0x1a')]();});}};}function handleEntityNotFound(_0x5f1325,_0x378a4a){return function(_0x183c5a){if(!_0x183c5a){_0x5f1325[_0x3da7('0x19')](0x194);}return _0x183c5a;};}function handleError(_0x414949,_0x11d550){_0x11d550=_0x11d550||0x1f4;return function(_0xbed95b){logger[_0x3da7('0x27')](_0xbed95b[_0x3da7('0x28')]);if(_0xbed95b[_0x3da7('0x29')]){delete _0xbed95b[_0x3da7('0x29')];}_0x414949[_0x3da7('0x1b')](_0x11d550)[_0x3da7('0x2a')](_0xbed95b);};}exports[_0x3da7('0x2b')]=function(_0x19d15c,_0x892370){var _0x48009b={},_0x3058f0={},_0x135a14={'count':0x0,'rows':[]};var _0x53423f=_[_0x3da7('0x2c')](db[_0x3da7('0x2d')][_0x3da7('0x2e')],function(_0x810059){return{'name':_0x810059['fieldName'],'type':_0x810059[_0x3da7('0x2f')][_0x3da7('0x30')]};});_0x3058f0[_0x3da7('0x31')]=_['map'](_0x53423f,_0x3da7('0x29'));_0x3058f0['query']=_[_0x3da7('0x32')](_0x19d15c[_0x3da7('0x33')]);_0x3058f0[_0x3da7('0x34')]=_['intersection'](_0x3058f0['model'],_0x3058f0['query']);_0x48009b[_0x3da7('0x35')]=_[_0x3da7('0x36')](_0x3058f0[_0x3da7('0x31')],qs[_0x3da7('0x37')](_0x19d15c[_0x3da7('0x33')][_0x3da7('0x37')]));_0x48009b[_0x3da7('0x35')]=_0x48009b[_0x3da7('0x35')][_0x3da7('0x38')]?_0x48009b[_0x3da7('0x35')]:_0x3058f0['model'];if(!_0x19d15c[_0x3da7('0x33')][_0x3da7('0x39')](_0x3da7('0x3a'))){_0x48009b[_0x3da7('0x1d')]=qs[_0x3da7('0x1d')](_0x19d15c['query'][_0x3da7('0x1d')]);_0x48009b[_0x3da7('0x1f')]=qs[_0x3da7('0x1f')](_0x19d15c[_0x3da7('0x33')]['offset']);}_0x48009b[_0x3da7('0x3b')]=qs['sort'](_0x19d15c[_0x3da7('0x33')][_0x3da7('0x3c')]);_0x48009b[_0x3da7('0x3d')]=qs['filters'](_[_0x3da7('0x3e')](_0x19d15c['query'],_0x3058f0[_0x3da7('0x34')]),_0x53423f);if(_0x19d15c['query']['filter']){_0x48009b['where']=_['merge'](_0x48009b[_0x3da7('0x3d')],{'$or':_[_0x3da7('0x2c')](_0x53423f,function(_0x2134e2){if(_0x2134e2[_0x3da7('0x2f')]!==_0x3da7('0x3f')){var _0x4c7f91={};_0x4c7f91[_0x2134e2[_0x3da7('0x29')]]={'$like':'%'+_0x19d15c['query'][_0x3da7('0x40')]+'%'};return _0x4c7f91;}})});}_0x48009b=_[_0x3da7('0x41')]({},_0x48009b,_0x19d15c[_0x3da7('0x42')]);var _0x11a200={'where':_0x48009b[_0x3da7('0x3d')]};return db[_0x3da7('0x2d')][_0x3da7('0x20')](_0x11a200)['then'](function(_0x169356){_0x135a14['count']=_0x169356;if(_0x19d15c[_0x3da7('0x33')][_0x3da7('0x43')]){_0x48009b[_0x3da7('0x44')]=[{'all':!![]}];}return db[_0x3da7('0x2d')]['findAll'](_0x48009b);})[_0x3da7('0x26')](function(_0x11ca32){_0x135a14[_0x3da7('0x45')]=_0x11ca32;return _0x135a14;})['then'](respondWithFilteredResult(_0x892370,_0x48009b))[_0x3da7('0x46')](handleError(_0x892370,null));};exports[_0x3da7('0x47')]=function(_0xe78d5c,_0x34d423){var _0x3d5c44={'raw':![],'where':{'id':_0xe78d5c[_0x3da7('0x48')]['id']}},_0x3db10f={};_0x3db10f[_0x3da7('0x31')]=_['keys'](db[_0x3da7('0x2d')]['rawAttributes']);_0x3db10f[_0x3da7('0x33')]=_[_0x3da7('0x32')](_0xe78d5c['query']);_0x3db10f[_0x3da7('0x34')]=_[_0x3da7('0x36')](_0x3db10f[_0x3da7('0x31')],_0x3db10f['query']);_0x3d5c44[_0x3da7('0x35')]=_[_0x3da7('0x36')](_0x3db10f[_0x3da7('0x31')],qs[_0x3da7('0x37')](_0xe78d5c[_0x3da7('0x33')][_0x3da7('0x37')]));_0x3d5c44[_0x3da7('0x35')]=_0x3d5c44[_0x3da7('0x35')][_0x3da7('0x38')]?_0x3d5c44[_0x3da7('0x35')]:_0x3db10f[_0x3da7('0x31')];if(_0xe78d5c[_0x3da7('0x33')][_0x3da7('0x43')]){_0x3d5c44[_0x3da7('0x44')]=[{'all':!![]}];}_0x3d5c44=_['merge']({},_0x3d5c44,_0xe78d5c[_0x3da7('0x42')]);return db[_0x3da7('0x2d')][_0x3da7('0x49')](_0x3d5c44)[_0x3da7('0x26')](handleEntityNotFound(_0x34d423,null))[_0x3da7('0x26')](respondWithResult(_0x34d423,null))[_0x3da7('0x46')](handleError(_0x34d423,null));};exports['create']=function(_0x441f93,_0x5d7984){return db[_0x3da7('0x2d')][_0x3da7('0x4a')](_0x441f93['body'],{})[_0x3da7('0x26')](respondWithResult(_0x5d7984,0xc9))[_0x3da7('0x46')](handleError(_0x5d7984,null));};exports[_0x3da7('0x25')]=function(_0x387df8,_0x3adb78){if(_0x387df8[_0x3da7('0x4b')]['id']){delete _0x387df8[_0x3da7('0x4b')]['id'];}return db['SugarcrmAccount'][_0x3da7('0x49')]({'where':{'id':_0x387df8[_0x3da7('0x48')]['id']}})[_0x3da7('0x26')](handleEntityNotFound(_0x3adb78,null))[_0x3da7('0x26')](saveUpdates(_0x387df8[_0x3da7('0x4b')],null))[_0x3da7('0x26')](respondWithResult(_0x3adb78,null))['catch'](handleError(_0x3adb78,null));};exports['destroy']=function(_0x1e0de8,_0x5a86c4){return db[_0x3da7('0x2d')][_0x3da7('0x49')]({'where':{'id':_0x1e0de8[_0x3da7('0x48')]['id']}})[_0x3da7('0x26')](handleEntityNotFound(_0x5a86c4,null))[_0x3da7('0x26')](removeEntity(_0x5a86c4,null))[_0x3da7('0x46')](handleError(_0x5a86c4,null));};exports[_0x3da7('0x4c')]=function(_0x5d4d50,_0x21c86b,_0x58a1ed){var _0x521bb0={};var _0x85e5f8={};var _0x18400c;var _0xa5ba2f;return db['SugarcrmAccount'][_0x3da7('0x4d')]({'where':{'id':_0x5d4d50[_0x3da7('0x48')]['id']}})[_0x3da7('0x26')](handleEntityNotFound(_0x21c86b,null))['then'](function(_0x577f86){if(_0x577f86){_0x18400c=_0x577f86;_0x85e5f8[_0x3da7('0x31')]=_[_0x3da7('0x32')](db[_0x3da7('0x4e')][_0x3da7('0x2e')]);_0x85e5f8[_0x3da7('0x33')]=_['keys'](_0x5d4d50[_0x3da7('0x33')]);_0x85e5f8[_0x3da7('0x34')]=_[_0x3da7('0x36')](_0x85e5f8[_0x3da7('0x31')],_0x85e5f8['query']);_0x521bb0[_0x3da7('0x35')]=_[_0x3da7('0x36')](_0x85e5f8[_0x3da7('0x31')],qs['fields'](_0x5d4d50[_0x3da7('0x33')][_0x3da7('0x37')]));_0x521bb0[_0x3da7('0x35')]=_0x521bb0[_0x3da7('0x35')][_0x3da7('0x38')]?_0x521bb0['attributes']:_0x85e5f8[_0x3da7('0x31')];_0x521bb0['order']=qs[_0x3da7('0x3c')](_0x5d4d50[_0x3da7('0x33')]['sort']);_0x521bb0['where']=qs[_0x3da7('0x34')](_[_0x3da7('0x3e')](_0x5d4d50[_0x3da7('0x33')],_0x85e5f8['filters']));if(_0x5d4d50[_0x3da7('0x33')]['filter']){_0x521bb0['where']=_[_0x3da7('0x41')](_0x521bb0[_0x3da7('0x3d')],{'$or':_[_0x3da7('0x2c')](_0x521bb0[_0x3da7('0x35')],function(_0x1cad09){var _0x58c23f={};_0x58c23f[_0x1cad09]={'$like':'%'+_0x5d4d50['query'][_0x3da7('0x40')]+'%'};return _0x58c23f;})});}_0x521bb0=_['merge']({},_0x521bb0,_0x5d4d50[_0x3da7('0x42')]);return _0x18400c[_0x3da7('0x4c')](_0x521bb0);}})[_0x3da7('0x26')](function(_0x3ee680){if(_0x3ee680){_0xa5ba2f=_0x3ee680[_0x3da7('0x38')];if(!_0x5d4d50[_0x3da7('0x33')]['hasOwnProperty']('nolimit')){_0x521bb0['limit']=qs['limit'](_0x5d4d50[_0x3da7('0x33')][_0x3da7('0x1d')]);_0x521bb0['offset']=qs['offset'](_0x5d4d50['query']['offset']);}return _0x18400c['getConfigurations'](_0x521bb0);}})['then'](function(_0x4389b6){if(_0x4389b6){return _0x4389b6?{'count':_0xa5ba2f,'rows':_0x4389b6}:null;}})[_0x3da7('0x26')](respondWithResult(_0x21c86b,null))[_0x3da7('0x46')](handleError(_0x21c86b,null));};exports[_0x3da7('0x4f')]=function(_0xbca33,_0x3bee9b,_0x10883){if(_0xbca33[_0x3da7('0x4b')]['id']){delete _0xbca33['body']['id'];}return db[_0x3da7('0x2d')][_0x3da7('0x4d')]({'where':{'id':_0xbca33['params']['id']}})[_0x3da7('0x26')](handleEntityNotFound(_0x3bee9b,null))['then'](function(_0x1efb90){if(_0x1efb90){_0xbca33[_0x3da7('0x4b')]['AccountId']=_0x1efb90['id'];_0xbca33[_0x3da7('0x4b')][_0x3da7('0x50')]=integrations[_0x3da7('0x51')](_0xbca33[_0x3da7('0x4b')][_0x3da7('0x52')],_0xbca33['body'][_0x3da7('0x2f')]);_0xbca33[_0x3da7('0x4b')]['Descriptions']=integrations[_0x3da7('0x53')](_0xbca33[_0x3da7('0x4b')][_0x3da7('0x52')],_0xbca33[_0x3da7('0x4b')]['type']);return db[_0x3da7('0x4e')][_0x3da7('0x4a')](_0xbca33['body'],{'include':[{'model':db['SugarcrmField'],'as':_0x3da7('0x50')},{'model':db[_0x3da7('0x54')],'as':_0x3da7('0x55')}]});}return null;})[_0x3da7('0x26')](respondWithResult(_0x3bee9b,null))[_0x3da7('0x46')](handleError(_0x3bee9b,null));};exports[_0x3da7('0x56')]=function(_0x1833e8,_0x513ac3,_0x1d3a89){var _0x58beaa='';var _0x4639c4=['id','name','assigned_user_id','created_by','description',_0x3da7('0x57'),_0x3da7('0x58'),_0x3da7('0x59'),'parent_id','parent_type',_0x3da7('0x5a'),_0x3da7('0x5b')];return db[_0x3da7('0x2d')][_0x3da7('0x4d')]({'where':{'id':_0x1833e8[_0x3da7('0x48')]['id']},'attributes':['id',_0x3da7('0x5c'),_0x3da7('0x5d'),_0x3da7('0x5e')]})['then'](handleEntityNotFound(_0x513ac3,null))[_0x3da7('0x26')](function(_0x54e9a8){if(_0x54e9a8){_0x58beaa=_0x54e9a8['remoteUri'];var _0x4e6629=_0x58beaa[_0x3da7('0x5f')](-0x1);if(_0x4e6629==='/'){_0x58beaa=_0x58beaa['substring'](0x0,_0x58beaa['lastIndexOf'](_0x4e6629));}return rp({'method':_0x3da7('0x60'),'uri':util[_0x3da7('0x61')](_0x3da7('0x62'),_0x58beaa,_0x3da7('0x63')),'json':!![],'form':{'method':'login','input_type':'JSON','response_type':_0x3da7('0x64'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x54e9a8[_0x3da7('0x5c')],'password':_0x54e9a8['password'],'encryption':_0x3da7('0x65')},'application':'xCALLY\x20Motion\x20Integration'})}});}})[_0x3da7('0x26')](function(_0xd690d1){if(_0xd690d1&&_0xd690d1['name']!=='Invalid\x20Login'&&_0xd690d1[_0x3da7('0x29')]!==_0x3da7('0x66')){return rp({'method':_0x3da7('0x60'),'uri':util[_0x3da7('0x61')](_0x3da7('0x62'),_0x58beaa,'/service/v4_1/rest.php'),'json':!![],'form':{'method':'get_module_fields','input_type':_0x3da7('0x64'),'response_type':_0x3da7('0x64'),'rest_data':JSON[_0x3da7('0x67')]({'session':_0xd690d1['id'],'module_name':_0x3da7('0x68')})}})[_0x3da7('0x26')](function(_0x363746){if(_0x363746){var _0x30608a=_['values'](_0x363746['module_fields']);_[_0x3da7('0x69')](_0x30608a,function(_0x3f7ceb){return _0x4639c4[_0x3da7('0x6a')](_0x3f7ceb[_0x3da7('0x29')]);});return{'count':_0x30608a['length'],'rows':_[_0x3da7('0x2c')](_0x30608a,function(_0x54d22e){return{'id':_0x54d22e['name'],'name':_0x54d22e['label'],'custom':_[_0x3da7('0x6b')](_0x54d22e[_0x3da7('0x29')],'_c')?!![]:![],'options':_0x54d22e[_0x3da7('0x42')]?_[_0x3da7('0x2c')](_[_0x3da7('0x6c')](_0x54d22e['options']),function(_0x22d785){return{'name':_0x22d785[_0x3da7('0x6d')],'value':_0x22d785[_0x3da7('0x29')]};}):[]};})};}})[_0x3da7('0x26')](respondWithResult(_0x513ac3,null))[_0x3da7('0x46')](function(_0x449c14){var _0x4cdae5=_0x1833e8[_0x3da7('0x33')][_0x3da7('0x6e')]?0x1f4:_0x449c14['statusCode']||0x1f4;logger[_0x3da7('0x27')](_0x3da7('0x6f'),_0x3da7('0x56'),_0x4cdae5,JSON[_0x3da7('0x67')](_0x449c14));delete _0x449c14[_0x3da7('0x29')];if(_0x4cdae5===0x191){_0x4cdae5=0x190;}_0x513ac3[_0x3da7('0x1b')](_0x4cdae5)[_0x3da7('0x2a')](_0x1833e8['query'][_0x3da7('0x6e')]?{'message':_0x3da7('0x70'),'statusCode':_0x449c14['statusCode']}:_0x449c14);});}else{var _0x15f9ce=0x1f4;_0x513ac3[_0x3da7('0x1b')](_0x15f9ce)['send']({'message':_0x3da7('0x70'),'statusCode':0x190});}});}; \ No newline at end of file +var _0x7caf=['lastIndexOf','format','%s%s','/service/v4_1/rest.php','login','JSON','stringify','username','password','Invalid\x20Login','Password\x20Expired','POST','get_module_fields','Calls','values','module_fields','remove','includes','label','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','zip-dir','moment','bluebird','mustache','path','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','sendStatus','status','undefined','limit','offset','count','set','json','apply','reject','update','then','destroy','end','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','SugarcrmAccount','includeAll','include','findAll','catch','show','find','create','body','params','getConfigurations','findOne','intersection','hasOwnProperty','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','SugarcrmConfiguration','SugarcrmField','getFields','assigned_user_id','description','date_start','duration_hours','parent_type','parent_name','remoteUri','slice','substring'];(function(_0x19eb12,_0x4b30eb){var _0x4777e6=function(_0x4ce9f2){while(--_0x4ce9f2){_0x19eb12['push'](_0x19eb12['shift']());}};_0x4777e6(++_0x4b30eb);}(_0x7caf,0x174));var _0xf7ca=function(_0xfa5616,_0x2d04b9){_0xfa5616=_0xfa5616-0x0;var _0x46a81c=_0x7caf[_0xfa5616];return _0x46a81c;};'use strict';var emlformat=require(_0xf7ca('0x0'));var rimraf=require(_0xf7ca('0x1'));var zipdir=require(_0xf7ca('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xf7ca('0x3'));var BPromise=require(_0xf7ca('0x4'));var Mustache=require(_0xf7ca('0x5'));var util=require('util');var path=require(_0xf7ca('0x6'));var sox=require('sox');var csv=require(_0xf7ca('0x7'));var ejs=require(_0xf7ca('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf7ca('0x9'));var squel=require(_0xf7ca('0xa'));var crypto=require(_0xf7ca('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xf7ca('0xc'));var toCsv=require(_0xf7ca('0x7'));var querystring=require(_0xf7ca('0xd'));var Papa=require(_0xf7ca('0xe'));var Redis=require('ioredis');var authService=require(_0xf7ca('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xf7ca('0x10'));var hardwareService=require(_0xf7ca('0x11'));var logger=require(_0xf7ca('0x12'))('api');var utils=require(_0xf7ca('0x13'));var config=require(_0xf7ca('0x14'));var licenseUtil=require(_0xf7ca('0x15'));var db=require(_0xf7ca('0x16'))['db'];var integrations=require(_0xf7ca('0x17'));function respondWithStatusCode(_0x167017,_0x334a71){_0x334a71=_0x334a71||0xcc;return function(_0x2e7dbc){if(_0x2e7dbc){return _0x167017[_0xf7ca('0x18')](_0x334a71);}return _0x167017[_0xf7ca('0x19')](_0x334a71)['end']();};}function respondWithResult(_0x1cb2e0,_0x764370){_0x764370=_0x764370||0xc8;return function(_0x3523aa){if(_0x3523aa){return _0x1cb2e0['status'](_0x764370)['json'](_0x3523aa);}};}function respondWithFilteredResult(_0x47c11f,_0x36f243){return function(_0x1a7d5e){if(_0x1a7d5e){var _0x2d413f=typeof _0x36f243['offset']===_0xf7ca('0x1a')&&typeof _0x36f243[_0xf7ca('0x1b')]===_0xf7ca('0x1a');var _0xf56a15=_0x1a7d5e['count'];var _0x3b0653=_0x2d413f?0x0:_0x36f243[_0xf7ca('0x1c')];var _0x5f9310=_0x2d413f?_0x1a7d5e[_0xf7ca('0x1d')]:_0x36f243[_0xf7ca('0x1c')]+_0x36f243[_0xf7ca('0x1b')];var _0x338e51;if(_0x5f9310>=_0xf56a15){_0x5f9310=_0xf56a15;_0x338e51=0xc8;}else{_0x338e51=0xce;}_0x47c11f[_0xf7ca('0x19')](_0x338e51);return _0x47c11f[_0xf7ca('0x1e')]('Content-Range',_0x3b0653+'-'+_0x5f9310+'/'+_0xf56a15)[_0xf7ca('0x1f')](_0x1a7d5e);}return null;};}function patchUpdates(_0x1d96b4){return function(_0x1df939){try{jsonpatch[_0xf7ca('0x20')](_0x1df939,_0x1d96b4,!![]);}catch(_0x252730){return BPromise[_0xf7ca('0x21')](_0x252730);}return _0x1df939['save']();};}function saveUpdates(_0xe939ed,_0x4ca2e5){return function(_0x2d2ac3){if(_0x2d2ac3){return _0x2d2ac3[_0xf7ca('0x22')](_0xe939ed)[_0xf7ca('0x23')](function(_0x33b478){return _0x33b478;});}return null;};}function removeEntity(_0x916084,_0x4613f6){return function(_0x222870){if(_0x222870){return _0x222870[_0xf7ca('0x24')]()[_0xf7ca('0x23')](function(){_0x916084['status'](0xcc)[_0xf7ca('0x25')]();});}};}function handleEntityNotFound(_0x23762b,_0x1a3451){return function(_0x586f90){if(!_0x586f90){_0x23762b[_0xf7ca('0x18')](0x194);}return _0x586f90;};}function handleError(_0x1369c4,_0x110d07){_0x110d07=_0x110d07||0x1f4;return function(_0x18ab95){logger[_0xf7ca('0x26')](_0x18ab95[_0xf7ca('0x27')]);if(_0x18ab95['name']){delete _0x18ab95[_0xf7ca('0x28')];}_0x1369c4[_0xf7ca('0x19')](_0x110d07)[_0xf7ca('0x29')](_0x18ab95);};}exports[_0xf7ca('0x2a')]=function(_0x58b2f2,_0x1dc760){var _0x6335a3={},_0x2b8c2d={},_0x62d4e9={'count':0x0,'rows':[]};var _0x474344=_[_0xf7ca('0x2b')](db['SugarcrmAccount'][_0xf7ca('0x2c')],function(_0xe9eedf){return{'name':_0xe9eedf[_0xf7ca('0x2d')],'type':_0xe9eedf['type'][_0xf7ca('0x2e')]};});_0x2b8c2d[_0xf7ca('0x2f')]=_[_0xf7ca('0x2b')](_0x474344,_0xf7ca('0x28'));_0x2b8c2d[_0xf7ca('0x30')]=_[_0xf7ca('0x31')](_0x58b2f2['query']);_0x2b8c2d[_0xf7ca('0x32')]=_['intersection'](_0x2b8c2d[_0xf7ca('0x2f')],_0x2b8c2d[_0xf7ca('0x30')]);_0x6335a3[_0xf7ca('0x33')]=_['intersection'](_0x2b8c2d[_0xf7ca('0x2f')],qs[_0xf7ca('0x34')](_0x58b2f2['query'][_0xf7ca('0x34')]));_0x6335a3['attributes']=_0x6335a3[_0xf7ca('0x33')][_0xf7ca('0x35')]?_0x6335a3[_0xf7ca('0x33')]:_0x2b8c2d[_0xf7ca('0x2f')];if(!_0x58b2f2[_0xf7ca('0x30')]['hasOwnProperty'](_0xf7ca('0x36'))){_0x6335a3[_0xf7ca('0x1b')]=qs['limit'](_0x58b2f2[_0xf7ca('0x30')][_0xf7ca('0x1b')]);_0x6335a3[_0xf7ca('0x1c')]=qs['offset'](_0x58b2f2['query']['offset']);}_0x6335a3[_0xf7ca('0x37')]=qs[_0xf7ca('0x38')](_0x58b2f2[_0xf7ca('0x30')][_0xf7ca('0x38')]);_0x6335a3[_0xf7ca('0x39')]=qs[_0xf7ca('0x32')](_[_0xf7ca('0x3a')](_0x58b2f2[_0xf7ca('0x30')],_0x2b8c2d[_0xf7ca('0x32')]),_0x474344);if(_0x58b2f2[_0xf7ca('0x30')][_0xf7ca('0x3b')]){_0x6335a3[_0xf7ca('0x39')]=_[_0xf7ca('0x3c')](_0x6335a3['where'],{'$or':_[_0xf7ca('0x2b')](_0x474344,function(_0x111131){if(_0x111131[_0xf7ca('0x3d')]!==_0xf7ca('0x3e')){var _0x78d505={};_0x78d505[_0x111131[_0xf7ca('0x28')]]={'$like':'%'+_0x58b2f2['query']['filter']+'%'};return _0x78d505;}})});}_0x6335a3=_[_0xf7ca('0x3c')]({},_0x6335a3,_0x58b2f2[_0xf7ca('0x3f')]);var _0x326741={'where':_0x6335a3[_0xf7ca('0x39')]};return db[_0xf7ca('0x40')][_0xf7ca('0x1d')](_0x326741)['then'](function(_0x50ad0e){_0x62d4e9[_0xf7ca('0x1d')]=_0x50ad0e;if(_0x58b2f2[_0xf7ca('0x30')][_0xf7ca('0x41')]){_0x6335a3[_0xf7ca('0x42')]=[{'all':!![]}];}return db[_0xf7ca('0x40')][_0xf7ca('0x43')](_0x6335a3);})['then'](function(_0x10862d){_0x62d4e9['rows']=_0x10862d;return _0x62d4e9;})[_0xf7ca('0x23')](respondWithFilteredResult(_0x1dc760,_0x6335a3))[_0xf7ca('0x44')](handleError(_0x1dc760,null));};exports[_0xf7ca('0x45')]=function(_0x577506,_0x1ed465){var _0x4dc24f={'raw':![],'where':{'id':_0x577506['params']['id']}},_0x124435={};_0x124435[_0xf7ca('0x2f')]=_[_0xf7ca('0x31')](db[_0xf7ca('0x40')]['rawAttributes']);_0x124435['query']=_[_0xf7ca('0x31')](_0x577506[_0xf7ca('0x30')]);_0x124435[_0xf7ca('0x32')]=_['intersection'](_0x124435['model'],_0x124435[_0xf7ca('0x30')]);_0x4dc24f[_0xf7ca('0x33')]=_['intersection'](_0x124435[_0xf7ca('0x2f')],qs[_0xf7ca('0x34')](_0x577506['query']['fields']));_0x4dc24f['attributes']=_0x4dc24f[_0xf7ca('0x33')][_0xf7ca('0x35')]?_0x4dc24f['attributes']:_0x124435[_0xf7ca('0x2f')];if(_0x577506[_0xf7ca('0x30')][_0xf7ca('0x41')]){_0x4dc24f[_0xf7ca('0x42')]=[{'all':!![]}];}_0x4dc24f=_[_0xf7ca('0x3c')]({},_0x4dc24f,_0x577506[_0xf7ca('0x3f')]);return db[_0xf7ca('0x40')][_0xf7ca('0x46')](_0x4dc24f)[_0xf7ca('0x23')](handleEntityNotFound(_0x1ed465,null))[_0xf7ca('0x23')](respondWithResult(_0x1ed465,null))[_0xf7ca('0x44')](handleError(_0x1ed465,null));};exports[_0xf7ca('0x47')]=function(_0x36e154,_0x1918a0){return db[_0xf7ca('0x40')][_0xf7ca('0x47')](_0x36e154[_0xf7ca('0x48')],{})[_0xf7ca('0x23')](respondWithResult(_0x1918a0,0xc9))['catch'](handleError(_0x1918a0,null));};exports[_0xf7ca('0x22')]=function(_0x3f1132,_0x30115d){if(_0x3f1132[_0xf7ca('0x48')]['id']){delete _0x3f1132[_0xf7ca('0x48')]['id'];}return db[_0xf7ca('0x40')]['find']({'where':{'id':_0x3f1132[_0xf7ca('0x49')]['id']}})['then'](handleEntityNotFound(_0x30115d,null))['then'](saveUpdates(_0x3f1132[_0xf7ca('0x48')],null))['then'](respondWithResult(_0x30115d,null))[_0xf7ca('0x44')](handleError(_0x30115d,null));};exports[_0xf7ca('0x24')]=function(_0x1d756f,_0x104874){return db[_0xf7ca('0x40')][_0xf7ca('0x46')]({'where':{'id':_0x1d756f[_0xf7ca('0x49')]['id']}})[_0xf7ca('0x23')](handleEntityNotFound(_0x104874,null))[_0xf7ca('0x23')](removeEntity(_0x104874,null))['catch'](handleError(_0x104874,null));};exports[_0xf7ca('0x4a')]=function(_0x3720e1,_0x32ed99,_0x45025c){var _0x2af88a={};var _0xb4398e={};var _0x133579;var _0x51c4a3;return db[_0xf7ca('0x40')][_0xf7ca('0x4b')]({'where':{'id':_0x3720e1[_0xf7ca('0x49')]['id']}})['then'](handleEntityNotFound(_0x32ed99,null))[_0xf7ca('0x23')](function(_0x1b8e62){if(_0x1b8e62){_0x133579=_0x1b8e62;_0xb4398e[_0xf7ca('0x2f')]=_[_0xf7ca('0x31')](db['SugarcrmConfiguration']['rawAttributes']);_0xb4398e[_0xf7ca('0x30')]=_[_0xf7ca('0x31')](_0x3720e1[_0xf7ca('0x30')]);_0xb4398e['filters']=_['intersection'](_0xb4398e['model'],_0xb4398e[_0xf7ca('0x30')]);_0x2af88a[_0xf7ca('0x33')]=_[_0xf7ca('0x4c')](_0xb4398e[_0xf7ca('0x2f')],qs[_0xf7ca('0x34')](_0x3720e1['query']['fields']));_0x2af88a[_0xf7ca('0x33')]=_0x2af88a[_0xf7ca('0x33')][_0xf7ca('0x35')]?_0x2af88a['attributes']:_0xb4398e[_0xf7ca('0x2f')];_0x2af88a['order']=qs[_0xf7ca('0x38')](_0x3720e1[_0xf7ca('0x30')]['sort']);_0x2af88a['where']=qs[_0xf7ca('0x32')](_[_0xf7ca('0x3a')](_0x3720e1[_0xf7ca('0x30')],_0xb4398e[_0xf7ca('0x32')]));if(_0x3720e1[_0xf7ca('0x30')][_0xf7ca('0x3b')]){_0x2af88a[_0xf7ca('0x39')]=_['merge'](_0x2af88a[_0xf7ca('0x39')],{'$or':_[_0xf7ca('0x2b')](_0x2af88a[_0xf7ca('0x33')],function(_0x42f9d4){var _0xd72744={};_0xd72744[_0x42f9d4]={'$like':'%'+_0x3720e1[_0xf7ca('0x30')][_0xf7ca('0x3b')]+'%'};return _0xd72744;})});}_0x2af88a=_[_0xf7ca('0x3c')]({},_0x2af88a,_0x3720e1['options']);return _0x133579[_0xf7ca('0x4a')](_0x2af88a);}})['then'](function(_0x40f2e8){if(_0x40f2e8){_0x51c4a3=_0x40f2e8[_0xf7ca('0x35')];if(!_0x3720e1[_0xf7ca('0x30')][_0xf7ca('0x4d')](_0xf7ca('0x36'))){_0x2af88a['limit']=qs[_0xf7ca('0x1b')](_0x3720e1['query'][_0xf7ca('0x1b')]);_0x2af88a[_0xf7ca('0x1c')]=qs[_0xf7ca('0x1c')](_0x3720e1[_0xf7ca('0x30')]['offset']);}return _0x133579[_0xf7ca('0x4a')](_0x2af88a);}})[_0xf7ca('0x23')](function(_0xb66796){if(_0xb66796){return _0xb66796?{'count':_0x51c4a3,'rows':_0xb66796}:null;}})[_0xf7ca('0x23')](respondWithResult(_0x32ed99,null))[_0xf7ca('0x44')](handleError(_0x32ed99,null));};exports[_0xf7ca('0x4e')]=function(_0x441829,_0x1d425b,_0x36f8e0){if(_0x441829[_0xf7ca('0x48')]['id']){delete _0x441829[_0xf7ca('0x48')]['id'];}return db[_0xf7ca('0x40')][_0xf7ca('0x4b')]({'where':{'id':_0x441829['params']['id']}})[_0xf7ca('0x23')](handleEntityNotFound(_0x1d425b,null))[_0xf7ca('0x23')](function(_0x44c0e1){if(_0x44c0e1){_0x441829['body']['AccountId']=_0x44c0e1['id'];_0x441829[_0xf7ca('0x48')][_0xf7ca('0x4f')]=integrations[_0xf7ca('0x50')](_0x441829[_0xf7ca('0x48')][_0xf7ca('0x51')],_0x441829[_0xf7ca('0x48')][_0xf7ca('0x3d')]);_0x441829[_0xf7ca('0x48')][_0xf7ca('0x52')]=integrations[_0xf7ca('0x53')](_0x441829[_0xf7ca('0x48')][_0xf7ca('0x51')],_0x441829[_0xf7ca('0x48')][_0xf7ca('0x3d')]);return db[_0xf7ca('0x54')][_0xf7ca('0x47')](_0x441829['body'],{'include':[{'model':db[_0xf7ca('0x55')],'as':_0xf7ca('0x4f')},{'model':db['SugarcrmField'],'as':'Descriptions'}]});}return null;})[_0xf7ca('0x23')](respondWithResult(_0x1d425b,null))[_0xf7ca('0x44')](handleError(_0x1d425b,null));};exports[_0xf7ca('0x56')]=function(_0x4ca3de,_0x57aa6d,_0x34ee08){var _0x55eada='';var _0x425e35=['id',_0xf7ca('0x28'),_0xf7ca('0x57'),'created_by',_0xf7ca('0x58'),_0xf7ca('0x59'),_0xf7ca('0x5a'),'duration_minutes','parent_id',_0xf7ca('0x5b'),_0xf7ca('0x5c'),'direction'];return db[_0xf7ca('0x40')][_0xf7ca('0x4b')]({'where':{'id':_0x4ca3de[_0xf7ca('0x49')]['id']},'attributes':['id','username','password','remoteUri']})[_0xf7ca('0x23')](handleEntityNotFound(_0x57aa6d,null))['then'](function(_0x2f88cc){if(_0x2f88cc){_0x55eada=_0x2f88cc[_0xf7ca('0x5d')];var _0x185385=_0x55eada[_0xf7ca('0x5e')](-0x1);if(_0x185385==='/'){_0x55eada=_0x55eada[_0xf7ca('0x5f')](0x0,_0x55eada[_0xf7ca('0x60')](_0x185385));}return rp({'method':'POST','uri':util[_0xf7ca('0x61')](_0xf7ca('0x62'),_0x55eada,_0xf7ca('0x63')),'json':!![],'form':{'method':_0xf7ca('0x64'),'input_type':_0xf7ca('0x65'),'response_type':_0xf7ca('0x65'),'rest_data':JSON[_0xf7ca('0x66')]({'user_auth':{'user_name':_0x2f88cc[_0xf7ca('0x67')],'password':_0x2f88cc[_0xf7ca('0x68')],'encryption':'PLAIN'},'application':'xCALLY\x20Motion\x20Integration'})}});}})[_0xf7ca('0x23')](function(_0x51c240){if(_0x51c240&&_0x51c240[_0xf7ca('0x28')]!==_0xf7ca('0x69')&&_0x51c240['name']!==_0xf7ca('0x6a')){return rp({'method':_0xf7ca('0x6b'),'uri':util['format'](_0xf7ca('0x62'),_0x55eada,_0xf7ca('0x63')),'json':!![],'form':{'method':_0xf7ca('0x6c'),'input_type':'JSON','response_type':_0xf7ca('0x65'),'rest_data':JSON[_0xf7ca('0x66')]({'session':_0x51c240['id'],'module_name':_0xf7ca('0x6d')})}})[_0xf7ca('0x23')](function(_0x2a1d8b){if(_0x2a1d8b){var _0x213cba=_[_0xf7ca('0x6e')](_0x2a1d8b[_0xf7ca('0x6f')]);_[_0xf7ca('0x70')](_0x213cba,function(_0x2112ab){return _0x425e35[_0xf7ca('0x71')](_0x2112ab[_0xf7ca('0x28')]);});return{'count':_0x213cba[_0xf7ca('0x35')],'rows':_[_0xf7ca('0x2b')](_0x213cba,function(_0xe8de3c){return{'id':_0xe8de3c[_0xf7ca('0x28')],'name':_0xe8de3c[_0xf7ca('0x72')],'custom':_['endsWith'](_0xe8de3c['name'],'_c')?!![]:![],'options':_0xe8de3c[_0xf7ca('0x3f')]?_[_0xf7ca('0x2b')](_['values'](_0xe8de3c['options']),function(_0x15541c){return{'name':_0x15541c['value'],'value':_0x15541c['name']};}):[]};})};}})[_0xf7ca('0x23')](respondWithResult(_0x57aa6d,null))[_0xf7ca('0x44')](function(_0x7200be){var _0x207d29=_0x4ca3de['query']['test']?0x1f4:_0x7200be['statusCode']||0x1f4;logger[_0xf7ca('0x26')](_0xf7ca('0x73'),_0xf7ca('0x56'),_0x207d29,JSON['stringify'](_0x7200be));delete _0x7200be[_0xf7ca('0x28')];if(_0x207d29===0x191){_0x207d29=0x190;}_0x57aa6d[_0xf7ca('0x19')](_0x207d29)[_0xf7ca('0x29')](_0x4ca3de['query']['test']?{'message':_0xf7ca('0x74'),'statusCode':_0x7200be['statusCode']}:_0x7200be);});}else{var _0x318129=0x1f4;_0x57aa6d[_0xf7ca('0x19')](_0x318129)['send']({'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 7b49478..ddfbdea 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 _0x847f=['../../config/environment','./intSugarcrmAccount.attributes','define','SugarcrmAccount','lodash','util','api','moment','path','rimraf'];(function(_0x40726e,_0x309ab2){var _0x10eb6e=function(_0x482a97){while(--_0x482a97){_0x40726e['push'](_0x40726e['shift']());}};_0x10eb6e(++_0x309ab2);}(_0x847f,0xb8));var _0xf847=function(_0x3c007e,_0x2e6adc){_0x3c007e=_0x3c007e-0x0;var _0x851f31=_0x847f[_0x3c007e];return _0x851f31;};'use strict';var _=require(_0xf847('0x0'));var util=require(_0xf847('0x1'));var logger=require('../../config/logger')(_0xf847('0x2'));var moment=require(_0xf847('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xf847('0x4'));var rimraf=require(_0xf847('0x5'));var config=require(_0xf847('0x6'));var attributes=require(_0xf847('0x7'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0xf2bc9e,_0x177d10){return _0xf2bc9e[_0xf847('0x8')](_0xf847('0x9'),attributes,{'tableName':'int_sugarcrm_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb5b2=['../../components/integrations/configuration','exports','define','SugarcrmAccount','int_sugarcrm_accounts','lodash','util','api','moment','bluebird','path','rimraf','../../config/environment','./intSugarcrmAccount.attributes'];(function(_0x46efd7,_0x43f84d){var _0x5637e4=function(_0x54e078){while(--_0x54e078){_0x46efd7['push'](_0x46efd7['shift']());}};_0x5637e4(++_0x43f84d);}(_0xb5b2,0x10f));var _0x2b5b=function(_0x5c5b29,_0x41618c){_0x5c5b29=_0x5c5b29-0x0;var _0x2980f8=_0xb5b2[_0x5c5b29];return _0x2980f8;};'use strict';var _=require(_0x2b5b('0x0'));var util=require(_0x2b5b('0x1'));var logger=require('../../config/logger')(_0x2b5b('0x2'));var moment=require(_0x2b5b('0x3'));var BPromise=require(_0x2b5b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2b5b('0x5'));var rimraf=require(_0x2b5b('0x6'));var config=require(_0x2b5b('0x7'));var attributes=require(_0x2b5b('0x8'));var integrations=require(_0x2b5b('0x9'));module[_0x2b5b('0xa')]=function(_0x172fcd,_0x58534f){return _0x172fcd[_0x2b5b('0xb')](_0x2b5b('0xc'),attributes,{'tableName':_0x2b5b('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.rpc.js index 060c583..dde299d 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 _0x3174=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','request','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetSugarcrmAccount','SugarcrmAccount','findAll','options','raw','where','attributes','limit','map','include','model','ShowSugarcrmAccount','find','moment'];(function(_0x4f3db7,_0x472870){var _0x2c0a30=function(_0x571fcf){while(--_0x571fcf){_0x4f3db7['push'](_0x4f3db7['shift']());}};_0x2c0a30(++_0x472870);}(_0x3174,0x87));var _0x4317=function(_0x572b16,_0x565b54){_0x572b16=_0x572b16-0x0;var _0x5ae671=_0x3174[_0x572b16];return _0x5ae671;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4317('0x0'));var BPromise=require(_0x4317('0x1'));var rs=require(_0x4317('0x2'));var fs=require('fs');var Redis=require(_0x4317('0x3'));var db=require(_0x4317('0x4'))['db'];var utils=require(_0x4317('0x5'));var logger=require(_0x4317('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x4317('0x7'));var client=jayson['client'][_0x4317('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x284f04,_0x5daf4d,_0x7326b1){return new BPromise(function(_0x177cc5,_0x5499e8){return client[_0x4317('0x9')](_0x284f04,_0x7326b1)[_0x4317('0xa')](function(_0x31acbb){logger[_0x4317('0xb')](_0x4317('0xc'),_0x5daf4d,_0x4317('0xd'));logger[_0x4317('0xe')]('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x5daf4d,'request\x20sent',JSON[_0x4317('0xf')](_0x31acbb));if(_0x31acbb[_0x4317('0x10')]){if(_0x31acbb[_0x4317('0x10')][_0x4317('0x11')]===0x1f4){logger['error']('SugarcrmAccount,\x20%s,\x20%s',_0x5daf4d,_0x31acbb['error']['message']);return _0x5499e8(_0x31acbb[_0x4317('0x10')][_0x4317('0x12')]);}logger[_0x4317('0x10')]('SugarcrmAccount,\x20%s,\x20%s',_0x5daf4d,_0x31acbb[_0x4317('0x10')][_0x4317('0x12')]);return _0x177cc5(_0x31acbb[_0x4317('0x10')]['message']);}else{logger[_0x4317('0xb')](_0x4317('0xc'),_0x5daf4d,_0x4317('0xd'));_0x177cc5(_0x31acbb[_0x4317('0x13')][_0x4317('0x12')]);}})[_0x4317('0x14')](function(_0x2d6abc){logger[_0x4317('0x10')](_0x4317('0xc'),_0x5daf4d,_0x2d6abc);_0x5499e8(_0x2d6abc);});});}exports[_0x4317('0x15')]=function(_0x27d624){var _0x50c6aa=this;return new Promise(function(_0x543356,_0x172cf2){return db[_0x4317('0x16')][_0x4317('0x17')]({'raw':_0x27d624['options']?_0x27d624[_0x4317('0x18')][_0x4317('0x19')]===undefined?!![]:![]:!![],'where':_0x27d624[_0x4317('0x18')]?_0x27d624[_0x4317('0x18')][_0x4317('0x1a')]||null:null,'attributes':_0x27d624[_0x4317('0x18')]?_0x27d624[_0x4317('0x18')][_0x4317('0x1b')]||null:null,'limit':_0x27d624[_0x4317('0x18')]?_0x27d624['options'][_0x4317('0x1c')]||null:null,'include':_0x27d624[_0x4317('0x18')]?_0x27d624['options']['include']?_[_0x4317('0x1d')](_0x27d624['options'][_0x4317('0x1e')],function(_0x36f58a){return{'model':db[_0x36f58a[_0x4317('0x1f')]],'as':_0x36f58a['as'],'attributes':_0x36f58a[_0x4317('0x1b')],'include':_0x36f58a[_0x4317('0x1e')]?_[_0x4317('0x1d')](_0x36f58a[_0x4317('0x1e')],function(_0x1f8c3b){return{'model':db[_0x1f8c3b['model']],'as':_0x1f8c3b['as'],'attributes':_0x1f8c3b[_0x4317('0x1b')],'include':_0x1f8c3b['include']?_[_0x4317('0x1d')](_0x1f8c3b[_0x4317('0x1e')],function(_0x90f275){return{'model':db[_0x90f275[_0x4317('0x1f')]],'as':_0x90f275['as'],'attributes':_0x90f275[_0x4317('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x4317('0xa')](function(_0x130aa3){logger[_0x4317('0xb')](_0x4317('0x15'),_0x27d624);logger[_0x4317('0xe')]('GetSugarcrmAccount',_0x27d624,JSON[_0x4317('0xf')](_0x130aa3));_0x543356(_0x130aa3);})['catch'](function(_0x3d08a4){logger[_0x4317('0x10')](_0x4317('0x15'),_0x3d08a4[_0x4317('0x12')],_0x27d624);_0x172cf2(_0x50c6aa[_0x4317('0x10')](0x1f4,_0x3d08a4['message']));});});};exports[_0x4317('0x20')]=function(_0xe8e0e5){var _0x237fdb=this;return new Promise(function(_0x5f3f4f,_0x3537cf){return db[_0x4317('0x16')][_0x4317('0x21')]({'raw':_0xe8e0e5[_0x4317('0x18')]?_0xe8e0e5['options'][_0x4317('0x19')]===undefined?!![]:![]:!![],'where':_0xe8e0e5['options']?_0xe8e0e5['options'][_0x4317('0x1a')]||null:null,'attributes':_0xe8e0e5[_0x4317('0x18')]?_0xe8e0e5[_0x4317('0x18')]['attributes']||null:null,'include':_0xe8e0e5[_0x4317('0x18')]?_0xe8e0e5[_0x4317('0x18')][_0x4317('0x1e')]?_['map'](_0xe8e0e5['options'][_0x4317('0x1e')],function(_0x43518b){return{'model':db[_0x43518b[_0x4317('0x1f')]],'as':_0x43518b['as'],'attributes':_0x43518b[_0x4317('0x1b')],'include':_0x43518b[_0x4317('0x1e')]?_['map'](_0x43518b['include'],function(_0x1f51c3){return{'model':db[_0x1f51c3[_0x4317('0x1f')]],'as':_0x1f51c3['as'],'attributes':_0x1f51c3[_0x4317('0x1b')],'include':_0x1f51c3['include']?_[_0x4317('0x1d')](_0x1f51c3[_0x4317('0x1e')],function(_0x336656){return{'model':db[_0x336656[_0x4317('0x1f')]],'as':_0x336656['as'],'attributes':_0x336656[_0x4317('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x4317('0xa')](function(_0x5b9925){logger[_0x4317('0xb')](_0x4317('0x20'),_0xe8e0e5);logger['debug'](_0x4317('0x20'),_0xe8e0e5,JSON['stringify'](_0x5b9925));_0x5f3f4f(_0x5b9925);})[_0x4317('0x14')](function(_0x144cd3){logger['error'](_0x4317('0x20'),_0x144cd3[_0x4317('0x12')],_0xe8e0e5);_0x3537cf(_0x237fdb[_0x4317('0x10')](0x1f4,_0x144cd3[_0x4317('0x12')]));});});}; \ No newline at end of file +var _0xd3ff=['SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetSugarcrmAccount','findAll','options','raw','where','attributes','include','map','model','SugarcrmAccount','find','ShowSugarcrmAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','http','request','then','info'];(function(_0x1cce9f,_0x3ab40a){var _0xf44b90=function(_0x348f51){while(--_0x348f51){_0x1cce9f['push'](_0x1cce9f['shift']());}};_0xf44b90(++_0x3ab40a);}(_0xd3ff,0x1c6));var _0xfd3f=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xd3ff[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0xfd3f('0x0'));var util=require(_0xfd3f('0x1'));var moment=require(_0xfd3f('0x2'));var BPromise=require(_0xfd3f('0x3'));var rs=require(_0xfd3f('0x4'));var fs=require('fs');var Redis=require(_0xfd3f('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xfd3f('0x6'));var logger=require('../../config/logger')(_0xfd3f('0x7'));var config=require(_0xfd3f('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xfd3f('0x9')][_0xfd3f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x208da4,_0x288dc0,_0x75aead){return new BPromise(function(_0xe78721,_0xd98a59){return client[_0xfd3f('0xb')](_0x208da4,_0x75aead)[_0xfd3f('0xc')](function(_0x3e3bac){logger[_0xfd3f('0xd')](_0xfd3f('0xe'),_0x288dc0,_0xfd3f('0xf'));logger[_0xfd3f('0x10')](_0xfd3f('0x11'),_0x288dc0,_0xfd3f('0xf'),JSON[_0xfd3f('0x12')](_0x3e3bac));if(_0x3e3bac[_0xfd3f('0x13')]){if(_0x3e3bac['error'][_0xfd3f('0x14')]===0x1f4){logger[_0xfd3f('0x13')](_0xfd3f('0xe'),_0x288dc0,_0x3e3bac[_0xfd3f('0x13')][_0xfd3f('0x15')]);return _0xd98a59(_0x3e3bac['error'][_0xfd3f('0x15')]);}logger['error'](_0xfd3f('0xe'),_0x288dc0,_0x3e3bac[_0xfd3f('0x13')][_0xfd3f('0x15')]);return _0xe78721(_0x3e3bac[_0xfd3f('0x13')]['message']);}else{logger[_0xfd3f('0xd')](_0xfd3f('0xe'),_0x288dc0,_0xfd3f('0xf'));_0xe78721(_0x3e3bac[_0xfd3f('0x16')]['message']);}})[_0xfd3f('0x17')](function(_0x1cd9be){logger['error'](_0xfd3f('0xe'),_0x288dc0,_0x1cd9be);_0xd98a59(_0x1cd9be);});});}exports[_0xfd3f('0x18')]=function(_0x5afa83){var _0x366d95=this;return new Promise(function(_0x8e286e,_0x509587){return db['SugarcrmAccount'][_0xfd3f('0x19')]({'raw':_0x5afa83[_0xfd3f('0x1a')]?_0x5afa83[_0xfd3f('0x1a')][_0xfd3f('0x1b')]===undefined?!![]:![]:!![],'where':_0x5afa83[_0xfd3f('0x1a')]?_0x5afa83['options'][_0xfd3f('0x1c')]||null:null,'attributes':_0x5afa83[_0xfd3f('0x1a')]?_0x5afa83[_0xfd3f('0x1a')][_0xfd3f('0x1d')]||null:null,'limit':_0x5afa83[_0xfd3f('0x1a')]?_0x5afa83['options']['limit']||null:null,'include':_0x5afa83[_0xfd3f('0x1a')]?_0x5afa83[_0xfd3f('0x1a')][_0xfd3f('0x1e')]?_[_0xfd3f('0x1f')](_0x5afa83[_0xfd3f('0x1a')][_0xfd3f('0x1e')],function(_0x35f759){return{'model':db[_0x35f759['model']],'as':_0x35f759['as'],'attributes':_0x35f759['attributes'],'include':_0x35f759[_0xfd3f('0x1e')]?_[_0xfd3f('0x1f')](_0x35f759[_0xfd3f('0x1e')],function(_0x1736c3){return{'model':db[_0x1736c3[_0xfd3f('0x20')]],'as':_0x1736c3['as'],'attributes':_0x1736c3['attributes'],'include':_0x1736c3['include']?_[_0xfd3f('0x1f')](_0x1736c3[_0xfd3f('0x1e')],function(_0x20c17d){return{'model':db[_0x20c17d[_0xfd3f('0x20')]],'as':_0x20c17d['as'],'attributes':_0x20c17d[_0xfd3f('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xfd3f('0xc')](function(_0x480d29){logger[_0xfd3f('0xd')](_0xfd3f('0x18'),_0x5afa83);logger['debug'](_0xfd3f('0x18'),_0x5afa83,JSON[_0xfd3f('0x12')](_0x480d29));_0x8e286e(_0x480d29);})[_0xfd3f('0x17')](function(_0x323284){logger[_0xfd3f('0x13')](_0xfd3f('0x18'),_0x323284[_0xfd3f('0x15')],_0x5afa83);_0x509587(_0x366d95['error'](0x1f4,_0x323284[_0xfd3f('0x15')]));});});};exports['ShowSugarcrmAccount']=function(_0x5207a){var _0xcf3fdc=this;return new Promise(function(_0x286898,_0x508263){return db[_0xfd3f('0x21')][_0xfd3f('0x22')]({'raw':_0x5207a['options']?_0x5207a[_0xfd3f('0x1a')][_0xfd3f('0x1b')]===undefined?!![]:![]:!![],'where':_0x5207a[_0xfd3f('0x1a')]?_0x5207a[_0xfd3f('0x1a')]['where']||null:null,'attributes':_0x5207a[_0xfd3f('0x1a')]?_0x5207a[_0xfd3f('0x1a')][_0xfd3f('0x1d')]||null:null,'include':_0x5207a[_0xfd3f('0x1a')]?_0x5207a[_0xfd3f('0x1a')][_0xfd3f('0x1e')]?_[_0xfd3f('0x1f')](_0x5207a[_0xfd3f('0x1a')][_0xfd3f('0x1e')],function(_0x4c483a){return{'model':db[_0x4c483a['model']],'as':_0x4c483a['as'],'attributes':_0x4c483a[_0xfd3f('0x1d')],'include':_0x4c483a[_0xfd3f('0x1e')]?_[_0xfd3f('0x1f')](_0x4c483a[_0xfd3f('0x1e')],function(_0x381ad8){return{'model':db[_0x381ad8[_0xfd3f('0x20')]],'as':_0x381ad8['as'],'attributes':_0x381ad8[_0xfd3f('0x1d')],'include':_0x381ad8[_0xfd3f('0x1e')]?_[_0xfd3f('0x1f')](_0x381ad8[_0xfd3f('0x1e')],function(_0xb12055){return{'model':db[_0xb12055[_0xfd3f('0x20')]],'as':_0xb12055['as'],'attributes':_0xb12055[_0xfd3f('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xefb8e6){logger[_0xfd3f('0xd')](_0xfd3f('0x23'),_0x5207a);logger[_0xfd3f('0x10')](_0xfd3f('0x23'),_0x5207a,JSON['stringify'](_0xefb8e6));_0x286898(_0xefb8e6);})['catch'](function(_0x541460){logger['error']('ShowSugarcrmAccount',_0x541460['message'],_0x5207a);_0x508263(_0xcf3fdc[_0xfd3f('0x13')](0x1f4,_0x541460[_0xfd3f('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index a0979f0..02e2363 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 _0x8442=['show','getFields','getSubjects','getDescriptions','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','get','isAuthenticated','index','/:id'];(function(_0x429a51,_0x56ee7f){var _0x1071cf=function(_0x1a7665){while(--_0x1a7665){_0x429a51['push'](_0x429a51['shift']());}};_0x1071cf(++_0x56ee7f);}(_0x8442,0x168));var _0x2844=function(_0xd7b39c,_0x3fc443){_0xd7b39c=_0xd7b39c-0x0;var _0x36530e=_0x8442[_0xd7b39c];return _0x36530e;};'use strict';var multer=require(_0x2844('0x0'));var util=require(_0x2844('0x1'));var path=require(_0x2844('0x2'));var timeout=require(_0x2844('0x3'));var express=require(_0x2844('0x4'));var router=express[_0x2844('0x5')]();var fs_extra=require(_0x2844('0x6'));var auth=require(_0x2844('0x7'));var interaction=require(_0x2844('0x8'));var config=require(_0x2844('0x9'));var controller=require(_0x2844('0xa'));router[_0x2844('0xb')]('/',auth[_0x2844('0xc')](),controller[_0x2844('0xd')]);router[_0x2844('0xb')](_0x2844('0xe'),auth[_0x2844('0xc')](),controller[_0x2844('0xf')]);router[_0x2844('0xb')]('/:id/fields',auth['isAuthenticated'](),controller[_0x2844('0x10')]);router[_0x2844('0xb')]('/:id/subjects',auth[_0x2844('0xc')](),controller[_0x2844('0x11')]);router['get']('/:id/descriptions',auth['isAuthenticated'](),controller[_0x2844('0x12')]);router['post']('/',auth['isAuthenticated'](),controller[_0x2844('0x13')]);router[_0x2844('0x14')](_0x2844('0xe'),auth[_0x2844('0xc')](),controller[_0x2844('0x15')]);router[_0x2844('0x16')](_0x2844('0xe'),auth[_0x2844('0xc')](),controller[_0x2844('0x17')]);module[_0x2844('0x18')]=router; \ No newline at end of file +var _0x9ad5=['/:id/fields','/:id/subjects','getSubjects','getDescriptions','post','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','show'];(function(_0x2d6efa,_0xfe2ec7){var _0x56254b=function(_0x67a30b){while(--_0x67a30b){_0x2d6efa['push'](_0x2d6efa['shift']());}};_0x56254b(++_0xfe2ec7);}(_0x9ad5,0x1eb));var _0x59ad=function(_0x5ec6c1,_0x41c040){_0x5ec6c1=_0x5ec6c1-0x0;var _0xa3a9e0=_0x9ad5[_0x5ec6c1];return _0xa3a9e0;};'use strict';var multer=require(_0x59ad('0x0'));var util=require(_0x59ad('0x1'));var path=require(_0x59ad('0x2'));var timeout=require(_0x59ad('0x3'));var express=require(_0x59ad('0x4'));var router=express[_0x59ad('0x5')]();var fs_extra=require(_0x59ad('0x6'));var auth=require(_0x59ad('0x7'));var interaction=require(_0x59ad('0x8'));var config=require('../../config/environment');var controller=require('./intSugarcrmConfiguration.controller');router[_0x59ad('0x9')]('/',auth[_0x59ad('0xa')](),controller[_0x59ad('0xb')]);router['get']('/:id',auth[_0x59ad('0xa')](),controller[_0x59ad('0xc')]);router[_0x59ad('0x9')](_0x59ad('0xd'),auth[_0x59ad('0xa')](),controller['getFields']);router[_0x59ad('0x9')](_0x59ad('0xe'),auth['isAuthenticated'](),controller[_0x59ad('0xf')]);router[_0x59ad('0x9')]('/:id/descriptions',auth[_0x59ad('0xa')](),controller[_0x59ad('0x10')]);router[_0x59ad('0x11')]('/',auth[_0x59ad('0xa')](),controller['create']);router[_0x59ad('0x12')](_0x59ad('0x13'),auth[_0x59ad('0xa')](),controller[_0x59ad('0x14')]);router[_0x59ad('0x15')](_0x59ad('0x13'),auth['isAuthenticated'](),controller[_0x59ad('0x16')]);module[_0x59ad('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 8d935e7..8205bb1 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 _0x0a23=['STRING'];(function(_0x4587c1,_0x4a401a){var _0x5051ad=function(_0x1de3c2){while(--_0x1de3c2){_0x4587c1['push'](_0x4587c1['shift']());}};_0x5051ad(++_0x4a401a);}(_0x0a23,0xb2));var _0x30a2=function(_0x5881eb,_0x31be1f){_0x5881eb=_0x5881eb-0x0;var _0x4042ab=_0x0a23[_0x5881eb];return _0x4042ab;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x30a2('0x0')]},'description':{'type':Sequelize[_0x30a2('0x0')]}}; \ No newline at end of file +var _0xfc7c=['exports','STRING'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xfc7c,0x1ba));var _0xcfc7=function(_0x4e9a0f,_0x57bf71){_0x4e9a0f=_0x4e9a0f-0x0;var _0x2066b0=_0xfc7c[_0x4e9a0f];return _0x2066b0;};'use strict';var Sequelize=require('sequelize');module[_0xcfc7('0x0')]={'name':{'type':Sequelize[_0xcfc7('0x1')]},'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 d5761c4..8073272 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 _0x515a=['key','map','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','then','catch','show','params','keys','find','create','body','findOne','getFields','SugarcrmField','getSubjects','getDescriptions','rawAttributes','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','undefined','count','offset','limit','Content-Range','json','apply','reject','save','update','destroy','sendStatus','name','send','SugarcrmConfiguration','fieldName','type'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x515a,0x171));var _0xa515=function(_0x41381f,_0x5b9893){_0x41381f=_0x41381f-0x0;var _0x33a44a=_0x515a[_0x41381f];return _0x33a44a;};'use strict';var emlformat=require(_0xa515('0x0'));var rimraf=require(_0xa515('0x1'));var zipdir=require(_0xa515('0x2'));var jsonpatch=require(_0xa515('0x3'));var rp=require(_0xa515('0x4'));var moment=require(_0xa515('0x5'));var BPromise=require(_0xa515('0x6'));var Mustache=require(_0xa515('0x7'));var util=require('util');var path=require('path');var sox=require(_0xa515('0x8'));var csv=require(_0xa515('0x9'));var ejs=require(_0xa515('0xa'));var fs=require('fs');var fs_extra=require(_0xa515('0xb'));var _=require(_0xa515('0xc'));var squel=require(_0xa515('0xd'));var crypto=require(_0xa515('0xe'));var jsforce=require(_0xa515('0xf'));var deskjs=require(_0xa515('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xa515('0x11'));var Redis=require(_0xa515('0x12'));var authService=require(_0xa515('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xa515('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa515('0x15'))(_0xa515('0x16'));var utils=require(_0xa515('0x17'));var config=require(_0xa515('0x18'));var licenseUtil=require(_0xa515('0x19'));var db=require(_0xa515('0x1a'))['db'];function respondWithStatusCode(_0x2af738,_0x5c3e4f){_0x5c3e4f=_0x5c3e4f||0xcc;return function(_0x10d6d7){if(_0x10d6d7){return _0x2af738['sendStatus'](_0x5c3e4f);}return _0x2af738[_0xa515('0x1b')](_0x5c3e4f)[_0xa515('0x1c')]();};}function respondWithResult(_0x1d7448,_0x1a11bc){_0x1a11bc=_0x1a11bc||0xc8;return function(_0x557304){if(_0x557304){return _0x1d7448[_0xa515('0x1b')](_0x1a11bc)['json'](_0x557304);}};}function respondWithFilteredResult(_0x38c4e5,_0x13d2f1){return function(_0x273b1e){if(_0x273b1e){var _0x197bb4=typeof _0x13d2f1['offset']===_0xa515('0x1d')&&typeof _0x13d2f1['limit']==='undefined';var _0x1b898e=_0x273b1e[_0xa515('0x1e')];var _0xda098e=_0x197bb4?0x0:_0x13d2f1[_0xa515('0x1f')];var _0x32bc3c=_0x197bb4?_0x273b1e[_0xa515('0x1e')]:_0x13d2f1[_0xa515('0x1f')]+_0x13d2f1[_0xa515('0x20')];var _0x4342d4;if(_0x32bc3c>=_0x1b898e){_0x32bc3c=_0x1b898e;_0x4342d4=0xc8;}else{_0x4342d4=0xce;}_0x38c4e5['status'](_0x4342d4);return _0x38c4e5['set'](_0xa515('0x21'),_0xda098e+'-'+_0x32bc3c+'/'+_0x1b898e)[_0xa515('0x22')](_0x273b1e);}return null;};}function patchUpdates(_0x3bedd2){return function(_0x203137){try{jsonpatch[_0xa515('0x23')](_0x203137,_0x3bedd2,!![]);}catch(_0x551d24){return BPromise[_0xa515('0x24')](_0x551d24);}return _0x203137[_0xa515('0x25')]();};}function saveUpdates(_0x5962cf,_0x5d26bd){return function(_0x24318c){if(_0x24318c){return _0x24318c[_0xa515('0x26')](_0x5962cf)['then'](function(_0x537785){return _0x537785;});}return null;};}function removeEntity(_0x56088a,_0x4e0b64){return function(_0x3396c9){if(_0x3396c9){return _0x3396c9[_0xa515('0x27')]()['then'](function(){_0x56088a[_0xa515('0x1b')](0xcc)[_0xa515('0x1c')]();});}};}function handleEntityNotFound(_0x1f14e5,_0xd5e302){return function(_0x1c7c01){if(!_0x1c7c01){_0x1f14e5[_0xa515('0x28')](0x194);}return _0x1c7c01;};}function handleError(_0x4a6573,_0x280ac9){_0x280ac9=_0x280ac9||0x1f4;return function(_0x33dfbb){logger['error'](_0x33dfbb['stack']);if(_0x33dfbb[_0xa515('0x29')]){delete _0x33dfbb[_0xa515('0x29')];}_0x4a6573[_0xa515('0x1b')](_0x280ac9)[_0xa515('0x2a')](_0x33dfbb);};}exports['index']=function(_0x5ab0ee,_0x2a990a){var _0x3551aa={},_0x3c7555={},_0x5acd1a={'count':0x0,'rows':[]};var _0x1364e1=_['map'](db[_0xa515('0x2b')]['rawAttributes'],function(_0x13e3e9){return{'name':_0x13e3e9[_0xa515('0x2c')],'type':_0x13e3e9[_0xa515('0x2d')][_0xa515('0x2e')]};});_0x3c7555['model']=_[_0xa515('0x2f')](_0x1364e1,_0xa515('0x29'));_0x3c7555[_0xa515('0x30')]=_['keys'](_0x5ab0ee['query']);_0x3c7555['filters']=_[_0xa515('0x31')](_0x3c7555[_0xa515('0x32')],_0x3c7555['query']);_0x3551aa[_0xa515('0x33')]=_[_0xa515('0x31')](_0x3c7555['model'],qs[_0xa515('0x34')](_0x5ab0ee[_0xa515('0x30')]['fields']));_0x3551aa[_0xa515('0x33')]=_0x3551aa['attributes'][_0xa515('0x35')]?_0x3551aa[_0xa515('0x33')]:_0x3c7555[_0xa515('0x32')];if(!_0x5ab0ee[_0xa515('0x30')][_0xa515('0x36')](_0xa515('0x37'))){_0x3551aa[_0xa515('0x20')]=qs[_0xa515('0x20')](_0x5ab0ee[_0xa515('0x30')][_0xa515('0x20')]);_0x3551aa[_0xa515('0x1f')]=qs[_0xa515('0x1f')](_0x5ab0ee[_0xa515('0x30')]['offset']);}_0x3551aa[_0xa515('0x38')]=qs[_0xa515('0x39')](_0x5ab0ee[_0xa515('0x30')]['sort']);_0x3551aa[_0xa515('0x3a')]=qs[_0xa515('0x3b')](_[_0xa515('0x3c')](_0x5ab0ee['query'],_0x3c7555[_0xa515('0x3b')]),_0x1364e1);if(_0x5ab0ee[_0xa515('0x30')][_0xa515('0x3d')]){_0x3551aa[_0xa515('0x3a')]=_[_0xa515('0x3e')](_0x3551aa[_0xa515('0x3a')],{'$or':_[_0xa515('0x2f')](_0x1364e1,function(_0x3b111c){if(_0x3b111c[_0xa515('0x2d')]!==_0xa515('0x3f')){var _0x2b4282={};_0x2b4282[_0x3b111c[_0xa515('0x29')]]={'$like':'%'+_0x5ab0ee[_0xa515('0x30')][_0xa515('0x3d')]+'%'};return _0x2b4282;}})});}_0x3551aa=_[_0xa515('0x3e')]({},_0x3551aa,_0x5ab0ee[_0xa515('0x40')]);var _0x1fcdfb={'where':_0x3551aa[_0xa515('0x3a')]};return db[_0xa515('0x2b')][_0xa515('0x1e')](_0x1fcdfb)['then'](function(_0x4d8183){_0x5acd1a[_0xa515('0x1e')]=_0x4d8183;if(_0x5ab0ee[_0xa515('0x30')][_0xa515('0x41')]){_0x3551aa[_0xa515('0x42')]=[{'all':!![]}];}return db[_0xa515('0x2b')][_0xa515('0x43')](_0x3551aa);})['then'](function(_0x14e8fe){_0x5acd1a[_0xa515('0x44')]=_0x14e8fe;return _0x5acd1a;})[_0xa515('0x45')](respondWithFilteredResult(_0x2a990a,_0x3551aa))[_0xa515('0x46')](handleError(_0x2a990a,null));};exports[_0xa515('0x47')]=function(_0x142c94,_0xd880fc){var _0x216c0f={'raw':![],'where':{'id':_0x142c94[_0xa515('0x48')]['id']}},_0x557965={};_0x557965['model']=_[_0xa515('0x49')](db[_0xa515('0x2b')]['rawAttributes']);_0x557965[_0xa515('0x30')]=_[_0xa515('0x49')](_0x142c94['query']);_0x557965['filters']=_[_0xa515('0x31')](_0x557965[_0xa515('0x32')],_0x557965[_0xa515('0x30')]);_0x216c0f[_0xa515('0x33')]=_[_0xa515('0x31')](_0x557965[_0xa515('0x32')],qs[_0xa515('0x34')](_0x142c94[_0xa515('0x30')]['fields']));_0x216c0f[_0xa515('0x33')]=_0x216c0f[_0xa515('0x33')][_0xa515('0x35')]?_0x216c0f['attributes']:_0x557965['model'];if(_0x142c94[_0xa515('0x30')][_0xa515('0x41')]){_0x216c0f[_0xa515('0x42')]=[{'all':!![]}];}_0x216c0f=_['merge']({},_0x216c0f,_0x142c94[_0xa515('0x40')]);return db[_0xa515('0x2b')][_0xa515('0x4a')](_0x216c0f)[_0xa515('0x45')](handleEntityNotFound(_0xd880fc,null))[_0xa515('0x45')](respondWithResult(_0xd880fc,null))['catch'](handleError(_0xd880fc,null));};exports[_0xa515('0x4b')]=function(_0x47af7d,_0x5e2302){return db[_0xa515('0x2b')][_0xa515('0x4b')](_0x47af7d[_0xa515('0x4c')],{})[_0xa515('0x45')](respondWithResult(_0x5e2302,0xc9))['catch'](handleError(_0x5e2302,null));};exports[_0xa515('0x26')]=function(_0xd58763,_0x523ca4){if(_0xd58763[_0xa515('0x4c')]['id']){delete _0xd58763[_0xa515('0x4c')]['id'];}return db[_0xa515('0x2b')][_0xa515('0x4a')]({'where':{'id':_0xd58763[_0xa515('0x48')]['id']}})[_0xa515('0x45')](handleEntityNotFound(_0x523ca4,null))[_0xa515('0x45')](saveUpdates(_0xd58763[_0xa515('0x4c')],null))[_0xa515('0x45')](respondWithResult(_0x523ca4,null))[_0xa515('0x46')](handleError(_0x523ca4,null));};exports[_0xa515('0x27')]=function(_0x5a1fd6,_0x58ddcc){return db[_0xa515('0x2b')][_0xa515('0x4a')]({'where':{'id':_0x5a1fd6[_0xa515('0x48')]['id']}})[_0xa515('0x45')](handleEntityNotFound(_0x58ddcc,null))[_0xa515('0x45')](removeEntity(_0x58ddcc,null))[_0xa515('0x46')](handleError(_0x58ddcc,null));};exports['getFields']=function(_0x184941,_0x1948a6,_0x4fef7a){var _0x22c3ec={};var _0x4b43f7={};var _0x3d9f7d;var _0x3d2b89;return db[_0xa515('0x2b')][_0xa515('0x4d')]({'where':{'id':_0x184941['params']['id']}})[_0xa515('0x45')](handleEntityNotFound(_0x1948a6,null))[_0xa515('0x45')](function(_0x3b477f){if(_0x3b477f){_0x3d9f7d=_0x3b477f;_0x4b43f7[_0xa515('0x32')]=_['keys'](db['SugarcrmField']['rawAttributes']);_0x4b43f7[_0xa515('0x30')]=_[_0xa515('0x49')](_0x184941[_0xa515('0x30')]);_0x4b43f7['filters']=_[_0xa515('0x31')](_0x4b43f7[_0xa515('0x32')],_0x4b43f7[_0xa515('0x30')]);_0x22c3ec[_0xa515('0x33')]=_[_0xa515('0x31')](_0x4b43f7[_0xa515('0x32')],qs[_0xa515('0x34')](_0x184941[_0xa515('0x30')][_0xa515('0x34')]));_0x22c3ec['attributes']=_0x22c3ec['attributes'][_0xa515('0x35')]?_0x22c3ec[_0xa515('0x33')]:_0x4b43f7[_0xa515('0x32')];_0x22c3ec['order']=qs[_0xa515('0x39')](_0x184941[_0xa515('0x30')][_0xa515('0x39')]);_0x22c3ec[_0xa515('0x3a')]=qs[_0xa515('0x3b')](_[_0xa515('0x3c')](_0x184941['query'],_0x4b43f7[_0xa515('0x3b')]));if(_0x184941[_0xa515('0x30')][_0xa515('0x3d')]){_0x22c3ec['where']=_[_0xa515('0x3e')](_0x22c3ec[_0xa515('0x3a')],{'$or':_['map'](_0x22c3ec['attributes'],function(_0x55b653){var _0x48957d={};_0x48957d[_0x55b653]={'$like':'%'+_0x184941[_0xa515('0x30')][_0xa515('0x3d')]+'%'};return _0x48957d;})});}_0x22c3ec=_[_0xa515('0x3e')]({},_0x22c3ec,_0x184941[_0xa515('0x40')]);return _0x3d9f7d['getFields'](_0x22c3ec);}})[_0xa515('0x45')](function(_0x504e29){if(_0x504e29){_0x3d2b89=_0x504e29[_0xa515('0x35')];if(!_0x184941['query'][_0xa515('0x36')]('nolimit')){_0x22c3ec['limit']=qs['limit'](_0x184941['query'][_0xa515('0x20')]);_0x22c3ec[_0xa515('0x1f')]=qs[_0xa515('0x1f')](_0x184941['query'][_0xa515('0x1f')]);}return _0x3d9f7d[_0xa515('0x4e')](_0x22c3ec);}})[_0xa515('0x45')](function(_0xda7d2f){if(_0xda7d2f){return _0xda7d2f?{'count':_0x3d2b89,'rows':_0xda7d2f}:null;}})['then'](respondWithResult(_0x1948a6,null))[_0xa515('0x46')](handleError(_0x1948a6,null));};exports['getSubjects']=function(_0x211272,_0x1c9e9c,_0x5764ec){var _0x4c15e9={};var _0x4aab2f={};var _0x25ce01;var _0x420fc8;return db[_0xa515('0x2b')][_0xa515('0x4d')]({'where':{'id':_0x211272[_0xa515('0x48')]['id']}})[_0xa515('0x45')](handleEntityNotFound(_0x1c9e9c,null))['then'](function(_0x19472a){if(_0x19472a){_0x25ce01=_0x19472a;_0x4aab2f[_0xa515('0x32')]=_['keys'](db[_0xa515('0x4f')]['rawAttributes']);_0x4aab2f['query']=_[_0xa515('0x49')](_0x211272[_0xa515('0x30')]);_0x4aab2f['filters']=_[_0xa515('0x31')](_0x4aab2f[_0xa515('0x32')],_0x4aab2f['query']);_0x4c15e9['attributes']=_['intersection'](_0x4aab2f[_0xa515('0x32')],qs[_0xa515('0x34')](_0x211272[_0xa515('0x30')][_0xa515('0x34')]));_0x4c15e9['attributes']=_0x4c15e9[_0xa515('0x33')][_0xa515('0x35')]?_0x4c15e9[_0xa515('0x33')]:_0x4aab2f[_0xa515('0x32')];_0x4c15e9[_0xa515('0x38')]=qs[_0xa515('0x39')](_0x211272[_0xa515('0x30')][_0xa515('0x39')]);_0x4c15e9[_0xa515('0x3a')]=qs['filters'](_[_0xa515('0x3c')](_0x211272[_0xa515('0x30')],_0x4aab2f[_0xa515('0x3b')]));if(_0x211272[_0xa515('0x30')][_0xa515('0x3d')]){_0x4c15e9[_0xa515('0x3a')]=_['merge'](_0x4c15e9[_0xa515('0x3a')],{'$or':_[_0xa515('0x2f')](_0x4c15e9[_0xa515('0x33')],function(_0x3e3656){var _0x209ec8={};_0x209ec8[_0x3e3656]={'$like':'%'+_0x211272[_0xa515('0x30')][_0xa515('0x3d')]+'%'};return _0x209ec8;})});}_0x4c15e9=_[_0xa515('0x3e')]({},_0x4c15e9,_0x211272[_0xa515('0x40')]);return _0x25ce01[_0xa515('0x50')](_0x4c15e9);}})[_0xa515('0x45')](function(_0x343c0a){if(_0x343c0a){_0x420fc8=_0x343c0a[_0xa515('0x35')];if(!_0x211272[_0xa515('0x30')]['hasOwnProperty']('nolimit')){_0x4c15e9[_0xa515('0x20')]=qs['limit'](_0x211272[_0xa515('0x30')]['limit']);_0x4c15e9[_0xa515('0x1f')]=qs[_0xa515('0x1f')](_0x211272[_0xa515('0x30')][_0xa515('0x1f')]);}return _0x25ce01[_0xa515('0x50')](_0x4c15e9);}})['then'](function(_0x68d9ad){if(_0x68d9ad){return _0x68d9ad?{'count':_0x420fc8,'rows':_0x68d9ad}:null;}})[_0xa515('0x45')](respondWithResult(_0x1c9e9c,null))[_0xa515('0x46')](handleError(_0x1c9e9c,null));};exports[_0xa515('0x51')]=function(_0x2d8615,_0x23c793,_0x1d07b6){var _0x433ded={};var _0x5632e0={};var _0x1dc926;var _0x157377;return db['SugarcrmConfiguration'][_0xa515('0x4d')]({'where':{'id':_0x2d8615[_0xa515('0x48')]['id']}})[_0xa515('0x45')](handleEntityNotFound(_0x23c793,null))[_0xa515('0x45')](function(_0x46ac54){if(_0x46ac54){_0x1dc926=_0x46ac54;_0x5632e0[_0xa515('0x32')]=_['keys'](db[_0xa515('0x4f')][_0xa515('0x52')]);_0x5632e0[_0xa515('0x30')]=_[_0xa515('0x49')](_0x2d8615[_0xa515('0x30')]);_0x5632e0['filters']=_['intersection'](_0x5632e0[_0xa515('0x32')],_0x5632e0[_0xa515('0x30')]);_0x433ded[_0xa515('0x33')]=_['intersection'](_0x5632e0[_0xa515('0x32')],qs[_0xa515('0x34')](_0x2d8615['query'][_0xa515('0x34')]));_0x433ded[_0xa515('0x33')]=_0x433ded[_0xa515('0x33')][_0xa515('0x35')]?_0x433ded[_0xa515('0x33')]:_0x5632e0[_0xa515('0x32')];_0x433ded[_0xa515('0x38')]=qs[_0xa515('0x39')](_0x2d8615[_0xa515('0x30')]['sort']);_0x433ded[_0xa515('0x3a')]=qs[_0xa515('0x3b')](_['pick'](_0x2d8615[_0xa515('0x30')],_0x5632e0[_0xa515('0x3b')]));if(_0x2d8615[_0xa515('0x30')][_0xa515('0x3d')]){_0x433ded[_0xa515('0x3a')]=_[_0xa515('0x3e')](_0x433ded['where'],{'$or':_['map'](_0x433ded[_0xa515('0x33')],function(_0x4a2cb7){var _0x22f6df={};_0x22f6df[_0x4a2cb7]={'$like':'%'+_0x2d8615[_0xa515('0x30')][_0xa515('0x3d')]+'%'};return _0x22f6df;})});}_0x433ded=_[_0xa515('0x3e')]({},_0x433ded,_0x2d8615[_0xa515('0x40')]);return _0x1dc926[_0xa515('0x51')](_0x433ded);}})[_0xa515('0x45')](function(_0x51cc06){if(_0x51cc06){_0x157377=_0x51cc06[_0xa515('0x35')];if(!_0x2d8615[_0xa515('0x30')][_0xa515('0x36')](_0xa515('0x37'))){_0x433ded[_0xa515('0x20')]=qs[_0xa515('0x20')](_0x2d8615[_0xa515('0x30')]['limit']);_0x433ded[_0xa515('0x1f')]=qs['offset'](_0x2d8615['query'][_0xa515('0x1f')]);}return _0x1dc926[_0xa515('0x51')](_0x433ded);}})[_0xa515('0x45')](function(_0x2ce8af){if(_0x2ce8af){return _0x2ce8af?{'count':_0x157377,'rows':_0x2ce8af}:null;}})[_0xa515('0x45')](respondWithResult(_0x23c793,null))[_0xa515('0x46')](handleError(_0x23c793,null));}; \ No newline at end of file +var _0x2b14=['filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filter','merge','type','VIRTUAL','includeAll','include','show','params','options','find','create','catch','body','getFields','findOne','SugarcrmField','pick','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','request-promise','moment','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','undefined','limit','count','offset','save','update','destroy','then','end','stack','name','send','map','SugarcrmConfiguration','rawAttributes','fieldName','key','model','keys','query'];(function(_0x75ce5b,_0x3b582f){var _0x22195e=function(_0x166668){while(--_0x166668){_0x75ce5b['push'](_0x75ce5b['shift']());}};_0x22195e(++_0x3b582f);}(_0x2b14,0xb2));var _0x42b1=function(_0x4f842f,_0x966fc7){_0x4f842f=_0x4f842f-0x0;var _0x281549=_0x2b14[_0x4f842f];return _0x281549;};'use strict';var emlformat=require(_0x42b1('0x0'));var rimraf=require(_0x42b1('0x1'));var zipdir=require(_0x42b1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x42b1('0x3'));var moment=require(_0x42b1('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x42b1('0x5'));var util=require('util');var path=require(_0x42b1('0x6'));var sox=require('sox');var csv=require(_0x42b1('0x7'));var ejs=require(_0x42b1('0x8'));var fs=require('fs');var fs_extra=require(_0x42b1('0x9'));var _=require(_0x42b1('0xa'));var squel=require(_0x42b1('0xb'));var crypto=require(_0x42b1('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x42b1('0xd'));var toCsv=require(_0x42b1('0x7'));var querystring=require(_0x42b1('0xe'));var Papa=require(_0x42b1('0xf'));var Redis=require('ioredis');var authService=require(_0x42b1('0x10'));var qs=require(_0x42b1('0x11'));var as=require(_0x42b1('0x12'));var hardwareService=require(_0x42b1('0x13'));var logger=require(_0x42b1('0x14'))('api');var utils=require(_0x42b1('0x15'));var config=require(_0x42b1('0x16'));var licenseUtil=require(_0x42b1('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x27a942,_0x402573){_0x402573=_0x402573||0xcc;return function(_0x15d8d1){if(_0x15d8d1){return _0x27a942[_0x42b1('0x18')](_0x402573);}return _0x27a942[_0x42b1('0x19')](_0x402573)['end']();};}function respondWithResult(_0x436328,_0xe97f8a){_0xe97f8a=_0xe97f8a||0xc8;return function(_0x54e288){if(_0x54e288){return _0x436328[_0x42b1('0x19')](_0xe97f8a)[_0x42b1('0x1a')](_0x54e288);}};}function respondWithFilteredResult(_0x5827ae,_0x44631c){return function(_0x4ca154){if(_0x4ca154){var _0x4e240a=typeof _0x44631c['offset']===_0x42b1('0x1b')&&typeof _0x44631c[_0x42b1('0x1c')]===_0x42b1('0x1b');var _0x36a043=_0x4ca154[_0x42b1('0x1d')];var _0x2d3421=_0x4e240a?0x0:_0x44631c['offset'];var _0x17171d=_0x4e240a?_0x4ca154[_0x42b1('0x1d')]:_0x44631c[_0x42b1('0x1e')]+_0x44631c[_0x42b1('0x1c')];var _0x26f778;if(_0x17171d>=_0x36a043){_0x17171d=_0x36a043;_0x26f778=0xc8;}else{_0x26f778=0xce;}_0x5827ae['status'](_0x26f778);return _0x5827ae['set']('Content-Range',_0x2d3421+'-'+_0x17171d+'/'+_0x36a043)[_0x42b1('0x1a')](_0x4ca154);}return null;};}function patchUpdates(_0x16808d){return function(_0x5cd0c8){try{jsonpatch['apply'](_0x5cd0c8,_0x16808d,!![]);}catch(_0x1eaf06){return BPromise['reject'](_0x1eaf06);}return _0x5cd0c8[_0x42b1('0x1f')]();};}function saveUpdates(_0x45c697,_0x24e9ff){return function(_0x113a6a){if(_0x113a6a){return _0x113a6a[_0x42b1('0x20')](_0x45c697)['then'](function(_0x377a39){return _0x377a39;});}return null;};}function removeEntity(_0x359637,_0x3c5c8d){return function(_0x1b0389){if(_0x1b0389){return _0x1b0389[_0x42b1('0x21')]()[_0x42b1('0x22')](function(){_0x359637[_0x42b1('0x19')](0xcc)[_0x42b1('0x23')]();});}};}function handleEntityNotFound(_0x59e4ed,_0x53e7b1){return function(_0x27a2db){if(!_0x27a2db){_0x59e4ed[_0x42b1('0x18')](0x194);}return _0x27a2db;};}function handleError(_0x599486,_0xb9acf7){_0xb9acf7=_0xb9acf7||0x1f4;return function(_0x1c4444){logger['error'](_0x1c4444[_0x42b1('0x24')]);if(_0x1c4444[_0x42b1('0x25')]){delete _0x1c4444['name'];}_0x599486['status'](_0xb9acf7)[_0x42b1('0x26')](_0x1c4444);};}exports['index']=function(_0x3d958c,_0x5a51f0){var _0x4389e6={},_0xc932b1={},_0x356c06={'count':0x0,'rows':[]};var _0x50b69d=_[_0x42b1('0x27')](db[_0x42b1('0x28')][_0x42b1('0x29')],function(_0x4c8112){return{'name':_0x4c8112[_0x42b1('0x2a')],'type':_0x4c8112['type'][_0x42b1('0x2b')]};});_0xc932b1[_0x42b1('0x2c')]=_[_0x42b1('0x27')](_0x50b69d,'name');_0xc932b1['query']=_[_0x42b1('0x2d')](_0x3d958c[_0x42b1('0x2e')]);_0xc932b1[_0x42b1('0x2f')]=_['intersection'](_0xc932b1[_0x42b1('0x2c')],_0xc932b1['query']);_0x4389e6[_0x42b1('0x30')]=_[_0x42b1('0x31')](_0xc932b1[_0x42b1('0x2c')],qs[_0x42b1('0x32')](_0x3d958c[_0x42b1('0x2e')][_0x42b1('0x32')]));_0x4389e6[_0x42b1('0x30')]=_0x4389e6[_0x42b1('0x30')][_0x42b1('0x33')]?_0x4389e6[_0x42b1('0x30')]:_0xc932b1['model'];if(!_0x3d958c[_0x42b1('0x2e')][_0x42b1('0x34')]('nolimit')){_0x4389e6['limit']=qs[_0x42b1('0x1c')](_0x3d958c['query'][_0x42b1('0x1c')]);_0x4389e6[_0x42b1('0x1e')]=qs[_0x42b1('0x1e')](_0x3d958c[_0x42b1('0x2e')][_0x42b1('0x1e')]);}_0x4389e6[_0x42b1('0x35')]=qs[_0x42b1('0x36')](_0x3d958c[_0x42b1('0x2e')][_0x42b1('0x36')]);_0x4389e6[_0x42b1('0x37')]=qs['filters'](_['pick'](_0x3d958c[_0x42b1('0x2e')],_0xc932b1[_0x42b1('0x2f')]),_0x50b69d);if(_0x3d958c[_0x42b1('0x2e')][_0x42b1('0x38')]){_0x4389e6['where']=_[_0x42b1('0x39')](_0x4389e6[_0x42b1('0x37')],{'$or':_[_0x42b1('0x27')](_0x50b69d,function(_0x448468){if(_0x448468[_0x42b1('0x3a')]!==_0x42b1('0x3b')){var _0x34f354={};_0x34f354[_0x448468[_0x42b1('0x25')]]={'$like':'%'+_0x3d958c[_0x42b1('0x2e')][_0x42b1('0x38')]+'%'};return _0x34f354;}})});}_0x4389e6=_[_0x42b1('0x39')]({},_0x4389e6,_0x3d958c['options']);var _0x551955={'where':_0x4389e6[_0x42b1('0x37')]};return db[_0x42b1('0x28')][_0x42b1('0x1d')](_0x551955)[_0x42b1('0x22')](function(_0xea1185){_0x356c06[_0x42b1('0x1d')]=_0xea1185;if(_0x3d958c[_0x42b1('0x2e')][_0x42b1('0x3c')]){_0x4389e6[_0x42b1('0x3d')]=[{'all':!![]}];}return db[_0x42b1('0x28')]['findAll'](_0x4389e6);})[_0x42b1('0x22')](function(_0x1a49f3){_0x356c06['rows']=_0x1a49f3;return _0x356c06;})['then'](respondWithFilteredResult(_0x5a51f0,_0x4389e6))['catch'](handleError(_0x5a51f0,null));};exports[_0x42b1('0x3e')]=function(_0x5f439d,_0x1534a7){var _0x32a397={'raw':![],'where':{'id':_0x5f439d[_0x42b1('0x3f')]['id']}},_0x4cf4ed={};_0x4cf4ed[_0x42b1('0x2c')]=_[_0x42b1('0x2d')](db['SugarcrmConfiguration'][_0x42b1('0x29')]);_0x4cf4ed[_0x42b1('0x2e')]=_[_0x42b1('0x2d')](_0x5f439d[_0x42b1('0x2e')]);_0x4cf4ed[_0x42b1('0x2f')]=_['intersection'](_0x4cf4ed[_0x42b1('0x2c')],_0x4cf4ed[_0x42b1('0x2e')]);_0x32a397['attributes']=_['intersection'](_0x4cf4ed[_0x42b1('0x2c')],qs['fields'](_0x5f439d['query'][_0x42b1('0x32')]));_0x32a397[_0x42b1('0x30')]=_0x32a397[_0x42b1('0x30')][_0x42b1('0x33')]?_0x32a397[_0x42b1('0x30')]:_0x4cf4ed['model'];if(_0x5f439d[_0x42b1('0x2e')][_0x42b1('0x3c')]){_0x32a397[_0x42b1('0x3d')]=[{'all':!![]}];}_0x32a397=_[_0x42b1('0x39')]({},_0x32a397,_0x5f439d[_0x42b1('0x40')]);return db[_0x42b1('0x28')][_0x42b1('0x41')](_0x32a397)['then'](handleEntityNotFound(_0x1534a7,null))[_0x42b1('0x22')](respondWithResult(_0x1534a7,null))['catch'](handleError(_0x1534a7,null));};exports[_0x42b1('0x42')]=function(_0x27c690,_0x1f7773){return db[_0x42b1('0x28')]['create'](_0x27c690['body'],{})[_0x42b1('0x22')](respondWithResult(_0x1f7773,0xc9))[_0x42b1('0x43')](handleError(_0x1f7773,null));};exports['update']=function(_0x2e0e7f,_0x21dc9a){if(_0x2e0e7f[_0x42b1('0x44')]['id']){delete _0x2e0e7f[_0x42b1('0x44')]['id'];}return db[_0x42b1('0x28')][_0x42b1('0x41')]({'where':{'id':_0x2e0e7f[_0x42b1('0x3f')]['id']}})[_0x42b1('0x22')](handleEntityNotFound(_0x21dc9a,null))[_0x42b1('0x22')](saveUpdates(_0x2e0e7f[_0x42b1('0x44')],null))[_0x42b1('0x22')](respondWithResult(_0x21dc9a,null))['catch'](handleError(_0x21dc9a,null));};exports[_0x42b1('0x21')]=function(_0x1f7609,_0x2ba374){return db['SugarcrmConfiguration'][_0x42b1('0x41')]({'where':{'id':_0x1f7609['params']['id']}})['then'](handleEntityNotFound(_0x2ba374,null))[_0x42b1('0x22')](removeEntity(_0x2ba374,null))['catch'](handleError(_0x2ba374,null));};exports[_0x42b1('0x45')]=function(_0x31458d,_0x3c74f1,_0x5625d2){var _0x102bc9={};var _0x24c1ba={};var _0x362d97;var _0x2add0d;return db[_0x42b1('0x28')][_0x42b1('0x46')]({'where':{'id':_0x31458d['params']['id']}})[_0x42b1('0x22')](handleEntityNotFound(_0x3c74f1,null))[_0x42b1('0x22')](function(_0x3a7254){if(_0x3a7254){_0x362d97=_0x3a7254;_0x24c1ba[_0x42b1('0x2c')]=_[_0x42b1('0x2d')](db[_0x42b1('0x47')][_0x42b1('0x29')]);_0x24c1ba[_0x42b1('0x2e')]=_['keys'](_0x31458d[_0x42b1('0x2e')]);_0x24c1ba['filters']=_['intersection'](_0x24c1ba[_0x42b1('0x2c')],_0x24c1ba[_0x42b1('0x2e')]);_0x102bc9[_0x42b1('0x30')]=_[_0x42b1('0x31')](_0x24c1ba[_0x42b1('0x2c')],qs[_0x42b1('0x32')](_0x31458d[_0x42b1('0x2e')][_0x42b1('0x32')]));_0x102bc9['attributes']=_0x102bc9[_0x42b1('0x30')][_0x42b1('0x33')]?_0x102bc9[_0x42b1('0x30')]:_0x24c1ba[_0x42b1('0x2c')];_0x102bc9[_0x42b1('0x35')]=qs[_0x42b1('0x36')](_0x31458d['query']['sort']);_0x102bc9[_0x42b1('0x37')]=qs[_0x42b1('0x2f')](_[_0x42b1('0x48')](_0x31458d[_0x42b1('0x2e')],_0x24c1ba[_0x42b1('0x2f')]));if(_0x31458d['query'][_0x42b1('0x38')]){_0x102bc9[_0x42b1('0x37')]=_[_0x42b1('0x39')](_0x102bc9['where'],{'$or':_[_0x42b1('0x27')](_0x102bc9[_0x42b1('0x30')],function(_0x4b8784){var _0x163502={};_0x163502[_0x4b8784]={'$like':'%'+_0x31458d['query'][_0x42b1('0x38')]+'%'};return _0x163502;})});}_0x102bc9=_['merge']({},_0x102bc9,_0x31458d[_0x42b1('0x40')]);return _0x362d97[_0x42b1('0x45')](_0x102bc9);}})['then'](function(_0x2a2a62){if(_0x2a2a62){_0x2add0d=_0x2a2a62[_0x42b1('0x33')];if(!_0x31458d[_0x42b1('0x2e')][_0x42b1('0x34')]('nolimit')){_0x102bc9[_0x42b1('0x1c')]=qs[_0x42b1('0x1c')](_0x31458d[_0x42b1('0x2e')][_0x42b1('0x1c')]);_0x102bc9[_0x42b1('0x1e')]=qs[_0x42b1('0x1e')](_0x31458d[_0x42b1('0x2e')][_0x42b1('0x1e')]);}return _0x362d97[_0x42b1('0x45')](_0x102bc9);}})[_0x42b1('0x22')](function(_0x134135){if(_0x134135){return _0x134135?{'count':_0x2add0d,'rows':_0x134135}:null;}})[_0x42b1('0x22')](respondWithResult(_0x3c74f1,null))['catch'](handleError(_0x3c74f1,null));};exports[_0x42b1('0x49')]=function(_0x428eff,_0x33c604,_0x439d6b){var _0x57e79a={};var _0x451f8b={};var _0x2f6fc6;var _0x2dbd22;return db['SugarcrmConfiguration'][_0x42b1('0x46')]({'where':{'id':_0x428eff[_0x42b1('0x3f')]['id']}})['then'](handleEntityNotFound(_0x33c604,null))[_0x42b1('0x22')](function(_0x43a40d){if(_0x43a40d){_0x2f6fc6=_0x43a40d;_0x451f8b[_0x42b1('0x2c')]=_[_0x42b1('0x2d')](db[_0x42b1('0x47')]['rawAttributes']);_0x451f8b[_0x42b1('0x2e')]=_[_0x42b1('0x2d')](_0x428eff['query']);_0x451f8b[_0x42b1('0x2f')]=_[_0x42b1('0x31')](_0x451f8b[_0x42b1('0x2c')],_0x451f8b[_0x42b1('0x2e')]);_0x57e79a[_0x42b1('0x30')]=_[_0x42b1('0x31')](_0x451f8b['model'],qs[_0x42b1('0x32')](_0x428eff['query'][_0x42b1('0x32')]));_0x57e79a['attributes']=_0x57e79a[_0x42b1('0x30')][_0x42b1('0x33')]?_0x57e79a[_0x42b1('0x30')]:_0x451f8b[_0x42b1('0x2c')];_0x57e79a[_0x42b1('0x35')]=qs[_0x42b1('0x36')](_0x428eff[_0x42b1('0x2e')][_0x42b1('0x36')]);_0x57e79a[_0x42b1('0x37')]=qs[_0x42b1('0x2f')](_[_0x42b1('0x48')](_0x428eff['query'],_0x451f8b[_0x42b1('0x2f')]));if(_0x428eff[_0x42b1('0x2e')][_0x42b1('0x38')]){_0x57e79a[_0x42b1('0x37')]=_[_0x42b1('0x39')](_0x57e79a['where'],{'$or':_[_0x42b1('0x27')](_0x57e79a['attributes'],function(_0x2e0fa3){var _0x517fde={};_0x517fde[_0x2e0fa3]={'$like':'%'+_0x428eff[_0x42b1('0x2e')]['filter']+'%'};return _0x517fde;})});}_0x57e79a=_[_0x42b1('0x39')]({},_0x57e79a,_0x428eff[_0x42b1('0x40')]);return _0x2f6fc6[_0x42b1('0x49')](_0x57e79a);}})[_0x42b1('0x22')](function(_0x521c1e){if(_0x521c1e){_0x2dbd22=_0x521c1e[_0x42b1('0x33')];if(!_0x428eff[_0x42b1('0x2e')]['hasOwnProperty']('nolimit')){_0x57e79a[_0x42b1('0x1c')]=qs[_0x42b1('0x1c')](_0x428eff[_0x42b1('0x2e')][_0x42b1('0x1c')]);_0x57e79a[_0x42b1('0x1e')]=qs[_0x42b1('0x1e')](_0x428eff['query']['offset']);}return _0x2f6fc6[_0x42b1('0x49')](_0x57e79a);}})[_0x42b1('0x22')](function(_0x1c8313){if(_0x1c8313){return _0x1c8313?{'count':_0x2dbd22,'rows':_0x1c8313}:null;}})[_0x42b1('0x22')](respondWithResult(_0x33c604,null))[_0x42b1('0x43')](handleError(_0x33c604,null));};exports[_0x42b1('0x4a')]=function(_0x3e5e11,_0x164b8f,_0x3d32c2){var _0x4454d8={};var _0x4eedb3={};var _0x50f001;var _0x13512d;return db[_0x42b1('0x28')][_0x42b1('0x46')]({'where':{'id':_0x3e5e11[_0x42b1('0x3f')]['id']}})[_0x42b1('0x22')](handleEntityNotFound(_0x164b8f,null))['then'](function(_0x1b75c2){if(_0x1b75c2){_0x50f001=_0x1b75c2;_0x4eedb3[_0x42b1('0x2c')]=_[_0x42b1('0x2d')](db[_0x42b1('0x47')]['rawAttributes']);_0x4eedb3[_0x42b1('0x2e')]=_['keys'](_0x3e5e11[_0x42b1('0x2e')]);_0x4eedb3[_0x42b1('0x2f')]=_[_0x42b1('0x31')](_0x4eedb3['model'],_0x4eedb3[_0x42b1('0x2e')]);_0x4454d8[_0x42b1('0x30')]=_['intersection'](_0x4eedb3[_0x42b1('0x2c')],qs[_0x42b1('0x32')](_0x3e5e11[_0x42b1('0x2e')][_0x42b1('0x32')]));_0x4454d8[_0x42b1('0x30')]=_0x4454d8['attributes'][_0x42b1('0x33')]?_0x4454d8[_0x42b1('0x30')]:_0x4eedb3[_0x42b1('0x2c')];_0x4454d8[_0x42b1('0x35')]=qs[_0x42b1('0x36')](_0x3e5e11['query'][_0x42b1('0x36')]);_0x4454d8[_0x42b1('0x37')]=qs['filters'](_['pick'](_0x3e5e11['query'],_0x4eedb3[_0x42b1('0x2f')]));if(_0x3e5e11[_0x42b1('0x2e')]['filter']){_0x4454d8[_0x42b1('0x37')]=_['merge'](_0x4454d8[_0x42b1('0x37')],{'$or':_[_0x42b1('0x27')](_0x4454d8['attributes'],function(_0x48ce6c){var _0x25e119={};_0x25e119[_0x48ce6c]={'$like':'%'+_0x3e5e11['query'][_0x42b1('0x38')]+'%'};return _0x25e119;})});}_0x4454d8=_[_0x42b1('0x39')]({},_0x4454d8,_0x3e5e11['options']);return _0x50f001[_0x42b1('0x4a')](_0x4454d8);}})[_0x42b1('0x22')](function(_0x410988){if(_0x410988){_0x13512d=_0x410988[_0x42b1('0x33')];if(!_0x3e5e11[_0x42b1('0x2e')][_0x42b1('0x34')]('nolimit')){_0x4454d8[_0x42b1('0x1c')]=qs['limit'](_0x3e5e11[_0x42b1('0x2e')][_0x42b1('0x1c')]);_0x4454d8[_0x42b1('0x1e')]=qs['offset'](_0x3e5e11['query']['offset']);}return _0x50f001['getDescriptions'](_0x4454d8);}})['then'](function(_0x5b1627){if(_0x5b1627){return _0x5b1627?{'count':_0x13512d,'rows':_0x5b1627}:null;}})[_0x42b1('0x22')](respondWithResult(_0x164b8f,null))['catch'](handleError(_0x164b8f,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index 1918094..9d7b8d7 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 _0x3756=['util','../../config/logger','api','bluebird','rimraf','define','SugarcrmConfiguration','int_sugarcrm_configurations','lodash'];(function(_0x376419,_0x4d9431){var _0x54ec18=function(_0x1b0916){while(--_0x1b0916){_0x376419['push'](_0x376419['shift']());}};_0x54ec18(++_0x4d9431);}(_0x3756,0x170));var _0x6375=function(_0x3f0a49,_0x59fcca){_0x3f0a49=_0x3f0a49-0x0;var _0x49798f=_0x3756[_0x3f0a49];return _0x49798f;};'use strict';var _=require(_0x6375('0x0'));var util=require(_0x6375('0x1'));var logger=require(_0x6375('0x2'))(_0x6375('0x3'));var moment=require('moment');var BPromise=require(_0x6375('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x6375('0x5'));var config=require('../../config/environment');var attributes=require('./intSugarcrmConfiguration.attributes');module['exports']=function(_0x124343,_0xad3764){return _0x124343[_0x6375('0x6')](_0x6375('0x7'),attributes,{'tableName':_0x6375('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf17e=['exports','define','SugarcrmConfiguration','int_sugarcrm_configurations','lodash','util','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x447caa,_0x45e9b3){var _0x1b360b=function(_0xa82b16){while(--_0xa82b16){_0x447caa['push'](_0x447caa['shift']());}};_0x1b360b(++_0x45e9b3);}(_0xf17e,0xb8));var _0xef17=function(_0x4f5835,_0x2bef47){_0x4f5835=_0x4f5835-0x0;var _0x5cc9ed=_0xf17e[_0x4f5835];return _0x5cc9ed;};'use strict';var _=require(_0xef17('0x0'));var util=require(_0xef17('0x1'));var logger=require('../../config/logger')(_0xef17('0x2'));var moment=require(_0xef17('0x3'));var BPromise=require(_0xef17('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xef17('0x5'));var rimraf=require(_0xef17('0x6'));var config=require(_0xef17('0x7'));var attributes=require('./intSugarcrmConfiguration.attributes');module[_0xef17('0x8')]=function(_0x5a7193,_0xfe9a4b){return _0x5a7193[_0xef17('0x9')](_0xef17('0xa'),attributes,{'tableName':_0xef17('0xb'),'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 0a2180b..b7c2905 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 _0x0284=['SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','util','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info'];(function(_0x281e5e,_0xf320e2){var _0x5a22d2=function(_0x405ff9){while(--_0x405ff9){_0x281e5e['push'](_0x281e5e['shift']());}};_0x5a22d2(++_0xf320e2);}(_0x0284,0x124));var _0x4028=function(_0x38537f,_0x252124){_0x38537f=_0x38537f-0x0;var _0x141e23=_0x0284[_0x38537f];return _0x141e23;};'use strict';var _=require('lodash');var util=require(_0x4028('0x0'));var moment=require(_0x4028('0x1'));var BPromise=require(_0x4028('0x2'));var rs=require(_0x4028('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4028('0x4'))(_0x4028('0x5'));var config=require(_0x4028('0x6'));var jayson=require(_0x4028('0x7'));var client=jayson[_0x4028('0x8')][_0x4028('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x233959,_0x96bffc,_0x386d97){return new BPromise(function(_0x25bd7d,_0x4b0d24){return client[_0x4028('0xa')](_0x233959,_0x386d97)['then'](function(_0x470112){logger[_0x4028('0xb')](_0x4028('0xc'),_0x96bffc,_0x4028('0xd'));logger['debug']('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0x96bffc,_0x4028('0xd'),JSON[_0x4028('0xe')](_0x470112));if(_0x470112[_0x4028('0xf')]){if(_0x470112['error']['code']===0x1f4){logger['error'](_0x4028('0xc'),_0x96bffc,_0x470112[_0x4028('0xf')][_0x4028('0x10')]);return _0x4b0d24(_0x470112[_0x4028('0xf')][_0x4028('0x10')]);}logger[_0x4028('0xf')](_0x4028('0xc'),_0x96bffc,_0x470112[_0x4028('0xf')][_0x4028('0x10')]);return _0x25bd7d(_0x470112[_0x4028('0xf')][_0x4028('0x10')]);}else{logger[_0x4028('0xb')](_0x4028('0xc'),_0x96bffc,_0x4028('0xd'));_0x25bd7d(_0x470112[_0x4028('0x11')]['message']);}})[_0x4028('0x12')](function(_0x11f386){logger[_0x4028('0xf')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x96bffc,_0x11f386);_0x4b0d24(_0x11f386);});});} \ No newline at end of file +var _0xdbc6=['http','request','info','SugarcrmConfiguration,\x20%s,\x20%s','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','catch','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x2326eb,_0x36b5a7){var _0x5307af=function(_0x18a199){while(--_0x18a199){_0x2326eb['push'](_0x2326eb['shift']());}};_0x5307af(++_0x36b5a7);}(_0xdbc6,0x1c3));var _0x6dbc=function(_0x4d706b,_0x3c81ce){_0x4d706b=_0x4d706b-0x0;var _0x4a1df6=_0xdbc6[_0x4d706b];return _0x4a1df6;};'use strict';var _=require(_0x6dbc('0x0'));var util=require('util');var moment=require(_0x6dbc('0x1'));var BPromise=require('bluebird');var rs=require(_0x6dbc('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6dbc('0x3'))['db'];var utils=require(_0x6dbc('0x4'));var logger=require(_0x6dbc('0x5'))(_0x6dbc('0x6'));var config=require(_0x6dbc('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x6dbc('0x8')][_0x6dbc('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x558c2c,_0x44d4fc,_0xdf4992){return new BPromise(function(_0x459dbd,_0x46a3ac){return client[_0x6dbc('0xa')](_0x558c2c,_0xdf4992)['then'](function(_0x470acc){logger[_0x6dbc('0xb')](_0x6dbc('0xc'),_0x44d4fc,'request\x20sent');logger[_0x6dbc('0xd')](_0x6dbc('0xe'),_0x44d4fc,'request\x20sent',JSON[_0x6dbc('0xf')](_0x470acc));if(_0x470acc['error']){if(_0x470acc[_0x6dbc('0x10')]['code']===0x1f4){logger['error'](_0x6dbc('0xc'),_0x44d4fc,_0x470acc['error'][_0x6dbc('0x11')]);return _0x46a3ac(_0x470acc[_0x6dbc('0x10')][_0x6dbc('0x11')]);}logger[_0x6dbc('0x10')](_0x6dbc('0xc'),_0x44d4fc,_0x470acc[_0x6dbc('0x10')][_0x6dbc('0x11')]);return _0x459dbd(_0x470acc['error'][_0x6dbc('0x11')]);}else{logger['info'](_0x6dbc('0xc'),_0x44d4fc,_0x6dbc('0x12'));_0x459dbd(_0x470acc['result'][_0x6dbc('0x11')]);}})[_0x6dbc('0x13')](function(_0x31eaa7){logger[_0x6dbc('0x10')](_0x6dbc('0xc'),_0x44d4fc,_0x31eaa7);_0x46a3ac(_0x31eaa7);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index 8cc52c1..7b26390 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 _0x213f=['../../components/auth/service','../../config/environment','./intSugarcrmField.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','destroy','exports','multer','path','express','Router','fs-extra'];(function(_0x48206c,_0xbcbc49){var _0x35f2e3=function(_0x4e4e3f){while(--_0x4e4e3f){_0x48206c['push'](_0x48206c['shift']());}};_0x35f2e3(++_0xbcbc49);}(_0x213f,0x80));var _0xf213=function(_0x4dff07,_0x317b0e){_0x4dff07=_0x4dff07-0x0;var _0x38aba5=_0x213f[_0x4dff07];return _0x38aba5;};'use strict';var multer=require(_0xf213('0x0'));var util=require('util');var path=require(_0xf213('0x1'));var timeout=require('connect-timeout');var express=require(_0xf213('0x2'));var router=express[_0xf213('0x3')]();var fs_extra=require(_0xf213('0x4'));var auth=require(_0xf213('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xf213('0x6'));var controller=require(_0xf213('0x7'));router[_0xf213('0x8')]('/',auth[_0xf213('0x9')](),controller[_0xf213('0xa')]);router[_0xf213('0x8')](_0xf213('0xb'),auth[_0xf213('0x9')](),controller[_0xf213('0xc')]);router[_0xf213('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xf213('0xe')]('/:id',auth['isAuthenticated'](),controller[_0xf213('0xf')]);router[_0xf213('0x10')]('/:id',auth[_0xf213('0x9')](),controller[_0xf213('0x11')]);module[_0xf213('0x12')]=router; \ No newline at end of file +var _0x6e7a=['../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','isAuthenticated','index','/:id','post','create','put','update','delete','exports','multer','util','connect-timeout','express','Router','fs-extra'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x6e7a,0x9c));var _0xa6e7=function(_0x2716c6,_0x38dd17){_0x2716c6=_0x2716c6-0x0;var _0x518dc2=_0x6e7a[_0x2716c6];return _0x518dc2;};'use strict';var multer=require(_0xa6e7('0x0'));var util=require(_0xa6e7('0x1'));var path=require('path');var timeout=require(_0xa6e7('0x2'));var express=require(_0xa6e7('0x3'));var router=express[_0xa6e7('0x4')]();var fs_extra=require(_0xa6e7('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xa6e7('0x6'));var config=require(_0xa6e7('0x7'));var controller=require(_0xa6e7('0x8'));router['get']('/',auth[_0xa6e7('0x9')](),controller[_0xa6e7('0xa')]);router['get'](_0xa6e7('0xb'),auth[_0xa6e7('0x9')](),controller['show']);router[_0xa6e7('0xc')]('/',auth[_0xa6e7('0x9')](),controller[_0xa6e7('0xd')]);router[_0xa6e7('0xe')]('/:id',auth['isAuthenticated'](),controller[_0xa6e7('0xf')]);router[_0xa6e7('0x10')](_0xa6e7('0xb'),auth[_0xa6e7('0x9')](),controller['destroy']);module[_0xa6e7('0x11')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index 4dac472..c78ee9d 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 _0x205a=['string','keyValue','STRING','ENUM','variable','customVariable','BOOLEAN','sequelize','exports'];(function(_0x3fa937,_0x45f3de){var _0x1d4235=function(_0xf435a3){while(--_0xf435a3){_0x3fa937['push'](_0x3fa937['shift']());}};_0x1d4235(++_0x45f3de);}(_0x205a,0x193));var _0xa205=function(_0xda0ec3,_0xbd14a0){_0xda0ec3=_0xda0ec3-0x0;var _0x258b92=_0x205a[_0xda0ec3];return _0x258b92;};'use strict';var Sequelize=require(_0xa205('0x0'));module[_0xa205('0x1')]={'type':{'type':Sequelize['ENUM'](_0xa205('0x2'),'variable','customVariable',_0xa205('0x3'),'picklist'),'defaultValue':_0xa205('0x2')},'content':{'type':Sequelize[_0xa205('0x4')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xa205('0x5')](_0xa205('0x2'),_0xa205('0x6'),_0xa205('0x7'))},'keyContent':{'type':Sequelize[_0xa205('0x4')]},'idField':{'type':Sequelize[_0xa205('0x4')]},'nameField':{'type':Sequelize[_0xa205('0x4')]},'customField':{'type':Sequelize[_0xa205('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xa205('0x4')]}}; \ No newline at end of file +var _0xe112=['ENUM','string','variable','customVariable','picklist','STRING','exports'];(function(_0x3a6efd,_0x2a5102){var _0x487b9a=function(_0x104f89){while(--_0x104f89){_0x3a6efd['push'](_0x3a6efd['shift']());}};_0x487b9a(++_0x2a5102);}(_0xe112,0x1f0));var _0x2e11=function(_0x1c8cd9,_0x1c94f0){_0x1c8cd9=_0x1c8cd9-0x0;var _0x512f42=_0xe112[_0x1c8cd9];return _0x512f42;};'use strict';var Sequelize=require('sequelize');module[_0x2e11('0x0')]={'type':{'type':Sequelize[_0x2e11('0x1')](_0x2e11('0x2'),_0x2e11('0x3'),_0x2e11('0x4'),'keyValue',_0x2e11('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0x2e11('0x6')]},'key':{'type':Sequelize[_0x2e11('0x6')]},'keyType':{'type':Sequelize[_0x2e11('0x1')]('string','variable',_0x2e11('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x2e11('0x6')]},'nameField':{'type':Sequelize[_0x2e11('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2e11('0x6')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index eeabd5a..a5f6e9d 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 _0xb90f=['rimraf','fast-json-patch','request-promise','moment','mustache','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','undefined','limit','offset','count','set','Content-Range','json','apply','reject','save','update','then','sendStatus','error','stack','name','send','index','map','SugarcrmField','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','include','rows','catch','show','params','rawAttributes','includeAll','options','find','create','body','destroy','eml-format'];(function(_0x19fa95,_0x1cca0a){var _0x58a835=function(_0x3e1957){while(--_0x3e1957){_0x19fa95['push'](_0x19fa95['shift']());}};_0x58a835(++_0x1cca0a);}(_0xb90f,0x12b));var _0xfb90=function(_0x594db6,_0x7250cc){_0x594db6=_0x594db6-0x0;var _0x2f1e00=_0xb90f[_0x594db6];return _0x2f1e00;};'use strict';var emlformat=require(_0xfb90('0x0'));var rimraf=require(_0xfb90('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfb90('0x2'));var rp=require(_0xfb90('0x3'));var moment=require(_0xfb90('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xfb90('0x5'));var util=require('util');var path=require(_0xfb90('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xfb90('0x7'));var fs=require('fs');var fs_extra=require(_0xfb90('0x8'));var _=require(_0xfb90('0x9'));var squel=require(_0xfb90('0xa'));var crypto=require(_0xfb90('0xb'));var jsforce=require(_0xfb90('0xc'));var deskjs=require(_0xfb90('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xfb90('0xe'));var Redis=require(_0xfb90('0xf'));var authService=require(_0xfb90('0x10'));var qs=require(_0xfb90('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfb90('0x12'));var logger=require(_0xfb90('0x13'))(_0xfb90('0x14'));var utils=require(_0xfb90('0x15'));var config=require(_0xfb90('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xfb90('0x17'))['db'];function respondWithStatusCode(_0xade337,_0x552f86){_0x552f86=_0x552f86||0xcc;return function(_0x4faa1c){if(_0x4faa1c){return _0xade337['sendStatus'](_0x552f86);}return _0xade337[_0xfb90('0x18')](_0x552f86)[_0xfb90('0x19')]();};}function respondWithResult(_0x115b54,_0x34d7a4){_0x34d7a4=_0x34d7a4||0xc8;return function(_0x20002c){if(_0x20002c){return _0x115b54[_0xfb90('0x18')](_0x34d7a4)['json'](_0x20002c);}};}function respondWithFilteredResult(_0x3e26b3,_0x29d01a){return function(_0x312591){if(_0x312591){var _0x5f3395=typeof _0x29d01a['offset']===_0xfb90('0x1a')&&typeof _0x29d01a[_0xfb90('0x1b')]===_0xfb90('0x1a');var _0x1f7da5=_0x312591['count'];var _0x45d85b=_0x5f3395?0x0:_0x29d01a[_0xfb90('0x1c')];var _0x652029=_0x5f3395?_0x312591[_0xfb90('0x1d')]:_0x29d01a[_0xfb90('0x1c')]+_0x29d01a[_0xfb90('0x1b')];var _0xa3ee98;if(_0x652029>=_0x1f7da5){_0x652029=_0x1f7da5;_0xa3ee98=0xc8;}else{_0xa3ee98=0xce;}_0x3e26b3[_0xfb90('0x18')](_0xa3ee98);return _0x3e26b3[_0xfb90('0x1e')](_0xfb90('0x1f'),_0x45d85b+'-'+_0x652029+'/'+_0x1f7da5)[_0xfb90('0x20')](_0x312591);}return null;};}function patchUpdates(_0x48fee4){return function(_0x5f412d){try{jsonpatch[_0xfb90('0x21')](_0x5f412d,_0x48fee4,!![]);}catch(_0xe11551){return BPromise[_0xfb90('0x22')](_0xe11551);}return _0x5f412d[_0xfb90('0x23')]();};}function saveUpdates(_0x3df6ef,_0x20165d){return function(_0x276fd0){if(_0x276fd0){return _0x276fd0[_0xfb90('0x24')](_0x3df6ef)[_0xfb90('0x25')](function(_0x8ac1a0){return _0x8ac1a0;});}return null;};}function removeEntity(_0x1f260d,_0x761899){return function(_0x34fde8){if(_0x34fde8){return _0x34fde8['destroy']()[_0xfb90('0x25')](function(){_0x1f260d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x23ae4b,_0x5abcb3){return function(_0x181443){if(!_0x181443){_0x23ae4b[_0xfb90('0x26')](0x194);}return _0x181443;};}function handleError(_0x46546b,_0x42b8c9){_0x42b8c9=_0x42b8c9||0x1f4;return function(_0x1163f3){logger[_0xfb90('0x27')](_0x1163f3[_0xfb90('0x28')]);if(_0x1163f3[_0xfb90('0x29')]){delete _0x1163f3[_0xfb90('0x29')];}_0x46546b[_0xfb90('0x18')](_0x42b8c9)[_0xfb90('0x2a')](_0x1163f3);};}exports[_0xfb90('0x2b')]=function(_0x59061b,_0x171282){var _0xfc4b79={},_0x19c178={},_0x20448d={'count':0x0,'rows':[]};var _0x5b1a3a=_[_0xfb90('0x2c')](db[_0xfb90('0x2d')]['rawAttributes'],function(_0xa39dce){return{'name':_0xa39dce[_0xfb90('0x2e')],'type':_0xa39dce['type']['key']};});_0x19c178[_0xfb90('0x2f')]=_[_0xfb90('0x2c')](_0x5b1a3a,_0xfb90('0x29'));_0x19c178[_0xfb90('0x30')]=_[_0xfb90('0x31')](_0x59061b['query']);_0x19c178[_0xfb90('0x32')]=_[_0xfb90('0x33')](_0x19c178[_0xfb90('0x2f')],_0x19c178[_0xfb90('0x30')]);_0xfc4b79[_0xfb90('0x34')]=_['intersection'](_0x19c178['model'],qs[_0xfb90('0x35')](_0x59061b[_0xfb90('0x30')][_0xfb90('0x35')]));_0xfc4b79[_0xfb90('0x34')]=_0xfc4b79['attributes'][_0xfb90('0x36')]?_0xfc4b79['attributes']:_0x19c178[_0xfb90('0x2f')];if(!_0x59061b[_0xfb90('0x30')][_0xfb90('0x37')](_0xfb90('0x38'))){_0xfc4b79[_0xfb90('0x1b')]=qs[_0xfb90('0x1b')](_0x59061b[_0xfb90('0x30')]['limit']);_0xfc4b79['offset']=qs[_0xfb90('0x1c')](_0x59061b['query'][_0xfb90('0x1c')]);}_0xfc4b79[_0xfb90('0x39')]=qs[_0xfb90('0x3a')](_0x59061b[_0xfb90('0x30')][_0xfb90('0x3a')]);_0xfc4b79[_0xfb90('0x3b')]=qs['filters'](_[_0xfb90('0x3c')](_0x59061b['query'],_0x19c178[_0xfb90('0x32')]),_0x5b1a3a);if(_0x59061b[_0xfb90('0x30')][_0xfb90('0x3d')]){_0xfc4b79[_0xfb90('0x3b')]=_['merge'](_0xfc4b79[_0xfb90('0x3b')],{'$or':_[_0xfb90('0x2c')](_0x5b1a3a,function(_0xa94e1c){if(_0xa94e1c['type']!==_0xfb90('0x3e')){var _0x2768a6={};_0x2768a6[_0xa94e1c[_0xfb90('0x29')]]={'$like':'%'+_0x59061b[_0xfb90('0x30')][_0xfb90('0x3d')]+'%'};return _0x2768a6;}})});}_0xfc4b79=_['merge']({},_0xfc4b79,_0x59061b['options']);var _0x25c16f={'where':_0xfc4b79[_0xfb90('0x3b')]};return db[_0xfb90('0x2d')][_0xfb90('0x1d')](_0x25c16f)['then'](function(_0x3a1d45){_0x20448d[_0xfb90('0x1d')]=_0x3a1d45;if(_0x59061b[_0xfb90('0x30')]['includeAll']){_0xfc4b79[_0xfb90('0x3f')]=[{'all':!![]}];}return db[_0xfb90('0x2d')]['findAll'](_0xfc4b79);})[_0xfb90('0x25')](function(_0x2d6837){_0x20448d[_0xfb90('0x40')]=_0x2d6837;return _0x20448d;})['then'](respondWithFilteredResult(_0x171282,_0xfc4b79))[_0xfb90('0x41')](handleError(_0x171282,null));};exports[_0xfb90('0x42')]=function(_0x97d381,_0xa3ac71){var _0x22ea1e={'raw':!![],'where':{'id':_0x97d381[_0xfb90('0x43')]['id']}},_0x5766b0={};_0x5766b0[_0xfb90('0x2f')]=_[_0xfb90('0x31')](db[_0xfb90('0x2d')][_0xfb90('0x44')]);_0x5766b0[_0xfb90('0x30')]=_[_0xfb90('0x31')](_0x97d381[_0xfb90('0x30')]);_0x5766b0['filters']=_[_0xfb90('0x33')](_0x5766b0[_0xfb90('0x2f')],_0x5766b0[_0xfb90('0x30')]);_0x22ea1e[_0xfb90('0x34')]=_[_0xfb90('0x33')](_0x5766b0['model'],qs[_0xfb90('0x35')](_0x97d381[_0xfb90('0x30')][_0xfb90('0x35')]));_0x22ea1e[_0xfb90('0x34')]=_0x22ea1e[_0xfb90('0x34')][_0xfb90('0x36')]?_0x22ea1e[_0xfb90('0x34')]:_0x5766b0[_0xfb90('0x2f')];if(_0x97d381['query'][_0xfb90('0x45')]){_0x22ea1e[_0xfb90('0x3f')]=[{'all':!![]}];}_0x22ea1e=_['merge']({},_0x22ea1e,_0x97d381[_0xfb90('0x46')]);return db[_0xfb90('0x2d')][_0xfb90('0x47')](_0x22ea1e)[_0xfb90('0x25')](handleEntityNotFound(_0xa3ac71,null))[_0xfb90('0x25')](respondWithResult(_0xa3ac71,null))[_0xfb90('0x41')](handleError(_0xa3ac71,null));};exports[_0xfb90('0x48')]=function(_0x59460f,_0x5cc9a5){return db[_0xfb90('0x2d')][_0xfb90('0x48')](_0x59460f[_0xfb90('0x49')],{})[_0xfb90('0x25')](respondWithResult(_0x5cc9a5,0xc9))[_0xfb90('0x41')](handleError(_0x5cc9a5,null));};exports[_0xfb90('0x24')]=function(_0x13066c,_0x2edcf2){if(_0x13066c['body']['id']){delete _0x13066c[_0xfb90('0x49')]['id'];}return db[_0xfb90('0x2d')]['find']({'where':{'id':_0x13066c['params']['id']}})[_0xfb90('0x25')](handleEntityNotFound(_0x2edcf2,null))[_0xfb90('0x25')](saveUpdates(_0x13066c[_0xfb90('0x49')],null))[_0xfb90('0x25')](respondWithResult(_0x2edcf2,null))['catch'](handleError(_0x2edcf2,null));};exports[_0xfb90('0x4a')]=function(_0xb53c7b,_0x4df23d){return db[_0xfb90('0x2d')]['find']({'where':{'id':_0xb53c7b[_0xfb90('0x43')]['id']}})[_0xfb90('0x25')](handleEntityNotFound(_0x4df23d,null))[_0xfb90('0x25')](removeEntity(_0x4df23d,null))[_0xfb90('0x41')](handleError(_0x4df23d,null));}; \ No newline at end of file +var _0xb69b=['ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','stack','name','send','index','SugarcrmField','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','rows','catch','show','params','length','options','find','create','body','destroy','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','lodash','desk.js','querystring','papaparse'];(function(_0x680b7b,_0x47d9ed){var _0x1ede67=function(_0x3a8efc){while(--_0x3a8efc){_0x680b7b['push'](_0x680b7b['shift']());}};_0x1ede67(++_0x47d9ed);}(_0xb69b,0xcf));var _0xbb69=function(_0x81ef5c,_0x48b2c1){_0x81ef5c=_0x81ef5c-0x0;var _0x87a2cd=_0xb69b[_0x81ef5c];return _0x87a2cd;};'use strict';var emlformat=require(_0xbb69('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbb69('0x1'));var jsonpatch=require(_0xbb69('0x2'));var rp=require(_0xbb69('0x3'));var moment=require(_0xbb69('0x4'));var BPromise=require(_0xbb69('0x5'));var Mustache=require(_0xbb69('0x6'));var util=require(_0xbb69('0x7'));var path=require('path');var sox=require(_0xbb69('0x8'));var csv=require(_0xbb69('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbb69('0xa'));var _=require(_0xbb69('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xbb69('0xc'));var toCsv=require(_0xbb69('0x9'));var querystring=require(_0xbb69('0xd'));var Papa=require(_0xbb69('0xe'));var Redis=require(_0xbb69('0xf'));var authService=require(_0xbb69('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xbb69('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbb69('0x12'))(_0xbb69('0x13'));var utils=require(_0xbb69('0x14'));var config=require(_0xbb69('0x15'));var licenseUtil=require(_0xbb69('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x541537,_0x34e9e8){_0x34e9e8=_0x34e9e8||0xcc;return function(_0x52453c){if(_0x52453c){return _0x541537[_0xbb69('0x17')](_0x34e9e8);}return _0x541537[_0xbb69('0x18')](_0x34e9e8)[_0xbb69('0x19')]();};}function respondWithResult(_0x1604f0,_0x563c18){_0x563c18=_0x563c18||0xc8;return function(_0x453d88){if(_0x453d88){return _0x1604f0[_0xbb69('0x18')](_0x563c18)[_0xbb69('0x1a')](_0x453d88);}};}function respondWithFilteredResult(_0x14e8a7,_0x332841){return function(_0x585075){if(_0x585075){var _0x5162c6=typeof _0x332841[_0xbb69('0x1b')]===_0xbb69('0x1c')&&typeof _0x332841[_0xbb69('0x1d')]===_0xbb69('0x1c');var _0x3fc47a=_0x585075['count'];var _0x17dd48=_0x5162c6?0x0:_0x332841[_0xbb69('0x1b')];var _0x4585b0=_0x5162c6?_0x585075[_0xbb69('0x1e')]:_0x332841[_0xbb69('0x1b')]+_0x332841[_0xbb69('0x1d')];var _0x583ffe;if(_0x4585b0>=_0x3fc47a){_0x4585b0=_0x3fc47a;_0x583ffe=0xc8;}else{_0x583ffe=0xce;}_0x14e8a7[_0xbb69('0x18')](_0x583ffe);return _0x14e8a7[_0xbb69('0x1f')](_0xbb69('0x20'),_0x17dd48+'-'+_0x4585b0+'/'+_0x3fc47a)[_0xbb69('0x1a')](_0x585075);}return null;};}function patchUpdates(_0x1e4a3e){return function(_0x16960b){try{jsonpatch[_0xbb69('0x21')](_0x16960b,_0x1e4a3e,!![]);}catch(_0x572441){return BPromise[_0xbb69('0x22')](_0x572441);}return _0x16960b[_0xbb69('0x23')]();};}function saveUpdates(_0x4df0b8,_0x1d52f0){return function(_0x4e21b9){if(_0x4e21b9){return _0x4e21b9[_0xbb69('0x24')](_0x4df0b8)['then'](function(_0x47263d){return _0x47263d;});}return null;};}function removeEntity(_0x1cbbfa,_0x31de85){return function(_0x40cfc5){if(_0x40cfc5){return _0x40cfc5['destroy']()[_0xbb69('0x25')](function(){_0x1cbbfa['status'](0xcc)[_0xbb69('0x19')]();});}};}function handleEntityNotFound(_0x19d371,_0x1a2a29){return function(_0x1eba24){if(!_0x1eba24){_0x19d371[_0xbb69('0x17')](0x194);}return _0x1eba24;};}function handleError(_0x1e4839,_0x2039d4){_0x2039d4=_0x2039d4||0x1f4;return function(_0x32dbd5){logger['error'](_0x32dbd5[_0xbb69('0x26')]);if(_0x32dbd5[_0xbb69('0x27')]){delete _0x32dbd5[_0xbb69('0x27')];}_0x1e4839['status'](_0x2039d4)[_0xbb69('0x28')](_0x32dbd5);};}exports[_0xbb69('0x29')]=function(_0x4e394b,_0x52c409){var _0x591f30={},_0x165603={},_0x34ffc5={'count':0x0,'rows':[]};var _0x4864a7=_['map'](db[_0xbb69('0x2a')][_0xbb69('0x2b')],function(_0x3e697e){return{'name':_0x3e697e[_0xbb69('0x2c')],'type':_0x3e697e[_0xbb69('0x2d')][_0xbb69('0x2e')]};});_0x165603['model']=_[_0xbb69('0x2f')](_0x4864a7,_0xbb69('0x27'));_0x165603[_0xbb69('0x30')]=_[_0xbb69('0x31')](_0x4e394b[_0xbb69('0x30')]);_0x165603[_0xbb69('0x32')]=_[_0xbb69('0x33')](_0x165603[_0xbb69('0x34')],_0x165603['query']);_0x591f30[_0xbb69('0x35')]=_[_0xbb69('0x33')](_0x165603['model'],qs[_0xbb69('0x36')](_0x4e394b[_0xbb69('0x30')][_0xbb69('0x36')]));_0x591f30[_0xbb69('0x35')]=_0x591f30['attributes']['length']?_0x591f30[_0xbb69('0x35')]:_0x165603[_0xbb69('0x34')];if(!_0x4e394b['query'][_0xbb69('0x37')]('nolimit')){_0x591f30[_0xbb69('0x1d')]=qs[_0xbb69('0x1d')](_0x4e394b[_0xbb69('0x30')][_0xbb69('0x1d')]);_0x591f30[_0xbb69('0x1b')]=qs[_0xbb69('0x1b')](_0x4e394b[_0xbb69('0x30')]['offset']);}_0x591f30['order']=qs['sort'](_0x4e394b[_0xbb69('0x30')][_0xbb69('0x38')]);_0x591f30[_0xbb69('0x39')]=qs[_0xbb69('0x32')](_[_0xbb69('0x3a')](_0x4e394b[_0xbb69('0x30')],_0x165603['filters']),_0x4864a7);if(_0x4e394b['query'][_0xbb69('0x3b')]){_0x591f30[_0xbb69('0x39')]=_[_0xbb69('0x3c')](_0x591f30['where'],{'$or':_['map'](_0x4864a7,function(_0x399c98){if(_0x399c98[_0xbb69('0x2d')]!==_0xbb69('0x3d')){var _0x106644={};_0x106644[_0x399c98[_0xbb69('0x27')]]={'$like':'%'+_0x4e394b['query']['filter']+'%'};return _0x106644;}})});}_0x591f30=_[_0xbb69('0x3c')]({},_0x591f30,_0x4e394b['options']);var _0x4fa075={'where':_0x591f30[_0xbb69('0x39')]};return db[_0xbb69('0x2a')][_0xbb69('0x1e')](_0x4fa075)[_0xbb69('0x25')](function(_0x3977f3){_0x34ffc5['count']=_0x3977f3;if(_0x4e394b[_0xbb69('0x30')][_0xbb69('0x3e')]){_0x591f30[_0xbb69('0x3f')]=[{'all':!![]}];}return db[_0xbb69('0x2a')]['findAll'](_0x591f30);})[_0xbb69('0x25')](function(_0x3b4467){_0x34ffc5[_0xbb69('0x40')]=_0x3b4467;return _0x34ffc5;})[_0xbb69('0x25')](respondWithFilteredResult(_0x52c409,_0x591f30))[_0xbb69('0x41')](handleError(_0x52c409,null));};exports[_0xbb69('0x42')]=function(_0x9ad84d,_0x462a8c){var _0x5a6113={'raw':!![],'where':{'id':_0x9ad84d[_0xbb69('0x43')]['id']}},_0x82de2e={};_0x82de2e[_0xbb69('0x34')]=_['keys'](db[_0xbb69('0x2a')][_0xbb69('0x2b')]);_0x82de2e['query']=_[_0xbb69('0x31')](_0x9ad84d['query']);_0x82de2e[_0xbb69('0x32')]=_[_0xbb69('0x33')](_0x82de2e[_0xbb69('0x34')],_0x82de2e[_0xbb69('0x30')]);_0x5a6113[_0xbb69('0x35')]=_[_0xbb69('0x33')](_0x82de2e['model'],qs['fields'](_0x9ad84d[_0xbb69('0x30')][_0xbb69('0x36')]));_0x5a6113[_0xbb69('0x35')]=_0x5a6113['attributes'][_0xbb69('0x44')]?_0x5a6113[_0xbb69('0x35')]:_0x82de2e['model'];if(_0x9ad84d['query'][_0xbb69('0x3e')]){_0x5a6113[_0xbb69('0x3f')]=[{'all':!![]}];}_0x5a6113=_[_0xbb69('0x3c')]({},_0x5a6113,_0x9ad84d[_0xbb69('0x45')]);return db['SugarcrmField'][_0xbb69('0x46')](_0x5a6113)['then'](handleEntityNotFound(_0x462a8c,null))[_0xbb69('0x25')](respondWithResult(_0x462a8c,null))[_0xbb69('0x41')](handleError(_0x462a8c,null));};exports[_0xbb69('0x47')]=function(_0x2048f6,_0x4ed9e1){return db[_0xbb69('0x2a')][_0xbb69('0x47')](_0x2048f6[_0xbb69('0x48')],{})['then'](respondWithResult(_0x4ed9e1,0xc9))['catch'](handleError(_0x4ed9e1,null));};exports[_0xbb69('0x24')]=function(_0x367ee8,_0x4eae5e){if(_0x367ee8[_0xbb69('0x48')]['id']){delete _0x367ee8[_0xbb69('0x48')]['id'];}return db[_0xbb69('0x2a')][_0xbb69('0x46')]({'where':{'id':_0x367ee8['params']['id']}})[_0xbb69('0x25')](handleEntityNotFound(_0x4eae5e,null))[_0xbb69('0x25')](saveUpdates(_0x367ee8['body'],null))[_0xbb69('0x25')](respondWithResult(_0x4eae5e,null))[_0xbb69('0x41')](handleError(_0x4eae5e,null));};exports[_0xbb69('0x49')]=function(_0x3ba48f,_0x25a171){return db[_0xbb69('0x2a')][_0xbb69('0x46')]({'where':{'id':_0x3ba48f['params']['id']}})[_0xbb69('0x25')](handleEntityNotFound(_0x25a171,null))['then'](removeEntity(_0x25a171,null))['catch'](handleError(_0x25a171,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index a33ed45..40d90b9 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 _0x1d03=['./intSugarcrmField.attributes','exports','define','int_sugarcrm_fields','sugarcrm_unique_index','idField','FieldId','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x3817a9,_0x29e215){var _0x443f30=function(_0x13940b){while(--_0x13940b){_0x3817a9['push'](_0x3817a9['shift']());}};_0x443f30(++_0x29e215);}(_0x1d03,0x11f));var _0x31d0=function(_0x558e92,_0x516b05){_0x558e92=_0x558e92-0x0;var _0x1acb89=_0x1d03[_0x558e92];return _0x1acb89;};'use strict';var _=require(_0x31d0('0x0'));var util=require(_0x31d0('0x1'));var logger=require(_0x31d0('0x2'))(_0x31d0('0x3'));var moment=require('moment');var BPromise=require(_0x31d0('0x4'));var rp=require(_0x31d0('0x5'));var fs=require('fs');var path=require(_0x31d0('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x31d0('0x7'));module[_0x31d0('0x8')]=function(_0x2b5714,_0x378a66){return _0x2b5714[_0x31d0('0x9')]('SugarcrmField',attributes,{'tableName':_0x31d0('0xa'),'paranoid':![],'indexes':[{'name':_0x31d0('0xb'),'fields':[_0x31d0('0xc'),_0x31d0('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb315=['../../config/environment','SugarcrmField','int_sugarcrm_fields','idField','FieldId','lodash','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0xb315,0x1e5));var _0x5b31=function(_0x5c4585,_0x3d0eab){_0x5c4585=_0x5c4585-0x0;var _0x21dede=_0xb315[_0x5c4585];return _0x21dede;};'use strict';var _=require(_0x5b31('0x0'));var util=require('util');var logger=require(_0x5b31('0x1'))(_0x5b31('0x2'));var moment=require(_0x5b31('0x3'));var BPromise=require(_0x5b31('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5b31('0x5'));var rimraf=require(_0x5b31('0x6'));var config=require(_0x5b31('0x7'));var attributes=require('./intSugarcrmField.attributes');module['exports']=function(_0x2eef33,_0x61a24c){return _0x2eef33['define'](_0x5b31('0x8'),attributes,{'tableName':_0x5b31('0x9'),'paranoid':![],'indexes':[{'name':'sugarcrm_unique_index','fields':[_0x5b31('0xa'),_0x5b31('0xb')],'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 5b8f7de..2547f59 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 _0xe462=['code','message','result','catch','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x174f49,_0x36b1fa){var _0x220f6f=function(_0x304b5f){while(--_0x304b5f){_0x174f49['push'](_0x174f49['shift']());}};_0x220f6f(++_0x36b1fa);}(_0xe462,0xa4));var _0x2e46=function(_0x27923d,_0xa2c725){_0x27923d=_0x27923d-0x0;var _0x1911d3=_0xe462[_0x27923d];return _0x1911d3;};'use strict';var _=require('lodash');var util=require(_0x2e46('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x2e46('0x1'));var fs=require('fs');var Redis=require(_0x2e46('0x2'));var db=require(_0x2e46('0x3'))['db'];var utils=require(_0x2e46('0x4'));var logger=require(_0x2e46('0x5'))(_0x2e46('0x6'));var config=require('../../config/environment');var jayson=require(_0x2e46('0x7'));var client=jayson[_0x2e46('0x8')][_0x2e46('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1a3539,_0x2869ab,_0xc54875){return new BPromise(function(_0x525f05,_0x4f30b8){return client['request'](_0x1a3539,_0xc54875)['then'](function(_0x5010c8){logger['info'](_0x2e46('0xa'),_0x2869ab,_0x2e46('0xb'));logger[_0x2e46('0xc')](_0x2e46('0xd'),_0x2869ab,_0x2e46('0xb'),JSON[_0x2e46('0xe')](_0x5010c8));if(_0x5010c8['error']){if(_0x5010c8[_0x2e46('0xf')][_0x2e46('0x10')]===0x1f4){logger['error'](_0x2e46('0xa'),_0x2869ab,_0x5010c8[_0x2e46('0xf')][_0x2e46('0x11')]);return _0x4f30b8(_0x5010c8[_0x2e46('0xf')][_0x2e46('0x11')]);}logger[_0x2e46('0xf')](_0x2e46('0xa'),_0x2869ab,_0x5010c8[_0x2e46('0xf')][_0x2e46('0x11')]);return _0x525f05(_0x5010c8[_0x2e46('0xf')][_0x2e46('0x11')]);}else{logger['info'](_0x2e46('0xa'),_0x2869ab,'request\x20sent');_0x525f05(_0x5010c8[_0x2e46('0x12')][_0x2e46('0x11')]);}})[_0x2e46('0x13')](function(_0x28471d){logger[_0x2e46('0xf')]('SugarcrmField,\x20%s,\x20%s',_0x2869ab,_0x28471d);_0x4f30b8(_0x28471d);});});} \ No newline at end of file +var _0xb4ad=['lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x2371dd,_0x2c8cb3){var _0xf1f2e0=function(_0x2512dd){while(--_0x2512dd){_0x2371dd['push'](_0x2371dd['shift']());}};_0xf1f2e0(++_0x2c8cb3);}(_0xb4ad,0x1a4));var _0xdb4a=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xb4ad[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xdb4a('0x0'));var util=require(_0xdb4a('0x1'));var moment=require(_0xdb4a('0x2'));var BPromise=require(_0xdb4a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdb4a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xdb4a('0x5'));var logger=require(_0xdb4a('0x6'))(_0xdb4a('0x7'));var config=require('../../config/environment');var jayson=require(_0xdb4a('0x8'));var client=jayson[_0xdb4a('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x559b61,_0x22c072,_0x10e912){return new BPromise(function(_0x1730e0,_0x51c156){return client['request'](_0x559b61,_0x10e912)['then'](function(_0xe01436){logger[_0xdb4a('0xa')](_0xdb4a('0xb'),_0x22c072,_0xdb4a('0xc'));logger['debug'](_0xdb4a('0xd'),_0x22c072,'request\x20sent',JSON[_0xdb4a('0xe')](_0xe01436));if(_0xe01436[_0xdb4a('0xf')]){if(_0xe01436[_0xdb4a('0xf')][_0xdb4a('0x10')]===0x1f4){logger[_0xdb4a('0xf')]('SugarcrmField,\x20%s,\x20%s',_0x22c072,_0xe01436[_0xdb4a('0xf')][_0xdb4a('0x11')]);return _0x51c156(_0xe01436[_0xdb4a('0xf')][_0xdb4a('0x11')]);}logger[_0xdb4a('0xf')](_0xdb4a('0xb'),_0x22c072,_0xe01436[_0xdb4a('0xf')][_0xdb4a('0x11')]);return _0x1730e0(_0xe01436[_0xdb4a('0xf')][_0xdb4a('0x11')]);}else{logger[_0xdb4a('0xa')]('SugarcrmField,\x20%s,\x20%s',_0x22c072,_0xdb4a('0xc'));_0x1730e0(_0xe01436[_0xdb4a('0x12')]['message']);}})[_0xdb4a('0x13')](function(_0x1f22e5){logger[_0xdb4a('0xf')]('SugarcrmField,\x20%s,\x20%s',_0x22c072,_0x1f22e5);_0x51c156(_0x1f22e5);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index 98354c5..522fa48 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 _0xc1c4=['util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','get','index','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','post','create','/:id','update','delete','destroy','exports','multer'];(function(_0xeffc3d,_0x41cc2b){var _0x1b5ec6=function(_0x3f15e6){while(--_0x3f15e6){_0xeffc3d['push'](_0xeffc3d['shift']());}};_0x1b5ec6(++_0x41cc2b);}(_0xc1c4,0x1c7));var _0x4c1c=function(_0x297bcf,_0x380dd9){_0x297bcf=_0x297bcf-0x0;var _0x5782=_0xc1c4[_0x297bcf];return _0x5782;};'use strict';var multer=require(_0x4c1c('0x0'));var util=require(_0x4c1c('0x1'));var path=require(_0x4c1c('0x2'));var timeout=require(_0x4c1c('0x3'));var express=require(_0x4c1c('0x4'));var router=express[_0x4c1c('0x5')]();var fs_extra=require(_0x4c1c('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x4c1c('0x7'));var config=require(_0x4c1c('0x8'));var controller=require(_0x4c1c('0x9'));router[_0x4c1c('0xa')]('/',auth['isAuthenticated'](),controller[_0x4c1c('0xb')]);router['get']('/:id',auth[_0x4c1c('0xc')](),controller[_0x4c1c('0xd')]);router['get'](_0x4c1c('0xe'),auth[_0x4c1c('0xc')](),controller[_0x4c1c('0xf')]);router[_0x4c1c('0xa')](_0x4c1c('0x10'),auth['isAuthenticated'](),controller['getFields']);router[_0x4c1c('0x11')]('/',auth[_0x4c1c('0xc')](),controller[_0x4c1c('0x12')]);router[_0x4c1c('0x11')](_0x4c1c('0xe'),auth[_0x4c1c('0xc')](),controller['addConfiguration']);router['put'](_0x4c1c('0x13'),auth[_0x4c1c('0xc')](),controller[_0x4c1c('0x14')]);router[_0x4c1c('0x15')](_0x4c1c('0x13'),auth['isAuthenticated'](),controller[_0x4c1c('0x16')]);module[_0x4c1c('0x17')]=router; \ No newline at end of file +var _0xe700=['destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration','put','update','delete'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xe700,0x16a));var _0x0e70=function(_0x104329,_0x23d9ca){_0x104329=_0x104329-0x0;var _0x1ca24c=_0xe700[_0x104329];return _0x1ca24c;};'use strict';var multer=require(_0x0e70('0x0'));var util=require(_0x0e70('0x1'));var path=require(_0x0e70('0x2'));var timeout=require(_0x0e70('0x3'));var express=require(_0x0e70('0x4'));var router=express['Router']();var fs_extra=require(_0x0e70('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0e70('0x6'));var config=require(_0x0e70('0x7'));var controller=require('./intVtigerAccount.controller');router['get']('/',auth[_0x0e70('0x8')](),controller[_0x0e70('0x9')]);router[_0x0e70('0xa')](_0x0e70('0xb'),auth['isAuthenticated'](),controller[_0x0e70('0xc')]);router[_0x0e70('0xa')](_0x0e70('0xd'),auth[_0x0e70('0x8')](),controller[_0x0e70('0xe')]);router[_0x0e70('0xa')](_0x0e70('0xf'),auth['isAuthenticated'](),controller[_0x0e70('0x10')]);router[_0x0e70('0x11')]('/',auth[_0x0e70('0x8')](),controller['create']);router[_0x0e70('0x11')](_0x0e70('0xd'),auth[_0x0e70('0x8')](),controller[_0x0e70('0x12')]);router[_0x0e70('0x13')](_0x0e70('0xb'),auth['isAuthenticated'](),controller[_0x0e70('0x14')]);router[_0x0e70('0x15')](_0x0e70('0xb'),auth[_0x0e70('0x8')](),controller[_0x0e70('0x16')]);module[_0x0e70('0x17')]=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index 2dc0cb7..00cc278 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 _0x120e=['HelpDesk','sequelize','exports','STRING'];(function(_0x3337e6,_0x40bd57){var _0x402b4b=function(_0x25cc88){while(--_0x25cc88){_0x3337e6['push'](_0x3337e6['shift']());}};_0x402b4b(++_0x40bd57);}(_0x120e,0x11d));var _0xe120=function(_0x2a2c13,_0x46b0d3){_0x2a2c13=_0x2a2c13-0x0;var _0x993aa9=_0x120e[_0x2a2c13];return _0x993aa9;};'use strict';var Sequelize=require(_0xe120('0x0'));module[_0xe120('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xe120('0x2')]},'username':{'type':Sequelize[_0xe120('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize[_0xe120('0x2')],'allowNull':![],'defaultValue':_0xe120('0x3')},'remoteUri':{'type':Sequelize['STRING'],'allowNull':![]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'accessKey':{'type':Sequelize[_0xe120('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xd9f5=['HelpDesk','sequelize','exports','STRING'];(function(_0x356b90,_0x34034d){var _0x47a2b7=function(_0x1cd6b9){while(--_0x1cd6b9){_0x356b90['push'](_0x356b90['shift']());}};_0x47a2b7(++_0x34034d);}(_0xd9f5,0x1e9));var _0x5d9f=function(_0x6f1a87,_0x5d5bcf){_0x6f1a87=_0x6f1a87-0x0;var _0x2495c7=_0xd9f5[_0x6f1a87];return _0x2495c7;};'use strict';var Sequelize=require(_0x5d9f('0x0'));module[_0x5d9f('0x1')]={'name':{'type':Sequelize[_0x5d9f('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x5d9f('0x2')]},'username':{'type':Sequelize['STRING'],'allowNull':![]},'moduleName':{'type':Sequelize[_0x5d9f('0x2')],'allowNull':![],'defaultValue':_0x5d9f('0x3')},'remoteUri':{'type':Sequelize[_0x5d9f('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x5d9f('0x2')],'allowNull':![]},'accessKey':{'type':Sequelize[_0x5d9f('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 4f5e40b..7217faf 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 _0x5662=['create','body','update','params','getConfigurations','findOne','VtigerConfiguration','order','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','VtigerField','md5','username','description','moduleName','remoteUri','serverUrl','accessKey','slice','substring','lastIndexOf','%s/webservice.php','GET','getchallenge','success','POST','login','result','autogenerated','reference','owner','remove','includes','editable','label','startsWith','picklistValues','value','log','test','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','limit','undefined','count','offset','set','json','apply','reject','then','destroy','sendStatus','error','name','send','index','map','VtigerAccount','rawAttributes','fieldName','key','model','keys','intersection','attributes','fields','length','query','hasOwnProperty','sort','where','filters','pick','merge','type','filter','options','includeAll','findAll','rows','catch','show','include','find'];(function(_0x34a73e,_0x49b7ba){var _0x264111=function(_0x542592){while(--_0x542592){_0x34a73e['push'](_0x34a73e['shift']());}};_0x264111(++_0x49b7ba);}(_0x5662,0xaa));var _0x2566=function(_0x2d5f97,_0x53d1ba){_0x2d5f97=_0x2d5f97-0x0;var _0xb3d085=_0x5662[_0x2d5f97];return _0xb3d085;};'use strict';var emlformat=require(_0x2566('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2566('0x1'));var jsonpatch=require(_0x2566('0x2'));var rp=require(_0x2566('0x3'));var moment=require(_0x2566('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2566('0x5'));var util=require(_0x2566('0x6'));var path=require(_0x2566('0x7'));var sox=require(_0x2566('0x8'));var csv=require('to-csv');var ejs=require(_0x2566('0x9'));var fs=require('fs');var fs_extra=require(_0x2566('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x2566('0xb'));var jsforce=require(_0x2566('0xc'));var deskjs=require(_0x2566('0xd'));var toCsv=require(_0x2566('0xe'));var querystring=require(_0x2566('0xf'));var Papa=require(_0x2566('0x10'));var Redis=require(_0x2566('0x11'));var authService=require(_0x2566('0x12'));var qs=require(_0x2566('0x13'));var as=require(_0x2566('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2566('0x15'))('api');var utils=require(_0x2566('0x16'));var config=require(_0x2566('0x17'));var licenseUtil=require(_0x2566('0x18'));var db=require(_0x2566('0x19'))['db'];var integrations=require(_0x2566('0x1a'));function respondWithStatusCode(_0x3fee99,_0x268f2b){_0x268f2b=_0x268f2b||0xcc;return function(_0x2256b5){if(_0x2256b5){return _0x3fee99['sendStatus'](_0x268f2b);}return _0x3fee99[_0x2566('0x1b')](_0x268f2b)[_0x2566('0x1c')]();};}function respondWithResult(_0x5dd7fc,_0x3f7bde){_0x3f7bde=_0x3f7bde||0xc8;return function(_0x1a707a){if(_0x1a707a){return _0x5dd7fc[_0x2566('0x1b')](_0x3f7bde)['json'](_0x1a707a);}};}function respondWithFilteredResult(_0x403f95,_0x17dffd){return function(_0x1ab1c9){if(_0x1ab1c9){var _0x40763e=typeof _0x17dffd['offset']==='undefined'&&typeof _0x17dffd[_0x2566('0x1d')]===_0x2566('0x1e');var _0x225758=_0x1ab1c9[_0x2566('0x1f')];var _0x4d58ba=_0x40763e?0x0:_0x17dffd[_0x2566('0x20')];var _0x331ccb=_0x40763e?_0x1ab1c9[_0x2566('0x1f')]:_0x17dffd[_0x2566('0x20')]+_0x17dffd[_0x2566('0x1d')];var _0x540b83;if(_0x331ccb>=_0x225758){_0x331ccb=_0x225758;_0x540b83=0xc8;}else{_0x540b83=0xce;}_0x403f95[_0x2566('0x1b')](_0x540b83);return _0x403f95[_0x2566('0x21')]('Content-Range',_0x4d58ba+'-'+_0x331ccb+'/'+_0x225758)[_0x2566('0x22')](_0x1ab1c9);}return null;};}function patchUpdates(_0x45ee96){return function(_0x295351){try{jsonpatch[_0x2566('0x23')](_0x295351,_0x45ee96,!![]);}catch(_0x5cdc98){return BPromise[_0x2566('0x24')](_0x5cdc98);}return _0x295351['save']();};}function saveUpdates(_0x103299,_0x2033f8){return function(_0x2f4359){if(_0x2f4359){return _0x2f4359['update'](_0x103299)[_0x2566('0x25')](function(_0x3950d4){return _0x3950d4;});}return null;};}function removeEntity(_0x55bdff,_0x328ae1){return function(_0x2745f5){if(_0x2745f5){return _0x2745f5[_0x2566('0x26')]()[_0x2566('0x25')](function(){_0x55bdff['status'](0xcc)[_0x2566('0x1c')]();});}};}function handleEntityNotFound(_0x4566b5,_0x44cacd){return function(_0x1bd487){if(!_0x1bd487){_0x4566b5[_0x2566('0x27')](0x194);}return _0x1bd487;};}function handleError(_0x382016,_0x1a3e80){_0x1a3e80=_0x1a3e80||0x1f4;return function(_0x34b5d7){logger[_0x2566('0x28')](_0x34b5d7['stack']);if(_0x34b5d7[_0x2566('0x29')]){delete _0x34b5d7[_0x2566('0x29')];}_0x382016[_0x2566('0x1b')](_0x1a3e80)[_0x2566('0x2a')](_0x34b5d7);};}exports[_0x2566('0x2b')]=function(_0xba62a4,_0x239cdd){var _0x3ce616={},_0x22b3b6={},_0x42282c={'count':0x0,'rows':[]};var _0x3c371b=_[_0x2566('0x2c')](db[_0x2566('0x2d')][_0x2566('0x2e')],function(_0x425933){return{'name':_0x425933[_0x2566('0x2f')],'type':_0x425933['type'][_0x2566('0x30')]};});_0x22b3b6[_0x2566('0x31')]=_[_0x2566('0x2c')](_0x3c371b,_0x2566('0x29'));_0x22b3b6['query']=_[_0x2566('0x32')](_0xba62a4['query']);_0x22b3b6['filters']=_[_0x2566('0x33')](_0x22b3b6[_0x2566('0x31')],_0x22b3b6['query']);_0x3ce616[_0x2566('0x34')]=_[_0x2566('0x33')](_0x22b3b6[_0x2566('0x31')],qs[_0x2566('0x35')](_0xba62a4['query'][_0x2566('0x35')]));_0x3ce616['attributes']=_0x3ce616[_0x2566('0x34')][_0x2566('0x36')]?_0x3ce616['attributes']:_0x22b3b6[_0x2566('0x31')];if(!_0xba62a4[_0x2566('0x37')][_0x2566('0x38')]('nolimit')){_0x3ce616[_0x2566('0x1d')]=qs[_0x2566('0x1d')](_0xba62a4[_0x2566('0x37')]['limit']);_0x3ce616['offset']=qs[_0x2566('0x20')](_0xba62a4[_0x2566('0x37')][_0x2566('0x20')]);}_0x3ce616['order']=qs[_0x2566('0x39')](_0xba62a4[_0x2566('0x37')][_0x2566('0x39')]);_0x3ce616[_0x2566('0x3a')]=qs[_0x2566('0x3b')](_[_0x2566('0x3c')](_0xba62a4[_0x2566('0x37')],_0x22b3b6[_0x2566('0x3b')]),_0x3c371b);if(_0xba62a4['query']['filter']){_0x3ce616[_0x2566('0x3a')]=_[_0x2566('0x3d')](_0x3ce616[_0x2566('0x3a')],{'$or':_['map'](_0x3c371b,function(_0x14ec47){if(_0x14ec47[_0x2566('0x3e')]!=='VIRTUAL'){var _0x43691b={};_0x43691b[_0x14ec47['name']]={'$like':'%'+_0xba62a4[_0x2566('0x37')][_0x2566('0x3f')]+'%'};return _0x43691b;}})});}_0x3ce616=_[_0x2566('0x3d')]({},_0x3ce616,_0xba62a4[_0x2566('0x40')]);var _0x40ba69={'where':_0x3ce616[_0x2566('0x3a')]};return db[_0x2566('0x2d')][_0x2566('0x1f')](_0x40ba69)[_0x2566('0x25')](function(_0x35c56e){_0x42282c[_0x2566('0x1f')]=_0x35c56e;if(_0xba62a4[_0x2566('0x37')][_0x2566('0x41')]){_0x3ce616['include']=[{'all':!![]}];}return db[_0x2566('0x2d')][_0x2566('0x42')](_0x3ce616);})[_0x2566('0x25')](function(_0x685355){_0x42282c[_0x2566('0x43')]=_0x685355;return _0x42282c;})['then'](respondWithFilteredResult(_0x239cdd,_0x3ce616))[_0x2566('0x44')](handleError(_0x239cdd,null));};exports[_0x2566('0x45')]=function(_0x29feb8,_0x422261){var _0x232089={'raw':![],'where':{'id':_0x29feb8['params']['id']}},_0x543283={};_0x543283['model']=_['keys'](db[_0x2566('0x2d')][_0x2566('0x2e')]);_0x543283[_0x2566('0x37')]=_[_0x2566('0x32')](_0x29feb8[_0x2566('0x37')]);_0x543283['filters']=_[_0x2566('0x33')](_0x543283[_0x2566('0x31')],_0x543283[_0x2566('0x37')]);_0x232089['attributes']=_[_0x2566('0x33')](_0x543283[_0x2566('0x31')],qs[_0x2566('0x35')](_0x29feb8[_0x2566('0x37')][_0x2566('0x35')]));_0x232089[_0x2566('0x34')]=_0x232089['attributes'][_0x2566('0x36')]?_0x232089[_0x2566('0x34')]:_0x543283[_0x2566('0x31')];if(_0x29feb8['query'][_0x2566('0x41')]){_0x232089[_0x2566('0x46')]=[{'all':!![]}];}_0x232089=_[_0x2566('0x3d')]({},_0x232089,_0x29feb8['options']);return db[_0x2566('0x2d')][_0x2566('0x47')](_0x232089)[_0x2566('0x25')](handleEntityNotFound(_0x422261,null))[_0x2566('0x25')](respondWithResult(_0x422261,null))[_0x2566('0x44')](handleError(_0x422261,null));};exports[_0x2566('0x48')]=function(_0x50d4fd,_0x3945d0){return db[_0x2566('0x2d')]['create'](_0x50d4fd[_0x2566('0x49')],{})[_0x2566('0x25')](respondWithResult(_0x3945d0,0xc9))[_0x2566('0x44')](handleError(_0x3945d0,null));};exports[_0x2566('0x4a')]=function(_0xc913ed,_0x137bbc){if(_0xc913ed[_0x2566('0x49')]['id']){delete _0xc913ed['body']['id'];}return db['VtigerAccount']['find']({'where':{'id':_0xc913ed['params']['id']}})[_0x2566('0x25')](handleEntityNotFound(_0x137bbc,null))[_0x2566('0x25')](saveUpdates(_0xc913ed[_0x2566('0x49')],null))['then'](respondWithResult(_0x137bbc,null))[_0x2566('0x44')](handleError(_0x137bbc,null));};exports[_0x2566('0x26')]=function(_0x1aeffe,_0x23fc55){return db[_0x2566('0x2d')][_0x2566('0x47')]({'where':{'id':_0x1aeffe[_0x2566('0x4b')]['id']}})[_0x2566('0x25')](handleEntityNotFound(_0x23fc55,null))[_0x2566('0x25')](removeEntity(_0x23fc55,null))[_0x2566('0x44')](handleError(_0x23fc55,null));};exports[_0x2566('0x4c')]=function(_0x56c1bd,_0x1b8eb3,_0x1e08d8){var _0x194718={};var _0x5256c2={};var _0x350a0a;var _0x3ff1c9;return db[_0x2566('0x2d')][_0x2566('0x4d')]({'where':{'id':_0x56c1bd['params']['id']}})[_0x2566('0x25')](handleEntityNotFound(_0x1b8eb3,null))[_0x2566('0x25')](function(_0x10568a){if(_0x10568a){_0x350a0a=_0x10568a;_0x5256c2[_0x2566('0x31')]=_[_0x2566('0x32')](db[_0x2566('0x4e')][_0x2566('0x2e')]);_0x5256c2[_0x2566('0x37')]=_[_0x2566('0x32')](_0x56c1bd[_0x2566('0x37')]);_0x5256c2[_0x2566('0x3b')]=_[_0x2566('0x33')](_0x5256c2[_0x2566('0x31')],_0x5256c2[_0x2566('0x37')]);_0x194718[_0x2566('0x34')]=_[_0x2566('0x33')](_0x5256c2[_0x2566('0x31')],qs[_0x2566('0x35')](_0x56c1bd[_0x2566('0x37')][_0x2566('0x35')]));_0x194718[_0x2566('0x34')]=_0x194718[_0x2566('0x34')][_0x2566('0x36')]?_0x194718[_0x2566('0x34')]:_0x5256c2[_0x2566('0x31')];_0x194718[_0x2566('0x4f')]=qs[_0x2566('0x39')](_0x56c1bd['query'][_0x2566('0x39')]);_0x194718[_0x2566('0x3a')]=qs[_0x2566('0x3b')](_[_0x2566('0x3c')](_0x56c1bd[_0x2566('0x37')],_0x5256c2[_0x2566('0x3b')]));if(_0x56c1bd['query']['filter']){_0x194718[_0x2566('0x3a')]=_[_0x2566('0x3d')](_0x194718['where'],{'$or':_[_0x2566('0x2c')](_0x194718[_0x2566('0x34')],function(_0x5b16c2){var _0xed5c6e={};_0xed5c6e[_0x5b16c2]={'$like':'%'+_0x56c1bd[_0x2566('0x37')]['filter']+'%'};return _0xed5c6e;})});}_0x194718=_[_0x2566('0x3d')]({},_0x194718,_0x56c1bd[_0x2566('0x40')]);return _0x350a0a[_0x2566('0x4c')](_0x194718);}})[_0x2566('0x25')](function(_0x2fbc5a){if(_0x2fbc5a){_0x3ff1c9=_0x2fbc5a['length'];if(!_0x56c1bd[_0x2566('0x37')][_0x2566('0x38')]('nolimit')){_0x194718[_0x2566('0x1d')]=qs[_0x2566('0x1d')](_0x56c1bd[_0x2566('0x37')][_0x2566('0x1d')]);_0x194718[_0x2566('0x20')]=qs[_0x2566('0x20')](_0x56c1bd[_0x2566('0x37')][_0x2566('0x20')]);}return _0x350a0a[_0x2566('0x4c')](_0x194718);}})['then'](function(_0x543c10){if(_0x543c10){return _0x543c10?{'count':_0x3ff1c9,'rows':_0x543c10}:null;}})[_0x2566('0x25')](respondWithResult(_0x1b8eb3,null))[_0x2566('0x44')](handleError(_0x1b8eb3,null));};exports[_0x2566('0x50')]=function(_0x1c51ac,_0x33b321,_0x20f7ac){if(_0x1c51ac[_0x2566('0x49')]['id']){delete _0x1c51ac['body']['id'];}return db[_0x2566('0x2d')]['findOne']({'where':{'id':_0x1c51ac[_0x2566('0x4b')]['id']}})[_0x2566('0x25')](handleEntityNotFound(_0x33b321,null))[_0x2566('0x25')](function(_0x24c485){if(_0x24c485){_0x1c51ac['body'][_0x2566('0x51')]=_0x24c485['id'];_0x1c51ac[_0x2566('0x49')][_0x2566('0x52')]=integrations[_0x2566('0x53')](_0x1c51ac['body']['channel'],_0x1c51ac['body']['type']);_0x1c51ac[_0x2566('0x49')][_0x2566('0x54')]=integrations[_0x2566('0x55')](_0x1c51ac[_0x2566('0x49')][_0x2566('0x56')],_0x1c51ac[_0x2566('0x49')][_0x2566('0x3e')]);return db['VtigerConfiguration'][_0x2566('0x48')](_0x1c51ac[_0x2566('0x49')],{'include':[{'model':db['VtigerField'],'as':_0x2566('0x52')},{'model':db[_0x2566('0x57')],'as':_0x2566('0x54')}]});}return null;})[_0x2566('0x25')](respondWithResult(_0x33b321,null))[_0x2566('0x44')](handleError(_0x33b321,null));};var md5=require(_0x2566('0x58'));exports['getFields']=function(_0xf586,_0x2fe719,_0xe581ef){var _0x375e20=null;var _0x2ba3b4=null;var _0x4d5ac1=null;var _0x49a8fc=null;var _0x2878f2='';return db['VtigerAccount'][_0x2566('0x4d')]({'where':{'id':_0xf586[_0x2566('0x4b')]['id']},'attributes':['id',_0x2566('0x29'),_0x2566('0x59'),_0x2566('0x5a'),_0x2566('0x5b'),_0x2566('0x5c'),_0x2566('0x5d'),_0x2566('0x5e')]})[_0x2566('0x25')](handleEntityNotFound(_0x2fe719,null))[_0x2566('0x25')](function(_0x1612e7){if(_0x1612e7){_0x375e20=_0x1612e7['username'];_0x2ba3b4=_0x1612e7['accessKey'];_0x4d5ac1=_0x1612e7['moduleName'];_0x2878f2=_0x1612e7[_0x2566('0x5c')];var _0x1b7152=_0x2878f2[_0x2566('0x5f')](-0x1);if(_0x1b7152==='/'){_0x2878f2=_0x2878f2[_0x2566('0x60')](0x0,_0x2878f2[_0x2566('0x61')](_0x1b7152));}_0x49a8fc=util['format'](_0x2566('0x62'),_0x2878f2);var _0x4c3787={'method':_0x2566('0x63'),'uri':_0x49a8fc,'qs':{'operation':_0x2566('0x64'),'username':_0x1612e7['username']},'json':!![]};return rp(_0x4c3787);}})['then'](function(_0x252d3c){if(_0x252d3c[_0x2566('0x65')]){var _0x27e933={'method':_0x2566('0x66'),'uri':_0x49a8fc,'form':{'operation':_0x2566('0x67'),'username':_0x375e20,'accessKey':md5(_0x252d3c['result']['token']+_0x2ba3b4)},'json':!![]};return rp(_0x27e933);}})[_0x2566('0x25')](function(_0x1b7185){if(_0x1b7185[_0x2566('0x65')]){var _0x364bf5={'method':_0x2566('0x63'),'uri':_0x49a8fc,'qs':{'operation':'describe','username':_0x375e20,'sessionName':_0x1b7185[_0x2566('0x68')]['sessionName'],'elementType':_0x4d5ac1},'json':!![]};return rp(_0x364bf5);}})[_0x2566('0x25')](function(_0x3a514c){if(_0x3a514c['success']){var _0x317745=[_0x2566('0x69'),_0x2566('0x6a'),_0x2566('0x6b')];_[_0x2566('0x6c')](_0x3a514c[_0x2566('0x68')][_0x2566('0x35')],function(_0x485234){return _0x317745[_0x2566('0x6d')](_0x485234[_0x2566('0x3e')][_0x2566('0x29')]);});_[_0x2566('0x6c')](_0x3a514c['result'][_0x2566('0x35')],function(_0x47959a){return _0x47959a[_0x2566('0x6e')]==='false';});return{'count':_0x3a514c[_0x2566('0x68')][_0x2566('0x35')][_0x2566('0x36')],'rows':_[_0x2566('0x2c')](_0x3a514c[_0x2566('0x68')][_0x2566('0x35')],function(_0x396f55){return{'id':_0x396f55[_0x2566('0x29')],'name':_0x396f55[_0x2566('0x6f')],'custom':_[_0x2566('0x70')](_0x396f55[_0x2566('0x29')],'cf_')?!![]:![],'options':_0x396f55[_0x2566('0x3e')][_0x2566('0x29')]==='picklist'&&_0x396f55[_0x2566('0x3e')][_0x2566('0x71')][_0x2566('0x36')]>0x0?_['map'](_0x396f55[_0x2566('0x3e')][_0x2566('0x71')],function(_0x478a65){return{'name':_0x478a65[_0x2566('0x6f')],'value':_0x478a65[_0x2566('0x72')]};}):[]};})};}})['then'](respondWithResult(_0x2fe719,null))[_0x2566('0x44')](function(_0x328154){console[_0x2566('0x73')]('vTiger\x20error:\x20'+_0x328154);var _0x323adf=_0xf586[_0x2566('0x37')][_0x2566('0x74')]?0x1f4:_0x328154['statusCode']||0x1f4;logger['error'](_0x2566('0x75'),_0x2566('0x76'),_0x323adf,JSON[_0x2566('0x77')](_0x328154));delete _0x328154[_0x2566('0x29')];if(_0x323adf===0x191){_0x323adf=0x190;}_0x2fe719['status'](_0x323adf)['send'](_0xf586[_0x2566('0x37')][_0x2566('0x74')]?{'message':_0x2566('0x78'),'statusCode':_0x328154['statusCode']}:_0x328154);});}; \ No newline at end of file +var _0x5f3f=['hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','create','body','destroy','getConfigurations','VtigerConfiguration','addConfiguration','findOne','AccountId','getSubjects','Descriptions','getDescriptions','VtigerField','Subjects','description','accessKey','username','moduleName','remoteUri','slice','substring','lastIndexOf','GET','getchallenge','success','POST','login','result','token','describe','sessionName','autogenerated','owner','includes','remove','editable','false','label','startsWith','cf_','picklist','picklistValues','vTiger\x20error:\x20','test','statusCode','stringify','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','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/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','sendStatus','error','stack','name','send','index','VtigerAccount','rawAttributes','type','key','map','query','keys','intersection','attributes','model','fields','length'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x5f3f,0x134));var _0xf5f3=function(_0x3c1d98,_0x5e8a76){_0x3c1d98=_0x3c1d98-0x0;var _0x462c73=_0x5f3f[_0x3c1d98];return _0x462c73;};'use strict';var emlformat=require(_0xf5f3('0x0'));var rimraf=require(_0xf5f3('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf5f3('0x2'));var rp=require(_0xf5f3('0x3'));var moment=require('moment');var BPromise=require(_0xf5f3('0x4'));var Mustache=require(_0xf5f3('0x5'));var util=require(_0xf5f3('0x6'));var path=require(_0xf5f3('0x7'));var sox=require(_0xf5f3('0x8'));var csv=require(_0xf5f3('0x9'));var ejs=require(_0xf5f3('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf5f3('0xb'));var squel=require(_0xf5f3('0xc'));var crypto=require(_0xf5f3('0xd'));var jsforce=require(_0xf5f3('0xe'));var deskjs=require(_0xf5f3('0xf'));var toCsv=require(_0xf5f3('0x9'));var querystring=require(_0xf5f3('0x10'));var Papa=require('papaparse');var Redis=require(_0xf5f3('0x11'));var authService=require(_0xf5f3('0x12'));var qs=require(_0xf5f3('0x13'));var as=require(_0xf5f3('0x14'));var hardwareService=require(_0xf5f3('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0xf5f3('0x16'));var config=require(_0xf5f3('0x17'));var licenseUtil=require(_0xf5f3('0x18'));var db=require(_0xf5f3('0x19'))['db'];var integrations=require(_0xf5f3('0x1a'));function respondWithStatusCode(_0x90fcbd,_0x42c982){_0x42c982=_0x42c982||0xcc;return function(_0x5f0010){if(_0x5f0010){return _0x90fcbd['sendStatus'](_0x42c982);}return _0x90fcbd[_0xf5f3('0x1b')](_0x42c982)[_0xf5f3('0x1c')]();};}function respondWithResult(_0x3eacac,_0x5f2d3c){_0x5f2d3c=_0x5f2d3c||0xc8;return function(_0x448b26){if(_0x448b26){return _0x3eacac['status'](_0x5f2d3c)[_0xf5f3('0x1d')](_0x448b26);}};}function respondWithFilteredResult(_0x392d46,_0x52e4f9){return function(_0x344f83){if(_0x344f83){var _0x46de14=typeof _0x52e4f9[_0xf5f3('0x1e')]==='undefined'&&typeof _0x52e4f9[_0xf5f3('0x1f')]===_0xf5f3('0x20');var _0xfed25=_0x344f83[_0xf5f3('0x21')];var _0x54842f=_0x46de14?0x0:_0x52e4f9[_0xf5f3('0x1e')];var _0x6b5f87=_0x46de14?_0x344f83['count']:_0x52e4f9[_0xf5f3('0x1e')]+_0x52e4f9[_0xf5f3('0x1f')];var _0x5e0d86;if(_0x6b5f87>=_0xfed25){_0x6b5f87=_0xfed25;_0x5e0d86=0xc8;}else{_0x5e0d86=0xce;}_0x392d46[_0xf5f3('0x1b')](_0x5e0d86);return _0x392d46[_0xf5f3('0x22')](_0xf5f3('0x23'),_0x54842f+'-'+_0x6b5f87+'/'+_0xfed25)[_0xf5f3('0x1d')](_0x344f83);}return null;};}function patchUpdates(_0x5af3b3){return function(_0x408aa6){try{jsonpatch['apply'](_0x408aa6,_0x5af3b3,!![]);}catch(_0x165a2c){return BPromise[_0xf5f3('0x24')](_0x165a2c);}return _0x408aa6[_0xf5f3('0x25')]();};}function saveUpdates(_0x2822e2,_0x4a3bd0){return function(_0x3b20b3){if(_0x3b20b3){return _0x3b20b3[_0xf5f3('0x26')](_0x2822e2)[_0xf5f3('0x27')](function(_0x38d84d){return _0x38d84d;});}return null;};}function removeEntity(_0x3ba5b1,_0x5a33a0){return function(_0x45516b){if(_0x45516b){return _0x45516b['destroy']()['then'](function(){_0x3ba5b1[_0xf5f3('0x1b')](0xcc)[_0xf5f3('0x1c')]();});}};}function handleEntityNotFound(_0x100e7f,_0x3cc322){return function(_0x408d10){if(!_0x408d10){_0x100e7f[_0xf5f3('0x28')](0x194);}return _0x408d10;};}function handleError(_0xebc6a1,_0x242288){_0x242288=_0x242288||0x1f4;return function(_0x1390b9){logger[_0xf5f3('0x29')](_0x1390b9[_0xf5f3('0x2a')]);if(_0x1390b9[_0xf5f3('0x2b')]){delete _0x1390b9[_0xf5f3('0x2b')];}_0xebc6a1['status'](_0x242288)[_0xf5f3('0x2c')](_0x1390b9);};}exports[_0xf5f3('0x2d')]=function(_0x2010a5,_0x283777){var _0x42865d={},_0x2c6753={},_0x557829={'count':0x0,'rows':[]};var _0x1ecde2=_['map'](db[_0xf5f3('0x2e')][_0xf5f3('0x2f')],function(_0x339dce){return{'name':_0x339dce['fieldName'],'type':_0x339dce[_0xf5f3('0x30')][_0xf5f3('0x31')]};});_0x2c6753['model']=_[_0xf5f3('0x32')](_0x1ecde2,_0xf5f3('0x2b'));_0x2c6753[_0xf5f3('0x33')]=_[_0xf5f3('0x34')](_0x2010a5[_0xf5f3('0x33')]);_0x2c6753['filters']=_[_0xf5f3('0x35')](_0x2c6753['model'],_0x2c6753[_0xf5f3('0x33')]);_0x42865d[_0xf5f3('0x36')]=_['intersection'](_0x2c6753[_0xf5f3('0x37')],qs[_0xf5f3('0x38')](_0x2010a5[_0xf5f3('0x33')]['fields']));_0x42865d[_0xf5f3('0x36')]=_0x42865d[_0xf5f3('0x36')][_0xf5f3('0x39')]?_0x42865d[_0xf5f3('0x36')]:_0x2c6753[_0xf5f3('0x37')];if(!_0x2010a5['query'][_0xf5f3('0x3a')](_0xf5f3('0x3b'))){_0x42865d[_0xf5f3('0x1f')]=qs[_0xf5f3('0x1f')](_0x2010a5['query'][_0xf5f3('0x1f')]);_0x42865d[_0xf5f3('0x1e')]=qs[_0xf5f3('0x1e')](_0x2010a5[_0xf5f3('0x33')]['offset']);}_0x42865d[_0xf5f3('0x3c')]=qs[_0xf5f3('0x3d')](_0x2010a5[_0xf5f3('0x33')][_0xf5f3('0x3d')]);_0x42865d[_0xf5f3('0x3e')]=qs[_0xf5f3('0x3f')](_[_0xf5f3('0x40')](_0x2010a5[_0xf5f3('0x33')],_0x2c6753[_0xf5f3('0x3f')]),_0x1ecde2);if(_0x2010a5[_0xf5f3('0x33')][_0xf5f3('0x41')]){_0x42865d[_0xf5f3('0x3e')]=_[_0xf5f3('0x42')](_0x42865d[_0xf5f3('0x3e')],{'$or':_[_0xf5f3('0x32')](_0x1ecde2,function(_0x1b6c5f){if(_0x1b6c5f['type']!==_0xf5f3('0x43')){var _0x218cab={};_0x218cab[_0x1b6c5f[_0xf5f3('0x2b')]]={'$like':'%'+_0x2010a5[_0xf5f3('0x33')][_0xf5f3('0x41')]+'%'};return _0x218cab;}})});}_0x42865d=_[_0xf5f3('0x42')]({},_0x42865d,_0x2010a5[_0xf5f3('0x44')]);var _0x17a4b8={'where':_0x42865d[_0xf5f3('0x3e')]};return db['VtigerAccount']['count'](_0x17a4b8)[_0xf5f3('0x27')](function(_0x35aca7){_0x557829[_0xf5f3('0x21')]=_0x35aca7;if(_0x2010a5[_0xf5f3('0x33')][_0xf5f3('0x45')]){_0x42865d[_0xf5f3('0x46')]=[{'all':!![]}];}return db[_0xf5f3('0x2e')][_0xf5f3('0x47')](_0x42865d);})[_0xf5f3('0x27')](function(_0x4c5fec){_0x557829[_0xf5f3('0x48')]=_0x4c5fec;return _0x557829;})[_0xf5f3('0x27')](respondWithFilteredResult(_0x283777,_0x42865d))[_0xf5f3('0x49')](handleError(_0x283777,null));};exports['show']=function(_0x5ab280,_0x498468){var _0x22e37e={'raw':![],'where':{'id':_0x5ab280[_0xf5f3('0x4a')]['id']}},_0x50926b={};_0x50926b[_0xf5f3('0x37')]=_[_0xf5f3('0x34')](db[_0xf5f3('0x2e')]['rawAttributes']);_0x50926b[_0xf5f3('0x33')]=_[_0xf5f3('0x34')](_0x5ab280[_0xf5f3('0x33')]);_0x50926b[_0xf5f3('0x3f')]=_[_0xf5f3('0x35')](_0x50926b[_0xf5f3('0x37')],_0x50926b[_0xf5f3('0x33')]);_0x22e37e[_0xf5f3('0x36')]=_[_0xf5f3('0x35')](_0x50926b['model'],qs[_0xf5f3('0x38')](_0x5ab280[_0xf5f3('0x33')][_0xf5f3('0x38')]));_0x22e37e['attributes']=_0x22e37e[_0xf5f3('0x36')][_0xf5f3('0x39')]?_0x22e37e[_0xf5f3('0x36')]:_0x50926b[_0xf5f3('0x37')];if(_0x5ab280['query'][_0xf5f3('0x45')]){_0x22e37e['include']=[{'all':!![]}];}_0x22e37e=_[_0xf5f3('0x42')]({},_0x22e37e,_0x5ab280['options']);return db['VtigerAccount'][_0xf5f3('0x4b')](_0x22e37e)[_0xf5f3('0x27')](handleEntityNotFound(_0x498468,null))[_0xf5f3('0x27')](respondWithResult(_0x498468,null))['catch'](handleError(_0x498468,null));};exports[_0xf5f3('0x4c')]=function(_0x68d7ab,_0x172171){return db[_0xf5f3('0x2e')]['create'](_0x68d7ab[_0xf5f3('0x4d')],{})[_0xf5f3('0x27')](respondWithResult(_0x172171,0xc9))['catch'](handleError(_0x172171,null));};exports[_0xf5f3('0x26')]=function(_0xa2dc2d,_0x57407a){if(_0xa2dc2d[_0xf5f3('0x4d')]['id']){delete _0xa2dc2d[_0xf5f3('0x4d')]['id'];}return db[_0xf5f3('0x2e')]['find']({'where':{'id':_0xa2dc2d['params']['id']}})[_0xf5f3('0x27')](handleEntityNotFound(_0x57407a,null))[_0xf5f3('0x27')](saveUpdates(_0xa2dc2d['body'],null))['then'](respondWithResult(_0x57407a,null))['catch'](handleError(_0x57407a,null));};exports[_0xf5f3('0x4e')]=function(_0x349b94,_0x405428){return db[_0xf5f3('0x2e')]['find']({'where':{'id':_0x349b94['params']['id']}})[_0xf5f3('0x27')](handleEntityNotFound(_0x405428,null))[_0xf5f3('0x27')](removeEntity(_0x405428,null))['catch'](handleError(_0x405428,null));};exports[_0xf5f3('0x4f')]=function(_0x12bb5e,_0x4ce191,_0x4e3c1f){var _0x46245b={};var _0x426cff={};var _0x3418bd;var _0x2cabaa;return db[_0xf5f3('0x2e')]['findOne']({'where':{'id':_0x12bb5e[_0xf5f3('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4ce191,null))[_0xf5f3('0x27')](function(_0x566f5a){if(_0x566f5a){_0x3418bd=_0x566f5a;_0x426cff['model']=_['keys'](db[_0xf5f3('0x50')][_0xf5f3('0x2f')]);_0x426cff[_0xf5f3('0x33')]=_[_0xf5f3('0x34')](_0x12bb5e[_0xf5f3('0x33')]);_0x426cff[_0xf5f3('0x3f')]=_[_0xf5f3('0x35')](_0x426cff[_0xf5f3('0x37')],_0x426cff[_0xf5f3('0x33')]);_0x46245b[_0xf5f3('0x36')]=_[_0xf5f3('0x35')](_0x426cff[_0xf5f3('0x37')],qs[_0xf5f3('0x38')](_0x12bb5e[_0xf5f3('0x33')]['fields']));_0x46245b['attributes']=_0x46245b[_0xf5f3('0x36')][_0xf5f3('0x39')]?_0x46245b[_0xf5f3('0x36')]:_0x426cff[_0xf5f3('0x37')];_0x46245b['order']=qs[_0xf5f3('0x3d')](_0x12bb5e[_0xf5f3('0x33')][_0xf5f3('0x3d')]);_0x46245b[_0xf5f3('0x3e')]=qs['filters'](_['pick'](_0x12bb5e['query'],_0x426cff['filters']));if(_0x12bb5e[_0xf5f3('0x33')]['filter']){_0x46245b[_0xf5f3('0x3e')]=_['merge'](_0x46245b['where'],{'$or':_[_0xf5f3('0x32')](_0x46245b[_0xf5f3('0x36')],function(_0x40df16){var _0x1c3865={};_0x1c3865[_0x40df16]={'$like':'%'+_0x12bb5e['query'][_0xf5f3('0x41')]+'%'};return _0x1c3865;})});}_0x46245b=_[_0xf5f3('0x42')]({},_0x46245b,_0x12bb5e[_0xf5f3('0x44')]);return _0x3418bd[_0xf5f3('0x4f')](_0x46245b);}})[_0xf5f3('0x27')](function(_0x5d031b){if(_0x5d031b){_0x2cabaa=_0x5d031b[_0xf5f3('0x39')];if(!_0x12bb5e['query']['hasOwnProperty'](_0xf5f3('0x3b'))){_0x46245b['limit']=qs[_0xf5f3('0x1f')](_0x12bb5e['query'][_0xf5f3('0x1f')]);_0x46245b[_0xf5f3('0x1e')]=qs[_0xf5f3('0x1e')](_0x12bb5e[_0xf5f3('0x33')][_0xf5f3('0x1e')]);}return _0x3418bd[_0xf5f3('0x4f')](_0x46245b);}})['then'](function(_0x350d39){if(_0x350d39){return _0x350d39?{'count':_0x2cabaa,'rows':_0x350d39}:null;}})[_0xf5f3('0x27')](respondWithResult(_0x4ce191,null))['catch'](handleError(_0x4ce191,null));};exports[_0xf5f3('0x51')]=function(_0x38d6b0,_0x53cec7,_0x59edc0){if(_0x38d6b0[_0xf5f3('0x4d')]['id']){delete _0x38d6b0['body']['id'];}return db[_0xf5f3('0x2e')][_0xf5f3('0x52')]({'where':{'id':_0x38d6b0[_0xf5f3('0x4a')]['id']}})[_0xf5f3('0x27')](handleEntityNotFound(_0x53cec7,null))[_0xf5f3('0x27')](function(_0x137e6e){if(_0x137e6e){_0x38d6b0[_0xf5f3('0x4d')][_0xf5f3('0x53')]=_0x137e6e['id'];_0x38d6b0[_0xf5f3('0x4d')]['Subjects']=integrations[_0xf5f3('0x54')](_0x38d6b0[_0xf5f3('0x4d')]['channel'],_0x38d6b0[_0xf5f3('0x4d')][_0xf5f3('0x30')]);_0x38d6b0[_0xf5f3('0x4d')][_0xf5f3('0x55')]=integrations[_0xf5f3('0x56')](_0x38d6b0['body']['channel'],_0x38d6b0[_0xf5f3('0x4d')]['type']);return db['VtigerConfiguration']['create'](_0x38d6b0['body'],{'include':[{'model':db[_0xf5f3('0x57')],'as':_0xf5f3('0x58')},{'model':db[_0xf5f3('0x57')],'as':_0xf5f3('0x55')}]});}return null;})[_0xf5f3('0x27')](respondWithResult(_0x53cec7,null))[_0xf5f3('0x49')](handleError(_0x53cec7,null));};var md5=require('md5');exports['getFields']=function(_0x131755,_0x2333f8,_0x10c216){var _0x49ff41=null;var _0x5a66b6=null;var _0x108e16=null;var _0x21ab74=null;var _0xd155e9='';return db[_0xf5f3('0x2e')]['findOne']({'where':{'id':_0x131755[_0xf5f3('0x4a')]['id']},'attributes':['id',_0xf5f3('0x2b'),'username',_0xf5f3('0x59'),'moduleName','remoteUri','serverUrl',_0xf5f3('0x5a')]})['then'](handleEntityNotFound(_0x2333f8,null))[_0xf5f3('0x27')](function(_0x507767){if(_0x507767){_0x49ff41=_0x507767[_0xf5f3('0x5b')];_0x5a66b6=_0x507767['accessKey'];_0x108e16=_0x507767[_0xf5f3('0x5c')];_0xd155e9=_0x507767[_0xf5f3('0x5d')];var _0x3414dc=_0xd155e9[_0xf5f3('0x5e')](-0x1);if(_0x3414dc==='/'){_0xd155e9=_0xd155e9[_0xf5f3('0x5f')](0x0,_0xd155e9[_0xf5f3('0x60')](_0x3414dc));}_0x21ab74=util['format']('%s/webservice.php',_0xd155e9);var _0x1915bd={'method':_0xf5f3('0x61'),'uri':_0x21ab74,'qs':{'operation':_0xf5f3('0x62'),'username':_0x507767[_0xf5f3('0x5b')]},'json':!![]};return rp(_0x1915bd);}})[_0xf5f3('0x27')](function(_0x430318){if(_0x430318[_0xf5f3('0x63')]){var _0x1255b8={'method':_0xf5f3('0x64'),'uri':_0x21ab74,'form':{'operation':_0xf5f3('0x65'),'username':_0x49ff41,'accessKey':md5(_0x430318[_0xf5f3('0x66')][_0xf5f3('0x67')]+_0x5a66b6)},'json':!![]};return rp(_0x1255b8);}})['then'](function(_0x594e14){if(_0x594e14[_0xf5f3('0x63')]){var _0x449969={'method':'GET','uri':_0x21ab74,'qs':{'operation':_0xf5f3('0x68'),'username':_0x49ff41,'sessionName':_0x594e14[_0xf5f3('0x66')][_0xf5f3('0x69')],'elementType':_0x108e16},'json':!![]};return rp(_0x449969);}})[_0xf5f3('0x27')](function(_0x182ceb){if(_0x182ceb[_0xf5f3('0x63')]){var _0x4b0bcb=[_0xf5f3('0x6a'),'reference',_0xf5f3('0x6b')];_['remove'](_0x182ceb[_0xf5f3('0x66')]['fields'],function(_0x386d99){return _0x4b0bcb[_0xf5f3('0x6c')](_0x386d99['type'][_0xf5f3('0x2b')]);});_[_0xf5f3('0x6d')](_0x182ceb[_0xf5f3('0x66')]['fields'],function(_0x14c9ba){return _0x14c9ba[_0xf5f3('0x6e')]===_0xf5f3('0x6f');});return{'count':_0x182ceb[_0xf5f3('0x66')][_0xf5f3('0x38')][_0xf5f3('0x39')],'rows':_[_0xf5f3('0x32')](_0x182ceb[_0xf5f3('0x66')][_0xf5f3('0x38')],function(_0x56f855){return{'id':_0x56f855[_0xf5f3('0x2b')],'name':_0x56f855[_0xf5f3('0x70')],'custom':_[_0xf5f3('0x71')](_0x56f855['name'],_0xf5f3('0x72'))?!![]:![],'options':_0x56f855[_0xf5f3('0x30')][_0xf5f3('0x2b')]===_0xf5f3('0x73')&&_0x56f855[_0xf5f3('0x30')][_0xf5f3('0x74')][_0xf5f3('0x39')]>0x0?_[_0xf5f3('0x32')](_0x56f855[_0xf5f3('0x30')][_0xf5f3('0x74')],function(_0x1cb527){return{'name':_0x1cb527[_0xf5f3('0x70')],'value':_0x1cb527['value']};}):[]};})};}})[_0xf5f3('0x27')](respondWithResult(_0x2333f8,null))['catch'](function(_0x1134c4){console['log'](_0xf5f3('0x75')+_0x1134c4);var _0x1395ea=_0x131755[_0xf5f3('0x33')][_0xf5f3('0x76')]?0x1f4:_0x1134c4[_0xf5f3('0x77')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x1395ea,JSON[_0xf5f3('0x78')](_0x1134c4));delete _0x1134c4['name'];if(_0x1395ea===0x191){_0x1395ea=0x190;}_0x2333f8[_0xf5f3('0x1b')](_0x1395ea)[_0xf5f3('0x2c')](_0x131755[_0xf5f3('0x33')][_0xf5f3('0x76')]?{'message':_0xf5f3('0x79'),'statusCode':_0x1134c4['statusCode']}:_0x1134c4);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index acbe92f..9a8e193 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 _0x02fb=['moment','bluebird','path','rimraf','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','define','int_vtiger_accounts','lodash','util','../../config/logger','api'];(function(_0x44b124,_0x53f626){var _0x4ada33=function(_0x442b57){while(--_0x442b57){_0x44b124['push'](_0x44b124['shift']());}};_0x4ada33(++_0x53f626);}(_0x02fb,0x1b6));var _0xb02f=function(_0xa8ce3b,_0x36d83d){_0xa8ce3b=_0xa8ce3b-0x0;var _0x4a894e=_0x02fb[_0xa8ce3b];return _0x4a894e;};'use strict';var _=require(_0xb02f('0x0'));var util=require(_0xb02f('0x1'));var logger=require(_0xb02f('0x2'))(_0xb02f('0x3'));var moment=require(_0xb02f('0x4'));var BPromise=require(_0xb02f('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb02f('0x6'));var rimraf=require(_0xb02f('0x7'));var config=require('../../config/environment');var attributes=require(_0xb02f('0x8'));var integrations=require(_0xb02f('0x9'));module[_0xb02f('0xa')]=function(_0x219abe,_0x38b740){return _0x219abe[_0xb02f('0xb')]('VtigerAccount',attributes,{'tableName':_0xb02f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa1cc=['util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','define','lodash'];(function(_0x11dee6,_0x6ccf04){var _0x1315d6=function(_0x1fc74d){while(--_0x1fc74d){_0x11dee6['push'](_0x11dee6['shift']());}};_0x1315d6(++_0x6ccf04);}(_0xa1cc,0x1bb));var _0xca1c=function(_0x50ac53,_0x449656){_0x50ac53=_0x50ac53-0x0;var _0x2e6a80=_0xa1cc[_0x50ac53];return _0x2e6a80;};'use strict';var _=require(_0xca1c('0x0'));var util=require(_0xca1c('0x1'));var logger=require(_0xca1c('0x2'))('api');var moment=require('moment');var BPromise=require(_0xca1c('0x3'));var rp=require(_0xca1c('0x4'));var fs=require('fs');var path=require(_0xca1c('0x5'));var rimraf=require(_0xca1c('0x6'));var config=require(_0xca1c('0x7'));var attributes=require(_0xca1c('0x8'));var integrations=require(_0xca1c('0x9'));module[_0xca1c('0xa')]=function(_0x12e76b,_0x445094){return _0x12e76b[_0xca1c('0xb')]('VtigerAccount',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 df7c849..4c824b5 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 _0x6c76=['findAll','options','raw','where','attributes','map','include','model','GetVtigerAccount','debug','ShowVtigerAccount','VtigerAccount','find','then','lodash','util','moment','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','request','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x1b4c64,_0xc02907){var _0x114ace=function(_0x1cc386){while(--_0x1cc386){_0x1b4c64['push'](_0x1b4c64['shift']());}};_0x114ace(++_0xc02907);}(_0x6c76,0x184));var _0x66c7=function(_0x1e2215,_0x2b2bd5){_0x1e2215=_0x1e2215-0x0;var _0x28f0cf=_0x6c76[_0x1e2215];return _0x28f0cf;};'use strict';var _=require(_0x66c7('0x0'));var util=require(_0x66c7('0x1'));var moment=require(_0x66c7('0x2'));var BPromise=require('bluebird');var rs=require(_0x66c7('0x3'));var fs=require('fs');var Redis=require(_0x66c7('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x66c7('0x5'))(_0x66c7('0x6'));var config=require('../../config/environment');var jayson=require(_0x66c7('0x7'));var client=jayson[_0x66c7('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x23408c,_0x4dffcd,_0x4fa6ce){return new BPromise(function(_0x208d06,_0x2b0065){return client[_0x66c7('0x9')](_0x23408c,_0x4fa6ce)['then'](function(_0x20c010){logger[_0x66c7('0xa')](_0x66c7('0xb'),_0x4dffcd,_0x66c7('0xc'));logger['debug'](_0x66c7('0xd'),_0x4dffcd,_0x66c7('0xc'),JSON[_0x66c7('0xe')](_0x20c010));if(_0x20c010[_0x66c7('0xf')]){if(_0x20c010[_0x66c7('0xf')][_0x66c7('0x10')]===0x1f4){logger[_0x66c7('0xf')]('VtigerAccount,\x20%s,\x20%s',_0x4dffcd,_0x20c010[_0x66c7('0xf')][_0x66c7('0x11')]);return _0x2b0065(_0x20c010[_0x66c7('0xf')][_0x66c7('0x11')]);}logger[_0x66c7('0xf')](_0x66c7('0xb'),_0x4dffcd,_0x20c010[_0x66c7('0xf')][_0x66c7('0x11')]);return _0x208d06(_0x20c010[_0x66c7('0xf')]['message']);}else{logger[_0x66c7('0xa')]('VtigerAccount,\x20%s,\x20%s',_0x4dffcd,_0x66c7('0xc'));_0x208d06(_0x20c010[_0x66c7('0x12')][_0x66c7('0x11')]);}})[_0x66c7('0x13')](function(_0x22b262){logger['error']('VtigerAccount,\x20%s,\x20%s',_0x4dffcd,_0x22b262);_0x2b0065(_0x22b262);});});}exports['GetVtigerAccount']=function(_0x5129f6){var _0x8ad572=this;return new Promise(function(_0x19f29d,_0x47a299){return db['VtigerAccount'][_0x66c7('0x14')]({'raw':_0x5129f6[_0x66c7('0x15')]?_0x5129f6[_0x66c7('0x15')][_0x66c7('0x16')]===undefined?!![]:![]:!![],'where':_0x5129f6['options']?_0x5129f6['options'][_0x66c7('0x17')]||null:null,'attributes':_0x5129f6[_0x66c7('0x15')]?_0x5129f6[_0x66c7('0x15')][_0x66c7('0x18')]||null:null,'limit':_0x5129f6[_0x66c7('0x15')]?_0x5129f6[_0x66c7('0x15')]['limit']||null:null,'include':_0x5129f6[_0x66c7('0x15')]?_0x5129f6[_0x66c7('0x15')]['include']?_[_0x66c7('0x19')](_0x5129f6[_0x66c7('0x15')][_0x66c7('0x1a')],function(_0x1fc9d3){return{'model':db[_0x1fc9d3['model']],'as':_0x1fc9d3['as'],'attributes':_0x1fc9d3[_0x66c7('0x18')],'include':_0x1fc9d3[_0x66c7('0x1a')]?_['map'](_0x1fc9d3[_0x66c7('0x1a')],function(_0x11a6b9){return{'model':db[_0x11a6b9[_0x66c7('0x1b')]],'as':_0x11a6b9['as'],'attributes':_0x11a6b9[_0x66c7('0x18')],'include':_0x11a6b9[_0x66c7('0x1a')]?_['map'](_0x11a6b9['include'],function(_0x4e514a){return{'model':db[_0x4e514a[_0x66c7('0x1b')]],'as':_0x4e514a['as'],'attributes':_0x4e514a[_0x66c7('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x9afd50){logger[_0x66c7('0xa')](_0x66c7('0x1c'),_0x5129f6);logger[_0x66c7('0x1d')](_0x66c7('0x1c'),_0x5129f6,JSON[_0x66c7('0xe')](_0x9afd50));_0x19f29d(_0x9afd50);})['catch'](function(_0xccefb2){logger[_0x66c7('0xf')](_0x66c7('0x1c'),_0xccefb2[_0x66c7('0x11')],_0x5129f6);_0x47a299(_0x8ad572[_0x66c7('0xf')](0x1f4,_0xccefb2['message']));});});};exports[_0x66c7('0x1e')]=function(_0x4f1a34){var _0xfbd97=this;return new Promise(function(_0x543fbf,_0x296875){return db[_0x66c7('0x1f')][_0x66c7('0x20')]({'raw':_0x4f1a34[_0x66c7('0x15')]?_0x4f1a34[_0x66c7('0x15')][_0x66c7('0x16')]===undefined?!![]:![]:!![],'where':_0x4f1a34['options']?_0x4f1a34['options'][_0x66c7('0x17')]||null:null,'attributes':_0x4f1a34[_0x66c7('0x15')]?_0x4f1a34[_0x66c7('0x15')][_0x66c7('0x18')]||null:null,'include':_0x4f1a34[_0x66c7('0x15')]?_0x4f1a34[_0x66c7('0x15')][_0x66c7('0x1a')]?_[_0x66c7('0x19')](_0x4f1a34[_0x66c7('0x15')][_0x66c7('0x1a')],function(_0x1fd460){return{'model':db[_0x1fd460[_0x66c7('0x1b')]],'as':_0x1fd460['as'],'attributes':_0x1fd460['attributes'],'include':_0x1fd460['include']?_[_0x66c7('0x19')](_0x1fd460[_0x66c7('0x1a')],function(_0x367ad5){return{'model':db[_0x367ad5[_0x66c7('0x1b')]],'as':_0x367ad5['as'],'attributes':_0x367ad5[_0x66c7('0x18')],'include':_0x367ad5[_0x66c7('0x1a')]?_[_0x66c7('0x19')](_0x367ad5['include'],function(_0x30b90f){return{'model':db[_0x30b90f[_0x66c7('0x1b')]],'as':_0x30b90f['as'],'attributes':_0x30b90f[_0x66c7('0x18')]};}):[]};}):[]};}):[]:[]})[_0x66c7('0x21')](function(_0x1e5993){logger[_0x66c7('0xa')](_0x66c7('0x1e'),_0x4f1a34);logger[_0x66c7('0x1d')](_0x66c7('0x1e'),_0x4f1a34,JSON[_0x66c7('0xe')](_0x1e5993));_0x543fbf(_0x1e5993);})[_0x66c7('0x13')](function(_0x4cd663){logger['error'](_0x66c7('0x1e'),_0x4cd663[_0x66c7('0x11')],_0x4f1a34);_0x296875(_0xfbd97[_0x66c7('0xf')](0x1f4,_0x4cd663['message']));});});}; \ No newline at end of file +var _0x3f8c=['jayson/promise','client','http','request','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetVtigerAccount','VtigerAccount','findAll','options','where','attributes','limit','include','map','model','debug','catch','find','raw','ShowVtigerAccount','moment','bluebird','randomstring','ioredis'];(function(_0x393d69,_0x3a8c83){var _0x3cee37=function(_0x462682){while(--_0x462682){_0x393d69['push'](_0x393d69['shift']());}};_0x3cee37(++_0x3a8c83);}(_0x3f8c,0x104));var _0xc3f8=function(_0x424e91,_0x3e5d80){_0x424e91=_0x424e91-0x0;var _0x1764ca=_0x3f8c[_0x424e91];return _0x1764ca;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xc3f8('0x0'));var BPromise=require(_0xc3f8('0x1'));var rs=require(_0xc3f8('0x2'));var fs=require('fs');var Redis=require(_0xc3f8('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xc3f8('0x4'));var client=jayson[_0xc3f8('0x5')][_0xc3f8('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x44c25d,_0x2bbaa5,_0x15512a){return new BPromise(function(_0x51093a,_0x28397e){return client[_0xc3f8('0x7')](_0x44c25d,_0x15512a)[_0xc3f8('0x8')](function(_0x3c340c){logger[_0xc3f8('0x9')](_0xc3f8('0xa'),_0x2bbaa5,_0xc3f8('0xb'));logger['debug'](_0xc3f8('0xc'),_0x2bbaa5,_0xc3f8('0xb'),JSON[_0xc3f8('0xd')](_0x3c340c));if(_0x3c340c[_0xc3f8('0xe')]){if(_0x3c340c['error'][_0xc3f8('0xf')]===0x1f4){logger[_0xc3f8('0xe')](_0xc3f8('0xa'),_0x2bbaa5,_0x3c340c[_0xc3f8('0xe')]['message']);return _0x28397e(_0x3c340c[_0xc3f8('0xe')][_0xc3f8('0x10')]);}logger[_0xc3f8('0xe')](_0xc3f8('0xa'),_0x2bbaa5,_0x3c340c[_0xc3f8('0xe')][_0xc3f8('0x10')]);return _0x51093a(_0x3c340c[_0xc3f8('0xe')][_0xc3f8('0x10')]);}else{logger[_0xc3f8('0x9')](_0xc3f8('0xa'),_0x2bbaa5,_0xc3f8('0xb'));_0x51093a(_0x3c340c[_0xc3f8('0x11')][_0xc3f8('0x10')]);}})['catch'](function(_0x14b3ed){logger['error']('VtigerAccount,\x20%s,\x20%s',_0x2bbaa5,_0x14b3ed);_0x28397e(_0x14b3ed);});});}exports[_0xc3f8('0x12')]=function(_0x2e7c0f){var _0x35500f=this;return new Promise(function(_0xb4ab67,_0x47a185){return db[_0xc3f8('0x13')][_0xc3f8('0x14')]({'raw':_0x2e7c0f['options']?_0x2e7c0f[_0xc3f8('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x2e7c0f[_0xc3f8('0x15')]?_0x2e7c0f[_0xc3f8('0x15')][_0xc3f8('0x16')]||null:null,'attributes':_0x2e7c0f['options']?_0x2e7c0f['options'][_0xc3f8('0x17')]||null:null,'limit':_0x2e7c0f[_0xc3f8('0x15')]?_0x2e7c0f[_0xc3f8('0x15')][_0xc3f8('0x18')]||null:null,'include':_0x2e7c0f[_0xc3f8('0x15')]?_0x2e7c0f[_0xc3f8('0x15')][_0xc3f8('0x19')]?_[_0xc3f8('0x1a')](_0x2e7c0f['options']['include'],function(_0x4b83f0){return{'model':db[_0x4b83f0[_0xc3f8('0x1b')]],'as':_0x4b83f0['as'],'attributes':_0x4b83f0['attributes'],'include':_0x4b83f0[_0xc3f8('0x19')]?_[_0xc3f8('0x1a')](_0x4b83f0['include'],function(_0x4569c2){return{'model':db[_0x4569c2[_0xc3f8('0x1b')]],'as':_0x4569c2['as'],'attributes':_0x4569c2[_0xc3f8('0x17')],'include':_0x4569c2[_0xc3f8('0x19')]?_[_0xc3f8('0x1a')](_0x4569c2[_0xc3f8('0x19')],function(_0xf1d460){return{'model':db[_0xf1d460[_0xc3f8('0x1b')]],'as':_0xf1d460['as'],'attributes':_0xf1d460[_0xc3f8('0x17')]};}):[]};}):[]};}):[]:[]})[_0xc3f8('0x8')](function(_0x22c8e6){logger[_0xc3f8('0x9')](_0xc3f8('0x12'),_0x2e7c0f);logger[_0xc3f8('0x1c')]('GetVtigerAccount',_0x2e7c0f,JSON[_0xc3f8('0xd')](_0x22c8e6));_0xb4ab67(_0x22c8e6);})[_0xc3f8('0x1d')](function(_0x218029){logger['error'](_0xc3f8('0x12'),_0x218029['message'],_0x2e7c0f);_0x47a185(_0x35500f[_0xc3f8('0xe')](0x1f4,_0x218029[_0xc3f8('0x10')]));});});};exports['ShowVtigerAccount']=function(_0x48b32e){var _0x21a225=this;return new Promise(function(_0x25df65,_0xd32b09){return db[_0xc3f8('0x13')][_0xc3f8('0x1e')]({'raw':_0x48b32e[_0xc3f8('0x15')]?_0x48b32e[_0xc3f8('0x15')][_0xc3f8('0x1f')]===undefined?!![]:![]:!![],'where':_0x48b32e[_0xc3f8('0x15')]?_0x48b32e[_0xc3f8('0x15')]['where']||null:null,'attributes':_0x48b32e[_0xc3f8('0x15')]?_0x48b32e[_0xc3f8('0x15')][_0xc3f8('0x17')]||null:null,'include':_0x48b32e[_0xc3f8('0x15')]?_0x48b32e[_0xc3f8('0x15')]['include']?_['map'](_0x48b32e[_0xc3f8('0x15')][_0xc3f8('0x19')],function(_0x76ef00){return{'model':db[_0x76ef00[_0xc3f8('0x1b')]],'as':_0x76ef00['as'],'attributes':_0x76ef00[_0xc3f8('0x17')],'include':_0x76ef00['include']?_[_0xc3f8('0x1a')](_0x76ef00[_0xc3f8('0x19')],function(_0x2ba6aa){return{'model':db[_0x2ba6aa['model']],'as':_0x2ba6aa['as'],'attributes':_0x2ba6aa[_0xc3f8('0x17')],'include':_0x2ba6aa[_0xc3f8('0x19')]?_[_0xc3f8('0x1a')](_0x2ba6aa['include'],function(_0x21a725){return{'model':db[_0x21a725[_0xc3f8('0x1b')]],'as':_0x21a725['as'],'attributes':_0x21a725['attributes']};}):[]};}):[]};}):[]:[]})[_0xc3f8('0x8')](function(_0x84d5d2){logger[_0xc3f8('0x9')](_0xc3f8('0x20'),_0x48b32e);logger[_0xc3f8('0x1c')](_0xc3f8('0x20'),_0x48b32e,JSON['stringify'](_0x84d5d2));_0x25df65(_0x84d5d2);})[_0xc3f8('0x1d')](function(_0x2e4880){logger[_0xc3f8('0xe')](_0xc3f8('0x20'),_0x2e4880[_0xc3f8('0x10')],_0x48b32e);_0xd32b09(_0x21a225['error'](0x1f4,_0x2e4880[_0xc3f8('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index aeb0c5c..07cb383 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 _0x20bd=['./intVtigerConfiguration.controller','get','isAuthenticated','index','/:id','show','getFields','/:id/subjects','getSubjects','/:id/descriptions','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x36c5b0,_0x5001da){var _0xf19333=function(_0x1e880a){while(--_0x1e880a){_0x36c5b0['push'](_0x36c5b0['shift']());}};_0xf19333(++_0x5001da);}(_0x20bd,0x12e));var _0xd20b=function(_0x39785f,_0x409e74){_0x39785f=_0x39785f-0x0;var _0x5a5138=_0x20bd[_0x39785f];return _0x5a5138;};'use strict';var multer=require(_0xd20b('0x0'));var util=require(_0xd20b('0x1'));var path=require(_0xd20b('0x2'));var timeout=require(_0xd20b('0x3'));var express=require(_0xd20b('0x4'));var router=express[_0xd20b('0x5')]();var fs_extra=require(_0xd20b('0x6'));var auth=require(_0xd20b('0x7'));var interaction=require(_0xd20b('0x8'));var config=require(_0xd20b('0x9'));var controller=require(_0xd20b('0xa'));router[_0xd20b('0xb')]('/',auth[_0xd20b('0xc')](),controller[_0xd20b('0xd')]);router[_0xd20b('0xb')](_0xd20b('0xe'),auth[_0xd20b('0xc')](),controller[_0xd20b('0xf')]);router[_0xd20b('0xb')]('/:id/fields',auth[_0xd20b('0xc')](),controller[_0xd20b('0x10')]);router['get'](_0xd20b('0x11'),auth[_0xd20b('0xc')](),controller[_0xd20b('0x12')]);router[_0xd20b('0xb')](_0xd20b('0x13'),auth[_0xd20b('0xc')](),controller['getDescriptions']);router['post']('/',auth[_0xd20b('0xc')](),controller['create']);router['put'](_0xd20b('0xe'),auth[_0xd20b('0xc')](),controller[_0xd20b('0x14')]);router[_0xd20b('0x15')](_0xd20b('0xe'),auth[_0xd20b('0xc')](),controller[_0xd20b('0x16')]);module[_0xd20b('0x17')]=router; \ No newline at end of file +var _0xd1d7=['getDescriptions','put','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/descriptions'];(function(_0x9fd887,_0x47f76c){var _0x1a54ab=function(_0xb65c08){while(--_0xb65c08){_0x9fd887['push'](_0x9fd887['shift']());}};_0x1a54ab(++_0x47f76c);}(_0xd1d7,0x17b));var _0x7d1d=function(_0x576a09,_0xa88bac){_0x576a09=_0x576a09-0x0;var _0x3bec24=_0xd1d7[_0x576a09];return _0x3bec24;};'use strict';var multer=require('multer');var util=require(_0x7d1d('0x0'));var path=require(_0x7d1d('0x1'));var timeout=require(_0x7d1d('0x2'));var express=require(_0x7d1d('0x3'));var router=express[_0x7d1d('0x4')]();var fs_extra=require(_0x7d1d('0x5'));var auth=require(_0x7d1d('0x6'));var interaction=require(_0x7d1d('0x7'));var config=require(_0x7d1d('0x8'));var controller=require('./intVtigerConfiguration.controller');router[_0x7d1d('0x9')]('/',auth[_0x7d1d('0xa')](),controller[_0x7d1d('0xb')]);router[_0x7d1d('0x9')](_0x7d1d('0xc'),auth[_0x7d1d('0xa')](),controller[_0x7d1d('0xd')]);router['get'](_0x7d1d('0xe'),auth[_0x7d1d('0xa')](),controller[_0x7d1d('0xf')]);router['get']('/:id/subjects',auth[_0x7d1d('0xa')](),controller['getSubjects']);router['get'](_0x7d1d('0x10'),auth['isAuthenticated'](),controller[_0x7d1d('0x11')]);router['post']('/',auth[_0x7d1d('0xa')](),controller['create']);router[_0x7d1d('0x12')]('/:id',auth[_0x7d1d('0xa')](),controller['update']);router[_0x7d1d('0x13')](_0x7d1d('0xc'),auth[_0x7d1d('0xa')](),controller[_0x7d1d('0x14')]);module[_0x7d1d('0x15')]=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index 9c157e4..e581a9e 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 _0x5270=['exports','STRING','sequelize'];(function(_0x35fabd,_0x825452){var _0x61a8ee=function(_0x218f4c){while(--_0x218f4c){_0x35fabd['push'](_0x35fabd['shift']());}};_0x61a8ee(++_0x825452);}(_0x5270,0x1af));var _0x0527=function(_0x5452f9,_0x4857eb){_0x5452f9=_0x5452f9-0x0;var _0x495d5a=_0x5270[_0x5452f9];return _0x495d5a;};'use strict';var Sequelize=require(_0x0527('0x0'));module[_0x0527('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x0527('0x2')]}}; \ No newline at end of file +var _0x3a5c=['STRING','exports'];(function(_0x5e9104,_0x5d1781){var _0x595a0b=function(_0x433f74){while(--_0x433f74){_0x5e9104['push'](_0x5e9104['shift']());}};_0x595a0b(++_0x5d1781);}(_0x3a5c,0xf3));var _0xc3a5=function(_0x4c84b8,_0x399628){_0x4c84b8=_0x4c84b8-0x0;var _0x1a24f9=_0x3a5c[_0x4c84b8];return _0x1a24f9;};'use strict';var Sequelize=require('sequelize');module[_0xc3a5('0x0')]={'name':{'type':Sequelize[_0xc3a5('0x1')]},'description':{'type':Sequelize[_0xc3a5('0x1')]}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index f6cec51..5847b72 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 _0xb0c9=['api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','update','then','destroy','error','stack','name','send','index','VtigerConfiguration','rawAttributes','type','map','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','where','filter','merge','options','includeAll','include','findAll','rows','catch','params','find','create','body','getFields','findOne','VtigerField','sort','pick','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x35d35d,_0xfb8c78){var _0x604622=function(_0x526141){while(--_0x526141){_0x35d35d['push'](_0x35d35d['shift']());}};_0x604622(++_0xfb8c78);}(_0xb0c9,0xd8));var _0x9b0c=function(_0x36041e,_0x3d6420){_0x36041e=_0x36041e-0x0;var _0x4fce84=_0xb0c9[_0x36041e];return _0x4fce84;};'use strict';var emlformat=require(_0x9b0c('0x0'));var rimraf=require(_0x9b0c('0x1'));var zipdir=require(_0x9b0c('0x2'));var jsonpatch=require(_0x9b0c('0x3'));var rp=require(_0x9b0c('0x4'));var moment=require('moment');var BPromise=require(_0x9b0c('0x5'));var Mustache=require(_0x9b0c('0x6'));var util=require('util');var path=require(_0x9b0c('0x7'));var sox=require('sox');var csv=require(_0x9b0c('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9b0c('0x9'));var _=require('lodash');var squel=require(_0x9b0c('0xa'));var crypto=require(_0x9b0c('0xb'));var jsforce=require(_0x9b0c('0xc'));var deskjs=require(_0x9b0c('0xd'));var toCsv=require('to-csv');var querystring=require(_0x9b0c('0xe'));var Papa=require(_0x9b0c('0xf'));var Redis=require(_0x9b0c('0x10'));var authService=require(_0x9b0c('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x9b0c('0x12'));var hardwareService=require(_0x9b0c('0x13'));var logger=require(_0x9b0c('0x14'))(_0x9b0c('0x15'));var utils=require(_0x9b0c('0x16'));var config=require(_0x9b0c('0x17'));var licenseUtil=require(_0x9b0c('0x18'));var db=require(_0x9b0c('0x19'))['db'];function respondWithStatusCode(_0x12af10,_0x154c32){_0x154c32=_0x154c32||0xcc;return function(_0x5addbf){if(_0x5addbf){return _0x12af10[_0x9b0c('0x1a')](_0x154c32);}return _0x12af10[_0x9b0c('0x1b')](_0x154c32)[_0x9b0c('0x1c')]();};}function respondWithResult(_0x3b729c,_0xad12d2){_0xad12d2=_0xad12d2||0xc8;return function(_0x389986){if(_0x389986){return _0x3b729c['status'](_0xad12d2)[_0x9b0c('0x1d')](_0x389986);}};}function respondWithFilteredResult(_0x28558d,_0x287583){return function(_0x2e6d69){if(_0x2e6d69){var _0x3de5d3=typeof _0x287583[_0x9b0c('0x1e')]===_0x9b0c('0x1f')&&typeof _0x287583[_0x9b0c('0x20')]===_0x9b0c('0x1f');var _0x2bd27c=_0x2e6d69[_0x9b0c('0x21')];var _0x534fa3=_0x3de5d3?0x0:_0x287583[_0x9b0c('0x1e')];var _0x982321=_0x3de5d3?_0x2e6d69[_0x9b0c('0x21')]:_0x287583[_0x9b0c('0x1e')]+_0x287583[_0x9b0c('0x20')];var _0x427782;if(_0x982321>=_0x2bd27c){_0x982321=_0x2bd27c;_0x427782=0xc8;}else{_0x427782=0xce;}_0x28558d[_0x9b0c('0x1b')](_0x427782);return _0x28558d['set'](_0x9b0c('0x22'),_0x534fa3+'-'+_0x982321+'/'+_0x2bd27c)[_0x9b0c('0x1d')](_0x2e6d69);}return null;};}function patchUpdates(_0x48ca12){return function(_0x259ba6){try{jsonpatch['apply'](_0x259ba6,_0x48ca12,!![]);}catch(_0xd1ba44){return BPromise[_0x9b0c('0x23')](_0xd1ba44);}return _0x259ba6['save']();};}function saveUpdates(_0x34372f,_0x5c47bb){return function(_0x4c5aef){if(_0x4c5aef){return _0x4c5aef[_0x9b0c('0x24')](_0x34372f)[_0x9b0c('0x25')](function(_0x37a157){return _0x37a157;});}return null;};}function removeEntity(_0x4f6191,_0x1645e0){return function(_0x15c38a){if(_0x15c38a){return _0x15c38a[_0x9b0c('0x26')]()[_0x9b0c('0x25')](function(){_0x4f6191['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x38746c,_0x4751f9){return function(_0x536f99){if(!_0x536f99){_0x38746c[_0x9b0c('0x1a')](0x194);}return _0x536f99;};}function handleError(_0x3e017f,_0x1705ab){_0x1705ab=_0x1705ab||0x1f4;return function(_0x18092f){logger[_0x9b0c('0x27')](_0x18092f[_0x9b0c('0x28')]);if(_0x18092f[_0x9b0c('0x29')]){delete _0x18092f[_0x9b0c('0x29')];}_0x3e017f['status'](_0x1705ab)[_0x9b0c('0x2a')](_0x18092f);};}exports[_0x9b0c('0x2b')]=function(_0x16bb73,_0x2ba998){var _0x4cfe03={},_0x424df4={},_0x351808={'count':0x0,'rows':[]};var _0x15656b=_['map'](db[_0x9b0c('0x2c')][_0x9b0c('0x2d')],function(_0x3a0cb1){return{'name':_0x3a0cb1['fieldName'],'type':_0x3a0cb1[_0x9b0c('0x2e')]['key']};});_0x424df4['model']=_[_0x9b0c('0x2f')](_0x15656b,_0x9b0c('0x29'));_0x424df4[_0x9b0c('0x30')]=_[_0x9b0c('0x31')](_0x16bb73[_0x9b0c('0x30')]);_0x424df4[_0x9b0c('0x32')]=_[_0x9b0c('0x33')](_0x424df4['model'],_0x424df4[_0x9b0c('0x30')]);_0x4cfe03[_0x9b0c('0x34')]=_[_0x9b0c('0x33')](_0x424df4[_0x9b0c('0x35')],qs[_0x9b0c('0x36')](_0x16bb73[_0x9b0c('0x30')]['fields']));_0x4cfe03['attributes']=_0x4cfe03[_0x9b0c('0x34')][_0x9b0c('0x37')]?_0x4cfe03['attributes']:_0x424df4[_0x9b0c('0x35')];if(!_0x16bb73[_0x9b0c('0x30')][_0x9b0c('0x38')](_0x9b0c('0x39'))){_0x4cfe03[_0x9b0c('0x20')]=qs[_0x9b0c('0x20')](_0x16bb73['query']['limit']);_0x4cfe03[_0x9b0c('0x1e')]=qs[_0x9b0c('0x1e')](_0x16bb73['query']['offset']);}_0x4cfe03[_0x9b0c('0x3a')]=qs['sort'](_0x16bb73[_0x9b0c('0x30')]['sort']);_0x4cfe03[_0x9b0c('0x3b')]=qs[_0x9b0c('0x32')](_['pick'](_0x16bb73['query'],_0x424df4[_0x9b0c('0x32')]),_0x15656b);if(_0x16bb73[_0x9b0c('0x30')][_0x9b0c('0x3c')]){_0x4cfe03[_0x9b0c('0x3b')]=_['merge'](_0x4cfe03[_0x9b0c('0x3b')],{'$or':_['map'](_0x15656b,function(_0x3d54c6){if(_0x3d54c6['type']!=='VIRTUAL'){var _0x401b87={};_0x401b87[_0x3d54c6['name']]={'$like':'%'+_0x16bb73[_0x9b0c('0x30')][_0x9b0c('0x3c')]+'%'};return _0x401b87;}})});}_0x4cfe03=_[_0x9b0c('0x3d')]({},_0x4cfe03,_0x16bb73[_0x9b0c('0x3e')]);var _0x48f7e8={'where':_0x4cfe03[_0x9b0c('0x3b')]};return db[_0x9b0c('0x2c')][_0x9b0c('0x21')](_0x48f7e8)[_0x9b0c('0x25')](function(_0x144712){_0x351808[_0x9b0c('0x21')]=_0x144712;if(_0x16bb73['query'][_0x9b0c('0x3f')]){_0x4cfe03[_0x9b0c('0x40')]=[{'all':!![]}];}return db[_0x9b0c('0x2c')][_0x9b0c('0x41')](_0x4cfe03);})[_0x9b0c('0x25')](function(_0x4affc4){_0x351808[_0x9b0c('0x42')]=_0x4affc4;return _0x351808;})['then'](respondWithFilteredResult(_0x2ba998,_0x4cfe03))[_0x9b0c('0x43')](handleError(_0x2ba998,null));};exports['show']=function(_0x34580a,_0x1df276){var _0x5b8040={'raw':![],'where':{'id':_0x34580a[_0x9b0c('0x44')]['id']}},_0xaae074={};_0xaae074[_0x9b0c('0x35')]=_[_0x9b0c('0x31')](db[_0x9b0c('0x2c')][_0x9b0c('0x2d')]);_0xaae074[_0x9b0c('0x30')]=_[_0x9b0c('0x31')](_0x34580a[_0x9b0c('0x30')]);_0xaae074['filters']=_[_0x9b0c('0x33')](_0xaae074[_0x9b0c('0x35')],_0xaae074[_0x9b0c('0x30')]);_0x5b8040[_0x9b0c('0x34')]=_[_0x9b0c('0x33')](_0xaae074['model'],qs['fields'](_0x34580a['query'][_0x9b0c('0x36')]));_0x5b8040['attributes']=_0x5b8040[_0x9b0c('0x34')][_0x9b0c('0x37')]?_0x5b8040['attributes']:_0xaae074[_0x9b0c('0x35')];if(_0x34580a['query']['includeAll']){_0x5b8040['include']=[{'all':!![]}];}_0x5b8040=_[_0x9b0c('0x3d')]({},_0x5b8040,_0x34580a['options']);return db['VtigerConfiguration'][_0x9b0c('0x45')](_0x5b8040)[_0x9b0c('0x25')](handleEntityNotFound(_0x1df276,null))[_0x9b0c('0x25')](respondWithResult(_0x1df276,null))['catch'](handleError(_0x1df276,null));};exports[_0x9b0c('0x46')]=function(_0x5bc78f,_0x2c9aa3){return db[_0x9b0c('0x2c')][_0x9b0c('0x46')](_0x5bc78f[_0x9b0c('0x47')],{})[_0x9b0c('0x25')](respondWithResult(_0x2c9aa3,0xc9))[_0x9b0c('0x43')](handleError(_0x2c9aa3,null));};exports[_0x9b0c('0x24')]=function(_0x4c48f2,_0x442609){if(_0x4c48f2[_0x9b0c('0x47')]['id']){delete _0x4c48f2[_0x9b0c('0x47')]['id'];}return db[_0x9b0c('0x2c')][_0x9b0c('0x45')]({'where':{'id':_0x4c48f2[_0x9b0c('0x44')]['id']}})[_0x9b0c('0x25')](handleEntityNotFound(_0x442609,null))['then'](saveUpdates(_0x4c48f2[_0x9b0c('0x47')],null))[_0x9b0c('0x25')](respondWithResult(_0x442609,null))[_0x9b0c('0x43')](handleError(_0x442609,null));};exports[_0x9b0c('0x26')]=function(_0x34f084,_0x30d8dc){return db['VtigerConfiguration'][_0x9b0c('0x45')]({'where':{'id':_0x34f084[_0x9b0c('0x44')]['id']}})[_0x9b0c('0x25')](handleEntityNotFound(_0x30d8dc,null))[_0x9b0c('0x25')](removeEntity(_0x30d8dc,null))[_0x9b0c('0x43')](handleError(_0x30d8dc,null));};exports[_0x9b0c('0x48')]=function(_0x9d2870,_0x42b6ad,_0x91703e){var _0x9355ba={};var _0x4a9fcf={};var _0x38a599;var _0x3b1470;return db[_0x9b0c('0x2c')][_0x9b0c('0x49')]({'where':{'id':_0x9d2870['params']['id']}})[_0x9b0c('0x25')](handleEntityNotFound(_0x42b6ad,null))[_0x9b0c('0x25')](function(_0x302721){if(_0x302721){_0x38a599=_0x302721;_0x4a9fcf[_0x9b0c('0x35')]=_[_0x9b0c('0x31')](db[_0x9b0c('0x4a')][_0x9b0c('0x2d')]);_0x4a9fcf[_0x9b0c('0x30')]=_['keys'](_0x9d2870[_0x9b0c('0x30')]);_0x4a9fcf[_0x9b0c('0x32')]=_[_0x9b0c('0x33')](_0x4a9fcf[_0x9b0c('0x35')],_0x4a9fcf[_0x9b0c('0x30')]);_0x9355ba[_0x9b0c('0x34')]=_['intersection'](_0x4a9fcf[_0x9b0c('0x35')],qs[_0x9b0c('0x36')](_0x9d2870[_0x9b0c('0x30')][_0x9b0c('0x36')]));_0x9355ba['attributes']=_0x9355ba[_0x9b0c('0x34')][_0x9b0c('0x37')]?_0x9355ba[_0x9b0c('0x34')]:_0x4a9fcf[_0x9b0c('0x35')];_0x9355ba[_0x9b0c('0x3a')]=qs['sort'](_0x9d2870['query'][_0x9b0c('0x4b')]);_0x9355ba[_0x9b0c('0x3b')]=qs['filters'](_[_0x9b0c('0x4c')](_0x9d2870['query'],_0x4a9fcf[_0x9b0c('0x32')]));if(_0x9d2870[_0x9b0c('0x30')][_0x9b0c('0x3c')]){_0x9355ba[_0x9b0c('0x3b')]=_[_0x9b0c('0x3d')](_0x9355ba[_0x9b0c('0x3b')],{'$or':_[_0x9b0c('0x2f')](_0x9355ba['attributes'],function(_0x29ee5c){var _0x4e7e3d={};_0x4e7e3d[_0x29ee5c]={'$like':'%'+_0x9d2870[_0x9b0c('0x30')][_0x9b0c('0x3c')]+'%'};return _0x4e7e3d;})});}_0x9355ba=_[_0x9b0c('0x3d')]({},_0x9355ba,_0x9d2870[_0x9b0c('0x3e')]);return _0x38a599['getFields'](_0x9355ba);}})[_0x9b0c('0x25')](function(_0x4cef89){if(_0x4cef89){_0x3b1470=_0x4cef89[_0x9b0c('0x37')];if(!_0x9d2870[_0x9b0c('0x30')][_0x9b0c('0x38')](_0x9b0c('0x39'))){_0x9355ba[_0x9b0c('0x20')]=qs[_0x9b0c('0x20')](_0x9d2870[_0x9b0c('0x30')][_0x9b0c('0x20')]);_0x9355ba[_0x9b0c('0x1e')]=qs[_0x9b0c('0x1e')](_0x9d2870[_0x9b0c('0x30')][_0x9b0c('0x1e')]);}return _0x38a599[_0x9b0c('0x48')](_0x9355ba);}})['then'](function(_0x598da2){if(_0x598da2){return _0x598da2?{'count':_0x3b1470,'rows':_0x598da2}:null;}})[_0x9b0c('0x25')](respondWithResult(_0x42b6ad,null))[_0x9b0c('0x43')](handleError(_0x42b6ad,null));};exports[_0x9b0c('0x4d')]=function(_0x125a6b,_0x5348df,_0x5a111c){var _0x3b46ea={};var _0x2cf68c={};var _0x4857c2;var _0xf2175e;return db[_0x9b0c('0x2c')][_0x9b0c('0x49')]({'where':{'id':_0x125a6b[_0x9b0c('0x44')]['id']}})['then'](handleEntityNotFound(_0x5348df,null))[_0x9b0c('0x25')](function(_0x319e1f){if(_0x319e1f){_0x4857c2=_0x319e1f;_0x2cf68c[_0x9b0c('0x35')]=_[_0x9b0c('0x31')](db[_0x9b0c('0x4a')][_0x9b0c('0x2d')]);_0x2cf68c[_0x9b0c('0x30')]=_['keys'](_0x125a6b[_0x9b0c('0x30')]);_0x2cf68c['filters']=_['intersection'](_0x2cf68c[_0x9b0c('0x35')],_0x2cf68c[_0x9b0c('0x30')]);_0x3b46ea[_0x9b0c('0x34')]=_[_0x9b0c('0x33')](_0x2cf68c[_0x9b0c('0x35')],qs[_0x9b0c('0x36')](_0x125a6b[_0x9b0c('0x30')][_0x9b0c('0x36')]));_0x3b46ea['attributes']=_0x3b46ea[_0x9b0c('0x34')][_0x9b0c('0x37')]?_0x3b46ea[_0x9b0c('0x34')]:_0x2cf68c[_0x9b0c('0x35')];_0x3b46ea['order']=qs[_0x9b0c('0x4b')](_0x125a6b['query']['sort']);_0x3b46ea[_0x9b0c('0x3b')]=qs['filters'](_[_0x9b0c('0x4c')](_0x125a6b[_0x9b0c('0x30')],_0x2cf68c[_0x9b0c('0x32')]));if(_0x125a6b[_0x9b0c('0x30')][_0x9b0c('0x3c')]){_0x3b46ea[_0x9b0c('0x3b')]=_[_0x9b0c('0x3d')](_0x3b46ea[_0x9b0c('0x3b')],{'$or':_['map'](_0x3b46ea['attributes'],function(_0x37a9c4){var _0x326ce8={};_0x326ce8[_0x37a9c4]={'$like':'%'+_0x125a6b[_0x9b0c('0x30')][_0x9b0c('0x3c')]+'%'};return _0x326ce8;})});}_0x3b46ea=_[_0x9b0c('0x3d')]({},_0x3b46ea,_0x125a6b[_0x9b0c('0x3e')]);return _0x4857c2['getSubjects'](_0x3b46ea);}})[_0x9b0c('0x25')](function(_0x1251b6){if(_0x1251b6){_0xf2175e=_0x1251b6[_0x9b0c('0x37')];if(!_0x125a6b[_0x9b0c('0x30')]['hasOwnProperty']('nolimit')){_0x3b46ea[_0x9b0c('0x20')]=qs[_0x9b0c('0x20')](_0x125a6b[_0x9b0c('0x30')]['limit']);_0x3b46ea[_0x9b0c('0x1e')]=qs[_0x9b0c('0x1e')](_0x125a6b[_0x9b0c('0x30')]['offset']);}return _0x4857c2[_0x9b0c('0x4d')](_0x3b46ea);}})['then'](function(_0x200211){if(_0x200211){return _0x200211?{'count':_0xf2175e,'rows':_0x200211}:null;}})['then'](respondWithResult(_0x5348df,null))['catch'](handleError(_0x5348df,null));};exports[_0x9b0c('0x4e')]=function(_0x9a4d08,_0x392e46,_0x33e7fb){var _0x3dd7b0={};var _0x522d31={};var _0x44db09;var _0xef89c7;return db[_0x9b0c('0x2c')][_0x9b0c('0x49')]({'where':{'id':_0x9a4d08[_0x9b0c('0x44')]['id']}})['then'](handleEntityNotFound(_0x392e46,null))[_0x9b0c('0x25')](function(_0x4f43c8){if(_0x4f43c8){_0x44db09=_0x4f43c8;_0x522d31[_0x9b0c('0x35')]=_['keys'](db[_0x9b0c('0x4a')][_0x9b0c('0x2d')]);_0x522d31[_0x9b0c('0x30')]=_[_0x9b0c('0x31')](_0x9a4d08[_0x9b0c('0x30')]);_0x522d31[_0x9b0c('0x32')]=_['intersection'](_0x522d31[_0x9b0c('0x35')],_0x522d31[_0x9b0c('0x30')]);_0x3dd7b0[_0x9b0c('0x34')]=_[_0x9b0c('0x33')](_0x522d31['model'],qs[_0x9b0c('0x36')](_0x9a4d08[_0x9b0c('0x30')][_0x9b0c('0x36')]));_0x3dd7b0[_0x9b0c('0x34')]=_0x3dd7b0[_0x9b0c('0x34')][_0x9b0c('0x37')]?_0x3dd7b0[_0x9b0c('0x34')]:_0x522d31[_0x9b0c('0x35')];_0x3dd7b0['order']=qs[_0x9b0c('0x4b')](_0x9a4d08['query'][_0x9b0c('0x4b')]);_0x3dd7b0[_0x9b0c('0x3b')]=qs['filters'](_['pick'](_0x9a4d08['query'],_0x522d31['filters']));if(_0x9a4d08[_0x9b0c('0x30')][_0x9b0c('0x3c')]){_0x3dd7b0[_0x9b0c('0x3b')]=_[_0x9b0c('0x3d')](_0x3dd7b0['where'],{'$or':_['map'](_0x3dd7b0['attributes'],function(_0x1ac869){var _0x5286b9={};_0x5286b9[_0x1ac869]={'$like':'%'+_0x9a4d08[_0x9b0c('0x30')][_0x9b0c('0x3c')]+'%'};return _0x5286b9;})});}_0x3dd7b0=_[_0x9b0c('0x3d')]({},_0x3dd7b0,_0x9a4d08[_0x9b0c('0x3e')]);return _0x44db09[_0x9b0c('0x4e')](_0x3dd7b0);}})[_0x9b0c('0x25')](function(_0x50a694){if(_0x50a694){_0xef89c7=_0x50a694[_0x9b0c('0x37')];if(!_0x9a4d08[_0x9b0c('0x30')][_0x9b0c('0x38')]('nolimit')){_0x3dd7b0[_0x9b0c('0x20')]=qs['limit'](_0x9a4d08[_0x9b0c('0x30')]['limit']);_0x3dd7b0[_0x9b0c('0x1e')]=qs[_0x9b0c('0x1e')](_0x9a4d08[_0x9b0c('0x30')]['offset']);}return _0x44db09['getDescriptions'](_0x3dd7b0);}})[_0x9b0c('0x25')](function(_0x3824e7){if(_0x3824e7){return _0x3824e7?{'count':_0xef89c7,'rows':_0x3824e7}:null;}})['then'](respondWithResult(_0x392e46,null))[_0x9b0c('0x43')](handleError(_0x392e46,null));}; \ No newline at end of file +var _0x3a61=['reject','save','then','destroy','error','stack','name','index','map','VtigerConfiguration','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filters','filter','merge','options','include','findAll','rows','catch','params','length','includeAll','find','create','body','update','getFields','getSubjects','findOne','pick','VtigerField','order','getDescriptions','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply'];(function(_0xf2771b,_0xa46123){var _0x140723=function(_0x3f8bd8){while(--_0x3f8bd8){_0xf2771b['push'](_0xf2771b['shift']());}};_0x140723(++_0xa46123);}(_0x3a61,0xd4));var _0x13a6=function(_0x3439ea,_0x3c68ba){_0x3439ea=_0x3439ea-0x0;var _0x3900a3=_0x3a61[_0x3439ea];return _0x3900a3;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x13a6('0x0'));var rp=require(_0x13a6('0x1'));var moment=require(_0x13a6('0x2'));var BPromise=require(_0x13a6('0x3'));var Mustache=require(_0x13a6('0x4'));var util=require(_0x13a6('0x5'));var path=require(_0x13a6('0x6'));var sox=require(_0x13a6('0x7'));var csv=require(_0x13a6('0x8'));var ejs=require(_0x13a6('0x9'));var fs=require('fs');var fs_extra=require(_0x13a6('0xa'));var _=require(_0x13a6('0xb'));var squel=require(_0x13a6('0xc'));var crypto=require(_0x13a6('0xd'));var jsforce=require(_0x13a6('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x13a6('0x8'));var querystring=require(_0x13a6('0xf'));var Papa=require(_0x13a6('0x10'));var Redis=require(_0x13a6('0x11'));var authService=require(_0x13a6('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x13a6('0x13'));var hardwareService=require(_0x13a6('0x14'));var logger=require('../../config/logger')(_0x13a6('0x15'));var utils=require(_0x13a6('0x16'));var config=require(_0x13a6('0x17'));var licenseUtil=require(_0x13a6('0x18'));var db=require(_0x13a6('0x19'))['db'];function respondWithStatusCode(_0x432b8a,_0x48ed37){_0x48ed37=_0x48ed37||0xcc;return function(_0xa2c257){if(_0xa2c257){return _0x432b8a[_0x13a6('0x1a')](_0x48ed37);}return _0x432b8a[_0x13a6('0x1b')](_0x48ed37)[_0x13a6('0x1c')]();};}function respondWithResult(_0x47a395,_0x1a7005){_0x1a7005=_0x1a7005||0xc8;return function(_0x46f430){if(_0x46f430){return _0x47a395['status'](_0x1a7005)['json'](_0x46f430);}};}function respondWithFilteredResult(_0xdd02bf,_0x3d3819){return function(_0x2a5b19){if(_0x2a5b19){var _0x5c0d73=typeof _0x3d3819[_0x13a6('0x1d')]===_0x13a6('0x1e')&&typeof _0x3d3819[_0x13a6('0x1f')]===_0x13a6('0x1e');var _0x29338b=_0x2a5b19['count'];var _0xf13806=_0x5c0d73?0x0:_0x3d3819['offset'];var _0x1433ba=_0x5c0d73?_0x2a5b19[_0x13a6('0x20')]:_0x3d3819[_0x13a6('0x1d')]+_0x3d3819['limit'];var _0x4de114;if(_0x1433ba>=_0x29338b){_0x1433ba=_0x29338b;_0x4de114=0xc8;}else{_0x4de114=0xce;}_0xdd02bf[_0x13a6('0x1b')](_0x4de114);return _0xdd02bf[_0x13a6('0x21')](_0x13a6('0x22'),_0xf13806+'-'+_0x1433ba+'/'+_0x29338b)[_0x13a6('0x23')](_0x2a5b19);}return null;};}function patchUpdates(_0x3b9b68){return function(_0x25b7d9){try{jsonpatch[_0x13a6('0x24')](_0x25b7d9,_0x3b9b68,!![]);}catch(_0x5b4d87){return BPromise[_0x13a6('0x25')](_0x5b4d87);}return _0x25b7d9[_0x13a6('0x26')]();};}function saveUpdates(_0x5e130a,_0x2a5ece){return function(_0x14a826){if(_0x14a826){return _0x14a826['update'](_0x5e130a)[_0x13a6('0x27')](function(_0xfcfebd){return _0xfcfebd;});}return null;};}function removeEntity(_0x29f13e,_0x49e107){return function(_0x58de69){if(_0x58de69){return _0x58de69[_0x13a6('0x28')]()[_0x13a6('0x27')](function(){_0x29f13e['status'](0xcc)[_0x13a6('0x1c')]();});}};}function handleEntityNotFound(_0x462105,_0x3af898){return function(_0x4376b6){if(!_0x4376b6){_0x462105[_0x13a6('0x1a')](0x194);}return _0x4376b6;};}function handleError(_0x53e54d,_0x192fdc){_0x192fdc=_0x192fdc||0x1f4;return function(_0x5c414b){logger[_0x13a6('0x29')](_0x5c414b[_0x13a6('0x2a')]);if(_0x5c414b[_0x13a6('0x2b')]){delete _0x5c414b[_0x13a6('0x2b')];}_0x53e54d['status'](_0x192fdc)['send'](_0x5c414b);};}exports[_0x13a6('0x2c')]=function(_0xc22b67,_0x5201f5){var _0x28b99c={},_0x2f03ac={},_0xc1dd82={'count':0x0,'rows':[]};var _0x266329=_[_0x13a6('0x2d')](db[_0x13a6('0x2e')][_0x13a6('0x2f')],function(_0x27ef64){return{'name':_0x27ef64[_0x13a6('0x30')],'type':_0x27ef64[_0x13a6('0x31')][_0x13a6('0x32')]};});_0x2f03ac[_0x13a6('0x33')]=_['map'](_0x266329,_0x13a6('0x2b'));_0x2f03ac[_0x13a6('0x34')]=_[_0x13a6('0x35')](_0xc22b67['query']);_0x2f03ac['filters']=_[_0x13a6('0x36')](_0x2f03ac['model'],_0x2f03ac['query']);_0x28b99c[_0x13a6('0x37')]=_[_0x13a6('0x36')](_0x2f03ac[_0x13a6('0x33')],qs['fields'](_0xc22b67[_0x13a6('0x34')][_0x13a6('0x38')]));_0x28b99c[_0x13a6('0x37')]=_0x28b99c['attributes']['length']?_0x28b99c['attributes']:_0x2f03ac[_0x13a6('0x33')];if(!_0xc22b67[_0x13a6('0x34')][_0x13a6('0x39')](_0x13a6('0x3a'))){_0x28b99c[_0x13a6('0x1f')]=qs['limit'](_0xc22b67[_0x13a6('0x34')][_0x13a6('0x1f')]);_0x28b99c[_0x13a6('0x1d')]=qs['offset'](_0xc22b67[_0x13a6('0x34')]['offset']);}_0x28b99c['order']=qs[_0x13a6('0x3b')](_0xc22b67[_0x13a6('0x34')][_0x13a6('0x3b')]);_0x28b99c[_0x13a6('0x3c')]=qs[_0x13a6('0x3d')](_['pick'](_0xc22b67[_0x13a6('0x34')],_0x2f03ac[_0x13a6('0x3d')]),_0x266329);if(_0xc22b67['query'][_0x13a6('0x3e')]){_0x28b99c[_0x13a6('0x3c')]=_[_0x13a6('0x3f')](_0x28b99c[_0x13a6('0x3c')],{'$or':_[_0x13a6('0x2d')](_0x266329,function(_0x581078){if(_0x581078['type']!=='VIRTUAL'){var _0x13ab01={};_0x13ab01[_0x581078[_0x13a6('0x2b')]]={'$like':'%'+_0xc22b67[_0x13a6('0x34')][_0x13a6('0x3e')]+'%'};return _0x13ab01;}})});}_0x28b99c=_['merge']({},_0x28b99c,_0xc22b67[_0x13a6('0x40')]);var _0x363635={'where':_0x28b99c[_0x13a6('0x3c')]};return db['VtigerConfiguration'][_0x13a6('0x20')](_0x363635)['then'](function(_0x257530){_0xc1dd82['count']=_0x257530;if(_0xc22b67[_0x13a6('0x34')]['includeAll']){_0x28b99c[_0x13a6('0x41')]=[{'all':!![]}];}return db['VtigerConfiguration'][_0x13a6('0x42')](_0x28b99c);})[_0x13a6('0x27')](function(_0x39486d){_0xc1dd82[_0x13a6('0x43')]=_0x39486d;return _0xc1dd82;})[_0x13a6('0x27')](respondWithFilteredResult(_0x5201f5,_0x28b99c))[_0x13a6('0x44')](handleError(_0x5201f5,null));};exports['show']=function(_0x37a536,_0x5f2dfe){var _0x38479c={'raw':![],'where':{'id':_0x37a536[_0x13a6('0x45')]['id']}},_0x22a31a={};_0x22a31a[_0x13a6('0x33')]=_[_0x13a6('0x35')](db['VtigerConfiguration'][_0x13a6('0x2f')]);_0x22a31a[_0x13a6('0x34')]=_[_0x13a6('0x35')](_0x37a536[_0x13a6('0x34')]);_0x22a31a['filters']=_['intersection'](_0x22a31a['model'],_0x22a31a['query']);_0x38479c['attributes']=_[_0x13a6('0x36')](_0x22a31a['model'],qs['fields'](_0x37a536[_0x13a6('0x34')][_0x13a6('0x38')]));_0x38479c[_0x13a6('0x37')]=_0x38479c[_0x13a6('0x37')][_0x13a6('0x46')]?_0x38479c[_0x13a6('0x37')]:_0x22a31a[_0x13a6('0x33')];if(_0x37a536[_0x13a6('0x34')][_0x13a6('0x47')]){_0x38479c[_0x13a6('0x41')]=[{'all':!![]}];}_0x38479c=_[_0x13a6('0x3f')]({},_0x38479c,_0x37a536['options']);return db['VtigerConfiguration'][_0x13a6('0x48')](_0x38479c)['then'](handleEntityNotFound(_0x5f2dfe,null))[_0x13a6('0x27')](respondWithResult(_0x5f2dfe,null))[_0x13a6('0x44')](handleError(_0x5f2dfe,null));};exports[_0x13a6('0x49')]=function(_0x2ea9e7,_0x3023f4){return db[_0x13a6('0x2e')][_0x13a6('0x49')](_0x2ea9e7[_0x13a6('0x4a')],{})[_0x13a6('0x27')](respondWithResult(_0x3023f4,0xc9))[_0x13a6('0x44')](handleError(_0x3023f4,null));};exports[_0x13a6('0x4b')]=function(_0x4cc1fb,_0x537eb9){if(_0x4cc1fb[_0x13a6('0x4a')]['id']){delete _0x4cc1fb[_0x13a6('0x4a')]['id'];}return db['VtigerConfiguration'][_0x13a6('0x48')]({'where':{'id':_0x4cc1fb[_0x13a6('0x45')]['id']}})['then'](handleEntityNotFound(_0x537eb9,null))[_0x13a6('0x27')](saveUpdates(_0x4cc1fb[_0x13a6('0x4a')],null))['then'](respondWithResult(_0x537eb9,null))['catch'](handleError(_0x537eb9,null));};exports[_0x13a6('0x28')]=function(_0x17f9aa,_0x2a2559){return db['VtigerConfiguration'][_0x13a6('0x48')]({'where':{'id':_0x17f9aa[_0x13a6('0x45')]['id']}})['then'](handleEntityNotFound(_0x2a2559,null))[_0x13a6('0x27')](removeEntity(_0x2a2559,null))[_0x13a6('0x44')](handleError(_0x2a2559,null));};exports['getFields']=function(_0x298755,_0x2d7fe9,_0xd35049){var _0x5e5bfd={};var _0x30a13b={};var _0x3df133;var _0x4ee253;return db[_0x13a6('0x2e')]['findOne']({'where':{'id':_0x298755[_0x13a6('0x45')]['id']}})[_0x13a6('0x27')](handleEntityNotFound(_0x2d7fe9,null))['then'](function(_0x444f7b){if(_0x444f7b){_0x3df133=_0x444f7b;_0x30a13b[_0x13a6('0x33')]=_[_0x13a6('0x35')](db['VtigerField']['rawAttributes']);_0x30a13b[_0x13a6('0x34')]=_[_0x13a6('0x35')](_0x298755[_0x13a6('0x34')]);_0x30a13b['filters']=_['intersection'](_0x30a13b[_0x13a6('0x33')],_0x30a13b['query']);_0x5e5bfd[_0x13a6('0x37')]=_[_0x13a6('0x36')](_0x30a13b[_0x13a6('0x33')],qs[_0x13a6('0x38')](_0x298755[_0x13a6('0x34')][_0x13a6('0x38')]));_0x5e5bfd[_0x13a6('0x37')]=_0x5e5bfd['attributes']['length']?_0x5e5bfd[_0x13a6('0x37')]:_0x30a13b[_0x13a6('0x33')];_0x5e5bfd['order']=qs[_0x13a6('0x3b')](_0x298755[_0x13a6('0x34')][_0x13a6('0x3b')]);_0x5e5bfd[_0x13a6('0x3c')]=qs[_0x13a6('0x3d')](_['pick'](_0x298755[_0x13a6('0x34')],_0x30a13b[_0x13a6('0x3d')]));if(_0x298755[_0x13a6('0x34')][_0x13a6('0x3e')]){_0x5e5bfd['where']=_[_0x13a6('0x3f')](_0x5e5bfd[_0x13a6('0x3c')],{'$or':_[_0x13a6('0x2d')](_0x5e5bfd[_0x13a6('0x37')],function(_0x50bbb7){var _0x5086c2={};_0x5086c2[_0x50bbb7]={'$like':'%'+_0x298755['query'][_0x13a6('0x3e')]+'%'};return _0x5086c2;})});}_0x5e5bfd=_[_0x13a6('0x3f')]({},_0x5e5bfd,_0x298755[_0x13a6('0x40')]);return _0x3df133[_0x13a6('0x4c')](_0x5e5bfd);}})[_0x13a6('0x27')](function(_0x3c4559){if(_0x3c4559){_0x4ee253=_0x3c4559['length'];if(!_0x298755[_0x13a6('0x34')][_0x13a6('0x39')](_0x13a6('0x3a'))){_0x5e5bfd[_0x13a6('0x1f')]=qs[_0x13a6('0x1f')](_0x298755[_0x13a6('0x34')]['limit']);_0x5e5bfd[_0x13a6('0x1d')]=qs[_0x13a6('0x1d')](_0x298755['query'][_0x13a6('0x1d')]);}return _0x3df133[_0x13a6('0x4c')](_0x5e5bfd);}})['then'](function(_0x326c7d){if(_0x326c7d){return _0x326c7d?{'count':_0x4ee253,'rows':_0x326c7d}:null;}})[_0x13a6('0x27')](respondWithResult(_0x2d7fe9,null))[_0x13a6('0x44')](handleError(_0x2d7fe9,null));};exports[_0x13a6('0x4d')]=function(_0x3e921e,_0x2e6e9b,_0x1868ba){var _0x3c4b5b={};var _0x4d2342={};var _0x43aa00;var _0x59d1a9;return db['VtigerConfiguration'][_0x13a6('0x4e')]({'where':{'id':_0x3e921e[_0x13a6('0x45')]['id']}})[_0x13a6('0x27')](handleEntityNotFound(_0x2e6e9b,null))[_0x13a6('0x27')](function(_0x3e3f42){if(_0x3e3f42){_0x43aa00=_0x3e3f42;_0x4d2342['model']=_['keys'](db['VtigerField']['rawAttributes']);_0x4d2342[_0x13a6('0x34')]=_[_0x13a6('0x35')](_0x3e921e['query']);_0x4d2342['filters']=_[_0x13a6('0x36')](_0x4d2342[_0x13a6('0x33')],_0x4d2342['query']);_0x3c4b5b[_0x13a6('0x37')]=_[_0x13a6('0x36')](_0x4d2342[_0x13a6('0x33')],qs[_0x13a6('0x38')](_0x3e921e['query'][_0x13a6('0x38')]));_0x3c4b5b[_0x13a6('0x37')]=_0x3c4b5b['attributes'][_0x13a6('0x46')]?_0x3c4b5b[_0x13a6('0x37')]:_0x4d2342[_0x13a6('0x33')];_0x3c4b5b['order']=qs[_0x13a6('0x3b')](_0x3e921e[_0x13a6('0x34')][_0x13a6('0x3b')]);_0x3c4b5b[_0x13a6('0x3c')]=qs[_0x13a6('0x3d')](_[_0x13a6('0x4f')](_0x3e921e[_0x13a6('0x34')],_0x4d2342[_0x13a6('0x3d')]));if(_0x3e921e[_0x13a6('0x34')][_0x13a6('0x3e')]){_0x3c4b5b[_0x13a6('0x3c')]=_['merge'](_0x3c4b5b[_0x13a6('0x3c')],{'$or':_[_0x13a6('0x2d')](_0x3c4b5b[_0x13a6('0x37')],function(_0x42134e){var _0x287732={};_0x287732[_0x42134e]={'$like':'%'+_0x3e921e[_0x13a6('0x34')][_0x13a6('0x3e')]+'%'};return _0x287732;})});}_0x3c4b5b=_[_0x13a6('0x3f')]({},_0x3c4b5b,_0x3e921e[_0x13a6('0x40')]);return _0x43aa00[_0x13a6('0x4d')](_0x3c4b5b);}})[_0x13a6('0x27')](function(_0x37b119){if(_0x37b119){_0x59d1a9=_0x37b119[_0x13a6('0x46')];if(!_0x3e921e['query'][_0x13a6('0x39')](_0x13a6('0x3a'))){_0x3c4b5b[_0x13a6('0x1f')]=qs[_0x13a6('0x1f')](_0x3e921e[_0x13a6('0x34')][_0x13a6('0x1f')]);_0x3c4b5b['offset']=qs[_0x13a6('0x1d')](_0x3e921e['query'][_0x13a6('0x1d')]);}return _0x43aa00[_0x13a6('0x4d')](_0x3c4b5b);}})[_0x13a6('0x27')](function(_0x4033d2){if(_0x4033d2){return _0x4033d2?{'count':_0x59d1a9,'rows':_0x4033d2}:null;}})[_0x13a6('0x27')](respondWithResult(_0x2e6e9b,null))[_0x13a6('0x44')](handleError(_0x2e6e9b,null));};exports['getDescriptions']=function(_0x173131,_0x45086f,_0x188283){var _0x1d95c3={};var _0x1dfe66={};var _0x5bcc36;var _0x41c81f;return db[_0x13a6('0x2e')][_0x13a6('0x4e')]({'where':{'id':_0x173131['params']['id']}})[_0x13a6('0x27')](handleEntityNotFound(_0x45086f,null))[_0x13a6('0x27')](function(_0x11f5cd){if(_0x11f5cd){_0x5bcc36=_0x11f5cd;_0x1dfe66[_0x13a6('0x33')]=_['keys'](db[_0x13a6('0x50')][_0x13a6('0x2f')]);_0x1dfe66[_0x13a6('0x34')]=_[_0x13a6('0x35')](_0x173131[_0x13a6('0x34')]);_0x1dfe66['filters']=_[_0x13a6('0x36')](_0x1dfe66[_0x13a6('0x33')],_0x1dfe66[_0x13a6('0x34')]);_0x1d95c3[_0x13a6('0x37')]=_['intersection'](_0x1dfe66[_0x13a6('0x33')],qs[_0x13a6('0x38')](_0x173131[_0x13a6('0x34')][_0x13a6('0x38')]));_0x1d95c3[_0x13a6('0x37')]=_0x1d95c3[_0x13a6('0x37')]['length']?_0x1d95c3[_0x13a6('0x37')]:_0x1dfe66['model'];_0x1d95c3[_0x13a6('0x51')]=qs[_0x13a6('0x3b')](_0x173131[_0x13a6('0x34')][_0x13a6('0x3b')]);_0x1d95c3[_0x13a6('0x3c')]=qs['filters'](_[_0x13a6('0x4f')](_0x173131[_0x13a6('0x34')],_0x1dfe66['filters']));if(_0x173131[_0x13a6('0x34')][_0x13a6('0x3e')]){_0x1d95c3[_0x13a6('0x3c')]=_[_0x13a6('0x3f')](_0x1d95c3['where'],{'$or':_[_0x13a6('0x2d')](_0x1d95c3['attributes'],function(_0x4a4db9){var _0x3725b2={};_0x3725b2[_0x4a4db9]={'$like':'%'+_0x173131['query'][_0x13a6('0x3e')]+'%'};return _0x3725b2;})});}_0x1d95c3=_['merge']({},_0x1d95c3,_0x173131['options']);return _0x5bcc36[_0x13a6('0x52')](_0x1d95c3);}})[_0x13a6('0x27')](function(_0x10bad5){if(_0x10bad5){_0x41c81f=_0x10bad5[_0x13a6('0x46')];if(!_0x173131['query'][_0x13a6('0x39')](_0x13a6('0x3a'))){_0x1d95c3[_0x13a6('0x1f')]=qs[_0x13a6('0x1f')](_0x173131['query'][_0x13a6('0x1f')]);_0x1d95c3[_0x13a6('0x1d')]=qs[_0x13a6('0x1d')](_0x173131['query'][_0x13a6('0x1d')]);}return _0x5bcc36[_0x13a6('0x52')](_0x1d95c3);}})['then'](function(_0x3aab1e){if(_0x3aab1e){return _0x3aab1e?{'count':_0x41c81f,'rows':_0x3aab1e}:null;}})[_0x13a6('0x27')](respondWithResult(_0x45086f,null))[_0x13a6('0x44')](handleError(_0x45086f,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index 6fc9c87..69e703d 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 _0x966b=['request-promise','path','../../config/environment','exports','define','int_vtiger_configurations','util','moment','bluebird'];(function(_0xbb9dbf,_0x5dafa4){var _0x30223c=function(_0xaa9ca){while(--_0xaa9ca){_0xbb9dbf['push'](_0xbb9dbf['shift']());}};_0x30223c(++_0x5dafa4);}(_0x966b,0x19b));var _0xb966=function(_0x4883cb,_0x3df63c){_0x4883cb=_0x4883cb-0x0;var _0x33aad7=_0x966b[_0x4883cb];return _0x33aad7;};'use strict';var _=require('lodash');var util=require(_0xb966('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xb966('0x1'));var BPromise=require(_0xb966('0x2'));var rp=require(_0xb966('0x3'));var fs=require('fs');var path=require(_0xb966('0x4'));var rimraf=require('rimraf');var config=require(_0xb966('0x5'));var attributes=require('./intVtigerConfiguration.attributes');module[_0xb966('0x6')]=function(_0x1b5ea8,_0x44ace0){return _0x1b5ea8[_0xb966('0x7')]('VtigerConfiguration',attributes,{'tableName':_0xb966('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa631=['../../config/environment','./intVtigerConfiguration.attributes','exports','define','VtigerConfiguration','lodash','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x2c060a,_0x919f9e){var _0x118b51=function(_0x599023){while(--_0x599023){_0x2c060a['push'](_0x2c060a['shift']());}};_0x118b51(++_0x919f9e);}(_0xa631,0xf5));var _0x1a63=function(_0x52de0c,_0x9480a9){_0x52de0c=_0x52de0c-0x0;var _0x55fd1e=_0xa631[_0x52de0c];return _0x55fd1e;};'use strict';var _=require(_0x1a63('0x0'));var util=require('util');var logger=require(_0x1a63('0x1'))(_0x1a63('0x2'));var moment=require(_0x1a63('0x3'));var BPromise=require(_0x1a63('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1a63('0x5'));var rimraf=require(_0x1a63('0x6'));var config=require(_0x1a63('0x7'));var attributes=require(_0x1a63('0x8'));module[_0x1a63('0x9')]=function(_0x5dc75a,_0x111842){return _0x5dc75a[_0x1a63('0xa')](_0x1a63('0xb'),attributes,{'tableName':'int_vtiger_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js index ec04f08..eb6e913 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 _0x3581=['../../mysqldb','../../config/environment','jayson/promise','http','request','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x555e88,_0x15f0ec){var _0x556baa=function(_0x3fee93){while(--_0x3fee93){_0x555e88['push'](_0x555e88['shift']());}};_0x556baa(++_0x15f0ec);}(_0x3581,0x1da));var _0x1358=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3581[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x1358('0x0'));var util=require(_0x1358('0x1'));var moment=require(_0x1358('0x2'));var BPromise=require(_0x1358('0x3'));var rs=require(_0x1358('0x4'));var fs=require('fs');var Redis=require(_0x1358('0x5'));var db=require(_0x1358('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x1358('0x7'));var jayson=require(_0x1358('0x8'));var client=jayson['client'][_0x1358('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x12b7b7,_0x32f781,_0x13bf2a){return new BPromise(function(_0x36d9da,_0x666747){return client[_0x1358('0xa')](_0x12b7b7,_0x13bf2a)['then'](function(_0x432f13){logger['info'](_0x1358('0xb'),_0x32f781,_0x1358('0xc'));logger['debug'](_0x1358('0xd'),_0x32f781,_0x1358('0xc'),JSON[_0x1358('0xe')](_0x432f13));if(_0x432f13['error']){if(_0x432f13[_0x1358('0xf')][_0x1358('0x10')]===0x1f4){logger[_0x1358('0xf')](_0x1358('0xb'),_0x32f781,_0x432f13[_0x1358('0xf')][_0x1358('0x11')]);return _0x666747(_0x432f13[_0x1358('0xf')]['message']);}logger['error'](_0x1358('0xb'),_0x32f781,_0x432f13[_0x1358('0xf')][_0x1358('0x11')]);return _0x36d9da(_0x432f13[_0x1358('0xf')][_0x1358('0x11')]);}else{logger['info'](_0x1358('0xb'),_0x32f781,'request\x20sent');_0x36d9da(_0x432f13[_0x1358('0x12')][_0x1358('0x11')]);}})[_0x1358('0x13')](function(_0x2eb2d2){logger[_0x1358('0xf')](_0x1358('0xb'),_0x32f781,_0x2eb2d2);_0x666747(_0x2eb2d2);});});} \ No newline at end of file +var _0x6f48=['then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x28dad7,_0x4b59d7){var _0x18a44e=function(_0x439b9b){while(--_0x439b9b){_0x28dad7['push'](_0x28dad7['shift']());}};_0x18a44e(++_0x4b59d7);}(_0x6f48,0x17b));var _0x86f4=function(_0x93b420,_0x492a89){_0x93b420=_0x93b420-0x0;var _0xf854bf=_0x6f48[_0x93b420];return _0xf854bf;};'use strict';var _=require(_0x86f4('0x0'));var util=require('util');var moment=require(_0x86f4('0x1'));var BPromise=require(_0x86f4('0x2'));var rs=require(_0x86f4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x86f4('0x4'))['db'];var utils=require(_0x86f4('0x5'));var logger=require(_0x86f4('0x6'))(_0x86f4('0x7'));var config=require(_0x86f4('0x8'));var jayson=require(_0x86f4('0x9'));var client=jayson['client'][_0x86f4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1e02cd,_0x6e6c67,_0x492168){return new BPromise(function(_0x288fb2,_0x35ad24){return client[_0x86f4('0xb')](_0x1e02cd,_0x492168)[_0x86f4('0xc')](function(_0x3c8f2c){logger[_0x86f4('0xd')](_0x86f4('0xe'),_0x6e6c67,_0x86f4('0xf'));logger['debug'](_0x86f4('0x10'),_0x6e6c67,_0x86f4('0xf'),JSON[_0x86f4('0x11')](_0x3c8f2c));if(_0x3c8f2c['error']){if(_0x3c8f2c[_0x86f4('0x12')][_0x86f4('0x13')]===0x1f4){logger['error'](_0x86f4('0xe'),_0x6e6c67,_0x3c8f2c[_0x86f4('0x12')][_0x86f4('0x14')]);return _0x35ad24(_0x3c8f2c['error'][_0x86f4('0x14')]);}logger[_0x86f4('0x12')](_0x86f4('0xe'),_0x6e6c67,_0x3c8f2c[_0x86f4('0x12')][_0x86f4('0x14')]);return _0x288fb2(_0x3c8f2c[_0x86f4('0x12')][_0x86f4('0x14')]);}else{logger['info']('VtigerConfiguration,\x20%s,\x20%s',_0x6e6c67,'request\x20sent');_0x288fb2(_0x3c8f2c[_0x86f4('0x15')]['message']);}})[_0x86f4('0x16')](function(_0x30f284){logger[_0x86f4('0x12')](_0x86f4('0xe'),_0x6e6c67,_0x30f284);_0x35ad24(_0x30f284);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index 86d1760..c408c18 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 _0xa7cf=['path','connect-timeout','express','Router','../../components/interaction/service','./intVtigerField.controller','get','isAuthenticated','index','/:id','put','update','delete','destroy','exports','multer','util'];(function(_0x550a9f,_0x4784c6){var _0x2a8aa4=function(_0x31bb3b){while(--_0x31bb3b){_0x550a9f['push'](_0x550a9f['shift']());}};_0x2a8aa4(++_0x4784c6);}(_0xa7cf,0x130));var _0xfa7c=function(_0x1e500e,_0x2c9d74){_0x1e500e=_0x1e500e-0x0;var _0x10dc5e=_0xa7cf[_0x1e500e];return _0x10dc5e;};'use strict';var multer=require(_0xfa7c('0x0'));var util=require(_0xfa7c('0x1'));var path=require(_0xfa7c('0x2'));var timeout=require(_0xfa7c('0x3'));var express=require(_0xfa7c('0x4'));var router=express[_0xfa7c('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xfa7c('0x6'));var config=require('../../config/environment');var controller=require(_0xfa7c('0x7'));router[_0xfa7c('0x8')]('/',auth[_0xfa7c('0x9')](),controller[_0xfa7c('0xa')]);router[_0xfa7c('0x8')](_0xfa7c('0xb'),auth[_0xfa7c('0x9')](),controller['show']);router['post']('/',auth[_0xfa7c('0x9')](),controller['create']);router[_0xfa7c('0xc')](_0xfa7c('0xb'),auth[_0xfa7c('0x9')](),controller[_0xfa7c('0xd')]);router[_0xfa7c('0xe')](_0xfa7c('0xb'),auth[_0xfa7c('0x9')](),controller[_0xfa7c('0xf')]);module[_0xfa7c('0x10')]=router; \ No newline at end of file +var _0xd7e2=['exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./intVtigerField.controller','isAuthenticated','index','get','/:id','show','create','update','delete','destroy'];(function(_0x48e1ec,_0x35f468){var _0x3b33eb=function(_0x507bf9){while(--_0x507bf9){_0x48e1ec['push'](_0x48e1ec['shift']());}};_0x3b33eb(++_0x35f468);}(_0xd7e2,0x6d));var _0x2d7e=function(_0x4e04a2,_0x40a69c){_0x4e04a2=_0x4e04a2-0x0;var _0x38d43a=_0xd7e2[_0x4e04a2];return _0x38d43a;};'use strict';var multer=require(_0x2d7e('0x0'));var util=require(_0x2d7e('0x1'));var path=require(_0x2d7e('0x2'));var timeout=require(_0x2d7e('0x3'));var express=require('express');var router=express[_0x2d7e('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2d7e('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x2d7e('0x6'));var controller=require(_0x2d7e('0x7'));router['get']('/',auth[_0x2d7e('0x8')](),controller[_0x2d7e('0x9')]);router[_0x2d7e('0xa')](_0x2d7e('0xb'),auth[_0x2d7e('0x8')](),controller[_0x2d7e('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x2d7e('0xd')]);router['put'](_0x2d7e('0xb'),auth[_0x2d7e('0x8')](),controller[_0x2d7e('0xe')]);router[_0x2d7e('0xf')](_0x2d7e('0xb'),auth[_0x2d7e('0x8')](),controller[_0x2d7e('0x10')]);module[_0x2d7e('0x11')]=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index e4f05d4..e4c98ac 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 _0x5f21=['string','variable','customVariable','picklist','STRING','sequelize','exports','ENUM'];(function(_0xe57185,_0x34a66f){var _0x2c7ab7=function(_0x1a94d9){while(--_0x1a94d9){_0xe57185['push'](_0xe57185['shift']());}};_0x2c7ab7(++_0x34a66f);}(_0x5f21,0x105));var _0x15f2=function(_0xadd386,_0x1fda2a){_0xadd386=_0xadd386-0x0;var _0xb996dd=_0x5f21[_0xadd386];return _0xb996dd;};'use strict';var Sequelize=require(_0x15f2('0x0'));module[_0x15f2('0x1')]={'type':{'type':Sequelize[_0x15f2('0x2')](_0x15f2('0x3'),_0x15f2('0x4'),_0x15f2('0x5'),'keyValue',_0x15f2('0x6')),'defaultValue':_0x15f2('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x15f2('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0x15f2('0x3'),_0x15f2('0x4'),_0x15f2('0x5'))},'keyContent':{'type':Sequelize[_0x15f2('0x7')]},'idField':{'type':Sequelize[_0x15f2('0x7')]},'nameField':{'type':Sequelize[_0x15f2('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x15f2('0x7')]}}; \ No newline at end of file +var _0xb84e=['variable','customVariable','keyValue','picklist','STRING','BOOLEAN','exports','ENUM','string'];(function(_0x4a6f9c,_0x4bf470){var _0x4218c2=function(_0x3a7125){while(--_0x3a7125){_0x4a6f9c['push'](_0x4a6f9c['shift']());}};_0x4218c2(++_0x4bf470);}(_0xb84e,0x1d1));var _0xeb84=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0xb84e[_0x50a0c2];return _0x5ebadd;};'use strict';var Sequelize=require('sequelize');module[_0xeb84('0x0')]={'type':{'type':Sequelize[_0xeb84('0x1')](_0xeb84('0x2'),_0xeb84('0x3'),_0xeb84('0x4'),_0xeb84('0x5'),_0xeb84('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0xeb84('0x7')]},'key':{'type':Sequelize[_0xeb84('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0xeb84('0x2'),_0xeb84('0x3'),_0xeb84('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xeb84('0x7')]},'nameField':{'type':Sequelize[_0xeb84('0x7')]},'customField':{'type':Sequelize[_0xeb84('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xeb84('0x7')]}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index fbdab16..509e321 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 _0xdec6=['index','VtigerField','rawAttributes','type','model','map','query','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','catch','params','keys','include','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','to-csv','ejs','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','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','stack','name','send'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xdec6,0xa5));var _0x6dec=function(_0x17928f,_0x4ad33f){_0x17928f=_0x17928f-0x0;var _0x500b63=_0xdec6[_0x17928f];return _0x500b63;};'use strict';var emlformat=require(_0x6dec('0x0'));var rimraf=require(_0x6dec('0x1'));var zipdir=require(_0x6dec('0x2'));var jsonpatch=require(_0x6dec('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x6dec('0x4'));var Mustache=require(_0x6dec('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x6dec('0x6'));var ejs=require(_0x6dec('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0x6dec('0x8'));var jsforce=require(_0x6dec('0x9'));var deskjs=require(_0x6dec('0xa'));var toCsv=require(_0x6dec('0x6'));var querystring=require(_0x6dec('0xb'));var Papa=require(_0x6dec('0xc'));var Redis=require(_0x6dec('0xd'));var authService=require(_0x6dec('0xe'));var qs=require(_0x6dec('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6dec('0x10'));var logger=require(_0x6dec('0x11'))('api');var utils=require(_0x6dec('0x12'));var config=require(_0x6dec('0x13'));var licenseUtil=require(_0x6dec('0x14'));var db=require(_0x6dec('0x15'))['db'];function respondWithStatusCode(_0x35c1e5,_0x5f5b29){_0x5f5b29=_0x5f5b29||0xcc;return function(_0x2ac44b){if(_0x2ac44b){return _0x35c1e5[_0x6dec('0x16')](_0x5f5b29);}return _0x35c1e5[_0x6dec('0x17')](_0x5f5b29)[_0x6dec('0x18')]();};}function respondWithResult(_0x3c7b9,_0x2c6eb9){_0x2c6eb9=_0x2c6eb9||0xc8;return function(_0x4dfa54){if(_0x4dfa54){return _0x3c7b9[_0x6dec('0x17')](_0x2c6eb9)[_0x6dec('0x19')](_0x4dfa54);}};}function respondWithFilteredResult(_0x1116fd,_0x552bbd){return function(_0x41bb38){if(_0x41bb38){var _0x27b738=typeof _0x552bbd[_0x6dec('0x1a')]===_0x6dec('0x1b')&&typeof _0x552bbd[_0x6dec('0x1c')]===_0x6dec('0x1b');var _0x246302=_0x41bb38['count'];var _0x6322b=_0x27b738?0x0:_0x552bbd['offset'];var _0x420cec=_0x27b738?_0x41bb38[_0x6dec('0x1d')]:_0x552bbd[_0x6dec('0x1a')]+_0x552bbd['limit'];var _0x5947ef;if(_0x420cec>=_0x246302){_0x420cec=_0x246302;_0x5947ef=0xc8;}else{_0x5947ef=0xce;}_0x1116fd['status'](_0x5947ef);return _0x1116fd[_0x6dec('0x1e')](_0x6dec('0x1f'),_0x6322b+'-'+_0x420cec+'/'+_0x246302)[_0x6dec('0x19')](_0x41bb38);}return null;};}function patchUpdates(_0x2e1c86){return function(_0x25e078){try{jsonpatch[_0x6dec('0x20')](_0x25e078,_0x2e1c86,!![]);}catch(_0x387c89){return BPromise['reject'](_0x387c89);}return _0x25e078[_0x6dec('0x21')]();};}function saveUpdates(_0x56351a,_0x1fcc37){return function(_0x106880){if(_0x106880){return _0x106880[_0x6dec('0x22')](_0x56351a)[_0x6dec('0x23')](function(_0x5bf0c5){return _0x5bf0c5;});}return null;};}function removeEntity(_0x22026e,_0x4704a7){return function(_0x3a0bf0){if(_0x3a0bf0){return _0x3a0bf0['destroy']()['then'](function(){_0x22026e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x29999d,_0x560770){return function(_0x46624d){if(!_0x46624d){_0x29999d[_0x6dec('0x16')](0x194);}return _0x46624d;};}function handleError(_0x57a0c7,_0x148018){_0x148018=_0x148018||0x1f4;return function(_0x52202f){logger['error'](_0x52202f[_0x6dec('0x24')]);if(_0x52202f['name']){delete _0x52202f[_0x6dec('0x25')];}_0x57a0c7[_0x6dec('0x17')](_0x148018)[_0x6dec('0x26')](_0x52202f);};}exports[_0x6dec('0x27')]=function(_0x108561,_0x13af47){var _0x40090d={},_0x49396c={},_0x2dd40f={'count':0x0,'rows':[]};var _0x197817=_['map'](db[_0x6dec('0x28')][_0x6dec('0x29')],function(_0xf65bb7){return{'name':_0xf65bb7['fieldName'],'type':_0xf65bb7[_0x6dec('0x2a')]['key']};});_0x49396c[_0x6dec('0x2b')]=_[_0x6dec('0x2c')](_0x197817,_0x6dec('0x25'));_0x49396c[_0x6dec('0x2d')]=_['keys'](_0x108561[_0x6dec('0x2d')]);_0x49396c[_0x6dec('0x2e')]=_['intersection'](_0x49396c[_0x6dec('0x2b')],_0x49396c[_0x6dec('0x2d')]);_0x40090d[_0x6dec('0x2f')]=_[_0x6dec('0x30')](_0x49396c[_0x6dec('0x2b')],qs[_0x6dec('0x31')](_0x108561[_0x6dec('0x2d')]['fields']));_0x40090d['attributes']=_0x40090d['attributes'][_0x6dec('0x32')]?_0x40090d[_0x6dec('0x2f')]:_0x49396c[_0x6dec('0x2b')];if(!_0x108561[_0x6dec('0x2d')]['hasOwnProperty'](_0x6dec('0x33'))){_0x40090d[_0x6dec('0x1c')]=qs[_0x6dec('0x1c')](_0x108561[_0x6dec('0x2d')][_0x6dec('0x1c')]);_0x40090d[_0x6dec('0x1a')]=qs[_0x6dec('0x1a')](_0x108561[_0x6dec('0x2d')]['offset']);}_0x40090d[_0x6dec('0x34')]=qs[_0x6dec('0x35')](_0x108561['query']['sort']);_0x40090d[_0x6dec('0x36')]=qs[_0x6dec('0x2e')](_[_0x6dec('0x37')](_0x108561[_0x6dec('0x2d')],_0x49396c['filters']),_0x197817);if(_0x108561[_0x6dec('0x2d')][_0x6dec('0x38')]){_0x40090d[_0x6dec('0x36')]=_[_0x6dec('0x39')](_0x40090d[_0x6dec('0x36')],{'$or':_[_0x6dec('0x2c')](_0x197817,function(_0x409cb2){if(_0x409cb2[_0x6dec('0x2a')]!==_0x6dec('0x3a')){var _0x37fbe9={};_0x37fbe9[_0x409cb2[_0x6dec('0x25')]]={'$like':'%'+_0x108561['query'][_0x6dec('0x38')]+'%'};return _0x37fbe9;}})});}_0x40090d=_[_0x6dec('0x39')]({},_0x40090d,_0x108561[_0x6dec('0x3b')]);var _0x350b78={'where':_0x40090d[_0x6dec('0x36')]};return db[_0x6dec('0x28')][_0x6dec('0x1d')](_0x350b78)[_0x6dec('0x23')](function(_0x128cc3){_0x2dd40f[_0x6dec('0x1d')]=_0x128cc3;if(_0x108561['query']['includeAll']){_0x40090d['include']=[{'all':!![]}];}return db[_0x6dec('0x28')][_0x6dec('0x3c')](_0x40090d);})[_0x6dec('0x23')](function(_0x5e5fca){_0x2dd40f['rows']=_0x5e5fca;return _0x2dd40f;})['then'](respondWithFilteredResult(_0x13af47,_0x40090d))[_0x6dec('0x3d')](handleError(_0x13af47,null));};exports['show']=function(_0x3e2119,_0x144063){var _0x2ab2c0={'raw':!![],'where':{'id':_0x3e2119[_0x6dec('0x3e')]['id']}},_0x261b52={};_0x261b52[_0x6dec('0x2b')]=_['keys'](db[_0x6dec('0x28')][_0x6dec('0x29')]);_0x261b52[_0x6dec('0x2d')]=_[_0x6dec('0x3f')](_0x3e2119[_0x6dec('0x2d')]);_0x261b52['filters']=_[_0x6dec('0x30')](_0x261b52[_0x6dec('0x2b')],_0x261b52[_0x6dec('0x2d')]);_0x2ab2c0[_0x6dec('0x2f')]=_[_0x6dec('0x30')](_0x261b52[_0x6dec('0x2b')],qs['fields'](_0x3e2119[_0x6dec('0x2d')]['fields']));_0x2ab2c0[_0x6dec('0x2f')]=_0x2ab2c0[_0x6dec('0x2f')][_0x6dec('0x32')]?_0x2ab2c0[_0x6dec('0x2f')]:_0x261b52[_0x6dec('0x2b')];if(_0x3e2119[_0x6dec('0x2d')]['includeAll']){_0x2ab2c0[_0x6dec('0x40')]=[{'all':!![]}];}_0x2ab2c0=_[_0x6dec('0x39')]({},_0x2ab2c0,_0x3e2119[_0x6dec('0x3b')]);return db[_0x6dec('0x28')]['find'](_0x2ab2c0)[_0x6dec('0x23')](handleEntityNotFound(_0x144063,null))[_0x6dec('0x23')](respondWithResult(_0x144063,null))[_0x6dec('0x3d')](handleError(_0x144063,null));};exports[_0x6dec('0x41')]=function(_0x47edf4,_0x3beb55){return db[_0x6dec('0x28')][_0x6dec('0x41')](_0x47edf4[_0x6dec('0x42')],{})[_0x6dec('0x23')](respondWithResult(_0x3beb55,0xc9))[_0x6dec('0x3d')](handleError(_0x3beb55,null));};exports['update']=function(_0x2265b5,_0x84918c){if(_0x2265b5[_0x6dec('0x42')]['id']){delete _0x2265b5[_0x6dec('0x42')]['id'];}return db[_0x6dec('0x28')][_0x6dec('0x43')]({'where':{'id':_0x2265b5[_0x6dec('0x3e')]['id']}})['then'](handleEntityNotFound(_0x84918c,null))['then'](saveUpdates(_0x2265b5[_0x6dec('0x42')],null))[_0x6dec('0x23')](respondWithResult(_0x84918c,null))['catch'](handleError(_0x84918c,null));};exports['destroy']=function(_0x1eff86,_0x41a67a){return db[_0x6dec('0x28')]['find']({'where':{'id':_0x1eff86[_0x6dec('0x3e')]['id']}})['then'](handleEntityNotFound(_0x41a67a,null))[_0x6dec('0x23')](removeEntity(_0x41a67a,null))[_0x6dec('0x3d')](handleError(_0x41a67a,null));}; \ No newline at end of file +var _0xd5e1=['set','Content-Range','apply','reject','save','then','destroy','error','name','index','VtigerField','fieldName','type','model','map','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','options','count','includeAll','findAll','rows','params','keys','rawAttributes','length','find','catch','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','offset','undefined'];(function(_0x20ae59,_0x11d00b){var _0x2da86f=function(_0x2a3230){while(--_0x2a3230){_0x20ae59['push'](_0x20ae59['shift']());}};_0x2da86f(++_0x11d00b);}(_0xd5e1,0x14a));var _0x1d5e=function(_0x44ed23,_0x510fbb){_0x44ed23=_0x44ed23-0x0;var _0x44b9b4=_0xd5e1[_0x44ed23];return _0x44b9b4;};'use strict';var emlformat=require(_0x1d5e('0x0'));var rimraf=require(_0x1d5e('0x1'));var zipdir=require(_0x1d5e('0x2'));var jsonpatch=require(_0x1d5e('0x3'));var rp=require(_0x1d5e('0x4'));var moment=require(_0x1d5e('0x5'));var BPromise=require(_0x1d5e('0x6'));var Mustache=require(_0x1d5e('0x7'));var util=require('util');var path=require(_0x1d5e('0x8'));var sox=require(_0x1d5e('0x9'));var csv=require(_0x1d5e('0xa'));var ejs=require(_0x1d5e('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1d5e('0xc'));var squel=require(_0x1d5e('0xd'));var crypto=require(_0x1d5e('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x1d5e('0xf'));var Papa=require(_0x1d5e('0x10'));var Redis=require(_0x1d5e('0x11'));var authService=require(_0x1d5e('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x1d5e('0x13'));var hardwareService=require(_0x1d5e('0x14'));var logger=require(_0x1d5e('0x15'))(_0x1d5e('0x16'));var utils=require(_0x1d5e('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x1d5e('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x55432b,_0x1ef352){_0x1ef352=_0x1ef352||0xcc;return function(_0x165c9b){if(_0x165c9b){return _0x55432b[_0x1d5e('0x19')](_0x1ef352);}return _0x55432b[_0x1d5e('0x1a')](_0x1ef352)[_0x1d5e('0x1b')]();};}function respondWithResult(_0x182b28,_0x285a39){_0x285a39=_0x285a39||0xc8;return function(_0x165c00){if(_0x165c00){return _0x182b28[_0x1d5e('0x1a')](_0x285a39)['json'](_0x165c00);}};}function respondWithFilteredResult(_0x376e26,_0x22aa1a){return function(_0x3c4add){if(_0x3c4add){var _0x326f63=typeof _0x22aa1a[_0x1d5e('0x1c')]===_0x1d5e('0x1d')&&typeof _0x22aa1a['limit']===_0x1d5e('0x1d');var _0x42dfcb=_0x3c4add['count'];var _0xc20f43=_0x326f63?0x0:_0x22aa1a[_0x1d5e('0x1c')];var _0x259d4f=_0x326f63?_0x3c4add['count']:_0x22aa1a[_0x1d5e('0x1c')]+_0x22aa1a['limit'];var _0x2ccfe5;if(_0x259d4f>=_0x42dfcb){_0x259d4f=_0x42dfcb;_0x2ccfe5=0xc8;}else{_0x2ccfe5=0xce;}_0x376e26[_0x1d5e('0x1a')](_0x2ccfe5);return _0x376e26[_0x1d5e('0x1e')](_0x1d5e('0x1f'),_0xc20f43+'-'+_0x259d4f+'/'+_0x42dfcb)['json'](_0x3c4add);}return null;};}function patchUpdates(_0x4012d0){return function(_0x5e2d5f){try{jsonpatch[_0x1d5e('0x20')](_0x5e2d5f,_0x4012d0,!![]);}catch(_0x3f9701){return BPromise[_0x1d5e('0x21')](_0x3f9701);}return _0x5e2d5f[_0x1d5e('0x22')]();};}function saveUpdates(_0x4d9d4d,_0x2c3173){return function(_0x1d86d5){if(_0x1d86d5){return _0x1d86d5['update'](_0x4d9d4d)[_0x1d5e('0x23')](function(_0x2a9799){return _0x2a9799;});}return null;};}function removeEntity(_0x283af8,_0x3d067d){return function(_0x3fbfd4){if(_0x3fbfd4){return _0x3fbfd4[_0x1d5e('0x24')]()[_0x1d5e('0x23')](function(){_0x283af8[_0x1d5e('0x1a')](0xcc)[_0x1d5e('0x1b')]();});}};}function handleEntityNotFound(_0x4b97b6,_0x466aed){return function(_0x41d407){if(!_0x41d407){_0x4b97b6[_0x1d5e('0x19')](0x194);}return _0x41d407;};}function handleError(_0x29aa50,_0xc06a45){_0xc06a45=_0xc06a45||0x1f4;return function(_0x3cd2f1){logger[_0x1d5e('0x25')](_0x3cd2f1['stack']);if(_0x3cd2f1[_0x1d5e('0x26')]){delete _0x3cd2f1['name'];}_0x29aa50[_0x1d5e('0x1a')](_0xc06a45)['send'](_0x3cd2f1);};}exports[_0x1d5e('0x27')]=function(_0x4b267c,_0x1dfaa2){var _0x3f3340={},_0x4a37d7={},_0x453810={'count':0x0,'rows':[]};var _0x3b68d5=_['map'](db[_0x1d5e('0x28')]['rawAttributes'],function(_0x1b7072){return{'name':_0x1b7072[_0x1d5e('0x29')],'type':_0x1b7072[_0x1d5e('0x2a')]['key']};});_0x4a37d7[_0x1d5e('0x2b')]=_[_0x1d5e('0x2c')](_0x3b68d5,_0x1d5e('0x26'));_0x4a37d7[_0x1d5e('0x2d')]=_['keys'](_0x4b267c['query']);_0x4a37d7[_0x1d5e('0x2e')]=_[_0x1d5e('0x2f')](_0x4a37d7[_0x1d5e('0x2b')],_0x4a37d7[_0x1d5e('0x2d')]);_0x3f3340['attributes']=_['intersection'](_0x4a37d7[_0x1d5e('0x2b')],qs[_0x1d5e('0x30')](_0x4b267c['query']['fields']));_0x3f3340['attributes']=_0x3f3340[_0x1d5e('0x31')]['length']?_0x3f3340[_0x1d5e('0x31')]:_0x4a37d7['model'];if(!_0x4b267c['query'][_0x1d5e('0x32')](_0x1d5e('0x33'))){_0x3f3340[_0x1d5e('0x34')]=qs[_0x1d5e('0x34')](_0x4b267c[_0x1d5e('0x2d')][_0x1d5e('0x34')]);_0x3f3340[_0x1d5e('0x1c')]=qs[_0x1d5e('0x1c')](_0x4b267c[_0x1d5e('0x2d')]['offset']);}_0x3f3340[_0x1d5e('0x35')]=qs['sort'](_0x4b267c[_0x1d5e('0x2d')][_0x1d5e('0x36')]);_0x3f3340[_0x1d5e('0x37')]=qs['filters'](_['pick'](_0x4b267c['query'],_0x4a37d7[_0x1d5e('0x2e')]),_0x3b68d5);if(_0x4b267c[_0x1d5e('0x2d')][_0x1d5e('0x38')]){_0x3f3340[_0x1d5e('0x37')]=_['merge'](_0x3f3340[_0x1d5e('0x37')],{'$or':_[_0x1d5e('0x2c')](_0x3b68d5,function(_0x48adeb){if(_0x48adeb[_0x1d5e('0x2a')]!=='VIRTUAL'){var _0x1c806b={};_0x1c806b[_0x48adeb['name']]={'$like':'%'+_0x4b267c['query'][_0x1d5e('0x38')]+'%'};return _0x1c806b;}})});}_0x3f3340=_[_0x1d5e('0x39')]({},_0x3f3340,_0x4b267c[_0x1d5e('0x3a')]);var _0xecaf08={'where':_0x3f3340[_0x1d5e('0x37')]};return db[_0x1d5e('0x28')]['count'](_0xecaf08)[_0x1d5e('0x23')](function(_0x4a6040){_0x453810[_0x1d5e('0x3b')]=_0x4a6040;if(_0x4b267c[_0x1d5e('0x2d')][_0x1d5e('0x3c')]){_0x3f3340['include']=[{'all':!![]}];}return db[_0x1d5e('0x28')][_0x1d5e('0x3d')](_0x3f3340);})[_0x1d5e('0x23')](function(_0x42e034){_0x453810[_0x1d5e('0x3e')]=_0x42e034;return _0x453810;})[_0x1d5e('0x23')](respondWithFilteredResult(_0x1dfaa2,_0x3f3340))['catch'](handleError(_0x1dfaa2,null));};exports['show']=function(_0x2cc418,_0x3701b0){var _0xc9b482={'raw':!![],'where':{'id':_0x2cc418[_0x1d5e('0x3f')]['id']}},_0x17be1e={};_0x17be1e['model']=_[_0x1d5e('0x40')](db[_0x1d5e('0x28')][_0x1d5e('0x41')]);_0x17be1e['query']=_[_0x1d5e('0x40')](_0x2cc418['query']);_0x17be1e[_0x1d5e('0x2e')]=_['intersection'](_0x17be1e[_0x1d5e('0x2b')],_0x17be1e[_0x1d5e('0x2d')]);_0xc9b482[_0x1d5e('0x31')]=_[_0x1d5e('0x2f')](_0x17be1e['model'],qs[_0x1d5e('0x30')](_0x2cc418['query'][_0x1d5e('0x30')]));_0xc9b482[_0x1d5e('0x31')]=_0xc9b482[_0x1d5e('0x31')][_0x1d5e('0x42')]?_0xc9b482[_0x1d5e('0x31')]:_0x17be1e[_0x1d5e('0x2b')];if(_0x2cc418[_0x1d5e('0x2d')][_0x1d5e('0x3c')]){_0xc9b482['include']=[{'all':!![]}];}_0xc9b482=_['merge']({},_0xc9b482,_0x2cc418[_0x1d5e('0x3a')]);return db[_0x1d5e('0x28')][_0x1d5e('0x43')](_0xc9b482)[_0x1d5e('0x23')](handleEntityNotFound(_0x3701b0,null))['then'](respondWithResult(_0x3701b0,null))[_0x1d5e('0x44')](handleError(_0x3701b0,null));};exports[_0x1d5e('0x45')]=function(_0x3ee658,_0x4040a8){return db[_0x1d5e('0x28')][_0x1d5e('0x45')](_0x3ee658[_0x1d5e('0x46')],{})[_0x1d5e('0x23')](respondWithResult(_0x4040a8,0xc9))[_0x1d5e('0x44')](handleError(_0x4040a8,null));};exports[_0x1d5e('0x47')]=function(_0x37fff7,_0x972df){if(_0x37fff7[_0x1d5e('0x46')]['id']){delete _0x37fff7['body']['id'];}return db[_0x1d5e('0x28')]['find']({'where':{'id':_0x37fff7[_0x1d5e('0x3f')]['id']}})[_0x1d5e('0x23')](handleEntityNotFound(_0x972df,null))['then'](saveUpdates(_0x37fff7[_0x1d5e('0x46')],null))[_0x1d5e('0x23')](respondWithResult(_0x972df,null))[_0x1d5e('0x44')](handleError(_0x972df,null));};exports['destroy']=function(_0x4abbcf,_0x17246f){return db['VtigerField'][_0x1d5e('0x43')]({'where':{'id':_0x4abbcf[_0x1d5e('0x3f')]['id']}})[_0x1d5e('0x23')](handleEntityNotFound(_0x17246f,null))['then'](removeEntity(_0x17246f,null))[_0x1d5e('0x44')](handleError(_0x17246f,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index 33aa85f..20f9d32 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 _0xdb5f=['util','../../config/logger','api','moment','path','../../config/environment','VtigerField','int_vtiger_fields','vtiger_unique_index','lodash'];(function(_0x4e93a9,_0x413f30){var _0x43013c=function(_0x3a0cf3){while(--_0x3a0cf3){_0x4e93a9['push'](_0x4e93a9['shift']());}};_0x43013c(++_0x413f30);}(_0xdb5f,0x1f3));var _0xfdb5=function(_0x11fa2f,_0x3ad278){_0x11fa2f=_0x11fa2f-0x0;var _0x39ee07=_0xdb5f[_0x11fa2f];return _0x39ee07;};'use strict';var _=require(_0xfdb5('0x0'));var util=require(_0xfdb5('0x1'));var logger=require(_0xfdb5('0x2'))(_0xfdb5('0x3'));var moment=require(_0xfdb5('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xfdb5('0x5'));var rimraf=require('rimraf');var config=require(_0xfdb5('0x6'));var attributes=require('./intVtigerField.attributes');module['exports']=function(_0x154aaa,_0x35f891){return _0x154aaa['define'](_0xfdb5('0x7'),attributes,{'tableName':_0xfdb5('0x8'),'paranoid':![],'indexes':[{'name':_0xfdb5('0x9'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc857=['idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','VtigerField','int_vtiger_fields','vtiger_unique_index'];(function(_0x3c85f1,_0x4cee02){var _0x22ad27=function(_0x2a6717){while(--_0x2a6717){_0x3c85f1['push'](_0x3c85f1['shift']());}};_0x22ad27(++_0x4cee02);}(_0xc857,0x1cd));var _0x7c85=function(_0x27bbae,_0x2e7339){_0x27bbae=_0x27bbae-0x0;var _0x149155=_0xc857[_0x27bbae];return _0x149155;};'use strict';var _=require(_0x7c85('0x0'));var util=require(_0x7c85('0x1'));var logger=require(_0x7c85('0x2'))(_0x7c85('0x3'));var moment=require(_0x7c85('0x4'));var BPromise=require(_0x7c85('0x5'));var rp=require(_0x7c85('0x6'));var fs=require('fs');var path=require(_0x7c85('0x7'));var rimraf=require(_0x7c85('0x8'));var config=require(_0x7c85('0x9'));var attributes=require('./intVtigerField.attributes');module[_0x7c85('0xa')]=function(_0x564aae,_0x14726b){return _0x564aae[_0x7c85('0xb')](_0x7c85('0xc'),attributes,{'tableName':_0x7c85('0xd'),'paranoid':![],'indexes':[{'name':_0x7c85('0xe'),'fields':[_0x7c85('0xf'),_0x7c85('0x10')],'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 63c7523..25a54d8 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 _0x2b9b=['http','request','then','request\x20sent','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','code','VtigerField,\x20%s,\x20%s','message','info','result','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x292107,_0x3090bf){var _0x4b92ed=function(_0x221c55){while(--_0x221c55){_0x292107['push'](_0x292107['shift']());}};_0x4b92ed(++_0x3090bf);}(_0x2b9b,0xfc));var _0xb2b9=function(_0x3fa074,_0x268d33){_0x3fa074=_0x3fa074-0x0;var _0x530192=_0x2b9b[_0x3fa074];return _0x530192;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xb2b9('0x0'));var BPromise=require(_0xb2b9('0x1'));var rs=require(_0xb2b9('0x2'));var fs=require('fs');var Redis=require(_0xb2b9('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xb2b9('0x4'))(_0xb2b9('0x5'));var config=require(_0xb2b9('0x6'));var jayson=require(_0xb2b9('0x7'));var client=jayson['client'][_0xb2b9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4139fb,_0x3e51a0,_0x2938ab){return new BPromise(function(_0xdcecf1,_0x4baf93){return client[_0xb2b9('0x9')](_0x4139fb,_0x2938ab)[_0xb2b9('0xa')](function(_0x9f50bf){logger['info']('VtigerField,\x20%s,\x20%s',_0x3e51a0,_0xb2b9('0xb'));logger['debug'](_0xb2b9('0xc'),_0x3e51a0,_0xb2b9('0xb'),JSON[_0xb2b9('0xd')](_0x9f50bf));if(_0x9f50bf[_0xb2b9('0xe')]){if(_0x9f50bf[_0xb2b9('0xe')][_0xb2b9('0xf')]===0x1f4){logger[_0xb2b9('0xe')](_0xb2b9('0x10'),_0x3e51a0,_0x9f50bf[_0xb2b9('0xe')][_0xb2b9('0x11')]);return _0x4baf93(_0x9f50bf[_0xb2b9('0xe')][_0xb2b9('0x11')]);}logger[_0xb2b9('0xe')](_0xb2b9('0x10'),_0x3e51a0,_0x9f50bf[_0xb2b9('0xe')]['message']);return _0xdcecf1(_0x9f50bf[_0xb2b9('0xe')][_0xb2b9('0x11')]);}else{logger[_0xb2b9('0x12')](_0xb2b9('0x10'),_0x3e51a0,'request\x20sent');_0xdcecf1(_0x9f50bf[_0xb2b9('0x13')][_0xb2b9('0x11')]);}})['catch'](function(_0x2af15e){logger[_0xb2b9('0xe')](_0xb2b9('0x10'),_0x3e51a0,_0x2af15e);_0x4baf93(_0x2af15e);});});} \ No newline at end of file +var _0x4d41=['../../config/environment','jayson/promise','http','then','VtigerField,\x20%s,\x20%s','debug','VtigerField,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','info','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x47aa64,_0xfb8a07){var _0x549c7a=function(_0x266165){while(--_0x266165){_0x47aa64['push'](_0x47aa64['shift']());}};_0x549c7a(++_0xfb8a07);}(_0x4d41,0x187));var _0x14d4=function(_0x460358,_0x45d45e){_0x460358=_0x460358-0x0;var _0x2e6a60=_0x4d41[_0x460358];return _0x2e6a60;};'use strict';var _=require(_0x14d4('0x0'));var util=require(_0x14d4('0x1'));var moment=require('moment');var BPromise=require(_0x14d4('0x2'));var rs=require(_0x14d4('0x3'));var fs=require('fs');var Redis=require(_0x14d4('0x4'));var db=require(_0x14d4('0x5'))['db'];var utils=require(_0x14d4('0x6'));var logger=require(_0x14d4('0x7'))('rpc');var config=require(_0x14d4('0x8'));var jayson=require(_0x14d4('0x9'));var client=jayson['client'][_0x14d4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3f7f3f,_0x5a2552,_0x2d0cb9){return new BPromise(function(_0x37b9db,_0x3539f2){return client['request'](_0x3f7f3f,_0x2d0cb9)[_0x14d4('0xb')](function(_0x171a89){logger['info'](_0x14d4('0xc'),_0x5a2552,'request\x20sent');logger[_0x14d4('0xd')](_0x14d4('0xe'),_0x5a2552,_0x14d4('0xf'),JSON['stringify'](_0x171a89));if(_0x171a89[_0x14d4('0x10')]){if(_0x171a89[_0x14d4('0x10')]['code']===0x1f4){logger[_0x14d4('0x10')](_0x14d4('0xc'),_0x5a2552,_0x171a89['error'][_0x14d4('0x11')]);return _0x3539f2(_0x171a89[_0x14d4('0x10')][_0x14d4('0x11')]);}logger[_0x14d4('0x10')](_0x14d4('0xc'),_0x5a2552,_0x171a89[_0x14d4('0x10')][_0x14d4('0x11')]);return _0x37b9db(_0x171a89[_0x14d4('0x10')][_0x14d4('0x11')]);}else{logger[_0x14d4('0x12')](_0x14d4('0xc'),_0x5a2552,_0x14d4('0xf'));_0x37b9db(_0x171a89[_0x14d4('0x13')][_0x14d4('0x11')]);}})[_0x14d4('0x14')](function(_0x30d5fe){logger[_0x14d4('0x10')](_0x14d4('0xc'),_0x5a2552,_0x30d5fe);_0x3539f2(_0x30d5fe);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index 73feef0..ae35104 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 _0xb13e=['Router','../../components/auth/service','./intZendeskAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','update','destroy','multer','util','path','connect-timeout','express'];(function(_0xa2c510,_0x43dc47){var _0x4dcfd3=function(_0x475791){while(--_0x475791){_0xa2c510['push'](_0xa2c510['shift']());}};_0x4dcfd3(++_0x43dc47);}(_0xb13e,0xa3));var _0xeb13=function(_0x5cb9d6,_0x3c7a06){_0x5cb9d6=_0x5cb9d6-0x0;var _0x12a90f=_0xb13e[_0x5cb9d6];return _0x12a90f;};'use strict';var multer=require(_0xeb13('0x0'));var util=require(_0xeb13('0x1'));var path=require(_0xeb13('0x2'));var timeout=require(_0xeb13('0x3'));var express=require(_0xeb13('0x4'));var router=express[_0xeb13('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xeb13('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xeb13('0x7'));router[_0xeb13('0x8')]('/',auth[_0xeb13('0x9')](),controller[_0xeb13('0xa')]);router[_0xeb13('0x8')](_0xeb13('0xb'),auth[_0xeb13('0x9')](),controller[_0xeb13('0xc')]);router['get'](_0xeb13('0xd'),auth['isAuthenticated'](),controller[_0xeb13('0xe')]);router['get'](_0xeb13('0xf'),auth[_0xeb13('0x9')](),controller[_0xeb13('0x10')]);router[_0xeb13('0x11')]('/',auth[_0xeb13('0x9')](),controller[_0xeb13('0x12')]);router[_0xeb13('0x11')]('/:id/configurations',auth[_0xeb13('0x9')](),controller['addConfiguration']);router['put']('/:id',auth[_0xeb13('0x9')](),controller[_0xeb13('0x13')]);router['delete'](_0xeb13('0xb'),auth[_0xeb13('0x9')](),controller[_0xeb13('0x14')]);module['exports']=router; \ No newline at end of file +var _0x09b7=['isAuthenticated','show','/:id/configurations','/:id/fields','getFields','post','create','put','update','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','get','/:id'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x09b7,0x121));var _0x709b=function(_0x35007a,_0x58a0d4){_0x35007a=_0x35007a-0x0;var _0x574f68=_0x09b7[_0x35007a];return _0x574f68;};'use strict';var multer=require(_0x709b('0x0'));var util=require('util');var path=require(_0x709b('0x1'));var timeout=require(_0x709b('0x2'));var express=require(_0x709b('0x3'));var router=express[_0x709b('0x4')]();var fs_extra=require(_0x709b('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x709b('0x6'));var config=require(_0x709b('0x7'));var controller=require(_0x709b('0x8'));router[_0x709b('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x709b('0xa'),auth[_0x709b('0xb')](),controller[_0x709b('0xc')]);router[_0x709b('0x9')](_0x709b('0xd'),auth[_0x709b('0xb')](),controller['getConfigurations']);router['get'](_0x709b('0xe'),auth['isAuthenticated'](),controller[_0x709b('0xf')]);router[_0x709b('0x10')]('/',auth[_0x709b('0xb')](),controller[_0x709b('0x11')]);router['post'](_0x709b('0xd'),auth[_0x709b('0xb')](),controller['addConfiguration']);router[_0x709b('0x12')](_0x709b('0xa'),auth[_0x709b('0xb')](),controller[_0x709b('0x13')]);router['delete'](_0x709b('0xa'),auth[_0x709b('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index 2708003..dcaa377 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 _0xfdbd=['username','ENUM','token','password','newTab','integrationTab','sequelize','exports','STRING'];(function(_0x23c958,_0x188c34){var _0x1d9b73=function(_0x448da3){while(--_0x448da3){_0x23c958['push'](_0x23c958['shift']());}};_0x1d9b73(++_0x188c34);}(_0xfdbd,0xf0));var _0xdfdb=function(_0x323419,_0x2a6172){_0x323419=_0x323419-0x0;var _0x4c0be7=_0xfdbd[_0x323419];return _0x4c0be7;};'use strict';var Sequelize=require(_0xdfdb('0x0'));module[_0xdfdb('0x1')]={'name':{'type':Sequelize[_0xdfdb('0x2')]},'description':{'type':Sequelize[_0xdfdb('0x2')]},'username':{'type':Sequelize[_0xdfdb('0x2')],'unique':_0xdfdb('0x3')},'password':{'type':Sequelize[_0xdfdb('0x2')]},'token':{'type':Sequelize[_0xdfdb('0x2')]},'remoteUri':{'type':Sequelize[_0xdfdb('0x2')],'unique':'remoteUri'},'authType':{'type':Sequelize[_0xdfdb('0x4')]('password',_0xdfdb('0x5')),'defaultValue':_0xdfdb('0x6')},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM']('integrationTab',_0xdfdb('0x7')),'defaultValue':_0xdfdb('0x8')}}; \ No newline at end of file +var _0x1967=['integrationTab','newTab','exports','STRING','username','remoteUri','ENUM','token','password'];(function(_0x51789d,_0x20deeb){var _0x20b2f6=function(_0x5d8b85){while(--_0x5d8b85){_0x51789d['push'](_0x51789d['shift']());}};_0x20b2f6(++_0x20deeb);}(_0x1967,0x173));var _0x7196=function(_0x1ef119,_0x287c0e){_0x1ef119=_0x1ef119-0x0;var _0x428231=_0x1967[_0x1ef119];return _0x428231;};'use strict';var Sequelize=require('sequelize');module[_0x7196('0x0')]={'name':{'type':Sequelize[_0x7196('0x1')]},'description':{'type':Sequelize[_0x7196('0x1')]},'username':{'type':Sequelize[_0x7196('0x1')],'unique':_0x7196('0x2')},'password':{'type':Sequelize[_0x7196('0x1')]},'token':{'type':Sequelize[_0x7196('0x1')]},'remoteUri':{'type':Sequelize[_0x7196('0x1')],'unique':_0x7196('0x3')},'authType':{'type':Sequelize[_0x7196('0x4')]('password',_0x7196('0x5')),'defaultValue':_0x7196('0x6')},'serverUrl':{'type':Sequelize[_0x7196('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x7196('0x4')](_0x7196('0x7'),_0x7196('0x8')),'defaultValue':'integrationTab'}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index f3c708e..b854012 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 _0x7334=['params','keys','rawAttributes','includeAll','options','find','create','body','destroy','ZendeskConfiguration','pick','getConfigurations','nolimit','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','getFields','findOne','username','token','authType','remoteUri','slice','substring','GET','format','%s/%s','ticket_fields','password','headers','toString','base64','ValidationError','subject','assignee','remove','position','title','system_field_options','custom_field_options','test','statusCode','error','getFields,\x20%s,\x20%s,\x20%s','eml-format','rimraf','zip-dir','moment','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','api','../../config/environment','../../config/license/util','../../mysqldb','../../components/integrations/configuration','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','end','sendStatus','stack','index','map','fieldName','model','name','query','filters','intersection','fields','length','attributes','hasOwnProperty','order','sort','filter','where','merge','type','VIRTUAL','ZendeskAccount','include','findAll','rows','catch','show'];(function(_0x42f24c,_0x302b62){var _0x3878aa=function(_0x253a40){while(--_0x253a40){_0x42f24c['push'](_0x42f24c['shift']());}};_0x3878aa(++_0x302b62);}(_0x7334,0x184));var _0x4733=function(_0x145925,_0xe1d002){_0x145925=_0x145925-0x0;var _0x4a07e0=_0x7334[_0x145925];return _0x4a07e0;};'use strict';var emlformat=require(_0x4733('0x0'));var rimraf=require(_0x4733('0x1'));var zipdir=require(_0x4733('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x4733('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x4733('0x4'));var util=require(_0x4733('0x5'));var path=require(_0x4733('0x6'));var sox=require(_0x4733('0x7'));var csv=require(_0x4733('0x8'));var ejs=require(_0x4733('0x9'));var fs=require('fs');var fs_extra=require(_0x4733('0xa'));var _=require(_0x4733('0xb'));var squel=require(_0x4733('0xc'));var crypto=require(_0x4733('0xd'));var jsforce=require(_0x4733('0xe'));var deskjs=require(_0x4733('0xf'));var toCsv=require(_0x4733('0x8'));var querystring=require(_0x4733('0x10'));var Papa=require(_0x4733('0x11'));var Redis=require(_0x4733('0x12'));var authService=require(_0x4733('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x4733('0x14'));var hardwareService=require(_0x4733('0x15'));var logger=require('../../config/logger')(_0x4733('0x16'));var utils=require('../../config/utils');var config=require(_0x4733('0x17'));var licenseUtil=require(_0x4733('0x18'));var db=require(_0x4733('0x19'))['db'];var integrations=require(_0x4733('0x1a'));function respondWithStatusCode(_0x100ecd,_0x1c146c){_0x1c146c=_0x1c146c||0xcc;return function(_0x2c0f6b){if(_0x2c0f6b){return _0x100ecd['sendStatus'](_0x1c146c);}return _0x100ecd[_0x4733('0x1b')](_0x1c146c)['end']();};}function respondWithResult(_0x4327f3,_0x1a22e4){_0x1a22e4=_0x1a22e4||0xc8;return function(_0x2e5b1b){if(_0x2e5b1b){return _0x4327f3[_0x4733('0x1b')](_0x1a22e4)[_0x4733('0x1c')](_0x2e5b1b);}};}function respondWithFilteredResult(_0x167016,_0x12f111){return function(_0x9fff){if(_0x9fff){var _0x1920ce=typeof _0x12f111['offset']===_0x4733('0x1d')&&typeof _0x12f111[_0x4733('0x1e')]==='undefined';var _0x444824=_0x9fff[_0x4733('0x1f')];var _0x2aa223=_0x1920ce?0x0:_0x12f111[_0x4733('0x20')];var _0x579f67=_0x1920ce?_0x9fff['count']:_0x12f111[_0x4733('0x20')]+_0x12f111[_0x4733('0x1e')];var _0x50c585;if(_0x579f67>=_0x444824){_0x579f67=_0x444824;_0x50c585=0xc8;}else{_0x50c585=0xce;}_0x167016[_0x4733('0x1b')](_0x50c585);return _0x167016[_0x4733('0x21')](_0x4733('0x22'),_0x2aa223+'-'+_0x579f67+'/'+_0x444824)[_0x4733('0x1c')](_0x9fff);}return null;};}function patchUpdates(_0x493cd3){return function(_0x1232e5){try{jsonpatch[_0x4733('0x23')](_0x1232e5,_0x493cd3,!![]);}catch(_0x5d058d){return BPromise[_0x4733('0x24')](_0x5d058d);}return _0x1232e5[_0x4733('0x25')]();};}function saveUpdates(_0x478e34,_0x15a291){return function(_0x115ce4){if(_0x115ce4){return _0x115ce4[_0x4733('0x26')](_0x478e34)[_0x4733('0x27')](function(_0x3a2542){return _0x3a2542;});}return null;};}function removeEntity(_0x24db74,_0x180049){return function(_0x2bb78f){if(_0x2bb78f){return _0x2bb78f['destroy']()[_0x4733('0x27')](function(){_0x24db74[_0x4733('0x1b')](0xcc)[_0x4733('0x28')]();});}};}function handleEntityNotFound(_0x2cb247,_0x30ee9b){return function(_0x3bd683){if(!_0x3bd683){_0x2cb247[_0x4733('0x29')](0x194);}return _0x3bd683;};}function handleError(_0xc3ab0a,_0x13bc12){_0x13bc12=_0x13bc12||0x1f4;return function(_0x23fe6c){logger['error'](_0x23fe6c[_0x4733('0x2a')]);if(_0x23fe6c['name']){delete _0x23fe6c['name'];}_0xc3ab0a[_0x4733('0x1b')](_0x13bc12)['send'](_0x23fe6c);};}exports[_0x4733('0x2b')]=function(_0x479989,_0x4abc0d){var _0x517c73={},_0x2976b0={},_0x3bfe53={'count':0x0,'rows':[]};var _0x29621e=_[_0x4733('0x2c')](db['ZendeskAccount']['rawAttributes'],function(_0x50f67e){return{'name':_0x50f67e[_0x4733('0x2d')],'type':_0x50f67e['type']['key']};});_0x2976b0[_0x4733('0x2e')]=_[_0x4733('0x2c')](_0x29621e,_0x4733('0x2f'));_0x2976b0['query']=_['keys'](_0x479989[_0x4733('0x30')]);_0x2976b0[_0x4733('0x31')]=_[_0x4733('0x32')](_0x2976b0[_0x4733('0x2e')],_0x2976b0[_0x4733('0x30')]);_0x517c73['attributes']=_[_0x4733('0x32')](_0x2976b0[_0x4733('0x2e')],qs[_0x4733('0x33')](_0x479989[_0x4733('0x30')][_0x4733('0x33')]));_0x517c73['attributes']=_0x517c73['attributes'][_0x4733('0x34')]?_0x517c73[_0x4733('0x35')]:_0x2976b0[_0x4733('0x2e')];if(!_0x479989[_0x4733('0x30')][_0x4733('0x36')]('nolimit')){_0x517c73[_0x4733('0x1e')]=qs[_0x4733('0x1e')](_0x479989[_0x4733('0x30')]['limit']);_0x517c73[_0x4733('0x20')]=qs[_0x4733('0x20')](_0x479989[_0x4733('0x30')][_0x4733('0x20')]);}_0x517c73[_0x4733('0x37')]=qs[_0x4733('0x38')](_0x479989[_0x4733('0x30')][_0x4733('0x38')]);_0x517c73['where']=qs[_0x4733('0x31')](_['pick'](_0x479989[_0x4733('0x30')],_0x2976b0[_0x4733('0x31')]),_0x29621e);if(_0x479989[_0x4733('0x30')][_0x4733('0x39')]){_0x517c73[_0x4733('0x3a')]=_[_0x4733('0x3b')](_0x517c73[_0x4733('0x3a')],{'$or':_[_0x4733('0x2c')](_0x29621e,function(_0x592fc2){if(_0x592fc2[_0x4733('0x3c')]!==_0x4733('0x3d')){var _0x5e12c3={};_0x5e12c3[_0x592fc2[_0x4733('0x2f')]]={'$like':'%'+_0x479989[_0x4733('0x30')]['filter']+'%'};return _0x5e12c3;}})});}_0x517c73=_[_0x4733('0x3b')]({},_0x517c73,_0x479989['options']);var _0x43ac2d={'where':_0x517c73['where']};return db[_0x4733('0x3e')][_0x4733('0x1f')](_0x43ac2d)['then'](function(_0x515720){_0x3bfe53[_0x4733('0x1f')]=_0x515720;if(_0x479989[_0x4733('0x30')]['includeAll']){_0x517c73[_0x4733('0x3f')]=[{'all':!![]}];}return db[_0x4733('0x3e')][_0x4733('0x40')](_0x517c73);})[_0x4733('0x27')](function(_0x3ae58c){_0x3bfe53[_0x4733('0x41')]=_0x3ae58c;return _0x3bfe53;})[_0x4733('0x27')](respondWithFilteredResult(_0x4abc0d,_0x517c73))[_0x4733('0x42')](handleError(_0x4abc0d,null));};exports[_0x4733('0x43')]=function(_0x42e055,_0x444471){var _0x1d32df={'raw':![],'where':{'id':_0x42e055[_0x4733('0x44')]['id']}},_0x191c04={};_0x191c04[_0x4733('0x2e')]=_[_0x4733('0x45')](db[_0x4733('0x3e')][_0x4733('0x46')]);_0x191c04['query']=_[_0x4733('0x45')](_0x42e055[_0x4733('0x30')]);_0x191c04[_0x4733('0x31')]=_[_0x4733('0x32')](_0x191c04[_0x4733('0x2e')],_0x191c04[_0x4733('0x30')]);_0x1d32df[_0x4733('0x35')]=_[_0x4733('0x32')](_0x191c04[_0x4733('0x2e')],qs[_0x4733('0x33')](_0x42e055[_0x4733('0x30')][_0x4733('0x33')]));_0x1d32df[_0x4733('0x35')]=_0x1d32df[_0x4733('0x35')]['length']?_0x1d32df['attributes']:_0x191c04[_0x4733('0x2e')];if(_0x42e055[_0x4733('0x30')][_0x4733('0x47')]){_0x1d32df[_0x4733('0x3f')]=[{'all':!![]}];}_0x1d32df=_[_0x4733('0x3b')]({},_0x1d32df,_0x42e055[_0x4733('0x48')]);return db[_0x4733('0x3e')][_0x4733('0x49')](_0x1d32df)[_0x4733('0x27')](handleEntityNotFound(_0x444471,null))[_0x4733('0x27')](respondWithResult(_0x444471,null))['catch'](handleError(_0x444471,null));};exports['create']=function(_0x51e201,_0x521ad3){return db[_0x4733('0x3e')][_0x4733('0x4a')](_0x51e201[_0x4733('0x4b')],{})[_0x4733('0x27')](respondWithResult(_0x521ad3,0xc9))[_0x4733('0x42')](handleError(_0x521ad3,null));};exports[_0x4733('0x26')]=function(_0x1c6abf,_0x2484f4){if(_0x1c6abf[_0x4733('0x4b')]['id']){delete _0x1c6abf[_0x4733('0x4b')]['id'];}return db['ZendeskAccount']['find']({'where':{'id':_0x1c6abf[_0x4733('0x44')]['id']}})['then'](handleEntityNotFound(_0x2484f4,null))[_0x4733('0x27')](saveUpdates(_0x1c6abf[_0x4733('0x4b')],null))[_0x4733('0x27')](respondWithResult(_0x2484f4,null))['catch'](handleError(_0x2484f4,null));};exports[_0x4733('0x4c')]=function(_0x45c9ad,_0x31ae69){return db[_0x4733('0x3e')][_0x4733('0x49')]({'where':{'id':_0x45c9ad[_0x4733('0x44')]['id']}})[_0x4733('0x27')](handleEntityNotFound(_0x31ae69,null))[_0x4733('0x27')](removeEntity(_0x31ae69,null))[_0x4733('0x42')](handleError(_0x31ae69,null));};exports['getConfigurations']=function(_0x31fb69,_0xdb1561,_0x899344){var _0x491fa5={};var _0x2effd2={};var _0x130aee;var _0xafb3f8;return db[_0x4733('0x3e')]['findOne']({'where':{'id':_0x31fb69[_0x4733('0x44')]['id']}})['then'](handleEntityNotFound(_0xdb1561,null))[_0x4733('0x27')](function(_0x3b8165){if(_0x3b8165){_0x130aee=_0x3b8165;_0x2effd2[_0x4733('0x2e')]=_[_0x4733('0x45')](db[_0x4733('0x4d')]['rawAttributes']);_0x2effd2[_0x4733('0x30')]=_[_0x4733('0x45')](_0x31fb69['query']);_0x2effd2['filters']=_[_0x4733('0x32')](_0x2effd2[_0x4733('0x2e')],_0x2effd2[_0x4733('0x30')]);_0x491fa5[_0x4733('0x35')]=_[_0x4733('0x32')](_0x2effd2[_0x4733('0x2e')],qs[_0x4733('0x33')](_0x31fb69[_0x4733('0x30')]['fields']));_0x491fa5['attributes']=_0x491fa5[_0x4733('0x35')]['length']?_0x491fa5[_0x4733('0x35')]:_0x2effd2[_0x4733('0x2e')];_0x491fa5[_0x4733('0x37')]=qs['sort'](_0x31fb69['query']['sort']);_0x491fa5[_0x4733('0x3a')]=qs[_0x4733('0x31')](_[_0x4733('0x4e')](_0x31fb69['query'],_0x2effd2[_0x4733('0x31')]));if(_0x31fb69[_0x4733('0x30')][_0x4733('0x39')]){_0x491fa5[_0x4733('0x3a')]=_[_0x4733('0x3b')](_0x491fa5[_0x4733('0x3a')],{'$or':_[_0x4733('0x2c')](_0x491fa5['attributes'],function(_0x1ed9eb){var _0x2b5eec={};_0x2b5eec[_0x1ed9eb]={'$like':'%'+_0x31fb69['query']['filter']+'%'};return _0x2b5eec;})});}_0x491fa5=_[_0x4733('0x3b')]({},_0x491fa5,_0x31fb69[_0x4733('0x48')]);return _0x130aee[_0x4733('0x4f')](_0x491fa5);}})[_0x4733('0x27')](function(_0x475dad){if(_0x475dad){_0xafb3f8=_0x475dad[_0x4733('0x34')];if(!_0x31fb69[_0x4733('0x30')][_0x4733('0x36')](_0x4733('0x50'))){_0x491fa5['limit']=qs[_0x4733('0x1e')](_0x31fb69[_0x4733('0x30')][_0x4733('0x1e')]);_0x491fa5['offset']=qs[_0x4733('0x20')](_0x31fb69['query'][_0x4733('0x20')]);}return _0x130aee[_0x4733('0x4f')](_0x491fa5);}})[_0x4733('0x27')](function(_0x3696d6){if(_0x3696d6){return _0x3696d6?{'count':_0xafb3f8,'rows':_0x3696d6}:null;}})[_0x4733('0x27')](respondWithResult(_0xdb1561,null))[_0x4733('0x42')](handleError(_0xdb1561,null));};exports['addConfiguration']=function(_0x137793,_0x574787,_0x15552d){if(_0x137793[_0x4733('0x4b')]['id']){delete _0x137793['body']['id'];}return db[_0x4733('0x3e')]['findOne']({'where':{'id':_0x137793['params']['id']}})[_0x4733('0x27')](handleEntityNotFound(_0x574787,null))[_0x4733('0x27')](function(_0x1a0ebf){if(_0x1a0ebf){_0x137793[_0x4733('0x4b')][_0x4733('0x51')]=_0x1a0ebf['id'];_0x137793[_0x4733('0x4b')][_0x4733('0x52')]=integrations[_0x4733('0x53')](_0x137793[_0x4733('0x4b')]['channel'],_0x137793['body']['type']);_0x137793[_0x4733('0x4b')][_0x4733('0x54')]=integrations[_0x4733('0x55')](_0x137793[_0x4733('0x4b')]['channel'],_0x137793[_0x4733('0x4b')][_0x4733('0x3c')]);return db[_0x4733('0x4d')]['create'](_0x137793[_0x4733('0x4b')],{'include':[{'model':db['ZendeskField'],'as':_0x4733('0x52')},{'model':db['ZendeskField'],'as':'Descriptions'}]});}return null;})[_0x4733('0x27')](respondWithResult(_0x574787,null))['catch'](handleError(_0x574787,null));};exports[_0x4733('0x56')]=function(_0x523498,_0x4e835b,_0x1a7baf){var _0x5c6083='';return db['ZendeskAccount'][_0x4733('0x57')]({'where':{'id':_0x523498[_0x4733('0x44')]['id']},'attributes':['id',_0x4733('0x58'),'password',_0x4733('0x59'),_0x4733('0x5a'),_0x4733('0x5b')]})[_0x4733('0x27')](handleEntityNotFound(_0x4e835b,null))[_0x4733('0x27')](function(_0x29f4e8){if(_0x29f4e8){_0x5c6083=_0x29f4e8['remoteUri'];var _0x3c9e3b=_0x5c6083[_0x4733('0x5c')](-0x1);if(_0x3c9e3b==='/'){_0x5c6083=_0x5c6083[_0x4733('0x5d')](0x0,_0x5c6083['lastIndexOf'](_0x3c9e3b));}var _0x2c0377={'method':_0x4733('0x5e'),'uri':util[_0x4733('0x5f')](_0x4733('0x60'),_0x5c6083,_0x4733('0x61')),'json':!![]};switch(_0x29f4e8[_0x4733('0x5a')]){case _0x4733('0x62'):_0x2c0377[_0x4733('0x63')]={'Authorization':util['format']('Basic\x20%s',new Buffer(util[_0x4733('0x5f')]('%s:%s',_0x29f4e8['username'],_0x29f4e8[_0x4733('0x62')]))[_0x4733('0x64')](_0x4733('0x65')))};break;case _0x4733('0x59'):_0x2c0377['headers']={'Authorization':util[_0x4733('0x5f')]('Basic\x20%s',new Buffer(util[_0x4733('0x5f')]('%s/token:%s',_0x29f4e8['username'],_0x29f4e8[_0x4733('0x59')]))['toString']('base64'))};break;default:throw new db['Sequelize'][(_0x4733('0x66'))]('Unknown\x20authentication\x20type');}return rp(_0x2c0377);}})[_0x4733('0x27')](function(_0x2fe1d3){if(_0x2fe1d3){var _0x59cc5b=[_0x4733('0x67'),'description','group',_0x4733('0x68')];_[_0x4733('0x69')](_0x2fe1d3[_0x4733('0x61')],function(_0x5a067b){return _0x59cc5b['includes'](_0x5a067b[_0x4733('0x3c')]);});return{'count':_0x2fe1d3['ticket_fields'][_0x4733('0x34')],'rows':_[_0x4733('0x2c')](_0x2fe1d3[_0x4733('0x61')],function(_0x42657b){return{'id':_0x42657b['id'],'name':_0x42657b[_0x4733('0x6a')]>0x7?_0x42657b[_0x4733('0x6b')]:_0x42657b['type'],'custom':_0x42657b[_0x4733('0x6a')]>0x7?!![]:![],'options':_0x42657b[_0x4733('0x6c')]?_0x42657b[_0x4733('0x6c')]:_0x42657b[_0x4733('0x6d')]?_0x42657b['custom_field_options']:[]};})};}})['then'](respondWithResult(_0x4e835b,null))[_0x4733('0x42')](function(_0x4d87c1){var _0x131595=_0x523498[_0x4733('0x30')][_0x4733('0x6e')]?0x1f4:_0x4d87c1[_0x4733('0x6f')]||0x1f4;logger[_0x4733('0x70')](_0x4733('0x71'),_0x4733('0x56'),_0x131595,JSON['stringify'](_0x4d87c1));delete _0x4d87c1[_0x4733('0x2f')];if(_0x131595===0x191){_0x131595=0x190;}_0x4e835b[_0x4733('0x1b')](_0x131595)['send'](_0x523498['query'][_0x4733('0x6e')]?{'message':'Wrong\x20credentials','statusCode':_0x4d87c1[_0x4733('0x6f')]}:_0x4d87c1);});}; \ No newline at end of file +var _0x0565=['eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','ZendeskAccount','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','findAll','rows','catch','show','params','include','find','create','body','getConfigurations','ZendeskConfiguration','pick','addConfiguration','findOne','AccountId','getSubjects','channel','Descriptions','getDescriptions','ZendeskField','Subjects','getFields','token','authType','remoteUri','slice','substring','lastIndexOf','format','ticket_fields','headers','Basic\x20%s','%s:%s','username','password','toString','base64','Sequelize','ValidationError','Unknown\x20authentication\x20type','subject','description','group','assignee','remove','position','system_field_options','custom_field_options','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','test','Wrong\x20credentials'];(function(_0x31fa71,_0x4bc616){var _0x482ebe=function(_0x59fc66){while(--_0x59fc66){_0x31fa71['push'](_0x31fa71['shift']());}};_0x482ebe(++_0x4bc616);}(_0x0565,0xf2));var _0x5056=function(_0x31a371,_0x50828e){_0x31a371=_0x31a371-0x0;var _0x2a5bd6=_0x0565[_0x31a371];return _0x2a5bd6;};'use strict';var emlformat=require(_0x5056('0x0'));var rimraf=require(_0x5056('0x1'));var zipdir=require(_0x5056('0x2'));var jsonpatch=require(_0x5056('0x3'));var rp=require(_0x5056('0x4'));var moment=require(_0x5056('0x5'));var BPromise=require(_0x5056('0x6'));var Mustache=require(_0x5056('0x7'));var util=require(_0x5056('0x8'));var path=require(_0x5056('0x9'));var sox=require('sox');var csv=require(_0x5056('0xa'));var ejs=require(_0x5056('0xb'));var fs=require('fs');var fs_extra=require(_0x5056('0xc'));var _=require(_0x5056('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x5056('0xe'));var deskjs=require(_0x5056('0xf'));var toCsv=require(_0x5056('0xa'));var querystring=require(_0x5056('0x10'));var Papa=require(_0x5056('0x11'));var Redis=require(_0x5056('0x12'));var authService=require(_0x5056('0x13'));var qs=require(_0x5056('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5056('0x15'));var logger=require(_0x5056('0x16'))(_0x5056('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5056('0x18'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');function respondWithStatusCode(_0x53e98a,_0x2d44fb){_0x2d44fb=_0x2d44fb||0xcc;return function(_0x4b183a){if(_0x4b183a){return _0x53e98a[_0x5056('0x19')](_0x2d44fb);}return _0x53e98a[_0x5056('0x1a')](_0x2d44fb)[_0x5056('0x1b')]();};}function respondWithResult(_0x543cee,_0x1e8b64){_0x1e8b64=_0x1e8b64||0xc8;return function(_0x29d05f){if(_0x29d05f){return _0x543cee[_0x5056('0x1a')](_0x1e8b64)[_0x5056('0x1c')](_0x29d05f);}};}function respondWithFilteredResult(_0x21561d,_0x6a044a){return function(_0x4ac332){if(_0x4ac332){var _0x2b7a17=typeof _0x6a044a['offset']===_0x5056('0x1d')&&typeof _0x6a044a[_0x5056('0x1e')]===_0x5056('0x1d');var _0x1f2ac6=_0x4ac332[_0x5056('0x1f')];var _0x51b21e=_0x2b7a17?0x0:_0x6a044a[_0x5056('0x20')];var _0x56537e=_0x2b7a17?_0x4ac332['count']:_0x6a044a['offset']+_0x6a044a[_0x5056('0x1e')];var _0x517bf3;if(_0x56537e>=_0x1f2ac6){_0x56537e=_0x1f2ac6;_0x517bf3=0xc8;}else{_0x517bf3=0xce;}_0x21561d[_0x5056('0x1a')](_0x517bf3);return _0x21561d[_0x5056('0x21')](_0x5056('0x22'),_0x51b21e+'-'+_0x56537e+'/'+_0x1f2ac6)[_0x5056('0x1c')](_0x4ac332);}return null;};}function patchUpdates(_0x33035c){return function(_0x4835fd){try{jsonpatch[_0x5056('0x23')](_0x4835fd,_0x33035c,!![]);}catch(_0x3cfd41){return BPromise['reject'](_0x3cfd41);}return _0x4835fd[_0x5056('0x24')]();};}function saveUpdates(_0x1bccef,_0x2564d0){return function(_0x58b16d){if(_0x58b16d){return _0x58b16d[_0x5056('0x25')](_0x1bccef)[_0x5056('0x26')](function(_0x5afbfe){return _0x5afbfe;});}return null;};}function removeEntity(_0x4a64be,_0x29e166){return function(_0x2f36a3){if(_0x2f36a3){return _0x2f36a3[_0x5056('0x27')]()[_0x5056('0x26')](function(){_0x4a64be['status'](0xcc)[_0x5056('0x1b')]();});}};}function handleEntityNotFound(_0x25409f,_0x5d1656){return function(_0x2c4290){if(!_0x2c4290){_0x25409f['sendStatus'](0x194);}return _0x2c4290;};}function handleError(_0x15f03f,_0x39d539){_0x39d539=_0x39d539||0x1f4;return function(_0x1106e5){logger[_0x5056('0x28')](_0x1106e5[_0x5056('0x29')]);if(_0x1106e5['name']){delete _0x1106e5[_0x5056('0x2a')];}_0x15f03f[_0x5056('0x1a')](_0x39d539)[_0x5056('0x2b')](_0x1106e5);};}exports[_0x5056('0x2c')]=function(_0x53e6db,_0x24d33e){var _0x5b0270={},_0x70246c={},_0x49fe67={'count':0x0,'rows':[]};var _0x56ccba=_['map'](db[_0x5056('0x2d')][_0x5056('0x2e')],function(_0x482939){return{'name':_0x482939[_0x5056('0x2f')],'type':_0x482939[_0x5056('0x30')][_0x5056('0x31')]};});_0x70246c[_0x5056('0x32')]=_[_0x5056('0x33')](_0x56ccba,_0x5056('0x2a'));_0x70246c[_0x5056('0x34')]=_[_0x5056('0x35')](_0x53e6db[_0x5056('0x34')]);_0x70246c[_0x5056('0x36')]=_[_0x5056('0x37')](_0x70246c['model'],_0x70246c['query']);_0x5b0270[_0x5056('0x38')]=_[_0x5056('0x37')](_0x70246c['model'],qs[_0x5056('0x39')](_0x53e6db[_0x5056('0x34')]['fields']));_0x5b0270[_0x5056('0x38')]=_0x5b0270[_0x5056('0x38')][_0x5056('0x3a')]?_0x5b0270[_0x5056('0x38')]:_0x70246c[_0x5056('0x32')];if(!_0x53e6db[_0x5056('0x34')][_0x5056('0x3b')](_0x5056('0x3c'))){_0x5b0270[_0x5056('0x1e')]=qs[_0x5056('0x1e')](_0x53e6db[_0x5056('0x34')][_0x5056('0x1e')]);_0x5b0270[_0x5056('0x20')]=qs[_0x5056('0x20')](_0x53e6db[_0x5056('0x34')]['offset']);}_0x5b0270[_0x5056('0x3d')]=qs['sort'](_0x53e6db[_0x5056('0x34')][_0x5056('0x3e')]);_0x5b0270[_0x5056('0x3f')]=qs[_0x5056('0x36')](_['pick'](_0x53e6db[_0x5056('0x34')],_0x70246c[_0x5056('0x36')]),_0x56ccba);if(_0x53e6db['query'][_0x5056('0x40')]){_0x5b0270['where']=_[_0x5056('0x41')](_0x5b0270[_0x5056('0x3f')],{'$or':_[_0x5056('0x33')](_0x56ccba,function(_0x502732){if(_0x502732[_0x5056('0x30')]!==_0x5056('0x42')){var _0x308133={};_0x308133[_0x502732[_0x5056('0x2a')]]={'$like':'%'+_0x53e6db[_0x5056('0x34')][_0x5056('0x40')]+'%'};return _0x308133;}})});}_0x5b0270=_[_0x5056('0x41')]({},_0x5b0270,_0x53e6db[_0x5056('0x43')]);var _0x15553e={'where':_0x5b0270[_0x5056('0x3f')]};return db[_0x5056('0x2d')][_0x5056('0x1f')](_0x15553e)[_0x5056('0x26')](function(_0x1e28f4){_0x49fe67[_0x5056('0x1f')]=_0x1e28f4;if(_0x53e6db[_0x5056('0x34')]['includeAll']){_0x5b0270['include']=[{'all':!![]}];}return db[_0x5056('0x2d')][_0x5056('0x44')](_0x5b0270);})[_0x5056('0x26')](function(_0x3a76d2){_0x49fe67[_0x5056('0x45')]=_0x3a76d2;return _0x49fe67;})[_0x5056('0x26')](respondWithFilteredResult(_0x24d33e,_0x5b0270))[_0x5056('0x46')](handleError(_0x24d33e,null));};exports[_0x5056('0x47')]=function(_0x48ab5e,_0x58f12f){var _0x68a385={'raw':![],'where':{'id':_0x48ab5e[_0x5056('0x48')]['id']}},_0x1b3a5e={};_0x1b3a5e['model']=_[_0x5056('0x35')](db['ZendeskAccount'][_0x5056('0x2e')]);_0x1b3a5e[_0x5056('0x34')]=_[_0x5056('0x35')](_0x48ab5e[_0x5056('0x34')]);_0x1b3a5e[_0x5056('0x36')]=_[_0x5056('0x37')](_0x1b3a5e['model'],_0x1b3a5e[_0x5056('0x34')]);_0x68a385[_0x5056('0x38')]=_[_0x5056('0x37')](_0x1b3a5e['model'],qs['fields'](_0x48ab5e['query']['fields']));_0x68a385[_0x5056('0x38')]=_0x68a385[_0x5056('0x38')][_0x5056('0x3a')]?_0x68a385[_0x5056('0x38')]:_0x1b3a5e[_0x5056('0x32')];if(_0x48ab5e['query']['includeAll']){_0x68a385[_0x5056('0x49')]=[{'all':!![]}];}_0x68a385=_[_0x5056('0x41')]({},_0x68a385,_0x48ab5e[_0x5056('0x43')]);return db[_0x5056('0x2d')][_0x5056('0x4a')](_0x68a385)[_0x5056('0x26')](handleEntityNotFound(_0x58f12f,null))[_0x5056('0x26')](respondWithResult(_0x58f12f,null))['catch'](handleError(_0x58f12f,null));};exports['create']=function(_0x14e3f5,_0x3c2988){return db['ZendeskAccount'][_0x5056('0x4b')](_0x14e3f5[_0x5056('0x4c')],{})['then'](respondWithResult(_0x3c2988,0xc9))['catch'](handleError(_0x3c2988,null));};exports[_0x5056('0x25')]=function(_0x1ab1a9,_0x50aa03){if(_0x1ab1a9['body']['id']){delete _0x1ab1a9[_0x5056('0x4c')]['id'];}return db[_0x5056('0x2d')]['find']({'where':{'id':_0x1ab1a9['params']['id']}})[_0x5056('0x26')](handleEntityNotFound(_0x50aa03,null))[_0x5056('0x26')](saveUpdates(_0x1ab1a9[_0x5056('0x4c')],null))[_0x5056('0x26')](respondWithResult(_0x50aa03,null))[_0x5056('0x46')](handleError(_0x50aa03,null));};exports[_0x5056('0x27')]=function(_0x97f7d8,_0x366ba2){return db[_0x5056('0x2d')][_0x5056('0x4a')]({'where':{'id':_0x97f7d8[_0x5056('0x48')]['id']}})[_0x5056('0x26')](handleEntityNotFound(_0x366ba2,null))[_0x5056('0x26')](removeEntity(_0x366ba2,null))[_0x5056('0x46')](handleError(_0x366ba2,null));};exports[_0x5056('0x4d')]=function(_0x4bf758,_0x5c1c29,_0x5bf887){var _0xb1fd25={};var _0x428701={};var _0x1c84b1;var _0x35776b;return db[_0x5056('0x2d')]['findOne']({'where':{'id':_0x4bf758[_0x5056('0x48')]['id']}})[_0x5056('0x26')](handleEntityNotFound(_0x5c1c29,null))[_0x5056('0x26')](function(_0x3d22cc){if(_0x3d22cc){_0x1c84b1=_0x3d22cc;_0x428701[_0x5056('0x32')]=_[_0x5056('0x35')](db[_0x5056('0x4e')][_0x5056('0x2e')]);_0x428701[_0x5056('0x34')]=_[_0x5056('0x35')](_0x4bf758[_0x5056('0x34')]);_0x428701[_0x5056('0x36')]=_[_0x5056('0x37')](_0x428701['model'],_0x428701[_0x5056('0x34')]);_0xb1fd25[_0x5056('0x38')]=_[_0x5056('0x37')](_0x428701['model'],qs[_0x5056('0x39')](_0x4bf758[_0x5056('0x34')][_0x5056('0x39')]));_0xb1fd25[_0x5056('0x38')]=_0xb1fd25['attributes']['length']?_0xb1fd25['attributes']:_0x428701[_0x5056('0x32')];_0xb1fd25['order']=qs[_0x5056('0x3e')](_0x4bf758[_0x5056('0x34')][_0x5056('0x3e')]);_0xb1fd25[_0x5056('0x3f')]=qs[_0x5056('0x36')](_[_0x5056('0x4f')](_0x4bf758['query'],_0x428701['filters']));if(_0x4bf758[_0x5056('0x34')][_0x5056('0x40')]){_0xb1fd25['where']=_[_0x5056('0x41')](_0xb1fd25[_0x5056('0x3f')],{'$or':_[_0x5056('0x33')](_0xb1fd25[_0x5056('0x38')],function(_0x44b75e){var _0x524308={};_0x524308[_0x44b75e]={'$like':'%'+_0x4bf758[_0x5056('0x34')][_0x5056('0x40')]+'%'};return _0x524308;})});}_0xb1fd25=_['merge']({},_0xb1fd25,_0x4bf758[_0x5056('0x43')]);return _0x1c84b1[_0x5056('0x4d')](_0xb1fd25);}})[_0x5056('0x26')](function(_0x1d59ac){if(_0x1d59ac){_0x35776b=_0x1d59ac[_0x5056('0x3a')];if(!_0x4bf758[_0x5056('0x34')][_0x5056('0x3b')](_0x5056('0x3c'))){_0xb1fd25[_0x5056('0x1e')]=qs[_0x5056('0x1e')](_0x4bf758[_0x5056('0x34')][_0x5056('0x1e')]);_0xb1fd25[_0x5056('0x20')]=qs['offset'](_0x4bf758[_0x5056('0x34')][_0x5056('0x20')]);}return _0x1c84b1[_0x5056('0x4d')](_0xb1fd25);}})[_0x5056('0x26')](function(_0x267ba4){if(_0x267ba4){return _0x267ba4?{'count':_0x35776b,'rows':_0x267ba4}:null;}})[_0x5056('0x26')](respondWithResult(_0x5c1c29,null))['catch'](handleError(_0x5c1c29,null));};exports[_0x5056('0x50')]=function(_0x4e343e,_0x1c3684,_0x277939){if(_0x4e343e['body']['id']){delete _0x4e343e['body']['id'];}return db[_0x5056('0x2d')][_0x5056('0x51')]({'where':{'id':_0x4e343e[_0x5056('0x48')]['id']}})[_0x5056('0x26')](handleEntityNotFound(_0x1c3684,null))['then'](function(_0x521384){if(_0x521384){_0x4e343e[_0x5056('0x4c')][_0x5056('0x52')]=_0x521384['id'];_0x4e343e[_0x5056('0x4c')]['Subjects']=integrations[_0x5056('0x53')](_0x4e343e['body'][_0x5056('0x54')],_0x4e343e[_0x5056('0x4c')][_0x5056('0x30')]);_0x4e343e['body'][_0x5056('0x55')]=integrations[_0x5056('0x56')](_0x4e343e[_0x5056('0x4c')][_0x5056('0x54')],_0x4e343e[_0x5056('0x4c')][_0x5056('0x30')]);return db[_0x5056('0x4e')]['create'](_0x4e343e[_0x5056('0x4c')],{'include':[{'model':db[_0x5056('0x57')],'as':_0x5056('0x58')},{'model':db['ZendeskField'],'as':_0x5056('0x55')}]});}return null;})['then'](respondWithResult(_0x1c3684,null))[_0x5056('0x46')](handleError(_0x1c3684,null));};exports[_0x5056('0x59')]=function(_0x3c7d5c,_0x45eac9,_0x5639a1){var _0x2a856c='';return db[_0x5056('0x2d')]['findOne']({'where':{'id':_0x3c7d5c[_0x5056('0x48')]['id']},'attributes':['id','username','password',_0x5056('0x5a'),_0x5056('0x5b'),_0x5056('0x5c')]})[_0x5056('0x26')](handleEntityNotFound(_0x45eac9,null))[_0x5056('0x26')](function(_0x88270d){if(_0x88270d){_0x2a856c=_0x88270d[_0x5056('0x5c')];var _0x3aa15f=_0x2a856c[_0x5056('0x5d')](-0x1);if(_0x3aa15f==='/'){_0x2a856c=_0x2a856c[_0x5056('0x5e')](0x0,_0x2a856c[_0x5056('0x5f')](_0x3aa15f));}var _0x153143={'method':'GET','uri':util[_0x5056('0x60')]('%s/%s',_0x2a856c,_0x5056('0x61')),'json':!![]};switch(_0x88270d[_0x5056('0x5b')]){case'password':_0x153143[_0x5056('0x62')]={'Authorization':util[_0x5056('0x60')](_0x5056('0x63'),new Buffer(util[_0x5056('0x60')](_0x5056('0x64'),_0x88270d[_0x5056('0x65')],_0x88270d[_0x5056('0x66')]))[_0x5056('0x67')]('base64'))};break;case _0x5056('0x5a'):_0x153143[_0x5056('0x62')]={'Authorization':util[_0x5056('0x60')](_0x5056('0x63'),new Buffer(util[_0x5056('0x60')]('%s/token:%s',_0x88270d[_0x5056('0x65')],_0x88270d['token']))[_0x5056('0x67')](_0x5056('0x68')))};break;default:throw new db[(_0x5056('0x69'))][(_0x5056('0x6a'))](_0x5056('0x6b'));}return rp(_0x153143);}})[_0x5056('0x26')](function(_0x2be789){if(_0x2be789){var _0x5f41de=[_0x5056('0x6c'),_0x5056('0x6d'),_0x5056('0x6e'),_0x5056('0x6f')];_[_0x5056('0x70')](_0x2be789[_0x5056('0x61')],function(_0x3f34b6){return _0x5f41de['includes'](_0x3f34b6['type']);});return{'count':_0x2be789['ticket_fields'][_0x5056('0x3a')],'rows':_['map'](_0x2be789[_0x5056('0x61')],function(_0x43d241){return{'id':_0x43d241['id'],'name':_0x43d241[_0x5056('0x71')]>0x7?_0x43d241['title']:_0x43d241[_0x5056('0x30')],'custom':_0x43d241['position']>0x7?!![]:![],'options':_0x43d241[_0x5056('0x72')]?_0x43d241[_0x5056('0x72')]:_0x43d241[_0x5056('0x73')]?_0x43d241['custom_field_options']:[]};})};}})[_0x5056('0x26')](respondWithResult(_0x45eac9,null))['catch'](function(_0x54b0ba){var _0x2ed978=_0x3c7d5c[_0x5056('0x34')]['test']?0x1f4:_0x54b0ba[_0x5056('0x74')]||0x1f4;logger['error'](_0x5056('0x75'),_0x5056('0x59'),_0x2ed978,JSON[_0x5056('0x76')](_0x54b0ba));delete _0x54b0ba[_0x5056('0x2a')];if(_0x2ed978===0x191){_0x2ed978=0x190;}_0x45eac9[_0x5056('0x1a')](_0x2ed978)[_0x5056('0x2b')](_0x3c7d5c['query'][_0x5056('0x77')]?{'message':_0x5056('0x78'),'statusCode':_0x54b0ba[_0x5056('0x74')]}:_0x54b0ba);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index 2518633..733076b 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 _0x897e=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','../../components/integrations/configuration','exports','ZendeskAccount','int_zendesk_accounts','util'];(function(_0x34a66e,_0x559c33){var _0x33b6dc=function(_0x68b865){while(--_0x68b865){_0x34a66e['push'](_0x34a66e['shift']());}};_0x33b6dc(++_0x559c33);}(_0x897e,0xb3));var _0xe897=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0x897e[_0x1928c9];return _0x51b5fb;};'use strict';var _=require('lodash');var util=require(_0xe897('0x0'));var logger=require(_0xe897('0x1'))(_0xe897('0x2'));var moment=require(_0xe897('0x3'));var BPromise=require(_0xe897('0x4'));var rp=require(_0xe897('0x5'));var fs=require('fs');var path=require(_0xe897('0x6'));var rimraf=require('rimraf');var config=require(_0xe897('0x7'));var attributes=require('./intZendeskAccount.attributes');var integrations=require(_0xe897('0x8'));module[_0xe897('0x9')]=function(_0xf63c9d,_0x660b13){return _0xf63c9d['define'](_0xe897('0xa'),attributes,{'tableName':_0xe897('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x97ba=['request-promise','rimraf','../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration','exports','define','ZendeskAccount','util','../../config/logger','api','moment','bluebird'];(function(_0xd4c1f8,_0x3c4879){var _0x208a21=function(_0x1a63ec){while(--_0x1a63ec){_0xd4c1f8['push'](_0xd4c1f8['shift']());}};_0x208a21(++_0x3c4879);}(_0x97ba,0x1b5));var _0xa97b=function(_0x3f5f14,_0x492bf4){_0x3f5f14=_0x3f5f14-0x0;var _0x76babd=_0x97ba[_0x3f5f14];return _0x76babd;};'use strict';var _=require('lodash');var util=require(_0xa97b('0x0'));var logger=require(_0xa97b('0x1'))(_0xa97b('0x2'));var moment=require(_0xa97b('0x3'));var BPromise=require(_0xa97b('0x4'));var rp=require(_0xa97b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa97b('0x6'));var config=require(_0xa97b('0x7'));var attributes=require(_0xa97b('0x8'));var integrations=require(_0xa97b('0x9'));module[_0xa97b('0xa')]=function(_0x4d8321,_0x3b63fc){return _0x4d8321[_0xa97b('0xb')](_0xa97b('0xc'),attributes,{'tableName':'int_zendesk_accounts','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 5f39ca1..4a616b5 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 _0xe963=['stringify','code','error','message','GetZendeskAccount','ZendeskAccount','options','raw','where','include','map','model','attributes','then','info','catch','ShowZendeskAccount','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s'];(function(_0x41b8b9,_0x42585c){var _0x1120f5=function(_0x542879){while(--_0x542879){_0x41b8b9['push'](_0x41b8b9['shift']());}};_0x1120f5(++_0x42585c);}(_0xe963,0x99));var _0x3e96=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe963[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x3e96('0x0'));var util=require(_0x3e96('0x1'));var moment=require('moment');var BPromise=require(_0x3e96('0x2'));var rs=require(_0x3e96('0x3'));var fs=require('fs');var Redis=require(_0x3e96('0x4'));var db=require(_0x3e96('0x5'))['db'];var utils=require(_0x3e96('0x6'));var logger=require(_0x3e96('0x7'))(_0x3e96('0x8'));var config=require(_0x3e96('0x9'));var jayson=require(_0x3e96('0xa'));var client=jayson[_0x3e96('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x83f314,_0x454573,_0x4a313e){return new BPromise(function(_0x4ab9d1,_0x58322b){return client[_0x3e96('0xc')](_0x83f314,_0x4a313e)['then'](function(_0x409e6c){logger['info'](_0x3e96('0xd'),_0x454573,_0x3e96('0xe'));logger[_0x3e96('0xf')](_0x3e96('0x10'),_0x454573,_0x3e96('0xe'),JSON[_0x3e96('0x11')](_0x409e6c));if(_0x409e6c['error']){if(_0x409e6c['error'][_0x3e96('0x12')]===0x1f4){logger[_0x3e96('0x13')](_0x3e96('0xd'),_0x454573,_0x409e6c[_0x3e96('0x13')][_0x3e96('0x14')]);return _0x58322b(_0x409e6c[_0x3e96('0x13')]['message']);}logger[_0x3e96('0x13')](_0x3e96('0xd'),_0x454573,_0x409e6c[_0x3e96('0x13')][_0x3e96('0x14')]);return _0x4ab9d1(_0x409e6c['error'][_0x3e96('0x14')]);}else{logger['info'](_0x3e96('0xd'),_0x454573,_0x3e96('0xe'));_0x4ab9d1(_0x409e6c['result'][_0x3e96('0x14')]);}})['catch'](function(_0x3e86f9){logger[_0x3e96('0x13')]('ZendeskAccount,\x20%s,\x20%s',_0x454573,_0x3e86f9);_0x58322b(_0x3e86f9);});});}exports[_0x3e96('0x15')]=function(_0x3e2167){var _0xef1571=this;return new Promise(function(_0x4ebe1a,_0x3a2e05){return db[_0x3e96('0x16')]['findAll']({'raw':_0x3e2167[_0x3e96('0x17')]?_0x3e2167[_0x3e96('0x17')][_0x3e96('0x18')]===undefined?!![]:![]:!![],'where':_0x3e2167['options']?_0x3e2167['options'][_0x3e96('0x19')]||null:null,'attributes':_0x3e2167[_0x3e96('0x17')]?_0x3e2167[_0x3e96('0x17')]['attributes']||null:null,'limit':_0x3e2167[_0x3e96('0x17')]?_0x3e2167[_0x3e96('0x17')]['limit']||null:null,'include':_0x3e2167[_0x3e96('0x17')]?_0x3e2167['options'][_0x3e96('0x1a')]?_[_0x3e96('0x1b')](_0x3e2167[_0x3e96('0x17')][_0x3e96('0x1a')],function(_0x37b375){return{'model':db[_0x37b375[_0x3e96('0x1c')]],'as':_0x37b375['as'],'attributes':_0x37b375[_0x3e96('0x1d')],'include':_0x37b375['include']?_[_0x3e96('0x1b')](_0x37b375[_0x3e96('0x1a')],function(_0x5de7e3){return{'model':db[_0x5de7e3['model']],'as':_0x5de7e3['as'],'attributes':_0x5de7e3[_0x3e96('0x1d')],'include':_0x5de7e3[_0x3e96('0x1a')]?_[_0x3e96('0x1b')](_0x5de7e3[_0x3e96('0x1a')],function(_0x80dcbe){return{'model':db[_0x80dcbe[_0x3e96('0x1c')]],'as':_0x80dcbe['as'],'attributes':_0x80dcbe[_0x3e96('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x3e96('0x1e')](function(_0x7cf888){logger[_0x3e96('0x1f')](_0x3e96('0x15'),_0x3e2167);logger[_0x3e96('0xf')]('GetZendeskAccount',_0x3e2167,JSON['stringify'](_0x7cf888));_0x4ebe1a(_0x7cf888);})[_0x3e96('0x20')](function(_0x1129ca){logger['error']('GetZendeskAccount',_0x1129ca[_0x3e96('0x14')],_0x3e2167);_0x3a2e05(_0xef1571[_0x3e96('0x13')](0x1f4,_0x1129ca['message']));});});};exports[_0x3e96('0x21')]=function(_0x38301d){var _0x3d2f90=this;return new Promise(function(_0x5d3ba1,_0x358e5a){return db['ZendeskAccount']['find']({'raw':_0x38301d['options']?_0x38301d[_0x3e96('0x17')][_0x3e96('0x18')]===undefined?!![]:![]:!![],'where':_0x38301d[_0x3e96('0x17')]?_0x38301d[_0x3e96('0x17')][_0x3e96('0x19')]||null:null,'attributes':_0x38301d[_0x3e96('0x17')]?_0x38301d[_0x3e96('0x17')][_0x3e96('0x1d')]||null:null,'include':_0x38301d[_0x3e96('0x17')]?_0x38301d[_0x3e96('0x17')]['include']?_[_0x3e96('0x1b')](_0x38301d[_0x3e96('0x17')][_0x3e96('0x1a')],function(_0x27c11d){return{'model':db[_0x27c11d[_0x3e96('0x1c')]],'as':_0x27c11d['as'],'attributes':_0x27c11d[_0x3e96('0x1d')],'include':_0x27c11d[_0x3e96('0x1a')]?_[_0x3e96('0x1b')](_0x27c11d[_0x3e96('0x1a')],function(_0xe969ca){return{'model':db[_0xe969ca[_0x3e96('0x1c')]],'as':_0xe969ca['as'],'attributes':_0xe969ca[_0x3e96('0x1d')],'include':_0xe969ca[_0x3e96('0x1a')]?_[_0x3e96('0x1b')](_0xe969ca[_0x3e96('0x1a')],function(_0x42f86c){return{'model':db[_0x42f86c[_0x3e96('0x1c')]],'as':_0x42f86c['as'],'attributes':_0x42f86c[_0x3e96('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x3e96('0x1e')](function(_0x954df5){logger['info'](_0x3e96('0x21'),_0x38301d);logger[_0x3e96('0xf')](_0x3e96('0x21'),_0x38301d,JSON[_0x3e96('0x11')](_0x954df5));_0x5d3ba1(_0x954df5);})[_0x3e96('0x20')](function(_0x5e6ff5){logger['error']('ShowZendeskAccount',_0x5e6ff5[_0x3e96('0x14')],_0x38301d);_0x358e5a(_0x3d2f90['error'](0x1f4,_0x5e6ff5['message']));});});}; \ No newline at end of file +var _0x7adb=['request','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetZendeskAccount','findAll','options','raw','where','limit','include','map','model','attributes','catch','ShowZendeskAccount','ZendeskAccount','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','http'];(function(_0x242a30,_0x52fc75){var _0x426293=function(_0x37ecd7){while(--_0x37ecd7){_0x242a30['push'](_0x242a30['shift']());}};_0x426293(++_0x52fc75);}(_0x7adb,0x7f));var _0xb7ad=function(_0x468461,_0x321018){_0x468461=_0x468461-0x0;var _0x44a0a5=_0x7adb[_0x468461];return _0x44a0a5;};'use strict';var _=require('lodash');var util=require(_0xb7ad('0x0'));var moment=require(_0xb7ad('0x1'));var BPromise=require('bluebird');var rs=require(_0xb7ad('0x2'));var fs=require('fs');var Redis=require(_0xb7ad('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xb7ad('0x4'));var logger=require(_0xb7ad('0x5'))(_0xb7ad('0x6'));var config=require('../../config/environment');var jayson=require(_0xb7ad('0x7'));var client=jayson['client'][_0xb7ad('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5ad4a5,_0x5057cb,_0x40ea6e){return new BPromise(function(_0x59c3c4,_0x30dad8){return client[_0xb7ad('0x9')](_0x5ad4a5,_0x40ea6e)[_0xb7ad('0xa')](function(_0x4238e1){logger[_0xb7ad('0xb')](_0xb7ad('0xc'),_0x5057cb,_0xb7ad('0xd'));logger[_0xb7ad('0xe')](_0xb7ad('0xf'),_0x5057cb,_0xb7ad('0xd'),JSON[_0xb7ad('0x10')](_0x4238e1));if(_0x4238e1['error']){if(_0x4238e1[_0xb7ad('0x11')][_0xb7ad('0x12')]===0x1f4){logger[_0xb7ad('0x11')]('ZendeskAccount,\x20%s,\x20%s',_0x5057cb,_0x4238e1[_0xb7ad('0x11')][_0xb7ad('0x13')]);return _0x30dad8(_0x4238e1[_0xb7ad('0x11')]['message']);}logger['error'](_0xb7ad('0xc'),_0x5057cb,_0x4238e1['error'][_0xb7ad('0x13')]);return _0x59c3c4(_0x4238e1[_0xb7ad('0x11')][_0xb7ad('0x13')]);}else{logger[_0xb7ad('0xb')]('ZendeskAccount,\x20%s,\x20%s',_0x5057cb,'request\x20sent');_0x59c3c4(_0x4238e1[_0xb7ad('0x14')][_0xb7ad('0x13')]);}})['catch'](function(_0x1a017b){logger[_0xb7ad('0x11')]('ZendeskAccount,\x20%s,\x20%s',_0x5057cb,_0x1a017b);_0x30dad8(_0x1a017b);});});}exports[_0xb7ad('0x15')]=function(_0x2c96da){var _0x394bce=this;return new Promise(function(_0x270b27,_0x41d758){return db['ZendeskAccount'][_0xb7ad('0x16')]({'raw':_0x2c96da[_0xb7ad('0x17')]?_0x2c96da[_0xb7ad('0x17')][_0xb7ad('0x18')]===undefined?!![]:![]:!![],'where':_0x2c96da[_0xb7ad('0x17')]?_0x2c96da[_0xb7ad('0x17')][_0xb7ad('0x19')]||null:null,'attributes':_0x2c96da[_0xb7ad('0x17')]?_0x2c96da[_0xb7ad('0x17')]['attributes']||null:null,'limit':_0x2c96da[_0xb7ad('0x17')]?_0x2c96da[_0xb7ad('0x17')][_0xb7ad('0x1a')]||null:null,'include':_0x2c96da[_0xb7ad('0x17')]?_0x2c96da[_0xb7ad('0x17')][_0xb7ad('0x1b')]?_[_0xb7ad('0x1c')](_0x2c96da['options'][_0xb7ad('0x1b')],function(_0x20f740){return{'model':db[_0x20f740[_0xb7ad('0x1d')]],'as':_0x20f740['as'],'attributes':_0x20f740['attributes'],'include':_0x20f740[_0xb7ad('0x1b')]?_[_0xb7ad('0x1c')](_0x20f740['include'],function(_0xecf9cf){return{'model':db[_0xecf9cf[_0xb7ad('0x1d')]],'as':_0xecf9cf['as'],'attributes':_0xecf9cf[_0xb7ad('0x1e')],'include':_0xecf9cf[_0xb7ad('0x1b')]?_['map'](_0xecf9cf[_0xb7ad('0x1b')],function(_0x3108b9){return{'model':db[_0x3108b9[_0xb7ad('0x1d')]],'as':_0x3108b9['as'],'attributes':_0x3108b9[_0xb7ad('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xb7ad('0xa')](function(_0x4576d0){logger['info'](_0xb7ad('0x15'),_0x2c96da);logger[_0xb7ad('0xe')](_0xb7ad('0x15'),_0x2c96da,JSON[_0xb7ad('0x10')](_0x4576d0));_0x270b27(_0x4576d0);})[_0xb7ad('0x1f')](function(_0x5ee48c){logger[_0xb7ad('0x11')](_0xb7ad('0x15'),_0x5ee48c[_0xb7ad('0x13')],_0x2c96da);_0x41d758(_0x394bce[_0xb7ad('0x11')](0x1f4,_0x5ee48c['message']));});});};exports[_0xb7ad('0x20')]=function(_0x56f458){var _0x2df260=this;return new Promise(function(_0x3e6378,_0x33380e){return db[_0xb7ad('0x21')]['find']({'raw':_0x56f458[_0xb7ad('0x17')]?_0x56f458[_0xb7ad('0x17')][_0xb7ad('0x18')]===undefined?!![]:![]:!![],'where':_0x56f458[_0xb7ad('0x17')]?_0x56f458[_0xb7ad('0x17')][_0xb7ad('0x19')]||null:null,'attributes':_0x56f458[_0xb7ad('0x17')]?_0x56f458['options'][_0xb7ad('0x1e')]||null:null,'include':_0x56f458['options']?_0x56f458[_0xb7ad('0x17')]['include']?_['map'](_0x56f458[_0xb7ad('0x17')][_0xb7ad('0x1b')],function(_0x407b9d){return{'model':db[_0x407b9d['model']],'as':_0x407b9d['as'],'attributes':_0x407b9d[_0xb7ad('0x1e')],'include':_0x407b9d['include']?_['map'](_0x407b9d[_0xb7ad('0x1b')],function(_0x55e78e){return{'model':db[_0x55e78e['model']],'as':_0x55e78e['as'],'attributes':_0x55e78e['attributes'],'include':_0x55e78e['include']?_[_0xb7ad('0x1c')](_0x55e78e['include'],function(_0xc86bd8){return{'model':db[_0xc86bd8['model']],'as':_0xc86bd8['as'],'attributes':_0xc86bd8[_0xb7ad('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5e0609){logger[_0xb7ad('0xb')](_0xb7ad('0x20'),_0x56f458);logger[_0xb7ad('0xe')](_0xb7ad('0x20'),_0x56f458,JSON[_0xb7ad('0x10')](_0x5e0609));_0x3e6378(_0x5e0609);})[_0xb7ad('0x1f')](function(_0x50b031){logger[_0xb7ad('0x11')]('ShowZendeskAccount',_0x50b031[_0xb7ad('0x13')],_0x56f458);_0x33380e(_0x2df260[_0xb7ad('0x11')](0x1f4,_0x50b031['message']));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index f0d12bb..49c1c1e 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 _0xcb91=['get','index','isAuthenticated','show','/:id/fields','/:id/subjects','getSubjects','getDescriptions','/:id/tags','create','post','put','/:id','update','delete','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intZendeskConfiguration.controller'];(function(_0x55c979,_0x36c5f0){var _0x690107=function(_0xa61dad){while(--_0xa61dad){_0x55c979['push'](_0x55c979['shift']());}};_0x690107(++_0x36c5f0);}(_0xcb91,0x1a9));var _0x1cb9=function(_0xaa1b3e,_0x47d976){_0xaa1b3e=_0xaa1b3e-0x0;var _0x454d7d=_0xcb91[_0xaa1b3e];return _0x454d7d;};'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');var controller=require(_0x1cb9('0x6'));router[_0x1cb9('0x7')]('/',auth['isAuthenticated'](),controller[_0x1cb9('0x8')]);router[_0x1cb9('0x7')]('/:id',auth[_0x1cb9('0x9')](),controller[_0x1cb9('0xa')]);router['get'](_0x1cb9('0xb'),auth['isAuthenticated'](),controller['getFields']);router[_0x1cb9('0x7')](_0x1cb9('0xc'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0xd')]);router[_0x1cb9('0x7')]('/:id/descriptions',auth[_0x1cb9('0x9')](),controller[_0x1cb9('0xe')]);router[_0x1cb9('0x7')](_0x1cb9('0xf'),auth[_0x1cb9('0x9')](),controller['getTags']);router['post']('/',auth['isAuthenticated'](),controller[_0x1cb9('0x10')]);router[_0x1cb9('0x11')](_0x1cb9('0xf'),auth[_0x1cb9('0x9')](),controller['setTags']);router[_0x1cb9('0x12')](_0x1cb9('0x13'),auth[_0x1cb9('0x9')](),controller[_0x1cb9('0x14')]);router[_0x1cb9('0x15')]('/:id',auth['isAuthenticated'](),controller[_0x1cb9('0x16')]);module[_0x1cb9('0x17')]=router; \ No newline at end of file +var _0xac4a=['../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','isAuthenticated','get','show','getSubjects','/:id/descriptions','getDescriptions','getTags','post','create','setTags','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x38f7fd,_0x34a05c){var _0x3c463b=function(_0x39aaf9){while(--_0x39aaf9){_0x38f7fd['push'](_0x38f7fd['shift']());}};_0x3c463b(++_0x34a05c);}(_0xac4a,0x13f));var _0xaac4=function(_0x58e0fe,_0x5c96a4){_0x58e0fe=_0x58e0fe-0x0;var _0x5d9a83=_0xac4a[_0x58e0fe];return _0x5d9a83;};'use strict';var multer=require(_0xaac4('0x0'));var util=require(_0xaac4('0x1'));var path=require(_0xaac4('0x2'));var timeout=require(_0xaac4('0x3'));var express=require(_0xaac4('0x4'));var router=express[_0xaac4('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xaac4('0x6'));var config=require(_0xaac4('0x7'));var controller=require(_0xaac4('0x8'));router['get']('/',auth[_0xaac4('0x9')](),controller['index']);router[_0xaac4('0xa')]('/:id',auth[_0xaac4('0x9')](),controller[_0xaac4('0xb')]);router['get']('/:id/fields',auth[_0xaac4('0x9')](),controller['getFields']);router[_0xaac4('0xa')]('/:id/subjects',auth['isAuthenticated'](),controller[_0xaac4('0xc')]);router[_0xaac4('0xa')](_0xaac4('0xd'),auth[_0xaac4('0x9')](),controller[_0xaac4('0xe')]);router['get']('/:id/tags',auth[_0xaac4('0x9')](),controller[_0xaac4('0xf')]);router[_0xaac4('0x10')]('/',auth['isAuthenticated'](),controller[_0xaac4('0x11')]);router[_0xaac4('0x10')]('/:id/tags',auth[_0xaac4('0x9')](),controller[_0xaac4('0x12')]);router[_0xaac4('0x13')](_0xaac4('0x14'),auth[_0xaac4('0x9')](),controller[_0xaac4('0x15')]);router[_0xaac4('0x16')](_0xaac4('0x14'),auth[_0xaac4('0x9')](),controller[_0xaac4('0x17')]);module[_0xaac4('0x18')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index 02f4e38..dbce9f5 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 _0xc1b5=['sequelize','STRING'];(function(_0x1a9142,_0x5539e6){var _0x3f14f6=function(_0x399e79){while(--_0x399e79){_0x1a9142['push'](_0x1a9142['shift']());}};_0x3f14f6(++_0x5539e6);}(_0xc1b5,0x74));var _0x5c1b=function(_0x57486e,_0x32283b){_0x57486e=_0x57486e-0x0;var _0x5f110b=_0xc1b5[_0x57486e];return _0x5f110b;};'use strict';var Sequelize=require(_0x5c1b('0x0'));module['exports']={'name':{'type':Sequelize[_0x5c1b('0x1')]},'description':{'type':Sequelize[_0x5c1b('0x1')]}}; \ No newline at end of file +var _0xeae2=['STRING','exports'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xeae2,0x9b));var _0x2eae=function(_0x1722e8,_0x3622a0){_0x1722e8=_0x1722e8-0x0;var _0x3a76d1=_0xeae2[_0x1722e8];return _0x3a76d1;};'use strict';var Sequelize=require('sequelize');module[_0x2eae('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x2eae('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index 288892f..53563a1 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 _0x2c1a=['length','hasOwnProperty','nolimit','where','pick','filter','merge','includeAll','findAll','rows','catch','show','include','create','body','find','params','getFields','findOne','order','sort','options','getSubjects','ZendeskField','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','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','api','../../config/utils','../../config/environment','../../config/license/util','status','end','undefined','limit','count','offset','set','json','apply','save','update','then','destroy','sendStatus','error','stack','name','index','map','ZendeskConfiguration','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2c1a,0x1d0));var _0xa2c1=function(_0x3ce33a,_0x19e1d0){_0x3ce33a=_0x3ce33a-0x0;var _0x5b61f3=_0x2c1a[_0x3ce33a];return _0x5b61f3;};'use strict';var emlformat=require(_0xa2c1('0x0'));var rimraf=require(_0xa2c1('0x1'));var zipdir=require(_0xa2c1('0x2'));var jsonpatch=require(_0xa2c1('0x3'));var rp=require(_0xa2c1('0x4'));var moment=require(_0xa2c1('0x5'));var BPromise=require(_0xa2c1('0x6'));var Mustache=require(_0xa2c1('0x7'));var util=require(_0xa2c1('0x8'));var path=require(_0xa2c1('0x9'));var sox=require('sox');var csv=require(_0xa2c1('0xa'));var ejs=require(_0xa2c1('0xb'));var fs=require('fs');var fs_extra=require(_0xa2c1('0xc'));var _=require(_0xa2c1('0xd'));var squel=require(_0xa2c1('0xe'));var crypto=require(_0xa2c1('0xf'));var jsforce=require(_0xa2c1('0x10'));var deskjs=require(_0xa2c1('0x11'));var toCsv=require(_0xa2c1('0xa'));var querystring=require(_0xa2c1('0x12'));var Papa=require(_0xa2c1('0x13'));var Redis=require('ioredis');var authService=require(_0xa2c1('0x14'));var qs=require(_0xa2c1('0x15'));var as=require(_0xa2c1('0x16'));var hardwareService=require(_0xa2c1('0x17'));var logger=require('../../config/logger')(_0xa2c1('0x18'));var utils=require(_0xa2c1('0x19'));var config=require(_0xa2c1('0x1a'));var licenseUtil=require(_0xa2c1('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5521dd,_0x318af7){_0x318af7=_0x318af7||0xcc;return function(_0x176c01){if(_0x176c01){return _0x5521dd['sendStatus'](_0x318af7);}return _0x5521dd[_0xa2c1('0x1c')](_0x318af7)[_0xa2c1('0x1d')]();};}function respondWithResult(_0x2608e4,_0x129881){_0x129881=_0x129881||0xc8;return function(_0x5a7fc7){if(_0x5a7fc7){return _0x2608e4[_0xa2c1('0x1c')](_0x129881)['json'](_0x5a7fc7);}};}function respondWithFilteredResult(_0x4d36de,_0xa61c6d){return function(_0x8ea028){if(_0x8ea028){var _0x496356=typeof _0xa61c6d['offset']===_0xa2c1('0x1e')&&typeof _0xa61c6d[_0xa2c1('0x1f')]===_0xa2c1('0x1e');var _0x2a420a=_0x8ea028[_0xa2c1('0x20')];var _0x156aea=_0x496356?0x0:_0xa61c6d['offset'];var _0x5e8485=_0x496356?_0x8ea028[_0xa2c1('0x20')]:_0xa61c6d[_0xa2c1('0x21')]+_0xa61c6d[_0xa2c1('0x1f')];var _0x2234b0;if(_0x5e8485>=_0x2a420a){_0x5e8485=_0x2a420a;_0x2234b0=0xc8;}else{_0x2234b0=0xce;}_0x4d36de[_0xa2c1('0x1c')](_0x2234b0);return _0x4d36de[_0xa2c1('0x22')]('Content-Range',_0x156aea+'-'+_0x5e8485+'/'+_0x2a420a)[_0xa2c1('0x23')](_0x8ea028);}return null;};}function patchUpdates(_0x195c2e){return function(_0x14f890){try{jsonpatch[_0xa2c1('0x24')](_0x14f890,_0x195c2e,!![]);}catch(_0xcf3893){return BPromise['reject'](_0xcf3893);}return _0x14f890[_0xa2c1('0x25')]();};}function saveUpdates(_0x23d40c,_0x463a8e){return function(_0x270a71){if(_0x270a71){return _0x270a71[_0xa2c1('0x26')](_0x23d40c)[_0xa2c1('0x27')](function(_0x1d5a1c){return _0x1d5a1c;});}return null;};}function removeEntity(_0x11b576,_0x14f0eb){return function(_0x4bff66){if(_0x4bff66){return _0x4bff66[_0xa2c1('0x28')]()[_0xa2c1('0x27')](function(){_0x11b576[_0xa2c1('0x1c')](0xcc)[_0xa2c1('0x1d')]();});}};}function handleEntityNotFound(_0x12f8da,_0x5eea74){return function(_0x4914df){if(!_0x4914df){_0x12f8da[_0xa2c1('0x29')](0x194);}return _0x4914df;};}function handleError(_0x252b4a,_0x2ba055){_0x2ba055=_0x2ba055||0x1f4;return function(_0x1e0554){logger[_0xa2c1('0x2a')](_0x1e0554[_0xa2c1('0x2b')]);if(_0x1e0554[_0xa2c1('0x2c')]){delete _0x1e0554[_0xa2c1('0x2c')];}_0x252b4a['status'](_0x2ba055)['send'](_0x1e0554);};}exports[_0xa2c1('0x2d')]=function(_0x3d4b36,_0x1f5834){var _0x47ec91={},_0x196ec8={},_0x14352f={'count':0x0,'rows':[]};var _0x2b2913=_[_0xa2c1('0x2e')](db[_0xa2c1('0x2f')][_0xa2c1('0x30')],function(_0x4d40ad){return{'name':_0x4d40ad[_0xa2c1('0x31')],'type':_0x4d40ad[_0xa2c1('0x32')]['key']};});_0x196ec8[_0xa2c1('0x33')]=_[_0xa2c1('0x2e')](_0x2b2913,_0xa2c1('0x2c'));_0x196ec8[_0xa2c1('0x34')]=_[_0xa2c1('0x35')](_0x3d4b36[_0xa2c1('0x34')]);_0x196ec8[_0xa2c1('0x36')]=_[_0xa2c1('0x37')](_0x196ec8['model'],_0x196ec8[_0xa2c1('0x34')]);_0x47ec91['attributes']=_[_0xa2c1('0x37')](_0x196ec8[_0xa2c1('0x33')],qs[_0xa2c1('0x38')](_0x3d4b36['query'][_0xa2c1('0x38')]));_0x47ec91[_0xa2c1('0x39')]=_0x47ec91[_0xa2c1('0x39')][_0xa2c1('0x3a')]?_0x47ec91[_0xa2c1('0x39')]:_0x196ec8[_0xa2c1('0x33')];if(!_0x3d4b36[_0xa2c1('0x34')][_0xa2c1('0x3b')](_0xa2c1('0x3c'))){_0x47ec91[_0xa2c1('0x1f')]=qs[_0xa2c1('0x1f')](_0x3d4b36[_0xa2c1('0x34')]['limit']);_0x47ec91[_0xa2c1('0x21')]=qs[_0xa2c1('0x21')](_0x3d4b36[_0xa2c1('0x34')]['offset']);}_0x47ec91['order']=qs['sort'](_0x3d4b36[_0xa2c1('0x34')]['sort']);_0x47ec91[_0xa2c1('0x3d')]=qs['filters'](_[_0xa2c1('0x3e')](_0x3d4b36[_0xa2c1('0x34')],_0x196ec8[_0xa2c1('0x36')]),_0x2b2913);if(_0x3d4b36['query'][_0xa2c1('0x3f')]){_0x47ec91['where']=_['merge'](_0x47ec91[_0xa2c1('0x3d')],{'$or':_[_0xa2c1('0x2e')](_0x2b2913,function(_0x1954dd){if(_0x1954dd[_0xa2c1('0x32')]!=='VIRTUAL'){var _0x19f151={};_0x19f151[_0x1954dd[_0xa2c1('0x2c')]]={'$like':'%'+_0x3d4b36[_0xa2c1('0x34')][_0xa2c1('0x3f')]+'%'};return _0x19f151;}})});}_0x47ec91=_[_0xa2c1('0x40')]({},_0x47ec91,_0x3d4b36['options']);var _0x290ca2={'where':_0x47ec91[_0xa2c1('0x3d')]};return db[_0xa2c1('0x2f')][_0xa2c1('0x20')](_0x290ca2)[_0xa2c1('0x27')](function(_0xd59fcd){_0x14352f[_0xa2c1('0x20')]=_0xd59fcd;if(_0x3d4b36['query'][_0xa2c1('0x41')]){_0x47ec91['include']=[{'all':!![]}];}return db[_0xa2c1('0x2f')][_0xa2c1('0x42')](_0x47ec91);})[_0xa2c1('0x27')](function(_0x4c348a){_0x14352f[_0xa2c1('0x43')]=_0x4c348a;return _0x14352f;})[_0xa2c1('0x27')](respondWithFilteredResult(_0x1f5834,_0x47ec91))[_0xa2c1('0x44')](handleError(_0x1f5834,null));};exports[_0xa2c1('0x45')]=function(_0x4ebbe8,_0x1522e3){var _0x183509={'raw':![],'where':{'id':_0x4ebbe8['params']['id']}},_0x2c4aad={};_0x2c4aad[_0xa2c1('0x33')]=_[_0xa2c1('0x35')](db[_0xa2c1('0x2f')]['rawAttributes']);_0x2c4aad['query']=_['keys'](_0x4ebbe8[_0xa2c1('0x34')]);_0x2c4aad['filters']=_[_0xa2c1('0x37')](_0x2c4aad['model'],_0x2c4aad[_0xa2c1('0x34')]);_0x183509[_0xa2c1('0x39')]=_[_0xa2c1('0x37')](_0x2c4aad['model'],qs[_0xa2c1('0x38')](_0x4ebbe8[_0xa2c1('0x34')][_0xa2c1('0x38')]));_0x183509[_0xa2c1('0x39')]=_0x183509[_0xa2c1('0x39')][_0xa2c1('0x3a')]?_0x183509['attributes']:_0x2c4aad[_0xa2c1('0x33')];if(_0x4ebbe8[_0xa2c1('0x34')][_0xa2c1('0x41')]){_0x183509[_0xa2c1('0x46')]=[{'all':!![]}];}_0x183509=_[_0xa2c1('0x40')]({},_0x183509,_0x4ebbe8['options']);return db['ZendeskConfiguration']['find'](_0x183509)['then'](handleEntityNotFound(_0x1522e3,null))[_0xa2c1('0x27')](respondWithResult(_0x1522e3,null))['catch'](handleError(_0x1522e3,null));};exports[_0xa2c1('0x47')]=function(_0x37d123,_0x2f9e0f){return db[_0xa2c1('0x2f')][_0xa2c1('0x47')](_0x37d123[_0xa2c1('0x48')],{})[_0xa2c1('0x27')](respondWithResult(_0x2f9e0f,0xc9))['catch'](handleError(_0x2f9e0f,null));};exports['update']=function(_0x4b5797,_0x1e96a2){if(_0x4b5797[_0xa2c1('0x48')]['id']){delete _0x4b5797['body']['id'];}return db[_0xa2c1('0x2f')][_0xa2c1('0x49')]({'where':{'id':_0x4b5797[_0xa2c1('0x4a')]['id']}})[_0xa2c1('0x27')](handleEntityNotFound(_0x1e96a2,null))[_0xa2c1('0x27')](saveUpdates(_0x4b5797[_0xa2c1('0x48')],null))['then'](respondWithResult(_0x1e96a2,null))['catch'](handleError(_0x1e96a2,null));};exports[_0xa2c1('0x28')]=function(_0x48c440,_0x469067){return db[_0xa2c1('0x2f')][_0xa2c1('0x49')]({'where':{'id':_0x48c440[_0xa2c1('0x4a')]['id']}})[_0xa2c1('0x27')](handleEntityNotFound(_0x469067,null))[_0xa2c1('0x27')](removeEntity(_0x469067,null))['catch'](handleError(_0x469067,null));};exports[_0xa2c1('0x4b')]=function(_0x49aaa5,_0x12eba8,_0x524cc9){var _0x13b043={};var _0x185521={};var _0x546773;var _0x4f2e1f;return db['ZendeskConfiguration'][_0xa2c1('0x4c')]({'where':{'id':_0x49aaa5[_0xa2c1('0x4a')]['id']}})[_0xa2c1('0x27')](handleEntityNotFound(_0x12eba8,null))[_0xa2c1('0x27')](function(_0x136bd6){if(_0x136bd6){_0x546773=_0x136bd6;_0x185521[_0xa2c1('0x33')]=_[_0xa2c1('0x35')](db['ZendeskField'][_0xa2c1('0x30')]);_0x185521[_0xa2c1('0x34')]=_[_0xa2c1('0x35')](_0x49aaa5[_0xa2c1('0x34')]);_0x185521[_0xa2c1('0x36')]=_[_0xa2c1('0x37')](_0x185521['model'],_0x185521[_0xa2c1('0x34')]);_0x13b043[_0xa2c1('0x39')]=_[_0xa2c1('0x37')](_0x185521[_0xa2c1('0x33')],qs[_0xa2c1('0x38')](_0x49aaa5['query'][_0xa2c1('0x38')]));_0x13b043[_0xa2c1('0x39')]=_0x13b043[_0xa2c1('0x39')]['length']?_0x13b043[_0xa2c1('0x39')]:_0x185521['model'];_0x13b043[_0xa2c1('0x4d')]=qs['sort'](_0x49aaa5[_0xa2c1('0x34')][_0xa2c1('0x4e')]);_0x13b043['where']=qs[_0xa2c1('0x36')](_[_0xa2c1('0x3e')](_0x49aaa5['query'],_0x185521[_0xa2c1('0x36')]));if(_0x49aaa5['query'][_0xa2c1('0x3f')]){_0x13b043[_0xa2c1('0x3d')]=_[_0xa2c1('0x40')](_0x13b043[_0xa2c1('0x3d')],{'$or':_['map'](_0x13b043[_0xa2c1('0x39')],function(_0x4b79ec){var _0x502cb4={};_0x502cb4[_0x4b79ec]={'$like':'%'+_0x49aaa5[_0xa2c1('0x34')][_0xa2c1('0x3f')]+'%'};return _0x502cb4;})});}_0x13b043=_[_0xa2c1('0x40')]({},_0x13b043,_0x49aaa5[_0xa2c1('0x4f')]);return _0x546773['getFields'](_0x13b043);}})[_0xa2c1('0x27')](function(_0x5a83f4){if(_0x5a83f4){_0x4f2e1f=_0x5a83f4['length'];if(!_0x49aaa5[_0xa2c1('0x34')]['hasOwnProperty'](_0xa2c1('0x3c'))){_0x13b043[_0xa2c1('0x1f')]=qs[_0xa2c1('0x1f')](_0x49aaa5[_0xa2c1('0x34')]['limit']);_0x13b043[_0xa2c1('0x21')]=qs[_0xa2c1('0x21')](_0x49aaa5['query'][_0xa2c1('0x21')]);}return _0x546773[_0xa2c1('0x4b')](_0x13b043);}})[_0xa2c1('0x27')](function(_0x302d1b){if(_0x302d1b){return _0x302d1b?{'count':_0x4f2e1f,'rows':_0x302d1b}:null;}})[_0xa2c1('0x27')](respondWithResult(_0x12eba8,null))[_0xa2c1('0x44')](handleError(_0x12eba8,null));};exports[_0xa2c1('0x50')]=function(_0x52cb4d,_0x5d0801,_0x2d3987){var _0x4ac745={};var _0x32b4c5={};var _0x4173d1;var _0x131303;return db['ZendeskConfiguration'][_0xa2c1('0x4c')]({'where':{'id':_0x52cb4d[_0xa2c1('0x4a')]['id']}})[_0xa2c1('0x27')](handleEntityNotFound(_0x5d0801,null))[_0xa2c1('0x27')](function(_0x23b28a){if(_0x23b28a){_0x4173d1=_0x23b28a;_0x32b4c5[_0xa2c1('0x33')]=_['keys'](db[_0xa2c1('0x51')][_0xa2c1('0x30')]);_0x32b4c5[_0xa2c1('0x34')]=_[_0xa2c1('0x35')](_0x52cb4d[_0xa2c1('0x34')]);_0x32b4c5[_0xa2c1('0x36')]=_[_0xa2c1('0x37')](_0x32b4c5[_0xa2c1('0x33')],_0x32b4c5['query']);_0x4ac745['attributes']=_['intersection'](_0x32b4c5[_0xa2c1('0x33')],qs[_0xa2c1('0x38')](_0x52cb4d[_0xa2c1('0x34')][_0xa2c1('0x38')]));_0x4ac745['attributes']=_0x4ac745['attributes'][_0xa2c1('0x3a')]?_0x4ac745[_0xa2c1('0x39')]:_0x32b4c5[_0xa2c1('0x33')];_0x4ac745['order']=qs[_0xa2c1('0x4e')](_0x52cb4d[_0xa2c1('0x34')][_0xa2c1('0x4e')]);_0x4ac745[_0xa2c1('0x3d')]=qs['filters'](_[_0xa2c1('0x3e')](_0x52cb4d['query'],_0x32b4c5[_0xa2c1('0x36')]));if(_0x52cb4d['query'][_0xa2c1('0x3f')]){_0x4ac745[_0xa2c1('0x3d')]=_['merge'](_0x4ac745[_0xa2c1('0x3d')],{'$or':_[_0xa2c1('0x2e')](_0x4ac745['attributes'],function(_0x6fd548){var _0x3b1fa9={};_0x3b1fa9[_0x6fd548]={'$like':'%'+_0x52cb4d[_0xa2c1('0x34')][_0xa2c1('0x3f')]+'%'};return _0x3b1fa9;})});}_0x4ac745=_[_0xa2c1('0x40')]({},_0x4ac745,_0x52cb4d[_0xa2c1('0x4f')]);return _0x4173d1['getSubjects'](_0x4ac745);}})[_0xa2c1('0x27')](function(_0x3e281d){if(_0x3e281d){_0x131303=_0x3e281d['length'];if(!_0x52cb4d[_0xa2c1('0x34')][_0xa2c1('0x3b')](_0xa2c1('0x3c'))){_0x4ac745[_0xa2c1('0x1f')]=qs[_0xa2c1('0x1f')](_0x52cb4d[_0xa2c1('0x34')][_0xa2c1('0x1f')]);_0x4ac745[_0xa2c1('0x21')]=qs['offset'](_0x52cb4d[_0xa2c1('0x34')][_0xa2c1('0x21')]);}return _0x4173d1['getSubjects'](_0x4ac745);}})[_0xa2c1('0x27')](function(_0x2bab42){if(_0x2bab42){return _0x2bab42?{'count':_0x131303,'rows':_0x2bab42}:null;}})['then'](respondWithResult(_0x5d0801,null))[_0xa2c1('0x44')](handleError(_0x5d0801,null));};exports[_0xa2c1('0x52')]=function(_0x18c0b0,_0x430055,_0x4bb5d2){var _0x2ec351={};var _0x1110dc={};var _0x376661;var _0x13b06e;return db[_0xa2c1('0x2f')][_0xa2c1('0x4c')]({'where':{'id':_0x18c0b0[_0xa2c1('0x4a')]['id']}})['then'](handleEntityNotFound(_0x430055,null))['then'](function(_0x45eba0){if(_0x45eba0){_0x376661=_0x45eba0;_0x1110dc[_0xa2c1('0x33')]=_[_0xa2c1('0x35')](db[_0xa2c1('0x51')][_0xa2c1('0x30')]);_0x1110dc['query']=_[_0xa2c1('0x35')](_0x18c0b0[_0xa2c1('0x34')]);_0x1110dc[_0xa2c1('0x36')]=_['intersection'](_0x1110dc[_0xa2c1('0x33')],_0x1110dc['query']);_0x2ec351[_0xa2c1('0x39')]=_[_0xa2c1('0x37')](_0x1110dc[_0xa2c1('0x33')],qs[_0xa2c1('0x38')](_0x18c0b0[_0xa2c1('0x34')]['fields']));_0x2ec351[_0xa2c1('0x39')]=_0x2ec351[_0xa2c1('0x39')]['length']?_0x2ec351['attributes']:_0x1110dc['model'];_0x2ec351[_0xa2c1('0x4d')]=qs[_0xa2c1('0x4e')](_0x18c0b0[_0xa2c1('0x34')][_0xa2c1('0x4e')]);_0x2ec351[_0xa2c1('0x3d')]=qs['filters'](_[_0xa2c1('0x3e')](_0x18c0b0[_0xa2c1('0x34')],_0x1110dc['filters']));if(_0x18c0b0[_0xa2c1('0x34')][_0xa2c1('0x3f')]){_0x2ec351[_0xa2c1('0x3d')]=_['merge'](_0x2ec351['where'],{'$or':_[_0xa2c1('0x2e')](_0x2ec351[_0xa2c1('0x39')],function(_0x41f20f){var _0x2a72a9={};_0x2a72a9[_0x41f20f]={'$like':'%'+_0x18c0b0[_0xa2c1('0x34')][_0xa2c1('0x3f')]+'%'};return _0x2a72a9;})});}_0x2ec351=_[_0xa2c1('0x40')]({},_0x2ec351,_0x18c0b0[_0xa2c1('0x4f')]);return _0x376661[_0xa2c1('0x52')](_0x2ec351);}})[_0xa2c1('0x27')](function(_0x5e447b){if(_0x5e447b){_0x13b06e=_0x5e447b[_0xa2c1('0x3a')];if(!_0x18c0b0[_0xa2c1('0x34')][_0xa2c1('0x3b')](_0xa2c1('0x3c'))){_0x2ec351[_0xa2c1('0x1f')]=qs[_0xa2c1('0x1f')](_0x18c0b0[_0xa2c1('0x34')][_0xa2c1('0x1f')]);_0x2ec351[_0xa2c1('0x21')]=qs[_0xa2c1('0x21')](_0x18c0b0['query'][_0xa2c1('0x21')]);}return _0x376661[_0xa2c1('0x52')](_0x2ec351);}})[_0xa2c1('0x27')](function(_0x33931b){if(_0x33931b){return _0x33931b?{'count':_0x13b06e,'rows':_0x33931b}:null;}})['then'](respondWithResult(_0x430055,null))['catch'](handleError(_0x430055,null));};exports[_0xa2c1('0x53')]=function(_0x30314b,_0x48189b,_0x57adbd){var _0x49e8d2={};var _0x4544a9={};var _0x47c56e;var _0x3a0b74;return db[_0xa2c1('0x2f')][_0xa2c1('0x4c')]({'where':{'id':_0x30314b[_0xa2c1('0x4a')]['id']}})[_0xa2c1('0x27')](handleEntityNotFound(_0x48189b,null))[_0xa2c1('0x27')](function(_0x396c08){if(_0x396c08){_0x47c56e=_0x396c08;_0x4544a9[_0xa2c1('0x33')]=_[_0xa2c1('0x35')](db[_0xa2c1('0x54')][_0xa2c1('0x30')]);_0x4544a9[_0xa2c1('0x34')]=_[_0xa2c1('0x35')](_0x30314b[_0xa2c1('0x34')]);_0x4544a9[_0xa2c1('0x36')]=_[_0xa2c1('0x37')](_0x4544a9[_0xa2c1('0x33')],_0x4544a9[_0xa2c1('0x34')]);_0x49e8d2[_0xa2c1('0x39')]=_[_0xa2c1('0x37')](_0x4544a9[_0xa2c1('0x33')],qs[_0xa2c1('0x38')](_0x30314b[_0xa2c1('0x34')][_0xa2c1('0x38')]));_0x49e8d2[_0xa2c1('0x39')]=_0x49e8d2[_0xa2c1('0x39')][_0xa2c1('0x3a')]?_0x49e8d2[_0xa2c1('0x39')]:_0x4544a9[_0xa2c1('0x33')];_0x49e8d2[_0xa2c1('0x4d')]=qs['sort'](_0x30314b[_0xa2c1('0x34')][_0xa2c1('0x4e')]);_0x49e8d2[_0xa2c1('0x3d')]=qs['filters'](_[_0xa2c1('0x3e')](_0x30314b['query'],_0x4544a9['filters']));if(_0x30314b[_0xa2c1('0x34')]['filter']){_0x49e8d2['where']=_[_0xa2c1('0x40')](_0x49e8d2[_0xa2c1('0x3d')],{'$or':_[_0xa2c1('0x2e')](_0x49e8d2[_0xa2c1('0x39')],function(_0x1b953c){var _0x591fa6={};_0x591fa6[_0x1b953c]={'$like':'%'+_0x30314b[_0xa2c1('0x34')][_0xa2c1('0x3f')]+'%'};return _0x591fa6;})});}_0x49e8d2=_[_0xa2c1('0x40')]({},_0x49e8d2,_0x30314b[_0xa2c1('0x4f')]);return _0x47c56e['getTags'](_0x49e8d2);}})[_0xa2c1('0x27')](function(_0x2273df){if(_0x2273df){_0x3a0b74=_0x2273df[_0xa2c1('0x3a')];if(!_0x30314b[_0xa2c1('0x34')][_0xa2c1('0x3b')]('nolimit')){_0x49e8d2[_0xa2c1('0x1f')]=qs[_0xa2c1('0x1f')](_0x30314b['query'][_0xa2c1('0x1f')]);_0x49e8d2[_0xa2c1('0x21')]=qs[_0xa2c1('0x21')](_0x30314b[_0xa2c1('0x34')][_0xa2c1('0x21')]);}return _0x47c56e[_0xa2c1('0x53')](_0x49e8d2);}})[_0xa2c1('0x27')](function(_0x143a6f){if(_0x143a6f){return _0x143a6f?{'count':_0x3a0b74,'rows':_0x143a6f}:null;}})[_0xa2c1('0x27')](respondWithResult(_0x48189b,null))[_0xa2c1('0x44')](handleError(_0x48189b,null));};exports[_0xa2c1('0x55')]=function(_0x216ba0,_0x3bd7a9,_0x5a424d){if(_0x216ba0['body']['id']){delete _0x216ba0[_0xa2c1('0x48')]['id'];}return db['ZendeskConfiguration'][_0xa2c1('0x4c')]({'where':{'id':_0x216ba0[_0xa2c1('0x4a')]['id']}})[_0xa2c1('0x27')](handleEntityNotFound(_0x3bd7a9,null))[_0xa2c1('0x27')](function(_0x4f5b62){if(_0x4f5b62){return _0x4f5b62[_0xa2c1('0x55')](_0x216ba0['body'][_0xa2c1('0x56')]||[]);}return null;})[_0xa2c1('0x27')](respondWithResult(_0x3bd7a9,null))['catch'](handleError(_0x3bd7a9,null));}; \ No newline at end of file +var _0x50db=['index','map','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','order','sort','where','filters','pick','merge','VIRTUAL','options','ZendeskConfiguration','includeAll','findAll','rows','catch','show','create','body','find','params','getFields','findOne','ZendeskField','filter','getSubjects','hasOwnProperty','nolimit','getDescriptions','getTags','Tag','setTags','ids','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','squel','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','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','end','error','stack','name','send'];(function(_0x2c79dc,_0x5bd4fc){var _0x3d53de=function(_0xac14e0){while(--_0xac14e0){_0x2c79dc['push'](_0x2c79dc['shift']());}};_0x3d53de(++_0x5bd4fc);}(_0x50db,0x1d4));var _0xb50d=function(_0x1494c0,_0x197063){_0x1494c0=_0x1494c0-0x0;var _0x31f1ac=_0x50db[_0x1494c0];return _0x31f1ac;};'use strict';var emlformat=require(_0xb50d('0x0'));var rimraf=require(_0xb50d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb50d('0x2'));var rp=require(_0xb50d('0x3'));var moment=require(_0xb50d('0x4'));var BPromise=require(_0xb50d('0x5'));var Mustache=require(_0xb50d('0x6'));var util=require('util');var path=require('path');var sox=require(_0xb50d('0x7'));var csv=require(_0xb50d('0x8'));var ejs=require(_0xb50d('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb50d('0xa'));var crypto=require('crypto');var jsforce=require(_0xb50d('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xb50d('0x8'));var querystring=require(_0xb50d('0xc'));var Papa=require('papaparse');var Redis=require(_0xb50d('0xd'));var authService=require(_0xb50d('0xe'));var qs=require(_0xb50d('0xf'));var as=require(_0xb50d('0x10'));var hardwareService=require(_0xb50d('0x11'));var logger=require(_0xb50d('0x12'))(_0xb50d('0x13'));var utils=require(_0xb50d('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xb50d('0x15'));var db=require(_0xb50d('0x16'))['db'];function respondWithStatusCode(_0x5a8d44,_0x3c5025){_0x3c5025=_0x3c5025||0xcc;return function(_0x456f21){if(_0x456f21){return _0x5a8d44[_0xb50d('0x17')](_0x3c5025);}return _0x5a8d44[_0xb50d('0x18')](_0x3c5025)['end']();};}function respondWithResult(_0xe056db,_0x54fab1){_0x54fab1=_0x54fab1||0xc8;return function(_0x4309a0){if(_0x4309a0){return _0xe056db[_0xb50d('0x18')](_0x54fab1)[_0xb50d('0x19')](_0x4309a0);}};}function respondWithFilteredResult(_0x2a8c61,_0x49b010){return function(_0x37bb0a){if(_0x37bb0a){var _0x20201d=typeof _0x49b010[_0xb50d('0x1a')]===_0xb50d('0x1b')&&typeof _0x49b010[_0xb50d('0x1c')]===_0xb50d('0x1b');var _0x1b5db4=_0x37bb0a['count'];var _0x13e3e9=_0x20201d?0x0:_0x49b010[_0xb50d('0x1a')];var _0x3e5532=_0x20201d?_0x37bb0a[_0xb50d('0x1d')]:_0x49b010[_0xb50d('0x1a')]+_0x49b010[_0xb50d('0x1c')];var _0xdf778b;if(_0x3e5532>=_0x1b5db4){_0x3e5532=_0x1b5db4;_0xdf778b=0xc8;}else{_0xdf778b=0xce;}_0x2a8c61[_0xb50d('0x18')](_0xdf778b);return _0x2a8c61[_0xb50d('0x1e')](_0xb50d('0x1f'),_0x13e3e9+'-'+_0x3e5532+'/'+_0x1b5db4)[_0xb50d('0x19')](_0x37bb0a);}return null;};}function patchUpdates(_0x2b6e62){return function(_0x4f9527){try{jsonpatch['apply'](_0x4f9527,_0x2b6e62,!![]);}catch(_0xe00331){return BPromise[_0xb50d('0x20')](_0xe00331);}return _0x4f9527[_0xb50d('0x21')]();};}function saveUpdates(_0xed4f62,_0x45cf2a){return function(_0x1ad48f){if(_0x1ad48f){return _0x1ad48f[_0xb50d('0x22')](_0xed4f62)[_0xb50d('0x23')](function(_0x31c232){return _0x31c232;});}return null;};}function removeEntity(_0x261d21,_0x1df868){return function(_0x222de5){if(_0x222de5){return _0x222de5[_0xb50d('0x24')]()[_0xb50d('0x23')](function(){_0x261d21[_0xb50d('0x18')](0xcc)[_0xb50d('0x25')]();});}};}function handleEntityNotFound(_0x39f41c,_0x397c74){return function(_0x2f5527){if(!_0x2f5527){_0x39f41c[_0xb50d('0x17')](0x194);}return _0x2f5527;};}function handleError(_0x35262b,_0x5c33eb){_0x5c33eb=_0x5c33eb||0x1f4;return function(_0x23ec97){logger[_0xb50d('0x26')](_0x23ec97[_0xb50d('0x27')]);if(_0x23ec97[_0xb50d('0x28')]){delete _0x23ec97[_0xb50d('0x28')];}_0x35262b[_0xb50d('0x18')](_0x5c33eb)[_0xb50d('0x29')](_0x23ec97);};}exports[_0xb50d('0x2a')]=function(_0x49a197,_0xd9b0ec){var _0x58981a={},_0x5c8c87={},_0x589831={'count':0x0,'rows':[]};var _0x239ce5=_[_0xb50d('0x2b')](db['ZendeskConfiguration'][_0xb50d('0x2c')],function(_0x4ce821){return{'name':_0x4ce821[_0xb50d('0x2d')],'type':_0x4ce821[_0xb50d('0x2e')][_0xb50d('0x2f')]};});_0x5c8c87[_0xb50d('0x30')]=_[_0xb50d('0x2b')](_0x239ce5,_0xb50d('0x28'));_0x5c8c87[_0xb50d('0x31')]=_[_0xb50d('0x32')](_0x49a197[_0xb50d('0x31')]);_0x5c8c87['filters']=_[_0xb50d('0x33')](_0x5c8c87[_0xb50d('0x30')],_0x5c8c87['query']);_0x58981a[_0xb50d('0x34')]=_[_0xb50d('0x33')](_0x5c8c87[_0xb50d('0x30')],qs[_0xb50d('0x35')](_0x49a197[_0xb50d('0x31')]['fields']));_0x58981a['attributes']=_0x58981a[_0xb50d('0x34')][_0xb50d('0x36')]?_0x58981a[_0xb50d('0x34')]:_0x5c8c87[_0xb50d('0x30')];if(!_0x49a197[_0xb50d('0x31')]['hasOwnProperty']('nolimit')){_0x58981a[_0xb50d('0x1c')]=qs[_0xb50d('0x1c')](_0x49a197[_0xb50d('0x31')]['limit']);_0x58981a[_0xb50d('0x1a')]=qs[_0xb50d('0x1a')](_0x49a197[_0xb50d('0x31')][_0xb50d('0x1a')]);}_0x58981a[_0xb50d('0x37')]=qs[_0xb50d('0x38')](_0x49a197['query'][_0xb50d('0x38')]);_0x58981a[_0xb50d('0x39')]=qs[_0xb50d('0x3a')](_[_0xb50d('0x3b')](_0x49a197[_0xb50d('0x31')],_0x5c8c87[_0xb50d('0x3a')]),_0x239ce5);if(_0x49a197[_0xb50d('0x31')]['filter']){_0x58981a[_0xb50d('0x39')]=_[_0xb50d('0x3c')](_0x58981a['where'],{'$or':_[_0xb50d('0x2b')](_0x239ce5,function(_0x1c7edb){if(_0x1c7edb[_0xb50d('0x2e')]!==_0xb50d('0x3d')){var _0x2e0065={};_0x2e0065[_0x1c7edb[_0xb50d('0x28')]]={'$like':'%'+_0x49a197['query']['filter']+'%'};return _0x2e0065;}})});}_0x58981a=_['merge']({},_0x58981a,_0x49a197[_0xb50d('0x3e')]);var _0x315ce1={'where':_0x58981a['where']};return db[_0xb50d('0x3f')]['count'](_0x315ce1)[_0xb50d('0x23')](function(_0x31a2fb){_0x589831[_0xb50d('0x1d')]=_0x31a2fb;if(_0x49a197[_0xb50d('0x31')][_0xb50d('0x40')]){_0x58981a['include']=[{'all':!![]}];}return db['ZendeskConfiguration'][_0xb50d('0x41')](_0x58981a);})[_0xb50d('0x23')](function(_0x1588e6){_0x589831[_0xb50d('0x42')]=_0x1588e6;return _0x589831;})[_0xb50d('0x23')](respondWithFilteredResult(_0xd9b0ec,_0x58981a))[_0xb50d('0x43')](handleError(_0xd9b0ec,null));};exports[_0xb50d('0x44')]=function(_0x5559e9,_0x38d386){var _0x59fc14={'raw':![],'where':{'id':_0x5559e9['params']['id']}},_0x1d1c9c={};_0x1d1c9c[_0xb50d('0x30')]=_[_0xb50d('0x32')](db[_0xb50d('0x3f')]['rawAttributes']);_0x1d1c9c['query']=_['keys'](_0x5559e9['query']);_0x1d1c9c['filters']=_['intersection'](_0x1d1c9c[_0xb50d('0x30')],_0x1d1c9c[_0xb50d('0x31')]);_0x59fc14['attributes']=_[_0xb50d('0x33')](_0x1d1c9c[_0xb50d('0x30')],qs['fields'](_0x5559e9[_0xb50d('0x31')]['fields']));_0x59fc14['attributes']=_0x59fc14[_0xb50d('0x34')][_0xb50d('0x36')]?_0x59fc14[_0xb50d('0x34')]:_0x1d1c9c[_0xb50d('0x30')];if(_0x5559e9[_0xb50d('0x31')]['includeAll']){_0x59fc14['include']=[{'all':!![]}];}_0x59fc14=_[_0xb50d('0x3c')]({},_0x59fc14,_0x5559e9[_0xb50d('0x3e')]);return db[_0xb50d('0x3f')]['find'](_0x59fc14)[_0xb50d('0x23')](handleEntityNotFound(_0x38d386,null))[_0xb50d('0x23')](respondWithResult(_0x38d386,null))[_0xb50d('0x43')](handleError(_0x38d386,null));};exports[_0xb50d('0x45')]=function(_0x5908a2,_0x4e151a){return db[_0xb50d('0x3f')][_0xb50d('0x45')](_0x5908a2[_0xb50d('0x46')],{})[_0xb50d('0x23')](respondWithResult(_0x4e151a,0xc9))[_0xb50d('0x43')](handleError(_0x4e151a,null));};exports['update']=function(_0x550fb9,_0x452c92){if(_0x550fb9['body']['id']){delete _0x550fb9[_0xb50d('0x46')]['id'];}return db[_0xb50d('0x3f')][_0xb50d('0x47')]({'where':{'id':_0x550fb9[_0xb50d('0x48')]['id']}})[_0xb50d('0x23')](handleEntityNotFound(_0x452c92,null))['then'](saveUpdates(_0x550fb9[_0xb50d('0x46')],null))[_0xb50d('0x23')](respondWithResult(_0x452c92,null))['catch'](handleError(_0x452c92,null));};exports['destroy']=function(_0x4679b4,_0x137404){return db[_0xb50d('0x3f')][_0xb50d('0x47')]({'where':{'id':_0x4679b4[_0xb50d('0x48')]['id']}})[_0xb50d('0x23')](handleEntityNotFound(_0x137404,null))['then'](removeEntity(_0x137404,null))[_0xb50d('0x43')](handleError(_0x137404,null));};exports[_0xb50d('0x49')]=function(_0x4ebef7,_0x437b9d,_0x5733a9){var _0x5cd924={};var _0x66028={};var _0x4f61e1;var _0x333510;return db[_0xb50d('0x3f')][_0xb50d('0x4a')]({'where':{'id':_0x4ebef7[_0xb50d('0x48')]['id']}})['then'](handleEntityNotFound(_0x437b9d,null))[_0xb50d('0x23')](function(_0xcf4be){if(_0xcf4be){_0x4f61e1=_0xcf4be;_0x66028[_0xb50d('0x30')]=_[_0xb50d('0x32')](db[_0xb50d('0x4b')][_0xb50d('0x2c')]);_0x66028[_0xb50d('0x31')]=_['keys'](_0x4ebef7[_0xb50d('0x31')]);_0x66028[_0xb50d('0x3a')]=_[_0xb50d('0x33')](_0x66028[_0xb50d('0x30')],_0x66028[_0xb50d('0x31')]);_0x5cd924[_0xb50d('0x34')]=_[_0xb50d('0x33')](_0x66028[_0xb50d('0x30')],qs['fields'](_0x4ebef7['query'][_0xb50d('0x35')]));_0x5cd924['attributes']=_0x5cd924[_0xb50d('0x34')][_0xb50d('0x36')]?_0x5cd924[_0xb50d('0x34')]:_0x66028['model'];_0x5cd924[_0xb50d('0x37')]=qs[_0xb50d('0x38')](_0x4ebef7[_0xb50d('0x31')][_0xb50d('0x38')]);_0x5cd924['where']=qs['filters'](_[_0xb50d('0x3b')](_0x4ebef7['query'],_0x66028['filters']));if(_0x4ebef7[_0xb50d('0x31')][_0xb50d('0x4c')]){_0x5cd924[_0xb50d('0x39')]=_[_0xb50d('0x3c')](_0x5cd924[_0xb50d('0x39')],{'$or':_[_0xb50d('0x2b')](_0x5cd924[_0xb50d('0x34')],function(_0x847018){var _0x529dae={};_0x529dae[_0x847018]={'$like':'%'+_0x4ebef7['query'][_0xb50d('0x4c')]+'%'};return _0x529dae;})});}_0x5cd924=_['merge']({},_0x5cd924,_0x4ebef7[_0xb50d('0x3e')]);return _0x4f61e1[_0xb50d('0x49')](_0x5cd924);}})[_0xb50d('0x23')](function(_0x50ef59){if(_0x50ef59){_0x333510=_0x50ef59[_0xb50d('0x36')];if(!_0x4ebef7[_0xb50d('0x31')]['hasOwnProperty']('nolimit')){_0x5cd924[_0xb50d('0x1c')]=qs[_0xb50d('0x1c')](_0x4ebef7[_0xb50d('0x31')][_0xb50d('0x1c')]);_0x5cd924[_0xb50d('0x1a')]=qs['offset'](_0x4ebef7[_0xb50d('0x31')][_0xb50d('0x1a')]);}return _0x4f61e1[_0xb50d('0x49')](_0x5cd924);}})[_0xb50d('0x23')](function(_0x326382){if(_0x326382){return _0x326382?{'count':_0x333510,'rows':_0x326382}:null;}})[_0xb50d('0x23')](respondWithResult(_0x437b9d,null))[_0xb50d('0x43')](handleError(_0x437b9d,null));};exports[_0xb50d('0x4d')]=function(_0x34bf3,_0x19e32a,_0x4c47f4){var _0x47ba25={};var _0x3c48cb={};var _0x148cef;var _0x36416b;return db[_0xb50d('0x3f')][_0xb50d('0x4a')]({'where':{'id':_0x34bf3[_0xb50d('0x48')]['id']}})['then'](handleEntityNotFound(_0x19e32a,null))[_0xb50d('0x23')](function(_0x19e0eb){if(_0x19e0eb){_0x148cef=_0x19e0eb;_0x3c48cb[_0xb50d('0x30')]=_['keys'](db['ZendeskField'][_0xb50d('0x2c')]);_0x3c48cb[_0xb50d('0x31')]=_[_0xb50d('0x32')](_0x34bf3[_0xb50d('0x31')]);_0x3c48cb['filters']=_[_0xb50d('0x33')](_0x3c48cb[_0xb50d('0x30')],_0x3c48cb[_0xb50d('0x31')]);_0x47ba25[_0xb50d('0x34')]=_[_0xb50d('0x33')](_0x3c48cb[_0xb50d('0x30')],qs[_0xb50d('0x35')](_0x34bf3[_0xb50d('0x31')][_0xb50d('0x35')]));_0x47ba25[_0xb50d('0x34')]=_0x47ba25[_0xb50d('0x34')]['length']?_0x47ba25[_0xb50d('0x34')]:_0x3c48cb[_0xb50d('0x30')];_0x47ba25[_0xb50d('0x37')]=qs['sort'](_0x34bf3[_0xb50d('0x31')][_0xb50d('0x38')]);_0x47ba25[_0xb50d('0x39')]=qs['filters'](_[_0xb50d('0x3b')](_0x34bf3[_0xb50d('0x31')],_0x3c48cb[_0xb50d('0x3a')]));if(_0x34bf3[_0xb50d('0x31')][_0xb50d('0x4c')]){_0x47ba25[_0xb50d('0x39')]=_[_0xb50d('0x3c')](_0x47ba25[_0xb50d('0x39')],{'$or':_[_0xb50d('0x2b')](_0x47ba25['attributes'],function(_0x4caa1c){var _0x32df2f={};_0x32df2f[_0x4caa1c]={'$like':'%'+_0x34bf3[_0xb50d('0x31')][_0xb50d('0x4c')]+'%'};return _0x32df2f;})});}_0x47ba25=_[_0xb50d('0x3c')]({},_0x47ba25,_0x34bf3['options']);return _0x148cef[_0xb50d('0x4d')](_0x47ba25);}})[_0xb50d('0x23')](function(_0x4d046a){if(_0x4d046a){_0x36416b=_0x4d046a[_0xb50d('0x36')];if(!_0x34bf3[_0xb50d('0x31')][_0xb50d('0x4e')](_0xb50d('0x4f'))){_0x47ba25[_0xb50d('0x1c')]=qs[_0xb50d('0x1c')](_0x34bf3[_0xb50d('0x31')]['limit']);_0x47ba25['offset']=qs[_0xb50d('0x1a')](_0x34bf3['query'][_0xb50d('0x1a')]);}return _0x148cef[_0xb50d('0x4d')](_0x47ba25);}})[_0xb50d('0x23')](function(_0x3ca4aa){if(_0x3ca4aa){return _0x3ca4aa?{'count':_0x36416b,'rows':_0x3ca4aa}:null;}})['then'](respondWithResult(_0x19e32a,null))[_0xb50d('0x43')](handleError(_0x19e32a,null));};exports[_0xb50d('0x50')]=function(_0x37f302,_0x293718,_0x52642b){var _0x43d049={};var _0x2ed37b={};var _0x350f1e;var _0x9b0214;return db[_0xb50d('0x3f')][_0xb50d('0x4a')]({'where':{'id':_0x37f302[_0xb50d('0x48')]['id']}})[_0xb50d('0x23')](handleEntityNotFound(_0x293718,null))[_0xb50d('0x23')](function(_0x518e4b){if(_0x518e4b){_0x350f1e=_0x518e4b;_0x2ed37b[_0xb50d('0x30')]=_[_0xb50d('0x32')](db['ZendeskField'][_0xb50d('0x2c')]);_0x2ed37b['query']=_['keys'](_0x37f302[_0xb50d('0x31')]);_0x2ed37b['filters']=_['intersection'](_0x2ed37b[_0xb50d('0x30')],_0x2ed37b[_0xb50d('0x31')]);_0x43d049[_0xb50d('0x34')]=_[_0xb50d('0x33')](_0x2ed37b[_0xb50d('0x30')],qs[_0xb50d('0x35')](_0x37f302[_0xb50d('0x31')][_0xb50d('0x35')]));_0x43d049['attributes']=_0x43d049[_0xb50d('0x34')]['length']?_0x43d049[_0xb50d('0x34')]:_0x2ed37b[_0xb50d('0x30')];_0x43d049[_0xb50d('0x37')]=qs['sort'](_0x37f302['query'][_0xb50d('0x38')]);_0x43d049[_0xb50d('0x39')]=qs['filters'](_['pick'](_0x37f302[_0xb50d('0x31')],_0x2ed37b[_0xb50d('0x3a')]));if(_0x37f302[_0xb50d('0x31')][_0xb50d('0x4c')]){_0x43d049[_0xb50d('0x39')]=_[_0xb50d('0x3c')](_0x43d049['where'],{'$or':_[_0xb50d('0x2b')](_0x43d049[_0xb50d('0x34')],function(_0x297256){var _0x231860={};_0x231860[_0x297256]={'$like':'%'+_0x37f302[_0xb50d('0x31')][_0xb50d('0x4c')]+'%'};return _0x231860;})});}_0x43d049=_[_0xb50d('0x3c')]({},_0x43d049,_0x37f302['options']);return _0x350f1e[_0xb50d('0x50')](_0x43d049);}})['then'](function(_0xdff744){if(_0xdff744){_0x9b0214=_0xdff744[_0xb50d('0x36')];if(!_0x37f302['query'][_0xb50d('0x4e')]('nolimit')){_0x43d049[_0xb50d('0x1c')]=qs[_0xb50d('0x1c')](_0x37f302[_0xb50d('0x31')][_0xb50d('0x1c')]);_0x43d049[_0xb50d('0x1a')]=qs[_0xb50d('0x1a')](_0x37f302[_0xb50d('0x31')][_0xb50d('0x1a')]);}return _0x350f1e[_0xb50d('0x50')](_0x43d049);}})[_0xb50d('0x23')](function(_0x1f79d4){if(_0x1f79d4){return _0x1f79d4?{'count':_0x9b0214,'rows':_0x1f79d4}:null;}})[_0xb50d('0x23')](respondWithResult(_0x293718,null))[_0xb50d('0x43')](handleError(_0x293718,null));};exports[_0xb50d('0x51')]=function(_0x2bedb8,_0x139e8b,_0x13dd1a){var _0x44a025={};var _0x3adf6b={};var _0x45949b;var _0x1be2b8;return db[_0xb50d('0x3f')][_0xb50d('0x4a')]({'where':{'id':_0x2bedb8['params']['id']}})[_0xb50d('0x23')](handleEntityNotFound(_0x139e8b,null))[_0xb50d('0x23')](function(_0x308741){if(_0x308741){_0x45949b=_0x308741;_0x3adf6b[_0xb50d('0x30')]=_[_0xb50d('0x32')](db[_0xb50d('0x52')][_0xb50d('0x2c')]);_0x3adf6b[_0xb50d('0x31')]=_[_0xb50d('0x32')](_0x2bedb8['query']);_0x3adf6b[_0xb50d('0x3a')]=_['intersection'](_0x3adf6b[_0xb50d('0x30')],_0x3adf6b[_0xb50d('0x31')]);_0x44a025[_0xb50d('0x34')]=_[_0xb50d('0x33')](_0x3adf6b[_0xb50d('0x30')],qs[_0xb50d('0x35')](_0x2bedb8[_0xb50d('0x31')][_0xb50d('0x35')]));_0x44a025[_0xb50d('0x34')]=_0x44a025['attributes'][_0xb50d('0x36')]?_0x44a025['attributes']:_0x3adf6b[_0xb50d('0x30')];_0x44a025[_0xb50d('0x37')]=qs['sort'](_0x2bedb8[_0xb50d('0x31')][_0xb50d('0x38')]);_0x44a025[_0xb50d('0x39')]=qs[_0xb50d('0x3a')](_['pick'](_0x2bedb8[_0xb50d('0x31')],_0x3adf6b[_0xb50d('0x3a')]));if(_0x2bedb8['query'][_0xb50d('0x4c')]){_0x44a025[_0xb50d('0x39')]=_[_0xb50d('0x3c')](_0x44a025['where'],{'$or':_['map'](_0x44a025[_0xb50d('0x34')],function(_0xa9c634){var _0x2dc380={};_0x2dc380[_0xa9c634]={'$like':'%'+_0x2bedb8[_0xb50d('0x31')][_0xb50d('0x4c')]+'%'};return _0x2dc380;})});}_0x44a025=_[_0xb50d('0x3c')]({},_0x44a025,_0x2bedb8[_0xb50d('0x3e')]);return _0x45949b[_0xb50d('0x51')](_0x44a025);}})[_0xb50d('0x23')](function(_0x82e579){if(_0x82e579){_0x1be2b8=_0x82e579[_0xb50d('0x36')];if(!_0x2bedb8['query']['hasOwnProperty']('nolimit')){_0x44a025[_0xb50d('0x1c')]=qs[_0xb50d('0x1c')](_0x2bedb8[_0xb50d('0x31')][_0xb50d('0x1c')]);_0x44a025[_0xb50d('0x1a')]=qs[_0xb50d('0x1a')](_0x2bedb8[_0xb50d('0x31')]['offset']);}return _0x45949b[_0xb50d('0x51')](_0x44a025);}})[_0xb50d('0x23')](function(_0x3e5039){if(_0x3e5039){return _0x3e5039?{'count':_0x1be2b8,'rows':_0x3e5039}:null;}})['then'](respondWithResult(_0x139e8b,null))['catch'](handleError(_0x139e8b,null));};exports[_0xb50d('0x53')]=function(_0x507ff3,_0x8a6908,_0x5a8201){if(_0x507ff3[_0xb50d('0x46')]['id']){delete _0x507ff3[_0xb50d('0x46')]['id'];}return db[_0xb50d('0x3f')][_0xb50d('0x4a')]({'where':{'id':_0x507ff3['params']['id']}})[_0xb50d('0x23')](handleEntityNotFound(_0x8a6908,null))[_0xb50d('0x23')](function(_0x145164){if(_0x145164){return _0x145164[_0xb50d('0x53')](_0x507ff3[_0xb50d('0x46')][_0xb50d('0x54')]||[]);}return null;})['then'](respondWithResult(_0x8a6908,null))['catch'](handleError(_0x8a6908,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index 4d153bc..15b6977 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 _0xda2d=['./intZendeskConfiguration.attributes','exports','define','ZendeskConfiguration','int_zendesk_configurations','util','../../config/logger','api','moment','bluebird','../../config/environment'];(function(_0x46d8c6,_0x4b8c84){var _0xd91cc0=function(_0x458eb7){while(--_0x458eb7){_0x46d8c6['push'](_0x46d8c6['shift']());}};_0xd91cc0(++_0x4b8c84);}(_0xda2d,0x102));var _0xdda2=function(_0x4a47c3,_0x2363dd){_0x4a47c3=_0x4a47c3-0x0;var _0x1bdb7c=_0xda2d[_0x4a47c3];return _0x1bdb7c;};'use strict';var _=require('lodash');var util=require(_0xdda2('0x0'));var logger=require(_0xdda2('0x1'))(_0xdda2('0x2'));var moment=require(_0xdda2('0x3'));var BPromise=require(_0xdda2('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xdda2('0x5'));var attributes=require(_0xdda2('0x6'));module[_0xdda2('0x7')]=function(_0x39f6c9,_0xc256bc){return _0x39f6c9[_0xdda2('0x8')](_0xdda2('0x9'),attributes,{'tableName':_0xdda2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x351d=['../../config/environment','exports','ZendeskConfiguration','int_zendesk_configurations','lodash','../../config/logger','api','moment','request-promise','rimraf'];(function(_0x67f23a,_0x1b0d9e){var _0x517675=function(_0x128e8a){while(--_0x128e8a){_0x67f23a['push'](_0x67f23a['shift']());}};_0x517675(++_0x1b0d9e);}(_0x351d,0x90));var _0xd351=function(_0x42f64b,_0x149fea){_0x42f64b=_0x42f64b-0x0;var _0x438477=_0x351d[_0x42f64b];return _0x438477;};'use strict';var _=require(_0xd351('0x0'));var util=require('util');var logger=require(_0xd351('0x1'))(_0xd351('0x2'));var moment=require(_0xd351('0x3'));var BPromise=require('bluebird');var rp=require(_0xd351('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xd351('0x5'));var config=require(_0xd351('0x6'));var attributes=require('./intZendeskConfiguration.attributes');module[_0xd351('0x7')]=function(_0x45e9e5,_0x88bd2b){return _0x45e9e5['define'](_0xd351('0x8'),attributes,{'tableName':_0xd351('0x9'),'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 8be0947..9a92bac 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 _0x4668=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment'];(function(_0x53a934,_0x2d33b8){var _0x1fd48a=function(_0x102669){while(--_0x102669){_0x53a934['push'](_0x53a934['shift']());}};_0x1fd48a(++_0x2d33b8);}(_0x4668,0x1bf));var _0x8466=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x4668[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x8466('0x0'));var util=require(_0x8466('0x1'));var moment=require(_0x8466('0x2'));var BPromise=require(_0x8466('0x3'));var rs=require(_0x8466('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8466('0x5'))['db'];var utils=require(_0x8466('0x6'));var logger=require(_0x8466('0x7'))(_0x8466('0x8'));var config=require(_0x8466('0x9'));var jayson=require(_0x8466('0xa'));var client=jayson[_0x8466('0xb')][_0x8466('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x466797,_0x40d13a,_0x38d846){return new BPromise(function(_0xeab8b,_0x58f1d0){return client[_0x8466('0xd')](_0x466797,_0x38d846)[_0x8466('0xe')](function(_0x39699a){logger[_0x8466('0xf')](_0x8466('0x10'),_0x40d13a,_0x8466('0x11'));logger[_0x8466('0x12')](_0x8466('0x13'),_0x40d13a,_0x8466('0x11'),JSON[_0x8466('0x14')](_0x39699a));if(_0x39699a[_0x8466('0x15')]){if(_0x39699a[_0x8466('0x15')][_0x8466('0x16')]===0x1f4){logger[_0x8466('0x15')](_0x8466('0x10'),_0x40d13a,_0x39699a[_0x8466('0x15')][_0x8466('0x17')]);return _0x58f1d0(_0x39699a['error'][_0x8466('0x17')]);}logger[_0x8466('0x15')](_0x8466('0x10'),_0x40d13a,_0x39699a[_0x8466('0x15')]['message']);return _0xeab8b(_0x39699a[_0x8466('0x15')]['message']);}else{logger[_0x8466('0xf')](_0x8466('0x10'),_0x40d13a,'request\x20sent');_0xeab8b(_0x39699a[_0x8466('0x18')][_0x8466('0x17')]);}})['catch'](function(_0x131c7f){logger[_0x8466('0x15')](_0x8466('0x10'),_0x40d13a,_0x131c7f);_0x58f1d0(_0x131c7f);});});} \ No newline at end of file +var _0xf6cf=['message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code'];(function(_0x4fac8e,_0x4ce5bf){var _0x209b52=function(_0x238465){while(--_0x238465){_0x4fac8e['push'](_0x4fac8e['shift']());}};_0x209b52(++_0x4ce5bf);}(_0xf6cf,0x86));var _0xff6c=function(_0x5d58bf,_0x1bf489){_0x5d58bf=_0x5d58bf-0x0;var _0x4ee60c=_0xf6cf[_0x5d58bf];return _0x4ee60c;};'use strict';var _=require(_0xff6c('0x0'));var util=require(_0xff6c('0x1'));var moment=require('moment');var BPromise=require(_0xff6c('0x2'));var rs=require(_0xff6c('0x3'));var fs=require('fs');var Redis=require(_0xff6c('0x4'));var db=require(_0xff6c('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xff6c('0x6'));var config=require(_0xff6c('0x7'));var jayson=require(_0xff6c('0x8'));var client=jayson[_0xff6c('0x9')][_0xff6c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xd89ef9,_0x3d315a,_0x330641){return new BPromise(function(_0x2d91dd,_0x530b6f){return client[_0xff6c('0xb')](_0xd89ef9,_0x330641)[_0xff6c('0xc')](function(_0x4b5546){logger[_0xff6c('0xd')](_0xff6c('0xe'),_0x3d315a,'request\x20sent');logger[_0xff6c('0xf')](_0xff6c('0x10'),_0x3d315a,_0xff6c('0x11'),JSON['stringify'](_0x4b5546));if(_0x4b5546['error']){if(_0x4b5546[_0xff6c('0x12')][_0xff6c('0x13')]===0x1f4){logger['error'](_0xff6c('0xe'),_0x3d315a,_0x4b5546[_0xff6c('0x12')][_0xff6c('0x14')]);return _0x530b6f(_0x4b5546[_0xff6c('0x12')][_0xff6c('0x14')]);}logger[_0xff6c('0x12')]('ZendeskConfiguration,\x20%s,\x20%s',_0x3d315a,_0x4b5546[_0xff6c('0x12')][_0xff6c('0x14')]);return _0x2d91dd(_0x4b5546[_0xff6c('0x12')][_0xff6c('0x14')]);}else{logger[_0xff6c('0xd')](_0xff6c('0xe'),_0x3d315a,_0xff6c('0x11'));_0x2d91dd(_0x4b5546['result'][_0xff6c('0x14')]);}})[_0xff6c('0x15')](function(_0x2e083f){logger[_0xff6c('0x12')]('ZendeskConfiguration,\x20%s,\x20%s',_0x3d315a,_0x2e083f);_0x530b6f(_0x2e083f);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index a5cb185..e0e9c42 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 _0xf126=['update','delete','/:id','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intZendeskField.controller','get','index','isAuthenticated','post','create','put'];(function(_0x515c43,_0x9cfc36){var _0x383b71=function(_0x3d2193){while(--_0x3d2193){_0x515c43['push'](_0x515c43['shift']());}};_0x383b71(++_0x9cfc36);}(_0xf126,0x1ea));var _0x6f12=function(_0x53ed0b,_0x25e205){_0x53ed0b=_0x53ed0b-0x0;var _0x453628=_0xf126[_0x53ed0b];return _0x453628;};'use strict';var multer=require(_0x6f12('0x0'));var util=require('util');var path=require(_0x6f12('0x1'));var timeout=require(_0x6f12('0x2'));var express=require(_0x6f12('0x3'));var router=express[_0x6f12('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x6f12('0x5'));var interaction=require(_0x6f12('0x6'));var config=require('../../config/environment');var controller=require(_0x6f12('0x7'));router[_0x6f12('0x8')]('/',auth['isAuthenticated'](),controller[_0x6f12('0x9')]);router[_0x6f12('0x8')]('/:id',auth[_0x6f12('0xa')](),controller['show']);router[_0x6f12('0xb')]('/',auth['isAuthenticated'](),controller[_0x6f12('0xc')]);router[_0x6f12('0xd')]('/:id',auth[_0x6f12('0xa')](),controller[_0x6f12('0xe')]);router[_0x6f12('0xf')](_0x6f12('0x10'),auth[_0x6f12('0xa')](),controller['destroy']);module[_0x6f12('0x11')]=router; \ No newline at end of file +var _0x3ac8=['../../components/interaction/service','./intZendeskField.controller','get','index','/:id','show','isAuthenticated','create','put','update','delete','exports','path','express','fs-extra','../../components/auth/service'];(function(_0x3f6eaf,_0x4412f3){var _0x26863f=function(_0x2d7714){while(--_0x2d7714){_0x3f6eaf['push'](_0x3f6eaf['shift']());}};_0x26863f(++_0x4412f3);}(_0x3ac8,0xec));var _0x83ac=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3ac8[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x83ac('0x0'));var timeout=require('connect-timeout');var express=require(_0x83ac('0x1'));var router=express['Router']();var fs_extra=require(_0x83ac('0x2'));var auth=require(_0x83ac('0x3'));var interaction=require(_0x83ac('0x4'));var config=require('../../config/environment');var controller=require(_0x83ac('0x5'));router[_0x83ac('0x6')]('/',auth['isAuthenticated'](),controller[_0x83ac('0x7')]);router['get'](_0x83ac('0x8'),auth['isAuthenticated'](),controller[_0x83ac('0x9')]);router['post']('/',auth[_0x83ac('0xa')](),controller[_0x83ac('0xb')]);router[_0x83ac('0xc')]('/:id',auth[_0x83ac('0xa')](),controller[_0x83ac('0xd')]);router[_0x83ac('0xe')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x83ac('0xf')]=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index 570180a..01cabd8 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 _0x0612=['ENUM','string','variable','picklist','STRING','BOOLEAN','sequelize','exports'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x0612,0xf6));var _0x2061=function(_0x3f7852,_0x4871f4){_0x3f7852=_0x3f7852-0x0;var _0x5c68e7=_0x0612[_0x3f7852];return _0x5c68e7;};'use strict';var Sequelize=require(_0x2061('0x0'));module[_0x2061('0x1')]={'type':{'type':Sequelize[_0x2061('0x2')](_0x2061('0x3'),_0x2061('0x4'),'customVariable','keyValue',_0x2061('0x5')),'defaultValue':_0x2061('0x3')},'content':{'type':Sequelize[_0x2061('0x6')]},'key':{'type':Sequelize[_0x2061('0x6')]},'keyType':{'type':Sequelize[_0x2061('0x2')](_0x2061('0x3'),'variable','customVariable')},'keyContent':{'type':Sequelize[_0x2061('0x6')]},'idField':{'type':Sequelize[_0x2061('0x6')]},'nameField':{'type':Sequelize[_0x2061('0x6')]},'customField':{'type':Sequelize[_0x2061('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2061('0x6')]}}; \ No newline at end of file +var _0xca10=['customVariable','string','STRING','sequelize','ENUM','variable'];(function(_0x32c9c4,_0x45a1b0){var _0x487166=function(_0x3adb72){while(--_0x3adb72){_0x32c9c4['push'](_0x32c9c4['shift']());}};_0x487166(++_0x45a1b0);}(_0xca10,0x81));var _0x0ca1=function(_0x3489ac,_0x335423){_0x3489ac=_0x3489ac-0x0;var _0x38032c=_0xca10[_0x3489ac];return _0x38032c;};'use strict';var Sequelize=require(_0x0ca1('0x0'));module['exports']={'type':{'type':Sequelize[_0x0ca1('0x1')]('string',_0x0ca1('0x2'),_0x0ca1('0x3'),'keyValue','picklist'),'defaultValue':_0x0ca1('0x4')},'content':{'type':Sequelize[_0x0ca1('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x0ca1('0x1')]('string',_0x0ca1('0x2'),'customVariable')},'keyContent':{'type':Sequelize[_0x0ca1('0x5')]},'idField':{'type':Sequelize[_0x0ca1('0x5')]},'nameField':{'type':Sequelize[_0x0ca1('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x0ca1('0x5')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index fad7c49..25265c5 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 _0xc8de=['where','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','find','create','body','destroy','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','update','then','error','stack','name','send','index','ZendeskField','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','length','nolimit','sort','pick','filter'];(function(_0x46bd16,_0x53e22b){var _0xc1ccfb=function(_0x46d761){while(--_0x46d761){_0x46bd16['push'](_0x46bd16['shift']());}};_0xc1ccfb(++_0x53e22b);}(_0xc8de,0x167));var _0xec8d=function(_0x211e91,_0x3c2485){_0x211e91=_0x211e91-0x0;var _0x521acb=_0xc8de[_0x211e91];return _0x521acb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xec8d('0x0'));var zipdir=require(_0xec8d('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xec8d('0x2'));var BPromise=require(_0xec8d('0x3'));var Mustache=require(_0xec8d('0x4'));var util=require(_0xec8d('0x5'));var path=require(_0xec8d('0x6'));var sox=require(_0xec8d('0x7'));var csv=require(_0xec8d('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xec8d('0x9'));var _=require('lodash');var squel=require(_0xec8d('0xa'));var crypto=require('crypto');var jsforce=require(_0xec8d('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xec8d('0x8'));var querystring=require('querystring');var Papa=require(_0xec8d('0xc'));var Redis=require(_0xec8d('0xd'));var authService=require(_0xec8d('0xe'));var qs=require(_0xec8d('0xf'));var as=require(_0xec8d('0x10'));var hardwareService=require(_0xec8d('0x11'));var logger=require(_0xec8d('0x12'))(_0xec8d('0x13'));var utils=require(_0xec8d('0x14'));var config=require(_0xec8d('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xec8d('0x16'))['db'];function respondWithStatusCode(_0x3ce9f6,_0x194149){_0x194149=_0x194149||0xcc;return function(_0x3a5d6f){if(_0x3a5d6f){return _0x3ce9f6[_0xec8d('0x17')](_0x194149);}return _0x3ce9f6[_0xec8d('0x18')](_0x194149)[_0xec8d('0x19')]();};}function respondWithResult(_0x43b202,_0x10d84d){_0x10d84d=_0x10d84d||0xc8;return function(_0x445ac5){if(_0x445ac5){return _0x43b202[_0xec8d('0x18')](_0x10d84d)[_0xec8d('0x1a')](_0x445ac5);}};}function respondWithFilteredResult(_0x5f316b,_0x2666c2){return function(_0x27ad4a){if(_0x27ad4a){var _0x3b0c6d=typeof _0x2666c2[_0xec8d('0x1b')]==='undefined'&&typeof _0x2666c2[_0xec8d('0x1c')]==='undefined';var _0x4af8f2=_0x27ad4a[_0xec8d('0x1d')];var _0x3b32c8=_0x3b0c6d?0x0:_0x2666c2['offset'];var _0x2bdc72=_0x3b0c6d?_0x27ad4a[_0xec8d('0x1d')]:_0x2666c2[_0xec8d('0x1b')]+_0x2666c2[_0xec8d('0x1c')];var _0x5bdb09;if(_0x2bdc72>=_0x4af8f2){_0x2bdc72=_0x4af8f2;_0x5bdb09=0xc8;}else{_0x5bdb09=0xce;}_0x5f316b['status'](_0x5bdb09);return _0x5f316b[_0xec8d('0x1e')]('Content-Range',_0x3b32c8+'-'+_0x2bdc72+'/'+_0x4af8f2)[_0xec8d('0x1a')](_0x27ad4a);}return null;};}function patchUpdates(_0x19d8f0){return function(_0x83ee70){try{jsonpatch['apply'](_0x83ee70,_0x19d8f0,!![]);}catch(_0x52e5c7){return BPromise['reject'](_0x52e5c7);}return _0x83ee70['save']();};}function saveUpdates(_0x376b4c,_0x154b78){return function(_0x5ed185){if(_0x5ed185){return _0x5ed185[_0xec8d('0x1f')](_0x376b4c)[_0xec8d('0x20')](function(_0x252d96){return _0x252d96;});}return null;};}function removeEntity(_0x5b6f89,_0x1ce3be){return function(_0xa2ad0a){if(_0xa2ad0a){return _0xa2ad0a['destroy']()[_0xec8d('0x20')](function(){_0x5b6f89[_0xec8d('0x18')](0xcc)[_0xec8d('0x19')]();});}};}function handleEntityNotFound(_0x3e90fe,_0x1e8561){return function(_0x2d4e04){if(!_0x2d4e04){_0x3e90fe['sendStatus'](0x194);}return _0x2d4e04;};}function handleError(_0x33983a,_0xdb1709){_0xdb1709=_0xdb1709||0x1f4;return function(_0x59ab92){logger[_0xec8d('0x21')](_0x59ab92[_0xec8d('0x22')]);if(_0x59ab92['name']){delete _0x59ab92[_0xec8d('0x23')];}_0x33983a[_0xec8d('0x18')](_0xdb1709)[_0xec8d('0x24')](_0x59ab92);};}exports[_0xec8d('0x25')]=function(_0x5ea99d,_0x33faf0){var _0x2da751={},_0x5de0ec={},_0x5946ec={'count':0x0,'rows':[]};var _0x41e264=_['map'](db[_0xec8d('0x26')][_0xec8d('0x27')],function(_0x4368df){return{'name':_0x4368df[_0xec8d('0x28')],'type':_0x4368df[_0xec8d('0x29')][_0xec8d('0x2a')]};});_0x5de0ec[_0xec8d('0x2b')]=_[_0xec8d('0x2c')](_0x41e264,_0xec8d('0x23'));_0x5de0ec['query']=_[_0xec8d('0x2d')](_0x5ea99d[_0xec8d('0x2e')]);_0x5de0ec[_0xec8d('0x2f')]=_[_0xec8d('0x30')](_0x5de0ec[_0xec8d('0x2b')],_0x5de0ec[_0xec8d('0x2e')]);_0x2da751[_0xec8d('0x31')]=_[_0xec8d('0x30')](_0x5de0ec[_0xec8d('0x2b')],qs['fields'](_0x5ea99d[_0xec8d('0x2e')]['fields']));_0x2da751[_0xec8d('0x31')]=_0x2da751[_0xec8d('0x31')][_0xec8d('0x32')]?_0x2da751[_0xec8d('0x31')]:_0x5de0ec[_0xec8d('0x2b')];if(!_0x5ea99d[_0xec8d('0x2e')]['hasOwnProperty'](_0xec8d('0x33'))){_0x2da751[_0xec8d('0x1c')]=qs[_0xec8d('0x1c')](_0x5ea99d[_0xec8d('0x2e')][_0xec8d('0x1c')]);_0x2da751['offset']=qs['offset'](_0x5ea99d[_0xec8d('0x2e')][_0xec8d('0x1b')]);}_0x2da751['order']=qs[_0xec8d('0x34')](_0x5ea99d['query']['sort']);_0x2da751['where']=qs[_0xec8d('0x2f')](_[_0xec8d('0x35')](_0x5ea99d['query'],_0x5de0ec[_0xec8d('0x2f')]),_0x41e264);if(_0x5ea99d[_0xec8d('0x2e')][_0xec8d('0x36')]){_0x2da751['where']=_['merge'](_0x2da751[_0xec8d('0x37')],{'$or':_[_0xec8d('0x2c')](_0x41e264,function(_0x49d15){if(_0x49d15[_0xec8d('0x29')]!==_0xec8d('0x38')){var _0x389e7f={};_0x389e7f[_0x49d15[_0xec8d('0x23')]]={'$like':'%'+_0x5ea99d[_0xec8d('0x2e')][_0xec8d('0x36')]+'%'};return _0x389e7f;}})});}_0x2da751=_[_0xec8d('0x39')]({},_0x2da751,_0x5ea99d[_0xec8d('0x3a')]);var _0x31b4bb={'where':_0x2da751['where']};return db[_0xec8d('0x26')]['count'](_0x31b4bb)['then'](function(_0x495a38){_0x5946ec[_0xec8d('0x1d')]=_0x495a38;if(_0x5ea99d[_0xec8d('0x2e')][_0xec8d('0x3b')]){_0x2da751[_0xec8d('0x3c')]=[{'all':!![]}];}return db[_0xec8d('0x26')][_0xec8d('0x3d')](_0x2da751);})[_0xec8d('0x20')](function(_0x200a63){_0x5946ec[_0xec8d('0x3e')]=_0x200a63;return _0x5946ec;})[_0xec8d('0x20')](respondWithFilteredResult(_0x33faf0,_0x2da751))[_0xec8d('0x3f')](handleError(_0x33faf0,null));};exports['show']=function(_0x1b5c05,_0x59c171){var _0x396578={'raw':!![],'where':{'id':_0x1b5c05[_0xec8d('0x40')]['id']}},_0x399b2b={};_0x399b2b[_0xec8d('0x2b')]=_[_0xec8d('0x2d')](db[_0xec8d('0x26')][_0xec8d('0x27')]);_0x399b2b[_0xec8d('0x2e')]=_['keys'](_0x1b5c05[_0xec8d('0x2e')]);_0x399b2b['filters']=_[_0xec8d('0x30')](_0x399b2b[_0xec8d('0x2b')],_0x399b2b[_0xec8d('0x2e')]);_0x396578[_0xec8d('0x31')]=_[_0xec8d('0x30')](_0x399b2b[_0xec8d('0x2b')],qs['fields'](_0x1b5c05[_0xec8d('0x2e')]['fields']));_0x396578[_0xec8d('0x31')]=_0x396578['attributes'][_0xec8d('0x32')]?_0x396578['attributes']:_0x399b2b[_0xec8d('0x2b')];if(_0x1b5c05[_0xec8d('0x2e')][_0xec8d('0x3b')]){_0x396578[_0xec8d('0x3c')]=[{'all':!![]}];}_0x396578=_[_0xec8d('0x39')]({},_0x396578,_0x1b5c05[_0xec8d('0x3a')]);return db[_0xec8d('0x26')][_0xec8d('0x41')](_0x396578)[_0xec8d('0x20')](handleEntityNotFound(_0x59c171,null))[_0xec8d('0x20')](respondWithResult(_0x59c171,null))[_0xec8d('0x3f')](handleError(_0x59c171,null));};exports[_0xec8d('0x42')]=function(_0x30f73b,_0x238e5a){return db[_0xec8d('0x26')][_0xec8d('0x42')](_0x30f73b[_0xec8d('0x43')],{})[_0xec8d('0x20')](respondWithResult(_0x238e5a,0xc9))['catch'](handleError(_0x238e5a,null));};exports[_0xec8d('0x1f')]=function(_0x462a84,_0x282898){if(_0x462a84[_0xec8d('0x43')]['id']){delete _0x462a84['body']['id'];}return db[_0xec8d('0x26')][_0xec8d('0x41')]({'where':{'id':_0x462a84[_0xec8d('0x40')]['id']}})[_0xec8d('0x20')](handleEntityNotFound(_0x282898,null))[_0xec8d('0x20')](saveUpdates(_0x462a84[_0xec8d('0x43')],null))[_0xec8d('0x20')](respondWithResult(_0x282898,null))['catch'](handleError(_0x282898,null));};exports[_0xec8d('0x44')]=function(_0x4a69b1,_0x579c2e){return db[_0xec8d('0x26')][_0xec8d('0x41')]({'where':{'id':_0x4a69b1['params']['id']}})['then'](handleEntityNotFound(_0x579c2e,null))[_0xec8d('0x20')](removeEntity(_0x579c2e,null))[_0xec8d('0x3f')](handleError(_0x579c2e,null));}; \ No newline at end of file +var _0x1bca=['index','map','fieldName','key','model','keys','filters','intersection','fields','attributes','query','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','create','ZendeskField','body','find','rimraf','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','update','destroy','then','error','stack','send'];(function(_0x521305,_0x3538ef){var _0x4be36e=function(_0x10fe5c){while(--_0x10fe5c){_0x521305['push'](_0x521305['shift']());}};_0x4be36e(++_0x3538ef);}(_0x1bca,0xb6));var _0xa1bc=function(_0x19caf9,_0x1263f6){_0x19caf9=_0x19caf9-0x0;var _0x4d21fb=_0x1bca[_0x19caf9];return _0x4d21fb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xa1bc('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xa1bc('0x1'));var moment=require('moment');var BPromise=require(_0xa1bc('0x2'));var Mustache=require(_0xa1bc('0x3'));var util=require(_0xa1bc('0x4'));var path=require('path');var sox=require(_0xa1bc('0x5'));var csv=require(_0xa1bc('0x6'));var ejs=require(_0xa1bc('0x7'));var fs=require('fs');var fs_extra=require(_0xa1bc('0x8'));var _=require('lodash');var squel=require(_0xa1bc('0x9'));var crypto=require(_0xa1bc('0xa'));var jsforce=require(_0xa1bc('0xb'));var deskjs=require(_0xa1bc('0xc'));var toCsv=require(_0xa1bc('0x6'));var querystring=require(_0xa1bc('0xd'));var Papa=require(_0xa1bc('0xe'));var Redis=require('ioredis');var authService=require(_0xa1bc('0xf'));var qs=require(_0xa1bc('0x10'));var as=require(_0xa1bc('0x11'));var hardwareService=require(_0xa1bc('0x12'));var logger=require(_0xa1bc('0x13'))(_0xa1bc('0x14'));var utils=require(_0xa1bc('0x15'));var config=require(_0xa1bc('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1f65bc,_0x37913b){_0x37913b=_0x37913b||0xcc;return function(_0x2b38cf){if(_0x2b38cf){return _0x1f65bc[_0xa1bc('0x17')](_0x37913b);}return _0x1f65bc[_0xa1bc('0x18')](_0x37913b)[_0xa1bc('0x19')]();};}function respondWithResult(_0x165acf,_0x2c5f01){_0x2c5f01=_0x2c5f01||0xc8;return function(_0xe0d028){if(_0xe0d028){return _0x165acf[_0xa1bc('0x18')](_0x2c5f01)[_0xa1bc('0x1a')](_0xe0d028);}};}function respondWithFilteredResult(_0x5a22e0,_0x565bc2){return function(_0xdb513d){if(_0xdb513d){var _0xf8c08e=typeof _0x565bc2[_0xa1bc('0x1b')]===_0xa1bc('0x1c')&&typeof _0x565bc2[_0xa1bc('0x1d')]===_0xa1bc('0x1c');var _0x36b899=_0xdb513d[_0xa1bc('0x1e')];var _0x4765be=_0xf8c08e?0x0:_0x565bc2['offset'];var _0x510046=_0xf8c08e?_0xdb513d[_0xa1bc('0x1e')]:_0x565bc2[_0xa1bc('0x1b')]+_0x565bc2[_0xa1bc('0x1d')];var _0x2b0410;if(_0x510046>=_0x36b899){_0x510046=_0x36b899;_0x2b0410=0xc8;}else{_0x2b0410=0xce;}_0x5a22e0['status'](_0x2b0410);return _0x5a22e0['set'](_0xa1bc('0x1f'),_0x4765be+'-'+_0x510046+'/'+_0x36b899)[_0xa1bc('0x1a')](_0xdb513d);}return null;};}function patchUpdates(_0x322703){return function(_0x95a766){try{jsonpatch[_0xa1bc('0x20')](_0x95a766,_0x322703,!![]);}catch(_0x3e8cd7){return BPromise['reject'](_0x3e8cd7);}return _0x95a766[_0xa1bc('0x21')]();};}function saveUpdates(_0xc81195,_0x1e4f4e){return function(_0x4fdf7d){if(_0x4fdf7d){return _0x4fdf7d[_0xa1bc('0x22')](_0xc81195)['then'](function(_0x10636d){return _0x10636d;});}return null;};}function removeEntity(_0x44f952,_0x23d67d){return function(_0x2a77a2){if(_0x2a77a2){return _0x2a77a2[_0xa1bc('0x23')]()[_0xa1bc('0x24')](function(){_0x44f952['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3cc2e0,_0x3a87f4){return function(_0x5eff38){if(!_0x5eff38){_0x3cc2e0[_0xa1bc('0x17')](0x194);}return _0x5eff38;};}function handleError(_0x31d31c,_0x14e37b){_0x14e37b=_0x14e37b||0x1f4;return function(_0x2a0348){logger[_0xa1bc('0x25')](_0x2a0348[_0xa1bc('0x26')]);if(_0x2a0348['name']){delete _0x2a0348['name'];}_0x31d31c[_0xa1bc('0x18')](_0x14e37b)[_0xa1bc('0x27')](_0x2a0348);};}exports[_0xa1bc('0x28')]=function(_0x1270f5,_0x16a9d7){var _0x4ae5d0={},_0x228fc8={},_0x512608={'count':0x0,'rows':[]};var _0x332201=_[_0xa1bc('0x29')](db['ZendeskField']['rawAttributes'],function(_0x4a120c){return{'name':_0x4a120c[_0xa1bc('0x2a')],'type':_0x4a120c['type'][_0xa1bc('0x2b')]};});_0x228fc8[_0xa1bc('0x2c')]=_[_0xa1bc('0x29')](_0x332201,'name');_0x228fc8['query']=_[_0xa1bc('0x2d')](_0x1270f5['query']);_0x228fc8[_0xa1bc('0x2e')]=_[_0xa1bc('0x2f')](_0x228fc8[_0xa1bc('0x2c')],_0x228fc8['query']);_0x4ae5d0['attributes']=_['intersection'](_0x228fc8[_0xa1bc('0x2c')],qs[_0xa1bc('0x30')](_0x1270f5['query'][_0xa1bc('0x30')]));_0x4ae5d0[_0xa1bc('0x31')]=_0x4ae5d0[_0xa1bc('0x31')]['length']?_0x4ae5d0[_0xa1bc('0x31')]:_0x228fc8[_0xa1bc('0x2c')];if(!_0x1270f5[_0xa1bc('0x32')]['hasOwnProperty'](_0xa1bc('0x33'))){_0x4ae5d0[_0xa1bc('0x1d')]=qs[_0xa1bc('0x1d')](_0x1270f5[_0xa1bc('0x32')][_0xa1bc('0x1d')]);_0x4ae5d0[_0xa1bc('0x1b')]=qs[_0xa1bc('0x1b')](_0x1270f5[_0xa1bc('0x32')]['offset']);}_0x4ae5d0[_0xa1bc('0x34')]=qs[_0xa1bc('0x35')](_0x1270f5[_0xa1bc('0x32')][_0xa1bc('0x35')]);_0x4ae5d0['where']=qs[_0xa1bc('0x2e')](_[_0xa1bc('0x36')](_0x1270f5['query'],_0x228fc8[_0xa1bc('0x2e')]),_0x332201);if(_0x1270f5[_0xa1bc('0x32')][_0xa1bc('0x37')]){_0x4ae5d0[_0xa1bc('0x38')]=_[_0xa1bc('0x39')](_0x4ae5d0['where'],{'$or':_[_0xa1bc('0x29')](_0x332201,function(_0x14c645){if(_0x14c645[_0xa1bc('0x3a')]!==_0xa1bc('0x3b')){var _0x3abf84={};_0x3abf84[_0x14c645['name']]={'$like':'%'+_0x1270f5[_0xa1bc('0x32')][_0xa1bc('0x37')]+'%'};return _0x3abf84;}})});}_0x4ae5d0=_[_0xa1bc('0x39')]({},_0x4ae5d0,_0x1270f5[_0xa1bc('0x3c')]);var _0xf9b275={'where':_0x4ae5d0['where']};return db['ZendeskField']['count'](_0xf9b275)[_0xa1bc('0x24')](function(_0x57160e){_0x512608[_0xa1bc('0x1e')]=_0x57160e;if(_0x1270f5[_0xa1bc('0x32')][_0xa1bc('0x3d')]){_0x4ae5d0[_0xa1bc('0x3e')]=[{'all':!![]}];}return db['ZendeskField'][_0xa1bc('0x3f')](_0x4ae5d0);})['then'](function(_0x482d37){_0x512608[_0xa1bc('0x40')]=_0x482d37;return _0x512608;})['then'](respondWithFilteredResult(_0x16a9d7,_0x4ae5d0))[_0xa1bc('0x41')](handleError(_0x16a9d7,null));};exports[_0xa1bc('0x42')]=function(_0x5d6c5c,_0x1d8e3c){var _0x5cd49d={'raw':!![],'where':{'id':_0x5d6c5c[_0xa1bc('0x43')]['id']}},_0x1544c8={};_0x1544c8[_0xa1bc('0x2c')]=_[_0xa1bc('0x2d')](db['ZendeskField'][_0xa1bc('0x44')]);_0x1544c8[_0xa1bc('0x32')]=_['keys'](_0x5d6c5c[_0xa1bc('0x32')]);_0x1544c8[_0xa1bc('0x2e')]=_[_0xa1bc('0x2f')](_0x1544c8[_0xa1bc('0x2c')],_0x1544c8[_0xa1bc('0x32')]);_0x5cd49d[_0xa1bc('0x31')]=_[_0xa1bc('0x2f')](_0x1544c8[_0xa1bc('0x2c')],qs[_0xa1bc('0x30')](_0x5d6c5c[_0xa1bc('0x32')][_0xa1bc('0x30')]));_0x5cd49d[_0xa1bc('0x31')]=_0x5cd49d[_0xa1bc('0x31')][_0xa1bc('0x45')]?_0x5cd49d['attributes']:_0x1544c8[_0xa1bc('0x2c')];if(_0x5d6c5c['query'][_0xa1bc('0x3d')]){_0x5cd49d[_0xa1bc('0x3e')]=[{'all':!![]}];}_0x5cd49d=_[_0xa1bc('0x39')]({},_0x5cd49d,_0x5d6c5c[_0xa1bc('0x3c')]);return db['ZendeskField']['find'](_0x5cd49d)['then'](handleEntityNotFound(_0x1d8e3c,null))['then'](respondWithResult(_0x1d8e3c,null))['catch'](handleError(_0x1d8e3c,null));};exports[_0xa1bc('0x46')]=function(_0x5cc542,_0x2dfad5){return db[_0xa1bc('0x47')][_0xa1bc('0x46')](_0x5cc542[_0xa1bc('0x48')],{})['then'](respondWithResult(_0x2dfad5,0xc9))[_0xa1bc('0x41')](handleError(_0x2dfad5,null));};exports[_0xa1bc('0x22')]=function(_0x3fa784,_0x3eb3d7){if(_0x3fa784[_0xa1bc('0x48')]['id']){delete _0x3fa784['body']['id'];}return db[_0xa1bc('0x47')][_0xa1bc('0x49')]({'where':{'id':_0x3fa784[_0xa1bc('0x43')]['id']}})[_0xa1bc('0x24')](handleEntityNotFound(_0x3eb3d7,null))['then'](saveUpdates(_0x3fa784['body'],null))['then'](respondWithResult(_0x3eb3d7,null))[_0xa1bc('0x41')](handleError(_0x3eb3d7,null));};exports[_0xa1bc('0x23')]=function(_0x5b3b1,_0x274684){return db[_0xa1bc('0x47')]['find']({'where':{'id':_0x5b3b1['params']['id']}})[_0xa1bc('0x24')](handleEntityNotFound(_0x274684,null))[_0xa1bc('0x24')](removeEntity(_0x274684,null))[_0xa1bc('0x41')](handleError(_0x274684,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index c06842b..9ef57bc 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 _0xb373=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','ZendeskField','int_zendesk_fields','zendesk_unique_index','idField','FieldId'];(function(_0x316c70,_0x211df0){var _0x1be905=function(_0x4b3a79){while(--_0x4b3a79){_0x316c70['push'](_0x316c70['shift']());}};_0x1be905(++_0x211df0);}(_0xb373,0x110));var _0x3b37=function(_0x5e1e17,_0x57f65b){_0x5e1e17=_0x5e1e17-0x0;var _0x40f960=_0xb373[_0x5e1e17];return _0x40f960;};'use strict';var _=require(_0x3b37('0x0'));var util=require(_0x3b37('0x1'));var logger=require(_0x3b37('0x2'))(_0x3b37('0x3'));var moment=require(_0x3b37('0x4'));var BPromise=require(_0x3b37('0x5'));var rp=require(_0x3b37('0x6'));var fs=require('fs');var path=require(_0x3b37('0x7'));var rimraf=require(_0x3b37('0x8'));var config=require(_0x3b37('0x9'));var attributes=require('./intZendeskField.attributes');module['exports']=function(_0x5c56a6,_0x66e006){return _0x5c56a6[_0x3b37('0xa')](_0x3b37('0xb'),attributes,{'tableName':_0x3b37('0xc'),'paranoid':![],'indexes':[{'name':_0x3b37('0xd'),'fields':[_0x3b37('0xe'),_0x3b37('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2733=['./intZendeskField.attributes','exports','define','ZendeskField','int_zendesk_fields','idField','FieldId','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x1961b,_0x5e1672){var _0x2d516b=function(_0x213e73){while(--_0x213e73){_0x1961b['push'](_0x1961b['shift']());}};_0x2d516b(++_0x5e1672);}(_0x2733,0xac));var _0x3273=function(_0x1a72f3,_0x217011){_0x1a72f3=_0x1a72f3-0x0;var _0x57ef47=_0x2733[_0x1a72f3];return _0x57ef47;};'use strict';var _=require(_0x3273('0x0'));var util=require(_0x3273('0x1'));var logger=require(_0x3273('0x2'))(_0x3273('0x3'));var moment=require(_0x3273('0x4'));var BPromise=require('bluebird');var rp=require(_0x3273('0x5'));var fs=require('fs');var path=require(_0x3273('0x6'));var rimraf=require(_0x3273('0x7'));var config=require('../../config/environment');var attributes=require(_0x3273('0x8'));module[_0x3273('0x9')]=function(_0x1a2372,_0x58d581){return _0x1a2372[_0x3273('0xa')](_0x3273('0xb'),attributes,{'tableName':_0x3273('0xc'),'paranoid':![],'indexes':[{'name':'zendesk_unique_index','fields':[_0x3273('0xd'),_0x3273('0xe')],'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 ce17058..1462e8e 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 _0x7213=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','ZendeskField,\x20%s,\x20%s','ZendeskField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x13ab39,_0x2df003){var _0x10fb5c=function(_0x3c3c84){while(--_0x3c3c84){_0x13ab39['push'](_0x13ab39['shift']());}};_0x10fb5c(++_0x2df003);}(_0x7213,0x123));var _0x3721=function(_0x2188cd,_0x5d70ca){_0x2188cd=_0x2188cd-0x0;var _0x5c1b21=_0x7213[_0x2188cd];return _0x5c1b21;};'use strict';var _=require(_0x3721('0x0'));var util=require(_0x3721('0x1'));var moment=require(_0x3721('0x2'));var BPromise=require(_0x3721('0x3'));var rs=require(_0x3721('0x4'));var fs=require('fs');var Redis=require(_0x3721('0x5'));var db=require(_0x3721('0x6'))['db'];var utils=require(_0x3721('0x7'));var logger=require(_0x3721('0x8'))('rpc');var config=require(_0x3721('0x9'));var jayson=require(_0x3721('0xa'));var client=jayson[_0x3721('0xb')][_0x3721('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x47defe,_0x1566c5,_0x4e49b3){return new BPromise(function(_0x13dba1,_0x247068){return client[_0x3721('0xd')](_0x47defe,_0x4e49b3)['then'](function(_0x45ef25){logger[_0x3721('0xe')](_0x3721('0xf'),_0x1566c5,'request\x20sent');logger['debug'](_0x3721('0x10'),_0x1566c5,_0x3721('0x11'),JSON[_0x3721('0x12')](_0x45ef25));if(_0x45ef25['error']){if(_0x45ef25[_0x3721('0x13')][_0x3721('0x14')]===0x1f4){logger[_0x3721('0x13')](_0x3721('0xf'),_0x1566c5,_0x45ef25[_0x3721('0x13')][_0x3721('0x15')]);return _0x247068(_0x45ef25['error'][_0x3721('0x15')]);}logger[_0x3721('0x13')]('ZendeskField,\x20%s,\x20%s',_0x1566c5,_0x45ef25['error'][_0x3721('0x15')]);return _0x13dba1(_0x45ef25[_0x3721('0x13')][_0x3721('0x15')]);}else{logger['info'](_0x3721('0xf'),_0x1566c5,_0x3721('0x11'));_0x13dba1(_0x45ef25[_0x3721('0x16')][_0x3721('0x15')]);}})[_0x3721('0x17')](function(_0x19fc0d){logger[_0x3721('0x13')](_0x3721('0xf'),_0x1566c5,_0x19fc0d);_0x247068(_0x19fc0d);});});} \ No newline at end of file +var _0xafe6=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','info','ZendeskField,\x20%s,\x20%s','request\x20sent','debug','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird'];(function(_0x3a2770,_0x34ffe0){var _0x5dcc6c=function(_0x5bc632){while(--_0x5bc632){_0x3a2770['push'](_0x3a2770['shift']());}};_0x5dcc6c(++_0x34ffe0);}(_0xafe6,0x9d));var _0x6afe=function(_0xb5ec02,_0x3b1304){_0xb5ec02=_0xb5ec02-0x0;var _0x19320f=_0xafe6[_0xb5ec02];return _0x19320f;};'use strict';var _=require(_0x6afe('0x0'));var util=require(_0x6afe('0x1'));var moment=require(_0x6afe('0x2'));var BPromise=require(_0x6afe('0x3'));var rs=require(_0x6afe('0x4'));var fs=require('fs');var Redis=require(_0x6afe('0x5'));var db=require(_0x6afe('0x6'))['db'];var utils=require(_0x6afe('0x7'));var logger=require(_0x6afe('0x8'))('rpc');var config=require(_0x6afe('0x9'));var jayson=require(_0x6afe('0xa'));var client=jayson[_0x6afe('0xb')][_0x6afe('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3856af,_0x4a1652,_0x517f34){return new BPromise(function(_0x2ffe26,_0x7488fe){return client['request'](_0x3856af,_0x517f34)['then'](function(_0x38c8d6){logger[_0x6afe('0xd')](_0x6afe('0xe'),_0x4a1652,_0x6afe('0xf'));logger[_0x6afe('0x10')](_0x6afe('0x11'),_0x4a1652,'request\x20sent',JSON[_0x6afe('0x12')](_0x38c8d6));if(_0x38c8d6[_0x6afe('0x13')]){if(_0x38c8d6[_0x6afe('0x13')]['code']===0x1f4){logger['error']('ZendeskField,\x20%s,\x20%s',_0x4a1652,_0x38c8d6['error'][_0x6afe('0x14')]);return _0x7488fe(_0x38c8d6['error'][_0x6afe('0x14')]);}logger['error']('ZendeskField,\x20%s,\x20%s',_0x4a1652,_0x38c8d6[_0x6afe('0x13')][_0x6afe('0x14')]);return _0x2ffe26(_0x38c8d6['error']['message']);}else{logger[_0x6afe('0xd')](_0x6afe('0xe'),_0x4a1652,_0x6afe('0xf'));_0x2ffe26(_0x38c8d6[_0x6afe('0x15')][_0x6afe('0x14')]);}})[_0x6afe('0x16')](function(_0xeb4272){logger[_0x6afe('0x13')](_0x6afe('0xe'),_0x4a1652,_0xeb4272);_0x7488fe(_0xeb4272);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index faaf491..83d408b 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 _0x2665=['/:id/configurations','put','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./intZohoAccount.controller','isAuthenticated','index','get','/:id','show','getConfigurations'];(function(_0xfd9b19,_0x21d75f){var _0x514918=function(_0x52e212){while(--_0x52e212){_0xfd9b19['push'](_0xfd9b19['shift']());}};_0x514918(++_0x21d75f);}(_0x2665,0x77));var _0x5266=function(_0x270ae5,_0x29a696){_0x270ae5=_0x270ae5-0x0;var _0x4e55f0=_0x2665[_0x270ae5];return _0x4e55f0;};'use strict';var multer=require(_0x5266('0x0'));var util=require(_0x5266('0x1'));var path=require('path');var timeout=require(_0x5266('0x2'));var express=require(_0x5266('0x3'));var router=express[_0x5266('0x4')]();var fs_extra=require(_0x5266('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x5266('0x6'));var config=require('../../config/environment');var controller=require(_0x5266('0x7'));router['get']('/',auth[_0x5266('0x8')](),controller[_0x5266('0x9')]);router[_0x5266('0xa')](_0x5266('0xb'),auth['isAuthenticated'](),controller[_0x5266('0xc')]);router[_0x5266('0xa')]('/:id/configurations',auth[_0x5266('0x8')](),controller[_0x5266('0xd')]);router[_0x5266('0xa')]('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router['post']('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x5266('0xe'),auth[_0x5266('0x8')](),controller['addConfiguration']);router[_0x5266('0xf')](_0x5266('0xb'),auth[_0x5266('0x8')](),controller['update']);router[_0x5266('0x10')](_0x5266('0xb'),auth[_0x5266('0x8')](),controller[_0x5266('0x11')]);module[_0x5266('0x12')]=router; \ No newline at end of file +var _0x2036=['getConfigurations','/:id/fields','isAuthenticated','getFields','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./intZohoAccount.controller','index','get','/:id','/:id/configurations'];(function(_0x2a50f7,_0x4c5ed1){var _0x5123ec=function(_0x552d41){while(--_0x552d41){_0x2a50f7['push'](_0x2a50f7['shift']());}};_0x5123ec(++_0x4c5ed1);}(_0x2036,0x196));var _0x6203=function(_0x44f63c,_0x34b07d){_0x44f63c=_0x44f63c-0x0;var _0x68ae76=_0x2036[_0x44f63c];return _0x68ae76;};'use strict';var multer=require(_0x6203('0x0'));var util=require(_0x6203('0x1'));var path=require(_0x6203('0x2'));var timeout=require(_0x6203('0x3'));var express=require(_0x6203('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x6203('0x5'));var config=require(_0x6203('0x6'));var controller=require(_0x6203('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x6203('0x8')]);router[_0x6203('0x9')](_0x6203('0xa'),auth['isAuthenticated'](),controller['show']);router['get'](_0x6203('0xb'),auth['isAuthenticated'](),controller[_0x6203('0xc')]);router[_0x6203('0x9')](_0x6203('0xd'),auth[_0x6203('0xe')](),controller[_0x6203('0xf')]);router[_0x6203('0x10')]('/',auth[_0x6203('0xe')](),controller[_0x6203('0x11')]);router[_0x6203('0x10')](_0x6203('0xb'),auth[_0x6203('0xe')](),controller['addConfiguration']);router[_0x6203('0x12')](_0x6203('0xa'),auth['isAuthenticated'](),controller[_0x6203('0x13')]);router[_0x6203('0x14')](_0x6203('0xa'),auth[_0x6203('0xe')](),controller[_0x6203('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index 99a0e8d..a238761 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 _0x9bde=['STRING','exports'];(function(_0x1acc2d,_0x597696){var _0xabfa6d=function(_0x41e83c){while(--_0x41e83c){_0x1acc2d['push'](_0x1acc2d['shift']());}};_0xabfa6d(++_0x597696);}(_0x9bde,0xe1));var _0xe9bd=function(_0x3b2ac1,_0x2f35a9){_0x3b2ac1=_0x3b2ac1-0x0;var _0x573d7a=_0x9bde[_0x3b2ac1];return _0x573d7a;};'use strict';var Sequelize=require('sequelize');module[_0xe9bd('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xe9bd('0x1')]},'host':{'type':Sequelize['STRING']},'zone':{'type':Sequelize[_0xe9bd('0x1')]},'clientId':{'type':Sequelize[_0xe9bd('0x1')]},'clientSecret':{'type':Sequelize[_0xe9bd('0x1')]},'serverUrl':{'type':Sequelize[_0xe9bd('0x1')],'allowNull':![]},'code':{'type':Sequelize[_0xe9bd('0x1')]},'refreshToken':{'type':Sequelize[_0xe9bd('0x1')]}}; \ No newline at end of file +var _0x91a7=['STRING','exports'];(function(_0x4d965d,_0x5781da){var _0x490ed4=function(_0x5525fc){while(--_0x5525fc){_0x4d965d['push'](_0x4d965d['shift']());}};_0x490ed4(++_0x5781da);}(_0x91a7,0xe7));var _0x791a=function(_0x2a7691,_0x4d3240){_0x2a7691=_0x2a7691-0x0;var _0x3d003c=_0x91a7[_0x2a7691];return _0x3d003c;};'use strict';var Sequelize=require('sequelize');module[_0x791a('0x0')]={'name':{'type':Sequelize[_0x791a('0x1')]},'description':{'type':Sequelize[_0x791a('0x1')]},'host':{'type':Sequelize['STRING']},'zone':{'type':Sequelize[_0x791a('0x1')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0x791a('0x1')]},'serverUrl':{'type':Sequelize['STRING'],'allowNull':![]},'code':{'type':Sequelize['STRING']},'refreshToken':{'type':Sequelize[_0x791a('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index b789082..41212bf 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 _0x02fb=['where','pick','filter','merge','options','findAll','rows','catch','show','keys','includeAll','include','find','create','body','params','ZohoConfiguration','length','order','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','type','ZohoField','Descriptions','zone','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.eu','POST','/oauth/v2/token','refreshToken','clientId','refresh_token','access_token','getFields','findOne','host','clientSecret','serverUrl','zoho.eu','com','slice','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','message','Subject','WhoId','Call_Duration','Call_Result','Call_Start_Time','remove','includes','system_mandatory','display_label','data_type','picklist','pick_list_values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','fast-json-patch','request-promise','bluebird','mustache','sox','ejs','fs-extra','squel','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../components/integrations/configuration','sendStatus','status','limit','undefined','count','offset','set','Content-Range','apply','save','then','destroy','error','stack','send','index','map','ZohoAccount','rawAttributes','fieldName','key','model','name','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort'];(function(_0x2cb552,_0x3807a9){var _0x16aa22=function(_0x22f99b){while(--_0x22f99b){_0x2cb552['push'](_0x2cb552['shift']());}};_0x16aa22(++_0x3807a9);}(_0x02fb,0x1b0));var _0xb02f=function(_0x7eb67f,_0x4a4d6b){_0x7eb67f=_0x7eb67f-0x0;var _0x5ce007=_0x02fb[_0x7eb67f];return _0x5ce007;};'use strict';var emlformat=require(_0xb02f('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xb02f('0x1'));var rp=require(_0xb02f('0x2'));var moment=require('moment');var BPromise=require(_0xb02f('0x3'));var Mustache=require(_0xb02f('0x4'));var util=require('util');var path=require('path');var sox=require(_0xb02f('0x5'));var csv=require('to-csv');var ejs=require(_0xb02f('0x6'));var fs=require('fs');var fs_extra=require(_0xb02f('0x7'));var _=require('lodash');var squel=require(_0xb02f('0x8'));var crypto=require('crypto');var jsforce=require(_0xb02f('0x9'));var deskjs=require(_0xb02f('0xa'));var toCsv=require(_0xb02f('0xb'));var querystring=require('querystring');var Papa=require(_0xb02f('0xc'));var Redis=require('ioredis');var authService=require(_0xb02f('0xd'));var qs=require(_0xb02f('0xe'));var as=require(_0xb02f('0xf'));var hardwareService=require(_0xb02f('0x10'));var logger=require('../../config/logger')(_0xb02f('0x11'));var utils=require(_0xb02f('0x12'));var config=require(_0xb02f('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var integrations=require(_0xb02f('0x14'));function respondWithStatusCode(_0x1f15e7,_0xbdfd24){_0xbdfd24=_0xbdfd24||0xcc;return function(_0x29e302){if(_0x29e302){return _0x1f15e7[_0xb02f('0x15')](_0xbdfd24);}return _0x1f15e7[_0xb02f('0x16')](_0xbdfd24)['end']();};}function respondWithResult(_0x257958,_0x4b0e89){_0x4b0e89=_0x4b0e89||0xc8;return function(_0xac9fa){if(_0xac9fa){return _0x257958['status'](_0x4b0e89)['json'](_0xac9fa);}};}function respondWithFilteredResult(_0x47e40e,_0x29d96d){return function(_0x335a27){if(_0x335a27){var _0x4d35e8=typeof _0x29d96d['offset']==='undefined'&&typeof _0x29d96d[_0xb02f('0x17')]===_0xb02f('0x18');var _0x8c2952=_0x335a27[_0xb02f('0x19')];var _0x440aa8=_0x4d35e8?0x0:_0x29d96d[_0xb02f('0x1a')];var _0x1a67f1=_0x4d35e8?_0x335a27[_0xb02f('0x19')]:_0x29d96d[_0xb02f('0x1a')]+_0x29d96d[_0xb02f('0x17')];var _0x436cd9;if(_0x1a67f1>=_0x8c2952){_0x1a67f1=_0x8c2952;_0x436cd9=0xc8;}else{_0x436cd9=0xce;}_0x47e40e[_0xb02f('0x16')](_0x436cd9);return _0x47e40e[_0xb02f('0x1b')](_0xb02f('0x1c'),_0x440aa8+'-'+_0x1a67f1+'/'+_0x8c2952)['json'](_0x335a27);}return null;};}function patchUpdates(_0x8b38ec){return function(_0x1df072){try{jsonpatch[_0xb02f('0x1d')](_0x1df072,_0x8b38ec,!![]);}catch(_0x327bd9){return BPromise['reject'](_0x327bd9);}return _0x1df072[_0xb02f('0x1e')]();};}function saveUpdates(_0x317d1e,_0x5b2d51){return function(_0x5ac62f){if(_0x5ac62f){return _0x5ac62f['update'](_0x317d1e)[_0xb02f('0x1f')](function(_0x24bd5a){return _0x24bd5a;});}return null;};}function removeEntity(_0x2f686e,_0x1c4b51){return function(_0x3abb22){if(_0x3abb22){return _0x3abb22[_0xb02f('0x20')]()[_0xb02f('0x1f')](function(){_0x2f686e[_0xb02f('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x912dc,_0x4708f8){return function(_0x1935b0){if(!_0x1935b0){_0x912dc[_0xb02f('0x15')](0x194);}return _0x1935b0;};}function handleError(_0x1f8efb,_0x5115cf){_0x5115cf=_0x5115cf||0x1f4;return function(_0x6a7b60){logger[_0xb02f('0x21')](_0x6a7b60[_0xb02f('0x22')]);if(_0x6a7b60['name']){delete _0x6a7b60['name'];}_0x1f8efb[_0xb02f('0x16')](_0x5115cf)[_0xb02f('0x23')](_0x6a7b60);};}exports[_0xb02f('0x24')]=function(_0xa290e9,_0x4bf65a){var _0x2bb442={},_0x4c9fae={},_0x56a2e6={'count':0x0,'rows':[]};var _0x302282=_[_0xb02f('0x25')](db[_0xb02f('0x26')][_0xb02f('0x27')],function(_0x4c7848){return{'name':_0x4c7848[_0xb02f('0x28')],'type':_0x4c7848['type'][_0xb02f('0x29')]};});_0x4c9fae[_0xb02f('0x2a')]=_[_0xb02f('0x25')](_0x302282,_0xb02f('0x2b'));_0x4c9fae[_0xb02f('0x2c')]=_['keys'](_0xa290e9[_0xb02f('0x2c')]);_0x4c9fae[_0xb02f('0x2d')]=_[_0xb02f('0x2e')](_0x4c9fae['model'],_0x4c9fae['query']);_0x2bb442[_0xb02f('0x2f')]=_[_0xb02f('0x2e')](_0x4c9fae[_0xb02f('0x2a')],qs[_0xb02f('0x30')](_0xa290e9[_0xb02f('0x2c')][_0xb02f('0x30')]));_0x2bb442[_0xb02f('0x2f')]=_0x2bb442[_0xb02f('0x2f')]['length']?_0x2bb442[_0xb02f('0x2f')]:_0x4c9fae[_0xb02f('0x2a')];if(!_0xa290e9[_0xb02f('0x2c')][_0xb02f('0x31')](_0xb02f('0x32'))){_0x2bb442['limit']=qs['limit'](_0xa290e9['query'][_0xb02f('0x17')]);_0x2bb442[_0xb02f('0x1a')]=qs[_0xb02f('0x1a')](_0xa290e9[_0xb02f('0x2c')]['offset']);}_0x2bb442['order']=qs[_0xb02f('0x33')](_0xa290e9[_0xb02f('0x2c')][_0xb02f('0x33')]);_0x2bb442[_0xb02f('0x34')]=qs[_0xb02f('0x2d')](_[_0xb02f('0x35')](_0xa290e9[_0xb02f('0x2c')],_0x4c9fae['filters']),_0x302282);if(_0xa290e9[_0xb02f('0x2c')][_0xb02f('0x36')]){_0x2bb442[_0xb02f('0x34')]=_[_0xb02f('0x37')](_0x2bb442[_0xb02f('0x34')],{'$or':_[_0xb02f('0x25')](_0x302282,function(_0x51d49f){if(_0x51d49f['type']!=='VIRTUAL'){var _0x12379f={};_0x12379f[_0x51d49f['name']]={'$like':'%'+_0xa290e9['query'][_0xb02f('0x36')]+'%'};return _0x12379f;}})});}_0x2bb442=_[_0xb02f('0x37')]({},_0x2bb442,_0xa290e9[_0xb02f('0x38')]);var _0x42712e={'where':_0x2bb442['where']};return db[_0xb02f('0x26')][_0xb02f('0x19')](_0x42712e)[_0xb02f('0x1f')](function(_0x50ecaf){_0x56a2e6[_0xb02f('0x19')]=_0x50ecaf;if(_0xa290e9['query']['includeAll']){_0x2bb442['include']=[{'all':!![]}];}return db[_0xb02f('0x26')][_0xb02f('0x39')](_0x2bb442);})[_0xb02f('0x1f')](function(_0x49550e){_0x56a2e6[_0xb02f('0x3a')]=_0x49550e;return _0x56a2e6;})[_0xb02f('0x1f')](respondWithFilteredResult(_0x4bf65a,_0x2bb442))[_0xb02f('0x3b')](handleError(_0x4bf65a,null));};exports[_0xb02f('0x3c')]=function(_0x4e858d,_0x55ce1e){var _0x83b735={'raw':![],'where':{'id':_0x4e858d['params']['id']}},_0x5d1f7e={};_0x5d1f7e[_0xb02f('0x2a')]=_['keys'](db['ZohoAccount'][_0xb02f('0x27')]);_0x5d1f7e[_0xb02f('0x2c')]=_[_0xb02f('0x3d')](_0x4e858d[_0xb02f('0x2c')]);_0x5d1f7e[_0xb02f('0x2d')]=_[_0xb02f('0x2e')](_0x5d1f7e[_0xb02f('0x2a')],_0x5d1f7e[_0xb02f('0x2c')]);_0x83b735['attributes']=_[_0xb02f('0x2e')](_0x5d1f7e['model'],qs[_0xb02f('0x30')](_0x4e858d[_0xb02f('0x2c')]['fields']));_0x83b735[_0xb02f('0x2f')]=_0x83b735[_0xb02f('0x2f')]['length']?_0x83b735['attributes']:_0x5d1f7e[_0xb02f('0x2a')];if(_0x4e858d[_0xb02f('0x2c')][_0xb02f('0x3e')]){_0x83b735[_0xb02f('0x3f')]=[{'all':!![]}];}_0x83b735=_[_0xb02f('0x37')]({},_0x83b735,_0x4e858d[_0xb02f('0x38')]);return db[_0xb02f('0x26')][_0xb02f('0x40')](_0x83b735)[_0xb02f('0x1f')](handleEntityNotFound(_0x55ce1e,null))[_0xb02f('0x1f')](respondWithResult(_0x55ce1e,null))[_0xb02f('0x3b')](handleError(_0x55ce1e,null));};exports[_0xb02f('0x41')]=function(_0x4c1f85,_0x161d72){return db[_0xb02f('0x26')]['create'](_0x4c1f85['body'],{})[_0xb02f('0x1f')](respondWithResult(_0x161d72,0xc9))['catch'](handleError(_0x161d72,null));};exports['update']=function(_0xdf3168,_0x48b748){if(_0xdf3168['body']['id']){delete _0xdf3168['body']['id'];}return db[_0xb02f('0x26')][_0xb02f('0x40')]({'where':{'id':_0xdf3168['params']['id']}})[_0xb02f('0x1f')](handleEntityNotFound(_0x48b748,null))[_0xb02f('0x1f')](saveUpdates(_0xdf3168[_0xb02f('0x42')],null))[_0xb02f('0x1f')](respondWithResult(_0x48b748,null))[_0xb02f('0x3b')](handleError(_0x48b748,null));};exports[_0xb02f('0x20')]=function(_0x2f4aab,_0x454b30){return db[_0xb02f('0x26')][_0xb02f('0x40')]({'where':{'id':_0x2f4aab[_0xb02f('0x43')]['id']}})['then'](handleEntityNotFound(_0x454b30,null))[_0xb02f('0x1f')](removeEntity(_0x454b30,null))[_0xb02f('0x3b')](handleError(_0x454b30,null));};exports['getConfigurations']=function(_0x5635d3,_0x3f22f9,_0x2c7a47){var _0x557fd5={};var _0x2a1a5a={};var _0x739aa7;var _0x27f24b;return db['ZohoAccount']['findOne']({'where':{'id':_0x5635d3[_0xb02f('0x43')]['id']}})['then'](handleEntityNotFound(_0x3f22f9,null))[_0xb02f('0x1f')](function(_0x1665de){if(_0x1665de){_0x739aa7=_0x1665de;_0x2a1a5a['model']=_[_0xb02f('0x3d')](db[_0xb02f('0x44')][_0xb02f('0x27')]);_0x2a1a5a['query']=_[_0xb02f('0x3d')](_0x5635d3['query']);_0x2a1a5a[_0xb02f('0x2d')]=_[_0xb02f('0x2e')](_0x2a1a5a[_0xb02f('0x2a')],_0x2a1a5a['query']);_0x557fd5[_0xb02f('0x2f')]=_[_0xb02f('0x2e')](_0x2a1a5a[_0xb02f('0x2a')],qs['fields'](_0x5635d3[_0xb02f('0x2c')]['fields']));_0x557fd5['attributes']=_0x557fd5['attributes'][_0xb02f('0x45')]?_0x557fd5['attributes']:_0x2a1a5a[_0xb02f('0x2a')];_0x557fd5[_0xb02f('0x46')]=qs[_0xb02f('0x33')](_0x5635d3[_0xb02f('0x2c')]['sort']);_0x557fd5[_0xb02f('0x34')]=qs[_0xb02f('0x2d')](_[_0xb02f('0x35')](_0x5635d3[_0xb02f('0x2c')],_0x2a1a5a[_0xb02f('0x2d')]));if(_0x5635d3[_0xb02f('0x2c')][_0xb02f('0x36')]){_0x557fd5[_0xb02f('0x34')]=_[_0xb02f('0x37')](_0x557fd5['where'],{'$or':_[_0xb02f('0x25')](_0x557fd5['attributes'],function(_0x430d2a){var _0x1624a4={};_0x1624a4[_0x430d2a]={'$like':'%'+_0x5635d3[_0xb02f('0x2c')]['filter']+'%'};return _0x1624a4;})});}_0x557fd5=_['merge']({},_0x557fd5,_0x5635d3['options']);return _0x739aa7[_0xb02f('0x47')](_0x557fd5);}})['then'](function(_0x24258a){if(_0x24258a){_0x27f24b=_0x24258a[_0xb02f('0x45')];if(!_0x5635d3[_0xb02f('0x2c')][_0xb02f('0x31')](_0xb02f('0x32'))){_0x557fd5[_0xb02f('0x17')]=qs[_0xb02f('0x17')](_0x5635d3['query'][_0xb02f('0x17')]);_0x557fd5[_0xb02f('0x1a')]=qs[_0xb02f('0x1a')](_0x5635d3[_0xb02f('0x2c')][_0xb02f('0x1a')]);}return _0x739aa7[_0xb02f('0x47')](_0x557fd5);}})['then'](function(_0x1045c9){if(_0x1045c9){return _0x1045c9?{'count':_0x27f24b,'rows':_0x1045c9}:null;}})[_0xb02f('0x1f')](respondWithResult(_0x3f22f9,null))[_0xb02f('0x3b')](handleError(_0x3f22f9,null));};exports[_0xb02f('0x48')]=function(_0x498926,_0x1a9a8f,_0x54bfd1){if(_0x498926[_0xb02f('0x42')]['id']){delete _0x498926[_0xb02f('0x42')]['id'];}return db[_0xb02f('0x26')]['findOne']({'where':{'id':_0x498926[_0xb02f('0x43')]['id']}})['then'](handleEntityNotFound(_0x1a9a8f,null))[_0xb02f('0x1f')](function(_0x3cd7fb){if(_0x3cd7fb){_0x498926[_0xb02f('0x42')][_0xb02f('0x49')]=_0x3cd7fb['id'];_0x498926[_0xb02f('0x42')][_0xb02f('0x4a')]=integrations[_0xb02f('0x4b')](_0x498926[_0xb02f('0x42')]['channel'],_0x498926[_0xb02f('0x42')]['type']);_0x498926[_0xb02f('0x42')]['Descriptions']=integrations['getDescriptions'](_0x498926['body']['channel'],_0x498926[_0xb02f('0x42')][_0xb02f('0x4c')]);return db[_0xb02f('0x44')][_0xb02f('0x41')](_0x498926['body'],{'include':[{'model':db[_0xb02f('0x4d')],'as':'Subjects'},{'model':db[_0xb02f('0x4d')],'as':_0xb02f('0x4e')}]});}return null;})[_0xb02f('0x1f')](respondWithResult(_0x1a9a8f,null))[_0xb02f('0x3b')](handleError(_0x1a9a8f,null));};function getAccessToken(_0x4457c3){return new Promise(function(_0x551cbb,_0x5c7648){var _0x259ade;switch(_0x4457c3[_0xb02f('0x4f')]){case'US':_0x259ade='https://accounts.zoho.com';break;case'AU':_0x259ade=_0xb02f('0x50');break;case'EU':_0x259ade='https://accounts.zoho.eu';break;case'IN':_0x259ade=_0xb02f('0x51');break;case'CN':_0x259ade='https://accounts.zoho.com.cn';break;default:_0x259ade=_0xb02f('0x52');break;}var _0x4780b7={'method':_0xb02f('0x53'),'uri':_0x259ade+_0xb02f('0x54'),'qs':{'refresh_token':_0x4457c3[_0xb02f('0x55')],'client_id':_0x4457c3[_0xb02f('0x56')],'client_secret':_0x4457c3['clientSecret'],'grant_type':_0xb02f('0x57')},'json':!![]};return rp(_0x4780b7)['then'](function(_0x3e1464){if(_0x3e1464['access_token']){_0x551cbb(_0x3e1464[_0xb02f('0x58')]);}else{_0x5c7648('Unable\x20to\x20retrieve\x20the\x20access\x20token');}})[_0xb02f('0x3b')](function(_0x472464){_0x5c7648(_0x472464);});});}exports[_0xb02f('0x59')]=function(_0x5bfef9,_0x4655c6,_0x495e03){var _0x49c8b6,_0x177ebf,_0x4c1ddc,_0x1bb145,_0x55c985;return db[_0xb02f('0x26')][_0xb02f('0x5a')]({'where':{'id':_0x5bfef9[_0xb02f('0x43')]['id']},'attributes':['id',_0xb02f('0x5b'),_0xb02f('0x4f'),'clientId',_0xb02f('0x5c'),_0xb02f('0x5d'),'code',_0xb02f('0x55')]})[_0xb02f('0x1f')](handleEntityNotFound(_0x4655c6,null))[_0xb02f('0x1f')](function(_0x5eda90){_0x55c985=_0x5eda90;_0x49c8b6=_0x55c985[_0xb02f('0x5b')];_0x177ebf=_0x49c8b6===_0xb02f('0x5e')?'eu':_0xb02f('0x5f');_0x4c1ddc=_0x55c985[_0xb02f('0x5d')];var _0x33a96a=_0x4c1ddc[_0xb02f('0x60')](-0x1);if(_0x33a96a==='/'||_0x33a96a==='\x5c'||_0x33a96a===':'){_0x4c1ddc=_0x4c1ddc['substring'](0x0,_0x4c1ddc[_0xb02f('0x61')](_0x33a96a));}if(!_0x55c985[_0xb02f('0x55')]){throw new Error(_0xb02f('0x62'));}return getAccessToken(_0x55c985);})['then'](function(_0x2c3a7a){if(_0x2c3a7a){return rp({'method':'GET','uri':util[_0xb02f('0x63')](_0xb02f('0x64'),_0x177ebf),'qs':{'module':_0xb02f('0x65')},'headers':{'Authorization':_0xb02f('0x66')+_0x2c3a7a},'json':!![]});}})['then'](function(_0x390372){if(_0x390372){if(_0x390372['response']&&_0x390372[_0xb02f('0x67')][_0xb02f('0x21')]){throw new Error(_0x390372[_0xb02f('0x67')]['error'][_0xb02f('0x68')]);}var _0x5f5ca0=[];var _0x33e0e4=[];var _0x2b21d6=['Owner',_0xb02f('0x69'),'Description',_0xb02f('0x6a'),_0xb02f('0x6b'),_0xb02f('0x6c'),_0xb02f('0x6d'),'Call_Type'];_0x33e0e4=_[_0xb02f('0x6e')](_0x390372[_0xb02f('0x30')],function(_0x58f941){return _0x2b21d6[_0xb02f('0x6f')](_0x58f941['api_name']);});for(var _0x4e5790=0x0;_0x4e5790<_0x33e0e4[_0xb02f('0x45')];_0x4e5790++){if(_0x33e0e4[_0x4e5790][_0xb02f('0x70')]===![]){_0x5f5ca0['push']({'id':_0x33e0e4[_0x4e5790]['id'],'name':_0x33e0e4[_0x4e5790][_0xb02f('0x71')],'custom':_0x33e0e4[_0x4e5790]['custom_field'],'options':_0x33e0e4[_0x4e5790][_0xb02f('0x72')]===_0xb02f('0x73')&&_0x33e0e4[_0x4e5790]['pick_list_values']['length']>-0x1?_[_0xb02f('0x25')](_0x33e0e4[_0x4e5790][_0xb02f('0x74')],function(_0x2fe114){return{'name':_0x2fe114,'value':_0x2fe114};}):[]});}}return{'count':_0x5f5ca0[_0xb02f('0x45')],'rows':_0x5f5ca0};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithResult(_0x4655c6,null))[_0xb02f('0x3b')](function(_0x3c55c4){var _0x3a9479=_0x5bfef9[_0xb02f('0x2c')][_0xb02f('0x75')]?0x1f4:_0x3c55c4[_0xb02f('0x76')]||0x1f4;logger[_0xb02f('0x21')](_0xb02f('0x77'),_0xb02f('0x59'),_0x3a9479,JSON['stringify'](_0x3c55c4));delete _0x3c55c4['name'];if(_0x3a9479===0x191){_0x3a9479=0x190;}_0x4655c6['status'](_0x3a9479)['send'](_0x5bfef9[_0xb02f('0x2c')][_0xb02f('0x75')]?{'message':_0xb02f('0x78'),'statusCode':_0x3c55c4[_0xb02f('0x76')]}:_0x3c55c4);});}; \ No newline at end of file +var _0x989b=['Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','response','message','Subject','Description','WhoId','Call_Duration','Call_Start_Time','Call_Type','includes','api_name','system_mandatory','push','display_label','data_type','pick_list_values','getFields,\x20%s,\x20%s,\x20%s','test','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','request-promise','moment','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/environment','../../mysqldb','../../components/integrations/configuration','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','error','stack','send','map','rawAttributes','fieldName','type','key','name','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','ZohoAccount','includeAll','include','rows','catch','show','params','find','create','body','destroy','getConfigurations','findOne','ZohoConfiguration','AccountId','Subjects','getSubjects','channel','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','POST','/oauth/v2/token','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','clientId','code','refreshToken','host','com','serverUrl','slice','substring','lastIndexOf'];(function(_0xc14df7,_0x163f90){var _0x34a445=function(_0x1bbf28){while(--_0x1bbf28){_0xc14df7['push'](_0xc14df7['shift']());}};_0x34a445(++_0x163f90);}(_0x989b,0x198));var _0xb989=function(_0x7fc50d,_0x2f3f9f){_0x7fc50d=_0x7fc50d-0x0;var _0x2a5212=_0x989b[_0x7fc50d];return _0x2a5212;};'use strict';var emlformat=require(_0xb989('0x0'));var rimraf=require(_0xb989('0x1'));var zipdir=require(_0xb989('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb989('0x3'));var moment=require(_0xb989('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xb989('0x5'));var util=require('util');var path=require('path');var sox=require(_0xb989('0x6'));var csv=require(_0xb989('0x7'));var ejs=require(_0xb989('0x8'));var fs=require('fs');var fs_extra=require(_0xb989('0x9'));var _=require(_0xb989('0xa'));var squel=require(_0xb989('0xb'));var crypto=require(_0xb989('0xc'));var jsforce=require(_0xb989('0xd'));var deskjs=require(_0xb989('0xe'));var toCsv=require('to-csv');var querystring=require(_0xb989('0xf'));var Papa=require(_0xb989('0x10'));var Redis=require(_0xb989('0x11'));var authService=require(_0xb989('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xb989('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xb989('0x14'));var utils=require('../../config/utils');var config=require(_0xb989('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xb989('0x16'))['db'];var integrations=require(_0xb989('0x17'));function respondWithStatusCode(_0x39fcb8,_0x1b72d2){_0x1b72d2=_0x1b72d2||0xcc;return function(_0x288651){if(_0x288651){return _0x39fcb8[_0xb989('0x18')](_0x1b72d2);}return _0x39fcb8[_0xb989('0x19')](_0x1b72d2)[_0xb989('0x1a')]();};}function respondWithResult(_0x2ab280,_0x4372a8){_0x4372a8=_0x4372a8||0xc8;return function(_0x3b2d7d){if(_0x3b2d7d){return _0x2ab280[_0xb989('0x19')](_0x4372a8)['json'](_0x3b2d7d);}};}function respondWithFilteredResult(_0x2bd9c8,_0x54f25d){return function(_0x2d945b){if(_0x2d945b){var _0x291ff5=typeof _0x54f25d[_0xb989('0x1b')]===_0xb989('0x1c')&&typeof _0x54f25d[_0xb989('0x1d')]===_0xb989('0x1c');var _0x2ac3d2=_0x2d945b[_0xb989('0x1e')];var _0x2d25dc=_0x291ff5?0x0:_0x54f25d[_0xb989('0x1b')];var _0xd17768=_0x291ff5?_0x2d945b[_0xb989('0x1e')]:_0x54f25d[_0xb989('0x1b')]+_0x54f25d[_0xb989('0x1d')];var _0x125b76;if(_0xd17768>=_0x2ac3d2){_0xd17768=_0x2ac3d2;_0x125b76=0xc8;}else{_0x125b76=0xce;}_0x2bd9c8[_0xb989('0x19')](_0x125b76);return _0x2bd9c8['set'](_0xb989('0x1f'),_0x2d25dc+'-'+_0xd17768+'/'+_0x2ac3d2)[_0xb989('0x20')](_0x2d945b);}return null;};}function patchUpdates(_0x27c2c0){return function(_0x23c433){try{jsonpatch[_0xb989('0x21')](_0x23c433,_0x27c2c0,!![]);}catch(_0x49b842){return BPromise[_0xb989('0x22')](_0x49b842);}return _0x23c433[_0xb989('0x23')]();};}function saveUpdates(_0x364d72,_0x19695a){return function(_0x58a67a){if(_0x58a67a){return _0x58a67a[_0xb989('0x24')](_0x364d72)[_0xb989('0x25')](function(_0x1f2e79){return _0x1f2e79;});}return null;};}function removeEntity(_0xdaab05,_0x1e41dd){return function(_0x173ceb){if(_0x173ceb){return _0x173ceb['destroy']()[_0xb989('0x25')](function(){_0xdaab05[_0xb989('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x54601e,_0x2f9786){return function(_0x1f30bd){if(!_0x1f30bd){_0x54601e[_0xb989('0x18')](0x194);}return _0x1f30bd;};}function handleError(_0x3db01b,_0x55b438){_0x55b438=_0x55b438||0x1f4;return function(_0x2702c4){logger[_0xb989('0x26')](_0x2702c4[_0xb989('0x27')]);if(_0x2702c4['name']){delete _0x2702c4['name'];}_0x3db01b['status'](_0x55b438)[_0xb989('0x28')](_0x2702c4);};}exports['index']=function(_0x590158,_0x115f16){var _0x20cfc4={},_0x254e10={},_0x5beed1={'count':0x0,'rows':[]};var _0x3c1af1=_[_0xb989('0x29')](db['ZohoAccount'][_0xb989('0x2a')],function(_0x13bec7){return{'name':_0x13bec7[_0xb989('0x2b')],'type':_0x13bec7[_0xb989('0x2c')][_0xb989('0x2d')]};});_0x254e10['model']=_[_0xb989('0x29')](_0x3c1af1,_0xb989('0x2e'));_0x254e10[_0xb989('0x2f')]=_[_0xb989('0x30')](_0x590158[_0xb989('0x2f')]);_0x254e10[_0xb989('0x31')]=_['intersection'](_0x254e10[_0xb989('0x32')],_0x254e10['query']);_0x20cfc4[_0xb989('0x33')]=_[_0xb989('0x34')](_0x254e10[_0xb989('0x32')],qs[_0xb989('0x35')](_0x590158[_0xb989('0x2f')]['fields']));_0x20cfc4[_0xb989('0x33')]=_0x20cfc4['attributes'][_0xb989('0x36')]?_0x20cfc4[_0xb989('0x33')]:_0x254e10['model'];if(!_0x590158[_0xb989('0x2f')][_0xb989('0x37')]('nolimit')){_0x20cfc4[_0xb989('0x1d')]=qs['limit'](_0x590158['query'][_0xb989('0x1d')]);_0x20cfc4[_0xb989('0x1b')]=qs[_0xb989('0x1b')](_0x590158[_0xb989('0x2f')][_0xb989('0x1b')]);}_0x20cfc4[_0xb989('0x38')]=qs[_0xb989('0x39')](_0x590158['query'][_0xb989('0x39')]);_0x20cfc4[_0xb989('0x3a')]=qs[_0xb989('0x31')](_[_0xb989('0x3b')](_0x590158['query'],_0x254e10[_0xb989('0x31')]),_0x3c1af1);if(_0x590158['query'][_0xb989('0x3c')]){_0x20cfc4[_0xb989('0x3a')]=_[_0xb989('0x3d')](_0x20cfc4['where'],{'$or':_[_0xb989('0x29')](_0x3c1af1,function(_0x5db71f){if(_0x5db71f['type']!==_0xb989('0x3e')){var _0x20ca95={};_0x20ca95[_0x5db71f[_0xb989('0x2e')]]={'$like':'%'+_0x590158[_0xb989('0x2f')]['filter']+'%'};return _0x20ca95;}})});}_0x20cfc4=_[_0xb989('0x3d')]({},_0x20cfc4,_0x590158[_0xb989('0x3f')]);var _0x44ba86={'where':_0x20cfc4[_0xb989('0x3a')]};return db[_0xb989('0x40')][_0xb989('0x1e')](_0x44ba86)[_0xb989('0x25')](function(_0x4408a0){_0x5beed1[_0xb989('0x1e')]=_0x4408a0;if(_0x590158['query'][_0xb989('0x41')]){_0x20cfc4[_0xb989('0x42')]=[{'all':!![]}];}return db['ZohoAccount']['findAll'](_0x20cfc4);})[_0xb989('0x25')](function(_0x50d55b){_0x5beed1[_0xb989('0x43')]=_0x50d55b;return _0x5beed1;})[_0xb989('0x25')](respondWithFilteredResult(_0x115f16,_0x20cfc4))[_0xb989('0x44')](handleError(_0x115f16,null));};exports[_0xb989('0x45')]=function(_0x5e3fab,_0x1dca05){var _0x33eed0={'raw':![],'where':{'id':_0x5e3fab[_0xb989('0x46')]['id']}},_0x94aa63={};_0x94aa63['model']=_[_0xb989('0x30')](db[_0xb989('0x40')][_0xb989('0x2a')]);_0x94aa63[_0xb989('0x2f')]=_['keys'](_0x5e3fab['query']);_0x94aa63[_0xb989('0x31')]=_['intersection'](_0x94aa63['model'],_0x94aa63[_0xb989('0x2f')]);_0x33eed0['attributes']=_[_0xb989('0x34')](_0x94aa63['model'],qs[_0xb989('0x35')](_0x5e3fab[_0xb989('0x2f')][_0xb989('0x35')]));_0x33eed0[_0xb989('0x33')]=_0x33eed0['attributes'][_0xb989('0x36')]?_0x33eed0[_0xb989('0x33')]:_0x94aa63['model'];if(_0x5e3fab[_0xb989('0x2f')]['includeAll']){_0x33eed0[_0xb989('0x42')]=[{'all':!![]}];}_0x33eed0=_['merge']({},_0x33eed0,_0x5e3fab[_0xb989('0x3f')]);return db[_0xb989('0x40')][_0xb989('0x47')](_0x33eed0)[_0xb989('0x25')](handleEntityNotFound(_0x1dca05,null))[_0xb989('0x25')](respondWithResult(_0x1dca05,null))[_0xb989('0x44')](handleError(_0x1dca05,null));};exports[_0xb989('0x48')]=function(_0x441f2d,_0x4c8579){return db[_0xb989('0x40')][_0xb989('0x48')](_0x441f2d[_0xb989('0x49')],{})[_0xb989('0x25')](respondWithResult(_0x4c8579,0xc9))[_0xb989('0x44')](handleError(_0x4c8579,null));};exports['update']=function(_0x3c6b8f,_0x192880){if(_0x3c6b8f[_0xb989('0x49')]['id']){delete _0x3c6b8f[_0xb989('0x49')]['id'];}return db['ZohoAccount'][_0xb989('0x47')]({'where':{'id':_0x3c6b8f[_0xb989('0x46')]['id']}})['then'](handleEntityNotFound(_0x192880,null))[_0xb989('0x25')](saveUpdates(_0x3c6b8f['body'],null))['then'](respondWithResult(_0x192880,null))[_0xb989('0x44')](handleError(_0x192880,null));};exports[_0xb989('0x4a')]=function(_0xfbb3ad,_0x3dfb5d){return db[_0xb989('0x40')][_0xb989('0x47')]({'where':{'id':_0xfbb3ad['params']['id']}})[_0xb989('0x25')](handleEntityNotFound(_0x3dfb5d,null))[_0xb989('0x25')](removeEntity(_0x3dfb5d,null))[_0xb989('0x44')](handleError(_0x3dfb5d,null));};exports[_0xb989('0x4b')]=function(_0x153e16,_0x43c350,_0x1ce085){var _0x9f2761={};var _0x12c94c={};var _0x585b11;var _0x35cb39;return db['ZohoAccount'][_0xb989('0x4c')]({'where':{'id':_0x153e16['params']['id']}})['then'](handleEntityNotFound(_0x43c350,null))['then'](function(_0x1a23cd){if(_0x1a23cd){_0x585b11=_0x1a23cd;_0x12c94c['model']=_[_0xb989('0x30')](db[_0xb989('0x4d')][_0xb989('0x2a')]);_0x12c94c['query']=_[_0xb989('0x30')](_0x153e16[_0xb989('0x2f')]);_0x12c94c[_0xb989('0x31')]=_[_0xb989('0x34')](_0x12c94c[_0xb989('0x32')],_0x12c94c['query']);_0x9f2761[_0xb989('0x33')]=_[_0xb989('0x34')](_0x12c94c['model'],qs['fields'](_0x153e16[_0xb989('0x2f')][_0xb989('0x35')]));_0x9f2761['attributes']=_0x9f2761['attributes'][_0xb989('0x36')]?_0x9f2761[_0xb989('0x33')]:_0x12c94c[_0xb989('0x32')];_0x9f2761[_0xb989('0x38')]=qs['sort'](_0x153e16['query']['sort']);_0x9f2761['where']=qs['filters'](_[_0xb989('0x3b')](_0x153e16[_0xb989('0x2f')],_0x12c94c[_0xb989('0x31')]));if(_0x153e16[_0xb989('0x2f')][_0xb989('0x3c')]){_0x9f2761[_0xb989('0x3a')]=_[_0xb989('0x3d')](_0x9f2761[_0xb989('0x3a')],{'$or':_[_0xb989('0x29')](_0x9f2761[_0xb989('0x33')],function(_0x429147){var _0x260847={};_0x260847[_0x429147]={'$like':'%'+_0x153e16[_0xb989('0x2f')]['filter']+'%'};return _0x260847;})});}_0x9f2761=_[_0xb989('0x3d')]({},_0x9f2761,_0x153e16[_0xb989('0x3f')]);return _0x585b11['getConfigurations'](_0x9f2761);}})['then'](function(_0x505bd0){if(_0x505bd0){_0x35cb39=_0x505bd0[_0xb989('0x36')];if(!_0x153e16[_0xb989('0x2f')][_0xb989('0x37')]('nolimit')){_0x9f2761[_0xb989('0x1d')]=qs[_0xb989('0x1d')](_0x153e16['query'][_0xb989('0x1d')]);_0x9f2761[_0xb989('0x1b')]=qs[_0xb989('0x1b')](_0x153e16[_0xb989('0x2f')][_0xb989('0x1b')]);}return _0x585b11[_0xb989('0x4b')](_0x9f2761);}})[_0xb989('0x25')](function(_0x3e862f){if(_0x3e862f){return _0x3e862f?{'count':_0x35cb39,'rows':_0x3e862f}:null;}})[_0xb989('0x25')](respondWithResult(_0x43c350,null))[_0xb989('0x44')](handleError(_0x43c350,null));};exports['addConfiguration']=function(_0x83b49e,_0x58da61,_0x1fff44){if(_0x83b49e[_0xb989('0x49')]['id']){delete _0x83b49e[_0xb989('0x49')]['id'];}return db[_0xb989('0x40')]['findOne']({'where':{'id':_0x83b49e['params']['id']}})[_0xb989('0x25')](handleEntityNotFound(_0x58da61,null))[_0xb989('0x25')](function(_0x48934d){if(_0x48934d){_0x83b49e[_0xb989('0x49')][_0xb989('0x4e')]=_0x48934d['id'];_0x83b49e[_0xb989('0x49')][_0xb989('0x4f')]=integrations[_0xb989('0x50')](_0x83b49e[_0xb989('0x49')][_0xb989('0x51')],_0x83b49e[_0xb989('0x49')][_0xb989('0x2c')]);_0x83b49e['body']['Descriptions']=integrations['getDescriptions'](_0x83b49e[_0xb989('0x49')][_0xb989('0x51')],_0x83b49e[_0xb989('0x49')]['type']);return db['ZohoConfiguration'][_0xb989('0x48')](_0x83b49e[_0xb989('0x49')],{'include':[{'model':db[_0xb989('0x52')],'as':_0xb989('0x4f')},{'model':db[_0xb989('0x52')],'as':'Descriptions'}]});}return null;})[_0xb989('0x25')](respondWithResult(_0x58da61,null))[_0xb989('0x44')](handleError(_0x58da61,null));};function getAccessToken(_0x1108f0){return new Promise(function(_0x482624,_0x103e15){var _0x130f20;switch(_0x1108f0[_0xb989('0x53')]){case'US':_0x130f20=_0xb989('0x54');break;case'AU':_0x130f20=_0xb989('0x55');break;case'EU':_0x130f20=_0xb989('0x56');break;case'IN':_0x130f20=_0xb989('0x57');break;case'CN':_0x130f20='https://accounts.zoho.com.cn';break;default:_0x130f20=_0xb989('0x56');break;}var _0x24edf1={'method':_0xb989('0x58'),'uri':_0x130f20+_0xb989('0x59'),'qs':{'refresh_token':_0x1108f0['refreshToken'],'client_id':_0x1108f0['clientId'],'client_secret':_0x1108f0[_0xb989('0x5a')],'grant_type':_0xb989('0x5b')},'json':!![]};return rp(_0x24edf1)[_0xb989('0x25')](function(_0x394144){if(_0x394144['access_token']){_0x482624(_0x394144[_0xb989('0x5c')]);}else{_0x103e15(_0xb989('0x5d'));}})[_0xb989('0x44')](function(_0x2fe9b2){_0x103e15(_0x2fe9b2);});});}exports[_0xb989('0x5e')]=function(_0x232ad9,_0x29f22d,_0x5ec7f7){var _0x18959a,_0x4de583,_0x1bf358,_0x4bf97e,_0x47e7eb;return db[_0xb989('0x40')]['findOne']({'where':{'id':_0x232ad9[_0xb989('0x46')]['id']},'attributes':['id','host',_0xb989('0x53'),_0xb989('0x5f'),_0xb989('0x5a'),'serverUrl',_0xb989('0x60'),_0xb989('0x61')]})[_0xb989('0x25')](handleEntityNotFound(_0x29f22d,null))[_0xb989('0x25')](function(_0x4eb74a){_0x47e7eb=_0x4eb74a;_0x18959a=_0x47e7eb[_0xb989('0x62')];_0x4de583=_0x18959a==='zoho.eu'?'eu':_0xb989('0x63');_0x1bf358=_0x47e7eb[_0xb989('0x64')];var _0x1fa809=_0x1bf358[_0xb989('0x65')](-0x1);if(_0x1fa809==='/'||_0x1fa809==='\x5c'||_0x1fa809===':'){_0x1bf358=_0x1bf358[_0xb989('0x66')](0x0,_0x1bf358[_0xb989('0x67')](_0x1fa809));}if(!_0x47e7eb['refreshToken']){throw new Error(_0xb989('0x68'));}return getAccessToken(_0x47e7eb);})[_0xb989('0x25')](function(_0xbcfef4){if(_0xbcfef4){return rp({'method':_0xb989('0x69'),'uri':util[_0xb989('0x6a')](_0xb989('0x6b'),_0x4de583),'qs':{'module':_0xb989('0x6c')},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0xbcfef4},'json':!![]});}})['then'](function(_0x241d90){if(_0x241d90){if(_0x241d90['response']&&_0x241d90[_0xb989('0x6d')][_0xb989('0x26')]){throw new Error(_0x241d90[_0xb989('0x6d')]['error'][_0xb989('0x6e')]);}var _0x2bcf2f=[];var _0x30300f=[];var _0x221ad7=['Owner',_0xb989('0x6f'),_0xb989('0x70'),_0xb989('0x71'),_0xb989('0x72'),'Call_Result',_0xb989('0x73'),_0xb989('0x74')];_0x30300f=_['remove'](_0x241d90[_0xb989('0x35')],function(_0x487151){return _0x221ad7[_0xb989('0x75')](_0x487151[_0xb989('0x76')]);});for(var _0x51af9c=0x0;_0x51af9c<_0x30300f['length'];_0x51af9c++){if(_0x30300f[_0x51af9c][_0xb989('0x77')]===![]){_0x2bcf2f[_0xb989('0x78')]({'id':_0x30300f[_0x51af9c]['id'],'name':_0x30300f[_0x51af9c][_0xb989('0x79')],'custom':_0x30300f[_0x51af9c]['custom_field'],'options':_0x30300f[_0x51af9c][_0xb989('0x7a')]==='picklist'&&_0x30300f[_0x51af9c][_0xb989('0x7b')][_0xb989('0x36')]>-0x1?_[_0xb989('0x29')](_0x30300f[_0x51af9c]['pick_list_values'],function(_0x40b290){return{'name':_0x40b290,'value':_0x40b290};}):[]});}}return{'count':_0x2bcf2f['length'],'rows':_0x2bcf2f};}else{return{'count':0x0,'rows':[]};}})[_0xb989('0x25')](respondWithResult(_0x29f22d,null))[_0xb989('0x44')](function(_0x4d1336){var _0x219e8e=_0x232ad9['query']['test']?0x1f4:_0x4d1336['statusCode']||0x1f4;logger[_0xb989('0x26')](_0xb989('0x7c'),_0xb989('0x5e'),_0x219e8e,JSON['stringify'](_0x4d1336));delete _0x4d1336[_0xb989('0x2e')];if(_0x219e8e===0x191){_0x219e8e=0x190;}_0x29f22d[_0xb989('0x19')](_0x219e8e)[_0xb989('0x28')](_0x232ad9[_0xb989('0x2f')][_0xb989('0x7d')]?{'message':_0xb989('0x7e'),'statusCode':_0x4d1336[_0xb989('0x7f')]}:_0x4d1336);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index c573759..a3d1773 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 _0x8e34=['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','https://accounts.zoho.com.au','catch','lodash','../../config/logger','moment','bluebird','request-promise','rimraf','../../components/integrations/configuration','exports','define','int_zoho_accounts','changed','serverUrl','clientId','clientSecret','host','slice','substring','lastIndexOf','zone','https://accounts.zoho.com','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','authorization_code','code','then','parse','refresh_token','refreshToken','info','format'];(function(_0x44a5dc,_0x4005f1){var _0x369c18=function(_0x5a2994){while(--_0x5a2994){_0x44a5dc['push'](_0x44a5dc['shift']());}};_0x369c18(++_0x4005f1);}(_0x8e34,0x1bf));var _0x48e3=function(_0x4449e4,_0x4c63ca){_0x4449e4=_0x4449e4-0x0;var _0x5a23d9=_0x8e34[_0x4449e4];return _0x5a23d9;};'use strict';var _=require(_0x48e3('0x0'));var util=require('util');var logger=require(_0x48e3('0x1'))('api');var moment=require(_0x48e3('0x2'));var BPromise=require(_0x48e3('0x3'));var rp=require(_0x48e3('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x48e3('0x5'));var config=require('../../config/environment');var attributes=require('./intZohoAccount.attributes');var integrations=require(_0x48e3('0x6'));module[_0x48e3('0x7')]=function(_0x1327a2,_0x2e57b8){return _0x1327a2[_0x48e3('0x8')]('ZohoAccount',attributes,{'tableName':_0x48e3('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x277dfc,_0x5078fb,_0x243b19){if(_0x277dfc['changed']('zone')||_0x277dfc[_0x48e3('0xa')](_0x48e3('0xb'))||_0x277dfc[_0x48e3('0xa')](_0x48e3('0xc'))||_0x277dfc[_0x48e3('0xa')](_0x48e3('0xd'))||_0x277dfc[_0x48e3('0xa')]('code')||_0x277dfc[_0x48e3('0xa')](_0x48e3('0xe'))){var _0x5c899c,_0x22e40b;_0x5c899c=_0x277dfc['serverUrl'];var _0x32c977=_0x5c899c[_0x48e3('0xf')](-0x1);if(_0x32c977==='/'||_0x32c977==='\x5c'||_0x32c977===':'){_0x5c899c=_0x5c899c[_0x48e3('0x10')](0x0,_0x5c899c[_0x48e3('0x11')](_0x32c977));}switch(_0x277dfc[_0x48e3('0x12')]){case'US':_0x22e40b=_0x48e3('0x13');break;case'AU':_0x22e40b='https://accounts.zoho.com.au';break;case'IN':_0x22e40b=_0x48e3('0x14');break;case'CN':_0x22e40b=_0x48e3('0x15');break;default:_0x22e40b=_0x48e3('0x16');break;}var _0x310081={'method':_0x48e3('0x17'),'uri':_0x22e40b+_0x48e3('0x18'),'form':{'grant_type':_0x48e3('0x19'),'client_id':_0x277dfc[_0x48e3('0xc')],'client_secret':_0x277dfc['clientSecret'],'redirect_uri':_0x277dfc[_0x48e3('0xb')],'code':_0x277dfc[_0x48e3('0x1a')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x310081)[_0x48e3('0x1b')](function(_0x1f9f2d){var _0x201d8c=JSON[_0x48e3('0x1c')](_0x1f9f2d);if(_0x201d8c[_0x48e3('0x1d')]){_0x277dfc[_0x48e3('0x1e')]=_0x201d8c[_0x48e3('0x1d')];logger[_0x48e3('0x1f')](util[_0x48e3('0x20')](_0x48e3('0x21'),_0x277dfc[_0x48e3('0x22')],_0x277dfc['id']));}else{logger[_0x48e3('0x23')](util[_0x48e3('0x20')](_0x48e3('0x24'),_0x277dfc[_0x48e3('0x22')],_0x277dfc['id']),util[_0x48e3('0x25')](_0x201d8c,{'showHidden':![],'depth':null}));}return _0x243b19(null,_0x5078fb);})['catch'](function(_0x894072){logger[_0x48e3('0x23')](util[_0x48e3('0x20')](_0x48e3('0x24'),_0x277dfc['name'],_0x277dfc['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x243b19(_0x894072);});}else{return _0x243b19(null,_0x5078fb);}},'beforeUpdate':function(_0x366dcb,_0x2ff61f,_0x1e0275){if(_0x366dcb[_0x48e3('0xa')](_0x48e3('0x12'))||_0x366dcb[_0x48e3('0xa')](_0x48e3('0xb'))||_0x366dcb[_0x48e3('0xa')](_0x48e3('0xc'))||_0x366dcb[_0x48e3('0xa')](_0x48e3('0xd'))||_0x366dcb[_0x48e3('0xa')](_0x48e3('0x1a'))||_0x366dcb[_0x48e3('0xa')]('host')){var _0x43fae8,_0x2b66a4;_0x43fae8=_0x366dcb['serverUrl'];var _0x312399=_0x43fae8[_0x48e3('0xf')](-0x1);if(_0x312399==='/'||_0x312399==='\x5c'||_0x312399===':'){_0x43fae8=_0x43fae8[_0x48e3('0x10')](0x0,_0x43fae8[_0x48e3('0x11')](_0x312399));}switch(_0x366dcb[_0x48e3('0x12')]){case'US':_0x2b66a4=_0x48e3('0x13');break;case'AU':_0x2b66a4=_0x48e3('0x26');break;case'IN':_0x2b66a4=_0x48e3('0x14');break;case'CN':_0x2b66a4=_0x48e3('0x15');break;default:_0x2b66a4=_0x48e3('0x16');break;}var _0x402196={'method':_0x48e3('0x17'),'uri':_0x2b66a4+_0x48e3('0x18'),'form':{'grant_type':_0x48e3('0x19'),'client_id':_0x366dcb[_0x48e3('0xc')],'client_secret':_0x366dcb[_0x48e3('0xd')],'redirect_uri':_0x366dcb[_0x48e3('0xb')],'code':_0x366dcb[_0x48e3('0x1a')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x402196)[_0x48e3('0x1b')](function(_0x94ae01){var _0x1b76e9=JSON[_0x48e3('0x1c')](_0x94ae01);if(_0x1b76e9[_0x48e3('0x1d')]){_0x366dcb[_0x48e3('0x1e')]=_0x1b76e9[_0x48e3('0x1d')];logger[_0x48e3('0x1f')](util[_0x48e3('0x20')](_0x48e3('0x21'),_0x366dcb[_0x48e3('0x22')],_0x366dcb['id']));}else{logger[_0x48e3('0x23')](util[_0x48e3('0x20')](_0x48e3('0x24'),_0x366dcb[_0x48e3('0x22')],_0x366dcb['id']),util[_0x48e3('0x25')](_0x1b76e9,{'showHidden':![],'depth':null}));}return _0x1e0275(null,_0x2ff61f);})[_0x48e3('0x27')](function(_0x321b48){logger[_0x48e3('0x23')](util[_0x48e3('0x20')](_0x48e3('0x24'),_0x366dcb[_0x48e3('0x22')],_0x366dcb['id']),util[_0x48e3('0x25')](parsedResult,{'showHidden':![],'depth':null}));return _0x1e0275(_0x321b48);});}else{return _0x1e0275(null,_0x2ff61f);}}}});}; \ No newline at end of file +var _0x4e68=['clientSecret','util','../../config/logger','moment','bluebird','request-promise','path','./intZohoAccount.attributes','../../components/integrations/configuration','exports','define','int_zoho_accounts','changed','zone','clientId','code','host','serverUrl','slice','substring','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','/oauth/v2/token','authorization_code','application/x-www-form-urlencoded','then','refresh_token','refreshToken','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','catch','lastIndexOf'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x4e68,0x191));var _0x84e6=function(_0x3a1c37,_0x487201){_0x3a1c37=_0x3a1c37-0x0;var _0x4ef332=_0x4e68[_0x3a1c37];return _0x4ef332;};'use strict';var _=require('lodash');var util=require(_0x84e6('0x0'));var logger=require(_0x84e6('0x1'))('api');var moment=require(_0x84e6('0x2'));var BPromise=require(_0x84e6('0x3'));var rp=require(_0x84e6('0x4'));var fs=require('fs');var path=require(_0x84e6('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x84e6('0x6'));var integrations=require(_0x84e6('0x7'));module[_0x84e6('0x8')]=function(_0x2bfbb2,_0x5bf94a){return _0x2bfbb2[_0x84e6('0x9')]('ZohoAccount',attributes,{'tableName':_0x84e6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x3cfde5,_0x4fd9e0,_0x1d3e00){if(_0x3cfde5[_0x84e6('0xb')](_0x84e6('0xc'))||_0x3cfde5[_0x84e6('0xb')]('serverUrl')||_0x3cfde5[_0x84e6('0xb')](_0x84e6('0xd'))||_0x3cfde5[_0x84e6('0xb')]('clientSecret')||_0x3cfde5['changed'](_0x84e6('0xe'))||_0x3cfde5[_0x84e6('0xb')](_0x84e6('0xf'))){var _0x3fd22c,_0x5be13a;_0x3fd22c=_0x3cfde5[_0x84e6('0x10')];var _0x3397b3=_0x3fd22c[_0x84e6('0x11')](-0x1);if(_0x3397b3==='/'||_0x3397b3==='\x5c'||_0x3397b3===':'){_0x3fd22c=_0x3fd22c[_0x84e6('0x12')](0x0,_0x3fd22c['lastIndexOf'](_0x3397b3));}switch(_0x3cfde5['zone']){case'US':_0x5be13a=_0x84e6('0x13');break;case'AU':_0x5be13a=_0x84e6('0x14');break;case'IN':_0x5be13a=_0x84e6('0x15');break;case'CN':_0x5be13a=_0x84e6('0x16');break;default:_0x5be13a=_0x84e6('0x17');break;}var _0x4296d5={'method':'POST','uri':_0x5be13a+_0x84e6('0x18'),'form':{'grant_type':_0x84e6('0x19'),'client_id':_0x3cfde5[_0x84e6('0xd')],'client_secret':_0x3cfde5['clientSecret'],'redirect_uri':_0x3cfde5[_0x84e6('0x10')],'code':_0x3cfde5[_0x84e6('0xe')]},'headers':{'Content-Type':_0x84e6('0x1a')}};return rp(_0x4296d5)[_0x84e6('0x1b')](function(_0x2e62db){var _0x537d22=JSON['parse'](_0x2e62db);if(_0x537d22[_0x84e6('0x1c')]){_0x3cfde5[_0x84e6('0x1d')]=_0x537d22[_0x84e6('0x1c')];logger[_0x84e6('0x1e')](util[_0x84e6('0x1f')](_0x84e6('0x20'),_0x3cfde5[_0x84e6('0x21')],_0x3cfde5['id']));}else{logger[_0x84e6('0x22')](util['format'](_0x84e6('0x23'),_0x3cfde5[_0x84e6('0x21')],_0x3cfde5['id']),util[_0x84e6('0x24')](_0x537d22,{'showHidden':![],'depth':null}));}return _0x1d3e00(null,_0x4fd9e0);})[_0x84e6('0x25')](function(_0x21c4dc){logger[_0x84e6('0x22')](util[_0x84e6('0x1f')](_0x84e6('0x23'),_0x3cfde5[_0x84e6('0x21')],_0x3cfde5['id']),util[_0x84e6('0x24')](parsedResult,{'showHidden':![],'depth':null}));return _0x1d3e00(_0x21c4dc);});}else{return _0x1d3e00(null,_0x4fd9e0);}},'beforeUpdate':function(_0x2ad14a,_0x4881e4,_0x6bd425){if(_0x2ad14a[_0x84e6('0xb')](_0x84e6('0xc'))||_0x2ad14a[_0x84e6('0xb')]('serverUrl')||_0x2ad14a[_0x84e6('0xb')](_0x84e6('0xd'))||_0x2ad14a[_0x84e6('0xb')]('clientSecret')||_0x2ad14a['changed'](_0x84e6('0xe'))||_0x2ad14a[_0x84e6('0xb')]('host')){var _0x350fde,_0x14a618;_0x350fde=_0x2ad14a[_0x84e6('0x10')];var _0x6158a9=_0x350fde[_0x84e6('0x11')](-0x1);if(_0x6158a9==='/'||_0x6158a9==='\x5c'||_0x6158a9===':'){_0x350fde=_0x350fde[_0x84e6('0x12')](0x0,_0x350fde[_0x84e6('0x26')](_0x6158a9));}switch(_0x2ad14a[_0x84e6('0xc')]){case'US':_0x14a618=_0x84e6('0x13');break;case'AU':_0x14a618=_0x84e6('0x14');break;case'IN':_0x14a618='https://accounts.zoho.in';break;case'CN':_0x14a618='https://accounts.zoho.com.cn';break;default:_0x14a618=_0x84e6('0x17');break;}var _0x48e8ba={'method':'POST','uri':_0x14a618+_0x84e6('0x18'),'form':{'grant_type':_0x84e6('0x19'),'client_id':_0x2ad14a[_0x84e6('0xd')],'client_secret':_0x2ad14a[_0x84e6('0x27')],'redirect_uri':_0x2ad14a[_0x84e6('0x10')],'code':_0x2ad14a[_0x84e6('0xe')]},'headers':{'Content-Type':_0x84e6('0x1a')}};return rp(_0x48e8ba)['then'](function(_0x1670f8){var _0x479869=JSON['parse'](_0x1670f8);if(_0x479869[_0x84e6('0x1c')]){_0x2ad14a[_0x84e6('0x1d')]=_0x479869[_0x84e6('0x1c')];logger['info'](util[_0x84e6('0x1f')]('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x2ad14a['name'],_0x2ad14a['id']));}else{logger['error'](util[_0x84e6('0x1f')](_0x84e6('0x23'),_0x2ad14a[_0x84e6('0x21')],_0x2ad14a['id']),util['inspect'](_0x479869,{'showHidden':![],'depth':null}));}return _0x6bd425(null,_0x4881e4);})[_0x84e6('0x25')](function(_0x1b78b2){logger['error'](util[_0x84e6('0x1f')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x2ad14a[_0x84e6('0x21')],_0x2ad14a['id']),util[_0x84e6('0x24')](parsedResult,{'showHidden':![],'depth':null}));return _0x6bd425(_0x1b78b2);});}else{return _0x6bd425(null,_0x4881e4);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index 479fa7e..b4aec41 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 _0x8561=['util','moment','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','info','ZohoAccount,\x20%s,\x20%s','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','findAll','options','raw','attributes','limit','map','include','model','GetZohoAccount','debug','ZohoAccount','find','where','then','ShowZohoAccount'];(function(_0x4c8a8f,_0x997ef){var _0x404500=function(_0x1c6072){while(--_0x1c6072){_0x4c8a8f['push'](_0x4c8a8f['shift']());}};_0x404500(++_0x997ef);}(_0x8561,0x1b2));var _0x1856=function(_0x2bd630,_0x494f0a){_0x2bd630=_0x2bd630-0x0;var _0x34d159=_0x8561[_0x2bd630];return _0x34d159;};'use strict';var _=require('lodash');var util=require(_0x1856('0x0'));var moment=require(_0x1856('0x1'));var BPromise=require('bluebird');var rs=require(_0x1856('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1856('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x1856('0x4'))('rpc');var config=require(_0x1856('0x5'));var jayson=require(_0x1856('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xe76f7e,_0x56a214,_0x598eba){return new BPromise(function(_0x1c79b0,_0x567852){return client['request'](_0xe76f7e,_0x598eba)['then'](function(_0x5c3bc5){logger[_0x1856('0x7')](_0x1856('0x8'),_0x56a214,'request\x20sent');logger['debug'](_0x1856('0x9'),_0x56a214,'request\x20sent',JSON[_0x1856('0xa')](_0x5c3bc5));if(_0x5c3bc5[_0x1856('0xb')]){if(_0x5c3bc5[_0x1856('0xb')]['code']===0x1f4){logger[_0x1856('0xb')](_0x1856('0x8'),_0x56a214,_0x5c3bc5['error'][_0x1856('0xc')]);return _0x567852(_0x5c3bc5[_0x1856('0xb')][_0x1856('0xc')]);}logger['error'](_0x1856('0x8'),_0x56a214,_0x5c3bc5[_0x1856('0xb')][_0x1856('0xc')]);return _0x1c79b0(_0x5c3bc5['error'][_0x1856('0xc')]);}else{logger[_0x1856('0x7')](_0x1856('0x8'),_0x56a214,_0x1856('0xd'));_0x1c79b0(_0x5c3bc5[_0x1856('0xe')][_0x1856('0xc')]);}})[_0x1856('0xf')](function(_0x51ed04){logger['error'](_0x1856('0x8'),_0x56a214,_0x51ed04);_0x567852(_0x51ed04);});});}exports['GetZohoAccount']=function(_0x4ccc42){var _0x1de74a=this;return new Promise(function(_0x2346f6,_0x5b12d0){return db['ZohoAccount'][_0x1856('0x10')]({'raw':_0x4ccc42[_0x1856('0x11')]?_0x4ccc42[_0x1856('0x11')][_0x1856('0x12')]===undefined?!![]:![]:!![],'where':_0x4ccc42[_0x1856('0x11')]?_0x4ccc42[_0x1856('0x11')]['where']||null:null,'attributes':_0x4ccc42[_0x1856('0x11')]?_0x4ccc42[_0x1856('0x11')][_0x1856('0x13')]||null:null,'limit':_0x4ccc42[_0x1856('0x11')]?_0x4ccc42[_0x1856('0x11')][_0x1856('0x14')]||null:null,'include':_0x4ccc42[_0x1856('0x11')]?_0x4ccc42['options']['include']?_[_0x1856('0x15')](_0x4ccc42[_0x1856('0x11')][_0x1856('0x16')],function(_0x4b867e){return{'model':db[_0x4b867e[_0x1856('0x17')]],'as':_0x4b867e['as'],'attributes':_0x4b867e[_0x1856('0x13')],'include':_0x4b867e[_0x1856('0x16')]?_[_0x1856('0x15')](_0x4b867e['include'],function(_0xfd069f){return{'model':db[_0xfd069f[_0x1856('0x17')]],'as':_0xfd069f['as'],'attributes':_0xfd069f[_0x1856('0x13')],'include':_0xfd069f[_0x1856('0x16')]?_['map'](_0xfd069f[_0x1856('0x16')],function(_0x4022e8){return{'model':db[_0x4022e8['model']],'as':_0x4022e8['as'],'attributes':_0x4022e8[_0x1856('0x13')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x46d381){logger['info'](_0x1856('0x18'),_0x4ccc42);logger[_0x1856('0x19')](_0x1856('0x18'),_0x4ccc42,JSON[_0x1856('0xa')](_0x46d381));_0x2346f6(_0x46d381);})['catch'](function(_0x2f3d8f){logger[_0x1856('0xb')](_0x1856('0x18'),_0x2f3d8f[_0x1856('0xc')],_0x4ccc42);_0x5b12d0(_0x1de74a[_0x1856('0xb')](0x1f4,_0x2f3d8f[_0x1856('0xc')]));});});};exports['ShowZohoAccount']=function(_0x2fbe7b){var _0x16ca12=this;return new Promise(function(_0x35428a,_0x48e78f){return db[_0x1856('0x1a')][_0x1856('0x1b')]({'raw':_0x2fbe7b[_0x1856('0x11')]?_0x2fbe7b['options'][_0x1856('0x12')]===undefined?!![]:![]:!![],'where':_0x2fbe7b['options']?_0x2fbe7b[_0x1856('0x11')][_0x1856('0x1c')]||null:null,'attributes':_0x2fbe7b[_0x1856('0x11')]?_0x2fbe7b[_0x1856('0x11')][_0x1856('0x13')]||null:null,'include':_0x2fbe7b[_0x1856('0x11')]?_0x2fbe7b[_0x1856('0x11')]['include']?_[_0x1856('0x15')](_0x2fbe7b[_0x1856('0x11')][_0x1856('0x16')],function(_0x1ab4c6){return{'model':db[_0x1ab4c6[_0x1856('0x17')]],'as':_0x1ab4c6['as'],'attributes':_0x1ab4c6['attributes'],'include':_0x1ab4c6[_0x1856('0x16')]?_[_0x1856('0x15')](_0x1ab4c6[_0x1856('0x16')],function(_0x4b2fca){return{'model':db[_0x4b2fca[_0x1856('0x17')]],'as':_0x4b2fca['as'],'attributes':_0x4b2fca[_0x1856('0x13')],'include':_0x4b2fca[_0x1856('0x16')]?_[_0x1856('0x15')](_0x4b2fca[_0x1856('0x16')],function(_0x5aa0e4){return{'model':db[_0x5aa0e4['model']],'as':_0x5aa0e4['as'],'attributes':_0x5aa0e4['attributes']};}):[]};}):[]};}):[]:[]})[_0x1856('0x1d')](function(_0x588865){logger[_0x1856('0x7')](_0x1856('0x1e'),_0x2fbe7b);logger['debug']('ShowZohoAccount',_0x2fbe7b,JSON[_0x1856('0xa')](_0x588865));_0x35428a(_0x588865);})[_0x1856('0xf')](function(_0x14b930){logger[_0x1856('0xb')]('ShowZohoAccount',_0x14b930[_0x1856('0xc')],_0x2fbe7b);_0x48e78f(_0x16ca12[_0x1856('0xb')](0x1f4,_0x14b930[_0x1856('0xc')]));});});}; \ No newline at end of file +var _0x0b78=['info','request\x20sent','debug','stringify','error','ZohoAccount,\x20%s,\x20%s','message','result','catch','GetZohoAccount','ZohoAccount','options','raw','where','attributes','limit','include','map','model','then','ShowZohoAccount','find','util','moment','bluebird','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http','request'];(function(_0x220dbb,_0x99328d){var _0x2b77de=function(_0x15e966){while(--_0x15e966){_0x220dbb['push'](_0x220dbb['shift']());}};_0x2b77de(++_0x99328d);}(_0x0b78,0x1d6));var _0x80b7=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x0b78[_0x42cae2];return _0x5f256f;};'use strict';var _=require('lodash');var util=require(_0x80b7('0x0'));var moment=require(_0x80b7('0x1'));var BPromise=require(_0x80b7('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x80b7('0x3'));var db=require(_0x80b7('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x80b7('0x5'));var jayson=require(_0x80b7('0x6'));var client=jayson[_0x80b7('0x7')][_0x80b7('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x33bdd8,_0x332cd5,_0x5ecbbf){return new BPromise(function(_0x1a0374,_0x114ef7){return client[_0x80b7('0x9')](_0x33bdd8,_0x5ecbbf)['then'](function(_0x54053b){logger[_0x80b7('0xa')]('ZohoAccount,\x20%s,\x20%s',_0x332cd5,_0x80b7('0xb'));logger[_0x80b7('0xc')]('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x332cd5,_0x80b7('0xb'),JSON[_0x80b7('0xd')](_0x54053b));if(_0x54053b[_0x80b7('0xe')]){if(_0x54053b[_0x80b7('0xe')]['code']===0x1f4){logger['error'](_0x80b7('0xf'),_0x332cd5,_0x54053b[_0x80b7('0xe')][_0x80b7('0x10')]);return _0x114ef7(_0x54053b[_0x80b7('0xe')][_0x80b7('0x10')]);}logger[_0x80b7('0xe')](_0x80b7('0xf'),_0x332cd5,_0x54053b[_0x80b7('0xe')][_0x80b7('0x10')]);return _0x1a0374(_0x54053b['error']['message']);}else{logger['info']('ZohoAccount,\x20%s,\x20%s',_0x332cd5,_0x80b7('0xb'));_0x1a0374(_0x54053b[_0x80b7('0x11')][_0x80b7('0x10')]);}})[_0x80b7('0x12')](function(_0x6c9f31){logger[_0x80b7('0xe')](_0x80b7('0xf'),_0x332cd5,_0x6c9f31);_0x114ef7(_0x6c9f31);});});}exports[_0x80b7('0x13')]=function(_0x22abaa){var _0x3b27ac=this;return new Promise(function(_0x25b5e9,_0x1ed4e6){return db[_0x80b7('0x14')]['findAll']({'raw':_0x22abaa[_0x80b7('0x15')]?_0x22abaa[_0x80b7('0x15')][_0x80b7('0x16')]===undefined?!![]:![]:!![],'where':_0x22abaa[_0x80b7('0x15')]?_0x22abaa[_0x80b7('0x15')][_0x80b7('0x17')]||null:null,'attributes':_0x22abaa[_0x80b7('0x15')]?_0x22abaa[_0x80b7('0x15')][_0x80b7('0x18')]||null:null,'limit':_0x22abaa[_0x80b7('0x15')]?_0x22abaa[_0x80b7('0x15')][_0x80b7('0x19')]||null:null,'include':_0x22abaa['options']?_0x22abaa['options'][_0x80b7('0x1a')]?_[_0x80b7('0x1b')](_0x22abaa[_0x80b7('0x15')]['include'],function(_0x9fccdc){return{'model':db[_0x9fccdc[_0x80b7('0x1c')]],'as':_0x9fccdc['as'],'attributes':_0x9fccdc[_0x80b7('0x18')],'include':_0x9fccdc[_0x80b7('0x1a')]?_[_0x80b7('0x1b')](_0x9fccdc[_0x80b7('0x1a')],function(_0x44ab49){return{'model':db[_0x44ab49[_0x80b7('0x1c')]],'as':_0x44ab49['as'],'attributes':_0x44ab49[_0x80b7('0x18')],'include':_0x44ab49[_0x80b7('0x1a')]?_[_0x80b7('0x1b')](_0x44ab49['include'],function(_0x328c15){return{'model':db[_0x328c15[_0x80b7('0x1c')]],'as':_0x328c15['as'],'attributes':_0x328c15[_0x80b7('0x18')]};}):[]};}):[]};}):[]:[]})[_0x80b7('0x1d')](function(_0x3fc028){logger[_0x80b7('0xa')](_0x80b7('0x13'),_0x22abaa);logger[_0x80b7('0xc')]('GetZohoAccount',_0x22abaa,JSON[_0x80b7('0xd')](_0x3fc028));_0x25b5e9(_0x3fc028);})[_0x80b7('0x12')](function(_0x1dc2df){logger[_0x80b7('0xe')](_0x80b7('0x13'),_0x1dc2df['message'],_0x22abaa);_0x1ed4e6(_0x3b27ac[_0x80b7('0xe')](0x1f4,_0x1dc2df[_0x80b7('0x10')]));});});};exports[_0x80b7('0x1e')]=function(_0x5a931c){var _0x1dddba=this;return new Promise(function(_0x2dbb98,_0x198d77){return db['ZohoAccount'][_0x80b7('0x1f')]({'raw':_0x5a931c[_0x80b7('0x15')]?_0x5a931c['options'][_0x80b7('0x16')]===undefined?!![]:![]:!![],'where':_0x5a931c[_0x80b7('0x15')]?_0x5a931c[_0x80b7('0x15')][_0x80b7('0x17')]||null:null,'attributes':_0x5a931c[_0x80b7('0x15')]?_0x5a931c[_0x80b7('0x15')]['attributes']||null:null,'include':_0x5a931c[_0x80b7('0x15')]?_0x5a931c[_0x80b7('0x15')][_0x80b7('0x1a')]?_['map'](_0x5a931c[_0x80b7('0x15')][_0x80b7('0x1a')],function(_0x2c87e6){return{'model':db[_0x2c87e6['model']],'as':_0x2c87e6['as'],'attributes':_0x2c87e6[_0x80b7('0x18')],'include':_0x2c87e6[_0x80b7('0x1a')]?_[_0x80b7('0x1b')](_0x2c87e6[_0x80b7('0x1a')],function(_0x5971d9){return{'model':db[_0x5971d9[_0x80b7('0x1c')]],'as':_0x5971d9['as'],'attributes':_0x5971d9[_0x80b7('0x18')],'include':_0x5971d9[_0x80b7('0x1a')]?_['map'](_0x5971d9['include'],function(_0x373cbb){return{'model':db[_0x373cbb[_0x80b7('0x1c')]],'as':_0x373cbb['as'],'attributes':_0x373cbb[_0x80b7('0x18')]};}):[]};}):[]};}):[]:[]})[_0x80b7('0x1d')](function(_0x546697){logger['info'](_0x80b7('0x1e'),_0x5a931c);logger[_0x80b7('0xc')](_0x80b7('0x1e'),_0x5a931c,JSON[_0x80b7('0xd')](_0x546697));_0x2dbb98(_0x546697);})['catch'](function(_0x1226cf){logger[_0x80b7('0xe')]('ShowZohoAccount',_0x1226cf[_0x80b7('0x10')],_0x5a931c);_0x198d77(_0x1dddba['error'](0x1f4,_0x1226cf[_0x80b7('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index ca0e336..5cd18a9 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 _0x52b7=['../../config/environment','./intZohoConfiguration.controller','index','get','/:id','show','/:id/fields','isAuthenticated','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','destroy','exports','multer','util','path','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x2eeed4,_0x28dc98){var _0x56099d=function(_0x1018a7){while(--_0x1018a7){_0x2eeed4['push'](_0x2eeed4['shift']());}};_0x56099d(++_0x28dc98);}(_0x52b7,0xb2));var _0x752b=function(_0x1b5c07,_0x18f64e){_0x1b5c07=_0x1b5c07-0x0;var _0x472d4f=_0x52b7[_0x1b5c07];return _0x472d4f;};'use strict';var multer=require(_0x752b('0x0'));var util=require(_0x752b('0x1'));var path=require(_0x752b('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x752b('0x3'));var auth=require(_0x752b('0x4'));var interaction=require(_0x752b('0x5'));var config=require(_0x752b('0x6'));var controller=require(_0x752b('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x752b('0x8')]);router[_0x752b('0x9')](_0x752b('0xa'),auth['isAuthenticated'](),controller[_0x752b('0xb')]);router[_0x752b('0x9')](_0x752b('0xc'),auth[_0x752b('0xd')](),controller['getFields']);router[_0x752b('0x9')](_0x752b('0xe'),auth[_0x752b('0xd')](),controller[_0x752b('0xf')]);router[_0x752b('0x9')](_0x752b('0x10'),auth[_0x752b('0xd')](),controller[_0x752b('0x11')]);router[_0x752b('0x12')]('/',auth['isAuthenticated'](),controller[_0x752b('0x13')]);router[_0x752b('0x14')](_0x752b('0xa'),auth[_0x752b('0xd')](),controller['update']);router['delete'](_0x752b('0xa'),auth[_0x752b('0xd')](),controller[_0x752b('0x15')]);module[_0x752b('0x16')]=router; \ No newline at end of file +var _0x23ed=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','get','isAuthenticated','/:id','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','put','update','delete','destroy','multer','util','path'];(function(_0x2f88bf,_0x761a0e){var _0x1b451e=function(_0x1116fa){while(--_0x1116fa){_0x2f88bf['push'](_0x2f88bf['shift']());}};_0x1b451e(++_0x761a0e);}(_0x23ed,0x135));var _0xd23e=function(_0x5044f3,_0x310ab3){_0x5044f3=_0x5044f3-0x0;var _0x2db7c6=_0x23ed[_0x5044f3];return _0x2db7c6;};'use strict';var multer=require(_0xd23e('0x0'));var util=require(_0xd23e('0x1'));var path=require(_0xd23e('0x2'));var timeout=require(_0xd23e('0x3'));var express=require(_0xd23e('0x4'));var router=express[_0xd23e('0x5')]();var fs_extra=require(_0xd23e('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xd23e('0x7'));var config=require(_0xd23e('0x8'));var controller=require(_0xd23e('0x9'));router[_0xd23e('0xa')]('/',auth[_0xd23e('0xb')](),controller['index']);router[_0xd23e('0xa')](_0xd23e('0xc'),auth[_0xd23e('0xb')](),controller['show']);router[_0xd23e('0xa')](_0xd23e('0xd'),auth['isAuthenticated'](),controller[_0xd23e('0xe')]);router[_0xd23e('0xa')](_0xd23e('0xf'),auth[_0xd23e('0xb')](),controller[_0xd23e('0x10')]);router[_0xd23e('0xa')](_0xd23e('0x11'),auth['isAuthenticated'](),controller[_0xd23e('0x12')]);router[_0xd23e('0x13')]('/',auth[_0xd23e('0xb')](),controller['create']);router[_0xd23e('0x14')](_0xd23e('0xc'),auth[_0xd23e('0xb')](),controller[_0xd23e('0x15')]);router[_0xd23e('0x16')](_0xd23e('0xc'),auth[_0xd23e('0xb')](),controller[_0xd23e('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index 3faa0ea..c66df49 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 _0x6ed4=['exports','STRING','ENUM','contact','lead','contact_lead','sequelize'];(function(_0x1fdb40,_0x51351c){var _0x281f93=function(_0x35eebe){while(--_0x35eebe){_0x1fdb40['push'](_0x1fdb40['shift']());}};_0x281f93(++_0x51351c);}(_0x6ed4,0x99));var _0x46ed=function(_0x4b6827,_0x4873b0){_0x4b6827=_0x4b6827-0x0;var _0x392499=_0x6ed4[_0x4b6827];return _0x392499;};'use strict';var Sequelize=require(_0x46ed('0x0'));module[_0x46ed('0x1')]={'name':{'type':Sequelize[_0x46ed('0x2')]},'moduleCreate':{'type':Sequelize[_0x46ed('0x3')]('lead',_0x46ed('0x4'),'nothing'),'defaultValue':_0x46ed('0x5')},'moduleSearch':{'type':Sequelize[_0x46ed('0x3')](_0x46ed('0x6'),_0x46ed('0x4'),_0x46ed('0x5')),'defaultValue':_0x46ed('0x6')},'description':{'type':Sequelize[_0x46ed('0x2')]}}; \ No newline at end of file +var _0x1d23=['contact_lead','sequelize','exports','STRING','lead','contact','nothing','ENUM'];(function(_0x2113c3,_0x37d9ee){var _0x4d471a=function(_0x25bbf1){while(--_0x25bbf1){_0x2113c3['push'](_0x2113c3['shift']());}};_0x4d471a(++_0x37d9ee);}(_0x1d23,0x129));var _0x31d2=function(_0xc68650,_0x258343){_0xc68650=_0xc68650-0x0;var _0x57bd40=_0x1d23[_0xc68650];return _0x57bd40;};'use strict';var Sequelize=require(_0x31d2('0x0'));module[_0x31d2('0x1')]={'name':{'type':Sequelize[_0x31d2('0x2')]},'moduleCreate':{'type':Sequelize['ENUM'](_0x31d2('0x3'),_0x31d2('0x4'),_0x31d2('0x5')),'defaultValue':'lead'},'moduleSearch':{'type':Sequelize[_0x31d2('0x6')](_0x31d2('0x7'),'contact',_0x31d2('0x3')),'defaultValue':'contact_lead'},'description':{'type':Sequelize[_0x31d2('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index df077e1..02d62ed 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 _0xbab6=['sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','error','name','send','index','ZohoConfiguration','rawAttributes','fieldName','key','model','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','pick','filter','where','type','VIRTUAL','merge','options','includeAll','include','findAll','then','show','params','length','find','catch','create','body','update','destroy','getFields','ZohoField','sort','map','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb'];(function(_0x568cd3,_0x435ac2){var _0x3ce9e2=function(_0x19a0f1){while(--_0x19a0f1){_0x568cd3['push'](_0x568cd3['shift']());}};_0x3ce9e2(++_0x435ac2);}(_0xbab6,0x11a));var _0x6bab=function(_0x331537,_0x1945cf){_0x331537=_0x331537-0x0;var _0x29c635=_0xbab6[_0x331537];return _0x29c635;};'use strict';var emlformat=require(_0x6bab('0x0'));var rimraf=require(_0x6bab('0x1'));var zipdir=require(_0x6bab('0x2'));var jsonpatch=require(_0x6bab('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x6bab('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x6bab('0x5'));var sox=require(_0x6bab('0x6'));var csv=require(_0x6bab('0x7'));var ejs=require(_0x6bab('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6bab('0x9'));var squel=require(_0x6bab('0xa'));var crypto=require(_0x6bab('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x6bab('0xc'));var toCsv=require(_0x6bab('0x7'));var querystring=require('querystring');var Papa=require(_0x6bab('0xd'));var Redis=require('ioredis');var authService=require(_0x6bab('0xe'));var qs=require(_0x6bab('0xf'));var as=require(_0x6bab('0x10'));var hardwareService=require(_0x6bab('0x11'));var logger=require('../../config/logger')(_0x6bab('0x12'));var utils=require(_0x6bab('0x13'));var config=require(_0x6bab('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x6bab('0x15'))['db'];function respondWithStatusCode(_0x26ca82,_0x2a1791){_0x2a1791=_0x2a1791||0xcc;return function(_0x1b938c){if(_0x1b938c){return _0x26ca82[_0x6bab('0x16')](_0x2a1791);}return _0x26ca82[_0x6bab('0x17')](_0x2a1791)['end']();};}function respondWithResult(_0xa010d2,_0xc9f7bc){_0xc9f7bc=_0xc9f7bc||0xc8;return function(_0x557450){if(_0x557450){return _0xa010d2[_0x6bab('0x17')](_0xc9f7bc)[_0x6bab('0x18')](_0x557450);}};}function respondWithFilteredResult(_0x211796,_0x26a5ec){return function(_0x7ef4d7){if(_0x7ef4d7){var _0x534be0=typeof _0x26a5ec[_0x6bab('0x19')]===_0x6bab('0x1a')&&typeof _0x26a5ec[_0x6bab('0x1b')]===_0x6bab('0x1a');var _0x36abb7=_0x7ef4d7[_0x6bab('0x1c')];var _0x4b200b=_0x534be0?0x0:_0x26a5ec[_0x6bab('0x19')];var _0x40b9c2=_0x534be0?_0x7ef4d7[_0x6bab('0x1c')]:_0x26a5ec['offset']+_0x26a5ec[_0x6bab('0x1b')];var _0x43e643;if(_0x40b9c2>=_0x36abb7){_0x40b9c2=_0x36abb7;_0x43e643=0xc8;}else{_0x43e643=0xce;}_0x211796[_0x6bab('0x17')](_0x43e643);return _0x211796['set'](_0x6bab('0x1d'),_0x4b200b+'-'+_0x40b9c2+'/'+_0x36abb7)[_0x6bab('0x18')](_0x7ef4d7);}return null;};}function patchUpdates(_0x1c2697){return function(_0x242926){try{jsonpatch[_0x6bab('0x1e')](_0x242926,_0x1c2697,!![]);}catch(_0x10b055){return BPromise[_0x6bab('0x1f')](_0x10b055);}return _0x242926['save']();};}function saveUpdates(_0x51e274,_0x5b7fef){return function(_0x32e657){if(_0x32e657){return _0x32e657['update'](_0x51e274)['then'](function(_0x19f80f){return _0x19f80f;});}return null;};}function removeEntity(_0x556568,_0x5e4791){return function(_0x4fd0a0){if(_0x4fd0a0){return _0x4fd0a0['destroy']()['then'](function(){_0x556568[_0x6bab('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x586ccc,_0xf42b12){return function(_0x1204b1){if(!_0x1204b1){_0x586ccc[_0x6bab('0x16')](0x194);}return _0x1204b1;};}function handleError(_0x278ba2,_0x5b8999){_0x5b8999=_0x5b8999||0x1f4;return function(_0x2b3cc2){logger[_0x6bab('0x20')](_0x2b3cc2['stack']);if(_0x2b3cc2[_0x6bab('0x21')]){delete _0x2b3cc2[_0x6bab('0x21')];}_0x278ba2[_0x6bab('0x17')](_0x5b8999)[_0x6bab('0x22')](_0x2b3cc2);};}exports[_0x6bab('0x23')]=function(_0x35f552,_0x515695){var _0x421eb9={},_0x44acb8={},_0xf826a8={'count':0x0,'rows':[]};var _0x4a4eaa=_['map'](db[_0x6bab('0x24')][_0x6bab('0x25')],function(_0x2802cd){return{'name':_0x2802cd[_0x6bab('0x26')],'type':_0x2802cd['type'][_0x6bab('0x27')]};});_0x44acb8[_0x6bab('0x28')]=_['map'](_0x4a4eaa,'name');_0x44acb8['query']=_[_0x6bab('0x29')](_0x35f552[_0x6bab('0x2a')]);_0x44acb8[_0x6bab('0x2b')]=_[_0x6bab('0x2c')](_0x44acb8[_0x6bab('0x28')],_0x44acb8['query']);_0x421eb9['attributes']=_[_0x6bab('0x2c')](_0x44acb8[_0x6bab('0x28')],qs[_0x6bab('0x2d')](_0x35f552[_0x6bab('0x2a')][_0x6bab('0x2d')]));_0x421eb9[_0x6bab('0x2e')]=_0x421eb9['attributes']['length']?_0x421eb9[_0x6bab('0x2e')]:_0x44acb8[_0x6bab('0x28')];if(!_0x35f552[_0x6bab('0x2a')][_0x6bab('0x2f')](_0x6bab('0x30'))){_0x421eb9[_0x6bab('0x1b')]=qs[_0x6bab('0x1b')](_0x35f552[_0x6bab('0x2a')][_0x6bab('0x1b')]);_0x421eb9['offset']=qs[_0x6bab('0x19')](_0x35f552[_0x6bab('0x2a')][_0x6bab('0x19')]);}_0x421eb9[_0x6bab('0x31')]=qs['sort'](_0x35f552[_0x6bab('0x2a')]['sort']);_0x421eb9['where']=qs[_0x6bab('0x2b')](_[_0x6bab('0x32')](_0x35f552[_0x6bab('0x2a')],_0x44acb8[_0x6bab('0x2b')]),_0x4a4eaa);if(_0x35f552[_0x6bab('0x2a')][_0x6bab('0x33')]){_0x421eb9[_0x6bab('0x34')]=_['merge'](_0x421eb9[_0x6bab('0x34')],{'$or':_['map'](_0x4a4eaa,function(_0x234cf3){if(_0x234cf3[_0x6bab('0x35')]!==_0x6bab('0x36')){var _0x43aeac={};_0x43aeac[_0x234cf3[_0x6bab('0x21')]]={'$like':'%'+_0x35f552[_0x6bab('0x2a')][_0x6bab('0x33')]+'%'};return _0x43aeac;}})});}_0x421eb9=_[_0x6bab('0x37')]({},_0x421eb9,_0x35f552[_0x6bab('0x38')]);var _0x870ebb={'where':_0x421eb9[_0x6bab('0x34')]};return db[_0x6bab('0x24')][_0x6bab('0x1c')](_0x870ebb)['then'](function(_0x4a598){_0xf826a8[_0x6bab('0x1c')]=_0x4a598;if(_0x35f552['query'][_0x6bab('0x39')]){_0x421eb9[_0x6bab('0x3a')]=[{'all':!![]}];}return db[_0x6bab('0x24')][_0x6bab('0x3b')](_0x421eb9);})[_0x6bab('0x3c')](function(_0x5b399d){_0xf826a8['rows']=_0x5b399d;return _0xf826a8;})[_0x6bab('0x3c')](respondWithFilteredResult(_0x515695,_0x421eb9))['catch'](handleError(_0x515695,null));};exports[_0x6bab('0x3d')]=function(_0xa795fd,_0x2a4e03){var _0x5a02b2={'raw':![],'where':{'id':_0xa795fd[_0x6bab('0x3e')]['id']}},_0x255a5d={};_0x255a5d[_0x6bab('0x28')]=_[_0x6bab('0x29')](db[_0x6bab('0x24')]['rawAttributes']);_0x255a5d['query']=_[_0x6bab('0x29')](_0xa795fd[_0x6bab('0x2a')]);_0x255a5d[_0x6bab('0x2b')]=_[_0x6bab('0x2c')](_0x255a5d[_0x6bab('0x28')],_0x255a5d[_0x6bab('0x2a')]);_0x5a02b2[_0x6bab('0x2e')]=_[_0x6bab('0x2c')](_0x255a5d['model'],qs[_0x6bab('0x2d')](_0xa795fd[_0x6bab('0x2a')][_0x6bab('0x2d')]));_0x5a02b2[_0x6bab('0x2e')]=_0x5a02b2['attributes'][_0x6bab('0x3f')]?_0x5a02b2['attributes']:_0x255a5d['model'];if(_0xa795fd[_0x6bab('0x2a')][_0x6bab('0x39')]){_0x5a02b2[_0x6bab('0x3a')]=[{'all':!![]}];}_0x5a02b2=_[_0x6bab('0x37')]({},_0x5a02b2,_0xa795fd[_0x6bab('0x38')]);return db[_0x6bab('0x24')][_0x6bab('0x40')](_0x5a02b2)['then'](handleEntityNotFound(_0x2a4e03,null))[_0x6bab('0x3c')](respondWithResult(_0x2a4e03,null))[_0x6bab('0x41')](handleError(_0x2a4e03,null));};exports[_0x6bab('0x42')]=function(_0x376624,_0x321a56){return db[_0x6bab('0x24')][_0x6bab('0x42')](_0x376624[_0x6bab('0x43')],{})['then'](respondWithResult(_0x321a56,0xc9))[_0x6bab('0x41')](handleError(_0x321a56,null));};exports[_0x6bab('0x44')]=function(_0x1df19c,_0x4954ed){if(_0x1df19c[_0x6bab('0x43')]['id']){delete _0x1df19c[_0x6bab('0x43')]['id'];}return db[_0x6bab('0x24')][_0x6bab('0x40')]({'where':{'id':_0x1df19c[_0x6bab('0x3e')]['id']}})[_0x6bab('0x3c')](handleEntityNotFound(_0x4954ed,null))['then'](saveUpdates(_0x1df19c[_0x6bab('0x43')],null))['then'](respondWithResult(_0x4954ed,null))[_0x6bab('0x41')](handleError(_0x4954ed,null));};exports[_0x6bab('0x45')]=function(_0x17d4b9,_0x23d617){return db[_0x6bab('0x24')]['find']({'where':{'id':_0x17d4b9[_0x6bab('0x3e')]['id']}})['then'](handleEntityNotFound(_0x23d617,null))[_0x6bab('0x3c')](removeEntity(_0x23d617,null))[_0x6bab('0x41')](handleError(_0x23d617,null));};exports[_0x6bab('0x46')]=function(_0x15a74e,_0x1ebdb4,_0x1e49d3){var _0x558924={};var _0x43296b={};var _0x57b49f;var _0x5b118b;return db[_0x6bab('0x24')]['findOne']({'where':{'id':_0x15a74e[_0x6bab('0x3e')]['id']}})[_0x6bab('0x3c')](handleEntityNotFound(_0x1ebdb4,null))['then'](function(_0x1dcba0){if(_0x1dcba0){_0x57b49f=_0x1dcba0;_0x43296b[_0x6bab('0x28')]=_[_0x6bab('0x29')](db[_0x6bab('0x47')][_0x6bab('0x25')]);_0x43296b[_0x6bab('0x2a')]=_[_0x6bab('0x29')](_0x15a74e[_0x6bab('0x2a')]);_0x43296b['filters']=_[_0x6bab('0x2c')](_0x43296b['model'],_0x43296b[_0x6bab('0x2a')]);_0x558924[_0x6bab('0x2e')]=_['intersection'](_0x43296b[_0x6bab('0x28')],qs['fields'](_0x15a74e['query'][_0x6bab('0x2d')]));_0x558924[_0x6bab('0x2e')]=_0x558924['attributes'][_0x6bab('0x3f')]?_0x558924[_0x6bab('0x2e')]:_0x43296b['model'];_0x558924[_0x6bab('0x31')]=qs[_0x6bab('0x48')](_0x15a74e[_0x6bab('0x2a')][_0x6bab('0x48')]);_0x558924[_0x6bab('0x34')]=qs[_0x6bab('0x2b')](_['pick'](_0x15a74e[_0x6bab('0x2a')],_0x43296b[_0x6bab('0x2b')]));if(_0x15a74e[_0x6bab('0x2a')]['filter']){_0x558924[_0x6bab('0x34')]=_['merge'](_0x558924['where'],{'$or':_[_0x6bab('0x49')](_0x558924[_0x6bab('0x2e')],function(_0x2fce17){var _0x1fb704={};_0x1fb704[_0x2fce17]={'$like':'%'+_0x15a74e[_0x6bab('0x2a')][_0x6bab('0x33')]+'%'};return _0x1fb704;})});}_0x558924=_['merge']({},_0x558924,_0x15a74e[_0x6bab('0x38')]);return _0x57b49f[_0x6bab('0x46')](_0x558924);}})[_0x6bab('0x3c')](function(_0x15ad37){if(_0x15ad37){_0x5b118b=_0x15ad37[_0x6bab('0x3f')];if(!_0x15a74e[_0x6bab('0x2a')][_0x6bab('0x2f')](_0x6bab('0x30'))){_0x558924[_0x6bab('0x1b')]=qs['limit'](_0x15a74e[_0x6bab('0x2a')][_0x6bab('0x1b')]);_0x558924[_0x6bab('0x19')]=qs['offset'](_0x15a74e[_0x6bab('0x2a')][_0x6bab('0x19')]);}return _0x57b49f[_0x6bab('0x46')](_0x558924);}})['then'](function(_0x3b60a9){if(_0x3b60a9){return _0x3b60a9?{'count':_0x5b118b,'rows':_0x3b60a9}:null;}})[_0x6bab('0x3c')](respondWithResult(_0x1ebdb4,null))[_0x6bab('0x41')](handleError(_0x1ebdb4,null));};exports['getSubjects']=function(_0x110073,_0x16b201,_0x5c74da){var _0x4743be={};var _0x20686e={};var _0x5f302f;var _0x4bea6d;return db[_0x6bab('0x24')]['findOne']({'where':{'id':_0x110073['params']['id']}})[_0x6bab('0x3c')](handleEntityNotFound(_0x16b201,null))[_0x6bab('0x3c')](function(_0x57e3a0){if(_0x57e3a0){_0x5f302f=_0x57e3a0;_0x20686e[_0x6bab('0x28')]=_[_0x6bab('0x29')](db[_0x6bab('0x47')][_0x6bab('0x25')]);_0x20686e[_0x6bab('0x2a')]=_['keys'](_0x110073[_0x6bab('0x2a')]);_0x20686e['filters']=_[_0x6bab('0x2c')](_0x20686e[_0x6bab('0x28')],_0x20686e['query']);_0x4743be[_0x6bab('0x2e')]=_['intersection'](_0x20686e['model'],qs['fields'](_0x110073[_0x6bab('0x2a')][_0x6bab('0x2d')]));_0x4743be[_0x6bab('0x2e')]=_0x4743be[_0x6bab('0x2e')][_0x6bab('0x3f')]?_0x4743be[_0x6bab('0x2e')]:_0x20686e[_0x6bab('0x28')];_0x4743be[_0x6bab('0x31')]=qs[_0x6bab('0x48')](_0x110073[_0x6bab('0x2a')][_0x6bab('0x48')]);_0x4743be[_0x6bab('0x34')]=qs[_0x6bab('0x2b')](_[_0x6bab('0x32')](_0x110073[_0x6bab('0x2a')],_0x20686e[_0x6bab('0x2b')]));if(_0x110073[_0x6bab('0x2a')][_0x6bab('0x33')]){_0x4743be[_0x6bab('0x34')]=_[_0x6bab('0x37')](_0x4743be['where'],{'$or':_[_0x6bab('0x49')](_0x4743be[_0x6bab('0x2e')],function(_0xe553c7){var _0xb3690c={};_0xb3690c[_0xe553c7]={'$like':'%'+_0x110073[_0x6bab('0x2a')][_0x6bab('0x33')]+'%'};return _0xb3690c;})});}_0x4743be=_[_0x6bab('0x37')]({},_0x4743be,_0x110073[_0x6bab('0x38')]);return _0x5f302f[_0x6bab('0x4a')](_0x4743be);}})['then'](function(_0x24bd75){if(_0x24bd75){_0x4bea6d=_0x24bd75[_0x6bab('0x3f')];if(!_0x110073[_0x6bab('0x2a')]['hasOwnProperty'](_0x6bab('0x30'))){_0x4743be['limit']=qs[_0x6bab('0x1b')](_0x110073[_0x6bab('0x2a')][_0x6bab('0x1b')]);_0x4743be[_0x6bab('0x19')]=qs[_0x6bab('0x19')](_0x110073[_0x6bab('0x2a')][_0x6bab('0x19')]);}return _0x5f302f[_0x6bab('0x4a')](_0x4743be);}})['then'](function(_0x32f5c5){if(_0x32f5c5){return _0x32f5c5?{'count':_0x4bea6d,'rows':_0x32f5c5}:null;}})[_0x6bab('0x3c')](respondWithResult(_0x16b201,null))[_0x6bab('0x41')](handleError(_0x16b201,null));};exports[_0x6bab('0x4b')]=function(_0x4f0962,_0x3c8989,_0x5d8ba5){var _0x48b94d={};var _0x261764={};var _0x22f0ff;var _0x531de6;return db[_0x6bab('0x24')]['findOne']({'where':{'id':_0x4f0962[_0x6bab('0x3e')]['id']}})[_0x6bab('0x3c')](handleEntityNotFound(_0x3c8989,null))['then'](function(_0x4192ee){if(_0x4192ee){_0x22f0ff=_0x4192ee;_0x261764['model']=_[_0x6bab('0x29')](db[_0x6bab('0x47')][_0x6bab('0x25')]);_0x261764[_0x6bab('0x2a')]=_[_0x6bab('0x29')](_0x4f0962[_0x6bab('0x2a')]);_0x261764['filters']=_[_0x6bab('0x2c')](_0x261764['model'],_0x261764[_0x6bab('0x2a')]);_0x48b94d[_0x6bab('0x2e')]=_['intersection'](_0x261764['model'],qs[_0x6bab('0x2d')](_0x4f0962[_0x6bab('0x2a')][_0x6bab('0x2d')]));_0x48b94d[_0x6bab('0x2e')]=_0x48b94d[_0x6bab('0x2e')][_0x6bab('0x3f')]?_0x48b94d[_0x6bab('0x2e')]:_0x261764[_0x6bab('0x28')];_0x48b94d[_0x6bab('0x31')]=qs[_0x6bab('0x48')](_0x4f0962[_0x6bab('0x2a')][_0x6bab('0x48')]);_0x48b94d[_0x6bab('0x34')]=qs[_0x6bab('0x2b')](_['pick'](_0x4f0962['query'],_0x261764['filters']));if(_0x4f0962[_0x6bab('0x2a')]['filter']){_0x48b94d[_0x6bab('0x34')]=_['merge'](_0x48b94d[_0x6bab('0x34')],{'$or':_['map'](_0x48b94d[_0x6bab('0x2e')],function(_0x2025df){var _0xbea6f0={};_0xbea6f0[_0x2025df]={'$like':'%'+_0x4f0962[_0x6bab('0x2a')][_0x6bab('0x33')]+'%'};return _0xbea6f0;})});}_0x48b94d=_[_0x6bab('0x37')]({},_0x48b94d,_0x4f0962[_0x6bab('0x38')]);return _0x22f0ff['getDescriptions'](_0x48b94d);}})[_0x6bab('0x3c')](function(_0x1e99ff){if(_0x1e99ff){_0x531de6=_0x1e99ff['length'];if(!_0x4f0962['query']['hasOwnProperty'](_0x6bab('0x30'))){_0x48b94d[_0x6bab('0x1b')]=qs[_0x6bab('0x1b')](_0x4f0962[_0x6bab('0x2a')][_0x6bab('0x1b')]);_0x48b94d[_0x6bab('0x19')]=qs['offset'](_0x4f0962[_0x6bab('0x2a')]['offset']);}return _0x22f0ff[_0x6bab('0x4b')](_0x48b94d);}})[_0x6bab('0x3c')](function(_0x30647d){if(_0x30647d){return _0x30647d?{'count':_0x531de6,'rows':_0x30647d}:null;}})[_0x6bab('0x3c')](respondWithResult(_0x3c8989,null))['catch'](handleError(_0x3c8989,null));}; \ No newline at end of file +var _0xb5cb=['ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','reject','then','destroy','stack','name','map','ZohoConfiguration','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','includeAll','findAll','catch','params','rawAttributes','find','create','body','getFields','ZohoField','order','getSubjects','findOne','getDescriptions','eml-format','rimraf','zip-dir','request-promise','bluebird','util','path','sox','to-csv'];(function(_0x37a9d7,_0x2b6fde){var _0x1343d3=function(_0x3bde45){while(--_0x3bde45){_0x37a9d7['push'](_0x37a9d7['shift']());}};_0x1343d3(++_0x2b6fde);}(_0xb5cb,0x1da));var _0xbb5c=function(_0x20f022,_0x1717ea){_0x20f022=_0x20f022-0x0;var _0x2b837a=_0xb5cb[_0x20f022];return _0x2b837a;};'use strict';var emlformat=require(_0xbb5c('0x0'));var rimraf=require(_0xbb5c('0x1'));var zipdir=require(_0xbb5c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbb5c('0x3'));var moment=require('moment');var BPromise=require(_0xbb5c('0x4'));var Mustache=require('mustache');var util=require(_0xbb5c('0x5'));var path=require(_0xbb5c('0x6'));var sox=require(_0xbb5c('0x7'));var csv=require(_0xbb5c('0x8'));var ejs=require(_0xbb5c('0x9'));var fs=require('fs');var fs_extra=require(_0xbb5c('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xbb5c('0xb'));var jsforce=require(_0xbb5c('0xc'));var deskjs=require(_0xbb5c('0xd'));var toCsv=require(_0xbb5c('0x8'));var querystring=require(_0xbb5c('0xe'));var Papa=require(_0xbb5c('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xbb5c('0x10'));var as=require(_0xbb5c('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbb5c('0x12'))(_0xbb5c('0x13'));var utils=require('../../config/utils');var config=require(_0xbb5c('0x14'));var licenseUtil=require(_0xbb5c('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xffd40,_0x5762e8){_0x5762e8=_0x5762e8||0xcc;return function(_0x53fad8){if(_0x53fad8){return _0xffd40[_0xbb5c('0x16')](_0x5762e8);}return _0xffd40[_0xbb5c('0x17')](_0x5762e8)[_0xbb5c('0x18')]();};}function respondWithResult(_0x10346f,_0x12ddfd){_0x12ddfd=_0x12ddfd||0xc8;return function(_0x50a815){if(_0x50a815){return _0x10346f[_0xbb5c('0x17')](_0x12ddfd)[_0xbb5c('0x19')](_0x50a815);}};}function respondWithFilteredResult(_0x5e9523,_0x7c1e8a){return function(_0xa41ec1){if(_0xa41ec1){var _0x17869c=typeof _0x7c1e8a[_0xbb5c('0x1a')]===_0xbb5c('0x1b')&&typeof _0x7c1e8a[_0xbb5c('0x1c')]===_0xbb5c('0x1b');var _0x49f84e=_0xa41ec1[_0xbb5c('0x1d')];var _0x371eaf=_0x17869c?0x0:_0x7c1e8a['offset'];var _0x202e98=_0x17869c?_0xa41ec1[_0xbb5c('0x1d')]:_0x7c1e8a[_0xbb5c('0x1a')]+_0x7c1e8a[_0xbb5c('0x1c')];var _0x2ff717;if(_0x202e98>=_0x49f84e){_0x202e98=_0x49f84e;_0x2ff717=0xc8;}else{_0x2ff717=0xce;}_0x5e9523[_0xbb5c('0x17')](_0x2ff717);return _0x5e9523['set']('Content-Range',_0x371eaf+'-'+_0x202e98+'/'+_0x49f84e)[_0xbb5c('0x19')](_0xa41ec1);}return null;};}function patchUpdates(_0x125f95){return function(_0x4d6099){try{jsonpatch['apply'](_0x4d6099,_0x125f95,!![]);}catch(_0x4bbc78){return BPromise[_0xbb5c('0x1e')](_0x4bbc78);}return _0x4d6099['save']();};}function saveUpdates(_0x5b4dda,_0x327440){return function(_0x5ab4bb){if(_0x5ab4bb){return _0x5ab4bb['update'](_0x5b4dda)[_0xbb5c('0x1f')](function(_0x5179e8){return _0x5179e8;});}return null;};}function removeEntity(_0x2355d5,_0x6424ed){return function(_0x288144){if(_0x288144){return _0x288144[_0xbb5c('0x20')]()[_0xbb5c('0x1f')](function(){_0x2355d5[_0xbb5c('0x17')](0xcc)[_0xbb5c('0x18')]();});}};}function handleEntityNotFound(_0x2925a3,_0x3829b5){return function(_0x4963ed){if(!_0x4963ed){_0x2925a3[_0xbb5c('0x16')](0x194);}return _0x4963ed;};}function handleError(_0x41c7de,_0x5055ea){_0x5055ea=_0x5055ea||0x1f4;return function(_0x4a32eb){logger['error'](_0x4a32eb[_0xbb5c('0x21')]);if(_0x4a32eb[_0xbb5c('0x22')]){delete _0x4a32eb['name'];}_0x41c7de[_0xbb5c('0x17')](_0x5055ea)['send'](_0x4a32eb);};}exports['index']=function(_0x4fe9ba,_0x93dc52){var _0x252d26={},_0xc477be={},_0x27754c={'count':0x0,'rows':[]};var _0x32ad20=_[_0xbb5c('0x23')](db[_0xbb5c('0x24')]['rawAttributes'],function(_0x38151e){return{'name':_0x38151e['fieldName'],'type':_0x38151e[_0xbb5c('0x25')][_0xbb5c('0x26')]};});_0xc477be[_0xbb5c('0x27')]=_['map'](_0x32ad20,_0xbb5c('0x22'));_0xc477be[_0xbb5c('0x28')]=_[_0xbb5c('0x29')](_0x4fe9ba[_0xbb5c('0x28')]);_0xc477be[_0xbb5c('0x2a')]=_[_0xbb5c('0x2b')](_0xc477be['model'],_0xc477be['query']);_0x252d26[_0xbb5c('0x2c')]=_[_0xbb5c('0x2b')](_0xc477be['model'],qs[_0xbb5c('0x2d')](_0x4fe9ba[_0xbb5c('0x28')][_0xbb5c('0x2d')]));_0x252d26[_0xbb5c('0x2c')]=_0x252d26[_0xbb5c('0x2c')][_0xbb5c('0x2e')]?_0x252d26['attributes']:_0xc477be['model'];if(!_0x4fe9ba[_0xbb5c('0x28')][_0xbb5c('0x2f')](_0xbb5c('0x30'))){_0x252d26[_0xbb5c('0x1c')]=qs['limit'](_0x4fe9ba[_0xbb5c('0x28')][_0xbb5c('0x1c')]);_0x252d26[_0xbb5c('0x1a')]=qs['offset'](_0x4fe9ba['query'][_0xbb5c('0x1a')]);}_0x252d26['order']=qs['sort'](_0x4fe9ba['query'][_0xbb5c('0x31')]);_0x252d26[_0xbb5c('0x32')]=qs[_0xbb5c('0x2a')](_[_0xbb5c('0x33')](_0x4fe9ba['query'],_0xc477be[_0xbb5c('0x2a')]),_0x32ad20);if(_0x4fe9ba[_0xbb5c('0x28')][_0xbb5c('0x34')]){_0x252d26[_0xbb5c('0x32')]=_[_0xbb5c('0x35')](_0x252d26[_0xbb5c('0x32')],{'$or':_[_0xbb5c('0x23')](_0x32ad20,function(_0x5b0ec7){if(_0x5b0ec7['type']!=='VIRTUAL'){var _0x39f27e={};_0x39f27e[_0x5b0ec7[_0xbb5c('0x22')]]={'$like':'%'+_0x4fe9ba['query'][_0xbb5c('0x34')]+'%'};return _0x39f27e;}})});}_0x252d26=_[_0xbb5c('0x35')]({},_0x252d26,_0x4fe9ba[_0xbb5c('0x36')]);var _0x5bdce0={'where':_0x252d26[_0xbb5c('0x32')]};return db[_0xbb5c('0x24')][_0xbb5c('0x1d')](_0x5bdce0)[_0xbb5c('0x1f')](function(_0x60b75c){_0x27754c[_0xbb5c('0x1d')]=_0x60b75c;if(_0x4fe9ba['query'][_0xbb5c('0x37')]){_0x252d26['include']=[{'all':!![]}];}return db[_0xbb5c('0x24')][_0xbb5c('0x38')](_0x252d26);})[_0xbb5c('0x1f')](function(_0x7fd29f){_0x27754c['rows']=_0x7fd29f;return _0x27754c;})[_0xbb5c('0x1f')](respondWithFilteredResult(_0x93dc52,_0x252d26))[_0xbb5c('0x39')](handleError(_0x93dc52,null));};exports['show']=function(_0x160481,_0x4ecb64){var _0xcd1cc8={'raw':![],'where':{'id':_0x160481[_0xbb5c('0x3a')]['id']}},_0x59e360={};_0x59e360[_0xbb5c('0x27')]=_[_0xbb5c('0x29')](db['ZohoConfiguration'][_0xbb5c('0x3b')]);_0x59e360[_0xbb5c('0x28')]=_[_0xbb5c('0x29')](_0x160481[_0xbb5c('0x28')]);_0x59e360[_0xbb5c('0x2a')]=_['intersection'](_0x59e360[_0xbb5c('0x27')],_0x59e360[_0xbb5c('0x28')]);_0xcd1cc8[_0xbb5c('0x2c')]=_[_0xbb5c('0x2b')](_0x59e360[_0xbb5c('0x27')],qs[_0xbb5c('0x2d')](_0x160481[_0xbb5c('0x28')]['fields']));_0xcd1cc8[_0xbb5c('0x2c')]=_0xcd1cc8[_0xbb5c('0x2c')]['length']?_0xcd1cc8[_0xbb5c('0x2c')]:_0x59e360[_0xbb5c('0x27')];if(_0x160481[_0xbb5c('0x28')]['includeAll']){_0xcd1cc8['include']=[{'all':!![]}];}_0xcd1cc8=_[_0xbb5c('0x35')]({},_0xcd1cc8,_0x160481[_0xbb5c('0x36')]);return db[_0xbb5c('0x24')][_0xbb5c('0x3c')](_0xcd1cc8)[_0xbb5c('0x1f')](handleEntityNotFound(_0x4ecb64,null))[_0xbb5c('0x1f')](respondWithResult(_0x4ecb64,null))[_0xbb5c('0x39')](handleError(_0x4ecb64,null));};exports[_0xbb5c('0x3d')]=function(_0x5e5b23,_0x494c1b){return db[_0xbb5c('0x24')]['create'](_0x5e5b23[_0xbb5c('0x3e')],{})[_0xbb5c('0x1f')](respondWithResult(_0x494c1b,0xc9))[_0xbb5c('0x39')](handleError(_0x494c1b,null));};exports['update']=function(_0xda7a18,_0x18772d){if(_0xda7a18[_0xbb5c('0x3e')]['id']){delete _0xda7a18[_0xbb5c('0x3e')]['id'];}return db[_0xbb5c('0x24')][_0xbb5c('0x3c')]({'where':{'id':_0xda7a18['params']['id']}})[_0xbb5c('0x1f')](handleEntityNotFound(_0x18772d,null))[_0xbb5c('0x1f')](saveUpdates(_0xda7a18['body'],null))['then'](respondWithResult(_0x18772d,null))['catch'](handleError(_0x18772d,null));};exports['destroy']=function(_0xcb32a6,_0xc1da1e){return db[_0xbb5c('0x24')][_0xbb5c('0x3c')]({'where':{'id':_0xcb32a6[_0xbb5c('0x3a')]['id']}})[_0xbb5c('0x1f')](handleEntityNotFound(_0xc1da1e,null))[_0xbb5c('0x1f')](removeEntity(_0xc1da1e,null))[_0xbb5c('0x39')](handleError(_0xc1da1e,null));};exports[_0xbb5c('0x3f')]=function(_0xeae34d,_0x2989c6,_0x42d541){var _0x30c365={};var _0x2e1d48={};var _0x2d0079;var _0x637d02;return db['ZohoConfiguration']['findOne']({'where':{'id':_0xeae34d[_0xbb5c('0x3a')]['id']}})[_0xbb5c('0x1f')](handleEntityNotFound(_0x2989c6,null))[_0xbb5c('0x1f')](function(_0x2f445c){if(_0x2f445c){_0x2d0079=_0x2f445c;_0x2e1d48[_0xbb5c('0x27')]=_[_0xbb5c('0x29')](db[_0xbb5c('0x40')]['rawAttributes']);_0x2e1d48[_0xbb5c('0x28')]=_['keys'](_0xeae34d['query']);_0x2e1d48[_0xbb5c('0x2a')]=_[_0xbb5c('0x2b')](_0x2e1d48[_0xbb5c('0x27')],_0x2e1d48[_0xbb5c('0x28')]);_0x30c365[_0xbb5c('0x2c')]=_[_0xbb5c('0x2b')](_0x2e1d48['model'],qs[_0xbb5c('0x2d')](_0xeae34d[_0xbb5c('0x28')]['fields']));_0x30c365[_0xbb5c('0x2c')]=_0x30c365[_0xbb5c('0x2c')][_0xbb5c('0x2e')]?_0x30c365[_0xbb5c('0x2c')]:_0x2e1d48[_0xbb5c('0x27')];_0x30c365[_0xbb5c('0x41')]=qs[_0xbb5c('0x31')](_0xeae34d[_0xbb5c('0x28')][_0xbb5c('0x31')]);_0x30c365[_0xbb5c('0x32')]=qs['filters'](_['pick'](_0xeae34d['query'],_0x2e1d48['filters']));if(_0xeae34d[_0xbb5c('0x28')][_0xbb5c('0x34')]){_0x30c365[_0xbb5c('0x32')]=_[_0xbb5c('0x35')](_0x30c365['where'],{'$or':_[_0xbb5c('0x23')](_0x30c365[_0xbb5c('0x2c')],function(_0x1ce93e){var _0xe0da43={};_0xe0da43[_0x1ce93e]={'$like':'%'+_0xeae34d[_0xbb5c('0x28')][_0xbb5c('0x34')]+'%'};return _0xe0da43;})});}_0x30c365=_['merge']({},_0x30c365,_0xeae34d[_0xbb5c('0x36')]);return _0x2d0079[_0xbb5c('0x3f')](_0x30c365);}})['then'](function(_0x3e069a){if(_0x3e069a){_0x637d02=_0x3e069a[_0xbb5c('0x2e')];if(!_0xeae34d[_0xbb5c('0x28')][_0xbb5c('0x2f')](_0xbb5c('0x30'))){_0x30c365[_0xbb5c('0x1c')]=qs[_0xbb5c('0x1c')](_0xeae34d['query']['limit']);_0x30c365['offset']=qs[_0xbb5c('0x1a')](_0xeae34d['query'][_0xbb5c('0x1a')]);}return _0x2d0079[_0xbb5c('0x3f')](_0x30c365);}})[_0xbb5c('0x1f')](function(_0x159f69){if(_0x159f69){return _0x159f69?{'count':_0x637d02,'rows':_0x159f69}:null;}})[_0xbb5c('0x1f')](respondWithResult(_0x2989c6,null))[_0xbb5c('0x39')](handleError(_0x2989c6,null));};exports[_0xbb5c('0x42')]=function(_0x334b3a,_0x9fce33,_0x4606ee){var _0x167aac={};var _0x33b807={};var _0x21691f;var _0x34d16e;return db['ZohoConfiguration'][_0xbb5c('0x43')]({'where':{'id':_0x334b3a[_0xbb5c('0x3a')]['id']}})[_0xbb5c('0x1f')](handleEntityNotFound(_0x9fce33,null))['then'](function(_0x36dc7e){if(_0x36dc7e){_0x21691f=_0x36dc7e;_0x33b807[_0xbb5c('0x27')]=_[_0xbb5c('0x29')](db[_0xbb5c('0x40')][_0xbb5c('0x3b')]);_0x33b807[_0xbb5c('0x28')]=_[_0xbb5c('0x29')](_0x334b3a[_0xbb5c('0x28')]);_0x33b807[_0xbb5c('0x2a')]=_[_0xbb5c('0x2b')](_0x33b807[_0xbb5c('0x27')],_0x33b807['query']);_0x167aac['attributes']=_[_0xbb5c('0x2b')](_0x33b807['model'],qs[_0xbb5c('0x2d')](_0x334b3a['query']['fields']));_0x167aac[_0xbb5c('0x2c')]=_0x167aac['attributes'][_0xbb5c('0x2e')]?_0x167aac[_0xbb5c('0x2c')]:_0x33b807[_0xbb5c('0x27')];_0x167aac[_0xbb5c('0x41')]=qs['sort'](_0x334b3a['query'][_0xbb5c('0x31')]);_0x167aac[_0xbb5c('0x32')]=qs[_0xbb5c('0x2a')](_[_0xbb5c('0x33')](_0x334b3a[_0xbb5c('0x28')],_0x33b807['filters']));if(_0x334b3a[_0xbb5c('0x28')][_0xbb5c('0x34')]){_0x167aac[_0xbb5c('0x32')]=_[_0xbb5c('0x35')](_0x167aac[_0xbb5c('0x32')],{'$or':_[_0xbb5c('0x23')](_0x167aac['attributes'],function(_0x5449fa){var _0x51f7b8={};_0x51f7b8[_0x5449fa]={'$like':'%'+_0x334b3a[_0xbb5c('0x28')]['filter']+'%'};return _0x51f7b8;})});}_0x167aac=_['merge']({},_0x167aac,_0x334b3a[_0xbb5c('0x36')]);return _0x21691f[_0xbb5c('0x42')](_0x167aac);}})['then'](function(_0x1f1d8c){if(_0x1f1d8c){_0x34d16e=_0x1f1d8c[_0xbb5c('0x2e')];if(!_0x334b3a[_0xbb5c('0x28')][_0xbb5c('0x2f')]('nolimit')){_0x167aac['limit']=qs['limit'](_0x334b3a['query']['limit']);_0x167aac[_0xbb5c('0x1a')]=qs[_0xbb5c('0x1a')](_0x334b3a[_0xbb5c('0x28')][_0xbb5c('0x1a')]);}return _0x21691f[_0xbb5c('0x42')](_0x167aac);}})['then'](function(_0x73afc6){if(_0x73afc6){return _0x73afc6?{'count':_0x34d16e,'rows':_0x73afc6}:null;}})['then'](respondWithResult(_0x9fce33,null))[_0xbb5c('0x39')](handleError(_0x9fce33,null));};exports[_0xbb5c('0x44')]=function(_0x3412e4,_0xe2e113,_0x4f0e79){var _0x4d3564={};var _0x123df5={};var _0x363d1a;var _0x589ba4;return db[_0xbb5c('0x24')][_0xbb5c('0x43')]({'where':{'id':_0x3412e4[_0xbb5c('0x3a')]['id']}})[_0xbb5c('0x1f')](handleEntityNotFound(_0xe2e113,null))[_0xbb5c('0x1f')](function(_0x3577af){if(_0x3577af){_0x363d1a=_0x3577af;_0x123df5[_0xbb5c('0x27')]=_[_0xbb5c('0x29')](db[_0xbb5c('0x40')][_0xbb5c('0x3b')]);_0x123df5[_0xbb5c('0x28')]=_[_0xbb5c('0x29')](_0x3412e4[_0xbb5c('0x28')]);_0x123df5[_0xbb5c('0x2a')]=_['intersection'](_0x123df5[_0xbb5c('0x27')],_0x123df5[_0xbb5c('0x28')]);_0x4d3564[_0xbb5c('0x2c')]=_[_0xbb5c('0x2b')](_0x123df5[_0xbb5c('0x27')],qs[_0xbb5c('0x2d')](_0x3412e4[_0xbb5c('0x28')][_0xbb5c('0x2d')]));_0x4d3564[_0xbb5c('0x2c')]=_0x4d3564[_0xbb5c('0x2c')][_0xbb5c('0x2e')]?_0x4d3564['attributes']:_0x123df5['model'];_0x4d3564[_0xbb5c('0x41')]=qs[_0xbb5c('0x31')](_0x3412e4['query'][_0xbb5c('0x31')]);_0x4d3564[_0xbb5c('0x32')]=qs[_0xbb5c('0x2a')](_['pick'](_0x3412e4[_0xbb5c('0x28')],_0x123df5[_0xbb5c('0x2a')]));if(_0x3412e4['query'][_0xbb5c('0x34')]){_0x4d3564['where']=_[_0xbb5c('0x35')](_0x4d3564[_0xbb5c('0x32')],{'$or':_[_0xbb5c('0x23')](_0x4d3564[_0xbb5c('0x2c')],function(_0x3f5c17){var _0x57e23b={};_0x57e23b[_0x3f5c17]={'$like':'%'+_0x3412e4[_0xbb5c('0x28')]['filter']+'%'};return _0x57e23b;})});}_0x4d3564=_[_0xbb5c('0x35')]({},_0x4d3564,_0x3412e4[_0xbb5c('0x36')]);return _0x363d1a['getDescriptions'](_0x4d3564);}})['then'](function(_0x469984){if(_0x469984){_0x589ba4=_0x469984[_0xbb5c('0x2e')];if(!_0x3412e4[_0xbb5c('0x28')][_0xbb5c('0x2f')](_0xbb5c('0x30'))){_0x4d3564[_0xbb5c('0x1c')]=qs[_0xbb5c('0x1c')](_0x3412e4[_0xbb5c('0x28')]['limit']);_0x4d3564[_0xbb5c('0x1a')]=qs['offset'](_0x3412e4[_0xbb5c('0x28')]['offset']);}return _0x363d1a[_0xbb5c('0x44')](_0x4d3564);}})[_0xbb5c('0x1f')](function(_0x4c5b30){if(_0x4c5b30){return _0x4c5b30?{'count':_0x589ba4,'rows':_0x4c5b30}:null;}})[_0xbb5c('0x1f')](respondWithResult(_0xe2e113,null))[_0xbb5c('0x39')](handleError(_0xe2e113,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index 6182ce4..497b729 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 _0x4225=['./intZohoConfiguration.attributes','ZohoConfiguration','int_zoho_configurations','lodash','util','../../config/logger','moment','bluebird'];(function(_0x1bef92,_0x51d606){var _0x3c0400=function(_0x382ff0){while(--_0x382ff0){_0x1bef92['push'](_0x1bef92['shift']());}};_0x3c0400(++_0x51d606);}(_0x4225,0x10b));var _0x5422=function(_0x7db900,_0x1e5f2e){_0x7db900=_0x7db900-0x0;var _0x12ada8=_0x4225[_0x7db900];return _0x12ada8;};'use strict';var _=require(_0x5422('0x0'));var util=require(_0x5422('0x1'));var logger=require(_0x5422('0x2'))('api');var moment=require(_0x5422('0x3'));var BPromise=require(_0x5422('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(_0x5422('0x5'));module['exports']=function(_0x18384b,_0x32c179){return _0x18384b['define'](_0x5422('0x6'),attributes,{'tableName':_0x5422('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5c09=['define','ZohoConfiguration','int_zoho_configurations','lodash','../../config/logger','request-promise','path','rimraf','../../config/environment','./intZohoConfiguration.attributes'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x5c09,0xa3));var _0x95c0=function(_0x4b3892,_0xe717e6){_0x4b3892=_0x4b3892-0x0;var _0x3ae6fc=_0x5c09[_0x4b3892];return _0x3ae6fc;};'use strict';var _=require(_0x95c0('0x0'));var util=require('util');var logger=require(_0x95c0('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x95c0('0x2'));var fs=require('fs');var path=require(_0x95c0('0x3'));var rimraf=require(_0x95c0('0x4'));var config=require(_0x95c0('0x5'));var attributes=require(_0x95c0('0x6'));module['exports']=function(_0x30f5f0,_0x12555a){return _0x30f5f0[_0x95c0('0x7')](_0x95c0('0x8'),attributes,{'tableName':_0x95c0('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js b/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js index 21ac5d0..29030dc 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 _0x4e76=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info'];(function(_0x38db92,_0x593c17){var _0x544d98=function(_0x5885eb){while(--_0x5885eb){_0x38db92['push'](_0x38db92['shift']());}};_0x544d98(++_0x593c17);}(_0x4e76,0x147));var _0x64e7=function(_0x5502a7,_0x325618){_0x5502a7=_0x5502a7-0x0;var _0x3946fa=_0x4e76[_0x5502a7];return _0x3946fa;};'use strict';var _=require(_0x64e7('0x0'));var util=require(_0x64e7('0x1'));var moment=require(_0x64e7('0x2'));var BPromise=require(_0x64e7('0x3'));var rs=require(_0x64e7('0x4'));var fs=require('fs');var Redis=require(_0x64e7('0x5'));var db=require(_0x64e7('0x6'))['db'];var utils=require(_0x64e7('0x7'));var logger=require(_0x64e7('0x8'))(_0x64e7('0x9'));var config=require(_0x64e7('0xa'));var jayson=require(_0x64e7('0xb'));var client=jayson['client'][_0x64e7('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x16408a,_0x2fa014,_0x16190a){return new BPromise(function(_0x2e732a,_0x182f1b){return client[_0x64e7('0xd')](_0x16408a,_0x16190a)[_0x64e7('0xe')](function(_0x5cf86b){logger['info'](_0x64e7('0xf'),_0x2fa014,_0x64e7('0x10'));logger[_0x64e7('0x11')]('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x2fa014,_0x64e7('0x10'),JSON[_0x64e7('0x12')](_0x5cf86b));if(_0x5cf86b[_0x64e7('0x13')]){if(_0x5cf86b[_0x64e7('0x13')][_0x64e7('0x14')]===0x1f4){logger[_0x64e7('0x13')](_0x64e7('0xf'),_0x2fa014,_0x5cf86b[_0x64e7('0x13')][_0x64e7('0x15')]);return _0x182f1b(_0x5cf86b['error'][_0x64e7('0x15')]);}logger[_0x64e7('0x13')](_0x64e7('0xf'),_0x2fa014,_0x5cf86b['error'][_0x64e7('0x15')]);return _0x2e732a(_0x5cf86b[_0x64e7('0x13')][_0x64e7('0x15')]);}else{logger[_0x64e7('0x16')](_0x64e7('0xf'),_0x2fa014,_0x64e7('0x10'));_0x2e732a(_0x5cf86b[_0x64e7('0x17')][_0x64e7('0x15')]);}})[_0x64e7('0x18')](function(_0x14fd93){logger[_0x64e7('0x13')](_0x64e7('0xf'),_0x2fa014,_0x14fd93);_0x182f1b(_0x14fd93);});});} \ No newline at end of file +var _0x48cc=['then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','util','moment','bluebird','randomstring','../../config/utils','../../config/environment','jayson/promise','http','request'];(function(_0x310a1b,_0x4c9129){var _0xdea206=function(_0x1f1e8d){while(--_0x1f1e8d){_0x310a1b['push'](_0x310a1b['shift']());}};_0xdea206(++_0x4c9129);}(_0x48cc,0x7c));var _0xc48c=function(_0x5999d9,_0x236c5e){_0x5999d9=_0x5999d9-0x0;var _0x33b836=_0x48cc[_0x5999d9];return _0x33b836;};'use strict';var _=require('lodash');var util=require(_0xc48c('0x0'));var moment=require(_0xc48c('0x1'));var BPromise=require(_0xc48c('0x2'));var rs=require(_0xc48c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xc48c('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xc48c('0x5'));var jayson=require(_0xc48c('0x6'));var client=jayson['client'][_0xc48c('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x34ca4e,_0x4a42dd,_0x4b7b8c){return new BPromise(function(_0x284aae,_0x584e53){return client[_0xc48c('0x8')](_0x34ca4e,_0x4b7b8c)[_0xc48c('0x9')](function(_0xc21d04){logger[_0xc48c('0xa')](_0xc48c('0xb'),_0x4a42dd,_0xc48c('0xc'));logger[_0xc48c('0xd')](_0xc48c('0xe'),_0x4a42dd,_0xc48c('0xc'),JSON['stringify'](_0xc21d04));if(_0xc21d04['error']){if(_0xc21d04[_0xc48c('0xf')][_0xc48c('0x10')]===0x1f4){logger[_0xc48c('0xf')]('ZohoConfiguration,\x20%s,\x20%s',_0x4a42dd,_0xc21d04[_0xc48c('0xf')][_0xc48c('0x11')]);return _0x584e53(_0xc21d04[_0xc48c('0xf')][_0xc48c('0x11')]);}logger[_0xc48c('0xf')](_0xc48c('0xb'),_0x4a42dd,_0xc21d04[_0xc48c('0xf')][_0xc48c('0x11')]);return _0x284aae(_0xc21d04[_0xc48c('0xf')][_0xc48c('0x11')]);}else{logger[_0xc48c('0xa')](_0xc48c('0xb'),_0x4a42dd,'request\x20sent');_0x284aae(_0xc21d04[_0xc48c('0x12')]['message']);}})['catch'](function(_0x405aad){logger[_0xc48c('0xf')](_0xc48c('0xb'),_0x4a42dd,_0x405aad);_0x584e53(_0x405aad);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index 4c6b8a5..479dcf4 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 _0xa904=['/:id','isAuthenticated','show','post','create','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../config/environment','./intZohoField.controller','get'];(function(_0x43f1f6,_0x1f908c){var _0x377ab8=function(_0x33e4f4){while(--_0x33e4f4){_0x43f1f6['push'](_0x43f1f6['shift']());}};_0x377ab8(++_0x1f908c);}(_0xa904,0x75));var _0x4a90=function(_0x58d5ac,_0x11c4bc){_0x58d5ac=_0x58d5ac-0x0;var _0x37985c=_0xa904[_0x58d5ac];return _0x37985c;};'use strict';var multer=require(_0x4a90('0x0'));var util=require(_0x4a90('0x1'));var path=require(_0x4a90('0x2'));var timeout=require('connect-timeout');var express=require(_0x4a90('0x3'));var router=express[_0x4a90('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x4a90('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x4a90('0x6'));var controller=require(_0x4a90('0x7'));router[_0x4a90('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x4a90('0x9'),auth[_0x4a90('0xa')](),controller[_0x4a90('0xb')]);router[_0x4a90('0xc')]('/',auth[_0x4a90('0xa')](),controller[_0x4a90('0xd')]);router['put'](_0x4a90('0x9'),auth[_0x4a90('0xa')](),controller[_0x4a90('0xe')]);router[_0x4a90('0xf')](_0x4a90('0x9'),auth[_0x4a90('0xa')](),controller[_0x4a90('0x10')]);module[_0x4a90('0x11')]=router; \ No newline at end of file +var _0xf97c=['create','update','delete','destroy','exports','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoField.controller','get','isAuthenticated','/:id','show','post'];(function(_0x50c599,_0x21de75){var _0x245ca1=function(_0x3a1de8){while(--_0x3a1de8){_0x50c599['push'](_0x50c599['shift']());}};_0x245ca1(++_0x21de75);}(_0xf97c,0x125));var _0xcf97=function(_0x8e74c4,_0x4c3b72){_0x8e74c4=_0x8e74c4-0x0;var _0x50e53f=_0xf97c[_0x8e74c4];return _0x50e53f;};'use strict';var multer=require(_0xcf97('0x0'));var util=require(_0xcf97('0x1'));var path=require('path');var timeout=require(_0xcf97('0x2'));var express=require(_0xcf97('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xcf97('0x4'));var interaction=require(_0xcf97('0x5'));var config=require(_0xcf97('0x6'));var controller=require(_0xcf97('0x7'));router[_0xcf97('0x8')]('/',auth[_0xcf97('0x9')](),controller['index']);router[_0xcf97('0x8')](_0xcf97('0xa'),auth[_0xcf97('0x9')](),controller[_0xcf97('0xb')]);router[_0xcf97('0xc')]('/',auth[_0xcf97('0x9')](),controller[_0xcf97('0xd')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xcf97('0xe')]);router[_0xcf97('0xf')](_0xcf97('0xa'),auth['isAuthenticated'](),controller[_0xcf97('0x10')]);module[_0xcf97('0x11')]=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index 6347354..0ead9b1 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 _0x7dc7=['BOOLEAN','sequelize','ENUM','variable','customVariable','keyValue','string','STRING'];(function(_0x4642b6,_0x29b10d){var _0x43f675=function(_0x580965){while(--_0x580965){_0x4642b6['push'](_0x4642b6['shift']());}};_0x43f675(++_0x29b10d);}(_0x7dc7,0x81));var _0x77dc=function(_0xa11e23,_0x53a81f){_0xa11e23=_0xa11e23-0x0;var _0x4b47a0=_0x7dc7[_0xa11e23];return _0x4b47a0;};'use strict';var Sequelize=require(_0x77dc('0x0'));module['exports']={'type':{'type':Sequelize[_0x77dc('0x1')]('string',_0x77dc('0x2'),_0x77dc('0x3'),_0x77dc('0x4'),'picklist'),'defaultValue':_0x77dc('0x5')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x77dc('0x1')](_0x77dc('0x5'),_0x77dc('0x2'),_0x77dc('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x77dc('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x77dc('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xf8d9=['variable','customVariable','keyValue','picklist','ENUM','STRING','sequelize','exports','string'];(function(_0x5d3a7f,_0x3569ba){var _0x34c7b7=function(_0x270c71){while(--_0x270c71){_0x5d3a7f['push'](_0x5d3a7f['shift']());}};_0x34c7b7(++_0x3569ba);}(_0xf8d9,0x1da));var _0x9f8d=function(_0x3de4f8,_0x336c7d){_0x3de4f8=_0x3de4f8-0x0;var _0x3d81fc=_0xf8d9[_0x3de4f8];return _0x3d81fc;};'use strict';var Sequelize=require(_0x9f8d('0x0'));module[_0x9f8d('0x1')]={'type':{'type':Sequelize['ENUM'](_0x9f8d('0x2'),_0x9f8d('0x3'),_0x9f8d('0x4'),_0x9f8d('0x5'),_0x9f8d('0x6')),'defaultValue':_0x9f8d('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x9f8d('0x7')](_0x9f8d('0x2'),_0x9f8d('0x3'),_0x9f8d('0x4'))},'keyContent':{'type':Sequelize[_0x9f8d('0x8')]},'idField':{'type':Sequelize[_0x9f8d('0x8')]},'nameField':{'type':Sequelize[_0x9f8d('0x8')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index 84a00e7..3ea0f1e 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 _0x7915=['../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','name','send','index','map','ZohoField','rawAttributes','fieldName','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','type','options','includeAll','findAll','rows','show','params','keys','include','find','catch','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x294925,_0x4ac28e){var _0xb19f18=function(_0x546d18){while(--_0x546d18){_0x294925['push'](_0x294925['shift']());}};_0xb19f18(++_0x4ac28e);}(_0x7915,0x1a9));var _0x5791=function(_0x4fa08a,_0x45b34e){_0x4fa08a=_0x4fa08a-0x0;var _0x514789=_0x7915[_0x4fa08a];return _0x514789;};'use strict';var emlformat=require(_0x5791('0x0'));var rimraf=require(_0x5791('0x1'));var zipdir=require(_0x5791('0x2'));var jsonpatch=require(_0x5791('0x3'));var rp=require(_0x5791('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x5791('0x5'));var util=require(_0x5791('0x6'));var path=require(_0x5791('0x7'));var sox=require(_0x5791('0x8'));var csv=require('to-csv');var ejs=require(_0x5791('0x9'));var fs=require('fs');var fs_extra=require(_0x5791('0xa'));var _=require(_0x5791('0xb'));var squel=require(_0x5791('0xc'));var crypto=require(_0x5791('0xd'));var jsforce=require(_0x5791('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5791('0xf'));var querystring=require(_0x5791('0x10'));var Papa=require(_0x5791('0x11'));var Redis=require('ioredis');var authService=require(_0x5791('0x12'));var qs=require(_0x5791('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5791('0x14'));var logger=require(_0x5791('0x15'))(_0x5791('0x16'));var utils=require(_0x5791('0x17'));var config=require(_0x5791('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x5791('0x19'))['db'];function respondWithStatusCode(_0x28dcfb,_0x37934e){_0x37934e=_0x37934e||0xcc;return function(_0x53eb50){if(_0x53eb50){return _0x28dcfb[_0x5791('0x1a')](_0x37934e);}return _0x28dcfb[_0x5791('0x1b')](_0x37934e)[_0x5791('0x1c')]();};}function respondWithResult(_0x2f6462,_0x16874a){_0x16874a=_0x16874a||0xc8;return function(_0x1209a1){if(_0x1209a1){return _0x2f6462[_0x5791('0x1b')](_0x16874a)[_0x5791('0x1d')](_0x1209a1);}};}function respondWithFilteredResult(_0x453f19,_0x345af3){return function(_0x5c4a6e){if(_0x5c4a6e){var _0x328e26=typeof _0x345af3[_0x5791('0x1e')]===_0x5791('0x1f')&&typeof _0x345af3[_0x5791('0x20')]===_0x5791('0x1f');var _0x11a449=_0x5c4a6e[_0x5791('0x21')];var _0x4f342c=_0x328e26?0x0:_0x345af3[_0x5791('0x1e')];var _0x42633c=_0x328e26?_0x5c4a6e[_0x5791('0x21')]:_0x345af3[_0x5791('0x1e')]+_0x345af3['limit'];var _0x23cdc2;if(_0x42633c>=_0x11a449){_0x42633c=_0x11a449;_0x23cdc2=0xc8;}else{_0x23cdc2=0xce;}_0x453f19[_0x5791('0x1b')](_0x23cdc2);return _0x453f19[_0x5791('0x22')](_0x5791('0x23'),_0x4f342c+'-'+_0x42633c+'/'+_0x11a449)[_0x5791('0x1d')](_0x5c4a6e);}return null;};}function patchUpdates(_0x5841bf){return function(_0x1cbedd){try{jsonpatch[_0x5791('0x24')](_0x1cbedd,_0x5841bf,!![]);}catch(_0x178fc5){return BPromise[_0x5791('0x25')](_0x178fc5);}return _0x1cbedd['save']();};}function saveUpdates(_0x4da09c,_0x3e6b17){return function(_0x25a1b1){if(_0x25a1b1){return _0x25a1b1[_0x5791('0x26')](_0x4da09c)[_0x5791('0x27')](function(_0x57900d){return _0x57900d;});}return null;};}function removeEntity(_0x4f9f81,_0x1bd93b){return function(_0xe8a1dd){if(_0xe8a1dd){return _0xe8a1dd[_0x5791('0x28')]()[_0x5791('0x27')](function(){_0x4f9f81['status'](0xcc)[_0x5791('0x1c')]();});}};}function handleEntityNotFound(_0x5eeb03,_0x17e85f){return function(_0x95262c){if(!_0x95262c){_0x5eeb03[_0x5791('0x1a')](0x194);}return _0x95262c;};}function handleError(_0x579797,_0x4eaa5d){_0x4eaa5d=_0x4eaa5d||0x1f4;return function(_0x5b2d42){logger[_0x5791('0x29')](_0x5b2d42['stack']);if(_0x5b2d42['name']){delete _0x5b2d42[_0x5791('0x2a')];}_0x579797['status'](_0x4eaa5d)[_0x5791('0x2b')](_0x5b2d42);};}exports[_0x5791('0x2c')]=function(_0x4c1c7f,_0x538d76){var _0x92421a={},_0x226f90={},_0x5eadc7={'count':0x0,'rows':[]};var _0x2769d3=_[_0x5791('0x2d')](db[_0x5791('0x2e')][_0x5791('0x2f')],function(_0x342875){return{'name':_0x342875[_0x5791('0x30')],'type':_0x342875['type'][_0x5791('0x31')]};});_0x226f90['model']=_['map'](_0x2769d3,_0x5791('0x2a'));_0x226f90[_0x5791('0x32')]=_['keys'](_0x4c1c7f[_0x5791('0x32')]);_0x226f90[_0x5791('0x33')]=_[_0x5791('0x34')](_0x226f90[_0x5791('0x35')],_0x226f90['query']);_0x92421a[_0x5791('0x36')]=_[_0x5791('0x34')](_0x226f90[_0x5791('0x35')],qs[_0x5791('0x37')](_0x4c1c7f[_0x5791('0x32')][_0x5791('0x37')]));_0x92421a[_0x5791('0x36')]=_0x92421a[_0x5791('0x36')][_0x5791('0x38')]?_0x92421a['attributes']:_0x226f90[_0x5791('0x35')];if(!_0x4c1c7f[_0x5791('0x32')][_0x5791('0x39')]('nolimit')){_0x92421a['limit']=qs[_0x5791('0x20')](_0x4c1c7f['query'][_0x5791('0x20')]);_0x92421a[_0x5791('0x1e')]=qs[_0x5791('0x1e')](_0x4c1c7f[_0x5791('0x32')][_0x5791('0x1e')]);}_0x92421a['order']=qs[_0x5791('0x3a')](_0x4c1c7f[_0x5791('0x32')][_0x5791('0x3a')]);_0x92421a[_0x5791('0x3b')]=qs[_0x5791('0x33')](_[_0x5791('0x3c')](_0x4c1c7f[_0x5791('0x32')],_0x226f90[_0x5791('0x33')]),_0x2769d3);if(_0x4c1c7f[_0x5791('0x32')][_0x5791('0x3d')]){_0x92421a[_0x5791('0x3b')]=_[_0x5791('0x3e')](_0x92421a[_0x5791('0x3b')],{'$or':_[_0x5791('0x2d')](_0x2769d3,function(_0x23a1d1){if(_0x23a1d1[_0x5791('0x3f')]!=='VIRTUAL'){var _0x53c4fc={};_0x53c4fc[_0x23a1d1[_0x5791('0x2a')]]={'$like':'%'+_0x4c1c7f['query'][_0x5791('0x3d')]+'%'};return _0x53c4fc;}})});}_0x92421a=_[_0x5791('0x3e')]({},_0x92421a,_0x4c1c7f[_0x5791('0x40')]);var _0x3e4b8a={'where':_0x92421a[_0x5791('0x3b')]};return db[_0x5791('0x2e')][_0x5791('0x21')](_0x3e4b8a)[_0x5791('0x27')](function(_0x47a2ef){_0x5eadc7[_0x5791('0x21')]=_0x47a2ef;if(_0x4c1c7f[_0x5791('0x32')][_0x5791('0x41')]){_0x92421a['include']=[{'all':!![]}];}return db['ZohoField'][_0x5791('0x42')](_0x92421a);})[_0x5791('0x27')](function(_0x39e2d1){_0x5eadc7[_0x5791('0x43')]=_0x39e2d1;return _0x5eadc7;})['then'](respondWithFilteredResult(_0x538d76,_0x92421a))['catch'](handleError(_0x538d76,null));};exports[_0x5791('0x44')]=function(_0x39c11e,_0x39fe41){var _0x5660b8={'raw':!![],'where':{'id':_0x39c11e[_0x5791('0x45')]['id']}},_0x359055={};_0x359055[_0x5791('0x35')]=_[_0x5791('0x46')](db[_0x5791('0x2e')]['rawAttributes']);_0x359055[_0x5791('0x32')]=_[_0x5791('0x46')](_0x39c11e[_0x5791('0x32')]);_0x359055[_0x5791('0x33')]=_[_0x5791('0x34')](_0x359055[_0x5791('0x35')],_0x359055[_0x5791('0x32')]);_0x5660b8['attributes']=_[_0x5791('0x34')](_0x359055[_0x5791('0x35')],qs[_0x5791('0x37')](_0x39c11e[_0x5791('0x32')]['fields']));_0x5660b8[_0x5791('0x36')]=_0x5660b8[_0x5791('0x36')]['length']?_0x5660b8['attributes']:_0x359055[_0x5791('0x35')];if(_0x39c11e[_0x5791('0x32')][_0x5791('0x41')]){_0x5660b8[_0x5791('0x47')]=[{'all':!![]}];}_0x5660b8=_['merge']({},_0x5660b8,_0x39c11e[_0x5791('0x40')]);return db['ZohoField'][_0x5791('0x48')](_0x5660b8)[_0x5791('0x27')](handleEntityNotFound(_0x39fe41,null))['then'](respondWithResult(_0x39fe41,null))[_0x5791('0x49')](handleError(_0x39fe41,null));};exports['create']=function(_0x252aee,_0x181a08){return db[_0x5791('0x2e')]['create'](_0x252aee[_0x5791('0x4a')],{})['then'](respondWithResult(_0x181a08,0xc9))[_0x5791('0x49')](handleError(_0x181a08,null));};exports[_0x5791('0x26')]=function(_0x5f0873,_0x1ecf33){if(_0x5f0873[_0x5791('0x4a')]['id']){delete _0x5f0873[_0x5791('0x4a')]['id'];}return db[_0x5791('0x2e')][_0x5791('0x48')]({'where':{'id':_0x5f0873['params']['id']}})[_0x5791('0x27')](handleEntityNotFound(_0x1ecf33,null))[_0x5791('0x27')](saveUpdates(_0x5f0873['body'],null))[_0x5791('0x27')](respondWithResult(_0x1ecf33,null))[_0x5791('0x49')](handleError(_0x1ecf33,null));};exports[_0x5791('0x28')]=function(_0xd31bf2,_0x474337){return db[_0x5791('0x2e')][_0x5791('0x48')]({'where':{'id':_0xd31bf2[_0x5791('0x45')]['id']}})[_0x5791('0x27')](handleEntityNotFound(_0x474337,null))[_0x5791('0x27')](removeEntity(_0x474337,null))[_0x5791('0x49')](handleError(_0x474337,null));}; \ No newline at end of file +var _0x457b=['set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ZohoField','fieldName','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','map','type','VIRTUAL','findAll','rows','catch','show','params','rawAttributes','include','options','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count'];(function(_0x13b5c8,_0x10461e){var _0x53ddcf=function(_0x68ee9c){while(--_0x68ee9c){_0x13b5c8['push'](_0x13b5c8['shift']());}};_0x53ddcf(++_0x10461e);}(_0x457b,0xca));var _0xb457=function(_0x1d7b23,_0x75416d){_0x1d7b23=_0x1d7b23-0x0;var _0x50fd26=_0x457b[_0x1d7b23];return _0x50fd26;};'use strict';var emlformat=require(_0xb457('0x0'));var rimraf=require(_0xb457('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb457('0x2'));var rp=require(_0xb457('0x3'));var moment=require(_0xb457('0x4'));var BPromise=require(_0xb457('0x5'));var Mustache=require(_0xb457('0x6'));var util=require('util');var path=require(_0xb457('0x7'));var sox=require(_0xb457('0x8'));var csv=require(_0xb457('0x9'));var ejs=require(_0xb457('0xa'));var fs=require('fs');var fs_extra=require(_0xb457('0xb'));var _=require('lodash');var squel=require(_0xb457('0xc'));var crypto=require(_0xb457('0xd'));var jsforce=require(_0xb457('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xb457('0xf'));var Papa=require(_0xb457('0x10'));var Redis=require(_0xb457('0x11'));var authService=require(_0xb457('0x12'));var qs=require(_0xb457('0x13'));var as=require(_0xb457('0x14'));var hardwareService=require(_0xb457('0x15'));var logger=require(_0xb457('0x16'))(_0xb457('0x17'));var utils=require(_0xb457('0x18'));var config=require(_0xb457('0x19'));var licenseUtil=require(_0xb457('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x595609,_0x1c9f97){_0x1c9f97=_0x1c9f97||0xcc;return function(_0x992b23){if(_0x992b23){return _0x595609[_0xb457('0x1b')](_0x1c9f97);}return _0x595609[_0xb457('0x1c')](_0x1c9f97)[_0xb457('0x1d')]();};}function respondWithResult(_0x5f1ced,_0x559e4b){_0x559e4b=_0x559e4b||0xc8;return function(_0x3b845){if(_0x3b845){return _0x5f1ced[_0xb457('0x1c')](_0x559e4b)[_0xb457('0x1e')](_0x3b845);}};}function respondWithFilteredResult(_0x2333a3,_0x5cd83c){return function(_0x327140){if(_0x327140){var _0xbbfda5=typeof _0x5cd83c[_0xb457('0x1f')]===_0xb457('0x20')&&typeof _0x5cd83c[_0xb457('0x21')]===_0xb457('0x20');var _0x33bfc6=_0x327140[_0xb457('0x22')];var _0x54903c=_0xbbfda5?0x0:_0x5cd83c[_0xb457('0x1f')];var _0x3218f1=_0xbbfda5?_0x327140[_0xb457('0x22')]:_0x5cd83c['offset']+_0x5cd83c['limit'];var _0x4685f7;if(_0x3218f1>=_0x33bfc6){_0x3218f1=_0x33bfc6;_0x4685f7=0xc8;}else{_0x4685f7=0xce;}_0x2333a3[_0xb457('0x1c')](_0x4685f7);return _0x2333a3[_0xb457('0x23')](_0xb457('0x24'),_0x54903c+'-'+_0x3218f1+'/'+_0x33bfc6)[_0xb457('0x1e')](_0x327140);}return null;};}function patchUpdates(_0x383706){return function(_0x1e9e1d){try{jsonpatch['apply'](_0x1e9e1d,_0x383706,!![]);}catch(_0x4aa6b4){return BPromise[_0xb457('0x25')](_0x4aa6b4);}return _0x1e9e1d[_0xb457('0x26')]();};}function saveUpdates(_0x1f85ab,_0x588b53){return function(_0x23f90d){if(_0x23f90d){return _0x23f90d[_0xb457('0x27')](_0x1f85ab)[_0xb457('0x28')](function(_0x48dead){return _0x48dead;});}return null;};}function removeEntity(_0x55aaef,_0x3d8a07){return function(_0x4d055d){if(_0x4d055d){return _0x4d055d[_0xb457('0x29')]()[_0xb457('0x28')](function(){_0x55aaef[_0xb457('0x1c')](0xcc)[_0xb457('0x1d')]();});}};}function handleEntityNotFound(_0x557f03,_0x1ffe7a){return function(_0x1f8ac0){if(!_0x1f8ac0){_0x557f03['sendStatus'](0x194);}return _0x1f8ac0;};}function handleError(_0x367b8a,_0x7ebca){_0x7ebca=_0x7ebca||0x1f4;return function(_0x17014b){logger[_0xb457('0x2a')](_0x17014b[_0xb457('0x2b')]);if(_0x17014b[_0xb457('0x2c')]){delete _0x17014b[_0xb457('0x2c')];}_0x367b8a['status'](_0x7ebca)[_0xb457('0x2d')](_0x17014b);};}exports[_0xb457('0x2e')]=function(_0x5a7592,_0xaaf240){var _0x262474={},_0x48ba9f={},_0x193910={'count':0x0,'rows':[]};var _0x3473dd=_['map'](db[_0xb457('0x2f')]['rawAttributes'],function(_0x34e91c){return{'name':_0x34e91c[_0xb457('0x30')],'type':_0x34e91c['type'][_0xb457('0x31')]};});_0x48ba9f[_0xb457('0x32')]=_['map'](_0x3473dd,_0xb457('0x2c'));_0x48ba9f['query']=_[_0xb457('0x33')](_0x5a7592['query']);_0x48ba9f[_0xb457('0x34')]=_[_0xb457('0x35')](_0x48ba9f['model'],_0x48ba9f[_0xb457('0x36')]);_0x262474[_0xb457('0x37')]=_[_0xb457('0x35')](_0x48ba9f[_0xb457('0x32')],qs['fields'](_0x5a7592[_0xb457('0x36')][_0xb457('0x38')]));_0x262474[_0xb457('0x37')]=_0x262474[_0xb457('0x37')][_0xb457('0x39')]?_0x262474[_0xb457('0x37')]:_0x48ba9f['model'];if(!_0x5a7592[_0xb457('0x36')][_0xb457('0x3a')](_0xb457('0x3b'))){_0x262474[_0xb457('0x21')]=qs[_0xb457('0x21')](_0x5a7592['query']['limit']);_0x262474[_0xb457('0x1f')]=qs['offset'](_0x5a7592[_0xb457('0x36')][_0xb457('0x1f')]);}_0x262474[_0xb457('0x3c')]=qs[_0xb457('0x3d')](_0x5a7592[_0xb457('0x36')][_0xb457('0x3d')]);_0x262474[_0xb457('0x3e')]=qs['filters'](_['pick'](_0x5a7592[_0xb457('0x36')],_0x48ba9f[_0xb457('0x34')]),_0x3473dd);if(_0x5a7592['query'][_0xb457('0x3f')]){_0x262474[_0xb457('0x3e')]=_[_0xb457('0x40')](_0x262474[_0xb457('0x3e')],{'$or':_[_0xb457('0x41')](_0x3473dd,function(_0x245b68){if(_0x245b68[_0xb457('0x42')]!==_0xb457('0x43')){var _0x17f8f5={};_0x17f8f5[_0x245b68['name']]={'$like':'%'+_0x5a7592[_0xb457('0x36')]['filter']+'%'};return _0x17f8f5;}})});}_0x262474=_[_0xb457('0x40')]({},_0x262474,_0x5a7592['options']);var _0xbb092a={'where':_0x262474[_0xb457('0x3e')]};return db[_0xb457('0x2f')][_0xb457('0x22')](_0xbb092a)[_0xb457('0x28')](function(_0x15db2c){_0x193910[_0xb457('0x22')]=_0x15db2c;if(_0x5a7592[_0xb457('0x36')]['includeAll']){_0x262474['include']=[{'all':!![]}];}return db[_0xb457('0x2f')][_0xb457('0x44')](_0x262474);})[_0xb457('0x28')](function(_0xb5c863){_0x193910[_0xb457('0x45')]=_0xb5c863;return _0x193910;})[_0xb457('0x28')](respondWithFilteredResult(_0xaaf240,_0x262474))[_0xb457('0x46')](handleError(_0xaaf240,null));};exports[_0xb457('0x47')]=function(_0x53066e,_0x211363){var _0x5c6a5d={'raw':!![],'where':{'id':_0x53066e[_0xb457('0x48')]['id']}},_0x2583d9={};_0x2583d9[_0xb457('0x32')]=_[_0xb457('0x33')](db['ZohoField'][_0xb457('0x49')]);_0x2583d9[_0xb457('0x36')]=_['keys'](_0x53066e['query']);_0x2583d9[_0xb457('0x34')]=_[_0xb457('0x35')](_0x2583d9['model'],_0x2583d9[_0xb457('0x36')]);_0x5c6a5d[_0xb457('0x37')]=_[_0xb457('0x35')](_0x2583d9[_0xb457('0x32')],qs['fields'](_0x53066e[_0xb457('0x36')][_0xb457('0x38')]));_0x5c6a5d[_0xb457('0x37')]=_0x5c6a5d['attributes'][_0xb457('0x39')]?_0x5c6a5d[_0xb457('0x37')]:_0x2583d9[_0xb457('0x32')];if(_0x53066e[_0xb457('0x36')]['includeAll']){_0x5c6a5d[_0xb457('0x4a')]=[{'all':!![]}];}_0x5c6a5d=_[_0xb457('0x40')]({},_0x5c6a5d,_0x53066e[_0xb457('0x4b')]);return db['ZohoField'][_0xb457('0x4c')](_0x5c6a5d)[_0xb457('0x28')](handleEntityNotFound(_0x211363,null))[_0xb457('0x28')](respondWithResult(_0x211363,null))[_0xb457('0x46')](handleError(_0x211363,null));};exports[_0xb457('0x4d')]=function(_0x156657,_0x32c61b){return db[_0xb457('0x2f')]['create'](_0x156657['body'],{})[_0xb457('0x28')](respondWithResult(_0x32c61b,0xc9))[_0xb457('0x46')](handleError(_0x32c61b,null));};exports['update']=function(_0xaa7254,_0x216ccb){if(_0xaa7254[_0xb457('0x4e')]['id']){delete _0xaa7254['body']['id'];}return db[_0xb457('0x2f')][_0xb457('0x4c')]({'where':{'id':_0xaa7254['params']['id']}})[_0xb457('0x28')](handleEntityNotFound(_0x216ccb,null))[_0xb457('0x28')](saveUpdates(_0xaa7254[_0xb457('0x4e')],null))[_0xb457('0x28')](respondWithResult(_0x216ccb,null))[_0xb457('0x46')](handleError(_0x216ccb,null));};exports[_0xb457('0x29')]=function(_0x132860,_0x4188f){return db[_0xb457('0x2f')][_0xb457('0x4c')]({'where':{'id':_0x132860['params']['id']}})[_0xb457('0x28')](handleEntityNotFound(_0x4188f,null))['then'](removeEntity(_0x4188f,null))[_0xb457('0x46')](handleError(_0x4188f,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index ff1bfd0..ca833b1 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 _0x430c=['api','moment','bluebird','./intZohoField.attributes','exports','ZohoField','int_zoho_fields','zoho_unique_index','idField','FieldId','lodash'];(function(_0x4c33d6,_0x10048f){var _0x22d6ef=function(_0x48e0ab){while(--_0x48e0ab){_0x4c33d6['push'](_0x4c33d6['shift']());}};_0x22d6ef(++_0x10048f);}(_0x430c,0x1a1));var _0xc430=function(_0x19dd7a,_0x51de21){_0x19dd7a=_0x19dd7a-0x0;var _0x3feb6a=_0x430c[_0x19dd7a];return _0x3feb6a;};'use strict';var _=require(_0xc430('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xc430('0x1'));var moment=require(_0xc430('0x2'));var BPromise=require(_0xc430('0x3'));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(_0xc430('0x4'));module[_0xc430('0x5')]=function(_0x50b256,_0x42aa9c){return _0x50b256['define'](_0xc430('0x6'),attributes,{'tableName':_0xc430('0x7'),'paranoid':![],'indexes':[{'name':_0xc430('0x8'),'fields':[_0xc430('0x9'),_0xc430('0xa')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7278=['idField','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intZohoField.attributes','exports','define','ZohoField','int_zoho_fields','zoho_unique_index'];(function(_0x18534f,_0x2016df){var _0x3f1584=function(_0xdac6f5){while(--_0xdac6f5){_0x18534f['push'](_0x18534f['shift']());}};_0x3f1584(++_0x2016df);}(_0x7278,0x161));var _0x8727=function(_0x208d0d,_0x341471){_0x208d0d=_0x208d0d-0x0;var _0x456a1c=_0x7278[_0x208d0d];return _0x456a1c;};'use strict';var _=require(_0x8727('0x0'));var util=require(_0x8727('0x1'));var logger=require(_0x8727('0x2'))(_0x8727('0x3'));var moment=require(_0x8727('0x4'));var BPromise=require('bluebird');var rp=require(_0x8727('0x5'));var fs=require('fs');var path=require(_0x8727('0x6'));var rimraf=require(_0x8727('0x7'));var config=require(_0x8727('0x8'));var attributes=require(_0x8727('0x9'));module[_0x8727('0xa')]=function(_0x180b71,_0x5549d5){return _0x180b71[_0x8727('0xb')](_0x8727('0xc'),attributes,{'tableName':_0x8727('0xd'),'paranoid':![],'indexes':[{'name':_0x8727('0xe'),'fields':[_0x8727('0xf'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.rpc.js b/server/api/intZohoField/intZohoField.rpc.js index 9e2343f..7bd6227 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 _0x5d6c=['debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','ZohoField,\x20%s,\x20%s'];(function(_0x103c7c,_0x3e464d){var _0x18d62b=function(_0x428883){while(--_0x428883){_0x103c7c['push'](_0x103c7c['shift']());}};_0x18d62b(++_0x3e464d);}(_0x5d6c,0x93));var _0xc5d6=function(_0xea80a5,_0x4397d1){_0xea80a5=_0xea80a5-0x0;var _0x4f063f=_0x5d6c[_0xea80a5];return _0x4f063f;};'use strict';var _=require(_0xc5d6('0x0'));var util=require('util');var moment=require(_0xc5d6('0x1'));var BPromise=require('bluebird');var rs=require(_0xc5d6('0x2'));var fs=require('fs');var Redis=require(_0xc5d6('0x3'));var db=require(_0xc5d6('0x4'))['db'];var utils=require(_0xc5d6('0x5'));var logger=require(_0xc5d6('0x6'))(_0xc5d6('0x7'));var config=require('../../config/environment');var jayson=require(_0xc5d6('0x8'));var client=jayson['client'][_0xc5d6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xe5d93d,_0x12380a,_0x22ee5a){return new BPromise(function(_0x34906e,_0x1d36b1){return client[_0xc5d6('0xa')](_0xe5d93d,_0x22ee5a)[_0xc5d6('0xb')](function(_0x5e07ee){logger[_0xc5d6('0xc')](_0xc5d6('0xd'),_0x12380a,'request\x20sent');logger[_0xc5d6('0xe')](_0xc5d6('0xf'),_0x12380a,'request\x20sent',JSON[_0xc5d6('0x10')](_0x5e07ee));if(_0x5e07ee['error']){if(_0x5e07ee[_0xc5d6('0x11')][_0xc5d6('0x12')]===0x1f4){logger[_0xc5d6('0x11')](_0xc5d6('0xd'),_0x12380a,_0x5e07ee['error'][_0xc5d6('0x13')]);return _0x1d36b1(_0x5e07ee[_0xc5d6('0x11')]['message']);}logger['error'](_0xc5d6('0xd'),_0x12380a,_0x5e07ee[_0xc5d6('0x11')]['message']);return _0x34906e(_0x5e07ee['error']['message']);}else{logger[_0xc5d6('0xc')](_0xc5d6('0xd'),_0x12380a,_0xc5d6('0x14'));_0x34906e(_0x5e07ee[_0xc5d6('0x15')][_0xc5d6('0x13')]);}})[_0xc5d6('0x16')](function(_0x2ac68e){logger[_0xc5d6('0x11')](_0xc5d6('0xd'),_0x12380a,_0x2ac68e);_0x1d36b1(_0x2ac68e);});});} \ No newline at end of file +var _0x9070=['../../config/logger','../../config/environment','jayson/promise','http','request','ZohoField,\x20%s,\x20%s','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x15b97a,_0x405cd8){var _0x729867=function(_0x460d87){while(--_0x460d87){_0x15b97a['push'](_0x15b97a['shift']());}};_0x729867(++_0x405cd8);}(_0x9070,0x93));var _0x0907=function(_0x50e593,_0x3ae998){_0x50e593=_0x50e593-0x0;var _0x3821d0=_0x9070[_0x50e593];return _0x3821d0;};'use strict';var _=require(_0x0907('0x0'));var util=require(_0x0907('0x1'));var moment=require(_0x0907('0x2'));var BPromise=require(_0x0907('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0907('0x4'));var db=require(_0x0907('0x5'))['db'];var utils=require(_0x0907('0x6'));var logger=require(_0x0907('0x7'))('rpc');var config=require(_0x0907('0x8'));var jayson=require(_0x0907('0x9'));var client=jayson['client'][_0x0907('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4c3299,_0x280ab3,_0x299b80){return new BPromise(function(_0x403511,_0xaa94cf){return client[_0x0907('0xb')](_0x4c3299,_0x299b80)['then'](function(_0x25c7e1){logger['info'](_0x0907('0xc'),_0x280ab3,_0x0907('0xd'));logger[_0x0907('0xe')](_0x0907('0xf'),_0x280ab3,'request\x20sent',JSON[_0x0907('0x10')](_0x25c7e1));if(_0x25c7e1[_0x0907('0x11')]){if(_0x25c7e1['error'][_0x0907('0x12')]===0x1f4){logger[_0x0907('0x11')](_0x0907('0xc'),_0x280ab3,_0x25c7e1[_0x0907('0x11')][_0x0907('0x13')]);return _0xaa94cf(_0x25c7e1['error']['message']);}logger['error']('ZohoField,\x20%s,\x20%s',_0x280ab3,_0x25c7e1[_0x0907('0x11')][_0x0907('0x13')]);return _0x403511(_0x25c7e1[_0x0907('0x11')][_0x0907('0x13')]);}else{logger[_0x0907('0x14')](_0x0907('0xc'),_0x280ab3,_0x0907('0xd'));_0x403511(_0x25c7e1['result']['message']);}})[_0x0907('0x15')](function(_0x4e128e){logger[_0x0907('0x11')](_0x0907('0xc'),_0x280ab3,_0x4e128e);_0xaa94cf(_0x4e128e);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index b9bd6cc..f831c55 100644 --- a/server/api/integration/index.js +++ b/server/api/integration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x26ebba,_0x1462c3){var _0x6c04d9=function(_0x13f819){while(--_0x13f819){_0x26ebba['push'](_0x26ebba['shift']());}};_0x6c04d9(++_0x1462c3);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x474bc0,_0x26989c){_0x474bc0=_0x474bc0-0x0;var _0x4b24cf=_0xcb91[_0x474bc0];return _0x4b24cf;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file +var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x2fadbb,_0x200240){var _0x280725=function(_0x540f9b){while(--_0x540f9b){_0x2fadbb['push'](_0x2fadbb['shift']());}};_0x280725(++_0x200240);}(_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 0813252..a1a9e32 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 _0xe36f=['state','sequelize','exports','unique_name_and_version','app.js','STRING','INTEGER'];(function(_0x3ba489,_0x1fba52){var _0x241c03=function(_0xec61f1){while(--_0xec61f1){_0x3ba489['push'](_0x3ba489['shift']());}};_0x241c03(++_0x1fba52);}(_0xe36f,0x189));var _0xfe36=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe36f[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0xfe36('0x0'));module[_0xfe36('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xfe36('0x2')},'version':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xfe36('0x2')},'main':{'type':Sequelize['STRING'],'defaultValue':_0xfe36('0x3')},'filename':{'type':Sequelize['STRING']},'path':{'type':Sequelize[_0xfe36('0x4')]},'type':{'type':Sequelize[_0xfe36('0x4')]},'size':{'type':Sequelize[_0xfe36('0x5')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'author':{'type':Sequelize['STRING']},'logo':{'type':Sequelize[_0xfe36('0x4')]},'state':{'type':Sequelize[_0xfe36('0x4')],'unique':_0xfe36('0x6')},'description':{'type':Sequelize['STRING']},'title':{'type':Sequelize[_0xfe36('0x4')]},'remoteUri':{'type':Sequelize[_0xfe36('0x4')]},'link':{'type':Sequelize[_0xfe36('0x4')],'defaultValue':'#'}}; \ No newline at end of file +var _0x96dd=['unique_name_and_version','state','exports','STRING'];(function(_0x213f3d,_0x31c31f){var _0x238251=function(_0x222903){while(--_0x222903){_0x213f3d['push'](_0x213f3d['shift']());}};_0x238251(++_0x31c31f);}(_0x96dd,0x162));var _0xd96d=function(_0x5a0de5,_0x156815){_0x5a0de5=_0x5a0de5-0x0;var _0x52a26a=_0x96dd[_0x5a0de5];return _0x52a26a;};'use strict';var Sequelize=require('sequelize');module[_0xd96d('0x0')]={'name':{'type':Sequelize[_0xd96d('0x1')],'allowNull':![],'unique':_0xd96d('0x2')},'version':{'type':Sequelize[_0xd96d('0x1')],'allowNull':![],'unique':_0xd96d('0x2')},'main':{'type':Sequelize[_0xd96d('0x1')],'defaultValue':'app.js'},'filename':{'type':Sequelize[_0xd96d('0x1')]},'path':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xd96d('0x1')]},'size':{'type':Sequelize['INTEGER']},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'author':{'type':Sequelize[_0xd96d('0x1')]},'logo':{'type':Sequelize[_0xd96d('0x1')]},'state':{'type':Sequelize[_0xd96d('0x1')],'unique':_0xd96d('0x3')},'description':{'type':Sequelize[_0xd96d('0x1')]},'title':{'type':Sequelize[_0xd96d('0x1')]},'remoteUri':{'type':Sequelize['STRING']},'link':{'type':Sequelize[_0xd96d('0x1')],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index fe12ae0..8b976ab 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 _0xe3da=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','set','apply','reject','save','update','then','destroy','error','stack','name','send','index','Integration','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','order','sort','where','pick','map','VIRTUAL','filter','merge','options','count','include','findAll','rows','catch','show','params','length','includeAll','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse'];(function(_0x39b148,_0x37726e){var _0x17a5ef=function(_0x35a1c0){while(--_0x35a1c0){_0x39b148['push'](_0x39b148['shift']());}};_0x17a5ef(++_0x37726e);}(_0xe3da,0x1cd));var _0xae3d=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xe3da[_0x19950b];return _0x3c6b41;};'use strict';var emlformat=require(_0xae3d('0x0'));var rimraf=require(_0xae3d('0x1'));var zipdir=require(_0xae3d('0x2'));var jsonpatch=require(_0xae3d('0x3'));var rp=require(_0xae3d('0x4'));var moment=require(_0xae3d('0x5'));var BPromise=require(_0xae3d('0x6'));var Mustache=require(_0xae3d('0x7'));var util=require(_0xae3d('0x8'));var path=require(_0xae3d('0x9'));var sox=require(_0xae3d('0xa'));var csv=require(_0xae3d('0xb'));var ejs=require(_0xae3d('0xc'));var fs=require('fs');var fs_extra=require(_0xae3d('0xd'));var _=require(_0xae3d('0xe'));var squel=require(_0xae3d('0xf'));var crypto=require('crypto');var jsforce=require(_0xae3d('0x10'));var deskjs=require(_0xae3d('0x11'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xae3d('0x12'));var Redis=require(_0xae3d('0x13'));var authService=require(_0xae3d('0x14'));var qs=require(_0xae3d('0x15'));var as=require(_0xae3d('0x16'));var hardwareService=require(_0xae3d('0x17'));var logger=require('../../config/logger')(_0xae3d('0x18'));var utils=require('../../config/utils');var config=require(_0xae3d('0x19'));var licenseUtil=require(_0xae3d('0x1a'));var db=require(_0xae3d('0x1b'))['db'];function respondWithStatusCode(_0x172f7a,_0x48aa74){_0x48aa74=_0x48aa74||0xcc;return function(_0xfb7869){if(_0xfb7869){return _0x172f7a[_0xae3d('0x1c')](_0x48aa74);}return _0x172f7a[_0xae3d('0x1d')](_0x48aa74)[_0xae3d('0x1e')]();};}function respondWithResult(_0x2afdd3,_0x430659){_0x430659=_0x430659||0xc8;return function(_0x31498d){if(_0x31498d){return _0x2afdd3['status'](_0x430659)[_0xae3d('0x1f')](_0x31498d);}};}function respondWithFilteredResult(_0x42f4b4,_0x46295b){return function(_0x230afb){if(_0x230afb){var _0x192c13=typeof _0x46295b[_0xae3d('0x20')]==='undefined'&&typeof _0x46295b[_0xae3d('0x21')]===_0xae3d('0x22');var _0x2e31f1=_0x230afb['count'];var _0x3f8cf9=_0x192c13?0x0:_0x46295b[_0xae3d('0x20')];var _0x558e42=_0x192c13?_0x230afb['count']:_0x46295b[_0xae3d('0x20')]+_0x46295b[_0xae3d('0x21')];var _0x19c44d;if(_0x558e42>=_0x2e31f1){_0x558e42=_0x2e31f1;_0x19c44d=0xc8;}else{_0x19c44d=0xce;}_0x42f4b4[_0xae3d('0x1d')](_0x19c44d);return _0x42f4b4[_0xae3d('0x23')]('Content-Range',_0x3f8cf9+'-'+_0x558e42+'/'+_0x2e31f1)[_0xae3d('0x1f')](_0x230afb);}return null;};}function patchUpdates(_0x48f00e){return function(_0x4a09c2){try{jsonpatch[_0xae3d('0x24')](_0x4a09c2,_0x48f00e,!![]);}catch(_0x1415e8){return BPromise[_0xae3d('0x25')](_0x1415e8);}return _0x4a09c2[_0xae3d('0x26')]();};}function saveUpdates(_0x3e7afc,_0x26c419){return function(_0x155099){if(_0x155099){return _0x155099[_0xae3d('0x27')](_0x3e7afc)[_0xae3d('0x28')](function(_0x300be8){return _0x300be8;});}return null;};}function removeEntity(_0x9bf34a,_0x37f5ff){return function(_0x1b2acb){if(_0x1b2acb){return _0x1b2acb[_0xae3d('0x29')]()[_0xae3d('0x28')](function(){_0x9bf34a[_0xae3d('0x1d')](0xcc)[_0xae3d('0x1e')]();});}};}function handleEntityNotFound(_0x2131e9,_0x1b1217){return function(_0x5d45db){if(!_0x5d45db){_0x2131e9[_0xae3d('0x1c')](0x194);}return _0x5d45db;};}function handleError(_0x185e71,_0xb5940){_0xb5940=_0xb5940||0x1f4;return function(_0x52df0f){logger[_0xae3d('0x2a')](_0x52df0f[_0xae3d('0x2b')]);if(_0x52df0f[_0xae3d('0x2c')]){delete _0x52df0f['name'];}_0x185e71['status'](_0xb5940)[_0xae3d('0x2d')](_0x52df0f);};}exports[_0xae3d('0x2e')]=function(_0x3a5840,_0x3114f9){var _0xb69ec9={},_0x561371={},_0x1d1483={'count':0x0,'rows':[]};var _0x3a2434=_['map'](db[_0xae3d('0x2f')][_0xae3d('0x30')],function(_0x2cf750){return{'name':_0x2cf750[_0xae3d('0x31')],'type':_0x2cf750[_0xae3d('0x32')][_0xae3d('0x33')]};});_0x561371['model']=_['map'](_0x3a2434,'name');_0x561371[_0xae3d('0x34')]=_[_0xae3d('0x35')](_0x3a5840[_0xae3d('0x34')]);_0x561371[_0xae3d('0x36')]=_['intersection'](_0x561371[_0xae3d('0x37')],_0x561371[_0xae3d('0x34')]);_0xb69ec9[_0xae3d('0x38')]=_[_0xae3d('0x39')](_0x561371[_0xae3d('0x37')],qs[_0xae3d('0x3a')](_0x3a5840[_0xae3d('0x34')]['fields']));_0xb69ec9[_0xae3d('0x38')]=_0xb69ec9['attributes']['length']?_0xb69ec9[_0xae3d('0x38')]:_0x561371['model'];if(!_0x3a5840[_0xae3d('0x34')]['hasOwnProperty']('nolimit')){_0xb69ec9[_0xae3d('0x21')]=qs[_0xae3d('0x21')](_0x3a5840[_0xae3d('0x34')]['limit']);_0xb69ec9[_0xae3d('0x20')]=qs['offset'](_0x3a5840[_0xae3d('0x34')][_0xae3d('0x20')]);}_0xb69ec9[_0xae3d('0x3b')]=qs[_0xae3d('0x3c')](_0x3a5840[_0xae3d('0x34')][_0xae3d('0x3c')]);_0xb69ec9[_0xae3d('0x3d')]=qs[_0xae3d('0x36')](_[_0xae3d('0x3e')](_0x3a5840[_0xae3d('0x34')],_0x561371[_0xae3d('0x36')]),_0x3a2434);if(_0x3a5840['query']['filter']){_0xb69ec9[_0xae3d('0x3d')]=_['merge'](_0xb69ec9[_0xae3d('0x3d')],{'$or':_[_0xae3d('0x3f')](_0x3a2434,function(_0x1db3c1){if(_0x1db3c1[_0xae3d('0x32')]!==_0xae3d('0x40')){var _0x35db44={};_0x35db44[_0x1db3c1[_0xae3d('0x2c')]]={'$like':'%'+_0x3a5840[_0xae3d('0x34')][_0xae3d('0x41')]+'%'};return _0x35db44;}})});}_0xb69ec9=_[_0xae3d('0x42')]({},_0xb69ec9,_0x3a5840[_0xae3d('0x43')]);var _0x549db8={'where':_0xb69ec9[_0xae3d('0x3d')]};return db[_0xae3d('0x2f')][_0xae3d('0x44')](_0x549db8)['then'](function(_0x4df102){_0x1d1483[_0xae3d('0x44')]=_0x4df102;if(_0x3a5840[_0xae3d('0x34')]['includeAll']){_0xb69ec9[_0xae3d('0x45')]=[{'all':!![]}];}return db[_0xae3d('0x2f')][_0xae3d('0x46')](_0xb69ec9);})[_0xae3d('0x28')](function(_0x436a04){_0x1d1483[_0xae3d('0x47')]=_0x436a04;return _0x1d1483;})['then'](respondWithFilteredResult(_0x3114f9,_0xb69ec9))[_0xae3d('0x48')](handleError(_0x3114f9,null));};exports[_0xae3d('0x49')]=function(_0xce7f34,_0x938811){var _0x1fef90={'raw':![],'where':{'id':_0xce7f34[_0xae3d('0x4a')]['id']}},_0x515220={};_0x515220['model']=_[_0xae3d('0x35')](db[_0xae3d('0x2f')][_0xae3d('0x30')]);_0x515220[_0xae3d('0x34')]=_['keys'](_0xce7f34['query']);_0x515220['filters']=_[_0xae3d('0x39')](_0x515220[_0xae3d('0x37')],_0x515220['query']);_0x1fef90['attributes']=_['intersection'](_0x515220[_0xae3d('0x37')],qs[_0xae3d('0x3a')](_0xce7f34[_0xae3d('0x34')][_0xae3d('0x3a')]));_0x1fef90[_0xae3d('0x38')]=_0x1fef90[_0xae3d('0x38')][_0xae3d('0x4b')]?_0x1fef90['attributes']:_0x515220['model'];if(_0xce7f34['query'][_0xae3d('0x4c')]){_0x1fef90['include']=[{'all':!![]}];}_0x1fef90=_[_0xae3d('0x42')]({},_0x1fef90,_0xce7f34[_0xae3d('0x43')]);return db[_0xae3d('0x2f')][_0xae3d('0x4d')](_0x1fef90)[_0xae3d('0x28')](handleEntityNotFound(_0x938811,null))[_0xae3d('0x28')](respondWithResult(_0x938811,null))[_0xae3d('0x48')](handleError(_0x938811,null));};exports[_0xae3d('0x4e')]=function(_0x38f92d,_0x4ed0f9){return db[_0xae3d('0x2f')]['create'](_0x38f92d['body'],{})['then'](respondWithResult(_0x4ed0f9,0xc9))[_0xae3d('0x48')](handleError(_0x4ed0f9,null));};exports[_0xae3d('0x27')]=function(_0x39f213,_0x6fa6c){if(_0x39f213['body']['id']){delete _0x39f213['body']['id'];}return db[_0xae3d('0x2f')][_0xae3d('0x4d')]({'where':{'id':_0x39f213[_0xae3d('0x4a')]['id']}})[_0xae3d('0x28')](handleEntityNotFound(_0x6fa6c,null))['then'](saveUpdates(_0x39f213[_0xae3d('0x4f')],null))[_0xae3d('0x28')](respondWithResult(_0x6fa6c,null))[_0xae3d('0x48')](handleError(_0x6fa6c,null));};exports[_0xae3d('0x29')]=function(_0x2a6a24,_0x38ccf1){return db[_0xae3d('0x2f')][_0xae3d('0x4d')]({'where':{'id':_0x2a6a24[_0xae3d('0x4a')]['id']}})[_0xae3d('0x28')](handleEntityNotFound(_0x38ccf1,null))[_0xae3d('0x28')](removeEntity(_0x38ccf1,null))[_0xae3d('0x48')](handleError(_0x38ccf1,null));}; \ No newline at end of file +var _0x0295=['params','intersection','include','find','create','body','eml-format','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','Integration','includeAll','rows','catch','show'];(function(_0x3bec61,_0x3a04b8){var _0x4bf6d2=function(_0x51e312){while(--_0x51e312){_0x3bec61['push'](_0x3bec61['shift']());}};_0x4bf6d2(++_0x3a04b8);}(_0x0295,0x1f0));var _0x5029=function(_0x3948ec,_0x3dfb10){_0x3948ec=_0x3948ec-0x0;var _0x2ad8f4=_0x0295[_0x3948ec];return _0x2ad8f4;};'use strict';var emlformat=require(_0x5029('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5029('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5029('0x2'));var Mustache=require(_0x5029('0x3'));var util=require(_0x5029('0x4'));var path=require(_0x5029('0x5'));var sox=require(_0x5029('0x6'));var csv=require(_0x5029('0x7'));var ejs=require(_0x5029('0x8'));var fs=require('fs');var fs_extra=require(_0x5029('0x9'));var _=require(_0x5029('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5029('0xb'));var toCsv=require('to-csv');var querystring=require(_0x5029('0xc'));var Papa=require('papaparse');var Redis=require(_0x5029('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x5029('0xe'));var as=require(_0x5029('0xf'));var hardwareService=require(_0x5029('0x10'));var logger=require('../../config/logger')(_0x5029('0x11'));var utils=require(_0x5029('0x12'));var config=require(_0x5029('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x5029('0x14'))['db'];function respondWithStatusCode(_0x2442b2,_0x4cced9){_0x4cced9=_0x4cced9||0xcc;return function(_0x4fa22d){if(_0x4fa22d){return _0x2442b2['sendStatus'](_0x4cced9);}return _0x2442b2['status'](_0x4cced9)[_0x5029('0x15')]();};}function respondWithResult(_0x2e0369,_0x12c237){_0x12c237=_0x12c237||0xc8;return function(_0x434630){if(_0x434630){return _0x2e0369[_0x5029('0x16')](_0x12c237)[_0x5029('0x17')](_0x434630);}};}function respondWithFilteredResult(_0xe278b7,_0x317c20){return function(_0x10bf55){if(_0x10bf55){var _0x326923=typeof _0x317c20[_0x5029('0x18')]===_0x5029('0x19')&&typeof _0x317c20[_0x5029('0x1a')]===_0x5029('0x19');var _0x343918=_0x10bf55['count'];var _0x1ed567=_0x326923?0x0:_0x317c20[_0x5029('0x18')];var _0x35de81=_0x326923?_0x10bf55[_0x5029('0x1b')]:_0x317c20[_0x5029('0x18')]+_0x317c20[_0x5029('0x1a')];var _0xaba461;if(_0x35de81>=_0x343918){_0x35de81=_0x343918;_0xaba461=0xc8;}else{_0xaba461=0xce;}_0xe278b7['status'](_0xaba461);return _0xe278b7[_0x5029('0x1c')]('Content-Range',_0x1ed567+'-'+_0x35de81+'/'+_0x343918)[_0x5029('0x17')](_0x10bf55);}return null;};}function patchUpdates(_0x8a414c){return function(_0x2710aa){try{jsonpatch[_0x5029('0x1d')](_0x2710aa,_0x8a414c,!![]);}catch(_0x4b5854){return BPromise['reject'](_0x4b5854);}return _0x2710aa[_0x5029('0x1e')]();};}function saveUpdates(_0x4a49b6,_0x3f657d){return function(_0x853a34){if(_0x853a34){return _0x853a34[_0x5029('0x1f')](_0x4a49b6)[_0x5029('0x20')](function(_0x16bd22){return _0x16bd22;});}return null;};}function removeEntity(_0x3a3e52,_0x125c26){return function(_0x356dac){if(_0x356dac){return _0x356dac[_0x5029('0x21')]()['then'](function(){_0x3a3e52['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x588d90,_0x45666c){return function(_0x51093c){if(!_0x51093c){_0x588d90['sendStatus'](0x194);}return _0x51093c;};}function handleError(_0x181da0,_0x1e7e61){_0x1e7e61=_0x1e7e61||0x1f4;return function(_0x36d810){logger['error'](_0x36d810[_0x5029('0x22')]);if(_0x36d810[_0x5029('0x23')]){delete _0x36d810['name'];}_0x181da0[_0x5029('0x16')](_0x1e7e61)[_0x5029('0x24')](_0x36d810);};}exports[_0x5029('0x25')]=function(_0x4a24b9,_0x32da06){var _0x251f99={},_0xe5313e={},_0x4b6f92={'count':0x0,'rows':[]};var _0x2cedf6=_[_0x5029('0x26')](db['Integration'][_0x5029('0x27')],function(_0x25032b){return{'name':_0x25032b[_0x5029('0x28')],'type':_0x25032b[_0x5029('0x29')][_0x5029('0x2a')]};});_0xe5313e[_0x5029('0x2b')]=_[_0x5029('0x26')](_0x2cedf6,_0x5029('0x23'));_0xe5313e[_0x5029('0x2c')]=_[_0x5029('0x2d')](_0x4a24b9[_0x5029('0x2c')]);_0xe5313e[_0x5029('0x2e')]=_['intersection'](_0xe5313e[_0x5029('0x2b')],_0xe5313e['query']);_0x251f99[_0x5029('0x2f')]=_['intersection'](_0xe5313e['model'],qs[_0x5029('0x30')](_0x4a24b9[_0x5029('0x2c')][_0x5029('0x30')]));_0x251f99['attributes']=_0x251f99[_0x5029('0x2f')][_0x5029('0x31')]?_0x251f99[_0x5029('0x2f')]:_0xe5313e[_0x5029('0x2b')];if(!_0x4a24b9[_0x5029('0x2c')][_0x5029('0x32')](_0x5029('0x33'))){_0x251f99[_0x5029('0x1a')]=qs[_0x5029('0x1a')](_0x4a24b9['query'][_0x5029('0x1a')]);_0x251f99[_0x5029('0x18')]=qs[_0x5029('0x18')](_0x4a24b9[_0x5029('0x2c')]['offset']);}_0x251f99[_0x5029('0x34')]=qs[_0x5029('0x35')](_0x4a24b9[_0x5029('0x2c')]['sort']);_0x251f99['where']=qs[_0x5029('0x2e')](_[_0x5029('0x36')](_0x4a24b9['query'],_0xe5313e['filters']),_0x2cedf6);if(_0x4a24b9[_0x5029('0x2c')][_0x5029('0x37')]){_0x251f99[_0x5029('0x38')]=_[_0x5029('0x39')](_0x251f99[_0x5029('0x38')],{'$or':_[_0x5029('0x26')](_0x2cedf6,function(_0x3cb84e){if(_0x3cb84e[_0x5029('0x29')]!==_0x5029('0x3a')){var _0x3effa4={};_0x3effa4[_0x3cb84e[_0x5029('0x23')]]={'$like':'%'+_0x4a24b9[_0x5029('0x2c')][_0x5029('0x37')]+'%'};return _0x3effa4;}})});}_0x251f99=_[_0x5029('0x39')]({},_0x251f99,_0x4a24b9['options']);var _0x57c2b5={'where':_0x251f99[_0x5029('0x38')]};return db[_0x5029('0x3b')][_0x5029('0x1b')](_0x57c2b5)['then'](function(_0x32d8a3){_0x4b6f92[_0x5029('0x1b')]=_0x32d8a3;if(_0x4a24b9['query'][_0x5029('0x3c')]){_0x251f99['include']=[{'all':!![]}];}return db[_0x5029('0x3b')]['findAll'](_0x251f99);})[_0x5029('0x20')](function(_0x359838){_0x4b6f92[_0x5029('0x3d')]=_0x359838;return _0x4b6f92;})[_0x5029('0x20')](respondWithFilteredResult(_0x32da06,_0x251f99))[_0x5029('0x3e')](handleError(_0x32da06,null));};exports[_0x5029('0x3f')]=function(_0x4b2219,_0x1021ea){var _0x2ae047={'raw':![],'where':{'id':_0x4b2219[_0x5029('0x40')]['id']}},_0x5a3e4d={};_0x5a3e4d[_0x5029('0x2b')]=_[_0x5029('0x2d')](db[_0x5029('0x3b')][_0x5029('0x27')]);_0x5a3e4d[_0x5029('0x2c')]=_['keys'](_0x4b2219[_0x5029('0x2c')]);_0x5a3e4d[_0x5029('0x2e')]=_[_0x5029('0x41')](_0x5a3e4d[_0x5029('0x2b')],_0x5a3e4d[_0x5029('0x2c')]);_0x2ae047['attributes']=_[_0x5029('0x41')](_0x5a3e4d[_0x5029('0x2b')],qs[_0x5029('0x30')](_0x4b2219[_0x5029('0x2c')][_0x5029('0x30')]));_0x2ae047[_0x5029('0x2f')]=_0x2ae047[_0x5029('0x2f')][_0x5029('0x31')]?_0x2ae047[_0x5029('0x2f')]:_0x5a3e4d['model'];if(_0x4b2219[_0x5029('0x2c')][_0x5029('0x3c')]){_0x2ae047[_0x5029('0x42')]=[{'all':!![]}];}_0x2ae047=_[_0x5029('0x39')]({},_0x2ae047,_0x4b2219['options']);return db['Integration'][_0x5029('0x43')](_0x2ae047)[_0x5029('0x20')](handleEntityNotFound(_0x1021ea,null))[_0x5029('0x20')](respondWithResult(_0x1021ea,null))[_0x5029('0x3e')](handleError(_0x1021ea,null));};exports[_0x5029('0x44')]=function(_0x3dfc08,_0x2bb7fc){return db[_0x5029('0x3b')][_0x5029('0x44')](_0x3dfc08[_0x5029('0x45')],{})[_0x5029('0x20')](respondWithResult(_0x2bb7fc,0xc9))[_0x5029('0x3e')](handleError(_0x2bb7fc,null));};exports[_0x5029('0x1f')]=function(_0x18f1f5,_0x3168bd){if(_0x18f1f5[_0x5029('0x45')]['id']){delete _0x18f1f5[_0x5029('0x45')]['id'];}return db[_0x5029('0x3b')][_0x5029('0x43')]({'where':{'id':_0x18f1f5[_0x5029('0x40')]['id']}})[_0x5029('0x20')](handleEntityNotFound(_0x3168bd,null))['then'](saveUpdates(_0x18f1f5[_0x5029('0x45')],null))['then'](respondWithResult(_0x3168bd,null))[_0x5029('0x3e')](handleError(_0x3168bd,null));};exports[_0x5029('0x21')]=function(_0x4d788a,_0x5343c6){return db[_0x5029('0x3b')]['find']({'where':{'id':_0x4d788a['params']['id']}})[_0x5029('0x20')](handleEntityNotFound(_0x5343c6,null))[_0x5029('0x20')](removeEntity(_0x5343c6,null))[_0x5029('0x3e')](handleError(_0x5343c6,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index c2cff9c..efe07e8 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 _0xe71a=['bluebird','path','exports','Integration','integrations','util'];(function(_0x30abc0,_0x397817){var _0x2b34b1=function(_0x4d433a){while(--_0x4d433a){_0x30abc0['push'](_0x30abc0['shift']());}};_0x2b34b1(++_0x397817);}(_0xe71a,0x1bb));var _0xae71=function(_0x5ee57c,_0x5bb461){_0x5ee57c=_0x5ee57c-0x0;var _0x625ca8=_0xe71a[_0x5ee57c];return _0x625ca8;};'use strict';var _=require('lodash');var util=require(_0xae71('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xae71('0x1'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xae71('0x2'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./integration.attributes');module[_0xae71('0x3')]=function(_0x20f9b2,_0x5a4206){return _0x20f9b2['define'](_0xae71('0x4'),attributes,{'tableName':_0xae71('0x5'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5e41=['./integration.attributes','exports','define','Integration','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment'];(function(_0x309d93,_0x157662){var _0x2dd61d=function(_0x25ff34){while(--_0x25ff34){_0x309d93['push'](_0x309d93['shift']());}};_0x2dd61d(++_0x157662);}(_0x5e41,0x1c0));var _0x15e4=function(_0x1484ed,_0x51eeac){_0x1484ed=_0x1484ed-0x0;var _0x565b8e=_0x5e41[_0x1484ed];return _0x565b8e;};'use strict';var _=require(_0x15e4('0x0'));var util=require(_0x15e4('0x1'));var logger=require(_0x15e4('0x2'))(_0x15e4('0x3'));var moment=require(_0x15e4('0x4'));var BPromise=require('bluebird');var rp=require(_0x15e4('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x15e4('0x6'));var config=require(_0x15e4('0x7'));var attributes=require(_0x15e4('0x8'));module[_0x15e4('0x9')]=function(_0xef470f,_0x4248c1){return _0xef470f[_0x15e4('0xa')](_0x15e4('0xb'),attributes,{'tableName':'integrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integration/integration.rpc.js b/server/api/integration/integration.rpc.js index b442d9f..25da728 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 _0x2542=['info','Integration,\x20%s,\x20%s','debug','Integration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0x47901d,_0xc6e227){var _0x36bab8=function(_0x25ec39){while(--_0x25ec39){_0x47901d['push'](_0x47901d['shift']());}};_0x36bab8(++_0xc6e227);}(_0x2542,0x169));var _0x2254=function(_0x233048,_0x54803a){_0x233048=_0x233048-0x0;var _0x3ffd8d=_0x2542[_0x233048];return _0x3ffd8d;};'use strict';var _=require(_0x2254('0x0'));var util=require(_0x2254('0x1'));var moment=require(_0x2254('0x2'));var BPromise=require(_0x2254('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2254('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2254('0x5'));var logger=require(_0x2254('0x6'))(_0x2254('0x7'));var config=require(_0x2254('0x8'));var jayson=require(_0x2254('0x9'));var client=jayson['client'][_0x2254('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xe8ca50,_0x2ee7ee,_0x3c45ec){return new BPromise(function(_0x1637ad,_0x477b47){return client[_0x2254('0xb')](_0xe8ca50,_0x3c45ec)[_0x2254('0xc')](function(_0xb395da){logger[_0x2254('0xd')](_0x2254('0xe'),_0x2ee7ee,'request\x20sent');logger[_0x2254('0xf')](_0x2254('0x10'),_0x2ee7ee,_0x2254('0x11'),JSON[_0x2254('0x12')](_0xb395da));if(_0xb395da['error']){if(_0xb395da['error'][_0x2254('0x13')]===0x1f4){logger[_0x2254('0x14')](_0x2254('0xe'),_0x2ee7ee,_0xb395da[_0x2254('0x14')][_0x2254('0x15')]);return _0x477b47(_0xb395da[_0x2254('0x14')]['message']);}logger[_0x2254('0x14')](_0x2254('0xe'),_0x2ee7ee,_0xb395da['error'][_0x2254('0x15')]);return _0x1637ad(_0xb395da[_0x2254('0x14')][_0x2254('0x15')]);}else{logger[_0x2254('0xd')](_0x2254('0xe'),_0x2ee7ee,_0x2254('0x11'));_0x1637ad(_0xb395da['result'][_0x2254('0x15')]);}})['catch'](function(_0x327d6d){logger[_0x2254('0x14')](_0x2254('0xe'),_0x2ee7ee,_0x327d6d);_0x477b47(_0x327d6d);});});} \ No newline at end of file +var _0x5f2f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','Integration,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x107b7b,_0x329414){var _0x557858=function(_0x16c68e){while(--_0x16c68e){_0x107b7b['push'](_0x107b7b['shift']());}};_0x557858(++_0x329414);}(_0x5f2f,0x73));var _0xf5f2=function(_0x2be1d9,_0x392d3d){_0x2be1d9=_0x2be1d9-0x0;var _0xe96373=_0x5f2f[_0x2be1d9];return _0xe96373;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3133bc,_0x473100,_0x5907aa){return new BPromise(function(_0x466882,_0x46cd9c){return client[_0xf5f2('0xc')](_0x3133bc,_0x5907aa)['then'](function(_0x375da4){logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,'request\x20sent');logger[_0xf5f2('0xf')]('Integration,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index 5662f02..01f66ef 100644 --- a/server/api/integrationReport/index.js +++ b/server/api/integrationReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f2f=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./integrationReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x5f2f,0x73));var _0xf5f2=function(_0x54e573,_0x129035){_0x54e573=_0x54e573-0x0;var _0x14d781=_0x5f2f[_0x54e573];return _0x14d781;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var fs_extra=require(_0xf5f2('0x6'));var auth=require(_0xf5f2('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf5f2('0x8'));router[_0xf5f2('0x9')]('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0xb')]);router[_0xf5f2('0x9')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0xd')]);router[_0xf5f2('0x9')](_0xf5f2('0xe'),auth['isAuthenticated'](),controller[_0xf5f2('0xf')]);router[_0xf5f2('0x10')]('/',auth[_0xf5f2('0xa')](),controller['create']);router[_0xf5f2('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xf5f2('0x12')]);router[_0xf5f2('0x13')]('/:id',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x14')]);module[_0xf5f2('0x15')]=router; \ No newline at end of file +var _0x4975=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','create','put','update','destroy','exports','multer','path','connect-timeout','express'];(function(_0x31496f,_0x20322d){var _0x200068=function(_0x59c07e){while(--_0x59c07e){_0x31496f['push'](_0x31496f['shift']());}};_0x200068(++_0x20322d);}(_0x4975,0x86));var _0x5497=function(_0x55fca5,_0x1a0afc){_0x55fca5=_0x55fca5-0x0;var _0x54e8e5=_0x4975[_0x55fca5];return _0x54e8e5;};'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('0xf'),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/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index b555aeb..98723a1 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 _0x2f63=['SENDING','RECEIVED','sequelize','exports','STRING','INTEGER','DATE','BOOLEAN','TEXT','ENUM','SENT'];(function(_0x1d4755,_0x274d8a){var _0x20d979=function(_0x3e883b){while(--_0x3e883b){_0x1d4755['push'](_0x1d4755['shift']());}};_0x20d979(++_0x274d8a);}(_0x2f63,0x9c));var _0x32f6=function(_0x2bddf9,_0x22c873){_0x2bddf9=_0x2bddf9-0x0;var _0x3f3ae9=_0x2f63[_0x2bddf9];return _0x3f3ae9;};'use strict';var Sequelize=require(_0x32f6('0x0'));module[_0x32f6('0x1')]={'integration':{'type':Sequelize[_0x32f6('0x2')]},'eventChannel':{'type':Sequelize[_0x32f6('0x2')]},'exitStatus':{'type':Sequelize['STRING']},'ticketId':{'type':Sequelize[_0x32f6('0x2')]},'integrationId':{'type':Sequelize[_0x32f6('0x3')]},'contacts':{'type':Sequelize[_0x32f6('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x32f6('0x2')]},'calleridname':{'type':Sequelize[_0x32f6('0x2')]},'queue':{'type':Sequelize[_0x32f6('0x2')]},'interface':{'type':Sequelize[_0x32f6('0x2')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0x32f6('0x4')]},'agentconnectAt':{'type':Sequelize[_0x32f6('0x4')]},'holdtime':{'type':Sequelize[_0x32f6('0x3')]},'agentcomplete':{'type':Sequelize[_0x32f6('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x32f6('0x4')]},'talktime':{'type':Sequelize[_0x32f6('0x3')]},'agentacw':{'type':Sequelize[_0x32f6('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0x32f6('0x2')]},'agentringnoanswer':{'type':Sequelize[_0x32f6('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x32f6('0x4')]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x32f6('0x4')]},'lastevent':{'type':Sequelize[_0x32f6('0x2')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0x32f6('0x3')]},'channelstatedesc':{'type':Sequelize[_0x32f6('0x2')]},'connectedlinenum':{'type':Sequelize[_0x32f6('0x2')]},'connectedlinename':{'type':Sequelize[_0x32f6('0x2')]},'language':{'type':Sequelize[_0x32f6('0x2')]},'accountcode':{'type':Sequelize[_0x32f6('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0x32f6('0x2')]},'destchannelstate':{'type':Sequelize[_0x32f6('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x32f6('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x32f6('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x32f6('0x2')]},'destlanguage':{'type':Sequelize[_0x32f6('0x2')]},'destaccountcode':{'type':Sequelize[_0x32f6('0x2')]},'destcontext':{'type':Sequelize[_0x32f6('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x32f6('0x2')]},'destuniqueid':{'type':Sequelize[_0x32f6('0x2')]},'messageId':{'type':Sequelize[_0x32f6('0x2')]},'inReplyTo':{'type':Sequelize[_0x32f6('0x2')]},'subject':{'type':Sequelize[_0x32f6('0x2')]},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x32f6('0x2')]},'attachment':{'type':Sequelize[_0x32f6('0x6')]},'html':{'type':Sequelize[_0x32f6('0x6')]},'text':{'type':Sequelize['TEXT']},'status':{'type':Sequelize[_0x32f6('0x7')](_0x32f6('0x8'),_0x32f6('0x9'),_0x32f6('0xa'),'FAILED')},'url':{'type':Sequelize[_0x32f6('0x2')]},'app':{'type':Sequelize[_0x32f6('0x2')]},'appdata':{'type':Sequelize['STRING']},'projectId':{'type':Sequelize[_0x32f6('0x3')]}}; \ No newline at end of file +var _0x5a62=['STRING','INTEGER','DATE','BOOLEAN','TEXT','ENUM','SENT','SENDING','FAILED','exports'];(function(_0x37f9fa,_0x4acb2d){var _0x3e4ffe=function(_0x802327){while(--_0x802327){_0x37f9fa['push'](_0x37f9fa['shift']());}};_0x3e4ffe(++_0x4acb2d);}(_0x5a62,0xb3));var _0x25a6=function(_0xf73c09,_0x4e424e){_0xf73c09=_0xf73c09-0x0;var _0xa8923c=_0x5a62[_0xf73c09];return _0xa8923c;};'use strict';var Sequelize=require('sequelize');module[_0x25a6('0x0')]={'integration':{'type':Sequelize[_0x25a6('0x1')]},'eventChannel':{'type':Sequelize['STRING']},'exitStatus':{'type':Sequelize[_0x25a6('0x1')]},'ticketId':{'type':Sequelize[_0x25a6('0x1')]},'integrationId':{'type':Sequelize[_0x25a6('0x2')]},'contacts':{'type':Sequelize[_0x25a6('0x1')]},'uniqueid':{'type':Sequelize[_0x25a6('0x1')]},'calleridnum':{'type':Sequelize[_0x25a6('0x1')]},'calleridname':{'type':Sequelize[_0x25a6('0x1')]},'queue':{'type':Sequelize[_0x25a6('0x1')]},'interface':{'type':Sequelize[_0x25a6('0x1')]},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0x25a6('0x3')]},'agentconnectAt':{'type':Sequelize[_0x25a6('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0x25a6('0x4')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize['DATE']},'talktime':{'type':Sequelize[_0x25a6('0x2')]},'agentacw':{'type':Sequelize[_0x25a6('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x25a6('0x2')]},'reason':{'type':Sequelize[_0x25a6('0x1')]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x25a6('0x3')]},'agentdump':{'type':Sequelize[_0x25a6('0x4')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x25a6('0x3')]},'lastevent':{'type':Sequelize[_0x25a6('0x1')]},'channel':{'type':Sequelize[_0x25a6('0x1')]},'channelstate':{'type':Sequelize[_0x25a6('0x2')]},'channelstatedesc':{'type':Sequelize[_0x25a6('0x1')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x25a6('0x1')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x25a6('0x1')]},'context':{'type':Sequelize[_0x25a6('0x1')]},'exten':{'type':Sequelize[_0x25a6('0x1')]},'priority':{'type':Sequelize[_0x25a6('0x1')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0x25a6('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0x25a6('0x1')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0x25a6('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0x25a6('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x25a6('0x1')]},'destlanguage':{'type':Sequelize[_0x25a6('0x1')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x25a6('0x1')]},'destpriority':{'type':Sequelize[_0x25a6('0x1')]},'destuniqueid':{'type':Sequelize[_0x25a6('0x1')]},'messageId':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0x25a6('0x1')]},'subject':{'type':Sequelize[_0x25a6('0x1')]},'from':{'type':Sequelize[_0x25a6('0x1')]},'to':{'type':Sequelize[_0x25a6('0x1')]},'cc':{'type':Sequelize[_0x25a6('0x1')]},'attachment':{'type':Sequelize[_0x25a6('0x5')]},'html':{'type':Sequelize['TEXT']},'text':{'type':Sequelize[_0x25a6('0x5')]},'status':{'type':Sequelize[_0x25a6('0x6')](_0x25a6('0x7'),_0x25a6('0x8'),'RECEIVED',_0x25a6('0x9'))},'url':{'type':Sequelize['STRING']},'app':{'type':Sequelize[_0x25a6('0x1')]},'appdata':{'type':Sequelize[_0x25a6('0x1')]},'projectId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index d7a9ddb..8ade6a4 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 _0x759b=['reject','save','update','then','destroy','sendStatus','stack','name','send','index','map','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','IntegrationReport','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','describe','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','sox','ejs','fs-extra','lodash','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','offset','undefined','limit','count','Content-Range','apply'];(function(_0x1ea786,_0x3b172b){var _0xe5d45=function(_0xc5e505){while(--_0xc5e505){_0x1ea786['push'](_0x1ea786['shift']());}};_0xe5d45(++_0x3b172b);}(_0x759b,0x75));var _0xb759=function(_0x4ff1a8,_0xbb3134){_0x4ff1a8=_0x4ff1a8-0x0;var _0x5b5582=_0x759b[_0x4ff1a8];return _0x5b5582;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb759('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb759('0x1'));var rp=require(_0xb759('0x2'));var moment=require('moment');var BPromise=require(_0xb759('0x3'));var Mustache=require(_0xb759('0x4'));var util=require('util');var path=require(_0xb759('0x5'));var sox=require(_0xb759('0x6'));var csv=require('to-csv');var ejs=require(_0xb759('0x7'));var fs=require('fs');var fs_extra=require(_0xb759('0x8'));var _=require(_0xb759('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xb759('0xa'));var deskjs=require(_0xb759('0xb'));var toCsv=require(_0xb759('0xc'));var querystring=require(_0xb759('0xd'));var Papa=require('papaparse');var Redis=require(_0xb759('0xe'));var authService=require(_0xb759('0xf'));var qs=require(_0xb759('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb759('0x11'));var logger=require(_0xb759('0x12'))(_0xb759('0x13'));var utils=require(_0xb759('0x14'));var config=require(_0xb759('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xb759('0x16'))['db'];function respondWithStatusCode(_0xbfc451,_0x528fa1){_0x528fa1=_0x528fa1||0xcc;return function(_0x3cca90){if(_0x3cca90){return _0xbfc451['sendStatus'](_0x528fa1);}return _0xbfc451[_0xb759('0x17')](_0x528fa1)[_0xb759('0x18')]();};}function respondWithResult(_0x1828e6,_0x2922f9){_0x2922f9=_0x2922f9||0xc8;return function(_0x46768c){if(_0x46768c){return _0x1828e6[_0xb759('0x17')](_0x2922f9)['json'](_0x46768c);}};}function respondWithFilteredResult(_0x4ea3a4,_0x58d22c){return function(_0x2ed7e7){if(_0x2ed7e7){var _0x337afa=typeof _0x58d22c[_0xb759('0x19')]===_0xb759('0x1a')&&typeof _0x58d22c[_0xb759('0x1b')]===_0xb759('0x1a');var _0x1083fb=_0x2ed7e7[_0xb759('0x1c')];var _0x4d7dce=_0x337afa?0x0:_0x58d22c[_0xb759('0x19')];var _0x2ad407=_0x337afa?_0x2ed7e7[_0xb759('0x1c')]:_0x58d22c[_0xb759('0x19')]+_0x58d22c[_0xb759('0x1b')];var _0x52eb6e;if(_0x2ad407>=_0x1083fb){_0x2ad407=_0x1083fb;_0x52eb6e=0xc8;}else{_0x52eb6e=0xce;}_0x4ea3a4[_0xb759('0x17')](_0x52eb6e);return _0x4ea3a4['set'](_0xb759('0x1d'),_0x4d7dce+'-'+_0x2ad407+'/'+_0x1083fb)['json'](_0x2ed7e7);}return null;};}function patchUpdates(_0x42518e){return function(_0x216cf2){try{jsonpatch[_0xb759('0x1e')](_0x216cf2,_0x42518e,!![]);}catch(_0x44a2f2){return BPromise[_0xb759('0x1f')](_0x44a2f2);}return _0x216cf2[_0xb759('0x20')]();};}function saveUpdates(_0x3b5bd3,_0x3c4550){return function(_0x479a97){if(_0x479a97){return _0x479a97[_0xb759('0x21')](_0x3b5bd3)[_0xb759('0x22')](function(_0x12de48){return _0x12de48;});}return null;};}function removeEntity(_0x42d955,_0x3ca8fb){return function(_0xd6a6a5){if(_0xd6a6a5){return _0xd6a6a5[_0xb759('0x23')]()['then'](function(){_0x42d955[_0xb759('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x45557a,_0x333a16){return function(_0x7101b3){if(!_0x7101b3){_0x45557a[_0xb759('0x24')](0x194);}return _0x7101b3;};}function handleError(_0x54a15d,_0x2ade24){_0x2ade24=_0x2ade24||0x1f4;return function(_0x26f455){logger['error'](_0x26f455[_0xb759('0x25')]);if(_0x26f455[_0xb759('0x26')]){delete _0x26f455[_0xb759('0x26')];}_0x54a15d[_0xb759('0x17')](_0x2ade24)[_0xb759('0x27')](_0x26f455);};}exports[_0xb759('0x28')]=function(_0x34586b,_0xa67765){var _0x481306={},_0x38480e={},_0x4e7ee4={'count':0x0,'rows':[]};var _0x2163df=_[_0xb759('0x29')](db['IntegrationReport'][_0xb759('0x2a')],function(_0x5d9dad){return{'name':_0x5d9dad['fieldName'],'type':_0x5d9dad[_0xb759('0x2b')][_0xb759('0x2c')]};});_0x38480e[_0xb759('0x2d')]=_[_0xb759('0x29')](_0x2163df,_0xb759('0x26'));_0x38480e[_0xb759('0x2e')]=_['keys'](_0x34586b[_0xb759('0x2e')]);_0x38480e[_0xb759('0x2f')]=_[_0xb759('0x30')](_0x38480e[_0xb759('0x2d')],_0x38480e[_0xb759('0x2e')]);_0x481306[_0xb759('0x31')]=_['intersection'](_0x38480e[_0xb759('0x2d')],qs['fields'](_0x34586b[_0xb759('0x2e')][_0xb759('0x32')]));_0x481306[_0xb759('0x31')]=_0x481306[_0xb759('0x31')][_0xb759('0x33')]?_0x481306[_0xb759('0x31')]:_0x38480e['model'];if(!_0x34586b[_0xb759('0x2e')][_0xb759('0x34')](_0xb759('0x35'))){_0x481306[_0xb759('0x1b')]=qs[_0xb759('0x1b')](_0x34586b['query'][_0xb759('0x1b')]);_0x481306[_0xb759('0x19')]=qs['offset'](_0x34586b[_0xb759('0x2e')][_0xb759('0x19')]);}_0x481306['order']=qs[_0xb759('0x36')](_0x34586b[_0xb759('0x2e')][_0xb759('0x36')]);_0x481306[_0xb759('0x37')]=qs[_0xb759('0x2f')](_[_0xb759('0x38')](_0x34586b[_0xb759('0x2e')],_0x38480e[_0xb759('0x2f')]),_0x2163df);if(_0x34586b['query'][_0xb759('0x39')]){_0x481306[_0xb759('0x37')]=_[_0xb759('0x3a')](_0x481306[_0xb759('0x37')],{'$or':_['map'](_0x2163df,function(_0xbf3b5){if(_0xbf3b5['type']!==_0xb759('0x3b')){var _0x1e8844={};_0x1e8844[_0xbf3b5['name']]={'$like':'%'+_0x34586b[_0xb759('0x2e')][_0xb759('0x39')]+'%'};return _0x1e8844;}})});}_0x481306=_['merge']({},_0x481306,_0x34586b[_0xb759('0x3c')]);var _0x60f176={'where':_0x481306[_0xb759('0x37')]};return db[_0xb759('0x3d')]['count'](_0x60f176)[_0xb759('0x22')](function(_0x79e146){_0x4e7ee4['count']=_0x79e146;if(_0x34586b[_0xb759('0x2e')][_0xb759('0x3e')]){_0x481306[_0xb759('0x3f')]=[{'all':!![]}];}return db[_0xb759('0x3d')][_0xb759('0x40')](_0x481306);})['then'](function(_0x2d2e42){_0x4e7ee4[_0xb759('0x41')]=_0x2d2e42;return _0x4e7ee4;})[_0xb759('0x22')](respondWithFilteredResult(_0xa67765,_0x481306))[_0xb759('0x42')](handleError(_0xa67765,null));};exports[_0xb759('0x43')]=function(_0x4144b1,_0x1a05c4){var _0x10f196={'raw':![],'where':{'id':_0x4144b1[_0xb759('0x44')]['id']}},_0x17d73b={};_0x17d73b[_0xb759('0x2d')]=_[_0xb759('0x45')](db[_0xb759('0x3d')][_0xb759('0x2a')]);_0x17d73b[_0xb759('0x2e')]=_['keys'](_0x4144b1[_0xb759('0x2e')]);_0x17d73b[_0xb759('0x2f')]=_[_0xb759('0x30')](_0x17d73b[_0xb759('0x2d')],_0x17d73b['query']);_0x10f196['attributes']=_[_0xb759('0x30')](_0x17d73b['model'],qs[_0xb759('0x32')](_0x4144b1[_0xb759('0x2e')][_0xb759('0x32')]));_0x10f196[_0xb759('0x31')]=_0x10f196['attributes'][_0xb759('0x33')]?_0x10f196[_0xb759('0x31')]:_0x17d73b[_0xb759('0x2d')];if(_0x4144b1[_0xb759('0x2e')][_0xb759('0x3e')]){_0x10f196[_0xb759('0x3f')]=[{'all':!![]}];}_0x10f196=_[_0xb759('0x3a')]({},_0x10f196,_0x4144b1['options']);return db['IntegrationReport'][_0xb759('0x46')](_0x10f196)['then'](handleEntityNotFound(_0x1a05c4,null))[_0xb759('0x22')](respondWithResult(_0x1a05c4,null))[_0xb759('0x42')](handleError(_0x1a05c4,null));};exports['create']=function(_0x2c1a70,_0x406cf3){return db[_0xb759('0x3d')][_0xb759('0x47')](_0x2c1a70[_0xb759('0x48')],{})['then'](respondWithResult(_0x406cf3,0xc9))[_0xb759('0x42')](handleError(_0x406cf3,null));};exports[_0xb759('0x21')]=function(_0x311909,_0x401659){if(_0x311909['body']['id']){delete _0x311909['body']['id'];}return db[_0xb759('0x3d')][_0xb759('0x46')]({'where':{'id':_0x311909[_0xb759('0x44')]['id']}})[_0xb759('0x22')](handleEntityNotFound(_0x401659,null))['then'](saveUpdates(_0x311909[_0xb759('0x48')],null))[_0xb759('0x22')](respondWithResult(_0x401659,null))[_0xb759('0x42')](handleError(_0x401659,null));};exports[_0xb759('0x23')]=function(_0x52613a,_0x5341cd){return db[_0xb759('0x3d')][_0xb759('0x46')]({'where':{'id':_0x52613a[_0xb759('0x44')]['id']}})['then'](handleEntityNotFound(_0x5341cd,null))[_0xb759('0x22')](removeEntity(_0x5341cd,null))[_0xb759('0x42')](handleError(_0x5341cd,null));};exports[_0xb759('0x49')]=function(_0x221316,_0x5c2fa0){return db[_0xb759('0x3d')][_0xb759('0x49')]()['then'](respondWithResult(_0x5c2fa0,null))[_0xb759('0x42')](handleError(_0x5c2fa0,null));}; \ No newline at end of file +var _0x8363=['name','send','index','map','IntegrationReport','rawAttributes','fieldName','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','include','findAll','rows','catch','params','includeAll','find','create','body','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','stack'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8363,0x101));var _0x3836=function(_0x23d988,_0x1a92d7){_0x23d988=_0x23d988-0x0;var _0x445fb8=_0x8363[_0x23d988];return _0x445fb8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3836('0x0'));var zipdir=require(_0x3836('0x1'));var jsonpatch=require(_0x3836('0x2'));var rp=require(_0x3836('0x3'));var moment=require(_0x3836('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x3836('0x5'));var path=require(_0x3836('0x6'));var sox=require('sox');var csv=require(_0x3836('0x7'));var ejs=require(_0x3836('0x8'));var fs=require('fs');var fs_extra=require(_0x3836('0x9'));var _=require(_0x3836('0xa'));var squel=require(_0x3836('0xb'));var crypto=require('crypto');var jsforce=require(_0x3836('0xc'));var deskjs=require(_0x3836('0xd'));var toCsv=require(_0x3836('0x7'));var querystring=require('querystring');var Papa=require(_0x3836('0xe'));var Redis=require(_0x3836('0xf'));var authService=require(_0x3836('0x10'));var qs=require(_0x3836('0x11'));var as=require(_0x3836('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3836('0x13'))(_0x3836('0x14'));var utils=require(_0x3836('0x15'));var config=require(_0x3836('0x16'));var licenseUtil=require(_0x3836('0x17'));var db=require(_0x3836('0x18'))['db'];function respondWithStatusCode(_0x224de5,_0x460503){_0x460503=_0x460503||0xcc;return function(_0x2ac6d8){if(_0x2ac6d8){return _0x224de5[_0x3836('0x19')](_0x460503);}return _0x224de5[_0x3836('0x1a')](_0x460503)[_0x3836('0x1b')]();};}function respondWithResult(_0x46cd66,_0x19c8a7){_0x19c8a7=_0x19c8a7||0xc8;return function(_0x34423c){if(_0x34423c){return _0x46cd66[_0x3836('0x1a')](_0x19c8a7)['json'](_0x34423c);}};}function respondWithFilteredResult(_0xe10956,_0x5e7f91){return function(_0x35a4bc){if(_0x35a4bc){var _0x32f082=typeof _0x5e7f91[_0x3836('0x1c')]===_0x3836('0x1d')&&typeof _0x5e7f91[_0x3836('0x1e')]===_0x3836('0x1d');var _0xd01700=_0x35a4bc[_0x3836('0x1f')];var _0x22dd04=_0x32f082?0x0:_0x5e7f91[_0x3836('0x1c')];var _0x331edb=_0x32f082?_0x35a4bc[_0x3836('0x1f')]:_0x5e7f91[_0x3836('0x1c')]+_0x5e7f91['limit'];var _0x37ce5e;if(_0x331edb>=_0xd01700){_0x331edb=_0xd01700;_0x37ce5e=0xc8;}else{_0x37ce5e=0xce;}_0xe10956[_0x3836('0x1a')](_0x37ce5e);return _0xe10956[_0x3836('0x20')](_0x3836('0x21'),_0x22dd04+'-'+_0x331edb+'/'+_0xd01700)['json'](_0x35a4bc);}return null;};}function patchUpdates(_0x2ff7da){return function(_0x3e726d){try{jsonpatch[_0x3836('0x22')](_0x3e726d,_0x2ff7da,!![]);}catch(_0x29c585){return BPromise[_0x3836('0x23')](_0x29c585);}return _0x3e726d['save']();};}function saveUpdates(_0x24e0de,_0x11072f){return function(_0x1f53f5){if(_0x1f53f5){return _0x1f53f5[_0x3836('0x24')](_0x24e0de)[_0x3836('0x25')](function(_0x1ca12e){return _0x1ca12e;});}return null;};}function removeEntity(_0x198a16,_0x2d2f70){return function(_0x1910e0){if(_0x1910e0){return _0x1910e0['destroy']()[_0x3836('0x25')](function(){_0x198a16[_0x3836('0x1a')](0xcc)[_0x3836('0x1b')]();});}};}function handleEntityNotFound(_0x198bb7,_0x2a71f4){return function(_0x2d1496){if(!_0x2d1496){_0x198bb7['sendStatus'](0x194);}return _0x2d1496;};}function handleError(_0x36ff5e,_0x56c49f){_0x56c49f=_0x56c49f||0x1f4;return function(_0x293032){logger['error'](_0x293032[_0x3836('0x26')]);if(_0x293032['name']){delete _0x293032[_0x3836('0x27')];}_0x36ff5e[_0x3836('0x1a')](_0x56c49f)[_0x3836('0x28')](_0x293032);};}exports[_0x3836('0x29')]=function(_0x89f8a6,_0x3cd873){var _0x2ba5f0={},_0x4b1b3e={},_0x20b734={'count':0x0,'rows':[]};var _0xef2152=_[_0x3836('0x2a')](db[_0x3836('0x2b')][_0x3836('0x2c')],function(_0x56a1c6){return{'name':_0x56a1c6[_0x3836('0x2d')],'type':_0x56a1c6['type'][_0x3836('0x2e')]};});_0x4b1b3e[_0x3836('0x2f')]=_[_0x3836('0x2a')](_0xef2152,_0x3836('0x27'));_0x4b1b3e[_0x3836('0x30')]=_[_0x3836('0x31')](_0x89f8a6[_0x3836('0x30')]);_0x4b1b3e[_0x3836('0x32')]=_['intersection'](_0x4b1b3e['model'],_0x4b1b3e[_0x3836('0x30')]);_0x2ba5f0[_0x3836('0x33')]=_[_0x3836('0x34')](_0x4b1b3e[_0x3836('0x2f')],qs['fields'](_0x89f8a6['query'][_0x3836('0x35')]));_0x2ba5f0[_0x3836('0x33')]=_0x2ba5f0['attributes'][_0x3836('0x36')]?_0x2ba5f0[_0x3836('0x33')]:_0x4b1b3e[_0x3836('0x2f')];if(!_0x89f8a6[_0x3836('0x30')][_0x3836('0x37')](_0x3836('0x38'))){_0x2ba5f0['limit']=qs[_0x3836('0x1e')](_0x89f8a6[_0x3836('0x30')][_0x3836('0x1e')]);_0x2ba5f0['offset']=qs[_0x3836('0x1c')](_0x89f8a6[_0x3836('0x30')][_0x3836('0x1c')]);}_0x2ba5f0[_0x3836('0x39')]=qs[_0x3836('0x3a')](_0x89f8a6['query'][_0x3836('0x3a')]);_0x2ba5f0[_0x3836('0x3b')]=qs[_0x3836('0x32')](_['pick'](_0x89f8a6[_0x3836('0x30')],_0x4b1b3e[_0x3836('0x32')]),_0xef2152);if(_0x89f8a6[_0x3836('0x30')][_0x3836('0x3c')]){_0x2ba5f0['where']=_[_0x3836('0x3d')](_0x2ba5f0['where'],{'$or':_[_0x3836('0x2a')](_0xef2152,function(_0x48eae1){if(_0x48eae1['type']!=='VIRTUAL'){var _0x671b1f={};_0x671b1f[_0x48eae1[_0x3836('0x27')]]={'$like':'%'+_0x89f8a6['query'][_0x3836('0x3c')]+'%'};return _0x671b1f;}})});}_0x2ba5f0=_['merge']({},_0x2ba5f0,_0x89f8a6[_0x3836('0x3e')]);var _0x5b908b={'where':_0x2ba5f0['where']};return db['IntegrationReport'][_0x3836('0x1f')](_0x5b908b)[_0x3836('0x25')](function(_0x5cb72a){_0x20b734[_0x3836('0x1f')]=_0x5cb72a;if(_0x89f8a6[_0x3836('0x30')]['includeAll']){_0x2ba5f0[_0x3836('0x3f')]=[{'all':!![]}];}return db[_0x3836('0x2b')][_0x3836('0x40')](_0x2ba5f0);})[_0x3836('0x25')](function(_0x99eb7){_0x20b734[_0x3836('0x41')]=_0x99eb7;return _0x20b734;})[_0x3836('0x25')](respondWithFilteredResult(_0x3cd873,_0x2ba5f0))[_0x3836('0x42')](handleError(_0x3cd873,null));};exports['show']=function(_0x2ef451,_0x1c4235){var _0x30b285={'raw':![],'where':{'id':_0x2ef451[_0x3836('0x43')]['id']}},_0x2e7dad={};_0x2e7dad['model']=_[_0x3836('0x31')](db[_0x3836('0x2b')][_0x3836('0x2c')]);_0x2e7dad[_0x3836('0x30')]=_[_0x3836('0x31')](_0x2ef451['query']);_0x2e7dad[_0x3836('0x32')]=_[_0x3836('0x34')](_0x2e7dad['model'],_0x2e7dad[_0x3836('0x30')]);_0x30b285['attributes']=_['intersection'](_0x2e7dad[_0x3836('0x2f')],qs['fields'](_0x2ef451['query'][_0x3836('0x35')]));_0x30b285[_0x3836('0x33')]=_0x30b285[_0x3836('0x33')][_0x3836('0x36')]?_0x30b285[_0x3836('0x33')]:_0x2e7dad[_0x3836('0x2f')];if(_0x2ef451[_0x3836('0x30')][_0x3836('0x44')]){_0x30b285[_0x3836('0x3f')]=[{'all':!![]}];}_0x30b285=_[_0x3836('0x3d')]({},_0x30b285,_0x2ef451['options']);return db[_0x3836('0x2b')][_0x3836('0x45')](_0x30b285)[_0x3836('0x25')](handleEntityNotFound(_0x1c4235,null))[_0x3836('0x25')](respondWithResult(_0x1c4235,null))[_0x3836('0x42')](handleError(_0x1c4235,null));};exports['create']=function(_0x2ad25b,_0x31aa6c){return db[_0x3836('0x2b')][_0x3836('0x46')](_0x2ad25b[_0x3836('0x47')],{})[_0x3836('0x25')](respondWithResult(_0x31aa6c,0xc9))[_0x3836('0x42')](handleError(_0x31aa6c,null));};exports[_0x3836('0x24')]=function(_0x33177c,_0x11bff0){if(_0x33177c[_0x3836('0x47')]['id']){delete _0x33177c[_0x3836('0x47')]['id'];}return db['IntegrationReport'][_0x3836('0x45')]({'where':{'id':_0x33177c[_0x3836('0x43')]['id']}})[_0x3836('0x25')](handleEntityNotFound(_0x11bff0,null))[_0x3836('0x25')](saveUpdates(_0x33177c[_0x3836('0x47')],null))[_0x3836('0x25')](respondWithResult(_0x11bff0,null))[_0x3836('0x42')](handleError(_0x11bff0,null));};exports[_0x3836('0x48')]=function(_0x12589a,_0x4195a2){return db['IntegrationReport'][_0x3836('0x45')]({'where':{'id':_0x12589a[_0x3836('0x43')]['id']}})[_0x3836('0x25')](handleEntityNotFound(_0x4195a2,null))[_0x3836('0x25')](removeEntity(_0x4195a2,null))[_0x3836('0x42')](handleError(_0x4195a2,null));};exports[_0x3836('0x49')]=function(_0x1a790,_0x4e0be2){return db[_0x3836('0x2b')][_0x3836('0x49')]()['then'](respondWithResult(_0x4e0be2,null))[_0x3836('0x42')](handleError(_0x4e0be2,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index 12488ea..3aa9cc1 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 _0xe646=['rimraf','../../config/environment','exports','define','IntegrationReport','report_integration','lodash','../../config/logger','api','bluebird','request-promise','path'];(function(_0x167115,_0x41a60a){var _0x1aa523=function(_0x10626f){while(--_0x10626f){_0x167115['push'](_0x167115['shift']());}};_0x1aa523(++_0x41a60a);}(_0xe646,0x1e6));var _0x6e64=function(_0x64c74c,_0x3ab585){_0x64c74c=_0x64c74c-0x0;var _0x202927=_0xe646[_0x64c74c];return _0x202927;};'use strict';var _=require(_0x6e64('0x0'));var util=require('util');var logger=require(_0x6e64('0x1'))(_0x6e64('0x2'));var moment=require('moment');var BPromise=require(_0x6e64('0x3'));var rp=require(_0x6e64('0x4'));var fs=require('fs');var path=require(_0x6e64('0x5'));var rimraf=require(_0x6e64('0x6'));var config=require(_0x6e64('0x7'));var attributes=require('./integrationReport.attributes');module[_0x6e64('0x8')]=function(_0x48db83,_0x29e441){return _0x48db83[_0x6e64('0x9')](_0x6e64('0xa'),attributes,{'tableName':_0x6e64('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8ced=['exports','define','IntegrationReport','report_integration','lodash','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./integrationReport.attributes'];(function(_0x1d63c6,_0x220b86){var _0x41fc0f=function(_0x2ecab5){while(--_0x2ecab5){_0x1d63c6['push'](_0x1d63c6['shift']());}};_0x41fc0f(++_0x220b86);}(_0x8ced,0x86));var _0xd8ce=function(_0x20d6f0,_0x33e54c){_0x20d6f0=_0x20d6f0-0x0;var _0x105ceb=_0x8ced[_0x20d6f0];return _0x105ceb;};'use strict';var _=require(_0xd8ce('0x0'));var util=require(_0xd8ce('0x1'));var logger=require(_0xd8ce('0x2'))(_0xd8ce('0x3'));var moment=require(_0xd8ce('0x4'));var BPromise=require(_0xd8ce('0x5'));var rp=require(_0xd8ce('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xd8ce('0x7'));var attributes=require(_0xd8ce('0x8'));module[_0xd8ce('0x9')]=function(_0x4bf38b,_0x42b826){return _0x4bf38b[_0xd8ce('0xa')](_0xd8ce('0xb'),attributes,{'tableName':_0xd8ce('0xc'),'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 00d52a2..dd8889b 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 _0x687b=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils'];(function(_0x164760,_0x5874b0){var _0x8b91b2=function(_0x40d20a){while(--_0x40d20a){_0x164760['push'](_0x164760['shift']());}};_0x8b91b2(++_0x5874b0);}(_0x687b,0x14a));var _0xb687=function(_0x239b5e,_0x208a3f){_0x239b5e=_0x239b5e-0x0;var _0x577f3d=_0x687b[_0x239b5e];return _0x577f3d;};'use strict';var _=require(_0xb687('0x0'));var util=require(_0xb687('0x1'));var moment=require(_0xb687('0x2'));var BPromise=require(_0xb687('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb687('0x4'))['db'];var utils=require(_0xb687('0x5'));var logger=require(_0xb687('0x6'))(_0xb687('0x7'));var config=require(_0xb687('0x8'));var jayson=require(_0xb687('0x9'));var client=jayson[_0xb687('0xa')][_0xb687('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x47ffea,_0x27b750,_0x48942b){return new BPromise(function(_0x2aea59,_0xd40346){return client['request'](_0x47ffea,_0x48942b)[_0xb687('0xc')](function(_0x21e3ab){logger[_0xb687('0xd')](_0xb687('0xe'),_0x27b750,_0xb687('0xf'));logger[_0xb687('0x10')](_0xb687('0x11'),_0x27b750,_0xb687('0xf'),JSON[_0xb687('0x12')](_0x21e3ab));if(_0x21e3ab['error']){if(_0x21e3ab[_0xb687('0x13')][_0xb687('0x14')]===0x1f4){logger[_0xb687('0x13')](_0xb687('0xe'),_0x27b750,_0x21e3ab['error']['message']);return _0xd40346(_0x21e3ab[_0xb687('0x13')][_0xb687('0x15')]);}logger['error'](_0xb687('0xe'),_0x27b750,_0x21e3ab[_0xb687('0x13')][_0xb687('0x15')]);return _0x2aea59(_0x21e3ab[_0xb687('0x13')][_0xb687('0x15')]);}else{logger[_0xb687('0xd')](_0xb687('0xe'),_0x27b750,_0xb687('0xf'));_0x2aea59(_0x21e3ab[_0xb687('0x16')][_0xb687('0x15')]);}})[_0xb687('0x17')](function(_0x19bb29){logger['error'](_0xb687('0xe'),_0x27b750,_0x19bb29);_0xd40346(_0x19bb29);});});} \ No newline at end of file +var _0x2675=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','randomstring','ioredis'];(function(_0x284f36,_0x34f9af){var _0x445ee5=function(_0x22a1a7){while(--_0x22a1a7){_0x284f36['push'](_0x284f36['shift']());}};_0x445ee5(++_0x34f9af);}(_0x2675,0x75));var _0x5267=function(_0x5b8242,_0x41b066){_0x5b8242=_0x5b8242-0x0;var _0x489db8=_0x2675[_0x5b8242];return _0x489db8;};'use strict';var _=require(_0x5267('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5267('0x1'));var fs=require('fs');var Redis=require(_0x5267('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x5267('0x3'));var logger=require(_0x5267('0x4'))('rpc');var config=require(_0x5267('0x5'));var jayson=require(_0x5267('0x6'));var client=jayson[_0x5267('0x7')][_0x5267('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x20f065,_0xc56cd5,_0x527c16){return new BPromise(function(_0x9e0a27,_0x46bfdf){return client['request'](_0x20f065,_0x527c16)[_0x5267('0x9')](function(_0x5d6645){logger[_0x5267('0xa')](_0x5267('0xb'),_0xc56cd5,_0x5267('0xc'));logger['debug'](_0x5267('0xd'),_0xc56cd5,'request\x20sent',JSON[_0x5267('0xe')](_0x5d6645));if(_0x5d6645['error']){if(_0x5d6645[_0x5267('0xf')][_0x5267('0x10')]===0x1f4){logger[_0x5267('0xf')](_0x5267('0xb'),_0xc56cd5,_0x5d6645[_0x5267('0xf')][_0x5267('0x11')]);return _0x46bfdf(_0x5d6645[_0x5267('0xf')][_0x5267('0x11')]);}logger[_0x5267('0xf')](_0x5267('0xb'),_0xc56cd5,_0x5d6645[_0x5267('0xf')][_0x5267('0x11')]);return _0x9e0a27(_0x5d6645[_0x5267('0xf')]['message']);}else{logger['info'](_0x5267('0xb'),_0xc56cd5,_0x5267('0xc'));_0x9e0a27(_0x5d6645[_0x5267('0x12')][_0x5267('0x11')]);}})[_0x5267('0x13')](function(_0x27e5c6){logger[_0x5267('0xf')](_0x5267('0xb'),_0xc56cd5,_0x27e5c6);_0x46bfdf(_0x27e5c6);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index e3f2dbf..fbcfcee 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 _0x93bb=['show','/:id/sub_intervals','getIntervals','post','create','/:id/sub_intervals/create_many','addIntervals','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id'];(function(_0x1b0a6a,_0x54f6c3){var _0x1ac3d9=function(_0x48d1f6){while(--_0x48d1f6){_0x1b0a6a['push'](_0x1b0a6a['shift']());}};_0x1ac3d9(++_0x54f6c3);}(_0x93bb,0x135));var _0xb93b=function(_0x2f4f6a,_0x378708){_0x2f4f6a=_0x2f4f6a-0x0;var _0x40af1a=_0x93bb[_0x2f4f6a];return _0x40af1a;};'use strict';var multer=require(_0xb93b('0x0'));var util=require(_0xb93b('0x1'));var path=require(_0xb93b('0x2'));var timeout=require(_0xb93b('0x3'));var express=require(_0xb93b('0x4'));var router=express[_0xb93b('0x5')]();var fs_extra=require(_0xb93b('0x6'));var auth=require(_0xb93b('0x7'));var interaction=require(_0xb93b('0x8'));var config=require(_0xb93b('0x9'));var controller=require('./interval.controller');router[_0xb93b('0xa')]('/',auth[_0xb93b('0xb')](),controller['index']);router[_0xb93b('0xa')](_0xb93b('0xc'),auth['isAuthenticated'](),controller[_0xb93b('0xd')]);router[_0xb93b('0xa')](_0xb93b('0xe'),auth[_0xb93b('0xb')](),controller[_0xb93b('0xf')]);router[_0xb93b('0x10')]('/',auth[_0xb93b('0xb')](),controller[_0xb93b('0x11')]);router[_0xb93b('0x10')](_0xb93b('0xe'),auth[_0xb93b('0xb')](),controller['addInterval']);router[_0xb93b('0x10')](_0xb93b('0x12'),auth[_0xb93b('0xb')](),controller[_0xb93b('0x13')]);router['put'](_0xb93b('0xc'),auth[_0xb93b('0xb')](),controller[_0xb93b('0x14')]);router[_0xb93b('0x15')](_0xb93b('0xc'),auth[_0xb93b('0xb')](),controller[_0xb93b('0x16')]);module['exports']=router; \ No newline at end of file +var _0xb245=['addInterval','/:id/sub_intervals/create_many','put','delete','destroy','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./interval.controller','isAuthenticated','index','/:id','get','/:id/sub_intervals','getIntervals','create','post'];(function(_0x2f6a4b,_0x102055){var _0x4ec890=function(_0x48cedc){while(--_0x48cedc){_0x2f6a4b['push'](_0x2f6a4b['shift']());}};_0x4ec890(++_0x102055);}(_0xb245,0xf8));var _0x5b24=function(_0x4b274e,_0x36f6f0){_0x4b274e=_0x4b274e-0x0;var _0x5b8162=_0xb245[_0x4b274e];return _0x5b8162;};'use strict';var multer=require(_0x5b24('0x0'));var util=require(_0x5b24('0x1'));var path=require(_0x5b24('0x2'));var timeout=require('connect-timeout');var express=require(_0x5b24('0x3'));var router=express[_0x5b24('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x5b24('0x5'));var config=require(_0x5b24('0x6'));var controller=require(_0x5b24('0x7'));router['get']('/',auth[_0x5b24('0x8')](),controller[_0x5b24('0x9')]);router['get'](_0x5b24('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x5b24('0xb')](_0x5b24('0xc'),auth['isAuthenticated'](),controller[_0x5b24('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x5b24('0xe')]);router[_0x5b24('0xf')](_0x5b24('0xc'),auth[_0x5b24('0x8')](),controller[_0x5b24('0x10')]);router[_0x5b24('0xf')](_0x5b24('0x11'),auth[_0x5b24('0x8')](),controller['addIntervals']);router[_0x5b24('0x12')](_0x5b24('0xa'),auth[_0x5b24('0x8')](),controller['update']);router[_0x5b24('0x13')](_0x5b24('0xa'),auth[_0x5b24('0x8')](),controller[_0x5b24('0x14')]);module[_0x5b24('0x15')]=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index 2bf0205..2b2e3b8 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 _0x3c3c=['STRING','sequelize'];(function(_0x7c63ed,_0x3ee1d1){var _0x39c511=function(_0x22d4b8){while(--_0x22d4b8){_0x7c63ed['push'](_0x7c63ed['shift']());}};_0x39c511(++_0x3ee1d1);}(_0x3c3c,0x1a5));var _0xc3c3=function(_0x43ead0,_0x2e45b5){_0x43ead0=_0x43ead0-0x0;var _0x42ee63=_0x3c3c[_0x43ead0];return _0x42ee63;};'use strict';var Sequelize=require(_0xc3c3('0x0'));module['exports']={'name':{'type':Sequelize[_0xc3c3('0x1')]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file +var _0x95a4=['sequelize','exports','STRING'];(function(_0x411add,_0x1aed38){var _0x238242=function(_0x4a1cd5){while(--_0x4a1cd5){_0x411add['push'](_0x411add['shift']());}};_0x238242(++_0x1aed38);}(_0x95a4,0x135));var _0x495a=function(_0x4c4959,_0x54fc9c){_0x4c4959=_0x4c4959-0x0;var _0x3ecab1=_0x95a4[_0x4c4959];return _0x3ecab1;};'use strict';var Sequelize=require(_0x495a('0x0'));module[_0x495a('0x1')]={'name':{'type':Sequelize[_0x495a('0x2')]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x495a('0x2')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/interval/interval.controller.js b/server/api/interval/interval.controller.js index b383c0a..db22745 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 _0x3088=['intersection','include','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','addInterval','getIntervals','findOne','addIntervals','sequelize','transaction','bulkCreate','eml-format','rimraf','zip-dir','request-promise','mustache','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/extensions/rewrite','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','update','destroy','then','get','Intervals','UserProfileResource','error','stack','name','send','index','map','Interval','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params'];(function(_0x24563c,_0x49d7cd){var _0x14796e=function(_0x3ab3d9){while(--_0x3ab3d9){_0x24563c['push'](_0x24563c['shift']());}};_0x14796e(++_0x49d7cd);}(_0x3088,0x6b));var _0x8308=function(_0x3b0912,_0x39d739){_0x3b0912=_0x3b0912-0x0;var _0xa8f339=_0x3088[_0x3b0912];return _0xa8f339;};'use strict';var emlformat=require(_0x8308('0x0'));var rimraf=require(_0x8308('0x1'));var zipdir=require(_0x8308('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8308('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x8308('0x4'));var util=require('util');var path=require('path');var sox=require(_0x8308('0x5'));var csv=require(_0x8308('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8308('0x7'));var squel=require(_0x8308('0x8'));var crypto=require(_0x8308('0x9'));var jsforce=require(_0x8308('0xa'));var deskjs=require(_0x8308('0xb'));var toCsv=require('to-csv');var querystring=require(_0x8308('0xc'));var Papa=require(_0x8308('0xd'));var Redis=require(_0x8308('0xe'));var authService=require(_0x8308('0xf'));var qs=require(_0x8308('0x10'));var as=require(_0x8308('0x11'));var hardwareService=require(_0x8308('0x12'));var logger=require('../../config/logger')(_0x8308('0x13'));var utils=require(_0x8308('0x14'));var config=require(_0x8308('0x15'));var licenseUtil=require(_0x8308('0x16'));var db=require(_0x8308('0x17'))['db'];var extensions=require(_0x8308('0x18'));function respondWithStatusCode(_0x5af66a,_0x3fac17){_0x3fac17=_0x3fac17||0xcc;return function(_0xa1c1c6){if(_0xa1c1c6){return _0x5af66a[_0x8308('0x19')](_0x3fac17);}return _0x5af66a[_0x8308('0x1a')](_0x3fac17)[_0x8308('0x1b')]();};}function respondWithResult(_0x3c1a40,_0x3cef95){_0x3cef95=_0x3cef95||0xc8;return function(_0x1df6da){if(_0x1df6da){return _0x3c1a40[_0x8308('0x1a')](_0x3cef95)[_0x8308('0x1c')](_0x1df6da);}};}function respondWithFilteredResult(_0xcf593,_0x583936){return function(_0x2eb2d5){if(_0x2eb2d5){var _0x5cf37a=typeof _0x583936[_0x8308('0x1d')]==='undefined'&&typeof _0x583936[_0x8308('0x1e')]===_0x8308('0x1f');var _0x2553ae=_0x2eb2d5['count'];var _0x48b861=_0x5cf37a?0x0:_0x583936[_0x8308('0x1d')];var _0x3ee001=_0x5cf37a?_0x2eb2d5[_0x8308('0x20')]:_0x583936[_0x8308('0x1d')]+_0x583936['limit'];var _0x143bff;if(_0x3ee001>=_0x2553ae){_0x3ee001=_0x2553ae;_0x143bff=0xc8;}else{_0x143bff=0xce;}_0xcf593[_0x8308('0x1a')](_0x143bff);return _0xcf593[_0x8308('0x21')](_0x8308('0x22'),_0x48b861+'-'+_0x3ee001+'/'+_0x2553ae)[_0x8308('0x1c')](_0x2eb2d5);}return null;};}function patchUpdates(_0x3d7a21){return function(_0x3eb783){try{jsonpatch['apply'](_0x3eb783,_0x3d7a21,!![]);}catch(_0x201cb5){return BPromise['reject'](_0x201cb5);}return _0x3eb783['save']();};}function saveUpdates(_0x5dd410,_0x1a841b){return function(_0x249df6){if(_0x249df6){return _0x249df6[_0x8308('0x23')](_0x5dd410)['then'](function(_0x534e83){return _0x534e83;});}return null;};}function removeEntity(_0x4636a1,_0x322433){return function(_0x512b8f){if(_0x512b8f){return _0x512b8f[_0x8308('0x24')]()[_0x8308('0x25')](function(){var _0x23dffa=_0x512b8f[_0x8308('0x26')]({'plain':!![]});var _0x595554=_0x8308('0x27');return db[_0x8308('0x28')][_0x8308('0x24')]({'where':{'type':_0x595554,'resourceId':_0x23dffa['id']}})[_0x8308('0x25')](function(){return _0x512b8f;});})[_0x8308('0x25')](function(){_0x4636a1[_0x8308('0x1a')](0xcc)[_0x8308('0x1b')]();});}};}function handleEntityNotFound(_0x3d76c3,_0xe5f0b8){return function(_0x5c8dbc){if(!_0x5c8dbc){_0x3d76c3[_0x8308('0x19')](0x194);}return _0x5c8dbc;};}function handleError(_0x363891,_0x5af829){_0x5af829=_0x5af829||0x1f4;return function(_0x448354){logger[_0x8308('0x29')](_0x448354[_0x8308('0x2a')]);if(_0x448354['name']){delete _0x448354[_0x8308('0x2b')];}_0x363891[_0x8308('0x1a')](_0x5af829)[_0x8308('0x2c')](_0x448354);};}exports[_0x8308('0x2d')]=function(_0x809914,_0x384489){var _0xcd7493={},_0x16a667={},_0x613094={'count':0x0,'rows':[]};var _0x404ecf=_[_0x8308('0x2e')](db[_0x8308('0x2f')][_0x8308('0x30')],function(_0x298b9e){return{'name':_0x298b9e[_0x8308('0x31')],'type':_0x298b9e[_0x8308('0x32')][_0x8308('0x33')]};});_0x16a667[_0x8308('0x34')]=_[_0x8308('0x2e')](_0x404ecf,_0x8308('0x2b'));_0x16a667[_0x8308('0x35')]=_[_0x8308('0x36')](_0x809914[_0x8308('0x35')]);_0x16a667[_0x8308('0x37')]=_['intersection'](_0x16a667[_0x8308('0x34')],_0x16a667[_0x8308('0x35')]);_0xcd7493[_0x8308('0x38')]=_['intersection'](_0x16a667['model'],qs[_0x8308('0x39')](_0x809914[_0x8308('0x35')][_0x8308('0x39')]));_0xcd7493[_0x8308('0x38')]=_0xcd7493[_0x8308('0x38')][_0x8308('0x3a')]?_0xcd7493[_0x8308('0x38')]:_0x16a667['model'];if(!_0x809914[_0x8308('0x35')][_0x8308('0x3b')](_0x8308('0x3c'))){_0xcd7493[_0x8308('0x1e')]=qs[_0x8308('0x1e')](_0x809914[_0x8308('0x35')][_0x8308('0x1e')]);_0xcd7493['offset']=qs[_0x8308('0x1d')](_0x809914[_0x8308('0x35')]['offset']);}_0xcd7493[_0x8308('0x3d')]=qs[_0x8308('0x3e')](_0x809914[_0x8308('0x35')]['sort']);_0xcd7493['where']=qs[_0x8308('0x37')](_[_0x8308('0x3f')](_0x809914['query'],_0x16a667[_0x8308('0x37')]),_0x404ecf);if(_0x809914[_0x8308('0x35')][_0x8308('0x40')]){_0xcd7493[_0x8308('0x41')]=_[_0x8308('0x42')](_0xcd7493[_0x8308('0x41')],{'$or':_[_0x8308('0x2e')](_0x404ecf,function(_0x1098a2){if(_0x1098a2[_0x8308('0x32')]!==_0x8308('0x43')){var _0x3dc40a={};_0x3dc40a[_0x1098a2[_0x8308('0x2b')]]={'$like':'%'+_0x809914[_0x8308('0x35')][_0x8308('0x40')]+'%'};return _0x3dc40a;}})});}_0xcd7493=_[_0x8308('0x42')]({},_0xcd7493,_0x809914[_0x8308('0x44')]);var _0x33a56c={'where':_0xcd7493['where']};return db[_0x8308('0x2f')][_0x8308('0x20')](_0x33a56c)[_0x8308('0x25')](function(_0x5290a7){_0x613094[_0x8308('0x20')]=_0x5290a7;if(_0x809914[_0x8308('0x35')][_0x8308('0x45')]){_0xcd7493['include']=[{'all':!![]}];}return db[_0x8308('0x2f')][_0x8308('0x46')](_0xcd7493);})[_0x8308('0x25')](function(_0x160fe7){_0x613094[_0x8308('0x47')]=_0x160fe7;return _0x613094;})[_0x8308('0x25')](respondWithFilteredResult(_0x384489,_0xcd7493))[_0x8308('0x48')](handleError(_0x384489,null));};exports[_0x8308('0x49')]=function(_0x1d5432,_0x30f0e6){var _0x5d5156={'raw':!![],'where':{'id':_0x1d5432[_0x8308('0x4a')]['id']}},_0x140b09={};_0x140b09[_0x8308('0x34')]=_['keys'](db[_0x8308('0x2f')][_0x8308('0x30')]);_0x140b09[_0x8308('0x35')]=_[_0x8308('0x36')](_0x1d5432[_0x8308('0x35')]);_0x140b09[_0x8308('0x37')]=_[_0x8308('0x4b')](_0x140b09[_0x8308('0x34')],_0x140b09[_0x8308('0x35')]);_0x5d5156[_0x8308('0x38')]=_[_0x8308('0x4b')](_0x140b09[_0x8308('0x34')],qs[_0x8308('0x39')](_0x1d5432[_0x8308('0x35')]['fields']));_0x5d5156['attributes']=_0x5d5156[_0x8308('0x38')]['length']?_0x5d5156['attributes']:_0x140b09[_0x8308('0x34')];if(_0x1d5432[_0x8308('0x35')][_0x8308('0x45')]){_0x5d5156[_0x8308('0x4c')]=[{'all':!![]}];}_0x5d5156=_['merge']({},_0x5d5156,_0x1d5432[_0x8308('0x44')]);return db[_0x8308('0x2f')]['find'](_0x5d5156)[_0x8308('0x25')](handleEntityNotFound(_0x30f0e6,null))['then'](respondWithResult(_0x30f0e6,null))[_0x8308('0x48')](handleError(_0x30f0e6,null));};exports[_0x8308('0x4d')]=function(_0x22daf2,_0x2a8998){return db['Interval']['create'](_0x22daf2['body'],{})['then'](function(_0x54984f){var _0xb4b6b9=_0x22daf2['user'][_0x8308('0x26')]({'plain':!![]});if(!_0xb4b6b9)throw new Error(_0x8308('0x4e'));if(_0xb4b6b9['role']==='user'){var _0xd37f2a=_0x54984f[_0x8308('0x26')]({'plain':!![]});var _0x225efd='Intervals';return db[_0x8308('0x4f')][_0x8308('0x50')]({'where':{'name':_0x225efd,'userProfileId':_0xb4b6b9['userProfileId']},'raw':!![]})['then'](function(_0x5a8442){if(_0x5a8442&&_0x5a8442[_0x8308('0x51')]===0x0){return db['UserProfileResource'][_0x8308('0x4d')]({'name':_0xd37f2a['name'],'resourceId':_0xd37f2a['id'],'type':_0x5a8442['name'],'sectionId':_0x5a8442['id']},{})[_0x8308('0x25')](function(){return _0x54984f;});}else{return _0x54984f;}})[_0x8308('0x48')](function(_0x504708){logger[_0x8308('0x29')](_0x8308('0x52'),_0x504708);throw _0x504708;});}return _0x54984f;})[_0x8308('0x25')](respondWithResult(_0x2a8998,0xc9))[_0x8308('0x48')](handleError(_0x2a8998,null));};exports[_0x8308('0x23')]=function(_0x276670,_0x104658){if(_0x276670['body']['id']){delete _0x276670[_0x8308('0x53')]['id'];}return db[_0x8308('0x2f')][_0x8308('0x50')]({'where':{'id':_0x276670['params']['id']}})[_0x8308('0x25')](handleEntityNotFound(_0x104658,null))[_0x8308('0x25')](saveUpdates(_0x276670[_0x8308('0x53')],null))[_0x8308('0x25')](respondWithResult(_0x104658,null))[_0x8308('0x48')](handleError(_0x104658,null));};exports['destroy']=function(_0x2a7899,_0x513ac3){return db['Interval']['find']({'where':{'id':_0x2a7899[_0x8308('0x4a')]['id']}})['then'](handleEntityNotFound(_0x513ac3,null))['then'](removeEntity(_0x513ac3,null))['catch'](handleError(_0x513ac3,null));};exports[_0x8308('0x54')]=function(_0x4c4600,_0x3cb8a5,_0x3184e6){if(_0x4c4600['body']['id']){delete _0x4c4600[_0x8308('0x53')]['id'];}return db[_0x8308('0x2f')][_0x8308('0x50')]({'where':{'id':_0x4c4600[_0x8308('0x4a')]['id']}})[_0x8308('0x25')](handleEntityNotFound(_0x3cb8a5,null))[_0x8308('0x25')](function(_0x3ea288){if(_0x3ea288){_0x4c4600[_0x8308('0x53')]['IntervalId']=_0x3ea288['id'];return db['Interval'][_0x8308('0x4d')](_0x4c4600[_0x8308('0x53')]);}})[_0x8308('0x25')](respondWithResult(_0x3cb8a5,null))[_0x8308('0x48')](handleError(_0x3cb8a5,null));};exports[_0x8308('0x55')]=function(_0x4dfa23,_0x483b8a,_0x4adce1){var _0x3ede26={};var _0x3bd73f={};var _0xbf78ea;var _0x4c7fd7;return db[_0x8308('0x2f')][_0x8308('0x56')]({'where':{'id':_0x4dfa23['params']['id']}})[_0x8308('0x25')](handleEntityNotFound(_0x483b8a,null))[_0x8308('0x25')](function(_0x2432b8){if(_0x2432b8){_0xbf78ea=_0x2432b8;_0x3bd73f[_0x8308('0x34')]=_[_0x8308('0x36')](db[_0x8308('0x2f')][_0x8308('0x30')]);_0x3bd73f['query']=_[_0x8308('0x36')](_0x4dfa23[_0x8308('0x35')]);_0x3bd73f[_0x8308('0x37')]=_[_0x8308('0x4b')](_0x3bd73f[_0x8308('0x34')],_0x3bd73f[_0x8308('0x35')]);_0x3ede26[_0x8308('0x38')]=_[_0x8308('0x4b')](_0x3bd73f[_0x8308('0x34')],qs[_0x8308('0x39')](_0x4dfa23[_0x8308('0x35')][_0x8308('0x39')]));_0x3ede26[_0x8308('0x38')]=_0x3ede26[_0x8308('0x38')][_0x8308('0x3a')]?_0x3ede26[_0x8308('0x38')]:_0x3bd73f[_0x8308('0x34')];_0x3ede26[_0x8308('0x3d')]=qs[_0x8308('0x3e')](_0x4dfa23[_0x8308('0x35')][_0x8308('0x3e')]);_0x3ede26[_0x8308('0x41')]=qs['filters'](_[_0x8308('0x3f')](_0x4dfa23['query'],_0x3bd73f[_0x8308('0x37')]));if(_0x4dfa23[_0x8308('0x35')][_0x8308('0x40')]){_0x3ede26[_0x8308('0x41')]=_[_0x8308('0x42')](_0x3ede26[_0x8308('0x41')],{'$or':_['map'](_0x3ede26[_0x8308('0x38')],function(_0x5146fe){var _0x5f57c8={};_0x5f57c8[_0x5146fe]={'$like':'%'+_0x4dfa23[_0x8308('0x35')][_0x8308('0x40')]+'%'};return _0x5f57c8;})});}_0x3ede26=_[_0x8308('0x42')]({},_0x3ede26,_0x4dfa23['options']);return _0xbf78ea[_0x8308('0x55')](_0x3ede26);}})[_0x8308('0x25')](function(_0x139dfd){if(_0x139dfd){_0x4c7fd7=_0x139dfd['length'];if(!_0x4dfa23[_0x8308('0x35')]['hasOwnProperty'](_0x8308('0x3c'))){_0x3ede26[_0x8308('0x1e')]=qs[_0x8308('0x1e')](_0x4dfa23[_0x8308('0x35')][_0x8308('0x1e')]);_0x3ede26[_0x8308('0x1d')]=qs[_0x8308('0x1d')](_0x4dfa23[_0x8308('0x35')][_0x8308('0x1d')]);}return _0xbf78ea[_0x8308('0x55')](_0x3ede26);}})[_0x8308('0x25')](function(_0x1627db){if(_0x1627db){return _0x1627db?{'count':_0x4c7fd7,'rows':_0x1627db}:null;}})['then'](respondWithResult(_0x483b8a,null))[_0x8308('0x48')](handleError(_0x483b8a,null));};exports[_0x8308('0x57')]=function(_0x5c32ef,_0x15447f,_0x992a20){return db['Interval'][_0x8308('0x56')]({'where':{'id':_0x5c32ef[_0x8308('0x4a')]['id']}})['then'](handleEntityNotFound(_0x15447f,null))[_0x8308('0x25')](function(_0x5d4076){if(_0x5d4076){return db[_0x8308('0x58')][_0x8308('0x59')](function(_0xa24e7e){return db['Interval'][_0x8308('0x24')]({'where':{'IntervalId':_0x5c32ef[_0x8308('0x4a')]['id']},'transaction':_0xa24e7e})[_0x8308('0x25')](function(_0xe17bde){var _0x3b203c=_[_0x8308('0x2e')](_0x5c32ef[_0x8308('0x53')],function(_0x9bc73){delete _0x9bc73['id'];_0x9bc73['IntervalId']=_0x5c32ef[_0x8308('0x4a')]['id'];return _0x9bc73;});return db['Interval'][_0x8308('0x5a')](_0x3b203c,{'transaction':_0xa24e7e});});})[_0x8308('0x25')](function(){return db[_0x8308('0x2f')][_0x8308('0x46')]({'where':{'IntervalId':_0x5c32ef[_0x8308('0x4a')]['id']}});});}})[_0x8308('0x25')](respondWithResult(_0x15447f,null))['catch'](handleError(_0x15447f,null));}; \ No newline at end of file +var _0x58bb=['role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addInterval','IntervalId','sort','getIntervals','hasOwnProperty','addIntervals','bulkCreate','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','../../components/extensions/rewrite','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','Intervals','stack','name','send','index','map','Interval','fieldName','type','key','model','query','keys','intersection','fields','attributes','nolimit','order','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user'];(function(_0x33d4a2,_0x2baaf4){var _0x2c793f=function(_0x414303){while(--_0x414303){_0x33d4a2['push'](_0x33d4a2['shift']());}};_0x2c793f(++_0x2baaf4);}(_0x58bb,0x6c));var _0xb58b=function(_0x109f3f,_0x330d7b){_0x109f3f=_0x109f3f-0x0;var _0x1408af=_0x58bb[_0x109f3f];return _0x1408af;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xb58b('0x0'));var jsonpatch=require(_0xb58b('0x1'));var rp=require(_0xb58b('0x2'));var moment=require(_0xb58b('0x3'));var BPromise=require(_0xb58b('0x4'));var Mustache=require(_0xb58b('0x5'));var util=require('util');var path=require(_0xb58b('0x6'));var sox=require(_0xb58b('0x7'));var csv=require('to-csv');var ejs=require(_0xb58b('0x8'));var fs=require('fs');var fs_extra=require(_0xb58b('0x9'));var _=require(_0xb58b('0xa'));var squel=require(_0xb58b('0xb'));var crypto=require(_0xb58b('0xc'));var jsforce=require(_0xb58b('0xd'));var deskjs=require(_0xb58b('0xe'));var toCsv=require(_0xb58b('0xf'));var querystring=require(_0xb58b('0x10'));var Papa=require(_0xb58b('0x11'));var Redis=require('ioredis');var authService=require(_0xb58b('0x12'));var qs=require(_0xb58b('0x13'));var as=require(_0xb58b('0x14'));var hardwareService=require(_0xb58b('0x15'));var logger=require(_0xb58b('0x16'))('api');var utils=require(_0xb58b('0x17'));var config=require(_0xb58b('0x18'));var licenseUtil=require(_0xb58b('0x19'));var db=require(_0xb58b('0x1a'))['db'];var extensions=require(_0xb58b('0x1b'));function respondWithStatusCode(_0x2f86a2,_0x35f3f2){_0x35f3f2=_0x35f3f2||0xcc;return function(_0x24bb5f){if(_0x24bb5f){return _0x2f86a2[_0xb58b('0x1c')](_0x35f3f2);}return _0x2f86a2[_0xb58b('0x1d')](_0x35f3f2)[_0xb58b('0x1e')]();};}function respondWithResult(_0x961c34,_0x19adac){_0x19adac=_0x19adac||0xc8;return function(_0x1fefca){if(_0x1fefca){return _0x961c34[_0xb58b('0x1d')](_0x19adac)[_0xb58b('0x1f')](_0x1fefca);}};}function respondWithFilteredResult(_0x3df60e,_0x328a97){return function(_0x400f2a){if(_0x400f2a){var _0x27dc59=typeof _0x328a97[_0xb58b('0x20')]===_0xb58b('0x21')&&typeof _0x328a97[_0xb58b('0x22')]==='undefined';var _0xbc481b=_0x400f2a[_0xb58b('0x23')];var _0x48743c=_0x27dc59?0x0:_0x328a97[_0xb58b('0x20')];var _0x4ced32=_0x27dc59?_0x400f2a[_0xb58b('0x23')]:_0x328a97[_0xb58b('0x20')]+_0x328a97['limit'];var _0x507316;if(_0x4ced32>=_0xbc481b){_0x4ced32=_0xbc481b;_0x507316=0xc8;}else{_0x507316=0xce;}_0x3df60e[_0xb58b('0x1d')](_0x507316);return _0x3df60e[_0xb58b('0x24')](_0xb58b('0x25'),_0x48743c+'-'+_0x4ced32+'/'+_0xbc481b)[_0xb58b('0x1f')](_0x400f2a);}return null;};}function patchUpdates(_0x5ca512){return function(_0xa03fe6){try{jsonpatch[_0xb58b('0x26')](_0xa03fe6,_0x5ca512,!![]);}catch(_0x222c1b){return BPromise[_0xb58b('0x27')](_0x222c1b);}return _0xa03fe6['save']();};}function saveUpdates(_0x31043c,_0xf7f533){return function(_0x50fb99){if(_0x50fb99){return _0x50fb99[_0xb58b('0x28')](_0x31043c)[_0xb58b('0x29')](function(_0x519378){return _0x519378;});}return null;};}function removeEntity(_0x2e5ec6,_0x16249d){return function(_0x570639){if(_0x570639){return _0x570639[_0xb58b('0x2a')]()[_0xb58b('0x29')](function(){var _0x3ef267=_0x570639['get']({'plain':!![]});var _0x4dc8e0=_0xb58b('0x2b');return db['UserProfileResource'][_0xb58b('0x2a')]({'where':{'type':_0x4dc8e0,'resourceId':_0x3ef267['id']}})[_0xb58b('0x29')](function(){return _0x570639;});})[_0xb58b('0x29')](function(){_0x2e5ec6[_0xb58b('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4844b1,_0x403a42){return function(_0x3705bd){if(!_0x3705bd){_0x4844b1[_0xb58b('0x1c')](0x194);}return _0x3705bd;};}function handleError(_0x39d162,_0x52de32){_0x52de32=_0x52de32||0x1f4;return function(_0x4ad1fa){logger['error'](_0x4ad1fa[_0xb58b('0x2c')]);if(_0x4ad1fa[_0xb58b('0x2d')]){delete _0x4ad1fa[_0xb58b('0x2d')];}_0x39d162[_0xb58b('0x1d')](_0x52de32)[_0xb58b('0x2e')](_0x4ad1fa);};}exports[_0xb58b('0x2f')]=function(_0x5593f1,_0x4f42e9){var _0x240ad9={},_0x2fd88b={},_0x28ca1e={'count':0x0,'rows':[]};var _0x23d47b=_[_0xb58b('0x30')](db[_0xb58b('0x31')]['rawAttributes'],function(_0x3715e5){return{'name':_0x3715e5[_0xb58b('0x32')],'type':_0x3715e5[_0xb58b('0x33')][_0xb58b('0x34')]};});_0x2fd88b[_0xb58b('0x35')]=_[_0xb58b('0x30')](_0x23d47b,_0xb58b('0x2d'));_0x2fd88b[_0xb58b('0x36')]=_[_0xb58b('0x37')](_0x5593f1['query']);_0x2fd88b['filters']=_[_0xb58b('0x38')](_0x2fd88b['model'],_0x2fd88b['query']);_0x240ad9['attributes']=_[_0xb58b('0x38')](_0x2fd88b['model'],qs[_0xb58b('0x39')](_0x5593f1['query']['fields']));_0x240ad9[_0xb58b('0x3a')]=_0x240ad9[_0xb58b('0x3a')]['length']?_0x240ad9['attributes']:_0x2fd88b[_0xb58b('0x35')];if(!_0x5593f1[_0xb58b('0x36')]['hasOwnProperty'](_0xb58b('0x3b'))){_0x240ad9[_0xb58b('0x22')]=qs[_0xb58b('0x22')](_0x5593f1[_0xb58b('0x36')][_0xb58b('0x22')]);_0x240ad9[_0xb58b('0x20')]=qs[_0xb58b('0x20')](_0x5593f1[_0xb58b('0x36')]['offset']);}_0x240ad9[_0xb58b('0x3c')]=qs['sort'](_0x5593f1['query']['sort']);_0x240ad9[_0xb58b('0x3d')]=qs[_0xb58b('0x3e')](_[_0xb58b('0x3f')](_0x5593f1[_0xb58b('0x36')],_0x2fd88b[_0xb58b('0x3e')]),_0x23d47b);if(_0x5593f1[_0xb58b('0x36')][_0xb58b('0x40')]){_0x240ad9[_0xb58b('0x3d')]=_[_0xb58b('0x41')](_0x240ad9[_0xb58b('0x3d')],{'$or':_['map'](_0x23d47b,function(_0x43a8f2){if(_0x43a8f2[_0xb58b('0x33')]!==_0xb58b('0x42')){var _0x679401={};_0x679401[_0x43a8f2[_0xb58b('0x2d')]]={'$like':'%'+_0x5593f1[_0xb58b('0x36')][_0xb58b('0x40')]+'%'};return _0x679401;}})});}_0x240ad9=_[_0xb58b('0x41')]({},_0x240ad9,_0x5593f1[_0xb58b('0x43')]);var _0x4fbb0e={'where':_0x240ad9[_0xb58b('0x3d')]};return db[_0xb58b('0x31')]['count'](_0x4fbb0e)[_0xb58b('0x29')](function(_0x26d24b){_0x28ca1e[_0xb58b('0x23')]=_0x26d24b;if(_0x5593f1[_0xb58b('0x36')][_0xb58b('0x44')]){_0x240ad9[_0xb58b('0x45')]=[{'all':!![]}];}return db[_0xb58b('0x31')][_0xb58b('0x46')](_0x240ad9);})[_0xb58b('0x29')](function(_0x2321c2){_0x28ca1e[_0xb58b('0x47')]=_0x2321c2;return _0x28ca1e;})['then'](respondWithFilteredResult(_0x4f42e9,_0x240ad9))[_0xb58b('0x48')](handleError(_0x4f42e9,null));};exports[_0xb58b('0x49')]=function(_0x3542c5,_0x182817){var _0x5a43cf={'raw':!![],'where':{'id':_0x3542c5[_0xb58b('0x4a')]['id']}},_0x224505={};_0x224505[_0xb58b('0x35')]=_['keys'](db[_0xb58b('0x31')][_0xb58b('0x4b')]);_0x224505['query']=_['keys'](_0x3542c5['query']);_0x224505[_0xb58b('0x3e')]=_[_0xb58b('0x38')](_0x224505[_0xb58b('0x35')],_0x224505[_0xb58b('0x36')]);_0x5a43cf[_0xb58b('0x3a')]=_['intersection'](_0x224505['model'],qs[_0xb58b('0x39')](_0x3542c5[_0xb58b('0x36')][_0xb58b('0x39')]));_0x5a43cf[_0xb58b('0x3a')]=_0x5a43cf[_0xb58b('0x3a')][_0xb58b('0x4c')]?_0x5a43cf[_0xb58b('0x3a')]:_0x224505[_0xb58b('0x35')];if(_0x3542c5[_0xb58b('0x36')]['includeAll']){_0x5a43cf['include']=[{'all':!![]}];}_0x5a43cf=_[_0xb58b('0x41')]({},_0x5a43cf,_0x3542c5[_0xb58b('0x43')]);return db[_0xb58b('0x31')][_0xb58b('0x4d')](_0x5a43cf)['then'](handleEntityNotFound(_0x182817,null))['then'](respondWithResult(_0x182817,null))[_0xb58b('0x48')](handleError(_0x182817,null));};exports[_0xb58b('0x4e')]=function(_0x538e8e,_0x241ca7){return db[_0xb58b('0x31')][_0xb58b('0x4e')](_0x538e8e[_0xb58b('0x4f')],{})[_0xb58b('0x29')](function(_0x5132c1){var _0xdd7634=_0x538e8e['user'][_0xb58b('0x50')]({'plain':!![]});if(!_0xdd7634)throw new Error(_0xb58b('0x51'));if(_0xdd7634[_0xb58b('0x52')]===_0xb58b('0x53')){var _0x5496af=_0x5132c1[_0xb58b('0x50')]({'plain':!![]});var _0x276c79=_0xb58b('0x2b');return db[_0xb58b('0x54')]['find']({'where':{'name':_0x276c79,'userProfileId':_0xdd7634[_0xb58b('0x55')]},'raw':!![]})[_0xb58b('0x29')](function(_0x792cc7){if(_0x792cc7&&_0x792cc7[_0xb58b('0x56')]===0x0){return db['UserProfileResource']['create']({'name':_0x5496af[_0xb58b('0x2d')],'resourceId':_0x5496af['id'],'type':_0x792cc7[_0xb58b('0x2d')],'sectionId':_0x792cc7['id']},{})['then'](function(){return _0x5132c1;});}else{return _0x5132c1;}})[_0xb58b('0x48')](function(_0x2bb404){logger['error'](_0xb58b('0x57'),_0x2bb404);throw _0x2bb404;});}return _0x5132c1;})['then'](respondWithResult(_0x241ca7,0xc9))['catch'](handleError(_0x241ca7,null));};exports[_0xb58b('0x28')]=function(_0x4b623e,_0x17d8c9){if(_0x4b623e['body']['id']){delete _0x4b623e[_0xb58b('0x4f')]['id'];}return db[_0xb58b('0x31')][_0xb58b('0x4d')]({'where':{'id':_0x4b623e[_0xb58b('0x4a')]['id']}})['then'](handleEntityNotFound(_0x17d8c9,null))[_0xb58b('0x29')](saveUpdates(_0x4b623e[_0xb58b('0x4f')],null))[_0xb58b('0x29')](respondWithResult(_0x17d8c9,null))[_0xb58b('0x48')](handleError(_0x17d8c9,null));};exports[_0xb58b('0x2a')]=function(_0x20fadf,_0xa870b){return db['Interval'][_0xb58b('0x4d')]({'where':{'id':_0x20fadf[_0xb58b('0x4a')]['id']}})[_0xb58b('0x29')](handleEntityNotFound(_0xa870b,null))['then'](removeEntity(_0xa870b,null))['catch'](handleError(_0xa870b,null));};exports[_0xb58b('0x58')]=function(_0x547ca0,_0x9dedd,_0x276695){if(_0x547ca0[_0xb58b('0x4f')]['id']){delete _0x547ca0[_0xb58b('0x4f')]['id'];}return db[_0xb58b('0x31')][_0xb58b('0x4d')]({'where':{'id':_0x547ca0['params']['id']}})['then'](handleEntityNotFound(_0x9dedd,null))[_0xb58b('0x29')](function(_0x11bb0f){if(_0x11bb0f){_0x547ca0[_0xb58b('0x4f')][_0xb58b('0x59')]=_0x11bb0f['id'];return db['Interval'][_0xb58b('0x4e')](_0x547ca0[_0xb58b('0x4f')]);}})[_0xb58b('0x29')](respondWithResult(_0x9dedd,null))[_0xb58b('0x48')](handleError(_0x9dedd,null));};exports['getIntervals']=function(_0x2a4601,_0x590d17,_0x2e4e26){var _0x1ba0c8={};var _0x5eda7a={};var _0x57a5e3;var _0x569b5d;return db[_0xb58b('0x31')]['findOne']({'where':{'id':_0x2a4601[_0xb58b('0x4a')]['id']}})[_0xb58b('0x29')](handleEntityNotFound(_0x590d17,null))[_0xb58b('0x29')](function(_0x581649){if(_0x581649){_0x57a5e3=_0x581649;_0x5eda7a[_0xb58b('0x35')]=_[_0xb58b('0x37')](db['Interval']['rawAttributes']);_0x5eda7a[_0xb58b('0x36')]=_[_0xb58b('0x37')](_0x2a4601[_0xb58b('0x36')]);_0x5eda7a[_0xb58b('0x3e')]=_[_0xb58b('0x38')](_0x5eda7a[_0xb58b('0x35')],_0x5eda7a[_0xb58b('0x36')]);_0x1ba0c8['attributes']=_[_0xb58b('0x38')](_0x5eda7a['model'],qs[_0xb58b('0x39')](_0x2a4601['query']['fields']));_0x1ba0c8[_0xb58b('0x3a')]=_0x1ba0c8[_0xb58b('0x3a')][_0xb58b('0x4c')]?_0x1ba0c8[_0xb58b('0x3a')]:_0x5eda7a[_0xb58b('0x35')];_0x1ba0c8[_0xb58b('0x3c')]=qs[_0xb58b('0x5a')](_0x2a4601['query'][_0xb58b('0x5a')]);_0x1ba0c8[_0xb58b('0x3d')]=qs[_0xb58b('0x3e')](_[_0xb58b('0x3f')](_0x2a4601[_0xb58b('0x36')],_0x5eda7a[_0xb58b('0x3e')]));if(_0x2a4601[_0xb58b('0x36')][_0xb58b('0x40')]){_0x1ba0c8[_0xb58b('0x3d')]=_[_0xb58b('0x41')](_0x1ba0c8[_0xb58b('0x3d')],{'$or':_[_0xb58b('0x30')](_0x1ba0c8[_0xb58b('0x3a')],function(_0x5c3f35){var _0x43048f={};_0x43048f[_0x5c3f35]={'$like':'%'+_0x2a4601['query']['filter']+'%'};return _0x43048f;})});}_0x1ba0c8=_['merge']({},_0x1ba0c8,_0x2a4601[_0xb58b('0x43')]);return _0x57a5e3[_0xb58b('0x5b')](_0x1ba0c8);}})[_0xb58b('0x29')](function(_0x383dd4){if(_0x383dd4){_0x569b5d=_0x383dd4[_0xb58b('0x4c')];if(!_0x2a4601[_0xb58b('0x36')][_0xb58b('0x5c')]('nolimit')){_0x1ba0c8[_0xb58b('0x22')]=qs[_0xb58b('0x22')](_0x2a4601['query']['limit']);_0x1ba0c8[_0xb58b('0x20')]=qs[_0xb58b('0x20')](_0x2a4601[_0xb58b('0x36')][_0xb58b('0x20')]);}return _0x57a5e3[_0xb58b('0x5b')](_0x1ba0c8);}})[_0xb58b('0x29')](function(_0x408784){if(_0x408784){return _0x408784?{'count':_0x569b5d,'rows':_0x408784}:null;}})[_0xb58b('0x29')](respondWithResult(_0x590d17,null))[_0xb58b('0x48')](handleError(_0x590d17,null));};exports[_0xb58b('0x5d')]=function(_0x34962a,_0x17983b,_0x1c83d7){return db[_0xb58b('0x31')]['findOne']({'where':{'id':_0x34962a[_0xb58b('0x4a')]['id']}})[_0xb58b('0x29')](handleEntityNotFound(_0x17983b,null))[_0xb58b('0x29')](function(_0x3c3076){if(_0x3c3076){return db['sequelize']['transaction'](function(_0xf99b07){return db[_0xb58b('0x31')][_0xb58b('0x2a')]({'where':{'IntervalId':_0x34962a['params']['id']},'transaction':_0xf99b07})['then'](function(_0x33ff3b){var _0x219b84=_[_0xb58b('0x30')](_0x34962a[_0xb58b('0x4f')],function(_0x4d9159){delete _0x4d9159['id'];_0x4d9159['IntervalId']=_0x34962a[_0xb58b('0x4a')]['id'];return _0x4d9159;});return db[_0xb58b('0x31')][_0xb58b('0x5e')](_0x219b84,{'transaction':_0xf99b07});});})[_0xb58b('0x29')](function(){return db['Interval'][_0xb58b('0x46')]({'where':{'IntervalId':_0x34962a[_0xb58b('0x4a')]['id']}});});}})[_0xb58b('0x29')](respondWithResult(_0x17983b,null))['catch'](handleError(_0x17983b,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index 5f5592b..8a53759 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 _0xa07e=['rimraf','./interval.attributes','../../components/extensions/rewrite','define','tools_intervals','rewrite','lodash','util','api','moment','bluebird','request-promise'];(function(_0x1c8028,_0x2fa83a){var _0x3c816b=function(_0x446915){while(--_0x446915){_0x1c8028['push'](_0x1c8028['shift']());}};_0x3c816b(++_0x2fa83a);}(_0xa07e,0x156));var _0xea07=function(_0x2c4763,_0x4a64bc){_0x2c4763=_0x2c4763-0x0;var _0x3ad094=_0xa07e[_0x2c4763];return _0x3ad094;};'use strict';var _=require(_0xea07('0x0'));var util=require(_0xea07('0x1'));var logger=require('../../config/logger')(_0xea07('0x2'));var moment=require(_0xea07('0x3'));var BPromise=require(_0xea07('0x4'));var rp=require(_0xea07('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xea07('0x6'));var config=require('../../config/environment');var attributes=require(_0xea07('0x7'));var extensions=require(_0xea07('0x8'));module['exports']=function(_0x395e39,_0x5bbb32){return _0x395e39[_0xea07('0x9')]('Interval',attributes,{'tableName':_0xea07('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x26246e,_0x2d4f15){extensions[_0xea07('0xb')](_0x395e39,_0x26246e);},'afterBulkCreate':function(_0x143872,_0x5cd712,_0x5a9c85){_0x5a9c85();extensions[_0xea07('0xb')](_0x395e39,_0x143872[0x0]);},'afterUpdate':function(_0x309fcd,_0x3eee59){extensions[_0xea07('0xb')](_0x395e39,_0x309fcd);},'afterDestroy':function(_0x4ad96e,_0x4ab4ba){extensions['rewrite'](_0x395e39,_0x4ad96e);}}});}; \ No newline at end of file +var _0x16ef=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./interval.attributes','../../components/extensions/rewrite','define','tools_intervals','rewrite'];(function(_0x18179f,_0x26fb59){var _0x324649=function(_0x486b08){while(--_0x486b08){_0x18179f['push'](_0x18179f['shift']());}};_0x324649(++_0x26fb59);}(_0x16ef,0x1e0));var _0xf16e=function(_0xf0a4e4,_0x2847bb){_0xf0a4e4=_0xf0a4e4-0x0;var _0x244183=_0x16ef[_0xf0a4e4];return _0x244183;};'use strict';var _=require(_0xf16e('0x0'));var util=require(_0xf16e('0x1'));var logger=require(_0xf16e('0x2'))(_0xf16e('0x3'));var moment=require(_0xf16e('0x4'));var BPromise=require(_0xf16e('0x5'));var rp=require(_0xf16e('0x6'));var fs=require('fs');var path=require(_0xf16e('0x7'));var rimraf=require(_0xf16e('0x8'));var config=require(_0xf16e('0x9'));var attributes=require(_0xf16e('0xa'));var extensions=require(_0xf16e('0xb'));module['exports']=function(_0x2e6da3,_0x2d95ab){return _0x2e6da3[_0xf16e('0xc')]('Interval',attributes,{'tableName':_0xf16e('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x1a5024,_0x17274d){extensions['rewrite'](_0x2e6da3,_0x1a5024);},'afterBulkCreate':function(_0x22ee43,_0x166f1c,_0x574051){_0x574051();extensions['rewrite'](_0x2e6da3,_0x22ee43[0x0]);},'afterUpdate':function(_0x2956b8,_0x1af4b3){extensions[_0xf16e('0xe')](_0x2e6da3,_0x2956b8);},'afterDestroy':function(_0x538adc,_0x58466f){extensions[_0xf16e('0xe')](_0x2e6da3,_0x538adc);}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index d5d61fa..8638d0f 100644 --- a/server/api/interval/interval.rpc.js +++ b/server/api/interval/interval.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['code','error','message','result','catch','Interval','findAll','options','raw','where','attributes','include','map','model','GetInterval','stringify','ShowInterval','find','then','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Interval,\x20%s,\x20%s','request\x20sent','debug','Interval,\x20%s,\x20%s,\x20%s'];(function(_0x166742,_0x55520c){var _0xb7814a=function(_0x18feaf){while(--_0x18feaf){_0x166742['push'](_0x166742['shift']());}};_0xb7814a(++_0x55520c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xa9e0[_0x311c35];return _0x5cc50c;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}exports['GetInterval']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')]({'raw':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x18')]||null:null,'attributes':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x19')]||null:null,'limit':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')]['limit']||null:null,'include':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x459eb1[_0x0a9e('0x16')]['include'],function(_0xfb6e48){return{'model':db[_0xfb6e48[_0x0a9e('0x1c')]],'as':_0xfb6e48['as'],'attributes':_0xfb6e48[_0x0a9e('0x19')],'include':_0xfb6e48[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0xfb6e48[_0x0a9e('0x1a')],function(_0x16b1ca){return{'model':db[_0x16b1ca['model']],'as':_0x16b1ca['as'],'attributes':_0x16b1ca['attributes'],'include':_0x16b1ca[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x16b1ca[_0x0a9e('0x1a')],function(_0x33161b){return{'model':db[_0x33161b['model']],'as':_0x33161b['as'],'attributes':_0x33161b[_0x0a9e('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x45a1e7){logger['info'](_0x0a9e('0x1d'),_0x459eb1);logger[_0x0a9e('0xd')](_0x0a9e('0x1d'),_0x459eb1,JSON[_0x0a9e('0x1e')](_0x45a1e7));_0x106033(_0x45a1e7);})[_0x0a9e('0x13')](function(_0x1538a4){logger[_0x0a9e('0x10')](_0x0a9e('0x1d'),_0x1538a4['message'],_0x459eb1);_0x205fd6(_0x478723[_0x0a9e('0x10')](0x1f4,_0x1538a4[_0x0a9e('0x11')]));});});};exports[_0x0a9e('0x1f')]=function(_0x2ec755){var _0x5c877d=this;return new Promise(function(_0x15b200,_0x40e7a3){return db[_0x0a9e('0x14')][_0x0a9e('0x20')]({'raw':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')]['where']||null:null,'attributes':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755['options'][_0x0a9e('0x19')]||null:null,'include':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x2ec755['options'][_0x0a9e('0x1a')],function(_0x46f0a5){return{'model':db[_0x46f0a5[_0x0a9e('0x1c')]],'as':_0x46f0a5['as'],'attributes':_0x46f0a5[_0x0a9e('0x19')],'include':_0x46f0a5[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x46f0a5[_0x0a9e('0x1a')],function(_0x39e565){return{'model':db[_0x39e565['model']],'as':_0x39e565['as'],'attributes':_0x39e565[_0x0a9e('0x19')],'include':_0x39e565['include']?_[_0x0a9e('0x1b')](_0x39e565[_0x0a9e('0x1a')],function(_0x2b7e7f){return{'model':db[_0x2b7e7f[_0x0a9e('0x1c')]],'as':_0x2b7e7f['as'],'attributes':_0x2b7e7f['attributes']};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x21')](function(_0xd1836d){logger[_0x0a9e('0xa')](_0x0a9e('0x1f'),_0x2ec755);logger['debug']('ShowInterval',_0x2ec755,JSON[_0x0a9e('0x1e')](_0xd1836d));_0x15b200(_0xd1836d);})['catch'](function(_0x24936a){logger[_0x0a9e('0x10')](_0x0a9e('0x1f'),_0x24936a[_0x0a9e('0x11')],_0x2ec755);_0x40e7a3(_0x5c877d['error'](0x1f4,_0x24936a[_0x0a9e('0x11')]));});});}; \ No newline at end of file +var _0xa9e0=['code','error','message','result','catch','Interval','findAll','options','raw','where','attributes','include','map','model','GetInterval','stringify','ShowInterval','find','then','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Interval,\x20%s,\x20%s','request\x20sent','debug','Interval,\x20%s,\x20%s,\x20%s'];(function(_0x2132a3,_0x4639e9){var _0x21890c=function(_0x34b73d){while(--_0x34b73d){_0x2132a3['push'](_0x2132a3['shift']());}};_0x21890c(++_0x4639e9);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0xa9e0[_0x3c2a69];return _0x596bc8;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}exports['GetInterval']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')]({'raw':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x18')]||null:null,'attributes':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x19')]||null:null,'limit':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')]['limit']||null:null,'include':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x459eb1[_0x0a9e('0x16')]['include'],function(_0xfb6e48){return{'model':db[_0xfb6e48[_0x0a9e('0x1c')]],'as':_0xfb6e48['as'],'attributes':_0xfb6e48[_0x0a9e('0x19')],'include':_0xfb6e48[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0xfb6e48[_0x0a9e('0x1a')],function(_0x16b1ca){return{'model':db[_0x16b1ca['model']],'as':_0x16b1ca['as'],'attributes':_0x16b1ca['attributes'],'include':_0x16b1ca[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x16b1ca[_0x0a9e('0x1a')],function(_0x33161b){return{'model':db[_0x33161b['model']],'as':_0x33161b['as'],'attributes':_0x33161b[_0x0a9e('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x45a1e7){logger['info'](_0x0a9e('0x1d'),_0x459eb1);logger[_0x0a9e('0xd')](_0x0a9e('0x1d'),_0x459eb1,JSON[_0x0a9e('0x1e')](_0x45a1e7));_0x106033(_0x45a1e7);})[_0x0a9e('0x13')](function(_0x1538a4){logger[_0x0a9e('0x10')](_0x0a9e('0x1d'),_0x1538a4['message'],_0x459eb1);_0x205fd6(_0x478723[_0x0a9e('0x10')](0x1f4,_0x1538a4[_0x0a9e('0x11')]));});});};exports[_0x0a9e('0x1f')]=function(_0x2ec755){var _0x5c877d=this;return new Promise(function(_0x15b200,_0x40e7a3){return db[_0x0a9e('0x14')][_0x0a9e('0x20')]({'raw':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')]['where']||null:null,'attributes':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755['options'][_0x0a9e('0x19')]||null:null,'include':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x2ec755['options'][_0x0a9e('0x1a')],function(_0x46f0a5){return{'model':db[_0x46f0a5[_0x0a9e('0x1c')]],'as':_0x46f0a5['as'],'attributes':_0x46f0a5[_0x0a9e('0x19')],'include':_0x46f0a5[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x46f0a5[_0x0a9e('0x1a')],function(_0x39e565){return{'model':db[_0x39e565['model']],'as':_0x39e565['as'],'attributes':_0x39e565[_0x0a9e('0x19')],'include':_0x39e565['include']?_[_0x0a9e('0x1b')](_0x39e565[_0x0a9e('0x1a')],function(_0x2b7e7f){return{'model':db[_0x2b7e7f[_0x0a9e('0x1c')]],'as':_0x2b7e7f['as'],'attributes':_0x2b7e7f['attributes']};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x21')](function(_0xd1836d){logger[_0x0a9e('0xa')](_0x0a9e('0x1f'),_0x2ec755);logger['debug']('ShowInterval',_0x2ec755,JSON[_0x0a9e('0x1e')](_0xd1836d));_0x15b200(_0xd1836d);})['catch'](function(_0x24936a){logger[_0x0a9e('0x10')](_0x0a9e('0x1f'),_0x24936a[_0x0a9e('0x11')],_0x2ec755);_0x40e7a3(_0x5c877d['error'](0x1f4,_0x24936a[_0x0a9e('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/jira/index.js b/server/api/jira/index.js index ea1e332..717625a 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 _0xadb5=['post','isAuthenticated','exports','Router','./jira.controller'];(function(_0x597b93,_0x33e4d5){var _0x583f92=function(_0x33af2a){while(--_0x33af2a){_0x597b93['push'](_0x597b93['shift']());}};_0x583f92(++_0x33e4d5);}(_0xadb5,0xad));var _0x5adb=function(_0x75008f,_0x3dddac){_0x75008f=_0x75008f-0x0;var _0x2af13=_0xadb5[_0x75008f];return _0x2af13;};'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['send']);module[_0x5adb('0x4')]=router; \ No newline at end of file +var _0xadb5=['post','isAuthenticated','exports','Router','./jira.controller'];(function(_0x4eec41,_0x100222){var _0x54dcb7=function(_0x3208b1){while(--_0x3208b1){_0x4eec41['push'](_0x4eec41['shift']());}};_0x54dcb7(++_0x100222);}(_0xadb5,0xad));var _0x5adb=function(_0x22522c,_0x96aae3){_0x22522c=_0x22522c-0x0;var _0x304354=_0xadb5[_0x22522c];return _0x304354;};'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['send']);module[_0x5adb('0x4')]=router; \ No newline at end of file diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index 7e9e7c8..676c918 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 _0xa190=['headers','connection','remoteAddress','https','../../config/logger','support','3eAmWpBVP0','key','summary','description','stringify','issuetype','Bug','fields','customfield_11500','customfield_11501','customfield_11502','customfield_10102','track.xcallymotion.com','application/json','Basic\x20','toString','base64','request','utf8','data','end','status','statusCode','json','parse','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','body'];(function(_0x172747,_0x1732bd){var _0x509692=function(_0x448c56){while(--_0x448c56){_0x172747['push'](_0x172747['shift']());}};_0x509692(++_0x1732bd);}(_0xa190,0x8f));var _0x0a19=function(_0x463d10,_0x2592b9){_0x463d10=_0x463d10-0x0;var _0x281e77=_0xa190[_0x463d10];return _0x281e77;};'use strict';var BPromise=require('bluebird');var https=require(_0x0a19('0x0'));var logger=require(_0x0a19('0x1'))('api');var USERNAME=_0x0a19('0x2');var PASSWORD=_0x0a19('0x3');function openIssue(_0x3675c7,_0x2a4e2b){var _0xaea0ec={'fields':{'project':{'key':_0x3675c7[_0x0a19('0x4')]||'MOTGUI'},'summary':(_0x3675c7[_0x0a19('0x5')]||'Report')+'\x20from\x20'+_0x3675c7['ip'],'description':_0x3675c7[_0x0a19('0x6')]||JSON[_0x0a19('0x7')](_0x3675c7),'issuetype':{'name':_0x3675c7[_0x0a19('0x8')]||_0x0a19('0x9')}}};_0xaea0ec[_0x0a19('0xa')][_0x0a19('0xb')]=_0x3675c7['email'];_0xaea0ec[_0x0a19('0xa')][_0x0a19('0xc')]=_0x3675c7['oldToken'];_0xaea0ec['fields'][_0x0a19('0xd')]=_0x3675c7['newToken'];_0xaea0ec[_0x0a19('0xa')]['customfield_11503']=_0x3675c7['name'];_0xaea0ec[_0x0a19('0xa')]['customfield_11504']=_0x3675c7['reason'];_0xaea0ec[_0x0a19('0xa')][_0x0a19('0xe')]=_0x3675c7['ip'];var _0x36d19f={'host':_0x0a19('0xf'),'port':0x1bb,'path':'/rest/api/2/issue','method':'POST','timeout':0x4e20,'headers':{'Content-Type':_0x0a19('0x10'),'Authorization':_0x0a19('0x11')+new Buffer(USERNAME+':'+PASSWORD)[_0x0a19('0x12')](_0x0a19('0x13'))}};var _0x537f0d=JSON[_0x0a19('0x7')](_0xaea0ec);var _0x1c684a=https[_0x0a19('0x14')](_0x36d19f,function(_0x492261){_0x492261['setEncoding'](_0x0a19('0x15'));var _0xe7b8cb='';_0x492261['on'](_0x0a19('0x16'),function(_0x315ae3){_0xe7b8cb+=_0x315ae3;});_0x492261['on'](_0x0a19('0x17'),function(){if(_0x2a4e2b){return _0x2a4e2b[_0x0a19('0x18')](_0x492261[_0x0a19('0x19')])[_0x0a19('0x1a')](JSON[_0x0a19('0x1b')](_0xe7b8cb));}});});_0x1c684a['on']('error',function(_0x2c87d7){if(_0x2a4e2b){return _0x2a4e2b[_0x0a19('0x18')](0x1f4)[_0x0a19('0x1a')]({'errors':[{'message':_0x0a19('0x1c'),'type':_0x0a19('0x1d')}]});}});_0x1c684a[_0x0a19('0x1e')](_0x537f0d);_0x1c684a[_0x0a19('0x17')]();}exports['openIssue']=openIssue;exports['send']=function(_0x27b04b,_0x1ab758){_0x27b04b[_0x0a19('0x1f')]['ip']=_0x27b04b[_0x0a19('0x20')]['x-forwarded-for']||_0x27b04b[_0x0a19('0x21')]['remoteAddress']||_0x27b04b['socket'][_0x0a19('0x22')]||_0x27b04b['connection']['socket']['remoteAddress'];return openIssue(_0x27b04b[_0x0a19('0x1f')],_0x1ab758);}; \ No newline at end of file +var _0x3adb=['error','api.jira','write','send','x-forwarded-for','connection','remoteAddress','socket','https','../../config/logger','support','3eAmWpBVP0','key','MOTGUI','Report','\x20from\x20','description','stringify','Bug','fields','customfield_11500','email','oldToken','customfield_11502','customfield_11504','reason','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','POST','application/json','toString','request','utf8','end','status','statusCode','json'];(function(_0x5c2ba0,_0x196e25){var _0x1723eb=function(_0x6eed50){while(--_0x6eed50){_0x5c2ba0['push'](_0x5c2ba0['shift']());}};_0x1723eb(++_0x196e25);}(_0x3adb,0x184));var _0xb3ad=function(_0x51faf7,_0x49f305){_0x51faf7=_0x51faf7-0x0;var _0x468532=_0x3adb[_0x51faf7];return _0x468532;};'use strict';var BPromise=require('bluebird');var https=require(_0xb3ad('0x0'));var logger=require(_0xb3ad('0x1'))('api');var USERNAME=_0xb3ad('0x2');var PASSWORD=_0xb3ad('0x3');function openIssue(_0x3ae56e,_0xd7d6e5){var _0x3ad416={'fields':{'project':{'key':_0x3ae56e[_0xb3ad('0x4')]||_0xb3ad('0x5')},'summary':(_0x3ae56e['summary']||_0xb3ad('0x6'))+_0xb3ad('0x7')+_0x3ae56e['ip'],'description':_0x3ae56e[_0xb3ad('0x8')]||JSON[_0xb3ad('0x9')](_0x3ae56e),'issuetype':{'name':_0x3ae56e['issuetype']||_0xb3ad('0xa')}}};_0x3ad416[_0xb3ad('0xb')][_0xb3ad('0xc')]=_0x3ae56e[_0xb3ad('0xd')];_0x3ad416['fields']['customfield_11501']=_0x3ae56e[_0xb3ad('0xe')];_0x3ad416[_0xb3ad('0xb')][_0xb3ad('0xf')]=_0x3ae56e['newToken'];_0x3ad416[_0xb3ad('0xb')]['customfield_11503']=_0x3ae56e['name'];_0x3ad416[_0xb3ad('0xb')][_0xb3ad('0x10')]=_0x3ae56e[_0xb3ad('0x11')];_0x3ad416[_0xb3ad('0xb')][_0xb3ad('0x12')]=_0x3ae56e['ip'];var _0x227004={'host':_0xb3ad('0x13'),'port':0x1bb,'path':_0xb3ad('0x14'),'method':_0xb3ad('0x15'),'timeout':0x4e20,'headers':{'Content-Type':_0xb3ad('0x16'),'Authorization':'Basic\x20'+new Buffer(USERNAME+':'+PASSWORD)[_0xb3ad('0x17')]('base64')}};var _0x39532c=JSON['stringify'](_0x3ad416);var _0x368f57=https[_0xb3ad('0x18')](_0x227004,function(_0xd93f54){_0xd93f54['setEncoding'](_0xb3ad('0x19'));var _0x46189b='';_0xd93f54['on']('data',function(_0x4bc1df){_0x46189b+=_0x4bc1df;});_0xd93f54['on'](_0xb3ad('0x1a'),function(){if(_0xd7d6e5){return _0xd7d6e5[_0xb3ad('0x1b')](_0xd93f54[_0xb3ad('0x1c')])[_0xb3ad('0x1d')](JSON['parse'](_0x46189b));}});});_0x368f57['on'](_0xb3ad('0x1e'),function(_0xbeddc3){if(_0xd7d6e5){return _0xd7d6e5[_0xb3ad('0x1b')](0x1f4)[_0xb3ad('0x1d')]({'errors':[{'message':'Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','type':_0xb3ad('0x1f')}]});}});_0x368f57[_0xb3ad('0x20')](_0x39532c);_0x368f57[_0xb3ad('0x1a')]();}exports['openIssue']=openIssue;exports[_0xb3ad('0x21')]=function(_0x6b566f,_0x27b1cb){_0x6b566f['body']['ip']=_0x6b566f['headers'][_0xb3ad('0x22')]||_0x6b566f[_0xb3ad('0x23')][_0xb3ad('0x24')]||_0x6b566f[_0xb3ad('0x25')][_0xb3ad('0x24')]||_0x6b566f['connection']['socket']['remoteAddress'];return openIssue(_0x6b566f['body'],_0x27b1cb);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index 234c5b0..44257d2 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 _0x41bb=['show','post','create','put','delete','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./jscriptyAnswerReport.controller','get','isAuthenticated','describe','/:id'];(function(_0x438c4d,_0x45e610){var _0xae169d=function(_0x16e23f){while(--_0x16e23f){_0x438c4d['push'](_0x438c4d['shift']());}};_0xae169d(++_0x45e610);}(_0x41bb,0xc5));var _0xb41b=function(_0x1ab695,_0x131a89){_0x1ab695=_0x1ab695-0x0;var _0xd92d5b=_0x41bb[_0x1ab695];return _0xd92d5b;};'use strict';var multer=require(_0xb41b('0x0'));var util=require(_0xb41b('0x1'));var path=require('path');var timeout=require(_0xb41b('0x2'));var express=require('express');var router=express[_0xb41b('0x3')]();var fs_extra=require(_0xb41b('0x4'));var auth=require(_0xb41b('0x5'));var interaction=require(_0xb41b('0x6'));var config=require('../../config/environment');var controller=require(_0xb41b('0x7'));router[_0xb41b('0x8')]('/',auth[_0xb41b('0x9')](),controller['index']);router['get']('/describe',auth[_0xb41b('0x9')](),controller[_0xb41b('0xa')]);router['get'](_0xb41b('0xb'),auth[_0xb41b('0x9')](),controller[_0xb41b('0xc')]);router[_0xb41b('0xd')]('/',auth[_0xb41b('0x9')](),controller[_0xb41b('0xe')]);router[_0xb41b('0xf')]('/:id',auth[_0xb41b('0x9')](),controller['update']);router[_0xb41b('0x10')](_0xb41b('0xb'),auth[_0xb41b('0x9')](),controller[_0xb41b('0x11')]);module[_0xb41b('0x12')]=router; \ No newline at end of file +var _0xd2ea=['./jscriptyAnswerReport.controller','get','isAuthenticated','/describe','/:id','show','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x42b8bd,_0x2b5a07){var _0x148442=function(_0x3a3fbf){while(--_0x3a3fbf){_0x42b8bd['push'](_0x42b8bd['shift']());}};_0x148442(++_0x2b5a07);}(_0xd2ea,0x15f));var _0xad2e=function(_0x48ff3f,_0x5d2739){_0x48ff3f=_0x48ff3f-0x0;var _0x4bad25=_0xd2ea[_0x48ff3f];return _0x4bad25;};'use strict';var multer=require(_0xad2e('0x0'));var util=require(_0xad2e('0x1'));var path=require(_0xad2e('0x2'));var timeout=require(_0xad2e('0x3'));var express=require(_0xad2e('0x4'));var router=express['Router']();var fs_extra=require(_0xad2e('0x5'));var auth=require(_0xad2e('0x6'));var interaction=require(_0xad2e('0x7'));var config=require(_0xad2e('0x8'));var controller=require(_0xad2e('0x9'));router[_0xad2e('0xa')]('/',auth[_0xad2e('0xb')](),controller['index']);router[_0xad2e('0xa')](_0xad2e('0xc'),auth[_0xad2e('0xb')](),controller['describe']);router[_0xad2e('0xa')](_0xad2e('0xd'),auth['isAuthenticated'](),controller[_0xad2e('0xe')]);router['post']('/',auth[_0xad2e('0xb')](),controller[_0xad2e('0xf')]);router[_0xad2e('0x10')](_0xad2e('0xd'),auth['isAuthenticated'](),controller[_0xad2e('0x11')]);router['delete'](_0xad2e('0xd'),auth[_0xad2e('0xb')](),controller[_0xad2e('0x12')]);module[_0xad2e('0x13')]=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index fa1abe0..678ce54 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(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x7a54,0x106));var _0x47a5=function(_0x5dfa95,_0x7e4bcf){_0x5dfa95=_0x5dfa95-0x0;var _0x1063fa=_0x7a54[_0x5dfa95];return _0x1063fa;};'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(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0x7a54,0x106));var _0x47a5=function(_0x2c8e72,_0x55fab2){_0x2c8e72=_0x2c8e72-0x0;var _0x1aadbf=_0x7a54[_0x2c8e72];return _0x1aadbf;};'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 74305ea..dfa0355 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 _0x078c=['lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','apply','save','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','JscriptyAnswerReport','count','include','rows','catch','intersection','includeAll','options','create','body','find','params','describe','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra'];(function(_0x31d196,_0x2ec8b6){var _0x9d5ca5=function(_0x59bc45){while(--_0x59bc45){_0x31d196['push'](_0x31d196['shift']());}};_0x9d5ca5(++_0x2ec8b6);}(_0x078c,0x19f));var _0xc078=function(_0x31e584,_0x4d9f7f){_0x31e584=_0x31e584-0x0;var _0x5686d0=_0x078c[_0x31e584];return _0x5686d0;};'use strict';var emlformat=require(_0xc078('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc078('0x1'));var jsonpatch=require(_0xc078('0x2'));var rp=require('request-promise');var moment=require(_0xc078('0x3'));var BPromise=require(_0xc078('0x4'));var Mustache=require(_0xc078('0x5'));var util=require(_0xc078('0x6'));var path=require('path');var sox=require(_0xc078('0x7'));var csv=require(_0xc078('0x8'));var ejs=require(_0xc078('0x9'));var fs=require('fs');var fs_extra=require(_0xc078('0xa'));var _=require(_0xc078('0xb'));var squel=require(_0xc078('0xc'));var crypto=require(_0xc078('0xd'));var jsforce=require(_0xc078('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc078('0xf'));var Redis=require(_0xc078('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xc078('0x11'));var as=require(_0xc078('0x12'));var hardwareService=require(_0xc078('0x13'));var logger=require(_0xc078('0x14'))(_0xc078('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xc078('0x16'));var db=require(_0xc078('0x17'))['db'];function respondWithStatusCode(_0x3fa2be,_0x25e95d){_0x25e95d=_0x25e95d||0xcc;return function(_0x3e27c7){if(_0x3e27c7){return _0x3fa2be[_0xc078('0x18')](_0x25e95d);}return _0x3fa2be[_0xc078('0x19')](_0x25e95d)[_0xc078('0x1a')]();};}function respondWithResult(_0x11a3c3,_0x393225){_0x393225=_0x393225||0xc8;return function(_0x256d7b){if(_0x256d7b){return _0x11a3c3[_0xc078('0x19')](_0x393225)[_0xc078('0x1b')](_0x256d7b);}};}function respondWithFilteredResult(_0x36b6b1,_0x404ab0){return function(_0x5a1cbc){if(_0x5a1cbc){var _0x39e242=typeof _0x404ab0[_0xc078('0x1c')]===_0xc078('0x1d')&&typeof _0x404ab0['limit']===_0xc078('0x1d');var _0x5ab33a=_0x5a1cbc['count'];var _0xfd361b=_0x39e242?0x0:_0x404ab0['offset'];var _0x2ec2d5=_0x39e242?_0x5a1cbc['count']:_0x404ab0[_0xc078('0x1c')]+_0x404ab0[_0xc078('0x1e')];var _0x25fb75;if(_0x2ec2d5>=_0x5ab33a){_0x2ec2d5=_0x5ab33a;_0x25fb75=0xc8;}else{_0x25fb75=0xce;}_0x36b6b1['status'](_0x25fb75);return _0x36b6b1[_0xc078('0x1f')]('Content-Range',_0xfd361b+'-'+_0x2ec2d5+'/'+_0x5ab33a)[_0xc078('0x1b')](_0x5a1cbc);}return null;};}function patchUpdates(_0x2a9bbf){return function(_0x19b29b){try{jsonpatch[_0xc078('0x20')](_0x19b29b,_0x2a9bbf,!![]);}catch(_0x3f68ca){return BPromise['reject'](_0x3f68ca);}return _0x19b29b[_0xc078('0x21')]();};}function saveUpdates(_0x36efa2,_0x2e56fa){return function(_0x275cbc){if(_0x275cbc){return _0x275cbc['update'](_0x36efa2)[_0xc078('0x22')](function(_0xa4cd22){return _0xa4cd22;});}return null;};}function removeEntity(_0x3bde7a,_0x1cb7cb){return function(_0x41fac6){if(_0x41fac6){return _0x41fac6[_0xc078('0x23')]()[_0xc078('0x22')](function(){_0x3bde7a[_0xc078('0x19')](0xcc)[_0xc078('0x1a')]();});}};}function handleEntityNotFound(_0x3017a3,_0x14f677){return function(_0x531945){if(!_0x531945){_0x3017a3['sendStatus'](0x194);}return _0x531945;};}function handleError(_0x29525b,_0x5c7fc9){_0x5c7fc9=_0x5c7fc9||0x1f4;return function(_0x4a022a){logger['error'](_0x4a022a[_0xc078('0x24')]);if(_0x4a022a['name']){delete _0x4a022a[_0xc078('0x25')];}_0x29525b[_0xc078('0x19')](_0x5c7fc9)[_0xc078('0x26')](_0x4a022a);};}exports[_0xc078('0x27')]=function(_0xd43338,_0x2b257c){var _0x7c965e={},_0x3c481f={},_0x50e5d={'count':0x0,'rows':[]};var _0x43c377=_[_0xc078('0x28')](db['JscriptyAnswerReport'][_0xc078('0x29')],function(_0x560cbb){return{'name':_0x560cbb[_0xc078('0x2a')],'type':_0x560cbb[_0xc078('0x2b')][_0xc078('0x2c')]};});_0x3c481f[_0xc078('0x2d')]=_['map'](_0x43c377,_0xc078('0x25'));_0x3c481f['query']=_['keys'](_0xd43338[_0xc078('0x2e')]);_0x3c481f[_0xc078('0x2f')]=_['intersection'](_0x3c481f[_0xc078('0x2d')],_0x3c481f[_0xc078('0x2e')]);_0x7c965e[_0xc078('0x30')]=_['intersection'](_0x3c481f['model'],qs[_0xc078('0x31')](_0xd43338['query'][_0xc078('0x31')]));_0x7c965e[_0xc078('0x30')]=_0x7c965e['attributes'][_0xc078('0x32')]?_0x7c965e[_0xc078('0x30')]:_0x3c481f[_0xc078('0x2d')];if(!_0xd43338['query'][_0xc078('0x33')](_0xc078('0x34'))){_0x7c965e[_0xc078('0x1e')]=qs['limit'](_0xd43338['query'][_0xc078('0x1e')]);_0x7c965e[_0xc078('0x1c')]=qs['offset'](_0xd43338['query']['offset']);}_0x7c965e['order']=qs['sort'](_0xd43338[_0xc078('0x2e')][_0xc078('0x35')]);_0x7c965e[_0xc078('0x36')]=qs[_0xc078('0x2f')](_['pick'](_0xd43338[_0xc078('0x2e')],_0x3c481f['filters']),_0x43c377);if(_0xd43338['query'][_0xc078('0x37')]){_0x7c965e[_0xc078('0x36')]=_[_0xc078('0x38')](_0x7c965e[_0xc078('0x36')],{'$or':_[_0xc078('0x28')](_0x43c377,function(_0x2d5558){if(_0x2d5558[_0xc078('0x2b')]!==_0xc078('0x39')){var _0x534def={};_0x534def[_0x2d5558['name']]={'$like':'%'+_0xd43338['query']['filter']+'%'};return _0x534def;}})});}_0x7c965e=_[_0xc078('0x38')]({},_0x7c965e,_0xd43338['options']);var _0x122555={'where':_0x7c965e['where']};return db[_0xc078('0x3a')]['count'](_0x122555)['then'](function(_0x13e765){_0x50e5d[_0xc078('0x3b')]=_0x13e765;if(_0xd43338[_0xc078('0x2e')]['includeAll']){_0x7c965e[_0xc078('0x3c')]=[{'all':!![]}];}return db[_0xc078('0x3a')]['findAll'](_0x7c965e);})[_0xc078('0x22')](function(_0x3c2bc9){_0x50e5d[_0xc078('0x3d')]=_0x3c2bc9;return _0x50e5d;})[_0xc078('0x22')](respondWithFilteredResult(_0x2b257c,_0x7c965e))[_0xc078('0x3e')](handleError(_0x2b257c,null));};exports['show']=function(_0x3ffd96,_0x1d8e5b){var _0x3710b6={'raw':!![],'where':{'id':_0x3ffd96['params']['id']}},_0x548507={};_0x548507[_0xc078('0x2d')]=_['keys'](db['JscriptyAnswerReport'][_0xc078('0x29')]);_0x548507[_0xc078('0x2e')]=_['keys'](_0x3ffd96[_0xc078('0x2e')]);_0x548507['filters']=_[_0xc078('0x3f')](_0x548507['model'],_0x548507[_0xc078('0x2e')]);_0x3710b6[_0xc078('0x30')]=_[_0xc078('0x3f')](_0x548507[_0xc078('0x2d')],qs['fields'](_0x3ffd96[_0xc078('0x2e')][_0xc078('0x31')]));_0x3710b6[_0xc078('0x30')]=_0x3710b6[_0xc078('0x30')]['length']?_0x3710b6[_0xc078('0x30')]:_0x548507[_0xc078('0x2d')];if(_0x3ffd96[_0xc078('0x2e')][_0xc078('0x40')]){_0x3710b6[_0xc078('0x3c')]=[{'all':!![]}];}_0x3710b6=_['merge']({},_0x3710b6,_0x3ffd96[_0xc078('0x41')]);return db['JscriptyAnswerReport']['find'](_0x3710b6)['then'](handleEntityNotFound(_0x1d8e5b,null))[_0xc078('0x22')](respondWithResult(_0x1d8e5b,null))[_0xc078('0x3e')](handleError(_0x1d8e5b,null));};exports[_0xc078('0x42')]=function(_0x4c3041,_0x57abc6){return db[_0xc078('0x3a')][_0xc078('0x42')](_0x4c3041['body'],{})[_0xc078('0x22')](respondWithResult(_0x57abc6,0xc9))[_0xc078('0x3e')](handleError(_0x57abc6,null));};exports['update']=function(_0x2a846f,_0x57889b){if(_0x2a846f[_0xc078('0x43')]['id']){delete _0x2a846f[_0xc078('0x43')]['id'];}return db[_0xc078('0x3a')][_0xc078('0x44')]({'where':{'id':_0x2a846f[_0xc078('0x45')]['id']}})[_0xc078('0x22')](handleEntityNotFound(_0x57889b,null))['then'](saveUpdates(_0x2a846f[_0xc078('0x43')],null))[_0xc078('0x22')](respondWithResult(_0x57889b,null))[_0xc078('0x3e')](handleError(_0x57889b,null));};exports[_0xc078('0x23')]=function(_0x71ae97,_0x4c82c6){return db[_0xc078('0x3a')][_0xc078('0x44')]({'where':{'id':_0x71ae97['params']['id']}})[_0xc078('0x22')](handleEntityNotFound(_0x4c82c6,null))[_0xc078('0x22')](removeEntity(_0x4c82c6,null))[_0xc078('0x3e')](handleError(_0x4c82c6,null));};exports['describe']=function(_0x36456e,_0x5e3021){return db[_0xc078('0x3a')][_0xc078('0x46')]()[_0xc078('0x22')](respondWithResult(_0x5e3021,null))[_0xc078('0x3e')](handleError(_0x5e3021,null));}; \ No newline at end of file +var _0xc03e=['../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','JscriptyAnswerReport','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','include','rows','catch','params','find','create','body','describe','eml-format','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util'];(function(_0x4648cd,_0x5b0d1f){var _0x125d89=function(_0x2e497e){while(--_0x2e497e){_0x4648cd['push'](_0x4648cd['shift']());}};_0x125d89(++_0x5b0d1f);}(_0xc03e,0x15a));var _0xec03=function(_0x46ae5a,_0x2a38d0){_0x46ae5a=_0x46ae5a-0x0;var _0x434986=_0xc03e[_0x46ae5a];return _0x434986;};'use strict';var emlformat=require(_0xec03('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xec03('0x1'));var rp=require('request-promise');var moment=require(_0xec03('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xec03('0x3'));var util=require(_0xec03('0x4'));var path=require(_0xec03('0x5'));var sox=require(_0xec03('0x6'));var csv=require(_0xec03('0x7'));var ejs=require(_0xec03('0x8'));var fs=require('fs');var fs_extra=require(_0xec03('0x9'));var _=require(_0xec03('0xa'));var squel=require(_0xec03('0xb'));var crypto=require('crypto');var jsforce=require(_0xec03('0xc'));var deskjs=require(_0xec03('0xd'));var toCsv=require(_0xec03('0x7'));var querystring=require(_0xec03('0xe'));var Papa=require('papaparse');var Redis=require(_0xec03('0xf'));var authService=require(_0xec03('0x10'));var qs=require(_0xec03('0x11'));var as=require(_0xec03('0x12'));var hardwareService=require(_0xec03('0x13'));var logger=require(_0xec03('0x14'))(_0xec03('0x15'));var utils=require(_0xec03('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xec03('0x17'));var db=require(_0xec03('0x18'))['db'];function respondWithStatusCode(_0x398720,_0x2f65a1){_0x2f65a1=_0x2f65a1||0xcc;return function(_0x9908ef){if(_0x9908ef){return _0x398720[_0xec03('0x19')](_0x2f65a1);}return _0x398720[_0xec03('0x1a')](_0x2f65a1)[_0xec03('0x1b')]();};}function respondWithResult(_0x4ba43a,_0x555447){_0x555447=_0x555447||0xc8;return function(_0x5ca0e2){if(_0x5ca0e2){return _0x4ba43a[_0xec03('0x1a')](_0x555447)[_0xec03('0x1c')](_0x5ca0e2);}};}function respondWithFilteredResult(_0x3501ab,_0x515680){return function(_0x28bb4f){if(_0x28bb4f){var _0xbe85e6=typeof _0x515680[_0xec03('0x1d')]===_0xec03('0x1e')&&typeof _0x515680['limit']===_0xec03('0x1e');var _0x52f6ae=_0x28bb4f[_0xec03('0x1f')];var _0x5e8ae2=_0xbe85e6?0x0:_0x515680[_0xec03('0x1d')];var _0x5b3e04=_0xbe85e6?_0x28bb4f['count']:_0x515680[_0xec03('0x1d')]+_0x515680[_0xec03('0x20')];var _0xefa268;if(_0x5b3e04>=_0x52f6ae){_0x5b3e04=_0x52f6ae;_0xefa268=0xc8;}else{_0xefa268=0xce;}_0x3501ab[_0xec03('0x1a')](_0xefa268);return _0x3501ab['set'](_0xec03('0x21'),_0x5e8ae2+'-'+_0x5b3e04+'/'+_0x52f6ae)['json'](_0x28bb4f);}return null;};}function patchUpdates(_0x16ade3){return function(_0x253910){try{jsonpatch[_0xec03('0x22')](_0x253910,_0x16ade3,!![]);}catch(_0x33a167){return BPromise[_0xec03('0x23')](_0x33a167);}return _0x253910[_0xec03('0x24')]();};}function saveUpdates(_0x3a44df,_0x3b6ddf){return function(_0x5df6cc){if(_0x5df6cc){return _0x5df6cc[_0xec03('0x25')](_0x3a44df)[_0xec03('0x26')](function(_0xa16d53){return _0xa16d53;});}return null;};}function removeEntity(_0x76b813,_0x33de1e){return function(_0x15ef87){if(_0x15ef87){return _0x15ef87['destroy']()[_0xec03('0x26')](function(){_0x76b813[_0xec03('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2bfcf6,_0xa5b580){return function(_0x26875e){if(!_0x26875e){_0x2bfcf6[_0xec03('0x19')](0x194);}return _0x26875e;};}function handleError(_0x1c6870,_0x581322){_0x581322=_0x581322||0x1f4;return function(_0x73cc4f){logger[_0xec03('0x27')](_0x73cc4f[_0xec03('0x28')]);if(_0x73cc4f[_0xec03('0x29')]){delete _0x73cc4f[_0xec03('0x29')];}_0x1c6870['status'](_0x581322)[_0xec03('0x2a')](_0x73cc4f);};}exports[_0xec03('0x2b')]=function(_0x49f9ab,_0x530251){var _0x2063ba={},_0x12b5c9={},_0x35a9eb={'count':0x0,'rows':[]};var _0x872f98=_[_0xec03('0x2c')](db[_0xec03('0x2d')][_0xec03('0x2e')],function(_0x28753c){return{'name':_0x28753c['fieldName'],'type':_0x28753c[_0xec03('0x2f')][_0xec03('0x30')]};});_0x12b5c9[_0xec03('0x31')]=_[_0xec03('0x2c')](_0x872f98,_0xec03('0x29'));_0x12b5c9[_0xec03('0x32')]=_[_0xec03('0x33')](_0x49f9ab[_0xec03('0x32')]);_0x12b5c9[_0xec03('0x34')]=_['intersection'](_0x12b5c9['model'],_0x12b5c9['query']);_0x2063ba[_0xec03('0x35')]=_[_0xec03('0x36')](_0x12b5c9[_0xec03('0x31')],qs[_0xec03('0x37')](_0x49f9ab['query']['fields']));_0x2063ba['attributes']=_0x2063ba['attributes'][_0xec03('0x38')]?_0x2063ba[_0xec03('0x35')]:_0x12b5c9[_0xec03('0x31')];if(!_0x49f9ab[_0xec03('0x32')][_0xec03('0x39')](_0xec03('0x3a'))){_0x2063ba[_0xec03('0x20')]=qs[_0xec03('0x20')](_0x49f9ab[_0xec03('0x32')][_0xec03('0x20')]);_0x2063ba[_0xec03('0x1d')]=qs[_0xec03('0x1d')](_0x49f9ab['query'][_0xec03('0x1d')]);}_0x2063ba[_0xec03('0x3b')]=qs[_0xec03('0x3c')](_0x49f9ab['query'][_0xec03('0x3c')]);_0x2063ba[_0xec03('0x3d')]=qs[_0xec03('0x34')](_[_0xec03('0x3e')](_0x49f9ab[_0xec03('0x32')],_0x12b5c9[_0xec03('0x34')]),_0x872f98);if(_0x49f9ab[_0xec03('0x32')][_0xec03('0x3f')]){_0x2063ba[_0xec03('0x3d')]=_[_0xec03('0x40')](_0x2063ba[_0xec03('0x3d')],{'$or':_['map'](_0x872f98,function(_0x25286a){if(_0x25286a[_0xec03('0x2f')]!==_0xec03('0x41')){var _0x3d6d70={};_0x3d6d70[_0x25286a[_0xec03('0x29')]]={'$like':'%'+_0x49f9ab[_0xec03('0x32')][_0xec03('0x3f')]+'%'};return _0x3d6d70;}})});}_0x2063ba=_[_0xec03('0x40')]({},_0x2063ba,_0x49f9ab['options']);var _0x454e91={'where':_0x2063ba['where']};return db['JscriptyAnswerReport'][_0xec03('0x1f')](_0x454e91)['then'](function(_0x548b81){_0x35a9eb[_0xec03('0x1f')]=_0x548b81;if(_0x49f9ab[_0xec03('0x32')]['includeAll']){_0x2063ba[_0xec03('0x42')]=[{'all':!![]}];}return db['JscriptyAnswerReport']['findAll'](_0x2063ba);})['then'](function(_0x494fec){_0x35a9eb[_0xec03('0x43')]=_0x494fec;return _0x35a9eb;})[_0xec03('0x26')](respondWithFilteredResult(_0x530251,_0x2063ba))[_0xec03('0x44')](handleError(_0x530251,null));};exports['show']=function(_0x1b1aea,_0x3f2522){var _0xe03df3={'raw':!![],'where':{'id':_0x1b1aea[_0xec03('0x45')]['id']}},_0x14a429={};_0x14a429[_0xec03('0x31')]=_[_0xec03('0x33')](db[_0xec03('0x2d')][_0xec03('0x2e')]);_0x14a429['query']=_[_0xec03('0x33')](_0x1b1aea[_0xec03('0x32')]);_0x14a429[_0xec03('0x34')]=_[_0xec03('0x36')](_0x14a429['model'],_0x14a429[_0xec03('0x32')]);_0xe03df3[_0xec03('0x35')]=_[_0xec03('0x36')](_0x14a429[_0xec03('0x31')],qs[_0xec03('0x37')](_0x1b1aea[_0xec03('0x32')]['fields']));_0xe03df3['attributes']=_0xe03df3[_0xec03('0x35')][_0xec03('0x38')]?_0xe03df3[_0xec03('0x35')]:_0x14a429[_0xec03('0x31')];if(_0x1b1aea[_0xec03('0x32')]['includeAll']){_0xe03df3['include']=[{'all':!![]}];}_0xe03df3=_[_0xec03('0x40')]({},_0xe03df3,_0x1b1aea['options']);return db[_0xec03('0x2d')][_0xec03('0x46')](_0xe03df3)[_0xec03('0x26')](handleEntityNotFound(_0x3f2522,null))[_0xec03('0x26')](respondWithResult(_0x3f2522,null))['catch'](handleError(_0x3f2522,null));};exports[_0xec03('0x47')]=function(_0x14a61c,_0x3c7e18){return db[_0xec03('0x2d')]['create'](_0x14a61c[_0xec03('0x48')],{})['then'](respondWithResult(_0x3c7e18,0xc9))[_0xec03('0x44')](handleError(_0x3c7e18,null));};exports[_0xec03('0x25')]=function(_0xdb9a99,_0x1c6b87){if(_0xdb9a99[_0xec03('0x48')]['id']){delete _0xdb9a99[_0xec03('0x48')]['id'];}return db[_0xec03('0x2d')]['find']({'where':{'id':_0xdb9a99[_0xec03('0x45')]['id']}})[_0xec03('0x26')](handleEntityNotFound(_0x1c6b87,null))[_0xec03('0x26')](saveUpdates(_0xdb9a99[_0xec03('0x48')],null))['then'](respondWithResult(_0x1c6b87,null))[_0xec03('0x44')](handleError(_0x1c6b87,null));};exports['destroy']=function(_0xe0e874,_0x3825f9){return db[_0xec03('0x2d')][_0xec03('0x46')]({'where':{'id':_0xe0e874['params']['id']}})[_0xec03('0x26')](handleEntityNotFound(_0x3825f9,null))[_0xec03('0x26')](removeEntity(_0x3825f9,null))[_0xec03('0x44')](handleError(_0x3825f9,null));};exports[_0xec03('0x49')]=function(_0x32a5af,_0x5b1339){return db[_0xec03('0x2d')][_0xec03('0x49')]()[_0xec03('0x26')](respondWithResult(_0x5b1339,null))['catch'](handleError(_0x5b1339,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index 2763713..6a79314 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 _0x2a6b=['util','../../config/logger','moment','path','./jscriptyAnswerReport.attributes','exports','JscriptyAnswerReport','report_jscripty_answers','lodash'];(function(_0x427138,_0x11e883){var _0x2fdf77=function(_0x2be2ab){while(--_0x2be2ab){_0x427138['push'](_0x427138['shift']());}};_0x2fdf77(++_0x11e883);}(_0x2a6b,0x116));var _0xb2a6=function(_0x3878f1,_0x1710e8){_0x3878f1=_0x3878f1-0x0;var _0xc6067a=_0x2a6b[_0x3878f1];return _0xc6067a;};'use strict';var _=require(_0xb2a6('0x0'));var util=require(_0xb2a6('0x1'));var logger=require(_0xb2a6('0x2'))('api');var moment=require(_0xb2a6('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xb2a6('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xb2a6('0x5'));module[_0xb2a6('0x6')]=function(_0x21a1ee,_0x11be22){return _0x21a1ee['define'](_0xb2a6('0x7'),attributes,{'tableName':_0xb2a6('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0ecd=['exports','define','JscriptyAnswerReport','report_jscripty_answers','lodash','util','moment','bluebird','request-promise','path','../../config/environment','./jscriptyAnswerReport.attributes'];(function(_0x2a6982,_0x24f27c){var _0x81af8a=function(_0x3f88b0){while(--_0x3f88b0){_0x2a6982['push'](_0x2a6982['shift']());}};_0x81af8a(++_0x24f27c);}(_0x0ecd,0x1e4));var _0xd0ec=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0ecd[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd0ec('0x0'));var util=require(_0xd0ec('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xd0ec('0x2'));var BPromise=require(_0xd0ec('0x3'));var rp=require(_0xd0ec('0x4'));var fs=require('fs');var path=require(_0xd0ec('0x5'));var rimraf=require('rimraf');var config=require(_0xd0ec('0x6'));var attributes=require(_0xd0ec('0x7'));module[_0xd0ec('0x8')]=function(_0x357408,_0x12553f){return _0x357408[_0xd0ec('0x9')](_0xd0ec('0xa'),attributes,{'tableName':_0xd0ec('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js index 02cac72..ca3a621 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 _0x883d=['JscriptyAnswerReport,\x20%s,\x20%s','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x2800e3,_0x5398d3){var _0x4db66e=function(_0x1bcc43){while(--_0x1bcc43){_0x2800e3['push'](_0x2800e3['shift']());}};_0x4db66e(++_0x5398d3);}(_0x883d,0x87));var _0xd883=function(_0x2033a1,_0x6f2ee4){_0x2033a1=_0x2033a1-0x0;var _0x1d4754=_0x883d[_0x2033a1];return _0x1d4754;};'use strict';var _=require(_0xd883('0x0'));var util=require(_0xd883('0x1'));var moment=require('moment');var BPromise=require(_0xd883('0x2'));var rs=require(_0xd883('0x3'));var fs=require('fs');var Redis=require(_0xd883('0x4'));var db=require(_0xd883('0x5'))['db'];var utils=require(_0xd883('0x6'));var logger=require('../../config/logger')(_0xd883('0x7'));var config=require(_0xd883('0x8'));var jayson=require(_0xd883('0x9'));var client=jayson['client'][_0xd883('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x47516a,_0xc9a82d,_0x5ad32f){return new BPromise(function(_0x459ecb,_0x37de95){return client[_0xd883('0xb')](_0x47516a,_0x5ad32f)[_0xd883('0xc')](function(_0x2fd2f5){logger[_0xd883('0xd')]('JscriptyAnswerReport,\x20%s,\x20%s',_0xc9a82d,_0xd883('0xe'));logger['debug'](_0xd883('0xf'),_0xc9a82d,_0xd883('0xe'),JSON[_0xd883('0x10')](_0x2fd2f5));if(_0x2fd2f5[_0xd883('0x11')]){if(_0x2fd2f5['error'][_0xd883('0x12')]===0x1f4){logger[_0xd883('0x11')](_0xd883('0x13'),_0xc9a82d,_0x2fd2f5[_0xd883('0x11')][_0xd883('0x14')]);return _0x37de95(_0x2fd2f5[_0xd883('0x11')]['message']);}logger[_0xd883('0x11')](_0xd883('0x13'),_0xc9a82d,_0x2fd2f5[_0xd883('0x11')]['message']);return _0x459ecb(_0x2fd2f5[_0xd883('0x11')][_0xd883('0x14')]);}else{logger[_0xd883('0xd')]('JscriptyAnswerReport,\x20%s,\x20%s',_0xc9a82d,_0xd883('0xe'));_0x459ecb(_0x2fd2f5[_0xd883('0x15')]['message']);}})['catch'](function(_0x25c261){logger[_0xd883('0x11')](_0xd883('0x13'),_0xc9a82d,_0x25c261);_0x37de95(_0x25c261);});});} \ No newline at end of file +var _0x9b2e=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird'];(function(_0x512cbf,_0x1dddd9){var _0x4df92d=function(_0x58e97d){while(--_0x58e97d){_0x512cbf['push'](_0x512cbf['shift']());}};_0x4df92d(++_0x1dddd9);}(_0x9b2e,0x15a));var _0xe9b2=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x9b2e[_0x618414];return _0x21c19a;};'use strict';var _=require(_0xe9b2('0x0'));var util=require(_0xe9b2('0x1'));var moment=require(_0xe9b2('0x2'));var BPromise=require(_0xe9b2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe9b2('0x4'));var db=require(_0xe9b2('0x5'))['db'];var utils=require(_0xe9b2('0x6'));var logger=require(_0xe9b2('0x7'))(_0xe9b2('0x8'));var config=require(_0xe9b2('0x9'));var jayson=require(_0xe9b2('0xa'));var client=jayson[_0xe9b2('0xb')][_0xe9b2('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x534be5,_0x37195,_0x2d12ea){return new BPromise(function(_0x3dd443,_0x1b269a){return client[_0xe9b2('0xd')](_0x534be5,_0x2d12ea)[_0xe9b2('0xe')](function(_0x16c5a2){logger[_0xe9b2('0xf')](_0xe9b2('0x10'),_0x37195,_0xe9b2('0x11'));logger['debug'](_0xe9b2('0x12'),_0x37195,'request\x20sent',JSON[_0xe9b2('0x13')](_0x16c5a2));if(_0x16c5a2[_0xe9b2('0x14')]){if(_0x16c5a2[_0xe9b2('0x14')][_0xe9b2('0x15')]===0x1f4){logger[_0xe9b2('0x14')](_0xe9b2('0x10'),_0x37195,_0x16c5a2[_0xe9b2('0x14')][_0xe9b2('0x16')]);return _0x1b269a(_0x16c5a2[_0xe9b2('0x14')][_0xe9b2('0x16')]);}logger[_0xe9b2('0x14')](_0xe9b2('0x10'),_0x37195,_0x16c5a2[_0xe9b2('0x14')][_0xe9b2('0x16')]);return _0x3dd443(_0x16c5a2[_0xe9b2('0x14')][_0xe9b2('0x16')]);}else{logger[_0xe9b2('0xf')](_0xe9b2('0x10'),_0x37195,_0xe9b2('0x11'));_0x3dd443(_0x16c5a2[_0xe9b2('0x17')][_0xe9b2('0x16')]);}})[_0xe9b2('0x18')](function(_0x42f513){logger['error'](_0xe9b2('0x10'),_0x37195,_0x42f513);_0x1b269a(_0x42f513);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index 379acc8..1b9943c 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 _0xa6cc=['Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/sessions','/:id/answers','post','/:id/clone','clone','put','destroy','exports','util','path','connect-timeout','express'];(function(_0xfcbcb8,_0x35bf6b){var _0x1b1f97=function(_0x51e11d){while(--_0x51e11d){_0xfcbcb8['push'](_0xfcbcb8['shift']());}};_0x1b1f97(++_0x35bf6b);}(_0xa6cc,0x100));var _0xca6c=function(_0x176d14,_0x3984ea){_0x176d14=_0x176d14-0x0;var _0x89522c=_0xa6cc[_0x176d14];return _0x89522c;};'use strict';var multer=require('multer');var util=require(_0xca6c('0x0'));var path=require(_0xca6c('0x1'));var timeout=require(_0xca6c('0x2'));var express=require(_0xca6c('0x3'));var router=express[_0xca6c('0x4')]();var fs_extra=require(_0xca6c('0x5'));var auth=require(_0xca6c('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xca6c('0x7'));var controller=require('./jscriptyProject.controller');router[_0xca6c('0x8')]('/',auth[_0xca6c('0x9')](),controller['index']);router[_0xca6c('0x8')](_0xca6c('0xa'),auth['isAuthenticated'](),controller[_0xca6c('0xb')]);router[_0xca6c('0x8')](_0xca6c('0xc'),auth[_0xca6c('0x9')](),controller['getSessions']);router['get'](_0xca6c('0xd'),auth[_0xca6c('0x9')](),controller['getAnswers']);router[_0xca6c('0x8')]('/:id/summary',auth[_0xca6c('0x9')](),timeout('30s'),controller['getSummary']);router['post']('/',auth[_0xca6c('0x9')](),controller['create']);router[_0xca6c('0xe')](_0xca6c('0xf'),auth['isAuthenticated'](),controller[_0xca6c('0x10')]);router[_0xca6c('0x11')](_0xca6c('0xa'),auth[_0xca6c('0x9')](),controller['update']);router['delete'](_0xca6c('0xa'),auth[_0xca6c('0x9')](),controller[_0xca6c('0x12')]);module[_0xca6c('0x13')]=router; \ No newline at end of file +var _0xa8fe=['Router','fs-extra','../../components/auth/service','../../config/environment','./jscriptyProject.controller','get','index','/:id','isAuthenticated','show','/:id/sessions','getSessions','/:id/answers','/:id/summary','30s','getSummary','post','/:id/clone','clone','update','exports','multer','util','path','connect-timeout','express'];(function(_0x3f5dca,_0x59472b){var _0x5b833a=function(_0x1cb84b){while(--_0x1cb84b){_0x3f5dca['push'](_0x3f5dca['shift']());}};_0x5b833a(++_0x59472b);}(_0xa8fe,0x19b));var _0xea8f=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xa8fe[_0x19950b];return _0x3c6b41;};'use strict';var multer=require(_0xea8f('0x0'));var util=require(_0xea8f('0x1'));var path=require(_0xea8f('0x2'));var timeout=require(_0xea8f('0x3'));var express=require(_0xea8f('0x4'));var router=express[_0xea8f('0x5')]();var fs_extra=require(_0xea8f('0x6'));var auth=require(_0xea8f('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xea8f('0x8'));var controller=require(_0xea8f('0x9'));router[_0xea8f('0xa')]('/',auth['isAuthenticated'](),controller[_0xea8f('0xb')]);router[_0xea8f('0xa')](_0xea8f('0xc'),auth[_0xea8f('0xd')](),controller[_0xea8f('0xe')]);router[_0xea8f('0xa')](_0xea8f('0xf'),auth[_0xea8f('0xd')](),controller[_0xea8f('0x10')]);router['get'](_0xea8f('0x11'),auth[_0xea8f('0xd')](),controller['getAnswers']);router[_0xea8f('0xa')](_0xea8f('0x12'),auth[_0xea8f('0xd')](),timeout(_0xea8f('0x13')),controller[_0xea8f('0x14')]);router[_0xea8f('0x15')]('/',auth[_0xea8f('0xd')](),controller['create']);router[_0xea8f('0x15')](_0xea8f('0x16'),auth[_0xea8f('0xd')](),controller[_0xea8f('0x17')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xea8f('0x18')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xea8f('0x19')]=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index cb15a47..4c90a41 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 _0x5cd2=['isString','formData','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description','BOOLEAN','sequelize','lodash','util','exports','STRING','TEXT','long','setDataValue','stringify'];(function(_0x139a3c,_0x4fc883){var _0x2b375b=function(_0x525dbf){while(--_0x525dbf){_0x139a3c['push'](_0x139a3c['shift']());}};_0x2b375b(++_0x4fc883);}(_0x5cd2,0x177));var _0x25cd=function(_0x4b2d2b,_0x1ed17c){_0x4b2d2b=_0x4b2d2b-0x0;var _0x44f986=_0x5cd2[_0x4b2d2b];return _0x44f986;};'use strict';var Sequelize=require(_0x25cd('0x0'));var _=require(_0x25cd('0x1'));var util=require(_0x25cd('0x2'));module[_0x25cd('0x3')]={'name':{'type':Sequelize['STRING'],'unique':'name'},'description':{'type':Sequelize[_0x25cd('0x4')]},'formData':{'type':Sequelize[_0x25cd('0x5')](_0x25cd('0x6')),'set':function(_0x508ef5){if(_['isObjectLike'](_0x508ef5)){this[_0x25cd('0x7')]('formData',JSON[_0x25cd('0x8')](_0x508ef5));}else if(_[_0x25cd('0x9')](_0x508ef5)){this[_0x25cd('0x7')](_0x25cd('0xa'),_0x508ef5);}else{this[_0x25cd('0x7')](_0x25cd('0xa'),util[_0x25cd('0xb')](_0x25cd('0xc'),this[_0x25cd('0xd')]('name')||'',this[_0x25cd('0xd')](_0x25cd('0xe'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x25cd('0xf')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x25cd('0xf')],'defaultValue':![]}}; \ No newline at end of file +var _0xba40=['isObjectLike','setDataValue','formData','format','getDataValue','description','BOOLEAN','sequelize','exports','name','TEXT'];(function(_0x10bc65,_0x33e884){var _0x365ec0=function(_0x14d38d){while(--_0x14d38d){_0x10bc65['push'](_0x10bc65['shift']());}};_0x365ec0(++_0x33e884);}(_0xba40,0xb7));var _0x0ba4=function(_0x56bd6a,_0xb544ce){_0x56bd6a=_0x56bd6a-0x0;var _0x1a223b=_0xba40[_0x56bd6a];return _0x1a223b;};'use strict';var Sequelize=require(_0x0ba4('0x0'));var _=require('lodash');var util=require('util');module[_0x0ba4('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x0ba4('0x2')},'description':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0x0ba4('0x3')]('long'),'set':function(_0x3d339e){if(_[_0x0ba4('0x4')](_0x3d339e)){this['setDataValue']('formData',JSON['stringify'](_0x3d339e));}else if(_['isString'](_0x3d339e)){this[_0x0ba4('0x5')](_0x0ba4('0x6'),_0x3d339e);}else{this['setDataValue'](_0x0ba4('0x6'),util[_0x0ba4('0x7')]('{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}',this[_0x0ba4('0x8')](_0x0ba4('0x2'))||'',this[_0x0ba4('0x8')](_0x0ba4('0x9'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x0ba4('0xa')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x0ba4('0xa')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index aa681c5..da7deb6 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 _0x609a=['setHeader','Content-type','text/csv','download','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','Projects','destroy','stack','name','send','index','map','rawAttributes','type','model','query','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','JscriptyProject','includeAll','findAll','rows','catch','keys','intersection','length','include','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','autoAssociation','params','getSessions','findOne','JscriptySessionReport','ProjectId','getAnswers','JscriptyAnswerReport','number','toString','indexOf','replace','getSummary','startTime','starttime','parse','JscriptyQuestionReport','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','isEmpty','now','/tmp/Jscripty_Project_%d_Summary_%s.csv','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv'];(function(_0x5bd6cd,_0x526dc3){var _0x3d46d7=function(_0xc4a9a6){while(--_0xc4a9a6){_0x5bd6cd['push'](_0x5bd6cd['shift']());}};_0x3d46d7(++_0x526dc3);}(_0x609a,0x1ec));var _0xa609=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x609a[_0x432682];return _0x463d05;};'use strict';var emlformat=require(_0xa609('0x0'));var rimraf=require(_0xa609('0x1'));var zipdir=require(_0xa609('0x2'));var jsonpatch=require(_0xa609('0x3'));var rp=require(_0xa609('0x4'));var moment=require(_0xa609('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xa609('0x6'));var util=require('util');var path=require(_0xa609('0x7'));var sox=require(_0xa609('0x8'));var csv=require(_0xa609('0x9'));var ejs=require(_0xa609('0xa'));var fs=require('fs');var fs_extra=require(_0xa609('0xb'));var _=require(_0xa609('0xc'));var squel=require(_0xa609('0xd'));var crypto=require(_0xa609('0xe'));var jsforce=require(_0xa609('0xf'));var deskjs=require(_0xa609('0x10'));var toCsv=require(_0xa609('0x9'));var querystring=require(_0xa609('0x11'));var Papa=require('papaparse');var Redis=require(_0xa609('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xa609('0x13'));var as=require(_0xa609('0x14'));var hardwareService=require(_0xa609('0x15'));var logger=require(_0xa609('0x16'))('api');var utils=require(_0xa609('0x17'));var config=require(_0xa609('0x18'));var licenseUtil=require(_0xa609('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2b8729,_0x28312c){_0x28312c=_0x28312c||0xcc;return function(_0x190509){if(_0x190509){return _0x2b8729[_0xa609('0x1a')](_0x28312c);}return _0x2b8729[_0xa609('0x1b')](_0x28312c)[_0xa609('0x1c')]();};}function respondWithResult(_0x142bcd,_0x36d144){_0x36d144=_0x36d144||0xc8;return function(_0x312d4e){if(_0x312d4e){return _0x142bcd[_0xa609('0x1b')](_0x36d144)[_0xa609('0x1d')](_0x312d4e);}};}function respondWithFilteredResult(_0x4809bc,_0x460693){return function(_0x460247){if(_0x460247){var _0x33db9a=typeof _0x460693[_0xa609('0x1e')]===_0xa609('0x1f')&&typeof _0x460693[_0xa609('0x20')]===_0xa609('0x1f');var _0x28726c=_0x460247[_0xa609('0x21')];var _0x1c9bed=_0x33db9a?0x0:_0x460693[_0xa609('0x1e')];var _0x3e6eac=_0x33db9a?_0x460247[_0xa609('0x21')]:_0x460693['offset']+_0x460693['limit'];var _0x4c4b14;if(_0x3e6eac>=_0x28726c){_0x3e6eac=_0x28726c;_0x4c4b14=0xc8;}else{_0x4c4b14=0xce;}_0x4809bc[_0xa609('0x1b')](_0x4c4b14);return _0x4809bc[_0xa609('0x22')](_0xa609('0x23'),_0x1c9bed+'-'+_0x3e6eac+'/'+_0x28726c)[_0xa609('0x1d')](_0x460247);}return null;};}function patchUpdates(_0x103bce){return function(_0x56a064){try{jsonpatch[_0xa609('0x24')](_0x56a064,_0x103bce,!![]);}catch(_0x204e2a){return BPromise['reject'](_0x204e2a);}return _0x56a064[_0xa609('0x25')]();};}function saveUpdates(_0x6b9ee0,_0x535e58){return function(_0x3a7975){if(_0x3a7975){return _0x3a7975[_0xa609('0x26')](_0x6b9ee0)[_0xa609('0x27')](function(_0x202b20){return _0x202b20;});}return null;};}function removeEntity(_0xd4321d,_0x210943){return function(_0x4ca2c3){if(_0x4ca2c3){return _0x4ca2c3['destroy']()[_0xa609('0x27')](function(){var _0x1fe2ab=_0x4ca2c3['get']({'plain':!![]});var _0x33673c=_0xa609('0x28');return db['UserProfileResource'][_0xa609('0x29')]({'where':{'type':_0x33673c,'resourceId':_0x1fe2ab['id']}})[_0xa609('0x27')](function(){return _0x4ca2c3;});})[_0xa609('0x27')](function(){_0xd4321d['status'](0xcc)[_0xa609('0x1c')]();});}};}function handleEntityNotFound(_0x34b7e1,_0x359638){return function(_0x1c46b0){if(!_0x1c46b0){_0x34b7e1[_0xa609('0x1a')](0x194);}return _0x1c46b0;};}function handleError(_0x1fffc5,_0x37d1aa){_0x37d1aa=_0x37d1aa||0x1f4;return function(_0xc8a523){logger['error'](_0xc8a523[_0xa609('0x2a')]);if(_0xc8a523[_0xa609('0x2b')]){delete _0xc8a523['name'];}_0x1fffc5[_0xa609('0x1b')](_0x37d1aa)[_0xa609('0x2c')](_0xc8a523);};}exports[_0xa609('0x2d')]=function(_0x3ba51a,_0x381a88){var _0x5cb635={},_0x32a1cd={},_0x44c1eb={'count':0x0,'rows':[]};var _0x196340=_[_0xa609('0x2e')](db['JscriptyProject'][_0xa609('0x2f')],function(_0x333c6f){return{'name':_0x333c6f['fieldName'],'type':_0x333c6f[_0xa609('0x30')]['key']};});_0x32a1cd[_0xa609('0x31')]=_[_0xa609('0x2e')](_0x196340,'name');_0x32a1cd[_0xa609('0x32')]=_['keys'](_0x3ba51a[_0xa609('0x32')]);_0x32a1cd['filters']=_['intersection'](_0x32a1cd[_0xa609('0x31')],_0x32a1cd['query']);_0x5cb635['attributes']=_['intersection'](_0x32a1cd['model'],qs[_0xa609('0x33')](_0x3ba51a[_0xa609('0x32')]['fields']));_0x5cb635[_0xa609('0x34')]=_0x5cb635[_0xa609('0x34')]['length']?_0x5cb635['attributes']:_0x32a1cd['model'];if(!_0x3ba51a[_0xa609('0x32')][_0xa609('0x35')](_0xa609('0x36'))){_0x5cb635[_0xa609('0x20')]=qs[_0xa609('0x20')](_0x3ba51a[_0xa609('0x32')][_0xa609('0x20')]);_0x5cb635['offset']=qs['offset'](_0x3ba51a['query']['offset']);}_0x5cb635[_0xa609('0x37')]=qs[_0xa609('0x38')](_0x3ba51a['query']['sort']);_0x5cb635[_0xa609('0x39')]=qs[_0xa609('0x3a')](_[_0xa609('0x3b')](_0x3ba51a[_0xa609('0x32')],_0x32a1cd[_0xa609('0x3a')]),_0x196340);if(_0x3ba51a['query'][_0xa609('0x3c')]){_0x5cb635[_0xa609('0x39')]=_[_0xa609('0x3d')](_0x5cb635[_0xa609('0x39')],{'$or':_[_0xa609('0x2e')](_0x196340,function(_0x26a647){if(_0x26a647[_0xa609('0x30')]!==_0xa609('0x3e')){var _0x715543={};_0x715543[_0x26a647['name']]={'$like':'%'+_0x3ba51a[_0xa609('0x32')][_0xa609('0x3c')]+'%'};return _0x715543;}})});}_0x5cb635=_['merge']({},_0x5cb635,_0x3ba51a[_0xa609('0x3f')]);var _0x3f8f3b={'where':_0x5cb635['where']};return db[_0xa609('0x40')][_0xa609('0x21')](_0x3f8f3b)['then'](function(_0x30fceb){_0x44c1eb['count']=_0x30fceb;if(_0x3ba51a['query'][_0xa609('0x41')]){_0x5cb635['include']=[{'all':!![]}];}return db[_0xa609('0x40')][_0xa609('0x42')](_0x5cb635);})[_0xa609('0x27')](function(_0xfa9786){_0x44c1eb[_0xa609('0x43')]=_0xfa9786;return _0x44c1eb;})['then'](respondWithFilteredResult(_0x381a88,_0x5cb635))[_0xa609('0x44')](handleError(_0x381a88,null));};exports['show']=function(_0x413aea,_0x5941b1){var _0x51e9aa={'raw':![],'where':{'id':_0x413aea['params']['id']}},_0x8913b7={};_0x8913b7[_0xa609('0x31')]=_[_0xa609('0x45')](db[_0xa609('0x40')][_0xa609('0x2f')]);_0x8913b7['query']=_[_0xa609('0x45')](_0x413aea[_0xa609('0x32')]);_0x8913b7[_0xa609('0x3a')]=_[_0xa609('0x46')](_0x8913b7[_0xa609('0x31')],_0x8913b7['query']);_0x51e9aa[_0xa609('0x34')]=_['intersection'](_0x8913b7[_0xa609('0x31')],qs[_0xa609('0x33')](_0x413aea[_0xa609('0x32')]['fields']));_0x51e9aa[_0xa609('0x34')]=_0x51e9aa[_0xa609('0x34')][_0xa609('0x47')]?_0x51e9aa[_0xa609('0x34')]:_0x8913b7[_0xa609('0x31')];if(_0x413aea[_0xa609('0x32')]['includeAll']){_0x51e9aa[_0xa609('0x48')]=[{'all':!![]}];}_0x51e9aa=_[_0xa609('0x3d')]({},_0x51e9aa,_0x413aea[_0xa609('0x3f')]);return db['JscriptyProject'][_0xa609('0x49')](_0x51e9aa)['then'](handleEntityNotFound(_0x5941b1,null))[_0xa609('0x27')](respondWithResult(_0x5941b1,null))[_0xa609('0x44')](handleError(_0x5941b1,null));};exports[_0xa609('0x4a')]=function(_0x1ccdf1,_0x4de98b){return db[_0xa609('0x40')][_0xa609('0x4a')](_0x1ccdf1[_0xa609('0x4b')],{})[_0xa609('0x27')](function(_0x73bb54){var _0x4f430e=_0x1ccdf1[_0xa609('0x4c')][_0xa609('0x4d')]({'plain':!![]});if(!_0x4f430e)throw new Error(_0xa609('0x4e'));if(_0x4f430e[_0xa609('0x4f')]===_0xa609('0x4c')){var _0x5dd362=_0x73bb54[_0xa609('0x4d')]({'plain':!![]});var _0x125ad1=_0xa609('0x28');return db[_0xa609('0x50')][_0xa609('0x49')]({'where':{'name':_0x125ad1,'userProfileId':_0x4f430e[_0xa609('0x51')]},'raw':!![]})['then'](function(_0x19b9e8){if(_0x19b9e8&&_0x19b9e8['autoAssociation']===0x0){return db[_0xa609('0x52')]['create']({'name':_0x5dd362[_0xa609('0x2b')],'resourceId':_0x5dd362['id'],'type':_0x19b9e8[_0xa609('0x2b')],'sectionId':_0x19b9e8['id']},{})['then'](function(){return _0x73bb54;});}else{return _0x73bb54;}})[_0xa609('0x44')](function(_0x141fc1){logger[_0xa609('0x53')](_0xa609('0x54'),_0x141fc1);throw _0x141fc1;});}return _0x73bb54;})[_0xa609('0x27')](respondWithResult(_0x4de98b,0xc9))[_0xa609('0x44')](handleError(_0x4de98b,null));};exports[_0xa609('0x55')]=function(_0x52f42d,_0xa21947){var _0x18dfb8={'where':{'id':_0x52f42d['params']['id']}},_0x2c0f59={};_0x2c0f59[_0xa609('0x31')]=_['keys'](db[_0xa609('0x40')][_0xa609('0x2f')]);_0x18dfb8[_0xa609('0x34')]=_[_0xa609('0x46')](_0x2c0f59[_0xa609('0x31')],qs[_0xa609('0x33')](_0x52f42d[_0xa609('0x32')][_0xa609('0x33')]));_0x18dfb8[_0xa609('0x34')]=_0x18dfb8['attributes'][_0xa609('0x47')]?_0x18dfb8[_0xa609('0x34')]:_0x2c0f59['model'];if(_0x52f42d['query'][_0xa609('0x41')]){_0x18dfb8[_0xa609('0x48')]=[{'all':!![]}];}_0x18dfb8=_[_0xa609('0x3d')]({},_0x18dfb8,_0x52f42d['options']);return db[_0xa609('0x40')]['find'](_0x18dfb8)[_0xa609('0x27')](handleEntityNotFound(_0xa21947,null))[_0xa609('0x27')](function(_0xf4aa73){if(_0xf4aa73){var _0x5bc5b3=_0xf4aa73['get']({'plain':!![]});_0x5bc5b3=qs[_0xa609('0x56')](_0x5bc5b3,['id',_0xa609('0x57'),_0xa609('0x58')]);_0x52f42d[_0xa609('0x4b')]=_[_0xa609('0x56')](_0x52f42d[_0xa609('0x4b')],['id',_0xa609('0x57'),_0xa609('0x58')]);return db[_0xa609('0x40')]['create'](_[_0xa609('0x3d')](_0x5bc5b3,_0x52f42d[_0xa609('0x4b')]),{'include':_0x52f42d[_0xa609('0x32')][_0xa609('0x41')]?[{'all':!![]}]:undefined})['then'](function(_0xbb25b9){var _0x2c872a=_0x52f42d[_0xa609('0x4c')][_0xa609('0x4d')]({'plain':!![]});if(!_0x2c872a)throw new Error(_0xa609('0x4e'));if(_0x2c872a[_0xa609('0x4f')]==='user'){var _0x10a8d5=_0xbb25b9['get']({'plain':!![]});var _0x5284e7=_0xa609('0x28');return db['UserProfileSection'][_0xa609('0x49')]({'where':{'name':_0x5284e7,'userProfileId':_0x2c872a[_0xa609('0x51')]},'raw':!![]})[_0xa609('0x27')](function(_0xaa1fef){if(_0xaa1fef&&_0xaa1fef[_0xa609('0x59')]===0x0){return db[_0xa609('0x52')]['create']({'name':_0x10a8d5[_0xa609('0x2b')],'resourceId':_0x10a8d5['id'],'type':_0xaa1fef[_0xa609('0x2b')],'sectionId':_0xaa1fef['id']},{})['then'](function(){return _0xbb25b9;});}else{return _0xbb25b9;}})[_0xa609('0x44')](function(_0x5d0afe){logger[_0xa609('0x53')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5d0afe);throw _0x5d0afe;});}return _0xbb25b9;});}})['then'](respondWithResult(_0xa21947,0xc9))[_0xa609('0x44')](handleError(_0xa21947,null));};exports[_0xa609('0x26')]=function(_0x3f34b3,_0xd0e0f6){if(_0x3f34b3[_0xa609('0x4b')]['id']){delete _0x3f34b3[_0xa609('0x4b')]['id'];}return db[_0xa609('0x40')][_0xa609('0x49')]({'where':{'id':_0x3f34b3[_0xa609('0x5a')]['id']}})[_0xa609('0x27')](handleEntityNotFound(_0xd0e0f6,null))[_0xa609('0x27')](saveUpdates(_0x3f34b3[_0xa609('0x4b')],null))['then'](respondWithResult(_0xd0e0f6,null))[_0xa609('0x44')](handleError(_0xd0e0f6,null));};exports['destroy']=function(_0x57ec79,_0x476602){return db[_0xa609('0x40')][_0xa609('0x49')]({'where':{'id':_0x57ec79[_0xa609('0x5a')]['id']}})['then'](handleEntityNotFound(_0x476602,null))[_0xa609('0x27')](removeEntity(_0x476602,null))[_0xa609('0x44')](handleError(_0x476602,null));};exports[_0xa609('0x5b')]=function(_0x4a8042,_0x10d571,_0x443eb5){var _0x1f6626={'raw':!![],'where':{}};var _0x264d9e={};var _0x10fd44={'count':0x0,'rows':[]};return db[_0xa609('0x40')][_0xa609('0x5c')]({'where':{'id':_0x4a8042['params']['id']}})[_0xa609('0x27')](handleEntityNotFound(_0x10d571,null))[_0xa609('0x27')](function(_0x251ace){if(_0x251ace){_0x264d9e[_0xa609('0x31')]=_[_0xa609('0x45')](db[_0xa609('0x5d')]['rawAttributes']);_0x264d9e[_0xa609('0x32')]=_[_0xa609('0x45')](_0x4a8042[_0xa609('0x32')]);_0x264d9e[_0xa609('0x3a')]=_[_0xa609('0x46')](_0x264d9e[_0xa609('0x31')],_0x264d9e[_0xa609('0x32')]);_0x1f6626[_0xa609('0x34')]=_[_0xa609('0x46')](_0x264d9e[_0xa609('0x31')],qs[_0xa609('0x33')](_0x4a8042[_0xa609('0x32')][_0xa609('0x33')]));_0x1f6626[_0xa609('0x34')]=_0x1f6626[_0xa609('0x34')][_0xa609('0x47')]?_0x1f6626[_0xa609('0x34')]:_0x264d9e[_0xa609('0x31')];if(!_0x4a8042[_0xa609('0x32')]['hasOwnProperty'](_0xa609('0x36'))){_0x1f6626[_0xa609('0x20')]=qs[_0xa609('0x20')](_0x4a8042['query'][_0xa609('0x20')]);_0x1f6626[_0xa609('0x1e')]=qs[_0xa609('0x1e')](_0x4a8042[_0xa609('0x32')]['offset']);}_0x1f6626[_0xa609('0x37')]=qs[_0xa609('0x38')](_0x4a8042[_0xa609('0x32')][_0xa609('0x38')]);_0x1f6626[_0xa609('0x39')]=qs[_0xa609('0x3a')](_[_0xa609('0x3b')](_0x4a8042[_0xa609('0x32')],_0x264d9e[_0xa609('0x3a')]));_0x1f6626[_0xa609('0x39')][_0xa609('0x5e')]=_0x251ace['id'];if(_0x4a8042['query']['filter']){_0x1f6626[_0xa609('0x39')]=_[_0xa609('0x3d')](_0x1f6626[_0xa609('0x39')],{'$or':_[_0xa609('0x2e')](_0x1f6626[_0xa609('0x34')],function(_0x10ecc9){var _0x454152={};_0x454152[_0x10ecc9]={'$like':'%'+_0x4a8042['query'][_0xa609('0x3c')]+'%'};return _0x454152;})});}_0x1f6626=_['merge']({},_0x1f6626,_0x4a8042[_0xa609('0x3f')]);return db['JscriptySessionReport'][_0xa609('0x21')]({'where':_0x1f6626[_0xa609('0x39')]})['then'](function(_0x595039){_0x10fd44[_0xa609('0x21')]=_0x595039;if(_0x4a8042[_0xa609('0x32')][_0xa609('0x41')]){_0x1f6626[_0xa609('0x48')]=[{'all':!![]}];}return db[_0xa609('0x5d')][_0xa609('0x42')](_0x1f6626);})[_0xa609('0x27')](function(_0x2f49a5){_0x10fd44[_0xa609('0x43')]=_0x2f49a5;return _0x10fd44;});}})[_0xa609('0x27')](respondWithFilteredResult(_0x10d571,_0x1f6626))[_0xa609('0x44')](handleError(_0x10d571,null));};exports[_0xa609('0x5f')]=function(_0x4d280b,_0x46ddcc,_0x558fa3){var _0x1e511e={'raw':!![],'where':{}};var _0x434afe={};var _0x155ac2={'count':0x0,'rows':[]};return db[_0xa609('0x40')][_0xa609('0x5c')]({'where':{'id':_0x4d280b['params']['id']}})[_0xa609('0x27')](handleEntityNotFound(_0x46ddcc,null))[_0xa609('0x27')](function(_0x768c15){if(_0x768c15){_0x434afe[_0xa609('0x31')]=_['keys'](db['JscriptyAnswerReport'][_0xa609('0x2f')]);_0x434afe[_0xa609('0x32')]=_[_0xa609('0x45')](_0x4d280b[_0xa609('0x32')]);_0x434afe[_0xa609('0x3a')]=_['intersection'](_0x434afe[_0xa609('0x31')],_0x434afe['query']);_0x1e511e[_0xa609('0x34')]=_['intersection'](_0x434afe[_0xa609('0x31')],qs[_0xa609('0x33')](_0x4d280b['query']['fields']));_0x1e511e[_0xa609('0x34')]=_0x1e511e['attributes'][_0xa609('0x47')]?_0x1e511e[_0xa609('0x34')]:_0x434afe['model'];if(!_0x4d280b[_0xa609('0x32')][_0xa609('0x35')](_0xa609('0x36'))){_0x1e511e['limit']=qs[_0xa609('0x20')](_0x4d280b['query'][_0xa609('0x20')]);_0x1e511e[_0xa609('0x1e')]=qs[_0xa609('0x1e')](_0x4d280b[_0xa609('0x32')][_0xa609('0x1e')]);}_0x1e511e[_0xa609('0x37')]=qs['sort'](_0x4d280b['query'][_0xa609('0x38')]);_0x1e511e['where']=qs[_0xa609('0x3a')](_['pick'](_0x4d280b[_0xa609('0x32')],_0x434afe[_0xa609('0x3a')]));_0x1e511e[_0xa609('0x39')][_0xa609('0x5e')]=_0x768c15['id'];if(_0x4d280b[_0xa609('0x32')][_0xa609('0x3c')]){_0x1e511e[_0xa609('0x39')]=_[_0xa609('0x3d')](_0x1e511e['where'],{'$or':_[_0xa609('0x2e')](_0x1e511e[_0xa609('0x34')],function(_0x3754f1){var _0x4ad33a={};_0x4ad33a[_0x3754f1]={'$like':'%'+_0x4d280b['query'][_0xa609('0x3c')]+'%'};return _0x4ad33a;})});}_0x1e511e=_[_0xa609('0x3d')]({},_0x1e511e,_0x4d280b['options']);return db[_0xa609('0x60')]['count']({'where':_0x1e511e[_0xa609('0x39')]})[_0xa609('0x27')](function(_0x158206){_0x155ac2[_0xa609('0x21')]=_0x158206;if(_0x4d280b[_0xa609('0x32')][_0xa609('0x41')]){_0x1e511e[_0xa609('0x48')]=[{'all':!![]}];}return db[_0xa609('0x60')]['findAll'](_0x1e511e);})['then'](function(_0x193f87){_0x155ac2['rows']=_0x193f87;return _0x155ac2;});}})['then'](respondWithFilteredResult(_0x46ddcc,_0x1e511e))[_0xa609('0x44')](handleError(_0x46ddcc,null));};function char(_0x58f131){return _0xa609('0x61')===typeof _0x58f131?String['fromCharCode']['apply'](null,arguments):_0x58f131;}function needsEncapsulation(_0x3748ca){return!!_0x3748ca&&(_0x3748ca[_0xa609('0x62')]()['indexOf'](char(0xd))>=0x0||_0x3748ca[_0xa609('0x62')]()[_0xa609('0x63')](char(0xa))>=0x0||_0x3748ca[_0xa609('0x62')]()[_0xa609('0x63')](char(0x2c))>=0x0||_0x3748ca[_0xa609('0x62')]()[_0xa609('0x63')](char(0x22))>=0x0);}function encapsulate(_0x51c8c5){var _0x1f18d0=char(0x22),_0x28cedf='\x5c'+char(0x22),_0xd84905=_0x51c8c5[_0xa609('0x62')]()[_0xa609('0x64')](new RegExp(_0x1f18d0,'g'),_0x28cedf);return _0x1f18d0+_0xd84905+_0x1f18d0;}exports[_0xa609('0x65')]=function(_0x1a25a8,_0x395a34,_0x42a782){var _0x4e3667,_0x569ad4;var _0x453d90={'where':{'ProjectId':_0x1a25a8['params']['id']}};if(_0x1a25a8[_0xa609('0x32')][_0xa609('0x66')]){_0x453d90[_0xa609('0x39')][_0xa609('0x67')]=JSON[_0xa609('0x68')](_0x1a25a8[_0xa609('0x32')][_0xa609('0x66')]);}return db[_0xa609('0x5d')][_0xa609('0x42')](_0x453d90)['then'](handleEntityNotFound(_0x395a34,null))[_0xa609('0x27')](function(_0x489ba2){if(_0x489ba2){_0x4e3667=_0x489ba2;return db[_0xa609('0x69')][_0xa609('0x42')]({'where':{'SessionId':{'$in':_['map'](_0x4e3667,'id')},'ProjectId':_0x1a25a8[_0xa609('0x5a')]['id']},'order':'-createdAt'});}})[_0xa609('0x27')](handleEntityNotFound(_0x395a34,null))[_0xa609('0x27')](function(_0x53af46){if(_0x53af46){_0x569ad4=_0x53af46;var _0x38d81d={};for(var _0x365ea4=0x0,_0x418d90=_0x569ad4[_0xa609('0x47')];_0x365ea4<_0x418d90;_0x365ea4++){if(!_0x38d81d[_0xa609('0x35')](_0x569ad4[_0x365ea4][_0xa609('0x6a')])){_0x38d81d[_0x569ad4[_0x365ea4][_0xa609('0x6a')]]=needsEncapsulation(_0x569ad4[_0x365ea4][_0xa609('0x6b')])?encapsulate(_0x569ad4[_0x365ea4]['question']):_0x569ad4[_0x365ea4][_0xa609('0x6b')];}}var _0x511198=[],_0x114332={};for(var _0x1960d3=0x0,_0x58f253=_0x4e3667[_0xa609('0x47')];_0x1960d3<_0x58f253;_0x1960d3++){_0x114332={'ProjectId':_0x1a25a8[_0xa609('0x5a')]['id'],'SessionId':_0x4e3667[_0x1960d3]['id'],'StartTime':moment(_0x4e3667[_0x1960d3][_0xa609('0x67')])[_0xa609('0x6c')](_0xa609('0x6d'))};for(var _0x2251dd=0x0,_0x5cd885=_0x569ad4[_0xa609('0x47')];_0x2251dd<_0x5cd885;_0x2251dd++){if(_0x569ad4[_0x2251dd][_0xa609('0x6e')]==_0x4e3667[_0x1960d3]['id']&&_0x38d81d['hasOwnProperty'](_0x569ad4[_0x2251dd][_0xa609('0x6a')])){_0x114332[_0x38d81d[_0x569ad4[_0x2251dd][_0xa609('0x6a')]]]=_0x569ad4[_0x2251dd][_0xa609('0x6f')];}}for(var _0xef903f in _0x38d81d){if(!_0x114332[_0xa609('0x35')](_0x38d81d[_0xef903f])){_0x114332[_0x38d81d[_0xef903f]]=null;}}_0x511198['push'](_0x114332);}return _0x511198;}})[_0xa609('0x27')](function(_0x5ec0c4){if(!_[_0xa609('0x70')](_0x5ec0c4)){var _0x1c9c12=toCsv(_0x5ec0c4);var _0x382121=Date[_0xa609('0x71')]();fs['writeFileSync'](util['format'](_0xa609('0x72'),_0x1a25a8[_0xa609('0x5a')]['id'],_0x382121),_0x1c9c12);_0x395a34['setHeader'](_0xa609('0x73'),_0xa609('0x74')+util[_0xa609('0x6c')](_0xa609('0x75'),_0x1a25a8['params']['id'],_0x382121));_0x395a34[_0xa609('0x76')](_0xa609('0x77'),_0xa609('0x78'));return _0x395a34[_0xa609('0x79')](util['format'](_0xa609('0x72'),_0x1a25a8[_0xa609('0x5a')]['id'],_0x382121));}else{return _0x395a34['sendStatus'](0xcc);}})[_0xa609('0x44')](handleError(_0x395a34,null));}; \ No newline at end of file +var _0xf925=['fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','merge','where','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','user','role','get','Projects','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','length','omit','createdAt','updatedAt','getSessions','findOne','JscriptySessionReport','pick','ProjectId','filter','JscriptyAnswerReport','number','toString','indexOf','replace','getSummary','startTime','parse','JscriptyQuestionReport','-createdAt','questionId','question','SessionId','answer','push','now','writeFileSync','format','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv','download','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','then','UserProfileResource','error','stack','name','send','index','map','JscriptyProject','rawAttributes'];(function(_0x170f3c,_0x2c724c){var _0x5e0012=function(_0x4e1f84){while(--_0x4e1f84){_0x170f3c['push'](_0x170f3c['shift']());}};_0x5e0012(++_0x2c724c);}(_0xf925,0xb7));var _0x5f92=function(_0x4729ae,_0x35a7c4){_0x4729ae=_0x4729ae-0x0;var _0x464880=_0xf925[_0x4729ae];return _0x464880;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5f92('0x0'));var rp=require(_0x5f92('0x1'));var moment=require(_0x5f92('0x2'));var BPromise=require(_0x5f92('0x3'));var Mustache=require('mustache');var util=require(_0x5f92('0x4'));var path=require(_0x5f92('0x5'));var sox=require(_0x5f92('0x6'));var csv=require(_0x5f92('0x7'));var ejs=require(_0x5f92('0x8'));var fs=require('fs');var fs_extra=require(_0x5f92('0x9'));var _=require(_0x5f92('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5f92('0xb'));var toCsv=require('to-csv');var querystring=require(_0x5f92('0xc'));var Papa=require(_0x5f92('0xd'));var Redis=require('ioredis');var authService=require(_0x5f92('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x5f92('0xf'));var hardwareService=require(_0x5f92('0x10'));var logger=require(_0x5f92('0x11'))(_0x5f92('0x12'));var utils=require('../../config/utils');var config=require(_0x5f92('0x13'));var licenseUtil=require(_0x5f92('0x14'));var db=require(_0x5f92('0x15'))['db'];function respondWithStatusCode(_0x171464,_0x50dddf){_0x50dddf=_0x50dddf||0xcc;return function(_0x37640f){if(_0x37640f){return _0x171464[_0x5f92('0x16')](_0x50dddf);}return _0x171464[_0x5f92('0x17')](_0x50dddf)['end']();};}function respondWithResult(_0x5e2878,_0x3ef88d){_0x3ef88d=_0x3ef88d||0xc8;return function(_0x2642f5){if(_0x2642f5){return _0x5e2878['status'](_0x3ef88d)['json'](_0x2642f5);}};}function respondWithFilteredResult(_0xb1c3fa,_0x3151eb){return function(_0x4ccd50){if(_0x4ccd50){var _0x2099e5=typeof _0x3151eb[_0x5f92('0x18')]==='undefined'&&typeof _0x3151eb[_0x5f92('0x19')]==='undefined';var _0x4d954d=_0x4ccd50[_0x5f92('0x1a')];var _0x4d22cf=_0x2099e5?0x0:_0x3151eb[_0x5f92('0x18')];var _0xb9c506=_0x2099e5?_0x4ccd50[_0x5f92('0x1a')]:_0x3151eb[_0x5f92('0x18')]+_0x3151eb[_0x5f92('0x19')];var _0x1c8ab6;if(_0xb9c506>=_0x4d954d){_0xb9c506=_0x4d954d;_0x1c8ab6=0xc8;}else{_0x1c8ab6=0xce;}_0xb1c3fa[_0x5f92('0x17')](_0x1c8ab6);return _0xb1c3fa[_0x5f92('0x1b')](_0x5f92('0x1c'),_0x4d22cf+'-'+_0xb9c506+'/'+_0x4d954d)[_0x5f92('0x1d')](_0x4ccd50);}return null;};}function patchUpdates(_0x215085){return function(_0x3bd2c6){try{jsonpatch[_0x5f92('0x1e')](_0x3bd2c6,_0x215085,!![]);}catch(_0x4923be){return BPromise[_0x5f92('0x1f')](_0x4923be);}return _0x3bd2c6[_0x5f92('0x20')]();};}function saveUpdates(_0xd1be3,_0x57dbc8){return function(_0x534f68){if(_0x534f68){return _0x534f68[_0x5f92('0x21')](_0xd1be3)['then'](function(_0x15ba80){return _0x15ba80;});}return null;};}function removeEntity(_0x52e110,_0x21482e){return function(_0x2a4fe2){if(_0x2a4fe2){return _0x2a4fe2[_0x5f92('0x22')]()[_0x5f92('0x23')](function(){var _0x2d3a16=_0x2a4fe2['get']({'plain':!![]});var _0x4fbc22='Projects';return db[_0x5f92('0x24')][_0x5f92('0x22')]({'where':{'type':_0x4fbc22,'resourceId':_0x2d3a16['id']}})['then'](function(){return _0x2a4fe2;});})[_0x5f92('0x23')](function(){_0x52e110[_0x5f92('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x37620f,_0x49d9da){return function(_0x55a327){if(!_0x55a327){_0x37620f[_0x5f92('0x16')](0x194);}return _0x55a327;};}function handleError(_0x558867,_0x26b5b9){_0x26b5b9=_0x26b5b9||0x1f4;return function(_0x45dd8e){logger[_0x5f92('0x25')](_0x45dd8e[_0x5f92('0x26')]);if(_0x45dd8e[_0x5f92('0x27')]){delete _0x45dd8e[_0x5f92('0x27')];}_0x558867['status'](_0x26b5b9)[_0x5f92('0x28')](_0x45dd8e);};}exports[_0x5f92('0x29')]=function(_0x18258a,_0x1893d1){var _0x56369b={},_0x224972={},_0x2996ad={'count':0x0,'rows':[]};var _0x130093=_[_0x5f92('0x2a')](db[_0x5f92('0x2b')][_0x5f92('0x2c')],function(_0x124218){return{'name':_0x124218[_0x5f92('0x2d')],'type':_0x124218[_0x5f92('0x2e')][_0x5f92('0x2f')]};});_0x224972[_0x5f92('0x30')]=_['map'](_0x130093,'name');_0x224972[_0x5f92('0x31')]=_[_0x5f92('0x32')](_0x18258a['query']);_0x224972[_0x5f92('0x33')]=_['intersection'](_0x224972[_0x5f92('0x30')],_0x224972[_0x5f92('0x31')]);_0x56369b['attributes']=_[_0x5f92('0x34')](_0x224972[_0x5f92('0x30')],qs[_0x5f92('0x35')](_0x18258a[_0x5f92('0x31')][_0x5f92('0x35')]));_0x56369b[_0x5f92('0x36')]=_0x56369b['attributes']['length']?_0x56369b[_0x5f92('0x36')]:_0x224972[_0x5f92('0x30')];if(!_0x18258a[_0x5f92('0x31')][_0x5f92('0x37')](_0x5f92('0x38'))){_0x56369b[_0x5f92('0x19')]=qs[_0x5f92('0x19')](_0x18258a[_0x5f92('0x31')][_0x5f92('0x19')]);_0x56369b[_0x5f92('0x18')]=qs['offset'](_0x18258a['query'][_0x5f92('0x18')]);}_0x56369b[_0x5f92('0x39')]=qs[_0x5f92('0x3a')](_0x18258a[_0x5f92('0x31')]['sort']);_0x56369b['where']=qs['filters'](_['pick'](_0x18258a[_0x5f92('0x31')],_0x224972[_0x5f92('0x33')]),_0x130093);if(_0x18258a[_0x5f92('0x31')]['filter']){_0x56369b['where']=_[_0x5f92('0x3b')](_0x56369b[_0x5f92('0x3c')],{'$or':_[_0x5f92('0x2a')](_0x130093,function(_0xf48367){if(_0xf48367[_0x5f92('0x2e')]!=='VIRTUAL'){var _0x1d01ed={};_0x1d01ed[_0xf48367['name']]={'$like':'%'+_0x18258a[_0x5f92('0x31')]['filter']+'%'};return _0x1d01ed;}})});}_0x56369b=_[_0x5f92('0x3b')]({},_0x56369b,_0x18258a[_0x5f92('0x3d')]);var _0x40cfad={'where':_0x56369b[_0x5f92('0x3c')]};return db[_0x5f92('0x2b')][_0x5f92('0x1a')](_0x40cfad)['then'](function(_0x3c8602){_0x2996ad['count']=_0x3c8602;if(_0x18258a[_0x5f92('0x31')]['includeAll']){_0x56369b[_0x5f92('0x3e')]=[{'all':!![]}];}return db['JscriptyProject'][_0x5f92('0x3f')](_0x56369b);})[_0x5f92('0x23')](function(_0x378a43){_0x2996ad[_0x5f92('0x40')]=_0x378a43;return _0x2996ad;})['then'](respondWithFilteredResult(_0x1893d1,_0x56369b))[_0x5f92('0x41')](handleError(_0x1893d1,null));};exports[_0x5f92('0x42')]=function(_0x25ffd6,_0xd3ca9){var _0x52ee61={'raw':![],'where':{'id':_0x25ffd6[_0x5f92('0x43')]['id']}},_0x1ed7c6={};_0x1ed7c6[_0x5f92('0x30')]=_[_0x5f92('0x32')](db[_0x5f92('0x2b')]['rawAttributes']);_0x1ed7c6[_0x5f92('0x31')]=_[_0x5f92('0x32')](_0x25ffd6['query']);_0x1ed7c6[_0x5f92('0x33')]=_[_0x5f92('0x34')](_0x1ed7c6['model'],_0x1ed7c6[_0x5f92('0x31')]);_0x52ee61['attributes']=_[_0x5f92('0x34')](_0x1ed7c6[_0x5f92('0x30')],qs[_0x5f92('0x35')](_0x25ffd6[_0x5f92('0x31')]['fields']));_0x52ee61[_0x5f92('0x36')]=_0x52ee61[_0x5f92('0x36')]['length']?_0x52ee61[_0x5f92('0x36')]:_0x1ed7c6['model'];if(_0x25ffd6[_0x5f92('0x31')][_0x5f92('0x44')]){_0x52ee61[_0x5f92('0x3e')]=[{'all':!![]}];}_0x52ee61=_[_0x5f92('0x3b')]({},_0x52ee61,_0x25ffd6[_0x5f92('0x3d')]);return db[_0x5f92('0x2b')][_0x5f92('0x45')](_0x52ee61)[_0x5f92('0x23')](handleEntityNotFound(_0xd3ca9,null))['then'](respondWithResult(_0xd3ca9,null))[_0x5f92('0x41')](handleError(_0xd3ca9,null));};exports[_0x5f92('0x46')]=function(_0x6c66a5,_0x1423be){return db['JscriptyProject'][_0x5f92('0x46')](_0x6c66a5[_0x5f92('0x47')],{})[_0x5f92('0x23')](function(_0x417b8c){var _0x159365=_0x6c66a5[_0x5f92('0x48')]['get']({'plain':!![]});if(!_0x159365)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x159365[_0x5f92('0x49')]===_0x5f92('0x48')){var _0x1e6b94=_0x417b8c[_0x5f92('0x4a')]({'plain':!![]});var _0x373b6a=_0x5f92('0x4b');return db[_0x5f92('0x4c')]['find']({'where':{'name':_0x373b6a,'userProfileId':_0x159365[_0x5f92('0x4d')]},'raw':!![]})['then'](function(_0x2aecb5){if(_0x2aecb5&&_0x2aecb5[_0x5f92('0x4e')]===0x0){return db[_0x5f92('0x24')][_0x5f92('0x46')]({'name':_0x1e6b94[_0x5f92('0x27')],'resourceId':_0x1e6b94['id'],'type':_0x2aecb5[_0x5f92('0x27')],'sectionId':_0x2aecb5['id']},{})[_0x5f92('0x23')](function(){return _0x417b8c;});}else{return _0x417b8c;}})['catch'](function(_0x2791a8){logger[_0x5f92('0x25')](_0x5f92('0x4f'),_0x2791a8);throw _0x2791a8;});}return _0x417b8c;})[_0x5f92('0x23')](respondWithResult(_0x1423be,0xc9))[_0x5f92('0x41')](handleError(_0x1423be,null));};exports['clone']=function(_0x132fcb,_0x4c8e03){var _0xab8e38={'where':{'id':_0x132fcb['params']['id']}},_0x44313e={};_0x44313e[_0x5f92('0x30')]=_[_0x5f92('0x32')](db[_0x5f92('0x2b')]['rawAttributes']);_0xab8e38['attributes']=_[_0x5f92('0x34')](_0x44313e[_0x5f92('0x30')],qs['fields'](_0x132fcb[_0x5f92('0x31')]['fields']));_0xab8e38['attributes']=_0xab8e38['attributes'][_0x5f92('0x50')]?_0xab8e38[_0x5f92('0x36')]:_0x44313e[_0x5f92('0x30')];if(_0x132fcb[_0x5f92('0x31')][_0x5f92('0x44')]){_0xab8e38[_0x5f92('0x3e')]=[{'all':!![]}];}_0xab8e38=_[_0x5f92('0x3b')]({},_0xab8e38,_0x132fcb[_0x5f92('0x3d')]);return db[_0x5f92('0x2b')][_0x5f92('0x45')](_0xab8e38)[_0x5f92('0x23')](handleEntityNotFound(_0x4c8e03,null))[_0x5f92('0x23')](function(_0x205b0c){if(_0x205b0c){var _0x3910f6=_0x205b0c[_0x5f92('0x4a')]({'plain':!![]});_0x3910f6=qs[_0x5f92('0x51')](_0x3910f6,['id',_0x5f92('0x52'),_0x5f92('0x53')]);_0x132fcb['body']=_[_0x5f92('0x51')](_0x132fcb[_0x5f92('0x47')],['id',_0x5f92('0x52'),'updatedAt']);return db[_0x5f92('0x2b')][_0x5f92('0x46')](_['merge'](_0x3910f6,_0x132fcb['body']),{'include':_0x132fcb[_0x5f92('0x31')][_0x5f92('0x44')]?[{'all':!![]}]:undefined})[_0x5f92('0x23')](function(_0x32351d){var _0xaed387=_0x132fcb[_0x5f92('0x48')]['get']({'plain':!![]});if(!_0xaed387)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xaed387[_0x5f92('0x49')]===_0x5f92('0x48')){var _0x3f32e4=_0x32351d[_0x5f92('0x4a')]({'plain':!![]});var _0x45ce65='Projects';return db[_0x5f92('0x4c')]['find']({'where':{'name':_0x45ce65,'userProfileId':_0xaed387[_0x5f92('0x4d')]},'raw':!![]})[_0x5f92('0x23')](function(_0x26c64a){if(_0x26c64a&&_0x26c64a[_0x5f92('0x4e')]===0x0){return db[_0x5f92('0x24')][_0x5f92('0x46')]({'name':_0x3f32e4[_0x5f92('0x27')],'resourceId':_0x3f32e4['id'],'type':_0x26c64a[_0x5f92('0x27')],'sectionId':_0x26c64a['id']},{})['then'](function(){return _0x32351d;});}else{return _0x32351d;}})[_0x5f92('0x41')](function(_0x214c08){logger['error'](_0x5f92('0x4f'),_0x214c08);throw _0x214c08;});}return _0x32351d;});}})[_0x5f92('0x23')](respondWithResult(_0x4c8e03,0xc9))[_0x5f92('0x41')](handleError(_0x4c8e03,null));};exports[_0x5f92('0x21')]=function(_0x4d6ced,_0x28c087){if(_0x4d6ced[_0x5f92('0x47')]['id']){delete _0x4d6ced[_0x5f92('0x47')]['id'];}return db[_0x5f92('0x2b')]['find']({'where':{'id':_0x4d6ced['params']['id']}})[_0x5f92('0x23')](handleEntityNotFound(_0x28c087,null))['then'](saveUpdates(_0x4d6ced['body'],null))[_0x5f92('0x23')](respondWithResult(_0x28c087,null))[_0x5f92('0x41')](handleError(_0x28c087,null));};exports['destroy']=function(_0x306e58,_0x43fd8a){return db['JscriptyProject'][_0x5f92('0x45')]({'where':{'id':_0x306e58[_0x5f92('0x43')]['id']}})[_0x5f92('0x23')](handleEntityNotFound(_0x43fd8a,null))[_0x5f92('0x23')](removeEntity(_0x43fd8a,null))[_0x5f92('0x41')](handleError(_0x43fd8a,null));};exports[_0x5f92('0x54')]=function(_0x2908d6,_0x348e7b,_0xd58ddd){var _0xb4b55f={'raw':!![],'where':{}};var _0x887546={};var _0x1b658f={'count':0x0,'rows':[]};return db[_0x5f92('0x2b')][_0x5f92('0x55')]({'where':{'id':_0x2908d6['params']['id']}})[_0x5f92('0x23')](handleEntityNotFound(_0x348e7b,null))[_0x5f92('0x23')](function(_0x12ce5c){if(_0x12ce5c){_0x887546[_0x5f92('0x30')]=_[_0x5f92('0x32')](db[_0x5f92('0x56')][_0x5f92('0x2c')]);_0x887546[_0x5f92('0x31')]=_[_0x5f92('0x32')](_0x2908d6[_0x5f92('0x31')]);_0x887546[_0x5f92('0x33')]=_['intersection'](_0x887546[_0x5f92('0x30')],_0x887546['query']);_0xb4b55f[_0x5f92('0x36')]=_[_0x5f92('0x34')](_0x887546[_0x5f92('0x30')],qs['fields'](_0x2908d6[_0x5f92('0x31')][_0x5f92('0x35')]));_0xb4b55f['attributes']=_0xb4b55f[_0x5f92('0x36')][_0x5f92('0x50')]?_0xb4b55f[_0x5f92('0x36')]:_0x887546[_0x5f92('0x30')];if(!_0x2908d6['query'][_0x5f92('0x37')]('nolimit')){_0xb4b55f[_0x5f92('0x19')]=qs[_0x5f92('0x19')](_0x2908d6[_0x5f92('0x31')][_0x5f92('0x19')]);_0xb4b55f['offset']=qs[_0x5f92('0x18')](_0x2908d6[_0x5f92('0x31')][_0x5f92('0x18')]);}_0xb4b55f['order']=qs[_0x5f92('0x3a')](_0x2908d6[_0x5f92('0x31')][_0x5f92('0x3a')]);_0xb4b55f[_0x5f92('0x3c')]=qs[_0x5f92('0x33')](_[_0x5f92('0x57')](_0x2908d6[_0x5f92('0x31')],_0x887546[_0x5f92('0x33')]));_0xb4b55f[_0x5f92('0x3c')][_0x5f92('0x58')]=_0x12ce5c['id'];if(_0x2908d6[_0x5f92('0x31')][_0x5f92('0x59')]){_0xb4b55f[_0x5f92('0x3c')]=_['merge'](_0xb4b55f[_0x5f92('0x3c')],{'$or':_[_0x5f92('0x2a')](_0xb4b55f[_0x5f92('0x36')],function(_0xdd4528){var _0x5f1d4f={};_0x5f1d4f[_0xdd4528]={'$like':'%'+_0x2908d6[_0x5f92('0x31')][_0x5f92('0x59')]+'%'};return _0x5f1d4f;})});}_0xb4b55f=_[_0x5f92('0x3b')]({},_0xb4b55f,_0x2908d6['options']);return db['JscriptySessionReport']['count']({'where':_0xb4b55f[_0x5f92('0x3c')]})[_0x5f92('0x23')](function(_0x56346f){_0x1b658f[_0x5f92('0x1a')]=_0x56346f;if(_0x2908d6['query']['includeAll']){_0xb4b55f['include']=[{'all':!![]}];}return db[_0x5f92('0x56')][_0x5f92('0x3f')](_0xb4b55f);})[_0x5f92('0x23')](function(_0xd478b1){_0x1b658f[_0x5f92('0x40')]=_0xd478b1;return _0x1b658f;});}})[_0x5f92('0x23')](respondWithFilteredResult(_0x348e7b,_0xb4b55f))[_0x5f92('0x41')](handleError(_0x348e7b,null));};exports['getAnswers']=function(_0x26aa03,_0x326bc6,_0x3f7938){var _0x3e3b8c={'raw':!![],'where':{}};var _0x1b3b44={};var _0x1eced2={'count':0x0,'rows':[]};return db[_0x5f92('0x2b')][_0x5f92('0x55')]({'where':{'id':_0x26aa03[_0x5f92('0x43')]['id']}})[_0x5f92('0x23')](handleEntityNotFound(_0x326bc6,null))[_0x5f92('0x23')](function(_0x31ce88){if(_0x31ce88){_0x1b3b44[_0x5f92('0x30')]=_[_0x5f92('0x32')](db[_0x5f92('0x5a')][_0x5f92('0x2c')]);_0x1b3b44[_0x5f92('0x31')]=_[_0x5f92('0x32')](_0x26aa03['query']);_0x1b3b44[_0x5f92('0x33')]=_[_0x5f92('0x34')](_0x1b3b44['model'],_0x1b3b44[_0x5f92('0x31')]);_0x3e3b8c[_0x5f92('0x36')]=_[_0x5f92('0x34')](_0x1b3b44[_0x5f92('0x30')],qs[_0x5f92('0x35')](_0x26aa03['query'][_0x5f92('0x35')]));_0x3e3b8c['attributes']=_0x3e3b8c[_0x5f92('0x36')][_0x5f92('0x50')]?_0x3e3b8c[_0x5f92('0x36')]:_0x1b3b44[_0x5f92('0x30')];if(!_0x26aa03['query'][_0x5f92('0x37')](_0x5f92('0x38'))){_0x3e3b8c[_0x5f92('0x19')]=qs[_0x5f92('0x19')](_0x26aa03[_0x5f92('0x31')][_0x5f92('0x19')]);_0x3e3b8c[_0x5f92('0x18')]=qs[_0x5f92('0x18')](_0x26aa03[_0x5f92('0x31')][_0x5f92('0x18')]);}_0x3e3b8c[_0x5f92('0x39')]=qs[_0x5f92('0x3a')](_0x26aa03[_0x5f92('0x31')][_0x5f92('0x3a')]);_0x3e3b8c[_0x5f92('0x3c')]=qs['filters'](_['pick'](_0x26aa03[_0x5f92('0x31')],_0x1b3b44[_0x5f92('0x33')]));_0x3e3b8c['where'][_0x5f92('0x58')]=_0x31ce88['id'];if(_0x26aa03[_0x5f92('0x31')][_0x5f92('0x59')]){_0x3e3b8c[_0x5f92('0x3c')]=_[_0x5f92('0x3b')](_0x3e3b8c[_0x5f92('0x3c')],{'$or':_[_0x5f92('0x2a')](_0x3e3b8c[_0x5f92('0x36')],function(_0x404cfa){var _0x3535ea={};_0x3535ea[_0x404cfa]={'$like':'%'+_0x26aa03['query'][_0x5f92('0x59')]+'%'};return _0x3535ea;})});}_0x3e3b8c=_[_0x5f92('0x3b')]({},_0x3e3b8c,_0x26aa03['options']);return db[_0x5f92('0x5a')][_0x5f92('0x1a')]({'where':_0x3e3b8c[_0x5f92('0x3c')]})[_0x5f92('0x23')](function(_0x5594a7){_0x1eced2[_0x5f92('0x1a')]=_0x5594a7;if(_0x26aa03['query'][_0x5f92('0x44')]){_0x3e3b8c[_0x5f92('0x3e')]=[{'all':!![]}];}return db[_0x5f92('0x5a')][_0x5f92('0x3f')](_0x3e3b8c);})[_0x5f92('0x23')](function(_0xf9470c){_0x1eced2[_0x5f92('0x40')]=_0xf9470c;return _0x1eced2;});}})[_0x5f92('0x23')](respondWithFilteredResult(_0x326bc6,_0x3e3b8c))['catch'](handleError(_0x326bc6,null));};function char(_0x482cd2){return _0x5f92('0x5b')===typeof _0x482cd2?String['fromCharCode'][_0x5f92('0x1e')](null,arguments):_0x482cd2;}function needsEncapsulation(_0x3962cd){return!!_0x3962cd&&(_0x3962cd[_0x5f92('0x5c')]()[_0x5f92('0x5d')](char(0xd))>=0x0||_0x3962cd[_0x5f92('0x5c')]()[_0x5f92('0x5d')](char(0xa))>=0x0||_0x3962cd[_0x5f92('0x5c')]()[_0x5f92('0x5d')](char(0x2c))>=0x0||_0x3962cd[_0x5f92('0x5c')]()[_0x5f92('0x5d')](char(0x22))>=0x0);}function encapsulate(_0x4ad892){var _0x565eab=char(0x22),_0x2d49bd='\x5c'+char(0x22),_0x546419=_0x4ad892['toString']()[_0x5f92('0x5e')](new RegExp(_0x565eab,'g'),_0x2d49bd);return _0x565eab+_0x546419+_0x565eab;}exports[_0x5f92('0x5f')]=function(_0x119716,_0x424cf9,_0x2d4351){var _0x23383e,_0x2f1f97;var _0x296066={'where':{'ProjectId':_0x119716[_0x5f92('0x43')]['id']}};if(_0x119716[_0x5f92('0x31')][_0x5f92('0x60')]){_0x296066[_0x5f92('0x3c')]['starttime']=JSON[_0x5f92('0x61')](_0x119716[_0x5f92('0x31')]['startTime']);}return db[_0x5f92('0x56')][_0x5f92('0x3f')](_0x296066)['then'](handleEntityNotFound(_0x424cf9,null))[_0x5f92('0x23')](function(_0x12a92f){if(_0x12a92f){_0x23383e=_0x12a92f;return db[_0x5f92('0x62')][_0x5f92('0x3f')]({'where':{'SessionId':{'$in':_[_0x5f92('0x2a')](_0x23383e,'id')},'ProjectId':_0x119716[_0x5f92('0x43')]['id']},'order':_0x5f92('0x63')});}})[_0x5f92('0x23')](handleEntityNotFound(_0x424cf9,null))['then'](function(_0x344d26){if(_0x344d26){_0x2f1f97=_0x344d26;var _0x1751de={};for(var _0x2a3ef2=0x0,_0x165c8c=_0x2f1f97['length'];_0x2a3ef2<_0x165c8c;_0x2a3ef2++){if(!_0x1751de['hasOwnProperty'](_0x2f1f97[_0x2a3ef2]['questionId'])){_0x1751de[_0x2f1f97[_0x2a3ef2][_0x5f92('0x64')]]=needsEncapsulation(_0x2f1f97[_0x2a3ef2]['question'])?encapsulate(_0x2f1f97[_0x2a3ef2]['question']):_0x2f1f97[_0x2a3ef2][_0x5f92('0x65')];}}var _0x21943d=[],_0x381578={};for(var _0x56733c=0x0,_0x3c3e68=_0x23383e[_0x5f92('0x50')];_0x56733c<_0x3c3e68;_0x56733c++){_0x381578={'ProjectId':_0x119716[_0x5f92('0x43')]['id'],'SessionId':_0x23383e[_0x56733c]['id'],'StartTime':moment(_0x23383e[_0x56733c]['starttime'])['format']('YYYY-MM-DD\x20HH:mm:ss')};for(var _0x1a510e=0x0,_0x1f492c=_0x2f1f97[_0x5f92('0x50')];_0x1a510e<_0x1f492c;_0x1a510e++){if(_0x2f1f97[_0x1a510e][_0x5f92('0x66')]==_0x23383e[_0x56733c]['id']&&_0x1751de[_0x5f92('0x37')](_0x2f1f97[_0x1a510e]['questionId'])){_0x381578[_0x1751de[_0x2f1f97[_0x1a510e][_0x5f92('0x64')]]]=_0x2f1f97[_0x1a510e][_0x5f92('0x67')];}}for(var _0x1e2ffd in _0x1751de){if(!_0x381578['hasOwnProperty'](_0x1751de[_0x1e2ffd])){_0x381578[_0x1751de[_0x1e2ffd]]=null;}}_0x21943d[_0x5f92('0x68')](_0x381578);}return _0x21943d;}})['then'](function(_0x1a6aa0){if(!_['isEmpty'](_0x1a6aa0)){var _0xa110c5=toCsv(_0x1a6aa0);var _0x49e033=Date[_0x5f92('0x69')]();fs[_0x5f92('0x6a')](util[_0x5f92('0x6b')](_0x5f92('0x6c'),_0x119716['params']['id'],_0x49e033),_0xa110c5);_0x424cf9[_0x5f92('0x6d')]('Content-disposition','attachment;\x20filename='+util['format'](_0x5f92('0x6e'),_0x119716[_0x5f92('0x43')]['id'],_0x49e033));_0x424cf9[_0x5f92('0x6d')](_0x5f92('0x6f'),_0x5f92('0x70'));return _0x424cf9[_0x5f92('0x71')](util[_0x5f92('0x6b')]('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x119716[_0x5f92('0x43')]['id'],_0x49e033));}else{return _0x424cf9[_0x5f92('0x16')](0xcc);}})['catch'](handleError(_0x424cf9,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index be2404f..6c01022 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 _0x277c=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','jscripty_projects','lodash','../../config/logger'];(function(_0x867b0a,_0x587ccf){var _0x137438=function(_0xbeafa6){while(--_0xbeafa6){_0x867b0a['push'](_0x867b0a['shift']());}};_0x137438(++_0x587ccf);}(_0x277c,0x153));var _0xc277=function(_0x1fc275,_0x429095){_0x1fc275=_0x1fc275-0x0;var _0x3aa041=_0x277c[_0x1fc275];return _0x3aa041;};'use strict';var _=require(_0xc277('0x0'));var util=require('util');var logger=require(_0xc277('0x1'))(_0xc277('0x2'));var moment=require(_0xc277('0x3'));var BPromise=require(_0xc277('0x4'));var rp=require(_0xc277('0x5'));var fs=require('fs');var path=require(_0xc277('0x6'));var rimraf=require(_0xc277('0x7'));var config=require(_0xc277('0x8'));var attributes=require('./jscriptyProject.attributes');module['exports']=function(_0x1a6582,_0x5a4f03){return _0x1a6582[_0xc277('0x9')]('JscriptyProject',attributes,{'tableName':_0xc277('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd6bb=['./jscriptyProject.attributes','define','JscriptyProject','jscripty_projects','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0xb0ed0c,_0x1a1fb1){var _0x5d5356=function(_0x562be0){while(--_0x562be0){_0xb0ed0c['push'](_0xb0ed0c['shift']());}};_0x5d5356(++_0x1a1fb1);}(_0xd6bb,0x1cc));var _0xbd6b=function(_0x1e4a8e,_0x18022b){_0x1e4a8e=_0x1e4a8e-0x0;var _0x5408f9=_0xd6bb[_0x1e4a8e];return _0x5408f9;};'use strict';var _=require(_0xbd6b('0x0'));var util=require('util');var logger=require(_0xbd6b('0x1'))(_0xbd6b('0x2'));var moment=require(_0xbd6b('0x3'));var BPromise=require(_0xbd6b('0x4'));var rp=require(_0xbd6b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbd6b('0x6'));var config=require(_0xbd6b('0x7'));var attributes=require(_0xbd6b('0x8'));module['exports']=function(_0x256a94,_0x15d0eb){return _0x256a94[_0xbd6b('0x9')](_0xbd6b('0xa'),attributes,{'tableName':_0xbd6b('0xb'),'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 f631299..f9f7983 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 _0x9c44=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','request','then','request\x20sent','debug','stringify','code','error','message','JscriptyProject,\x20%s,\x20%s','info','result','catch','moment','bluebird'];(function(_0x60abfe,_0xc06aec){var _0x56d55f=function(_0x2220cb){while(--_0x2220cb){_0x60abfe['push'](_0x60abfe['shift']());}};_0x56d55f(++_0xc06aec);}(_0x9c44,0x178));var _0x49c4=function(_0x45d55e,_0x2fede3){_0x45d55e=_0x45d55e-0x0;var _0x29812a=_0x9c44[_0x45d55e];return _0x29812a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x49c4('0x0'));var BPromise=require(_0x49c4('0x1'));var rs=require(_0x49c4('0x2'));var fs=require('fs');var Redis=require(_0x49c4('0x3'));var db=require(_0x49c4('0x4'))['db'];var utils=require(_0x49c4('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x49c4('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x49c4('0x7')][_0x49c4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x69bc41,_0x2c4e2e,_0x436234){return new BPromise(function(_0x511d53,_0x11c586){return client[_0x49c4('0x9')](_0x69bc41,_0x436234)[_0x49c4('0xa')](function(_0x4487ca){logger['info']('JscriptyProject,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'));logger[_0x49c4('0xc')]('JscriptyProject,\x20%s,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'),JSON[_0x49c4('0xd')](_0x4487ca));if(_0x4487ca['error']){if(_0x4487ca['error'][_0x49c4('0xe')]===0x1f4){logger[_0x49c4('0xf')]('JscriptyProject,\x20%s,\x20%s',_0x2c4e2e,_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);return _0x11c586(_0x4487ca['error'][_0x49c4('0x10')]);}logger[_0x49c4('0xf')](_0x49c4('0x11'),_0x2c4e2e,_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);return _0x511d53(_0x4487ca[_0x49c4('0xf')][_0x49c4('0x10')]);}else{logger[_0x49c4('0x12')]('JscriptyProject,\x20%s,\x20%s',_0x2c4e2e,_0x49c4('0xb'));_0x511d53(_0x4487ca[_0x49c4('0x13')][_0x49c4('0x10')]);}})[_0x49c4('0x14')](function(_0x2abc78){logger['error'](_0x49c4('0x11'),_0x2c4e2e,_0x2abc78);_0x11c586(_0x2abc78);});});} \ No newline at end of file +var _0xd8b0=['../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','ioredis'];(function(_0x230951,_0x4dad52){var _0xeb26b1=function(_0x25776c){while(--_0x25776c){_0x230951['push'](_0x230951['shift']());}};_0xeb26b1(++_0x4dad52);}(_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 moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0d8b('0x2'));var db=require(_0x0d8b('0x3'))['db'];var utils=require(_0x0d8b('0x4'));var logger=require(_0x0d8b('0x5'))(_0x0d8b('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0d8b('0x7')][_0x0d8b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x39f43a,_0x4a4470,_0x413284){return new BPromise(function(_0x284169,_0x58e4e2){return client[_0x0d8b('0x9')](_0x39f43a,_0x413284)[_0x0d8b('0xa')](function(_0x3b027f){logger[_0x0d8b('0xb')](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));logger[_0x0d8b('0xe')](_0x0d8b('0xf'),_0x4a4470,'request\x20sent',JSON[_0x0d8b('0x10')](_0x3b027f));if(_0x3b027f['error']){if(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x12')]===0x1f4){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x58e4e2(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x284169(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}else{logger['info'](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));_0x284169(_0x3b027f[_0x0d8b('0x14')][_0x0d8b('0x13')]);}})[_0x0d8b('0x15')](function(_0x5cd485){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x5cd485);_0x58e4e2(_0x5cd485);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index 80b6d39..76c9f4f 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 _0x7aa6=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','destroy','multer','path','express'];(function(_0xc18524,_0x5caaf1){var _0x52b1f7=function(_0x32953f){while(--_0x32953f){_0xc18524['push'](_0xc18524['shift']());}};_0x52b1f7(++_0x5caaf1);}(_0x7aa6,0x10e));var _0x67aa=function(_0x278915,_0x3d7842){_0x278915=_0x278915-0x0;var _0x1f10fd=_0x7aa6[_0x278915];return _0x1f10fd;};'use strict';var multer=require(_0x67aa('0x0'));var util=require('util');var path=require(_0x67aa('0x1'));var timeout=require('connect-timeout');var express=require(_0x67aa('0x2'));var router=express[_0x67aa('0x3')]();var fs_extra=require(_0x67aa('0x4'));var auth=require(_0x67aa('0x5'));var interaction=require(_0x67aa('0x6'));var config=require(_0x67aa('0x7'));var controller=require(_0x67aa('0x8'));router[_0x67aa('0x9')]('/',auth[_0x67aa('0xa')](),controller[_0x67aa('0xb')]);router[_0x67aa('0x9')](_0x67aa('0xc'),auth[_0x67aa('0xa')](),controller[_0x67aa('0xd')]);router['get'](_0x67aa('0xe'),auth[_0x67aa('0xa')](),controller[_0x67aa('0xf')]);router[_0x67aa('0x10')]('/',auth[_0x67aa('0xa')](),controller[_0x67aa('0x11')]);router[_0x67aa('0x12')](_0x67aa('0xe'),auth[_0x67aa('0xa')](),controller[_0x67aa('0x13')]);router['delete'](_0x67aa('0xe'),auth['isAuthenticated'](),controller[_0x67aa('0x14')]);module['exports']=router; \ No newline at end of file +var _0x909e=['index','/:id','show','post','put','update','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','get','isAuthenticated'];(function(_0x4eb9da,_0x2c08eb){var _0x438805=function(_0x5b4330){while(--_0x5b4330){_0x4eb9da['push'](_0x4eb9da['shift']());}};_0x438805(++_0x2c08eb);}(_0x909e,0xd0));var _0xe909=function(_0x523bba,_0x309eb7){_0x523bba=_0x523bba-0x0;var _0x59e639=_0x909e[_0x523bba];return _0x59e639;};'use strict';var multer=require(_0xe909('0x0'));var util=require(_0xe909('0x1'));var path=require('path');var timeout=require(_0xe909('0x2'));var express=require(_0xe909('0x3'));var router=express[_0xe909('0x4')]();var fs_extra=require(_0xe909('0x5'));var auth=require(_0xe909('0x6'));var interaction=require(_0xe909('0x7'));var config=require(_0xe909('0x8'));var controller=require(_0xe909('0x9'));router[_0xe909('0xa')]('/',auth[_0xe909('0xb')](),controller[_0xe909('0xc')]);router[_0xe909('0xa')]('/describe',auth[_0xe909('0xb')](),controller['describe']);router[_0xe909('0xa')](_0xe909('0xd'),auth[_0xe909('0xb')](),controller[_0xe909('0xe')]);router[_0xe909('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0xe909('0x10')](_0xe909('0xd'),auth['isAuthenticated'](),controller[_0xe909('0x11')]);router['delete']('/:id',auth[_0xe909('0xb')](),controller[_0xe909('0x12')]);module[_0xe909('0x13')]=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index 298bdd0..e058af6 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(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0x7a54,0x106));var _0x47a5=function(_0x27cb46,_0x5eacaa){_0x27cb46=_0x27cb46-0x0;var _0x3a3f70=_0x7a54[_0x27cb46];return _0x3a3f70;};'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(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x7a54,0x106));var _0x47a5=function(_0x1be3ef,_0x5be6e0){_0x1be3ef=_0x1be3ef-0x0;var _0x40590c=_0x7a54[_0x1be3ef];return _0x40590c;};'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 e94cac1..eb096c3 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 _0x5c8e=['status','end','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map','JscriptyQuestionReport','rawAttributes','fieldName','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/utils','../../config/license/util','../../mysqldb','sendStatus'];(function(_0x3fb518,_0x37e67d){var _0x42a12a=function(_0x254cc3){while(--_0x254cc3){_0x3fb518['push'](_0x3fb518['shift']());}};_0x42a12a(++_0x37e67d);}(_0x5c8e,0x7b));var _0xe5c8=function(_0x206ec2,_0xb922d0){_0x206ec2=_0x206ec2-0x0;var _0x3df610=_0x5c8e[_0x206ec2];return _0x3df610;};'use strict';var emlformat=require(_0xe5c8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe5c8('0x1'));var jsonpatch=require(_0xe5c8('0x2'));var rp=require(_0xe5c8('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xe5c8('0x4'));var path=require('path');var sox=require(_0xe5c8('0x5'));var csv=require(_0xe5c8('0x6'));var ejs=require(_0xe5c8('0x7'));var fs=require('fs');var fs_extra=require(_0xe5c8('0x8'));var _=require(_0xe5c8('0x9'));var squel=require(_0xe5c8('0xa'));var crypto=require(_0xe5c8('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xe5c8('0xc'));var Papa=require(_0xe5c8('0xd'));var Redis=require(_0xe5c8('0xe'));var authService=require(_0xe5c8('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xe5c8('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xe5c8('0x11'));var config=require('../../config/environment');var licenseUtil=require(_0xe5c8('0x12'));var db=require(_0xe5c8('0x13'))['db'];function respondWithStatusCode(_0x5d101f,_0x426a4d){_0x426a4d=_0x426a4d||0xcc;return function(_0x26d718){if(_0x26d718){return _0x5d101f[_0xe5c8('0x14')](_0x426a4d);}return _0x5d101f[_0xe5c8('0x15')](_0x426a4d)[_0xe5c8('0x16')]();};}function respondWithResult(_0xde47c9,_0x1e7d74){_0x1e7d74=_0x1e7d74||0xc8;return function(_0x515d08){if(_0x515d08){return _0xde47c9[_0xe5c8('0x15')](_0x1e7d74)['json'](_0x515d08);}};}function respondWithFilteredResult(_0x854d69,_0x578210){return function(_0x408d12){if(_0x408d12){var _0x4442d4=typeof _0x578210[_0xe5c8('0x17')]===_0xe5c8('0x18')&&typeof _0x578210[_0xe5c8('0x19')]===_0xe5c8('0x18');var _0x15353e=_0x408d12['count'];var _0x28d50b=_0x4442d4?0x0:_0x578210[_0xe5c8('0x17')];var _0x177a27=_0x4442d4?_0x408d12[_0xe5c8('0x1a')]:_0x578210[_0xe5c8('0x17')]+_0x578210[_0xe5c8('0x19')];var _0x5b4811;if(_0x177a27>=_0x15353e){_0x177a27=_0x15353e;_0x5b4811=0xc8;}else{_0x5b4811=0xce;}_0x854d69[_0xe5c8('0x15')](_0x5b4811);return _0x854d69[_0xe5c8('0x1b')](_0xe5c8('0x1c'),_0x28d50b+'-'+_0x177a27+'/'+_0x15353e)['json'](_0x408d12);}return null;};}function patchUpdates(_0x9de2ba){return function(_0x95b2df){try{jsonpatch[_0xe5c8('0x1d')](_0x95b2df,_0x9de2ba,!![]);}catch(_0x5d3c18){return BPromise[_0xe5c8('0x1e')](_0x5d3c18);}return _0x95b2df[_0xe5c8('0x1f')]();};}function saveUpdates(_0x593c56,_0x43d1d1){return function(_0x56ad66){if(_0x56ad66){return _0x56ad66[_0xe5c8('0x20')](_0x593c56)[_0xe5c8('0x21')](function(_0x1c8ddd){return _0x1c8ddd;});}return null;};}function removeEntity(_0x1d1686,_0x4fc248){return function(_0xeea1e){if(_0xeea1e){return _0xeea1e[_0xe5c8('0x22')]()[_0xe5c8('0x21')](function(){_0x1d1686[_0xe5c8('0x15')](0xcc)[_0xe5c8('0x16')]();});}};}function handleEntityNotFound(_0x6f3048,_0x22aab0){return function(_0x220c5c){if(!_0x220c5c){_0x6f3048[_0xe5c8('0x14')](0x194);}return _0x220c5c;};}function handleError(_0x1c4e96,_0x18fe65){_0x18fe65=_0x18fe65||0x1f4;return function(_0xfa1fc9){logger[_0xe5c8('0x23')](_0xfa1fc9[_0xe5c8('0x24')]);if(_0xfa1fc9['name']){delete _0xfa1fc9[_0xe5c8('0x25')];}_0x1c4e96[_0xe5c8('0x15')](_0x18fe65)['send'](_0xfa1fc9);};}exports[_0xe5c8('0x26')]=function(_0x214b7c,_0x4738a1){var _0x598e46={},_0x3487ed={},_0xaa191b={'count':0x0,'rows':[]};var _0xc0502d=_[_0xe5c8('0x27')](db[_0xe5c8('0x28')][_0xe5c8('0x29')],function(_0x2d6c4c){return{'name':_0x2d6c4c[_0xe5c8('0x2a')],'type':_0x2d6c4c['type']['key']};});_0x3487ed['model']=_[_0xe5c8('0x27')](_0xc0502d,'name');_0x3487ed[_0xe5c8('0x2b')]=_['keys'](_0x214b7c[_0xe5c8('0x2b')]);_0x3487ed[_0xe5c8('0x2c')]=_[_0xe5c8('0x2d')](_0x3487ed[_0xe5c8('0x2e')],_0x3487ed[_0xe5c8('0x2b')]);_0x598e46[_0xe5c8('0x2f')]=_[_0xe5c8('0x2d')](_0x3487ed[_0xe5c8('0x2e')],qs['fields'](_0x214b7c[_0xe5c8('0x2b')][_0xe5c8('0x30')]));_0x598e46[_0xe5c8('0x2f')]=_0x598e46['attributes'][_0xe5c8('0x31')]?_0x598e46[_0xe5c8('0x2f')]:_0x3487ed[_0xe5c8('0x2e')];if(!_0x214b7c[_0xe5c8('0x2b')][_0xe5c8('0x32')]('nolimit')){_0x598e46[_0xe5c8('0x19')]=qs[_0xe5c8('0x19')](_0x214b7c[_0xe5c8('0x2b')]['limit']);_0x598e46['offset']=qs['offset'](_0x214b7c[_0xe5c8('0x2b')][_0xe5c8('0x17')]);}_0x598e46[_0xe5c8('0x33')]=qs[_0xe5c8('0x34')](_0x214b7c[_0xe5c8('0x2b')][_0xe5c8('0x34')]);_0x598e46['where']=qs[_0xe5c8('0x2c')](_[_0xe5c8('0x35')](_0x214b7c[_0xe5c8('0x2b')],_0x3487ed[_0xe5c8('0x2c')]),_0xc0502d);if(_0x214b7c[_0xe5c8('0x2b')][_0xe5c8('0x36')]){_0x598e46[_0xe5c8('0x37')]=_[_0xe5c8('0x38')](_0x598e46[_0xe5c8('0x37')],{'$or':_[_0xe5c8('0x27')](_0xc0502d,function(_0x308050){if(_0x308050[_0xe5c8('0x39')]!==_0xe5c8('0x3a')){var _0x153169={};_0x153169[_0x308050[_0xe5c8('0x25')]]={'$like':'%'+_0x214b7c[_0xe5c8('0x2b')][_0xe5c8('0x36')]+'%'};return _0x153169;}})});}_0x598e46=_['merge']({},_0x598e46,_0x214b7c[_0xe5c8('0x3b')]);var _0x74d020={'where':_0x598e46['where']};return db[_0xe5c8('0x28')][_0xe5c8('0x1a')](_0x74d020)[_0xe5c8('0x21')](function(_0x2e88b2){_0xaa191b[_0xe5c8('0x1a')]=_0x2e88b2;if(_0x214b7c[_0xe5c8('0x2b')][_0xe5c8('0x3c')]){_0x598e46[_0xe5c8('0x3d')]=[{'all':!![]}];}return db[_0xe5c8('0x28')][_0xe5c8('0x3e')](_0x598e46);})['then'](function(_0x540935){_0xaa191b[_0xe5c8('0x3f')]=_0x540935;return _0xaa191b;})['then'](respondWithFilteredResult(_0x4738a1,_0x598e46))[_0xe5c8('0x40')](handleError(_0x4738a1,null));};exports[_0xe5c8('0x41')]=function(_0x43240d,_0x470692){var _0x75c3f9={'raw':!![],'where':{'id':_0x43240d[_0xe5c8('0x42')]['id']}},_0x225ad7={};_0x225ad7['model']=_[_0xe5c8('0x43')](db[_0xe5c8('0x28')][_0xe5c8('0x29')]);_0x225ad7['query']=_[_0xe5c8('0x43')](_0x43240d[_0xe5c8('0x2b')]);_0x225ad7[_0xe5c8('0x2c')]=_[_0xe5c8('0x2d')](_0x225ad7[_0xe5c8('0x2e')],_0x225ad7[_0xe5c8('0x2b')]);_0x75c3f9[_0xe5c8('0x2f')]=_[_0xe5c8('0x2d')](_0x225ad7[_0xe5c8('0x2e')],qs[_0xe5c8('0x30')](_0x43240d[_0xe5c8('0x2b')][_0xe5c8('0x30')]));_0x75c3f9[_0xe5c8('0x2f')]=_0x75c3f9[_0xe5c8('0x2f')]['length']?_0x75c3f9[_0xe5c8('0x2f')]:_0x225ad7[_0xe5c8('0x2e')];if(_0x43240d[_0xe5c8('0x2b')][_0xe5c8('0x3c')]){_0x75c3f9[_0xe5c8('0x3d')]=[{'all':!![]}];}_0x75c3f9=_['merge']({},_0x75c3f9,_0x43240d[_0xe5c8('0x3b')]);return db['JscriptyQuestionReport'][_0xe5c8('0x44')](_0x75c3f9)['then'](handleEntityNotFound(_0x470692,null))[_0xe5c8('0x21')](respondWithResult(_0x470692,null))[_0xe5c8('0x40')](handleError(_0x470692,null));};exports['create']=function(_0x18ef93,_0x97308f){return db[_0xe5c8('0x28')][_0xe5c8('0x45')](_0x18ef93['body'],{})[_0xe5c8('0x21')](respondWithResult(_0x97308f,0xc9))[_0xe5c8('0x40')](handleError(_0x97308f,null));};exports['update']=function(_0x3dddab,_0x5c2d23){if(_0x3dddab[_0xe5c8('0x46')]['id']){delete _0x3dddab[_0xe5c8('0x46')]['id'];}return db[_0xe5c8('0x28')][_0xe5c8('0x44')]({'where':{'id':_0x3dddab['params']['id']}})[_0xe5c8('0x21')](handleEntityNotFound(_0x5c2d23,null))[_0xe5c8('0x21')](saveUpdates(_0x3dddab['body'],null))[_0xe5c8('0x21')](respondWithResult(_0x5c2d23,null))['catch'](handleError(_0x5c2d23,null));};exports[_0xe5c8('0x22')]=function(_0x46510d,_0x43600e){return db['JscriptyQuestionReport']['find']({'where':{'id':_0x46510d[_0xe5c8('0x42')]['id']}})[_0xe5c8('0x21')](handleEntityNotFound(_0x43600e,null))[_0xe5c8('0x21')](removeEntity(_0x43600e,null))[_0xe5c8('0x40')](handleError(_0x43600e,null));};exports[_0xe5c8('0x47')]=function(_0x1d8e90,_0x3ba059){return db[_0xe5c8('0x28')][_0xe5c8('0x47')]()[_0xe5c8('0x21')](respondWithResult(_0x3ba059,null))[_0xe5c8('0x40')](handleError(_0x3ba059,null));}; \ No newline at end of file +var _0x8c10=['catch','show','params','length','include','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','update','destroy','then','stack','name','send','index','map','JscriptyQuestionReport','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','nolimit','sort','pick','filter','where','merge','VIRTUAL','includeAll','findAll','rows'];(function(_0xc30f1a,_0x29e364){var _0x8ca57b=function(_0x41d73d){while(--_0x41d73d){_0xc30f1a['push'](_0xc30f1a['shift']());}};_0x8ca57b(++_0x29e364);}(_0x8c10,0x13e));var _0x08c1=function(_0x127a81,_0x522efd){_0x127a81=_0x127a81-0x0;var _0x3709b8=_0x8c10[_0x127a81];return _0x3709b8;};'use strict';var emlformat=require(_0x08c1('0x0'));var rimraf=require(_0x08c1('0x1'));var zipdir=require(_0x08c1('0x2'));var jsonpatch=require(_0x08c1('0x3'));var rp=require(_0x08c1('0x4'));var moment=require(_0x08c1('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x08c1('0x6'));var util=require(_0x08c1('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x08c1('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x08c1('0x9'));var squel=require('squel');var crypto=require(_0x08c1('0xa'));var jsforce=require(_0x08c1('0xb'));var deskjs=require(_0x08c1('0xc'));var toCsv=require(_0x08c1('0x8'));var querystring=require(_0x08c1('0xd'));var Papa=require(_0x08c1('0xe'));var Redis=require(_0x08c1('0xf'));var authService=require(_0x08c1('0x10'));var qs=require(_0x08c1('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x08c1('0x12'));var logger=require(_0x08c1('0x13'))(_0x08c1('0x14'));var utils=require(_0x08c1('0x15'));var config=require(_0x08c1('0x16'));var licenseUtil=require(_0x08c1('0x17'));var db=require(_0x08c1('0x18'))['db'];function respondWithStatusCode(_0x5b9fa7,_0x378613){_0x378613=_0x378613||0xcc;return function(_0x486577){if(_0x486577){return _0x5b9fa7[_0x08c1('0x19')](_0x378613);}return _0x5b9fa7[_0x08c1('0x1a')](_0x378613)[_0x08c1('0x1b')]();};}function respondWithResult(_0xa04262,_0x321584){_0x321584=_0x321584||0xc8;return function(_0x51b44f){if(_0x51b44f){return _0xa04262[_0x08c1('0x1a')](_0x321584)['json'](_0x51b44f);}};}function respondWithFilteredResult(_0x1d7064,_0x36806b){return function(_0x157652){if(_0x157652){var _0x1ad1d5=typeof _0x36806b[_0x08c1('0x1c')]==='undefined'&&typeof _0x36806b[_0x08c1('0x1d')]===_0x08c1('0x1e');var _0x1ec6a3=_0x157652[_0x08c1('0x1f')];var _0x2be16b=_0x1ad1d5?0x0:_0x36806b[_0x08c1('0x1c')];var _0x3ca653=_0x1ad1d5?_0x157652[_0x08c1('0x1f')]:_0x36806b[_0x08c1('0x1c')]+_0x36806b[_0x08c1('0x1d')];var _0x2c67f9;if(_0x3ca653>=_0x1ec6a3){_0x3ca653=_0x1ec6a3;_0x2c67f9=0xc8;}else{_0x2c67f9=0xce;}_0x1d7064[_0x08c1('0x1a')](_0x2c67f9);return _0x1d7064[_0x08c1('0x20')](_0x08c1('0x21'),_0x2be16b+'-'+_0x3ca653+'/'+_0x1ec6a3)[_0x08c1('0x22')](_0x157652);}return null;};}function patchUpdates(_0x23919f){return function(_0x262d43){try{jsonpatch[_0x08c1('0x23')](_0x262d43,_0x23919f,!![]);}catch(_0x32fe9e){return BPromise[_0x08c1('0x24')](_0x32fe9e);}return _0x262d43['save']();};}function saveUpdates(_0x2e7542,_0x20a558){return function(_0x30ff78){if(_0x30ff78){return _0x30ff78[_0x08c1('0x25')](_0x2e7542)['then'](function(_0x523588){return _0x523588;});}return null;};}function removeEntity(_0x38761f,_0x5e71fd){return function(_0x349e2d){if(_0x349e2d){return _0x349e2d[_0x08c1('0x26')]()[_0x08c1('0x27')](function(){_0x38761f[_0x08c1('0x1a')](0xcc)[_0x08c1('0x1b')]();});}};}function handleEntityNotFound(_0x395f51,_0x18419f){return function(_0xd5a1ae){if(!_0xd5a1ae){_0x395f51[_0x08c1('0x19')](0x194);}return _0xd5a1ae;};}function handleError(_0x1a4a4d,_0x4b2395){_0x4b2395=_0x4b2395||0x1f4;return function(_0x382c31){logger['error'](_0x382c31[_0x08c1('0x28')]);if(_0x382c31[_0x08c1('0x29')]){delete _0x382c31[_0x08c1('0x29')];}_0x1a4a4d[_0x08c1('0x1a')](_0x4b2395)[_0x08c1('0x2a')](_0x382c31);};}exports[_0x08c1('0x2b')]=function(_0x66c81f,_0x4faf9a){var _0x46f977={},_0xf3a54d={},_0x5800d1={'count':0x0,'rows':[]};var _0x25fbd7=_[_0x08c1('0x2c')](db[_0x08c1('0x2d')][_0x08c1('0x2e')],function(_0xc68444){return{'name':_0xc68444[_0x08c1('0x2f')],'type':_0xc68444[_0x08c1('0x30')][_0x08c1('0x31')]};});_0xf3a54d['model']=_['map'](_0x25fbd7,'name');_0xf3a54d[_0x08c1('0x32')]=_[_0x08c1('0x33')](_0x66c81f['query']);_0xf3a54d[_0x08c1('0x34')]=_['intersection'](_0xf3a54d[_0x08c1('0x35')],_0xf3a54d[_0x08c1('0x32')]);_0x46f977[_0x08c1('0x36')]=_[_0x08c1('0x37')](_0xf3a54d['model'],qs['fields'](_0x66c81f[_0x08c1('0x32')][_0x08c1('0x38')]));_0x46f977[_0x08c1('0x36')]=_0x46f977[_0x08c1('0x36')]['length']?_0x46f977[_0x08c1('0x36')]:_0xf3a54d['model'];if(!_0x66c81f[_0x08c1('0x32')]['hasOwnProperty'](_0x08c1('0x39'))){_0x46f977[_0x08c1('0x1d')]=qs[_0x08c1('0x1d')](_0x66c81f[_0x08c1('0x32')][_0x08c1('0x1d')]);_0x46f977[_0x08c1('0x1c')]=qs[_0x08c1('0x1c')](_0x66c81f[_0x08c1('0x32')][_0x08c1('0x1c')]);}_0x46f977['order']=qs[_0x08c1('0x3a')](_0x66c81f[_0x08c1('0x32')]['sort']);_0x46f977['where']=qs[_0x08c1('0x34')](_[_0x08c1('0x3b')](_0x66c81f[_0x08c1('0x32')],_0xf3a54d[_0x08c1('0x34')]),_0x25fbd7);if(_0x66c81f[_0x08c1('0x32')][_0x08c1('0x3c')]){_0x46f977[_0x08c1('0x3d')]=_[_0x08c1('0x3e')](_0x46f977[_0x08c1('0x3d')],{'$or':_[_0x08c1('0x2c')](_0x25fbd7,function(_0x32d15b){if(_0x32d15b[_0x08c1('0x30')]!==_0x08c1('0x3f')){var _0x20086c={};_0x20086c[_0x32d15b[_0x08c1('0x29')]]={'$like':'%'+_0x66c81f[_0x08c1('0x32')][_0x08c1('0x3c')]+'%'};return _0x20086c;}})});}_0x46f977=_['merge']({},_0x46f977,_0x66c81f['options']);var _0x52cc17={'where':_0x46f977[_0x08c1('0x3d')]};return db['JscriptyQuestionReport']['count'](_0x52cc17)[_0x08c1('0x27')](function(_0x263cf9){_0x5800d1[_0x08c1('0x1f')]=_0x263cf9;if(_0x66c81f[_0x08c1('0x32')][_0x08c1('0x40')]){_0x46f977['include']=[{'all':!![]}];}return db[_0x08c1('0x2d')][_0x08c1('0x41')](_0x46f977);})['then'](function(_0x5bcb84){_0x5800d1[_0x08c1('0x42')]=_0x5bcb84;return _0x5800d1;})['then'](respondWithFilteredResult(_0x4faf9a,_0x46f977))[_0x08c1('0x43')](handleError(_0x4faf9a,null));};exports[_0x08c1('0x44')]=function(_0x1b781c,_0x43f391){var _0x291df7={'raw':!![],'where':{'id':_0x1b781c[_0x08c1('0x45')]['id']}},_0x3c03ef={};_0x3c03ef['model']=_['keys'](db['JscriptyQuestionReport']['rawAttributes']);_0x3c03ef[_0x08c1('0x32')]=_['keys'](_0x1b781c[_0x08c1('0x32')]);_0x3c03ef[_0x08c1('0x34')]=_['intersection'](_0x3c03ef[_0x08c1('0x35')],_0x3c03ef[_0x08c1('0x32')]);_0x291df7[_0x08c1('0x36')]=_[_0x08c1('0x37')](_0x3c03ef[_0x08c1('0x35')],qs['fields'](_0x1b781c[_0x08c1('0x32')][_0x08c1('0x38')]));_0x291df7[_0x08c1('0x36')]=_0x291df7[_0x08c1('0x36')][_0x08c1('0x46')]?_0x291df7[_0x08c1('0x36')]:_0x3c03ef[_0x08c1('0x35')];if(_0x1b781c['query'][_0x08c1('0x40')]){_0x291df7[_0x08c1('0x47')]=[{'all':!![]}];}_0x291df7=_[_0x08c1('0x3e')]({},_0x291df7,_0x1b781c[_0x08c1('0x48')]);return db[_0x08c1('0x2d')][_0x08c1('0x49')](_0x291df7)[_0x08c1('0x27')](handleEntityNotFound(_0x43f391,null))[_0x08c1('0x27')](respondWithResult(_0x43f391,null))[_0x08c1('0x43')](handleError(_0x43f391,null));};exports['create']=function(_0x650345,_0x28be6f){return db['JscriptyQuestionReport'][_0x08c1('0x4a')](_0x650345['body'],{})['then'](respondWithResult(_0x28be6f,0xc9))[_0x08c1('0x43')](handleError(_0x28be6f,null));};exports[_0x08c1('0x25')]=function(_0x26ad27,_0x30733b){if(_0x26ad27[_0x08c1('0x4b')]['id']){delete _0x26ad27[_0x08c1('0x4b')]['id'];}return db[_0x08c1('0x2d')][_0x08c1('0x49')]({'where':{'id':_0x26ad27[_0x08c1('0x45')]['id']}})['then'](handleEntityNotFound(_0x30733b,null))[_0x08c1('0x27')](saveUpdates(_0x26ad27['body'],null))[_0x08c1('0x27')](respondWithResult(_0x30733b,null))[_0x08c1('0x43')](handleError(_0x30733b,null));};exports['destroy']=function(_0x1dba4d,_0xcac10a){return db[_0x08c1('0x2d')][_0x08c1('0x49')]({'where':{'id':_0x1dba4d[_0x08c1('0x45')]['id']}})['then'](handleEntityNotFound(_0xcac10a,null))[_0x08c1('0x27')](removeEntity(_0xcac10a,null))[_0x08c1('0x43')](handleError(_0xcac10a,null));};exports[_0x08c1('0x4c')]=function(_0x1d9ae1,_0x4fb2ef){return db[_0x08c1('0x2d')][_0x08c1('0x4c')]()[_0x08c1('0x27')](respondWithResult(_0x4fb2ef,null))['catch'](handleError(_0x4fb2ef,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index f834c37..bdbce05 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 _0x5c9a=['path','rimraf','exports','JscriptyQuestionReport','report_jscripty_questions','lodash','util','../../config/logger','moment','request-promise'];(function(_0x310504,_0x26ad95){var _0x5b36d0=function(_0x253f28){while(--_0x253f28){_0x310504['push'](_0x310504['shift']());}};_0x5b36d0(++_0x26ad95);}(_0x5c9a,0x87));var _0xa5c9=function(_0x5678b5,_0x1c4aa8){_0x5678b5=_0x5678b5-0x0;var _0x4c09a5=_0x5c9a[_0x5678b5];return _0x4c09a5;};'use strict';var _=require(_0xa5c9('0x0'));var util=require(_0xa5c9('0x1'));var logger=require(_0xa5c9('0x2'))('api');var moment=require(_0xa5c9('0x3'));var BPromise=require('bluebird');var rp=require(_0xa5c9('0x4'));var fs=require('fs');var path=require(_0xa5c9('0x5'));var rimraf=require(_0xa5c9('0x6'));var config=require('../../config/environment');var attributes=require('./jscriptyQuestionReport.attributes');module[_0xa5c9('0x7')]=function(_0x34d58a,_0x57684a){return _0x34d58a['define'](_0xa5c9('0x8'),attributes,{'tableName':_0xa5c9('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf9cb=['request-promise','path','../../config/environment','./jscriptyQuestionReport.attributes','exports','define','JscriptyQuestionReport','report_jscripty_questions','lodash','util','../../config/logger','api','bluebird'];(function(_0x132d9e,_0x4a0839){var _0x40b733=function(_0x30c113){while(--_0x30c113){_0x132d9e['push'](_0x132d9e['shift']());}};_0x40b733(++_0x4a0839);}(_0xf9cb,0x133));var _0xbf9c=function(_0x166d93,_0x301f09){_0x166d93=_0x166d93-0x0;var _0xba708=_0xf9cb[_0x166d93];return _0xba708;};'use strict';var _=require(_0xbf9c('0x0'));var util=require(_0xbf9c('0x1'));var logger=require(_0xbf9c('0x2'))(_0xbf9c('0x3'));var moment=require('moment');var BPromise=require(_0xbf9c('0x4'));var rp=require(_0xbf9c('0x5'));var fs=require('fs');var path=require(_0xbf9c('0x6'));var rimraf=require('rimraf');var config=require(_0xbf9c('0x7'));var attributes=require(_0xbf9c('0x8'));module[_0xbf9c('0x9')]=function(_0x15906e,_0xe28eaf){return _0x15906e[_0xbf9c('0xa')](_0xbf9c('0xb'),attributes,{'tableName':_0xbf9c('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 b23a8eb..bd89b87 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 _0x5992=['util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','JscriptyQuestionReport,\x20%s,\x20%s','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash'];(function(_0x582244,_0x33f08b){var _0x81f9e4=function(_0x1f63f8){while(--_0x1f63f8){_0x582244['push'](_0x582244['shift']());}};_0x81f9e4(++_0x33f08b);}(_0x5992,0xbf));var _0x2599=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x5992[_0x53ccf2];return _0x5a2964;};'use strict';var _=require(_0x2599('0x0'));var util=require(_0x2599('0x1'));var moment=require(_0x2599('0x2'));var BPromise=require(_0x2599('0x3'));var rs=require(_0x2599('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2599('0x5'))['db'];var utils=require(_0x2599('0x6'));var logger=require(_0x2599('0x7'))(_0x2599('0x8'));var config=require(_0x2599('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x2599('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x14f551,_0x324de8,_0x29bf0c){return new BPromise(function(_0x2cf30c,_0x50a700){return client[_0x2599('0xb')](_0x14f551,_0x29bf0c)[_0x2599('0xc')](function(_0x39bd26){logger[_0x2599('0xd')](_0x2599('0xe'),_0x324de8,'request\x20sent');logger[_0x2599('0xf')](_0x2599('0x10'),_0x324de8,_0x2599('0x11'),JSON[_0x2599('0x12')](_0x39bd26));if(_0x39bd26[_0x2599('0x13')]){if(_0x39bd26[_0x2599('0x13')][_0x2599('0x14')]===0x1f4){logger['error']('JscriptyQuestionReport,\x20%s,\x20%s',_0x324de8,_0x39bd26[_0x2599('0x13')]['message']);return _0x50a700(_0x39bd26['error']['message']);}logger[_0x2599('0x13')](_0x2599('0xe'),_0x324de8,_0x39bd26[_0x2599('0x13')][_0x2599('0x15')]);return _0x2cf30c(_0x39bd26[_0x2599('0x13')][_0x2599('0x15')]);}else{logger[_0x2599('0xd')](_0x2599('0xe'),_0x324de8,_0x2599('0x11'));_0x2cf30c(_0x39bd26[_0x2599('0x16')][_0x2599('0x15')]);}})[_0x2599('0x17')](function(_0x50f400){logger[_0x2599('0x13')](_0x2599('0xe'),_0x324de8,_0x50f400);_0x50a700(_0x50f400);});});} \ No newline at end of file +var _0x754d=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','request\x20sent','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','JscriptyQuestionReport,\x20%s,\x20%s','message','result','lodash','util','bluebird','ioredis'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x754d,0xe3));var _0xd754=function(_0x3ec032,_0x50c519){_0x3ec032=_0x3ec032-0x0;var _0x228f84=_0x754d[_0x3ec032];return _0x228f84;};'use strict';var _=require(_0xd754('0x0'));var util=require(_0xd754('0x1'));var moment=require('moment');var BPromise=require(_0xd754('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd754('0x3'));var db=require(_0xd754('0x4'))['db'];var utils=require(_0xd754('0x5'));var logger=require(_0xd754('0x6'))(_0xd754('0x7'));var config=require('../../config/environment');var jayson=require(_0xd754('0x8'));var client=jayson[_0xd754('0x9')][_0xd754('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf9f293,_0x302ed5,_0x4c9708){return new BPromise(function(_0x39e1d2,_0x37e700){return client[_0xd754('0xb')](_0xf9f293,_0x4c9708)['then'](function(_0x24983d){logger[_0xd754('0xc')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x302ed5,_0xd754('0xd'));logger['debug'](_0xd754('0xe'),_0x302ed5,_0xd754('0xd'),JSON[_0xd754('0xf')](_0x24983d));if(_0x24983d[_0xd754('0x10')]){if(_0x24983d['error'][_0xd754('0x11')]===0x1f4){logger[_0xd754('0x10')](_0xd754('0x12'),_0x302ed5,_0x24983d['error']['message']);return _0x37e700(_0x24983d[_0xd754('0x10')]['message']);}logger['error']('JscriptyQuestionReport,\x20%s,\x20%s',_0x302ed5,_0x24983d[_0xd754('0x10')][_0xd754('0x13')]);return _0x39e1d2(_0x24983d[_0xd754('0x10')][_0xd754('0x13')]);}else{logger[_0xd754('0xc')](_0xd754('0x12'),_0x302ed5,_0xd754('0xd'));_0x39e1d2(_0x24983d[_0xd754('0x14')][_0xd754('0x13')]);}})['catch'](function(_0x54328a){logger[_0xd754('0x10')](_0xd754('0x12'),_0x302ed5,_0x54328a);_0x37e700(_0x54328a);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index a8d6834..791b525 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 _0xca98=['../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/questions','getQuestions','post','create','update','destroy','exports','util','connect-timeout','fs-extra','../../components/auth/service'];(function(_0x3c51d4,_0x36ba53){var _0x53c45f=function(_0x3d6683){while(--_0x3d6683){_0x3c51d4['push'](_0x3c51d4['shift']());}};_0x53c45f(++_0x36ba53);}(_0xca98,0x1b4));var _0x8ca9=function(_0x594ece,_0x2a1f27){_0x594ece=_0x594ece-0x0;var _0x471bc4=_0xca98[_0x594ece];return _0x471bc4;};'use strict';var multer=require('multer');var util=require(_0x8ca9('0x0'));var path=require('path');var timeout=require(_0x8ca9('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x8ca9('0x2'));var auth=require(_0x8ca9('0x3'));var interaction=require(_0x8ca9('0x4'));var config=require(_0x8ca9('0x5'));var controller=require(_0x8ca9('0x6'));router[_0x8ca9('0x7')]('/',auth[_0x8ca9('0x8')](),controller['index']);router[_0x8ca9('0x7')](_0x8ca9('0x9'),auth['isAuthenticated'](),controller[_0x8ca9('0xa')]);router[_0x8ca9('0x7')](_0x8ca9('0xb'),auth[_0x8ca9('0x8')](),controller[_0x8ca9('0xc')]);router['get'](_0x8ca9('0xd'),auth[_0x8ca9('0x8')](),controller[_0x8ca9('0xe')]);router[_0x8ca9('0xf')]('/',auth[_0x8ca9('0x8')](),controller[_0x8ca9('0x10')]);router['put'](_0x8ca9('0xb'),auth[_0x8ca9('0x8')](),controller[_0x8ca9('0x11')]);router['delete'](_0x8ca9('0xb'),auth[_0x8ca9('0x8')](),controller[_0x8ca9('0x12')]);module[_0x8ca9('0x13')]=router; \ No newline at end of file +var _0x4393=['exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/questions','post','create','put','update','delete'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x4393,0xdd));var _0x3439=function(_0x372004,_0x503f88){_0x372004=_0x372004-0x0;var _0x213de1=_0x4393[_0x372004];return _0x213de1;};'use strict';var multer=require('multer');var util=require(_0x3439('0x0'));var path=require(_0x3439('0x1'));var timeout=require(_0x3439('0x2'));var express=require(_0x3439('0x3'));var router=express[_0x3439('0x4')]();var fs_extra=require(_0x3439('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x3439('0x6'));var config=require(_0x3439('0x7'));var controller=require(_0x3439('0x8'));router[_0x3439('0x9')]('/',auth[_0x3439('0xa')](),controller[_0x3439('0xb')]);router[_0x3439('0x9')](_0x3439('0xc'),auth[_0x3439('0xa')](),controller[_0x3439('0xd')]);router[_0x3439('0x9')](_0x3439('0xe'),auth['isAuthenticated'](),controller['show']);router['get'](_0x3439('0xf'),auth[_0x3439('0xa')](),controller['getQuestions']);router[_0x3439('0x10')]('/',auth[_0x3439('0xa')](),controller[_0x3439('0x11')]);router[_0x3439('0x12')]('/:id',auth[_0x3439('0xa')](),controller[_0x3439('0x13')]);router[_0x3439('0x14')](_0x3439('0xe'),auth[_0x3439('0xa')](),controller['destroy']);module[_0x3439('0x15')]=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index 082ae6f..85af32a 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 _0xacfd=['STRING','BOOLEAN','moment','sequelize','DATE','setDataValue','starttime','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x3f267c,_0x150415){var _0x124815=function(_0x1003e2){while(--_0x1003e2){_0x3f267c['push'](_0x3f267c['shift']());}};_0x124815(++_0x150415);}(_0xacfd,0x119));var _0xdacf=function(_0x13d758,_0x38e1fc){_0x13d758=_0x13d758-0x0;var _0x4147f6=_0xacfd[_0x13d758];return _0x4147f6;};'use strict';var moment=require(_0xdacf('0x0'));var Sequelize=require(_0xdacf('0x1'));module['exports']={'starttime':{'type':Sequelize[_0xdacf('0x2')],'set':function(_0x4f227c){this[_0xdacf('0x3')](_0xdacf('0x4'),_0x4f227c);this[_0xdacf('0x3')]('endtime',moment()[_0xdacf('0x5')](_0xdacf('0x6')));}},'endtime':{'type':Sequelize[_0xdacf('0x2')]},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize[_0xdacf('0x7')]},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xdacf('0x7')]},'calleridnum':{'type':Sequelize[_0xdacf('0x7')]},'completed':{'type':Sequelize[_0xdacf('0x8')],'defaultValue':![]}}; \ No newline at end of file +var _0x311b=['endtime','format','YYYY-MM-DD\x20HH:mm:ss','STRING','BOOLEAN','moment','sequelize','DATE','starttime','setDataValue'];(function(_0x327826,_0x33f699){var _0x23361=function(_0x3da715){while(--_0x3da715){_0x327826['push'](_0x327826['shift']());}};_0x23361(++_0x33f699);}(_0x311b,0x13b));var _0xb311=function(_0x8cc7c,_0x591379){_0x8cc7c=_0x8cc7c-0x0;var _0x404b40=_0x311b[_0x8cc7c];return _0x404b40;};'use strict';var moment=require(_0xb311('0x0'));var Sequelize=require(_0xb311('0x1'));module['exports']={'starttime':{'type':Sequelize[_0xb311('0x2')],'set':function(_0x326508){this['setDataValue'](_0xb311('0x3'),_0x326508);this[_0xb311('0x4')](_0xb311('0x5'),moment()[_0xb311('0x6')](_0xb311('0x7')));}},'endtime':{'type':Sequelize['DATE']},'membername':{'type':Sequelize[_0xb311('0x8')]},'projectname':{'type':Sequelize[_0xb311('0x8')]},'queue':{'type':Sequelize[_0xb311('0x8')]},'uniqueid':{'type':Sequelize[_0xb311('0x8')]},'calleridname':{'type':Sequelize[_0xb311('0x8')]},'calleridnum':{'type':Sequelize['STRING']},'completed':{'type':Sequelize[_0xb311('0x9')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index 67fe5b8..13e31f6 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 _0x6f79=['JscriptySessionReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','describe','JscriptyQuestionReport','sort','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','map'];(function(_0x545da4,_0x1503c2){var _0xeed53f=function(_0x51c725){while(--_0x51c725){_0x545da4['push'](_0x545da4['shift']());}};_0xeed53f(++_0x1503c2);}(_0x6f79,0x15a));var _0x96f7=function(_0x299f9a,_0x122c49){_0x299f9a=_0x299f9a-0x0;var _0x5bec96=_0x6f79[_0x299f9a];return _0x5bec96;};'use strict';var emlformat=require(_0x96f7('0x0'));var rimraf=require(_0x96f7('0x1'));var zipdir=require(_0x96f7('0x2'));var jsonpatch=require(_0x96f7('0x3'));var rp=require(_0x96f7('0x4'));var moment=require(_0x96f7('0x5'));var BPromise=require(_0x96f7('0x6'));var Mustache=require(_0x96f7('0x7'));var util=require(_0x96f7('0x8'));var path=require(_0x96f7('0x9'));var sox=require(_0x96f7('0xa'));var csv=require(_0x96f7('0xb'));var ejs=require(_0x96f7('0xc'));var fs=require('fs');var fs_extra=require(_0x96f7('0xd'));var _=require(_0x96f7('0xe'));var squel=require('squel');var crypto=require(_0x96f7('0xf'));var jsforce=require(_0x96f7('0x10'));var deskjs=require(_0x96f7('0x11'));var toCsv=require(_0x96f7('0xb'));var querystring=require(_0x96f7('0x12'));var Papa=require('papaparse');var Redis=require(_0x96f7('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x96f7('0x14'));var hardwareService=require(_0x96f7('0x15'));var logger=require(_0x96f7('0x16'))(_0x96f7('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2fa821,_0x46218c){_0x46218c=_0x46218c||0xcc;return function(_0x36a666){if(_0x36a666){return _0x2fa821[_0x96f7('0x18')](_0x46218c);}return _0x2fa821[_0x96f7('0x19')](_0x46218c)[_0x96f7('0x1a')]();};}function respondWithResult(_0x1bcd6e,_0x2fd96b){_0x2fd96b=_0x2fd96b||0xc8;return function(_0x5ec6ec){if(_0x5ec6ec){return _0x1bcd6e['status'](_0x2fd96b)[_0x96f7('0x1b')](_0x5ec6ec);}};}function respondWithFilteredResult(_0x8413f5,_0xb37fc5){return function(_0x7d5189){if(_0x7d5189){var _0x30e787=typeof _0xb37fc5[_0x96f7('0x1c')]===_0x96f7('0x1d')&&typeof _0xb37fc5[_0x96f7('0x1e')]==='undefined';var _0x303584=_0x7d5189[_0x96f7('0x1f')];var _0x3cf27f=_0x30e787?0x0:_0xb37fc5[_0x96f7('0x1c')];var _0x171926=_0x30e787?_0x7d5189[_0x96f7('0x1f')]:_0xb37fc5[_0x96f7('0x1c')]+_0xb37fc5[_0x96f7('0x1e')];var _0x4a8e56;if(_0x171926>=_0x303584){_0x171926=_0x303584;_0x4a8e56=0xc8;}else{_0x4a8e56=0xce;}_0x8413f5['status'](_0x4a8e56);return _0x8413f5[_0x96f7('0x20')](_0x96f7('0x21'),_0x3cf27f+'-'+_0x171926+'/'+_0x303584)[_0x96f7('0x1b')](_0x7d5189);}return null;};}function patchUpdates(_0x1c638f){return function(_0x5e33bf){try{jsonpatch[_0x96f7('0x22')](_0x5e33bf,_0x1c638f,!![]);}catch(_0x292838){return BPromise[_0x96f7('0x23')](_0x292838);}return _0x5e33bf['save']();};}function saveUpdates(_0xb5fd55,_0x37d3a9){return function(_0x381478){if(_0x381478){return _0x381478[_0x96f7('0x24')](_0xb5fd55)[_0x96f7('0x25')](function(_0x2208d0){return _0x2208d0;});}return null;};}function removeEntity(_0x3d987a,_0x4c3491){return function(_0x161d33){if(_0x161d33){return _0x161d33[_0x96f7('0x26')]()['then'](function(){_0x3d987a[_0x96f7('0x19')](0xcc)[_0x96f7('0x1a')]();});}};}function handleEntityNotFound(_0x2bb92e,_0x2c4fbf){return function(_0x2e37ac){if(!_0x2e37ac){_0x2bb92e[_0x96f7('0x18')](0x194);}return _0x2e37ac;};}function handleError(_0x49e0ab,_0x852008){_0x852008=_0x852008||0x1f4;return function(_0x1a9be8){logger[_0x96f7('0x27')](_0x1a9be8[_0x96f7('0x28')]);if(_0x1a9be8[_0x96f7('0x29')]){delete _0x1a9be8['name'];}_0x49e0ab['status'](_0x852008)[_0x96f7('0x2a')](_0x1a9be8);};}exports['index']=function(_0x36cb33,_0x4b13c5){var _0x890767={},_0x24f65b={},_0x329e98={'count':0x0,'rows':[]};var _0x65ae47=_[_0x96f7('0x2b')](db[_0x96f7('0x2c')][_0x96f7('0x2d')],function(_0x510611){return{'name':_0x510611[_0x96f7('0x2e')],'type':_0x510611[_0x96f7('0x2f')][_0x96f7('0x30')]};});_0x24f65b[_0x96f7('0x31')]=_[_0x96f7('0x2b')](_0x65ae47,_0x96f7('0x29'));_0x24f65b['query']=_[_0x96f7('0x32')](_0x36cb33[_0x96f7('0x33')]);_0x24f65b[_0x96f7('0x34')]=_[_0x96f7('0x35')](_0x24f65b[_0x96f7('0x31')],_0x24f65b[_0x96f7('0x33')]);_0x890767[_0x96f7('0x36')]=_[_0x96f7('0x35')](_0x24f65b[_0x96f7('0x31')],qs[_0x96f7('0x37')](_0x36cb33[_0x96f7('0x33')][_0x96f7('0x37')]));_0x890767[_0x96f7('0x36')]=_0x890767['attributes'][_0x96f7('0x38')]?_0x890767[_0x96f7('0x36')]:_0x24f65b[_0x96f7('0x31')];if(!_0x36cb33[_0x96f7('0x33')][_0x96f7('0x39')](_0x96f7('0x3a'))){_0x890767[_0x96f7('0x1e')]=qs[_0x96f7('0x1e')](_0x36cb33[_0x96f7('0x33')][_0x96f7('0x1e')]);_0x890767[_0x96f7('0x1c')]=qs[_0x96f7('0x1c')](_0x36cb33[_0x96f7('0x33')][_0x96f7('0x1c')]);}_0x890767[_0x96f7('0x3b')]=qs['sort'](_0x36cb33[_0x96f7('0x33')]['sort']);_0x890767[_0x96f7('0x3c')]=qs[_0x96f7('0x34')](_[_0x96f7('0x3d')](_0x36cb33[_0x96f7('0x33')],_0x24f65b[_0x96f7('0x34')]),_0x65ae47);if(_0x36cb33[_0x96f7('0x33')][_0x96f7('0x3e')]){_0x890767[_0x96f7('0x3c')]=_[_0x96f7('0x3f')](_0x890767[_0x96f7('0x3c')],{'$or':_[_0x96f7('0x2b')](_0x65ae47,function(_0x11aef5){if(_0x11aef5[_0x96f7('0x2f')]!=='VIRTUAL'){var _0x30781d={};_0x30781d[_0x11aef5[_0x96f7('0x29')]]={'$like':'%'+_0x36cb33[_0x96f7('0x33')][_0x96f7('0x3e')]+'%'};return _0x30781d;}})});}_0x890767=_['merge']({},_0x890767,_0x36cb33[_0x96f7('0x40')]);var _0x149306={'where':_0x890767['where']};return db['JscriptySessionReport'][_0x96f7('0x1f')](_0x149306)[_0x96f7('0x25')](function(_0x4f77d4){_0x329e98[_0x96f7('0x1f')]=_0x4f77d4;if(_0x36cb33[_0x96f7('0x33')][_0x96f7('0x41')]){_0x890767[_0x96f7('0x42')]=[{'all':!![]}];}return db[_0x96f7('0x2c')][_0x96f7('0x43')](_0x890767);})[_0x96f7('0x25')](function(_0x3753b1){_0x329e98[_0x96f7('0x44')]=_0x3753b1;return _0x329e98;})[_0x96f7('0x25')](respondWithFilteredResult(_0x4b13c5,_0x890767))[_0x96f7('0x45')](handleError(_0x4b13c5,null));};exports[_0x96f7('0x46')]=function(_0x51d433,_0x363836){var _0x2f0ae8={'raw':!![],'where':{'id':_0x51d433['params']['id']}},_0x2ad796={};_0x2ad796['model']=_['keys'](db[_0x96f7('0x2c')]['rawAttributes']);_0x2ad796['query']=_[_0x96f7('0x32')](_0x51d433[_0x96f7('0x33')]);_0x2ad796[_0x96f7('0x34')]=_[_0x96f7('0x35')](_0x2ad796[_0x96f7('0x31')],_0x2ad796['query']);_0x2f0ae8[_0x96f7('0x36')]=_['intersection'](_0x2ad796[_0x96f7('0x31')],qs[_0x96f7('0x37')](_0x51d433[_0x96f7('0x33')][_0x96f7('0x37')]));_0x2f0ae8['attributes']=_0x2f0ae8[_0x96f7('0x36')][_0x96f7('0x38')]?_0x2f0ae8[_0x96f7('0x36')]:_0x2ad796[_0x96f7('0x31')];if(_0x51d433[_0x96f7('0x33')][_0x96f7('0x41')]){_0x2f0ae8[_0x96f7('0x42')]=[{'all':!![]}];}_0x2f0ae8=_[_0x96f7('0x3f')]({},_0x2f0ae8,_0x51d433[_0x96f7('0x40')]);return db[_0x96f7('0x2c')][_0x96f7('0x47')](_0x2f0ae8)['then'](handleEntityNotFound(_0x363836,null))[_0x96f7('0x25')](respondWithResult(_0x363836,null))[_0x96f7('0x45')](handleError(_0x363836,null));};exports[_0x96f7('0x48')]=function(_0x24fc85,_0x1a09f2){return db[_0x96f7('0x2c')][_0x96f7('0x48')](_0x24fc85[_0x96f7('0x49')],{})[_0x96f7('0x25')](respondWithResult(_0x1a09f2,0xc9))[_0x96f7('0x45')](handleError(_0x1a09f2,null));};exports['update']=function(_0x24dddc,_0x20413b){if(_0x24dddc['body']['id']){delete _0x24dddc[_0x96f7('0x49')]['id'];}return db['JscriptySessionReport'][_0x96f7('0x47')]({'where':{'id':_0x24dddc['params']['id']}})[_0x96f7('0x25')](handleEntityNotFound(_0x20413b,null))[_0x96f7('0x25')](saveUpdates(_0x24dddc[_0x96f7('0x49')],null))['then'](respondWithResult(_0x20413b,null))['catch'](handleError(_0x20413b,null));};exports[_0x96f7('0x26')]=function(_0x1144ca,_0x396865){return db['JscriptySessionReport']['find']({'where':{'id':_0x1144ca[_0x96f7('0x4a')]['id']}})['then'](handleEntityNotFound(_0x396865,null))[_0x96f7('0x25')](removeEntity(_0x396865,null))[_0x96f7('0x45')](handleError(_0x396865,null));};exports[_0x96f7('0x4b')]=function(_0x5e011a,_0x1fc531){return db[_0x96f7('0x2c')][_0x96f7('0x4b')]()['then'](respondWithResult(_0x1fc531,null))[_0x96f7('0x45')](handleError(_0x1fc531,null));};exports['getQuestions']=function(_0x5e0ccb,_0x435422,_0x48514d){var _0x339323={'raw':!![],'where':{}};var _0x1df40b={};var _0x2d5c44={'count':0x0,'rows':[]};return db['JscriptySessionReport']['findOne']({'where':{'id':_0x5e0ccb[_0x96f7('0x4a')]['id']}})[_0x96f7('0x25')](handleEntityNotFound(_0x435422,null))['then'](function(_0x3c06ec){if(_0x3c06ec){_0x1df40b[_0x96f7('0x31')]=_[_0x96f7('0x32')](db[_0x96f7('0x4c')][_0x96f7('0x2d')]);_0x1df40b[_0x96f7('0x33')]=_[_0x96f7('0x32')](_0x5e0ccb[_0x96f7('0x33')]);_0x1df40b[_0x96f7('0x34')]=_[_0x96f7('0x35')](_0x1df40b[_0x96f7('0x31')],_0x1df40b[_0x96f7('0x33')]);_0x339323[_0x96f7('0x36')]=_[_0x96f7('0x35')](_0x1df40b[_0x96f7('0x31')],qs[_0x96f7('0x37')](_0x5e0ccb[_0x96f7('0x33')][_0x96f7('0x37')]));_0x339323[_0x96f7('0x36')]=_0x339323[_0x96f7('0x36')][_0x96f7('0x38')]?_0x339323[_0x96f7('0x36')]:_0x1df40b[_0x96f7('0x31')];if(!_0x5e0ccb[_0x96f7('0x33')][_0x96f7('0x39')](_0x96f7('0x3a'))){_0x339323[_0x96f7('0x1e')]=qs[_0x96f7('0x1e')](_0x5e0ccb[_0x96f7('0x33')][_0x96f7('0x1e')]);_0x339323[_0x96f7('0x1c')]=qs[_0x96f7('0x1c')](_0x5e0ccb[_0x96f7('0x33')][_0x96f7('0x1c')]);}_0x339323[_0x96f7('0x3b')]=qs[_0x96f7('0x4d')](_0x5e0ccb[_0x96f7('0x33')]['sort']);_0x339323[_0x96f7('0x3c')]=qs[_0x96f7('0x34')](_[_0x96f7('0x3d')](_0x5e0ccb['query'],_0x1df40b[_0x96f7('0x34')]));_0x339323[_0x96f7('0x3c')]['SessionId']=_0x3c06ec['id'];if(_0x5e0ccb[_0x96f7('0x33')][_0x96f7('0x3e')]){_0x339323[_0x96f7('0x3c')]=_[_0x96f7('0x3f')](_0x339323[_0x96f7('0x3c')],{'$or':_[_0x96f7('0x2b')](_0x339323[_0x96f7('0x36')],function(_0x311fa6){var _0x495039={};_0x495039[_0x311fa6]={'$like':'%'+_0x5e0ccb[_0x96f7('0x33')][_0x96f7('0x3e')]+'%'};return _0x495039;})});}_0x339323=_[_0x96f7('0x3f')]({},_0x339323,_0x5e0ccb['options']);return db['JscriptyQuestionReport'][_0x96f7('0x1f')]({'where':_0x339323[_0x96f7('0x3c')]})[_0x96f7('0x25')](function(_0x87db0f){_0x2d5c44[_0x96f7('0x1f')]=_0x87db0f;if(_0x5e0ccb[_0x96f7('0x33')][_0x96f7('0x41')]){_0x339323[_0x96f7('0x42')]=[{'all':!![]}];}return db[_0x96f7('0x4c')][_0x96f7('0x43')](_0x339323);})[_0x96f7('0x25')](function(_0x3af18e){_0x2d5c44[_0x96f7('0x44')]=_0x3af18e;return _0x2d5c44;});}})['then'](respondWithFilteredResult(_0x435422,_0x339323))[_0x96f7('0x45')](handleError(_0x435422,null));}; \ No newline at end of file +var _0x95a2=['request-promise','moment','bluebird','mustache','util','path','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','undefined','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','error','stack','name','map','JscriptySessionReport','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','fields','length','nolimit','sort','where','filter','merge','includeAll','include','findAll','rows','catch','intersection','find','create','body','params','describe','getQuestions','findOne','JscriptyQuestionReport','hasOwnProperty','order','pick','SessionId','options','rimraf','zip-dir'];(function(_0x2e7a45,_0x48960d){var _0x3eaeff=function(_0x269d72){while(--_0x269d72){_0x2e7a45['push'](_0x2e7a45['shift']());}};_0x3eaeff(++_0x48960d);}(_0x95a2,0x1d2));var _0x295a=function(_0x5a60ce,_0x48f080){_0x5a60ce=_0x5a60ce-0x0;var _0x393e5e=_0x95a2[_0x5a60ce];return _0x393e5e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x295a('0x0'));var zipdir=require(_0x295a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x295a('0x2'));var moment=require(_0x295a('0x3'));var BPromise=require(_0x295a('0x4'));var Mustache=require(_0x295a('0x5'));var util=require(_0x295a('0x6'));var path=require(_0x295a('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x295a('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x295a('0x9'));var crypto=require(_0x295a('0xa'));var jsforce=require(_0x295a('0xb'));var deskjs=require(_0x295a('0xc'));var toCsv=require('to-csv');var querystring=require(_0x295a('0xd'));var Papa=require(_0x295a('0xe'));var Redis=require(_0x295a('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x295a('0x10'));var as=require(_0x295a('0x11'));var hardwareService=require(_0x295a('0x12'));var logger=require('../../config/logger')(_0x295a('0x13'));var utils=require(_0x295a('0x14'));var config=require(_0x295a('0x15'));var licenseUtil=require(_0x295a('0x16'));var db=require(_0x295a('0x17'))['db'];function respondWithStatusCode(_0x4ad121,_0x50eb54){_0x50eb54=_0x50eb54||0xcc;return function(_0x36fe35){if(_0x36fe35){return _0x4ad121['sendStatus'](_0x50eb54);}return _0x4ad121[_0x295a('0x18')](_0x50eb54)[_0x295a('0x19')]();};}function respondWithResult(_0x549eb1,_0x27c50d){_0x27c50d=_0x27c50d||0xc8;return function(_0x5ec284){if(_0x5ec284){return _0x549eb1[_0x295a('0x18')](_0x27c50d)['json'](_0x5ec284);}};}function respondWithFilteredResult(_0x39aac2,_0x2f8e28){return function(_0x39fb75){if(_0x39fb75){var _0x4cf09a=typeof _0x2f8e28['offset']==='undefined'&&typeof _0x2f8e28['limit']===_0x295a('0x1a');var _0x376107=_0x39fb75[_0x295a('0x1b')];var _0x1d663f=_0x4cf09a?0x0:_0x2f8e28['offset'];var _0x344579=_0x4cf09a?_0x39fb75[_0x295a('0x1b')]:_0x2f8e28[_0x295a('0x1c')]+_0x2f8e28[_0x295a('0x1d')];var _0x4f63e3;if(_0x344579>=_0x376107){_0x344579=_0x376107;_0x4f63e3=0xc8;}else{_0x4f63e3=0xce;}_0x39aac2[_0x295a('0x18')](_0x4f63e3);return _0x39aac2[_0x295a('0x1e')](_0x295a('0x1f'),_0x1d663f+'-'+_0x344579+'/'+_0x376107)[_0x295a('0x20')](_0x39fb75);}return null;};}function patchUpdates(_0x3ad16c){return function(_0x274ba9){try{jsonpatch[_0x295a('0x21')](_0x274ba9,_0x3ad16c,!![]);}catch(_0x169bfa){return BPromise[_0x295a('0x22')](_0x169bfa);}return _0x274ba9[_0x295a('0x23')]();};}function saveUpdates(_0x57a98f,_0xdab6ca){return function(_0x185a44){if(_0x185a44){return _0x185a44[_0x295a('0x24')](_0x57a98f)[_0x295a('0x25')](function(_0x3bb839){return _0x3bb839;});}return null;};}function removeEntity(_0x39aad4,_0xd0a70){return function(_0x348f1c){if(_0x348f1c){return _0x348f1c['destroy']()[_0x295a('0x25')](function(){_0x39aad4[_0x295a('0x18')](0xcc)[_0x295a('0x19')]();});}};}function handleEntityNotFound(_0x15cf65,_0x355457){return function(_0x4db7fc){if(!_0x4db7fc){_0x15cf65['sendStatus'](0x194);}return _0x4db7fc;};}function handleError(_0x5a1b22,_0x3043ca){_0x3043ca=_0x3043ca||0x1f4;return function(_0x269fb3){logger[_0x295a('0x26')](_0x269fb3[_0x295a('0x27')]);if(_0x269fb3[_0x295a('0x28')]){delete _0x269fb3['name'];}_0x5a1b22['status'](_0x3043ca)['send'](_0x269fb3);};}exports['index']=function(_0x2cc323,_0xc282a7){var _0x378aed={},_0xd22942={},_0x4b34f1={'count':0x0,'rows':[]};var _0x730afe=_[_0x295a('0x29')](db[_0x295a('0x2a')][_0x295a('0x2b')],function(_0x3f4d1b){return{'name':_0x3f4d1b[_0x295a('0x2c')],'type':_0x3f4d1b[_0x295a('0x2d')][_0x295a('0x2e')]};});_0xd22942['model']=_[_0x295a('0x29')](_0x730afe,_0x295a('0x28'));_0xd22942[_0x295a('0x2f')]=_[_0x295a('0x30')](_0x2cc323[_0x295a('0x2f')]);_0xd22942[_0x295a('0x31')]=_['intersection'](_0xd22942[_0x295a('0x32')],_0xd22942[_0x295a('0x2f')]);_0x378aed[_0x295a('0x33')]=_['intersection'](_0xd22942[_0x295a('0x32')],qs[_0x295a('0x34')](_0x2cc323['query']['fields']));_0x378aed[_0x295a('0x33')]=_0x378aed[_0x295a('0x33')][_0x295a('0x35')]?_0x378aed['attributes']:_0xd22942['model'];if(!_0x2cc323['query']['hasOwnProperty'](_0x295a('0x36'))){_0x378aed['limit']=qs[_0x295a('0x1d')](_0x2cc323['query']['limit']);_0x378aed[_0x295a('0x1c')]=qs[_0x295a('0x1c')](_0x2cc323['query']['offset']);}_0x378aed['order']=qs[_0x295a('0x37')](_0x2cc323['query'][_0x295a('0x37')]);_0x378aed[_0x295a('0x38')]=qs['filters'](_['pick'](_0x2cc323[_0x295a('0x2f')],_0xd22942[_0x295a('0x31')]),_0x730afe);if(_0x2cc323[_0x295a('0x2f')][_0x295a('0x39')]){_0x378aed[_0x295a('0x38')]=_[_0x295a('0x3a')](_0x378aed[_0x295a('0x38')],{'$or':_['map'](_0x730afe,function(_0x44b250){if(_0x44b250[_0x295a('0x2d')]!=='VIRTUAL'){var _0x378ee3={};_0x378ee3[_0x44b250[_0x295a('0x28')]]={'$like':'%'+_0x2cc323[_0x295a('0x2f')][_0x295a('0x39')]+'%'};return _0x378ee3;}})});}_0x378aed=_['merge']({},_0x378aed,_0x2cc323['options']);var _0x3136c0={'where':_0x378aed['where']};return db[_0x295a('0x2a')][_0x295a('0x1b')](_0x3136c0)['then'](function(_0xb8ef82){_0x4b34f1[_0x295a('0x1b')]=_0xb8ef82;if(_0x2cc323['query'][_0x295a('0x3b')]){_0x378aed[_0x295a('0x3c')]=[{'all':!![]}];}return db[_0x295a('0x2a')][_0x295a('0x3d')](_0x378aed);})[_0x295a('0x25')](function(_0x426872){_0x4b34f1[_0x295a('0x3e')]=_0x426872;return _0x4b34f1;})[_0x295a('0x25')](respondWithFilteredResult(_0xc282a7,_0x378aed))[_0x295a('0x3f')](handleError(_0xc282a7,null));};exports['show']=function(_0x216dd9,_0x15aebb){var _0x22c73b={'raw':!![],'where':{'id':_0x216dd9['params']['id']}},_0x41b91b={};_0x41b91b[_0x295a('0x32')]=_[_0x295a('0x30')](db['JscriptySessionReport']['rawAttributes']);_0x41b91b['query']=_['keys'](_0x216dd9[_0x295a('0x2f')]);_0x41b91b[_0x295a('0x31')]=_[_0x295a('0x40')](_0x41b91b[_0x295a('0x32')],_0x41b91b['query']);_0x22c73b[_0x295a('0x33')]=_['intersection'](_0x41b91b['model'],qs[_0x295a('0x34')](_0x216dd9[_0x295a('0x2f')][_0x295a('0x34')]));_0x22c73b[_0x295a('0x33')]=_0x22c73b[_0x295a('0x33')]['length']?_0x22c73b[_0x295a('0x33')]:_0x41b91b['model'];if(_0x216dd9[_0x295a('0x2f')][_0x295a('0x3b')]){_0x22c73b[_0x295a('0x3c')]=[{'all':!![]}];}_0x22c73b=_['merge']({},_0x22c73b,_0x216dd9['options']);return db[_0x295a('0x2a')][_0x295a('0x41')](_0x22c73b)['then'](handleEntityNotFound(_0x15aebb,null))[_0x295a('0x25')](respondWithResult(_0x15aebb,null))[_0x295a('0x3f')](handleError(_0x15aebb,null));};exports['create']=function(_0x4f59d6,_0x35dd87){return db[_0x295a('0x2a')][_0x295a('0x42')](_0x4f59d6[_0x295a('0x43')],{})[_0x295a('0x25')](respondWithResult(_0x35dd87,0xc9))[_0x295a('0x3f')](handleError(_0x35dd87,null));};exports[_0x295a('0x24')]=function(_0x3ee780,_0x4efd0d){if(_0x3ee780['body']['id']){delete _0x3ee780[_0x295a('0x43')]['id'];}return db['JscriptySessionReport']['find']({'where':{'id':_0x3ee780['params']['id']}})['then'](handleEntityNotFound(_0x4efd0d,null))['then'](saveUpdates(_0x3ee780[_0x295a('0x43')],null))[_0x295a('0x25')](respondWithResult(_0x4efd0d,null))[_0x295a('0x3f')](handleError(_0x4efd0d,null));};exports['destroy']=function(_0x4920c1,_0x8cb421){return db[_0x295a('0x2a')][_0x295a('0x41')]({'where':{'id':_0x4920c1[_0x295a('0x44')]['id']}})[_0x295a('0x25')](handleEntityNotFound(_0x8cb421,null))['then'](removeEntity(_0x8cb421,null))[_0x295a('0x3f')](handleError(_0x8cb421,null));};exports[_0x295a('0x45')]=function(_0x4c2327,_0x46da62){return db[_0x295a('0x2a')]['describe']()[_0x295a('0x25')](respondWithResult(_0x46da62,null))['catch'](handleError(_0x46da62,null));};exports[_0x295a('0x46')]=function(_0x35d0a4,_0x1f281f,_0x5d10d5){var _0x4888b7={'raw':!![],'where':{}};var _0x2ed7ab={};var _0x2949a7={'count':0x0,'rows':[]};return db[_0x295a('0x2a')][_0x295a('0x47')]({'where':{'id':_0x35d0a4[_0x295a('0x44')]['id']}})[_0x295a('0x25')](handleEntityNotFound(_0x1f281f,null))['then'](function(_0x15b4f3){if(_0x15b4f3){_0x2ed7ab['model']=_[_0x295a('0x30')](db[_0x295a('0x48')][_0x295a('0x2b')]);_0x2ed7ab[_0x295a('0x2f')]=_[_0x295a('0x30')](_0x35d0a4[_0x295a('0x2f')]);_0x2ed7ab[_0x295a('0x31')]=_['intersection'](_0x2ed7ab[_0x295a('0x32')],_0x2ed7ab[_0x295a('0x2f')]);_0x4888b7[_0x295a('0x33')]=_[_0x295a('0x40')](_0x2ed7ab[_0x295a('0x32')],qs['fields'](_0x35d0a4[_0x295a('0x2f')][_0x295a('0x34')]));_0x4888b7['attributes']=_0x4888b7[_0x295a('0x33')][_0x295a('0x35')]?_0x4888b7[_0x295a('0x33')]:_0x2ed7ab['model'];if(!_0x35d0a4[_0x295a('0x2f')][_0x295a('0x49')](_0x295a('0x36'))){_0x4888b7['limit']=qs[_0x295a('0x1d')](_0x35d0a4[_0x295a('0x2f')][_0x295a('0x1d')]);_0x4888b7[_0x295a('0x1c')]=qs[_0x295a('0x1c')](_0x35d0a4[_0x295a('0x2f')][_0x295a('0x1c')]);}_0x4888b7[_0x295a('0x4a')]=qs[_0x295a('0x37')](_0x35d0a4['query'][_0x295a('0x37')]);_0x4888b7[_0x295a('0x38')]=qs[_0x295a('0x31')](_[_0x295a('0x4b')](_0x35d0a4[_0x295a('0x2f')],_0x2ed7ab[_0x295a('0x31')]));_0x4888b7[_0x295a('0x38')][_0x295a('0x4c')]=_0x15b4f3['id'];if(_0x35d0a4[_0x295a('0x2f')]['filter']){_0x4888b7[_0x295a('0x38')]=_[_0x295a('0x3a')](_0x4888b7['where'],{'$or':_[_0x295a('0x29')](_0x4888b7[_0x295a('0x33')],function(_0x4d61ad){var _0x3a9bc7={};_0x3a9bc7[_0x4d61ad]={'$like':'%'+_0x35d0a4[_0x295a('0x2f')][_0x295a('0x39')]+'%'};return _0x3a9bc7;})});}_0x4888b7=_[_0x295a('0x3a')]({},_0x4888b7,_0x35d0a4[_0x295a('0x4d')]);return db[_0x295a('0x48')][_0x295a('0x1b')]({'where':_0x4888b7[_0x295a('0x38')]})['then'](function(_0x1469a8){_0x2949a7[_0x295a('0x1b')]=_0x1469a8;if(_0x35d0a4[_0x295a('0x2f')][_0x295a('0x3b')]){_0x4888b7[_0x295a('0x3c')]=[{'all':!![]}];}return db[_0x295a('0x48')]['findAll'](_0x4888b7);})[_0x295a('0x25')](function(_0x2a8efb){_0x2949a7[_0x295a('0x3e')]=_0x2a8efb;return _0x2949a7;});}})['then'](respondWithFilteredResult(_0x1f281f,_0x4888b7))['catch'](handleError(_0x1f281f,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index 1ac532e..da6ce23 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 _0x7217=['../../config/environment','./jscriptySessionReport.attributes','exports','define','JscriptySessionReport','report_jscripty_sessions','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x17928f,_0x4ad33f){var _0x500b63=function(_0x127644){while(--_0x127644){_0x17928f['push'](_0x17928f['shift']());}};_0x500b63(++_0x4ad33f);}(_0x7217,0x19e));var _0x7721=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0x7217[_0x31e29a];return _0x32d892;};'use strict';var _=require(_0x7721('0x0'));var util=require('util');var logger=require(_0x7721('0x1'))(_0x7721('0x2'));var moment=require(_0x7721('0x3'));var BPromise=require(_0x7721('0x4'));var rp=require(_0x7721('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7721('0x6'));var attributes=require(_0x7721('0x7'));module[_0x7721('0x8')]=function(_0x3fe47c,_0xb239e0){return _0x3fe47c[_0x7721('0x9')](_0x7721('0xa'),attributes,{'tableName':_0x7721('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xed1c=['exports','JscriptySessionReport','report_jscripty_sessions','lodash','util','request-promise','path','rimraf','./jscriptySessionReport.attributes'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xed1c,0xe4));var _0xced1=function(_0x484ec2,_0xf3ca9){_0x484ec2=_0x484ec2-0x0;var _0x564cec=_0xed1c[_0x484ec2];return _0x564cec;};'use strict';var _=require(_0xced1('0x0'));var util=require(_0xced1('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xced1('0x2'));var fs=require('fs');var path=require(_0xced1('0x3'));var rimraf=require(_0xced1('0x4'));var config=require('../../config/environment');var attributes=require(_0xced1('0x5'));module[_0xced1('0x6')]=function(_0x466657,_0x37b22b){return _0x466657['define'](_0xced1('0x7'),attributes,{'tableName':_0xced1('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js b/server/api/jscriptySessionReport/jscriptySessionReport.rpc.js index 6bb464a..922509a 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 _0x6a55=['JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','lodash','randomstring','../../config/utils','rpc','jayson/promise','client','http','then','info'];(function(_0x2df507,_0x553862){var _0x1f7167=function(_0x11319e){while(--_0x11319e){_0x2df507['push'](_0x2df507['shift']());}};_0x1f7167(++_0x553862);}(_0x6a55,0xdb));var _0x56a5=function(_0x2df4cc,_0x1233c6){_0x2df4cc=_0x2df4cc-0x0;var _0x40af8d=_0x6a55[_0x2df4cc];return _0x40af8d;};'use strict';var _=require(_0x56a5('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x56a5('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x56a5('0x2'));var logger=require('../../config/logger')(_0x56a5('0x3'));var config=require('../../config/environment');var jayson=require(_0x56a5('0x4'));var client=jayson[_0x56a5('0x5')][_0x56a5('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x293ea1,_0x444c65,_0x2272d9){return new BPromise(function(_0x2b8f57,_0x387dcb){return client['request'](_0x293ea1,_0x2272d9)[_0x56a5('0x7')](function(_0xf15490){logger[_0x56a5('0x8')](_0x56a5('0x9'),_0x444c65,_0x56a5('0xa'));logger[_0x56a5('0xb')](_0x56a5('0xc'),_0x444c65,_0x56a5('0xa'),JSON[_0x56a5('0xd')](_0xf15490));if(_0xf15490['error']){if(_0xf15490['error'][_0x56a5('0xe')]===0x1f4){logger[_0x56a5('0xf')](_0x56a5('0x9'),_0x444c65,_0xf15490[_0x56a5('0xf')][_0x56a5('0x10')]);return _0x387dcb(_0xf15490[_0x56a5('0xf')]['message']);}logger['error'](_0x56a5('0x9'),_0x444c65,_0xf15490[_0x56a5('0xf')][_0x56a5('0x10')]);return _0x2b8f57(_0xf15490[_0x56a5('0xf')][_0x56a5('0x10')]);}else{logger[_0x56a5('0x8')](_0x56a5('0x9'),_0x444c65,'request\x20sent');_0x2b8f57(_0xf15490[_0x56a5('0x11')]['message']);}})[_0x56a5('0x12')](function(_0x51d031){logger[_0x56a5('0xf')](_0x56a5('0x9'),_0x444c65,_0x51d031);_0x387dcb(_0x51d031);});});} \ No newline at end of file +var _0xfcf0=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','JscriptySessionReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','lodash','util','bluebird'];(function(_0x41cfd4,_0x1ed2cc){var _0x190f48=function(_0x4b5b1a){while(--_0x4b5b1a){_0x41cfd4['push'](_0x41cfd4['shift']());}};_0x190f48(++_0x1ed2cc);}(_0xfcf0,0x138));var _0x0fcf=function(_0x3d5f84,_0x569548){_0x3d5f84=_0x3d5f84-0x0;var _0x1981b8=_0xfcf0[_0x3d5f84];return _0x1981b8;};'use strict';var _=require(_0x0fcf('0x0'));var util=require(_0x0fcf('0x1'));var moment=require('moment');var BPromise=require(_0x0fcf('0x2'));var rs=require(_0x0fcf('0x3'));var fs=require('fs');var Redis=require(_0x0fcf('0x4'));var db=require(_0x0fcf('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0fcf('0x6'))(_0x0fcf('0x7'));var config=require(_0x0fcf('0x8'));var jayson=require(_0x0fcf('0x9'));var client=jayson[_0x0fcf('0xa')][_0x0fcf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x61bbb9,_0x2dfdf8,_0x50c575){return new BPromise(function(_0x1388d1,_0x6ced94){return client[_0x0fcf('0xc')](_0x61bbb9,_0x50c575)['then'](function(_0x69a840){logger[_0x0fcf('0xd')](_0x0fcf('0xe'),_0x2dfdf8,'request\x20sent');logger[_0x0fcf('0xf')]('JscriptySessionReport,\x20%s,\x20%s,\x20%s',_0x2dfdf8,_0x0fcf('0x10'),JSON[_0x0fcf('0x11')](_0x69a840));if(_0x69a840[_0x0fcf('0x12')]){if(_0x69a840['error']['code']===0x1f4){logger[_0x0fcf('0x12')](_0x0fcf('0xe'),_0x2dfdf8,_0x69a840['error'][_0x0fcf('0x13')]);return _0x6ced94(_0x69a840[_0x0fcf('0x12')][_0x0fcf('0x13')]);}logger[_0x0fcf('0x12')](_0x0fcf('0xe'),_0x2dfdf8,_0x69a840['error'][_0x0fcf('0x13')]);return _0x1388d1(_0x69a840[_0x0fcf('0x12')][_0x0fcf('0x13')]);}else{logger['info'](_0x0fcf('0xe'),_0x2dfdf8,_0x0fcf('0x10'));_0x1388d1(_0x69a840[_0x0fcf('0x14')][_0x0fcf('0x13')]);}})['catch'](function(_0x3e78d0){logger[_0x0fcf('0x12')](_0x0fcf('0xe'),_0x2dfdf8,_0x3e78d0);_0x6ced94(_0x3e78d0);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index 631686d..f57eb9c 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 _0xe5d5=['/:id','isAuthenticated','update','exports','path','express','fs-extra','../../components/interaction/service','../../config/environment','./license.controller','get','index','put'];(function(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0xe5d5,0x156));var _0x5e5d=function(_0x5cfd72,_0x58f356){_0x5cfd72=_0x5cfd72-0x0;var _0x2a4aa1=_0xe5d5[_0x5cfd72];return _0x2a4aa1;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x5e5d('0x0'));var timeout=require('connect-timeout');var express=require(_0x5e5d('0x1'));var router=express['Router']();var fs_extra=require(_0x5e5d('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0x5e5d('0x3'));var config=require(_0x5e5d('0x4'));var controller=require(_0x5e5d('0x5'));router[_0x5e5d('0x6')]('/',controller[_0x5e5d('0x7')]);router[_0x5e5d('0x8')](_0x5e5d('0x9'),auth[_0x5e5d('0xa')](),controller[_0x5e5d('0xb')]);module[_0x5e5d('0xc')]=router; \ No newline at end of file +var _0x67cb=['../../components/auth/service','./license.controller','get','index','put','isAuthenticated','update','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x4cbef1,_0x56629f){var _0x222bdd=function(_0x49944){while(--_0x49944){_0x4cbef1['push'](_0x4cbef1['shift']());}};_0x222bdd(++_0x56629f);}(_0x67cb,0x19e));var _0xb67c=function(_0x23b655,_0x4feb2b){_0x23b655=_0x23b655-0x0;var _0x364b32=_0x67cb[_0x23b655];return _0x364b32;};'use strict';var multer=require(_0xb67c('0x0'));var util=require('util');var path=require(_0xb67c('0x1'));var timeout=require(_0xb67c('0x2'));var express=require(_0xb67c('0x3'));var router=express[_0xb67c('0x4')]();var fs_extra=require(_0xb67c('0x5'));var auth=require(_0xb67c('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xb67c('0x7'));router[_0xb67c('0x8')]('/',controller[_0xb67c('0x9')]);router[_0xb67c('0xa')]('/:id',auth[_0xb67c('0xb')](),controller[_0xb67c('0xc')]);module[_0xb67c('0xd')]=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index 837dd7b..9f9a8d8 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 _0x05cb=['INTEGER','sequelize','TEXT','STRING'];(function(_0x3687ae,_0x3e2ac4){var _0x2af097=function(_0x373b39){while(--_0x373b39){_0x3687ae['push'](_0x3687ae['shift']());}};_0x2af097(++_0x3e2ac4);}(_0x05cb,0x131));var _0xb05c=function(_0x3d9662,_0x236ea2){_0x3d9662=_0x3d9662-0x0;var _0x58c2d5=_0x05cb[_0x3d9662];return _0x58c2d5;};'use strict';var Sequelize=require(_0xb05c('0x0'));module['exports']={'license':{'type':Sequelize[_0xb05c('0x1')]},'data1':{'type':Sequelize[_0xb05c('0x2')]},'data2':{'type':Sequelize[_0xb05c('0x2')]},'chatLicenseExceeded':{'type':Sequelize[_0xb05c('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0xafed=['INTEGER','sequelize','exports','TEXT','STRING'];(function(_0x1a381e,_0x3030ab){var _0x4d0482=function(_0x56a0a6){while(--_0x56a0a6){_0x1a381e['push'](_0x1a381e['shift']());}};_0x4d0482(++_0x3030ab);}(_0xafed,0x7e));var _0xdafe=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xafed[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xdafe('0x0'));module[_0xdafe('0x1')]={'license':{'type':Sequelize[_0xdafe('0x2')]},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize[_0xdafe('0x3')]},'chatLicenseExceeded':{'type':Sequelize[_0xdafe('0x4')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/license/license.controller.js b/server/api/license/license.controller.js index 4cf981d..9b5cfe2 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 _0x5fab=['checkLicense','key','demo','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','end','sendStatus','name','send','index','model','keys','License','rawAttributes','query','filters','intersection','attributes','fields','merge','then','catch','body','find','params'];(function(_0x1b9c66,_0xcfbe73){var _0x56776d=function(_0x8bf6d8){while(--_0x8bf6d8){_0x1b9c66['push'](_0x1b9c66['shift']());}};_0x56776d(++_0xcfbe73);}(_0x5fab,0x177));var _0xb5fa=function(_0xdf56aa,_0x4d9c15){_0xdf56aa=_0xdf56aa-0x0;var _0x82768=_0x5fab[_0xdf56aa];return _0x82768;};'use strict';var emlformat=require(_0xb5fa('0x0'));var rimraf=require(_0xb5fa('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb5fa('0x2'));var rp=require(_0xb5fa('0x3'));var moment=require(_0xb5fa('0x4'));var BPromise=require(_0xb5fa('0x5'));var Mustache=require(_0xb5fa('0x6'));var util=require(_0xb5fa('0x7'));var path=require(_0xb5fa('0x8'));var sox=require(_0xb5fa('0x9'));var csv=require(_0xb5fa('0xa'));var ejs=require(_0xb5fa('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb5fa('0xc'));var crypto=require(_0xb5fa('0xd'));var jsforce=require(_0xb5fa('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xb5fa('0xa'));var querystring=require(_0xb5fa('0xf'));var Papa=require(_0xb5fa('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb5fa('0x11'));var as=require(_0xb5fa('0x12'));var hardwareService=require(_0xb5fa('0x13'));var logger=require(_0xb5fa('0x14'))(_0xb5fa('0x15'));var utils=require(_0xb5fa('0x16'));var config=require(_0xb5fa('0x17'));var licenseUtil=require(_0xb5fa('0x18'));var db=require(_0xb5fa('0x19'))['db'];function respondWithStatusCode(_0x4d3576,_0x2ad830){_0x2ad830=_0x2ad830||0xcc;return function(_0x3dad4d){if(_0x3dad4d){return _0x4d3576['sendStatus'](_0x2ad830);}return _0x4d3576[_0xb5fa('0x1a')](_0x2ad830)['end']();};}function respondWithResult(_0x265992,_0x3fc372){_0x3fc372=_0x3fc372||0xc8;return function(_0x40c914){if(_0x40c914){return _0x265992[_0xb5fa('0x1a')](_0x3fc372)[_0xb5fa('0x1b')](_0x40c914);}};}function respondWithFilteredResult(_0x5371cf,_0x567f31){return function(_0x38e964){if(_0x38e964){var _0x587043=typeof _0x567f31[_0xb5fa('0x1c')]===_0xb5fa('0x1d')&&typeof _0x567f31['limit']==='undefined';var _0x451a55=_0x38e964[_0xb5fa('0x1e')];var _0x32e9e5=_0x587043?0x0:_0x567f31[_0xb5fa('0x1c')];var _0x324ba5=_0x587043?_0x38e964[_0xb5fa('0x1e')]:_0x567f31[_0xb5fa('0x1c')]+_0x567f31[_0xb5fa('0x1f')];var _0xc14dc4;if(_0x324ba5>=_0x451a55){_0x324ba5=_0x451a55;_0xc14dc4=0xc8;}else{_0xc14dc4=0xce;}_0x5371cf[_0xb5fa('0x1a')](_0xc14dc4);return _0x5371cf[_0xb5fa('0x20')](_0xb5fa('0x21'),_0x32e9e5+'-'+_0x324ba5+'/'+_0x451a55)['json'](_0x38e964);}return null;};}function patchUpdates(_0x432bfa){return function(_0x519e20){try{jsonpatch[_0xb5fa('0x22')](_0x519e20,_0x432bfa,!![]);}catch(_0x4a6c04){return BPromise[_0xb5fa('0x23')](_0x4a6c04);}return _0x519e20[_0xb5fa('0x24')]();};}function saveUpdates(_0x4e05c0,_0x40dfdf){return function(_0x3a2ab9){if(_0x3a2ab9){return _0x3a2ab9[_0xb5fa('0x25')](_0x4e05c0)['then'](function(_0x32a85c){return _0x32a85c;});}return null;};}function removeEntity(_0xec108f,_0x444237){return function(_0x542348){if(_0x542348){return _0x542348[_0xb5fa('0x26')]()['then'](function(){_0xec108f[_0xb5fa('0x1a')](0xcc)[_0xb5fa('0x27')]();});}};}function handleEntityNotFound(_0x11053a,_0x543edf){return function(_0x2dbd22){if(!_0x2dbd22){_0x11053a[_0xb5fa('0x28')](0x194);}return _0x2dbd22;};}function handleError(_0x6a455c,_0x20d649){_0x20d649=_0x20d649||0x1f4;return function(_0x568870){logger['error'](_0x568870['stack']);if(_0x568870['name']){delete _0x568870[_0xb5fa('0x29')];}_0x6a455c[_0xb5fa('0x1a')](_0x20d649)[_0xb5fa('0x2a')](_0x568870);};}var utilLicense=require(_0xb5fa('0x18'));exports[_0xb5fa('0x2b')]=function(_0x3506a4,_0x358549){var _0x353314={'raw':!![],'where':{'id':0x1}},_0x409af9={};_0x409af9[_0xb5fa('0x2c')]=_[_0xb5fa('0x2d')](db[_0xb5fa('0x2e')][_0xb5fa('0x2f')]);_0x409af9[_0xb5fa('0x30')]=_[_0xb5fa('0x2d')](_0x3506a4[_0xb5fa('0x30')]);_0x409af9[_0xb5fa('0x31')]=_[_0xb5fa('0x32')](_0x409af9[_0xb5fa('0x2c')],_0x409af9[_0xb5fa('0x30')]);_0x353314[_0xb5fa('0x33')]=_[_0xb5fa('0x32')](_0x409af9[_0xb5fa('0x2c')],qs[_0xb5fa('0x34')](_0x3506a4['query'][_0xb5fa('0x34')]));_0x353314['attributes']=_0x353314['attributes']['length']?_0x353314[_0xb5fa('0x33')]:_0x409af9['model'];_0x353314=_[_0xb5fa('0x35')]({},_0x353314,_0x3506a4['options']);return utilLicense['getLicense'](_0x353314)[_0xb5fa('0x36')](respondWithResult(_0x358549,null))[_0xb5fa('0x37')](handleError(_0x358549,null));};exports['update']=function(_0x59f41d,_0x3d73c2){if(_0x59f41d[_0xb5fa('0x38')]['id']){delete _0x59f41d[_0xb5fa('0x38')]['id'];}return db['License'][_0xb5fa('0x39')]({'where':{'id':_0x59f41d[_0xb5fa('0x3a')]['id']}})['then'](handleEntityNotFound(_0x3d73c2,null))[_0xb5fa('0x36')](function(_0x2056de){var _0x204d6b=_0x2056de['get']({'plain':!![]});return utilLicense[_0xb5fa('0x3b')](_0x204d6b,_0x59f41d[_0xb5fa('0x38')][_0xb5fa('0x3c')]);})['then'](function(_0x117694){if(!_0x117694[_0xb5fa('0x3d')]){return saveUpdates(_0x59f41d[_0xb5fa('0x38')],null);}return _0x117694;})[_0xb5fa('0x36')](respondWithResult(_0x3d73c2,null))['catch'](handleError(_0x3d73c2,null));}; \ No newline at end of file +var _0xf494=['fields','length','merge','options','getLicense','body','License','find','params','get','key','demo','catch','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','save','update','then','error','stack','name','../../config/license/util','index','model','rawAttributes','query','keys','filters','intersection','attributes'];(function(_0x521929,_0x479be5){var _0x632436=function(_0x288290){while(--_0x288290){_0x521929['push'](_0x521929['shift']());}};_0x632436(++_0x479be5);}(_0xf494,0x1c6));var _0x4f49=function(_0xec9b3a,_0x53c6bf){_0xec9b3a=_0xec9b3a-0x0;var _0x4e7613=_0xf494[_0xec9b3a];return _0x4e7613;};'use strict';var emlformat=require(_0x4f49('0x0'));var rimraf=require(_0x4f49('0x1'));var zipdir=require(_0x4f49('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4f49('0x3'));var moment=require(_0x4f49('0x4'));var BPromise=require(_0x4f49('0x5'));var Mustache=require(_0x4f49('0x6'));var util=require(_0x4f49('0x7'));var path=require(_0x4f49('0x8'));var sox=require(_0x4f49('0x9'));var csv=require(_0x4f49('0xa'));var ejs=require(_0x4f49('0xb'));var fs=require('fs');var fs_extra=require(_0x4f49('0xc'));var _=require(_0x4f49('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x4f49('0xe'));var deskjs=require(_0x4f49('0xf'));var toCsv=require(_0x4f49('0xa'));var querystring=require(_0x4f49('0x10'));var Papa=require(_0x4f49('0x11'));var Redis=require(_0x4f49('0x12'));var authService=require(_0x4f49('0x13'));var qs=require(_0x4f49('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4f49('0x15'));var logger=require(_0x4f49('0x16'))('api');var utils=require(_0x4f49('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4f49('0x18'))['db'];function respondWithStatusCode(_0x12527d,_0x4bf89f){_0x4bf89f=_0x4bf89f||0xcc;return function(_0x1e1c37){if(_0x1e1c37){return _0x12527d[_0x4f49('0x19')](_0x4bf89f);}return _0x12527d[_0x4f49('0x1a')](_0x4bf89f)[_0x4f49('0x1b')]();};}function respondWithResult(_0x1a0f1e,_0x2f0131){_0x2f0131=_0x2f0131||0xc8;return function(_0xfdb477){if(_0xfdb477){return _0x1a0f1e['status'](_0x2f0131)[_0x4f49('0x1c')](_0xfdb477);}};}function respondWithFilteredResult(_0x1f2d0d,_0x415e83){return function(_0x5878f4){if(_0x5878f4){var _0x5bdfaf=typeof _0x415e83[_0x4f49('0x1d')]===_0x4f49('0x1e')&&typeof _0x415e83[_0x4f49('0x1f')]==='undefined';var _0x1dccfd=_0x5878f4[_0x4f49('0x20')];var _0x4e85df=_0x5bdfaf?0x0:_0x415e83['offset'];var _0x5bb23b=_0x5bdfaf?_0x5878f4['count']:_0x415e83['offset']+_0x415e83[_0x4f49('0x1f')];var _0x1834f4;if(_0x5bb23b>=_0x1dccfd){_0x5bb23b=_0x1dccfd;_0x1834f4=0xc8;}else{_0x1834f4=0xce;}_0x1f2d0d[_0x4f49('0x1a')](_0x1834f4);return _0x1f2d0d[_0x4f49('0x21')]('Content-Range',_0x4e85df+'-'+_0x5bb23b+'/'+_0x1dccfd)[_0x4f49('0x1c')](_0x5878f4);}return null;};}function patchUpdates(_0x2aed27){return function(_0x197a49){try{jsonpatch[_0x4f49('0x22')](_0x197a49,_0x2aed27,!![]);}catch(_0xea82f8){return BPromise['reject'](_0xea82f8);}return _0x197a49[_0x4f49('0x23')]();};}function saveUpdates(_0x357446,_0x3ae590){return function(_0x53b57d){if(_0x53b57d){return _0x53b57d[_0x4f49('0x24')](_0x357446)[_0x4f49('0x25')](function(_0x32ca7b){return _0x32ca7b;});}return null;};}function removeEntity(_0x43c458,_0x9d30aa){return function(_0x36187b){if(_0x36187b){return _0x36187b['destroy']()['then'](function(){_0x43c458[_0x4f49('0x1a')](0xcc)[_0x4f49('0x1b')]();});}};}function handleEntityNotFound(_0x4fedbb,_0x408552){return function(_0x2c1519){if(!_0x2c1519){_0x4fedbb[_0x4f49('0x19')](0x194);}return _0x2c1519;};}function handleError(_0x525950,_0xc54070){_0xc54070=_0xc54070||0x1f4;return function(_0x2eed1c){logger[_0x4f49('0x26')](_0x2eed1c[_0x4f49('0x27')]);if(_0x2eed1c[_0x4f49('0x28')]){delete _0x2eed1c[_0x4f49('0x28')];}_0x525950['status'](_0xc54070)['send'](_0x2eed1c);};}var utilLicense=require(_0x4f49('0x29'));exports[_0x4f49('0x2a')]=function(_0x605c91,_0x560050){var _0x3cbfbd={'raw':!![],'where':{'id':0x1}},_0x206203={};_0x206203[_0x4f49('0x2b')]=_['keys'](db['License'][_0x4f49('0x2c')]);_0x206203[_0x4f49('0x2d')]=_[_0x4f49('0x2e')](_0x605c91['query']);_0x206203[_0x4f49('0x2f')]=_[_0x4f49('0x30')](_0x206203[_0x4f49('0x2b')],_0x206203[_0x4f49('0x2d')]);_0x3cbfbd[_0x4f49('0x31')]=_[_0x4f49('0x30')](_0x206203[_0x4f49('0x2b')],qs[_0x4f49('0x32')](_0x605c91[_0x4f49('0x2d')][_0x4f49('0x32')]));_0x3cbfbd[_0x4f49('0x31')]=_0x3cbfbd[_0x4f49('0x31')][_0x4f49('0x33')]?_0x3cbfbd[_0x4f49('0x31')]:_0x206203[_0x4f49('0x2b')];_0x3cbfbd=_[_0x4f49('0x34')]({},_0x3cbfbd,_0x605c91[_0x4f49('0x35')]);return utilLicense[_0x4f49('0x36')](_0x3cbfbd)[_0x4f49('0x25')](respondWithResult(_0x560050,null))['catch'](handleError(_0x560050,null));};exports[_0x4f49('0x24')]=function(_0x46b7ba,_0x24f568){if(_0x46b7ba[_0x4f49('0x37')]['id']){delete _0x46b7ba[_0x4f49('0x37')]['id'];}return db[_0x4f49('0x38')][_0x4f49('0x39')]({'where':{'id':_0x46b7ba[_0x4f49('0x3a')]['id']}})[_0x4f49('0x25')](handleEntityNotFound(_0x24f568,null))[_0x4f49('0x25')](function(_0x44e6a0){var _0x343365=_0x44e6a0[_0x4f49('0x3b')]({'plain':!![]});return utilLicense['checkLicense'](_0x343365,_0x46b7ba[_0x4f49('0x37')][_0x4f49('0x3c')]);})[_0x4f49('0x25')](function(_0x26014f){if(!_0x26014f[_0x4f49('0x3d')]){return saveUpdates(_0x46b7ba[_0x4f49('0x37')],null);}return _0x26014f;})[_0x4f49('0x25')](respondWithResult(_0x24f568,null))[_0x4f49('0x3e')](handleError(_0x24f568,null));}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index 701831d..3391121 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 _0xf4e0=['License','lodash','util','api','bluebird','request-promise','path','rimraf','define'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf4e0,0xac));var _0x0f4e=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xf4e0[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x0f4e('0x0'));var util=require(_0x0f4e('0x1'));var logger=require('../../config/logger')(_0x0f4e('0x2'));var moment=require('moment');var BPromise=require(_0x0f4e('0x3'));var rp=require(_0x0f4e('0x4'));var fs=require('fs');var path=require(_0x0f4e('0x5'));var rimraf=require(_0x0f4e('0x6'));var config=require('../../config/environment');var attributes=require('./license.attributes');module['exports']=function(_0x4daf7a,_0x262470){return _0x4daf7a[_0x0f4e('0x7')](_0x0f4e('0x8'),attributes,{'tableName':'license','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4faa=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./license.attributes','exports','define','License'];(function(_0xb83ec2,_0x18e73b){var _0x4d2fbf=function(_0x16538a){while(--_0x16538a){_0xb83ec2['push'](_0xb83ec2['shift']());}};_0x4d2fbf(++_0x18e73b);}(_0x4faa,0x198));var _0xa4fa=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x4faa[_0x2d7f0e];return _0x110b07;};'use strict';var _=require(_0xa4fa('0x0'));var util=require(_0xa4fa('0x1'));var logger=require(_0xa4fa('0x2'))('api');var moment=require(_0xa4fa('0x3'));var BPromise=require(_0xa4fa('0x4'));var rp=require(_0xa4fa('0x5'));var fs=require('fs');var path=require(_0xa4fa('0x6'));var rimraf=require('rimraf');var config=require(_0xa4fa('0x7'));var attributes=require(_0xa4fa('0x8'));module[_0xa4fa('0x9')]=function(_0x5ab4f3,_0xce250d){return _0x5ab4f3[_0xa4fa('0xa')](_0xa4fa('0xb'),attributes,{'tableName':'license','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/license/license.rpc.js b/server/api/license/license.rpc.js index f39585a..f98e4d2 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 _0xc96c=['../../config/utils','../../config/logger','rpc','client','http','request','info','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','stringify','error','code','License,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x1f6e3c,_0x791725){var _0x5c2c0c=function(_0x3ed7b3){while(--_0x3ed7b3){_0x1f6e3c['push'](_0x1f6e3c['shift']());}};_0x5c2c0c(++_0x791725);}(_0xc96c,0xa1));var _0xcc96=function(_0x28019c,_0x67743){_0x28019c=_0x28019c-0x0;var _0x48ca39=_0xc96c[_0x28019c];return _0x48ca39;};'use strict';var _=require(_0xcc96('0x0'));var util=require(_0xcc96('0x1'));var moment=require(_0xcc96('0x2'));var BPromise=require(_0xcc96('0x3'));var rs=require(_0xcc96('0x4'));var fs=require('fs');var Redis=require(_0xcc96('0x5'));var db=require(_0xcc96('0x6'))['db'];var utils=require(_0xcc96('0x7'));var logger=require(_0xcc96('0x8'))(_0xcc96('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xcc96('0xa')][_0xcc96('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3a1186,_0x48d5d0,_0x4cba2d){return new BPromise(function(_0x2c103c,_0x1de7a6){return client[_0xcc96('0xc')](_0x3a1186,_0x4cba2d)['then'](function(_0x5d18f4){logger[_0xcc96('0xd')]('License,\x20%s,\x20%s',_0x48d5d0,_0xcc96('0xe'));logger[_0xcc96('0xf')](_0xcc96('0x10'),_0x48d5d0,'request\x20sent',JSON[_0xcc96('0x11')](_0x5d18f4));if(_0x5d18f4['error']){if(_0x5d18f4[_0xcc96('0x12')][_0xcc96('0x13')]===0x1f4){logger[_0xcc96('0x12')](_0xcc96('0x14'),_0x48d5d0,_0x5d18f4[_0xcc96('0x12')][_0xcc96('0x15')]);return _0x1de7a6(_0x5d18f4[_0xcc96('0x12')][_0xcc96('0x15')]);}logger[_0xcc96('0x12')]('License,\x20%s,\x20%s',_0x48d5d0,_0x5d18f4['error']['message']);return _0x2c103c(_0x5d18f4[_0xcc96('0x12')]['message']);}else{logger[_0xcc96('0xd')]('License,\x20%s,\x20%s',_0x48d5d0,'request\x20sent');_0x2c103c(_0x5d18f4[_0xcc96('0x16')]['message']);}})[_0xcc96('0x17')](function(_0x2698cb){logger['error'](_0xcc96('0x14'),_0x48d5d0,_0x2698cb);_0x1de7a6(_0x2698cb);});});} \ No newline at end of file +var _0x2f2d=['code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','License,\x20%s,\x20%s','request\x20sent','License,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x11f226,_0x491e30){var _0x30be77=function(_0x2049bd){while(--_0x2049bd){_0x11f226['push'](_0x11f226['shift']());}};_0x30be77(++_0x491e30);}(_0x2f2d,0x1a2));var _0xd2f2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2f2d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xd2f2('0x0'));var util=require(_0xd2f2('0x1'));var moment=require(_0xd2f2('0x2'));var BPromise=require(_0xd2f2('0x3'));var rs=require(_0xd2f2('0x4'));var fs=require('fs');var Redis=require(_0xd2f2('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xd2f2('0x6'));var logger=require('../../config/logger')(_0xd2f2('0x7'));var config=require(_0xd2f2('0x8'));var jayson=require(_0xd2f2('0x9'));var client=jayson['client'][_0xd2f2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x40769f,_0x57afe1,_0x49d7e9){return new BPromise(function(_0x1144be,_0xd1f8ad){return client[_0xd2f2('0xb')](_0x40769f,_0x49d7e9)[_0xd2f2('0xc')](function(_0x453fa4){logger[_0xd2f2('0xd')](_0xd2f2('0xe'),_0x57afe1,_0xd2f2('0xf'));logger['debug'](_0xd2f2('0x10'),_0x57afe1,'request\x20sent',JSON[_0xd2f2('0x11')](_0x453fa4));if(_0x453fa4[_0xd2f2('0x12')]){if(_0x453fa4[_0xd2f2('0x12')][_0xd2f2('0x13')]===0x1f4){logger['error'](_0xd2f2('0xe'),_0x57afe1,_0x453fa4['error']['message']);return _0xd1f8ad(_0x453fa4[_0xd2f2('0x12')][_0xd2f2('0x14')]);}logger['error'](_0xd2f2('0xe'),_0x57afe1,_0x453fa4[_0xd2f2('0x12')][_0xd2f2('0x14')]);return _0x1144be(_0x453fa4[_0xd2f2('0x12')][_0xd2f2('0x14')]);}else{logger[_0xd2f2('0xd')](_0xd2f2('0xe'),_0x57afe1,_0xd2f2('0xf'));_0x1144be(_0x453fa4[_0xd2f2('0x15')][_0xd2f2('0x14')]);}})[_0xd2f2('0x16')](function(_0x354259){logger[_0xd2f2('0x12')]('License,\x20%s,\x20%s',_0x57afe1,_0x354259);_0xd1f8ad(_0x354259);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index f326ef8..89cbaef 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 _0x0b68=['removeAnswers','removeImap','removeSmtp','destroy','removeAgents','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','getDispositions','getAnswers','/:id/in_servers','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','/:id/applications','getApplications','getMessages','verifySmtp','/:id/users','getAgents','post','addDisposition','/:id/canned_answers','addImap','addSmtp','addInteraction','addApplications','/:id/send','send','put','update','delete','/:id/dispositions','removeDispositions'];(function(_0x376c6d,_0x50a35f){var _0xb9df10=function(_0x2b0737){while(--_0x2b0737){_0x376c6d['push'](_0x376c6d['shift']());}};_0xb9df10(++_0x50a35f);}(_0x0b68,0x191));var _0x80b6=function(_0x717c93,_0x5945d4){_0x717c93=_0x717c93-0x0;var _0x37ee31=_0x0b68[_0x717c93];return _0x37ee31;};'use strict';var multer=require(_0x80b6('0x0'));var util=require(_0x80b6('0x1'));var path=require('path');var timeout=require(_0x80b6('0x2'));var express=require(_0x80b6('0x3'));var router=express[_0x80b6('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x80b6('0x5'));var interaction=require(_0x80b6('0x6'));var config=require(_0x80b6('0x7'));var controller=require('./mailAccount.controller');router[_0x80b6('0x8')]('/',auth[_0x80b6('0x9')](),controller[_0x80b6('0xa')]);router[_0x80b6('0x8')]('/describe',auth[_0x80b6('0x9')](),controller[_0x80b6('0xb')]);router[_0x80b6('0x8')]('/:id',auth[_0x80b6('0x9')](),controller['show']);router[_0x80b6('0x8')]('/:id/dispositions',auth[_0x80b6('0x9')](),controller[_0x80b6('0xc')]);router[_0x80b6('0x8')]('/:id/canned_answers',auth[_0x80b6('0x9')](),controller[_0x80b6('0xd')]);router['get'](_0x80b6('0xe'),auth[_0x80b6('0x9')](),controller['getImap']);router[_0x80b6('0x8')](_0x80b6('0xf'),auth[_0x80b6('0x9')](),controller[_0x80b6('0x10')]);router[_0x80b6('0x8')](_0x80b6('0x11'),auth[_0x80b6('0x9')](),controller[_0x80b6('0x12')]);router[_0x80b6('0x8')](_0x80b6('0x13'),auth[_0x80b6('0x9')](),controller[_0x80b6('0x14')]);router[_0x80b6('0x8')]('/:id/messages',auth[_0x80b6('0x9')](),controller[_0x80b6('0x15')]);router[_0x80b6('0x8')]('/:id/verify',auth[_0x80b6('0x9')](),controller[_0x80b6('0x16')]);router[_0x80b6('0x8')](_0x80b6('0x17'),auth[_0x80b6('0x9')](),controller[_0x80b6('0x18')]);router[_0x80b6('0x19')]('/:id/dispositions',auth[_0x80b6('0x9')](),controller[_0x80b6('0x1a')]);router[_0x80b6('0x19')](_0x80b6('0x1b'),auth[_0x80b6('0x9')](),controller['addAnswer']);router['post']('/',auth[_0x80b6('0x9')](),controller['create']);router['post'](_0x80b6('0xe'),auth['isAuthenticated'](),controller[_0x80b6('0x1c')]);router[_0x80b6('0x19')](_0x80b6('0xf'),auth[_0x80b6('0x9')](),controller[_0x80b6('0x1d')]);router[_0x80b6('0x19')](_0x80b6('0x11'),auth[_0x80b6('0x9')](),controller[_0x80b6('0x1e')]);router[_0x80b6('0x19')](_0x80b6('0x13'),auth[_0x80b6('0x9')](),controller[_0x80b6('0x1f')]);router[_0x80b6('0x19')](_0x80b6('0x20'),auth[_0x80b6('0x9')](),controller[_0x80b6('0x21')]);router['post']('/:id/users',auth[_0x80b6('0x9')](),controller['addAgents']);router[_0x80b6('0x22')]('/:id',auth[_0x80b6('0x9')](),controller[_0x80b6('0x23')]);router[_0x80b6('0x24')](_0x80b6('0x25'),auth[_0x80b6('0x9')](),controller[_0x80b6('0x26')]);router[_0x80b6('0x24')](_0x80b6('0x1b'),auth[_0x80b6('0x9')](),controller[_0x80b6('0x27')]);router[_0x80b6('0x24')](_0x80b6('0xe'),auth[_0x80b6('0x9')](),controller[_0x80b6('0x28')]);router['delete']('/:id/out_servers',auth[_0x80b6('0x9')](),controller[_0x80b6('0x29')]);router[_0x80b6('0x24')]('/:id',auth[_0x80b6('0x9')](),controller[_0x80b6('0x2a')]);router[_0x80b6('0x24')]('/:id/users',auth[_0x80b6('0x9')](),controller[_0x80b6('0x2b')]);module['exports']=router; \ No newline at end of file +var _0x8ec4=['create','addImap','addSmtp','/:id/interactions','addInteraction','addApplications','/:id/send','send','/:id/users','put','update','delete','removeAnswers','removeImap','removeSmtp','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','./mailAccount.controller','isAuthenticated','index','get','describe','/:id','/:id/dispositions','getAnswers','/:id/in_servers','/:id/out_servers','getInteractions','/:id/applications','getApplications','/:id/messages','getMessages','/:id/verify','verifySmtp','getAgents','post','addDisposition','/:id/canned_answers','addAnswer'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0x8ec4,0x181));var _0x48ec=function(_0x192c6a,_0xaafed6){_0x192c6a=_0x192c6a-0x0;var _0x49fe49=_0x8ec4[_0x192c6a];return _0x49fe49;};'use strict';var multer=require(_0x48ec('0x0'));var util=require(_0x48ec('0x1'));var path=require(_0x48ec('0x2'));var timeout=require(_0x48ec('0x3'));var express=require('express');var router=express[_0x48ec('0x4')]();var fs_extra=require(_0x48ec('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x48ec('0x6'));var config=require('../../config/environment');var controller=require(_0x48ec('0x7'));router['get']('/',auth[_0x48ec('0x8')](),controller[_0x48ec('0x9')]);router[_0x48ec('0xa')]('/describe',auth['isAuthenticated'](),controller[_0x48ec('0xb')]);router[_0x48ec('0xa')](_0x48ec('0xc'),auth[_0x48ec('0x8')](),controller['show']);router['get'](_0x48ec('0xd'),auth['isAuthenticated'](),controller['getDispositions']);router['get']('/:id/canned_answers',auth[_0x48ec('0x8')](),controller[_0x48ec('0xe')]);router['get'](_0x48ec('0xf'),auth[_0x48ec('0x8')](),controller['getImap']);router[_0x48ec('0xa')](_0x48ec('0x10'),auth[_0x48ec('0x8')](),controller['getSmtp']);router[_0x48ec('0xa')]('/:id/interactions',auth[_0x48ec('0x8')](),controller[_0x48ec('0x11')]);router['get'](_0x48ec('0x12'),auth[_0x48ec('0x8')](),controller[_0x48ec('0x13')]);router['get'](_0x48ec('0x14'),auth[_0x48ec('0x8')](),controller[_0x48ec('0x15')]);router['get'](_0x48ec('0x16'),auth[_0x48ec('0x8')](),controller[_0x48ec('0x17')]);router['get']('/:id/users',auth[_0x48ec('0x8')](),controller[_0x48ec('0x18')]);router[_0x48ec('0x19')](_0x48ec('0xd'),auth[_0x48ec('0x8')](),controller[_0x48ec('0x1a')]);router[_0x48ec('0x19')](_0x48ec('0x1b'),auth['isAuthenticated'](),controller[_0x48ec('0x1c')]);router[_0x48ec('0x19')]('/',auth[_0x48ec('0x8')](),controller[_0x48ec('0x1d')]);router[_0x48ec('0x19')](_0x48ec('0xf'),auth[_0x48ec('0x8')](),controller[_0x48ec('0x1e')]);router[_0x48ec('0x19')](_0x48ec('0x10'),auth['isAuthenticated'](),controller[_0x48ec('0x1f')]);router[_0x48ec('0x19')](_0x48ec('0x20'),auth[_0x48ec('0x8')](),controller[_0x48ec('0x21')]);router['post']('/:id/applications',auth[_0x48ec('0x8')](),controller[_0x48ec('0x22')]);router[_0x48ec('0x19')](_0x48ec('0x23'),auth[_0x48ec('0x8')](),controller[_0x48ec('0x24')]);router[_0x48ec('0x19')](_0x48ec('0x25'),auth[_0x48ec('0x8')](),controller['addAgents']);router[_0x48ec('0x26')](_0x48ec('0xc'),auth[_0x48ec('0x8')](),controller[_0x48ec('0x27')]);router[_0x48ec('0x28')](_0x48ec('0xd'),auth[_0x48ec('0x8')](),controller['removeDispositions']);router[_0x48ec('0x28')](_0x48ec('0x1b'),auth['isAuthenticated'](),controller[_0x48ec('0x29')]);router[_0x48ec('0x28')](_0x48ec('0xf'),auth[_0x48ec('0x8')](),controller[_0x48ec('0x2a')]);router[_0x48ec('0x28')](_0x48ec('0x10'),auth[_0x48ec('0x8')](),controller[_0x48ec('0x2b')]);router[_0x48ec('0x28')]('/:id',auth[_0x48ec('0x8')](),controller[_0x48ec('0x2c')]);router[_0x48ec('0x28')]('/:id/users',auth['isAuthenticated'](),controller['removeAgents']);module[_0x48ec('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 ba34486..409b134 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 _0x34e5=['BOOLEAN','Arial,Helvetica,sans-serif','INTEGER','UNSIGNED','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x34e5,0x172));var _0x534e=function(_0x3935fc,_0x456432){_0x3935fc=_0x3935fc-0x0;var _0x1a2e23=_0x34e5[_0x3935fc];return _0x1a2e23;};'use strict';var Sequelize=require('sequelize');module[_0x534e('0x0')]={'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x534e('0x1')],'allowNull':![]},'service':{'type':Sequelize[_0x534e('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0x534e('0x1')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x534e('0x2')],'defaultValue':!![]},'key':{'type':Sequelize[_0x534e('0x1')],'allowNull':![]},'template':{'type':Sequelize['TEXT']},'markAsUnread':{'type':Sequelize[_0x534e('0x2')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x534e('0x1')],'allowNull':![],'defaultValue':_0x534e('0x3')},'fontSize':{'type':Sequelize[_0x534e('0x4')](0x2)[_0x534e('0x5')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x534e('0x6')],'defaultValue':function(){return _0x534e('0x7');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x534e('0x2')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x534e('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x534e('0x2')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x534e('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x534e('0x8')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x534e('0x9'),'set':function(_0x310b6d){if(!_0x310b6d)this[_0x534e('0xa')]('mandatoryDispositionPauseId',null);this[_0x534e('0xa')](_0x534e('0xb'),_0x310b6d);}}}; \ No newline at end of file +var _0x1159=['setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','STRING','BOOLEAN','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'];(function(_0x54ea7a,_0x19df9b){var _0x65a10d=function(_0x1bf936){while(--_0x1bf936){_0x54ea7a['push'](_0x54ea7a['shift']());}};_0x65a10d(++_0x19df9b);}(_0x1159,0xf3));var _0x9115=function(_0x4e4ea5,_0x546986){_0x4e4ea5=_0x4e4ea5-0x0;var _0x2b5f6d=_0x1159[_0x4e4ea5];return _0x2b5f6d;};'use strict';var Sequelize=require(_0x9115('0x0'));module['exports']={'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x9115('0x1')],'allowNull':![]},'service':{'type':Sequelize[_0x9115('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0x9115('0x1')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x9115('0x2')],'defaultValue':!![]},'key':{'type':Sequelize[_0x9115('0x1')],'allowNull':![]},'template':{'type':Sequelize[_0x9115('0x3')]},'markAsUnread':{'type':Sequelize[_0x9115('0x2')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x9115('0x1')],'allowNull':![],'defaultValue':'Arial,Helvetica,sans-serif'},'fontSize':{'type':Sequelize[_0x9115('0x4')](0x2)[_0x9115('0x5')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x9115('0x3')],'defaultValue':function(){return _0x9115('0x6');}},'notificationSound':{'type':Sequelize[_0x9115('0x2')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x9115('0x2')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x9115('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x9115('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x9115('0x2')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x9115('0x7')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x9115('0x8'),'set':function(_0x170177){if(!_0x170177)this[_0x9115('0x9')](_0x9115('0xa'),null);this['setDataValue'](_0x9115('0xb'),_0x170177);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index 546dccc..fc13630 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 _0x471a=['Smtp','Pause','mandatoryDispositionPause','MailAccount','rawAttributes','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','findAll','rows','show','find','body','params','catch','describe','addDisposition','Disposition','create','getDispositions','MailAccountId','includeAll','include','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findOne','removeAnswers','email','ListId','isNil','active','description','cservice','cauthentication','cuser','password','pass','cpassword','authentication','host','port','service','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','name','getImap','addImap','removeImap','setImap','getSmtp','addSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','omit','getInteractions','Contact','User','Owner','fullname','internal','Tag','color','tag','addApplications','sequelize','MailApplication','bulkCreate','priority','getApplications','MailMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','inlineCss','true','CmList','List','Contacts','updatedAt','DESC','from','%s\x20<%s>','attachments','join','root','server/files/attachments','basename','auth','secure','SendMail','sendMail','List\x20not\x20found','CmContact','out','messageId','Interaction','Messages','verifySmtp','VerifySmtp','ValidationError','addAgents','spread','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','papaparse','html-to-text','juice','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','register','jayson/promise','client','http','then','info','MailAccount,\x20%s,\x20%s','debug','MailAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','get','MailAccounts','stack','index','MailServerIn','Imap','MailServerOut'];(function(_0x45fc6a,_0x166adb){var _0x14bcfd=function(_0x3ba718){while(--_0x3ba718){_0x45fc6a['push'](_0x45fc6a['shift']());}};_0x14bcfd(++_0x166adb);}(_0x471a,0x88));var _0xa471=function(_0x47f937,_0x48a7d9){_0x47f937=_0x47f937-0x0;var _0x2b180f=_0x471a[_0x47f937];return _0x2b180f;};'use strict';var emlformat=require(_0xa471('0x0'));var rimraf=require(_0xa471('0x1'));var zipdir=require(_0xa471('0x2'));var jsonpatch=require(_0xa471('0x3'));var rp=require(_0xa471('0x4'));var moment=require(_0xa471('0x5'));var BPromise=require(_0xa471('0x6'));var Mustache=require('mustache');var util=require(_0xa471('0x7'));var path=require(_0xa471('0x8'));var sox=require(_0xa471('0x9'));var csv=require(_0xa471('0xa'));var ejs=require(_0xa471('0xb'));var fs=require('fs');var fs_extra=require(_0xa471('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xa471('0xd'));var jsforce=require(_0xa471('0xe'));var deskjs=require(_0xa471('0xf'));var toCsv=require(_0xa471('0xa'));var querystring=require('querystring');var Papa=require(_0xa471('0x10'));var htmlToText=require(_0xa471('0x11'));var juice=require(_0xa471('0x12'));var Redis=require(_0xa471('0x13'));var authService=require(_0xa471('0x14'));var qs=require(_0xa471('0x15'));var as=require(_0xa471('0x16'));var hardwareService=require(_0xa471('0x17'));var logger=require(_0xa471('0x18'))(_0xa471('0x19'));var utils=require(_0xa471('0x1a'));var config=require(_0xa471('0x1b'));var licenseUtil=require(_0xa471('0x1c'));var db=require(_0xa471('0x1d'))['db'];config[_0xa471('0x1e')]=_[_0xa471('0x1f')](config[_0xa471('0x1e')],{'host':_0xa471('0x20'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa471('0x1e')]));require('./mailAccount.socket')[_0xa471('0x21')](socket);var jayson=require(_0xa471('0x22'));var client=jayson[_0xa471('0x23')][_0xa471('0x24')]({'port':0x232b});function respondWithRpcPromise(_0x553f54,_0x2a8998,_0x5f0c63,_0x2fc856){return new BPromise(function(_0x38290d,_0x58039f){var _0x501348=_0x2fc856||client;return _0x501348['request'](_0x553f54,_0x5f0c63)[_0xa471('0x25')](function(_0x313a67){logger[_0xa471('0x26')](_0xa471('0x27'),_0x2a8998,'request\x20sent');logger[_0xa471('0x28')](_0xa471('0x29'),_0x2a8998,_0xa471('0x2a'),JSON['stringify'](_0x313a67));if(_0x313a67['error']){if(_0x313a67[_0xa471('0x2b')][_0xa471('0x2c')]===0x1f4){logger[_0xa471('0x2b')]('MailAccount,\x20%s,\x20%s',_0x2a8998,_0x313a67[_0xa471('0x2b')][_0xa471('0x2d')]);return _0x58039f(_0x313a67[_0xa471('0x2b')]['message']);}logger[_0xa471('0x2b')](_0xa471('0x27'),_0x2a8998,_0x313a67[_0xa471('0x2b')][_0xa471('0x2d')]);return _0x38290d(_0x313a67[_0xa471('0x2b')]['message']);}else{logger[_0xa471('0x26')](_0xa471('0x27'),_0x2a8998,_0xa471('0x2a'));_0x38290d(_0x313a67[_0xa471('0x2e')][_0xa471('0x2d')]);}})['catch'](function(_0x20f9d8){logger[_0xa471('0x2b')]('MailAccount,\x20%s,\x20%s',_0x2a8998,_0x20f9d8);_0x58039f(_0x20f9d8);});});}function respondWithStatusCode(_0x30b8ad,_0x44ddd1){_0x44ddd1=_0x44ddd1||0xcc;return function(_0x32a40f){if(_0x32a40f){return _0x30b8ad[_0xa471('0x2f')](_0x44ddd1);}return _0x30b8ad[_0xa471('0x30')](_0x44ddd1)[_0xa471('0x31')]();};}function respondWithResult(_0x53f738,_0x4c7fa7){_0x4c7fa7=_0x4c7fa7||0xc8;return function(_0x1db70b){if(_0x1db70b){return _0x53f738[_0xa471('0x30')](_0x4c7fa7)[_0xa471('0x32')](_0x1db70b);}};}function respondWithFilteredResult(_0x2072ed,_0x1a7335){return function(_0x28894c){if(_0x28894c){var _0xd42202=typeof _0x1a7335[_0xa471('0x33')]===_0xa471('0x34')&&typeof _0x1a7335[_0xa471('0x35')]===_0xa471('0x34');var _0x5d8cda=_0x28894c[_0xa471('0x36')];var _0x92f2d=_0xd42202?0x0:_0x1a7335[_0xa471('0x33')];var _0x393756=_0xd42202?_0x28894c[_0xa471('0x36')]:_0x1a7335[_0xa471('0x33')]+_0x1a7335[_0xa471('0x35')];var _0x24d7e4;if(_0x393756>=_0x5d8cda){_0x393756=_0x5d8cda;_0x24d7e4=0xc8;}else{_0x24d7e4=0xce;}_0x2072ed[_0xa471('0x30')](_0x24d7e4);return _0x2072ed[_0xa471('0x37')](_0xa471('0x38'),_0x92f2d+'-'+_0x393756+'/'+_0x5d8cda)[_0xa471('0x32')](_0x28894c);}return null;};}function patchUpdates(_0x5b7fa0){return function(_0x47b595){try{jsonpatch[_0xa471('0x39')](_0x47b595,_0x5b7fa0,!![]);}catch(_0x1dce3e){return BPromise[_0xa471('0x3a')](_0x1dce3e);}return _0x47b595[_0xa471('0x3b')]();};}function saveUpdates(_0x58fbdc,_0x5bc4b9){return function(_0x57e91f){if(_0x57e91f){return _0x57e91f[_0xa471('0x3c')](_0x58fbdc)['then'](function(_0x1dce2b){return _0x1dce2b;});}return null;};}function removeEntity(_0x49ca7c,_0x3ebbec){return function(_0x4108cb){if(_0x4108cb){return _0x4108cb[_0xa471('0x3d')]()[_0xa471('0x25')](function(){var _0x47346f=_0x4108cb[_0xa471('0x3e')]({'plain':!![]});var _0x1e0a07=_0xa471('0x3f');return db['UserProfileResource'][_0xa471('0x3d')]({'where':{'type':_0x1e0a07,'resourceId':_0x47346f['id']}})['then'](function(){return _0x4108cb;});})[_0xa471('0x25')](function(){_0x49ca7c['status'](0xcc)[_0xa471('0x31')]();});}};}function handleEntityNotFound(_0x3e9cd3,_0x31aa6a){return function(_0x60228c){if(!_0x60228c){_0x3e9cd3['sendStatus'](0x194);}return _0x60228c;};}function handleError(_0x3d2381,_0x296546){_0x296546=_0x296546||0x1f4;return function(_0x48f6c9){logger['error'](_0x48f6c9[_0xa471('0x40')]);if(_0x48f6c9['name']){delete _0x48f6c9['name'];}_0x3d2381[_0xa471('0x30')](_0x296546)['send'](_0x48f6c9);};}exports[_0xa471('0x41')]=function(_0x42ded2,_0x3fbb30){var _0x3f442b={'include':[{'model':db[_0xa471('0x42')],'as':_0xa471('0x43')},{'model':db[_0xa471('0x44')],'as':_0xa471('0x45')},{'model':db[_0xa471('0x46')],'as':_0xa471('0x47')}]},_0x5f1156={},_0x4473c={'count':0x0,'rows':[]};var _0x557ba=_['map'](db[_0xa471('0x48')][_0xa471('0x49')],function(_0x40928e){return{'name':_0x40928e['fieldName'],'type':_0x40928e['type'][_0xa471('0x4a')]};});_0x5f1156[_0xa471('0x4b')]=_[_0xa471('0x4c')](_0x557ba,'name');_0x5f1156[_0xa471('0x4d')]=_[_0xa471('0x4e')](_0x42ded2[_0xa471('0x4d')]);_0x5f1156[_0xa471('0x4f')]=_[_0xa471('0x50')](_0x5f1156[_0xa471('0x4b')],_0x5f1156['query']);_0x3f442b['attributes']=_[_0xa471('0x50')](_0x5f1156[_0xa471('0x4b')],qs[_0xa471('0x51')](_0x42ded2[_0xa471('0x4d')][_0xa471('0x51')]));_0x3f442b[_0xa471('0x52')]=_0x3f442b[_0xa471('0x52')][_0xa471('0x53')]?_0x3f442b[_0xa471('0x52')]:_0x5f1156['model'];if(!_0x42ded2[_0xa471('0x4d')][_0xa471('0x54')](_0xa471('0x55'))){_0x3f442b[_0xa471('0x35')]=qs['limit'](_0x42ded2[_0xa471('0x4d')][_0xa471('0x35')]);_0x3f442b[_0xa471('0x33')]=qs[_0xa471('0x33')](_0x42ded2[_0xa471('0x4d')][_0xa471('0x33')]);}_0x3f442b[_0xa471('0x56')]=qs['sort'](_0x42ded2[_0xa471('0x4d')][_0xa471('0x57')]);_0x3f442b[_0xa471('0x58')]=qs[_0xa471('0x4f')](_[_0xa471('0x59')](_0x42ded2[_0xa471('0x4d')],_0x5f1156[_0xa471('0x4f')]),_0x557ba);if(_0x42ded2['query']['filter']){_0x3f442b[_0xa471('0x58')]=_[_0xa471('0x5a')](_0x3f442b[_0xa471('0x58')],{'$or':_[_0xa471('0x4c')](_0x557ba,function(_0x43e0d2){if(_0x43e0d2[_0xa471('0x5b')]!==_0xa471('0x5c')){var _0x42d557={};_0x42d557[_0x43e0d2['name']]={'$like':'%'+_0x42ded2['query'][_0xa471('0x5d')]+'%'};return _0x42d557;}})});}_0x3f442b=_[_0xa471('0x5a')]({},_0x3f442b,_0x42ded2[_0xa471('0x5e')]);var _0x2b63b7={'where':_0x3f442b[_0xa471('0x58')]};return db[_0xa471('0x48')][_0xa471('0x36')](_0x2b63b7)['then'](function(_0x313414){_0x4473c[_0xa471('0x36')]=_0x313414;if(_0x42ded2['query']['includeAll']){_0x3f442b['include']=[{'all':!![]}];}return db['MailAccount'][_0xa471('0x5f')](_0x3f442b);})[_0xa471('0x25')](function(_0x3e4df8){_0x4473c[_0xa471('0x60')]=_0x3e4df8;return _0x4473c;})[_0xa471('0x25')](respondWithFilteredResult(_0x3fbb30,_0x3f442b))['catch'](handleError(_0x3fbb30,null));};exports[_0xa471('0x61')]=function(_0x246399,_0x5c0e15){var _0x5db542={'raw':![],'where':{'id':_0x246399['params']['id']},'include':[{'model':db[_0xa471('0x42')],'as':_0xa471('0x43')},{'model':db[_0xa471('0x44')],'as':_0xa471('0x45')},{'model':db['Pause'],'as':_0xa471('0x47')}]},_0x2aa612={};_0x2aa612[_0xa471('0x4b')]=_[_0xa471('0x4e')](db[_0xa471('0x48')][_0xa471('0x49')]);_0x2aa612[_0xa471('0x4d')]=_[_0xa471('0x4e')](_0x246399[_0xa471('0x4d')]);_0x2aa612[_0xa471('0x4f')]=_[_0xa471('0x50')](_0x2aa612['model'],_0x2aa612['query']);_0x5db542[_0xa471('0x52')]=_[_0xa471('0x50')](_0x2aa612[_0xa471('0x4b')],qs[_0xa471('0x51')](_0x246399['query']['fields']));_0x5db542[_0xa471('0x52')]=_0x5db542[_0xa471('0x52')][_0xa471('0x53')]?_0x5db542[_0xa471('0x52')]:_0x2aa612['model'];if(_0x246399[_0xa471('0x4d')]['includeAll']){_0x5db542['include']=[{'all':!![]}];}_0x5db542=_[_0xa471('0x5a')]({},_0x5db542,_0x246399[_0xa471('0x5e')]);return db[_0xa471('0x48')][_0xa471('0x62')](_0x5db542)[_0xa471('0x25')](handleEntityNotFound(_0x5c0e15,null))['then'](respondWithResult(_0x5c0e15,null))['catch'](handleError(_0x5c0e15,null));};exports['update']=function(_0x421a12,_0x1a63f1){if(_0x421a12[_0xa471('0x63')]['id']){delete _0x421a12[_0xa471('0x63')]['id'];}return db[_0xa471('0x48')][_0xa471('0x62')]({'where':{'id':_0x421a12[_0xa471('0x64')]['id']},'include':[{'model':db['MailServerIn'],'as':_0xa471('0x43')},{'model':db[_0xa471('0x44')],'as':'Smtp'},{'model':db[_0xa471('0x46')],'as':_0xa471('0x47')}]})['then'](handleEntityNotFound(_0x1a63f1,null))[_0xa471('0x25')](saveUpdates(_0x421a12[_0xa471('0x63')],null))[_0xa471('0x25')](function(_0x3de6ec){if(_0x3de6ec&&_0x421a12[_0xa471('0x63')][_0xa471('0x43')]){return db['MailServerIn'][_0xa471('0x3c')](_0x421a12[_0xa471('0x63')][_0xa471('0x43')],{'where':{'MailAccountId':_0x3de6ec['id']}})[_0xa471('0x25')](function(){return _0x3de6ec;});}return _0x3de6ec;})[_0xa471('0x25')](function(_0x54a033){if(_0x54a033&&_0x421a12[_0xa471('0x63')]['Smtp']){return db[_0xa471('0x44')][_0xa471('0x3c')](_0x421a12[_0xa471('0x63')][_0xa471('0x45')],{'where':{'MailAccountId':_0x54a033['id']}})[_0xa471('0x25')](function(){return _0x54a033;});}return _0x54a033;})[_0xa471('0x25')](respondWithResult(_0x1a63f1,null))[_0xa471('0x65')](handleError(_0x1a63f1,null));};exports[_0xa471('0x66')]=function(_0xd4a9a9,_0x419602){return db[_0xa471('0x48')]['describe']()[_0xa471('0x25')](respondWithResult(_0x419602,null))['catch'](handleError(_0x419602,null));};exports[_0xa471('0x67')]=function(_0x1973e7,_0x41b402,_0x44cf7d){if(_0x1973e7['body']['id']){delete _0x1973e7['body']['id'];}return db['MailAccount']['find']({'where':{'id':_0x1973e7['params']['id']}})[_0xa471('0x25')](handleEntityNotFound(_0x41b402,null))[_0xa471('0x25')](function(_0x597f31){if(_0x597f31){_0x1973e7[_0xa471('0x63')]['MailAccountId']=_0x597f31['id'];return db[_0xa471('0x68')][_0xa471('0x69')](_0x1973e7[_0xa471('0x63')]);}})[_0xa471('0x25')](respondWithResult(_0x41b402,null))[_0xa471('0x65')](handleError(_0x41b402,null));};exports[_0xa471('0x6a')]=function(_0x423f2b,_0xd3ba55,_0x5a2c36){var _0x396e06={'raw':![],'where':{}};var _0x11e092={};var _0x329448={'count':0x0,'rows':[]};return db['MailAccount']['findOne']({'where':{'id':_0x423f2b[_0xa471('0x64')]['id']}})[_0xa471('0x25')](handleEntityNotFound(_0xd3ba55,null))[_0xa471('0x25')](function(_0x5642e0){if(_0x5642e0){_0x11e092['model']=_[_0xa471('0x4e')](db[_0xa471('0x68')][_0xa471('0x49')]);_0x11e092[_0xa471('0x4d')]=_[_0xa471('0x4e')](_0x423f2b['query']);_0x11e092[_0xa471('0x4f')]=_[_0xa471('0x50')](_0x11e092[_0xa471('0x4b')],_0x11e092[_0xa471('0x4d')]);_0x396e06['attributes']=_[_0xa471('0x50')](_0x11e092['model'],qs[_0xa471('0x51')](_0x423f2b[_0xa471('0x4d')][_0xa471('0x51')]));_0x396e06['attributes']=_0x396e06['attributes'][_0xa471('0x53')]?_0x396e06[_0xa471('0x52')]:_0x11e092['model'];if(!_0x423f2b[_0xa471('0x4d')][_0xa471('0x54')](_0xa471('0x55'))){_0x396e06[_0xa471('0x35')]=qs['limit'](_0x423f2b[_0xa471('0x4d')][_0xa471('0x35')]);_0x396e06[_0xa471('0x33')]=qs[_0xa471('0x33')](_0x423f2b[_0xa471('0x4d')][_0xa471('0x33')]);}_0x396e06['order']=qs[_0xa471('0x57')](_0x423f2b[_0xa471('0x4d')][_0xa471('0x57')]);_0x396e06[_0xa471('0x58')]=qs[_0xa471('0x4f')](_[_0xa471('0x59')](_0x423f2b[_0xa471('0x4d')],_0x11e092[_0xa471('0x4f')]));_0x396e06['where'][_0xa471('0x6b')]=_0x5642e0['id'];if(_0x423f2b[_0xa471('0x4d')][_0xa471('0x5d')]){_0x396e06['where']=_[_0xa471('0x5a')](_0x396e06[_0xa471('0x58')],{'$or':_['map'](_0x396e06['attributes'],function(_0x4bbee3){var _0x569faa={};_0x569faa[_0x4bbee3]={'$like':'%'+_0x423f2b[_0xa471('0x4d')][_0xa471('0x5d')]+'%'};return _0x569faa;})});}_0x396e06=_[_0xa471('0x5a')]({},_0x396e06,_0x423f2b[_0xa471('0x5e')]);return db[_0xa471('0x68')][_0xa471('0x36')]({'where':_0x396e06[_0xa471('0x58')]})[_0xa471('0x25')](function(_0x3057bb){_0x329448[_0xa471('0x36')]=_0x3057bb;if(_0x423f2b[_0xa471('0x4d')][_0xa471('0x6c')]){_0x396e06[_0xa471('0x6d')]=[{'all':!![]}];}return db[_0xa471('0x68')][_0xa471('0x5f')](_0x396e06);})[_0xa471('0x25')](function(_0x55d34e){_0x329448['rows']=_0x55d34e;return _0x329448;});}})[_0xa471('0x25')](respondWithFilteredResult(_0xd3ba55,_0x396e06))[_0xa471('0x65')](handleError(_0xd3ba55,null));};exports[_0xa471('0x6e')]=function(_0x1108b5,_0x3c1544,_0x2f926a){return db[_0xa471('0x48')]['find']({'where':{'id':_0x1108b5[_0xa471('0x64')]['id']}})[_0xa471('0x25')](handleEntityNotFound(_0x3c1544,null))[_0xa471('0x25')](function(_0x3784b5){if(_0x3784b5){return _0x3784b5[_0xa471('0x6e')](_0x1108b5[_0xa471('0x4d')][_0xa471('0x6f')]);}})['then'](respondWithStatusCode(_0x3c1544,null))['catch'](handleError(_0x3c1544,null));};exports[_0xa471('0x70')]=function(_0x52d430,_0x58cb1e,_0x1c14fb){if(_0x52d430[_0xa471('0x63')]['id']){delete _0x52d430['body']['id'];}return db[_0xa471('0x48')][_0xa471('0x62')]({'where':{'id':_0x52d430[_0xa471('0x64')]['id']}})['then'](handleEntityNotFound(_0x58cb1e,null))[_0xa471('0x25')](function(_0x4a1d4e){if(_0x4a1d4e){_0x52d430[_0xa471('0x63')]['MailAccountId']=_0x4a1d4e['id'];return db[_0xa471('0x71')][_0xa471('0x69')](_0x52d430[_0xa471('0x63')]);}})[_0xa471('0x25')](respondWithResult(_0x58cb1e,null))[_0xa471('0x65')](handleError(_0x58cb1e,null));};exports[_0xa471('0x72')]=function(_0x8be066,_0x471bfb,_0x4f6887){var _0x250bd3={'raw':![],'where':{}};var _0x259264={};var _0x58f4ac={'count':0x0,'rows':[]};return db[_0xa471('0x48')][_0xa471('0x73')]({'where':{'id':_0x8be066[_0xa471('0x64')]['id']}})[_0xa471('0x25')](handleEntityNotFound(_0x471bfb,null))[_0xa471('0x25')](function(_0x3447b7){if(_0x3447b7){_0x259264['model']=_[_0xa471('0x4e')](db[_0xa471('0x71')]['rawAttributes']);_0x259264['query']=_[_0xa471('0x4e')](_0x8be066[_0xa471('0x4d')]);_0x259264[_0xa471('0x4f')]=_['intersection'](_0x259264[_0xa471('0x4b')],_0x259264[_0xa471('0x4d')]);_0x250bd3[_0xa471('0x52')]=_[_0xa471('0x50')](_0x259264[_0xa471('0x4b')],qs[_0xa471('0x51')](_0x8be066[_0xa471('0x4d')][_0xa471('0x51')]));_0x250bd3[_0xa471('0x52')]=_0x250bd3[_0xa471('0x52')][_0xa471('0x53')]?_0x250bd3[_0xa471('0x52')]:_0x259264['model'];if(!_0x8be066[_0xa471('0x4d')]['hasOwnProperty'](_0xa471('0x55'))){_0x250bd3[_0xa471('0x35')]=qs[_0xa471('0x35')](_0x8be066['query'][_0xa471('0x35')]);_0x250bd3['offset']=qs[_0xa471('0x33')](_0x8be066[_0xa471('0x4d')][_0xa471('0x33')]);}_0x250bd3[_0xa471('0x56')]=qs[_0xa471('0x57')](_0x8be066['query'][_0xa471('0x57')]);_0x250bd3[_0xa471('0x58')]=qs[_0xa471('0x4f')](_[_0xa471('0x59')](_0x8be066[_0xa471('0x4d')],_0x259264['filters']));_0x250bd3[_0xa471('0x58')][_0xa471('0x6b')]=_0x3447b7['id'];if(_0x8be066['query']['filter']){_0x250bd3[_0xa471('0x58')]=_[_0xa471('0x5a')](_0x250bd3[_0xa471('0x58')],{'$or':_[_0xa471('0x4c')](_0x250bd3['attributes'],function(_0xfce415){var _0x5e4225={};_0x5e4225[_0xfce415]={'$like':'%'+_0x8be066[_0xa471('0x4d')]['filter']+'%'};return _0x5e4225;})});}_0x250bd3=_[_0xa471('0x5a')]({},_0x250bd3,_0x8be066[_0xa471('0x5e')]);return db[_0xa471('0x71')][_0xa471('0x36')]({'where':_0x250bd3[_0xa471('0x58')]})[_0xa471('0x25')](function(_0x3a2ff7){_0x58f4ac[_0xa471('0x36')]=_0x3a2ff7;if(_0x8be066['query'][_0xa471('0x6c')]){_0x250bd3[_0xa471('0x6d')]=[{'all':!![]}];}return db[_0xa471('0x71')][_0xa471('0x5f')](_0x250bd3);})[_0xa471('0x25')](function(_0x520029){_0x58f4ac[_0xa471('0x60')]=_0x520029;return _0x58f4ac;});}})[_0xa471('0x25')](respondWithFilteredResult(_0x471bfb,_0x250bd3))[_0xa471('0x65')](handleError(_0x471bfb,null));};exports[_0xa471('0x74')]=function(_0x44b83d,_0x54672d,_0x390e0b){return db[_0xa471('0x48')][_0xa471('0x62')]({'where':{'id':_0x44b83d[_0xa471('0x64')]['id']}})['then'](handleEntityNotFound(_0x54672d,null))[_0xa471('0x25')](function(_0xb13383){if(_0xb13383){return _0xb13383[_0xa471('0x74')](_0x44b83d[_0xa471('0x4d')]['ids']);}})[_0xa471('0x25')](respondWithStatusCode(_0x54672d,null))[_0xa471('0x65')](handleError(_0x54672d,null));};exports[_0xa471('0x69')]=function(_0x7f5324,_0x74fba9){var _0x1974e9={'name':_0x7f5324['body']['name'],'key':_0x7f5324['body']['key'],'email':_0x7f5324['body'][_0xa471('0x75')],'ListId':_0x7f5324['body'][_0xa471('0x76')],'active':!_[_0xa471('0x77')](_0x7f5324[_0xa471('0x63')]['active'])?_0x7f5324['body'][_0xa471('0x78')]:!![],'description':_0x7f5324[_0xa471('0x63')][_0xa471('0x79')]||null,'Imap':{},'Smtp':{}};if(_[_0xa471('0x77')](_0x7f5324['body'][_0xa471('0x7a')])){if(_0x7f5324[_0xa471('0x63')][_0xa471('0x7b')]){_0x1974e9[_0xa471('0x43')]['user']=_0x1974e9[_0xa471('0x45')]['user']=_0x7f5324[_0xa471('0x63')][_0xa471('0x7c')];_0x1974e9[_0xa471('0x43')][_0xa471('0x7d')]=_0x1974e9[_0xa471('0x45')][_0xa471('0x7e')]=_0x7f5324[_0xa471('0x63')][_0xa471('0x7f')];}else{_0x1974e9['Imap'][_0xa471('0x80')]=_0x1974e9[_0xa471('0x45')][_0xa471('0x80')]=![];}_0x1974e9[_0xa471('0x43')]['host']=_0x7f5324[_0xa471('0x63')][_0xa471('0x43')]['host'];_0x1974e9[_0xa471('0x43')]['port']=_0x7f5324[_0xa471('0x63')]['Imap']['port'];_0x1974e9['Smtp'][_0xa471('0x81')]=_0x7f5324['body'][_0xa471('0x45')][_0xa471('0x81')];_0x1974e9[_0xa471('0x45')][_0xa471('0x82')]=_0x7f5324[_0xa471('0x63')][_0xa471('0x45')][_0xa471('0x82')];}else{_0x1974e9[_0xa471('0x43')][_0xa471('0x83')]=_0x1974e9['Smtp'][_0xa471('0x83')]=_0x7f5324[_0xa471('0x63')][_0xa471('0x7a')];_0x1974e9[_0xa471('0x43')]['user']=_0x1974e9['Smtp']['user']=_0x7f5324[_0xa471('0x63')]['cuser'];_0x1974e9['Imap'][_0xa471('0x7d')]=_0x1974e9[_0xa471('0x45')][_0xa471('0x7e')]=_0x7f5324[_0xa471('0x63')][_0xa471('0x7f')];}return db[_0xa471('0x48')]['create'](_0x1974e9,{'include':[{'model':db[_0xa471('0x44')],'as':_0xa471('0x45')},{'model':db[_0xa471('0x42')],'as':_0xa471('0x43')}]})[_0xa471('0x25')](function(_0x13c835){var _0x17a6bd=_0x7f5324[_0xa471('0x84')][_0xa471('0x3e')]({'plain':!![]});if(!_0x17a6bd)throw new Error(_0xa471('0x85'));if(_0x17a6bd['role']===_0xa471('0x84')){var _0x2b6b80=_0x13c835[_0xa471('0x3e')]({'plain':!![]});return db[_0xa471('0x86')][_0xa471('0x62')]({'where':{'name':_0xa471('0x3f'),'userProfileId':_0x17a6bd[_0xa471('0x87')]},'raw':!![]})['then'](function(_0x3e2189){if(_0x3e2189&&_0x3e2189[_0xa471('0x88')]===0x0){return db[_0xa471('0x89')][_0xa471('0x69')]({'name':_0x2b6b80[_0xa471('0x8a')],'resourceId':_0x2b6b80['id'],'type':_0x3e2189[_0xa471('0x8a')],'sectionId':_0x3e2189['id']},{})[_0xa471('0x25')](function(){return _0x13c835;});}else{return _0x13c835;}})[_0xa471('0x65')](function(_0xc2e8e7){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xc2e8e7);throw _0xc2e8e7;});}return _0x13c835;})['then'](respondWithResult(_0x74fba9,0xc9))['catch'](handleError(_0x74fba9,null));};exports[_0xa471('0x8b')]=function(_0xd9cdf3,_0x154dee,_0x4bac7f){return db['MailAccount']['findOne']({'where':{'id':_0xd9cdf3[_0xa471('0x64')]['id']}})[_0xa471('0x25')](handleEntityNotFound(_0x154dee,null))[_0xa471('0x25')](function(_0x4274f7){if(_0x4274f7){return _0x4274f7[_0xa471('0x8b')]();}return null;})['then'](respondWithResult(_0x154dee,null))[_0xa471('0x65')](handleError(_0x154dee,null));};exports[_0xa471('0x8c')]=function(_0xf80e6f,_0x3ee2b0,_0x1b03d0){if(_0xf80e6f[_0xa471('0x63')]['id']){delete _0xf80e6f[_0xa471('0x63')]['id'];}return db[_0xa471('0x48')][_0xa471('0x62')]({'where':{'id':_0xf80e6f[_0xa471('0x64')]['id']}})[_0xa471('0x25')](handleEntityNotFound(_0x3ee2b0,null))[_0xa471('0x25')](function(_0x30102b){if(_0x30102b){_0xf80e6f['body'][_0xa471('0x6b')]=_0x30102b['id'];return db[_0xa471('0x42')][_0xa471('0x69')](_0xf80e6f['body']);}})[_0xa471('0x25')](respondWithResult(_0x3ee2b0,null))['catch'](handleError(_0x3ee2b0,null));};exports[_0xa471('0x8d')]=function(_0x1c6539,_0x2d7515,_0x39b978){return db['MailAccount'][_0xa471('0x73')]({'where':{'id':_0x1c6539['params']['id']}})[_0xa471('0x25')](handleEntityNotFound(_0x2d7515,null))[_0xa471('0x25')](function(_0x21e10e){if(_0x21e10e){return _0x21e10e[_0xa471('0x8e')](null);}return null;})[_0xa471('0x25')](respondWithStatusCode(_0x2d7515,null))[_0xa471('0x65')](handleError(_0x2d7515,null));};exports['getSmtp']=function(_0x4b0b66,_0x5bfba9,_0xf3ef55){return db[_0xa471('0x48')][_0xa471('0x73')]({'where':{'id':_0x4b0b66[_0xa471('0x64')]['id']}})['then'](handleEntityNotFound(_0x5bfba9,null))[_0xa471('0x25')](function(_0x19255f){if(_0x19255f){return _0x19255f[_0xa471('0x8f')]();}return null;})['then'](respondWithResult(_0x5bfba9,null))[_0xa471('0x65')](handleError(_0x5bfba9,null));};exports[_0xa471('0x90')]=function(_0x436577,_0x21b05a,_0x98445c){if(_0x436577[_0xa471('0x63')]['id']){delete _0x436577[_0xa471('0x63')]['id'];}return db[_0xa471('0x48')]['find']({'where':{'id':_0x436577['params']['id']}})[_0xa471('0x25')](handleEntityNotFound(_0x21b05a,null))[_0xa471('0x25')](function(_0x5f114f){if(_0x5f114f){_0x436577[_0xa471('0x63')][_0xa471('0x6b')]=_0x5f114f['id'];return db['MailServerOut'][_0xa471('0x69')](_0x436577[_0xa471('0x63')]);}})[_0xa471('0x25')](respondWithResult(_0x21b05a,null))[_0xa471('0x65')](handleError(_0x21b05a,null));};exports[_0xa471('0x91')]=function(_0xbafc5d,_0x1a7d92,_0x441344){return db[_0xa471('0x48')]['findOne']({'where':{'id':_0xbafc5d[_0xa471('0x64')]['id']}})[_0xa471('0x25')](handleEntityNotFound(_0x1a7d92,null))[_0xa471('0x25')](function(_0x3bc6a4){if(_0x3bc6a4){return _0x3bc6a4[_0xa471('0x92')](null);}return null;})[_0xa471('0x25')](respondWithStatusCode(_0x1a7d92,null))[_0xa471('0x65')](handleError(_0x1a7d92,null));};exports[_0xa471('0x93')]=function(_0x97b8ff,_0x44a9b4,_0x3dfa93){return db[_0xa471('0x94')][_0xa471('0x62')]({'where':{'id':_0x97b8ff[_0xa471('0x64')]['id']}})[_0xa471('0x25')](handleEntityNotFound(_0x44a9b4,null))[_0xa471('0x25')](function(_0x13a1bd){if(_0x13a1bd){return _0x13a1bd[_0xa471('0x93')](_0x97b8ff[_0xa471('0x63')][_0xa471('0x6f')],_[_0xa471('0x95')](_0x97b8ff[_0xa471('0x63')],[_0xa471('0x6f'),'id'])||{});}})['then'](respondWithResult(_0x44a9b4,null))[_0xa471('0x65')](handleError(_0x44a9b4,null));};exports[_0xa471('0x96')]=function(_0x40cd96,_0x5e08d5,_0x33ffbe){var _0x1fcc77={'raw':![],'where':{}};var _0x4f1d97={};var _0x1c21c1={'count':0x0,'rows':[]};return db[_0xa471('0x48')][_0xa471('0x73')]({'where':{'id':_0x40cd96[_0xa471('0x64')]['id']}})[_0xa471('0x25')](handleEntityNotFound(_0x5e08d5,null))[_0xa471('0x25')](function(_0x3d4bb9){if(_0x3d4bb9){_0x4f1d97[_0xa471('0x4b')]=_[_0xa471('0x4e')](db['MailInteraction']['rawAttributes']);_0x4f1d97[_0xa471('0x4d')]=_[_0xa471('0x4e')](_0x40cd96[_0xa471('0x4d')]);_0x4f1d97[_0xa471('0x4f')]=_[_0xa471('0x50')](_0x4f1d97[_0xa471('0x4b')],_0x4f1d97[_0xa471('0x4d')]);_0x1fcc77[_0xa471('0x52')]=_[_0xa471('0x50')](_0x4f1d97[_0xa471('0x4b')],qs['fields'](_0x40cd96[_0xa471('0x4d')][_0xa471('0x51')]));_0x1fcc77[_0xa471('0x52')]=_0x1fcc77[_0xa471('0x52')][_0xa471('0x53')]?_0x1fcc77[_0xa471('0x52')]:_0x4f1d97['model'];if(!_0x40cd96[_0xa471('0x4d')][_0xa471('0x54')](_0xa471('0x55'))){_0x1fcc77[_0xa471('0x35')]=qs['limit'](_0x40cd96[_0xa471('0x4d')][_0xa471('0x35')]);_0x1fcc77['offset']=qs[_0xa471('0x33')](_0x40cd96['query']['offset']);}_0x1fcc77[_0xa471('0x56')]=qs[_0xa471('0x57')](_0x40cd96[_0xa471('0x4d')]['sort']);_0x1fcc77[_0xa471('0x58')]=qs[_0xa471('0x4f')](_[_0xa471('0x59')](_0x40cd96[_0xa471('0x4d')],_0x4f1d97[_0xa471('0x4f')]));_0x1fcc77[_0xa471('0x58')][_0xa471('0x6b')]=_0x3d4bb9['id'];if(_0x40cd96[_0xa471('0x4d')][_0xa471('0x5d')]){_0x1fcc77[_0xa471('0x58')]=_[_0xa471('0x5a')](_0x1fcc77['where'],{'$or':_['map'](_0x1fcc77[_0xa471('0x52')],function(_0x2e7d29){var _0x4c28b0={};_0x4c28b0[_0x2e7d29]={'$like':'%'+_0x40cd96[_0xa471('0x4d')][_0xa471('0x5d')]+'%'};return _0x4c28b0;})});}_0x1fcc77=_[_0xa471('0x5a')]({},_0x1fcc77,_0x40cd96['options']);return db[_0xa471('0x94')][_0xa471('0x36')]({'where':_0x1fcc77[_0xa471('0x58')]})['then'](function(_0x21bece){_0x1c21c1[_0xa471('0x36')]=_0x21bece;if(_0x40cd96[_0xa471('0x4d')][_0xa471('0x6c')]){_0x1fcc77[_0xa471('0x6d')]=[{'model':db['CmContact'],'as':_0xa471('0x97'),'required':![]},{'model':db[_0xa471('0x98')],'as':_0xa471('0x99'),'attributes':[_0xa471('0x8a'),_0xa471('0x9a'),_0xa471('0x9b')],'required':![]},{'model':db[_0xa471('0x9c')],'as':'Tags','attributes':['id','name',_0xa471('0x9d')],'where':_0x40cd96[_0xa471('0x4d')][_0xa471('0x9e')]?{'id':_0x40cd96[_0xa471('0x4d')]['tag']}:undefined,'required':_0x40cd96[_0xa471('0x4d')]['tag']?!![]:![]}];}return db[_0xa471('0x94')]['findAll'](_0x1fcc77);})[_0xa471('0x25')](function(_0xb50765){_0x1c21c1[_0xa471('0x60')]=_0xb50765;return _0x1c21c1;});}})['then'](respondWithFilteredResult(_0x5e08d5,_0x1fcc77))[_0xa471('0x65')](handleError(_0x5e08d5,null));};exports[_0xa471('0x9f')]=function(_0x4e15a0,_0x3f929d,_0x5642c9){return db[_0xa471('0x48')][_0xa471('0x73')]({'where':{'id':_0x4e15a0[_0xa471('0x64')]['id']}})[_0xa471('0x25')](handleEntityNotFound(_0x3f929d,null))[_0xa471('0x25')](function(_0x58f71b){if(_0x58f71b){return db[_0xa471('0xa0')]['transaction'](function(_0x365fc0){return db['MailApplication'][_0xa471('0x3d')]({'where':{'MailAccountId':_0x4e15a0[_0xa471('0x64')]['id']},'transaction':_0x365fc0})[_0xa471('0x25')](function(_0x3465a6){var _0x27be84=_[_0xa471('0x4c')](_0x4e15a0[_0xa471('0x63')],function(_0x597c22){_0x597c22[_0xa471('0x6b')]=_0x4e15a0[_0xa471('0x64')]['id'];return _0x597c22;});return db[_0xa471('0xa1')][_0xa471('0xa2')](_0x27be84,{'transaction':_0x365fc0});});})['then'](function(){return db[_0xa471('0xa1')]['findAndCountAll']({'where':{'MailAccountId':_0x4e15a0['params']['id']},'order':_0xa471('0xa3')});});}})[_0xa471('0x25')](respondWithResult(_0x3f929d,null))[_0xa471('0x65')](handleError(_0x3f929d,null));};exports[_0xa471('0xa4')]=function(_0x152579,_0x8a1fee,_0x3ec49d){var _0x3b5f4f={};var _0x4b221f={};var _0x5f5835;var _0x4de037;return db[_0xa471('0x48')][_0xa471('0x73')]({'where':{'id':_0x152579['params']['id']}})[_0xa471('0x25')](handleEntityNotFound(_0x8a1fee,null))[_0xa471('0x25')](function(_0x29ddb2){if(_0x29ddb2){_0x5f5835=_0x29ddb2;_0x4b221f[_0xa471('0x4b')]=_[_0xa471('0x4e')](db[_0xa471('0xa1')][_0xa471('0x49')]);_0x4b221f[_0xa471('0x4d')]=_[_0xa471('0x4e')](_0x152579[_0xa471('0x4d')]);_0x4b221f[_0xa471('0x4f')]=_[_0xa471('0x50')](_0x4b221f[_0xa471('0x4b')],_0x4b221f['query']);_0x3b5f4f['attributes']=_['intersection'](_0x4b221f[_0xa471('0x4b')],qs['fields'](_0x152579[_0xa471('0x4d')][_0xa471('0x51')]));_0x3b5f4f['attributes']=_0x3b5f4f[_0xa471('0x52')][_0xa471('0x53')]?_0x3b5f4f[_0xa471('0x52')]:_0x4b221f[_0xa471('0x4b')];_0x3b5f4f['order']=qs[_0xa471('0x57')](_0x152579[_0xa471('0x4d')][_0xa471('0x57')]);_0x3b5f4f['where']=qs[_0xa471('0x4f')](_['pick'](_0x152579[_0xa471('0x4d')],_0x4b221f[_0xa471('0x4f')]));if(_0x152579[_0xa471('0x4d')]['filter']){_0x3b5f4f[_0xa471('0x58')]=_['merge'](_0x3b5f4f['where'],{'$or':_[_0xa471('0x4c')](_0x3b5f4f[_0xa471('0x52')],function(_0x38f887){var _0x57480c={};_0x57480c[_0x38f887]={'$like':'%'+_0x152579[_0xa471('0x4d')]['filter']+'%'};return _0x57480c;})});}_0x3b5f4f=_[_0xa471('0x5a')]({},_0x3b5f4f,_0x152579[_0xa471('0x5e')]);return _0x5f5835[_0xa471('0xa4')](_0x3b5f4f);}})[_0xa471('0x25')](function(_0x22b498){if(_0x22b498){_0x4de037=_0x22b498[_0xa471('0x53')];if(!_0x152579[_0xa471('0x4d')][_0xa471('0x54')](_0xa471('0x55'))){_0x3b5f4f[_0xa471('0x35')]=qs[_0xa471('0x35')](_0x152579[_0xa471('0x4d')][_0xa471('0x35')]);_0x3b5f4f[_0xa471('0x33')]=qs['offset'](_0x152579[_0xa471('0x4d')][_0xa471('0x33')]);}return _0x5f5835[_0xa471('0xa4')](_0x3b5f4f);}})[_0xa471('0x25')](function(_0x3a49d8){if(_0x3a49d8){return _0x3a49d8?{'count':_0x4de037,'rows':_0x3a49d8}:null;}})[_0xa471('0x25')](respondWithResult(_0x8a1fee,null))[_0xa471('0x65')](handleError(_0x8a1fee,null));};exports['getMessages']=function(_0x487fdb,_0xb9ecab,_0x24068f){var _0x581586={'raw':!![],'where':{}};var _0x4856e7={};var _0x2cf5be={'count':0x0,'rows':[]};return db[_0xa471('0x48')][_0xa471('0x73')]({'where':{'id':_0x487fdb[_0xa471('0x64')]['id']}})['then'](handleEntityNotFound(_0xb9ecab,null))[_0xa471('0x25')](function(_0xdeddc5){if(_0xdeddc5){_0x4856e7[_0xa471('0x4b')]=_[_0xa471('0x4e')](db[_0xa471('0xa5')][_0xa471('0x49')]);_0x4856e7[_0xa471('0x4d')]=_['keys'](_0x487fdb[_0xa471('0x4d')]);_0x4856e7['filters']=_[_0xa471('0x50')](_0x4856e7[_0xa471('0x4b')],_0x4856e7['query']);_0x581586[_0xa471('0x52')]=_[_0xa471('0x50')](_0x4856e7[_0xa471('0x4b')],qs['fields'](_0x487fdb[_0xa471('0x4d')][_0xa471('0x51')]));_0x581586[_0xa471('0x52')]=_0x581586['attributes']['length']?_0x581586[_0xa471('0x52')]:_0x4856e7[_0xa471('0x4b')];if(!_0x487fdb[_0xa471('0x4d')]['hasOwnProperty'](_0xa471('0x55'))){_0x581586[_0xa471('0x35')]=qs[_0xa471('0x35')](_0x487fdb[_0xa471('0x4d')][_0xa471('0x35')]);_0x581586[_0xa471('0x33')]=qs[_0xa471('0x33')](_0x487fdb[_0xa471('0x4d')][_0xa471('0x33')]);}_0x581586['order']=qs[_0xa471('0x57')](_0x487fdb[_0xa471('0x4d')]['sort']);_0x581586[_0xa471('0x58')]=qs[_0xa471('0x4f')](_[_0xa471('0x59')](_0x487fdb[_0xa471('0x4d')],_0x4856e7[_0xa471('0x4f')]));_0x581586['where'][_0xa471('0x6b')]=_0xdeddc5['id'];if(_0x487fdb['query'][_0xa471('0x5d')]){_0x581586['where']=_['merge'](_0x581586[_0xa471('0x58')],{'$or':_['map'](_0x581586[_0xa471('0x52')],function(_0x2af347){var _0x550de3={};_0x550de3[_0x2af347]={'$like':'%'+_0x487fdb[_0xa471('0x4d')][_0xa471('0x5d')]+'%'};return _0x550de3;})});}if(_0x487fdb['query']['$gte']){var _0x2c173b=_0x487fdb['query'][_0xa471('0xa6')][_0xa471('0xa7')](',');var _0xac187d={};_0xac187d[_0x2c173b[0x0]]={'$gte':moment(_0x2c173b[0x1])[_0xa471('0xa8')](_0xa471('0xa9'))};_0x581586['where']=_[_0xa471('0x5a')](_0x581586[_0xa471('0x58')],_0xac187d);}_0x581586=_['merge']({},_0x581586,_0x487fdb[_0xa471('0x5e')]);return db[_0xa471('0xa5')][_0xa471('0x36')]({'where':_0x581586[_0xa471('0x58')]})['then'](function(_0x24d46f){_0x2cf5be[_0xa471('0x36')]=_0x24d46f;if(_0x487fdb[_0xa471('0x4d')][_0xa471('0x6c')]){_0x581586[_0xa471('0x6d')]=[{'all':!![]}];}return db['MailMessage'][_0xa471('0x5f')](_0x581586);})[_0xa471('0x25')](function(_0x28f864){if(_0x487fdb[_0xa471('0x4d')][_0xa471('0xaa')]===_0xa471('0xab')){for(var _0x145f55=0x0;_0x145f55<_0x28f864[_0xa471('0x53')];_0x145f55++){_0x28f864[_0x145f55][_0xa471('0x63')]=juice(_0x28f864[_0x145f55][_0xa471('0x63')]);}}_0x2cf5be[_0xa471('0x60')]=_0x28f864;return _0x2cf5be;});}})[_0xa471('0x25')](respondWithFilteredResult(_0xb9ecab,_0x581586))[_0xa471('0x65')](handleError(_0xb9ecab,null));};exports['send']=function(_0x43a150,_0x585dbe,_0x28f367){var _0xc3b38b,_0x39cdaf={},_0x25bd23;if(_0x43a150[_0xa471('0x63')]['to']){_0x25bd23=_0x43a150[_0xa471('0x63')]['to'][_0xa471('0xa7')](',')[0x0];}return db[_0xa471('0x48')][_0xa471('0x62')]({'where':{'id':_0x43a150[_0xa471('0x64')]['id']},'include':[{'model':db[_0xa471('0xac')],'as':_0xa471('0xad'),'include':[{'model':db['CmContact'],'as':_0xa471('0xae'),'where':{'email':_0x25bd23},'limit':0x1,'order':[[_0xa471('0xaf'),_0xa471('0xb0')]]}]},{'model':db[_0xa471('0x44')],'as':_0xa471('0x45'),'raw':!![]}]})[_0xa471('0x25')](handleEntityNotFound(_0x585dbe,null))[_0xa471('0x25')](function(_0x148850){if(_0x148850){_0xc3b38b=_0x148850;if(_0x148850[_0xa471('0x45')]){if(_['isNil'](_0x43a150[_0xa471('0x63')][_0xa471('0xb1')])){_0x43a150['body'][_0xa471('0xb1')]=util[_0xa471('0xa8')](_0xa471('0xb2'),_0x148850[_0xa471('0x8a')],_0x148850[_0xa471('0x75')]||_0x148850[_0xa471('0x45')][_0xa471('0x84')]);}if(_0x43a150[_0xa471('0x63')][_0xa471('0xb3')]&&_0x43a150[_0xa471('0x63')][_0xa471('0xb3')]['length']){for(var _0x5a1ae5=0x0;_0x5a1ae5<_0x43a150['body']['attachments'][_0xa471('0x53')];_0x5a1ae5+=0x1){_0x43a150[_0xa471('0x63')][_0xa471('0xb3')][_0x5a1ae5]={'filename':_0x43a150[_0xa471('0x63')]['attachments'][_0x5a1ae5][_0xa471('0x8a')],'path':path[_0xa471('0xb4')](config[_0xa471('0xb5')],_0xa471('0xb6'),_0x43a150[_0xa471('0x63')][_0xa471('0xb3')][_0x5a1ae5][_0xa471('0xb7')])};}}var _0x122f6b={'tls':{'rejectUnauthorized':![]}};if(_[_0xa471('0x77')](_0x148850['Smtp'][_0xa471('0x83')])){if(_0x148850[_0xa471('0x45')][_0xa471('0x80')]){_0x122f6b[_0xa471('0xb8')]={'user':_0x148850[_0xa471('0x45')][_0xa471('0x84')],'pass':_0x148850[_0xa471('0x45')]['pass']};}_0x122f6b['host']=_0x148850[_0xa471('0x45')][_0xa471('0x81')];_0x122f6b[_0xa471('0x82')]=_0x148850[_0xa471('0x45')][_0xa471('0x82')];_0x122f6b[_0xa471('0xb9')]=_0x148850[_0xa471('0x45')][_0xa471('0xb9')];}else{_0x122f6b[_0xa471('0x83')]=_0x148850[_0xa471('0x45')][_0xa471('0x83')];_0x122f6b['auth']={'user':_0x148850['Smtp'][_0xa471('0x84')],'pass':_0x148850[_0xa471('0x45')][_0xa471('0x7e')]};}return respondWithRpcPromise(_0xa471('0xba'),_0xa471('0xbb'),{'account':_0x122f6b,'message':_0x43a150['body']});}else{throw new Error(_0xa471('0xbc'));}}})[_0xa471('0x25')](function(_0x4be21c){if(_0x4be21c){_0x39cdaf=_0x4be21c;if(_0xc3b38b[_0xa471('0xad')]){if(_0xc3b38b['List']['Contacts'][_0xa471('0x53')]){return _0xc3b38b['List'][_0xa471('0xae')][0x0];}else{return db[_0xa471('0xbd')][_0xa471('0x69')](_[_0xa471('0x1f')](_0x43a150[_0xa471('0x63')],{'firstName':_0x43a150[_0xa471('0x63')]['to'],'email':_0x43a150['body']['to'],'phone':_0x43a150[_0xa471('0x63')]['to'],'ListId':_0xc3b38b['ListId']}));}}else{throw new Error(_0xa471('0xbc'));}}})['then'](function(_0x152a87){if(_0x152a87){var _0xe32784={'UserId':_0x43a150['user']['id'],'ContactId':_0x152a87['id'],'MailAccountId':_0xc3b38b['id'],'inReplyTo':_0x39cdaf['messageId'],'to':_0x43a150[_0xa471('0x63')][_0xa471('0xb1')],'cc':_0x43a150[_0xa471('0x63')]['cc'],'subject':_0x43a150[_0xa471('0x63')]['subject'],'attach':_0x43a150[_0xa471('0x63')]['attach'],'firstMsgDirection':'out','lastMsgAt':moment()[_0xa471('0xa8')](_0xa471('0xa9')),'lastMsgDirection':_0xa471('0xbe'),'Messages':[_['merge'](_0x43a150['body'],{'messageId':_0x39cdaf[_0xa471('0xbf')],'sentAt':moment()[_0xa471('0xa8')](_0xa471('0xa9')),'read':!![],'MailAccountId':_0xc3b38b['id'],'UserId':_0x43a150[_0xa471('0x84')]['id'],'ContactId':_0x152a87['id']})]};if(_0x43a150[_0xa471('0x63')][_0xa471('0xc0')]){_0xe32784=_['merge'](_0xe32784,_0x43a150[_0xa471('0x63')][_0xa471('0xc0')]);}return db[_0xa471('0x94')]['create'](_0xe32784,{'include':[{'model':db[_0xa471('0xa5')],'as':_0xa471('0xc1')}]});}})['then'](respondWithResult(_0x585dbe,null))[_0xa471('0x65')](handleError(_0x585dbe,null));};exports[_0xa471('0xc2')]=function(_0x342a2b,_0x28a66e,_0x36974e){return db[_0xa471('0x48')]['find']({'where':{'id':_0x342a2b[_0xa471('0x64')]['id']},'include':[{'model':db[_0xa471('0x44')],'as':_0xa471('0x45'),'raw':!![]}]})[_0xa471('0x25')](handleEntityNotFound(_0x28a66e,null))[_0xa471('0x25')](function(_0x3b7c3){if(_0x3b7c3&&_0x3b7c3[_0xa471('0x45')]){var _0x502072={'id':_0x3b7c3['id'],'tls':{'rejectUnauthorized':![]}};if(_0x3b7c3[_0xa471('0x45')]['service']){_0x502072[_0xa471('0x83')]=_0x3b7c3[_0xa471('0x45')][_0xa471('0x83')];}else{_0x502072[_0xa471('0x81')]=_0x3b7c3[_0xa471('0x45')][_0xa471('0x81')];_0x502072['port']=_0x3b7c3['Smtp'][_0xa471('0x82')];_0x502072[_0xa471('0xb9')]=_0x3b7c3[_0xa471('0x45')][_0xa471('0xb9')];}if(_0x3b7c3['Smtp'][_0xa471('0x80')]){_0x502072[_0xa471('0xb8')]={'user':_0x3b7c3[_0xa471('0x45')]['user'],'pass':_0x3b7c3['Smtp'][_0xa471('0x7e')]};}return respondWithRpcPromise(_0xa471('0xc3'),'verifySmtp',{'account':_0x502072});}})['then'](respondWithResult(_0x28a66e,null))['catch'](handleError(_0x28a66e,null));};exports['destroy']=function(_0x36a936,_0x3d7070){return db['MailAccount'][_0xa471('0x62')]({'where':{'id':_0x36a936['params']['id']}})[_0xa471('0x25')](handleEntityNotFound(_0x3d7070,null))[_0xa471('0x25')](function(_0x23eae8){if(_0x23eae8&&_0x23eae8['service']){throw new db['Sequelize'][(_0xa471('0xc4'))]('You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account');}return _0x23eae8;})[_0xa471('0x25')](removeEntity(_0x3d7070,null))[_0xa471('0x65')](handleError(_0x3d7070,null));};exports[_0xa471('0xc5')]=function(_0x30d0d0,_0x4773b1,_0x51684d){return db['MailAccount'][_0xa471('0x62')]({'where':{'id':_0x30d0d0[_0xa471('0x64')]['id']}})[_0xa471('0x25')](handleEntityNotFound(_0x4773b1,null))[_0xa471('0x25')](function(_0x443779){if(_0x443779){return _0x443779[_0xa471('0xc5')](_0x30d0d0[_0xa471('0x63')][_0xa471('0x6f')],_[_0xa471('0x95')](_0x30d0d0[_0xa471('0x63')],[_0xa471('0x6f'),'id'])||{})[_0xa471('0xc6')](function(_0x27ddd5){for(var _0x194352=0x0;_0x194352<_0x30d0d0[_0xa471('0x63')][_0xa471('0x6f')][_0xa471('0x53')];_0x194352+=0x1){socket[_0xa471('0xc7')](_0xa471('0xc8'),{'UserId':Number(_0x30d0d0[_0xa471('0x63')][_0xa471('0x6f')][_0x194352]),'MailAccountId':Number(_0x30d0d0[_0xa471('0x64')]['id'])});}return _0x27ddd5;});}})[_0xa471('0x25')](respondWithResult(_0x4773b1,null))[_0xa471('0x65')](handleError(_0x4773b1,null));};exports['removeAgents']=function(_0x464efe,_0x2bb86b,_0x135d13){return db['MailAccount']['find']({'where':{'id':_0x464efe[_0xa471('0x64')]['id']}})[_0xa471('0x25')](handleEntityNotFound(_0x2bb86b,null))[_0xa471('0x25')](function(_0x4833dd){if(_0x4833dd){return _0x4833dd[_0xa471('0xc9')](_0x464efe[_0xa471('0x4d')][_0xa471('0x6f')])[_0xa471('0x25')](function(){if(_[_0xa471('0xca')](_0x464efe[_0xa471('0x4d')][_0xa471('0x6f')])){for(var _0x155d6e=0x0;_0x155d6e<_0x464efe[_0xa471('0x4d')][_0xa471('0x6f')][_0xa471('0x53')];_0x155d6e+=0x1){socket['emit'](_0xa471('0xcb'),{'UserId':Number(_0x464efe[_0xa471('0x4d')][_0xa471('0x6f')][_0x155d6e]),'MailAccountId':Number(_0x464efe['params']['id'])});}}else{socket[_0xa471('0xc7')](_0xa471('0xcb'),{'UserId':Number(_0x464efe[_0xa471('0x4d')][_0xa471('0x6f')]),'MailAccountId':Number(_0x464efe[_0xa471('0x64')]['id'])});}});}})[_0xa471('0x25')](respondWithStatusCode(_0x2bb86b,null))[_0xa471('0x65')](handleError(_0x2bb86b,null));};exports[_0xa471('0xcc')]=function(_0x105641,_0x4630e3,_0x5ad713){var _0x514484={};var _0x9c3bb0={};var _0x43dfb6;var _0x576210;return db[_0xa471('0x48')][_0xa471('0x73')]({'where':{'id':_0x105641['params']['id']}})[_0xa471('0x25')](handleEntityNotFound(_0x4630e3,null))[_0xa471('0x25')](function(_0x12e429){if(_0x12e429){_0x43dfb6=_0x12e429;_0x9c3bb0['model']=_['keys'](db[_0xa471('0x98')][_0xa471('0x49')]);_0x9c3bb0[_0xa471('0x4d')]=_[_0xa471('0x4e')](_0x105641[_0xa471('0x4d')]);_0x9c3bb0[_0xa471('0x4f')]=_[_0xa471('0x50')](_0x9c3bb0[_0xa471('0x4b')],_0x9c3bb0[_0xa471('0x4d')]);_0x514484[_0xa471('0x52')]=_[_0xa471('0x50')](_0x9c3bb0['model'],qs['fields'](_0x105641[_0xa471('0x4d')][_0xa471('0x51')]));_0x514484[_0xa471('0x52')]=_0x514484[_0xa471('0x52')][_0xa471('0x53')]?_0x514484[_0xa471('0x52')]:_0x9c3bb0[_0xa471('0x4b')];_0x514484[_0xa471('0x56')]=qs[_0xa471('0x57')](_0x105641[_0xa471('0x4d')][_0xa471('0x57')]);_0x514484['where']=qs[_0xa471('0x4f')](_[_0xa471('0x59')](_0x105641[_0xa471('0x4d')],_0x9c3bb0[_0xa471('0x4f')]));if(_0x105641[_0xa471('0x4d')][_0xa471('0x5d')]){_0x514484['where']=_[_0xa471('0x5a')](_0x514484[_0xa471('0x58')],{'$or':_[_0xa471('0x4c')](_0x514484[_0xa471('0x52')],function(_0xf1633b){var _0x51a4d7={};_0x51a4d7[_0xf1633b]={'$like':'%'+_0x105641[_0xa471('0x4d')][_0xa471('0x5d')]+'%'};return _0x51a4d7;})});}_0x514484=_['merge']({},_0x514484,_0x105641[_0xa471('0x5e')]);return _0x43dfb6[_0xa471('0xcc')](_0x514484);}})['then'](function(_0x59f7a1){if(_0x59f7a1){_0x576210=_0x59f7a1[_0xa471('0x53')];if(!_0x105641[_0xa471('0x4d')][_0xa471('0x54')](_0xa471('0x55'))){_0x514484['limit']=qs[_0xa471('0x35')](_0x105641['query'][_0xa471('0x35')]);_0x514484[_0xa471('0x33')]=qs[_0xa471('0x33')](_0x105641[_0xa471('0x4d')]['offset']);}return _0x43dfb6[_0xa471('0xcc')](_0x514484);}})[_0xa471('0x25')](function(_0x2b594d){if(_0x2b594d){return _0x2b594d?{'count':_0x576210,'rows':_0x2b594d}:null;}})['then'](respondWithResult(_0x4630e3,null))[_0xa471('0x65')](handleError(_0x4630e3,null));}; \ No newline at end of file +var _0xceaf=['spread','emit','userMailAccount:save','removeAgents','userMailAccount:remove','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','to-csv','querystring','html-to-text','juice','../../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','./mailAccount.socket','register','jayson/promise','client','http','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','get','MailAccounts','UserProfileResource','stack','name','send','index','MailServerIn','Imap','MailServerOut','Smtp','MailAccount','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','catch','show','Pause','mandatoryDispositionPause','find','body','describe','params','Disposition','create','getDispositions','findOne','order','MailAccountId','removeDispositions','addAnswer','getAnswers','CannedAnswer','removeAnswers','key','email','ListId','isNil','active','description','cauthentication','user','cuser','password','authentication','host','port','service','cservice','pass','cpassword','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','getSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','omit','ids','getInteractions','CmContact','Contact','User','Owner','internal','Tag','Tags','color','tag','addApplications','sequelize','transaction','MailApplication','bulkCreate','priority','getApplications','hasOwnProperty','getMessages','$gte','YYYY-MM-DD\x20HH:mm:ss','MailMessage','inlineCss','true','split','CmList','List','DESC','from','format','attachments','join','root','server/files/attachments','secure','auth','SendMail','sendMail','Contacts','messageId','subject','Interaction','Messages','verifySmtp','VerifySmtp','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents'];(function(_0x10004e,_0xd701e6){var _0x5af990=function(_0x4bab6a){while(--_0x4bab6a){_0x10004e['push'](_0x10004e['shift']());}};_0x5af990(++_0xd701e6);}(_0xceaf,0xd4));var _0xfcea=function(_0x3b771c,_0x5e4689){_0x3b771c=_0x3b771c-0x0;var _0x3962fe=_0xceaf[_0x3b771c];return _0x3962fe;};'use strict';var emlformat=require(_0xfcea('0x0'));var rimraf=require(_0xfcea('0x1'));var zipdir=require(_0xfcea('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfcea('0x3'));var moment=require(_0xfcea('0x4'));var BPromise=require(_0xfcea('0x5'));var Mustache=require(_0xfcea('0x6'));var util=require(_0xfcea('0x7'));var path=require(_0xfcea('0x8'));var sox=require(_0xfcea('0x9'));var csv=require('to-csv');var ejs=require(_0xfcea('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xfcea('0xb'));var crypto=require(_0xfcea('0xc'));var jsforce=require(_0xfcea('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xfcea('0xe'));var querystring=require(_0xfcea('0xf'));var Papa=require('papaparse');var htmlToText=require(_0xfcea('0x10'));var juice=require(_0xfcea('0x11'));var Redis=require('ioredis');var authService=require(_0xfcea('0x12'));var qs=require(_0xfcea('0x13'));var as=require(_0xfcea('0x14'));var hardwareService=require(_0xfcea('0x15'));var logger=require(_0xfcea('0x16'))(_0xfcea('0x17'));var utils=require(_0xfcea('0x18'));var config=require(_0xfcea('0x19'));var licenseUtil=require(_0xfcea('0x1a'));var db=require(_0xfcea('0x1b'))['db'];config[_0xfcea('0x1c')]=_[_0xfcea('0x1d')](config['redis'],{'host':_0xfcea('0x1e'),'port':0x18eb});var socket=require(_0xfcea('0x1f'))(new Redis(config[_0xfcea('0x1c')]));require(_0xfcea('0x20'))[_0xfcea('0x21')](socket);var jayson=require(_0xfcea('0x22'));var client=jayson[_0xfcea('0x23')][_0xfcea('0x24')]({'port':0x232b});function respondWithRpcPromise(_0x5b614e,_0x1574b0,_0x5bd937,_0x1a08b9){return new BPromise(function(_0x429cc8,_0x511cd2){var _0x2931b4=_0x1a08b9||client;return _0x2931b4[_0xfcea('0x25')](_0x5b614e,_0x5bd937)[_0xfcea('0x26')](function(_0x252d99){logger[_0xfcea('0x27')](_0xfcea('0x28'),_0x1574b0,_0xfcea('0x29'));logger[_0xfcea('0x2a')](_0xfcea('0x2b'),_0x1574b0,_0xfcea('0x29'),JSON[_0xfcea('0x2c')](_0x252d99));if(_0x252d99[_0xfcea('0x2d')]){if(_0x252d99[_0xfcea('0x2d')][_0xfcea('0x2e')]===0x1f4){logger[_0xfcea('0x2d')](_0xfcea('0x28'),_0x1574b0,_0x252d99[_0xfcea('0x2d')]['message']);return _0x511cd2(_0x252d99[_0xfcea('0x2d')][_0xfcea('0x2f')]);}logger[_0xfcea('0x2d')](_0xfcea('0x28'),_0x1574b0,_0x252d99['error'][_0xfcea('0x2f')]);return _0x429cc8(_0x252d99[_0xfcea('0x2d')][_0xfcea('0x2f')]);}else{logger[_0xfcea('0x27')](_0xfcea('0x28'),_0x1574b0,_0xfcea('0x29'));_0x429cc8(_0x252d99[_0xfcea('0x30')]['message']);}})['catch'](function(_0x1d5cad){logger[_0xfcea('0x2d')](_0xfcea('0x28'),_0x1574b0,_0x1d5cad);_0x511cd2(_0x1d5cad);});});}function respondWithStatusCode(_0x4b34e6,_0x3dc933){_0x3dc933=_0x3dc933||0xcc;return function(_0x1b66ed){if(_0x1b66ed){return _0x4b34e6[_0xfcea('0x31')](_0x3dc933);}return _0x4b34e6[_0xfcea('0x32')](_0x3dc933)[_0xfcea('0x33')]();};}function respondWithResult(_0x2d3a8d,_0x244e36){_0x244e36=_0x244e36||0xc8;return function(_0x5eab2d){if(_0x5eab2d){return _0x2d3a8d[_0xfcea('0x32')](_0x244e36)[_0xfcea('0x34')](_0x5eab2d);}};}function respondWithFilteredResult(_0x5c5366,_0x353f34){return function(_0x5dfbd4){if(_0x5dfbd4){var _0x4cecb5=typeof _0x353f34[_0xfcea('0x35')]===_0xfcea('0x36')&&typeof _0x353f34[_0xfcea('0x37')]===_0xfcea('0x36');var _0x2e183c=_0x5dfbd4[_0xfcea('0x38')];var _0x45988c=_0x4cecb5?0x0:_0x353f34[_0xfcea('0x35')];var _0x39247b=_0x4cecb5?_0x5dfbd4[_0xfcea('0x38')]:_0x353f34[_0xfcea('0x35')]+_0x353f34[_0xfcea('0x37')];var _0x1966b6;if(_0x39247b>=_0x2e183c){_0x39247b=_0x2e183c;_0x1966b6=0xc8;}else{_0x1966b6=0xce;}_0x5c5366[_0xfcea('0x32')](_0x1966b6);return _0x5c5366[_0xfcea('0x39')](_0xfcea('0x3a'),_0x45988c+'-'+_0x39247b+'/'+_0x2e183c)[_0xfcea('0x34')](_0x5dfbd4);}return null;};}function patchUpdates(_0x14f0e3){return function(_0x4f40a3){try{jsonpatch[_0xfcea('0x3b')](_0x4f40a3,_0x14f0e3,!![]);}catch(_0x5305d7){return BPromise[_0xfcea('0x3c')](_0x5305d7);}return _0x4f40a3[_0xfcea('0x3d')]();};}function saveUpdates(_0x8061df,_0x25b681){return function(_0x1e456c){if(_0x1e456c){return _0x1e456c[_0xfcea('0x3e')](_0x8061df)[_0xfcea('0x26')](function(_0x19c918){return _0x19c918;});}return null;};}function removeEntity(_0xa2b60a,_0x2a3025){return function(_0x1d0b4f){if(_0x1d0b4f){return _0x1d0b4f[_0xfcea('0x3f')]()[_0xfcea('0x26')](function(){var _0xc33894=_0x1d0b4f[_0xfcea('0x40')]({'plain':!![]});var _0x20c56c=_0xfcea('0x41');return db[_0xfcea('0x42')][_0xfcea('0x3f')]({'where':{'type':_0x20c56c,'resourceId':_0xc33894['id']}})[_0xfcea('0x26')](function(){return _0x1d0b4f;});})[_0xfcea('0x26')](function(){_0xa2b60a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1c31ea,_0x331302){return function(_0x50e8c0){if(!_0x50e8c0){_0x1c31ea[_0xfcea('0x31')](0x194);}return _0x50e8c0;};}function handleError(_0x167c1b,_0x35bf2c){_0x35bf2c=_0x35bf2c||0x1f4;return function(_0x4364b8){logger[_0xfcea('0x2d')](_0x4364b8[_0xfcea('0x43')]);if(_0x4364b8[_0xfcea('0x44')]){delete _0x4364b8[_0xfcea('0x44')];}_0x167c1b[_0xfcea('0x32')](_0x35bf2c)[_0xfcea('0x45')](_0x4364b8);};}exports[_0xfcea('0x46')]=function(_0x53bccd,_0x533cf7){var _0x3f6f2f={'include':[{'model':db[_0xfcea('0x47')],'as':_0xfcea('0x48')},{'model':db[_0xfcea('0x49')],'as':_0xfcea('0x4a')},{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x32e920={},_0x348f29={'count':0x0,'rows':[]};var _0x3d4cda=_['map'](db[_0xfcea('0x4b')][_0xfcea('0x4c')],function(_0x2f8530){return{'name':_0x2f8530[_0xfcea('0x4d')],'type':_0x2f8530[_0xfcea('0x4e')]['key']};});_0x32e920[_0xfcea('0x4f')]=_[_0xfcea('0x50')](_0x3d4cda,_0xfcea('0x44'));_0x32e920[_0xfcea('0x51')]=_[_0xfcea('0x52')](_0x53bccd['query']);_0x32e920[_0xfcea('0x53')]=_[_0xfcea('0x54')](_0x32e920[_0xfcea('0x4f')],_0x32e920['query']);_0x3f6f2f[_0xfcea('0x55')]=_[_0xfcea('0x54')](_0x32e920[_0xfcea('0x4f')],qs['fields'](_0x53bccd[_0xfcea('0x51')][_0xfcea('0x56')]));_0x3f6f2f[_0xfcea('0x55')]=_0x3f6f2f['attributes'][_0xfcea('0x57')]?_0x3f6f2f[_0xfcea('0x55')]:_0x32e920[_0xfcea('0x4f')];if(!_0x53bccd[_0xfcea('0x51')]['hasOwnProperty'](_0xfcea('0x58'))){_0x3f6f2f[_0xfcea('0x37')]=qs[_0xfcea('0x37')](_0x53bccd[_0xfcea('0x51')][_0xfcea('0x37')]);_0x3f6f2f['offset']=qs[_0xfcea('0x35')](_0x53bccd[_0xfcea('0x51')]['offset']);}_0x3f6f2f['order']=qs[_0xfcea('0x59')](_0x53bccd[_0xfcea('0x51')][_0xfcea('0x59')]);_0x3f6f2f[_0xfcea('0x5a')]=qs[_0xfcea('0x53')](_[_0xfcea('0x5b')](_0x53bccd[_0xfcea('0x51')],_0x32e920[_0xfcea('0x53')]),_0x3d4cda);if(_0x53bccd['query'][_0xfcea('0x5c')]){_0x3f6f2f[_0xfcea('0x5a')]=_[_0xfcea('0x5d')](_0x3f6f2f[_0xfcea('0x5a')],{'$or':_[_0xfcea('0x50')](_0x3d4cda,function(_0x7f1a3d){if(_0x7f1a3d[_0xfcea('0x4e')]!=='VIRTUAL'){var _0xff9036={};_0xff9036[_0x7f1a3d['name']]={'$like':'%'+_0x53bccd[_0xfcea('0x51')][_0xfcea('0x5c')]+'%'};return _0xff9036;}})});}_0x3f6f2f=_['merge']({},_0x3f6f2f,_0x53bccd[_0xfcea('0x5e')]);var _0x393822={'where':_0x3f6f2f['where']};return db['MailAccount'][_0xfcea('0x38')](_0x393822)[_0xfcea('0x26')](function(_0x4dd69b){_0x348f29[_0xfcea('0x38')]=_0x4dd69b;if(_0x53bccd[_0xfcea('0x51')][_0xfcea('0x5f')]){_0x3f6f2f[_0xfcea('0x60')]=[{'all':!![]}];}return db[_0xfcea('0x4b')][_0xfcea('0x61')](_0x3f6f2f);})[_0xfcea('0x26')](function(_0x16abf0){_0x348f29[_0xfcea('0x62')]=_0x16abf0;return _0x348f29;})[_0xfcea('0x26')](respondWithFilteredResult(_0x533cf7,_0x3f6f2f))[_0xfcea('0x63')](handleError(_0x533cf7,null));};exports[_0xfcea('0x64')]=function(_0x46939b,_0x574e9f){var _0x40f3b3={'raw':![],'where':{'id':_0x46939b['params']['id']},'include':[{'model':db[_0xfcea('0x47')],'as':_0xfcea('0x48')},{'model':db[_0xfcea('0x49')],'as':_0xfcea('0x4a')},{'model':db[_0xfcea('0x65')],'as':_0xfcea('0x66')}]},_0x4f17ce={};_0x4f17ce[_0xfcea('0x4f')]=_[_0xfcea('0x52')](db[_0xfcea('0x4b')][_0xfcea('0x4c')]);_0x4f17ce[_0xfcea('0x51')]=_[_0xfcea('0x52')](_0x46939b[_0xfcea('0x51')]);_0x4f17ce['filters']=_[_0xfcea('0x54')](_0x4f17ce[_0xfcea('0x4f')],_0x4f17ce[_0xfcea('0x51')]);_0x40f3b3['attributes']=_[_0xfcea('0x54')](_0x4f17ce[_0xfcea('0x4f')],qs[_0xfcea('0x56')](_0x46939b['query'][_0xfcea('0x56')]));_0x40f3b3['attributes']=_0x40f3b3[_0xfcea('0x55')][_0xfcea('0x57')]?_0x40f3b3[_0xfcea('0x55')]:_0x4f17ce[_0xfcea('0x4f')];if(_0x46939b[_0xfcea('0x51')][_0xfcea('0x5f')]){_0x40f3b3[_0xfcea('0x60')]=[{'all':!![]}];}_0x40f3b3=_[_0xfcea('0x5d')]({},_0x40f3b3,_0x46939b[_0xfcea('0x5e')]);return db[_0xfcea('0x4b')][_0xfcea('0x67')](_0x40f3b3)[_0xfcea('0x26')](handleEntityNotFound(_0x574e9f,null))[_0xfcea('0x26')](respondWithResult(_0x574e9f,null))[_0xfcea('0x63')](handleError(_0x574e9f,null));};exports['update']=function(_0x10de3b,_0x3e562c){if(_0x10de3b[_0xfcea('0x68')]['id']){delete _0x10de3b[_0xfcea('0x68')]['id'];}return db[_0xfcea('0x4b')]['find']({'where':{'id':_0x10de3b['params']['id']},'include':[{'model':db['MailServerIn'],'as':_0xfcea('0x48')},{'model':db[_0xfcea('0x49')],'as':_0xfcea('0x4a')},{'model':db[_0xfcea('0x65')],'as':_0xfcea('0x66')}]})['then'](handleEntityNotFound(_0x3e562c,null))[_0xfcea('0x26')](saveUpdates(_0x10de3b[_0xfcea('0x68')],null))['then'](function(_0x56f2da){if(_0x56f2da&&_0x10de3b[_0xfcea('0x68')][_0xfcea('0x48')]){return db[_0xfcea('0x47')]['update'](_0x10de3b[_0xfcea('0x68')][_0xfcea('0x48')],{'where':{'MailAccountId':_0x56f2da['id']}})['then'](function(){return _0x56f2da;});}return _0x56f2da;})[_0xfcea('0x26')](function(_0x5f10d9){if(_0x5f10d9&&_0x10de3b[_0xfcea('0x68')]['Smtp']){return db[_0xfcea('0x49')]['update'](_0x10de3b[_0xfcea('0x68')][_0xfcea('0x4a')],{'where':{'MailAccountId':_0x5f10d9['id']}})[_0xfcea('0x26')](function(){return _0x5f10d9;});}return _0x5f10d9;})['then'](respondWithResult(_0x3e562c,null))[_0xfcea('0x63')](handleError(_0x3e562c,null));};exports[_0xfcea('0x69')]=function(_0x11dedf,_0x5a6932){return db[_0xfcea('0x4b')][_0xfcea('0x69')]()[_0xfcea('0x26')](respondWithResult(_0x5a6932,null))['catch'](handleError(_0x5a6932,null));};exports['addDisposition']=function(_0x46ecf4,_0x28816b,_0x35d522){if(_0x46ecf4[_0xfcea('0x68')]['id']){delete _0x46ecf4[_0xfcea('0x68')]['id'];}return db[_0xfcea('0x4b')][_0xfcea('0x67')]({'where':{'id':_0x46ecf4[_0xfcea('0x6a')]['id']}})[_0xfcea('0x26')](handleEntityNotFound(_0x28816b,null))[_0xfcea('0x26')](function(_0x4f4369){if(_0x4f4369){_0x46ecf4['body']['MailAccountId']=_0x4f4369['id'];return db[_0xfcea('0x6b')][_0xfcea('0x6c')](_0x46ecf4[_0xfcea('0x68')]);}})[_0xfcea('0x26')](respondWithResult(_0x28816b,null))[_0xfcea('0x63')](handleError(_0x28816b,null));};exports[_0xfcea('0x6d')]=function(_0x3a8975,_0x3a49f6,_0x44d982){var _0x24e3bb={'raw':![],'where':{}};var _0x4780c2={};var _0x220bf1={'count':0x0,'rows':[]};return db['MailAccount'][_0xfcea('0x6e')]({'where':{'id':_0x3a8975[_0xfcea('0x6a')]['id']}})[_0xfcea('0x26')](handleEntityNotFound(_0x3a49f6,null))['then'](function(_0x3f8af6){if(_0x3f8af6){_0x4780c2[_0xfcea('0x4f')]=_[_0xfcea('0x52')](db['Disposition'][_0xfcea('0x4c')]);_0x4780c2['query']=_[_0xfcea('0x52')](_0x3a8975['query']);_0x4780c2[_0xfcea('0x53')]=_[_0xfcea('0x54')](_0x4780c2[_0xfcea('0x4f')],_0x4780c2['query']);_0x24e3bb[_0xfcea('0x55')]=_['intersection'](_0x4780c2[_0xfcea('0x4f')],qs[_0xfcea('0x56')](_0x3a8975[_0xfcea('0x51')][_0xfcea('0x56')]));_0x24e3bb['attributes']=_0x24e3bb[_0xfcea('0x55')]['length']?_0x24e3bb[_0xfcea('0x55')]:_0x4780c2[_0xfcea('0x4f')];if(!_0x3a8975['query']['hasOwnProperty']('nolimit')){_0x24e3bb['limit']=qs[_0xfcea('0x37')](_0x3a8975[_0xfcea('0x51')][_0xfcea('0x37')]);_0x24e3bb[_0xfcea('0x35')]=qs[_0xfcea('0x35')](_0x3a8975[_0xfcea('0x51')][_0xfcea('0x35')]);}_0x24e3bb[_0xfcea('0x6f')]=qs['sort'](_0x3a8975[_0xfcea('0x51')][_0xfcea('0x59')]);_0x24e3bb['where']=qs[_0xfcea('0x53')](_[_0xfcea('0x5b')](_0x3a8975[_0xfcea('0x51')],_0x4780c2[_0xfcea('0x53')]));_0x24e3bb[_0xfcea('0x5a')][_0xfcea('0x70')]=_0x3f8af6['id'];if(_0x3a8975[_0xfcea('0x51')][_0xfcea('0x5c')]){_0x24e3bb[_0xfcea('0x5a')]=_[_0xfcea('0x5d')](_0x24e3bb['where'],{'$or':_[_0xfcea('0x50')](_0x24e3bb[_0xfcea('0x55')],function(_0x6c9024){var _0x524e7c={};_0x524e7c[_0x6c9024]={'$like':'%'+_0x3a8975['query'][_0xfcea('0x5c')]+'%'};return _0x524e7c;})});}_0x24e3bb=_['merge']({},_0x24e3bb,_0x3a8975[_0xfcea('0x5e')]);return db[_0xfcea('0x6b')][_0xfcea('0x38')]({'where':_0x24e3bb[_0xfcea('0x5a')]})[_0xfcea('0x26')](function(_0x51ed0b){_0x220bf1[_0xfcea('0x38')]=_0x51ed0b;if(_0x3a8975['query'][_0xfcea('0x5f')]){_0x24e3bb[_0xfcea('0x60')]=[{'all':!![]}];}return db[_0xfcea('0x6b')]['findAll'](_0x24e3bb);})[_0xfcea('0x26')](function(_0x579523){_0x220bf1[_0xfcea('0x62')]=_0x579523;return _0x220bf1;});}})[_0xfcea('0x26')](respondWithFilteredResult(_0x3a49f6,_0x24e3bb))[_0xfcea('0x63')](handleError(_0x3a49f6,null));};exports['removeDispositions']=function(_0xf17f68,_0x1bf83e,_0x4fbd4b){return db[_0xfcea('0x4b')]['find']({'where':{'id':_0xf17f68[_0xfcea('0x6a')]['id']}})[_0xfcea('0x26')](handleEntityNotFound(_0x1bf83e,null))[_0xfcea('0x26')](function(_0x4216e1){if(_0x4216e1){return _0x4216e1[_0xfcea('0x71')](_0xf17f68[_0xfcea('0x51')]['ids']);}})[_0xfcea('0x26')](respondWithStatusCode(_0x1bf83e,null))[_0xfcea('0x63')](handleError(_0x1bf83e,null));};exports[_0xfcea('0x72')]=function(_0x5ec4f3,_0xb922ac,_0x373770){if(_0x5ec4f3['body']['id']){delete _0x5ec4f3[_0xfcea('0x68')]['id'];}return db[_0xfcea('0x4b')][_0xfcea('0x67')]({'where':{'id':_0x5ec4f3['params']['id']}})[_0xfcea('0x26')](handleEntityNotFound(_0xb922ac,null))[_0xfcea('0x26')](function(_0x5e35b1){if(_0x5e35b1){_0x5ec4f3['body'][_0xfcea('0x70')]=_0x5e35b1['id'];return db['CannedAnswer'][_0xfcea('0x6c')](_0x5ec4f3[_0xfcea('0x68')]);}})[_0xfcea('0x26')](respondWithResult(_0xb922ac,null))[_0xfcea('0x63')](handleError(_0xb922ac,null));};exports[_0xfcea('0x73')]=function(_0x19f7e0,_0x16086f,_0x111898){var _0x21a7cd={'raw':![],'where':{}};var _0x478222={};var _0x11648d={'count':0x0,'rows':[]};return db['MailAccount']['findOne']({'where':{'id':_0x19f7e0[_0xfcea('0x6a')]['id']}})[_0xfcea('0x26')](handleEntityNotFound(_0x16086f,null))['then'](function(_0x3ab062){if(_0x3ab062){_0x478222['model']=_[_0xfcea('0x52')](db[_0xfcea('0x74')]['rawAttributes']);_0x478222[_0xfcea('0x51')]=_['keys'](_0x19f7e0[_0xfcea('0x51')]);_0x478222[_0xfcea('0x53')]=_[_0xfcea('0x54')](_0x478222[_0xfcea('0x4f')],_0x478222[_0xfcea('0x51')]);_0x21a7cd[_0xfcea('0x55')]=_[_0xfcea('0x54')](_0x478222[_0xfcea('0x4f')],qs[_0xfcea('0x56')](_0x19f7e0[_0xfcea('0x51')]['fields']));_0x21a7cd['attributes']=_0x21a7cd['attributes'][_0xfcea('0x57')]?_0x21a7cd['attributes']:_0x478222[_0xfcea('0x4f')];if(!_0x19f7e0[_0xfcea('0x51')]['hasOwnProperty']('nolimit')){_0x21a7cd[_0xfcea('0x37')]=qs[_0xfcea('0x37')](_0x19f7e0[_0xfcea('0x51')][_0xfcea('0x37')]);_0x21a7cd[_0xfcea('0x35')]=qs[_0xfcea('0x35')](_0x19f7e0[_0xfcea('0x51')][_0xfcea('0x35')]);}_0x21a7cd[_0xfcea('0x6f')]=qs[_0xfcea('0x59')](_0x19f7e0[_0xfcea('0x51')][_0xfcea('0x59')]);_0x21a7cd[_0xfcea('0x5a')]=qs['filters'](_[_0xfcea('0x5b')](_0x19f7e0['query'],_0x478222[_0xfcea('0x53')]));_0x21a7cd[_0xfcea('0x5a')][_0xfcea('0x70')]=_0x3ab062['id'];if(_0x19f7e0['query'][_0xfcea('0x5c')]){_0x21a7cd[_0xfcea('0x5a')]=_['merge'](_0x21a7cd[_0xfcea('0x5a')],{'$or':_[_0xfcea('0x50')](_0x21a7cd[_0xfcea('0x55')],function(_0x2f692f){var _0x8f1bc6={};_0x8f1bc6[_0x2f692f]={'$like':'%'+_0x19f7e0[_0xfcea('0x51')][_0xfcea('0x5c')]+'%'};return _0x8f1bc6;})});}_0x21a7cd=_[_0xfcea('0x5d')]({},_0x21a7cd,_0x19f7e0[_0xfcea('0x5e')]);return db[_0xfcea('0x74')]['count']({'where':_0x21a7cd['where']})['then'](function(_0x1681d1){_0x11648d[_0xfcea('0x38')]=_0x1681d1;if(_0x19f7e0[_0xfcea('0x51')][_0xfcea('0x5f')]){_0x21a7cd[_0xfcea('0x60')]=[{'all':!![]}];}return db[_0xfcea('0x74')]['findAll'](_0x21a7cd);})[_0xfcea('0x26')](function(_0x414fb9){_0x11648d[_0xfcea('0x62')]=_0x414fb9;return _0x11648d;});}})[_0xfcea('0x26')](respondWithFilteredResult(_0x16086f,_0x21a7cd))[_0xfcea('0x63')](handleError(_0x16086f,null));};exports[_0xfcea('0x75')]=function(_0x57f40a,_0xeabeb1,_0x13bf45){return db[_0xfcea('0x4b')]['find']({'where':{'id':_0x57f40a[_0xfcea('0x6a')]['id']}})[_0xfcea('0x26')](handleEntityNotFound(_0xeabeb1,null))[_0xfcea('0x26')](function(_0x251178){if(_0x251178){return _0x251178[_0xfcea('0x75')](_0x57f40a[_0xfcea('0x51')]['ids']);}})[_0xfcea('0x26')](respondWithStatusCode(_0xeabeb1,null))[_0xfcea('0x63')](handleError(_0xeabeb1,null));};exports[_0xfcea('0x6c')]=function(_0x2cf5b2,_0x1b4bd5){var _0x94d67={'name':_0x2cf5b2[_0xfcea('0x68')][_0xfcea('0x44')],'key':_0x2cf5b2[_0xfcea('0x68')][_0xfcea('0x76')],'email':_0x2cf5b2[_0xfcea('0x68')][_0xfcea('0x77')],'ListId':_0x2cf5b2[_0xfcea('0x68')][_0xfcea('0x78')],'active':!_[_0xfcea('0x79')](_0x2cf5b2['body']['active'])?_0x2cf5b2[_0xfcea('0x68')][_0xfcea('0x7a')]:!![],'description':_0x2cf5b2[_0xfcea('0x68')][_0xfcea('0x7b')]||null,'Imap':{},'Smtp':{}};if(_[_0xfcea('0x79')](_0x2cf5b2['body']['cservice'])){if(_0x2cf5b2['body'][_0xfcea('0x7c')]){_0x94d67[_0xfcea('0x48')][_0xfcea('0x7d')]=_0x94d67[_0xfcea('0x4a')][_0xfcea('0x7d')]=_0x2cf5b2['body'][_0xfcea('0x7e')];_0x94d67[_0xfcea('0x48')][_0xfcea('0x7f')]=_0x94d67['Smtp']['pass']=_0x2cf5b2[_0xfcea('0x68')]['cpassword'];}else{_0x94d67[_0xfcea('0x48')][_0xfcea('0x80')]=_0x94d67[_0xfcea('0x4a')]['authentication']=![];}_0x94d67[_0xfcea('0x48')]['host']=_0x2cf5b2[_0xfcea('0x68')]['Imap'][_0xfcea('0x81')];_0x94d67['Imap'][_0xfcea('0x82')]=_0x2cf5b2[_0xfcea('0x68')][_0xfcea('0x48')][_0xfcea('0x82')];_0x94d67[_0xfcea('0x4a')]['host']=_0x2cf5b2[_0xfcea('0x68')][_0xfcea('0x4a')]['host'];_0x94d67[_0xfcea('0x4a')][_0xfcea('0x82')]=_0x2cf5b2['body'][_0xfcea('0x4a')][_0xfcea('0x82')];}else{_0x94d67[_0xfcea('0x48')]['service']=_0x94d67['Smtp'][_0xfcea('0x83')]=_0x2cf5b2['body'][_0xfcea('0x84')];_0x94d67[_0xfcea('0x48')][_0xfcea('0x7d')]=_0x94d67[_0xfcea('0x4a')]['user']=_0x2cf5b2[_0xfcea('0x68')][_0xfcea('0x7e')];_0x94d67[_0xfcea('0x48')][_0xfcea('0x7f')]=_0x94d67[_0xfcea('0x4a')][_0xfcea('0x85')]=_0x2cf5b2[_0xfcea('0x68')][_0xfcea('0x86')];}return db[_0xfcea('0x4b')][_0xfcea('0x6c')](_0x94d67,{'include':[{'model':db[_0xfcea('0x49')],'as':'Smtp'},{'model':db[_0xfcea('0x47')],'as':_0xfcea('0x48')}]})[_0xfcea('0x26')](function(_0x9c2eb3){var _0x14cb72=_0x2cf5b2[_0xfcea('0x7d')][_0xfcea('0x40')]({'plain':!![]});if(!_0x14cb72)throw new Error(_0xfcea('0x87'));if(_0x14cb72[_0xfcea('0x88')]==='user'){var _0x1d9cf1=_0x9c2eb3[_0xfcea('0x40')]({'plain':!![]});return db[_0xfcea('0x89')][_0xfcea('0x67')]({'where':{'name':_0xfcea('0x41'),'userProfileId':_0x14cb72[_0xfcea('0x8a')]},'raw':!![]})[_0xfcea('0x26')](function(_0x7d31da){if(_0x7d31da&&_0x7d31da[_0xfcea('0x8b')]===0x0){return db[_0xfcea('0x42')][_0xfcea('0x6c')]({'name':_0x1d9cf1[_0xfcea('0x44')],'resourceId':_0x1d9cf1['id'],'type':_0x7d31da['name'],'sectionId':_0x7d31da['id']},{})[_0xfcea('0x26')](function(){return _0x9c2eb3;});}else{return _0x9c2eb3;}})[_0xfcea('0x63')](function(_0x2c59cd){logger[_0xfcea('0x2d')](_0xfcea('0x8c'),_0x2c59cd);throw _0x2c59cd;});}return _0x9c2eb3;})[_0xfcea('0x26')](respondWithResult(_0x1b4bd5,0xc9))[_0xfcea('0x63')](handleError(_0x1b4bd5,null));};exports[_0xfcea('0x8d')]=function(_0x47870a,_0x3823d9,_0x21d3c3){return db[_0xfcea('0x4b')][_0xfcea('0x6e')]({'where':{'id':_0x47870a[_0xfcea('0x6a')]['id']}})['then'](handleEntityNotFound(_0x3823d9,null))['then'](function(_0x53612e){if(_0x53612e){return _0x53612e['getImap']();}return null;})[_0xfcea('0x26')](respondWithResult(_0x3823d9,null))[_0xfcea('0x63')](handleError(_0x3823d9,null));};exports[_0xfcea('0x8e')]=function(_0x4b048c,_0x306bba,_0x220465){if(_0x4b048c[_0xfcea('0x68')]['id']){delete _0x4b048c[_0xfcea('0x68')]['id'];}return db[_0xfcea('0x4b')][_0xfcea('0x67')]({'where':{'id':_0x4b048c[_0xfcea('0x6a')]['id']}})['then'](handleEntityNotFound(_0x306bba,null))[_0xfcea('0x26')](function(_0x5a1b2c){if(_0x5a1b2c){_0x4b048c[_0xfcea('0x68')][_0xfcea('0x70')]=_0x5a1b2c['id'];return db['MailServerIn'][_0xfcea('0x6c')](_0x4b048c[_0xfcea('0x68')]);}})[_0xfcea('0x26')](respondWithResult(_0x306bba,null))['catch'](handleError(_0x306bba,null));};exports[_0xfcea('0x8f')]=function(_0x4496fc,_0x400d64,_0x47a7ab){return db[_0xfcea('0x4b')][_0xfcea('0x6e')]({'where':{'id':_0x4496fc[_0xfcea('0x6a')]['id']}})['then'](handleEntityNotFound(_0x400d64,null))[_0xfcea('0x26')](function(_0x421b0b){if(_0x421b0b){return _0x421b0b['setImap'](null);}return null;})[_0xfcea('0x26')](respondWithStatusCode(_0x400d64,null))['catch'](handleError(_0x400d64,null));};exports[_0xfcea('0x90')]=function(_0x172aeb,_0x53b0bd,_0x15d897){return db['MailAccount'][_0xfcea('0x6e')]({'where':{'id':_0x172aeb[_0xfcea('0x6a')]['id']}})['then'](handleEntityNotFound(_0x53b0bd,null))[_0xfcea('0x26')](function(_0x2f1767){if(_0x2f1767){return _0x2f1767[_0xfcea('0x90')]();}return null;})['then'](respondWithResult(_0x53b0bd,null))[_0xfcea('0x63')](handleError(_0x53b0bd,null));};exports['addSmtp']=function(_0x1cc132,_0x147cae,_0x30f432){if(_0x1cc132[_0xfcea('0x68')]['id']){delete _0x1cc132[_0xfcea('0x68')]['id'];}return db['MailAccount'][_0xfcea('0x67')]({'where':{'id':_0x1cc132[_0xfcea('0x6a')]['id']}})[_0xfcea('0x26')](handleEntityNotFound(_0x147cae,null))['then'](function(_0x3131a2){if(_0x3131a2){_0x1cc132[_0xfcea('0x68')][_0xfcea('0x70')]=_0x3131a2['id'];return db[_0xfcea('0x49')]['create'](_0x1cc132['body']);}})[_0xfcea('0x26')](respondWithResult(_0x147cae,null))['catch'](handleError(_0x147cae,null));};exports[_0xfcea('0x91')]=function(_0x2cd23e,_0x5c568b,_0x4ae6ce){return db[_0xfcea('0x4b')][_0xfcea('0x6e')]({'where':{'id':_0x2cd23e[_0xfcea('0x6a')]['id']}})['then'](handleEntityNotFound(_0x5c568b,null))[_0xfcea('0x26')](function(_0x4db319){if(_0x4db319){return _0x4db319[_0xfcea('0x92')](null);}return null;})[_0xfcea('0x26')](respondWithStatusCode(_0x5c568b,null))['catch'](handleError(_0x5c568b,null));};exports[_0xfcea('0x93')]=function(_0x5a6860,_0x5c52b0,_0xb0a669){return db[_0xfcea('0x94')]['find']({'where':{'id':_0x5a6860[_0xfcea('0x6a')]['id']}})[_0xfcea('0x26')](handleEntityNotFound(_0x5c52b0,null))['then'](function(_0x130f2f){if(_0x130f2f){return _0x130f2f['addInteraction'](_0x5a6860[_0xfcea('0x68')]['ids'],_[_0xfcea('0x95')](_0x5a6860[_0xfcea('0x68')],[_0xfcea('0x96'),'id'])||{});}})[_0xfcea('0x26')](respondWithResult(_0x5c52b0,null))[_0xfcea('0x63')](handleError(_0x5c52b0,null));};exports[_0xfcea('0x97')]=function(_0x36761c,_0x5ca850,_0xa35d0c){var _0x5b5a29={'raw':![],'where':{}};var _0x38331f={};var _0x17bae2={'count':0x0,'rows':[]};return db[_0xfcea('0x4b')]['findOne']({'where':{'id':_0x36761c[_0xfcea('0x6a')]['id']}})[_0xfcea('0x26')](handleEntityNotFound(_0x5ca850,null))['then'](function(_0x4756f4){if(_0x4756f4){_0x38331f[_0xfcea('0x4f')]=_[_0xfcea('0x52')](db['MailInteraction'][_0xfcea('0x4c')]);_0x38331f['query']=_[_0xfcea('0x52')](_0x36761c['query']);_0x38331f[_0xfcea('0x53')]=_[_0xfcea('0x54')](_0x38331f[_0xfcea('0x4f')],_0x38331f[_0xfcea('0x51')]);_0x5b5a29['attributes']=_[_0xfcea('0x54')](_0x38331f[_0xfcea('0x4f')],qs[_0xfcea('0x56')](_0x36761c['query'][_0xfcea('0x56')]));_0x5b5a29[_0xfcea('0x55')]=_0x5b5a29[_0xfcea('0x55')][_0xfcea('0x57')]?_0x5b5a29['attributes']:_0x38331f[_0xfcea('0x4f')];if(!_0x36761c[_0xfcea('0x51')]['hasOwnProperty'](_0xfcea('0x58'))){_0x5b5a29[_0xfcea('0x37')]=qs[_0xfcea('0x37')](_0x36761c['query']['limit']);_0x5b5a29[_0xfcea('0x35')]=qs[_0xfcea('0x35')](_0x36761c[_0xfcea('0x51')][_0xfcea('0x35')]);}_0x5b5a29[_0xfcea('0x6f')]=qs['sort'](_0x36761c[_0xfcea('0x51')]['sort']);_0x5b5a29[_0xfcea('0x5a')]=qs['filters'](_[_0xfcea('0x5b')](_0x36761c[_0xfcea('0x51')],_0x38331f['filters']));_0x5b5a29['where']['MailAccountId']=_0x4756f4['id'];if(_0x36761c[_0xfcea('0x51')]['filter']){_0x5b5a29['where']=_[_0xfcea('0x5d')](_0x5b5a29[_0xfcea('0x5a')],{'$or':_[_0xfcea('0x50')](_0x5b5a29[_0xfcea('0x55')],function(_0x4389b0){var _0x204079={};_0x204079[_0x4389b0]={'$like':'%'+_0x36761c['query'][_0xfcea('0x5c')]+'%'};return _0x204079;})});}_0x5b5a29=_[_0xfcea('0x5d')]({},_0x5b5a29,_0x36761c[_0xfcea('0x5e')]);return db[_0xfcea('0x94')]['count']({'where':_0x5b5a29[_0xfcea('0x5a')]})[_0xfcea('0x26')](function(_0x3c1a11){_0x17bae2[_0xfcea('0x38')]=_0x3c1a11;if(_0x36761c['query'][_0xfcea('0x5f')]){_0x5b5a29[_0xfcea('0x60')]=[{'model':db[_0xfcea('0x98')],'as':_0xfcea('0x99'),'required':![]},{'model':db[_0xfcea('0x9a')],'as':_0xfcea('0x9b'),'attributes':[_0xfcea('0x44'),'fullname',_0xfcea('0x9c')],'required':![]},{'model':db[_0xfcea('0x9d')],'as':_0xfcea('0x9e'),'attributes':['id','name',_0xfcea('0x9f')],'where':_0x36761c[_0xfcea('0x51')][_0xfcea('0xa0')]?{'id':_0x36761c['query'][_0xfcea('0xa0')]}:undefined,'required':_0x36761c[_0xfcea('0x51')]['tag']?!![]:![]}];}return db['MailInteraction'][_0xfcea('0x61')](_0x5b5a29);})[_0xfcea('0x26')](function(_0x4204ae){_0x17bae2[_0xfcea('0x62')]=_0x4204ae;return _0x17bae2;});}})[_0xfcea('0x26')](respondWithFilteredResult(_0x5ca850,_0x5b5a29))[_0xfcea('0x63')](handleError(_0x5ca850,null));};exports[_0xfcea('0xa1')]=function(_0x4ab4f2,_0x55e4df,_0x44c142){return db[_0xfcea('0x4b')][_0xfcea('0x6e')]({'where':{'id':_0x4ab4f2['params']['id']}})[_0xfcea('0x26')](handleEntityNotFound(_0x55e4df,null))[_0xfcea('0x26')](function(_0x292772){if(_0x292772){return db[_0xfcea('0xa2')][_0xfcea('0xa3')](function(_0x45803f){return db[_0xfcea('0xa4')]['destroy']({'where':{'MailAccountId':_0x4ab4f2['params']['id']},'transaction':_0x45803f})[_0xfcea('0x26')](function(_0x32b972){var _0x518709=_['map'](_0x4ab4f2['body'],function(_0x39f4fb){_0x39f4fb[_0xfcea('0x70')]=_0x4ab4f2['params']['id'];return _0x39f4fb;});return db[_0xfcea('0xa4')][_0xfcea('0xa5')](_0x518709,{'transaction':_0x45803f});});})[_0xfcea('0x26')](function(){return db['MailApplication']['findAndCountAll']({'where':{'MailAccountId':_0x4ab4f2[_0xfcea('0x6a')]['id']},'order':_0xfcea('0xa6')});});}})[_0xfcea('0x26')](respondWithResult(_0x55e4df,null))['catch'](handleError(_0x55e4df,null));};exports['getApplications']=function(_0x192249,_0x55bbf9,_0x4b0b71){var _0x34f4f5={};var _0x516a76={};var _0x12ce7c;var _0x5236b6;return db[_0xfcea('0x4b')][_0xfcea('0x6e')]({'where':{'id':_0x192249[_0xfcea('0x6a')]['id']}})['then'](handleEntityNotFound(_0x55bbf9,null))[_0xfcea('0x26')](function(_0x243c27){if(_0x243c27){_0x12ce7c=_0x243c27;_0x516a76[_0xfcea('0x4f')]=_[_0xfcea('0x52')](db[_0xfcea('0xa4')][_0xfcea('0x4c')]);_0x516a76['query']=_[_0xfcea('0x52')](_0x192249['query']);_0x516a76[_0xfcea('0x53')]=_[_0xfcea('0x54')](_0x516a76[_0xfcea('0x4f')],_0x516a76['query']);_0x34f4f5[_0xfcea('0x55')]=_[_0xfcea('0x54')](_0x516a76[_0xfcea('0x4f')],qs[_0xfcea('0x56')](_0x192249[_0xfcea('0x51')][_0xfcea('0x56')]));_0x34f4f5['attributes']=_0x34f4f5[_0xfcea('0x55')][_0xfcea('0x57')]?_0x34f4f5['attributes']:_0x516a76[_0xfcea('0x4f')];_0x34f4f5['order']=qs[_0xfcea('0x59')](_0x192249[_0xfcea('0x51')]['sort']);_0x34f4f5[_0xfcea('0x5a')]=qs['filters'](_[_0xfcea('0x5b')](_0x192249[_0xfcea('0x51')],_0x516a76[_0xfcea('0x53')]));if(_0x192249[_0xfcea('0x51')][_0xfcea('0x5c')]){_0x34f4f5[_0xfcea('0x5a')]=_[_0xfcea('0x5d')](_0x34f4f5['where'],{'$or':_[_0xfcea('0x50')](_0x34f4f5[_0xfcea('0x55')],function(_0x5d6ca9){var _0x45e1b1={};_0x45e1b1[_0x5d6ca9]={'$like':'%'+_0x192249['query']['filter']+'%'};return _0x45e1b1;})});}_0x34f4f5=_[_0xfcea('0x5d')]({},_0x34f4f5,_0x192249[_0xfcea('0x5e')]);return _0x12ce7c[_0xfcea('0xa7')](_0x34f4f5);}})[_0xfcea('0x26')](function(_0x680631){if(_0x680631){_0x5236b6=_0x680631[_0xfcea('0x57')];if(!_0x192249[_0xfcea('0x51')][_0xfcea('0xa8')]('nolimit')){_0x34f4f5['limit']=qs[_0xfcea('0x37')](_0x192249[_0xfcea('0x51')][_0xfcea('0x37')]);_0x34f4f5['offset']=qs[_0xfcea('0x35')](_0x192249[_0xfcea('0x51')][_0xfcea('0x35')]);}return _0x12ce7c['getApplications'](_0x34f4f5);}})[_0xfcea('0x26')](function(_0x2db2bb){if(_0x2db2bb){return _0x2db2bb?{'count':_0x5236b6,'rows':_0x2db2bb}:null;}})[_0xfcea('0x26')](respondWithResult(_0x55bbf9,null))[_0xfcea('0x63')](handleError(_0x55bbf9,null));};exports[_0xfcea('0xa9')]=function(_0x2ab3eb,_0x472379,_0x1da8f0){var _0x2bc0ba={'raw':!![],'where':{}};var _0x43e97d={};var _0x2b81d7={'count':0x0,'rows':[]};return db[_0xfcea('0x4b')][_0xfcea('0x6e')]({'where':{'id':_0x2ab3eb[_0xfcea('0x6a')]['id']}})[_0xfcea('0x26')](handleEntityNotFound(_0x472379,null))[_0xfcea('0x26')](function(_0x48dff0){if(_0x48dff0){_0x43e97d['model']=_[_0xfcea('0x52')](db['MailMessage'][_0xfcea('0x4c')]);_0x43e97d[_0xfcea('0x51')]=_[_0xfcea('0x52')](_0x2ab3eb[_0xfcea('0x51')]);_0x43e97d[_0xfcea('0x53')]=_['intersection'](_0x43e97d[_0xfcea('0x4f')],_0x43e97d[_0xfcea('0x51')]);_0x2bc0ba[_0xfcea('0x55')]=_['intersection'](_0x43e97d[_0xfcea('0x4f')],qs['fields'](_0x2ab3eb[_0xfcea('0x51')][_0xfcea('0x56')]));_0x2bc0ba[_0xfcea('0x55')]=_0x2bc0ba[_0xfcea('0x55')]['length']?_0x2bc0ba[_0xfcea('0x55')]:_0x43e97d[_0xfcea('0x4f')];if(!_0x2ab3eb[_0xfcea('0x51')][_0xfcea('0xa8')](_0xfcea('0x58'))){_0x2bc0ba[_0xfcea('0x37')]=qs[_0xfcea('0x37')](_0x2ab3eb[_0xfcea('0x51')][_0xfcea('0x37')]);_0x2bc0ba[_0xfcea('0x35')]=qs[_0xfcea('0x35')](_0x2ab3eb[_0xfcea('0x51')]['offset']);}_0x2bc0ba[_0xfcea('0x6f')]=qs[_0xfcea('0x59')](_0x2ab3eb[_0xfcea('0x51')]['sort']);_0x2bc0ba['where']=qs[_0xfcea('0x53')](_[_0xfcea('0x5b')](_0x2ab3eb['query'],_0x43e97d['filters']));_0x2bc0ba['where'][_0xfcea('0x70')]=_0x48dff0['id'];if(_0x2ab3eb[_0xfcea('0x51')][_0xfcea('0x5c')]){_0x2bc0ba['where']=_[_0xfcea('0x5d')](_0x2bc0ba[_0xfcea('0x5a')],{'$or':_[_0xfcea('0x50')](_0x2bc0ba[_0xfcea('0x55')],function(_0x501067){var _0x1bbd89={};_0x1bbd89[_0x501067]={'$like':'%'+_0x2ab3eb[_0xfcea('0x51')]['filter']+'%'};return _0x1bbd89;})});}if(_0x2ab3eb[_0xfcea('0x51')][_0xfcea('0xaa')]){var _0x403124=_0x2ab3eb[_0xfcea('0x51')]['$gte']['split'](',');var _0x40a1d9={};_0x40a1d9[_0x403124[0x0]]={'$gte':moment(_0x403124[0x1])['format'](_0xfcea('0xab'))};_0x2bc0ba[_0xfcea('0x5a')]=_[_0xfcea('0x5d')](_0x2bc0ba[_0xfcea('0x5a')],_0x40a1d9);}_0x2bc0ba=_[_0xfcea('0x5d')]({},_0x2bc0ba,_0x2ab3eb['options']);return db[_0xfcea('0xac')][_0xfcea('0x38')]({'where':_0x2bc0ba[_0xfcea('0x5a')]})[_0xfcea('0x26')](function(_0x2f2bad){_0x2b81d7[_0xfcea('0x38')]=_0x2f2bad;if(_0x2ab3eb[_0xfcea('0x51')][_0xfcea('0x5f')]){_0x2bc0ba['include']=[{'all':!![]}];}return db[_0xfcea('0xac')][_0xfcea('0x61')](_0x2bc0ba);})[_0xfcea('0x26')](function(_0x259f08){if(_0x2ab3eb[_0xfcea('0x51')][_0xfcea('0xad')]===_0xfcea('0xae')){for(var _0x49325f=0x0;_0x49325f<_0x259f08['length'];_0x49325f++){_0x259f08[_0x49325f][_0xfcea('0x68')]=juice(_0x259f08[_0x49325f]['body']);}}_0x2b81d7[_0xfcea('0x62')]=_0x259f08;return _0x2b81d7;});}})[_0xfcea('0x26')](respondWithFilteredResult(_0x472379,_0x2bc0ba))[_0xfcea('0x63')](handleError(_0x472379,null));};exports[_0xfcea('0x45')]=function(_0x1bb3a1,_0x17df1,_0x4c70a3){var _0x44d785,_0x5c369b={},_0x33d840;if(_0x1bb3a1[_0xfcea('0x68')]['to']){_0x33d840=_0x1bb3a1[_0xfcea('0x68')]['to'][_0xfcea('0xaf')](',')[0x0];}return db[_0xfcea('0x4b')][_0xfcea('0x67')]({'where':{'id':_0x1bb3a1[_0xfcea('0x6a')]['id']},'include':[{'model':db[_0xfcea('0xb0')],'as':_0xfcea('0xb1'),'include':[{'model':db['CmContact'],'as':'Contacts','where':{'email':_0x33d840},'limit':0x1,'order':[['updatedAt',_0xfcea('0xb2')]]}]},{'model':db['MailServerOut'],'as':_0xfcea('0x4a'),'raw':!![]}]})[_0xfcea('0x26')](handleEntityNotFound(_0x17df1,null))[_0xfcea('0x26')](function(_0x38c162){if(_0x38c162){_0x44d785=_0x38c162;if(_0x38c162[_0xfcea('0x4a')]){if(_[_0xfcea('0x79')](_0x1bb3a1['body'][_0xfcea('0xb3')])){_0x1bb3a1[_0xfcea('0x68')]['from']=util[_0xfcea('0xb4')]('%s\x20<%s>',_0x38c162['name'],_0x38c162[_0xfcea('0x77')]||_0x38c162[_0xfcea('0x4a')][_0xfcea('0x7d')]);}if(_0x1bb3a1['body']['attachments']&&_0x1bb3a1[_0xfcea('0x68')][_0xfcea('0xb5')][_0xfcea('0x57')]){for(var _0x3e085f=0x0;_0x3e085f<_0x1bb3a1[_0xfcea('0x68')][_0xfcea('0xb5')][_0xfcea('0x57')];_0x3e085f+=0x1){_0x1bb3a1['body'][_0xfcea('0xb5')][_0x3e085f]={'filename':_0x1bb3a1[_0xfcea('0x68')][_0xfcea('0xb5')][_0x3e085f][_0xfcea('0x44')],'path':path[_0xfcea('0xb6')](config[_0xfcea('0xb7')],_0xfcea('0xb8'),_0x1bb3a1[_0xfcea('0x68')][_0xfcea('0xb5')][_0x3e085f]['basename'])};}}var _0x2bbae7={'tls':{'rejectUnauthorized':![]}};if(_['isNil'](_0x38c162[_0xfcea('0x4a')][_0xfcea('0x83')])){if(_0x38c162[_0xfcea('0x4a')][_0xfcea('0x80')]){_0x2bbae7['auth']={'user':_0x38c162['Smtp']['user'],'pass':_0x38c162['Smtp']['pass']};}_0x2bbae7[_0xfcea('0x81')]=_0x38c162[_0xfcea('0x4a')]['host'];_0x2bbae7[_0xfcea('0x82')]=_0x38c162['Smtp'][_0xfcea('0x82')];_0x2bbae7[_0xfcea('0xb9')]=_0x38c162['Smtp'][_0xfcea('0xb9')];}else{_0x2bbae7['service']=_0x38c162['Smtp']['service'];_0x2bbae7[_0xfcea('0xba')]={'user':_0x38c162[_0xfcea('0x4a')][_0xfcea('0x7d')],'pass':_0x38c162['Smtp'][_0xfcea('0x85')]};}return respondWithRpcPromise(_0xfcea('0xbb'),_0xfcea('0xbc'),{'account':_0x2bbae7,'message':_0x1bb3a1[_0xfcea('0x68')]});}else{throw new Error('List\x20not\x20found');}}})[_0xfcea('0x26')](function(_0x39ddd9){if(_0x39ddd9){_0x5c369b=_0x39ddd9;if(_0x44d785['List']){if(_0x44d785[_0xfcea('0xb1')]['Contacts'][_0xfcea('0x57')]){return _0x44d785[_0xfcea('0xb1')][_0xfcea('0xbd')][0x0];}else{return db[_0xfcea('0x98')][_0xfcea('0x6c')](_[_0xfcea('0x1d')](_0x1bb3a1[_0xfcea('0x68')],{'firstName':_0x1bb3a1[_0xfcea('0x68')]['to'],'email':_0x1bb3a1[_0xfcea('0x68')]['to'],'phone':_0x1bb3a1[_0xfcea('0x68')]['to'],'ListId':_0x44d785[_0xfcea('0x78')]}));}}else{throw new Error('List\x20not\x20found');}}})[_0xfcea('0x26')](function(_0x43889a){if(_0x43889a){var _0x416cec={'UserId':_0x1bb3a1[_0xfcea('0x7d')]['id'],'ContactId':_0x43889a['id'],'MailAccountId':_0x44d785['id'],'inReplyTo':_0x5c369b[_0xfcea('0xbe')],'to':_0x1bb3a1[_0xfcea('0x68')][_0xfcea('0xb3')],'cc':_0x1bb3a1[_0xfcea('0x68')]['cc'],'subject':_0x1bb3a1[_0xfcea('0x68')][_0xfcea('0xbf')],'attach':_0x1bb3a1[_0xfcea('0x68')]['attach'],'firstMsgDirection':'out','lastMsgAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'out','Messages':[_[_0xfcea('0x5d')](_0x1bb3a1['body'],{'messageId':_0x5c369b[_0xfcea('0xbe')],'sentAt':moment()[_0xfcea('0xb4')](_0xfcea('0xab')),'read':!![],'MailAccountId':_0x44d785['id'],'UserId':_0x1bb3a1[_0xfcea('0x7d')]['id'],'ContactId':_0x43889a['id']})]};if(_0x1bb3a1[_0xfcea('0x68')][_0xfcea('0xc0')]){_0x416cec=_['merge'](_0x416cec,_0x1bb3a1[_0xfcea('0x68')]['Interaction']);}return db[_0xfcea('0x94')][_0xfcea('0x6c')](_0x416cec,{'include':[{'model':db['MailMessage'],'as':_0xfcea('0xc1')}]});}})[_0xfcea('0x26')](respondWithResult(_0x17df1,null))[_0xfcea('0x63')](handleError(_0x17df1,null));};exports[_0xfcea('0xc2')]=function(_0x1c84bd,_0x553973,_0x4b64cc){return db[_0xfcea('0x4b')][_0xfcea('0x67')]({'where':{'id':_0x1c84bd[_0xfcea('0x6a')]['id']},'include':[{'model':db[_0xfcea('0x49')],'as':_0xfcea('0x4a'),'raw':!![]}]})[_0xfcea('0x26')](handleEntityNotFound(_0x553973,null))[_0xfcea('0x26')](function(_0x42a600){if(_0x42a600&&_0x42a600[_0xfcea('0x4a')]){var _0x1e64e5={'id':_0x42a600['id'],'tls':{'rejectUnauthorized':![]}};if(_0x42a600[_0xfcea('0x4a')][_0xfcea('0x83')]){_0x1e64e5[_0xfcea('0x83')]=_0x42a600[_0xfcea('0x4a')][_0xfcea('0x83')];}else{_0x1e64e5[_0xfcea('0x81')]=_0x42a600[_0xfcea('0x4a')][_0xfcea('0x81')];_0x1e64e5[_0xfcea('0x82')]=_0x42a600[_0xfcea('0x4a')][_0xfcea('0x82')];_0x1e64e5[_0xfcea('0xb9')]=_0x42a600[_0xfcea('0x4a')][_0xfcea('0xb9')];}if(_0x42a600[_0xfcea('0x4a')][_0xfcea('0x80')]){_0x1e64e5[_0xfcea('0xba')]={'user':_0x42a600['Smtp'][_0xfcea('0x7d')],'pass':_0x42a600[_0xfcea('0x4a')][_0xfcea('0x85')]};}return respondWithRpcPromise(_0xfcea('0xc3'),'verifySmtp',{'account':_0x1e64e5});}})[_0xfcea('0x26')](respondWithResult(_0x553973,null))[_0xfcea('0x63')](handleError(_0x553973,null));};exports[_0xfcea('0x3f')]=function(_0x2ea2b3,_0x15c8b8){return db['MailAccount'][_0xfcea('0x67')]({'where':{'id':_0x2ea2b3[_0xfcea('0x6a')]['id']}})[_0xfcea('0x26')](handleEntityNotFound(_0x15c8b8,null))['then'](function(_0x23dfa9){if(_0x23dfa9&&_0x23dfa9['service']){throw new db[(_0xfcea('0xc4'))][(_0xfcea('0xc5'))](_0xfcea('0xc6'));}return _0x23dfa9;})[_0xfcea('0x26')](removeEntity(_0x15c8b8,null))[_0xfcea('0x63')](handleError(_0x15c8b8,null));};exports[_0xfcea('0xc7')]=function(_0x4ca661,_0x267247,_0x5503f3){return db['MailAccount'][_0xfcea('0x67')]({'where':{'id':_0x4ca661['params']['id']}})[_0xfcea('0x26')](handleEntityNotFound(_0x267247,null))['then'](function(_0x1e5e17){if(_0x1e5e17){return _0x1e5e17[_0xfcea('0xc7')](_0x4ca661[_0xfcea('0x68')]['ids'],_[_0xfcea('0x95')](_0x4ca661[_0xfcea('0x68')],[_0xfcea('0x96'),'id'])||{})[_0xfcea('0xc8')](function(_0x39475d){for(var _0x4bea15=0x0;_0x4bea15<_0x4ca661[_0xfcea('0x68')][_0xfcea('0x96')][_0xfcea('0x57')];_0x4bea15+=0x1){socket[_0xfcea('0xc9')](_0xfcea('0xca'),{'UserId':Number(_0x4ca661[_0xfcea('0x68')]['ids'][_0x4bea15]),'MailAccountId':Number(_0x4ca661['params']['id'])});}return _0x39475d;});}})[_0xfcea('0x26')](respondWithResult(_0x267247,null))[_0xfcea('0x63')](handleError(_0x267247,null));};exports[_0xfcea('0xcb')]=function(_0x401420,_0xa88d8,_0x4096d2){return db[_0xfcea('0x4b')][_0xfcea('0x67')]({'where':{'id':_0x401420[_0xfcea('0x6a')]['id']}})[_0xfcea('0x26')](handleEntityNotFound(_0xa88d8,null))['then'](function(_0x910982){if(_0x910982){return _0x910982[_0xfcea('0xcb')](_0x401420[_0xfcea('0x51')][_0xfcea('0x96')])[_0xfcea('0x26')](function(){if(_['isArray'](_0x401420['query']['ids'])){for(var _0x524dcd=0x0;_0x524dcd<_0x401420[_0xfcea('0x51')]['ids'][_0xfcea('0x57')];_0x524dcd+=0x1){socket[_0xfcea('0xc9')](_0xfcea('0xcc'),{'UserId':Number(_0x401420[_0xfcea('0x51')][_0xfcea('0x96')][_0x524dcd]),'MailAccountId':Number(_0x401420[_0xfcea('0x6a')]['id'])});}}else{socket['emit'](_0xfcea('0xcc'),{'UserId':Number(_0x401420[_0xfcea('0x51')][_0xfcea('0x96')]),'MailAccountId':Number(_0x401420['params']['id'])});}});}})[_0xfcea('0x26')](respondWithStatusCode(_0xa88d8,null))[_0xfcea('0x63')](handleError(_0xa88d8,null));};exports[_0xfcea('0xcd')]=function(_0x45db0a,_0x1357d4,_0x3fd9f0){var _0x47bb9e={};var _0x1fe57f={};var _0x4a5ab8;var _0x2cb049;return db[_0xfcea('0x4b')]['findOne']({'where':{'id':_0x45db0a['params']['id']}})['then'](handleEntityNotFound(_0x1357d4,null))[_0xfcea('0x26')](function(_0x116c91){if(_0x116c91){_0x4a5ab8=_0x116c91;_0x1fe57f[_0xfcea('0x4f')]=_[_0xfcea('0x52')](db['User'][_0xfcea('0x4c')]);_0x1fe57f[_0xfcea('0x51')]=_['keys'](_0x45db0a['query']);_0x1fe57f[_0xfcea('0x53')]=_[_0xfcea('0x54')](_0x1fe57f[_0xfcea('0x4f')],_0x1fe57f[_0xfcea('0x51')]);_0x47bb9e[_0xfcea('0x55')]=_[_0xfcea('0x54')](_0x1fe57f[_0xfcea('0x4f')],qs[_0xfcea('0x56')](_0x45db0a[_0xfcea('0x51')][_0xfcea('0x56')]));_0x47bb9e[_0xfcea('0x55')]=_0x47bb9e[_0xfcea('0x55')][_0xfcea('0x57')]?_0x47bb9e[_0xfcea('0x55')]:_0x1fe57f['model'];_0x47bb9e[_0xfcea('0x6f')]=qs[_0xfcea('0x59')](_0x45db0a[_0xfcea('0x51')]['sort']);_0x47bb9e[_0xfcea('0x5a')]=qs['filters'](_['pick'](_0x45db0a[_0xfcea('0x51')],_0x1fe57f[_0xfcea('0x53')]));if(_0x45db0a['query'][_0xfcea('0x5c')]){_0x47bb9e[_0xfcea('0x5a')]=_[_0xfcea('0x5d')](_0x47bb9e[_0xfcea('0x5a')],{'$or':_[_0xfcea('0x50')](_0x47bb9e[_0xfcea('0x55')],function(_0x154ea2){var _0x2a4823={};_0x2a4823[_0x154ea2]={'$like':'%'+_0x45db0a[_0xfcea('0x51')][_0xfcea('0x5c')]+'%'};return _0x2a4823;})});}_0x47bb9e=_[_0xfcea('0x5d')]({},_0x47bb9e,_0x45db0a[_0xfcea('0x5e')]);return _0x4a5ab8['getAgents'](_0x47bb9e);}})[_0xfcea('0x26')](function(_0x623205){if(_0x623205){_0x2cb049=_0x623205[_0xfcea('0x57')];if(!_0x45db0a[_0xfcea('0x51')][_0xfcea('0xa8')](_0xfcea('0x58'))){_0x47bb9e['limit']=qs[_0xfcea('0x37')](_0x45db0a['query'][_0xfcea('0x37')]);_0x47bb9e[_0xfcea('0x35')]=qs[_0xfcea('0x35')](_0x45db0a[_0xfcea('0x51')]['offset']);}return _0x4a5ab8[_0xfcea('0xcd')](_0x47bb9e);}})[_0xfcea('0x26')](function(_0x1b82fb){if(_0x1b82fb){return _0x1b82fb?{'count':_0x2cb049,'rows':_0x1b82fb}:null;}})['then'](respondWithResult(_0x1357d4,null))['catch'](handleError(_0x1357d4,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index b14e1c1..b20ac72 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 _0x36c3=['hook','exports','events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty'];(function(_0x33fd8e,_0x19845d){var _0x1cc3a5=function(_0x4a55d0){while(--_0x4a55d0){_0x33fd8e['push'](_0x33fd8e['shift']());}};_0x1cc3a5(++_0x19845d);}(_0x36c3,0x1a6));var _0x336c=function(_0x39e9f4,_0x7da7be){_0x39e9f4=_0x39e9f4-0x0;var _0x16b495=_0x36c3[_0x39e9f4];return _0x16b495;};'use strict';var EventEmitter=require(_0x336c('0x0'));var MailAccount=require(_0x336c('0x1'))['db']['MailAccount'];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x336c('0x2')](0x0);var events={'afterCreate':_0x336c('0x3'),'afterUpdate':_0x336c('0x4'),'afterDestroy':_0x336c('0x5')};function emitEvent(_0x32aed2){return function(_0x2b1194,_0x39ed12,_0x4e4c07){MailAccountEvents[_0x336c('0x6')](_0x32aed2+':'+_0x2b1194['id'],_0x2b1194);MailAccountEvents[_0x336c('0x6')](_0x32aed2,_0x2b1194);_0x4e4c07(null);};}for(var e in events){if(events[_0x336c('0x7')](e)){var event=events[e];MailAccount[_0x336c('0x8')](e,emitEvent(event));}}module[_0x336c('0x9')]=MailAccountEvents; \ No newline at end of file +var _0x1324=['emit','hasOwnProperty','hook','events','setMaxListeners','save','update','remove'];(function(_0x7feb90,_0x28e700){var _0x3c5b33=function(_0x113cfa){while(--_0x113cfa){_0x7feb90['push'](_0x7feb90['shift']());}};_0x3c5b33(++_0x28e700);}(_0x1324,0x1c3));var _0x4132=function(_0x52b2e7,_0x5cceb2){_0x52b2e7=_0x52b2e7-0x0;var _0x16b338=_0x1324[_0x52b2e7];return _0x16b338;};'use strict';var EventEmitter=require(_0x4132('0x0'));var MailAccount=require('../../mysqldb')['db']['MailAccount'];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x4132('0x1')](0x0);var events={'afterCreate':_0x4132('0x2'),'afterUpdate':_0x4132('0x3'),'afterDestroy':_0x4132('0x4')};function emitEvent(_0x3f61ec){return function(_0x4e7985,_0x170367,_0x396ef2){MailAccountEvents[_0x4132('0x5')](_0x3f61ec+':'+_0x4e7985['id'],_0x4e7985);MailAccountEvents[_0x4132('0x5')](_0x3f61ec,_0x4e7985);_0x396ef2(null);};}for(var e in events){if(events[_0x4132('0x6')](e)){var event=events[e];MailAccount[_0x4132('0x7')](e,emitEvent(event));}}module['exports']=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index 18df50b..f7a809a 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 _0x079b=['exports','MailAccount','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment'];(function(_0x9e98cf,_0x217d15){var _0x22d06c=function(_0x6a7f0c){while(--_0x6a7f0c){_0x9e98cf['push'](_0x9e98cf['shift']());}};_0x22d06c(++_0x217d15);}(_0x079b,0x1c4));var _0xb079=function(_0x31687e,_0x42b91a){_0x31687e=_0x31687e-0x0;var _0x10fbb4=_0x079b[_0x31687e];return _0x10fbb4;};'use strict';var _=require('lodash');var util=require(_0xb079('0x0'));var logger=require(_0xb079('0x1'))(_0xb079('0x2'));var moment=require(_0xb079('0x3'));var BPromise=require('bluebird');var rp=require(_0xb079('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb079('0x5'));var config=require(_0xb079('0x6'));var attributes=require('./mailAccount.attributes');module[_0xb079('0x7')]=function(_0x1c3bd8,_0x2a5ec0){return _0x1c3bd8['define'](_0xb079('0x8'),attributes,{'tableName':'mail_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x13d0=['exports','define','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./mailAccount.attributes'];(function(_0x466410,_0x4069d9){var _0x3d758e=function(_0x400fc0){while(--_0x400fc0){_0x466410['push'](_0x466410['shift']());}};_0x3d758e(++_0x4069d9);}(_0x13d0,0x9e));var _0x013d=function(_0x127bab,_0x5f4482){_0x127bab=_0x127bab-0x0;var _0x21ccef=_0x13d0[_0x127bab];return _0x21ccef;};'use strict';var _=require(_0x013d('0x0'));var util=require(_0x013d('0x1'));var logger=require(_0x013d('0x2'))(_0x013d('0x3'));var moment=require(_0x013d('0x4'));var BPromise=require('bluebird');var rp=require(_0x013d('0x5'));var fs=require('fs');var path=require(_0x013d('0x6'));var rimraf=require(_0x013d('0x7'));var config=require(_0x013d('0x8'));var attributes=require(_0x013d('0x9'));module[_0x013d('0xa')]=function(_0x5a0214,_0x25c6d2){return _0x5a0214[_0x013d('0xb')]('MailAccount',attributes,{'tableName':'mail_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.rpc.js b/server/api/mailAccount/mailAccount.rpc.js index 6931d70..03c1174 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 _0xd11f=['register','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetMailAccount','MailAccount','findAll','options','raw','where','attributes','limit','include','model','map','stringify','ShowMailAccount','find','NotifyMailAccount','mail','keys','CmContact','createdAt','updatedAt','CompanyId','body','from','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','CmList','Contacts','DESC','Applications','MailServerOut','Smtp','List','get','omit','applications','list','orderBy','priority','push','length','close','autoclose','*,*,*,*','ListId','create','List\x20not\x20found','contact','messageId','attach','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','Messages','inReplyTo','spread','update','subject','interaction','created','attachments','originTo','originCc','originChannel','Email','ChatOfflineMessageId','Attachment','Attachments','UserId','name','unshift','agent','waitForTheAssignedAgent','Start','startRouting','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','./mailAccount.socket'];(function(_0x213761,_0x39e4dd){var _0x11b67d=function(_0x45f79d){while(--_0x45f79d){_0x213761['push'](_0x213761['shift']());}};_0x11b67d(++_0x39e4dd);}(_0xd11f,0x133));var _0xfd11=function(_0x817d9b,_0x3c37e3){_0x817d9b=_0x817d9b-0x0;var _0x2752e1=_0xd11f[_0x817d9b];return _0x2752e1;};'use strict';var _=require(_0xfd11('0x0'));var util=require(_0xfd11('0x1'));var moment=require(_0xfd11('0x2'));var BPromise=require(_0xfd11('0x3'));var rs=require(_0xfd11('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xfd11('0x5'));var logger=require(_0xfd11('0x6'))('rpc');var config=require(_0xfd11('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xfd11('0x8')][_0xfd11('0x9')]({'port':0x232c});config[_0xfd11('0xa')]=_[_0xfd11('0xb')](config[_0xfd11('0xa')],{'host':_0xfd11('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfd11('0xa')]));require(_0xfd11('0xd'))[_0xfd11('0xe')](socket);function respondWithRpcPromise(_0x47c319,_0x4b45f9,_0x356a68){return new BPromise(function(_0x410fa0,_0x588ce0){return client[_0xfd11('0xf')](_0x47c319,_0x356a68)[_0xfd11('0x10')](function(_0x347029){logger[_0xfd11('0x11')](_0xfd11('0x12'),_0x4b45f9,_0xfd11('0x13'));logger[_0xfd11('0x14')](_0xfd11('0x15'),_0x4b45f9,_0xfd11('0x13'),JSON['stringify'](_0x347029));if(_0x347029[_0xfd11('0x16')]){if(_0x347029[_0xfd11('0x16')][_0xfd11('0x17')]===0x1f4){logger[_0xfd11('0x16')](_0xfd11('0x12'),_0x4b45f9,_0x347029['error'][_0xfd11('0x18')]);return _0x588ce0(_0x347029[_0xfd11('0x16')][_0xfd11('0x18')]);}logger['error'](_0xfd11('0x12'),_0x4b45f9,_0x347029[_0xfd11('0x16')]['message']);return _0x410fa0(_0x347029[_0xfd11('0x16')][_0xfd11('0x18')]);}else{logger[_0xfd11('0x11')]('MailAccount,\x20%s,\x20%s',_0x4b45f9,_0xfd11('0x13'));_0x410fa0(_0x347029[_0xfd11('0x19')][_0xfd11('0x18')]);}})[_0xfd11('0x1a')](function(_0x1ff125){logger[_0xfd11('0x16')](_0xfd11('0x12'),_0x4b45f9,_0x1ff125);_0x588ce0(_0x1ff125);});});}exports[_0xfd11('0x1b')]=function(_0xeb2eb2){var _0x5c7f4b=this;return new Promise(function(_0x427985,_0xe1ae54){return db[_0xfd11('0x1c')][_0xfd11('0x1d')]({'raw':_0xeb2eb2['options']?_0xeb2eb2[_0xfd11('0x1e')][_0xfd11('0x1f')]===undefined?!![]:![]:!![],'where':_0xeb2eb2[_0xfd11('0x1e')]?_0xeb2eb2[_0xfd11('0x1e')][_0xfd11('0x20')]||null:null,'attributes':_0xeb2eb2['options']?_0xeb2eb2['options'][_0xfd11('0x21')]||null:null,'limit':_0xeb2eb2[_0xfd11('0x1e')]?_0xeb2eb2[_0xfd11('0x1e')][_0xfd11('0x22')]||null:null,'include':_0xeb2eb2[_0xfd11('0x1e')]?_0xeb2eb2[_0xfd11('0x1e')][_0xfd11('0x23')]?_['map'](_0xeb2eb2['options']['include'],function(_0x1a90a8){return{'model':db[_0x1a90a8[_0xfd11('0x24')]],'as':_0x1a90a8['as'],'attributes':_0x1a90a8[_0xfd11('0x21')],'include':_0x1a90a8[_0xfd11('0x23')]?_[_0xfd11('0x25')](_0x1a90a8['include'],function(_0x28ae5f){return{'model':db[_0x28ae5f[_0xfd11('0x24')]],'as':_0x28ae5f['as'],'attributes':_0x28ae5f[_0xfd11('0x21')],'include':_0x28ae5f['include']?_[_0xfd11('0x25')](_0x28ae5f['include'],function(_0x56b1ca){return{'model':db[_0x56b1ca['model']],'as':_0x56b1ca['as'],'attributes':_0x56b1ca[_0xfd11('0x21')]};}):[]};}):[]};}):[]:[]})[_0xfd11('0x10')](function(_0x258a48){logger[_0xfd11('0x11')](_0xfd11('0x1b'),_0xeb2eb2);logger[_0xfd11('0x14')]('GetMailAccount',_0xeb2eb2,JSON[_0xfd11('0x26')](_0x258a48));_0x427985(_0x258a48);})[_0xfd11('0x1a')](function(_0x1eb45a){logger[_0xfd11('0x16')](_0xfd11('0x1b'),_0x1eb45a[_0xfd11('0x18')],_0xeb2eb2);_0xe1ae54(_0x5c7f4b[_0xfd11('0x16')](0x1f4,_0x1eb45a[_0xfd11('0x18')]));});});};exports[_0xfd11('0x27')]=function(_0x17dfa8){var _0xeb73b=this;return new Promise(function(_0x177e11,_0xab90db){return db[_0xfd11('0x1c')][_0xfd11('0x28')]({'raw':_0x17dfa8[_0xfd11('0x1e')]?_0x17dfa8[_0xfd11('0x1e')][_0xfd11('0x1f')]===undefined?!![]:![]:!![],'where':_0x17dfa8['options']?_0x17dfa8['options'][_0xfd11('0x20')]||null:null,'attributes':_0x17dfa8['options']?_0x17dfa8[_0xfd11('0x1e')]['attributes']||null:null,'include':_0x17dfa8['options']?_0x17dfa8['options'][_0xfd11('0x23')]?_[_0xfd11('0x25')](_0x17dfa8[_0xfd11('0x1e')][_0xfd11('0x23')],function(_0x570391){return{'model':db[_0x570391[_0xfd11('0x24')]],'as':_0x570391['as'],'attributes':_0x570391[_0xfd11('0x21')],'include':_0x570391[_0xfd11('0x23')]?_['map'](_0x570391['include'],function(_0x5c69c7){return{'model':db[_0x5c69c7[_0xfd11('0x24')]],'as':_0x5c69c7['as'],'attributes':_0x5c69c7[_0xfd11('0x21')],'include':_0x5c69c7[_0xfd11('0x23')]?_['map'](_0x5c69c7['include'],function(_0x49a567){return{'model':db[_0x49a567[_0xfd11('0x24')]],'as':_0x49a567['as'],'attributes':_0x49a567['attributes']};}):[]};}):[]};}):[]:[]})[_0xfd11('0x10')](function(_0x1dfbc8){logger[_0xfd11('0x11')](_0xfd11('0x27'),_0x17dfa8);logger[_0xfd11('0x14')](_0xfd11('0x27'),_0x17dfa8,JSON[_0xfd11('0x26')](_0x1dfbc8));_0x177e11(_0x1dfbc8);})['catch'](function(_0x369150){logger[_0xfd11('0x16')](_0xfd11('0x27'),_0x369150[_0xfd11('0x18')],_0x17dfa8);_0xab90db(_0xeb73b[_0xfd11('0x16')](0x1f4,_0x369150['message']));});});};exports[_0xfd11('0x29')]=function(_0x22b8a5){var _0x173bb5=this;return new Promise(function(_0x252513,_0xa9e3c4){var _0x4878a2={'body':_0x22b8a5['body'],'channel':_0xfd11('0x2a')};var _0x3e8123=_['difference'](_[_0xfd11('0x2b')](db[_0xfd11('0x2c')]['rawAttributes']),[_0xfd11('0x2d'),_0xfd11('0x2e'),_0xfd11('0x2f'),'ListId']);var _0x4492f7=![];if(_0x22b8a5[_0xfd11('0x30')]['id']){delete _0x22b8a5[_0xfd11('0x30')]['id'];}if(_['isNil'](_0x22b8a5[_0xfd11('0x30')][_0xfd11('0x31')])){return _0xa9e3c4(_0x173bb5[_0xfd11('0x16')](0x1f4,_0xfd11('0x32')));}if(_[_0xfd11('0x33')](_0x22b8a5[_0xfd11('0x30')][_0xfd11('0x30')])||_0x22b8a5[_0xfd11('0x30')][_0xfd11('0x30')]===''){return _0xa9e3c4(_0x173bb5[_0xfd11('0x16')](0x1f4,_0xfd11('0x34')));}if(_[_0xfd11('0x33')](_0x22b8a5['body']['mapKey'])){return _0xa9e3c4(_0x173bb5[_0xfd11('0x16')](0x1f4,'mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3e8123));}if(!_[_0xfd11('0x35')](_0x3e8123,_0x22b8a5[_0xfd11('0x30')][_0xfd11('0x36')])){return _0xa9e3c4(_0x173bb5[_0xfd11('0x16')](0x1f4,_0xfd11('0x37')+_0x3e8123));}var _0xe09b31={};_0xe09b31[_0x22b8a5['body'][_0xfd11('0x36')]]=_0x22b8a5[_0xfd11('0x30')]['from'];return db[_0xfd11('0x1c')][_0xfd11('0x28')]({'where':{'id':_0x22b8a5[_0xfd11('0x38')]['id']},'include':[{'model':db[_0xfd11('0x39')],'as':'List','include':[{'model':db['CmContact'],'as':_0xfd11('0x3a'),'where':_0xe09b31,'limit':0x1,'order':[[_0xfd11('0x2e'),_0xfd11('0x3b')]]}]},{'model':db['MailApplication'],'as':_0xfd11('0x3c')},{'model':db[_0xfd11('0x3d')],'as':_0xfd11('0x3e')}]})[_0xfd11('0x10')](function(_0x13e922){if(_0x13e922&&_0x13e922[_0xfd11('0x3f')]){var _0x79faab=_0x13e922[_0xfd11('0x40')]({'plain':!![]});_0x4878a2[_0xfd11('0x38')]=_[_0xfd11('0x41')](_0x79faab,[_0xfd11('0x3c'),_0xfd11('0x3f')]);_0x4878a2[_0xfd11('0x42')]=_0x79faab[_0xfd11('0x3c')];_0x4878a2[_0xfd11('0x43')]=_0x79faab[_0xfd11('0x3f')];_0x4878a2[_0xfd11('0x42')]=_[_0xfd11('0x44')](_0x4878a2[_0xfd11('0x42')],[_0xfd11('0x45')],['asc']);if(_0x4878a2[_0xfd11('0x38')]&&_0x4878a2[_0xfd11('0x38')]['autoclose']){_0x4878a2[_0xfd11('0x42')][_0xfd11('0x46')]({'id':0x0,'priority':_0x4878a2['applications'][_0xfd11('0x47')]+0x1,'app':_0xfd11('0x48'),'appdata':_0xfd11('0x49'),'interval':_0xfd11('0x4a')});}if(_0x4878a2['account'][_0xfd11('0x3c')]){delete _0x4878a2[_0xfd11('0x38')][_0xfd11('0x3c')];}if(_0x4878a2[_0xfd11('0x38')]['List']){delete _0x4878a2[_0xfd11('0x38')][_0xfd11('0x3f')];}if(_0x79faab[_0xfd11('0x3f')][_0xfd11('0x3a')][_0xfd11('0x47')]){return _0x79faab['List']['Contacts'][0x0];}var _0xf397af=_[_0xfd11('0xb')](_0x22b8a5['body'],{'firstName':_0x22b8a5[_0xfd11('0x30')]['from'],'ListId':_0x79faab[_0xfd11('0x4b')]});_0xf397af[_0x22b8a5[_0xfd11('0x30')]['mapKey']]=_0x22b8a5[_0xfd11('0x30')][_0xfd11('0x31')];return db[_0xfd11('0x2c')][_0xfd11('0x4c')](_0xf397af);}else{throw new Error(_0xfd11('0x4d'));}})['then'](function(_0x238681){_0x4878a2[_0xfd11('0x4e')]=_0x238681;if(_0x238681){if(!_0x22b8a5['body'][_0xfd11('0x18')][_0xfd11('0x4f')]){_0x22b8a5['body'][_0xfd11('0x18')][_0xfd11('0x4f')]=rs['generate']()+'\x20'+_0x22b8a5['body']['message'][_0xfd11('0x31')];}var _0x283e6a={'ContactId':_0x238681['id'],'MailAccountId':_0x22b8a5[_0xfd11('0x38')]['id'],'inReplyTo':_0x22b8a5['body'][_0xfd11('0x18')]['messageId'],'to':_0x22b8a5[_0xfd11('0x30')][_0xfd11('0x18')][_0xfd11('0x31')],'cc':_0x22b8a5['body'][_0xfd11('0x18')]['cc'],'subject':_0x22b8a5[_0xfd11('0x30')]['message']['subject'],'attach':_0x22b8a5['body']['message'][_0xfd11('0x50')],'lastMsgAt':moment()[_0xfd11('0x51')](_0xfd11('0x52')),'lastMsgDirection':'in'};return db[_0xfd11('0x53')][_0xfd11('0x28')]({'where':{'closed':![],'MailAccountId':_0x22b8a5[_0xfd11('0x38')]['id']},'include':[{'model':db[_0xfd11('0x54')],'as':_0xfd11('0x55'),'attributes':[_0xfd11('0x4f')],'where':{'messageId':_0x22b8a5['body']['message'][_0xfd11('0x56')]}}]})[_0xfd11('0x10')](function(_0x163539){if(_0x163539){return[_0x163539,![]];}return db[_0xfd11('0x53')]['create'](_0x283e6a)['then'](function(_0x24eaf7){return[_0x24eaf7,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0xfd11('0x57')](function(_0x58da26,_0x38a48a){if(_0x58da26){_0x4492f7=_0x38a48a;if(!_0x38a48a){return _0x58da26[_0xfd11('0x58')]({'inReplyTo':_0x22b8a5[_0xfd11('0x30')][_0xfd11('0x18')]['messageId'],'to':_0x22b8a5[_0xfd11('0x30')][_0xfd11('0x18')][_0xfd11('0x31')],'cc':_0x22b8a5[_0xfd11('0x30')][_0xfd11('0x18')]['cc'],'subject':_0x22b8a5[_0xfd11('0x30')][_0xfd11('0x18')][_0xfd11('0x59')],'attach':_0x58da26[_0xfd11('0x50')]?_0x58da26[_0xfd11('0x50')]:_0x22b8a5[_0xfd11('0x30')]['message']['attach'],'substatus':null,'substatusAt':moment()[_0xfd11('0x51')](_0xfd11('0x52')),'lastMsgAt':moment()[_0xfd11('0x51')](_0xfd11('0x52')),'lastMsgDirection':'in'});}else{return _0x58da26;}}})['then'](function(_0x37504c){_0x4878a2[_0xfd11('0x5a')]=_0x37504c[_0xfd11('0x40')]({'plain':!![]});_0x4878a2['interaction'][_0xfd11('0x5b')]=_0x4492f7;return db[_0xfd11('0x54')][_0xfd11('0x4c')]({'body':_0x22b8a5[_0xfd11('0x30')][_0xfd11('0x30')],'MailAccountId':_0x22b8a5[_0xfd11('0x38')]['id'],'MailInteractionId':_0x37504c['id'],'direction':'in','ContactId':_0x4878a2[_0xfd11('0x4e')]['id'],'messageId':_0x22b8a5[_0xfd11('0x30')][_0xfd11('0x18')]['messageId'],'from':_0x22b8a5[_0xfd11('0x30')][_0xfd11('0x18')][_0xfd11('0x31')],'to':_0x22b8a5[_0xfd11('0x30')][_0xfd11('0x18')]['to'],'cc':_0x22b8a5['body']['message']['cc'],'subject':_0x22b8a5[_0xfd11('0x30')]['message'][_0xfd11('0x59')],'attach':_0x22b8a5[_0xfd11('0x30')][_0xfd11('0x18')][_0xfd11('0x50')],'Attachments':_0x22b8a5['body'][_0xfd11('0x18')][_0xfd11('0x5c')],'originTo':_0x22b8a5[_0xfd11('0x30')][_0xfd11('0x18')][_0xfd11('0x5d')],'originCc':_0x22b8a5[_0xfd11('0x30')]['message'][_0xfd11('0x5e')],'bcc':_0x22b8a5[_0xfd11('0x30')][_0xfd11('0x18')]['bcc'],'ChatWebsiteId':_0x22b8a5['body'][_0xfd11('0x18')]['ChatWebsiteId']||null,'originChannel':_0x22b8a5[_0xfd11('0x30')][_0xfd11('0x18')][_0xfd11('0x5f')]||_0xfd11('0x60'),'ChatOfflineMessageId':_0x22b8a5[_0xfd11('0x30')][_0xfd11('0x18')][_0xfd11('0x61')]||null},{'include':[{'model':db[_0xfd11('0x62')],'as':_0xfd11('0x63')}]});})['then'](function(_0x1d4d68){_0x4878a2[_0xfd11('0x18')]=_0x1d4d68;if(_0x4878a2['interaction'][_0xfd11('0x64')]){return db['User'][_0xfd11('0x28')]({'attributes':['id',_0xfd11('0x65')],'where':{'id':_0x4878a2['interaction']['UserId']}})[_0xfd11('0x10')](function(_0x5b3480){if(_0x5b3480){_0x4878a2[_0xfd11('0x42')][_0xfd11('0x66')]({'id':0x0,'priority':0x0,'app':_0xfd11('0x67'),'appdata':_0x5b3480[_0xfd11('0x65')]+','+(_0x4878a2['account'][_0xfd11('0x68')]||0xa),'interval':_0xfd11('0x4a')});}return respondWithRpcPromise(_0xfd11('0x69'),_0xfd11('0x6a'),_0x4878a2);});}return respondWithRpcPromise(_0xfd11('0x69'),_0xfd11('0x6a'),_0x4878a2);})[_0xfd11('0x10')](function(_0x1f1713){_0x252513(_0x1f1713);})[_0xfd11('0x1a')](function(_0x269c5a){_0xa9e3c4(_0x173bb5[_0xfd11('0x16')](0x1f4,_0x269c5a[_0xfd11('0x18')]));});});}; \ No newline at end of file +var _0x6e52=['omit','Applications','applications','orderBy','autoclose','push','close','*,*,*,*','length','create','List\x20not\x20found','contact','messageId','generate','subject','YYYY-MM-DD\x20HH:mm:ss','Messages','inReplyTo','Contact\x20not\x20found','spread','update','attach','format','interaction','created','MailMessage','attachments','originTo','originCc','bcc','ChatWebsiteId','Email','Attachment','UserId','User','name','unshift','agent','waitForTheAssignedAgent','Start','startRouting','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./mailAccount.socket','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','error','code','message','catch','GetMailAccount','MailAccount','options','attributes','include','model','map','stringify','find','raw','where','ShowMailAccount','NotifyMailAccount','body','mail','difference','keys','CmContact','createdAt','updatedAt','CompanyId','ListId','isNil','from','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','List','Contacts','DESC','MailApplication','MailServerOut','get'];(function(_0x5af1ad,_0x612fe4){var _0x4437ea=function(_0x3511ec){while(--_0x3511ec){_0x5af1ad['push'](_0x5af1ad['shift']());}};_0x4437ea(++_0x612fe4);}(_0x6e52,0x161));var _0x26e5=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x6e52[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0x26e5('0x0'));var moment=require(_0x26e5('0x1'));var BPromise=require(_0x26e5('0x2'));var rs=require(_0x26e5('0x3'));var fs=require('fs');var Redis=require(_0x26e5('0x4'));var db=require(_0x26e5('0x5'))['db'];var utils=require(_0x26e5('0x6'));var logger=require(_0x26e5('0x7'))(_0x26e5('0x8'));var config=require(_0x26e5('0x9'));var jayson=require(_0x26e5('0xa'));var client=jayson[_0x26e5('0xb')][_0x26e5('0xc')]({'port':0x232c});config[_0x26e5('0xd')]=_[_0x26e5('0xe')](config[_0x26e5('0xd')],{'host':_0x26e5('0xf'),'port':0x18eb});var socket=require(_0x26e5('0x10'))(new Redis(config[_0x26e5('0xd')]));require(_0x26e5('0x11'))['register'](socket);function respondWithRpcPromise(_0x1935ac,_0x417ca7,_0x47b5d0){return new BPromise(function(_0xf44a15,_0x648b27){return client['request'](_0x1935ac,_0x47b5d0)[_0x26e5('0x12')](function(_0x60bba2){logger[_0x26e5('0x13')](_0x26e5('0x14'),_0x417ca7,_0x26e5('0x15'));logger[_0x26e5('0x16')](_0x26e5('0x17'),_0x417ca7,_0x26e5('0x15'),JSON['stringify'](_0x60bba2));if(_0x60bba2['error']){if(_0x60bba2[_0x26e5('0x18')][_0x26e5('0x19')]===0x1f4){logger[_0x26e5('0x18')](_0x26e5('0x14'),_0x417ca7,_0x60bba2[_0x26e5('0x18')][_0x26e5('0x1a')]);return _0x648b27(_0x60bba2[_0x26e5('0x18')][_0x26e5('0x1a')]);}logger[_0x26e5('0x18')](_0x26e5('0x14'),_0x417ca7,_0x60bba2[_0x26e5('0x18')][_0x26e5('0x1a')]);return _0xf44a15(_0x60bba2['error'][_0x26e5('0x1a')]);}else{logger['info'](_0x26e5('0x14'),_0x417ca7,_0x26e5('0x15'));_0xf44a15(_0x60bba2['result'][_0x26e5('0x1a')]);}})[_0x26e5('0x1b')](function(_0x509bd4){logger[_0x26e5('0x18')](_0x26e5('0x14'),_0x417ca7,_0x509bd4);_0x648b27(_0x509bd4);});});}exports[_0x26e5('0x1c')]=function(_0x556981){var _0x395a8b=this;return new Promise(function(_0x3244bf,_0x1854d4){return db[_0x26e5('0x1d')]['findAll']({'raw':_0x556981[_0x26e5('0x1e')]?_0x556981[_0x26e5('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x556981[_0x26e5('0x1e')]?_0x556981[_0x26e5('0x1e')]['where']||null:null,'attributes':_0x556981[_0x26e5('0x1e')]?_0x556981[_0x26e5('0x1e')][_0x26e5('0x1f')]||null:null,'limit':_0x556981[_0x26e5('0x1e')]?_0x556981[_0x26e5('0x1e')]['limit']||null:null,'include':_0x556981[_0x26e5('0x1e')]?_0x556981[_0x26e5('0x1e')][_0x26e5('0x20')]?_['map'](_0x556981[_0x26e5('0x1e')][_0x26e5('0x20')],function(_0x10f6bc){return{'model':db[_0x10f6bc[_0x26e5('0x21')]],'as':_0x10f6bc['as'],'attributes':_0x10f6bc[_0x26e5('0x1f')],'include':_0x10f6bc['include']?_['map'](_0x10f6bc[_0x26e5('0x20')],function(_0x292fed){return{'model':db[_0x292fed[_0x26e5('0x21')]],'as':_0x292fed['as'],'attributes':_0x292fed[_0x26e5('0x1f')],'include':_0x292fed['include']?_[_0x26e5('0x22')](_0x292fed[_0x26e5('0x20')],function(_0x356047){return{'model':db[_0x356047['model']],'as':_0x356047['as'],'attributes':_0x356047[_0x26e5('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x26e5('0x12')](function(_0x48d596){logger['info'](_0x26e5('0x1c'),_0x556981);logger[_0x26e5('0x16')](_0x26e5('0x1c'),_0x556981,JSON[_0x26e5('0x23')](_0x48d596));_0x3244bf(_0x48d596);})[_0x26e5('0x1b')](function(_0x5f2f87){logger[_0x26e5('0x18')](_0x26e5('0x1c'),_0x5f2f87[_0x26e5('0x1a')],_0x556981);_0x1854d4(_0x395a8b['error'](0x1f4,_0x5f2f87[_0x26e5('0x1a')]));});});};exports['ShowMailAccount']=function(_0xac2e0e){var _0x3e01e5=this;return new Promise(function(_0x3dcdeb,_0x37bbfc){return db[_0x26e5('0x1d')][_0x26e5('0x24')]({'raw':_0xac2e0e[_0x26e5('0x1e')]?_0xac2e0e[_0x26e5('0x1e')][_0x26e5('0x25')]===undefined?!![]:![]:!![],'where':_0xac2e0e[_0x26e5('0x1e')]?_0xac2e0e[_0x26e5('0x1e')][_0x26e5('0x26')]||null:null,'attributes':_0xac2e0e[_0x26e5('0x1e')]?_0xac2e0e[_0x26e5('0x1e')][_0x26e5('0x1f')]||null:null,'include':_0xac2e0e['options']?_0xac2e0e['options']['include']?_[_0x26e5('0x22')](_0xac2e0e[_0x26e5('0x1e')][_0x26e5('0x20')],function(_0x23713b){return{'model':db[_0x23713b[_0x26e5('0x21')]],'as':_0x23713b['as'],'attributes':_0x23713b['attributes'],'include':_0x23713b['include']?_['map'](_0x23713b[_0x26e5('0x20')],function(_0x5bb48d){return{'model':db[_0x5bb48d[_0x26e5('0x21')]],'as':_0x5bb48d['as'],'attributes':_0x5bb48d[_0x26e5('0x1f')],'include':_0x5bb48d['include']?_['map'](_0x5bb48d[_0x26e5('0x20')],function(_0x1d7ff5){return{'model':db[_0x1d7ff5['model']],'as':_0x1d7ff5['as'],'attributes':_0x1d7ff5[_0x26e5('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1b820f){logger[_0x26e5('0x13')](_0x26e5('0x27'),_0xac2e0e);logger[_0x26e5('0x16')](_0x26e5('0x27'),_0xac2e0e,JSON[_0x26e5('0x23')](_0x1b820f));_0x3dcdeb(_0x1b820f);})[_0x26e5('0x1b')](function(_0xced2e9){logger['error'](_0x26e5('0x27'),_0xced2e9['message'],_0xac2e0e);_0x37bbfc(_0x3e01e5[_0x26e5('0x18')](0x1f4,_0xced2e9[_0x26e5('0x1a')]));});});};exports[_0x26e5('0x28')]=function(_0x3e4597){var _0x1fd3d=this;return new Promise(function(_0x1c135c,_0x4634b2){var _0x4e44cc={'body':_0x3e4597[_0x26e5('0x29')],'channel':_0x26e5('0x2a')};var _0x1be715=_[_0x26e5('0x2b')](_[_0x26e5('0x2c')](db[_0x26e5('0x2d')]['rawAttributes']),[_0x26e5('0x2e'),_0x26e5('0x2f'),_0x26e5('0x30'),_0x26e5('0x31')]);var _0x4fbb74=![];if(_0x3e4597['body']['id']){delete _0x3e4597[_0x26e5('0x29')]['id'];}if(_[_0x26e5('0x32')](_0x3e4597[_0x26e5('0x29')][_0x26e5('0x33')])){return _0x4634b2(_0x1fd3d[_0x26e5('0x18')](0x1f4,'from\x20is\x20mandatory'));}if(_[_0x26e5('0x32')](_0x3e4597['body'][_0x26e5('0x29')])||_0x3e4597[_0x26e5('0x29')]['body']===''){return _0x4634b2(_0x1fd3d[_0x26e5('0x18')](0x1f4,_0x26e5('0x34')));}if(_[_0x26e5('0x32')](_0x3e4597['body'][_0x26e5('0x35')])){return _0x4634b2(_0x1fd3d[_0x26e5('0x18')](0x1f4,'mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x1be715));}if(!_[_0x26e5('0x36')](_0x1be715,_0x3e4597[_0x26e5('0x29')][_0x26e5('0x35')])){return _0x4634b2(_0x1fd3d[_0x26e5('0x18')](0x1f4,_0x26e5('0x37')+_0x1be715));}var _0xbd4160={};_0xbd4160[_0x3e4597[_0x26e5('0x29')][_0x26e5('0x35')]]=_0x3e4597[_0x26e5('0x29')][_0x26e5('0x33')];return db[_0x26e5('0x1d')][_0x26e5('0x24')]({'where':{'id':_0x3e4597[_0x26e5('0x38')]['id']},'include':[{'model':db['CmList'],'as':_0x26e5('0x39'),'include':[{'model':db[_0x26e5('0x2d')],'as':_0x26e5('0x3a'),'where':_0xbd4160,'limit':0x1,'order':[[_0x26e5('0x2f'),_0x26e5('0x3b')]]}]},{'model':db[_0x26e5('0x3c')],'as':'Applications'},{'model':db[_0x26e5('0x3d')],'as':'Smtp'}]})[_0x26e5('0x12')](function(_0x1ecf6e){if(_0x1ecf6e&&_0x1ecf6e[_0x26e5('0x39')]){var _0x259394=_0x1ecf6e[_0x26e5('0x3e')]({'plain':!![]});_0x4e44cc[_0x26e5('0x38')]=_[_0x26e5('0x3f')](_0x259394,[_0x26e5('0x40'),'List']);_0x4e44cc[_0x26e5('0x41')]=_0x259394[_0x26e5('0x40')];_0x4e44cc['list']=_0x259394['List'];_0x4e44cc[_0x26e5('0x41')]=_[_0x26e5('0x42')](_0x4e44cc[_0x26e5('0x41')],['priority'],['asc']);if(_0x4e44cc[_0x26e5('0x38')]&&_0x4e44cc[_0x26e5('0x38')][_0x26e5('0x43')]){_0x4e44cc[_0x26e5('0x41')][_0x26e5('0x44')]({'id':0x0,'priority':_0x4e44cc[_0x26e5('0x41')]['length']+0x1,'app':_0x26e5('0x45'),'appdata':'autoclose','interval':_0x26e5('0x46')});}if(_0x4e44cc['account'][_0x26e5('0x40')]){delete _0x4e44cc['account'][_0x26e5('0x40')];}if(_0x4e44cc[_0x26e5('0x38')][_0x26e5('0x39')]){delete _0x4e44cc['account'][_0x26e5('0x39')];}if(_0x259394[_0x26e5('0x39')][_0x26e5('0x3a')][_0x26e5('0x47')]){return _0x259394[_0x26e5('0x39')]['Contacts'][0x0];}var _0x172096=_[_0x26e5('0xe')](_0x3e4597['body'],{'firstName':_0x3e4597[_0x26e5('0x29')][_0x26e5('0x33')],'ListId':_0x259394[_0x26e5('0x31')]});_0x172096[_0x3e4597[_0x26e5('0x29')][_0x26e5('0x35')]]=_0x3e4597[_0x26e5('0x29')][_0x26e5('0x33')];return db[_0x26e5('0x2d')][_0x26e5('0x48')](_0x172096);}else{throw new Error(_0x26e5('0x49'));}})[_0x26e5('0x12')](function(_0x27923c){_0x4e44cc[_0x26e5('0x4a')]=_0x27923c;if(_0x27923c){if(!_0x3e4597[_0x26e5('0x29')][_0x26e5('0x1a')][_0x26e5('0x4b')]){_0x3e4597[_0x26e5('0x29')][_0x26e5('0x1a')][_0x26e5('0x4b')]=rs[_0x26e5('0x4c')]()+'\x20'+_0x3e4597[_0x26e5('0x29')][_0x26e5('0x1a')][_0x26e5('0x33')];}var _0x42d430={'ContactId':_0x27923c['id'],'MailAccountId':_0x3e4597[_0x26e5('0x38')]['id'],'inReplyTo':_0x3e4597[_0x26e5('0x29')][_0x26e5('0x1a')][_0x26e5('0x4b')],'to':_0x3e4597['body'][_0x26e5('0x1a')][_0x26e5('0x33')],'cc':_0x3e4597['body']['message']['cc'],'subject':_0x3e4597[_0x26e5('0x29')][_0x26e5('0x1a')][_0x26e5('0x4d')],'attach':_0x3e4597[_0x26e5('0x29')]['message']['attach'],'lastMsgAt':moment()['format'](_0x26e5('0x4e')),'lastMsgDirection':'in'};return db['MailInteraction']['find']({'where':{'closed':![],'MailAccountId':_0x3e4597[_0x26e5('0x38')]['id']},'include':[{'model':db['MailMessage'],'as':_0x26e5('0x4f'),'attributes':[_0x26e5('0x4b')],'where':{'messageId':_0x3e4597['body']['message'][_0x26e5('0x50')]}}]})[_0x26e5('0x12')](function(_0x32cb47){if(_0x32cb47){return[_0x32cb47,![]];}return db['MailInteraction'][_0x26e5('0x48')](_0x42d430)[_0x26e5('0x12')](function(_0x615ed3){return[_0x615ed3,!![]];});});}else{throw new Error(_0x26e5('0x51'));}})[_0x26e5('0x52')](function(_0x1bbbbe,_0x243273){if(_0x1bbbbe){_0x4fbb74=_0x243273;if(!_0x243273){return _0x1bbbbe[_0x26e5('0x53')]({'inReplyTo':_0x3e4597[_0x26e5('0x29')][_0x26e5('0x1a')][_0x26e5('0x4b')],'to':_0x3e4597[_0x26e5('0x29')][_0x26e5('0x1a')]['from'],'cc':_0x3e4597[_0x26e5('0x29')][_0x26e5('0x1a')]['cc'],'subject':_0x3e4597['body'][_0x26e5('0x1a')]['subject'],'attach':_0x1bbbbe['attach']?_0x1bbbbe[_0x26e5('0x54')]:_0x3e4597[_0x26e5('0x29')][_0x26e5('0x1a')]['attach'],'substatus':null,'substatusAt':moment()[_0x26e5('0x55')](_0x26e5('0x4e')),'lastMsgAt':moment()[_0x26e5('0x55')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in'});}else{return _0x1bbbbe;}}})['then'](function(_0x5dda0e){_0x4e44cc[_0x26e5('0x56')]=_0x5dda0e['get']({'plain':!![]});_0x4e44cc[_0x26e5('0x56')][_0x26e5('0x57')]=_0x4fbb74;return db[_0x26e5('0x58')][_0x26e5('0x48')]({'body':_0x3e4597['body']['body'],'MailAccountId':_0x3e4597[_0x26e5('0x38')]['id'],'MailInteractionId':_0x5dda0e['id'],'direction':'in','ContactId':_0x4e44cc[_0x26e5('0x4a')]['id'],'messageId':_0x3e4597[_0x26e5('0x29')][_0x26e5('0x1a')]['messageId'],'from':_0x3e4597[_0x26e5('0x29')][_0x26e5('0x1a')][_0x26e5('0x33')],'to':_0x3e4597['body'][_0x26e5('0x1a')]['to'],'cc':_0x3e4597['body']['message']['cc'],'subject':_0x3e4597[_0x26e5('0x29')]['message'][_0x26e5('0x4d')],'attach':_0x3e4597[_0x26e5('0x29')][_0x26e5('0x1a')][_0x26e5('0x54')],'Attachments':_0x3e4597[_0x26e5('0x29')][_0x26e5('0x1a')][_0x26e5('0x59')],'originTo':_0x3e4597[_0x26e5('0x29')][_0x26e5('0x1a')][_0x26e5('0x5a')],'originCc':_0x3e4597[_0x26e5('0x29')][_0x26e5('0x1a')][_0x26e5('0x5b')],'bcc':_0x3e4597[_0x26e5('0x29')][_0x26e5('0x1a')][_0x26e5('0x5c')],'ChatWebsiteId':_0x3e4597[_0x26e5('0x29')][_0x26e5('0x1a')][_0x26e5('0x5d')]||null,'originChannel':_0x3e4597[_0x26e5('0x29')][_0x26e5('0x1a')]['originChannel']||_0x26e5('0x5e'),'ChatOfflineMessageId':_0x3e4597['body']['message']['ChatOfflineMessageId']||null},{'include':[{'model':db[_0x26e5('0x5f')],'as':'Attachments'}]});})[_0x26e5('0x12')](function(_0x9bffa3){_0x4e44cc[_0x26e5('0x1a')]=_0x9bffa3;if(_0x4e44cc[_0x26e5('0x56')][_0x26e5('0x60')]){return db[_0x26e5('0x61')][_0x26e5('0x24')]({'attributes':['id',_0x26e5('0x62')],'where':{'id':_0x4e44cc[_0x26e5('0x56')]['UserId']}})['then'](function(_0x102684){if(_0x102684){_0x4e44cc[_0x26e5('0x41')][_0x26e5('0x63')]({'id':0x0,'priority':0x0,'app':_0x26e5('0x64'),'appdata':_0x102684[_0x26e5('0x62')]+','+(_0x4e44cc[_0x26e5('0x38')][_0x26e5('0x65')]||0xa),'interval':_0x26e5('0x46')});}return respondWithRpcPromise(_0x26e5('0x66'),_0x26e5('0x67'),_0x4e44cc);});}return respondWithRpcPromise(_0x26e5('0x66'),_0x26e5('0x67'),_0x4e44cc);})[_0x26e5('0x12')](function(_0x22a6d5){_0x1c135c(_0x22a6d5);})[_0x26e5('0x1b')](function(_0x197465){_0x4634b2(_0x1fd3d[_0x26e5('0x18')](0x1f4,_0x197465[_0x26e5('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index ae6b3a6..d8808b3 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 _0x594e=['register','length','remove','emit'];(function(_0x5c5db0,_0x3989f0){var _0x379327=function(_0x22ffce){while(--_0x22ffce){_0x5c5db0['push'](_0x5c5db0['shift']());}};_0x379327(++_0x3989f0);}(_0x594e,0x11e));var _0xe594=function(_0x1abcc7,_0x164980){_0x1abcc7=_0x1abcc7-0x0;var _0x33725d=_0x594e[_0x1abcc7];return _0x33725d;};'use strict';var MailAccountEvents=require('./mailAccount.events');var events=['save',_0xe594('0x0'),'update'];function createListener(_0x1db7be,_0x59589f){return function(_0x44b2ad){_0x59589f[_0xe594('0x1')](_0x1db7be,_0x44b2ad);};}function removeListener(_0x13df98,_0x25f947){return function(){MailAccountEvents['removeListener'](_0x13df98,_0x25f947);};}exports[_0xe594('0x2')]=function(_0x48c301){for(var _0x4b17bb=0x0,_0x10d35c=events[_0xe594('0x3')];_0x4b17bb<_0x10d35c;_0x4b17bb++){var _0x4c6875=events[_0x4b17bb];var _0x198d88=createListener('mailAccount:'+_0x4c6875,_0x48c301);MailAccountEvents['on'](_0x4c6875,_0x198d88);}}; \ No newline at end of file +var _0x4a47=['./mailAccount.events','save','remove','update','emit','register','mailAccount:'];(function(_0x356551,_0x347656){var _0x1e6756=function(_0x41677c){while(--_0x41677c){_0x356551['push'](_0x356551['shift']());}};_0x1e6756(++_0x347656);}(_0x4a47,0x15e));var _0x74a4=function(_0x50667a,_0x86eb28){_0x50667a=_0x50667a-0x0;var _0x4987e5=_0x4a47[_0x50667a];return _0x4987e5;};'use strict';var MailAccountEvents=require(_0x74a4('0x0'));var events=[_0x74a4('0x1'),_0x74a4('0x2'),_0x74a4('0x3')];function createListener(_0x9d9c20,_0x32864d){return function(_0xc53a39){_0x32864d[_0x74a4('0x4')](_0x9d9c20,_0xc53a39);};}function removeListener(_0x3ff3b5,_0x29fbc4){return function(){MailAccountEvents['removeListener'](_0x3ff3b5,_0x29fbc4);};}exports[_0x74a4('0x5')]=function(_0x2827a7){for(var _0x28d072=0x0,_0x2a73c4=events['length'];_0x28d072<_0x2a73c4;_0x28d072++){var _0x3ab129=events[_0x28d072];var _0x599bb9=createListener(_0x74a4('0x6')+_0x3ab129,_0x2827a7);MailAccountEvents['on'](_0x3ab129,_0x599bb9);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index 3f5faad..0241aee 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 _0xca44=['multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','put','isAuthenticated','update','delete'];(function(_0x424a14,_0x2e6755){var _0x1c7420=function(_0x5f1b51){while(--_0x5f1b51){_0x424a14['push'](_0x424a14['shift']());}};_0x1c7420(++_0x2e6755);}(_0xca44,0xfc));var _0x4ca4=function(_0xa62a5,_0x3dd20e){_0xa62a5=_0xa62a5-0x0;var _0x5af351=_0xca44[_0xa62a5];return _0x5af351;};'use strict';var multer=require(_0x4ca4('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x4ca4('0x1'));var express=require(_0x4ca4('0x2'));var router=express[_0x4ca4('0x3')]();var fs_extra=require(_0x4ca4('0x4'));var auth=require(_0x4ca4('0x5'));var interaction=require(_0x4ca4('0x6'));var config=require(_0x4ca4('0x7'));var controller=require('./mailApplication.controller');router[_0x4ca4('0x8')](_0x4ca4('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x4ca4('0xa')](_0x4ca4('0x9'),auth[_0x4ca4('0xb')](),controller[_0x4ca4('0xc')]);router[_0x4ca4('0xd')](_0x4ca4('0x9'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x852c=['exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','./mailApplication.controller','get','isAuthenticated','show','put','/:id','delete','destroy'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x852c,0xd1));var _0xc852=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x852c[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xc852('0x0'));var util=require(_0xc852('0x1'));var path=require(_0xc852('0x2'));var timeout=require(_0xc852('0x3'));var express=require(_0xc852('0x4'));var router=express['Router']();var fs_extra=require(_0xc852('0x5'));var auth=require(_0xc852('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xc852('0x7'));router[_0xc852('0x8')]('/:id',auth[_0xc852('0x9')](),controller[_0xc852('0xa')]);router[_0xc852('0xb')](_0xc852('0xc'),auth[_0xc852('0x9')](),controller['update']);router[_0xc852('0xd')]('/:id',auth['isAuthenticated'](),controller[_0xc852('0xe')]);module[_0xc852('0xf')]=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index cb76187..57b1e9f 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 _0x930e=['sequelize','INTEGER','noop','TEXT','STRING','*,*,*,*'];(function(_0x9d950a,_0x1adee4){var _0x11e6b7=function(_0x2c0f0c){while(--_0x2c0f0c){_0x9d950a['push'](_0x9d950a['shift']());}};_0x11e6b7(++_0x1adee4);}(_0x930e,0xcc));var _0xe930=function(_0x3be3b9,_0x44f144){_0x3be3b9=_0x3be3b9-0x0;var _0x275bd8=_0x930e[_0x3be3b9];return _0x275bd8;};'use strict';var Sequelize=require(_0xe930('0x0'));module['exports']={'priority':{'type':Sequelize[_0xe930('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xe930('0x2')},'appdata':{'type':Sequelize[_0xe930('0x3')]()},'description':{'type':Sequelize[_0xe930('0x4')]},'interval':{'type':Sequelize[_0xe930('0x4')],'defaultValue':_0xe930('0x5')}}; \ No newline at end of file +var _0x1e30=['*,*,*,*','sequelize','exports','INTEGER','STRING','noop','TEXT'];(function(_0xfadc1a,_0xc6a189){var _0x1be3a4=function(_0x1a9107){while(--_0x1a9107){_0xfadc1a['push'](_0xfadc1a['shift']());}};_0x1be3a4(++_0xc6a189);}(_0x1e30,0x8d));var _0x01e3=function(_0x4bd11d,_0xee69b8){_0x4bd11d=_0x4bd11d-0x0;var _0x328238=_0x1e30[_0x4bd11d];return _0x328238;};'use strict';var Sequelize=require(_0x01e3('0x0'));module[_0x01e3('0x1')]={'priority':{'type':Sequelize[_0x01e3('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x01e3('0x3')],'allowNull':![],'defaultValue':_0x01e3('0x4')},'appdata':{'type':Sequelize[_0x01e3('0x5')]()},'description':{'type':Sequelize[_0x01e3('0x3')]},'interval':{'type':Sequelize[_0x01e3('0x3')],'defaultValue':_0x01e3('0x6')}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index 6d9bda2..fc44f3d 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 _0xac4a=['Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','show','params','model','keys','MailApplication','query','filters','intersection','fields','attributes','length','includeAll','include','merge','options','catch','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','ejs','lodash','crypto','jsforce','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set'];(function(_0x1cda79,_0x22d5dd){var _0x253703=function(_0x44617b){while(--_0x44617b){_0x1cda79['push'](_0x1cda79['shift']());}};_0x253703(++_0x22d5dd);}(_0xac4a,0x13f));var _0xaac4=function(_0x1edebe,_0x42be86){_0x1edebe=_0x1edebe-0x0;var _0xc186a9=_0xac4a[_0x1edebe];return _0xc186a9;};'use strict';var emlformat=require(_0xaac4('0x0'));var rimraf=require(_0xaac4('0x1'));var zipdir=require(_0xaac4('0x2'));var jsonpatch=require(_0xaac4('0x3'));var rp=require(_0xaac4('0x4'));var moment=require(_0xaac4('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xaac4('0x6'));var path=require(_0xaac4('0x7'));var sox=require(_0xaac4('0x8'));var csv=require('to-csv');var ejs=require(_0xaac4('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xaac4('0xa'));var squel=require('squel');var crypto=require(_0xaac4('0xb'));var jsforce=require(_0xaac4('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xaac4('0xd'));var Papa=require('papaparse');var Redis=require(_0xaac4('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xaac4('0xf'));var hardwareService=require(_0xaac4('0x10'));var logger=require(_0xaac4('0x11'))(_0xaac4('0x12'));var utils=require(_0xaac4('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xaac4('0x14'))['db'];function respondWithStatusCode(_0x2e2d02,_0x45e512){_0x45e512=_0x45e512||0xcc;return function(_0x5a4801){if(_0x5a4801){return _0x2e2d02[_0xaac4('0x15')](_0x45e512);}return _0x2e2d02[_0xaac4('0x16')](_0x45e512)['end']();};}function respondWithResult(_0xf06b1d,_0x2b20d0){_0x2b20d0=_0x2b20d0||0xc8;return function(_0x46698d){if(_0x46698d){return _0xf06b1d[_0xaac4('0x16')](_0x2b20d0)[_0xaac4('0x17')](_0x46698d);}};}function respondWithFilteredResult(_0x2fbeb7,_0x31b7e5){return function(_0x1df9ae){if(_0x1df9ae){var _0x233278=typeof _0x31b7e5[_0xaac4('0x18')]===_0xaac4('0x19')&&typeof _0x31b7e5[_0xaac4('0x1a')]===_0xaac4('0x19');var _0x52686a=_0x1df9ae[_0xaac4('0x1b')];var _0x52085a=_0x233278?0x0:_0x31b7e5[_0xaac4('0x18')];var _0x5b6fd6=_0x233278?_0x1df9ae[_0xaac4('0x1b')]:_0x31b7e5[_0xaac4('0x18')]+_0x31b7e5[_0xaac4('0x1a')];var _0x271bcb;if(_0x5b6fd6>=_0x52686a){_0x5b6fd6=_0x52686a;_0x271bcb=0xc8;}else{_0x271bcb=0xce;}_0x2fbeb7[_0xaac4('0x16')](_0x271bcb);return _0x2fbeb7[_0xaac4('0x1c')](_0xaac4('0x1d'),_0x52085a+'-'+_0x5b6fd6+'/'+_0x52686a)[_0xaac4('0x17')](_0x1df9ae);}return null;};}function patchUpdates(_0x4166ee){return function(_0x480fb0){try{jsonpatch[_0xaac4('0x1e')](_0x480fb0,_0x4166ee,!![]);}catch(_0x4e1e89){return BPromise[_0xaac4('0x1f')](_0x4e1e89);}return _0x480fb0[_0xaac4('0x20')]();};}function saveUpdates(_0x43625c,_0x477b77){return function(_0x17140f){if(_0x17140f){return _0x17140f[_0xaac4('0x21')](_0x43625c)['then'](function(_0x43ccdc){return _0x43ccdc;});}return null;};}function removeEntity(_0x27a84d,_0x174860){return function(_0x4f10ec){if(_0x4f10ec){return _0x4f10ec[_0xaac4('0x22')]()[_0xaac4('0x23')](function(){_0x27a84d[_0xaac4('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x24186b,_0x4f1b65){return function(_0x54203b){if(!_0x54203b){_0x24186b['sendStatus'](0x194);}return _0x54203b;};}function handleError(_0x5a0bb3,_0x22d5a6){_0x22d5a6=_0x22d5a6||0x1f4;return function(_0x17d25f){logger[_0xaac4('0x24')](_0x17d25f[_0xaac4('0x25')]);if(_0x17d25f[_0xaac4('0x26')]){delete _0x17d25f[_0xaac4('0x26')];}_0x5a0bb3[_0xaac4('0x16')](_0x22d5a6)[_0xaac4('0x27')](_0x17d25f);};}exports[_0xaac4('0x28')]=function(_0x386c9b,_0x4d0f5f){var _0x316445={'raw':!![],'where':{'id':_0x386c9b[_0xaac4('0x29')]['id']}},_0x16b33c={};_0x16b33c[_0xaac4('0x2a')]=_[_0xaac4('0x2b')](db[_0xaac4('0x2c')]['rawAttributes']);_0x16b33c[_0xaac4('0x2d')]=_['keys'](_0x386c9b[_0xaac4('0x2d')]);_0x16b33c[_0xaac4('0x2e')]=_[_0xaac4('0x2f')](_0x16b33c[_0xaac4('0x2a')],_0x16b33c['query']);_0x316445['attributes']=_['intersection'](_0x16b33c[_0xaac4('0x2a')],qs[_0xaac4('0x30')](_0x386c9b[_0xaac4('0x2d')][_0xaac4('0x30')]));_0x316445[_0xaac4('0x31')]=_0x316445[_0xaac4('0x31')][_0xaac4('0x32')]?_0x316445[_0xaac4('0x31')]:_0x16b33c[_0xaac4('0x2a')];if(_0x386c9b[_0xaac4('0x2d')][_0xaac4('0x33')]){_0x316445[_0xaac4('0x34')]=[{'all':!![]}];}_0x316445=_[_0xaac4('0x35')]({},_0x316445,_0x386c9b[_0xaac4('0x36')]);return db[_0xaac4('0x2c')]['find'](_0x316445)['then'](handleEntityNotFound(_0x4d0f5f,null))[_0xaac4('0x23')](respondWithResult(_0x4d0f5f,null))[_0xaac4('0x37')](handleError(_0x4d0f5f,null));};exports[_0xaac4('0x21')]=function(_0x5e6080,_0x191d0f){if(_0x5e6080[_0xaac4('0x38')]['id']){delete _0x5e6080[_0xaac4('0x38')]['id'];}return db[_0xaac4('0x2c')][_0xaac4('0x39')]({'where':{'id':_0x5e6080[_0xaac4('0x29')]['id']}})[_0xaac4('0x23')](handleEntityNotFound(_0x191d0f,null))['then'](saveUpdates(_0x5e6080[_0xaac4('0x38')],null))[_0xaac4('0x23')](respondWithResult(_0x191d0f,null))[_0xaac4('0x37')](handleError(_0x191d0f,null));};exports['destroy']=function(_0x36d84a,_0x497e7b){return db['MailApplication'][_0xaac4('0x39')]({'where':{'id':_0x36d84a[_0xaac4('0x29')]['id']}})[_0xaac4('0x23')](handleEntityNotFound(_0x497e7b,null))['then'](removeEntity(_0x497e7b,null))['catch'](handleError(_0x497e7b,null));}; \ No newline at end of file +var _0x9bde=['../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','then','destroy','error','name','send','show','model','keys','MailApplication','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','catch','update','body','params','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment'];(function(_0x5646b0,_0x453a95){var _0x295c45=function(_0x3da741){while(--_0x3da741){_0x5646b0['push'](_0x5646b0['shift']());}};_0x295c45(++_0x453a95);}(_0x9bde,0xe1));var _0xe9bd=function(_0x10f030,_0x1a714d){_0x10f030=_0x10f030-0x0;var _0x20932c=_0x9bde[_0x10f030];return _0x20932c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe9bd('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe9bd('0x1'));var rp=require('request-promise');var moment=require(_0xe9bd('0x2'));var BPromise=require(_0xe9bd('0x3'));var Mustache=require(_0xe9bd('0x4'));var util=require(_0xe9bd('0x5'));var path=require(_0xe9bd('0x6'));var sox=require(_0xe9bd('0x7'));var csv=require(_0xe9bd('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe9bd('0x9'));var _=require(_0xe9bd('0xa'));var squel=require(_0xe9bd('0xb'));var crypto=require(_0xe9bd('0xc'));var jsforce=require(_0xe9bd('0xd'));var deskjs=require(_0xe9bd('0xe'));var toCsv=require(_0xe9bd('0x8'));var querystring=require(_0xe9bd('0xf'));var Papa=require(_0xe9bd('0x10'));var Redis=require(_0xe9bd('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe9bd('0x12'));var hardwareService=require(_0xe9bd('0x13'));var logger=require(_0xe9bd('0x14'))('api');var utils=require(_0xe9bd('0x15'));var config=require(_0xe9bd('0x16'));var licenseUtil=require(_0xe9bd('0x17'));var db=require(_0xe9bd('0x18'))['db'];function respondWithStatusCode(_0x5e022a,_0x2c1d98){_0x2c1d98=_0x2c1d98||0xcc;return function(_0x4ac319){if(_0x4ac319){return _0x5e022a[_0xe9bd('0x19')](_0x2c1d98);}return _0x5e022a[_0xe9bd('0x1a')](_0x2c1d98)[_0xe9bd('0x1b')]();};}function respondWithResult(_0x51109f,_0x47ba5e){_0x47ba5e=_0x47ba5e||0xc8;return function(_0x46a95e){if(_0x46a95e){return _0x51109f[_0xe9bd('0x1a')](_0x47ba5e)[_0xe9bd('0x1c')](_0x46a95e);}};}function respondWithFilteredResult(_0x46a59b,_0x3360bd){return function(_0x389e7b){if(_0x389e7b){var _0x45a9f2=typeof _0x3360bd['offset']===_0xe9bd('0x1d')&&typeof _0x3360bd[_0xe9bd('0x1e')]===_0xe9bd('0x1d');var _0x494b27=_0x389e7b[_0xe9bd('0x1f')];var _0x3bae08=_0x45a9f2?0x0:_0x3360bd[_0xe9bd('0x20')];var _0x330733=_0x45a9f2?_0x389e7b['count']:_0x3360bd[_0xe9bd('0x20')]+_0x3360bd['limit'];var _0xc6b661;if(_0x330733>=_0x494b27){_0x330733=_0x494b27;_0xc6b661=0xc8;}else{_0xc6b661=0xce;}_0x46a59b['status'](_0xc6b661);return _0x46a59b[_0xe9bd('0x21')](_0xe9bd('0x22'),_0x3bae08+'-'+_0x330733+'/'+_0x494b27)[_0xe9bd('0x1c')](_0x389e7b);}return null;};}function patchUpdates(_0x3dda13){return function(_0x1acb82){try{jsonpatch[_0xe9bd('0x23')](_0x1acb82,_0x3dda13,!![]);}catch(_0x6593ce){return BPromise['reject'](_0x6593ce);}return _0x1acb82[_0xe9bd('0x24')]();};}function saveUpdates(_0x28cd17,_0x4ecaf5){return function(_0x37aec1){if(_0x37aec1){return _0x37aec1['update'](_0x28cd17)[_0xe9bd('0x25')](function(_0x1b9cc9){return _0x1b9cc9;});}return null;};}function removeEntity(_0x36f8c0,_0xf02209){return function(_0x5bc4bf){if(_0x5bc4bf){return _0x5bc4bf[_0xe9bd('0x26')]()[_0xe9bd('0x25')](function(){_0x36f8c0[_0xe9bd('0x1a')](0xcc)[_0xe9bd('0x1b')]();});}};}function handleEntityNotFound(_0x2641be,_0xb52d45){return function(_0x399f3c){if(!_0x399f3c){_0x2641be[_0xe9bd('0x19')](0x194);}return _0x399f3c;};}function handleError(_0x1ae889,_0x5987af){_0x5987af=_0x5987af||0x1f4;return function(_0x3c211a){logger[_0xe9bd('0x27')](_0x3c211a['stack']);if(_0x3c211a[_0xe9bd('0x28')]){delete _0x3c211a[_0xe9bd('0x28')];}_0x1ae889[_0xe9bd('0x1a')](_0x5987af)[_0xe9bd('0x29')](_0x3c211a);};}exports[_0xe9bd('0x2a')]=function(_0x183601,_0x519f48){var _0x5b7f1d={'raw':!![],'where':{'id':_0x183601['params']['id']}},_0x1de54c={};_0x1de54c[_0xe9bd('0x2b')]=_[_0xe9bd('0x2c')](db[_0xe9bd('0x2d')][_0xe9bd('0x2e')]);_0x1de54c[_0xe9bd('0x2f')]=_['keys'](_0x183601['query']);_0x1de54c[_0xe9bd('0x30')]=_[_0xe9bd('0x31')](_0x1de54c[_0xe9bd('0x2b')],_0x1de54c[_0xe9bd('0x2f')]);_0x5b7f1d[_0xe9bd('0x32')]=_[_0xe9bd('0x31')](_0x1de54c[_0xe9bd('0x2b')],qs[_0xe9bd('0x33')](_0x183601[_0xe9bd('0x2f')]['fields']));_0x5b7f1d[_0xe9bd('0x32')]=_0x5b7f1d[_0xe9bd('0x32')][_0xe9bd('0x34')]?_0x5b7f1d['attributes']:_0x1de54c['model'];if(_0x183601[_0xe9bd('0x2f')][_0xe9bd('0x35')]){_0x5b7f1d[_0xe9bd('0x36')]=[{'all':!![]}];}_0x5b7f1d=_[_0xe9bd('0x37')]({},_0x5b7f1d,_0x183601[_0xe9bd('0x38')]);return db[_0xe9bd('0x2d')][_0xe9bd('0x39')](_0x5b7f1d)[_0xe9bd('0x25')](handleEntityNotFound(_0x519f48,null))[_0xe9bd('0x25')](respondWithResult(_0x519f48,null))[_0xe9bd('0x3a')](handleError(_0x519f48,null));};exports[_0xe9bd('0x3b')]=function(_0x549dd1,_0x2ad46e){if(_0x549dd1[_0xe9bd('0x3c')]['id']){delete _0x549dd1[_0xe9bd('0x3c')]['id'];}return db[_0xe9bd('0x2d')][_0xe9bd('0x39')]({'where':{'id':_0x549dd1[_0xe9bd('0x3d')]['id']}})['then'](handleEntityNotFound(_0x2ad46e,null))[_0xe9bd('0x25')](saveUpdates(_0x549dd1[_0xe9bd('0x3c')],null))['then'](respondWithResult(_0x2ad46e,null))[_0xe9bd('0x3a')](handleError(_0x2ad46e,null));};exports[_0xe9bd('0x26')]=function(_0x4c7d47,_0x4b1da0){return db[_0xe9bd('0x2d')][_0xe9bd('0x39')]({'where':{'id':_0x4c7d47['params']['id']}})[_0xe9bd('0x25')](handleEntityNotFound(_0x4b1da0,null))[_0xe9bd('0x25')](removeEntity(_0x4b1da0,null))[_0xe9bd('0x3a')](handleError(_0x4b1da0,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index 0fea99e..0c96445 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 _0x5faf=['../../config/environment','./mailApplication.attributes','exports','define','MailApplication','mail_applications','utf8mb4','lodash','util','bluebird','path','rimraf'];(function(_0x1faf67,_0x7ad662){var _0x387342=function(_0x25dd4a){while(--_0x25dd4a){_0x1faf67['push'](_0x1faf67['shift']());}};_0x387342(++_0x7ad662);}(_0x5faf,0x97));var _0xf5fa=function(_0x5e4629,_0x21868e){_0x5e4629=_0x5e4629-0x0;var _0x2be35d=_0x5faf[_0x5e4629];return _0x2be35d;};'use strict';var _=require(_0xf5fa('0x0'));var util=require(_0xf5fa('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xf5fa('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf5fa('0x3'));var rimraf=require(_0xf5fa('0x4'));var config=require(_0xf5fa('0x5'));var attributes=require(_0xf5fa('0x6'));module[_0xf5fa('0x7')]=function(_0x38209a,_0x32080e){return _0x38209a[_0xf5fa('0x8')](_0xf5fa('0x9'),attributes,{'tableName':_0xf5fa('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf5fa('0xb'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xc198=['rimraf','../../config/environment','./mailApplication.attributes','exports','define','MailApplication','mail_applications','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','path'];(function(_0x5287f5,_0x166d8a){var _0x7e501c=function(_0x49973){while(--_0x49973){_0x5287f5['push'](_0x5287f5['shift']());}};_0x7e501c(++_0x166d8a);}(_0xc198,0xbd));var _0x8c19=function(_0x20db36,_0x38b5a9){_0x20db36=_0x20db36-0x0;var _0x960aab=_0xc198[_0x20db36];return _0x960aab;};'use strict';var _=require(_0x8c19('0x0'));var util=require('util');var logger=require(_0x8c19('0x1'))(_0x8c19('0x2'));var moment=require(_0x8c19('0x3'));var BPromise=require(_0x8c19('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8c19('0x5'));var rimraf=require(_0x8c19('0x6'));var config=require(_0x8c19('0x7'));var attributes=require(_0x8c19('0x8'));module[_0x8c19('0x9')]=function(_0x596732,_0x3f67b3){return _0x596732[_0x8c19('0xa')](_0x8c19('0xb'),attributes,{'tableName':_0x8c19('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x8c19('0xd'),'collate':_0x8c19('0xe')});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index c877f09..5f7a07d 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 _0xa36b=['stringify','error','code','message','result','catch','update','body','options','raw','where','attributes','limit','then','UpdateMailApplication','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','MailApplication,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x47a7d0,_0x4e182d){var _0xb9bd08=function(_0x588ee2){while(--_0x588ee2){_0x47a7d0['push'](_0x47a7d0['shift']());}};_0xb9bd08(++_0x4e182d);}(_0xa36b,0x107));var _0xba36=function(_0x2c0964,_0x504d2f){_0x2c0964=_0x2c0964-0x0;var _0x3c6616=_0xa36b[_0x2c0964];return _0x3c6616;};'use strict';var _=require('lodash');var util=require(_0xba36('0x0'));var moment=require(_0xba36('0x1'));var BPromise=require(_0xba36('0x2'));var rs=require(_0xba36('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xba36('0x4'))['db'];var utils=require(_0xba36('0x5'));var logger=require(_0xba36('0x6'))(_0xba36('0x7'));var config=require(_0xba36('0x8'));var jayson=require(_0xba36('0x9'));var client=jayson[_0xba36('0xa')][_0xba36('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1e24ab,_0x3fd7e5,_0x37ca59){return new BPromise(function(_0x1e1141,_0x35c752){return client['request'](_0x1e24ab,_0x37ca59)['then'](function(_0x20a2ea){logger[_0xba36('0xc')](_0xba36('0xd'),_0x3fd7e5,_0xba36('0xe'));logger[_0xba36('0xf')]('MailApplication,\x20%s,\x20%s,\x20%s',_0x3fd7e5,_0xba36('0xe'),JSON[_0xba36('0x10')](_0x20a2ea));if(_0x20a2ea[_0xba36('0x11')]){if(_0x20a2ea[_0xba36('0x11')][_0xba36('0x12')]===0x1f4){logger['error'](_0xba36('0xd'),_0x3fd7e5,_0x20a2ea[_0xba36('0x11')][_0xba36('0x13')]);return _0x35c752(_0x20a2ea[_0xba36('0x11')][_0xba36('0x13')]);}logger['error'](_0xba36('0xd'),_0x3fd7e5,_0x20a2ea[_0xba36('0x11')][_0xba36('0x13')]);return _0x1e1141(_0x20a2ea[_0xba36('0x11')][_0xba36('0x13')]);}else{logger[_0xba36('0xc')](_0xba36('0xd'),_0x3fd7e5,_0xba36('0xe'));_0x1e1141(_0x20a2ea[_0xba36('0x14')][_0xba36('0x13')]);}})[_0xba36('0x15')](function(_0x2722e0){logger[_0xba36('0x11')](_0xba36('0xd'),_0x3fd7e5,_0x2722e0);_0x35c752(_0x2722e0);});});}exports['UpdateMailApplication']=function(_0x5392c6){var _0x30ce72=this;return new Promise(function(_0x3105a9,_0x577f1b){return db['MailApplication'][_0xba36('0x16')](_0x5392c6[_0xba36('0x17')],{'raw':_0x5392c6[_0xba36('0x18')]?_0x5392c6[_0xba36('0x18')][_0xba36('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5392c6['options']?_0x5392c6['options'][_0xba36('0x1a')]||null:null,'attributes':_0x5392c6[_0xba36('0x18')]?_0x5392c6[_0xba36('0x18')][_0xba36('0x1b')]||null:null,'limit':_0x5392c6[_0xba36('0x18')]?_0x5392c6['options'][_0xba36('0x1c')]||null:null})[_0xba36('0x1d')](function(_0x20d4c1){logger[_0xba36('0xc')]('UpdateMailApplication',_0x5392c6);logger[_0xba36('0xf')](_0xba36('0x1e'),_0x5392c6,JSON['stringify'](_0x20d4c1));_0x3105a9(_0x20d4c1);})[_0xba36('0x15')](function(_0x3c107d){logger[_0xba36('0x11')](_0xba36('0x1e'),_0x3c107d[_0xba36('0x13')],_0x5392c6);_0x577f1b(_0x30ce72['error'](0x1f4,_0x3c107d['message']));});});}; \ No newline at end of file +var _0xed5f=['rpc','../../config/environment','client','request','then','info','MailApplication,\x20%s,\x20%s','debug','MailApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','UpdateMailApplication','body','raw','options','where','attributes','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x281d68,_0x318dad){var _0x30d86c=function(_0x3fe6b8){while(--_0x3fe6b8){_0x281d68['push'](_0x281d68['shift']());}};_0x30d86c(++_0x318dad);}(_0xed5f,0x106));var _0xfed5=function(_0xa28f21,_0x47d9b4){_0xa28f21=_0xa28f21-0x0;var _0x499fd7=_0xed5f[_0xa28f21];return _0x499fd7;};'use strict';var _=require(_0xfed5('0x0'));var util=require(_0xfed5('0x1'));var moment=require(_0xfed5('0x2'));var BPromise=require('bluebird');var rs=require(_0xfed5('0x3'));var fs=require('fs');var Redis=require(_0xfed5('0x4'));var db=require(_0xfed5('0x5'))['db'];var utils=require(_0xfed5('0x6'));var logger=require(_0xfed5('0x7'))(_0xfed5('0x8'));var config=require(_0xfed5('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xfed5('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x196347,_0x53225c,_0x358981){return new BPromise(function(_0x1e8abe,_0x5ae0d1){return client[_0xfed5('0xb')](_0x196347,_0x358981)[_0xfed5('0xc')](function(_0x501814){logger[_0xfed5('0xd')](_0xfed5('0xe'),_0x53225c,'request\x20sent');logger[_0xfed5('0xf')](_0xfed5('0x10'),_0x53225c,_0xfed5('0x11'),JSON[_0xfed5('0x12')](_0x501814));if(_0x501814[_0xfed5('0x13')]){if(_0x501814[_0xfed5('0x13')][_0xfed5('0x14')]===0x1f4){logger['error'](_0xfed5('0xe'),_0x53225c,_0x501814[_0xfed5('0x13')][_0xfed5('0x15')]);return _0x5ae0d1(_0x501814['error'][_0xfed5('0x15')]);}logger[_0xfed5('0x13')]('MailApplication,\x20%s,\x20%s',_0x53225c,_0x501814[_0xfed5('0x13')][_0xfed5('0x15')]);return _0x1e8abe(_0x501814['error'][_0xfed5('0x15')]);}else{logger[_0xfed5('0xd')](_0xfed5('0xe'),_0x53225c,'request\x20sent');_0x1e8abe(_0x501814[_0xfed5('0x16')]['message']);}})['catch'](function(_0x13f99f){logger[_0xfed5('0x13')]('MailApplication,\x20%s,\x20%s',_0x53225c,_0x13f99f);_0x5ae0d1(_0x13f99f);});});}exports[_0xfed5('0x17')]=function(_0x50adad){var _0x3bf01f=this;return new Promise(function(_0x95ccae,_0x5f732d){return db['MailApplication']['update'](_0x50adad[_0xfed5('0x18')],{'raw':_0x50adad['options']?_0x50adad['options'][_0xfed5('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x50adad[_0xfed5('0x1a')]?_0x50adad['options'][_0xfed5('0x1b')]||null:null,'attributes':_0x50adad[_0xfed5('0x1a')]?_0x50adad[_0xfed5('0x1a')][_0xfed5('0x1c')]||null:null,'limit':_0x50adad['options']?_0x50adad['options']['limit']||null:null})[_0xfed5('0xc')](function(_0xc172cd){logger[_0xfed5('0xd')](_0xfed5('0x17'),_0x50adad);logger[_0xfed5('0xf')](_0xfed5('0x17'),_0x50adad,JSON[_0xfed5('0x12')](_0xc172cd));_0x95ccae(_0xc172cd);})[_0xfed5('0x1d')](function(_0x5372fa){logger[_0xfed5('0x13')](_0xfed5('0x17'),_0x5372fa[_0xfed5('0x15')],_0x50adad);_0x5f732d(_0x3bf01f[_0xfed5('0x13')](0x1f4,_0x5372fa[_0xfed5('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index 8c5011a..10e98dd 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 _0x97d4=['get','isAuthenticated','index','/describe','/:id','show','/:id/messages','getMessages','/:id/download','download','create','post','addMessage','/:id/tags','tracked','mail','mailinteraction:addtags','addTags','put','update','mailinteraction:destroy','destroy','delete','removeTags','express','Router','../../components/auth/service','./mailInteraction.controller'];(function(_0x46ba9c,_0x144189){var _0x36801d=function(_0x3561ba){while(--_0x3561ba){_0x46ba9c['push'](_0x46ba9c['shift']());}};_0x36801d(++_0x144189);}(_0x97d4,0x1d8));var _0x497d=function(_0x53b972,_0x288c5c){_0x53b972=_0x53b972-0x0;var _0x502d0a=_0x97d4[_0x53b972];return _0x502d0a;};'use strict';var express=require(_0x497d('0x0'));var router=express[_0x497d('0x1')]();var auth=require(_0x497d('0x2'));var interaction=require('../../components/interaction/service');var controller=require(_0x497d('0x3'));router[_0x497d('0x4')]('/',auth[_0x497d('0x5')](),controller[_0x497d('0x6')]);router[_0x497d('0x4')](_0x497d('0x7'),auth[_0x497d('0x5')](),controller['describe']);router[_0x497d('0x4')](_0x497d('0x8'),auth[_0x497d('0x5')](),controller[_0x497d('0x9')]);router[_0x497d('0x4')](_0x497d('0xa'),auth['isAuthenticated'](),controller[_0x497d('0xb')]);router[_0x497d('0x4')](_0x497d('0xc'),auth[_0x497d('0x5')](),controller[_0x497d('0xd')]);router['post']('/',auth[_0x497d('0x5')](),controller[_0x497d('0xe')]);router[_0x497d('0xf')](_0x497d('0xa'),auth[_0x497d('0x5')](),controller[_0x497d('0x10')]);router[_0x497d('0xf')](_0x497d('0x11'),auth[_0x497d('0x5')](),interaction[_0x497d('0x12')](_0x497d('0x13'),_0x497d('0x14')),controller[_0x497d('0x15')]);router[_0x497d('0x16')](_0x497d('0x8'),auth[_0x497d('0x5')](),interaction[_0x497d('0x12')](_0x497d('0x13'),'mailinteraction:update'),controller[_0x497d('0x17')]);router['delete'](_0x497d('0x8'),auth[_0x497d('0x5')](),interaction[_0x497d('0x12')](_0x497d('0x13'),_0x497d('0x18')),controller[_0x497d('0x19')]);router[_0x497d('0x1a')](_0x497d('0x11'),auth[_0x497d('0x5')](),controller[_0x497d('0x1b')]);module['exports']=router; \ No newline at end of file +var _0xdcc6=['Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','mail','mailinteraction:addtags','put','mailinteraction:update','update','delete','express'];(function(_0x2b9b7f,_0x4d47df){var _0x4ed19a=function(_0x72b5ff){while(--_0x72b5ff){_0x2b9b7f['push'](_0x2b9b7f['shift']());}};_0x4ed19a(++_0x4d47df);}(_0xdcc6,0x103));var _0x6dcc=function(_0x282b0d,_0x482407){_0x282b0d=_0x282b0d-0x0;var _0x5c7755=_0xdcc6[_0x282b0d];return _0x5c7755;};'use strict';var express=require(_0x6dcc('0x0'));var router=express[_0x6dcc('0x1')]();var auth=require(_0x6dcc('0x2'));var interaction=require(_0x6dcc('0x3'));var controller=require('./mailInteraction.controller');router[_0x6dcc('0x4')]('/',auth[_0x6dcc('0x5')](),controller[_0x6dcc('0x6')]);router[_0x6dcc('0x4')](_0x6dcc('0x7'),auth[_0x6dcc('0x5')](),controller[_0x6dcc('0x8')]);router[_0x6dcc('0x4')](_0x6dcc('0x9'),auth['isAuthenticated'](),controller[_0x6dcc('0xa')]);router[_0x6dcc('0x4')](_0x6dcc('0xb'),auth[_0x6dcc('0x5')](),controller[_0x6dcc('0xc')]);router['get'](_0x6dcc('0xd'),auth[_0x6dcc('0x5')](),controller[_0x6dcc('0xe')]);router[_0x6dcc('0xf')]('/',auth[_0x6dcc('0x5')](),controller[_0x6dcc('0x10')]);router[_0x6dcc('0xf')](_0x6dcc('0xb'),auth[_0x6dcc('0x5')](),controller[_0x6dcc('0x11')]);router[_0x6dcc('0xf')](_0x6dcc('0x12'),auth['isAuthenticated'](),interaction[_0x6dcc('0x13')](_0x6dcc('0x14'),_0x6dcc('0x15')),controller['addTags']);router[_0x6dcc('0x16')](_0x6dcc('0x9'),auth['isAuthenticated'](),interaction[_0x6dcc('0x13')](_0x6dcc('0x14'),_0x6dcc('0x17')),controller[_0x6dcc('0x18')]);router[_0x6dcc('0x19')](_0x6dcc('0x9'),auth[_0x6dcc('0x5')](),interaction[_0x6dcc('0x13')](_0x6dcc('0x14'),'mailinteraction:destroy'),controller['destroy']);router[_0x6dcc('0x19')](_0x6dcc('0x12'),auth[_0x6dcc('0x5')](),controller['removeTags']);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 a93c146..ef47225 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 _0xa354=['ENUM','out','iconv','exports','BOOLEAN','DATE','STRING','TEXT','long'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa354,0x146));var _0x4a35=function(_0x2e64b5,_0xe7ae4b){_0x2e64b5=_0x2e64b5-0x0;var _0x233e67=_0xa354[_0x2e64b5];return _0x233e67;};'use strict';var Sequelize=require('sequelize');var iconv=require(_0x4a35('0x0'));module[_0x4a35('0x1')]={'closed':{'type':Sequelize[_0x4a35('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x4a35('0x3')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x4a35('0x4')]},'thirdDisposition':{'type':Sequelize[_0x4a35('0x4')]},'note':{'type':Sequelize[_0x4a35('0x4')]},'inReplyTo':{'type':Sequelize['STRING'](0x1fe)},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x4a35('0x5')](_0x4a35('0x6'))},'subject':{'type':Sequelize[_0x4a35('0x5')]()},'attach':{'type':Sequelize[_0x4a35('0x2')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x4a35('0x3')]},'substatus':{'type':Sequelize['STRING'](0x3c)},'substatusAt':{'type':Sequelize[_0x4a35('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x4a35('0x7')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x4a35('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x4a35('0x7')]('in',_0x4a35('0x8')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x4a35('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x0d56=['out','BOOLEAN','sequelize','iconv','DATE','STRING','TEXT','long','ENUM'];(function(_0x541e4f,_0x48d7fa){var _0x5c1711=function(_0x10fdb1){while(--_0x10fdb1){_0x541e4f['push'](_0x541e4f['shift']());}};_0x5c1711(++_0x48d7fa);}(_0x0d56,0x197));var _0x60d5=function(_0x2bc897,_0x2de371){_0x2bc897=_0x2bc897-0x0;var _0xf70f9=_0x0d56[_0x2bc897];return _0xf70f9;};'use strict';var Sequelize=require(_0x60d5('0x0'));var iconv=require(_0x60d5('0x1'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x60d5('0x2')]},'disposition':{'type':Sequelize[_0x60d5('0x3')]},'secondDisposition':{'type':Sequelize[_0x60d5('0x3')]},'thirdDisposition':{'type':Sequelize[_0x60d5('0x3')]},'note':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0x60d5('0x3')](0x1fe)},'to':{'type':Sequelize[_0x60d5('0x3')]},'cc':{'type':Sequelize[_0x60d5('0x4')](_0x60d5('0x5'))},'subject':{'type':Sequelize['TEXT']()},'attach':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'read1stAt':{'type':Sequelize['DATE']},'substatus':{'type':Sequelize['STRING'](0x3c)},'substatusAt':{'type':Sequelize[_0x60d5('0x2')]},'firstMsgDirection':{'type':Sequelize[_0x60d5('0x6')]('in',_0x60d5('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x60d5('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x60d5('0x6')]('in',_0x60d5('0x7')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x60d5('0x8')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index 16ab578..1da2541 100644 --- a/server/api/mailInteraction/mailInteraction.controller.js +++ b/server/api/mailInteraction/mailInteraction.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.MailInteractionId\x20IN\x20?','groupBy','MailInteractionId','Setting','findOne','enableEmailPreview','show','params','rawAttributes','includeAll','include','merge','options','create','body','describe','addMessage','ids','omit','getMessages','nolimit','pick','$gte','format','YYYY-MM-DD\x20HH:mm:ss','findAll','inlineCss','rows','spread','emit','mailInteractionTags:save','removeTags','download','unix','join','server','tmp','root','files','attachments','transcript-%d-%s.zip','Attachment','Attachments','Messages','subject','get','each','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','bcc','Bcc','basename','existsSync','build','message%d.eml','unlinkSync','eml-format','zip-dir','moment','bluebird','path','lodash','squel','juice','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','update','destroy','then','error','stack','name','send','fullname','TagIds','Tags','split','forEach','push','MailMessage','out','-id','trimStart','plainBody','catch','index','map','MailInteraction','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','field','color','tools_tags','u.id','ui.MailInteractionId','from','user_has_mail_interactions','left_join','users','u.id\x20=\x20ui.UserId','select','mail_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','mail_accounts','a.id\x20=\x20i.MailAccountId','mail_messages','me.MailInteractionId\x20=\x20i.id','it.MailInteractionId\x20=\x20i.id','expr','search','parseSearch','conditions','length','find','unreadMessages','value','having','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','type','text','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','start','some','compact','isEmpty','i.MailAccountId\x20IN\x20?','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','isEmail','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','SELECT','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','t.id\x20IN\x20?','resolve','MailAccountId','i.MailAccountId\x20IS\x20NOT\x20NULL','role','getMailAccounts','i.MailAccountId\x20IS\x20NULL','agent','toString','sequelize','keyBy','a.key','Account.key','Account.mandatoryDisposition','CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20(\x27%\x27\x20+\x20a.email\x20+\x20\x27%\x27)\x20THEN\x20SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201)\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.createdAt','i.updatedAt','i.closed','i.attach','i.lastMsgAt','i.subject','i.disposition','i.secondDisposition','i.thirdDisposition','i.ContactId','i.MailAccountId','Contact.firstName','c.email'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0xb10b,0x12a));var _0xbb10=function(_0x5c3fac,_0x5f0267){_0x5c3fac=_0x5c3fac-0x0;var _0x382099=_0xb10b[_0x5c3fac];return _0x382099;};'use strict';var emlformat=require(_0xbb10('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbb10('0x1'));var moment=require(_0xbb10('0x2'));var BPromise=require(_0xbb10('0x3'));var util=require('util');var path=require(_0xbb10('0x4'));var fs=require('fs');var _=require(_0xbb10('0x5'));var squel=require(_0xbb10('0x6'));var juice=require(_0xbb10('0x7'));var Redis=require(_0xbb10('0x8'));var qs=require(_0xbb10('0x9'));var as=require('../../components/parsers/advancedSearch');var logger=require(_0xbb10('0xa'))(_0xbb10('0xb'));var config=require('../../config/environment');var db=require(_0xbb10('0xc'))['db'];config[_0xbb10('0xd')]=_[_0xbb10('0xe')](config[_0xbb10('0xd')],{'host':_0xbb10('0xf'),'port':0x18eb});var socket=require(_0xbb10('0x10'))(new Redis(config[_0xbb10('0xd')]));require(_0xbb10('0x11'))['register'](socket);function respondWithStatusCode(_0x4e47f8,_0x20bd61){_0x20bd61=_0x20bd61||0xcc;return function(_0x118a74){if(_0x118a74){return _0x4e47f8[_0xbb10('0x12')](_0x20bd61);}return _0x4e47f8['status'](_0x20bd61)[_0xbb10('0x13')]();};}function respondWithResult(_0x5be7e0,_0x44fb19){_0x44fb19=_0x44fb19||0xc8;return function(_0x916a32){if(_0x916a32){return _0x5be7e0[_0xbb10('0x14')](_0x44fb19)[_0xbb10('0x15')](_0x916a32);}};}function respondWithFilteredResult(_0x442548,_0x147230){return function(_0x58a612){if(_0x58a612){var _0x26e021=typeof _0x147230[_0xbb10('0x16')]===_0xbb10('0x17')&&typeof _0x147230[_0xbb10('0x18')]===_0xbb10('0x17');var _0x2f2ebf=_0x58a612[_0xbb10('0x19')];var _0x36b5e8=_0x26e021?0x0:_0x147230[_0xbb10('0x16')];var _0x2b184e=_0x26e021?_0x58a612['count']:_0x147230[_0xbb10('0x16')]+_0x147230[_0xbb10('0x18')];var _0x133ac2;if(_0x2b184e>=_0x2f2ebf){_0x2b184e=_0x2f2ebf;_0x133ac2=0xc8;}else{_0x133ac2=0xce;}_0x442548[_0xbb10('0x14')](_0x133ac2);return _0x442548[_0xbb10('0x1a')](_0xbb10('0x1b'),_0x36b5e8+'-'+_0x2b184e+'/'+_0x2f2ebf)[_0xbb10('0x15')](_0x58a612);}return null;};}function saveUpdates(_0x30efc6){return function(_0xbf2906){if(_0xbf2906){return _0xbf2906[_0xbb10('0x1c')](_0x30efc6)['then'](function(_0x5ff0cf){return _0x5ff0cf;});}return null;};}function removeEntity(_0x19f48d){return function(_0x388fab){if(_0x388fab){return _0x388fab[_0xbb10('0x1d')]()[_0xbb10('0x1e')](function(){_0x19f48d[_0xbb10('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x12f888){return function(_0x12ef77){if(!_0x12ef77){_0x12f888['sendStatus'](0x194);}return _0x12ef77;};}function handleError(_0x4c4b0d,_0x8e2b97){_0x8e2b97=_0x8e2b97||0x1f4;return function(_0x311abe){logger[_0xbb10('0x1f')](_0x311abe[_0xbb10('0x20')]);if(_0x311abe[_0xbb10('0x21')]){delete _0x311abe[_0xbb10('0x21')];}_0x4c4b0d[_0xbb10('0x14')](_0x8e2b97)[_0xbb10('0x22')](_0x311abe);};}function getInteractionUsers(_0x7f2377,_0x395404){return new BPromise(function(_0x3ba6cd,_0x26ad93){try{if(_0x395404[_0x7f2377['id']]){_0x7f2377['Users']=_['map'](_0x395404[_0x7f2377['id']],function(_0x4fb5e0){return{'id':_0x4fb5e0['id'],'fullname':_0x4fb5e0[_0xbb10('0x23')]};});}}catch(_0x3c5ae7){_0x26ad93(_0x3c5ae7);}_0x3ba6cd(_0x7f2377);});}function getInteractionTags(_0x2c89b9,_0x4e25ff){return new BPromise(function(_0x2fdde9,_0x24d586){try{if(_0x2c89b9[_0xbb10('0x24')]){_0x2c89b9[_0xbb10('0x25')]=[];_0x2c89b9[_0xbb10('0x24')][_0xbb10('0x26')](',')[_0xbb10('0x27')](function(_0x4aabb9){_0x2c89b9[_0xbb10('0x25')][_0xbb10('0x28')](_0x4e25ff[_0x4aabb9]);});}delete _0x2c89b9[_0xbb10('0x24')];}catch(_0x2e0249){_0x24d586(_0x2e0249);}_0x2fdde9(_0x2c89b9);});}function getLastMessageText(_0x1d30aa){return new BPromise(function(_0x2ff4c1,_0x5d5c80){return db[_0xbb10('0x29')]['findOne']({'where':{'$and':[{'MailInteractionId':_0x1d30aa['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0xbb10('0x2a')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':['plainBody'],'order':_0xbb10('0x2b'),'raw':!![]})[_0xbb10('0x1e')](function(_0x1b59f9){if(_0x1b59f9&&_0x1b59f9['plainBody']){_0x1d30aa['lastMsgText']=_[_0xbb10('0x2c')](_0x1b59f9[_0xbb10('0x2d')]);}_0x2ff4c1(_0x1d30aa);})['catch'](function(_0x359ad4){_0x5d5c80(_0x359ad4);});});}function updateMailInteraction(_0x37dde7,_0x2f653f,_0x1c0b57,_0x37a83f){return new BPromise(function(_0x138bc6,_0xf85197){return getInteractionUsers(_0x37dde7,_0x1c0b57)['then'](function(_0x25acb3){return getInteractionTags(_0x25acb3,_0x2f653f);})[_0xbb10('0x1e')](function(_0x441d15){if(_0x37a83f){_0x138bc6(getLastMessageText(_0x441d15));}else{_0x138bc6(_0x441d15);}})[_0xbb10('0x2e')](function(_0xfb2c5e){_0xf85197(_0xfb2c5e);});});}exports[_0xbb10('0x2f')]=function(_0x188cbd,_0x10202c){var _0x3c8d7d={},_0x56943c={},_0x2b5352={'count':0x0,'rows':[]};var _0x150107=_[_0xbb10('0x30')](db[_0xbb10('0x31')]['rawAttributes'],function(_0x111762){return{'name':_0x111762['fieldName'],'type':_0x111762['type'][_0xbb10('0x32')]};});_0x56943c[_0xbb10('0x33')]=_[_0xbb10('0x30')](_0x150107,_0xbb10('0x21'));_0x56943c[_0xbb10('0x34')]=_[_0xbb10('0x35')](_0x188cbd['query']);_0x56943c[_0xbb10('0x36')]=_[_0xbb10('0x37')](_0x56943c['model'],_0x56943c['query']);_0x3c8d7d['attributes']=_[_0xbb10('0x37')](_0x56943c[_0xbb10('0x33')],qs[_0xbb10('0x38')](_0x188cbd['query'][_0xbb10('0x38')]));_0x3c8d7d[_0xbb10('0x39')]=_0x3c8d7d[_0xbb10('0x39')]['length']?_0x3c8d7d[_0xbb10('0x39')]:_0x56943c[_0xbb10('0x33')];if(!_0x188cbd[_0xbb10('0x34')][_0xbb10('0x3a')]('nolimit')){_0x3c8d7d[_0xbb10('0x18')]=qs[_0xbb10('0x18')](_0x188cbd['query'][_0xbb10('0x18')]);_0x3c8d7d[_0xbb10('0x16')]=qs[_0xbb10('0x16')](_0x188cbd[_0xbb10('0x34')][_0xbb10('0x16')]);}_0x3c8d7d[_0xbb10('0x3b')]=qs['sort'](_0x188cbd[_0xbb10('0x34')][_0xbb10('0x3c')]);_0x3c8d7d[_0xbb10('0x3d')]=qs[_0xbb10('0x36')](_['pick'](_0x188cbd[_0xbb10('0x34')],_0x56943c[_0xbb10('0x36')]),_0x150107);var _0x23dc18=[];var _0x403beb=squel['select']()[_0xbb10('0x3e')]('id')[_0xbb10('0x3e')]('name')['field'](_0xbb10('0x3f'))['from'](_0xbb10('0x40'));var _0x180933=squel['select']()[_0xbb10('0x3e')](_0xbb10('0x41'))[_0xbb10('0x3e')]('u.fullname')[_0xbb10('0x3e')](_0xbb10('0x42'))[_0xbb10('0x43')](_0xbb10('0x44'),'ui')[_0xbb10('0x45')](_0xbb10('0x46'),'u',_0xbb10('0x47'));var _0x3efa96=squel[_0xbb10('0x48')]()[_0xbb10('0x43')](_0xbb10('0x49'),'i')[_0xbb10('0x45')]('cm_contacts','c',_0xbb10('0x4a'))[_0xbb10('0x45')]('users','o',_0xbb10('0x4b'))[_0xbb10('0x45')](_0xbb10('0x4c'),'a',_0xbb10('0x4d'))[_0xbb10('0x45')](_0xbb10('0x4e'),'me',_0xbb10('0x4f'))['left_join']('mail_interaction_has_tags','it',_0xbb10('0x50'))[_0xbb10('0x45')](_0xbb10('0x40'),'t','t.id\x20=\x20it.TagId');var _0x5f0c12=squel[_0xbb10('0x51')]();var _0x34cf4e=[];var _0x1bd054=squel[_0xbb10('0x51')]();var _0x10159b;if(_0x188cbd[_0xbb10('0x34')][_0xbb10('0x52')]){_0x10159b=as[_0xbb10('0x53')](_0x188cbd[_0xbb10('0x34')][_0xbb10('0x52')]);var _0x550111=_0x10159b['sqlOperator'];for(var _0x412e13=0x0;_0x412e13<_0x10159b[_0xbb10('0x54')][_0xbb10('0x55')];_0x412e13++){var _0xb014b0=_0x10159b[_0xbb10('0x54')][_0x412e13];var _0x440f9e='i';var _0x358e7e=_[_0xbb10('0x56')](_0x150107,[_0xbb10('0x21'),_0xb014b0[_0xbb10('0x3e')]]);if(!_0x358e7e){switch(_0xb014b0[_0xbb10('0x3e')]){case _0xbb10('0x57'):if(_0xb014b0[_0xbb10('0x58')]==0x1){_0x3efa96[_0xbb10('0x59')]('`'+_0xb014b0[_0xbb10('0x3e')]+'`\x20=\x200');}else{_0x3efa96[_0xbb10('0x59')]('`'+_0xb014b0['field']+_0xbb10('0x5a'));}break;case _0xbb10('0x5b'):if(_0xb014b0[_0xbb10('0x5c')]===_0xbb10('0x5d')){if(_0xb014b0[_0xbb10('0x58')][_0xbb10('0x26')]('\x20')[_0xbb10('0x55')]>0x1){_0x5f0c12[_0x550111](_0xbb10('0x5e'),qs[_0xbb10('0x5f')](_0xb014b0[_0xbb10('0x58')]),null);}else{var _0x44a056='%'+_0xb014b0[_0xbb10('0x58')]+'%';_0x5f0c12[_0x550111](_0xbb10('0x60'),_0x44a056,_0x44a056,_0x44a056);}}else{_0x358e7e=_[_0xbb10('0x56')](_0x150107,[_0xbb10('0x21'),'ContactId']);_0xb014b0[_0xbb10('0x3e')]=_0xbb10('0x61');_0x155dc5=as[_0xbb10('0x62')](_0x440f9e,_0x358e7e[_0xbb10('0x63')],_0xb014b0);_0x5f0c12[_0x550111](_0x155dc5[_0xbb10('0x64')],_0x155dc5[_0xbb10('0x58')]['start'],_0x155dc5[_0xbb10('0x58')][_0xbb10('0x13')]);}break;case _0xbb10('0x65'):var _0x14fed3=_0xb014b0[_0xbb10('0x58')][_0xbb10('0x26')](',')[_0xbb10('0x30')](function(_0x12ec18){return Number(_0x12ec18);});_0x14fed3[_0xbb10('0x27')](function(_0x40c4fb){_0x1bd054['or'](_0xbb10('0x66'),'%,'+_0x40c4fb+',%');});_0x34cf4e=_[_0xbb10('0x67')](_0x34cf4e,_0x14fed3);break;case _0xbb10('0x68'):if(_0xb014b0['operator']==='$substring'){_0x5f0c12[_0x550111](_0xbb10('0x69'),'%'+_0xb014b0[_0xbb10('0x58')]+'%',null);}else{_0x358e7e=_[_0xbb10('0x56')](_0x150107,[_0xbb10('0x21'),'UserId']);_0xb014b0['field']=_0xbb10('0x6a');_0x155dc5=as[_0xbb10('0x62')](_0x440f9e,_0x358e7e[_0xbb10('0x63')],_0xb014b0);_0x5f0c12[_0x550111](_0x155dc5[_0xbb10('0x64')],_0x155dc5[_0xbb10('0x58')][_0xbb10('0x6b')],_0x155dc5[_0xbb10('0x58')]['end']);}break;case _0xbb10('0x2d'):_0x155dc5=as[_0xbb10('0x62')]('me',null,_0xb014b0);_0x5f0c12[_0x550111](_0x155dc5['text'],_0x155dc5['value']['start'],_0x155dc5[_0xbb10('0x58')][_0xbb10('0x13')]);break;}}else{var _0x155dc5=as['buildExpression'](_0x440f9e,_0x358e7e['type'],_0xb014b0);_0x5f0c12[_0x550111](_0x155dc5['text'],_0x155dc5[_0xbb10('0x58')][_0xbb10('0x6b')],_0x155dc5[_0xbb10('0x58')]['end']);}}}else{var _0xa1bbd9=_(_0x188cbd[_0xbb10('0x34')])['keys']()['map'](function(_0x27d7b9){return _[_0xbb10('0x6c')](_0x150107,[_0xbb10('0x21'),_0x27d7b9])?_0x27d7b9:undefined;})[_0xbb10('0x6d')]()['value']();if(!_[_0xbb10('0x6e')](_0xa1bbd9)){_0xa1bbd9[_0xbb10('0x27')](function(_0xa7179d){if(_0xa7179d==='MailAccountId'){_0x3efa96[_0xbb10('0x3d')](_0xbb10('0x6f'),[][_0xbb10('0x70')](_0x188cbd['query'][_0xa7179d]));}else if(_0xa7179d===_0xbb10('0x71')){var _0x31e85e=JSON[_0xbb10('0x72')](_0x188cbd[_0xbb10('0x34')][_0xa7179d])['$gte'];var _0x251417=JSON[_0xbb10('0x72')](_0x188cbd[_0xbb10('0x34')][_0xa7179d])[_0xbb10('0x73')];_0x3efa96['where'](_0xbb10('0x74'),_0x31e85e,_0x251417);}else{if(_0x188cbd[_0xbb10('0x34')][_0xa7179d]===_0xbb10('0x75')){_0x3efa96[_0xbb10('0x3d')]('i.'+_0xa7179d+_0xbb10('0x76'));}else{_0x3efa96[_0xbb10('0x3d')]('i.'+_0xa7179d+_0xbb10('0x77'),_0x188cbd['query'][_0xa7179d]);}}});}if(_0x188cbd['query']['read']){if(_0x188cbd[_0xbb10('0x34')][_0xbb10('0x78')]==0x1){_0x3efa96[_0xbb10('0x59')]('`unreadMessages`\x20=\x200');}else{_0x3efa96['having'](_0xbb10('0x79'));}}if(_0x188cbd[_0xbb10('0x34')][_0xbb10('0x7a')]){_0x34cf4e=_[_0xbb10('0x7b')](_0x188cbd[_0xbb10('0x34')][_0xbb10('0x7a')])?_0x188cbd['query'][_0xbb10('0x7a')]:new Array(_0x188cbd[_0xbb10('0x34')][_0xbb10('0x7a')]);_0x34cf4e[_0xbb10('0x27')](function(_0x2aaaa6){_0x1bd054['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x2aaaa6+',%');});}if(_0x188cbd['query']['filter']){var _0x329da7=_0x188cbd[_0xbb10('0x34')][_0xbb10('0x7c')][_0xbb10('0x7d')]('\x5c','\x5c\x5c')[_0xbb10('0x7d')](/'/g,'\x27\x27');if(qs[_0xbb10('0x7e')](_0x329da7)){_0x5f0c12['or']('i.id\x20LIKE\x20?',_0x329da7+'%');}else if(qs[_0xbb10('0x7f')](_0x329da7)){_0x5f0c12['or']('c.email\x20LIKE\x20?',_0x329da7+'%');}else{_0x5f0c12['or']('MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x329da7))['or'](_0xbb10('0x80'),qs[_0xbb10('0x5f')](_0x329da7));}}}_0x3efa96[_0xbb10('0x3d')](_0x5f0c12);_0x3efa96[_0xbb10('0x81')]('i.id');var _0x122d38={'type':db['Sequelize']['QueryTypes'][_0xbb10('0x82')],'raw':!![]};var _0xfe3db0=_0x3efa96[_0xbb10('0x83')]();_0xfe3db0[_0xbb10('0x3e')](_0xbb10('0x84'));_0xfe3db0['field'](_0xbb10('0x85'),_0xbb10('0x57'));if(_0x3c8d7d[_0xbb10('0x3b')]){_0x3c8d7d[_0xbb10('0x3b')][_0xbb10('0x27')](function(_0x27f42f){var _0x174395=_0x27f42f[0x0]==='contactName'?_0x27f42f[0x0]:'i.'+_0x27f42f[0x0];_0x3efa96[_0xbb10('0x3b')](_0x174395,_0x27f42f[0x1]===_0xbb10('0x86')?![]:!![]);});}if(!_[_0xbb10('0x6e')](_0x34cf4e)){_0x3efa96[_0xbb10('0x59')](_0x1bd054);_0xfe3db0[_0xbb10('0x3d')](_0xbb10('0x87'),_0x34cf4e);}BPromise[_0xbb10('0x88')]()[_0xbb10('0x1e')](function(){if(!_0x10159b){if(_0x188cbd['query'][_0xbb10('0x89')])return;_0xfe3db0[_0xbb10('0x3d')](_0xbb10('0x8a'));_0x3efa96['where']('i.MailAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x188cbd['user'][_0xbb10('0x8b')]!=='agent')return;return _0x188cbd['user'][_0xbb10('0x8c')]({'attributes':['id'],'raw':!![]})[_0xbb10('0x1e')](function(_0x33ff06){if(_[_0xbb10('0x6e')](_0x33ff06)){_0xfe3db0[_0xbb10('0x3d')](_0xbb10('0x8d'));_0x3efa96[_0xbb10('0x3d')](_0xbb10('0x8d'));}else{_0xfe3db0[_0xbb10('0x3d')]('i.MailAccountId\x20IN\x20?',_[_0xbb10('0x30')](_0x33ff06,'id'));_0x3efa96[_0xbb10('0x3d')](_0xbb10('0x6f'),_[_0xbb10('0x30')](_0x33ff06,'id'));}});})['then'](function(){if(_0x188cbd['user'][_0xbb10('0x8b')]===_0xbb10('0x8e')&&!_0x10159b&&!_0x188cbd[_0xbb10('0x34')][_0xbb10('0x89')])return[];return db['sequelize'][_0xbb10('0x34')](_0xfe3db0[_0xbb10('0x8f')](),_0x122d38);})[_0xbb10('0x1e')](function(_0xf7b3e1){_0x2b5352[_0xbb10('0x19')]=_0xf7b3e1['length'];if(_0x2b5352['count']===0x0)return[];return db[_0xbb10('0x90')][_0xbb10('0x34')](_0x403beb[_0xbb10('0x8f')](),_0x122d38)['then'](function(_0x256b35){_0x23dc18=_[_0xbb10('0x91')](_0x256b35,'id');_0x122d38=_['merge'](_0x122d38,{'model':db['MailInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x188cbd[_0xbb10('0x34')][_0xbb10('0x38')]){_0x3c8d7d[_0xbb10('0x39')]['forEach'](function(_0x32d5a5){_0x3efa96[_0xbb10('0x3e')]('i.'+_0x32d5a5);});}else{_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x85'),_0xbb10('0x57'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x92'),_0xbb10('0x93'));_0x3efa96[_0xbb10('0x3e')]('a.mandatoryDisposition',_0xbb10('0x94'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x95'),_0xbb10('0x96'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x84'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x97'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x98'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x99'));_0x3efa96['field']('i.closedAt');_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x9a'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x9b'));_0x3efa96[_0xbb10('0x3e')]('i.lastMsgDirection');_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x9c'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x9d'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0x9e'));_0x3efa96['field'](_0xbb10('0x9f'));_0x3efa96[_0xbb10('0x3e')]('i.substatus');_0x3efa96[_0xbb10('0x3e')]('i.to');_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa0'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa1'));_0x3efa96[_0xbb10('0x3e')]('i.UserId');_0x3efa96[_0xbb10('0x3e')]('c.firstName',_0xbb10('0xa2'));_0x3efa96[_0xbb10('0x3e')]('c.lastName','Contact.lastName');_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa3'),_0xbb10('0xa4'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa5'),_0xbb10('0xa6'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa7'),_0xbb10('0xa8'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xa9'),'Contact.fax');_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xaa'),_0xbb10('0xab'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xac'),_0xbb10('0xad'));_0x3efa96[_0xbb10('0x3e')](_0xbb10('0xae'),_0xbb10('0x24'));}if(_0x3c8d7d[_0xbb10('0x18')])_0x3efa96[_0xbb10('0x18')](_0x3c8d7d[_0xbb10('0x18')]);if(_0x3c8d7d['offset'])_0x3efa96[_0xbb10('0x16')](_0x3c8d7d['offset']);return db[_0xbb10('0x90')][_0xbb10('0x34')](_0x3efa96[_0xbb10('0x8f')](),_0x122d38);})[_0xbb10('0x1e')](function(_0x38d369){if(_0x38d369['length']>0x0)_0x180933[_0xbb10('0x3d')](_0xbb10('0xaf'),_[_0xbb10('0x30')](_0x38d369,'id'));return db[_0xbb10('0x90')][_0xbb10('0x34')](_0x180933[_0xbb10('0x8f')](),_0x122d38)['then'](function(_0x4bd470){var _0x5cc9d7=_[_0xbb10('0xb0')](_0x4bd470,_0xbb10('0xb1'));var _0x57d5a1=[];return db[_0xbb10('0xb2')][_0xbb10('0xb3')]({'attributes':['enableEmailPreview'],'raw':!![]})[_0xbb10('0x1e')](function(_0xaede56){var _0x5642c3=_0xaede56[_0xbb10('0xb4')];_0x38d369['forEach'](function(_0x34cec7){_0x57d5a1[_0xbb10('0x28')](updateMailInteraction(_0x34cec7,_0x23dc18,_0x5cc9d7,_0x5642c3));});return BPromise['all'](_0x57d5a1);});});});})[_0xbb10('0x1e')](function(_0x28cc74){_0x2b5352['rows']=_0x28cc74;return _0x2b5352;})['then'](respondWithFilteredResult(_0x10202c,_0x3c8d7d))[_0xbb10('0x2e')](handleError(_0x10202c,null));};exports[_0xbb10('0xb5')]=function(_0x3e0e34,_0x3299bc){var _0x3ceb77={'raw':![],'where':{'id':_0x3e0e34[_0xbb10('0xb6')]['id']}},_0x4c3bdc={};_0x4c3bdc[_0xbb10('0x33')]=_[_0xbb10('0x35')](db['MailInteraction'][_0xbb10('0xb7')]);_0x4c3bdc[_0xbb10('0x34')]=_[_0xbb10('0x35')](_0x3e0e34[_0xbb10('0x34')]);_0x4c3bdc[_0xbb10('0x36')]=_[_0xbb10('0x37')](_0x4c3bdc[_0xbb10('0x33')],_0x4c3bdc[_0xbb10('0x34')]);_0x3ceb77[_0xbb10('0x39')]=_['intersection'](_0x4c3bdc['model'],qs[_0xbb10('0x38')](_0x3e0e34[_0xbb10('0x34')][_0xbb10('0x38')]));_0x3ceb77[_0xbb10('0x39')]=_0x3ceb77[_0xbb10('0x39')][_0xbb10('0x55')]?_0x3ceb77[_0xbb10('0x39')]:_0x4c3bdc[_0xbb10('0x33')];if(_0x3e0e34[_0xbb10('0x34')][_0xbb10('0xb8')]){_0x3ceb77[_0xbb10('0xb9')]=[{'all':!![]}];}_0x3ceb77=_[_0xbb10('0xba')]({},_0x3ceb77,_0x3e0e34[_0xbb10('0xbb')]);return db['MailInteraction'][_0xbb10('0x56')](_0x3ceb77)[_0xbb10('0x1e')](handleEntityNotFound(_0x3299bc,null))[_0xbb10('0x1e')](respondWithResult(_0x3299bc,null))[_0xbb10('0x2e')](handleError(_0x3299bc,null));};exports[_0xbb10('0xbc')]=function(_0xd9284e,_0x4258fc){return db[_0xbb10('0x31')][_0xbb10('0xbc')](_0xd9284e[_0xbb10('0xbd')],{})[_0xbb10('0x1e')](respondWithResult(_0x4258fc,0xc9))['catch'](handleError(_0x4258fc,null));};exports[_0xbb10('0x1c')]=function(_0x5e1ac5,_0x3faaca){if(_0x5e1ac5[_0xbb10('0xbd')]['id']){delete _0x5e1ac5[_0xbb10('0xbd')]['id'];}return db[_0xbb10('0x31')][_0xbb10('0x56')]({'where':{'id':_0x5e1ac5[_0xbb10('0xb6')]['id']}})['then'](handleEntityNotFound(_0x3faaca,null))[_0xbb10('0x1e')](saveUpdates(_0x5e1ac5['body'],null))[_0xbb10('0x1e')](respondWithResult(_0x3faaca,null))[_0xbb10('0x2e')](handleError(_0x3faaca,null));};exports[_0xbb10('0x1d')]=function(_0x576bb6,_0x2b652c){return db[_0xbb10('0x31')][_0xbb10('0x56')]({'where':{'id':_0x576bb6[_0xbb10('0xb6')]['id']}})[_0xbb10('0x1e')](handleEntityNotFound(_0x2b652c,null))[_0xbb10('0x1e')](removeEntity(_0x2b652c,null))[_0xbb10('0x2e')](handleError(_0x2b652c,null));};exports[_0xbb10('0xbe')]=function(_0x589565,_0x3696b3){return db['MailInteraction'][_0xbb10('0xbe')]()[_0xbb10('0x1e')](respondWithResult(_0x3696b3,null))[_0xbb10('0x2e')](handleError(_0x3696b3,null));};exports[_0xbb10('0xbf')]=function(_0x44c229,_0x40271f){return db[_0xbb10('0x29')]['find']({'where':{'id':_0x44c229[_0xbb10('0xb6')]['id']}})['then'](handleEntityNotFound(_0x40271f,null))['then'](function(_0x1513e0){if(_0x1513e0){return _0x1513e0[_0xbb10('0xbf')](_0x44c229[_0xbb10('0xbd')][_0xbb10('0xc0')],_[_0xbb10('0xc1')](_0x44c229[_0xbb10('0xbd')],['ids','id'])||{});}})[_0xbb10('0x1e')](respondWithResult(_0x40271f,null))[_0xbb10('0x2e')](handleError(_0x40271f,null));};exports[_0xbb10('0xc2')]=function(_0xb1b7c8,_0x136520){var _0x28127c={'raw':![],'where':{}};var _0x528aff={};var _0xdfdc42={'count':0x0,'rows':[]};return db[_0xbb10('0x31')][_0xbb10('0xb3')]({'where':{'id':_0xb1b7c8[_0xbb10('0xb6')]['id']}})[_0xbb10('0x1e')](handleEntityNotFound(_0x136520,null))[_0xbb10('0x1e')](function(_0x2764e1){if(_0x2764e1){_0x528aff['model']=_[_0xbb10('0x35')](db['MailMessage'][_0xbb10('0xb7')]);_0x528aff['query']=_['keys'](_0xb1b7c8[_0xbb10('0x34')]);_0x528aff[_0xbb10('0x36')]=_[_0xbb10('0x37')](_0x528aff[_0xbb10('0x33')],_0x528aff[_0xbb10('0x34')]);_0x28127c['attributes']=_[_0xbb10('0x37')](_0x528aff['model'],qs['fields'](_0xb1b7c8['query'][_0xbb10('0x38')]));_0x28127c[_0xbb10('0x39')]=_0x28127c[_0xbb10('0x39')][_0xbb10('0x55')]?_0x28127c[_0xbb10('0x39')]:_0x528aff['model'];if(!_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0x3a')](_0xbb10('0xc3'))){_0x28127c[_0xbb10('0x18')]=qs[_0xbb10('0x18')](_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0x18')]);_0x28127c['offset']=qs['offset'](_0xb1b7c8['query'][_0xbb10('0x16')]);}_0x28127c[_0xbb10('0x3b')]=qs[_0xbb10('0x3c')](_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0x3c')]);_0x28127c[_0xbb10('0x3d')]=qs[_0xbb10('0x36')](_[_0xbb10('0xc4')](_0xb1b7c8[_0xbb10('0x34')],_0x528aff[_0xbb10('0x36')]));_0x28127c['where']['MailInteractionId']=_0x2764e1['id'];if(_0xb1b7c8['query'][_0xbb10('0x7c')]){_0x28127c[_0xbb10('0x3d')]=_[_0xbb10('0xba')](_0x28127c['where'],{'$or':_[_0xbb10('0x30')](_0x28127c[_0xbb10('0x39')],function(_0x2c638d){var _0x290280={};_0x290280[_0x2c638d]={'$like':'%'+_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0x7c')]+'%'};return _0x290280;})});}if(_0xb1b7c8['query']['$gte']){var _0x356660=_0xb1b7c8['query'][_0xbb10('0xc5')][_0xbb10('0x26')](',');var _0x152ca9={};_0x152ca9[_0x356660[0x0]]={'$gte':moment(_0x356660[0x1])[_0xbb10('0xc6')](_0xbb10('0xc7'))};_0x28127c[_0xbb10('0x3d')]=_[_0xbb10('0xba')](_0x28127c[_0xbb10('0x3d')],_0x152ca9);}_0x28127c=_[_0xbb10('0xba')]({},_0x28127c,_0xb1b7c8[_0xbb10('0xbb')]);return db['MailMessage'][_0xbb10('0x19')]({'where':_0x28127c['where']})[_0xbb10('0x1e')](function(_0x5547fa){_0xdfdc42[_0xbb10('0x19')]=_0x5547fa;if(_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0xb8')]){_0x28127c[_0xbb10('0xb9')]=[{'all':!![]}];}return db['MailMessage'][_0xbb10('0xc8')](_0x28127c);})['then'](function(_0xfe1154){if(_0xb1b7c8[_0xbb10('0x34')][_0xbb10('0xc9')]==='true'){for(var _0x298167=0x0;_0x298167<_0xfe1154[_0xbb10('0x55')];_0x298167++){_0xfe1154[_0x298167][_0xbb10('0xbd')]=juice(_0xfe1154[_0x298167][_0xbb10('0xbd')]);}}_0xdfdc42[_0xbb10('0xca')]=_0xfe1154;return _0xdfdc42;});}})[_0xbb10('0x1e')](respondWithFilteredResult(_0x136520,_0x28127c))['catch'](handleError(_0x136520,null));};exports['addTags']=function(_0x522a88,_0x26a752){return db['MailInteraction'][_0xbb10('0x56')]({'where':{'id':_0x522a88['params']['id']}})[_0xbb10('0x1e')](handleEntityNotFound(_0x26a752,null))[_0xbb10('0x1e')](function(_0x385ad3){if(_0x385ad3){return _0x385ad3['setTags'](_0x522a88['body'][_0xbb10('0xc0')],_[_0xbb10('0xc1')](_0x522a88[_0xbb10('0xbd')],['ids','id'])||{})[_0xbb10('0xcb')](function(){return db[_0xbb10('0x65')][_0xbb10('0xc8')]({'attributes':['id','name','color'],'where':{'id':_0x522a88['body'][_0xbb10('0xc0')]}});})['then'](function(_0x3dfbcd){socket[_0xbb10('0xcc')](_0xbb10('0xcd'),{'id':Number(_0x522a88[_0xbb10('0xb6')]['id']),'tags':_0x3dfbcd||[]});return{'id':Number(_0x522a88[_0xbb10('0xb6')]['id']),'tags':_0x3dfbcd||[]};});}})[_0xbb10('0x1e')](respondWithResult(_0x26a752,null))[_0xbb10('0x2e')](handleError(_0x26a752,null));};exports[_0xbb10('0xce')]=function(_0x2746eb,_0x431792){return db[_0xbb10('0x31')]['find']({'where':{'id':_0x2746eb[_0xbb10('0xb6')]['id']}})[_0xbb10('0x1e')](handleEntityNotFound(_0x431792,null))['then'](function(_0x14ef50){if(_0x14ef50){return _0x14ef50['removeTags'](_0x2746eb['query'][_0xbb10('0xc0')]);}})[_0xbb10('0x1e')](respondWithStatusCode(_0x431792,null))[_0xbb10('0x2e')](handleError(_0x431792,null));};exports[_0xbb10('0xcf')]=function(_0x99c4,_0x4ca4ce){var _0x161171=moment()[_0xbb10('0xd0')]()['toString']();var _0xa45726=path[_0xbb10('0xd1')](config['root'],_0xbb10('0xd2'),'files',_0xbb10('0xd3'));var _0x8e8049=path[_0xbb10('0xd1')](config[_0xbb10('0xd4')],_0xbb10('0xd2'),_0xbb10('0xd5'),_0xbb10('0xd6'));var _0x56f902=path[_0xbb10('0xd1')](_0xa45726,_0x161171);var _0x4720a1=util[_0xbb10('0xc6')](_0xbb10('0xd7'),_0x99c4[_0xbb10('0xb6')]['id'],_0x161171);var _0x1301e3=path['join'](_0xa45726,_0x4720a1);var _0x550301=[];if(_0x99c4['query'][_0xbb10('0xd6')]){_0x550301[_0xbb10('0x28')]({'model':db[_0xbb10('0xd8')],'as':_0xbb10('0xd9'),'raw':!![]});}var _0x57700b=[{'model':db[_0xbb10('0x29')],'as':_0xbb10('0xda'),'attributes':['id',_0xbb10('0xbd'),'from','to','cc','bcc',_0xbb10('0xdb'),'createdAt'],'where':{'secret':![]},'order':qs[_0xbb10('0x3c')]('id'),'include':_0x550301}];return db[_0xbb10('0x31')][_0xbb10('0x56')]({'where':{'id':_0x99c4[_0xbb10('0xb6')]['id']},'include':_0x57700b})[_0xbb10('0x1e')](handleEntityNotFound(_0x4ca4ce,null))[_0xbb10('0x1e')](function(_0x1fe250){if(_0x1fe250&&_0x1fe250['Messages']){var _0x424371=_0x1fe250[_0xbb10('0xdc')]({'plain':!![]});fs['mkdirSync'](_0x56f902);return BPromise[_0xbb10('0xdd')](_0x424371[_0xbb10('0xda')],function(_0x32f261,_0x5b11a2){var _0x4b490a={'from':_0x32f261['from'],'to':_0x32f261['to'],'subject':_0x32f261[_0xbb10('0xdb')],'html':_0x32f261[_0xbb10('0xbd')],'headers':{'Date':moment(_0x32f261['createdAt'])[_0xbb10('0xc6')](_0xbb10('0xde'))},'attachments':[]};if(_0x32f261['cc']){_0x4b490a[_0xbb10('0xdf')]['Cc']=_0x32f261['cc'];}if(_0x32f261[_0xbb10('0xe0')]){_0x4b490a[_0xbb10('0xdf')][_0xbb10('0xe1')]=_0x32f261[_0xbb10('0xe0')];}return new BPromise(function(_0x48f0eb,_0x304603){if(_0x32f261['Attachments']){for(var _0x5a7c4e=0x0;_0x5a7c4e<_0x32f261['Attachments'][_0xbb10('0x55')];_0x5a7c4e++){var _0x572d73=_0x32f261['Attachments'][_0x5a7c4e];var _0x1f09f1=path['join'](_0x8e8049,_0x572d73[_0xbb10('0xe2')]);if(fs[_0xbb10('0xe3')](_0x1f09f1)){_0x4b490a[_0xbb10('0xd6')]['push']({'name':_0x572d73['name'],'contentType':_0x572d73[_0xbb10('0x63')],'data':fs['readFileSync'](_0x1f09f1)});}}}emlformat[_0xbb10('0xe4')](_0x4b490a,function(_0x211172,_0x589ecb){if(_0x211172)return _0x304603(_0x211172);fs['writeFileSync'](path[_0xbb10('0xd1')](_0x56f902,util[_0xbb10('0xc6')](_0xbb10('0xe5'),_0x5b11a2)),_0x589ecb);return _0x48f0eb(_0x589ecb);});});})['then'](function(){return new BPromise(function(_0x4f4aa8,_0x426a4f){zipdir(_0x56f902,{'saveTo':_0x1301e3},function(_0x22f153,_0x4d47cc){if(_0x22f153)return _0x426a4f(_0x22f153);return _0x4f4aa8(_0x4d47cc);});})[_0xbb10('0x1e')](function(){return new BPromise(function(_0x203e5a,_0xe88e90){rimraf(_0x56f902,function(_0x4845b5){if(_0x4845b5)_0xe88e90(_0x4845b5);return _0x203e5a();});});})[_0xbb10('0x1e')](function(){return _0x4ca4ce[_0xbb10('0xcf')](_0x1301e3,_0x4720a1,function(_0x166f4f){if(!_0x166f4f)fs[_0xbb10('0xe6')](_0x1301e3);});});});}else{return _0x4ca4ce[_0xbb10('0x12')](0xc8);}})[_0xbb10('0x2e')](handleError(_0x4ca4ce,null));}; \ No newline at end of file +var _0xa9e0=['o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','Setting','enableEmailPreview','all','rows','show','params','includeAll','include','options','create','body','addMessage','ids','omit','getMessages','nolimit','MailInteractionId','format','YYYY-MM-DD\x20HH:mm:ss','findAll','inlineCss','true','addTags','setTags','Tag','mailInteractionTags:save','download','join','root','server','tmp','attachments','Attachment','Attachments','subject','Messages','get','mkdirSync','each','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','bcc','Bcc','basename','existsSync','readFileSync','writeFileSync','message%d.eml','unlinkSync','eml-format','rimraf','zip-dir','util','lodash','squel','juice','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','defaults','socket.io-emitter','redis','./mailInteraction.socket','register','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','sendStatus','error','stack','name','send','Users','fullname','Tags','split','forEach','push','TagIds','MailMessage','findOne','out','-id','plainBody','lastMsgText','trimStart','catch','index','MailInteraction','rawAttributes','fieldName','key','model','map','query','intersection','attributes','fields','length','hasOwnProperty','sort','filters','pick','select','field','color','from','tools_tags','u.id','u.fullname','ui.MailInteractionId','user_has_mail_interactions','left_join','users','u.id\x20=\x20ui.UserId','mail_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','a.id\x20=\x20i.MailAccountId','mail_messages','me.MailInteractionId\x20=\x20i.id','it.MailInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','having','`\x20>\x200','Contact','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','type','text','start','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','buildExpression','keys','some','compact','where','i.MailAccountId\x20IN\x20?','concat','createdAt','parse','$gte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','group','QueryTypes','SELECT','clone','i.id','order','contactName','DESC','t.id\x20IN\x20?','resolve','MailAccountId','i.MailAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getMailAccounts','i.MailAccountId\x20IS\x20NULL','sequelize','toString','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','Account.mandatoryDisposition','i.createdAt','i.updatedAt','i.closed','i.closedAt','i.attach','i.lastMsgDirection','i.disposition','i.secondDisposition','i.thirdDisposition','i.substatus','i.to','i.MailAccountId','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname'];(function(_0x17c151,_0x16b798){var _0x29ec11=function(_0x585303){while(--_0x585303){_0x17c151['push'](_0x17c151['shift']());}};_0x29ec11(++_0x16b798);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0xa9e0[_0x2cfb58];return _0xd99951;};'use strict';var emlformat=require(_0x0a9e('0x0'));var rimraf=require(_0x0a9e('0x1'));var zipdir=require(_0x0a9e('0x2'));var moment=require('moment');var BPromise=require('bluebird');var util=require(_0x0a9e('0x3'));var path=require('path');var fs=require('fs');var _=require(_0x0a9e('0x4'));var squel=require(_0x0a9e('0x5'));var juice=require(_0x0a9e('0x6'));var Redis=require(_0x0a9e('0x7'));var qs=require(_0x0a9e('0x8'));var as=require('../../components/parsers/advancedSearch');var logger=require(_0x0a9e('0x9'))(_0x0a9e('0xa'));var config=require(_0x0a9e('0xb'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x0a9e('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x0a9e('0xd'))(new Redis(config[_0x0a9e('0xe')]));require(_0x0a9e('0xf'))[_0x0a9e('0x10')](socket);function respondWithStatusCode(_0xfeb75b,_0xbd1168){_0xbd1168=_0xbd1168||0xcc;return function(_0x4a4c56){if(_0x4a4c56){return _0xfeb75b['sendStatus'](_0xbd1168);}return _0xfeb75b['status'](_0xbd1168)['end']();};}function respondWithResult(_0x273d4d,_0x36471c){_0x36471c=_0x36471c||0xc8;return function(_0xd5b662){if(_0xd5b662){return _0x273d4d[_0x0a9e('0x11')](_0x36471c)[_0x0a9e('0x12')](_0xd5b662);}};}function respondWithFilteredResult(_0x69aeb7,_0x5db4b0){return function(_0x4283ce){if(_0x4283ce){var _0x239b12=typeof _0x5db4b0[_0x0a9e('0x13')]===_0x0a9e('0x14')&&typeof _0x5db4b0[_0x0a9e('0x15')]===_0x0a9e('0x14');var _0x52a03d=_0x4283ce[_0x0a9e('0x16')];var _0x5d0880=_0x239b12?0x0:_0x5db4b0[_0x0a9e('0x13')];var _0x519dfd=_0x239b12?_0x4283ce[_0x0a9e('0x16')]:_0x5db4b0[_0x0a9e('0x13')]+_0x5db4b0['limit'];var _0x225616;if(_0x519dfd>=_0x52a03d){_0x519dfd=_0x52a03d;_0x225616=0xc8;}else{_0x225616=0xce;}_0x69aeb7['status'](_0x225616);return _0x69aeb7[_0x0a9e('0x17')](_0x0a9e('0x18'),_0x5d0880+'-'+_0x519dfd+'/'+_0x52a03d)[_0x0a9e('0x12')](_0x4283ce);}return null;};}function saveUpdates(_0x205fd6){return function(_0x31b1ca){if(_0x31b1ca){return _0x31b1ca[_0x0a9e('0x19')](_0x205fd6)[_0x0a9e('0x1a')](function(_0x20559e){return _0x20559e;});}return null;};}function removeEntity(_0x1314ae){return function(_0x112016){if(_0x112016){return _0x112016[_0x0a9e('0x1b')]()[_0x0a9e('0x1a')](function(){_0x1314ae['status'](0xcc)[_0x0a9e('0x1c')]();});}};}function handleEntityNotFound(_0x155cce){return function(_0x53682f){if(!_0x53682f){_0x155cce[_0x0a9e('0x1d')](0x194);}return _0x53682f;};}function handleError(_0x5a09ef,_0x588269){_0x588269=_0x588269||0x1f4;return function(_0x3a02e1){logger[_0x0a9e('0x1e')](_0x3a02e1[_0x0a9e('0x1f')]);if(_0x3a02e1[_0x0a9e('0x20')]){delete _0x3a02e1['name'];}_0x5a09ef[_0x0a9e('0x11')](_0x588269)[_0x0a9e('0x21')](_0x3a02e1);};}function getInteractionUsers(_0x3b45bc,_0x4d00e6){return new BPromise(function(_0x370d86,_0x42ac8f){try{if(_0x4d00e6[_0x3b45bc['id']]){_0x3b45bc[_0x0a9e('0x22')]=_['map'](_0x4d00e6[_0x3b45bc['id']],function(_0x59181e){return{'id':_0x59181e['id'],'fullname':_0x59181e[_0x0a9e('0x23')]};});}}catch(_0x3a8e58){_0x42ac8f(_0x3a8e58);}_0x370d86(_0x3b45bc);});}function getInteractionTags(_0x40c424,_0x33161b){return new BPromise(function(_0x526cf3,_0x384319){try{if(_0x40c424['TagIds']){_0x40c424[_0x0a9e('0x24')]=[];_0x40c424['TagIds'][_0x0a9e('0x25')](',')[_0x0a9e('0x26')](function(_0x25fba9){_0x40c424[_0x0a9e('0x24')][_0x0a9e('0x27')](_0x33161b[_0x25fba9]);});}delete _0x40c424[_0x0a9e('0x28')];}catch(_0x11c3b6){_0x384319(_0x11c3b6);}_0x526cf3(_0x40c424);});}function getLastMessageText(_0x14de77){return new BPromise(function(_0x5a101a,_0x3652a7){return db[_0x0a9e('0x29')][_0x0a9e('0x2a')]({'where':{'$and':[{'MailInteractionId':_0x14de77['id']},{'$or':[{'direction':'in'},{'$and':[{'direction':_0x0a9e('0x2b')},{'secret':![]},{'UserId':{'$ne':null}}]}]}]},'attributes':['plainBody'],'order':_0x0a9e('0x2c'),'raw':!![]})[_0x0a9e('0x1a')](function(_0x1843b2){if(_0x1843b2&&_0x1843b2[_0x0a9e('0x2d')]){_0x14de77[_0x0a9e('0x2e')]=_[_0x0a9e('0x2f')](_0x1843b2[_0x0a9e('0x2d')]);}_0x5a101a(_0x14de77);})[_0x0a9e('0x30')](function(_0x1dbde2){_0x3652a7(_0x1dbde2);});});}function updateMailInteraction(_0x540530,_0x426950,_0x5d1e0e,_0x2407f9){return new BPromise(function(_0x3ae878,_0x1122db){return getInteractionUsers(_0x540530,_0x5d1e0e)[_0x0a9e('0x1a')](function(_0x25ce3a){return getInteractionTags(_0x25ce3a,_0x426950);})['then'](function(_0x66c1d2){if(_0x2407f9){_0x3ae878(getLastMessageText(_0x66c1d2));}else{_0x3ae878(_0x66c1d2);}})[_0x0a9e('0x30')](function(_0x40cb85){_0x1122db(_0x40cb85);});});}exports[_0x0a9e('0x31')]=function(_0x2b45ea,_0x409319){var _0x332d35={},_0x39e565={},_0x5583a4={'count':0x0,'rows':[]};var _0x44295a=_['map'](db[_0x0a9e('0x32')][_0x0a9e('0x33')],function(_0x2b7e7f){return{'name':_0x2b7e7f[_0x0a9e('0x34')],'type':_0x2b7e7f['type'][_0x0a9e('0x35')]};});_0x39e565[_0x0a9e('0x36')]=_[_0x0a9e('0x37')](_0x44295a,_0x0a9e('0x20'));_0x39e565['query']=_['keys'](_0x2b45ea[_0x0a9e('0x38')]);_0x39e565['filters']=_[_0x0a9e('0x39')](_0x39e565[_0x0a9e('0x36')],_0x39e565[_0x0a9e('0x38')]);_0x332d35[_0x0a9e('0x3a')]=_['intersection'](_0x39e565[_0x0a9e('0x36')],qs[_0x0a9e('0x3b')](_0x2b45ea[_0x0a9e('0x38')]['fields']));_0x332d35[_0x0a9e('0x3a')]=_0x332d35[_0x0a9e('0x3a')][_0x0a9e('0x3c')]?_0x332d35['attributes']:_0x39e565['model'];if(!_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x3d')]('nolimit')){_0x332d35[_0x0a9e('0x15')]=qs[_0x0a9e('0x15')](_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x15')]);_0x332d35['offset']=qs['offset'](_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x13')]);}_0x332d35['order']=qs[_0x0a9e('0x3e')](_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x3e')]);_0x332d35['where']=qs[_0x0a9e('0x3f')](_[_0x0a9e('0x40')](_0x2b45ea[_0x0a9e('0x38')],_0x39e565[_0x0a9e('0x3f')]),_0x44295a);var _0x13cb1f=[];var _0xeaa5e5=squel[_0x0a9e('0x41')]()[_0x0a9e('0x42')]('id')[_0x0a9e('0x42')](_0x0a9e('0x20'))[_0x0a9e('0x42')](_0x0a9e('0x43'))[_0x0a9e('0x44')](_0x0a9e('0x45'));var _0x37f6cc=squel['select']()['field'](_0x0a9e('0x46'))[_0x0a9e('0x42')](_0x0a9e('0x47'))[_0x0a9e('0x42')](_0x0a9e('0x48'))[_0x0a9e('0x44')](_0x0a9e('0x49'),'ui')[_0x0a9e('0x4a')](_0x0a9e('0x4b'),'u',_0x0a9e('0x4c'));var _0x2c2cb0=squel[_0x0a9e('0x41')]()['from'](_0x0a9e('0x4d'),'i')[_0x0a9e('0x4a')](_0x0a9e('0x4e'),'c',_0x0a9e('0x4f'))[_0x0a9e('0x4a')](_0x0a9e('0x4b'),'o',_0x0a9e('0x50'))[_0x0a9e('0x4a')]('mail_accounts','a',_0x0a9e('0x51'))['left_join'](_0x0a9e('0x52'),'me',_0x0a9e('0x53'))[_0x0a9e('0x4a')]('mail_interaction_has_tags','it',_0x0a9e('0x54'))[_0x0a9e('0x4a')](_0x0a9e('0x45'),'t',_0x0a9e('0x55'));var _0x45c845=squel[_0x0a9e('0x56')]();var _0x45bf7f=[];var _0x5bbcde=squel[_0x0a9e('0x56')]();var _0x1bde3c;if(_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x57')]){_0x1bde3c=as[_0x0a9e('0x58')](_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x57')]);var _0x19383e=_0x1bde3c[_0x0a9e('0x59')];for(var _0x58a5c2=0x0;_0x58a5c2<_0x1bde3c[_0x0a9e('0x5a')][_0x0a9e('0x3c')];_0x58a5c2++){var _0x4f7240=_0x1bde3c['conditions'][_0x58a5c2];var _0x5ddf84='i';var _0x1adfee=_[_0x0a9e('0x5b')](_0x44295a,[_0x0a9e('0x20'),_0x4f7240[_0x0a9e('0x42')]]);if(!_0x1adfee){switch(_0x4f7240[_0x0a9e('0x42')]){case _0x0a9e('0x5c'):if(_0x4f7240[_0x0a9e('0x5d')]==0x1){_0x2c2cb0[_0x0a9e('0x5e')]('`'+_0x4f7240['field']+'`\x20=\x200');}else{_0x2c2cb0['having']('`'+_0x4f7240[_0x0a9e('0x42')]+_0x0a9e('0x5f'));}break;case _0x0a9e('0x60'):if(_0x4f7240['operator']===_0x0a9e('0x61')){if(_0x4f7240[_0x0a9e('0x5d')]['split']('\x20')['length']>0x1){_0x45c845[_0x19383e](_0x0a9e('0x62'),qs['getFullTextValue'](_0x4f7240[_0x0a9e('0x5d')]),null);}else{var _0x4c3845='%'+_0x4f7240[_0x0a9e('0x5d')]+'%';_0x45c845[_0x19383e](_0x0a9e('0x63'),_0x4c3845,_0x4c3845,_0x4c3845);}}else{_0x1adfee=_[_0x0a9e('0x5b')](_0x44295a,['name',_0x0a9e('0x64')]);_0x4f7240[_0x0a9e('0x42')]='ContactId';_0x2244d6=as['buildExpression'](_0x5ddf84,_0x1adfee[_0x0a9e('0x65')],_0x4f7240);_0x45c845[_0x19383e](_0x2244d6[_0x0a9e('0x66')],_0x2244d6['value'][_0x0a9e('0x67')],_0x2244d6['value'][_0x0a9e('0x1c')]);}break;case'Tag':var _0xe22ccc=_0x4f7240['value']['split'](',')['map'](function(_0x2da03c){return Number(_0x2da03c);});_0xe22ccc['forEach'](function(_0x2f7092){_0x5bbcde['or'](_0x0a9e('0x68'),'%,'+_0x2f7092+',%');});_0x45bf7f=_[_0x0a9e('0x69')](_0x45bf7f,_0xe22ccc);break;case _0x0a9e('0x6a'):if(_0x4f7240[_0x0a9e('0x6b')]===_0x0a9e('0x61')){_0x45c845[_0x19383e](_0x0a9e('0x6c'),'%'+_0x4f7240[_0x0a9e('0x5d')]+'%',null);}else{_0x1adfee=_['find'](_0x44295a,[_0x0a9e('0x20'),_0x0a9e('0x6d')]);_0x4f7240[_0x0a9e('0x42')]=_0x0a9e('0x6d');_0x2244d6=as[_0x0a9e('0x6e')](_0x5ddf84,_0x1adfee[_0x0a9e('0x65')],_0x4f7240);_0x45c845[_0x19383e](_0x2244d6['text'],_0x2244d6[_0x0a9e('0x5d')][_0x0a9e('0x67')],_0x2244d6['value'][_0x0a9e('0x1c')]);}break;case'plainBody':_0x2244d6=as[_0x0a9e('0x6e')]('me',null,_0x4f7240);_0x45c845[_0x19383e](_0x2244d6['text'],_0x2244d6['value']['start'],_0x2244d6[_0x0a9e('0x5d')]['end']);break;}}else{var _0x2244d6=as[_0x0a9e('0x6e')](_0x5ddf84,_0x1adfee[_0x0a9e('0x65')],_0x4f7240);_0x45c845[_0x19383e](_0x2244d6[_0x0a9e('0x66')],_0x2244d6[_0x0a9e('0x5d')][_0x0a9e('0x67')],_0x2244d6['value'][_0x0a9e('0x1c')]);}}}else{var _0x5854cc=_(_0x2b45ea[_0x0a9e('0x38')])[_0x0a9e('0x6f')]()[_0x0a9e('0x37')](function(_0x5adf8f){return _[_0x0a9e('0x70')](_0x44295a,[_0x0a9e('0x20'),_0x5adf8f])?_0x5adf8f:undefined;})[_0x0a9e('0x71')]()[_0x0a9e('0x5d')]();if(!_['isEmpty'](_0x5854cc)){_0x5854cc[_0x0a9e('0x26')](function(_0xe05a5a){if(_0xe05a5a==='MailAccountId'){_0x2c2cb0[_0x0a9e('0x72')](_0x0a9e('0x73'),[][_0x0a9e('0x74')](_0x2b45ea[_0x0a9e('0x38')][_0xe05a5a]));}else if(_0xe05a5a===_0x0a9e('0x75')){var _0x4d4a35=JSON[_0x0a9e('0x76')](_0x2b45ea[_0x0a9e('0x38')][_0xe05a5a])[_0x0a9e('0x77')];var _0x47bb43=JSON[_0x0a9e('0x76')](_0x2b45ea['query'][_0xe05a5a])['$lte'];_0x2c2cb0[_0x0a9e('0x72')](_0x0a9e('0x78'),_0x4d4a35,_0x47bb43);}else{if(_0x2b45ea[_0x0a9e('0x38')][_0xe05a5a]===_0x0a9e('0x79')){_0x2c2cb0[_0x0a9e('0x72')]('i.'+_0xe05a5a+_0x0a9e('0x7a'));}else{_0x2c2cb0[_0x0a9e('0x72')]('i.'+_0xe05a5a+_0x0a9e('0x7b'),_0x2b45ea[_0x0a9e('0x38')][_0xe05a5a]);}}});}if(_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x7c')]){if(_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x7c')]==0x1){_0x2c2cb0[_0x0a9e('0x5e')](_0x0a9e('0x7d'));}else{_0x2c2cb0[_0x0a9e('0x5e')](_0x0a9e('0x7e'));}}if(_0x2b45ea[_0x0a9e('0x38')]['tag']){_0x45bf7f=_[_0x0a9e('0x7f')](_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x80')])?_0x2b45ea['query'][_0x0a9e('0x80')]:new Array(_0x2b45ea[_0x0a9e('0x38')]['tag']);_0x45bf7f[_0x0a9e('0x26')](function(_0x56e31e){_0x5bbcde['or'](_0x0a9e('0x68'),'%,'+_0x56e31e+',%');});}if(_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x81')]){var _0x4a43a8=_0x2b45ea['query']['filter'][_0x0a9e('0x82')]('\x5c','\x5c\x5c')[_0x0a9e('0x82')](/'/g,'\x27\x27');if(qs[_0x0a9e('0x83')](_0x4a43a8)){_0x45c845['or'](_0x0a9e('0x84'),_0x4a43a8+'%');}else if(qs[_0x0a9e('0x85')](_0x4a43a8)){_0x45c845['or'](_0x0a9e('0x86'),_0x4a43a8+'%');}else{_0x45c845['or'](_0x0a9e('0x87'),qs[_0x0a9e('0x88')](_0x4a43a8))['or']('MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x0a9e('0x88')](_0x4a43a8));}}}_0x2c2cb0[_0x0a9e('0x72')](_0x45c845);_0x2c2cb0[_0x0a9e('0x89')]('i.id');var _0x2bdc44={'type':db['Sequelize'][_0x0a9e('0x8a')][_0x0a9e('0x8b')],'raw':!![]};var _0x4c46c1=_0x2c2cb0[_0x0a9e('0x8c')]();_0x4c46c1[_0x0a9e('0x42')](_0x0a9e('0x8d'));_0x4c46c1[_0x0a9e('0x42')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x0a9e('0x5c'));if(_0x332d35[_0x0a9e('0x8e')]){_0x332d35[_0x0a9e('0x8e')][_0x0a9e('0x26')](function(_0x5b7fc3){var _0x109ccb=_0x5b7fc3[0x0]===_0x0a9e('0x8f')?_0x5b7fc3[0x0]:'i.'+_0x5b7fc3[0x0];_0x2c2cb0[_0x0a9e('0x8e')](_0x109ccb,_0x5b7fc3[0x1]===_0x0a9e('0x90')?![]:!![]);});}if(!_['isEmpty'](_0x45bf7f)){_0x2c2cb0[_0x0a9e('0x5e')](_0x5bbcde);_0x4c46c1[_0x0a9e('0x72')](_0x0a9e('0x91'),_0x45bf7f);}BPromise[_0x0a9e('0x92')]()[_0x0a9e('0x1a')](function(){if(!_0x1bde3c){if(_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x93')])return;_0x4c46c1[_0x0a9e('0x72')](_0x0a9e('0x94'));_0x2c2cb0[_0x0a9e('0x72')](_0x0a9e('0x94'));return;}if(_0x2b45ea[_0x0a9e('0x95')][_0x0a9e('0x96')]!==_0x0a9e('0x97'))return;return _0x2b45ea['user'][_0x0a9e('0x98')]({'attributes':['id'],'raw':!![]})[_0x0a9e('0x1a')](function(_0xc599b3){if(_['isEmpty'](_0xc599b3)){_0x4c46c1[_0x0a9e('0x72')](_0x0a9e('0x99'));_0x2c2cb0[_0x0a9e('0x72')](_0x0a9e('0x99'));}else{_0x4c46c1['where']('i.MailAccountId\x20IN\x20?',_[_0x0a9e('0x37')](_0xc599b3,'id'));_0x2c2cb0[_0x0a9e('0x72')]('i.MailAccountId\x20IN\x20?',_[_0x0a9e('0x37')](_0xc599b3,'id'));}});})['then'](function(){if(_0x2b45ea[_0x0a9e('0x95')][_0x0a9e('0x96')]==='agent'&&!_0x1bde3c&&!_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x93')])return[];return db[_0x0a9e('0x9a')][_0x0a9e('0x38')](_0x4c46c1[_0x0a9e('0x9b')](),_0x2bdc44);})[_0x0a9e('0x1a')](function(_0x444f1f){_0x5583a4['count']=_0x444f1f[_0x0a9e('0x3c')];if(_0x5583a4[_0x0a9e('0x16')]===0x0)return[];return db[_0x0a9e('0x9a')][_0x0a9e('0x38')](_0xeaa5e5['toString'](),_0x2bdc44)[_0x0a9e('0x1a')](function(_0xf0db1){_0x13cb1f=_['keyBy'](_0xf0db1,'id');_0x2bdc44=_[_0x0a9e('0x9c')](_0x2bdc44,{'model':db['MailInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2b45ea[_0x0a9e('0x38')][_0x0a9e('0x3b')]){_0x332d35[_0x0a9e('0x3a')][_0x0a9e('0x26')](function(_0x5af453){_0x2c2cb0['field']('i.'+_0x5af453);});}else{_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0x9d'),_0x0a9e('0x5c'));_0x2c2cb0['field'](_0x0a9e('0x9e'),_0x0a9e('0x9f'));_0x2c2cb0['field']('a.mandatoryDisposition',_0x0a9e('0xa0'));_0x2c2cb0['field']('CASE\x20WHEN\x20i.to\x20IS\x20NOT\x20NULL\x20AND\x20i.to\x20<>\x20\x27\x27\x20AND\x20i.to\x20NOT\x20LIKE\x20(\x27%\x27\x20+\x20a.email\x20+\x20\x27%\x27)\x20THEN\x20SUBSTRING_INDEX(i.to,\x20\x27<\x27,\x201)\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName');_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0x8d'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xa1'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xa2'));_0x2c2cb0['field'](_0x0a9e('0xa3'));_0x2c2cb0['field'](_0x0a9e('0xa4'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xa5'));_0x2c2cb0[_0x0a9e('0x42')]('i.lastMsgAt');_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xa6'));_0x2c2cb0[_0x0a9e('0x42')]('i.subject');_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xa7'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xa8'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xa9'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xaa'));_0x2c2cb0['field'](_0x0a9e('0xab'));_0x2c2cb0[_0x0a9e('0x42')]('i.ContactId');_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xac'));_0x2c2cb0[_0x0a9e('0x42')]('i.UserId');_0x2c2cb0[_0x0a9e('0x42')]('c.firstName',_0x0a9e('0xad'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xae'),_0x0a9e('0xaf'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xb0'),_0x0a9e('0xb1'));_0x2c2cb0[_0x0a9e('0x42')]('c.phone',_0x0a9e('0xb2'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xb3'),_0x0a9e('0xb4'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xb5'),_0x0a9e('0xb6'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xb7'),_0x0a9e('0xb8'));_0x2c2cb0[_0x0a9e('0x42')](_0x0a9e('0xb9'),_0x0a9e('0xba'));_0x2c2cb0['field'](_0x0a9e('0xbb'),_0x0a9e('0x28'));}if(_0x332d35[_0x0a9e('0x15')])_0x2c2cb0[_0x0a9e('0x15')](_0x332d35[_0x0a9e('0x15')]);if(_0x332d35['offset'])_0x2c2cb0[_0x0a9e('0x13')](_0x332d35[_0x0a9e('0x13')]);return db['sequelize'][_0x0a9e('0x38')](_0x2c2cb0['toString'](),_0x2bdc44);})[_0x0a9e('0x1a')](function(_0x27041d){if(_0x27041d[_0x0a9e('0x3c')]>0x0)_0x37f6cc[_0x0a9e('0x72')]('ui.MailInteractionId\x20IN\x20?',_[_0x0a9e('0x37')](_0x27041d,'id'));return db['sequelize'][_0x0a9e('0x38')](_0x37f6cc[_0x0a9e('0x9b')](),_0x2bdc44)['then'](function(_0x231c6a){var _0x63c9f7=_[_0x0a9e('0xbc')](_0x231c6a,'MailInteractionId');var _0x4c788f=[];return db[_0x0a9e('0xbd')][_0x0a9e('0x2a')]({'attributes':[_0x0a9e('0xbe')],'raw':!![]})[_0x0a9e('0x1a')](function(_0x3f2f40){var _0x2450a8=_0x3f2f40[_0x0a9e('0xbe')];_0x27041d[_0x0a9e('0x26')](function(_0x3f8124){_0x4c788f['push'](updateMailInteraction(_0x3f8124,_0x13cb1f,_0x63c9f7,_0x2450a8));});return BPromise[_0x0a9e('0xbf')](_0x4c788f);});});});})['then'](function(_0x287324){_0x5583a4[_0x0a9e('0xc0')]=_0x287324;return _0x5583a4;})[_0x0a9e('0x1a')](respondWithFilteredResult(_0x409319,_0x332d35))[_0x0a9e('0x30')](handleError(_0x409319,null));};exports[_0x0a9e('0xc1')]=function(_0x4e7273,_0x436313){var _0x4667bf={'raw':![],'where':{'id':_0x4e7273[_0x0a9e('0xc2')]['id']}},_0x2791c5={};_0x2791c5[_0x0a9e('0x36')]=_['keys'](db['MailInteraction'][_0x0a9e('0x33')]);_0x2791c5['query']=_[_0x0a9e('0x6f')](_0x4e7273[_0x0a9e('0x38')]);_0x2791c5[_0x0a9e('0x3f')]=_[_0x0a9e('0x39')](_0x2791c5[_0x0a9e('0x36')],_0x2791c5[_0x0a9e('0x38')]);_0x4667bf['attributes']=_['intersection'](_0x2791c5[_0x0a9e('0x36')],qs['fields'](_0x4e7273[_0x0a9e('0x38')]['fields']));_0x4667bf[_0x0a9e('0x3a')]=_0x4667bf['attributes']['length']?_0x4667bf[_0x0a9e('0x3a')]:_0x2791c5[_0x0a9e('0x36')];if(_0x4e7273['query'][_0x0a9e('0xc3')]){_0x4667bf[_0x0a9e('0xc4')]=[{'all':!![]}];}_0x4667bf=_[_0x0a9e('0x9c')]({},_0x4667bf,_0x4e7273[_0x0a9e('0xc5')]);return db[_0x0a9e('0x32')]['find'](_0x4667bf)['then'](handleEntityNotFound(_0x436313,null))[_0x0a9e('0x1a')](respondWithResult(_0x436313,null))[_0x0a9e('0x30')](handleError(_0x436313,null));};exports[_0x0a9e('0xc6')]=function(_0x24beb6,_0x59303b){return db['MailInteraction'][_0x0a9e('0xc6')](_0x24beb6[_0x0a9e('0xc7')],{})['then'](respondWithResult(_0x59303b,0xc9))[_0x0a9e('0x30')](handleError(_0x59303b,null));};exports[_0x0a9e('0x19')]=function(_0xcacabb,_0x2427d5){if(_0xcacabb[_0x0a9e('0xc7')]['id']){delete _0xcacabb[_0x0a9e('0xc7')]['id'];}return db[_0x0a9e('0x32')][_0x0a9e('0x5b')]({'where':{'id':_0xcacabb[_0x0a9e('0xc2')]['id']}})[_0x0a9e('0x1a')](handleEntityNotFound(_0x2427d5,null))['then'](saveUpdates(_0xcacabb[_0x0a9e('0xc7')],null))[_0x0a9e('0x1a')](respondWithResult(_0x2427d5,null))[_0x0a9e('0x30')](handleError(_0x2427d5,null));};exports[_0x0a9e('0x1b')]=function(_0x1d0b02,_0x547e37){return db['MailInteraction'][_0x0a9e('0x5b')]({'where':{'id':_0x1d0b02[_0x0a9e('0xc2')]['id']}})[_0x0a9e('0x1a')](handleEntityNotFound(_0x547e37,null))[_0x0a9e('0x1a')](removeEntity(_0x547e37,null))[_0x0a9e('0x30')](handleError(_0x547e37,null));};exports['describe']=function(_0x1339d0,_0x3c775a){return db[_0x0a9e('0x32')]['describe']()[_0x0a9e('0x1a')](respondWithResult(_0x3c775a,null))['catch'](handleError(_0x3c775a,null));};exports[_0x0a9e('0xc8')]=function(_0x4799d4,_0x25b745){return db[_0x0a9e('0x29')][_0x0a9e('0x5b')]({'where':{'id':_0x4799d4['params']['id']}})[_0x0a9e('0x1a')](handleEntityNotFound(_0x25b745,null))['then'](function(_0x4383da){if(_0x4383da){return _0x4383da[_0x0a9e('0xc8')](_0x4799d4[_0x0a9e('0xc7')][_0x0a9e('0xc9')],_[_0x0a9e('0xca')](_0x4799d4[_0x0a9e('0xc7')],[_0x0a9e('0xc9'),'id'])||{});}})[_0x0a9e('0x1a')](respondWithResult(_0x25b745,null))[_0x0a9e('0x30')](handleError(_0x25b745,null));};exports[_0x0a9e('0xcb')]=function(_0x4262d0,_0xc876d4){var _0x2415fe={'raw':![],'where':{}};var _0x399def={};var _0x98c62c={'count':0x0,'rows':[]};return db[_0x0a9e('0x32')]['findOne']({'where':{'id':_0x4262d0['params']['id']}})[_0x0a9e('0x1a')](handleEntityNotFound(_0xc876d4,null))['then'](function(_0x1d999b){if(_0x1d999b){_0x399def[_0x0a9e('0x36')]=_['keys'](db[_0x0a9e('0x29')][_0x0a9e('0x33')]);_0x399def[_0x0a9e('0x38')]=_[_0x0a9e('0x6f')](_0x4262d0['query']);_0x399def[_0x0a9e('0x3f')]=_[_0x0a9e('0x39')](_0x399def[_0x0a9e('0x36')],_0x399def[_0x0a9e('0x38')]);_0x2415fe['attributes']=_[_0x0a9e('0x39')](_0x399def[_0x0a9e('0x36')],qs[_0x0a9e('0x3b')](_0x4262d0['query'][_0x0a9e('0x3b')]));_0x2415fe[_0x0a9e('0x3a')]=_0x2415fe[_0x0a9e('0x3a')]['length']?_0x2415fe[_0x0a9e('0x3a')]:_0x399def[_0x0a9e('0x36')];if(!_0x4262d0[_0x0a9e('0x38')][_0x0a9e('0x3d')](_0x0a9e('0xcc'))){_0x2415fe['limit']=qs[_0x0a9e('0x15')](_0x4262d0[_0x0a9e('0x38')]['limit']);_0x2415fe[_0x0a9e('0x13')]=qs[_0x0a9e('0x13')](_0x4262d0[_0x0a9e('0x38')]['offset']);}_0x2415fe['order']=qs['sort'](_0x4262d0[_0x0a9e('0x38')][_0x0a9e('0x3e')]);_0x2415fe['where']=qs[_0x0a9e('0x3f')](_[_0x0a9e('0x40')](_0x4262d0[_0x0a9e('0x38')],_0x399def['filters']));_0x2415fe[_0x0a9e('0x72')][_0x0a9e('0xcd')]=_0x1d999b['id'];if(_0x4262d0[_0x0a9e('0x38')][_0x0a9e('0x81')]){_0x2415fe[_0x0a9e('0x72')]=_[_0x0a9e('0x9c')](_0x2415fe[_0x0a9e('0x72')],{'$or':_[_0x0a9e('0x37')](_0x2415fe[_0x0a9e('0x3a')],function(_0x5a1848){var _0x43c397={};_0x43c397[_0x5a1848]={'$like':'%'+_0x4262d0['query'][_0x0a9e('0x81')]+'%'};return _0x43c397;})});}if(_0x4262d0[_0x0a9e('0x38')][_0x0a9e('0x77')]){var _0x3cf222=_0x4262d0[_0x0a9e('0x38')][_0x0a9e('0x77')]['split'](',');var _0x1a0314={};_0x1a0314[_0x3cf222[0x0]]={'$gte':moment(_0x3cf222[0x1])[_0x0a9e('0xce')](_0x0a9e('0xcf'))};_0x2415fe[_0x0a9e('0x72')]=_['merge'](_0x2415fe[_0x0a9e('0x72')],_0x1a0314);}_0x2415fe=_[_0x0a9e('0x9c')]({},_0x2415fe,_0x4262d0[_0x0a9e('0xc5')]);return db[_0x0a9e('0x29')][_0x0a9e('0x16')]({'where':_0x2415fe[_0x0a9e('0x72')]})[_0x0a9e('0x1a')](function(_0x25931e){_0x98c62c[_0x0a9e('0x16')]=_0x25931e;if(_0x4262d0[_0x0a9e('0x38')]['includeAll']){_0x2415fe[_0x0a9e('0xc4')]=[{'all':!![]}];}return db[_0x0a9e('0x29')][_0x0a9e('0xd0')](_0x2415fe);})[_0x0a9e('0x1a')](function(_0xea8bd1){if(_0x4262d0[_0x0a9e('0x38')][_0x0a9e('0xd1')]===_0x0a9e('0xd2')){for(var _0x566b90=0x0;_0x566b90<_0xea8bd1[_0x0a9e('0x3c')];_0x566b90++){_0xea8bd1[_0x566b90][_0x0a9e('0xc7')]=juice(_0xea8bd1[_0x566b90][_0x0a9e('0xc7')]);}}_0x98c62c['rows']=_0xea8bd1;return _0x98c62c;});}})[_0x0a9e('0x1a')](respondWithFilteredResult(_0xc876d4,_0x2415fe))[_0x0a9e('0x30')](handleError(_0xc876d4,null));};exports[_0x0a9e('0xd3')]=function(_0x97d5b5,_0x370b5e){return db[_0x0a9e('0x32')][_0x0a9e('0x5b')]({'where':{'id':_0x97d5b5[_0x0a9e('0xc2')]['id']}})[_0x0a9e('0x1a')](handleEntityNotFound(_0x370b5e,null))[_0x0a9e('0x1a')](function(_0x5a7dad){if(_0x5a7dad){return _0x5a7dad[_0x0a9e('0xd4')](_0x97d5b5[_0x0a9e('0xc7')][_0x0a9e('0xc9')],_[_0x0a9e('0xca')](_0x97d5b5[_0x0a9e('0xc7')],[_0x0a9e('0xc9'),'id'])||{})['spread'](function(){return db[_0x0a9e('0xd5')]['findAll']({'attributes':['id','name','color'],'where':{'id':_0x97d5b5[_0x0a9e('0xc7')][_0x0a9e('0xc9')]}});})[_0x0a9e('0x1a')](function(_0x2a07d0){socket['emit'](_0x0a9e('0xd6'),{'id':Number(_0x97d5b5[_0x0a9e('0xc2')]['id']),'tags':_0x2a07d0||[]});return{'id':Number(_0x97d5b5[_0x0a9e('0xc2')]['id']),'tags':_0x2a07d0||[]};});}})[_0x0a9e('0x1a')](respondWithResult(_0x370b5e,null))[_0x0a9e('0x30')](handleError(_0x370b5e,null));};exports['removeTags']=function(_0x57b1b1,_0x9484c8){return db[_0x0a9e('0x32')][_0x0a9e('0x5b')]({'where':{'id':_0x57b1b1['params']['id']}})[_0x0a9e('0x1a')](handleEntityNotFound(_0x9484c8,null))[_0x0a9e('0x1a')](function(_0x422f0a){if(_0x422f0a){return _0x422f0a['removeTags'](_0x57b1b1[_0x0a9e('0x38')][_0x0a9e('0xc9')]);}})[_0x0a9e('0x1a')](respondWithStatusCode(_0x9484c8,null))['catch'](handleError(_0x9484c8,null));};exports[_0x0a9e('0xd7')]=function(_0x336b30,_0x3b7213){var _0x549e03=moment()['unix']()['toString']();var _0x3b04fd=path[_0x0a9e('0xd8')](config[_0x0a9e('0xd9')],_0x0a9e('0xda'),'files',_0x0a9e('0xdb'));var _0x532424=path[_0x0a9e('0xd8')](config[_0x0a9e('0xd9')],_0x0a9e('0xda'),'files',_0x0a9e('0xdc'));var _0x33a26c=path[_0x0a9e('0xd8')](_0x3b04fd,_0x549e03);var _0x580dd6=util[_0x0a9e('0xce')]('transcript-%d-%s.zip',_0x336b30[_0x0a9e('0xc2')]['id'],_0x549e03);var _0x5c57e1=path[_0x0a9e('0xd8')](_0x3b04fd,_0x580dd6);var _0x57b7d4=[];if(_0x336b30[_0x0a9e('0x38')][_0x0a9e('0xdc')]){_0x57b7d4[_0x0a9e('0x27')]({'model':db[_0x0a9e('0xdd')],'as':_0x0a9e('0xde'),'raw':!![]});}var _0x251dd9=[{'model':db[_0x0a9e('0x29')],'as':'Messages','attributes':['id',_0x0a9e('0xc7'),_0x0a9e('0x44'),'to','cc','bcc',_0x0a9e('0xdf'),_0x0a9e('0x75')],'where':{'secret':![]},'order':qs['sort']('id'),'include':_0x57b7d4}];return db[_0x0a9e('0x32')][_0x0a9e('0x5b')]({'where':{'id':_0x336b30[_0x0a9e('0xc2')]['id']},'include':_0x251dd9})['then'](handleEntityNotFound(_0x3b7213,null))[_0x0a9e('0x1a')](function(_0xf49ed4){if(_0xf49ed4&&_0xf49ed4[_0x0a9e('0xe0')]){var _0x3f0d64=_0xf49ed4[_0x0a9e('0xe1')]({'plain':!![]});fs[_0x0a9e('0xe2')](_0x33a26c);return BPromise[_0x0a9e('0xe3')](_0x3f0d64[_0x0a9e('0xe0')],function(_0x22767f,_0x426c3c){var _0x56e148={'from':_0x22767f[_0x0a9e('0x44')],'to':_0x22767f['to'],'subject':_0x22767f['subject'],'html':_0x22767f[_0x0a9e('0xc7')],'headers':{'Date':moment(_0x22767f[_0x0a9e('0x75')])[_0x0a9e('0xce')](_0x0a9e('0xe4'))},'attachments':[]};if(_0x22767f['cc']){_0x56e148[_0x0a9e('0xe5')]['Cc']=_0x22767f['cc'];}if(_0x22767f[_0x0a9e('0xe6')]){_0x56e148['headers'][_0x0a9e('0xe7')]=_0x22767f[_0x0a9e('0xe6')];}return new BPromise(function(_0x2977a7,_0x55a599){if(_0x22767f[_0x0a9e('0xde')]){for(var _0x402544=0x0;_0x402544<_0x22767f[_0x0a9e('0xde')][_0x0a9e('0x3c')];_0x402544++){var _0x31e1e0=_0x22767f[_0x0a9e('0xde')][_0x402544];var _0x1e93f5=path['join'](_0x532424,_0x31e1e0[_0x0a9e('0xe8')]);if(fs[_0x0a9e('0xe9')](_0x1e93f5)){_0x56e148[_0x0a9e('0xdc')][_0x0a9e('0x27')]({'name':_0x31e1e0[_0x0a9e('0x20')],'contentType':_0x31e1e0[_0x0a9e('0x65')],'data':fs[_0x0a9e('0xea')](_0x1e93f5)});}}}emlformat['build'](_0x56e148,function(_0x5c8720,_0x10aa22){if(_0x5c8720)return _0x55a599(_0x5c8720);fs[_0x0a9e('0xeb')](path[_0x0a9e('0xd8')](_0x33a26c,util[_0x0a9e('0xce')](_0x0a9e('0xec'),_0x426c3c)),_0x10aa22);return _0x2977a7(_0x10aa22);});});})[_0x0a9e('0x1a')](function(){return new BPromise(function(_0x609711,_0x584854){zipdir(_0x33a26c,{'saveTo':_0x5c57e1},function(_0x39ea62,_0x1d7fc4){if(_0x39ea62)return _0x584854(_0x39ea62);return _0x609711(_0x1d7fc4);});})[_0x0a9e('0x1a')](function(){return new BPromise(function(_0x2675a5,_0x1b1757){rimraf(_0x33a26c,function(_0x3c6082){if(_0x3c6082)_0x1b1757(_0x3c6082);return _0x2675a5();});});})[_0x0a9e('0x1a')](function(){return _0x3b7213['download'](_0x5c57e1,_0x580dd6,function(_0x311288){if(!_0x311288)fs[_0x0a9e('0xed')](_0x5c57e1);});});});}else{return _0x3b7213[_0x0a9e('0x1d')](0xc8);}})['catch'](handleError(_0x3b7213,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index dc89f67..5b69dfa 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 _0xb04b=['then','Users','findAll','length','emit','hasOwnProperty','hook','exports','events','../../mysqldb','MailMessage','setMaxListeners','update','getUsers'];(function(_0x5ec079,_0x44ab9b){var _0x5e795f=function(_0x28ca25){while(--_0x28ca25){_0x5ec079['push'](_0x5ec079['shift']());}};_0x5e795f(++_0x44ab9b);}(_0xb04b,0x13c));var _0xbb04=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xb04b[_0x19e35c];return _0x3e1fe8;};'use strict';var EventEmitter=require(_0xbb04('0x0'));var MailInteraction=require(_0xbb04('0x1'))['db']['MailInteraction'];var MailMessage=require(_0xbb04('0x1'))['db'][_0xbb04('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0xbb04('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xbb04('0x4'),'afterDestroy':'remove'};function emitEvent(_0xedb816){return function(_0x52e3d9,_0x143118,_0x19d8ed){_0x52e3d9[_0xbb04('0x5')]({'attributes':['id'],'raw':!![]})[_0xbb04('0x6')](function(_0x13ff57){_0x52e3d9['setDataValue'](_0xbb04('0x7'),_0x13ff57['map'](function(_0x217b7a){return{'id':_0x217b7a['id']};}));return MailMessage[_0xbb04('0x8')]({'where':{'MailInteractionId':_0x52e3d9['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x2e3031){_0x52e3d9['setDataValue']('unreadMessages',_0x2e3031[_0xbb04('0x9')]);MailInteractionEvents[_0xbb04('0xa')](_0xedb816+':'+_0x52e3d9['id'],_0x52e3d9);MailInteractionEvents[_0xbb04('0xa')](_0xedb816,_0x52e3d9);_0x19d8ed(null);})['catch'](_0x19d8ed(null));};}for(var e in events){if(events[_0xbb04('0xb')](e)){var event=events[e];MailInteraction[_0xbb04('0xc')](e,emitEvent(event));}}module[_0xbb04('0xd')]=MailInteractionEvents; \ No newline at end of file +var _0xa60d=['hasOwnProperty','exports','../../mysqldb','MailMessage','save','update','getUsers','then','map','findAll','setDataValue','emit','catch'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xa60d,0x1e3));var _0xda60=function(_0x3de4f8,_0x336c7d){_0x3de4f8=_0x3de4f8-0x0;var _0x3d81fc=_0xa60d[_0x3de4f8];return _0x3d81fc;};'use strict';var EventEmitter=require('events');var MailInteraction=require(_0xda60('0x0'))['db']['MailInteraction'];var MailMessage=require(_0xda60('0x0'))['db'][_0xda60('0x1')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xda60('0x2'),'afterUpdate':_0xda60('0x3'),'afterDestroy':'remove'};function emitEvent(_0x56ae75){return function(_0x263cb0,_0x4ed183,_0x1b0cb0){_0x263cb0[_0xda60('0x4')]({'attributes':['id'],'raw':!![]})[_0xda60('0x5')](function(_0x4a3e19){_0x263cb0['setDataValue']('Users',_0x4a3e19[_0xda60('0x6')](function(_0x5dbc31){return{'id':_0x5dbc31['id']};}));return MailMessage[_0xda60('0x7')]({'where':{'MailInteractionId':_0x263cb0['id'],'direction':'in','read':![]},'raw':!![]});})[_0xda60('0x5')](function(_0x3adab1){_0x263cb0[_0xda60('0x8')]('unreadMessages',_0x3adab1['length']);MailInteractionEvents['emit'](_0x56ae75+':'+_0x263cb0['id'],_0x263cb0);MailInteractionEvents[_0xda60('0x9')](_0x56ae75,_0x263cb0);_0x1b0cb0(null);})[_0xda60('0xa')](_0x1b0cb0(null));};}for(var e in events){if(events[_0xda60('0xb')](e)){var event=events[e];MailInteraction['hook'](e,emitEvent(event));}}module[_0xda60('0xc')]=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index f0b1548..5637079 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 _0xd3bb=['utf8mb4','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./mailInteraction.attributes','exports','define','fti_mail_interactions','subject','substatus','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closed','changed','closedAt','models','get','MailMessage','then','catch'];(function(_0x23c6f2,_0x4e033c){var _0x4c270b=function(_0x4913f0){while(--_0x4913f0){_0x23c6f2['push'](_0x23c6f2['shift']());}};_0x4c270b(++_0x4e033c);}(_0xd3bb,0x187));var _0xbd3b=function(_0x35e530,_0xaee432){_0x35e530=_0x35e530-0x0;var _0x4e7467=_0xd3bb[_0x35e530];return _0x4e7467;};'use strict';var _=require(_0xbd3b('0x0'));var util=require(_0xbd3b('0x1'));var logger=require(_0xbd3b('0x2'))('api');var moment=require(_0xbd3b('0x3'));var BPromise=require(_0xbd3b('0x4'));var rp=require(_0xbd3b('0x5'));var fs=require('fs');var path=require(_0xbd3b('0x6'));var rimraf=require(_0xbd3b('0x7'));var config=require('../../config/environment');var attributes=require(_0xbd3b('0x8'));module[_0xbd3b('0x9')]=function(_0x192448,_0x3b7bfb){return _0x192448[_0xbd3b('0xa')]('MailInteraction',attributes,{'tableName':'mail_interactions','paranoid':![],'indexes':[{'name':_0xbd3b('0xb'),'fields':[_0xbd3b('0xc'),'to'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0xbdea61,_0x5b1ace,_0x3e3d00){if(_0xbdea61[_0xbd3b('0xd')]){_0xbdea61[_0xbd3b('0xe')]=moment()[_0xbd3b('0xf')](_0xbd3b('0x10'));}if(_0xbdea61[_0xbd3b('0x11')]){_0xbdea61['closedAt']=moment()[_0xbd3b('0xf')](_0xbd3b('0x10'));}_0x3e3d00(null,_0x5b1ace);},'beforeUpdate':function(_0xec1894,_0x2b59fa,_0x511358){if(_0xec1894[_0xbd3b('0x12')](_0xbd3b('0xd'))){_0xec1894[_0xbd3b('0xe')]=_0xec1894['substatus']?moment()[_0xbd3b('0xf')](_0xbd3b('0x10')):null;}if(_0xec1894['changed'](_0xbd3b('0x11'))){_0xec1894[_0xbd3b('0x13')]=moment()[_0xbd3b('0xf')](_0xbd3b('0x10'));_0xec1894[_0xbd3b('0xd')]=null;_0xec1894[_0xbd3b('0xe')]=null;}_0x511358(null,_0xec1894);},'afterUpdate':function(_0x39fadc,_0x2df987,_0x5bca49){var _0x47cee8=_0x192448[_0xbd3b('0x14')];var _0x1724e9=_0x39fadc[_0xbd3b('0x15')]({'plain':!![]});if(_0x1724e9[_0xbd3b('0x11')]){return _0x47cee8[_0xbd3b('0x16')]['update']({'read':!![]},{'where':{'MailInteractionId':_0x1724e9['id']}})[_0xbd3b('0x17')](function(){_0x5bca49();})[_0xbd3b('0x18')](function(_0x5272fa){_0x5bca49(_0x5272fa);});}else{_0x5bca49();}}},'charset':_0xbd3b('0x19'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xf749=['path','rimraf','../../config/environment','./mailInteraction.attributes','exports','define','mail_interactions','fti_mail_interactions','FULLTEXT','substatus','format','YYYY-MM-DD\x20HH:mm:ss','closedAt','changed','substatusAt','closed','models','MailMessage','update','then','utf8mb4','util','../../config/logger','bluebird','request-promise'];(function(_0x2a8d0f,_0x57c74e){var _0x3b27c1=function(_0xa1aadb){while(--_0xa1aadb){_0x2a8d0f['push'](_0x2a8d0f['shift']());}};_0x3b27c1(++_0x57c74e);}(_0xf749,0x92));var _0x9f74=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0xf749[_0x413feb];return _0x40ee88;};'use strict';var _=require('lodash');var util=require(_0x9f74('0x0'));var logger=require(_0x9f74('0x1'))('api');var moment=require('moment');var BPromise=require(_0x9f74('0x2'));var rp=require(_0x9f74('0x3'));var fs=require('fs');var path=require(_0x9f74('0x4'));var rimraf=require(_0x9f74('0x5'));var config=require(_0x9f74('0x6'));var attributes=require(_0x9f74('0x7'));module[_0x9f74('0x8')]=function(_0x54fc86,_0x1610bc){return _0x54fc86[_0x9f74('0x9')]('MailInteraction',attributes,{'tableName':_0x9f74('0xa'),'paranoid':![],'indexes':[{'name':_0x9f74('0xb'),'fields':['subject','to'],'type':_0x9f74('0xc')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x330ec8,_0x4c28e1,_0x5c7087){if(_0x330ec8[_0x9f74('0xd')]){_0x330ec8['substatusAt']=moment()[_0x9f74('0xe')](_0x9f74('0xf'));}if(_0x330ec8['closed']){_0x330ec8[_0x9f74('0x10')]=moment()[_0x9f74('0xe')](_0x9f74('0xf'));}_0x5c7087(null,_0x4c28e1);},'beforeUpdate':function(_0x38fc2b,_0xa8e603,_0x4dfa25){if(_0x38fc2b[_0x9f74('0x11')]('substatus')){_0x38fc2b[_0x9f74('0x12')]=_0x38fc2b['substatus']?moment()[_0x9f74('0xe')](_0x9f74('0xf')):null;}if(_0x38fc2b[_0x9f74('0x11')](_0x9f74('0x13'))){_0x38fc2b[_0x9f74('0x10')]=moment()[_0x9f74('0xe')](_0x9f74('0xf'));_0x38fc2b[_0x9f74('0xd')]=null;_0x38fc2b[_0x9f74('0x12')]=null;}_0x4dfa25(null,_0x38fc2b);},'afterUpdate':function(_0x17e245,_0x30b780,_0x46e310){var _0x5e2356=_0x54fc86[_0x9f74('0x14')];var _0x5c6c42=_0x17e245['get']({'plain':!![]});if(_0x5c6c42['closed']){return _0x5e2356[_0x9f74('0x15')][_0x9f74('0x16')]({'read':!![]},{'where':{'MailInteractionId':_0x5c6c42['id']}})[_0x9f74('0x17')](function(){_0x46e310();})['catch'](function(_0x2e8d8c){_0x46e310(_0x2e8d8c);});}else{_0x46e310();}}},'charset':_0x9f74('0x18'),'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 48eae69..5c55d65 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 _0x5668=['socket.io-emitter','./mailInteraction.socket','register','request','then','info','MailInteraction,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','UpdateMailInteraction','MailInteraction','update','options','raw','where','attributes','AddTagsToMailInteraction','find','addTags','ids','omit','body','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost'];(function(_0x3206fe,_0x2dc7a9){var _0x1ce53a=function(_0xde922e){while(--_0xde922e){_0x3206fe['push'](_0x3206fe['shift']());}};_0x1ce53a(++_0x2dc7a9);}(_0x5668,0xff));var _0x8566=function(_0x2c5c16,_0x255896){_0x2c5c16=_0x2c5c16-0x0;var _0x17a0d7=_0x5668[_0x2c5c16];return _0x17a0d7;};'use strict';var _=require(_0x8566('0x0'));var util=require(_0x8566('0x1'));var moment=require(_0x8566('0x2'));var BPromise=require(_0x8566('0x3'));var rs=require(_0x8566('0x4'));var fs=require('fs');var Redis=require(_0x8566('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x8566('0x6'))(_0x8566('0x7'));var config=require(_0x8566('0x8'));var jayson=require(_0x8566('0x9'));var client=jayson[_0x8566('0xa')][_0x8566('0xb')]({'port':0x232a});config[_0x8566('0xc')]=_[_0x8566('0xd')](config[_0x8566('0xc')],{'host':_0x8566('0xe'),'port':0x18eb});var socket=require(_0x8566('0xf'))(new Redis(config['redis']));require(_0x8566('0x10'))[_0x8566('0x11')](socket);function respondWithRpcPromise(_0x384fea,_0x3a29bf,_0x2edd0e){return new BPromise(function(_0x2b4127,_0x1b806e){return client[_0x8566('0x12')](_0x384fea,_0x2edd0e)[_0x8566('0x13')](function(_0x22c392){logger[_0x8566('0x14')](_0x8566('0x15'),_0x3a29bf,'request\x20sent');logger[_0x8566('0x16')]('MailInteraction,\x20%s,\x20%s,\x20%s',_0x3a29bf,_0x8566('0x17'),JSON[_0x8566('0x18')](_0x22c392));if(_0x22c392['error']){if(_0x22c392[_0x8566('0x19')][_0x8566('0x1a')]===0x1f4){logger['error'](_0x8566('0x15'),_0x3a29bf,_0x22c392[_0x8566('0x19')]['message']);return _0x1b806e(_0x22c392['error'][_0x8566('0x1b')]);}logger['error'](_0x8566('0x15'),_0x3a29bf,_0x22c392['error'][_0x8566('0x1b')]);return _0x2b4127(_0x22c392['error'][_0x8566('0x1b')]);}else{logger['info'](_0x8566('0x15'),_0x3a29bf,_0x8566('0x17'));_0x2b4127(_0x22c392[_0x8566('0x1c')]['message']);}})[_0x8566('0x1d')](function(_0x477ac0){logger[_0x8566('0x19')](_0x8566('0x15'),_0x3a29bf,_0x477ac0);_0x1b806e(_0x477ac0);});});}exports[_0x8566('0x1e')]=function(_0x45b891){var _0x5ac136=this;return new Promise(function(_0x5364f9,_0x477e99){return db[_0x8566('0x1f')][_0x8566('0x20')](_0x45b891['body'],{'raw':_0x45b891[_0x8566('0x21')]?_0x45b891['options'][_0x8566('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x45b891['options']?_0x45b891[_0x8566('0x21')][_0x8566('0x23')]||null:null,'attributes':_0x45b891['options']?_0x45b891[_0x8566('0x21')][_0x8566('0x24')]||null:null,'limit':_0x45b891[_0x8566('0x21')]?_0x45b891[_0x8566('0x21')]['limit']||null:null})['then'](function(_0x516f02){logger[_0x8566('0x14')]('UpdateMailInteraction',_0x45b891);logger[_0x8566('0x16')](_0x8566('0x1e'),_0x45b891,JSON[_0x8566('0x18')](_0x516f02));_0x5364f9(_0x516f02);})[_0x8566('0x1d')](function(_0xb5c88f){logger[_0x8566('0x19')](_0x8566('0x1e'),_0xb5c88f['message'],_0x45b891);_0x477e99(_0x5ac136['error'](0x1f4,_0xb5c88f[_0x8566('0x1b')]));});});};exports[_0x8566('0x25')]=function(_0x3c820a){return new Promise(function(_0x413b04,_0x39b598){return db[_0x8566('0x1f')][_0x8566('0x26')]({'where':_0x3c820a[_0x8566('0x21')]?_0x3c820a[_0x8566('0x21')][_0x8566('0x23')]||null:null})[_0x8566('0x13')](function(_0x1056f4){if(_0x1056f4){return _0x1056f4[_0x8566('0x27')](_0x3c820a['body'][_0x8566('0x28')],_[_0x8566('0x29')](_0x3c820a[_0x8566('0x2a')],[_0x8566('0x28'),'id'])||{});}})[_0x8566('0x2b')](function(_0x222f56){logger[_0x8566('0x14')](_0x8566('0x2c'),_0x3c820a);logger[_0x8566('0x16')](_0x8566('0x2c'),_0x3c820a,JSON[_0x8566('0x18')](_0x222f56));_0x413b04(_0x222f56);})[_0x8566('0x1d')](function(_0x598419){logger[_0x8566('0x19')](_0x8566('0x2c'),_0x598419[_0x8566('0x1b')],_0x3c820a);_0x39b598(_this[_0x8566('0x19')](0x1f4,_0x598419[_0x8566('0x1b')]));});});}; \ No newline at end of file +var _0xa997=['defaults','localhost','socket.io-emitter','./mailInteraction.socket','request','then','info','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','UpdateMailInteraction','MailInteraction','update','options','raw','where','attributes','AddTagsToMailInteraction','find','addTags','ids','omit','body','spread','AddTags','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','client','http','redis'];(function(_0x14735c,_0x56c131){var _0x44e4f4=function(_0x5d565f){while(--_0x5d565f){_0x14735c['push'](_0x14735c['shift']());}};_0x44e4f4(++_0x56c131);}(_0xa997,0x166));var _0x7a99=function(_0x794207,_0x54a989){_0x794207=_0x794207-0x0;var _0x4ee1c9=_0xa997[_0x794207];return _0x4ee1c9;};'use strict';var _=require(_0x7a99('0x0'));var util=require(_0x7a99('0x1'));var moment=require(_0x7a99('0x2'));var BPromise=require(_0x7a99('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7a99('0x4'));var db=require(_0x7a99('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x7a99('0x6'))(_0x7a99('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x7a99('0x8')][_0x7a99('0x9')]({'port':0x232a});config[_0x7a99('0xa')]=_[_0x7a99('0xb')](config[_0x7a99('0xa')],{'host':_0x7a99('0xc'),'port':0x18eb});var socket=require(_0x7a99('0xd'))(new Redis(config[_0x7a99('0xa')]));require(_0x7a99('0xe'))['register'](socket);function respondWithRpcPromise(_0x28e0b2,_0xd442c5,_0x3b8801){return new BPromise(function(_0x4f7503,_0x538b85){return client[_0x7a99('0xf')](_0x28e0b2,_0x3b8801)[_0x7a99('0x10')](function(_0xb9b05e){logger[_0x7a99('0x11')](_0x7a99('0x12'),_0xd442c5,_0x7a99('0x13'));logger[_0x7a99('0x14')](_0x7a99('0x15'),_0xd442c5,_0x7a99('0x13'),JSON[_0x7a99('0x16')](_0xb9b05e));if(_0xb9b05e['error']){if(_0xb9b05e[_0x7a99('0x17')]['code']===0x1f4){logger[_0x7a99('0x17')](_0x7a99('0x12'),_0xd442c5,_0xb9b05e[_0x7a99('0x17')][_0x7a99('0x18')]);return _0x538b85(_0xb9b05e[_0x7a99('0x17')][_0x7a99('0x18')]);}logger[_0x7a99('0x17')]('MailInteraction,\x20%s,\x20%s',_0xd442c5,_0xb9b05e['error'][_0x7a99('0x18')]);return _0x4f7503(_0xb9b05e[_0x7a99('0x17')][_0x7a99('0x18')]);}else{logger[_0x7a99('0x11')](_0x7a99('0x12'),_0xd442c5,_0x7a99('0x13'));_0x4f7503(_0xb9b05e['result'][_0x7a99('0x18')]);}})[_0x7a99('0x19')](function(_0x230175){logger[_0x7a99('0x17')](_0x7a99('0x12'),_0xd442c5,_0x230175);_0x538b85(_0x230175);});});}exports[_0x7a99('0x1a')]=function(_0xf405ce){var _0xe8f28c=this;return new Promise(function(_0x218a4a,_0x460149){return db[_0x7a99('0x1b')][_0x7a99('0x1c')](_0xf405ce['body'],{'raw':_0xf405ce['options']?_0xf405ce[_0x7a99('0x1d')][_0x7a99('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xf405ce['options']?_0xf405ce[_0x7a99('0x1d')][_0x7a99('0x1f')]||null:null,'attributes':_0xf405ce['options']?_0xf405ce[_0x7a99('0x1d')][_0x7a99('0x20')]||null:null,'limit':_0xf405ce[_0x7a99('0x1d')]?_0xf405ce['options']['limit']||null:null})[_0x7a99('0x10')](function(_0x39e40c){logger['info'](_0x7a99('0x1a'),_0xf405ce);logger[_0x7a99('0x14')](_0x7a99('0x1a'),_0xf405ce,JSON[_0x7a99('0x16')](_0x39e40c));_0x218a4a(_0x39e40c);})[_0x7a99('0x19')](function(_0x4ddf41){logger[_0x7a99('0x17')](_0x7a99('0x1a'),_0x4ddf41[_0x7a99('0x18')],_0xf405ce);_0x460149(_0xe8f28c['error'](0x1f4,_0x4ddf41['message']));});});};exports[_0x7a99('0x21')]=function(_0x5ecf42){return new Promise(function(_0x1cdb01,_0x558dd6){return db[_0x7a99('0x1b')][_0x7a99('0x22')]({'where':_0x5ecf42['options']?_0x5ecf42[_0x7a99('0x1d')][_0x7a99('0x1f')]||null:null})[_0x7a99('0x10')](function(_0x182c98){if(_0x182c98){return _0x182c98[_0x7a99('0x23')](_0x5ecf42['body'][_0x7a99('0x24')],_[_0x7a99('0x25')](_0x5ecf42[_0x7a99('0x26')],['ids','id'])||{});}})[_0x7a99('0x27')](function(_0x304023){logger['info'](_0x7a99('0x28'),_0x5ecf42);logger[_0x7a99('0x14')](_0x7a99('0x28'),_0x5ecf42,JSON[_0x7a99('0x16')](_0x304023));_0x1cdb01(_0x304023);})[_0x7a99('0x19')](function(_0x1be37a){logger['error'](_0x7a99('0x28'),_0x1be37a[_0x7a99('0x18')],_0x5ecf42);_0x558dd6(_this[_0x7a99('0x17')](0x1f4,_0x1be37a['message']));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index dc053ba..ed08fd4 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 _0x0771=['save','remove','update','emit','removeListener','register'];(function(_0x56f220,_0x9e6544){var _0x187aaa=function(_0xe56fe2){while(--_0xe56fe2){_0x56f220['push'](_0x56f220['shift']());}};_0x187aaa(++_0x9e6544);}(_0x0771,0xae));var _0x1077=function(_0x37628a,_0x92e3c6){_0x37628a=_0x37628a-0x0;var _0x1cf2bf=_0x0771[_0x37628a];return _0x1cf2bf;};'use strict';var MailInteractionEvents=require('./mailInteraction.events');var events=[_0x1077('0x0'),_0x1077('0x1'),_0x1077('0x2')];function createListener(_0x8e2e8a,_0x591f1d){return function(_0x4d2c64){_0x591f1d[_0x1077('0x3')](_0x8e2e8a,_0x4d2c64);};}function removeListener(_0x218be1,_0x6759d){return function(){MailInteractionEvents[_0x1077('0x4')](_0x218be1,_0x6759d);};}exports[_0x1077('0x5')]=function(_0x2d5e47){for(var _0x405605=0x0,_0x39d697=events['length'];_0x405605<_0x39d697;_0x405605++){var _0x48e936=events[_0x405605];var _0x51b6cf=createListener('mailInteraction:'+_0x48e936,_0x2d5e47);MailInteractionEvents['on'](_0x48e936,_0x51b6cf);}}; \ No newline at end of file +var _0xf09a=['save','remove','update','emit','removeListener','register','length','mailInteraction:','./mailInteraction.events'];(function(_0x32be42,_0x3229cf){var _0x4a344f=function(_0x5206fa){while(--_0x5206fa){_0x32be42['push'](_0x32be42['shift']());}};_0x4a344f(++_0x3229cf);}(_0xf09a,0x15e));var _0xaf09=function(_0x2abaae,_0x29fd8b){_0x2abaae=_0x2abaae-0x0;var _0x5b5745=_0xf09a[_0x2abaae];return _0x5b5745;};'use strict';var MailInteractionEvents=require(_0xaf09('0x0'));var events=[_0xaf09('0x1'),_0xaf09('0x2'),_0xaf09('0x3')];function createListener(_0x432e99,_0x39f0ad){return function(_0x2aac5b){_0x39f0ad[_0xaf09('0x4')](_0x432e99,_0x2aac5b);};}function removeListener(_0x4e3a8d,_0x38ad2e){return function(){MailInteractionEvents[_0xaf09('0x5')](_0x4e3a8d,_0x38ad2e);};}exports[_0xaf09('0x6')]=function(_0x47586a){for(var _0x144f3a=0x0,_0x45754d=events[_0xaf09('0x7')];_0x144f3a<_0x45754d;_0x144f3a++){var _0xa95a87=events[_0x144f3a];var _0x1334d0=createListener(_0xaf09('0x8')+_0xa95a87,_0x47586a);MailInteractionEvents['on'](_0xa95a87,_0x1334d0);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index 2dd6504..a86ce37 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 _0x945a=['/:id/download','download','post','tracked','mailmessage:create','create','put','update','accept','delete','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./mailMessage.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x5c72ee,_0x5a8bf8){var _0x231876=function(_0x955276){while(--_0x955276){_0x5c72ee['push'](_0x5c72ee['shift']());}};_0x231876(++_0x5a8bf8);}(_0x945a,0x1d2));var _0xa945=function(_0x47f662,_0x4cdfde){_0x47f662=_0x47f662-0x0;var _0x29e522=_0x945a[_0x47f662];return _0x29e522;};'use strict';var multer=require('multer');var util=require(_0xa945('0x0'));var path=require(_0xa945('0x1'));var timeout=require(_0xa945('0x2'));var express=require('express');var router=express[_0xa945('0x3')]();var fs_extra=require(_0xa945('0x4'));var auth=require(_0xa945('0x5'));var interaction=require(_0xa945('0x6'));var config=require('../../config/environment');var controller=require(_0xa945('0x7'));router[_0xa945('0x8')]('/',auth[_0xa945('0x9')](),controller[_0xa945('0xa')]);router[_0xa945('0x8')](_0xa945('0xb'),auth['isAuthenticated'](),controller[_0xa945('0xc')]);router['get'](_0xa945('0xd'),auth[_0xa945('0x9')](),controller['show']);router[_0xa945('0x8')](_0xa945('0xe'),auth[_0xa945('0x9')](),controller[_0xa945('0xf')]);router[_0xa945('0x10')]('/',auth[_0xa945('0x9')](),interaction[_0xa945('0x11')]('mail',_0xa945('0x12')),controller[_0xa945('0x13')]);router[_0xa945('0x14')](_0xa945('0xd'),auth[_0xa945('0x9')](),controller[_0xa945('0x15')]);router['put']('/:id/accept',auth[_0xa945('0x9')](),controller[_0xa945('0x16')]);router[_0xa945('0x14')]('/:id/reject',auth[_0xa945('0x9')](),controller['reject']);router[_0xa945('0x17')]('/:id',auth[_0xa945('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x92d7=['isAuthenticated','/:id','show','/:id/download','post','tracked','mail','put','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailMessage.controller','get','index','/describe'];(function(_0x2080a3,_0x48acfa){var _0x8d7d17=function(_0x2dbc06){while(--_0x2dbc06){_0x2080a3['push'](_0x2080a3['shift']());}};_0x8d7d17(++_0x48acfa);}(_0x92d7,0x17b));var _0x792d=function(_0xd1500a,_0x15c5b6){_0xd1500a=_0xd1500a-0x0;var _0x49038d=_0x92d7[_0xd1500a];return _0x49038d;};'use strict';var multer=require(_0x792d('0x0'));var util=require('util');var path=require(_0x792d('0x1'));var timeout=require(_0x792d('0x2'));var express=require(_0x792d('0x3'));var router=express[_0x792d('0x4')]();var fs_extra=require(_0x792d('0x5'));var auth=require(_0x792d('0x6'));var interaction=require(_0x792d('0x7'));var config=require(_0x792d('0x8'));var controller=require(_0x792d('0x9'));router[_0x792d('0xa')]('/',auth['isAuthenticated'](),controller[_0x792d('0xb')]);router[_0x792d('0xa')](_0x792d('0xc'),auth[_0x792d('0xd')](),controller['describe']);router[_0x792d('0xa')](_0x792d('0xe'),auth[_0x792d('0xd')](),controller[_0x792d('0xf')]);router[_0x792d('0xa')](_0x792d('0x10'),auth[_0x792d('0xd')](),controller['download']);router[_0x792d('0x11')]('/',auth['isAuthenticated'](),interaction[_0x792d('0x12')](_0x792d('0x13'),'mailmessage:create'),controller['create']);router[_0x792d('0x14')](_0x792d('0xe'),auth[_0x792d('0xd')](),controller['update']);router[_0x792d('0x14')](_0x792d('0x15'),auth[_0x792d('0xd')](),controller[_0x792d('0x16')]);router[_0x792d('0x14')](_0x792d('0x17'),auth[_0x792d('0xd')](),controller[_0x792d('0x18')]);router[_0x792d('0x19')](_0x792d('0xe'),auth[_0x792d('0xd')](),controller[_0x792d('0x1a')]);module[_0x792d('0x1b')]=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index fec68c9..a69d5a7 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 _0x72f1=['medium','BOOLEAN','ENUM','out','STRING','DATE','Email','Chat','lodash','TEXT','long'];(function(_0xd1d19a,_0x1933f0){var _0x52a79d=function(_0x5199e2){while(--_0x5199e2){_0xd1d19a['push'](_0xd1d19a['shift']());}};_0x52a79d(++_0x1933f0);}(_0x72f1,0x17e));var _0x172f=function(_0x5e4d19,_0x1a198f){_0x5e4d19=_0x5e4d19-0x0;var _0x56375d=_0x72f1[_0x5e4d19];return _0x56375d;};'use strict';var Sequelize=require('sequelize');var _=require(_0x172f('0x0'));module['exports']={'body':{'type':Sequelize[_0x172f('0x1')](_0x172f('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x172f('0x1')](_0x172f('0x3'))},'read':{'type':Sequelize[_0x172f('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x172f('0x5')]('in',_0x172f('0x6')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0x172f('0x7')](0x1fe)},'from':{'type':Sequelize[_0x172f('0x7')]},'to':{'type':Sequelize[_0x172f('0x1')](_0x172f('0x2'))},'cc':{'type':Sequelize[_0x172f('0x1')](_0x172f('0x2'))},'bcc':{'type':Sequelize['TEXT']('long')},'subject':{'type':Sequelize['TEXT']},'sentAt':{'type':Sequelize[_0x172f('0x8')]},'attach':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'secret':{'type':Sequelize[_0x172f('0x4')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x172f('0x8')]},'originTo':{'type':Sequelize[_0x172f('0x1')]('long')},'originCc':{'type':Sequelize['TEXT'](_0x172f('0x2'))},'originChannel':{'type':Sequelize['ENUM'](_0x172f('0x9'),_0x172f('0xa')),'defaultValue':_0x172f('0x9'),'allowNull':![]}}; \ No newline at end of file +var _0x8553=['DATE','INTEGER','Email','Chat','sequelize','lodash','exports','TEXT','long','BOOLEAN','ENUM','out','STRING'];(function(_0x51ac9a,_0x1209cc){var _0xc9e025=function(_0x34e527){while(--_0x34e527){_0x51ac9a['push'](_0x51ac9a['shift']());}};_0xc9e025(++_0x1209cc);}(_0x8553,0x1d8));var _0x3855=function(_0x1ae825,_0x14e376){_0x1ae825=_0x1ae825-0x0;var _0x18a712=_0x8553[_0x1ae825];return _0x18a712;};'use strict';var Sequelize=require(_0x3855('0x0'));var _=require(_0x3855('0x1'));module[_0x3855('0x2')]={'body':{'type':Sequelize[_0x3855('0x3')](_0x3855('0x4')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT']('medium')},'read':{'type':Sequelize[_0x3855('0x5')],'defaultValue':![]},'direction':{'type':Sequelize[_0x3855('0x6')]('in',_0x3855('0x7')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize['STRING'](0x1fe)},'from':{'type':Sequelize[_0x3855('0x8')]},'to':{'type':Sequelize[_0x3855('0x3')](_0x3855('0x4'))},'cc':{'type':Sequelize[_0x3855('0x3')]('long')},'bcc':{'type':Sequelize[_0x3855('0x3')](_0x3855('0x4'))},'subject':{'type':Sequelize[_0x3855('0x3')]},'sentAt':{'type':Sequelize[_0x3855('0x9')]},'attach':{'type':Sequelize[_0x3855('0xa')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x3855('0x5')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x3855('0x9')]},'originTo':{'type':Sequelize['TEXT'](_0x3855('0x4'))},'originCc':{'type':Sequelize[_0x3855('0x3')](_0x3855('0x4'))},'originChannel':{'type':Sequelize['ENUM'](_0x3855('0xb'),_0x3855('0xc')),'defaultValue':_0x3855('0xb'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index aecb30d..edf5449 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 _0x6a6c=['fields','length','hasOwnProperty','nolimit','order','sort','where','pick','type','merge','options','count','includeAll','include','findAll','catch','show','params','body','find','describe','create','direction','out','secret','split','findOne','MailAccountId','CmList','List','CmContact','updatedAt','MailServerOut','Smtp','isNil','service','host','port','secure','authentication','auth','user','pass','attachments','join','basename','Contacts','ListId','SendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','stringify','read','readAt','UserId','agent','get','MailInteraction','read1stAt','[MAILMESSAGE: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','Sequelize','SELECT','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','accept','fromString','EventManager','acceptmessage','reject','mail','MailInteractionId','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','rejectMessage','QueryTypes','User','rejectmessage','download','unix','toString','root','files','tmp','server','message-%s.eml','subject','createdAt','Attachments','from','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','existsSync','push','readFileSync','build','writeFileSync','unlinkSync','moment','util','path','html-to-text','../../config/logger','../../config/environment','redis','defaults','localhost','socket.io-emitter','jayson/promise','http','client','request','info','MailMessage,\x20%s,\x20%s','request\x20sent','MailMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','status','offset','limit','undefined','set','Content-Range','json','update','then','destroy','end','sendStatus','stack','name','send','index','map','MailMessage','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes'];(function(_0x43b06b,_0x1929c7){var _0x2c555b=function(_0x30fa8c){while(--_0x30fa8c){_0x43b06b['push'](_0x43b06b['shift']());}};_0x2c555b(++_0x1929c7);}(_0x6a6c,0x71));var _0xc6a6=function(_0xa2648b,_0x3ee728){_0xa2648b=_0xa2648b-0x0;var _0x41cfcf=_0x6a6c[_0xa2648b];return _0x41cfcf;};'use strict';var emlformat=require('eml-format');var moment=require(_0xc6a6('0x0'));var BPromise=require('bluebird');var util=require(_0xc6a6('0x1'));var path=require(_0xc6a6('0x2'));var fs=require('fs');var _=require('lodash');var Redis=require('ioredis');var htmlToText=require(_0xc6a6('0x3'));var qs=require('../../components/parsers/qs');var logger=require(_0xc6a6('0x4'))('api');var interaction_log=require(_0xc6a6('0x4'))('mail-interactions');var config=require(_0xc6a6('0x5'));var db=require('../../mysqldb')['db'];config[_0xc6a6('0x6')]=_[_0xc6a6('0x7')](config[_0xc6a6('0x6')],{'host':_0xc6a6('0x8'),'port':0x18eb});var socket=require(_0xc6a6('0x9'))(new Redis(config[_0xc6a6('0x6')]));require('./mailMessage.socket')['register'](socket);var jayson=require(_0xc6a6('0xa'));var client=jayson['client'][_0xc6a6('0xb')]({'port':0x232c});var client9003=jayson[_0xc6a6('0xc')][_0xc6a6('0xb')]({'port':0x232b});var client9002=jayson[_0xc6a6('0xc')][_0xc6a6('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x389c77,_0x3b5dbe,_0x25dd11,_0x26914b){return new BPromise(function(_0x2f72e9,_0x653874){var _0x16918f=_0x26914b||client;return _0x16918f[_0xc6a6('0xd')](_0x389c77,_0x25dd11)['then'](function(_0x1e09ea){logger[_0xc6a6('0xe')](_0xc6a6('0xf'),_0x3b5dbe,_0xc6a6('0x10'));logger['debug'](_0xc6a6('0x11'),_0x3b5dbe,_0xc6a6('0x10'),JSON['stringify'](_0x1e09ea));if(_0x1e09ea[_0xc6a6('0x12')]){if(_0x1e09ea[_0xc6a6('0x12')][_0xc6a6('0x13')]===0x1f4){logger['error']('MailMessage,\x20%s,\x20%s',_0x3b5dbe,_0x1e09ea[_0xc6a6('0x12')]['message']);return _0x653874(_0x1e09ea[_0xc6a6('0x12')][_0xc6a6('0x14')]);}logger[_0xc6a6('0x12')](_0xc6a6('0xf'),_0x3b5dbe,_0x1e09ea[_0xc6a6('0x12')]['message']);return _0x2f72e9(_0x1e09ea[_0xc6a6('0x12')]['message']);}else{logger[_0xc6a6('0xe')](_0xc6a6('0xf'),_0x3b5dbe,_0xc6a6('0x10'));_0x2f72e9(_0x1e09ea[_0xc6a6('0x15')]['message']);}})['catch'](function(_0x15d3df){logger[_0xc6a6('0x12')](_0xc6a6('0xf'),_0x3b5dbe,_0x15d3df);_0x653874(_0x15d3df);});});}function respondWithResult(_0x5a2f39,_0x4b6bb6){_0x4b6bb6=_0x4b6bb6||0xc8;return function(_0x49241b){if(_0x49241b){return _0x5a2f39[_0xc6a6('0x16')](_0x4b6bb6)['json'](_0x49241b);}};}function respondWithFilteredResult(_0x302b06,_0x34da4e){return function(_0x16bb5c){if(_0x16bb5c){var _0x36e17d=typeof _0x34da4e[_0xc6a6('0x17')]==='undefined'&&typeof _0x34da4e[_0xc6a6('0x18')]===_0xc6a6('0x19');var _0x8d6bb7=_0x16bb5c['count'];var _0x4b0fa5=_0x36e17d?0x0:_0x34da4e[_0xc6a6('0x17')];var _0xf181cc=_0x36e17d?_0x16bb5c['count']:_0x34da4e[_0xc6a6('0x17')]+_0x34da4e['limit'];var _0x4ceb8d;if(_0xf181cc>=_0x8d6bb7){_0xf181cc=_0x8d6bb7;_0x4ceb8d=0xc8;}else{_0x4ceb8d=0xce;}_0x302b06[_0xc6a6('0x16')](_0x4ceb8d);return _0x302b06[_0xc6a6('0x1a')](_0xc6a6('0x1b'),_0x4b0fa5+'-'+_0xf181cc+'/'+_0x8d6bb7)[_0xc6a6('0x1c')](_0x16bb5c);}return null;};}function saveUpdates(_0x2041d4){return function(_0x58cd79){if(_0x58cd79){return _0x58cd79[_0xc6a6('0x1d')](_0x2041d4)[_0xc6a6('0x1e')](function(_0x4338ab){return _0x4338ab;});}return null;};}function removeEntity(_0x5b0f4a){return function(_0xf04994){if(_0xf04994){return _0xf04994[_0xc6a6('0x1f')]()[_0xc6a6('0x1e')](function(){_0x5b0f4a[_0xc6a6('0x16')](0xcc)[_0xc6a6('0x20')]();});}};}function handleEntityNotFound(_0x4e6c12){return function(_0x5ca89d){if(!_0x5ca89d){_0x4e6c12[_0xc6a6('0x21')](0x194);}return _0x5ca89d;};}function handleError(_0x28849c,_0x5893b8){_0x5893b8=_0x5893b8||0x1f4;return function(_0x4eee95){logger[_0xc6a6('0x12')](_0x4eee95[_0xc6a6('0x22')]);if(_0x4eee95['name']){delete _0x4eee95[_0xc6a6('0x23')];}_0x28849c[_0xc6a6('0x16')](_0x5893b8)[_0xc6a6('0x24')](_0x4eee95);};}exports[_0xc6a6('0x25')]=function(_0x5a4f38,_0x4cbca3){var _0x358e90={},_0x4a3599={},_0x2f87ec={'count':0x0,'rows':[]};var _0x1a08f3=_[_0xc6a6('0x26')](db[_0xc6a6('0x27')][_0xc6a6('0x28')],function(_0x3c23e7){return{'name':_0x3c23e7[_0xc6a6('0x29')],'type':_0x3c23e7['type'][_0xc6a6('0x2a')]};});_0x4a3599[_0xc6a6('0x2b')]=_[_0xc6a6('0x26')](_0x1a08f3,_0xc6a6('0x23'));_0x4a3599['query']=_[_0xc6a6('0x2c')](_0x5a4f38[_0xc6a6('0x2d')]);_0x4a3599[_0xc6a6('0x2e')]=_[_0xc6a6('0x2f')](_0x4a3599[_0xc6a6('0x2b')],_0x4a3599[_0xc6a6('0x2d')]);_0x358e90[_0xc6a6('0x30')]=_[_0xc6a6('0x2f')](_0x4a3599['model'],qs[_0xc6a6('0x31')](_0x5a4f38[_0xc6a6('0x2d')][_0xc6a6('0x31')]));_0x358e90[_0xc6a6('0x30')]=_0x358e90['attributes'][_0xc6a6('0x32')]?_0x358e90[_0xc6a6('0x30')]:_0x4a3599[_0xc6a6('0x2b')];if(!_0x5a4f38[_0xc6a6('0x2d')][_0xc6a6('0x33')](_0xc6a6('0x34'))){_0x358e90[_0xc6a6('0x18')]=qs[_0xc6a6('0x18')](_0x5a4f38[_0xc6a6('0x2d')]['limit']);_0x358e90[_0xc6a6('0x17')]=qs['offset'](_0x5a4f38['query']['offset']);}_0x358e90[_0xc6a6('0x35')]=qs[_0xc6a6('0x36')](_0x5a4f38['query'][_0xc6a6('0x36')]);_0x358e90[_0xc6a6('0x37')]=qs[_0xc6a6('0x2e')](_[_0xc6a6('0x38')](_0x5a4f38[_0xc6a6('0x2d')],_0x4a3599[_0xc6a6('0x2e')]),_0x1a08f3);if(_0x5a4f38[_0xc6a6('0x2d')]['filter']){_0x358e90['where']=_['merge'](_0x358e90[_0xc6a6('0x37')],{'$or':_[_0xc6a6('0x26')](_0x1a08f3,function(_0x485d52){if(_0x485d52[_0xc6a6('0x39')]!=='VIRTUAL'){var _0x22f8ea={};_0x22f8ea[_0x485d52[_0xc6a6('0x23')]]={'$like':'%'+_0x5a4f38['query']['filter']+'%'};return _0x22f8ea;}})});}_0x358e90=_[_0xc6a6('0x3a')]({},_0x358e90,_0x5a4f38[_0xc6a6('0x3b')]);var _0x4e81ac={'where':_0x358e90[_0xc6a6('0x37')]};return db[_0xc6a6('0x27')][_0xc6a6('0x3c')](_0x4e81ac)[_0xc6a6('0x1e')](function(_0x10f8e4){_0x2f87ec['count']=_0x10f8e4;if(_0x5a4f38['query'][_0xc6a6('0x3d')]){_0x358e90[_0xc6a6('0x3e')]=[{'all':!![]}];}return db[_0xc6a6('0x27')][_0xc6a6('0x3f')](_0x358e90);})['then'](function(_0x50ca6b){_0x2f87ec['rows']=_0x50ca6b;return _0x2f87ec;})[_0xc6a6('0x1e')](respondWithFilteredResult(_0x4cbca3,_0x358e90))[_0xc6a6('0x40')](handleError(_0x4cbca3,null));};exports[_0xc6a6('0x41')]=function(_0x2e9927,_0x19f5df){var _0x263898={'raw':!![],'where':{'id':_0x2e9927[_0xc6a6('0x42')]['id']}},_0x45c148={};_0x45c148[_0xc6a6('0x2b')]=_[_0xc6a6('0x2c')](db[_0xc6a6('0x27')]['rawAttributes']);_0x45c148['query']=_[_0xc6a6('0x2c')](_0x2e9927[_0xc6a6('0x2d')]);_0x45c148[_0xc6a6('0x2e')]=_[_0xc6a6('0x2f')](_0x45c148['model'],_0x45c148[_0xc6a6('0x2d')]);_0x263898[_0xc6a6('0x30')]=_[_0xc6a6('0x2f')](_0x45c148[_0xc6a6('0x2b')],qs['fields'](_0x2e9927[_0xc6a6('0x2d')][_0xc6a6('0x31')]));_0x263898[_0xc6a6('0x30')]=_0x263898[_0xc6a6('0x30')][_0xc6a6('0x32')]?_0x263898[_0xc6a6('0x30')]:_0x45c148[_0xc6a6('0x2b')];if(_0x2e9927[_0xc6a6('0x2d')]['includeAll']){_0x263898[_0xc6a6('0x3e')]=[{'all':!![]}];}_0x263898=_['merge']({},_0x263898,_0x2e9927[_0xc6a6('0x3b')]);return db[_0xc6a6('0x27')]['find'](_0x263898)[_0xc6a6('0x1e')](handleEntityNotFound(_0x19f5df,null))[_0xc6a6('0x1e')](respondWithResult(_0x19f5df,null))['catch'](handleError(_0x19f5df,null));};exports[_0xc6a6('0x1d')]=function(_0x4e24a7,_0x48b0b1){if(_0x4e24a7[_0xc6a6('0x43')]['id']){delete _0x4e24a7[_0xc6a6('0x43')]['id'];}return db[_0xc6a6('0x27')][_0xc6a6('0x44')]({'where':{'id':_0x4e24a7[_0xc6a6('0x42')]['id']}})[_0xc6a6('0x1e')](handleEntityNotFound(_0x48b0b1,null))['then'](saveUpdates(_0x4e24a7[_0xc6a6('0x43')],null))[_0xc6a6('0x1e')](respondWithResult(_0x48b0b1,null))['catch'](handleError(_0x48b0b1,null));};exports[_0xc6a6('0x1f')]=function(_0x4d3e7f,_0x446866){return db[_0xc6a6('0x27')]['find']({'where':{'id':_0x4d3e7f[_0xc6a6('0x42')]['id']}})['then'](handleEntityNotFound(_0x446866,null))[_0xc6a6('0x1e')](removeEntity(_0x446866,null))[_0xc6a6('0x40')](handleError(_0x446866,null));};exports[_0xc6a6('0x45')]=function(_0x306c33,_0x2394ac){return db[_0xc6a6('0x27')][_0xc6a6('0x45')]()[_0xc6a6('0x1e')](respondWithResult(_0x2394ac,null))['catch'](handleError(_0x2394ac,null));};exports[_0xc6a6('0x46')]=function(_0x127cc8,_0x17ab04){return db['MailMessage'][_0xc6a6('0x46')](_0x127cc8['body'])[_0xc6a6('0x1e')](function(_0x3c11d1){if(_0x3c11d1){if(_0x3c11d1[_0xc6a6('0x47')]===_0xc6a6('0x48')&&!_0x3c11d1[_0xc6a6('0x49')]){var _0x46583e,_0x419002,_0x5635e7;if(_0x127cc8[_0xc6a6('0x43')]['to']){_0x419002=_0x127cc8['body']['to'][_0xc6a6('0x4a')](',')[0x0];}return db['MailAccount'][_0xc6a6('0x4b')]({'where':{'id':_0x3c11d1[_0xc6a6('0x4c')]},'include':[{'model':db[_0xc6a6('0x4d')],'as':_0xc6a6('0x4e'),'include':[{'model':db[_0xc6a6('0x4f')],'as':'Contacts','where':{'email':_0x419002},'limit':0x1,'order':[[_0xc6a6('0x50'),'DESC']]}]},{'model':db[_0xc6a6('0x51')],'as':'Smtp','raw':!![]}]})[_0xc6a6('0x1e')](function(_0x247336){_0x46583e=_0x247336;if(_0x46583e&&_0x46583e[_0xc6a6('0x52')]){var _0xd2e42b={'tls':{'rejectUnauthorized':![]}};if(_[_0xc6a6('0x53')](_0x46583e[_0xc6a6('0x52')][_0xc6a6('0x54')])){_0xd2e42b[_0xc6a6('0x55')]=_0x46583e['Smtp'][_0xc6a6('0x55')];_0xd2e42b['port']=_0x46583e[_0xc6a6('0x52')][_0xc6a6('0x56')];_0xd2e42b[_0xc6a6('0x57')]=_0x46583e[_0xc6a6('0x52')]['secure'];if(_0x46583e[_0xc6a6('0x52')][_0xc6a6('0x58')]){_0xd2e42b[_0xc6a6('0x59')]={'user':_0x46583e['Smtp'][_0xc6a6('0x5a')],'pass':_0x46583e[_0xc6a6('0x52')]['pass']};}}else{_0xd2e42b[_0xc6a6('0x54')]=_0x46583e[_0xc6a6('0x52')][_0xc6a6('0x54')];_0xd2e42b[_0xc6a6('0x59')]={'user':_0x46583e[_0xc6a6('0x52')][_0xc6a6('0x5a')],'pass':_0x46583e[_0xc6a6('0x52')][_0xc6a6('0x5b')]};_0xd2e42b[_0xc6a6('0x57')]=_0x46583e[_0xc6a6('0x52')][_0xc6a6('0x57')];}if(_0x127cc8[_0xc6a6('0x43')][_0xc6a6('0x5c')]&&_0x127cc8[_0xc6a6('0x43')][_0xc6a6('0x5c')][_0xc6a6('0x32')]){for(var _0x4937c2=0x0;_0x4937c2<_0x127cc8[_0xc6a6('0x43')][_0xc6a6('0x5c')][_0xc6a6('0x32')];_0x4937c2+=0x1){_0x127cc8['body']['attachments'][_0x4937c2]={'filename':_0x127cc8[_0xc6a6('0x43')][_0xc6a6('0x5c')][_0x4937c2]['name'],'path':path[_0xc6a6('0x5d')](config['root'],'server/files/attachments',_0x127cc8[_0xc6a6('0x43')][_0xc6a6('0x5c')][_0x4937c2][_0xc6a6('0x5e')])};}}_0x5635e7={'account':_0xd2e42b,'message':_0x127cc8['body']};return;}})[_0xc6a6('0x1e')](function(){if(_0x46583e[_0xc6a6('0x4e')]){if(_0x46583e[_0xc6a6('0x4e')][_0xc6a6('0x5f')][_0xc6a6('0x32')]){return _0x46583e[_0xc6a6('0x4e')]['Contacts'][0x0];}else{return db['CmContact'][_0xc6a6('0x46')](_[_0xc6a6('0x7')](_0x127cc8[_0xc6a6('0x43')],{'firstName':_0x127cc8[_0xc6a6('0x43')]['to'],'email':_0x127cc8[_0xc6a6('0x43')]['to'],'phone':_0x127cc8['body']['to'],'ListId':_0x46583e[_0xc6a6('0x60')]}));}}else{throw new Error('List\x20not\x20found');}})[_0xc6a6('0x1e')](function(){if(_0x5635e7){return respondWithRpcPromise(_0xc6a6('0x61'),'sendMail',_0x5635e7,client9003)[_0xc6a6('0x1e')](function(_0x51f3e8){return _0x3c11d1[_0xc6a6('0x1d')]({'read':!![],'messageId':_0x51f3e8[_0xc6a6('0x62')],'sentAt':moment()[_0xc6a6('0x63')](_0xc6a6('0x64'))});})[_0xc6a6('0x40')](function(_0x3687a2){logger['error']('%s',JSON[_0xc6a6('0x65')](_0x3687a2));return _0x3c11d1;});}return _0x3c11d1;});}return _0x3c11d1;}})[_0xc6a6('0x1e')](respondWithResult(_0x17ab04,0xc9))['catch'](handleError(_0x17ab04,null));};exports['accept']=function(_0x1bba52,_0x3808da){var _0x30c3d9={'agent':{},'channel':'mail'};if(_0x1bba52[_0xc6a6('0x43')]['id']){delete _0x1bba52[_0xc6a6('0x43')]['id'];}_0x1bba52['body'][_0xc6a6('0x66')]=!![];_0x1bba52['body'][_0xc6a6('0x67')]=moment()[_0xc6a6('0x63')](_0xc6a6('0x64'));_0x1bba52[_0xc6a6('0x43')][_0xc6a6('0x68')]=_0x1bba52['body'][_0xc6a6('0x68')]||_0x1bba52[_0xc6a6('0x5a')]['id'];_0x30c3d9[_0xc6a6('0x69')]['id']=_0x1bba52['body'][_0xc6a6('0x68')];return db[_0xc6a6('0x27')][_0xc6a6('0x44')]({'where':{'id':_0x1bba52[_0xc6a6('0x42')]['id'],'UserId':null}})[_0xc6a6('0x1e')](handleEntityNotFound(_0x3808da,null))[_0xc6a6('0x1e')](saveUpdates(_0x1bba52[_0xc6a6('0x43')],null))[_0xc6a6('0x1e')](function(_0x4e3db8){if(_0x4e3db8){_0x30c3d9[_0xc6a6('0x14')]=_0x4e3db8[_0xc6a6('0x6a')]({'plain':!![]});return db[_0xc6a6('0x6b')][_0xc6a6('0x44')]({'where':{'id':_0x4e3db8['MailInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x3808da,null))[_0xc6a6('0x1e')](function(_0x5d7c3b){if(_0x5d7c3b){return _0x5d7c3b[_0xc6a6('0x1d')]({'UserId':_0x1bba52['body']['UserId'],'read1stAt':_[_0xc6a6('0x53')](_0x5d7c3b[_0xc6a6('0x6c')])?moment()[_0xc6a6('0x63')](_0xc6a6('0x64')):undefined});}return null;})[_0xc6a6('0x1e')](function(_0x261ca3){if(_0x261ca3){_0x30c3d9['interaction']=_0x261ca3[_0xc6a6('0x6a')]({'plain':!![]});interaction_log[_0xc6a6('0xe')](_0xc6a6('0x6d'),_0x1bba52[_0xc6a6('0x5a')]['id'],_0x1bba52[_0xc6a6('0x5a')][_0xc6a6('0x23')],_0x1bba52[_0xc6a6('0x5a')]['role'],_0x30c3d9[_0xc6a6('0x6e')]['id'],_0x1bba52[_0xc6a6('0x43')]?JSON['stringify'](_0x1bba52[_0xc6a6('0x43')]):_0xc6a6('0x6f'));return respondWithRpcPromise(_0xc6a6('0x70'),_0xc6a6('0x71'),_0x30c3d9);}return null;})[_0xc6a6('0x1e')](function(_0x4d12b8){var _0x6c0c33=_0xc6a6('0x72')+_0x4d12b8['message'][_0xc6a6('0x73')];return db[_0xc6a6('0x74')]['query'](_0x6c0c33,{'type':db[_0xc6a6('0x75')]['QueryTypes'][_0xc6a6('0x76')],'raw':!![]})[_0xc6a6('0x1e')](function(_0x4d4fce){return _0x4d4fce;});})['then'](function(_0x35c200){if(_0x35c200){_0x30c3d9[_0xc6a6('0x14')]['contact']=_0x35c200[0x0];if(!_0x1bba52[_0xc6a6('0x43')]['UserId'])return;return db['User'][_0xc6a6('0x44')]({'where':{'id':_0x1bba52['body']['UserId'],'role':_0xc6a6('0x69')},'attributes':['id','name',_0xc6a6('0x77'),_0xc6a6('0x78'),_0xc6a6('0x79')],'raw':!![]});}return null;})[_0xc6a6('0x1e')](function(_0xd4ecba){if(!_0xd4ecba)return null;_0x30c3d9['message'][_0xc6a6('0x69')]=_0xd4ecba;return _0x30c3d9;})[_0xc6a6('0x1e')](function(_0x13cecc){if(_0x13cecc){if(_0x1bba52[_0xc6a6('0x43')][_0xc6a6('0x7a')]){_0x30c3d9[_0xc6a6('0x14')][_0xc6a6('0x7b')]=util[_0xc6a6('0x63')](_0xc6a6('0x7c'),_0x1bba52[_0xc6a6('0x5a')][_0xc6a6('0x23')]);_0x30c3d9[_0xc6a6('0x14')]['channel']=_0x30c3d9[_0xc6a6('0x7d')];_0x30c3d9[_0xc6a6('0x14')][_0xc6a6('0x7e')]=_0x30c3d9[_0xc6a6('0x7d')];_0x30c3d9[_0xc6a6('0x14')][_0xc6a6('0x7f')]=_0xc6a6('0x80');_0x30c3d9['message'][_0xc6a6('0x43')]=htmlToText[_0xc6a6('0x81')](_0x30c3d9['message'][_0xc6a6('0x43')]);return respondWithRpcPromise(_0xc6a6('0x82'),'EventManager',{'event':_0xc6a6('0x83'),'message':_0x30c3d9[_0xc6a6('0x14')]},client9002)[_0xc6a6('0x1e')](function(){return _0x30c3d9;});}return _0x30c3d9;}return null;})[_0xc6a6('0x1e')](respondWithResult(_0x3808da,null))[_0xc6a6('0x40')](handleError(_0x3808da,null));};exports[_0xc6a6('0x84')]=function(_0x544d80,_0x490276){var _0x219e97={'agent':{},'channel':_0xc6a6('0x85')};if(_0x544d80['body']['id']){delete _0x544d80[_0xc6a6('0x43')]['id'];}_0x544d80['body'][_0xc6a6('0x68')]=_0x544d80[_0xc6a6('0x43')][_0xc6a6('0x68')]||_0x544d80[_0xc6a6('0x5a')]['id'];_0x219e97[_0xc6a6('0x69')]['id']=_0x544d80['body']['UserId'];return db[_0xc6a6('0x27')][_0xc6a6('0x44')]({'where':{'id':_0x544d80['params']['id'],'UserId':null}})[_0xc6a6('0x1e')](handleEntityNotFound(_0x490276,null))[_0xc6a6('0x1e')](function(_0x5e28f0){if(_0x5e28f0){_0x219e97['message']=_0x5e28f0[_0xc6a6('0x6a')]({'plain':!![]});return db[_0xc6a6('0x6b')][_0xc6a6('0x44')]({'where':{'id':_0x5e28f0[_0xc6a6('0x86')]}});}return null;})[_0xc6a6('0x1e')](handleEntityNotFound(_0x490276,null))[_0xc6a6('0x1e')](function(_0x44a470){if(_0x44a470){_0x219e97[_0xc6a6('0x6e')]=_0x44a470[_0xc6a6('0x6a')]({'plain':!![]});interaction_log[_0xc6a6('0xe')](_0xc6a6('0x87'),_0x544d80[_0xc6a6('0x5a')]['id'],_0x544d80[_0xc6a6('0x5a')][_0xc6a6('0x23')],_0x544d80[_0xc6a6('0x5a')][_0xc6a6('0x88')],_0x219e97[_0xc6a6('0x6e')]['id'],_0x544d80[_0xc6a6('0x43')]?JSON[_0xc6a6('0x65')](_0x544d80[_0xc6a6('0x43')]):'null');return respondWithRpcPromise('RejectMessage',_0xc6a6('0x89'),_0x219e97);}return null;})[_0xc6a6('0x1e')](function(_0x10ea53){var _0x37ed6f=_0xc6a6('0x72')+_0x10ea53[_0xc6a6('0x14')]['ContactId'];return db[_0xc6a6('0x74')][_0xc6a6('0x2d')](_0x37ed6f,{'type':db[_0xc6a6('0x75')][_0xc6a6('0x8a')][_0xc6a6('0x76')],'raw':!![]})[_0xc6a6('0x1e')](function(_0x172afa){return _0x172afa;});})['then'](function(_0x2ead56){if(_0x2ead56){_0x219e97['message']['contact']=_0x2ead56[0x0];if(!_0x544d80['body']['UserId'])return;return db[_0xc6a6('0x8b')][_0xc6a6('0x44')]({'where':{'id':_0x544d80['body'][_0xc6a6('0x68')],'role':_0xc6a6('0x69')},'attributes':['id',_0xc6a6('0x23'),_0xc6a6('0x77'),_0xc6a6('0x78'),'internal'],'raw':!![]});}return null;})[_0xc6a6('0x1e')](function(_0x4f642c){if(!_0x4f642c)return null;_0x219e97[_0xc6a6('0x14')][_0xc6a6('0x69')]=_0x4f642c;return _0x219e97;})[_0xc6a6('0x1e')](function(_0x121aba){if(_0x121aba){_0x121aba['message'][_0xc6a6('0x7b')]=util[_0xc6a6('0x63')](_0xc6a6('0x7c'),_0x544d80[_0xc6a6('0x5a')][_0xc6a6('0x23')]);_0x121aba[_0xc6a6('0x14')][_0xc6a6('0x7d')]=_0x219e97[_0xc6a6('0x7d')];_0x121aba[_0xc6a6('0x14')][_0xc6a6('0x7e')]=_0x219e97[_0xc6a6('0x7d')];_0x121aba['message'][_0xc6a6('0x7f')]=_0xc6a6('0x84');_0x121aba[_0xc6a6('0x14')][_0xc6a6('0x43')]=htmlToText[_0xc6a6('0x81')](_0x219e97[_0xc6a6('0x14')]['body']);respondWithRpcPromise(_0xc6a6('0x82'),'EventManager',{'event':_0xc6a6('0x8c'),'message':_0x121aba[_0xc6a6('0x14')]},client9002);return _0x219e97;}return null;})[_0xc6a6('0x1e')](respondWithResult(_0x490276,null))[_0xc6a6('0x40')](handleError(_0x490276,null));};exports[_0xc6a6('0x8d')]=function(_0x3aad58,_0x278b21){var _0x5b6571=moment()[_0xc6a6('0x8e')]()[_0xc6a6('0x8f')]();var _0x58c2ea=path['join'](config[_0xc6a6('0x90')],'server',_0xc6a6('0x91'),_0xc6a6('0x92'));var _0x3fa8a4=path['join'](config['root'],_0xc6a6('0x93'),_0xc6a6('0x91'),_0xc6a6('0x5c'));var _0x46538d=util[_0xc6a6('0x63')](_0xc6a6('0x94'),_0x5b6571);return db[_0xc6a6('0x27')]['find']({'where':{'id':_0x3aad58[_0xc6a6('0x42')]['id']},'attributes':['id','body','from','to','cc','bcc',_0xc6a6('0x95'),_0xc6a6('0x96')],'include':_0x3aad58[_0xc6a6('0x2d')]['attachments']?[{'model':db['Attachment'],'as':_0xc6a6('0x97')}]:undefined})[_0xc6a6('0x1e')](handleEntityNotFound(_0x278b21,null))[_0xc6a6('0x1e')](function(_0x5f4869){if(_0x5f4869){var _0x1619df=_0x5f4869;var _0xbb8c43={'from':_0x1619df[_0xc6a6('0x98')],'to':_0x1619df['to'],'subject':_0x1619df['subject'],'html':_0x1619df[_0xc6a6('0x43')],'headers':{'Date':moment(_0x1619df['createdAt'])[_0xc6a6('0x63')](_0xc6a6('0x99'))},'attachments':[]};if(_0x5f4869['cc']){_0xbb8c43[_0xc6a6('0x9a')]['Cc']=_0x5f4869['cc'];}if(_0x5f4869['bcc']){_0xbb8c43[_0xc6a6('0x9a')][_0xc6a6('0x9b')]=_0x5f4869['bcc'];}return new BPromise(function(_0x4fb17b,_0x5a63bc){if(_0x5f4869[_0xc6a6('0x97')]){for(var _0x36e6e7=0x0;_0x36e6e7<_0x5f4869[_0xc6a6('0x97')]['length'];_0x36e6e7++){var _0x4adcc7=_0x5f4869[_0xc6a6('0x97')][_0x36e6e7];var _0x20c0b8=path[_0xc6a6('0x5d')](_0x3fa8a4,_0x4adcc7[_0xc6a6('0x5e')]);if(fs[_0xc6a6('0x9c')](_0x20c0b8)){_0xbb8c43[_0xc6a6('0x5c')][_0xc6a6('0x9d')]({'name':_0x4adcc7[_0xc6a6('0x23')],'contentType':_0x4adcc7[_0xc6a6('0x39')],'data':fs[_0xc6a6('0x9e')](_0x20c0b8)});}}}emlformat[_0xc6a6('0x9f')](_0xbb8c43,function(_0x2ccc98,_0x309b4c){if(_0x2ccc98)return _0x5a63bc(_0x2ccc98);fs[_0xc6a6('0xa0')](path[_0xc6a6('0x5d')](_0x58c2ea,_0x46538d),_0x309b4c);return _0x4fb17b(_0x309b4c);});});}})[_0xc6a6('0x1e')](function(_0xaaee8b){if(_0xaaee8b){return _0x278b21[_0xc6a6('0x8d')](path[_0xc6a6('0x5d')](_0x58c2ea,_0x46538d),_0x46538d,function(_0x34c4b5){if(!_0x34c4b5)fs[_0xc6a6('0xa1')](path[_0xc6a6('0x5d')](_0x58c2ea,_0x46538d));});}})[_0xc6a6('0x40')](handleError(_0x278b21,null));}; \ No newline at end of file +var _0x37d8=['defaults','socket.io-emitter','./mailMessage.socket','jayson/promise','client','http','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','status','json','offset','undefined','limit','count','set','end','sendStatus','index','map','MailMessage','rawAttributes','fieldName','type','model','name','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','findAll','rows','show','params','include','options','find','update','body','catch','describe','create','direction','out','secret','split','findOne','MailAccountId','CmList','CmContact','Contacts','updatedAt','DESC','Smtp','service','host','port','secure','authentication','auth','pass','user','attachments','length','join','root','server/files/attachments','basename','List','ListId','List\x20not\x20found','format','YYYY-MM-DD\x20HH:mm:ss','accept','mail','read','readAt','UserId','agent','get','MailInteraction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','AcceptMessage','acceptMessage','ContactId','sequelize','Sequelize','QueryTypes','SELECT','User','fullname','email','interface','SIP/%s','channel','fromString','EventManager','acceptmessage','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','contact','motionChannel','event','reject','rejectmessage','download','unix','toString','server','files','from','subject','Attachments','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','bcc','Bcc','existsSync','push','readFileSync','build','writeFileSync','unlinkSync','eml-format','bluebird','util','path','lodash','../../components/parsers/qs','api','../../config/logger','../../config/environment','redis'];(function(_0x4c4ca2,_0x30d812){var _0x17dac3=function(_0x4f07e6){while(--_0x4f07e6){_0x4c4ca2['push'](_0x4c4ca2['shift']());}};_0x17dac3(++_0x30d812);}(_0x37d8,0x94));var _0x837d=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x37d8[_0x501510];return _0x1e6ee5;};'use strict';var emlformat=require(_0x837d('0x0'));var moment=require('moment');var BPromise=require(_0x837d('0x1'));var util=require(_0x837d('0x2'));var path=require(_0x837d('0x3'));var fs=require('fs');var _=require(_0x837d('0x4'));var Redis=require('ioredis');var htmlToText=require('html-to-text');var qs=require(_0x837d('0x5'));var logger=require('../../config/logger')(_0x837d('0x6'));var interaction_log=require(_0x837d('0x7'))('mail-interactions');var config=require(_0x837d('0x8'));var db=require('../../mysqldb')['db'];config[_0x837d('0x9')]=_[_0x837d('0xa')](config[_0x837d('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x837d('0xb'))(new Redis(config[_0x837d('0x9')]));require(_0x837d('0xc'))['register'](socket);var jayson=require(_0x837d('0xd'));var client=jayson[_0x837d('0xe')][_0x837d('0xf')]({'port':0x232c});var client9003=jayson[_0x837d('0xe')]['http']({'port':0x232b});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2e3f82,_0x5618cc,_0x3de028,_0xb91d77){return new BPromise(function(_0x5bfcb4,_0x32f5a1){var _0x2e90b0=_0xb91d77||client;return _0x2e90b0[_0x837d('0x10')](_0x2e3f82,_0x3de028)[_0x837d('0x11')](function(_0x5ceb72){logger[_0x837d('0x12')](_0x837d('0x13'),_0x5618cc,_0x837d('0x14'));logger[_0x837d('0x15')](_0x837d('0x16'),_0x5618cc,_0x837d('0x14'),JSON[_0x837d('0x17')](_0x5ceb72));if(_0x5ceb72[_0x837d('0x18')]){if(_0x5ceb72['error'][_0x837d('0x19')]===0x1f4){logger[_0x837d('0x18')](_0x837d('0x13'),_0x5618cc,_0x5ceb72[_0x837d('0x18')][_0x837d('0x1a')]);return _0x32f5a1(_0x5ceb72[_0x837d('0x18')][_0x837d('0x1a')]);}logger[_0x837d('0x18')](_0x837d('0x13'),_0x5618cc,_0x5ceb72[_0x837d('0x18')]['message']);return _0x5bfcb4(_0x5ceb72[_0x837d('0x18')][_0x837d('0x1a')]);}else{logger['info']('MailMessage,\x20%s,\x20%s',_0x5618cc,_0x837d('0x14'));_0x5bfcb4(_0x5ceb72[_0x837d('0x1b')][_0x837d('0x1a')]);}})['catch'](function(_0x21f4cc){logger[_0x837d('0x18')](_0x837d('0x13'),_0x5618cc,_0x21f4cc);_0x32f5a1(_0x21f4cc);});});}function respondWithResult(_0x1d3a26,_0x1cd813){_0x1cd813=_0x1cd813||0xc8;return function(_0x1ec260){if(_0x1ec260){return _0x1d3a26[_0x837d('0x1c')](_0x1cd813)[_0x837d('0x1d')](_0x1ec260);}};}function respondWithFilteredResult(_0xdd6dcf,_0x329c49){return function(_0x5446a4){if(_0x5446a4){var _0x5e128d=typeof _0x329c49[_0x837d('0x1e')]===_0x837d('0x1f')&&typeof _0x329c49[_0x837d('0x20')]==='undefined';var _0x3c2fa8=_0x5446a4[_0x837d('0x21')];var _0x4d2d3e=_0x5e128d?0x0:_0x329c49[_0x837d('0x1e')];var _0x1269b0=_0x5e128d?_0x5446a4[_0x837d('0x21')]:_0x329c49[_0x837d('0x1e')]+_0x329c49['limit'];var _0x2198e8;if(_0x1269b0>=_0x3c2fa8){_0x1269b0=_0x3c2fa8;_0x2198e8=0xc8;}else{_0x2198e8=0xce;}_0xdd6dcf[_0x837d('0x1c')](_0x2198e8);return _0xdd6dcf[_0x837d('0x22')]('Content-Range',_0x4d2d3e+'-'+_0x1269b0+'/'+_0x3c2fa8)[_0x837d('0x1d')](_0x5446a4);}return null;};}function saveUpdates(_0x5a1ec7){return function(_0x1d1781){if(_0x1d1781){return _0x1d1781['update'](_0x5a1ec7)['then'](function(_0x429929){return _0x429929;});}return null;};}function removeEntity(_0x368b47){return function(_0x25be16){if(_0x25be16){return _0x25be16['destroy']()['then'](function(){_0x368b47['status'](0xcc)[_0x837d('0x23')]();});}};}function handleEntityNotFound(_0xc85e08){return function(_0x4d36ca){if(!_0x4d36ca){_0xc85e08[_0x837d('0x24')](0x194);}return _0x4d36ca;};}function handleError(_0x14f125,_0x6d0b09){_0x6d0b09=_0x6d0b09||0x1f4;return function(_0x38adc6){logger[_0x837d('0x18')](_0x38adc6['stack']);if(_0x38adc6['name']){delete _0x38adc6['name'];}_0x14f125[_0x837d('0x1c')](_0x6d0b09)['send'](_0x38adc6);};}exports[_0x837d('0x25')]=function(_0x157688,_0x725aa3){var _0x3f3db2={},_0x4d3a1c={},_0x346895={'count':0x0,'rows':[]};var _0x2070c6=_[_0x837d('0x26')](db[_0x837d('0x27')][_0x837d('0x28')],function(_0x14aee0){return{'name':_0x14aee0[_0x837d('0x29')],'type':_0x14aee0[_0x837d('0x2a')]['key']};});_0x4d3a1c[_0x837d('0x2b')]=_['map'](_0x2070c6,_0x837d('0x2c'));_0x4d3a1c[_0x837d('0x2d')]=_[_0x837d('0x2e')](_0x157688['query']);_0x4d3a1c[_0x837d('0x2f')]=_[_0x837d('0x30')](_0x4d3a1c['model'],_0x4d3a1c[_0x837d('0x2d')]);_0x3f3db2[_0x837d('0x31')]=_[_0x837d('0x30')](_0x4d3a1c[_0x837d('0x2b')],qs[_0x837d('0x32')](_0x157688[_0x837d('0x2d')][_0x837d('0x32')]));_0x3f3db2['attributes']=_0x3f3db2[_0x837d('0x31')]['length']?_0x3f3db2[_0x837d('0x31')]:_0x4d3a1c[_0x837d('0x2b')];if(!_0x157688['query'][_0x837d('0x33')](_0x837d('0x34'))){_0x3f3db2[_0x837d('0x20')]=qs['limit'](_0x157688['query'][_0x837d('0x20')]);_0x3f3db2[_0x837d('0x1e')]=qs[_0x837d('0x1e')](_0x157688[_0x837d('0x2d')][_0x837d('0x1e')]);}_0x3f3db2[_0x837d('0x35')]=qs['sort'](_0x157688[_0x837d('0x2d')][_0x837d('0x36')]);_0x3f3db2[_0x837d('0x37')]=qs['filters'](_[_0x837d('0x38')](_0x157688['query'],_0x4d3a1c[_0x837d('0x2f')]),_0x2070c6);if(_0x157688['query']['filter']){_0x3f3db2[_0x837d('0x37')]=_[_0x837d('0x39')](_0x3f3db2[_0x837d('0x37')],{'$or':_[_0x837d('0x26')](_0x2070c6,function(_0x56f9b7){if(_0x56f9b7[_0x837d('0x2a')]!==_0x837d('0x3a')){var _0x3e772a={};_0x3e772a[_0x56f9b7[_0x837d('0x2c')]]={'$like':'%'+_0x157688[_0x837d('0x2d')][_0x837d('0x3b')]+'%'};return _0x3e772a;}})});}_0x3f3db2=_[_0x837d('0x39')]({},_0x3f3db2,_0x157688['options']);var _0x29c9c4={'where':_0x3f3db2[_0x837d('0x37')]};return db[_0x837d('0x27')][_0x837d('0x21')](_0x29c9c4)[_0x837d('0x11')](function(_0x4c7f10){_0x346895[_0x837d('0x21')]=_0x4c7f10;if(_0x157688['query'][_0x837d('0x3c')]){_0x3f3db2['include']=[{'all':!![]}];}return db['MailMessage'][_0x837d('0x3d')](_0x3f3db2);})['then'](function(_0x3b8cb5){_0x346895[_0x837d('0x3e')]=_0x3b8cb5;return _0x346895;})['then'](respondWithFilteredResult(_0x725aa3,_0x3f3db2))['catch'](handleError(_0x725aa3,null));};exports[_0x837d('0x3f')]=function(_0x2fe62d,_0x527f91){var _0x202355={'raw':!![],'where':{'id':_0x2fe62d[_0x837d('0x40')]['id']}},_0x2b4bd6={};_0x2b4bd6[_0x837d('0x2b')]=_[_0x837d('0x2e')](db[_0x837d('0x27')][_0x837d('0x28')]);_0x2b4bd6[_0x837d('0x2d')]=_[_0x837d('0x2e')](_0x2fe62d[_0x837d('0x2d')]);_0x2b4bd6['filters']=_[_0x837d('0x30')](_0x2b4bd6[_0x837d('0x2b')],_0x2b4bd6['query']);_0x202355[_0x837d('0x31')]=_[_0x837d('0x30')](_0x2b4bd6['model'],qs[_0x837d('0x32')](_0x2fe62d[_0x837d('0x2d')][_0x837d('0x32')]));_0x202355[_0x837d('0x31')]=_0x202355[_0x837d('0x31')]['length']?_0x202355[_0x837d('0x31')]:_0x2b4bd6[_0x837d('0x2b')];if(_0x2fe62d['query'][_0x837d('0x3c')]){_0x202355[_0x837d('0x41')]=[{'all':!![]}];}_0x202355=_[_0x837d('0x39')]({},_0x202355,_0x2fe62d[_0x837d('0x42')]);return db[_0x837d('0x27')][_0x837d('0x43')](_0x202355)[_0x837d('0x11')](handleEntityNotFound(_0x527f91,null))['then'](respondWithResult(_0x527f91,null))['catch'](handleError(_0x527f91,null));};exports[_0x837d('0x44')]=function(_0x456c87,_0x215133){if(_0x456c87[_0x837d('0x45')]['id']){delete _0x456c87['body']['id'];}return db['MailMessage'][_0x837d('0x43')]({'where':{'id':_0x456c87[_0x837d('0x40')]['id']}})[_0x837d('0x11')](handleEntityNotFound(_0x215133,null))[_0x837d('0x11')](saveUpdates(_0x456c87[_0x837d('0x45')],null))[_0x837d('0x11')](respondWithResult(_0x215133,null))[_0x837d('0x46')](handleError(_0x215133,null));};exports['destroy']=function(_0x3eda4a,_0xa7876e){return db[_0x837d('0x27')][_0x837d('0x43')]({'where':{'id':_0x3eda4a[_0x837d('0x40')]['id']}})['then'](handleEntityNotFound(_0xa7876e,null))['then'](removeEntity(_0xa7876e,null))[_0x837d('0x46')](handleError(_0xa7876e,null));};exports['describe']=function(_0x36cfc7,_0x3063ef){return db['MailMessage'][_0x837d('0x47')]()[_0x837d('0x11')](respondWithResult(_0x3063ef,null))[_0x837d('0x46')](handleError(_0x3063ef,null));};exports[_0x837d('0x48')]=function(_0x2ef641,_0x3e3a72){return db[_0x837d('0x27')][_0x837d('0x48')](_0x2ef641[_0x837d('0x45')])[_0x837d('0x11')](function(_0x1d02e9){if(_0x1d02e9){if(_0x1d02e9[_0x837d('0x49')]===_0x837d('0x4a')&&!_0x1d02e9[_0x837d('0x4b')]){var _0x79b451,_0x548141,_0x58e7f0;if(_0x2ef641['body']['to']){_0x548141=_0x2ef641['body']['to'][_0x837d('0x4c')](',')[0x0];}return db['MailAccount'][_0x837d('0x4d')]({'where':{'id':_0x1d02e9[_0x837d('0x4e')]},'include':[{'model':db[_0x837d('0x4f')],'as':'List','include':[{'model':db[_0x837d('0x50')],'as':_0x837d('0x51'),'where':{'email':_0x548141},'limit':0x1,'order':[[_0x837d('0x52'),_0x837d('0x53')]]}]},{'model':db['MailServerOut'],'as':'Smtp','raw':!![]}]})[_0x837d('0x11')](function(_0x5b0432){_0x79b451=_0x5b0432;if(_0x79b451&&_0x79b451['Smtp']){var _0x4d7d03={'tls':{'rejectUnauthorized':![]}};if(_['isNil'](_0x79b451[_0x837d('0x54')][_0x837d('0x55')])){_0x4d7d03[_0x837d('0x56')]=_0x79b451[_0x837d('0x54')][_0x837d('0x56')];_0x4d7d03[_0x837d('0x57')]=_0x79b451[_0x837d('0x54')][_0x837d('0x57')];_0x4d7d03[_0x837d('0x58')]=_0x79b451[_0x837d('0x54')][_0x837d('0x58')];if(_0x79b451[_0x837d('0x54')][_0x837d('0x59')]){_0x4d7d03[_0x837d('0x5a')]={'user':_0x79b451[_0x837d('0x54')]['user'],'pass':_0x79b451[_0x837d('0x54')][_0x837d('0x5b')]};}}else{_0x4d7d03[_0x837d('0x55')]=_0x79b451[_0x837d('0x54')]['service'];_0x4d7d03[_0x837d('0x5a')]={'user':_0x79b451[_0x837d('0x54')][_0x837d('0x5c')],'pass':_0x79b451[_0x837d('0x54')][_0x837d('0x5b')]};_0x4d7d03[_0x837d('0x58')]=_0x79b451[_0x837d('0x54')][_0x837d('0x58')];}if(_0x2ef641[_0x837d('0x45')]['attachments']&&_0x2ef641[_0x837d('0x45')][_0x837d('0x5d')]['length']){for(var _0x33593e=0x0;_0x33593e<_0x2ef641['body'][_0x837d('0x5d')][_0x837d('0x5e')];_0x33593e+=0x1){_0x2ef641['body'][_0x837d('0x5d')][_0x33593e]={'filename':_0x2ef641[_0x837d('0x45')][_0x837d('0x5d')][_0x33593e][_0x837d('0x2c')],'path':path[_0x837d('0x5f')](config[_0x837d('0x60')],_0x837d('0x61'),_0x2ef641[_0x837d('0x45')][_0x837d('0x5d')][_0x33593e][_0x837d('0x62')])};}}_0x58e7f0={'account':_0x4d7d03,'message':_0x2ef641[_0x837d('0x45')]};return;}})['then'](function(){if(_0x79b451[_0x837d('0x63')]){if(_0x79b451[_0x837d('0x63')]['Contacts'][_0x837d('0x5e')]){return _0x79b451['List'][_0x837d('0x51')][0x0];}else{return db[_0x837d('0x50')][_0x837d('0x48')](_[_0x837d('0xa')](_0x2ef641[_0x837d('0x45')],{'firstName':_0x2ef641[_0x837d('0x45')]['to'],'email':_0x2ef641[_0x837d('0x45')]['to'],'phone':_0x2ef641[_0x837d('0x45')]['to'],'ListId':_0x79b451[_0x837d('0x64')]}));}}else{throw new Error(_0x837d('0x65'));}})[_0x837d('0x11')](function(){if(_0x58e7f0){return respondWithRpcPromise('SendMail','sendMail',_0x58e7f0,client9003)['then'](function(_0x2d5b28){return _0x1d02e9['update']({'read':!![],'messageId':_0x2d5b28['messageId'],'sentAt':moment()[_0x837d('0x66')](_0x837d('0x67'))});})[_0x837d('0x46')](function(_0xd805b3){logger[_0x837d('0x18')]('%s',JSON[_0x837d('0x17')](_0xd805b3));return _0x1d02e9;});}return _0x1d02e9;});}return _0x1d02e9;}})[_0x837d('0x11')](respondWithResult(_0x3e3a72,0xc9))[_0x837d('0x46')](handleError(_0x3e3a72,null));};exports[_0x837d('0x68')]=function(_0x13d37e,_0x36fbf8){var _0x5261f4={'agent':{},'channel':_0x837d('0x69')};if(_0x13d37e[_0x837d('0x45')]['id']){delete _0x13d37e[_0x837d('0x45')]['id'];}_0x13d37e[_0x837d('0x45')][_0x837d('0x6a')]=!![];_0x13d37e[_0x837d('0x45')][_0x837d('0x6b')]=moment()[_0x837d('0x66')](_0x837d('0x67'));_0x13d37e[_0x837d('0x45')]['UserId']=_0x13d37e[_0x837d('0x45')][_0x837d('0x6c')]||_0x13d37e[_0x837d('0x5c')]['id'];_0x5261f4[_0x837d('0x6d')]['id']=_0x13d37e['body'][_0x837d('0x6c')];return db[_0x837d('0x27')]['find']({'where':{'id':_0x13d37e[_0x837d('0x40')]['id'],'UserId':null}})[_0x837d('0x11')](handleEntityNotFound(_0x36fbf8,null))[_0x837d('0x11')](saveUpdates(_0x13d37e[_0x837d('0x45')],null))[_0x837d('0x11')](function(_0x2eb848){if(_0x2eb848){_0x5261f4['message']=_0x2eb848[_0x837d('0x6e')]({'plain':!![]});return db[_0x837d('0x6f')][_0x837d('0x43')]({'where':{'id':_0x2eb848['MailInteractionId']}});}return null;})[_0x837d('0x11')](handleEntityNotFound(_0x36fbf8,null))[_0x837d('0x11')](function(_0x1156da){if(_0x1156da){return _0x1156da[_0x837d('0x44')]({'UserId':_0x13d37e[_0x837d('0x45')][_0x837d('0x6c')],'read1stAt':_['isNil'](_0x1156da['read1stAt'])?moment()[_0x837d('0x66')](_0x837d('0x67')):undefined});}return null;})[_0x837d('0x11')](function(_0x1e2b41){if(_0x1e2b41){_0x5261f4['interaction']=_0x1e2b41[_0x837d('0x6e')]({'plain':!![]});interaction_log[_0x837d('0x12')](_0x837d('0x70'),_0x13d37e[_0x837d('0x5c')]['id'],_0x13d37e[_0x837d('0x5c')][_0x837d('0x2c')],_0x13d37e[_0x837d('0x5c')][_0x837d('0x71')],_0x5261f4[_0x837d('0x72')]['id'],_0x13d37e['body']?JSON['stringify'](_0x13d37e[_0x837d('0x45')]):'null');return respondWithRpcPromise(_0x837d('0x73'),_0x837d('0x74'),_0x5261f4);}return null;})[_0x837d('0x11')](function(_0x432055){var _0xff47ec='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x432055[_0x837d('0x1a')][_0x837d('0x75')];return db[_0x837d('0x76')]['query'](_0xff47ec,{'type':db[_0x837d('0x77')][_0x837d('0x78')][_0x837d('0x79')],'raw':!![]})['then'](function(_0xb1e8d0){return _0xb1e8d0;});})[_0x837d('0x11')](function(_0x14f293){if(_0x14f293){_0x5261f4[_0x837d('0x1a')]['contact']=_0x14f293[0x0];if(!_0x13d37e['body'][_0x837d('0x6c')])return;return db[_0x837d('0x7a')][_0x837d('0x43')]({'where':{'id':_0x13d37e[_0x837d('0x45')][_0x837d('0x6c')],'role':_0x837d('0x6d')},'attributes':['id',_0x837d('0x2c'),_0x837d('0x7b'),_0x837d('0x7c'),'internal'],'raw':!![]});}return null;})[_0x837d('0x11')](function(_0x306b7f){if(!_0x306b7f)return null;_0x5261f4[_0x837d('0x1a')][_0x837d('0x6d')]=_0x306b7f;return _0x5261f4;})['then'](function(_0x16a3ef){if(_0x16a3ef){if(_0x13d37e['body']['manual']){_0x5261f4[_0x837d('0x1a')][_0x837d('0x7d')]=util[_0x837d('0x66')](_0x837d('0x7e'),_0x13d37e[_0x837d('0x5c')][_0x837d('0x2c')]);_0x5261f4[_0x837d('0x1a')][_0x837d('0x7f')]=_0x5261f4['channel'];_0x5261f4[_0x837d('0x1a')]['motionChannel']=_0x5261f4[_0x837d('0x7f')];_0x5261f4[_0x837d('0x1a')]['event']='accept';_0x5261f4[_0x837d('0x1a')]['body']=htmlToText[_0x837d('0x80')](_0x5261f4['message'][_0x837d('0x45')]);return respondWithRpcPromise(_0x837d('0x81'),_0x837d('0x81'),{'event':_0x837d('0x82'),'message':_0x5261f4[_0x837d('0x1a')]},client9002)[_0x837d('0x11')](function(){return _0x5261f4;});}return _0x5261f4;}return null;})[_0x837d('0x11')](respondWithResult(_0x36fbf8,null))['catch'](handleError(_0x36fbf8,null));};exports['reject']=function(_0xfa59b9,_0x4a000f){var _0x31e67e={'agent':{},'channel':'mail'};if(_0xfa59b9['body']['id']){delete _0xfa59b9[_0x837d('0x45')]['id'];}_0xfa59b9['body']['UserId']=_0xfa59b9['body'][_0x837d('0x6c')]||_0xfa59b9[_0x837d('0x5c')]['id'];_0x31e67e[_0x837d('0x6d')]['id']=_0xfa59b9[_0x837d('0x45')][_0x837d('0x6c')];return db['MailMessage']['find']({'where':{'id':_0xfa59b9[_0x837d('0x40')]['id'],'UserId':null}})[_0x837d('0x11')](handleEntityNotFound(_0x4a000f,null))['then'](function(_0x11acd7){if(_0x11acd7){_0x31e67e['message']=_0x11acd7['get']({'plain':!![]});return db[_0x837d('0x6f')][_0x837d('0x43')]({'where':{'id':_0x11acd7['MailInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x4a000f,null))[_0x837d('0x11')](function(_0x43de2d){if(_0x43de2d){_0x31e67e[_0x837d('0x72')]=_0x43de2d['get']({'plain':!![]});interaction_log[_0x837d('0x12')](_0x837d('0x83'),_0xfa59b9[_0x837d('0x5c')]['id'],_0xfa59b9[_0x837d('0x5c')][_0x837d('0x2c')],_0xfa59b9[_0x837d('0x5c')][_0x837d('0x71')],_0x31e67e[_0x837d('0x72')]['id'],_0xfa59b9['body']?JSON[_0x837d('0x17')](_0xfa59b9['body']):'null');return respondWithRpcPromise(_0x837d('0x84'),_0x837d('0x85'),_0x31e67e);}return null;})[_0x837d('0x11')](function(_0x52e35a){var _0x39aa0c=_0x837d('0x86')+_0x52e35a['message'][_0x837d('0x75')];return db[_0x837d('0x76')]['query'](_0x39aa0c,{'type':db[_0x837d('0x77')][_0x837d('0x78')][_0x837d('0x79')],'raw':!![]})[_0x837d('0x11')](function(_0x1062be){return _0x1062be;});})[_0x837d('0x11')](function(_0x3771de){if(_0x3771de){_0x31e67e['message'][_0x837d('0x87')]=_0x3771de[0x0];if(!_0xfa59b9['body'][_0x837d('0x6c')])return;return db[_0x837d('0x7a')][_0x837d('0x43')]({'where':{'id':_0xfa59b9[_0x837d('0x45')][_0x837d('0x6c')],'role':_0x837d('0x6d')},'attributes':['id','name',_0x837d('0x7b'),_0x837d('0x7c'),'internal'],'raw':!![]});}return null;})[_0x837d('0x11')](function(_0x5bcfc3){if(!_0x5bcfc3)return null;_0x31e67e[_0x837d('0x1a')]['agent']=_0x5bcfc3;return _0x31e67e;})[_0x837d('0x11')](function(_0x593b6f){if(_0x593b6f){_0x593b6f[_0x837d('0x1a')][_0x837d('0x7d')]=util['format'](_0x837d('0x7e'),_0xfa59b9[_0x837d('0x5c')][_0x837d('0x2c')]);_0x593b6f[_0x837d('0x1a')]['channel']=_0x31e67e[_0x837d('0x7f')];_0x593b6f[_0x837d('0x1a')][_0x837d('0x88')]=_0x31e67e[_0x837d('0x7f')];_0x593b6f[_0x837d('0x1a')][_0x837d('0x89')]=_0x837d('0x8a');_0x593b6f[_0x837d('0x1a')][_0x837d('0x45')]=htmlToText[_0x837d('0x80')](_0x31e67e[_0x837d('0x1a')][_0x837d('0x45')]);respondWithRpcPromise(_0x837d('0x81'),_0x837d('0x81'),{'event':_0x837d('0x8b'),'message':_0x593b6f[_0x837d('0x1a')]},client9002);return _0x31e67e;}return null;})[_0x837d('0x11')](respondWithResult(_0x4a000f,null))['catch'](handleError(_0x4a000f,null));};exports[_0x837d('0x8c')]=function(_0x4a99b4,_0x4d5610){var _0xe1b1ba=moment()[_0x837d('0x8d')]()[_0x837d('0x8e')]();var _0x3f2042=path[_0x837d('0x5f')](config[_0x837d('0x60')],_0x837d('0x8f'),_0x837d('0x90'),'tmp');var _0x310563=path[_0x837d('0x5f')](config[_0x837d('0x60')],_0x837d('0x8f'),'files',_0x837d('0x5d'));var _0x1822ae=util[_0x837d('0x66')]('message-%s.eml',_0xe1b1ba);return db['MailMessage'][_0x837d('0x43')]({'where':{'id':_0x4a99b4[_0x837d('0x40')]['id']},'attributes':['id',_0x837d('0x45'),_0x837d('0x91'),'to','cc','bcc',_0x837d('0x92'),'createdAt'],'include':_0x4a99b4[_0x837d('0x2d')]['attachments']?[{'model':db['Attachment'],'as':_0x837d('0x93')}]:undefined})[_0x837d('0x11')](handleEntityNotFound(_0x4d5610,null))[_0x837d('0x11')](function(_0x21df17){if(_0x21df17){var _0x1e6406=_0x21df17;var _0x4a6658={'from':_0x1e6406['from'],'to':_0x1e6406['to'],'subject':_0x1e6406['subject'],'html':_0x1e6406[_0x837d('0x45')],'headers':{'Date':moment(_0x1e6406['createdAt'])[_0x837d('0x66')](_0x837d('0x94'))},'attachments':[]};if(_0x21df17['cc']){_0x4a6658[_0x837d('0x95')]['Cc']=_0x21df17['cc'];}if(_0x21df17[_0x837d('0x96')]){_0x4a6658[_0x837d('0x95')][_0x837d('0x97')]=_0x21df17[_0x837d('0x96')];}return new BPromise(function(_0x4a56b5,_0x3f271d){if(_0x21df17[_0x837d('0x93')]){for(var _0x121350=0x0;_0x121350<_0x21df17[_0x837d('0x93')]['length'];_0x121350++){var _0x3b6578=_0x21df17[_0x837d('0x93')][_0x121350];var _0x46c124=path[_0x837d('0x5f')](_0x310563,_0x3b6578[_0x837d('0x62')]);if(fs[_0x837d('0x98')](_0x46c124)){_0x4a6658[_0x837d('0x5d')][_0x837d('0x99')]({'name':_0x3b6578['name'],'contentType':_0x3b6578[_0x837d('0x2a')],'data':fs[_0x837d('0x9a')](_0x46c124)});}}}emlformat[_0x837d('0x9b')](_0x4a6658,function(_0x24367f,_0x1196fe){if(_0x24367f)return _0x3f271d(_0x24367f);fs[_0x837d('0x9c')](path[_0x837d('0x5f')](_0x3f2042,_0x1822ae),_0x1196fe);return _0x4a56b5(_0x1196fe);});});}})[_0x837d('0x11')](function(_0x51fa00){if(_0x51fa00){return _0x4d5610[_0x837d('0x8c')](path[_0x837d('0x5f')](_0x3f2042,_0x1822ae),_0x1822ae,function(_0x29ef0a){if(!_0x29ef0a)fs[_0x837d('0x9d')](path[_0x837d('0x5f')](_0x3f2042,_0x1822ae));});}})[_0x837d('0x46')](handleError(_0x4d5610,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index d8e58df..2a56f94 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 _0x1a23=['MailMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x5df617,_0x36d8e3){var _0x11bac5=function(_0x2aa96e){while(--_0x2aa96e){_0x5df617['push'](_0x5df617['shift']());}};_0x11bac5(++_0x36d8e3);}(_0x1a23,0x1b6));var _0x31a2=function(_0x13009e,_0xb64397){_0x13009e=_0x13009e-0x0;var _0x31e9df=_0x1a23[_0x13009e];return _0x31e9df;};'use strict';var EventEmitter=require(_0x31a2('0x0'));var MailMessage=require(_0x31a2('0x1'))['db'][_0x31a2('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x31a2('0x3')](0x0);var events={'afterCreate':_0x31a2('0x4'),'afterUpdate':_0x31a2('0x5'),'afterDestroy':_0x31a2('0x6')};function emitEvent(_0x3141d8){return function(_0x2c2a27,_0x12ea4c,_0x39cd26){MailMessageEvents[_0x31a2('0x7')](_0x3141d8+':'+_0x2c2a27['id'],_0x2c2a27);MailMessageEvents[_0x31a2('0x7')](_0x3141d8,_0x2c2a27);_0x39cd26(null);};}for(var e in events){if(events[_0x31a2('0x8')](e)){var event=events[e];MailMessage[_0x31a2('0x9')](e,emitEvent(event));}}module[_0x31a2('0xa')]=MailMessageEvents; \ No newline at end of file +var _0x85a5=['exports','events','../../mysqldb','MailMessage','update','remove','emit','hook'];(function(_0x2b5b44,_0x17189c){var _0x32cb66=function(_0x4ce183){while(--_0x4ce183){_0x2b5b44['push'](_0x2b5b44['shift']());}};_0x32cb66(++_0x17189c);}(_0x85a5,0x1c1));var _0x585a=function(_0x14e001,_0x569bf){_0x14e001=_0x14e001-0x0;var _0x2c09da=_0x85a5[_0x14e001];return _0x2c09da;};'use strict';var EventEmitter=require(_0x585a('0x0'));var MailMessage=require(_0x585a('0x1'))['db'][_0x585a('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x585a('0x3'),'afterDestroy':_0x585a('0x4')};function emitEvent(_0x3c1b39){return function(_0x3371d4,_0x1db0ec,_0x59bd91){MailMessageEvents[_0x585a('0x5')](_0x3c1b39+':'+_0x3371d4['id'],_0x3371d4);MailMessageEvents[_0x585a('0x5')](_0x3c1b39,_0x3371d4);_0x59bd91(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailMessage[_0x585a('0x6')](e,emitEvent(event));}}module[_0x585a('0x7')]=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index 03775c7..ede3a47 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 _0xe995=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','mail_messages','messageId','fti_mail_messages','plainBody','fromString','body','models','get','toLowerCase','direction','out','isNil','MailInteraction','findOne','MailInteractionId','then','update','createdAt','catch','lodash','../../config/logger'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xe995,0x13d));var _0x5e99=function(_0x33ef0e,_0x4ffe34){_0x33ef0e=_0x33ef0e-0x0;var _0xb060fc=_0xe995[_0x33ef0e];return _0xb060fc;};'use strict';var _=require(_0x5e99('0x0'));var util=require('util');var logger=require(_0x5e99('0x1'))('api');var moment=require(_0x5e99('0x2'));var BPromise=require(_0x5e99('0x3'));var rp=require(_0x5e99('0x4'));var htmlToText=require('html-to-text');var fs=require('fs');var path=require(_0x5e99('0x5'));var rimraf=require(_0x5e99('0x6'));var config=require(_0x5e99('0x7'));var attributes=require('./mailMessage.attributes');module[_0x5e99('0x8')]=function(_0x4042b5,_0x3711a2){return _0x4042b5[_0x5e99('0x9')]('MailMessage',attributes,{'tableName':_0x5e99('0xa'),'paranoid':![],'indexes':[{'name':_0x5e99('0xb'),'fields':['messageId']},{'name':_0x5e99('0xc'),'fields':['plainBody','subject'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x5d3b48,_0x16579f,_0xb2c68e){if(_0x5d3b48['body']){_0x5d3b48[_0x5e99('0xd')]=htmlToText[_0x5e99('0xe')](_0x5d3b48[_0x5e99('0xf')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0xb2c68e(null,_0x16579f);},'afterCreate':function(_0xe43c78,_0x730f8d,_0x29396c){var _0x25ea88=_0x4042b5[_0x5e99('0x10')];var _0x9d9e29=_0xe43c78[_0x5e99('0x11')]({'plain':!![]});if(_0x9d9e29['direction'][_0x5e99('0x12')]()==='in'||_0x9d9e29[_0x5e99('0x13')][_0x5e99('0x12')]()===_0x5e99('0x14')&&!_0x9d9e29['secret']&&!_[_0x5e99('0x15')](_0x9d9e29['UserId'])){_0x25ea88[_0x5e99('0x16')][_0x5e99('0x17')]({'where':{'id':_0x9d9e29[_0x5e99('0x18')]}})[_0x5e99('0x19')](function(_0x4a44a1){if(_0x4a44a1){_0x4a44a1[_0x5e99('0x1a')]({'lastMsgAt':_0x9d9e29[_0x5e99('0x1b')],'lastMsgDirection':_0x9d9e29[_0x5e99('0x13')]['toLowerCase']()});}})[_0x5e99('0x1c')](function(_0x40fd25){console['error'](_0x40fd25);});}_0x29396c();}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x433c=['html-to-text','path','rimraf','../../config/environment','exports','define','MailMessage','mail_messages','messageId','fti_mail_messages','plainBody','subject','body','models','get','direction','toLowerCase','secret','findOne','then','update','createdAt','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x45b1ba,_0x5a6a21){var _0x145ddb=function(_0x650d42){while(--_0x650d42){_0x45b1ba['push'](_0x45b1ba['shift']());}};_0x145ddb(++_0x5a6a21);}(_0x433c,0x119));var _0xc433=function(_0x5c9f2d,_0xeee094){_0x5c9f2d=_0x5c9f2d-0x0;var _0x4007f0=_0x433c[_0x5c9f2d];return _0x4007f0;};'use strict';var _=require(_0xc433('0x0'));var util=require(_0xc433('0x1'));var logger=require(_0xc433('0x2'))(_0xc433('0x3'));var moment=require(_0xc433('0x4'));var BPromise=require(_0xc433('0x5'));var rp=require(_0xc433('0x6'));var htmlToText=require(_0xc433('0x7'));var fs=require('fs');var path=require(_0xc433('0x8'));var rimraf=require(_0xc433('0x9'));var config=require(_0xc433('0xa'));var attributes=require('./mailMessage.attributes');module[_0xc433('0xb')]=function(_0x431044,_0x584b3b){return _0x431044[_0xc433('0xc')](_0xc433('0xd'),attributes,{'tableName':_0xc433('0xe'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0xc433('0xf')]},{'name':_0xc433('0x10'),'fields':[_0xc433('0x11'),_0xc433('0x12')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x4facf2,_0x2c6680,_0x3d90d6){if(_0x4facf2[_0xc433('0x13')]){_0x4facf2[_0xc433('0x11')]=htmlToText['fromString'](_0x4facf2[_0xc433('0x13')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x3d90d6(null,_0x2c6680);},'afterCreate':function(_0x417cfb,_0x3a4509,_0x4c7ef5){var _0xa186e4=_0x431044[_0xc433('0x14')];var _0x1ed11d=_0x417cfb[_0xc433('0x15')]({'plain':!![]});if(_0x1ed11d[_0xc433('0x16')][_0xc433('0x17')]()==='in'||_0x1ed11d[_0xc433('0x16')]['toLowerCase']()==='out'&&!_0x1ed11d[_0xc433('0x18')]&&!_['isNil'](_0x1ed11d['UserId'])){_0xa186e4['MailInteraction'][_0xc433('0x19')]({'where':{'id':_0x1ed11d['MailInteractionId']}})[_0xc433('0x1a')](function(_0x2d0361){if(_0x2d0361){_0x2d0361[_0xc433('0x1b')]({'lastMsgAt':_0x1ed11d[_0xc433('0x1c')],'lastMsgDirection':_0x1ed11d['direction']['toLowerCase']()});}})['catch'](function(_0x28e9cd){console[_0xc433('0x1d')](_0x28e9cd);});}_0x4c7ef5();}},'charset':_0xc433('0x1e'),'collate':_0xc433('0x1f')});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index 78c63b1..86d0fd0 100644 --- a/server/api/mailMessage/mailMessage.rpc.js +++ b/server/api/mailMessage/mailMessage.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe2cf=['MailMessage,\x20%s,\x20%s','request\x20sent','error','message','result','CreateMailMessage','MailMessage','create','options','debug','stringify','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','redis','defaults','socket.io-emitter','./mailMessage.socket','request','then','info'];(function(_0xb1a10,_0x3076f0){var _0x4d0735=function(_0x4c3c3b){while(--_0x4c3c3b){_0xb1a10['push'](_0xb1a10['shift']());}};_0x4d0735(++_0x3076f0);}(_0xe2cf,0x1a1));var _0xfe2c=function(_0x42b02c,_0x5c7b99){_0x42b02c=_0x42b02c-0x0;var _0x105518=_0xe2cf[_0x42b02c];return _0x105518;};'use strict';var _=require('lodash');var util=require(_0xfe2c('0x0'));var moment=require('moment');var BPromise=require(_0xfe2c('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfe2c('0x2'));var db=require(_0xfe2c('0x3'))['db'];var utils=require(_0xfe2c('0x4'));var logger=require(_0xfe2c('0x5'))('rpc');var config=require(_0xfe2c('0x6'));var jayson=require(_0xfe2c('0x7'));var client=jayson['client']['http']({'port':0x232a});config[_0xfe2c('0x8')]=_[_0xfe2c('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xfe2c('0xa'))(new Redis(config[_0xfe2c('0x8')]));require(_0xfe2c('0xb'))['register'](socket);function respondWithRpcPromise(_0x5b616c,_0x396912,_0x15421e){return new BPromise(function(_0x495513,_0x22278c){return client[_0xfe2c('0xc')](_0x5b616c,_0x15421e)[_0xfe2c('0xd')](function(_0xa176e9){logger[_0xfe2c('0xe')](_0xfe2c('0xf'),_0x396912,_0xfe2c('0x10'));logger['debug']('MailMessage,\x20%s,\x20%s,\x20%s',_0x396912,'request\x20sent',JSON['stringify'](_0xa176e9));if(_0xa176e9[_0xfe2c('0x11')]){if(_0xa176e9['error']['code']===0x1f4){logger[_0xfe2c('0x11')](_0xfe2c('0xf'),_0x396912,_0xa176e9[_0xfe2c('0x11')][_0xfe2c('0x12')]);return _0x22278c(_0xa176e9['error']['message']);}logger[_0xfe2c('0x11')](_0xfe2c('0xf'),_0x396912,_0xa176e9[_0xfe2c('0x11')][_0xfe2c('0x12')]);return _0x495513(_0xa176e9['error'][_0xfe2c('0x12')]);}else{logger[_0xfe2c('0xe')](_0xfe2c('0xf'),_0x396912,_0xfe2c('0x10'));_0x495513(_0xa176e9[_0xfe2c('0x13')][_0xfe2c('0x12')]);}})['catch'](function(_0x22481a){logger[_0xfe2c('0x11')](_0xfe2c('0xf'),_0x396912,_0x22481a);_0x22278c(_0x22481a);});});}exports[_0xfe2c('0x14')]=function(_0x55f751){var _0x1139fe=this;return new Promise(function(_0x59bdeb,_0x4e9137){return db[_0xfe2c('0x15')][_0xfe2c('0x16')](_0x55f751['body'],{'raw':_0x55f751[_0xfe2c('0x17')]?_0x55f751[_0xfe2c('0x17')]['raw']===undefined?!![]:![]:!![]})[_0xfe2c('0xd')](function(_0x5dd54b){logger[_0xfe2c('0xe')](_0xfe2c('0x14'),_0x55f751);logger[_0xfe2c('0x18')](_0xfe2c('0x14'),_0x55f751,JSON[_0xfe2c('0x19')](_0x5dd54b));_0x59bdeb(_0x5dd54b);})[_0xfe2c('0x1a')](function(_0x57cd6d){logger[_0xfe2c('0x11')](_0xfe2c('0x14'),_0x57cd6d[_0xfe2c('0x12')],_0x55f751);_0x4e9137(_0x1139fe[_0xfe2c('0x11')](0x1f4,_0x57cd6d[_0xfe2c('0x12')]));});});}; \ No newline at end of file +var _0x5f66=['stringify','error','code','message','info','result','MailMessage','create','body','options','raw','CreateMailMessage','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./mailMessage.socket','then','MailMessage,\x20%s,\x20%s','debug','request\x20sent'];(function(_0x81979d,_0x569968){var _0x47e819=function(_0x4cac0f){while(--_0x4cac0f){_0x81979d['push'](_0x81979d['shift']());}};_0x47e819(++_0x569968);}(_0x5f66,0x1a0));var _0x65f6=function(_0x122096,_0x60c295){_0x122096=_0x122096-0x0;var _0x3d1966=_0x5f66[_0x122096];return _0x3d1966;};'use strict';var _=require('lodash');var util=require(_0x65f6('0x0'));var moment=require('moment');var BPromise=require(_0x65f6('0x1'));var rs=require(_0x65f6('0x2'));var fs=require('fs');var Redis=require(_0x65f6('0x3'));var db=require(_0x65f6('0x4'))['db'];var utils=require(_0x65f6('0x5'));var logger=require('../../config/logger')(_0x65f6('0x6'));var config=require('../../config/environment');var jayson=require(_0x65f6('0x7'));var client=jayson[_0x65f6('0x8')]['http']({'port':0x232a});config['redis']=_[_0x65f6('0x9')](config[_0x65f6('0xa')],{'host':_0x65f6('0xb'),'port':0x18eb});var socket=require(_0x65f6('0xc'))(new Redis(config[_0x65f6('0xa')]));require(_0x65f6('0xd'))['register'](socket);function respondWithRpcPromise(_0x5123ee,_0x18fea1,_0x2f6d5b){return new BPromise(function(_0x264647,_0x25c416){return client['request'](_0x5123ee,_0x2f6d5b)[_0x65f6('0xe')](function(_0x571436){logger['info'](_0x65f6('0xf'),_0x18fea1,'request\x20sent');logger[_0x65f6('0x10')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x18fea1,_0x65f6('0x11'),JSON[_0x65f6('0x12')](_0x571436));if(_0x571436[_0x65f6('0x13')]){if(_0x571436[_0x65f6('0x13')][_0x65f6('0x14')]===0x1f4){logger[_0x65f6('0x13')](_0x65f6('0xf'),_0x18fea1,_0x571436[_0x65f6('0x13')][_0x65f6('0x15')]);return _0x25c416(_0x571436[_0x65f6('0x13')]['message']);}logger[_0x65f6('0x13')]('MailMessage,\x20%s,\x20%s',_0x18fea1,_0x571436['error'][_0x65f6('0x15')]);return _0x264647(_0x571436[_0x65f6('0x13')][_0x65f6('0x15')]);}else{logger[_0x65f6('0x16')](_0x65f6('0xf'),_0x18fea1,_0x65f6('0x11'));_0x264647(_0x571436[_0x65f6('0x17')][_0x65f6('0x15')]);}})['catch'](function(_0x4d79a1){logger[_0x65f6('0x13')]('MailMessage,\x20%s,\x20%s',_0x18fea1,_0x4d79a1);_0x25c416(_0x4d79a1);});});}exports['CreateMailMessage']=function(_0x5c5b91){var _0x365159=this;return new Promise(function(_0x21ea88,_0x5114a4){return db[_0x65f6('0x18')][_0x65f6('0x19')](_0x5c5b91[_0x65f6('0x1a')],{'raw':_0x5c5b91[_0x65f6('0x1b')]?_0x5c5b91[_0x65f6('0x1b')][_0x65f6('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x197a49){logger['info']('CreateMailMessage',_0x5c5b91);logger[_0x65f6('0x10')](_0x65f6('0x1d'),_0x5c5b91,JSON['stringify'](_0x197a49));_0x21ea88(_0x197a49);})[_0x65f6('0x1e')](function(_0x471a33){logger[_0x65f6('0x13')](_0x65f6('0x1d'),_0x471a33['message'],_0x5c5b91);_0x5114a4(_0x365159[_0x65f6('0x13')](0x1f4,_0x471a33[_0x65f6('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index 973d303..80ca56f 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 _0xd6e1=['emit','removeListener','length','mailMessage:','./mailMessage.events','save','remove','update'];(function(_0x2b0b15,_0xa15cb2){var _0x5e4f5d=function(_0x32f80f){while(--_0x32f80f){_0x2b0b15['push'](_0x2b0b15['shift']());}};_0x5e4f5d(++_0xa15cb2);}(_0xd6e1,0x9c));var _0x1d6e=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xd6e1[_0x502c7d];return _0x30b7ed;};'use strict';var MailMessageEvents=require(_0x1d6e('0x0'));var events=[_0x1d6e('0x1'),_0x1d6e('0x2'),_0x1d6e('0x3')];function createListener(_0x2fdb6d,_0x1b5666){return function(_0x360601){_0x1b5666[_0x1d6e('0x4')](_0x2fdb6d,_0x360601);};}function removeListener(_0x5b24d4,_0x5ad7cb){return function(){MailMessageEvents[_0x1d6e('0x5')](_0x5b24d4,_0x5ad7cb);};}exports['register']=function(_0x7e022f){for(var _0x44f06f=0x0,_0x2a3bba=events[_0x1d6e('0x6')];_0x44f06f<_0x2a3bba;_0x44f06f++){var _0x5a218c=events[_0x44f06f];var _0x2da0ae=createListener(_0x1d6e('0x7')+_0x5a218c,_0x7e022f);MailMessageEvents['on'](_0x5a218c,_0x2da0ae);}}; \ No newline at end of file +var _0x4403=['length','update','emit','removeListener'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x4403,0x179));var _0x3440=function(_0x9d74a7,_0x137a86){_0x9d74a7=_0x9d74a7-0x0;var _0x49ca62=_0x4403[_0x9d74a7];return _0x49ca62;};'use strict';var MailMessageEvents=require('./mailMessage.events');var events=['save','remove',_0x3440('0x0')];function createListener(_0x571a63,_0x173448){return function(_0x48ba88){_0x173448[_0x3440('0x1')](_0x571a63,_0x48ba88);};}function removeListener(_0x39386e,_0x4d4dc6){return function(){MailMessageEvents[_0x3440('0x2')](_0x39386e,_0x4d4dc6);};}exports['register']=function(_0x5904cb){for(var _0x1e5e8d=0x0,_0x3121bd=events[_0x3440('0x3')];_0x1e5e8d<_0x3121bd;_0x1e5e8d++){var _0x4abc5a=events[_0x1e5e8d];var _0x33a070=createListener('mailMessage:'+_0x4abc5a,_0x5904cb);MailMessageEvents['on'](_0x4abc5a,_0x33a070);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index 41a5286..6f9f8e1 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 _0x7c25=['multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./mailQueue.controller','get','isAuthenticated','index','/describe','describe','/:id/members','getMembers','/:id/teams','/:id/users','getAgents','post','create','addTeams','put','/:id','destroy','delete','removeTeams','removeAgents','exports'];(function(_0x32ab72,_0x47dd1b){var _0x83eea5=function(_0x5dc26c){while(--_0x5dc26c){_0x32ab72['push'](_0x32ab72['shift']());}};_0x83eea5(++_0x47dd1b);}(_0x7c25,0x1ed));var _0x57c2=function(_0x19e47b,_0xb92dc6){_0x19e47b=_0x19e47b-0x0;var _0x5727d7=_0x7c25[_0x19e47b];return _0x5727d7;};'use strict';var multer=require(_0x57c2('0x0'));var util=require(_0x57c2('0x1'));var path=require('path');var timeout=require(_0x57c2('0x2'));var express=require(_0x57c2('0x3'));var router=express[_0x57c2('0x4')]();var fs_extra=require(_0x57c2('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x57c2('0x6'));var config=require(_0x57c2('0x7'));var controller=require(_0x57c2('0x8'));router[_0x57c2('0x9')]('/',auth[_0x57c2('0xa')](),controller[_0x57c2('0xb')]);router[_0x57c2('0x9')](_0x57c2('0xc'),auth[_0x57c2('0xa')](),controller[_0x57c2('0xd')]);router[_0x57c2('0x9')]('/:id',auth[_0x57c2('0xa')](),controller['show']);router[_0x57c2('0x9')](_0x57c2('0xe'),auth[_0x57c2('0xa')](),controller[_0x57c2('0xf')]);router[_0x57c2('0x9')](_0x57c2('0x10'),auth[_0x57c2('0xa')](),controller['getTeams']);router[_0x57c2('0x9')](_0x57c2('0x11'),auth['isAuthenticated'](),controller[_0x57c2('0x12')]);router[_0x57c2('0x13')]('/',auth[_0x57c2('0xa')](),controller[_0x57c2('0x14')]);router['post']('/:id/teams',auth['isAuthenticated'](),controller[_0x57c2('0x15')]);router['post'](_0x57c2('0x11'),auth[_0x57c2('0xa')](),controller['addAgents']);router[_0x57c2('0x16')](_0x57c2('0x17'),auth[_0x57c2('0xa')](),controller['update']);router['delete'](_0x57c2('0x17'),auth[_0x57c2('0xa')](),controller[_0x57c2('0x18')]);router[_0x57c2('0x19')]('/:id/teams',auth['isAuthenticated'](),controller[_0x57c2('0x1a')]);router[_0x57c2('0x19')](_0x57c2('0x11'),auth[_0x57c2('0xa')](),controller[_0x57c2('0x1b')]);module[_0x57c2('0x1c')]=router; \ No newline at end of file +var _0x953e=['../../config/environment','./mailQueue.controller','get','index','/describe','isAuthenticated','describe','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','update','destroy','delete','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x2d2c16,_0x4e88b6){var _0x53f2fb=function(_0x6b6dac){while(--_0x6b6dac){_0x2d2c16['push'](_0x2d2c16['shift']());}};_0x53f2fb(++_0x4e88b6);}(_0x953e,0x143));var _0xe953=function(_0x3bb6bb,_0x249b70){_0x3bb6bb=_0x3bb6bb-0x0;var _0x385df9=_0x953e[_0x3bb6bb];return _0x385df9;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe953('0x0'));var timeout=require(_0xe953('0x1'));var express=require(_0xe953('0x2'));var router=express[_0xe953('0x3')]();var fs_extra=require(_0xe953('0x4'));var auth=require(_0xe953('0x5'));var interaction=require(_0xe953('0x6'));var config=require(_0xe953('0x7'));var controller=require(_0xe953('0x8'));router[_0xe953('0x9')]('/',auth['isAuthenticated'](),controller[_0xe953('0xa')]);router[_0xe953('0x9')](_0xe953('0xb'),auth[_0xe953('0xc')](),controller[_0xe953('0xd')]);router[_0xe953('0x9')]('/:id',auth[_0xe953('0xc')](),controller[_0xe953('0xe')]);router['get'](_0xe953('0xf'),auth[_0xe953('0xc')](),controller['getMembers']);router[_0xe953('0x9')](_0xe953('0x10'),auth['isAuthenticated'](),controller[_0xe953('0x11')]);router['get'](_0xe953('0x12'),auth[_0xe953('0xc')](),controller[_0xe953('0x13')]);router[_0xe953('0x14')]('/',auth['isAuthenticated'](),controller[_0xe953('0x15')]);router[_0xe953('0x14')]('/:id/teams',auth[_0xe953('0xc')](),controller[_0xe953('0x16')]);router[_0xe953('0x14')]('/:id/users',auth[_0xe953('0xc')](),controller[_0xe953('0x17')]);router[_0xe953('0x18')](_0xe953('0x19'),auth['isAuthenticated'](),controller[_0xe953('0x1a')]);router['delete']('/:id',auth[_0xe953('0xc')](),controller[_0xe953('0x1b')]);router[_0xe953('0x1c')](_0xe953('0x10'),auth['isAuthenticated'](),controller['removeTeams']);router['delete']('/:id/users',auth[_0xe953('0xc')](),controller['removeAgents']);module[_0xe953('0x1d')]=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index 034fd28..f8a9a6c 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 _0xdc52=['rrmemory','beepall','roundrobin','exports','STRING','INTEGER','ENUM'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xdc52,0x137));var _0x2dc5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdc52[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x2dc5('0x0')]={'name':{'type':Sequelize[_0x2dc5('0x1')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x2dc5('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x2dc5('0x3')](_0x2dc5('0x4'),_0x2dc5('0x5'),_0x2dc5('0x6'))}}; \ No newline at end of file +var _0x9872=['sequelize','exports','STRING','rrmemory','beepall','roundrobin'];(function(_0x217ecd,_0x5b35da){var _0x50b480=function(_0x40cb44){while(--_0x40cb44){_0x217ecd['push'](_0x217ecd['shift']());}};_0x50b480(++_0x5b35da);}(_0x9872,0xae));var _0x2987=function(_0x7f60f0,_0x3e68bf){_0x7f60f0=_0x7f60f0-0x0;var _0x5c6b07=_0x9872[_0x7f60f0];return _0x5c6b07;};'use strict';var Sequelize=require(_0x2987('0x0'));module[_0x2987('0x1')]={'name':{'type':Sequelize[_0x2987('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x2987('0x3'),_0x2987('0x4'),_0x2987('0x5'))}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index c8fa35f..b37a225 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 _0xbab3=['transaction','each','findOrCreate','emit','userMailQueue:save','removeTeams','select','field','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','sequelize','toString','SELECT','every','all','union','value','isEmpty','forEach','userMailQueue:remove','addAgents','omit','removeAgents','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','destroy','get','MailQueues','error','stack','name','send','MailQueue','rawAttributes','fieldName','type','key','map','query','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','keys','intersection','find','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','UserMailQueue','MailQueueId','User','UserId','agent','mailPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','ids','Agents','online','voicePause','interface','flatMap'];(function(_0x158129,_0x25039a){var _0x1d1059=function(_0x46c472){while(--_0x46c472){_0x158129['push'](_0x158129['shift']());}};_0x1d1059(++_0x25039a);}(_0xbab3,0x130));var _0x3bab=function(_0x278679,_0x1eb219){_0x278679=_0x278679-0x0;var _0x4874aa=_0xbab3[_0x278679];return _0x4874aa;};'use strict';var emlformat=require(_0x3bab('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3bab('0x1'));var jsonpatch=require(_0x3bab('0x2'));var rp=require(_0x3bab('0x3'));var moment=require('moment');var BPromise=require(_0x3bab('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x3bab('0x5'));var csv=require('to-csv');var ejs=require(_0x3bab('0x6'));var fs=require('fs');var fs_extra=require(_0x3bab('0x7'));var _=require(_0x3bab('0x8'));var squel=require(_0x3bab('0x9'));var crypto=require(_0x3bab('0xa'));var jsforce=require(_0x3bab('0xb'));var deskjs=require(_0x3bab('0xc'));var toCsv=require(_0x3bab('0xd'));var querystring=require(_0x3bab('0xe'));var Papa=require(_0x3bab('0xf'));var Redis=require(_0x3bab('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x3bab('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3bab('0x12'));var logger=require(_0x3bab('0x13'))('api');var utils=require(_0x3bab('0x14'));var config=require(_0x3bab('0x15'));var licenseUtil=require(_0x3bab('0x16'));var db=require(_0x3bab('0x17'))['db'];config[_0x3bab('0x18')]=_[_0x3bab('0x19')](config[_0x3bab('0x18')],{'host':_0x3bab('0x1a'),'port':0x18eb});var socket=require(_0x3bab('0x1b'))(new Redis(config[_0x3bab('0x18')]));require(_0x3bab('0x1c'))[_0x3bab('0x1d')](socket);function respondWithStatusCode(_0x1cc3bd,_0x25ea2e){_0x25ea2e=_0x25ea2e||0xcc;return function(_0x2828ea){if(_0x2828ea){return _0x1cc3bd[_0x3bab('0x1e')](_0x25ea2e);}return _0x1cc3bd[_0x3bab('0x1f')](_0x25ea2e)[_0x3bab('0x20')]();};}function respondWithResult(_0x51b3e3,_0x55f969){_0x55f969=_0x55f969||0xc8;return function(_0x518b89){if(_0x518b89){return _0x51b3e3[_0x3bab('0x1f')](_0x55f969)[_0x3bab('0x21')](_0x518b89);}};}function respondWithFilteredResult(_0x3d38a6,_0x1ccdb5){return function(_0x3c9a22){if(_0x3c9a22){var _0x1f4cad=typeof _0x1ccdb5[_0x3bab('0x22')]===_0x3bab('0x23')&&typeof _0x1ccdb5[_0x3bab('0x24')]==='undefined';var _0x142dc2=_0x3c9a22[_0x3bab('0x25')];var _0x46c8d9=_0x1f4cad?0x0:_0x1ccdb5['offset'];var _0x5a4f54=_0x1f4cad?_0x3c9a22[_0x3bab('0x25')]:_0x1ccdb5[_0x3bab('0x22')]+_0x1ccdb5['limit'];var _0x395469;if(_0x5a4f54>=_0x142dc2){_0x5a4f54=_0x142dc2;_0x395469=0xc8;}else{_0x395469=0xce;}_0x3d38a6['status'](_0x395469);return _0x3d38a6[_0x3bab('0x26')](_0x3bab('0x27'),_0x46c8d9+'-'+_0x5a4f54+'/'+_0x142dc2)[_0x3bab('0x21')](_0x3c9a22);}return null;};}function patchUpdates(_0x28d4bf){return function(_0x377e9e){try{jsonpatch['apply'](_0x377e9e,_0x28d4bf,!![]);}catch(_0x1b8f39){return BPromise[_0x3bab('0x28')](_0x1b8f39);}return _0x377e9e['save']();};}function saveUpdates(_0x497a4f,_0x1493f9){return function(_0x2065e8){if(_0x2065e8){return _0x2065e8[_0x3bab('0x29')](_0x497a4f)[_0x3bab('0x2a')](function(_0x2fcba3){return _0x2fcba3;});}return null;};}function removeEntity(_0x5d08da,_0x2538a3){return function(_0x203981){if(_0x203981){return _0x203981[_0x3bab('0x2b')]()[_0x3bab('0x2a')](function(){var _0x524daf=_0x203981[_0x3bab('0x2c')]({'plain':!![]});var _0x109860=_0x3bab('0x2d');return db['UserProfileResource'][_0x3bab('0x2b')]({'where':{'type':_0x109860,'resourceId':_0x524daf['id']}})[_0x3bab('0x2a')](function(){return _0x203981;});})['then'](function(){_0x5d08da[_0x3bab('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x372926,_0x5148f5){return function(_0x15513e){if(!_0x15513e){_0x372926[_0x3bab('0x1e')](0x194);}return _0x15513e;};}function handleError(_0x2f3629,_0x4bf900){_0x4bf900=_0x4bf900||0x1f4;return function(_0x4b3f5d){logger[_0x3bab('0x2e')](_0x4b3f5d[_0x3bab('0x2f')]);if(_0x4b3f5d['name']){delete _0x4b3f5d[_0x3bab('0x30')];}_0x2f3629[_0x3bab('0x1f')](_0x4bf900)[_0x3bab('0x31')](_0x4b3f5d);};}exports['index']=function(_0x522438,_0x4192c7){var _0x1250c7={},_0x1b53e5={},_0x100ff3={'count':0x0,'rows':[]};var _0x5c0b85=_['map'](db[_0x3bab('0x32')][_0x3bab('0x33')],function(_0x3a4c7f){return{'name':_0x3a4c7f[_0x3bab('0x34')],'type':_0x3a4c7f[_0x3bab('0x35')][_0x3bab('0x36')]};});_0x1b53e5['model']=_[_0x3bab('0x37')](_0x5c0b85,_0x3bab('0x30'));_0x1b53e5[_0x3bab('0x38')]=_['keys'](_0x522438[_0x3bab('0x38')]);_0x1b53e5['filters']=_['intersection'](_0x1b53e5[_0x3bab('0x39')],_0x1b53e5[_0x3bab('0x38')]);_0x1250c7[_0x3bab('0x3a')]=_['intersection'](_0x1b53e5['model'],qs[_0x3bab('0x3b')](_0x522438[_0x3bab('0x38')][_0x3bab('0x3b')]));_0x1250c7[_0x3bab('0x3a')]=_0x1250c7[_0x3bab('0x3a')][_0x3bab('0x3c')]?_0x1250c7[_0x3bab('0x3a')]:_0x1b53e5[_0x3bab('0x39')];if(!_0x522438[_0x3bab('0x38')][_0x3bab('0x3d')](_0x3bab('0x3e'))){_0x1250c7[_0x3bab('0x24')]=qs['limit'](_0x522438[_0x3bab('0x38')][_0x3bab('0x24')]);_0x1250c7['offset']=qs[_0x3bab('0x22')](_0x522438[_0x3bab('0x38')][_0x3bab('0x22')]);}_0x1250c7[_0x3bab('0x3f')]=qs['sort'](_0x522438[_0x3bab('0x38')][_0x3bab('0x40')]);_0x1250c7[_0x3bab('0x41')]=qs[_0x3bab('0x42')](_[_0x3bab('0x43')](_0x522438[_0x3bab('0x38')],_0x1b53e5[_0x3bab('0x42')]),_0x5c0b85);if(_0x522438[_0x3bab('0x38')][_0x3bab('0x44')]){_0x1250c7[_0x3bab('0x41')]=_[_0x3bab('0x45')](_0x1250c7[_0x3bab('0x41')],{'$or':_[_0x3bab('0x37')](_0x5c0b85,function(_0xf57cfe){if(_0xf57cfe[_0x3bab('0x35')]!==_0x3bab('0x46')){var _0x568f43={};_0x568f43[_0xf57cfe[_0x3bab('0x30')]]={'$like':'%'+_0x522438[_0x3bab('0x38')][_0x3bab('0x44')]+'%'};return _0x568f43;}})});}_0x1250c7=_[_0x3bab('0x45')]({},_0x1250c7,_0x522438[_0x3bab('0x47')]);var _0x26fe75={'where':_0x1250c7['where']};return db['MailQueue'][_0x3bab('0x25')](_0x26fe75)[_0x3bab('0x2a')](function(_0x36a3e6){_0x100ff3[_0x3bab('0x25')]=_0x36a3e6;if(_0x522438['query'][_0x3bab('0x48')]){_0x1250c7[_0x3bab('0x49')]=[{'all':!![]}];}return db['MailQueue'][_0x3bab('0x4a')](_0x1250c7);})[_0x3bab('0x2a')](function(_0x37159a){_0x100ff3[_0x3bab('0x4b')]=_0x37159a;return _0x100ff3;})['then'](respondWithFilteredResult(_0x4192c7,_0x1250c7))[_0x3bab('0x4c')](handleError(_0x4192c7,null));};exports['show']=function(_0x4a5766,_0x58f1b5){var _0xdf94e6={'raw':!![],'where':{'id':_0x4a5766[_0x3bab('0x4d')]['id']}},_0x195f3e={};_0x195f3e[_0x3bab('0x39')]=_[_0x3bab('0x4e')](db[_0x3bab('0x32')][_0x3bab('0x33')]);_0x195f3e[_0x3bab('0x38')]=_[_0x3bab('0x4e')](_0x4a5766[_0x3bab('0x38')]);_0x195f3e[_0x3bab('0x42')]=_['intersection'](_0x195f3e[_0x3bab('0x39')],_0x195f3e[_0x3bab('0x38')]);_0xdf94e6[_0x3bab('0x3a')]=_[_0x3bab('0x4f')](_0x195f3e[_0x3bab('0x39')],qs[_0x3bab('0x3b')](_0x4a5766[_0x3bab('0x38')][_0x3bab('0x3b')]));_0xdf94e6[_0x3bab('0x3a')]=_0xdf94e6[_0x3bab('0x3a')][_0x3bab('0x3c')]?_0xdf94e6['attributes']:_0x195f3e['model'];if(_0x4a5766[_0x3bab('0x38')][_0x3bab('0x48')]){_0xdf94e6[_0x3bab('0x49')]=[{'all':!![]}];}_0xdf94e6=_[_0x3bab('0x45')]({},_0xdf94e6,_0x4a5766[_0x3bab('0x47')]);return db['MailQueue'][_0x3bab('0x50')](_0xdf94e6)[_0x3bab('0x2a')](handleEntityNotFound(_0x58f1b5,null))[_0x3bab('0x2a')](respondWithResult(_0x58f1b5,null))[_0x3bab('0x4c')](handleError(_0x58f1b5,null));};exports['create']=function(_0x4bbc0c,_0x2f6821){return db[_0x3bab('0x32')]['create'](_0x4bbc0c['body'],{})[_0x3bab('0x2a')](function(_0x5e1324){var _0x54a553=_0x4bbc0c['user'][_0x3bab('0x2c')]({'plain':!![]});if(!_0x54a553)throw new Error(_0x3bab('0x51'));if(_0x54a553['role']===_0x3bab('0x52')){var _0x414a5c=_0x5e1324['get']({'plain':!![]});var _0x569519=_0x3bab('0x2d');return db[_0x3bab('0x53')][_0x3bab('0x50')]({'where':{'name':_0x569519,'userProfileId':_0x54a553[_0x3bab('0x54')]},'raw':!![]})[_0x3bab('0x2a')](function(_0x552c17){if(_0x552c17&&_0x552c17['autoAssociation']===0x0){return db['UserProfileResource'][_0x3bab('0x55')]({'name':_0x414a5c[_0x3bab('0x30')],'resourceId':_0x414a5c['id'],'type':_0x552c17['name'],'sectionId':_0x552c17['id']},{})['then'](function(){return _0x5e1324;});}else{return _0x5e1324;}})[_0x3bab('0x4c')](function(_0x568fe5){logger['error'](_0x3bab('0x56'),_0x568fe5);throw _0x568fe5;});}return _0x5e1324;})[_0x3bab('0x2a')](respondWithResult(_0x2f6821,0xc9))[_0x3bab('0x4c')](handleError(_0x2f6821,null));};exports[_0x3bab('0x29')]=function(_0x3fa606,_0x4ec971){if(_0x3fa606[_0x3bab('0x57')]['id']){delete _0x3fa606[_0x3bab('0x57')]['id'];}return db[_0x3bab('0x32')]['find']({'where':{'id':_0x3fa606[_0x3bab('0x4d')]['id']}})[_0x3bab('0x2a')](handleEntityNotFound(_0x4ec971,null))[_0x3bab('0x2a')](saveUpdates(_0x3fa606[_0x3bab('0x57')],null))[_0x3bab('0x2a')](respondWithResult(_0x4ec971,null))[_0x3bab('0x4c')](handleError(_0x4ec971,null));};exports[_0x3bab('0x2b')]=function(_0x229674,_0x289734){return db['MailQueue'][_0x3bab('0x50')]({'where':{'id':_0x229674[_0x3bab('0x4d')]['id']}})['then'](handleEntityNotFound(_0x289734,null))[_0x3bab('0x2a')](removeEntity(_0x289734,null))[_0x3bab('0x4c')](handleError(_0x289734,null));};exports[_0x3bab('0x58')]=function(_0x42de5a,_0x23fe67){return db[_0x3bab('0x32')]['describe']()['then'](respondWithResult(_0x23fe67,null))[_0x3bab('0x4c')](handleError(_0x23fe67,null));};exports[_0x3bab('0x59')]=function(_0x4f9c38,_0x4c0cbd,_0x4c68b5){var _0x2f4fe8={'raw':!![],'where':{}},_0xcac681={},_0x54e91b;return db[_0x3bab('0x32')][_0x3bab('0x5a')]({'where':{'id':_0x4f9c38[_0x3bab('0x4d')]['id']}})[_0x3bab('0x2a')](handleEntityNotFound(_0x4c0cbd,null))['then'](function(_0x2cf3b8){if(_0x2cf3b8){_0x54e91b=_0x2cf3b8[_0x3bab('0x2c')]({'plain':!![]});_0xcac681[_0x3bab('0x39')]=_[_0x3bab('0x4e')](db[_0x3bab('0x5b')][_0x3bab('0x33')]);_0xcac681[_0x3bab('0x38')]=_['keys'](_0x4f9c38[_0x3bab('0x38')]);_0xcac681[_0x3bab('0x42')]=_[_0x3bab('0x4f')](_0xcac681[_0x3bab('0x39')],_0xcac681[_0x3bab('0x38')]);_0x2f4fe8[_0x3bab('0x3a')]=_[_0x3bab('0x4f')](_0xcac681[_0x3bab('0x39')],qs[_0x3bab('0x3b')](_0x4f9c38[_0x3bab('0x38')][_0x3bab('0x3b')]));_0x2f4fe8[_0x3bab('0x3a')]=_0x2f4fe8[_0x3bab('0x3a')][_0x3bab('0x3c')]?_0x2f4fe8['attributes']:_0xcac681[_0x3bab('0x39')];if(!_0x4f9c38[_0x3bab('0x38')]['hasOwnProperty'](_0x3bab('0x3e'))){_0x2f4fe8[_0x3bab('0x24')]=qs[_0x3bab('0x24')](_0x4f9c38[_0x3bab('0x38')]['limit']);_0x2f4fe8[_0x3bab('0x22')]=qs[_0x3bab('0x22')](_0x4f9c38['query']['offset']);}_0x2f4fe8[_0x3bab('0x3f')]=qs[_0x3bab('0x40')](_0x4f9c38[_0x3bab('0x38')][_0x3bab('0x40')]);_0x2f4fe8['where']=qs[_0x3bab('0x42')](_['pick'](_0x4f9c38['query'],_0xcac681['filters']));_0x2f4fe8[_0x3bab('0x41')][_0x3bab('0x5c')]=_0x2cf3b8['id'];if(_0x4f9c38[_0x3bab('0x38')][_0x3bab('0x44')]){_0x2f4fe8[_0x3bab('0x41')]=_[_0x3bab('0x45')](_0x2f4fe8[_0x3bab('0x41')],{'$or':_[_0x3bab('0x37')](_0x2f4fe8[_0x3bab('0x3a')],function(_0x4c8632){var _0x21bb41={};_0x21bb41[_0x4c8632]={'$like':'%'+_0x4f9c38[_0x3bab('0x38')][_0x3bab('0x44')]+'%'};return _0x21bb41;})});}_0x2f4fe8=_[_0x3bab('0x45')]({},_0x2f4fe8,_0x4f9c38[_0x3bab('0x47')]);return db['UserMailQueue'][_0x3bab('0x4a')](_0x2f4fe8);}})['then'](function(_0x3ba0da){if(_0x3ba0da){return db[_0x3bab('0x5d')]['findAndCountAll']({'where':{'id':_[_0x3bab('0x37')](_0x3ba0da,_0x3bab('0x5e')),'role':_0x3bab('0x5f')},'attributes':['id',_0x3bab('0x30'),_0x3bab('0x60'),_0x3bab('0x61'),_0x3bab('0x62')]});}})[_0x3bab('0x2a')](function(_0x335cd5){if(_0x335cd5){return{'count':_0x335cd5[_0x3bab('0x25')],'rows':_[_0x3bab('0x37')](_0x335cd5[_0x3bab('0x4b')],function(_0x592ef2){return{'membername':_0x592ef2['name'],'UserId':_0x592ef2['id'],'queue_name':_0x54e91b[_0x3bab('0x30')],'MailQueueId':_0x54e91b['id'],'interface':util[_0x3bab('0x63')](_0x3bab('0x64'),_0x3bab('0x65'),_0x592ef2[_0x3bab('0x30')]),'penalty':0x0,'paused':_0x592ef2['mailPause'],'createdAt':_0x592ef2[_0x3bab('0x62')],'updatedAt':_0x592ef2['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x3bab('0x2a')](respondWithFilteredResult(_0x4c0cbd,_0x2f4fe8))[_0x3bab('0x4c')](handleError(_0x4c0cbd,null));};exports[_0x3bab('0x66')]=function(_0x5a5db3,_0x3f7c30,_0x33e167){var _0x4b7671={};var _0x1e8ba6={};var _0x395691;var _0x8bcdb7;return db[_0x3bab('0x32')]['findOne']({'where':{'id':_0x5a5db3[_0x3bab('0x4d')]['id']}})['then'](handleEntityNotFound(_0x3f7c30,null))[_0x3bab('0x2a')](function(_0x45537a){if(_0x45537a){_0x395691=_0x45537a;_0x1e8ba6[_0x3bab('0x39')]=_[_0x3bab('0x4e')](db[_0x3bab('0x67')]['rawAttributes']);_0x1e8ba6[_0x3bab('0x38')]=_[_0x3bab('0x4e')](_0x5a5db3[_0x3bab('0x38')]);_0x1e8ba6[_0x3bab('0x42')]=_['intersection'](_0x1e8ba6[_0x3bab('0x39')],_0x1e8ba6[_0x3bab('0x38')]);_0x4b7671['attributes']=_[_0x3bab('0x4f')](_0x1e8ba6[_0x3bab('0x39')],qs[_0x3bab('0x3b')](_0x5a5db3[_0x3bab('0x38')][_0x3bab('0x3b')]));_0x4b7671['attributes']=_0x4b7671[_0x3bab('0x3a')][_0x3bab('0x3c')]?_0x4b7671[_0x3bab('0x3a')]:_0x1e8ba6[_0x3bab('0x39')];_0x4b7671['order']=qs[_0x3bab('0x40')](_0x5a5db3[_0x3bab('0x38')][_0x3bab('0x40')]);_0x4b7671[_0x3bab('0x41')]=qs[_0x3bab('0x42')](_[_0x3bab('0x43')](_0x5a5db3[_0x3bab('0x38')],_0x1e8ba6[_0x3bab('0x42')]));if(_0x5a5db3[_0x3bab('0x38')][_0x3bab('0x44')]){_0x4b7671[_0x3bab('0x41')]=_[_0x3bab('0x45')](_0x4b7671[_0x3bab('0x41')],{'$or':_[_0x3bab('0x37')](_0x4b7671[_0x3bab('0x3a')],function(_0x15826e){var _0x81fedf={};_0x81fedf[_0x15826e]={'$like':'%'+_0x5a5db3[_0x3bab('0x38')][_0x3bab('0x44')]+'%'};return _0x81fedf;})});}_0x4b7671=_[_0x3bab('0x45')]({},_0x4b7671,_0x5a5db3[_0x3bab('0x47')]);return _0x395691[_0x3bab('0x66')](_0x4b7671);}})[_0x3bab('0x2a')](function(_0x4484f3){if(_0x4484f3){_0x8bcdb7=_0x4484f3['length'];if(!_0x5a5db3[_0x3bab('0x38')][_0x3bab('0x3d')](_0x3bab('0x3e'))){_0x4b7671[_0x3bab('0x24')]=qs[_0x3bab('0x24')](_0x5a5db3['query'][_0x3bab('0x24')]);_0x4b7671['offset']=qs[_0x3bab('0x22')](_0x5a5db3[_0x3bab('0x38')]['offset']);}return _0x395691['getTeams'](_0x4b7671);}})[_0x3bab('0x2a')](function(_0x31e6b2){if(_0x31e6b2){return _0x31e6b2?{'count':_0x8bcdb7,'rows':_0x31e6b2}:null;}})[_0x3bab('0x2a')](respondWithResult(_0x3f7c30,null))[_0x3bab('0x4c')](handleError(_0x3f7c30,null));};exports['addTeams']=function(_0x24e9e4,_0x434b54,_0x26852e){var _0x2b0810=_0x24e9e4[_0x3bab('0x57')][_0x3bab('0x68')];return db['Team']['findAll']({'where':{'id':_0x2b0810},'attributes':['id'],'include':[{'model':db[_0x3bab('0x5d')],'as':_0x3bab('0x69'),'attributes':['id',_0x3bab('0x30'),_0x3bab('0x6a'),_0x3bab('0x6b'),_0x3bab('0x6c')],'raw':!![]}]})[_0x3bab('0x2a')](function(_0x4aa1df){if(_0x4aa1df){var _0x509f9b=_[_0x3bab('0x6d')](_0x4aa1df,function(_0x17d86c){var _0x332f64=_0x17d86c[_0x3bab('0x2c')]({'plain':!![]});return _0x332f64[_0x3bab('0x69')];});return db[_0x3bab('0x32')][_0x3bab('0x50')]({'where':{'id':_0x24e9e4[_0x3bab('0x4d')]['id']}})['then'](function(_0x36dca5){return db['sequelize'][_0x3bab('0x6e')](function(_0x1069bf){return _0x36dca5['addTeams'](_0x2b0810,{'transaction':_0x1069bf})[_0x3bab('0x2a')](function(){return BPromise[_0x3bab('0x6f')](_0x509f9b,function(_0x12e0be){return db[_0x3bab('0x5b')][_0x3bab('0x70')]({'where':{'UserId':_0x12e0be['id'],'MailQueueId':_0x24e9e4['params']['id']},'transaction':_0x1069bf});});})['then'](function(){_0x509f9b['forEach'](function(_0x1af596){socket[_0x3bab('0x71')](_0x3bab('0x72'),{'UserId':_0x1af596['id'],'MailQueueId':_0x36dca5['id']});});});});});}})[_0x3bab('0x2a')](respondWithStatusCode(_0x434b54,null))[_0x3bab('0x4c')](handleError(_0x434b54,null));};exports[_0x3bab('0x73')]=function(_0x211223,_0x23b997,_0x3ee272){return db[_0x3bab('0x67')][_0x3bab('0x4a')]({'where':{'id':_0x211223[_0x3bab('0x38')][_0x3bab('0x68')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x3bab('0x69'),'attributes':['id'],'raw':!![]}]})[_0x3bab('0x2a')](handleEntityNotFound(_0x23b997,null))['then'](function(_0x42ccd3){var _0x419d8d=_[_0x3bab('0x37')](_0x42ccd3,'id');var _0x513031=[];var _0x9ec5d3=[];var _0x3f081e=squel[_0x3bab('0x74')]();_0x3f081e[_0x3bab('0x75')]('tq.TeamId')[_0x3bab('0x76')]('team_has_mail_queues','tq')[_0x3bab('0x77')](_0x3bab('0x78'),'ut',_0x3bab('0x79'))['where']('MailQueueId\x20=\x20?',_0x211223[_0x3bab('0x4d')]['id']);for(var _0x571a72=0x0;_0x571a72<_0x42ccd3[_0x3bab('0x3c')];_0x571a72+=0x1){let _0x35d72f=_0x42ccd3[_0x571a72];for(var _0x1dfe69=0x0;_0x1dfe69<_0x35d72f['Agents'][_0x3bab('0x3c')];_0x1dfe69+=0x1){let _0x2040bd=_0x35d72f['Agents'][_0x1dfe69];var _0x252fac=_0x3f081e[_0x3bab('0x7a')]();_0x252fac[_0x3bab('0x41')](_0x3bab('0x7b'),_0x2040bd['id']);_0x9ec5d3['push'](db[_0x3bab('0x7c')][_0x3bab('0x38')](_0x252fac[_0x3bab('0x7d')](),{'type':db[_0x3bab('0x7c')]['QueryTypes'][_0x3bab('0x7e')]})[_0x3bab('0x2a')](function(_0x35c193){if(_0x35c193['length']===0x1){return _0x2040bd['id'];}else{var _0x3a3014=_[_0x3bab('0x7f')](_['map'](_0x35c193,'TeamId'),function(_0x309230){return _['includes'](_0x419d8d,_0x309230);});if(_0x3a3014){return _0x2040bd['id'];}}}));}}return BPromise[_0x3bab('0x80')](_0x9ec5d3)['then'](function(_0xa7632f){_0x513031=_(_0x513031)[_0x3bab('0x81')](_0xa7632f)['compact']()[_0x3bab('0x82')]();return db[_0x3bab('0x32')]['find']({'where':{'id':_0x211223['params']['id']}})[_0x3bab('0x2a')](function(_0x5aaca5){return db[_0x3bab('0x7c')]['transaction'](function(_0x1994c4){return _0x5aaca5[_0x3bab('0x73')](_0x211223[_0x3bab('0x38')][_0x3bab('0x68')],{'transaction':_0x1994c4})[_0x3bab('0x2a')](function(){if(!_[_0x3bab('0x83')](_0x513031)){return _0x5aaca5['removeAgents'](_0x513031,{'transaction':_0x1994c4});}})[_0x3bab('0x2a')](function(){_0x513031[_0x3bab('0x84')](function(_0x1447f6){socket['emit'](_0x3bab('0x85'),{'UserId':_0x1447f6,'MailQueueId':_0x5aaca5['id']});});});});});});})[_0x3bab('0x2a')](respondWithStatusCode(_0x23b997,null))[_0x3bab('0x4c')](handleError(_0x23b997,null));};exports[_0x3bab('0x86')]=function(_0x56810c,_0x3cb6a6,_0x421558){return db[_0x3bab('0x32')]['find']({'where':{'id':_0x56810c[_0x3bab('0x4d')]['id']}})[_0x3bab('0x2a')](handleEntityNotFound(_0x3cb6a6,null))['then'](function(_0x5633da){if(_0x5633da){return _0x5633da[_0x3bab('0x86')](_0x56810c[_0x3bab('0x57')][_0x3bab('0x68')],_[_0x3bab('0x87')](_0x56810c[_0x3bab('0x57')],[_0x3bab('0x68'),'id'])||{})['spread'](function(_0x149238){for(var _0x34d7fe=0x0;_0x34d7fe<_0x56810c[_0x3bab('0x57')][_0x3bab('0x68')][_0x3bab('0x3c')];_0x34d7fe+=0x1){socket[_0x3bab('0x71')](_0x3bab('0x72'),{'UserId':Number(_0x56810c[_0x3bab('0x57')][_0x3bab('0x68')][_0x34d7fe]),'MailQueueId':Number(_0x56810c[_0x3bab('0x4d')]['id'])});}return _0x149238;});}})[_0x3bab('0x2a')](respondWithResult(_0x3cb6a6,null))[_0x3bab('0x4c')](handleError(_0x3cb6a6,null));};exports[_0x3bab('0x88')]=function(_0x29dfef,_0x1f7850,_0x1d8c48){return db[_0x3bab('0x32')][_0x3bab('0x50')]({'where':{'id':_0x29dfef[_0x3bab('0x4d')]['id']}})[_0x3bab('0x2a')](handleEntityNotFound(_0x1f7850,null))[_0x3bab('0x2a')](function(_0x4aea4f){if(_0x4aea4f){return _0x4aea4f['removeAgents'](_0x29dfef[_0x3bab('0x38')][_0x3bab('0x68')])['then'](function(){if(_['isArray'](_0x29dfef['query'][_0x3bab('0x68')])){for(var _0x23742c=0x0;_0x23742c<_0x29dfef[_0x3bab('0x38')][_0x3bab('0x68')][_0x3bab('0x3c')];_0x23742c+=0x1){socket[_0x3bab('0x71')](_0x3bab('0x85'),{'UserId':Number(_0x29dfef[_0x3bab('0x38')][_0x3bab('0x68')][_0x23742c]),'MailQueueId':Number(_0x29dfef[_0x3bab('0x4d')]['id'])});}}else{socket[_0x3bab('0x71')](_0x3bab('0x85'),{'UserId':Number(_0x29dfef[_0x3bab('0x38')][_0x3bab('0x68')]),'MailQueueId':Number(_0x29dfef[_0x3bab('0x4d')]['id'])});}});}})[_0x3bab('0x2a')](respondWithStatusCode(_0x1f7850,null))[_0x3bab('0x4c')](handleError(_0x1f7850,null));};exports[_0x3bab('0x89')]=function(_0x279244,_0x16663b,_0x46196b){var _0x22f7b1={};var _0x3d0bbf={};var _0x1d3d12;var _0x2a0d93;return db[_0x3bab('0x32')]['findOne']({'where':{'id':_0x279244[_0x3bab('0x4d')]['id']}})[_0x3bab('0x2a')](handleEntityNotFound(_0x16663b,null))[_0x3bab('0x2a')](function(_0x176e42){if(_0x176e42){_0x1d3d12=_0x176e42;_0x3d0bbf['model']=_[_0x3bab('0x4e')](db[_0x3bab('0x5d')][_0x3bab('0x33')]);_0x3d0bbf[_0x3bab('0x38')]=_[_0x3bab('0x4e')](_0x279244['query']);_0x3d0bbf['filters']=_['intersection'](_0x3d0bbf['model'],_0x3d0bbf[_0x3bab('0x38')]);_0x22f7b1['attributes']=_[_0x3bab('0x4f')](_0x3d0bbf[_0x3bab('0x39')],qs[_0x3bab('0x3b')](_0x279244['query'][_0x3bab('0x3b')]));_0x22f7b1[_0x3bab('0x3a')]=_0x22f7b1[_0x3bab('0x3a')][_0x3bab('0x3c')]?_0x22f7b1[_0x3bab('0x3a')]:_0x3d0bbf[_0x3bab('0x39')];_0x22f7b1[_0x3bab('0x3f')]=qs['sort'](_0x279244[_0x3bab('0x38')][_0x3bab('0x40')]);_0x22f7b1[_0x3bab('0x41')]=qs['filters'](_[_0x3bab('0x43')](_0x279244[_0x3bab('0x38')],_0x3d0bbf['filters']));if(_0x279244[_0x3bab('0x38')]['filter']){_0x22f7b1[_0x3bab('0x41')]=_[_0x3bab('0x45')](_0x22f7b1['where'],{'$or':_[_0x3bab('0x37')](_0x22f7b1['attributes'],function(_0xcfa051){var _0x543678={};_0x543678[_0xcfa051]={'$like':'%'+_0x279244[_0x3bab('0x38')][_0x3bab('0x44')]+'%'};return _0x543678;})});}_0x22f7b1=_['merge']({},_0x22f7b1,_0x279244[_0x3bab('0x47')]);return _0x1d3d12['getAgents'](_0x22f7b1);}})[_0x3bab('0x2a')](function(_0x4f27d3){if(_0x4f27d3){_0x2a0d93=_0x4f27d3[_0x3bab('0x3c')];if(!_0x279244['query'][_0x3bab('0x3d')](_0x3bab('0x3e'))){_0x22f7b1['limit']=qs['limit'](_0x279244[_0x3bab('0x38')][_0x3bab('0x24')]);_0x22f7b1['offset']=qs[_0x3bab('0x22')](_0x279244[_0x3bab('0x38')][_0x3bab('0x22')]);}return _0x1d3d12[_0x3bab('0x89')](_0x22f7b1);}})['then'](function(_0x400266){if(_0x400266){return _0x400266?{'count':_0x2a0d93,'rows':_0x400266}:null;}})[_0x3bab('0x2a')](respondWithResult(_0x16663b,null))['catch'](handleError(_0x16663b,null));}; \ No newline at end of file +var _0x3750=['findAndCountAll','UserId','mailPause','updatedAt','createdAt','rows','format','SIP','getTeams','Team','ids','Agents','online','interface','flatMap','sequelize','transaction','addTeams','findOrCreate','forEach','emit','userMailQueue:save','removeTeams','field','tq.TeamId','from','team_has_mail_queues','join','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','push','toString','QueryTypes','every','TeamId','compact','isEmpty','userMailQueue:remove','addAgents','omit','spread','removeAgents','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','register','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','json','apply','save','then','get','MailQueues','destroy','stack','name','send','map','MailQueue','rawAttributes','fieldName','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','show','params','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','findOne','UserMailQueue','order','pick','MailQueueId','User'];(function(_0x183fd9,_0x423116){var _0x370cff=function(_0x15aceb){while(--_0x15aceb){_0x183fd9['push'](_0x183fd9['shift']());}};_0x370cff(++_0x423116);}(_0x3750,0xbb));var _0x0375=function(_0x49c057,_0xc808ed){_0x49c057=_0x49c057-0x0;var _0xd8f0e6=_0x3750[_0x49c057];return _0xd8f0e6;};'use strict';var emlformat=require(_0x0375('0x0'));var rimraf=require(_0x0375('0x1'));var zipdir=require(_0x0375('0x2'));var jsonpatch=require(_0x0375('0x3'));var rp=require(_0x0375('0x4'));var moment=require('moment');var BPromise=require(_0x0375('0x5'));var Mustache=require(_0x0375('0x6'));var util=require('util');var path=require(_0x0375('0x7'));var sox=require(_0x0375('0x8'));var csv=require(_0x0375('0x9'));var ejs=require(_0x0375('0xa'));var fs=require('fs');var fs_extra=require(_0x0375('0xb'));var _=require(_0x0375('0xc'));var squel=require('squel');var crypto=require(_0x0375('0xd'));var jsforce=require(_0x0375('0xe'));var deskjs=require(_0x0375('0xf'));var toCsv=require(_0x0375('0x9'));var querystring=require(_0x0375('0x10'));var Papa=require(_0x0375('0x11'));var Redis=require('ioredis');var authService=require(_0x0375('0x12'));var qs=require(_0x0375('0x13'));var as=require(_0x0375('0x14'));var hardwareService=require(_0x0375('0x15'));var logger=require(_0x0375('0x16'))(_0x0375('0x17'));var utils=require(_0x0375('0x18'));var config=require(_0x0375('0x19'));var licenseUtil=require(_0x0375('0x1a'));var db=require(_0x0375('0x1b'))['db'];config[_0x0375('0x1c')]=_[_0x0375('0x1d')](config['redis'],{'host':_0x0375('0x1e'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0375('0x1c')]));require('./mailQueue.socket')[_0x0375('0x1f')](socket);function respondWithStatusCode(_0x54e289,_0x343175){_0x343175=_0x343175||0xcc;return function(_0x3126f6){if(_0x3126f6){return _0x54e289[_0x0375('0x20')](_0x343175);}return _0x54e289[_0x0375('0x21')](_0x343175)[_0x0375('0x22')]();};}function respondWithResult(_0x12d950,_0x3585a0){_0x3585a0=_0x3585a0||0xc8;return function(_0x94acd1){if(_0x94acd1){return _0x12d950[_0x0375('0x21')](_0x3585a0)['json'](_0x94acd1);}};}function respondWithFilteredResult(_0x4b5869,_0x5b0649){return function(_0x35d83c){if(_0x35d83c){var _0x503fd4=typeof _0x5b0649['offset']===_0x0375('0x23')&&typeof _0x5b0649[_0x0375('0x24')]===_0x0375('0x23');var _0x4ffc43=_0x35d83c[_0x0375('0x25')];var _0x2d14b6=_0x503fd4?0x0:_0x5b0649['offset'];var _0x4a9331=_0x503fd4?_0x35d83c['count']:_0x5b0649[_0x0375('0x26')]+_0x5b0649['limit'];var _0x10d4eb;if(_0x4a9331>=_0x4ffc43){_0x4a9331=_0x4ffc43;_0x10d4eb=0xc8;}else{_0x10d4eb=0xce;}_0x4b5869[_0x0375('0x21')](_0x10d4eb);return _0x4b5869[_0x0375('0x27')](_0x0375('0x28'),_0x2d14b6+'-'+_0x4a9331+'/'+_0x4ffc43)[_0x0375('0x29')](_0x35d83c);}return null;};}function patchUpdates(_0x5251af){return function(_0x3f9dd3){try{jsonpatch[_0x0375('0x2a')](_0x3f9dd3,_0x5251af,!![]);}catch(_0x3810c0){return BPromise['reject'](_0x3810c0);}return _0x3f9dd3[_0x0375('0x2b')]();};}function saveUpdates(_0x3c884d,_0x19ec53){return function(_0x48778e){if(_0x48778e){return _0x48778e['update'](_0x3c884d)[_0x0375('0x2c')](function(_0x256426){return _0x256426;});}return null;};}function removeEntity(_0x5b6880,_0x4c2285){return function(_0x5d34d2){if(_0x5d34d2){return _0x5d34d2['destroy']()[_0x0375('0x2c')](function(){var _0x1a731a=_0x5d34d2[_0x0375('0x2d')]({'plain':!![]});var _0x527204=_0x0375('0x2e');return db['UserProfileResource'][_0x0375('0x2f')]({'where':{'type':_0x527204,'resourceId':_0x1a731a['id']}})[_0x0375('0x2c')](function(){return _0x5d34d2;});})[_0x0375('0x2c')](function(){_0x5b6880[_0x0375('0x21')](0xcc)[_0x0375('0x22')]();});}};}function handleEntityNotFound(_0x275a50,_0x2716ad){return function(_0x4fe547){if(!_0x4fe547){_0x275a50[_0x0375('0x20')](0x194);}return _0x4fe547;};}function handleError(_0x3162d2,_0x47b965){_0x47b965=_0x47b965||0x1f4;return function(_0x17a4eb){logger['error'](_0x17a4eb[_0x0375('0x30')]);if(_0x17a4eb[_0x0375('0x31')]){delete _0x17a4eb['name'];}_0x3162d2[_0x0375('0x21')](_0x47b965)[_0x0375('0x32')](_0x17a4eb);};}exports['index']=function(_0x502762,_0x411f8c){var _0x3379ed={},_0x18b054={},_0x5f15a5={'count':0x0,'rows':[]};var _0x4d24be=_[_0x0375('0x33')](db[_0x0375('0x34')][_0x0375('0x35')],function(_0x2bc290){return{'name':_0x2bc290[_0x0375('0x36')],'type':_0x2bc290['type']['key']};});_0x18b054['model']=_['map'](_0x4d24be,'name');_0x18b054[_0x0375('0x37')]=_[_0x0375('0x38')](_0x502762[_0x0375('0x37')]);_0x18b054[_0x0375('0x39')]=_[_0x0375('0x3a')](_0x18b054['model'],_0x18b054[_0x0375('0x37')]);_0x3379ed[_0x0375('0x3b')]=_['intersection'](_0x18b054[_0x0375('0x3c')],qs[_0x0375('0x3d')](_0x502762[_0x0375('0x37')][_0x0375('0x3d')]));_0x3379ed[_0x0375('0x3b')]=_0x3379ed[_0x0375('0x3b')][_0x0375('0x3e')]?_0x3379ed[_0x0375('0x3b')]:_0x18b054['model'];if(!_0x502762[_0x0375('0x37')][_0x0375('0x3f')](_0x0375('0x40'))){_0x3379ed[_0x0375('0x24')]=qs[_0x0375('0x24')](_0x502762[_0x0375('0x37')]['limit']);_0x3379ed[_0x0375('0x26')]=qs['offset'](_0x502762['query'][_0x0375('0x26')]);}_0x3379ed['order']=qs[_0x0375('0x41')](_0x502762['query'][_0x0375('0x41')]);_0x3379ed[_0x0375('0x42')]=qs['filters'](_['pick'](_0x502762[_0x0375('0x37')],_0x18b054[_0x0375('0x39')]),_0x4d24be);if(_0x502762[_0x0375('0x37')][_0x0375('0x43')]){_0x3379ed[_0x0375('0x42')]=_['merge'](_0x3379ed[_0x0375('0x42')],{'$or':_[_0x0375('0x33')](_0x4d24be,function(_0x3f1532){if(_0x3f1532[_0x0375('0x44')]!==_0x0375('0x45')){var _0x2038eb={};_0x2038eb[_0x3f1532[_0x0375('0x31')]]={'$like':'%'+_0x502762['query'][_0x0375('0x43')]+'%'};return _0x2038eb;}})});}_0x3379ed=_[_0x0375('0x46')]({},_0x3379ed,_0x502762[_0x0375('0x47')]);var _0x5de35e={'where':_0x3379ed[_0x0375('0x42')]};return db['MailQueue'][_0x0375('0x25')](_0x5de35e)[_0x0375('0x2c')](function(_0x1e1ea2){_0x5f15a5['count']=_0x1e1ea2;if(_0x502762[_0x0375('0x37')][_0x0375('0x48')]){_0x3379ed[_0x0375('0x49')]=[{'all':!![]}];}return db['MailQueue'][_0x0375('0x4a')](_0x3379ed);})[_0x0375('0x2c')](function(_0x4109fb){_0x5f15a5['rows']=_0x4109fb;return _0x5f15a5;})[_0x0375('0x2c')](respondWithFilteredResult(_0x411f8c,_0x3379ed))['catch'](handleError(_0x411f8c,null));};exports[_0x0375('0x4b')]=function(_0x1793a3,_0x4bc102){var _0x51bd38={'raw':!![],'where':{'id':_0x1793a3[_0x0375('0x4c')]['id']}},_0x4ef53d={};_0x4ef53d[_0x0375('0x3c')]=_[_0x0375('0x38')](db['MailQueue'][_0x0375('0x35')]);_0x4ef53d['query']=_['keys'](_0x1793a3[_0x0375('0x37')]);_0x4ef53d['filters']=_[_0x0375('0x3a')](_0x4ef53d[_0x0375('0x3c')],_0x4ef53d[_0x0375('0x37')]);_0x51bd38[_0x0375('0x3b')]=_[_0x0375('0x3a')](_0x4ef53d['model'],qs[_0x0375('0x3d')](_0x1793a3[_0x0375('0x37')][_0x0375('0x3d')]));_0x51bd38['attributes']=_0x51bd38[_0x0375('0x3b')][_0x0375('0x3e')]?_0x51bd38[_0x0375('0x3b')]:_0x4ef53d['model'];if(_0x1793a3['query'][_0x0375('0x48')]){_0x51bd38[_0x0375('0x49')]=[{'all':!![]}];}_0x51bd38=_[_0x0375('0x46')]({},_0x51bd38,_0x1793a3[_0x0375('0x47')]);return db[_0x0375('0x34')][_0x0375('0x4d')](_0x51bd38)[_0x0375('0x2c')](handleEntityNotFound(_0x4bc102,null))[_0x0375('0x2c')](respondWithResult(_0x4bc102,null))[_0x0375('0x4e')](handleError(_0x4bc102,null));};exports['create']=function(_0x165b7f,_0x3008f3){return db[_0x0375('0x34')][_0x0375('0x4f')](_0x165b7f[_0x0375('0x50')],{})[_0x0375('0x2c')](function(_0x40836b){var _0x57cdbf=_0x165b7f[_0x0375('0x51')]['get']({'plain':!![]});if(!_0x57cdbf)throw new Error(_0x0375('0x52'));if(_0x57cdbf[_0x0375('0x53')]===_0x0375('0x51')){var _0x1aad20=_0x40836b[_0x0375('0x2d')]({'plain':!![]});var _0x229c83='MailQueues';return db['UserProfileSection'][_0x0375('0x4d')]({'where':{'name':_0x229c83,'userProfileId':_0x57cdbf[_0x0375('0x54')]},'raw':!![]})[_0x0375('0x2c')](function(_0x2ce641){if(_0x2ce641&&_0x2ce641[_0x0375('0x55')]===0x0){return db[_0x0375('0x56')][_0x0375('0x4f')]({'name':_0x1aad20['name'],'resourceId':_0x1aad20['id'],'type':_0x2ce641[_0x0375('0x31')],'sectionId':_0x2ce641['id']},{})[_0x0375('0x2c')](function(){return _0x40836b;});}else{return _0x40836b;}})[_0x0375('0x4e')](function(_0x3d5f9c){logger[_0x0375('0x57')](_0x0375('0x58'),_0x3d5f9c);throw _0x3d5f9c;});}return _0x40836b;})[_0x0375('0x2c')](respondWithResult(_0x3008f3,0xc9))[_0x0375('0x4e')](handleError(_0x3008f3,null));};exports[_0x0375('0x59')]=function(_0x1f196d,_0x4ded04){if(_0x1f196d['body']['id']){delete _0x1f196d['body']['id'];}return db[_0x0375('0x34')][_0x0375('0x4d')]({'where':{'id':_0x1f196d[_0x0375('0x4c')]['id']}})['then'](handleEntityNotFound(_0x4ded04,null))['then'](saveUpdates(_0x1f196d[_0x0375('0x50')],null))[_0x0375('0x2c')](respondWithResult(_0x4ded04,null))[_0x0375('0x4e')](handleError(_0x4ded04,null));};exports[_0x0375('0x2f')]=function(_0x2be455,_0x4a5297){return db[_0x0375('0x34')][_0x0375('0x4d')]({'where':{'id':_0x2be455[_0x0375('0x4c')]['id']}})['then'](handleEntityNotFound(_0x4a5297,null))['then'](removeEntity(_0x4a5297,null))[_0x0375('0x4e')](handleError(_0x4a5297,null));};exports[_0x0375('0x5a')]=function(_0x377551,_0x80a2c9){return db[_0x0375('0x34')]['describe']()[_0x0375('0x2c')](respondWithResult(_0x80a2c9,null))[_0x0375('0x4e')](handleError(_0x80a2c9,null));};exports['getMembers']=function(_0x15efd4,_0x51ab49,_0x122694){var _0x1348da={'raw':!![],'where':{}},_0x41489c={},_0x1f527a;return db['MailQueue'][_0x0375('0x5b')]({'where':{'id':_0x15efd4[_0x0375('0x4c')]['id']}})[_0x0375('0x2c')](handleEntityNotFound(_0x51ab49,null))['then'](function(_0x127668){if(_0x127668){_0x1f527a=_0x127668['get']({'plain':!![]});_0x41489c[_0x0375('0x3c')]=_[_0x0375('0x38')](db[_0x0375('0x5c')][_0x0375('0x35')]);_0x41489c[_0x0375('0x37')]=_['keys'](_0x15efd4['query']);_0x41489c[_0x0375('0x39')]=_[_0x0375('0x3a')](_0x41489c[_0x0375('0x3c')],_0x41489c[_0x0375('0x37')]);_0x1348da[_0x0375('0x3b')]=_[_0x0375('0x3a')](_0x41489c[_0x0375('0x3c')],qs['fields'](_0x15efd4[_0x0375('0x37')]['fields']));_0x1348da['attributes']=_0x1348da[_0x0375('0x3b')][_0x0375('0x3e')]?_0x1348da[_0x0375('0x3b')]:_0x41489c['model'];if(!_0x15efd4['query'][_0x0375('0x3f')](_0x0375('0x40'))){_0x1348da[_0x0375('0x24')]=qs['limit'](_0x15efd4[_0x0375('0x37')]['limit']);_0x1348da[_0x0375('0x26')]=qs[_0x0375('0x26')](_0x15efd4[_0x0375('0x37')][_0x0375('0x26')]);}_0x1348da[_0x0375('0x5d')]=qs['sort'](_0x15efd4[_0x0375('0x37')]['sort']);_0x1348da[_0x0375('0x42')]=qs[_0x0375('0x39')](_[_0x0375('0x5e')](_0x15efd4[_0x0375('0x37')],_0x41489c[_0x0375('0x39')]));_0x1348da[_0x0375('0x42')][_0x0375('0x5f')]=_0x127668['id'];if(_0x15efd4[_0x0375('0x37')][_0x0375('0x43')]){_0x1348da[_0x0375('0x42')]=_[_0x0375('0x46')](_0x1348da[_0x0375('0x42')],{'$or':_['map'](_0x1348da['attributes'],function(_0x1c098a){var _0x7b062={};_0x7b062[_0x1c098a]={'$like':'%'+_0x15efd4[_0x0375('0x37')][_0x0375('0x43')]+'%'};return _0x7b062;})});}_0x1348da=_['merge']({},_0x1348da,_0x15efd4[_0x0375('0x47')]);return db['UserMailQueue'][_0x0375('0x4a')](_0x1348da);}})[_0x0375('0x2c')](function(_0x4e6d20){if(_0x4e6d20){return db[_0x0375('0x60')][_0x0375('0x61')]({'where':{'id':_[_0x0375('0x33')](_0x4e6d20,_0x0375('0x62')),'role':'agent'},'attributes':['id',_0x0375('0x31'),_0x0375('0x63'),_0x0375('0x64'),_0x0375('0x65')]});}})[_0x0375('0x2c')](function(_0x20d8e1){if(_0x20d8e1){return{'count':_0x20d8e1[_0x0375('0x25')],'rows':_[_0x0375('0x33')](_0x20d8e1[_0x0375('0x66')],function(_0x4fd944){return{'membername':_0x4fd944[_0x0375('0x31')],'UserId':_0x4fd944['id'],'queue_name':_0x1f527a[_0x0375('0x31')],'MailQueueId':_0x1f527a['id'],'interface':util[_0x0375('0x67')]('%s/%s',_0x0375('0x68'),_0x4fd944[_0x0375('0x31')]),'penalty':0x0,'paused':_0x4fd944[_0x0375('0x63')],'createdAt':_0x4fd944[_0x0375('0x65')],'updatedAt':_0x4fd944['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x51ab49,_0x1348da))[_0x0375('0x4e')](handleError(_0x51ab49,null));};exports[_0x0375('0x69')]=function(_0x60297f,_0x28cf3b,_0x1fe6d1){var _0x59e315={};var _0x13cce5={};var _0x3eb467;var _0x14f557;return db[_0x0375('0x34')][_0x0375('0x5b')]({'where':{'id':_0x60297f['params']['id']}})[_0x0375('0x2c')](handleEntityNotFound(_0x28cf3b,null))[_0x0375('0x2c')](function(_0xd6ff6d){if(_0xd6ff6d){_0x3eb467=_0xd6ff6d;_0x13cce5['model']=_[_0x0375('0x38')](db[_0x0375('0x6a')][_0x0375('0x35')]);_0x13cce5['query']=_[_0x0375('0x38')](_0x60297f[_0x0375('0x37')]);_0x13cce5[_0x0375('0x39')]=_[_0x0375('0x3a')](_0x13cce5[_0x0375('0x3c')],_0x13cce5[_0x0375('0x37')]);_0x59e315['attributes']=_[_0x0375('0x3a')](_0x13cce5[_0x0375('0x3c')],qs[_0x0375('0x3d')](_0x60297f['query'][_0x0375('0x3d')]));_0x59e315[_0x0375('0x3b')]=_0x59e315['attributes'][_0x0375('0x3e')]?_0x59e315[_0x0375('0x3b')]:_0x13cce5[_0x0375('0x3c')];_0x59e315[_0x0375('0x5d')]=qs[_0x0375('0x41')](_0x60297f[_0x0375('0x37')][_0x0375('0x41')]);_0x59e315[_0x0375('0x42')]=qs[_0x0375('0x39')](_['pick'](_0x60297f[_0x0375('0x37')],_0x13cce5['filters']));if(_0x60297f[_0x0375('0x37')][_0x0375('0x43')]){_0x59e315['where']=_[_0x0375('0x46')](_0x59e315[_0x0375('0x42')],{'$or':_[_0x0375('0x33')](_0x59e315[_0x0375('0x3b')],function(_0x15cea3){var _0x2b89a7={};_0x2b89a7[_0x15cea3]={'$like':'%'+_0x60297f['query'][_0x0375('0x43')]+'%'};return _0x2b89a7;})});}_0x59e315=_[_0x0375('0x46')]({},_0x59e315,_0x60297f[_0x0375('0x47')]);return _0x3eb467[_0x0375('0x69')](_0x59e315);}})['then'](function(_0x412683){if(_0x412683){_0x14f557=_0x412683['length'];if(!_0x60297f['query'][_0x0375('0x3f')](_0x0375('0x40'))){_0x59e315[_0x0375('0x24')]=qs[_0x0375('0x24')](_0x60297f[_0x0375('0x37')][_0x0375('0x24')]);_0x59e315[_0x0375('0x26')]=qs[_0x0375('0x26')](_0x60297f[_0x0375('0x37')][_0x0375('0x26')]);}return _0x3eb467[_0x0375('0x69')](_0x59e315);}})['then'](function(_0x5c17fb){if(_0x5c17fb){return _0x5c17fb?{'count':_0x14f557,'rows':_0x5c17fb}:null;}})[_0x0375('0x2c')](respondWithResult(_0x28cf3b,null))[_0x0375('0x4e')](handleError(_0x28cf3b,null));};exports['addTeams']=function(_0x157abe,_0x3e6c6c,_0x926b2){var _0x5dbe7a=_0x157abe[_0x0375('0x50')][_0x0375('0x6b')];return db['Team'][_0x0375('0x4a')]({'where':{'id':_0x5dbe7a},'attributes':['id'],'include':[{'model':db[_0x0375('0x60')],'as':_0x0375('0x6c'),'attributes':['id',_0x0375('0x31'),_0x0375('0x6d'),'voicePause',_0x0375('0x6e')],'raw':!![]}]})[_0x0375('0x2c')](function(_0x33434b){if(_0x33434b){var _0xe21d68=_[_0x0375('0x6f')](_0x33434b,function(_0x1ac1a5){var _0x25f0d6=_0x1ac1a5[_0x0375('0x2d')]({'plain':!![]});return _0x25f0d6[_0x0375('0x6c')];});return db[_0x0375('0x34')]['find']({'where':{'id':_0x157abe['params']['id']}})[_0x0375('0x2c')](function(_0x245090){return db[_0x0375('0x70')][_0x0375('0x71')](function(_0x365d53){return _0x245090[_0x0375('0x72')](_0x5dbe7a,{'transaction':_0x365d53})[_0x0375('0x2c')](function(){return BPromise['each'](_0xe21d68,function(_0x434494){return db[_0x0375('0x5c')][_0x0375('0x73')]({'where':{'UserId':_0x434494['id'],'MailQueueId':_0x157abe[_0x0375('0x4c')]['id']},'transaction':_0x365d53});});})['then'](function(){_0xe21d68[_0x0375('0x74')](function(_0x3fea9e){socket[_0x0375('0x75')](_0x0375('0x76'),{'UserId':_0x3fea9e['id'],'MailQueueId':_0x245090['id']});});});});});}})[_0x0375('0x2c')](respondWithStatusCode(_0x3e6c6c,null))[_0x0375('0x4e')](handleError(_0x3e6c6c,null));};exports[_0x0375('0x77')]=function(_0x2aae3a,_0x212964,_0x59b1eb){return db[_0x0375('0x6a')][_0x0375('0x4a')]({'where':{'id':_0x2aae3a['query'][_0x0375('0x6b')]},'attributes':['id'],'include':[{'model':db[_0x0375('0x60')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x0375('0x2c')](handleEntityNotFound(_0x212964,null))['then'](function(_0x10d910){var _0x2c32ff=_[_0x0375('0x33')](_0x10d910,'id');var _0x23b248=[];var _0x5b2e30=[];var _0x58cd94=squel['select']();_0x58cd94[_0x0375('0x78')](_0x0375('0x79'))[_0x0375('0x7a')](_0x0375('0x7b'),'tq')[_0x0375('0x7c')]('user_has_teams','ut',_0x0375('0x7d'))['where'](_0x0375('0x7e'),_0x2aae3a[_0x0375('0x4c')]['id']);for(var _0x46584=0x0;_0x46584<_0x10d910['length'];_0x46584+=0x1){let _0x28b131=_0x10d910[_0x46584];for(var _0x2f1c5e=0x0;_0x2f1c5e<_0x28b131[_0x0375('0x6c')][_0x0375('0x3e')];_0x2f1c5e+=0x1){let _0x4e5b3b=_0x28b131[_0x0375('0x6c')][_0x2f1c5e];var _0x104b43=_0x58cd94[_0x0375('0x7f')]();_0x104b43['where']('ut.UserId\x20=\x20?',_0x4e5b3b['id']);_0x5b2e30[_0x0375('0x80')](db[_0x0375('0x70')]['query'](_0x104b43[_0x0375('0x81')](),{'type':db[_0x0375('0x70')][_0x0375('0x82')]['SELECT']})[_0x0375('0x2c')](function(_0x41bc21){if(_0x41bc21[_0x0375('0x3e')]===0x1){return _0x4e5b3b['id'];}else{var _0x515cc6=_[_0x0375('0x83')](_[_0x0375('0x33')](_0x41bc21,_0x0375('0x84')),function(_0x596b8b){return _['includes'](_0x2c32ff,_0x596b8b);});if(_0x515cc6){return _0x4e5b3b['id'];}}}));}}return BPromise['all'](_0x5b2e30)[_0x0375('0x2c')](function(_0xf5889f){_0x23b248=_(_0x23b248)['union'](_0xf5889f)[_0x0375('0x85')]()['value']();return db['MailQueue']['find']({'where':{'id':_0x2aae3a[_0x0375('0x4c')]['id']}})['then'](function(_0x1024c1){return db[_0x0375('0x70')][_0x0375('0x71')](function(_0x42db7b){return _0x1024c1[_0x0375('0x77')](_0x2aae3a[_0x0375('0x37')][_0x0375('0x6b')],{'transaction':_0x42db7b})[_0x0375('0x2c')](function(){if(!_[_0x0375('0x86')](_0x23b248)){return _0x1024c1['removeAgents'](_0x23b248,{'transaction':_0x42db7b});}})[_0x0375('0x2c')](function(){_0x23b248[_0x0375('0x74')](function(_0x269141){socket[_0x0375('0x75')](_0x0375('0x87'),{'UserId':_0x269141,'MailQueueId':_0x1024c1['id']});});});});});});})[_0x0375('0x2c')](respondWithStatusCode(_0x212964,null))[_0x0375('0x4e')](handleError(_0x212964,null));};exports[_0x0375('0x88')]=function(_0x40b684,_0x469ad4,_0x383fa4){return db[_0x0375('0x34')][_0x0375('0x4d')]({'where':{'id':_0x40b684['params']['id']}})[_0x0375('0x2c')](handleEntityNotFound(_0x469ad4,null))[_0x0375('0x2c')](function(_0x718b40){if(_0x718b40){return _0x718b40['addAgents'](_0x40b684[_0x0375('0x50')][_0x0375('0x6b')],_[_0x0375('0x89')](_0x40b684[_0x0375('0x50')],[_0x0375('0x6b'),'id'])||{})[_0x0375('0x8a')](function(_0x5a1bed){for(var _0x25ac26=0x0;_0x25ac26<_0x40b684[_0x0375('0x50')][_0x0375('0x6b')]['length'];_0x25ac26+=0x1){socket[_0x0375('0x75')](_0x0375('0x76'),{'UserId':Number(_0x40b684[_0x0375('0x50')][_0x0375('0x6b')][_0x25ac26]),'MailQueueId':Number(_0x40b684[_0x0375('0x4c')]['id'])});}return _0x5a1bed;});}})[_0x0375('0x2c')](respondWithResult(_0x469ad4,null))[_0x0375('0x4e')](handleError(_0x469ad4,null));};exports[_0x0375('0x8b')]=function(_0x59cbec,_0x375b6a,_0x315d6d){return db[_0x0375('0x34')][_0x0375('0x4d')]({'where':{'id':_0x59cbec[_0x0375('0x4c')]['id']}})['then'](handleEntityNotFound(_0x375b6a,null))[_0x0375('0x2c')](function(_0x4d2880){if(_0x4d2880){return _0x4d2880[_0x0375('0x8b')](_0x59cbec['query']['ids'])[_0x0375('0x2c')](function(){if(_[_0x0375('0x8c')](_0x59cbec[_0x0375('0x37')][_0x0375('0x6b')])){for(var _0x2393cc=0x0;_0x2393cc<_0x59cbec['query'][_0x0375('0x6b')][_0x0375('0x3e')];_0x2393cc+=0x1){socket[_0x0375('0x75')]('userMailQueue:remove',{'UserId':Number(_0x59cbec[_0x0375('0x37')][_0x0375('0x6b')][_0x2393cc]),'MailQueueId':Number(_0x59cbec[_0x0375('0x4c')]['id'])});}}else{socket[_0x0375('0x75')](_0x0375('0x87'),{'UserId':Number(_0x59cbec[_0x0375('0x37')][_0x0375('0x6b')]),'MailQueueId':Number(_0x59cbec[_0x0375('0x4c')]['id'])});}});}})[_0x0375('0x2c')](respondWithStatusCode(_0x375b6a,null))['catch'](handleError(_0x375b6a,null));};exports[_0x0375('0x8d')]=function(_0x3cf493,_0x5e3e04,_0x50c2a5){var _0x3fc982={};var _0x36da6b={};var _0x250e49;var _0x10ec45;return db[_0x0375('0x34')]['findOne']({'where':{'id':_0x3cf493[_0x0375('0x4c')]['id']}})[_0x0375('0x2c')](handleEntityNotFound(_0x5e3e04,null))[_0x0375('0x2c')](function(_0x591506){if(_0x591506){_0x250e49=_0x591506;_0x36da6b[_0x0375('0x3c')]=_[_0x0375('0x38')](db[_0x0375('0x60')][_0x0375('0x35')]);_0x36da6b['query']=_[_0x0375('0x38')](_0x3cf493[_0x0375('0x37')]);_0x36da6b[_0x0375('0x39')]=_['intersection'](_0x36da6b[_0x0375('0x3c')],_0x36da6b[_0x0375('0x37')]);_0x3fc982[_0x0375('0x3b')]=_[_0x0375('0x3a')](_0x36da6b[_0x0375('0x3c')],qs['fields'](_0x3cf493['query'][_0x0375('0x3d')]));_0x3fc982['attributes']=_0x3fc982[_0x0375('0x3b')][_0x0375('0x3e')]?_0x3fc982[_0x0375('0x3b')]:_0x36da6b[_0x0375('0x3c')];_0x3fc982[_0x0375('0x5d')]=qs[_0x0375('0x41')](_0x3cf493[_0x0375('0x37')][_0x0375('0x41')]);_0x3fc982[_0x0375('0x42')]=qs[_0x0375('0x39')](_[_0x0375('0x5e')](_0x3cf493[_0x0375('0x37')],_0x36da6b[_0x0375('0x39')]));if(_0x3cf493['query']['filter']){_0x3fc982[_0x0375('0x42')]=_[_0x0375('0x46')](_0x3fc982[_0x0375('0x42')],{'$or':_[_0x0375('0x33')](_0x3fc982[_0x0375('0x3b')],function(_0x559e87){var _0x110e5b={};_0x110e5b[_0x559e87]={'$like':'%'+_0x3cf493[_0x0375('0x37')]['filter']+'%'};return _0x110e5b;})});}_0x3fc982=_[_0x0375('0x46')]({},_0x3fc982,_0x3cf493[_0x0375('0x47')]);return _0x250e49[_0x0375('0x8d')](_0x3fc982);}})[_0x0375('0x2c')](function(_0x5bdccd){if(_0x5bdccd){_0x10ec45=_0x5bdccd['length'];if(!_0x3cf493[_0x0375('0x37')][_0x0375('0x3f')](_0x0375('0x40'))){_0x3fc982[_0x0375('0x24')]=qs['limit'](_0x3cf493['query'][_0x0375('0x24')]);_0x3fc982[_0x0375('0x26')]=qs['offset'](_0x3cf493[_0x0375('0x37')][_0x0375('0x26')]);}return _0x250e49[_0x0375('0x8d')](_0x3fc982);}})[_0x0375('0x2c')](function(_0x16c2a5){if(_0x16c2a5){return _0x16c2a5?{'count':_0x10ec45,'rows':_0x16c2a5}:null;}})[_0x0375('0x2c')](respondWithResult(_0x5e3e04,null))[_0x0375('0x4e')](handleError(_0x5e3e04,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index ed93792..f55b9fa 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 _0x724e=['../../mysqldb','MailQueue','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x43b5ef,_0x9b59c3){var _0x40c238=function(_0x30f021){while(--_0x30f021){_0x43b5ef['push'](_0x43b5ef['shift']());}};_0x40c238(++_0x9b59c3);}(_0x724e,0x128));var _0xe724=function(_0xee6393,_0x2a7d1a){_0xee6393=_0xee6393-0x0;var _0x3ade12=_0x724e[_0xee6393];return _0x3ade12;};'use strict';var EventEmitter=require(_0xe724('0x0'));var MailQueue=require(_0xe724('0x1'))['db'][_0xe724('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xe724('0x3'),'afterDestroy':_0xe724('0x4')};function emitEvent(_0x3024b6){return function(_0x1ee3f,_0xc83335,_0x4666cd){MailQueueEvents['emit'](_0x3024b6+':'+_0x1ee3f['id'],_0x1ee3f);MailQueueEvents[_0xe724('0x5')](_0x3024b6,_0x1ee3f);_0x4666cd(null);};}for(var e in events){if(events[_0xe724('0x6')](e)){var event=events[e];MailQueue[_0xe724('0x7')](e,emitEvent(event));}}module[_0xe724('0x8')]=MailQueueEvents; \ No newline at end of file +var _0x59b2=['exports','../../mysqldb','MailQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0x59b2,0xa1));var _0x259b=function(_0x58175c,_0x2d9373){_0x58175c=_0x58175c-0x0;var _0x55b88f=_0x59b2[_0x58175c];return _0x55b88f;};'use strict';var EventEmitter=require('events');var MailQueue=require(_0x259b('0x0'))['db'][_0x259b('0x1')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x259b('0x2')](0x0);var events={'afterCreate':_0x259b('0x3'),'afterUpdate':_0x259b('0x4'),'afterDestroy':_0x259b('0x5')};function emitEvent(_0x3d9b09){return function(_0x566bc7,_0x1547db,_0x475a20){MailQueueEvents['emit'](_0x3d9b09+':'+_0x566bc7['id'],_0x566bc7);MailQueueEvents[_0x259b('0x6')](_0x3d9b09,_0x566bc7);_0x475a20(null);};}for(var e in events){if(events[_0x259b('0x7')](e)){var event=events[e];MailQueue[_0x259b('0x8')](e,emitEvent(event));}}module[_0x259b('0x9')]=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index c0625ce..06e53eb 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 _0xe81c=['moment','bluebird','request-promise','rimraf','../../config/environment','./mailQueue.attributes','exports','MailQueue','mail_queues','util','api'];(function(_0x39f2d3,_0x7971a0){var _0x488364=function(_0x59182f){while(--_0x59182f){_0x39f2d3['push'](_0x39f2d3['shift']());}};_0x488364(++_0x7971a0);}(_0xe81c,0x174));var _0xce81=function(_0x13b3b5,_0x52d8d8){_0x13b3b5=_0x13b3b5-0x0;var _0x337cd0=_0xe81c[_0x13b3b5];return _0x337cd0;};'use strict';var _=require('lodash');var util=require(_0xce81('0x0'));var logger=require('../../config/logger')(_0xce81('0x1'));var moment=require(_0xce81('0x2'));var BPromise=require(_0xce81('0x3'));var rp=require(_0xce81('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xce81('0x5'));var config=require(_0xce81('0x6'));var attributes=require(_0xce81('0x7'));module[_0xce81('0x8')]=function(_0x3f9206,_0x18d155){return _0x3f9206['define'](_0xce81('0x9'),attributes,{'tableName':_0xce81('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6ad7=['path','rimraf','../../config/environment','exports','define','MailQueue','mail_queues','lodash','util','api','moment','bluebird','request-promise'];(function(_0xe139e8,_0xc4fcd5){var _0x581f00=function(_0x136202){while(--_0x136202){_0xe139e8['push'](_0xe139e8['shift']());}};_0x581f00(++_0xc4fcd5);}(_0x6ad7,0x1a7));var _0x76ad=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6ad7[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x76ad('0x0'));var util=require(_0x76ad('0x1'));var logger=require('../../config/logger')(_0x76ad('0x2'));var moment=require(_0x76ad('0x3'));var BPromise=require(_0x76ad('0x4'));var rp=require(_0x76ad('0x5'));var fs=require('fs');var path=require(_0x76ad('0x6'));var rimraf=require(_0x76ad('0x7'));var config=require(_0x76ad('0x8'));var attributes=require('./mailQueue.attributes');module[_0x76ad('0x9')]=function(_0x2ec165,_0x4f09aa){return _0x2ec165[_0x76ad('0xa')](_0x76ad('0xb'),attributes,{'tableName':_0x76ad('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 2e334b6..4107475 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 _0x3706=['options','where','attributes','limit','include','map','model','MailQueue','raw','ShowMailQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','./mailQueue.socket','register','then','info','MailQueue,\x20%s,\x20%s','debug','MailQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','GetMailQueue','findAll'];(function(_0x11b9fa,_0x50b79b){var _0x13410c=function(_0x598256){while(--_0x598256){_0x11b9fa['push'](_0x11b9fa['shift']());}};_0x13410c(++_0x50b79b);}(_0x3706,0x169));var _0x6370=function(_0xbb9dbf,_0x5dafa4){_0xbb9dbf=_0xbb9dbf-0x0;var _0x30223c=_0x3706[_0xbb9dbf];return _0x30223c;};'use strict';var _=require(_0x6370('0x0'));var util=require(_0x6370('0x1'));var moment=require(_0x6370('0x2'));var BPromise=require(_0x6370('0x3'));var rs=require(_0x6370('0x4'));var fs=require('fs');var Redis=require(_0x6370('0x5'));var db=require(_0x6370('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x6370('0x7'))(_0x6370('0x8'));var config=require('../../config/environment');var jayson=require(_0x6370('0x9'));var client=jayson[_0x6370('0xa')][_0x6370('0xb')]({'port':0x232a});config[_0x6370('0xc')]=_['defaults'](config[_0x6370('0xc')],{'host':_0x6370('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x6370('0xe'))[_0x6370('0xf')](socket);function respondWithRpcPromise(_0x9ebe7f,_0x39dd7b,_0x40ac61){return new BPromise(function(_0x2eb827,_0x3af8a7){return client['request'](_0x9ebe7f,_0x40ac61)[_0x6370('0x10')](function(_0x3447e3){logger[_0x6370('0x11')](_0x6370('0x12'),_0x39dd7b,'request\x20sent');logger[_0x6370('0x13')](_0x6370('0x14'),_0x39dd7b,_0x6370('0x15'),JSON[_0x6370('0x16')](_0x3447e3));if(_0x3447e3[_0x6370('0x17')]){if(_0x3447e3[_0x6370('0x17')]['code']===0x1f4){logger[_0x6370('0x17')](_0x6370('0x12'),_0x39dd7b,_0x3447e3['error'][_0x6370('0x18')]);return _0x3af8a7(_0x3447e3[_0x6370('0x17')][_0x6370('0x18')]);}logger['error'](_0x6370('0x12'),_0x39dd7b,_0x3447e3[_0x6370('0x17')]['message']);return _0x2eb827(_0x3447e3[_0x6370('0x17')][_0x6370('0x18')]);}else{logger[_0x6370('0x11')](_0x6370('0x12'),_0x39dd7b,_0x6370('0x15'));_0x2eb827(_0x3447e3[_0x6370('0x19')][_0x6370('0x18')]);}})[_0x6370('0x1a')](function(_0x238bbe){logger[_0x6370('0x17')]('MailQueue,\x20%s,\x20%s',_0x39dd7b,_0x238bbe);_0x3af8a7(_0x238bbe);});});}exports[_0x6370('0x1b')]=function(_0x58b823){var _0x1bfb5f=this;return new Promise(function(_0x177e5f,_0x511c3c){return db['MailQueue'][_0x6370('0x1c')]({'raw':_0x58b823[_0x6370('0x1d')]?_0x58b823[_0x6370('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x58b823[_0x6370('0x1d')]?_0x58b823[_0x6370('0x1d')][_0x6370('0x1e')]||null:null,'attributes':_0x58b823['options']?_0x58b823[_0x6370('0x1d')][_0x6370('0x1f')]||null:null,'limit':_0x58b823[_0x6370('0x1d')]?_0x58b823[_0x6370('0x1d')][_0x6370('0x20')]||null:null,'include':_0x58b823[_0x6370('0x1d')]?_0x58b823[_0x6370('0x1d')][_0x6370('0x21')]?_[_0x6370('0x22')](_0x58b823[_0x6370('0x1d')]['include'],function(_0x25c572){return{'model':db[_0x25c572[_0x6370('0x23')]],'as':_0x25c572['as'],'attributes':_0x25c572[_0x6370('0x1f')],'include':_0x25c572[_0x6370('0x21')]?_[_0x6370('0x22')](_0x25c572[_0x6370('0x21')],function(_0x10590e){return{'model':db[_0x10590e[_0x6370('0x23')]],'as':_0x10590e['as'],'attributes':_0x10590e['attributes'],'include':_0x10590e[_0x6370('0x21')]?_[_0x6370('0x22')](_0x10590e['include'],function(_0x4f94ab){return{'model':db[_0x4f94ab['model']],'as':_0x4f94ab['as'],'attributes':_0x4f94ab['attributes']};}):[]};}):[]};}):[]:[]})[_0x6370('0x10')](function(_0x32d880){logger[_0x6370('0x11')](_0x6370('0x1b'),_0x58b823);logger['debug'](_0x6370('0x1b'),_0x58b823,JSON['stringify'](_0x32d880));_0x177e5f(_0x32d880);})[_0x6370('0x1a')](function(_0x1c97cd){logger['error']('GetMailQueue',_0x1c97cd['message'],_0x58b823);_0x511c3c(_0x1bfb5f[_0x6370('0x17')](0x1f4,_0x1c97cd['message']));});});};exports['ShowMailQueue']=function(_0x529369){var _0xb0e56e=this;return new Promise(function(_0x1727e6,_0x64757c){return db[_0x6370('0x24')]['find']({'raw':_0x529369[_0x6370('0x1d')]?_0x529369[_0x6370('0x1d')][_0x6370('0x25')]===undefined?!![]:![]:!![],'where':_0x529369[_0x6370('0x1d')]?_0x529369[_0x6370('0x1d')][_0x6370('0x1e')]||null:null,'attributes':_0x529369[_0x6370('0x1d')]?_0x529369['options'][_0x6370('0x1f')]||null:null,'include':_0x529369[_0x6370('0x1d')]?_0x529369[_0x6370('0x1d')][_0x6370('0x21')]?_[_0x6370('0x22')](_0x529369['options'][_0x6370('0x21')],function(_0x63bb58){return{'model':db[_0x63bb58[_0x6370('0x23')]],'as':_0x63bb58['as'],'attributes':_0x63bb58[_0x6370('0x1f')],'include':_0x63bb58[_0x6370('0x21')]?_[_0x6370('0x22')](_0x63bb58[_0x6370('0x21')],function(_0x14da81){return{'model':db[_0x14da81[_0x6370('0x23')]],'as':_0x14da81['as'],'attributes':_0x14da81[_0x6370('0x1f')],'include':_0x14da81[_0x6370('0x21')]?_[_0x6370('0x22')](_0x14da81[_0x6370('0x21')],function(_0x2e8ac3){return{'model':db[_0x2e8ac3[_0x6370('0x23')]],'as':_0x2e8ac3['as'],'attributes':_0x2e8ac3[_0x6370('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3d0661){logger['info'](_0x6370('0x26'),_0x529369);logger[_0x6370('0x13')](_0x6370('0x26'),_0x529369,JSON[_0x6370('0x16')](_0x3d0661));_0x1727e6(_0x3d0661);})['catch'](function(_0x3969ba){logger[_0x6370('0x17')](_0x6370('0x26'),_0x3969ba[_0x6370('0x18')],_0x529369);_0x64757c(_0xb0e56e[_0x6370('0x17')](0x1f4,_0x3969ba['message']));});});}; \ No newline at end of file +var _0x52fc=['error','code','MailQueue,\x20%s,\x20%s','message','catch','findAll','options','raw','where','attributes','limit','map','include','model','GetMailQueue','ShowMailQueue','find','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','socket.io-emitter','./mailQueue.socket','request','then','info','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x5916b3,_0x50b4ba){var _0x424254=function(_0x1d11bf){while(--_0x1d11bf){_0x5916b3['push'](_0x5916b3['shift']());}};_0x424254(++_0x50b4ba);}(_0x52fc,0xc5));var _0xc52f=function(_0x1cbed3,_0x13f712){_0x1cbed3=_0x1cbed3-0x0;var _0x4ecfe8=_0x52fc[_0x1cbed3];return _0x4ecfe8;};'use strict';var _=require(_0xc52f('0x0'));var util=require(_0xc52f('0x1'));var moment=require(_0xc52f('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc52f('0x3'));var db=require(_0xc52f('0x4'))['db'];var utils=require(_0xc52f('0x5'));var logger=require(_0xc52f('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xc52f('0x7'));var client=jayson[_0xc52f('0x8')][_0xc52f('0x9')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xc52f('0xa'))(new Redis(config['redis']));require(_0xc52f('0xb'))['register'](socket);function respondWithRpcPromise(_0x37a3df,_0x2cd17b,_0x4e75bb){return new BPromise(function(_0x1dadc8,_0x20e49f){return client[_0xc52f('0xc')](_0x37a3df,_0x4e75bb)[_0xc52f('0xd')](function(_0x4bd6aa){logger[_0xc52f('0xe')]('MailQueue,\x20%s,\x20%s',_0x2cd17b,_0xc52f('0xf'));logger[_0xc52f('0x10')](_0xc52f('0x11'),_0x2cd17b,_0xc52f('0xf'),JSON[_0xc52f('0x12')](_0x4bd6aa));if(_0x4bd6aa[_0xc52f('0x13')]){if(_0x4bd6aa['error'][_0xc52f('0x14')]===0x1f4){logger[_0xc52f('0x13')](_0xc52f('0x15'),_0x2cd17b,_0x4bd6aa[_0xc52f('0x13')][_0xc52f('0x16')]);return _0x20e49f(_0x4bd6aa['error'][_0xc52f('0x16')]);}logger[_0xc52f('0x13')](_0xc52f('0x15'),_0x2cd17b,_0x4bd6aa[_0xc52f('0x13')]['message']);return _0x1dadc8(_0x4bd6aa[_0xc52f('0x13')][_0xc52f('0x16')]);}else{logger[_0xc52f('0xe')](_0xc52f('0x15'),_0x2cd17b,_0xc52f('0xf'));_0x1dadc8(_0x4bd6aa['result'][_0xc52f('0x16')]);}})[_0xc52f('0x17')](function(_0x2f2aab){logger[_0xc52f('0x13')](_0xc52f('0x15'),_0x2cd17b,_0x2f2aab);_0x20e49f(_0x2f2aab);});});}exports['GetMailQueue']=function(_0x32159d){var _0x18e4ad=this;return new Promise(function(_0x4c8ae7,_0x5e3663){return db['MailQueue'][_0xc52f('0x18')]({'raw':_0x32159d[_0xc52f('0x19')]?_0x32159d['options'][_0xc52f('0x1a')]===undefined?!![]:![]:!![],'where':_0x32159d[_0xc52f('0x19')]?_0x32159d[_0xc52f('0x19')][_0xc52f('0x1b')]||null:null,'attributes':_0x32159d[_0xc52f('0x19')]?_0x32159d['options'][_0xc52f('0x1c')]||null:null,'limit':_0x32159d['options']?_0x32159d[_0xc52f('0x19')][_0xc52f('0x1d')]||null:null,'include':_0x32159d[_0xc52f('0x19')]?_0x32159d[_0xc52f('0x19')]['include']?_[_0xc52f('0x1e')](_0x32159d[_0xc52f('0x19')][_0xc52f('0x1f')],function(_0x319189){return{'model':db[_0x319189[_0xc52f('0x20')]],'as':_0x319189['as'],'attributes':_0x319189[_0xc52f('0x1c')],'include':_0x319189['include']?_[_0xc52f('0x1e')](_0x319189[_0xc52f('0x1f')],function(_0xd17963){return{'model':db[_0xd17963['model']],'as':_0xd17963['as'],'attributes':_0xd17963[_0xc52f('0x1c')],'include':_0xd17963['include']?_[_0xc52f('0x1e')](_0xd17963[_0xc52f('0x1f')],function(_0x3382de){return{'model':db[_0x3382de[_0xc52f('0x20')]],'as':_0x3382de['as'],'attributes':_0x3382de[_0xc52f('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x32a81a){logger[_0xc52f('0xe')](_0xc52f('0x21'),_0x32159d);logger['debug'](_0xc52f('0x21'),_0x32159d,JSON[_0xc52f('0x12')](_0x32a81a));_0x4c8ae7(_0x32a81a);})['catch'](function(_0x4ce0ab){logger['error'](_0xc52f('0x21'),_0x4ce0ab[_0xc52f('0x16')],_0x32159d);_0x5e3663(_0x18e4ad[_0xc52f('0x13')](0x1f4,_0x4ce0ab[_0xc52f('0x16')]));});});};exports[_0xc52f('0x22')]=function(_0x42c7f3){var _0x35b800=this;return new Promise(function(_0x569db4,_0x2a9588){return db['MailQueue'][_0xc52f('0x23')]({'raw':_0x42c7f3[_0xc52f('0x19')]?_0x42c7f3[_0xc52f('0x19')][_0xc52f('0x1a')]===undefined?!![]:![]:!![],'where':_0x42c7f3['options']?_0x42c7f3[_0xc52f('0x19')][_0xc52f('0x1b')]||null:null,'attributes':_0x42c7f3['options']?_0x42c7f3['options'][_0xc52f('0x1c')]||null:null,'include':_0x42c7f3[_0xc52f('0x19')]?_0x42c7f3[_0xc52f('0x19')]['include']?_[_0xc52f('0x1e')](_0x42c7f3[_0xc52f('0x19')]['include'],function(_0x12b507){return{'model':db[_0x12b507[_0xc52f('0x20')]],'as':_0x12b507['as'],'attributes':_0x12b507[_0xc52f('0x1c')],'include':_0x12b507['include']?_['map'](_0x12b507[_0xc52f('0x1f')],function(_0x2a5b89){return{'model':db[_0x2a5b89[_0xc52f('0x20')]],'as':_0x2a5b89['as'],'attributes':_0x2a5b89['attributes'],'include':_0x2a5b89[_0xc52f('0x1f')]?_[_0xc52f('0x1e')](_0x2a5b89['include'],function(_0x1fc954){return{'model':db[_0x1fc954[_0xc52f('0x20')]],'as':_0x1fc954['as'],'attributes':_0x1fc954['attributes']};}):[]};}):[]};}):[]:[]})[_0xc52f('0xd')](function(_0x167b25){logger[_0xc52f('0xe')](_0xc52f('0x22'),_0x42c7f3);logger['debug'](_0xc52f('0x22'),_0x42c7f3,JSON[_0xc52f('0x12')](_0x167b25));_0x569db4(_0x167b25);})[_0xc52f('0x17')](function(_0x28a19a){logger['error'](_0xc52f('0x22'),_0x28a19a[_0xc52f('0x16')],_0x42c7f3);_0x2a9588(_0x35b800[_0xc52f('0x13')](0x1f4,_0x28a19a['message']));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index 7e8603f..0fe4705 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 _0x2781=['./mailQueue.events','save','remove','update','emit','register'];(function(_0x32be30,_0x2ab00f){var _0x33b63b=function(_0x40d291){while(--_0x40d291){_0x32be30['push'](_0x32be30['shift']());}};_0x33b63b(++_0x2ab00f);}(_0x2781,0xe4));var _0x1278=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x2781[_0x160c73];return _0xd9302;};'use strict';var MailQueueEvents=require(_0x1278('0x0'));var events=[_0x1278('0x1'),_0x1278('0x2'),_0x1278('0x3')];function createListener(_0x230714,_0x3d207d){return function(_0x104be9){_0x3d207d[_0x1278('0x4')](_0x230714,_0x104be9);};}function removeListener(_0x1ef54c,_0x102fd4){return function(){MailQueueEvents['removeListener'](_0x1ef54c,_0x102fd4);};}exports[_0x1278('0x5')]=function(_0x216adf){for(var _0x5646b6=0x0,_0x387240=events['length'];_0x5646b6<_0x387240;_0x5646b6++){var _0x2b3476=events[_0x5646b6];var _0x31afae=createListener('mailQueue:'+_0x2b3476,_0x216adf);MailQueueEvents['on'](_0x2b3476,_0x31afae);}}; \ No newline at end of file +var _0x16f2=['./mailQueue.events','save','remove','update','register','length'];(function(_0x320699,_0x24e253){var _0x1f5c28=function(_0x2b6040){while(--_0x2b6040){_0x320699['push'](_0x320699['shift']());}};_0x1f5c28(++_0x24e253);}(_0x16f2,0x150));var _0x216f=function(_0x31db2b,_0xb218b7){_0x31db2b=_0x31db2b-0x0;var _0x1459a0=_0x16f2[_0x31db2b];return _0x1459a0;};'use strict';var MailQueueEvents=require(_0x216f('0x0'));var events=[_0x216f('0x1'),_0x216f('0x2'),_0x216f('0x3')];function createListener(_0x35b406,_0x3649c3){return function(_0x44078e){_0x3649c3['emit'](_0x35b406,_0x44078e);};}function removeListener(_0x2b956b,_0x424973){return function(){MailQueueEvents['removeListener'](_0x2b956b,_0x424973);};}exports[_0x216f('0x4')]=function(_0x11e82c){for(var _0xcad11d=0x0,_0x2170b4=events[_0x216f('0x5')];_0xcad11d<_0x2170b4;_0xcad11d++){var _0x203c82=events[_0xcad11d];var _0x333cf5=createListener('mailQueue:'+_0x203c82,_0x11e82c);MailQueueEvents['on'](_0x203c82,_0x333cf5);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index ccdbb74..1da6c66 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 _0xe423=['../../config/environment','./mailQueueReport.controller','isAuthenticated','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x415e5d,_0x44cc86){var _0x1973f3=function(_0x285bcc){while(--_0x285bcc){_0x415e5d['push'](_0x415e5d['shift']());}};_0x1973f3(++_0x44cc86);}(_0xe423,0x199));var _0x3e42=function(_0x5a5f79,_0x48716b){_0x5a5f79=_0x5a5f79-0x0;var _0x2ba09c=_0xe423[_0x5a5f79];return _0x2ba09c;};'use strict';var multer=require(_0x3e42('0x0'));var util=require(_0x3e42('0x1'));var path=require(_0x3e42('0x2'));var timeout=require(_0x3e42('0x3'));var express=require(_0x3e42('0x4'));var router=express[_0x3e42('0x5')]();var fs_extra=require(_0x3e42('0x6'));var auth=require(_0x3e42('0x7'));var interaction=require(_0x3e42('0x8'));var config=require(_0x3e42('0x9'));var controller=require(_0x3e42('0xa'));router['get']('/',auth[_0x3e42('0xb')](),controller['index']);router['get']('/describe',auth['isAuthenticated'](),controller[_0x3e42('0xc')]);router['get'](_0x3e42('0xd'),auth[_0x3e42('0xb')](),controller[_0x3e42('0xe')]);router[_0x3e42('0xf')]('/',auth[_0x3e42('0xb')](),controller[_0x3e42('0x10')]);router[_0x3e42('0x11')](_0x3e42('0xd'),auth['isAuthenticated'](),controller[_0x3e42('0x12')]);router[_0x3e42('0x13')]('/:id',auth[_0x3e42('0xb')](),controller[_0x3e42('0x14')]);module[_0x3e42('0x15')]=router; \ No newline at end of file +var _0x6e21=['index','/describe','/:id','post','create','put','exports','util','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueueReport.controller','get','isAuthenticated'];(function(_0x32668b,_0x247ce9){var _0x4b4e6f=function(_0x207e1d){while(--_0x207e1d){_0x32668b['push'](_0x32668b['shift']());}};_0x4b4e6f(++_0x247ce9);}(_0x6e21,0x1c9));var _0x16e2=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x6e21[_0x4565bf];return _0x5610ba;};'use strict';var multer=require('multer');var util=require(_0x16e2('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x16e2('0x1')]();var fs_extra=require('fs-extra');var auth=require(_0x16e2('0x2'));var interaction=require(_0x16e2('0x3'));var config=require(_0x16e2('0x4'));var controller=require(_0x16e2('0x5'));router[_0x16e2('0x6')]('/',auth[_0x16e2('0x7')](),controller[_0x16e2('0x8')]);router['get'](_0x16e2('0x9'),auth[_0x16e2('0x7')](),controller['describe']);router[_0x16e2('0x6')](_0x16e2('0xa'),auth[_0x16e2('0x7')](),controller['show']);router[_0x16e2('0xb')]('/',auth[_0x16e2('0x7')](),controller[_0x16e2('0xc')]);router[_0x16e2('0xd')](_0x16e2('0xa'),auth[_0x16e2('0x7')](),controller['update']);router['delete'](_0x16e2('0xa'),auth[_0x16e2('0x7')](),controller['destroy']);module[_0x16e2('0xe')]=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index b606f1c..9ba52c6 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 _0x6cfa=['STRING','DATE','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6cfa,0xa1));var _0xa6cf=function(_0x1d5e0e,_0x40f9eb){_0x1d5e0e=_0x1d5e0e-0x0;var _0x1acedc=_0x6cfa[_0x1d5e0e];return _0x1acedc;};'use strict';var moment=require(_0xa6cf('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0xa6cf('0x1')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xa6cf('0x2')]},'leaveAt':{'type':Sequelize[_0xa6cf('0x2')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x7af0=['STRING','moment','sequelize','DATE'];(function(_0x52b65e,_0x2e216e){var _0x27be92=function(_0xcffe7c){while(--_0xcffe7c){_0x52b65e['push'](_0x52b65e['shift']());}};_0x27be92(++_0x2e216e);}(_0x7af0,0x139));var _0x07af=function(_0x497b1e,_0x586379){_0x497b1e=_0x497b1e-0x0;var _0x3f72e1=_0x7af0[_0x497b1e];return _0x3f72e1;};'use strict';var moment=require(_0x07af('0x0'));var Sequelize=require(_0x07af('0x1'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x07af('0x2')]},'leaveAt':{'type':Sequelize[_0x07af('0x2')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x07af('0x2')]},'reason':{'type':Sequelize[_0x07af('0x3')]}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index b13fb97..ec71756 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 _0xd824=['../../config/environment','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','then','destroy','error','stack','name','send','index','MailQueueReport','rawAttributes','type','key','query','keys','intersection','attributes','fields','length','model','hasOwnProperty','order','sort','where','pick','filters','filter','options','includeAll','include','findAll','rows','catch','show','params','merge','find','create','body','describe','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','ejs','squel','crypto','jsforce','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils'];(function(_0xdd2bfa,_0x5bd304){var _0x55397e=function(_0x196f7d){while(--_0x196f7d){_0xdd2bfa['push'](_0xdd2bfa['shift']());}};_0x55397e(++_0x5bd304);}(_0xd824,0xc2));var _0x4d82=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd824[_0x122ef9];return _0x42fba0;};'use strict';var emlformat=require(_0x4d82('0x0'));var rimraf=require(_0x4d82('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x4d82('0x2'));var moment=require(_0x4d82('0x3'));var BPromise=require(_0x4d82('0x4'));var Mustache=require(_0x4d82('0x5'));var util=require(_0x4d82('0x6'));var path=require(_0x4d82('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x4d82('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x4d82('0x9'));var crypto=require(_0x4d82('0xa'));var jsforce=require(_0x4d82('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x4d82('0xc'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4d82('0xd'));var authService=require(_0x4d82('0xe'));var qs=require(_0x4d82('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4d82('0x10'));var logger=require('../../config/logger')(_0x4d82('0x11'));var utils=require(_0x4d82('0x12'));var config=require(_0x4d82('0x13'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x346394,_0x248eed){_0x248eed=_0x248eed||0xcc;return function(_0x319ba8){if(_0x319ba8){return _0x346394[_0x4d82('0x14')](_0x248eed);}return _0x346394['status'](_0x248eed)[_0x4d82('0x15')]();};}function respondWithResult(_0x2094bc,_0x41f5b2){_0x41f5b2=_0x41f5b2||0xc8;return function(_0x486152){if(_0x486152){return _0x2094bc[_0x4d82('0x16')](_0x41f5b2)['json'](_0x486152);}};}function respondWithFilteredResult(_0x3382c4,_0x5012db){return function(_0x469e09){if(_0x469e09){var _0x496f3b=typeof _0x5012db[_0x4d82('0x17')]===_0x4d82('0x18')&&typeof _0x5012db[_0x4d82('0x19')]===_0x4d82('0x18');var _0x2648a8=_0x469e09[_0x4d82('0x1a')];var _0x258c59=_0x496f3b?0x0:_0x5012db[_0x4d82('0x17')];var _0x2f2127=_0x496f3b?_0x469e09['count']:_0x5012db[_0x4d82('0x17')]+_0x5012db[_0x4d82('0x19')];var _0x1b1e39;if(_0x2f2127>=_0x2648a8){_0x2f2127=_0x2648a8;_0x1b1e39=0xc8;}else{_0x1b1e39=0xce;}_0x3382c4[_0x4d82('0x16')](_0x1b1e39);return _0x3382c4[_0x4d82('0x1b')](_0x4d82('0x1c'),_0x258c59+'-'+_0x2f2127+'/'+_0x2648a8)[_0x4d82('0x1d')](_0x469e09);}return null;};}function patchUpdates(_0x64669c){return function(_0x19832f){try{jsonpatch[_0x4d82('0x1e')](_0x19832f,_0x64669c,!![]);}catch(_0xf2f5a5){return BPromise['reject'](_0xf2f5a5);}return _0x19832f[_0x4d82('0x1f')]();};}function saveUpdates(_0x748ee7,_0x5e5bdf){return function(_0x1a419f){if(_0x1a419f){return _0x1a419f[_0x4d82('0x20')](_0x748ee7)[_0x4d82('0x21')](function(_0x14a2d4){return _0x14a2d4;});}return null;};}function removeEntity(_0xe17d70,_0x15f5d1){return function(_0x11c043){if(_0x11c043){return _0x11c043[_0x4d82('0x22')]()[_0x4d82('0x21')](function(){_0xe17d70[_0x4d82('0x16')](0xcc)[_0x4d82('0x15')]();});}};}function handleEntityNotFound(_0x395efc,_0x7404ba){return function(_0x284c66){if(!_0x284c66){_0x395efc[_0x4d82('0x14')](0x194);}return _0x284c66;};}function handleError(_0x4af6da,_0x5e0b03){_0x5e0b03=_0x5e0b03||0x1f4;return function(_0x3dcb0f){logger[_0x4d82('0x23')](_0x3dcb0f[_0x4d82('0x24')]);if(_0x3dcb0f[_0x4d82('0x25')]){delete _0x3dcb0f['name'];}_0x4af6da[_0x4d82('0x16')](_0x5e0b03)[_0x4d82('0x26')](_0x3dcb0f);};}exports[_0x4d82('0x27')]=function(_0x11d022,_0x5ce98b){var _0x4081f6={},_0x4a7444={},_0x4d9ac4={'count':0x0,'rows':[]};var _0x487581=_['map'](db[_0x4d82('0x28')][_0x4d82('0x29')],function(_0x88318c){return{'name':_0x88318c['fieldName'],'type':_0x88318c[_0x4d82('0x2a')][_0x4d82('0x2b')]};});_0x4a7444['model']=_['map'](_0x487581,_0x4d82('0x25'));_0x4a7444[_0x4d82('0x2c')]=_[_0x4d82('0x2d')](_0x11d022[_0x4d82('0x2c')]);_0x4a7444['filters']=_[_0x4d82('0x2e')](_0x4a7444['model'],_0x4a7444[_0x4d82('0x2c')]);_0x4081f6[_0x4d82('0x2f')]=_['intersection'](_0x4a7444['model'],qs[_0x4d82('0x30')](_0x11d022[_0x4d82('0x2c')][_0x4d82('0x30')]));_0x4081f6[_0x4d82('0x2f')]=_0x4081f6[_0x4d82('0x2f')][_0x4d82('0x31')]?_0x4081f6[_0x4d82('0x2f')]:_0x4a7444[_0x4d82('0x32')];if(!_0x11d022[_0x4d82('0x2c')][_0x4d82('0x33')]('nolimit')){_0x4081f6[_0x4d82('0x19')]=qs[_0x4d82('0x19')](_0x11d022[_0x4d82('0x2c')]['limit']);_0x4081f6[_0x4d82('0x17')]=qs[_0x4d82('0x17')](_0x11d022['query'][_0x4d82('0x17')]);}_0x4081f6[_0x4d82('0x34')]=qs[_0x4d82('0x35')](_0x11d022['query'][_0x4d82('0x35')]);_0x4081f6[_0x4d82('0x36')]=qs['filters'](_[_0x4d82('0x37')](_0x11d022['query'],_0x4a7444[_0x4d82('0x38')]),_0x487581);if(_0x11d022[_0x4d82('0x2c')]['filter']){_0x4081f6[_0x4d82('0x36')]=_['merge'](_0x4081f6[_0x4d82('0x36')],{'$or':_['map'](_0x487581,function(_0x51c705){if(_0x51c705[_0x4d82('0x2a')]!=='VIRTUAL'){var _0x2528d7={};_0x2528d7[_0x51c705['name']]={'$like':'%'+_0x11d022[_0x4d82('0x2c')][_0x4d82('0x39')]+'%'};return _0x2528d7;}})});}_0x4081f6=_['merge']({},_0x4081f6,_0x11d022[_0x4d82('0x3a')]);var _0x5d9444={'where':_0x4081f6[_0x4d82('0x36')]};return db[_0x4d82('0x28')]['count'](_0x5d9444)[_0x4d82('0x21')](function(_0x5521f1){_0x4d9ac4[_0x4d82('0x1a')]=_0x5521f1;if(_0x11d022[_0x4d82('0x2c')][_0x4d82('0x3b')]){_0x4081f6[_0x4d82('0x3c')]=[{'all':!![]}];}return db[_0x4d82('0x28')][_0x4d82('0x3d')](_0x4081f6);})['then'](function(_0x222b35){_0x4d9ac4[_0x4d82('0x3e')]=_0x222b35;return _0x4d9ac4;})[_0x4d82('0x21')](respondWithFilteredResult(_0x5ce98b,_0x4081f6))[_0x4d82('0x3f')](handleError(_0x5ce98b,null));};exports[_0x4d82('0x40')]=function(_0x363158,_0x37498b){var _0x4c474b={'raw':!![],'where':{'id':_0x363158[_0x4d82('0x41')]['id']}},_0x3c80d6={};_0x3c80d6[_0x4d82('0x32')]=_[_0x4d82('0x2d')](db[_0x4d82('0x28')]['rawAttributes']);_0x3c80d6[_0x4d82('0x2c')]=_[_0x4d82('0x2d')](_0x363158[_0x4d82('0x2c')]);_0x3c80d6[_0x4d82('0x38')]=_[_0x4d82('0x2e')](_0x3c80d6[_0x4d82('0x32')],_0x3c80d6[_0x4d82('0x2c')]);_0x4c474b['attributes']=_[_0x4d82('0x2e')](_0x3c80d6[_0x4d82('0x32')],qs['fields'](_0x363158[_0x4d82('0x2c')]['fields']));_0x4c474b[_0x4d82('0x2f')]=_0x4c474b[_0x4d82('0x2f')]['length']?_0x4c474b[_0x4d82('0x2f')]:_0x3c80d6[_0x4d82('0x32')];if(_0x363158['query'][_0x4d82('0x3b')]){_0x4c474b[_0x4d82('0x3c')]=[{'all':!![]}];}_0x4c474b=_[_0x4d82('0x42')]({},_0x4c474b,_0x363158['options']);return db[_0x4d82('0x28')][_0x4d82('0x43')](_0x4c474b)['then'](handleEntityNotFound(_0x37498b,null))['then'](respondWithResult(_0x37498b,null))[_0x4d82('0x3f')](handleError(_0x37498b,null));};exports[_0x4d82('0x44')]=function(_0x40c5ed,_0xb9d3bd){return db[_0x4d82('0x28')][_0x4d82('0x44')](_0x40c5ed[_0x4d82('0x45')],{})['then'](respondWithResult(_0xb9d3bd,0xc9))[_0x4d82('0x3f')](handleError(_0xb9d3bd,null));};exports[_0x4d82('0x20')]=function(_0x2e4083,_0x234ce3){if(_0x2e4083['body']['id']){delete _0x2e4083['body']['id'];}return db['MailQueueReport'][_0x4d82('0x43')]({'where':{'id':_0x2e4083[_0x4d82('0x41')]['id']}})[_0x4d82('0x21')](handleEntityNotFound(_0x234ce3,null))[_0x4d82('0x21')](saveUpdates(_0x2e4083[_0x4d82('0x45')],null))[_0x4d82('0x21')](respondWithResult(_0x234ce3,null))['catch'](handleError(_0x234ce3,null));};exports[_0x4d82('0x22')]=function(_0x1c022d,_0x3c0ffc){return db[_0x4d82('0x28')][_0x4d82('0x43')]({'where':{'id':_0x1c022d[_0x4d82('0x41')]['id']}})[_0x4d82('0x21')](handleEntityNotFound(_0x3c0ffc,null))[_0x4d82('0x21')](removeEntity(_0x3c0ffc,null))[_0x4d82('0x3f')](handleError(_0x3c0ffc,null));};exports['describe']=function(_0x418e6c,_0x25a4de){return db[_0x4d82('0x28')][_0x4d82('0x46')]()[_0x4d82('0x21')](respondWithResult(_0x25a4de,null))[_0x4d82('0x3f')](handleError(_0x25a4de,null));}; \ No newline at end of file +var _0x4e2e=['name','send','map','MailQueueReport','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','filter','options','includeAll','findAll','rows','catch','show','params','rawAttributes','include','find','create','body','update','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','then','destroy','stack'];(function(_0x173872,_0x2d1d0e){var _0x23ec55=function(_0xe663af){while(--_0xe663af){_0x173872['push'](_0x173872['shift']());}};_0x23ec55(++_0x2d1d0e);}(_0x4e2e,0x1f2));var _0xe4e2=function(_0x2cb053,_0x1c6225){_0x2cb053=_0x2cb053-0x0;var _0x2fef7a=_0x4e2e[_0x2cb053];return _0x2fef7a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe4e2('0x0'));var zipdir=require(_0xe4e2('0x1'));var jsonpatch=require(_0xe4e2('0x2'));var rp=require(_0xe4e2('0x3'));var moment=require(_0xe4e2('0x4'));var BPromise=require(_0xe4e2('0x5'));var Mustache=require('mustache');var util=require(_0xe4e2('0x6'));var path=require(_0xe4e2('0x7'));var sox=require(_0xe4e2('0x8'));var csv=require(_0xe4e2('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xe4e2('0xa'));var _=require(_0xe4e2('0xb'));var squel=require(_0xe4e2('0xc'));var crypto=require(_0xe4e2('0xd'));var jsforce=require(_0xe4e2('0xe'));var deskjs=require(_0xe4e2('0xf'));var toCsv=require(_0xe4e2('0x9'));var querystring=require(_0xe4e2('0x10'));var Papa=require('papaparse');var Redis=require(_0xe4e2('0x11'));var authService=require(_0xe4e2('0x12'));var qs=require(_0xe4e2('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe4e2('0x14'));var logger=require(_0xe4e2('0x15'))(_0xe4e2('0x16'));var utils=require(_0xe4e2('0x17'));var config=require(_0xe4e2('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xe4e2('0x19'))['db'];function respondWithStatusCode(_0x20d34e,_0x19c6ef){_0x19c6ef=_0x19c6ef||0xcc;return function(_0x13657c){if(_0x13657c){return _0x20d34e['sendStatus'](_0x19c6ef);}return _0x20d34e[_0xe4e2('0x1a')](_0x19c6ef)[_0xe4e2('0x1b')]();};}function respondWithResult(_0xb45217,_0x4e0bc2){_0x4e0bc2=_0x4e0bc2||0xc8;return function(_0x202486){if(_0x202486){return _0xb45217['status'](_0x4e0bc2)['json'](_0x202486);}};}function respondWithFilteredResult(_0x117a2a,_0x2d2018){return function(_0x1f9b2d){if(_0x1f9b2d){var _0x28ee12=typeof _0x2d2018[_0xe4e2('0x1c')]==='undefined'&&typeof _0x2d2018[_0xe4e2('0x1d')]===_0xe4e2('0x1e');var _0x340935=_0x1f9b2d['count'];var _0x196f16=_0x28ee12?0x0:_0x2d2018['offset'];var _0x1d5e9d=_0x28ee12?_0x1f9b2d[_0xe4e2('0x1f')]:_0x2d2018[_0xe4e2('0x1c')]+_0x2d2018[_0xe4e2('0x1d')];var _0x3dfbdf;if(_0x1d5e9d>=_0x340935){_0x1d5e9d=_0x340935;_0x3dfbdf=0xc8;}else{_0x3dfbdf=0xce;}_0x117a2a[_0xe4e2('0x1a')](_0x3dfbdf);return _0x117a2a[_0xe4e2('0x20')](_0xe4e2('0x21'),_0x196f16+'-'+_0x1d5e9d+'/'+_0x340935)[_0xe4e2('0x22')](_0x1f9b2d);}return null;};}function patchUpdates(_0x362741){return function(_0x5a84c5){try{jsonpatch[_0xe4e2('0x23')](_0x5a84c5,_0x362741,!![]);}catch(_0x2e7ecd){return BPromise[_0xe4e2('0x24')](_0x2e7ecd);}return _0x5a84c5[_0xe4e2('0x25')]();};}function saveUpdates(_0xbdf1ad,_0x23b466){return function(_0x16f14b){if(_0x16f14b){return _0x16f14b['update'](_0xbdf1ad)[_0xe4e2('0x26')](function(_0x2ab435){return _0x2ab435;});}return null;};}function removeEntity(_0x2088b9,_0x5373c0){return function(_0x353030){if(_0x353030){return _0x353030[_0xe4e2('0x27')]()['then'](function(){_0x2088b9[_0xe4e2('0x1a')](0xcc)[_0xe4e2('0x1b')]();});}};}function handleEntityNotFound(_0x29143c,_0x3f5265){return function(_0x249b7e){if(!_0x249b7e){_0x29143c['sendStatus'](0x194);}return _0x249b7e;};}function handleError(_0x166610,_0x357903){_0x357903=_0x357903||0x1f4;return function(_0x1f6d1f){logger['error'](_0x1f6d1f[_0xe4e2('0x28')]);if(_0x1f6d1f[_0xe4e2('0x29')]){delete _0x1f6d1f[_0xe4e2('0x29')];}_0x166610['status'](_0x357903)[_0xe4e2('0x2a')](_0x1f6d1f);};}exports['index']=function(_0x477b5c,_0x1e21c0){var _0x52c849={},_0x46926a={},_0x18e2e5={'count':0x0,'rows':[]};var _0x135116=_[_0xe4e2('0x2b')](db[_0xe4e2('0x2c')]['rawAttributes'],function(_0x5f30dc){return{'name':_0x5f30dc[_0xe4e2('0x2d')],'type':_0x5f30dc[_0xe4e2('0x2e')][_0xe4e2('0x2f')]};});_0x46926a[_0xe4e2('0x30')]=_[_0xe4e2('0x2b')](_0x135116,_0xe4e2('0x29'));_0x46926a[_0xe4e2('0x31')]=_[_0xe4e2('0x32')](_0x477b5c[_0xe4e2('0x31')]);_0x46926a[_0xe4e2('0x33')]=_[_0xe4e2('0x34')](_0x46926a[_0xe4e2('0x30')],_0x46926a['query']);_0x52c849[_0xe4e2('0x35')]=_[_0xe4e2('0x34')](_0x46926a[_0xe4e2('0x30')],qs[_0xe4e2('0x36')](_0x477b5c[_0xe4e2('0x31')][_0xe4e2('0x36')]));_0x52c849['attributes']=_0x52c849[_0xe4e2('0x35')][_0xe4e2('0x37')]?_0x52c849[_0xe4e2('0x35')]:_0x46926a[_0xe4e2('0x30')];if(!_0x477b5c[_0xe4e2('0x31')][_0xe4e2('0x38')](_0xe4e2('0x39'))){_0x52c849[_0xe4e2('0x1d')]=qs[_0xe4e2('0x1d')](_0x477b5c[_0xe4e2('0x31')][_0xe4e2('0x1d')]);_0x52c849['offset']=qs[_0xe4e2('0x1c')](_0x477b5c['query'][_0xe4e2('0x1c')]);}_0x52c849[_0xe4e2('0x3a')]=qs['sort'](_0x477b5c[_0xe4e2('0x31')][_0xe4e2('0x3b')]);_0x52c849[_0xe4e2('0x3c')]=qs[_0xe4e2('0x33')](_['pick'](_0x477b5c[_0xe4e2('0x31')],_0x46926a['filters']),_0x135116);if(_0x477b5c[_0xe4e2('0x31')]['filter']){_0x52c849[_0xe4e2('0x3c')]=_[_0xe4e2('0x3d')](_0x52c849[_0xe4e2('0x3c')],{'$or':_['map'](_0x135116,function(_0x2f5576){if(_0x2f5576[_0xe4e2('0x2e')]!=='VIRTUAL'){var _0x2b0f61={};_0x2b0f61[_0x2f5576[_0xe4e2('0x29')]]={'$like':'%'+_0x477b5c[_0xe4e2('0x31')][_0xe4e2('0x3e')]+'%'};return _0x2b0f61;}})});}_0x52c849=_[_0xe4e2('0x3d')]({},_0x52c849,_0x477b5c[_0xe4e2('0x3f')]);var _0x18fa94={'where':_0x52c849[_0xe4e2('0x3c')]};return db[_0xe4e2('0x2c')]['count'](_0x18fa94)['then'](function(_0xf4f15f){_0x18e2e5[_0xe4e2('0x1f')]=_0xf4f15f;if(_0x477b5c[_0xe4e2('0x31')][_0xe4e2('0x40')]){_0x52c849['include']=[{'all':!![]}];}return db['MailQueueReport'][_0xe4e2('0x41')](_0x52c849);})[_0xe4e2('0x26')](function(_0x3080d5){_0x18e2e5[_0xe4e2('0x42')]=_0x3080d5;return _0x18e2e5;})['then'](respondWithFilteredResult(_0x1e21c0,_0x52c849))[_0xe4e2('0x43')](handleError(_0x1e21c0,null));};exports[_0xe4e2('0x44')]=function(_0x385572,_0x577d4c){var _0x1b54f6={'raw':!![],'where':{'id':_0x385572[_0xe4e2('0x45')]['id']}},_0x4789cf={};_0x4789cf[_0xe4e2('0x30')]=_['keys'](db['MailQueueReport'][_0xe4e2('0x46')]);_0x4789cf[_0xe4e2('0x31')]=_[_0xe4e2('0x32')](_0x385572['query']);_0x4789cf[_0xe4e2('0x33')]=_[_0xe4e2('0x34')](_0x4789cf['model'],_0x4789cf[_0xe4e2('0x31')]);_0x1b54f6[_0xe4e2('0x35')]=_[_0xe4e2('0x34')](_0x4789cf[_0xe4e2('0x30')],qs[_0xe4e2('0x36')](_0x385572[_0xe4e2('0x31')][_0xe4e2('0x36')]));_0x1b54f6[_0xe4e2('0x35')]=_0x1b54f6['attributes'][_0xe4e2('0x37')]?_0x1b54f6[_0xe4e2('0x35')]:_0x4789cf['model'];if(_0x385572['query'][_0xe4e2('0x40')]){_0x1b54f6[_0xe4e2('0x47')]=[{'all':!![]}];}_0x1b54f6=_[_0xe4e2('0x3d')]({},_0x1b54f6,_0x385572['options']);return db[_0xe4e2('0x2c')][_0xe4e2('0x48')](_0x1b54f6)[_0xe4e2('0x26')](handleEntityNotFound(_0x577d4c,null))[_0xe4e2('0x26')](respondWithResult(_0x577d4c,null))['catch'](handleError(_0x577d4c,null));};exports[_0xe4e2('0x49')]=function(_0x918c17,_0x32a7c6){return db[_0xe4e2('0x2c')]['create'](_0x918c17[_0xe4e2('0x4a')],{})[_0xe4e2('0x26')](respondWithResult(_0x32a7c6,0xc9))['catch'](handleError(_0x32a7c6,null));};exports[_0xe4e2('0x4b')]=function(_0xedcd86,_0x21e5d7){if(_0xedcd86['body']['id']){delete _0xedcd86[_0xe4e2('0x4a')]['id'];}return db[_0xe4e2('0x2c')][_0xe4e2('0x48')]({'where':{'id':_0xedcd86['params']['id']}})['then'](handleEntityNotFound(_0x21e5d7,null))[_0xe4e2('0x26')](saveUpdates(_0xedcd86['body'],null))[_0xe4e2('0x26')](respondWithResult(_0x21e5d7,null))['catch'](handleError(_0x21e5d7,null));};exports[_0xe4e2('0x27')]=function(_0x2125df,_0x2a2e76){return db['MailQueueReport'][_0xe4e2('0x48')]({'where':{'id':_0x2125df['params']['id']}})[_0xe4e2('0x26')](handleEntityNotFound(_0x2a2e76,null))[_0xe4e2('0x26')](removeEntity(_0x2a2e76,null))['catch'](handleError(_0x2a2e76,null));};exports[_0xe4e2('0x4c')]=function(_0x582674,_0x169251){return db[_0xe4e2('0x2c')]['describe']()[_0xe4e2('0x26')](respondWithResult(_0x169251,null))[_0xe4e2('0x43')](handleError(_0x169251,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index 56cd691..d9116d4 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 _0x3ef0=['../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./mailQueueReport.attributes','exports','define','MailQueueReport','report_mail_queue','uniqueid','lodash','util'];(function(_0x17a227,_0x151915){var _0x41ed72=function(_0x208956){while(--_0x208956){_0x17a227['push'](_0x17a227['shift']());}};_0x41ed72(++_0x151915);}(_0x3ef0,0x1da));var _0x03ef=function(_0x1f15b7,_0x5b6e19){_0x1f15b7=_0x1f15b7-0x0;var _0x270405=_0x3ef0[_0x1f15b7];return _0x270405;};'use strict';var _=require(_0x03ef('0x0'));var util=require(_0x03ef('0x1'));var logger=require(_0x03ef('0x2'))('api');var moment=require(_0x03ef('0x3'));var BPromise=require(_0x03ef('0x4'));var rp=require(_0x03ef('0x5'));var fs=require('fs');var path=require(_0x03ef('0x6'));var rimraf=require('rimraf');var config=require(_0x03ef('0x7'));var attributes=require(_0x03ef('0x8'));module[_0x03ef('0x9')]=function(_0x562f85,_0x3b42cb){return _0x562f85[_0x03ef('0xa')](_0x03ef('0xb'),attributes,{'tableName':_0x03ef('0xc'),'paranoid':![],'indexes':[{'name':_0x03ef('0xd'),'fields':[_0x03ef('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x90b3=['./mailQueueReport.attributes','exports','define','report_mail_queue','uniqueid','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x3d27ba,_0x2671a3){var _0xf01885=function(_0x311f5c){while(--_0x311f5c){_0x3d27ba['push'](_0x3d27ba['shift']());}};_0xf01885(++_0x2671a3);}(_0x90b3,0x123));var _0x390b=function(_0x14eac5,_0x5d7549){_0x14eac5=_0x14eac5-0x0;var _0x223eb6=_0x90b3[_0x14eac5];return _0x223eb6;};'use strict';var _=require(_0x390b('0x0'));var util=require(_0x390b('0x1'));var logger=require(_0x390b('0x2'))(_0x390b('0x3'));var moment=require(_0x390b('0x4'));var BPromise=require('bluebird');var rp=require(_0x390b('0x5'));var fs=require('fs');var path=require(_0x390b('0x6'));var rimraf=require(_0x390b('0x7'));var config=require('../../config/environment');var attributes=require(_0x390b('0x8'));module[_0x390b('0x9')]=function(_0xe452ef,_0x449ef0){return _0xe452ef[_0x390b('0xa')]('MailQueueReport',attributes,{'tableName':_0x390b('0xb'),'paranoid':![],'indexes':[{'name':_0x390b('0xc'),'fields':[_0x390b('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 cacf69e..d32c4c9 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 _0xc4aa=['create','body','options','raw','update','where','attributes','limit','UpdateMailQueueReport','stringify','lodash','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','CreateMailQueueReport','MailQueueReport'];(function(_0x97182a,_0x247d91){var _0x95e00c=function(_0x1427cd){while(--_0x1427cd){_0x97182a['push'](_0x97182a['shift']());}};_0x95e00c(++_0x247d91);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xc4aa[_0x2641f9];return _0x585741;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});}exports[_0xac4a('0x15')]=function(_0x28e304){var _0x44ec59=this;return new Promise(function(_0x546c5d,_0x5ac21e){return db[_0xac4a('0x16')][_0xac4a('0x17')](_0x28e304[_0xac4a('0x18')],{'raw':_0x28e304['options']?_0x28e304[_0xac4a('0x19')][_0xac4a('0x1a')]===undefined?!![]:![]:!![]})[_0xac4a('0xc')](function(_0x3a3cdb){logger[_0xac4a('0x13')](_0xac4a('0x15'),_0x28e304);logger[_0xac4a('0xf')](_0xac4a('0x15'),_0x28e304,JSON['stringify'](_0x3a3cdb));_0x546c5d(_0x3a3cdb);})[_0xac4a('0x14')](function(_0x3204ad){logger['error'](_0xac4a('0x15'),_0x3204ad[_0xac4a('0x12')],_0x28e304);_0x5ac21e(_0x44ec59[_0xac4a('0x10')](0x1f4,_0x3204ad[_0xac4a('0x12')]));});});};exports['UpdateMailQueueReport']=function(_0x1b7998){var _0x2503d8=this;return new Promise(function(_0x15435c,_0x412494){return db[_0xac4a('0x16')][_0xac4a('0x1b')](_0x1b7998[_0xac4a('0x18')],{'raw':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1c')]||null:null,'attributes':_0x1b7998[_0xac4a('0x19')]?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1d')]||null:null,'limit':_0x1b7998['options']?_0x1b7998[_0xac4a('0x19')][_0xac4a('0x1e')]||null:null})[_0xac4a('0xc')](function(_0x2772fe){logger[_0xac4a('0x13')]('UpdateMailQueueReport',_0x1b7998);logger['debug'](_0xac4a('0x1f'),_0x1b7998,JSON[_0xac4a('0x20')](_0x2772fe));_0x15435c(_0x2772fe);})[_0xac4a('0x14')](function(_0x546b65){logger['error'](_0xac4a('0x1f'),_0x546b65[_0xac4a('0x12')],_0x1b7998);_0x412494(_0x2503d8[_0xac4a('0x10')](0x1f4,_0x546b65[_0xac4a('0x12')]));});});}; \ No newline at end of file +var _0x7a54=['moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','MailQueueReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','MailQueueReport','create','body','options','raw','CreateMailQueueReport','UpdateMailQueueReport','update','where','attributes','limit','then','lodash','util'];(function(_0x4a60c2,_0x101f38){var _0xd01b23=function(_0x4d1972){while(--_0x4d1972){_0x4a60c2['push'](_0x4a60c2['shift']());}};_0xd01b23(++_0x101f38);}(_0x7a54,0x106));var _0x47a5=function(_0x5dccff,_0x3202d1){_0x5dccff=_0x5dccff-0x0;var _0x411360=_0x7a54[_0x5dccff];return _0x411360;};'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')]('MailQueueReport,\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['CreateMailQueueReport']=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')]('CreateMailQueueReport',_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')]));});});};exports[_0x47a5('0x1b')]=function(_0x513981){var _0x28747d=this;return new Promise(function(_0xc4cd63,_0x4437f1){return db[_0x47a5('0x15')][_0x47a5('0x1c')](_0x513981['body'],{'raw':_0x513981['options']?_0x513981[_0x47a5('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x513981[_0x47a5('0x18')]?_0x513981['options'][_0x47a5('0x1d')]||null:null,'attributes':_0x513981[_0x47a5('0x18')]?_0x513981[_0x47a5('0x18')][_0x47a5('0x1e')]||null:null,'limit':_0x513981[_0x47a5('0x18')]?_0x513981[_0x47a5('0x18')][_0x47a5('0x1f')]||null:null})[_0x47a5('0x20')](function(_0x16631f){logger[_0x47a5('0xb')](_0x47a5('0x1b'),_0x513981);logger[_0x47a5('0xd')](_0x47a5('0x1b'),_0x513981,JSON['stringify'](_0x16631f));_0xc4cd63(_0x16631f);})[_0x47a5('0x14')](function(_0x51833b){logger[_0x47a5('0xf')](_0x47a5('0x1b'),_0x51833b[_0x47a5('0x11')],_0x513981);_0x4437f1(_0x28747d['error'](0x1f4,_0x51833b[_0x47a5('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index 0993609..086d235 100644 --- a/server/api/mailServerIn/index.js +++ b/server/api/mailServerIn/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x3fc7ba,_0x3bf175){var _0x230dbc=function(_0x27a16d){while(--_0x27a16d){_0x3fc7ba['push'](_0x3fc7ba['shift']());}};_0x230dbc(++_0x3bf175);}(_0x70e0,0x17b));var _0x070e=function(_0xa24402,_0x3ee5f1){_0xa24402=_0xa24402-0x0;var _0xef1621=_0x70e0[_0xa24402];return _0xef1621;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file +var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x384a41,_0x39c786){var _0x34d382=function(_0x1992d7){while(--_0x1992d7){_0x384a41['push'](_0x384a41['shift']());}};_0x34d382(++_0x39c786);}(_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/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index 60b64f3..777aab4 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 _0xa75b=['BOOLEAN','INTEGER','INBOX','sequelize','STRING'];(function(_0x2af053,_0x4f6d28){var _0x4b4001=function(_0x9200c1){while(--_0x9200c1){_0x2af053['push'](_0x2af053['shift']());}};_0x4b4001(++_0x4f6d28);}(_0xa75b,0x170));var _0xba75=function(_0x5285f0,_0x430d90){_0x5285f0=_0x5285f0-0x0;var _0x1a644e=_0xa75b[_0x5285f0];return _0x1a644e;};'use strict';var Sequelize=require(_0xba75('0x0'));module['exports']={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0xba75('0x1')]},'authentication':{'type':Sequelize[_0xba75('0x2')],'defaultValue':!![]},'user':{'type':Sequelize[_0xba75('0x1')]},'password':{'type':Sequelize[_0xba75('0x1')]},'port':{'type':Sequelize[_0xba75('0x3')]},'tls':{'type':Sequelize[_0xba75('0x2')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0xba75('0x1')],'defaultValue':_0xba75('0x4')},'connTimeout':{'type':Sequelize[_0xba75('0x3')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0xba75('0x3')],'defaultValue':0x5},'service':{'type':Sequelize[_0xba75('0x1')]}}; \ No newline at end of file +var _0x777d=['INTEGER','exports','STRING','INBOX'];(function(_0x90e575,_0x48c2ec){var _0x1aae60=function(_0x4e40cf){while(--_0x4e40cf){_0x90e575['push'](_0x90e575['shift']());}};_0x1aae60(++_0x48c2ec);}(_0x777d,0xe9));var _0xd777=function(_0x10244a,_0x3e96f4){_0x10244a=_0x10244a-0x0;var _0x4daacd=_0x777d[_0x10244a];return _0x4daacd;};'use strict';var Sequelize=require('sequelize');module[_0xd777('0x0')]={'description':{'type':Sequelize[_0xd777('0x1')]},'host':{'type':Sequelize[_0xd777('0x1')]},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'user':{'type':Sequelize[_0xd777('0x1')]},'password':{'type':Sequelize[_0xd777('0x1')]},'port':{'type':Sequelize['INTEGER']},'tls':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'mailbox':{'type':Sequelize['STRING'],'defaultValue':_0xd777('0x2')},'connTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0xd777('0x3')],'defaultValue':0x5},'service':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index d7f3ad6..ec9ed38 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 _0xc1d0=['path','rimraf','exports','define','MailServerIn','../../config/logger','api','moment','request-promise'];(function(_0x851b51,_0x3bfbc0){var _0x5e2c1f=function(_0x549d0d){while(--_0x549d0d){_0x851b51['push'](_0x851b51['shift']());}};_0x5e2c1f(++_0x3bfbc0);}(_0xc1d0,0x1f4));var _0x0c1d=function(_0x35387d,_0x1ba72f){_0x35387d=_0x35387d-0x0;var _0x3aba56=_0xc1d0[_0x35387d];return _0x3aba56;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x0c1d('0x0'))(_0x0c1d('0x1'));var moment=require(_0x0c1d('0x2'));var BPromise=require('bluebird');var rp=require(_0x0c1d('0x3'));var fs=require('fs');var path=require(_0x0c1d('0x4'));var rimraf=require(_0x0c1d('0x5'));var config=require('../../config/environment');var attributes=require('./mailServerIn.attributes');module[_0x0c1d('0x6')]=function(_0x4ff9a0,_0x3d8356){return _0x4ff9a0[_0x0c1d('0x7')](_0x0c1d('0x8'),attributes,{'tableName':'mail_servers_in','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf9c3=['mail_servers_in','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./mailServerIn.attributes','exports'];(function(_0x4b98b0,_0x295fec){var _0x1a24f7=function(_0x32d353){while(--_0x32d353){_0x4b98b0['push'](_0x4b98b0['shift']());}};_0x1a24f7(++_0x295fec);}(_0xf9c3,0x1c4));var _0x3f9c=function(_0xb179b5,_0x3601bf){_0xb179b5=_0xb179b5-0x0;var _0x4088a7=_0xf9c3[_0xb179b5];return _0x4088a7;};'use strict';var _=require(_0x3f9c('0x0'));var util=require('util');var logger=require(_0x3f9c('0x1'))(_0x3f9c('0x2'));var moment=require('moment');var BPromise=require(_0x3f9c('0x3'));var rp=require(_0x3f9c('0x4'));var fs=require('fs');var path=require(_0x3f9c('0x5'));var rimraf=require(_0x3f9c('0x6'));var config=require(_0x3f9c('0x7'));var attributes=require(_0x3f9c('0x8'));module[_0x3f9c('0x9')]=function(_0x57c2db,_0x46814f){return _0x57c2db['define']('MailServerIn',attributes,{'tableName':_0x3f9c('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.rpc.js b/server/api/mailServerIn/mailServerIn.rpc.js index 2688bc6..36365d0 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 _0x8e2e=['findAll','options','raw','where','attributes','limit','include','model','map','then','catch','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','MailServerIn,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','GetMailServerIn','MailServerIn'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x8e2e,0x10b));var _0xe8e2=function(_0x2f88bf,_0x761a0e){_0x2f88bf=_0x2f88bf-0x0;var _0x1b451e=_0x8e2e[_0x2f88bf];return _0x1b451e;};'use strict';var _=require('lodash');var util=require(_0xe8e2('0x0'));var moment=require(_0xe8e2('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe8e2('0x2'))['db'];var utils=require(_0xe8e2('0x3'));var logger=require(_0xe8e2('0x4'))(_0xe8e2('0x5'));var config=require(_0xe8e2('0x6'));var jayson=require(_0xe8e2('0x7'));var client=jayson[_0xe8e2('0x8')][_0xe8e2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x113fef,_0x28a86a,_0x531b72){return new BPromise(function(_0xdd1d8a,_0x2a6c32){return client[_0xe8e2('0xa')](_0x113fef,_0x531b72)['then'](function(_0x10edc7){logger[_0xe8e2('0xb')](_0xe8e2('0xc'),_0x28a86a,'request\x20sent');logger['debug']('MailServerIn,\x20%s,\x20%s,\x20%s',_0x28a86a,_0xe8e2('0xd'),JSON[_0xe8e2('0xe')](_0x10edc7));if(_0x10edc7[_0xe8e2('0xf')]){if(_0x10edc7[_0xe8e2('0xf')][_0xe8e2('0x10')]===0x1f4){logger[_0xe8e2('0xf')](_0xe8e2('0xc'),_0x28a86a,_0x10edc7[_0xe8e2('0xf')][_0xe8e2('0x11')]);return _0x2a6c32(_0x10edc7[_0xe8e2('0xf')]['message']);}logger[_0xe8e2('0xf')]('MailServerIn,\x20%s,\x20%s',_0x28a86a,_0x10edc7[_0xe8e2('0xf')][_0xe8e2('0x11')]);return _0xdd1d8a(_0x10edc7[_0xe8e2('0xf')][_0xe8e2('0x11')]);}else{logger['info'](_0xe8e2('0xc'),_0x28a86a,_0xe8e2('0xd'));_0xdd1d8a(_0x10edc7[_0xe8e2('0x12')][_0xe8e2('0x11')]);}})['catch'](function(_0x1d8f33){logger[_0xe8e2('0xf')](_0xe8e2('0xc'),_0x28a86a,_0x1d8f33);_0x2a6c32(_0x1d8f33);});});}exports[_0xe8e2('0x13')]=function(_0x99ed04){var _0x3a90c8=this;return new Promise(function(_0x5067a1,_0x9d40c4){return db[_0xe8e2('0x14')][_0xe8e2('0x15')]({'raw':_0x99ed04[_0xe8e2('0x16')]?_0x99ed04[_0xe8e2('0x16')][_0xe8e2('0x17')]===undefined?!![]:![]:!![],'where':_0x99ed04[_0xe8e2('0x16')]?_0x99ed04[_0xe8e2('0x16')][_0xe8e2('0x18')]||null:null,'attributes':_0x99ed04[_0xe8e2('0x16')]?_0x99ed04[_0xe8e2('0x16')][_0xe8e2('0x19')]||null:null,'limit':_0x99ed04[_0xe8e2('0x16')]?_0x99ed04[_0xe8e2('0x16')][_0xe8e2('0x1a')]||null:null,'include':_0x99ed04['options']?_0x99ed04['options'][_0xe8e2('0x1b')]?_['map'](_0x99ed04['options'][_0xe8e2('0x1b')],function(_0x583355){return{'model':db[_0x583355[_0xe8e2('0x1c')]],'as':_0x583355['as'],'attributes':_0x583355[_0xe8e2('0x19')],'include':_0x583355[_0xe8e2('0x1b')]?_[_0xe8e2('0x1d')](_0x583355[_0xe8e2('0x1b')],function(_0x5a9a46){return{'model':db[_0x5a9a46[_0xe8e2('0x1c')]],'as':_0x5a9a46['as'],'attributes':_0x5a9a46[_0xe8e2('0x19')],'include':_0x5a9a46[_0xe8e2('0x1b')]?_[_0xe8e2('0x1d')](_0x5a9a46['include'],function(_0x53fd95){return{'model':db[_0x53fd95['model']],'as':_0x53fd95['as'],'attributes':_0x53fd95['attributes']};}):[]};}):[]};}):[]:[]})[_0xe8e2('0x1e')](function(_0x2d7c32){logger[_0xe8e2('0xb')](_0xe8e2('0x13'),_0x99ed04);logger['debug'](_0xe8e2('0x13'),_0x99ed04,JSON['stringify'](_0x2d7c32));_0x5067a1(_0x2d7c32);})[_0xe8e2('0x1f')](function(_0x39623a){logger[_0xe8e2('0xf')](_0xe8e2('0x13'),_0x39623a[_0xe8e2('0x11')],_0x99ed04);_0x9d40c4(_0x3a90c8['error'](0x1f4,_0x39623a[_0xe8e2('0x11')]));});});}; \ No newline at end of file +var _0xa204=['options','raw','where','attributes','include','map','model','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','message','result','GetMailServerIn','MailServerIn','findAll'];(function(_0x296203,_0x258d89){var _0x288b65=function(_0x586318){while(--_0x586318){_0x296203['push'](_0x296203['shift']());}};_0x288b65(++_0x258d89);}(_0xa204,0x152));var _0x4a20=function(_0x3a79a6,_0x338e25){_0x3a79a6=_0x3a79a6-0x0;var _0x3d623c=_0xa204[_0x3a79a6];return _0x3d623c;};'use strict';var _=require(_0x4a20('0x0'));var util=require(_0x4a20('0x1'));var moment=require('moment');var BPromise=require(_0x4a20('0x2'));var rs=require(_0x4a20('0x3'));var fs=require('fs');var Redis=require(_0x4a20('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4a20('0x5'));var logger=require(_0x4a20('0x6'))(_0x4a20('0x7'));var config=require(_0x4a20('0x8'));var jayson=require(_0x4a20('0x9'));var client=jayson[_0x4a20('0xa')][_0x4a20('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2a549b,_0x57ce07,_0x27e3ec){return new BPromise(function(_0x31a214,_0x2d5107){return client[_0x4a20('0xc')](_0x2a549b,_0x27e3ec)['then'](function(_0x4fa4d6){logger[_0x4a20('0xd')](_0x4a20('0xe'),_0x57ce07,_0x4a20('0xf'));logger[_0x4a20('0x10')](_0x4a20('0x11'),_0x57ce07,_0x4a20('0xf'),JSON[_0x4a20('0x12')](_0x4fa4d6));if(_0x4fa4d6[_0x4a20('0x13')]){if(_0x4fa4d6[_0x4a20('0x13')]['code']===0x1f4){logger[_0x4a20('0x13')](_0x4a20('0xe'),_0x57ce07,_0x4fa4d6['error'][_0x4a20('0x14')]);return _0x2d5107(_0x4fa4d6[_0x4a20('0x13')][_0x4a20('0x14')]);}logger['error'](_0x4a20('0xe'),_0x57ce07,_0x4fa4d6['error']['message']);return _0x31a214(_0x4fa4d6['error'][_0x4a20('0x14')]);}else{logger['info'](_0x4a20('0xe'),_0x57ce07,'request\x20sent');_0x31a214(_0x4fa4d6[_0x4a20('0x15')][_0x4a20('0x14')]);}})['catch'](function(_0x3bd783){logger['error']('MailServerIn,\x20%s,\x20%s',_0x57ce07,_0x3bd783);_0x2d5107(_0x3bd783);});});}exports[_0x4a20('0x16')]=function(_0x8a23f1){var _0x296156=this;return new Promise(function(_0x557e7d,_0x57f0f7){return db[_0x4a20('0x17')][_0x4a20('0x18')]({'raw':_0x8a23f1[_0x4a20('0x19')]?_0x8a23f1[_0x4a20('0x19')][_0x4a20('0x1a')]===undefined?!![]:![]:!![],'where':_0x8a23f1[_0x4a20('0x19')]?_0x8a23f1['options'][_0x4a20('0x1b')]||null:null,'attributes':_0x8a23f1[_0x4a20('0x19')]?_0x8a23f1[_0x4a20('0x19')][_0x4a20('0x1c')]||null:null,'limit':_0x8a23f1['options']?_0x8a23f1['options']['limit']||null:null,'include':_0x8a23f1[_0x4a20('0x19')]?_0x8a23f1['options'][_0x4a20('0x1d')]?_[_0x4a20('0x1e')](_0x8a23f1[_0x4a20('0x19')]['include'],function(_0xe81f9c){return{'model':db[_0xe81f9c[_0x4a20('0x1f')]],'as':_0xe81f9c['as'],'attributes':_0xe81f9c[_0x4a20('0x1c')],'include':_0xe81f9c[_0x4a20('0x1d')]?_[_0x4a20('0x1e')](_0xe81f9c[_0x4a20('0x1d')],function(_0x4d583b){return{'model':db[_0x4d583b['model']],'as':_0x4d583b['as'],'attributes':_0x4d583b[_0x4a20('0x1c')],'include':_0x4d583b[_0x4a20('0x1d')]?_[_0x4a20('0x1e')](_0x4d583b[_0x4a20('0x1d')],function(_0x649dd1){return{'model':db[_0x649dd1[_0x4a20('0x1f')]],'as':_0x649dd1['as'],'attributes':_0x649dd1[_0x4a20('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3789de){logger['info'](_0x4a20('0x16'),_0x8a23f1);logger[_0x4a20('0x10')]('GetMailServerIn',_0x8a23f1,JSON[_0x4a20('0x12')](_0x3789de));_0x557e7d(_0x3789de);})[_0x4a20('0x20')](function(_0x5c6882){logger[_0x4a20('0x13')](_0x4a20('0x16'),_0x5c6882['message'],_0x8a23f1);_0x57f0f7(_0x296156[_0x4a20('0x13')](0x1f4,_0x5c6882[_0x4a20('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index db6f28e..09587cf 100644 --- a/server/api/mailServerOut/index.js +++ b/server/api/mailServerOut/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['index','/:id','isAuthenticated','post','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailServerOut.controller','get'];(function(_0xd1d19a,_0x1933f0){var _0x52a79d=function(_0x5199e2){while(--_0x5199e2){_0xd1d19a['push'](_0xd1d19a['shift']());}};_0x52a79d(++_0x1933f0);}(_0x7a54,0x106));var _0x47a5=function(_0xfd9cb0,_0x445d36){_0xfd9cb0=_0xfd9cb0-0x0;var _0x412fc7=_0x7a54[_0xfd9cb0];return _0x412fc7;};'use strict';var multer=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var path=require(_0x47a5('0x2'));var timeout=require('connect-timeout');var express=require(_0x47a5('0x3'));var router=express[_0x47a5('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x47a5('0x5'));var interaction=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var controller=require(_0x47a5('0x8'));router[_0x47a5('0x9')]('/',auth['isAuthenticated'](),controller[_0x47a5('0xa')]);router['get'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['show']);router[_0x47a5('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x47a5('0xb'),auth[_0x47a5('0xc')](),controller['update']);router[_0x47a5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x47a5('0xf')]);module[_0x47a5('0x10')]=router; \ No newline at end of file +var _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(_0x13ea00,_0x12f610){var _0x1f7347=function(_0x34ae63){while(--_0x34ae63){_0x13ea00['push'](_0x13ea00['shift']());}};_0x1f7347(++_0x12f610);}(_0x7a54,0x106));var _0x47a5=function(_0x485d12,_0x2e9ac9){_0x485d12=_0x485d12-0x0;var _0x2057fd=_0x7a54[_0x485d12];return _0x2057fd;};'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 4906f95..190a774 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 _0xefb7=['BOOLEAN','sequelize','exports','STRING','INTEGER'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0xefb7,0x14b));var _0x7efb=function(_0x104e21,_0x2ea86f){_0x104e21=_0x104e21-0x0;var _0x605b37=_0xefb7[_0x104e21];return _0x605b37;};'use strict';var Sequelize=require(_0x7efb('0x0'));module[_0x7efb('0x1')]={'description':{'type':Sequelize[_0x7efb('0x2')]},'host':{'type':Sequelize[_0x7efb('0x2')]},'user':{'type':Sequelize[_0x7efb('0x2')]},'pass':{'type':Sequelize[_0x7efb('0x2')]},'port':{'type':Sequelize[_0x7efb('0x3')]},'secure':{'type':Sequelize[_0x7efb('0x4')],'defaultValue':![]},'service':{'type':Sequelize[_0x7efb('0x2')]},'authentication':{'type':Sequelize[_0x7efb('0x4')],'defaultValue':!![]}}; \ No newline at end of file +var _0x5324=['sequelize','exports','STRING','BOOLEAN'];(function(_0x586f16,_0xb505dd){var _0x6e9878=function(_0x41be02){while(--_0x41be02){_0x586f16['push'](_0x586f16['shift']());}};_0x6e9878(++_0xb505dd);}(_0x5324,0x154));var _0x4532=function(_0x302f5c,_0x214a42){_0x302f5c=_0x302f5c-0x0;var _0x4bfff9=_0x5324[_0x302f5c];return _0x4bfff9;};'use strict';var Sequelize=require(_0x4532('0x0'));module[_0x4532('0x1')]={'description':{'type':Sequelize[_0x4532('0x2')]},'host':{'type':Sequelize[_0x4532('0x2')]},'user':{'type':Sequelize['STRING']},'pass':{'type':Sequelize[_0x4532('0x2')]},'port':{'type':Sequelize['INTEGER']},'secure':{'type':Sequelize[_0x4532('0x3')],'defaultValue':![]},'service':{'type':Sequelize[_0x4532('0x2')]},'authentication':{'type':Sequelize[_0x4532('0x3')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.controller.js b/server/api/mailServerOut/mailServerOut.controller.js index e057cb6..f1f2ddc 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 _0x0cff=['params','find','body','eml-format','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','map','MailServerOut','rawAttributes','fieldName','type','key','model','query','attributes','intersection','fields','length','nolimit','order','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0x0cff,0x1a7));var _0xf0cf=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x0cff[_0x21a9d9];return _0x46adce;};'use strict';var emlformat=require(_0xf0cf('0x0'));var rimraf=require(_0xf0cf('0x1'));var zipdir=require(_0xf0cf('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xf0cf('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xf0cf('0x4'));var util=require(_0xf0cf('0x5'));var path=require(_0xf0cf('0x6'));var sox=require(_0xf0cf('0x7'));var csv=require(_0xf0cf('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf0cf('0x9'));var _=require(_0xf0cf('0xa'));var squel=require(_0xf0cf('0xb'));var crypto=require(_0xf0cf('0xc'));var jsforce=require(_0xf0cf('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xf0cf('0x8'));var querystring=require(_0xf0cf('0xe'));var Papa=require(_0xf0cf('0xf'));var Redis=require('ioredis');var authService=require(_0xf0cf('0x10'));var qs=require(_0xf0cf('0x11'));var as=require(_0xf0cf('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf0cf('0x13'));var utils=require('../../config/utils');var config=require(_0xf0cf('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xf0cf('0x15'))['db'];function respondWithStatusCode(_0x32544e,_0x42b9fc){_0x42b9fc=_0x42b9fc||0xcc;return function(_0x5a3f81){if(_0x5a3f81){return _0x32544e[_0xf0cf('0x16')](_0x42b9fc);}return _0x32544e[_0xf0cf('0x17')](_0x42b9fc)[_0xf0cf('0x18')]();};}function respondWithResult(_0x4fbed5,_0x4795f2){_0x4795f2=_0x4795f2||0xc8;return function(_0x493e61){if(_0x493e61){return _0x4fbed5['status'](_0x4795f2)[_0xf0cf('0x19')](_0x493e61);}};}function respondWithFilteredResult(_0x5d0dfa,_0x5bbb92){return function(_0x459613){if(_0x459613){var _0x3499d1=typeof _0x5bbb92[_0xf0cf('0x1a')]===_0xf0cf('0x1b')&&typeof _0x5bbb92['limit']==='undefined';var _0x19abed=_0x459613['count'];var _0xe7ba95=_0x3499d1?0x0:_0x5bbb92['offset'];var _0x22b11f=_0x3499d1?_0x459613[_0xf0cf('0x1c')]:_0x5bbb92[_0xf0cf('0x1a')]+_0x5bbb92[_0xf0cf('0x1d')];var _0xd0042a;if(_0x22b11f>=_0x19abed){_0x22b11f=_0x19abed;_0xd0042a=0xc8;}else{_0xd0042a=0xce;}_0x5d0dfa[_0xf0cf('0x17')](_0xd0042a);return _0x5d0dfa[_0xf0cf('0x1e')](_0xf0cf('0x1f'),_0xe7ba95+'-'+_0x22b11f+'/'+_0x19abed)['json'](_0x459613);}return null;};}function patchUpdates(_0x1e8f23){return function(_0x213436){try{jsonpatch['apply'](_0x213436,_0x1e8f23,!![]);}catch(_0xe46204){return BPromise[_0xf0cf('0x20')](_0xe46204);}return _0x213436[_0xf0cf('0x21')]();};}function saveUpdates(_0x41083e,_0x1a9198){return function(_0x295932){if(_0x295932){return _0x295932[_0xf0cf('0x22')](_0x41083e)[_0xf0cf('0x23')](function(_0xb57002){return _0xb57002;});}return null;};}function removeEntity(_0x27bc45,_0x3ae3a6){return function(_0x1a9b03){if(_0x1a9b03){return _0x1a9b03[_0xf0cf('0x24')]()[_0xf0cf('0x23')](function(){_0x27bc45[_0xf0cf('0x17')](0xcc)[_0xf0cf('0x18')]();});}};}function handleEntityNotFound(_0x8d1b14,_0x5c2978){return function(_0x60692d){if(!_0x60692d){_0x8d1b14['sendStatus'](0x194);}return _0x60692d;};}function handleError(_0x2e02b4,_0x525fff){_0x525fff=_0x525fff||0x1f4;return function(_0x475d0b){logger[_0xf0cf('0x25')](_0x475d0b[_0xf0cf('0x26')]);if(_0x475d0b[_0xf0cf('0x27')]){delete _0x475d0b[_0xf0cf('0x27')];}_0x2e02b4[_0xf0cf('0x17')](_0x525fff)['send'](_0x475d0b);};}exports['index']=function(_0x521ba1,_0x3a947f){var _0x2a1070={},_0x1a1575={},_0x3c89dd={'count':0x0,'rows':[]};var _0x4fc5bc=_[_0xf0cf('0x28')](db[_0xf0cf('0x29')][_0xf0cf('0x2a')],function(_0x8776f9){return{'name':_0x8776f9[_0xf0cf('0x2b')],'type':_0x8776f9[_0xf0cf('0x2c')][_0xf0cf('0x2d')]};});_0x1a1575[_0xf0cf('0x2e')]=_[_0xf0cf('0x28')](_0x4fc5bc,'name');_0x1a1575[_0xf0cf('0x2f')]=_['keys'](_0x521ba1[_0xf0cf('0x2f')]);_0x1a1575['filters']=_['intersection'](_0x1a1575[_0xf0cf('0x2e')],_0x1a1575['query']);_0x2a1070[_0xf0cf('0x30')]=_[_0xf0cf('0x31')](_0x1a1575[_0xf0cf('0x2e')],qs[_0xf0cf('0x32')](_0x521ba1[_0xf0cf('0x2f')][_0xf0cf('0x32')]));_0x2a1070[_0xf0cf('0x30')]=_0x2a1070[_0xf0cf('0x30')][_0xf0cf('0x33')]?_0x2a1070[_0xf0cf('0x30')]:_0x1a1575['model'];if(!_0x521ba1[_0xf0cf('0x2f')]['hasOwnProperty'](_0xf0cf('0x34'))){_0x2a1070[_0xf0cf('0x1d')]=qs[_0xf0cf('0x1d')](_0x521ba1[_0xf0cf('0x2f')][_0xf0cf('0x1d')]);_0x2a1070['offset']=qs[_0xf0cf('0x1a')](_0x521ba1[_0xf0cf('0x2f')]['offset']);}_0x2a1070[_0xf0cf('0x35')]=qs['sort'](_0x521ba1[_0xf0cf('0x2f')]['sort']);_0x2a1070[_0xf0cf('0x36')]=qs[_0xf0cf('0x37')](_[_0xf0cf('0x38')](_0x521ba1['query'],_0x1a1575[_0xf0cf('0x37')]),_0x4fc5bc);if(_0x521ba1[_0xf0cf('0x2f')][_0xf0cf('0x39')]){_0x2a1070['where']=_['merge'](_0x2a1070[_0xf0cf('0x36')],{'$or':_[_0xf0cf('0x28')](_0x4fc5bc,function(_0xbee045){if(_0xbee045['type']!==_0xf0cf('0x3a')){var _0x400d1d={};_0x400d1d[_0xbee045[_0xf0cf('0x27')]]={'$like':'%'+_0x521ba1[_0xf0cf('0x2f')][_0xf0cf('0x39')]+'%'};return _0x400d1d;}})});}_0x2a1070=_[_0xf0cf('0x3b')]({},_0x2a1070,_0x521ba1[_0xf0cf('0x3c')]);var _0x32a62f={'where':_0x2a1070[_0xf0cf('0x36')]};return db[_0xf0cf('0x29')]['count'](_0x32a62f)[_0xf0cf('0x23')](function(_0x50bf61){_0x3c89dd['count']=_0x50bf61;if(_0x521ba1[_0xf0cf('0x2f')][_0xf0cf('0x3d')]){_0x2a1070[_0xf0cf('0x3e')]=[{'all':!![]}];}return db[_0xf0cf('0x29')][_0xf0cf('0x3f')](_0x2a1070);})['then'](function(_0x4160e2){_0x3c89dd[_0xf0cf('0x40')]=_0x4160e2;return _0x3c89dd;})[_0xf0cf('0x23')](respondWithFilteredResult(_0x3a947f,_0x2a1070))[_0xf0cf('0x41')](handleError(_0x3a947f,null));};exports[_0xf0cf('0x42')]=function(_0x879eca,_0x2a34f2){var _0x4e62ed={'raw':!![],'where':{'id':_0x879eca[_0xf0cf('0x43')]['id']}},_0x416185={};_0x416185[_0xf0cf('0x2e')]=_['keys'](db['MailServerOut'][_0xf0cf('0x2a')]);_0x416185[_0xf0cf('0x2f')]=_['keys'](_0x879eca[_0xf0cf('0x2f')]);_0x416185[_0xf0cf('0x37')]=_[_0xf0cf('0x31')](_0x416185[_0xf0cf('0x2e')],_0x416185[_0xf0cf('0x2f')]);_0x4e62ed[_0xf0cf('0x30')]=_[_0xf0cf('0x31')](_0x416185[_0xf0cf('0x2e')],qs[_0xf0cf('0x32')](_0x879eca[_0xf0cf('0x2f')][_0xf0cf('0x32')]));_0x4e62ed[_0xf0cf('0x30')]=_0x4e62ed['attributes'][_0xf0cf('0x33')]?_0x4e62ed[_0xf0cf('0x30')]:_0x416185[_0xf0cf('0x2e')];if(_0x879eca[_0xf0cf('0x2f')][_0xf0cf('0x3d')]){_0x4e62ed[_0xf0cf('0x3e')]=[{'all':!![]}];}_0x4e62ed=_['merge']({},_0x4e62ed,_0x879eca[_0xf0cf('0x3c')]);return db['MailServerOut'][_0xf0cf('0x44')](_0x4e62ed)[_0xf0cf('0x23')](handleEntityNotFound(_0x2a34f2,null))[_0xf0cf('0x23')](respondWithResult(_0x2a34f2,null))[_0xf0cf('0x41')](handleError(_0x2a34f2,null));};exports['create']=function(_0x4a4bee,_0x5b4f6e){return db['MailServerOut']['create'](_0x4a4bee['body'],{})[_0xf0cf('0x23')](respondWithResult(_0x5b4f6e,0xc9))['catch'](handleError(_0x5b4f6e,null));};exports[_0xf0cf('0x22')]=function(_0x4563f5,_0x1ea6c2){if(_0x4563f5[_0xf0cf('0x45')]['id']){delete _0x4563f5[_0xf0cf('0x45')]['id'];}return db['MailServerOut'][_0xf0cf('0x44')]({'where':{'id':_0x4563f5[_0xf0cf('0x43')]['id']}})[_0xf0cf('0x23')](handleEntityNotFound(_0x1ea6c2,null))[_0xf0cf('0x23')](saveUpdates(_0x4563f5['body'],null))['then'](respondWithResult(_0x1ea6c2,null))[_0xf0cf('0x41')](handleError(_0x1ea6c2,null));};exports[_0xf0cf('0x24')]=function(_0x4c51a2,_0x49adc7){return db[_0xf0cf('0x29')][_0xf0cf('0x44')]({'where':{'id':_0x4c51a2[_0xf0cf('0x43')]['id']}})[_0xf0cf('0x23')](handleEntityNotFound(_0x49adc7,null))[_0xf0cf('0x23')](removeEntity(_0x49adc7,null))[_0xf0cf('0x41')](handleError(_0x49adc7,null));}; \ No newline at end of file +var _0x58ae=['error','stack','name','send','index','map','MailServerOut','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','rawAttributes','includeAll','find','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','to-csv','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','status','end','json','offset','limit','count','apply','update','then','destroy'];(function(_0x7ef78,_0xe47ee2){var _0x12725b=function(_0x289dd9){while(--_0x289dd9){_0x7ef78['push'](_0x7ef78['shift']());}};_0x12725b(++_0xe47ee2);}(_0x58ae,0x1c9));var _0xe58a=function(_0x4c0b23,_0x474c1c){_0x4c0b23=_0x4c0b23-0x0;var _0x3a06f0=_0x58ae[_0x4c0b23];return _0x3a06f0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xe58a('0x0'));var zipdir=require(_0xe58a('0x1'));var jsonpatch=require(_0xe58a('0x2'));var rp=require(_0xe58a('0x3'));var moment=require(_0xe58a('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xe58a('0x5'));var util=require('util');var path=require(_0xe58a('0x6'));var sox=require('sox');var csv=require(_0xe58a('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xe58a('0x8'));var crypto=require('crypto');var jsforce=require(_0xe58a('0x9'));var deskjs=require(_0xe58a('0xa'));var toCsv=require('to-csv');var querystring=require(_0xe58a('0xb'));var Papa=require(_0xe58a('0xc'));var Redis=require(_0xe58a('0xd'));var authService=require(_0xe58a('0xe'));var qs=require(_0xe58a('0xf'));var as=require(_0xe58a('0x10'));var hardwareService=require(_0xe58a('0x11'));var logger=require(_0xe58a('0x12'))(_0xe58a('0x13'));var utils=require(_0xe58a('0x14'));var config=require(_0xe58a('0x15'));var licenseUtil=require(_0xe58a('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2ef356,_0x478e28){_0x478e28=_0x478e28||0xcc;return function(_0x322891){if(_0x322891){return _0x2ef356['sendStatus'](_0x478e28);}return _0x2ef356[_0xe58a('0x17')](_0x478e28)[_0xe58a('0x18')]();};}function respondWithResult(_0x140c8f,_0x5058c8){_0x5058c8=_0x5058c8||0xc8;return function(_0x5b739b){if(_0x5b739b){return _0x140c8f['status'](_0x5058c8)[_0xe58a('0x19')](_0x5b739b);}};}function respondWithFilteredResult(_0x94430d,_0xf55e20){return function(_0xf6ecf1){if(_0xf6ecf1){var _0x5228fa=typeof _0xf55e20[_0xe58a('0x1a')]==='undefined'&&typeof _0xf55e20[_0xe58a('0x1b')]==='undefined';var _0x5d8d74=_0xf6ecf1['count'];var _0x78ca6c=_0x5228fa?0x0:_0xf55e20['offset'];var _0x53a7e4=_0x5228fa?_0xf6ecf1[_0xe58a('0x1c')]:_0xf55e20[_0xe58a('0x1a')]+_0xf55e20[_0xe58a('0x1b')];var _0x19bfaf;if(_0x53a7e4>=_0x5d8d74){_0x53a7e4=_0x5d8d74;_0x19bfaf=0xc8;}else{_0x19bfaf=0xce;}_0x94430d[_0xe58a('0x17')](_0x19bfaf);return _0x94430d['set']('Content-Range',_0x78ca6c+'-'+_0x53a7e4+'/'+_0x5d8d74)['json'](_0xf6ecf1);}return null;};}function patchUpdates(_0x9684e1){return function(_0x46e062){try{jsonpatch[_0xe58a('0x1d')](_0x46e062,_0x9684e1,!![]);}catch(_0x48ff8c){return BPromise['reject'](_0x48ff8c);}return _0x46e062['save']();};}function saveUpdates(_0x4fd4c3,_0x597ba9){return function(_0x2bce2d){if(_0x2bce2d){return _0x2bce2d[_0xe58a('0x1e')](_0x4fd4c3)[_0xe58a('0x1f')](function(_0xfce5c6){return _0xfce5c6;});}return null;};}function removeEntity(_0x57295a,_0x1e0887){return function(_0xea5795){if(_0xea5795){return _0xea5795[_0xe58a('0x20')]()[_0xe58a('0x1f')](function(){_0x57295a[_0xe58a('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2e0de1,_0x201382){return function(_0x184457){if(!_0x184457){_0x2e0de1['sendStatus'](0x194);}return _0x184457;};}function handleError(_0x3d63ac,_0x30f958){_0x30f958=_0x30f958||0x1f4;return function(_0x16919d){logger[_0xe58a('0x21')](_0x16919d[_0xe58a('0x22')]);if(_0x16919d[_0xe58a('0x23')]){delete _0x16919d[_0xe58a('0x23')];}_0x3d63ac[_0xe58a('0x17')](_0x30f958)[_0xe58a('0x24')](_0x16919d);};}exports[_0xe58a('0x25')]=function(_0x2ea128,_0x5a766a){var _0x31e710={},_0x525a45={},_0x1ccb9f={'count':0x0,'rows':[]};var _0x190238=_[_0xe58a('0x26')](db[_0xe58a('0x27')]['rawAttributes'],function(_0x233f75){return{'name':_0x233f75[_0xe58a('0x28')],'type':_0x233f75[_0xe58a('0x29')]['key']};});_0x525a45[_0xe58a('0x2a')]=_[_0xe58a('0x26')](_0x190238,_0xe58a('0x23'));_0x525a45['query']=_[_0xe58a('0x2b')](_0x2ea128[_0xe58a('0x2c')]);_0x525a45[_0xe58a('0x2d')]=_[_0xe58a('0x2e')](_0x525a45[_0xe58a('0x2a')],_0x525a45[_0xe58a('0x2c')]);_0x31e710[_0xe58a('0x2f')]=_[_0xe58a('0x2e')](_0x525a45['model'],qs[_0xe58a('0x30')](_0x2ea128[_0xe58a('0x2c')][_0xe58a('0x30')]));_0x31e710[_0xe58a('0x2f')]=_0x31e710[_0xe58a('0x2f')][_0xe58a('0x31')]?_0x31e710[_0xe58a('0x2f')]:_0x525a45['model'];if(!_0x2ea128[_0xe58a('0x2c')]['hasOwnProperty'](_0xe58a('0x32'))){_0x31e710[_0xe58a('0x1b')]=qs[_0xe58a('0x1b')](_0x2ea128[_0xe58a('0x2c')][_0xe58a('0x1b')]);_0x31e710[_0xe58a('0x1a')]=qs[_0xe58a('0x1a')](_0x2ea128[_0xe58a('0x2c')][_0xe58a('0x1a')]);}_0x31e710[_0xe58a('0x33')]=qs[_0xe58a('0x34')](_0x2ea128[_0xe58a('0x2c')][_0xe58a('0x34')]);_0x31e710[_0xe58a('0x35')]=qs['filters'](_[_0xe58a('0x36')](_0x2ea128[_0xe58a('0x2c')],_0x525a45['filters']),_0x190238);if(_0x2ea128[_0xe58a('0x2c')][_0xe58a('0x37')]){_0x31e710['where']=_[_0xe58a('0x38')](_0x31e710[_0xe58a('0x35')],{'$or':_[_0xe58a('0x26')](_0x190238,function(_0x5bba53){if(_0x5bba53['type']!==_0xe58a('0x39')){var _0x47b5d7={};_0x47b5d7[_0x5bba53['name']]={'$like':'%'+_0x2ea128[_0xe58a('0x2c')]['filter']+'%'};return _0x47b5d7;}})});}_0x31e710=_[_0xe58a('0x38')]({},_0x31e710,_0x2ea128[_0xe58a('0x3a')]);var _0x5e629b={'where':_0x31e710[_0xe58a('0x35')]};return db[_0xe58a('0x27')]['count'](_0x5e629b)[_0xe58a('0x1f')](function(_0x5b22d5){_0x1ccb9f[_0xe58a('0x1c')]=_0x5b22d5;if(_0x2ea128[_0xe58a('0x2c')]['includeAll']){_0x31e710[_0xe58a('0x3b')]=[{'all':!![]}];}return db[_0xe58a('0x27')][_0xe58a('0x3c')](_0x31e710);})[_0xe58a('0x1f')](function(_0xe09617){_0x1ccb9f[_0xe58a('0x3d')]=_0xe09617;return _0x1ccb9f;})['then'](respondWithFilteredResult(_0x5a766a,_0x31e710))[_0xe58a('0x3e')](handleError(_0x5a766a,null));};exports[_0xe58a('0x3f')]=function(_0x8dad84,_0x1fb7f2){var _0x24a0df={'raw':!![],'where':{'id':_0x8dad84[_0xe58a('0x40')]['id']}},_0x558c19={};_0x558c19[_0xe58a('0x2a')]=_[_0xe58a('0x2b')](db[_0xe58a('0x27')][_0xe58a('0x41')]);_0x558c19[_0xe58a('0x2c')]=_[_0xe58a('0x2b')](_0x8dad84[_0xe58a('0x2c')]);_0x558c19[_0xe58a('0x2d')]=_[_0xe58a('0x2e')](_0x558c19[_0xe58a('0x2a')],_0x558c19['query']);_0x24a0df[_0xe58a('0x2f')]=_[_0xe58a('0x2e')](_0x558c19[_0xe58a('0x2a')],qs[_0xe58a('0x30')](_0x8dad84[_0xe58a('0x2c')][_0xe58a('0x30')]));_0x24a0df[_0xe58a('0x2f')]=_0x24a0df[_0xe58a('0x2f')]['length']?_0x24a0df[_0xe58a('0x2f')]:_0x558c19[_0xe58a('0x2a')];if(_0x8dad84[_0xe58a('0x2c')][_0xe58a('0x42')]){_0x24a0df[_0xe58a('0x3b')]=[{'all':!![]}];}_0x24a0df=_['merge']({},_0x24a0df,_0x8dad84[_0xe58a('0x3a')]);return db[_0xe58a('0x27')][_0xe58a('0x43')](_0x24a0df)[_0xe58a('0x1f')](handleEntityNotFound(_0x1fb7f2,null))[_0xe58a('0x1f')](respondWithResult(_0x1fb7f2,null))[_0xe58a('0x3e')](handleError(_0x1fb7f2,null));};exports[_0xe58a('0x44')]=function(_0x1691ad,_0x5eec4){return db['MailServerOut'][_0xe58a('0x44')](_0x1691ad[_0xe58a('0x45')],{})[_0xe58a('0x1f')](respondWithResult(_0x5eec4,0xc9))[_0xe58a('0x3e')](handleError(_0x5eec4,null));};exports[_0xe58a('0x1e')]=function(_0x1a6117,_0x47e879){if(_0x1a6117['body']['id']){delete _0x1a6117[_0xe58a('0x45')]['id'];}return db[_0xe58a('0x27')]['find']({'where':{'id':_0x1a6117['params']['id']}})['then'](handleEntityNotFound(_0x47e879,null))[_0xe58a('0x1f')](saveUpdates(_0x1a6117[_0xe58a('0x45')],null))[_0xe58a('0x1f')](respondWithResult(_0x47e879,null))['catch'](handleError(_0x47e879,null));};exports['destroy']=function(_0x108ac4,_0xcd97d8){return db[_0xe58a('0x27')]['find']({'where':{'id':_0x108ac4[_0xe58a('0x40')]['id']}})[_0xe58a('0x1f')](handleEntityNotFound(_0xcd97d8,null))[_0xe58a('0x1f')](removeEntity(_0xcd97d8,null))[_0xe58a('0x3e')](handleError(_0xcd97d8,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index 7d8cf86..f562460 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 _0x95bc=['util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./mailServerOut.attributes','exports','MailServerOut','mail_servers_out','lodash'];(function(_0x33b101,_0x1fe78f){var _0x5553af=function(_0x31a4ad){while(--_0x31a4ad){_0x33b101['push'](_0x33b101['shift']());}};_0x5553af(++_0x1fe78f);}(_0x95bc,0x81));var _0xc95b=function(_0x45c052,_0xa0e041){_0x45c052=_0x45c052-0x0;var _0x16d11a=_0x95bc[_0x45c052];return _0x16d11a;};'use strict';var _=require(_0xc95b('0x0'));var util=require(_0xc95b('0x1'));var logger=require(_0xc95b('0x2'))(_0xc95b('0x3'));var moment=require(_0xc95b('0x4'));var BPromise=require(_0xc95b('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc95b('0x6'));var rimraf=require(_0xc95b('0x7'));var config=require(_0xc95b('0x8'));var attributes=require(_0xc95b('0x9'));module[_0xc95b('0xa')]=function(_0x378532,_0x820dd1){return _0x378532['define'](_0xc95b('0xb'),attributes,{'tableName':_0xc95b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xae2f=['util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./mailServerOut.attributes','define','MailServerOut','mail_servers_out','lodash'];(function(_0x241dec,_0x59a528){var _0x5def47=function(_0x265c6c){while(--_0x265c6c){_0x241dec['push'](_0x241dec['shift']());}};_0x5def47(++_0x59a528);}(_0xae2f,0xf6));var _0xfae2=function(_0x4f32de,_0x5bd4a){_0x4f32de=_0x4f32de-0x0;var _0x149821=_0xae2f[_0x4f32de];return _0x149821;};'use strict';var _=require(_0xfae2('0x0'));var util=require(_0xfae2('0x1'));var logger=require(_0xfae2('0x2'))(_0xfae2('0x3'));var moment=require('moment');var BPromise=require(_0xfae2('0x4'));var rp=require(_0xfae2('0x5'));var fs=require('fs');var path=require(_0xfae2('0x6'));var rimraf=require(_0xfae2('0x7'));var config=require(_0xfae2('0x8'));var attributes=require(_0xfae2('0x9'));module['exports']=function(_0x2ed638,_0x2e231b){return _0x2ed638[_0xfae2('0xa')](_0xfae2('0xb'),attributes,{'tableName':_0xfae2('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.rpc.js b/server/api/mailServerOut/mailServerOut.rpc.js index d7c0a7f..55fdb7c 100644 --- a/server/api/mailServerOut/mailServerOut.rpc.js +++ b/server/api/mailServerOut/mailServerOut.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f2f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','MailServerOut,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x3ce057,_0x16e553){var _0x4c7705=function(_0x3aa103){while(--_0x3aa103){_0x3ce057['push'](_0x3ce057['shift']());}};_0x4c7705(++_0x16e553);}(_0x5f2f,0x73));var _0xf5f2=function(_0xa63b0d,_0x2a94ac){_0xa63b0d=_0xa63b0d-0x0;var _0x325298=_0x5f2f[_0xa63b0d];return _0x325298;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3133bc,_0x473100,_0x5907aa){return new BPromise(function(_0x466882,_0x46cd9c){return client[_0xf5f2('0xc')](_0x3133bc,_0x5907aa)['then'](function(_0x375da4){logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,'request\x20sent');logger[_0xf5f2('0xf')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});} \ No newline at end of file +var _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','MailServerOut,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x131b07,_0x17a72b){var _0x5e4a37=function(_0x402f2f){while(--_0x402f2f){_0x131b07['push'](_0x131b07['shift']());}};_0x5e4a37(++_0x17a72b);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0xc4aa[_0x1928c9];return _0x51b5fb;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index ea2b863..b1f6c41 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 _0xade4=['get','isAuthenticated','index','describe','create','/:id','update','delete','destroy','exports','multer','util','path','express','../../components/auth/service','../../config/environment'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xade4,0xda));var _0x4ade=function(_0x1ebdca,_0x44732d){_0x1ebdca=_0x1ebdca-0x0;var _0x106295=_0xade4[_0x1ebdca];return _0x106295;};'use strict';var multer=require(_0x4ade('0x0'));var util=require(_0x4ade('0x1'));var path=require(_0x4ade('0x2'));var timeout=require('connect-timeout');var express=require(_0x4ade('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x4ade('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x4ade('0x5'));var controller=require('./mailSubstatus.controller');router[_0x4ade('0x6')]('/',auth[_0x4ade('0x7')](),controller[_0x4ade('0x8')]);router[_0x4ade('0x6')]('/describe',auth[_0x4ade('0x7')](),controller[_0x4ade('0x9')]);router[_0x4ade('0x6')]('/:id',auth[_0x4ade('0x7')](),controller['show']);router['post']('/',auth[_0x4ade('0x7')](),controller[_0x4ade('0xa')]);router['put'](_0x4ade('0xb'),auth[_0x4ade('0x7')](),controller[_0x4ade('0xc')]);router[_0x4ade('0xd')](_0x4ade('0xb'),auth[_0x4ade('0x7')](),controller[_0x4ade('0xe')]);module[_0x4ade('0xf')]=router; \ No newline at end of file +var _0xfd0c=['put','/:id','update','destroy','exports','util','express','fs-extra','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','get','isAuthenticated','/describe','describe','show','post','create'];(function(_0x61a0c0,_0x4e1ecb){var _0x388f5a=function(_0x2d800a){while(--_0x2d800a){_0x61a0c0['push'](_0x61a0c0['shift']());}};_0x388f5a(++_0x4e1ecb);}(_0xfd0c,0xcb));var _0xcfd0=function(_0x47a5bd,_0x508329){_0x47a5bd=_0x47a5bd-0x0;var _0x5c2184=_0xfd0c[_0x47a5bd];return _0x5c2184;};'use strict';var multer=require('multer');var util=require(_0xcfd0('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xcfd0('0x1'));var router=express['Router']();var fs_extra=require(_0xcfd0('0x2'));var auth=require('../../components/auth/service');var interaction=require(_0xcfd0('0x3'));var config=require(_0xcfd0('0x4'));var controller=require(_0xcfd0('0x5'));router[_0xcfd0('0x6')]('/',auth[_0xcfd0('0x7')](),controller['index']);router[_0xcfd0('0x6')](_0xcfd0('0x8'),auth[_0xcfd0('0x7')](),controller[_0xcfd0('0x9')]);router[_0xcfd0('0x6')]('/:id',auth[_0xcfd0('0x7')](),controller[_0xcfd0('0xa')]);router[_0xcfd0('0xb')]('/',auth[_0xcfd0('0x7')](),controller[_0xcfd0('0xc')]);router[_0xcfd0('0xd')](_0xcfd0('0xe'),auth[_0xcfd0('0x7')](),controller[_0xcfd0('0xf')]);router['delete'](_0xcfd0('0xe'),auth[_0xcfd0('0x7')](),controller[_0xcfd0('0x10')]);module[_0xcfd0('0x11')]=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index 208492c..cdcd910 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 _0xba18=['STRING','name','sequelize','exports'];(function(_0x43577a,_0xd9dc6e){var _0xb8d923=function(_0x15912e){while(--_0x15912e){_0x43577a['push'](_0x43577a['shift']());}};_0xb8d923(++_0xd9dc6e);}(_0xba18,0x1ea));var _0x8ba1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xba18[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x8ba1('0x0'));module[_0x8ba1('0x1')]={'name':{'type':Sequelize[_0x8ba1('0x2')],'unique':_0x8ba1('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x8ba1('0x2')]}}; \ No newline at end of file +var _0x7bd0=['name','sequelize','exports','STRING'];(function(_0x2ae2ad,_0xac5b0c){var _0x26dbd7=function(_0x5e685b){while(--_0x5e685b){_0x2ae2ad['push'](_0x2ae2ad['shift']());}};_0x26dbd7(++_0xac5b0c);}(_0x7bd0,0x111));var _0x07bd=function(_0x541260,_0x4c7f2e){_0x541260=_0x541260-0x0;var _0x1dd2b5=_0x7bd0[_0x541260];return _0x1dd2b5;};'use strict';var Sequelize=require(_0x07bd('0x0'));module[_0x07bd('0x1')]={'name':{'type':Sequelize[_0x07bd('0x2')],'unique':_0x07bd('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x07bd('0x2')]}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index 3855a4b..119c584 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 _0x718d=['json','undefined','count','offset','set','Content-Range','reject','save','update','then','error','stack','send','index','map','rawAttributes','key','name','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','MailSubstatus','findAll','show','params','length','include','find','catch','create','body','destroy','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','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'];(function(_0x2e3e6a,_0x4b231f){var _0x3c8c5c=function(_0x4dea1e){while(--_0x4dea1e){_0x2e3e6a['push'](_0x2e3e6a['shift']());}};_0x3c8c5c(++_0x4b231f);}(_0x718d,0x16e));var _0xd718=function(_0x3ba5a2,_0x3fadbb){_0x3ba5a2=_0x3ba5a2-0x0;var _0x1e64a9=_0x718d[_0x3ba5a2];return _0x1e64a9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd718('0x0'));var zipdir=require(_0xd718('0x1'));var jsonpatch=require(_0xd718('0x2'));var rp=require(_0xd718('0x3'));var moment=require(_0xd718('0x4'));var BPromise=require(_0xd718('0x5'));var Mustache=require(_0xd718('0x6'));var util=require('util');var path=require(_0xd718('0x7'));var sox=require(_0xd718('0x8'));var csv=require(_0xd718('0x9'));var ejs=require(_0xd718('0xa'));var fs=require('fs');var fs_extra=require(_0xd718('0xb'));var _=require(_0xd718('0xc'));var squel=require(_0xd718('0xd'));var crypto=require(_0xd718('0xe'));var jsforce=require(_0xd718('0xf'));var deskjs=require(_0xd718('0x10'));var toCsv=require(_0xd718('0x9'));var querystring=require('querystring');var Papa=require(_0xd718('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xd718('0x12'));var as=require(_0xd718('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd718('0x14'))(_0xd718('0x15'));var utils=require(_0xd718('0x16'));var config=require(_0xd718('0x17'));var licenseUtil=require(_0xd718('0x18'));var db=require(_0xd718('0x19'))['db'];function respondWithStatusCode(_0x160e37,_0x5aabee){_0x5aabee=_0x5aabee||0xcc;return function(_0x30a18e){if(_0x30a18e){return _0x160e37[_0xd718('0x1a')](_0x5aabee);}return _0x160e37[_0xd718('0x1b')](_0x5aabee)[_0xd718('0x1c')]();};}function respondWithResult(_0x3b0e81,_0x43b4d4){_0x43b4d4=_0x43b4d4||0xc8;return function(_0x506e7b){if(_0x506e7b){return _0x3b0e81[_0xd718('0x1b')](_0x43b4d4)[_0xd718('0x1d')](_0x506e7b);}};}function respondWithFilteredResult(_0x10f6af,_0x4749eb){return function(_0x3ff05e){if(_0x3ff05e){var _0x44e0c9=typeof _0x4749eb['offset']===_0xd718('0x1e')&&typeof _0x4749eb['limit']===_0xd718('0x1e');var _0x1aa674=_0x3ff05e[_0xd718('0x1f')];var _0x2ca0af=_0x44e0c9?0x0:_0x4749eb[_0xd718('0x20')];var _0x1dd2e4=_0x44e0c9?_0x3ff05e[_0xd718('0x1f')]:_0x4749eb[_0xd718('0x20')]+_0x4749eb['limit'];var _0x11ac84;if(_0x1dd2e4>=_0x1aa674){_0x1dd2e4=_0x1aa674;_0x11ac84=0xc8;}else{_0x11ac84=0xce;}_0x10f6af['status'](_0x11ac84);return _0x10f6af[_0xd718('0x21')](_0xd718('0x22'),_0x2ca0af+'-'+_0x1dd2e4+'/'+_0x1aa674)[_0xd718('0x1d')](_0x3ff05e);}return null;};}function patchUpdates(_0x51badd){return function(_0x93d95c){try{jsonpatch['apply'](_0x93d95c,_0x51badd,!![]);}catch(_0x57461d){return BPromise[_0xd718('0x23')](_0x57461d);}return _0x93d95c[_0xd718('0x24')]();};}function saveUpdates(_0x260f20,_0x4692a4){return function(_0x53bcee){if(_0x53bcee){return _0x53bcee[_0xd718('0x25')](_0x260f20)[_0xd718('0x26')](function(_0x1dedf3){return _0x1dedf3;});}return null;};}function removeEntity(_0x12cea9,_0x9b44c3){return function(_0x54e11b){if(_0x54e11b){return _0x54e11b['destroy']()[_0xd718('0x26')](function(){_0x12cea9[_0xd718('0x1b')](0xcc)[_0xd718('0x1c')]();});}};}function handleEntityNotFound(_0x2d9c76,_0x41a5b9){return function(_0x41ef26){if(!_0x41ef26){_0x2d9c76[_0xd718('0x1a')](0x194);}return _0x41ef26;};}function handleError(_0xf42567,_0x439e88){_0x439e88=_0x439e88||0x1f4;return function(_0x41eb8f){logger[_0xd718('0x27')](_0x41eb8f[_0xd718('0x28')]);if(_0x41eb8f['name']){delete _0x41eb8f['name'];}_0xf42567['status'](_0x439e88)[_0xd718('0x29')](_0x41eb8f);};}exports[_0xd718('0x2a')]=function(_0x211ed2,_0x3aa69f){var _0x27da13={},_0x5ed9ce={},_0x2a95a6={'count':0x0,'rows':[]};var _0x4b3a73=_[_0xd718('0x2b')](db['MailSubstatus'][_0xd718('0x2c')],function(_0x316869){return{'name':_0x316869['fieldName'],'type':_0x316869['type'][_0xd718('0x2d')]};});_0x5ed9ce['model']=_[_0xd718('0x2b')](_0x4b3a73,_0xd718('0x2e'));_0x5ed9ce['query']=_[_0xd718('0x2f')](_0x211ed2[_0xd718('0x30')]);_0x5ed9ce[_0xd718('0x31')]=_[_0xd718('0x32')](_0x5ed9ce[_0xd718('0x33')],_0x5ed9ce[_0xd718('0x30')]);_0x27da13[_0xd718('0x34')]=_[_0xd718('0x32')](_0x5ed9ce[_0xd718('0x33')],qs[_0xd718('0x35')](_0x211ed2[_0xd718('0x30')][_0xd718('0x35')]));_0x27da13[_0xd718('0x34')]=_0x27da13[_0xd718('0x34')]['length']?_0x27da13[_0xd718('0x34')]:_0x5ed9ce[_0xd718('0x33')];if(!_0x211ed2[_0xd718('0x30')][_0xd718('0x36')](_0xd718('0x37'))){_0x27da13[_0xd718('0x38')]=qs[_0xd718('0x38')](_0x211ed2['query'][_0xd718('0x38')]);_0x27da13['offset']=qs[_0xd718('0x20')](_0x211ed2[_0xd718('0x30')][_0xd718('0x20')]);}_0x27da13[_0xd718('0x39')]=qs[_0xd718('0x3a')](_0x211ed2[_0xd718('0x30')][_0xd718('0x3a')]);_0x27da13[_0xd718('0x3b')]=qs[_0xd718('0x31')](_[_0xd718('0x3c')](_0x211ed2[_0xd718('0x30')],_0x5ed9ce[_0xd718('0x31')]),_0x4b3a73);if(_0x211ed2['query'][_0xd718('0x3d')]){_0x27da13[_0xd718('0x3b')]=_[_0xd718('0x3e')](_0x27da13[_0xd718('0x3b')],{'$or':_[_0xd718('0x2b')](_0x4b3a73,function(_0x1fc13f){if(_0x1fc13f[_0xd718('0x3f')]!==_0xd718('0x40')){var _0x37f2f3={};_0x37f2f3[_0x1fc13f[_0xd718('0x2e')]]={'$like':'%'+_0x211ed2[_0xd718('0x30')][_0xd718('0x3d')]+'%'};return _0x37f2f3;}})});}_0x27da13=_[_0xd718('0x3e')]({},_0x27da13,_0x211ed2[_0xd718('0x41')]);var _0x1fa6b1={'where':_0x27da13['where']};return db['MailSubstatus']['count'](_0x1fa6b1)[_0xd718('0x26')](function(_0x598de7){_0x2a95a6['count']=_0x598de7;if(_0x211ed2['query'][_0xd718('0x42')]){_0x27da13['include']=[{'all':!![]}];}return db[_0xd718('0x43')][_0xd718('0x44')](_0x27da13);})['then'](function(_0x4ca65b){_0x2a95a6['rows']=_0x4ca65b;return _0x2a95a6;})[_0xd718('0x26')](respondWithFilteredResult(_0x3aa69f,_0x27da13))['catch'](handleError(_0x3aa69f,null));};exports[_0xd718('0x45')]=function(_0x4f97fb,_0x451c11){var _0x48aa20={'raw':!![],'where':{'id':_0x4f97fb[_0xd718('0x46')]['id']}},_0x3df9ed={};_0x3df9ed[_0xd718('0x33')]=_[_0xd718('0x2f')](db[_0xd718('0x43')][_0xd718('0x2c')]);_0x3df9ed[_0xd718('0x30')]=_[_0xd718('0x2f')](_0x4f97fb[_0xd718('0x30')]);_0x3df9ed[_0xd718('0x31')]=_[_0xd718('0x32')](_0x3df9ed[_0xd718('0x33')],_0x3df9ed[_0xd718('0x30')]);_0x48aa20[_0xd718('0x34')]=_[_0xd718('0x32')](_0x3df9ed['model'],qs[_0xd718('0x35')](_0x4f97fb['query'][_0xd718('0x35')]));_0x48aa20['attributes']=_0x48aa20['attributes'][_0xd718('0x47')]?_0x48aa20[_0xd718('0x34')]:_0x3df9ed[_0xd718('0x33')];if(_0x4f97fb[_0xd718('0x30')]['includeAll']){_0x48aa20[_0xd718('0x48')]=[{'all':!![]}];}_0x48aa20=_['merge']({},_0x48aa20,_0x4f97fb['options']);return db['MailSubstatus'][_0xd718('0x49')](_0x48aa20)[_0xd718('0x26')](handleEntityNotFound(_0x451c11,null))[_0xd718('0x26')](respondWithResult(_0x451c11,null))[_0xd718('0x4a')](handleError(_0x451c11,null));};exports[_0xd718('0x4b')]=function(_0x2bd27a,_0xdfb4d8){return db['MailSubstatus'][_0xd718('0x4b')](_0x2bd27a[_0xd718('0x4c')],{})[_0xd718('0x26')](respondWithResult(_0xdfb4d8,0xc9))[_0xd718('0x4a')](handleError(_0xdfb4d8,null));};exports[_0xd718('0x25')]=function(_0x393d24,_0x19296d){if(_0x393d24[_0xd718('0x4c')]['id']){delete _0x393d24['body']['id'];}return db['MailSubstatus']['find']({'where':{'id':_0x393d24[_0xd718('0x46')]['id']}})[_0xd718('0x26')](handleEntityNotFound(_0x19296d,null))[_0xd718('0x26')](saveUpdates(_0x393d24['body'],null))[_0xd718('0x26')](respondWithResult(_0x19296d,null))['catch'](handleError(_0x19296d,null));};exports[_0xd718('0x4d')]=function(_0x564d70,_0x481170){return db['MailSubstatus'][_0xd718('0x49')]({'where':{'id':_0x564d70[_0xd718('0x46')]['id']}})[_0xd718('0x26')](handleEntityNotFound(_0x481170,null))['then'](removeEntity(_0x481170,null))['catch'](handleError(_0x481170,null));};exports[_0xd718('0x4e')]=function(_0x578e09,_0x1788a4){return db[_0xd718('0x43')]['describe']()[_0xd718('0x26')](respondWithResult(_0x1788a4,null))['catch'](handleError(_0x1788a4,null));}; \ No newline at end of file +var _0xdcaa=['api','../../config/environment','../../config/license/util','sendStatus','status','undefined','count','offset','apply','reject','save','update','then','destroy','end','error','stack','name','send','map','MailSubstatus','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','pick','filter','merge','where','options','includeAll','include','findAll','rows','show','params','find','catch','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x596482,_0x2241c4){var _0x634068=function(_0x473d29){while(--_0x473d29){_0x596482['push'](_0x596482['shift']());}};_0x634068(++_0x2241c4);}(_0xdcaa,0x1ea));var _0xadca=function(_0xc33e5d,_0x35c74a){_0xc33e5d=_0xc33e5d-0x0;var _0x30b935=_0xdcaa[_0xc33e5d];return _0x30b935;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xadca('0x0'));var zipdir=require(_0xadca('0x1'));var jsonpatch=require(_0xadca('0x2'));var rp=require(_0xadca('0x3'));var moment=require('moment');var BPromise=require(_0xadca('0x4'));var Mustache=require(_0xadca('0x5'));var util=require(_0xadca('0x6'));var path=require(_0xadca('0x7'));var sox=require(_0xadca('0x8'));var csv=require(_0xadca('0x9'));var ejs=require(_0xadca('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xadca('0xb'));var crypto=require(_0xadca('0xc'));var jsforce=require(_0xadca('0xd'));var deskjs=require(_0xadca('0xe'));var toCsv=require(_0xadca('0x9'));var querystring=require(_0xadca('0xf'));var Papa=require(_0xadca('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xadca('0x11'));var as=require(_0xadca('0x12'));var hardwareService=require(_0xadca('0x13'));var logger=require(_0xadca('0x14'))(_0xadca('0x15'));var utils=require('../../config/utils');var config=require(_0xadca('0x16'));var licenseUtil=require(_0xadca('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xec0407,_0x1ea1c7){_0x1ea1c7=_0x1ea1c7||0xcc;return function(_0x3d1d75){if(_0x3d1d75){return _0xec0407[_0xadca('0x18')](_0x1ea1c7);}return _0xec0407[_0xadca('0x19')](_0x1ea1c7)['end']();};}function respondWithResult(_0x468160,_0x3feccb){_0x3feccb=_0x3feccb||0xc8;return function(_0x287f0e){if(_0x287f0e){return _0x468160['status'](_0x3feccb)['json'](_0x287f0e);}};}function respondWithFilteredResult(_0x3b2b84,_0x511cc4){return function(_0x3745b3){if(_0x3745b3){var _0x59a9ae=typeof _0x511cc4['offset']===_0xadca('0x1a')&&typeof _0x511cc4['limit']==='undefined';var _0xd09f14=_0x3745b3[_0xadca('0x1b')];var _0x553a1c=_0x59a9ae?0x0:_0x511cc4['offset'];var _0x557a2a=_0x59a9ae?_0x3745b3['count']:_0x511cc4[_0xadca('0x1c')]+_0x511cc4['limit'];var _0x391eaf;if(_0x557a2a>=_0xd09f14){_0x557a2a=_0xd09f14;_0x391eaf=0xc8;}else{_0x391eaf=0xce;}_0x3b2b84['status'](_0x391eaf);return _0x3b2b84['set']('Content-Range',_0x553a1c+'-'+_0x557a2a+'/'+_0xd09f14)['json'](_0x3745b3);}return null;};}function patchUpdates(_0x23614a){return function(_0x28066b){try{jsonpatch[_0xadca('0x1d')](_0x28066b,_0x23614a,!![]);}catch(_0x4972a3){return BPromise[_0xadca('0x1e')](_0x4972a3);}return _0x28066b[_0xadca('0x1f')]();};}function saveUpdates(_0x4fcabb,_0x28923d){return function(_0x3e7f25){if(_0x3e7f25){return _0x3e7f25[_0xadca('0x20')](_0x4fcabb)[_0xadca('0x21')](function(_0x285d26){return _0x285d26;});}return null;};}function removeEntity(_0x1f5f6f,_0x2e017a){return function(_0x11032f){if(_0x11032f){return _0x11032f[_0xadca('0x22')]()[_0xadca('0x21')](function(){_0x1f5f6f[_0xadca('0x19')](0xcc)[_0xadca('0x23')]();});}};}function handleEntityNotFound(_0x3e38ae,_0x46adae){return function(_0x4c5dbc){if(!_0x4c5dbc){_0x3e38ae[_0xadca('0x18')](0x194);}return _0x4c5dbc;};}function handleError(_0x1535f6,_0x3db937){_0x3db937=_0x3db937||0x1f4;return function(_0x253a00){logger[_0xadca('0x24')](_0x253a00[_0xadca('0x25')]);if(_0x253a00[_0xadca('0x26')]){delete _0x253a00[_0xadca('0x26')];}_0x1535f6[_0xadca('0x19')](_0x3db937)[_0xadca('0x27')](_0x253a00);};}exports['index']=function(_0x346d18,_0x167599){var _0x1bd129={},_0x33238c={},_0x532604={'count':0x0,'rows':[]};var _0x90230=_[_0xadca('0x28')](db[_0xadca('0x29')][_0xadca('0x2a')],function(_0x509047){return{'name':_0x509047[_0xadca('0x2b')],'type':_0x509047[_0xadca('0x2c')][_0xadca('0x2d')]};});_0x33238c[_0xadca('0x2e')]=_[_0xadca('0x28')](_0x90230,_0xadca('0x26'));_0x33238c[_0xadca('0x2f')]=_[_0xadca('0x30')](_0x346d18['query']);_0x33238c[_0xadca('0x31')]=_[_0xadca('0x32')](_0x33238c[_0xadca('0x2e')],_0x33238c[_0xadca('0x2f')]);_0x1bd129[_0xadca('0x33')]=_[_0xadca('0x32')](_0x33238c['model'],qs['fields'](_0x346d18['query'][_0xadca('0x34')]));_0x1bd129[_0xadca('0x33')]=_0x1bd129[_0xadca('0x33')]['length']?_0x1bd129[_0xadca('0x33')]:_0x33238c[_0xadca('0x2e')];if(!_0x346d18['query'][_0xadca('0x35')](_0xadca('0x36'))){_0x1bd129[_0xadca('0x37')]=qs[_0xadca('0x37')](_0x346d18[_0xadca('0x2f')][_0xadca('0x37')]);_0x1bd129['offset']=qs[_0xadca('0x1c')](_0x346d18['query'][_0xadca('0x1c')]);}_0x1bd129[_0xadca('0x38')]=qs['sort'](_0x346d18[_0xadca('0x2f')][_0xadca('0x39')]);_0x1bd129['where']=qs['filters'](_[_0xadca('0x3a')](_0x346d18[_0xadca('0x2f')],_0x33238c[_0xadca('0x31')]),_0x90230);if(_0x346d18[_0xadca('0x2f')][_0xadca('0x3b')]){_0x1bd129['where']=_[_0xadca('0x3c')](_0x1bd129[_0xadca('0x3d')],{'$or':_[_0xadca('0x28')](_0x90230,function(_0x2def5f){if(_0x2def5f['type']!=='VIRTUAL'){var _0x4badcb={};_0x4badcb[_0x2def5f['name']]={'$like':'%'+_0x346d18[_0xadca('0x2f')]['filter']+'%'};return _0x4badcb;}})});}_0x1bd129=_['merge']({},_0x1bd129,_0x346d18[_0xadca('0x3e')]);var _0x8b7480={'where':_0x1bd129[_0xadca('0x3d')]};return db[_0xadca('0x29')]['count'](_0x8b7480)[_0xadca('0x21')](function(_0x4a7e1d){_0x532604[_0xadca('0x1b')]=_0x4a7e1d;if(_0x346d18['query'][_0xadca('0x3f')]){_0x1bd129[_0xadca('0x40')]=[{'all':!![]}];}return db[_0xadca('0x29')][_0xadca('0x41')](_0x1bd129);})[_0xadca('0x21')](function(_0x5a2af1){_0x532604[_0xadca('0x42')]=_0x5a2af1;return _0x532604;})[_0xadca('0x21')](respondWithFilteredResult(_0x167599,_0x1bd129))['catch'](handleError(_0x167599,null));};exports[_0xadca('0x43')]=function(_0x40d06,_0x4ef628){var _0xd026a7={'raw':!![],'where':{'id':_0x40d06[_0xadca('0x44')]['id']}},_0x179b40={};_0x179b40['model']=_[_0xadca('0x30')](db['MailSubstatus'][_0xadca('0x2a')]);_0x179b40[_0xadca('0x2f')]=_[_0xadca('0x30')](_0x40d06['query']);_0x179b40['filters']=_[_0xadca('0x32')](_0x179b40[_0xadca('0x2e')],_0x179b40[_0xadca('0x2f')]);_0xd026a7['attributes']=_[_0xadca('0x32')](_0x179b40[_0xadca('0x2e')],qs[_0xadca('0x34')](_0x40d06[_0xadca('0x2f')][_0xadca('0x34')]));_0xd026a7['attributes']=_0xd026a7[_0xadca('0x33')]['length']?_0xd026a7[_0xadca('0x33')]:_0x179b40[_0xadca('0x2e')];if(_0x40d06[_0xadca('0x2f')][_0xadca('0x3f')]){_0xd026a7[_0xadca('0x40')]=[{'all':!![]}];}_0xd026a7=_[_0xadca('0x3c')]({},_0xd026a7,_0x40d06['options']);return db[_0xadca('0x29')][_0xadca('0x45')](_0xd026a7)[_0xadca('0x21')](handleEntityNotFound(_0x4ef628,null))[_0xadca('0x21')](respondWithResult(_0x4ef628,null))[_0xadca('0x46')](handleError(_0x4ef628,null));};exports['create']=function(_0x326b02,_0x31d9bb){return db[_0xadca('0x29')]['create'](_0x326b02[_0xadca('0x47')],{})['then'](respondWithResult(_0x31d9bb,0xc9))[_0xadca('0x46')](handleError(_0x31d9bb,null));};exports[_0xadca('0x20')]=function(_0x442468,_0x4b9dc0){if(_0x442468[_0xadca('0x47')]['id']){delete _0x442468[_0xadca('0x47')]['id'];}return db[_0xadca('0x29')][_0xadca('0x45')]({'where':{'id':_0x442468['params']['id']}})[_0xadca('0x21')](handleEntityNotFound(_0x4b9dc0,null))[_0xadca('0x21')](saveUpdates(_0x442468[_0xadca('0x47')],null))[_0xadca('0x21')](respondWithResult(_0x4b9dc0,null))[_0xadca('0x46')](handleError(_0x4b9dc0,null));};exports[_0xadca('0x22')]=function(_0x5bbcb0,_0x8c795c){return db[_0xadca('0x29')][_0xadca('0x45')]({'where':{'id':_0x5bbcb0[_0xadca('0x44')]['id']}})['then'](handleEntityNotFound(_0x8c795c,null))[_0xadca('0x21')](removeEntity(_0x8c795c,null))['catch'](handleError(_0x8c795c,null));};exports['describe']=function(_0x38491d,_0x43bae4){return db[_0xadca('0x29')][_0xadca('0x48')]()[_0xadca('0x21')](respondWithResult(_0x43bae4,null))[_0xadca('0x46')](handleError(_0x43bae4,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index f591deb..af0ea29 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 _0xd38f=['../../config/environment','./mailSubstatus.attributes','exports','MailSubstatus','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x3bbcba,_0x39e30d){var _0x5e70bd=function(_0x3ed1a9){while(--_0x3ed1a9){_0x3bbcba['push'](_0x3bbcba['shift']());}};_0x5e70bd(++_0x39e30d);}(_0xd38f,0xbf));var _0xfd38=function(_0x5eebc1,_0xc5b2c9){_0x5eebc1=_0x5eebc1-0x0;var _0x3a9ea9=_0xd38f[_0x5eebc1];return _0x3a9ea9;};'use strict';var _=require(_0xfd38('0x0'));var util=require(_0xfd38('0x1'));var logger=require(_0xfd38('0x2'))(_0xfd38('0x3'));var moment=require('moment');var BPromise=require(_0xfd38('0x4'));var rp=require(_0xfd38('0x5'));var fs=require('fs');var path=require(_0xfd38('0x6'));var rimraf=require('rimraf');var config=require(_0xfd38('0x7'));var attributes=require(_0xfd38('0x8'));module[_0xfd38('0x9')]=function(_0x1e4c6c,_0xe8fcf8){return _0x1e4c6c['define'](_0xfd38('0xa'),attributes,{'tableName':'mail_substatuses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x96d7=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailSubstatus.attributes','exports','define','mail_substatuses','lodash'];(function(_0x54c302,_0x1e91be){var _0x57d3aa=function(_0x312f81){while(--_0x312f81){_0x54c302['push'](_0x54c302['shift']());}};_0x57d3aa(++_0x1e91be);}(_0x96d7,0x1d3));var _0x796d=function(_0x244ae9,_0x5d8803){_0x244ae9=_0x244ae9-0x0;var _0x112942=_0x96d7[_0x244ae9];return _0x112942;};'use strict';var _=require(_0x796d('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x796d('0x1'));var moment=require(_0x796d('0x2'));var BPromise=require(_0x796d('0x3'));var rp=require(_0x796d('0x4'));var fs=require('fs');var path=require(_0x796d('0x5'));var rimraf=require(_0x796d('0x6'));var config=require(_0x796d('0x7'));var attributes=require(_0x796d('0x8'));module[_0x796d('0x9')]=function(_0x52903a,_0x417039){return _0x52903a[_0x796d('0xa')]('MailSubstatus',attributes,{'tableName':_0x796d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.rpc.js b/server/api/mailSubstatus/mailSubstatus.rpc.js index 1ac4c5c..6063370 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 _0x89e1=['message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','error'];(function(_0x4fa165,_0x15b5fb){var _0x27779d=function(_0x1c8d96){while(--_0x1c8d96){_0x4fa165['push'](_0x4fa165['shift']());}};_0x27779d(++_0x15b5fb);}(_0x89e1,0xab));var _0x189e=function(_0x3105f6,_0x3abf8a){_0x3105f6=_0x3105f6-0x0;var _0x8b80f1=_0x89e1[_0x3105f6];return _0x8b80f1;};'use strict';var _=require(_0x189e('0x0'));var util=require('util');var moment=require(_0x189e('0x1'));var BPromise=require('bluebird');var rs=require(_0x189e('0x2'));var fs=require('fs');var Redis=require(_0x189e('0x3'));var db=require(_0x189e('0x4'))['db'];var utils=require(_0x189e('0x5'));var logger=require(_0x189e('0x6'))('rpc');var config=require(_0x189e('0x7'));var jayson=require(_0x189e('0x8'));var client=jayson[_0x189e('0x9')][_0x189e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xa811c2,_0x520bc4,_0x4f56ff){return new BPromise(function(_0x3ebc0d,_0x2acd41){return client[_0x189e('0xb')](_0xa811c2,_0x4f56ff)[_0x189e('0xc')](function(_0x5c6b56){logger['info'](_0x189e('0xd'),_0x520bc4,_0x189e('0xe'));logger[_0x189e('0xf')](_0x189e('0x10'),_0x520bc4,'request\x20sent',JSON['stringify'](_0x5c6b56));if(_0x5c6b56[_0x189e('0x11')]){if(_0x5c6b56[_0x189e('0x11')]['code']===0x1f4){logger[_0x189e('0x11')](_0x189e('0xd'),_0x520bc4,_0x5c6b56['error'][_0x189e('0x12')]);return _0x2acd41(_0x5c6b56[_0x189e('0x11')]['message']);}logger[_0x189e('0x11')](_0x189e('0xd'),_0x520bc4,_0x5c6b56[_0x189e('0x11')]['message']);return _0x3ebc0d(_0x5c6b56[_0x189e('0x11')][_0x189e('0x12')]);}else{logger['info'](_0x189e('0xd'),_0x520bc4,_0x189e('0xe'));_0x3ebc0d(_0x5c6b56[_0x189e('0x13')][_0x189e('0x12')]);}})[_0x189e('0x14')](function(_0x503751){logger[_0x189e('0x11')](_0x189e('0xd'),_0x520bc4,_0x503751);_0x2acd41(_0x503751);});});} \ No newline at end of file +var _0xe3cc=['../../config/utils','rpc','../../config/environment','jayson/promise','http','then','MailSubstatus,\x20%s,\x20%s','MailSubstatus,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','bluebird','ioredis'];(function(_0x347fdc,_0x4aaab6){var _0x140b9c=function(_0x39a28e){while(--_0x39a28e){_0x347fdc['push'](_0x347fdc['shift']());}};_0x140b9c(++_0x4aaab6);}(_0xe3cc,0x81));var _0xce3c=function(_0x165a56,_0x59c06d){_0x165a56=_0x165a56-0x0;var _0xcca30a=_0xe3cc[_0x165a56];return _0xcca30a;};'use strict';var _=require(_0xce3c('0x0'));var util=require(_0xce3c('0x1'));var moment=require('moment');var BPromise=require(_0xce3c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xce3c('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xce3c('0x4'));var logger=require('../../config/logger')(_0xce3c('0x5'));var config=require(_0xce3c('0x6'));var jayson=require(_0xce3c('0x7'));var client=jayson['client'][_0xce3c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x28cf98,_0x11c3c9,_0x2d9a1f){return new BPromise(function(_0x450915,_0xc7a751){return client['request'](_0x28cf98,_0x2d9a1f)[_0xce3c('0x9')](function(_0x33d144){logger['info'](_0xce3c('0xa'),_0x11c3c9,'request\x20sent');logger['debug'](_0xce3c('0xb'),_0x11c3c9,_0xce3c('0xc'),JSON[_0xce3c('0xd')](_0x33d144));if(_0x33d144[_0xce3c('0xe')]){if(_0x33d144[_0xce3c('0xe')][_0xce3c('0xf')]===0x1f4){logger[_0xce3c('0xe')](_0xce3c('0xa'),_0x11c3c9,_0x33d144[_0xce3c('0xe')][_0xce3c('0x10')]);return _0xc7a751(_0x33d144[_0xce3c('0xe')]['message']);}logger[_0xce3c('0xe')](_0xce3c('0xa'),_0x11c3c9,_0x33d144[_0xce3c('0xe')][_0xce3c('0x10')]);return _0x450915(_0x33d144[_0xce3c('0xe')][_0xce3c('0x10')]);}else{logger['info'](_0xce3c('0xa'),_0x11c3c9,_0xce3c('0xc'));_0x450915(_0x33d144[_0xce3c('0x11')][_0xce3c('0x10')]);}})[_0xce3c('0x12')](function(_0x55f7a2){logger[_0xce3c('0xe')](_0xce3c('0xa'),_0x11c3c9,_0x55f7a2);_0xc7a751(_0x55f7a2);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index 2e36519..76011b1 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 _0x519e=['show','post','create','put','update','delete','destroy','multer','util','path','express','fs-extra','get','isAuthenticated','index','describe','/:id'];(function(_0x503cd5,_0x57774a){var _0x1fdf1e=function(_0x5222cc){while(--_0x5222cc){_0x503cd5['push'](_0x503cd5['shift']());}};_0x1fdf1e(++_0x57774a);}(_0x519e,0x8f));var _0xe519=function(_0x361872,_0x2a66bc){_0x361872=_0x361872-0x0;var _0xbe8c7=_0x519e[_0x361872];return _0xbe8c7;};'use strict';var multer=require(_0xe519('0x0'));var util=require(_0xe519('0x1'));var path=require(_0xe519('0x2'));var timeout=require('connect-timeout');var express=require(_0xe519('0x3'));var router=express['Router']();var fs_extra=require(_0xe519('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./mailTransferReport.controller');router[_0xe519('0x5')]('/',auth[_0xe519('0x6')](),controller[_0xe519('0x7')]);router[_0xe519('0x5')]('/describe',auth[_0xe519('0x6')](),controller[_0xe519('0x8')]);router['get'](_0xe519('0x9'),auth['isAuthenticated'](),controller[_0xe519('0xa')]);router[_0xe519('0xb')]('/',auth['isAuthenticated'](),controller[_0xe519('0xc')]);router[_0xe519('0xd')](_0xe519('0x9'),auth[_0xe519('0x6')](),controller[_0xe519('0xe')]);router[_0xe519('0xf')](_0xe519('0x9'),auth[_0xe519('0x6')](),controller[_0xe519('0x10')]);module['exports']=router; \ No newline at end of file +var _0x10f1=['update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','get','isAuthenticated','index','describe','/:id','show','post','create','put'];(function(_0x44c79f,_0x21f727){var _0x4089ef=function(_0x5a237a){while(--_0x5a237a){_0x44c79f['push'](_0x44c79f['shift']());}};_0x4089ef(++_0x21f727);}(_0x10f1,0x1e7));var _0x110f=function(_0x18c8b5,_0x2a15d3){_0x18c8b5=_0x18c8b5-0x0;var _0x358984=_0x10f1[_0x18c8b5];return _0x358984;};'use strict';var multer=require(_0x110f('0x0'));var util=require('util');var path=require(_0x110f('0x1'));var timeout=require(_0x110f('0x2'));var express=require(_0x110f('0x3'));var router=express[_0x110f('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x110f('0x5'));var config=require(_0x110f('0x6'));var controller=require(_0x110f('0x7'));router[_0x110f('0x8')]('/',auth[_0x110f('0x9')](),controller[_0x110f('0xa')]);router[_0x110f('0x8')]('/describe',auth[_0x110f('0x9')](),controller[_0x110f('0xb')]);router[_0x110f('0x8')](_0x110f('0xc'),auth[_0x110f('0x9')](),controller[_0x110f('0xd')]);router[_0x110f('0xe')]('/',auth[_0x110f('0x9')](),controller[_0x110f('0xf')]);router[_0x110f('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x110f('0x11')]);router[_0x110f('0x12')](_0x110f('0xc'),auth[_0x110f('0x9')](),controller[_0x110f('0x13')]);module[_0x110f('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 61a2d7d..041378b 100644 --- a/server/api/mailTransferReport/mailTransferReport.attributes.js +++ b/server/api/mailTransferReport/mailTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['NOW','moment','sequelize','exports','account','agent','queue'];(function(_0x21c7ff,_0x1f3e83){var _0x4097f2=function(_0x550da2){while(--_0x550da2){_0x21c7ff['push'](_0x21c7ff['shift']());}};_0x4097f2(++_0x1f3e83);}(_0x70e0,0x17b));var _0x070e=function(_0x116ea2,_0x3bc38a){_0x116ea2=_0x116ea2-0x0;var _0x4cfd1f=_0x70e0[_0x116ea2];return _0x4cfd1f;};'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 _0x008c=['ENUM','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x1b11ea,_0xe164b){var _0x5e9a75=function(_0x24e0de){while(--_0x24e0de){_0x1b11ea['push'](_0x1b11ea['shift']());}};_0x5e9a75(++_0xe164b);}(_0x008c,0x188));var _0xc008=function(_0x4fb73e,_0x17f37d){_0x4fb73e=_0x4fb73e-0x0;var _0x14de68=_0x008c[_0x4fb73e];return _0x14de68;};'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/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index 46c6ad4..3f59bc2 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 _0x9a6f=['find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','sort','where','pick','filter','merge','VIRTUAL','options','include','MailTransferReport','findAll','rows','catch','params'];(function(_0x350a01,_0x5ed763){var _0xc17c6b=function(_0x31aaec){while(--_0x31aaec){_0x350a01['push'](_0x350a01['shift']());}};_0xc17c6b(++_0x5ed763);}(_0x9a6f,0x98));var _0xf9a6=function(_0x45c0da,_0x4f9492){_0x45c0da=_0x45c0da-0x0;var _0x51efff=_0x9a6f[_0x45c0da];return _0x51efff;};'use strict';var emlformat=require(_0xf9a6('0x0'));var rimraf=require(_0xf9a6('0x1'));var zipdir=require(_0xf9a6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf9a6('0x3'));var moment=require(_0xf9a6('0x4'));var BPromise=require(_0xf9a6('0x5'));var Mustache=require(_0xf9a6('0x6'));var util=require(_0xf9a6('0x7'));var path=require(_0xf9a6('0x8'));var sox=require('sox');var csv=require(_0xf9a6('0x9'));var ejs=require(_0xf9a6('0xa'));var fs=require('fs');var fs_extra=require(_0xf9a6('0xb'));var _=require(_0xf9a6('0xc'));var squel=require(_0xf9a6('0xd'));var crypto=require(_0xf9a6('0xe'));var jsforce=require(_0xf9a6('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xf9a6('0x10'));var Papa=require(_0xf9a6('0x11'));var Redis=require(_0xf9a6('0x12'));var authService=require(_0xf9a6('0x13'));var qs=require(_0xf9a6('0x14'));var as=require(_0xf9a6('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf9a6('0x16'))('api');var utils=require('../../config/utils');var config=require(_0xf9a6('0x17'));var licenseUtil=require(_0xf9a6('0x18'));var db=require(_0xf9a6('0x19'))['db'];function respondWithStatusCode(_0x209f0e,_0xe14977){_0xe14977=_0xe14977||0xcc;return function(_0x2c1234){if(_0x2c1234){return _0x209f0e[_0xf9a6('0x1a')](_0xe14977);}return _0x209f0e[_0xf9a6('0x1b')](_0xe14977)[_0xf9a6('0x1c')]();};}function respondWithResult(_0x2bcaa7,_0x5349b3){_0x5349b3=_0x5349b3||0xc8;return function(_0x96806e){if(_0x96806e){return _0x2bcaa7[_0xf9a6('0x1b')](_0x5349b3)[_0xf9a6('0x1d')](_0x96806e);}};}function respondWithFilteredResult(_0x592a57,_0x4cb3a4){return function(_0x4aab2b){if(_0x4aab2b){var _0x148f37=typeof _0x4cb3a4[_0xf9a6('0x1e')]==='undefined'&&typeof _0x4cb3a4[_0xf9a6('0x1f')]==='undefined';var _0x1f6042=_0x4aab2b[_0xf9a6('0x20')];var _0x137b28=_0x148f37?0x0:_0x4cb3a4['offset'];var _0x37e596=_0x148f37?_0x4aab2b[_0xf9a6('0x20')]:_0x4cb3a4['offset']+_0x4cb3a4[_0xf9a6('0x1f')];var _0x4d6abd;if(_0x37e596>=_0x1f6042){_0x37e596=_0x1f6042;_0x4d6abd=0xc8;}else{_0x4d6abd=0xce;}_0x592a57[_0xf9a6('0x1b')](_0x4d6abd);return _0x592a57[_0xf9a6('0x21')](_0xf9a6('0x22'),_0x137b28+'-'+_0x37e596+'/'+_0x1f6042)[_0xf9a6('0x1d')](_0x4aab2b);}return null;};}function patchUpdates(_0x7ccb0f){return function(_0x491d32){try{jsonpatch['apply'](_0x491d32,_0x7ccb0f,!![]);}catch(_0x17bc3e){return BPromise[_0xf9a6('0x23')](_0x17bc3e);}return _0x491d32[_0xf9a6('0x24')]();};}function saveUpdates(_0x427701,_0x511dc){return function(_0x4a8867){if(_0x4a8867){return _0x4a8867[_0xf9a6('0x25')](_0x427701)[_0xf9a6('0x26')](function(_0x16dadc){return _0x16dadc;});}return null;};}function removeEntity(_0xfb550e,_0x3a76c7){return function(_0x17dd20){if(_0x17dd20){return _0x17dd20[_0xf9a6('0x27')]()['then'](function(){_0xfb550e[_0xf9a6('0x1b')](0xcc)[_0xf9a6('0x1c')]();});}};}function handleEntityNotFound(_0x4de915,_0xf52fb3){return function(_0x2f3c25){if(!_0x2f3c25){_0x4de915[_0xf9a6('0x1a')](0x194);}return _0x2f3c25;};}function handleError(_0x843216,_0x1dfc2e){_0x1dfc2e=_0x1dfc2e||0x1f4;return function(_0x3177dc){logger[_0xf9a6('0x28')](_0x3177dc[_0xf9a6('0x29')]);if(_0x3177dc[_0xf9a6('0x2a')]){delete _0x3177dc[_0xf9a6('0x2a')];}_0x843216[_0xf9a6('0x1b')](_0x1dfc2e)[_0xf9a6('0x2b')](_0x3177dc);};}exports['index']=function(_0xf58aa8,_0x1d11d4){var _0x32df46={},_0x564225={},_0xcc87d8={'count':0x0,'rows':[]};var _0x3524ad=_[_0xf9a6('0x2c')](db['MailTransferReport'][_0xf9a6('0x2d')],function(_0x206189){return{'name':_0x206189[_0xf9a6('0x2e')],'type':_0x206189[_0xf9a6('0x2f')][_0xf9a6('0x30')]};});_0x564225[_0xf9a6('0x31')]=_[_0xf9a6('0x2c')](_0x3524ad,_0xf9a6('0x2a'));_0x564225[_0xf9a6('0x32')]=_[_0xf9a6('0x33')](_0xf58aa8[_0xf9a6('0x32')]);_0x564225[_0xf9a6('0x34')]=_[_0xf9a6('0x35')](_0x564225[_0xf9a6('0x31')],_0x564225[_0xf9a6('0x32')]);_0x32df46[_0xf9a6('0x36')]=_[_0xf9a6('0x35')](_0x564225[_0xf9a6('0x31')],qs[_0xf9a6('0x37')](_0xf58aa8['query'][_0xf9a6('0x37')]));_0x32df46[_0xf9a6('0x36')]=_0x32df46['attributes'][_0xf9a6('0x38')]?_0x32df46[_0xf9a6('0x36')]:_0x564225[_0xf9a6('0x31')];if(!_0xf58aa8['query']['hasOwnProperty']('nolimit')){_0x32df46[_0xf9a6('0x1f')]=qs['limit'](_0xf58aa8[_0xf9a6('0x32')][_0xf9a6('0x1f')]);_0x32df46[_0xf9a6('0x1e')]=qs[_0xf9a6('0x1e')](_0xf58aa8[_0xf9a6('0x32')][_0xf9a6('0x1e')]);}_0x32df46['order']=qs[_0xf9a6('0x39')](_0xf58aa8['query'][_0xf9a6('0x39')]);_0x32df46[_0xf9a6('0x3a')]=qs[_0xf9a6('0x34')](_[_0xf9a6('0x3b')](_0xf58aa8[_0xf9a6('0x32')],_0x564225[_0xf9a6('0x34')]),_0x3524ad);if(_0xf58aa8[_0xf9a6('0x32')][_0xf9a6('0x3c')]){_0x32df46['where']=_[_0xf9a6('0x3d')](_0x32df46[_0xf9a6('0x3a')],{'$or':_[_0xf9a6('0x2c')](_0x3524ad,function(_0x26374e){if(_0x26374e[_0xf9a6('0x2f')]!==_0xf9a6('0x3e')){var _0x23fd48={};_0x23fd48[_0x26374e[_0xf9a6('0x2a')]]={'$like':'%'+_0xf58aa8[_0xf9a6('0x32')][_0xf9a6('0x3c')]+'%'};return _0x23fd48;}})});}_0x32df46=_[_0xf9a6('0x3d')]({},_0x32df46,_0xf58aa8[_0xf9a6('0x3f')]);var _0x107464={'where':_0x32df46['where']};return db['MailTransferReport']['count'](_0x107464)[_0xf9a6('0x26')](function(_0x5ee5b2){_0xcc87d8[_0xf9a6('0x20')]=_0x5ee5b2;if(_0xf58aa8[_0xf9a6('0x32')]['includeAll']){_0x32df46[_0xf9a6('0x40')]=[{'all':!![]}];}return db[_0xf9a6('0x41')][_0xf9a6('0x42')](_0x32df46);})[_0xf9a6('0x26')](function(_0x56d3b3){_0xcc87d8[_0xf9a6('0x43')]=_0x56d3b3;return _0xcc87d8;})['then'](respondWithFilteredResult(_0x1d11d4,_0x32df46))[_0xf9a6('0x44')](handleError(_0x1d11d4,null));};exports['show']=function(_0x417e76,_0x149c99){var _0xae1dc4={'raw':!![],'where':{'id':_0x417e76[_0xf9a6('0x45')]['id']}},_0x231800={};_0x231800[_0xf9a6('0x31')]=_[_0xf9a6('0x33')](db[_0xf9a6('0x41')][_0xf9a6('0x2d')]);_0x231800['query']=_[_0xf9a6('0x33')](_0x417e76[_0xf9a6('0x32')]);_0x231800[_0xf9a6('0x34')]=_[_0xf9a6('0x35')](_0x231800[_0xf9a6('0x31')],_0x231800['query']);_0xae1dc4['attributes']=_[_0xf9a6('0x35')](_0x231800['model'],qs[_0xf9a6('0x37')](_0x417e76['query']['fields']));_0xae1dc4['attributes']=_0xae1dc4[_0xf9a6('0x36')]['length']?_0xae1dc4['attributes']:_0x231800[_0xf9a6('0x31')];if(_0x417e76[_0xf9a6('0x32')]['includeAll']){_0xae1dc4[_0xf9a6('0x40')]=[{'all':!![]}];}_0xae1dc4=_['merge']({},_0xae1dc4,_0x417e76[_0xf9a6('0x3f')]);return db[_0xf9a6('0x41')][_0xf9a6('0x46')](_0xae1dc4)['then'](handleEntityNotFound(_0x149c99,null))[_0xf9a6('0x26')](respondWithResult(_0x149c99,null))[_0xf9a6('0x44')](handleError(_0x149c99,null));};exports[_0xf9a6('0x47')]=function(_0x237e27,_0xf0ea84){return db[_0xf9a6('0x41')][_0xf9a6('0x47')](_0x237e27[_0xf9a6('0x48')],{})[_0xf9a6('0x26')](respondWithResult(_0xf0ea84,0xc9))[_0xf9a6('0x44')](handleError(_0xf0ea84,null));};exports['update']=function(_0x50f0cf,_0x2eb520){if(_0x50f0cf[_0xf9a6('0x48')]['id']){delete _0x50f0cf[_0xf9a6('0x48')]['id'];}return db[_0xf9a6('0x41')][_0xf9a6('0x46')]({'where':{'id':_0x50f0cf[_0xf9a6('0x45')]['id']}})['then'](handleEntityNotFound(_0x2eb520,null))['then'](saveUpdates(_0x50f0cf[_0xf9a6('0x48')],null))['then'](respondWithResult(_0x2eb520,null))['catch'](handleError(_0x2eb520,null));};exports['destroy']=function(_0x27035e,_0xebc31b){return db[_0xf9a6('0x41')][_0xf9a6('0x46')]({'where':{'id':_0x27035e['params']['id']}})[_0xf9a6('0x26')](handleEntityNotFound(_0xebc31b,null))[_0xf9a6('0x26')](removeEntity(_0xebc31b,null))['catch'](handleError(_0xebc31b,null));};exports[_0xf9a6('0x49')]=function(_0x1d414f,_0x502c12){return db[_0xf9a6('0x41')][_0xf9a6('0x49')]()[_0xf9a6('0x26')](respondWithResult(_0x502c12,null))[_0xf9a6('0x44')](handleError(_0x502c12,null));}; \ No newline at end of file +var _0xce54=['keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','filter','map','VIRTUAL','merge','options','findAll','then','rows','params','includeAll','find','create','body','update','catch','describe','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','stack','name','MailTransferReport','rawAttributes','fieldName','type','key','model','query'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xce54,0x1d6));var _0x4ce5=function(_0x531bf2,_0x9b3263){_0x531bf2=_0x531bf2-0x0;var _0x23e539=_0xce54[_0x531bf2];return _0x23e539;};'use strict';var emlformat=require(_0x4ce5('0x0'));var rimraf=require(_0x4ce5('0x1'));var zipdir=require(_0x4ce5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x4ce5('0x3'));var BPromise=require(_0x4ce5('0x4'));var Mustache=require(_0x4ce5('0x5'));var util=require(_0x4ce5('0x6'));var path=require('path');var sox=require(_0x4ce5('0x7'));var csv=require(_0x4ce5('0x8'));var ejs=require(_0x4ce5('0x9'));var fs=require('fs');var fs_extra=require(_0x4ce5('0xa'));var _=require(_0x4ce5('0xb'));var squel=require(_0x4ce5('0xc'));var crypto=require(_0x4ce5('0xd'));var jsforce=require(_0x4ce5('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4ce5('0xf'));var Papa=require(_0x4ce5('0x10'));var Redis=require(_0x4ce5('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x4ce5('0x12'));var as=require(_0x4ce5('0x13'));var hardwareService=require(_0x4ce5('0x14'));var logger=require('../../config/logger')(_0x4ce5('0x15'));var utils=require(_0x4ce5('0x16'));var config=require(_0x4ce5('0x17'));var licenseUtil=require(_0x4ce5('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x500dd1,_0xb9b76c){_0xb9b76c=_0xb9b76c||0xcc;return function(_0x2dc5c7){if(_0x2dc5c7){return _0x500dd1[_0x4ce5('0x19')](_0xb9b76c);}return _0x500dd1[_0x4ce5('0x1a')](_0xb9b76c)[_0x4ce5('0x1b')]();};}function respondWithResult(_0x15002f,_0x4b3877){_0x4b3877=_0x4b3877||0xc8;return function(_0x4f7b4e){if(_0x4f7b4e){return _0x15002f[_0x4ce5('0x1a')](_0x4b3877)[_0x4ce5('0x1c')](_0x4f7b4e);}};}function respondWithFilteredResult(_0x54afce,_0x1478a3){return function(_0x39616f){if(_0x39616f){var _0x5ecad3=typeof _0x1478a3[_0x4ce5('0x1d')]===_0x4ce5('0x1e')&&typeof _0x1478a3[_0x4ce5('0x1f')]===_0x4ce5('0x1e');var _0x22c04a=_0x39616f[_0x4ce5('0x20')];var _0x371686=_0x5ecad3?0x0:_0x1478a3[_0x4ce5('0x1d')];var _0x551e0=_0x5ecad3?_0x39616f[_0x4ce5('0x20')]:_0x1478a3[_0x4ce5('0x1d')]+_0x1478a3[_0x4ce5('0x1f')];var _0x19169e;if(_0x551e0>=_0x22c04a){_0x551e0=_0x22c04a;_0x19169e=0xc8;}else{_0x19169e=0xce;}_0x54afce['status'](_0x19169e);return _0x54afce[_0x4ce5('0x21')](_0x4ce5('0x22'),_0x371686+'-'+_0x551e0+'/'+_0x22c04a)[_0x4ce5('0x1c')](_0x39616f);}return null;};}function patchUpdates(_0x2704fb){return function(_0x212096){try{jsonpatch[_0x4ce5('0x23')](_0x212096,_0x2704fb,!![]);}catch(_0x19bd31){return BPromise[_0x4ce5('0x24')](_0x19bd31);}return _0x212096[_0x4ce5('0x25')]();};}function saveUpdates(_0x10be2c,_0x56d1d9){return function(_0x4837ac){if(_0x4837ac){return _0x4837ac['update'](_0x10be2c)['then'](function(_0x5f57eb){return _0x5f57eb;});}return null;};}function removeEntity(_0x278bf1,_0x4ba2a8){return function(_0x5213db){if(_0x5213db){return _0x5213db[_0x4ce5('0x26')]()['then'](function(){_0x278bf1[_0x4ce5('0x1a')](0xcc)[_0x4ce5('0x1b')]();});}};}function handleEntityNotFound(_0x497b90,_0x4cdac3){return function(_0xc5af96){if(!_0xc5af96){_0x497b90[_0x4ce5('0x19')](0x194);}return _0xc5af96;};}function handleError(_0x2442ba,_0x53e9e9){_0x53e9e9=_0x53e9e9||0x1f4;return function(_0x30f35b){logger['error'](_0x30f35b[_0x4ce5('0x27')]);if(_0x30f35b[_0x4ce5('0x28')]){delete _0x30f35b['name'];}_0x2442ba[_0x4ce5('0x1a')](_0x53e9e9)['send'](_0x30f35b);};}exports['index']=function(_0x53d1f0,_0x5b1fa5){var _0x2cd8ea={},_0xd6ea9a={},_0x5d1f33={'count':0x0,'rows':[]};var _0x554f98=_['map'](db[_0x4ce5('0x29')][_0x4ce5('0x2a')],function(_0x290c96){return{'name':_0x290c96[_0x4ce5('0x2b')],'type':_0x290c96[_0x4ce5('0x2c')][_0x4ce5('0x2d')]};});_0xd6ea9a[_0x4ce5('0x2e')]=_['map'](_0x554f98,'name');_0xd6ea9a[_0x4ce5('0x2f')]=_[_0x4ce5('0x30')](_0x53d1f0[_0x4ce5('0x2f')]);_0xd6ea9a['filters']=_[_0x4ce5('0x31')](_0xd6ea9a[_0x4ce5('0x2e')],_0xd6ea9a[_0x4ce5('0x2f')]);_0x2cd8ea[_0x4ce5('0x32')]=_['intersection'](_0xd6ea9a[_0x4ce5('0x2e')],qs[_0x4ce5('0x33')](_0x53d1f0[_0x4ce5('0x2f')][_0x4ce5('0x33')]));_0x2cd8ea[_0x4ce5('0x32')]=_0x2cd8ea[_0x4ce5('0x32')][_0x4ce5('0x34')]?_0x2cd8ea[_0x4ce5('0x32')]:_0xd6ea9a['model'];if(!_0x53d1f0[_0x4ce5('0x2f')][_0x4ce5('0x35')]('nolimit')){_0x2cd8ea[_0x4ce5('0x1f')]=qs['limit'](_0x53d1f0[_0x4ce5('0x2f')][_0x4ce5('0x1f')]);_0x2cd8ea[_0x4ce5('0x1d')]=qs[_0x4ce5('0x1d')](_0x53d1f0[_0x4ce5('0x2f')][_0x4ce5('0x1d')]);}_0x2cd8ea[_0x4ce5('0x36')]=qs[_0x4ce5('0x37')](_0x53d1f0['query'][_0x4ce5('0x37')]);_0x2cd8ea[_0x4ce5('0x38')]=qs[_0x4ce5('0x39')](_['pick'](_0x53d1f0['query'],_0xd6ea9a['filters']),_0x554f98);if(_0x53d1f0[_0x4ce5('0x2f')][_0x4ce5('0x3a')]){_0x2cd8ea[_0x4ce5('0x38')]=_['merge'](_0x2cd8ea[_0x4ce5('0x38')],{'$or':_[_0x4ce5('0x3b')](_0x554f98,function(_0x1d83ad){if(_0x1d83ad['type']!==_0x4ce5('0x3c')){var _0x1db72b={};_0x1db72b[_0x1d83ad[_0x4ce5('0x28')]]={'$like':'%'+_0x53d1f0[_0x4ce5('0x2f')][_0x4ce5('0x3a')]+'%'};return _0x1db72b;}})});}_0x2cd8ea=_[_0x4ce5('0x3d')]({},_0x2cd8ea,_0x53d1f0[_0x4ce5('0x3e')]);var _0x3c6de5={'where':_0x2cd8ea[_0x4ce5('0x38')]};return db['MailTransferReport'][_0x4ce5('0x20')](_0x3c6de5)['then'](function(_0x53f979){_0x5d1f33[_0x4ce5('0x20')]=_0x53f979;if(_0x53d1f0[_0x4ce5('0x2f')]['includeAll']){_0x2cd8ea['include']=[{'all':!![]}];}return db[_0x4ce5('0x29')][_0x4ce5('0x3f')](_0x2cd8ea);})[_0x4ce5('0x40')](function(_0x142c49){_0x5d1f33[_0x4ce5('0x41')]=_0x142c49;return _0x5d1f33;})[_0x4ce5('0x40')](respondWithFilteredResult(_0x5b1fa5,_0x2cd8ea))['catch'](handleError(_0x5b1fa5,null));};exports['show']=function(_0x101baa,_0x624be4){var _0x343aca={'raw':!![],'where':{'id':_0x101baa[_0x4ce5('0x42')]['id']}},_0x3cf300={};_0x3cf300['model']=_[_0x4ce5('0x30')](db['MailTransferReport'][_0x4ce5('0x2a')]);_0x3cf300[_0x4ce5('0x2f')]=_[_0x4ce5('0x30')](_0x101baa['query']);_0x3cf300[_0x4ce5('0x39')]=_[_0x4ce5('0x31')](_0x3cf300['model'],_0x3cf300['query']);_0x343aca['attributes']=_[_0x4ce5('0x31')](_0x3cf300[_0x4ce5('0x2e')],qs[_0x4ce5('0x33')](_0x101baa[_0x4ce5('0x2f')][_0x4ce5('0x33')]));_0x343aca['attributes']=_0x343aca['attributes'][_0x4ce5('0x34')]?_0x343aca[_0x4ce5('0x32')]:_0x3cf300[_0x4ce5('0x2e')];if(_0x101baa[_0x4ce5('0x2f')][_0x4ce5('0x43')]){_0x343aca['include']=[{'all':!![]}];}_0x343aca=_['merge']({},_0x343aca,_0x101baa['options']);return db['MailTransferReport'][_0x4ce5('0x44')](_0x343aca)[_0x4ce5('0x40')](handleEntityNotFound(_0x624be4,null))['then'](respondWithResult(_0x624be4,null))['catch'](handleError(_0x624be4,null));};exports[_0x4ce5('0x45')]=function(_0x4cba54,_0x1d668b){return db[_0x4ce5('0x29')][_0x4ce5('0x45')](_0x4cba54[_0x4ce5('0x46')],{})[_0x4ce5('0x40')](respondWithResult(_0x1d668b,0xc9))['catch'](handleError(_0x1d668b,null));};exports[_0x4ce5('0x47')]=function(_0x565852,_0x4e8174){if(_0x565852[_0x4ce5('0x46')]['id']){delete _0x565852[_0x4ce5('0x46')]['id'];}return db[_0x4ce5('0x29')]['find']({'where':{'id':_0x565852[_0x4ce5('0x42')]['id']}})[_0x4ce5('0x40')](handleEntityNotFound(_0x4e8174,null))[_0x4ce5('0x40')](saveUpdates(_0x565852['body'],null))[_0x4ce5('0x40')](respondWithResult(_0x4e8174,null))[_0x4ce5('0x48')](handleError(_0x4e8174,null));};exports[_0x4ce5('0x26')]=function(_0x3f9e52,_0x4f43da){return db[_0x4ce5('0x29')][_0x4ce5('0x44')]({'where':{'id':_0x3f9e52[_0x4ce5('0x42')]['id']}})[_0x4ce5('0x40')](handleEntityNotFound(_0x4f43da,null))[_0x4ce5('0x40')](removeEntity(_0x4f43da,null))[_0x4ce5('0x48')](handleError(_0x4f43da,null));};exports['describe']=function(_0x4b7549,_0x4a8024){return db[_0x4ce5('0x29')][_0x4ce5('0x49')]()[_0x4ce5('0x40')](respondWithResult(_0x4a8024,null))[_0x4ce5('0x48')](handleError(_0x4a8024,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index 64fb185..b6780d0 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 _0x9bee=['request-promise','path','rimraf','../../config/environment','./mailTransferReport.attributes','exports','define','MailTransferReport','report_mail_transfer','uniqueid','../../config/logger','api','bluebird'];(function(_0x5be929,_0x2d51fb){var _0x4a96ab=function(_0x331a58){while(--_0x331a58){_0x5be929['push'](_0x5be929['shift']());}};_0x4a96ab(++_0x2d51fb);}(_0x9bee,0xf4));var _0xe9be=function(_0x570930,_0x4d79a4){_0x570930=_0x570930-0x0;var _0xdd3486=_0x9bee[_0x570930];return _0xdd3486;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe9be('0x0'))(_0xe9be('0x1'));var moment=require('moment');var BPromise=require(_0xe9be('0x2'));var rp=require(_0xe9be('0x3'));var fs=require('fs');var path=require(_0xe9be('0x4'));var rimraf=require(_0xe9be('0x5'));var config=require(_0xe9be('0x6'));var attributes=require(_0xe9be('0x7'));module[_0xe9be('0x8')]=function(_0x1d5c7a,_0x5bbaad){return _0x1d5c7a[_0xe9be('0x9')](_0xe9be('0xa'),attributes,{'tableName':_0xe9be('0xb'),'paranoid':![],'indexes':[{'name':_0xe9be('0xc'),'fields':[_0xe9be('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2159=['../../config/environment','./mailTransferReport.attributes','exports','define','report_mail_transfer','uniqueid','lodash','util','../../config/logger','api','bluebird','path','rimraf'];(function(_0x290b9e,_0x5d1f8c){var _0x413447=function(_0x364787){while(--_0x364787){_0x290b9e['push'](_0x290b9e['shift']());}};_0x413447(++_0x5d1f8c);}(_0x2159,0x17f));var _0x9215=function(_0x1ca1ad,_0x54f5b3){_0x1ca1ad=_0x1ca1ad-0x0;var _0x28e597=_0x2159[_0x1ca1ad];return _0x28e597;};'use strict';var _=require(_0x9215('0x0'));var util=require(_0x9215('0x1'));var logger=require(_0x9215('0x2'))(_0x9215('0x3'));var moment=require('moment');var BPromise=require(_0x9215('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9215('0x5'));var rimraf=require(_0x9215('0x6'));var config=require(_0x9215('0x7'));var attributes=require(_0x9215('0x8'));module[_0x9215('0x9')]=function(_0x1fd854,_0x3be70d){return _0x1fd854[_0x9215('0xa')]('MailTransferReport',attributes,{'tableName':_0x9215('0xb'),'paranoid':![],'indexes':[{'name':_0x9215('0xc'),'fields':[_0x9215('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index bf68125..e3fb3b9 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 _0x971e=['error','code','message','result','catch','lodash','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','MailTransferReport,\x20%s,\x20%s','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x141d5a,_0x255dca){var _0x297835=function(_0x431f49){while(--_0x431f49){_0x141d5a['push'](_0x141d5a['shift']());}};_0x297835(++_0x255dca);}(_0x971e,0x165));var _0xe971=function(_0x1dcec9,_0x4b965a){_0x1dcec9=_0x1dcec9-0x0;var _0x59e0b7=_0x971e[_0x1dcec9];return _0x59e0b7;};'use strict';var _=require(_0xe971('0x0'));var util=require('util');var moment=require(_0xe971('0x1'));var BPromise=require(_0xe971('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe971('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xe971('0x4'))(_0xe971('0x5'));var config=require(_0xe971('0x6'));var jayson=require(_0xe971('0x7'));var client=jayson[_0xe971('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5d4a7b,_0x25cf48,_0x403e5c){return new BPromise(function(_0x2c99d5,_0x56c2f0){return client[_0xe971('0x9')](_0x5d4a7b,_0x403e5c)[_0xe971('0xa')](function(_0x705f31){logger[_0xe971('0xb')](_0xe971('0xc'),_0x25cf48,'request\x20sent');logger[_0xe971('0xd')](_0xe971('0xe'),_0x25cf48,_0xe971('0xf'),JSON[_0xe971('0x10')](_0x705f31));if(_0x705f31[_0xe971('0x11')]){if(_0x705f31['error'][_0xe971('0x12')]===0x1f4){logger['error'](_0xe971('0xc'),_0x25cf48,_0x705f31['error'][_0xe971('0x13')]);return _0x56c2f0(_0x705f31[_0xe971('0x11')]['message']);}logger[_0xe971('0x11')](_0xe971('0xc'),_0x25cf48,_0x705f31[_0xe971('0x11')][_0xe971('0x13')]);return _0x2c99d5(_0x705f31['error']['message']);}else{logger[_0xe971('0xb')](_0xe971('0xc'),_0x25cf48,_0xe971('0xf'));_0x2c99d5(_0x705f31[_0xe971('0x14')][_0xe971('0x13')]);}})[_0xe971('0x15')](function(_0x6fc20e){logger[_0xe971('0x11')]('MailTransferReport,\x20%s,\x20%s',_0x25cf48,_0x6fc20e);_0x56c2f0(_0x6fc20e);});});} \ No newline at end of file +var _0xdb47=['jayson/promise','then','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment'];(function(_0x24b7e5,_0x73a80f){var _0x21b7b6=function(_0x57705d){while(--_0x57705d){_0x24b7e5['push'](_0x24b7e5['shift']());}};_0x21b7b6(++_0x73a80f);}(_0xdb47,0xbe));var _0x7db4=function(_0x2c7b5c,_0x331adf){_0x2c7b5c=_0x2c7b5c-0x0;var _0x1df5f3=_0xdb47[_0x2c7b5c];return _0x1df5f3;};'use strict';var _=require(_0x7db4('0x0'));var util=require('util');var moment=require(_0x7db4('0x1'));var BPromise=require(_0x7db4('0x2'));var rs=require(_0x7db4('0x3'));var fs=require('fs');var Redis=require(_0x7db4('0x4'));var db=require(_0x7db4('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7db4('0x6'));var config=require(_0x7db4('0x7'));var jayson=require(_0x7db4('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x35c64f,_0x12e0be,_0x2b6c84){return new BPromise(function(_0x5049ad,_0x570f72){return client['request'](_0x35c64f,_0x2b6c84)[_0x7db4('0x9')](function(_0x1477b2){logger['info'](_0x7db4('0xa'),_0x12e0be,_0x7db4('0xb'));logger[_0x7db4('0xc')]('MailTransferReport,\x20%s,\x20%s,\x20%s',_0x12e0be,_0x7db4('0xb'),JSON[_0x7db4('0xd')](_0x1477b2));if(_0x1477b2['error']){if(_0x1477b2['error'][_0x7db4('0xe')]===0x1f4){logger[_0x7db4('0xf')]('MailTransferReport,\x20%s,\x20%s',_0x12e0be,_0x1477b2[_0x7db4('0xf')][_0x7db4('0x10')]);return _0x570f72(_0x1477b2['error'][_0x7db4('0x10')]);}logger['error'](_0x7db4('0xa'),_0x12e0be,_0x1477b2['error'][_0x7db4('0x10')]);return _0x5049ad(_0x1477b2[_0x7db4('0xf')][_0x7db4('0x10')]);}else{logger['info'](_0x7db4('0xa'),_0x12e0be,'request\x20sent');_0x5049ad(_0x1477b2[_0x7db4('0x11')][_0x7db4('0x10')]);}})['catch'](function(_0x2b17ca){logger['error']('MailTransferReport,\x20%s,\x20%s',_0x12e0be,_0x2b17ca);_0x570f72(_0x2b17ca);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index cf7d449..3bce6fa 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 _0x8e18=['get','isAuthenticated','index','/describe','describe','post','create','/:id','update','delete','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./memberReport.controller'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8e18,0x124));var _0x88e1=function(_0x2ca586,_0x495404){_0x2ca586=_0x2ca586-0x0;var _0x4aa84b=_0x8e18[_0x2ca586];return _0x4aa84b;};'use strict';var multer=require('multer');var util=require(_0x88e1('0x0'));var path=require(_0x88e1('0x1'));var timeout=require('connect-timeout');var express=require(_0x88e1('0x2'));var router=express[_0x88e1('0x3')]();var fs_extra=require(_0x88e1('0x4'));var auth=require(_0x88e1('0x5'));var interaction=require(_0x88e1('0x6'));var config=require('../../config/environment');var controller=require(_0x88e1('0x7'));router[_0x88e1('0x8')]('/',auth[_0x88e1('0x9')](),controller[_0x88e1('0xa')]);router[_0x88e1('0x8')](_0x88e1('0xb'),auth[_0x88e1('0x9')](),controller[_0x88e1('0xc')]);router[_0x88e1('0x8')]('/:id',auth[_0x88e1('0x9')](),controller['show']);router[_0x88e1('0xd')]('/',auth[_0x88e1('0x9')](),controller[_0x88e1('0xe')]);router['put'](_0x88e1('0xf'),auth['isAuthenticated'](),controller[_0x88e1('0x10')]);router[_0x88e1('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x88e1('0x12')]);module[_0x88e1('0x13')]=router; \ No newline at end of file +var _0x5842=['express','Router','fs-extra','get','/describe','isAuthenticated','describe','/:id','show','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x224523,_0x4a351a){var _0x4a1a35=function(_0x342cd1){while(--_0x342cd1){_0x224523['push'](_0x224523['shift']());}};_0x4a1a35(++_0x4a351a);}(_0x5842,0x106));var _0x2584=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x5842[_0x8c43de];return _0xa6591b;};'use strict';var multer=require(_0x2584('0x0'));var util=require(_0x2584('0x1'));var path=require(_0x2584('0x2'));var timeout=require(_0x2584('0x3'));var express=require(_0x2584('0x4'));var router=express[_0x2584('0x5')]();var fs_extra=require(_0x2584('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./memberReport.controller');router[_0x2584('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x2584('0x7')](_0x2584('0x8'),auth[_0x2584('0x9')](),controller[_0x2584('0xa')]);router['get'](_0x2584('0xb'),auth[_0x2584('0x9')](),controller[_0x2584('0xc')]);router[_0x2584('0xd')]('/',auth[_0x2584('0x9')](),controller['create']);router[_0x2584('0xe')](_0x2584('0xb'),auth['isAuthenticated'](),controller[_0x2584('0xf')]);router[_0x2584('0x10')](_0x2584('0xb'),auth['isAuthenticated'](),controller[_0x2584('0x11')]);module[_0x2584('0x12')]=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index 31bec50..20a9b60 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 _0x1db3=['diff','seconds','exitAt','setDataValue','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[dial\x20string]','talk:[queue]','moment','exports','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','getDataValue','enterAt'];(function(_0x12d3eb,_0x1fb7fd){var _0x4e50ff=function(_0x32a105){while(--_0x32a105){_0x12d3eb['push'](_0x12d3eb['shift']());}};_0x4e50ff(++_0x1fb7fd);}(_0x1db3,0x1e5));var _0x31db=function(_0x8e55b8,_0x491244){_0x8e55b8=_0x8e55b8-0x0;var _0x4e0ad7=_0x1db3[_0x8e55b8];return _0x4e0ad7;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x31db('0x0'));module[_0x31db('0x1')]={'channel':{'type':Sequelize[_0x31db('0x2')]},'membername':{'type':Sequelize[_0x31db('0x2')]},'interface':{'type':Sequelize[_0x31db('0x2')]},'type':{'type':Sequelize[_0x31db('0x2')],'defaultValue':_0x31db('0x3'),'comment':_0x31db('0x4')},'duration':{'type':Sequelize[_0x31db('0x5')]},'enterAt':{'type':Sequelize[_0x31db('0x6')]},'exitAt':{'type':Sequelize[_0x31db('0x6')],'set':function(_0x3f252a){var _0x2b4eb6=moment(_0x3f252a);var _0x156381=moment(this[_0x31db('0x7')](_0x31db('0x8')));var _0x3a431e=_0x2b4eb6[_0x31db('0x9')](_0x156381,_0x31db('0xa'));this['setDataValue'](_0x31db('0xb'),_0x3f252a);this[_0x31db('0xc')](_0x31db('0xd'),_0x3a431e||null);}},'data1':{'type':Sequelize[_0x31db('0x2')],'comment':_0x31db('0xe')},'data2':{'type':Sequelize['STRING'],'comment':_0x31db('0xf')},'data3':{'type':Sequelize[_0x31db('0x2')],'comment':_0x31db('0x10')},'data4':{'type':Sequelize['STRING'],'comment':_0x31db('0x11')},'data5':{'type':Sequelize[_0x31db('0x2')],'comment':_0x31db('0x12')},'role':{'type':Sequelize[_0x31db('0x2')]},'internal':{'type':Sequelize[_0x31db('0x5')]},'uniqueid':{'type':Sequelize[_0x31db('0x2')]}}; \ No newline at end of file +var _0x4bc3=['STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','diff','seconds','setDataValue','exitAt','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[dial\x20string]','talk:[queue]','sequelize','moment'];(function(_0xfc21f5,_0x38955f){var _0x11462c=function(_0x336bf4){while(--_0x336bf4){_0xfc21f5['push'](_0xfc21f5['shift']());}};_0x11462c(++_0x38955f);}(_0x4bc3,0x16e));var _0x34bc=function(_0x21549c,_0x6d64d1){_0x21549c=_0x21549c-0x0;var _0x426cbd=_0x4bc3[_0x21549c];return _0x426cbd;};'use strict';var Sequelize=require(_0x34bc('0x0'));var moment=require(_0x34bc('0x1'));module['exports']={'channel':{'type':Sequelize[_0x34bc('0x2')]},'membername':{'type':Sequelize[_0x34bc('0x2')]},'interface':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x34bc('0x2')],'defaultValue':_0x34bc('0x3'),'comment':_0x34bc('0x4')},'duration':{'type':Sequelize[_0x34bc('0x5')]},'enterAt':{'type':Sequelize[_0x34bc('0x6')]},'exitAt':{'type':Sequelize[_0x34bc('0x6')],'set':function(_0x2cc9c2){var _0x4c63a1=moment(_0x2cc9c2);var _0x21451b=moment(this['getDataValue']('enterAt'));var _0x18a01c=_0x4c63a1[_0x34bc('0x7')](_0x21451b,_0x34bc('0x8'));this[_0x34bc('0x9')](_0x34bc('0xa'),_0x2cc9c2);this[_0x34bc('0x9')]('duration',_0x18a01c||null);}},'data1':{'type':Sequelize['STRING'],'comment':_0x34bc('0xb')},'data2':{'type':Sequelize[_0x34bc('0x2')],'comment':_0x34bc('0xc')},'data3':{'type':Sequelize['STRING'],'comment':_0x34bc('0xd')},'data4':{'type':Sequelize['STRING'],'comment':_0x34bc('0xe')},'data5':{'type':Sequelize[_0x34bc('0x2')],'comment':_0x34bc('0xf')},'role':{'type':Sequelize['STRING']},'internal':{'type':Sequelize[_0x34bc('0x5')]},'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 22e4a0a..1339273 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 _0x55ca=['merge','filter','includeAll','include','findAll','rawAttributes','options','create','body','find','params','catch','destroy','describe','eml-format','rimraf','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','reject','update','then','end','sendStatus','error','stack','name','send','index','map','MemberReport','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x55ca,0x126));var _0xa55c=function(_0x81f000,_0x15df85){_0x81f000=_0x81f000-0x0;var _0x337aa2=_0x55ca[_0x81f000];return _0x337aa2;};'use strict';var emlformat=require(_0xa55c('0x0'));var rimraf=require(_0xa55c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa55c('0x2'));var BPromise=require(_0xa55c('0x3'));var Mustache=require('mustache');var util=require(_0xa55c('0x4'));var path=require(_0xa55c('0x5'));var sox=require(_0xa55c('0x6'));var csv=require(_0xa55c('0x7'));var ejs=require(_0xa55c('0x8'));var fs=require('fs');var fs_extra=require(_0xa55c('0x9'));var _=require(_0xa55c('0xa'));var squel=require('squel');var crypto=require(_0xa55c('0xb'));var jsforce=require(_0xa55c('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa55c('0x7'));var querystring=require(_0xa55c('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa55c('0xe'));var qs=require(_0xa55c('0xf'));var as=require(_0xa55c('0x10'));var hardwareService=require(_0xa55c('0x11'));var logger=require(_0xa55c('0x12'))(_0xa55c('0x13'));var utils=require(_0xa55c('0x14'));var config=require(_0xa55c('0x15'));var licenseUtil=require(_0xa55c('0x16'));var db=require(_0xa55c('0x17'))['db'];function respondWithStatusCode(_0x5d47ff,_0x59d84a){_0x59d84a=_0x59d84a||0xcc;return function(_0x2a35be){if(_0x2a35be){return _0x5d47ff['sendStatus'](_0x59d84a);}return _0x5d47ff['status'](_0x59d84a)['end']();};}function respondWithResult(_0x18ee85,_0x3930e4){_0x3930e4=_0x3930e4||0xc8;return function(_0x462cd6){if(_0x462cd6){return _0x18ee85[_0xa55c('0x18')](_0x3930e4)[_0xa55c('0x19')](_0x462cd6);}};}function respondWithFilteredResult(_0x247e77,_0x4e0b2f){return function(_0x3ccf65){if(_0x3ccf65){var _0x3dcf4f=typeof _0x4e0b2f[_0xa55c('0x1a')]===_0xa55c('0x1b')&&typeof _0x4e0b2f[_0xa55c('0x1c')]===_0xa55c('0x1b');var _0x51590e=_0x3ccf65[_0xa55c('0x1d')];var _0x24783b=_0x3dcf4f?0x0:_0x4e0b2f['offset'];var _0x3d4c9e=_0x3dcf4f?_0x3ccf65[_0xa55c('0x1d')]:_0x4e0b2f[_0xa55c('0x1a')]+_0x4e0b2f[_0xa55c('0x1c')];var _0x23a1ae;if(_0x3d4c9e>=_0x51590e){_0x3d4c9e=_0x51590e;_0x23a1ae=0xc8;}else{_0x23a1ae=0xce;}_0x247e77[_0xa55c('0x18')](_0x23a1ae);return _0x247e77['set']('Content-Range',_0x24783b+'-'+_0x3d4c9e+'/'+_0x51590e)[_0xa55c('0x19')](_0x3ccf65);}return null;};}function patchUpdates(_0x3776ac){return function(_0xade4c4){try{jsonpatch['apply'](_0xade4c4,_0x3776ac,!![]);}catch(_0x383d92){return BPromise[_0xa55c('0x1e')](_0x383d92);}return _0xade4c4['save']();};}function saveUpdates(_0x187a87,_0x133096){return function(_0x940f28){if(_0x940f28){return _0x940f28[_0xa55c('0x1f')](_0x187a87)[_0xa55c('0x20')](function(_0x49ed04){return _0x49ed04;});}return null;};}function removeEntity(_0x1fc828,_0x504c24){return function(_0x5ba836){if(_0x5ba836){return _0x5ba836['destroy']()[_0xa55c('0x20')](function(){_0x1fc828['status'](0xcc)[_0xa55c('0x21')]();});}};}function handleEntityNotFound(_0x190757,_0x3f64de){return function(_0xf0e574){if(!_0xf0e574){_0x190757[_0xa55c('0x22')](0x194);}return _0xf0e574;};}function handleError(_0x170ba4,_0x1da633){_0x1da633=_0x1da633||0x1f4;return function(_0x11e7f7){logger[_0xa55c('0x23')](_0x11e7f7[_0xa55c('0x24')]);if(_0x11e7f7[_0xa55c('0x25')]){delete _0x11e7f7['name'];}_0x170ba4[_0xa55c('0x18')](_0x1da633)[_0xa55c('0x26')](_0x11e7f7);};}exports[_0xa55c('0x27')]=function(_0x906caa,_0x5d940d){var _0x1377b0={},_0x22f6b6={},_0x1b8388={'count':0x0,'rows':[]};var _0x201941=_[_0xa55c('0x28')](db[_0xa55c('0x29')]['rawAttributes'],function(_0x23e698){return{'name':_0x23e698['fieldName'],'type':_0x23e698[_0xa55c('0x2a')][_0xa55c('0x2b')]};});_0x22f6b6[_0xa55c('0x2c')]=_[_0xa55c('0x28')](_0x201941,'name');_0x22f6b6[_0xa55c('0x2d')]=_[_0xa55c('0x2e')](_0x906caa[_0xa55c('0x2d')]);_0x22f6b6[_0xa55c('0x2f')]=_[_0xa55c('0x30')](_0x22f6b6[_0xa55c('0x2c')],_0x22f6b6[_0xa55c('0x2d')]);_0x1377b0[_0xa55c('0x31')]=_[_0xa55c('0x30')](_0x22f6b6[_0xa55c('0x2c')],qs[_0xa55c('0x32')](_0x906caa['query']['fields']));_0x1377b0[_0xa55c('0x31')]=_0x1377b0[_0xa55c('0x31')]['length']?_0x1377b0[_0xa55c('0x31')]:_0x22f6b6[_0xa55c('0x2c')];if(!_0x906caa[_0xa55c('0x2d')][_0xa55c('0x33')](_0xa55c('0x34'))){_0x1377b0[_0xa55c('0x1c')]=qs[_0xa55c('0x1c')](_0x906caa[_0xa55c('0x2d')][_0xa55c('0x1c')]);_0x1377b0['offset']=qs['offset'](_0x906caa['query'][_0xa55c('0x1a')]);}_0x1377b0[_0xa55c('0x35')]=qs[_0xa55c('0x36')](_0x906caa['query'][_0xa55c('0x36')]);_0x1377b0['where']=qs[_0xa55c('0x2f')](_['pick'](_0x906caa[_0xa55c('0x2d')],_0x22f6b6[_0xa55c('0x2f')]),_0x201941);if(_0x906caa[_0xa55c('0x2d')]['filter']){_0x1377b0[_0xa55c('0x37')]=_[_0xa55c('0x38')](_0x1377b0['where'],{'$or':_[_0xa55c('0x28')](_0x201941,function(_0x194e78){if(_0x194e78['type']!=='VIRTUAL'){var _0x235f6b={};_0x235f6b[_0x194e78['name']]={'$like':'%'+_0x906caa[_0xa55c('0x2d')][_0xa55c('0x39')]+'%'};return _0x235f6b;}})});}_0x1377b0=_['merge']({},_0x1377b0,_0x906caa['options']);var _0x5e50b6={'where':_0x1377b0['where']};return db[_0xa55c('0x29')][_0xa55c('0x1d')](_0x5e50b6)[_0xa55c('0x20')](function(_0x99c4f8){_0x1b8388[_0xa55c('0x1d')]=_0x99c4f8;if(_0x906caa['query'][_0xa55c('0x3a')]){_0x1377b0[_0xa55c('0x3b')]=[{'all':!![]}];}return db[_0xa55c('0x29')][_0xa55c('0x3c')](_0x1377b0);})[_0xa55c('0x20')](function(_0x23cef5){_0x1b8388['rows']=_0x23cef5;return _0x1b8388;})[_0xa55c('0x20')](respondWithFilteredResult(_0x5d940d,_0x1377b0))['catch'](handleError(_0x5d940d,null));};exports['show']=function(_0x404e7f,_0x1f63d8){var _0x496920={'raw':!![],'where':{'id':_0x404e7f['params']['id']}},_0x2bd98b={};_0x2bd98b['model']=_[_0xa55c('0x2e')](db[_0xa55c('0x29')][_0xa55c('0x3d')]);_0x2bd98b['query']=_[_0xa55c('0x2e')](_0x404e7f[_0xa55c('0x2d')]);_0x2bd98b['filters']=_[_0xa55c('0x30')](_0x2bd98b['model'],_0x2bd98b[_0xa55c('0x2d')]);_0x496920[_0xa55c('0x31')]=_['intersection'](_0x2bd98b[_0xa55c('0x2c')],qs[_0xa55c('0x32')](_0x404e7f['query'][_0xa55c('0x32')]));_0x496920[_0xa55c('0x31')]=_0x496920[_0xa55c('0x31')]['length']?_0x496920[_0xa55c('0x31')]:_0x2bd98b['model'];if(_0x404e7f[_0xa55c('0x2d')][_0xa55c('0x3a')]){_0x496920[_0xa55c('0x3b')]=[{'all':!![]}];}_0x496920=_['merge']({},_0x496920,_0x404e7f[_0xa55c('0x3e')]);return db[_0xa55c('0x29')]['find'](_0x496920)[_0xa55c('0x20')](handleEntityNotFound(_0x1f63d8,null))[_0xa55c('0x20')](respondWithResult(_0x1f63d8,null))['catch'](handleError(_0x1f63d8,null));};exports[_0xa55c('0x3f')]=function(_0xd3fe78,_0x52f9a7){return db[_0xa55c('0x29')][_0xa55c('0x3f')](_0xd3fe78[_0xa55c('0x40')],{})[_0xa55c('0x20')](respondWithResult(_0x52f9a7,0xc9))['catch'](handleError(_0x52f9a7,null));};exports[_0xa55c('0x1f')]=function(_0x58a7ea,_0x2157d6){if(_0x58a7ea[_0xa55c('0x40')]['id']){delete _0x58a7ea[_0xa55c('0x40')]['id'];}return db['MemberReport'][_0xa55c('0x41')]({'where':{'id':_0x58a7ea[_0xa55c('0x42')]['id']}})['then'](handleEntityNotFound(_0x2157d6,null))[_0xa55c('0x20')](saveUpdates(_0x58a7ea[_0xa55c('0x40')],null))[_0xa55c('0x20')](respondWithResult(_0x2157d6,null))[_0xa55c('0x43')](handleError(_0x2157d6,null));};exports[_0xa55c('0x44')]=function(_0x1c84d9,_0x1e1293){return db[_0xa55c('0x29')][_0xa55c('0x41')]({'where':{'id':_0x1c84d9[_0xa55c('0x42')]['id']}})['then'](handleEntityNotFound(_0x1e1293,null))[_0xa55c('0x20')](removeEntity(_0x1e1293,null))[_0xa55c('0x43')](handleError(_0x1e1293,null));};exports[_0xa55c('0x45')]=function(_0x4f73b6,_0x4c3095){return db[_0xa55c('0x29')]['describe']()[_0xa55c('0x20')](respondWithResult(_0x4c3095,null))['catch'](handleError(_0x4c3095,null));}; \ No newline at end of file +var _0x3e74=['show','params','options','find','catch','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','end','json','undefined','limit','offset','count','status','set','Content-Range','apply','save','update','then','destroy','sendStatus','name','send','index','map','MemberReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows'];(function(_0x5c6399,_0x4a9ab){var _0x184a3b=function(_0x582e68){while(--_0x582e68){_0x5c6399['push'](_0x5c6399['shift']());}};_0x184a3b(++_0x4a9ab);}(_0x3e74,0x175));var _0x43e7=function(_0x3aa21c,_0x346a86){_0x3aa21c=_0x3aa21c-0x0;var _0x3d9cf8=_0x3e74[_0x3aa21c];return _0x3d9cf8;};'use strict';var emlformat=require(_0x43e7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x43e7('0x1'));var jsonpatch=require(_0x43e7('0x2'));var rp=require(_0x43e7('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x43e7('0x4'));var util=require('util');var path=require(_0x43e7('0x5'));var sox=require(_0x43e7('0x6'));var csv=require(_0x43e7('0x7'));var ejs=require(_0x43e7('0x8'));var fs=require('fs');var fs_extra=require(_0x43e7('0x9'));var _=require('lodash');var squel=require(_0x43e7('0xa'));var crypto=require(_0x43e7('0xb'));var jsforce=require(_0x43e7('0xc'));var deskjs=require(_0x43e7('0xd'));var toCsv=require(_0x43e7('0x7'));var querystring=require('querystring');var Papa=require(_0x43e7('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x43e7('0xf'));var as=require(_0x43e7('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x43e7('0x11'))('api');var utils=require(_0x43e7('0x12'));var config=require(_0x43e7('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x43e7('0x14'))['db'];function respondWithStatusCode(_0xc960ea,_0x2718d3){_0x2718d3=_0x2718d3||0xcc;return function(_0x3bb83f){if(_0x3bb83f){return _0xc960ea['sendStatus'](_0x2718d3);}return _0xc960ea['status'](_0x2718d3)[_0x43e7('0x15')]();};}function respondWithResult(_0x21fdd3,_0x44b0bd){_0x44b0bd=_0x44b0bd||0xc8;return function(_0x51b974){if(_0x51b974){return _0x21fdd3['status'](_0x44b0bd)[_0x43e7('0x16')](_0x51b974);}};}function respondWithFilteredResult(_0x14c146,_0x203378){return function(_0x328445){if(_0x328445){var _0x4de324=typeof _0x203378['offset']===_0x43e7('0x17')&&typeof _0x203378[_0x43e7('0x18')]===_0x43e7('0x17');var _0x5d346f=_0x328445['count'];var _0x446986=_0x4de324?0x0:_0x203378[_0x43e7('0x19')];var _0x9037d3=_0x4de324?_0x328445[_0x43e7('0x1a')]:_0x203378[_0x43e7('0x19')]+_0x203378[_0x43e7('0x18')];var _0x619236;if(_0x9037d3>=_0x5d346f){_0x9037d3=_0x5d346f;_0x619236=0xc8;}else{_0x619236=0xce;}_0x14c146[_0x43e7('0x1b')](_0x619236);return _0x14c146[_0x43e7('0x1c')](_0x43e7('0x1d'),_0x446986+'-'+_0x9037d3+'/'+_0x5d346f)[_0x43e7('0x16')](_0x328445);}return null;};}function patchUpdates(_0x177ee1){return function(_0x4b5d64){try{jsonpatch[_0x43e7('0x1e')](_0x4b5d64,_0x177ee1,!![]);}catch(_0x3c6625){return BPromise['reject'](_0x3c6625);}return _0x4b5d64[_0x43e7('0x1f')]();};}function saveUpdates(_0x3e281e,_0x3945bb){return function(_0x28aacc){if(_0x28aacc){return _0x28aacc[_0x43e7('0x20')](_0x3e281e)[_0x43e7('0x21')](function(_0x54a9e7){return _0x54a9e7;});}return null;};}function removeEntity(_0x454359,_0x4eea52){return function(_0x4c9df3){if(_0x4c9df3){return _0x4c9df3[_0x43e7('0x22')]()[_0x43e7('0x21')](function(){_0x454359['status'](0xcc)[_0x43e7('0x15')]();});}};}function handleEntityNotFound(_0x4ca5cf,_0x326dab){return function(_0x5c5e67){if(!_0x5c5e67){_0x4ca5cf[_0x43e7('0x23')](0x194);}return _0x5c5e67;};}function handleError(_0x1b5f50,_0x20888b){_0x20888b=_0x20888b||0x1f4;return function(_0x405f85){logger['error'](_0x405f85['stack']);if(_0x405f85[_0x43e7('0x24')]){delete _0x405f85['name'];}_0x1b5f50[_0x43e7('0x1b')](_0x20888b)[_0x43e7('0x25')](_0x405f85);};}exports[_0x43e7('0x26')]=function(_0xb1fc63,_0x5087d7){var _0x33a1a5={},_0x4690a6={},_0x45b675={'count':0x0,'rows':[]};var _0x50f9f5=_[_0x43e7('0x27')](db[_0x43e7('0x28')][_0x43e7('0x29')],function(_0x31b2a6){return{'name':_0x31b2a6[_0x43e7('0x2a')],'type':_0x31b2a6[_0x43e7('0x2b')][_0x43e7('0x2c')]};});_0x4690a6[_0x43e7('0x2d')]=_[_0x43e7('0x27')](_0x50f9f5,_0x43e7('0x24'));_0x4690a6['query']=_[_0x43e7('0x2e')](_0xb1fc63[_0x43e7('0x2f')]);_0x4690a6[_0x43e7('0x30')]=_[_0x43e7('0x31')](_0x4690a6[_0x43e7('0x2d')],_0x4690a6['query']);_0x33a1a5[_0x43e7('0x32')]=_[_0x43e7('0x31')](_0x4690a6[_0x43e7('0x2d')],qs[_0x43e7('0x33')](_0xb1fc63['query']['fields']));_0x33a1a5['attributes']=_0x33a1a5[_0x43e7('0x32')][_0x43e7('0x34')]?_0x33a1a5[_0x43e7('0x32')]:_0x4690a6[_0x43e7('0x2d')];if(!_0xb1fc63[_0x43e7('0x2f')][_0x43e7('0x35')]('nolimit')){_0x33a1a5['limit']=qs['limit'](_0xb1fc63['query']['limit']);_0x33a1a5['offset']=qs['offset'](_0xb1fc63[_0x43e7('0x2f')]['offset']);}_0x33a1a5[_0x43e7('0x36')]=qs[_0x43e7('0x37')](_0xb1fc63[_0x43e7('0x2f')][_0x43e7('0x37')]);_0x33a1a5[_0x43e7('0x38')]=qs[_0x43e7('0x30')](_[_0x43e7('0x39')](_0xb1fc63['query'],_0x4690a6['filters']),_0x50f9f5);if(_0xb1fc63['query'][_0x43e7('0x3a')]){_0x33a1a5[_0x43e7('0x38')]=_[_0x43e7('0x3b')](_0x33a1a5[_0x43e7('0x38')],{'$or':_[_0x43e7('0x27')](_0x50f9f5,function(_0x1ed538){if(_0x1ed538[_0x43e7('0x2b')]!==_0x43e7('0x3c')){var _0x55c798={};_0x55c798[_0x1ed538[_0x43e7('0x24')]]={'$like':'%'+_0xb1fc63[_0x43e7('0x2f')]['filter']+'%'};return _0x55c798;}})});}_0x33a1a5=_[_0x43e7('0x3b')]({},_0x33a1a5,_0xb1fc63['options']);var _0x44d8e4={'where':_0x33a1a5[_0x43e7('0x38')]};return db[_0x43e7('0x28')][_0x43e7('0x1a')](_0x44d8e4)[_0x43e7('0x21')](function(_0x234d8f){_0x45b675['count']=_0x234d8f;if(_0xb1fc63['query'][_0x43e7('0x3d')]){_0x33a1a5[_0x43e7('0x3e')]=[{'all':!![]}];}return db[_0x43e7('0x28')][_0x43e7('0x3f')](_0x33a1a5);})[_0x43e7('0x21')](function(_0x4a4a85){_0x45b675[_0x43e7('0x40')]=_0x4a4a85;return _0x45b675;})[_0x43e7('0x21')](respondWithFilteredResult(_0x5087d7,_0x33a1a5))['catch'](handleError(_0x5087d7,null));};exports[_0x43e7('0x41')]=function(_0x51a69c,_0x2ad8ef){var _0x504101={'raw':!![],'where':{'id':_0x51a69c[_0x43e7('0x42')]['id']}},_0x3d81ae={};_0x3d81ae[_0x43e7('0x2d')]=_[_0x43e7('0x2e')](db['MemberReport']['rawAttributes']);_0x3d81ae[_0x43e7('0x2f')]=_[_0x43e7('0x2e')](_0x51a69c[_0x43e7('0x2f')]);_0x3d81ae[_0x43e7('0x30')]=_['intersection'](_0x3d81ae['model'],_0x3d81ae['query']);_0x504101[_0x43e7('0x32')]=_['intersection'](_0x3d81ae[_0x43e7('0x2d')],qs['fields'](_0x51a69c['query'][_0x43e7('0x33')]));_0x504101['attributes']=_0x504101[_0x43e7('0x32')][_0x43e7('0x34')]?_0x504101[_0x43e7('0x32')]:_0x3d81ae[_0x43e7('0x2d')];if(_0x51a69c['query'][_0x43e7('0x3d')]){_0x504101[_0x43e7('0x3e')]=[{'all':!![]}];}_0x504101=_[_0x43e7('0x3b')]({},_0x504101,_0x51a69c[_0x43e7('0x43')]);return db[_0x43e7('0x28')][_0x43e7('0x44')](_0x504101)['then'](handleEntityNotFound(_0x2ad8ef,null))['then'](respondWithResult(_0x2ad8ef,null))[_0x43e7('0x45')](handleError(_0x2ad8ef,null));};exports[_0x43e7('0x46')]=function(_0x212841,_0x4c00a8){return db['MemberReport']['create'](_0x212841[_0x43e7('0x47')],{})[_0x43e7('0x21')](respondWithResult(_0x4c00a8,0xc9))['catch'](handleError(_0x4c00a8,null));};exports[_0x43e7('0x20')]=function(_0x47686e,_0x3c96fe){if(_0x47686e['body']['id']){delete _0x47686e['body']['id'];}return db['MemberReport']['find']({'where':{'id':_0x47686e[_0x43e7('0x42')]['id']}})[_0x43e7('0x21')](handleEntityNotFound(_0x3c96fe,null))['then'](saveUpdates(_0x47686e[_0x43e7('0x47')],null))[_0x43e7('0x21')](respondWithResult(_0x3c96fe,null))[_0x43e7('0x45')](handleError(_0x3c96fe,null));};exports[_0x43e7('0x22')]=function(_0x4a0ce5,_0x2718d5){return db['MemberReport']['find']({'where':{'id':_0x4a0ce5[_0x43e7('0x42')]['id']}})[_0x43e7('0x21')](handleEntityNotFound(_0x2718d5,null))[_0x43e7('0x21')](removeEntity(_0x2718d5,null))[_0x43e7('0x45')](handleError(_0x2718d5,null));};exports[_0x43e7('0x48')]=function(_0x2351cf,_0x1cd87c){return db[_0x43e7('0x28')][_0x43e7('0x48')]()[_0x43e7('0x21')](respondWithResult(_0x1cd87c,null))['catch'](handleError(_0x1cd87c,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index d230a93..c8d7b86 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 _0x8876=['request-promise','path','../../config/environment','./memberReport.attributes','exports','MemberReport','report_member','membername_interface','membername','interface','util','../../config/logger','api','moment','bluebird'];(function(_0x4267a2,_0x45f935){var _0x8019ad=function(_0x160140){while(--_0x160140){_0x4267a2['push'](_0x4267a2['shift']());}};_0x8019ad(++_0x45f935);}(_0x8876,0xa0));var _0x6887=function(_0x3f3634,_0x9b12f8){_0x3f3634=_0x3f3634-0x0;var _0x56c0db=_0x8876[_0x3f3634];return _0x56c0db;};'use strict';var _=require('lodash');var util=require(_0x6887('0x0'));var logger=require(_0x6887('0x1'))(_0x6887('0x2'));var moment=require(_0x6887('0x3'));var BPromise=require(_0x6887('0x4'));var rp=require(_0x6887('0x5'));var fs=require('fs');var path=require(_0x6887('0x6'));var rimraf=require('rimraf');var config=require(_0x6887('0x7'));var attributes=require(_0x6887('0x8'));module[_0x6887('0x9')]=function(_0x516842,_0x501589){return _0x516842['define'](_0x6887('0xa'),attributes,{'tableName':_0x6887('0xb'),'paranoid':![],'indexes':[{'name':_0x6887('0xc'),'fields':[_0x6887('0xd'),_0x6887('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa209=['define','report_member','membername_interface','interface','lodash','util','api','moment','bluebird','request-promise','path','rimraf','./memberReport.attributes','exports'];(function(_0x53ee20,_0x3bcbc1){var _0x2f637a=function(_0x2e9295){while(--_0x2e9295){_0x53ee20['push'](_0x53ee20['shift']());}};_0x2f637a(++_0x3bcbc1);}(_0xa209,0xba));var _0x9a20=function(_0x49c4fb,_0x5e7898){_0x49c4fb=_0x49c4fb-0x0;var _0x157d10=_0xa209[_0x49c4fb];return _0x157d10;};'use strict';var _=require(_0x9a20('0x0'));var util=require(_0x9a20('0x1'));var logger=require('../../config/logger')(_0x9a20('0x2'));var moment=require(_0x9a20('0x3'));var BPromise=require(_0x9a20('0x4'));var rp=require(_0x9a20('0x5'));var fs=require('fs');var path=require(_0x9a20('0x6'));var rimraf=require(_0x9a20('0x7'));var config=require('../../config/environment');var attributes=require(_0x9a20('0x8'));module[_0x9a20('0x9')]=function(_0xb4a3f4,_0x3f6b50){return _0xb4a3f4[_0x9a20('0xa')]('MemberReport',attributes,{'tableName':_0x9a20('0xb'),'paranoid':![],'indexes':[{'name':_0x9a20('0xc'),'fields':['membername',_0x9a20('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index 8ebfa50..62ad45e 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 _0x4753=['ioredis','../../config/utils','client','http','request','then','info','MemberReport,\x20%s,\x20%s','request\x20sent','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetMemberReport','MemberReport','options','raw','where','attributes','limit','include','map','model','debug','CreateMemberReport','create','UpdateMemberReport','update','body','lodash','util','moment','randomstring'];(function(_0xd61230,_0x38d09a){var _0x473627=function(_0x1a792a){while(--_0x1a792a){_0xd61230['push'](_0xd61230['shift']());}};_0x473627(++_0x38d09a);}(_0x4753,0x1f4));var _0x3475=function(_0x1b3fa6,_0x24fde1){_0x1b3fa6=_0x1b3fa6-0x0;var _0x386330=_0x4753[_0x1b3fa6];return _0x386330;};'use strict';var _=require(_0x3475('0x0'));var util=require(_0x3475('0x1'));var moment=require(_0x3475('0x2'));var BPromise=require('bluebird');var rs=require(_0x3475('0x3'));var fs=require('fs');var Redis=require(_0x3475('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x3475('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3475('0x6')][_0x3475('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x48c6af,_0x820cbe,_0x157c1e){return new BPromise(function(_0x409bfc,_0x1d021b){return client[_0x3475('0x8')](_0x48c6af,_0x157c1e)[_0x3475('0x9')](function(_0x2c4cd7){logger[_0x3475('0xa')](_0x3475('0xb'),_0x820cbe,_0x3475('0xc'));logger['debug'](_0x3475('0xd'),_0x820cbe,_0x3475('0xc'),JSON[_0x3475('0xe')](_0x2c4cd7));if(_0x2c4cd7['error']){if(_0x2c4cd7[_0x3475('0xf')][_0x3475('0x10')]===0x1f4){logger['error'](_0x3475('0xb'),_0x820cbe,_0x2c4cd7['error'][_0x3475('0x11')]);return _0x1d021b(_0x2c4cd7[_0x3475('0xf')][_0x3475('0x11')]);}logger['error'](_0x3475('0xb'),_0x820cbe,_0x2c4cd7[_0x3475('0xf')][_0x3475('0x11')]);return _0x409bfc(_0x2c4cd7[_0x3475('0xf')]['message']);}else{logger[_0x3475('0xa')]('MemberReport,\x20%s,\x20%s',_0x820cbe,'request\x20sent');_0x409bfc(_0x2c4cd7[_0x3475('0x12')][_0x3475('0x11')]);}})[_0x3475('0x13')](function(_0x1e0c0a){logger[_0x3475('0xf')]('MemberReport,\x20%s,\x20%s',_0x820cbe,_0x1e0c0a);_0x1d021b(_0x1e0c0a);});});}exports[_0x3475('0x14')]=function(_0x547009){var _0x12a893=this;return new Promise(function(_0x26764a,_0x3640f1){return db[_0x3475('0x15')]['findAll']({'raw':_0x547009[_0x3475('0x16')]?_0x547009['options'][_0x3475('0x17')]===undefined?!![]:![]:!![],'where':_0x547009[_0x3475('0x16')]?_0x547009[_0x3475('0x16')][_0x3475('0x18')]||null:null,'attributes':_0x547009['options']?_0x547009[_0x3475('0x16')][_0x3475('0x19')]||null:null,'limit':_0x547009[_0x3475('0x16')]?_0x547009['options'][_0x3475('0x1a')]||null:null,'include':_0x547009[_0x3475('0x16')]?_0x547009[_0x3475('0x16')][_0x3475('0x1b')]?_[_0x3475('0x1c')](_0x547009[_0x3475('0x16')][_0x3475('0x1b')],function(_0x1d72f9){return{'model':db[_0x1d72f9[_0x3475('0x1d')]],'as':_0x1d72f9['as'],'attributes':_0x1d72f9[_0x3475('0x19')],'include':_0x1d72f9[_0x3475('0x1b')]?_[_0x3475('0x1c')](_0x1d72f9[_0x3475('0x1b')],function(_0x4ff2a1){return{'model':db[_0x4ff2a1['model']],'as':_0x4ff2a1['as'],'attributes':_0x4ff2a1['attributes'],'include':_0x4ff2a1[_0x3475('0x1b')]?_[_0x3475('0x1c')](_0x4ff2a1['include'],function(_0x1f3481){return{'model':db[_0x1f3481[_0x3475('0x1d')]],'as':_0x1f3481['as'],'attributes':_0x1f3481[_0x3475('0x19')]};}):[]};}):[]};}):[]:[]})[_0x3475('0x9')](function(_0x2f2569){logger['info']('GetMemberReport',_0x547009);logger[_0x3475('0x1e')](_0x3475('0x14'),_0x547009,JSON[_0x3475('0xe')](_0x2f2569));_0x26764a(_0x2f2569);})[_0x3475('0x13')](function(_0x2a3ced){logger[_0x3475('0xf')]('GetMemberReport',_0x2a3ced[_0x3475('0x11')],_0x547009);_0x3640f1(_0x12a893[_0x3475('0xf')](0x1f4,_0x2a3ced[_0x3475('0x11')]));});});};exports[_0x3475('0x1f')]=function(_0x26426a){var _0x4fbf8b=this;return new Promise(function(_0x534c9e,_0x2ee53a){return db[_0x3475('0x15')][_0x3475('0x20')](_0x26426a['body'],{'raw':_0x26426a[_0x3475('0x16')]?_0x26426a[_0x3475('0x16')][_0x3475('0x17')]===undefined?!![]:![]:!![]})[_0x3475('0x9')](function(_0x5a4774){logger[_0x3475('0xa')](_0x3475('0x1f'),_0x26426a);logger['debug'](_0x3475('0x1f'),_0x26426a,JSON[_0x3475('0xe')](_0x5a4774));_0x534c9e(_0x5a4774);})[_0x3475('0x13')](function(_0x2dc0ea){logger[_0x3475('0xf')](_0x3475('0x1f'),_0x2dc0ea[_0x3475('0x11')],_0x26426a);_0x2ee53a(_0x4fbf8b[_0x3475('0xf')](0x1f4,_0x2dc0ea[_0x3475('0x11')]));});});};exports[_0x3475('0x21')]=function(_0x501775){var _0x49d11d=this;return new Promise(function(_0x229124,_0x32abcc){return db[_0x3475('0x15')][_0x3475('0x22')](_0x501775[_0x3475('0x23')],{'raw':_0x501775['options']?_0x501775['options'][_0x3475('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x501775[_0x3475('0x16')]?_0x501775[_0x3475('0x16')][_0x3475('0x18')]||null:null,'attributes':_0x501775['options']?_0x501775[_0x3475('0x16')][_0x3475('0x19')]||null:null,'limit':_0x501775[_0x3475('0x16')]?_0x501775[_0x3475('0x16')][_0x3475('0x1a')]||null:null})[_0x3475('0x9')](function(_0x1dc1ac){logger[_0x3475('0xa')](_0x3475('0x21'),_0x501775);logger[_0x3475('0x1e')](_0x3475('0x21'),_0x501775,JSON['stringify'](_0x1dc1ac));_0x229124(_0x1dc1ac);})['catch'](function(_0x2f8bd7){logger[_0x3475('0xf')](_0x3475('0x21'),_0x2f8bd7[_0x3475('0x11')],_0x501775);_0x32abcc(_0x49d11d[_0x3475('0xf')](0x1f4,_0x2f8bd7[_0x3475('0x11')]));});});}; \ No newline at end of file +var _0x90b5=['map','model','include','attributes','CreateMemberReport','create','body','UpdateMemberReport','update','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','http','request','then','info','MemberReport,\x20%s,\x20%s','debug','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','GetMemberReport','MemberReport','options','raw','where','limit'];(function(_0x2426e9,_0x3a396d){var _0x5c9496=function(_0x1857f4){while(--_0x1857f4){_0x2426e9['push'](_0x2426e9['shift']());}};_0x5c9496(++_0x3a396d);}(_0x90b5,0x139));var _0x590b=function(_0x5792eb,_0x4acd6e){_0x5792eb=_0x5792eb-0x0;var _0x4b9aaa=_0x90b5[_0x5792eb];return _0x4b9aaa;};'use strict';var _=require(_0x590b('0x0'));var util=require('util');var moment=require(_0x590b('0x1'));var BPromise=require(_0x590b('0x2'));var rs=require(_0x590b('0x3'));var fs=require('fs');var Redis=require(_0x590b('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x590b('0x5'))(_0x590b('0x6'));var config=require('../../config/environment');var jayson=require(_0x590b('0x7'));var client=jayson[_0x590b('0x8')][_0x590b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5e54fe,_0x30bc6e,_0x3663a0){return new BPromise(function(_0x3ec156,_0x9c408b){return client[_0x590b('0xa')](_0x5e54fe,_0x3663a0)[_0x590b('0xb')](function(_0x2103c0){logger[_0x590b('0xc')](_0x590b('0xd'),_0x30bc6e,'request\x20sent');logger[_0x590b('0xe')](_0x590b('0xf'),_0x30bc6e,'request\x20sent',JSON[_0x590b('0x10')](_0x2103c0));if(_0x2103c0['error']){if(_0x2103c0[_0x590b('0x11')][_0x590b('0x12')]===0x1f4){logger[_0x590b('0x11')](_0x590b('0xd'),_0x30bc6e,_0x2103c0['error'][_0x590b('0x13')]);return _0x9c408b(_0x2103c0[_0x590b('0x11')][_0x590b('0x13')]);}logger[_0x590b('0x11')](_0x590b('0xd'),_0x30bc6e,_0x2103c0[_0x590b('0x11')][_0x590b('0x13')]);return _0x3ec156(_0x2103c0[_0x590b('0x11')][_0x590b('0x13')]);}else{logger[_0x590b('0xc')](_0x590b('0xd'),_0x30bc6e,_0x590b('0x14'));_0x3ec156(_0x2103c0[_0x590b('0x15')][_0x590b('0x13')]);}})[_0x590b('0x16')](function(_0x4f2512){logger[_0x590b('0x11')]('MemberReport,\x20%s,\x20%s',_0x30bc6e,_0x4f2512);_0x9c408b(_0x4f2512);});});}exports[_0x590b('0x17')]=function(_0x115309){var _0xf05b00=this;return new Promise(function(_0x53337c,_0x4b2c3c){return db[_0x590b('0x18')]['findAll']({'raw':_0x115309[_0x590b('0x19')]?_0x115309[_0x590b('0x19')][_0x590b('0x1a')]===undefined?!![]:![]:!![],'where':_0x115309['options']?_0x115309[_0x590b('0x19')][_0x590b('0x1b')]||null:null,'attributes':_0x115309[_0x590b('0x19')]?_0x115309[_0x590b('0x19')]['attributes']||null:null,'limit':_0x115309[_0x590b('0x19')]?_0x115309['options'][_0x590b('0x1c')]||null:null,'include':_0x115309[_0x590b('0x19')]?_0x115309['options']['include']?_[_0x590b('0x1d')](_0x115309[_0x590b('0x19')]['include'],function(_0x21638c){return{'model':db[_0x21638c[_0x590b('0x1e')]],'as':_0x21638c['as'],'attributes':_0x21638c['attributes'],'include':_0x21638c['include']?_[_0x590b('0x1d')](_0x21638c['include'],function(_0x39fead){return{'model':db[_0x39fead['model']],'as':_0x39fead['as'],'attributes':_0x39fead['attributes'],'include':_0x39fead[_0x590b('0x1f')]?_[_0x590b('0x1d')](_0x39fead['include'],function(_0x1febcd){return{'model':db[_0x1febcd[_0x590b('0x1e')]],'as':_0x1febcd['as'],'attributes':_0x1febcd[_0x590b('0x20')]};}):[]};}):[]};}):[]:[]})[_0x590b('0xb')](function(_0x320a45){logger['info'](_0x590b('0x17'),_0x115309);logger[_0x590b('0xe')](_0x590b('0x17'),_0x115309,JSON[_0x590b('0x10')](_0x320a45));_0x53337c(_0x320a45);})[_0x590b('0x16')](function(_0x3b881f){logger['error'](_0x590b('0x17'),_0x3b881f['message'],_0x115309);_0x4b2c3c(_0xf05b00[_0x590b('0x11')](0x1f4,_0x3b881f[_0x590b('0x13')]));});});};exports[_0x590b('0x21')]=function(_0x33931e){var _0x53a751=this;return new Promise(function(_0x1041e5,_0x4ef071){return db[_0x590b('0x18')][_0x590b('0x22')](_0x33931e[_0x590b('0x23')],{'raw':_0x33931e[_0x590b('0x19')]?_0x33931e[_0x590b('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x590b('0xb')](function(_0x129516){logger[_0x590b('0xc')](_0x590b('0x21'),_0x33931e);logger['debug']('CreateMemberReport',_0x33931e,JSON[_0x590b('0x10')](_0x129516));_0x1041e5(_0x129516);})[_0x590b('0x16')](function(_0x48408d){logger[_0x590b('0x11')]('CreateMemberReport',_0x48408d['message'],_0x33931e);_0x4ef071(_0x53a751[_0x590b('0x11')](0x1f4,_0x48408d['message']));});});};exports[_0x590b('0x24')]=function(_0x4561ac){var _0x35d7ce=this;return new Promise(function(_0x3c2d0f,_0x35dcaf){return db[_0x590b('0x18')][_0x590b('0x25')](_0x4561ac[_0x590b('0x23')],{'raw':_0x4561ac[_0x590b('0x19')]?_0x4561ac[_0x590b('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4561ac['options']?_0x4561ac[_0x590b('0x19')][_0x590b('0x1b')]||null:null,'attributes':_0x4561ac[_0x590b('0x19')]?_0x4561ac[_0x590b('0x19')][_0x590b('0x20')]||null:null,'limit':_0x4561ac['options']?_0x4561ac[_0x590b('0x19')][_0x590b('0x1c')]||null:null})[_0x590b('0xb')](function(_0x1d1fe7){logger[_0x590b('0xc')]('UpdateMemberReport',_0x4561ac);logger[_0x590b('0xe')](_0x590b('0x24'),_0x4561ac,JSON['stringify'](_0x1d1fe7));_0x3c2d0f(_0x1d1fe7);})['catch'](function(_0x46dbf3){logger['error'](_0x590b('0x24'),_0x46dbf3[_0x590b('0x13')],_0x4561ac);_0x35dcaf(_0x35d7ce[_0x590b('0x11')](0x1f4,_0x46dbf3[_0x590b('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index d1adf5d..f99681c 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 _0xe931=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./migration.controller','get','index','exports','multer','util'];(function(_0x2abe8d,_0x1834aa){var _0xe1ae37=function(_0x421a64){while(--_0x421a64){_0x2abe8d['push'](_0x2abe8d['shift']());}};_0xe1ae37(++_0x1834aa);}(_0xe931,0x177));var _0x1e93=function(_0x58eee3,_0x5c4379){_0x58eee3=_0x58eee3-0x0;var _0x18720e=_0xe931[_0x58eee3];return _0x18720e;};'use strict';var multer=require(_0x1e93('0x0'));var util=require(_0x1e93('0x1'));var path=require(_0x1e93('0x2'));var timeout=require('connect-timeout');var express=require(_0x1e93('0x3'));var router=express[_0x1e93('0x4')]();var fs_extra=require(_0x1e93('0x5'));var auth=require(_0x1e93('0x6'));var interaction=require(_0x1e93('0x7'));var config=require(_0x1e93('0x8'));var controller=require(_0x1e93('0x9'));router[_0x1e93('0xa')]('/',controller[_0x1e93('0xb')]);module[_0x1e93('0xc')]=router; \ No newline at end of file +var _0xe57d=['path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','./migration.controller','index','exports','multer'];(function(_0x4a11d2,_0x1de50f){var _0x57776e=function(_0x5548a5){while(--_0x5548a5){_0x4a11d2['push'](_0x4a11d2['shift']());}};_0x57776e(++_0x1de50f);}(_0xe57d,0xd7));var _0xde57=function(_0x35b2a1,_0x4cdca8){_0x35b2a1=_0x35b2a1-0x0;var _0x6023da=_0xe57d[_0x35b2a1];return _0x6023da;};'use strict';var multer=require(_0xde57('0x0'));var util=require('util');var path=require(_0xde57('0x1'));var timeout=require(_0xde57('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xde57('0x3'));var auth=require(_0xde57('0x4'));var interaction=require(_0xde57('0x5'));var config=require('../../config/environment');var controller=require(_0xde57('0x6'));router['get']('/',controller[_0xde57('0x7')]);module[_0xde57('0x8')]=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index 281e0a4..9348444 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 _0xbc0b=['STRING','exports'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0xbc0b,0xeb));var _0xbbc0=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0xbc0b[_0xa148b7];return _0x51efd3;};'use strict';var Sequelize=require('sequelize');module[_0xbbc0('0x0')]={'version':{'type':Sequelize[_0xbbc0('0x1')],'unique':'version'}}; \ No newline at end of file +var _0xf886=['exports','sequelize'];(function(_0xc2678e,_0x162af9){var _0x50a4dc=function(_0x53b935){while(--_0x53b935){_0xc2678e['push'](_0xc2678e['shift']());}};_0x50a4dc(++_0x162af9);}(_0xf886,0x17b));var _0x6f88=function(_0x5ac1e5,_0x4b5012){_0x5ac1e5=_0x5ac1e5-0x0;var _0x1bccc6=_0xf886[_0x5ac1e5];return _0x1bccc6;};'use strict';var Sequelize=require(_0x6f88('0x0'));module[_0x6f88('0x1')]={'version':{'type':Sequelize['STRING'],'unique':'version'}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index 8a6b7bd..e2f2536 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 _0xdca9=['save','update','then','destroy','error','name','send','index','map','Migration','rawAttributes','fieldName','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','sort','where','filter','merge','VIRTUAL','include','findAll','rows','catch','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','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','undefined','count','offset','limit','set','reject'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xdca9,0x16d));var _0x9dca=function(_0x5851ce,_0x1b72ad){_0x5851ce=_0x5851ce-0x0;var _0x4cbda2=_0xdca9[_0x5851ce];return _0x4cbda2;};'use strict';var emlformat=require(_0x9dca('0x0'));var rimraf=require(_0x9dca('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9dca('0x2'));var rp=require(_0x9dca('0x3'));var moment=require(_0x9dca('0x4'));var BPromise=require(_0x9dca('0x5'));var Mustache=require(_0x9dca('0x6'));var util=require(_0x9dca('0x7'));var path=require('path');var sox=require(_0x9dca('0x8'));var csv=require(_0x9dca('0x9'));var ejs=require(_0x9dca('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x9dca('0xb'));var crypto=require(_0x9dca('0xc'));var jsforce=require(_0x9dca('0xd'));var deskjs=require(_0x9dca('0xe'));var toCsv=require(_0x9dca('0x9'));var querystring=require(_0x9dca('0xf'));var Papa=require(_0x9dca('0x10'));var Redis=require(_0x9dca('0x11'));var authService=require(_0x9dca('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x9dca('0x13'));var hardwareService=require(_0x9dca('0x14'));var logger=require(_0x9dca('0x15'))(_0x9dca('0x16'));var utils=require(_0x9dca('0x17'));var config=require(_0x9dca('0x18'));var licenseUtil=require(_0x9dca('0x19'));var db=require(_0x9dca('0x1a'))['db'];function respondWithStatusCode(_0x3e56f3,_0x2b6d8c){_0x2b6d8c=_0x2b6d8c||0xcc;return function(_0x304fbc){if(_0x304fbc){return _0x3e56f3[_0x9dca('0x1b')](_0x2b6d8c);}return _0x3e56f3[_0x9dca('0x1c')](_0x2b6d8c)[_0x9dca('0x1d')]();};}function respondWithResult(_0x393be6,_0x19e092){_0x19e092=_0x19e092||0xc8;return function(_0x192190){if(_0x192190){return _0x393be6['status'](_0x19e092)[_0x9dca('0x1e')](_0x192190);}};}function respondWithFilteredResult(_0x43bf8c,_0x427d1b){return function(_0x40e1c9){if(_0x40e1c9){var _0x2b1431=typeof _0x427d1b['offset']===_0x9dca('0x1f')&&typeof _0x427d1b['limit']===_0x9dca('0x1f');var _0x4db55e=_0x40e1c9[_0x9dca('0x20')];var _0x121ac8=_0x2b1431?0x0:_0x427d1b[_0x9dca('0x21')];var _0x576f04=_0x2b1431?_0x40e1c9['count']:_0x427d1b[_0x9dca('0x21')]+_0x427d1b[_0x9dca('0x22')];var _0x2c0345;if(_0x576f04>=_0x4db55e){_0x576f04=_0x4db55e;_0x2c0345=0xc8;}else{_0x2c0345=0xce;}_0x43bf8c[_0x9dca('0x1c')](_0x2c0345);return _0x43bf8c[_0x9dca('0x23')]('Content-Range',_0x121ac8+'-'+_0x576f04+'/'+_0x4db55e)['json'](_0x40e1c9);}return null;};}function patchUpdates(_0x58f5ab){return function(_0x359f71){try{jsonpatch['apply'](_0x359f71,_0x58f5ab,!![]);}catch(_0x140eee){return BPromise[_0x9dca('0x24')](_0x140eee);}return _0x359f71[_0x9dca('0x25')]();};}function saveUpdates(_0x1a1f65,_0x46cefa){return function(_0x240478){if(_0x240478){return _0x240478[_0x9dca('0x26')](_0x1a1f65)[_0x9dca('0x27')](function(_0xa35276){return _0xa35276;});}return null;};}function removeEntity(_0x5648a6,_0x1fa2ef){return function(_0x1ac5d9){if(_0x1ac5d9){return _0x1ac5d9[_0x9dca('0x28')]()[_0x9dca('0x27')](function(){_0x5648a6[_0x9dca('0x1c')](0xcc)[_0x9dca('0x1d')]();});}};}function handleEntityNotFound(_0x4d3897,_0x5f0d9e){return function(_0xade2c1){if(!_0xade2c1){_0x4d3897[_0x9dca('0x1b')](0x194);}return _0xade2c1;};}function handleError(_0x286c91,_0x19f60a){_0x19f60a=_0x19f60a||0x1f4;return function(_0x1829d3){logger[_0x9dca('0x29')](_0x1829d3['stack']);if(_0x1829d3[_0x9dca('0x2a')]){delete _0x1829d3[_0x9dca('0x2a')];}_0x286c91['status'](_0x19f60a)[_0x9dca('0x2b')](_0x1829d3);};}exports[_0x9dca('0x2c')]=function(_0x45bf3b,_0x4b6e3d){var _0x5ac0bb={},_0x38c1a7={},_0x5b8265={'count':0x0,'rows':[]};var _0x566265=_[_0x9dca('0x2d')](db[_0x9dca('0x2e')][_0x9dca('0x2f')],function(_0x5bf06f){return{'name':_0x5bf06f[_0x9dca('0x30')],'type':_0x5bf06f['type']['key']};});_0x38c1a7['model']=_[_0x9dca('0x2d')](_0x566265,'name');_0x38c1a7[_0x9dca('0x31')]=_[_0x9dca('0x32')](_0x45bf3b[_0x9dca('0x31')]);_0x38c1a7[_0x9dca('0x33')]=_[_0x9dca('0x34')](_0x38c1a7[_0x9dca('0x35')],_0x38c1a7['query']);_0x5ac0bb[_0x9dca('0x36')]=_[_0x9dca('0x34')](_0x38c1a7[_0x9dca('0x35')],qs[_0x9dca('0x37')](_0x45bf3b[_0x9dca('0x31')][_0x9dca('0x37')]));_0x5ac0bb[_0x9dca('0x36')]=_0x5ac0bb['attributes'][_0x9dca('0x38')]?_0x5ac0bb['attributes']:_0x38c1a7[_0x9dca('0x35')];if(!_0x45bf3b['query'][_0x9dca('0x39')]('nolimit')){_0x5ac0bb['limit']=qs[_0x9dca('0x22')](_0x45bf3b[_0x9dca('0x31')][_0x9dca('0x22')]);_0x5ac0bb['offset']=qs[_0x9dca('0x21')](_0x45bf3b[_0x9dca('0x31')][_0x9dca('0x21')]);}_0x5ac0bb['order']=qs[_0x9dca('0x3a')](_0x45bf3b[_0x9dca('0x31')][_0x9dca('0x3a')]);_0x5ac0bb[_0x9dca('0x3b')]=qs[_0x9dca('0x33')](_['pick'](_0x45bf3b[_0x9dca('0x31')],_0x38c1a7[_0x9dca('0x33')]),_0x566265);if(_0x45bf3b[_0x9dca('0x31')][_0x9dca('0x3c')]){_0x5ac0bb[_0x9dca('0x3b')]=_[_0x9dca('0x3d')](_0x5ac0bb[_0x9dca('0x3b')],{'$or':_[_0x9dca('0x2d')](_0x566265,function(_0x180947){if(_0x180947['type']!==_0x9dca('0x3e')){var _0x5bab69={};_0x5bab69[_0x180947[_0x9dca('0x2a')]]={'$like':'%'+_0x45bf3b[_0x9dca('0x31')][_0x9dca('0x3c')]+'%'};return _0x5bab69;}})});}_0x5ac0bb=_[_0x9dca('0x3d')]({},_0x5ac0bb,_0x45bf3b['options']);var _0x46f3c6={'where':_0x5ac0bb[_0x9dca('0x3b')]};return db[_0x9dca('0x2e')][_0x9dca('0x20')](_0x46f3c6)[_0x9dca('0x27')](function(_0x78af65){_0x5b8265[_0x9dca('0x20')]=_0x78af65;if(_0x45bf3b[_0x9dca('0x31')]['includeAll']){_0x5ac0bb[_0x9dca('0x3f')]=[{'all':!![]}];}return db[_0x9dca('0x2e')][_0x9dca('0x40')](_0x5ac0bb);})['then'](function(_0x14ebc0){_0x5b8265[_0x9dca('0x41')]=_0x14ebc0;return _0x5b8265;})[_0x9dca('0x27')](respondWithFilteredResult(_0x4b6e3d,_0x5ac0bb))[_0x9dca('0x42')](handleError(_0x4b6e3d,null));}; \ No newline at end of file +var _0x11cb=['error','name','send','map','Migration','fieldName','type','key','model','query','keys','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','filters','pick','merge','VIRTUAL','filter','options','include','findAll','rows','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','count','offset','limit','Content-Range','apply','reject','update','then'];(function(_0x5a6644,_0x45d612){var _0x3a2a5d=function(_0x54159e){while(--_0x54159e){_0x5a6644['push'](_0x5a6644['shift']());}};_0x3a2a5d(++_0x45d612);}(_0x11cb,0x1d4));var _0xb11c=function(_0x58ed3a,_0x16bab9){_0x58ed3a=_0x58ed3a-0x0;var _0xdd4f63=_0x11cb[_0x58ed3a];return _0xdd4f63;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb11c('0x0'));var zipdir=require(_0xb11c('0x1'));var jsonpatch=require(_0xb11c('0x2'));var rp=require(_0xb11c('0x3'));var moment=require('moment');var BPromise=require(_0xb11c('0x4'));var Mustache=require(_0xb11c('0x5'));var util=require('util');var path=require(_0xb11c('0x6'));var sox=require('sox');var csv=require(_0xb11c('0x7'));var ejs=require(_0xb11c('0x8'));var fs=require('fs');var fs_extra=require(_0xb11c('0x9'));var _=require(_0xb11c('0xa'));var squel=require(_0xb11c('0xb'));var crypto=require(_0xb11c('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xb11c('0xd'));var toCsv=require(_0xb11c('0x7'));var querystring=require(_0xb11c('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xb11c('0xf'));var qs=require(_0xb11c('0x10'));var as=require(_0xb11c('0x11'));var hardwareService=require(_0xb11c('0x12'));var logger=require(_0xb11c('0x13'))('api');var utils=require(_0xb11c('0x14'));var config=require(_0xb11c('0x15'));var licenseUtil=require(_0xb11c('0x16'));var db=require(_0xb11c('0x17'))['db'];function respondWithStatusCode(_0x4f612f,_0xbf7ab2){_0xbf7ab2=_0xbf7ab2||0xcc;return function(_0x1981bc){if(_0x1981bc){return _0x4f612f[_0xb11c('0x18')](_0xbf7ab2);}return _0x4f612f['status'](_0xbf7ab2)[_0xb11c('0x19')]();};}function respondWithResult(_0xbcbd79,_0x5008c3){_0x5008c3=_0x5008c3||0xc8;return function(_0x2ce300){if(_0x2ce300){return _0xbcbd79[_0xb11c('0x1a')](_0x5008c3)[_0xb11c('0x1b')](_0x2ce300);}};}function respondWithFilteredResult(_0x2d3b20,_0x34b3aa){return function(_0x591909){if(_0x591909){var _0x5720f4=typeof _0x34b3aa['offset']==='undefined'&&typeof _0x34b3aa['limit']==='undefined';var _0x5754bb=_0x591909[_0xb11c('0x1c')];var _0x1a5b4a=_0x5720f4?0x0:_0x34b3aa[_0xb11c('0x1d')];var _0x2b0684=_0x5720f4?_0x591909[_0xb11c('0x1c')]:_0x34b3aa[_0xb11c('0x1d')]+_0x34b3aa[_0xb11c('0x1e')];var _0x6c04be;if(_0x2b0684>=_0x5754bb){_0x2b0684=_0x5754bb;_0x6c04be=0xc8;}else{_0x6c04be=0xce;}_0x2d3b20['status'](_0x6c04be);return _0x2d3b20['set'](_0xb11c('0x1f'),_0x1a5b4a+'-'+_0x2b0684+'/'+_0x5754bb)[_0xb11c('0x1b')](_0x591909);}return null;};}function patchUpdates(_0x43512c){return function(_0x49741a){try{jsonpatch[_0xb11c('0x20')](_0x49741a,_0x43512c,!![]);}catch(_0x1b47f2){return BPromise[_0xb11c('0x21')](_0x1b47f2);}return _0x49741a['save']();};}function saveUpdates(_0x45297e,_0x372d4d){return function(_0x59f20e){if(_0x59f20e){return _0x59f20e[_0xb11c('0x22')](_0x45297e)[_0xb11c('0x23')](function(_0x3b1231){return _0x3b1231;});}return null;};}function removeEntity(_0x1a6b35,_0x546e90){return function(_0x1c92f1){if(_0x1c92f1){return _0x1c92f1['destroy']()[_0xb11c('0x23')](function(){_0x1a6b35[_0xb11c('0x1a')](0xcc)[_0xb11c('0x19')]();});}};}function handleEntityNotFound(_0x1db934,_0x161d67){return function(_0x3da680){if(!_0x3da680){_0x1db934[_0xb11c('0x18')](0x194);}return _0x3da680;};}function handleError(_0x3cf109,_0x2d6b0f){_0x2d6b0f=_0x2d6b0f||0x1f4;return function(_0x13ac78){logger[_0xb11c('0x24')](_0x13ac78['stack']);if(_0x13ac78[_0xb11c('0x25')]){delete _0x13ac78[_0xb11c('0x25')];}_0x3cf109[_0xb11c('0x1a')](_0x2d6b0f)[_0xb11c('0x26')](_0x13ac78);};}exports['index']=function(_0x32d224,_0x276daa){var _0x45c64b={},_0x5a2eda={},_0x3c8b4f={'count':0x0,'rows':[]};var _0x5e40ad=_[_0xb11c('0x27')](db[_0xb11c('0x28')]['rawAttributes'],function(_0x1cd86b){return{'name':_0x1cd86b[_0xb11c('0x29')],'type':_0x1cd86b[_0xb11c('0x2a')][_0xb11c('0x2b')]};});_0x5a2eda[_0xb11c('0x2c')]=_[_0xb11c('0x27')](_0x5e40ad,_0xb11c('0x25'));_0x5a2eda[_0xb11c('0x2d')]=_[_0xb11c('0x2e')](_0x32d224['query']);_0x5a2eda['filters']=_[_0xb11c('0x2f')](_0x5a2eda[_0xb11c('0x2c')],_0x5a2eda[_0xb11c('0x2d')]);_0x45c64b['attributes']=_[_0xb11c('0x2f')](_0x5a2eda['model'],qs[_0xb11c('0x30')](_0x32d224[_0xb11c('0x2d')][_0xb11c('0x30')]));_0x45c64b[_0xb11c('0x31')]=_0x45c64b['attributes']['length']?_0x45c64b['attributes']:_0x5a2eda[_0xb11c('0x2c')];if(!_0x32d224['query'][_0xb11c('0x32')](_0xb11c('0x33'))){_0x45c64b[_0xb11c('0x1e')]=qs[_0xb11c('0x1e')](_0x32d224[_0xb11c('0x2d')][_0xb11c('0x1e')]);_0x45c64b[_0xb11c('0x1d')]=qs[_0xb11c('0x1d')](_0x32d224['query']['offset']);}_0x45c64b['order']=qs[_0xb11c('0x34')](_0x32d224[_0xb11c('0x2d')][_0xb11c('0x34')]);_0x45c64b[_0xb11c('0x35')]=qs[_0xb11c('0x36')](_[_0xb11c('0x37')](_0x32d224[_0xb11c('0x2d')],_0x5a2eda[_0xb11c('0x36')]),_0x5e40ad);if(_0x32d224[_0xb11c('0x2d')]['filter']){_0x45c64b[_0xb11c('0x35')]=_[_0xb11c('0x38')](_0x45c64b['where'],{'$or':_[_0xb11c('0x27')](_0x5e40ad,function(_0x3f6bfb){if(_0x3f6bfb[_0xb11c('0x2a')]!==_0xb11c('0x39')){var _0xc34371={};_0xc34371[_0x3f6bfb[_0xb11c('0x25')]]={'$like':'%'+_0x32d224[_0xb11c('0x2d')][_0xb11c('0x3a')]+'%'};return _0xc34371;}})});}_0x45c64b=_['merge']({},_0x45c64b,_0x32d224[_0xb11c('0x3b')]);var _0x11e941={'where':_0x45c64b['where']};return db[_0xb11c('0x28')][_0xb11c('0x1c')](_0x11e941)[_0xb11c('0x23')](function(_0x106865){_0x3c8b4f[_0xb11c('0x1c')]=_0x106865;if(_0x32d224[_0xb11c('0x2d')]['includeAll']){_0x45c64b[_0xb11c('0x3c')]=[{'all':!![]}];}return db['Migration'][_0xb11c('0x3d')](_0x45c64b);})[_0xb11c('0x23')](function(_0x47d36e){_0x3c8b4f[_0xb11c('0x3e')]=_0x47d36e;return _0x3c8b4f;})[_0xb11c('0x23')](respondWithFilteredResult(_0x276daa,_0x45c64b))['catch'](handleError(_0x276daa,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index 7778b42..66a5a7a 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 _0x0d36=['Migration','migrations','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x5a636f,_0x3fec2b){var _0x6a8cfb=function(_0x20e6ca){while(--_0x20e6ca){_0x5a636f['push'](_0x5a636f['shift']());}};_0x6a8cfb(++_0x3fec2b);}(_0x0d36,0x1bc));var _0x60d3=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0d36[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0x60d3('0x0'));var logger=require(_0x60d3('0x1'))(_0x60d3('0x2'));var moment=require(_0x60d3('0x3'));var BPromise=require(_0x60d3('0x4'));var rp=require(_0x60d3('0x5'));var fs=require('fs');var path=require(_0x60d3('0x6'));var rimraf=require(_0x60d3('0x7'));var config=require(_0x60d3('0x8'));var attributes=require('./migration.attributes');module[_0x60d3('0x9')]=function(_0x2e55fa,_0x750aca){return _0x2e55fa[_0x60d3('0xa')](_0x60d3('0xb'),attributes,{'tableName':_0x60d3('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7593=['request-promise','path','../../config/environment','./migration.attributes','exports','define','Migration','lodash','util','api','moment'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x7593,0xcd));var _0x3759=function(_0x5b0144,_0x48dcce){_0x5b0144=_0x5b0144-0x0;var _0x17903f=_0x7593[_0x5b0144];return _0x17903f;};'use strict';var _=require(_0x3759('0x0'));var util=require(_0x3759('0x1'));var logger=require('../../config/logger')(_0x3759('0x2'));var moment=require(_0x3759('0x3'));var BPromise=require('bluebird');var rp=require(_0x3759('0x4'));var fs=require('fs');var path=require(_0x3759('0x5'));var rimraf=require('rimraf');var config=require(_0x3759('0x6'));var attributes=require(_0x3759('0x7'));module[_0x3759('0x8')]=function(_0x59d405,_0x3e0fc6){return _0x59d405[_0x3759('0x9')](_0x3759('0xa'),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 b67e150..ef6a01f 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 _0x18a9=['then','info','Migration,\x20%s,\x20%s','request\x20sent','Migration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x141d37,_0x436f7b){var _0x2fe4da=function(_0x46679c){while(--_0x46679c){_0x141d37['push'](_0x141d37['shift']());}};_0x2fe4da(++_0x436f7b);}(_0x18a9,0x15b));var _0x918a=function(_0x4e8975,_0xabfb8b){_0x4e8975=_0x4e8975-0x0;var _0x437b49=_0x18a9[_0x4e8975];return _0x437b49;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x918a('0x0'));var BPromise=require(_0x918a('0x1'));var rs=require(_0x918a('0x2'));var fs=require('fs');var Redis=require(_0x918a('0x3'));var db=require(_0x918a('0x4'))['db'];var utils=require(_0x918a('0x5'));var logger=require(_0x918a('0x6'))(_0x918a('0x7'));var config=require(_0x918a('0x8'));var jayson=require(_0x918a('0x9'));var client=jayson[_0x918a('0xa')][_0x918a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x492c39,_0xdb8dd8,_0x266256){return new BPromise(function(_0x51caca,_0x40518f){return client[_0x918a('0xc')](_0x492c39,_0x266256)[_0x918a('0xd')](function(_0x224a87){logger[_0x918a('0xe')](_0x918a('0xf'),_0xdb8dd8,_0x918a('0x10'));logger['debug'](_0x918a('0x11'),_0xdb8dd8,_0x918a('0x10'),JSON[_0x918a('0x12')](_0x224a87));if(_0x224a87[_0x918a('0x13')]){if(_0x224a87['error'][_0x918a('0x14')]===0x1f4){logger[_0x918a('0x13')]('Migration,\x20%s,\x20%s',_0xdb8dd8,_0x224a87[_0x918a('0x13')][_0x918a('0x15')]);return _0x40518f(_0x224a87[_0x918a('0x13')][_0x918a('0x15')]);}logger['error'](_0x918a('0xf'),_0xdb8dd8,_0x224a87['error'][_0x918a('0x15')]);return _0x51caca(_0x224a87['error']['message']);}else{logger[_0x918a('0xe')](_0x918a('0xf'),_0xdb8dd8,'request\x20sent');_0x51caca(_0x224a87[_0x918a('0x16')]['message']);}})[_0x918a('0x17')](function(_0x17f988){logger[_0x918a('0x13')]('Migration,\x20%s,\x20%s',_0xdb8dd8,_0x17f988);_0x40518f(_0x17f988);});});} \ No newline at end of file +var _0x89e8=['randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','request','info','Migration,\x20%s,\x20%s','request\x20sent','Migration,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','bluebird'];(function(_0x4d641e,_0x243f82){var _0x56560e=function(_0x2b0d53){while(--_0x2b0d53){_0x4d641e['push'](_0x4d641e['shift']());}};_0x56560e(++_0x243f82);}(_0x89e8,0x74));var _0x889e=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x89e8[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x889e('0x0'));var util=require(_0x889e('0x1'));var moment=require(_0x889e('0x2'));var BPromise=require(_0x889e('0x3'));var rs=require(_0x889e('0x4'));var fs=require('fs');var Redis=require(_0x889e('0x5'));var db=require(_0x889e('0x6'))['db'];var utils=require(_0x889e('0x7'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x889e('0x8'));var client=jayson[_0x889e('0x9')][_0x889e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5ed85f,_0x38eeae,_0x54f734){return new BPromise(function(_0x2bfae4,_0x42be62){return client[_0x889e('0xb')](_0x5ed85f,_0x54f734)['then'](function(_0x21c1d9){logger[_0x889e('0xc')](_0x889e('0xd'),_0x38eeae,_0x889e('0xe'));logger['debug'](_0x889e('0xf'),_0x38eeae,_0x889e('0xe'),JSON['stringify'](_0x21c1d9));if(_0x21c1d9[_0x889e('0x10')]){if(_0x21c1d9[_0x889e('0x10')][_0x889e('0x11')]===0x1f4){logger[_0x889e('0x10')]('Migration,\x20%s,\x20%s',_0x38eeae,_0x21c1d9[_0x889e('0x10')][_0x889e('0x12')]);return _0x42be62(_0x21c1d9[_0x889e('0x10')]['message']);}logger[_0x889e('0x10')](_0x889e('0xd'),_0x38eeae,_0x21c1d9[_0x889e('0x10')][_0x889e('0x12')]);return _0x2bfae4(_0x21c1d9[_0x889e('0x10')]['message']);}else{logger['info'](_0x889e('0xd'),_0x38eeae,_0x889e('0xe'));_0x2bfae4(_0x21c1d9[_0x889e('0x13')][_0x889e('0x12')]);}})['catch'](function(_0x22fbf6){logger[_0x889e('0x10')]('Migration,\x20%s,\x20%s',_0x38eeae,_0x22fbf6);_0x42be62(_0x22fbf6);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index 9ad9602..be166e5 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 _0xcedf=['create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../config/environment','get','index','/:id','post','isAuthenticated'];(function(_0x136806,_0x3bf842){var _0x22a20f=function(_0x4330f0){while(--_0x4330f0){_0x136806['push'](_0x136806['shift']());}};_0x22a20f(++_0x3bf842);}(_0xcedf,0x1b6));var _0xfced=function(_0x3596d2,_0x37d9a8){_0x3596d2=_0x3596d2-0x0;var _0x3576e2=_0xcedf[_0x3596d2];return _0x3576e2;};'use strict';var multer=require(_0xfced('0x0'));var util=require(_0xfced('0x1'));var path=require(_0xfced('0x2'));var timeout=require(_0xfced('0x3'));var express=require('express');var router=express[_0xfced('0x4')]();var fs_extra=require(_0xfced('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xfced('0x6'));var controller=require('./network.controller');router[_0xfced('0x7')]('/',auth['isAuthenticated'](),controller[_0xfced('0x8')]);router['get'](_0xfced('0x9'),auth['isAuthenticated'](),controller['show']);router[_0xfced('0xa')]('/',auth[_0xfced('0xb')](),controller[_0xfced('0xc')]);router[_0xfced('0xd')]('/:id',auth[_0xfced('0xb')](),controller[_0xfced('0xe')]);router[_0xfced('0xf')](_0xfced('0x9'),auth[_0xfced('0xb')](),controller[_0xfced('0x10')]);module[_0xfced('0x11')]=router; \ No newline at end of file +var _0xb9a7=['get','isAuthenticated','index','/:id','show','create','put','update','delete','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./network.controller'];(function(_0x3652cf,_0x8143a4){var _0x6d1a47=function(_0x3437e1){while(--_0x3437e1){_0x3652cf['push'](_0x3652cf['shift']());}};_0x6d1a47(++_0x8143a4);}(_0xb9a7,0x172));var _0x7b9a=function(_0x2235bf,_0x3a06a7){_0x2235bf=_0x2235bf-0x0;var _0x4c3a64=_0xb9a7[_0x2235bf];return _0x4c3a64;};'use strict';var multer=require(_0x7b9a('0x0'));var util=require('util');var path=require(_0x7b9a('0x1'));var timeout=require(_0x7b9a('0x2'));var express=require(_0x7b9a('0x3'));var router=express[_0x7b9a('0x4')]();var fs_extra=require(_0x7b9a('0x5'));var auth=require(_0x7b9a('0x6'));var interaction=require(_0x7b9a('0x7'));var config=require(_0x7b9a('0x8'));var controller=require(_0x7b9a('0x9'));router[_0x7b9a('0xa')]('/',auth[_0x7b9a('0xb')](),controller[_0x7b9a('0xc')]);router[_0x7b9a('0xa')](_0x7b9a('0xd'),auth[_0x7b9a('0xb')](),controller[_0x7b9a('0xe')]);router['post']('/',auth[_0x7b9a('0xb')](),controller[_0x7b9a('0xf')]);router[_0x7b9a('0x10')](_0x7b9a('0xd'),auth[_0x7b9a('0xb')](),controller[_0x7b9a('0x11')]);router[_0x7b9a('0x12')](_0x7b9a('0xd'),auth[_0x7b9a('0xb')](),controller['destroy']);module[_0x7b9a('0x13')]=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index e35e2b8..61d8085 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 _0xa4b6=['exports','externip','turn','STRING'];(function(_0x409f02,_0x1613db){var _0x28e3e7=function(_0x3b0442){while(--_0x3b0442){_0x409f02['push'](_0x409f02['shift']());}};_0x28e3e7(++_0x1613db);}(_0xa4b6,0xd0));var _0x6a4b=function(_0x17498a,_0x15f23b){_0x17498a=_0x17498a-0x0;var _0x3858cf=_0xa4b6[_0x17498a];return _0x3858cf;};'use strict';var Sequelize=require('sequelize');module[_0x6a4b('0x0')]={'type':{'type':Sequelize['ENUM']('localnet',_0x6a4b('0x1'),'stun',_0x6a4b('0x2'))},'value':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x6a4b('0x3')]},'password':{'type':Sequelize[_0x6a4b('0x3')]}}; \ No newline at end of file +var _0xc385=['stun','turn','STRING','sequelize','exports','ENUM','externip'];(function(_0x108ec4,_0x43f379){var _0x1017de=function(_0xbf7193){while(--_0xbf7193){_0x108ec4['push'](_0x108ec4['shift']());}};_0x1017de(++_0x43f379);}(_0xc385,0x8f));var _0x5c38=function(_0x5a79e2,_0x319b1a){_0x5a79e2=_0x5a79e2-0x0;var _0x266c45=_0xc385[_0x5a79e2];return _0x266c45;};'use strict';var Sequelize=require(_0x5c38('0x0'));module[_0x5c38('0x1')]={'type':{'type':Sequelize[_0x5c38('0x2')]('localnet',_0x5c38('0x3'),_0x5c38('0x4'),_0x5c38('0x5'))},'value':{'type':Sequelize[_0x5c38('0x6')]},'username':{'type':Sequelize[_0x5c38('0x6')]},'password':{'type':Sequelize[_0x5c38('0x6')]}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index df9c8b5..0ca3369 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 _0xe3ab=['count','findAll','rows','show','includeAll','find','sequelize','create','body','STUN','join','root','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','toUpperCase','readFileSync','server/files/templates/turn_multiple.ejs','res_stun_monitor.so','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','transaction','params','TURN','server/files/templates/network.ejs','/etc/asterisk/turn_xcally.conf','chan_sip.so','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','Network,\x20%s,\x20%s','debug','Network,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','sendStatus','status','json','offset','undefined','limit','set','apply','reject','save','update','destroy','end','stack','name','index','Network','rawAttributes','fieldName','type','key','map','query','keys','attributes','intersection','fields','length','model','hasOwnProperty','nolimit','sort','pick','filters','filter','where','merge','VIRTUAL'];(function(_0x3d2494,_0x47489b){var _0x351e9b=function(_0xde8d0d){while(--_0xde8d0d){_0x3d2494['push'](_0x3d2494['shift']());}};_0x351e9b(++_0x47489b);}(_0xe3ab,0x8b));var _0xbe3a=function(_0x2b2a73,_0x360a58){_0x2b2a73=_0x2b2a73-0x0;var _0x1a7615=_0xe3ab[_0x2b2a73];return _0x1a7615;};'use strict';var emlformat=require(_0xbe3a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbe3a('0x1'));var jsonpatch=require(_0xbe3a('0x2'));var rp=require(_0xbe3a('0x3'));var moment=require(_0xbe3a('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xbe3a('0x5'));var util=require('util');var path=require(_0xbe3a('0x6'));var sox=require(_0xbe3a('0x7'));var csv=require(_0xbe3a('0x8'));var ejs=require(_0xbe3a('0x9'));var fs=require('fs');var fs_extra=require(_0xbe3a('0xa'));var _=require(_0xbe3a('0xb'));var squel=require(_0xbe3a('0xc'));var crypto=require(_0xbe3a('0xd'));var jsforce=require(_0xbe3a('0xe'));var deskjs=require(_0xbe3a('0xf'));var toCsv=require(_0xbe3a('0x8'));var querystring=require(_0xbe3a('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xbe3a('0x11'));var qs=require(_0xbe3a('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbe3a('0x13'));var logger=require(_0xbe3a('0x14'))('api');var utils=require(_0xbe3a('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xbe3a('0x16'));var db=require(_0xbe3a('0x17'))['db'];var jayson=require(_0xbe3a('0x18'));var client=jayson[_0xbe3a('0x19')][_0xbe3a('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0x1f460a,_0x1c802e,_0x3f61ae,_0x144b74){return new BPromise(function(_0x1e96b1,_0x4e209f){var _0x2fd64a=_0x144b74||client;return _0x2fd64a[_0xbe3a('0x1b')](_0x1f460a,_0x3f61ae)[_0xbe3a('0x1c')](function(_0x22e7b0){logger[_0xbe3a('0x1d')](_0xbe3a('0x1e'),_0x1c802e,'request\x20sent');logger[_0xbe3a('0x1f')](_0xbe3a('0x20'),_0x1c802e,_0xbe3a('0x21'),JSON['stringify'](_0x22e7b0));if(_0x22e7b0[_0xbe3a('0x22')]){if(_0x22e7b0[_0xbe3a('0x22')][_0xbe3a('0x23')]===0x1f4){logger[_0xbe3a('0x22')](_0xbe3a('0x1e'),_0x1c802e,_0x22e7b0['error'][_0xbe3a('0x24')]);return _0x4e209f(_0x22e7b0[_0xbe3a('0x22')]['message']);}logger[_0xbe3a('0x22')](_0xbe3a('0x1e'),_0x1c802e,_0x22e7b0[_0xbe3a('0x22')]['message']);return _0x1e96b1(_0x22e7b0[_0xbe3a('0x22')][_0xbe3a('0x24')]);}else{logger[_0xbe3a('0x1d')]('Network,\x20%s,\x20%s',_0x1c802e,_0xbe3a('0x21'));_0x1e96b1(_0x22e7b0[_0xbe3a('0x25')][_0xbe3a('0x24')]);}})[_0xbe3a('0x26')](function(_0x5e162f){logger[_0xbe3a('0x22')]('Network,\x20%s,\x20%s',_0x1c802e,_0x5e162f);_0x4e209f(_0x5e162f);});});}function respondWithStatusCode(_0x350f05,_0xd5b18a){_0xd5b18a=_0xd5b18a||0xcc;return function(_0xe9ae43){if(_0xe9ae43){return _0x350f05[_0xbe3a('0x27')](_0xd5b18a);}return _0x350f05[_0xbe3a('0x28')](_0xd5b18a)['end']();};}function respondWithResult(_0x1768d3,_0x4f5bcb){_0x4f5bcb=_0x4f5bcb||0xc8;return function(_0x3d0903){if(_0x3d0903){return _0x1768d3[_0xbe3a('0x28')](_0x4f5bcb)[_0xbe3a('0x29')](_0x3d0903);}};}function respondWithFilteredResult(_0x49b916,_0xc69391){return function(_0x342178){if(_0x342178){var _0x47f470=typeof _0xc69391[_0xbe3a('0x2a')]===_0xbe3a('0x2b')&&typeof _0xc69391['limit']===_0xbe3a('0x2b');var _0x535c3d=_0x342178['count'];var _0x30931b=_0x47f470?0x0:_0xc69391[_0xbe3a('0x2a')];var _0x37aab8=_0x47f470?_0x342178['count']:_0xc69391['offset']+_0xc69391[_0xbe3a('0x2c')];var _0x116517;if(_0x37aab8>=_0x535c3d){_0x37aab8=_0x535c3d;_0x116517=0xc8;}else{_0x116517=0xce;}_0x49b916['status'](_0x116517);return _0x49b916[_0xbe3a('0x2d')]('Content-Range',_0x30931b+'-'+_0x37aab8+'/'+_0x535c3d)[_0xbe3a('0x29')](_0x342178);}return null;};}function patchUpdates(_0x45c025){return function(_0x380997){try{jsonpatch[_0xbe3a('0x2e')](_0x380997,_0x45c025,!![]);}catch(_0x32df3a){return BPromise[_0xbe3a('0x2f')](_0x32df3a);}return _0x380997[_0xbe3a('0x30')]();};}function saveUpdates(_0x46d9ba,_0x267c91){return function(_0x21a4d1){if(_0x21a4d1){return _0x21a4d1[_0xbe3a('0x31')](_0x46d9ba)['then'](function(_0x283b7e){return _0x283b7e;});}return null;};}function removeEntity(_0x4a5730,_0x4c8c75){return function(_0x599697){if(_0x599697){return _0x599697[_0xbe3a('0x32')]()['then'](function(){_0x4a5730[_0xbe3a('0x28')](0xcc)[_0xbe3a('0x33')]();});}};}function handleEntityNotFound(_0x24c0ba,_0x5765b3){return function(_0x2073d4){if(!_0x2073d4){_0x24c0ba[_0xbe3a('0x27')](0x194);}return _0x2073d4;};}function handleError(_0x19ffba,_0x57b430){_0x57b430=_0x57b430||0x1f4;return function(_0x5164e5){logger[_0xbe3a('0x22')](_0x5164e5[_0xbe3a('0x34')]);if(_0x5164e5[_0xbe3a('0x35')]){delete _0x5164e5['name'];}_0x19ffba[_0xbe3a('0x28')](_0x57b430)['send'](_0x5164e5);};}exports[_0xbe3a('0x36')]=function(_0x5ccc79,_0xd112f0){var _0x4acdb4={},_0x29401e={},_0xc58e1e={'count':0x0,'rows':[]};var _0x28741b=_['map'](db[_0xbe3a('0x37')][_0xbe3a('0x38')],function(_0x19f08d){return{'name':_0x19f08d[_0xbe3a('0x39')],'type':_0x19f08d[_0xbe3a('0x3a')][_0xbe3a('0x3b')]};});_0x29401e['model']=_[_0xbe3a('0x3c')](_0x28741b,'name');_0x29401e[_0xbe3a('0x3d')]=_[_0xbe3a('0x3e')](_0x5ccc79[_0xbe3a('0x3d')]);_0x29401e['filters']=_['intersection'](_0x29401e['model'],_0x29401e[_0xbe3a('0x3d')]);_0x4acdb4[_0xbe3a('0x3f')]=_[_0xbe3a('0x40')](_0x29401e['model'],qs['fields'](_0x5ccc79[_0xbe3a('0x3d')][_0xbe3a('0x41')]));_0x4acdb4[_0xbe3a('0x3f')]=_0x4acdb4[_0xbe3a('0x3f')][_0xbe3a('0x42')]?_0x4acdb4[_0xbe3a('0x3f')]:_0x29401e[_0xbe3a('0x43')];if(!_0x5ccc79[_0xbe3a('0x3d')][_0xbe3a('0x44')](_0xbe3a('0x45'))){_0x4acdb4['limit']=qs[_0xbe3a('0x2c')](_0x5ccc79[_0xbe3a('0x3d')][_0xbe3a('0x2c')]);_0x4acdb4[_0xbe3a('0x2a')]=qs[_0xbe3a('0x2a')](_0x5ccc79[_0xbe3a('0x3d')][_0xbe3a('0x2a')]);}_0x4acdb4['order']=qs[_0xbe3a('0x46')](_0x5ccc79['query']['sort']);_0x4acdb4['where']=qs['filters'](_[_0xbe3a('0x47')](_0x5ccc79['query'],_0x29401e[_0xbe3a('0x48')]),_0x28741b);if(_0x5ccc79[_0xbe3a('0x3d')][_0xbe3a('0x49')]){_0x4acdb4[_0xbe3a('0x4a')]=_[_0xbe3a('0x4b')](_0x4acdb4[_0xbe3a('0x4a')],{'$or':_['map'](_0x28741b,function(_0x15590b){if(_0x15590b[_0xbe3a('0x3a')]!==_0xbe3a('0x4c')){var _0x517410={};_0x517410[_0x15590b[_0xbe3a('0x35')]]={'$like':'%'+_0x5ccc79[_0xbe3a('0x3d')][_0xbe3a('0x49')]+'%'};return _0x517410;}})});}_0x4acdb4=_[_0xbe3a('0x4b')]({},_0x4acdb4,_0x5ccc79['options']);var _0x3120c0={'where':_0x4acdb4[_0xbe3a('0x4a')]};return db['Network'][_0xbe3a('0x4d')](_0x3120c0)['then'](function(_0x5936f7){_0xc58e1e['count']=_0x5936f7;if(_0x5ccc79[_0xbe3a('0x3d')]['includeAll']){_0x4acdb4['include']=[{'all':!![]}];}return db['Network'][_0xbe3a('0x4e')](_0x4acdb4);})['then'](function(_0x53d53d){_0xc58e1e[_0xbe3a('0x4f')]=_0x53d53d;return _0xc58e1e;})['then'](respondWithFilteredResult(_0xd112f0,_0x4acdb4))['catch'](handleError(_0xd112f0,null));};exports[_0xbe3a('0x50')]=function(_0x217a4c,_0x4a9e24){var _0x2095db={'raw':!![],'where':{'id':_0x217a4c['params']['id']}},_0x352393={};_0x352393[_0xbe3a('0x43')]=_[_0xbe3a('0x3e')](db[_0xbe3a('0x37')][_0xbe3a('0x38')]);_0x352393[_0xbe3a('0x3d')]=_[_0xbe3a('0x3e')](_0x217a4c[_0xbe3a('0x3d')]);_0x352393[_0xbe3a('0x48')]=_[_0xbe3a('0x40')](_0x352393[_0xbe3a('0x43')],_0x352393[_0xbe3a('0x3d')]);_0x2095db[_0xbe3a('0x3f')]=_['intersection'](_0x352393[_0xbe3a('0x43')],qs[_0xbe3a('0x41')](_0x217a4c['query'][_0xbe3a('0x41')]));_0x2095db[_0xbe3a('0x3f')]=_0x2095db[_0xbe3a('0x3f')]['length']?_0x2095db['attributes']:_0x352393[_0xbe3a('0x43')];if(_0x217a4c[_0xbe3a('0x3d')][_0xbe3a('0x51')]){_0x2095db['include']=[{'all':!![]}];}_0x2095db=_[_0xbe3a('0x4b')]({},_0x2095db,_0x217a4c['options']);return db[_0xbe3a('0x37')][_0xbe3a('0x52')](_0x2095db)[_0xbe3a('0x1c')](handleEntityNotFound(_0x4a9e24,null))['then'](respondWithResult(_0x4a9e24,null))[_0xbe3a('0x26')](handleError(_0x4a9e24,null));};exports['create']=function(_0x581e52,_0x2af840,_0x331282){var _0x526437;return db[_0xbe3a('0x53')]['transaction'](function(_0x5de8e5){return db['Network'][_0xbe3a('0x54')](_0x581e52['body'],{'raw':!![]})['then'](function(_0xcdd84f){_0x526437=_0xcdd84f;return db['Network'][_0xbe3a('0x4e')]({'where':{'type':_0x581e52[_0xbe3a('0x55')]['type']},'raw':!![]});})['then'](function(_0x1098d8){if(_0x526437[_0xbe3a('0x3a')]['toUpperCase']()==_0xbe3a('0x56')){var _0x5ea6d8=fs['readFileSync'](path[_0xbe3a('0x57')](config[_0xbe3a('0x58')],_0xbe3a('0x59')),_0xbe3a('0x5a'));var _0x30fa6f=ejs[_0xbe3a('0x5b')](_0x5ea6d8,{'networks':_0x1098d8||[]});fs[_0xbe3a('0x5c')](_0xbe3a('0x5d'),_0x30fa6f);return respondWithRpcPromise(_0xbe3a('0x5e'),_0xbe3a('0x54'),{'module':'res_stun_monitor.so'});}else if(_0x526437[_0xbe3a('0x3a')][_0xbe3a('0x5f')]()=='TURN'){var _0x95e449=fs[_0xbe3a('0x60')](path['join'](config[_0xbe3a('0x58')],_0xbe3a('0x61')),'utf8');var _0x44f787=ejs[_0xbe3a('0x5b')](_0x95e449,{'networks':_0x1098d8||[]});fs[_0xbe3a('0x5c')]('/etc/asterisk/turn_xcally.conf',_0x44f787);return respondWithRpcPromise(_0xbe3a('0x5e'),_0xbe3a('0x54'),{'module':_0xbe3a('0x62')});}else{var _0xf0e019=fs[_0xbe3a('0x60')](path[_0xbe3a('0x57')](config[_0xbe3a('0x58')],'server/files/templates/network.ejs'),_0xbe3a('0x5a'));var _0x4e5b2c=ejs[_0xbe3a('0x5b')](_0xf0e019,{'networks':_0x1098d8||[]});fs[_0xbe3a('0x5c')](util[_0xbe3a('0x63')](_0xbe3a('0x64'),_0x581e52['body'][_0xbe3a('0x3a')][_0xbe3a('0x65')]()),_0x4e5b2c);return respondWithRpcPromise(_0xbe3a('0x5e'),_0xbe3a('0x54'),{'module':'chan_sip.so'});}return null;})[_0xbe3a('0x1c')](function(){return _0x526437;});})[_0xbe3a('0x1c')](respondWithResult(_0x2af840,0xc9))[_0xbe3a('0x26')](handleError(_0x2af840,null));};exports[_0xbe3a('0x31')]=function(_0xf941b5,_0x550d06,_0x58ae51){var _0x2830cf;return db[_0xbe3a('0x53')][_0xbe3a('0x66')](function(_0x46053c){return db[_0xbe3a('0x37')][_0xbe3a('0x52')]({'where':{'id':_0xf941b5[_0xbe3a('0x67')]['id']}})[_0xbe3a('0x1c')](handleEntityNotFound(_0x550d06,null))[_0xbe3a('0x1c')](saveUpdates(_0xf941b5[_0xbe3a('0x55')],null))[_0xbe3a('0x1c')](function(_0x42a25d){if(_0x42a25d){_0x2830cf=_0x42a25d;return db[_0xbe3a('0x37')][_0xbe3a('0x4e')]({'where':{'type':_0x2830cf['type']},'raw':!![]});}return null;})[_0xbe3a('0x1c')](function(_0x4a9d34){if(_0x2830cf[_0xbe3a('0x3a')][_0xbe3a('0x5f')]()=='STUN'){var _0x5dfc35=fs[_0xbe3a('0x60')](path[_0xbe3a('0x57')](config['root'],_0xbe3a('0x59')),_0xbe3a('0x5a'));var _0x561e3a=ejs[_0xbe3a('0x5b')](_0x5dfc35,{'networks':_0x4a9d34||[]});fs[_0xbe3a('0x5c')](_0xbe3a('0x5d'),_0x561e3a);return respondWithRpcPromise('Reload',_0xbe3a('0x31'),{'module':'res_stun_monitor.so'});}else if(_0x2830cf[_0xbe3a('0x3a')][_0xbe3a('0x5f')]()==_0xbe3a('0x68')){var _0x3d6ee5=fs[_0xbe3a('0x60')](path[_0xbe3a('0x57')](config[_0xbe3a('0x58')],_0xbe3a('0x61')),_0xbe3a('0x5a'));var _0x272db9=ejs['render'](_0x3d6ee5,{'networks':_0x4a9d34||[]});fs[_0xbe3a('0x5c')]('/etc/asterisk/turn_xcally.conf',_0x272db9);return respondWithRpcPromise(_0xbe3a('0x5e'),_0xbe3a('0x31'),{'module':'res_stun_monitor.so'});}else{var _0x1d3848=fs[_0xbe3a('0x60')](path[_0xbe3a('0x57')](config[_0xbe3a('0x58')],_0xbe3a('0x69')),_0xbe3a('0x5a'));var _0x22b532=ejs[_0xbe3a('0x5b')](_0x1d3848,{'networks':_0x4a9d34||[]});fs['writeFileSync'](util[_0xbe3a('0x63')](_0xbe3a('0x64'),_0xf941b5[_0xbe3a('0x55')]['type'][_0xbe3a('0x65')]()),_0x22b532);return respondWithRpcPromise(_0xbe3a('0x5e'),_0xbe3a('0x31'),{'module':'chan_sip.so'});}return null;})[_0xbe3a('0x1c')](function(_0x25cbd3){if(_0x25cbd3){return _0x2830cf;}return null;});})[_0xbe3a('0x1c')](respondWithResult(_0x550d06,null))[_0xbe3a('0x26')](handleError(_0x550d06,null));};exports[_0xbe3a('0x32')]=function(_0x42af2b,_0x33ce77,_0xe4a7e0){var _0x1e9169;return db['Network'][_0xbe3a('0x52')]({'where':{'id':_0x42af2b[_0xbe3a('0x67')]['id']}})[_0xbe3a('0x1c')](function(_0x5a2cbb){_0x1e9169=_0x5a2cbb;return _0x5a2cbb;})[_0xbe3a('0x1c')](handleEntityNotFound(_0x33ce77,null))['then'](removeEntity(_0x33ce77,null))[_0xbe3a('0x1c')](function(){if(_0x1e9169){return db[_0xbe3a('0x37')][_0xbe3a('0x4e')]({'where':{'type':_0x1e9169[_0xbe3a('0x3a')]},'raw':!![]});}})['then'](function(_0x4526ee){if(_0x1e9169[_0xbe3a('0x3a')][_0xbe3a('0x5f')]()==_0xbe3a('0x56')){var _0x1378f9=fs[_0xbe3a('0x60')](path[_0xbe3a('0x57')](config[_0xbe3a('0x58')],_0xbe3a('0x59')),_0xbe3a('0x5a'));var _0x201e86=ejs[_0xbe3a('0x5b')](_0x1378f9,{'networks':_0x4526ee||[]});fs['writeFileSync'](_0xbe3a('0x5d'),_0x201e86);return respondWithRpcPromise(_0xbe3a('0x5e'),_0xbe3a('0x32'),{'module':'res_stun_monitor.so'});}else if(_0x1e9169[_0xbe3a('0x3a')]['toUpperCase']()==_0xbe3a('0x68')){var _0x391f35=fs['readFileSync'](path[_0xbe3a('0x57')](config[_0xbe3a('0x58')],_0xbe3a('0x61')),_0xbe3a('0x5a'));var _0x2cbbed=ejs['render'](_0x391f35,{'networks':_0x4526ee||[]});fs[_0xbe3a('0x5c')](_0xbe3a('0x6a'),_0x2cbbed);return respondWithRpcPromise('Reload',_0xbe3a('0x32'),{'module':_0xbe3a('0x62')});}else{var _0x3a4dad=fs['readFileSync'](path['join'](config['root'],'server/files/templates/network.ejs'),_0xbe3a('0x5a'));var _0x258cce=ejs[_0xbe3a('0x5b')](_0x3a4dad,{'networks':_0x4526ee||[]});fs[_0xbe3a('0x5c')](util[_0xbe3a('0x63')](_0xbe3a('0x64'),_0x42af2b[_0xbe3a('0x55')][_0xbe3a('0x3a')][_0xbe3a('0x65')]()),_0x258cce);return respondWithRpcPromise(_0xbe3a('0x5e'),_0xbe3a('0x32'),{'module':_0xbe3a('0x6b')});}return null;})[_0xbe3a('0x26')](handleError(_0x33ce77,null));}; \ No newline at end of file +var _0x25f0=['query','filters','intersection','fields','attributes','length','nolimit','order','sort','pick','where','VIRTUAL','filter','merge','options','Network','findAll','rows','show','params','keys','includeAll','find','sequelize','transaction','create','body','toUpperCase','readFileSync','join','root','server/files/templates/stun_multiple.ejs','utf8','render','/etc/asterisk/stun_xcally.conf','Reload','TURN','server/files/templates/turn_multiple.ejs','writeFileSync','/etc/asterisk/turn_xcally.conf','res_stun_monitor.so','format','/etc/asterisk/sip_xcally_%s.conf','chan_sip.so','STUN','server/files/templates/network.ejs','toLowerCase','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','request','info','Network,\x20%s,\x20%s','debug','Network,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','reject','save','update','then','name','send','index','map','rawAttributes','fieldName','type','key','model'];(function(_0x385170,_0x212a9c){var _0x1c89d1=function(_0x191ce2){while(--_0x191ce2){_0x385170['push'](_0x385170['shift']());}};_0x1c89d1(++_0x212a9c);}(_0x25f0,0x108));var _0x025f=function(_0x25b657,_0x3f97b6){_0x25b657=_0x25b657-0x0;var _0x491a7b=_0x25f0[_0x25b657];return _0x491a7b;};'use strict';var emlformat=require(_0x025f('0x0'));var rimraf=require(_0x025f('0x1'));var zipdir=require(_0x025f('0x2'));var jsonpatch=require(_0x025f('0x3'));var rp=require(_0x025f('0x4'));var moment=require(_0x025f('0x5'));var BPromise=require(_0x025f('0x6'));var Mustache=require(_0x025f('0x7'));var util=require('util');var path=require(_0x025f('0x8'));var sox=require(_0x025f('0x9'));var csv=require(_0x025f('0xa'));var ejs=require(_0x025f('0xb'));var fs=require('fs');var fs_extra=require(_0x025f('0xc'));var _=require('lodash');var squel=require(_0x025f('0xd'));var crypto=require('crypto');var jsforce=require(_0x025f('0xe'));var deskjs=require(_0x025f('0xf'));var toCsv=require(_0x025f('0xa'));var querystring=require(_0x025f('0x10'));var Papa=require('papaparse');var Redis=require(_0x025f('0x11'));var authService=require(_0x025f('0x12'));var qs=require(_0x025f('0x13'));var as=require(_0x025f('0x14'));var hardwareService=require(_0x025f('0x15'));var logger=require('../../config/logger')(_0x025f('0x16'));var utils=require('../../config/utils');var config=require(_0x025f('0x17'));var licenseUtil=require(_0x025f('0x18'));var db=require(_0x025f('0x19'))['db'];var jayson=require(_0x025f('0x1a'));var client=jayson[_0x025f('0x1b')]['http']({'port':0x232a});function respondWithRpcPromise(_0x311888,_0x226a5b,_0x4e2dbf,_0x4e58ab){return new BPromise(function(_0x51d599,_0x429347){var _0x4a7bf2=_0x4e58ab||client;return _0x4a7bf2[_0x025f('0x1c')](_0x311888,_0x4e2dbf)['then'](function(_0x4ff809){logger[_0x025f('0x1d')](_0x025f('0x1e'),_0x226a5b,'request\x20sent');logger[_0x025f('0x1f')](_0x025f('0x20'),_0x226a5b,'request\x20sent',JSON['stringify'](_0x4ff809));if(_0x4ff809[_0x025f('0x21')]){if(_0x4ff809[_0x025f('0x21')][_0x025f('0x22')]===0x1f4){logger[_0x025f('0x21')](_0x025f('0x1e'),_0x226a5b,_0x4ff809[_0x025f('0x21')][_0x025f('0x23')]);return _0x429347(_0x4ff809['error'][_0x025f('0x23')]);}logger[_0x025f('0x21')](_0x025f('0x1e'),_0x226a5b,_0x4ff809[_0x025f('0x21')][_0x025f('0x23')]);return _0x51d599(_0x4ff809[_0x025f('0x21')]['message']);}else{logger[_0x025f('0x1d')](_0x025f('0x1e'),_0x226a5b,_0x025f('0x24'));_0x51d599(_0x4ff809[_0x025f('0x25')][_0x025f('0x23')]);}})[_0x025f('0x26')](function(_0x4a5615){logger[_0x025f('0x21')](_0x025f('0x1e'),_0x226a5b,_0x4a5615);_0x429347(_0x4a5615);});});}function respondWithStatusCode(_0x30b701,_0x57644c){_0x57644c=_0x57644c||0xcc;return function(_0x39641f){if(_0x39641f){return _0x30b701[_0x025f('0x27')](_0x57644c);}return _0x30b701[_0x025f('0x28')](_0x57644c)['end']();};}function respondWithResult(_0xd1ed05,_0x1c744e){_0x1c744e=_0x1c744e||0xc8;return function(_0xc6a07e){if(_0xc6a07e){return _0xd1ed05['status'](_0x1c744e)[_0x025f('0x29')](_0xc6a07e);}};}function respondWithFilteredResult(_0x519239,_0x56c5e9){return function(_0xf1241d){if(_0xf1241d){var _0x3bcefe=typeof _0x56c5e9[_0x025f('0x2a')]===_0x025f('0x2b')&&typeof _0x56c5e9[_0x025f('0x2c')]===_0x025f('0x2b');var _0x59f838=_0xf1241d[_0x025f('0x2d')];var _0x4fcf50=_0x3bcefe?0x0:_0x56c5e9[_0x025f('0x2a')];var _0x5a05d3=_0x3bcefe?_0xf1241d[_0x025f('0x2d')]:_0x56c5e9[_0x025f('0x2a')]+_0x56c5e9[_0x025f('0x2c')];var _0x532853;if(_0x5a05d3>=_0x59f838){_0x5a05d3=_0x59f838;_0x532853=0xc8;}else{_0x532853=0xce;}_0x519239[_0x025f('0x28')](_0x532853);return _0x519239[_0x025f('0x2e')]('Content-Range',_0x4fcf50+'-'+_0x5a05d3+'/'+_0x59f838)[_0x025f('0x29')](_0xf1241d);}return null;};}function patchUpdates(_0x1c33e7){return function(_0x459ba6){try{jsonpatch['apply'](_0x459ba6,_0x1c33e7,!![]);}catch(_0x1a4336){return BPromise[_0x025f('0x2f')](_0x1a4336);}return _0x459ba6[_0x025f('0x30')]();};}function saveUpdates(_0x147c9e,_0x39a228){return function(_0x21cf18){if(_0x21cf18){return _0x21cf18[_0x025f('0x31')](_0x147c9e)[_0x025f('0x32')](function(_0x42a46c){return _0x42a46c;});}return null;};}function removeEntity(_0x8c7028,_0x354932){return function(_0x2e781a){if(_0x2e781a){return _0x2e781a['destroy']()[_0x025f('0x32')](function(){_0x8c7028[_0x025f('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x409a63,_0x567108){return function(_0x31e24e){if(!_0x31e24e){_0x409a63[_0x025f('0x27')](0x194);}return _0x31e24e;};}function handleError(_0x2ba951,_0xc56c5b){_0xc56c5b=_0xc56c5b||0x1f4;return function(_0xd4b69c){logger[_0x025f('0x21')](_0xd4b69c['stack']);if(_0xd4b69c['name']){delete _0xd4b69c[_0x025f('0x33')];}_0x2ba951['status'](_0xc56c5b)[_0x025f('0x34')](_0xd4b69c);};}exports[_0x025f('0x35')]=function(_0x4aa385,_0x108d3f){var _0xaf7730={},_0x10af68={},_0x1f95c0={'count':0x0,'rows':[]};var _0x521a45=_[_0x025f('0x36')](db['Network'][_0x025f('0x37')],function(_0x2ad718){return{'name':_0x2ad718[_0x025f('0x38')],'type':_0x2ad718[_0x025f('0x39')][_0x025f('0x3a')]};});_0x10af68[_0x025f('0x3b')]=_[_0x025f('0x36')](_0x521a45,_0x025f('0x33'));_0x10af68['query']=_['keys'](_0x4aa385[_0x025f('0x3c')]);_0x10af68[_0x025f('0x3d')]=_[_0x025f('0x3e')](_0x10af68['model'],_0x10af68[_0x025f('0x3c')]);_0xaf7730['attributes']=_['intersection'](_0x10af68['model'],qs[_0x025f('0x3f')](_0x4aa385[_0x025f('0x3c')]['fields']));_0xaf7730[_0x025f('0x40')]=_0xaf7730['attributes'][_0x025f('0x41')]?_0xaf7730[_0x025f('0x40')]:_0x10af68[_0x025f('0x3b')];if(!_0x4aa385[_0x025f('0x3c')]['hasOwnProperty'](_0x025f('0x42'))){_0xaf7730[_0x025f('0x2c')]=qs[_0x025f('0x2c')](_0x4aa385['query'][_0x025f('0x2c')]);_0xaf7730[_0x025f('0x2a')]=qs[_0x025f('0x2a')](_0x4aa385[_0x025f('0x3c')][_0x025f('0x2a')]);}_0xaf7730[_0x025f('0x43')]=qs[_0x025f('0x44')](_0x4aa385[_0x025f('0x3c')][_0x025f('0x44')]);_0xaf7730['where']=qs[_0x025f('0x3d')](_[_0x025f('0x45')](_0x4aa385['query'],_0x10af68[_0x025f('0x3d')]),_0x521a45);if(_0x4aa385[_0x025f('0x3c')]['filter']){_0xaf7730[_0x025f('0x46')]=_['merge'](_0xaf7730['where'],{'$or':_[_0x025f('0x36')](_0x521a45,function(_0x538b75){if(_0x538b75[_0x025f('0x39')]!==_0x025f('0x47')){var _0x252b5d={};_0x252b5d[_0x538b75[_0x025f('0x33')]]={'$like':'%'+_0x4aa385[_0x025f('0x3c')][_0x025f('0x48')]+'%'};return _0x252b5d;}})});}_0xaf7730=_[_0x025f('0x49')]({},_0xaf7730,_0x4aa385[_0x025f('0x4a')]);var _0x2738f8={'where':_0xaf7730['where']};return db[_0x025f('0x4b')][_0x025f('0x2d')](_0x2738f8)[_0x025f('0x32')](function(_0x19dcea){_0x1f95c0[_0x025f('0x2d')]=_0x19dcea;if(_0x4aa385[_0x025f('0x3c')]['includeAll']){_0xaf7730['include']=[{'all':!![]}];}return db[_0x025f('0x4b')][_0x025f('0x4c')](_0xaf7730);})[_0x025f('0x32')](function(_0x380906){_0x1f95c0[_0x025f('0x4d')]=_0x380906;return _0x1f95c0;})[_0x025f('0x32')](respondWithFilteredResult(_0x108d3f,_0xaf7730))[_0x025f('0x26')](handleError(_0x108d3f,null));};exports[_0x025f('0x4e')]=function(_0x1902a9,_0x48a43c){var _0xf58a58={'raw':!![],'where':{'id':_0x1902a9[_0x025f('0x4f')]['id']}},_0x54dfa7={};_0x54dfa7[_0x025f('0x3b')]=_[_0x025f('0x50')](db[_0x025f('0x4b')][_0x025f('0x37')]);_0x54dfa7['query']=_[_0x025f('0x50')](_0x1902a9[_0x025f('0x3c')]);_0x54dfa7[_0x025f('0x3d')]=_['intersection'](_0x54dfa7[_0x025f('0x3b')],_0x54dfa7[_0x025f('0x3c')]);_0xf58a58[_0x025f('0x40')]=_[_0x025f('0x3e')](_0x54dfa7[_0x025f('0x3b')],qs['fields'](_0x1902a9[_0x025f('0x3c')][_0x025f('0x3f')]));_0xf58a58['attributes']=_0xf58a58[_0x025f('0x40')]['length']?_0xf58a58[_0x025f('0x40')]:_0x54dfa7['model'];if(_0x1902a9['query'][_0x025f('0x51')]){_0xf58a58['include']=[{'all':!![]}];}_0xf58a58=_[_0x025f('0x49')]({},_0xf58a58,_0x1902a9[_0x025f('0x4a')]);return db[_0x025f('0x4b')][_0x025f('0x52')](_0xf58a58)['then'](handleEntityNotFound(_0x48a43c,null))['then'](respondWithResult(_0x48a43c,null))['catch'](handleError(_0x48a43c,null));};exports['create']=function(_0x2cb59e,_0x5658b3,_0x856df0){var _0x200c98;return db[_0x025f('0x53')][_0x025f('0x54')](function(_0x56db17){return db[_0x025f('0x4b')][_0x025f('0x55')](_0x2cb59e[_0x025f('0x56')],{'raw':!![]})[_0x025f('0x32')](function(_0x1cc06f){_0x200c98=_0x1cc06f;return db['Network'][_0x025f('0x4c')]({'where':{'type':_0x2cb59e[_0x025f('0x56')][_0x025f('0x39')]},'raw':!![]});})['then'](function(_0x2c3f55){if(_0x200c98[_0x025f('0x39')][_0x025f('0x57')]()=='STUN'){var _0x2288dc=fs[_0x025f('0x58')](path[_0x025f('0x59')](config[_0x025f('0x5a')],_0x025f('0x5b')),_0x025f('0x5c'));var _0x56b0df=ejs[_0x025f('0x5d')](_0x2288dc,{'networks':_0x2c3f55||[]});fs['writeFileSync'](_0x025f('0x5e'),_0x56b0df);return respondWithRpcPromise(_0x025f('0x5f'),_0x025f('0x55'),{'module':'res_stun_monitor.so'});}else if(_0x200c98[_0x025f('0x39')][_0x025f('0x57')]()==_0x025f('0x60')){var _0xaff0bf=fs['readFileSync'](path[_0x025f('0x59')](config[_0x025f('0x5a')],_0x025f('0x61')),_0x025f('0x5c'));var _0x202741=ejs[_0x025f('0x5d')](_0xaff0bf,{'networks':_0x2c3f55||[]});fs[_0x025f('0x62')](_0x025f('0x63'),_0x202741);return respondWithRpcPromise('Reload',_0x025f('0x55'),{'module':_0x025f('0x64')});}else{var _0x5ed54e=fs[_0x025f('0x58')](path[_0x025f('0x59')](config[_0x025f('0x5a')],'server/files/templates/network.ejs'),'utf8');var _0x1465ca=ejs[_0x025f('0x5d')](_0x5ed54e,{'networks':_0x2c3f55||[]});fs[_0x025f('0x62')](util[_0x025f('0x65')](_0x025f('0x66'),_0x2cb59e[_0x025f('0x56')][_0x025f('0x39')]['toLowerCase']()),_0x1465ca);return respondWithRpcPromise('Reload',_0x025f('0x55'),{'module':_0x025f('0x67')});}return null;})[_0x025f('0x32')](function(){return _0x200c98;});})['then'](respondWithResult(_0x5658b3,0xc9))[_0x025f('0x26')](handleError(_0x5658b3,null));};exports[_0x025f('0x31')]=function(_0x2186a1,_0x2d27a2,_0x12f79e){var _0x4438d4;return db['sequelize'][_0x025f('0x54')](function(_0x3200f8){return db[_0x025f('0x4b')]['find']({'where':{'id':_0x2186a1[_0x025f('0x4f')]['id']}})['then'](handleEntityNotFound(_0x2d27a2,null))[_0x025f('0x32')](saveUpdates(_0x2186a1[_0x025f('0x56')],null))[_0x025f('0x32')](function(_0x4d331b){if(_0x4d331b){_0x4438d4=_0x4d331b;return db[_0x025f('0x4b')][_0x025f('0x4c')]({'where':{'type':_0x4438d4[_0x025f('0x39')]},'raw':!![]});}return null;})[_0x025f('0x32')](function(_0x33cbac){if(_0x4438d4[_0x025f('0x39')][_0x025f('0x57')]()==_0x025f('0x68')){var _0x4a62c3=fs[_0x025f('0x58')](path[_0x025f('0x59')](config[_0x025f('0x5a')],_0x025f('0x5b')),_0x025f('0x5c'));var _0x96b0c9=ejs[_0x025f('0x5d')](_0x4a62c3,{'networks':_0x33cbac||[]});fs[_0x025f('0x62')](_0x025f('0x5e'),_0x96b0c9);return respondWithRpcPromise(_0x025f('0x5f'),_0x025f('0x31'),{'module':'res_stun_monitor.so'});}else if(_0x4438d4['type'][_0x025f('0x57')]()==_0x025f('0x60')){var _0x55d8ca=fs[_0x025f('0x58')](path[_0x025f('0x59')](config[_0x025f('0x5a')],'server/files/templates/turn_multiple.ejs'),'utf8');var _0x18aa47=ejs['render'](_0x55d8ca,{'networks':_0x33cbac||[]});fs[_0x025f('0x62')](_0x025f('0x63'),_0x18aa47);return respondWithRpcPromise(_0x025f('0x5f'),_0x025f('0x31'),{'module':_0x025f('0x64')});}else{var _0x908758=fs[_0x025f('0x58')](path[_0x025f('0x59')](config[_0x025f('0x5a')],_0x025f('0x69')),_0x025f('0x5c'));var _0x4620d8=ejs[_0x025f('0x5d')](_0x908758,{'networks':_0x33cbac||[]});fs[_0x025f('0x62')](util[_0x025f('0x65')](_0x025f('0x66'),_0x2186a1[_0x025f('0x56')][_0x025f('0x39')][_0x025f('0x6a')]()),_0x4620d8);return respondWithRpcPromise(_0x025f('0x5f'),_0x025f('0x31'),{'module':'chan_sip.so'});}return null;})[_0x025f('0x32')](function(_0x4bd503){if(_0x4bd503){return _0x4438d4;}return null;});})[_0x025f('0x32')](respondWithResult(_0x2d27a2,null))[_0x025f('0x26')](handleError(_0x2d27a2,null));};exports['destroy']=function(_0x25c4ca,_0x533024,_0x2bb9ce){var _0x49f43a;return db[_0x025f('0x4b')]['find']({'where':{'id':_0x25c4ca[_0x025f('0x4f')]['id']}})[_0x025f('0x32')](function(_0x26d1f6){_0x49f43a=_0x26d1f6;return _0x26d1f6;})['then'](handleEntityNotFound(_0x533024,null))[_0x025f('0x32')](removeEntity(_0x533024,null))[_0x025f('0x32')](function(){if(_0x49f43a){return db[_0x025f('0x4b')]['findAll']({'where':{'type':_0x49f43a[_0x025f('0x39')]},'raw':!![]});}})[_0x025f('0x32')](function(_0x25bc72){if(_0x49f43a['type']['toUpperCase']()==_0x025f('0x68')){var _0x18e0ae=fs['readFileSync'](path[_0x025f('0x59')](config[_0x025f('0x5a')],_0x025f('0x5b')),_0x025f('0x5c'));var _0x2f5a8f=ejs[_0x025f('0x5d')](_0x18e0ae,{'networks':_0x25bc72||[]});fs['writeFileSync'](_0x025f('0x5e'),_0x2f5a8f);return respondWithRpcPromise(_0x025f('0x5f'),_0x025f('0x6b'),{'module':_0x025f('0x64')});}else if(_0x49f43a['type'][_0x025f('0x57')]()==_0x025f('0x60')){var _0x19c3b5=fs[_0x025f('0x58')](path[_0x025f('0x59')](config['root'],_0x025f('0x61')),'utf8');var _0x3c5403=ejs[_0x025f('0x5d')](_0x19c3b5,{'networks':_0x25bc72||[]});fs[_0x025f('0x62')](_0x025f('0x63'),_0x3c5403);return respondWithRpcPromise(_0x025f('0x5f'),'destroy',{'module':_0x025f('0x64')});}else{var _0x28fe74=fs[_0x025f('0x58')](path['join'](config[_0x025f('0x5a')],_0x025f('0x69')),'utf8');var _0x989a42=ejs[_0x025f('0x5d')](_0x28fe74,{'networks':_0x25bc72||[]});fs['writeFileSync'](util[_0x025f('0x65')]('/etc/asterisk/sip_xcally_%s.conf',_0x25c4ca[_0x025f('0x56')]['type'][_0x025f('0x6a')]()),_0x989a42);return respondWithRpcPromise(_0x025f('0x5f'),'destroy',{'module':_0x025f('0x67')});}return null;})['catch'](handleError(_0x533024,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index f41f307..683042f 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 _0x87ae=['define','Network','../../config/logger','bluebird','request-promise','path','../../config/environment','./network.attributes','exports'];(function(_0x34995c,_0x4467ad){var _0x1ede26=function(_0x2ddfbe){while(--_0x2ddfbe){_0x34995c['push'](_0x34995c['shift']());}};_0x1ede26(++_0x4467ad);}(_0x87ae,0xf5));var _0xe87a=function(_0x3de8a4,_0x289a5c){_0x3de8a4=_0x3de8a4-0x0;var _0x4635cf=_0x87ae[_0x3de8a4];return _0x4635cf;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe87a('0x0'))('api');var moment=require('moment');var BPromise=require(_0xe87a('0x1'));var rp=require(_0xe87a('0x2'));var fs=require('fs');var path=require(_0xe87a('0x3'));var rimraf=require('rimraf');var config=require(_0xe87a('0x4'));var attributes=require(_0xe87a('0x5'));module[_0xe87a('0x6')]=function(_0x5ef978,_0x4b9934){return _0x5ef978[_0xe87a('0x7')](_0xe87a('0x8'),attributes,{'tableName':'network','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaaa2=['./network.attributes','exports','define','network','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment'];(function(_0x128152,_0xe6dd67){var _0x417a82=function(_0x517dab){while(--_0x517dab){_0x128152['push'](_0x128152['shift']());}};_0x417a82(++_0xe6dd67);}(_0xaaa2,0xac));var _0x2aaa=function(_0x3ca568,_0x3e5d71){_0x3ca568=_0x3ca568-0x0;var _0xcc04c8=_0xaaa2[_0x3ca568];return _0xcc04c8;};'use strict';var _=require(_0x2aaa('0x0'));var util=require(_0x2aaa('0x1'));var logger=require(_0x2aaa('0x2'))(_0x2aaa('0x3'));var moment=require(_0x2aaa('0x4'));var BPromise=require(_0x2aaa('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2aaa('0x6'));var rimraf=require('rimraf');var config=require(_0x2aaa('0x7'));var attributes=require(_0x2aaa('0x8'));module[_0x2aaa('0x9')]=function(_0x25cb1d,_0x1ef101){return _0x25cb1d[_0x2aaa('0xa')]('Network',attributes,{'tableName':_0x2aaa('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/network/network.rpc.js b/server/api/network/network.rpc.js index 51b6a63..14d7fec 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(_0x5aa15b,_0x189d1a){var _0x162354=function(_0x1dc152){while(--_0x1dc152){_0x5aa15b['push'](_0x5aa15b['shift']());}};_0x162354(++_0x189d1a);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'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 _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(_0x1b9b14,_0x11b8f4){var _0xc197bd=function(_0x18a17e){while(--_0x18a17e){_0x1b9b14['push'](_0x1b9b14['shift']());}};_0xc197bd(++_0x11b8f4);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('Network,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/index.js b/server/api/openchannelAccount/index.js index acf8297..0c136bc 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 _0x95d3=['/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/applications','/:id/interactions','/:id/users','getAgents','post','addDisposition','notify','addApplications','addAgents','/:id/send','put','delete','removeDispositions','removeAnswers','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x7bc16e,_0x190301){var _0x7a6faa=function(_0x33b617){while(--_0x33b617){_0x7bc16e['push'](_0x7bc16e['shift']());}};_0x7a6faa(++_0x190301);}(_0x95d3,0x102));var _0x395d=function(_0x26b2b0,_0x3b5795){_0x26b2b0=_0x26b2b0-0x0;var _0x56b527=_0x95d3[_0x26b2b0];return _0x56b527;};'use strict';var multer=require(_0x395d('0x0'));var util=require(_0x395d('0x1'));var path=require(_0x395d('0x2'));var timeout=require(_0x395d('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x395d('0x4'));var auth=require(_0x395d('0x5'));var interaction=require(_0x395d('0x6'));var config=require(_0x395d('0x7'));var controller=require(_0x395d('0x8'));router[_0x395d('0x9')]('/',auth[_0x395d('0xa')](),controller[_0x395d('0xb')]);router[_0x395d('0x9')](_0x395d('0xc'),auth[_0x395d('0xa')](),controller[_0x395d('0xd')]);router['get'](_0x395d('0xe'),auth[_0x395d('0xa')](),controller[_0x395d('0xf')]);router['get'](_0x395d('0x10'),auth[_0x395d('0xa')](),controller[_0x395d('0x11')]);router[_0x395d('0x9')](_0x395d('0x12'),auth[_0x395d('0xa')](),controller['getAnswers']);router[_0x395d('0x9')](_0x395d('0x13'),auth[_0x395d('0xa')](),controller['getApplications']);router['get'](_0x395d('0x14'),auth[_0x395d('0xa')](),controller['getInteractions']);router[_0x395d('0x9')](_0x395d('0x15'),auth[_0x395d('0xa')](),controller[_0x395d('0x16')]);router[_0x395d('0x17')]('/',auth[_0x395d('0xa')](),controller['create']);router[_0x395d('0x17')](_0x395d('0x10'),auth['isAuthenticated'](),controller[_0x395d('0x18')]);router[_0x395d('0x17')](_0x395d('0x12'),auth['isAuthenticated'](),controller['addAnswer']);router['post']('/:id/notify',controller[_0x395d('0x19')]);router[_0x395d('0x17')](_0x395d('0x13'),auth[_0x395d('0xa')](),controller[_0x395d('0x1a')]);router['post']('/:id/users',auth['isAuthenticated'](),controller[_0x395d('0x1b')]);router[_0x395d('0x17')](_0x395d('0x1c'),auth[_0x395d('0xa')](),controller['send']);router[_0x395d('0x1d')](_0x395d('0xe'),auth[_0x395d('0xa')](),controller['update']);router[_0x395d('0x1e')](_0x395d('0xe'),auth[_0x395d('0xa')](),controller['destroy']);router['delete'](_0x395d('0x10'),auth[_0x395d('0xa')](),controller[_0x395d('0x1f')]);router[_0x395d('0x1e')](_0x395d('0x12'),auth[_0x395d('0xa')](),controller[_0x395d('0x20')]);router[_0x395d('0x1e')](_0x395d('0x15'),auth[_0x395d('0xa')](),controller['removeAgents']);module[_0x395d('0x21')]=router; \ No newline at end of file +var _0x7aa0=['/:id','removeDispositions','removeAnswers','removeAgents','exports','multer','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','isAuthenticated','get','/describe','describe','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','getApplications','/:id/interactions','getInteractions','/:id/users','post','create','addDisposition','/:id/notify','notify','addAgents','/:id/send','send','delete'];(function(_0x29eecd,_0x53cc93){var _0x1299c3=function(_0x47f156){while(--_0x47f156){_0x29eecd['push'](_0x29eecd['shift']());}};_0x1299c3(++_0x53cc93);}(_0x7aa0,0x89));var _0x07aa=function(_0x908f1b,_0x45d206){_0x908f1b=_0x908f1b-0x0;var _0x49dac9=_0x7aa0[_0x908f1b];return _0x49dac9;};'use strict';var multer=require(_0x07aa('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x07aa('0x1'));var express=require(_0x07aa('0x2'));var router=express[_0x07aa('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x07aa('0x4'));var config=require(_0x07aa('0x5'));var controller=require(_0x07aa('0x6'));router['get']('/',auth[_0x07aa('0x7')](),controller['index']);router[_0x07aa('0x8')](_0x07aa('0x9'),auth[_0x07aa('0x7')](),controller[_0x07aa('0xa')]);router[_0x07aa('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x07aa('0x8')](_0x07aa('0xb'),auth[_0x07aa('0x7')](),controller[_0x07aa('0xc')]);router['get'](_0x07aa('0xd'),auth['isAuthenticated'](),controller[_0x07aa('0xe')]);router[_0x07aa('0x8')]('/:id/applications',auth['isAuthenticated'](),controller[_0x07aa('0xf')]);router[_0x07aa('0x8')](_0x07aa('0x10'),auth[_0x07aa('0x7')](),controller[_0x07aa('0x11')]);router['get'](_0x07aa('0x12'),auth[_0x07aa('0x7')](),controller['getAgents']);router[_0x07aa('0x13')]('/',auth['isAuthenticated'](),controller[_0x07aa('0x14')]);router['post'](_0x07aa('0xb'),auth[_0x07aa('0x7')](),controller[_0x07aa('0x15')]);router['post']('/:id/canned_answers',auth[_0x07aa('0x7')](),controller['addAnswer']);router[_0x07aa('0x13')](_0x07aa('0x16'),controller[_0x07aa('0x17')]);router[_0x07aa('0x13')]('/:id/applications',auth[_0x07aa('0x7')](),controller['addApplications']);router['post'](_0x07aa('0x12'),auth[_0x07aa('0x7')](),controller[_0x07aa('0x18')]);router[_0x07aa('0x13')](_0x07aa('0x19'),auth[_0x07aa('0x7')](),controller[_0x07aa('0x1a')]);router['put']('/:id',auth[_0x07aa('0x7')](),controller['update']);router[_0x07aa('0x1b')](_0x07aa('0x1c'),auth[_0x07aa('0x7')](),controller['destroy']);router[_0x07aa('0x1b')](_0x07aa('0xb'),auth[_0x07aa('0x7')](),controller[_0x07aa('0x1d')]);router['delete']('/:id/canned_answers',auth[_0x07aa('0x7')](),controller[_0x07aa('0x1e')]);router[_0x07aa('0x1b')](_0x07aa('0x12'),auth[_0x07aa('0x7')](),controller[_0x07aa('0x1f')]);module[_0x07aa('0x20')]=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index 81a1ed1..0633221 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 _0xe58b=['mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','name','STRING','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue'];(function(_0x2db12b,_0x30ab1d){var _0x20990b=function(_0x589477){while(--_0x589477){_0x2db12b['push'](_0x2db12b['shift']());}};_0x20990b(++_0x30ab1d);}(_0xe58b,0x6e));var _0xbe58=function(_0x4e7f89,_0x128d45){_0x4e7f89=_0x4e7f89-0x0;var _0x512524=_0xe58b[_0x4e7f89];return _0x512524;};'use strict';var Sequelize=require(_0xbe58('0x0'));var rs=require(_0xbe58('0x1'));module[_0xbe58('0x2')]={'name':{'type':Sequelize['STRING'],'unique':_0xbe58('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0xbe58('0x4')]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs['generate']();}},'replyUri':{'type':Sequelize[_0xbe58('0x4')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0xbe58('0x4')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xbe58('0x5');}},'notificationSound':{'type':Sequelize[_0xbe58('0x6')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xbe58('0x6')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xbe58('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0xbe58('0x4')]},'queueTransfer':{'type':Sequelize[_0xbe58('0x6')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xbe58('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xbe58('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xbe58('0x7')],'allowNull':!![],'defaultValue':null,'comment':_0xbe58('0x8')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x59dbce){if(!_0x59dbce)this[_0xbe58('0x9')](_0xbe58('0xa'),null);this[_0xbe58('0x9')](_0xbe58('0xb'),_0x59dbce);}}}; \ No newline at end of file +var _0x44e3=['Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','sequelize','randomstring','exports','STRING','name','generate','TEXT'];(function(_0x2bd0d7,_0x158fb3){var _0x3f3d78=function(_0x204a96){while(--_0x204a96){_0x2bd0d7['push'](_0x2bd0d7['shift']());}};_0x3f3d78(++_0x158fb3);}(_0x44e3,0x10a));var _0x344e=function(_0x6e9828,_0x44399b){_0x6e9828=_0x6e9828-0x0;var _0x20145f=_0x44e3[_0x6e9828];return _0x20145f;};'use strict';var Sequelize=require(_0x344e('0x0'));var rs=require(_0x344e('0x1'));module[_0x344e('0x2')]={'name':{'type':Sequelize[_0x344e('0x3')],'unique':_0x344e('0x4'),'allowNull':![]},'description':{'type':Sequelize[_0x344e('0x3')]},'token':{'type':Sequelize[_0x344e('0x3')],'defaultValue':function(){return rs[_0x344e('0x5')]();}},'replyUri':{'type':Sequelize[_0x344e('0x3')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x344e('0x3')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x344e('0x6')],'defaultValue':function(){return _0x344e('0x7');}},'notificationSound':{'type':Sequelize[_0x344e('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x344e('0x8')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x344e('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x344e('0x3')]},'queueTransfer':{'type':Sequelize[_0x344e('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x344e('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x344e('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x344e('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x344e('0xa')},'mandatoryDisposition':{'type':Sequelize[_0x344e('0x8')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0xb4f4bf){if(!_0xb4f4bf)this[_0x344e('0xb')](_0x344e('0xc'),null);this[_0x344e('0xb')]('mandatoryDisposition',_0xb4f4bf);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index aaf0f0f..d1d1afc 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 _0xa679=['startRouting','EventManager','addApplications','sequelize','findAndCountAll','priority','getApplications','findOne','pick','getInteractions','Contact','User','Owner','internal','Tag','Tags','color','tag','addAgents','omit','userOpenchannelAccount:save','removeAgents','isArray','emit','userOpenchannelAccount:remove','getAgents','body\x20is\x20mandatory\x20and\x20not\x20empty','out','OpenchannelMessage','Messages','dataValues','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./openchannelAccount.socket','register','jayson/promise','http','client','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','json','undefined','offset','limit','Content-Range','apply','update','destroy','end','name','send','index','Pause','mandatoryDispositionPause','map','OpenchannelAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','filter','merge','VIRTUAL','options','count','include','findAll','rows','show','includeAll','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','OpenchannelAccounts','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','params','describe','addDisposition','OpenchannelAccountId','Disposition','getDispositions','sort','removeDispositions','getAnswers','CannedAnswer','removeAnswers','ids','notify','openchannel','CmContact','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','isNil','from','Sequelize','from\x20is\x20mandatory','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','OpenchannelApplication','Applications','applications','list','orderBy','asc','account','contact','firstName','lastName','threadId','externalUrl','OpenchannelInteraction','spread','messageId','interaction','created','autoclose','push','close','unmanaged','AttachmentId','UserId','agent','waitForTheAssignedAgent','*,*,*,*','forcedOwnership','Start'];(function(_0x2ed8f3,_0x4aa12f){var _0x525a55=function(_0x4cfb58){while(--_0x4cfb58){_0x2ed8f3['push'](_0x2ed8f3['shift']());}};_0x525a55(++_0x4aa12f);}(_0xa679,0x1a3));var _0x9a67=function(_0x15760d,_0x271933){_0x15760d=_0x15760d-0x0;var _0x5981ad=_0xa679[_0x15760d];return _0x5981ad;};'use strict';var emlformat=require(_0x9a67('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9a67('0x1'));var jsonpatch=require(_0x9a67('0x2'));var rp=require(_0x9a67('0x3'));var moment=require(_0x9a67('0x4'));var BPromise=require(_0x9a67('0x5'));var Mustache=require(_0x9a67('0x6'));var util=require(_0x9a67('0x7'));var path=require(_0x9a67('0x8'));var sox=require(_0x9a67('0x9'));var csv=require(_0x9a67('0xa'));var ejs=require(_0x9a67('0xb'));var fs=require('fs');var fs_extra=require(_0x9a67('0xc'));var _=require(_0x9a67('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x9a67('0xa'));var querystring=require(_0x9a67('0xe'));var Papa=require('papaparse');var Redis=require(_0x9a67('0xf'));var authService=require(_0x9a67('0x10'));var qs=require(_0x9a67('0x11'));var as=require(_0x9a67('0x12'));var hardwareService=require(_0x9a67('0x13'));var logger=require('../../config/logger')(_0x9a67('0x14'));var utils=require(_0x9a67('0x15'));var config=require(_0x9a67('0x16'));var licenseUtil=require(_0x9a67('0x17'));var db=require(_0x9a67('0x18'))['db'];config[_0x9a67('0x19')]=_[_0x9a67('0x1a')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x9a67('0x1b'))(new Redis(config[_0x9a67('0x19')]));require(_0x9a67('0x1c'))[_0x9a67('0x1d')](socket);var jayson=require(_0x9a67('0x1e'));var client=jayson['client'][_0x9a67('0x1f')]({'port':0x232c});var client9002=jayson[_0x9a67('0x20')][_0x9a67('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x3b917b,_0x445da6,_0x24ca19,_0x3ba6f2){return new BPromise(function(_0x385bcf,_0x1af7a5){var _0x53e41b=_0x3ba6f2||client;return _0x53e41b[_0x9a67('0x21')](_0x3b917b,_0x24ca19)[_0x9a67('0x22')](function(_0x2ee204){logger[_0x9a67('0x23')](_0x9a67('0x24'),_0x445da6,_0x9a67('0x25'));logger[_0x9a67('0x26')](_0x9a67('0x27'),_0x445da6,_0x9a67('0x25'),JSON[_0x9a67('0x28')](_0x2ee204));if(_0x2ee204[_0x9a67('0x29')]){if(_0x2ee204[_0x9a67('0x29')][_0x9a67('0x2a')]===0x1f4){logger['error']('OpenchannelAccount,\x20%s,\x20%s',_0x445da6,_0x2ee204[_0x9a67('0x29')][_0x9a67('0x2b')]);return _0x1af7a5(_0x2ee204['error'][_0x9a67('0x2b')]);}logger['error'](_0x9a67('0x24'),_0x445da6,_0x2ee204['error'][_0x9a67('0x2b')]);return _0x385bcf(_0x2ee204[_0x9a67('0x29')][_0x9a67('0x2b')]);}else{logger['info'](_0x9a67('0x24'),_0x445da6,_0x9a67('0x25'));_0x385bcf(_0x2ee204[_0x9a67('0x2c')]['message']);}})[_0x9a67('0x2d')](function(_0x20b06d){logger[_0x9a67('0x29')]('OpenchannelAccount,\x20%s,\x20%s',_0x445da6,_0x20b06d);_0x1af7a5(_0x20b06d);});});}function respondWithStatusCode(_0x398297,_0x125edd){_0x125edd=_0x125edd||0xcc;return function(_0xf724dc){if(_0xf724dc){return _0x398297[_0x9a67('0x2e')](_0x125edd);}return _0x398297['status'](_0x125edd)['end']();};}function respondWithResult(_0x53c12c,_0x338e63){_0x338e63=_0x338e63||0xc8;return function(_0x511699){if(_0x511699){return _0x53c12c[_0x9a67('0x2f')](_0x338e63)[_0x9a67('0x30')](_0x511699);}};}function respondWithFilteredResult(_0x351adb,_0x573d2b){return function(_0x200d19){if(_0x200d19){var _0xb05ea6=typeof _0x573d2b['offset']===_0x9a67('0x31')&&typeof _0x573d2b['limit']==='undefined';var _0x451c27=_0x200d19['count'];var _0x2b5bf2=_0xb05ea6?0x0:_0x573d2b[_0x9a67('0x32')];var _0x5eaaba=_0xb05ea6?_0x200d19['count']:_0x573d2b[_0x9a67('0x32')]+_0x573d2b[_0x9a67('0x33')];var _0x4343dc;if(_0x5eaaba>=_0x451c27){_0x5eaaba=_0x451c27;_0x4343dc=0xc8;}else{_0x4343dc=0xce;}_0x351adb[_0x9a67('0x2f')](_0x4343dc);return _0x351adb['set'](_0x9a67('0x34'),_0x2b5bf2+'-'+_0x5eaaba+'/'+_0x451c27)['json'](_0x200d19);}return null;};}function patchUpdates(_0xc47f0e){return function(_0x2a71a8){try{jsonpatch[_0x9a67('0x35')](_0x2a71a8,_0xc47f0e,!![]);}catch(_0x5872e3){return BPromise['reject'](_0x5872e3);}return _0x2a71a8['save']();};}function saveUpdates(_0x537640,_0x3baf9a){return function(_0x4725f7){if(_0x4725f7){return _0x4725f7[_0x9a67('0x36')](_0x537640)[_0x9a67('0x22')](function(_0x2d56bb){return _0x2d56bb;});}return null;};}function removeEntity(_0x3aaa78,_0x97101){return function(_0x1844f9){if(_0x1844f9){return _0x1844f9[_0x9a67('0x37')]()[_0x9a67('0x22')](function(){var _0x36a53b=_0x1844f9['get']({'plain':!![]});var _0x536399='OpenchannelAccounts';return db['UserProfileResource'][_0x9a67('0x37')]({'where':{'type':_0x536399,'resourceId':_0x36a53b['id']}})[_0x9a67('0x22')](function(){return _0x1844f9;});})['then'](function(){_0x3aaa78['status'](0xcc)[_0x9a67('0x38')]();});}};}function handleEntityNotFound(_0xdec942,_0x4e5609){return function(_0x5859d1){if(!_0x5859d1){_0xdec942[_0x9a67('0x2e')](0x194);}return _0x5859d1;};}function handleError(_0x561623,_0x164d07){_0x164d07=_0x164d07||0x1f4;return function(_0x207c90){logger[_0x9a67('0x29')](_0x207c90['stack']);if(_0x207c90[_0x9a67('0x39')]){delete _0x207c90[_0x9a67('0x39')];}_0x561623[_0x9a67('0x2f')](_0x164d07)[_0x9a67('0x3a')](_0x207c90);};}exports[_0x9a67('0x3b')]=function(_0xea6b2f,_0x3f50d7){var _0x2d145d={'include':[{'model':db[_0x9a67('0x3c')],'as':_0x9a67('0x3d')}]},_0xb27319={},_0xc82b4f={'count':0x0,'rows':[]};var _0x55a06f=_[_0x9a67('0x3e')](db[_0x9a67('0x3f')][_0x9a67('0x40')],function(_0x539193){return{'name':_0x539193[_0x9a67('0x41')],'type':_0x539193[_0x9a67('0x42')][_0x9a67('0x43')]};});_0xb27319[_0x9a67('0x44')]=_[_0x9a67('0x3e')](_0x55a06f,_0x9a67('0x39'));_0xb27319[_0x9a67('0x45')]=_[_0x9a67('0x46')](_0xea6b2f[_0x9a67('0x45')]);_0xb27319[_0x9a67('0x47')]=_[_0x9a67('0x48')](_0xb27319[_0x9a67('0x44')],_0xb27319[_0x9a67('0x45')]);_0x2d145d[_0x9a67('0x49')]=_[_0x9a67('0x48')](_0xb27319[_0x9a67('0x44')],qs[_0x9a67('0x4a')](_0xea6b2f[_0x9a67('0x45')][_0x9a67('0x4a')]));_0x2d145d[_0x9a67('0x49')]=_0x2d145d[_0x9a67('0x49')][_0x9a67('0x4b')]?_0x2d145d[_0x9a67('0x49')]:_0xb27319[_0x9a67('0x44')];if(!_0xea6b2f['query'][_0x9a67('0x4c')](_0x9a67('0x4d'))){_0x2d145d[_0x9a67('0x33')]=qs[_0x9a67('0x33')](_0xea6b2f['query']['limit']);_0x2d145d[_0x9a67('0x32')]=qs['offset'](_0xea6b2f[_0x9a67('0x45')][_0x9a67('0x32')]);}_0x2d145d[_0x9a67('0x4e')]=qs['sort'](_0xea6b2f[_0x9a67('0x45')]['sort']);_0x2d145d[_0x9a67('0x4f')]=qs[_0x9a67('0x47')](_['pick'](_0xea6b2f['query'],_0xb27319['filters']),_0x55a06f);if(_0xea6b2f[_0x9a67('0x45')][_0x9a67('0x50')]){_0x2d145d[_0x9a67('0x4f')]=_[_0x9a67('0x51')](_0x2d145d[_0x9a67('0x4f')],{'$or':_[_0x9a67('0x3e')](_0x55a06f,function(_0x2aebe6){if(_0x2aebe6[_0x9a67('0x42')]!==_0x9a67('0x52')){var _0x4202b9={};_0x4202b9[_0x2aebe6[_0x9a67('0x39')]]={'$like':'%'+_0xea6b2f[_0x9a67('0x45')][_0x9a67('0x50')]+'%'};return _0x4202b9;}})});}_0x2d145d=_['merge']({},_0x2d145d,_0xea6b2f[_0x9a67('0x53')]);var _0x2e1d1e={'where':_0x2d145d['where']};return db[_0x9a67('0x3f')][_0x9a67('0x54')](_0x2e1d1e)[_0x9a67('0x22')](function(_0x4169a1){_0xc82b4f[_0x9a67('0x54')]=_0x4169a1;if(_0xea6b2f['query']['includeAll']){_0x2d145d[_0x9a67('0x55')]=[{'all':!![]}];}return db['OpenchannelAccount'][_0x9a67('0x56')](_0x2d145d);})[_0x9a67('0x22')](function(_0x405578){_0xc82b4f[_0x9a67('0x57')]=_0x405578;return _0xc82b4f;})[_0x9a67('0x22')](respondWithFilteredResult(_0x3f50d7,_0x2d145d))['catch'](handleError(_0x3f50d7,null));};exports[_0x9a67('0x58')]=function(_0x528b8f,_0x42d817){var _0x307f3b={'raw':![],'where':{'id':_0x528b8f['params']['id']},'include':[{'model':db[_0x9a67('0x3c')],'as':'mandatoryDispositionPause'}]},_0xb89705={};_0xb89705[_0x9a67('0x44')]=_[_0x9a67('0x46')](db[_0x9a67('0x3f')]['rawAttributes']);_0xb89705['query']=_[_0x9a67('0x46')](_0x528b8f[_0x9a67('0x45')]);_0xb89705[_0x9a67('0x47')]=_[_0x9a67('0x48')](_0xb89705['model'],_0xb89705[_0x9a67('0x45')]);_0x307f3b[_0x9a67('0x49')]=_[_0x9a67('0x48')](_0xb89705['model'],qs[_0x9a67('0x4a')](_0x528b8f['query'][_0x9a67('0x4a')]));_0x307f3b['attributes']=_0x307f3b['attributes'][_0x9a67('0x4b')]?_0x307f3b[_0x9a67('0x49')]:_0xb89705['model'];if(_0x528b8f[_0x9a67('0x45')][_0x9a67('0x59')]){_0x307f3b[_0x9a67('0x55')]=[{'all':!![]}];}_0x307f3b=_[_0x9a67('0x51')]({},_0x307f3b,_0x528b8f[_0x9a67('0x53')]);return db[_0x9a67('0x3f')]['find'](_0x307f3b)[_0x9a67('0x22')](handleEntityNotFound(_0x42d817,null))[_0x9a67('0x22')](respondWithResult(_0x42d817,null))[_0x9a67('0x2d')](handleError(_0x42d817,null));};exports[_0x9a67('0x5a')]=function(_0x3cd3db,_0x59f0c6){return db['OpenchannelAccount'][_0x9a67('0x5a')](_0x3cd3db[_0x9a67('0x5b')],{})[_0x9a67('0x22')](function(_0x32f348){var _0x458514=_0x3cd3db[_0x9a67('0x5c')][_0x9a67('0x5d')]({'plain':!![]});if(!_0x458514)throw new Error(_0x9a67('0x5e'));if(_0x458514[_0x9a67('0x5f')]==='user'){var _0x3eae11=_0x32f348[_0x9a67('0x5d')]({'plain':!![]});var _0xdb417a=_0x9a67('0x60');return db[_0x9a67('0x61')]['find']({'where':{'name':_0xdb417a,'userProfileId':_0x458514[_0x9a67('0x62')]},'raw':!![]})['then'](function(_0x182599){if(_0x182599&&_0x182599[_0x9a67('0x63')]===0x0){return db[_0x9a67('0x64')]['create']({'name':_0x3eae11['name'],'resourceId':_0x3eae11['id'],'type':_0x182599['name'],'sectionId':_0x182599['id']},{})[_0x9a67('0x22')](function(){return _0x32f348;});}else{return _0x32f348;}})[_0x9a67('0x2d')](function(_0x3a1a66){logger[_0x9a67('0x29')](_0x9a67('0x65'),_0x3a1a66);throw _0x3a1a66;});}return _0x32f348;})['then'](respondWithResult(_0x59f0c6,0xc9))[_0x9a67('0x2d')](handleError(_0x59f0c6,null));};exports['update']=function(_0x40c720,_0x2cb9b8){if(_0x40c720['body']['id']){delete _0x40c720[_0x9a67('0x5b')]['id'];}return db[_0x9a67('0x3f')][_0x9a67('0x66')]({'where':{'id':_0x40c720[_0x9a67('0x67')]['id']},'include':[{'model':db[_0x9a67('0x3c')],'as':_0x9a67('0x3d')}]})[_0x9a67('0x22')](handleEntityNotFound(_0x2cb9b8,null))[_0x9a67('0x22')](saveUpdates(_0x40c720['body'],null))[_0x9a67('0x22')](respondWithResult(_0x2cb9b8,null))['catch'](handleError(_0x2cb9b8,null));};exports[_0x9a67('0x37')]=function(_0x155105,_0x1d4144){return db[_0x9a67('0x3f')][_0x9a67('0x66')]({'where':{'id':_0x155105[_0x9a67('0x67')]['id']}})[_0x9a67('0x22')](handleEntityNotFound(_0x1d4144,null))[_0x9a67('0x22')](removeEntity(_0x1d4144,null))[_0x9a67('0x2d')](handleError(_0x1d4144,null));};exports[_0x9a67('0x68')]=function(_0x458248,_0x5c774b){return db['OpenchannelAccount'][_0x9a67('0x68')]()['then'](respondWithResult(_0x5c774b,null))[_0x9a67('0x2d')](handleError(_0x5c774b,null));};exports[_0x9a67('0x69')]=function(_0x4684cd,_0x23746c,_0x5d236b){if(_0x4684cd['body']['id']){delete _0x4684cd[_0x9a67('0x5b')]['id'];}return db['OpenchannelAccount']['find']({'where':{'id':_0x4684cd[_0x9a67('0x67')]['id']}})[_0x9a67('0x22')](handleEntityNotFound(_0x23746c,null))[_0x9a67('0x22')](function(_0x27ead5){if(_0x27ead5){_0x4684cd[_0x9a67('0x5b')][_0x9a67('0x6a')]=_0x27ead5['id'];return db[_0x9a67('0x6b')][_0x9a67('0x5a')](_0x4684cd[_0x9a67('0x5b')]);}})[_0x9a67('0x22')](respondWithResult(_0x23746c,null))[_0x9a67('0x2d')](handleError(_0x23746c,null));};exports[_0x9a67('0x6c')]=function(_0x1d69b1,_0x149eca,_0x3a546b){var _0x2501d3={'raw':![],'where':{}};var _0x1d641f={};var _0x55f105={'count':0x0,'rows':[]};return db[_0x9a67('0x3f')]['findOne']({'where':{'id':_0x1d69b1['params']['id']}})[_0x9a67('0x22')](handleEntityNotFound(_0x149eca,null))[_0x9a67('0x22')](function(_0x50e4c0){if(_0x50e4c0){_0x1d641f[_0x9a67('0x44')]=_['keys'](db[_0x9a67('0x6b')]['rawAttributes']);_0x1d641f['query']=_[_0x9a67('0x46')](_0x1d69b1['query']);_0x1d641f[_0x9a67('0x47')]=_[_0x9a67('0x48')](_0x1d641f[_0x9a67('0x44')],_0x1d641f['query']);_0x2501d3[_0x9a67('0x49')]=_[_0x9a67('0x48')](_0x1d641f['model'],qs['fields'](_0x1d69b1[_0x9a67('0x45')][_0x9a67('0x4a')]));_0x2501d3['attributes']=_0x2501d3[_0x9a67('0x49')][_0x9a67('0x4b')]?_0x2501d3[_0x9a67('0x49')]:_0x1d641f[_0x9a67('0x44')];if(!_0x1d69b1['query'][_0x9a67('0x4c')](_0x9a67('0x4d'))){_0x2501d3[_0x9a67('0x33')]=qs['limit'](_0x1d69b1[_0x9a67('0x45')]['limit']);_0x2501d3[_0x9a67('0x32')]=qs['offset'](_0x1d69b1[_0x9a67('0x45')][_0x9a67('0x32')]);}_0x2501d3[_0x9a67('0x4e')]=qs[_0x9a67('0x6d')](_0x1d69b1['query'][_0x9a67('0x6d')]);_0x2501d3['where']=qs['filters'](_['pick'](_0x1d69b1[_0x9a67('0x45')],_0x1d641f[_0x9a67('0x47')]));_0x2501d3[_0x9a67('0x4f')]['OpenchannelAccountId']=_0x50e4c0['id'];if(_0x1d69b1[_0x9a67('0x45')][_0x9a67('0x50')]){_0x2501d3[_0x9a67('0x4f')]=_[_0x9a67('0x51')](_0x2501d3[_0x9a67('0x4f')],{'$or':_[_0x9a67('0x3e')](_0x2501d3[_0x9a67('0x49')],function(_0x197330){var _0x1e5f7d={};_0x1e5f7d[_0x197330]={'$like':'%'+_0x1d69b1[_0x9a67('0x45')][_0x9a67('0x50')]+'%'};return _0x1e5f7d;})});}_0x2501d3=_[_0x9a67('0x51')]({},_0x2501d3,_0x1d69b1[_0x9a67('0x53')]);return db['Disposition'][_0x9a67('0x54')]({'where':_0x2501d3[_0x9a67('0x4f')]})[_0x9a67('0x22')](function(_0x5915ba){_0x55f105[_0x9a67('0x54')]=_0x5915ba;if(_0x1d69b1[_0x9a67('0x45')][_0x9a67('0x59')]){_0x2501d3['include']=[{'all':!![]}];}return db[_0x9a67('0x6b')][_0x9a67('0x56')](_0x2501d3);})[_0x9a67('0x22')](function(_0x212ec8){_0x55f105[_0x9a67('0x57')]=_0x212ec8;return _0x55f105;});}})[_0x9a67('0x22')](respondWithFilteredResult(_0x149eca,_0x2501d3))[_0x9a67('0x2d')](handleError(_0x149eca,null));};exports[_0x9a67('0x6e')]=function(_0x2fe2bb,_0x30a4b2,_0x5e23ba){return db[_0x9a67('0x3f')][_0x9a67('0x66')]({'where':{'id':_0x2fe2bb[_0x9a67('0x67')]['id']}})[_0x9a67('0x22')](handleEntityNotFound(_0x30a4b2,null))[_0x9a67('0x22')](function(_0x4625b3){if(_0x4625b3){return _0x4625b3['removeDispositions'](_0x2fe2bb[_0x9a67('0x45')]['ids']);}})[_0x9a67('0x22')](respondWithStatusCode(_0x30a4b2,null))['catch'](handleError(_0x30a4b2,null));};exports['addAnswer']=function(_0x164d35,_0x56703c,_0x15dd88){if(_0x164d35['body']['id']){delete _0x164d35[_0x9a67('0x5b')]['id'];}return db[_0x9a67('0x3f')][_0x9a67('0x66')]({'where':{'id':_0x164d35[_0x9a67('0x67')]['id']}})['then'](handleEntityNotFound(_0x56703c,null))[_0x9a67('0x22')](function(_0x327448){if(_0x327448){_0x164d35[_0x9a67('0x5b')][_0x9a67('0x6a')]=_0x327448['id'];return db['CannedAnswer'][_0x9a67('0x5a')](_0x164d35[_0x9a67('0x5b')]);}})[_0x9a67('0x22')](respondWithResult(_0x56703c,null))[_0x9a67('0x2d')](handleError(_0x56703c,null));};exports[_0x9a67('0x6f')]=function(_0x12ab64,_0x5e6677,_0x3d0b80){var _0x3e9380={'raw':![],'where':{}};var _0x469f13={};var _0x5a2096={'count':0x0,'rows':[]};return db[_0x9a67('0x3f')]['findOne']({'where':{'id':_0x12ab64[_0x9a67('0x67')]['id']}})[_0x9a67('0x22')](handleEntityNotFound(_0x5e6677,null))[_0x9a67('0x22')](function(_0x1f6a98){if(_0x1f6a98){_0x469f13[_0x9a67('0x44')]=_[_0x9a67('0x46')](db[_0x9a67('0x70')][_0x9a67('0x40')]);_0x469f13[_0x9a67('0x45')]=_[_0x9a67('0x46')](_0x12ab64[_0x9a67('0x45')]);_0x469f13[_0x9a67('0x47')]=_[_0x9a67('0x48')](_0x469f13[_0x9a67('0x44')],_0x469f13[_0x9a67('0x45')]);_0x3e9380[_0x9a67('0x49')]=_[_0x9a67('0x48')](_0x469f13['model'],qs['fields'](_0x12ab64[_0x9a67('0x45')][_0x9a67('0x4a')]));_0x3e9380[_0x9a67('0x49')]=_0x3e9380[_0x9a67('0x49')]['length']?_0x3e9380['attributes']:_0x469f13[_0x9a67('0x44')];if(!_0x12ab64['query'][_0x9a67('0x4c')]('nolimit')){_0x3e9380[_0x9a67('0x33')]=qs['limit'](_0x12ab64[_0x9a67('0x45')]['limit']);_0x3e9380[_0x9a67('0x32')]=qs[_0x9a67('0x32')](_0x12ab64[_0x9a67('0x45')][_0x9a67('0x32')]);}_0x3e9380[_0x9a67('0x4e')]=qs[_0x9a67('0x6d')](_0x12ab64[_0x9a67('0x45')][_0x9a67('0x6d')]);_0x3e9380['where']=qs[_0x9a67('0x47')](_['pick'](_0x12ab64[_0x9a67('0x45')],_0x469f13['filters']));_0x3e9380[_0x9a67('0x4f')][_0x9a67('0x6a')]=_0x1f6a98['id'];if(_0x12ab64[_0x9a67('0x45')][_0x9a67('0x50')]){_0x3e9380[_0x9a67('0x4f')]=_['merge'](_0x3e9380[_0x9a67('0x4f')],{'$or':_[_0x9a67('0x3e')](_0x3e9380[_0x9a67('0x49')],function(_0x4ec9f0){var _0x3d8d62={};_0x3d8d62[_0x4ec9f0]={'$like':'%'+_0x12ab64[_0x9a67('0x45')][_0x9a67('0x50')]+'%'};return _0x3d8d62;})});}_0x3e9380=_[_0x9a67('0x51')]({},_0x3e9380,_0x12ab64[_0x9a67('0x53')]);return db['CannedAnswer'][_0x9a67('0x54')]({'where':_0x3e9380[_0x9a67('0x4f')]})[_0x9a67('0x22')](function(_0x3128fd){_0x5a2096[_0x9a67('0x54')]=_0x3128fd;if(_0x12ab64[_0x9a67('0x45')][_0x9a67('0x59')]){_0x3e9380[_0x9a67('0x55')]=[{'all':!![]}];}return db[_0x9a67('0x70')][_0x9a67('0x56')](_0x3e9380);})[_0x9a67('0x22')](function(_0x5ae208){_0x5a2096['rows']=_0x5ae208;return _0x5a2096;});}})['then'](respondWithFilteredResult(_0x5e6677,_0x3e9380))[_0x9a67('0x2d')](handleError(_0x5e6677,null));};exports[_0x9a67('0x71')]=function(_0x1c7def,_0x572aa7,_0x2d5a9e){return db[_0x9a67('0x3f')][_0x9a67('0x66')]({'where':{'id':_0x1c7def[_0x9a67('0x67')]['id']}})['then'](handleEntityNotFound(_0x572aa7,null))[_0x9a67('0x22')](function(_0x47cba0){if(_0x47cba0){return _0x47cba0['removeAnswers'](_0x1c7def[_0x9a67('0x45')][_0x9a67('0x72')]);}})[_0x9a67('0x22')](respondWithStatusCode(_0x572aa7,null))['catch'](handleError(_0x572aa7,null));};exports[_0x9a67('0x73')]=function(_0x3da1fb,_0x1c151e,_0x3e73fd){var _0x432553={'body':_0x3da1fb['body'],'channel':_0x9a67('0x74')};var _0x52ec09=[];var _0x2bf9f8=[];var _0x42bca8={};var _0x5593b1=![];return db[_0x9a67('0x75')][_0x9a67('0x68')]()['then'](function(_0x1c1007){if(!_0x1c1007){throw new db['Sequelize'][(_0x9a67('0x76'))](_0x9a67('0x77'));}_0x52ec09=_[_0x9a67('0x78')](_['keys'](_0x1c1007),[_0x9a67('0x79'),_0x9a67('0x7a')]);_0x2bf9f8=_[_0x9a67('0x78')](_['keys'](_0x1c1007),['createdAt',_0x9a67('0x7a'),'CompanyId',_0x9a67('0x7b')]);if(_0x3da1fb[_0x9a67('0x5b')]['id']){delete _0x3da1fb[_0x9a67('0x5b')]['id'];}if(_[_0x9a67('0x7c')](_0x3da1fb[_0x9a67('0x5b')][_0x9a67('0x7d')])){throw new db[(_0x9a67('0x7e'))][(_0x9a67('0x76'))](_0x9a67('0x7f'));}if(_[_0x9a67('0x7c')](_0x3da1fb[_0x9a67('0x5b')][_0x9a67('0x5b')])||_0x3da1fb[_0x9a67('0x5b')][_0x9a67('0x5b')]===''){throw new db[(_0x9a67('0x7e'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x3da1fb[_0x9a67('0x5b')]['mapKey'])){throw new db[(_0x9a67('0x7e'))][(_0x9a67('0x76'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x2bf9f8);}if(!_[_0x9a67('0x80')](_0x2bf9f8,_0x3da1fb['body'][_0x9a67('0x81')])){throw new db['Sequelize'][(_0x9a67('0x76'))](_0x9a67('0x82')+_0x2bf9f8);}_0x42bca8[_0x3da1fb[_0x9a67('0x5b')][_0x9a67('0x81')]]=_0x3da1fb[_0x9a67('0x5b')][_0x9a67('0x7d')];})[_0x9a67('0x22')](function(){return db[_0x9a67('0x3f')]['find']({'where':{'id':_0x3da1fb[_0x9a67('0x67')]['id']},'include':[{'model':db[_0x9a67('0x83')],'as':_0x9a67('0x84'),'include':[{'model':db['CmContact'],'as':_0x9a67('0x85'),'where':_0x42bca8,'limit':0x1,'order':[[_0x9a67('0x7a'),_0x9a67('0x86')]]}]},{'model':db[_0x9a67('0x87')],'as':_0x9a67('0x88')}]});})[_0x9a67('0x22')](handleEntityNotFound(_0x1c151e,null))[_0x9a67('0x22')](function(_0x33370a){if(_0x33370a&&_0x33370a[_0x9a67('0x84')]){_0x432553['account']=_0x33370a;_0x432553[_0x9a67('0x89')]=_0x33370a[_0x9a67('0x88')];_0x432553[_0x9a67('0x8a')]=_0x33370a['List'];_0x432553[_0x9a67('0x89')]=_[_0x9a67('0x8b')](_0x432553[_0x9a67('0x89')],['priority'],[_0x9a67('0x8c')]);if(_0x432553[_0x9a67('0x8d')][_0x9a67('0x88')]){delete _0x432553[_0x9a67('0x8d')]['Applications'];}if(_0x432553[_0x9a67('0x8d')][_0x9a67('0x84')]&&_0x432553['account'][_0x9a67('0x84')][_0x9a67('0x85')][_0x9a67('0x4b')]){return _0x432553['account'][_0x9a67('0x84')]['Contacts'][0x0];}var _0x561694=_['defaults'](_0x3da1fb['body'],{'firstName':_0x3da1fb[_0x9a67('0x5b')][_0x9a67('0x7d')],'ListId':_0x33370a[_0x9a67('0x7b')]});_0x561694[_0x3da1fb['body']['mapKey']]=_0x3da1fb[_0x9a67('0x5b')]['from'];return db[_0x9a67('0x75')][_0x9a67('0x5a')](_0x561694,{'fields':_0x52ec09,'raw':!![]});}})['then'](handleEntityNotFound(_0x1c151e,null))[_0x9a67('0x22')](function(_0x4397bd){_0x432553[_0x9a67('0x8e')]=_0x4397bd;if(_0x4397bd){var _0xe0f18b={'ContactId':_0x4397bd['id'],'OpenchannelAccountId':_0x3da1fb['params']['id'],'from':(_0x4397bd[_0x9a67('0x8f')]||'')+'\x20'+(_0x4397bd[_0x9a67('0x90')]||'')};var _0x35569e={'OpenchannelAccountId':_0x3da1fb[_0x9a67('0x67')]['id'],'closed':![]};if(_0x3da1fb[_0x9a67('0x5b')][_0x9a67('0x91')]){_0x35569e['threadId']=_0x3da1fb[_0x9a67('0x5b')]['threadId'];return db['OpenchannelInteraction'][_0x9a67('0x66')]({'where':_0x35569e})[_0x9a67('0x22')](function(_0x27b08e){if(_0x27b08e){return[_0x27b08e,![]];}_0xe0f18b[_0x9a67('0x91')]=_0x3da1fb[_0x9a67('0x5b')][_0x9a67('0x91')];_0xe0f18b[_0x9a67('0x92')]=_0x3da1fb[_0x9a67('0x5b')]['externalUrl'];return db[_0x9a67('0x93')][_0x9a67('0x5a')](_0xe0f18b)['then'](function(_0x2ed874){return[_0x2ed874,!![]];});});}else{_0x35569e[_0x9a67('0x91')]=null;}_0x35569e['ContactId']=_0x4397bd['id'];return db['OpenchannelInteraction']['find']({'where':_0x35569e})[_0x9a67('0x22')](function(_0x17f7ab){if(_0x17f7ab){return[_0x17f7ab,![]];}return db[_0x9a67('0x93')][_0x9a67('0x5a')](_0xe0f18b)[_0x9a67('0x22')](function(_0x3868ce){return[_0x3868ce,!![]];});});}})[_0x9a67('0x94')](function(_0x6114,_0x4ff596){if(_0x6114){_0x5593b1=_0x4ff596;if(!_0x4ff596){var _0x47ebf3={'from':(_0x432553['contact'][_0x9a67('0x8f')]||'')+'\x20'+(_0x432553['contact'][_0x9a67('0x90')]||'')};if(_0x3da1fb[_0x9a67('0x5b')][_0x9a67('0x91')]&&_0x3da1fb[_0x9a67('0x5b')][_0x9a67('0x95')]&&_0x3da1fb[_0x9a67('0x5b')][_0x9a67('0x91')]!=_0x3da1fb[_0x9a67('0x5b')][_0x9a67('0x95')]){_0x47ebf3[_0x9a67('0x91')]=_0x3da1fb[_0x9a67('0x5b')][_0x9a67('0x95')];}return _0x6114['update'](_0x47ebf3);}else{return _0x6114;}}})['then'](function(_0x42e0e4){_0x432553[_0x9a67('0x96')]=_0x42e0e4['get']({'plain':!![]});_0x432553[_0x9a67('0x96')][_0x9a67('0x97')]=_0x5593b1;if(_0x432553[_0x9a67('0x96')]['created']){if(_0x432553[_0x9a67('0x8d')][_0x9a67('0x98')]){_0x432553[_0x9a67('0x89')][_0x9a67('0x99')]({'id':0x0,'priority':_0x432553[_0x9a67('0x89')]['length']+0x1,'app':_0x9a67('0x9a'),'appdata':_0x9a67('0x9b'),'interval':'*,*,*,*'});}}return db['OpenchannelMessage']['create']({'body':_0x3da1fb[_0x9a67('0x5b')]['body'],'OpenchannelAccountId':_0x3da1fb['params']['id'],'OpenchannelInteractionId':_0x42e0e4['id'],'direction':'in','ContactId':_0x432553[_0x9a67('0x8e')]['id'],'AttachmentId':_0x3da1fb[_0x9a67('0x5b')][_0x9a67('0x9c')]});})[_0x9a67('0x22')](function(_0x39ba5c){_0x432553[_0x9a67('0x2b')]=_0x39ba5c;if(_0x432553[_0x9a67('0x96')][_0x9a67('0x9d')]){return db['User']['find']({'attributes':['id',_0x9a67('0x39')],'where':{'id':_0x432553[_0x9a67('0x96')]['UserId']}})[_0x9a67('0x22')](function(_0x5f19f0){if(_0x5f19f0){_0x432553[_0x9a67('0x89')]['unshift']({'id':0x0,'priority':0x0,'app':_0x9a67('0x9e'),'appdata':_0x5f19f0[_0x9a67('0x39')]+','+(_0x432553[_0x9a67('0x8d')][_0x9a67('0x9f')]||0xa),'interval':_0x9a67('0xa0')});_0x432553[_0x9a67('0xa1')]=![];}return respondWithRpcPromise('Start','startRouting',_0x432553);});}return respondWithRpcPromise(_0x9a67('0xa2'),_0x9a67('0xa3'),_0x432553);})['then'](function(_0x343de6){respondWithRpcPromise(_0x9a67('0xa4'),_0x9a67('0xa4'),{'event':_0x9a67('0x73'),'message':_0x343de6},client9002);return _0x343de6;})['then'](respondWithResult(_0x1c151e,null))[_0x9a67('0x2d')](handleError(_0x1c151e,null));};exports[_0x9a67('0xa5')]=function(_0x120b95,_0x3b8a70,_0x2679c7){return db[_0x9a67('0x3f')]['findOne']({'where':{'id':_0x120b95[_0x9a67('0x67')]['id']}})[_0x9a67('0x22')](handleEntityNotFound(_0x3b8a70,null))[_0x9a67('0x22')](function(_0x1e5bfb){if(_0x1e5bfb){return db[_0x9a67('0xa6')]['transaction'](function(_0x52354d){return db[_0x9a67('0x87')][_0x9a67('0x37')]({'where':{'OpenchannelAccountId':_0x120b95[_0x9a67('0x67')]['id']},'transaction':_0x52354d})['then'](function(_0x6b4636){var _0x34ebaf=_[_0x9a67('0x3e')](_0x120b95['body'],function(_0x2720b4){_0x2720b4[_0x9a67('0x6a')]=_0x120b95[_0x9a67('0x67')]['id'];return _0x2720b4;});return db[_0x9a67('0x87')]['bulkCreate'](_0x34ebaf,{'transaction':_0x52354d});});})['then'](function(){return db[_0x9a67('0x87')][_0x9a67('0xa7')]({'where':{'OpenchannelAccountId':_0x120b95[_0x9a67('0x67')]['id']},'order':_0x9a67('0xa8')});});}})['then'](respondWithResult(_0x3b8a70,null))[_0x9a67('0x2d')](handleError(_0x3b8a70,null));};exports[_0x9a67('0xa9')]=function(_0x2a4181,_0x294659,_0x5b6a8f){var _0x4c88c1={};var _0x598d43={};var _0x4a297d;var _0x456ac4;return db[_0x9a67('0x3f')][_0x9a67('0xaa')]({'where':{'id':_0x2a4181['params']['id']}})[_0x9a67('0x22')](handleEntityNotFound(_0x294659,null))['then'](function(_0x2e2c3e){if(_0x2e2c3e){_0x4a297d=_0x2e2c3e;_0x598d43[_0x9a67('0x44')]=_[_0x9a67('0x46')](db[_0x9a67('0x87')]['rawAttributes']);_0x598d43['query']=_[_0x9a67('0x46')](_0x2a4181['query']);_0x598d43[_0x9a67('0x47')]=_[_0x9a67('0x48')](_0x598d43[_0x9a67('0x44')],_0x598d43[_0x9a67('0x45')]);_0x4c88c1['attributes']=_['intersection'](_0x598d43[_0x9a67('0x44')],qs[_0x9a67('0x4a')](_0x2a4181[_0x9a67('0x45')][_0x9a67('0x4a')]));_0x4c88c1[_0x9a67('0x49')]=_0x4c88c1[_0x9a67('0x49')]['length']?_0x4c88c1[_0x9a67('0x49')]:_0x598d43[_0x9a67('0x44')];_0x4c88c1[_0x9a67('0x4e')]=qs[_0x9a67('0x6d')](_0x2a4181[_0x9a67('0x45')]['sort']);_0x4c88c1[_0x9a67('0x4f')]=qs[_0x9a67('0x47')](_[_0x9a67('0xab')](_0x2a4181[_0x9a67('0x45')],_0x598d43[_0x9a67('0x47')]));if(_0x2a4181[_0x9a67('0x45')][_0x9a67('0x50')]){_0x4c88c1[_0x9a67('0x4f')]=_[_0x9a67('0x51')](_0x4c88c1[_0x9a67('0x4f')],{'$or':_[_0x9a67('0x3e')](_0x4c88c1[_0x9a67('0x49')],function(_0x2d14a4){var _0x1a669f={};_0x1a669f[_0x2d14a4]={'$like':'%'+_0x2a4181['query'][_0x9a67('0x50')]+'%'};return _0x1a669f;})});}_0x4c88c1=_[_0x9a67('0x51')]({},_0x4c88c1,_0x2a4181['options']);return _0x4a297d[_0x9a67('0xa9')](_0x4c88c1);}})[_0x9a67('0x22')](function(_0x3b432b){if(_0x3b432b){_0x456ac4=_0x3b432b['length'];if(!_0x2a4181['query'][_0x9a67('0x4c')](_0x9a67('0x4d'))){_0x4c88c1[_0x9a67('0x33')]=qs['limit'](_0x2a4181[_0x9a67('0x45')]['limit']);_0x4c88c1[_0x9a67('0x32')]=qs['offset'](_0x2a4181['query']['offset']);}return _0x4a297d[_0x9a67('0xa9')](_0x4c88c1);}})[_0x9a67('0x22')](function(_0x3b73d6){if(_0x3b73d6){return _0x3b73d6?{'count':_0x456ac4,'rows':_0x3b73d6}:null;}})['then'](respondWithResult(_0x294659,null))[_0x9a67('0x2d')](handleError(_0x294659,null));};exports[_0x9a67('0xac')]=function(_0x1503c4,_0x310982,_0xe4122b){var _0x413ea5={'raw':![],'where':{}};var _0x5076e9={};var _0x461e37={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x9a67('0xaa')]({'where':{'id':_0x1503c4[_0x9a67('0x67')]['id']}})[_0x9a67('0x22')](handleEntityNotFound(_0x310982,null))['then'](function(_0x13eee5){if(_0x13eee5){_0x5076e9[_0x9a67('0x44')]=_[_0x9a67('0x46')](db['OpenchannelInteraction'][_0x9a67('0x40')]);_0x5076e9[_0x9a67('0x45')]=_['keys'](_0x1503c4[_0x9a67('0x45')]);_0x5076e9[_0x9a67('0x47')]=_['intersection'](_0x5076e9['model'],_0x5076e9[_0x9a67('0x45')]);_0x413ea5[_0x9a67('0x49')]=_[_0x9a67('0x48')](_0x5076e9[_0x9a67('0x44')],qs['fields'](_0x1503c4[_0x9a67('0x45')]['fields']));_0x413ea5[_0x9a67('0x49')]=_0x413ea5[_0x9a67('0x49')]['length']?_0x413ea5[_0x9a67('0x49')]:_0x5076e9[_0x9a67('0x44')];if(!_0x1503c4[_0x9a67('0x45')][_0x9a67('0x4c')](_0x9a67('0x4d'))){_0x413ea5[_0x9a67('0x33')]=qs['limit'](_0x1503c4[_0x9a67('0x45')][_0x9a67('0x33')]);_0x413ea5[_0x9a67('0x32')]=qs[_0x9a67('0x32')](_0x1503c4[_0x9a67('0x45')][_0x9a67('0x32')]);}_0x413ea5[_0x9a67('0x4e')]=qs[_0x9a67('0x6d')](_0x1503c4['query']['sort']);_0x413ea5[_0x9a67('0x4f')]=qs[_0x9a67('0x47')](_[_0x9a67('0xab')](_0x1503c4[_0x9a67('0x45')],_0x5076e9['filters']));_0x413ea5['where'][_0x9a67('0x6a')]=_0x13eee5['id'];if(_0x1503c4['query'][_0x9a67('0x50')]){_0x413ea5[_0x9a67('0x4f')]=_[_0x9a67('0x51')](_0x413ea5['where'],{'$or':_[_0x9a67('0x3e')](_0x413ea5['attributes'],function(_0x582ded){var _0x36e348={};_0x36e348[_0x582ded]={'$like':'%'+_0x1503c4['query'][_0x9a67('0x50')]+'%'};return _0x36e348;})});}_0x413ea5=_['merge']({},_0x413ea5,_0x1503c4[_0x9a67('0x53')]);return db[_0x9a67('0x93')][_0x9a67('0x54')]({'where':_0x413ea5[_0x9a67('0x4f')]})['then'](function(_0xbeebce){_0x461e37[_0x9a67('0x54')]=_0xbeebce;if(_0x1503c4[_0x9a67('0x45')][_0x9a67('0x59')]){_0x413ea5[_0x9a67('0x55')]=[{'model':db[_0x9a67('0x75')],'as':_0x9a67('0xad'),'required':![]},{'model':db[_0x9a67('0xae')],'as':_0x9a67('0xaf'),'attributes':[_0x9a67('0x39'),'fullname',_0x9a67('0xb0')],'required':![]},{'model':db[_0x9a67('0xb1')],'as':_0x9a67('0xb2'),'attributes':['id',_0x9a67('0x39'),_0x9a67('0xb3')],'where':_0x1503c4[_0x9a67('0x45')][_0x9a67('0xb4')]?{'id':_0x1503c4[_0x9a67('0x45')][_0x9a67('0xb4')]}:undefined,'required':_0x1503c4[_0x9a67('0x45')][_0x9a67('0xb4')]?!![]:![]}];}return db[_0x9a67('0x93')][_0x9a67('0x56')](_0x413ea5);})[_0x9a67('0x22')](function(_0x13afde){_0x461e37['rows']=_0x13afde;return _0x461e37;});}})['then'](respondWithFilteredResult(_0x310982,_0x413ea5))[_0x9a67('0x2d')](handleError(_0x310982,null));};exports[_0x9a67('0xb5')]=function(_0x56f9e8,_0x46b91d,_0x454f0e){return db[_0x9a67('0x3f')]['find']({'where':{'id':_0x56f9e8[_0x9a67('0x67')]['id']}})[_0x9a67('0x22')](handleEntityNotFound(_0x46b91d,null))['then'](function(_0x299deb){if(_0x299deb){return _0x299deb['addAgents'](_0x56f9e8[_0x9a67('0x5b')]['ids'],_[_0x9a67('0xb6')](_0x56f9e8['body'],[_0x9a67('0x72'),'id'])||{})['spread'](function(_0x2e2716){for(var _0x48a36f=0x0;_0x48a36f<_0x56f9e8[_0x9a67('0x5b')][_0x9a67('0x72')]['length'];_0x48a36f+=0x1){socket['emit'](_0x9a67('0xb7'),{'UserId':Number(_0x56f9e8[_0x9a67('0x5b')][_0x9a67('0x72')][_0x48a36f]),'OpenchannelAccountId':Number(_0x56f9e8['params']['id'])});}return _0x2e2716;});}})['then'](respondWithResult(_0x46b91d,null))['catch'](handleError(_0x46b91d,null));};exports[_0x9a67('0xb8')]=function(_0xb93568,_0x16494a,_0x4792b7){return db[_0x9a67('0x3f')]['find']({'where':{'id':_0xb93568[_0x9a67('0x67')]['id']}})[_0x9a67('0x22')](handleEntityNotFound(_0x16494a,null))[_0x9a67('0x22')](function(_0x6df63e){if(_0x6df63e){return _0x6df63e[_0x9a67('0xb8')](_0xb93568[_0x9a67('0x45')][_0x9a67('0x72')])[_0x9a67('0x22')](function(){if(_[_0x9a67('0xb9')](_0xb93568[_0x9a67('0x45')][_0x9a67('0x72')])){for(var _0xdb7bd5=0x0;_0xdb7bd5<_0xb93568[_0x9a67('0x45')]['ids'][_0x9a67('0x4b')];_0xdb7bd5+=0x1){socket[_0x9a67('0xba')](_0x9a67('0xbb'),{'UserId':Number(_0xb93568['query'][_0x9a67('0x72')][_0xdb7bd5]),'OpenchannelAccountId':Number(_0xb93568[_0x9a67('0x67')]['id'])});}}else{socket[_0x9a67('0xba')](_0x9a67('0xbb'),{'UserId':Number(_0xb93568[_0x9a67('0x45')]['ids']),'OpenchannelAccountId':Number(_0xb93568[_0x9a67('0x67')]['id'])});}});}})[_0x9a67('0x22')](respondWithStatusCode(_0x16494a,null))[_0x9a67('0x2d')](handleError(_0x16494a,null));};exports[_0x9a67('0xbc')]=function(_0x3221e6,_0x40cc7a,_0x2dcb15){var _0x180308={};var _0x44abe4={};var _0x1fb8e2;var _0x4a4c25;return db[_0x9a67('0x3f')][_0x9a67('0xaa')]({'where':{'id':_0x3221e6[_0x9a67('0x67')]['id']}})[_0x9a67('0x22')](handleEntityNotFound(_0x40cc7a,null))[_0x9a67('0x22')](function(_0x517622){if(_0x517622){_0x1fb8e2=_0x517622;_0x44abe4['model']=_[_0x9a67('0x46')](db[_0x9a67('0xae')]['rawAttributes']);_0x44abe4[_0x9a67('0x45')]=_[_0x9a67('0x46')](_0x3221e6[_0x9a67('0x45')]);_0x44abe4[_0x9a67('0x47')]=_['intersection'](_0x44abe4['model'],_0x44abe4['query']);_0x180308[_0x9a67('0x49')]=_[_0x9a67('0x48')](_0x44abe4[_0x9a67('0x44')],qs[_0x9a67('0x4a')](_0x3221e6[_0x9a67('0x45')][_0x9a67('0x4a')]));_0x180308[_0x9a67('0x49')]=_0x180308[_0x9a67('0x49')][_0x9a67('0x4b')]?_0x180308[_0x9a67('0x49')]:_0x44abe4[_0x9a67('0x44')];_0x180308[_0x9a67('0x4e')]=qs[_0x9a67('0x6d')](_0x3221e6[_0x9a67('0x45')][_0x9a67('0x6d')]);_0x180308[_0x9a67('0x4f')]=qs[_0x9a67('0x47')](_['pick'](_0x3221e6[_0x9a67('0x45')],_0x44abe4[_0x9a67('0x47')]));if(_0x3221e6[_0x9a67('0x45')][_0x9a67('0x50')]){_0x180308[_0x9a67('0x4f')]=_[_0x9a67('0x51')](_0x180308['where'],{'$or':_[_0x9a67('0x3e')](_0x180308[_0x9a67('0x49')],function(_0x5ef7b0){var _0x4815bb={};_0x4815bb[_0x5ef7b0]={'$like':'%'+_0x3221e6[_0x9a67('0x45')]['filter']+'%'};return _0x4815bb;})});}_0x180308=_[_0x9a67('0x51')]({},_0x180308,_0x3221e6[_0x9a67('0x53')]);return _0x1fb8e2[_0x9a67('0xbc')](_0x180308);}})[_0x9a67('0x22')](function(_0x33a501){if(_0x33a501){_0x4a4c25=_0x33a501[_0x9a67('0x4b')];if(!_0x3221e6[_0x9a67('0x45')][_0x9a67('0x4c')](_0x9a67('0x4d'))){_0x180308[_0x9a67('0x33')]=qs['limit'](_0x3221e6[_0x9a67('0x45')][_0x9a67('0x33')]);_0x180308[_0x9a67('0x32')]=qs['offset'](_0x3221e6[_0x9a67('0x45')]['offset']);}return _0x1fb8e2[_0x9a67('0xbc')](_0x180308);}})[_0x9a67('0x22')](function(_0x48fc00){if(_0x48fc00){return _0x48fc00?{'count':_0x4a4c25,'rows':_0x48fc00}:null;}})[_0x9a67('0x22')](respondWithResult(_0x40cc7a,null))['catch'](handleError(_0x40cc7a,null));};exports[_0x9a67('0x3a')]=function(_0xdafeb5,_0x346f65,_0x384500){var _0x3066f7,_0x93376,_0x1e7eab;if(_[_0x9a67('0x7c')](_0xdafeb5['body'][_0x9a67('0x5b')])||_0xdafeb5[_0x9a67('0x5b')][_0x9a67('0x5b')]===''){throw new db['Sequelize'][(_0x9a67('0x76'))](_0x9a67('0xbd'));}if(_[_0x9a67('0x7c')](_0xdafeb5[_0x9a67('0x5b')]['to'])){}_0x3066f7=_0xdafeb5['body']['to'];return db[_0x9a67('0x3f')][_0x9a67('0xaa')]({'where':{'id':_0xdafeb5['params']['id']}})[_0x9a67('0x22')](handleEntityNotFound(_0x346f65,null))[_0x9a67('0x22')](function(_0x267458){if(_0x267458){return db['OpenchannelAccount']['find']({'where':{'id':_0x267458['id']},'include':[{'model':db[_0x9a67('0x83')],'as':_0x9a67('0x84'),'include':[{'model':db[_0x9a67('0x75')],'as':'Contacts','where':{[_0x267458['mapKey']]:_0x3066f7},'limit':0x1,'order':[[_0x9a67('0x7a'),_0x9a67('0x86')]]}]}]})['then'](handleEntityNotFound(_0x346f65,null))[_0x9a67('0x22')](function(_0x3afc07){if(_0x3afc07&&_0x3afc07[_0x9a67('0x84')]){_0x93376=_0x3afc07[_0x9a67('0x5d')]({'plain':!![]});if(_0x93376[_0x9a67('0x84')]&&_0x93376[_0x9a67('0x84')][_0x9a67('0x85')][_0x9a67('0x4b')]){return _0x93376[_0x9a67('0x84')][_0x9a67('0x85')][0x0];}return db[_0x9a67('0x75')]['create'](_[_0x9a67('0x1a')](_0xdafeb5['body'],{'firstName':_0x3066f7,[_0x3afc07[_0x9a67('0x81')]]:_0x3066f7,'phone':_0x3066f7,'ListId':_0x93376[_0x9a67('0x7b')]}));}})[_0x9a67('0x22')](handleEntityNotFound(_0x346f65,null))['then'](function(_0x2e61a8){if(_0x2e61a8){_0x1e7eab=_0x2e61a8;return db[_0x9a67('0x93')][_0x9a67('0x66')]({'where':{'ContactId':_0x1e7eab['id'],'closed':![],'OpenchannelAccountId':_0x93376['id']}})[_0x9a67('0x22')](function(_0x2e6571){if(_0x2e6571){return[_0x2e6571,![]];}return db[_0x9a67('0x93')][_0x9a67('0x5a')]({'UserId':_0xdafeb5[_0x9a67('0x5c')]['id'],'ContactId':_0x1e7eab['id'],'OpenchannelAccountId':_0x93376['id'],'lastMsgDirection':_0x9a67('0xbe'),'Messages':[_['merge'](_0xdafeb5[_0x9a67('0x5b')],{'read':![],'body':_0xdafeb5['body']['body'],'OpenchannelAccountId':_0x93376['id'],'UserId':_0xdafeb5[_0x9a67('0x5c')]['id'],'ContactId':_0x1e7eab['id']})]},{'include':[{'model':db[_0x9a67('0xbf')],'as':_0x9a67('0xc0')}]})[_0x9a67('0x22')](function(_0x46633e){return[_0x46633e,!![]];});});}})[_0x9a67('0x94')](function(_0x3bec3c,_0x45ef2b){if(_0x45ef2b){return _0x3bec3c;}return db[_0x9a67('0xbf')]['create'](_[_0x9a67('0x51')](_0xdafeb5[_0x9a67('0x5b')],{'read':![],'body':_0xdafeb5[_0x9a67('0x5b')]['body'],'OpenchannelAccountId':_0x93376['id'],'OpenchannelInteractionId':_0x3bec3c['id'],'UserId':_0xdafeb5[_0x9a67('0x5c')]['id'],'ContactId':_0x1e7eab['id']}))['then'](function(_0x1b731f){_0x3bec3c[_0x9a67('0xc1')][_0x9a67('0xc0')]=[];_0x3bec3c[_0x9a67('0xc1')][_0x9a67('0xc0')][_0x9a67('0x99')](_0x1b731f[_0x9a67('0xc1')]);return _0x3bec3c;});});}})['then'](respondWithResult(_0x346f65,null))[_0x9a67('0x2d')](handleError(_0x346f65,null));}; \ No newline at end of file +var _0x1e3a=['length','hasOwnProperty','nolimit','sort','where','filters','filter','merge','VIRTUAL','includeAll','include','findAll','rows','Pause','keys','options','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','autoAssociation','create','body','describe','addDisposition','Disposition','findOne','params','order','removeDispositions','OpenchannelAccountId','CannedAnswer','removeAnswers','openchannel','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','createdAt','updatedAt','difference','CompanyId','isNil','from','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','OpenchannelApplication','applications','priority','asc','account','Applications','firstName','lastName','threadId','externalUrl','OpenchannelInteraction','ContactId','spread','contact','messageId','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','unshift','agent','forcedOwnership','startRouting','EventManager','notify','addApplications','transaction','bulkCreate','findAndCountAll','getApplications','pick','Contact','User','Owner','internal','Tag','color','tag','addAgents','emit','ids','isArray','userOpenchannelAccount:remove','getAgents','ListId','Messages','dataValues','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','jayson/promise','client','http','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','update','destroy','OpenchannelAccounts','UserProfileResource','status','stack','name','send','mandatoryDispositionPause','map','OpenchannelAccount','rawAttributes','type','key','query','model','attributes','intersection','fields'];(function(_0x28d26e,_0x7b2da0){var _0x41fb4a=function(_0x5f49d2){while(--_0x5f49d2){_0x28d26e['push'](_0x28d26e['shift']());}};_0x41fb4a(++_0x7b2da0);}(_0x1e3a,0x123));var _0xa1e3=function(_0x5e6cb8,_0x1d1eb5){_0x5e6cb8=_0x5e6cb8-0x0;var _0x41754f=_0x1e3a[_0x5e6cb8];return _0x41754f;};'use strict';var emlformat=require(_0xa1e3('0x0'));var rimraf=require(_0xa1e3('0x1'));var zipdir=require(_0xa1e3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa1e3('0x3'));var moment=require(_0xa1e3('0x4'));var BPromise=require(_0xa1e3('0x5'));var Mustache=require(_0xa1e3('0x6'));var util=require(_0xa1e3('0x7'));var path=require(_0xa1e3('0x8'));var sox=require(_0xa1e3('0x9'));var csv=require(_0xa1e3('0xa'));var ejs=require(_0xa1e3('0xb'));var fs=require('fs');var fs_extra=require(_0xa1e3('0xc'));var _=require(_0xa1e3('0xd'));var squel=require(_0xa1e3('0xe'));var crypto=require(_0xa1e3('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xa1e3('0x10'));var toCsv=require('to-csv');var querystring=require(_0xa1e3('0x11'));var Papa=require(_0xa1e3('0x12'));var Redis=require(_0xa1e3('0x13'));var authService=require(_0xa1e3('0x14'));var qs=require(_0xa1e3('0x15'));var as=require(_0xa1e3('0x16'));var hardwareService=require(_0xa1e3('0x17'));var logger=require(_0xa1e3('0x18'))('api');var utils=require(_0xa1e3('0x19'));var config=require(_0xa1e3('0x1a'));var licenseUtil=require(_0xa1e3('0x1b'));var db=require(_0xa1e3('0x1c'))['db'];config[_0xa1e3('0x1d')]=_[_0xa1e3('0x1e')](config[_0xa1e3('0x1d')],{'host':'localhost','port':0x18eb});var socket=require(_0xa1e3('0x1f'))(new Redis(config[_0xa1e3('0x1d')]));require('./openchannelAccount.socket')['register'](socket);var jayson=require(_0xa1e3('0x20'));var client=jayson[_0xa1e3('0x21')]['http']({'port':0x232c});var client9002=jayson[_0xa1e3('0x21')][_0xa1e3('0x22')]({'port':0x232a});function respondWithRpcPromise(_0x1f9f8e,_0x34a356,_0x1f748d,_0x446730){return new BPromise(function(_0x18381c,_0x336e9b){var _0x39abcd=_0x446730||client;return _0x39abcd['request'](_0x1f9f8e,_0x1f748d)[_0xa1e3('0x23')](function(_0x1163bd){logger[_0xa1e3('0x24')](_0xa1e3('0x25'),_0x34a356,_0xa1e3('0x26'));logger[_0xa1e3('0x27')](_0xa1e3('0x28'),_0x34a356,'request\x20sent',JSON[_0xa1e3('0x29')](_0x1163bd));if(_0x1163bd[_0xa1e3('0x2a')]){if(_0x1163bd[_0xa1e3('0x2a')][_0xa1e3('0x2b')]===0x1f4){logger[_0xa1e3('0x2a')]('OpenchannelAccount,\x20%s,\x20%s',_0x34a356,_0x1163bd[_0xa1e3('0x2a')]['message']);return _0x336e9b(_0x1163bd[_0xa1e3('0x2a')][_0xa1e3('0x2c')]);}logger[_0xa1e3('0x2a')](_0xa1e3('0x25'),_0x34a356,_0x1163bd[_0xa1e3('0x2a')][_0xa1e3('0x2c')]);return _0x18381c(_0x1163bd['error'][_0xa1e3('0x2c')]);}else{logger[_0xa1e3('0x24')](_0xa1e3('0x25'),_0x34a356,_0xa1e3('0x26'));_0x18381c(_0x1163bd[_0xa1e3('0x2d')][_0xa1e3('0x2c')]);}})[_0xa1e3('0x2e')](function(_0x7e2eb8){logger[_0xa1e3('0x2a')](_0xa1e3('0x25'),_0x34a356,_0x7e2eb8);_0x336e9b(_0x7e2eb8);});});}function respondWithStatusCode(_0x90f4b3,_0x4ed2b2){_0x4ed2b2=_0x4ed2b2||0xcc;return function(_0x2d7237){if(_0x2d7237){return _0x90f4b3[_0xa1e3('0x2f')](_0x4ed2b2);}return _0x90f4b3['status'](_0x4ed2b2)[_0xa1e3('0x30')]();};}function respondWithResult(_0x56da4b,_0x343167){_0x343167=_0x343167||0xc8;return function(_0xff82c8){if(_0xff82c8){return _0x56da4b['status'](_0x343167)['json'](_0xff82c8);}};}function respondWithFilteredResult(_0x587eb1,_0x7fd6af){return function(_0x52de15){if(_0x52de15){var _0x43e0d4=typeof _0x7fd6af[_0xa1e3('0x31')]===_0xa1e3('0x32')&&typeof _0x7fd6af[_0xa1e3('0x33')]===_0xa1e3('0x32');var _0x5cf7b9=_0x52de15[_0xa1e3('0x34')];var _0x43ee9c=_0x43e0d4?0x0:_0x7fd6af[_0xa1e3('0x31')];var _0x5dac19=_0x43e0d4?_0x52de15[_0xa1e3('0x34')]:_0x7fd6af['offset']+_0x7fd6af[_0xa1e3('0x33')];var _0x46ebfd;if(_0x5dac19>=_0x5cf7b9){_0x5dac19=_0x5cf7b9;_0x46ebfd=0xc8;}else{_0x46ebfd=0xce;}_0x587eb1['status'](_0x46ebfd);return _0x587eb1[_0xa1e3('0x35')](_0xa1e3('0x36'),_0x43ee9c+'-'+_0x5dac19+'/'+_0x5cf7b9)[_0xa1e3('0x37')](_0x52de15);}return null;};}function patchUpdates(_0x2a1daf){return function(_0x189003){try{jsonpatch['apply'](_0x189003,_0x2a1daf,!![]);}catch(_0x2620b1){return BPromise[_0xa1e3('0x38')](_0x2620b1);}return _0x189003[_0xa1e3('0x39')]();};}function saveUpdates(_0x182789,_0xd2fba1){return function(_0x41ad66){if(_0x41ad66){return _0x41ad66[_0xa1e3('0x3a')](_0x182789)[_0xa1e3('0x23')](function(_0x335c3f){return _0x335c3f;});}return null;};}function removeEntity(_0x44fcf6,_0x3fa8e7){return function(_0xa418c9){if(_0xa418c9){return _0xa418c9[_0xa1e3('0x3b')]()[_0xa1e3('0x23')](function(){var _0xc7f775=_0xa418c9['get']({'plain':!![]});var _0x1b8ff5=_0xa1e3('0x3c');return db[_0xa1e3('0x3d')][_0xa1e3('0x3b')]({'where':{'type':_0x1b8ff5,'resourceId':_0xc7f775['id']}})['then'](function(){return _0xa418c9;});})[_0xa1e3('0x23')](function(){_0x44fcf6[_0xa1e3('0x3e')](0xcc)[_0xa1e3('0x30')]();});}};}function handleEntityNotFound(_0x4b1ff6,_0x8fd830){return function(_0x223422){if(!_0x223422){_0x4b1ff6[_0xa1e3('0x2f')](0x194);}return _0x223422;};}function handleError(_0x163d53,_0xc6968e){_0xc6968e=_0xc6968e||0x1f4;return function(_0x569cda){logger['error'](_0x569cda[_0xa1e3('0x3f')]);if(_0x569cda[_0xa1e3('0x40')]){delete _0x569cda[_0xa1e3('0x40')];}_0x163d53[_0xa1e3('0x3e')](_0xc6968e)[_0xa1e3('0x41')](_0x569cda);};}exports['index']=function(_0x350dcd,_0x31bdf1){var _0x339d6a={'include':[{'model':db['Pause'],'as':_0xa1e3('0x42')}]},_0x439731={},_0x3acc74={'count':0x0,'rows':[]};var _0x3900c4=_[_0xa1e3('0x43')](db[_0xa1e3('0x44')][_0xa1e3('0x45')],function(_0x494a05){return{'name':_0x494a05['fieldName'],'type':_0x494a05[_0xa1e3('0x46')][_0xa1e3('0x47')]};});_0x439731['model']=_[_0xa1e3('0x43')](_0x3900c4,'name');_0x439731[_0xa1e3('0x48')]=_['keys'](_0x350dcd[_0xa1e3('0x48')]);_0x439731['filters']=_['intersection'](_0x439731[_0xa1e3('0x49')],_0x439731[_0xa1e3('0x48')]);_0x339d6a[_0xa1e3('0x4a')]=_[_0xa1e3('0x4b')](_0x439731['model'],qs['fields'](_0x350dcd[_0xa1e3('0x48')][_0xa1e3('0x4c')]));_0x339d6a['attributes']=_0x339d6a[_0xa1e3('0x4a')][_0xa1e3('0x4d')]?_0x339d6a[_0xa1e3('0x4a')]:_0x439731[_0xa1e3('0x49')];if(!_0x350dcd[_0xa1e3('0x48')][_0xa1e3('0x4e')](_0xa1e3('0x4f'))){_0x339d6a['limit']=qs[_0xa1e3('0x33')](_0x350dcd[_0xa1e3('0x48')]['limit']);_0x339d6a[_0xa1e3('0x31')]=qs['offset'](_0x350dcd['query'][_0xa1e3('0x31')]);}_0x339d6a['order']=qs[_0xa1e3('0x50')](_0x350dcd[_0xa1e3('0x48')][_0xa1e3('0x50')]);_0x339d6a[_0xa1e3('0x51')]=qs[_0xa1e3('0x52')](_['pick'](_0x350dcd[_0xa1e3('0x48')],_0x439731[_0xa1e3('0x52')]),_0x3900c4);if(_0x350dcd[_0xa1e3('0x48')][_0xa1e3('0x53')]){_0x339d6a[_0xa1e3('0x51')]=_[_0xa1e3('0x54')](_0x339d6a[_0xa1e3('0x51')],{'$or':_['map'](_0x3900c4,function(_0x487b35){if(_0x487b35[_0xa1e3('0x46')]!==_0xa1e3('0x55')){var _0x10018a={};_0x10018a[_0x487b35[_0xa1e3('0x40')]]={'$like':'%'+_0x350dcd['query'][_0xa1e3('0x53')]+'%'};return _0x10018a;}})});}_0x339d6a=_['merge']({},_0x339d6a,_0x350dcd['options']);var _0x284bc6={'where':_0x339d6a[_0xa1e3('0x51')]};return db['OpenchannelAccount']['count'](_0x284bc6)[_0xa1e3('0x23')](function(_0x58592e){_0x3acc74['count']=_0x58592e;if(_0x350dcd[_0xa1e3('0x48')][_0xa1e3('0x56')]){_0x339d6a[_0xa1e3('0x57')]=[{'all':!![]}];}return db[_0xa1e3('0x44')][_0xa1e3('0x58')](_0x339d6a);})[_0xa1e3('0x23')](function(_0x4dbc58){_0x3acc74[_0xa1e3('0x59')]=_0x4dbc58;return _0x3acc74;})[_0xa1e3('0x23')](respondWithFilteredResult(_0x31bdf1,_0x339d6a))['catch'](handleError(_0x31bdf1,null));};exports['show']=function(_0x4226aa,_0x502a06){var _0x3c371c={'raw':![],'where':{'id':_0x4226aa['params']['id']},'include':[{'model':db[_0xa1e3('0x5a')],'as':_0xa1e3('0x42')}]},_0x3eb33d={};_0x3eb33d[_0xa1e3('0x49')]=_['keys'](db[_0xa1e3('0x44')]['rawAttributes']);_0x3eb33d[_0xa1e3('0x48')]=_[_0xa1e3('0x5b')](_0x4226aa['query']);_0x3eb33d['filters']=_[_0xa1e3('0x4b')](_0x3eb33d['model'],_0x3eb33d[_0xa1e3('0x48')]);_0x3c371c[_0xa1e3('0x4a')]=_[_0xa1e3('0x4b')](_0x3eb33d[_0xa1e3('0x49')],qs[_0xa1e3('0x4c')](_0x4226aa[_0xa1e3('0x48')][_0xa1e3('0x4c')]));_0x3c371c[_0xa1e3('0x4a')]=_0x3c371c[_0xa1e3('0x4a')][_0xa1e3('0x4d')]?_0x3c371c['attributes']:_0x3eb33d[_0xa1e3('0x49')];if(_0x4226aa[_0xa1e3('0x48')][_0xa1e3('0x56')]){_0x3c371c['include']=[{'all':!![]}];}_0x3c371c=_[_0xa1e3('0x54')]({},_0x3c371c,_0x4226aa[_0xa1e3('0x5c')]);return db[_0xa1e3('0x44')]['find'](_0x3c371c)[_0xa1e3('0x23')](handleEntityNotFound(_0x502a06,null))[_0xa1e3('0x23')](respondWithResult(_0x502a06,null))[_0xa1e3('0x2e')](handleError(_0x502a06,null));};exports['create']=function(_0x3e6f47,_0x102dc9){return db[_0xa1e3('0x44')]['create'](_0x3e6f47['body'],{})[_0xa1e3('0x23')](function(_0x47ab13){var _0x2d9dbe=_0x3e6f47[_0xa1e3('0x5d')][_0xa1e3('0x5e')]({'plain':!![]});if(!_0x2d9dbe)throw new Error(_0xa1e3('0x5f'));if(_0x2d9dbe['role']===_0xa1e3('0x5d')){var _0x3fc4ac=_0x47ab13['get']({'plain':!![]});var _0x589f52=_0xa1e3('0x3c');return db[_0xa1e3('0x60')][_0xa1e3('0x61')]({'where':{'name':_0x589f52,'userProfileId':_0x2d9dbe[_0xa1e3('0x62')]},'raw':!![]})[_0xa1e3('0x23')](function(_0x48555b){if(_0x48555b&&_0x48555b[_0xa1e3('0x63')]===0x0){return db[_0xa1e3('0x3d')][_0xa1e3('0x64')]({'name':_0x3fc4ac[_0xa1e3('0x40')],'resourceId':_0x3fc4ac['id'],'type':_0x48555b[_0xa1e3('0x40')],'sectionId':_0x48555b['id']},{})['then'](function(){return _0x47ab13;});}else{return _0x47ab13;}})['catch'](function(_0xa6b6b2){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xa6b6b2);throw _0xa6b6b2;});}return _0x47ab13;})[_0xa1e3('0x23')](respondWithResult(_0x102dc9,0xc9))[_0xa1e3('0x2e')](handleError(_0x102dc9,null));};exports['update']=function(_0xf06c12,_0x41d13c){if(_0xf06c12[_0xa1e3('0x65')]['id']){delete _0xf06c12['body']['id'];}return db[_0xa1e3('0x44')][_0xa1e3('0x61')]({'where':{'id':_0xf06c12['params']['id']},'include':[{'model':db[_0xa1e3('0x5a')],'as':'mandatoryDispositionPause'}]})[_0xa1e3('0x23')](handleEntityNotFound(_0x41d13c,null))[_0xa1e3('0x23')](saveUpdates(_0xf06c12[_0xa1e3('0x65')],null))[_0xa1e3('0x23')](respondWithResult(_0x41d13c,null))['catch'](handleError(_0x41d13c,null));};exports['destroy']=function(_0x231b3d,_0x360759){return db[_0xa1e3('0x44')][_0xa1e3('0x61')]({'where':{'id':_0x231b3d['params']['id']}})[_0xa1e3('0x23')](handleEntityNotFound(_0x360759,null))[_0xa1e3('0x23')](removeEntity(_0x360759,null))[_0xa1e3('0x2e')](handleError(_0x360759,null));};exports[_0xa1e3('0x66')]=function(_0x4dcead,_0x10f300){return db[_0xa1e3('0x44')][_0xa1e3('0x66')]()['then'](respondWithResult(_0x10f300,null))[_0xa1e3('0x2e')](handleError(_0x10f300,null));};exports[_0xa1e3('0x67')]=function(_0x460a4d,_0x50db44,_0xd8e0a7){if(_0x460a4d[_0xa1e3('0x65')]['id']){delete _0x460a4d[_0xa1e3('0x65')]['id'];}return db[_0xa1e3('0x44')][_0xa1e3('0x61')]({'where':{'id':_0x460a4d['params']['id']}})[_0xa1e3('0x23')](handleEntityNotFound(_0x50db44,null))[_0xa1e3('0x23')](function(_0x5a9ef0){if(_0x5a9ef0){_0x460a4d[_0xa1e3('0x65')]['OpenchannelAccountId']=_0x5a9ef0['id'];return db[_0xa1e3('0x68')][_0xa1e3('0x64')](_0x460a4d[_0xa1e3('0x65')]);}})[_0xa1e3('0x23')](respondWithResult(_0x50db44,null))['catch'](handleError(_0x50db44,null));};exports['getDispositions']=function(_0x37e365,_0x4e8dc3,_0x422374){var _0x2b6f52={'raw':![],'where':{}};var _0xfe6f4c={};var _0x36272a={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0xa1e3('0x69')]({'where':{'id':_0x37e365[_0xa1e3('0x6a')]['id']}})[_0xa1e3('0x23')](handleEntityNotFound(_0x4e8dc3,null))['then'](function(_0xfc9710){if(_0xfc9710){_0xfe6f4c[_0xa1e3('0x49')]=_[_0xa1e3('0x5b')](db['Disposition'][_0xa1e3('0x45')]);_0xfe6f4c['query']=_[_0xa1e3('0x5b')](_0x37e365[_0xa1e3('0x48')]);_0xfe6f4c['filters']=_[_0xa1e3('0x4b')](_0xfe6f4c['model'],_0xfe6f4c[_0xa1e3('0x48')]);_0x2b6f52[_0xa1e3('0x4a')]=_[_0xa1e3('0x4b')](_0xfe6f4c[_0xa1e3('0x49')],qs[_0xa1e3('0x4c')](_0x37e365['query'][_0xa1e3('0x4c')]));_0x2b6f52[_0xa1e3('0x4a')]=_0x2b6f52['attributes'][_0xa1e3('0x4d')]?_0x2b6f52[_0xa1e3('0x4a')]:_0xfe6f4c[_0xa1e3('0x49')];if(!_0x37e365[_0xa1e3('0x48')][_0xa1e3('0x4e')]('nolimit')){_0x2b6f52[_0xa1e3('0x33')]=qs[_0xa1e3('0x33')](_0x37e365[_0xa1e3('0x48')]['limit']);_0x2b6f52['offset']=qs[_0xa1e3('0x31')](_0x37e365['query']['offset']);}_0x2b6f52[_0xa1e3('0x6b')]=qs[_0xa1e3('0x50')](_0x37e365[_0xa1e3('0x48')][_0xa1e3('0x50')]);_0x2b6f52[_0xa1e3('0x51')]=qs[_0xa1e3('0x52')](_['pick'](_0x37e365[_0xa1e3('0x48')],_0xfe6f4c[_0xa1e3('0x52')]));_0x2b6f52[_0xa1e3('0x51')]['OpenchannelAccountId']=_0xfc9710['id'];if(_0x37e365[_0xa1e3('0x48')]['filter']){_0x2b6f52[_0xa1e3('0x51')]=_[_0xa1e3('0x54')](_0x2b6f52['where'],{'$or':_[_0xa1e3('0x43')](_0x2b6f52[_0xa1e3('0x4a')],function(_0x212ed3){var _0x55cfe3={};_0x55cfe3[_0x212ed3]={'$like':'%'+_0x37e365['query']['filter']+'%'};return _0x55cfe3;})});}_0x2b6f52=_['merge']({},_0x2b6f52,_0x37e365[_0xa1e3('0x5c')]);return db[_0xa1e3('0x68')][_0xa1e3('0x34')]({'where':_0x2b6f52[_0xa1e3('0x51')]})[_0xa1e3('0x23')](function(_0x18bb7a){_0x36272a[_0xa1e3('0x34')]=_0x18bb7a;if(_0x37e365[_0xa1e3('0x48')][_0xa1e3('0x56')]){_0x2b6f52['include']=[{'all':!![]}];}return db['Disposition'][_0xa1e3('0x58')](_0x2b6f52);})[_0xa1e3('0x23')](function(_0x2873e4){_0x36272a[_0xa1e3('0x59')]=_0x2873e4;return _0x36272a;});}})[_0xa1e3('0x23')](respondWithFilteredResult(_0x4e8dc3,_0x2b6f52))[_0xa1e3('0x2e')](handleError(_0x4e8dc3,null));};exports[_0xa1e3('0x6c')]=function(_0x5f272f,_0x4b0b8d,_0x466af3){return db[_0xa1e3('0x44')][_0xa1e3('0x61')]({'where':{'id':_0x5f272f[_0xa1e3('0x6a')]['id']}})['then'](handleEntityNotFound(_0x4b0b8d,null))[_0xa1e3('0x23')](function(_0x112e3c){if(_0x112e3c){return _0x112e3c[_0xa1e3('0x6c')](_0x5f272f[_0xa1e3('0x48')]['ids']);}})[_0xa1e3('0x23')](respondWithStatusCode(_0x4b0b8d,null))[_0xa1e3('0x2e')](handleError(_0x4b0b8d,null));};exports['addAnswer']=function(_0x1ef140,_0xdd1681,_0x59735f){if(_0x1ef140[_0xa1e3('0x65')]['id']){delete _0x1ef140[_0xa1e3('0x65')]['id'];}return db['OpenchannelAccount'][_0xa1e3('0x61')]({'where':{'id':_0x1ef140['params']['id']}})[_0xa1e3('0x23')](handleEntityNotFound(_0xdd1681,null))['then'](function(_0x5f3f8f){if(_0x5f3f8f){_0x1ef140[_0xa1e3('0x65')][_0xa1e3('0x6d')]=_0x5f3f8f['id'];return db[_0xa1e3('0x6e')]['create'](_0x1ef140[_0xa1e3('0x65')]);}})[_0xa1e3('0x23')](respondWithResult(_0xdd1681,null))[_0xa1e3('0x2e')](handleError(_0xdd1681,null));};exports['getAnswers']=function(_0x641151,_0xa118f9,_0x5f3580){var _0x3e0d18={'raw':![],'where':{}};var _0x3de347={};var _0x1d11c8={'count':0x0,'rows':[]};return db[_0xa1e3('0x44')]['findOne']({'where':{'id':_0x641151[_0xa1e3('0x6a')]['id']}})[_0xa1e3('0x23')](handleEntityNotFound(_0xa118f9,null))[_0xa1e3('0x23')](function(_0x50c5b5){if(_0x50c5b5){_0x3de347[_0xa1e3('0x49')]=_[_0xa1e3('0x5b')](db[_0xa1e3('0x6e')][_0xa1e3('0x45')]);_0x3de347[_0xa1e3('0x48')]=_[_0xa1e3('0x5b')](_0x641151['query']);_0x3de347[_0xa1e3('0x52')]=_['intersection'](_0x3de347['model'],_0x3de347['query']);_0x3e0d18[_0xa1e3('0x4a')]=_[_0xa1e3('0x4b')](_0x3de347[_0xa1e3('0x49')],qs[_0xa1e3('0x4c')](_0x641151[_0xa1e3('0x48')][_0xa1e3('0x4c')]));_0x3e0d18['attributes']=_0x3e0d18[_0xa1e3('0x4a')][_0xa1e3('0x4d')]?_0x3e0d18[_0xa1e3('0x4a')]:_0x3de347[_0xa1e3('0x49')];if(!_0x641151[_0xa1e3('0x48')][_0xa1e3('0x4e')]('nolimit')){_0x3e0d18[_0xa1e3('0x33')]=qs[_0xa1e3('0x33')](_0x641151[_0xa1e3('0x48')][_0xa1e3('0x33')]);_0x3e0d18[_0xa1e3('0x31')]=qs[_0xa1e3('0x31')](_0x641151[_0xa1e3('0x48')][_0xa1e3('0x31')]);}_0x3e0d18[_0xa1e3('0x6b')]=qs['sort'](_0x641151[_0xa1e3('0x48')]['sort']);_0x3e0d18[_0xa1e3('0x51')]=qs[_0xa1e3('0x52')](_['pick'](_0x641151[_0xa1e3('0x48')],_0x3de347['filters']));_0x3e0d18[_0xa1e3('0x51')][_0xa1e3('0x6d')]=_0x50c5b5['id'];if(_0x641151[_0xa1e3('0x48')][_0xa1e3('0x53')]){_0x3e0d18[_0xa1e3('0x51')]=_[_0xa1e3('0x54')](_0x3e0d18[_0xa1e3('0x51')],{'$or':_[_0xa1e3('0x43')](_0x3e0d18['attributes'],function(_0x51c131){var _0x33dd8b={};_0x33dd8b[_0x51c131]={'$like':'%'+_0x641151[_0xa1e3('0x48')][_0xa1e3('0x53')]+'%'};return _0x33dd8b;})});}_0x3e0d18=_[_0xa1e3('0x54')]({},_0x3e0d18,_0x641151['options']);return db[_0xa1e3('0x6e')]['count']({'where':_0x3e0d18[_0xa1e3('0x51')]})[_0xa1e3('0x23')](function(_0x52d7a7){_0x1d11c8[_0xa1e3('0x34')]=_0x52d7a7;if(_0x641151[_0xa1e3('0x48')][_0xa1e3('0x56')]){_0x3e0d18[_0xa1e3('0x57')]=[{'all':!![]}];}return db[_0xa1e3('0x6e')]['findAll'](_0x3e0d18);})[_0xa1e3('0x23')](function(_0x3e7571){_0x1d11c8[_0xa1e3('0x59')]=_0x3e7571;return _0x1d11c8;});}})[_0xa1e3('0x23')](respondWithFilteredResult(_0xa118f9,_0x3e0d18))[_0xa1e3('0x2e')](handleError(_0xa118f9,null));};exports[_0xa1e3('0x6f')]=function(_0x1d2d00,_0x312ba6,_0x345c4a){return db[_0xa1e3('0x44')]['find']({'where':{'id':_0x1d2d00[_0xa1e3('0x6a')]['id']}})[_0xa1e3('0x23')](handleEntityNotFound(_0x312ba6,null))[_0xa1e3('0x23')](function(_0x785597){if(_0x785597){return _0x785597[_0xa1e3('0x6f')](_0x1d2d00[_0xa1e3('0x48')]['ids']);}})[_0xa1e3('0x23')](respondWithStatusCode(_0x312ba6,null))[_0xa1e3('0x2e')](handleError(_0x312ba6,null));};exports['notify']=function(_0x229fcc,_0x3d45ed,_0x272e4e){var _0xd98d59={'body':_0x229fcc['body'],'channel':_0xa1e3('0x70')};var _0xd5c27b=[];var _0x8f52b6=[];var _0x277fcf={};var _0x5446f7=![];return db[_0xa1e3('0x71')][_0xa1e3('0x66')]()[_0xa1e3('0x23')](function(_0x199eb4){if(!_0x199eb4){throw new db[(_0xa1e3('0x72'))][(_0xa1e3('0x73'))](_0xa1e3('0x74'));}_0xd5c27b=_['difference'](_['keys'](_0x199eb4),[_0xa1e3('0x75'),_0xa1e3('0x76')]);_0x8f52b6=_[_0xa1e3('0x77')](_[_0xa1e3('0x5b')](_0x199eb4),[_0xa1e3('0x75'),_0xa1e3('0x76'),_0xa1e3('0x78'),'ListId']);if(_0x229fcc['body']['id']){delete _0x229fcc[_0xa1e3('0x65')]['id'];}if(_[_0xa1e3('0x79')](_0x229fcc['body'][_0xa1e3('0x7a')])){throw new db[(_0xa1e3('0x72'))][(_0xa1e3('0x73'))]('from\x20is\x20mandatory');}if(_[_0xa1e3('0x79')](_0x229fcc[_0xa1e3('0x65')][_0xa1e3('0x65')])||_0x229fcc['body']['body']===''){throw new db[(_0xa1e3('0x72'))][(_0xa1e3('0x73'))](_0xa1e3('0x7b'));}if(_[_0xa1e3('0x79')](_0x229fcc[_0xa1e3('0x65')][_0xa1e3('0x7c')])){throw new db[(_0xa1e3('0x72'))][(_0xa1e3('0x73'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x8f52b6);}if(!_[_0xa1e3('0x7d')](_0x8f52b6,_0x229fcc['body'][_0xa1e3('0x7c')])){throw new db[(_0xa1e3('0x72'))][(_0xa1e3('0x73'))](_0xa1e3('0x7e')+_0x8f52b6);}_0x277fcf[_0x229fcc['body']['mapKey']]=_0x229fcc[_0xa1e3('0x65')][_0xa1e3('0x7a')];})['then'](function(){return db[_0xa1e3('0x44')]['find']({'where':{'id':_0x229fcc[_0xa1e3('0x6a')]['id']},'include':[{'model':db[_0xa1e3('0x7f')],'as':_0xa1e3('0x80'),'include':[{'model':db[_0xa1e3('0x71')],'as':_0xa1e3('0x81'),'where':_0x277fcf,'limit':0x1,'order':[[_0xa1e3('0x76'),_0xa1e3('0x82')]]}]},{'model':db[_0xa1e3('0x83')],'as':'Applications'}]});})[_0xa1e3('0x23')](handleEntityNotFound(_0x3d45ed,null))[_0xa1e3('0x23')](function(_0x331042){if(_0x331042&&_0x331042[_0xa1e3('0x80')]){_0xd98d59['account']=_0x331042;_0xd98d59[_0xa1e3('0x84')]=_0x331042['Applications'];_0xd98d59['list']=_0x331042['List'];_0xd98d59[_0xa1e3('0x84')]=_['orderBy'](_0xd98d59[_0xa1e3('0x84')],[_0xa1e3('0x85')],[_0xa1e3('0x86')]);if(_0xd98d59[_0xa1e3('0x87')][_0xa1e3('0x88')]){delete _0xd98d59[_0xa1e3('0x87')][_0xa1e3('0x88')];}if(_0xd98d59['account']['List']&&_0xd98d59[_0xa1e3('0x87')][_0xa1e3('0x80')]['Contacts'][_0xa1e3('0x4d')]){return _0xd98d59[_0xa1e3('0x87')][_0xa1e3('0x80')][_0xa1e3('0x81')][0x0];}var _0x280423=_[_0xa1e3('0x1e')](_0x229fcc['body'],{'firstName':_0x229fcc[_0xa1e3('0x65')]['from'],'ListId':_0x331042['ListId']});_0x280423[_0x229fcc[_0xa1e3('0x65')]['mapKey']]=_0x229fcc['body']['from'];return db[_0xa1e3('0x71')][_0xa1e3('0x64')](_0x280423,{'fields':_0xd5c27b,'raw':!![]});}})[_0xa1e3('0x23')](handleEntityNotFound(_0x3d45ed,null))[_0xa1e3('0x23')](function(_0x43b344){_0xd98d59['contact']=_0x43b344;if(_0x43b344){var _0x37e84f={'ContactId':_0x43b344['id'],'OpenchannelAccountId':_0x229fcc[_0xa1e3('0x6a')]['id'],'from':(_0x43b344[_0xa1e3('0x89')]||'')+'\x20'+(_0x43b344[_0xa1e3('0x8a')]||'')};var _0x2b7e55={'OpenchannelAccountId':_0x229fcc[_0xa1e3('0x6a')]['id'],'closed':![]};if(_0x229fcc[_0xa1e3('0x65')]['threadId']){_0x2b7e55[_0xa1e3('0x8b')]=_0x229fcc[_0xa1e3('0x65')][_0xa1e3('0x8b')];return db['OpenchannelInteraction'][_0xa1e3('0x61')]({'where':_0x2b7e55})[_0xa1e3('0x23')](function(_0x17fd21){if(_0x17fd21){return[_0x17fd21,![]];}_0x37e84f[_0xa1e3('0x8b')]=_0x229fcc[_0xa1e3('0x65')][_0xa1e3('0x8b')];_0x37e84f[_0xa1e3('0x8c')]=_0x229fcc['body'][_0xa1e3('0x8c')];return db[_0xa1e3('0x8d')][_0xa1e3('0x64')](_0x37e84f)[_0xa1e3('0x23')](function(_0xc7c355){return[_0xc7c355,!![]];});});}else{_0x2b7e55[_0xa1e3('0x8b')]=null;}_0x2b7e55[_0xa1e3('0x8e')]=_0x43b344['id'];return db[_0xa1e3('0x8d')]['find']({'where':_0x2b7e55})['then'](function(_0x1ea3bd){if(_0x1ea3bd){return[_0x1ea3bd,![]];}return db[_0xa1e3('0x8d')][_0xa1e3('0x64')](_0x37e84f)['then'](function(_0x8f80dc){return[_0x8f80dc,!![]];});});}})[_0xa1e3('0x8f')](function(_0x3e5494,_0x1f9748){if(_0x3e5494){_0x5446f7=_0x1f9748;if(!_0x1f9748){var _0x433d5e={'from':(_0xd98d59['contact'][_0xa1e3('0x89')]||'')+'\x20'+(_0xd98d59[_0xa1e3('0x90')][_0xa1e3('0x8a')]||'')};if(_0x229fcc[_0xa1e3('0x65')][_0xa1e3('0x8b')]&&_0x229fcc['body'][_0xa1e3('0x91')]&&_0x229fcc['body'][_0xa1e3('0x8b')]!=_0x229fcc['body']['messageId']){_0x433d5e['threadId']=_0x229fcc['body'][_0xa1e3('0x91')];}return _0x3e5494[_0xa1e3('0x3a')](_0x433d5e);}else{return _0x3e5494;}}})['then'](function(_0x3c3dab){_0xd98d59['interaction']=_0x3c3dab['get']({'plain':!![]});_0xd98d59[_0xa1e3('0x92')][_0xa1e3('0x93')]=_0x5446f7;if(_0xd98d59[_0xa1e3('0x92')][_0xa1e3('0x93')]){if(_0xd98d59['account'][_0xa1e3('0x94')]){_0xd98d59[_0xa1e3('0x84')][_0xa1e3('0x95')]({'id':0x0,'priority':_0xd98d59[_0xa1e3('0x84')][_0xa1e3('0x4d')]+0x1,'app':_0xa1e3('0x96'),'appdata':_0xa1e3('0x97'),'interval':_0xa1e3('0x98')});}}return db[_0xa1e3('0x99')][_0xa1e3('0x64')]({'body':_0x229fcc[_0xa1e3('0x65')][_0xa1e3('0x65')],'OpenchannelAccountId':_0x229fcc[_0xa1e3('0x6a')]['id'],'OpenchannelInteractionId':_0x3c3dab['id'],'direction':'in','ContactId':_0xd98d59[_0xa1e3('0x90')]['id'],'AttachmentId':_0x229fcc[_0xa1e3('0x65')][_0xa1e3('0x9a')]});})[_0xa1e3('0x23')](function(_0x269d43){_0xd98d59[_0xa1e3('0x2c')]=_0x269d43;if(_0xd98d59[_0xa1e3('0x92')]['UserId']){return db['User'][_0xa1e3('0x61')]({'attributes':['id',_0xa1e3('0x40')],'where':{'id':_0xd98d59[_0xa1e3('0x92')][_0xa1e3('0x9b')]}})['then'](function(_0x478658){if(_0x478658){_0xd98d59[_0xa1e3('0x84')][_0xa1e3('0x9c')]({'id':0x0,'priority':0x0,'app':_0xa1e3('0x9d'),'appdata':_0x478658[_0xa1e3('0x40')]+','+(_0xd98d59[_0xa1e3('0x87')]['waitForTheAssignedAgent']||0xa),'interval':_0xa1e3('0x98')});_0xd98d59[_0xa1e3('0x9e')]=![];}return respondWithRpcPromise('Start',_0xa1e3('0x9f'),_0xd98d59);});}return respondWithRpcPromise('Start',_0xa1e3('0x9f'),_0xd98d59);})[_0xa1e3('0x23')](function(_0x13176f){respondWithRpcPromise(_0xa1e3('0xa0'),'EventManager',{'event':_0xa1e3('0xa1'),'message':_0x13176f},client9002);return _0x13176f;})[_0xa1e3('0x23')](respondWithResult(_0x3d45ed,null))[_0xa1e3('0x2e')](handleError(_0x3d45ed,null));};exports[_0xa1e3('0xa2')]=function(_0x33ddfc,_0x4ff0c5,_0x497545){return db[_0xa1e3('0x44')][_0xa1e3('0x69')]({'where':{'id':_0x33ddfc['params']['id']}})[_0xa1e3('0x23')](handleEntityNotFound(_0x4ff0c5,null))[_0xa1e3('0x23')](function(_0x25a139){if(_0x25a139){return db['sequelize'][_0xa1e3('0xa3')](function(_0x5e857f){return db['OpenchannelApplication']['destroy']({'where':{'OpenchannelAccountId':_0x33ddfc[_0xa1e3('0x6a')]['id']},'transaction':_0x5e857f})['then'](function(_0xa5fcb9){var _0x14a788=_[_0xa1e3('0x43')](_0x33ddfc['body'],function(_0x2aa28b){_0x2aa28b[_0xa1e3('0x6d')]=_0x33ddfc[_0xa1e3('0x6a')]['id'];return _0x2aa28b;});return db[_0xa1e3('0x83')][_0xa1e3('0xa4')](_0x14a788,{'transaction':_0x5e857f});});})[_0xa1e3('0x23')](function(){return db[_0xa1e3('0x83')][_0xa1e3('0xa5')]({'where':{'OpenchannelAccountId':_0x33ddfc[_0xa1e3('0x6a')]['id']},'order':_0xa1e3('0x85')});});}})['then'](respondWithResult(_0x4ff0c5,null))[_0xa1e3('0x2e')](handleError(_0x4ff0c5,null));};exports[_0xa1e3('0xa6')]=function(_0x1ad2ee,_0x208b2a,_0x13291d){var _0x40a8b7={};var _0x4b2357={};var _0x4820a4;var _0x44ea32;return db[_0xa1e3('0x44')]['findOne']({'where':{'id':_0x1ad2ee[_0xa1e3('0x6a')]['id']}})[_0xa1e3('0x23')](handleEntityNotFound(_0x208b2a,null))['then'](function(_0x49c0d1){if(_0x49c0d1){_0x4820a4=_0x49c0d1;_0x4b2357[_0xa1e3('0x49')]=_[_0xa1e3('0x5b')](db[_0xa1e3('0x83')]['rawAttributes']);_0x4b2357[_0xa1e3('0x48')]=_[_0xa1e3('0x5b')](_0x1ad2ee['query']);_0x4b2357[_0xa1e3('0x52')]=_['intersection'](_0x4b2357['model'],_0x4b2357[_0xa1e3('0x48')]);_0x40a8b7[_0xa1e3('0x4a')]=_['intersection'](_0x4b2357['model'],qs[_0xa1e3('0x4c')](_0x1ad2ee['query'][_0xa1e3('0x4c')]));_0x40a8b7['attributes']=_0x40a8b7[_0xa1e3('0x4a')][_0xa1e3('0x4d')]?_0x40a8b7[_0xa1e3('0x4a')]:_0x4b2357['model'];_0x40a8b7[_0xa1e3('0x6b')]=qs[_0xa1e3('0x50')](_0x1ad2ee[_0xa1e3('0x48')][_0xa1e3('0x50')]);_0x40a8b7[_0xa1e3('0x51')]=qs[_0xa1e3('0x52')](_[_0xa1e3('0xa7')](_0x1ad2ee['query'],_0x4b2357[_0xa1e3('0x52')]));if(_0x1ad2ee[_0xa1e3('0x48')][_0xa1e3('0x53')]){_0x40a8b7[_0xa1e3('0x51')]=_[_0xa1e3('0x54')](_0x40a8b7['where'],{'$or':_[_0xa1e3('0x43')](_0x40a8b7[_0xa1e3('0x4a')],function(_0x132836){var _0x2e0479={};_0x2e0479[_0x132836]={'$like':'%'+_0x1ad2ee[_0xa1e3('0x48')][_0xa1e3('0x53')]+'%'};return _0x2e0479;})});}_0x40a8b7=_[_0xa1e3('0x54')]({},_0x40a8b7,_0x1ad2ee[_0xa1e3('0x5c')]);return _0x4820a4[_0xa1e3('0xa6')](_0x40a8b7);}})[_0xa1e3('0x23')](function(_0x3cdd32){if(_0x3cdd32){_0x44ea32=_0x3cdd32[_0xa1e3('0x4d')];if(!_0x1ad2ee[_0xa1e3('0x48')]['hasOwnProperty'](_0xa1e3('0x4f'))){_0x40a8b7[_0xa1e3('0x33')]=qs['limit'](_0x1ad2ee['query']['limit']);_0x40a8b7[_0xa1e3('0x31')]=qs[_0xa1e3('0x31')](_0x1ad2ee[_0xa1e3('0x48')][_0xa1e3('0x31')]);}return _0x4820a4[_0xa1e3('0xa6')](_0x40a8b7);}})[_0xa1e3('0x23')](function(_0x9a396d){if(_0x9a396d){return _0x9a396d?{'count':_0x44ea32,'rows':_0x9a396d}:null;}})[_0xa1e3('0x23')](respondWithResult(_0x208b2a,null))[_0xa1e3('0x2e')](handleError(_0x208b2a,null));};exports['getInteractions']=function(_0x56f2c5,_0x23d1a9,_0x4b122c){var _0x535178={'raw':![],'where':{}};var _0x18c70a={};var _0x45f5d3={'count':0x0,'rows':[]};return db[_0xa1e3('0x44')][_0xa1e3('0x69')]({'where':{'id':_0x56f2c5['params']['id']}})[_0xa1e3('0x23')](handleEntityNotFound(_0x23d1a9,null))[_0xa1e3('0x23')](function(_0x528994){if(_0x528994){_0x18c70a[_0xa1e3('0x49')]=_[_0xa1e3('0x5b')](db['OpenchannelInteraction'][_0xa1e3('0x45')]);_0x18c70a[_0xa1e3('0x48')]=_[_0xa1e3('0x5b')](_0x56f2c5[_0xa1e3('0x48')]);_0x18c70a[_0xa1e3('0x52')]=_[_0xa1e3('0x4b')](_0x18c70a[_0xa1e3('0x49')],_0x18c70a[_0xa1e3('0x48')]);_0x535178[_0xa1e3('0x4a')]=_[_0xa1e3('0x4b')](_0x18c70a[_0xa1e3('0x49')],qs[_0xa1e3('0x4c')](_0x56f2c5[_0xa1e3('0x48')][_0xa1e3('0x4c')]));_0x535178[_0xa1e3('0x4a')]=_0x535178[_0xa1e3('0x4a')][_0xa1e3('0x4d')]?_0x535178[_0xa1e3('0x4a')]:_0x18c70a[_0xa1e3('0x49')];if(!_0x56f2c5['query']['hasOwnProperty']('nolimit')){_0x535178['limit']=qs[_0xa1e3('0x33')](_0x56f2c5[_0xa1e3('0x48')][_0xa1e3('0x33')]);_0x535178[_0xa1e3('0x31')]=qs['offset'](_0x56f2c5[_0xa1e3('0x48')][_0xa1e3('0x31')]);}_0x535178['order']=qs[_0xa1e3('0x50')](_0x56f2c5[_0xa1e3('0x48')][_0xa1e3('0x50')]);_0x535178[_0xa1e3('0x51')]=qs[_0xa1e3('0x52')](_['pick'](_0x56f2c5[_0xa1e3('0x48')],_0x18c70a[_0xa1e3('0x52')]));_0x535178['where'][_0xa1e3('0x6d')]=_0x528994['id'];if(_0x56f2c5[_0xa1e3('0x48')]['filter']){_0x535178[_0xa1e3('0x51')]=_[_0xa1e3('0x54')](_0x535178[_0xa1e3('0x51')],{'$or':_[_0xa1e3('0x43')](_0x535178['attributes'],function(_0x487177){var _0x1b52a3={};_0x1b52a3[_0x487177]={'$like':'%'+_0x56f2c5[_0xa1e3('0x48')][_0xa1e3('0x53')]+'%'};return _0x1b52a3;})});}_0x535178=_[_0xa1e3('0x54')]({},_0x535178,_0x56f2c5[_0xa1e3('0x5c')]);return db[_0xa1e3('0x8d')]['count']({'where':_0x535178[_0xa1e3('0x51')]})[_0xa1e3('0x23')](function(_0xe400e6){_0x45f5d3[_0xa1e3('0x34')]=_0xe400e6;if(_0x56f2c5['query'][_0xa1e3('0x56')]){_0x535178['include']=[{'model':db[_0xa1e3('0x71')],'as':_0xa1e3('0xa8'),'required':![]},{'model':db[_0xa1e3('0xa9')],'as':_0xa1e3('0xaa'),'attributes':[_0xa1e3('0x40'),'fullname',_0xa1e3('0xab')],'required':![]},{'model':db[_0xa1e3('0xac')],'as':'Tags','attributes':['id',_0xa1e3('0x40'),_0xa1e3('0xad')],'where':_0x56f2c5['query'][_0xa1e3('0xae')]?{'id':_0x56f2c5[_0xa1e3('0x48')][_0xa1e3('0xae')]}:undefined,'required':_0x56f2c5[_0xa1e3('0x48')][_0xa1e3('0xae')]?!![]:![]}];}return db['OpenchannelInteraction'][_0xa1e3('0x58')](_0x535178);})[_0xa1e3('0x23')](function(_0x241bee){_0x45f5d3[_0xa1e3('0x59')]=_0x241bee;return _0x45f5d3;});}})['then'](respondWithFilteredResult(_0x23d1a9,_0x535178))[_0xa1e3('0x2e')](handleError(_0x23d1a9,null));};exports[_0xa1e3('0xaf')]=function(_0x2dc031,_0x1ed54e,_0x30cb8e){return db[_0xa1e3('0x44')][_0xa1e3('0x61')]({'where':{'id':_0x2dc031[_0xa1e3('0x6a')]['id']}})['then'](handleEntityNotFound(_0x1ed54e,null))[_0xa1e3('0x23')](function(_0x4c48e6){if(_0x4c48e6){return _0x4c48e6[_0xa1e3('0xaf')](_0x2dc031[_0xa1e3('0x65')]['ids'],_['omit'](_0x2dc031[_0xa1e3('0x65')],['ids','id'])||{})['spread'](function(_0x4d1bfa){for(var _0x31baf8=0x0;_0x31baf8<_0x2dc031[_0xa1e3('0x65')]['ids']['length'];_0x31baf8+=0x1){socket[_0xa1e3('0xb0')]('userOpenchannelAccount:save',{'UserId':Number(_0x2dc031['body'][_0xa1e3('0xb1')][_0x31baf8]),'OpenchannelAccountId':Number(_0x2dc031[_0xa1e3('0x6a')]['id'])});}return _0x4d1bfa;});}})['then'](respondWithResult(_0x1ed54e,null))[_0xa1e3('0x2e')](handleError(_0x1ed54e,null));};exports['removeAgents']=function(_0xcab5e4,_0x57c148,_0x50b50c){return db[_0xa1e3('0x44')][_0xa1e3('0x61')]({'where':{'id':_0xcab5e4[_0xa1e3('0x6a')]['id']}})[_0xa1e3('0x23')](handleEntityNotFound(_0x57c148,null))['then'](function(_0x11653b){if(_0x11653b){return _0x11653b['removeAgents'](_0xcab5e4[_0xa1e3('0x48')][_0xa1e3('0xb1')])[_0xa1e3('0x23')](function(){if(_[_0xa1e3('0xb2')](_0xcab5e4[_0xa1e3('0x48')][_0xa1e3('0xb1')])){for(var _0x113667=0x0;_0x113667<_0xcab5e4['query'][_0xa1e3('0xb1')][_0xa1e3('0x4d')];_0x113667+=0x1){socket['emit'](_0xa1e3('0xb3'),{'UserId':Number(_0xcab5e4[_0xa1e3('0x48')][_0xa1e3('0xb1')][_0x113667]),'OpenchannelAccountId':Number(_0xcab5e4[_0xa1e3('0x6a')]['id'])});}}else{socket[_0xa1e3('0xb0')](_0xa1e3('0xb3'),{'UserId':Number(_0xcab5e4['query'][_0xa1e3('0xb1')]),'OpenchannelAccountId':Number(_0xcab5e4[_0xa1e3('0x6a')]['id'])});}});}})[_0xa1e3('0x23')](respondWithStatusCode(_0x57c148,null))[_0xa1e3('0x2e')](handleError(_0x57c148,null));};exports['getAgents']=function(_0xe21d8e,_0x5c3eb1,_0xeb42fa){var _0x56624a={};var _0x2882df={};var _0x111977;var _0x533556;return db[_0xa1e3('0x44')][_0xa1e3('0x69')]({'where':{'id':_0xe21d8e[_0xa1e3('0x6a')]['id']}})[_0xa1e3('0x23')](handleEntityNotFound(_0x5c3eb1,null))['then'](function(_0xc7ff34){if(_0xc7ff34){_0x111977=_0xc7ff34;_0x2882df[_0xa1e3('0x49')]=_[_0xa1e3('0x5b')](db[_0xa1e3('0xa9')][_0xa1e3('0x45')]);_0x2882df[_0xa1e3('0x48')]=_['keys'](_0xe21d8e[_0xa1e3('0x48')]);_0x2882df[_0xa1e3('0x52')]=_['intersection'](_0x2882df[_0xa1e3('0x49')],_0x2882df[_0xa1e3('0x48')]);_0x56624a[_0xa1e3('0x4a')]=_[_0xa1e3('0x4b')](_0x2882df[_0xa1e3('0x49')],qs[_0xa1e3('0x4c')](_0xe21d8e[_0xa1e3('0x48')][_0xa1e3('0x4c')]));_0x56624a[_0xa1e3('0x4a')]=_0x56624a[_0xa1e3('0x4a')][_0xa1e3('0x4d')]?_0x56624a[_0xa1e3('0x4a')]:_0x2882df[_0xa1e3('0x49')];_0x56624a[_0xa1e3('0x6b')]=qs['sort'](_0xe21d8e[_0xa1e3('0x48')][_0xa1e3('0x50')]);_0x56624a[_0xa1e3('0x51')]=qs['filters'](_[_0xa1e3('0xa7')](_0xe21d8e['query'],_0x2882df[_0xa1e3('0x52')]));if(_0xe21d8e[_0xa1e3('0x48')][_0xa1e3('0x53')]){_0x56624a['where']=_[_0xa1e3('0x54')](_0x56624a[_0xa1e3('0x51')],{'$or':_[_0xa1e3('0x43')](_0x56624a[_0xa1e3('0x4a')],function(_0x221a63){var _0x3d29ed={};_0x3d29ed[_0x221a63]={'$like':'%'+_0xe21d8e[_0xa1e3('0x48')][_0xa1e3('0x53')]+'%'};return _0x3d29ed;})});}_0x56624a=_[_0xa1e3('0x54')]({},_0x56624a,_0xe21d8e[_0xa1e3('0x5c')]);return _0x111977[_0xa1e3('0xb4')](_0x56624a);}})[_0xa1e3('0x23')](function(_0x64909f){if(_0x64909f){_0x533556=_0x64909f[_0xa1e3('0x4d')];if(!_0xe21d8e[_0xa1e3('0x48')]['hasOwnProperty'](_0xa1e3('0x4f'))){_0x56624a[_0xa1e3('0x33')]=qs['limit'](_0xe21d8e[_0xa1e3('0x48')][_0xa1e3('0x33')]);_0x56624a['offset']=qs[_0xa1e3('0x31')](_0xe21d8e[_0xa1e3('0x48')][_0xa1e3('0x31')]);}return _0x111977[_0xa1e3('0xb4')](_0x56624a);}})[_0xa1e3('0x23')](function(_0x45f09c){if(_0x45f09c){return _0x45f09c?{'count':_0x533556,'rows':_0x45f09c}:null;}})[_0xa1e3('0x23')](respondWithResult(_0x5c3eb1,null))[_0xa1e3('0x2e')](handleError(_0x5c3eb1,null));};exports[_0xa1e3('0x41')]=function(_0x54e788,_0x2bb239,_0x3edb3a){var _0x22ff36,_0x3dbebe,_0x331c86;if(_[_0xa1e3('0x79')](_0x54e788[_0xa1e3('0x65')]['body'])||_0x54e788[_0xa1e3('0x65')]['body']===''){throw new db[(_0xa1e3('0x72'))][(_0xa1e3('0x73'))](_0xa1e3('0x7b'));}if(_[_0xa1e3('0x79')](_0x54e788[_0xa1e3('0x65')]['to'])){}_0x22ff36=_0x54e788[_0xa1e3('0x65')]['to'];return db[_0xa1e3('0x44')][_0xa1e3('0x69')]({'where':{'id':_0x54e788['params']['id']}})['then'](handleEntityNotFound(_0x2bb239,null))[_0xa1e3('0x23')](function(_0x14c120){if(_0x14c120){return db[_0xa1e3('0x44')]['find']({'where':{'id':_0x14c120['id']},'include':[{'model':db[_0xa1e3('0x7f')],'as':'List','include':[{'model':db[_0xa1e3('0x71')],'as':_0xa1e3('0x81'),'where':{[_0x14c120[_0xa1e3('0x7c')]]:_0x22ff36},'limit':0x1,'order':[[_0xa1e3('0x76'),'DESC']]}]}]})['then'](handleEntityNotFound(_0x2bb239,null))['then'](function(_0x4052d5){if(_0x4052d5&&_0x4052d5['List']){_0x3dbebe=_0x4052d5['get']({'plain':!![]});if(_0x3dbebe[_0xa1e3('0x80')]&&_0x3dbebe[_0xa1e3('0x80')][_0xa1e3('0x81')]['length']){return _0x3dbebe[_0xa1e3('0x80')][_0xa1e3('0x81')][0x0];}return db[_0xa1e3('0x71')][_0xa1e3('0x64')](_[_0xa1e3('0x1e')](_0x54e788[_0xa1e3('0x65')],{'firstName':_0x22ff36,[_0x4052d5[_0xa1e3('0x7c')]]:_0x22ff36,'phone':_0x22ff36,'ListId':_0x3dbebe[_0xa1e3('0xb5')]}));}})[_0xa1e3('0x23')](handleEntityNotFound(_0x2bb239,null))[_0xa1e3('0x23')](function(_0xc632b1){if(_0xc632b1){_0x331c86=_0xc632b1;return db[_0xa1e3('0x8d')][_0xa1e3('0x61')]({'where':{'ContactId':_0x331c86['id'],'closed':![],'OpenchannelAccountId':_0x3dbebe['id']}})[_0xa1e3('0x23')](function(_0x430544){if(_0x430544){return[_0x430544,![]];}return db['OpenchannelInteraction'][_0xa1e3('0x64')]({'UserId':_0x54e788[_0xa1e3('0x5d')]['id'],'ContactId':_0x331c86['id'],'OpenchannelAccountId':_0x3dbebe['id'],'lastMsgDirection':'out','Messages':[_[_0xa1e3('0x54')](_0x54e788[_0xa1e3('0x65')],{'read':![],'body':_0x54e788['body'][_0xa1e3('0x65')],'OpenchannelAccountId':_0x3dbebe['id'],'UserId':_0x54e788[_0xa1e3('0x5d')]['id'],'ContactId':_0x331c86['id']})]},{'include':[{'model':db[_0xa1e3('0x99')],'as':_0xa1e3('0xb6')}]})[_0xa1e3('0x23')](function(_0x576f1b){return[_0x576f1b,!![]];});});}})[_0xa1e3('0x8f')](function(_0x558051,_0x414ae9){if(_0x414ae9){return _0x558051;}return db[_0xa1e3('0x99')][_0xa1e3('0x64')](_['merge'](_0x54e788[_0xa1e3('0x65')],{'read':![],'body':_0x54e788[_0xa1e3('0x65')][_0xa1e3('0x65')],'OpenchannelAccountId':_0x3dbebe['id'],'OpenchannelInteractionId':_0x558051['id'],'UserId':_0x54e788[_0xa1e3('0x5d')]['id'],'ContactId':_0x331c86['id']}))[_0xa1e3('0x23')](function(_0x1b2e21){_0x558051[_0xa1e3('0xb7')][_0xa1e3('0xb6')]=[];_0x558051[_0xa1e3('0xb7')][_0xa1e3('0xb6')][_0xa1e3('0x95')](_0x1b2e21[_0xa1e3('0xb7')]);return _0x558051;});});}})[_0xa1e3('0x23')](respondWithResult(_0x2bb239,null))['catch'](handleError(_0x2bb239,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index 7a1a3b2..58e9709 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 _0x1339=['update','remove','emit','hasOwnProperty','exports','OpenchannelAccount','setMaxListeners','save'];(function(_0x51d39,_0x73a608){var _0x396254=function(_0x1cc7bb){while(--_0x1cc7bb){_0x51d39['push'](_0x51d39['shift']());}};_0x396254(++_0x73a608);}(_0x1339,0x1ed));var _0x9133=function(_0x5a89b1,_0xe5d6a){_0x5a89b1=_0x5a89b1-0x0;var _0xe9ff0a=_0x1339[_0x5a89b1];return _0xe9ff0a;};'use strict';var EventEmitter=require('events');var OpenchannelAccount=require('../../mysqldb')['db'][_0x9133('0x0')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x9133('0x1')](0x0);var events={'afterCreate':_0x9133('0x2'),'afterUpdate':_0x9133('0x3'),'afterDestroy':_0x9133('0x4')};function emitEvent(_0x192d48){return function(_0x176e80,_0x110c51,_0x558345){OpenchannelAccountEvents[_0x9133('0x5')](_0x192d48+':'+_0x176e80['id'],_0x176e80);OpenchannelAccountEvents[_0x9133('0x5')](_0x192d48,_0x176e80);_0x558345(null);};}for(var e in events){if(events[_0x9133('0x6')](e)){var event=events[e];OpenchannelAccount['hook'](e,emitEvent(event));}}module[_0x9133('0x7')]=OpenchannelAccountEvents; \ No newline at end of file +var _0x3c81=['hook','exports','events','../../mysqldb','setMaxListeners','save','emit','hasOwnProperty'];(function(_0x3e954d,_0x4cc3a0){var _0x59649b=function(_0x9c6eac){while(--_0x9c6eac){_0x3e954d['push'](_0x3e954d['shift']());}};_0x59649b(++_0x4cc3a0);}(_0x3c81,0x102));var _0x13c8=function(_0xb09413,_0x4892ef){_0xb09413=_0xb09413-0x0;var _0x13793d=_0x3c81[_0xb09413];return _0x13793d;};'use strict';var EventEmitter=require(_0x13c8('0x0'));var OpenchannelAccount=require(_0x13c8('0x1'))['db']['OpenchannelAccount'];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x13c8('0x2')](0x0);var events={'afterCreate':_0x13c8('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x5c3ba4){return function(_0x548599,_0x101d4f,_0x3ec886){OpenchannelAccountEvents[_0x13c8('0x4')](_0x5c3ba4+':'+_0x548599['id'],_0x548599);OpenchannelAccountEvents[_0x13c8('0x4')](_0x5c3ba4,_0x548599);_0x3ec886(null);};}for(var e in events){if(events[_0x13c8('0x5')](e)){var event=events[e];OpenchannelAccount[_0x13c8('0x6')](e,emitEvent(event));}}module[_0x13c8('0x7')]=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index 23e2dd7..aa4b85f 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(_0x107092,_0x477659){var _0x5cb31f=function(_0x58e88b){while(--_0x58e88b){_0x107092['push'](_0x107092['shift']());}};_0x5cb31f(++_0x477659);}(_0xa9e0,0x123));var _0x0a9e=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0xa9e0[_0x18a79d];return _0x4f8848;};'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(_0x29e1c6,_0x2e203f){var _0x29203a=function(_0x2488fb){while(--_0x2488fb){_0x29e1c6['push'](_0x29e1c6['shift']());}};_0x29203a(++_0x2e203f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xa9e0[_0x1facfa];return _0x9ec701;};'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 959ad76..8f2be7b 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 _0xb62e=['result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','request','then','info','OpenchannelAccount,\x20%s,\x20%s','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0xc8a931,_0x260690){var _0x28bd27=function(_0x591b9f){while(--_0x591b9f){_0xc8a931['push'](_0xc8a931['shift']());}};_0x28bd27(++_0x260690);}(_0xb62e,0x1de));var _0xeb62=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xb62e[_0x167cc1];return _0x10bc4b;};'use strict';var _=require(_0xeb62('0x0'));var util=require(_0xeb62('0x1'));var moment=require(_0xeb62('0x2'));var BPromise=require(_0xeb62('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xeb62('0x4'));var db=require(_0xeb62('0x5'))['db'];var utils=require(_0xeb62('0x6'));var logger=require(_0xeb62('0x7'))(_0xeb62('0x8'));var config=require(_0xeb62('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xeb62('0xa')][_0xeb62('0xb')]({'port':0x232a});config[_0xeb62('0xc')]=_['defaults'](config[_0xeb62('0xc')],{'host':_0xeb62('0xd'),'port':0x18eb});var socket=require(_0xeb62('0xe'))(new Redis(config[_0xeb62('0xc')]));require('./openchannelAccount.socket')['register'](socket);function respondWithRpcPromise(_0x4693c9,_0x40584b,_0x6d5e94){return new BPromise(function(_0xf93c21,_0x2fe923){return client[_0xeb62('0xf')](_0x4693c9,_0x6d5e94)[_0xeb62('0x10')](function(_0x3a826a){logger[_0xeb62('0x11')](_0xeb62('0x12'),_0x40584b,'request\x20sent');logger[_0xeb62('0x13')](_0xeb62('0x14'),_0x40584b,_0xeb62('0x15'),JSON[_0xeb62('0x16')](_0x3a826a));if(_0x3a826a['error']){if(_0x3a826a[_0xeb62('0x17')][_0xeb62('0x18')]===0x1f4){logger[_0xeb62('0x17')]('OpenchannelAccount,\x20%s,\x20%s',_0x40584b,_0x3a826a[_0xeb62('0x17')][_0xeb62('0x19')]);return _0x2fe923(_0x3a826a[_0xeb62('0x17')]['message']);}logger[_0xeb62('0x17')](_0xeb62('0x12'),_0x40584b,_0x3a826a[_0xeb62('0x17')][_0xeb62('0x19')]);return _0xf93c21(_0x3a826a[_0xeb62('0x17')][_0xeb62('0x19')]);}else{logger[_0xeb62('0x11')](_0xeb62('0x12'),_0x40584b,_0xeb62('0x15'));_0xf93c21(_0x3a826a[_0xeb62('0x1a')][_0xeb62('0x19')]);}})[_0xeb62('0x1b')](function(_0x3cdf76){logger['error'](_0xeb62('0x12'),_0x40584b,_0x3cdf76);_0x2fe923(_0x3cdf76);});});} \ No newline at end of file +var _0x6582=['code','message','info','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','client','http','redis','defaults','localhost','./openchannelAccount.socket','register','request','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x40e914,_0x5c0801){var _0x217bf0=function(_0xf7309){while(--_0xf7309){_0x40e914['push'](_0x40e914['shift']());}};_0x217bf0(++_0x5c0801);}(_0x6582,0x108));var _0x2658=function(_0x2cb122,_0x5684a0){_0x2cb122=_0x2cb122-0x0;var _0x21af56=_0x6582[_0x2cb122];return _0x21af56;};'use strict';var _=require(_0x2658('0x0'));var util=require(_0x2658('0x1'));var moment=require(_0x2658('0x2'));var BPromise=require(_0x2658('0x3'));var rs=require(_0x2658('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2658('0x5'))['db'];var utils=require(_0x2658('0x6'));var logger=require(_0x2658('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x2658('0x8')][_0x2658('0x9')]({'port':0x232a});config[_0x2658('0xa')]=_[_0x2658('0xb')](config[_0x2658('0xa')],{'host':_0x2658('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2658('0xa')]));require(_0x2658('0xd'))[_0x2658('0xe')](socket);function respondWithRpcPromise(_0x99b9db,_0x455ff9,_0x2b2561){return new BPromise(function(_0x3f22a5,_0x1aaaac){return client[_0x2658('0xf')](_0x99b9db,_0x2b2561)['then'](function(_0x20fe6d){logger['info'](_0x2658('0x10'),_0x455ff9,_0x2658('0x11'));logger[_0x2658('0x12')](_0x2658('0x13'),_0x455ff9,_0x2658('0x11'),JSON[_0x2658('0x14')](_0x20fe6d));if(_0x20fe6d[_0x2658('0x15')]){if(_0x20fe6d['error'][_0x2658('0x16')]===0x1f4){logger[_0x2658('0x15')](_0x2658('0x10'),_0x455ff9,_0x20fe6d[_0x2658('0x15')][_0x2658('0x17')]);return _0x1aaaac(_0x20fe6d['error'][_0x2658('0x17')]);}logger[_0x2658('0x15')](_0x2658('0x10'),_0x455ff9,_0x20fe6d['error'][_0x2658('0x17')]);return _0x3f22a5(_0x20fe6d[_0x2658('0x15')][_0x2658('0x17')]);}else{logger[_0x2658('0x18')]('OpenchannelAccount,\x20%s,\x20%s',_0x455ff9,_0x2658('0x11'));_0x3f22a5(_0x20fe6d['result'][_0x2658('0x17')]);}})[_0x2658('0x19')](function(_0x307220){logger[_0x2658('0x15')]('OpenchannelAccount,\x20%s,\x20%s',_0x455ff9,_0x307220);_0x1aaaac(_0x307220);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index d168c3d..f2721f7 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 _0x9e9b=['register','length','openchannelAccount:','./openchannelAccount.events','update'];(function(_0x41cc2c,_0x53e9bc){var _0x22eead=function(_0x567c73){while(--_0x567c73){_0x41cc2c['push'](_0x41cc2c['shift']());}};_0x22eead(++_0x53e9bc);}(_0x9e9b,0x1a7));var _0xb9e9=function(_0x2df2d0,_0x1d6ea8){_0x2df2d0=_0x2df2d0-0x0;var _0x3c4438=_0x9e9b[_0x2df2d0];return _0x3c4438;};'use strict';var OpenchannelAccountEvents=require(_0xb9e9('0x0'));var events=['save','remove',_0xb9e9('0x1')];function createListener(_0x3d68be,_0x42d119){return function(_0x1ccb2d){_0x42d119['emit'](_0x3d68be,_0x1ccb2d);};}function removeListener(_0x430131,_0x394a8e){return function(){OpenchannelAccountEvents['removeListener'](_0x430131,_0x394a8e);};}exports[_0xb9e9('0x2')]=function(_0x7b18d5){for(var _0x3e4023=0x0,_0x119d31=events[_0xb9e9('0x3')];_0x3e4023<_0x119d31;_0x3e4023++){var _0x3e199b=events[_0x3e4023];var _0x2e9b34=createListener(_0xb9e9('0x4')+_0x3e199b,_0x7b18d5);OpenchannelAccountEvents['on'](_0x3e199b,_0x2e9b34);}}; \ No newline at end of file +var _0x95c5=['register','length','openchannelAccount:','./openchannelAccount.events','save','update','emit','removeListener'];(function(_0x15ae84,_0xb492d9){var _0x59e865=function(_0x341d1d){while(--_0x341d1d){_0x15ae84['push'](_0x15ae84['shift']());}};_0x59e865(++_0xb492d9);}(_0x95c5,0x153));var _0x595c=function(_0x207d2f,_0x44400f){_0x207d2f=_0x207d2f-0x0;var _0x3c3498=_0x95c5[_0x207d2f];return _0x3c3498;};'use strict';var OpenchannelAccountEvents=require(_0x595c('0x0'));var events=[_0x595c('0x1'),'remove',_0x595c('0x2')];function createListener(_0x22a23d,_0x36a7da){return function(_0x1da8dc){_0x36a7da[_0x595c('0x3')](_0x22a23d,_0x1da8dc);};}function removeListener(_0x218d7b,_0xf4369b){return function(){OpenchannelAccountEvents[_0x595c('0x4')](_0x218d7b,_0xf4369b);};}exports[_0x595c('0x5')]=function(_0x46be42){for(var _0x4ff80b=0x0,_0x49a115=events[_0x595c('0x6')];_0x4ff80b<_0x49a115;_0x4ff80b++){var _0xfcaf47=events[_0x4ff80b];var _0x218eca=createListener(_0x595c('0x7')+_0xfcaf47,_0x46be42);OpenchannelAccountEvents['on'](_0xfcaf47,_0x218eca);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index 638608e..b5fb436 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 _0x10cb=['isAuthenticated','post','create','put','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','/:id'];(function(_0x5538f8,_0x74a03){var _0x21b08e=function(_0x486f5f){while(--_0x486f5f){_0x5538f8['push'](_0x5538f8['shift']());}};_0x21b08e(++_0x74a03);}(_0x10cb,0xc5));var _0xb10c=function(_0x51cea2,_0x3ae57c){_0x51cea2=_0x51cea2-0x0;var _0x485abc=_0x10cb[_0x51cea2];return _0x485abc;};'use strict';var multer=require(_0xb10c('0x0'));var util=require('util');var path=require(_0xb10c('0x1'));var timeout=require(_0xb10c('0x2'));var express=require(_0xb10c('0x3'));var router=express[_0xb10c('0x4')]();var fs_extra=require(_0xb10c('0x5'));var auth=require(_0xb10c('0x6'));var interaction=require(_0xb10c('0x7'));var config=require(_0xb10c('0x8'));var controller=require(_0xb10c('0x9'));router[_0xb10c('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0xb10c('0xa')](_0xb10c('0xb'),auth[_0xb10c('0xc')](),controller['show']);router[_0xb10c('0xd')]('/',auth['isAuthenticated'](),controller[_0xb10c('0xe')]);router[_0xb10c('0xf')]('/:id',auth[_0xb10c('0xc')](),controller['update']);router[_0xb10c('0x10')](_0xb10c('0xb'),auth[_0xb10c('0xc')](),controller[_0xb10c('0x11')]);module[_0xb10c('0x12')]=router; \ No newline at end of file +var _0xda3a=['get','isAuthenticated','index','/:id','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x4d8cda,_0x20588d){var _0x44f4a0=function(_0x1a0401){while(--_0x1a0401){_0x4d8cda['push'](_0x4d8cda['shift']());}};_0x44f4a0(++_0x20588d);}(_0xda3a,0x1ad));var _0xada3=function(_0x2d897b,_0x2c8d5d){_0x2d897b=_0x2d897b-0x0;var _0xd40863=_0xda3a[_0x2d897b];return _0xd40863;};'use strict';var multer=require(_0xada3('0x0'));var util=require(_0xada3('0x1'));var path=require(_0xada3('0x2'));var timeout=require(_0xada3('0x3'));var express=require(_0xada3('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xada3('0x5'));var interaction=require(_0xada3('0x6'));var config=require(_0xada3('0x7'));var controller=require('./openchannelApplication.controller');router[_0xada3('0x8')]('/',auth[_0xada3('0x9')](),controller[_0xada3('0xa')]);router[_0xada3('0x8')](_0xada3('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xada3('0xc')]('/',auth['isAuthenticated'](),controller[_0xada3('0xd')]);router[_0xada3('0xe')]('/:id',auth[_0xada3('0x9')](),controller[_0xada3('0xf')]);router[_0xada3('0x10')](_0xada3('0xb'),auth[_0xada3('0x9')](),controller[_0xada3('0x11')]);module[_0xada3('0x12')]=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index 27f10a2..e52a16a 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 _0xca63=['*,*,*,*','sequelize','exports','INTEGER','noop','TEXT','STRING'];(function(_0x446f11,_0x95cf21){var _0x385cb5=function(_0x426715){while(--_0x426715){_0x446f11['push'](_0x446f11['shift']());}};_0x385cb5(++_0x95cf21);}(_0xca63,0x1ba));var _0x3ca6=function(_0x2e57ca,_0x54c316){_0x2e57ca=_0x2e57ca-0x0;var _0x17d8cc=_0xca63[_0x2e57ca];return _0x17d8cc;};'use strict';var Sequelize=require(_0x3ca6('0x0'));module[_0x3ca6('0x1')]={'priority':{'type':Sequelize[_0x3ca6('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x3ca6('0x3')},'appdata':{'type':Sequelize[_0x3ca6('0x4')]()},'description':{'type':Sequelize[_0x3ca6('0x5')]},'interval':{'type':Sequelize[_0x3ca6('0x5')],'defaultValue':_0x3ca6('0x6')}}; \ No newline at end of file +var _0xc773=['STRING','noop','TEXT','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x140ef7,_0x38c3fa){var _0x446793=function(_0xe52a50){while(--_0xe52a50){_0x140ef7['push'](_0x140ef7['shift']());}};_0x446793(++_0x38c3fa);}(_0xc773,0x82));var _0x3c77=function(_0xd968e2,_0x3739b5){_0xd968e2=_0xd968e2-0x0;var _0x536b76=_0xc773[_0xd968e2];return _0x536b76;};'use strict';var Sequelize=require(_0x3c77('0x0'));module[_0x3c77('0x1')]={'priority':{'type':Sequelize[_0x3c77('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x3c77('0x3')],'allowNull':![],'defaultValue':_0x3c77('0x4')},'appdata':{'type':Sequelize[_0x3c77('0x5')]()},'description':{'type':Sequelize[_0x3c77('0x3')]},'interval':{'type':Sequelize[_0x3c77('0x3')],'defaultValue':_0x3c77('0x6')}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index 196c3b1..98053fd 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 _0xec0f=['includeAll','findAll','rows','catch','params','length','include','find','create','body','destroy','zip-dir','request-promise','moment','bluebird','mustache','util','sox','ejs','lodash','squel','crypto','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','stack','name','send','index','OpenchannelApplication','rawAttributes','fieldName','key','map','query','keys','filters','intersection','model','fields','attributes','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options'];(function(_0x3442ba,_0x57040f){var _0x80c090=function(_0x164635){while(--_0x164635){_0x3442ba['push'](_0x3442ba['shift']());}};_0x80c090(++_0x57040f);}(_0xec0f,0x1b5));var _0xfec0=function(_0x55572a,_0x3d75a5){_0x55572a=_0x55572a-0x0;var _0x5b3b99=_0xec0f[_0x55572a];return _0x5b3b99;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xfec0('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfec0('0x1'));var moment=require(_0xfec0('0x2'));var BPromise=require(_0xfec0('0x3'));var Mustache=require(_0xfec0('0x4'));var util=require(_0xfec0('0x5'));var path=require('path');var sox=require(_0xfec0('0x6'));var csv=require('to-csv');var ejs=require(_0xfec0('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xfec0('0x8'));var squel=require(_0xfec0('0x9'));var crypto=require(_0xfec0('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xfec0('0xb'));var querystring=require(_0xfec0('0xc'));var Papa=require(_0xfec0('0xd'));var Redis=require(_0xfec0('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xfec0('0xf'));var hardwareService=require(_0xfec0('0x10'));var logger=require(_0xfec0('0x11'))('api');var utils=require('../../config/utils');var config=require(_0xfec0('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0xfec0('0x13'))['db'];function respondWithStatusCode(_0x8046a8,_0x447259){_0x447259=_0x447259||0xcc;return function(_0x6d0767){if(_0x6d0767){return _0x8046a8[_0xfec0('0x14')](_0x447259);}return _0x8046a8['status'](_0x447259)[_0xfec0('0x15')]();};}function respondWithResult(_0x7a37e2,_0x5789d0){_0x5789d0=_0x5789d0||0xc8;return function(_0x149c30){if(_0x149c30){return _0x7a37e2[_0xfec0('0x16')](_0x5789d0)[_0xfec0('0x17')](_0x149c30);}};}function respondWithFilteredResult(_0x511ff6,_0x6d2ab8){return function(_0x10e44a){if(_0x10e44a){var _0x33939f=typeof _0x6d2ab8[_0xfec0('0x18')]===_0xfec0('0x19')&&typeof _0x6d2ab8['limit']===_0xfec0('0x19');var _0x4ed20f=_0x10e44a['count'];var _0x3d5333=_0x33939f?0x0:_0x6d2ab8[_0xfec0('0x18')];var _0x3f9c7b=_0x33939f?_0x10e44a[_0xfec0('0x1a')]:_0x6d2ab8['offset']+_0x6d2ab8[_0xfec0('0x1b')];var _0x44397e;if(_0x3f9c7b>=_0x4ed20f){_0x3f9c7b=_0x4ed20f;_0x44397e=0xc8;}else{_0x44397e=0xce;}_0x511ff6['status'](_0x44397e);return _0x511ff6[_0xfec0('0x1c')](_0xfec0('0x1d'),_0x3d5333+'-'+_0x3f9c7b+'/'+_0x4ed20f)[_0xfec0('0x17')](_0x10e44a);}return null;};}function patchUpdates(_0x56da21){return function(_0x2917de){try{jsonpatch[_0xfec0('0x1e')](_0x2917de,_0x56da21,!![]);}catch(_0x2d75f3){return BPromise[_0xfec0('0x1f')](_0x2d75f3);}return _0x2917de[_0xfec0('0x20')]();};}function saveUpdates(_0x5a8aa6,_0x99f477){return function(_0x1e6b4c){if(_0x1e6b4c){return _0x1e6b4c[_0xfec0('0x21')](_0x5a8aa6)[_0xfec0('0x22')](function(_0x320e3e){return _0x320e3e;});}return null;};}function removeEntity(_0x5c4b4b,_0xcaf35a){return function(_0x48f46b){if(_0x48f46b){return _0x48f46b['destroy']()[_0xfec0('0x22')](function(){_0x5c4b4b['status'](0xcc)[_0xfec0('0x15')]();});}};}function handleEntityNotFound(_0x15851a,_0x91ecfb){return function(_0x2f7b0a){if(!_0x2f7b0a){_0x15851a[_0xfec0('0x14')](0x194);}return _0x2f7b0a;};}function handleError(_0x4319d5,_0x1d0e88){_0x1d0e88=_0x1d0e88||0x1f4;return function(_0x578518){logger['error'](_0x578518[_0xfec0('0x23')]);if(_0x578518['name']){delete _0x578518[_0xfec0('0x24')];}_0x4319d5['status'](_0x1d0e88)[_0xfec0('0x25')](_0x578518);};}exports[_0xfec0('0x26')]=function(_0x2e5bfa,_0x47d2b6){var _0x1177f5={},_0x10ca3c={},_0x9cd710={'count':0x0,'rows':[]};var _0x19168a=_['map'](db[_0xfec0('0x27')][_0xfec0('0x28')],function(_0x26f26a){return{'name':_0x26f26a[_0xfec0('0x29')],'type':_0x26f26a['type'][_0xfec0('0x2a')]};});_0x10ca3c['model']=_[_0xfec0('0x2b')](_0x19168a,'name');_0x10ca3c[_0xfec0('0x2c')]=_[_0xfec0('0x2d')](_0x2e5bfa[_0xfec0('0x2c')]);_0x10ca3c[_0xfec0('0x2e')]=_[_0xfec0('0x2f')](_0x10ca3c[_0xfec0('0x30')],_0x10ca3c[_0xfec0('0x2c')]);_0x1177f5['attributes']=_[_0xfec0('0x2f')](_0x10ca3c[_0xfec0('0x30')],qs[_0xfec0('0x31')](_0x2e5bfa['query']['fields']));_0x1177f5[_0xfec0('0x32')]=_0x1177f5[_0xfec0('0x32')]['length']?_0x1177f5[_0xfec0('0x32')]:_0x10ca3c[_0xfec0('0x30')];if(!_0x2e5bfa[_0xfec0('0x2c')]['hasOwnProperty'](_0xfec0('0x33'))){_0x1177f5[_0xfec0('0x1b')]=qs[_0xfec0('0x1b')](_0x2e5bfa[_0xfec0('0x2c')]['limit']);_0x1177f5[_0xfec0('0x18')]=qs['offset'](_0x2e5bfa[_0xfec0('0x2c')][_0xfec0('0x18')]);}_0x1177f5[_0xfec0('0x34')]=qs['sort'](_0x2e5bfa['query'][_0xfec0('0x35')]);_0x1177f5[_0xfec0('0x36')]=qs['filters'](_['pick'](_0x2e5bfa['query'],_0x10ca3c[_0xfec0('0x2e')]),_0x19168a);if(_0x2e5bfa['query'][_0xfec0('0x37')]){_0x1177f5['where']=_[_0xfec0('0x38')](_0x1177f5[_0xfec0('0x36')],{'$or':_[_0xfec0('0x2b')](_0x19168a,function(_0xac36f1){if(_0xac36f1[_0xfec0('0x39')]!==_0xfec0('0x3a')){var _0x48a287={};_0x48a287[_0xac36f1[_0xfec0('0x24')]]={'$like':'%'+_0x2e5bfa['query'][_0xfec0('0x37')]+'%'};return _0x48a287;}})});}_0x1177f5=_['merge']({},_0x1177f5,_0x2e5bfa[_0xfec0('0x3b')]);var _0x422d22={'where':_0x1177f5[_0xfec0('0x36')]};return db['OpenchannelApplication'][_0xfec0('0x1a')](_0x422d22)[_0xfec0('0x22')](function(_0x1b20fe){_0x9cd710[_0xfec0('0x1a')]=_0x1b20fe;if(_0x2e5bfa[_0xfec0('0x2c')][_0xfec0('0x3c')]){_0x1177f5['include']=[{'all':!![]}];}return db[_0xfec0('0x27')][_0xfec0('0x3d')](_0x1177f5);})['then'](function(_0x58117c){_0x9cd710[_0xfec0('0x3e')]=_0x58117c;return _0x9cd710;})[_0xfec0('0x22')](respondWithFilteredResult(_0x47d2b6,_0x1177f5))[_0xfec0('0x3f')](handleError(_0x47d2b6,null));};exports['show']=function(_0x2d9af5,_0x3b9722){var _0x140a5d={'raw':!![],'where':{'id':_0x2d9af5[_0xfec0('0x40')]['id']}},_0xccc82e={};_0xccc82e[_0xfec0('0x30')]=_[_0xfec0('0x2d')](db[_0xfec0('0x27')]['rawAttributes']);_0xccc82e['query']=_['keys'](_0x2d9af5[_0xfec0('0x2c')]);_0xccc82e['filters']=_[_0xfec0('0x2f')](_0xccc82e[_0xfec0('0x30')],_0xccc82e[_0xfec0('0x2c')]);_0x140a5d[_0xfec0('0x32')]=_[_0xfec0('0x2f')](_0xccc82e[_0xfec0('0x30')],qs[_0xfec0('0x31')](_0x2d9af5['query'][_0xfec0('0x31')]));_0x140a5d[_0xfec0('0x32')]=_0x140a5d[_0xfec0('0x32')][_0xfec0('0x41')]?_0x140a5d['attributes']:_0xccc82e[_0xfec0('0x30')];if(_0x2d9af5[_0xfec0('0x2c')][_0xfec0('0x3c')]){_0x140a5d[_0xfec0('0x42')]=[{'all':!![]}];}_0x140a5d=_[_0xfec0('0x38')]({},_0x140a5d,_0x2d9af5[_0xfec0('0x3b')]);return db[_0xfec0('0x27')][_0xfec0('0x43')](_0x140a5d)[_0xfec0('0x22')](handleEntityNotFound(_0x3b9722,null))[_0xfec0('0x22')](respondWithResult(_0x3b9722,null))['catch'](handleError(_0x3b9722,null));};exports[_0xfec0('0x44')]=function(_0x4caca9,_0x3bd234){return db[_0xfec0('0x27')][_0xfec0('0x44')](_0x4caca9[_0xfec0('0x45')],{})[_0xfec0('0x22')](respondWithResult(_0x3bd234,0xc9))[_0xfec0('0x3f')](handleError(_0x3bd234,null));};exports[_0xfec0('0x21')]=function(_0x561600,_0x38897f){if(_0x561600[_0xfec0('0x45')]['id']){delete _0x561600[_0xfec0('0x45')]['id'];}return db[_0xfec0('0x27')][_0xfec0('0x43')]({'where':{'id':_0x561600[_0xfec0('0x40')]['id']}})[_0xfec0('0x22')](handleEntityNotFound(_0x38897f,null))['then'](saveUpdates(_0x561600['body'],null))['then'](respondWithResult(_0x38897f,null))[_0xfec0('0x3f')](handleError(_0x38897f,null));};exports[_0xfec0('0x46')]=function(_0x11c4ad,_0x3d20c8){return db[_0xfec0('0x27')][_0xfec0('0x43')]({'where':{'id':_0x11c4ad[_0xfec0('0x40')]['id']}})[_0xfec0('0x22')](handleEntityNotFound(_0x3d20c8,null))[_0xfec0('0x22')](removeEntity(_0x3d20c8,null))['catch'](handleError(_0x3d20c8,null));}; \ No newline at end of file +var _0x51ff=['util','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','save','then','destroy','error','stack','name','send','index','map','OpenchannelApplication','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','options','includeAll','include','rows','catch','show','params','merge','find','update','body','rimraf','fast-json-patch','bluebird','mustache'];(function(_0x1b65b8,_0x120585){var _0x50150c=function(_0x1c5325){while(--_0x1c5325){_0x1b65b8['push'](_0x1b65b8['shift']());}};_0x50150c(++_0x120585);}(_0x51ff,0x90));var _0xf51f=function(_0x242a81,_0x5ad269){_0x242a81=_0x242a81-0x0;var _0x34dae1=_0x51ff[_0x242a81];return _0x34dae1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf51f('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf51f('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xf51f('0x2'));var Mustache=require(_0xf51f('0x3'));var util=require(_0xf51f('0x4'));var path=require(_0xf51f('0x5'));var sox=require(_0xf51f('0x6'));var csv=require('to-csv');var ejs=require(_0xf51f('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf51f('0x8'));var squel=require(_0xf51f('0x9'));var crypto=require(_0xf51f('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xf51f('0xb'));var toCsv=require(_0xf51f('0xc'));var querystring=require(_0xf51f('0xd'));var Papa=require('papaparse');var Redis=require(_0xf51f('0xe'));var authService=require(_0xf51f('0xf'));var qs=require(_0xf51f('0x10'));var as=require(_0xf51f('0x11'));var hardwareService=require(_0xf51f('0x12'));var logger=require(_0xf51f('0x13'))('api');var utils=require('../../config/utils');var config=require(_0xf51f('0x14'));var licenseUtil=require(_0xf51f('0x15'));var db=require(_0xf51f('0x16'))['db'];function respondWithStatusCode(_0x93e989,_0x3e6f62){_0x3e6f62=_0x3e6f62||0xcc;return function(_0xb73861){if(_0xb73861){return _0x93e989[_0xf51f('0x17')](_0x3e6f62);}return _0x93e989[_0xf51f('0x18')](_0x3e6f62)[_0xf51f('0x19')]();};}function respondWithResult(_0xb78367,_0x308c3a){_0x308c3a=_0x308c3a||0xc8;return function(_0x451081){if(_0x451081){return _0xb78367['status'](_0x308c3a)[_0xf51f('0x1a')](_0x451081);}};}function respondWithFilteredResult(_0x4a2a4e,_0x25c751){return function(_0x99f14e){if(_0x99f14e){var _0x1ba196=typeof _0x25c751[_0xf51f('0x1b')]===_0xf51f('0x1c')&&typeof _0x25c751[_0xf51f('0x1d')]===_0xf51f('0x1c');var _0x50f459=_0x99f14e[_0xf51f('0x1e')];var _0x257f78=_0x1ba196?0x0:_0x25c751[_0xf51f('0x1b')];var _0x3996d9=_0x1ba196?_0x99f14e[_0xf51f('0x1e')]:_0x25c751[_0xf51f('0x1b')]+_0x25c751['limit'];var _0x371ea9;if(_0x3996d9>=_0x50f459){_0x3996d9=_0x50f459;_0x371ea9=0xc8;}else{_0x371ea9=0xce;}_0x4a2a4e['status'](_0x371ea9);return _0x4a2a4e[_0xf51f('0x1f')](_0xf51f('0x20'),_0x257f78+'-'+_0x3996d9+'/'+_0x50f459)[_0xf51f('0x1a')](_0x99f14e);}return null;};}function patchUpdates(_0x5461ad){return function(_0x52d827){try{jsonpatch[_0xf51f('0x21')](_0x52d827,_0x5461ad,!![]);}catch(_0x308a33){return BPromise['reject'](_0x308a33);}return _0x52d827[_0xf51f('0x22')]();};}function saveUpdates(_0x953d1b,_0xbc092a){return function(_0x278274){if(_0x278274){return _0x278274['update'](_0x953d1b)[_0xf51f('0x23')](function(_0x57f137){return _0x57f137;});}return null;};}function removeEntity(_0x5f41ff,_0x52b4e8){return function(_0x2ab861){if(_0x2ab861){return _0x2ab861[_0xf51f('0x24')]()['then'](function(){_0x5f41ff[_0xf51f('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1f582e,_0x1d1a7b){return function(_0x601373){if(!_0x601373){_0x1f582e[_0xf51f('0x17')](0x194);}return _0x601373;};}function handleError(_0x3badaa,_0x25a05f){_0x25a05f=_0x25a05f||0x1f4;return function(_0x36d7b7){logger[_0xf51f('0x25')](_0x36d7b7[_0xf51f('0x26')]);if(_0x36d7b7[_0xf51f('0x27')]){delete _0x36d7b7[_0xf51f('0x27')];}_0x3badaa['status'](_0x25a05f)[_0xf51f('0x28')](_0x36d7b7);};}exports[_0xf51f('0x29')]=function(_0x5b8a33,_0x4aafbb){var _0x5da8bd={},_0x332086={},_0x35746f={'count':0x0,'rows':[]};var _0x5a8d21=_[_0xf51f('0x2a')](db[_0xf51f('0x2b')][_0xf51f('0x2c')],function(_0x44c69a){return{'name':_0x44c69a[_0xf51f('0x2d')],'type':_0x44c69a[_0xf51f('0x2e')]['key']};});_0x332086[_0xf51f('0x2f')]=_[_0xf51f('0x2a')](_0x5a8d21,_0xf51f('0x27'));_0x332086[_0xf51f('0x30')]=_[_0xf51f('0x31')](_0x5b8a33[_0xf51f('0x30')]);_0x332086[_0xf51f('0x32')]=_[_0xf51f('0x33')](_0x332086[_0xf51f('0x2f')],_0x332086[_0xf51f('0x30')]);_0x5da8bd[_0xf51f('0x34')]=_['intersection'](_0x332086[_0xf51f('0x2f')],qs[_0xf51f('0x35')](_0x5b8a33[_0xf51f('0x30')][_0xf51f('0x35')]));_0x5da8bd[_0xf51f('0x34')]=_0x5da8bd[_0xf51f('0x34')][_0xf51f('0x36')]?_0x5da8bd[_0xf51f('0x34')]:_0x332086[_0xf51f('0x2f')];if(!_0x5b8a33['query'][_0xf51f('0x37')](_0xf51f('0x38'))){_0x5da8bd[_0xf51f('0x1d')]=qs[_0xf51f('0x1d')](_0x5b8a33[_0xf51f('0x30')][_0xf51f('0x1d')]);_0x5da8bd[_0xf51f('0x1b')]=qs[_0xf51f('0x1b')](_0x5b8a33['query'][_0xf51f('0x1b')]);}_0x5da8bd[_0xf51f('0x39')]=qs[_0xf51f('0x3a')](_0x5b8a33[_0xf51f('0x30')][_0xf51f('0x3a')]);_0x5da8bd[_0xf51f('0x3b')]=qs[_0xf51f('0x32')](_[_0xf51f('0x3c')](_0x5b8a33[_0xf51f('0x30')],_0x332086[_0xf51f('0x32')]),_0x5a8d21);if(_0x5b8a33['query']['filter']){_0x5da8bd['where']=_['merge'](_0x5da8bd[_0xf51f('0x3b')],{'$or':_['map'](_0x5a8d21,function(_0xb98e96){if(_0xb98e96[_0xf51f('0x2e')]!==_0xf51f('0x3d')){var _0x30f2d0={};_0x30f2d0[_0xb98e96[_0xf51f('0x27')]]={'$like':'%'+_0x5b8a33[_0xf51f('0x30')][_0xf51f('0x3e')]+'%'};return _0x30f2d0;}})});}_0x5da8bd=_['merge']({},_0x5da8bd,_0x5b8a33[_0xf51f('0x3f')]);var _0x5b795b={'where':_0x5da8bd[_0xf51f('0x3b')]};return db[_0xf51f('0x2b')][_0xf51f('0x1e')](_0x5b795b)[_0xf51f('0x23')](function(_0x7a1297){_0x35746f[_0xf51f('0x1e')]=_0x7a1297;if(_0x5b8a33[_0xf51f('0x30')][_0xf51f('0x40')]){_0x5da8bd[_0xf51f('0x41')]=[{'all':!![]}];}return db['OpenchannelApplication']['findAll'](_0x5da8bd);})[_0xf51f('0x23')](function(_0x45e757){_0x35746f[_0xf51f('0x42')]=_0x45e757;return _0x35746f;})[_0xf51f('0x23')](respondWithFilteredResult(_0x4aafbb,_0x5da8bd))[_0xf51f('0x43')](handleError(_0x4aafbb,null));};exports[_0xf51f('0x44')]=function(_0x52a056,_0x20a7ea){var _0x1d5a49={'raw':!![],'where':{'id':_0x52a056[_0xf51f('0x45')]['id']}},_0x4c9bd8={};_0x4c9bd8[_0xf51f('0x2f')]=_[_0xf51f('0x31')](db[_0xf51f('0x2b')][_0xf51f('0x2c')]);_0x4c9bd8['query']=_[_0xf51f('0x31')](_0x52a056[_0xf51f('0x30')]);_0x4c9bd8[_0xf51f('0x32')]=_['intersection'](_0x4c9bd8[_0xf51f('0x2f')],_0x4c9bd8[_0xf51f('0x30')]);_0x1d5a49[_0xf51f('0x34')]=_[_0xf51f('0x33')](_0x4c9bd8[_0xf51f('0x2f')],qs[_0xf51f('0x35')](_0x52a056['query'][_0xf51f('0x35')]));_0x1d5a49[_0xf51f('0x34')]=_0x1d5a49[_0xf51f('0x34')][_0xf51f('0x36')]?_0x1d5a49[_0xf51f('0x34')]:_0x4c9bd8[_0xf51f('0x2f')];if(_0x52a056['query'][_0xf51f('0x40')]){_0x1d5a49[_0xf51f('0x41')]=[{'all':!![]}];}_0x1d5a49=_[_0xf51f('0x46')]({},_0x1d5a49,_0x52a056[_0xf51f('0x3f')]);return db[_0xf51f('0x2b')][_0xf51f('0x47')](_0x1d5a49)['then'](handleEntityNotFound(_0x20a7ea,null))[_0xf51f('0x23')](respondWithResult(_0x20a7ea,null))[_0xf51f('0x43')](handleError(_0x20a7ea,null));};exports['create']=function(_0x1a2c28,_0x4e16b0){return db[_0xf51f('0x2b')]['create'](_0x1a2c28['body'],{})[_0xf51f('0x23')](respondWithResult(_0x4e16b0,0xc9))['catch'](handleError(_0x4e16b0,null));};exports[_0xf51f('0x48')]=function(_0x41d9a0,_0x160ce7){if(_0x41d9a0['body']['id']){delete _0x41d9a0[_0xf51f('0x49')]['id'];}return db[_0xf51f('0x2b')]['find']({'where':{'id':_0x41d9a0[_0xf51f('0x45')]['id']}})[_0xf51f('0x23')](handleEntityNotFound(_0x160ce7,null))[_0xf51f('0x23')](saveUpdates(_0x41d9a0[_0xf51f('0x49')],null))['then'](respondWithResult(_0x160ce7,null))[_0xf51f('0x43')](handleError(_0x160ce7,null));};exports[_0xf51f('0x24')]=function(_0x355d67,_0x989898){return db['OpenchannelApplication'][_0xf51f('0x47')]({'where':{'id':_0x355d67[_0xf51f('0x45')]['id']}})[_0xf51f('0x23')](handleEntityNotFound(_0x989898,null))[_0xf51f('0x23')](removeEntity(_0x989898,null))[_0xf51f('0x43')](handleError(_0x989898,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index 1a3c977..a22eb07 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 _0x200c=['bluebird','request-promise','path','rimraf','../../config/environment','./openchannelApplication.attributes','OpenchannelApplication','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment'];(function(_0xaf524,_0x288431){var _0x4a5cf2=function(_0x5c1330){while(--_0x5c1330){_0xaf524['push'](_0xaf524['shift']());}};_0x4a5cf2(++_0x288431);}(_0x200c,0x10c));var _0xc200=function(_0xc3075a,_0x51279c){_0xc3075a=_0xc3075a-0x0;var _0x3ce7af=_0x200c[_0xc3075a];return _0x3ce7af;};'use strict';var _=require(_0xc200('0x0'));var util=require(_0xc200('0x1'));var logger=require(_0xc200('0x2'))(_0xc200('0x3'));var moment=require(_0xc200('0x4'));var BPromise=require(_0xc200('0x5'));var rp=require(_0xc200('0x6'));var fs=require('fs');var path=require(_0xc200('0x7'));var rimraf=require(_0xc200('0x8'));var config=require(_0xc200('0x9'));var attributes=require(_0xc200('0xa'));module['exports']=function(_0x15f12d,_0xf05b44){return _0x15f12d['define'](_0xc200('0xb'),attributes,{'tableName':'openchannel_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xc200('0xc')});}; \ No newline at end of file +var _0xe4eb=['openchannel_applications','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xe4eb,0x1d1));var _0xbe4e=function(_0x4d0fb5,_0x20cd73){_0x4d0fb5=_0x4d0fb5-0x0;var _0x5b73ef=_0xe4eb[_0x4d0fb5];return _0x5b73ef;};'use strict';var _=require(_0xbe4e('0x0'));var util=require('util');var logger=require(_0xbe4e('0x1'))(_0xbe4e('0x2'));var moment=require(_0xbe4e('0x3'));var BPromise=require(_0xbe4e('0x4'));var rp=require(_0xbe4e('0x5'));var fs=require('fs');var path=require(_0xbe4e('0x6'));var rimraf=require(_0xbe4e('0x7'));var config=require(_0xbe4e('0x8'));var attributes=require('./openchannelApplication.attributes');module[_0xbe4e('0x9')]=function(_0x13ed0e,_0x5e2ea9){return _0x13ed0e[_0xbe4e('0xa')]('OpenchannelApplication',attributes,{'tableName':_0xbe4e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xbe4e('0xc'),'collate':_0xbe4e('0xd')});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index d0f3855..3821b3d 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 _0x7891=['UpdateOpenchannelApplication','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','then','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','OpenchannelApplication','update','body','options','where'];(function(_0x11160d,_0x413adc){var _0x21520a=function(_0x272f3c){while(--_0x272f3c){_0x11160d['push'](_0x11160d['shift']());}};_0x21520a(++_0x413adc);}(_0x7891,0x79));var _0x1789=function(_0x48de7d,_0x23bd65){_0x48de7d=_0x48de7d-0x0;var _0x276f39=_0x7891[_0x48de7d];return _0x276f39;};'use strict';var _=require(_0x1789('0x0'));var util=require(_0x1789('0x1'));var moment=require(_0x1789('0x2'));var BPromise=require(_0x1789('0x3'));var rs=require(_0x1789('0x4'));var fs=require('fs');var Redis=require(_0x1789('0x5'));var db=require(_0x1789('0x6'))['db'];var utils=require(_0x1789('0x7'));var logger=require(_0x1789('0x8'))(_0x1789('0x9'));var config=require(_0x1789('0xa'));var jayson=require(_0x1789('0xb'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4ef839,_0x933482,_0x56c2dc){return new BPromise(function(_0x211d2b,_0x562eb0){return client['request'](_0x4ef839,_0x56c2dc)[_0x1789('0xc')](function(_0x2da10a){logger[_0x1789('0xd')](_0x1789('0xe'),_0x933482,_0x1789('0xf'));logger[_0x1789('0x10')](_0x1789('0x11'),_0x933482,_0x1789('0xf'),JSON[_0x1789('0x12')](_0x2da10a));if(_0x2da10a[_0x1789('0x13')]){if(_0x2da10a['error'][_0x1789('0x14')]===0x1f4){logger[_0x1789('0x13')]('OpenchannelApplication,\x20%s,\x20%s',_0x933482,_0x2da10a['error']['message']);return _0x562eb0(_0x2da10a[_0x1789('0x13')][_0x1789('0x15')]);}logger[_0x1789('0x13')](_0x1789('0xe'),_0x933482,_0x2da10a[_0x1789('0x13')][_0x1789('0x15')]);return _0x211d2b(_0x2da10a[_0x1789('0x13')][_0x1789('0x15')]);}else{logger[_0x1789('0xd')](_0x1789('0xe'),_0x933482,'request\x20sent');_0x211d2b(_0x2da10a[_0x1789('0x16')][_0x1789('0x15')]);}})[_0x1789('0x17')](function(_0x4f40a3){logger['error'](_0x1789('0xe'),_0x933482,_0x4f40a3);_0x562eb0(_0x4f40a3);});});}exports['UpdateOpenchannelApplication']=function(_0xa8a10){var _0x16205b=this;return new Promise(function(_0x5ec497,_0x9085b4){return db[_0x1789('0x18')][_0x1789('0x19')](_0xa8a10[_0x1789('0x1a')],{'raw':_0xa8a10[_0x1789('0x1b')]?_0xa8a10[_0x1789('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xa8a10[_0x1789('0x1b')]?_0xa8a10[_0x1789('0x1b')][_0x1789('0x1c')]||null:null,'attributes':_0xa8a10[_0x1789('0x1b')]?_0xa8a10[_0x1789('0x1b')]['attributes']||null:null,'limit':_0xa8a10[_0x1789('0x1b')]?_0xa8a10[_0x1789('0x1b')]['limit']||null:null})[_0x1789('0xc')](function(_0x25c5ab){logger['info'](_0x1789('0x1d'),_0xa8a10);logger['debug'](_0x1789('0x1d'),_0xa8a10,JSON[_0x1789('0x12')](_0x25c5ab));_0x5ec497(_0x25c5ab);})[_0x1789('0x17')](function(_0x2d960f){logger['error'](_0x1789('0x1d'),_0x2d960f[_0x1789('0x15')],_0xa8a10);_0x9085b4(_0x16205b[_0x1789('0x13')](0x1f4,_0x2d960f[_0x1789('0x15')]));});});}; \ No newline at end of file +var _0x6bc0=['code','OpenchannelApplication,\x20%s,\x20%s','message','request\x20sent','result','catch','UpdateOpenchannelApplication','OpenchannelApplication','update','body','options','raw','where','attributes','then','stringify','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','error'];(function(_0x3877c1,_0x238c29){var _0x59056a=function(_0x3567cd){while(--_0x3567cd){_0x3877c1['push'](_0x3877c1['shift']());}};_0x59056a(++_0x238c29);}(_0x6bc0,0x1d0));var _0x06bc=function(_0x5066de,_0x4cc35f){_0x5066de=_0x5066de-0x0;var _0x4802d4=_0x6bc0[_0x5066de];return _0x4802d4;};'use strict';var _=require('lodash');var util=require(_0x06bc('0x0'));var moment=require(_0x06bc('0x1'));var BPromise=require(_0x06bc('0x2'));var rs=require(_0x06bc('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x06bc('0x4'))['db'];var utils=require(_0x06bc('0x5'));var logger=require(_0x06bc('0x6'))(_0x06bc('0x7'));var config=require(_0x06bc('0x8'));var jayson=require(_0x06bc('0x9'));var client=jayson[_0x06bc('0xa')][_0x06bc('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x24d0ae,_0x27b28a,_0x191714){return new BPromise(function(_0x5d4bfc,_0x26f0e0){return client['request'](_0x24d0ae,_0x191714)['then'](function(_0x55227a){logger[_0x06bc('0xc')]('OpenchannelApplication,\x20%s,\x20%s',_0x27b28a,'request\x20sent');logger[_0x06bc('0xd')](_0x06bc('0xe'),_0x27b28a,'request\x20sent',JSON['stringify'](_0x55227a));if(_0x55227a[_0x06bc('0xf')]){if(_0x55227a[_0x06bc('0xf')][_0x06bc('0x10')]===0x1f4){logger[_0x06bc('0xf')](_0x06bc('0x11'),_0x27b28a,_0x55227a[_0x06bc('0xf')]['message']);return _0x26f0e0(_0x55227a[_0x06bc('0xf')]['message']);}logger[_0x06bc('0xf')]('OpenchannelApplication,\x20%s,\x20%s',_0x27b28a,_0x55227a['error'][_0x06bc('0x12')]);return _0x5d4bfc(_0x55227a[_0x06bc('0xf')][_0x06bc('0x12')]);}else{logger[_0x06bc('0xc')](_0x06bc('0x11'),_0x27b28a,_0x06bc('0x13'));_0x5d4bfc(_0x55227a[_0x06bc('0x14')]['message']);}})[_0x06bc('0x15')](function(_0xf97b76){logger['error'](_0x06bc('0x11'),_0x27b28a,_0xf97b76);_0x26f0e0(_0xf97b76);});});}exports[_0x06bc('0x16')]=function(_0x3a43dd){var _0x5c6f17=this;return new Promise(function(_0x1e6e0c,_0x330e4f){return db[_0x06bc('0x17')][_0x06bc('0x18')](_0x3a43dd[_0x06bc('0x19')],{'raw':_0x3a43dd['options']?_0x3a43dd[_0x06bc('0x1a')][_0x06bc('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3a43dd[_0x06bc('0x1a')]?_0x3a43dd[_0x06bc('0x1a')][_0x06bc('0x1c')]||null:null,'attributes':_0x3a43dd['options']?_0x3a43dd[_0x06bc('0x1a')][_0x06bc('0x1d')]||null:null,'limit':_0x3a43dd[_0x06bc('0x1a')]?_0x3a43dd[_0x06bc('0x1a')]['limit']||null:null})[_0x06bc('0x1e')](function(_0x3b2364){logger[_0x06bc('0xc')](_0x06bc('0x16'),_0x3a43dd);logger[_0x06bc('0xd')](_0x06bc('0x16'),_0x3a43dd,JSON[_0x06bc('0x1f')](_0x3b2364));_0x1e6e0c(_0x3b2364);})[_0x06bc('0x15')](function(_0x55aaf9){logger['error'](_0x06bc('0x16'),_0x55aaf9[_0x06bc('0x12')],_0x3a43dd);_0x330e4f(_0x5c6f17['error'](0x1f4,_0x55aaf9['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index 472c6f3..bd47690 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 _0x18df=['isAuthenticated','download','post','create','addMessage','/:id/tags','openchannelinteraction:addtags','put','tracked','openchannel','openchannelinteraction:update','update','openchannelinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller','get','describe','/:id','show','/:id/messages'];(function(_0x28a376,_0x409968){var _0x1f3797=function(_0x589232){while(--_0x589232){_0x28a376['push'](_0x28a376['shift']());}};_0x1f3797(++_0x409968);}(_0x18df,0x88));var _0xf18d=function(_0x48238e,_0x2b4921){_0x48238e=_0x48238e-0x0;var _0x5c6400=_0x18df[_0x48238e];return _0x5c6400;};'use strict';var multer=require(_0xf18d('0x0'));var util=require(_0xf18d('0x1'));var path=require(_0xf18d('0x2'));var timeout=require(_0xf18d('0x3'));var express=require('express');var router=express[_0xf18d('0x4')]();var fs_extra=require(_0xf18d('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xf18d('0x6'));var config=require(_0xf18d('0x7'));var controller=require(_0xf18d('0x8'));router[_0xf18d('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/describe',auth['isAuthenticated'](),controller[_0xf18d('0xa')]);router[_0xf18d('0x9')](_0xf18d('0xb'),auth['isAuthenticated'](),controller[_0xf18d('0xc')]);router[_0xf18d('0x9')](_0xf18d('0xd'),auth[_0xf18d('0xe')](),controller['getMessages']);router['get']('/:id/download',auth[_0xf18d('0xe')](),controller[_0xf18d('0xf')]);router[_0xf18d('0x10')]('/',auth[_0xf18d('0xe')](),controller[_0xf18d('0x11')]);router[_0xf18d('0x10')](_0xf18d('0xd'),auth[_0xf18d('0xe')](),controller[_0xf18d('0x12')]);router[_0xf18d('0x10')](_0xf18d('0x13'),auth[_0xf18d('0xe')](),interaction['tracked']('openchannel',_0xf18d('0x14')),controller['addTags']);router[_0xf18d('0x15')]('/:id',auth['isAuthenticated'](),interaction[_0xf18d('0x16')](_0xf18d('0x17'),_0xf18d('0x18')),controller[_0xf18d('0x19')]);router['delete'](_0xf18d('0xb'),auth[_0xf18d('0xe')](),interaction[_0xf18d('0x16')](_0xf18d('0x17'),_0xf18d('0x1a')),controller[_0xf18d('0x1b')]);router['delete'](_0xf18d('0x13'),auth['isAuthenticated'](),controller[_0xf18d('0x1c')]);module[_0xf18d('0x1d')]=router; \ No newline at end of file +var _0xfe6a=['isAuthenticated','/:id','/:id/messages','getMessages','/:id/download','download','create','post','tracked','openchannel','openchannelinteraction:addtags','addTags','openchannelinteraction:update','delete','openchannelinteraction:destroy','/:id/tags','removeTags','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe'];(function(_0x51dd2c,_0x2a2345){var _0x41c678=function(_0xa14c31){while(--_0xa14c31){_0x51dd2c['push'](_0x51dd2c['shift']());}};_0x41c678(++_0x2a2345);}(_0xfe6a,0x1d3));var _0xafe6=function(_0x5b013c,_0x40b30e){_0x5b013c=_0x5b013c-0x0;var _0x131621=_0xfe6a[_0x5b013c];return _0x131621;};'use strict';var multer=require(_0xafe6('0x0'));var util=require(_0xafe6('0x1'));var path=require(_0xafe6('0x2'));var timeout=require(_0xafe6('0x3'));var express=require(_0xafe6('0x4'));var router=express[_0xafe6('0x5')]();var fs_extra=require(_0xafe6('0x6'));var auth=require(_0xafe6('0x7'));var interaction=require(_0xafe6('0x8'));var config=require(_0xafe6('0x9'));var controller=require('./openchannelInteraction.controller');router[_0xafe6('0xa')]('/',auth['isAuthenticated'](),controller[_0xafe6('0xb')]);router[_0xafe6('0xa')](_0xafe6('0xc'),auth[_0xafe6('0xd')](),controller['describe']);router[_0xafe6('0xa')](_0xafe6('0xe'),auth['isAuthenticated'](),controller['show']);router[_0xafe6('0xa')](_0xafe6('0xf'),auth[_0xafe6('0xd')](),controller[_0xafe6('0x10')]);router[_0xafe6('0xa')](_0xafe6('0x11'),auth[_0xafe6('0xd')](),controller[_0xafe6('0x12')]);router['post']('/',auth[_0xafe6('0xd')](),controller[_0xafe6('0x13')]);router['post'](_0xafe6('0xf'),auth[_0xafe6('0xd')](),controller['addMessage']);router[_0xafe6('0x14')]('/:id/tags',auth[_0xafe6('0xd')](),interaction[_0xafe6('0x15')](_0xafe6('0x16'),_0xafe6('0x17')),controller[_0xafe6('0x18')]);router['put'](_0xafe6('0xe'),auth[_0xafe6('0xd')](),interaction[_0xafe6('0x15')](_0xafe6('0x16'),_0xafe6('0x19')),controller['update']);router[_0xafe6('0x1a')](_0xafe6('0xe'),auth['isAuthenticated'](),interaction[_0xafe6('0x15')](_0xafe6('0x16'),_0xafe6('0x1b')),controller['destroy']);router[_0xafe6('0x1a')](_0xafe6('0x1c'),auth['isAuthenticated'](),controller[_0xafe6('0x1d')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index 176fec4..33dc096 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 _0x61e6=['sequelize','exports','BOOLEAN','STRING','DATE','ENUM','out'];(function(_0xe2dce0,_0xacbb6a){var _0x134a7d=function(_0x17f8b0){while(--_0x17f8b0){_0xe2dce0['push'](_0xe2dce0['shift']());}};_0x134a7d(++_0xacbb6a);}(_0x61e6,0x9a));var _0x661e=function(_0x243834,_0x256db1){_0x243834=_0x243834-0x0;var _0xe3519=_0x61e6[_0x243834];return _0xe3519;};'use strict';var Sequelize=require(_0x661e('0x0'));module[_0x661e('0x1')]={'closed':{'type':Sequelize[_0x661e('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x661e('0x3')]},'secondDisposition':{'type':Sequelize[_0x661e('0x3')]},'thirdDisposition':{'type':Sequelize[_0x661e('0x3')]},'note':{'type':Sequelize[_0x661e('0x3')]},'read1stAt':{'type':Sequelize[_0x661e('0x4')]},'threadId':{'type':Sequelize[_0x661e('0x3')]},'externalUrl':{'type':Sequelize[_0x661e('0x3')]},'lastMsgAt':{'type':Sequelize[_0x661e('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x661e('0x5')]('in',_0x661e('0x6')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x661e('0x3')]},'autoreplyExecuted':{'type':Sequelize[_0x661e('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x3663=['out','sequelize','exports','BOOLEAN','STRING','DATE'];(function(_0x31c201,_0x2f0396){var _0xe880b4=function(_0xc17602){while(--_0xc17602){_0x31c201['push'](_0x31c201['shift']());}};_0xe880b4(++_0x2f0396);}(_0x3663,0x1cf));var _0x3366=function(_0x311cfe,_0x42e904){_0x311cfe=_0x311cfe-0x0;var _0x40ce33=_0x3663[_0x311cfe];return _0x40ce33;};'use strict';var Sequelize=require(_0x3366('0x0'));module[_0x3366('0x1')]={'closed':{'type':Sequelize[_0x3366('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x3366('0x3')]},'secondDisposition':{'type':Sequelize[_0x3366('0x3')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x3366('0x3')]},'read1stAt':{'type':Sequelize[_0x3366('0x4')]},'threadId':{'type':Sequelize[_0x3366('0x3')]},'externalUrl':{'type':Sequelize[_0x3366('0x3')]},'lastMsgAt':{'type':Sequelize[_0x3366('0x4')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x3366('0x5')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x3366('0x3')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index 6bf31a8..76930ae 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 _0xc551=['pipe','createWriteStream','System','firstName','out','views','downloadInteraction.ejs','.pdf','Openchannel','download','log','err','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','then','error','stack','name','send','Users','map','fullname','TagIds','Tags','split','push','index','rawAttributes','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filters','select','field','color','tools_tags','u.id','u.fullname','ui.OpenchannelInteractionId','left_join','u.id\x20=\x20ui.UserId','from','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','o.id\x20=\x20i.UserId','openchannel_accounts','a.id\x20=\x20i.OpenchannelAccountId','openchannel_messages','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','value','`\x20=\x200','having','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','body','keys','some','compact','forEach','OpenchannelAccountId','where','concat','createdAt','parse','$gte','$lte','null','\x20IS\x20NULL','\x20=\x20?','read','tag','filter','replace','isNumeric','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','QueryTypes','SELECT','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','contactName','isEmpty','resolve','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','getOpenchannelAccounts','i.OpenchannelAccountId\x20IN\x20?','role','agent','sequelize','toString','OpenchannelInteraction','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20i.from\x20IS\x20NOT\x20NULL\x20AND\x20i.from\x20<>\x20\x27\x27\x20THEN\x20i.from\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','Contact.firstName','c.lastName','Contact.lastName','c.email','c.phone','Contact.phone','c.mobile','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','ui.OpenchannelInteractionId\x20IN\x20?','OpenchannelInteractionId','all','rows','catch','show','params','includeAll','include','options','create','update','destroy','describe','addMessage','OpenchannelMessage','ids','omit','getMessages','findOne','merge','format','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','spread','emit','removeTags','root','server','join','files','attachments','transcript-%d-%s.zip','CmContact','Contact','lastName','Attachment','Messages','direction','secret','Account','Owner','mkdirSync','closedAt','disposition','threadId','basename','createReadStream'];(function(_0x320ea7,_0x4313af){var _0xc3d97d=function(_0x236cc2){while(--_0x236cc2){_0x320ea7['push'](_0x320ea7['shift']());}};_0xc3d97d(++_0x4313af);}(_0xc551,0xf6));var _0x1c55=function(_0x494965,_0x31a20a){_0x494965=_0x494965-0x0;var _0x55e7ff=_0xc551[_0x494965];return _0x55e7ff;};'use strict';var emlformat=require(_0x1c55('0x0'));var rimraf=require(_0x1c55('0x1'));var zipdir=require(_0x1c55('0x2'));var jsonpatch=require(_0x1c55('0x3'));var rp=require(_0x1c55('0x4'));var moment=require(_0x1c55('0x5'));var BPromise=require(_0x1c55('0x6'));var Mustache=require(_0x1c55('0x7'));var util=require(_0x1c55('0x8'));var path=require(_0x1c55('0x9'));var sox=require(_0x1c55('0xa'));var csv=require(_0x1c55('0xb'));var ejs=require(_0x1c55('0xc'));var fs=require('fs');var fs_extra=require(_0x1c55('0xd'));var _=require(_0x1c55('0xe'));var squel=require(_0x1c55('0xf'));var crypto=require('crypto');var jsforce=require(_0x1c55('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x1c55('0xb'));var querystring=require('querystring');var Papa=require(_0x1c55('0x11'));var Redis=require('ioredis');var authService=require(_0x1c55('0x12'));var qs=require(_0x1c55('0x13'));var as=require(_0x1c55('0x14'));var pdf=require(_0x1c55('0x15'));var hardwareService=require(_0x1c55('0x16'));var logger=require(_0x1c55('0x17'))(_0x1c55('0x18'));var utils=require(_0x1c55('0x19'));var config=require(_0x1c55('0x1a'));var licenseUtil=require(_0x1c55('0x1b'));var db=require(_0x1c55('0x1c'))['db'];config[_0x1c55('0x1d')]=_[_0x1c55('0x1e')](config[_0x1c55('0x1d')],{'host':_0x1c55('0x1f'),'port':0x18eb});var socket=require(_0x1c55('0x20'))(new Redis(config[_0x1c55('0x1d')]));require(_0x1c55('0x21'))['register'](socket);function respondWithStatusCode(_0x220b95,_0x20da6b){_0x20da6b=_0x20da6b||0xcc;return function(_0x4eb81d){if(_0x4eb81d){return _0x220b95[_0x1c55('0x22')](_0x20da6b);}return _0x220b95[_0x1c55('0x23')](_0x20da6b)[_0x1c55('0x24')]();};}function respondWithResult(_0x5b0a8b,_0x1623d7){_0x1623d7=_0x1623d7||0xc8;return function(_0x2ff562){if(_0x2ff562){return _0x5b0a8b[_0x1c55('0x23')](_0x1623d7)[_0x1c55('0x25')](_0x2ff562);}};}function respondWithFilteredResult(_0x3dfa39,_0x28b439){return function(_0x475e1e){if(_0x475e1e){var _0x283934=typeof _0x28b439[_0x1c55('0x26')]==='undefined'&&typeof _0x28b439[_0x1c55('0x27')]===_0x1c55('0x28');var _0x2ef47b=_0x475e1e[_0x1c55('0x29')];var _0x27ad06=_0x283934?0x0:_0x28b439['offset'];var _0x8483d5=_0x283934?_0x475e1e[_0x1c55('0x29')]:_0x28b439['offset']+_0x28b439[_0x1c55('0x27')];var _0x1c63a7;if(_0x8483d5>=_0x2ef47b){_0x8483d5=_0x2ef47b;_0x1c63a7=0xc8;}else{_0x1c63a7=0xce;}_0x3dfa39[_0x1c55('0x23')](_0x1c63a7);return _0x3dfa39[_0x1c55('0x2a')](_0x1c55('0x2b'),_0x27ad06+'-'+_0x8483d5+'/'+_0x2ef47b)[_0x1c55('0x25')](_0x475e1e);}return null;};}function patchUpdates(_0x55c09e){return function(_0x26d07c){try{jsonpatch[_0x1c55('0x2c')](_0x26d07c,_0x55c09e,!![]);}catch(_0x2679c0){return BPromise[_0x1c55('0x2d')](_0x2679c0);}return _0x26d07c[_0x1c55('0x2e')]();};}function saveUpdates(_0x2784aa,_0x4d625f){return function(_0x4f7d70){if(_0x4f7d70){return _0x4f7d70['update'](_0x2784aa)[_0x1c55('0x2f')](function(_0x30b397){return _0x30b397;});}return null;};}function removeEntity(_0x1398d5,_0x49ccb5){return function(_0x469c91){if(_0x469c91){return _0x469c91['destroy']()['then'](function(){_0x1398d5[_0x1c55('0x23')](0xcc)[_0x1c55('0x24')]();});}};}function handleEntityNotFound(_0x1a577c,_0x370c64){return function(_0x531ca9){if(!_0x531ca9){_0x1a577c['sendStatus'](0x194);}return _0x531ca9;};}function handleError(_0x34ba24,_0x31d5a5){_0x31d5a5=_0x31d5a5||0x1f4;return function(_0x3791c1){logger[_0x1c55('0x30')](_0x3791c1[_0x1c55('0x31')]);if(_0x3791c1[_0x1c55('0x32')]){delete _0x3791c1[_0x1c55('0x32')];}_0x34ba24[_0x1c55('0x23')](_0x31d5a5)[_0x1c55('0x33')](_0x3791c1);};}function getInteractionUsers(_0x39008f,_0x7759d2){return new BPromise(function(_0x4e8368,_0x3623f7){try{if(_0x7759d2[_0x39008f['id']]){_0x39008f[_0x1c55('0x34')]=_[_0x1c55('0x35')](_0x7759d2[_0x39008f['id']],function(_0x124530){return{'id':_0x124530['id'],'fullname':_0x124530[_0x1c55('0x36')]};});}}catch(_0x4a039d){_0x3623f7(_0x4a039d);}_0x4e8368(_0x39008f);});}function getInteractionTags(_0xf34592,_0x50a16f){return new BPromise(function(_0x255cc7,_0x1c7c1d){try{if(_0xf34592[_0x1c55('0x37')]){_0xf34592[_0x1c55('0x38')]=[];_0xf34592[_0x1c55('0x37')][_0x1c55('0x39')](',')['forEach'](function(_0x16ff45){_0xf34592[_0x1c55('0x38')][_0x1c55('0x3a')](_0x50a16f[_0x16ff45]);});}delete _0xf34592[_0x1c55('0x37')];}catch(_0x53a0ad){_0x1c7c1d(_0x53a0ad);}_0x255cc7(_0xf34592);});}function updateOpenchannelInteraction(_0x38317e,_0x23dd45,_0x4d5571){return new BPromise(function(_0x281071,_0xb4bcc9){return getInteractionUsers(_0x38317e,_0x4d5571)[_0x1c55('0x2f')](function(_0x2277b0){return getInteractionTags(_0x2277b0,_0x23dd45);})[_0x1c55('0x2f')](function(_0x5dc518){_0x281071(_0x5dc518);})['catch'](function(_0x2e405a){_0xb4bcc9(_0x2e405a);});});}exports[_0x1c55('0x3b')]=function(_0xe31e67,_0x3fe34c){var _0x21cb12={},_0x2618e0={},_0x53caa4={'count':0x0,'rows':[]};var _0x587613=_['map'](db['OpenchannelInteraction'][_0x1c55('0x3c')],function(_0x36c24a){return{'name':_0x36c24a['fieldName'],'type':_0x36c24a[_0x1c55('0x3d')][_0x1c55('0x3e')]};});_0x2618e0[_0x1c55('0x3f')]=_[_0x1c55('0x35')](_0x587613,_0x1c55('0x32'));_0x2618e0[_0x1c55('0x40')]=_['keys'](_0xe31e67['query']);_0x2618e0['filters']=_[_0x1c55('0x41')](_0x2618e0[_0x1c55('0x3f')],_0x2618e0[_0x1c55('0x40')]);_0x21cb12[_0x1c55('0x42')]=_['intersection'](_0x2618e0['model'],qs[_0x1c55('0x43')](_0xe31e67[_0x1c55('0x40')][_0x1c55('0x43')]));_0x21cb12[_0x1c55('0x42')]=_0x21cb12[_0x1c55('0x42')][_0x1c55('0x44')]?_0x21cb12['attributes']:_0x2618e0['model'];if(!_0xe31e67[_0x1c55('0x40')][_0x1c55('0x45')]('nolimit')){_0x21cb12[_0x1c55('0x27')]=qs[_0x1c55('0x27')](_0xe31e67['query'][_0x1c55('0x27')]);_0x21cb12['offset']=qs[_0x1c55('0x26')](_0xe31e67['query'][_0x1c55('0x26')]);}_0x21cb12[_0x1c55('0x46')]=qs[_0x1c55('0x47')](_0xe31e67['query']['sort']);_0x21cb12['where']=qs['filters'](_[_0x1c55('0x48')](_0xe31e67[_0x1c55('0x40')],_0x2618e0[_0x1c55('0x49')]),_0x587613);var _0x1fb905=[];var _0x1283bb=squel[_0x1c55('0x4a')]()[_0x1c55('0x4b')]('id')['field'](_0x1c55('0x32'))[_0x1c55('0x4b')](_0x1c55('0x4c'))['from'](_0x1c55('0x4d'));var _0x93bf44=squel[_0x1c55('0x4a')]()['field'](_0x1c55('0x4e'))['field'](_0x1c55('0x4f'))[_0x1c55('0x4b')](_0x1c55('0x50'))['from']('user_has_openchannel_interactions','ui')[_0x1c55('0x51')]('users','u',_0x1c55('0x52'));var _0x3e96ea=squel['select']()[_0x1c55('0x53')]('openchannel_interactions','i')[_0x1c55('0x51')](_0x1c55('0x54'),'c',_0x1c55('0x55'))[_0x1c55('0x51')](_0x1c55('0x56'),'o',_0x1c55('0x57'))['left_join'](_0x1c55('0x58'),'a',_0x1c55('0x59'))[_0x1c55('0x51')](_0x1c55('0x5a'),'me','me.OpenchannelInteractionId\x20=\x20i.id')[_0x1c55('0x51')](_0x1c55('0x5b'),'it',_0x1c55('0x5c'))[_0x1c55('0x51')](_0x1c55('0x4d'),'t',_0x1c55('0x5d'));var _0x104ff0=squel[_0x1c55('0x5e')]();var _0x93b16=[];var _0x54523c=squel[_0x1c55('0x5e')]();var _0x211ca2;if(_0xe31e67['query'][_0x1c55('0x5f')]){_0x211ca2=as[_0x1c55('0x60')](_0xe31e67[_0x1c55('0x40')][_0x1c55('0x5f')]);var _0x4167e1=_0x211ca2[_0x1c55('0x61')];for(var _0x3fa4ea=0x0;_0x3fa4ea<_0x211ca2['conditions'][_0x1c55('0x44')];_0x3fa4ea++){var _0x40db2a=_0x211ca2['conditions'][_0x3fa4ea];var _0x15bb6b='i';var _0x1770a3=_['find'](_0x587613,[_0x1c55('0x32'),_0x40db2a[_0x1c55('0x4b')]]);if(!_0x1770a3){switch(_0x40db2a[_0x1c55('0x4b')]){case'unreadMessages':if(_0x40db2a[_0x1c55('0x62')]==0x1){_0x3e96ea['having']('`'+_0x40db2a['field']+_0x1c55('0x63'));}else{_0x3e96ea[_0x1c55('0x64')]('`'+_0x40db2a[_0x1c55('0x4b')]+'`\x20>\x200');}break;case'Contact':if(_0x40db2a[_0x1c55('0x65')]===_0x1c55('0x66')){if(_0x40db2a[_0x1c55('0x62')][_0x1c55('0x39')]('\x20')[_0x1c55('0x44')]>0x1){_0x104ff0[_0x4167e1](_0x1c55('0x67'),qs[_0x1c55('0x68')](_0x40db2a[_0x1c55('0x62')]),null);}else{var _0x6f4597='%'+_0x40db2a[_0x1c55('0x62')]+'%';_0x104ff0[_0x4167e1](_0x1c55('0x69'),_0x6f4597,_0x6f4597,_0x6f4597);}}else{_0x1770a3=_[_0x1c55('0x6a')](_0x587613,[_0x1c55('0x32'),_0x1c55('0x6b')]);_0x40db2a['field']=_0x1c55('0x6b');_0xdf53c1=as[_0x1c55('0x6c')](_0x15bb6b,_0x1770a3['type'],_0x40db2a);_0x104ff0[_0x4167e1](_0xdf53c1[_0x1c55('0x6d')],_0xdf53c1[_0x1c55('0x62')][_0x1c55('0x6e')],_0xdf53c1['value'][_0x1c55('0x24')]);}break;case _0x1c55('0x6f'):var _0x5acb2d=_0x40db2a[_0x1c55('0x62')][_0x1c55('0x39')](',')[_0x1c55('0x35')](function(_0xf5d6){return Number(_0xf5d6);});_0x5acb2d['forEach'](function(_0x5b05bf){_0x54523c['or'](_0x1c55('0x70'),'%,'+_0x5b05bf+',%');});_0x93b16=_[_0x1c55('0x71')](_0x93b16,_0x5acb2d);break;case _0x1c55('0x72'):if(_0x40db2a['operator']==='$substring'){_0x104ff0[_0x4167e1](_0x1c55('0x73'),'%'+_0x40db2a['value']+'%',null);}else{_0x1770a3=_['find'](_0x587613,['name','UserId']);_0x40db2a['field']='UserId';_0xdf53c1=as['buildExpression'](_0x15bb6b,_0x1770a3['type'],_0x40db2a);_0x104ff0[_0x4167e1](_0xdf53c1['text'],_0xdf53c1[_0x1c55('0x62')][_0x1c55('0x6e')],_0xdf53c1[_0x1c55('0x62')][_0x1c55('0x24')]);}break;case _0x1c55('0x74'):_0xdf53c1=as['buildExpression']('me',null,_0x40db2a);_0x104ff0[_0x4167e1](_0xdf53c1[_0x1c55('0x6d')],_0xdf53c1['value']['start'],_0xdf53c1[_0x1c55('0x62')][_0x1c55('0x24')]);break;}}else{var _0xdf53c1=as[_0x1c55('0x6c')](_0x15bb6b,_0x1770a3[_0x1c55('0x3d')],_0x40db2a);_0x104ff0[_0x4167e1](_0xdf53c1[_0x1c55('0x6d')],_0xdf53c1[_0x1c55('0x62')][_0x1c55('0x6e')],_0xdf53c1[_0x1c55('0x62')][_0x1c55('0x24')]);}}}else{var _0x455a95=_(_0xe31e67[_0x1c55('0x40')])[_0x1c55('0x75')]()[_0x1c55('0x35')](function(_0x1898f3){return _[_0x1c55('0x76')](_0x587613,[_0x1c55('0x32'),_0x1898f3])?_0x1898f3:undefined;})[_0x1c55('0x77')]()[_0x1c55('0x62')]();if(!_['isEmpty'](_0x455a95)){_0x455a95[_0x1c55('0x78')](function(_0x16b1ed){if(_0x16b1ed===_0x1c55('0x79')){_0x3e96ea[_0x1c55('0x7a')]('i.OpenchannelAccountId\x20IN\x20?',[][_0x1c55('0x7b')](_0xe31e67[_0x1c55('0x40')][_0x16b1ed]));}else if(_0x16b1ed===_0x1c55('0x7c')){var _0x2c8907=JSON[_0x1c55('0x7d')](_0xe31e67[_0x1c55('0x40')][_0x16b1ed])[_0x1c55('0x7e')];var _0x1f8d17=JSON['parse'](_0xe31e67[_0x1c55('0x40')][_0x16b1ed])[_0x1c55('0x7f')];_0x3e96ea[_0x1c55('0x7a')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x2c8907,_0x1f8d17);}else{if(_0xe31e67[_0x1c55('0x40')][_0x16b1ed]===_0x1c55('0x80')){_0x3e96ea['where']('i.'+_0x16b1ed+_0x1c55('0x81'));}else{_0x3e96ea[_0x1c55('0x7a')]('i.'+_0x16b1ed+_0x1c55('0x82'),_0xe31e67['query'][_0x16b1ed]);}}});}if(_0xe31e67[_0x1c55('0x40')]['read']){if(_0xe31e67[_0x1c55('0x40')][_0x1c55('0x83')]==0x1){_0x3e96ea['having']('`unreadMessages`\x20=\x200');}else{_0x3e96ea[_0x1c55('0x64')]('`unreadMessages`\x20>\x200');}}if(_0xe31e67[_0x1c55('0x40')][_0x1c55('0x84')]){_0x93b16=_['isArray'](_0xe31e67['query'][_0x1c55('0x84')])?_0xe31e67['query'][_0x1c55('0x84')]:new Array(_0xe31e67[_0x1c55('0x40')][_0x1c55('0x84')]);_0x93b16[_0x1c55('0x78')](function(_0x57a992){_0x54523c['or'](_0x1c55('0x70'),'%,'+_0x57a992+',%');});}if(_0xe31e67[_0x1c55('0x40')][_0x1c55('0x85')]){var _0x217ed3=_0xe31e67['query'][_0x1c55('0x85')]['replace']('\x5c','\x5c\x5c')[_0x1c55('0x86')](/'/g,'\x27\x27');if(qs[_0x1c55('0x87')](_0x217ed3)){_0x104ff0['or']('i.id\x20LIKE\x20?',_0x217ed3+'%');}else{_0x104ff0['or'](_0x1c55('0x88'),qs[_0x1c55('0x68')](_0x217ed3))['or']('i.from\x20LIKE\x20?',_0x217ed3+'%')['or'](_0x1c55('0x89'),_0x217ed3+'%');}}}_0x3e96ea[_0x1c55('0x7a')](_0x104ff0);_0x3e96ea[_0x1c55('0x8a')](_0x1c55('0x8b'));var _0x498922={'type':db['Sequelize'][_0x1c55('0x8c')][_0x1c55('0x8d')],'raw':!![]};var _0x5f24b8=_0x3e96ea['clone']();_0x5f24b8[_0x1c55('0x4b')](_0x1c55('0x8b'));_0x5f24b8['field'](_0x1c55('0x8e'),_0x1c55('0x8f'));if(_0x21cb12['order']){_0x21cb12[_0x1c55('0x46')][_0x1c55('0x78')](function(_0x4c35fd){var _0x5791c8=_0x4c35fd[0x0]===_0x1c55('0x90')?_0x4c35fd[0x0]:'i.'+_0x4c35fd[0x0];_0x3e96ea[_0x1c55('0x46')](_0x5791c8,_0x4c35fd[0x1]==='DESC'?![]:!![]);});}if(!_[_0x1c55('0x91')](_0x93b16)){_0x3e96ea[_0x1c55('0x64')](_0x54523c);_0x5f24b8[_0x1c55('0x7a')]('t.id\x20IN\x20?',_0x93b16);}BPromise[_0x1c55('0x92')]()['then'](function(){if(!_0x211ca2){if(_0xe31e67[_0x1c55('0x40')][_0x1c55('0x79')])return;_0x5f24b8[_0x1c55('0x7a')](_0x1c55('0x93'));_0x3e96ea[_0x1c55('0x7a')](_0x1c55('0x93'));return;}if(_0xe31e67['user']['role']!=='agent')return;return _0xe31e67[_0x1c55('0x94')][_0x1c55('0x95')]({'attributes':['id'],'raw':!![]})['then'](function(_0x16efde){if(_[_0x1c55('0x91')](_0x16efde)){_0x5f24b8[_0x1c55('0x7a')]('i.OpenchannelAccountId\x20IS\x20NULL');_0x3e96ea[_0x1c55('0x7a')]('i.OpenchannelAccountId\x20IS\x20NULL');}else{_0x5f24b8['where'](_0x1c55('0x96'),_[_0x1c55('0x35')](_0x16efde,'id'));_0x3e96ea[_0x1c55('0x7a')](_0x1c55('0x96'),_[_0x1c55('0x35')](_0x16efde,'id'));}});})[_0x1c55('0x2f')](function(){if(_0xe31e67[_0x1c55('0x94')][_0x1c55('0x97')]===_0x1c55('0x98')&&!_0x211ca2&&!_0xe31e67[_0x1c55('0x40')][_0x1c55('0x79')])return[];return db[_0x1c55('0x99')][_0x1c55('0x40')](_0x5f24b8[_0x1c55('0x9a')](),_0x498922);})[_0x1c55('0x2f')](function(_0x4d7701){_0x53caa4['count']=_0x4d7701[_0x1c55('0x44')];if(_0x53caa4[_0x1c55('0x29')]===0x0)return[];return db['sequelize'][_0x1c55('0x40')](_0x1283bb['toString'](),_0x498922)[_0x1c55('0x2f')](function(_0x1cfbb9){_0x1fb905=_['keyBy'](_0x1cfbb9,'id');_0x498922=_['merge'](_0x498922,{'model':db[_0x1c55('0x9b')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0xe31e67[_0x1c55('0x40')][_0x1c55('0x43')]){_0x21cb12[_0x1c55('0x42')]['forEach'](function(_0x31d1ac){_0x3e96ea[_0x1c55('0x4b')]('i.'+_0x31d1ac);});}else{_0x3e96ea[_0x1c55('0x4b')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');_0x3e96ea[_0x1c55('0x4b')]('a.key',_0x1c55('0x9c'));_0x3e96ea[_0x1c55('0x4b')](_0x1c55('0x9d'),_0x1c55('0x9e'));_0x3e96ea[_0x1c55('0x4b')](_0x1c55('0x9f'),_0x1c55('0x90'));_0x3e96ea[_0x1c55('0x4b')](_0x1c55('0xa0'));_0x3e96ea[_0x1c55('0x4b')]('c.firstName',_0x1c55('0xa1'));_0x3e96ea['field'](_0x1c55('0xa2'),_0x1c55('0xa3'));_0x3e96ea[_0x1c55('0x4b')](_0x1c55('0xa4'),'Contact.email');_0x3e96ea[_0x1c55('0x4b')](_0x1c55('0xa5'),_0x1c55('0xa6'));_0x3e96ea[_0x1c55('0x4b')](_0x1c55('0xa7'),'Contact.mobile');_0x3e96ea[_0x1c55('0x4b')]('c.fax',_0x1c55('0xa8'));_0x3e96ea[_0x1c55('0x4b')](_0x1c55('0xa9'),_0x1c55('0xaa'));_0x3e96ea[_0x1c55('0x4b')](_0x1c55('0xab'),_0x1c55('0xac'));_0x3e96ea['field']('GROUP_CONCAT(DISTINCT\x20t.id)','TagIds');}if(_0x21cb12[_0x1c55('0x27')])_0x3e96ea[_0x1c55('0x27')](_0x21cb12[_0x1c55('0x27')]);if(_0x21cb12[_0x1c55('0x26')])_0x3e96ea[_0x1c55('0x26')](_0x21cb12['offset']);return db[_0x1c55('0x99')]['query'](_0x3e96ea[_0x1c55('0x9a')](),_0x498922);})[_0x1c55('0x2f')](function(_0x10004e){if(_0x10004e[_0x1c55('0x44')]>0x0)_0x93bf44[_0x1c55('0x7a')](_0x1c55('0xad'),_[_0x1c55('0x35')](_0x10004e,'id'));return db[_0x1c55('0x99')][_0x1c55('0x40')](_0x93bf44[_0x1c55('0x9a')](),_0x498922)[_0x1c55('0x2f')](function(_0x24d4be){var _0x1dfa3f=_['groupBy'](_0x24d4be,_0x1c55('0xae'));var _0x4a35a4=[];_0x10004e[_0x1c55('0x78')](function(_0x2af199){_0x4a35a4[_0x1c55('0x3a')](updateOpenchannelInteraction(_0x2af199,_0x1fb905,_0x1dfa3f));});return BPromise[_0x1c55('0xaf')](_0x4a35a4);});});})[_0x1c55('0x2f')](function(_0x208ab4){_0x53caa4[_0x1c55('0xb0')]=_0x208ab4;return _0x53caa4;})['then'](respondWithFilteredResult(_0x3fe34c,_0x21cb12))[_0x1c55('0xb1')](handleError(_0x3fe34c,null));};exports[_0x1c55('0xb2')]=function(_0x113ccb,_0x5f448f){var _0x21709e={};if(_0x113ccb[_0x1c55('0x40')][_0x1c55('0x3d')]&&_0x113ccb[_0x1c55('0x40')][_0x1c55('0x3d')]===_0x1c55('0x53')){_0x21709e['from']=_0x113ccb[_0x1c55('0xb3')]['id'];}else{_0x21709e['id']=_0x113ccb['params']['id'];}var _0x57f172={'raw':![],'where':_0x21709e},_0x5a8930={};_0x5a8930[_0x1c55('0x3f')]=_[_0x1c55('0x75')](db[_0x1c55('0x9b')]['rawAttributes']);_0x5a8930[_0x1c55('0x40')]=_[_0x1c55('0x75')](_0x113ccb['query']);_0x5a8930['filters']=_[_0x1c55('0x41')](_0x5a8930[_0x1c55('0x3f')],_0x5a8930[_0x1c55('0x40')]);_0x57f172[_0x1c55('0x42')]=_['intersection'](_0x5a8930['model'],qs[_0x1c55('0x43')](_0x113ccb[_0x1c55('0x40')][_0x1c55('0x43')]));_0x57f172[_0x1c55('0x42')]=_0x57f172[_0x1c55('0x42')][_0x1c55('0x44')]?_0x57f172[_0x1c55('0x42')]:_0x5a8930[_0x1c55('0x3f')];if(_0x113ccb['query'][_0x1c55('0xb4')]){_0x57f172[_0x1c55('0xb5')]=[{'all':!![]}];}_0x57f172=_['merge']({},_0x57f172,_0x113ccb[_0x1c55('0xb6')]);return db[_0x1c55('0x9b')]['find'](_0x57f172)[_0x1c55('0x2f')](handleEntityNotFound(_0x5f448f,null))[_0x1c55('0x2f')](respondWithResult(_0x5f448f,null))[_0x1c55('0xb1')](handleError(_0x5f448f,null));};exports[_0x1c55('0xb7')]=function(_0x268cc4,_0xc179be){return db[_0x1c55('0x9b')][_0x1c55('0xb7')](_0x268cc4['body'],{})[_0x1c55('0x2f')](respondWithResult(_0xc179be,0xc9))['catch'](handleError(_0xc179be,null));};exports[_0x1c55('0xb8')]=function(_0x4d8efc,_0x1bb487){if(_0x4d8efc[_0x1c55('0x74')]['id']){delete _0x4d8efc[_0x1c55('0x74')]['id'];}return db[_0x1c55('0x9b')]['find']({'where':{'id':_0x4d8efc['params']['id']}})[_0x1c55('0x2f')](handleEntityNotFound(_0x1bb487,null))[_0x1c55('0x2f')](saveUpdates(_0x4d8efc[_0x1c55('0x74')],null))[_0x1c55('0x2f')](respondWithResult(_0x1bb487,null))[_0x1c55('0xb1')](handleError(_0x1bb487,null));};exports[_0x1c55('0xb9')]=function(_0x167943,_0x2593b3){return db[_0x1c55('0x9b')][_0x1c55('0x6a')]({'where':{'id':_0x167943['params']['id']}})[_0x1c55('0x2f')](handleEntityNotFound(_0x2593b3,null))[_0x1c55('0x2f')](removeEntity(_0x2593b3,null))[_0x1c55('0xb1')](handleError(_0x2593b3,null));};exports[_0x1c55('0xba')]=function(_0x5324e7,_0x4bdb83){return db[_0x1c55('0x9b')][_0x1c55('0xba')]()[_0x1c55('0x2f')](respondWithResult(_0x4bdb83,null))[_0x1c55('0xb1')](handleError(_0x4bdb83,null));};exports[_0x1c55('0xbb')]=function(_0x5ef0bd,_0x44bec4,_0x147816){return db[_0x1c55('0xbc')][_0x1c55('0x6a')]({'where':{'id':_0x5ef0bd[_0x1c55('0xb3')]['id']}})[_0x1c55('0x2f')](handleEntityNotFound(_0x44bec4,null))[_0x1c55('0x2f')](function(_0x554210){if(_0x554210){return _0x554210[_0x1c55('0xbb')](_0x5ef0bd['body'][_0x1c55('0xbd')],_[_0x1c55('0xbe')](_0x5ef0bd['body'],['ids','id'])||{});}})['then'](respondWithResult(_0x44bec4,null))[_0x1c55('0xb1')](handleError(_0x44bec4,null));};exports[_0x1c55('0xbf')]=function(_0x4db896,_0x1965b1,_0x49d55c){var _0x572e46={'raw':![],'where':{}};var _0x328970={};var _0x5e9134={'count':0x0,'rows':[]};return db[_0x1c55('0x9b')][_0x1c55('0xc0')]({'where':{'id':_0x4db896[_0x1c55('0xb3')]['id']}})[_0x1c55('0x2f')](handleEntityNotFound(_0x1965b1,null))[_0x1c55('0x2f')](function(_0x1a06da){if(_0x1a06da){_0x328970['model']=_['keys'](db[_0x1c55('0xbc')][_0x1c55('0x3c')]);_0x328970[_0x1c55('0x40')]=_['keys'](_0x4db896[_0x1c55('0x40')]);_0x328970[_0x1c55('0x49')]=_[_0x1c55('0x41')](_0x328970[_0x1c55('0x3f')],_0x328970[_0x1c55('0x40')]);_0x572e46['attributes']=_[_0x1c55('0x41')](_0x328970['model'],qs['fields'](_0x4db896['query'][_0x1c55('0x43')]));_0x572e46[_0x1c55('0x42')]=_0x572e46['attributes'][_0x1c55('0x44')]?_0x572e46[_0x1c55('0x42')]:_0x328970[_0x1c55('0x3f')];if(!_0x4db896[_0x1c55('0x40')]['hasOwnProperty']('nolimit')){_0x572e46[_0x1c55('0x27')]=qs[_0x1c55('0x27')](_0x4db896[_0x1c55('0x40')][_0x1c55('0x27')]);_0x572e46['offset']=qs[_0x1c55('0x26')](_0x4db896[_0x1c55('0x40')]['offset']);}_0x572e46[_0x1c55('0x46')]=qs['sort'](_0x4db896[_0x1c55('0x40')][_0x1c55('0x47')]);_0x572e46[_0x1c55('0x7a')]=qs[_0x1c55('0x49')](_[_0x1c55('0x48')](_0x4db896[_0x1c55('0x40')],_0x328970[_0x1c55('0x49')]));_0x572e46[_0x1c55('0x7a')][_0x1c55('0xae')]=_0x1a06da['id'];if(_0x4db896['query'][_0x1c55('0x85')]){_0x572e46[_0x1c55('0x7a')]=_[_0x1c55('0xc1')](_0x572e46[_0x1c55('0x7a')],{'$or':_[_0x1c55('0x35')](_0x572e46[_0x1c55('0x42')],function(_0x5c70a1){var _0x1082e4={};_0x1082e4[_0x5c70a1]={'$like':'%'+_0x4db896[_0x1c55('0x40')][_0x1c55('0x85')]+'%'};return _0x1082e4;})});}if(_0x4db896['query'][_0x1c55('0x7e')]){var _0xb30278=_0x4db896[_0x1c55('0x40')][_0x1c55('0x7e')][_0x1c55('0x39')](',');var _0x33341e={};_0x33341e[_0xb30278[0x0]]={'$gte':moment(_0xb30278[0x1])[_0x1c55('0xc2')](_0x1c55('0xc3'))};_0x572e46[_0x1c55('0x7a')]=_[_0x1c55('0xc1')](_0x572e46['where'],_0x33341e);}_0x572e46=_[_0x1c55('0xc1')]({},_0x572e46,_0x4db896['options']);return db[_0x1c55('0xbc')][_0x1c55('0x29')]({'where':_0x572e46[_0x1c55('0x7a')]})[_0x1c55('0x2f')](function(_0x1940f7){_0x5e9134[_0x1c55('0x29')]=_0x1940f7;if(_0x4db896[_0x1c55('0x40')][_0x1c55('0xb4')]){_0x572e46['include']=[{'all':!![]}];}return db[_0x1c55('0xbc')][_0x1c55('0xc4')](_0x572e46);})[_0x1c55('0x2f')](function(_0x5c9d5c){_0x5e9134[_0x1c55('0xb0')]=_0x5c9d5c;return _0x5e9134;});}})[_0x1c55('0x2f')](respondWithFilteredResult(_0x1965b1,_0x572e46))['catch'](handleError(_0x1965b1,null));};exports[_0x1c55('0xc5')]=function(_0x2f76e9,_0x48690c,_0x5301bc){return db['OpenchannelInteraction'][_0x1c55('0x6a')]({'where':{'id':_0x2f76e9['params']['id']}})[_0x1c55('0x2f')](handleEntityNotFound(_0x48690c,null))[_0x1c55('0x2f')](function(_0x1524cb){if(_0x1524cb){return _0x1524cb['setTags'](_0x2f76e9['body'][_0x1c55('0xbd')],_[_0x1c55('0xbe')](_0x2f76e9[_0x1c55('0x74')],[_0x1c55('0xbd'),'id'])||{})[_0x1c55('0xc6')](function(){return db[_0x1c55('0x6f')][_0x1c55('0xc4')]({'attributes':['id',_0x1c55('0x32'),'color'],'where':{'id':_0x2f76e9[_0x1c55('0x74')][_0x1c55('0xbd')]}});})[_0x1c55('0x2f')](function(_0x11693f){socket[_0x1c55('0xc7')]('openchannelInteractionTags:save',{'id':Number(_0x2f76e9[_0x1c55('0xb3')]['id']),'tags':_0x11693f||[]});return{'id':Number(_0x2f76e9[_0x1c55('0xb3')]['id']),'tags':_0x11693f||[]};});}})[_0x1c55('0x2f')](respondWithResult(_0x48690c,null))[_0x1c55('0xb1')](handleError(_0x48690c,null));};exports[_0x1c55('0xc8')]=function(_0x14c758,_0x222ac3,_0x5d9f12){return db[_0x1c55('0x9b')][_0x1c55('0x6a')]({'where':{'id':_0x14c758[_0x1c55('0xb3')]['id']}})[_0x1c55('0x2f')](handleEntityNotFound(_0x222ac3,null))[_0x1c55('0x2f')](function(_0x4e35fa){if(_0x4e35fa){return _0x4e35fa[_0x1c55('0xc8')](_0x14c758[_0x1c55('0x40')][_0x1c55('0xbd')]);}})[_0x1c55('0x2f')](respondWithStatusCode(_0x222ac3,null))['catch'](handleError(_0x222ac3,null));};exports['download']=function(_0x82c3f5,_0x4f7428){var _0x2b3911=moment()['unix']()[_0x1c55('0x9a')]();var _0x3f02c9=path['join'](config[_0x1c55('0xc9')],_0x1c55('0xca'),'files','tmp');var _0xb1976b=path[_0x1c55('0xcb')](config[_0x1c55('0xc9')],_0x1c55('0xca'),_0x1c55('0xcc'),_0x1c55('0xcd'));var _0x192045=path['join'](_0x3f02c9,_0x2b3911);var _0x59fdbb=util[_0x1c55('0xc2')](_0x1c55('0xce'),_0x82c3f5['params']['id'],_0x2b3911);var _0x49edf9=path['join'](_0x3f02c9,_0x59fdbb);var _0x33b523=[];_0x33b523[_0x1c55('0x3a')]({'model':db[_0x1c55('0x72')],'as':_0x1c55('0x72'),'attributes':['id',_0x1c55('0x36')],'raw':!![]});_0x33b523[_0x1c55('0x3a')]({'model':db[_0x1c55('0xcf')],'as':_0x1c55('0xd0'),'attributes':['id','firstName',_0x1c55('0xd1')],'raw':!![]});if(_0x82c3f5[_0x1c55('0x40')][_0x1c55('0xcd')]){_0x33b523[_0x1c55('0x3a')]({'model':db[_0x1c55('0xd2')],'as':_0x1c55('0xd2'),'raw':!![]});}var _0x5f169e=[{'model':db[_0x1c55('0xbc')],'as':_0x1c55('0xd3'),'attributes':['id',_0x1c55('0x74'),'createdAt',_0x1c55('0xd4'),_0x1c55('0xd5'),'read'],'include':_0x33b523}];_0x5f169e[_0x1c55('0x3a')]({'model':db['OpenchannelAccount'],'as':_0x1c55('0xd6'),'attributes':['id',_0x1c55('0x32')]});_0x5f169e[_0x1c55('0x3a')]({'model':db[_0x1c55('0x72')],'as':_0x1c55('0xd7'),'attributes':['id',_0x1c55('0x36')]});return db[_0x1c55('0x9b')][_0x1c55('0x6a')]({'where':{'id':_0x82c3f5[_0x1c55('0xb3')]['id']},'include':_0x5f169e})[_0x1c55('0x2f')](handleEntityNotFound(_0x4f7428,null))[_0x1c55('0x2f')](function(_0x4607d4){if(_0x4607d4){var _0x56a5f7=_0x4607d4['get']({'plain':!![]});fs[_0x1c55('0xd8')](_0x192045);var _0x5e7509={'channel':'Openchannel','account':_0x56a5f7[_0x1c55('0xd6')][_0x1c55('0x32')],'agent':_0x56a5f7[_0x1c55('0xd7')]?_0x56a5f7[_0x1c55('0xd7')][_0x1c55('0x36')]:'N.A.','createdAt':moment(_0x56a5f7[_0x1c55('0x7c')])[_0x1c55('0xc2')](_0x1c55('0xc3'))[_0x1c55('0x9a')](),'closedAt':_0x56a5f7['closed']?moment(_0x56a5f7[_0x1c55('0xd9')])[_0x1c55('0xc2')](_0x1c55('0xc3'))['toString']():'','disposition':_0x56a5f7[_0x1c55('0xda')],'visibility':_0x56a5f7[_0x1c55('0xdb')]?'Public':'Private','messages':_(_0x56a5f7[_0x1c55('0xd3')])[_0x1c55('0x85')]({'secret':![]})[_0x1c55('0x35')](function(_0x1122a6){if(_0x1122a6['Attachment']){var _0x28b615=path['join'](_0xb1976b,_0x1122a6[_0x1c55('0xd2')][_0x1c55('0xdc')]);if(fs['existsSync'](_0x28b615)){fs[_0x1c55('0xdd')](_0x28b615)[_0x1c55('0xde')](fs[_0x1c55('0xdf')](path[_0x1c55('0xcb')](_0x192045,_0x1122a6['Attachment']['basename'])));}}return{'date':moment(_0x1122a6['createdAt'])[_0x1c55('0xc2')]('YYYY-MM-DD\x20HH:mm:ss')[_0x1c55('0x9a')](),'sender':_0x1122a6[_0x1c55('0xd4')]==='out'?_0x1122a6[_0x1c55('0x72')]?_0x1122a6[_0x1c55('0x72')][_0x1c55('0x36')]:_0x1c55('0xe0'):_0x1122a6[_0x1c55('0xd0')][_0x1c55('0xe1')]+(_0x1122a6[_0x1c55('0xd0')]['lastName']?'\x20'+_0x1122a6[_0x1c55('0xd0')][_0x1c55('0xd1')]:''),'body':_0x1122a6[_0x1c55('0xd2')]?_0x1122a6['Attachment'][_0x1c55('0xdc')]:_0x1122a6[_0x1c55('0x74')],'direction':_0x1122a6[_0x1c55('0xd4')]===_0x1c55('0xe2')?'A':'C','secret':_0x1122a6[_0x1c55('0xd5')],'read':_0x1122a6[_0x1c55('0x83')],'attachment':_0x1122a6[_0x1c55('0xd2')]};})['value']()};return ejs['renderFile'](path[_0x1c55('0xcb')](config[_0x1c55('0xc9')],'server',_0x1c55('0xe3'),_0x1c55('0xe4')),{'interaction':_0x5e7509})[_0x1c55('0x2f')](function(_0x426b59){var _0x5875a1=path[_0x1c55('0xcb')](_0x192045,'transcript-'+_0x56a5f7['id']+'-'+_0x2b3911+_0x1c55('0xe5'));var _0x4aade2={'path':_0x5875a1,'channel':_0x1c55('0xe6'),'interactionId':_0x56a5f7['id']};return pdf['createPdfFromHTML'](_0x426b59,_0x4aade2);})[_0x1c55('0x2f')](function(){return new BPromise(function(_0x5164eb,_0x49af32){zipdir(_0x192045,{'saveTo':_0x49edf9},function(_0x2c16bd,_0x125e42){if(_0x2c16bd)return _0x49af32(_0x2c16bd);return _0x5164eb(_0x125e42);});})[_0x1c55('0x2f')](function(){return new BPromise(function(_0x4cb817,_0x50b36a){rimraf(_0x192045,function(_0x259cc8){if(_0x259cc8)_0x50b36a(_0x259cc8);return _0x4cb817();});});})[_0x1c55('0x2f')](function(){return _0x4f7428[_0x1c55('0xe7')](_0x49edf9,_0x59fdbb,function(_0x9121a7){if(_0x9121a7){console[_0x1c55('0xe8')](_0x1c55('0xe9'),_0x9121a7);}else{fs['unlinkSync'](_0x49edf9);}});});});}else{return _0x4f7428[_0x1c55('0x22')](0xc8);}})['catch'](handleError(_0x4f7428,null));}; \ No newline at end of file +var _0x31df=['Contact.fax','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.OpenchannelInteractionId\x20IN\x20?','groupBy','OpenchannelInteractionId','push','all','show','params','includeAll','include','options','describe','addMessage','ids','omit','getMessages','OpenchannelMessage','nolimit','format','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','Tag','color','emit','openchannelInteractionTags:save','removeTags','unix','join','root','server','files','attachments','transcript-%d-%s.zip','CmContact','Contact','firstName','lastName','Attachment','direction','secret','OpenchannelAccount','Account','Owner','get','mkdirSync','Openchannel','N.A.','createdAt','closedAt','disposition','threadId','Public','basename','existsSync','pipe','createWriteStream','out','System','renderFile','views','downloadInteraction.ejs','.pdf','createPdfFromHTML','download','log','err','unlinkSync','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','sendStatus','status','offset','undefined','count','limit','set','json','reject','save','update','destroy','then','error','stack','name','Users','map','fullname','TagIds','Tags','split','catch','index','OpenchannelInteraction','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','order','sort','where','pick','field','from','u.fullname','ui.OpenchannelInteractionId','left_join','users','u.id\x20=\x20ui.UserId','select','openchannel_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','me.OpenchannelInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','parseSearch','search','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','type','text','start','end','forEach','union','User','$substring','UserId','buildExpression','body','some','compact','isEmpty','OpenchannelAccountId','i.OpenchannelAccountId\x20IN\x20?','concat','parse','$gte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','isNumeric','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','i.from\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','t.id\x20IN\x20?','resolve','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','role','agent','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','sequelize','toString','length','keyBy','merge','a.key','Account.key','Account.mandatoryDisposition','contactName','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','c.phone','Contact.phone','Contact.mobile','c.fax'];(function(_0x45dd7a,_0x4d7cc3){var _0x43786d=function(_0x3b9376){while(--_0x3b9376){_0x45dd7a['push'](_0x45dd7a['shift']());}};_0x43786d(++_0x4d7cc3);}(_0x31df,0x134));var _0xf31d=function(_0x6f51ae,_0x46add1){_0x6f51ae=_0x6f51ae-0x0;var _0x18257d=_0x31df[_0x6f51ae];return _0x18257d;};'use strict';var emlformat=require(_0xf31d('0x0'));var rimraf=require(_0xf31d('0x1'));var zipdir=require(_0xf31d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf31d('0x3'));var moment=require(_0xf31d('0x4'));var BPromise=require(_0xf31d('0x5'));var Mustache=require(_0xf31d('0x6'));var util=require('util');var path=require(_0xf31d('0x7'));var sox=require(_0xf31d('0x8'));var csv=require(_0xf31d('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf31d('0xa'));var _=require(_0xf31d('0xb'));var squel=require(_0xf31d('0xc'));var crypto=require(_0xf31d('0xd'));var jsforce=require(_0xf31d('0xe'));var deskjs=require(_0xf31d('0xf'));var toCsv=require(_0xf31d('0x9'));var querystring=require(_0xf31d('0x10'));var Papa=require(_0xf31d('0x11'));var Redis=require('ioredis');var authService=require(_0xf31d('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var pdf=require(_0xf31d('0x13'));var hardwareService=require(_0xf31d('0x14'));var logger=require(_0xf31d('0x15'))(_0xf31d('0x16'));var utils=require(_0xf31d('0x17'));var config=require(_0xf31d('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xf31d('0x19'))['db'];config[_0xf31d('0x1a')]=_[_0xf31d('0x1b')](config[_0xf31d('0x1a')],{'host':_0xf31d('0x1c'),'port':0x18eb});var socket=require(_0xf31d('0x1d'))(new Redis(config[_0xf31d('0x1a')]));require('./openchannelInteraction.socket')['register'](socket);function respondWithStatusCode(_0x4d257d,_0x401bb6){_0x401bb6=_0x401bb6||0xcc;return function(_0x454884){if(_0x454884){return _0x4d257d[_0xf31d('0x1e')](_0x401bb6);}return _0x4d257d[_0xf31d('0x1f')](_0x401bb6)['end']();};}function respondWithResult(_0x5eb69e,_0x215921){_0x215921=_0x215921||0xc8;return function(_0xce7545){if(_0xce7545){return _0x5eb69e[_0xf31d('0x1f')](_0x215921)['json'](_0xce7545);}};}function respondWithFilteredResult(_0x326aa0,_0x31fbf8){return function(_0x4a0890){if(_0x4a0890){var _0x14451c=typeof _0x31fbf8[_0xf31d('0x20')]===_0xf31d('0x21')&&typeof _0x31fbf8['limit']==='undefined';var _0x36137e=_0x4a0890['count'];var _0x3c8852=_0x14451c?0x0:_0x31fbf8[_0xf31d('0x20')];var _0x38619b=_0x14451c?_0x4a0890[_0xf31d('0x22')]:_0x31fbf8[_0xf31d('0x20')]+_0x31fbf8[_0xf31d('0x23')];var _0x485af7;if(_0x38619b>=_0x36137e){_0x38619b=_0x36137e;_0x485af7=0xc8;}else{_0x485af7=0xce;}_0x326aa0['status'](_0x485af7);return _0x326aa0[_0xf31d('0x24')]('Content-Range',_0x3c8852+'-'+_0x38619b+'/'+_0x36137e)[_0xf31d('0x25')](_0x4a0890);}return null;};}function patchUpdates(_0x4e0d9c){return function(_0x281cfe){try{jsonpatch['apply'](_0x281cfe,_0x4e0d9c,!![]);}catch(_0x18c6a6){return BPromise[_0xf31d('0x26')](_0x18c6a6);}return _0x281cfe[_0xf31d('0x27')]();};}function saveUpdates(_0x779935,_0x502a8c){return function(_0x133334){if(_0x133334){return _0x133334[_0xf31d('0x28')](_0x779935)['then'](function(_0x45ab79){return _0x45ab79;});}return null;};}function removeEntity(_0x16a618,_0x3c6e9e){return function(_0x28b1a4){if(_0x28b1a4){return _0x28b1a4[_0xf31d('0x29')]()[_0xf31d('0x2a')](function(){_0x16a618[_0xf31d('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x238776,_0x30b330){return function(_0xcdd490){if(!_0xcdd490){_0x238776[_0xf31d('0x1e')](0x194);}return _0xcdd490;};}function handleError(_0x3ab4b3,_0x5cefc3){_0x5cefc3=_0x5cefc3||0x1f4;return function(_0xf6347c){logger[_0xf31d('0x2b')](_0xf6347c[_0xf31d('0x2c')]);if(_0xf6347c[_0xf31d('0x2d')]){delete _0xf6347c[_0xf31d('0x2d')];}_0x3ab4b3['status'](_0x5cefc3)['send'](_0xf6347c);};}function getInteractionUsers(_0x588a59,_0x541227){return new BPromise(function(_0x324ea2,_0x4e52fb){try{if(_0x541227[_0x588a59['id']]){_0x588a59[_0xf31d('0x2e')]=_[_0xf31d('0x2f')](_0x541227[_0x588a59['id']],function(_0x3d97a1){return{'id':_0x3d97a1['id'],'fullname':_0x3d97a1[_0xf31d('0x30')]};});}}catch(_0x2054ed){_0x4e52fb(_0x2054ed);}_0x324ea2(_0x588a59);});}function getInteractionTags(_0x2a4bb0,_0x33ebc0){return new BPromise(function(_0x4a37a0,_0x99c986){try{if(_0x2a4bb0[_0xf31d('0x31')]){_0x2a4bb0[_0xf31d('0x32')]=[];_0x2a4bb0[_0xf31d('0x31')][_0xf31d('0x33')](',')['forEach'](function(_0x7a0b86){_0x2a4bb0[_0xf31d('0x32')]['push'](_0x33ebc0[_0x7a0b86]);});}delete _0x2a4bb0['TagIds'];}catch(_0x4f6f77){_0x99c986(_0x4f6f77);}_0x4a37a0(_0x2a4bb0);});}function updateOpenchannelInteraction(_0x3847de,_0x158720,_0x2c64d2){return new BPromise(function(_0x3ecc30,_0x2e3f5f){return getInteractionUsers(_0x3847de,_0x2c64d2)[_0xf31d('0x2a')](function(_0x3622a0){return getInteractionTags(_0x3622a0,_0x158720);})[_0xf31d('0x2a')](function(_0x5bfa26){_0x3ecc30(_0x5bfa26);})[_0xf31d('0x34')](function(_0x2efc07){_0x2e3f5f(_0x2efc07);});});}exports[_0xf31d('0x35')]=function(_0x41bffe,_0x564ada){var _0x63cd84={},_0x5069ca={},_0x15c395={'count':0x0,'rows':[]};var _0x5e4288=_['map'](db[_0xf31d('0x36')][_0xf31d('0x37')],function(_0x4d1369){return{'name':_0x4d1369[_0xf31d('0x38')],'type':_0x4d1369['type'][_0xf31d('0x39')]};});_0x5069ca[_0xf31d('0x3a')]=_[_0xf31d('0x2f')](_0x5e4288,_0xf31d('0x2d'));_0x5069ca[_0xf31d('0x3b')]=_[_0xf31d('0x3c')](_0x41bffe['query']);_0x5069ca[_0xf31d('0x3d')]=_[_0xf31d('0x3e')](_0x5069ca[_0xf31d('0x3a')],_0x5069ca[_0xf31d('0x3b')]);_0x63cd84['attributes']=_['intersection'](_0x5069ca[_0xf31d('0x3a')],qs['fields'](_0x41bffe[_0xf31d('0x3b')][_0xf31d('0x3f')]));_0x63cd84[_0xf31d('0x40')]=_0x63cd84['attributes']['length']?_0x63cd84[_0xf31d('0x40')]:_0x5069ca[_0xf31d('0x3a')];if(!_0x41bffe[_0xf31d('0x3b')][_0xf31d('0x41')]('nolimit')){_0x63cd84[_0xf31d('0x23')]=qs[_0xf31d('0x23')](_0x41bffe[_0xf31d('0x3b')][_0xf31d('0x23')]);_0x63cd84[_0xf31d('0x20')]=qs['offset'](_0x41bffe[_0xf31d('0x3b')]['offset']);}_0x63cd84[_0xf31d('0x42')]=qs['sort'](_0x41bffe[_0xf31d('0x3b')][_0xf31d('0x43')]);_0x63cd84[_0xf31d('0x44')]=qs[_0xf31d('0x3d')](_[_0xf31d('0x45')](_0x41bffe[_0xf31d('0x3b')],_0x5069ca[_0xf31d('0x3d')]),_0x5e4288);var _0x4dacc9=[];var _0x4679c8=squel['select']()['field']('id')[_0xf31d('0x46')](_0xf31d('0x2d'))[_0xf31d('0x46')]('color')[_0xf31d('0x47')]('tools_tags');var _0xe15336=squel['select']()[_0xf31d('0x46')]('u.id')[_0xf31d('0x46')](_0xf31d('0x48'))['field'](_0xf31d('0x49'))['from']('user_has_openchannel_interactions','ui')[_0xf31d('0x4a')](_0xf31d('0x4b'),'u',_0xf31d('0x4c'));var _0x520dca=squel[_0xf31d('0x4d')]()['from'](_0xf31d('0x4e'),'i')[_0xf31d('0x4a')](_0xf31d('0x4f'),'c',_0xf31d('0x50'))['left_join']('users','o','o.id\x20=\x20i.UserId')[_0xf31d('0x4a')]('openchannel_accounts','a','a.id\x20=\x20i.OpenchannelAccountId')[_0xf31d('0x4a')]('openchannel_messages','me',_0xf31d('0x51'))[_0xf31d('0x4a')]('openchannel_interaction_has_tags','it','it.OpenchannelInteractionId\x20=\x20i.id')[_0xf31d('0x4a')](_0xf31d('0x52'),'t',_0xf31d('0x53'));var _0x578796=squel[_0xf31d('0x54')]();var _0x275993=[];var _0x5ad8a1=squel[_0xf31d('0x54')]();var _0x4b8f40;if(_0x41bffe[_0xf31d('0x3b')]['search']){_0x4b8f40=as[_0xf31d('0x55')](_0x41bffe['query'][_0xf31d('0x56')]);var _0x455bca=_0x4b8f40['sqlOperator'];for(var _0x5c7dd5=0x0;_0x5c7dd5<_0x4b8f40[_0xf31d('0x57')]['length'];_0x5c7dd5++){var _0x46b33c=_0x4b8f40[_0xf31d('0x57')][_0x5c7dd5];var _0x4a2839='i';var _0x1dee58=_[_0xf31d('0x58')](_0x5e4288,['name',_0x46b33c['field']]);if(!_0x1dee58){switch(_0x46b33c[_0xf31d('0x46')]){case _0xf31d('0x59'):if(_0x46b33c[_0xf31d('0x5a')]==0x1){_0x520dca[_0xf31d('0x5b')]('`'+_0x46b33c['field']+_0xf31d('0x5c'));}else{_0x520dca['having']('`'+_0x46b33c['field']+_0xf31d('0x5d'));}break;case'Contact':if(_0x46b33c['operator']==='$substring'){if(_0x46b33c[_0xf31d('0x5a')][_0xf31d('0x33')]('\x20')['length']>0x1){_0x578796[_0x455bca]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x46b33c[_0xf31d('0x5a')]),null);}else{var _0x1d083f='%'+_0x46b33c[_0xf31d('0x5a')]+'%';_0x578796[_0x455bca](_0xf31d('0x5e'),_0x1d083f,_0x1d083f,_0x1d083f);}}else{_0x1dee58=_[_0xf31d('0x58')](_0x5e4288,['name',_0xf31d('0x5f')]);_0x46b33c[_0xf31d('0x46')]=_0xf31d('0x5f');_0x579315=as['buildExpression'](_0x4a2839,_0x1dee58[_0xf31d('0x60')],_0x46b33c);_0x578796[_0x455bca](_0x579315[_0xf31d('0x61')],_0x579315[_0xf31d('0x5a')][_0xf31d('0x62')],_0x579315['value'][_0xf31d('0x63')]);}break;case'Tag':var _0x43edc8=_0x46b33c['value'][_0xf31d('0x33')](',')[_0xf31d('0x2f')](function(_0x2cad49){return Number(_0x2cad49);});_0x43edc8[_0xf31d('0x64')](function(_0x174e63){_0x5ad8a1['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x174e63+',%');});_0x275993=_[_0xf31d('0x65')](_0x275993,_0x43edc8);break;case _0xf31d('0x66'):if(_0x46b33c['operator']===_0xf31d('0x67')){_0x578796[_0x455bca]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x46b33c[_0xf31d('0x5a')]+'%',null);}else{_0x1dee58=_['find'](_0x5e4288,[_0xf31d('0x2d'),_0xf31d('0x68')]);_0x46b33c['field']=_0xf31d('0x68');_0x579315=as[_0xf31d('0x69')](_0x4a2839,_0x1dee58[_0xf31d('0x60')],_0x46b33c);_0x578796[_0x455bca](_0x579315[_0xf31d('0x61')],_0x579315['value'][_0xf31d('0x62')],_0x579315['value']['end']);}break;case _0xf31d('0x6a'):_0x579315=as[_0xf31d('0x69')]('me',null,_0x46b33c);_0x578796[_0x455bca](_0x579315[_0xf31d('0x61')],_0x579315[_0xf31d('0x5a')][_0xf31d('0x62')],_0x579315['value']['end']);break;}}else{var _0x579315=as['buildExpression'](_0x4a2839,_0x1dee58[_0xf31d('0x60')],_0x46b33c);_0x578796[_0x455bca](_0x579315[_0xf31d('0x61')],_0x579315[_0xf31d('0x5a')][_0xf31d('0x62')],_0x579315[_0xf31d('0x5a')][_0xf31d('0x63')]);}}}else{var _0x52967e=_(_0x41bffe[_0xf31d('0x3b')])[_0xf31d('0x3c')]()['map'](function(_0xa116f){return _[_0xf31d('0x6b')](_0x5e4288,[_0xf31d('0x2d'),_0xa116f])?_0xa116f:undefined;})[_0xf31d('0x6c')]()[_0xf31d('0x5a')]();if(!_[_0xf31d('0x6d')](_0x52967e)){_0x52967e[_0xf31d('0x64')](function(_0x338dfa){if(_0x338dfa===_0xf31d('0x6e')){_0x520dca[_0xf31d('0x44')](_0xf31d('0x6f'),[][_0xf31d('0x70')](_0x41bffe['query'][_0x338dfa]));}else if(_0x338dfa==='createdAt'){var _0x31c633=JSON[_0xf31d('0x71')](_0x41bffe['query'][_0x338dfa])[_0xf31d('0x72')];var _0x4820f7=JSON['parse'](_0x41bffe['query'][_0x338dfa])['$lte'];_0x520dca[_0xf31d('0x44')](_0xf31d('0x73'),_0x31c633,_0x4820f7);}else{if(_0x41bffe['query'][_0x338dfa]==='null'){_0x520dca['where']('i.'+_0x338dfa+_0xf31d('0x74'));}else{_0x520dca[_0xf31d('0x44')]('i.'+_0x338dfa+_0xf31d('0x75'),_0x41bffe[_0xf31d('0x3b')][_0x338dfa]);}}});}if(_0x41bffe[_0xf31d('0x3b')][_0xf31d('0x76')]){if(_0x41bffe['query'][_0xf31d('0x76')]==0x1){_0x520dca[_0xf31d('0x5b')](_0xf31d('0x77'));}else{_0x520dca[_0xf31d('0x5b')](_0xf31d('0x78'));}}if(_0x41bffe['query'][_0xf31d('0x79')]){_0x275993=_[_0xf31d('0x7a')](_0x41bffe[_0xf31d('0x3b')][_0xf31d('0x79')])?_0x41bffe[_0xf31d('0x3b')][_0xf31d('0x79')]:new Array(_0x41bffe[_0xf31d('0x3b')]['tag']);_0x275993[_0xf31d('0x64')](function(_0x3f9708){_0x5ad8a1['or'](_0xf31d('0x7b'),'%,'+_0x3f9708+',%');});}if(_0x41bffe[_0xf31d('0x3b')][_0xf31d('0x7c')]){var _0x532116=_0x41bffe['query'][_0xf31d('0x7c')]['replace']('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0xf31d('0x7d')](_0x532116)){_0x578796['or']('i.id\x20LIKE\x20?',_0x532116+'%');}else{_0x578796['or'](_0xf31d('0x7e'),qs[_0xf31d('0x7f')](_0x532116))['or'](_0xf31d('0x80'),_0x532116+'%')['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x532116+'%');}}}_0x520dca['where'](_0x578796);_0x520dca[_0xf31d('0x81')](_0xf31d('0x82'));var _0xc1f5c4={'type':db[_0xf31d('0x83')][_0xf31d('0x84')][_0xf31d('0x85')],'raw':!![]};var _0x2e4407=_0x520dca[_0xf31d('0x86')]();_0x2e4407[_0xf31d('0x46')]('i.id');_0x2e4407[_0xf31d('0x46')](_0xf31d('0x87'),_0xf31d('0x59'));if(_0x63cd84[_0xf31d('0x42')]){_0x63cd84[_0xf31d('0x42')]['forEach'](function(_0x33b76d){var _0x21ee87=_0x33b76d[0x0]==='contactName'?_0x33b76d[0x0]:'i.'+_0x33b76d[0x0];_0x520dca[_0xf31d('0x42')](_0x21ee87,_0x33b76d[0x1]===_0xf31d('0x88')?![]:!![]);});}if(!_[_0xf31d('0x6d')](_0x275993)){_0x520dca[_0xf31d('0x5b')](_0x5ad8a1);_0x2e4407[_0xf31d('0x44')](_0xf31d('0x89'),_0x275993);}BPromise[_0xf31d('0x8a')]()[_0xf31d('0x2a')](function(){if(!_0x4b8f40){if(_0x41bffe[_0xf31d('0x3b')]['OpenchannelAccountId'])return;_0x2e4407[_0xf31d('0x44')](_0xf31d('0x8b'));_0x520dca[_0xf31d('0x44')](_0xf31d('0x8b'));return;}if(_0x41bffe[_0xf31d('0x8c')][_0xf31d('0x8d')]!==_0xf31d('0x8e'))return;return _0x41bffe[_0xf31d('0x8c')][_0xf31d('0x8f')]({'attributes':['id'],'raw':!![]})['then'](function(_0x769a56){if(_['isEmpty'](_0x769a56)){_0x2e4407[_0xf31d('0x44')](_0xf31d('0x90'));_0x520dca[_0xf31d('0x44')](_0xf31d('0x90'));}else{_0x2e4407['where'](_0xf31d('0x6f'),_[_0xf31d('0x2f')](_0x769a56,'id'));_0x520dca[_0xf31d('0x44')](_0xf31d('0x6f'),_['map'](_0x769a56,'id'));}});})['then'](function(){if(_0x41bffe[_0xf31d('0x8c')][_0xf31d('0x8d')]===_0xf31d('0x8e')&&!_0x4b8f40&&!_0x41bffe[_0xf31d('0x3b')][_0xf31d('0x6e')])return[];return db[_0xf31d('0x91')][_0xf31d('0x3b')](_0x2e4407[_0xf31d('0x92')](),_0xc1f5c4);})['then'](function(_0x3458ec){_0x15c395[_0xf31d('0x22')]=_0x3458ec[_0xf31d('0x93')];if(_0x15c395['count']===0x0)return[];return db[_0xf31d('0x91')][_0xf31d('0x3b')](_0x4679c8[_0xf31d('0x92')](),_0xc1f5c4)[_0xf31d('0x2a')](function(_0x4854c3){_0x4dacc9=_[_0xf31d('0x94')](_0x4854c3,'id');_0xc1f5c4=_[_0xf31d('0x95')](_0xc1f5c4,{'model':db[_0xf31d('0x36')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x41bffe[_0xf31d('0x3b')]['fields']){_0x63cd84[_0xf31d('0x40')][_0xf31d('0x64')](function(_0x471571){_0x520dca[_0xf31d('0x46')]('i.'+_0x471571);});}else{_0x520dca['field'](_0xf31d('0x87'),_0xf31d('0x59'));_0x520dca[_0xf31d('0x46')](_0xf31d('0x96'),_0xf31d('0x97'));_0x520dca[_0xf31d('0x46')]('a.mandatoryDisposition',_0xf31d('0x98'));_0x520dca[_0xf31d('0x46')]('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',_0xf31d('0x99'));_0x520dca[_0xf31d('0x46')](_0xf31d('0x9a'));_0x520dca[_0xf31d('0x46')](_0xf31d('0x9b'),_0xf31d('0x9c'));_0x520dca[_0xf31d('0x46')](_0xf31d('0x9d'),_0xf31d('0x9e'));_0x520dca[_0xf31d('0x46')](_0xf31d('0x9f'),'Contact.email');_0x520dca['field'](_0xf31d('0xa0'),_0xf31d('0xa1'));_0x520dca[_0xf31d('0x46')]('c.mobile',_0xf31d('0xa2'));_0x520dca[_0xf31d('0x46')](_0xf31d('0xa3'),_0xf31d('0xa4'));_0x520dca[_0xf31d('0x46')]('o.fullname',_0xf31d('0xa5'));_0x520dca['field'](_0xf31d('0xa6'),_0xf31d('0xa7'));_0x520dca[_0xf31d('0x46')](_0xf31d('0xa8'),_0xf31d('0x31'));}if(_0x63cd84[_0xf31d('0x23')])_0x520dca['limit'](_0x63cd84[_0xf31d('0x23')]);if(_0x63cd84[_0xf31d('0x20')])_0x520dca[_0xf31d('0x20')](_0x63cd84[_0xf31d('0x20')]);return db[_0xf31d('0x91')][_0xf31d('0x3b')](_0x520dca['toString'](),_0xc1f5c4);})[_0xf31d('0x2a')](function(_0x2ea915){if(_0x2ea915['length']>0x0)_0xe15336[_0xf31d('0x44')](_0xf31d('0xa9'),_[_0xf31d('0x2f')](_0x2ea915,'id'));return db['sequelize'][_0xf31d('0x3b')](_0xe15336[_0xf31d('0x92')](),_0xc1f5c4)[_0xf31d('0x2a')](function(_0x37a518){var _0x35dc0c=_[_0xf31d('0xaa')](_0x37a518,_0xf31d('0xab'));var _0x3e3cba=[];_0x2ea915[_0xf31d('0x64')](function(_0xd0f7c7){_0x3e3cba[_0xf31d('0xac')](updateOpenchannelInteraction(_0xd0f7c7,_0x4dacc9,_0x35dc0c));});return BPromise[_0xf31d('0xad')](_0x3e3cba);});});})['then'](function(_0x8c1661){_0x15c395['rows']=_0x8c1661;return _0x15c395;})[_0xf31d('0x2a')](respondWithFilteredResult(_0x564ada,_0x63cd84))['catch'](handleError(_0x564ada,null));};exports[_0xf31d('0xae')]=function(_0x30a229,_0x18301c){var _0x57c3aa={};if(_0x30a229[_0xf31d('0x3b')][_0xf31d('0x60')]&&_0x30a229[_0xf31d('0x3b')][_0xf31d('0x60')]===_0xf31d('0x47')){_0x57c3aa[_0xf31d('0x47')]=_0x30a229[_0xf31d('0xaf')]['id'];}else{_0x57c3aa['id']=_0x30a229[_0xf31d('0xaf')]['id'];}var _0x1a0822={'raw':![],'where':_0x57c3aa},_0x47b72a={};_0x47b72a['model']=_[_0xf31d('0x3c')](db[_0xf31d('0x36')]['rawAttributes']);_0x47b72a[_0xf31d('0x3b')]=_['keys'](_0x30a229[_0xf31d('0x3b')]);_0x47b72a[_0xf31d('0x3d')]=_['intersection'](_0x47b72a[_0xf31d('0x3a')],_0x47b72a[_0xf31d('0x3b')]);_0x1a0822[_0xf31d('0x40')]=_[_0xf31d('0x3e')](_0x47b72a[_0xf31d('0x3a')],qs['fields'](_0x30a229[_0xf31d('0x3b')]['fields']));_0x1a0822[_0xf31d('0x40')]=_0x1a0822['attributes'][_0xf31d('0x93')]?_0x1a0822[_0xf31d('0x40')]:_0x47b72a['model'];if(_0x30a229['query'][_0xf31d('0xb0')]){_0x1a0822[_0xf31d('0xb1')]=[{'all':!![]}];}_0x1a0822=_[_0xf31d('0x95')]({},_0x1a0822,_0x30a229[_0xf31d('0xb2')]);return db['OpenchannelInteraction'][_0xf31d('0x58')](_0x1a0822)[_0xf31d('0x2a')](handleEntityNotFound(_0x18301c,null))[_0xf31d('0x2a')](respondWithResult(_0x18301c,null))[_0xf31d('0x34')](handleError(_0x18301c,null));};exports['create']=function(_0x38452b,_0x2ab5b4){return db[_0xf31d('0x36')]['create'](_0x38452b[_0xf31d('0x6a')],{})[_0xf31d('0x2a')](respondWithResult(_0x2ab5b4,0xc9))[_0xf31d('0x34')](handleError(_0x2ab5b4,null));};exports[_0xf31d('0x28')]=function(_0x214602,_0x4f23c1){if(_0x214602[_0xf31d('0x6a')]['id']){delete _0x214602[_0xf31d('0x6a')]['id'];}return db['OpenchannelInteraction']['find']({'where':{'id':_0x214602[_0xf31d('0xaf')]['id']}})[_0xf31d('0x2a')](handleEntityNotFound(_0x4f23c1,null))[_0xf31d('0x2a')](saveUpdates(_0x214602[_0xf31d('0x6a')],null))['then'](respondWithResult(_0x4f23c1,null))['catch'](handleError(_0x4f23c1,null));};exports[_0xf31d('0x29')]=function(_0x32a1b3,_0x261837){return db[_0xf31d('0x36')][_0xf31d('0x58')]({'where':{'id':_0x32a1b3[_0xf31d('0xaf')]['id']}})[_0xf31d('0x2a')](handleEntityNotFound(_0x261837,null))[_0xf31d('0x2a')](removeEntity(_0x261837,null))[_0xf31d('0x34')](handleError(_0x261837,null));};exports[_0xf31d('0xb3')]=function(_0x139005,_0x2b75b2){return db[_0xf31d('0x36')]['describe']()[_0xf31d('0x2a')](respondWithResult(_0x2b75b2,null))[_0xf31d('0x34')](handleError(_0x2b75b2,null));};exports[_0xf31d('0xb4')]=function(_0x54653e,_0x1450df,_0x21a89f){return db['OpenchannelMessage'][_0xf31d('0x58')]({'where':{'id':_0x54653e['params']['id']}})[_0xf31d('0x2a')](handleEntityNotFound(_0x1450df,null))[_0xf31d('0x2a')](function(_0x26aa82){if(_0x26aa82){return _0x26aa82[_0xf31d('0xb4')](_0x54653e['body'][_0xf31d('0xb5')],_[_0xf31d('0xb6')](_0x54653e[_0xf31d('0x6a')],[_0xf31d('0xb5'),'id'])||{});}})[_0xf31d('0x2a')](respondWithResult(_0x1450df,null))[_0xf31d('0x34')](handleError(_0x1450df,null));};exports[_0xf31d('0xb7')]=function(_0x3d503d,_0x3c7c02,_0x40a3c7){var _0x2b6ab7={'raw':![],'where':{}};var _0x3fe076={};var _0xb31fdc={'count':0x0,'rows':[]};return db[_0xf31d('0x36')]['findOne']({'where':{'id':_0x3d503d[_0xf31d('0xaf')]['id']}})[_0xf31d('0x2a')](handleEntityNotFound(_0x3c7c02,null))[_0xf31d('0x2a')](function(_0x3d55fe){if(_0x3d55fe){_0x3fe076[_0xf31d('0x3a')]=_['keys'](db[_0xf31d('0xb8')][_0xf31d('0x37')]);_0x3fe076['query']=_[_0xf31d('0x3c')](_0x3d503d['query']);_0x3fe076[_0xf31d('0x3d')]=_[_0xf31d('0x3e')](_0x3fe076[_0xf31d('0x3a')],_0x3fe076[_0xf31d('0x3b')]);_0x2b6ab7[_0xf31d('0x40')]=_[_0xf31d('0x3e')](_0x3fe076['model'],qs[_0xf31d('0x3f')](_0x3d503d[_0xf31d('0x3b')][_0xf31d('0x3f')]));_0x2b6ab7[_0xf31d('0x40')]=_0x2b6ab7[_0xf31d('0x40')][_0xf31d('0x93')]?_0x2b6ab7[_0xf31d('0x40')]:_0x3fe076[_0xf31d('0x3a')];if(!_0x3d503d['query'][_0xf31d('0x41')](_0xf31d('0xb9'))){_0x2b6ab7[_0xf31d('0x23')]=qs['limit'](_0x3d503d['query'][_0xf31d('0x23')]);_0x2b6ab7[_0xf31d('0x20')]=qs[_0xf31d('0x20')](_0x3d503d[_0xf31d('0x3b')][_0xf31d('0x20')]);}_0x2b6ab7['order']=qs[_0xf31d('0x43')](_0x3d503d[_0xf31d('0x3b')]['sort']);_0x2b6ab7['where']=qs[_0xf31d('0x3d')](_[_0xf31d('0x45')](_0x3d503d[_0xf31d('0x3b')],_0x3fe076[_0xf31d('0x3d')]));_0x2b6ab7[_0xf31d('0x44')][_0xf31d('0xab')]=_0x3d55fe['id'];if(_0x3d503d[_0xf31d('0x3b')][_0xf31d('0x7c')]){_0x2b6ab7[_0xf31d('0x44')]=_['merge'](_0x2b6ab7[_0xf31d('0x44')],{'$or':_[_0xf31d('0x2f')](_0x2b6ab7[_0xf31d('0x40')],function(_0x4d04ce){var _0x539f05={};_0x539f05[_0x4d04ce]={'$like':'%'+_0x3d503d['query']['filter']+'%'};return _0x539f05;})});}if(_0x3d503d[_0xf31d('0x3b')][_0xf31d('0x72')]){var _0x5100af=_0x3d503d[_0xf31d('0x3b')][_0xf31d('0x72')][_0xf31d('0x33')](',');var _0x20b12c={};_0x20b12c[_0x5100af[0x0]]={'$gte':moment(_0x5100af[0x1])[_0xf31d('0xba')](_0xf31d('0xbb'))};_0x2b6ab7[_0xf31d('0x44')]=_[_0xf31d('0x95')](_0x2b6ab7['where'],_0x20b12c);}_0x2b6ab7=_[_0xf31d('0x95')]({},_0x2b6ab7,_0x3d503d[_0xf31d('0xb2')]);return db[_0xf31d('0xb8')]['count']({'where':_0x2b6ab7[_0xf31d('0x44')]})['then'](function(_0x38ee4c){_0xb31fdc[_0xf31d('0x22')]=_0x38ee4c;if(_0x3d503d['query'][_0xf31d('0xb0')]){_0x2b6ab7[_0xf31d('0xb1')]=[{'all':!![]}];}return db[_0xf31d('0xb8')][_0xf31d('0xbc')](_0x2b6ab7);})[_0xf31d('0x2a')](function(_0x55f3bd){_0xb31fdc['rows']=_0x55f3bd;return _0xb31fdc;});}})[_0xf31d('0x2a')](respondWithFilteredResult(_0x3c7c02,_0x2b6ab7))['catch'](handleError(_0x3c7c02,null));};exports[_0xf31d('0xbd')]=function(_0x31df81,_0x3809a6,_0x5b26cc){return db[_0xf31d('0x36')][_0xf31d('0x58')]({'where':{'id':_0x31df81[_0xf31d('0xaf')]['id']}})[_0xf31d('0x2a')](handleEntityNotFound(_0x3809a6,null))[_0xf31d('0x2a')](function(_0x2746b9){if(_0x2746b9){return _0x2746b9['setTags'](_0x31df81[_0xf31d('0x6a')][_0xf31d('0xb5')],_['omit'](_0x31df81[_0xf31d('0x6a')],['ids','id'])||{})['spread'](function(){return db[_0xf31d('0xbe')]['findAll']({'attributes':['id',_0xf31d('0x2d'),_0xf31d('0xbf')],'where':{'id':_0x31df81[_0xf31d('0x6a')][_0xf31d('0xb5')]}});})[_0xf31d('0x2a')](function(_0x25d7ff){socket[_0xf31d('0xc0')](_0xf31d('0xc1'),{'id':Number(_0x31df81[_0xf31d('0xaf')]['id']),'tags':_0x25d7ff||[]});return{'id':Number(_0x31df81[_0xf31d('0xaf')]['id']),'tags':_0x25d7ff||[]};});}})[_0xf31d('0x2a')](respondWithResult(_0x3809a6,null))[_0xf31d('0x34')](handleError(_0x3809a6,null));};exports['removeTags']=function(_0x4a7105,_0x421192,_0x3184c6){return db[_0xf31d('0x36')][_0xf31d('0x58')]({'where':{'id':_0x4a7105[_0xf31d('0xaf')]['id']}})['then'](handleEntityNotFound(_0x421192,null))['then'](function(_0x177733){if(_0x177733){return _0x177733[_0xf31d('0xc2')](_0x4a7105[_0xf31d('0x3b')][_0xf31d('0xb5')]);}})['then'](respondWithStatusCode(_0x421192,null))[_0xf31d('0x34')](handleError(_0x421192,null));};exports['download']=function(_0x1da096,_0x2c021f){var _0x5d04a4=moment()[_0xf31d('0xc3')]()[_0xf31d('0x92')]();var _0x348012=path[_0xf31d('0xc4')](config[_0xf31d('0xc5')],_0xf31d('0xc6'),_0xf31d('0xc7'),'tmp');var _0x151360=path[_0xf31d('0xc4')](config[_0xf31d('0xc5')],_0xf31d('0xc6'),_0xf31d('0xc7'),_0xf31d('0xc8'));var _0x1dd315=path['join'](_0x348012,_0x5d04a4);var _0x45561b=util['format'](_0xf31d('0xc9'),_0x1da096[_0xf31d('0xaf')]['id'],_0x5d04a4);var _0x39f65e=path[_0xf31d('0xc4')](_0x348012,_0x45561b);var _0x842fa2=[];_0x842fa2['push']({'model':db[_0xf31d('0x66')],'as':'User','attributes':['id',_0xf31d('0x30')],'raw':!![]});_0x842fa2[_0xf31d('0xac')]({'model':db[_0xf31d('0xca')],'as':_0xf31d('0xcb'),'attributes':['id',_0xf31d('0xcc'),_0xf31d('0xcd')],'raw':!![]});if(_0x1da096[_0xf31d('0x3b')][_0xf31d('0xc8')]){_0x842fa2[_0xf31d('0xac')]({'model':db[_0xf31d('0xce')],'as':_0xf31d('0xce'),'raw':!![]});}var _0x11f489=[{'model':db[_0xf31d('0xb8')],'as':'Messages','attributes':['id',_0xf31d('0x6a'),'createdAt',_0xf31d('0xcf'),_0xf31d('0xd0'),_0xf31d('0x76')],'include':_0x842fa2}];_0x11f489[_0xf31d('0xac')]({'model':db[_0xf31d('0xd1')],'as':_0xf31d('0xd2'),'attributes':['id',_0xf31d('0x2d')]});_0x11f489[_0xf31d('0xac')]({'model':db[_0xf31d('0x66')],'as':_0xf31d('0xd3'),'attributes':['id','fullname']});return db[_0xf31d('0x36')]['find']({'where':{'id':_0x1da096['params']['id']},'include':_0x11f489})[_0xf31d('0x2a')](handleEntityNotFound(_0x2c021f,null))[_0xf31d('0x2a')](function(_0x50b734){if(_0x50b734){var _0x1f91ab=_0x50b734[_0xf31d('0xd4')]({'plain':!![]});fs[_0xf31d('0xd5')](_0x1dd315);var _0x425b5b={'channel':_0xf31d('0xd6'),'account':_0x1f91ab[_0xf31d('0xd2')][_0xf31d('0x2d')],'agent':_0x1f91ab[_0xf31d('0xd3')]?_0x1f91ab[_0xf31d('0xd3')]['fullname']:_0xf31d('0xd7'),'createdAt':moment(_0x1f91ab[_0xf31d('0xd8')])['format'](_0xf31d('0xbb'))[_0xf31d('0x92')](),'closedAt':_0x1f91ab['closed']?moment(_0x1f91ab[_0xf31d('0xd9')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0xf31d('0x92')]():'','disposition':_0x1f91ab[_0xf31d('0xda')],'visibility':_0x1f91ab[_0xf31d('0xdb')]?_0xf31d('0xdc'):'Private','messages':_(_0x1f91ab['Messages'])['filter']({'secret':![]})[_0xf31d('0x2f')](function(_0x2a2d3c){if(_0x2a2d3c[_0xf31d('0xce')]){var _0xdfe05f=path[_0xf31d('0xc4')](_0x151360,_0x2a2d3c[_0xf31d('0xce')][_0xf31d('0xdd')]);if(fs[_0xf31d('0xde')](_0xdfe05f)){fs['createReadStream'](_0xdfe05f)[_0xf31d('0xdf')](fs[_0xf31d('0xe0')](path[_0xf31d('0xc4')](_0x1dd315,_0x2a2d3c['Attachment'][_0xf31d('0xdd')])));}}return{'date':moment(_0x2a2d3c[_0xf31d('0xd8')])[_0xf31d('0xba')](_0xf31d('0xbb'))[_0xf31d('0x92')](),'sender':_0x2a2d3c[_0xf31d('0xcf')]===_0xf31d('0xe1')?_0x2a2d3c['User']?_0x2a2d3c[_0xf31d('0x66')][_0xf31d('0x30')]:_0xf31d('0xe2'):_0x2a2d3c[_0xf31d('0xcb')][_0xf31d('0xcc')]+(_0x2a2d3c['Contact'][_0xf31d('0xcd')]?'\x20'+_0x2a2d3c['Contact']['lastName']:''),'body':_0x2a2d3c[_0xf31d('0xce')]?_0x2a2d3c[_0xf31d('0xce')][_0xf31d('0xdd')]:_0x2a2d3c[_0xf31d('0x6a')],'direction':_0x2a2d3c[_0xf31d('0xcf')]===_0xf31d('0xe1')?'A':'C','secret':_0x2a2d3c[_0xf31d('0xd0')],'read':_0x2a2d3c[_0xf31d('0x76')],'attachment':_0x2a2d3c['Attachment']};})[_0xf31d('0x5a')]()};return ejs[_0xf31d('0xe3')](path[_0xf31d('0xc4')](config['root'],'server',_0xf31d('0xe4'),_0xf31d('0xe5')),{'interaction':_0x425b5b})[_0xf31d('0x2a')](function(_0x5ac8ed){var _0x459843=path[_0xf31d('0xc4')](_0x1dd315,'transcript-'+_0x1f91ab['id']+'-'+_0x5d04a4+_0xf31d('0xe6'));var _0x51e3c2={'path':_0x459843,'channel':_0xf31d('0xd6'),'interactionId':_0x1f91ab['id']};return pdf[_0xf31d('0xe7')](_0x5ac8ed,_0x51e3c2);})[_0xf31d('0x2a')](function(){return new BPromise(function(_0x4cbbf4,_0x50c760){zipdir(_0x1dd315,{'saveTo':_0x39f65e},function(_0x241d9c,_0x77e08c){if(_0x241d9c)return _0x50c760(_0x241d9c);return _0x4cbbf4(_0x77e08c);});})['then'](function(){return new BPromise(function(_0x3411cd,_0x59804b){rimraf(_0x1dd315,function(_0x1cf1a0){if(_0x1cf1a0)_0x59804b(_0x1cf1a0);return _0x3411cd();});});})['then'](function(){return _0x2c021f[_0xf31d('0xe8')](_0x39f65e,_0x45561b,function(_0x5a4efd){if(_0x5a4efd){console[_0xf31d('0xe9')](_0xf31d('0xea'),_0x5a4efd);}else{fs[_0xf31d('0xeb')](_0x39f65e);}});});});}else{return _0x2c021f[_0xf31d('0x1e')](0xc8);}})['catch'](handleError(_0x2c021f,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index f34087d..74d0985 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 _0x4ca1=['unreadMessages','length','emit','hook','exports','events','../../mysqldb','OpenchannelInteraction','OpenchannelMessage','save','remove','getUsers','then','setDataValue','findAll'];(function(_0x2555d0,_0x4150a6){var _0x3bb486=function(_0x1eb89f){while(--_0x1eb89f){_0x2555d0['push'](_0x2555d0['shift']());}};_0x3bb486(++_0x4150a6);}(_0x4ca1,0x14f));var _0x14ca=function(_0x5ba513,_0x459c3b){_0x5ba513=_0x5ba513-0x0;var _0x1132a0=_0x4ca1[_0x5ba513];return _0x1132a0;};'use strict';var EventEmitter=require(_0x14ca('0x0'));var OpenchannelInteraction=require(_0x14ca('0x1'))['db'][_0x14ca('0x2')];var OpenchannelMessage=require(_0x14ca('0x1'))['db'][_0x14ca('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x14ca('0x4'),'afterUpdate':'update','afterDestroy':_0x14ca('0x5')};function emitEvent(_0x54c8a6){return function(_0x1fa5a2,_0x283118,_0xa9ea14){_0x1fa5a2[_0x14ca('0x6')]({'attributes':['id'],'raw':!![]})[_0x14ca('0x7')](function(_0x40d1fa){_0x1fa5a2[_0x14ca('0x8')]('Users',_0x40d1fa['map'](function(_0x37762b){return{'id':_0x37762b['id']};}));return OpenchannelMessage[_0x14ca('0x9')]({'where':{'OpenchannelInteractionId':_0x1fa5a2['id'],'direction':'in','read':![]},'raw':!![]});})[_0x14ca('0x7')](function(_0x545b72){_0x1fa5a2[_0x14ca('0x8')](_0x14ca('0xa'),_0x545b72[_0x14ca('0xb')]);OpenchannelInteractionEvents[_0x14ca('0xc')](_0x54c8a6+':'+_0x1fa5a2['id'],_0x1fa5a2);OpenchannelInteractionEvents[_0x14ca('0xc')](_0x54c8a6,_0x1fa5a2);_0xa9ea14(null);})['catch'](_0xa9ea14(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelInteraction[_0x14ca('0xd')](e,emitEvent(event));}}module[_0x14ca('0xe')]=OpenchannelInteractionEvents; \ No newline at end of file +var _0x24b4=['Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','exports','events','../../mysqldb','OpenchannelInteraction','OpenchannelMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue'];(function(_0x278797,_0x189dc7){var _0x10f482=function(_0x13c307){while(--_0x13c307){_0x278797['push'](_0x278797['shift']());}};_0x10f482(++_0x189dc7);}(_0x24b4,0x1e9));var _0x424b=function(_0x5e5268,_0x75213e){_0x5e5268=_0x5e5268-0x0;var _0x1c5bab=_0x24b4[_0x5e5268];return _0x1c5bab;};'use strict';var EventEmitter=require(_0x424b('0x0'));var OpenchannelInteraction=require(_0x424b('0x1'))['db'][_0x424b('0x2')];var OpenchannelMessage=require(_0x424b('0x1'))['db'][_0x424b('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x424b('0x4')](0x0);var events={'afterCreate':_0x424b('0x5'),'afterUpdate':_0x424b('0x6'),'afterDestroy':_0x424b('0x7')};function emitEvent(_0x41d213){return function(_0x4b5569,_0x170828,_0x36c875){_0x4b5569[_0x424b('0x8')]({'attributes':['id'],'raw':!![]})[_0x424b('0x9')](function(_0x323099){_0x4b5569[_0x424b('0xa')](_0x424b('0xb'),_0x323099[_0x424b('0xc')](function(_0x21d789){return{'id':_0x21d789['id']};}));return OpenchannelMessage[_0x424b('0xd')]({'where':{'OpenchannelInteractionId':_0x4b5569['id'],'direction':'in','read':![]},'raw':!![]});})[_0x424b('0x9')](function(_0x15044e){_0x4b5569['setDataValue'](_0x424b('0xe'),_0x15044e[_0x424b('0xf')]);OpenchannelInteractionEvents[_0x424b('0x10')](_0x41d213+':'+_0x4b5569['id'],_0x4b5569);OpenchannelInteractionEvents[_0x424b('0x10')](_0x41d213,_0x4b5569);_0x36c875(null);})[_0x424b('0x11')](_0x36c875(null));};}for(var e in events){if(events[_0x424b('0x12')](e)){var event=events[e];OpenchannelInteraction['hook'](e,emitEvent(event));}}module[_0x424b('0x13')]=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index 9669b21..947c47e 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 _0xcff7=['openchannel_interactions','changed','closed','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x2a534f,_0x23705b){var _0x23d365=function(_0x2f5849){while(--_0x2f5849){_0x2a534f['push'](_0x2a534f['shift']());}};_0x23d365(++_0x23705b);}(_0xcff7,0xc8));var _0x7cff=function(_0x1b3fe4,_0x342870){_0x1b3fe4=_0x1b3fe4-0x0;var _0x379ad5=_0xcff7[_0x1b3fe4];return _0x379ad5;};'use strict';var _=require(_0x7cff('0x0'));var util=require(_0x7cff('0x1'));var logger=require(_0x7cff('0x2'))(_0x7cff('0x3'));var moment=require('moment');var BPromise=require(_0x7cff('0x4'));var rp=require(_0x7cff('0x5'));var fs=require('fs');var path=require(_0x7cff('0x6'));var rimraf=require(_0x7cff('0x7'));var config=require(_0x7cff('0x8'));var attributes=require('./openchannelInteraction.attributes');module[_0x7cff('0x9')]=function(_0x1f4f8b,_0x3549ee){return _0x1f4f8b['define']('OpenchannelInteraction',attributes,{'tableName':_0x7cff('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci','hooks':{'beforeUpdate':function(_0x32a6e1,_0x50ad4f,_0x5234f5){if(_0x32a6e1[_0x7cff('0xb')](_0x7cff('0xc'))){_0x32a6e1['closedAt']=moment()['format'](_0x7cff('0xd'));}_0x5234f5(null,_0x32a6e1);}}});}; \ No newline at end of file +var _0xa75c=['moment','bluebird','request-promise','../../config/environment','./openchannelInteraction.attributes','exports','OpenchannelInteraction','openchannel_interactions','utf8mb4','changed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','api'];(function(_0x180e70,_0x3620a3){var _0x5d130b=function(_0x3bcdf2){while(--_0x3bcdf2){_0x180e70['push'](_0x180e70['shift']());}};_0x5d130b(++_0x3620a3);}(_0xa75c,0x183));var _0xca75=function(_0x33975c,_0x50d085){_0x33975c=_0x33975c-0x0;var _0x1c15ab=_0xa75c[_0x33975c];return _0x1c15ab;};'use strict';var _=require(_0xca75('0x0'));var util=require('util');var logger=require(_0xca75('0x1'))(_0xca75('0x2'));var moment=require(_0xca75('0x3'));var BPromise=require(_0xca75('0x4'));var rp=require(_0xca75('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xca75('0x6'));var attributes=require(_0xca75('0x7'));module[_0xca75('0x8')]=function(_0x372b45,_0x4d339a){return _0x372b45['define'](_0xca75('0x9'),attributes,{'tableName':_0xca75('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xca75('0xb'),'collate':'utf8mb4_unicode_ci','hooks':{'beforeUpdate':function(_0x3da6e7,_0x51667a,_0x457993){if(_0x3da6e7[_0xca75('0xc')]('closed')){_0x3da6e7['closedAt']=moment()[_0xca75('0xd')](_0xca75('0xe'));}_0x457993(null,_0x3da6e7);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index 25048c6..02599a7 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 _0x38fe=['jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','request','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','code','error','message','info','result','catch','OpenchannelInteraction','update','body','options','raw','where','limit','UpdateOpenchannelInteraction','debug','find','omit','ids','spread','AddTags','stringify','lodash','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x24061a,_0x1c9f4d){var _0x82054e=function(_0x2ec346){while(--_0x2ec346){_0x24061a['push'](_0x24061a['shift']());}};_0x82054e(++_0x1c9f4d);}(_0x38fe,0xe9));var _0xe38f=function(_0x283613,_0x1dbd06){_0x283613=_0x283613-0x0;var _0x4a5abf=_0x38fe[_0x283613];return _0x4a5abf;};'use strict';var _=require(_0xe38f('0x0'));var util=require(_0xe38f('0x1'));var moment=require('moment');var BPromise=require(_0xe38f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe38f('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xe38f('0x4'));var logger=require(_0xe38f('0x5'))(_0xe38f('0x6'));var config=require('../../config/environment');var jayson=require(_0xe38f('0x7'));var client=jayson['client'][_0xe38f('0x8')]({'port':0x232a});config[_0xe38f('0x9')]=_[_0xe38f('0xa')](config[_0xe38f('0x9')],{'host':_0xe38f('0xb'),'port':0x18eb});var socket=require(_0xe38f('0xc'))(new Redis(config['redis']));require(_0xe38f('0xd'))[_0xe38f('0xe')](socket);function respondWithRpcPromise(_0x2bf594,_0x23bc51,_0x4d919b){return new BPromise(function(_0x51ef78,_0x5a6278){return client[_0xe38f('0xf')](_0x2bf594,_0x4d919b)['then'](function(_0x4200d9){logger['info'](_0xe38f('0x10'),_0x23bc51,_0xe38f('0x11'));logger['debug'](_0xe38f('0x12'),_0x23bc51,_0xe38f('0x11'),JSON['stringify'](_0x4200d9));if(_0x4200d9['error']){if(_0x4200d9['error'][_0xe38f('0x13')]===0x1f4){logger[_0xe38f('0x14')](_0xe38f('0x10'),_0x23bc51,_0x4200d9[_0xe38f('0x14')][_0xe38f('0x15')]);return _0x5a6278(_0x4200d9['error']['message']);}logger[_0xe38f('0x14')]('OpenchannelInteraction,\x20%s,\x20%s',_0x23bc51,_0x4200d9[_0xe38f('0x14')][_0xe38f('0x15')]);return _0x51ef78(_0x4200d9[_0xe38f('0x14')]['message']);}else{logger[_0xe38f('0x16')](_0xe38f('0x10'),_0x23bc51,_0xe38f('0x11'));_0x51ef78(_0x4200d9[_0xe38f('0x17')]['message']);}})[_0xe38f('0x18')](function(_0xa4d103){logger[_0xe38f('0x14')](_0xe38f('0x10'),_0x23bc51,_0xa4d103);_0x5a6278(_0xa4d103);});});}exports['UpdateOpenchannelInteraction']=function(_0x5f2a95){var _0x4e9e5a=this;return new Promise(function(_0x1ca972,_0x4381e5){return db[_0xe38f('0x19')][_0xe38f('0x1a')](_0x5f2a95[_0xe38f('0x1b')],{'raw':_0x5f2a95[_0xe38f('0x1c')]?_0x5f2a95['options'][_0xe38f('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5f2a95[_0xe38f('0x1c')]?_0x5f2a95[_0xe38f('0x1c')][_0xe38f('0x1e')]||null:null,'attributes':_0x5f2a95['options']?_0x5f2a95[_0xe38f('0x1c')]['attributes']||null:null,'limit':_0x5f2a95[_0xe38f('0x1c')]?_0x5f2a95[_0xe38f('0x1c')][_0xe38f('0x1f')]||null:null})['then'](function(_0x5e11f6){logger[_0xe38f('0x16')](_0xe38f('0x20'),_0x5f2a95);logger[_0xe38f('0x21')](_0xe38f('0x20'),_0x5f2a95,JSON['stringify'](_0x5e11f6));_0x1ca972(_0x5e11f6);})['catch'](function(_0x127818){logger[_0xe38f('0x14')]('UpdateOpenchannelInteraction',_0x127818[_0xe38f('0x15')],_0x5f2a95);_0x4381e5(_0x4e9e5a[_0xe38f('0x14')](0x1f4,_0x127818[_0xe38f('0x15')]));});});};exports['AddTagsToOpenchannelInteraction']=function(_0x362a74){return new Promise(function(_0x2ef970,_0x5908f3){return db[_0xe38f('0x19')][_0xe38f('0x22')]({'where':_0x362a74['options']?_0x362a74['options'][_0xe38f('0x1e')]||null:null})['then'](function(_0xeea6f6){if(_0xeea6f6){return _0xeea6f6['addTags'](_0x362a74[_0xe38f('0x1b')]['ids'],_[_0xe38f('0x23')](_0x362a74[_0xe38f('0x1b')],[_0xe38f('0x24'),'id'])||{});}})[_0xe38f('0x25')](function(_0x5d27c0){logger[_0xe38f('0x16')]('AddTags',_0x362a74);logger['debug'](_0xe38f('0x26'),_0x362a74,JSON[_0xe38f('0x27')](_0x5d27c0));_0x2ef970(_0x5d27c0);})[_0xe38f('0x18')](function(_0x509e3e){logger['error']('AddTags',_0x509e3e[_0xe38f('0x15')],_0x362a74);_0x5908f3(_this['error'](0x1f4,_0x509e3e[_0xe38f('0x15')]));});});}; \ No newline at end of file +var _0xd9b1=['raw','where','then','AddTagsToOpenchannelInteraction','OpenchannelInteraction','find','addTags','ids','body','AddTags','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','http','redis','defaults','socket.io-emitter','./openchannelInteraction.socket','request','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','UpdateOpenchannelInteraction','update','options'];(function(_0x4b03d3,_0x32f1d2){var _0x58a968=function(_0x1661e5){while(--_0x1661e5){_0x4b03d3['push'](_0x4b03d3['shift']());}};_0x58a968(++_0x32f1d2);}(_0xd9b1,0x187));var _0x1d9b=function(_0x2864b6,_0x4156c6){_0x2864b6=_0x2864b6-0x0;var _0x59f642=_0xd9b1[_0x2864b6];return _0x59f642;};'use strict';var _=require(_0x1d9b('0x0'));var util=require(_0x1d9b('0x1'));var moment=require(_0x1d9b('0x2'));var BPromise=require(_0x1d9b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1d9b('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1d9b('0x5'));var logger=require('../../config/logger')(_0x1d9b('0x6'));var config=require(_0x1d9b('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1d9b('0x8')]({'port':0x232a});config[_0x1d9b('0x9')]=_[_0x1d9b('0xa')](config[_0x1d9b('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x1d9b('0xb'))(new Redis(config[_0x1d9b('0x9')]));require(_0x1d9b('0xc'))['register'](socket);function respondWithRpcPromise(_0x11410b,_0x215144,_0x291e23){return new BPromise(function(_0x3df260,_0x27d1a0){return client[_0x1d9b('0xd')](_0x11410b,_0x291e23)['then'](function(_0x20ab3c){logger[_0x1d9b('0xe')](_0x1d9b('0xf'),_0x215144,_0x1d9b('0x10'));logger[_0x1d9b('0x11')](_0x1d9b('0x12'),_0x215144,'request\x20sent',JSON[_0x1d9b('0x13')](_0x20ab3c));if(_0x20ab3c[_0x1d9b('0x14')]){if(_0x20ab3c[_0x1d9b('0x14')][_0x1d9b('0x15')]===0x1f4){logger[_0x1d9b('0x14')](_0x1d9b('0xf'),_0x215144,_0x20ab3c[_0x1d9b('0x14')]['message']);return _0x27d1a0(_0x20ab3c[_0x1d9b('0x14')][_0x1d9b('0x16')]);}logger[_0x1d9b('0x14')](_0x1d9b('0xf'),_0x215144,_0x20ab3c[_0x1d9b('0x14')]['message']);return _0x3df260(_0x20ab3c[_0x1d9b('0x14')]['message']);}else{logger[_0x1d9b('0xe')](_0x1d9b('0xf'),_0x215144,_0x1d9b('0x10'));_0x3df260(_0x20ab3c[_0x1d9b('0x17')][_0x1d9b('0x16')]);}})['catch'](function(_0x15e8f7){logger[_0x1d9b('0x14')](_0x1d9b('0xf'),_0x215144,_0x15e8f7);_0x27d1a0(_0x15e8f7);});});}exports[_0x1d9b('0x18')]=function(_0x4796c1){var _0x34dc1b=this;return new Promise(function(_0x32e64c,_0x1058b0){return db['OpenchannelInteraction'][_0x1d9b('0x19')](_0x4796c1['body'],{'raw':_0x4796c1[_0x1d9b('0x1a')]?_0x4796c1['options'][_0x1d9b('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4796c1[_0x1d9b('0x1a')]?_0x4796c1['options'][_0x1d9b('0x1c')]||null:null,'attributes':_0x4796c1[_0x1d9b('0x1a')]?_0x4796c1[_0x1d9b('0x1a')]['attributes']||null:null,'limit':_0x4796c1[_0x1d9b('0x1a')]?_0x4796c1['options']['limit']||null:null})[_0x1d9b('0x1d')](function(_0x58f77b){logger[_0x1d9b('0xe')](_0x1d9b('0x18'),_0x4796c1);logger['debug'](_0x1d9b('0x18'),_0x4796c1,JSON[_0x1d9b('0x13')](_0x58f77b));_0x32e64c(_0x58f77b);})['catch'](function(_0x670b7d){logger[_0x1d9b('0x14')](_0x1d9b('0x18'),_0x670b7d['message'],_0x4796c1);_0x1058b0(_0x34dc1b[_0x1d9b('0x14')](0x1f4,_0x670b7d['message']));});});};exports[_0x1d9b('0x1e')]=function(_0x187b1e){return new Promise(function(_0x5986f5,_0x5d03cc){return db[_0x1d9b('0x1f')][_0x1d9b('0x20')]({'where':_0x187b1e[_0x1d9b('0x1a')]?_0x187b1e[_0x1d9b('0x1a')]['where']||null:null})['then'](function(_0x2c78c6){if(_0x2c78c6){return _0x2c78c6[_0x1d9b('0x21')](_0x187b1e['body'][_0x1d9b('0x22')],_['omit'](_0x187b1e[_0x1d9b('0x23')],[_0x1d9b('0x22'),'id'])||{});}})['spread'](function(_0x23b56d){logger[_0x1d9b('0xe')]('AddTags',_0x187b1e);logger[_0x1d9b('0x11')](_0x1d9b('0x24'),_0x187b1e,JSON[_0x1d9b('0x13')](_0x23b56d));_0x5986f5(_0x23b56d);})[_0x1d9b('0x25')](function(_0x54a942){logger[_0x1d9b('0x14')](_0x1d9b('0x24'),_0x54a942[_0x1d9b('0x16')],_0x187b1e);_0x5d03cc(_this['error'](0x1f4,_0x54a942[_0x1d9b('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index 4e541a7..f3622af 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 _0x0550=['./openchannelInteraction.events','save','remove','emit','register','length','openchannelInteraction:'];(function(_0x2a4148,_0x72b950){var _0x36c495=function(_0x20854a){while(--_0x20854a){_0x2a4148['push'](_0x2a4148['shift']());}};_0x36c495(++_0x72b950);}(_0x0550,0xd2));var _0x0055=function(_0x552252,_0xdb0d75){_0x552252=_0x552252-0x0;var _0x16ae8d=_0x0550[_0x552252];return _0x16ae8d;};'use strict';var OpenchannelInteractionEvents=require(_0x0055('0x0'));var events=[_0x0055('0x1'),_0x0055('0x2'),'update'];function createListener(_0x41f5db,_0x14dc19){return function(_0x3e9a82){_0x14dc19[_0x0055('0x3')](_0x41f5db,_0x3e9a82);};}function removeListener(_0x59a90d,_0x4314c3){return function(){OpenchannelInteractionEvents['removeListener'](_0x59a90d,_0x4314c3);};}exports[_0x0055('0x4')]=function(_0x16423e){for(var _0x351554=0x0,_0x5cb169=events[_0x0055('0x5')];_0x351554<_0x5cb169;_0x351554++){var _0x4c3a47=events[_0x351554];var _0x470eca=createListener(_0x0055('0x6')+_0x4c3a47,_0x16423e);OpenchannelInteractionEvents['on'](_0x4c3a47,_0x470eca);}}; \ No newline at end of file +var _0x4631=['./openchannelInteraction.events','save','remove','update','removeListener','register','length','openchannelInteraction:'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x4631,0x198));var _0x1463=function(_0x34021d,_0x753aa6){_0x34021d=_0x34021d-0x0;var _0x16597b=_0x4631[_0x34021d];return _0x16597b;};'use strict';var OpenchannelInteractionEvents=require(_0x1463('0x0'));var events=[_0x1463('0x1'),_0x1463('0x2'),_0x1463('0x3')];function createListener(_0x57a6b7,_0x331e4a){return function(_0x4f2a65){_0x331e4a['emit'](_0x57a6b7,_0x4f2a65);};}function removeListener(_0x95253a,_0x3f2b98){return function(){OpenchannelInteractionEvents[_0x1463('0x4')](_0x95253a,_0x3f2b98);};}exports[_0x1463('0x5')]=function(_0x19fc37){for(var _0x42d6ac=0x0,_0x2854fa=events[_0x1463('0x6')];_0x42d6ac<_0x2854fa;_0x42d6ac++){var _0x54c320=events[_0x42d6ac];var _0x1d1bcc=createListener(_0x1463('0x7')+_0x54c320,_0x19fc37);OpenchannelInteractionEvents['on'](_0x54c320,_0x1d1bcc);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index 7638523..84e711d 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 _0x70e0=['put','update','/:id/accept','accept','destroy','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelMessage.controller','isAuthenticated','describe','get','/:id','show','post','openchannel','openchannelmessage:create','create'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x70e0,0x17b));var _0x070e=function(_0x50efe2,_0x1a8c58){_0x50efe2=_0x50efe2-0x0;var _0xc9b57a=_0x70e0[_0x50efe2];return _0xc9b57a;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');var controller=require(_0x070e('0x7'));router['get']('/',auth[_0x070e('0x8')](),controller['index']);router['get']('/describe',auth[_0x070e('0x8')](),controller[_0x070e('0x9')]);router[_0x070e('0xa')](_0x070e('0xb'),auth[_0x070e('0x8')](),controller[_0x070e('0xc')]);router[_0x070e('0xd')]('/',auth['isAuthenticated'](),interaction['tracked'](_0x070e('0xe'),_0x070e('0xf')),controller[_0x070e('0x10')]);router[_0x070e('0x11')](_0x070e('0xb'),auth[_0x070e('0x8')](),controller[_0x070e('0x12')]);router[_0x070e('0x11')](_0x070e('0x13'),auth[_0x070e('0x8')](),controller[_0x070e('0x14')]);router['put']('/:id/reject',auth[_0x070e('0x8')](),controller['reject']);router['delete']('/:id',auth[_0x070e('0x8')](),controller[_0x070e('0x15')]);module['exports']=router; \ No newline at end of file +var _0x70e0=['put','update','/:id/accept','accept','destroy','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelMessage.controller','isAuthenticated','describe','get','/:id','show','post','openchannel','openchannelmessage:create','create'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x70e0,0x17b));var _0x070e=function(_0x25d395,_0x584c38){_0x25d395=_0x25d395-0x0;var _0x26487f=_0x70e0[_0x25d395];return _0x26487f;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');var controller=require(_0x070e('0x7'));router['get']('/',auth[_0x070e('0x8')](),controller['index']);router['get']('/describe',auth[_0x070e('0x8')](),controller[_0x070e('0x9')]);router[_0x070e('0xa')](_0x070e('0xb'),auth[_0x070e('0x8')](),controller[_0x070e('0xc')]);router[_0x070e('0xd')]('/',auth['isAuthenticated'](),interaction['tracked'](_0x070e('0xe'),_0x070e('0xf')),controller[_0x070e('0x10')]);router[_0x070e('0x11')](_0x070e('0xb'),auth[_0x070e('0x8')](),controller[_0x070e('0x12')]);router[_0x070e('0x11')](_0x070e('0x13'),auth[_0x070e('0x8')](),controller[_0x070e('0x14')]);router['put']('/:id/reject',auth[_0x070e('0x8')](),controller['reject']);router['delete']('/:id',auth[_0x070e('0x8')](),controller[_0x070e('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index ab27c15..5bcfa08 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 _0x173d=['exports','BOOLEAN','ENUM','out','DATE','STRING'];(function(_0x44bfef,_0x399046){var _0x38a406=function(_0x5e7995){while(--_0x5e7995){_0x44bfef['push'](_0x44bfef['shift']());}};_0x38a406(++_0x399046);}(_0x173d,0x108));var _0xd173=function(_0x52c5ef,_0x5ba79c){_0x52c5ef=_0x52c5ef-0x0;var _0x538fbf=_0x173d[_0x52c5ef];return _0x538fbf;};'use strict';var Sequelize=require('sequelize');module[_0xd173('0x0')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xd173('0x1')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xd173('0x2')]('in',_0xd173('0x3')),'defaultValue':_0xd173('0x3'),'allowNull':![]},'readAt':{'type':Sequelize[_0xd173('0x4')]},'providerName':{'type':Sequelize[_0xd173('0x5')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0xb9e7=['ENUM','out','DATE','exports','TEXT','medium','BOOLEAN'];(function(_0x2abaae,_0x29fd8b){var _0x5b5745=function(_0x2f6218){while(--_0x2f6218){_0x2abaae['push'](_0x2abaae['shift']());}};_0x5b5745(++_0x29fd8b);}(_0xb9e7,0x1df));var _0x7b9e=function(_0x7b173,_0x539d7f){_0x7b173=_0x7b173-0x0;var _0x1c598c=_0xb9e7[_0x7b173];return _0x1c598c;};'use strict';var Sequelize=require('sequelize');module[_0x7b9e('0x0')]={'body':{'type':Sequelize[_0x7b9e('0x1')](_0x7b9e('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x7b9e('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x7b9e('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x7b9e('0x4')]('in','out'),'defaultValue':_0x7b9e('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x7b9e('0x6')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0x7b9e('0x1')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index b1598bb..4c370bc 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 _0x90b5=['show','intersection','includeAll','find','catch','body','update','params','describe','../../config/logger','openchannel-interactions','accept','readAt','format','YYYY-MM-DD\x20HH:mm:ss','user','agent','UserId','get','OpenchannelInteraction','OpenchannelInteractionId','isNil','role','interaction','null','acceptMessage','ContactId','sequelize','Sequelize','QueryTypes','SELECT','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','openchannel','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','contact','User','rejectmessage','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./openchannelMessage.socket','register','jayson/promise','client','http','request','then','request\x20sent','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelMessage,\x20%s,\x20%s','message','info','sendStatus','status','end','json','undefined','count','offset','limit','set','apply','save','destroy','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','fields','length','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','include','OpenchannelMessage','findAll','rows'];(function(_0x587180,_0x146b3a){var _0x1eee3c=function(_0x3845e7){while(--_0x3845e7){_0x587180['push'](_0x587180['shift']());}};_0x1eee3c(++_0x146b3a);}(_0x90b5,0x139));var _0x590b=function(_0xae01dd,_0xbd8a3c){_0xae01dd=_0xae01dd-0x0;var _0x8c26df=_0x90b5[_0xae01dd];return _0x8c26df;};'use strict';var emlformat=require(_0x590b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x590b('0x1'));var jsonpatch=require(_0x590b('0x2'));var rp=require(_0x590b('0x3'));var moment=require(_0x590b('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x590b('0x5'));var path=require(_0x590b('0x6'));var sox=require('sox');var csv=require(_0x590b('0x7'));var ejs=require(_0x590b('0x8'));var fs=require('fs');var fs_extra=require(_0x590b('0x9'));var _=require('lodash');var squel=require(_0x590b('0xa'));var crypto=require(_0x590b('0xb'));var jsforce=require(_0x590b('0xc'));var deskjs=require(_0x590b('0xd'));var toCsv=require(_0x590b('0x7'));var querystring=require(_0x590b('0xe'));var Papa=require(_0x590b('0xf'));var Redis=require(_0x590b('0x10'));var authService=require(_0x590b('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x590b('0x12'));var hardwareService=require(_0x590b('0x13'));var logger=require('../../config/logger')(_0x590b('0x14'));var utils=require('../../config/utils');var config=require(_0x590b('0x15'));var licenseUtil=require(_0x590b('0x16'));var db=require(_0x590b('0x17'))['db'];config[_0x590b('0x18')]=_['defaults'](config[_0x590b('0x18')],{'host':_0x590b('0x19'),'port':0x18eb});var socket=require(_0x590b('0x1a'))(new Redis(config[_0x590b('0x18')]));require(_0x590b('0x1b'))[_0x590b('0x1c')](socket);var jayson=require(_0x590b('0x1d'));var client=jayson[_0x590b('0x1e')][_0x590b('0x1f')]({'port':0x232c});var client9002=jayson[_0x590b('0x1e')][_0x590b('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x260f47,_0x3e4723,_0x378490,_0x3b9601){return new BPromise(function(_0x4f2512,_0x1ec65a){var _0x530e24=_0x3b9601||client;return _0x530e24[_0x590b('0x20')](_0x260f47,_0x378490)[_0x590b('0x21')](function(_0xf05b00){logger['info']('OpenchannelMessage,\x20%s,\x20%s',_0x3e4723,_0x590b('0x22'));logger['debug'](_0x590b('0x23'),_0x3e4723,_0x590b('0x22'),JSON[_0x590b('0x24')](_0xf05b00));if(_0xf05b00['error']){if(_0xf05b00[_0x590b('0x25')][_0x590b('0x26')]===0x1f4){logger[_0x590b('0x25')](_0x590b('0x27'),_0x3e4723,_0xf05b00['error'][_0x590b('0x28')]);return _0x1ec65a(_0xf05b00['error'][_0x590b('0x28')]);}logger[_0x590b('0x25')]('OpenchannelMessage,\x20%s,\x20%s',_0x3e4723,_0xf05b00['error'][_0x590b('0x28')]);return _0x4f2512(_0xf05b00[_0x590b('0x25')]['message']);}else{logger[_0x590b('0x29')](_0x590b('0x27'),_0x3e4723,'request\x20sent');_0x4f2512(_0xf05b00['result'][_0x590b('0x28')]);}})['catch'](function(_0x39fead){logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x3e4723,_0x39fead);_0x1ec65a(_0x39fead);});});}function respondWithStatusCode(_0x2314d0,_0x20571b){_0x20571b=_0x20571b||0xcc;return function(_0x5cf6b6){if(_0x5cf6b6){return _0x2314d0[_0x590b('0x2a')](_0x20571b);}return _0x2314d0[_0x590b('0x2b')](_0x20571b)[_0x590b('0x2c')]();};}function respondWithResult(_0x2914dd,_0x320a45){_0x320a45=_0x320a45||0xc8;return function(_0x5c5903){if(_0x5c5903){return _0x2914dd[_0x590b('0x2b')](_0x320a45)[_0x590b('0x2d')](_0x5c5903);}};}function respondWithFilteredResult(_0x333af8,_0x38a64a){return function(_0x1ee769){if(_0x1ee769){var _0x3b881f=typeof _0x38a64a['offset']===_0x590b('0x2e')&&typeof _0x38a64a['limit']===_0x590b('0x2e');var _0x3f9fd0=_0x1ee769[_0x590b('0x2f')];var _0x33931e=_0x3b881f?0x0:_0x38a64a['offset'];var _0x1041e5=_0x3b881f?_0x1ee769['count']:_0x38a64a[_0x590b('0x30')]+_0x38a64a[_0x590b('0x31')];var _0x2ea853;if(_0x1041e5>=_0x3f9fd0){_0x1041e5=_0x3f9fd0;_0x2ea853=0xc8;}else{_0x2ea853=0xce;}_0x333af8[_0x590b('0x2b')](_0x2ea853);return _0x333af8[_0x590b('0x32')]('Content-Range',_0x33931e+'-'+_0x1041e5+'/'+_0x3f9fd0)[_0x590b('0x2d')](_0x1ee769);}return null;};}function patchUpdates(_0x129516){return function(_0x4303f6){try{jsonpatch[_0x590b('0x33')](_0x4303f6,_0x129516,!![]);}catch(_0x5efcae){return BPromise['reject'](_0x5efcae);}return _0x4303f6[_0x590b('0x34')]();};}function saveUpdates(_0x125ee3,_0x48408d){return function(_0x38c312){if(_0x38c312){return _0x38c312['update'](_0x125ee3)['then'](function(_0x2387f7){return _0x2387f7;});}return null;};}function removeEntity(_0x4b0616,_0x87bee6){return function(_0x4561ac){if(_0x4561ac){return _0x4561ac[_0x590b('0x35')]()[_0x590b('0x21')](function(){_0x4b0616[_0x590b('0x2b')](0xcc)[_0x590b('0x2c')]();});}};}function handleEntityNotFound(_0x251cab,_0x4579e3){return function(_0x422a5b){if(!_0x422a5b){_0x251cab[_0x590b('0x2a')](0x194);}return _0x422a5b;};}function handleError(_0x58a110,_0x5d3fe6){_0x5d3fe6=_0x5d3fe6||0x1f4;return function(_0x322940){logger[_0x590b('0x25')](_0x322940[_0x590b('0x36')]);if(_0x322940[_0x590b('0x37')]){delete _0x322940[_0x590b('0x37')];}_0x58a110['status'](_0x5d3fe6)[_0x590b('0x38')](_0x322940);};}exports[_0x590b('0x39')]=function(_0x3e5ca5,_0x1d1fe7){var _0x1e2b8d={},_0x4b7604={},_0x433922={'count':0x0,'rows':[]};var _0x2fd86b=_['map'](db['OpenchannelMessage'][_0x590b('0x3a')],function(_0x4be52e){return{'name':_0x4be52e[_0x590b('0x3b')],'type':_0x4be52e[_0x590b('0x3c')][_0x590b('0x3d')]};});_0x4b7604[_0x590b('0x3e')]=_[_0x590b('0x3f')](_0x2fd86b,_0x590b('0x37'));_0x4b7604[_0x590b('0x40')]=_[_0x590b('0x41')](_0x3e5ca5[_0x590b('0x40')]);_0x4b7604[_0x590b('0x42')]=_['intersection'](_0x4b7604[_0x590b('0x3e')],_0x4b7604[_0x590b('0x40')]);_0x1e2b8d[_0x590b('0x43')]=_['intersection'](_0x4b7604[_0x590b('0x3e')],qs[_0x590b('0x44')](_0x3e5ca5[_0x590b('0x40')][_0x590b('0x44')]));_0x1e2b8d[_0x590b('0x43')]=_0x1e2b8d[_0x590b('0x43')][_0x590b('0x45')]?_0x1e2b8d[_0x590b('0x43')]:_0x4b7604['model'];if(!_0x3e5ca5[_0x590b('0x40')]['hasOwnProperty'](_0x590b('0x46'))){_0x1e2b8d[_0x590b('0x31')]=qs[_0x590b('0x31')](_0x3e5ca5['query'][_0x590b('0x31')]);_0x1e2b8d[_0x590b('0x30')]=qs[_0x590b('0x30')](_0x3e5ca5[_0x590b('0x40')]['offset']);}_0x1e2b8d[_0x590b('0x47')]=qs[_0x590b('0x48')](_0x3e5ca5['query']['sort']);_0x1e2b8d['where']=qs[_0x590b('0x42')](_[_0x590b('0x49')](_0x3e5ca5[_0x590b('0x40')],_0x4b7604['filters']),_0x2fd86b);if(_0x3e5ca5['query'][_0x590b('0x4a')]){_0x1e2b8d[_0x590b('0x4b')]=_['merge'](_0x1e2b8d[_0x590b('0x4b')],{'$or':_[_0x590b('0x3f')](_0x2fd86b,function(_0x44d1d8){if(_0x44d1d8[_0x590b('0x3c')]!==_0x590b('0x4c')){var _0x25ae14={};_0x25ae14[_0x44d1d8[_0x590b('0x37')]]={'$like':'%'+_0x3e5ca5[_0x590b('0x40')][_0x590b('0x4a')]+'%'};return _0x25ae14;}})});}_0x1e2b8d=_[_0x590b('0x4d')]({},_0x1e2b8d,_0x3e5ca5[_0x590b('0x4e')]);var _0x146961={'where':_0x1e2b8d[_0x590b('0x4b')]};return db['OpenchannelMessage']['count'](_0x146961)[_0x590b('0x21')](function(_0x1c1e35){_0x433922[_0x590b('0x2f')]=_0x1c1e35;if(_0x3e5ca5[_0x590b('0x40')]['includeAll']){_0x1e2b8d[_0x590b('0x4f')]=[{'all':!![]}];}return db[_0x590b('0x50')][_0x590b('0x51')](_0x1e2b8d);})['then'](function(_0x1964c5){_0x433922[_0x590b('0x52')]=_0x1964c5;return _0x433922;})['then'](respondWithFilteredResult(_0x1d1fe7,_0x1e2b8d))['catch'](handleError(_0x1d1fe7,null));};exports[_0x590b('0x53')]=function(_0x224a9b,_0x4ff15f){var _0x218c86={'raw':!![],'where':{'id':_0x224a9b['params']['id']}},_0x466f2c={};_0x466f2c[_0x590b('0x3e')]=_[_0x590b('0x41')](db[_0x590b('0x50')]['rawAttributes']);_0x466f2c['query']=_[_0x590b('0x41')](_0x224a9b[_0x590b('0x40')]);_0x466f2c['filters']=_[_0x590b('0x54')](_0x466f2c[_0x590b('0x3e')],_0x466f2c[_0x590b('0x40')]);_0x218c86[_0x590b('0x43')]=_[_0x590b('0x54')](_0x466f2c[_0x590b('0x3e')],qs[_0x590b('0x44')](_0x224a9b['query'][_0x590b('0x44')]));_0x218c86['attributes']=_0x218c86[_0x590b('0x43')][_0x590b('0x45')]?_0x218c86[_0x590b('0x43')]:_0x466f2c['model'];if(_0x224a9b['query'][_0x590b('0x55')]){_0x218c86[_0x590b('0x4f')]=[{'all':!![]}];}_0x218c86=_[_0x590b('0x4d')]({},_0x218c86,_0x224a9b[_0x590b('0x4e')]);return db['OpenchannelMessage'][_0x590b('0x56')](_0x218c86)['then'](handleEntityNotFound(_0x4ff15f,null))['then'](respondWithResult(_0x4ff15f,null))[_0x590b('0x57')](handleError(_0x4ff15f,null));};exports['create']=function(_0x10d9a3,_0x5663ef){return db[_0x590b('0x50')]['create'](_0x10d9a3[_0x590b('0x58')],{})[_0x590b('0x21')](respondWithResult(_0x5663ef,0xc9))[_0x590b('0x57')](handleError(_0x5663ef,null));};exports[_0x590b('0x59')]=function(_0xf1addd,_0x1537e9){if(_0xf1addd[_0x590b('0x58')]['id']){delete _0xf1addd[_0x590b('0x58')]['id'];}return db[_0x590b('0x50')]['find']({'where':{'id':_0xf1addd[_0x590b('0x5a')]['id']}})[_0x590b('0x21')](handleEntityNotFound(_0x1537e9,null))['then'](saveUpdates(_0xf1addd[_0x590b('0x58')],null))[_0x590b('0x21')](respondWithResult(_0x1537e9,null))[_0x590b('0x57')](handleError(_0x1537e9,null));};exports[_0x590b('0x35')]=function(_0x57e442,_0x1c2e0d){return db[_0x590b('0x50')][_0x590b('0x56')]({'where':{'id':_0x57e442[_0x590b('0x5a')]['id']}})['then'](handleEntityNotFound(_0x1c2e0d,null))[_0x590b('0x21')](removeEntity(_0x1c2e0d,null))['catch'](handleError(_0x1c2e0d,null));};exports[_0x590b('0x5b')]=function(_0x26e488,_0x3d4151){return db[_0x590b('0x50')]['describe']()[_0x590b('0x21')](respondWithResult(_0x3d4151,null))['catch'](handleError(_0x3d4151,null));};var interaction_log=require(_0x590b('0x5c'))(_0x590b('0x5d'));exports[_0x590b('0x5e')]=function(_0x556276,_0x2dff4f,_0x48f49a){var _0x1b0cbb={'agent':{},'channel':'openchannel'};if(_0x556276[_0x590b('0x58')]['id']){delete _0x556276[_0x590b('0x58')]['id'];}_0x556276[_0x590b('0x58')]['read']=!![];_0x556276['body'][_0x590b('0x5f')]=moment()[_0x590b('0x60')](_0x590b('0x61'));_0x556276[_0x590b('0x58')]['UserId']=_0x556276[_0x590b('0x58')]['UserId']||_0x556276[_0x590b('0x62')]['id'];_0x1b0cbb[_0x590b('0x63')]['id']=_0x556276[_0x590b('0x58')][_0x590b('0x64')];return db[_0x590b('0x50')]['find']({'where':{'id':_0x556276['params']['id'],'UserId':null}})[_0x590b('0x21')](handleEntityNotFound(_0x2dff4f,null))['then'](saveUpdates(_0x556276['body'],null))[_0x590b('0x21')](function(_0x1c14bf){if(_0x1c14bf){_0x1b0cbb['message']=_0x1c14bf[_0x590b('0x65')]({'plain':!![]});return db[_0x590b('0x66')]['find']({'where':{'id':_0x1c14bf[_0x590b('0x67')]}});}return null;})[_0x590b('0x21')](handleEntityNotFound(_0x2dff4f,null))['then'](function(_0xdbd073){if(_0xdbd073){return _0xdbd073['update']({'UserId':_0x556276[_0x590b('0x58')][_0x590b('0x64')],'read1stAt':_[_0x590b('0x68')](_0xdbd073['read1stAt'])?moment()[_0x590b('0x60')](_0x590b('0x61')):undefined});}return null;})[_0x590b('0x21')](function(_0x35bc9c){if(_0x35bc9c){_0x1b0cbb['interaction']=_0x35bc9c[_0x590b('0x65')]({'plain':!![]});interaction_log[_0x590b('0x29')]('[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x556276[_0x590b('0x62')]['id'],_0x556276['user'][_0x590b('0x37')],_0x556276[_0x590b('0x62')][_0x590b('0x69')],_0x1b0cbb[_0x590b('0x6a')]['id'],_0x556276[_0x590b('0x58')]?JSON[_0x590b('0x24')](_0x556276[_0x590b('0x58')]):_0x590b('0x6b'));return respondWithRpcPromise('AcceptMessage',_0x590b('0x6c'),_0x1b0cbb);}return null;})[_0x590b('0x21')](function(_0x474e26){var _0x329139='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x474e26['message'][_0x590b('0x6d')];return db[_0x590b('0x6e')]['query'](_0x329139,{'type':db[_0x590b('0x6f')][_0x590b('0x70')][_0x590b('0x71')],'raw':!![]})['then'](function(_0x23ee83){return _0x23ee83;});})['then'](function(_0x43dedf){if(_0x43dedf){_0x1b0cbb['message']['contact']=_0x43dedf[0x0];if(!_0x556276[_0x590b('0x58')][_0x590b('0x64')])return;return db['User'][_0x590b('0x56')]({'where':{'id':_0x556276[_0x590b('0x58')][_0x590b('0x64')],'role':_0x590b('0x63')},'attributes':['id','name',_0x590b('0x72'),_0x590b('0x73'),_0x590b('0x74')],'raw':!![]});}return null;})[_0x590b('0x21')](function(_0x1be3fc){if(!_0x1be3fc)return null;_0x1b0cbb[_0x590b('0x28')][_0x590b('0x63')]=_0x1be3fc;return _0x1b0cbb;})[_0x590b('0x21')](function(_0x421547){if(_0x421547){if(_0x556276['body'][_0x590b('0x75')]){_0x1b0cbb['message'][_0x590b('0x76')]=util[_0x590b('0x60')](_0x590b('0x77'),_0x556276[_0x590b('0x62')]['name']);_0x1b0cbb[_0x590b('0x28')][_0x590b('0x78')]=_0x1b0cbb[_0x590b('0x78')];_0x1b0cbb['message'][_0x590b('0x79')]=_0x1b0cbb[_0x590b('0x78')];_0x1b0cbb[_0x590b('0x28')][_0x590b('0x7a')]=_0x590b('0x5e');return respondWithRpcPromise('EventManager',_0x590b('0x7b'),{'event':_0x590b('0x7c'),'message':_0x1b0cbb['message']},client9002)['then'](function(){return _0x1b0cbb;});}return _0x1b0cbb;}return null;})['then'](respondWithResult(_0x2dff4f,null))[_0x590b('0x57')](handleError(_0x2dff4f,null));};var interaction_log=require(_0x590b('0x5c'))('openchannel-interactions');exports['reject']=function(_0xa529a8,_0x53c729,_0x440929){var _0x2acd6f={'agent':{},'channel':_0x590b('0x7d')};if(_0xa529a8['body']['id']){delete _0xa529a8[_0x590b('0x58')]['id'];}_0xa529a8[_0x590b('0x58')][_0x590b('0x64')]=_0xa529a8['body'][_0x590b('0x64')]||_0xa529a8[_0x590b('0x62')]['id'];_0x2acd6f[_0x590b('0x63')]['id']=_0xa529a8['body'][_0x590b('0x64')];return db[_0x590b('0x50')][_0x590b('0x56')]({'where':{'id':_0xa529a8[_0x590b('0x5a')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x53c729,null))[_0x590b('0x21')](function(_0x1df0a7){if(_0x1df0a7){_0x2acd6f[_0x590b('0x28')]=_0x1df0a7[_0x590b('0x65')]({'plain':!![]});return db[_0x590b('0x66')][_0x590b('0x56')]({'where':{'id':_0x1df0a7['OpenchannelInteractionId']}});}return null;})[_0x590b('0x21')](handleEntityNotFound(_0x53c729,null))[_0x590b('0x21')](function(_0xaf4bff){if(_0xaf4bff){_0x2acd6f[_0x590b('0x6a')]=_0xaf4bff[_0x590b('0x65')]({'plain':!![]});interaction_log['info'](_0x590b('0x7e'),_0xa529a8[_0x590b('0x62')]['id'],_0xa529a8[_0x590b('0x62')]['name'],_0xa529a8['user'][_0x590b('0x69')],_0x2acd6f[_0x590b('0x6a')]['id'],_0xa529a8[_0x590b('0x58')]?JSON[_0x590b('0x24')](_0xa529a8[_0x590b('0x58')]):'null');return respondWithRpcPromise(_0x590b('0x7f'),_0x590b('0x80'),_0x2acd6f);}return null;})['then'](function(_0xa3f06f){var _0xd24046='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0xa3f06f[_0x590b('0x28')][_0x590b('0x6d')];return db[_0x590b('0x6e')][_0x590b('0x40')](_0xd24046,{'type':db[_0x590b('0x6f')][_0x590b('0x70')]['SELECT'],'raw':!![]})[_0x590b('0x21')](function(_0x44c344){return _0x44c344;});})['then'](function(_0x17291b){if(_0x17291b){_0x2acd6f[_0x590b('0x28')][_0x590b('0x81')]=_0x17291b[0x0];if(!_0xa529a8['body'][_0x590b('0x64')])return;return db[_0x590b('0x82')][_0x590b('0x56')]({'where':{'id':_0xa529a8['body']['UserId'],'role':_0x590b('0x63')},'attributes':['id',_0x590b('0x37'),'fullname',_0x590b('0x73'),_0x590b('0x74')],'raw':!![]});}return null;})[_0x590b('0x21')](function(_0x1ef93c){if(!_0x1ef93c)return null;_0x2acd6f[_0x590b('0x28')][_0x590b('0x63')]=_0x1ef93c;return _0x2acd6f;})[_0x590b('0x21')](function(_0x32e2de){if(_0x32e2de){_0x32e2de[_0x590b('0x28')][_0x590b('0x76')]=util['format'](_0x590b('0x77'),_0xa529a8[_0x590b('0x62')][_0x590b('0x37')]);_0x32e2de[_0x590b('0x28')][_0x590b('0x78')]=_0x2acd6f[_0x590b('0x78')];_0x32e2de[_0x590b('0x28')][_0x590b('0x79')]=_0x2acd6f[_0x590b('0x78')];_0x32e2de[_0x590b('0x28')][_0x590b('0x7a')]='reject';respondWithRpcPromise(_0x590b('0x7b'),_0x590b('0x7b'),{'event':_0x590b('0x83'),'message':_0x32e2de[_0x590b('0x28')]},client9002);return _0x2acd6f;}return null;})[_0x590b('0x21')](respondWithResult(_0x53c729,null))[_0x590b('0x57')](handleError(_0x53c729,null));}; \ No newline at end of file +var _0xfcfa=['key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','filter','includeAll','include','rows','show','rawAttributes','options','create','body','find','params','describe','openchannel','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','get','OpenchannelInteraction','OpenchannelInteractionId','isNil','read1stAt','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','stringify','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','Sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','interface','SIP/%s','channel','motionChannel','event','accept','EventManager','acceptmessage','agent','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','RejectMessage','rejectMessage','ContactId','sequelize','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','to-csv','fs-extra','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','jayson/promise','client','http','then','info','request\x20sent','debug','error','message','OpenchannelMessage,\x20%s,\x20%s','catch','status','json','offset','count','limit','apply','reject','save','update','destroy','end','sendStatus','stack','name','send','index','map','OpenchannelMessage','fieldName','type'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xfcfa,0x14b));var _0xafcf=function(_0x2957f9,_0x2d44b7){_0x2957f9=_0x2957f9-0x0;var _0x5b4586=_0xfcfa[_0x2957f9];return _0x5b4586;};'use strict';var emlformat=require(_0xafcf('0x0'));var rimraf=require(_0xafcf('0x1'));var zipdir=require(_0xafcf('0x2'));var jsonpatch=require(_0xafcf('0x3'));var rp=require(_0xafcf('0x4'));var moment=require('moment');var BPromise=require(_0xafcf('0x5'));var Mustache=require('mustache');var util=require(_0xafcf('0x6'));var path=require('path');var sox=require(_0xafcf('0x7'));var csv=require(_0xafcf('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xafcf('0x9'));var _=require('lodash');var squel=require(_0xafcf('0xa'));var crypto=require('crypto');var jsforce=require(_0xafcf('0xb'));var deskjs=require(_0xafcf('0xc'));var toCsv=require(_0xafcf('0x8'));var querystring=require(_0xafcf('0xd'));var Papa=require(_0xafcf('0xe'));var Redis=require('ioredis');var authService=require(_0xafcf('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xafcf('0x10'));var logger=require(_0xafcf('0x11'))(_0xafcf('0x12'));var utils=require(_0xafcf('0x13'));var config=require(_0xafcf('0x14'));var licenseUtil=require(_0xafcf('0x15'));var db=require(_0xafcf('0x16'))['db'];config[_0xafcf('0x17')]=_[_0xafcf('0x18')](config[_0xafcf('0x17')],{'host':_0xafcf('0x19'),'port':0x18eb});var socket=require(_0xafcf('0x1a'))(new Redis(config[_0xafcf('0x17')]));require(_0xafcf('0x1b'))['register'](socket);var jayson=require(_0xafcf('0x1c'));var client=jayson[_0xafcf('0x1d')][_0xafcf('0x1e')]({'port':0x232c});var client9002=jayson[_0xafcf('0x1d')][_0xafcf('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x472ca4,_0x40b397,_0x390e68,_0x4896f2){return new BPromise(function(_0x24c353,_0x5402a0){var _0x1088b4=_0x4896f2||client;return _0x1088b4['request'](_0x472ca4,_0x390e68)[_0xafcf('0x1f')](function(_0x614462){logger[_0xafcf('0x20')]('OpenchannelMessage,\x20%s,\x20%s',_0x40b397,_0xafcf('0x21'));logger[_0xafcf('0x22')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x40b397,'request\x20sent',JSON['stringify'](_0x614462));if(_0x614462[_0xafcf('0x23')]){if(_0x614462[_0xafcf('0x23')]['code']===0x1f4){logger['error']('OpenchannelMessage,\x20%s,\x20%s',_0x40b397,_0x614462[_0xafcf('0x23')]['message']);return _0x5402a0(_0x614462['error'][_0xafcf('0x24')]);}logger[_0xafcf('0x23')](_0xafcf('0x25'),_0x40b397,_0x614462['error'][_0xafcf('0x24')]);return _0x24c353(_0x614462['error']['message']);}else{logger[_0xafcf('0x20')](_0xafcf('0x25'),_0x40b397,'request\x20sent');_0x24c353(_0x614462['result'][_0xafcf('0x24')]);}})[_0xafcf('0x26')](function(_0x3faa1e){logger[_0xafcf('0x23')](_0xafcf('0x25'),_0x40b397,_0x3faa1e);_0x5402a0(_0x3faa1e);});});}function respondWithStatusCode(_0x49d307,_0x137ae1){_0x137ae1=_0x137ae1||0xcc;return function(_0xa521ab){if(_0xa521ab){return _0x49d307['sendStatus'](_0x137ae1);}return _0x49d307[_0xafcf('0x27')](_0x137ae1)['end']();};}function respondWithResult(_0x25482b,_0xeb41e5){_0xeb41e5=_0xeb41e5||0xc8;return function(_0x331d5b){if(_0x331d5b){return _0x25482b[_0xafcf('0x27')](_0xeb41e5)[_0xafcf('0x28')](_0x331d5b);}};}function respondWithFilteredResult(_0x43b13f,_0x41e85c){return function(_0x13f483){if(_0x13f483){var _0x2edd09=typeof _0x41e85c[_0xafcf('0x29')]==='undefined'&&typeof _0x41e85c['limit']==='undefined';var _0x58ebd5=_0x13f483[_0xafcf('0x2a')];var _0x4f41f6=_0x2edd09?0x0:_0x41e85c[_0xafcf('0x29')];var _0x3dd20f=_0x2edd09?_0x13f483[_0xafcf('0x2a')]:_0x41e85c[_0xafcf('0x29')]+_0x41e85c[_0xafcf('0x2b')];var _0x31135d;if(_0x3dd20f>=_0x58ebd5){_0x3dd20f=_0x58ebd5;_0x31135d=0xc8;}else{_0x31135d=0xce;}_0x43b13f[_0xafcf('0x27')](_0x31135d);return _0x43b13f['set']('Content-Range',_0x4f41f6+'-'+_0x3dd20f+'/'+_0x58ebd5)[_0xafcf('0x28')](_0x13f483);}return null;};}function patchUpdates(_0x66dc6b){return function(_0x250da9){try{jsonpatch[_0xafcf('0x2c')](_0x250da9,_0x66dc6b,!![]);}catch(_0xf81e5b){return BPromise[_0xafcf('0x2d')](_0xf81e5b);}return _0x250da9[_0xafcf('0x2e')]();};}function saveUpdates(_0x8ee3de,_0x12fe44){return function(_0x39f184){if(_0x39f184){return _0x39f184[_0xafcf('0x2f')](_0x8ee3de)[_0xafcf('0x1f')](function(_0x212d47){return _0x212d47;});}return null;};}function removeEntity(_0x30efe4,_0x3021e4){return function(_0x4a68c7){if(_0x4a68c7){return _0x4a68c7[_0xafcf('0x30')]()[_0xafcf('0x1f')](function(){_0x30efe4[_0xafcf('0x27')](0xcc)[_0xafcf('0x31')]();});}};}function handleEntityNotFound(_0x137fb4,_0x552560){return function(_0x435d5b){if(!_0x435d5b){_0x137fb4[_0xafcf('0x32')](0x194);}return _0x435d5b;};}function handleError(_0x42d484,_0x18e751){_0x18e751=_0x18e751||0x1f4;return function(_0x1abf4f){logger[_0xafcf('0x23')](_0x1abf4f[_0xafcf('0x33')]);if(_0x1abf4f[_0xafcf('0x34')]){delete _0x1abf4f[_0xafcf('0x34')];}_0x42d484[_0xafcf('0x27')](_0x18e751)[_0xafcf('0x35')](_0x1abf4f);};}exports[_0xafcf('0x36')]=function(_0x384d94,_0xfc71ca){var _0x42db1d={},_0x43d26a={},_0x1f5e5e={'count':0x0,'rows':[]};var _0x22d16e=_[_0xafcf('0x37')](db[_0xafcf('0x38')]['rawAttributes'],function(_0x3bafe7){return{'name':_0x3bafe7[_0xafcf('0x39')],'type':_0x3bafe7[_0xafcf('0x3a')][_0xafcf('0x3b')]};});_0x43d26a[_0xafcf('0x3c')]=_[_0xafcf('0x37')](_0x22d16e,_0xafcf('0x34'));_0x43d26a['query']=_[_0xafcf('0x3d')](_0x384d94[_0xafcf('0x3e')]);_0x43d26a[_0xafcf('0x3f')]=_[_0xafcf('0x40')](_0x43d26a[_0xafcf('0x3c')],_0x43d26a[_0xafcf('0x3e')]);_0x42db1d[_0xafcf('0x41')]=_[_0xafcf('0x40')](_0x43d26a[_0xafcf('0x3c')],qs['fields'](_0x384d94[_0xafcf('0x3e')][_0xafcf('0x42')]));_0x42db1d['attributes']=_0x42db1d['attributes'][_0xafcf('0x43')]?_0x42db1d[_0xafcf('0x41')]:_0x43d26a[_0xafcf('0x3c')];if(!_0x384d94[_0xafcf('0x3e')][_0xafcf('0x44')](_0xafcf('0x45'))){_0x42db1d[_0xafcf('0x2b')]=qs['limit'](_0x384d94[_0xafcf('0x3e')][_0xafcf('0x2b')]);_0x42db1d[_0xafcf('0x29')]=qs[_0xafcf('0x29')](_0x384d94['query'][_0xafcf('0x29')]);}_0x42db1d[_0xafcf('0x46')]=qs[_0xafcf('0x47')](_0x384d94[_0xafcf('0x3e')][_0xafcf('0x47')]);_0x42db1d['where']=qs[_0xafcf('0x3f')](_['pick'](_0x384d94[_0xafcf('0x3e')],_0x43d26a[_0xafcf('0x3f')]),_0x22d16e);if(_0x384d94[_0xafcf('0x3e')]['filter']){_0x42db1d[_0xafcf('0x48')]=_[_0xafcf('0x49')](_0x42db1d[_0xafcf('0x48')],{'$or':_['map'](_0x22d16e,function(_0xf0ee5b){if(_0xf0ee5b['type']!==_0xafcf('0x4a')){var _0x119817={};_0x119817[_0xf0ee5b['name']]={'$like':'%'+_0x384d94[_0xafcf('0x3e')][_0xafcf('0x4b')]+'%'};return _0x119817;}})});}_0x42db1d=_[_0xafcf('0x49')]({},_0x42db1d,_0x384d94['options']);var _0xced3f2={'where':_0x42db1d[_0xafcf('0x48')]};return db[_0xafcf('0x38')]['count'](_0xced3f2)[_0xafcf('0x1f')](function(_0x5efd7f){_0x1f5e5e[_0xafcf('0x2a')]=_0x5efd7f;if(_0x384d94[_0xafcf('0x3e')][_0xafcf('0x4c')]){_0x42db1d[_0xafcf('0x4d')]=[{'all':!![]}];}return db[_0xafcf('0x38')]['findAll'](_0x42db1d);})['then'](function(_0x5d9ad7){_0x1f5e5e[_0xafcf('0x4e')]=_0x5d9ad7;return _0x1f5e5e;})['then'](respondWithFilteredResult(_0xfc71ca,_0x42db1d))[_0xafcf('0x26')](handleError(_0xfc71ca,null));};exports[_0xafcf('0x4f')]=function(_0x343d06,_0x59fcc9){var _0x23c008={'raw':!![],'where':{'id':_0x343d06['params']['id']}},_0x38b46d={};_0x38b46d[_0xafcf('0x3c')]=_[_0xafcf('0x3d')](db['OpenchannelMessage'][_0xafcf('0x50')]);_0x38b46d['query']=_[_0xafcf('0x3d')](_0x343d06[_0xafcf('0x3e')]);_0x38b46d[_0xafcf('0x3f')]=_[_0xafcf('0x40')](_0x38b46d[_0xafcf('0x3c')],_0x38b46d['query']);_0x23c008[_0xafcf('0x41')]=_[_0xafcf('0x40')](_0x38b46d[_0xafcf('0x3c')],qs[_0xafcf('0x42')](_0x343d06[_0xafcf('0x3e')][_0xafcf('0x42')]));_0x23c008[_0xafcf('0x41')]=_0x23c008[_0xafcf('0x41')][_0xafcf('0x43')]?_0x23c008[_0xafcf('0x41')]:_0x38b46d[_0xafcf('0x3c')];if(_0x343d06[_0xafcf('0x3e')][_0xafcf('0x4c')]){_0x23c008[_0xafcf('0x4d')]=[{'all':!![]}];}_0x23c008=_['merge']({},_0x23c008,_0x343d06[_0xafcf('0x51')]);return db[_0xafcf('0x38')]['find'](_0x23c008)[_0xafcf('0x1f')](handleEntityNotFound(_0x59fcc9,null))['then'](respondWithResult(_0x59fcc9,null))[_0xafcf('0x26')](handleError(_0x59fcc9,null));};exports[_0xafcf('0x52')]=function(_0xd1aeb5,_0x4c97e5){return db['OpenchannelMessage'][_0xafcf('0x52')](_0xd1aeb5['body'],{})[_0xafcf('0x1f')](respondWithResult(_0x4c97e5,0xc9))[_0xafcf('0x26')](handleError(_0x4c97e5,null));};exports[_0xafcf('0x2f')]=function(_0x20e0b1,_0x371098){if(_0x20e0b1[_0xafcf('0x53')]['id']){delete _0x20e0b1[_0xafcf('0x53')]['id'];}return db[_0xafcf('0x38')][_0xafcf('0x54')]({'where':{'id':_0x20e0b1[_0xafcf('0x55')]['id']}})[_0xafcf('0x1f')](handleEntityNotFound(_0x371098,null))[_0xafcf('0x1f')](saveUpdates(_0x20e0b1['body'],null))[_0xafcf('0x1f')](respondWithResult(_0x371098,null))[_0xafcf('0x26')](handleError(_0x371098,null));};exports[_0xafcf('0x30')]=function(_0x48c1f7,_0x7bf420){return db[_0xafcf('0x38')][_0xafcf('0x54')]({'where':{'id':_0x48c1f7[_0xafcf('0x55')]['id']}})[_0xafcf('0x1f')](handleEntityNotFound(_0x7bf420,null))[_0xafcf('0x1f')](removeEntity(_0x7bf420,null))[_0xafcf('0x26')](handleError(_0x7bf420,null));};exports[_0xafcf('0x56')]=function(_0x237d07,_0x3540cc){return db[_0xafcf('0x38')][_0xafcf('0x56')]()[_0xafcf('0x1f')](respondWithResult(_0x3540cc,null))['catch'](handleError(_0x3540cc,null));};var interaction_log=require(_0xafcf('0x11'))('openchannel-interactions');exports['accept']=function(_0x53a6a6,_0x321705,_0x218014){var _0x1f712b={'agent':{},'channel':_0xafcf('0x57')};if(_0x53a6a6['body']['id']){delete _0x53a6a6['body']['id'];}_0x53a6a6[_0xafcf('0x53')][_0xafcf('0x58')]=!![];_0x53a6a6[_0xafcf('0x53')][_0xafcf('0x59')]=moment()[_0xafcf('0x5a')](_0xafcf('0x5b'));_0x53a6a6['body'][_0xafcf('0x5c')]=_0x53a6a6[_0xafcf('0x53')][_0xafcf('0x5c')]||_0x53a6a6['user']['id'];_0x1f712b['agent']['id']=_0x53a6a6[_0xafcf('0x53')][_0xafcf('0x5c')];return db[_0xafcf('0x38')][_0xafcf('0x54')]({'where':{'id':_0x53a6a6[_0xafcf('0x55')]['id'],'UserId':null}})[_0xafcf('0x1f')](handleEntityNotFound(_0x321705,null))[_0xafcf('0x1f')](saveUpdates(_0x53a6a6['body'],null))[_0xafcf('0x1f')](function(_0x46ea9d){if(_0x46ea9d){_0x1f712b[_0xafcf('0x24')]=_0x46ea9d[_0xafcf('0x5d')]({'plain':!![]});return db[_0xafcf('0x5e')]['find']({'where':{'id':_0x46ea9d[_0xafcf('0x5f')]}});}return null;})[_0xafcf('0x1f')](handleEntityNotFound(_0x321705,null))[_0xafcf('0x1f')](function(_0x2e20e3){if(_0x2e20e3){return _0x2e20e3[_0xafcf('0x2f')]({'UserId':_0x53a6a6[_0xafcf('0x53')]['UserId'],'read1stAt':_[_0xafcf('0x60')](_0x2e20e3[_0xafcf('0x61')])?moment()['format'](_0xafcf('0x5b')):undefined});}return null;})['then'](function(_0x2afda4){if(_0x2afda4){_0x1f712b[_0xafcf('0x62')]=_0x2afda4[_0xafcf('0x5d')]({'plain':!![]});interaction_log[_0xafcf('0x20')](_0xafcf('0x63'),_0x53a6a6[_0xafcf('0x64')]['id'],_0x53a6a6[_0xafcf('0x64')][_0xafcf('0x34')],_0x53a6a6[_0xafcf('0x64')]['role'],_0x1f712b[_0xafcf('0x62')]['id'],_0x53a6a6['body']?JSON[_0xafcf('0x65')](_0x53a6a6[_0xafcf('0x53')]):'null');return respondWithRpcPromise(_0xafcf('0x66'),_0xafcf('0x67'),_0x1f712b);}return null;})[_0xafcf('0x1f')](function(_0x545bd2){var _0x3f8d78=_0xafcf('0x68')+_0x545bd2[_0xafcf('0x24')]['ContactId'];return db['sequelize'][_0xafcf('0x3e')](_0x3f8d78,{'type':db[_0xafcf('0x69')][_0xafcf('0x6a')][_0xafcf('0x6b')],'raw':!![]})[_0xafcf('0x1f')](function(_0xe9daa3){return _0xe9daa3;});})[_0xafcf('0x1f')](function(_0x5cfbe8){if(_0x5cfbe8){_0x1f712b['message'][_0xafcf('0x6c')]=_0x5cfbe8[0x0];if(!_0x53a6a6[_0xafcf('0x53')][_0xafcf('0x5c')])return;return db[_0xafcf('0x6d')][_0xafcf('0x54')]({'where':{'id':_0x53a6a6['body'][_0xafcf('0x5c')],'role':'agent'},'attributes':['id','name',_0xafcf('0x6e'),_0xafcf('0x6f'),_0xafcf('0x70')],'raw':!![]});}return null;})[_0xafcf('0x1f')](function(_0x2196be){if(!_0x2196be)return null;_0x1f712b[_0xafcf('0x24')]['agent']=_0x2196be;return _0x1f712b;})['then'](function(_0x527f88){if(_0x527f88){if(_0x53a6a6[_0xafcf('0x53')]['manual']){_0x1f712b['message'][_0xafcf('0x71')]=util['format'](_0xafcf('0x72'),_0x53a6a6[_0xafcf('0x64')]['name']);_0x1f712b[_0xafcf('0x24')][_0xafcf('0x73')]=_0x1f712b[_0xafcf('0x73')];_0x1f712b['message'][_0xafcf('0x74')]=_0x1f712b['channel'];_0x1f712b[_0xafcf('0x24')][_0xafcf('0x75')]=_0xafcf('0x76');return respondWithRpcPromise(_0xafcf('0x77'),'EventManager',{'event':_0xafcf('0x78'),'message':_0x1f712b[_0xafcf('0x24')]},client9002)[_0xafcf('0x1f')](function(){return _0x1f712b;});}return _0x1f712b;}return null;})[_0xafcf('0x1f')](respondWithResult(_0x321705,null))[_0xafcf('0x26')](handleError(_0x321705,null));};var interaction_log=require('../../config/logger')('openchannel-interactions');exports[_0xafcf('0x2d')]=function(_0x5efd42,_0x2fb506,_0x2ea885){var _0x25d788={'agent':{},'channel':_0xafcf('0x57')};if(_0x5efd42[_0xafcf('0x53')]['id']){delete _0x5efd42[_0xafcf('0x53')]['id'];}_0x5efd42[_0xafcf('0x53')][_0xafcf('0x5c')]=_0x5efd42[_0xafcf('0x53')]['UserId']||_0x5efd42[_0xafcf('0x64')]['id'];_0x25d788[_0xafcf('0x79')]['id']=_0x5efd42[_0xafcf('0x53')]['UserId'];return db[_0xafcf('0x38')]['find']({'where':{'id':_0x5efd42[_0xafcf('0x55')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x2fb506,null))[_0xafcf('0x1f')](function(_0x4c06ff){if(_0x4c06ff){_0x25d788[_0xafcf('0x24')]=_0x4c06ff['get']({'plain':!![]});return db['OpenchannelInteraction']['find']({'where':{'id':_0x4c06ff[_0xafcf('0x5f')]}});}return null;})['then'](handleEntityNotFound(_0x2fb506,null))['then'](function(_0x306f0f){if(_0x306f0f){_0x25d788[_0xafcf('0x62')]=_0x306f0f['get']({'plain':!![]});interaction_log[_0xafcf('0x20')](_0xafcf('0x7a'),_0x5efd42[_0xafcf('0x64')]['id'],_0x5efd42[_0xafcf('0x64')][_0xafcf('0x34')],_0x5efd42[_0xafcf('0x64')][_0xafcf('0x7b')],_0x25d788[_0xafcf('0x62')]['id'],_0x5efd42['body']?JSON['stringify'](_0x5efd42[_0xafcf('0x53')]):_0xafcf('0x7c'));return respondWithRpcPromise(_0xafcf('0x7d'),_0xafcf('0x7e'),_0x25d788);}return null;})[_0xafcf('0x1f')](function(_0x3e1bdb){var _0x58534c=_0xafcf('0x68')+_0x3e1bdb[_0xafcf('0x24')][_0xafcf('0x7f')];return db[_0xafcf('0x80')]['query'](_0x58534c,{'type':db['Sequelize']['QueryTypes'][_0xafcf('0x6b')],'raw':!![]})[_0xafcf('0x1f')](function(_0x518aef){return _0x518aef;});})[_0xafcf('0x1f')](function(_0x5b4656){if(_0x5b4656){_0x25d788[_0xafcf('0x24')][_0xafcf('0x6c')]=_0x5b4656[0x0];if(!_0x5efd42[_0xafcf('0x53')][_0xafcf('0x5c')])return;return db['User'][_0xafcf('0x54')]({'where':{'id':_0x5efd42[_0xafcf('0x53')][_0xafcf('0x5c')],'role':_0xafcf('0x79')},'attributes':['id','name','fullname','email',_0xafcf('0x70')],'raw':!![]});}return null;})[_0xafcf('0x1f')](function(_0x514efa){if(!_0x514efa)return null;_0x25d788['message'][_0xafcf('0x79')]=_0x514efa;return _0x25d788;})['then'](function(_0x142a68){if(_0x142a68){_0x142a68[_0xafcf('0x24')][_0xafcf('0x71')]=util[_0xafcf('0x5a')](_0xafcf('0x72'),_0x5efd42[_0xafcf('0x64')][_0xafcf('0x34')]);_0x142a68['message']['channel']=_0x25d788[_0xafcf('0x73')];_0x142a68[_0xafcf('0x24')][_0xafcf('0x74')]=_0x25d788[_0xafcf('0x73')];_0x142a68[_0xafcf('0x24')][_0xafcf('0x75')]=_0xafcf('0x2d');respondWithRpcPromise(_0xafcf('0x77'),_0xafcf('0x77'),{'event':_0xafcf('0x81'),'message':_0x142a68['message']},client9002);return _0x25d788;}return null;})[_0xafcf('0x1f')](respondWithResult(_0x2fb506,null))['catch'](handleError(_0x2fb506,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index 5046fc3..e1332c5 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 _0x806e=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelMessage','setMaxListeners','save'];(function(_0xe61e71,_0x4ee5b5){var _0x1b2384=function(_0x4b09e2){while(--_0x4b09e2){_0xe61e71['push'](_0xe61e71['shift']());}};_0x1b2384(++_0x4ee5b5);}(_0x806e,0x150));var _0xe806=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x806e[_0x20a584];return _0x4b41a8;};'use strict';var EventEmitter=require(_0xe806('0x0'));var OpenchannelMessage=require(_0xe806('0x1'))['db'][_0xe806('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0xe806('0x3')](0x0);var events={'afterCreate':_0xe806('0x4'),'afterUpdate':_0xe806('0x5'),'afterDestroy':_0xe806('0x6')};function emitEvent(_0x54fb7c){return function(_0x19caf3,_0x5c16eb,_0x18b5ec){OpenchannelMessageEvents[_0xe806('0x7')](_0x54fb7c+':'+_0x19caf3['id'],_0x19caf3);OpenchannelMessageEvents[_0xe806('0x7')](_0x54fb7c,_0x19caf3);_0x18b5ec(null);};}for(var e in events){if(events[_0xe806('0x8')](e)){var event=events[e];OpenchannelMessage[_0xe806('0x9')](e,emitEvent(event));}}module[_0xe806('0xa')]=OpenchannelMessageEvents; \ No newline at end of file +var _0xb0c0=['../../mysqldb','setMaxListeners','update','emit','hasOwnProperty','hook','exports'];(function(_0xe75e71,_0x29b2b5){var _0x3e622c=function(_0x3a0c06){while(--_0x3a0c06){_0xe75e71['push'](_0xe75e71['shift']());}};_0x3e622c(++_0x29b2b5);}(_0xb0c0,0xc4));var _0x0b0c=function(_0x46b0ba,_0x3f9488){_0x46b0ba=_0x46b0ba-0x0;var _0x24070b=_0xb0c0[_0x46b0ba];return _0x24070b;};'use strict';var EventEmitter=require('events');var OpenchannelMessage=require(_0x0b0c('0x0'))['db']['OpenchannelMessage'];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x0b0c('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x0b0c('0x2'),'afterDestroy':'remove'};function emitEvent(_0xb04c24){return function(_0x161a76,_0x5ea3fb,_0x53f348){OpenchannelMessageEvents['emit'](_0xb04c24+':'+_0x161a76['id'],_0x161a76);OpenchannelMessageEvents[_0x0b0c('0x3')](_0xb04c24,_0x161a76);_0x53f348(null);};}for(var e in events){if(events[_0x0b0c('0x4')](e)){var event=events[e];OpenchannelMessage[_0x0b0c('0x5')](e,emitEvent(event));}}module[_0x0b0c('0x6')]=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index 23da170..9ad62c0 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 _0x5c3c=['Forwarding\x20message\x20%d\x20to\x20%s','omit','Contact','method','GET','POST','Message\x20%d\x20forwarded\x20to\x20%s','threadId','inspect','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelMessage.attributes','exports','fti_openchannel_messages','body','models','get','direction','toLowerCase','out','isNil','UserId','OpenchannelInteraction','OpenchannelInteractionId','then','update','createdAt','catch','error','describe','OpenchannelAccount','find','Interactions','CmContact','keys','replyUri','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format'];(function(_0x1034c1,_0x16ccf7){var _0x33adf9=function(_0xd6e1ac){while(--_0xd6e1ac){_0x1034c1['push'](_0x1034c1['shift']());}};_0x33adf9(++_0x16ccf7);}(_0x5c3c,0x132));var _0xc5c3=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0x5c3c[_0x376b45];return _0x2341b3;};'use strict';var _=require(_0xc5c3('0x0'));var util=require(_0xc5c3('0x1'));var logger=require(_0xc5c3('0x2'))(_0xc5c3('0x3'));var moment=require('moment');var BPromise=require(_0xc5c3('0x4'));var rp=require(_0xc5c3('0x5'));var fs=require('fs');var path=require(_0xc5c3('0x6'));var rimraf=require(_0xc5c3('0x7'));var config=require(_0xc5c3('0x8'));var attributes=require(_0xc5c3('0x9'));module[_0xc5c3('0xa')]=function(_0x23a6b5,_0x28bdd9){return _0x23a6b5['define']('OpenchannelMessage',attributes,{'tableName':'openchannel_messages','paranoid':![],'indexes':[{'name':_0xc5c3('0xb'),'fields':[_0xc5c3('0xc')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x110b89,_0x46e2c1,_0x52f3eb){var _0x14140f=_0x23a6b5[_0xc5c3('0xd')];var _0x4e329f=_0x110b89[_0xc5c3('0xe')]({'plain':!![]});if(_0x4e329f[_0xc5c3('0xf')][_0xc5c3('0x10')]()==='in'||_0x4e329f['direction'][_0xc5c3('0x10')]()===_0xc5c3('0x11')&&!_0x4e329f['secret']&&!_[_0xc5c3('0x12')](_0x4e329f[_0xc5c3('0x13')])){_0x14140f[_0xc5c3('0x14')]['findOne']({'where':{'id':_0x4e329f[_0xc5c3('0x15')]}})[_0xc5c3('0x16')](function(_0x1488ab){if(_0x1488ab){_0x1488ab[_0xc5c3('0x17')]({'lastMsgAt':_0x4e329f[_0xc5c3('0x18')],'lastMsgDirection':_0x4e329f['direction']['toLowerCase']()});}})[_0xc5c3('0x19')](function(_0x577e1a){console[_0xc5c3('0x1a')](_0x577e1a);});}if(_0x4e329f[_0xc5c3('0xf')]==='out'&&!_0x4e329f['secret']){var _0x467ba9;_0x14140f['CmContact'][_0xc5c3('0x1b')]()[_0xc5c3('0x16')](function(_0x2ff158){return _0x14140f[_0xc5c3('0x1c')][_0xc5c3('0x1d')]({'where':{'id':_0x4e329f['OpenchannelAccountId']},'include':[{'model':_0x14140f[_0xc5c3('0x14')],'as':_0xc5c3('0x1e'),'where':{'id':_0x4e329f[_0xc5c3('0x15')]},'limit':0x1,'include':[{'model':_0x14140f[_0xc5c3('0x1f')],'as':'Contact','attributes':_[_0xc5c3('0x20')](_0x2ff158)}]}]});})[_0xc5c3('0x16')](function(_0x3cc612){_0x467ba9=_0x3cc612[_0xc5c3('0xe')]({'plain':!![]});if(_0x467ba9&&_0x467ba9[_0xc5c3('0x21')]){logger['info'](_0xc5c3('0x22'),_0xc5c3('0x23'),util[_0xc5c3('0x24')](_0xc5c3('0x25'),_0x4e329f['id'],_0x467ba9[_0xc5c3('0x21')]));if(_0x467ba9[_0xc5c3('0x1e')]&&_0x467ba9[_0xc5c3('0x1e')]['length']){_0x4e329f['Interaction']=_[_0xc5c3('0x26')](_0x467ba9[_0xc5c3('0x1e')][0x0],'Contact');_0x4e329f['Contact']=_0x467ba9[_0xc5c3('0x1e')][0x0][_0xc5c3('0x27')];}var _0x46e2c1={'method':'POST','uri':encodeURI(_0x467ba9['replyUri']),'json':!![],'resolveWithFullResponse':!![]};switch(_0x46e2c1[_0xc5c3('0x28')]){case _0xc5c3('0x29'):_0x46e2c1['qs']=_0x4e329f;break;case _0xc5c3('0x2a'):_0x46e2c1[_0xc5c3('0xc')]=_0x4e329f;break;}return rp(_0x46e2c1)['then'](function(_0x21efd6){logger['info'](_0xc5c3('0x22'),'afterCreate',util[_0xc5c3('0x24')](_0xc5c3('0x2b'),_0x4e329f['id'],_0x467ba9[_0xc5c3('0x21')]));if(_0x21efd6[_0xc5c3('0xc')][_0xc5c3('0x2c')]&&_0x21efd6[_0xc5c3('0xc')][_0xc5c3('0x2c')]!=_0x4e329f['Interaction'][_0xc5c3('0x2c')]){return _0x14140f['OpenchannelInteraction'][_0xc5c3('0x17')]({'threadId':_0x21efd6[_0xc5c3('0xc')]['threadId']},{'logging':!![],'where':{'id':_0x4e329f['Interaction']['id']}});}else{return;}})[_0xc5c3('0x16')](function(){return _0x110b89[_0xc5c3('0x17')]({'read':!![]});})[_0xc5c3('0x19')](function(_0x19e482){logger['error'](_0xc5c3('0x22'),_0xc5c3('0x23'),util[_0xc5c3('0x2d')](_0x19e482,{'showHidden':![],'depth':null}));_0x52f3eb();});}else{_0x52f3eb();}})[_0xc5c3('0x2e')](function(){_0x52f3eb();});}else{_0x52f3eb();}}},'charset':_0xc5c3('0x2f'),'collate':_0xc5c3('0x30')});}; \ No newline at end of file +var _0xef0f=['POST','method','GET','body','format','Message\x20%d\x20forwarded\x20to\x20%s','threadId','inspect','finally','utf8mb4','lodash','../../config/logger','api','moment','request-promise','path','rimraf','./openchannelMessage.attributes','exports','define','OpenchannelMessage','fti_openchannel_messages','FULLTEXT','models','get','direction','toLowerCase','out','secret','UserId','OpenchannelInteraction','findOne','OpenchannelInteractionId','then','update','error','CmContact','describe','OpenchannelAccount','find','OpenchannelAccountId','Interactions','keys','replyUri','OpenchannelMessage,\x20%s,\x20%s','afterCreate','length','Interaction','omit','Contact'];(function(_0x10f7f7,_0x457207){var _0x4ca615=function(_0x3db9aa){while(--_0x3db9aa){_0x10f7f7['push'](_0x10f7f7['shift']());}};_0x4ca615(++_0x457207);}(_0xef0f,0x168));var _0xfef0=function(_0x14dfc,_0x38da8f){_0x14dfc=_0x14dfc-0x0;var _0x330858=_0xef0f[_0x14dfc];return _0x330858;};'use strict';var _=require(_0xfef0('0x0'));var util=require('util');var logger=require(_0xfef0('0x1'))(_0xfef0('0x2'));var moment=require(_0xfef0('0x3'));var BPromise=require('bluebird');var rp=require(_0xfef0('0x4'));var fs=require('fs');var path=require(_0xfef0('0x5'));var rimraf=require(_0xfef0('0x6'));var config=require('../../config/environment');var attributes=require(_0xfef0('0x7'));module[_0xfef0('0x8')]=function(_0x2697df,_0x315a8c){return _0x2697df[_0xfef0('0x9')](_0xfef0('0xa'),attributes,{'tableName':'openchannel_messages','paranoid':![],'indexes':[{'name':_0xfef0('0xb'),'fields':['body'],'type':_0xfef0('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x100e3a,_0x3a81cc,_0x2d42dc){var _0x334e74=_0x2697df[_0xfef0('0xd')];var _0xc177db=_0x100e3a[_0xfef0('0xe')]({'plain':!![]});if(_0xc177db[_0xfef0('0xf')][_0xfef0('0x10')]()==='in'||_0xc177db[_0xfef0('0xf')][_0xfef0('0x10')]()===_0xfef0('0x11')&&!_0xc177db[_0xfef0('0x12')]&&!_['isNil'](_0xc177db[_0xfef0('0x13')])){_0x334e74[_0xfef0('0x14')][_0xfef0('0x15')]({'where':{'id':_0xc177db[_0xfef0('0x16')]}})[_0xfef0('0x17')](function(_0x45599a){if(_0x45599a){_0x45599a[_0xfef0('0x18')]({'lastMsgAt':_0xc177db['createdAt'],'lastMsgDirection':_0xc177db[_0xfef0('0xf')]['toLowerCase']()});}})['catch'](function(_0x5acdd0){console[_0xfef0('0x19')](_0x5acdd0);});}if(_0xc177db[_0xfef0('0xf')]===_0xfef0('0x11')&&!_0xc177db[_0xfef0('0x12')]){var _0x2a96d9;_0x334e74[_0xfef0('0x1a')][_0xfef0('0x1b')]()[_0xfef0('0x17')](function(_0x581459){return _0x334e74[_0xfef0('0x1c')][_0xfef0('0x1d')]({'where':{'id':_0xc177db[_0xfef0('0x1e')]},'include':[{'model':_0x334e74[_0xfef0('0x14')],'as':_0xfef0('0x1f'),'where':{'id':_0xc177db['OpenchannelInteractionId']},'limit':0x1,'include':[{'model':_0x334e74[_0xfef0('0x1a')],'as':'Contact','attributes':_[_0xfef0('0x20')](_0x581459)}]}]});})[_0xfef0('0x17')](function(_0x28dee1){_0x2a96d9=_0x28dee1['get']({'plain':!![]});if(_0x2a96d9&&_0x2a96d9[_0xfef0('0x21')]){logger['info'](_0xfef0('0x22'),_0xfef0('0x23'),util['format']('Forwarding\x20message\x20%d\x20to\x20%s',_0xc177db['id'],_0x2a96d9['replyUri']));if(_0x2a96d9[_0xfef0('0x1f')]&&_0x2a96d9['Interactions'][_0xfef0('0x24')]){_0xc177db[_0xfef0('0x25')]=_[_0xfef0('0x26')](_0x2a96d9[_0xfef0('0x1f')][0x0],_0xfef0('0x27'));_0xc177db[_0xfef0('0x27')]=_0x2a96d9['Interactions'][0x0]['Contact'];}var _0x3a81cc={'method':_0xfef0('0x28'),'uri':encodeURI(_0x2a96d9[_0xfef0('0x21')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x3a81cc[_0xfef0('0x29')]){case _0xfef0('0x2a'):_0x3a81cc['qs']=_0xc177db;break;case _0xfef0('0x28'):_0x3a81cc[_0xfef0('0x2b')]=_0xc177db;break;}return rp(_0x3a81cc)[_0xfef0('0x17')](function(_0x391279){logger['info'](_0xfef0('0x22'),_0xfef0('0x23'),util[_0xfef0('0x2c')](_0xfef0('0x2d'),_0xc177db['id'],_0x2a96d9[_0xfef0('0x21')]));if(_0x391279[_0xfef0('0x2b')][_0xfef0('0x2e')]&&_0x391279[_0xfef0('0x2b')][_0xfef0('0x2e')]!=_0xc177db[_0xfef0('0x25')][_0xfef0('0x2e')]){return _0x334e74[_0xfef0('0x14')]['update']({'threadId':_0x391279[_0xfef0('0x2b')]['threadId']},{'logging':!![],'where':{'id':_0xc177db['Interaction']['id']}});}else{return;}})[_0xfef0('0x17')](function(){return _0x100e3a[_0xfef0('0x18')]({'read':!![]});})['catch'](function(_0x4bbdba){logger['error']('OpenchannelMessage,\x20%s,\x20%s','afterCreate',util[_0xfef0('0x2f')](_0x4bbdba,{'showHidden':![],'depth':null}));_0x2d42dc();});}else{_0x2d42dc();}})[_0xfef0('0x30')](function(){_0x2d42dc();});}else{_0x2d42dc();}}},'charset':_0xfef0('0x31'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index b5b9b65..bed7e7a 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 _0x7a54=['../../config/environment','jayson/promise','http','defaults','redis','socket.io-emitter','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateOpenchannelMessage','OpenchannelMessage','body','options','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x3d274d,_0x28f77e){var _0x2b135c=function(_0x33aee5){while(--_0x33aee5){_0x3d274d['push'](_0x3d274d['shift']());}};_0x2b135c(++_0x28f77e);}(_0x7a54,0x106));var _0x47a5=function(_0x5e6449,_0x4f3d82){_0x5e6449=_0x5e6449-0x0;var _0x2f3d38=_0x7a54[_0x5e6449];return _0x2f3d38;};'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});config['redis']=_[_0x47a5('0xb')](config[_0x47a5('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x47a5('0xd'))(new Redis(config['redis']));require('./openchannelMessage.socket')['register'](socket);function respondWithRpcPromise(_0x2a0e98,_0x2baee7,_0x5e31dd){return new BPromise(function(_0x2eb0dd,_0x49e844){return client['request'](_0x2a0e98,_0x5e31dd)[_0x47a5('0xe')](function(_0x69e4d4){logger[_0x47a5('0xf')](_0x47a5('0x10'),_0x2baee7,_0x47a5('0x11'));logger[_0x47a5('0x12')](_0x47a5('0x13'),_0x2baee7,'request\x20sent',JSON[_0x47a5('0x14')](_0x69e4d4));if(_0x69e4d4[_0x47a5('0x15')]){if(_0x69e4d4[_0x47a5('0x15')][_0x47a5('0x16')]===0x1f4){logger[_0x47a5('0x15')](_0x47a5('0x10'),_0x2baee7,_0x69e4d4[_0x47a5('0x15')][_0x47a5('0x17')]);return _0x49e844(_0x69e4d4['error'][_0x47a5('0x17')]);}logger[_0x47a5('0x15')](_0x47a5('0x10'),_0x2baee7,_0x69e4d4[_0x47a5('0x15')][_0x47a5('0x17')]);return _0x2eb0dd(_0x69e4d4['error']['message']);}else{logger[_0x47a5('0xf')]('OpenchannelMessage,\x20%s,\x20%s',_0x2baee7,'request\x20sent');_0x2eb0dd(_0x69e4d4[_0x47a5('0x18')][_0x47a5('0x17')]);}})[_0x47a5('0x19')](function(_0x1ef371){logger[_0x47a5('0x15')](_0x47a5('0x10'),_0x2baee7,_0x1ef371);_0x49e844(_0x1ef371);});});}exports[_0x47a5('0x1a')]=function(_0xe3c618){var _0x3aed38=this;return new Promise(function(_0x4a9fcb,_0x1570bc){return db[_0x47a5('0x1b')]['create'](_0xe3c618[_0x47a5('0x1c')],{'raw':_0xe3c618[_0x47a5('0x1d')]?_0xe3c618[_0x47a5('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x47a5('0xe')](function(_0x2f142b){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xe3c618);logger['debug'](_0x47a5('0x1a'),_0xe3c618,JSON[_0x47a5('0x14')](_0x2f142b));_0x4a9fcb(_0x2f142b);})['catch'](function(_0x28747d){logger[_0x47a5('0x15')](_0x47a5('0x1a'),_0x28747d[_0x47a5('0x17')],_0xe3c618);_0x1570bc(_0x3aed38[_0x47a5('0x15')](0x1f4,_0x28747d['message']));});});}; \ No newline at end of file +var _0xadb5=['debug','request\x20sent','stringify','error','code','message','info','result','catch','OpenchannelMessage','body','raw','CreateOpenchannelMessage','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','register','request','then','OpenchannelMessage,\x20%s,\x20%s'];(function(_0x4e3741,_0x145f1f){var _0x2bb0b0=function(_0x323a5b){while(--_0x323a5b){_0x4e3741['push'](_0x4e3741['shift']());}};_0x2bb0b0(++_0x145f1f);}(_0xadb5,0xad));var _0x5adb=function(_0x24c1af,_0x506470){_0x24c1af=_0x24c1af-0x0;var _0x4f903d=_0xadb5[_0x24c1af];return _0x4f903d;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});config[_0x5adb('0xa')]=_[_0x5adb('0xb')](config[_0x5adb('0xa')],{'host':_0x5adb('0xc'),'port':0x18eb});var socket=require(_0x5adb('0xd'))(new Redis(config[_0x5adb('0xa')]));require(_0x5adb('0xe'))[_0x5adb('0xf')](socket);function respondWithRpcPromise(_0x336bad,_0x129f5a,_0x275428){return new BPromise(function(_0x563d86,_0x4c268d){return client[_0x5adb('0x10')](_0x336bad,_0x275428)[_0x5adb('0x11')](function(_0x82e67e){logger['info'](_0x5adb('0x12'),_0x129f5a,'request\x20sent');logger[_0x5adb('0x13')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x129f5a,_0x5adb('0x14'),JSON[_0x5adb('0x15')](_0x82e67e));if(_0x82e67e[_0x5adb('0x16')]){if(_0x82e67e['error'][_0x5adb('0x17')]===0x1f4){logger[_0x5adb('0x16')](_0x5adb('0x12'),_0x129f5a,_0x82e67e['error'][_0x5adb('0x18')]);return _0x4c268d(_0x82e67e['error'][_0x5adb('0x18')]);}logger[_0x5adb('0x16')](_0x5adb('0x12'),_0x129f5a,_0x82e67e[_0x5adb('0x16')][_0x5adb('0x18')]);return _0x563d86(_0x82e67e[_0x5adb('0x16')][_0x5adb('0x18')]);}else{logger[_0x5adb('0x19')](_0x5adb('0x12'),_0x129f5a,'request\x20sent');_0x563d86(_0x82e67e[_0x5adb('0x1a')]['message']);}})[_0x5adb('0x1b')](function(_0x558f76){logger[_0x5adb('0x16')]('OpenchannelMessage,\x20%s,\x20%s',_0x129f5a,_0x558f76);_0x4c268d(_0x558f76);});});}exports['CreateOpenchannelMessage']=function(_0x1fbaa5){var _0x1bed20=this;return new Promise(function(_0x438671,_0x1fd4a7){return db[_0x5adb('0x1c')]['create'](_0x1fbaa5[_0x5adb('0x1d')],{'raw':_0x1fbaa5['options']?_0x1fbaa5['options'][_0x5adb('0x1e')]===undefined?!![]:![]:!![]})[_0x5adb('0x11')](function(_0x1a38d3){logger[_0x5adb('0x19')](_0x5adb('0x1f'),_0x1fbaa5);logger[_0x5adb('0x13')](_0x5adb('0x1f'),_0x1fbaa5,JSON['stringify'](_0x1a38d3));_0x438671(_0x1a38d3);})[_0x5adb('0x1b')](function(_0x373cc3){logger[_0x5adb('0x16')](_0x5adb('0x1f'),_0x373cc3[_0x5adb('0x18')],_0x1fbaa5);_0x1fd4a7(_0x1bed20['error'](0x1f4,_0x373cc3[_0x5adb('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index 4e1a2a1..7f86c02 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 _0x0e50=['removeListener','length','openchannelMessage:','./openchannelMessage.events','save','remove','emit'];(function(_0x9db798,_0x3f5685){var _0x417009=function(_0x44ad92){while(--_0x44ad92){_0x9db798['push'](_0x9db798['shift']());}};_0x417009(++_0x3f5685);}(_0x0e50,0x168));var _0x00e5=function(_0x1b2ff7,_0x12a034){_0x1b2ff7=_0x1b2ff7-0x0;var _0x31656a=_0x0e50[_0x1b2ff7];return _0x31656a;};'use strict';var OpenchannelMessageEvents=require(_0x00e5('0x0'));var events=[_0x00e5('0x1'),_0x00e5('0x2'),'update'];function createListener(_0x1b3523,_0xa345ef){return function(_0x4a0533){_0xa345ef[_0x00e5('0x3')](_0x1b3523,_0x4a0533);};}function removeListener(_0x3d2263,_0x4f38ad){return function(){OpenchannelMessageEvents[_0x00e5('0x4')](_0x3d2263,_0x4f38ad);};}exports['register']=function(_0x3efbe7){for(var _0xeb6242=0x0,_0x255aec=events[_0x00e5('0x5')];_0xeb6242<_0x255aec;_0xeb6242++){var _0x40b93e=events[_0xeb6242];var _0x4c91eb=createListener(_0x00e5('0x6')+_0x40b93e,_0x3efbe7);OpenchannelMessageEvents['on'](_0x40b93e,_0x4c91eb);}}; \ No newline at end of file +var _0xbc5d=['save','remove','update','emit','removeListener','length'];(function(_0x1e0690,_0x23f317){var _0xa2f55d=function(_0x33c01c){while(--_0x33c01c){_0x1e0690['push'](_0x1e0690['shift']());}};_0xa2f55d(++_0x23f317);}(_0xbc5d,0x19e));var _0xdbc5=function(_0x3a2bb7,_0xdc071b){_0x3a2bb7=_0x3a2bb7-0x0;var _0x227d23=_0xbc5d[_0x3a2bb7];return _0x227d23;};'use strict';var OpenchannelMessageEvents=require('./openchannelMessage.events');var events=[_0xdbc5('0x0'),_0xdbc5('0x1'),_0xdbc5('0x2')];function createListener(_0x37391e,_0x2e3562){return function(_0x24034d){_0x2e3562[_0xdbc5('0x3')](_0x37391e,_0x24034d);};}function removeListener(_0x2e6d33,_0x270c3a){return function(){OpenchannelMessageEvents[_0xdbc5('0x4')](_0x2e6d33,_0x270c3a);};}exports['register']=function(_0x3e79ac){for(var _0x55da91=0x0,_0x1c6222=events[_0xdbc5('0x5')];_0x55da91<_0x1c6222;_0x55da91++){var _0x2d7747=events[_0x55da91];var _0x2932b4=createListener('openchannelMessage:'+_0x2d7747,_0x3e79ac);OpenchannelMessageEvents['on'](_0x2d7747,_0x2932b4);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index 09ce032..e76a250 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 _0x5024=['get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getAgents','create','post','addTeams','/:id/users','addAgents','put','update','delete','destroy','removeTeams','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','./openchannelQueue.controller'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x5024,0xac));var _0x4502=function(_0x17f57c,_0x5994ae){_0x17f57c=_0x17f57c-0x0;var _0x2cf32e=_0x5024[_0x17f57c];return _0x2cf32e;};'use strict';var multer=require(_0x4502('0x0'));var util=require(_0x4502('0x1'));var path=require(_0x4502('0x2'));var timeout=require('connect-timeout');var express=require(_0x4502('0x3'));var router=express['Router']();var fs_extra=require(_0x4502('0x4'));var auth=require(_0x4502('0x5'));var interaction=require(_0x4502('0x6'));var config=require('../../config/environment');var controller=require(_0x4502('0x7'));router[_0x4502('0x8')]('/',auth[_0x4502('0x9')](),controller[_0x4502('0xa')]);router[_0x4502('0x8')](_0x4502('0xb'),auth[_0x4502('0x9')](),controller[_0x4502('0xc')]);router['get'](_0x4502('0xd'),auth[_0x4502('0x9')](),controller[_0x4502('0xe')]);router[_0x4502('0x8')](_0x4502('0xf'),auth[_0x4502('0x9')](),controller[_0x4502('0x10')]);router[_0x4502('0x8')](_0x4502('0x11'),auth[_0x4502('0x9')](),controller['getTeams']);router[_0x4502('0x8')]('/:id/users',auth['isAuthenticated'](),controller[_0x4502('0x12')]);router['post']('/',auth[_0x4502('0x9')](),controller[_0x4502('0x13')]);router[_0x4502('0x14')](_0x4502('0x11'),auth[_0x4502('0x9')](),controller[_0x4502('0x15')]);router[_0x4502('0x14')](_0x4502('0x16'),auth[_0x4502('0x9')](),controller[_0x4502('0x17')]);router[_0x4502('0x18')](_0x4502('0xd'),auth['isAuthenticated'](),controller[_0x4502('0x19')]);router[_0x4502('0x1a')](_0x4502('0xd'),auth[_0x4502('0x9')](),controller[_0x4502('0x1b')]);router['delete']('/:id/teams',auth['isAuthenticated'](),controller[_0x4502('0x1c')]);router[_0x4502('0x1a')](_0x4502('0x16'),auth[_0x4502('0x9')](),controller['removeAgents']);module[_0x4502('0x1d')]=router; \ No newline at end of file +var _0x94d1=['create','addTeams','addAgents','put','update','delete','destroy','removeTeams','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueue.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post'];(function(_0x258683,_0x3c447b){var _0x484b2d=function(_0x4cc949){while(--_0x4cc949){_0x258683['push'](_0x258683['shift']());}};_0x484b2d(++_0x3c447b);}(_0x94d1,0xf0));var _0x194d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x94d1[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x194d('0x0'));var util=require('util');var path=require(_0x194d('0x1'));var timeout=require(_0x194d('0x2'));var express=require(_0x194d('0x3'));var router=express[_0x194d('0x4')]();var fs_extra=require(_0x194d('0x5'));var auth=require(_0x194d('0x6'));var interaction=require(_0x194d('0x7'));var config=require(_0x194d('0x8'));var controller=require(_0x194d('0x9'));router['get']('/',auth[_0x194d('0xa')](),controller[_0x194d('0xb')]);router[_0x194d('0xc')](_0x194d('0xd'),auth[_0x194d('0xa')](),controller[_0x194d('0xe')]);router['get'](_0x194d('0xf'),auth[_0x194d('0xa')](),controller[_0x194d('0x10')]);router[_0x194d('0xc')](_0x194d('0x11'),auth[_0x194d('0xa')](),controller[_0x194d('0x12')]);router[_0x194d('0xc')](_0x194d('0x13'),auth[_0x194d('0xa')](),controller[_0x194d('0x14')]);router[_0x194d('0xc')](_0x194d('0x15'),auth[_0x194d('0xa')](),controller[_0x194d('0x16')]);router[_0x194d('0x17')]('/',auth[_0x194d('0xa')](),controller[_0x194d('0x18')]);router['post'](_0x194d('0x13'),auth[_0x194d('0xa')](),controller[_0x194d('0x19')]);router[_0x194d('0x17')](_0x194d('0x15'),auth[_0x194d('0xa')](),controller[_0x194d('0x1a')]);router[_0x194d('0x1b')]('/:id',auth[_0x194d('0xa')](),controller[_0x194d('0x1c')]);router[_0x194d('0x1d')]('/:id',auth[_0x194d('0xa')](),controller[_0x194d('0x1e')]);router[_0x194d('0x1d')]('/:id/teams',auth['isAuthenticated'](),controller[_0x194d('0x1f')]);router[_0x194d('0x1d')](_0x194d('0x15'),auth[_0x194d('0xa')](),controller['removeAgents']);module[_0x194d('0x20')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index 863f259..3e0d7f2 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 _0xf032=['roundrobin','sequelize','exports','STRING','name','INTEGER','rrmemory','beepall'];(function(_0x1304a3,_0xccf246){var _0x2acc66=function(_0x4c7d65){while(--_0x4c7d65){_0x1304a3['push'](_0x1304a3['shift']());}};_0x2acc66(++_0xccf246);}(_0xf032,0x1e9));var _0x2f03=function(_0x378e85,_0x3a8add){_0x378e85=_0x378e85-0x0;var _0x8a97a=_0xf032[_0x378e85];return _0x8a97a;};'use strict';var Sequelize=require(_0x2f03('0x0'));module[_0x2f03('0x1')]={'name':{'type':Sequelize[_0x2f03('0x2')],'unique':_0x2f03('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x2f03('0x2')]},'timeout':{'type':Sequelize[_0x2f03('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x2f03('0x5'),_0x2f03('0x6'),_0x2f03('0x7'))}}; \ No newline at end of file +var _0xf1ac=['STRING','INTEGER','ENUM','beepall','sequelize'];(function(_0x1c1af9,_0x5c3e27){var _0x5e1069=function(_0x258267){while(--_0x258267){_0x1c1af9['push'](_0x1c1af9['shift']());}};_0x5e1069(++_0x5c3e27);}(_0xf1ac,0x121));var _0xcf1a=function(_0x207d2f,_0x44400f){_0x207d2f=_0x207d2f-0x0;var _0x3c3498=_0xf1ac[_0x207d2f];return _0x3c3498;};'use strict';var Sequelize=require(_0xcf1a('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xcf1a('0x1')]},'timeout':{'type':Sequelize[_0xcf1a('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xcf1a('0x3')]('rrmemory',_0xcf1a('0x4'),'roundrobin')}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index c464e88..5ece336 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 _0xdaa1=['findAll','rows','catch','show','params','fields','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','getMembers','findOne','UserOpenchannelQueue','OpenchannelQueueId','filter','agent','openchannelPause','updatedAt','createdAt','format','getTeams','Team','addTeams','ids','User','online','voicePause','interface','Agents','transaction','each','findOrCreate','forEach','emit','userOpenchannelQueue:save','removeTeams','select','field','tq.TeamId','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','push','sequelize','QueryTypes','SELECT','TeamId','includes','all','union','compact','value','removeAgents','userOpenchannelQueue:remove','addAgents','isArray','getAgents','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','./openchannelQueue.socket','register','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','save','then','destroy','get','OpenchannelQueues','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','key','query','keys','filters','model','attributes','intersection','length','hasOwnProperty','nolimit','order','sort','where','pick','type','VIRTUAL','merge','options','OpenchannelQueue','includeAll','include'];(function(_0x38e210,_0x1520c2){var _0x458b4d=function(_0x146ce8){while(--_0x146ce8){_0x38e210['push'](_0x38e210['shift']());}};_0x458b4d(++_0x1520c2);}(_0xdaa1,0xcd));var _0x1daa=function(_0x549979,_0x323771){_0x549979=_0x549979-0x0;var _0x28bfdf=_0xdaa1[_0x549979];return _0x28bfdf;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1daa('0x0'));var zipdir=require(_0x1daa('0x1'));var jsonpatch=require(_0x1daa('0x2'));var rp=require('request-promise');var moment=require(_0x1daa('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x1daa('0x4'));var util=require(_0x1daa('0x5'));var path=require(_0x1daa('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x1daa('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1daa('0x8'));var squel=require(_0x1daa('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x1daa('0xa'));var toCsv=require('to-csv');var querystring=require(_0x1daa('0xb'));var Papa=require(_0x1daa('0xc'));var Redis=require(_0x1daa('0xd'));var authService=require(_0x1daa('0xe'));var qs=require(_0x1daa('0xf'));var as=require(_0x1daa('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1daa('0x11'))(_0x1daa('0x12'));var utils=require(_0x1daa('0x13'));var config=require(_0x1daa('0x14'));var licenseUtil=require(_0x1daa('0x15'));var db=require(_0x1daa('0x16'))['db'];config['redis']=_[_0x1daa('0x17')](config[_0x1daa('0x18')],{'host':_0x1daa('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1daa('0x18')]));require(_0x1daa('0x1a'))[_0x1daa('0x1b')](socket);function respondWithStatusCode(_0x71ccae,_0x3bf34f){_0x3bf34f=_0x3bf34f||0xcc;return function(_0x1ffa6e){if(_0x1ffa6e){return _0x71ccae[_0x1daa('0x1c')](_0x3bf34f);}return _0x71ccae[_0x1daa('0x1d')](_0x3bf34f)[_0x1daa('0x1e')]();};}function respondWithResult(_0x4349e1,_0x474138){_0x474138=_0x474138||0xc8;return function(_0xe3b557){if(_0xe3b557){return _0x4349e1[_0x1daa('0x1d')](_0x474138)[_0x1daa('0x1f')](_0xe3b557);}};}function respondWithFilteredResult(_0x13cd0f,_0xee66d5){return function(_0x1c3f98){if(_0x1c3f98){var _0x17e053=typeof _0xee66d5[_0x1daa('0x20')]==='undefined'&&typeof _0xee66d5[_0x1daa('0x21')]==='undefined';var _0x28261e=_0x1c3f98[_0x1daa('0x22')];var _0x32937d=_0x17e053?0x0:_0xee66d5[_0x1daa('0x20')];var _0x46a93f=_0x17e053?_0x1c3f98['count']:_0xee66d5[_0x1daa('0x20')]+_0xee66d5[_0x1daa('0x21')];var _0x4fa758;if(_0x46a93f>=_0x28261e){_0x46a93f=_0x28261e;_0x4fa758=0xc8;}else{_0x4fa758=0xce;}_0x13cd0f[_0x1daa('0x1d')](_0x4fa758);return _0x13cd0f[_0x1daa('0x23')](_0x1daa('0x24'),_0x32937d+'-'+_0x46a93f+'/'+_0x28261e)[_0x1daa('0x1f')](_0x1c3f98);}return null;};}function patchUpdates(_0x546870){return function(_0x244a32){try{jsonpatch[_0x1daa('0x25')](_0x244a32,_0x546870,!![]);}catch(_0x18f320){return BPromise['reject'](_0x18f320);}return _0x244a32[_0x1daa('0x26')]();};}function saveUpdates(_0x1b7ce7,_0x182beb){return function(_0x533699){if(_0x533699){return _0x533699['update'](_0x1b7ce7)[_0x1daa('0x27')](function(_0x4f3d69){return _0x4f3d69;});}return null;};}function removeEntity(_0x8e73ab,_0x3917c0){return function(_0x46bd55){if(_0x46bd55){return _0x46bd55[_0x1daa('0x28')]()[_0x1daa('0x27')](function(){var _0x3d10b5=_0x46bd55[_0x1daa('0x29')]({'plain':!![]});var _0x35bf95=_0x1daa('0x2a');return db[_0x1daa('0x2b')][_0x1daa('0x28')]({'where':{'type':_0x35bf95,'resourceId':_0x3d10b5['id']}})[_0x1daa('0x27')](function(){return _0x46bd55;});})[_0x1daa('0x27')](function(){_0x8e73ab[_0x1daa('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x362ac1,_0x38d9df){return function(_0x3329fc){if(!_0x3329fc){_0x362ac1[_0x1daa('0x1c')](0x194);}return _0x3329fc;};}function handleError(_0x5629f8,_0xe0b25c){_0xe0b25c=_0xe0b25c||0x1f4;return function(_0x23d655){logger[_0x1daa('0x2c')](_0x23d655[_0x1daa('0x2d')]);if(_0x23d655[_0x1daa('0x2e')]){delete _0x23d655[_0x1daa('0x2e')];}_0x5629f8[_0x1daa('0x1d')](_0xe0b25c)[_0x1daa('0x2f')](_0x23d655);};}exports[_0x1daa('0x30')]=function(_0x2b591e,_0x4e45db){var _0x3216b3={},_0x8407b2={},_0x53dc2e={'count':0x0,'rows':[]};var _0x555e0e=_[_0x1daa('0x31')](db['OpenchannelQueue'][_0x1daa('0x32')],function(_0x18c35b){return{'name':_0x18c35b[_0x1daa('0x33')],'type':_0x18c35b['type'][_0x1daa('0x34')]};});_0x8407b2['model']=_['map'](_0x555e0e,_0x1daa('0x2e'));_0x8407b2[_0x1daa('0x35')]=_[_0x1daa('0x36')](_0x2b591e[_0x1daa('0x35')]);_0x8407b2[_0x1daa('0x37')]=_['intersection'](_0x8407b2[_0x1daa('0x38')],_0x8407b2['query']);_0x3216b3[_0x1daa('0x39')]=_[_0x1daa('0x3a')](_0x8407b2[_0x1daa('0x38')],qs['fields'](_0x2b591e[_0x1daa('0x35')]['fields']));_0x3216b3['attributes']=_0x3216b3[_0x1daa('0x39')][_0x1daa('0x3b')]?_0x3216b3[_0x1daa('0x39')]:_0x8407b2[_0x1daa('0x38')];if(!_0x2b591e[_0x1daa('0x35')][_0x1daa('0x3c')](_0x1daa('0x3d'))){_0x3216b3['limit']=qs[_0x1daa('0x21')](_0x2b591e[_0x1daa('0x35')][_0x1daa('0x21')]);_0x3216b3['offset']=qs[_0x1daa('0x20')](_0x2b591e[_0x1daa('0x35')][_0x1daa('0x20')]);}_0x3216b3[_0x1daa('0x3e')]=qs[_0x1daa('0x3f')](_0x2b591e[_0x1daa('0x35')][_0x1daa('0x3f')]);_0x3216b3[_0x1daa('0x40')]=qs[_0x1daa('0x37')](_[_0x1daa('0x41')](_0x2b591e[_0x1daa('0x35')],_0x8407b2['filters']),_0x555e0e);if(_0x2b591e[_0x1daa('0x35')]['filter']){_0x3216b3[_0x1daa('0x40')]=_['merge'](_0x3216b3['where'],{'$or':_[_0x1daa('0x31')](_0x555e0e,function(_0x464147){if(_0x464147[_0x1daa('0x42')]!==_0x1daa('0x43')){var _0x14651a={};_0x14651a[_0x464147[_0x1daa('0x2e')]]={'$like':'%'+_0x2b591e[_0x1daa('0x35')]['filter']+'%'};return _0x14651a;}})});}_0x3216b3=_[_0x1daa('0x44')]({},_0x3216b3,_0x2b591e[_0x1daa('0x45')]);var _0x3e4479={'where':_0x3216b3[_0x1daa('0x40')]};return db[_0x1daa('0x46')][_0x1daa('0x22')](_0x3e4479)[_0x1daa('0x27')](function(_0x3c19ac){_0x53dc2e['count']=_0x3c19ac;if(_0x2b591e[_0x1daa('0x35')][_0x1daa('0x47')]){_0x3216b3[_0x1daa('0x48')]=[{'all':!![]}];}return db[_0x1daa('0x46')][_0x1daa('0x49')](_0x3216b3);})['then'](function(_0x1c7248){_0x53dc2e[_0x1daa('0x4a')]=_0x1c7248;return _0x53dc2e;})['then'](respondWithFilteredResult(_0x4e45db,_0x3216b3))[_0x1daa('0x4b')](handleError(_0x4e45db,null));};exports[_0x1daa('0x4c')]=function(_0x4a3668,_0x3e88c5){var _0x4e7afe={'raw':!![],'where':{'id':_0x4a3668[_0x1daa('0x4d')]['id']}},_0x26f24e={};_0x26f24e['model']=_[_0x1daa('0x36')](db['OpenchannelQueue'][_0x1daa('0x32')]);_0x26f24e[_0x1daa('0x35')]=_[_0x1daa('0x36')](_0x4a3668[_0x1daa('0x35')]);_0x26f24e[_0x1daa('0x37')]=_[_0x1daa('0x3a')](_0x26f24e[_0x1daa('0x38')],_0x26f24e[_0x1daa('0x35')]);_0x4e7afe[_0x1daa('0x39')]=_[_0x1daa('0x3a')](_0x26f24e[_0x1daa('0x38')],qs['fields'](_0x4a3668[_0x1daa('0x35')][_0x1daa('0x4e')]));_0x4e7afe[_0x1daa('0x39')]=_0x4e7afe[_0x1daa('0x39')][_0x1daa('0x3b')]?_0x4e7afe['attributes']:_0x26f24e[_0x1daa('0x38')];if(_0x4a3668[_0x1daa('0x35')]['includeAll']){_0x4e7afe[_0x1daa('0x48')]=[{'all':!![]}];}_0x4e7afe=_[_0x1daa('0x44')]({},_0x4e7afe,_0x4a3668[_0x1daa('0x45')]);return db['OpenchannelQueue'][_0x1daa('0x4f')](_0x4e7afe)[_0x1daa('0x27')](handleEntityNotFound(_0x3e88c5,null))[_0x1daa('0x27')](respondWithResult(_0x3e88c5,null))[_0x1daa('0x4b')](handleError(_0x3e88c5,null));};exports['create']=function(_0x42fa3b,_0x5e6a7a){return db[_0x1daa('0x46')][_0x1daa('0x50')](_0x42fa3b[_0x1daa('0x51')],{})[_0x1daa('0x27')](function(_0x4af14a){var _0x14954a=_0x42fa3b[_0x1daa('0x52')][_0x1daa('0x29')]({'plain':!![]});if(!_0x14954a)throw new Error(_0x1daa('0x53'));if(_0x14954a[_0x1daa('0x54')]===_0x1daa('0x52')){var _0x5544a6=_0x4af14a[_0x1daa('0x29')]({'plain':!![]});var _0x122a92=_0x1daa('0x2a');return db[_0x1daa('0x55')]['find']({'where':{'name':_0x122a92,'userProfileId':_0x14954a['userProfileId']},'raw':!![]})['then'](function(_0x3bd57c){if(_0x3bd57c&&_0x3bd57c[_0x1daa('0x56')]===0x0){return db[_0x1daa('0x2b')][_0x1daa('0x50')]({'name':_0x5544a6['name'],'resourceId':_0x5544a6['id'],'type':_0x3bd57c['name'],'sectionId':_0x3bd57c['id']},{})['then'](function(){return _0x4af14a;});}else{return _0x4af14a;}})[_0x1daa('0x4b')](function(_0x31892a){logger[_0x1daa('0x2c')](_0x1daa('0x57'),_0x31892a);throw _0x31892a;});}return _0x4af14a;})[_0x1daa('0x27')](respondWithResult(_0x5e6a7a,0xc9))[_0x1daa('0x4b')](handleError(_0x5e6a7a,null));};exports[_0x1daa('0x58')]=function(_0x8c50c4,_0x143bb5){if(_0x8c50c4[_0x1daa('0x51')]['id']){delete _0x8c50c4[_0x1daa('0x51')]['id'];}return db[_0x1daa('0x46')][_0x1daa('0x4f')]({'where':{'id':_0x8c50c4[_0x1daa('0x4d')]['id']}})[_0x1daa('0x27')](handleEntityNotFound(_0x143bb5,null))[_0x1daa('0x27')](saveUpdates(_0x8c50c4[_0x1daa('0x51')],null))[_0x1daa('0x27')](respondWithResult(_0x143bb5,null))['catch'](handleError(_0x143bb5,null));};exports[_0x1daa('0x28')]=function(_0x5da7a5,_0x5ec0fe){return db[_0x1daa('0x46')][_0x1daa('0x4f')]({'where':{'id':_0x5da7a5[_0x1daa('0x4d')]['id']}})['then'](handleEntityNotFound(_0x5ec0fe,null))[_0x1daa('0x27')](removeEntity(_0x5ec0fe,null))[_0x1daa('0x4b')](handleError(_0x5ec0fe,null));};exports[_0x1daa('0x59')]=function(_0x4543e4,_0x4cec9a){return db[_0x1daa('0x46')][_0x1daa('0x59')]()['then'](respondWithResult(_0x4cec9a,null))[_0x1daa('0x4b')](handleError(_0x4cec9a,null));};exports[_0x1daa('0x5a')]=function(_0x228245,_0xddf1c9,_0x16b3c3){var _0x141a82={'raw':!![],'where':{}},_0x12ee76={},_0x53da85;return db[_0x1daa('0x46')][_0x1daa('0x5b')]({'where':{'id':_0x228245[_0x1daa('0x4d')]['id']}})[_0x1daa('0x27')](handleEntityNotFound(_0xddf1c9,null))[_0x1daa('0x27')](function(_0x429b89){if(_0x429b89){_0x53da85=_0x429b89[_0x1daa('0x29')]({'plain':!![]});_0x12ee76['model']=_[_0x1daa('0x36')](db[_0x1daa('0x5c')][_0x1daa('0x32')]);_0x12ee76[_0x1daa('0x35')]=_[_0x1daa('0x36')](_0x228245[_0x1daa('0x35')]);_0x12ee76['filters']=_['intersection'](_0x12ee76['model'],_0x12ee76[_0x1daa('0x35')]);_0x141a82['attributes']=_[_0x1daa('0x3a')](_0x12ee76[_0x1daa('0x38')],qs['fields'](_0x228245[_0x1daa('0x35')][_0x1daa('0x4e')]));_0x141a82['attributes']=_0x141a82[_0x1daa('0x39')]['length']?_0x141a82[_0x1daa('0x39')]:_0x12ee76[_0x1daa('0x38')];if(!_0x228245[_0x1daa('0x35')][_0x1daa('0x3c')](_0x1daa('0x3d'))){_0x141a82[_0x1daa('0x21')]=qs[_0x1daa('0x21')](_0x228245[_0x1daa('0x35')][_0x1daa('0x21')]);_0x141a82[_0x1daa('0x20')]=qs['offset'](_0x228245[_0x1daa('0x35')][_0x1daa('0x20')]);}_0x141a82[_0x1daa('0x3e')]=qs['sort'](_0x228245[_0x1daa('0x35')]['sort']);_0x141a82['where']=qs[_0x1daa('0x37')](_['pick'](_0x228245[_0x1daa('0x35')],_0x12ee76['filters']));_0x141a82['where'][_0x1daa('0x5d')]=_0x429b89['id'];if(_0x228245[_0x1daa('0x35')][_0x1daa('0x5e')]){_0x141a82['where']=_[_0x1daa('0x44')](_0x141a82[_0x1daa('0x40')],{'$or':_[_0x1daa('0x31')](_0x141a82[_0x1daa('0x39')],function(_0x1e77d1){var _0x3d2ae1={};_0x3d2ae1[_0x1e77d1]={'$like':'%'+_0x228245[_0x1daa('0x35')][_0x1daa('0x5e')]+'%'};return _0x3d2ae1;})});}_0x141a82=_['merge']({},_0x141a82,_0x228245['options']);return db[_0x1daa('0x5c')][_0x1daa('0x49')](_0x141a82);}})['then'](function(_0x2fc9a5){if(_0x2fc9a5){return db['User']['findAndCountAll']({'where':{'id':_['map'](_0x2fc9a5,'UserId'),'role':_0x1daa('0x5f')},'attributes':['id',_0x1daa('0x2e'),_0x1daa('0x60'),_0x1daa('0x61'),_0x1daa('0x62')]});}})[_0x1daa('0x27')](function(_0x383f25){if(_0x383f25){return{'count':_0x383f25[_0x1daa('0x22')],'rows':_[_0x1daa('0x31')](_0x383f25[_0x1daa('0x4a')],function(_0x4993e9){return{'membername':_0x4993e9['name'],'UserId':_0x4993e9['id'],'queue_name':_0x53da85[_0x1daa('0x2e')],'OpenchannelQueueId':_0x53da85['id'],'interface':util[_0x1daa('0x63')]('%s/%s','SIP',_0x4993e9[_0x1daa('0x2e')]),'penalty':0x0,'paused':_0x4993e9[_0x1daa('0x60')],'createdAt':_0x4993e9['createdAt'],'updatedAt':_0x4993e9[_0x1daa('0x61')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0xddf1c9,_0x141a82))[_0x1daa('0x4b')](handleError(_0xddf1c9,null));};exports[_0x1daa('0x64')]=function(_0x14fa03,_0x7c21f,_0x536447){var _0x3837a1={};var _0x2f11f6={};var _0x117149;var _0x2958c6;return db[_0x1daa('0x46')][_0x1daa('0x5b')]({'where':{'id':_0x14fa03[_0x1daa('0x4d')]['id']}})[_0x1daa('0x27')](handleEntityNotFound(_0x7c21f,null))['then'](function(_0x40a6f8){if(_0x40a6f8){_0x117149=_0x40a6f8;_0x2f11f6['model']=_[_0x1daa('0x36')](db[_0x1daa('0x65')]['rawAttributes']);_0x2f11f6[_0x1daa('0x35')]=_[_0x1daa('0x36')](_0x14fa03['query']);_0x2f11f6['filters']=_[_0x1daa('0x3a')](_0x2f11f6[_0x1daa('0x38')],_0x2f11f6[_0x1daa('0x35')]);_0x3837a1[_0x1daa('0x39')]=_[_0x1daa('0x3a')](_0x2f11f6[_0x1daa('0x38')],qs[_0x1daa('0x4e')](_0x14fa03[_0x1daa('0x35')][_0x1daa('0x4e')]));_0x3837a1[_0x1daa('0x39')]=_0x3837a1[_0x1daa('0x39')]['length']?_0x3837a1[_0x1daa('0x39')]:_0x2f11f6[_0x1daa('0x38')];_0x3837a1[_0x1daa('0x3e')]=qs[_0x1daa('0x3f')](_0x14fa03[_0x1daa('0x35')][_0x1daa('0x3f')]);_0x3837a1[_0x1daa('0x40')]=qs['filters'](_['pick'](_0x14fa03['query'],_0x2f11f6[_0x1daa('0x37')]));if(_0x14fa03['query'][_0x1daa('0x5e')]){_0x3837a1[_0x1daa('0x40')]=_['merge'](_0x3837a1[_0x1daa('0x40')],{'$or':_[_0x1daa('0x31')](_0x3837a1[_0x1daa('0x39')],function(_0x2b2968){var _0x37a424={};_0x37a424[_0x2b2968]={'$like':'%'+_0x14fa03[_0x1daa('0x35')]['filter']+'%'};return _0x37a424;})});}_0x3837a1=_['merge']({},_0x3837a1,_0x14fa03[_0x1daa('0x45')]);return _0x117149['getTeams'](_0x3837a1);}})['then'](function(_0x5ee733){if(_0x5ee733){_0x2958c6=_0x5ee733[_0x1daa('0x3b')];if(!_0x14fa03[_0x1daa('0x35')][_0x1daa('0x3c')](_0x1daa('0x3d'))){_0x3837a1[_0x1daa('0x21')]=qs['limit'](_0x14fa03[_0x1daa('0x35')][_0x1daa('0x21')]);_0x3837a1[_0x1daa('0x20')]=qs[_0x1daa('0x20')](_0x14fa03[_0x1daa('0x35')]['offset']);}return _0x117149[_0x1daa('0x64')](_0x3837a1);}})[_0x1daa('0x27')](function(_0xc97eb){if(_0xc97eb){return _0xc97eb?{'count':_0x2958c6,'rows':_0xc97eb}:null;}})[_0x1daa('0x27')](respondWithResult(_0x7c21f,null))['catch'](handleError(_0x7c21f,null));};exports[_0x1daa('0x66')]=function(_0x5cb2e7,_0x5400c2,_0x50659b){var _0x5b3f9a=_0x5cb2e7[_0x1daa('0x51')][_0x1daa('0x67')];return db[_0x1daa('0x65')][_0x1daa('0x49')]({'where':{'id':_0x5b3f9a},'attributes':['id'],'include':[{'model':db[_0x1daa('0x68')],'as':'Agents','attributes':['id',_0x1daa('0x2e'),_0x1daa('0x69'),_0x1daa('0x6a'),_0x1daa('0x6b')],'raw':!![]}]})[_0x1daa('0x27')](function(_0x247b7e){if(_0x247b7e){var _0x142bc8=_['flatMap'](_0x247b7e,function(_0x2604cf){var _0x50f6ee=_0x2604cf[_0x1daa('0x29')]({'plain':!![]});return _0x50f6ee[_0x1daa('0x6c')];});return db[_0x1daa('0x46')][_0x1daa('0x4f')]({'where':{'id':_0x5cb2e7[_0x1daa('0x4d')]['id']}})['then'](function(_0x19a3f9){return db['sequelize'][_0x1daa('0x6d')](function(_0x2f8e0a){return _0x19a3f9[_0x1daa('0x66')](_0x5b3f9a,{'transaction':_0x2f8e0a})['then'](function(){return BPromise[_0x1daa('0x6e')](_0x142bc8,function(_0x2d772d){return db[_0x1daa('0x5c')][_0x1daa('0x6f')]({'where':{'UserId':_0x2d772d['id'],'OpenchannelQueueId':_0x5cb2e7[_0x1daa('0x4d')]['id']},'transaction':_0x2f8e0a});});})['then'](function(){_0x142bc8[_0x1daa('0x70')](function(_0x1a360e){socket[_0x1daa('0x71')](_0x1daa('0x72'),{'UserId':_0x1a360e['id'],'OpenchannelQueueId':_0x19a3f9['id']});});});});});}})[_0x1daa('0x27')](respondWithStatusCode(_0x5400c2,null))[_0x1daa('0x4b')](handleError(_0x5400c2,null));};exports[_0x1daa('0x73')]=function(_0x311f03,_0x257ade,_0x284598){return db[_0x1daa('0x65')][_0x1daa('0x49')]({'where':{'id':_0x311f03[_0x1daa('0x35')][_0x1daa('0x67')]},'attributes':['id'],'include':[{'model':db[_0x1daa('0x68')],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x257ade,null))[_0x1daa('0x27')](function(_0x4a038e){var _0x3ddb53=_['map'](_0x4a038e,'id');var _0x50d763=[];var _0x27f1b7=[];var _0x28d250=squel[_0x1daa('0x74')]();_0x28d250[_0x1daa('0x75')](_0x1daa('0x76'))['from']('team_has_openchannel_queues','tq')[_0x1daa('0x77')](_0x1daa('0x78'),'ut',_0x1daa('0x79'))[_0x1daa('0x40')](_0x1daa('0x7a'),_0x311f03[_0x1daa('0x4d')]['id']);for(var _0x2d966e=0x0;_0x2d966e<_0x4a038e[_0x1daa('0x3b')];_0x2d966e+=0x1){let _0x51a0ee=_0x4a038e[_0x2d966e];for(var _0x561385=0x0;_0x561385<_0x51a0ee[_0x1daa('0x6c')]['length'];_0x561385+=0x1){let _0x31eb46=_0x51a0ee[_0x1daa('0x6c')][_0x561385];var _0xc40b91=_0x28d250[_0x1daa('0x7b')]();_0xc40b91[_0x1daa('0x40')]('ut.UserId\x20=\x20?',_0x31eb46['id']);_0x27f1b7[_0x1daa('0x7c')](db[_0x1daa('0x7d')][_0x1daa('0x35')](_0xc40b91['toString'](),{'type':db[_0x1daa('0x7d')][_0x1daa('0x7e')][_0x1daa('0x7f')]})[_0x1daa('0x27')](function(_0x12a3aa){if(_0x12a3aa['length']===0x1){return _0x31eb46['id'];}else{var _0x767287=_['every'](_['map'](_0x12a3aa,_0x1daa('0x80')),function(_0x5df1b7){return _[_0x1daa('0x81')](_0x3ddb53,_0x5df1b7);});if(_0x767287){return _0x31eb46['id'];}}}));}}return BPromise[_0x1daa('0x82')](_0x27f1b7)['then'](function(_0x17b28f){_0x50d763=_(_0x50d763)[_0x1daa('0x83')](_0x17b28f)[_0x1daa('0x84')]()[_0x1daa('0x85')]();return db[_0x1daa('0x46')]['find']({'where':{'id':_0x311f03[_0x1daa('0x4d')]['id']}})[_0x1daa('0x27')](function(_0x4ff3e3){return db['sequelize'][_0x1daa('0x6d')](function(_0x263099){return _0x4ff3e3[_0x1daa('0x73')](_0x311f03[_0x1daa('0x35')][_0x1daa('0x67')],{'transaction':_0x263099})[_0x1daa('0x27')](function(){if(!_['isEmpty'](_0x50d763)){return _0x4ff3e3[_0x1daa('0x86')](_0x50d763,{'transaction':_0x263099});}})['then'](function(){_0x50d763[_0x1daa('0x70')](function(_0x3d5748){socket['emit'](_0x1daa('0x87'),{'UserId':_0x3d5748,'OpenchannelQueueId':_0x4ff3e3['id']});});});});});});})[_0x1daa('0x27')](respondWithStatusCode(_0x257ade,null))[_0x1daa('0x4b')](handleError(_0x257ade,null));};exports[_0x1daa('0x88')]=function(_0x548e45,_0x4a3a35,_0x402c7d){return db[_0x1daa('0x46')][_0x1daa('0x4f')]({'where':{'id':_0x548e45[_0x1daa('0x4d')]['id']}})['then'](handleEntityNotFound(_0x4a3a35,null))[_0x1daa('0x27')](function(_0x3b4a15){if(_0x3b4a15){return _0x3b4a15[_0x1daa('0x88')](_0x548e45[_0x1daa('0x51')][_0x1daa('0x67')],_['omit'](_0x548e45[_0x1daa('0x51')],[_0x1daa('0x67'),'id'])||{})['spread'](function(_0x49d696){for(var _0x2e8997=0x0;_0x2e8997<_0x548e45[_0x1daa('0x51')][_0x1daa('0x67')][_0x1daa('0x3b')];_0x2e8997+=0x1){socket[_0x1daa('0x71')](_0x1daa('0x72'),{'UserId':Number(_0x548e45[_0x1daa('0x51')][_0x1daa('0x67')][_0x2e8997]),'OpenchannelQueueId':Number(_0x548e45[_0x1daa('0x4d')]['id'])});}return _0x49d696;});}})[_0x1daa('0x27')](respondWithResult(_0x4a3a35,null))[_0x1daa('0x4b')](handleError(_0x4a3a35,null));};exports[_0x1daa('0x86')]=function(_0x2f1af0,_0x339e43,_0x834a10){return db[_0x1daa('0x46')][_0x1daa('0x4f')]({'where':{'id':_0x2f1af0['params']['id']}})['then'](handleEntityNotFound(_0x339e43,null))[_0x1daa('0x27')](function(_0x1ba02d){if(_0x1ba02d){return _0x1ba02d[_0x1daa('0x86')](_0x2f1af0[_0x1daa('0x35')][_0x1daa('0x67')])[_0x1daa('0x27')](function(){if(_[_0x1daa('0x89')](_0x2f1af0[_0x1daa('0x35')][_0x1daa('0x67')])){for(var _0x3e039e=0x0;_0x3e039e<_0x2f1af0[_0x1daa('0x35')][_0x1daa('0x67')][_0x1daa('0x3b')];_0x3e039e+=0x1){socket[_0x1daa('0x71')]('userOpenchannelQueue:remove',{'UserId':Number(_0x2f1af0['query']['ids'][_0x3e039e]),'OpenchannelQueueId':Number(_0x2f1af0[_0x1daa('0x4d')]['id'])});}}else{socket[_0x1daa('0x71')](_0x1daa('0x87'),{'UserId':Number(_0x2f1af0[_0x1daa('0x35')]['ids']),'OpenchannelQueueId':Number(_0x2f1af0['params']['id'])});}});}})[_0x1daa('0x27')](respondWithStatusCode(_0x339e43,null))['catch'](handleError(_0x339e43,null));};exports[_0x1daa('0x8a')]=function(_0x338151,_0x4effde,_0x299142){var _0x187709={};var _0xf11454={};var _0x5235b5;var _0x423363;return db[_0x1daa('0x46')][_0x1daa('0x5b')]({'where':{'id':_0x338151[_0x1daa('0x4d')]['id']}})[_0x1daa('0x27')](handleEntityNotFound(_0x4effde,null))['then'](function(_0x44d058){if(_0x44d058){_0x5235b5=_0x44d058;_0xf11454['model']=_['keys'](db[_0x1daa('0x68')][_0x1daa('0x32')]);_0xf11454[_0x1daa('0x35')]=_[_0x1daa('0x36')](_0x338151['query']);_0xf11454[_0x1daa('0x37')]=_[_0x1daa('0x3a')](_0xf11454[_0x1daa('0x38')],_0xf11454[_0x1daa('0x35')]);_0x187709[_0x1daa('0x39')]=_[_0x1daa('0x3a')](_0xf11454[_0x1daa('0x38')],qs[_0x1daa('0x4e')](_0x338151[_0x1daa('0x35')][_0x1daa('0x4e')]));_0x187709[_0x1daa('0x39')]=_0x187709[_0x1daa('0x39')][_0x1daa('0x3b')]?_0x187709[_0x1daa('0x39')]:_0xf11454['model'];_0x187709['order']=qs['sort'](_0x338151[_0x1daa('0x35')][_0x1daa('0x3f')]);_0x187709['where']=qs[_0x1daa('0x37')](_[_0x1daa('0x41')](_0x338151[_0x1daa('0x35')],_0xf11454[_0x1daa('0x37')]));if(_0x338151[_0x1daa('0x35')][_0x1daa('0x5e')]){_0x187709[_0x1daa('0x40')]=_['merge'](_0x187709['where'],{'$or':_[_0x1daa('0x31')](_0x187709['attributes'],function(_0x80ca6){var _0x359a9b={};_0x359a9b[_0x80ca6]={'$like':'%'+_0x338151[_0x1daa('0x35')][_0x1daa('0x5e')]+'%'};return _0x359a9b;})});}_0x187709=_['merge']({},_0x187709,_0x338151[_0x1daa('0x45')]);return _0x5235b5[_0x1daa('0x8a')](_0x187709);}})['then'](function(_0x2c9019){if(_0x2c9019){_0x423363=_0x2c9019[_0x1daa('0x3b')];if(!_0x338151[_0x1daa('0x35')][_0x1daa('0x3c')](_0x1daa('0x3d'))){_0x187709[_0x1daa('0x21')]=qs[_0x1daa('0x21')](_0x338151[_0x1daa('0x35')][_0x1daa('0x21')]);_0x187709['offset']=qs[_0x1daa('0x20')](_0x338151[_0x1daa('0x35')]['offset']);}return _0x5235b5[_0x1daa('0x8a')](_0x187709);}})[_0x1daa('0x27')](function(_0x3c68c9){if(_0x3c68c9){return _0x3c68c9?{'count':_0x423363,'rows':_0x3c68c9}:null;}})[_0x1daa('0x27')](respondWithResult(_0x4effde,null))[_0x1daa('0x4b')](handleError(_0x4effde,null));}; \ No newline at end of file +var _0xe8fa=['team_has_openchannel_queues','join','user_has_teams','clone','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','SELECT','every','TeamId','all','union','compact','value','isEmpty','removeAgents','addAgents','omit','isArray','getAgents','request-promise','bluebird','mustache','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','OpenchannelQueues','UserProfileResource','error','send','index','map','OpenchannelQueue','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','order','sort','pick','filter','where','merge','type','VIRTUAL','name','options','includeAll','findAll','rows','show','fields','include','find','catch','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','findOne','UserOpenchannelQueue','nolimit','OpenchannelQueueId','findAndCountAll','UserId','agent','openchannelPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','addTeams','ids','Team','User','Agents','voicePause','interface','flatMap','transaction','emit','removeTeams','tq.TeamId','from'];(function(_0x213b4c,_0x299eaf){var _0x28b6ea=function(_0x14bed7){while(--_0x14bed7){_0x213b4c['push'](_0x213b4c['shift']());}};_0x28b6ea(++_0x299eaf);}(_0xe8fa,0x12a));var _0xae8f=function(_0x2080a3,_0x48acfa){_0x2080a3=_0x2080a3-0x0;var _0x8d7d17=_0xe8fa[_0x2080a3];return _0x8d7d17;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xae8f('0x0'));var moment=require('moment');var BPromise=require(_0xae8f('0x1'));var Mustache=require(_0xae8f('0x2'));var util=require('util');var path=require('path');var sox=require(_0xae8f('0x3'));var csv=require(_0xae8f('0x4'));var ejs=require(_0xae8f('0x5'));var fs=require('fs');var fs_extra=require(_0xae8f('0x6'));var _=require('lodash');var squel=require(_0xae8f('0x7'));var crypto=require(_0xae8f('0x8'));var jsforce=require(_0xae8f('0x9'));var deskjs=require(_0xae8f('0xa'));var toCsv=require(_0xae8f('0x4'));var querystring=require(_0xae8f('0xb'));var Papa=require('papaparse');var Redis=require(_0xae8f('0xc'));var authService=require(_0xae8f('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0xae8f('0xe'));var hardwareService=require(_0xae8f('0xf'));var logger=require(_0xae8f('0x10'))(_0xae8f('0x11'));var utils=require(_0xae8f('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0xae8f('0x13'));var db=require('../../mysqldb')['db'];config[_0xae8f('0x14')]=_[_0xae8f('0x15')](config[_0xae8f('0x14')],{'host':_0xae8f('0x16'),'port':0x18eb});var socket=require(_0xae8f('0x17'))(new Redis(config[_0xae8f('0x14')]));require('./openchannelQueue.socket')[_0xae8f('0x18')](socket);function respondWithStatusCode(_0x87e507,_0x26fe5b){_0x26fe5b=_0x26fe5b||0xcc;return function(_0x56075b){if(_0x56075b){return _0x87e507[_0xae8f('0x19')](_0x26fe5b);}return _0x87e507[_0xae8f('0x1a')](_0x26fe5b)[_0xae8f('0x1b')]();};}function respondWithResult(_0x1e194d,_0x54b128){_0x54b128=_0x54b128||0xc8;return function(_0x59b7e0){if(_0x59b7e0){return _0x1e194d['status'](_0x54b128)[_0xae8f('0x1c')](_0x59b7e0);}};}function respondWithFilteredResult(_0x5f0e0e,_0x32d1de){return function(_0x26232c){if(_0x26232c){var _0x271058=typeof _0x32d1de[_0xae8f('0x1d')]===_0xae8f('0x1e')&&typeof _0x32d1de[_0xae8f('0x1f')]==='undefined';var _0x5a9a60=_0x26232c[_0xae8f('0x20')];var _0x41f385=_0x271058?0x0:_0x32d1de['offset'];var _0x120946=_0x271058?_0x26232c[_0xae8f('0x20')]:_0x32d1de[_0xae8f('0x1d')]+_0x32d1de[_0xae8f('0x1f')];var _0x28245c;if(_0x120946>=_0x5a9a60){_0x120946=_0x5a9a60;_0x28245c=0xc8;}else{_0x28245c=0xce;}_0x5f0e0e[_0xae8f('0x1a')](_0x28245c);return _0x5f0e0e[_0xae8f('0x21')](_0xae8f('0x22'),_0x41f385+'-'+_0x120946+'/'+_0x5a9a60)[_0xae8f('0x1c')](_0x26232c);}return null;};}function patchUpdates(_0x2a8e0b){return function(_0x4d2ad1){try{jsonpatch[_0xae8f('0x23')](_0x4d2ad1,_0x2a8e0b,!![]);}catch(_0x45a327){return BPromise[_0xae8f('0x24')](_0x45a327);}return _0x4d2ad1[_0xae8f('0x25')]();};}function saveUpdates(_0x519f90,_0x35fc9d){return function(_0x2dd617){if(_0x2dd617){return _0x2dd617[_0xae8f('0x26')](_0x519f90)[_0xae8f('0x27')](function(_0x374711){return _0x374711;});}return null;};}function removeEntity(_0x14942f,_0x118b94){return function(_0x23eab0){if(_0x23eab0){return _0x23eab0[_0xae8f('0x28')]()[_0xae8f('0x27')](function(){var _0x249893=_0x23eab0['get']({'plain':!![]});var _0x5ca04a=_0xae8f('0x29');return db[_0xae8f('0x2a')][_0xae8f('0x28')]({'where':{'type':_0x5ca04a,'resourceId':_0x249893['id']}})['then'](function(){return _0x23eab0;});})['then'](function(){_0x14942f[_0xae8f('0x1a')](0xcc)[_0xae8f('0x1b')]();});}};}function handleEntityNotFound(_0x14e9aa,_0x2681ad){return function(_0x1fa64c){if(!_0x1fa64c){_0x14e9aa[_0xae8f('0x19')](0x194);}return _0x1fa64c;};}function handleError(_0x4eeeb7,_0x4fc691){_0x4fc691=_0x4fc691||0x1f4;return function(_0x13d93f){logger[_0xae8f('0x2b')](_0x13d93f['stack']);if(_0x13d93f['name']){delete _0x13d93f['name'];}_0x4eeeb7['status'](_0x4fc691)[_0xae8f('0x2c')](_0x13d93f);};}exports[_0xae8f('0x2d')]=function(_0x27cc6c,_0x757aed){var _0x41e555={},_0x8b6916={},_0x534363={'count':0x0,'rows':[]};var _0x439585=_[_0xae8f('0x2e')](db[_0xae8f('0x2f')][_0xae8f('0x30')],function(_0x59d1b7){return{'name':_0x59d1b7[_0xae8f('0x31')],'type':_0x59d1b7['type']['key']};});_0x8b6916[_0xae8f('0x32')]=_['map'](_0x439585,'name');_0x8b6916[_0xae8f('0x33')]=_[_0xae8f('0x34')](_0x27cc6c['query']);_0x8b6916[_0xae8f('0x35')]=_[_0xae8f('0x36')](_0x8b6916[_0xae8f('0x32')],_0x8b6916[_0xae8f('0x33')]);_0x41e555[_0xae8f('0x37')]=_[_0xae8f('0x36')](_0x8b6916['model'],qs['fields'](_0x27cc6c[_0xae8f('0x33')]['fields']));_0x41e555[_0xae8f('0x37')]=_0x41e555[_0xae8f('0x37')][_0xae8f('0x38')]?_0x41e555[_0xae8f('0x37')]:_0x8b6916[_0xae8f('0x32')];if(!_0x27cc6c[_0xae8f('0x33')][_0xae8f('0x39')]('nolimit')){_0x41e555[_0xae8f('0x1f')]=qs['limit'](_0x27cc6c['query'][_0xae8f('0x1f')]);_0x41e555[_0xae8f('0x1d')]=qs[_0xae8f('0x1d')](_0x27cc6c[_0xae8f('0x33')][_0xae8f('0x1d')]);}_0x41e555[_0xae8f('0x3a')]=qs[_0xae8f('0x3b')](_0x27cc6c[_0xae8f('0x33')][_0xae8f('0x3b')]);_0x41e555['where']=qs[_0xae8f('0x35')](_[_0xae8f('0x3c')](_0x27cc6c['query'],_0x8b6916['filters']),_0x439585);if(_0x27cc6c[_0xae8f('0x33')][_0xae8f('0x3d')]){_0x41e555[_0xae8f('0x3e')]=_[_0xae8f('0x3f')](_0x41e555[_0xae8f('0x3e')],{'$or':_[_0xae8f('0x2e')](_0x439585,function(_0x10a3c9){if(_0x10a3c9[_0xae8f('0x40')]!==_0xae8f('0x41')){var _0x529ae9={};_0x529ae9[_0x10a3c9[_0xae8f('0x42')]]={'$like':'%'+_0x27cc6c['query']['filter']+'%'};return _0x529ae9;}})});}_0x41e555=_[_0xae8f('0x3f')]({},_0x41e555,_0x27cc6c[_0xae8f('0x43')]);var _0x3e2f51={'where':_0x41e555[_0xae8f('0x3e')]};return db[_0xae8f('0x2f')][_0xae8f('0x20')](_0x3e2f51)[_0xae8f('0x27')](function(_0x400a4d){_0x534363[_0xae8f('0x20')]=_0x400a4d;if(_0x27cc6c['query'][_0xae8f('0x44')]){_0x41e555['include']=[{'all':!![]}];}return db[_0xae8f('0x2f')][_0xae8f('0x45')](_0x41e555);})['then'](function(_0x9b2bbd){_0x534363[_0xae8f('0x46')]=_0x9b2bbd;return _0x534363;})['then'](respondWithFilteredResult(_0x757aed,_0x41e555))['catch'](handleError(_0x757aed,null));};exports[_0xae8f('0x47')]=function(_0x1a9839,_0x105317){var _0x1036a0={'raw':!![],'where':{'id':_0x1a9839['params']['id']}},_0x11afb0={};_0x11afb0[_0xae8f('0x32')]=_['keys'](db['OpenchannelQueue']['rawAttributes']);_0x11afb0['query']=_[_0xae8f('0x34')](_0x1a9839['query']);_0x11afb0[_0xae8f('0x35')]=_[_0xae8f('0x36')](_0x11afb0['model'],_0x11afb0[_0xae8f('0x33')]);_0x1036a0[_0xae8f('0x37')]=_[_0xae8f('0x36')](_0x11afb0[_0xae8f('0x32')],qs[_0xae8f('0x48')](_0x1a9839[_0xae8f('0x33')][_0xae8f('0x48')]));_0x1036a0[_0xae8f('0x37')]=_0x1036a0[_0xae8f('0x37')][_0xae8f('0x38')]?_0x1036a0['attributes']:_0x11afb0[_0xae8f('0x32')];if(_0x1a9839[_0xae8f('0x33')][_0xae8f('0x44')]){_0x1036a0[_0xae8f('0x49')]=[{'all':!![]}];}_0x1036a0=_['merge']({},_0x1036a0,_0x1a9839[_0xae8f('0x43')]);return db[_0xae8f('0x2f')][_0xae8f('0x4a')](_0x1036a0)[_0xae8f('0x27')](handleEntityNotFound(_0x105317,null))[_0xae8f('0x27')](respondWithResult(_0x105317,null))[_0xae8f('0x4b')](handleError(_0x105317,null));};exports[_0xae8f('0x4c')]=function(_0x1be217,_0x44dfba){return db[_0xae8f('0x2f')][_0xae8f('0x4c')](_0x1be217[_0xae8f('0x4d')],{})[_0xae8f('0x27')](function(_0x4f1d57){var _0x2a4c23=_0x1be217['user'][_0xae8f('0x4e')]({'plain':!![]});if(!_0x2a4c23)throw new Error(_0xae8f('0x4f'));if(_0x2a4c23[_0xae8f('0x50')]===_0xae8f('0x51')){var _0x227a1a=_0x4f1d57[_0xae8f('0x4e')]({'plain':!![]});var _0x5ae0a5=_0xae8f('0x29');return db[_0xae8f('0x52')][_0xae8f('0x4a')]({'where':{'name':_0x5ae0a5,'userProfileId':_0x2a4c23[_0xae8f('0x53')]},'raw':!![]})['then'](function(_0x25dac1){if(_0x25dac1&&_0x25dac1[_0xae8f('0x54')]===0x0){return db[_0xae8f('0x2a')][_0xae8f('0x4c')]({'name':_0x227a1a[_0xae8f('0x42')],'resourceId':_0x227a1a['id'],'type':_0x25dac1[_0xae8f('0x42')],'sectionId':_0x25dac1['id']},{})[_0xae8f('0x27')](function(){return _0x4f1d57;});}else{return _0x4f1d57;}})['catch'](function(_0x4a2081){logger[_0xae8f('0x2b')](_0xae8f('0x55'),_0x4a2081);throw _0x4a2081;});}return _0x4f1d57;})['then'](respondWithResult(_0x44dfba,0xc9))['catch'](handleError(_0x44dfba,null));};exports['update']=function(_0x79e24b,_0x288161){if(_0x79e24b[_0xae8f('0x4d')]['id']){delete _0x79e24b[_0xae8f('0x4d')]['id'];}return db[_0xae8f('0x2f')][_0xae8f('0x4a')]({'where':{'id':_0x79e24b[_0xae8f('0x56')]['id']}})[_0xae8f('0x27')](handleEntityNotFound(_0x288161,null))[_0xae8f('0x27')](saveUpdates(_0x79e24b[_0xae8f('0x4d')],null))[_0xae8f('0x27')](respondWithResult(_0x288161,null))[_0xae8f('0x4b')](handleError(_0x288161,null));};exports[_0xae8f('0x28')]=function(_0x592c91,_0x5a4cfc){return db[_0xae8f('0x2f')][_0xae8f('0x4a')]({'where':{'id':_0x592c91['params']['id']}})[_0xae8f('0x27')](handleEntityNotFound(_0x5a4cfc,null))[_0xae8f('0x27')](removeEntity(_0x5a4cfc,null))[_0xae8f('0x4b')](handleError(_0x5a4cfc,null));};exports[_0xae8f('0x57')]=function(_0x508be4,_0x51408f){return db[_0xae8f('0x2f')]['describe']()[_0xae8f('0x27')](respondWithResult(_0x51408f,null))[_0xae8f('0x4b')](handleError(_0x51408f,null));};exports[_0xae8f('0x58')]=function(_0x2d65db,_0x457c07,_0x5ab73b){var _0x11588a={'raw':!![],'where':{}},_0x24a3bd={},_0x431189;return db[_0xae8f('0x2f')][_0xae8f('0x59')]({'where':{'id':_0x2d65db['params']['id']}})[_0xae8f('0x27')](handleEntityNotFound(_0x457c07,null))['then'](function(_0x382cfa){if(_0x382cfa){_0x431189=_0x382cfa['get']({'plain':!![]});_0x24a3bd[_0xae8f('0x32')]=_[_0xae8f('0x34')](db[_0xae8f('0x5a')][_0xae8f('0x30')]);_0x24a3bd[_0xae8f('0x33')]=_['keys'](_0x2d65db[_0xae8f('0x33')]);_0x24a3bd[_0xae8f('0x35')]=_[_0xae8f('0x36')](_0x24a3bd[_0xae8f('0x32')],_0x24a3bd[_0xae8f('0x33')]);_0x11588a['attributes']=_['intersection'](_0x24a3bd['model'],qs[_0xae8f('0x48')](_0x2d65db[_0xae8f('0x33')]['fields']));_0x11588a[_0xae8f('0x37')]=_0x11588a['attributes'][_0xae8f('0x38')]?_0x11588a[_0xae8f('0x37')]:_0x24a3bd[_0xae8f('0x32')];if(!_0x2d65db['query'][_0xae8f('0x39')](_0xae8f('0x5b'))){_0x11588a[_0xae8f('0x1f')]=qs['limit'](_0x2d65db[_0xae8f('0x33')][_0xae8f('0x1f')]);_0x11588a[_0xae8f('0x1d')]=qs[_0xae8f('0x1d')](_0x2d65db['query'][_0xae8f('0x1d')]);}_0x11588a['order']=qs[_0xae8f('0x3b')](_0x2d65db[_0xae8f('0x33')]['sort']);_0x11588a[_0xae8f('0x3e')]=qs[_0xae8f('0x35')](_[_0xae8f('0x3c')](_0x2d65db[_0xae8f('0x33')],_0x24a3bd[_0xae8f('0x35')]));_0x11588a[_0xae8f('0x3e')][_0xae8f('0x5c')]=_0x382cfa['id'];if(_0x2d65db['query'][_0xae8f('0x3d')]){_0x11588a[_0xae8f('0x3e')]=_[_0xae8f('0x3f')](_0x11588a[_0xae8f('0x3e')],{'$or':_[_0xae8f('0x2e')](_0x11588a[_0xae8f('0x37')],function(_0x3f826a){var _0xeb723f={};_0xeb723f[_0x3f826a]={'$like':'%'+_0x2d65db[_0xae8f('0x33')][_0xae8f('0x3d')]+'%'};return _0xeb723f;})});}_0x11588a=_[_0xae8f('0x3f')]({},_0x11588a,_0x2d65db[_0xae8f('0x43')]);return db[_0xae8f('0x5a')][_0xae8f('0x45')](_0x11588a);}})[_0xae8f('0x27')](function(_0x3183b6){if(_0x3183b6){return db['User'][_0xae8f('0x5d')]({'where':{'id':_['map'](_0x3183b6,_0xae8f('0x5e')),'role':_0xae8f('0x5f')},'attributes':['id',_0xae8f('0x42'),_0xae8f('0x60'),_0xae8f('0x61'),_0xae8f('0x62')]});}})[_0xae8f('0x27')](function(_0x5f020e){if(_0x5f020e){return{'count':_0x5f020e[_0xae8f('0x20')],'rows':_[_0xae8f('0x2e')](_0x5f020e[_0xae8f('0x46')],function(_0x3dac7d){return{'membername':_0x3dac7d[_0xae8f('0x42')],'UserId':_0x3dac7d['id'],'queue_name':_0x431189[_0xae8f('0x42')],'OpenchannelQueueId':_0x431189['id'],'interface':util[_0xae8f('0x63')](_0xae8f('0x64'),_0xae8f('0x65'),_0x3dac7d[_0xae8f('0x42')]),'penalty':0x0,'paused':_0x3dac7d[_0xae8f('0x60')],'createdAt':_0x3dac7d[_0xae8f('0x62')],'updatedAt':_0x3dac7d['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0xae8f('0x27')](respondWithFilteredResult(_0x457c07,_0x11588a))[_0xae8f('0x4b')](handleError(_0x457c07,null));};exports[_0xae8f('0x66')]=function(_0x30415,_0x3b4200,_0x5f37ca){var _0x363035={};var _0x10cf58={};var _0x58d9e0;var _0x2ca2e6;return db[_0xae8f('0x2f')][_0xae8f('0x59')]({'where':{'id':_0x30415[_0xae8f('0x56')]['id']}})[_0xae8f('0x27')](handleEntityNotFound(_0x3b4200,null))[_0xae8f('0x27')](function(_0xdfb928){if(_0xdfb928){_0x58d9e0=_0xdfb928;_0x10cf58['model']=_['keys'](db['Team'][_0xae8f('0x30')]);_0x10cf58['query']=_[_0xae8f('0x34')](_0x30415[_0xae8f('0x33')]);_0x10cf58[_0xae8f('0x35')]=_[_0xae8f('0x36')](_0x10cf58[_0xae8f('0x32')],_0x10cf58['query']);_0x363035[_0xae8f('0x37')]=_[_0xae8f('0x36')](_0x10cf58[_0xae8f('0x32')],qs['fields'](_0x30415[_0xae8f('0x33')][_0xae8f('0x48')]));_0x363035['attributes']=_0x363035[_0xae8f('0x37')][_0xae8f('0x38')]?_0x363035[_0xae8f('0x37')]:_0x10cf58[_0xae8f('0x32')];_0x363035[_0xae8f('0x3a')]=qs[_0xae8f('0x3b')](_0x30415[_0xae8f('0x33')][_0xae8f('0x3b')]);_0x363035['where']=qs[_0xae8f('0x35')](_[_0xae8f('0x3c')](_0x30415[_0xae8f('0x33')],_0x10cf58[_0xae8f('0x35')]));if(_0x30415[_0xae8f('0x33')][_0xae8f('0x3d')]){_0x363035[_0xae8f('0x3e')]=_[_0xae8f('0x3f')](_0x363035[_0xae8f('0x3e')],{'$or':_[_0xae8f('0x2e')](_0x363035[_0xae8f('0x37')],function(_0x354fd3){var _0x1c104b={};_0x1c104b[_0x354fd3]={'$like':'%'+_0x30415['query'][_0xae8f('0x3d')]+'%'};return _0x1c104b;})});}_0x363035=_[_0xae8f('0x3f')]({},_0x363035,_0x30415[_0xae8f('0x43')]);return _0x58d9e0[_0xae8f('0x66')](_0x363035);}})[_0xae8f('0x27')](function(_0x203114){if(_0x203114){_0x2ca2e6=_0x203114[_0xae8f('0x38')];if(!_0x30415[_0xae8f('0x33')][_0xae8f('0x39')](_0xae8f('0x5b'))){_0x363035['limit']=qs[_0xae8f('0x1f')](_0x30415['query'][_0xae8f('0x1f')]);_0x363035[_0xae8f('0x1d')]=qs[_0xae8f('0x1d')](_0x30415[_0xae8f('0x33')]['offset']);}return _0x58d9e0['getTeams'](_0x363035);}})[_0xae8f('0x27')](function(_0x5da201){if(_0x5da201){return _0x5da201?{'count':_0x2ca2e6,'rows':_0x5da201}:null;}})['then'](respondWithResult(_0x3b4200,null))[_0xae8f('0x4b')](handleError(_0x3b4200,null));};exports[_0xae8f('0x67')]=function(_0x4f1732,_0x5e6b33,_0x5da2f7){var _0x51e316=_0x4f1732[_0xae8f('0x4d')][_0xae8f('0x68')];return db[_0xae8f('0x69')]['findAll']({'where':{'id':_0x51e316},'attributes':['id'],'include':[{'model':db[_0xae8f('0x6a')],'as':_0xae8f('0x6b'),'attributes':['id','name','online',_0xae8f('0x6c'),_0xae8f('0x6d')],'raw':!![]}]})[_0xae8f('0x27')](function(_0x556dd9){if(_0x556dd9){var _0x207771=_[_0xae8f('0x6e')](_0x556dd9,function(_0xab7f66){var _0x52929c=_0xab7f66[_0xae8f('0x4e')]({'plain':!![]});return _0x52929c[_0xae8f('0x6b')];});return db[_0xae8f('0x2f')][_0xae8f('0x4a')]({'where':{'id':_0x4f1732[_0xae8f('0x56')]['id']}})[_0xae8f('0x27')](function(_0x4c56a1){return db['sequelize'][_0xae8f('0x6f')](function(_0x3cd2aa){return _0x4c56a1[_0xae8f('0x67')](_0x51e316,{'transaction':_0x3cd2aa})[_0xae8f('0x27')](function(){return BPromise['each'](_0x207771,function(_0x17310e){return db['UserOpenchannelQueue']['findOrCreate']({'where':{'UserId':_0x17310e['id'],'OpenchannelQueueId':_0x4f1732[_0xae8f('0x56')]['id']},'transaction':_0x3cd2aa});});})[_0xae8f('0x27')](function(){_0x207771['forEach'](function(_0x12801c){socket[_0xae8f('0x70')]('userOpenchannelQueue:save',{'UserId':_0x12801c['id'],'OpenchannelQueueId':_0x4c56a1['id']});});});});});}})['then'](respondWithStatusCode(_0x5e6b33,null))[_0xae8f('0x4b')](handleError(_0x5e6b33,null));};exports[_0xae8f('0x71')]=function(_0x5a4d66,_0x16303a,_0x2d78f9){return db[_0xae8f('0x69')][_0xae8f('0x45')]({'where':{'id':_0x5a4d66['query'][_0xae8f('0x68')]},'attributes':['id'],'include':[{'model':db[_0xae8f('0x6a')],'as':_0xae8f('0x6b'),'attributes':['id'],'raw':!![]}]})[_0xae8f('0x27')](handleEntityNotFound(_0x16303a,null))[_0xae8f('0x27')](function(_0x4e17e7){var _0xbc1001=_['map'](_0x4e17e7,'id');var _0x37f90d=[];var _0x577258=[];var _0x3fea2c=squel['select']();_0x3fea2c['field'](_0xae8f('0x72'))[_0xae8f('0x73')](_0xae8f('0x74'),'tq')[_0xae8f('0x75')](_0xae8f('0x76'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xae8f('0x3e')]('OpenchannelQueueId\x20=\x20?',_0x5a4d66[_0xae8f('0x56')]['id']);for(var _0x35d74a=0x0;_0x35d74a<_0x4e17e7[_0xae8f('0x38')];_0x35d74a+=0x1){let _0x58c3fe=_0x4e17e7[_0x35d74a];for(var _0x2f7b2d=0x0;_0x2f7b2d<_0x58c3fe['Agents'][_0xae8f('0x38')];_0x2f7b2d+=0x1){let _0x17946c=_0x58c3fe[_0xae8f('0x6b')][_0x2f7b2d];var _0xec7265=_0x3fea2c[_0xae8f('0x77')]();_0xec7265[_0xae8f('0x3e')](_0xae8f('0x78'),_0x17946c['id']);_0x577258[_0xae8f('0x79')](db[_0xae8f('0x7a')]['query'](_0xec7265[_0xae8f('0x7b')](),{'type':db['sequelize'][_0xae8f('0x7c')][_0xae8f('0x7d')]})[_0xae8f('0x27')](function(_0xbf5f64){if(_0xbf5f64[_0xae8f('0x38')]===0x1){return _0x17946c['id'];}else{var _0x411d08=_[_0xae8f('0x7e')](_['map'](_0xbf5f64,_0xae8f('0x7f')),function(_0x3b85df){return _['includes'](_0xbc1001,_0x3b85df);});if(_0x411d08){return _0x17946c['id'];}}}));}}return BPromise[_0xae8f('0x80')](_0x577258)[_0xae8f('0x27')](function(_0x26216f){_0x37f90d=_(_0x37f90d)[_0xae8f('0x81')](_0x26216f)[_0xae8f('0x82')]()[_0xae8f('0x83')]();return db[_0xae8f('0x2f')][_0xae8f('0x4a')]({'where':{'id':_0x5a4d66[_0xae8f('0x56')]['id']}})[_0xae8f('0x27')](function(_0x160a99){return db['sequelize'][_0xae8f('0x6f')](function(_0x42bf78){return _0x160a99[_0xae8f('0x71')](_0x5a4d66[_0xae8f('0x33')]['ids'],{'transaction':_0x42bf78})['then'](function(){if(!_[_0xae8f('0x84')](_0x37f90d)){return _0x160a99[_0xae8f('0x85')](_0x37f90d,{'transaction':_0x42bf78});}})[_0xae8f('0x27')](function(){_0x37f90d['forEach'](function(_0x2b9ebd){socket['emit']('userOpenchannelQueue:remove',{'UserId':_0x2b9ebd,'OpenchannelQueueId':_0x160a99['id']});});});});});});})[_0xae8f('0x27')](respondWithStatusCode(_0x16303a,null))[_0xae8f('0x4b')](handleError(_0x16303a,null));};exports['addAgents']=function(_0x59652c,_0x1f2583,_0x2cec90){return db[_0xae8f('0x2f')][_0xae8f('0x4a')]({'where':{'id':_0x59652c[_0xae8f('0x56')]['id']}})[_0xae8f('0x27')](handleEntityNotFound(_0x1f2583,null))['then'](function(_0x466378){if(_0x466378){return _0x466378[_0xae8f('0x86')](_0x59652c[_0xae8f('0x4d')][_0xae8f('0x68')],_[_0xae8f('0x87')](_0x59652c['body'],[_0xae8f('0x68'),'id'])||{})['spread'](function(_0x2c5f71){for(var _0x2e0e1f=0x0;_0x2e0e1f<_0x59652c[_0xae8f('0x4d')]['ids'][_0xae8f('0x38')];_0x2e0e1f+=0x1){socket[_0xae8f('0x70')]('userOpenchannelQueue:save',{'UserId':Number(_0x59652c['body']['ids'][_0x2e0e1f]),'OpenchannelQueueId':Number(_0x59652c[_0xae8f('0x56')]['id'])});}return _0x2c5f71;});}})['then'](respondWithResult(_0x1f2583,null))[_0xae8f('0x4b')](handleError(_0x1f2583,null));};exports[_0xae8f('0x85')]=function(_0x26e5c2,_0x595962,_0x51853b){return db['OpenchannelQueue']['find']({'where':{'id':_0x26e5c2[_0xae8f('0x56')]['id']}})[_0xae8f('0x27')](handleEntityNotFound(_0x595962,null))[_0xae8f('0x27')](function(_0x42b770){if(_0x42b770){return _0x42b770[_0xae8f('0x85')](_0x26e5c2['query'][_0xae8f('0x68')])[_0xae8f('0x27')](function(){if(_[_0xae8f('0x88')](_0x26e5c2[_0xae8f('0x33')][_0xae8f('0x68')])){for(var _0x1ba286=0x0;_0x1ba286<_0x26e5c2[_0xae8f('0x33')][_0xae8f('0x68')][_0xae8f('0x38')];_0x1ba286+=0x1){socket['emit']('userOpenchannelQueue:remove',{'UserId':Number(_0x26e5c2[_0xae8f('0x33')]['ids'][_0x1ba286]),'OpenchannelQueueId':Number(_0x26e5c2[_0xae8f('0x56')]['id'])});}}else{socket[_0xae8f('0x70')]('userOpenchannelQueue:remove',{'UserId':Number(_0x26e5c2[_0xae8f('0x33')][_0xae8f('0x68')]),'OpenchannelQueueId':Number(_0x26e5c2[_0xae8f('0x56')]['id'])});}});}})[_0xae8f('0x27')](respondWithStatusCode(_0x595962,null))['catch'](handleError(_0x595962,null));};exports['getAgents']=function(_0x3a6247,_0x4e5470,_0x9774e7){var _0x58b34c={};var _0x576be6={};var _0x21360c;var _0x5afe92;return db[_0xae8f('0x2f')]['findOne']({'where':{'id':_0x3a6247[_0xae8f('0x56')]['id']}})[_0xae8f('0x27')](handleEntityNotFound(_0x4e5470,null))[_0xae8f('0x27')](function(_0x169b9f){if(_0x169b9f){_0x21360c=_0x169b9f;_0x576be6[_0xae8f('0x32')]=_['keys'](db[_0xae8f('0x6a')]['rawAttributes']);_0x576be6['query']=_['keys'](_0x3a6247[_0xae8f('0x33')]);_0x576be6['filters']=_[_0xae8f('0x36')](_0x576be6[_0xae8f('0x32')],_0x576be6[_0xae8f('0x33')]);_0x58b34c[_0xae8f('0x37')]=_['intersection'](_0x576be6['model'],qs[_0xae8f('0x48')](_0x3a6247[_0xae8f('0x33')][_0xae8f('0x48')]));_0x58b34c[_0xae8f('0x37')]=_0x58b34c[_0xae8f('0x37')][_0xae8f('0x38')]?_0x58b34c[_0xae8f('0x37')]:_0x576be6[_0xae8f('0x32')];_0x58b34c[_0xae8f('0x3a')]=qs[_0xae8f('0x3b')](_0x3a6247[_0xae8f('0x33')][_0xae8f('0x3b')]);_0x58b34c['where']=qs[_0xae8f('0x35')](_['pick'](_0x3a6247[_0xae8f('0x33')],_0x576be6['filters']));if(_0x3a6247[_0xae8f('0x33')][_0xae8f('0x3d')]){_0x58b34c[_0xae8f('0x3e')]=_['merge'](_0x58b34c[_0xae8f('0x3e')],{'$or':_[_0xae8f('0x2e')](_0x58b34c[_0xae8f('0x37')],function(_0x51400e){var _0x3c13a7={};_0x3c13a7[_0x51400e]={'$like':'%'+_0x3a6247[_0xae8f('0x33')][_0xae8f('0x3d')]+'%'};return _0x3c13a7;})});}_0x58b34c=_['merge']({},_0x58b34c,_0x3a6247[_0xae8f('0x43')]);return _0x21360c[_0xae8f('0x89')](_0x58b34c);}})[_0xae8f('0x27')](function(_0x250cd8){if(_0x250cd8){_0x5afe92=_0x250cd8[_0xae8f('0x38')];if(!_0x3a6247[_0xae8f('0x33')]['hasOwnProperty'](_0xae8f('0x5b'))){_0x58b34c[_0xae8f('0x1f')]=qs[_0xae8f('0x1f')](_0x3a6247[_0xae8f('0x33')]['limit']);_0x58b34c[_0xae8f('0x1d')]=qs[_0xae8f('0x1d')](_0x3a6247[_0xae8f('0x33')]['offset']);}return _0x21360c[_0xae8f('0x89')](_0x58b34c);}})['then'](function(_0x200dad){if(_0x200dad){return _0x200dad?{'count':_0x5afe92,'rows':_0x200dad}:null;}})[_0xae8f('0x27')](respondWithResult(_0x4e5470,null))['catch'](handleError(_0x4e5470,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index 719c3a9..4687dd9 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 _0x0762=['update','remove','emit','hasOwnProperty','hook','exports','events','setMaxListeners','save'];(function(_0x3ccbbe,_0x2dd3a9){var _0x50344e=function(_0x1648f2){while(--_0x1648f2){_0x3ccbbe['push'](_0x3ccbbe['shift']());}};_0x50344e(++_0x2dd3a9);}(_0x0762,0x1d1));var _0x2076=function(_0x518e33,_0x5253a3){_0x518e33=_0x518e33-0x0;var _0x299619=_0x0762[_0x518e33];return _0x299619;};'use strict';var EventEmitter=require(_0x2076('0x0'));var OpenchannelQueue=require('../../mysqldb')['db']['OpenchannelQueue'];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x2076('0x1')](0x0);var events={'afterCreate':_0x2076('0x2'),'afterUpdate':_0x2076('0x3'),'afterDestroy':_0x2076('0x4')};function emitEvent(_0x53b001){return function(_0x313cc2,_0x2fe33b,_0x5ae731){OpenchannelQueueEvents[_0x2076('0x5')](_0x53b001+':'+_0x313cc2['id'],_0x313cc2);OpenchannelQueueEvents[_0x2076('0x5')](_0x53b001,_0x313cc2);_0x5ae731(null);};}for(var e in events){if(events[_0x2076('0x6')](e)){var event=events[e];OpenchannelQueue[_0x2076('0x7')](e,emitEvent(event));}}module[_0x2076('0x8')]=OpenchannelQueueEvents; \ No newline at end of file +var _0xe8a3=['hook','exports','events','../../mysqldb','OpenchannelQueue','setMaxListeners','save','update','remove','emit'];(function(_0xcfd49f,_0x1e13af){var _0x45d3c9=function(_0x2051dd){while(--_0x2051dd){_0xcfd49f['push'](_0xcfd49f['shift']());}};_0x45d3c9(++_0x1e13af);}(_0xe8a3,0xb6));var _0x3e8a=function(_0x245d76,_0x1c2c6f){_0x245d76=_0x245d76-0x0;var _0x4516f7=_0xe8a3[_0x245d76];return _0x4516f7;};'use strict';var EventEmitter=require(_0x3e8a('0x0'));var OpenchannelQueue=require(_0x3e8a('0x1'))['db'][_0x3e8a('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x3e8a('0x3')](0x0);var events={'afterCreate':_0x3e8a('0x4'),'afterUpdate':_0x3e8a('0x5'),'afterDestroy':_0x3e8a('0x6')};function emitEvent(_0x3b8ba0){return function(_0x317ea9,_0x1442f3,_0x5f05fa){OpenchannelQueueEvents[_0x3e8a('0x7')](_0x3b8ba0+':'+_0x317ea9['id'],_0x317ea9);OpenchannelQueueEvents[_0x3e8a('0x7')](_0x3b8ba0,_0x317ea9);_0x5f05fa(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelQueue[_0x3e8a('0x8')](e,emitEvent(event));}}module[_0x3e8a('0x9')]=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index 09b8f42..c21f339 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 _0x61c7=['lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueue.attributes','exports','define','OpenchannelQueue','openchannel_queues'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x61c7,0x1ad));var _0x761c=function(_0x3098ec,_0x179c9a){_0x3098ec=_0x3098ec-0x0;var _0x2d8589=_0x61c7[_0x3098ec];return _0x2d8589;};'use strict';var _=require(_0x761c('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x761c('0x1'));var moment=require(_0x761c('0x2'));var BPromise=require(_0x761c('0x3'));var rp=require(_0x761c('0x4'));var fs=require('fs');var path=require(_0x761c('0x5'));var rimraf=require(_0x761c('0x6'));var config=require(_0x761c('0x7'));var attributes=require(_0x761c('0x8'));module[_0x761c('0x9')]=function(_0x45b373,_0x22da9a){return _0x45b373[_0x761c('0xa')](_0x761c('0xb'),attributes,{'tableName':_0x761c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc823=['bluebird','request-promise','rimraf','./openchannelQueue.attributes','exports','define','OpenchannelQueue','openchannel_queues'];(function(_0x24fc9c,_0x2087b9){var _0x4ba5e0=function(_0x229ca6){while(--_0x229ca6){_0x24fc9c['push'](_0x24fc9c['shift']());}};_0x4ba5e0(++_0x2087b9);}(_0xc823,0x88));var _0x3c82=function(_0x8a21c3,_0x5161dc){_0x8a21c3=_0x8a21c3-0x0;var _0x334c17=_0xc823[_0x8a21c3];return _0x334c17;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x3c82('0x0'));var rp=require(_0x3c82('0x1'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3c82('0x2'));var config=require('../../config/environment');var attributes=require(_0x3c82('0x3'));module[_0x3c82('0x4')]=function(_0x32322b,_0x3e62d7){return _0x32322b[_0x3c82('0x5')](_0x3c82('0x6'),attributes,{'tableName':_0x3c82('0x7'),'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 a31d5d9..d23c48c 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 _0x8434=['redis','localhost','socket.io-emitter','register','request','then','info','request\x20sent','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','OpenchannelQueue,\x20%s,\x20%s','message','result','catch','GetOpenchannelQueue','OpenchannelQueue','findAll','options','raw','attributes','limit','map','include','model','debug','find','where','ShowOpenchannelQueue','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults'];(function(_0x10baf1,_0x21d520){var _0x2cc1d8=function(_0x5e91a8){while(--_0x5e91a8){_0x10baf1['push'](_0x10baf1['shift']());}};_0x2cc1d8(++_0x21d520);}(_0x8434,0x197));var _0x4843=function(_0x466afb,_0xd83e04){_0x466afb=_0x466afb-0x0;var _0x41b4b2=_0x8434[_0x466afb];return _0x41b4b2;};'use strict';var _=require(_0x4843('0x0'));var util=require(_0x4843('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x4843('0x2'));var fs=require('fs');var Redis=require(_0x4843('0x3'));var db=require(_0x4843('0x4'))['db'];var utils=require(_0x4843('0x5'));var logger=require(_0x4843('0x6'))(_0x4843('0x7'));var config=require(_0x4843('0x8'));var jayson=require(_0x4843('0x9'));var client=jayson[_0x4843('0xa')][_0x4843('0xb')]({'port':0x232a});config['redis']=_[_0x4843('0xc')](config[_0x4843('0xd')],{'host':_0x4843('0xe'),'port':0x18eb});var socket=require(_0x4843('0xf'))(new Redis(config['redis']));require('./openchannelQueue.socket')[_0x4843('0x10')](socket);function respondWithRpcPromise(_0x843b83,_0x3a4201,_0x37c0ac){return new BPromise(function(_0x173bcb,_0xa489ad){return client[_0x4843('0x11')](_0x843b83,_0x37c0ac)[_0x4843('0x12')](function(_0x4ef44b){logger[_0x4843('0x13')]('OpenchannelQueue,\x20%s,\x20%s',_0x3a4201,_0x4843('0x14'));logger['debug'](_0x4843('0x15'),_0x3a4201,_0x4843('0x14'),JSON[_0x4843('0x16')](_0x4ef44b));if(_0x4ef44b[_0x4843('0x17')]){if(_0x4ef44b[_0x4843('0x17')]['code']===0x1f4){logger['error'](_0x4843('0x18'),_0x3a4201,_0x4ef44b['error'][_0x4843('0x19')]);return _0xa489ad(_0x4ef44b['error'][_0x4843('0x19')]);}logger[_0x4843('0x17')]('OpenchannelQueue,\x20%s,\x20%s',_0x3a4201,_0x4ef44b[_0x4843('0x17')][_0x4843('0x19')]);return _0x173bcb(_0x4ef44b['error'][_0x4843('0x19')]);}else{logger[_0x4843('0x13')](_0x4843('0x18'),_0x3a4201,_0x4843('0x14'));_0x173bcb(_0x4ef44b[_0x4843('0x1a')][_0x4843('0x19')]);}})[_0x4843('0x1b')](function(_0x4a78a7){logger[_0x4843('0x17')](_0x4843('0x18'),_0x3a4201,_0x4a78a7);_0xa489ad(_0x4a78a7);});});}exports[_0x4843('0x1c')]=function(_0x31aa3d){var _0x24059a=this;return new Promise(function(_0x407128,_0x2b6662){return db[_0x4843('0x1d')][_0x4843('0x1e')]({'raw':_0x31aa3d[_0x4843('0x1f')]?_0x31aa3d['options'][_0x4843('0x20')]===undefined?!![]:![]:!![],'where':_0x31aa3d[_0x4843('0x1f')]?_0x31aa3d[_0x4843('0x1f')]['where']||null:null,'attributes':_0x31aa3d[_0x4843('0x1f')]?_0x31aa3d[_0x4843('0x1f')][_0x4843('0x21')]||null:null,'limit':_0x31aa3d[_0x4843('0x1f')]?_0x31aa3d[_0x4843('0x1f')][_0x4843('0x22')]||null:null,'include':_0x31aa3d[_0x4843('0x1f')]?_0x31aa3d[_0x4843('0x1f')]['include']?_[_0x4843('0x23')](_0x31aa3d[_0x4843('0x1f')][_0x4843('0x24')],function(_0x5ab4a3){return{'model':db[_0x5ab4a3[_0x4843('0x25')]],'as':_0x5ab4a3['as'],'attributes':_0x5ab4a3[_0x4843('0x21')],'include':_0x5ab4a3[_0x4843('0x24')]?_[_0x4843('0x23')](_0x5ab4a3[_0x4843('0x24')],function(_0x190365){return{'model':db[_0x190365[_0x4843('0x25')]],'as':_0x190365['as'],'attributes':_0x190365['attributes'],'include':_0x190365[_0x4843('0x24')]?_['map'](_0x190365[_0x4843('0x24')],function(_0x593b9e){return{'model':db[_0x593b9e[_0x4843('0x25')]],'as':_0x593b9e['as'],'attributes':_0x593b9e['attributes']};}):[]};}):[]};}):[]:[]})[_0x4843('0x12')](function(_0x5cd402){logger[_0x4843('0x13')](_0x4843('0x1c'),_0x31aa3d);logger[_0x4843('0x26')]('GetOpenchannelQueue',_0x31aa3d,JSON[_0x4843('0x16')](_0x5cd402));_0x407128(_0x5cd402);})[_0x4843('0x1b')](function(_0x47a40e){logger['error'](_0x4843('0x1c'),_0x47a40e[_0x4843('0x19')],_0x31aa3d);_0x2b6662(_0x24059a['error'](0x1f4,_0x47a40e[_0x4843('0x19')]));});});};exports['ShowOpenchannelQueue']=function(_0x181c69){var _0x47ea46=this;return new Promise(function(_0x2ebd52,_0x5c9074){return db[_0x4843('0x1d')][_0x4843('0x27')]({'raw':_0x181c69[_0x4843('0x1f')]?_0x181c69['options']['raw']===undefined?!![]:![]:!![],'where':_0x181c69['options']?_0x181c69[_0x4843('0x1f')][_0x4843('0x28')]||null:null,'attributes':_0x181c69[_0x4843('0x1f')]?_0x181c69['options'][_0x4843('0x21')]||null:null,'include':_0x181c69[_0x4843('0x1f')]?_0x181c69[_0x4843('0x1f')][_0x4843('0x24')]?_[_0x4843('0x23')](_0x181c69[_0x4843('0x1f')][_0x4843('0x24')],function(_0x375223){return{'model':db[_0x375223[_0x4843('0x25')]],'as':_0x375223['as'],'attributes':_0x375223[_0x4843('0x21')],'include':_0x375223[_0x4843('0x24')]?_['map'](_0x375223[_0x4843('0x24')],function(_0xd70253){return{'model':db[_0xd70253[_0x4843('0x25')]],'as':_0xd70253['as'],'attributes':_0xd70253[_0x4843('0x21')],'include':_0xd70253[_0x4843('0x24')]?_['map'](_0xd70253[_0x4843('0x24')],function(_0x1a89e9){return{'model':db[_0x1a89e9[_0x4843('0x25')]],'as':_0x1a89e9['as'],'attributes':_0x1a89e9[_0x4843('0x21')]};}):[]};}):[]};}):[]:[]})[_0x4843('0x12')](function(_0x183ab1){logger['info']('ShowOpenchannelQueue',_0x181c69);logger['debug']('ShowOpenchannelQueue',_0x181c69,JSON[_0x4843('0x16')](_0x183ab1));_0x2ebd52(_0x183ab1);})[_0x4843('0x1b')](function(_0x1ff3c3){logger['error'](_0x4843('0x29'),_0x1ff3c3[_0x4843('0x19')],_0x181c69);_0x5c9074(_0x47ea46[_0x4843('0x17')](0x1f4,_0x1ff3c3[_0x4843('0x19')]));});});}; \ No newline at end of file +var _0xbe11=['info','result','catch','OpenchannelQueue','options','where','attributes','limit','include','map','model','then','GetOpenchannelQueue','stringify','ShowOpenchannelQueue','find','raw','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./openchannelQueue.socket','request','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','OpenchannelQueue,\x20%s,\x20%s','message'];(function(_0x4f96ab,_0x5e25c3){var _0x5e9a29=function(_0x45684c){while(--_0x45684c){_0x4f96ab['push'](_0x4f96ab['shift']());}};_0x5e9a29(++_0x5e25c3);}(_0xbe11,0xfb));var _0x1be1=function(_0x22b323,_0x459102){_0x22b323=_0x22b323-0x0;var _0x2e0229=_0xbe11[_0x22b323];return _0x2e0229;};'use strict';var _=require('lodash');var util=require(_0x1be1('0x0'));var moment=require('moment');var BPromise=require(_0x1be1('0x1'));var rs=require(_0x1be1('0x2'));var fs=require('fs');var Redis=require(_0x1be1('0x3'));var db=require(_0x1be1('0x4'))['db'];var utils=require(_0x1be1('0x5'));var logger=require(_0x1be1('0x6'))(_0x1be1('0x7'));var config=require(_0x1be1('0x8'));var jayson=require(_0x1be1('0x9'));var client=jayson[_0x1be1('0xa')]['http']({'port':0x232a});config[_0x1be1('0xb')]=_['defaults'](config[_0x1be1('0xb')],{'host':_0x1be1('0xc'),'port':0x18eb});var socket=require(_0x1be1('0xd'))(new Redis(config[_0x1be1('0xb')]));require(_0x1be1('0xe'))['register'](socket);function respondWithRpcPromise(_0x4355e2,_0x4e8f27,_0x47a381){return new BPromise(function(_0x24e380,_0x11aed1){return client[_0x1be1('0xf')](_0x4355e2,_0x47a381)['then'](function(_0x40c517){logger['info']('OpenchannelQueue,\x20%s,\x20%s',_0x4e8f27,'request\x20sent');logger[_0x1be1('0x10')](_0x1be1('0x11'),_0x4e8f27,_0x1be1('0x12'),JSON['stringify'](_0x40c517));if(_0x40c517['error']){if(_0x40c517[_0x1be1('0x13')]['code']===0x1f4){logger[_0x1be1('0x13')](_0x1be1('0x14'),_0x4e8f27,_0x40c517[_0x1be1('0x13')][_0x1be1('0x15')]);return _0x11aed1(_0x40c517[_0x1be1('0x13')][_0x1be1('0x15')]);}logger[_0x1be1('0x13')](_0x1be1('0x14'),_0x4e8f27,_0x40c517[_0x1be1('0x13')]['message']);return _0x24e380(_0x40c517[_0x1be1('0x13')][_0x1be1('0x15')]);}else{logger[_0x1be1('0x16')]('OpenchannelQueue,\x20%s,\x20%s',_0x4e8f27,_0x1be1('0x12'));_0x24e380(_0x40c517[_0x1be1('0x17')][_0x1be1('0x15')]);}})[_0x1be1('0x18')](function(_0x347373){logger[_0x1be1('0x13')](_0x1be1('0x14'),_0x4e8f27,_0x347373);_0x11aed1(_0x347373);});});}exports['GetOpenchannelQueue']=function(_0x21da26){var _0x352633=this;return new Promise(function(_0x316fc0,_0x394ffe){return db[_0x1be1('0x19')]['findAll']({'raw':_0x21da26[_0x1be1('0x1a')]?_0x21da26[_0x1be1('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x21da26[_0x1be1('0x1a')]?_0x21da26[_0x1be1('0x1a')][_0x1be1('0x1b')]||null:null,'attributes':_0x21da26[_0x1be1('0x1a')]?_0x21da26['options'][_0x1be1('0x1c')]||null:null,'limit':_0x21da26[_0x1be1('0x1a')]?_0x21da26[_0x1be1('0x1a')][_0x1be1('0x1d')]||null:null,'include':_0x21da26[_0x1be1('0x1a')]?_0x21da26['options'][_0x1be1('0x1e')]?_['map'](_0x21da26['options'][_0x1be1('0x1e')],function(_0x1359fb){return{'model':db[_0x1359fb['model']],'as':_0x1359fb['as'],'attributes':_0x1359fb[_0x1be1('0x1c')],'include':_0x1359fb['include']?_['map'](_0x1359fb[_0x1be1('0x1e')],function(_0x25fe30){return{'model':db[_0x25fe30['model']],'as':_0x25fe30['as'],'attributes':_0x25fe30[_0x1be1('0x1c')],'include':_0x25fe30[_0x1be1('0x1e')]?_[_0x1be1('0x1f')](_0x25fe30['include'],function(_0x499040){return{'model':db[_0x499040[_0x1be1('0x20')]],'as':_0x499040['as'],'attributes':_0x499040[_0x1be1('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x1be1('0x21')](function(_0x430e8c){logger[_0x1be1('0x16')](_0x1be1('0x22'),_0x21da26);logger[_0x1be1('0x10')](_0x1be1('0x22'),_0x21da26,JSON[_0x1be1('0x23')](_0x430e8c));_0x316fc0(_0x430e8c);})['catch'](function(_0x48b3ab){logger[_0x1be1('0x13')]('GetOpenchannelQueue',_0x48b3ab[_0x1be1('0x15')],_0x21da26);_0x394ffe(_0x352633[_0x1be1('0x13')](0x1f4,_0x48b3ab[_0x1be1('0x15')]));});});};exports[_0x1be1('0x24')]=function(_0x42f44c){var _0x46b31c=this;return new Promise(function(_0xb61219,_0x6c7650){return db[_0x1be1('0x19')][_0x1be1('0x25')]({'raw':_0x42f44c[_0x1be1('0x1a')]?_0x42f44c[_0x1be1('0x1a')][_0x1be1('0x26')]===undefined?!![]:![]:!![],'where':_0x42f44c[_0x1be1('0x1a')]?_0x42f44c[_0x1be1('0x1a')][_0x1be1('0x1b')]||null:null,'attributes':_0x42f44c[_0x1be1('0x1a')]?_0x42f44c['options'][_0x1be1('0x1c')]||null:null,'include':_0x42f44c[_0x1be1('0x1a')]?_0x42f44c['options']['include']?_[_0x1be1('0x1f')](_0x42f44c[_0x1be1('0x1a')][_0x1be1('0x1e')],function(_0x57d94f){return{'model':db[_0x57d94f[_0x1be1('0x20')]],'as':_0x57d94f['as'],'attributes':_0x57d94f[_0x1be1('0x1c')],'include':_0x57d94f['include']?_['map'](_0x57d94f['include'],function(_0x3bb3b1){return{'model':db[_0x3bb3b1['model']],'as':_0x3bb3b1['as'],'attributes':_0x3bb3b1[_0x1be1('0x1c')],'include':_0x3bb3b1[_0x1be1('0x1e')]?_[_0x1be1('0x1f')](_0x3bb3b1[_0x1be1('0x1e')],function(_0x5cafd4){return{'model':db[_0x5cafd4[_0x1be1('0x20')]],'as':_0x5cafd4['as'],'attributes':_0x5cafd4[_0x1be1('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3fcc21){logger[_0x1be1('0x16')](_0x1be1('0x24'),_0x42f44c);logger[_0x1be1('0x10')](_0x1be1('0x24'),_0x42f44c,JSON['stringify'](_0x3fcc21));_0xb61219(_0x3fcc21);})[_0x1be1('0x18')](function(_0xc293ac){logger[_0x1be1('0x13')]('ShowOpenchannelQueue',_0xc293ac[_0x1be1('0x15')],_0x42f44c);_0x6c7650(_0x46b31c[_0x1be1('0x13')](0x1f4,_0xc293ac['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index b404124..b4ac5a4 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 _0x9897=['update','emit','removeListener','length','openchannelQueue:','./openchannelQueue.events','save','remove'];(function(_0x2f8255,_0x44ff85){var _0x2207f6=function(_0x30c5c2){while(--_0x30c5c2){_0x2f8255['push'](_0x2f8255['shift']());}};_0x2207f6(++_0x44ff85);}(_0x9897,0xc5));var _0x7989=function(_0x4d8ed9,_0x2ae284){_0x4d8ed9=_0x4d8ed9-0x0;var _0x1e2140=_0x9897[_0x4d8ed9];return _0x1e2140;};'use strict';var OpenchannelQueueEvents=require(_0x7989('0x0'));var events=[_0x7989('0x1'),_0x7989('0x2'),_0x7989('0x3')];function createListener(_0x15e5c0,_0x22fead){return function(_0x2bd955){_0x22fead[_0x7989('0x4')](_0x15e5c0,_0x2bd955);};}function removeListener(_0x1dbcb6,_0x368211){return function(){OpenchannelQueueEvents[_0x7989('0x5')](_0x1dbcb6,_0x368211);};}exports['register']=function(_0x4ca49d){for(var _0x20696e=0x0,_0x5340cc=events[_0x7989('0x6')];_0x20696e<_0x5340cc;_0x20696e++){var _0x5c3547=events[_0x20696e];var _0x243ba9=createListener(_0x7989('0x7')+_0x5c3547,_0x4ca49d);OpenchannelQueueEvents['on'](_0x5c3547,_0x243ba9);}}; \ No newline at end of file +var _0x088d=['save','remove','update','emit','register','length','openchannelQueue:'];(function(_0x1d7d00,_0x12c726){var _0x5e4e1b=function(_0x47405e){while(--_0x47405e){_0x1d7d00['push'](_0x1d7d00['shift']());}};_0x5e4e1b(++_0x12c726);}(_0x088d,0x10a));var _0xd088=function(_0xaeb4ff,_0x57fd90){_0xaeb4ff=_0xaeb4ff-0x0;var _0x4e65d1=_0x088d[_0xaeb4ff];return _0x4e65d1;};'use strict';var OpenchannelQueueEvents=require('./openchannelQueue.events');var events=[_0xd088('0x0'),_0xd088('0x1'),_0xd088('0x2')];function createListener(_0x594618,_0x13f910){return function(_0x247fbd){_0x13f910[_0xd088('0x3')](_0x594618,_0x247fbd);};}function removeListener(_0x4d5e7e,_0x5b9f35){return function(){OpenchannelQueueEvents['removeListener'](_0x4d5e7e,_0x5b9f35);};}exports[_0xd088('0x4')]=function(_0x443d15){for(var _0x1ac91d=0x0,_0xb2d3c0=events[_0xd088('0x5')];_0x1ac91d<_0xb2d3c0;_0x1ac91d++){var _0x4cc159=events[_0x1ac91d];var _0x4264fd=createListener(_0xd088('0x6')+_0x4cc159,_0x443d15);OpenchannelQueueEvents['on'](_0x4cc159,_0x4264fd);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index 53c6431..e6ed787 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 _0x8f73=['./openchannelQueueReport.controller','get','index','/describe','isAuthenticated','describe','/:id','post','create','put','delete','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x4fbba2,_0xc4dde5){var _0x36569b=function(_0x46d1e6){while(--_0x46d1e6){_0x4fbba2['push'](_0x4fbba2['shift']());}};_0x36569b(++_0xc4dde5);}(_0x8f73,0x1e6));var _0x38f7=function(_0x550d12,_0x5384bd){_0x550d12=_0x550d12-0x0;var _0x12103d=_0x8f73[_0x550d12];return _0x12103d;};'use strict';var multer=require(_0x38f7('0x0'));var util=require(_0x38f7('0x1'));var path=require(_0x38f7('0x2'));var timeout=require(_0x38f7('0x3'));var express=require(_0x38f7('0x4'));var router=express['Router']();var fs_extra=require(_0x38f7('0x5'));var auth=require(_0x38f7('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x38f7('0x7'));var controller=require(_0x38f7('0x8'));router[_0x38f7('0x9')]('/',auth['isAuthenticated'](),controller[_0x38f7('0xa')]);router[_0x38f7('0x9')](_0x38f7('0xb'),auth[_0x38f7('0xc')](),controller[_0x38f7('0xd')]);router[_0x38f7('0x9')](_0x38f7('0xe'),auth['isAuthenticated'](),controller['show']);router[_0x38f7('0xf')]('/',auth['isAuthenticated'](),controller[_0x38f7('0x10')]);router[_0x38f7('0x11')](_0x38f7('0xe'),auth[_0x38f7('0xc')](),controller['update']);router[_0x38f7('0x12')](_0x38f7('0xe'),auth[_0x38f7('0xc')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x43b5=['isAuthenticated','index','describe','/:id','show','post','create','put','update','destroy','exports','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x4a5340,_0x155f02){var _0x1711b9=function(_0x50a407){while(--_0x50a407){_0x4a5340['push'](_0x4a5340['shift']());}};_0x1711b9(++_0x155f02);}(_0x43b5,0x128));var _0x543b=function(_0x127169,_0x2c1f50){_0x127169=_0x127169-0x0;var _0x58e9aa=_0x43b5[_0x127169];return _0x58e9aa;};'use strict';var multer=require('multer');var util=require(_0x543b('0x0'));var path=require(_0x543b('0x1'));var timeout=require(_0x543b('0x2'));var express=require(_0x543b('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x543b('0x4'));var interaction=require(_0x543b('0x5'));var config=require(_0x543b('0x6'));var controller=require('./openchannelQueueReport.controller');router[_0x543b('0x7')]('/',auth[_0x543b('0x8')](),controller[_0x543b('0x9')]);router[_0x543b('0x7')]('/describe',auth['isAuthenticated'](),controller[_0x543b('0xa')]);router['get'](_0x543b('0xb'),auth[_0x543b('0x8')](),controller[_0x543b('0xc')]);router[_0x543b('0xd')]('/',auth[_0x543b('0x8')](),controller[_0x543b('0xe')]);router[_0x543b('0xf')](_0x543b('0xb'),auth['isAuthenticated'](),controller[_0x543b('0x10')]);router['delete'](_0x543b('0xb'),auth['isAuthenticated'](),controller[_0x543b('0x11')]);module[_0x543b('0x12')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index b8614c3..1f6bc82 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 _0xfe9d=['STRING','DATE','moment','sequelize','exports'];(function(_0x4aaa10,_0x1dd1d3){var _0x23202d=function(_0x4fc131){while(--_0x4fc131){_0x4aaa10['push'](_0x4aaa10['shift']());}};_0x23202d(++_0x1dd1d3);}(_0xfe9d,0x1a1));var _0xdfe9=function(_0x1a6b00,_0x18f4d6){_0x1a6b00=_0x1a6b00-0x0;var _0x5dbb28=_0xfe9d[_0x1a6b00];return _0x5dbb28;};'use strict';var moment=require(_0xdfe9('0x0'));var Sequelize=require(_0xdfe9('0x1'));module[_0xdfe9('0x2')]={'uniqueid':{'type':Sequelize[_0xdfe9('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xdfe9('0x3')]},'joinAt':{'type':Sequelize[_0xdfe9('0x4')]},'leaveAt':{'type':Sequelize[_0xdfe9('0x4')]},'acceptAt':{'type':Sequelize[_0xdfe9('0x4')]},'exitAt':{'type':Sequelize[_0xdfe9('0x4')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xca2a=['STRING','DATE','moment','sequelize','exports'];(function(_0x404b9a,_0xca0480){var _0x30ba61=function(_0x1cdde1){while(--_0x1cdde1){_0x404b9a['push'](_0x404b9a['shift']());}};_0x30ba61(++_0xca0480);}(_0xca2a,0x8e));var _0xaca2=function(_0x5347c4,_0x1fec40){_0x5347c4=_0x5347c4-0x0;var _0x3b888c=_0xca2a[_0x5347c4];return _0x3b888c;};'use strict';var moment=require(_0xaca2('0x0'));var Sequelize=require(_0xaca2('0x1'));module[_0xaca2('0x2')]={'uniqueid':{'type':Sequelize[_0xaca2('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xaca2('0x3')]},'joinAt':{'type':Sequelize[_0xaca2('0x4')]},'leaveAt':{'type':Sequelize[_0xaca2('0x4')]},'acceptAt':{'type':Sequelize[_0xaca2('0x4')]},'exitAt':{'type':Sequelize[_0xaca2('0x4')]},'reason':{'type':Sequelize[_0xaca2('0x3')]}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index bdb2127..e63509a 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 _0x4be4=['papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','sendStatus','error','stack','name','map','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','OpenchannelQueueReport','findAll','rows','show','params','includeAll','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','lodash','squel','crypto','jsforce','querystring'];(function(_0x5f2ed0,_0xaf721b){var _0x4f2eed=function(_0x251648){while(--_0x251648){_0x5f2ed0['push'](_0x5f2ed0['shift']());}};_0x4f2eed(++_0xaf721b);}(_0x4be4,0x168));var _0x44be=function(_0x28cde3,_0x5d4fc6){_0x28cde3=_0x28cde3-0x0;var _0x2dba45=_0x4be4[_0x28cde3];return _0x2dba45;};'use strict';var emlformat=require(_0x44be('0x0'));var rimraf=require(_0x44be('0x1'));var zipdir=require(_0x44be('0x2'));var jsonpatch=require(_0x44be('0x3'));var rp=require(_0x44be('0x4'));var moment=require(_0x44be('0x5'));var BPromise=require(_0x44be('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x44be('0x7'));var sox=require(_0x44be('0x8'));var csv=require(_0x44be('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x44be('0xa'));var squel=require(_0x44be('0xb'));var crypto=require(_0x44be('0xc'));var jsforce=require(_0x44be('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x44be('0xe'));var Papa=require(_0x44be('0xf'));var Redis=require('ioredis');var authService=require(_0x44be('0x10'));var qs=require(_0x44be('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x44be('0x12'));var logger=require(_0x44be('0x13'))(_0x44be('0x14'));var utils=require(_0x44be('0x15'));var config=require(_0x44be('0x16'));var licenseUtil=require(_0x44be('0x17'));var db=require(_0x44be('0x18'))['db'];function respondWithStatusCode(_0x4596ca,_0x155636){_0x155636=_0x155636||0xcc;return function(_0x427552){if(_0x427552){return _0x4596ca['sendStatus'](_0x155636);}return _0x4596ca[_0x44be('0x19')](_0x155636)[_0x44be('0x1a')]();};}function respondWithResult(_0x418ab4,_0x44985f){_0x44985f=_0x44985f||0xc8;return function(_0x37039d){if(_0x37039d){return _0x418ab4['status'](_0x44985f)[_0x44be('0x1b')](_0x37039d);}};}function respondWithFilteredResult(_0x5891eb,_0x3ab5d6){return function(_0x20943c){if(_0x20943c){var _0x592205=typeof _0x3ab5d6[_0x44be('0x1c')]===_0x44be('0x1d')&&typeof _0x3ab5d6[_0x44be('0x1e')]===_0x44be('0x1d');var _0xa1e8dc=_0x20943c['count'];var _0x14dad5=_0x592205?0x0:_0x3ab5d6[_0x44be('0x1c')];var _0x472609=_0x592205?_0x20943c[_0x44be('0x1f')]:_0x3ab5d6['offset']+_0x3ab5d6[_0x44be('0x1e')];var _0x567440;if(_0x472609>=_0xa1e8dc){_0x472609=_0xa1e8dc;_0x567440=0xc8;}else{_0x567440=0xce;}_0x5891eb['status'](_0x567440);return _0x5891eb[_0x44be('0x20')](_0x44be('0x21'),_0x14dad5+'-'+_0x472609+'/'+_0xa1e8dc)[_0x44be('0x1b')](_0x20943c);}return null;};}function patchUpdates(_0x3bb892){return function(_0x1c7219){try{jsonpatch[_0x44be('0x22')](_0x1c7219,_0x3bb892,!![]);}catch(_0x8afb2e){return BPromise[_0x44be('0x23')](_0x8afb2e);}return _0x1c7219['save']();};}function saveUpdates(_0x371b1a,_0x410acb){return function(_0x3797a1){if(_0x3797a1){return _0x3797a1[_0x44be('0x24')](_0x371b1a)[_0x44be('0x25')](function(_0x4fceea){return _0x4fceea;});}return null;};}function removeEntity(_0x4c1313,_0x5d9406){return function(_0x5eb665){if(_0x5eb665){return _0x5eb665[_0x44be('0x26')]()[_0x44be('0x25')](function(){_0x4c1313[_0x44be('0x19')](0xcc)[_0x44be('0x1a')]();});}};}function handleEntityNotFound(_0x4e62fb,_0x13ead4){return function(_0x47c1e5){if(!_0x47c1e5){_0x4e62fb[_0x44be('0x27')](0x194);}return _0x47c1e5;};}function handleError(_0x407042,_0x157809){_0x157809=_0x157809||0x1f4;return function(_0x3214aa){logger[_0x44be('0x28')](_0x3214aa[_0x44be('0x29')]);if(_0x3214aa[_0x44be('0x2a')]){delete _0x3214aa[_0x44be('0x2a')];}_0x407042[_0x44be('0x19')](_0x157809)['send'](_0x3214aa);};}exports['index']=function(_0x13db24,_0x5be5af){var _0x184fab={},_0x19f758={},_0x2f1918={'count':0x0,'rows':[]};var _0x2a0e7f=_[_0x44be('0x2b')](db['OpenchannelQueueReport'][_0x44be('0x2c')],function(_0x12e090){return{'name':_0x12e090[_0x44be('0x2d')],'type':_0x12e090[_0x44be('0x2e')]['key']};});_0x19f758[_0x44be('0x2f')]=_[_0x44be('0x2b')](_0x2a0e7f,'name');_0x19f758['query']=_[_0x44be('0x30')](_0x13db24[_0x44be('0x31')]);_0x19f758[_0x44be('0x32')]=_[_0x44be('0x33')](_0x19f758['model'],_0x19f758[_0x44be('0x31')]);_0x184fab[_0x44be('0x34')]=_[_0x44be('0x33')](_0x19f758[_0x44be('0x2f')],qs[_0x44be('0x35')](_0x13db24[_0x44be('0x31')][_0x44be('0x35')]));_0x184fab['attributes']=_0x184fab[_0x44be('0x34')][_0x44be('0x36')]?_0x184fab[_0x44be('0x34')]:_0x19f758[_0x44be('0x2f')];if(!_0x13db24[_0x44be('0x31')][_0x44be('0x37')]('nolimit')){_0x184fab[_0x44be('0x1e')]=qs[_0x44be('0x1e')](_0x13db24[_0x44be('0x31')][_0x44be('0x1e')]);_0x184fab['offset']=qs['offset'](_0x13db24['query'][_0x44be('0x1c')]);}_0x184fab[_0x44be('0x38')]=qs[_0x44be('0x39')](_0x13db24['query'][_0x44be('0x39')]);_0x184fab[_0x44be('0x3a')]=qs[_0x44be('0x32')](_[_0x44be('0x3b')](_0x13db24['query'],_0x19f758[_0x44be('0x32')]),_0x2a0e7f);if(_0x13db24[_0x44be('0x31')][_0x44be('0x3c')]){_0x184fab[_0x44be('0x3a')]=_[_0x44be('0x3d')](_0x184fab[_0x44be('0x3a')],{'$or':_[_0x44be('0x2b')](_0x2a0e7f,function(_0x35c7a3){if(_0x35c7a3[_0x44be('0x2e')]!==_0x44be('0x3e')){var _0xe36dba={};_0xe36dba[_0x35c7a3[_0x44be('0x2a')]]={'$like':'%'+_0x13db24[_0x44be('0x31')][_0x44be('0x3c')]+'%'};return _0xe36dba;}})});}_0x184fab=_[_0x44be('0x3d')]({},_0x184fab,_0x13db24[_0x44be('0x3f')]);var _0x38834c={'where':_0x184fab[_0x44be('0x3a')]};return db[_0x44be('0x40')][_0x44be('0x1f')](_0x38834c)[_0x44be('0x25')](function(_0x3c03a6){_0x2f1918[_0x44be('0x1f')]=_0x3c03a6;if(_0x13db24[_0x44be('0x31')]['includeAll']){_0x184fab['include']=[{'all':!![]}];}return db[_0x44be('0x40')][_0x44be('0x41')](_0x184fab);})[_0x44be('0x25')](function(_0x3fa0c4){_0x2f1918[_0x44be('0x42')]=_0x3fa0c4;return _0x2f1918;})['then'](respondWithFilteredResult(_0x5be5af,_0x184fab))['catch'](handleError(_0x5be5af,null));};exports[_0x44be('0x43')]=function(_0xd1b1ad,_0x2a0a39){var _0x145645={'raw':!![],'where':{'id':_0xd1b1ad[_0x44be('0x44')]['id']}},_0x590187={};_0x590187[_0x44be('0x2f')]=_[_0x44be('0x30')](db[_0x44be('0x40')][_0x44be('0x2c')]);_0x590187['query']=_[_0x44be('0x30')](_0xd1b1ad[_0x44be('0x31')]);_0x590187['filters']=_[_0x44be('0x33')](_0x590187[_0x44be('0x2f')],_0x590187[_0x44be('0x31')]);_0x145645['attributes']=_[_0x44be('0x33')](_0x590187[_0x44be('0x2f')],qs[_0x44be('0x35')](_0xd1b1ad[_0x44be('0x31')][_0x44be('0x35')]));_0x145645[_0x44be('0x34')]=_0x145645['attributes'][_0x44be('0x36')]?_0x145645[_0x44be('0x34')]:_0x590187[_0x44be('0x2f')];if(_0xd1b1ad[_0x44be('0x31')][_0x44be('0x45')]){_0x145645['include']=[{'all':!![]}];}_0x145645=_[_0x44be('0x3d')]({},_0x145645,_0xd1b1ad['options']);return db['OpenchannelQueueReport'][_0x44be('0x46')](_0x145645)[_0x44be('0x25')](handleEntityNotFound(_0x2a0a39,null))[_0x44be('0x25')](respondWithResult(_0x2a0a39,null))[_0x44be('0x47')](handleError(_0x2a0a39,null));};exports[_0x44be('0x48')]=function(_0xb98a65,_0x1c4c17){return db[_0x44be('0x40')][_0x44be('0x48')](_0xb98a65[_0x44be('0x49')],{})[_0x44be('0x25')](respondWithResult(_0x1c4c17,0xc9))['catch'](handleError(_0x1c4c17,null));};exports['update']=function(_0x18af1b,_0x13ca44){if(_0x18af1b[_0x44be('0x49')]['id']){delete _0x18af1b[_0x44be('0x49')]['id'];}return db[_0x44be('0x40')][_0x44be('0x46')]({'where':{'id':_0x18af1b[_0x44be('0x44')]['id']}})[_0x44be('0x25')](handleEntityNotFound(_0x13ca44,null))[_0x44be('0x25')](saveUpdates(_0x18af1b[_0x44be('0x49')],null))[_0x44be('0x25')](respondWithResult(_0x13ca44,null))[_0x44be('0x47')](handleError(_0x13ca44,null));};exports[_0x44be('0x26')]=function(_0x5dd4da,_0x3ea877){return db[_0x44be('0x40')]['find']({'where':{'id':_0x5dd4da[_0x44be('0x44')]['id']}})[_0x44be('0x25')](handleEntityNotFound(_0x3ea877,null))[_0x44be('0x25')](removeEntity(_0x3ea877,null))[_0x44be('0x47')](handleError(_0x3ea877,null));};exports['describe']=function(_0x3ce32d,_0x3c46e8){return db[_0x44be('0x40')][_0x44be('0x4a')]()['then'](respondWithResult(_0x3c46e8,null))[_0x44be('0x47')](handleError(_0x3c46e8,null));}; \ No newline at end of file +var _0xe89f=['sort','pick','filter','merge','where','map','VIRTUAL','count','includeAll','rows','catch','show','params','include','options','find','create','body','update','describe','eml-format','rimraf','zip-dir','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','offset','limit','set','Content-Range','json','save','then','destroy','error','stack','name','index','OpenchannelQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order'];(function(_0x523b03,_0xe7acc6){var _0x54f539=function(_0x226723){while(--_0x226723){_0x523b03['push'](_0x523b03['shift']());}};_0x54f539(++_0xe7acc6);}(_0xe89f,0x1ca));var _0xfe89=function(_0x229fce,_0x7f7a29){_0x229fce=_0x229fce-0x0;var _0x23005a=_0xe89f[_0x229fce];return _0x23005a;};'use strict';var emlformat=require(_0xfe89('0x0'));var rimraf=require(_0xfe89('0x1'));var zipdir=require(_0xfe89('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xfe89('0x3'));var BPromise=require(_0xfe89('0x4'));var Mustache=require('mustache');var util=require(_0xfe89('0x5'));var path=require(_0xfe89('0x6'));var sox=require(_0xfe89('0x7'));var csv=require(_0xfe89('0x8'));var ejs=require(_0xfe89('0x9'));var fs=require('fs');var fs_extra=require(_0xfe89('0xa'));var _=require(_0xfe89('0xb'));var squel=require(_0xfe89('0xc'));var crypto=require('crypto');var jsforce=require(_0xfe89('0xd'));var deskjs=require(_0xfe89('0xe'));var toCsv=require(_0xfe89('0x8'));var querystring=require(_0xfe89('0xf'));var Papa=require(_0xfe89('0x10'));var Redis=require(_0xfe89('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xfe89('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfe89('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xfe89('0x14'));var config=require(_0xfe89('0x15'));var licenseUtil=require(_0xfe89('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x522da6,_0x2cb5b9){_0x2cb5b9=_0x2cb5b9||0xcc;return function(_0x22a011){if(_0x22a011){return _0x522da6[_0xfe89('0x17')](_0x2cb5b9);}return _0x522da6['status'](_0x2cb5b9)[_0xfe89('0x18')]();};}function respondWithResult(_0xde2121,_0xb24c61){_0xb24c61=_0xb24c61||0xc8;return function(_0x4e6518){if(_0x4e6518){return _0xde2121[_0xfe89('0x19')](_0xb24c61)['json'](_0x4e6518);}};}function respondWithFilteredResult(_0x185021,_0x4ede5a){return function(_0x119392){if(_0x119392){var _0x1198a6=typeof _0x4ede5a[_0xfe89('0x1a')]==='undefined'&&typeof _0x4ede5a[_0xfe89('0x1b')]==='undefined';var _0xb12aa3=_0x119392['count'];var _0x6fe797=_0x1198a6?0x0:_0x4ede5a[_0xfe89('0x1a')];var _0x6b8379=_0x1198a6?_0x119392['count']:_0x4ede5a[_0xfe89('0x1a')]+_0x4ede5a[_0xfe89('0x1b')];var _0x168167;if(_0x6b8379>=_0xb12aa3){_0x6b8379=_0xb12aa3;_0x168167=0xc8;}else{_0x168167=0xce;}_0x185021[_0xfe89('0x19')](_0x168167);return _0x185021[_0xfe89('0x1c')](_0xfe89('0x1d'),_0x6fe797+'-'+_0x6b8379+'/'+_0xb12aa3)[_0xfe89('0x1e')](_0x119392);}return null;};}function patchUpdates(_0x22d32c){return function(_0x32f478){try{jsonpatch['apply'](_0x32f478,_0x22d32c,!![]);}catch(_0x1b6e55){return BPromise['reject'](_0x1b6e55);}return _0x32f478[_0xfe89('0x1f')]();};}function saveUpdates(_0x2e1b70,_0x4be9c1){return function(_0x5db6bc){if(_0x5db6bc){return _0x5db6bc['update'](_0x2e1b70)[_0xfe89('0x20')](function(_0x219e06){return _0x219e06;});}return null;};}function removeEntity(_0x365438,_0x94010b){return function(_0x11da2e){if(_0x11da2e){return _0x11da2e[_0xfe89('0x21')]()[_0xfe89('0x20')](function(){_0x365438['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1a9987,_0x4fe53d){return function(_0x4e4f14){if(!_0x4e4f14){_0x1a9987[_0xfe89('0x17')](0x194);}return _0x4e4f14;};}function handleError(_0x45bcdb,_0x5783eb){_0x5783eb=_0x5783eb||0x1f4;return function(_0x1cfdcc){logger[_0xfe89('0x22')](_0x1cfdcc[_0xfe89('0x23')]);if(_0x1cfdcc[_0xfe89('0x24')]){delete _0x1cfdcc[_0xfe89('0x24')];}_0x45bcdb[_0xfe89('0x19')](_0x5783eb)['send'](_0x1cfdcc);};}exports[_0xfe89('0x25')]=function(_0x3316f8,_0xaa7850){var _0x415213={},_0x260c1a={},_0x204ada={'count':0x0,'rows':[]};var _0x59ebac=_['map'](db[_0xfe89('0x26')][_0xfe89('0x27')],function(_0x256a38){return{'name':_0x256a38[_0xfe89('0x28')],'type':_0x256a38[_0xfe89('0x29')][_0xfe89('0x2a')]};});_0x260c1a[_0xfe89('0x2b')]=_['map'](_0x59ebac,_0xfe89('0x24'));_0x260c1a[_0xfe89('0x2c')]=_[_0xfe89('0x2d')](_0x3316f8['query']);_0x260c1a[_0xfe89('0x2e')]=_[_0xfe89('0x2f')](_0x260c1a['model'],_0x260c1a[_0xfe89('0x2c')]);_0x415213['attributes']=_[_0xfe89('0x2f')](_0x260c1a[_0xfe89('0x2b')],qs[_0xfe89('0x30')](_0x3316f8[_0xfe89('0x2c')][_0xfe89('0x30')]));_0x415213[_0xfe89('0x31')]=_0x415213[_0xfe89('0x31')][_0xfe89('0x32')]?_0x415213[_0xfe89('0x31')]:_0x260c1a[_0xfe89('0x2b')];if(!_0x3316f8[_0xfe89('0x2c')]['hasOwnProperty'](_0xfe89('0x33'))){_0x415213['limit']=qs[_0xfe89('0x1b')](_0x3316f8['query'][_0xfe89('0x1b')]);_0x415213[_0xfe89('0x1a')]=qs[_0xfe89('0x1a')](_0x3316f8[_0xfe89('0x2c')][_0xfe89('0x1a')]);}_0x415213[_0xfe89('0x34')]=qs[_0xfe89('0x35')](_0x3316f8[_0xfe89('0x2c')][_0xfe89('0x35')]);_0x415213['where']=qs[_0xfe89('0x2e')](_[_0xfe89('0x36')](_0x3316f8[_0xfe89('0x2c')],_0x260c1a[_0xfe89('0x2e')]),_0x59ebac);if(_0x3316f8[_0xfe89('0x2c')][_0xfe89('0x37')]){_0x415213['where']=_[_0xfe89('0x38')](_0x415213[_0xfe89('0x39')],{'$or':_[_0xfe89('0x3a')](_0x59ebac,function(_0x2f310c){if(_0x2f310c[_0xfe89('0x29')]!==_0xfe89('0x3b')){var _0x55b9a8={};_0x55b9a8[_0x2f310c['name']]={'$like':'%'+_0x3316f8[_0xfe89('0x2c')][_0xfe89('0x37')]+'%'};return _0x55b9a8;}})});}_0x415213=_[_0xfe89('0x38')]({},_0x415213,_0x3316f8['options']);var _0x20827a={'where':_0x415213['where']};return db[_0xfe89('0x26')][_0xfe89('0x3c')](_0x20827a)[_0xfe89('0x20')](function(_0x261a56){_0x204ada['count']=_0x261a56;if(_0x3316f8['query'][_0xfe89('0x3d')]){_0x415213['include']=[{'all':!![]}];}return db[_0xfe89('0x26')]['findAll'](_0x415213);})[_0xfe89('0x20')](function(_0xb58b99){_0x204ada[_0xfe89('0x3e')]=_0xb58b99;return _0x204ada;})['then'](respondWithFilteredResult(_0xaa7850,_0x415213))[_0xfe89('0x3f')](handleError(_0xaa7850,null));};exports[_0xfe89('0x40')]=function(_0x25d1ff,_0x1adba4){var _0x49b3bb={'raw':!![],'where':{'id':_0x25d1ff[_0xfe89('0x41')]['id']}},_0x4671f6={};_0x4671f6[_0xfe89('0x2b')]=_[_0xfe89('0x2d')](db['OpenchannelQueueReport'][_0xfe89('0x27')]);_0x4671f6[_0xfe89('0x2c')]=_[_0xfe89('0x2d')](_0x25d1ff[_0xfe89('0x2c')]);_0x4671f6[_0xfe89('0x2e')]=_[_0xfe89('0x2f')](_0x4671f6['model'],_0x4671f6[_0xfe89('0x2c')]);_0x49b3bb[_0xfe89('0x31')]=_[_0xfe89('0x2f')](_0x4671f6[_0xfe89('0x2b')],qs[_0xfe89('0x30')](_0x25d1ff['query']['fields']));_0x49b3bb[_0xfe89('0x31')]=_0x49b3bb[_0xfe89('0x31')][_0xfe89('0x32')]?_0x49b3bb[_0xfe89('0x31')]:_0x4671f6[_0xfe89('0x2b')];if(_0x25d1ff['query']['includeAll']){_0x49b3bb[_0xfe89('0x42')]=[{'all':!![]}];}_0x49b3bb=_['merge']({},_0x49b3bb,_0x25d1ff[_0xfe89('0x43')]);return db[_0xfe89('0x26')][_0xfe89('0x44')](_0x49b3bb)[_0xfe89('0x20')](handleEntityNotFound(_0x1adba4,null))[_0xfe89('0x20')](respondWithResult(_0x1adba4,null))[_0xfe89('0x3f')](handleError(_0x1adba4,null));};exports[_0xfe89('0x45')]=function(_0x3a2ce8,_0xce49d0){return db[_0xfe89('0x26')][_0xfe89('0x45')](_0x3a2ce8[_0xfe89('0x46')],{})[_0xfe89('0x20')](respondWithResult(_0xce49d0,0xc9))['catch'](handleError(_0xce49d0,null));};exports[_0xfe89('0x47')]=function(_0x145174,_0x5aa663){if(_0x145174[_0xfe89('0x46')]['id']){delete _0x145174[_0xfe89('0x46')]['id'];}return db[_0xfe89('0x26')][_0xfe89('0x44')]({'where':{'id':_0x145174[_0xfe89('0x41')]['id']}})[_0xfe89('0x20')](handleEntityNotFound(_0x5aa663,null))[_0xfe89('0x20')](saveUpdates(_0x145174[_0xfe89('0x46')],null))['then'](respondWithResult(_0x5aa663,null))[_0xfe89('0x3f')](handleError(_0x5aa663,null));};exports[_0xfe89('0x21')]=function(_0x25bcbb,_0x155a33){return db[_0xfe89('0x26')][_0xfe89('0x44')]({'where':{'id':_0x25bcbb[_0xfe89('0x41')]['id']}})[_0xfe89('0x20')](handleEntityNotFound(_0x155a33,null))['then'](removeEntity(_0x155a33,null))[_0xfe89('0x3f')](handleError(_0x155a33,null));};exports[_0xfe89('0x48')]=function(_0x1841d1,_0x56faa5){return db[_0xfe89('0x26')][_0xfe89('0x48')]()[_0xfe89('0x20')](respondWithResult(_0x56faa5,null))[_0xfe89('0x3f')](handleError(_0x56faa5,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index 7c7fc89..817bba6 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 _0x5fc3=['util','api','moment','bluebird','request-promise','path','../../config/environment','./openchannelQueueReport.attributes','exports','define','report_openchannel_queue','uniqueid','lodash'];(function(_0x42abed,_0x4bca02){var _0x2dcbf0=function(_0x5eb843){while(--_0x5eb843){_0x42abed['push'](_0x42abed['shift']());}};_0x2dcbf0(++_0x4bca02);}(_0x5fc3,0xa8));var _0x35fc=function(_0x403c20,_0x4a7b99){_0x403c20=_0x403c20-0x0;var _0x2b271a=_0x5fc3[_0x403c20];return _0x2b271a;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var logger=require('../../config/logger')(_0x35fc('0x2'));var moment=require(_0x35fc('0x3'));var BPromise=require(_0x35fc('0x4'));var rp=require(_0x35fc('0x5'));var fs=require('fs');var path=require(_0x35fc('0x6'));var rimraf=require('rimraf');var config=require(_0x35fc('0x7'));var attributes=require(_0x35fc('0x8'));module[_0x35fc('0x9')]=function(_0x5b85ad,_0x5754be){return _0x5b85ad[_0x35fc('0xa')]('OpenchannelQueueReport',attributes,{'tableName':_0x35fc('0xb'),'paranoid':![],'indexes':[{'name':_0x35fc('0xc'),'fields':[_0x35fc('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc4aa=['bluebird','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue','lodash','util','../../config/logger','api','moment'];(function(_0x50377b,_0x2f4a9f){var _0x55e6b7=function(_0x22e0b3){while(--_0x22e0b3){_0x50377b['push'](_0x50377b['shift']());}};_0x55e6b7(++_0x2f4a9f);}(_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/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index 0402555..a519729 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 _0xf7b4=['OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','OpenchannelQueueReport,\x20%s,\x20%s','message','result','catch','OpenchannelQueueReport','create','body','options','then','CreateOpenchannelQueueReport','UpdateOpenchannelQueueReport','update','raw','attributes','limit','lodash','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug'];(function(_0xb09cb8,_0x13f7ce){var _0x235e64=function(_0x2aa4e7){while(--_0x2aa4e7){_0xb09cb8['push'](_0xb09cb8['shift']());}};_0x235e64(++_0x13f7ce);}(_0xf7b4,0x152));var _0x4f7b=function(_0x542d87,_0x3f1428){_0x542d87=_0x542d87-0x0;var _0x18f154=_0xf7b4[_0x542d87];return _0x18f154;};'use strict';var _=require(_0x4f7b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x4f7b('0x1'));var rs=require(_0x4f7b('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4f7b('0x3'));var logger=require(_0x4f7b('0x4'))(_0x4f7b('0x5'));var config=require(_0x4f7b('0x6'));var jayson=require(_0x4f7b('0x7'));var client=jayson[_0x4f7b('0x8')][_0x4f7b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3ad135,_0x173784,_0x351036){return new BPromise(function(_0x36ea9c,_0x3ef6e1){return client[_0x4f7b('0xa')](_0x3ad135,_0x351036)['then'](function(_0x433563){logger[_0x4f7b('0xb')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x173784,_0x4f7b('0xc'));logger[_0x4f7b('0xd')](_0x4f7b('0xe'),_0x173784,_0x4f7b('0xc'),JSON[_0x4f7b('0xf')](_0x433563));if(_0x433563['error']){if(_0x433563[_0x4f7b('0x10')]['code']===0x1f4){logger['error'](_0x4f7b('0x11'),_0x173784,_0x433563[_0x4f7b('0x10')][_0x4f7b('0x12')]);return _0x3ef6e1(_0x433563[_0x4f7b('0x10')]['message']);}logger[_0x4f7b('0x10')](_0x4f7b('0x11'),_0x173784,_0x433563[_0x4f7b('0x10')][_0x4f7b('0x12')]);return _0x36ea9c(_0x433563[_0x4f7b('0x10')][_0x4f7b('0x12')]);}else{logger[_0x4f7b('0xb')](_0x4f7b('0x11'),_0x173784,_0x4f7b('0xc'));_0x36ea9c(_0x433563[_0x4f7b('0x13')][_0x4f7b('0x12')]);}})[_0x4f7b('0x14')](function(_0x50a161){logger[_0x4f7b('0x10')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x173784,_0x50a161);_0x3ef6e1(_0x50a161);});});}exports['CreateOpenchannelQueueReport']=function(_0x24e5cf){var _0x3813da=this;return new Promise(function(_0x519d90,_0x2b34c9){return db[_0x4f7b('0x15')][_0x4f7b('0x16')](_0x24e5cf[_0x4f7b('0x17')],{'raw':_0x24e5cf['options']?_0x24e5cf[_0x4f7b('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x4f7b('0x19')](function(_0x12374b){logger[_0x4f7b('0xb')](_0x4f7b('0x1a'),_0x24e5cf);logger[_0x4f7b('0xd')](_0x4f7b('0x1a'),_0x24e5cf,JSON[_0x4f7b('0xf')](_0x12374b));_0x519d90(_0x12374b);})[_0x4f7b('0x14')](function(_0x2a8b50){logger['error'](_0x4f7b('0x1a'),_0x2a8b50[_0x4f7b('0x12')],_0x24e5cf);_0x2b34c9(_0x3813da[_0x4f7b('0x10')](0x1f4,_0x2a8b50['message']));});});};exports[_0x4f7b('0x1b')]=function(_0x4610a4){var _0x5d22f4=this;return new Promise(function(_0x15dbec,_0x59ec24){return db[_0x4f7b('0x15')][_0x4f7b('0x1c')](_0x4610a4[_0x4f7b('0x17')],{'raw':_0x4610a4[_0x4f7b('0x18')]?_0x4610a4[_0x4f7b('0x18')][_0x4f7b('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4610a4[_0x4f7b('0x18')]?_0x4610a4[_0x4f7b('0x18')]['where']||null:null,'attributes':_0x4610a4[_0x4f7b('0x18')]?_0x4610a4[_0x4f7b('0x18')][_0x4f7b('0x1e')]||null:null,'limit':_0x4610a4['options']?_0x4610a4[_0x4f7b('0x18')][_0x4f7b('0x1f')]||null:null})[_0x4f7b('0x19')](function(_0x3a56ff){logger[_0x4f7b('0xb')]('UpdateOpenchannelQueueReport',_0x4610a4);logger[_0x4f7b('0xd')](_0x4f7b('0x1b'),_0x4610a4,JSON[_0x4f7b('0xf')](_0x3a56ff));_0x15dbec(_0x3a56ff);})['catch'](function(_0x7de561){logger['error']('UpdateOpenchannelQueueReport',_0x7de561[_0x4f7b('0x12')],_0x4610a4);_0x59ec24(_0x5d22f4['error'](0x1f4,_0x7de561[_0x4f7b('0x12')]));});});}; \ No newline at end of file +var _0xcae2=['where','attributes','UpdateOpenchannelQueueReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','options','raw','then','stringify','update','body'];(function(_0x2d0411,_0x517e4f){var _0x4b128a=function(_0x347e00){while(--_0x347e00){_0x2d0411['push'](_0x2d0411['shift']());}};_0x4b128a(++_0x517e4f);}(_0xcae2,0x143));var _0x2cae=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xcae2[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x2cae('0x0'));var util=require(_0x2cae('0x1'));var moment=require(_0x2cae('0x2'));var BPromise=require(_0x2cae('0x3'));var rs=require(_0x2cae('0x4'));var fs=require('fs');var Redis=require(_0x2cae('0x5'));var db=require(_0x2cae('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x2cae('0x7'))(_0x2cae('0x8'));var config=require(_0x2cae('0x9'));var jayson=require(_0x2cae('0xa'));var client=jayson['client'][_0x2cae('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1feff6,_0x1e1a3d,_0x25b6a2){return new BPromise(function(_0x2e7498,_0x49e1d1){return client['request'](_0x1feff6,_0x25b6a2)['then'](function(_0x49f0d3){logger[_0x2cae('0xc')](_0x2cae('0xd'),_0x1e1a3d,_0x2cae('0xe'));logger[_0x2cae('0xf')](_0x2cae('0x10'),_0x1e1a3d,_0x2cae('0xe'),JSON['stringify'](_0x49f0d3));if(_0x49f0d3[_0x2cae('0x11')]){if(_0x49f0d3['error'][_0x2cae('0x12')]===0x1f4){logger[_0x2cae('0x11')](_0x2cae('0xd'),_0x1e1a3d,_0x49f0d3[_0x2cae('0x11')][_0x2cae('0x13')]);return _0x49e1d1(_0x49f0d3[_0x2cae('0x11')]['message']);}logger[_0x2cae('0x11')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x1e1a3d,_0x49f0d3[_0x2cae('0x11')][_0x2cae('0x13')]);return _0x2e7498(_0x49f0d3['error'][_0x2cae('0x13')]);}else{logger[_0x2cae('0xc')](_0x2cae('0xd'),_0x1e1a3d,_0x2cae('0xe'));_0x2e7498(_0x49f0d3['result'][_0x2cae('0x13')]);}})[_0x2cae('0x14')](function(_0x4a89e1){logger[_0x2cae('0x11')](_0x2cae('0xd'),_0x1e1a3d,_0x4a89e1);_0x49e1d1(_0x4a89e1);});});}exports[_0x2cae('0x15')]=function(_0xe6314f){var _0x2813b1=this;return new Promise(function(_0x164aee,_0x398290){return db[_0x2cae('0x16')]['create'](_0xe6314f['body'],{'raw':_0xe6314f[_0x2cae('0x17')]?_0xe6314f[_0x2cae('0x17')][_0x2cae('0x18')]===undefined?!![]:![]:!![]})[_0x2cae('0x19')](function(_0x2f4f5c){logger[_0x2cae('0xc')](_0x2cae('0x15'),_0xe6314f);logger['debug']('CreateOpenchannelQueueReport',_0xe6314f,JSON[_0x2cae('0x1a')](_0x2f4f5c));_0x164aee(_0x2f4f5c);})[_0x2cae('0x14')](function(_0x5d800e){logger['error']('CreateOpenchannelQueueReport',_0x5d800e[_0x2cae('0x13')],_0xe6314f);_0x398290(_0x2813b1[_0x2cae('0x11')](0x1f4,_0x5d800e['message']));});});};exports['UpdateOpenchannelQueueReport']=function(_0x309ae3){var _0x1c8063=this;return new Promise(function(_0x407324,_0x2fdc92){return db[_0x2cae('0x16')][_0x2cae('0x1b')](_0x309ae3[_0x2cae('0x1c')],{'raw':_0x309ae3[_0x2cae('0x17')]?_0x309ae3[_0x2cae('0x17')][_0x2cae('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x309ae3[_0x2cae('0x17')]?_0x309ae3[_0x2cae('0x17')][_0x2cae('0x1d')]||null:null,'attributes':_0x309ae3[_0x2cae('0x17')]?_0x309ae3[_0x2cae('0x17')][_0x2cae('0x1e')]||null:null,'limit':_0x309ae3['options']?_0x309ae3['options']['limit']||null:null})['then'](function(_0x7d5421){logger[_0x2cae('0xc')](_0x2cae('0x1f'),_0x309ae3);logger[_0x2cae('0xf')]('UpdateOpenchannelQueueReport',_0x309ae3,JSON[_0x2cae('0x1a')](_0x7d5421));_0x407324(_0x7d5421);})[_0x2cae('0x14')](function(_0xd53da6){logger['error'](_0x2cae('0x1f'),_0xd53da6['message'],_0x309ae3);_0x2fdc92(_0x1c8063[_0x2cae('0x11')](0x1f4,_0xd53da6['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index 27e9bbb..a69a218 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 _0x808a=['../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post','create','put','update','delete','multer','util','Router','fs-extra'];(function(_0x23e9e5,_0x262b98){var _0x4d643c=function(_0x1699de){while(--_0x1699de){_0x23e9e5['push'](_0x23e9e5['shift']());}};_0x4d643c(++_0x262b98);}(_0x808a,0x178));var _0xa808=function(_0x36940e,_0x11f338){_0x36940e=_0x36940e-0x0;var _0x3283f2=_0x808a[_0x36940e];return _0x3283f2;};'use strict';var multer=require(_0xa808('0x0'));var util=require(_0xa808('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa808('0x2')]();var fs_extra=require(_0xa808('0x3'));var auth=require(_0xa808('0x4'));var interaction=require(_0xa808('0x5'));var config=require(_0xa808('0x6'));var controller=require(_0xa808('0x7'));router[_0xa808('0x8')]('/',auth[_0xa808('0x9')](),controller[_0xa808('0xa')]);router[_0xa808('0x8')](_0xa808('0xb'),auth['isAuthenticated'](),controller[_0xa808('0xc')]);router[_0xa808('0x8')](_0xa808('0xd'),auth[_0xa808('0x9')](),controller['show']);router[_0xa808('0xe')]('/',auth[_0xa808('0x9')](),controller[_0xa808('0xf')]);router[_0xa808('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xa808('0x11')]);router[_0xa808('0x12')](_0xa808('0xd'),auth[_0xa808('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xa156=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','describe','/:id','show','post','create','put','destroy'];(function(_0x72a33d,_0x5691da){var _0x2621d5=function(_0x95b7c6){while(--_0x95b7c6){_0x72a33d['push'](_0x72a33d['shift']());}};_0x2621d5(++_0x5691da);}(_0xa156,0x140));var _0x6a15=function(_0x387ce2,_0x7b729a){_0x387ce2=_0x387ce2-0x0;var _0x3d2631=_0xa156[_0x387ce2];return _0x3d2631;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x6a15('0x0'));var express=require(_0x6a15('0x1'));var router=express[_0x6a15('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x6a15('0x3'));var interaction=require(_0x6a15('0x4'));var config=require(_0x6a15('0x5'));var controller=require(_0x6a15('0x6'));router[_0x6a15('0x7')]('/',auth[_0x6a15('0x8')](),controller['index']);router['get']('/describe',auth[_0x6a15('0x8')](),controller[_0x6a15('0x9')]);router[_0x6a15('0x7')](_0x6a15('0xa'),auth[_0x6a15('0x8')](),controller[_0x6a15('0xb')]);router[_0x6a15('0xc')]('/',auth[_0x6a15('0x8')](),controller[_0x6a15('0xd')]);router[_0x6a15('0xe')](_0x6a15('0xa'),auth[_0x6a15('0x8')](),controller['update']);router['delete'](_0x6a15('0xa'),auth[_0x6a15('0x8')](),controller[_0x6a15('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index de67f18..3073b81 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 _0x008c=['ENUM','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x4dcdfc,_0x11374f){var _0x25d086=function(_0x4e1141){while(--_0x4e1141){_0x4dcdfc['push'](_0x4dcdfc['shift']());}};_0x25d086(++_0x11374f);}(_0x008c,0x188));var _0xc008=function(_0x112e6a,_0x4dfc41){_0x112e6a=_0x112e6a-0x0;var _0x1b691b=_0x008c[_0x112e6a];return _0x1b691b;};'use strict';var moment=require(_0xc008('0x0'));var Sequelize=require(_0xc008('0x1'));module[_0xc008('0x2')]={'uniqueid':{'type':Sequelize[_0xc008('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xc008('0x4')]('account',_0xc008('0x5'),_0xc008('0x6')),'allowNull':![],'defaultValue':_0xc008('0x6')},'transferredAt':{'type':Sequelize[_0xc008('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xc008('0x8')]}}; \ No newline at end of file +var _0xa9e0=['account','queue','DATE','NOW','moment','sequelize','exports'];(function(_0x1f7909,_0x1aefbd){var _0x2cb51f=function(_0x37635b){while(--_0x37635b){_0x1f7909['push'](_0x1f7909['shift']());}};_0x2cb51f(++_0x1aefbd);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0xa9e0[_0x2cfb58];return _0xd99951;};'use strict';var moment=require(_0x0a9e('0x0'));var Sequelize=require(_0x0a9e('0x1'));module[_0x0a9e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x3'),'agent',_0x0a9e('0x4')),'allowNull':![],'defaultValue':_0x0a9e('0x4')},'transferredAt':{'type':Sequelize[_0x0a9e('0x5')],'allowNull':![],'defaultValue':Sequelize[_0x0a9e('0x6')]}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index d20973c..cea021b 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 _0x5f57=['find','create','body','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','sox','to-csv','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','count','offset','Content-Range','save','update','then','destroy','error','stack','name','send','OpenchannelTransferReport','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','limit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','length'];(function(_0x23bb5d,_0x3f6e11){var _0x5a88b3=function(_0xbd02b0){while(--_0xbd02b0){_0x23bb5d['push'](_0x23bb5d['shift']());}};_0x5a88b3(++_0x3f6e11);}(_0x5f57,0xdf));var _0x75f5=function(_0x3e6117,_0x445636){_0x3e6117=_0x3e6117-0x0;var _0x89111d=_0x5f57[_0x3e6117];return _0x89111d;};'use strict';var emlformat=require(_0x75f5('0x0'));var rimraf=require(_0x75f5('0x1'));var zipdir=require(_0x75f5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x75f5('0x3'));var moment=require(_0x75f5('0x4'));var BPromise=require(_0x75f5('0x5'));var Mustache=require('mustache');var util=require(_0x75f5('0x6'));var path=require('path');var sox=require(_0x75f5('0x7'));var csv=require(_0x75f5('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x75f5('0x9'));var squel=require(_0x75f5('0xa'));var crypto=require('crypto');var jsforce=require(_0x75f5('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x75f5('0xc'));var Papa=require(_0x75f5('0xd'));var Redis=require(_0x75f5('0xe'));var authService=require(_0x75f5('0xf'));var qs=require(_0x75f5('0x10'));var as=require(_0x75f5('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x75f5('0x12'))(_0x75f5('0x13'));var utils=require(_0x75f5('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x75f5('0x15'));var db=require(_0x75f5('0x16'))['db'];function respondWithStatusCode(_0x48734a,_0x4c3d80){_0x4c3d80=_0x4c3d80||0xcc;return function(_0xf9759){if(_0xf9759){return _0x48734a[_0x75f5('0x17')](_0x4c3d80);}return _0x48734a['status'](_0x4c3d80)[_0x75f5('0x18')]();};}function respondWithResult(_0x353dcb,_0x48d472){_0x48d472=_0x48d472||0xc8;return function(_0xee74b0){if(_0xee74b0){return _0x353dcb[_0x75f5('0x19')](_0x48d472)[_0x75f5('0x1a')](_0xee74b0);}};}function respondWithFilteredResult(_0x2ad441,_0x194442){return function(_0x47e17a){if(_0x47e17a){var _0x56e7ff=typeof _0x194442['offset']===_0x75f5('0x1b')&&typeof _0x194442['limit']===_0x75f5('0x1b');var _0x72ceb1=_0x47e17a[_0x75f5('0x1c')];var _0x91ef87=_0x56e7ff?0x0:_0x194442[_0x75f5('0x1d')];var _0x5076a5=_0x56e7ff?_0x47e17a[_0x75f5('0x1c')]:_0x194442[_0x75f5('0x1d')]+_0x194442['limit'];var _0x2e1bda;if(_0x5076a5>=_0x72ceb1){_0x5076a5=_0x72ceb1;_0x2e1bda=0xc8;}else{_0x2e1bda=0xce;}_0x2ad441[_0x75f5('0x19')](_0x2e1bda);return _0x2ad441['set'](_0x75f5('0x1e'),_0x91ef87+'-'+_0x5076a5+'/'+_0x72ceb1)[_0x75f5('0x1a')](_0x47e17a);}return null;};}function patchUpdates(_0x4b6034){return function(_0x32b156){try{jsonpatch['apply'](_0x32b156,_0x4b6034,!![]);}catch(_0x3d79f5){return BPromise['reject'](_0x3d79f5);}return _0x32b156[_0x75f5('0x1f')]();};}function saveUpdates(_0x509ea1,_0xbf0c88){return function(_0x42ab84){if(_0x42ab84){return _0x42ab84[_0x75f5('0x20')](_0x509ea1)[_0x75f5('0x21')](function(_0x16c612){return _0x16c612;});}return null;};}function removeEntity(_0x518f2e,_0x21cd29){return function(_0xdac329){if(_0xdac329){return _0xdac329[_0x75f5('0x22')]()['then'](function(){_0x518f2e[_0x75f5('0x19')](0xcc)[_0x75f5('0x18')]();});}};}function handleEntityNotFound(_0x3d7614,_0xb5dec4){return function(_0x30c560){if(!_0x30c560){_0x3d7614[_0x75f5('0x17')](0x194);}return _0x30c560;};}function handleError(_0x22ab0c,_0x439b3a){_0x439b3a=_0x439b3a||0x1f4;return function(_0x246e8b){logger[_0x75f5('0x23')](_0x246e8b[_0x75f5('0x24')]);if(_0x246e8b[_0x75f5('0x25')]){delete _0x246e8b[_0x75f5('0x25')];}_0x22ab0c[_0x75f5('0x19')](_0x439b3a)[_0x75f5('0x26')](_0x246e8b);};}exports['index']=function(_0x48f566,_0x30b9ef){var _0x27bc38={},_0x5a1cc4={},_0x165dcc={'count':0x0,'rows':[]};var _0x1686cf=_['map'](db[_0x75f5('0x27')]['rawAttributes'],function(_0x50cae8){return{'name':_0x50cae8[_0x75f5('0x28')],'type':_0x50cae8[_0x75f5('0x29')][_0x75f5('0x2a')]};});_0x5a1cc4[_0x75f5('0x2b')]=_[_0x75f5('0x2c')](_0x1686cf,'name');_0x5a1cc4[_0x75f5('0x2d')]=_['keys'](_0x48f566[_0x75f5('0x2d')]);_0x5a1cc4[_0x75f5('0x2e')]=_[_0x75f5('0x2f')](_0x5a1cc4[_0x75f5('0x2b')],_0x5a1cc4[_0x75f5('0x2d')]);_0x27bc38[_0x75f5('0x30')]=_['intersection'](_0x5a1cc4[_0x75f5('0x2b')],qs[_0x75f5('0x31')](_0x48f566[_0x75f5('0x2d')][_0x75f5('0x31')]));_0x27bc38[_0x75f5('0x30')]=_0x27bc38[_0x75f5('0x30')]['length']?_0x27bc38[_0x75f5('0x30')]:_0x5a1cc4['model'];if(!_0x48f566['query'][_0x75f5('0x32')]('nolimit')){_0x27bc38['limit']=qs[_0x75f5('0x33')](_0x48f566[_0x75f5('0x2d')][_0x75f5('0x33')]);_0x27bc38['offset']=qs[_0x75f5('0x1d')](_0x48f566[_0x75f5('0x2d')][_0x75f5('0x1d')]);}_0x27bc38[_0x75f5('0x34')]=qs['sort'](_0x48f566['query'][_0x75f5('0x35')]);_0x27bc38[_0x75f5('0x36')]=qs[_0x75f5('0x2e')](_['pick'](_0x48f566[_0x75f5('0x2d')],_0x5a1cc4[_0x75f5('0x2e')]),_0x1686cf);if(_0x48f566[_0x75f5('0x2d')][_0x75f5('0x37')]){_0x27bc38[_0x75f5('0x36')]=_[_0x75f5('0x38')](_0x27bc38[_0x75f5('0x36')],{'$or':_[_0x75f5('0x2c')](_0x1686cf,function(_0x3b8d2b){if(_0x3b8d2b['type']!==_0x75f5('0x39')){var _0x3327f3={};_0x3327f3[_0x3b8d2b[_0x75f5('0x25')]]={'$like':'%'+_0x48f566[_0x75f5('0x2d')][_0x75f5('0x37')]+'%'};return _0x3327f3;}})});}_0x27bc38=_[_0x75f5('0x38')]({},_0x27bc38,_0x48f566[_0x75f5('0x3a')]);var _0xbdec56={'where':_0x27bc38[_0x75f5('0x36')]};return db[_0x75f5('0x27')][_0x75f5('0x1c')](_0xbdec56)['then'](function(_0x3fe147){_0x165dcc[_0x75f5('0x1c')]=_0x3fe147;if(_0x48f566[_0x75f5('0x2d')][_0x75f5('0x3b')]){_0x27bc38[_0x75f5('0x3c')]=[{'all':!![]}];}return db[_0x75f5('0x27')][_0x75f5('0x3d')](_0x27bc38);})[_0x75f5('0x21')](function(_0x6183b0){_0x165dcc[_0x75f5('0x3e')]=_0x6183b0;return _0x165dcc;})[_0x75f5('0x21')](respondWithFilteredResult(_0x30b9ef,_0x27bc38))[_0x75f5('0x3f')](handleError(_0x30b9ef,null));};exports[_0x75f5('0x40')]=function(_0x52ba6a,_0x261225){var _0x5a959e={'raw':!![],'where':{'id':_0x52ba6a[_0x75f5('0x41')]['id']}},_0xcd6dfa={};_0xcd6dfa[_0x75f5('0x2b')]=_[_0x75f5('0x42')](db[_0x75f5('0x27')][_0x75f5('0x43')]);_0xcd6dfa[_0x75f5('0x2d')]=_['keys'](_0x52ba6a[_0x75f5('0x2d')]);_0xcd6dfa[_0x75f5('0x2e')]=_[_0x75f5('0x2f')](_0xcd6dfa[_0x75f5('0x2b')],_0xcd6dfa[_0x75f5('0x2d')]);_0x5a959e[_0x75f5('0x30')]=_[_0x75f5('0x2f')](_0xcd6dfa[_0x75f5('0x2b')],qs[_0x75f5('0x31')](_0x52ba6a[_0x75f5('0x2d')][_0x75f5('0x31')]));_0x5a959e['attributes']=_0x5a959e[_0x75f5('0x30')][_0x75f5('0x44')]?_0x5a959e[_0x75f5('0x30')]:_0xcd6dfa[_0x75f5('0x2b')];if(_0x52ba6a[_0x75f5('0x2d')][_0x75f5('0x3b')]){_0x5a959e['include']=[{'all':!![]}];}_0x5a959e=_['merge']({},_0x5a959e,_0x52ba6a[_0x75f5('0x3a')]);return db[_0x75f5('0x27')][_0x75f5('0x45')](_0x5a959e)[_0x75f5('0x21')](handleEntityNotFound(_0x261225,null))['then'](respondWithResult(_0x261225,null))[_0x75f5('0x3f')](handleError(_0x261225,null));};exports[_0x75f5('0x46')]=function(_0x13c950,_0x1d9afc){return db[_0x75f5('0x27')][_0x75f5('0x46')](_0x13c950['body'],{})[_0x75f5('0x21')](respondWithResult(_0x1d9afc,0xc9))[_0x75f5('0x3f')](handleError(_0x1d9afc,null));};exports[_0x75f5('0x20')]=function(_0x19e9e2,_0x44d832){if(_0x19e9e2[_0x75f5('0x47')]['id']){delete _0x19e9e2[_0x75f5('0x47')]['id'];}return db[_0x75f5('0x27')]['find']({'where':{'id':_0x19e9e2['params']['id']}})[_0x75f5('0x21')](handleEntityNotFound(_0x44d832,null))[_0x75f5('0x21')](saveUpdates(_0x19e9e2[_0x75f5('0x47')],null))[_0x75f5('0x21')](respondWithResult(_0x44d832,null))[_0x75f5('0x3f')](handleError(_0x44d832,null));};exports[_0x75f5('0x22')]=function(_0x956fdb,_0x34041d){return db[_0x75f5('0x27')][_0x75f5('0x45')]({'where':{'id':_0x956fdb['params']['id']}})[_0x75f5('0x21')](handleEntityNotFound(_0x34041d,null))[_0x75f5('0x21')](removeEntity(_0x34041d,null))[_0x75f5('0x3f')](handleError(_0x34041d,null));};exports[_0x75f5('0x48')]=function(_0x48901b,_0x1e8cf2){return db[_0x75f5('0x27')]['describe']()[_0x75f5('0x21')](respondWithResult(_0x1e8cf2,null))[_0x75f5('0x3f')](handleError(_0x1e8cf2,null));}; \ No newline at end of file +var _0xaa64=['update','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','then','destroy','sendStatus','error','stack','name','send','index','map','OpenchannelTransferReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','options','includeAll','include','rows','catch','show','params','find','create','body'];(function(_0x39a52e,_0x4e0f30){var _0x19bfaa=function(_0x51f101){while(--_0x51f101){_0x39a52e['push'](_0x39a52e['shift']());}};_0x19bfaa(++_0x4e0f30);}(_0xaa64,0x92));var _0x4aa6=function(_0x10197a,_0x5b7bb6){_0x10197a=_0x10197a-0x0;var _0x11ad2b=_0xaa64[_0x10197a];return _0x11ad2b;};'use strict';var emlformat=require(_0x4aa6('0x0'));var rimraf=require(_0x4aa6('0x1'));var zipdir=require(_0x4aa6('0x2'));var jsonpatch=require(_0x4aa6('0x3'));var rp=require(_0x4aa6('0x4'));var moment=require('moment');var BPromise=require(_0x4aa6('0x5'));var Mustache=require('mustache');var util=require(_0x4aa6('0x6'));var path=require('path');var sox=require(_0x4aa6('0x7'));var csv=require(_0x4aa6('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4aa6('0x9'));var _=require(_0x4aa6('0xa'));var squel=require(_0x4aa6('0xb'));var crypto=require(_0x4aa6('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x4aa6('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x4aa6('0xe'));var Redis=require(_0x4aa6('0xf'));var authService=require(_0x4aa6('0x10'));var qs=require(_0x4aa6('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4aa6('0x12'));var logger=require(_0x4aa6('0x13'))(_0x4aa6('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x27d106,_0x41a7db){_0x41a7db=_0x41a7db||0xcc;return function(_0x2b0f48){if(_0x2b0f48){return _0x27d106['sendStatus'](_0x41a7db);}return _0x27d106[_0x4aa6('0x15')](_0x41a7db)[_0x4aa6('0x16')]();};}function respondWithResult(_0x343818,_0x286e62){_0x286e62=_0x286e62||0xc8;return function(_0x58252d){if(_0x58252d){return _0x343818[_0x4aa6('0x15')](_0x286e62)['json'](_0x58252d);}};}function respondWithFilteredResult(_0x4ce466,_0x5ad3da){return function(_0x512590){if(_0x512590){var _0x186054=typeof _0x5ad3da[_0x4aa6('0x17')]===_0x4aa6('0x18')&&typeof _0x5ad3da[_0x4aa6('0x19')]===_0x4aa6('0x18');var _0xccc4d4=_0x512590[_0x4aa6('0x1a')];var _0x4275ae=_0x186054?0x0:_0x5ad3da[_0x4aa6('0x17')];var _0x36df8e=_0x186054?_0x512590[_0x4aa6('0x1a')]:_0x5ad3da[_0x4aa6('0x17')]+_0x5ad3da['limit'];var _0x11f0ab;if(_0x36df8e>=_0xccc4d4){_0x36df8e=_0xccc4d4;_0x11f0ab=0xc8;}else{_0x11f0ab=0xce;}_0x4ce466[_0x4aa6('0x15')](_0x11f0ab);return _0x4ce466[_0x4aa6('0x1b')](_0x4aa6('0x1c'),_0x4275ae+'-'+_0x36df8e+'/'+_0xccc4d4)[_0x4aa6('0x1d')](_0x512590);}return null;};}function patchUpdates(_0x47a26d){return function(_0xdcad5){try{jsonpatch[_0x4aa6('0x1e')](_0xdcad5,_0x47a26d,!![]);}catch(_0x1943cb){return BPromise['reject'](_0x1943cb);}return _0xdcad5['save']();};}function saveUpdates(_0x1956c1,_0x39c073){return function(_0x2ff736){if(_0x2ff736){return _0x2ff736['update'](_0x1956c1)[_0x4aa6('0x1f')](function(_0xad5c){return _0xad5c;});}return null;};}function removeEntity(_0x3e01cd,_0xeeacfa){return function(_0x18fa4f){if(_0x18fa4f){return _0x18fa4f[_0x4aa6('0x20')]()[_0x4aa6('0x1f')](function(){_0x3e01cd[_0x4aa6('0x15')](0xcc)[_0x4aa6('0x16')]();});}};}function handleEntityNotFound(_0x5c17e7,_0x47dfbc){return function(_0x5203d6){if(!_0x5203d6){_0x5c17e7[_0x4aa6('0x21')](0x194);}return _0x5203d6;};}function handleError(_0x1b7e9c,_0x23249a){_0x23249a=_0x23249a||0x1f4;return function(_0x4b4037){logger[_0x4aa6('0x22')](_0x4b4037[_0x4aa6('0x23')]);if(_0x4b4037[_0x4aa6('0x24')]){delete _0x4b4037[_0x4aa6('0x24')];}_0x1b7e9c['status'](_0x23249a)[_0x4aa6('0x25')](_0x4b4037);};}exports[_0x4aa6('0x26')]=function(_0x2b50f1,_0x2e4167){var _0x5aefb4={},_0x34c982={},_0x34291c={'count':0x0,'rows':[]};var _0x1394fc=_[_0x4aa6('0x27')](db[_0x4aa6('0x28')][_0x4aa6('0x29')],function(_0x3a54d5){return{'name':_0x3a54d5[_0x4aa6('0x2a')],'type':_0x3a54d5[_0x4aa6('0x2b')][_0x4aa6('0x2c')]};});_0x34c982[_0x4aa6('0x2d')]=_[_0x4aa6('0x27')](_0x1394fc,'name');_0x34c982[_0x4aa6('0x2e')]=_[_0x4aa6('0x2f')](_0x2b50f1[_0x4aa6('0x2e')]);_0x34c982['filters']=_[_0x4aa6('0x30')](_0x34c982[_0x4aa6('0x2d')],_0x34c982[_0x4aa6('0x2e')]);_0x5aefb4['attributes']=_['intersection'](_0x34c982[_0x4aa6('0x2d')],qs['fields'](_0x2b50f1[_0x4aa6('0x2e')][_0x4aa6('0x31')]));_0x5aefb4[_0x4aa6('0x32')]=_0x5aefb4['attributes'][_0x4aa6('0x33')]?_0x5aefb4[_0x4aa6('0x32')]:_0x34c982[_0x4aa6('0x2d')];if(!_0x2b50f1[_0x4aa6('0x2e')][_0x4aa6('0x34')]('nolimit')){_0x5aefb4[_0x4aa6('0x19')]=qs[_0x4aa6('0x19')](_0x2b50f1[_0x4aa6('0x2e')][_0x4aa6('0x19')]);_0x5aefb4[_0x4aa6('0x17')]=qs['offset'](_0x2b50f1[_0x4aa6('0x2e')][_0x4aa6('0x17')]);}_0x5aefb4[_0x4aa6('0x35')]=qs['sort'](_0x2b50f1[_0x4aa6('0x2e')][_0x4aa6('0x36')]);_0x5aefb4[_0x4aa6('0x37')]=qs[_0x4aa6('0x38')](_[_0x4aa6('0x39')](_0x2b50f1['query'],_0x34c982['filters']),_0x1394fc);if(_0x2b50f1['query'][_0x4aa6('0x3a')]){_0x5aefb4[_0x4aa6('0x37')]=_[_0x4aa6('0x3b')](_0x5aefb4[_0x4aa6('0x37')],{'$or':_[_0x4aa6('0x27')](_0x1394fc,function(_0x586470){if(_0x586470['type']!=='VIRTUAL'){var _0x2e755c={};_0x2e755c[_0x586470[_0x4aa6('0x24')]]={'$like':'%'+_0x2b50f1[_0x4aa6('0x2e')][_0x4aa6('0x3a')]+'%'};return _0x2e755c;}})});}_0x5aefb4=_[_0x4aa6('0x3b')]({},_0x5aefb4,_0x2b50f1[_0x4aa6('0x3c')]);var _0x365473={'where':_0x5aefb4[_0x4aa6('0x37')]};return db[_0x4aa6('0x28')][_0x4aa6('0x1a')](_0x365473)[_0x4aa6('0x1f')](function(_0x2e7d6d){_0x34291c[_0x4aa6('0x1a')]=_0x2e7d6d;if(_0x2b50f1[_0x4aa6('0x2e')][_0x4aa6('0x3d')]){_0x5aefb4[_0x4aa6('0x3e')]=[{'all':!![]}];}return db[_0x4aa6('0x28')]['findAll'](_0x5aefb4);})[_0x4aa6('0x1f')](function(_0x19cf02){_0x34291c[_0x4aa6('0x3f')]=_0x19cf02;return _0x34291c;})[_0x4aa6('0x1f')](respondWithFilteredResult(_0x2e4167,_0x5aefb4))[_0x4aa6('0x40')](handleError(_0x2e4167,null));};exports[_0x4aa6('0x41')]=function(_0x32cc54,_0x2d3e87){var _0x247a81={'raw':!![],'where':{'id':_0x32cc54[_0x4aa6('0x42')]['id']}},_0x3086f8={};_0x3086f8[_0x4aa6('0x2d')]=_[_0x4aa6('0x2f')](db[_0x4aa6('0x28')][_0x4aa6('0x29')]);_0x3086f8[_0x4aa6('0x2e')]=_[_0x4aa6('0x2f')](_0x32cc54['query']);_0x3086f8[_0x4aa6('0x38')]=_[_0x4aa6('0x30')](_0x3086f8[_0x4aa6('0x2d')],_0x3086f8['query']);_0x247a81[_0x4aa6('0x32')]=_[_0x4aa6('0x30')](_0x3086f8[_0x4aa6('0x2d')],qs[_0x4aa6('0x31')](_0x32cc54['query'][_0x4aa6('0x31')]));_0x247a81[_0x4aa6('0x32')]=_0x247a81[_0x4aa6('0x32')][_0x4aa6('0x33')]?_0x247a81['attributes']:_0x3086f8['model'];if(_0x32cc54[_0x4aa6('0x2e')][_0x4aa6('0x3d')]){_0x247a81[_0x4aa6('0x3e')]=[{'all':!![]}];}_0x247a81=_[_0x4aa6('0x3b')]({},_0x247a81,_0x32cc54['options']);return db[_0x4aa6('0x28')][_0x4aa6('0x43')](_0x247a81)[_0x4aa6('0x1f')](handleEntityNotFound(_0x2d3e87,null))[_0x4aa6('0x1f')](respondWithResult(_0x2d3e87,null))['catch'](handleError(_0x2d3e87,null));};exports[_0x4aa6('0x44')]=function(_0x2564d2,_0x266afd){return db[_0x4aa6('0x28')]['create'](_0x2564d2[_0x4aa6('0x45')],{})['then'](respondWithResult(_0x266afd,0xc9))['catch'](handleError(_0x266afd,null));};exports[_0x4aa6('0x46')]=function(_0x34865e,_0x4483cc){if(_0x34865e[_0x4aa6('0x45')]['id']){delete _0x34865e[_0x4aa6('0x45')]['id'];}return db['OpenchannelTransferReport'][_0x4aa6('0x43')]({'where':{'id':_0x34865e['params']['id']}})[_0x4aa6('0x1f')](handleEntityNotFound(_0x4483cc,null))[_0x4aa6('0x1f')](saveUpdates(_0x34865e[_0x4aa6('0x45')],null))['then'](respondWithResult(_0x4483cc,null))[_0x4aa6('0x40')](handleError(_0x4483cc,null));};exports[_0x4aa6('0x20')]=function(_0x41bddf,_0x193caf){return db[_0x4aa6('0x28')][_0x4aa6('0x43')]({'where':{'id':_0x41bddf['params']['id']}})['then'](handleEntityNotFound(_0x193caf,null))['then'](removeEntity(_0x193caf,null))[_0x4aa6('0x40')](handleError(_0x193caf,null));};exports[_0x4aa6('0x47')]=function(_0x490f4c,_0x5e897d){return db['OpenchannelTransferReport']['describe']()[_0x4aa6('0x1f')](respondWithResult(_0x5e897d,null))[_0x4aa6('0x40')](handleError(_0x5e897d,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index b929317..ad05c62 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 _0xe31a=['../../config/environment','./openchannelTransferReport.attributes','define','OpenchannelTransferReport','report_openchannel_transfer','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x179b53,_0x31f6fe){var _0x38a146=function(_0x33f0c2){while(--_0x33f0c2){_0x179b53['push'](_0x179b53['shift']());}};_0x38a146(++_0x31f6fe);}(_0xe31a,0x68));var _0xae31=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0xe31a[_0x2c7618];return _0x5ce3f0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xae31('0x0'))(_0xae31('0x1'));var moment=require(_0xae31('0x2'));var BPromise=require(_0xae31('0x3'));var rp=require(_0xae31('0x4'));var fs=require('fs');var path=require(_0xae31('0x5'));var rimraf=require('rimraf');var config=require(_0xae31('0x6'));var attributes=require(_0xae31('0x7'));module['exports']=function(_0x293427,_0x44a40d){return _0x293427[_0xae31('0x8')](_0xae31('0x9'),attributes,{'tableName':_0xae31('0xa'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xdc78=['report_openchannel_transfer','uniqueid','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelTransferReport.attributes','exports','define','OpenchannelTransferReport'];(function(_0x3b69e3,_0x40bb88){var _0x1f5b5e=function(_0x4fdd01){while(--_0x4fdd01){_0x3b69e3['push'](_0x3b69e3['shift']());}};_0x1f5b5e(++_0x40bb88);}(_0xdc78,0x72));var _0x8dc7=function(_0x3a73bc,_0x550aef){_0x3a73bc=_0x3a73bc-0x0;var _0x32891b=_0xdc78[_0x3a73bc];return _0x32891b;};'use strict';var _=require(_0x8dc7('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x8dc7('0x1'));var moment=require(_0x8dc7('0x2'));var BPromise=require(_0x8dc7('0x3'));var rp=require(_0x8dc7('0x4'));var fs=require('fs');var path=require(_0x8dc7('0x5'));var rimraf=require(_0x8dc7('0x6'));var config=require(_0x8dc7('0x7'));var attributes=require(_0x8dc7('0x8'));module[_0x8dc7('0x9')]=function(_0xdb8533,_0x5711fc){return _0xdb8533[_0x8dc7('0xa')](_0x8dc7('0xb'),attributes,{'tableName':_0x8dc7('0xc'),'paranoid':![],'indexes':[{'name':_0x8dc7('0xd'),'fields':[_0x8dc7('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index 7913c50..af7e2f4 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 _0x5577=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x5577,0x1b4));var _0x7557=function(_0x45f9ca,_0x368549){_0x45f9ca=_0x45f9ca-0x0;var _0x4ce72a=_0x5577[_0x45f9ca];return _0x4ce72a;};'use strict';var _=require(_0x7557('0x0'));var util=require('util');var moment=require(_0x7557('0x1'));var BPromise=require(_0x7557('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7557('0x3'));var db=require(_0x7557('0x4'))['db'];var utils=require(_0x7557('0x5'));var logger=require(_0x7557('0x6'))(_0x7557('0x7'));var config=require(_0x7557('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x7557('0x9')][_0x7557('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3da895,_0x1446fd,_0x33e9aa){return new BPromise(function(_0x37f335,_0xa4f49a){return client[_0x7557('0xb')](_0x3da895,_0x33e9aa)[_0x7557('0xc')](function(_0x24b592){logger[_0x7557('0xd')](_0x7557('0xe'),_0x1446fd,_0x7557('0xf'));logger[_0x7557('0x10')](_0x7557('0x11'),_0x1446fd,'request\x20sent',JSON['stringify'](_0x24b592));if(_0x24b592[_0x7557('0x12')]){if(_0x24b592[_0x7557('0x12')][_0x7557('0x13')]===0x1f4){logger[_0x7557('0x12')](_0x7557('0xe'),_0x1446fd,_0x24b592[_0x7557('0x12')][_0x7557('0x14')]);return _0xa4f49a(_0x24b592[_0x7557('0x12')][_0x7557('0x14')]);}logger[_0x7557('0x12')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x1446fd,_0x24b592[_0x7557('0x12')][_0x7557('0x14')]);return _0x37f335(_0x24b592[_0x7557('0x12')]['message']);}else{logger[_0x7557('0xd')](_0x7557('0xe'),_0x1446fd,_0x7557('0xf'));_0x37f335(_0x24b592[_0x7557('0x15')]['message']);}})[_0x7557('0x16')](function(_0x46057c){logger['error']('OpenchannelTransferReport,\x20%s,\x20%s',_0x1446fd,_0x46057c);_0xa4f49a(_0x46057c);});});} \ No newline at end of file +var _0xf725=['http','then','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x32b475,_0x2a13ad){var _0x1b34e0=function(_0x2879f3){while(--_0x2879f3){_0x32b475['push'](_0x32b475['shift']());}};_0x1b34e0(++_0x2a13ad);}(_0xf725,0x7e));var _0x5f72=function(_0x48bb8a,_0x3e5bec){_0x48bb8a=_0x48bb8a-0x0;var _0x4f01a4=_0xf725[_0x48bb8a];return _0x4f01a4;};'use strict';var _=require(_0x5f72('0x0'));var util=require(_0x5f72('0x1'));var moment=require(_0x5f72('0x2'));var BPromise=require(_0x5f72('0x3'));var rs=require(_0x5f72('0x4'));var fs=require('fs');var Redis=require(_0x5f72('0x5'));var db=require(_0x5f72('0x6'))['db'];var utils=require(_0x5f72('0x7'));var logger=require(_0x5f72('0x8'))(_0x5f72('0x9'));var config=require('../../config/environment');var jayson=require(_0x5f72('0xa'));var client=jayson[_0x5f72('0xb')][_0x5f72('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x193393,_0x148af8,_0x4961d1){return new BPromise(function(_0x158aa3,_0x523365){return client['request'](_0x193393,_0x4961d1)[_0x5f72('0xd')](function(_0x3f189d){logger['info'](_0x5f72('0xe'),_0x148af8,_0x5f72('0xf'));logger['debug'](_0x5f72('0x10'),_0x148af8,_0x5f72('0xf'),JSON[_0x5f72('0x11')](_0x3f189d));if(_0x3f189d[_0x5f72('0x12')]){if(_0x3f189d[_0x5f72('0x12')][_0x5f72('0x13')]===0x1f4){logger[_0x5f72('0x12')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x148af8,_0x3f189d[_0x5f72('0x12')][_0x5f72('0x14')]);return _0x523365(_0x3f189d[_0x5f72('0x12')][_0x5f72('0x14')]);}logger[_0x5f72('0x12')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x148af8,_0x3f189d[_0x5f72('0x12')]['message']);return _0x158aa3(_0x3f189d['error'][_0x5f72('0x14')]);}else{logger['info'](_0x5f72('0xe'),_0x148af8,'request\x20sent');_0x158aa3(_0x3f189d[_0x5f72('0x15')]['message']);}})[_0x5f72('0x16')](function(_0x2c7ac6){logger['error'](_0x5f72('0xe'),_0x148af8,_0x2c7ac6);_0x523365(_0x2c7ac6);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index 1c613d1..604726a 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 _0x8cbf=['exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','/:id','show','create','put','update','delete','destroy'];(function(_0x480d67,_0x3110a9){var _0x32752b=function(_0xb665ab){while(--_0xb665ab){_0x480d67['push'](_0x480d67['shift']());}};_0x32752b(++_0x3110a9);}(_0x8cbf,0x144));var _0xf8cb=function(_0x301bf7,_0x28cba8){_0x301bf7=_0x301bf7-0x0;var _0x274ae9=_0x8cbf[_0x301bf7];return _0x274ae9;};'use strict';var multer=require('multer');var util=require(_0xf8cb('0x0'));var path=require(_0xf8cb('0x1'));var timeout=require(_0xf8cb('0x2'));var express=require(_0xf8cb('0x3'));var router=express[_0xf8cb('0x4')]();var fs_extra=require(_0xf8cb('0x5'));var auth=require(_0xf8cb('0x6'));var interaction=require(_0xf8cb('0x7'));var config=require(_0xf8cb('0x8'));var controller=require('./pause.controller');router['get']('/',auth[_0xf8cb('0x9')](),controller[_0xf8cb('0xa')]);router['get'](_0xf8cb('0xb'),auth[_0xf8cb('0x9')](),controller[_0xf8cb('0xc')]);router['post']('/',auth[_0xf8cb('0x9')](),controller[_0xf8cb('0xd')]);router[_0xf8cb('0xe')](_0xf8cb('0xb'),auth['isAuthenticated'](),controller[_0xf8cb('0xf')]);router[_0xf8cb('0x10')](_0xf8cb('0xb'),auth[_0xf8cb('0x9')](),controller[_0xf8cb('0x11')]);module[_0xf8cb('0x12')]=router; \ No newline at end of file +var _0x693f=['create','put','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./pause.controller','get','index','isAuthenticated','post'];(function(_0x29527b,_0x1efaac){var _0xee661f=function(_0x49bbc7){while(--_0x49bbc7){_0x29527b['push'](_0x29527b['shift']());}};_0xee661f(++_0x1efaac);}(_0x693f,0x9d));var _0xf693=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x693f[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0xf693('0x0'));var util=require(_0xf693('0x1'));var path=require(_0xf693('0x2'));var timeout=require(_0xf693('0x3'));var express=require('express');var router=express[_0xf693('0x4')]();var fs_extra=require(_0xf693('0x5'));var auth=require(_0xf693('0x6'));var interaction=require(_0xf693('0x7'));var config=require(_0xf693('0x8'));var controller=require(_0xf693('0x9'));router[_0xf693('0xa')]('/',auth['isAuthenticated'](),controller[_0xf693('0xb')]);router[_0xf693('0xa')]('/:id',auth[_0xf693('0xc')](),controller['show']);router[_0xf693('0xd')]('/',auth['isAuthenticated'](),controller[_0xf693('0xe')]);router[_0xf693('0xf')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xf693('0x10')]('/:id',auth[_0xf693('0xc')](),controller[_0xf693('0x11')]);module[_0xf693('0x12')]=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index 9b1b7b0..068f441 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 _0xee86=['sequelize','STRING','name'];(function(_0x1bfba4,_0x141daa){var _0x4930d0=function(_0x426271){while(--_0x426271){_0x1bfba4['push'](_0x1bfba4['shift']());}};_0x4930d0(++_0x141daa);}(_0xee86,0x1bf));var _0x6ee8=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0xee86[_0x36eaaa];return _0x461349;};'use strict';var Sequelize=require(_0x6ee8('0x0'));module['exports']={'name':{'type':Sequelize[_0x6ee8('0x1')],'unique':_0x6ee8('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x6ee8('0x1')]}}; \ No newline at end of file +var _0x4417=['name','sequelize','STRING'];(function(_0x583f19,_0x4ccecc){var _0x851dba=function(_0x45ca50){while(--_0x45ca50){_0x583f19['push'](_0x583f19['shift']());}};_0x851dba(++_0x4ccecc);}(_0x4417,0x139));var _0x7441=function(_0x217b9b,_0x16a2e6){_0x217b9b=_0x217b9b-0x0;var _0x4867e4=_0x4417[_0x217b9b];return _0x4867e4;};'use strict';var Sequelize=require(_0x7441('0x0'));module['exports']={'name':{'type':Sequelize[_0x7441('0x1')],'unique':_0x7441('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x7441('0x1')]}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index 66b7277..cde97b1 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 _0x3b69=['query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','then','get','Pauses','UserProfileResource','destroy','sendStatus','stack','name','send','index','map','Pause','rawAttributes','fieldName','type','key','model','keys'];(function(_0xdd0f95,_0x4709af){var _0x28ec00=function(_0x2918c2){while(--_0x2918c2){_0xdd0f95['push'](_0xdd0f95['shift']());}};_0x28ec00(++_0x4709af);}(_0x3b69,0x127));var _0x93b6=function(_0x4c20bd,_0x499f40){_0x4c20bd=_0x4c20bd-0x0;var _0x3a51f5=_0x3b69[_0x4c20bd];return _0x3a51f5;};'use strict';var emlformat=require(_0x93b6('0x0'));var rimraf=require(_0x93b6('0x1'));var zipdir=require(_0x93b6('0x2'));var jsonpatch=require(_0x93b6('0x3'));var rp=require(_0x93b6('0x4'));var moment=require(_0x93b6('0x5'));var BPromise=require(_0x93b6('0x6'));var Mustache=require('mustache');var util=require(_0x93b6('0x7'));var path=require(_0x93b6('0x8'));var sox=require(_0x93b6('0x9'));var csv=require(_0x93b6('0xa'));var ejs=require(_0x93b6('0xb'));var fs=require('fs');var fs_extra=require(_0x93b6('0xc'));var _=require(_0x93b6('0xd'));var squel=require(_0x93b6('0xe'));var crypto=require('crypto');var jsforce=require(_0x93b6('0xf'));var deskjs=require(_0x93b6('0x10'));var toCsv=require('to-csv');var querystring=require(_0x93b6('0x11'));var Papa=require(_0x93b6('0x12'));var Redis=require(_0x93b6('0x13'));var authService=require(_0x93b6('0x14'));var qs=require(_0x93b6('0x15'));var as=require(_0x93b6('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x93b6('0x17'))('api');var utils=require(_0x93b6('0x18'));var config=require(_0x93b6('0x19'));var licenseUtil=require(_0x93b6('0x1a'));var db=require(_0x93b6('0x1b'))['db'];function respondWithStatusCode(_0x4b07a2,_0x2c11cf){_0x2c11cf=_0x2c11cf||0xcc;return function(_0x24dea5){if(_0x24dea5){return _0x4b07a2['sendStatus'](_0x2c11cf);}return _0x4b07a2[_0x93b6('0x1c')](_0x2c11cf)[_0x93b6('0x1d')]();};}function respondWithResult(_0x1fdce6,_0x3986e3){_0x3986e3=_0x3986e3||0xc8;return function(_0x4df99d){if(_0x4df99d){return _0x1fdce6[_0x93b6('0x1c')](_0x3986e3)[_0x93b6('0x1e')](_0x4df99d);}};}function respondWithFilteredResult(_0x3b1e3e,_0x4f4f6f){return function(_0x4ea7dc){if(_0x4ea7dc){var _0x3d0a7c=typeof _0x4f4f6f[_0x93b6('0x1f')]===_0x93b6('0x20')&&typeof _0x4f4f6f[_0x93b6('0x21')]===_0x93b6('0x20');var _0x1eb4dd=_0x4ea7dc[_0x93b6('0x22')];var _0x59d6ff=_0x3d0a7c?0x0:_0x4f4f6f[_0x93b6('0x1f')];var _0x46b927=_0x3d0a7c?_0x4ea7dc[_0x93b6('0x22')]:_0x4f4f6f[_0x93b6('0x1f')]+_0x4f4f6f[_0x93b6('0x21')];var _0x59227b;if(_0x46b927>=_0x1eb4dd){_0x46b927=_0x1eb4dd;_0x59227b=0xc8;}else{_0x59227b=0xce;}_0x3b1e3e['status'](_0x59227b);return _0x3b1e3e['set'](_0x93b6('0x23'),_0x59d6ff+'-'+_0x46b927+'/'+_0x1eb4dd)[_0x93b6('0x1e')](_0x4ea7dc);}return null;};}function patchUpdates(_0x4f11db){return function(_0x3f181b){try{jsonpatch[_0x93b6('0x24')](_0x3f181b,_0x4f11db,!![]);}catch(_0x585b49){return BPromise[_0x93b6('0x25')](_0x585b49);}return _0x3f181b[_0x93b6('0x26')]();};}function saveUpdates(_0x3f13e5,_0x1c7b9e){return function(_0x2603da){if(_0x2603da){return _0x2603da['update'](_0x3f13e5)[_0x93b6('0x27')](function(_0x16a134){return _0x16a134;});}return null;};}function removeEntity(_0x5b0b2f,_0x1bb6fb){return function(_0x22d9b9){if(_0x22d9b9){return _0x22d9b9['destroy']()['then'](function(){var _0x6ac091=_0x22d9b9[_0x93b6('0x28')]({'plain':!![]});var _0x2016ea=_0x93b6('0x29');return db[_0x93b6('0x2a')][_0x93b6('0x2b')]({'where':{'type':_0x2016ea,'resourceId':_0x6ac091['id']}})[_0x93b6('0x27')](function(){return _0x22d9b9;});})[_0x93b6('0x27')](function(){_0x5b0b2f[_0x93b6('0x1c')](0xcc)[_0x93b6('0x1d')]();});}};}function handleEntityNotFound(_0x29ad2a,_0x29ab76){return function(_0x3eb5b8){if(!_0x3eb5b8){_0x29ad2a[_0x93b6('0x2c')](0x194);}return _0x3eb5b8;};}function handleError(_0xb2a182,_0x1273dc){_0x1273dc=_0x1273dc||0x1f4;return function(_0x2f475a){logger['error'](_0x2f475a[_0x93b6('0x2d')]);if(_0x2f475a[_0x93b6('0x2e')]){delete _0x2f475a[_0x93b6('0x2e')];}_0xb2a182[_0x93b6('0x1c')](_0x1273dc)[_0x93b6('0x2f')](_0x2f475a);};}exports[_0x93b6('0x30')]=function(_0x2a27e3,_0x1dfaff){var _0x341207={},_0x220d0a={},_0x15a6fb={'count':0x0,'rows':[]};var _0x294b48=_[_0x93b6('0x31')](db[_0x93b6('0x32')][_0x93b6('0x33')],function(_0x346903){return{'name':_0x346903[_0x93b6('0x34')],'type':_0x346903[_0x93b6('0x35')][_0x93b6('0x36')]};});_0x220d0a[_0x93b6('0x37')]=_[_0x93b6('0x31')](_0x294b48,'name');_0x220d0a['query']=_[_0x93b6('0x38')](_0x2a27e3[_0x93b6('0x39')]);_0x220d0a[_0x93b6('0x3a')]=_['intersection'](_0x220d0a[_0x93b6('0x37')],_0x220d0a[_0x93b6('0x39')]);_0x341207[_0x93b6('0x3b')]=_[_0x93b6('0x3c')](_0x220d0a[_0x93b6('0x37')],qs[_0x93b6('0x3d')](_0x2a27e3[_0x93b6('0x39')][_0x93b6('0x3d')]));_0x341207['attributes']=_0x341207['attributes'][_0x93b6('0x3e')]?_0x341207['attributes']:_0x220d0a['model'];if(!_0x2a27e3[_0x93b6('0x39')][_0x93b6('0x3f')](_0x93b6('0x40'))){_0x341207['limit']=qs[_0x93b6('0x21')](_0x2a27e3['query']['limit']);_0x341207[_0x93b6('0x1f')]=qs[_0x93b6('0x1f')](_0x2a27e3[_0x93b6('0x39')][_0x93b6('0x1f')]);}_0x341207[_0x93b6('0x41')]=qs[_0x93b6('0x42')](_0x2a27e3['query'][_0x93b6('0x42')]);_0x341207[_0x93b6('0x43')]=qs[_0x93b6('0x3a')](_[_0x93b6('0x44')](_0x2a27e3[_0x93b6('0x39')],_0x220d0a[_0x93b6('0x3a')]),_0x294b48);if(_0x2a27e3[_0x93b6('0x39')][_0x93b6('0x45')]){_0x341207['where']=_[_0x93b6('0x46')](_0x341207[_0x93b6('0x43')],{'$or':_[_0x93b6('0x31')](_0x294b48,function(_0x4ac79c){if(_0x4ac79c[_0x93b6('0x35')]!==_0x93b6('0x47')){var _0x5eb4f7={};_0x5eb4f7[_0x4ac79c['name']]={'$like':'%'+_0x2a27e3[_0x93b6('0x39')]['filter']+'%'};return _0x5eb4f7;}})});}_0x341207=_['merge']({},_0x341207,_0x2a27e3[_0x93b6('0x48')]);var _0x3edd82={'where':_0x341207[_0x93b6('0x43')]};return db[_0x93b6('0x32')][_0x93b6('0x22')](_0x3edd82)['then'](function(_0x2228bc){_0x15a6fb['count']=_0x2228bc;if(_0x2a27e3['query'][_0x93b6('0x49')]){_0x341207[_0x93b6('0x4a')]=[{'all':!![]}];}return db['Pause'][_0x93b6('0x4b')](_0x341207);})[_0x93b6('0x27')](function(_0x38d9f3){_0x15a6fb[_0x93b6('0x4c')]=_0x38d9f3;return _0x15a6fb;})[_0x93b6('0x27')](respondWithFilteredResult(_0x1dfaff,_0x341207))[_0x93b6('0x4d')](handleError(_0x1dfaff,null));};exports['show']=function(_0x5c6c14,_0x2b8cb9){var _0x32cb27={'raw':!![],'where':{'id':_0x5c6c14[_0x93b6('0x4e')]['id']}},_0x163b17={};_0x163b17[_0x93b6('0x37')]=_['keys'](db[_0x93b6('0x32')]['rawAttributes']);_0x163b17[_0x93b6('0x39')]=_[_0x93b6('0x38')](_0x5c6c14['query']);_0x163b17[_0x93b6('0x3a')]=_['intersection'](_0x163b17[_0x93b6('0x37')],_0x163b17[_0x93b6('0x39')]);_0x32cb27[_0x93b6('0x3b')]=_[_0x93b6('0x3c')](_0x163b17[_0x93b6('0x37')],qs[_0x93b6('0x3d')](_0x5c6c14[_0x93b6('0x39')][_0x93b6('0x3d')]));_0x32cb27[_0x93b6('0x3b')]=_0x32cb27[_0x93b6('0x3b')][_0x93b6('0x3e')]?_0x32cb27[_0x93b6('0x3b')]:_0x163b17[_0x93b6('0x37')];if(_0x5c6c14[_0x93b6('0x39')]['includeAll']){_0x32cb27[_0x93b6('0x4a')]=[{'all':!![]}];}_0x32cb27=_['merge']({},_0x32cb27,_0x5c6c14[_0x93b6('0x48')]);return db[_0x93b6('0x32')][_0x93b6('0x4f')](_0x32cb27)[_0x93b6('0x27')](handleEntityNotFound(_0x2b8cb9,null))[_0x93b6('0x27')](respondWithResult(_0x2b8cb9,null))[_0x93b6('0x4d')](handleError(_0x2b8cb9,null));};exports[_0x93b6('0x50')]=function(_0x47c19b,_0x4ee7b3){return db['Pause'][_0x93b6('0x50')](_0x47c19b[_0x93b6('0x51')],{})['then'](function(_0x1a566b){var _0x2f5011=_0x47c19b[_0x93b6('0x52')][_0x93b6('0x28')]({'plain':!![]});if(!_0x2f5011)throw new Error(_0x93b6('0x53'));if(_0x2f5011['role']===_0x93b6('0x52')){var _0x1e51aa=_0x1a566b[_0x93b6('0x28')]({'plain':!![]});var _0x1ec756=_0x93b6('0x29');return db[_0x93b6('0x54')][_0x93b6('0x4f')]({'where':{'name':_0x1ec756,'userProfileId':_0x2f5011[_0x93b6('0x55')]},'raw':!![]})[_0x93b6('0x27')](function(_0x1cb342){if(_0x1cb342&&_0x1cb342[_0x93b6('0x56')]===0x0){return db[_0x93b6('0x2a')]['create']({'name':_0x1e51aa[_0x93b6('0x2e')],'resourceId':_0x1e51aa['id'],'type':_0x1cb342[_0x93b6('0x2e')],'sectionId':_0x1cb342['id']},{})['then'](function(){return _0x1a566b;});}else{return _0x1a566b;}})[_0x93b6('0x4d')](function(_0x40b2b8){logger['error'](_0x93b6('0x57'),_0x40b2b8);throw _0x40b2b8;});}return _0x1a566b;})['then'](respondWithResult(_0x4ee7b3,0xc9))['catch'](handleError(_0x4ee7b3,null));};exports['update']=function(_0xb231b4,_0x297527){if(_0xb231b4[_0x93b6('0x51')]['id']){delete _0xb231b4[_0x93b6('0x51')]['id'];}return db[_0x93b6('0x32')][_0x93b6('0x4f')]({'where':{'id':_0xb231b4[_0x93b6('0x4e')]['id']}})[_0x93b6('0x27')](handleEntityNotFound(_0x297527,null))[_0x93b6('0x27')](saveUpdates(_0xb231b4[_0x93b6('0x51')],null))[_0x93b6('0x27')](respondWithResult(_0x297527,null))['catch'](handleError(_0x297527,null));};exports[_0x93b6('0x2b')]=function(_0x26c4c4,_0x24eada){return db[_0x93b6('0x32')][_0x93b6('0x4f')]({'where':{'id':_0x26c4c4[_0x93b6('0x4e')]['id']}})[_0x93b6('0x27')](handleEntityNotFound(_0x24eada,null))[_0x93b6('0x27')](removeEntity(_0x24eada,null))[_0x93b6('0x4d')](handleError(_0x24eada,null));}; \ No newline at end of file +var _0x1c54=['zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','Pauses','UserProfileResource','destroy','then','error','stack','name','send','map','Pause','rawAttributes','fieldName','key','model','keys','filters','intersection','attributes','query','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','fields','options','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s'];(function(_0x464f8b,_0x10ae65){var _0x46f2c7=function(_0x50d53b){while(--_0x50d53b){_0x464f8b['push'](_0x464f8b['shift']());}};_0x46f2c7(++_0x10ae65);}(_0x1c54,0xac));var _0x41c5=function(_0xbe048b,_0x2f8970){_0xbe048b=_0xbe048b-0x0;var _0x1d9099=_0x1c54[_0xbe048b];return _0x1d9099;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x41c5('0x0'));var jsonpatch=require(_0x41c5('0x1'));var rp=require(_0x41c5('0x2'));var moment=require('moment');var BPromise=require(_0x41c5('0x3'));var Mustache=require(_0x41c5('0x4'));var util=require(_0x41c5('0x5'));var path=require(_0x41c5('0x6'));var sox=require(_0x41c5('0x7'));var csv=require(_0x41c5('0x8'));var ejs=require(_0x41c5('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x41c5('0xa'));var squel=require('squel');var crypto=require(_0x41c5('0xb'));var jsforce=require(_0x41c5('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x41c5('0x8'));var querystring=require(_0x41c5('0xd'));var Papa=require(_0x41c5('0xe'));var Redis=require(_0x41c5('0xf'));var authService=require(_0x41c5('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x41c5('0x11'));var hardwareService=require(_0x41c5('0x12'));var logger=require(_0x41c5('0x13'))('api');var utils=require(_0x41c5('0x14'));var config=require(_0x41c5('0x15'));var licenseUtil=require(_0x41c5('0x16'));var db=require(_0x41c5('0x17'))['db'];function respondWithStatusCode(_0x21474,_0x1a59c3){_0x1a59c3=_0x1a59c3||0xcc;return function(_0x1359fd){if(_0x1359fd){return _0x21474[_0x41c5('0x18')](_0x1a59c3);}return _0x21474[_0x41c5('0x19')](_0x1a59c3)[_0x41c5('0x1a')]();};}function respondWithResult(_0x96e955,_0x5e53a9){_0x5e53a9=_0x5e53a9||0xc8;return function(_0x58a86b){if(_0x58a86b){return _0x96e955['status'](_0x5e53a9)[_0x41c5('0x1b')](_0x58a86b);}};}function respondWithFilteredResult(_0xc7dd28,_0x263368){return function(_0x40170d){if(_0x40170d){var _0x1b8d16=typeof _0x263368[_0x41c5('0x1c')]==='undefined'&&typeof _0x263368[_0x41c5('0x1d')]===_0x41c5('0x1e');var _0xe4931c=_0x40170d[_0x41c5('0x1f')];var _0x9aae1e=_0x1b8d16?0x0:_0x263368[_0x41c5('0x1c')];var _0x26f788=_0x1b8d16?_0x40170d['count']:_0x263368[_0x41c5('0x1c')]+_0x263368[_0x41c5('0x1d')];var _0x2a7d54;if(_0x26f788>=_0xe4931c){_0x26f788=_0xe4931c;_0x2a7d54=0xc8;}else{_0x2a7d54=0xce;}_0xc7dd28['status'](_0x2a7d54);return _0xc7dd28[_0x41c5('0x20')](_0x41c5('0x21'),_0x9aae1e+'-'+_0x26f788+'/'+_0xe4931c)[_0x41c5('0x1b')](_0x40170d);}return null;};}function patchUpdates(_0x36564c){return function(_0x666430){try{jsonpatch['apply'](_0x666430,_0x36564c,!![]);}catch(_0x528c31){return BPromise[_0x41c5('0x22')](_0x528c31);}return _0x666430[_0x41c5('0x23')]();};}function saveUpdates(_0x588fc6,_0x38f8da){return function(_0x581bbb){if(_0x581bbb){return _0x581bbb[_0x41c5('0x24')](_0x588fc6)['then'](function(_0xd8411c){return _0xd8411c;});}return null;};}function removeEntity(_0x2b6273,_0x31db17){return function(_0x20ebc6){if(_0x20ebc6){return _0x20ebc6['destroy']()['then'](function(){var _0x3fa6a7=_0x20ebc6['get']({'plain':!![]});var _0x2b394f=_0x41c5('0x25');return db[_0x41c5('0x26')][_0x41c5('0x27')]({'where':{'type':_0x2b394f,'resourceId':_0x3fa6a7['id']}})[_0x41c5('0x28')](function(){return _0x20ebc6;});})[_0x41c5('0x28')](function(){_0x2b6273[_0x41c5('0x19')](0xcc)[_0x41c5('0x1a')]();});}};}function handleEntityNotFound(_0x48b50a,_0x13e6af){return function(_0x8840a9){if(!_0x8840a9){_0x48b50a['sendStatus'](0x194);}return _0x8840a9;};}function handleError(_0x2607a9,_0x17bd06){_0x17bd06=_0x17bd06||0x1f4;return function(_0xcca179){logger[_0x41c5('0x29')](_0xcca179[_0x41c5('0x2a')]);if(_0xcca179[_0x41c5('0x2b')]){delete _0xcca179[_0x41c5('0x2b')];}_0x2607a9[_0x41c5('0x19')](_0x17bd06)[_0x41c5('0x2c')](_0xcca179);};}exports['index']=function(_0x3f77e2,_0x261e9f){var _0x21a6ce={},_0x374819={},_0x15b4bd={'count':0x0,'rows':[]};var _0x194df6=_[_0x41c5('0x2d')](db[_0x41c5('0x2e')][_0x41c5('0x2f')],function(_0x2dc485){return{'name':_0x2dc485[_0x41c5('0x30')],'type':_0x2dc485['type'][_0x41c5('0x31')]};});_0x374819[_0x41c5('0x32')]=_[_0x41c5('0x2d')](_0x194df6,'name');_0x374819['query']=_[_0x41c5('0x33')](_0x3f77e2['query']);_0x374819[_0x41c5('0x34')]=_[_0x41c5('0x35')](_0x374819[_0x41c5('0x32')],_0x374819['query']);_0x21a6ce[_0x41c5('0x36')]=_[_0x41c5('0x35')](_0x374819[_0x41c5('0x32')],qs['fields'](_0x3f77e2[_0x41c5('0x37')]['fields']));_0x21a6ce[_0x41c5('0x36')]=_0x21a6ce[_0x41c5('0x36')][_0x41c5('0x38')]?_0x21a6ce['attributes']:_0x374819[_0x41c5('0x32')];if(!_0x3f77e2[_0x41c5('0x37')][_0x41c5('0x39')](_0x41c5('0x3a'))){_0x21a6ce[_0x41c5('0x1d')]=qs[_0x41c5('0x1d')](_0x3f77e2[_0x41c5('0x37')][_0x41c5('0x1d')]);_0x21a6ce['offset']=qs[_0x41c5('0x1c')](_0x3f77e2[_0x41c5('0x37')][_0x41c5('0x1c')]);}_0x21a6ce[_0x41c5('0x3b')]=qs[_0x41c5('0x3c')](_0x3f77e2[_0x41c5('0x37')][_0x41c5('0x3c')]);_0x21a6ce[_0x41c5('0x3d')]=qs[_0x41c5('0x34')](_[_0x41c5('0x3e')](_0x3f77e2['query'],_0x374819['filters']),_0x194df6);if(_0x3f77e2['query'][_0x41c5('0x3f')]){_0x21a6ce[_0x41c5('0x3d')]=_[_0x41c5('0x40')](_0x21a6ce['where'],{'$or':_['map'](_0x194df6,function(_0x5ad2a9){if(_0x5ad2a9[_0x41c5('0x41')]!==_0x41c5('0x42')){var _0x3434a2={};_0x3434a2[_0x5ad2a9[_0x41c5('0x2b')]]={'$like':'%'+_0x3f77e2[_0x41c5('0x37')]['filter']+'%'};return _0x3434a2;}})});}_0x21a6ce=_[_0x41c5('0x40')]({},_0x21a6ce,_0x3f77e2['options']);var _0xb23f3c={'where':_0x21a6ce[_0x41c5('0x3d')]};return db['Pause'][_0x41c5('0x1f')](_0xb23f3c)[_0x41c5('0x28')](function(_0x5cb311){_0x15b4bd[_0x41c5('0x1f')]=_0x5cb311;if(_0x3f77e2[_0x41c5('0x37')][_0x41c5('0x43')]){_0x21a6ce[_0x41c5('0x44')]=[{'all':!![]}];}return db[_0x41c5('0x2e')][_0x41c5('0x45')](_0x21a6ce);})[_0x41c5('0x28')](function(_0x7aa3cc){_0x15b4bd[_0x41c5('0x46')]=_0x7aa3cc;return _0x15b4bd;})[_0x41c5('0x28')](respondWithFilteredResult(_0x261e9f,_0x21a6ce))[_0x41c5('0x47')](handleError(_0x261e9f,null));};exports[_0x41c5('0x48')]=function(_0x375af9,_0x1cf126){var _0x218e26={'raw':!![],'where':{'id':_0x375af9[_0x41c5('0x49')]['id']}},_0x449a98={};_0x449a98[_0x41c5('0x32')]=_[_0x41c5('0x33')](db[_0x41c5('0x2e')][_0x41c5('0x2f')]);_0x449a98['query']=_['keys'](_0x375af9['query']);_0x449a98[_0x41c5('0x34')]=_[_0x41c5('0x35')](_0x449a98['model'],_0x449a98[_0x41c5('0x37')]);_0x218e26[_0x41c5('0x36')]=_['intersection'](_0x449a98[_0x41c5('0x32')],qs[_0x41c5('0x4a')](_0x375af9[_0x41c5('0x37')]['fields']));_0x218e26['attributes']=_0x218e26[_0x41c5('0x36')][_0x41c5('0x38')]?_0x218e26['attributes']:_0x449a98[_0x41c5('0x32')];if(_0x375af9[_0x41c5('0x37')]['includeAll']){_0x218e26[_0x41c5('0x44')]=[{'all':!![]}];}_0x218e26=_[_0x41c5('0x40')]({},_0x218e26,_0x375af9[_0x41c5('0x4b')]);return db[_0x41c5('0x2e')]['find'](_0x218e26)['then'](handleEntityNotFound(_0x1cf126,null))['then'](respondWithResult(_0x1cf126,null))[_0x41c5('0x47')](handleError(_0x1cf126,null));};exports[_0x41c5('0x4c')]=function(_0x3a014b,_0x1c140b){return db[_0x41c5('0x2e')][_0x41c5('0x4c')](_0x3a014b[_0x41c5('0x4d')],{})[_0x41c5('0x28')](function(_0x48d278){var _0x2ed377=_0x3a014b[_0x41c5('0x4e')][_0x41c5('0x4f')]({'plain':!![]});if(!_0x2ed377)throw new Error(_0x41c5('0x50'));if(_0x2ed377['role']===_0x41c5('0x4e')){var _0x59ea4b=_0x48d278[_0x41c5('0x4f')]({'plain':!![]});var _0x55998c=_0x41c5('0x25');return db[_0x41c5('0x51')][_0x41c5('0x52')]({'where':{'name':_0x55998c,'userProfileId':_0x2ed377[_0x41c5('0x53')]},'raw':!![]})['then'](function(_0x2d6ea6){if(_0x2d6ea6&&_0x2d6ea6[_0x41c5('0x54')]===0x0){return db[_0x41c5('0x26')]['create']({'name':_0x59ea4b[_0x41c5('0x2b')],'resourceId':_0x59ea4b['id'],'type':_0x2d6ea6[_0x41c5('0x2b')],'sectionId':_0x2d6ea6['id']},{})['then'](function(){return _0x48d278;});}else{return _0x48d278;}})[_0x41c5('0x47')](function(_0x5d8ae8){logger['error'](_0x41c5('0x55'),_0x5d8ae8);throw _0x5d8ae8;});}return _0x48d278;})[_0x41c5('0x28')](respondWithResult(_0x1c140b,0xc9))['catch'](handleError(_0x1c140b,null));};exports['update']=function(_0x3558e8,_0x329681){if(_0x3558e8['body']['id']){delete _0x3558e8[_0x41c5('0x4d')]['id'];}return db[_0x41c5('0x2e')][_0x41c5('0x52')]({'where':{'id':_0x3558e8['params']['id']}})[_0x41c5('0x28')](handleEntityNotFound(_0x329681,null))[_0x41c5('0x28')](saveUpdates(_0x3558e8['body'],null))[_0x41c5('0x28')](respondWithResult(_0x329681,null))['catch'](handleError(_0x329681,null));};exports[_0x41c5('0x27')]=function(_0x1549a0,_0x2ab86d){return db[_0x41c5('0x2e')]['find']({'where':{'id':_0x1549a0[_0x41c5('0x49')]['id']}})[_0x41c5('0x28')](handleEntityNotFound(_0x2ab86d,null))['then'](removeEntity(_0x2ab86d,null))[_0x41c5('0x47')](handleError(_0x2ab86d,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index 6ec1c81..582f72a 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 _0x5fab=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./pause.attributes','exports','Pause','tools_pauses','lodash','util'];(function(_0x49ada1,_0x52170f){var _0x3c08c8=function(_0x12f942){while(--_0x12f942){_0x49ada1['push'](_0x49ada1['shift']());}};_0x3c08c8(++_0x52170f);}(_0x5fab,0x177));var _0xb5fa=function(_0x27638d,_0x4094db){_0x27638d=_0x27638d-0x0;var _0x35da35=_0x5fab[_0x27638d];return _0x35da35;};'use strict';var _=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var logger=require('../../config/logger')(_0xb5fa('0x2'));var moment=require(_0xb5fa('0x3'));var BPromise=require(_0xb5fa('0x4'));var rp=require(_0xb5fa('0x5'));var fs=require('fs');var path=require(_0xb5fa('0x6'));var rimraf=require(_0xb5fa('0x7'));var config=require(_0xb5fa('0x8'));var attributes=require(_0xb5fa('0x9'));module[_0xb5fa('0xa')]=function(_0x44df89,_0x4a0249){return _0x44df89['define'](_0xb5fa('0xb'),attributes,{'tableName':_0xb5fa('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9957=['exports','define','Pause','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./pause.attributes'];(function(_0x5a3cf0,_0x160a68){var _0x5a64ee=function(_0x34cd1d){while(--_0x34cd1d){_0x5a3cf0['push'](_0x5a3cf0['shift']());}};_0x5a64ee(++_0x160a68);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'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':'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 8cf44ce..daa34c7 100644 --- a/server/api/pause/pause.rpc.js +++ b/server/api/pause/pause.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Pause,\x20%s,\x20%s','Pause,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','ShowPause','Pause','find','options','raw','where','attributes','map','include','model','debug'];(function(_0x5ccac6,_0x750631){var _0x59a198=function(_0x4d6bc5){while(--_0x4d6bc5){_0x5ccac6['push'](_0x5ccac6['shift']());}};_0x59a198(++_0x750631);}(_0xb10b,0x12a));var _0xbb10=function(_0x35ebae,_0x4f86c4){_0x35ebae=_0x35ebae-0x0;var _0x1924cf=_0xb10b[_0x35ebae];return _0x1924cf;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')]({'raw':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8[_0xbb10('0x18')]?_0x378da8['options'][_0xbb10('0x1b')]||null:null,'include':_0x378da8[_0xbb10('0x18')]?_0x378da8['options']['include']?_[_0xbb10('0x1c')](_0x378da8[_0xbb10('0x18')][_0xbb10('0x1d')],function(_0x317da4){return{'model':db[_0x317da4[_0xbb10('0x1e')]],'as':_0x317da4['as'],'attributes':_0x317da4[_0xbb10('0x1b')],'include':_0x317da4[_0xbb10('0x1d')]?_[_0xbb10('0x1c')](_0x317da4[_0xbb10('0x1d')],function(_0x395404){return{'model':db[_0x395404[_0xbb10('0x1e')]],'as':_0x395404['as'],'attributes':_0x395404[_0xbb10('0x1b')],'include':_0x395404['include']?_['map'](_0x395404['include'],function(_0xc93a04){return{'model':db[_0xc93a04[_0xbb10('0x1e')]],'as':_0xc93a04['as'],'attributes':_0xc93a04[_0xbb10('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2fdde9){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1f')](_0xbb10('0x15'),_0x378da8,JSON[_0xbb10('0x11')](_0x2fdde9));_0x575cca(_0x2fdde9);})[_0xbb10('0x20')](function(_0x4aabb9){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x4aabb9[_0xbb10('0x13')],_0x378da8);_0x30efc6(_0x1682a4[_0xbb10('0x12')](0x1f4,_0x4aabb9[_0xbb10('0x13')]));});});}; \ No newline at end of file +var _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(_0x3b4206,_0x2bc8c5){var _0x2ca6d9=function(_0x5a1107){while(--_0x5a1107){_0x3b4206['push'](_0x3b4206['shift']());}};_0x2ca6d9(++_0x2bc8c5);}(_0x7a54,0x106));var _0x47a5=function(_0x38ad8e,_0x2b0ee6){_0x38ad8e=_0x38ad8e-0x0;var _0x2a0369=_0x7a54[_0x38ad8e];return _0x2a0369;};'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 606a129..2ef4b49 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 _0xb458=['show','/:id/download','diskStorage','server/files/plugins','originalname','replace','format','%s-%s%s','basename','now','extname','post','single','file','upload','webhookPost','put','/:id','update','delete','exports','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./plugin.controller','index','get','/webhook','webhookGet','isAuthenticated'];(function(_0x4ac6ca,_0x190469){var _0x43cbdc=function(_0x1c861b){while(--_0x1c861b){_0x4ac6ca['push'](_0x4ac6ca['shift']());}};_0x43cbdc(++_0x190469);}(_0xb458,0x103));var _0x8b45=function(_0x3ab0f7,_0x421925){_0x3ab0f7=_0x3ab0f7-0x0;var _0x55ab91=_0xb458[_0x3ab0f7];return _0x55ab91;};'use strict';var multer=require(_0x8b45('0x0'));var util=require(_0x8b45('0x1'));var path=require(_0x8b45('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x8b45('0x3')]();var fs_extra=require(_0x8b45('0x4'));var auth=require(_0x8b45('0x5'));var interaction=require(_0x8b45('0x6'));var config=require('../../config/environment');var controller=require(_0x8b45('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x8b45('0x8')]);router[_0x8b45('0x9')](_0x8b45('0xa'),controller[_0x8b45('0xb')]);router[_0x8b45('0x9')]('/:id',auth[_0x8b45('0xc')](),controller[_0x8b45('0xd')]);router[_0x8b45('0x9')](_0x8b45('0xe'),auth[_0x8b45('0xc')](),controller['download']);var upload=multer({'storage':multer[_0x8b45('0xf')]({'destination':function(_0x7cc49b,_0x57faf9,_0x5316af){_0x5316af(null,path['join'](config['root'],_0x8b45('0x10')));},'filename':function(_0x285728,_0x37c220,_0x52c4db){_0x37c220[_0x8b45('0x11')]=_0x37c220[_0x8b45('0x11')][_0x8b45('0x12')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x52c4db(null,util[_0x8b45('0x13')](_0x8b45('0x14'),path[_0x8b45('0x15')](_0x37c220['originalname'],path['extname'](_0x37c220[_0x8b45('0x11')])),Date[_0x8b45('0x16')](),path[_0x8b45('0x17')](_0x37c220[_0x8b45('0x11')])));}})});router[_0x8b45('0x18')]('/',upload[_0x8b45('0x19')](_0x8b45('0x1a')),controller[_0x8b45('0x1b')]);router[_0x8b45('0x18')](_0x8b45('0xa'),controller[_0x8b45('0x1c')]);router[_0x8b45('0x1d')](_0x8b45('0x1e'),auth[_0x8b45('0xc')](),controller[_0x8b45('0x1f')]);router[_0x8b45('0x20')](_0x8b45('0x1e'),auth[_0x8b45('0xc')](),controller['delete']);module[_0x8b45('0x21')]=router; \ No newline at end of file +var _0x57d4=['../../config/environment','./plugin.controller','get','isAuthenticated','index','/webhook','webhookGet','show','diskStorage','join','root','server/files/plugins','originalname','%s-%s%s','basename','extname','now','single','file','upload','webhookPost','/:id','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x34d993,_0x3c7017){var _0x4728c7=function(_0x12f5ca){while(--_0x12f5ca){_0x34d993['push'](_0x34d993['shift']());}};_0x4728c7(++_0x3c7017);}(_0x57d4,0x78));var _0x457d=function(_0x392b40,_0x5bfc40){_0x392b40=_0x392b40-0x0;var _0x2bac4f=_0x57d4[_0x392b40];return _0x2bac4f;};'use strict';var multer=require(_0x457d('0x0'));var util=require(_0x457d('0x1'));var path=require('path');var timeout=require(_0x457d('0x2'));var express=require(_0x457d('0x3'));var router=express[_0x457d('0x4')]();var fs_extra=require(_0x457d('0x5'));var auth=require(_0x457d('0x6'));var interaction=require(_0x457d('0x7'));var config=require(_0x457d('0x8'));var controller=require(_0x457d('0x9'));router[_0x457d('0xa')]('/',auth[_0x457d('0xb')](),controller[_0x457d('0xc')]);router['get'](_0x457d('0xd'),controller[_0x457d('0xe')]);router['get']('/:id',auth[_0x457d('0xb')](),controller[_0x457d('0xf')]);router[_0x457d('0xa')]('/:id/download',auth['isAuthenticated'](),controller['download']);var upload=multer({'storage':multer[_0x457d('0x10')]({'destination':function(_0x38ec93,_0x449f48,_0x128e09){_0x128e09(null,path[_0x457d('0x11')](config[_0x457d('0x12')],_0x457d('0x13')));},'filename':function(_0x24cf65,_0xe7d200,_0x5abf49){_0xe7d200[_0x457d('0x14')]=_0xe7d200[_0x457d('0x14')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x5abf49(null,util['format'](_0x457d('0x15'),path[_0x457d('0x16')](_0xe7d200[_0x457d('0x14')],path[_0x457d('0x17')](_0xe7d200[_0x457d('0x14')])),Date[_0x457d('0x18')](),path[_0x457d('0x17')](_0xe7d200[_0x457d('0x14')])));}})});router['post']('/',upload[_0x457d('0x19')](_0x457d('0x1a')),controller[_0x457d('0x1b')]);router['post']('/webhook',controller[_0x457d('0x1c')]);router['put'](_0x457d('0x1d'),auth[_0x457d('0xb')](),controller['update']);router[_0x457d('0x1e')]('/:id',auth['isAuthenticated'](),controller[_0x457d('0x1e')]);module[_0x457d('0x1f')]=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index 5308ca9..dd3eb28 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 _0xff7f=['script','TEXT','adminOnly','agentOnly','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','exports','STRING','ENUM','html'];(function(_0x2ab84a,_0x24cb76){var _0x5330e1=function(_0x57a48a){while(--_0x57a48a){_0x2ab84a['push'](_0x2ab84a['shift']());}};_0x5330e1(++_0x24cb76);}(_0xff7f,0x1b7));var _0xfff7=function(_0x7bdfc6,_0x17e1b9){_0x7bdfc6=_0x7bdfc6-0x0;var _0x23d65f=_0xff7f[_0x7bdfc6];return _0x23d65f;};'use strict';var Sequelize=require(_0xfff7('0x0'));module[_0xfff7('0x1')]={'name':{'type':Sequelize[_0xfff7('0x2')]},'type':{'type':Sequelize[_0xfff7('0x3')](_0xfff7('0x4'),_0xfff7('0x5'))},'description':{'type':Sequelize[_0xfff7('0x6')]},'version':{'type':Sequelize[_0xfff7('0x6')]},'path':{'type':Sequelize[_0xfff7('0x2')],'comment':'The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.'},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.'},'sidebar':{'type':Sequelize[_0xfff7('0x3')](_0xfff7('0x7'),_0xfff7('0x8'),_0xfff7('0x9'),_0xfff7('0xa')),'defaultValue':_0xfff7('0x9'),'comment':_0xfff7('0xb')},'icon':{'type':Sequelize[_0xfff7('0x2')]},'adminUrl':{'type':Sequelize[_0xfff7('0x2')]},'agentUrl':{'type':Sequelize[_0xfff7('0x2')]},'scriptName':{'type':Sequelize['STRING']},'scriptPath':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x7172=['Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','STRING','html','TEXT','ENUM','adminOnly','agentOnly','always','never'];(function(_0xdb357c,_0x3786b6){var _0x5c8735=function(_0x2e179c){while(--_0x2e179c){_0xdb357c['push'](_0xdb357c['shift']());}};_0x5c8735(++_0x3786b6);}(_0x7172,0x1a9));var _0x2717=function(_0x47d710,_0x58374e){_0x47d710=_0x47d710-0x0;var _0x25c1d9=_0x7172[_0x47d710];return _0x25c1d9;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM'](_0x2717('0x0'),'script')},'description':{'type':Sequelize[_0x2717('0x1')]},'version':{'type':Sequelize[_0x2717('0x1')]},'path':{'type':Sequelize['STRING'],'comment':'The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.'},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.'},'sidebar':{'type':Sequelize[_0x2717('0x2')](_0x2717('0x3'),_0x2717('0x4'),_0x2717('0x5'),_0x2717('0x6')),'defaultValue':_0x2717('0x5'),'comment':_0x2717('0x7')},'icon':{'type':Sequelize[_0x2717('0x8')]},'adminUrl':{'type':Sequelize[_0x2717('0x8')]},'agentUrl':{'type':Sequelize['STRING']},'scriptName':{'type':Sequelize[_0x2717('0x8')]},'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 34c0f3e..4cb1a86 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 _0x59e9=['Temporary\x20file\x20removed','upload','file','filename','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','readdirSync','some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','parse','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','parameters','Invalid\x20manifest:\x20parameters\x20missing','views','Invalid\x20manifest:\x20views\x20missing','Invalid\x20manifest:\x20no\x20view\x20specified','script','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','icon-apps','html','admin','test','Warning:\x20admin\x20view\x20not\x20specified','agent','plugins','body','role','user','userProfileId','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','http://localhost:','json','encoding','format','%s%s','headers','content-length','content-type','endsWith','statusCode','webhookPost','method','set','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','querystring','papaparse','extract-zip','archiver','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./plugin.socket','register','status','end','offset','undefined','limit','count','Content-Range','apply','update','then','destroy','get','sendStatus','error','name','send','index','map','Plugin','rawAttributes','fieldName','type','query','keys','intersection','attributes','fields','model','hasOwnProperty','order','sort','filters','pick','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','params','length','find','download','root','%s.zip','basename','createWriteStream','zip','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe','glob','**/*','server/files/plugins','dirname','join','finalize','close','existsSync','Plugin\x20not\x20found','unlinkSync','info','Download\x20completed'];(function(_0x57fa7e,_0xd0b5ce){var _0x320671=function(_0x3392cc){while(--_0x3392cc){_0x57fa7e['push'](_0x57fa7e['shift']());}};_0x320671(++_0xd0b5ce);}(_0x59e9,0x19d));var _0x959e=function(_0x4e4d94,_0x442eae){_0x4e4d94=_0x4e4d94-0x0;var _0x330a1f=_0x59e9[_0x4e4d94];return _0x330a1f;};'use strict';var emlformat=require(_0x959e('0x0'));var rimraf=require(_0x959e('0x1'));var zipdir=require(_0x959e('0x2'));var jsonpatch=require(_0x959e('0x3'));var rp=require(_0x959e('0x4'));var moment=require(_0x959e('0x5'));var BPromise=require(_0x959e('0x6'));var Mustache=require(_0x959e('0x7'));var util=require('util');var path=require(_0x959e('0x8'));var sox=require(_0x959e('0x9'));var csv=require(_0x959e('0xa'));var ejs=require(_0x959e('0xb'));var fs=require('fs');var fs_extra=require(_0x959e('0xc'));var _=require(_0x959e('0xd'));var squel=require(_0x959e('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x959e('0xf'));var Papa=require(_0x959e('0x10'));var extract=require(_0x959e('0x11'));var rimraf=require(_0x959e('0x1'));var archiver=require(_0x959e('0x12'));var Redis=require(_0x959e('0x13'));var authService=require(_0x959e('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x959e('0x15'));var hardwareService=require(_0x959e('0x16'));var logger=require(_0x959e('0x17'))(_0x959e('0x18'));var utils=require(_0x959e('0x19'));var config=require(_0x959e('0x1a'));var licenseUtil=require('../../config/license/util');var db=require(_0x959e('0x1b'))['db'];config[_0x959e('0x1c')]=_[_0x959e('0x1d')](config[_0x959e('0x1c')],{'host':_0x959e('0x1e'),'port':0x18eb});var socket=require(_0x959e('0x1f'))(new Redis(config[_0x959e('0x1c')]));require(_0x959e('0x20'))[_0x959e('0x21')](socket);function respondWithStatusCode(_0x255d60,_0x48065a){_0x48065a=_0x48065a||0xcc;return function(_0x56f2b4){if(_0x56f2b4){return _0x255d60['sendStatus'](_0x48065a);}return _0x255d60[_0x959e('0x22')](_0x48065a)[_0x959e('0x23')]();};}function respondWithResult(_0x431488,_0x115104){_0x115104=_0x115104||0xc8;return function(_0x484600){if(_0x484600){return _0x431488[_0x959e('0x22')](_0x115104)['json'](_0x484600);}};}function respondWithFilteredResult(_0x5346c3,_0x26d294){return function(_0x18a4a6){if(_0x18a4a6){var _0x3bd4c0=typeof _0x26d294[_0x959e('0x24')]===_0x959e('0x25')&&typeof _0x26d294[_0x959e('0x26')]===_0x959e('0x25');var _0x1b7373=_0x18a4a6['count'];var _0x13070f=_0x3bd4c0?0x0:_0x26d294['offset'];var _0x324fec=_0x3bd4c0?_0x18a4a6[_0x959e('0x27')]:_0x26d294[_0x959e('0x24')]+_0x26d294['limit'];var _0xcb9c47;if(_0x324fec>=_0x1b7373){_0x324fec=_0x1b7373;_0xcb9c47=0xc8;}else{_0xcb9c47=0xce;}_0x5346c3[_0x959e('0x22')](_0xcb9c47);return _0x5346c3['set'](_0x959e('0x28'),_0x13070f+'-'+_0x324fec+'/'+_0x1b7373)['json'](_0x18a4a6);}return null;};}function patchUpdates(_0x818814){return function(_0x1a5eb2){try{jsonpatch[_0x959e('0x29')](_0x1a5eb2,_0x818814,!![]);}catch(_0x215a6e){return BPromise['reject'](_0x215a6e);}return _0x1a5eb2['save']();};}function saveUpdates(_0x532a06,_0x579c2a){return function(_0x950f72){if(_0x950f72){return _0x950f72[_0x959e('0x2a')](_0x532a06)[_0x959e('0x2b')](function(_0x80bd98){return _0x80bd98;});}return null;};}function removeEntity(_0x179a1a,_0x5c514e){return function(_0x45eed8){if(_0x45eed8){return _0x45eed8[_0x959e('0x2c')]()[_0x959e('0x2b')](function(){var _0x1dcb1d=_0x45eed8[_0x959e('0x2d')]({'plain':!![]});var _0x2f5961='Plugins';return db['UserProfileResource'][_0x959e('0x2c')]({'where':{'type':_0x2f5961,'resourceId':_0x1dcb1d['id']}})[_0x959e('0x2b')](function(){return _0x45eed8;});})[_0x959e('0x2b')](function(){_0x179a1a[_0x959e('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4c9d42,_0x32f74d){return function(_0x14952b){if(!_0x14952b){_0x4c9d42[_0x959e('0x2e')](0x194);}return _0x14952b;};}function handleError(_0x4ce9af,_0x447c10){_0x447c10=_0x447c10||0x1f4;return function(_0x3e10a2){logger[_0x959e('0x2f')](_0x3e10a2['stack']);if(_0x3e10a2[_0x959e('0x30')]){delete _0x3e10a2[_0x959e('0x30')];}_0x4ce9af[_0x959e('0x22')](_0x447c10)[_0x959e('0x31')](_0x3e10a2);};}exports[_0x959e('0x32')]=function(_0x2bcc0b,_0x5e1e5e){var _0x54e245={},_0x641dd9={},_0x216b30={'count':0x0,'rows':[]};var _0x2ff1bc=_[_0x959e('0x33')](db[_0x959e('0x34')][_0x959e('0x35')],function(_0x121f8e){return{'name':_0x121f8e[_0x959e('0x36')],'type':_0x121f8e[_0x959e('0x37')]['key']};});_0x641dd9['model']=_[_0x959e('0x33')](_0x2ff1bc,_0x959e('0x30'));_0x641dd9[_0x959e('0x38')]=_[_0x959e('0x39')](_0x2bcc0b[_0x959e('0x38')]);_0x641dd9['filters']=_[_0x959e('0x3a')](_0x641dd9['model'],_0x641dd9[_0x959e('0x38')]);_0x54e245[_0x959e('0x3b')]=_[_0x959e('0x3a')](_0x641dd9['model'],qs['fields'](_0x2bcc0b[_0x959e('0x38')][_0x959e('0x3c')]));_0x54e245[_0x959e('0x3b')]=_0x54e245[_0x959e('0x3b')]['length']?_0x54e245[_0x959e('0x3b')]:_0x641dd9[_0x959e('0x3d')];if(!_0x2bcc0b[_0x959e('0x38')][_0x959e('0x3e')]('nolimit')){_0x54e245[_0x959e('0x26')]=qs[_0x959e('0x26')](_0x2bcc0b[_0x959e('0x38')]['limit']);_0x54e245[_0x959e('0x24')]=qs['offset'](_0x2bcc0b['query'][_0x959e('0x24')]);}_0x54e245[_0x959e('0x3f')]=qs[_0x959e('0x40')](_0x2bcc0b[_0x959e('0x38')][_0x959e('0x40')]);_0x54e245['where']=qs[_0x959e('0x41')](_[_0x959e('0x42')](_0x2bcc0b[_0x959e('0x38')],_0x641dd9[_0x959e('0x41')]),_0x2ff1bc);if(_0x2bcc0b[_0x959e('0x38')][_0x959e('0x43')]){_0x54e245[_0x959e('0x44')]=_['merge'](_0x54e245[_0x959e('0x44')],{'$or':_[_0x959e('0x33')](_0x2ff1bc,function(_0x48192f){if(_0x48192f[_0x959e('0x37')]!==_0x959e('0x45')){var _0x14a942={};_0x14a942[_0x48192f[_0x959e('0x30')]]={'$like':'%'+_0x2bcc0b[_0x959e('0x38')][_0x959e('0x43')]+'%'};return _0x14a942;}})});}_0x54e245=_[_0x959e('0x46')]({},_0x54e245,_0x2bcc0b[_0x959e('0x47')]);var _0x225741={'where':_0x54e245[_0x959e('0x44')]};return db['Plugin'][_0x959e('0x27')](_0x225741)[_0x959e('0x2b')](function(_0x2020b8){_0x216b30[_0x959e('0x27')]=_0x2020b8;if(_0x2bcc0b[_0x959e('0x38')][_0x959e('0x48')]){_0x54e245[_0x959e('0x49')]=[{'all':!![]}];}return db[_0x959e('0x34')][_0x959e('0x4a')](_0x54e245);})[_0x959e('0x2b')](function(_0x39772d){_0x216b30['rows']=_0x39772d;return _0x216b30;})[_0x959e('0x2b')](respondWithFilteredResult(_0x5e1e5e,_0x54e245))[_0x959e('0x4b')](handleError(_0x5e1e5e,null));};exports[_0x959e('0x4c')]=function(_0x31e269,_0x3d3f67){var _0x2b002a={'raw':!![],'where':{'id':_0x31e269[_0x959e('0x4d')]['id']}},_0x2ba1d9={};_0x2ba1d9[_0x959e('0x3d')]=_[_0x959e('0x39')](db['Plugin']['rawAttributes']);_0x2ba1d9[_0x959e('0x38')]=_[_0x959e('0x39')](_0x31e269['query']);_0x2ba1d9[_0x959e('0x41')]=_[_0x959e('0x3a')](_0x2ba1d9[_0x959e('0x3d')],_0x2ba1d9[_0x959e('0x38')]);_0x2b002a['attributes']=_[_0x959e('0x3a')](_0x2ba1d9['model'],qs[_0x959e('0x3c')](_0x31e269[_0x959e('0x38')]['fields']));_0x2b002a['attributes']=_0x2b002a[_0x959e('0x3b')][_0x959e('0x4e')]?_0x2b002a[_0x959e('0x3b')]:_0x2ba1d9[_0x959e('0x3d')];if(_0x31e269[_0x959e('0x38')]['includeAll']){_0x2b002a[_0x959e('0x49')]=[{'all':!![]}];}_0x2b002a=_['merge']({},_0x2b002a,_0x31e269[_0x959e('0x47')]);return db[_0x959e('0x34')][_0x959e('0x4f')](_0x2b002a)[_0x959e('0x2b')](handleEntityNotFound(_0x3d3f67,null))[_0x959e('0x2b')](respondWithResult(_0x3d3f67,null))[_0x959e('0x4b')](handleError(_0x3d3f67,null));};exports[_0x959e('0x50')]=function(_0x5af7b7,_0x240160,_0xa55590){return db[_0x959e('0x34')][_0x959e('0x4f')]({'where':{'id':_0x5af7b7[_0x959e('0x4d')]['id']},'attributes':['name',_0x959e('0x8')],'raw':!![]})[_0x959e('0x2b')](handleEntityNotFound(_0x240160,null))['then'](function(_0x5a3ae7){if(_0x5a3ae7){var _0x112dfb=path['join'](config[_0x959e('0x51')],'server/files/plugins',util['format'](_0x959e('0x52'),path[_0x959e('0x53')](_0x5a3ae7[_0x959e('0x8')])));var _0x2f550f=fs[_0x959e('0x54')](_0x112dfb);var _0x4f93ed=archiver(_0x959e('0x55'),{'zlib':{'level':0x9}});_0x4f93ed['on']('warning',function(_0x3a4f14){if(_0x3a4f14['code']===_0x959e('0x56')){logger[_0x959e('0x2f')](_0x3a4f14);}else{throw new db[(_0x959e('0x57'))]['Error']('Error\x20while\x20generating\x20the\x20zip\x20archive');}});_0x4f93ed['on'](_0x959e('0x2f'),function(_0x535ddc){throw new db[(_0x959e('0x57'))][(_0x959e('0x58'))](_0x959e('0x59'));});_0x4f93ed[_0x959e('0x5a')](_0x2f550f);_0x4f93ed[_0x959e('0x5b')](_0x959e('0x5c'),{'cwd':path['join'](config['root'],_0x959e('0x5d'),path[_0x959e('0x5e')](_0x5a3ae7['path'])),'ignore':[path[_0x959e('0x5f')](path['basename'](_0x5a3ae7['path']),'node_modules/**/*'),path['join'](path[_0x959e('0x53')](_0x5a3ae7[_0x959e('0x8')]),'attachments/**/*')],'nodir':!![]})[_0x959e('0x60')]();_0x2f550f['on'](_0x959e('0x61'),function(){if(!fs[_0x959e('0x62')](_0x112dfb)){throw new db[(_0x959e('0x57'))][(_0x959e('0x58'))](_0x959e('0x63'));}return _0x240160[_0x959e('0x50')](_0x112dfb,util['format'](_0x959e('0x52'),path['basename'](_0x5a3ae7['path'])),function(_0x552b00){if(_0x552b00){throw new db[(_0x959e('0x57'))][(_0x959e('0x58'))]('Error\x20while\x20downloading\x20the\x20plugin');}fs[_0x959e('0x64')](_0x112dfb);logger[_0x959e('0x65')](_0x959e('0x66'));logger['info'](_0x959e('0x67'));});});}return null;})[_0x959e('0x4b')](handleError(_0x240160,null));};exports[_0x959e('0x68')]=function(_0x20c339,_0x1d3522,_0x540ade){var _0x2b3cc2=path[_0x959e('0x53')](_0x20c339[_0x959e('0x69')][_0x959e('0x6a')],path['extname'](_0x20c339[_0x959e('0x69')][_0x959e('0x6a')]));var _0x5828a1=path['join'](config[_0x959e('0x51')],_0x959e('0x5d'),_0x20c339[_0x959e('0x69')][_0x959e('0x6a')]);var _0x3e71de=path['join'](config[_0x959e('0x51')],_0x959e('0x5d'),_0x2b3cc2);logger[_0x959e('0x65')](_0x959e('0x6b'),_0x5828a1);logger[_0x959e('0x65')](_0x959e('0x6c'),_0x3e71de);try{fs[_0x959e('0x6d')](_0x5828a1,parseInt(_0x959e('0x6e'),0x8));extract(_0x5828a1,{'dir':_0x3e71de},function(_0x46c256){if(_0x46c256){logger[_0x959e('0x2f')](_0x46c256);handleError(_0x46c256,!![]);};var _0x3dca80=fs['readdirSync'](_0x3e71de);if(_0x3dca80[_0x959e('0x4e')]>0x1){removeReferences(_0x5828a1,_0x3e71de);logger[_0x959e('0x2f')](_0x959e('0x6f'));return _0x540ade(new Error(_0x959e('0x6f')));}var _0x37c303=fs[_0x959e('0x70')](path[_0x959e('0x5f')](_0x3e71de,_0x3dca80[0x0]));if(_0x37c303[_0x959e('0x71')]()){removeReferences(_0x5828a1,_0x3e71de);logger[_0x959e('0x2f')](_0x959e('0x6f'));return _0x540ade(new Error(_0x959e('0x6f')));}if(_0x37c303[_0x959e('0x72')]()){var _0x4c040c=fs[_0x959e('0x73')](path['join'](_0x3e71de,_0x3dca80[0x0]));if(_0x4c040c[_0x959e('0x4e')]===0x0){removeReferences(_0x5828a1,_0x3e71de);logger[_0x959e('0x2f')](_0x959e('0x6f'));return _0x540ade(new Error(_0x959e('0x6f')));}var _0x36a8f4=_0x4c040c[_0x959e('0x74')](function(_0x4707fa){return _0x4707fa===_0x959e('0x75');});if(!_0x36a8f4){return _0x540ade(new Error(_0x959e('0x76')));}var _0xe702ae=fs[_0x959e('0x77')](path[_0x959e('0x5f')](_0x3e71de,_0x3dca80[0x0],_0x959e('0x75')));var _0x29ed1e=JSON[_0x959e('0x78')](_0xe702ae);if(_0x959e('0x25')==typeof _0x29ed1e[_0x959e('0x30')]){return _0x540ade(new Error(_0x959e('0x79')));}if(_0x959e('0x25')==typeof _0x29ed1e['type']){return _0x540ade(new Error(_0x959e('0x7a')));}if(_0x959e('0x25')==typeof _0x29ed1e[_0x959e('0x7b')]){return _0x540ade(new Error('Invalid\x20manifest:\x20version\x20not\x20specified'));}if('undefined'==typeof _0x29ed1e[_0x959e('0x7c')]){return _0x540ade(new Error(_0x959e('0x7d')));}if(_0x29ed1e['type']==='html'){if('undefined'==typeof _0x29ed1e[_0x959e('0x7c')][_0x959e('0x7e')]){return _0x540ade(new Error(_0x959e('0x7f')));}if('undefined'==typeof _0x29ed1e[_0x959e('0x7c')]['views']['admin']&&_0x959e('0x25')==typeof _0x29ed1e[_0x959e('0x7c')]['views']['agent']){return _0x540ade(new Error(_0x959e('0x80')));}}else if(_0x29ed1e[_0x959e('0x37')]===_0x959e('0x81')){if(_0x959e('0x25')==typeof _0x29ed1e[_0x959e('0x7c')]['scriptName']){return _0x540ade(new Error(_0x959e('0x82')));}if('undefined'==typeof _0x29ed1e['parameters'][_0x959e('0x83')]){return _0x540ade(new Error(_0x959e('0x84')));}}else{return _0x540ade(new Error(_0x959e('0x85')));}var _0x1e694e=_0x29ed1e[_0x959e('0x30')];var _0x4e2dce=_0x29ed1e[_0x959e('0x86')];var _0x1787d8=_0x29ed1e['type'];var _0x3e63a0=_0x29ed1e['sidebar']?_0x29ed1e[_0x959e('0x87')]:_0x959e('0x88');var _0x29f301=_0x29ed1e[_0x959e('0x89')]?_0x29ed1e['icon']:_0x959e('0x8a');var _0x110563='';var _0x3c5a7d='';var _0x2e1182='';var _0x3e1e3a='';var _0x4d0bbb=_0x29ed1e[_0x959e('0x7b')];if(_0x1787d8===_0x959e('0x8b')){if(_0x959e('0x25')!=typeof _0x29ed1e[_0x959e('0x7c')][_0x959e('0x7e')][_0x959e('0x8c')]){var _0xf34f08=_0x29ed1e[_0x959e('0x7c')][_0x959e('0x7e')][_0x959e('0x8c')];if(!/^(f|ht)tps?:\/\//i[_0x959e('0x8d')](_0xf34f08)){_0x110563=path[_0x959e('0x5f')]('plugins',_0x2b3cc2,_0x3dca80[0x0],_0xf34f08);}else{_0x110563=_0xf34f08;}}else{logger['info'](_0x959e('0x8e'));}if(_0x959e('0x25')!=typeof _0x29ed1e[_0x959e('0x7c')][_0x959e('0x7e')][_0x959e('0x8f')]){var _0x13522d=_0x29ed1e[_0x959e('0x7c')][_0x959e('0x7e')][_0x959e('0x8f')];if(!/^(f|ht)tps?:\/\//i[_0x959e('0x8d')](_0x13522d)){_0x3c5a7d=path[_0x959e('0x5f')](_0x959e('0x90'),_0x2b3cc2,_0x3dca80[0x0],_0x13522d);}else{_0x3c5a7d=_0x13522d;}}else{logger['info']('Warning:\x20agent\x20view\x20not\x20specified');}}else if(_0x1787d8==='script'){_0x2e1182=_0x29ed1e[_0x959e('0x7c')]['scriptName'];_0x3e1e3a=_0x29ed1e[_0x959e('0x7c')][_0x959e('0x83')];if(_0x959e('0x25')!=typeof _0x29ed1e[_0x959e('0x7c')][_0x959e('0x7e')]){if(_0x959e('0x25')!=typeof _0x29ed1e['parameters'][_0x959e('0x7e')][_0x959e('0x8c')]){var _0xf34f08=_0x29ed1e[_0x959e('0x7c')][_0x959e('0x7e')][_0x959e('0x8c')];if(!/^(f|ht)tps?:\/\//i['test'](_0xf34f08)){_0x110563=path[_0x959e('0x5f')](_0x959e('0x90'),_0x2b3cc2,_0x3dca80[0x0],_0xf34f08);}else{_0x110563=_0xf34f08;}}if('undefined'!=typeof _0x29ed1e[_0x959e('0x7c')][_0x959e('0x7e')][_0x959e('0x8f')]){var _0x13522d=_0x29ed1e[_0x959e('0x7c')][_0x959e('0x7e')][_0x959e('0x8f')];if(!/^(f|ht)tps?:\/\//i[_0x959e('0x8d')](_0x13522d)){_0x3c5a7d=path[_0x959e('0x5f')](_0x959e('0x90'),_0x2b3cc2,_0x3dca80[0x0],_0x13522d);}else{_0x3c5a7d=_0x13522d;}}}}var _0x2e8402={'name':_0x1e694e,'description':_0x4e2dce,'path':path[_0x959e('0x5f')](_0x2b3cc2,_0x3dca80[0x0]),'type':_0x1787d8,'sidebar':_0x3e63a0,'icon':_0x29f301,'adminUrl':_0x110563,'agentUrl':_0x3c5a7d,'scriptName':_0x2e1182,'scriptPath':_0x3e1e3a,'version':_0x4d0bbb};removeReferences(_0x5828a1,null);return db[_0x959e('0x34')]['create'](_0x2e8402)[_0x959e('0x2b')](function(_0x2e7982){var _0x85cfd1={'role':_0x20c339[_0x959e('0x91')][_0x959e('0x92')],'userProfileId':_0x20c339[_0x959e('0x91')]['userProfileId']};if(!_0x85cfd1)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x85cfd1[_0x959e('0x92')]===_0x959e('0x93')){var _0x4ea202=_0x2e7982[_0x959e('0x2d')]({'plain':!![]});return db['UserProfileSection'][_0x959e('0x4f')]({'where':{'name':'Plugins','userProfileId':_0x85cfd1[_0x959e('0x94')]},'raw':!![]})[_0x959e('0x2b')](function(_0x4333e2){if(_0x4333e2&&_0x4333e2['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x4ea202['name'],'resourceId':_0x4ea202['id'],'type':_0x4333e2[_0x959e('0x30')],'sectionId':_0x4333e2['id']},{})[_0x959e('0x2b')](function(){return _0x2e7982;});}else{return _0x2e7982;}})[_0x959e('0x4b')](function(_0x2e92ed){logger[_0x959e('0x2f')](_0x959e('0x95'),_0x2e92ed);throw _0x2e92ed;});}return _0x2e7982;})['then'](respondWithResult(_0x1d3522,null))['catch'](handleError(_0x1d3522,null));}});}catch(_0x5c1e49){_0x1d3522[_0x959e('0x22')](0x1f4)[_0x959e('0x31')](_0x5c1e49);}};function removeReferences(_0x6073ef,_0x5c56b0){try{if(_0x6073ef){fs[_0x959e('0x64')](_0x6073ef);logger[_0x959e('0x65')](_0x959e('0x96'));}if(_0x5c56b0){rimraf(_0x5c56b0,function(){});logger['info'](_0x959e('0x97'));}}catch(_0x3f86ce){logger[_0x959e('0x2f')](_0x3f86ce);}}exports[_0x959e('0x2a')]=function(_0x45541d,_0x56e77b,_0x120d83){return db['Plugin']['find']({'where':{'id':_0x45541d[_0x959e('0x4d')]['id']}})[_0x959e('0x2b')](handleEntityNotFound(_0x56e77b,null))[_0x959e('0x2b')](saveUpdates(_0x45541d['body'],null))['then'](respondWithResult(_0x56e77b,null))[_0x959e('0x4b')](handleError(_0x56e77b,null));};exports[_0x959e('0x98')]=function(_0x1ce224,_0x16fb4b,_0x3afc64){return db[_0x959e('0x34')]['find']({'where':{'id':_0x1ce224['params']['id']}})[_0x959e('0x2b')](function(_0x4f323a){if(_0x4f323a){return _0x4f323a['destroy']();}})[_0x959e('0x2b')](function(_0x28960){rimraf(path[_0x959e('0x5f')](config['root'],'server/files/plugins',path[_0x959e('0x5e')](_0x28960[_0x959e('0x8')])),function(){});return _0x28960;})[_0x959e('0x2b')](handleEntityNotFound(_0x16fb4b,null))[_0x959e('0x2b')](respondWithStatusCode(_0x16fb4b,null))[_0x959e('0x4b')](handleError(_0x16fb4b,null));};exports[_0x959e('0x99')]=function(_0xf85288,_0x474420,_0x1a3f94){return BPromise[_0x959e('0x9a')]()[_0x959e('0x2b')](function(){if(!_0xf85288[_0x959e('0x38')][_0x959e('0x8')]){throw new Error(_0x959e('0x9b'));}if(!_0xf85288[_0x959e('0x38')][_0x959e('0x9c')]){throw new Error(_0x959e('0x9d'));}var _0x5a0a85=_0xf85288[_0x959e('0x38')][_0x959e('0x9e')]?_0xf85288[_0x959e('0x38')][_0x959e('0x9e')]+':'+_0xf85288[_0x959e('0x38')][_0x959e('0x9c')]:_0x959e('0x9f')+_0xf85288[_0x959e('0x38')][_0x959e('0x9c')];var _0x224277=_0xf85288[_0x959e('0x38')][_0x959e('0xa0')]?_0xf85288[_0x959e('0x38')][_0x959e('0xa0')]:!![];var _0x382ef6=_0xf85288['query'][_0x959e('0xa1')]?_0xf85288[_0x959e('0x38')][_0x959e('0xa1')]:null;var _0x1bd563={'method':_0xf85288['method'],'uri':util[_0x959e('0xa2')](_0x959e('0xa3'),_0x5a0a85,_0xf85288[_0x959e('0x38')][_0x959e('0x8')]),'json':_0x224277,'resolveWithFullResponse':!![],'encoding':_0x382ef6,'qs':_0xf85288[_0x959e('0x38')]};if(_0xf85288['headers']){_0x1bd563[_0x959e('0xa4')]=_0xf85288[_0x959e('0xa4')];if(_0x1bd563[_0x959e('0xa4')][_0x959e('0xa5')]){delete _0x1bd563['headers']['content-length'];}}if(_0x1bd563['headers'][_0x959e('0xa6')]){delete _0x1bd563[_0x959e('0xa4')][_0x959e('0xa6')];}return rp(_0x1bd563);})[_0x959e('0x2b')](function(_0x5bc8e1){if(_0x5bc8e1){_0x474420['set'](_0x5bc8e1['headers']);logger[_0x959e('0x65')](_0x5bc8e1[_0x959e('0x91')]);if(_[_0x959e('0xa7')](_0xf85288[_0x959e('0x38')][_0x959e('0x8')],'download')&&_0x5bc8e1['statusCode']==0x1f4){return _0x474420[_0x959e('0x2e')](_0x5bc8e1[_0x959e('0xa8')]);}else{return _0x474420[_0x959e('0x22')](_0x5bc8e1[_0x959e('0xa8')])[_0x959e('0x31')](_0x5bc8e1[_0x959e('0x91')]);}}else{return _0x474420[_0x959e('0x2e')](0xc8);}})[_0x959e('0x4b')](handleError(_0x474420,null));};exports[_0x959e('0xa9')]=function(_0x553f90,_0x40c0e2,_0xa43386){return BPromise['resolve']()[_0x959e('0x2b')](function(){if(!_0x553f90[_0x959e('0x38')][_0x959e('0x8')]){throw new Error(_0x959e('0x9b'));}if(!_0x553f90[_0x959e('0x38')][_0x959e('0x9c')]){throw new Error(_0x959e('0x9d'));}var _0x81fd82=_0x553f90[_0x959e('0x38')][_0x959e('0x9e')]?_0x553f90[_0x959e('0x38')][_0x959e('0x9e')]+':'+_0x553f90['query'][_0x959e('0x9c')]:'http://localhost:'+_0x553f90[_0x959e('0x38')][_0x959e('0x9c')];var _0x32238b=_0x553f90[_0x959e('0x38')][_0x959e('0xa0')]?_0x553f90[_0x959e('0x38')]['json']:!![];var _0x587abb=_0x553f90[_0x959e('0x38')][_0x959e('0xa1')]?_0x553f90[_0x959e('0x38')]['encoding']:null;var _0x15fdbb={'method':_0x553f90[_0x959e('0xaa')],'uri':util[_0x959e('0xa2')](_0x959e('0xa3'),_0x81fd82,_0x553f90[_0x959e('0x38')][_0x959e('0x8')]),'json':_0x32238b,'resolveWithFullResponse':!![],'encoding':_0x587abb,'body':_0x553f90['body']};if(_0x553f90['headers']){_0x15fdbb[_0x959e('0xa4')]=_0x553f90[_0x959e('0xa4')];if(_0x15fdbb[_0x959e('0xa4')][_0x959e('0xa5')]){delete _0x15fdbb[_0x959e('0xa4')][_0x959e('0xa5')];}}if(_0x15fdbb['headers'][_0x959e('0xa6')]){delete _0x15fdbb[_0x959e('0xa4')][_0x959e('0xa6')];}return rp(_0x15fdbb);})[_0x959e('0x2b')](function(_0x597450){if(_0x597450){_0x40c0e2[_0x959e('0xab')](_0x597450[_0x959e('0xa4')]);logger[_0x959e('0x65')](_0x597450['body']);return _0x40c0e2['status'](_0x597450['statusCode'])['send'](_0x597450[_0x959e('0x91')]);}else{return _0x40c0e2['sendStatus'](0xc8);}})[_0x959e('0x4b')](handleError(_0x40c0e2,null));}; \ No newline at end of file +var _0xf226=['../../mysqldb','redis','socket.io-emitter','./plugin.socket','register','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','get','destroy','end','error','stack','send','map','Plugin','rawAttributes','fieldName','model','name','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','merge','options','includeAll','catch','show','include','find','download','params','root','server/files/plugins','format','%s.zip','basename','zip','warning','code','ENOENT','Sequelize','Error\x20while\x20generating\x20the\x20zip\x20archive','glob','**/*','join','node_modules/**/*','attachments/**/*','finalize','Error','Error\x20while\x20downloading\x20the\x20plugin','info','Download\x20completed','Temporary\x20file\x20removed','upload','file','filename','extname','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','length','Invalid\x20plugin\x20structure','lstatSync','isDirectory','manifest.json','Plugin\x20manifest\x20missing','parse','type','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','admin','agent','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','description','sidebar','always','icon','icon-apps','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','Warning:\x20agent\x20view\x20not\x20specified','script','create','body','role','userProfileId','user','UserProfileSection','Plugins','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','delete','dirname','webhookGet','resolve','port','hostname','encoding','method','%s%s','headers','content-length','content-type','endsWith','statusCode','webhookPost','\x27PATH\x27\x20parameter\x20not\x20specified','\x27PORT\x27\x20parameter\x20not\x20specified','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x2ff5c6,_0x248fe2){var _0x5605f2=function(_0xc4a69){while(--_0xc4a69){_0x2ff5c6['push'](_0x2ff5c6['shift']());}};_0x5605f2(++_0x248fe2);}(_0xf226,0x1c9));var _0x6f22=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf226[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x6f22('0x0'));var rp=require(_0x6f22('0x1'));var moment=require(_0x6f22('0x2'));var BPromise=require(_0x6f22('0x3'));var Mustache=require('mustache');var util=require(_0x6f22('0x4'));var path=require(_0x6f22('0x5'));var sox=require('sox');var csv=require(_0x6f22('0x6'));var ejs=require(_0x6f22('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6f22('0x8'));var squel=require(_0x6f22('0x9'));var crypto=require(_0x6f22('0xa'));var jsforce=require(_0x6f22('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x6f22('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var extract=require('extract-zip');var rimraf=require('rimraf');var archiver=require('archiver');var Redis=require(_0x6f22('0xc'));var authService=require(_0x6f22('0xd'));var qs=require(_0x6f22('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6f22('0xf'));var logger=require('../../config/logger')(_0x6f22('0x10'));var utils=require(_0x6f22('0x11'));var config=require(_0x6f22('0x12'));var licenseUtil=require(_0x6f22('0x13'));var db=require(_0x6f22('0x14'))['db'];config[_0x6f22('0x15')]=_['defaults'](config[_0x6f22('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0x6f22('0x16'))(new Redis(config[_0x6f22('0x15')]));require(_0x6f22('0x17'))[_0x6f22('0x18')](socket);function respondWithStatusCode(_0x507bbc,_0x47cbdc){_0x47cbdc=_0x47cbdc||0xcc;return function(_0x151f4e){if(_0x151f4e){return _0x507bbc[_0x6f22('0x19')](_0x47cbdc);}return _0x507bbc[_0x6f22('0x1a')](_0x47cbdc)['end']();};}function respondWithResult(_0x5a6183,_0x213cc9){_0x213cc9=_0x213cc9||0xc8;return function(_0x35624b){if(_0x35624b){return _0x5a6183[_0x6f22('0x1a')](_0x213cc9)[_0x6f22('0x1b')](_0x35624b);}};}function respondWithFilteredResult(_0xd8c5e2,_0x435a1f){return function(_0x15a77f){if(_0x15a77f){var _0x26b3e6=typeof _0x435a1f[_0x6f22('0x1c')]===_0x6f22('0x1d')&&typeof _0x435a1f[_0x6f22('0x1e')]===_0x6f22('0x1d');var _0x2c397e=_0x15a77f[_0x6f22('0x1f')];var _0x3a362b=_0x26b3e6?0x0:_0x435a1f['offset'];var _0x2e8ee9=_0x26b3e6?_0x15a77f[_0x6f22('0x1f')]:_0x435a1f[_0x6f22('0x1c')]+_0x435a1f[_0x6f22('0x1e')];var _0x3d7342;if(_0x2e8ee9>=_0x2c397e){_0x2e8ee9=_0x2c397e;_0x3d7342=0xc8;}else{_0x3d7342=0xce;}_0xd8c5e2['status'](_0x3d7342);return _0xd8c5e2[_0x6f22('0x20')](_0x6f22('0x21'),_0x3a362b+'-'+_0x2e8ee9+'/'+_0x2c397e)[_0x6f22('0x1b')](_0x15a77f);}return null;};}function patchUpdates(_0x119827){return function(_0x4705ea){try{jsonpatch[_0x6f22('0x22')](_0x4705ea,_0x119827,!![]);}catch(_0x3a8b9b){return BPromise['reject'](_0x3a8b9b);}return _0x4705ea['save']();};}function saveUpdates(_0x3f511c,_0x4d0380){return function(_0x4538bc){if(_0x4538bc){return _0x4538bc[_0x6f22('0x23')](_0x3f511c)[_0x6f22('0x24')](function(_0x5adf34){return _0x5adf34;});}return null;};}function removeEntity(_0x2cc3c8,_0x363144){return function(_0x49aabe){if(_0x49aabe){return _0x49aabe['destroy']()['then'](function(){var _0x4a0d9b=_0x49aabe[_0x6f22('0x25')]({'plain':!![]});var _0x19e12a='Plugins';return db['UserProfileResource'][_0x6f22('0x26')]({'where':{'type':_0x19e12a,'resourceId':_0x4a0d9b['id']}})[_0x6f22('0x24')](function(){return _0x49aabe;});})['then'](function(){_0x2cc3c8[_0x6f22('0x1a')](0xcc)[_0x6f22('0x27')]();});}};}function handleEntityNotFound(_0x14a8e8,_0x1f26fc){return function(_0x4aec2c){if(!_0x4aec2c){_0x14a8e8['sendStatus'](0x194);}return _0x4aec2c;};}function handleError(_0x28b20c,_0x2b1a2e){_0x2b1a2e=_0x2b1a2e||0x1f4;return function(_0xeb433b){logger[_0x6f22('0x28')](_0xeb433b[_0x6f22('0x29')]);if(_0xeb433b['name']){delete _0xeb433b['name'];}_0x28b20c[_0x6f22('0x1a')](_0x2b1a2e)[_0x6f22('0x2a')](_0xeb433b);};}exports['index']=function(_0x55ffd2,_0x1394cc){var _0x5ee607={},_0x5214f8={},_0xc3f356={'count':0x0,'rows':[]};var _0xa712fb=_[_0x6f22('0x2b')](db[_0x6f22('0x2c')][_0x6f22('0x2d')],function(_0x27e71a){return{'name':_0x27e71a[_0x6f22('0x2e')],'type':_0x27e71a['type']['key']};});_0x5214f8[_0x6f22('0x2f')]=_[_0x6f22('0x2b')](_0xa712fb,_0x6f22('0x30'));_0x5214f8[_0x6f22('0x31')]=_[_0x6f22('0x32')](_0x55ffd2['query']);_0x5214f8[_0x6f22('0x33')]=_[_0x6f22('0x34')](_0x5214f8[_0x6f22('0x2f')],_0x5214f8[_0x6f22('0x31')]);_0x5ee607[_0x6f22('0x35')]=_['intersection'](_0x5214f8[_0x6f22('0x2f')],qs[_0x6f22('0x36')](_0x55ffd2['query'][_0x6f22('0x36')]));_0x5ee607['attributes']=_0x5ee607['attributes']['length']?_0x5ee607[_0x6f22('0x35')]:_0x5214f8[_0x6f22('0x2f')];if(!_0x55ffd2[_0x6f22('0x31')]['hasOwnProperty'](_0x6f22('0x37'))){_0x5ee607[_0x6f22('0x1e')]=qs[_0x6f22('0x1e')](_0x55ffd2[_0x6f22('0x31')][_0x6f22('0x1e')]);_0x5ee607[_0x6f22('0x1c')]=qs['offset'](_0x55ffd2[_0x6f22('0x31')][_0x6f22('0x1c')]);}_0x5ee607[_0x6f22('0x38')]=qs[_0x6f22('0x39')](_0x55ffd2['query']['sort']);_0x5ee607[_0x6f22('0x3a')]=qs[_0x6f22('0x33')](_[_0x6f22('0x3b')](_0x55ffd2[_0x6f22('0x31')],_0x5214f8[_0x6f22('0x33')]),_0xa712fb);if(_0x55ffd2['query'][_0x6f22('0x3c')]){_0x5ee607[_0x6f22('0x3a')]=_[_0x6f22('0x3d')](_0x5ee607[_0x6f22('0x3a')],{'$or':_[_0x6f22('0x2b')](_0xa712fb,function(_0x5de250){if(_0x5de250['type']!=='VIRTUAL'){var _0x4940b5={};_0x4940b5[_0x5de250[_0x6f22('0x30')]]={'$like':'%'+_0x55ffd2['query'][_0x6f22('0x3c')]+'%'};return _0x4940b5;}})});}_0x5ee607=_[_0x6f22('0x3d')]({},_0x5ee607,_0x55ffd2[_0x6f22('0x3e')]);var _0x32b06e={'where':_0x5ee607['where']};return db[_0x6f22('0x2c')][_0x6f22('0x1f')](_0x32b06e)[_0x6f22('0x24')](function(_0x32602e){_0xc3f356[_0x6f22('0x1f')]=_0x32602e;if(_0x55ffd2[_0x6f22('0x31')][_0x6f22('0x3f')]){_0x5ee607['include']=[{'all':!![]}];}return db[_0x6f22('0x2c')]['findAll'](_0x5ee607);})['then'](function(_0x340d6e){_0xc3f356['rows']=_0x340d6e;return _0xc3f356;})[_0x6f22('0x24')](respondWithFilteredResult(_0x1394cc,_0x5ee607))[_0x6f22('0x40')](handleError(_0x1394cc,null));};exports[_0x6f22('0x41')]=function(_0x4ab501,_0xee059f){var _0x3cf621={'raw':!![],'where':{'id':_0x4ab501['params']['id']}},_0x4202ce={};_0x4202ce[_0x6f22('0x2f')]=_[_0x6f22('0x32')](db[_0x6f22('0x2c')]['rawAttributes']);_0x4202ce[_0x6f22('0x31')]=_[_0x6f22('0x32')](_0x4ab501[_0x6f22('0x31')]);_0x4202ce['filters']=_[_0x6f22('0x34')](_0x4202ce[_0x6f22('0x2f')],_0x4202ce['query']);_0x3cf621['attributes']=_['intersection'](_0x4202ce[_0x6f22('0x2f')],qs[_0x6f22('0x36')](_0x4ab501[_0x6f22('0x31')]['fields']));_0x3cf621[_0x6f22('0x35')]=_0x3cf621[_0x6f22('0x35')]['length']?_0x3cf621[_0x6f22('0x35')]:_0x4202ce['model'];if(_0x4ab501[_0x6f22('0x31')][_0x6f22('0x3f')]){_0x3cf621[_0x6f22('0x42')]=[{'all':!![]}];}_0x3cf621=_[_0x6f22('0x3d')]({},_0x3cf621,_0x4ab501['options']);return db[_0x6f22('0x2c')][_0x6f22('0x43')](_0x3cf621)[_0x6f22('0x24')](handleEntityNotFound(_0xee059f,null))[_0x6f22('0x24')](respondWithResult(_0xee059f,null))[_0x6f22('0x40')](handleError(_0xee059f,null));};exports[_0x6f22('0x44')]=function(_0x446f73,_0x21f76e,_0x4b66ee){return db[_0x6f22('0x2c')]['find']({'where':{'id':_0x446f73[_0x6f22('0x45')]['id']},'attributes':[_0x6f22('0x30'),_0x6f22('0x5')],'raw':!![]})[_0x6f22('0x24')](handleEntityNotFound(_0x21f76e,null))['then'](function(_0x4bb43f){if(_0x4bb43f){var _0x51e5da=path['join'](config[_0x6f22('0x46')],_0x6f22('0x47'),util[_0x6f22('0x48')](_0x6f22('0x49'),path[_0x6f22('0x4a')](_0x4bb43f[_0x6f22('0x5')])));var _0x2738f3=fs['createWriteStream'](_0x51e5da);var _0x3c1289=archiver(_0x6f22('0x4b'),{'zlib':{'level':0x9}});_0x3c1289['on'](_0x6f22('0x4c'),function(_0x92c2){if(_0x92c2[_0x6f22('0x4d')]===_0x6f22('0x4e')){logger[_0x6f22('0x28')](_0x92c2);}else{throw new db[(_0x6f22('0x4f'))]['Error']('Error\x20while\x20generating\x20the\x20zip\x20archive');}});_0x3c1289['on'](_0x6f22('0x28'),function(_0x5782cd){throw new db[(_0x6f22('0x4f'))]['Error'](_0x6f22('0x50'));});_0x3c1289['pipe'](_0x2738f3);_0x3c1289[_0x6f22('0x51')](_0x6f22('0x52'),{'cwd':path[_0x6f22('0x53')](config[_0x6f22('0x46')],'server/files/plugins',path['dirname'](_0x4bb43f[_0x6f22('0x5')])),'ignore':[path[_0x6f22('0x53')](path[_0x6f22('0x4a')](_0x4bb43f['path']),_0x6f22('0x54')),path[_0x6f22('0x53')](path[_0x6f22('0x4a')](_0x4bb43f['path']),_0x6f22('0x55'))],'nodir':!![]})[_0x6f22('0x56')]();_0x2738f3['on']('close',function(){if(!fs['existsSync'](_0x51e5da)){throw new db[(_0x6f22('0x4f'))]['Error']('Plugin\x20not\x20found');}return _0x21f76e[_0x6f22('0x44')](_0x51e5da,util[_0x6f22('0x48')](_0x6f22('0x49'),path[_0x6f22('0x4a')](_0x4bb43f['path'])),function(_0xb00bba){if(_0xb00bba){throw new db[(_0x6f22('0x4f'))][(_0x6f22('0x57'))](_0x6f22('0x58'));}fs['unlinkSync'](_0x51e5da);logger[_0x6f22('0x59')](_0x6f22('0x5a'));logger[_0x6f22('0x59')](_0x6f22('0x5b'));});});}return null;})['catch'](handleError(_0x21f76e,null));};exports[_0x6f22('0x5c')]=function(_0x25098e,_0x515620,_0x486883){var _0x1955fd=path[_0x6f22('0x4a')](_0x25098e[_0x6f22('0x5d')][_0x6f22('0x5e')],path[_0x6f22('0x5f')](_0x25098e[_0x6f22('0x5d')]['filename']));var _0x1dc683=path['join'](config[_0x6f22('0x46')],_0x6f22('0x47'),_0x25098e[_0x6f22('0x5d')][_0x6f22('0x5e')]);var _0x1827f3=path[_0x6f22('0x53')](config[_0x6f22('0x46')],'server/files/plugins',_0x1955fd);logger[_0x6f22('0x59')]('Plugin\x20upload\x20filepath:\x20%s',_0x1dc683);logger[_0x6f22('0x59')](_0x6f22('0x60'),_0x1827f3);try{fs[_0x6f22('0x61')](_0x1dc683,parseInt(_0x6f22('0x62'),0x8));extract(_0x1dc683,{'dir':_0x1827f3},function(_0x1426bd){if(_0x1426bd){logger['error'](_0x1426bd);handleError(_0x1426bd,!![]);};var _0x1ecedb=fs['readdirSync'](_0x1827f3);if(_0x1ecedb[_0x6f22('0x63')]>0x1){removeReferences(_0x1dc683,_0x1827f3);logger[_0x6f22('0x28')]('Invalid\x20plugin\x20structure');return _0x486883(new Error(_0x6f22('0x64')));}var _0x4a8427=fs[_0x6f22('0x65')](path[_0x6f22('0x53')](_0x1827f3,_0x1ecedb[0x0]));if(_0x4a8427['isFile']()){removeReferences(_0x1dc683,_0x1827f3);logger[_0x6f22('0x28')](_0x6f22('0x64'));return _0x486883(new Error(_0x6f22('0x64')));}if(_0x4a8427[_0x6f22('0x66')]()){var _0x40f32e=fs['readdirSync'](path[_0x6f22('0x53')](_0x1827f3,_0x1ecedb[0x0]));if(_0x40f32e[_0x6f22('0x63')]===0x0){removeReferences(_0x1dc683,_0x1827f3);logger['error'](_0x6f22('0x64'));return _0x486883(new Error('Invalid\x20plugin\x20structure'));}var _0x1c77f1=_0x40f32e['some'](function(_0x305c9e){return _0x305c9e===_0x6f22('0x67');});if(!_0x1c77f1){return _0x486883(new Error(_0x6f22('0x68')));}var _0x3680f8=fs['readFileSync'](path[_0x6f22('0x53')](_0x1827f3,_0x1ecedb[0x0],_0x6f22('0x67')));var _0x351911=JSON[_0x6f22('0x69')](_0x3680f8);if(_0x6f22('0x1d')==typeof _0x351911[_0x6f22('0x30')]){return _0x486883(new Error('Invalid\x20manifest:\x20name\x20missing'));}if('undefined'==typeof _0x351911[_0x6f22('0x6a')]){return _0x486883(new Error(_0x6f22('0x6b')));}if(_0x6f22('0x1d')==typeof _0x351911[_0x6f22('0x6c')]){return _0x486883(new Error(_0x6f22('0x6d')));}if(_0x6f22('0x1d')==typeof _0x351911[_0x6f22('0x6e')]){return _0x486883(new Error(_0x6f22('0x6f')));}if(_0x351911['type']===_0x6f22('0x70')){if(_0x6f22('0x1d')==typeof _0x351911[_0x6f22('0x6e')][_0x6f22('0x71')]){return _0x486883(new Error('Invalid\x20manifest:\x20views\x20missing'));}if('undefined'==typeof _0x351911['parameters'][_0x6f22('0x71')][_0x6f22('0x72')]&&'undefined'==typeof _0x351911[_0x6f22('0x6e')][_0x6f22('0x71')][_0x6f22('0x73')]){return _0x486883(new Error('Invalid\x20manifest:\x20no\x20view\x20specified'));}}else if(_0x351911[_0x6f22('0x6a')]==='script'){if(_0x6f22('0x1d')==typeof _0x351911[_0x6f22('0x6e')][_0x6f22('0x74')]){return _0x486883(new Error(_0x6f22('0x75')));}if(_0x6f22('0x1d')==typeof _0x351911[_0x6f22('0x6e')][_0x6f22('0x76')]){return _0x486883(new Error(_0x6f22('0x77')));}}else{return _0x486883(new Error('Invalid\x20manifest:\x20invalid\x20type'));}var _0x5338a0=_0x351911[_0x6f22('0x30')];var _0x20f852=_0x351911[_0x6f22('0x78')];var _0x2feac4=_0x351911[_0x6f22('0x6a')];var _0x54965d=_0x351911[_0x6f22('0x79')]?_0x351911['sidebar']:_0x6f22('0x7a');var _0x484a3b=_0x351911[_0x6f22('0x7b')]?_0x351911['icon']:_0x6f22('0x7c');var _0x30744a='';var _0x122b8c='';var _0x1dd553='';var _0x5c8d42='';var _0x665ed3=_0x351911[_0x6f22('0x6c')];if(_0x2feac4==='html'){if(_0x6f22('0x1d')!=typeof _0x351911[_0x6f22('0x6e')]['views'][_0x6f22('0x72')]){var _0x5db3c4=_0x351911[_0x6f22('0x6e')][_0x6f22('0x71')][_0x6f22('0x72')];if(!/^(f|ht)tps?:\/\//i[_0x6f22('0x7d')](_0x5db3c4)){_0x30744a=path[_0x6f22('0x53')](_0x6f22('0x7e'),_0x1955fd,_0x1ecedb[0x0],_0x5db3c4);}else{_0x30744a=_0x5db3c4;}}else{logger[_0x6f22('0x59')](_0x6f22('0x7f'));}if('undefined'!=typeof _0x351911['parameters'][_0x6f22('0x71')][_0x6f22('0x73')]){var _0xda67a3=_0x351911[_0x6f22('0x6e')][_0x6f22('0x71')]['agent'];if(!/^(f|ht)tps?:\/\//i[_0x6f22('0x7d')](_0xda67a3)){_0x122b8c=path[_0x6f22('0x53')]('plugins',_0x1955fd,_0x1ecedb[0x0],_0xda67a3);}else{_0x122b8c=_0xda67a3;}}else{logger['info'](_0x6f22('0x80'));}}else if(_0x2feac4===_0x6f22('0x81')){_0x1dd553=_0x351911[_0x6f22('0x6e')]['scriptName'];_0x5c8d42=_0x351911[_0x6f22('0x6e')][_0x6f22('0x76')];if(_0x6f22('0x1d')!=typeof _0x351911[_0x6f22('0x6e')][_0x6f22('0x71')]){if('undefined'!=typeof _0x351911['parameters'][_0x6f22('0x71')]['admin']){var _0x5db3c4=_0x351911[_0x6f22('0x6e')][_0x6f22('0x71')][_0x6f22('0x72')];if(!/^(f|ht)tps?:\/\//i['test'](_0x5db3c4)){_0x30744a=path[_0x6f22('0x53')](_0x6f22('0x7e'),_0x1955fd,_0x1ecedb[0x0],_0x5db3c4);}else{_0x30744a=_0x5db3c4;}}if('undefined'!=typeof _0x351911[_0x6f22('0x6e')][_0x6f22('0x71')][_0x6f22('0x73')]){var _0xda67a3=_0x351911['parameters'][_0x6f22('0x71')]['agent'];if(!/^(f|ht)tps?:\/\//i[_0x6f22('0x7d')](_0xda67a3)){_0x122b8c=path[_0x6f22('0x53')](_0x6f22('0x7e'),_0x1955fd,_0x1ecedb[0x0],_0xda67a3);}else{_0x122b8c=_0xda67a3;}}}}var _0x41aa17={'name':_0x5338a0,'description':_0x20f852,'path':path[_0x6f22('0x53')](_0x1955fd,_0x1ecedb[0x0]),'type':_0x2feac4,'sidebar':_0x54965d,'icon':_0x484a3b,'adminUrl':_0x30744a,'agentUrl':_0x122b8c,'scriptName':_0x1dd553,'scriptPath':_0x5c8d42,'version':_0x665ed3};removeReferences(_0x1dc683,null);return db[_0x6f22('0x2c')][_0x6f22('0x82')](_0x41aa17)[_0x6f22('0x24')](function(_0x15262b){var _0xa0eee3={'role':_0x25098e[_0x6f22('0x83')][_0x6f22('0x84')],'userProfileId':_0x25098e[_0x6f22('0x83')][_0x6f22('0x85')]};if(!_0xa0eee3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xa0eee3['role']===_0x6f22('0x86')){var _0x7acb45=_0x15262b[_0x6f22('0x25')]({'plain':!![]});return db[_0x6f22('0x87')][_0x6f22('0x43')]({'where':{'name':_0x6f22('0x88'),'userProfileId':_0xa0eee3[_0x6f22('0x85')]},'raw':!![]})[_0x6f22('0x24')](function(_0x3b4315){if(_0x3b4315&&_0x3b4315[_0x6f22('0x89')]===0x0){return db[_0x6f22('0x8a')][_0x6f22('0x82')]({'name':_0x7acb45[_0x6f22('0x30')],'resourceId':_0x7acb45['id'],'type':_0x3b4315['name'],'sectionId':_0x3b4315['id']},{})[_0x6f22('0x24')](function(){return _0x15262b;});}else{return _0x15262b;}})[_0x6f22('0x40')](function(_0x15abd4){logger[_0x6f22('0x28')](_0x6f22('0x8b'),_0x15abd4);throw _0x15abd4;});}return _0x15262b;})[_0x6f22('0x24')](respondWithResult(_0x515620,null))['catch'](handleError(_0x515620,null));}});}catch(_0x27cdf6){_0x515620[_0x6f22('0x1a')](0x1f4)['send'](_0x27cdf6);}};function removeReferences(_0x48644f,_0x5f3a89){try{if(_0x48644f){fs['unlinkSync'](_0x48644f);logger[_0x6f22('0x59')](_0x6f22('0x8c'));}if(_0x5f3a89){rimraf(_0x5f3a89,function(){});logger[_0x6f22('0x59')](_0x6f22('0x8d'));}}catch(_0x49bd2d){logger[_0x6f22('0x28')](_0x49bd2d);}}exports[_0x6f22('0x23')]=function(_0x2eac95,_0x5c3eb2,_0x4efe63){return db['Plugin'][_0x6f22('0x43')]({'where':{'id':_0x2eac95[_0x6f22('0x45')]['id']}})[_0x6f22('0x24')](handleEntityNotFound(_0x5c3eb2,null))[_0x6f22('0x24')](saveUpdates(_0x2eac95[_0x6f22('0x83')],null))[_0x6f22('0x24')](respondWithResult(_0x5c3eb2,null))[_0x6f22('0x40')](handleError(_0x5c3eb2,null));};exports[_0x6f22('0x8e')]=function(_0x390285,_0x5b246e,_0x586c66){return db[_0x6f22('0x2c')]['find']({'where':{'id':_0x390285['params']['id']}})['then'](function(_0xfc7be5){if(_0xfc7be5){return _0xfc7be5[_0x6f22('0x26')]();}})[_0x6f22('0x24')](function(_0x34fe87){rimraf(path[_0x6f22('0x53')](config['root'],_0x6f22('0x47'),path[_0x6f22('0x8f')](_0x34fe87['path'])),function(){});return _0x34fe87;})[_0x6f22('0x24')](handleEntityNotFound(_0x5b246e,null))[_0x6f22('0x24')](respondWithStatusCode(_0x5b246e,null))[_0x6f22('0x40')](handleError(_0x5b246e,null));};exports[_0x6f22('0x90')]=function(_0x4de165,_0x46df69,_0x33cbc7){return BPromise[_0x6f22('0x91')]()[_0x6f22('0x24')](function(){if(!_0x4de165[_0x6f22('0x31')][_0x6f22('0x5')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x4de165[_0x6f22('0x31')][_0x6f22('0x92')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x46183d=_0x4de165[_0x6f22('0x31')][_0x6f22('0x93')]?_0x4de165[_0x6f22('0x31')][_0x6f22('0x93')]+':'+_0x4de165[_0x6f22('0x31')]['port']:'http://localhost:'+_0x4de165[_0x6f22('0x31')][_0x6f22('0x92')];var _0x5c0e17=_0x4de165[_0x6f22('0x31')][_0x6f22('0x1b')]?_0x4de165[_0x6f22('0x31')][_0x6f22('0x1b')]:!![];var _0x24baec=_0x4de165[_0x6f22('0x31')][_0x6f22('0x94')]?_0x4de165[_0x6f22('0x31')]['encoding']:null;var _0x1322f8={'method':_0x4de165[_0x6f22('0x95')],'uri':util[_0x6f22('0x48')](_0x6f22('0x96'),_0x46183d,_0x4de165[_0x6f22('0x31')][_0x6f22('0x5')]),'json':_0x5c0e17,'resolveWithFullResponse':!![],'encoding':_0x24baec,'qs':_0x4de165[_0x6f22('0x31')]};if(_0x4de165[_0x6f22('0x97')]){_0x1322f8[_0x6f22('0x97')]=_0x4de165[_0x6f22('0x97')];if(_0x1322f8[_0x6f22('0x97')][_0x6f22('0x98')]){delete _0x1322f8[_0x6f22('0x97')]['content-length'];}}if(_0x1322f8[_0x6f22('0x97')][_0x6f22('0x99')]){delete _0x1322f8[_0x6f22('0x97')][_0x6f22('0x99')];}return rp(_0x1322f8);})[_0x6f22('0x24')](function(_0x32db79){if(_0x32db79){_0x46df69[_0x6f22('0x20')](_0x32db79[_0x6f22('0x97')]);logger[_0x6f22('0x59')](_0x32db79['body']);if(_[_0x6f22('0x9a')](_0x4de165[_0x6f22('0x31')][_0x6f22('0x5')],_0x6f22('0x44'))&&_0x32db79[_0x6f22('0x9b')]==0x1f4){return _0x46df69[_0x6f22('0x19')](_0x32db79[_0x6f22('0x9b')]);}else{return _0x46df69['status'](_0x32db79[_0x6f22('0x9b')])[_0x6f22('0x2a')](_0x32db79[_0x6f22('0x83')]);}}else{return _0x46df69[_0x6f22('0x19')](0xc8);}})[_0x6f22('0x40')](handleError(_0x46df69,null));};exports[_0x6f22('0x9c')]=function(_0x4fb4ed,_0x32fa67,_0x1f9256){return BPromise[_0x6f22('0x91')]()[_0x6f22('0x24')](function(){if(!_0x4fb4ed[_0x6f22('0x31')][_0x6f22('0x5')]){throw new Error(_0x6f22('0x9d'));}if(!_0x4fb4ed[_0x6f22('0x31')]['port']){throw new Error(_0x6f22('0x9e'));}var _0x198670=_0x4fb4ed['query']['hostname']?_0x4fb4ed['query']['hostname']+':'+_0x4fb4ed[_0x6f22('0x31')][_0x6f22('0x92')]:'http://localhost:'+_0x4fb4ed['query'][_0x6f22('0x92')];var _0x4c1bfb=_0x4fb4ed[_0x6f22('0x31')][_0x6f22('0x1b')]?_0x4fb4ed[_0x6f22('0x31')][_0x6f22('0x1b')]:!![];var _0x4c6023=_0x4fb4ed[_0x6f22('0x31')][_0x6f22('0x94')]?_0x4fb4ed[_0x6f22('0x31')][_0x6f22('0x94')]:null;var _0x2a8119={'method':_0x4fb4ed[_0x6f22('0x95')],'uri':util[_0x6f22('0x48')](_0x6f22('0x96'),_0x198670,_0x4fb4ed[_0x6f22('0x31')]['path']),'json':_0x4c1bfb,'resolveWithFullResponse':!![],'encoding':_0x4c6023,'body':_0x4fb4ed['body']};if(_0x4fb4ed[_0x6f22('0x97')]){_0x2a8119[_0x6f22('0x97')]=_0x4fb4ed[_0x6f22('0x97')];if(_0x2a8119[_0x6f22('0x97')]['content-length']){delete _0x2a8119[_0x6f22('0x97')]['content-length'];}}if(_0x2a8119['headers'][_0x6f22('0x99')]){delete _0x2a8119['headers'][_0x6f22('0x99')];}return rp(_0x2a8119);})[_0x6f22('0x24')](function(_0x59988f){if(_0x59988f){_0x32fa67[_0x6f22('0x20')](_0x59988f[_0x6f22('0x97')]);logger[_0x6f22('0x59')](_0x59988f[_0x6f22('0x83')]);return _0x32fa67[_0x6f22('0x1a')](_0x59988f[_0x6f22('0x9b')])[_0x6f22('0x2a')](_0x59988f[_0x6f22('0x83')]);}else{return _0x32fa67['sendStatus'](0xc8);}})[_0x6f22('0x40')](handleError(_0x32fa67,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index 51a2dc4..6021cd0 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 _0x5496=['setMaxListeners','save','remove','hasOwnProperty','hook','events','../../mysqldb','Plugin'];(function(_0x1d962f,_0x4aa293){var _0x1602ae=function(_0x3a3ad3){while(--_0x3a3ad3){_0x1d962f['push'](_0x1d962f['shift']());}};_0x1602ae(++_0x4aa293);}(_0x5496,0x175));var _0x6549=function(_0x3c8086,_0x5ddac9){_0x3c8086=_0x3c8086-0x0;var _0x5de319=_0x5496[_0x3c8086];return _0x5de319;};'use strict';var EventEmitter=require(_0x6549('0x0'));var Plugin=require(_0x6549('0x1'))['db'][_0x6549('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0x6549('0x3')](0x0);var events={'afterCreate':_0x6549('0x4'),'afterUpdate':'update','afterDestroy':_0x6549('0x5')};function emitEvent(_0x4de1db){return function(_0x2d2155,_0x8112c5,_0x3750cc){PluginEvents['emit'](_0x4de1db+':'+_0x2d2155['id'],_0x2d2155);PluginEvents['emit'](_0x4de1db,_0x2d2155);_0x3750cc(null);};}for(var e in events){if(events[_0x6549('0x6')](e)){var event=events[e];Plugin[_0x6549('0x7')](e,emitEvent(event));}}module['exports']=PluginEvents; \ No newline at end of file +var _0x2e65=['save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','Plugin','setMaxListeners'];(function(_0x3fc287,_0x5c3f36){var _0x33af9f=function(_0x27cfc6){while(--_0x27cfc6){_0x3fc287['push'](_0x3fc287['shift']());}};_0x33af9f(++_0x5c3f36);}(_0x2e65,0x193));var _0x52e6=function(_0xabfec4,_0x35076e){_0xabfec4=_0xabfec4-0x0;var _0x7bafa2=_0x2e65[_0xabfec4];return _0x7bafa2;};'use strict';var EventEmitter=require(_0x52e6('0x0'));var Plugin=require(_0x52e6('0x1'))['db'][_0x52e6('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0x52e6('0x3')](0x0);var events={'afterCreate':_0x52e6('0x4'),'afterUpdate':_0x52e6('0x5'),'afterDestroy':_0x52e6('0x6')};function emitEvent(_0x74e40d){return function(_0x47912f,_0x383919,_0x12ee44){PluginEvents[_0x52e6('0x7')](_0x74e40d+':'+_0x47912f['id'],_0x47912f);PluginEvents[_0x52e6('0x7')](_0x74e40d,_0x47912f);_0x12ee44(null);};}for(var e in events){if(events[_0x52e6('0x8')](e)){var event=events[e];Plugin[_0x52e6('0x9')](e,emitEvent(event));}}module[_0x52e6('0xa')]=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index cbb6993..a7efdf1 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 _0xd53a=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./plugin.attributes','exports','define','Plugin','plugins','lodash','util'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xd53a,0x14e));var _0xad53=function(_0x55621a,_0x52aee7){_0x55621a=_0x55621a-0x0;var _0x45933c=_0xd53a[_0x55621a];return _0x45933c;};'use strict';var _=require(_0xad53('0x0'));var util=require(_0xad53('0x1'));var logger=require(_0xad53('0x2'))('api');var moment=require(_0xad53('0x3'));var BPromise=require(_0xad53('0x4'));var rp=require(_0xad53('0x5'));var fs=require('fs');var path=require(_0xad53('0x6'));var rimraf=require(_0xad53('0x7'));var config=require(_0xad53('0x8'));var attributes=require(_0xad53('0x9'));module[_0xad53('0xa')]=function(_0x384211,_0x1cceca){return _0x384211[_0xad53('0xb')](_0xad53('0xc'),attributes,{'tableName':_0xad53('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x67cb=['bluebird','request-promise','path','./plugin.attributes','exports','Plugin','plugins','lodash','../../config/logger','api','moment'];(function(_0x4cca6b,_0x1d9431){var _0x42f048=function(_0x95dd2c){while(--_0x95dd2c){_0x4cca6b['push'](_0x4cca6b['shift']());}};_0x42f048(++_0x1d9431);}(_0x67cb,0x19e));var _0xb67c=function(_0x34ad72,_0x1e43f6){_0x34ad72=_0x34ad72-0x0;var _0x5c9aa8=_0x67cb[_0x34ad72];return _0x5c9aa8;};'use strict';var _=require(_0xb67c('0x0'));var util=require('util');var logger=require(_0xb67c('0x1'))(_0xb67c('0x2'));var moment=require(_0xb67c('0x3'));var BPromise=require(_0xb67c('0x4'));var rp=require(_0xb67c('0x5'));var fs=require('fs');var path=require(_0xb67c('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xb67c('0x7'));module[_0xb67c('0x8')]=function(_0x4b90cb,_0xaa201a){return _0x4b90cb['define'](_0xb67c('0x9'),attributes,{'tableName':_0xb67c('0xa'),'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 1d92005..aa9024b 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 _0xa2a1=['info','Plugin,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','CreatePlugin','create','body','raw','then','debug','stringify','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request'];(function(_0x46f3f8,_0x12c74b){var _0xbc57cd=function(_0x34df37){while(--_0x34df37){_0x46f3f8['push'](_0x46f3f8['shift']());}};_0xbc57cd(++_0x12c74b);}(_0xa2a1,0xf6));var _0x1a2a=function(_0x29f6a8,_0x434270){_0x29f6a8=_0x29f6a8-0x0;var _0x29064c=_0xa2a1[_0x29f6a8];return _0x29064c;};'use strict';var _=require(_0x1a2a('0x0'));var util=require('util');var moment=require(_0x1a2a('0x1'));var BPromise=require(_0x1a2a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1a2a('0x3'));var db=require(_0x1a2a('0x4'))['db'];var utils=require(_0x1a2a('0x5'));var logger=require(_0x1a2a('0x6'))(_0x1a2a('0x7'));var config=require(_0x1a2a('0x8'));var jayson=require(_0x1a2a('0x9'));var client=jayson[_0x1a2a('0xa')][_0x1a2a('0xb')]({'port':0x232a});config[_0x1a2a('0xc')]=_[_0x1a2a('0xd')](config[_0x1a2a('0xc')],{'host':_0x1a2a('0xe'),'port':0x18eb});var socket=require(_0x1a2a('0xf'))(new Redis(config[_0x1a2a('0xc')]));require('./plugin.socket')[_0x1a2a('0x10')](socket);function respondWithRpcPromise(_0x254835,_0x51dd3c,_0x355c6d){return new BPromise(function(_0x32a372,_0x183423){return client[_0x1a2a('0x11')](_0x254835,_0x355c6d)['then'](function(_0xf730ef){logger[_0x1a2a('0x12')](_0x1a2a('0x13'),_0x51dd3c,_0x1a2a('0x14'));logger['debug']('Plugin,\x20%s,\x20%s,\x20%s',_0x51dd3c,_0x1a2a('0x14'),JSON['stringify'](_0xf730ef));if(_0xf730ef[_0x1a2a('0x15')]){if(_0xf730ef[_0x1a2a('0x15')][_0x1a2a('0x16')]===0x1f4){logger[_0x1a2a('0x15')](_0x1a2a('0x13'),_0x51dd3c,_0xf730ef[_0x1a2a('0x15')][_0x1a2a('0x17')]);return _0x183423(_0xf730ef[_0x1a2a('0x15')][_0x1a2a('0x17')]);}logger[_0x1a2a('0x15')](_0x1a2a('0x13'),_0x51dd3c,_0xf730ef[_0x1a2a('0x15')]['message']);return _0x32a372(_0xf730ef[_0x1a2a('0x15')][_0x1a2a('0x17')]);}else{logger[_0x1a2a('0x12')]('Plugin,\x20%s,\x20%s',_0x51dd3c,_0x1a2a('0x14'));_0x32a372(_0xf730ef[_0x1a2a('0x18')][_0x1a2a('0x17')]);}})[_0x1a2a('0x19')](function(_0x16a0e9){logger[_0x1a2a('0x15')](_0x1a2a('0x13'),_0x51dd3c,_0x16a0e9);_0x183423(_0x16a0e9);});});}exports[_0x1a2a('0x1a')]=function(_0x1fb90c){var _0x968bc4=this;return new Promise(function(_0x4c5e43,_0x2ba51a){return db['Plugin'][_0x1a2a('0x1b')](_0x1fb90c[_0x1a2a('0x1c')],{'raw':_0x1fb90c['options']?_0x1fb90c['options'][_0x1a2a('0x1d')]===undefined?!![]:![]:!![]})[_0x1a2a('0x1e')](function(_0x3f6fd7){logger['info'](_0x1a2a('0x1a'),_0x1fb90c);logger[_0x1a2a('0x1f')]('CreatePlugin',_0x1fb90c,JSON[_0x1a2a('0x20')](_0x3f6fd7));_0x4c5e43(_0x3f6fd7);})[_0x1a2a('0x19')](function(_0x26cd5b){logger['error'](_0x1a2a('0x1a'),_0x26cd5b[_0x1a2a('0x17')],_0x1fb90c);_0x2ba51a(_0x968bc4[_0x1a2a('0x15')](0x1f4,_0x26cd5b[_0x1a2a('0x17')]));});});}; \ No newline at end of file +var _0x2b00=['info','Plugin,\x20%s,\x20%s','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreatePlugin','Plugin','create','body','options','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','./plugin.socket','register','request','then'];(function(_0x166e88,_0x1bae10){var _0x43ec68=function(_0x2924a5){while(--_0x2924a5){_0x166e88['push'](_0x166e88['shift']());}};_0x43ec68(++_0x1bae10);}(_0x2b00,0x1ef));var _0x02b0=function(_0x57ad25,_0x30f4b6){_0x57ad25=_0x57ad25-0x0;var _0x14a80c=_0x2b00[_0x57ad25];return _0x14a80c;};'use strict';var _=require(_0x02b0('0x0'));var util=require(_0x02b0('0x1'));var moment=require('moment');var BPromise=require(_0x02b0('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x02b0('0x3'));var db=require(_0x02b0('0x4'))['db'];var utils=require(_0x02b0('0x5'));var logger=require(_0x02b0('0x6'))(_0x02b0('0x7'));var config=require(_0x02b0('0x8'));var jayson=require(_0x02b0('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x02b0('0xa')]=_[_0x02b0('0xb')](config[_0x02b0('0xa')],{'host':_0x02b0('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x02b0('0xa')]));require(_0x02b0('0xd'))[_0x02b0('0xe')](socket);function respondWithRpcPromise(_0x4a63fd,_0x2335de,_0x57ec4b){return new BPromise(function(_0x5b1d43,_0x1398b7){return client[_0x02b0('0xf')](_0x4a63fd,_0x57ec4b)[_0x02b0('0x10')](function(_0xcdba7a){logger[_0x02b0('0x11')](_0x02b0('0x12'),_0x2335de,_0x02b0('0x13'));logger[_0x02b0('0x14')](_0x02b0('0x15'),_0x2335de,'request\x20sent',JSON[_0x02b0('0x16')](_0xcdba7a));if(_0xcdba7a[_0x02b0('0x17')]){if(_0xcdba7a[_0x02b0('0x17')]['code']===0x1f4){logger[_0x02b0('0x17')]('Plugin,\x20%s,\x20%s',_0x2335de,_0xcdba7a[_0x02b0('0x17')]['message']);return _0x1398b7(_0xcdba7a[_0x02b0('0x17')][_0x02b0('0x18')]);}logger[_0x02b0('0x17')]('Plugin,\x20%s,\x20%s',_0x2335de,_0xcdba7a[_0x02b0('0x17')][_0x02b0('0x18')]);return _0x5b1d43(_0xcdba7a[_0x02b0('0x17')][_0x02b0('0x18')]);}else{logger['info']('Plugin,\x20%s,\x20%s',_0x2335de,_0x02b0('0x13'));_0x5b1d43(_0xcdba7a[_0x02b0('0x19')][_0x02b0('0x18')]);}})[_0x02b0('0x1a')](function(_0x4313a7){logger[_0x02b0('0x17')](_0x02b0('0x12'),_0x2335de,_0x4313a7);_0x1398b7(_0x4313a7);});});}exports[_0x02b0('0x1b')]=function(_0x57bf0c){var _0xc40253=this;return new Promise(function(_0x6e5ec4,_0x157cc7){return db[_0x02b0('0x1c')][_0x02b0('0x1d')](_0x57bf0c[_0x02b0('0x1e')],{'raw':_0x57bf0c[_0x02b0('0x1f')]?_0x57bf0c[_0x02b0('0x1f')]['raw']===undefined?!![]:![]:!![]})[_0x02b0('0x10')](function(_0xc5b8a8){logger['info']('CreatePlugin',_0x57bf0c);logger['debug'](_0x02b0('0x1b'),_0x57bf0c,JSON[_0x02b0('0x16')](_0xc5b8a8));_0x6e5ec4(_0xc5b8a8);})[_0x02b0('0x1a')](function(_0x55761a){logger[_0x02b0('0x17')](_0x02b0('0x1b'),_0x55761a[_0x02b0('0x18')],_0x57bf0c);_0x157cc7(_0xc40253[_0x02b0('0x17')](0x1f4,_0x55761a[_0x02b0('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index 3c58a37..e57b1ca 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 _0x0c49=['./plugin.events','save','remove','update','emit','removeListener','register','length','plugin:'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0x0c49,0x15f));var _0x90c4=function(_0x3a582c,_0x2b4cf7){_0x3a582c=_0x3a582c-0x0;var _0x1f1109=_0x0c49[_0x3a582c];return _0x1f1109;};'use strict';var PluginEvents=require(_0x90c4('0x0'));var events=[_0x90c4('0x1'),_0x90c4('0x2'),_0x90c4('0x3')];function createListener(_0xef33d0,_0x35bc9e){return function(_0x4a7c4a){_0x35bc9e[_0x90c4('0x4')](_0xef33d0,_0x4a7c4a);};}function removeListener(_0x558255,_0x3bb93){return function(){PluginEvents[_0x90c4('0x5')](_0x558255,_0x3bb93);};}exports[_0x90c4('0x6')]=function(_0xcb519){for(var _0xd56739=0x0,_0x5cadf8=events[_0x90c4('0x7')];_0xd56739<_0x5cadf8;_0xd56739++){var _0x989bd3=events[_0xd56739];var _0xae3e19=createListener(_0x90c4('0x8')+_0x989bd3,_0xcb519);PluginEvents['on'](_0x989bd3,_0xae3e19);}}; \ No newline at end of file +var _0xb810=['emit','removeListener','length','./plugin.events','save','update'];(function(_0x2681df,_0xf9decc){var _0x17163c=function(_0x423f79){while(--_0x423f79){_0x2681df['push'](_0x2681df['shift']());}};_0x17163c(++_0xf9decc);}(_0xb810,0xf3));var _0x0b81=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0xb810[_0x138adb];return _0x1b27f2;};'use strict';var PluginEvents=require(_0x0b81('0x0'));var events=[_0x0b81('0x1'),'remove',_0x0b81('0x2')];function createListener(_0x342331,_0x3c0116){return function(_0x477f93){_0x3c0116[_0x0b81('0x3')](_0x342331,_0x477f93);};}function removeListener(_0x961438,_0x19e609){return function(){PluginEvents[_0x0b81('0x4')](_0x961438,_0x19e609);};}exports['register']=function(_0x22b404){for(var _0x3afaa1=0x0,_0x1b26c9=events[_0x0b81('0x5')];_0x3afaa1<_0x1b26c9;_0x3afaa1++){var _0x12000b=events[_0x3afaa1];var _0x648f21=createListener('plugin:'+_0x12000b,_0x22b404);PluginEvents['on'](_0x12000b,_0x648f21);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index 7941ab3..375fb4e 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(_0x5520c6,_0x24f3c7){var _0x196c04=function(_0x143fd1){while(--_0x143fd1){_0x5520c6['push'](_0x5520c6['shift']());}};_0x196c04(++_0x24f3c7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0xa9e0[_0x4bfac3];return _0x15f0f2;};'use strict';var express=require(_0x0a9e('0x0'));var router=express[_0x0a9e('0x1')]();var auth=require(_0x0a9e('0x2'));var controller=require('./pm2.controller');router['get']('/',auth[_0x0a9e('0x3')](),controller['index']);router[_0x0a9e('0x4')](_0x0a9e('0x5'),auth[_0x0a9e('0x3')](),controller[_0x0a9e('0x6')]);router[_0x0a9e('0x7')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x8')]);router[_0x0a9e('0x9')](_0x0a9e('0x5'),auth['isAuthenticated'](),controller['update']);router[_0x0a9e('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);module[_0x0a9e('0xc')]=router; \ No newline at end of file +var _0xa9e0=['create','put','delete','destroy','exports','express','Router','../../components/auth/service','isAuthenticated','get','/:id','show','post'];(function(_0x5d066c,_0x17cb02){var _0x22f437=function(_0x407e5f){while(--_0x407e5f){_0x5d066c['push'](_0x5d066c['shift']());}};_0x22f437(++_0x17cb02);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xa9e0[_0x4fc9e6];return _0x551d28;};'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 98af217..1f21b86 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 _0x4fdb=['lodash','../../config/pm2','../../config/logger','api','path','child_process','exec','bluebird','status','json','error','stack','name','send','npm\x20install','info','index','then','reject','express','motion2','length','catch','show','describe','params','body','script','join','../../files/plugins','cwd','chdir','dump','restart','stop','hasOwnProperty','Unknown\x20status','destroy','Unknown\x20id'];(function(_0x3d39b2,_0x80e7b6){var _0x3a4df3=function(_0x40740a){while(--_0x40740a){_0x3d39b2['push'](_0x3d39b2['shift']());}};_0x3a4df3(++_0x80e7b6);}(_0x4fdb,0x9c));var _0xb4fd=function(_0x1555bf,_0x20bbc5){_0x1555bf=_0x1555bf-0x0;var _0x135c18=_0x4fdb[_0x1555bf];return _0x135c18;};'use strict';var _=require(_0xb4fd('0x0'));var pm2=require(_0xb4fd('0x1'));var logger=require(_0xb4fd('0x2'))(_0xb4fd('0x3'));var path=require(_0xb4fd('0x4'));var exec=require(_0xb4fd('0x5'))[_0xb4fd('0x6')];var BPromise=require(_0xb4fd('0x7'));function handleEntityNotFound(_0x1c0b08,_0x5b73bb){return function(_0x308de6){if(!_0x308de6){_0x1c0b08['sendStatus'](0x194);;}return _0x308de6;};}function respondWithResult(_0x14052b,_0x5d8b39){_0x5d8b39=_0x5d8b39||0xc8;return function(_0x53273f){if(_0x53273f){return _0x14052b[_0xb4fd('0x8')](_0x5d8b39)[_0xb4fd('0x9')](_0x53273f);}return null;};}function handleError(_0x1151b5,_0x52dca2){_0x52dca2=_0x52dca2||0x1f4;return function(_0x526d3b){logger[_0xb4fd('0xa')](_0x526d3b[_0xb4fd('0xb')]);if(_0x526d3b[_0xb4fd('0xc')]){delete _0x526d3b['name'];}_0x1151b5[_0xb4fd('0x8')](_0x52dca2)[_0xb4fd('0xd')](_0x526d3b);};}function execChildProcess(){return new BPromise(function(_0x2148db,_0x23b08f){exec(_0xb4fd('0xe'),function(_0x502379,_0xd05458,_0x1f3e30){logger[_0xb4fd('0xf')](_0xd05458);logger[_0xb4fd('0xf')](_0x1f3e30);if(_0x502379){logger['error'](_0x502379);return _0x23b08f(_0x502379);}return _0x2148db(_0xd05458);});});}exports[_0xb4fd('0x10')]=function(_0x65f08a,_0x345d35){return pm2['list']()[_0xb4fd('0x11')](function(_0x1234d7){if(_0x1234d7){var _0xc35d8d=_[_0xb4fd('0x12')](_0x1234d7,function(_0x36e88f){return _0x36e88f[_0xb4fd('0xc')]===_0xb4fd('0x13')||_0x36e88f['name']===_0xb4fd('0x14');});return{'rows':_0xc35d8d,'count':_0xc35d8d[_0xb4fd('0x15')]};}return null;})[_0xb4fd('0x11')](respondWithResult(_0x345d35,null))[_0xb4fd('0x16')](handleError(_0x345d35,null));};exports[_0xb4fd('0x17')]=function(_0x137e51,_0x1d0812){return pm2[_0xb4fd('0x18')](_0x137e51[_0xb4fd('0x19')]['id'])[_0xb4fd('0x11')](respondWithResult(_0x1d0812,null))[_0xb4fd('0x11')](handleEntityNotFound(_0x1d0812,null))['catch'](handleError(_0x1d0812,null));};exports['create']=function(_0x504e80,_0x5c14c0){if(_0x504e80[_0xb4fd('0x1a')][_0xb4fd('0xc')]&&_0x504e80[_0xb4fd('0x1a')][_0xb4fd('0x1b')]){var _0x458133=path[_0xb4fd('0x1c')](__dirname,_0xb4fd('0x1d'),_0x504e80['body']['script']);var _0x216307=process[_0xb4fd('0x1e')]();process[_0xb4fd('0x1f')](path['dirname'](_0x458133));return execChildProcess()[_0xb4fd('0x11')](function(_0x49d42c){process[_0xb4fd('0x1f')](_0x216307);return pm2['start']({'name':_0x504e80[_0xb4fd('0x1a')][_0xb4fd('0xc')],'script':_0x458133});})[_0xb4fd('0x11')](function(_0x261eda){pm2[_0xb4fd('0x20')]();return _0x261eda[0x0];})[_0xb4fd('0x11')](respondWithResult(_0x5c14c0,0xc9))[_0xb4fd('0x16')](handleError(_0x5c14c0,null));}else{return _0x5c14c0[_0xb4fd('0x8')](0x1f4)['send']({'message':'Missing\x20name\x20and/or\x20path'});}};exports['update']=function(_0x453982,_0x4bad85){if(_0x453982[_0xb4fd('0x1a')]['id']){delete _0x453982['body']['id'];}var _0x5738c2={'online':_0xb4fd('0x21'),'stopped':_0xb4fd('0x22')};if(_0x5738c2[_0xb4fd('0x23')](_0x453982['body'][_0xb4fd('0x8')])){return pm2[_0x5738c2[_0x453982[_0xb4fd('0x1a')][_0xb4fd('0x8')]]](_0x453982[_0xb4fd('0x19')]['id'])['then'](respondWithResult(_0x4bad85,0xc8))[_0xb4fd('0x16')](handleError(_0x4bad85,null));}else{return _0x4bad85[_0xb4fd('0x8')](0x1f4)['send']({'message':_0xb4fd('0x24')});}};exports[_0xb4fd('0x25')]=function(_0xbe7d2c,_0x597874){if(_0xbe7d2c[_0xb4fd('0x1a')]['id']){delete _0xbe7d2c[_0xb4fd('0x1a')]['id'];}if(_0xbe7d2c[_0xb4fd('0x19')]['id']){return pm2['delete'](_0xbe7d2c['params']['id'])['then'](function(_0x5f36e4){pm2[_0xb4fd('0x20')]();return _0x5f36e4[0x0];})[_0xb4fd('0x11')](respondWithResult(_0x597874,null))[_0xb4fd('0x16')](handleError(_0x597874,null));}else{return _0x597874[_0xb4fd('0x8')](0x1f4)[_0xb4fd('0xd')]({'message':_0xb4fd('0x26')});}}; \ No newline at end of file +var _0xf109=['name','send','info','index','list','express','motion2','then','catch','params','create','body','script','join','../../files/plugins','cwd','chdir','dirname','start','restart','stop','hasOwnProperty','Unknown\x20status','destroy','dump','Unknown\x20id','lodash','../../config/pm2','../../config/logger','exec','bluebird','sendStatus','status','json','error','stack'];(function(_0xacb1e2,_0x55e0ab){var _0x463815=function(_0x413c3b){while(--_0x413c3b){_0xacb1e2['push'](_0xacb1e2['shift']());}};_0x463815(++_0x55e0ab);}(_0xf109,0xce));var _0x9f10=function(_0x5ddaac,_0x2697a8){_0x5ddaac=_0x5ddaac-0x0;var _0x2a9c58=_0xf109[_0x5ddaac];return _0x2a9c58;};'use strict';var _=require(_0x9f10('0x0'));var pm2=require(_0x9f10('0x1'));var logger=require(_0x9f10('0x2'))('api');var path=require('path');var exec=require('child_process')[_0x9f10('0x3')];var BPromise=require(_0x9f10('0x4'));function handleEntityNotFound(_0x74d0ee,_0x26f01c){return function(_0x4027f4){if(!_0x4027f4){_0x74d0ee[_0x9f10('0x5')](0x194);;}return _0x4027f4;};}function respondWithResult(_0x408fe8,_0xd3137b){_0xd3137b=_0xd3137b||0xc8;return function(_0x227a29){if(_0x227a29){return _0x408fe8[_0x9f10('0x6')](_0xd3137b)[_0x9f10('0x7')](_0x227a29);}return null;};}function handleError(_0x5c8719,_0x42a8cd){_0x42a8cd=_0x42a8cd||0x1f4;return function(_0x3019eb){logger[_0x9f10('0x8')](_0x3019eb[_0x9f10('0x9')]);if(_0x3019eb[_0x9f10('0xa')]){delete _0x3019eb['name'];}_0x5c8719[_0x9f10('0x6')](_0x42a8cd)[_0x9f10('0xb')](_0x3019eb);};}function execChildProcess(){return new BPromise(function(_0x4522d9,_0x4e577d){exec('npm\x20install',function(_0x3fac2b,_0x311935,_0x407336){logger['info'](_0x311935);logger[_0x9f10('0xc')](_0x407336);if(_0x3fac2b){logger[_0x9f10('0x8')](_0x3fac2b);return _0x4e577d(_0x3fac2b);}return _0x4522d9(_0x311935);});});}exports[_0x9f10('0xd')]=function(_0x58067f,_0x9a3ae6){return pm2[_0x9f10('0xe')]()['then'](function(_0x40a48a){if(_0x40a48a){var _0x236e28=_['reject'](_0x40a48a,function(_0x59bcad){return _0x59bcad[_0x9f10('0xa')]===_0x9f10('0xf')||_0x59bcad['name']===_0x9f10('0x10');});return{'rows':_0x236e28,'count':_0x236e28['length']};}return null;})[_0x9f10('0x11')](respondWithResult(_0x9a3ae6,null))[_0x9f10('0x12')](handleError(_0x9a3ae6,null));};exports['show']=function(_0x11cc56,_0xd2950c){return pm2['describe'](_0x11cc56[_0x9f10('0x13')]['id'])['then'](respondWithResult(_0xd2950c,null))[_0x9f10('0x11')](handleEntityNotFound(_0xd2950c,null))['catch'](handleError(_0xd2950c,null));};exports[_0x9f10('0x14')]=function(_0x56fb44,_0x54c262){if(_0x56fb44[_0x9f10('0x15')][_0x9f10('0xa')]&&_0x56fb44[_0x9f10('0x15')][_0x9f10('0x16')]){var _0xa810c=path[_0x9f10('0x17')](__dirname,_0x9f10('0x18'),_0x56fb44['body'][_0x9f10('0x16')]);var _0x58e6ba=process[_0x9f10('0x19')]();process[_0x9f10('0x1a')](path[_0x9f10('0x1b')](_0xa810c));return execChildProcess()['then'](function(_0x2f31fb){process[_0x9f10('0x1a')](_0x58e6ba);return pm2[_0x9f10('0x1c')]({'name':_0x56fb44['body'][_0x9f10('0xa')],'script':_0xa810c});})[_0x9f10('0x11')](function(_0x44b99d){pm2['dump']();return _0x44b99d[0x0];})[_0x9f10('0x11')](respondWithResult(_0x54c262,0xc9))[_0x9f10('0x12')](handleError(_0x54c262,null));}else{return _0x54c262[_0x9f10('0x6')](0x1f4)[_0x9f10('0xb')]({'message':'Missing\x20name\x20and/or\x20path'});}};exports['update']=function(_0x5c1800,_0x385a39){if(_0x5c1800['body']['id']){delete _0x5c1800[_0x9f10('0x15')]['id'];}var _0x1de75a={'online':_0x9f10('0x1d'),'stopped':_0x9f10('0x1e')};if(_0x1de75a[_0x9f10('0x1f')](_0x5c1800['body'][_0x9f10('0x6')])){return pm2[_0x1de75a[_0x5c1800[_0x9f10('0x15')][_0x9f10('0x6')]]](_0x5c1800[_0x9f10('0x13')]['id'])[_0x9f10('0x11')](respondWithResult(_0x385a39,0xc8))[_0x9f10('0x12')](handleError(_0x385a39,null));}else{return _0x385a39['status'](0x1f4)[_0x9f10('0xb')]({'message':_0x9f10('0x20')});}};exports[_0x9f10('0x21')]=function(_0x1b03ee,_0x49b3f4){if(_0x1b03ee[_0x9f10('0x15')]['id']){delete _0x1b03ee[_0x9f10('0x15')]['id'];}if(_0x1b03ee[_0x9f10('0x13')]['id']){return pm2['delete'](_0x1b03ee[_0x9f10('0x13')]['id'])['then'](function(_0x1069ba){pm2[_0x9f10('0x22')]();return _0x1069ba[0x0];})[_0x9f10('0x11')](respondWithResult(_0x49b3f4,null))['catch'](handleError(_0x49b3f4,null));}else{return _0x49b3f4[_0x9f10('0x6')](0x1f4)[_0x9f10('0xb')]({'message':_0x9f10('0x23')});}}; \ No newline at end of file diff --git a/server/api/realtime/index.js b/server/api/realtime/index.js index 51bdcb5..6244136 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 _0x4baa=['../../components/auth/service','get','/queues','isAuthenticated','getQueues'];(function(_0x385359,_0x325c57){var _0x2ea4dd=function(_0x1bcf4f){while(--_0x1bcf4f){_0x385359['push'](_0x385359['shift']());}};_0x2ea4dd(++_0x325c57);}(_0x4baa,0x14f));var _0xa4ba=function(_0x53f463,_0x25e271){_0x53f463=_0x53f463-0x0;var _0x4f4cdd=_0x4baa[_0x53f463];return _0x4f4cdd;};'use strict';var express=require('express');var router=express['Router']();var auth=require(_0xa4ba('0x0'));var controller=require('./realtime.controller');router[_0xa4ba('0x1')](_0xa4ba('0x2'),auth[_0xa4ba('0x3')](),controller[_0xa4ba('0x4')]);module['exports']=router; \ No newline at end of file +var _0x3457=['getQueues','exports','get','/queues','isAuthenticated'];(function(_0x591df4,_0x4c5ad2){var _0x2412d7=function(_0x19e7e5){while(--_0x19e7e5){_0x591df4['push'](_0x591df4['shift']());}};_0x2412d7(++_0x4c5ad2);}(_0x3457,0x93));var _0x7345=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x3457[_0x122ef9];return _0x42fba0;};'use strict';var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var controller=require('./realtime.controller');router[_0x7345('0x0')](_0x7345('0x1'),auth[_0x7345('0x2')](),controller[_0x7345('0x3')]);module[_0x7345('0x4')]=router; \ No newline at end of file diff --git a/server/api/realtime/realtime.controller.js b/server/api/realtime/realtime.controller.js index c9a4807..20aebd3 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 _0xfdbd=['user','role','userProfileId','type','outbound','QueueCampaigns','Queues','UserProfile','getResources','findAndCountAll','request','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','loggedIn','available','waiting','push','pTalking','message','dialMethod','Trunk','startPredictive','startProgressive','erlangCalls','erlangCallToSecond','erlangBusyFactor','dialPredictiveInterval','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','rows','map','get','paused','loggedInDb','originated','agents','find','pick','getAgents','online','getMembers','UserId','User','QueueId','findAll','agent','length','all','catch','util','lodash','jayson/promise','../../components/parsers/qs','../../config/logger','api','../../mysqldb','client','http','limit','undefined','count','offset','status','set','json','error','stack','name','getQueues','mail','chat','sms','openchannel','voice','resolve','then','query','channel','includes','toLowerCase','startCase','Queue','rawAttributes','fieldName','key'];(function(_0x4c9206,_0x5155d0){var _0x197c5b=function(_0x5c8cae){while(--_0x5c8cae){_0x4c9206['push'](_0x4c9206['shift']());}};_0x197c5b(++_0x5155d0);}(_0xfdbd,0xf0));var _0xdfdb=function(_0x5e848d,_0x1dbd20){_0x5e848d=_0x5e848d-0x0;var _0x3785e5=_0xfdbd[_0x5e848d];return _0x3785e5;};'use strict';var util=require(_0xdfdb('0x0'));var _=require(_0xdfdb('0x1'));var jayson=require(_0xdfdb('0x2'));var qs=require(_0xdfdb('0x3'));var logger=require(_0xdfdb('0x4'))(_0xdfdb('0x5'));var db=require(_0xdfdb('0x6'))['db'];var client=jayson[_0xdfdb('0x7')][_0xdfdb('0x8')]({'port':0x232a});var routingClient=jayson['client'][_0xdfdb('0x8')]({'port':0x232c});function respondWithFilteredResult(_0x4a4a3f,_0x453ef6){return function(_0x41bd5e){if(_0x41bd5e){var _0x489f19=typeof _0x453ef6['offset']==='undefined'&&typeof _0x453ef6[_0xdfdb('0x9')]===_0xdfdb('0xa');var _0x47c629=_0x41bd5e[_0xdfdb('0xb')];var _0x444c19=_0x489f19?0x0:_0x453ef6[_0xdfdb('0xc')];var _0x27ddcd=_0x489f19?_0x41bd5e[_0xdfdb('0xb')]:_0x453ef6[_0xdfdb('0xc')]+_0x453ef6[_0xdfdb('0x9')];var _0x47dccc;if(_0x27ddcd>=_0x47c629){_0x27ddcd=_0x47c629;_0x47dccc=0xc8;}else{_0x47dccc=0xce;}_0x4a4a3f[_0xdfdb('0xd')](_0x47dccc);return _0x4a4a3f[_0xdfdb('0xe')]('Content-Range',_0x444c19+'-'+_0x27ddcd+'/'+_0x47c629)[_0xdfdb('0xf')](_0x41bd5e);}return null;};}function handleError(_0x33a706,_0x2bee3b){_0x2bee3b=_0x2bee3b||0x1f4;return function(_0x1918c1){logger[_0xdfdb('0x10')](_0x1918c1[_0xdfdb('0x11')]);if(_0x1918c1[_0xdfdb('0x12')]){delete _0x1918c1[_0xdfdb('0x12')];}_0x33a706['status'](_0x2bee3b)['send'](_0x1918c1);};}exports[_0xdfdb('0x13')]=function(_0x4b1ff7,_0x471ddc){var _0x9f3039=[_0xdfdb('0x14'),_0xdfdb('0x15'),_0xdfdb('0x16'),_0xdfdb('0x17'),'fax','whatsapp',_0xdfdb('0x18')];var _0x8b9193={'count':0x0,'rows':[]},_0x2c1070={},_0x55ab5a;Promise[_0xdfdb('0x19')]()[_0xdfdb('0x1a')](function(){if(_0x4b1ff7[_0xdfdb('0x1b')][_0xdfdb('0x1c')]){if(!_[_0xdfdb('0x1d')](_0x9f3039,_0x4b1ff7[_0xdfdb('0x1b')][_0xdfdb('0x1c')][_0xdfdb('0x1e')]()))throw new Error('Invalid\x20channel');_0x55ab5a=_0x4b1ff7[_0xdfdb('0x1b')][_0xdfdb('0x1c')][_0xdfdb('0x1e')]();}var _0x5cc70b=_[_0xdfdb('0x1f')](_0x55ab5a)+_0xdfdb('0x20');var _0x2c7dd1=_['map'](db[_0x5cc70b][_0xdfdb('0x21')],function(_0x789bd2){return{'name':_0x789bd2[_0xdfdb('0x22')],'type':_0x789bd2['type'][_0xdfdb('0x23')]};});_0x2c1070=qs['getOptions'](_0x2c7dd1,_0x4b1ff7);if(_0x4b1ff7[_0xdfdb('0x24')][_0xdfdb('0x25')]===_0xdfdb('0x24')){var _0x2a560c={'params':{'id':_0x4b1ff7['user'][_0xdfdb('0x26')]},'query':{'section':_0x55ab5a===_0xdfdb('0x18')&&_0x4b1ff7[_0xdfdb('0x1b')][_0xdfdb('0x27')]===_0xdfdb('0x28')?_0xdfdb('0x29'):_['startCase'](_0x55ab5a)+_0xdfdb('0x2a'),'type':_0x4b1ff7[_0xdfdb('0x1b')][_0xdfdb('0x27')],'nolimit':!![],'sort':'name','filter':_0x4b1ff7[_0xdfdb('0x1b')]['filter']}};return db[_0xdfdb('0x2b')][_0xdfdb('0x2c')](_0x2a560c);}return db[_0x5cc70b][_0xdfdb('0x2d')](_0x2c1070);})['then'](function(_0x5bc174){_0x8b9193[_0xdfdb('0xb')]=_0x5bc174[_0xdfdb('0xb')];var _0xedbb91=_0x55ab5a===_0xdfdb('0x18')?client:routingClient;return _0xedbb91[_0xdfdb('0x2e')](_[_0xdfdb('0x1f')](_0x55ab5a)+'Queues',_0x4b1ff7)[_0xdfdb('0x1a')](function(_0x364805){if(_0x364805[_0xdfdb('0x10')])throw new Error(util[_0xdfdb('0x2f')](_0xdfdb('0x30'),_0x55ab5a));var _0x157de8=_0x364805[_0xdfdb('0x31')];var _0x1ce036=[_0xdfdb('0x32'),_0xdfdb('0x33'),_0xdfdb('0x34'),'talking','paused'];if(_0x55ab5a===_0xdfdb('0x18')&&_0x4b1ff7['query'][_0xdfdb('0x27')]===_0xdfdb('0x28')){_0x1ce036[_0xdfdb('0x35')](_0xdfdb('0x36'),'originated',_0xdfdb('0x37'),'dialActive',_0xdfdb('0x38'),_0xdfdb('0x39'),_0xdfdb('0x3a'),_0xdfdb('0x3b'),_0xdfdb('0x3c'),_0xdfdb('0x3d'),'erlangAbandonmentRate',_0xdfdb('0x3e'),_0xdfdb('0x3f'),'dialPredictiveIntervalMaxThreshold',_0xdfdb('0x40'),_0xdfdb('0x41'),_0xdfdb('0x42'),_0xdfdb('0x43'),_0xdfdb('0x44'),_0xdfdb('0x45'),_0xdfdb('0x46'),_0xdfdb('0x47'));}var _0x21f4c7=_0x5bc174[_0xdfdb('0x48')][_0xdfdb('0x49')](function(_0x5530d8){var _0x2defcc=_0x5530d8[_0xdfdb('0x4a')]({'plain':!![]});_0x2defcc[_0xdfdb('0x4b')]=0x0;_0x2defcc[_0xdfdb('0x4c')]=0x0;_0x2defcc[_0xdfdb('0x32')]=0x0;_0x2defcc[_0xdfdb('0x33')]=0x0;_0x2defcc[_0xdfdb('0x4b')]=0x0;_0x2defcc[_0xdfdb('0x34')]=0x0;if(_0x55ab5a==='voice'){_0x2defcc['talking']=0x0;if(_0x4b1ff7[_0xdfdb('0x1b')][_0xdfdb('0x27')]===_0xdfdb('0x28')){_0x2defcc[_0xdfdb('0x36')]=0x0;_0x2defcc[_0xdfdb('0x4d')]=0x0;}}_0x2defcc[_0xdfdb('0x4e')]=[];var _0x3da4ca=_[_0xdfdb('0x4f')](_0x157de8[_0xdfdb('0x48')],['id',_0x2defcc['id']]);if(_0x3da4ca)_['merge'](_0x2defcc,_[_0xdfdb('0x50')](_0x3da4ca,_0x1ce036));if(_0x55ab5a===_0xdfdb('0x18')){return _0x5530d8[_0xdfdb('0x51')]({'attributes':['id',_0xdfdb('0x12'),_0xdfdb('0x52')],'joinTableAttributes':[],'raw':!![]})['then'](function(_0x281cec){return _0x5530d8[_0xdfdb('0x53')]({'raw':!![]})[_0xdfdb('0x1a')](function(_0x3f95fe){for(var _0x431004=0x0;_0x431004<_0x281cec['length'];_0x431004++){var _0x1d7a3a=_[_0xdfdb('0x4f')](_0x3f95fe,[_0xdfdb('0x54'),_0x281cec[_0x431004]['id']]);var _0x5b4381={'id':_0x281cec[_0x431004]['id'],'name':_0x281cec[_0x431004][_0xdfdb('0x12')],'online':Boolean(_0x281cec[_0x431004]['online']),'paused':_0x1d7a3a?Boolean(_0x1d7a3a[_0xdfdb('0x4b')]):![]};if(_0x5b4381['online'])_0x2defcc[_0xdfdb('0x4c')]++;if(_0x5b4381[_0xdfdb('0x4b')])_0x2defcc['paused']++;_0x2defcc[_0xdfdb('0x4e')]['push'](_0x5b4381);}return _0x2defcc;});});}else{var _0xfea790=_0xdfdb('0x55')+_[_0xdfdb('0x1f')](_0x55ab5a)+_0xdfdb('0x20');var _0x25cc2f=_0x55ab5a+'Pause';return db[_0xfea790]['findAll']({'where':{[_[_0xdfdb('0x1f')](_0x55ab5a)+_0xdfdb('0x56')]:_0x5530d8['id']},'raw':!![]})['then'](function(_0x2b0a8b){return db['User'][_0xdfdb('0x57')]({'attributes':['id',_0xdfdb('0x12'),_0xdfdb('0x52'),_0x25cc2f],'where':{'id':_[_0xdfdb('0x49')](_0x2b0a8b,_0xdfdb('0x54')),'role':_0xdfdb('0x58')},'raw':!![]});})[_0xdfdb('0x1a')](function(_0x11ce58){for(var _0x2ac36e=0x0;_0x2ac36e<_0x11ce58[_0xdfdb('0x59')];_0x2ac36e++){var _0x24f88a={'id':_0x11ce58[_0x2ac36e]['id'],'name':_0x11ce58[_0x2ac36e][_0xdfdb('0x12')],'online':Boolean(_0x11ce58[_0x2ac36e][_0xdfdb('0x52')]),'paused':Boolean(_0x11ce58[_0x2ac36e][_0x25cc2f])};if(_0x24f88a[_0xdfdb('0x52')])_0x2defcc[_0xdfdb('0x4c')]++;if(_0x24f88a[_0xdfdb('0x4b')])_0x2defcc['paused']++;_0x2defcc['agents'][_0xdfdb('0x35')](_0x24f88a);}return _0x2defcc;});}});return Promise[_0xdfdb('0x5a')](_0x21f4c7);});})[_0xdfdb('0x1a')](function(_0x4bbb88){_0x8b9193[_0xdfdb('0x48')]=_0x4bbb88;return _0x8b9193;})[_0xdfdb('0x1a')](respondWithFilteredResult(_0x471ddc,_0x2c1070))[_0xdfdb('0x5b')](handleError(_0x471ddc,null));}; \ No newline at end of file +var _0x77d4=['lodash','../../components/parsers/qs','api','../../mysqldb','client','http','limit','count','offset','status','set','json','error','stack','name','mail','chat','openchannel','fax','whatsapp','voice','resolve','then','query','channel','includes','toLowerCase','startCase','Queue','map','rawAttributes','fieldName','type','key','getOptions','role','user','userProfileId','outbound','QueueCampaigns','filter','UserProfile','getResources','findAndCountAll','request','Queues','format','Unable\x20to\x20retrieve\x20RPC\x20%s\x20queues','result','loggedIn','available','waiting','talking','paused','push','pTalking','message','dialActive','dialMethod','Trunk','startPredictive','startProgressive','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','predictiveIntervalAvailable','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','rows','originated','agents','find','pick','getMembers','length','online','Pause','findAll','User','UserId','agent','loggedInDb','all','catch'];(function(_0x368587,_0x1b6554){var _0x42d33c=function(_0xfdccf){while(--_0xfdccf){_0x368587['push'](_0x368587['shift']());}};_0x42d33c(++_0x1b6554);}(_0x77d4,0x108));var _0x477d=function(_0x299e1e,_0x20eab5){_0x299e1e=_0x299e1e-0x0;var _0x3757dc=_0x77d4[_0x299e1e];return _0x3757dc;};'use strict';var util=require('util');var _=require(_0x477d('0x0'));var jayson=require('jayson/promise');var qs=require(_0x477d('0x1'));var logger=require('../../config/logger')(_0x477d('0x2'));var db=require(_0x477d('0x3'))['db'];var client=jayson['client']['http']({'port':0x232a});var routingClient=jayson[_0x477d('0x4')][_0x477d('0x5')]({'port':0x232c});function respondWithFilteredResult(_0x3d2f8d,_0x471fca){return function(_0x2545e5){if(_0x2545e5){var _0x45ca2d=typeof _0x471fca['offset']==='undefined'&&typeof _0x471fca[_0x477d('0x6')]==='undefined';var _0x5da70c=_0x2545e5[_0x477d('0x7')];var _0x29f11b=_0x45ca2d?0x0:_0x471fca[_0x477d('0x8')];var _0x2c326c=_0x45ca2d?_0x2545e5[_0x477d('0x7')]:_0x471fca['offset']+_0x471fca[_0x477d('0x6')];var _0x4f11bc;if(_0x2c326c>=_0x5da70c){_0x2c326c=_0x5da70c;_0x4f11bc=0xc8;}else{_0x4f11bc=0xce;}_0x3d2f8d[_0x477d('0x9')](_0x4f11bc);return _0x3d2f8d[_0x477d('0xa')]('Content-Range',_0x29f11b+'-'+_0x2c326c+'/'+_0x5da70c)[_0x477d('0xb')](_0x2545e5);}return null;};}function handleError(_0x3d362a,_0x5a190c){_0x5a190c=_0x5a190c||0x1f4;return function(_0x5dd33c){logger[_0x477d('0xc')](_0x5dd33c[_0x477d('0xd')]);if(_0x5dd33c['name']){delete _0x5dd33c[_0x477d('0xe')];}_0x3d362a[_0x477d('0x9')](_0x5a190c)['send'](_0x5dd33c);};}exports['getQueues']=function(_0x38a0a8,_0x4bbfef){var _0x30481f=[_0x477d('0xf'),_0x477d('0x10'),'sms',_0x477d('0x11'),_0x477d('0x12'),_0x477d('0x13'),_0x477d('0x14')];var _0x57b38e={'count':0x0,'rows':[]},_0x28f17a={},_0x5d5553;Promise[_0x477d('0x15')]()[_0x477d('0x16')](function(){if(_0x38a0a8[_0x477d('0x17')][_0x477d('0x18')]){if(!_[_0x477d('0x19')](_0x30481f,_0x38a0a8[_0x477d('0x17')]['channel'][_0x477d('0x1a')]()))throw new Error('Invalid\x20channel');_0x5d5553=_0x38a0a8[_0x477d('0x17')][_0x477d('0x18')][_0x477d('0x1a')]();}var _0x14cbd5=_[_0x477d('0x1b')](_0x5d5553)+_0x477d('0x1c');var _0x435a3b=_[_0x477d('0x1d')](db[_0x14cbd5][_0x477d('0x1e')],function(_0x5981a){return{'name':_0x5981a[_0x477d('0x1f')],'type':_0x5981a[_0x477d('0x20')][_0x477d('0x21')]};});_0x28f17a=qs[_0x477d('0x22')](_0x435a3b,_0x38a0a8);if(_0x38a0a8['user'][_0x477d('0x23')]==='user'){var _0x239b56={'params':{'id':_0x38a0a8[_0x477d('0x24')][_0x477d('0x25')]},'query':{'section':_0x5d5553===_0x477d('0x14')&&_0x38a0a8['query'][_0x477d('0x20')]===_0x477d('0x26')?_0x477d('0x27'):_['startCase'](_0x5d5553)+'Queues','type':_0x38a0a8[_0x477d('0x17')][_0x477d('0x20')],'nolimit':!![],'sort':_0x477d('0xe'),'filter':_0x38a0a8['query'][_0x477d('0x28')]}};return db[_0x477d('0x29')][_0x477d('0x2a')](_0x239b56);}return db[_0x14cbd5][_0x477d('0x2b')](_0x28f17a);})[_0x477d('0x16')](function(_0x537fc4){_0x57b38e[_0x477d('0x7')]=_0x537fc4[_0x477d('0x7')];var _0x17dd16=_0x5d5553===_0x477d('0x14')?client:routingClient;return _0x17dd16[_0x477d('0x2c')](_[_0x477d('0x1b')](_0x5d5553)+_0x477d('0x2d'),_0x38a0a8)[_0x477d('0x16')](function(_0x204541){if(_0x204541[_0x477d('0xc')])throw new Error(util[_0x477d('0x2e')](_0x477d('0x2f'),_0x5d5553));var _0x138c6d=_0x204541[_0x477d('0x30')];var _0x16042d=[_0x477d('0x31'),_0x477d('0x32'),_0x477d('0x33'),_0x477d('0x34'),_0x477d('0x35')];if(_0x5d5553==='voice'&&_0x38a0a8[_0x477d('0x17')]['type']===_0x477d('0x26')){_0x16042d[_0x477d('0x36')](_0x477d('0x37'),'originated',_0x477d('0x38'),_0x477d('0x39'),_0x477d('0x3a'),_0x477d('0x3b'),_0x477d('0x3c'),_0x477d('0x3d'),_0x477d('0x3e'),_0x477d('0x3f'),_0x477d('0x40'),_0x477d('0x41'),'dialPredictiveInterval',_0x477d('0x42'),_0x477d('0x43'),_0x477d('0x44'),'predictiveIntervalTotalCalls',_0x477d('0x45'),_0x477d('0x46'),_0x477d('0x47'),'predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime');}var _0x21de5c=_0x537fc4[_0x477d('0x48')][_0x477d('0x1d')](function(_0x13ac50){var _0x1c0d86=_0x13ac50['get']({'plain':!![]});_0x1c0d86[_0x477d('0x35')]=0x0;_0x1c0d86['loggedInDb']=0x0;_0x1c0d86[_0x477d('0x31')]=0x0;_0x1c0d86[_0x477d('0x32')]=0x0;_0x1c0d86[_0x477d('0x35')]=0x0;_0x1c0d86['waiting']=0x0;if(_0x5d5553==='voice'){_0x1c0d86[_0x477d('0x34')]=0x0;if(_0x38a0a8[_0x477d('0x17')][_0x477d('0x20')]===_0x477d('0x26')){_0x1c0d86['pTalking']=0x0;_0x1c0d86[_0x477d('0x49')]=0x0;}}_0x1c0d86[_0x477d('0x4a')]=[];var _0x40fdc0=_[_0x477d('0x4b')](_0x138c6d[_0x477d('0x48')],['id',_0x1c0d86['id']]);if(_0x40fdc0)_['merge'](_0x1c0d86,_[_0x477d('0x4c')](_0x40fdc0,_0x16042d));if(_0x5d5553===_0x477d('0x14')){return _0x13ac50['getAgents']({'attributes':['id',_0x477d('0xe'),'online'],'joinTableAttributes':[],'raw':!![]})[_0x477d('0x16')](function(_0x7a5a47){return _0x13ac50[_0x477d('0x4d')]({'raw':!![]})[_0x477d('0x16')](function(_0x1f9552){for(var _0x10bbed=0x0;_0x10bbed<_0x7a5a47[_0x477d('0x4e')];_0x10bbed++){var _0xb94247=_[_0x477d('0x4b')](_0x1f9552,['UserId',_0x7a5a47[_0x10bbed]['id']]);var _0x5759f={'id':_0x7a5a47[_0x10bbed]['id'],'name':_0x7a5a47[_0x10bbed][_0x477d('0xe')],'online':Boolean(_0x7a5a47[_0x10bbed][_0x477d('0x4f')]),'paused':_0xb94247?Boolean(_0xb94247[_0x477d('0x35')]):![]};if(_0x5759f['online'])_0x1c0d86['loggedInDb']++;if(_0x5759f[_0x477d('0x35')])_0x1c0d86[_0x477d('0x35')]++;_0x1c0d86['agents'][_0x477d('0x36')](_0x5759f);}return _0x1c0d86;});});}else{var _0x4fb6f5='User'+_[_0x477d('0x1b')](_0x5d5553)+_0x477d('0x1c');var _0x133b81=_0x5d5553+_0x477d('0x50');return db[_0x4fb6f5][_0x477d('0x51')]({'where':{[_[_0x477d('0x1b')](_0x5d5553)+'QueueId']:_0x13ac50['id']},'raw':!![]})[_0x477d('0x16')](function(_0xed1fb2){return db[_0x477d('0x52')][_0x477d('0x51')]({'attributes':['id',_0x477d('0xe'),'online',_0x133b81],'where':{'id':_['map'](_0xed1fb2,_0x477d('0x53')),'role':_0x477d('0x54')},'raw':!![]});})[_0x477d('0x16')](function(_0x59dc4c){for(var _0x45a5da=0x0;_0x45a5da<_0x59dc4c[_0x477d('0x4e')];_0x45a5da++){var _0x3154da={'id':_0x59dc4c[_0x45a5da]['id'],'name':_0x59dc4c[_0x45a5da][_0x477d('0xe')],'online':Boolean(_0x59dc4c[_0x45a5da][_0x477d('0x4f')]),'paused':Boolean(_0x59dc4c[_0x45a5da][_0x133b81])};if(_0x3154da[_0x477d('0x4f')])_0x1c0d86[_0x477d('0x55')]++;if(_0x3154da['paused'])_0x1c0d86[_0x477d('0x35')]++;_0x1c0d86[_0x477d('0x4a')][_0x477d('0x36')](_0x3154da);}return _0x1c0d86;});}});return Promise[_0x477d('0x56')](_0x21de5c);});})[_0x477d('0x16')](function(_0x32b430){_0x57b38e[_0x477d('0x48')]=_0x32b430;return _0x57b38e;})[_0x477d('0x16')](respondWithFilteredResult(_0x4bbfef,_0x28f17a))[_0x477d('0x57')](handleError(_0x4bbfef,null));}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index fbe05b9..030575b 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 _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x2456cd,_0x26bd74){var _0x1e14b2=function(_0x45e61c){while(--_0x45e61c){_0x2456cd['push'](_0x2456cd['shift']());}};_0x1e14b2(++_0x26bd74);}(_0xe706,0xa3));var _0x6e70=function(_0x1575cf,_0x1190d4){_0x1575cf=_0x1575cf-0x0;var _0x2b7a4e=_0xe706[_0x1575cf];return _0x2b7a4e;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x32d536,_0x568fc4){var _0xa8c5e6=function(_0x1df1ab){while(--_0x1df1ab){_0x32d536['push'](_0x32d536['shift']());}};_0xa8c5e6(++_0x568fc4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0xa9e0[_0x4154a6];return _0x3b2786;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index b4ce738..64b3461 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 _0x1883=['DATE','sequelize','exports','INTEGER','STRING'];(function(_0x30ae02,_0x2d8a4a){var _0xc8abc8=function(_0xcaa8a7){while(--_0xcaa8a7){_0x30ae02['push'](_0x30ae02['shift']());}};_0xc8abc8(++_0x2d8a4a);}(_0x1883,0xab));var _0x3188=function(_0x59eccd,_0x4f9f97){_0x59eccd=_0x59eccd-0x0;var _0x40f30d=_0x1883[_0x59eccd];return _0x40f30d;};'use strict';var Sequelize=require(_0x3188('0x0'));module[_0x3188('0x1')]={'state':{'type':Sequelize[_0x3188('0x2')](0x2)},'statedesc':{'type':Sequelize[_0x3188('0x3')]},'scheduledat':{'type':Sequelize[_0x3188('0x4')]},'uniqueid':{'type':Sequelize[_0x3188('0x3')]},'starttime':{'type':Sequelize[_0x3188('0x4')]},'responsetime':{'type':Sequelize[_0x3188('0x4')]},'ringtime':{'type':Sequelize[_0x3188('0x2')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x3188('0x3')]},'campaigntype':{'type':Sequelize[_0x3188('0x3')]},'membername':{'type':Sequelize[_0x3188('0x3')]}}; \ No newline at end of file +var _0x23f4=['STRING','INTEGER','exports','DATE'];(function(_0x33e5be,_0x3d6889){var _0x470603=function(_0x33a3d7){while(--_0x33a3d7){_0x33e5be['push'](_0x33e5be['shift']());}};_0x470603(++_0x3d6889);}(_0x23f4,0x1ee));var _0x423f=function(_0x14b642,_0x40facb){_0x14b642=_0x14b642-0x0;var _0x2f4340=_0x23f4[_0x14b642];return _0x2f4340;};'use strict';var Sequelize=require('sequelize');module[_0x423f('0x0')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x423f('0x1')]},'uniqueid':{'type':Sequelize[_0x423f('0x2')]},'starttime':{'type':Sequelize[_0x423f('0x1')]},'responsetime':{'type':Sequelize[_0x423f('0x1')]},'ringtime':{'type':Sequelize[_0x423f('0x3')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x423f('0x2')]},'campaigntype':{'type':Sequelize[_0x423f('0x2')]},'membername':{'type':Sequelize[_0x423f('0x2')]}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index 99335f3..6664e23 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 _0x84cb=['bluebird','request-promise','path','../../config/environment','./reportAgentPreview.attributes','define','ReportAgentPreview','report_agent_preview','util','../../config/logger'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x84cb,0x116));var _0xb84c=function(_0x293838,_0x541252){_0x293838=_0x293838-0x0;var _0x5b50c3=_0x84cb[_0x293838];return _0x5b50c3;};'use strict';var _=require('lodash');var util=require(_0xb84c('0x0'));var logger=require(_0xb84c('0x1'))('api');var moment=require('moment');var BPromise=require(_0xb84c('0x2'));var rp=require(_0xb84c('0x3'));var fs=require('fs');var path=require(_0xb84c('0x4'));var rimraf=require('rimraf');var config=require(_0xb84c('0x5'));var attributes=require(_0xb84c('0x6'));module['exports']=function(_0x1174ad,_0x58464f){return _0x1174ad[_0xb84c('0x7')](_0xb84c('0x8'),attributes,{'tableName':_0xb84c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x202f=['request-promise','path','./reportAgentPreview.attributes','exports','define','ReportAgentPreview','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0xea1cff,_0x2f9db8){var _0xe544e3=function(_0x35c867){while(--_0x35c867){_0xea1cff['push'](_0xea1cff['shift']());}};_0xe544e3(++_0x2f9db8);}(_0x202f,0x16e));var _0xf202=function(_0x43ce5d,_0x5d50fb){_0x43ce5d=_0x43ce5d-0x0;var _0xdcfa4f=_0x202f[_0x43ce5d];return _0xdcfa4f;};'use strict';var _=require(_0xf202('0x0'));var util=require(_0xf202('0x1'));var logger=require(_0xf202('0x2'))(_0xf202('0x3'));var moment=require(_0xf202('0x4'));var BPromise=require(_0xf202('0x5'));var rp=require(_0xf202('0x6'));var fs=require('fs');var path=require(_0xf202('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf202('0x8'));module[_0xf202('0x9')]=function(_0x3c3b14,_0xd8fb40){return _0x3c3b14[_0xf202('0xa')](_0xf202('0xb'),attributes,{'tableName':'report_agent_preview','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 7e50ce3..b373e04 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 _0xb392=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateReportAgentPreview','ReportAgentPreview','create','body','options','raw','info','debug','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x48ee31,_0x15b628){var _0x1da5e0=function(_0x55d07a){while(--_0x55d07a){_0x48ee31['push'](_0x48ee31['shift']());}};_0x1da5e0(++_0x15b628);}(_0xb392,0x15a));var _0x2b39=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xb392[_0x4fc9e6];return _0x551d28;};'use strict';var _=require(_0x2b39('0x0'));var util=require(_0x2b39('0x1'));var moment=require(_0x2b39('0x2'));var BPromise=require(_0x2b39('0x3'));var rs=require(_0x2b39('0x4'));var fs=require('fs');var Redis=require(_0x2b39('0x5'));var db=require(_0x2b39('0x6'))['db'];var utils=require(_0x2b39('0x7'));var logger=require(_0x2b39('0x8'))(_0x2b39('0x9'));var config=require(_0x2b39('0xa'));var jayson=require(_0x2b39('0xb'));var client=jayson[_0x2b39('0xc')][_0x2b39('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x5af652,_0x55d1a3,_0x32236c){return new BPromise(function(_0x1e1eb0,_0x2c53c0){return client[_0x2b39('0xe')](_0x5af652,_0x32236c)[_0x2b39('0xf')](function(_0x57dbf2){logger['info'](_0x2b39('0x10'),_0x55d1a3,_0x2b39('0x11'));logger['debug'](_0x2b39('0x12'),_0x55d1a3,_0x2b39('0x11'),JSON[_0x2b39('0x13')](_0x57dbf2));if(_0x57dbf2[_0x2b39('0x14')]){if(_0x57dbf2[_0x2b39('0x14')][_0x2b39('0x15')]===0x1f4){logger['error'](_0x2b39('0x10'),_0x55d1a3,_0x57dbf2['error']['message']);return _0x2c53c0(_0x57dbf2[_0x2b39('0x14')][_0x2b39('0x16')]);}logger['error'](_0x2b39('0x10'),_0x55d1a3,_0x57dbf2[_0x2b39('0x14')]['message']);return _0x1e1eb0(_0x57dbf2['error'][_0x2b39('0x16')]);}else{logger['info'](_0x2b39('0x10'),_0x55d1a3,_0x2b39('0x11'));_0x1e1eb0(_0x57dbf2['result']['message']);}})[_0x2b39('0x17')](function(_0x19aab7){logger['error'](_0x2b39('0x10'),_0x55d1a3,_0x19aab7);_0x2c53c0(_0x19aab7);});});}exports[_0x2b39('0x18')]=function(_0x4a1ec2){var _0xcd306f=this;return new Promise(function(_0x6da874,_0x23c77e){return db[_0x2b39('0x19')][_0x2b39('0x1a')](_0x4a1ec2[_0x2b39('0x1b')],{'raw':_0x4a1ec2[_0x2b39('0x1c')]?_0x4a1ec2[_0x2b39('0x1c')][_0x2b39('0x1d')]===undefined?!![]:![]:!![]})[_0x2b39('0xf')](function(_0x207d2a){logger[_0x2b39('0x1e')](_0x2b39('0x18'),_0x4a1ec2);logger[_0x2b39('0x1f')](_0x2b39('0x18'),_0x4a1ec2,JSON[_0x2b39('0x13')](_0x207d2a));_0x6da874(_0x207d2a);})[_0x2b39('0x17')](function(_0x9b7021){logger[_0x2b39('0x14')]('CreateReportAgentPreview',_0x9b7021[_0x2b39('0x16')],_0x4a1ec2);_0x23c77e(_0xcd306f['error'](0x1f4,_0x9b7021['message']));});});}; \ No newline at end of file +var _0x94a0=['info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','error','code','message','catch','ReportAgentPreview','create','body','options','raw','CreateReportAgentPreview','stringify','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','request'];(function(_0x263a74,_0xc31414){var _0x2aa86c=function(_0x382896){while(--_0x382896){_0x263a74['push'](_0x263a74['shift']());}};_0x2aa86c(++_0xc31414);}(_0x94a0,0x97));var _0x094a=function(_0x4564ff,_0xd39a3c){_0x4564ff=_0x4564ff-0x0;var _0x35b8b9=_0x94a0[_0x4564ff];return _0x35b8b9;};'use strict';var _=require(_0x094a('0x0'));var util=require('util');var moment=require(_0x094a('0x1'));var BPromise=require(_0x094a('0x2'));var rs=require(_0x094a('0x3'));var fs=require('fs');var Redis=require(_0x094a('0x4'));var db=require(_0x094a('0x5'))['db'];var utils=require(_0x094a('0x6'));var logger=require('../../config/logger')(_0x094a('0x7'));var config=require(_0x094a('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x094a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x335bdf,_0x49b7a7,_0x20f1b8){return new BPromise(function(_0x169aa6,_0x278fe9){return client[_0x094a('0xa')](_0x335bdf,_0x20f1b8)['then'](function(_0x3f8edc){logger[_0x094a('0xb')](_0x094a('0xc'),_0x49b7a7,_0x094a('0xd'));logger[_0x094a('0xe')](_0x094a('0xf'),_0x49b7a7,_0x094a('0xd'),JSON['stringify'](_0x3f8edc));if(_0x3f8edc[_0x094a('0x10')]){if(_0x3f8edc[_0x094a('0x10')][_0x094a('0x11')]===0x1f4){logger[_0x094a('0x10')]('ReportAgentPreview,\x20%s,\x20%s',_0x49b7a7,_0x3f8edc[_0x094a('0x10')][_0x094a('0x12')]);return _0x278fe9(_0x3f8edc[_0x094a('0x10')]['message']);}logger[_0x094a('0x10')](_0x094a('0xc'),_0x49b7a7,_0x3f8edc['error'][_0x094a('0x12')]);return _0x169aa6(_0x3f8edc[_0x094a('0x10')][_0x094a('0x12')]);}else{logger[_0x094a('0xb')](_0x094a('0xc'),_0x49b7a7,_0x094a('0xd'));_0x169aa6(_0x3f8edc['result'][_0x094a('0x12')]);}})[_0x094a('0x13')](function(_0x1b8d47){logger['error'](_0x094a('0xc'),_0x49b7a7,_0x1b8d47);_0x278fe9(_0x1b8d47);});});}exports['CreateReportAgentPreview']=function(_0x137f29){var _0xf47209=this;return new Promise(function(_0x57c73d,_0x36c6ab){return db[_0x094a('0x14')][_0x094a('0x15')](_0x137f29[_0x094a('0x16')],{'raw':_0x137f29[_0x094a('0x17')]?_0x137f29[_0x094a('0x17')][_0x094a('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x30195f){logger[_0x094a('0xb')](_0x094a('0x19'),_0x137f29);logger[_0x094a('0xe')](_0x094a('0x19'),_0x137f29,JSON[_0x094a('0x1a')](_0x30195f));_0x57c73d(_0x30195f);})[_0x094a('0x13')](function(_0x5194ba){logger[_0x094a('0x10')]('CreateReportAgentPreview',_0x5194ba[_0x094a('0x12')],_0x137f29);_0x36c6ab(_0xf47209[_0x094a('0x10')](0x1f4,_0x5194ba[_0x094a('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index fdf7882..4064783 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 _0xf289=['mailQueues','mailAccounts','openchannelQueues','/sms/queues','smsQueues','/whatsapp/queues','whatsappQueues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','/voice/queues/channels/:uniqueid','/voice/queues/channels/:uniqueid/hangup','/voice/queues/channels/:uniqueid/redirect/:exten','/voice/queues/:id','showVoiceQueues','put','updateVoiceQueue','outbound','/outbound/channels','outboundChannels','/agents','agents','/agents/:id/capacity','telephones','/trunks','trunks','campaigns','/fax/accounts','faxAccounts','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','whatsappQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','queueNotify','mail','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','fax','openchannel','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','sms','/whatsapp/queues/:id/notify','whatsapp','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','showWhatsappQueues','agentNotify','multer','util','Router','../../components/auth/service','./rpc.controller','get','/voice/channels','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','/chat/queues','chatQueues','/mail/queues'];(function(_0x1646fa,_0x4e5bd7){var _0x5a47a5=function(_0x2db820){while(--_0x2db820){_0x1646fa['push'](_0x1646fa['shift']());}};_0x5a47a5(++_0x4e5bd7);}(_0xf289,0x132));var _0x9f28=function(_0x464f32,_0x4d9ecb){_0x464f32=_0x464f32-0x0;var _0x24f5ec=_0xf289[_0x464f32];return _0x24f5ec;};'use strict';var multer=require(_0x9f28('0x0'));var util=require(_0x9f28('0x1'));var path=require('path');var express=require('express');var router=express[_0x9f28('0x2')]();var auth=require(_0x9f28('0x3'));var controller=require(_0x9f28('0x4'));router[_0x9f28('0x5')](_0x9f28('0x6'),auth[_0x9f28('0x7')](),controller[_0x9f28('0x8')]);router[_0x9f28('0x5')](_0x9f28('0x9'),auth[_0x9f28('0x7')](),controller[_0x9f28('0xa')]);router[_0x9f28('0x5')](_0x9f28('0xb'),auth[_0x9f28('0x7')](),controller[_0x9f28('0xc')]);router[_0x9f28('0x5')](_0x9f28('0xd'),auth['isAuthenticated'](),controller[_0x9f28('0xe')]);router[_0x9f28('0x5')](_0x9f28('0xf'),auth[_0x9f28('0x7')](),controller[_0x9f28('0x10')]);router[_0x9f28('0x5')](_0x9f28('0x11'),auth[_0x9f28('0x7')](),controller[_0x9f28('0x12')]);router[_0x9f28('0x5')]('/mail/accounts',auth['isAuthenticated'](),controller[_0x9f28('0x13')]);router['get']('/openchannel/queues',auth[_0x9f28('0x7')](),controller[_0x9f28('0x14')]);router[_0x9f28('0x5')](_0x9f28('0x15'),auth[_0x9f28('0x7')](),controller[_0x9f28('0x16')]);router[_0x9f28('0x5')](_0x9f28('0x17'),auth[_0x9f28('0x7')](),controller[_0x9f28('0x18')]);router['get']('/fax/queues',auth['isAuthenticated'](),controller[_0x9f28('0x19')]);router[_0x9f28('0x5')](_0x9f28('0x1a'),auth[_0x9f28('0x7')](),controller[_0x9f28('0x1b')]);router[_0x9f28('0x5')](_0x9f28('0x1c'),auth['isAuthenticated'](),controller['voiceQueuesChannels']);router[_0x9f28('0x5')](_0x9f28('0x1d'),auth['isAuthenticated'](),controller['voiceQueuesChannel']);router['get'](_0x9f28('0x1e'),auth[_0x9f28('0x7')](),controller['voiceQueuesChannelHangup']);router[_0x9f28('0x5')](_0x9f28('0x1f'),auth[_0x9f28('0x7')](),controller['voiceQueuesChannelRedirect']);router[_0x9f28('0x5')](_0x9f28('0x20'),auth[_0x9f28('0x7')](),controller[_0x9f28('0x21')]);router[_0x9f28('0x22')]('/voice/queues/:id',auth[_0x9f28('0x7')](),controller[_0x9f28('0x23')]);router['get']('/outbound',auth['isAuthenticated'](),controller[_0x9f28('0x24')]);router[_0x9f28('0x5')](_0x9f28('0x25'),auth['isAuthenticated'](),controller[_0x9f28('0x26')]);router[_0x9f28('0x5')](_0x9f28('0x27'),auth[_0x9f28('0x7')](),controller[_0x9f28('0x28')]);router[_0x9f28('0x22')](_0x9f28('0x29'),auth[_0x9f28('0x7')](),controller['agentCapacity']);router['get']('/telephones',auth[_0x9f28('0x7')](),controller[_0x9f28('0x2a')]);router[_0x9f28('0x5')](_0x9f28('0x2b'),auth[_0x9f28('0x7')](),controller[_0x9f28('0x2c')]);router[_0x9f28('0x5')]('/campaigns',auth[_0x9f28('0x7')](),controller[_0x9f28('0x2d')]);router[_0x9f28('0x5')](_0x9f28('0x2e'),auth[_0x9f28('0x7')](),controller[_0x9f28('0x2f')]);router[_0x9f28('0x5')]('/chat/queues/waitinginteractions',auth[_0x9f28('0x7')](),controller[_0x9f28('0x30')]);router[_0x9f28('0x5')](_0x9f28('0x31'),auth[_0x9f28('0x7')](),controller[_0x9f28('0x32')]);router[_0x9f28('0x5')]('/openchannel/queues/waitinginteractions',auth[_0x9f28('0x7')](),controller['openchannelQueuesWaitingInteractions']);router[_0x9f28('0x5')]('/openchannel/queues/:id/waitinginteractions',auth['isAuthenticated'](),controller[_0x9f28('0x33')]);router['get'](_0x9f28('0x34'),auth['isAuthenticated'](),controller[_0x9f28('0x35')]);router['get'](_0x9f28('0x36'),auth[_0x9f28('0x7')](),controller[_0x9f28('0x37')]);router[_0x9f28('0x5')](_0x9f28('0x38'),auth[_0x9f28('0x7')](),controller[_0x9f28('0x39')]);router[_0x9f28('0x3a')](_0x9f28('0x3b'),auth[_0x9f28('0x7')](),controller[_0x9f28('0x3c')](_0x9f28('0x3d')));router[_0x9f28('0x5')](_0x9f28('0x3e'),auth['isAuthenticated'](),controller[_0x9f28('0x3f')]);router['post'](_0x9f28('0x40'),auth[_0x9f28('0x7')](),controller[_0x9f28('0x3c')]('chat'));router[_0x9f28('0x5')](_0x9f28('0x41'),auth[_0x9f28('0x7')](),controller[_0x9f28('0x42')]);router['post'](_0x9f28('0x43'),auth['isAuthenticated'](),controller[_0x9f28('0x3c')](_0x9f28('0x44')));router[_0x9f28('0x5')]('/fax/queues/:id',auth[_0x9f28('0x7')](),controller['showFaxQueues']);router['post']('/openchannel/queues/:id/notify',auth[_0x9f28('0x7')](),controller[_0x9f28('0x3c')](_0x9f28('0x45')));router[_0x9f28('0x5')](_0x9f28('0x46'),auth['isAuthenticated'](),controller[_0x9f28('0x47')]);router[_0x9f28('0x3a')](_0x9f28('0x48'),auth[_0x9f28('0x7')](),controller[_0x9f28('0x3c')](_0x9f28('0x49')));router[_0x9f28('0x3a')](_0x9f28('0x4a'),auth[_0x9f28('0x7')](),controller['queueNotify'](_0x9f28('0x4b')));router['get'](_0x9f28('0x4c'),auth[_0x9f28('0x7')](),controller[_0x9f28('0x4d')]);router[_0x9f28('0x5')](_0x9f28('0x4e'),auth[_0x9f28('0x7')](),controller[_0x9f28('0x4f')]);router[_0x9f28('0x3a')]('/agents/:id/notify',auth['isAuthenticated'](),controller[_0x9f28('0x50')]);module['exports']=router; \ No newline at end of file +var _0x08bd=['/whatsapp/queues','whatsappQueues','/fax/queues','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','put','/outbound','outbound','/agents','agents','/agents/:id/capacity','agentCapacity','trunks','/campaigns','campaigns','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/openchannel/queues/:id/waitinginteractions','openchannelQueuesIdWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/whatsapp/queues/waitinginteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','queueNotify','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','chat','showChatQueues','/fax/queues/:id/notify','fax','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','showOpenchannelQueues','sms','/whatsapp/queues/:id/notify','/sms/queues/:id','showSmsQueues','/whatsapp/queues/:id','agentNotify','multer','util','path','express','Router','./rpc.controller','get','/voice/channels','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','isAuthenticated','voiceQueues','/chat/queues','/mail/queues','/mail/accounts','mailAccounts','/openchannel/queues','openchannelQueues','smsQueues'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x08bd,0xd3));var _0xd08b=function(_0x454b16,_0xb54e30){_0x454b16=_0x454b16-0x0;var _0x52aa95=_0x08bd[_0x454b16];return _0x52aa95;};'use strict';var multer=require(_0xd08b('0x0'));var util=require(_0xd08b('0x1'));var path=require(_0xd08b('0x2'));var express=require(_0xd08b('0x3'));var router=express[_0xd08b('0x4')]();var auth=require('../../components/auth/service');var controller=require(_0xd08b('0x5'));router[_0xd08b('0x6')](_0xd08b('0x7'),auth['isAuthenticated'](),controller['voiceChannels']);router[_0xd08b('0x6')](_0xd08b('0x8'),auth['isAuthenticated'](),controller[_0xd08b('0x9')]);router[_0xd08b('0x6')](_0xd08b('0xa'),auth[_0xd08b('0xb')](),controller['voiceChannelStopMixMonitor']);router['get']('/voice/queues',auth['isAuthenticated'](),controller[_0xd08b('0xc')]);router[_0xd08b('0x6')](_0xd08b('0xd'),auth[_0xd08b('0xb')](),controller['chatQueues']);router[_0xd08b('0x6')](_0xd08b('0xe'),auth[_0xd08b('0xb')](),controller['mailQueues']);router[_0xd08b('0x6')](_0xd08b('0xf'),auth[_0xd08b('0xb')](),controller[_0xd08b('0x10')]);router[_0xd08b('0x6')](_0xd08b('0x11'),auth['isAuthenticated'](),controller[_0xd08b('0x12')]);router[_0xd08b('0x6')]('/sms/queues',auth[_0xd08b('0xb')](),controller[_0xd08b('0x13')]);router['get'](_0xd08b('0x14'),auth[_0xd08b('0xb')](),controller[_0xd08b('0x15')]);router['get'](_0xd08b('0x16'),auth['isAuthenticated'](),controller['faxQueues']);router[_0xd08b('0x6')]('/voice/queues/preview/:id',auth[_0xd08b('0xb')](),controller[_0xd08b('0x17')]);router[_0xd08b('0x6')](_0xd08b('0x18'),auth[_0xd08b('0xb')](),controller[_0xd08b('0x19')]);router[_0xd08b('0x6')](_0xd08b('0x1a'),auth[_0xd08b('0xb')](),controller[_0xd08b('0x1b')]);router[_0xd08b('0x6')](_0xd08b('0x1c'),auth[_0xd08b('0xb')](),controller['voiceQueuesChannelHangup']);router[_0xd08b('0x6')](_0xd08b('0x1d'),auth[_0xd08b('0xb')](),controller[_0xd08b('0x1e')]);router['get'](_0xd08b('0x1f'),auth[_0xd08b('0xb')](),controller['showVoiceQueues']);router[_0xd08b('0x20')](_0xd08b('0x1f'),auth[_0xd08b('0xb')](),controller['updateVoiceQueue']);router['get'](_0xd08b('0x21'),auth['isAuthenticated'](),controller[_0xd08b('0x22')]);router[_0xd08b('0x6')]('/outbound/channels',auth[_0xd08b('0xb')](),controller['outboundChannels']);router[_0xd08b('0x6')](_0xd08b('0x23'),auth['isAuthenticated'](),controller[_0xd08b('0x24')]);router[_0xd08b('0x20')](_0xd08b('0x25'),auth['isAuthenticated'](),controller[_0xd08b('0x26')]);router['get']('/telephones',auth[_0xd08b('0xb')](),controller['telephones']);router[_0xd08b('0x6')]('/trunks',auth[_0xd08b('0xb')](),controller[_0xd08b('0x27')]);router['get'](_0xd08b('0x28'),auth[_0xd08b('0xb')](),controller[_0xd08b('0x29')]);router[_0xd08b('0x6')]('/fax/accounts',auth[_0xd08b('0xb')](),controller['faxAccounts']);router[_0xd08b('0x6')](_0xd08b('0x2a'),auth['isAuthenticated'](),controller[_0xd08b('0x2b')]);router[_0xd08b('0x6')](_0xd08b('0x2c'),auth['isAuthenticated'](),controller[_0xd08b('0x2d')]);router['get'](_0xd08b('0x2e'),auth[_0xd08b('0xb')](),controller[_0xd08b('0x2f')]);router['get'](_0xd08b('0x30'),auth['isAuthenticated'](),controller[_0xd08b('0x31')]);router[_0xd08b('0x6')](_0xd08b('0x32'),auth[_0xd08b('0xb')](),controller[_0xd08b('0x33')]);router['get'](_0xd08b('0x34'),auth[_0xd08b('0xb')](),controller['whatsappQueuesWaitingInteractions']);router[_0xd08b('0x6')](_0xd08b('0x35'),auth[_0xd08b('0xb')](),controller[_0xd08b('0x36')]);router[_0xd08b('0x37')](_0xd08b('0x38'),auth[_0xd08b('0xb')](),controller[_0xd08b('0x39')]('mail'));router[_0xd08b('0x6')](_0xd08b('0x3a'),auth[_0xd08b('0xb')](),controller[_0xd08b('0x3b')]);router['post'](_0xd08b('0x3c'),auth[_0xd08b('0xb')](),controller[_0xd08b('0x39')](_0xd08b('0x3d')));router[_0xd08b('0x6')]('/chat/queues/:id',auth[_0xd08b('0xb')](),controller[_0xd08b('0x3e')]);router[_0xd08b('0x37')](_0xd08b('0x3f'),auth['isAuthenticated'](),controller[_0xd08b('0x39')](_0xd08b('0x40')));router['get'](_0xd08b('0x41'),auth['isAuthenticated'](),controller[_0xd08b('0x42')]);router[_0xd08b('0x37')](_0xd08b('0x43'),auth[_0xd08b('0xb')](),controller['queueNotify'](_0xd08b('0x44')));router[_0xd08b('0x6')](_0xd08b('0x45'),auth['isAuthenticated'](),controller[_0xd08b('0x46')]);router['post']('/sms/queues/:id/notify',auth[_0xd08b('0xb')](),controller[_0xd08b('0x39')](_0xd08b('0x47')));router[_0xd08b('0x37')](_0xd08b('0x48'),auth[_0xd08b('0xb')](),controller[_0xd08b('0x39')]('whatsapp'));router[_0xd08b('0x6')](_0xd08b('0x49'),auth[_0xd08b('0xb')](),controller[_0xd08b('0x4a')]);router[_0xd08b('0x6')](_0xd08b('0x4b'),auth[_0xd08b('0xb')](),controller['showWhatsappQueues']);router[_0xd08b('0x37')]('/agents/:id/notify',auth[_0xd08b('0xb')](),controller[_0xd08b('0x4c')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index 14993d6..bfafe3e 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 _0xa41a=['name','send','isNil','rows','find','voiceChannels','VoiceChannels','query','voiceChannelMixMonitor','merge','params','catch','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','VoiceQueues','updateVoiceQueue','UpdateVoiceQueue','body','VoiceQueuesPreview','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','Outbound','outboundChannels','OutboundChannels','Agents','agentCapacity','interaction','hasOwnProperty','MemberReport','findAll','YYYY-MM-DD\x20HH:mm:ss','length','updateAttributes','findOrCreate','user','INTERACTION','interface','SIP/%s','agent','AgentCapacity','capacity','trunks','Trunks','campaigns','Campaigns','chatQueues','ChatQueues','showChatQueues','showMailQueues','MailQueues','mailAccounts','OpenchannelQueues','showOpenchannelQueues','SmsQueues','showSmsQueues','whatsappQueues','showWhatsappQueues','WhatsappQueues','FaxQueues','showFaxQueues','faxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','type','filter','map','queue_id','value','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','faxQueuesWaitingInteractions','queueNotify','capitalize','chat','Website','Queue','findOne','\x20Queue\x20not\x20found','Interaction','update','MessageId','From','Account','QueueId','TransferReport','create','Start','queue','queueTransferTimeout','agentNotify','Channel\x20field\x20is\x20mandatory','channel','User','Agent\x20not\x20found','Message','messageId','\x20Message\x20not\x20found','agentTransferTimeout','*,*,*,*','bluebird','moment','util','../../mysqldb','../../config/logger','api','jayson/promise','client','http','request','then','error','code','message','result','status','json','sendStatus','stack'];(function(_0x4e607f,_0x473052){var _0x202d88=function(_0x3dd7c1){while(--_0x3dd7c1){_0x4e607f['push'](_0x4e607f['shift']());}};_0x202d88(++_0x473052);}(_0xa41a,0x6b));var _0xaa41=function(_0x4c7ffe,_0x29ba20){_0x4c7ffe=_0x4c7ffe-0x0;var _0x4a9017=_0xa41a[_0x4c7ffe];return _0x4a9017;};'use strict';var BPromise=require(_0xaa41('0x0'));var moment=require(_0xaa41('0x1'));var _=require('lodash');var util=require(_0xaa41('0x2'));var db=require(_0xaa41('0x3'))['db'];var logger=require(_0xaa41('0x4'))(_0xaa41('0x5'));var jayson=require(_0xaa41('0x6'));var amiClient=jayson[_0xaa41('0x7')][_0xaa41('0x8')]({'port':0x232a});var mailClient=jayson[_0xaa41('0x7')]['http']({'port':0x232b});var routingClient=jayson[_0xaa41('0x7')][_0xaa41('0x8')]({'port':0x232c});function respondWithRpcPromise(_0x54bc5a,_0x5b1fff,_0x179545){return new BPromise(function(_0x202cce,_0x588ab4){var _0x31df43=_0x179545?_0x179545:amiClient;return _0x31df43[_0xaa41('0x9')](_0x54bc5a,_0x5b1fff)[_0xaa41('0xa')](function(_0x1cc344){if(_0x1cc344[_0xaa41('0xb')]){if(_0x1cc344[_0xaa41('0xb')][_0xaa41('0xc')]===0x1f4){return _0x588ab4(_0x1cc344[_0xaa41('0xb')][_0xaa41('0xd')]);}return _0x202cce(_0x1cc344['error'][_0xaa41('0xd')]);}else{_0x202cce(_0x1cc344[_0xaa41('0xe')]);}})['catch'](function(_0x54827c){_0x588ab4(_0x54827c);});});}function respondWithResult(_0x1d0a54,_0x518b5b){_0x518b5b=_0x518b5b||0xc8;return function(_0x19bd69){if(_0x19bd69){return _0x1d0a54[_0xaa41('0xf')](_0x518b5b)[_0xaa41('0x10')](_0x19bd69);}return _0x1d0a54[_0xaa41('0x11')](0x194);};}function handleError(_0x6f9ade,_0x4eaf81){_0x4eaf81=_0x4eaf81||0x1f4;return function(_0x1e9d7f){logger[_0xaa41('0xb')](_0x1e9d7f[_0xaa41('0x12')]);if(_0x1e9d7f[_0xaa41('0x13')]){delete _0x1e9d7f[_0xaa41('0x13')];}_0x6f9ade[_0xaa41('0xf')](_0x4eaf81)[_0xaa41('0x14')](_0x1e9d7f);};}function findById(_0x550ad5){return function(_0x2d868a){if(!_[_0xaa41('0x15')](_0x550ad5)&&!_[_0xaa41('0x15')](_0x2d868a)&&!_[_0xaa41('0x15')](_0x2d868a[_0xaa41('0x16')])){return _[_0xaa41('0x17')](_0x2d868a[_0xaa41('0x16')],function(_0x46e6d3){return _0x46e6d3['id']==_0x550ad5;});}return null;};}exports[_0xaa41('0x18')]=function(_0x4fe1a4,_0x5cd936){return respondWithRpcPromise(_0xaa41('0x19'),_0x4fe1a4[_0xaa41('0x1a')])[_0xaa41('0xa')](respondWithResult(_0x5cd936,null))['catch'](handleError(_0x5cd936,null));};exports[_0xaa41('0x1b')]=function(_0x1f692b,_0x4e768e){return respondWithRpcPromise('VoiceChannelMixMonitor',_[_0xaa41('0x1c')](_0x1f692b['query'],_0x1f692b[_0xaa41('0x1d')]))[_0xaa41('0xa')](respondWithResult(_0x4e768e,null))[_0xaa41('0x1e')](handleError(_0x4e768e,null));};exports[_0xaa41('0x1f')]=function(_0x1d623c,_0x4eb01f){return respondWithRpcPromise(_0xaa41('0x20'),_[_0xaa41('0x1c')](_0x1d623c[_0xaa41('0x1a')],_0x1d623c[_0xaa41('0x1d')]))[_0xaa41('0xa')](respondWithResult(_0x4eb01f,null))[_0xaa41('0x1e')](handleError(_0x4eb01f,null));};exports['voiceQueues']=function(_0x5795f4,_0x16aec5){return respondWithRpcPromise('VoiceQueues',_0x5795f4['query'])[_0xaa41('0xa')](respondWithResult(_0x16aec5,null))['catch'](handleError(_0x16aec5,null));};exports['showVoiceQueues']=function(_0x2d0ac0,_0x9c8c21){return respondWithRpcPromise(_0xaa41('0x21'),_0x2d0ac0[_0xaa41('0x1a')])[_0xaa41('0xa')](findById(_0x2d0ac0[_0xaa41('0x1d')]['id']))['then'](respondWithResult(_0x9c8c21,null))[_0xaa41('0x1e')](handleError(_0x9c8c21,null));};exports[_0xaa41('0x22')]=function(_0x63c18c,_0x9a16e3){return respondWithRpcPromise(_0xaa41('0x23'),_[_0xaa41('0x1c')](_0x63c18c[_0xaa41('0x24')],_0x63c18c[_0xaa41('0x1d')]))['then'](respondWithResult(_0x9a16e3,null))[_0xaa41('0x1e')](handleError(_0x9a16e3,null));};exports['voiceQueuesPreview']=function(_0x5dad80,_0x714537){return respondWithRpcPromise(_0xaa41('0x25'),_['merge'](_0x5dad80[_0xaa41('0x1a')],_0x5dad80[_0xaa41('0x1d')]))['then'](respondWithResult(_0x714537,null))['catch'](handleError(_0x714537,null));};exports['voiceQueuesChannels']=function(_0x1cf3da,_0x2f5cc0){return respondWithRpcPromise(_0xaa41('0x26'),_0x1cf3da[_0xaa41('0x1a')])['then'](respondWithResult(_0x2f5cc0,null))[_0xaa41('0x1e')](handleError(_0x2f5cc0,null));};exports[_0xaa41('0x27')]=function(_0x3e0204,_0x4de770){return respondWithRpcPromise(_0xaa41('0x28'),_[_0xaa41('0x1c')](_0x3e0204[_0xaa41('0x1a')],_0x3e0204['params']))[_0xaa41('0xa')](respondWithResult(_0x4de770,null))[_0xaa41('0x1e')](handleError(_0x4de770,null));};exports['voiceQueuesChannelHangup']=function(_0x23eb50,_0x13b6d4){return respondWithRpcPromise(_0xaa41('0x29'),_['merge'](_0x23eb50[_0xaa41('0x1a')],_0x23eb50['params']))[_0xaa41('0xa')](respondWithResult(_0x13b6d4,null))[_0xaa41('0x1e')](handleError(_0x13b6d4,null));};exports[_0xaa41('0x2a')]=function(_0x49b77a,_0x526377){return respondWithRpcPromise('VoiceQueuesChannelRedirect',_[_0xaa41('0x1c')](_0x49b77a[_0xaa41('0x1a')],_0x49b77a[_0xaa41('0x1d')]))[_0xaa41('0xa')](respondWithResult(_0x526377,null))['catch'](handleError(_0x526377,null));};exports['outbound']=function(_0x267999,_0x5673c){return respondWithRpcPromise(_0xaa41('0x2b'),_0x267999[_0xaa41('0x1a')])[_0xaa41('0xa')](respondWithResult(_0x5673c,null))[_0xaa41('0x1e')](handleError(_0x5673c,null));};exports[_0xaa41('0x2c')]=function(_0x5e9879,_0x3adc28){return respondWithRpcPromise(_0xaa41('0x2d'),_0x5e9879[_0xaa41('0x1a')])[_0xaa41('0xa')](respondWithResult(_0x3adc28,null))['catch'](handleError(_0x3adc28,null));};exports['agents']=function(_0x42b759,_0x275fa3){var _0x5eae08;return respondWithRpcPromise(_0xaa41('0x2e'),_0x42b759['query'])[_0xaa41('0xa')](function(_0x25f2df){_0x5eae08=_0x25f2df;return respondWithRpcPromise(_0xaa41('0x2e'),_0x42b759[_0xaa41('0x1a')],routingClient);})[_0xaa41('0xa')](function(_0x12ba1a){return _[_0xaa41('0x1c')]({},_0x12ba1a,_0x5eae08);})[_0xaa41('0xa')](respondWithResult(_0x275fa3,null))['catch'](handleError(_0x275fa3,null));};exports[_0xaa41('0x2f')]=function(_0x2abf39,_0x35c685){if(_0x2abf39[_0xaa41('0x24')]&&_0x2abf39[_0xaa41('0x24')][_0xaa41('0x30')]&&_0x2abf39['user']&&_0x2abf39['user'][_0xaa41('0x13')]){for(var _0x4f9086 in _0x2abf39[_0xaa41('0x24')][_0xaa41('0x30')]){if(_0x2abf39[_0xaa41('0x24')][_0xaa41('0x30')][_0xaa41('0x31')](_0x4f9086)){db[_0xaa41('0x32')][_0xaa41('0x33')]({'where':{'channel':_0x4f9086,'membername':_0x2abf39['user'][_0xaa41('0x13')],'type':'INTERACTION','exitAt':null,'uniqueid':_0x2abf39['body'][_0xaa41('0x30')][_0x4f9086]&&_0x2abf39['body']['interaction'][_0x4f9086]['length']?{'$notIn':_0x2abf39[_0xaa41('0x24')]['interaction'][_0x4f9086]}:{'$ne':null}}})[_0xaa41('0xa')](function(_0x198716){var _0x4a6882=moment()['format'](_0xaa41('0x34'));for(var _0x1b7b97=0x0,_0x1bb973=_0x198716[_0xaa41('0x35')];_0x1b7b97<_0x1bb973;_0x1b7b97+=0x1){_0x198716[_0x1b7b97][_0xaa41('0x36')]({'exitAt':_0x4a6882});}});for(var _0x337993=0x0;_0x337993<_0x2abf39[_0xaa41('0x24')][_0xaa41('0x30')][_0x4f9086][_0xaa41('0x35')];_0x337993+=0x1){db['MemberReport'][_0xaa41('0x37')]({'where':{'channel':_0x4f9086,'membername':_0x2abf39[_0xaa41('0x38')][_0xaa41('0x13')],'type':_0xaa41('0x39'),'uniqueid':_0x2abf39[_0xaa41('0x24')][_0xaa41('0x30')][_0x4f9086][_0x337993],'exitAt':null},'defaults':{'channel':_0x4f9086,'membername':_0x2abf39['user'][_0xaa41('0x13')],'interface':_[_0xaa41('0x15')](_0x2abf39[_0xaa41('0x38')][_0xaa41('0x3a')])?util['format'](_0xaa41('0x3b'),_0x2abf39['user']['name']):_0x2abf39[_0xaa41('0x38')][_0xaa41('0x3a')],'type':_0xaa41('0x39'),'enterAt':moment()['format'](_0xaa41('0x34')),'role':_0xaa41('0x3c'),'internal':_0x2abf39[_0xaa41('0x38')]['internal'],'uniqueid':_0x2abf39[_0xaa41('0x24')][_0xaa41('0x30')][_0x4f9086][_0x337993]}});}}}}return respondWithRpcPromise(_0xaa41('0x3d'),{'id':_0x2abf39[_0xaa41('0x1d')]['id'],'capacity':_0x2abf39[_0xaa41('0x24')][_0xaa41('0x3e')]},routingClient)[_0xaa41('0xa')](respondWithResult(_0x35c685,null))[_0xaa41('0x1e')](handleError(_0x35c685,null));};exports['telephones']=function(_0x9f0a81,_0x5bef5f){return respondWithRpcPromise('Telephones',_0x9f0a81[_0xaa41('0x1a')])[_0xaa41('0xa')](respondWithResult(_0x5bef5f,null))[_0xaa41('0x1e')](handleError(_0x5bef5f,null));};exports[_0xaa41('0x3f')]=function(_0x14aab0,_0x288db3){return respondWithRpcPromise(_0xaa41('0x40'),_0x14aab0[_0xaa41('0x1a')])['then'](respondWithResult(_0x288db3,null))[_0xaa41('0x1e')](handleError(_0x288db3,null));};exports[_0xaa41('0x41')]=function(_0x1d518f,_0x4f9e92){return respondWithRpcPromise(_0xaa41('0x42'),_0x1d518f[_0xaa41('0x1a')])['then'](respondWithResult(_0x4f9e92,null))[_0xaa41('0x1e')](handleError(_0x4f9e92,null));};exports[_0xaa41('0x43')]=function(_0x283b3b,_0x4e5a2e){return respondWithRpcPromise(_0xaa41('0x44'),_0x283b3b[_0xaa41('0x1a')],routingClient)['then'](respondWithResult(_0x4e5a2e,null))['catch'](handleError(_0x4e5a2e,null));};exports[_0xaa41('0x45')]=function(_0x3cd14f,_0x3a29d2){return respondWithRpcPromise('ChatQueues',_0x3cd14f[_0xaa41('0x1a')],routingClient)[_0xaa41('0xa')](findById(_0x3cd14f[_0xaa41('0x1d')]['id']))[_0xaa41('0xa')](respondWithResult(_0x3a29d2,null))[_0xaa41('0x1e')](handleError(_0x3a29d2,null));};exports['mailQueues']=function(_0x2ae70c,_0x57cb70){return respondWithRpcPromise('MailQueues',_0x2ae70c[_0xaa41('0x1a')],routingClient)['then'](respondWithResult(_0x57cb70,null))[_0xaa41('0x1e')](handleError(_0x57cb70,null));};exports[_0xaa41('0x46')]=function(_0x169ddf,_0x5e83e1){return respondWithRpcPromise(_0xaa41('0x47'),_0x169ddf[_0xaa41('0x1a')],routingClient)[_0xaa41('0xa')](findById(_0x169ddf[_0xaa41('0x1d')]['id']))[_0xaa41('0xa')](respondWithResult(_0x5e83e1,null))[_0xaa41('0x1e')](handleError(_0x5e83e1,null));};exports[_0xaa41('0x48')]=function(_0x337059,_0x3f91f3){return respondWithRpcPromise('MailAccounts',_0x337059[_0xaa41('0x1a')],mailClient)[_0xaa41('0xa')](respondWithResult(_0x3f91f3,null))[_0xaa41('0x1e')](handleError(_0x3f91f3,null));};exports['openchannelQueues']=function(_0x3fe47a,_0x2caf5c){return respondWithRpcPromise(_0xaa41('0x49'),_0x3fe47a[_0xaa41('0x1a')],routingClient)[_0xaa41('0xa')](respondWithResult(_0x2caf5c,null))[_0xaa41('0x1e')](handleError(_0x2caf5c,null));};exports[_0xaa41('0x4a')]=function(_0x5ea056,_0x55a85c){return respondWithRpcPromise('OpenchannelQueues',_0x5ea056['query'],routingClient)['then'](findById(_0x5ea056['params']['id']))[_0xaa41('0xa')](respondWithResult(_0x55a85c,null))['catch'](handleError(_0x55a85c,null));};exports['smsQueues']=function(_0x24c6f3,_0x40a524){return respondWithRpcPromise(_0xaa41('0x4b'),_0x24c6f3[_0xaa41('0x1a')],routingClient)['then'](respondWithResult(_0x40a524,null))[_0xaa41('0x1e')](handleError(_0x40a524,null));};exports[_0xaa41('0x4c')]=function(_0x1ddb6c,_0x46822f){return respondWithRpcPromise(_0xaa41('0x4b'),_0x1ddb6c[_0xaa41('0x1a')],routingClient)[_0xaa41('0xa')](findById(_0x1ddb6c[_0xaa41('0x1d')]['id']))[_0xaa41('0xa')](respondWithResult(_0x46822f,null))['catch'](handleError(_0x46822f,null));};exports[_0xaa41('0x4d')]=function(_0x2d2af8,_0x50170f){return respondWithRpcPromise('WhatsappQueues',_0x2d2af8['query'],routingClient)[_0xaa41('0xa')](respondWithResult(_0x50170f,null))['catch'](handleError(_0x50170f,null));};exports[_0xaa41('0x4e')]=function(_0x5c8028,_0x5423b6){return respondWithRpcPromise(_0xaa41('0x4f'),_0x5c8028['query'],routingClient)[_0xaa41('0xa')](findById(_0x5c8028[_0xaa41('0x1d')]['id']))[_0xaa41('0xa')](respondWithResult(_0x5423b6,null))[_0xaa41('0x1e')](handleError(_0x5423b6,null));};exports['faxQueues']=function(_0x5be61b,_0x339db3){return respondWithRpcPromise(_0xaa41('0x50'),_0x5be61b['query'],routingClient)['then'](respondWithResult(_0x339db3,null))[_0xaa41('0x1e')](handleError(_0x339db3,null));};exports[_0xaa41('0x51')]=function(_0x304694,_0xbeafb5){return respondWithRpcPromise(_0xaa41('0x50'),_0x304694['query'],routingClient)[_0xaa41('0xa')](findById(_0x304694['params']['id']))['then'](respondWithResult(_0xbeafb5,null))['catch'](handleError(_0xbeafb5,null));};exports[_0xaa41('0x52')]=function(_0x19ec63,_0x436362){return respondWithRpcPromise('FaxAccounts',_0x19ec63[_0xaa41('0x1a')])[_0xaa41('0xa')](respondWithResult(_0x436362,null))[_0xaa41('0x1e')](handleError(_0x436362,null));};exports[_0xaa41('0x53')]=function(_0x457515,_0x3ffbf8){return respondWithRpcPromise(_0xaa41('0x54'),_0x457515['query'],routingClient)[_0xaa41('0xa')](respondWithResult(_0x3ffbf8,null))[_0xaa41('0x1e')](handleError(_0x3ffbf8,null));};exports[_0xaa41('0x55')]=function(_0x175ca9,_0x51ff61){return respondWithRpcPromise(_0xaa41('0x56'),_0x175ca9['query'],routingClient)[_0xaa41('0xa')](respondWithResult(_0x51ff61,null))[_0xaa41('0x1e')](handleError(_0x51ff61,null));};exports[_0xaa41('0x57')]=function(_0x143ef0,_0x491cad){return respondWithRpcPromise(_0xaa41('0x58'),_0x143ef0[_0xaa41('0x1a')],routingClient)[_0xaa41('0xa')](respondWithResult(_0x491cad,null))[_0xaa41('0x1e')](handleError(_0x491cad,null));};exports['openchannelQueuesIdWaitingInteractions']=function(_0x140d78,_0x50197b){return respondWithRpcPromise(_0xaa41('0x58'),_0x140d78[_0xaa41('0x1a')],routingClient)['then'](function(_0x1ac05e){if(_0x140d78[_0xaa41('0x1a')][_0xaa41('0x59')]!==undefined){var _0x582d79=_(_0x1ac05e[_0xaa41('0x16')])[_0xaa41('0x5a')]([_0x140d78[_0xaa41('0x1a')][_0xaa41('0x59')],_0x140d78[_0xaa41('0x1d')]['id']])[_0xaa41('0x5b')](_0xaa41('0x5c'))['uniq']()[_0xaa41('0x5d')]();return _0x1ac05e[_0xaa41('0x16')][_0xaa41('0x5a')](function(_0x530982){return _0x582d79['indexOf'](_0x530982[_0xaa41('0x5c')])>-0x1;});}else{return _0x1ac05e[_0xaa41('0x16')]['filter'](function(_0x1ce957){return _0x1ce957[_0xaa41('0x5c')]===parseInt(_0x140d78['params']['id']);});}})[_0xaa41('0xa')](respondWithResult(_0x50197b,null))[_0xaa41('0x1e')](handleError(_0x50197b,null));};exports[_0xaa41('0x5e')]=function(_0xe8731,_0x46feb2){return respondWithRpcPromise(_0xaa41('0x5f'),_0xe8731[_0xaa41('0x1a')],routingClient)[_0xaa41('0xa')](respondWithResult(_0x46feb2,null))['catch'](handleError(_0x46feb2,null));};exports['whatsappQueuesWaitingInteractions']=function(_0x397526,_0x481db9){return respondWithRpcPromise(_0xaa41('0x60'),_0x397526[_0xaa41('0x1a')],routingClient)[_0xaa41('0xa')](respondWithResult(_0x481db9,null))['catch'](handleError(_0x481db9,null));};exports[_0xaa41('0x61')]=function(_0x404c38,_0x2d7493){return respondWithRpcPromise('FaxQueuesWaitingInteractions',_0x404c38[_0xaa41('0x1a')],routingClient)[_0xaa41('0xa')](respondWithResult(_0x2d7493,null))['catch'](handleError(_0x2d7493,null));};exports[_0xaa41('0x62')]=function(_0x4de25c){return function(_0x53faf4,_0x3f6a2b){var _0x34d0e4,_0x5eded3;var _0x5a8cb0=_[_0xaa41('0x63')](_0x4de25c);var _0x1726ec=_0x4de25c===_0xaa41('0x64')?_0xaa41('0x65'):'Account';return db[_0x5a8cb0+_0xaa41('0x66')][_0xaa41('0x67')]({'raw':!![],'where':{'id':_0x53faf4[_0xaa41('0x1d')]['id']}})['then'](function(_0x1ad3aa){if(_[_0xaa41('0x15')](_0x1ad3aa)){throw new Error(_0x5a8cb0+_0xaa41('0x68'));}_0x34d0e4=_0x1ad3aa;return db[_0x5a8cb0+'Message'][_0xaa41('0x67')]({'where':{'id':_0x53faf4['body']['messageId']},'include':[{'model':db[_0x5a8cb0+_0xaa41('0x69')],'as':_0xaa41('0x69')},{'model':db[_0x5a8cb0+_0x1726ec],'as':'Account'}]});})[_0xaa41('0xa')](function(_0x9e8ebb){if(_[_0xaa41('0x15')](_0x9e8ebb)){throw new Error(_0x5a8cb0+'\x20Message\x20not\x20found');}_0x5eded3=_0x9e8ebb;return _0x9e8ebb[_0xaa41('0x6a')]({'read':0x0,'readAt':null,'UserId':null});})[_0xaa41('0xa')](function(){var _0x1a2deb={'uniqueid':_0x4de25c+'.'+_0x5eded3['id']+'.'+_0x5eded3[_0xaa41('0x69')]['id'],'FromUserId':_0x53faf4[_0xaa41('0x38')]['id'],'type':'queue'};_0x1a2deb[_0x5a8cb0+_0xaa41('0x6b')]=_0x5eded3['id'];_0x1a2deb[_0x5a8cb0+'InteractionId']=_0x5eded3[_0xaa41('0x69')]['id'];_0x1a2deb[_0xaa41('0x6c')+_0x5a8cb0+_0x1726ec+'Id']=_0x5eded3[_0xaa41('0x6d')]['id'];_0x1a2deb['To'+_0x5a8cb0+_0xaa41('0x6e')]=_0x34d0e4['id'];return db[_0x5a8cb0+_0xaa41('0x6f')][_0xaa41('0x70')](_0x1a2deb);})[_0xaa41('0xa')](function(){return respondWithRpcPromise(_0xaa41('0x71'),{'channel':_0x4de25c,'interaction':_0x5eded3[_0xaa41('0x69')],'message':_0x5eded3,'account':_0x5eded3[_0xaa41('0x6d')],'applications':[{'id':0x0,'priority':0x1,'app':_0xaa41('0x72'),'appdata':_0x34d0e4['name']+','+(_0x5eded3[_0xaa41('0x6d')][_0xaa41('0x73')]||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0xaa41('0xa')](respondWithResult(_0x3f6a2b,null))['catch'](handleError(_0x3f6a2b,null));};};exports[_0xaa41('0x74')]=function(_0xb44b1f,_0x472eb3){var _0x38d759,_0x2dc55e;if(_[_0xaa41('0x15')](_0xb44b1f[_0xaa41('0x24')]['channel'])){throw new Error(_0xaa41('0x75'));}var _0x1d50db=_0xb44b1f[_0xaa41('0x24')][_0xaa41('0x76')];var _0x585ce7=_[_0xaa41('0x63')](_0x1d50db);var _0x5c9beb=_0x1d50db===_0xaa41('0x64')?_0xaa41('0x65'):_0xaa41('0x6d');return db[_0xaa41('0x77')][_0xaa41('0x67')]({'raw':!![],'where':{'id':_0xb44b1f['params']['id'],'role':_0xaa41('0x3c')}})[_0xaa41('0xa')](function(_0x5819ac){if(_[_0xaa41('0x15')](_0x5819ac)){throw new Error(_0xaa41('0x78'));}_0x38d759=_0x5819ac;return db[_0x585ce7+_0xaa41('0x79')][_0xaa41('0x67')]({'where':{'id':_0xb44b1f[_0xaa41('0x24')][_0xaa41('0x7a')]},'include':[{'model':db[_0x585ce7+_0xaa41('0x69')],'as':_0xaa41('0x69')},{'model':db[_0x585ce7+_0x5c9beb],'as':'Account'}]});})[_0xaa41('0xa')](function(_0x39d3cc){if(_[_0xaa41('0x15')](_0x39d3cc)){throw new Error(_0x585ce7+_0xaa41('0x7b'));}_0x2dc55e=_0x39d3cc;return _0x39d3cc[_0xaa41('0x6a')]({'read':0x0,'readAt':null,'UserId':null});})[_0xaa41('0xa')](function(){var _0x5489be={'uniqueid':_0x1d50db+'.'+_0x2dc55e['id']+'.'+_0x2dc55e['Interaction']['id'],'FromUserId':_0xb44b1f['user']['id'],'type':_0xaa41('0x72'),'ToUserId':_0x38d759['id']};_0x5489be[_0x585ce7+_0xaa41('0x6b')]=_0x2dc55e['id'];_0x5489be[_0x585ce7+'InteractionId']=_0x2dc55e[_0xaa41('0x69')]['id'];_0x5489be[_0xaa41('0x6c')+_0x585ce7+_0x5c9beb+'Id']=_0x2dc55e['Account']['id'];return db[_0x585ce7+_0xaa41('0x6f')][_0xaa41('0x70')](_0x5489be);})[_0xaa41('0xa')](function(){return respondWithRpcPromise(_0xaa41('0x71'),{'channel':_0x1d50db,'interaction':_0x2dc55e['Interaction'],'message':_0x2dc55e,'account':_0x2dc55e[_0xaa41('0x6d')],'applications':[{'id':0x0,'priority':0x1,'app':'agent','appdata':_0x38d759[_0xaa41('0x13')]+','+(_0x2dc55e[_0xaa41('0x6d')][_0xaa41('0x7c')]||0x12c),'interval':_0xaa41('0x7d')}]},routingClient);})[_0xaa41('0xa')](respondWithResult(_0x472eb3,null))[_0xaa41('0x1e')](handleError(_0x472eb3,null));}; \ No newline at end of file +var _0x9957=['queueNotify','capitalize','chat','Website','Account','findOne','Message','messageId','Interaction','\x20Message\x20not\x20found','MessageId','InteractionId','QueueId','TransferReport','Start','queue','*,*,*,*','agentNotify','channel','Channel\x20field\x20is\x20mandatory','User','agent','Agent\x20not\x20found','From','create','bluebird','moment','lodash','util','../../config/logger','api','jayson/promise','client','http','request','then','error','code','message','catch','status','json','stack','name','send','isNil','rows','find','merge','query','params','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','voiceQueues','VoiceQueues','showVoiceQueues','UpdateVoiceQueue','body','voiceQueuesPreview','VoiceQueuesPreview','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','OutboundChannels','agents','Agents','interaction','user','hasOwnProperty','MemberReport','findAll','INTERACTION','YYYY-MM-DD\x20HH:mm:ss','length','updateAttributes','findOrCreate','format','interface','internal','AgentCapacity','telephones','Telephones','trunks','chatQueues','ChatQueues','showChatQueues','MailQueues','showMailQueues','MailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','smsQueues','showSmsQueues','SmsQueues','whatsappQueues','WhatsappQueues','showWhatsappQueues','FaxQueues','showFaxQueues','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','openchannelQueuesIdWaitingInteractions','type','filter','map','queue_id','uniq','value','indexOf','smsQueuesWaitingInteractions','WhatsappQueuesWaitingInteractions','FaxQueuesWaitingInteractions'];(function(_0x43e75d,_0x4bf714){var _0x3a96e9=function(_0x1d7f60){while(--_0x1d7f60){_0x43e75d['push'](_0x43e75d['shift']());}};_0x3a96e9(++_0x4bf714);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var BPromise=require(_0x7995('0x0'));var moment=require(_0x7995('0x1'));var _=require(_0x7995('0x2'));var util=require(_0x7995('0x3'));var db=require('../../mysqldb')['db'];var logger=require(_0x7995('0x4'))(_0x7995('0x5'));var jayson=require(_0x7995('0x6'));var amiClient=jayson[_0x7995('0x7')]['http']({'port':0x232a});var mailClient=jayson[_0x7995('0x7')][_0x7995('0x8')]({'port':0x232b});var routingClient=jayson[_0x7995('0x7')][_0x7995('0x8')]({'port':0x232c});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){var _0x4a64f7=_0x4996ca?_0x4996ca:amiClient;return _0x4a64f7[_0x7995('0x9')](_0xbda126,_0x326741)[_0x7995('0xa')](function(_0x18c8a3){if(_0x18c8a3[_0x7995('0xb')]){if(_0x18c8a3[_0x7995('0xb')][_0x7995('0xc')]===0x1f4){return _0x1cad37(_0x18c8a3[_0x7995('0xb')]['message']);}return _0x465276(_0x18c8a3[_0x7995('0xb')][_0x7995('0xd')]);}else{_0x465276(_0x18c8a3['result']);}})[_0x7995('0xe')](function(_0x2cb37a){_0x1cad37(_0x2cb37a);});});}function respondWithResult(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xc8;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0xf')](_0x385f00)[_0x7995('0x10')](_0x281576);}return _0x19a27e['sendStatus'](0x194);};}function handleError(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0x1f4;return function(_0x2233dd){logger[_0x7995('0xb')](_0x2233dd[_0x7995('0x11')]);if(_0x2233dd[_0x7995('0x12')]){delete _0x2233dd[_0x7995('0x12')];}_0x58f5ad[_0x7995('0xf')](_0x2b4e94)[_0x7995('0x13')](_0x2233dd);};}function findById(_0x5377e5){return function(_0x2eeacc){if(!_['isNil'](_0x5377e5)&&!_[_0x7995('0x14')](_0x2eeacc)&&!_[_0x7995('0x14')](_0x2eeacc[_0x7995('0x15')])){return _[_0x7995('0x16')](_0x2eeacc[_0x7995('0x15')],function(_0x37a7d4){return _0x37a7d4['id']==_0x5377e5;});}return null;};}exports['voiceChannels']=function(_0x54c9ae,_0x2536c8){return respondWithRpcPromise('VoiceChannels',_0x54c9ae['query'])[_0x7995('0xa')](respondWithResult(_0x2536c8,null))[_0x7995('0xe')](handleError(_0x2536c8,null));};exports['voiceChannelMixMonitor']=function(_0x3a9b54,_0x51f276){return respondWithRpcPromise('VoiceChannelMixMonitor',_[_0x7995('0x17')](_0x3a9b54[_0x7995('0x18')],_0x3a9b54[_0x7995('0x19')]))[_0x7995('0xa')](respondWithResult(_0x51f276,null))[_0x7995('0xe')](handleError(_0x51f276,null));};exports[_0x7995('0x1a')]=function(_0x5d40ae,_0x32a09a){return respondWithRpcPromise(_0x7995('0x1b'),_[_0x7995('0x17')](_0x5d40ae[_0x7995('0x18')],_0x5d40ae[_0x7995('0x19')]))[_0x7995('0xa')](respondWithResult(_0x32a09a,null))[_0x7995('0xe')](handleError(_0x32a09a,null));};exports[_0x7995('0x1c')]=function(_0x59405a,_0x39df42){return respondWithRpcPromise(_0x7995('0x1d'),_0x59405a[_0x7995('0x18')])[_0x7995('0xa')](respondWithResult(_0x39df42,null))[_0x7995('0xe')](handleError(_0x39df42,null));};exports[_0x7995('0x1e')]=function(_0x56691a,_0x47625f){return respondWithRpcPromise('VoiceQueues',_0x56691a[_0x7995('0x18')])[_0x7995('0xa')](findById(_0x56691a[_0x7995('0x19')]['id']))[_0x7995('0xa')](respondWithResult(_0x47625f,null))[_0x7995('0xe')](handleError(_0x47625f,null));};exports['updateVoiceQueue']=function(_0x9b2a15,_0x514445){return respondWithRpcPromise(_0x7995('0x1f'),_[_0x7995('0x17')](_0x9b2a15[_0x7995('0x20')],_0x9b2a15['params']))['then'](respondWithResult(_0x514445,null))['catch'](handleError(_0x514445,null));};exports[_0x7995('0x21')]=function(_0xe6b0b3,_0x327a81){return respondWithRpcPromise(_0x7995('0x22'),_[_0x7995('0x17')](_0xe6b0b3[_0x7995('0x18')],_0xe6b0b3['params']))['then'](respondWithResult(_0x327a81,null))[_0x7995('0xe')](handleError(_0x327a81,null));};exports['voiceQueuesChannels']=function(_0x553671,_0x3eb566){return respondWithRpcPromise(_0x7995('0x23'),_0x553671[_0x7995('0x18')])[_0x7995('0xa')](respondWithResult(_0x3eb566,null))['catch'](handleError(_0x3eb566,null));};exports[_0x7995('0x24')]=function(_0x33e24e,_0x5dd802){return respondWithRpcPromise('VoiceQueuesChannel',_['merge'](_0x33e24e[_0x7995('0x18')],_0x33e24e[_0x7995('0x19')]))['then'](respondWithResult(_0x5dd802,null))[_0x7995('0xe')](handleError(_0x5dd802,null));};exports['voiceQueuesChannelHangup']=function(_0x37917b,_0x1cb058){return respondWithRpcPromise(_0x7995('0x25'),_['merge'](_0x37917b['query'],_0x37917b[_0x7995('0x19')]))['then'](respondWithResult(_0x1cb058,null))['catch'](handleError(_0x1cb058,null));};exports[_0x7995('0x26')]=function(_0xe328b1,_0x5212ff){return respondWithRpcPromise(_0x7995('0x27'),_[_0x7995('0x17')](_0xe328b1[_0x7995('0x18')],_0xe328b1[_0x7995('0x19')]))[_0x7995('0xa')](respondWithResult(_0x5212ff,null))['catch'](handleError(_0x5212ff,null));};exports[_0x7995('0x28')]=function(_0x242713,_0xf612e6){return respondWithRpcPromise(_0x7995('0x29'),_0x242713['query'])[_0x7995('0xa')](respondWithResult(_0xf612e6,null))[_0x7995('0xe')](handleError(_0xf612e6,null));};exports[_0x7995('0x2a')]=function(_0xe5ea43,_0x1f5bee){return respondWithRpcPromise(_0x7995('0x2b'),_0xe5ea43['query'])[_0x7995('0xa')](respondWithResult(_0x1f5bee,null))[_0x7995('0xe')](handleError(_0x1f5bee,null));};exports[_0x7995('0x2c')]=function(_0x2ea47f,_0x2e04cd){var _0x298fc2;return respondWithRpcPromise(_0x7995('0x2d'),_0x2ea47f[_0x7995('0x18')])[_0x7995('0xa')](function(_0x447981){_0x298fc2=_0x447981;return respondWithRpcPromise(_0x7995('0x2d'),_0x2ea47f[_0x7995('0x18')],routingClient);})[_0x7995('0xa')](function(_0x53cda2){return _['merge']({},_0x53cda2,_0x298fc2);})[_0x7995('0xa')](respondWithResult(_0x2e04cd,null))[_0x7995('0xe')](handleError(_0x2e04cd,null));};exports['agentCapacity']=function(_0x4b0855,_0x3f8522){if(_0x4b0855['body']&&_0x4b0855['body'][_0x7995('0x2e')]&&_0x4b0855[_0x7995('0x2f')]&&_0x4b0855[_0x7995('0x2f')]['name']){for(var _0x46ac4f in _0x4b0855['body'][_0x7995('0x2e')]){if(_0x4b0855['body']['interaction'][_0x7995('0x30')](_0x46ac4f)){db[_0x7995('0x31')][_0x7995('0x32')]({'where':{'channel':_0x46ac4f,'membername':_0x4b0855[_0x7995('0x2f')]['name'],'type':_0x7995('0x33'),'exitAt':null,'uniqueid':_0x4b0855[_0x7995('0x20')][_0x7995('0x2e')][_0x46ac4f]&&_0x4b0855[_0x7995('0x20')]['interaction'][_0x46ac4f]['length']?{'$notIn':_0x4b0855[_0x7995('0x20')]['interaction'][_0x46ac4f]}:{'$ne':null}}})[_0x7995('0xa')](function(_0x59c153){var _0x2f435e=moment()['format'](_0x7995('0x34'));for(var _0x1b0373=0x0,_0x4d9245=_0x59c153[_0x7995('0x35')];_0x1b0373<_0x4d9245;_0x1b0373+=0x1){_0x59c153[_0x1b0373][_0x7995('0x36')]({'exitAt':_0x2f435e});}});for(var _0x314145=0x0;_0x314145<_0x4b0855[_0x7995('0x20')]['interaction'][_0x46ac4f][_0x7995('0x35')];_0x314145+=0x1){db[_0x7995('0x31')][_0x7995('0x37')]({'where':{'channel':_0x46ac4f,'membername':_0x4b0855['user'][_0x7995('0x12')],'type':_0x7995('0x33'),'uniqueid':_0x4b0855[_0x7995('0x20')][_0x7995('0x2e')][_0x46ac4f][_0x314145],'exitAt':null},'defaults':{'channel':_0x46ac4f,'membername':_0x4b0855[_0x7995('0x2f')]['name'],'interface':_[_0x7995('0x14')](_0x4b0855[_0x7995('0x2f')]['interface'])?util[_0x7995('0x38')]('SIP/%s',_0x4b0855[_0x7995('0x2f')][_0x7995('0x12')]):_0x4b0855[_0x7995('0x2f')][_0x7995('0x39')],'type':_0x7995('0x33'),'enterAt':moment()[_0x7995('0x38')](_0x7995('0x34')),'role':'agent','internal':_0x4b0855[_0x7995('0x2f')][_0x7995('0x3a')],'uniqueid':_0x4b0855[_0x7995('0x20')]['interaction'][_0x46ac4f][_0x314145]}});}}}}return respondWithRpcPromise(_0x7995('0x3b'),{'id':_0x4b0855[_0x7995('0x19')]['id'],'capacity':_0x4b0855[_0x7995('0x20')]['capacity']},routingClient)['then'](respondWithResult(_0x3f8522,null))['catch'](handleError(_0x3f8522,null));};exports[_0x7995('0x3c')]=function(_0x1fd1ca,_0x4cf5db){return respondWithRpcPromise(_0x7995('0x3d'),_0x1fd1ca[_0x7995('0x18')])[_0x7995('0xa')](respondWithResult(_0x4cf5db,null))[_0x7995('0xe')](handleError(_0x4cf5db,null));};exports[_0x7995('0x3e')]=function(_0x528c8e,_0x29ee32){return respondWithRpcPromise('Trunks',_0x528c8e[_0x7995('0x18')])[_0x7995('0xa')](respondWithResult(_0x29ee32,null))[_0x7995('0xe')](handleError(_0x29ee32,null));};exports['campaigns']=function(_0x5e1f34,_0x54e2b1){return respondWithRpcPromise('Campaigns',_0x5e1f34[_0x7995('0x18')])[_0x7995('0xa')](respondWithResult(_0x54e2b1,null))[_0x7995('0xe')](handleError(_0x54e2b1,null));};exports[_0x7995('0x3f')]=function(_0x1d957e,_0x357e60){return respondWithRpcPromise(_0x7995('0x40'),_0x1d957e[_0x7995('0x18')],routingClient)[_0x7995('0xa')](respondWithResult(_0x357e60,null))[_0x7995('0xe')](handleError(_0x357e60,null));};exports[_0x7995('0x41')]=function(_0x133c63,_0x3da72b){return respondWithRpcPromise(_0x7995('0x40'),_0x133c63[_0x7995('0x18')],routingClient)[_0x7995('0xa')](findById(_0x133c63[_0x7995('0x19')]['id']))[_0x7995('0xa')](respondWithResult(_0x3da72b,null))[_0x7995('0xe')](handleError(_0x3da72b,null));};exports['mailQueues']=function(_0x56a374,_0x630737){return respondWithRpcPromise(_0x7995('0x42'),_0x56a374[_0x7995('0x18')],routingClient)['then'](respondWithResult(_0x630737,null))['catch'](handleError(_0x630737,null));};exports[_0x7995('0x43')]=function(_0x197b52,_0x5b9467){return respondWithRpcPromise(_0x7995('0x42'),_0x197b52['query'],routingClient)[_0x7995('0xa')](findById(_0x197b52[_0x7995('0x19')]['id']))[_0x7995('0xa')](respondWithResult(_0x5b9467,null))[_0x7995('0xe')](handleError(_0x5b9467,null));};exports['mailAccounts']=function(_0x5e2d97,_0x40e5fc){return respondWithRpcPromise(_0x7995('0x44'),_0x5e2d97[_0x7995('0x18')],mailClient)[_0x7995('0xa')](respondWithResult(_0x40e5fc,null))[_0x7995('0xe')](handleError(_0x40e5fc,null));};exports[_0x7995('0x45')]=function(_0x1d4689,_0x1e2206){return respondWithRpcPromise(_0x7995('0x46'),_0x1d4689['query'],routingClient)[_0x7995('0xa')](respondWithResult(_0x1e2206,null))[_0x7995('0xe')](handleError(_0x1e2206,null));};exports[_0x7995('0x47')]=function(_0x1ecfdb,_0x59c5aa){return respondWithRpcPromise('OpenchannelQueues',_0x1ecfdb[_0x7995('0x18')],routingClient)[_0x7995('0xa')](findById(_0x1ecfdb['params']['id']))[_0x7995('0xa')](respondWithResult(_0x59c5aa,null))[_0x7995('0xe')](handleError(_0x59c5aa,null));};exports[_0x7995('0x48')]=function(_0x57727e,_0x32cb04){return respondWithRpcPromise('SmsQueues',_0x57727e[_0x7995('0x18')],routingClient)['then'](respondWithResult(_0x32cb04,null))[_0x7995('0xe')](handleError(_0x32cb04,null));};exports[_0x7995('0x49')]=function(_0x1722e2,_0x25b534){return respondWithRpcPromise(_0x7995('0x4a'),_0x1722e2[_0x7995('0x18')],routingClient)[_0x7995('0xa')](findById(_0x1722e2[_0x7995('0x19')]['id']))[_0x7995('0xa')](respondWithResult(_0x25b534,null))[_0x7995('0xe')](handleError(_0x25b534,null));};exports[_0x7995('0x4b')]=function(_0x234d8d,_0x56eb85){return respondWithRpcPromise(_0x7995('0x4c'),_0x234d8d[_0x7995('0x18')],routingClient)[_0x7995('0xa')](respondWithResult(_0x56eb85,null))[_0x7995('0xe')](handleError(_0x56eb85,null));};exports[_0x7995('0x4d')]=function(_0x54a2e0,_0x4b54f2){return respondWithRpcPromise(_0x7995('0x4c'),_0x54a2e0[_0x7995('0x18')],routingClient)[_0x7995('0xa')](findById(_0x54a2e0[_0x7995('0x19')]['id']))['then'](respondWithResult(_0x4b54f2,null))[_0x7995('0xe')](handleError(_0x4b54f2,null));};exports['faxQueues']=function(_0x5df621,_0xca8238){return respondWithRpcPromise(_0x7995('0x4e'),_0x5df621[_0x7995('0x18')],routingClient)[_0x7995('0xa')](respondWithResult(_0xca8238,null))[_0x7995('0xe')](handleError(_0xca8238,null));};exports[_0x7995('0x4f')]=function(_0x32a52f,_0x13dc73){return respondWithRpcPromise(_0x7995('0x4e'),_0x32a52f[_0x7995('0x18')],routingClient)['then'](findById(_0x32a52f[_0x7995('0x19')]['id']))[_0x7995('0xa')](respondWithResult(_0x13dc73,null))[_0x7995('0xe')](handleError(_0x13dc73,null));};exports['faxAccounts']=function(_0x1fe1cb,_0x1d2f9d){return respondWithRpcPromise(_0x7995('0x50'),_0x1fe1cb[_0x7995('0x18')])[_0x7995('0xa')](respondWithResult(_0x1d2f9d,null))[_0x7995('0xe')](handleError(_0x1d2f9d,null));};exports[_0x7995('0x51')]=function(_0x3adfd2,_0x2f94c4){return respondWithRpcPromise(_0x7995('0x52'),_0x3adfd2[_0x7995('0x18')],routingClient)['then'](respondWithResult(_0x2f94c4,null))['catch'](handleError(_0x2f94c4,null));};exports[_0x7995('0x53')]=function(_0xfe1105,_0x39ebb6){return respondWithRpcPromise(_0x7995('0x54'),_0xfe1105['query'],routingClient)[_0x7995('0xa')](respondWithResult(_0x39ebb6,null))[_0x7995('0xe')](handleError(_0x39ebb6,null));};exports['openchannelQueuesWaitingInteractions']=function(_0x480fdb,_0x3253b5){return respondWithRpcPromise(_0x7995('0x55'),_0x480fdb['query'],routingClient)[_0x7995('0xa')](respondWithResult(_0x3253b5,null))['catch'](handleError(_0x3253b5,null));};exports[_0x7995('0x56')]=function(_0xea9aba,_0x4ff9ff){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0xea9aba[_0x7995('0x18')],routingClient)['then'](function(_0x31b9e6){if(_0xea9aba[_0x7995('0x18')][_0x7995('0x57')]!==undefined){var _0x45bd8a=_(_0x31b9e6[_0x7995('0x15')])[_0x7995('0x58')]([_0xea9aba[_0x7995('0x18')][_0x7995('0x57')],_0xea9aba[_0x7995('0x19')]['id']])[_0x7995('0x59')](_0x7995('0x5a'))[_0x7995('0x5b')]()[_0x7995('0x5c')]();return _0x31b9e6[_0x7995('0x15')][_0x7995('0x58')](function(_0x3773de){return _0x45bd8a[_0x7995('0x5d')](_0x3773de[_0x7995('0x5a')])>-0x1;});}else{return _0x31b9e6[_0x7995('0x15')][_0x7995('0x58')](function(_0x306fa9){return _0x306fa9[_0x7995('0x5a')]===parseInt(_0xea9aba[_0x7995('0x19')]['id']);});}})[_0x7995('0xa')](respondWithResult(_0x4ff9ff,null))[_0x7995('0xe')](handleError(_0x4ff9ff,null));};exports[_0x7995('0x5e')]=function(_0x2f7f51,_0x34724d){return respondWithRpcPromise('SmsQueuesWaitingInteractions',_0x2f7f51[_0x7995('0x18')],routingClient)[_0x7995('0xa')](respondWithResult(_0x34724d,null))['catch'](handleError(_0x34724d,null));};exports['whatsappQueuesWaitingInteractions']=function(_0x15e8d1,_0x3fe8fc){return respondWithRpcPromise(_0x7995('0x5f'),_0x15e8d1[_0x7995('0x18')],routingClient)[_0x7995('0xa')](respondWithResult(_0x3fe8fc,null))[_0x7995('0xe')](handleError(_0x3fe8fc,null));};exports['faxQueuesWaitingInteractions']=function(_0x2f8a2d,_0xb68962){return respondWithRpcPromise(_0x7995('0x60'),_0x2f8a2d[_0x7995('0x18')],routingClient)[_0x7995('0xa')](respondWithResult(_0xb68962,null))[_0x7995('0xe')](handleError(_0xb68962,null));};exports[_0x7995('0x61')]=function(_0xc93dcb){return function(_0x560095,_0x1c8e7d){var _0x2b8217,_0x5c04c9;var _0x479271=_[_0x7995('0x62')](_0xc93dcb);var _0xf8c2ed=_0xc93dcb===_0x7995('0x63')?_0x7995('0x64'):_0x7995('0x65');return db[_0x479271+'Queue'][_0x7995('0x66')]({'raw':!![],'where':{'id':_0x560095[_0x7995('0x19')]['id']}})['then'](function(_0x209977){if(_[_0x7995('0x14')](_0x209977)){throw new Error(_0x479271+'\x20Queue\x20not\x20found');}_0x2b8217=_0x209977;return db[_0x479271+_0x7995('0x67')]['findOne']({'where':{'id':_0x560095[_0x7995('0x20')][_0x7995('0x68')]},'include':[{'model':db[_0x479271+_0x7995('0x69')],'as':_0x7995('0x69')},{'model':db[_0x479271+_0xf8c2ed],'as':_0x7995('0x65')}]});})['then'](function(_0x1f0506){if(_[_0x7995('0x14')](_0x1f0506)){throw new Error(_0x479271+_0x7995('0x6a'));}_0x5c04c9=_0x1f0506;return _0x1f0506['update']({'read':0x0,'readAt':null,'UserId':null});})[_0x7995('0xa')](function(){var _0x3f3434={'uniqueid':_0xc93dcb+'.'+_0x5c04c9['id']+'.'+_0x5c04c9[_0x7995('0x69')]['id'],'FromUserId':_0x560095[_0x7995('0x2f')]['id'],'type':'queue'};_0x3f3434[_0x479271+_0x7995('0x6b')]=_0x5c04c9['id'];_0x3f3434[_0x479271+_0x7995('0x6c')]=_0x5c04c9[_0x7995('0x69')]['id'];_0x3f3434['From'+_0x479271+_0xf8c2ed+'Id']=_0x5c04c9['Account']['id'];_0x3f3434['To'+_0x479271+_0x7995('0x6d')]=_0x2b8217['id'];return db[_0x479271+_0x7995('0x6e')]['create'](_0x3f3434);})['then'](function(){return respondWithRpcPromise(_0x7995('0x6f'),{'channel':_0xc93dcb,'interaction':_0x5c04c9[_0x7995('0x69')],'message':_0x5c04c9,'account':_0x5c04c9[_0x7995('0x65')],'applications':[{'id':0x0,'priority':0x1,'app':_0x7995('0x70'),'appdata':_0x2b8217[_0x7995('0x12')]+','+(_0x5c04c9['Account']['queueTransferTimeout']||0x12c),'interval':_0x7995('0x71')}]},routingClient);})['then'](respondWithResult(_0x1c8e7d,null))['catch'](handleError(_0x1c8e7d,null));};};exports[_0x7995('0x72')]=function(_0x3b731e,_0x3192b8){var _0x5eb360,_0x3b1309;if(_[_0x7995('0x14')](_0x3b731e[_0x7995('0x20')][_0x7995('0x73')])){throw new Error(_0x7995('0x74'));}var _0x5799d1=_0x3b731e[_0x7995('0x20')][_0x7995('0x73')];var _0x1a2d6a=_[_0x7995('0x62')](_0x5799d1);var _0x50bf9a=_0x5799d1===_0x7995('0x63')?_0x7995('0x64'):'Account';return db[_0x7995('0x75')][_0x7995('0x66')]({'raw':!![],'where':{'id':_0x3b731e['params']['id'],'role':_0x7995('0x76')}})['then'](function(_0x1b4b34){if(_['isNil'](_0x1b4b34)){throw new Error(_0x7995('0x77'));}_0x5eb360=_0x1b4b34;return db[_0x1a2d6a+'Message'][_0x7995('0x66')]({'where':{'id':_0x3b731e[_0x7995('0x20')]['messageId']},'include':[{'model':db[_0x1a2d6a+_0x7995('0x69')],'as':'Interaction'},{'model':db[_0x1a2d6a+_0x50bf9a],'as':'Account'}]});})[_0x7995('0xa')](function(_0x14812d){if(_[_0x7995('0x14')](_0x14812d)){throw new Error(_0x1a2d6a+_0x7995('0x6a'));}_0x3b1309=_0x14812d;return _0x14812d['update']({'read':0x0,'readAt':null,'UserId':null});})[_0x7995('0xa')](function(){var _0x35044a={'uniqueid':_0x5799d1+'.'+_0x3b1309['id']+'.'+_0x3b1309['Interaction']['id'],'FromUserId':_0x3b731e['user']['id'],'type':_0x7995('0x70'),'ToUserId':_0x5eb360['id']};_0x35044a[_0x1a2d6a+'MessageId']=_0x3b1309['id'];_0x35044a[_0x1a2d6a+_0x7995('0x6c')]=_0x3b1309[_0x7995('0x69')]['id'];_0x35044a[_0x7995('0x78')+_0x1a2d6a+_0x50bf9a+'Id']=_0x3b1309['Account']['id'];return db[_0x1a2d6a+'TransferReport'][_0x7995('0x79')](_0x35044a);})['then'](function(){return respondWithRpcPromise(_0x7995('0x6f'),{'channel':_0x5799d1,'interaction':_0x3b1309[_0x7995('0x69')],'message':_0x3b1309,'account':_0x3b1309[_0x7995('0x65')],'applications':[{'id':0x0,'priority':0x1,'app':_0x7995('0x76'),'appdata':_0x5eb360['name']+','+(_0x3b1309['Account']['agentTransferTimeout']||0x12c),'interval':_0x7995('0x71')}]},routingClient);})[_0x7995('0xa')](respondWithResult(_0x3192b8,null))[_0x7995('0xe')](handleError(_0x3192b8,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index f12448d..889d22d 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 _0x460b=['index','/:id','show','get','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated'];(function(_0x25ec49,_0x22739c){var _0x9b9e03=function(_0x37cfff){while(--_0x37cfff){_0x25ec49['push'](_0x25ec49['shift']());}};_0x9b9e03(++_0x22739c);}(_0x460b,0x187));var _0xb460=function(_0x4be79b,_0x21e987){_0x4be79b=_0x4be79b-0x0;var _0x14d71e=_0x460b[_0x4be79b];return _0x14d71e;};'use strict';var multer=require(_0xb460('0x0'));var util=require(_0xb460('0x1'));var path=require(_0xb460('0x2'));var timeout=require(_0xb460('0x3'));var express=require(_0xb460('0x4'));var router=express['Router']();var fs_extra=require(_0xb460('0x5'));var auth=require(_0xb460('0x6'));var interaction=require(_0xb460('0x7'));var config=require('../../config/environment');var controller=require('./schedule.controller');router['get']('/',auth[_0xb460('0x8')](),controller[_0xb460('0x9')]);router['get'](_0xb460('0xa'),auth[_0xb460('0x8')](),controller[_0xb460('0xb')]);router[_0xb460('0xc')]('/:id/run',auth[_0xb460('0x8')](),controller['run']);router[_0xb460('0xd')]('/',auth[_0xb460('0x8')](),controller[_0xb460('0xe')]);router[_0xb460('0xf')](_0xb460('0xa'),auth['isAuthenticated'](),controller[_0xb460('0x10')]);router[_0xb460('0x11')](_0xb460('0xa'),auth[_0xb460('0x8')](),controller[_0xb460('0x12')]);module[_0xb460('0x13')]=router; \ No newline at end of file +var _0xe8ce=['destroy','exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./schedule.controller','get','isAuthenticated','index','/:id','show','/:id/run','run','post','create','put','update'];(function(_0x301bee,_0x91a563){var _0x3fbdbc=function(_0x4a7222){while(--_0x4a7222){_0x301bee['push'](_0x301bee['shift']());}};_0x3fbdbc(++_0x91a563);}(_0xe8ce,0x128));var _0xee8c=function(_0x306d2e,_0x556dff){_0x306d2e=_0x306d2e-0x0;var _0x1d31a7=_0xe8ce[_0x306d2e];return _0x1d31a7;};'use strict';var multer=require('multer');var util=require(_0xee8c('0x0'));var path=require(_0xee8c('0x1'));var timeout=require('connect-timeout');var express=require(_0xee8c('0x2'));var router=express[_0xee8c('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xee8c('0x4'));var interaction=require(_0xee8c('0x5'));var config=require(_0xee8c('0x6'));var controller=require(_0xee8c('0x7'));router[_0xee8c('0x8')]('/',auth[_0xee8c('0x9')](),controller[_0xee8c('0xa')]);router['get'](_0xee8c('0xb'),auth[_0xee8c('0x9')](),controller[_0xee8c('0xc')]);router[_0xee8c('0x8')](_0xee8c('0xd'),auth[_0xee8c('0x9')](),controller[_0xee8c('0xe')]);router[_0xee8c('0xf')]('/',auth[_0xee8c('0x9')](),controller[_0xee8c('0x10')]);router[_0xee8c('0x11')]('/:id',auth[_0xee8c('0x9')](),controller[_0xee8c('0x12')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xee8c('0x13')]);module[_0xee8c('0x14')]=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index 55e1e57..4da2e97 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 _0x84c7=['csv','pdf','custom','default','TEXT','sequelize','exports','BOOLEAN','STRING','0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM','years','quarters','months','weeks','days','hours','minutes'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x84c7,0x69));var _0x784c=function(_0x33997d,_0x3dc314){_0x33997d=_0x33997d-0x0;var _0x4de84d=_0x84c7[_0x33997d];return _0x4de84d;};'use strict';var Sequelize=require(_0x784c('0x0'));module[_0x784c('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x784c('0x2')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x784c('0x3')],'allowNull':![],'defaultValue':_0x784c('0x4')},'startAt':{'type':Sequelize[_0x784c('0x5')],'allowNull':![]},'endAt':{'type':Sequelize[_0x784c('0x5')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x784c('0x6')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x784c('0x7')](_0x784c('0x8'),_0x784c('0x9'),_0x784c('0xa'),_0x784c('0xb'),_0x784c('0xc'),_0x784c('0xd'),_0x784c('0xe')),'allowNull':![],'defaultValue':_0x784c('0xc')},'output':{'type':Sequelize[_0x784c('0x7')](_0x784c('0xf'),_0x784c('0x10'),'xlsx'),'allowNull':![],'defaultValue':_0x784c('0xf')},'type':{'type':Sequelize[_0x784c('0x7')](_0x784c('0x11'),_0x784c('0x12')),'allowNull':![],'defaultValue':_0x784c('0x11')},'sendMail':{'type':Sequelize[_0x784c('0x2')],'defaultValue':![]},'email':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x784c('0x13')]},'bcc':{'type':Sequelize[_0x784c('0x13')]},'sendIfEmpty':{'type':Sequelize[_0x784c('0x2')],'defaultValue':!![]}}; \ No newline at end of file +var _0x835f=['pdf','custom','default','TEXT','sequelize','exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM','years','quarters','months','weeks','days','hours','minutes','csv'];(function(_0x1e6d9a,_0x548cf2){var _0x59b4da=function(_0x24a41d){while(--_0x24a41d){_0x1e6d9a['push'](_0x1e6d9a['shift']());}};_0x59b4da(++_0x548cf2);}(_0x835f,0x130));var _0xf835=function(_0x335271,_0x5025f2){_0x335271=_0x335271-0x0;var _0xa9fff8=_0x835f[_0x335271];return _0xa9fff8;};'use strict';var Sequelize=require(_0xf835('0x0'));module[_0xf835('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xf835('0x2')]},'active':{'type':Sequelize[_0xf835('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0xf835('0x2')],'allowNull':![],'defaultValue':_0xf835('0x4')},'startAt':{'type':Sequelize[_0xf835('0x5')],'allowNull':![]},'endAt':{'type':Sequelize['DATE'],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0xf835('0x6')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0xf835('0x7')](_0xf835('0x8'),_0xf835('0x9'),_0xf835('0xa'),_0xf835('0xb'),_0xf835('0xc'),_0xf835('0xd'),_0xf835('0xe')),'allowNull':![],'defaultValue':_0xf835('0xc')},'output':{'type':Sequelize[_0xf835('0x7')](_0xf835('0xf'),_0xf835('0x10'),'xlsx'),'allowNull':![],'defaultValue':_0xf835('0xf')},'type':{'type':Sequelize[_0xf835('0x7')](_0xf835('0x11'),_0xf835('0x12')),'allowNull':![],'defaultValue':_0xf835('0x11')},'sendMail':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'email':{'type':Sequelize[_0xf835('0x2')]},'cc':{'type':Sequelize[_0xf835('0x13')]},'bcc':{'type':Sequelize[_0xf835('0x13')]},'sendIfEmpty':{'type':Sequelize[_0xf835('0x3')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index 266b133..db529d3 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 _0x24a3=['autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','run','../../config/schedule','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','count','set','apply','update','then','destroy','get','Scheduler','end','error','stack','name','index','map','rawAttributes','fieldName','type','key','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','includeAll','include','Schedule','findAll','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId'];(function(_0x3feceb,_0x2c9359){var _0x24dc29=function(_0x4e47e8){while(--_0x4e47e8){_0x3feceb['push'](_0x3feceb['shift']());}};_0x24dc29(++_0x2c9359);}(_0x24a3,0x14c));var _0x324a=function(_0x28625c,_0x3e1338){_0x28625c=_0x28625c-0x0;var _0x169996=_0x24a3[_0x28625c];return _0x169996;};'use strict';var emlformat=require(_0x324a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x324a('0x1'));var jsonpatch=require(_0x324a('0x2'));var rp=require(_0x324a('0x3'));var moment=require(_0x324a('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x324a('0x5'));var util=require(_0x324a('0x6'));var path=require('path');var sox=require(_0x324a('0x7'));var csv=require(_0x324a('0x8'));var ejs=require(_0x324a('0x9'));var fs=require('fs');var fs_extra=require(_0x324a('0xa'));var _=require(_0x324a('0xb'));var squel=require(_0x324a('0xc'));var crypto=require('crypto');var jsforce=require(_0x324a('0xd'));var deskjs=require(_0x324a('0xe'));var toCsv=require(_0x324a('0x8'));var querystring=require(_0x324a('0xf'));var Papa=require(_0x324a('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x324a('0x11'));var as=require(_0x324a('0x12'));var hardwareService=require(_0x324a('0x13'));var logger=require(_0x324a('0x14'))(_0x324a('0x15'));var utils=require(_0x324a('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x324a('0x17'));var db=require(_0x324a('0x18'))['db'];function respondWithStatusCode(_0x4df02e,_0x28c576){_0x28c576=_0x28c576||0xcc;return function(_0x25654a){if(_0x25654a){return _0x4df02e[_0x324a('0x19')](_0x28c576);}return _0x4df02e['status'](_0x28c576)['end']();};}function respondWithResult(_0x487e01,_0x3ed346){_0x3ed346=_0x3ed346||0xc8;return function(_0x44f8e7){if(_0x44f8e7){return _0x487e01[_0x324a('0x1a')](_0x3ed346)[_0x324a('0x1b')](_0x44f8e7);}};}function respondWithFilteredResult(_0x7e6bf4,_0x2773e5){return function(_0x4a5dad){if(_0x4a5dad){var _0x3de66f=typeof _0x2773e5[_0x324a('0x1c')]==='undefined'&&typeof _0x2773e5[_0x324a('0x1d')]==='undefined';var _0x246b0b=_0x4a5dad[_0x324a('0x1e')];var _0x4ecc19=_0x3de66f?0x0:_0x2773e5[_0x324a('0x1c')];var _0x59da02=_0x3de66f?_0x4a5dad[_0x324a('0x1e')]:_0x2773e5[_0x324a('0x1c')]+_0x2773e5[_0x324a('0x1d')];var _0x38592f;if(_0x59da02>=_0x246b0b){_0x59da02=_0x246b0b;_0x38592f=0xc8;}else{_0x38592f=0xce;}_0x7e6bf4[_0x324a('0x1a')](_0x38592f);return _0x7e6bf4[_0x324a('0x1f')]('Content-Range',_0x4ecc19+'-'+_0x59da02+'/'+_0x246b0b)['json'](_0x4a5dad);}return null;};}function patchUpdates(_0x284a43){return function(_0x1c1120){try{jsonpatch[_0x324a('0x20')](_0x1c1120,_0x284a43,!![]);}catch(_0x5eae17){return BPromise['reject'](_0x5eae17);}return _0x1c1120['save']();};}function saveUpdates(_0x347248,_0x22e76){return function(_0x7d3213){if(_0x7d3213){return _0x7d3213[_0x324a('0x21')](_0x347248)[_0x324a('0x22')](function(_0x45d00b){return _0x45d00b;});}return null;};}function removeEntity(_0x48becb,_0x35117d){return function(_0x3a6345){if(_0x3a6345){return _0x3a6345[_0x324a('0x23')]()[_0x324a('0x22')](function(){var _0x446396=_0x3a6345[_0x324a('0x24')]({'plain':!![]});var _0x1a0142=_0x324a('0x25');return db['UserProfileResource']['destroy']({'where':{'type':_0x1a0142,'resourceId':_0x446396['id']}})['then'](function(){return _0x3a6345;});})[_0x324a('0x22')](function(){_0x48becb[_0x324a('0x1a')](0xcc)[_0x324a('0x26')]();});}};}function handleEntityNotFound(_0x4d8e44,_0x2084df){return function(_0x302dc4){if(!_0x302dc4){_0x4d8e44[_0x324a('0x19')](0x194);}return _0x302dc4;};}function handleError(_0x4c9abc,_0xec6f34){_0xec6f34=_0xec6f34||0x1f4;return function(_0xfe1cb6){logger[_0x324a('0x27')](_0xfe1cb6[_0x324a('0x28')]);if(_0xfe1cb6[_0x324a('0x29')]){delete _0xfe1cb6['name'];}_0x4c9abc[_0x324a('0x1a')](_0xec6f34)['send'](_0xfe1cb6);};}exports[_0x324a('0x2a')]=function(_0x299bb7,_0xf4f18b){var _0x9f5180={},_0x14b4d4={},_0x1983ef={'count':0x0,'rows':[]};var _0x29911c=_[_0x324a('0x2b')](db['Schedule'][_0x324a('0x2c')],function(_0x41f51d){return{'name':_0x41f51d[_0x324a('0x2d')],'type':_0x41f51d[_0x324a('0x2e')][_0x324a('0x2f')]};});_0x14b4d4[_0x324a('0x30')]=_[_0x324a('0x2b')](_0x29911c,'name');_0x14b4d4['query']=_[_0x324a('0x31')](_0x299bb7[_0x324a('0x32')]);_0x14b4d4['filters']=_[_0x324a('0x33')](_0x14b4d4[_0x324a('0x30')],_0x14b4d4[_0x324a('0x32')]);_0x9f5180['attributes']=_[_0x324a('0x33')](_0x14b4d4[_0x324a('0x30')],qs[_0x324a('0x34')](_0x299bb7[_0x324a('0x32')][_0x324a('0x34')]));_0x9f5180[_0x324a('0x35')]=_0x9f5180[_0x324a('0x35')][_0x324a('0x36')]?_0x9f5180['attributes']:_0x14b4d4[_0x324a('0x30')];if(!_0x299bb7[_0x324a('0x32')][_0x324a('0x37')](_0x324a('0x38'))){_0x9f5180[_0x324a('0x1d')]=qs[_0x324a('0x1d')](_0x299bb7[_0x324a('0x32')][_0x324a('0x1d')]);_0x9f5180[_0x324a('0x1c')]=qs[_0x324a('0x1c')](_0x299bb7[_0x324a('0x32')]['offset']);}_0x9f5180['order']=qs[_0x324a('0x39')](_0x299bb7['query'][_0x324a('0x39')]);_0x9f5180[_0x324a('0x3a')]=qs[_0x324a('0x3b')](_[_0x324a('0x3c')](_0x299bb7[_0x324a('0x32')],_0x14b4d4[_0x324a('0x3b')]),_0x29911c);if(_0x299bb7[_0x324a('0x32')][_0x324a('0x3d')]){_0x9f5180['where']=_[_0x324a('0x3e')](_0x9f5180['where'],{'$or':_[_0x324a('0x2b')](_0x29911c,function(_0x402c7a){if(_0x402c7a[_0x324a('0x2e')]!=='VIRTUAL'){var _0x981f34={};_0x981f34[_0x402c7a[_0x324a('0x29')]]={'$like':'%'+_0x299bb7['query'][_0x324a('0x3d')]+'%'};return _0x981f34;}})});}_0x9f5180=_[_0x324a('0x3e')]({},_0x9f5180,_0x299bb7['options']);var _0x22ec8b={'where':_0x9f5180[_0x324a('0x3a')]};return db['Schedule'][_0x324a('0x1e')](_0x22ec8b)[_0x324a('0x22')](function(_0x8a0d7a){_0x1983ef['count']=_0x8a0d7a;if(_0x299bb7[_0x324a('0x32')][_0x324a('0x3f')]){_0x9f5180[_0x324a('0x40')]=[{'all':!![]}];}return db[_0x324a('0x41')][_0x324a('0x42')](_0x9f5180);})[_0x324a('0x22')](function(_0x4147a3){_0x1983ef['rows']=_0x4147a3;return _0x1983ef;})['then'](respondWithFilteredResult(_0xf4f18b,_0x9f5180))[_0x324a('0x43')](handleError(_0xf4f18b,null));};exports[_0x324a('0x44')]=function(_0x5adb23,_0x5eac48){var _0x5d7274={'raw':![],'where':{'id':_0x5adb23[_0x324a('0x45')]['id']}},_0x44d65b={};_0x44d65b[_0x324a('0x30')]=_[_0x324a('0x31')](db[_0x324a('0x41')]['rawAttributes']);_0x44d65b['query']=_[_0x324a('0x31')](_0x5adb23[_0x324a('0x32')]);_0x44d65b[_0x324a('0x3b')]=_[_0x324a('0x33')](_0x44d65b['model'],_0x44d65b[_0x324a('0x32')]);_0x5d7274[_0x324a('0x35')]=_[_0x324a('0x33')](_0x44d65b['model'],qs[_0x324a('0x34')](_0x5adb23[_0x324a('0x32')][_0x324a('0x34')]));_0x5d7274[_0x324a('0x35')]=_0x5d7274[_0x324a('0x35')]['length']?_0x5d7274['attributes']:_0x44d65b['model'];if(_0x5adb23[_0x324a('0x32')]['includeAll']){_0x5d7274[_0x324a('0x40')]=[{'all':!![]}];}_0x5d7274=_['merge']({},_0x5d7274,_0x5adb23['options']);return db[_0x324a('0x41')][_0x324a('0x46')](_0x5d7274)[_0x324a('0x22')](handleEntityNotFound(_0x5eac48,null))[_0x324a('0x22')](respondWithResult(_0x5eac48,null))[_0x324a('0x43')](handleError(_0x5eac48,null));};exports[_0x324a('0x47')]=function(_0x6ce950,_0x365218){return db[_0x324a('0x41')][_0x324a('0x47')](_0x6ce950[_0x324a('0x48')],{})[_0x324a('0x22')](function(_0x1848ea){var _0x3528b9=_0x6ce950[_0x324a('0x49')]['get']({'plain':!![]});if(!_0x3528b9)throw new Error(_0x324a('0x4a'));if(_0x3528b9[_0x324a('0x4b')]==='user'){var _0x925ffc=_0x1848ea[_0x324a('0x24')]({'plain':!![]});var _0x213f99='Scheduler';return db[_0x324a('0x4c')][_0x324a('0x46')]({'where':{'name':_0x213f99,'userProfileId':_0x3528b9[_0x324a('0x4d')]},'raw':!![]})['then'](function(_0x4e2167){if(_0x4e2167&&_0x4e2167[_0x324a('0x4e')]===0x0){return db['UserProfileResource'][_0x324a('0x47')]({'name':_0x925ffc['name'],'resourceId':_0x925ffc['id'],'type':_0x4e2167[_0x324a('0x29')],'sectionId':_0x4e2167['id']},{})['then'](function(){return _0x1848ea;});}else{return _0x1848ea;}})['catch'](function(_0x3f9b75){logger['error'](_0x324a('0x4f'),_0x3f9b75);throw _0x3f9b75;});}return _0x1848ea;})[_0x324a('0x22')](respondWithResult(_0x365218,0xc9))[_0x324a('0x43')](handleError(_0x365218,null));};exports[_0x324a('0x21')]=function(_0x29a575,_0x60aaa5){if(_0x29a575[_0x324a('0x48')]['id']){delete _0x29a575[_0x324a('0x48')]['id'];}return db[_0x324a('0x41')][_0x324a('0x46')]({'where':{'id':_0x29a575[_0x324a('0x45')]['id']}})[_0x324a('0x22')](handleEntityNotFound(_0x60aaa5,null))[_0x324a('0x22')](saveUpdates(_0x29a575[_0x324a('0x48')],null))[_0x324a('0x22')](respondWithResult(_0x60aaa5,null))[_0x324a('0x43')](handleError(_0x60aaa5,null));};exports[_0x324a('0x23')]=function(_0x3de18f,_0x5f2770){return db['Schedule'][_0x324a('0x46')]({'where':{'id':_0x3de18f['params']['id']}})[_0x324a('0x22')](handleEntityNotFound(_0x5f2770,null))[_0x324a('0x22')](removeEntity(_0x5f2770,null))[_0x324a('0x43')](handleError(_0x5f2770,null));};exports[_0x324a('0x50')]=function(_0x593831,_0x35550a,_0xc409ef){var _0xf28663=require(_0x324a('0x51'));return db['Schedule'][_0x324a('0x46')]({'where':{'id':_0x593831[_0x324a('0x45')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x35550a,null))[_0x324a('0x22')](function(){_0xf28663['run'](_0x593831[_0x324a('0x45')]['id']);})[_0x324a('0x22')](respondWithStatusCode(_0x35550a,null))[_0x324a('0x43')](handleError(_0x35550a,null));}; \ No newline at end of file +var _0x33f2=['../../config/schedule','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','ejs','fs-extra','squel','crypto','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','../../mysqldb','sendStatus','status','json','offset','limit','count','set','apply','save','update','then','get','Scheduler','UserProfileResource','destroy','end','name','send','index','map','Schedule','rawAttributes','type','key','query','keys','filters','intersection','attributes','model','fields','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','includeAll','catch','show','params','length','include','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','run'];(function(_0x53ee29,_0x5ea32c){var _0x554f43=function(_0x26f921){while(--_0x26f921){_0x53ee29['push'](_0x53ee29['shift']());}};_0x554f43(++_0x5ea32c);}(_0x33f2,0xa9));var _0x233f=function(_0x220f3f,_0x11c540){_0x220f3f=_0x220f3f-0x0;var _0x1f170e=_0x33f2[_0x220f3f];return _0x1f170e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x233f('0x0'));var zipdir=require(_0x233f('0x1'));var jsonpatch=require(_0x233f('0x2'));var rp=require(_0x233f('0x3'));var moment=require(_0x233f('0x4'));var BPromise=require(_0x233f('0x5'));var Mustache=require(_0x233f('0x6'));var util=require(_0x233f('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x233f('0x8'));var fs=require('fs');var fs_extra=require(_0x233f('0x9'));var _=require('lodash');var squel=require(_0x233f('0xa'));var crypto=require(_0x233f('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x233f('0xc'));var toCsv=require(_0x233f('0xd'));var querystring=require(_0x233f('0xe'));var Papa=require(_0x233f('0xf'));var Redis=require(_0x233f('0x10'));var authService=require(_0x233f('0x11'));var qs=require(_0x233f('0x12'));var as=require(_0x233f('0x13'));var hardwareService=require(_0x233f('0x14'));var logger=require(_0x233f('0x15'))('api');var utils=require(_0x233f('0x16'));var config=require(_0x233f('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x233f('0x18'))['db'];function respondWithStatusCode(_0x5f359f,_0x5f536d){_0x5f536d=_0x5f536d||0xcc;return function(_0x2d261f){if(_0x2d261f){return _0x5f359f[_0x233f('0x19')](_0x5f536d);}return _0x5f359f[_0x233f('0x1a')](_0x5f536d)['end']();};}function respondWithResult(_0x592fdc,_0x28c4a4){_0x28c4a4=_0x28c4a4||0xc8;return function(_0x4b6a67){if(_0x4b6a67){return _0x592fdc[_0x233f('0x1a')](_0x28c4a4)[_0x233f('0x1b')](_0x4b6a67);}};}function respondWithFilteredResult(_0x5260a5,_0x4e5032){return function(_0x30ffab){if(_0x30ffab){var _0x2c7779=typeof _0x4e5032[_0x233f('0x1c')]==='undefined'&&typeof _0x4e5032[_0x233f('0x1d')]==='undefined';var _0xaa6746=_0x30ffab[_0x233f('0x1e')];var _0x432df3=_0x2c7779?0x0:_0x4e5032[_0x233f('0x1c')];var _0x46be42=_0x2c7779?_0x30ffab['count']:_0x4e5032['offset']+_0x4e5032[_0x233f('0x1d')];var _0x46f8cc;if(_0x46be42>=_0xaa6746){_0x46be42=_0xaa6746;_0x46f8cc=0xc8;}else{_0x46f8cc=0xce;}_0x5260a5[_0x233f('0x1a')](_0x46f8cc);return _0x5260a5[_0x233f('0x1f')]('Content-Range',_0x432df3+'-'+_0x46be42+'/'+_0xaa6746)[_0x233f('0x1b')](_0x30ffab);}return null;};}function patchUpdates(_0x15cf6a){return function(_0x4db166){try{jsonpatch[_0x233f('0x20')](_0x4db166,_0x15cf6a,!![]);}catch(_0x2d027b){return BPromise['reject'](_0x2d027b);}return _0x4db166[_0x233f('0x21')]();};}function saveUpdates(_0x2fe4c6,_0x1bdce0){return function(_0x48021b){if(_0x48021b){return _0x48021b[_0x233f('0x22')](_0x2fe4c6)[_0x233f('0x23')](function(_0x2c7e67){return _0x2c7e67;});}return null;};}function removeEntity(_0x1c917d,_0x539d86){return function(_0xda1b68){if(_0xda1b68){return _0xda1b68['destroy']()['then'](function(){var _0x46851c=_0xda1b68[_0x233f('0x24')]({'plain':!![]});var _0x1e42b6=_0x233f('0x25');return db[_0x233f('0x26')][_0x233f('0x27')]({'where':{'type':_0x1e42b6,'resourceId':_0x46851c['id']}})[_0x233f('0x23')](function(){return _0xda1b68;});})[_0x233f('0x23')](function(){_0x1c917d[_0x233f('0x1a')](0xcc)[_0x233f('0x28')]();});}};}function handleEntityNotFound(_0x26d6a8,_0xb1900c){return function(_0x2b7a33){if(!_0x2b7a33){_0x26d6a8['sendStatus'](0x194);}return _0x2b7a33;};}function handleError(_0x50dd48,_0x40db67){_0x40db67=_0x40db67||0x1f4;return function(_0x294e1c){logger['error'](_0x294e1c['stack']);if(_0x294e1c[_0x233f('0x29')]){delete _0x294e1c['name'];}_0x50dd48['status'](_0x40db67)[_0x233f('0x2a')](_0x294e1c);};}exports[_0x233f('0x2b')]=function(_0x3ade8f,_0x34ff3f){var _0x1cc108={},_0x5ddb12={},_0x446467={'count':0x0,'rows':[]};var _0x5bed99=_[_0x233f('0x2c')](db[_0x233f('0x2d')][_0x233f('0x2e')],function(_0x4094be){return{'name':_0x4094be['fieldName'],'type':_0x4094be[_0x233f('0x2f')][_0x233f('0x30')]};});_0x5ddb12['model']=_[_0x233f('0x2c')](_0x5bed99,_0x233f('0x29'));_0x5ddb12[_0x233f('0x31')]=_[_0x233f('0x32')](_0x3ade8f['query']);_0x5ddb12[_0x233f('0x33')]=_[_0x233f('0x34')](_0x5ddb12['model'],_0x5ddb12['query']);_0x1cc108[_0x233f('0x35')]=_['intersection'](_0x5ddb12[_0x233f('0x36')],qs[_0x233f('0x37')](_0x3ade8f[_0x233f('0x31')][_0x233f('0x37')]));_0x1cc108[_0x233f('0x35')]=_0x1cc108[_0x233f('0x35')]['length']?_0x1cc108[_0x233f('0x35')]:_0x5ddb12[_0x233f('0x36')];if(!_0x3ade8f[_0x233f('0x31')][_0x233f('0x38')](_0x233f('0x39'))){_0x1cc108[_0x233f('0x1d')]=qs[_0x233f('0x1d')](_0x3ade8f[_0x233f('0x31')][_0x233f('0x1d')]);_0x1cc108['offset']=qs['offset'](_0x3ade8f['query']['offset']);}_0x1cc108[_0x233f('0x3a')]=qs['sort'](_0x3ade8f[_0x233f('0x31')][_0x233f('0x3b')]);_0x1cc108['where']=qs['filters'](_[_0x233f('0x3c')](_0x3ade8f[_0x233f('0x31')],_0x5ddb12[_0x233f('0x33')]),_0x5bed99);if(_0x3ade8f[_0x233f('0x31')][_0x233f('0x3d')]){_0x1cc108['where']=_[_0x233f('0x3e')](_0x1cc108[_0x233f('0x3f')],{'$or':_[_0x233f('0x2c')](_0x5bed99,function(_0x3cedfb){if(_0x3cedfb['type']!==_0x233f('0x40')){var _0x33ef1a={};_0x33ef1a[_0x3cedfb[_0x233f('0x29')]]={'$like':'%'+_0x3ade8f[_0x233f('0x31')][_0x233f('0x3d')]+'%'};return _0x33ef1a;}})});}_0x1cc108=_[_0x233f('0x3e')]({},_0x1cc108,_0x3ade8f['options']);var _0x42cbf2={'where':_0x1cc108[_0x233f('0x3f')]};return db[_0x233f('0x2d')][_0x233f('0x1e')](_0x42cbf2)[_0x233f('0x23')](function(_0x5c0ba4){_0x446467[_0x233f('0x1e')]=_0x5c0ba4;if(_0x3ade8f[_0x233f('0x31')][_0x233f('0x41')]){_0x1cc108['include']=[{'all':!![]}];}return db[_0x233f('0x2d')]['findAll'](_0x1cc108);})[_0x233f('0x23')](function(_0x4336f2){_0x446467['rows']=_0x4336f2;return _0x446467;})[_0x233f('0x23')](respondWithFilteredResult(_0x34ff3f,_0x1cc108))[_0x233f('0x42')](handleError(_0x34ff3f,null));};exports[_0x233f('0x43')]=function(_0x2e9f05,_0x53bf1c){var _0x32751e={'raw':![],'where':{'id':_0x2e9f05[_0x233f('0x44')]['id']}},_0x5a663b={};_0x5a663b[_0x233f('0x36')]=_[_0x233f('0x32')](db[_0x233f('0x2d')]['rawAttributes']);_0x5a663b['query']=_[_0x233f('0x32')](_0x2e9f05[_0x233f('0x31')]);_0x5a663b[_0x233f('0x33')]=_[_0x233f('0x34')](_0x5a663b['model'],_0x5a663b['query']);_0x32751e[_0x233f('0x35')]=_['intersection'](_0x5a663b[_0x233f('0x36')],qs[_0x233f('0x37')](_0x2e9f05[_0x233f('0x31')][_0x233f('0x37')]));_0x32751e[_0x233f('0x35')]=_0x32751e[_0x233f('0x35')][_0x233f('0x45')]?_0x32751e[_0x233f('0x35')]:_0x5a663b[_0x233f('0x36')];if(_0x2e9f05['query']['includeAll']){_0x32751e[_0x233f('0x46')]=[{'all':!![]}];}_0x32751e=_[_0x233f('0x3e')]({},_0x32751e,_0x2e9f05[_0x233f('0x47')]);return db[_0x233f('0x2d')][_0x233f('0x48')](_0x32751e)[_0x233f('0x23')](handleEntityNotFound(_0x53bf1c,null))[_0x233f('0x23')](respondWithResult(_0x53bf1c,null))[_0x233f('0x42')](handleError(_0x53bf1c,null));};exports['create']=function(_0x32f264,_0x2f3121){return db[_0x233f('0x2d')][_0x233f('0x49')](_0x32f264['body'],{})[_0x233f('0x23')](function(_0x35deff){var _0x52dbe9=_0x32f264[_0x233f('0x4a')]['get']({'plain':!![]});if(!_0x52dbe9)throw new Error(_0x233f('0x4b'));if(_0x52dbe9[_0x233f('0x4c')]===_0x233f('0x4a')){var _0x4ff42b=_0x35deff[_0x233f('0x24')]({'plain':!![]});var _0x732179=_0x233f('0x25');return db[_0x233f('0x4d')]['find']({'where':{'name':_0x732179,'userProfileId':_0x52dbe9[_0x233f('0x4e')]},'raw':!![]})[_0x233f('0x23')](function(_0x800dde){if(_0x800dde&&_0x800dde['autoAssociation']===0x0){return db['UserProfileResource'][_0x233f('0x49')]({'name':_0x4ff42b['name'],'resourceId':_0x4ff42b['id'],'type':_0x800dde[_0x233f('0x29')],'sectionId':_0x800dde['id']},{})[_0x233f('0x23')](function(){return _0x35deff;});}else{return _0x35deff;}})[_0x233f('0x42')](function(_0x4415e7){logger[_0x233f('0x4f')](_0x233f('0x50'),_0x4415e7);throw _0x4415e7;});}return _0x35deff;})[_0x233f('0x23')](respondWithResult(_0x2f3121,0xc9))['catch'](handleError(_0x2f3121,null));};exports[_0x233f('0x22')]=function(_0x4adf8f,_0x5a188e){if(_0x4adf8f[_0x233f('0x51')]['id']){delete _0x4adf8f[_0x233f('0x51')]['id'];}return db[_0x233f('0x2d')]['find']({'where':{'id':_0x4adf8f[_0x233f('0x44')]['id']}})[_0x233f('0x23')](handleEntityNotFound(_0x5a188e,null))[_0x233f('0x23')](saveUpdates(_0x4adf8f[_0x233f('0x51')],null))[_0x233f('0x23')](respondWithResult(_0x5a188e,null))[_0x233f('0x42')](handleError(_0x5a188e,null));};exports[_0x233f('0x27')]=function(_0x2a29fe,_0x2af66d){return db['Schedule'][_0x233f('0x48')]({'where':{'id':_0x2a29fe[_0x233f('0x44')]['id']}})[_0x233f('0x23')](handleEntityNotFound(_0x2af66d,null))['then'](removeEntity(_0x2af66d,null))[_0x233f('0x42')](handleError(_0x2af66d,null));};exports[_0x233f('0x52')]=function(_0x3b8540,_0x579e11,_0x2a31a8){var _0x54ad0c=require(_0x233f('0x53'));return db[_0x233f('0x2d')][_0x233f('0x48')]({'where':{'id':_0x3b8540[_0x233f('0x44')]['id']},'raw':!![]})[_0x233f('0x23')](handleEntityNotFound(_0x579e11,null))[_0x233f('0x23')](function(){_0x54ad0c[_0x233f('0x52')](_0x3b8540['params']['id']);})[_0x233f('0x23')](respondWithStatusCode(_0x579e11,null))[_0x233f('0x42')](handleError(_0x579e11,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index f19415e..ca7b391 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 _0x6095=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','exports','define','tools_schedules','lodash'];(function(_0x1b349a,_0x22222c){var _0x5d1f7c=function(_0x368d7c){while(--_0x368d7c){_0x1b349a['push'](_0x1b349a['shift']());}};_0x5d1f7c(++_0x22222c);}(_0x6095,0xdb));var _0x5609=function(_0x82129b,_0x484ae9){_0x82129b=_0x82129b-0x0;var _0x2ae5dc=_0x6095[_0x82129b];return _0x2ae5dc;};'use strict';var _=require(_0x5609('0x0'));var util=require('util');var logger=require(_0x5609('0x1'))(_0x5609('0x2'));var moment=require(_0x5609('0x3'));var BPromise=require('bluebird');var rp=require(_0x5609('0x4'));var fs=require('fs');var path=require(_0x5609('0x5'));var rimraf=require(_0x5609('0x6'));var config=require(_0x5609('0x7'));var attributes=require('./schedule.attributes');module[_0x5609('0x8')]=function(_0x5926e8,_0x150669){return _0x5926e8[_0x5609('0x9')]('Schedule',attributes,{'tableName':_0x5609('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8292=['util','api','moment','bluebird','request-promise','path','rimraf','exports','Schedule','tools_schedules','lodash'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0x8292,0x99));var _0x2829=function(_0x55036a,_0x1e43dc){_0x55036a=_0x55036a-0x0;var _0x2ebe00=_0x8292[_0x55036a];return _0x2ebe00;};'use strict';var _=require(_0x2829('0x0'));var util=require(_0x2829('0x1'));var logger=require('../../config/logger')(_0x2829('0x2'));var moment=require(_0x2829('0x3'));var BPromise=require(_0x2829('0x4'));var rp=require(_0x2829('0x5'));var fs=require('fs');var path=require(_0x2829('0x6'));var rimraf=require(_0x2829('0x7'));var config=require('../../config/environment');var attributes=require('./schedule.attributes');module[_0x2829('0x8')]=function(_0xe6e06e,_0x31c4e7){return _0xe6e06e['define'](_0x2829('0x9'),attributes,{'tableName':_0x2829('0xa'),'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 4011eac..71b5be9 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 _0x720b=['request','then','info','Schedule,\x20%s,\x20%s','request\x20sent','Schedule,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x4dc700,_0x10191b){var _0x484b91=function(_0x45bacb){while(--_0x45bacb){_0x4dc700['push'](_0x4dc700['shift']());}};_0x484b91(++_0x10191b);}(_0x720b,0x9b));var _0xb720=function(_0x8df0a9,_0x181195){_0x8df0a9=_0x8df0a9-0x0;var _0x2fa3cb=_0x720b[_0x8df0a9];return _0x2fa3cb;};'use strict';var _=require(_0xb720('0x0'));var util=require(_0xb720('0x1'));var moment=require(_0xb720('0x2'));var BPromise=require(_0xb720('0x3'));var rs=require(_0xb720('0x4'));var fs=require('fs');var Redis=require(_0xb720('0x5'));var db=require(_0xb720('0x6'))['db'];var utils=require(_0xb720('0x7'));var logger=require(_0xb720('0x8'))(_0xb720('0x9'));var config=require(_0xb720('0xa'));var jayson=require(_0xb720('0xb'));var client=jayson[_0xb720('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x54ba70,_0x29f852,_0x4df52b){return new BPromise(function(_0x2f78e5,_0x33bc4d){return client[_0xb720('0xd')](_0x54ba70,_0x4df52b)[_0xb720('0xe')](function(_0x3bbc90){logger[_0xb720('0xf')](_0xb720('0x10'),_0x29f852,_0xb720('0x11'));logger['debug'](_0xb720('0x12'),_0x29f852,_0xb720('0x11'),JSON[_0xb720('0x13')](_0x3bbc90));if(_0x3bbc90[_0xb720('0x14')]){if(_0x3bbc90[_0xb720('0x14')]['code']===0x1f4){logger[_0xb720('0x14')]('Schedule,\x20%s,\x20%s',_0x29f852,_0x3bbc90[_0xb720('0x14')][_0xb720('0x15')]);return _0x33bc4d(_0x3bbc90[_0xb720('0x14')]['message']);}logger[_0xb720('0x14')]('Schedule,\x20%s,\x20%s',_0x29f852,_0x3bbc90[_0xb720('0x14')][_0xb720('0x15')]);return _0x2f78e5(_0x3bbc90[_0xb720('0x14')][_0xb720('0x15')]);}else{logger[_0xb720('0xf')](_0xb720('0x10'),_0x29f852,_0xb720('0x11'));_0x2f78e5(_0x3bbc90[_0xb720('0x16')]['message']);}})[_0xb720('0x17')](function(_0xfeb5c0){logger[_0xb720('0x14')](_0xb720('0x10'),_0x29f852,_0xfeb5c0);_0x33bc4d(_0xfeb5c0);});});} \ No newline at end of file +var _0x4762=['http','then','info','Schedule,\x20%s,\x20%s','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','code','error','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x1ccbcc,_0x5c948b){var _0x1e873f=function(_0x4f232e){while(--_0x4f232e){_0x1ccbcc['push'](_0x1ccbcc['shift']());}};_0x1e873f(++_0x5c948b);}(_0x4762,0xac));var _0x2476=function(_0x33aaba,_0x391bbb){_0x33aaba=_0x33aaba-0x0;var _0x8004ad=_0x4762[_0x33aaba];return _0x8004ad;};'use strict';var _=require(_0x2476('0x0'));var util=require('util');var moment=require(_0x2476('0x1'));var BPromise=require(_0x2476('0x2'));var rs=require(_0x2476('0x3'));var fs=require('fs');var Redis=require(_0x2476('0x4'));var db=require(_0x2476('0x5'))['db'];var utils=require(_0x2476('0x6'));var logger=require(_0x2476('0x7'))(_0x2476('0x8'));var config=require(_0x2476('0x9'));var jayson=require(_0x2476('0xa'));var client=jayson[_0x2476('0xb')][_0x2476('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2f4f91,_0x1ea0bc,_0x276043){return new BPromise(function(_0x4ae8dc,_0x45d9e4){return client['request'](_0x2f4f91,_0x276043)[_0x2476('0xd')](function(_0x10f104){logger[_0x2476('0xe')](_0x2476('0xf'),_0x1ea0bc,_0x2476('0x10'));logger[_0x2476('0x11')](_0x2476('0x12'),_0x1ea0bc,_0x2476('0x10'),JSON['stringify'](_0x10f104));if(_0x10f104['error']){if(_0x10f104['error'][_0x2476('0x13')]===0x1f4){logger['error'](_0x2476('0xf'),_0x1ea0bc,_0x10f104[_0x2476('0x14')][_0x2476('0x15')]);return _0x45d9e4(_0x10f104[_0x2476('0x14')][_0x2476('0x15')]);}logger[_0x2476('0x14')](_0x2476('0xf'),_0x1ea0bc,_0x10f104[_0x2476('0x14')]['message']);return _0x4ae8dc(_0x10f104[_0x2476('0x14')]['message']);}else{logger['info'](_0x2476('0xf'),_0x1ea0bc,_0x2476('0x10'));_0x4ae8dc(_0x10f104[_0x2476('0x16')][_0x2476('0x15')]);}})['catch'](function(_0x374311){logger[_0x2476('0x14')]('Schedule,\x20%s,\x20%s',_0x1ea0bc,_0x374311);_0x45d9e4(_0x374311);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index 74141d9..5a1ca2d 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 _0x46be=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','./screenRecording.controller','get','index','/describe','isAuthenticated','describe','/:id','show','download','post','create'];(function(_0x32527b,_0x5ea21d){var _0x22b77b=function(_0x106e09){while(--_0x106e09){_0x32527b['push'](_0x32527b['shift']());}};_0x22b77b(++_0x5ea21d);}(_0x46be,0x193));var _0xe46b=function(_0x4a8e14,_0x519668){_0x4a8e14=_0x4a8e14-0x0;var _0x28be98=_0x46be[_0x4a8e14];return _0x28be98;};'use strict';var multer=require(_0xe46b('0x0'));var util=require(_0xe46b('0x1'));var path=require(_0xe46b('0x2'));var timeout=require(_0xe46b('0x3'));var express=require(_0xe46b('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xe46b('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xe46b('0x6'));router[_0xe46b('0x7')]('/',auth['isAuthenticated'](),controller[_0xe46b('0x8')]);router[_0xe46b('0x7')](_0xe46b('0x9'),auth[_0xe46b('0xa')](),controller[_0xe46b('0xb')]);router['get'](_0xe46b('0xc'),auth[_0xe46b('0xa')](),controller[_0xe46b('0xd')]);router[_0xe46b('0x7')]('/:id/download',auth[_0xe46b('0xa')](),controller[_0xe46b('0xe')]);router[_0xe46b('0xf')]('/',auth[_0xe46b('0xa')](),controller[_0xe46b('0x10')]);router['put'](_0xe46b('0xc'),auth[_0xe46b('0xa')](),controller[_0xe46b('0x11')]);router[_0xe46b('0x12')](_0xe46b('0xc'),auth[_0xe46b('0xa')](),controller[_0xe46b('0x13')]);module[_0xe46b('0x14')]=router; \ No newline at end of file +var _0x5d6f=['connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','/:id/download','post','create','update','delete','exports','util','path'];(function(_0x1f0679,_0x53d43c){var _0x3dc3a4=function(_0x49ba8f){while(--_0x49ba8f){_0x1f0679['push'](_0x1f0679['shift']());}};_0x3dc3a4(++_0x53d43c);}(_0x5d6f,0xfa));var _0xf5d6=function(_0x3199af,_0x339560){_0x3199af=_0x3199af-0x0;var _0x5aa4d0=_0x5d6f[_0x3199af];return _0x5aa4d0;};'use strict';var multer=require('multer');var util=require(_0xf5d6('0x0'));var path=require(_0xf5d6('0x1'));var timeout=require(_0xf5d6('0x2'));var express=require(_0xf5d6('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xf5d6('0x4'));var interaction=require(_0xf5d6('0x5'));var config=require(_0xf5d6('0x6'));var controller=require('./screenRecording.controller');router[_0xf5d6('0x7')]('/',auth[_0xf5d6('0x8')](),controller[_0xf5d6('0x9')]);router['get'](_0xf5d6('0xa'),auth[_0xf5d6('0x8')](),controller['describe']);router[_0xf5d6('0x7')](_0xf5d6('0xb'),auth['isAuthenticated'](),controller['show']);router['get'](_0xf5d6('0xc'),auth[_0xf5d6('0x8')](),controller['download']);router[_0xf5d6('0xd')]('/',auth[_0xf5d6('0x8')](),controller[_0xf5d6('0xe')]);router['put'](_0xf5d6('0xb'),auth[_0xf5d6('0x8')](),controller[_0xf5d6('0xf')]);router[_0xf5d6('0x10')]('/:id',auth[_0xf5d6('0x8')](),controller['destroy']);module[_0xf5d6('0x11')]=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index d47183b..5264991 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 _0xc74c=['extname','getDataValue','STRING','replace','setDataValue','INTEGER','startedAt','subtract','closedAt','duration','format','MM-DD-YYYY\x20HH:mm','toString','createdAt','updatedAt','sequelize','moment','exports','VIRTUAL','value'];(function(_0x3cb152,_0x57eb54){var _0x4f54c3=function(_0x273a45){while(--_0x273a45){_0x3cb152['push'](_0x3cb152['shift']());}};_0x4f54c3(++_0x57eb54);}(_0xc74c,0x163));var _0xcc74=function(_0x1a0487,_0x205461){_0x1a0487=_0x1a0487-0x0;var _0xa3b36d=_0xc74c[_0x1a0487];return _0xa3b36d;};'use strict';var Sequelize=require(_0xcc74('0x0'));var moment=require(_0xcc74('0x1'));var path=require('path');var config=require('../../config/environment');module[_0xcc74('0x2')]={'format':{'type':Sequelize[_0xcc74('0x3')],'get':function(){return this['getDataValue'](_0xcc74('0x4'))?path[_0xcc74('0x5')](this[_0xcc74('0x6')](_0xcc74('0x4'))):undefined;}},'interactionid':{'type':Sequelize[_0xcc74('0x7')]},'channel':{'type':Sequelize[_0xcc74('0x7')]},'value':{'type':Sequelize[_0xcc74('0x7')],'set':function(_0x5d46a6){var _0x15248f=_0x5d46a6[_0xcc74('0x8')](/\\/g,'/');this[_0xcc74('0x9')](_0xcc74('0x4'),_0x15248f);}},'rating':{'type':Sequelize[_0xcc74('0xa')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize['INTEGER'],'set':function(_0x4b4534){this[_0xcc74('0x9')](_0xcc74('0xb'),moment()[_0xcc74('0xc')](_0x4b4534,'ms'));this['setDataValue'](_0xcc74('0xd'),moment());this[_0xcc74('0x9')](_0xcc74('0xe'),_0x4b4534);}},'startedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xcc74('0x6')]('startedAt'))[_0xcc74('0xf')]('MM-DD-YYYY\x20HH:mm')['toString']();}},'closedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xcc74('0x6')](_0xcc74('0xd')))[_0xcc74('0xf')](_0xcc74('0x10'))[_0xcc74('0x11')]();}},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xcc74('0x6')](_0xcc74('0x12')))[_0xcc74('0xf')](_0xcc74('0x10'))[_0xcc74('0x11')]();}},'updatedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xcc74('0x6')](_0xcc74('0x13')))[_0xcc74('0xf')](_0xcc74('0x10'))[_0xcc74('0x11')]();}}}; \ No newline at end of file +var _0x4c4a=['toString','DATE','createdAt','updatedAt','sequelize','moment','path','exports','VIRTUAL','getDataValue','value','STRING','setDataValue','INTEGER','startedAt','subtract','closedAt','duration','format','MM-DD-YYYY\x20HH:mm'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4c4a,0x1d0));var _0xa4c4=function(_0x5bad30,_0x5ec213){_0x5bad30=_0x5bad30-0x0;var _0x303abe=_0x4c4a[_0x5bad30];return _0x303abe;};'use strict';var Sequelize=require(_0xa4c4('0x0'));var moment=require(_0xa4c4('0x1'));var path=require(_0xa4c4('0x2'));var config=require('../../config/environment');module[_0xa4c4('0x3')]={'format':{'type':Sequelize[_0xa4c4('0x4')],'get':function(){return this[_0xa4c4('0x5')](_0xa4c4('0x6'))?path['extname'](this[_0xa4c4('0x5')]('value')):undefined;}},'interactionid':{'type':Sequelize[_0xa4c4('0x7')]},'channel':{'type':Sequelize[_0xa4c4('0x7')]},'value':{'type':Sequelize['STRING'],'set':function(_0x557596){var _0x11b498=_0x557596['replace'](/\\/g,'/');this[_0xa4c4('0x8')](_0xa4c4('0x6'),_0x11b498);}},'rating':{'type':Sequelize[_0xa4c4('0x9')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize['INTEGER'],'set':function(_0x5ec64c){this[_0xa4c4('0x8')](_0xa4c4('0xa'),moment()[_0xa4c4('0xb')](_0x5ec64c,'ms'));this[_0xa4c4('0x8')](_0xa4c4('0xc'),moment());this['setDataValue'](_0xa4c4('0xd'),_0x5ec64c);}},'startedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xa4c4('0x5')](_0xa4c4('0xa')))[_0xa4c4('0xe')](_0xa4c4('0xf'))[_0xa4c4('0x10')]();}},'closedAt':{'type':Sequelize[_0xa4c4('0x11')],'get':function(){return moment(this[_0xa4c4('0x5')](_0xa4c4('0xc')))[_0xa4c4('0xe')]('MM-DD-YYYY\x20HH:mm')[_0xa4c4('0x10')]();}},'createdAt':{'type':Sequelize[_0xa4c4('0x11')],'get':function(){return moment(this[_0xa4c4('0x5')](_0xa4c4('0x12')))[_0xa4c4('0xe')](_0xa4c4('0xf'))[_0xa4c4('0x10')]();}},'updatedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xa4c4('0x5')](_0xa4c4('0x13')))['format'](_0xa4c4('0xf'))[_0xa4c4('0x10')]();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index fafe0f5..61beb65 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 _0x8958=['pick','merge','VIRTUAL','filter','options','ScreenRecording','include','findAll','params','rawAttributes','includeAll','create','catch','body','createdAt','closedAt','describe','download','../../components/encryptor','uniqueid','find','value','join','root','server/files/screen_recordings','%s.cypher','decryptFile','secrets','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','unlink','message','Not\x20found','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','File:\x20\x22','destroy','rimraf','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','apply','reject','save','update','then','error','name','send','index','map','fieldName','type','key','model','format','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0x26310a,_0x5f02ea){var _0x172460=function(_0x310de6){while(--_0x310de6){_0x26310a['push'](_0x26310a['shift']());}};_0x172460(++_0x5f02ea);}(_0x8958,0x93));var _0x8895=function(_0x10197a,_0x5b7bb6){_0x10197a=_0x10197a-0x0;var _0x11ad2b=_0x8958[_0x10197a];return _0x11ad2b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8895('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x8895('0x1'));var Mustache=require('mustache');var util=require(_0x8895('0x2'));var path=require(_0x8895('0x3'));var sox=require(_0x8895('0x4'));var csv=require('to-csv');var ejs=require(_0x8895('0x5'));var fs=require('fs');var fs_extra=require(_0x8895('0x6'));var _=require(_0x8895('0x7'));var squel=require(_0x8895('0x8'));var crypto=require(_0x8895('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x8895('0xa'));var toCsv=require(_0x8895('0xb'));var querystring=require(_0x8895('0xc'));var Papa=require(_0x8895('0xd'));var Redis=require(_0x8895('0xe'));var authService=require(_0x8895('0xf'));var qs=require(_0x8895('0x10'));var as=require(_0x8895('0x11'));var hardwareService=require(_0x8895('0x12'));var logger=require(_0x8895('0x13'))('api');var utils=require(_0x8895('0x14'));var config=require(_0x8895('0x15'));var licenseUtil=require(_0x8895('0x16'));var db=require(_0x8895('0x17'))['db'];function respondWithStatusCode(_0x446e1a,_0xaf93bc){_0xaf93bc=_0xaf93bc||0xcc;return function(_0x5af0ef){if(_0x5af0ef){return _0x446e1a[_0x8895('0x18')](_0xaf93bc);}return _0x446e1a[_0x8895('0x19')](_0xaf93bc)[_0x8895('0x1a')]();};}function respondWithResult(_0x57d40a,_0x47b9fe){_0x47b9fe=_0x47b9fe||0xc8;return function(_0x9191b8){if(_0x9191b8){return _0x57d40a['status'](_0x47b9fe)[_0x8895('0x1b')](_0x9191b8);}};}function respondWithFilteredResult(_0x337101,_0x195789){return function(_0x3d7b59){if(_0x3d7b59){var _0x2c9d40=typeof _0x195789['offset']===_0x8895('0x1c')&&typeof _0x195789[_0x8895('0x1d')]===_0x8895('0x1c');var _0xcdd661=_0x3d7b59[_0x8895('0x1e')];var _0x1b5c82=_0x2c9d40?0x0:_0x195789[_0x8895('0x1f')];var _0x26cee0=_0x2c9d40?_0x3d7b59[_0x8895('0x1e')]:_0x195789[_0x8895('0x1f')]+_0x195789[_0x8895('0x1d')];var _0x6b8a16;if(_0x26cee0>=_0xcdd661){_0x26cee0=_0xcdd661;_0x6b8a16=0xc8;}else{_0x6b8a16=0xce;}_0x337101[_0x8895('0x19')](_0x6b8a16);return _0x337101['set']('Content-Range',_0x1b5c82+'-'+_0x26cee0+'/'+_0xcdd661)['json'](_0x3d7b59);}return null;};}function patchUpdates(_0x3daf43){return function(_0x456282){try{jsonpatch[_0x8895('0x20')](_0x456282,_0x3daf43,!![]);}catch(_0x29449a){return BPromise[_0x8895('0x21')](_0x29449a);}return _0x456282[_0x8895('0x22')]();};}function saveUpdates(_0x461346,_0xc1ce17){return function(_0x5219ca){if(_0x5219ca){return _0x5219ca[_0x8895('0x23')](_0x461346)[_0x8895('0x24')](function(_0x2a403){return _0x2a403;});}return null;};}function removeEntity(_0x1f71f3,_0x29223d){return function(_0x4d092d){if(_0x4d092d){return _0x4d092d['destroy']()[_0x8895('0x24')](function(){_0x1f71f3[_0x8895('0x19')](0xcc)[_0x8895('0x1a')]();});}};}function handleEntityNotFound(_0x24a376,_0x4fc150){return function(_0x25da11){if(!_0x25da11){_0x24a376[_0x8895('0x18')](0x194);}return _0x25da11;};}function handleError(_0x187a15,_0x5486a6){_0x5486a6=_0x5486a6||0x1f4;return function(_0x4aee03){logger[_0x8895('0x25')](_0x4aee03['stack']);if(_0x4aee03[_0x8895('0x26')]){delete _0x4aee03[_0x8895('0x26')];}_0x187a15[_0x8895('0x19')](_0x5486a6)[_0x8895('0x27')](_0x4aee03);};}exports[_0x8895('0x28')]=function(_0x5c03ea,_0x4d567a){var _0x6e449d={},_0x37ac3a={},_0x3fc4cc={'count':0x0,'rows':[]};var _0x16b65b=_[_0x8895('0x29')](db['ScreenRecording']['rawAttributes'],function(_0x46ae32){return{'name':_0x46ae32[_0x8895('0x2a')],'type':_0x46ae32[_0x8895('0x2b')][_0x8895('0x2c')]};});_0x37ac3a[_0x8895('0x2d')]=_['differenceBy'](_[_0x8895('0x29')](_0x16b65b,'name'),[_0x8895('0x2e')]);_0x37ac3a['query']=_[_0x8895('0x2f')](_0x5c03ea[_0x8895('0x30')]);_0x37ac3a[_0x8895('0x31')]=_[_0x8895('0x32')](_0x37ac3a[_0x8895('0x2d')],_0x37ac3a['query']);_0x6e449d[_0x8895('0x33')]=_[_0x8895('0x32')](_0x37ac3a[_0x8895('0x2d')],qs[_0x8895('0x34')](_0x5c03ea[_0x8895('0x30')]['fields']));_0x6e449d[_0x8895('0x33')]=_0x6e449d['attributes'][_0x8895('0x35')]?_0x6e449d['attributes']:_0x37ac3a[_0x8895('0x2d')];if(!_0x5c03ea[_0x8895('0x30')][_0x8895('0x36')](_0x8895('0x37'))){_0x6e449d[_0x8895('0x1d')]=qs['limit'](_0x5c03ea[_0x8895('0x30')]['limit']);_0x6e449d[_0x8895('0x1f')]=qs[_0x8895('0x1f')](_0x5c03ea[_0x8895('0x30')][_0x8895('0x1f')]);}_0x6e449d[_0x8895('0x38')]=qs[_0x8895('0x39')](_0x5c03ea['query'][_0x8895('0x39')]);_0x6e449d[_0x8895('0x3a')]=qs['filters'](_[_0x8895('0x3b')](_0x5c03ea['query'],_0x37ac3a[_0x8895('0x31')]),_0x16b65b);if(_0x5c03ea[_0x8895('0x30')]['filter']){_0x6e449d[_0x8895('0x3a')]=_[_0x8895('0x3c')](_0x6e449d['where'],{'$or':_['map'](_0x16b65b,function(_0x202130){if(_0x202130[_0x8895('0x2b')]!==_0x8895('0x3d')){var _0x331a9e={};_0x331a9e[_0x202130[_0x8895('0x26')]]={'$like':'%'+_0x5c03ea['query'][_0x8895('0x3e')]+'%'};return _0x331a9e;}})});}_0x6e449d=_[_0x8895('0x3c')]({},_0x6e449d,_0x5c03ea[_0x8895('0x3f')]);var _0x10005f={'where':_0x6e449d[_0x8895('0x3a')]};return db[_0x8895('0x40')]['count'](_0x10005f)[_0x8895('0x24')](function(_0x5ebfc4){_0x3fc4cc[_0x8895('0x1e')]=_0x5ebfc4;if(_0x5c03ea[_0x8895('0x30')]['includeAll']){_0x6e449d[_0x8895('0x41')]=[{'all':!![]}];}return db['ScreenRecording'][_0x8895('0x42')](_0x6e449d);})['then'](function(_0x4af3b1){_0x3fc4cc['rows']=_0x4af3b1;return _0x3fc4cc;})['then'](respondWithFilteredResult(_0x4d567a,_0x6e449d))['catch'](handleError(_0x4d567a,null));};exports['show']=function(_0x447ed6,_0x206f57){var _0x596531={'raw':![],'where':{'id':_0x447ed6[_0x8895('0x43')]['id']}},_0x4835d7={};_0x4835d7[_0x8895('0x2d')]=_['keys'](db[_0x8895('0x40')][_0x8895('0x44')]);_0x4835d7[_0x8895('0x30')]=_[_0x8895('0x2f')](_0x447ed6[_0x8895('0x30')]);_0x4835d7['filters']=_['intersection'](_0x4835d7['model'],_0x4835d7[_0x8895('0x30')]);_0x596531['attributes']=_[_0x8895('0x32')](_0x4835d7[_0x8895('0x2d')],qs[_0x8895('0x34')](_0x447ed6[_0x8895('0x30')]['fields']));_0x596531[_0x8895('0x33')]=_0x596531[_0x8895('0x33')][_0x8895('0x35')]?_0x596531[_0x8895('0x33')]:_0x4835d7[_0x8895('0x2d')];if(_0x447ed6[_0x8895('0x30')][_0x8895('0x45')]){_0x596531[_0x8895('0x41')]=[{'all':!![]}];}_0x596531=_['merge']({},_0x596531,_0x447ed6[_0x8895('0x3f')]);return db[_0x8895('0x40')]['find'](_0x596531)[_0x8895('0x24')](handleEntityNotFound(_0x206f57,null))['then'](respondWithResult(_0x206f57,null))['catch'](handleError(_0x206f57,null));};exports[_0x8895('0x46')]=function(_0x337a9f,_0x130018){return db['ScreenRecording'][_0x8895('0x46')](_0x337a9f['body'],{})[_0x8895('0x24')](respondWithResult(_0x130018,0xc9))[_0x8895('0x47')](handleError(_0x130018,null));};exports[_0x8895('0x23')]=function(_0x1ca539,_0x2f3bf1){if(_0x1ca539[_0x8895('0x48')]['id']){delete _0x1ca539[_0x8895('0x48')]['id'];}delete _0x1ca539['body']['duration'];delete _0x1ca539[_0x8895('0x48')][_0x8895('0x49')];delete _0x1ca539['body'][_0x8895('0x4a')];delete _0x1ca539['body']['value'];return db[_0x8895('0x40')]['find']({'where':{'id':_0x1ca539[_0x8895('0x43')]['id']}})[_0x8895('0x24')](handleEntityNotFound(_0x2f3bf1,null))[_0x8895('0x24')](saveUpdates(_0x1ca539[_0x8895('0x48')],null))[_0x8895('0x24')](respondWithResult(_0x2f3bf1,null))[_0x8895('0x47')](handleError(_0x2f3bf1,null));};exports[_0x8895('0x4b')]=function(_0x38d6ae,_0x583419){return db[_0x8895('0x40')][_0x8895('0x4b')]()[_0x8895('0x24')](respondWithResult(_0x583419,null))['catch'](handleError(_0x583419,null));};exports[_0x8895('0x4c')]=function(_0x3935fd,_0xd7ffeb,_0x14e769){var _0x1e264a=require(_0x8895('0x4d'));var _0x434ab8=![];var _0x216e6e={};if(_0x3935fd[_0x8895('0x30')][_0x8895('0x2b')]&&_0x3935fd['query'][_0x8895('0x2b')]===_0x8895('0x4e')){_0x216e6e[_0x8895('0x4e')]=_0x3935fd[_0x8895('0x43')]['id'];}else{_0x216e6e['id']=_0x3935fd[_0x8895('0x43')]['id'];}return db['ScreenRecording'][_0x8895('0x4f')]({'where':_0x216e6e,'attributes':['id',_0x8895('0x50')],'raw':!![]})[_0x8895('0x24')](handleEntityNotFound(_0xd7ffeb,null))[_0x8895('0x24')](function(_0x37a7b4){if(_0x37a7b4){var _0x58dd6c=path[_0x8895('0x51')](config[_0x8895('0x52')],_0x8895('0x53'),_0x37a7b4['value']);var _0x20422f=util[_0x8895('0x2e')](_0x8895('0x54'),_0x58dd6c);if(fs['existsSync'](_0x20422f)){_0x434ab8=!![];return _0x1e264a[_0x8895('0x55')](_0x20422f,_0x58dd6c,config[_0x8895('0x56')]['recording'])[_0x8895('0x24')](function(){return _0x37a7b4;});}return _0x37a7b4;}})[_0x8895('0x24')](function(_0x5198f8){if(_0x5198f8){var _0x2f990a=path[_0x8895('0x51')](config[_0x8895('0x52')],_0x8895('0x53'),_0x5198f8['value']);if(!fs['existsSync'](_0x2f990a)){throw new db[(_0x8895('0x57'))][(_0x8895('0x58'))](_0x8895('0x59'));}if(_0x5198f8['filename']){return _0xd7ffeb[_0x8895('0x4c')](_0x2f990a,_0x5198f8[_0x8895('0x5a')]+path['extname'](_0x2f990a),function(){if(_0x434ab8){fs[_0x8895('0x5b')](_0x2f990a);}});}else{return _0xd7ffeb['download'](_0x2f990a,function(_0x435e36){if(_0x434ab8){fs[_0x8895('0x5b')](_0x2f990a);}});}}})[_0x8895('0x47')](function(_0x14f8a4){if(_0x14f8a4[_0x8895('0x5c')]==='ScreenRecording\x20not\x20found'){_0xd7ffeb['status'](0x194)[_0x8895('0x27')](_0x8895('0x5d'));}else{return handleError(_0xd7ffeb,null);}});};exports['destroy']=function(_0x46f8ae,_0x131476){return db[_0x8895('0x40')][_0x8895('0x4f')]({'where':{'id':_0x46f8ae['params']['id']}})[_0x8895('0x24')](function(_0x2d2bf9){if(_[_0x8895('0x5e')](_0x2d2bf9)){throw new ReferenceError(_0x8895('0x5f'));}return _0x2d2bf9;})[_0x8895('0x24')](function(_0x41a2fe){var _0x261d4b=path[_0x8895('0x51')](config[_0x8895('0x52')],_0x8895('0x53'),_0x41a2fe[_0x8895('0x50')]);logger[_0x8895('0x60')](_0x8895('0x61'),_0x261d4b);if(!_[_0x8895('0x5e')](_0x41a2fe[_0x8895('0x50')])&&fs['existsSync'](_0x261d4b)){logger['info']('File:\x20\x22'+_0x261d4b+_0x8895('0x62'));fs[_0x8895('0x63')](_0x261d4b);}_0x261d4b=_0x261d4b+_0x8895('0x64');if(!_[_0x8895('0x5e')](_0x41a2fe[_0x8895('0x50')])&&fs['existsSync'](_0x261d4b)){logger[_0x8895('0x60')](_0x8895('0x65')+_0x261d4b+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x8895('0x63')](_0x261d4b);}return _0x41a2fe;})[_0x8895('0x24')](function(_0xf51f48){if(!_0xf51f48)throw new InternalError();return _0xf51f48[_0x8895('0x66')]();})[_0x8895('0x24')](function(){_0x131476['status'](0xcc)[_0x8895('0x1a')]();})[_0x8895('0x47')](handleError(_0x131476,null));}; \ No newline at end of file +var _0xa630=['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','../../mysqldb','status','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','ScreenRecording','type','key','model','differenceBy','format','query','keys','intersection','fields','attributes','length','order','filters','pick','filter','where','merge','VIRTUAL','include','findAll','rows','catch','show','params','rawAttributes','includeAll','options','find','create','body','createdAt','value','describe','../../components/encryptor','root','server/files/screen_recordings','%s.cypher','existsSync','decryptFile','secrets','recording','join','ScreenRecording\x20not\x20found','filename','extname','download','message','Not\x20found','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','eml-format','rimraf','request-promise','bluebird','util','path','sox','to-csv','ejs','lodash'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0xa630,0xbe));var _0x0a63=function(_0x47e595,_0x3cbd5a){_0x47e595=_0x47e595-0x0;var _0x487fea=_0xa630[_0x47e595];return _0x487fea;};'use strict';var emlformat=require(_0x0a63('0x0'));var rimraf=require(_0x0a63('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a63('0x2'));var moment=require('moment');var BPromise=require(_0x0a63('0x3'));var Mustache=require('mustache');var util=require(_0x0a63('0x4'));var path=require(_0x0a63('0x5'));var sox=require(_0x0a63('0x6'));var csv=require(_0x0a63('0x7'));var ejs=require(_0x0a63('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0a63('0x9'));var squel=require(_0x0a63('0xa'));var crypto=require(_0x0a63('0xb'));var jsforce=require(_0x0a63('0xc'));var deskjs=require(_0x0a63('0xd'));var toCsv=require(_0x0a63('0x7'));var querystring=require('querystring');var Papa=require(_0x0a63('0xe'));var Redis=require(_0x0a63('0xf'));var authService=require(_0x0a63('0x10'));var qs=require(_0x0a63('0x11'));var as=require(_0x0a63('0x12'));var hardwareService=require(_0x0a63('0x13'));var logger=require(_0x0a63('0x14'))(_0x0a63('0x15'));var utils=require(_0x0a63('0x16'));var config=require(_0x0a63('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x0a63('0x18'))['db'];function respondWithStatusCode(_0x420043,_0x2fce86){_0x2fce86=_0x2fce86||0xcc;return function(_0x3d6323){if(_0x3d6323){return _0x420043['sendStatus'](_0x2fce86);}return _0x420043[_0x0a63('0x19')](_0x2fce86)['end']();};}function respondWithResult(_0x331e99,_0x19e922){_0x19e922=_0x19e922||0xc8;return function(_0x26b2bc){if(_0x26b2bc){return _0x331e99[_0x0a63('0x19')](_0x19e922)[_0x0a63('0x1a')](_0x26b2bc);}};}function respondWithFilteredResult(_0x23b49d,_0x552b1f){return function(_0x1e3251){if(_0x1e3251){var _0x524a98=typeof _0x552b1f[_0x0a63('0x1b')]==='undefined'&&typeof _0x552b1f[_0x0a63('0x1c')]===_0x0a63('0x1d');var _0x36a9e8=_0x1e3251[_0x0a63('0x1e')];var _0x1f7481=_0x524a98?0x0:_0x552b1f[_0x0a63('0x1b')];var _0x30f292=_0x524a98?_0x1e3251[_0x0a63('0x1e')]:_0x552b1f[_0x0a63('0x1b')]+_0x552b1f[_0x0a63('0x1c')];var _0x2ad167;if(_0x30f292>=_0x36a9e8){_0x30f292=_0x36a9e8;_0x2ad167=0xc8;}else{_0x2ad167=0xce;}_0x23b49d['status'](_0x2ad167);return _0x23b49d['set'](_0x0a63('0x1f'),_0x1f7481+'-'+_0x30f292+'/'+_0x36a9e8)['json'](_0x1e3251);}return null;};}function patchUpdates(_0x2fc87c){return function(_0x5937df){try{jsonpatch[_0x0a63('0x20')](_0x5937df,_0x2fc87c,!![]);}catch(_0x41d6b8){return BPromise[_0x0a63('0x21')](_0x41d6b8);}return _0x5937df[_0x0a63('0x22')]();};}function saveUpdates(_0x5da46b,_0x398a16){return function(_0x4c225a){if(_0x4c225a){return _0x4c225a[_0x0a63('0x23')](_0x5da46b)[_0x0a63('0x24')](function(_0x1bf64a){return _0x1bf64a;});}return null;};}function removeEntity(_0x20c114,_0x343273){return function(_0x1f929f){if(_0x1f929f){return _0x1f929f[_0x0a63('0x25')]()[_0x0a63('0x24')](function(){_0x20c114['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x55fb70,_0x4c8637){return function(_0xeacfc9){if(!_0xeacfc9){_0x55fb70['sendStatus'](0x194);}return _0xeacfc9;};}function handleError(_0x496c93,_0x2133cf){_0x2133cf=_0x2133cf||0x1f4;return function(_0x1d5448){logger[_0x0a63('0x26')](_0x1d5448[_0x0a63('0x27')]);if(_0x1d5448['name']){delete _0x1d5448[_0x0a63('0x28')];}_0x496c93[_0x0a63('0x19')](_0x2133cf)[_0x0a63('0x29')](_0x1d5448);};}exports['index']=function(_0x34239b,_0xcf409){var _0x1b7bdb={},_0x145090={},_0x32a52b={'count':0x0,'rows':[]};var _0x4577b6=_[_0x0a63('0x2a')](db[_0x0a63('0x2b')]['rawAttributes'],function(_0x58cc71){return{'name':_0x58cc71['fieldName'],'type':_0x58cc71[_0x0a63('0x2c')][_0x0a63('0x2d')]};});_0x145090[_0x0a63('0x2e')]=_[_0x0a63('0x2f')](_[_0x0a63('0x2a')](_0x4577b6,'name'),[_0x0a63('0x30')]);_0x145090[_0x0a63('0x31')]=_[_0x0a63('0x32')](_0x34239b[_0x0a63('0x31')]);_0x145090['filters']=_[_0x0a63('0x33')](_0x145090[_0x0a63('0x2e')],_0x145090['query']);_0x1b7bdb['attributes']=_[_0x0a63('0x33')](_0x145090['model'],qs['fields'](_0x34239b[_0x0a63('0x31')][_0x0a63('0x34')]));_0x1b7bdb['attributes']=_0x1b7bdb[_0x0a63('0x35')][_0x0a63('0x36')]?_0x1b7bdb[_0x0a63('0x35')]:_0x145090[_0x0a63('0x2e')];if(!_0x34239b[_0x0a63('0x31')]['hasOwnProperty']('nolimit')){_0x1b7bdb[_0x0a63('0x1c')]=qs[_0x0a63('0x1c')](_0x34239b[_0x0a63('0x31')][_0x0a63('0x1c')]);_0x1b7bdb[_0x0a63('0x1b')]=qs[_0x0a63('0x1b')](_0x34239b['query'][_0x0a63('0x1b')]);}_0x1b7bdb[_0x0a63('0x37')]=qs['sort'](_0x34239b[_0x0a63('0x31')]['sort']);_0x1b7bdb['where']=qs[_0x0a63('0x38')](_[_0x0a63('0x39')](_0x34239b[_0x0a63('0x31')],_0x145090['filters']),_0x4577b6);if(_0x34239b[_0x0a63('0x31')][_0x0a63('0x3a')]){_0x1b7bdb[_0x0a63('0x3b')]=_[_0x0a63('0x3c')](_0x1b7bdb[_0x0a63('0x3b')],{'$or':_[_0x0a63('0x2a')](_0x4577b6,function(_0x604a45){if(_0x604a45['type']!==_0x0a63('0x3d')){var _0x1c7e67={};_0x1c7e67[_0x604a45[_0x0a63('0x28')]]={'$like':'%'+_0x34239b['query']['filter']+'%'};return _0x1c7e67;}})});}_0x1b7bdb=_[_0x0a63('0x3c')]({},_0x1b7bdb,_0x34239b['options']);var _0x1a01f4={'where':_0x1b7bdb[_0x0a63('0x3b')]};return db[_0x0a63('0x2b')]['count'](_0x1a01f4)[_0x0a63('0x24')](function(_0x14c737){_0x32a52b[_0x0a63('0x1e')]=_0x14c737;if(_0x34239b[_0x0a63('0x31')]['includeAll']){_0x1b7bdb[_0x0a63('0x3e')]=[{'all':!![]}];}return db[_0x0a63('0x2b')][_0x0a63('0x3f')](_0x1b7bdb);})[_0x0a63('0x24')](function(_0xf18ace){_0x32a52b[_0x0a63('0x40')]=_0xf18ace;return _0x32a52b;})['then'](respondWithFilteredResult(_0xcf409,_0x1b7bdb))[_0x0a63('0x41')](handleError(_0xcf409,null));};exports[_0x0a63('0x42')]=function(_0x347a0b,_0x793502){var _0x20fa0d={'raw':![],'where':{'id':_0x347a0b[_0x0a63('0x43')]['id']}},_0x2482ca={};_0x2482ca[_0x0a63('0x2e')]=_[_0x0a63('0x32')](db[_0x0a63('0x2b')][_0x0a63('0x44')]);_0x2482ca[_0x0a63('0x31')]=_[_0x0a63('0x32')](_0x347a0b[_0x0a63('0x31')]);_0x2482ca[_0x0a63('0x38')]=_[_0x0a63('0x33')](_0x2482ca[_0x0a63('0x2e')],_0x2482ca[_0x0a63('0x31')]);_0x20fa0d['attributes']=_[_0x0a63('0x33')](_0x2482ca['model'],qs['fields'](_0x347a0b[_0x0a63('0x31')][_0x0a63('0x34')]));_0x20fa0d[_0x0a63('0x35')]=_0x20fa0d[_0x0a63('0x35')][_0x0a63('0x36')]?_0x20fa0d[_0x0a63('0x35')]:_0x2482ca[_0x0a63('0x2e')];if(_0x347a0b[_0x0a63('0x31')][_0x0a63('0x45')]){_0x20fa0d[_0x0a63('0x3e')]=[{'all':!![]}];}_0x20fa0d=_[_0x0a63('0x3c')]({},_0x20fa0d,_0x347a0b[_0x0a63('0x46')]);return db[_0x0a63('0x2b')][_0x0a63('0x47')](_0x20fa0d)[_0x0a63('0x24')](handleEntityNotFound(_0x793502,null))[_0x0a63('0x24')](respondWithResult(_0x793502,null))[_0x0a63('0x41')](handleError(_0x793502,null));};exports[_0x0a63('0x48')]=function(_0x366887,_0x148e0a){return db['ScreenRecording'][_0x0a63('0x48')](_0x366887[_0x0a63('0x49')],{})['then'](respondWithResult(_0x148e0a,0xc9))['catch'](handleError(_0x148e0a,null));};exports['update']=function(_0x485f20,_0x36d066){if(_0x485f20[_0x0a63('0x49')]['id']){delete _0x485f20['body']['id'];}delete _0x485f20[_0x0a63('0x49')]['duration'];delete _0x485f20[_0x0a63('0x49')][_0x0a63('0x4a')];delete _0x485f20['body']['closedAt'];delete _0x485f20['body'][_0x0a63('0x4b')];return db[_0x0a63('0x2b')][_0x0a63('0x47')]({'where':{'id':_0x485f20[_0x0a63('0x43')]['id']}})[_0x0a63('0x24')](handleEntityNotFound(_0x36d066,null))['then'](saveUpdates(_0x485f20[_0x0a63('0x49')],null))[_0x0a63('0x24')](respondWithResult(_0x36d066,null))[_0x0a63('0x41')](handleError(_0x36d066,null));};exports[_0x0a63('0x4c')]=function(_0x3575ae,_0x4a5b6e){return db[_0x0a63('0x2b')][_0x0a63('0x4c')]()[_0x0a63('0x24')](respondWithResult(_0x4a5b6e,null))[_0x0a63('0x41')](handleError(_0x4a5b6e,null));};exports['download']=function(_0x35b688,_0x3bd10c,_0x337bef){var _0x330550=require(_0x0a63('0x4d'));var _0x258ed3=![];var _0x4d4e20={};if(_0x35b688[_0x0a63('0x31')][_0x0a63('0x2c')]&&_0x35b688[_0x0a63('0x31')][_0x0a63('0x2c')]==='uniqueid'){_0x4d4e20['uniqueid']=_0x35b688[_0x0a63('0x43')]['id'];}else{_0x4d4e20['id']=_0x35b688[_0x0a63('0x43')]['id'];}return db[_0x0a63('0x2b')][_0x0a63('0x47')]({'where':_0x4d4e20,'attributes':['id',_0x0a63('0x4b')],'raw':!![]})['then'](handleEntityNotFound(_0x3bd10c,null))['then'](function(_0x58b3a8){if(_0x58b3a8){var _0x42c1bb=path['join'](config[_0x0a63('0x4e')],_0x0a63('0x4f'),_0x58b3a8[_0x0a63('0x4b')]);var _0x5d77e3=util['format'](_0x0a63('0x50'),_0x42c1bb);if(fs[_0x0a63('0x51')](_0x5d77e3)){_0x258ed3=!![];return _0x330550[_0x0a63('0x52')](_0x5d77e3,_0x42c1bb,config[_0x0a63('0x53')][_0x0a63('0x54')])[_0x0a63('0x24')](function(){return _0x58b3a8;});}return _0x58b3a8;}})[_0x0a63('0x24')](function(_0xc3415c){if(_0xc3415c){var _0xe454ef=path[_0x0a63('0x55')](config[_0x0a63('0x4e')],_0x0a63('0x4f'),_0xc3415c[_0x0a63('0x4b')]);if(!fs[_0x0a63('0x51')](_0xe454ef)){throw new db['Sequelize']['ValidationError'](_0x0a63('0x56'));}if(_0xc3415c[_0x0a63('0x57')]){return _0x3bd10c['download'](_0xe454ef,_0xc3415c[_0x0a63('0x57')]+path[_0x0a63('0x58')](_0xe454ef),function(){if(_0x258ed3){fs['unlink'](_0xe454ef);}});}else{return _0x3bd10c[_0x0a63('0x59')](_0xe454ef,function(_0x3053e4){if(_0x258ed3){fs['unlink'](_0xe454ef);}});}}})['catch'](function(_0x3b395a){if(_0x3b395a[_0x0a63('0x5a')]===_0x0a63('0x56')){_0x3bd10c['status'](0x194)[_0x0a63('0x29')](_0x0a63('0x5b'));}else{return handleError(_0x3bd10c,null);}});};exports[_0x0a63('0x25')]=function(_0x284dca,_0x15fc2e){return db['ScreenRecording'][_0x0a63('0x47')]({'where':{'id':_0x284dca[_0x0a63('0x43')]['id']}})[_0x0a63('0x24')](function(_0x1fa9cd){if(_[_0x0a63('0x5c')](_0x1fa9cd)){throw new ReferenceError(_0x0a63('0x5d'));}return _0x1fa9cd;})[_0x0a63('0x24')](function(_0x57313b){var _0x4571e7=path[_0x0a63('0x55')](config[_0x0a63('0x4e')],_0x0a63('0x4f'),_0x57313b[_0x0a63('0x4b')]);logger[_0x0a63('0x5e')](_0x0a63('0x5f'),_0x4571e7);if(!_[_0x0a63('0x5c')](_0x57313b['value'])&&fs['existsSync'](_0x4571e7)){logger[_0x0a63('0x5e')](_0x0a63('0x60')+_0x4571e7+_0x0a63('0x61'));fs[_0x0a63('0x62')](_0x4571e7);}_0x4571e7=_0x4571e7+_0x0a63('0x63');if(!_['isNil'](_0x57313b[_0x0a63('0x4b')])&&fs[_0x0a63('0x51')](_0x4571e7)){logger[_0x0a63('0x5e')](_0x0a63('0x60')+_0x4571e7+_0x0a63('0x61'));fs[_0x0a63('0x62')](_0x4571e7);}return _0x57313b;})[_0x0a63('0x24')](function(_0xe52dfd){if(!_0xe52dfd)throw new InternalError();return _0xe52dfd[_0x0a63('0x25')]();})[_0x0a63('0x24')](function(){_0x15fc2e[_0x0a63('0x19')](0xcc)['end']();})[_0x0a63('0x41')](handleError(_0x15fc2e,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index dc7e9a3..b945bfa 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 _0x1988=['lodash','util','api','request-promise','path','rimraf','../../config/environment','./screenRecording.attributes','exports','define','ScreenRecording','screen_recordings','interactionid'];(function(_0x66d929,_0x2c9e16){var _0x868705=function(_0x4e153f){while(--_0x4e153f){_0x66d929['push'](_0x66d929['shift']());}};_0x868705(++_0x2c9e16);}(_0x1988,0x15f));var _0x8198=function(_0x19da0d,_0x52e92e){_0x19da0d=_0x19da0d-0x0;var _0x4d1b49=_0x1988[_0x19da0d];return _0x4d1b49;};'use strict';var _=require(_0x8198('0x0'));var util=require(_0x8198('0x1'));var logger=require('../../config/logger')(_0x8198('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x8198('0x3'));var fs=require('fs');var path=require(_0x8198('0x4'));var rimraf=require(_0x8198('0x5'));var config=require(_0x8198('0x6'));var attributes=require(_0x8198('0x7'));module[_0x8198('0x8')]=function(_0xb735e0,_0x29af74){return _0xb735e0[_0x8198('0x9')](_0x8198('0xa'),attributes,{'tableName':_0x8198('0xb'),'paranoid':![],'indexes':[{'name':_0x8198('0xc'),'fields':[_0x8198('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1f9e=['define','ScreenRecording','screen_recordings','interactionid','lodash','util','bluebird','request-promise','path','./screenRecording.attributes','exports'];(function(_0xf99891,_0x2e4291){var _0x35db9b=function(_0x529374){while(--_0x529374){_0xf99891['push'](_0xf99891['shift']());}};_0x35db9b(++_0x2e4291);}(_0x1f9e,0x1d2));var _0xe1f9=function(_0x71e493,_0x4308b7){_0x71e493=_0x71e493-0x0;var _0x3d40ab=_0x1f9e[_0x71e493];return _0x3d40ab;};'use strict';var _=require(_0xe1f9('0x0'));var util=require(_0xe1f9('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xe1f9('0x2'));var rp=require(_0xe1f9('0x3'));var fs=require('fs');var path=require(_0xe1f9('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xe1f9('0x5'));module[_0xe1f9('0x6')]=function(_0x4e35ea,_0x4e98bf){return _0x4e35ea[_0xe1f9('0x7')](_0xe1f9('0x8'),attributes,{'tableName':_0xe1f9('0x9'),'paranoid':![],'indexes':[{'name':_0xe1f9('0xa'),'fields':[_0xe1f9('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index d258cef..f86aded 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 _0xb19e=['request','then','ScreenRecording,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ScreenRecording,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x28973c,_0x31a176){var _0x906cfd=function(_0x477797){while(--_0x477797){_0x28973c['push'](_0x28973c['shift']());}};_0x906cfd(++_0x31a176);}(_0xb19e,0x7d));var _0xeb19=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xb19e[_0x2641f9];return _0x585741;};'use strict';var _=require(_0xeb19('0x0'));var util=require(_0xeb19('0x1'));var moment=require(_0xeb19('0x2'));var BPromise=require(_0xeb19('0x3'));var rs=require(_0xeb19('0x4'));var fs=require('fs');var Redis=require(_0xeb19('0x5'));var db=require(_0xeb19('0x6'))['db'];var utils=require(_0xeb19('0x7'));var logger=require(_0xeb19('0x8'))(_0xeb19('0x9'));var config=require(_0xeb19('0xa'));var jayson=require(_0xeb19('0xb'));var client=jayson[_0xeb19('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x459bb7,_0x209893,_0x4f6dd2){return new BPromise(function(_0x4867fc,_0x5e3aa6){return client[_0xeb19('0xd')](_0x459bb7,_0x4f6dd2)[_0xeb19('0xe')](function(_0x1134b1){logger['info']('ScreenRecording,\x20%s,\x20%s',_0x209893,'request\x20sent');logger['debug'](_0xeb19('0xf'),_0x209893,_0xeb19('0x10'),JSON[_0xeb19('0x11')](_0x1134b1));if(_0x1134b1[_0xeb19('0x12')]){if(_0x1134b1['error'][_0xeb19('0x13')]===0x1f4){logger['error'](_0xeb19('0x14'),_0x209893,_0x1134b1[_0xeb19('0x12')][_0xeb19('0x15')]);return _0x5e3aa6(_0x1134b1[_0xeb19('0x12')][_0xeb19('0x15')]);}logger[_0xeb19('0x12')](_0xeb19('0x14'),_0x209893,_0x1134b1['error'][_0xeb19('0x15')]);return _0x4867fc(_0x1134b1[_0xeb19('0x12')][_0xeb19('0x15')]);}else{logger['info'](_0xeb19('0x14'),_0x209893,_0xeb19('0x10'));_0x4867fc(_0x1134b1['result'][_0xeb19('0x15')]);}})[_0xeb19('0x16')](function(_0x146b57){logger[_0xeb19('0x12')]('ScreenRecording,\x20%s,\x20%s',_0x209893,_0x146b57);_0x5e3aa6(_0x146b57);});});} \ No newline at end of file +var _0xa5a2=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','ScreenRecording,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util'];(function(_0x4afd0d,_0x12f0a3){var _0x2487cb=function(_0x30bfb5){while(--_0x30bfb5){_0x4afd0d['push'](_0x4afd0d['shift']());}};_0x2487cb(++_0x12f0a3);}(_0xa5a2,0xfb));var _0x2a5a=function(_0x24862c,_0x1b82f9){_0x24862c=_0x24862c-0x0;var _0x6d702d=_0xa5a2[_0x24862c];return _0x6d702d;};'use strict';var _=require(_0x2a5a('0x0'));var util=require(_0x2a5a('0x1'));var moment=require(_0x2a5a('0x2'));var BPromise=require(_0x2a5a('0x3'));var rs=require(_0x2a5a('0x4'));var fs=require('fs');var Redis=require(_0x2a5a('0x5'));var db=require(_0x2a5a('0x6'))['db'];var utils=require(_0x2a5a('0x7'));var logger=require(_0x2a5a('0x8'))(_0x2a5a('0x9'));var config=require(_0x2a5a('0xa'));var jayson=require(_0x2a5a('0xb'));var client=jayson[_0x2a5a('0xc')][_0x2a5a('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x14f039,_0x28ccb1,_0x30efce){return new BPromise(function(_0x53a47f,_0x321b4b){return client['request'](_0x14f039,_0x30efce)[_0x2a5a('0xe')](function(_0x533e8a){logger[_0x2a5a('0xf')](_0x2a5a('0x10'),_0x28ccb1,_0x2a5a('0x11'));logger['debug'](_0x2a5a('0x12'),_0x28ccb1,_0x2a5a('0x11'),JSON[_0x2a5a('0x13')](_0x533e8a));if(_0x533e8a[_0x2a5a('0x14')]){if(_0x533e8a[_0x2a5a('0x14')]['code']===0x1f4){logger[_0x2a5a('0x14')](_0x2a5a('0x10'),_0x28ccb1,_0x533e8a['error'][_0x2a5a('0x15')]);return _0x321b4b(_0x533e8a['error'][_0x2a5a('0x15')]);}logger['error'](_0x2a5a('0x10'),_0x28ccb1,_0x533e8a[_0x2a5a('0x14')]['message']);return _0x53a47f(_0x533e8a[_0x2a5a('0x14')][_0x2a5a('0x15')]);}else{logger[_0x2a5a('0xf')](_0x2a5a('0x10'),_0x28ccb1,_0x2a5a('0x11'));_0x53a47f(_0x533e8a['result'][_0x2a5a('0x15')]);}})[_0x2a5a('0x16')](function(_0x410088){logger['error'](_0x2a5a('0x10'),_0x28ccb1,_0x410088);_0x321b4b(_0x410088);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index 6add5e7..6282466 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 _0xc610=['/:id/favicon','diskStorage','server/files/images/logos/','%s%s','extname','post','single','addLogo','format','logologin','originalname','file','join','root','addPreferred','addFavicon','/:id','update','multer','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','get','index','/now','getDate','/:id/logo','getLogo','/:id/logo_login','getLogoLogin','/:id/gdpr','gdpr','/:id/preferred'];(function(_0x1dd0c7,_0x390510){var _0x1a9a81=function(_0x18921f){while(--_0x18921f){_0x1dd0c7['push'](_0x1dd0c7['shift']());}};_0x1a9a81(++_0x390510);}(_0xc610,0x1c2));var _0x0c61=function(_0x25bb9d,_0x4f12cc){_0x25bb9d=_0x25bb9d-0x0;var _0x5e7a45=_0xc610[_0x25bb9d];return _0x5e7a45;};'use strict';var multer=require(_0x0c61('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0c61('0x1')]();var fs_extra=require(_0x0c61('0x2'));var auth=require(_0x0c61('0x3'));var interaction=require(_0x0c61('0x4'));var config=require(_0x0c61('0x5'));var controller=require(_0x0c61('0x6'));router[_0x0c61('0x7')]('/',auth['isAuthenticated'](),controller[_0x0c61('0x8')]);router[_0x0c61('0x7')](_0x0c61('0x9'),controller[_0x0c61('0xa')]);router[_0x0c61('0x7')]('/:id',controller['show']);router[_0x0c61('0x7')](_0x0c61('0xb'),controller[_0x0c61('0xc')]);router[_0x0c61('0x7')](_0x0c61('0xd'),controller[_0x0c61('0xe')]);router[_0x0c61('0x7')](_0x0c61('0xf'),controller[_0x0c61('0x10')]);router['get'](_0x0c61('0x11'),controller['getPreferred']);router[_0x0c61('0x7')](_0x0c61('0x12'),controller['getFavicon']);var upload=multer({'storage':multer[_0x0c61('0x13')]({'destination':function(_0x49f52c,_0x4d7fd9,_0x278db7){_0x278db7(null,path['join'](config['root'],_0x0c61('0x14')));},'filename':function(_0x18258d,_0xe2fe83,_0x4c8480){_0x4c8480(null,util['format'](_0x0c61('0x15'),'logo',path[_0x0c61('0x16')](_0xe2fe83['originalname'])));}})});router[_0x0c61('0x17')]('/:id/logo',upload[_0x0c61('0x18')]('file'),controller[_0x0c61('0x19')]);var upload=multer({'storage':multer[_0x0c61('0x13')]({'destination':function(_0xa3aef9,_0x5423cf,_0x5b9561){_0x5b9561(null,path['join'](config['root'],_0x0c61('0x14')));},'filename':function(_0x398cab,_0xeadd83,_0x4140a1){_0x4140a1(null,util[_0x0c61('0x1a')](_0x0c61('0x15'),_0x0c61('0x1b'),path[_0x0c61('0x16')](_0xeadd83[_0x0c61('0x1c')])));}})});router[_0x0c61('0x17')](_0x0c61('0xd'),upload[_0x0c61('0x18')](_0x0c61('0x1d')),controller['addLogoLogin']);var upload=multer({'storage':multer[_0x0c61('0x13')]({'destination':function(_0x1b9c86,_0x24b7c7,_0x3fa983){_0x3fa983(null,path[_0x0c61('0x1e')](config[_0x0c61('0x1f')],'server/files/images/logos/'));},'filename':function(_0x46da86,_0x191da4,_0x4e8f8c){_0x4e8f8c(null,util[_0x0c61('0x1a')](_0x0c61('0x15'),'preferred',path['extname'](_0x191da4[_0x0c61('0x1c')])));}})});router[_0x0c61('0x17')](_0x0c61('0x11'),upload['single'](_0x0c61('0x1d')),controller[_0x0c61('0x20')]);var upload=multer({'storage':multer[_0x0c61('0x13')]({'destination':function(_0x433981,_0x56a645,_0x5f3ac0){_0x5f3ac0(null,path[_0x0c61('0x1e')](config['root'],_0x0c61('0x14')));},'filename':function(_0x154c90,_0x30a533,_0x57f79b){_0x57f79b(null,util[_0x0c61('0x1a')](_0x0c61('0x15'),'favicon',path[_0x0c61('0x16')](_0x30a533['originalname'])));}})});router['post'](_0x0c61('0x12'),upload[_0x0c61('0x18')](_0x0c61('0x1d')),controller[_0x0c61('0x21')]);router['put'](_0x0c61('0x22'),auth['isAuthenticated'](),controller[_0x0c61('0x23')]);module['exports']=router; \ No newline at end of file +var _0xd6b9=['../../config/environment','./setting.controller','get','isAuthenticated','index','/now','/:id','show','/:id/logo','getLogo','/:id/logo_login','getLogoLogin','/:id/gdpr','gdpr','getPreferred','diskStorage','join','server/files/images/logos/','format','%s%s','originalname','single','file','root','logologin','extname','post','preferred','/:id/preferred','/:id/favicon','addFavicon','put','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x1c336f,_0x1eb98f){var _0xcf87ac=function(_0x46f32b){while(--_0x46f32b){_0x1c336f['push'](_0x1c336f['shift']());}};_0xcf87ac(++_0x1eb98f);}(_0xd6b9,0xee));var _0x9d6b=function(_0x509f97,_0x442414){_0x509f97=_0x509f97-0x0;var _0x18bbef=_0xd6b9[_0x509f97];return _0x18bbef;};'use strict';var multer=require('multer');var util=require(_0x9d6b('0x0'));var path=require(_0x9d6b('0x1'));var timeout=require(_0x9d6b('0x2'));var express=require(_0x9d6b('0x3'));var router=express[_0x9d6b('0x4')]();var fs_extra=require(_0x9d6b('0x5'));var auth=require(_0x9d6b('0x6'));var interaction=require(_0x9d6b('0x7'));var config=require(_0x9d6b('0x8'));var controller=require(_0x9d6b('0x9'));router[_0x9d6b('0xa')]('/',auth[_0x9d6b('0xb')](),controller[_0x9d6b('0xc')]);router[_0x9d6b('0xa')](_0x9d6b('0xd'),controller['getDate']);router[_0x9d6b('0xa')](_0x9d6b('0xe'),controller[_0x9d6b('0xf')]);router[_0x9d6b('0xa')](_0x9d6b('0x10'),controller[_0x9d6b('0x11')]);router[_0x9d6b('0xa')](_0x9d6b('0x12'),controller[_0x9d6b('0x13')]);router[_0x9d6b('0xa')](_0x9d6b('0x14'),controller[_0x9d6b('0x15')]);router[_0x9d6b('0xa')]('/:id/preferred',controller[_0x9d6b('0x16')]);router[_0x9d6b('0xa')]('/:id/favicon',controller['getFavicon']);var upload=multer({'storage':multer[_0x9d6b('0x17')]({'destination':function(_0x10dff7,_0x5c436a,_0x22875b){_0x22875b(null,path[_0x9d6b('0x18')](config['root'],_0x9d6b('0x19')));},'filename':function(_0x315d9b,_0x58bdb2,_0x3328ae){_0x3328ae(null,util[_0x9d6b('0x1a')](_0x9d6b('0x1b'),'logo',path['extname'](_0x58bdb2[_0x9d6b('0x1c')])));}})});router['post'](_0x9d6b('0x10'),upload[_0x9d6b('0x1d')](_0x9d6b('0x1e')),controller['addLogo']);var upload=multer({'storage':multer[_0x9d6b('0x17')]({'destination':function(_0x16fcb8,_0x1f30f8,_0x18b9b4){_0x18b9b4(null,path[_0x9d6b('0x18')](config[_0x9d6b('0x1f')],_0x9d6b('0x19')));},'filename':function(_0xf71bae,_0x16d320,_0x318861){_0x318861(null,util[_0x9d6b('0x1a')](_0x9d6b('0x1b'),_0x9d6b('0x20'),path[_0x9d6b('0x21')](_0x16d320[_0x9d6b('0x1c')])));}})});router[_0x9d6b('0x22')]('/:id/logo_login',upload[_0x9d6b('0x1d')](_0x9d6b('0x1e')),controller['addLogoLogin']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x28157b,_0x111387,_0x305354){_0x305354(null,path[_0x9d6b('0x18')](config[_0x9d6b('0x1f')],_0x9d6b('0x19')));},'filename':function(_0x8da96f,_0x3098a3,_0x298b0a){_0x298b0a(null,util[_0x9d6b('0x1a')](_0x9d6b('0x1b'),_0x9d6b('0x23'),path[_0x9d6b('0x21')](_0x3098a3[_0x9d6b('0x1c')])));}})});router[_0x9d6b('0x22')](_0x9d6b('0x24'),upload[_0x9d6b('0x1d')](_0x9d6b('0x1e')),controller['addPreferred']);var upload=multer({'storage':multer[_0x9d6b('0x17')]({'destination':function(_0x290567,_0x13ba9b,_0x16e7f6){_0x16e7f6(null,path[_0x9d6b('0x18')](config['root'],_0x9d6b('0x19')));},'filename':function(_0x460d7a,_0x58d04a,_0x395497){_0x395497(null,util[_0x9d6b('0x1a')]('%s%s','favicon',path[_0x9d6b('0x21')](_0x58d04a[_0x9d6b('0x1c')])));}})});router[_0x9d6b('0x22')](_0x9d6b('0x25'),upload[_0x9d6b('0x1d')](_0x9d6b('0x1e')),controller[_0x9d6b('0x26')]);router[_0x9d6b('0x27')](_0x9d6b('0xe'),auth['isAuthenticated'](),controller['update']);module[_0x9d6b('0x28')]=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index 6e82cc6..bd464f4 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 _0x5f2f=['INTEGER','min_internal','min_mailbox','STRING','BOOLEAN','alternate','UNSIGNED','sequelize','exports'];(function(_0x57b41a,_0x18ae3e){var _0xe2ef65=function(_0x481a60){while(--_0x481a60){_0x57b41a['push'](_0x57b41a['shift']());}};_0xe2ef65(++_0x18ae3e);}(_0x5f2f,0x73));var _0xf5f2=function(_0x569dda,_0x29f743){_0x569dda=_0x569dda-0x0;var _0x9fb40b=_0x5f2f[_0x569dda];return _0x9fb40b;};'use strict';var Sequelize=require(_0xf5f2('0x0'));module[_0xf5f2('0x1')]={'min_internal':{'type':Sequelize[_0xf5f2('0x2')](0xb),'unique':_0xf5f2('0x3'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0xf5f2('0x2')](0xb),'unique':_0xf5f2('0x4'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0xf5f2('0x2')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0xf5f2('0x5')],'defaultValue':'/var/opt/motion2/server/files/sounds/converted'},'logo':{'type':Sequelize['STRING']},'defaultLogo':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0xf5f2('0x5')]},'defaultLoginLogo':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0xf5f2('0x5')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0xf5f2('0x5')]},'turnaddr':{'type':Sequelize[_0xf5f2('0x5')]},'turnusername':{'type':Sequelize[_0xf5f2('0x5')]},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize[_0xf5f2('0x5')]},'defaultPageTitle':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize['STRING'],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':![]},'split':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0xf5f2('0x5')],'defaultValue':_0xf5f2('0x7')},'chatTimeout':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0xf5f2('0x5')]},'allowedLoginAttempts':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize['STRING']},'defaultFavicon':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0xf5f2('0x2')]},'transcribeRegion':{'type':Sequelize[_0xf5f2('0x5')]},'sentiment':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0xf5f2('0x2')]},'sentimentRegion':{'type':Sequelize[_0xf5f2('0x5')]},'language':{'type':Sequelize[_0xf5f2('0x5')]},'bucket':{'type':Sequelize[_0xf5f2('0x5')]},'googleSsoEnabled':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize[_0xf5f2('0x2')](0x2)[_0xf5f2('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0xf5f2('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0xf5f2('0x2')](0x2)[_0xf5f2('0x8')],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize[_0xf5f2('0x2')],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0xf5f2('0x6')],'defaultValue':![]}}; \ No newline at end of file +var _0xdb28=['INTEGER','min_internal','min_mailbox','STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN','https://www.xcally.com/bar/phonebar/autoupdater.xml','alternate','UNSIGNED','sequelize','exports'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xdb28,0x106));var _0x8db2=function(_0x4718b2,_0x40cede){_0x4718b2=_0x4718b2-0x0;var _0xb04760=_0xdb28[_0x4718b2];return _0xb04760;};'use strict';var Sequelize=require(_0x8db2('0x0'));module[_0x8db2('0x1')]={'min_internal':{'type':Sequelize[_0x8db2('0x2')](0xb),'unique':_0x8db2('0x3'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':_0x8db2('0x4'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0x8db2('0x2')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x8db2('0x5')],'defaultValue':_0x8db2('0x6')},'logo':{'type':Sequelize[_0x8db2('0x5')]},'defaultLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x8db2('0x5')]},'defaultLoginLogo':{'type':Sequelize[_0x8db2('0x7')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize['STRING']},'defaultHeaderWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x8db2('0x7')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x8db2('0x7')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0x8db2('0x5')]},'turnaddr':{'type':Sequelize[_0x8db2('0x5')]},'turnusername':{'type':Sequelize[_0x8db2('0x5')]},'turnpassword':{'type':Sequelize[_0x8db2('0x5')]},'pageTitle':{'type':Sequelize[_0x8db2('0x5')]},'defaultPageTitle':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x8db2('0x7')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x8db2('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x8db2('0x7')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize['STRING'],'defaultValue':_0x8db2('0x8')},'enableEmailPreview':{'type':Sequelize[_0x8db2('0x7')],'defaultValue':![]},'split':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0x8db2('0x2')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x8db2('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x8db2('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x8db2('0x5')],'defaultValue':_0x8db2('0x9')},'chatTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x8db2('0x5')]},'defaultPreferred':{'type':Sequelize[_0x8db2('0x7')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x8db2('0x7')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x8db2('0x5')]},'allowedLoginAttempts':{'type':Sequelize[_0x8db2('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x8db2('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x8db2('0x5')]},'defaultFavicon':{'type':Sequelize[_0x8db2('0x7')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x8db2('0x2')],'defaultValue':0xa,'validate':{'min':0xa}},'transcribe':{'type':Sequelize[_0x8db2('0x7')],'defaultValue':![]},'automaticTranscribe':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transcribeAccountId':{'type':Sequelize[_0x8db2('0x2')]},'transcribeRegion':{'type':Sequelize[_0x8db2('0x5')]},'sentiment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'automaticSentiment':{'type':Sequelize[_0x8db2('0x7')],'defaultValue':![]},'sentimentAccountId':{'type':Sequelize[_0x8db2('0x2')]},'sentimentRegion':{'type':Sequelize[_0x8db2('0x5')]},'language':{'type':Sequelize[_0x8db2('0x5')]},'bucket':{'type':Sequelize[_0x8db2('0x5')]},'googleSsoEnabled':{'type':Sequelize[_0x8db2('0x7')],'defaultValue':![]},'enforcePasswordHistory':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'passwordHistoryLimit':{'type':Sequelize['INTEGER'](0x2)[_0x8db2('0xa')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5}},'privacyPolicyEmail':{'type':Sequelize[_0x8db2('0x2')](0x2)[_0x8db2('0xa')],'defaultValue':0x0},'privacyPolicyName':{'type':Sequelize[_0x8db2('0x2')](0x2)['UNSIGNED'],'defaultValue':0x0},'privacyPolicyNumber':{'type':Sequelize[_0x8db2('0x2')](0x2)[_0x8db2('0xa')],'defaultValue':0x0},'searchOnEnterKey':{'type':Sequelize[_0x8db2('0x7')],'defaultValue':!![]},'chatInteractionsReloadTimeout':{'type':Sequelize[_0x8db2('0x2')],'defaultValue':0x0},'mailInteractionsReloadTimeout':{'type':Sequelize[_0x8db2('0x2')],'defaultValue':0x0},'openchannelInteractionsReloadTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsInteractionsReloadTimeout':{'type':Sequelize[_0x8db2('0x2')],'defaultValue':0x0},'whatsappInteractionsReloadTimeout':{'type':Sequelize[_0x8db2('0x2')],'defaultValue':0x0},'stopRecordingOnTransfer':{'type':Sequelize[_0x8db2('0x7')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index 869dc19..70c2f11 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 _0xf5b7=['utcOffset','now','format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','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','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','error','message','sendStatus','status','end','json','undefined','count','offset','limit','Content-Range','reject','save','update','then','destroy','name','send','index','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','VIRTUAL','filter','merge','options','Setting','includeAll','include','rows','catch','show','params','find','body','addLogo','file','filename','logo','addLogoLogin','loginLogo','getLogo','server/files/images/logos','favicon','defaultLoginLogo','defaultPreferred','existsSync','join','root','toLower','upperFirst','custom','default_logo.svg','ValidationError','download','getLogoLogin','getLicense','default_loginLogo.svg','default','Sequelize','\x20not\x20found','securePassword','preferred','getPreferred','defaultFavicon','default_preferred.png','addFavicon','getFavicon','default_favicon.ico'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xf5b7,0xf7));var _0x7f5b=function(_0x50471b,_0x10054a){_0x50471b=_0x50471b-0x0;var _0xd6d011=_0xf5b7[_0x50471b];return _0xd6d011;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7f5b('0x0'));var zipdir=require(_0x7f5b('0x1'));var jsonpatch=require(_0x7f5b('0x2'));var rp=require(_0x7f5b('0x3'));var moment=require(_0x7f5b('0x4'));var BPromise=require(_0x7f5b('0x5'));var Mustache=require('mustache');var util=require(_0x7f5b('0x6'));var path=require('path');var sox=require(_0x7f5b('0x7'));var csv=require(_0x7f5b('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7f5b('0x9'));var _=require(_0x7f5b('0xa'));var squel=require(_0x7f5b('0xb'));var crypto=require(_0x7f5b('0xc'));var jsforce=require(_0x7f5b('0xd'));var deskjs=require(_0x7f5b('0xe'));var toCsv=require(_0x7f5b('0x8'));var querystring=require(_0x7f5b('0xf'));var Papa=require(_0x7f5b('0x10'));var Redis=require(_0x7f5b('0x11'));var authService=require(_0x7f5b('0x12'));var qs=require(_0x7f5b('0x13'));var as=require(_0x7f5b('0x14'));var hardwareService=require(_0x7f5b('0x15'));var logger=require(_0x7f5b('0x16'))('api');var utils=require(_0x7f5b('0x17'));var config=require(_0x7f5b('0x18'));var licenseUtil=require(_0x7f5b('0x19'));var db=require(_0x7f5b('0x1a'))['db'];var jayson=require(_0x7f5b('0x1b'));var client=jayson[_0x7f5b('0x1c')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2cd761,_0x319b70,_0x1bc1e9,_0x434f2c){return new BPromise(function(_0x1172dd,_0x4321cb){var _0x481824=_0x434f2c||client;return _0x481824['request'](_0x2cd761,_0x1bc1e9)['then'](function(_0x1cc067){logger[_0x7f5b('0x1d')](_0x7f5b('0x1e'),_0x319b70,_0x7f5b('0x1f'));logger[_0x7f5b('0x20')](_0x7f5b('0x21'),_0x319b70,_0x7f5b('0x1f'),JSON['stringify'](_0x1cc067));if(_0x1cc067['error']){if(_0x1cc067[_0x7f5b('0x22')]['code']===0x1f4){logger[_0x7f5b('0x22')](_0x7f5b('0x1e'),_0x319b70,_0x1cc067['error'][_0x7f5b('0x23')]);return _0x4321cb(_0x1cc067[_0x7f5b('0x22')]['message']);}logger['error'](_0x7f5b('0x1e'),_0x319b70,_0x1cc067[_0x7f5b('0x22')][_0x7f5b('0x23')]);return _0x1172dd(_0x1cc067['error'][_0x7f5b('0x23')]);}else{logger[_0x7f5b('0x1d')](_0x7f5b('0x1e'),_0x319b70,_0x7f5b('0x1f'));_0x1172dd(_0x1cc067['result'][_0x7f5b('0x23')]);}})['catch'](function(_0x2722a8){logger[_0x7f5b('0x22')]('Setting,\x20%s,\x20%s',_0x319b70,_0x2722a8);_0x4321cb(_0x2722a8);});});}function respondWithStatusCode(_0x42020e,_0x5c2b40){_0x5c2b40=_0x5c2b40||0xcc;return function(_0x262cba){if(_0x262cba){return _0x42020e[_0x7f5b('0x24')](_0x5c2b40);}return _0x42020e[_0x7f5b('0x25')](_0x5c2b40)[_0x7f5b('0x26')]();};}function respondWithResult(_0x3064de,_0x2f8ce4){_0x2f8ce4=_0x2f8ce4||0xc8;return function(_0x246ab1){if(_0x246ab1){return _0x3064de[_0x7f5b('0x25')](_0x2f8ce4)[_0x7f5b('0x27')](_0x246ab1);}};}function respondWithFilteredResult(_0x376b0a,_0x400ca7){return function(_0x46449a){if(_0x46449a){var _0x469dac=typeof _0x400ca7['offset']===_0x7f5b('0x28')&&typeof _0x400ca7['limit']===_0x7f5b('0x28');var _0x59affb=_0x46449a[_0x7f5b('0x29')];var _0x58e005=_0x469dac?0x0:_0x400ca7['offset'];var _0x3d987c=_0x469dac?_0x46449a[_0x7f5b('0x29')]:_0x400ca7[_0x7f5b('0x2a')]+_0x400ca7[_0x7f5b('0x2b')];var _0x30b996;if(_0x3d987c>=_0x59affb){_0x3d987c=_0x59affb;_0x30b996=0xc8;}else{_0x30b996=0xce;}_0x376b0a[_0x7f5b('0x25')](_0x30b996);return _0x376b0a['set'](_0x7f5b('0x2c'),_0x58e005+'-'+_0x3d987c+'/'+_0x59affb)[_0x7f5b('0x27')](_0x46449a);}return null;};}function patchUpdates(_0x5a8615){return function(_0x71ec85){try{jsonpatch['apply'](_0x71ec85,_0x5a8615,!![]);}catch(_0x528b0e){return BPromise[_0x7f5b('0x2d')](_0x528b0e);}return _0x71ec85[_0x7f5b('0x2e')]();};}function saveUpdates(_0x2b904d,_0x78b62c){return function(_0x54df44){if(_0x54df44){return _0x54df44[_0x7f5b('0x2f')](_0x2b904d)[_0x7f5b('0x30')](function(_0x35f2e2){return _0x35f2e2;});}return null;};}function removeEntity(_0xadc1be,_0x2da69e){return function(_0x1c1df9){if(_0x1c1df9){return _0x1c1df9[_0x7f5b('0x31')]()[_0x7f5b('0x30')](function(){_0xadc1be[_0x7f5b('0x25')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1af2e3,_0x1128a6){return function(_0x1ca6ce){if(!_0x1ca6ce){_0x1af2e3[_0x7f5b('0x24')](0x194);}return _0x1ca6ce;};}function handleError(_0x89e9ec,_0x584614){_0x584614=_0x584614||0x1f4;return function(_0x108f3e){logger[_0x7f5b('0x22')](_0x108f3e['stack']);if(_0x108f3e[_0x7f5b('0x32')]){delete _0x108f3e[_0x7f5b('0x32')];}_0x89e9ec[_0x7f5b('0x25')](_0x584614)[_0x7f5b('0x33')](_0x108f3e);};}exports[_0x7f5b('0x34')]=function(_0x57e9f3,_0x3d44e5){var _0x44e37e={},_0x1914c7={},_0x42745c={'count':0x0,'rows':[]};var _0x814e5c=_['map'](db['Setting'][_0x7f5b('0x35')],function(_0x2e8bcd){return{'name':_0x2e8bcd[_0x7f5b('0x36')],'type':_0x2e8bcd[_0x7f5b('0x37')][_0x7f5b('0x38')]};});_0x1914c7['model']=_[_0x7f5b('0x39')](_0x814e5c,_0x7f5b('0x32'));_0x1914c7[_0x7f5b('0x3a')]=_[_0x7f5b('0x3b')](_0x57e9f3[_0x7f5b('0x3a')]);_0x1914c7[_0x7f5b('0x3c')]=_[_0x7f5b('0x3d')](_0x1914c7[_0x7f5b('0x3e')],_0x1914c7[_0x7f5b('0x3a')]);_0x44e37e[_0x7f5b('0x3f')]=_[_0x7f5b('0x3d')](_0x1914c7['model'],qs[_0x7f5b('0x40')](_0x57e9f3[_0x7f5b('0x3a')][_0x7f5b('0x40')]));_0x44e37e[_0x7f5b('0x3f')]=_0x44e37e['attributes'][_0x7f5b('0x41')]?_0x44e37e[_0x7f5b('0x3f')]:_0x1914c7[_0x7f5b('0x3e')];if(!_0x57e9f3[_0x7f5b('0x3a')][_0x7f5b('0x42')](_0x7f5b('0x43'))){_0x44e37e[_0x7f5b('0x2b')]=qs[_0x7f5b('0x2b')](_0x57e9f3[_0x7f5b('0x3a')][_0x7f5b('0x2b')]);_0x44e37e['offset']=qs['offset'](_0x57e9f3[_0x7f5b('0x3a')][_0x7f5b('0x2a')]);}_0x44e37e[_0x7f5b('0x44')]=qs[_0x7f5b('0x45')](_0x57e9f3[_0x7f5b('0x3a')][_0x7f5b('0x45')]);_0x44e37e[_0x7f5b('0x46')]=qs['filters'](_[_0x7f5b('0x47')](_0x57e9f3[_0x7f5b('0x3a')],_0x1914c7['filters']),_0x814e5c);if(_0x57e9f3[_0x7f5b('0x3a')]['filter']){_0x44e37e[_0x7f5b('0x46')]=_['merge'](_0x44e37e[_0x7f5b('0x46')],{'$or':_[_0x7f5b('0x39')](_0x814e5c,function(_0xe61f03){if(_0xe61f03[_0x7f5b('0x37')]!==_0x7f5b('0x48')){var _0x25e400={};_0x25e400[_0xe61f03[_0x7f5b('0x32')]]={'$like':'%'+_0x57e9f3[_0x7f5b('0x3a')][_0x7f5b('0x49')]+'%'};return _0x25e400;}})});}_0x44e37e=_[_0x7f5b('0x4a')]({},_0x44e37e,_0x57e9f3[_0x7f5b('0x4b')]);var _0x2b9d47={'where':_0x44e37e['where']};return db[_0x7f5b('0x4c')]['count'](_0x2b9d47)[_0x7f5b('0x30')](function(_0x100594){_0x42745c[_0x7f5b('0x29')]=_0x100594;if(_0x57e9f3[_0x7f5b('0x3a')][_0x7f5b('0x4d')]){_0x44e37e[_0x7f5b('0x4e')]=[{'all':!![]}];}return db[_0x7f5b('0x4c')]['findAll'](_0x44e37e);})[_0x7f5b('0x30')](function(_0x3630f5){_0x42745c[_0x7f5b('0x4f')]=_0x3630f5;return _0x42745c;})['then'](respondWithFilteredResult(_0x3d44e5,_0x44e37e))[_0x7f5b('0x50')](handleError(_0x3d44e5,null));};exports[_0x7f5b('0x51')]=function(_0x47b5c0,_0x4739a1){var _0x4a5d3c={'raw':![],'where':{'id':_0x47b5c0[_0x7f5b('0x52')]['id']}},_0x468c0d={};_0x468c0d['model']=_[_0x7f5b('0x3b')](db[_0x7f5b('0x4c')]['rawAttributes']);_0x468c0d[_0x7f5b('0x3a')]=_[_0x7f5b('0x3b')](_0x47b5c0['query']);_0x468c0d[_0x7f5b('0x3c')]=_['intersection'](_0x468c0d[_0x7f5b('0x3e')],_0x468c0d['query']);_0x4a5d3c[_0x7f5b('0x3f')]=_[_0x7f5b('0x3d')](_0x468c0d['model'],qs[_0x7f5b('0x40')](_0x47b5c0[_0x7f5b('0x3a')][_0x7f5b('0x40')]));_0x4a5d3c[_0x7f5b('0x3f')]=_0x4a5d3c['attributes']['length']?_0x4a5d3c[_0x7f5b('0x3f')]:_0x468c0d[_0x7f5b('0x3e')];if(_0x47b5c0[_0x7f5b('0x3a')][_0x7f5b('0x4d')]){_0x4a5d3c[_0x7f5b('0x4e')]=[{'all':!![]}];}_0x4a5d3c=_[_0x7f5b('0x4a')]({},_0x4a5d3c,_0x47b5c0['options']);return db[_0x7f5b('0x4c')][_0x7f5b('0x53')](_0x4a5d3c)[_0x7f5b('0x30')](handleEntityNotFound(_0x4739a1,null))[_0x7f5b('0x30')](respondWithResult(_0x4739a1,null))['catch'](handleError(_0x4739a1,null));};exports['update']=function(_0x49d16b,_0x4e9845){if(_0x49d16b[_0x7f5b('0x54')]['id']){delete _0x49d16b['body']['id'];}return db[_0x7f5b('0x4c')][_0x7f5b('0x53')]({'where':{'id':_0x49d16b['params']['id']}})['then'](handleEntityNotFound(_0x4e9845,null))[_0x7f5b('0x30')](saveUpdates(_0x49d16b[_0x7f5b('0x54')],null))[_0x7f5b('0x30')](respondWithResult(_0x4e9845,null))[_0x7f5b('0x50')](handleError(_0x4e9845,null));};exports[_0x7f5b('0x55')]=function(_0x5bbcac,_0x340f55,_0x39fba6){if(_0x5bbcac[_0x7f5b('0x56')]&&_0x5bbcac[_0x7f5b('0x56')][_0x7f5b('0x57')]){_0x5bbcac[_0x7f5b('0x54')][_0x7f5b('0x58')]=_0x5bbcac[_0x7f5b('0x56')]['filename'];}return db[_0x7f5b('0x4c')]['find']({'where':{'id':_0x5bbcac[_0x7f5b('0x52')]['id']}})[_0x7f5b('0x30')](handleEntityNotFound(_0x340f55,null))[_0x7f5b('0x30')](saveUpdates(_0x5bbcac[_0x7f5b('0x54')],null))[_0x7f5b('0x30')](respondWithResult(_0x340f55,null))[_0x7f5b('0x50')](handleError(_0x340f55,null));};exports[_0x7f5b('0x59')]=function(_0x199bd4,_0x284151,_0x1b1694){if(_0x199bd4[_0x7f5b('0x56')]&&_0x199bd4['file'][_0x7f5b('0x57')]){_0x199bd4['body'][_0x7f5b('0x5a')]=_0x199bd4['file'][_0x7f5b('0x57')];}return db[_0x7f5b('0x4c')][_0x7f5b('0x53')]({'where':{'id':_0x199bd4[_0x7f5b('0x52')]['id']}})['then'](handleEntityNotFound(_0x284151,null))['then'](saveUpdates(_0x199bd4[_0x7f5b('0x54')],null))[_0x7f5b('0x30')](respondWithResult(_0x284151,null))[_0x7f5b('0x50')](handleError(_0x284151,null));};var utilLicense=require('../../config/license/util');exports[_0x7f5b('0x5b')]=function(_0x6b43e0,_0x1c1779,_0x40e7ba){var _0x1c967a=_0x7f5b('0x5c');var _0x4b19bf={'custom':![]};return utilLicense['getLicense']()[_0x7f5b('0x30')](function(_0x2bdd49){if(_0x2bdd49){_0x4b19bf=_0x2bdd49;}return db[_0x7f5b('0x4c')][_0x7f5b('0x53')]({'where':{'id':_0x6b43e0[_0x7f5b('0x52')]['id']},'attributes':[_0x7f5b('0x58'),_0x7f5b('0x5a'),'preferred',_0x7f5b('0x5d'),'defaultLogo',_0x7f5b('0x5e'),_0x7f5b('0x5f'),'defaultFavicon'],'raw':!![]});})[_0x7f5b('0x30')](handleEntityNotFound(_0x1c1779,null))[_0x7f5b('0x30')](function(_0x33fdd9){if(_0x33fdd9){var _0x220e24=_0x33fdd9[_0x7f5b('0x58')]&&fs[_0x7f5b('0x60')](path[_0x7f5b('0x61')](config[_0x7f5b('0x62')],_0x1c967a,_['toLower'](_0x33fdd9[_0x7f5b('0x58')])))?path[_0x7f5b('0x61')](config[_0x7f5b('0x62')],_0x1c967a,_['toLower'](_0x33fdd9['logo'])):path[_0x7f5b('0x61')](config[_0x7f5b('0x62')],_0x1c967a,_[_0x7f5b('0x63')]('default_logo.svg'));var _0x90ab7='default'+_[_0x7f5b('0x64')](_0x7f5b('0x58'));if(_0x33fdd9[_0x90ab7]||!_0x4b19bf[_0x7f5b('0x65')]){_0x220e24=path['join'](config['root'],_0x1c967a,_[_0x7f5b('0x63')](_0x7f5b('0x66')));}if(!fs[_0x7f5b('0x60')](_0x220e24)){throw new db['Sequelize'][(_0x7f5b('0x67'))](_['upperFirst'](_0x7f5b('0x58'))+'\x20not\x20found');}return _0x1c1779[_0x7f5b('0x68')](_0x220e24);}})['catch'](handleError(_0x1c1779,null));};var utilLicense=require(_0x7f5b('0x19'));exports[_0x7f5b('0x69')]=function(_0xac7aad,_0x3be91c,_0x4d158e){var _0x2cae95=_0x7f5b('0x5c');var _0x56b928={'custom':![]};return utilLicense[_0x7f5b('0x6a')]()[_0x7f5b('0x30')](function(_0x44e7a8){if(_0x44e7a8){_0x56b928=_0x44e7a8;}return db[_0x7f5b('0x4c')][_0x7f5b('0x53')]({'where':{'id':_0xac7aad[_0x7f5b('0x52')]['id']},'attributes':[_0x7f5b('0x58'),_0x7f5b('0x5a'),'preferred',_0x7f5b('0x5d'),'defaultLogo',_0x7f5b('0x5e'),_0x7f5b('0x5f'),'defaultFavicon'],'raw':!![]});})['then'](handleEntityNotFound(_0x3be91c,null))['then'](function(_0x10ca11){if(_0x10ca11){var _0x26730d=_0x10ca11[_0x7f5b('0x5a')]&&fs[_0x7f5b('0x60')](path[_0x7f5b('0x61')](config[_0x7f5b('0x62')],_0x2cae95,_['toLower'](_0x10ca11[_0x7f5b('0x5a')])))?path['join'](config[_0x7f5b('0x62')],_0x2cae95,_[_0x7f5b('0x63')](_0x10ca11[_0x7f5b('0x5a')])):path['join'](config[_0x7f5b('0x62')],_0x2cae95,_[_0x7f5b('0x63')](_0x7f5b('0x6b')));var _0x2b5f72=_0x7f5b('0x6c')+_[_0x7f5b('0x64')]('loginLogo');if(_0x10ca11[_0x2b5f72]||!_0x56b928[_0x7f5b('0x65')]){_0x26730d=path['join'](config[_0x7f5b('0x62')],_0x2cae95,_[_0x7f5b('0x63')]('default_loginLogo.svg'));}if(!fs[_0x7f5b('0x60')](_0x26730d)){throw new db[(_0x7f5b('0x6d'))][(_0x7f5b('0x67'))](_['upperFirst'](_0x7f5b('0x5a'))+_0x7f5b('0x6e'));}return _0x3be91c[_0x7f5b('0x68')](_0x26730d);}})['catch'](handleError(_0x3be91c,null));};exports['gdpr']=function(_0x4ff35c,_0x4accd1){return db[_0x7f5b('0x4c')][_0x7f5b('0x53')]({'where':{'id':_0x4ff35c['params']['id']},'attributes':[_0x7f5b('0x6f')]})[_0x7f5b('0x30')](respondWithResult(_0x4accd1,null))[_0x7f5b('0x50')](handleError(_0x4accd1,null));};exports['addPreferred']=function(_0x343c83,_0x55708b,_0x46417f){if(_0x343c83[_0x7f5b('0x56')]&&_0x343c83[_0x7f5b('0x56')]['filename']){_0x343c83['body'][_0x7f5b('0x70')]=_0x343c83[_0x7f5b('0x56')]['filename'];}return db[_0x7f5b('0x4c')]['find']({'where':{'id':_0x343c83['params']['id']}})['then'](handleEntityNotFound(_0x55708b,null))[_0x7f5b('0x30')](saveUpdates(_0x343c83[_0x7f5b('0x54')],null))[_0x7f5b('0x30')](respondWithResult(_0x55708b,null))[_0x7f5b('0x50')](handleError(_0x55708b,null));};var utilLicense=require('../../config/license/util');exports[_0x7f5b('0x71')]=function(_0x2cfeba,_0x4cb5b8,_0x534c78){var _0x865aa5=_0x7f5b('0x5c');var _0x45ecfd={'custom':![]};return utilLicense[_0x7f5b('0x6a')]()[_0x7f5b('0x30')](function(_0x570023){if(_0x570023){_0x45ecfd=_0x570023;}return db[_0x7f5b('0x4c')][_0x7f5b('0x53')]({'where':{'id':_0x2cfeba[_0x7f5b('0x52')]['id']},'attributes':[_0x7f5b('0x58'),_0x7f5b('0x5a'),'preferred',_0x7f5b('0x5d'),'defaultLogo',_0x7f5b('0x5e'),'defaultPreferred',_0x7f5b('0x72')],'raw':!![]});})[_0x7f5b('0x30')](handleEntityNotFound(_0x4cb5b8,null))['then'](function(_0x2b3135){if(_0x2b3135){var _0x5be767=_0x2b3135[_0x7f5b('0x70')]&&fs['existsSync'](path['join'](config['root'],_0x865aa5,_[_0x7f5b('0x63')](_0x2b3135[_0x7f5b('0x70')])))?path[_0x7f5b('0x61')](config[_0x7f5b('0x62')],_0x865aa5,_[_0x7f5b('0x63')](_0x2b3135[_0x7f5b('0x70')])):path['join'](config[_0x7f5b('0x62')],_0x865aa5,_['toLower'](_0x7f5b('0x73')));var _0x22bdeb=_0x7f5b('0x6c')+_[_0x7f5b('0x64')](_0x7f5b('0x70'));if(_0x2b3135[_0x22bdeb]||!_0x45ecfd[_0x7f5b('0x65')]||!_0x45ecfd[_0x7f5b('0x70')]){_0x5be767=path[_0x7f5b('0x61')](config[_0x7f5b('0x62')],_0x865aa5,_[_0x7f5b('0x63')](_0x7f5b('0x73')));}if(!fs[_0x7f5b('0x60')](_0x5be767)){throw new db['Sequelize'][(_0x7f5b('0x67'))](_['upperFirst'](_0x7f5b('0x70'))+'\x20not\x20found');}return _0x4cb5b8[_0x7f5b('0x68')](_0x5be767);}})[_0x7f5b('0x50')](handleError(_0x4cb5b8,null));};exports[_0x7f5b('0x74')]=function(_0x1f172a,_0x49796f,_0xa115fb){if(_0x1f172a[_0x7f5b('0x56')]&&_0x1f172a[_0x7f5b('0x56')][_0x7f5b('0x57')]){_0x1f172a[_0x7f5b('0x54')][_0x7f5b('0x5d')]=_0x1f172a[_0x7f5b('0x56')][_0x7f5b('0x57')];}return db['Setting'][_0x7f5b('0x53')]({'where':{'id':_0x1f172a[_0x7f5b('0x52')]['id']}})[_0x7f5b('0x30')](handleEntityNotFound(_0x49796f,null))[_0x7f5b('0x30')](saveUpdates(_0x1f172a[_0x7f5b('0x54')],null))[_0x7f5b('0x30')](respondWithResult(_0x49796f,null))[_0x7f5b('0x50')](handleError(_0x49796f,null));};var utilLicense=require('../../config/license/util');exports[_0x7f5b('0x75')]=function(_0x45dd9f,_0x4dc06f,_0x41d6ad){var _0x13b939=_0x7f5b('0x5c');var _0x4c4e38={'custom':![]};return utilLicense[_0x7f5b('0x6a')]()['then'](function(_0x312ad0){if(_0x312ad0){_0x4c4e38=_0x312ad0;}return db[_0x7f5b('0x4c')][_0x7f5b('0x53')]({'where':{'id':_0x45dd9f[_0x7f5b('0x52')]['id']},'attributes':[_0x7f5b('0x58'),'loginLogo','preferred','favicon','defaultLogo',_0x7f5b('0x5e'),'defaultPreferred',_0x7f5b('0x72')],'raw':!![]});})[_0x7f5b('0x30')](handleEntityNotFound(_0x4dc06f,null))[_0x7f5b('0x30')](function(_0x418571){if(_0x418571){var _0x421ea9=_0x418571[_0x7f5b('0x5d')]&&fs[_0x7f5b('0x60')](path[_0x7f5b('0x61')](config[_0x7f5b('0x62')],_0x13b939,_[_0x7f5b('0x63')](_0x418571[_0x7f5b('0x5d')])))?path[_0x7f5b('0x61')](config[_0x7f5b('0x62')],_0x13b939,_[_0x7f5b('0x63')](_0x418571[_0x7f5b('0x5d')])):path[_0x7f5b('0x61')](config[_0x7f5b('0x62')],_0x13b939,_[_0x7f5b('0x63')](_0x7f5b('0x76')));var _0x1a1561=_0x7f5b('0x6c')+_[_0x7f5b('0x64')]('favicon');if(_0x418571[_0x1a1561]||!_0x4c4e38[_0x7f5b('0x65')]){_0x421ea9=path[_0x7f5b('0x61')](config[_0x7f5b('0x62')],_0x13b939,_[_0x7f5b('0x63')]('default_favicon.ico'));}if(!fs['existsSync'](_0x421ea9)){throw new db['Sequelize'][(_0x7f5b('0x67'))](_['upperFirst'](_0x7f5b('0x5d'))+_0x7f5b('0x6e'));}return _0x4dc06f[_0x7f5b('0x68')](_0x421ea9);}})[_0x7f5b('0x50')](handleError(_0x4dc06f,null));};exports['getDate']=function(_0x206769,_0x214c1d){var _0x2e6434={'offset':moment()[_0x7f5b('0x77')]()};_0x2e6434[_0x7f5b('0x78')]=moment()[_0x7f5b('0x77')](_0x2e6434['offset'])[_0x7f5b('0x79')]('YYYY-MM-DD\x20HH:mm:ss:SSS');return _0x214c1d['status'](0xc8)[_0x7f5b('0x33')](_0x2e6434);}; \ No newline at end of file +var _0x47aa=['getLogo','server/files/images/logos','getLicense','logo','preferred','favicon','defaultLoginLogo','defaultFavicon','existsSync','join','root','toLower','default_logo.svg','default','upperFirst','custom','Sequelize','ValidationError','\x20not\x20found','download','getLogoLogin','defaultLogo','defaultPreferred','default_loginLogo.svg','gdpr','addPreferred','getPreferred','default_preferred.png','addFavicon','getFavicon','default_favicon.ico','getDate','utcOffset','now','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','jayson/promise','client','http','request','then','info','Setting,\x20%s,\x20%s','debug','Setting,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','destroy','stack','name','send','map','Setting','fieldName','type','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','VIRTUAL','merge','includeAll','include','findAll','rows','params','options','update','body','addLogo','file','filename','find','addLogoLogin','loginLogo'];(function(_0x539fb2,_0x5b6718){var _0x4d583d=function(_0x55fa69){while(--_0x55fa69){_0x539fb2['push'](_0x539fb2['shift']());}};_0x4d583d(++_0x5b6718);}(_0x47aa,0x9e));var _0xa47a=function(_0x1b125f,_0x554872){_0x1b125f=_0x1b125f-0x0;var _0x437fbf=_0x47aa[_0x1b125f];return _0x437fbf;};'use strict';var emlformat=require(_0xa47a('0x0'));var rimraf=require(_0xa47a('0x1'));var zipdir=require(_0xa47a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa47a('0x3'));var moment=require('moment');var BPromise=require(_0xa47a('0x4'));var Mustache=require(_0xa47a('0x5'));var util=require(_0xa47a('0x6'));var path=require(_0xa47a('0x7'));var sox=require(_0xa47a('0x8'));var csv=require(_0xa47a('0x9'));var ejs=require(_0xa47a('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa47a('0xb'));var squel=require('squel');var crypto=require(_0xa47a('0xc'));var jsforce=require(_0xa47a('0xd'));var deskjs=require(_0xa47a('0xe'));var toCsv=require('to-csv');var querystring=require(_0xa47a('0xf'));var Papa=require(_0xa47a('0x10'));var Redis=require(_0xa47a('0x11'));var authService=require(_0xa47a('0x12'));var qs=require(_0xa47a('0x13'));var as=require(_0xa47a('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xa47a('0x15'));var utils=require(_0xa47a('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xa47a('0x17'));var db=require(_0xa47a('0x18'))['db'];var jayson=require(_0xa47a('0x19'));var client=jayson[_0xa47a('0x1a')][_0xa47a('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x799da,_0x567b0a,_0x290553,_0x59cb36){return new BPromise(function(_0x52a672,_0x235a99){var _0x4447a1=_0x59cb36||client;return _0x4447a1[_0xa47a('0x1c')](_0x799da,_0x290553)[_0xa47a('0x1d')](function(_0x3a2eb3){logger[_0xa47a('0x1e')](_0xa47a('0x1f'),_0x567b0a,'request\x20sent');logger[_0xa47a('0x20')](_0xa47a('0x21'),_0x567b0a,_0xa47a('0x22'),JSON[_0xa47a('0x23')](_0x3a2eb3));if(_0x3a2eb3['error']){if(_0x3a2eb3[_0xa47a('0x24')][_0xa47a('0x25')]===0x1f4){logger[_0xa47a('0x24')]('Setting,\x20%s,\x20%s',_0x567b0a,_0x3a2eb3[_0xa47a('0x24')][_0xa47a('0x26')]);return _0x235a99(_0x3a2eb3[_0xa47a('0x24')]['message']);}logger[_0xa47a('0x24')]('Setting,\x20%s,\x20%s',_0x567b0a,_0x3a2eb3[_0xa47a('0x24')][_0xa47a('0x26')]);return _0x52a672(_0x3a2eb3[_0xa47a('0x24')][_0xa47a('0x26')]);}else{logger['info']('Setting,\x20%s,\x20%s',_0x567b0a,_0xa47a('0x22'));_0x52a672(_0x3a2eb3[_0xa47a('0x27')][_0xa47a('0x26')]);}})[_0xa47a('0x28')](function(_0x4c701f){logger[_0xa47a('0x24')]('Setting,\x20%s,\x20%s',_0x567b0a,_0x4c701f);_0x235a99(_0x4c701f);});});}function respondWithStatusCode(_0x4b0aab,_0x456d75){_0x456d75=_0x456d75||0xcc;return function(_0x542028){if(_0x542028){return _0x4b0aab[_0xa47a('0x29')](_0x456d75);}return _0x4b0aab[_0xa47a('0x2a')](_0x456d75)[_0xa47a('0x2b')]();};}function respondWithResult(_0x12ea8c,_0x31f149){_0x31f149=_0x31f149||0xc8;return function(_0x32510f){if(_0x32510f){return _0x12ea8c['status'](_0x31f149)[_0xa47a('0x2c')](_0x32510f);}};}function respondWithFilteredResult(_0x500315,_0x2684a0){return function(_0x2e5b64){if(_0x2e5b64){var _0x1166c1=typeof _0x2684a0[_0xa47a('0x2d')]===_0xa47a('0x2e')&&typeof _0x2684a0[_0xa47a('0x2f')]===_0xa47a('0x2e');var _0xabaeb3=_0x2e5b64[_0xa47a('0x30')];var _0x5508ec=_0x1166c1?0x0:_0x2684a0[_0xa47a('0x2d')];var _0x19d70d=_0x1166c1?_0x2e5b64[_0xa47a('0x30')]:_0x2684a0[_0xa47a('0x2d')]+_0x2684a0['limit'];var _0x26b71e;if(_0x19d70d>=_0xabaeb3){_0x19d70d=_0xabaeb3;_0x26b71e=0xc8;}else{_0x26b71e=0xce;}_0x500315[_0xa47a('0x2a')](_0x26b71e);return _0x500315['set'](_0xa47a('0x31'),_0x5508ec+'-'+_0x19d70d+'/'+_0xabaeb3)['json'](_0x2e5b64);}return null;};}function patchUpdates(_0x394fec){return function(_0x52a8a7){try{jsonpatch[_0xa47a('0x32')](_0x52a8a7,_0x394fec,!![]);}catch(_0x370811){return BPromise['reject'](_0x370811);}return _0x52a8a7['save']();};}function saveUpdates(_0x1997ad,_0x1c1ecb){return function(_0x2b790a){if(_0x2b790a){return _0x2b790a['update'](_0x1997ad)[_0xa47a('0x1d')](function(_0x89c333){return _0x89c333;});}return null;};}function removeEntity(_0x3a0fa0,_0xec6e0b){return function(_0x2be74e){if(_0x2be74e){return _0x2be74e[_0xa47a('0x33')]()[_0xa47a('0x1d')](function(){_0x3a0fa0[_0xa47a('0x2a')](0xcc)[_0xa47a('0x2b')]();});}};}function handleEntityNotFound(_0x435bcf,_0x48285b){return function(_0x1c9bf6){if(!_0x1c9bf6){_0x435bcf[_0xa47a('0x29')](0x194);}return _0x1c9bf6;};}function handleError(_0x568e39,_0x1918ca){_0x1918ca=_0x1918ca||0x1f4;return function(_0x4c3dba){logger[_0xa47a('0x24')](_0x4c3dba[_0xa47a('0x34')]);if(_0x4c3dba[_0xa47a('0x35')]){delete _0x4c3dba[_0xa47a('0x35')];}_0x568e39[_0xa47a('0x2a')](_0x1918ca)[_0xa47a('0x36')](_0x4c3dba);};}exports['index']=function(_0x3a69c0,_0x3452bd){var _0x173d4d={},_0xe467ab={},_0x1b3ced={'count':0x0,'rows':[]};var _0x2f6814=_[_0xa47a('0x37')](db[_0xa47a('0x38')]['rawAttributes'],function(_0x443d3f){return{'name':_0x443d3f[_0xa47a('0x39')],'type':_0x443d3f[_0xa47a('0x3a')]['key']};});_0xe467ab[_0xa47a('0x3b')]=_[_0xa47a('0x37')](_0x2f6814,_0xa47a('0x35'));_0xe467ab['query']=_[_0xa47a('0x3c')](_0x3a69c0[_0xa47a('0x3d')]);_0xe467ab['filters']=_[_0xa47a('0x3e')](_0xe467ab[_0xa47a('0x3b')],_0xe467ab[_0xa47a('0x3d')]);_0x173d4d['attributes']=_[_0xa47a('0x3e')](_0xe467ab[_0xa47a('0x3b')],qs[_0xa47a('0x3f')](_0x3a69c0[_0xa47a('0x3d')][_0xa47a('0x3f')]));_0x173d4d[_0xa47a('0x40')]=_0x173d4d[_0xa47a('0x40')][_0xa47a('0x41')]?_0x173d4d[_0xa47a('0x40')]:_0xe467ab['model'];if(!_0x3a69c0[_0xa47a('0x3d')][_0xa47a('0x42')](_0xa47a('0x43'))){_0x173d4d[_0xa47a('0x2f')]=qs['limit'](_0x3a69c0['query'][_0xa47a('0x2f')]);_0x173d4d['offset']=qs[_0xa47a('0x2d')](_0x3a69c0[_0xa47a('0x3d')][_0xa47a('0x2d')]);}_0x173d4d[_0xa47a('0x44')]=qs[_0xa47a('0x45')](_0x3a69c0[_0xa47a('0x3d')][_0xa47a('0x45')]);_0x173d4d['where']=qs[_0xa47a('0x46')](_[_0xa47a('0x47')](_0x3a69c0['query'],_0xe467ab[_0xa47a('0x46')]),_0x2f6814);if(_0x3a69c0['query'][_0xa47a('0x48')]){_0x173d4d[_0xa47a('0x49')]=_['merge'](_0x173d4d[_0xa47a('0x49')],{'$or':_[_0xa47a('0x37')](_0x2f6814,function(_0x2ebf33){if(_0x2ebf33[_0xa47a('0x3a')]!==_0xa47a('0x4a')){var _0x5f1c71={};_0x5f1c71[_0x2ebf33[_0xa47a('0x35')]]={'$like':'%'+_0x3a69c0[_0xa47a('0x3d')][_0xa47a('0x48')]+'%'};return _0x5f1c71;}})});}_0x173d4d=_[_0xa47a('0x4b')]({},_0x173d4d,_0x3a69c0['options']);var _0x48ce06={'where':_0x173d4d['where']};return db[_0xa47a('0x38')][_0xa47a('0x30')](_0x48ce06)[_0xa47a('0x1d')](function(_0x335d4e){_0x1b3ced[_0xa47a('0x30')]=_0x335d4e;if(_0x3a69c0[_0xa47a('0x3d')][_0xa47a('0x4c')]){_0x173d4d[_0xa47a('0x4d')]=[{'all':!![]}];}return db['Setting'][_0xa47a('0x4e')](_0x173d4d);})['then'](function(_0x31bc78){_0x1b3ced[_0xa47a('0x4f')]=_0x31bc78;return _0x1b3ced;})[_0xa47a('0x1d')](respondWithFilteredResult(_0x3452bd,_0x173d4d))[_0xa47a('0x28')](handleError(_0x3452bd,null));};exports['show']=function(_0xd09f98,_0x22d933){var _0x509dc3={'raw':![],'where':{'id':_0xd09f98[_0xa47a('0x50')]['id']}},_0x1e7c82={};_0x1e7c82[_0xa47a('0x3b')]=_[_0xa47a('0x3c')](db['Setting']['rawAttributes']);_0x1e7c82[_0xa47a('0x3d')]=_['keys'](_0xd09f98[_0xa47a('0x3d')]);_0x1e7c82[_0xa47a('0x46')]=_[_0xa47a('0x3e')](_0x1e7c82['model'],_0x1e7c82[_0xa47a('0x3d')]);_0x509dc3[_0xa47a('0x40')]=_['intersection'](_0x1e7c82[_0xa47a('0x3b')],qs['fields'](_0xd09f98[_0xa47a('0x3d')][_0xa47a('0x3f')]));_0x509dc3[_0xa47a('0x40')]=_0x509dc3[_0xa47a('0x40')][_0xa47a('0x41')]?_0x509dc3[_0xa47a('0x40')]:_0x1e7c82[_0xa47a('0x3b')];if(_0xd09f98[_0xa47a('0x3d')][_0xa47a('0x4c')]){_0x509dc3[_0xa47a('0x4d')]=[{'all':!![]}];}_0x509dc3=_[_0xa47a('0x4b')]({},_0x509dc3,_0xd09f98[_0xa47a('0x51')]);return db['Setting']['find'](_0x509dc3)[_0xa47a('0x1d')](handleEntityNotFound(_0x22d933,null))[_0xa47a('0x1d')](respondWithResult(_0x22d933,null))[_0xa47a('0x28')](handleError(_0x22d933,null));};exports[_0xa47a('0x52')]=function(_0x3c4abb,_0x110217){if(_0x3c4abb[_0xa47a('0x53')]['id']){delete _0x3c4abb[_0xa47a('0x53')]['id'];}return db[_0xa47a('0x38')]['find']({'where':{'id':_0x3c4abb[_0xa47a('0x50')]['id']}})[_0xa47a('0x1d')](handleEntityNotFound(_0x110217,null))[_0xa47a('0x1d')](saveUpdates(_0x3c4abb[_0xa47a('0x53')],null))[_0xa47a('0x1d')](respondWithResult(_0x110217,null))['catch'](handleError(_0x110217,null));};exports[_0xa47a('0x54')]=function(_0x33ed31,_0x54b81f,_0x24ae76){if(_0x33ed31[_0xa47a('0x55')]&&_0x33ed31[_0xa47a('0x55')][_0xa47a('0x56')]){_0x33ed31[_0xa47a('0x53')]['logo']=_0x33ed31[_0xa47a('0x55')]['filename'];}return db[_0xa47a('0x38')][_0xa47a('0x57')]({'where':{'id':_0x33ed31[_0xa47a('0x50')]['id']}})['then'](handleEntityNotFound(_0x54b81f,null))[_0xa47a('0x1d')](saveUpdates(_0x33ed31[_0xa47a('0x53')],null))[_0xa47a('0x1d')](respondWithResult(_0x54b81f,null))[_0xa47a('0x28')](handleError(_0x54b81f,null));};exports[_0xa47a('0x58')]=function(_0xda4a30,_0x13c55b,_0x8b48c8){if(_0xda4a30[_0xa47a('0x55')]&&_0xda4a30[_0xa47a('0x55')][_0xa47a('0x56')]){_0xda4a30[_0xa47a('0x53')][_0xa47a('0x59')]=_0xda4a30[_0xa47a('0x55')]['filename'];}return db[_0xa47a('0x38')][_0xa47a('0x57')]({'where':{'id':_0xda4a30['params']['id']}})[_0xa47a('0x1d')](handleEntityNotFound(_0x13c55b,null))[_0xa47a('0x1d')](saveUpdates(_0xda4a30['body'],null))[_0xa47a('0x1d')](respondWithResult(_0x13c55b,null))[_0xa47a('0x28')](handleError(_0x13c55b,null));};var utilLicense=require('../../config/license/util');exports[_0xa47a('0x5a')]=function(_0x456131,_0xb76921,_0x1beab6){var _0x125e0c=_0xa47a('0x5b');var _0x12b2ef={'custom':![]};return utilLicense[_0xa47a('0x5c')]()['then'](function(_0x53ab29){if(_0x53ab29){_0x12b2ef=_0x53ab29;}return db[_0xa47a('0x38')][_0xa47a('0x57')]({'where':{'id':_0x456131[_0xa47a('0x50')]['id']},'attributes':[_0xa47a('0x5d'),_0xa47a('0x59'),_0xa47a('0x5e'),_0xa47a('0x5f'),'defaultLogo',_0xa47a('0x60'),'defaultPreferred',_0xa47a('0x61')],'raw':!![]});})[_0xa47a('0x1d')](handleEntityNotFound(_0xb76921,null))[_0xa47a('0x1d')](function(_0x390772){if(_0x390772){var _0x52e333=_0x390772[_0xa47a('0x5d')]&&fs[_0xa47a('0x62')](path[_0xa47a('0x63')](config[_0xa47a('0x64')],_0x125e0c,_[_0xa47a('0x65')](_0x390772[_0xa47a('0x5d')])))?path['join'](config[_0xa47a('0x64')],_0x125e0c,_['toLower'](_0x390772['logo'])):path[_0xa47a('0x63')](config[_0xa47a('0x64')],_0x125e0c,_[_0xa47a('0x65')](_0xa47a('0x66')));var _0x1c8a9d=_0xa47a('0x67')+_[_0xa47a('0x68')]('logo');if(_0x390772[_0x1c8a9d]||!_0x12b2ef[_0xa47a('0x69')]){_0x52e333=path[_0xa47a('0x63')](config['root'],_0x125e0c,_[_0xa47a('0x65')](_0xa47a('0x66')));}if(!fs[_0xa47a('0x62')](_0x52e333)){throw new db[(_0xa47a('0x6a'))][(_0xa47a('0x6b'))](_[_0xa47a('0x68')](_0xa47a('0x5d'))+_0xa47a('0x6c'));}return _0xb76921[_0xa47a('0x6d')](_0x52e333);}})['catch'](handleError(_0xb76921,null));};var utilLicense=require(_0xa47a('0x17'));exports[_0xa47a('0x6e')]=function(_0x16f1c3,_0x2d62aa,_0x9d047b){var _0x5184b5=_0xa47a('0x5b');var _0x414d25={'custom':![]};return utilLicense[_0xa47a('0x5c')]()[_0xa47a('0x1d')](function(_0x44e84e){if(_0x44e84e){_0x414d25=_0x44e84e;}return db['Setting'][_0xa47a('0x57')]({'where':{'id':_0x16f1c3[_0xa47a('0x50')]['id']},'attributes':[_0xa47a('0x5d'),_0xa47a('0x59'),_0xa47a('0x5e'),_0xa47a('0x5f'),_0xa47a('0x6f'),'defaultLoginLogo',_0xa47a('0x70'),_0xa47a('0x61')],'raw':!![]});})[_0xa47a('0x1d')](handleEntityNotFound(_0x2d62aa,null))[_0xa47a('0x1d')](function(_0x2f1fb7){if(_0x2f1fb7){var _0x42a7b9=_0x2f1fb7[_0xa47a('0x59')]&&fs[_0xa47a('0x62')](path[_0xa47a('0x63')](config[_0xa47a('0x64')],_0x5184b5,_[_0xa47a('0x65')](_0x2f1fb7[_0xa47a('0x59')])))?path[_0xa47a('0x63')](config['root'],_0x5184b5,_[_0xa47a('0x65')](_0x2f1fb7[_0xa47a('0x59')])):path['join'](config[_0xa47a('0x64')],_0x5184b5,_[_0xa47a('0x65')]('default_loginLogo.svg'));var _0x5e8dcf=_0xa47a('0x67')+_[_0xa47a('0x68')]('loginLogo');if(_0x2f1fb7[_0x5e8dcf]||!_0x414d25[_0xa47a('0x69')]){_0x42a7b9=path[_0xa47a('0x63')](config[_0xa47a('0x64')],_0x5184b5,_[_0xa47a('0x65')](_0xa47a('0x71')));}if(!fs[_0xa47a('0x62')](_0x42a7b9)){throw new db[(_0xa47a('0x6a'))][(_0xa47a('0x6b'))](_['upperFirst'](_0xa47a('0x59'))+_0xa47a('0x6c'));}return _0x2d62aa[_0xa47a('0x6d')](_0x42a7b9);}})[_0xa47a('0x28')](handleError(_0x2d62aa,null));};exports[_0xa47a('0x72')]=function(_0xae9719,_0x33b255){return db[_0xa47a('0x38')]['find']({'where':{'id':_0xae9719['params']['id']},'attributes':['securePassword']})[_0xa47a('0x1d')](respondWithResult(_0x33b255,null))[_0xa47a('0x28')](handleError(_0x33b255,null));};exports[_0xa47a('0x73')]=function(_0x53a200,_0x4b3aa1,_0x13dfd4){if(_0x53a200[_0xa47a('0x55')]&&_0x53a200[_0xa47a('0x55')][_0xa47a('0x56')]){_0x53a200[_0xa47a('0x53')][_0xa47a('0x5e')]=_0x53a200[_0xa47a('0x55')][_0xa47a('0x56')];}return db['Setting'][_0xa47a('0x57')]({'where':{'id':_0x53a200['params']['id']}})[_0xa47a('0x1d')](handleEntityNotFound(_0x4b3aa1,null))[_0xa47a('0x1d')](saveUpdates(_0x53a200[_0xa47a('0x53')],null))[_0xa47a('0x1d')](respondWithResult(_0x4b3aa1,null))[_0xa47a('0x28')](handleError(_0x4b3aa1,null));};var utilLicense=require('../../config/license/util');exports[_0xa47a('0x74')]=function(_0xaead1a,_0x1f59f4,_0x3a61f0){var _0x4a7c6a=_0xa47a('0x5b');var _0x1eeb4b={'custom':![]};return utilLicense[_0xa47a('0x5c')]()[_0xa47a('0x1d')](function(_0x6feb99){if(_0x6feb99){_0x1eeb4b=_0x6feb99;}return db[_0xa47a('0x38')][_0xa47a('0x57')]({'where':{'id':_0xaead1a[_0xa47a('0x50')]['id']},'attributes':[_0xa47a('0x5d'),_0xa47a('0x59'),_0xa47a('0x5e'),_0xa47a('0x5f'),'defaultLogo',_0xa47a('0x60'),'defaultPreferred','defaultFavicon'],'raw':!![]});})[_0xa47a('0x1d')](handleEntityNotFound(_0x1f59f4,null))[_0xa47a('0x1d')](function(_0x12f443){if(_0x12f443){var _0x294293=_0x12f443['preferred']&&fs[_0xa47a('0x62')](path[_0xa47a('0x63')](config[_0xa47a('0x64')],_0x4a7c6a,_[_0xa47a('0x65')](_0x12f443[_0xa47a('0x5e')])))?path[_0xa47a('0x63')](config[_0xa47a('0x64')],_0x4a7c6a,_[_0xa47a('0x65')](_0x12f443[_0xa47a('0x5e')])):path['join'](config[_0xa47a('0x64')],_0x4a7c6a,_['toLower'](_0xa47a('0x75')));var _0x88d0da=_0xa47a('0x67')+_[_0xa47a('0x68')](_0xa47a('0x5e'));if(_0x12f443[_0x88d0da]||!_0x1eeb4b[_0xa47a('0x69')]||!_0x1eeb4b[_0xa47a('0x5e')]){_0x294293=path['join'](config[_0xa47a('0x64')],_0x4a7c6a,_[_0xa47a('0x65')](_0xa47a('0x75')));}if(!fs[_0xa47a('0x62')](_0x294293)){throw new db[(_0xa47a('0x6a'))]['ValidationError'](_[_0xa47a('0x68')](_0xa47a('0x5e'))+_0xa47a('0x6c'));}return _0x1f59f4[_0xa47a('0x6d')](_0x294293);}})[_0xa47a('0x28')](handleError(_0x1f59f4,null));};exports[_0xa47a('0x76')]=function(_0x52b01e,_0x24fbe5,_0x109539){if(_0x52b01e['file']&&_0x52b01e[_0xa47a('0x55')][_0xa47a('0x56')]){_0x52b01e[_0xa47a('0x53')][_0xa47a('0x5f')]=_0x52b01e[_0xa47a('0x55')][_0xa47a('0x56')];}return db['Setting'][_0xa47a('0x57')]({'where':{'id':_0x52b01e[_0xa47a('0x50')]['id']}})['then'](handleEntityNotFound(_0x24fbe5,null))[_0xa47a('0x1d')](saveUpdates(_0x52b01e[_0xa47a('0x53')],null))[_0xa47a('0x1d')](respondWithResult(_0x24fbe5,null))[_0xa47a('0x28')](handleError(_0x24fbe5,null));};var utilLicense=require('../../config/license/util');exports[_0xa47a('0x77')]=function(_0x2d69f,_0x2b73d5,_0x55d60a){var _0x23c405='server/files/images/logos';var _0x3ff479={'custom':![]};return utilLicense[_0xa47a('0x5c')]()[_0xa47a('0x1d')](function(_0x1fff6c){if(_0x1fff6c){_0x3ff479=_0x1fff6c;}return db['Setting'][_0xa47a('0x57')]({'where':{'id':_0x2d69f[_0xa47a('0x50')]['id']},'attributes':[_0xa47a('0x5d'),_0xa47a('0x59'),_0xa47a('0x5e'),_0xa47a('0x5f'),'defaultLogo',_0xa47a('0x60'),'defaultPreferred',_0xa47a('0x61')],'raw':!![]});})[_0xa47a('0x1d')](handleEntityNotFound(_0x2b73d5,null))['then'](function(_0x517e0b){if(_0x517e0b){var _0x535a87=_0x517e0b['favicon']&&fs[_0xa47a('0x62')](path[_0xa47a('0x63')](config['root'],_0x23c405,_[_0xa47a('0x65')](_0x517e0b[_0xa47a('0x5f')])))?path[_0xa47a('0x63')](config[_0xa47a('0x64')],_0x23c405,_[_0xa47a('0x65')](_0x517e0b['favicon'])):path[_0xa47a('0x63')](config['root'],_0x23c405,_['toLower'](_0xa47a('0x78')));var _0x32f1b9=_0xa47a('0x67')+_[_0xa47a('0x68')](_0xa47a('0x5f'));if(_0x517e0b[_0x32f1b9]||!_0x3ff479['custom']){_0x535a87=path[_0xa47a('0x63')](config[_0xa47a('0x64')],_0x23c405,_[_0xa47a('0x65')](_0xa47a('0x78')));}if(!fs['existsSync'](_0x535a87)){throw new db[(_0xa47a('0x6a'))][(_0xa47a('0x6b'))](_[_0xa47a('0x68')](_0xa47a('0x5f'))+_0xa47a('0x6c'));}return _0x2b73d5[_0xa47a('0x6d')](_0x535a87);}})[_0xa47a('0x28')](handleError(_0x2b73d5,null));};exports[_0xa47a('0x79')]=function(_0x198f8e,_0x292676){var _0x184981={'offset':moment()[_0xa47a('0x7a')]()};_0x184981[_0xa47a('0x7b')]=moment()[_0xa47a('0x7a')](_0x184981['offset'])['format']('YYYY-MM-DD\x20HH:mm:ss:SSS');return _0x292676['status'](0xc8)[_0xa47a('0x36')](_0x184981);}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index ab1c937..f936083 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 _0x008c=['define','settings','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./setting.attributes','exports'];(function(_0x475aa9,_0x439aab){var _0x360bbc=function(_0x331a22){while(--_0x331a22){_0x475aa9['push'](_0x475aa9['shift']());}};_0x360bbc(++_0x439aab);}(_0x008c,0x188));var _0xc008=function(_0x13eaae,_0x11ec0a){_0x13eaae=_0x13eaae-0x0;var _0x4493db=_0x008c[_0x13eaae];return _0x4493db;};'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 +var _0x008c=['define','settings','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./setting.attributes','exports'];(function(_0x1f9862,_0x1047d7){var _0x5c41b0=function(_0x4790a3){while(--_0x4790a3){_0x1f9862['push'](_0x1f9862['shift']());}};_0x5c41b0(++_0x1047d7);}(_0x008c,0x188));var _0xc008=function(_0x3a3c81,_0x253ca1){_0x3a3c81=_0x3a3c81-0x0;var _0x53acaf=_0x008c[_0x3a3c81];return _0x53acaf;};'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 8100634..5a672f9 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 _0x1174=['code','message','result','catch','ShowSetting','Setting','find','options','raw','where','attributes','include','model','map','then','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','Setting,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1174,0x10f));var _0x4117=function(_0x5387da,_0x5979fe){_0x5387da=_0x5387da-0x0;var _0x4f62f7=_0x1174[_0x5387da];return _0x4f62f7;};'use strict';var _=require('lodash');var util=require(_0x4117('0x0'));var moment=require(_0x4117('0x1'));var BPromise=require(_0x4117('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4117('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x4117('0x4'));var logger=require(_0x4117('0x5'))(_0x4117('0x6'));var config=require(_0x4117('0x7'));var jayson=require(_0x4117('0x8'));var client=jayson[_0x4117('0x9')][_0x4117('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4e113c,_0x56ce85,_0x535ba9){return new BPromise(function(_0x16e55b,_0x934e1c){return client[_0x4117('0xb')](_0x4e113c,_0x535ba9)['then'](function(_0x32220e){logger[_0x4117('0xc')](_0x4117('0xd'),_0x56ce85,_0x4117('0xe'));logger['debug']('Setting,\x20%s,\x20%s,\x20%s',_0x56ce85,'request\x20sent',JSON[_0x4117('0xf')](_0x32220e));if(_0x32220e[_0x4117('0x10')]){if(_0x32220e[_0x4117('0x10')][_0x4117('0x11')]===0x1f4){logger[_0x4117('0x10')]('Setting,\x20%s,\x20%s',_0x56ce85,_0x32220e[_0x4117('0x10')][_0x4117('0x12')]);return _0x934e1c(_0x32220e[_0x4117('0x10')]['message']);}logger['error'](_0x4117('0xd'),_0x56ce85,_0x32220e[_0x4117('0x10')][_0x4117('0x12')]);return _0x16e55b(_0x32220e[_0x4117('0x10')][_0x4117('0x12')]);}else{logger[_0x4117('0xc')]('Setting,\x20%s,\x20%s',_0x56ce85,_0x4117('0xe'));_0x16e55b(_0x32220e[_0x4117('0x13')][_0x4117('0x12')]);}})[_0x4117('0x14')](function(_0x433f70){logger[_0x4117('0x10')]('Setting,\x20%s,\x20%s',_0x56ce85,_0x433f70);_0x934e1c(_0x433f70);});});}exports[_0x4117('0x15')]=function(_0x5784fe){var _0x49d703=this;return new Promise(function(_0x590735,_0x114395){return db[_0x4117('0x16')][_0x4117('0x17')]({'raw':_0x5784fe[_0x4117('0x18')]?_0x5784fe[_0x4117('0x18')][_0x4117('0x19')]===undefined?!![]:![]:!![],'where':_0x5784fe['options']?_0x5784fe[_0x4117('0x18')][_0x4117('0x1a')]||null:null,'attributes':_0x5784fe['options']?_0x5784fe[_0x4117('0x18')][_0x4117('0x1b')]||null:null,'include':_0x5784fe['options']?_0x5784fe[_0x4117('0x18')][_0x4117('0x1c')]?_['map'](_0x5784fe['options']['include'],function(_0x1a9677){return{'model':db[_0x1a9677[_0x4117('0x1d')]],'as':_0x1a9677['as'],'attributes':_0x1a9677[_0x4117('0x1b')],'include':_0x1a9677['include']?_[_0x4117('0x1e')](_0x1a9677['include'],function(_0x1a19b9){return{'model':db[_0x1a19b9[_0x4117('0x1d')]],'as':_0x1a19b9['as'],'attributes':_0x1a19b9[_0x4117('0x1b')],'include':_0x1a19b9['include']?_['map'](_0x1a19b9[_0x4117('0x1c')],function(_0x45e294){return{'model':db[_0x45e294[_0x4117('0x1d')]],'as':_0x45e294['as'],'attributes':_0x45e294[_0x4117('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x4117('0x1f')](function(_0x38dd09){logger['info'](_0x4117('0x15'),_0x5784fe);logger['debug'](_0x4117('0x15'),_0x5784fe,JSON['stringify'](_0x38dd09));_0x590735(_0x38dd09);})['catch'](function(_0x256835){logger[_0x4117('0x10')](_0x4117('0x15'),_0x256835[_0x4117('0x12')],_0x5784fe);_0x114395(_0x49d703['error'](0x1f4,_0x256835[_0x4117('0x12')]));});});}; \ No newline at end of file +var _0xb8e2=['options','raw','where','attributes','include','map','model','moment','bluebird','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Setting,\x20%s,\x20%s','debug','Setting,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','ShowSetting','find'];(function(_0x5b5eb4,_0x117c87){var _0x42af53=function(_0xdf6fcb){while(--_0xdf6fcb){_0x5b5eb4['push'](_0x5b5eb4['shift']());}};_0x42af53(++_0x117c87);}(_0xb8e2,0xe7));var _0x2b8e=function(_0x1a8bbc,_0x17a086){_0x1a8bbc=_0x1a8bbc-0x0;var _0x212fc2=_0xb8e2[_0x1a8bbc];return _0x212fc2;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x2b8e('0x0'));var BPromise=require(_0x2b8e('0x1'));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(_0x2b8e('0x2'))(_0x2b8e('0x3'));var config=require(_0x2b8e('0x4'));var jayson=require(_0x2b8e('0x5'));var client=jayson['client'][_0x2b8e('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x2ff3b6,_0x1c4245,_0x4a6d71){return new BPromise(function(_0x5a28f4,_0x1d9a6f){return client[_0x2b8e('0x7')](_0x2ff3b6,_0x4a6d71)[_0x2b8e('0x8')](function(_0x564e0e){logger[_0x2b8e('0x9')](_0x2b8e('0xa'),_0x1c4245,'request\x20sent');logger[_0x2b8e('0xb')](_0x2b8e('0xc'),_0x1c4245,_0x2b8e('0xd'),JSON[_0x2b8e('0xe')](_0x564e0e));if(_0x564e0e[_0x2b8e('0xf')]){if(_0x564e0e[_0x2b8e('0xf')]['code']===0x1f4){logger[_0x2b8e('0xf')]('Setting,\x20%s,\x20%s',_0x1c4245,_0x564e0e['error']['message']);return _0x1d9a6f(_0x564e0e[_0x2b8e('0xf')][_0x2b8e('0x10')]);}logger['error']('Setting,\x20%s,\x20%s',_0x1c4245,_0x564e0e[_0x2b8e('0xf')][_0x2b8e('0x10')]);return _0x5a28f4(_0x564e0e[_0x2b8e('0xf')][_0x2b8e('0x10')]);}else{logger[_0x2b8e('0x9')]('Setting,\x20%s,\x20%s',_0x1c4245,_0x2b8e('0xd'));_0x5a28f4(_0x564e0e[_0x2b8e('0x11')][_0x2b8e('0x10')]);}})[_0x2b8e('0x12')](function(_0x19b548){logger[_0x2b8e('0xf')](_0x2b8e('0xa'),_0x1c4245,_0x19b548);_0x1d9a6f(_0x19b548);});});}exports[_0x2b8e('0x13')]=function(_0x5ae44d){var _0x3dec07=this;return new Promise(function(_0x528b44,_0x33cf36){return db['Setting'][_0x2b8e('0x14')]({'raw':_0x5ae44d['options']?_0x5ae44d[_0x2b8e('0x15')][_0x2b8e('0x16')]===undefined?!![]:![]:!![],'where':_0x5ae44d[_0x2b8e('0x15')]?_0x5ae44d['options'][_0x2b8e('0x17')]||null:null,'attributes':_0x5ae44d['options']?_0x5ae44d[_0x2b8e('0x15')][_0x2b8e('0x18')]||null:null,'include':_0x5ae44d[_0x2b8e('0x15')]?_0x5ae44d['options'][_0x2b8e('0x19')]?_[_0x2b8e('0x1a')](_0x5ae44d['options'][_0x2b8e('0x19')],function(_0x8c15ed){return{'model':db[_0x8c15ed[_0x2b8e('0x1b')]],'as':_0x8c15ed['as'],'attributes':_0x8c15ed[_0x2b8e('0x18')],'include':_0x8c15ed[_0x2b8e('0x19')]?_[_0x2b8e('0x1a')](_0x8c15ed[_0x2b8e('0x19')],function(_0x20a83f){return{'model':db[_0x20a83f[_0x2b8e('0x1b')]],'as':_0x20a83f['as'],'attributes':_0x20a83f[_0x2b8e('0x18')],'include':_0x20a83f[_0x2b8e('0x19')]?_[_0x2b8e('0x1a')](_0x20a83f[_0x2b8e('0x19')],function(_0x5f06b0){return{'model':db[_0x5f06b0['model']],'as':_0x5f06b0['as'],'attributes':_0x5f06b0[_0x2b8e('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x15368b){logger[_0x2b8e('0x9')](_0x2b8e('0x13'),_0x5ae44d);logger['debug'](_0x2b8e('0x13'),_0x5ae44d,JSON[_0x2b8e('0xe')](_0x15368b));_0x528b44(_0x15368b);})['catch'](function(_0x128bf2){logger['error'](_0x2b8e('0x13'),_0x128bf2[_0x2b8e('0x10')],_0x5ae44d);_0x33cf36(_0x3dec07['error'](0x1f4,_0x128bf2['message']));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index 95429c9..b7ab4bf 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 _0xabce=['/:id/users','getAgents','create','post','addAnswer','/:id/notify','notify','/:id/send','send','status','addAgents','put','update','delete','/:id','destroy','removeDispositions','removeAnswers','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/status'];(function(_0x3383f0,_0x8736c0){var _0x14e0fc=function(_0x372922){while(--_0x372922){_0x3383f0['push'](_0x3383f0['shift']());}};_0x14e0fc(++_0x8736c0);}(_0xabce,0x103));var _0xeabc=function(_0x363ef8,_0x4ecb1a){_0x363ef8=_0x363ef8-0x0;var _0x148822=_0xabce[_0x363ef8];return _0x148822;};'use strict';var multer=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var path=require(_0xeabc('0x2'));var timeout=require(_0xeabc('0x3'));var express=require(_0xeabc('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xeabc('0x5'));var interaction=require(_0xeabc('0x6'));var config=require(_0xeabc('0x7'));var controller=require('./smsAccount.controller');router['get']('/',auth[_0xeabc('0x8')](),controller['index']);router[_0xeabc('0x9')]('/describe',auth[_0xeabc('0x8')](),controller[_0xeabc('0xa')]);router[_0xeabc('0x9')]('/:id',auth[_0xeabc('0x8')](),controller[_0xeabc('0xb')]);router[_0xeabc('0x9')](_0xeabc('0xc'),auth[_0xeabc('0x8')](),controller[_0xeabc('0xd')]);router[_0xeabc('0x9')](_0xeabc('0xe'),auth[_0xeabc('0x8')](),controller[_0xeabc('0xf')]);router[_0xeabc('0x9')](_0xeabc('0x10'),auth[_0xeabc('0x8')](),controller[_0xeabc('0x11')]);router[_0xeabc('0x9')](_0xeabc('0x12'),auth['isAuthenticated'](),controller[_0xeabc('0x13')]);router[_0xeabc('0x9')](_0xeabc('0x14'),controller['statusGet']);router['get'](_0xeabc('0x15'),auth[_0xeabc('0x8')](),controller[_0xeabc('0x16')]);router['post']('/',auth[_0xeabc('0x8')](),controller[_0xeabc('0x17')]);router['post']('/:id/dispositions',auth[_0xeabc('0x8')](),controller['addDisposition']);router[_0xeabc('0x18')](_0xeabc('0xe'),auth[_0xeabc('0x8')](),controller[_0xeabc('0x19')]);router[_0xeabc('0x18')](_0xeabc('0x1a'),controller[_0xeabc('0x1b')]);router[_0xeabc('0x18')]('/:id/applications',auth[_0xeabc('0x8')](),controller['addApplications']);router[_0xeabc('0x18')](_0xeabc('0x1c'),auth['isAuthenticated'](),controller[_0xeabc('0x1d')]);router[_0xeabc('0x18')](_0xeabc('0x14'),controller[_0xeabc('0x1e')]);router[_0xeabc('0x18')]('/:id/users',auth[_0xeabc('0x8')](),controller[_0xeabc('0x1f')]);router[_0xeabc('0x20')]('/:id',auth[_0xeabc('0x8')](),controller[_0xeabc('0x21')]);router[_0xeabc('0x22')](_0xeabc('0x23'),auth['isAuthenticated'](),controller[_0xeabc('0x24')]);router['delete'](_0xeabc('0xc'),auth['isAuthenticated'](),controller[_0xeabc('0x25')]);router[_0xeabc('0x22')](_0xeabc('0xe'),auth[_0xeabc('0x8')](),controller[_0xeabc('0x26')]);router[_0xeabc('0x22')](_0xeabc('0x15'),auth['isAuthenticated'](),controller['removeAgents']);module[_0xeabc('0x27')]=router; \ No newline at end of file +var _0xc4aa=['statusGet','/:id/users','getAgents','post','addDisposition','addAnswer','notify','addApplications','/:id/send','send','status','put','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','./smsAccount.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/status'];(function(_0x55b707,_0x4b0113){var _0x19f4ef=function(_0xee9f51){while(--_0xee9f51){_0x55b707['push'](_0x55b707['shift']());}};_0x19f4ef(++_0x4b0113);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x1e4360,_0x930b9b){_0x1e4360=_0x1e4360-0x0;var _0x31e6b4=_0xc4aa[_0x1e4360];return _0x31e6b4;};'use strict';var multer=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var path=require(_0xac4a('0x2'));var timeout=require(_0xac4a('0x3'));var express=require(_0xac4a('0x4'));var router=express[_0xac4a('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xac4a('0x6'));var controller=require(_0xac4a('0x7'));router[_0xac4a('0x8')]('/',auth[_0xac4a('0x9')](),controller[_0xac4a('0xa')]);router[_0xac4a('0x8')](_0xac4a('0xb'),auth[_0xac4a('0x9')](),controller['describe']);router['get'](_0xac4a('0xc'),auth[_0xac4a('0x9')](),controller[_0xac4a('0xd')]);router['get'](_0xac4a('0xe'),auth[_0xac4a('0x9')](),controller[_0xac4a('0xf')]);router['get'](_0xac4a('0x10'),auth['isAuthenticated'](),controller[_0xac4a('0x11')]);router['get'](_0xac4a('0x12'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x13')]);router['get'](_0xac4a('0x14'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x15')]);router[_0xac4a('0x8')](_0xac4a('0x16'),controller[_0xac4a('0x17')]);router[_0xac4a('0x8')](_0xac4a('0x18'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x19')]);router[_0xac4a('0x1a')]('/',auth[_0xac4a('0x9')](),controller['create']);router[_0xac4a('0x1a')](_0xac4a('0xe'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x1b')]);router[_0xac4a('0x1a')](_0xac4a('0x10'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x1c')]);router['post']('/:id/notify',controller[_0xac4a('0x1d')]);router[_0xac4a('0x1a')](_0xac4a('0x12'),auth['isAuthenticated'](),controller[_0xac4a('0x1e')]);router[_0xac4a('0x1a')](_0xac4a('0x1f'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x20')]);router[_0xac4a('0x1a')](_0xac4a('0x16'),controller[_0xac4a('0x21')]);router['post'](_0xac4a('0x18'),auth[_0xac4a('0x9')](),controller['addAgents']);router[_0xac4a('0x22')](_0xac4a('0xc'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x23')]);router['delete'](_0xac4a('0xc'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x24')]);router[_0xac4a('0x25')](_0xac4a('0xe'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x26')]);router[_0xac4a('0x25')](_0xac4a('0x10'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x27')]);router[_0xac4a('0x25')](_0xac4a('0x18'),auth[_0xac4a('0x9')](),controller[_0xac4a('0x28')]);module[_0xac4a('0x29')]=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index 8896460..687c3ee 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 _0xce74=['mandatoryDisposition','sequelize','randomstring','exports','STRING','generate','ENUM','twilio','connectel','clicksend','clickatell','csc','infobip','intelepeer','BOOLEAN','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId'];(function(_0x37fa88,_0x3f39bd){var _0x4c1bef=function(_0x2a0d04){while(--_0x2a0d04){_0x37fa88['push'](_0x37fa88['shift']());}};_0x4c1bef(++_0x3f39bd);}(_0xce74,0x155));var _0x4ce7=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xce74[_0x1facfa];return _0x9ec701;};'use strict';var Sequelize=require(_0x4ce7('0x0'));var rs=require(_0x4ce7('0x1'));module[_0x4ce7('0x2')]={'name':{'type':Sequelize[_0x4ce7('0x3')],'unique':'name','allowNull':![]},'key':{'type':Sequelize[_0x4ce7('0x3')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize[_0x4ce7('0x3')],'defaultValue':function(){return rs[_0x4ce7('0x4')]();}},'phone':{'type':Sequelize[_0x4ce7('0x3')]},'type':{'type':Sequelize[_0x4ce7('0x5')](_0x4ce7('0x6'),'skebby',_0x4ce7('0x7'),_0x4ce7('0x8'),'plivo',_0x4ce7('0x9'),'bandwidth',_0x4ce7('0xa'),_0x4ce7('0xb'),_0x4ce7('0xc'))},'accountSid':{'type':Sequelize[_0x4ce7('0x3')]},'authId':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0x4ce7('0x3')]},'smsMethod':{'type':Sequelize['ENUM']('SI','TI','GP')},'username':{'type':Sequelize[_0x4ce7('0x3')]},'password':{'type':Sequelize['STRING']},'apiKey':{'type':Sequelize[_0x4ce7('0x3')]},'applicationId':{'type':Sequelize[_0x4ce7('0x3')]},'accountId':{'type':Sequelize[_0x4ce7('0x3')]},'senderString':{'type':Sequelize[_0x4ce7('0x3')]},'deliveryReport':{'type':Sequelize[_0x4ce7('0xd')],'defaultValue':![]},'description':{'type':Sequelize[_0x4ce7('0x3')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x4ce7('0xe');}},'notificationSound':{'type':Sequelize[_0x4ce7('0xd')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x4ce7('0xd')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x4ce7('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x4ce7('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x4ce7('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize['STRING']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x4ce7('0xf')],'comment':_0x4ce7('0x10')},'mandatoryDisposition':{'type':Sequelize[_0x4ce7('0xd')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x331b89){if(!_0x331b89)this[_0x4ce7('0x11')](_0x4ce7('0x12'),null);this[_0x4ce7('0x11')](_0x4ce7('0x13'),_0x331b89);}}}; \ No newline at end of file +var _0x4594=['plivo','csc','intelepeer','ENUM','BOOLEAN','TEXT','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','randomstring','exports','STRING','twilio','skebby','clicksend'];(function(_0x27031e,_0x1eb8cd){var _0xfd46b3=function(_0x9fdcf8){while(--_0x9fdcf8){_0x27031e['push'](_0x27031e['shift']());}};_0xfd46b3(++_0x1eb8cd);}(_0x4594,0x11a));var _0x4459=function(_0x4c7982,_0x5c041a){_0x4c7982=_0x4c7982-0x0;var _0x1735af=_0x4594[_0x4c7982];return _0x1735af;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x4459('0x0'));module[_0x4459('0x1')]={'name':{'type':Sequelize[_0x4459('0x2')],'unique':'name','allowNull':![]},'key':{'type':Sequelize[_0x4459('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0x4459('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0x4459('0x2')],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize[_0x4459('0x2')]},'type':{'type':Sequelize['ENUM'](_0x4459('0x3'),_0x4459('0x4'),'connectel',_0x4459('0x5'),_0x4459('0x6'),'clickatell','bandwidth',_0x4459('0x7'),'infobip',_0x4459('0x8'))},'accountSid':{'type':Sequelize['STRING']},'authId':{'type':Sequelize[_0x4459('0x2')]},'authToken':{'type':Sequelize['STRING']},'smsMethod':{'type':Sequelize[_0x4459('0x9')]('SI','TI','GP')},'username':{'type':Sequelize[_0x4459('0x2')]},'password':{'type':Sequelize[_0x4459('0x2')]},'apiKey':{'type':Sequelize['STRING']},'applicationId':{'type':Sequelize[_0x4459('0x2')]},'accountId':{'type':Sequelize[_0x4459('0x2')]},'senderString':{'type':Sequelize[_0x4459('0x2')]},'deliveryReport':{'type':Sequelize[_0x4459('0xa')],'defaultValue':![]},'description':{'type':Sequelize[_0x4459('0x2')]},'notificationTemplate':{'type':Sequelize[_0x4459('0xb')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x4459('0xa')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x4459('0xa')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x4459('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x4459('0xa')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x4459('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x4459('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x4459('0x2')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x4459('0xc')],'comment':_0x4459('0xd')},'mandatoryDisposition':{'type':Sequelize[_0x4459('0xa')],'defaultValue':![],'comment':_0x4459('0xe'),'set':function(_0x53a68f){if(!_0x53a68f)this[_0x4459('0xf')](_0x4459('0x10'),null);this[_0x4459('0xf')](_0x4459('0x11'),_0x53a68f);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index 721f4f9..b2124d5 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 _0x82c1=['count','set','Content-Range','json','apply','reject','save','update','destroy','SmsAccounts','UserProfileResource','sendStatus','stack','Pause','mandatoryDispositionPause','map','SmsAccount','rawAttributes','fieldName','type','model','name','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','show','user','get','UserProfileSection','find','userProfileId','autoAssociation','create','body','params','addDisposition','SmsAccountId','Disposition','getDispositions','findOne','hasOwnProperty','rows','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','account','applications','priority','asc','Applications','CmContact','describe','Sequelize','ValidationError','createdAt','updatedAt','difference','ListId','twilio','from','Body','messageId','MessageSid','skebby','sender','text','clicksend','message_id','Text','results','csc','originatingAddress','segmentedMessage','clickatell','replyMessageId','intelepeer','refid','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','list','omit','SmsInteraction','spread','autoclose','push','close','unmanaged','*,*,*,*','interaction','created','SmsMessage','ContactId','UserId','User','agent','waitForTheAssignedAgent','Start','startRouting','SmsAccount,\x20%s,\x20%s,\x20%s','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','entity\x20found','stringify','text/xml','send','\x0a','addApplications','sequelize','transaction','SmsApplication','findAndCountAll','getApplications','getInteractions','Contact','fullname','internal','Tag','Tags','color','tag','to\x20is\x20mandatory','List','out','Messages','dataValues','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','statusInt','requestid','status_code','groupName','bandwidth','redif','DELIVERED','connectel','error_code','infobip','DELIVERED_TO_GATEWAY','message-delivered','DELIVRD','ACCEPTD','state','message-id','addAgents','emit','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','defaults','redis','localhost','socket.io-emitter','./smsAccount.socket','register','client','http','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','status','end','offset','undefined','limit'];(function(_0x3c5e6b,_0x31674d){var _0x2c33ba=function(_0x55b146){while(--_0x55b146){_0x3c5e6b['push'](_0x3c5e6b['shift']());}};_0x2c33ba(++_0x31674d);}(_0x82c1,0xae));var _0x182c=function(_0x35e1a3,_0xd37ecc){_0x35e1a3=_0x35e1a3-0x0;var _0x24312d=_0x82c1[_0x35e1a3];return _0x24312d;};'use strict';var emlformat=require(_0x182c('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x182c('0x1'));var rp=require(_0x182c('0x2'));var moment=require(_0x182c('0x3'));var BPromise=require(_0x182c('0x4'));var Mustache=require(_0x182c('0x5'));var util=require(_0x182c('0x6'));var path=require(_0x182c('0x7'));var sox=require('sox');var csv=require(_0x182c('0x8'));var ejs=require(_0x182c('0x9'));var fs=require('fs');var fs_extra=require(_0x182c('0xa'));var _=require(_0x182c('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x182c('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x182c('0x8'));var querystring=require(_0x182c('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x182c('0xe'));var qs=require(_0x182c('0xf'));var as=require(_0x182c('0x10'));var hardwareService=require(_0x182c('0x11'));var logger=require(_0x182c('0x12'))(_0x182c('0x13'));var utils=require(_0x182c('0x14'));var config=require(_0x182c('0x15'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_[_0x182c('0x16')](config[_0x182c('0x17')],{'host':_0x182c('0x18'),'port':0x18eb});var socket=require(_0x182c('0x19'))(new Redis(config['redis']));require(_0x182c('0x1a'))[_0x182c('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson[_0x182c('0x1c')][_0x182c('0x1d')]({'port':0x232c});function respondWithRpcPromise(_0xce0f8f,_0x240b6c,_0x35a420,_0x1c05c5){return new BPromise(function(_0x241df4,_0x372fdf){var _0x3f34c4=_0x1c05c5||client;return _0x3f34c4['request'](_0xce0f8f,_0x35a420)[_0x182c('0x1e')](function(_0x486f33){logger[_0x182c('0x1f')](_0x182c('0x20'),_0x240b6c,_0x182c('0x21'));logger[_0x182c('0x22')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x240b6c,'request\x20sent',JSON['stringify'](_0x486f33));if(_0x486f33[_0x182c('0x23')]){if(_0x486f33['error'][_0x182c('0x24')]===0x1f4){logger[_0x182c('0x23')](_0x182c('0x20'),_0x240b6c,_0x486f33[_0x182c('0x23')][_0x182c('0x25')]);return _0x372fdf(_0x486f33[_0x182c('0x23')]['message']);}logger[_0x182c('0x23')](_0x182c('0x20'),_0x240b6c,_0x486f33['error'][_0x182c('0x25')]);return _0x241df4(_0x486f33[_0x182c('0x23')][_0x182c('0x25')]);}else{logger[_0x182c('0x1f')](_0x182c('0x20'),_0x240b6c,_0x182c('0x21'));_0x241df4(_0x486f33[_0x182c('0x26')][_0x182c('0x25')]);}})[_0x182c('0x27')](function(_0x32b8b8){logger['error'](_0x182c('0x20'),_0x240b6c,_0x32b8b8);_0x372fdf(_0x32b8b8);});});}function respondWithStatusCode(_0x3b2aaa,_0x3c56d7){_0x3c56d7=_0x3c56d7||0xcc;return function(_0x46f91e){if(_0x46f91e){return _0x3b2aaa['sendStatus'](_0x3c56d7);}return _0x3b2aaa[_0x182c('0x28')](_0x3c56d7)[_0x182c('0x29')]();};}function respondWithResult(_0x25fc10,_0x4b84a3){_0x4b84a3=_0x4b84a3||0xc8;return function(_0x2d6ef3){if(_0x2d6ef3){return _0x25fc10[_0x182c('0x28')](_0x4b84a3)['json'](_0x2d6ef3);}};}function respondWithFilteredResult(_0x2e09c3,_0x5632d4){return function(_0x336857){if(_0x336857){var _0x1bdee4=typeof _0x5632d4[_0x182c('0x2a')]===_0x182c('0x2b')&&typeof _0x5632d4[_0x182c('0x2c')]===_0x182c('0x2b');var _0x232062=_0x336857['count'];var _0x1bbf9b=_0x1bdee4?0x0:_0x5632d4['offset'];var _0x4831e8=_0x1bdee4?_0x336857[_0x182c('0x2d')]:_0x5632d4[_0x182c('0x2a')]+_0x5632d4['limit'];var _0x4dbae1;if(_0x4831e8>=_0x232062){_0x4831e8=_0x232062;_0x4dbae1=0xc8;}else{_0x4dbae1=0xce;}_0x2e09c3[_0x182c('0x28')](_0x4dbae1);return _0x2e09c3[_0x182c('0x2e')](_0x182c('0x2f'),_0x1bbf9b+'-'+_0x4831e8+'/'+_0x232062)[_0x182c('0x30')](_0x336857);}return null;};}function patchUpdates(_0x2310ad){return function(_0x1fdd17){try{jsonpatch[_0x182c('0x31')](_0x1fdd17,_0x2310ad,!![]);}catch(_0x59a185){return BPromise[_0x182c('0x32')](_0x59a185);}return _0x1fdd17[_0x182c('0x33')]();};}function saveUpdates(_0x57b082,_0x5debec){return function(_0x1fdf2d){if(_0x1fdf2d){return _0x1fdf2d[_0x182c('0x34')](_0x57b082)['then'](function(_0x2d8648){return _0x2d8648;});}return null;};}function removeEntity(_0xe684ff,_0x23d26a){return function(_0x537a2d){if(_0x537a2d){return _0x537a2d[_0x182c('0x35')]()['then'](function(){var _0x260e3f=_0x537a2d['get']({'plain':!![]});var _0x3b0f92=_0x182c('0x36');return db[_0x182c('0x37')]['destroy']({'where':{'type':_0x3b0f92,'resourceId':_0x260e3f['id']}})[_0x182c('0x1e')](function(){return _0x537a2d;});})[_0x182c('0x1e')](function(){_0xe684ff['status'](0xcc)[_0x182c('0x29')]();});}};}function handleEntityNotFound(_0xccd354,_0x20b032){return function(_0x4b588c){if(!_0x4b588c){_0xccd354[_0x182c('0x38')](0x194);}return _0x4b588c;};}function handleError(_0x185a20,_0x3b50ac){_0x3b50ac=_0x3b50ac||0x1f4;return function(_0x3e26f0){logger[_0x182c('0x23')](_0x3e26f0[_0x182c('0x39')]);if(_0x3e26f0['name']){delete _0x3e26f0['name'];}_0x185a20[_0x182c('0x28')](_0x3b50ac)['send'](_0x3e26f0);};}exports['index']=function(_0x3da1e9,_0x13e94e){var _0xeb0bf7={'include':[{'model':db[_0x182c('0x3a')],'as':_0x182c('0x3b')}]},_0x13dbc6={},_0x4725e4={'count':0x0,'rows':[]};var _0x34dc15=_[_0x182c('0x3c')](db[_0x182c('0x3d')][_0x182c('0x3e')],function(_0x2b4982){return{'name':_0x2b4982[_0x182c('0x3f')],'type':_0x2b4982[_0x182c('0x40')]['key']};});_0x13dbc6[_0x182c('0x41')]=_['map'](_0x34dc15,_0x182c('0x42'));_0x13dbc6[_0x182c('0x43')]=_[_0x182c('0x44')](_0x3da1e9['query']);_0x13dbc6[_0x182c('0x45')]=_[_0x182c('0x46')](_0x13dbc6['model'],_0x13dbc6[_0x182c('0x43')]);_0xeb0bf7['attributes']=_[_0x182c('0x46')](_0x13dbc6[_0x182c('0x41')],qs[_0x182c('0x47')](_0x3da1e9[_0x182c('0x43')][_0x182c('0x47')]));_0xeb0bf7['attributes']=_0xeb0bf7[_0x182c('0x48')][_0x182c('0x49')]?_0xeb0bf7[_0x182c('0x48')]:_0x13dbc6['model'];if(!_0x3da1e9[_0x182c('0x43')]['hasOwnProperty'](_0x182c('0x4a'))){_0xeb0bf7[_0x182c('0x2c')]=qs[_0x182c('0x2c')](_0x3da1e9[_0x182c('0x43')][_0x182c('0x2c')]);_0xeb0bf7['offset']=qs[_0x182c('0x2a')](_0x3da1e9[_0x182c('0x43')]['offset']);}_0xeb0bf7[_0x182c('0x4b')]=qs[_0x182c('0x4c')](_0x3da1e9['query'][_0x182c('0x4c')]);_0xeb0bf7[_0x182c('0x4d')]=qs[_0x182c('0x45')](_[_0x182c('0x4e')](_0x3da1e9[_0x182c('0x43')],_0x13dbc6['filters']),_0x34dc15);if(_0x3da1e9['query'][_0x182c('0x4f')]){_0xeb0bf7[_0x182c('0x4d')]=_[_0x182c('0x50')](_0xeb0bf7[_0x182c('0x4d')],{'$or':_['map'](_0x34dc15,function(_0x355714){if(_0x355714[_0x182c('0x40')]!=='VIRTUAL'){var _0x42d37b={};_0x42d37b[_0x355714[_0x182c('0x42')]]={'$like':'%'+_0x3da1e9[_0x182c('0x43')][_0x182c('0x4f')]+'%'};return _0x42d37b;}})});}_0xeb0bf7=_['merge']({},_0xeb0bf7,_0x3da1e9[_0x182c('0x51')]);var _0x27f7d7={'where':_0xeb0bf7[_0x182c('0x4d')]};return db[_0x182c('0x3d')][_0x182c('0x2d')](_0x27f7d7)[_0x182c('0x1e')](function(_0x47dd75){_0x4725e4[_0x182c('0x2d')]=_0x47dd75;if(_0x3da1e9[_0x182c('0x43')][_0x182c('0x52')]){_0xeb0bf7[_0x182c('0x53')]=[{'all':!![]}];}return db['SmsAccount'][_0x182c('0x54')](_0xeb0bf7);})[_0x182c('0x1e')](function(_0x3e314f){_0x4725e4['rows']=_0x3e314f;return _0x4725e4;})['then'](respondWithFilteredResult(_0x13e94e,_0xeb0bf7))[_0x182c('0x27')](handleError(_0x13e94e,null));};exports[_0x182c('0x55')]=function(_0x443023,_0x576291){var _0x168f15={'raw':![],'where':{'id':_0x443023['params']['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0xe2ebb4={};_0xe2ebb4[_0x182c('0x41')]=_['keys'](db[_0x182c('0x3d')][_0x182c('0x3e')]);_0xe2ebb4[_0x182c('0x43')]=_[_0x182c('0x44')](_0x443023[_0x182c('0x43')]);_0xe2ebb4[_0x182c('0x45')]=_['intersection'](_0xe2ebb4['model'],_0xe2ebb4[_0x182c('0x43')]);_0x168f15[_0x182c('0x48')]=_[_0x182c('0x46')](_0xe2ebb4[_0x182c('0x41')],qs[_0x182c('0x47')](_0x443023[_0x182c('0x43')][_0x182c('0x47')]));_0x168f15[_0x182c('0x48')]=_0x168f15[_0x182c('0x48')]['length']?_0x168f15[_0x182c('0x48')]:_0xe2ebb4[_0x182c('0x41')];if(_0x443023[_0x182c('0x43')][_0x182c('0x52')]){_0x168f15[_0x182c('0x53')]=[{'all':!![]}];}_0x168f15=_['merge']({},_0x168f15,_0x443023['options']);return db[_0x182c('0x3d')]['find'](_0x168f15)[_0x182c('0x1e')](handleEntityNotFound(_0x576291,null))[_0x182c('0x1e')](respondWithResult(_0x576291,null))[_0x182c('0x27')](handleError(_0x576291,null));};exports['create']=function(_0x58aa67,_0x4fe440){return db['SmsAccount']['create'](_0x58aa67['body'],{})[_0x182c('0x1e')](function(_0x99d9a0){var _0x7605b=_0x58aa67[_0x182c('0x56')][_0x182c('0x57')]({'plain':!![]});if(!_0x7605b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x7605b['role']==='user'){var _0x1d5c84=_0x99d9a0[_0x182c('0x57')]({'plain':!![]});var _0x11f67a=_0x182c('0x36');return db[_0x182c('0x58')][_0x182c('0x59')]({'where':{'name':_0x11f67a,'userProfileId':_0x7605b[_0x182c('0x5a')]},'raw':!![]})[_0x182c('0x1e')](function(_0x7caef7){if(_0x7caef7&&_0x7caef7[_0x182c('0x5b')]===0x0){return db[_0x182c('0x37')][_0x182c('0x5c')]({'name':_0x1d5c84[_0x182c('0x42')],'resourceId':_0x1d5c84['id'],'type':_0x7caef7[_0x182c('0x42')],'sectionId':_0x7caef7['id']},{})[_0x182c('0x1e')](function(){return _0x99d9a0;});}else{return _0x99d9a0;}})[_0x182c('0x27')](function(_0x20a36c){logger[_0x182c('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x20a36c);throw _0x20a36c;});}return _0x99d9a0;})[_0x182c('0x1e')](respondWithResult(_0x4fe440,0xc9))['catch'](handleError(_0x4fe440,null));};exports[_0x182c('0x34')]=function(_0x51c540,_0x24a1ff){if(_0x51c540['body']['id']){delete _0x51c540[_0x182c('0x5d')]['id'];}return db[_0x182c('0x3d')][_0x182c('0x59')]({'where':{'id':_0x51c540[_0x182c('0x5e')]['id']},'include':[{'model':db[_0x182c('0x3a')],'as':_0x182c('0x3b')}]})['then'](handleEntityNotFound(_0x24a1ff,null))['then'](saveUpdates(_0x51c540[_0x182c('0x5d')],null))['then'](respondWithResult(_0x24a1ff,null))[_0x182c('0x27')](handleError(_0x24a1ff,null));};exports[_0x182c('0x35')]=function(_0x43e237,_0x18f9a9){return db[_0x182c('0x3d')][_0x182c('0x59')]({'where':{'id':_0x43e237[_0x182c('0x5e')]['id']}})[_0x182c('0x1e')](handleEntityNotFound(_0x18f9a9,null))[_0x182c('0x1e')](removeEntity(_0x18f9a9,null))[_0x182c('0x27')](handleError(_0x18f9a9,null));};exports['describe']=function(_0xe18f91,_0xbd22f1){return db[_0x182c('0x3d')]['describe']()[_0x182c('0x1e')](respondWithResult(_0xbd22f1,null))[_0x182c('0x27')](handleError(_0xbd22f1,null));};exports[_0x182c('0x5f')]=function(_0x38da2f,_0x1dfc92,_0x61ab02){if(_0x38da2f['body']['id']){delete _0x38da2f[_0x182c('0x5d')]['id'];}return db[_0x182c('0x3d')][_0x182c('0x59')]({'where':{'id':_0x38da2f[_0x182c('0x5e')]['id']}})[_0x182c('0x1e')](handleEntityNotFound(_0x1dfc92,null))[_0x182c('0x1e')](function(_0x565457){if(_0x565457){_0x38da2f['body'][_0x182c('0x60')]=_0x565457['id'];return db[_0x182c('0x61')][_0x182c('0x5c')](_0x38da2f[_0x182c('0x5d')]);}})[_0x182c('0x1e')](respondWithResult(_0x1dfc92,null))[_0x182c('0x27')](handleError(_0x1dfc92,null));};exports[_0x182c('0x62')]=function(_0x48b678,_0x1e071e,_0x46c1a4){var _0x1d18f4={'raw':![],'where':{}};var _0x5aa005={};var _0x5c514b={'count':0x0,'rows':[]};return db[_0x182c('0x3d')][_0x182c('0x63')]({'where':{'id':_0x48b678[_0x182c('0x5e')]['id']}})['then'](handleEntityNotFound(_0x1e071e,null))[_0x182c('0x1e')](function(_0x5af773){if(_0x5af773){_0x5aa005[_0x182c('0x41')]=_[_0x182c('0x44')](db['Disposition'][_0x182c('0x3e')]);_0x5aa005[_0x182c('0x43')]=_[_0x182c('0x44')](_0x48b678[_0x182c('0x43')]);_0x5aa005[_0x182c('0x45')]=_['intersection'](_0x5aa005['model'],_0x5aa005[_0x182c('0x43')]);_0x1d18f4[_0x182c('0x48')]=_[_0x182c('0x46')](_0x5aa005[_0x182c('0x41')],qs[_0x182c('0x47')](_0x48b678['query']['fields']));_0x1d18f4[_0x182c('0x48')]=_0x1d18f4[_0x182c('0x48')][_0x182c('0x49')]?_0x1d18f4[_0x182c('0x48')]:_0x5aa005[_0x182c('0x41')];if(!_0x48b678[_0x182c('0x43')][_0x182c('0x64')](_0x182c('0x4a'))){_0x1d18f4[_0x182c('0x2c')]=qs[_0x182c('0x2c')](_0x48b678['query'][_0x182c('0x2c')]);_0x1d18f4[_0x182c('0x2a')]=qs[_0x182c('0x2a')](_0x48b678[_0x182c('0x43')][_0x182c('0x2a')]);}_0x1d18f4[_0x182c('0x4b')]=qs['sort'](_0x48b678[_0x182c('0x43')][_0x182c('0x4c')]);_0x1d18f4[_0x182c('0x4d')]=qs[_0x182c('0x45')](_['pick'](_0x48b678[_0x182c('0x43')],_0x5aa005[_0x182c('0x45')]));_0x1d18f4['where'][_0x182c('0x60')]=_0x5af773['id'];if(_0x48b678[_0x182c('0x43')][_0x182c('0x4f')]){_0x1d18f4[_0x182c('0x4d')]=_[_0x182c('0x50')](_0x1d18f4['where'],{'$or':_[_0x182c('0x3c')](_0x1d18f4[_0x182c('0x48')],function(_0x44b5f8){var _0x3d4b53={};_0x3d4b53[_0x44b5f8]={'$like':'%'+_0x48b678['query'][_0x182c('0x4f')]+'%'};return _0x3d4b53;})});}_0x1d18f4=_['merge']({},_0x1d18f4,_0x48b678[_0x182c('0x51')]);return db[_0x182c('0x61')][_0x182c('0x2d')]({'where':_0x1d18f4[_0x182c('0x4d')]})[_0x182c('0x1e')](function(_0x4e35b5){_0x5c514b[_0x182c('0x2d')]=_0x4e35b5;if(_0x48b678[_0x182c('0x43')][_0x182c('0x52')]){_0x1d18f4['include']=[{'all':!![]}];}return db['Disposition'][_0x182c('0x54')](_0x1d18f4);})[_0x182c('0x1e')](function(_0x28fd0c){_0x5c514b[_0x182c('0x65')]=_0x28fd0c;return _0x5c514b;});}})['then'](respondWithFilteredResult(_0x1e071e,_0x1d18f4))[_0x182c('0x27')](handleError(_0x1e071e,null));};exports[_0x182c('0x66')]=function(_0x5dd985,_0x8d8ce,_0x215a13){return db[_0x182c('0x3d')]['find']({'where':{'id':_0x5dd985[_0x182c('0x5e')]['id']}})[_0x182c('0x1e')](handleEntityNotFound(_0x8d8ce,null))['then'](function(_0x5d9e07){if(_0x5d9e07){return _0x5d9e07['removeDispositions'](_0x5dd985[_0x182c('0x43')][_0x182c('0x67')]);}})['then'](respondWithStatusCode(_0x8d8ce,null))[_0x182c('0x27')](handleError(_0x8d8ce,null));};exports[_0x182c('0x68')]=function(_0x31c053,_0x34cdf5,_0x5d2978){if(_0x31c053['body']['id']){delete _0x31c053[_0x182c('0x5d')]['id'];}return db[_0x182c('0x3d')][_0x182c('0x59')]({'where':{'id':_0x31c053[_0x182c('0x5e')]['id']}})[_0x182c('0x1e')](handleEntityNotFound(_0x34cdf5,null))['then'](function(_0x2ba385){if(_0x2ba385){_0x31c053[_0x182c('0x5d')][_0x182c('0x60')]=_0x2ba385['id'];return db[_0x182c('0x69')]['create'](_0x31c053[_0x182c('0x5d')]);}})['then'](respondWithResult(_0x34cdf5,null))[_0x182c('0x27')](handleError(_0x34cdf5,null));};exports[_0x182c('0x6a')]=function(_0x4e13ba,_0x32ce51,_0xc43ef3){var _0x43382c={'raw':![],'where':{}};var _0x305423={};var _0x36e96a={'count':0x0,'rows':[]};return db['SmsAccount'][_0x182c('0x63')]({'where':{'id':_0x4e13ba[_0x182c('0x5e')]['id']}})['then'](handleEntityNotFound(_0x32ce51,null))[_0x182c('0x1e')](function(_0x34b0fa){if(_0x34b0fa){_0x305423['model']=_[_0x182c('0x44')](db['CannedAnswer'][_0x182c('0x3e')]);_0x305423['query']=_[_0x182c('0x44')](_0x4e13ba['query']);_0x305423[_0x182c('0x45')]=_['intersection'](_0x305423[_0x182c('0x41')],_0x305423[_0x182c('0x43')]);_0x43382c['attributes']=_[_0x182c('0x46')](_0x305423[_0x182c('0x41')],qs[_0x182c('0x47')](_0x4e13ba[_0x182c('0x43')][_0x182c('0x47')]));_0x43382c['attributes']=_0x43382c[_0x182c('0x48')][_0x182c('0x49')]?_0x43382c['attributes']:_0x305423[_0x182c('0x41')];if(!_0x4e13ba[_0x182c('0x43')][_0x182c('0x64')]('nolimit')){_0x43382c[_0x182c('0x2c')]=qs['limit'](_0x4e13ba[_0x182c('0x43')][_0x182c('0x2c')]);_0x43382c[_0x182c('0x2a')]=qs['offset'](_0x4e13ba['query'][_0x182c('0x2a')]);}_0x43382c[_0x182c('0x4b')]=qs[_0x182c('0x4c')](_0x4e13ba[_0x182c('0x43')][_0x182c('0x4c')]);_0x43382c[_0x182c('0x4d')]=qs[_0x182c('0x45')](_[_0x182c('0x4e')](_0x4e13ba['query'],_0x305423[_0x182c('0x45')]));_0x43382c[_0x182c('0x4d')][_0x182c('0x60')]=_0x34b0fa['id'];if(_0x4e13ba[_0x182c('0x43')][_0x182c('0x4f')]){_0x43382c['where']=_[_0x182c('0x50')](_0x43382c[_0x182c('0x4d')],{'$or':_[_0x182c('0x3c')](_0x43382c['attributes'],function(_0x19b6a5){var _0x2fe48e={};_0x2fe48e[_0x19b6a5]={'$like':'%'+_0x4e13ba[_0x182c('0x43')][_0x182c('0x4f')]+'%'};return _0x2fe48e;})});}_0x43382c=_[_0x182c('0x50')]({},_0x43382c,_0x4e13ba[_0x182c('0x51')]);return db[_0x182c('0x69')][_0x182c('0x2d')]({'where':_0x43382c[_0x182c('0x4d')]})['then'](function(_0x219b87){_0x36e96a[_0x182c('0x2d')]=_0x219b87;if(_0x4e13ba[_0x182c('0x43')]['includeAll']){_0x43382c[_0x182c('0x53')]=[{'all':!![]}];}return db[_0x182c('0x69')][_0x182c('0x54')](_0x43382c);})[_0x182c('0x1e')](function(_0x27a021){_0x36e96a[_0x182c('0x65')]=_0x27a021;return _0x36e96a;});}})[_0x182c('0x1e')](respondWithFilteredResult(_0x32ce51,_0x43382c))[_0x182c('0x27')](handleError(_0x32ce51,null));};exports[_0x182c('0x6b')]=function(_0xd90177,_0x3f1170,_0x280df3){return db[_0x182c('0x3d')][_0x182c('0x59')]({'where':{'id':_0xd90177[_0x182c('0x5e')]['id']}})[_0x182c('0x1e')](handleEntityNotFound(_0x3f1170,null))[_0x182c('0x1e')](function(_0x5ca344){if(_0x5ca344){return _0x5ca344[_0x182c('0x6b')](_0xd90177[_0x182c('0x43')][_0x182c('0x67')]);}})[_0x182c('0x1e')](respondWithStatusCode(_0x3f1170,null))['catch'](handleError(_0x3f1170,null));};exports['notify']=function(_0x24a10d,_0x58fa87,_0x49a9f2){var _0x3fd3a8={'channel':'sms'};var _0x2203ec=[];var _0x1efb03=[];var _0x20a9fe={};return db[_0x182c('0x3d')][_0x182c('0x59')]({'where':{'id':_0x24a10d[_0x182c('0x5e')]['id']},'include':[{'model':db['SmsApplication'],'as':'Applications'}]})[_0x182c('0x1e')](handleEntityNotFound(_0x58fa87,null))[_0x182c('0x1e')](function(_0x5f203b){_0x3fd3a8[_0x182c('0x6c')]=_0x5f203b;_0x3fd3a8[_0x182c('0x6d')]=_['orderBy'](_0x5f203b['Applications'],[_0x182c('0x6e')],[_0x182c('0x6f')]);if(_0x3fd3a8['account'][_0x182c('0x70')]){delete _0x3fd3a8[_0x182c('0x6c')][_0x182c('0x70')];}return db[_0x182c('0x71')][_0x182c('0x72')]();})[_0x182c('0x1e')](function(_0x2b07db){if(!_0x2b07db){throw new db[(_0x182c('0x73'))][(_0x182c('0x74'))]('no\x20available\x20attributes');}_0x2203ec=_['difference'](_['keys'](_0x2b07db),[_0x182c('0x75'),_0x182c('0x76')]);_0x1efb03=_[_0x182c('0x77')](_[_0x182c('0x44')](_0x2b07db),[_0x182c('0x75'),'updatedAt','CompanyId',_0x182c('0x78')]);_0x3fd3a8[_0x182c('0x5d')]={'mapKey':'mobile'};if(_0x3fd3a8[_0x182c('0x6c')]['type']){switch(_0x3fd3a8[_0x182c('0x6c')][_0x182c('0x40')]){case _0x182c('0x79'):_0x3fd3a8[_0x182c('0x5d')][_0x182c('0x7a')]=_0x24a10d[_0x182c('0x5d')]['From'];_0x3fd3a8[_0x182c('0x5d')]['body']=_0x24a10d[_0x182c('0x5d')][_0x182c('0x7b')];_0x3fd3a8[_0x182c('0x5d')][_0x182c('0x7c')]=_0x24a10d[_0x182c('0x5d')][_0x182c('0x7d')];break;case _0x182c('0x7e'):_0x3fd3a8[_0x182c('0x5d')][_0x182c('0x7a')]='+'+_0x24a10d['body'][_0x182c('0x7f')];_0x3fd3a8[_0x182c('0x5d')][_0x182c('0x5d')]=_0x24a10d['body'][_0x182c('0x80')];break;case'connectel':_0x3fd3a8[_0x182c('0x5d')][_0x182c('0x7a')]=_0x24a10d[_0x182c('0x5d')][_0x182c('0x7a')];_0x3fd3a8['body']['body']=_0x24a10d['body'][_0x182c('0x25')];break;case _0x182c('0x81'):_0x3fd3a8[_0x182c('0x5d')][_0x182c('0x7a')]=_0x24a10d[_0x182c('0x5d')][_0x182c('0x7a')];_0x3fd3a8['body']['body']=_0x24a10d[_0x182c('0x5d')][_0x182c('0x5d')];_0x3fd3a8['body']['messageId']=_0x24a10d['body'][_0x182c('0x82')];break;case'plivo':_0x3fd3a8[_0x182c('0x5d')][_0x182c('0x7a')]=_0x24a10d[_0x182c('0x5d')]['From'];_0x3fd3a8[_0x182c('0x5d')]['body']=_0x24a10d[_0x182c('0x5d')][_0x182c('0x83')];_0x3fd3a8[_0x182c('0x5d')][_0x182c('0x7c')]=_0x24a10d[_0x182c('0x5d')]['MessageUUID'];break;case'infobip':_0x3fd3a8[_0x182c('0x5d')][_0x182c('0x7a')]='+'+_0x24a10d[_0x182c('0x5d')][_0x182c('0x84')][0x0][_0x182c('0x7a')];_0x3fd3a8[_0x182c('0x5d')][_0x182c('0x5d')]=_0x24a10d[_0x182c('0x5d')]['results'][0x0][_0x182c('0x80')];_0x3fd3a8[_0x182c('0x5d')]['messageId']=_0x24a10d[_0x182c('0x5d')][_0x182c('0x84')][0x0][_0x182c('0x7c')];break;case _0x182c('0x85'):_0x3fd3a8[_0x182c('0x5d')][_0x182c('0x7a')]=_0x24a10d[_0x182c('0x5d')][_0x182c('0x86')];_0x3fd3a8[_0x182c('0x5d')][_0x182c('0x5d')]=_0x24a10d['body'][_0x182c('0x87')][_0x182c('0x25')];break;case _0x182c('0x88'):_0x3fd3a8[_0x182c('0x5d')][_0x182c('0x7a')]=_0x24a10d[_0x182c('0x5d')]['fromNumber'];_0x3fd3a8['body'][_0x182c('0x5d')]=_0x24a10d['body']['text'];_0x3fd3a8[_0x182c('0x5d')][_0x182c('0x7c')]=_0x24a10d['body'][_0x182c('0x89')];break;case'bandwidth':_0x3fd3a8['body'][_0x182c('0x7c')]=_0x24a10d[_0x182c('0x5d')][0x0]['message']['id'];_0x3fd3a8[_0x182c('0x5d')][_0x182c('0x7a')]=_0x24a10d[_0x182c('0x5d')][0x0][_0x182c('0x25')]['from'];_0x3fd3a8[_0x182c('0x5d')][_0x182c('0x5d')]=_0x24a10d[_0x182c('0x5d')][0x0][_0x182c('0x25')]['text'];break;case _0x182c('0x8a'):_0x3fd3a8[_0x182c('0x5d')]['from']=_0x24a10d['body'][_0x182c('0x7a')];_0x3fd3a8['body'][_0x182c('0x5d')]=_0x24a10d['body'][_0x182c('0x25')];_0x3fd3a8[_0x182c('0x5d')][_0x182c('0x7c')]=_0x24a10d[_0x182c('0x5d')][_0x182c('0x8b')];break;}}if(_0x3fd3a8[_0x182c('0x5d')]['id']){delete _0x3fd3a8[_0x182c('0x5d')]['id'];}if(_[_0x182c('0x8c')](_0x3fd3a8[_0x182c('0x5d')][_0x182c('0x7a')])){throw new db['Sequelize'][(_0x182c('0x74'))](_0x182c('0x8d'));}if(_['isNil'](_0x3fd3a8['body'][_0x182c('0x5d')])||_0x3fd3a8['body'][_0x182c('0x5d')]===''){throw new db[(_0x182c('0x73'))][(_0x182c('0x74'))](_0x182c('0x8e'));}if(_[_0x182c('0x8c')](_0x3fd3a8[_0x182c('0x5d')]['mapKey'])){throw new db[(_0x182c('0x73'))][(_0x182c('0x74'))](_0x182c('0x8f')+_0x1efb03);}if(!_['includes'](_0x1efb03,_0x3fd3a8[_0x182c('0x5d')][_0x182c('0x90')])){throw new db[(_0x182c('0x73'))][(_0x182c('0x74'))](_0x182c('0x91')+_0x1efb03);}_0x20a9fe[_0x3fd3a8['body']['mapKey']]=_0x3fd3a8[_0x182c('0x5d')][_0x182c('0x7a')];return db[_0x182c('0x92')]['find']({'where':{'id':_0x3fd3a8[_0x182c('0x6c')][_0x182c('0x78')]},'include':[{'model':db['CmContact'],'as':_0x182c('0x93'),'where':_0x20a9fe,'limit':0x1,'order':[[_0x182c('0x76'),_0x182c('0x94')]]}]});})[_0x182c('0x1e')](handleEntityNotFound(_0x58fa87,null))['then'](function(_0x5ad362){if(_0x5ad362){_0x3fd3a8[_0x182c('0x95')]=_[_0x182c('0x96')](_0x5ad362,[_0x182c('0x93')]);if(_0x5ad362['Contacts'][_0x182c('0x49')]){return _0x5ad362[_0x182c('0x93')][0x0];}var _0x396151=_[_0x182c('0x16')](_0x3fd3a8[_0x182c('0x5d')],{'firstName':_0x3fd3a8['body'][_0x182c('0x7a')],'ListId':_0x5ad362['id']});_0x396151[_0x3fd3a8['body']['mapKey']]=_0x3fd3a8['body'][_0x182c('0x7a')];return db['CmContact'][_0x182c('0x5c')](_0x396151,{'fields':_0x2203ec,'raw':!![]});}})['then'](handleEntityNotFound(_0x58fa87,null))[_0x182c('0x1e')](function(_0x3ee132){if(_0x3ee132){_0x3fd3a8['contact']=_0x3ee132;var _0xe4b77a={'ContactId':_0x3ee132['id'],'phone':_0x3fd3a8[_0x182c('0x5d')][_0x182c('0x7a')],'SmsAccountId':_0x24a10d[_0x182c('0x5e')]['id']};var _0x2dd0b0={'ContactId':_0x3ee132['id'],'SmsAccountId':_0x24a10d[_0x182c('0x5e')]['id'],'closed':![]};return db[_0x182c('0x97')][_0x182c('0x59')]({'where':_0x2dd0b0})[_0x182c('0x1e')](function(_0x230d8e){if(_0x230d8e){return[_0x230d8e,![]];}return db[_0x182c('0x97')]['create'](_0xe4b77a)[_0x182c('0x1e')](function(_0x70b061){return[_0x70b061,!![]];});});}})[_0x182c('0x98')](function(_0x1102ab,_0x473d73){_0x3fd3a8['interaction']=_0x1102ab['get']({'plain':!![]});_0x3fd3a8['interaction']['created']=![];if(_0x473d73){if(_0x3fd3a8[_0x182c('0x6c')][_0x182c('0x99')]){_0x3fd3a8[_0x182c('0x6d')][_0x182c('0x9a')]({'id':0x0,'priority':_0x3fd3a8[_0x182c('0x6d')]['length']+0x1,'app':_0x182c('0x9b'),'appdata':_0x182c('0x9c'),'interval':_0x182c('0x9d')});}_0x3fd3a8[_0x182c('0x9e')][_0x182c('0x9f')]=!![];}return db[_0x182c('0xa0')][_0x182c('0x5c')]({'phone':_0x3fd3a8[_0x182c('0x5d')]['from'],'messageId':_0x3fd3a8[_0x182c('0x5d')]['messageId'],'body':_0x3fd3a8[_0x182c('0x5d')][_0x182c('0x5d')],'SmsAccountId':_0x24a10d[_0x182c('0x5e')]['id'],'SmsInteractionId':_0x1102ab['id'],'direction':'in','ContactId':_0x1102ab[_0x182c('0xa1')],'AttachmentId':_0x3fd3a8[_0x182c('0x5d')]['AttachmentId']});})[_0x182c('0x1e')](function(_0x5d60d2){_0x3fd3a8['message']=_0x5d60d2;if(_0x3fd3a8[_0x182c('0x9e')][_0x182c('0xa2')]){return db[_0x182c('0xa3')][_0x182c('0x59')]({'attributes':['id',_0x182c('0x42')],'where':{'id':_0x3fd3a8[_0x182c('0x9e')][_0x182c('0xa2')]}})[_0x182c('0x1e')](function(_0x3ac284){if(_0x3ac284){_0x3fd3a8[_0x182c('0x6d')]['unshift']({'id':0x0,'priority':0x0,'app':_0x182c('0xa4'),'appdata':_0x3ac284[_0x182c('0x42')]+','+(_0x3fd3a8['account'][_0x182c('0xa5')]||0xa),'interval':_0x182c('0x9d')});}return respondWithRpcPromise(_0x182c('0xa6'),'startRouting',_0x3fd3a8);});}return respondWithRpcPromise('Start',_0x182c('0xa7'),_0x3fd3a8);})[_0x182c('0x1e')](function(_0x49420d){if(_0x49420d){var _0x177b74=0xc8;var _0x62cf4d='receiveMessage';logger[_0x182c('0x1f')](_0x182c('0xa8'),_0x62cf4d,_0x177b74,'entity\x20found');logger[_0x182c('0x22')](_0x182c('0xa9'),_0x62cf4d,_0x177b74,_0x182c('0xaa'),JSON[_0x182c('0xab')](_0x49420d));if(_0x3fd3a8[_0x182c('0x6c')]['type']===_0x182c('0x79')){return _0x58fa87[_0x182c('0x28')](_0x177b74)[_0x182c('0x2e')]('Content-Type',_0x182c('0xac'))[_0x182c('0xad')](_0x182c('0xae'));}else{return _0x58fa87[_0x182c('0x28')](_0x177b74)[_0x182c('0x30')](_0x49420d);}}})['catch'](handleError(_0x58fa87,null));};exports[_0x182c('0xaf')]=function(_0x1bab10,_0x5589ec,_0x4c3216){return db[_0x182c('0x3d')]['findOne']({'where':{'id':_0x1bab10[_0x182c('0x5e')]['id']}})[_0x182c('0x1e')](handleEntityNotFound(_0x5589ec,null))[_0x182c('0x1e')](function(_0x3d7f90){if(_0x3d7f90){return db[_0x182c('0xb0')][_0x182c('0xb1')](function(_0x3f76bd){return db[_0x182c('0xb2')]['destroy']({'where':{'SmsAccountId':_0x1bab10[_0x182c('0x5e')]['id']},'transaction':_0x3f76bd})['then'](function(_0x45b010){var _0x337927=_[_0x182c('0x3c')](_0x1bab10[_0x182c('0x5d')],function(_0x5f4e4c){_0x5f4e4c[_0x182c('0x60')]=_0x1bab10['params']['id'];return _0x5f4e4c;});return db[_0x182c('0xb2')]['bulkCreate'](_0x337927,{'transaction':_0x3f76bd});});})[_0x182c('0x1e')](function(){return db[_0x182c('0xb2')][_0x182c('0xb3')]({'where':{'SmsAccountId':_0x1bab10[_0x182c('0x5e')]['id']},'order':'priority'});});}})[_0x182c('0x1e')](respondWithResult(_0x5589ec,null))[_0x182c('0x27')](handleError(_0x5589ec,null));};exports[_0x182c('0xb4')]=function(_0x21c250,_0x344bb6,_0x504413){var _0x1b4d03={};var _0x4e66d8={};var _0x99e223;var _0x4f0a3b;return db[_0x182c('0x3d')][_0x182c('0x63')]({'where':{'id':_0x21c250[_0x182c('0x5e')]['id']}})[_0x182c('0x1e')](handleEntityNotFound(_0x344bb6,null))[_0x182c('0x1e')](function(_0x56d568){if(_0x56d568){_0x99e223=_0x56d568;_0x4e66d8['model']=_[_0x182c('0x44')](db[_0x182c('0xb2')]['rawAttributes']);_0x4e66d8[_0x182c('0x43')]=_[_0x182c('0x44')](_0x21c250[_0x182c('0x43')]);_0x4e66d8[_0x182c('0x45')]=_['intersection'](_0x4e66d8[_0x182c('0x41')],_0x4e66d8[_0x182c('0x43')]);_0x1b4d03[_0x182c('0x48')]=_[_0x182c('0x46')](_0x4e66d8['model'],qs[_0x182c('0x47')](_0x21c250[_0x182c('0x43')][_0x182c('0x47')]));_0x1b4d03[_0x182c('0x48')]=_0x1b4d03[_0x182c('0x48')]['length']?_0x1b4d03[_0x182c('0x48')]:_0x4e66d8['model'];_0x1b4d03[_0x182c('0x4b')]=qs['sort'](_0x21c250[_0x182c('0x43')][_0x182c('0x4c')]);_0x1b4d03[_0x182c('0x4d')]=qs[_0x182c('0x45')](_[_0x182c('0x4e')](_0x21c250[_0x182c('0x43')],_0x4e66d8[_0x182c('0x45')]));if(_0x21c250[_0x182c('0x43')][_0x182c('0x4f')]){_0x1b4d03['where']=_[_0x182c('0x50')](_0x1b4d03[_0x182c('0x4d')],{'$or':_['map'](_0x1b4d03[_0x182c('0x48')],function(_0x25877b){var _0x2c50cf={};_0x2c50cf[_0x25877b]={'$like':'%'+_0x21c250['query'][_0x182c('0x4f')]+'%'};return _0x2c50cf;})});}_0x1b4d03=_[_0x182c('0x50')]({},_0x1b4d03,_0x21c250['options']);return _0x99e223[_0x182c('0xb4')](_0x1b4d03);}})[_0x182c('0x1e')](function(_0x359f45){if(_0x359f45){_0x4f0a3b=_0x359f45[_0x182c('0x49')];if(!_0x21c250[_0x182c('0x43')][_0x182c('0x64')](_0x182c('0x4a'))){_0x1b4d03[_0x182c('0x2c')]=qs[_0x182c('0x2c')](_0x21c250[_0x182c('0x43')]['limit']);_0x1b4d03[_0x182c('0x2a')]=qs[_0x182c('0x2a')](_0x21c250['query']['offset']);}return _0x99e223[_0x182c('0xb4')](_0x1b4d03);}})[_0x182c('0x1e')](function(_0x2fe9aa){if(_0x2fe9aa){return _0x2fe9aa?{'count':_0x4f0a3b,'rows':_0x2fe9aa}:null;}})[_0x182c('0x1e')](respondWithResult(_0x344bb6,null))[_0x182c('0x27')](handleError(_0x344bb6,null));};exports[_0x182c('0xb5')]=function(_0x29c669,_0x3513ae,_0x1d7000){var _0x3d9d58={'raw':![],'where':{}};var _0x13891d={};var _0x5a18f1={'count':0x0,'rows':[]};return db[_0x182c('0x3d')][_0x182c('0x63')]({'where':{'id':_0x29c669['params']['id']}})[_0x182c('0x1e')](handleEntityNotFound(_0x3513ae,null))[_0x182c('0x1e')](function(_0x1f50e7){if(_0x1f50e7){_0x13891d['model']=_[_0x182c('0x44')](db[_0x182c('0x97')][_0x182c('0x3e')]);_0x13891d[_0x182c('0x43')]=_['keys'](_0x29c669[_0x182c('0x43')]);_0x13891d[_0x182c('0x45')]=_[_0x182c('0x46')](_0x13891d[_0x182c('0x41')],_0x13891d[_0x182c('0x43')]);_0x3d9d58[_0x182c('0x48')]=_[_0x182c('0x46')](_0x13891d[_0x182c('0x41')],qs[_0x182c('0x47')](_0x29c669['query']['fields']));_0x3d9d58[_0x182c('0x48')]=_0x3d9d58[_0x182c('0x48')]['length']?_0x3d9d58[_0x182c('0x48')]:_0x13891d[_0x182c('0x41')];if(!_0x29c669[_0x182c('0x43')][_0x182c('0x64')](_0x182c('0x4a'))){_0x3d9d58[_0x182c('0x2c')]=qs[_0x182c('0x2c')](_0x29c669['query'][_0x182c('0x2c')]);_0x3d9d58[_0x182c('0x2a')]=qs[_0x182c('0x2a')](_0x29c669['query'][_0x182c('0x2a')]);}_0x3d9d58[_0x182c('0x4b')]=qs[_0x182c('0x4c')](_0x29c669[_0x182c('0x43')][_0x182c('0x4c')]);_0x3d9d58[_0x182c('0x4d')]=qs['filters'](_['pick'](_0x29c669[_0x182c('0x43')],_0x13891d[_0x182c('0x45')]));_0x3d9d58[_0x182c('0x4d')][_0x182c('0x60')]=_0x1f50e7['id'];if(_0x29c669[_0x182c('0x43')][_0x182c('0x4f')]){_0x3d9d58['where']=_[_0x182c('0x50')](_0x3d9d58[_0x182c('0x4d')],{'$or':_[_0x182c('0x3c')](_0x3d9d58['attributes'],function(_0x3b7ba1){var _0x4099c7={};_0x4099c7[_0x3b7ba1]={'$like':'%'+_0x29c669['query'][_0x182c('0x4f')]+'%'};return _0x4099c7;})});}_0x3d9d58=_[_0x182c('0x50')]({},_0x3d9d58,_0x29c669[_0x182c('0x51')]);return db[_0x182c('0x97')][_0x182c('0x2d')]({'where':_0x3d9d58['where']})[_0x182c('0x1e')](function(_0x2564c8){_0x5a18f1[_0x182c('0x2d')]=_0x2564c8;if(_0x29c669['query'][_0x182c('0x52')]){_0x3d9d58[_0x182c('0x53')]=[{'model':db[_0x182c('0x71')],'as':_0x182c('0xb6'),'required':![]},{'model':db[_0x182c('0xa3')],'as':'Owner','attributes':[_0x182c('0x42'),_0x182c('0xb7'),_0x182c('0xb8')],'required':![]},{'model':db[_0x182c('0xb9')],'as':_0x182c('0xba'),'attributes':['id',_0x182c('0x42'),_0x182c('0xbb')],'where':_0x29c669[_0x182c('0x43')][_0x182c('0xbc')]?{'id':_0x29c669[_0x182c('0x43')][_0x182c('0xbc')]}:undefined,'required':_0x29c669[_0x182c('0x43')][_0x182c('0xbc')]?!![]:![]}];}return db[_0x182c('0x97')][_0x182c('0x54')](_0x3d9d58);})['then'](function(_0x3100db){_0x5a18f1[_0x182c('0x65')]=_0x3100db;return _0x5a18f1;});}})['then'](respondWithFilteredResult(_0x3513ae,_0x3d9d58))[_0x182c('0x27')](handleError(_0x3513ae,null));};exports[_0x182c('0xad')]=function(_0x27f14c,_0x587c7e,_0x4295a8){var _0x3e7026,_0x222412,_0x3e0e16;if(_[_0x182c('0x8c')](_0x27f14c[_0x182c('0x5d')][_0x182c('0x5d')])||_0x27f14c['body'][_0x182c('0x5d')]===''){throw new db[(_0x182c('0x73'))][(_0x182c('0x74'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x182c('0x8c')](_0x27f14c[_0x182c('0x5d')]['to'])){throw new db['Sequelize']['ValidationError'](_0x182c('0xbd'));}_0x3e7026=_0x27f14c['body']['to'];return db[_0x182c('0x3d')]['find']({'where':{'id':_0x27f14c[_0x182c('0x5e')]['id']},'include':[{'model':db[_0x182c('0x92')],'as':_0x182c('0xbe'),'include':[{'model':db['CmContact'],'as':_0x182c('0x93'),'where':{'mobile':_0x3e7026},'limit':0x1,'order':[[_0x182c('0x76'),_0x182c('0x94')]]}]}]})[_0x182c('0x1e')](handleEntityNotFound(_0x587c7e,null))[_0x182c('0x1e')](function(_0x6ddcf7){if(_0x6ddcf7&&_0x6ddcf7[_0x182c('0xbe')]){_0x222412=_0x6ddcf7[_0x182c('0x57')]({'plain':!![]});if(_0x222412['List']&&_0x222412['List'][_0x182c('0x93')][_0x182c('0x49')]){return _0x222412['List'][_0x182c('0x93')][0x0];}return db[_0x182c('0x71')][_0x182c('0x5c')](_[_0x182c('0x16')](_0x27f14c['body'],{'firstName':_0x3e7026,'mobile':_0x3e7026,'phone':_0x3e7026,'ListId':_0x222412[_0x182c('0x78')]}));}})['then'](handleEntityNotFound(_0x587c7e,null))[_0x182c('0x1e')](function(_0x224b84){if(_0x224b84){_0x3e0e16=_0x224b84;return db[_0x182c('0x97')]['find']({'where':{'ContactId':_0x3e0e16['id'],'closed':![],'SmsAccountId':_0x222412['id']}})[_0x182c('0x1e')](function(_0x529aeb){if(_0x529aeb){return[_0x529aeb,![]];}return db[_0x182c('0x97')][_0x182c('0x5c')]({'UserId':_0x27f14c['user']['id'],'ContactId':_0x3e0e16['id'],'SmsAccountId':_0x222412['id'],'phone':_0x3e7026,'firstMsgDirection':_0x182c('0xbf'),'Messages':[_[_0x182c('0x50')](_0x27f14c['body'],{'read':![],'body':_0x27f14c[_0x182c('0x5d')][_0x182c('0x5d')],'phone':_0x3e7026,'SmsAccountId':_0x222412['id'],'UserId':_0x27f14c[_0x182c('0x56')]['id'],'ContactId':_0x3e0e16['id']})]},{'include':[{'model':db[_0x182c('0xa0')],'as':_0x182c('0xc0')}]})[_0x182c('0x1e')](function(_0x165024){return[_0x165024,!![]];});});}})[_0x182c('0x98')](function(_0x434412,_0x5e46a1){if(_0x5e46a1){return _0x434412;}return db['SmsMessage'][_0x182c('0x5c')](_[_0x182c('0x50')](_0x27f14c[_0x182c('0x5d')],{'read':![],'body':_0x27f14c[_0x182c('0x5d')][_0x182c('0x5d')],'phone':_0x3e7026,'SmsAccountId':_0x222412['id'],'SmsInteractionId':_0x434412['id'],'UserId':_0x27f14c[_0x182c('0x56')]['id'],'ContactId':_0x3e0e16['id']}))['then'](function(_0x56b229){_0x434412[_0x182c('0xc1')][_0x182c('0xc0')]=[];_0x434412[_0x182c('0xc1')][_0x182c('0xc0')]['push'](_0x56b229[_0x182c('0xc1')]);return _0x434412;});})['then'](respondWithResult(_0x587c7e,null))[_0x182c('0x27')](handleError(_0x587c7e,null));};exports[_0x182c('0x28')]=function(_0x52ef2c,_0x513ad8,_0x6dd85b){if(_0x52ef2c[_0x182c('0x5d')]['id']){delete _0x52ef2c['body']['id'];}var _0xab1971,_0x641470,_0x34be23;return db[_0x182c('0x3d')][_0x182c('0x59')]({'where':{'id':_0x52ef2c['params']['id']}})[_0x182c('0x1e')](handleEntityNotFound(_0x513ad8,null))[_0x182c('0x1e')](function(_0x337e4c){if(_0x337e4c){_0x34be23=_0x337e4c;logger['debug']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x182c('0x28'),_0x182c('0xc2'),_0x337e4c[_0x182c('0x40')],util[_0x182c('0xc3')](_0x52ef2c['body'],{'showHidden':![],'depth':null}));switch(_0x337e4c['type']){case'skebby':if(_0x52ef2c[_0x182c('0x5d')]['skebby_dispatch_id']&&_0x52ef2c[_0x182c('0x5d')][_0x182c('0x28')]){_0x641470=_0x52ef2c[_0x182c('0x5d')][_0x182c('0x28')];return db[_0x182c('0xa0')][_0x182c('0x59')]({'where':{'messageId':_0x52ef2c[_0x182c('0x5d')][_0x182c('0xc4')]}});}break;case'connectel':if(_0x52ef2c['body']['requestid']&&_0x52ef2c['body'][_0x182c('0xc5')]){_0x641470=_0x52ef2c[_0x182c('0x5d')][_0x182c('0xc5')];return db['SmsMessage'][_0x182c('0x59')]({'where':{'messageId':_0x52ef2c[_0x182c('0x5d')][_0x182c('0xc6')]}});}break;case _0x182c('0x81'):if(_0x52ef2c['body'][_0x182c('0x82')]&&_0x52ef2c[_0x182c('0x5d')][_0x182c('0xc7')]){_0x641470=_0x52ef2c[_0x182c('0x5d')]['status_code'];return db[_0x182c('0xa0')][_0x182c('0x59')]({'where':{'messageId':_0x52ef2c['body'][_0x182c('0x82')]}});}break;case'infobip':var _0x4e2e3c=_0x52ef2c[_0x182c('0x5d')][_0x182c('0x84')][0x0];if(_0x4e2e3c[_0x182c('0x7c')]&&_0x4e2e3c[_0x182c('0x28')][_0x182c('0xc8')]==='DELIVERED'){_0x641470=_0x4e2e3c[_0x182c('0x28')]['groupName'];return db['SmsMessage'][_0x182c('0x59')]({'where':{'messageId':_0x4e2e3c['messageId']}});}break;case'clickatell':if(_0x52ef2c[_0x182c('0x5d')][_0x182c('0x7c')]&&_0x52ef2c[_0x182c('0x5d')][_0x182c('0x28')]){_0x641470=_0x52ef2c[_0x182c('0x5d')][_0x182c('0x28')];return db['SmsMessage'][_0x182c('0x59')]({'where':{'messageId':_0x52ef2c[_0x182c('0x5d')][_0x182c('0x7c')]}});}break;case _0x182c('0xc9'):if(_0x52ef2c[_0x182c('0x5d')][0x0][_0x182c('0x25')]['id']){_0x641470=_0x52ef2c[_0x182c('0x5d')][0x0][_0x182c('0x40')];return db[_0x182c('0xa0')][_0x182c('0x59')]({'where':{'messageId':_0x52ef2c[_0x182c('0x5d')][0x0][_0x182c('0x25')]['id']}});}break;case _0x182c('0x8a'):if(_0x52ef2c[_0x182c('0x5d')][_0x182c('0xca')]&&_0x52ef2c[_0x182c('0x5d')][_0x182c('0x28')]){_0x641470=_0x52ef2c['body'][_0x182c('0x28')];return db[_0x182c('0xa0')][_0x182c('0x59')]({'where':{'messageId':_0x52ef2c[_0x182c('0x5d')][_0x182c('0xca')]}});}break;}}})['then'](handleEntityNotFound(_0x513ad8,null))[_0x182c('0x1e')](function(_0x593358){if(_0x593358){_0xab1971=_0x593358;switch(_0x34be23[_0x182c('0x40')]){case _0x182c('0x7e'):if(_0x641470===_0x182c('0xcb')){return _0xab1971[_0x182c('0x34')]({'read':!![]});}else{logger[_0x182c('0x23')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x182c('0x7e'),util[_0x182c('0xc3')](_0x52ef2c[_0x182c('0x5d')],{'showHidden':![],'depth':null}));}break;case _0x182c('0xcc'):if(_0x641470==='1'){return _0xab1971[_0x182c('0x34')]({'read':!![]});}else{logger[_0x182c('0x23')](_0x182c('0xa8'),'status',_0x182c('0x7e'),util['inspect'](_0x52ef2c[_0x182c('0x5d')],{'showHidden':![],'depth':null}));}break;case _0x182c('0x81'):if(!_0x52ef2c[_0x182c('0x5d')][_0x182c('0xcd')]&&_0x641470>=0xc8&&_0x641470<=0xce){return _0xab1971[_0x182c('0x34')]({'read':!![]});}else{logger['error'](_0x182c('0xa8'),_0x182c('0x28'),'clicksend',util['inspect'](_0x52ef2c['body'],{'showHidden':![],'depth':null}));}break;case _0x182c('0xce'):var _0x1f375a=_0x52ef2c[_0x182c('0x5d')][_0x182c('0x84')][0x0];if(_0x1f375a['status']['groupName']===_0x182c('0xcb')){return _0xab1971['update']({'read':!![]});}else{logger['error'](_0x182c('0xa8'),_0x182c('0x28'),_0x182c('0xce'),util[_0x182c('0xc3')](_0x52ef2c[_0x182c('0x5d')],{'showHidden':![],'depth':null}));}break;case _0x182c('0x88'):if(_0x641470==_0x182c('0xcf')||_0x641470=='RECEIVED_BY_RECIPIENT'){return _0xab1971[_0x182c('0x34')]({'read':!![]});}else{logger['error'](_0x182c('0xa8'),_0x182c('0x28'),_0x182c('0x88'),util[_0x182c('0xc3')](_0x52ef2c['body'],{'showHidden':![],'depth':null}));}break;case'bandwidth':if(_0x641470==_0x182c('0xd0')){return _0xab1971[_0x182c('0x34')]({'read':!![]});}else{logger[_0x182c('0x23')]('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x182c('0xc9'),util[_0x182c('0xc3')](_0x52ef2c[_0x182c('0x5d')],{'showHidden':![],'depth':null}));}break;case _0x182c('0x8a'):if(_0x641470===_0x182c('0xd1')||_0x641470===_0x182c('0xd2')){return _0xab1971['update']({'read':!![]});}else{logger[_0x182c('0x23')](_0x182c('0xa8'),_0x182c('0x28'),_0x182c('0x8a'),util[_0x182c('0xc3')](_0x52ef2c[_0x182c('0x5d')],{'showHidden':![],'depth':null}));}break;}return _0xab1971;}})[_0x182c('0x1e')](respondWithResult(_0x513ad8,null))[_0x182c('0x27')](handleError(_0x513ad8,null));};exports['statusGet']=function(_0x3416d1,_0x473b07,_0x5633fa){var _0x47a821,_0x986373,_0x17f6f7;return db[_0x182c('0x3d')][_0x182c('0x59')]({'where':{'id':_0x3416d1['params']['id']}})[_0x182c('0x1e')](handleEntityNotFound(_0x473b07,null))[_0x182c('0x1e')](function(_0x1e65df){if(_0x1e65df){_0x17f6f7=_0x1e65df;logger[_0x182c('0x22')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x182c('0x28'),_0x182c('0xc2'),_0x1e65df[_0x182c('0x40')],util['inspect'](_0x3416d1['query'],{'showHidden':![],'depth':null}));switch(_0x1e65df['type']){case _0x182c('0x85'):if(_0x3416d1[_0x182c('0x43')]['message-id']&&_0x3416d1[_0x182c('0x43')][_0x182c('0xd3')]){_0x986373=_0x3416d1[_0x182c('0x43')]['state'];return db['SmsMessage'][_0x182c('0x59')]({'where':{'messageId':_0x3416d1['query'][_0x182c('0xd4')]}});}break;}}})[_0x182c('0x1e')](handleEntityNotFound(_0x473b07,null))[_0x182c('0x1e')](function(_0x30d458){if(_0x30d458){_0x47a821=_0x30d458;switch(_0x17f6f7[_0x182c('0x40')]){case _0x182c('0x85'):if(_0x986373==='2'||_0x986373==='6'){return _0x47a821[_0x182c('0x34')]({'read':!![]});}else{logger['error'](_0x182c('0xa8'),_0x182c('0x28'),_0x182c('0x85'),util[_0x182c('0xc3')](_0x3416d1[_0x182c('0x43')],{'showHidden':![],'depth':null}));};break;}return _0x47a821;}})[_0x182c('0x1e')](respondWithResult(_0x473b07,null))[_0x182c('0x27')](handleError(_0x473b07,null));};exports['addAgents']=function(_0x246b97,_0x202b39,_0x7bb7c2){return db[_0x182c('0x3d')][_0x182c('0x59')]({'where':{'id':_0x246b97['params']['id']}})[_0x182c('0x1e')](handleEntityNotFound(_0x202b39,null))[_0x182c('0x1e')](function(_0x4bca2b){if(_0x4bca2b){return _0x4bca2b[_0x182c('0xd5')](_0x246b97[_0x182c('0x5d')]['ids'],_[_0x182c('0x96')](_0x246b97[_0x182c('0x5d')],[_0x182c('0x67'),'id'])||{})[_0x182c('0x98')](function(_0x5ee1f4){for(var _0x16334e=0x0;_0x16334e<_0x246b97[_0x182c('0x5d')][_0x182c('0x67')][_0x182c('0x49')];_0x16334e+=0x1){socket[_0x182c('0xd6')]('userSmsAccount:save',{'UserId':Number(_0x246b97['body'][_0x182c('0x67')][_0x16334e]),'SmsAccountId':Number(_0x246b97[_0x182c('0x5e')]['id'])});}return _0x5ee1f4;});}})['then'](respondWithResult(_0x202b39,null))[_0x182c('0x27')](handleError(_0x202b39,null));};exports[_0x182c('0xd7')]=function(_0x5956e3,_0x49b6af,_0xbaef58){return db[_0x182c('0x3d')][_0x182c('0x59')]({'where':{'id':_0x5956e3[_0x182c('0x5e')]['id']}})[_0x182c('0x1e')](handleEntityNotFound(_0x49b6af,null))[_0x182c('0x1e')](function(_0x527b09){if(_0x527b09){return _0x527b09['removeAgents'](_0x5956e3[_0x182c('0x43')][_0x182c('0x67')])['then'](function(){if(_[_0x182c('0xd8')](_0x5956e3[_0x182c('0x43')][_0x182c('0x67')])){for(var _0x5e58b7=0x0;_0x5e58b7<_0x5956e3['query'][_0x182c('0x67')][_0x182c('0x49')];_0x5e58b7+=0x1){socket[_0x182c('0xd6')](_0x182c('0xd9'),{'UserId':Number(_0x5956e3[_0x182c('0x43')][_0x182c('0x67')][_0x5e58b7]),'SmsAccountId':Number(_0x5956e3['params']['id'])});}}else{socket['emit'](_0x182c('0xd9'),{'UserId':Number(_0x5956e3['query'][_0x182c('0x67')]),'SmsAccountId':Number(_0x5956e3[_0x182c('0x5e')]['id'])});}});}})[_0x182c('0x1e')](respondWithStatusCode(_0x49b6af,null))[_0x182c('0x27')](handleError(_0x49b6af,null));};exports[_0x182c('0xda')]=function(_0x5c7691,_0x5432c5,_0x1bd200){var _0x330331={};var _0x5b844d={};var _0x2b5b31;var _0x4c8d10;return db[_0x182c('0x3d')][_0x182c('0x63')]({'where':{'id':_0x5c7691[_0x182c('0x5e')]['id']}})[_0x182c('0x1e')](handleEntityNotFound(_0x5432c5,null))[_0x182c('0x1e')](function(_0x5c4022){if(_0x5c4022){_0x2b5b31=_0x5c4022;_0x5b844d[_0x182c('0x41')]=_[_0x182c('0x44')](db[_0x182c('0xa3')][_0x182c('0x3e')]);_0x5b844d[_0x182c('0x43')]=_[_0x182c('0x44')](_0x5c7691['query']);_0x5b844d[_0x182c('0x45')]=_[_0x182c('0x46')](_0x5b844d[_0x182c('0x41')],_0x5b844d[_0x182c('0x43')]);_0x330331['attributes']=_[_0x182c('0x46')](_0x5b844d['model'],qs[_0x182c('0x47')](_0x5c7691['query'][_0x182c('0x47')]));_0x330331[_0x182c('0x48')]=_0x330331[_0x182c('0x48')]['length']?_0x330331[_0x182c('0x48')]:_0x5b844d['model'];_0x330331[_0x182c('0x4b')]=qs[_0x182c('0x4c')](_0x5c7691[_0x182c('0x43')][_0x182c('0x4c')]);_0x330331[_0x182c('0x4d')]=qs[_0x182c('0x45')](_['pick'](_0x5c7691[_0x182c('0x43')],_0x5b844d[_0x182c('0x45')]));if(_0x5c7691[_0x182c('0x43')][_0x182c('0x4f')]){_0x330331[_0x182c('0x4d')]=_['merge'](_0x330331['where'],{'$or':_[_0x182c('0x3c')](_0x330331[_0x182c('0x48')],function(_0x3ceca0){var _0x5a88f5={};_0x5a88f5[_0x3ceca0]={'$like':'%'+_0x5c7691[_0x182c('0x43')][_0x182c('0x4f')]+'%'};return _0x5a88f5;})});}_0x330331=_[_0x182c('0x50')]({},_0x330331,_0x5c7691[_0x182c('0x51')]);return _0x2b5b31[_0x182c('0xda')](_0x330331);}})[_0x182c('0x1e')](function(_0x50faa3){if(_0x50faa3){_0x4c8d10=_0x50faa3[_0x182c('0x49')];if(!_0x5c7691[_0x182c('0x43')][_0x182c('0x64')]('nolimit')){_0x330331['limit']=qs[_0x182c('0x2c')](_0x5c7691[_0x182c('0x43')][_0x182c('0x2c')]);_0x330331[_0x182c('0x2a')]=qs[_0x182c('0x2a')](_0x5c7691['query'][_0x182c('0x2a')]);}return _0x2b5b31[_0x182c('0xda')](_0x330331);}})[_0x182c('0x1e')](function(_0x45da11){if(_0x45da11){return _0x45da11?{'count':_0x4c8d10,'rows':_0x45da11}:null;}})[_0x182c('0x1e')](respondWithResult(_0x5432c5,null))[_0x182c('0x27')](handleError(_0x5432c5,null));}; \ No newline at end of file +var _0xd4c1=['account','applications','asc','Applications','CmContact','Sequelize','difference','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','from','From','Body','messageId','MessageSid','sender','connectel','clicksend','plivo','MessageUUID','infobip','results','text','csc','originatingAddress','segmentedMessage','clickatell','fromNumber','replyMessageId','bandwidth','intelepeer','isNil','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','DESC','list','omit','Contacts','contact','SmsInteraction','spread','interaction','autoclose','push','unmanaged','SmsMessage','ContactId','UserId','User','unshift','waitForTheAssignedAgent','*,*,*,*','Start','startRouting','receiveMessage','info','entity\x20found','debug','SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s','text/xml','\x0a','addApplications','sequelize','bulkCreate','findAndCountAll','priority','getApplications','Contact','Owner','internal','Tag','Tags','tag','to\x20is\x20mandatory','List','out','Messages','dataValues','received\x20delivery\x20report\x20from','skebby','skebby_dispatch_id','requestid','statusInt','message_id','status_code','groupName','DELIVERED','redif','inspect','error_code','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','message-delivered','DELIVRD','statusGet','message-id','state','addAgents','userSmsAccount:save','removeAgents','isArray','emit','userSmsAccount:remove','getAgents','eml-format','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','defaults','localhost','socket.io-emitter','redis','./smsAccount.socket','register','client','http','then','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsAccount,\x20%s,\x20%s','message','request\x20sent','catch','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','get','SmsAccounts','UserProfileResource','stack','name','send','index','Pause','mandatoryDispositionPause','SmsAccount','rawAttributes','fieldName','model','map','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','includeAll','findAll','rows','show','params','include','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','SmsAccountId','findOne','Disposition','removeDispositions','ids','CannedAnswer','getAnswers','removeAnswers','sms','SmsApplication'];(function(_0x3e2164,_0x5a3178){var _0x4a52bf=function(_0x1f99c7){while(--_0x1f99c7){_0x3e2164['push'](_0x3e2164['shift']());}};_0x4a52bf(++_0x5a3178);}(_0xd4c1,0x151));var _0x1d4c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd4c1[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0x1d4c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1d4c('0x1'));var jsonpatch=require(_0x1d4c('0x2'));var rp=require('request-promise');var moment=require(_0x1d4c('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x1d4c('0x4'));var util=require(_0x1d4c('0x5'));var path=require(_0x1d4c('0x6'));var sox=require(_0x1d4c('0x7'));var csv=require(_0x1d4c('0x8'));var ejs=require(_0x1d4c('0x9'));var fs=require('fs');var fs_extra=require(_0x1d4c('0xa'));var _=require(_0x1d4c('0xb'));var squel=require(_0x1d4c('0xc'));var crypto=require('crypto');var jsforce=require(_0x1d4c('0xd'));var deskjs=require(_0x1d4c('0xe'));var toCsv=require(_0x1d4c('0x8'));var querystring=require('querystring');var Papa=require(_0x1d4c('0xf'));var Redis=require(_0x1d4c('0x10'));var authService=require(_0x1d4c('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1d4c('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x1d4c('0x13'));var config=require(_0x1d4c('0x14'));var licenseUtil=require(_0x1d4c('0x15'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x1d4c('0x16')](config['redis'],{'host':_0x1d4c('0x17'),'port':0x18eb});var socket=require(_0x1d4c('0x18'))(new Redis(config[_0x1d4c('0x19')]));require(_0x1d4c('0x1a'))[_0x1d4c('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson[_0x1d4c('0x1c')][_0x1d4c('0x1d')]({'port':0x232c});function respondWithRpcPromise(_0x4fe4fb,_0x1f3507,_0x3970d4,_0x14df3f){return new BPromise(function(_0x8628b8,_0x4004d2){var _0x11c81d=_0x14df3f||client;return _0x11c81d['request'](_0x4fe4fb,_0x3970d4)[_0x1d4c('0x1e')](function(_0xc09853){logger['info']('SmsAccount,\x20%s,\x20%s',_0x1f3507,'request\x20sent');logger['debug'](_0x1d4c('0x1f'),_0x1f3507,'request\x20sent',JSON[_0x1d4c('0x20')](_0xc09853));if(_0xc09853[_0x1d4c('0x21')]){if(_0xc09853[_0x1d4c('0x21')][_0x1d4c('0x22')]===0x1f4){logger[_0x1d4c('0x21')](_0x1d4c('0x23'),_0x1f3507,_0xc09853['error']['message']);return _0x4004d2(_0xc09853[_0x1d4c('0x21')][_0x1d4c('0x24')]);}logger['error'](_0x1d4c('0x23'),_0x1f3507,_0xc09853['error'][_0x1d4c('0x24')]);return _0x8628b8(_0xc09853['error'][_0x1d4c('0x24')]);}else{logger['info'](_0x1d4c('0x23'),_0x1f3507,_0x1d4c('0x25'));_0x8628b8(_0xc09853['result'][_0x1d4c('0x24')]);}})[_0x1d4c('0x26')](function(_0x3b2c8d){logger[_0x1d4c('0x21')](_0x1d4c('0x23'),_0x1f3507,_0x3b2c8d);_0x4004d2(_0x3b2c8d);});});}function respondWithStatusCode(_0x1d6f11,_0x2557ad){_0x2557ad=_0x2557ad||0xcc;return function(_0x32a8e3){if(_0x32a8e3){return _0x1d6f11[_0x1d4c('0x27')](_0x2557ad);}return _0x1d6f11['status'](_0x2557ad)[_0x1d4c('0x28')]();};}function respondWithResult(_0x36dd77,_0x32d9ed){_0x32d9ed=_0x32d9ed||0xc8;return function(_0x586d17){if(_0x586d17){return _0x36dd77[_0x1d4c('0x29')](_0x32d9ed)['json'](_0x586d17);}};}function respondWithFilteredResult(_0x55d98d,_0x418eac){return function(_0x49702e){if(_0x49702e){var _0x1680eb=typeof _0x418eac[_0x1d4c('0x2a')]===_0x1d4c('0x2b')&&typeof _0x418eac[_0x1d4c('0x2c')]===_0x1d4c('0x2b');var _0x581652=_0x49702e[_0x1d4c('0x2d')];var _0x57688c=_0x1680eb?0x0:_0x418eac[_0x1d4c('0x2a')];var _0xbff78a=_0x1680eb?_0x49702e[_0x1d4c('0x2d')]:_0x418eac[_0x1d4c('0x2a')]+_0x418eac['limit'];var _0x4a46f9;if(_0xbff78a>=_0x581652){_0xbff78a=_0x581652;_0x4a46f9=0xc8;}else{_0x4a46f9=0xce;}_0x55d98d[_0x1d4c('0x29')](_0x4a46f9);return _0x55d98d[_0x1d4c('0x2e')](_0x1d4c('0x2f'),_0x57688c+'-'+_0xbff78a+'/'+_0x581652)['json'](_0x49702e);}return null;};}function patchUpdates(_0xdbcaa8){return function(_0x1e1782){try{jsonpatch[_0x1d4c('0x30')](_0x1e1782,_0xdbcaa8,!![]);}catch(_0x491bbf){return BPromise[_0x1d4c('0x31')](_0x491bbf);}return _0x1e1782[_0x1d4c('0x32')]();};}function saveUpdates(_0x4de1e5,_0x22fe9c){return function(_0x1c56af){if(_0x1c56af){return _0x1c56af[_0x1d4c('0x33')](_0x4de1e5)[_0x1d4c('0x1e')](function(_0x4d5196){return _0x4d5196;});}return null;};}function removeEntity(_0x482fb4,_0x4a52d8){return function(_0x5427b6){if(_0x5427b6){return _0x5427b6[_0x1d4c('0x34')]()[_0x1d4c('0x1e')](function(){var _0x6ff04d=_0x5427b6[_0x1d4c('0x35')]({'plain':!![]});var _0x1de0fd=_0x1d4c('0x36');return db[_0x1d4c('0x37')]['destroy']({'where':{'type':_0x1de0fd,'resourceId':_0x6ff04d['id']}})[_0x1d4c('0x1e')](function(){return _0x5427b6;});})[_0x1d4c('0x1e')](function(){_0x482fb4[_0x1d4c('0x29')](0xcc)[_0x1d4c('0x28')]();});}};}function handleEntityNotFound(_0x2f1dfa,_0x34093f){return function(_0x413b53){if(!_0x413b53){_0x2f1dfa[_0x1d4c('0x27')](0x194);}return _0x413b53;};}function handleError(_0x3a53b3,_0x514b06){_0x514b06=_0x514b06||0x1f4;return function(_0x50a017){logger['error'](_0x50a017[_0x1d4c('0x38')]);if(_0x50a017['name']){delete _0x50a017[_0x1d4c('0x39')];}_0x3a53b3['status'](_0x514b06)[_0x1d4c('0x3a')](_0x50a017);};}exports[_0x1d4c('0x3b')]=function(_0x5ce6f4,_0x1987ae){var _0x3b7616={'include':[{'model':db[_0x1d4c('0x3c')],'as':_0x1d4c('0x3d')}]},_0xbf0896={},_0x25936c={'count':0x0,'rows':[]};var _0x49550e=_['map'](db[_0x1d4c('0x3e')][_0x1d4c('0x3f')],function(_0x2190e8){return{'name':_0x2190e8[_0x1d4c('0x40')],'type':_0x2190e8['type']['key']};});_0xbf0896[_0x1d4c('0x41')]=_[_0x1d4c('0x42')](_0x49550e,'name');_0xbf0896[_0x1d4c('0x43')]=_[_0x1d4c('0x44')](_0x5ce6f4[_0x1d4c('0x43')]);_0xbf0896['filters']=_[_0x1d4c('0x45')](_0xbf0896[_0x1d4c('0x41')],_0xbf0896[_0x1d4c('0x43')]);_0x3b7616['attributes']=_['intersection'](_0xbf0896['model'],qs[_0x1d4c('0x46')](_0x5ce6f4[_0x1d4c('0x43')]['fields']));_0x3b7616[_0x1d4c('0x47')]=_0x3b7616[_0x1d4c('0x47')][_0x1d4c('0x48')]?_0x3b7616[_0x1d4c('0x47')]:_0xbf0896[_0x1d4c('0x41')];if(!_0x5ce6f4['query'][_0x1d4c('0x49')](_0x1d4c('0x4a'))){_0x3b7616[_0x1d4c('0x2c')]=qs['limit'](_0x5ce6f4[_0x1d4c('0x43')][_0x1d4c('0x2c')]);_0x3b7616[_0x1d4c('0x2a')]=qs[_0x1d4c('0x2a')](_0x5ce6f4['query'][_0x1d4c('0x2a')]);}_0x3b7616[_0x1d4c('0x4b')]=qs[_0x1d4c('0x4c')](_0x5ce6f4[_0x1d4c('0x43')][_0x1d4c('0x4c')]);_0x3b7616[_0x1d4c('0x4d')]=qs[_0x1d4c('0x4e')](_[_0x1d4c('0x4f')](_0x5ce6f4[_0x1d4c('0x43')],_0xbf0896[_0x1d4c('0x4e')]),_0x49550e);if(_0x5ce6f4[_0x1d4c('0x43')][_0x1d4c('0x50')]){_0x3b7616[_0x1d4c('0x4d')]=_[_0x1d4c('0x51')](_0x3b7616['where'],{'$or':_[_0x1d4c('0x42')](_0x49550e,function(_0x3b7e90){if(_0x3b7e90[_0x1d4c('0x52')]!==_0x1d4c('0x53')){var _0x47d62d={};_0x47d62d[_0x3b7e90['name']]={'$like':'%'+_0x5ce6f4[_0x1d4c('0x43')][_0x1d4c('0x50')]+'%'};return _0x47d62d;}})});}_0x3b7616=_['merge']({},_0x3b7616,_0x5ce6f4['options']);var _0x55027f={'where':_0x3b7616['where']};return db['SmsAccount']['count'](_0x55027f)[_0x1d4c('0x1e')](function(_0x51135e){_0x25936c[_0x1d4c('0x2d')]=_0x51135e;if(_0x5ce6f4['query'][_0x1d4c('0x54')]){_0x3b7616['include']=[{'all':!![]}];}return db['SmsAccount'][_0x1d4c('0x55')](_0x3b7616);})[_0x1d4c('0x1e')](function(_0x190965){_0x25936c[_0x1d4c('0x56')]=_0x190965;return _0x25936c;})[_0x1d4c('0x1e')](respondWithFilteredResult(_0x1987ae,_0x3b7616))[_0x1d4c('0x26')](handleError(_0x1987ae,null));};exports[_0x1d4c('0x57')]=function(_0x33b53e,_0x1ba135){var _0x32d005={'raw':![],'where':{'id':_0x33b53e[_0x1d4c('0x58')]['id']},'include':[{'model':db[_0x1d4c('0x3c')],'as':_0x1d4c('0x3d')}]},_0x599f8a={};_0x599f8a[_0x1d4c('0x41')]=_[_0x1d4c('0x44')](db['SmsAccount'][_0x1d4c('0x3f')]);_0x599f8a[_0x1d4c('0x43')]=_[_0x1d4c('0x44')](_0x33b53e[_0x1d4c('0x43')]);_0x599f8a[_0x1d4c('0x4e')]=_[_0x1d4c('0x45')](_0x599f8a[_0x1d4c('0x41')],_0x599f8a['query']);_0x32d005['attributes']=_[_0x1d4c('0x45')](_0x599f8a[_0x1d4c('0x41')],qs['fields'](_0x33b53e[_0x1d4c('0x43')][_0x1d4c('0x46')]));_0x32d005['attributes']=_0x32d005[_0x1d4c('0x47')]['length']?_0x32d005[_0x1d4c('0x47')]:_0x599f8a[_0x1d4c('0x41')];if(_0x33b53e['query'][_0x1d4c('0x54')]){_0x32d005[_0x1d4c('0x59')]=[{'all':!![]}];}_0x32d005=_[_0x1d4c('0x51')]({},_0x32d005,_0x33b53e[_0x1d4c('0x5a')]);return db[_0x1d4c('0x3e')]['find'](_0x32d005)['then'](handleEntityNotFound(_0x1ba135,null))[_0x1d4c('0x1e')](respondWithResult(_0x1ba135,null))[_0x1d4c('0x26')](handleError(_0x1ba135,null));};exports[_0x1d4c('0x5b')]=function(_0x2333cc,_0x468599){return db[_0x1d4c('0x3e')]['create'](_0x2333cc[_0x1d4c('0x5c')],{})[_0x1d4c('0x1e')](function(_0x57eaf8){var _0x1c5535=_0x2333cc[_0x1d4c('0x5d')][_0x1d4c('0x35')]({'plain':!![]});if(!_0x1c5535)throw new Error(_0x1d4c('0x5e'));if(_0x1c5535[_0x1d4c('0x5f')]===_0x1d4c('0x5d')){var _0x260a3e=_0x57eaf8[_0x1d4c('0x35')]({'plain':!![]});var _0x1fd7fd=_0x1d4c('0x36');return db[_0x1d4c('0x60')][_0x1d4c('0x61')]({'where':{'name':_0x1fd7fd,'userProfileId':_0x1c5535[_0x1d4c('0x62')]},'raw':!![]})[_0x1d4c('0x1e')](function(_0x674654){if(_0x674654&&_0x674654[_0x1d4c('0x63')]===0x0){return db[_0x1d4c('0x37')][_0x1d4c('0x5b')]({'name':_0x260a3e[_0x1d4c('0x39')],'resourceId':_0x260a3e['id'],'type':_0x674654[_0x1d4c('0x39')],'sectionId':_0x674654['id']},{})['then'](function(){return _0x57eaf8;});}else{return _0x57eaf8;}})[_0x1d4c('0x26')](function(_0x107b4a){logger[_0x1d4c('0x21')](_0x1d4c('0x64'),_0x107b4a);throw _0x107b4a;});}return _0x57eaf8;})['then'](respondWithResult(_0x468599,0xc9))[_0x1d4c('0x26')](handleError(_0x468599,null));};exports[_0x1d4c('0x33')]=function(_0x556d16,_0x382b6a){if(_0x556d16[_0x1d4c('0x5c')]['id']){delete _0x556d16[_0x1d4c('0x5c')]['id'];}return db['SmsAccount'][_0x1d4c('0x61')]({'where':{'id':_0x556d16['params']['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})[_0x1d4c('0x1e')](handleEntityNotFound(_0x382b6a,null))[_0x1d4c('0x1e')](saveUpdates(_0x556d16['body'],null))['then'](respondWithResult(_0x382b6a,null))[_0x1d4c('0x26')](handleError(_0x382b6a,null));};exports['destroy']=function(_0x261dcb,_0x1e29b8){return db['SmsAccount'][_0x1d4c('0x61')]({'where':{'id':_0x261dcb[_0x1d4c('0x58')]['id']}})[_0x1d4c('0x1e')](handleEntityNotFound(_0x1e29b8,null))['then'](removeEntity(_0x1e29b8,null))[_0x1d4c('0x26')](handleError(_0x1e29b8,null));};exports[_0x1d4c('0x65')]=function(_0x479518,_0x425ee7){return db[_0x1d4c('0x3e')][_0x1d4c('0x65')]()[_0x1d4c('0x1e')](respondWithResult(_0x425ee7,null))[_0x1d4c('0x26')](handleError(_0x425ee7,null));};exports[_0x1d4c('0x66')]=function(_0x2d8cd6,_0x26bb5e,_0x45e437){if(_0x2d8cd6[_0x1d4c('0x5c')]['id']){delete _0x2d8cd6[_0x1d4c('0x5c')]['id'];}return db[_0x1d4c('0x3e')][_0x1d4c('0x61')]({'where':{'id':_0x2d8cd6['params']['id']}})[_0x1d4c('0x1e')](handleEntityNotFound(_0x26bb5e,null))[_0x1d4c('0x1e')](function(_0x729e4f){if(_0x729e4f){_0x2d8cd6[_0x1d4c('0x5c')][_0x1d4c('0x67')]=_0x729e4f['id'];return db['Disposition'][_0x1d4c('0x5b')](_0x2d8cd6[_0x1d4c('0x5c')]);}})['then'](respondWithResult(_0x26bb5e,null))[_0x1d4c('0x26')](handleError(_0x26bb5e,null));};exports['getDispositions']=function(_0x384051,_0x3913af,_0x341631){var _0x485785={'raw':![],'where':{}};var _0x3b514c={};var _0x4c071f={'count':0x0,'rows':[]};return db['SmsAccount'][_0x1d4c('0x68')]({'where':{'id':_0x384051[_0x1d4c('0x58')]['id']}})['then'](handleEntityNotFound(_0x3913af,null))[_0x1d4c('0x1e')](function(_0x455db1){if(_0x455db1){_0x3b514c['model']=_[_0x1d4c('0x44')](db['Disposition'][_0x1d4c('0x3f')]);_0x3b514c[_0x1d4c('0x43')]=_[_0x1d4c('0x44')](_0x384051['query']);_0x3b514c[_0x1d4c('0x4e')]=_[_0x1d4c('0x45')](_0x3b514c['model'],_0x3b514c[_0x1d4c('0x43')]);_0x485785['attributes']=_[_0x1d4c('0x45')](_0x3b514c[_0x1d4c('0x41')],qs[_0x1d4c('0x46')](_0x384051[_0x1d4c('0x43')][_0x1d4c('0x46')]));_0x485785[_0x1d4c('0x47')]=_0x485785['attributes'][_0x1d4c('0x48')]?_0x485785[_0x1d4c('0x47')]:_0x3b514c[_0x1d4c('0x41')];if(!_0x384051[_0x1d4c('0x43')][_0x1d4c('0x49')](_0x1d4c('0x4a'))){_0x485785[_0x1d4c('0x2c')]=qs[_0x1d4c('0x2c')](_0x384051[_0x1d4c('0x43')][_0x1d4c('0x2c')]);_0x485785['offset']=qs[_0x1d4c('0x2a')](_0x384051['query'][_0x1d4c('0x2a')]);}_0x485785[_0x1d4c('0x4b')]=qs[_0x1d4c('0x4c')](_0x384051['query'][_0x1d4c('0x4c')]);_0x485785[_0x1d4c('0x4d')]=qs[_0x1d4c('0x4e')](_[_0x1d4c('0x4f')](_0x384051[_0x1d4c('0x43')],_0x3b514c[_0x1d4c('0x4e')]));_0x485785[_0x1d4c('0x4d')][_0x1d4c('0x67')]=_0x455db1['id'];if(_0x384051[_0x1d4c('0x43')]['filter']){_0x485785['where']=_[_0x1d4c('0x51')](_0x485785['where'],{'$or':_['map'](_0x485785[_0x1d4c('0x47')],function(_0x3fc368){var _0xbc6772={};_0xbc6772[_0x3fc368]={'$like':'%'+_0x384051[_0x1d4c('0x43')]['filter']+'%'};return _0xbc6772;})});}_0x485785=_[_0x1d4c('0x51')]({},_0x485785,_0x384051[_0x1d4c('0x5a')]);return db[_0x1d4c('0x69')][_0x1d4c('0x2d')]({'where':_0x485785[_0x1d4c('0x4d')]})[_0x1d4c('0x1e')](function(_0x56b8ba){_0x4c071f[_0x1d4c('0x2d')]=_0x56b8ba;if(_0x384051[_0x1d4c('0x43')][_0x1d4c('0x54')]){_0x485785[_0x1d4c('0x59')]=[{'all':!![]}];}return db[_0x1d4c('0x69')][_0x1d4c('0x55')](_0x485785);})[_0x1d4c('0x1e')](function(_0x300426){_0x4c071f['rows']=_0x300426;return _0x4c071f;});}})[_0x1d4c('0x1e')](respondWithFilteredResult(_0x3913af,_0x485785))[_0x1d4c('0x26')](handleError(_0x3913af,null));};exports[_0x1d4c('0x6a')]=function(_0x3e0009,_0x400aae,_0x233778){return db['SmsAccount'][_0x1d4c('0x61')]({'where':{'id':_0x3e0009[_0x1d4c('0x58')]['id']}})[_0x1d4c('0x1e')](handleEntityNotFound(_0x400aae,null))[_0x1d4c('0x1e')](function(_0x3d7034){if(_0x3d7034){return _0x3d7034[_0x1d4c('0x6a')](_0x3e0009[_0x1d4c('0x43')][_0x1d4c('0x6b')]);}})[_0x1d4c('0x1e')](respondWithStatusCode(_0x400aae,null))[_0x1d4c('0x26')](handleError(_0x400aae,null));};exports['addAnswer']=function(_0x2feb77,_0x1d667d,_0x57e5ca){if(_0x2feb77['body']['id']){delete _0x2feb77[_0x1d4c('0x5c')]['id'];}return db[_0x1d4c('0x3e')][_0x1d4c('0x61')]({'where':{'id':_0x2feb77['params']['id']}})[_0x1d4c('0x1e')](handleEntityNotFound(_0x1d667d,null))[_0x1d4c('0x1e')](function(_0x2d2f14){if(_0x2d2f14){_0x2feb77[_0x1d4c('0x5c')][_0x1d4c('0x67')]=_0x2d2f14['id'];return db[_0x1d4c('0x6c')]['create'](_0x2feb77[_0x1d4c('0x5c')]);}})['then'](respondWithResult(_0x1d667d,null))[_0x1d4c('0x26')](handleError(_0x1d667d,null));};exports[_0x1d4c('0x6d')]=function(_0x13c05b,_0x4d0f2b,_0x36f7f3){var _0x4ad80b={'raw':![],'where':{}};var _0x33210f={};var _0x184bce={'count':0x0,'rows':[]};return db['SmsAccount'][_0x1d4c('0x68')]({'where':{'id':_0x13c05b[_0x1d4c('0x58')]['id']}})[_0x1d4c('0x1e')](handleEntityNotFound(_0x4d0f2b,null))[_0x1d4c('0x1e')](function(_0x51fcbf){if(_0x51fcbf){_0x33210f[_0x1d4c('0x41')]=_[_0x1d4c('0x44')](db[_0x1d4c('0x6c')][_0x1d4c('0x3f')]);_0x33210f[_0x1d4c('0x43')]=_[_0x1d4c('0x44')](_0x13c05b[_0x1d4c('0x43')]);_0x33210f['filters']=_[_0x1d4c('0x45')](_0x33210f[_0x1d4c('0x41')],_0x33210f[_0x1d4c('0x43')]);_0x4ad80b['attributes']=_[_0x1d4c('0x45')](_0x33210f['model'],qs[_0x1d4c('0x46')](_0x13c05b[_0x1d4c('0x43')]['fields']));_0x4ad80b['attributes']=_0x4ad80b[_0x1d4c('0x47')][_0x1d4c('0x48')]?_0x4ad80b[_0x1d4c('0x47')]:_0x33210f['model'];if(!_0x13c05b[_0x1d4c('0x43')]['hasOwnProperty'](_0x1d4c('0x4a'))){_0x4ad80b[_0x1d4c('0x2c')]=qs[_0x1d4c('0x2c')](_0x13c05b[_0x1d4c('0x43')][_0x1d4c('0x2c')]);_0x4ad80b['offset']=qs[_0x1d4c('0x2a')](_0x13c05b[_0x1d4c('0x43')][_0x1d4c('0x2a')]);}_0x4ad80b['order']=qs[_0x1d4c('0x4c')](_0x13c05b['query']['sort']);_0x4ad80b[_0x1d4c('0x4d')]=qs[_0x1d4c('0x4e')](_[_0x1d4c('0x4f')](_0x13c05b[_0x1d4c('0x43')],_0x33210f[_0x1d4c('0x4e')]));_0x4ad80b[_0x1d4c('0x4d')][_0x1d4c('0x67')]=_0x51fcbf['id'];if(_0x13c05b[_0x1d4c('0x43')][_0x1d4c('0x50')]){_0x4ad80b['where']=_[_0x1d4c('0x51')](_0x4ad80b[_0x1d4c('0x4d')],{'$or':_[_0x1d4c('0x42')](_0x4ad80b[_0x1d4c('0x47')],function(_0x2cfead){var _0x5e4b45={};_0x5e4b45[_0x2cfead]={'$like':'%'+_0x13c05b[_0x1d4c('0x43')]['filter']+'%'};return _0x5e4b45;})});}_0x4ad80b=_[_0x1d4c('0x51')]({},_0x4ad80b,_0x13c05b[_0x1d4c('0x5a')]);return db[_0x1d4c('0x6c')][_0x1d4c('0x2d')]({'where':_0x4ad80b[_0x1d4c('0x4d')]})[_0x1d4c('0x1e')](function(_0x4bd41c){_0x184bce[_0x1d4c('0x2d')]=_0x4bd41c;if(_0x13c05b['query'][_0x1d4c('0x54')]){_0x4ad80b[_0x1d4c('0x59')]=[{'all':!![]}];}return db[_0x1d4c('0x6c')][_0x1d4c('0x55')](_0x4ad80b);})[_0x1d4c('0x1e')](function(_0x2de1ea){_0x184bce[_0x1d4c('0x56')]=_0x2de1ea;return _0x184bce;});}})['then'](respondWithFilteredResult(_0x4d0f2b,_0x4ad80b))[_0x1d4c('0x26')](handleError(_0x4d0f2b,null));};exports[_0x1d4c('0x6e')]=function(_0x5895fd,_0x26b99b,_0x1fdc74){return db[_0x1d4c('0x3e')][_0x1d4c('0x61')]({'where':{'id':_0x5895fd['params']['id']}})['then'](handleEntityNotFound(_0x26b99b,null))[_0x1d4c('0x1e')](function(_0x52d66e){if(_0x52d66e){return _0x52d66e[_0x1d4c('0x6e')](_0x5895fd[_0x1d4c('0x43')]['ids']);}})['then'](respondWithStatusCode(_0x26b99b,null))[_0x1d4c('0x26')](handleError(_0x26b99b,null));};exports['notify']=function(_0x4aaa90,_0x2510b4,_0x30fa8d){var _0x48c915={'channel':_0x1d4c('0x6f')};var _0x37f248=[];var _0x1688bb=[];var _0x189ec8={};return db['SmsAccount'][_0x1d4c('0x61')]({'where':{'id':_0x4aaa90[_0x1d4c('0x58')]['id']},'include':[{'model':db[_0x1d4c('0x70')],'as':'Applications'}]})['then'](handleEntityNotFound(_0x2510b4,null))['then'](function(_0x44f216){_0x48c915[_0x1d4c('0x71')]=_0x44f216;_0x48c915[_0x1d4c('0x72')]=_['orderBy'](_0x44f216['Applications'],['priority'],[_0x1d4c('0x73')]);if(_0x48c915[_0x1d4c('0x71')][_0x1d4c('0x74')]){delete _0x48c915[_0x1d4c('0x71')][_0x1d4c('0x74')];}return db[_0x1d4c('0x75')]['describe']();})['then'](function(_0x151e75){if(!_0x151e75){throw new db[(_0x1d4c('0x76'))]['ValidationError']('no\x20available\x20attributes');}_0x37f248=_[_0x1d4c('0x77')](_[_0x1d4c('0x44')](_0x151e75),[_0x1d4c('0x78'),_0x1d4c('0x79')]);_0x1688bb=_['difference'](_[_0x1d4c('0x44')](_0x151e75),['createdAt',_0x1d4c('0x79'),_0x1d4c('0x7a'),_0x1d4c('0x7b')]);_0x48c915[_0x1d4c('0x5c')]={'mapKey':_0x1d4c('0x7c')};if(_0x48c915['account'][_0x1d4c('0x52')]){switch(_0x48c915[_0x1d4c('0x71')]['type']){case _0x1d4c('0x7d'):_0x48c915['body'][_0x1d4c('0x7e')]=_0x4aaa90[_0x1d4c('0x5c')][_0x1d4c('0x7f')];_0x48c915[_0x1d4c('0x5c')][_0x1d4c('0x5c')]=_0x4aaa90[_0x1d4c('0x5c')][_0x1d4c('0x80')];_0x48c915[_0x1d4c('0x5c')][_0x1d4c('0x81')]=_0x4aaa90[_0x1d4c('0x5c')][_0x1d4c('0x82')];break;case'skebby':_0x48c915[_0x1d4c('0x5c')]['from']='+'+_0x4aaa90[_0x1d4c('0x5c')][_0x1d4c('0x83')];_0x48c915[_0x1d4c('0x5c')][_0x1d4c('0x5c')]=_0x4aaa90['body']['text'];break;case _0x1d4c('0x84'):_0x48c915['body']['from']=_0x4aaa90['body'][_0x1d4c('0x7e')];_0x48c915[_0x1d4c('0x5c')][_0x1d4c('0x5c')]=_0x4aaa90[_0x1d4c('0x5c')]['message'];break;case _0x1d4c('0x85'):_0x48c915[_0x1d4c('0x5c')][_0x1d4c('0x7e')]=_0x4aaa90[_0x1d4c('0x5c')][_0x1d4c('0x7e')];_0x48c915[_0x1d4c('0x5c')][_0x1d4c('0x5c')]=_0x4aaa90[_0x1d4c('0x5c')]['body'];_0x48c915[_0x1d4c('0x5c')][_0x1d4c('0x81')]=_0x4aaa90[_0x1d4c('0x5c')]['message_id'];break;case _0x1d4c('0x86'):_0x48c915[_0x1d4c('0x5c')][_0x1d4c('0x7e')]=_0x4aaa90['body']['From'];_0x48c915[_0x1d4c('0x5c')][_0x1d4c('0x5c')]=_0x4aaa90[_0x1d4c('0x5c')]['Text'];_0x48c915[_0x1d4c('0x5c')]['messageId']=_0x4aaa90[_0x1d4c('0x5c')][_0x1d4c('0x87')];break;case _0x1d4c('0x88'):_0x48c915[_0x1d4c('0x5c')]['from']='+'+_0x4aaa90['body'][_0x1d4c('0x89')][0x0][_0x1d4c('0x7e')];_0x48c915[_0x1d4c('0x5c')][_0x1d4c('0x5c')]=_0x4aaa90[_0x1d4c('0x5c')][_0x1d4c('0x89')][0x0][_0x1d4c('0x8a')];_0x48c915[_0x1d4c('0x5c')][_0x1d4c('0x81')]=_0x4aaa90[_0x1d4c('0x5c')]['results'][0x0][_0x1d4c('0x81')];break;case _0x1d4c('0x8b'):_0x48c915[_0x1d4c('0x5c')][_0x1d4c('0x7e')]=_0x4aaa90[_0x1d4c('0x5c')][_0x1d4c('0x8c')];_0x48c915[_0x1d4c('0x5c')][_0x1d4c('0x5c')]=_0x4aaa90[_0x1d4c('0x5c')][_0x1d4c('0x8d')][_0x1d4c('0x24')];break;case _0x1d4c('0x8e'):_0x48c915[_0x1d4c('0x5c')][_0x1d4c('0x7e')]=_0x4aaa90['body'][_0x1d4c('0x8f')];_0x48c915['body'][_0x1d4c('0x5c')]=_0x4aaa90[_0x1d4c('0x5c')]['text'];_0x48c915[_0x1d4c('0x5c')][_0x1d4c('0x81')]=_0x4aaa90['body'][_0x1d4c('0x90')];break;case _0x1d4c('0x91'):_0x48c915[_0x1d4c('0x5c')][_0x1d4c('0x81')]=_0x4aaa90[_0x1d4c('0x5c')][0x0][_0x1d4c('0x24')]['id'];_0x48c915[_0x1d4c('0x5c')]['from']=_0x4aaa90[_0x1d4c('0x5c')][0x0][_0x1d4c('0x24')][_0x1d4c('0x7e')];_0x48c915[_0x1d4c('0x5c')][_0x1d4c('0x5c')]=_0x4aaa90[_0x1d4c('0x5c')][0x0][_0x1d4c('0x24')][_0x1d4c('0x8a')];break;case _0x1d4c('0x92'):_0x48c915[_0x1d4c('0x5c')][_0x1d4c('0x7e')]=_0x4aaa90[_0x1d4c('0x5c')][_0x1d4c('0x7e')];_0x48c915[_0x1d4c('0x5c')][_0x1d4c('0x5c')]=_0x4aaa90['body']['message'];_0x48c915[_0x1d4c('0x5c')][_0x1d4c('0x81')]=_0x4aaa90[_0x1d4c('0x5c')]['refid'];break;}}if(_0x48c915['body']['id']){delete _0x48c915['body']['id'];}if(_[_0x1d4c('0x93')](_0x48c915[_0x1d4c('0x5c')][_0x1d4c('0x7e')])){throw new db[(_0x1d4c('0x76'))][(_0x1d4c('0x94'))](_0x1d4c('0x95'));}if(_[_0x1d4c('0x93')](_0x48c915[_0x1d4c('0x5c')][_0x1d4c('0x5c')])||_0x48c915[_0x1d4c('0x5c')][_0x1d4c('0x5c')]===''){throw new db['Sequelize'][(_0x1d4c('0x94'))](_0x1d4c('0x96'));}if(_['isNil'](_0x48c915[_0x1d4c('0x5c')][_0x1d4c('0x97')])){throw new db['Sequelize'][(_0x1d4c('0x94'))](_0x1d4c('0x98')+_0x1688bb);}if(!_['includes'](_0x1688bb,_0x48c915[_0x1d4c('0x5c')][_0x1d4c('0x97')])){throw new db['Sequelize'][(_0x1d4c('0x94'))](_0x1d4c('0x99')+_0x1688bb);}_0x189ec8[_0x48c915[_0x1d4c('0x5c')]['mapKey']]=_0x48c915['body'][_0x1d4c('0x7e')];return db[_0x1d4c('0x9a')][_0x1d4c('0x61')]({'where':{'id':_0x48c915[_0x1d4c('0x71')][_0x1d4c('0x7b')]},'include':[{'model':db[_0x1d4c('0x75')],'as':'Contacts','where':_0x189ec8,'limit':0x1,'order':[[_0x1d4c('0x79'),_0x1d4c('0x9b')]]}]});})[_0x1d4c('0x1e')](handleEntityNotFound(_0x2510b4,null))[_0x1d4c('0x1e')](function(_0x144136){if(_0x144136){_0x48c915[_0x1d4c('0x9c')]=_[_0x1d4c('0x9d')](_0x144136,[_0x1d4c('0x9e')]);if(_0x144136[_0x1d4c('0x9e')][_0x1d4c('0x48')]){return _0x144136['Contacts'][0x0];}var _0x4d103b=_['defaults'](_0x48c915[_0x1d4c('0x5c')],{'firstName':_0x48c915[_0x1d4c('0x5c')]['from'],'ListId':_0x144136['id']});_0x4d103b[_0x48c915['body'][_0x1d4c('0x97')]]=_0x48c915[_0x1d4c('0x5c')]['from'];return db[_0x1d4c('0x75')][_0x1d4c('0x5b')](_0x4d103b,{'fields':_0x37f248,'raw':!![]});}})[_0x1d4c('0x1e')](handleEntityNotFound(_0x2510b4,null))[_0x1d4c('0x1e')](function(_0x1dcc9f){if(_0x1dcc9f){_0x48c915[_0x1d4c('0x9f')]=_0x1dcc9f;var _0x295d3f={'ContactId':_0x1dcc9f['id'],'phone':_0x48c915[_0x1d4c('0x5c')]['from'],'SmsAccountId':_0x4aaa90[_0x1d4c('0x58')]['id']};var _0x5aa1ef={'ContactId':_0x1dcc9f['id'],'SmsAccountId':_0x4aaa90['params']['id'],'closed':![]};return db[_0x1d4c('0xa0')][_0x1d4c('0x61')]({'where':_0x5aa1ef})[_0x1d4c('0x1e')](function(_0x2e3a55){if(_0x2e3a55){return[_0x2e3a55,![]];}return db['SmsInteraction'][_0x1d4c('0x5b')](_0x295d3f)[_0x1d4c('0x1e')](function(_0x3728c8){return[_0x3728c8,!![]];});});}})[_0x1d4c('0xa1')](function(_0x51f856,_0x434d4c){_0x48c915[_0x1d4c('0xa2')]=_0x51f856[_0x1d4c('0x35')]({'plain':!![]});_0x48c915[_0x1d4c('0xa2')]['created']=![];if(_0x434d4c){if(_0x48c915[_0x1d4c('0x71')][_0x1d4c('0xa3')]){_0x48c915[_0x1d4c('0x72')][_0x1d4c('0xa4')]({'id':0x0,'priority':_0x48c915['applications'][_0x1d4c('0x48')]+0x1,'app':'close','appdata':_0x1d4c('0xa5'),'interval':'*,*,*,*'});}_0x48c915[_0x1d4c('0xa2')]['created']=!![];}return db[_0x1d4c('0xa6')][_0x1d4c('0x5b')]({'phone':_0x48c915[_0x1d4c('0x5c')][_0x1d4c('0x7e')],'messageId':_0x48c915['body'][_0x1d4c('0x81')],'body':_0x48c915[_0x1d4c('0x5c')][_0x1d4c('0x5c')],'SmsAccountId':_0x4aaa90[_0x1d4c('0x58')]['id'],'SmsInteractionId':_0x51f856['id'],'direction':'in','ContactId':_0x51f856[_0x1d4c('0xa7')],'AttachmentId':_0x48c915[_0x1d4c('0x5c')]['AttachmentId']});})[_0x1d4c('0x1e')](function(_0x3fe300){_0x48c915['message']=_0x3fe300;if(_0x48c915[_0x1d4c('0xa2')][_0x1d4c('0xa8')]){return db[_0x1d4c('0xa9')][_0x1d4c('0x61')]({'attributes':['id',_0x1d4c('0x39')],'where':{'id':_0x48c915['interaction'][_0x1d4c('0xa8')]}})[_0x1d4c('0x1e')](function(_0x874522){if(_0x874522){_0x48c915[_0x1d4c('0x72')][_0x1d4c('0xaa')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x874522[_0x1d4c('0x39')]+','+(_0x48c915[_0x1d4c('0x71')][_0x1d4c('0xab')]||0xa),'interval':_0x1d4c('0xac')});}return respondWithRpcPromise(_0x1d4c('0xad'),_0x1d4c('0xae'),_0x48c915);});}return respondWithRpcPromise(_0x1d4c('0xad'),_0x1d4c('0xae'),_0x48c915);})[_0x1d4c('0x1e')](function(_0x362874){if(_0x362874){var _0x34fe39=0xc8;var _0xf16899=_0x1d4c('0xaf');logger[_0x1d4c('0xb0')](_0x1d4c('0x1f'),_0xf16899,_0x34fe39,_0x1d4c('0xb1'));logger[_0x1d4c('0xb2')](_0x1d4c('0xb3'),_0xf16899,_0x34fe39,'entity\x20found',JSON[_0x1d4c('0x20')](_0x362874));if(_0x48c915[_0x1d4c('0x71')][_0x1d4c('0x52')]===_0x1d4c('0x7d')){return _0x2510b4[_0x1d4c('0x29')](_0x34fe39)[_0x1d4c('0x2e')]('Content-Type',_0x1d4c('0xb4'))[_0x1d4c('0x3a')](_0x1d4c('0xb5'));}else{return _0x2510b4['status'](_0x34fe39)['json'](_0x362874);}}})[_0x1d4c('0x26')](handleError(_0x2510b4,null));};exports[_0x1d4c('0xb6')]=function(_0x38d811,_0x492eaf,_0xe1bb1e){return db[_0x1d4c('0x3e')]['findOne']({'where':{'id':_0x38d811['params']['id']}})[_0x1d4c('0x1e')](handleEntityNotFound(_0x492eaf,null))['then'](function(_0x5e595c){if(_0x5e595c){return db[_0x1d4c('0xb7')]['transaction'](function(_0x142031){return db[_0x1d4c('0x70')][_0x1d4c('0x34')]({'where':{'SmsAccountId':_0x38d811['params']['id']},'transaction':_0x142031})[_0x1d4c('0x1e')](function(_0x3e329c){var _0xbafb67=_[_0x1d4c('0x42')](_0x38d811['body'],function(_0x2eaa73){_0x2eaa73[_0x1d4c('0x67')]=_0x38d811[_0x1d4c('0x58')]['id'];return _0x2eaa73;});return db['SmsApplication'][_0x1d4c('0xb8')](_0xbafb67,{'transaction':_0x142031});});})[_0x1d4c('0x1e')](function(){return db['SmsApplication'][_0x1d4c('0xb9')]({'where':{'SmsAccountId':_0x38d811[_0x1d4c('0x58')]['id']},'order':_0x1d4c('0xba')});});}})[_0x1d4c('0x1e')](respondWithResult(_0x492eaf,null))[_0x1d4c('0x26')](handleError(_0x492eaf,null));};exports[_0x1d4c('0xbb')]=function(_0x4f7a2e,_0xe78954,_0x1af622){var _0x42bcc5={};var _0x1cb49f={};var _0x5e74ba;var _0x5c9ee1;return db[_0x1d4c('0x3e')]['findOne']({'where':{'id':_0x4f7a2e[_0x1d4c('0x58')]['id']}})[_0x1d4c('0x1e')](handleEntityNotFound(_0xe78954,null))[_0x1d4c('0x1e')](function(_0x1faca5){if(_0x1faca5){_0x5e74ba=_0x1faca5;_0x1cb49f['model']=_[_0x1d4c('0x44')](db[_0x1d4c('0x70')][_0x1d4c('0x3f')]);_0x1cb49f['query']=_['keys'](_0x4f7a2e[_0x1d4c('0x43')]);_0x1cb49f[_0x1d4c('0x4e')]=_[_0x1d4c('0x45')](_0x1cb49f[_0x1d4c('0x41')],_0x1cb49f[_0x1d4c('0x43')]);_0x42bcc5['attributes']=_[_0x1d4c('0x45')](_0x1cb49f['model'],qs[_0x1d4c('0x46')](_0x4f7a2e[_0x1d4c('0x43')][_0x1d4c('0x46')]));_0x42bcc5['attributes']=_0x42bcc5[_0x1d4c('0x47')][_0x1d4c('0x48')]?_0x42bcc5[_0x1d4c('0x47')]:_0x1cb49f[_0x1d4c('0x41')];_0x42bcc5[_0x1d4c('0x4b')]=qs[_0x1d4c('0x4c')](_0x4f7a2e[_0x1d4c('0x43')][_0x1d4c('0x4c')]);_0x42bcc5['where']=qs[_0x1d4c('0x4e')](_[_0x1d4c('0x4f')](_0x4f7a2e[_0x1d4c('0x43')],_0x1cb49f[_0x1d4c('0x4e')]));if(_0x4f7a2e[_0x1d4c('0x43')][_0x1d4c('0x50')]){_0x42bcc5['where']=_[_0x1d4c('0x51')](_0x42bcc5[_0x1d4c('0x4d')],{'$or':_[_0x1d4c('0x42')](_0x42bcc5[_0x1d4c('0x47')],function(_0x47fd4b){var _0x141ad7={};_0x141ad7[_0x47fd4b]={'$like':'%'+_0x4f7a2e[_0x1d4c('0x43')][_0x1d4c('0x50')]+'%'};return _0x141ad7;})});}_0x42bcc5=_[_0x1d4c('0x51')]({},_0x42bcc5,_0x4f7a2e[_0x1d4c('0x5a')]);return _0x5e74ba['getApplications'](_0x42bcc5);}})['then'](function(_0x2eea90){if(_0x2eea90){_0x5c9ee1=_0x2eea90[_0x1d4c('0x48')];if(!_0x4f7a2e['query'][_0x1d4c('0x49')](_0x1d4c('0x4a'))){_0x42bcc5[_0x1d4c('0x2c')]=qs[_0x1d4c('0x2c')](_0x4f7a2e['query'][_0x1d4c('0x2c')]);_0x42bcc5['offset']=qs[_0x1d4c('0x2a')](_0x4f7a2e[_0x1d4c('0x43')][_0x1d4c('0x2a')]);}return _0x5e74ba[_0x1d4c('0xbb')](_0x42bcc5);}})[_0x1d4c('0x1e')](function(_0x35d657){if(_0x35d657){return _0x35d657?{'count':_0x5c9ee1,'rows':_0x35d657}:null;}})[_0x1d4c('0x1e')](respondWithResult(_0xe78954,null))[_0x1d4c('0x26')](handleError(_0xe78954,null));};exports['getInteractions']=function(_0x2ac315,_0x258ee5,_0x3f2226){var _0x4d97a1={'raw':![],'where':{}};var _0x619e0e={};var _0x22419b={'count':0x0,'rows':[]};return db[_0x1d4c('0x3e')][_0x1d4c('0x68')]({'where':{'id':_0x2ac315[_0x1d4c('0x58')]['id']}})['then'](handleEntityNotFound(_0x258ee5,null))[_0x1d4c('0x1e')](function(_0x108fde){if(_0x108fde){_0x619e0e[_0x1d4c('0x41')]=_[_0x1d4c('0x44')](db[_0x1d4c('0xa0')][_0x1d4c('0x3f')]);_0x619e0e[_0x1d4c('0x43')]=_[_0x1d4c('0x44')](_0x2ac315['query']);_0x619e0e[_0x1d4c('0x4e')]=_[_0x1d4c('0x45')](_0x619e0e[_0x1d4c('0x41')],_0x619e0e[_0x1d4c('0x43')]);_0x4d97a1[_0x1d4c('0x47')]=_['intersection'](_0x619e0e[_0x1d4c('0x41')],qs['fields'](_0x2ac315[_0x1d4c('0x43')][_0x1d4c('0x46')]));_0x4d97a1[_0x1d4c('0x47')]=_0x4d97a1[_0x1d4c('0x47')][_0x1d4c('0x48')]?_0x4d97a1[_0x1d4c('0x47')]:_0x619e0e[_0x1d4c('0x41')];if(!_0x2ac315[_0x1d4c('0x43')][_0x1d4c('0x49')]('nolimit')){_0x4d97a1[_0x1d4c('0x2c')]=qs[_0x1d4c('0x2c')](_0x2ac315[_0x1d4c('0x43')][_0x1d4c('0x2c')]);_0x4d97a1['offset']=qs[_0x1d4c('0x2a')](_0x2ac315[_0x1d4c('0x43')][_0x1d4c('0x2a')]);}_0x4d97a1[_0x1d4c('0x4b')]=qs[_0x1d4c('0x4c')](_0x2ac315['query'][_0x1d4c('0x4c')]);_0x4d97a1['where']=qs[_0x1d4c('0x4e')](_[_0x1d4c('0x4f')](_0x2ac315[_0x1d4c('0x43')],_0x619e0e[_0x1d4c('0x4e')]));_0x4d97a1[_0x1d4c('0x4d')][_0x1d4c('0x67')]=_0x108fde['id'];if(_0x2ac315[_0x1d4c('0x43')]['filter']){_0x4d97a1[_0x1d4c('0x4d')]=_[_0x1d4c('0x51')](_0x4d97a1[_0x1d4c('0x4d')],{'$or':_[_0x1d4c('0x42')](_0x4d97a1[_0x1d4c('0x47')],function(_0x29df5e){var _0x99e8bf={};_0x99e8bf[_0x29df5e]={'$like':'%'+_0x2ac315[_0x1d4c('0x43')][_0x1d4c('0x50')]+'%'};return _0x99e8bf;})});}_0x4d97a1=_[_0x1d4c('0x51')]({},_0x4d97a1,_0x2ac315[_0x1d4c('0x5a')]);return db[_0x1d4c('0xa0')]['count']({'where':_0x4d97a1[_0x1d4c('0x4d')]})[_0x1d4c('0x1e')](function(_0x56c988){_0x22419b['count']=_0x56c988;if(_0x2ac315[_0x1d4c('0x43')][_0x1d4c('0x54')]){_0x4d97a1[_0x1d4c('0x59')]=[{'model':db[_0x1d4c('0x75')],'as':_0x1d4c('0xbc'),'required':![]},{'model':db[_0x1d4c('0xa9')],'as':_0x1d4c('0xbd'),'attributes':[_0x1d4c('0x39'),'fullname',_0x1d4c('0xbe')],'required':![]},{'model':db[_0x1d4c('0xbf')],'as':_0x1d4c('0xc0'),'attributes':['id',_0x1d4c('0x39'),'color'],'where':_0x2ac315[_0x1d4c('0x43')][_0x1d4c('0xc1')]?{'id':_0x2ac315['query']['tag']}:undefined,'required':_0x2ac315[_0x1d4c('0x43')][_0x1d4c('0xc1')]?!![]:![]}];}return db[_0x1d4c('0xa0')]['findAll'](_0x4d97a1);})[_0x1d4c('0x1e')](function(_0x39bb81){_0x22419b[_0x1d4c('0x56')]=_0x39bb81;return _0x22419b;});}})[_0x1d4c('0x1e')](respondWithFilteredResult(_0x258ee5,_0x4d97a1))[_0x1d4c('0x26')](handleError(_0x258ee5,null));};exports[_0x1d4c('0x3a')]=function(_0x492b3b,_0x1aa278,_0x44ede2){var _0x252ca4,_0x590022,_0x254815;if(_[_0x1d4c('0x93')](_0x492b3b['body'][_0x1d4c('0x5c')])||_0x492b3b[_0x1d4c('0x5c')]['body']===''){throw new db[(_0x1d4c('0x76'))]['ValidationError'](_0x1d4c('0x96'));}if(_[_0x1d4c('0x93')](_0x492b3b[_0x1d4c('0x5c')]['to'])){throw new db[(_0x1d4c('0x76'))]['ValidationError'](_0x1d4c('0xc2'));}_0x252ca4=_0x492b3b['body']['to'];return db[_0x1d4c('0x3e')][_0x1d4c('0x61')]({'where':{'id':_0x492b3b[_0x1d4c('0x58')]['id']},'include':[{'model':db[_0x1d4c('0x9a')],'as':_0x1d4c('0xc3'),'include':[{'model':db[_0x1d4c('0x75')],'as':_0x1d4c('0x9e'),'where':{'mobile':_0x252ca4},'limit':0x1,'order':[[_0x1d4c('0x79'),'DESC']]}]}]})[_0x1d4c('0x1e')](handleEntityNotFound(_0x1aa278,null))[_0x1d4c('0x1e')](function(_0x546e54){if(_0x546e54&&_0x546e54[_0x1d4c('0xc3')]){_0x590022=_0x546e54['get']({'plain':!![]});if(_0x590022['List']&&_0x590022[_0x1d4c('0xc3')][_0x1d4c('0x9e')][_0x1d4c('0x48')]){return _0x590022[_0x1d4c('0xc3')]['Contacts'][0x0];}return db['CmContact'][_0x1d4c('0x5b')](_[_0x1d4c('0x16')](_0x492b3b[_0x1d4c('0x5c')],{'firstName':_0x252ca4,'mobile':_0x252ca4,'phone':_0x252ca4,'ListId':_0x590022[_0x1d4c('0x7b')]}));}})[_0x1d4c('0x1e')](handleEntityNotFound(_0x1aa278,null))[_0x1d4c('0x1e')](function(_0x3bba25){if(_0x3bba25){_0x254815=_0x3bba25;return db[_0x1d4c('0xa0')][_0x1d4c('0x61')]({'where':{'ContactId':_0x254815['id'],'closed':![],'SmsAccountId':_0x590022['id']}})[_0x1d4c('0x1e')](function(_0xfad8a2){if(_0xfad8a2){return[_0xfad8a2,![]];}return db[_0x1d4c('0xa0')][_0x1d4c('0x5b')]({'UserId':_0x492b3b[_0x1d4c('0x5d')]['id'],'ContactId':_0x254815['id'],'SmsAccountId':_0x590022['id'],'phone':_0x252ca4,'firstMsgDirection':_0x1d4c('0xc4'),'Messages':[_[_0x1d4c('0x51')](_0x492b3b['body'],{'read':![],'body':_0x492b3b['body'][_0x1d4c('0x5c')],'phone':_0x252ca4,'SmsAccountId':_0x590022['id'],'UserId':_0x492b3b[_0x1d4c('0x5d')]['id'],'ContactId':_0x254815['id']})]},{'include':[{'model':db[_0x1d4c('0xa6')],'as':_0x1d4c('0xc5')}]})[_0x1d4c('0x1e')](function(_0x139f08){return[_0x139f08,!![]];});});}})['spread'](function(_0x27671a,_0x2ad1ee){if(_0x2ad1ee){return _0x27671a;}return db[_0x1d4c('0xa6')][_0x1d4c('0x5b')](_[_0x1d4c('0x51')](_0x492b3b[_0x1d4c('0x5c')],{'read':![],'body':_0x492b3b[_0x1d4c('0x5c')]['body'],'phone':_0x252ca4,'SmsAccountId':_0x590022['id'],'SmsInteractionId':_0x27671a['id'],'UserId':_0x492b3b[_0x1d4c('0x5d')]['id'],'ContactId':_0x254815['id']}))[_0x1d4c('0x1e')](function(_0x57a429){_0x27671a[_0x1d4c('0xc6')][_0x1d4c('0xc5')]=[];_0x27671a[_0x1d4c('0xc6')][_0x1d4c('0xc5')]['push'](_0x57a429['dataValues']);return _0x27671a;});})['then'](respondWithResult(_0x1aa278,null))['catch'](handleError(_0x1aa278,null));};exports[_0x1d4c('0x29')]=function(_0x3a2dc5,_0x4ba457,_0x2bba80){if(_0x3a2dc5[_0x1d4c('0x5c')]['id']){delete _0x3a2dc5[_0x1d4c('0x5c')]['id'];}var _0x34f587,_0x1ddfb9,_0x565a6c;return db[_0x1d4c('0x3e')][_0x1d4c('0x61')]({'where':{'id':_0x3a2dc5['params']['id']}})[_0x1d4c('0x1e')](handleEntityNotFound(_0x4ba457,null))[_0x1d4c('0x1e')](function(_0x3d030f){if(_0x3d030f){_0x565a6c=_0x3d030f;logger[_0x1d4c('0xb2')](_0x1d4c('0x1f'),_0x1d4c('0x29'),_0x1d4c('0xc7'),_0x3d030f[_0x1d4c('0x52')],util['inspect'](_0x3a2dc5[_0x1d4c('0x5c')],{'showHidden':![],'depth':null}));switch(_0x3d030f[_0x1d4c('0x52')]){case _0x1d4c('0xc8'):if(_0x3a2dc5[_0x1d4c('0x5c')][_0x1d4c('0xc9')]&&_0x3a2dc5[_0x1d4c('0x5c')]['status']){_0x1ddfb9=_0x3a2dc5[_0x1d4c('0x5c')][_0x1d4c('0x29')];return db[_0x1d4c('0xa6')][_0x1d4c('0x61')]({'where':{'messageId':_0x3a2dc5[_0x1d4c('0x5c')][_0x1d4c('0xc9')]}});}break;case _0x1d4c('0x84'):if(_0x3a2dc5[_0x1d4c('0x5c')][_0x1d4c('0xca')]&&_0x3a2dc5[_0x1d4c('0x5c')][_0x1d4c('0xcb')]){_0x1ddfb9=_0x3a2dc5[_0x1d4c('0x5c')][_0x1d4c('0xcb')];return db['SmsMessage'][_0x1d4c('0x61')]({'where':{'messageId':_0x3a2dc5['body'][_0x1d4c('0xca')]}});}break;case _0x1d4c('0x85'):if(_0x3a2dc5[_0x1d4c('0x5c')][_0x1d4c('0xcc')]&&_0x3a2dc5[_0x1d4c('0x5c')][_0x1d4c('0xcd')]){_0x1ddfb9=_0x3a2dc5['body']['status_code'];return db[_0x1d4c('0xa6')][_0x1d4c('0x61')]({'where':{'messageId':_0x3a2dc5['body'][_0x1d4c('0xcc')]}});}break;case'infobip':var _0x350ad4=_0x3a2dc5[_0x1d4c('0x5c')][_0x1d4c('0x89')][0x0];if(_0x350ad4[_0x1d4c('0x81')]&&_0x350ad4[_0x1d4c('0x29')][_0x1d4c('0xce')]===_0x1d4c('0xcf')){_0x1ddfb9=_0x350ad4['status'][_0x1d4c('0xce')];return db[_0x1d4c('0xa6')][_0x1d4c('0x61')]({'where':{'messageId':_0x350ad4[_0x1d4c('0x81')]}});}break;case'clickatell':if(_0x3a2dc5[_0x1d4c('0x5c')][_0x1d4c('0x81')]&&_0x3a2dc5[_0x1d4c('0x5c')][_0x1d4c('0x29')]){_0x1ddfb9=_0x3a2dc5[_0x1d4c('0x5c')][_0x1d4c('0x29')];return db[_0x1d4c('0xa6')]['find']({'where':{'messageId':_0x3a2dc5[_0x1d4c('0x5c')][_0x1d4c('0x81')]}});}break;case _0x1d4c('0x91'):if(_0x3a2dc5[_0x1d4c('0x5c')][0x0][_0x1d4c('0x24')]['id']){_0x1ddfb9=_0x3a2dc5[_0x1d4c('0x5c')][0x0][_0x1d4c('0x52')];return db[_0x1d4c('0xa6')][_0x1d4c('0x61')]({'where':{'messageId':_0x3a2dc5[_0x1d4c('0x5c')][0x0]['message']['id']}});}break;case _0x1d4c('0x92'):if(_0x3a2dc5[_0x1d4c('0x5c')]['redif']&&_0x3a2dc5['body'][_0x1d4c('0x29')]){_0x1ddfb9=_0x3a2dc5[_0x1d4c('0x5c')][_0x1d4c('0x29')];return db['SmsMessage'][_0x1d4c('0x61')]({'where':{'messageId':_0x3a2dc5['body'][_0x1d4c('0xd0')]}});}break;}}})[_0x1d4c('0x1e')](handleEntityNotFound(_0x4ba457,null))[_0x1d4c('0x1e')](function(_0xd49452){if(_0xd49452){_0x34f587=_0xd49452;switch(_0x565a6c[_0x1d4c('0x52')]){case _0x1d4c('0xc8'):if(_0x1ddfb9==='DELIVERED'){return _0x34f587[_0x1d4c('0x33')]({'read':!![]});}else{logger[_0x1d4c('0x21')](_0x1d4c('0x1f'),_0x1d4c('0x29'),'skebby',util['inspect'](_0x3a2dc5['body'],{'showHidden':![],'depth':null}));}break;case _0x1d4c('0x84'):if(_0x1ddfb9==='1'){return _0x34f587[_0x1d4c('0x33')]({'read':!![]});}else{logger[_0x1d4c('0x21')](_0x1d4c('0x1f'),_0x1d4c('0x29'),_0x1d4c('0xc8'),util[_0x1d4c('0xd1')](_0x3a2dc5['body'],{'showHidden':![],'depth':null}));}break;case'clicksend':if(!_0x3a2dc5[_0x1d4c('0x5c')][_0x1d4c('0xd2')]&&_0x1ddfb9>=0xc8&&_0x1ddfb9<=0xce){return _0x34f587[_0x1d4c('0x33')]({'read':!![]});}else{logger[_0x1d4c('0x21')](_0x1d4c('0x1f'),'status',_0x1d4c('0x85'),util[_0x1d4c('0xd1')](_0x3a2dc5['body'],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x375c93=_0x3a2dc5[_0x1d4c('0x5c')][_0x1d4c('0x89')][0x0];if(_0x375c93['status'][_0x1d4c('0xce')]===_0x1d4c('0xcf')){return _0x34f587[_0x1d4c('0x33')]({'read':!![]});}else{logger[_0x1d4c('0x21')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x1d4c('0x29'),_0x1d4c('0x88'),util[_0x1d4c('0xd1')](_0x3a2dc5[_0x1d4c('0x5c')],{'showHidden':![],'depth':null}));}break;case _0x1d4c('0x8e'):if(_0x1ddfb9==_0x1d4c('0xd3')||_0x1ddfb9==_0x1d4c('0xd4')){return _0x34f587[_0x1d4c('0x33')]({'read':!![]});}else{logger[_0x1d4c('0x21')](_0x1d4c('0x1f'),_0x1d4c('0x29'),_0x1d4c('0x8e'),util['inspect'](_0x3a2dc5[_0x1d4c('0x5c')],{'showHidden':![],'depth':null}));}break;case _0x1d4c('0x91'):if(_0x1ddfb9==_0x1d4c('0xd5')){return _0x34f587[_0x1d4c('0x33')]({'read':!![]});}else{logger['error'](_0x1d4c('0x1f'),'status',_0x1d4c('0x91'),util[_0x1d4c('0xd1')](_0x3a2dc5['body'],{'showHidden':![],'depth':null}));}break;case _0x1d4c('0x92'):if(_0x1ddfb9===_0x1d4c('0xd6')||_0x1ddfb9==='ACCEPTD'){return _0x34f587[_0x1d4c('0x33')]({'read':!![]});}else{logger[_0x1d4c('0x21')](_0x1d4c('0x1f'),_0x1d4c('0x29'),'intelepeer',util[_0x1d4c('0xd1')](_0x3a2dc5[_0x1d4c('0x5c')],{'showHidden':![],'depth':null}));}break;}return _0x34f587;}})[_0x1d4c('0x1e')](respondWithResult(_0x4ba457,null))[_0x1d4c('0x26')](handleError(_0x4ba457,null));};exports[_0x1d4c('0xd7')]=function(_0x463fb3,_0x11a5c0,_0x4cc28f){var _0x1bf159,_0x1faaf6,_0x1a9c80;return db['SmsAccount'][_0x1d4c('0x61')]({'where':{'id':_0x463fb3['params']['id']}})[_0x1d4c('0x1e')](handleEntityNotFound(_0x11a5c0,null))[_0x1d4c('0x1e')](function(_0x25905f){if(_0x25905f){_0x1a9c80=_0x25905f;logger[_0x1d4c('0xb2')](_0x1d4c('0x1f'),_0x1d4c('0x29'),_0x1d4c('0xc7'),_0x25905f[_0x1d4c('0x52')],util['inspect'](_0x463fb3[_0x1d4c('0x43')],{'showHidden':![],'depth':null}));switch(_0x25905f[_0x1d4c('0x52')]){case'csc':if(_0x463fb3['query'][_0x1d4c('0xd8')]&&_0x463fb3[_0x1d4c('0x43')][_0x1d4c('0xd9')]){_0x1faaf6=_0x463fb3[_0x1d4c('0x43')]['state'];return db['SmsMessage'][_0x1d4c('0x61')]({'where':{'messageId':_0x463fb3[_0x1d4c('0x43')][_0x1d4c('0xd8')]}});}break;}}})['then'](handleEntityNotFound(_0x11a5c0,null))['then'](function(_0x232426){if(_0x232426){_0x1bf159=_0x232426;switch(_0x1a9c80[_0x1d4c('0x52')]){case _0x1d4c('0x8b'):if(_0x1faaf6==='2'||_0x1faaf6==='6'){return _0x1bf159[_0x1d4c('0x33')]({'read':!![]});}else{logger[_0x1d4c('0x21')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x1d4c('0x29'),_0x1d4c('0x8b'),util[_0x1d4c('0xd1')](_0x463fb3[_0x1d4c('0x43')],{'showHidden':![],'depth':null}));};break;}return _0x1bf159;}})[_0x1d4c('0x1e')](respondWithResult(_0x11a5c0,null))[_0x1d4c('0x26')](handleError(_0x11a5c0,null));};exports[_0x1d4c('0xda')]=function(_0x3db8ef,_0x57274a,_0x261e10){return db[_0x1d4c('0x3e')]['find']({'where':{'id':_0x3db8ef[_0x1d4c('0x58')]['id']}})['then'](handleEntityNotFound(_0x57274a,null))['then'](function(_0x3dd97f){if(_0x3dd97f){return _0x3dd97f[_0x1d4c('0xda')](_0x3db8ef[_0x1d4c('0x5c')][_0x1d4c('0x6b')],_[_0x1d4c('0x9d')](_0x3db8ef[_0x1d4c('0x5c')],[_0x1d4c('0x6b'),'id'])||{})[_0x1d4c('0xa1')](function(_0x5552cb){for(var _0x3b5bf9=0x0;_0x3b5bf9<_0x3db8ef[_0x1d4c('0x5c')][_0x1d4c('0x6b')][_0x1d4c('0x48')];_0x3b5bf9+=0x1){socket['emit'](_0x1d4c('0xdb'),{'UserId':Number(_0x3db8ef[_0x1d4c('0x5c')][_0x1d4c('0x6b')][_0x3b5bf9]),'SmsAccountId':Number(_0x3db8ef[_0x1d4c('0x58')]['id'])});}return _0x5552cb;});}})['then'](respondWithResult(_0x57274a,null))[_0x1d4c('0x26')](handleError(_0x57274a,null));};exports['removeAgents']=function(_0x4ae9c0,_0x401f78,_0x30f134){return db[_0x1d4c('0x3e')][_0x1d4c('0x61')]({'where':{'id':_0x4ae9c0[_0x1d4c('0x58')]['id']}})[_0x1d4c('0x1e')](handleEntityNotFound(_0x401f78,null))[_0x1d4c('0x1e')](function(_0x42ac80){if(_0x42ac80){return _0x42ac80[_0x1d4c('0xdc')](_0x4ae9c0[_0x1d4c('0x43')][_0x1d4c('0x6b')])[_0x1d4c('0x1e')](function(){if(_[_0x1d4c('0xdd')](_0x4ae9c0['query'][_0x1d4c('0x6b')])){for(var _0x493da6=0x0;_0x493da6<_0x4ae9c0['query'][_0x1d4c('0x6b')][_0x1d4c('0x48')];_0x493da6+=0x1){socket[_0x1d4c('0xde')](_0x1d4c('0xdf'),{'UserId':Number(_0x4ae9c0[_0x1d4c('0x43')][_0x1d4c('0x6b')][_0x493da6]),'SmsAccountId':Number(_0x4ae9c0[_0x1d4c('0x58')]['id'])});}}else{socket[_0x1d4c('0xde')]('userSmsAccount:remove',{'UserId':Number(_0x4ae9c0[_0x1d4c('0x43')][_0x1d4c('0x6b')]),'SmsAccountId':Number(_0x4ae9c0[_0x1d4c('0x58')]['id'])});}});}})['then'](respondWithStatusCode(_0x401f78,null))[_0x1d4c('0x26')](handleError(_0x401f78,null));};exports[_0x1d4c('0xe0')]=function(_0x18b902,_0x2520b0,_0x411da1){var _0x33731f={};var _0x240b7a={};var _0x147a11;var _0x3f6b8c;return db[_0x1d4c('0x3e')]['findOne']({'where':{'id':_0x18b902[_0x1d4c('0x58')]['id']}})['then'](handleEntityNotFound(_0x2520b0,null))[_0x1d4c('0x1e')](function(_0x37edc6){if(_0x37edc6){_0x147a11=_0x37edc6;_0x240b7a[_0x1d4c('0x41')]=_[_0x1d4c('0x44')](db['User'][_0x1d4c('0x3f')]);_0x240b7a[_0x1d4c('0x43')]=_[_0x1d4c('0x44')](_0x18b902[_0x1d4c('0x43')]);_0x240b7a['filters']=_[_0x1d4c('0x45')](_0x240b7a[_0x1d4c('0x41')],_0x240b7a[_0x1d4c('0x43')]);_0x33731f['attributes']=_[_0x1d4c('0x45')](_0x240b7a[_0x1d4c('0x41')],qs[_0x1d4c('0x46')](_0x18b902[_0x1d4c('0x43')][_0x1d4c('0x46')]));_0x33731f['attributes']=_0x33731f[_0x1d4c('0x47')][_0x1d4c('0x48')]?_0x33731f[_0x1d4c('0x47')]:_0x240b7a[_0x1d4c('0x41')];_0x33731f[_0x1d4c('0x4b')]=qs[_0x1d4c('0x4c')](_0x18b902['query']['sort']);_0x33731f[_0x1d4c('0x4d')]=qs[_0x1d4c('0x4e')](_[_0x1d4c('0x4f')](_0x18b902['query'],_0x240b7a['filters']));if(_0x18b902[_0x1d4c('0x43')][_0x1d4c('0x50')]){_0x33731f['where']=_[_0x1d4c('0x51')](_0x33731f[_0x1d4c('0x4d')],{'$or':_[_0x1d4c('0x42')](_0x33731f['attributes'],function(_0x42f8c0){var _0x2c20a1={};_0x2c20a1[_0x42f8c0]={'$like':'%'+_0x18b902['query'][_0x1d4c('0x50')]+'%'};return _0x2c20a1;})});}_0x33731f=_[_0x1d4c('0x51')]({},_0x33731f,_0x18b902[_0x1d4c('0x5a')]);return _0x147a11[_0x1d4c('0xe0')](_0x33731f);}})[_0x1d4c('0x1e')](function(_0x222ec6){if(_0x222ec6){_0x3f6b8c=_0x222ec6[_0x1d4c('0x48')];if(!_0x18b902[_0x1d4c('0x43')]['hasOwnProperty'](_0x1d4c('0x4a'))){_0x33731f[_0x1d4c('0x2c')]=qs['limit'](_0x18b902[_0x1d4c('0x43')][_0x1d4c('0x2c')]);_0x33731f[_0x1d4c('0x2a')]=qs['offset'](_0x18b902[_0x1d4c('0x43')][_0x1d4c('0x2a')]);}return _0x147a11[_0x1d4c('0xe0')](_0x33731f);}})[_0x1d4c('0x1e')](function(_0x102de9){if(_0x102de9){return _0x102de9?{'count':_0x3f6b8c,'rows':_0x102de9}:null;}})[_0x1d4c('0x1e')](respondWithResult(_0x2520b0,null))['catch'](handleError(_0x2520b0,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index d57daa3..e1a53f3 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 _0xdaf9=['../../mysqldb','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x364221,_0x18b5f0){var _0x148011=function(_0x206142){while(--_0x206142){_0x364221['push'](_0x364221['shift']());}};_0x148011(++_0x18b5f0);}(_0xdaf9,0x179));var _0x9daf=function(_0x3e9bea,_0x198c86){_0x3e9bea=_0x3e9bea-0x0;var _0x4835ea=_0xdaf9[_0x3e9bea];return _0x4835ea;};'use strict';var EventEmitter=require(_0x9daf('0x0'));var SmsAccount=require(_0x9daf('0x1'))['db']['SmsAccount'];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x9daf('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x9daf('0x3'),'afterDestroy':_0x9daf('0x4')};function emitEvent(_0x58acd1){return function(_0x5bf282,_0x574f89,_0x3d632b){SmsAccountEvents[_0x9daf('0x5')](_0x58acd1+':'+_0x5bf282['id'],_0x5bf282);SmsAccountEvents[_0x9daf('0x5')](_0x58acd1,_0x5bf282);_0x3d632b(null);};}for(var e in events){if(events[_0x9daf('0x6')](e)){var event=events[e];SmsAccount[_0x9daf('0x7')](e,emitEvent(event));}}module[_0x9daf('0x8')]=SmsAccountEvents; \ No newline at end of file +var _0x9d1c=['exports','../../mysqldb','SmsAccount','setMaxListeners','save','update','remove','emit','hook'];(function(_0x4d3d50,_0x50f156){var _0x175e6d=function(_0x41fc26){while(--_0x41fc26){_0x4d3d50['push'](_0x4d3d50['shift']());}};_0x175e6d(++_0x50f156);}(_0x9d1c,0x10f));var _0xc9d1=function(_0x2c572e,_0x4a0a7a){_0x2c572e=_0x2c572e-0x0;var _0x13a7da=_0x9d1c[_0x2c572e];return _0x13a7da;};'use strict';var EventEmitter=require('events');var SmsAccount=require(_0xc9d1('0x0'))['db'][_0xc9d1('0x1')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0xc9d1('0x2')](0x0);var events={'afterCreate':_0xc9d1('0x3'),'afterUpdate':_0xc9d1('0x4'),'afterDestroy':_0xc9d1('0x5')};function emitEvent(_0xeb56fe){return function(_0x3e069c,_0x2d0514,_0x506d26){SmsAccountEvents['emit'](_0xeb56fe+':'+_0x3e069c['id'],_0x3e069c);SmsAccountEvents[_0xc9d1('0x6')](_0xeb56fe,_0x3e069c);_0x506d26(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsAccount[_0xc9d1('0x7')](e,emitEvent(event));}}module[_0xc9d1('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 a196426..f426b00 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 _0xcce5=['SmsAccount','sms_accounts','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./smsAccount.attributes','exports','define'];(function(_0x16bc92,_0x1b0935){var _0x27a2d2=function(_0x334beb){while(--_0x334beb){_0x16bc92['push'](_0x16bc92['shift']());}};_0x27a2d2(++_0x1b0935);}(_0xcce5,0x11a));var _0x5cce=function(_0x6f230c,_0x178930){_0x6f230c=_0x6f230c-0x0;var _0x55e608=_0xcce5[_0x6f230c];return _0x55e608;};'use strict';var _=require(_0x5cce('0x0'));var util=require(_0x5cce('0x1'));var logger=require(_0x5cce('0x2'))(_0x5cce('0x3'));var moment=require(_0x5cce('0x4'));var BPromise=require(_0x5cce('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5cce('0x6'));var rimraf=require(_0x5cce('0x7'));var config=require(_0x5cce('0x8'));var attributes=require(_0x5cce('0x9'));module[_0x5cce('0xa')]=function(_0x1f1005,_0x32debb){return _0x1f1005[_0x5cce('0xb')](_0x5cce('0xc'),attributes,{'tableName':_0x5cce('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1644=['../../config/environment','define','SmsAccount','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0x1644,0x19a));var _0x4164=function(_0x1d1722,_0x759c36){_0x1d1722=_0x1d1722-0x0;var _0x100055=_0x1644[_0x1d1722];return _0x100055;};'use strict';var _=require(_0x4164('0x0'));var util=require(_0x4164('0x1'));var logger=require(_0x4164('0x2'))(_0x4164('0x3'));var moment=require('moment');var BPromise=require(_0x4164('0x4'));var rp=require(_0x4164('0x5'));var fs=require('fs');var path=require(_0x4164('0x6'));var rimraf=require(_0x4164('0x7'));var config=require(_0x4164('0x8'));var attributes=require('./smsAccount.attributes');module['exports']=function(_0x50aa96,_0x14b2b3){return _0x50aa96[_0x4164('0x9')](_0x4164('0xa'),attributes,{'tableName':'sms_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.rpc.js b/server/api/smsAccount/smsAccount.rpc.js index e67c226..b4611ef 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 _0xd02d=['model','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','ShowSmsAccount','find','options','attributes','include','map'];(function(_0x1833ec,_0x46a830){var _0xea3f81=function(_0x37e3d4){while(--_0x37e3d4){_0x1833ec['push'](_0x1833ec['shift']());}};_0xea3f81(++_0x46a830);}(_0xd02d,0x1a1));var _0xdd02=function(_0xea651b,_0x2c974c){_0xea651b=_0xea651b-0x0;var _0x1559c1=_0xd02d[_0xea651b];return _0x1559c1;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xdd02('0x0'));var BPromise=require(_0xdd02('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdd02('0x2'))['db'];var utils=require(_0xdd02('0x3'));var logger=require(_0xdd02('0x4'))(_0xdd02('0x5'));var config=require(_0xdd02('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xdd02('0x7')][_0xdd02('0x8')]({'port':0x232a});config[_0xdd02('0x9')]=_[_0xdd02('0xa')](config[_0xdd02('0x9')],{'host':_0xdd02('0xb'),'port':0x18eb});var socket=require(_0xdd02('0xc'))(new Redis(config[_0xdd02('0x9')]));require('./smsAccount.socket')['register'](socket);function respondWithRpcPromise(_0x4c59e9,_0x595a29,_0xea07b){return new BPromise(function(_0x17b3b9,_0x7de9d7){return client[_0xdd02('0xd')](_0x4c59e9,_0xea07b)[_0xdd02('0xe')](function(_0x3c8426){logger[_0xdd02('0xf')](_0xdd02('0x10'),_0x595a29,_0xdd02('0x11'));logger[_0xdd02('0x12')](_0xdd02('0x13'),_0x595a29,_0xdd02('0x11'),JSON[_0xdd02('0x14')](_0x3c8426));if(_0x3c8426[_0xdd02('0x15')]){if(_0x3c8426[_0xdd02('0x15')][_0xdd02('0x16')]===0x1f4){logger[_0xdd02('0x15')]('SmsAccount,\x20%s,\x20%s',_0x595a29,_0x3c8426[_0xdd02('0x15')][_0xdd02('0x17')]);return _0x7de9d7(_0x3c8426[_0xdd02('0x15')]['message']);}logger[_0xdd02('0x15')](_0xdd02('0x10'),_0x595a29,_0x3c8426[_0xdd02('0x15')][_0xdd02('0x17')]);return _0x17b3b9(_0x3c8426[_0xdd02('0x15')][_0xdd02('0x17')]);}else{logger[_0xdd02('0xf')](_0xdd02('0x10'),_0x595a29,_0xdd02('0x11'));_0x17b3b9(_0x3c8426['result']['message']);}})[_0xdd02('0x18')](function(_0x3d7d75){logger[_0xdd02('0x15')](_0xdd02('0x10'),_0x595a29,_0x3d7d75);_0x7de9d7(_0x3d7d75);});});}exports[_0xdd02('0x19')]=function(_0x8c92ec){var _0x1992d7=this;return new Promise(function(_0x38494d,_0x562bc5){return db['SmsAccount'][_0xdd02('0x1a')]({'raw':_0x8c92ec[_0xdd02('0x1b')]?_0x8c92ec[_0xdd02('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x8c92ec[_0xdd02('0x1b')]?_0x8c92ec[_0xdd02('0x1b')]['where']||null:null,'attributes':_0x8c92ec[_0xdd02('0x1b')]?_0x8c92ec[_0xdd02('0x1b')][_0xdd02('0x1c')]||null:null,'include':_0x8c92ec[_0xdd02('0x1b')]?_0x8c92ec['options'][_0xdd02('0x1d')]?_[_0xdd02('0x1e')](_0x8c92ec['options'][_0xdd02('0x1d')],function(_0x513af2){return{'model':db[_0x513af2[_0xdd02('0x1f')]],'as':_0x513af2['as'],'attributes':_0x513af2[_0xdd02('0x1c')],'include':_0x513af2[_0xdd02('0x1d')]?_[_0xdd02('0x1e')](_0x513af2[_0xdd02('0x1d')],function(_0x3da556){return{'model':db[_0x3da556['model']],'as':_0x3da556['as'],'attributes':_0x3da556[_0xdd02('0x1c')],'include':_0x3da556[_0xdd02('0x1d')]?_[_0xdd02('0x1e')](_0x3da556[_0xdd02('0x1d')],function(_0x3453c1){return{'model':db[_0x3453c1[_0xdd02('0x1f')]],'as':_0x3453c1['as'],'attributes':_0x3453c1[_0xdd02('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xdd02('0xe')](function(_0x58b754){logger['info'](_0xdd02('0x19'),_0x8c92ec);logger['debug']('ShowSmsAccount',_0x8c92ec,JSON[_0xdd02('0x14')](_0x58b754));_0x38494d(_0x58b754);})[_0xdd02('0x18')](function(_0x3d11b8){logger[_0xdd02('0x15')](_0xdd02('0x19'),_0x3d11b8[_0xdd02('0x17')],_0x8c92ec);_0x562bc5(_0x1992d7['error'](0x1f4,_0x3d11b8[_0xdd02('0x17')]));});});}; \ No newline at end of file +var _0xa94c=['then','ShowSmsAccount','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','redis','defaults','socket.io-emitter','./smsAccount.socket','request','info','SmsAccount,\x20%s,\x20%s','debug','SmsAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','SmsAccount','find','options','raw','where','include','map','attributes','model'];(function(_0x462999,_0x24d200){var _0x4b1366=function(_0x1fa353){while(--_0x1fa353){_0x462999['push'](_0x462999['shift']());}};_0x4b1366(++_0x24d200);}(_0xa94c,0x156));var _0xca94=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0xa94c[_0x164eca];return _0x2ce562;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xca94('0x0'));var BPromise=require('bluebird');var rs=require(_0xca94('0x1'));var fs=require('fs');var Redis=require(_0xca94('0x2'));var db=require(_0xca94('0x3'))['db'];var utils=require(_0xca94('0x4'));var logger=require(_0xca94('0x5'))(_0xca94('0x6'));var config=require(_0xca94('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});config[_0xca94('0x8')]=_[_0xca94('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xca94('0xa'))(new Redis(config['redis']));require(_0xca94('0xb'))['register'](socket);function respondWithRpcPromise(_0x38aabc,_0x34f98e,_0x263781){return new BPromise(function(_0x11a550,_0x3f6182){return client[_0xca94('0xc')](_0x38aabc,_0x263781)['then'](function(_0xfa7322){logger[_0xca94('0xd')](_0xca94('0xe'),_0x34f98e,'request\x20sent');logger[_0xca94('0xf')](_0xca94('0x10'),_0x34f98e,_0xca94('0x11'),JSON[_0xca94('0x12')](_0xfa7322));if(_0xfa7322['error']){if(_0xfa7322[_0xca94('0x13')][_0xca94('0x14')]===0x1f4){logger[_0xca94('0x13')](_0xca94('0xe'),_0x34f98e,_0xfa7322['error']['message']);return _0x3f6182(_0xfa7322[_0xca94('0x13')][_0xca94('0x15')]);}logger['error'](_0xca94('0xe'),_0x34f98e,_0xfa7322[_0xca94('0x13')][_0xca94('0x15')]);return _0x11a550(_0xfa7322[_0xca94('0x13')][_0xca94('0x15')]);}else{logger[_0xca94('0xd')](_0xca94('0xe'),_0x34f98e,'request\x20sent');_0x11a550(_0xfa7322['result'][_0xca94('0x15')]);}})[_0xca94('0x16')](function(_0x4ca4d9){logger[_0xca94('0x13')](_0xca94('0xe'),_0x34f98e,_0x4ca4d9);_0x3f6182(_0x4ca4d9);});});}exports['ShowSmsAccount']=function(_0x1aedc0){var _0x1b225d=this;return new Promise(function(_0x32da75,_0x325846){return db[_0xca94('0x17')][_0xca94('0x18')]({'raw':_0x1aedc0[_0xca94('0x19')]?_0x1aedc0[_0xca94('0x19')][_0xca94('0x1a')]===undefined?!![]:![]:!![],'where':_0x1aedc0[_0xca94('0x19')]?_0x1aedc0[_0xca94('0x19')][_0xca94('0x1b')]||null:null,'attributes':_0x1aedc0[_0xca94('0x19')]?_0x1aedc0['options']['attributes']||null:null,'include':_0x1aedc0[_0xca94('0x19')]?_0x1aedc0[_0xca94('0x19')][_0xca94('0x1c')]?_[_0xca94('0x1d')](_0x1aedc0[_0xca94('0x19')][_0xca94('0x1c')],function(_0x17be30){return{'model':db[_0x17be30['model']],'as':_0x17be30['as'],'attributes':_0x17be30[_0xca94('0x1e')],'include':_0x17be30['include']?_[_0xca94('0x1d')](_0x17be30[_0xca94('0x1c')],function(_0x455089){return{'model':db[_0x455089[_0xca94('0x1f')]],'as':_0x455089['as'],'attributes':_0x455089[_0xca94('0x1e')],'include':_0x455089['include']?_[_0xca94('0x1d')](_0x455089['include'],function(_0x50e733){return{'model':db[_0x50e733[_0xca94('0x1f')]],'as':_0x50e733['as'],'attributes':_0x50e733[_0xca94('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xca94('0x20')](function(_0x52df31){logger['info'](_0xca94('0x21'),_0x1aedc0);logger[_0xca94('0xf')]('ShowSmsAccount',_0x1aedc0,JSON[_0xca94('0x12')](_0x52df31));_0x32da75(_0x52df31);})[_0xca94('0x16')](function(_0x174890){logger[_0xca94('0x13')](_0xca94('0x21'),_0x174890[_0xca94('0x15')],_0x1aedc0);_0x325846(_0x1b225d['error'](0x1f4,_0x174890[_0xca94('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index 3052f22..e9258a5 100644 --- a/server/api/smsAccount/smsAccount.socket.js +++ b/server/api/smsAccount/smsAccount.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0xa9e0[_0x47a7d0];return _0xb9bd08;};'use strict';var SmsAccountEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){SmsAccountEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);SmsAccountEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file +var _0xa9e0=['register','length','smsAccount:','./smsAccount.events','save','remove','emit','removeListener'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xa9e0[_0x30ae5e];return _0x1f2e93;};'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 26d764d..885671b 100644 --- a/server/api/smsApplication/index.js +++ b/server/api/smsApplication/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3e74=['path','connect-timeout','express','../../components/auth/service','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','exports','multer'];(function(_0x1ca6b9,_0x341300){var _0x364fdc=function(_0x2499e3){while(--_0x2499e3){_0x1ca6b9['push'](_0x1ca6b9['shift']());}};_0x364fdc(++_0x341300);}(_0x3e74,0x175));var _0x43e7=function(_0x4b645e,_0x3151c8){_0x4b645e=_0x4b645e-0x0;var _0x7ac9bf=_0x3e74[_0x4b645e];return _0x7ac9bf;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x43e7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x43e7('0x5'));var controller=require(_0x43e7('0x6'));router[_0x43e7('0x7')]('/',auth[_0x43e7('0x8')](),controller[_0x43e7('0x9')]);router['get'](_0x43e7('0xa'),auth[_0x43e7('0x8')](),controller[_0x43e7('0xb')]);router[_0x43e7('0xc')]('/',auth[_0x43e7('0x8')](),controller['create']);router[_0x43e7('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x43e7('0xe')]);router[_0x43e7('0xf')]('/:id',auth[_0x43e7('0x8')](),controller['destroy']);module[_0x43e7('0x10')]=router; \ No newline at end of file +var _0x3e74=['path','connect-timeout','express','../../components/auth/service','../../config/environment','./smsApplication.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','exports','multer'];(function(_0x5a852b,_0x1694c2){var _0xd74d84=function(_0x170a6d){while(--_0x170a6d){_0x5a852b['push'](_0x5a852b['shift']());}};_0xd74d84(++_0x1694c2);}(_0x3e74,0x175));var _0x43e7=function(_0x1336a3,_0x1d6d79){_0x1336a3=_0x1336a3-0x0;var _0x1b5fe6=_0x3e74[_0x1336a3];return _0x1b5fe6;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x43e7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x43e7('0x5'));var controller=require(_0x43e7('0x6'));router[_0x43e7('0x7')]('/',auth[_0x43e7('0x8')](),controller[_0x43e7('0x9')]);router['get'](_0x43e7('0xa'),auth[_0x43e7('0x8')](),controller[_0x43e7('0xb')]);router[_0x43e7('0xc')]('/',auth[_0x43e7('0x8')](),controller['create']);router[_0x43e7('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x43e7('0xe')]);router[_0x43e7('0xf')]('/:id',auth[_0x43e7('0x8')](),controller['destroy']);module[_0x43e7('0x10')]=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index 50f5c67..64805fe 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 _0xb8cc=['TEXT','*,*,*,*','sequelize','exports','INTEGER','STRING','noop'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0xb8cc,0x11a));var _0xcb8c=function(_0x30ff1c,_0x4ed1f4){_0x30ff1c=_0x30ff1c-0x0;var _0x1e5f51=_0xb8cc[_0x30ff1c];return _0x1e5f51;};'use strict';var Sequelize=require(_0xcb8c('0x0'));module[_0xcb8c('0x1')]={'priority':{'type':Sequelize[_0xcb8c('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xcb8c('0x3')],'allowNull':![],'defaultValue':_0xcb8c('0x4')},'appdata':{'type':Sequelize[_0xcb8c('0x5')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xcb8c('0x6')}}; \ No newline at end of file +var _0xe676=['TEXT','*,*,*,*','sequelize','exports','INTEGER','STRING','noop'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0xe676,0x167));var _0x6e67=function(_0x31eb67,_0x9bc8c0){_0x31eb67=_0x31eb67-0x0;var _0x2a8cb8=_0xe676[_0x31eb67];return _0x2a8cb8;};'use strict';var Sequelize=require(_0x6e67('0x0'));module[_0x6e67('0x1')]={'priority':{'type':Sequelize[_0x6e67('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x6e67('0x3')],'allowNull':![],'defaultValue':_0x6e67('0x4')},'appdata':{'type':Sequelize[_0x6e67('0x5')]()},'description':{'type':Sequelize[_0x6e67('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x6e67('0x6')}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index 018dd47..ac73780 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 _0x2112=['request-promise','bluebird','mustache','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','destroy','name','send','index','map','SmsApplication','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','include','findAll','catch','show','params','includeAll','options','find','create','body','eml-format','zip-dir'];(function(_0x4970d6,_0x2e6b07){var _0x2857f3=function(_0x447128){while(--_0x447128){_0x4970d6['push'](_0x4970d6['shift']());}};_0x2857f3(++_0x2e6b07);}(_0x2112,0x8c));var _0x2211=function(_0xaab0a9,_0x394bcc){_0xaab0a9=_0xaab0a9-0x0;var _0x367f01=_0x2112[_0xaab0a9];return _0x367f01;};'use strict';var emlformat=require(_0x2211('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2211('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2211('0x2'));var moment=require('moment');var BPromise=require(_0x2211('0x3'));var Mustache=require(_0x2211('0x4'));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(_0x2211('0x5'));var _=require(_0x2211('0x6'));var squel=require(_0x2211('0x7'));var crypto=require('crypto');var jsforce=require(_0x2211('0x8'));var deskjs=require(_0x2211('0x9'));var toCsv=require('to-csv');var querystring=require(_0x2211('0xa'));var Papa=require(_0x2211('0xb'));var Redis=require('ioredis');var authService=require(_0x2211('0xc'));var qs=require(_0x2211('0xd'));var as=require(_0x2211('0xe'));var hardwareService=require(_0x2211('0xf'));var logger=require(_0x2211('0x10'))(_0x2211('0x11'));var utils=require(_0x2211('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x2211('0x13'));var db=require(_0x2211('0x14'))['db'];function respondWithStatusCode(_0x34acd2,_0x5e508d){_0x5e508d=_0x5e508d||0xcc;return function(_0x5474d3){if(_0x5474d3){return _0x34acd2[_0x2211('0x15')](_0x5e508d);}return _0x34acd2[_0x2211('0x16')](_0x5e508d)[_0x2211('0x17')]();};}function respondWithResult(_0x5cc309,_0x14c563){_0x14c563=_0x14c563||0xc8;return function(_0x6a12be){if(_0x6a12be){return _0x5cc309[_0x2211('0x16')](_0x14c563)[_0x2211('0x18')](_0x6a12be);}};}function respondWithFilteredResult(_0x1dcb43,_0x3e41de){return function(_0x2e9969){if(_0x2e9969){var _0x37edbf=typeof _0x3e41de[_0x2211('0x19')]==='undefined'&&typeof _0x3e41de[_0x2211('0x1a')]===_0x2211('0x1b');var _0x2a8770=_0x2e9969[_0x2211('0x1c')];var _0x4ddfb1=_0x37edbf?0x0:_0x3e41de[_0x2211('0x19')];var _0x461654=_0x37edbf?_0x2e9969[_0x2211('0x1c')]:_0x3e41de['offset']+_0x3e41de['limit'];var _0x2220f4;if(_0x461654>=_0x2a8770){_0x461654=_0x2a8770;_0x2220f4=0xc8;}else{_0x2220f4=0xce;}_0x1dcb43['status'](_0x2220f4);return _0x1dcb43[_0x2211('0x1d')](_0x2211('0x1e'),_0x4ddfb1+'-'+_0x461654+'/'+_0x2a8770)[_0x2211('0x18')](_0x2e9969);}return null;};}function patchUpdates(_0x27c1a3){return function(_0x35db54){try{jsonpatch['apply'](_0x35db54,_0x27c1a3,!![]);}catch(_0xea2edf){return BPromise[_0x2211('0x1f')](_0xea2edf);}return _0x35db54[_0x2211('0x20')]();};}function saveUpdates(_0x3adbcb,_0xc7af86){return function(_0x5767c5){if(_0x5767c5){return _0x5767c5[_0x2211('0x21')](_0x3adbcb)[_0x2211('0x22')](function(_0x4d0e1a){return _0x4d0e1a;});}return null;};}function removeEntity(_0x333c6c,_0x1f445e){return function(_0x1a4786){if(_0x1a4786){return _0x1a4786[_0x2211('0x23')]()[_0x2211('0x22')](function(){_0x333c6c[_0x2211('0x16')](0xcc)[_0x2211('0x17')]();});}};}function handleEntityNotFound(_0x163aba,_0x57b4c4){return function(_0x460d21){if(!_0x460d21){_0x163aba[_0x2211('0x15')](0x194);}return _0x460d21;};}function handleError(_0xa1277a,_0x1fc1b0){_0x1fc1b0=_0x1fc1b0||0x1f4;return function(_0x13201c){logger['error'](_0x13201c['stack']);if(_0x13201c[_0x2211('0x24')]){delete _0x13201c[_0x2211('0x24')];}_0xa1277a['status'](_0x1fc1b0)[_0x2211('0x25')](_0x13201c);};}exports[_0x2211('0x26')]=function(_0x328971,_0x5232a6){var _0x71e239={},_0x5d9aaf={},_0x2f9300={'count':0x0,'rows':[]};var _0x4e3afd=_[_0x2211('0x27')](db[_0x2211('0x28')][_0x2211('0x29')],function(_0x5d8820){return{'name':_0x5d8820[_0x2211('0x2a')],'type':_0x5d8820[_0x2211('0x2b')][_0x2211('0x2c')]};});_0x5d9aaf[_0x2211('0x2d')]=_[_0x2211('0x27')](_0x4e3afd,_0x2211('0x24'));_0x5d9aaf[_0x2211('0x2e')]=_[_0x2211('0x2f')](_0x328971[_0x2211('0x2e')]);_0x5d9aaf[_0x2211('0x30')]=_[_0x2211('0x31')](_0x5d9aaf[_0x2211('0x2d')],_0x5d9aaf['query']);_0x71e239[_0x2211('0x32')]=_[_0x2211('0x31')](_0x5d9aaf['model'],qs['fields'](_0x328971[_0x2211('0x2e')][_0x2211('0x33')]));_0x71e239['attributes']=_0x71e239['attributes'][_0x2211('0x34')]?_0x71e239[_0x2211('0x32')]:_0x5d9aaf[_0x2211('0x2d')];if(!_0x328971[_0x2211('0x2e')][_0x2211('0x35')](_0x2211('0x36'))){_0x71e239[_0x2211('0x1a')]=qs[_0x2211('0x1a')](_0x328971[_0x2211('0x2e')][_0x2211('0x1a')]);_0x71e239['offset']=qs[_0x2211('0x19')](_0x328971[_0x2211('0x2e')][_0x2211('0x19')]);}_0x71e239[_0x2211('0x37')]=qs[_0x2211('0x38')](_0x328971[_0x2211('0x2e')]['sort']);_0x71e239[_0x2211('0x39')]=qs['filters'](_[_0x2211('0x3a')](_0x328971[_0x2211('0x2e')],_0x5d9aaf[_0x2211('0x30')]),_0x4e3afd);if(_0x328971[_0x2211('0x2e')]['filter']){_0x71e239[_0x2211('0x39')]=_[_0x2211('0x3b')](_0x71e239['where'],{'$or':_[_0x2211('0x27')](_0x4e3afd,function(_0x10fe46){if(_0x10fe46[_0x2211('0x2b')]!==_0x2211('0x3c')){var _0x4376e0={};_0x4376e0[_0x10fe46['name']]={'$like':'%'+_0x328971[_0x2211('0x2e')]['filter']+'%'};return _0x4376e0;}})});}_0x71e239=_[_0x2211('0x3b')]({},_0x71e239,_0x328971['options']);var _0x58f77a={'where':_0x71e239[_0x2211('0x39')]};return db[_0x2211('0x28')][_0x2211('0x1c')](_0x58f77a)[_0x2211('0x22')](function(_0x51f22a){_0x2f9300['count']=_0x51f22a;if(_0x328971[_0x2211('0x2e')]['includeAll']){_0x71e239[_0x2211('0x3d')]=[{'all':!![]}];}return db['SmsApplication'][_0x2211('0x3e')](_0x71e239);})[_0x2211('0x22')](function(_0x5e5c2c){_0x2f9300['rows']=_0x5e5c2c;return _0x2f9300;})[_0x2211('0x22')](respondWithFilteredResult(_0x5232a6,_0x71e239))[_0x2211('0x3f')](handleError(_0x5232a6,null));};exports[_0x2211('0x40')]=function(_0x2a5a48,_0x34e24b){var _0x5c70d7={'raw':!![],'where':{'id':_0x2a5a48[_0x2211('0x41')]['id']}},_0x243937={};_0x243937[_0x2211('0x2d')]=_[_0x2211('0x2f')](db['SmsApplication']['rawAttributes']);_0x243937[_0x2211('0x2e')]=_[_0x2211('0x2f')](_0x2a5a48[_0x2211('0x2e')]);_0x243937[_0x2211('0x30')]=_[_0x2211('0x31')](_0x243937[_0x2211('0x2d')],_0x243937[_0x2211('0x2e')]);_0x5c70d7[_0x2211('0x32')]=_[_0x2211('0x31')](_0x243937[_0x2211('0x2d')],qs[_0x2211('0x33')](_0x2a5a48['query']['fields']));_0x5c70d7[_0x2211('0x32')]=_0x5c70d7['attributes'][_0x2211('0x34')]?_0x5c70d7[_0x2211('0x32')]:_0x243937[_0x2211('0x2d')];if(_0x2a5a48[_0x2211('0x2e')][_0x2211('0x42')]){_0x5c70d7[_0x2211('0x3d')]=[{'all':!![]}];}_0x5c70d7=_['merge']({},_0x5c70d7,_0x2a5a48[_0x2211('0x43')]);return db[_0x2211('0x28')][_0x2211('0x44')](_0x5c70d7)[_0x2211('0x22')](handleEntityNotFound(_0x34e24b,null))['then'](respondWithResult(_0x34e24b,null))['catch'](handleError(_0x34e24b,null));};exports[_0x2211('0x45')]=function(_0x23cc63,_0x579ac7){return db[_0x2211('0x28')][_0x2211('0x45')](_0x23cc63[_0x2211('0x46')],{})[_0x2211('0x22')](respondWithResult(_0x579ac7,0xc9))[_0x2211('0x3f')](handleError(_0x579ac7,null));};exports[_0x2211('0x21')]=function(_0x5b09d9,_0x330888){if(_0x5b09d9['body']['id']){delete _0x5b09d9['body']['id'];}return db[_0x2211('0x28')]['find']({'where':{'id':_0x5b09d9[_0x2211('0x41')]['id']}})[_0x2211('0x22')](handleEntityNotFound(_0x330888,null))['then'](saveUpdates(_0x5b09d9[_0x2211('0x46')],null))['then'](respondWithResult(_0x330888,null))[_0x2211('0x3f')](handleError(_0x330888,null));};exports[_0x2211('0x23')]=function(_0x21ff6a,_0x3c892c){return db[_0x2211('0x28')]['find']({'where':{'id':_0x21ff6a[_0x2211('0x41')]['id']}})[_0x2211('0x22')](handleEntityNotFound(_0x3c892c,null))[_0x2211('0x22')](removeEntity(_0x3c892c,null))['catch'](handleError(_0x3c892c,null));}; \ No newline at end of file +var _0xd48e=['mustache','util','path','sox','ejs','squel','crypto','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','count','set','apply','reject','then','destroy','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','pick','filter','where','merge','options','SmsApplication','includeAll','include','findAll','rows','catch','show','params','find','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird'];(function(_0x2d405c,_0x4f1258){var _0x44f2df=function(_0x15fc84){while(--_0x15fc84){_0x2d405c['push'](_0x2d405c['shift']());}};_0x44f2df(++_0x4f1258);}(_0xd48e,0x1b0));var _0xed48=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0xd48e[_0x1caf6a];return _0x1bf493;};'use strict';var emlformat=require(_0xed48('0x0'));var rimraf=require(_0xed48('0x1'));var zipdir=require(_0xed48('0x2'));var jsonpatch=require(_0xed48('0x3'));var rp=require('request-promise');var moment=require(_0xed48('0x4'));var BPromise=require(_0xed48('0x5'));var Mustache=require(_0xed48('0x6'));var util=require(_0xed48('0x7'));var path=require(_0xed48('0x8'));var sox=require(_0xed48('0x9'));var csv=require('to-csv');var ejs=require(_0xed48('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xed48('0xb'));var crypto=require(_0xed48('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xed48('0xd'));var querystring=require(_0xed48('0xe'));var Papa=require(_0xed48('0xf'));var Redis=require(_0xed48('0x10'));var authService=require(_0xed48('0x11'));var qs=require(_0xed48('0x12'));var as=require(_0xed48('0x13'));var hardwareService=require(_0xed48('0x14'));var logger=require(_0xed48('0x15'))(_0xed48('0x16'));var utils=require('../../config/utils');var config=require(_0xed48('0x17'));var licenseUtil=require(_0xed48('0x18'));var db=require(_0xed48('0x19'))['db'];function respondWithStatusCode(_0x2e3da7,_0x26ae13){_0x26ae13=_0x26ae13||0xcc;return function(_0x8a51b1){if(_0x8a51b1){return _0x2e3da7['sendStatus'](_0x26ae13);}return _0x2e3da7[_0xed48('0x1a')](_0x26ae13)[_0xed48('0x1b')]();};}function respondWithResult(_0x163c64,_0x5e3d85){_0x5e3d85=_0x5e3d85||0xc8;return function(_0x44e7b0){if(_0x44e7b0){return _0x163c64['status'](_0x5e3d85)[_0xed48('0x1c')](_0x44e7b0);}};}function respondWithFilteredResult(_0x4b257a,_0x13f20f){return function(_0x501baf){if(_0x501baf){var _0x44ca14=typeof _0x13f20f[_0xed48('0x1d')]==='undefined'&&typeof _0x13f20f[_0xed48('0x1e')]==='undefined';var _0x3ac0f5=_0x501baf[_0xed48('0x1f')];var _0x3d907c=_0x44ca14?0x0:_0x13f20f[_0xed48('0x1d')];var _0x20d69f=_0x44ca14?_0x501baf['count']:_0x13f20f[_0xed48('0x1d')]+_0x13f20f[_0xed48('0x1e')];var _0x59d019;if(_0x20d69f>=_0x3ac0f5){_0x20d69f=_0x3ac0f5;_0x59d019=0xc8;}else{_0x59d019=0xce;}_0x4b257a[_0xed48('0x1a')](_0x59d019);return _0x4b257a[_0xed48('0x20')]('Content-Range',_0x3d907c+'-'+_0x20d69f+'/'+_0x3ac0f5)[_0xed48('0x1c')](_0x501baf);}return null;};}function patchUpdates(_0x480c6b){return function(_0x11760b){try{jsonpatch[_0xed48('0x21')](_0x11760b,_0x480c6b,!![]);}catch(_0x2c1a1a){return BPromise[_0xed48('0x22')](_0x2c1a1a);}return _0x11760b['save']();};}function saveUpdates(_0x2022c3,_0x50a53a){return function(_0x1cbc84){if(_0x1cbc84){return _0x1cbc84['update'](_0x2022c3)[_0xed48('0x23')](function(_0x1a1057){return _0x1a1057;});}return null;};}function removeEntity(_0x4d1003,_0x5e8d2b){return function(_0x602f){if(_0x602f){return _0x602f[_0xed48('0x24')]()[_0xed48('0x23')](function(){_0x4d1003[_0xed48('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5de23,_0x4e0773){return function(_0x28ea57){if(!_0x28ea57){_0x5de23[_0xed48('0x25')](0x194);}return _0x28ea57;};}function handleError(_0x58ccde,_0x20ba6c){_0x20ba6c=_0x20ba6c||0x1f4;return function(_0x17a2e9){logger['error'](_0x17a2e9[_0xed48('0x26')]);if(_0x17a2e9['name']){delete _0x17a2e9[_0xed48('0x27')];}_0x58ccde[_0xed48('0x1a')](_0x20ba6c)[_0xed48('0x28')](_0x17a2e9);};}exports[_0xed48('0x29')]=function(_0x2f04a5,_0xb82141){var _0x47193d={},_0x5948ed={},_0x4f7c8e={'count':0x0,'rows':[]};var _0x1c4e1c=_[_0xed48('0x2a')](db['SmsApplication'][_0xed48('0x2b')],function(_0x2ad583){return{'name':_0x2ad583[_0xed48('0x2c')],'type':_0x2ad583['type']['key']};});_0x5948ed['model']=_[_0xed48('0x2a')](_0x1c4e1c,_0xed48('0x27'));_0x5948ed[_0xed48('0x2d')]=_[_0xed48('0x2e')](_0x2f04a5[_0xed48('0x2d')]);_0x5948ed[_0xed48('0x2f')]=_[_0xed48('0x30')](_0x5948ed[_0xed48('0x31')],_0x5948ed[_0xed48('0x2d')]);_0x47193d['attributes']=_[_0xed48('0x30')](_0x5948ed[_0xed48('0x31')],qs[_0xed48('0x32')](_0x2f04a5[_0xed48('0x2d')][_0xed48('0x32')]));_0x47193d[_0xed48('0x33')]=_0x47193d[_0xed48('0x33')][_0xed48('0x34')]?_0x47193d[_0xed48('0x33')]:_0x5948ed[_0xed48('0x31')];if(!_0x2f04a5[_0xed48('0x2d')][_0xed48('0x35')]('nolimit')){_0x47193d[_0xed48('0x1e')]=qs['limit'](_0x2f04a5[_0xed48('0x2d')]['limit']);_0x47193d[_0xed48('0x1d')]=qs[_0xed48('0x1d')](_0x2f04a5['query'][_0xed48('0x1d')]);}_0x47193d[_0xed48('0x36')]=qs['sort'](_0x2f04a5[_0xed48('0x2d')][_0xed48('0x37')]);_0x47193d['where']=qs[_0xed48('0x2f')](_[_0xed48('0x38')](_0x2f04a5[_0xed48('0x2d')],_0x5948ed[_0xed48('0x2f')]),_0x1c4e1c);if(_0x2f04a5[_0xed48('0x2d')][_0xed48('0x39')]){_0x47193d[_0xed48('0x3a')]=_['merge'](_0x47193d[_0xed48('0x3a')],{'$or':_[_0xed48('0x2a')](_0x1c4e1c,function(_0x578e6b){if(_0x578e6b['type']!=='VIRTUAL'){var _0x52d1e6={};_0x52d1e6[_0x578e6b[_0xed48('0x27')]]={'$like':'%'+_0x2f04a5[_0xed48('0x2d')]['filter']+'%'};return _0x52d1e6;}})});}_0x47193d=_[_0xed48('0x3b')]({},_0x47193d,_0x2f04a5[_0xed48('0x3c')]);var _0x35cff0={'where':_0x47193d[_0xed48('0x3a')]};return db[_0xed48('0x3d')][_0xed48('0x1f')](_0x35cff0)['then'](function(_0xc9b21){_0x4f7c8e[_0xed48('0x1f')]=_0xc9b21;if(_0x2f04a5[_0xed48('0x2d')][_0xed48('0x3e')]){_0x47193d[_0xed48('0x3f')]=[{'all':!![]}];}return db['SmsApplication'][_0xed48('0x40')](_0x47193d);})[_0xed48('0x23')](function(_0x4afa39){_0x4f7c8e[_0xed48('0x41')]=_0x4afa39;return _0x4f7c8e;})[_0xed48('0x23')](respondWithFilteredResult(_0xb82141,_0x47193d))[_0xed48('0x42')](handleError(_0xb82141,null));};exports[_0xed48('0x43')]=function(_0x309307,_0x382858){var _0x1233ef={'raw':!![],'where':{'id':_0x309307[_0xed48('0x44')]['id']}},_0x588bd0={};_0x588bd0[_0xed48('0x31')]=_[_0xed48('0x2e')](db[_0xed48('0x3d')]['rawAttributes']);_0x588bd0[_0xed48('0x2d')]=_[_0xed48('0x2e')](_0x309307[_0xed48('0x2d')]);_0x588bd0[_0xed48('0x2f')]=_[_0xed48('0x30')](_0x588bd0['model'],_0x588bd0[_0xed48('0x2d')]);_0x1233ef[_0xed48('0x33')]=_['intersection'](_0x588bd0['model'],qs[_0xed48('0x32')](_0x309307[_0xed48('0x2d')][_0xed48('0x32')]));_0x1233ef[_0xed48('0x33')]=_0x1233ef[_0xed48('0x33')][_0xed48('0x34')]?_0x1233ef[_0xed48('0x33')]:_0x588bd0[_0xed48('0x31')];if(_0x309307[_0xed48('0x2d')][_0xed48('0x3e')]){_0x1233ef[_0xed48('0x3f')]=[{'all':!![]}];}_0x1233ef=_['merge']({},_0x1233ef,_0x309307[_0xed48('0x3c')]);return db[_0xed48('0x3d')][_0xed48('0x45')](_0x1233ef)[_0xed48('0x23')](handleEntityNotFound(_0x382858,null))[_0xed48('0x23')](respondWithResult(_0x382858,null))[_0xed48('0x42')](handleError(_0x382858,null));};exports[_0xed48('0x46')]=function(_0x5253f0,_0xa1a7e4){return db['SmsApplication'][_0xed48('0x46')](_0x5253f0[_0xed48('0x47')],{})[_0xed48('0x23')](respondWithResult(_0xa1a7e4,0xc9))['catch'](handleError(_0xa1a7e4,null));};exports[_0xed48('0x48')]=function(_0x34b171,_0x1bd0af){if(_0x34b171[_0xed48('0x47')]['id']){delete _0x34b171[_0xed48('0x47')]['id'];}return db[_0xed48('0x3d')][_0xed48('0x45')]({'where':{'id':_0x34b171['params']['id']}})[_0xed48('0x23')](handleEntityNotFound(_0x1bd0af,null))['then'](saveUpdates(_0x34b171['body'],null))['then'](respondWithResult(_0x1bd0af,null))[_0xed48('0x42')](handleError(_0x1bd0af,null));};exports['destroy']=function(_0x302d4f,_0x54b237){return db[_0xed48('0x3d')][_0xed48('0x45')]({'where':{'id':_0x302d4f['params']['id']}})[_0xed48('0x23')](handleEntityNotFound(_0x54b237,null))[_0xed48('0x23')](removeEntity(_0x54b237,null))[_0xed48('0x42')](handleError(_0x54b237,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index 41463fb..a74c6e2 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 _0x131a=['sms_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','exports','define','SmsApplication'];(function(_0x440454,_0x4a323d){var _0x4bb436=function(_0x525122){while(--_0x525122){_0x440454['push'](_0x440454['shift']());}};_0x4bb436(++_0x4a323d);}(_0x131a,0x18b));var _0xa131=function(_0x4e80e1,_0xe94205){_0x4e80e1=_0x4e80e1-0x0;var _0x38be88=_0x131a[_0x4e80e1];return _0x38be88;};'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('./smsApplication.attributes');module[_0xa131('0x8')]=function(_0xdb263c,_0x1a51cf){return _0xdb263c[_0xa131('0x9')](_0xa131('0xa'),attributes,{'tableName':_0xa131('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa131('0xc'),'collate':_0xa131('0xd')});}; \ No newline at end of file +var _0xd056=['./smsApplication.attributes','exports','define','SmsApplication','sms_applications','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x57ff66,_0x403ac6){var _0x459863=function(_0x99f11c){while(--_0x99f11c){_0x57ff66['push'](_0x57ff66['shift']());}};_0x459863(++_0x403ac6);}(_0xd056,0x142));var _0x6d05=function(_0x461e48,_0x4ee394){_0x461e48=_0x461e48-0x0;var _0x1aaef3=_0xd056[_0x461e48];return _0x1aaef3;};'use strict';var _=require('lodash');var util=require(_0x6d05('0x0'));var logger=require(_0x6d05('0x1'))(_0x6d05('0x2'));var moment=require(_0x6d05('0x3'));var BPromise=require(_0x6d05('0x4'));var rp=require(_0x6d05('0x5'));var fs=require('fs');var path=require(_0x6d05('0x6'));var rimraf=require('rimraf');var config=require(_0x6d05('0x7'));var attributes=require(_0x6d05('0x8'));module[_0x6d05('0x9')]=function(_0x332568,_0x26f393){return _0x332568[_0x6d05('0xa')](_0x6d05('0xb'),attributes,{'tableName':_0x6d05('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6d05('0xd'),'collate':_0x6d05('0xe')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index 0111333..ca88d2e 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 _0x8a5c=['request','then','info','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http'];(function(_0x58eae0,_0x3a2bc2){var _0x4f63cf=function(_0x55c14a){while(--_0x55c14a){_0x58eae0['push'](_0x58eae0['shift']());}};_0x4f63cf(++_0x3a2bc2);}(_0x8a5c,0x136));var _0xc8a5=function(_0x5e5718,_0x36258a){_0x5e5718=_0x5e5718-0x0;var _0x33d659=_0x8a5c[_0x5e5718];return _0x33d659;};'use strict';var _=require(_0xc8a5('0x0'));var util=require(_0xc8a5('0x1'));var moment=require(_0xc8a5('0x2'));var BPromise=require(_0xc8a5('0x3'));var rs=require(_0xc8a5('0x4'));var fs=require('fs');var Redis=require(_0xc8a5('0x5'));var db=require(_0xc8a5('0x6'))['db'];var utils=require(_0xc8a5('0x7'));var logger=require(_0xc8a5('0x8'))('rpc');var config=require(_0xc8a5('0x9'));var jayson=require(_0xc8a5('0xa'));var client=jayson['client'][_0xc8a5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xcee97e,_0xd6de78,_0xa9f42c){return new BPromise(function(_0x4d25e4,_0x3ecf08){return client[_0xc8a5('0xc')](_0xcee97e,_0xa9f42c)[_0xc8a5('0xd')](function(_0x2c1fe9){logger[_0xc8a5('0xe')](_0xc8a5('0xf'),_0xd6de78,_0xc8a5('0x10'));logger[_0xc8a5('0x11')](_0xc8a5('0x12'),_0xd6de78,'request\x20sent',JSON['stringify'](_0x2c1fe9));if(_0x2c1fe9[_0xc8a5('0x13')]){if(_0x2c1fe9['error'][_0xc8a5('0x14')]===0x1f4){logger[_0xc8a5('0x13')](_0xc8a5('0xf'),_0xd6de78,_0x2c1fe9[_0xc8a5('0x13')][_0xc8a5('0x15')]);return _0x3ecf08(_0x2c1fe9['error'][_0xc8a5('0x15')]);}logger[_0xc8a5('0x13')]('SmsApplication,\x20%s,\x20%s',_0xd6de78,_0x2c1fe9[_0xc8a5('0x13')][_0xc8a5('0x15')]);return _0x4d25e4(_0x2c1fe9[_0xc8a5('0x13')][_0xc8a5('0x15')]);}else{logger[_0xc8a5('0xe')](_0xc8a5('0xf'),_0xd6de78,'request\x20sent');_0x4d25e4(_0x2c1fe9[_0xc8a5('0x16')][_0xc8a5('0x15')]);}})['catch'](function(_0x36a78b){logger[_0xc8a5('0x13')]('SmsApplication,\x20%s,\x20%s',_0xd6de78,_0x36a78b);_0x3ecf08(_0x36a78b);});});} \ No newline at end of file +var _0xa5aa=['jayson/promise','client','request','then','info','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x4de741,_0x2bf1ee){var _0x41a392=function(_0x54a818){while(--_0x54a818){_0x4de741['push'](_0x4de741['shift']());}};_0x41a392(++_0x2bf1ee);}(_0xa5aa,0x1ac));var _0xaa5a=function(_0x2fc046,_0x5a1296){_0x2fc046=_0x2fc046-0x0;var _0x207283=_0xa5aa[_0x2fc046];return _0x207283;};'use strict';var _=require(_0xaa5a('0x0'));var util=require(_0xaa5a('0x1'));var moment=require('moment');var BPromise=require(_0xaa5a('0x2'));var rs=require(_0xaa5a('0x3'));var fs=require('fs');var Redis=require(_0xaa5a('0x4'));var db=require(_0xaa5a('0x5'))['db'];var utils=require(_0xaa5a('0x6'));var logger=require(_0xaa5a('0x7'))('rpc');var config=require(_0xaa5a('0x8'));var jayson=require(_0xaa5a('0x9'));var client=jayson[_0xaa5a('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5ca487,_0x26e49b,_0x3ec50a){return new BPromise(function(_0x4daa9a,_0x8f2d83){return client[_0xaa5a('0xb')](_0x5ca487,_0x3ec50a)[_0xaa5a('0xc')](function(_0x5d1b4b){logger[_0xaa5a('0xd')](_0xaa5a('0xe'),_0x26e49b,_0xaa5a('0xf'));logger[_0xaa5a('0x10')](_0xaa5a('0x11'),_0x26e49b,_0xaa5a('0xf'),JSON['stringify'](_0x5d1b4b));if(_0x5d1b4b[_0xaa5a('0x12')]){if(_0x5d1b4b[_0xaa5a('0x12')][_0xaa5a('0x13')]===0x1f4){logger[_0xaa5a('0x12')](_0xaa5a('0xe'),_0x26e49b,_0x5d1b4b[_0xaa5a('0x12')][_0xaa5a('0x14')]);return _0x8f2d83(_0x5d1b4b[_0xaa5a('0x12')][_0xaa5a('0x14')]);}logger[_0xaa5a('0x12')](_0xaa5a('0xe'),_0x26e49b,_0x5d1b4b[_0xaa5a('0x12')]['message']);return _0x4daa9a(_0x5d1b4b[_0xaa5a('0x12')][_0xaa5a('0x14')]);}else{logger[_0xaa5a('0xd')]('SmsApplication,\x20%s,\x20%s',_0x26e49b,_0xaa5a('0xf'));_0x4daa9a(_0x5d1b4b[_0xaa5a('0x15')][_0xaa5a('0x14')]);}})[_0xaa5a('0x16')](function(_0x8e1dde){logger[_0xaa5a('0x12')](_0xaa5a('0xe'),_0x26e49b,_0x8e1dde);_0x8f2d83(_0x8e1dde);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index 431ec34..8ed703f 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 _0x955f=['fs-extra','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','/:id/messages','download','post','create','addMessage','/:id/tags','tracked','sms','smsinteraction:addtags','addTags','put','smsinteraction:update','update','delete','smsinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','express'];(function(_0x56da9c,_0x100463){var _0x475fbb=function(_0x488bce){while(--_0x488bce){_0x56da9c['push'](_0x56da9c['shift']());}};_0x475fbb(++_0x100463);}(_0x955f,0x1eb));var _0xf955=function(_0x35c3a6,_0x272182){_0x35c3a6=_0x35c3a6-0x0;var _0x4d72a5=_0x955f[_0x35c3a6];return _0x4d72a5;};'use strict';var multer=require(_0xf955('0x0'));var util=require(_0xf955('0x1'));var path=require(_0xf955('0x2'));var timeout=require(_0xf955('0x3'));var express=require(_0xf955('0x4'));var router=express['Router']();var fs_extra=require(_0xf955('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xf955('0x6'));var controller=require('./smsInteraction.controller');router[_0xf955('0x7')]('/',auth[_0xf955('0x8')](),controller[_0xf955('0x9')]);router['get'](_0xf955('0xa'),auth[_0xf955('0x8')](),controller['describe']);router[_0xf955('0x7')](_0xf955('0xb'),auth[_0xf955('0x8')](),controller[_0xf955('0xc')]);router[_0xf955('0x7')](_0xf955('0xd'),auth[_0xf955('0x8')](),controller['getMessages']);router[_0xf955('0x7')]('/:id/download',auth[_0xf955('0x8')](),controller[_0xf955('0xe')]);router[_0xf955('0xf')]('/',auth['isAuthenticated'](),controller[_0xf955('0x10')]);router['post'](_0xf955('0xd'),auth['isAuthenticated'](),controller[_0xf955('0x11')]);router[_0xf955('0xf')](_0xf955('0x12'),auth[_0xf955('0x8')](),interaction[_0xf955('0x13')](_0xf955('0x14'),_0xf955('0x15')),controller[_0xf955('0x16')]);router[_0xf955('0x17')](_0xf955('0xb'),auth['isAuthenticated'](),interaction[_0xf955('0x13')]('sms',_0xf955('0x18')),controller[_0xf955('0x19')]);router[_0xf955('0x1a')](_0xf955('0xb'),auth['isAuthenticated'](),interaction['tracked'](_0xf955('0x14'),_0xf955('0x1b')),controller[_0xf955('0x1c')]);router['delete'](_0xf955('0x12'),auth[_0xf955('0x8')](),controller[_0xf955('0x1d')]);module[_0xf955('0x1e')]=router; \ No newline at end of file +var _0x0b0e=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsInteraction.controller','get','isAuthenticated','index','describe','/:id','/:id/messages','getMessages','download','post','create','addMessage','/:id/tags','tracked','sms','smsinteraction:addtags','put','smsinteraction:update','delete','exports','multer'];(function(_0x59178d,_0x43efe1){var _0x162c0c=function(_0x5b11d2){while(--_0x5b11d2){_0x59178d['push'](_0x59178d['shift']());}};_0x162c0c(++_0x43efe1);}(_0x0b0e,0x187));var _0xe0b0=function(_0x2d460c,_0x4f08c0){_0x2d460c=_0x2d460c-0x0;var _0xf6fc4c=_0x0b0e[_0x2d460c];return _0xf6fc4c;};'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')]('/describe',auth['isAuthenticated'](),controller[_0xe0b0('0xc')]);router[_0xe0b0('0x9')](_0xe0b0('0xd'),auth[_0xe0b0('0xa')](),controller['show']);router[_0xe0b0('0x9')](_0xe0b0('0xe'),auth['isAuthenticated'](),controller[_0xe0b0('0xf')]);router[_0xe0b0('0x9')]('/:id/download',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x10')]);router[_0xe0b0('0x11')]('/',auth['isAuthenticated'](),controller[_0xe0b0('0x12')]);router[_0xe0b0('0x11')](_0xe0b0('0xe'),auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x13')]);router['post'](_0xe0b0('0x14'),auth[_0xe0b0('0xa')](),interaction[_0xe0b0('0x15')](_0xe0b0('0x16'),_0xe0b0('0x17')),controller['addTags']);router[_0xe0b0('0x18')]('/:id',auth[_0xe0b0('0xa')](),interaction[_0xe0b0('0x15')]('sms',_0xe0b0('0x19')),controller['update']);router[_0xe0b0('0x1a')](_0xe0b0('0xd'),auth['isAuthenticated'](),interaction['tracked'](_0xe0b0('0x16'),'smsinteraction:destroy'),controller['destroy']);router['delete'](_0xe0b0('0x14'),auth['isAuthenticated'](),controller['removeTags']);module[_0xe0b0('0x1b')]=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index 66859b4..b861b35 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 _0x2494=['DATE','STRING','out','ENUM','sequelize','exports','BOOLEAN'];(function(_0x54f6a,_0x331aa8){var _0x15081a=function(_0x16a9f6){while(--_0x16a9f6){_0x54f6a['push'](_0x54f6a['shift']());}};_0x15081a(++_0x331aa8);}(_0x2494,0x82));var _0x4249=function(_0xfefa58,_0x33c53d){_0xfefa58=_0xfefa58-0x0;var _0x38dc12=_0x2494[_0xfefa58];return _0x38dc12;};'use strict';var Sequelize=require(_0x4249('0x0'));var moment=require('moment');module[_0x4249('0x1')]={'closed':{'type':Sequelize[_0x4249('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x4249('0x3')]},'disposition':{'type':Sequelize[_0x4249('0x4')]},'secondDisposition':{'type':Sequelize[_0x4249('0x4')]},'thirdDisposition':{'type':Sequelize[_0x4249('0x4')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x4249('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x4249('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x4249('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x4249('0x6')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x4249('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0xe260=['out','sequelize','exports','BOOLEAN','DATE','STRING','ENUM'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xe260,0x94));var _0x0e26=function(_0x231f08,_0x1138db){_0x231f08=_0x231f08-0x0;var _0x25e2b1=_0xe260[_0x231f08];return _0x25e2b1;};'use strict';var Sequelize=require(_0x0e26('0x0'));var moment=require('moment');module[_0x0e26('0x1')]={'closed':{'type':Sequelize[_0x0e26('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x0e26('0x3')]},'disposition':{'type':Sequelize[_0x0e26('0x4')]},'secondDisposition':{'type':Sequelize[_0x0e26('0x4')]},'thirdDisposition':{'type':Sequelize[_0x0e26('0x4')]},'note':{'type':Sequelize[_0x0e26('0x4')]},'phone':{'type':Sequelize[_0x0e26('0x4')]},'read1stAt':{'type':Sequelize[_0x0e26('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x0e26('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x0e26('0x5')]('in',_0x0e26('0x6')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x0e26('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index b70748f..dc21b1e 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 _0x0ee8=['save','update','destroy','error','stack','name','send','Users','map','fullname','TagIds','Tags','split','forEach','push','then','catch','SmsInteraction','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filters','pick','field','from','u.id','u.fullname','user_has_sms_interactions','left_join','u.id\x20=\x20ui.UserId','sms_interactions','cm_contacts','users','o.id\x20=\x20i.UserId','sms_accounts','a.id\x20=\x20i.SmsAccountId','sms_messages','me.SmsInteractionId\x20=\x20i.id','sms_interaction_has_tags','tools_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','length','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','UserId','compact','isEmpty','SmsAccountId','where','i.SmsAccountId\x20IN\x20?','concat','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','QueryTypes','SELECT','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','resolve','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','role','agent','i.SmsAccountId\x20IS\x20NULL','toString','keyBy','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','Contact.phone','c.fax','o.fullname','GROUP_CONCAT(DISTINCT\x20t.id)','ui.SmsInteractionId\x20IN\x20?','groupBy','SmsInteractionId','all','rows','show','params','includeAll','include','merge','options','create','body','describe','addMessage','omit','ids','getMessages','findOne','SmsMessage','$gte','YYYY-MM-DD\x20HH:mm:ss','setTags','spread','findAll','smsInteractionTags:save','removeTags','download','server','tmp','join','root','attachments','format','transcript-%d-%s.zip','User','CmContact','lastName','createdAt','direction','SmsAccount','Account','Owner','get','N.A.','closedAt','disposition','Messages','out','System','firstName','secret','renderFile','Sms','createPdfFromHTML','log','err','unlinkSync','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/export/pdf','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./smsInteraction.socket','register','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject'];(function(_0x23e028,_0x3287ca){var _0x2514bf=function(_0x2845a2){while(--_0x2845a2){_0x23e028['push'](_0x23e028['shift']());}};_0x2514bf(++_0x3287ca);}(_0x0ee8,0xbc));var _0x80ee=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x0ee8[_0x8c43de];return _0xa6591b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x80ee('0x0'));var zipdir=require(_0x80ee('0x1'));var jsonpatch=require(_0x80ee('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x80ee('0x3'));var Mustache=require(_0x80ee('0x4'));var util=require(_0x80ee('0x5'));var path=require(_0x80ee('0x6'));var sox=require(_0x80ee('0x7'));var csv=require('to-csv');var ejs=require(_0x80ee('0x8'));var fs=require('fs');var fs_extra=require(_0x80ee('0x9'));var _=require(_0x80ee('0xa'));var squel=require(_0x80ee('0xb'));var crypto=require(_0x80ee('0xc'));var jsforce=require(_0x80ee('0xd'));var deskjs=require(_0x80ee('0xe'));var toCsv=require(_0x80ee('0xf'));var querystring=require(_0x80ee('0x10'));var Papa=require('papaparse');var Redis=require(_0x80ee('0x11'));var authService=require(_0x80ee('0x12'));var qs=require(_0x80ee('0x13'));var as=require('../../components/parsers/advancedSearch');var pdf=require(_0x80ee('0x14'));var hardwareService=require(_0x80ee('0x15'));var logger=require('../../config/logger')(_0x80ee('0x16'));var utils=require(_0x80ee('0x17'));var config=require(_0x80ee('0x18'));var licenseUtil=require(_0x80ee('0x19'));var db=require(_0x80ee('0x1a'))['db'];config['redis']=_[_0x80ee('0x1b')](config[_0x80ee('0x1c')],{'host':_0x80ee('0x1d'),'port':0x18eb});var socket=require(_0x80ee('0x1e'))(new Redis(config[_0x80ee('0x1c')]));require(_0x80ee('0x1f'))[_0x80ee('0x20')](socket);function respondWithStatusCode(_0x1a36ff,_0x219508){_0x219508=_0x219508||0xcc;return function(_0x35d68f){if(_0x35d68f){return _0x1a36ff[_0x80ee('0x21')](_0x219508);}return _0x1a36ff[_0x80ee('0x22')](_0x219508)[_0x80ee('0x23')]();};}function respondWithResult(_0xed6df,_0x1c6afd){_0x1c6afd=_0x1c6afd||0xc8;return function(_0x1878b9){if(_0x1878b9){return _0xed6df['status'](_0x1c6afd)[_0x80ee('0x24')](_0x1878b9);}};}function respondWithFilteredResult(_0x560dc7,_0x5621b5){return function(_0x462c8a){if(_0x462c8a){var _0xfe39ed=typeof _0x5621b5[_0x80ee('0x25')]==='undefined'&&typeof _0x5621b5[_0x80ee('0x26')]===_0x80ee('0x27');var _0x597967=_0x462c8a[_0x80ee('0x28')];var _0x5cf9a7=_0xfe39ed?0x0:_0x5621b5[_0x80ee('0x25')];var _0x4604be=_0xfe39ed?_0x462c8a[_0x80ee('0x28')]:_0x5621b5['offset']+_0x5621b5['limit'];var _0x20ede6;if(_0x4604be>=_0x597967){_0x4604be=_0x597967;_0x20ede6=0xc8;}else{_0x20ede6=0xce;}_0x560dc7[_0x80ee('0x22')](_0x20ede6);return _0x560dc7[_0x80ee('0x29')](_0x80ee('0x2a'),_0x5cf9a7+'-'+_0x4604be+'/'+_0x597967)[_0x80ee('0x24')](_0x462c8a);}return null;};}function patchUpdates(_0x3238a0){return function(_0x1a9202){try{jsonpatch[_0x80ee('0x2b')](_0x1a9202,_0x3238a0,!![]);}catch(_0xacd47e){return BPromise[_0x80ee('0x2c')](_0xacd47e);}return _0x1a9202[_0x80ee('0x2d')]();};}function saveUpdates(_0x8a1976,_0x598c5e){return function(_0x42af66){if(_0x42af66){return _0x42af66[_0x80ee('0x2e')](_0x8a1976)['then'](function(_0x57e22e){return _0x57e22e;});}return null;};}function removeEntity(_0x42d68c,_0x36ae71){return function(_0x18bf3b){if(_0x18bf3b){return _0x18bf3b[_0x80ee('0x2f')]()['then'](function(){_0x42d68c[_0x80ee('0x22')](0xcc)[_0x80ee('0x23')]();});}};}function handleEntityNotFound(_0x1c97e8,_0x23159a){return function(_0x1c3f32){if(!_0x1c3f32){_0x1c97e8['sendStatus'](0x194);}return _0x1c3f32;};}function handleError(_0x4df0c6,_0x3aeaa6){_0x3aeaa6=_0x3aeaa6||0x1f4;return function(_0x33a7b0){logger[_0x80ee('0x30')](_0x33a7b0[_0x80ee('0x31')]);if(_0x33a7b0[_0x80ee('0x32')]){delete _0x33a7b0[_0x80ee('0x32')];}_0x4df0c6[_0x80ee('0x22')](_0x3aeaa6)[_0x80ee('0x33')](_0x33a7b0);};}function getInteractionUsers(_0x248840,_0x1a91ac){return new BPromise(function(_0x2f8eb7,_0x5a65b5){try{if(_0x1a91ac[_0x248840['id']]){_0x248840[_0x80ee('0x34')]=_[_0x80ee('0x35')](_0x1a91ac[_0x248840['id']],function(_0x94af0b){return{'id':_0x94af0b['id'],'fullname':_0x94af0b[_0x80ee('0x36')]};});}}catch(_0x6627dc){_0x5a65b5(_0x6627dc);}_0x2f8eb7(_0x248840);});}function getInteractionTags(_0x157d6a,_0xa0870d){return new BPromise(function(_0x34b000,_0x1fca8c){try{if(_0x157d6a[_0x80ee('0x37')]){_0x157d6a[_0x80ee('0x38')]=[];_0x157d6a[_0x80ee('0x37')][_0x80ee('0x39')](',')[_0x80ee('0x3a')](function(_0x56763a){_0x157d6a['Tags'][_0x80ee('0x3b')](_0xa0870d[_0x56763a]);});}delete _0x157d6a[_0x80ee('0x37')];}catch(_0x5f06cb){_0x1fca8c(_0x5f06cb);}_0x34b000(_0x157d6a);});}function updateSmsInteraction(_0x3bc59b,_0x361b1f,_0x4eadbf){return new BPromise(function(_0x99ec4,_0x25d0f8){return getInteractionUsers(_0x3bc59b,_0x4eadbf)[_0x80ee('0x3c')](function(_0x55c5d9){return getInteractionTags(_0x55c5d9,_0x361b1f);})['then'](function(_0x38660f){_0x99ec4(_0x38660f);})[_0x80ee('0x3d')](function(_0x3cc040){_0x25d0f8(_0x3cc040);});});}exports['index']=function(_0x4536a4,_0x2e7971){var _0x47a6c5={},_0x33100e={},_0x1e9ae0={'count':0x0,'rows':[]};var _0x186ca0=_[_0x80ee('0x35')](db[_0x80ee('0x3e')][_0x80ee('0x3f')],function(_0x393190){return{'name':_0x393190['fieldName'],'type':_0x393190[_0x80ee('0x40')][_0x80ee('0x41')]};});_0x33100e[_0x80ee('0x42')]=_[_0x80ee('0x35')](_0x186ca0,_0x80ee('0x32'));_0x33100e[_0x80ee('0x43')]=_[_0x80ee('0x44')](_0x4536a4[_0x80ee('0x43')]);_0x33100e['filters']=_[_0x80ee('0x45')](_0x33100e[_0x80ee('0x42')],_0x33100e['query']);_0x47a6c5[_0x80ee('0x46')]=_['intersection'](_0x33100e[_0x80ee('0x42')],qs[_0x80ee('0x47')](_0x4536a4[_0x80ee('0x43')][_0x80ee('0x47')]));_0x47a6c5[_0x80ee('0x46')]=_0x47a6c5[_0x80ee('0x46')]['length']?_0x47a6c5[_0x80ee('0x46')]:_0x33100e[_0x80ee('0x42')];if(!_0x4536a4[_0x80ee('0x43')][_0x80ee('0x48')](_0x80ee('0x49'))){_0x47a6c5[_0x80ee('0x26')]=qs[_0x80ee('0x26')](_0x4536a4[_0x80ee('0x43')]['limit']);_0x47a6c5[_0x80ee('0x25')]=qs[_0x80ee('0x25')](_0x4536a4[_0x80ee('0x43')]['offset']);}_0x47a6c5[_0x80ee('0x4a')]=qs['sort'](_0x4536a4['query'][_0x80ee('0x4b')]);_0x47a6c5['where']=qs[_0x80ee('0x4c')](_[_0x80ee('0x4d')](_0x4536a4[_0x80ee('0x43')],_0x33100e[_0x80ee('0x4c')]),_0x186ca0);var _0x3be8d7=[];var _0x5c1909=squel['select']()[_0x80ee('0x4e')]('id')['field'](_0x80ee('0x32'))[_0x80ee('0x4e')]('color')[_0x80ee('0x4f')]('tools_tags');var _0x491d8b=squel['select']()[_0x80ee('0x4e')](_0x80ee('0x50'))['field'](_0x80ee('0x51'))['field']('ui.SmsInteractionId')['from'](_0x80ee('0x52'),'ui')[_0x80ee('0x53')]('users','u',_0x80ee('0x54'));var _0x398c97=squel['select']()[_0x80ee('0x4f')](_0x80ee('0x55'),'i')[_0x80ee('0x53')](_0x80ee('0x56'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x80ee('0x53')](_0x80ee('0x57'),'o',_0x80ee('0x58'))[_0x80ee('0x53')](_0x80ee('0x59'),'a',_0x80ee('0x5a'))[_0x80ee('0x53')](_0x80ee('0x5b'),'me',_0x80ee('0x5c'))[_0x80ee('0x53')](_0x80ee('0x5d'),'it','it.SmsInteractionId\x20=\x20i.id')[_0x80ee('0x53')](_0x80ee('0x5e'),'t',_0x80ee('0x5f'));var _0x14dcb7=squel['expr']();var _0x44eee9=[];var _0x1834de=squel[_0x80ee('0x60')]();var _0x174199;if(_0x4536a4['query'][_0x80ee('0x61')]){_0x174199=as[_0x80ee('0x62')](_0x4536a4[_0x80ee('0x43')][_0x80ee('0x61')]);var _0x25430b=_0x174199[_0x80ee('0x63')];for(var _0x4f6bfa=0x0;_0x4f6bfa<_0x174199[_0x80ee('0x64')][_0x80ee('0x65')];_0x4f6bfa++){var _0x3a0779=_0x174199[_0x80ee('0x64')][_0x4f6bfa];var _0x4cf352='i';var _0x132963=_[_0x80ee('0x66')](_0x186ca0,[_0x80ee('0x32'),_0x3a0779[_0x80ee('0x4e')]]);if(!_0x132963){switch(_0x3a0779[_0x80ee('0x4e')]){case _0x80ee('0x67'):if(_0x3a0779[_0x80ee('0x68')]==0x1){_0x398c97[_0x80ee('0x69')]('`'+_0x3a0779['field']+_0x80ee('0x6a'));}else{_0x398c97[_0x80ee('0x69')]('`'+_0x3a0779[_0x80ee('0x4e')]+_0x80ee('0x6b'));}break;case _0x80ee('0x6c'):if(_0x3a0779[_0x80ee('0x6d')]===_0x80ee('0x6e')){if(_0x3a0779[_0x80ee('0x68')]['split']('\x20')[_0x80ee('0x65')]>0x1){_0x14dcb7[_0x25430b]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x80ee('0x6f')](_0x3a0779[_0x80ee('0x68')]),null);}else{var _0x5ade25='%'+_0x3a0779['value']+'%';_0x14dcb7[_0x25430b](_0x80ee('0x70'),_0x5ade25,_0x5ade25,_0x5ade25);}}else{_0x132963=_[_0x80ee('0x66')](_0x186ca0,[_0x80ee('0x32'),_0x80ee('0x71')]);_0x3a0779['field']='ContactId';_0xd783=as[_0x80ee('0x72')](_0x4cf352,_0x132963[_0x80ee('0x40')],_0x3a0779);_0x14dcb7[_0x25430b](_0xd783[_0x80ee('0x73')],_0xd783['value'][_0x80ee('0x74')],_0xd783[_0x80ee('0x68')]['end']);}break;case _0x80ee('0x75'):var _0x126358=_0x3a0779[_0x80ee('0x68')][_0x80ee('0x39')](',')[_0x80ee('0x35')](function(_0x2d666a){return Number(_0x2d666a);});_0x126358[_0x80ee('0x3a')](function(_0x27317b){_0x1834de['or'](_0x80ee('0x76'),'%,'+_0x27317b+',%');});_0x44eee9=_[_0x80ee('0x77')](_0x44eee9,_0x126358);break;case'User':if(_0x3a0779['operator']==='$substring'){_0x14dcb7[_0x25430b]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x3a0779[_0x80ee('0x68')]+'%',null);}else{_0x132963=_[_0x80ee('0x66')](_0x186ca0,[_0x80ee('0x32'),'UserId']);_0x3a0779[_0x80ee('0x4e')]=_0x80ee('0x78');_0xd783=as[_0x80ee('0x72')](_0x4cf352,_0x132963[_0x80ee('0x40')],_0x3a0779);_0x14dcb7[_0x25430b](_0xd783[_0x80ee('0x73')],_0xd783['value'][_0x80ee('0x74')],_0xd783[_0x80ee('0x68')]['end']);}break;case'body':_0xd783=as[_0x80ee('0x72')]('me',null,_0x3a0779);_0x14dcb7[_0x25430b](_0xd783[_0x80ee('0x73')],_0xd783[_0x80ee('0x68')]['start'],_0xd783[_0x80ee('0x68')][_0x80ee('0x23')]);break;}}else{var _0xd783=as[_0x80ee('0x72')](_0x4cf352,_0x132963['type'],_0x3a0779);_0x14dcb7[_0x25430b](_0xd783[_0x80ee('0x73')],_0xd783[_0x80ee('0x68')][_0x80ee('0x74')],_0xd783[_0x80ee('0x68')][_0x80ee('0x23')]);}}}else{var _0x3fe3f5=_(_0x4536a4[_0x80ee('0x43')])[_0x80ee('0x44')]()[_0x80ee('0x35')](function(_0x3b2a4f){return _['some'](_0x186ca0,['name',_0x3b2a4f])?_0x3b2a4f:undefined;})[_0x80ee('0x79')]()[_0x80ee('0x68')]();if(!_[_0x80ee('0x7a')](_0x3fe3f5)){_0x3fe3f5['forEach'](function(_0x371546){if(_0x371546===_0x80ee('0x7b')){_0x398c97[_0x80ee('0x7c')](_0x80ee('0x7d'),[][_0x80ee('0x7e')](_0x4536a4[_0x80ee('0x43')][_0x371546]));}else if(_0x371546==='createdAt'){var _0x44775d=JSON[_0x80ee('0x7f')](_0x4536a4[_0x80ee('0x43')][_0x371546])['$gte'];var _0x29cbce=JSON[_0x80ee('0x7f')](_0x4536a4['query'][_0x371546])[_0x80ee('0x80')];_0x398c97[_0x80ee('0x7c')](_0x80ee('0x81'),_0x44775d,_0x29cbce);}else{if(_0x4536a4[_0x80ee('0x43')][_0x371546]===_0x80ee('0x82')){_0x398c97[_0x80ee('0x7c')]('i.'+_0x371546+_0x80ee('0x83'));}else{_0x398c97[_0x80ee('0x7c')]('i.'+_0x371546+_0x80ee('0x84'),_0x4536a4[_0x80ee('0x43')][_0x371546]);}}});}if(_0x4536a4['query'][_0x80ee('0x85')]){if(_0x4536a4[_0x80ee('0x43')][_0x80ee('0x85')]==0x1){_0x398c97[_0x80ee('0x69')](_0x80ee('0x86'));}else{_0x398c97[_0x80ee('0x69')](_0x80ee('0x87'));}}if(_0x4536a4['query']['tag']){_0x44eee9=_[_0x80ee('0x88')](_0x4536a4[_0x80ee('0x43')][_0x80ee('0x89')])?_0x4536a4['query']['tag']:new Array(_0x4536a4[_0x80ee('0x43')][_0x80ee('0x89')]);_0x44eee9['forEach'](function(_0x242858){_0x1834de['or'](_0x80ee('0x76'),'%,'+_0x242858+',%');});}if(_0x4536a4[_0x80ee('0x43')][_0x80ee('0x8a')]){var _0x44a313=_0x4536a4[_0x80ee('0x43')]['filter'][_0x80ee('0x8b')]('\x5c','\x5c\x5c')[_0x80ee('0x8b')](/'/g,'\x27\x27');if(qs[_0x80ee('0x8c')](_0x44a313)){_0x14dcb7['or'](_0x80ee('0x8d'),_0x44a313+'%')['or'](_0x80ee('0x8e'),_0x44a313+'%');}else{_0x14dcb7['or'](_0x80ee('0x8f'),qs[_0x80ee('0x6f')](_0x44a313))['or'](_0x80ee('0x90'),_0x44a313+'%');}}}_0x398c97[_0x80ee('0x7c')](_0x14dcb7);_0x398c97[_0x80ee('0x91')](_0x80ee('0x92'));var _0x371faa={'type':db['Sequelize'][_0x80ee('0x93')][_0x80ee('0x94')],'raw':!![]};var _0x192367=_0x398c97['clone']();_0x192367['field'](_0x80ee('0x92'));_0x192367[_0x80ee('0x4e')](_0x80ee('0x95'),_0x80ee('0x67'));if(_0x47a6c5['order']){_0x47a6c5[_0x80ee('0x4a')]['forEach'](function(_0x1e2de8){var _0x4bca0c=_0x1e2de8[0x0]===_0x80ee('0x96')?_0x1e2de8[0x0]:'i.'+_0x1e2de8[0x0];_0x398c97[_0x80ee('0x4a')](_0x4bca0c,_0x1e2de8[0x1]===_0x80ee('0x97')?![]:!![]);});}if(!_['isEmpty'](_0x44eee9)){_0x398c97[_0x80ee('0x69')](_0x1834de);_0x192367[_0x80ee('0x7c')](_0x80ee('0x98'),_0x44eee9);}BPromise[_0x80ee('0x99')]()['then'](function(){if(!_0x174199){if(_0x4536a4[_0x80ee('0x43')]['SmsAccountId'])return;_0x192367[_0x80ee('0x7c')](_0x80ee('0x9a'));_0x398c97[_0x80ee('0x7c')](_0x80ee('0x9a'));return;}if(_0x4536a4[_0x80ee('0x9b')][_0x80ee('0x9c')]!==_0x80ee('0x9d'))return;return _0x4536a4[_0x80ee('0x9b')]['getSmsAccounts']({'attributes':['id'],'raw':!![]})[_0x80ee('0x3c')](function(_0x4bf2d2){if(_[_0x80ee('0x7a')](_0x4bf2d2)){_0x192367[_0x80ee('0x7c')]('i.SmsAccountId\x20IS\x20NULL');_0x398c97[_0x80ee('0x7c')](_0x80ee('0x9e'));}else{_0x192367['where'](_0x80ee('0x7d'),_[_0x80ee('0x35')](_0x4bf2d2,'id'));_0x398c97['where']('i.SmsAccountId\x20IN\x20?',_[_0x80ee('0x35')](_0x4bf2d2,'id'));}});})[_0x80ee('0x3c')](function(){if(_0x4536a4[_0x80ee('0x9b')][_0x80ee('0x9c')]==='agent'&&!_0x174199&&!_0x4536a4[_0x80ee('0x43')][_0x80ee('0x7b')])return[];return db['sequelize'][_0x80ee('0x43')](_0x192367[_0x80ee('0x9f')](),_0x371faa);})[_0x80ee('0x3c')](function(_0x505fa8){_0x1e9ae0[_0x80ee('0x28')]=_0x505fa8[_0x80ee('0x65')];if(_0x1e9ae0['count']===0x0)return[];return db['sequelize'][_0x80ee('0x43')](_0x5c1909[_0x80ee('0x9f')](),_0x371faa)[_0x80ee('0x3c')](function(_0x5763b6){_0x3be8d7=_[_0x80ee('0xa0')](_0x5763b6,'id');_0x371faa=_['merge'](_0x371faa,{'model':db['SmsInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x4536a4[_0x80ee('0x43')][_0x80ee('0x47')]){_0x47a6c5['attributes'][_0x80ee('0x3a')](function(_0x4215b9){_0x398c97[_0x80ee('0x4e')]('i.'+_0x4215b9);});}else{_0x398c97['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x80ee('0x67'));_0x398c97[_0x80ee('0x4e')]('a.key',_0x80ee('0xa1'));_0x398c97[_0x80ee('0x4e')](_0x80ee('0xa2'),_0x80ee('0xa3'));_0x398c97[_0x80ee('0x4e')](_0x80ee('0xa4'),'contactName');_0x398c97[_0x80ee('0x4e')](_0x80ee('0xa5'));_0x398c97[_0x80ee('0x4e')]('c.firstName',_0x80ee('0xa6'));_0x398c97[_0x80ee('0x4e')](_0x80ee('0xa7'),_0x80ee('0xa8'));_0x398c97[_0x80ee('0x4e')](_0x80ee('0xa9'),_0x80ee('0xaa'));_0x398c97[_0x80ee('0x4e')]('c.phone',_0x80ee('0xab'));_0x398c97[_0x80ee('0x4e')]('c.mobile','Contact.mobile');_0x398c97[_0x80ee('0x4e')](_0x80ee('0xac'),'Contact.fax');_0x398c97[_0x80ee('0x4e')](_0x80ee('0xad'),'Owner.fullname');_0x398c97[_0x80ee('0x4e')]('o.internal','Owner.internal');_0x398c97[_0x80ee('0x4e')](_0x80ee('0xae'),_0x80ee('0x37'));}if(_0x47a6c5['limit'])_0x398c97[_0x80ee('0x26')](_0x47a6c5[_0x80ee('0x26')]);if(_0x47a6c5['offset'])_0x398c97[_0x80ee('0x25')](_0x47a6c5[_0x80ee('0x25')]);return db['sequelize'][_0x80ee('0x43')](_0x398c97[_0x80ee('0x9f')](),_0x371faa);})[_0x80ee('0x3c')](function(_0x5b4003){if(_0x5b4003[_0x80ee('0x65')]>0x0)_0x491d8b['where'](_0x80ee('0xaf'),_[_0x80ee('0x35')](_0x5b4003,'id'));return db['sequelize'][_0x80ee('0x43')](_0x491d8b['toString'](),_0x371faa)['then'](function(_0x59006f){var _0x339d2a=_[_0x80ee('0xb0')](_0x59006f,_0x80ee('0xb1'));var _0x4a578d=[];_0x5b4003[_0x80ee('0x3a')](function(_0x53b427){_0x4a578d[_0x80ee('0x3b')](updateSmsInteraction(_0x53b427,_0x3be8d7,_0x339d2a));});return BPromise[_0x80ee('0xb2')](_0x4a578d);});});})['then'](function(_0xb53b78){_0x1e9ae0[_0x80ee('0xb3')]=_0xb53b78;return _0x1e9ae0;})[_0x80ee('0x3c')](respondWithFilteredResult(_0x2e7971,_0x47a6c5))['catch'](handleError(_0x2e7971,null));};exports[_0x80ee('0xb4')]=function(_0x41d60f,_0x400ec8){var _0x41fb02={'raw':![],'where':{'id':_0x41d60f[_0x80ee('0xb5')]['id']}},_0x2fe51b={};_0x2fe51b[_0x80ee('0x42')]=_[_0x80ee('0x44')](db[_0x80ee('0x3e')][_0x80ee('0x3f')]);_0x2fe51b[_0x80ee('0x43')]=_[_0x80ee('0x44')](_0x41d60f['query']);_0x2fe51b[_0x80ee('0x4c')]=_[_0x80ee('0x45')](_0x2fe51b['model'],_0x2fe51b[_0x80ee('0x43')]);_0x41fb02['attributes']=_['intersection'](_0x2fe51b[_0x80ee('0x42')],qs[_0x80ee('0x47')](_0x41d60f[_0x80ee('0x43')][_0x80ee('0x47')]));_0x41fb02[_0x80ee('0x46')]=_0x41fb02[_0x80ee('0x46')][_0x80ee('0x65')]?_0x41fb02[_0x80ee('0x46')]:_0x2fe51b[_0x80ee('0x42')];if(_0x41d60f['query'][_0x80ee('0xb6')]){_0x41fb02[_0x80ee('0xb7')]=[{'all':!![]}];}_0x41fb02=_[_0x80ee('0xb8')]({},_0x41fb02,_0x41d60f[_0x80ee('0xb9')]);return db['SmsInteraction'][_0x80ee('0x66')](_0x41fb02)['then'](handleEntityNotFound(_0x400ec8,null))['then'](respondWithResult(_0x400ec8,null))['catch'](handleError(_0x400ec8,null));};exports['create']=function(_0x53b48f,_0x260935){return db[_0x80ee('0x3e')][_0x80ee('0xba')](_0x53b48f[_0x80ee('0xbb')],{})['then'](respondWithResult(_0x260935,0xc9))[_0x80ee('0x3d')](handleError(_0x260935,null));};exports['update']=function(_0x1b35ff,_0x4ff367){if(_0x1b35ff[_0x80ee('0xbb')]['id']){delete _0x1b35ff[_0x80ee('0xbb')]['id'];}return db[_0x80ee('0x3e')]['find']({'where':{'id':_0x1b35ff[_0x80ee('0xb5')]['id']}})[_0x80ee('0x3c')](handleEntityNotFound(_0x4ff367,null))[_0x80ee('0x3c')](saveUpdates(_0x1b35ff['body'],null))[_0x80ee('0x3c')](respondWithResult(_0x4ff367,null))[_0x80ee('0x3d')](handleError(_0x4ff367,null));};exports[_0x80ee('0x2f')]=function(_0x3e8693,_0x39d429){return db['SmsInteraction'][_0x80ee('0x66')]({'where':{'id':_0x3e8693[_0x80ee('0xb5')]['id']}})['then'](handleEntityNotFound(_0x39d429,null))['then'](removeEntity(_0x39d429,null))[_0x80ee('0x3d')](handleError(_0x39d429,null));};exports[_0x80ee('0xbc')]=function(_0x3a2cbc,_0x2ce608){return db['SmsInteraction']['describe']()[_0x80ee('0x3c')](respondWithResult(_0x2ce608,null))[_0x80ee('0x3d')](handleError(_0x2ce608,null));};exports[_0x80ee('0xbd')]=function(_0x1e78eb,_0x344de,_0x27571b){return db['SmsMessage'][_0x80ee('0x66')]({'where':{'id':_0x1e78eb[_0x80ee('0xb5')]['id']}})['then'](handleEntityNotFound(_0x344de,null))[_0x80ee('0x3c')](function(_0x342cf7){if(_0x342cf7){return _0x342cf7[_0x80ee('0xbd')](_0x1e78eb['body']['ids'],_[_0x80ee('0xbe')](_0x1e78eb[_0x80ee('0xbb')],[_0x80ee('0xbf'),'id'])||{});}})['then'](respondWithResult(_0x344de,null))['catch'](handleError(_0x344de,null));};exports[_0x80ee('0xc0')]=function(_0x24337d,_0xf0617c,_0x43de64){var _0x5a255d={'raw':![],'where':{}};var _0x34a65b={};var _0x36e37f={'count':0x0,'rows':[]};return db[_0x80ee('0x3e')][_0x80ee('0xc1')]({'where':{'id':_0x24337d['params']['id']}})[_0x80ee('0x3c')](handleEntityNotFound(_0xf0617c,null))[_0x80ee('0x3c')](function(_0x5c1a65){if(_0x5c1a65){_0x34a65b[_0x80ee('0x42')]=_[_0x80ee('0x44')](db[_0x80ee('0xc2')][_0x80ee('0x3f')]);_0x34a65b[_0x80ee('0x43')]=_[_0x80ee('0x44')](_0x24337d[_0x80ee('0x43')]);_0x34a65b['filters']=_[_0x80ee('0x45')](_0x34a65b['model'],_0x34a65b[_0x80ee('0x43')]);_0x5a255d[_0x80ee('0x46')]=_['intersection'](_0x34a65b['model'],qs[_0x80ee('0x47')](_0x24337d['query']['fields']));_0x5a255d['attributes']=_0x5a255d[_0x80ee('0x46')][_0x80ee('0x65')]?_0x5a255d['attributes']:_0x34a65b[_0x80ee('0x42')];if(!_0x24337d[_0x80ee('0x43')][_0x80ee('0x48')](_0x80ee('0x49'))){_0x5a255d['limit']=qs[_0x80ee('0x26')](_0x24337d[_0x80ee('0x43')][_0x80ee('0x26')]);_0x5a255d['offset']=qs['offset'](_0x24337d[_0x80ee('0x43')][_0x80ee('0x25')]);}_0x5a255d[_0x80ee('0x4a')]=qs[_0x80ee('0x4b')](_0x24337d['query'][_0x80ee('0x4b')]);_0x5a255d[_0x80ee('0x7c')]=qs[_0x80ee('0x4c')](_[_0x80ee('0x4d')](_0x24337d['query'],_0x34a65b[_0x80ee('0x4c')]));_0x5a255d[_0x80ee('0x7c')]['SmsInteractionId']=_0x5c1a65['id'];if(_0x24337d[_0x80ee('0x43')]['filter']){_0x5a255d[_0x80ee('0x7c')]=_['merge'](_0x5a255d['where'],{'$or':_[_0x80ee('0x35')](_0x5a255d['attributes'],function(_0x2d2a05){var _0x1a3ff4={};_0x1a3ff4[_0x2d2a05]={'$like':'%'+_0x24337d[_0x80ee('0x43')][_0x80ee('0x8a')]+'%'};return _0x1a3ff4;})});}if(_0x24337d['query'][_0x80ee('0xc3')]){var _0x1e516d=_0x24337d[_0x80ee('0x43')][_0x80ee('0xc3')][_0x80ee('0x39')](',');var _0x3f09ec={};_0x3f09ec[_0x1e516d[0x0]]={'$gte':moment(_0x1e516d[0x1])['format'](_0x80ee('0xc4'))};_0x5a255d['where']=_[_0x80ee('0xb8')](_0x5a255d['where'],_0x3f09ec);}_0x5a255d=_['merge']({},_0x5a255d,_0x24337d[_0x80ee('0xb9')]);return db[_0x80ee('0xc2')][_0x80ee('0x28')]({'where':_0x5a255d[_0x80ee('0x7c')]})[_0x80ee('0x3c')](function(_0x2766a0){_0x36e37f[_0x80ee('0x28')]=_0x2766a0;if(_0x24337d[_0x80ee('0x43')][_0x80ee('0xb6')]){_0x5a255d[_0x80ee('0xb7')]=[{'all':!![]}];}return db[_0x80ee('0xc2')]['findAll'](_0x5a255d);})[_0x80ee('0x3c')](function(_0x3d6e7b){_0x36e37f[_0x80ee('0xb3')]=_0x3d6e7b;return _0x36e37f;});}})['then'](respondWithFilteredResult(_0xf0617c,_0x5a255d))[_0x80ee('0x3d')](handleError(_0xf0617c,null));};exports['addTags']=function(_0x296bec,_0x54f694,_0x26ba96){return db[_0x80ee('0x3e')][_0x80ee('0x66')]({'where':{'id':_0x296bec[_0x80ee('0xb5')]['id']}})[_0x80ee('0x3c')](handleEntityNotFound(_0x54f694,null))[_0x80ee('0x3c')](function(_0x3b470f){if(_0x3b470f){return _0x3b470f[_0x80ee('0xc5')](_0x296bec[_0x80ee('0xbb')][_0x80ee('0xbf')],_[_0x80ee('0xbe')](_0x296bec['body'],[_0x80ee('0xbf'),'id'])||{})[_0x80ee('0xc6')](function(){return db[_0x80ee('0x75')][_0x80ee('0xc7')]({'attributes':['id',_0x80ee('0x32'),'color'],'where':{'id':_0x296bec[_0x80ee('0xbb')][_0x80ee('0xbf')]}});})[_0x80ee('0x3c')](function(_0xbbb7a0){socket['emit'](_0x80ee('0xc8'),{'id':Number(_0x296bec[_0x80ee('0xb5')]['id']),'tags':_0xbbb7a0||[]});return{'id':Number(_0x296bec[_0x80ee('0xb5')]['id']),'tags':_0xbbb7a0||[]};});}})[_0x80ee('0x3c')](respondWithResult(_0x54f694,null))[_0x80ee('0x3d')](handleError(_0x54f694,null));};exports['removeTags']=function(_0x5500ea,_0x3c4a78,_0x4263fb){return db[_0x80ee('0x3e')][_0x80ee('0x66')]({'where':{'id':_0x5500ea[_0x80ee('0xb5')]['id']}})[_0x80ee('0x3c')](handleEntityNotFound(_0x3c4a78,null))[_0x80ee('0x3c')](function(_0x2ef12d){if(_0x2ef12d){return _0x2ef12d[_0x80ee('0xc9')](_0x5500ea[_0x80ee('0x43')][_0x80ee('0xbf')]);}})[_0x80ee('0x3c')](respondWithStatusCode(_0x3c4a78,null))[_0x80ee('0x3d')](handleError(_0x3c4a78,null));};exports[_0x80ee('0xca')]=function(_0x311b4d,_0x5d81fc){var _0x42154d=moment()['unix']()[_0x80ee('0x9f')]();var _0x49dcf3=path['join'](config['root'],_0x80ee('0xcb'),'files',_0x80ee('0xcc'));var _0x429d48=path[_0x80ee('0xcd')](config[_0x80ee('0xce')],'server','files',_0x80ee('0xcf'));var _0x327d91=path[_0x80ee('0xcd')](_0x49dcf3,_0x42154d);var _0x16d986=util[_0x80ee('0xd0')](_0x80ee('0xd1'),_0x311b4d['params']['id'],_0x42154d);var _0x2333c1=path[_0x80ee('0xcd')](_0x49dcf3,_0x16d986);var _0x145614=[];_0x145614[_0x80ee('0x3b')]({'model':db['User'],'as':_0x80ee('0xd2'),'attributes':['id',_0x80ee('0x36')],'raw':!![]});_0x145614[_0x80ee('0x3b')]({'model':db[_0x80ee('0xd3')],'as':_0x80ee('0x6c'),'attributes':['id','firstName',_0x80ee('0xd4')],'raw':!![]});var _0x1cacbe=[{'model':db['SmsMessage'],'as':'Messages','attributes':['id',_0x80ee('0xbb'),_0x80ee('0xd5'),_0x80ee('0xd6'),'secret',_0x80ee('0x85')],'include':_0x145614}];_0x1cacbe['push']({'model':db[_0x80ee('0xd7')],'as':_0x80ee('0xd8'),'attributes':['id','name']});_0x1cacbe[_0x80ee('0x3b')]({'model':db[_0x80ee('0xd2')],'as':_0x80ee('0xd9'),'attributes':['id',_0x80ee('0x36')]});return db[_0x80ee('0x3e')][_0x80ee('0x66')]({'where':{'id':_0x311b4d[_0x80ee('0xb5')]['id']},'include':_0x1cacbe})[_0x80ee('0x3c')](handleEntityNotFound(_0x5d81fc,null))[_0x80ee('0x3c')](function(_0xc31935){if(_0xc31935){var _0x5115d4=_0xc31935[_0x80ee('0xda')]({'plain':!![]});fs['mkdirSync'](_0x327d91);var _0x439b44={'channel':'Sms','account':_0x5115d4[_0x80ee('0xd8')][_0x80ee('0x32')],'agent':_0x5115d4['Owner']?_0x5115d4[_0x80ee('0xd9')][_0x80ee('0x36')]:_0x80ee('0xdb'),'createdAt':moment(_0x5115d4['createdAt'])[_0x80ee('0xd0')](_0x80ee('0xc4'))['toString'](),'closedAt':_0x5115d4['closed']?moment(_0x5115d4[_0x80ee('0xdc')])[_0x80ee('0xd0')](_0x80ee('0xc4'))['toString']():'','disposition':_0x5115d4[_0x80ee('0xdd')],'messages':_(_0x5115d4[_0x80ee('0xde')])[_0x80ee('0x8a')]({'secret':![]})[_0x80ee('0x35')](function(_0x2e3a41){return{'date':moment(_0x2e3a41[_0x80ee('0xd5')])[_0x80ee('0xd0')](_0x80ee('0xc4'))[_0x80ee('0x9f')](),'sender':_0x2e3a41[_0x80ee('0xd6')]===_0x80ee('0xdf')?_0x2e3a41[_0x80ee('0xd2')]?_0x2e3a41[_0x80ee('0xd2')][_0x80ee('0x36')]:_0x80ee('0xe0'):_0x2e3a41['Contact'][_0x80ee('0xe1')]+(_0x2e3a41[_0x80ee('0x6c')][_0x80ee('0xd4')]?'\x20'+_0x2e3a41[_0x80ee('0x6c')][_0x80ee('0xd4')]:''),'body':_0x2e3a41[_0x80ee('0xbb')],'direction':_0x2e3a41['direction']==='out'?'A':'C','secret':_0x2e3a41[_0x80ee('0xe2')],'read':_0x2e3a41[_0x80ee('0x85')]};})[_0x80ee('0x68')]()};return ejs[_0x80ee('0xe3')](path[_0x80ee('0xcd')](config[_0x80ee('0xce')],'server','views','downloadInteraction.ejs'),{'interaction':_0x439b44})[_0x80ee('0x3c')](function(_0x498784){var _0x46692e=path[_0x80ee('0xcd')](_0x327d91,'transcript-'+_0x5115d4['id']+'-'+_0x42154d+'.pdf');var _0xaa1f70={'path':_0x46692e,'channel':_0x80ee('0xe4'),'interactionId':_0x5115d4['id']};return pdf[_0x80ee('0xe5')](_0x498784,_0xaa1f70);})['then'](function(){return new BPromise(function(_0x5d96a7,_0x4d965e){zipdir(_0x327d91,{'saveTo':_0x2333c1},function(_0x106e3c,_0x42ac53){if(_0x106e3c)return _0x4d965e(_0x106e3c);return _0x5d96a7(_0x42ac53);});})[_0x80ee('0x3c')](function(){return new BPromise(function(_0x39776c,_0x76c157){rimraf(_0x327d91,function(_0x57bdf5){if(_0x57bdf5)_0x76c157(_0x57bdf5);return _0x39776c();});});})[_0x80ee('0x3c')](function(){return _0x5d81fc[_0x80ee('0xca')](_0x2333c1,_0x16d986,function(_0xbcd4db){if(_0xbcd4db){console[_0x80ee('0xe6')](_0x80ee('0xe7'),_0xbcd4db);}else{fs[_0x80ee('0xe8')](_0x2333c1);}});});});}else{return _0x5d81fc[_0x80ee('0x21')](0xc8);}})[_0x80ee('0x3d')](handleError(_0x5d81fc,null));}; \ No newline at end of file +var _0x8c9c=['merge','a.key','Account.key','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','i.*','c.firstName','Contact.email','c.phone','Contact.phone','c.fax','Contact.fax','o.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.SmsInteractionId\x20IN\x20?','groupBy','all','catch','show','params','include','options','create','describe','addMessage','SmsMessage','ids','getMessages','SmsInteractionId','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','addTags','setTags','omit','findAll','smsInteractionTags:save','removeTags','unix','join','root','files','tmp','server','attachments','transcript-%d-%s.zip','fullname','CmContact','firstName','lastName','Messages','direction','secret','SmsAccount','Account','Owner','get','Sms','N.A.','closed','closedAt','disposition','out','System','Contact','renderFile','views','transcript-','.pdf','createPdfFromHTML','download','log','err','unlinkSync','sendStatus','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./smsInteraction.socket','register','status','end','json','undefined','limit','count','offset','apply','save','update','then','destroy','stack','name','send','Users','map','TagIds','Tags','split','forEach','push','SmsInteraction','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','field','color','from','tools_tags','select','u.id','u.fullname','users','u.id\x20=\x20ui.UserId','sms_interactions','left_join','cm_contacts','o.id\x20=\x20i.UserId','sms_accounts','sms_messages','me.SmsInteractionId\x20=\x20i.id','sms_interaction_has_tags','t.id\x20=\x20it.TagId','expr','search','conditions','find','unreadMessages','having','`\x20=\x200','operator','value','getFullTextValue','ContactId','buildExpression','type','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','text','body','some','compact','SmsAccountId','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','isEmpty','resolve','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','agent','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','i.SmsAccountId\x20IN\x20?','sequelize','toString','keyBy'];(function(_0x15f303,_0xb51396){var _0x5b5843=function(_0x24bd45){while(--_0x24bd45){_0x15f303['push'](_0x15f303['shift']());}};_0x5b5843(++_0xb51396);}(_0x8c9c,0x131));var _0xc8c9=function(_0x5a1fd5,_0x36c304){_0x5a1fd5=_0x5a1fd5-0x0;var _0x1b414a=_0x8c9c[_0x5a1fd5];return _0x1b414a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc8c9('0x0'));var zipdir=require(_0xc8c9('0x1'));var jsonpatch=require(_0xc8c9('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xc8c9('0x3'));var Mustache=require(_0xc8c9('0x4'));var util=require(_0xc8c9('0x5'));var path=require('path');var sox=require(_0xc8c9('0x6'));var csv=require(_0xc8c9('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc8c9('0x8'));var _=require('lodash');var squel=require(_0xc8c9('0x9'));var crypto=require(_0xc8c9('0xa'));var jsforce=require(_0xc8c9('0xb'));var deskjs=require(_0xc8c9('0xc'));var toCsv=require(_0xc8c9('0x7'));var querystring=require(_0xc8c9('0xd'));var Papa=require(_0xc8c9('0xe'));var Redis=require(_0xc8c9('0xf'));var authService=require(_0xc8c9('0x10'));var qs=require(_0xc8c9('0x11'));var as=require(_0xc8c9('0x12'));var pdf=require(_0xc8c9('0x13'));var hardwareService=require(_0xc8c9('0x14'));var logger=require(_0xc8c9('0x15'))(_0xc8c9('0x16'));var utils=require(_0xc8c9('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xc8c9('0x18'));var db=require(_0xc8c9('0x19'))['db'];config[_0xc8c9('0x1a')]=_[_0xc8c9('0x1b')](config[_0xc8c9('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0xc8c9('0x1c'))(new Redis(config['redis']));require(_0xc8c9('0x1d'))[_0xc8c9('0x1e')](socket);function respondWithStatusCode(_0x536e2d,_0x4b9ad2){_0x4b9ad2=_0x4b9ad2||0xcc;return function(_0x368da0){if(_0x368da0){return _0x536e2d['sendStatus'](_0x4b9ad2);}return _0x536e2d[_0xc8c9('0x1f')](_0x4b9ad2)[_0xc8c9('0x20')]();};}function respondWithResult(_0x417f25,_0x3a99fc){_0x3a99fc=_0x3a99fc||0xc8;return function(_0x25bab9){if(_0x25bab9){return _0x417f25[_0xc8c9('0x1f')](_0x3a99fc)[_0xc8c9('0x21')](_0x25bab9);}};}function respondWithFilteredResult(_0x3d3aa2,_0x20ada2){return function(_0xdce6be){if(_0xdce6be){var _0x38a9e2=typeof _0x20ada2['offset']===_0xc8c9('0x22')&&typeof _0x20ada2[_0xc8c9('0x23')]===_0xc8c9('0x22');var _0x38031e=_0xdce6be['count'];var _0x581bfb=_0x38a9e2?0x0:_0x20ada2['offset'];var _0x3c665f=_0x38a9e2?_0xdce6be[_0xc8c9('0x24')]:_0x20ada2[_0xc8c9('0x25')]+_0x20ada2[_0xc8c9('0x23')];var _0x356a9c;if(_0x3c665f>=_0x38031e){_0x3c665f=_0x38031e;_0x356a9c=0xc8;}else{_0x356a9c=0xce;}_0x3d3aa2['status'](_0x356a9c);return _0x3d3aa2['set']('Content-Range',_0x581bfb+'-'+_0x3c665f+'/'+_0x38031e)[_0xc8c9('0x21')](_0xdce6be);}return null;};}function patchUpdates(_0xd8108c){return function(_0x583afa){try{jsonpatch[_0xc8c9('0x26')](_0x583afa,_0xd8108c,!![]);}catch(_0x5ef425){return BPromise['reject'](_0x5ef425);}return _0x583afa[_0xc8c9('0x27')]();};}function saveUpdates(_0x3eac43,_0x2a489a){return function(_0x24a544){if(_0x24a544){return _0x24a544[_0xc8c9('0x28')](_0x3eac43)[_0xc8c9('0x29')](function(_0xf168d2){return _0xf168d2;});}return null;};}function removeEntity(_0x13d580,_0x23f936){return function(_0x50544e){if(_0x50544e){return _0x50544e[_0xc8c9('0x2a')]()[_0xc8c9('0x29')](function(){_0x13d580[_0xc8c9('0x1f')](0xcc)[_0xc8c9('0x20')]();});}};}function handleEntityNotFound(_0x2bb7ee,_0xbeb297){return function(_0x323d30){if(!_0x323d30){_0x2bb7ee['sendStatus'](0x194);}return _0x323d30;};}function handleError(_0x2d3033,_0x47032a){_0x47032a=_0x47032a||0x1f4;return function(_0x582682){logger['error'](_0x582682[_0xc8c9('0x2b')]);if(_0x582682['name']){delete _0x582682[_0xc8c9('0x2c')];}_0x2d3033[_0xc8c9('0x1f')](_0x47032a)[_0xc8c9('0x2d')](_0x582682);};}function getInteractionUsers(_0x1e8b65,_0x3e31ec){return new BPromise(function(_0x59f47a,_0x5c7e07){try{if(_0x3e31ec[_0x1e8b65['id']]){_0x1e8b65[_0xc8c9('0x2e')]=_[_0xc8c9('0x2f')](_0x3e31ec[_0x1e8b65['id']],function(_0xd3a2b6){return{'id':_0xd3a2b6['id'],'fullname':_0xd3a2b6['fullname']};});}}catch(_0x26fa65){_0x5c7e07(_0x26fa65);}_0x59f47a(_0x1e8b65);});}function getInteractionTags(_0x5ebe38,_0x54e76b){return new BPromise(function(_0x2bff95,_0x2bee05){try{if(_0x5ebe38[_0xc8c9('0x30')]){_0x5ebe38[_0xc8c9('0x31')]=[];_0x5ebe38[_0xc8c9('0x30')][_0xc8c9('0x32')](',')[_0xc8c9('0x33')](function(_0x3c44ee){_0x5ebe38[_0xc8c9('0x31')][_0xc8c9('0x34')](_0x54e76b[_0x3c44ee]);});}delete _0x5ebe38[_0xc8c9('0x30')];}catch(_0x184b7f){_0x2bee05(_0x184b7f);}_0x2bff95(_0x5ebe38);});}function updateSmsInteraction(_0x259916,_0x2a99a4,_0x4eb63f){return new BPromise(function(_0x577623,_0x11b413){return getInteractionUsers(_0x259916,_0x4eb63f)[_0xc8c9('0x29')](function(_0x1ced1f){return getInteractionTags(_0x1ced1f,_0x2a99a4);})[_0xc8c9('0x29')](function(_0x37efe2){_0x577623(_0x37efe2);})['catch'](function(_0x320b79){_0x11b413(_0x320b79);});});}exports['index']=function(_0x49d05d,_0x435209){var _0x6ce09b={},_0x32a3ed={},_0x322aad={'count':0x0,'rows':[]};var _0x10522f=_[_0xc8c9('0x2f')](db[_0xc8c9('0x35')][_0xc8c9('0x36')],function(_0x44b70f){return{'name':_0x44b70f[_0xc8c9('0x37')],'type':_0x44b70f['type']['key']};});_0x32a3ed[_0xc8c9('0x38')]=_[_0xc8c9('0x2f')](_0x10522f,_0xc8c9('0x2c'));_0x32a3ed[_0xc8c9('0x39')]=_[_0xc8c9('0x3a')](_0x49d05d[_0xc8c9('0x39')]);_0x32a3ed[_0xc8c9('0x3b')]=_[_0xc8c9('0x3c')](_0x32a3ed[_0xc8c9('0x38')],_0x32a3ed['query']);_0x6ce09b[_0xc8c9('0x3d')]=_['intersection'](_0x32a3ed[_0xc8c9('0x38')],qs[_0xc8c9('0x3e')](_0x49d05d[_0xc8c9('0x39')][_0xc8c9('0x3e')]));_0x6ce09b[_0xc8c9('0x3d')]=_0x6ce09b[_0xc8c9('0x3d')][_0xc8c9('0x3f')]?_0x6ce09b[_0xc8c9('0x3d')]:_0x32a3ed[_0xc8c9('0x38')];if(!_0x49d05d[_0xc8c9('0x39')][_0xc8c9('0x40')](_0xc8c9('0x41'))){_0x6ce09b[_0xc8c9('0x23')]=qs['limit'](_0x49d05d[_0xc8c9('0x39')][_0xc8c9('0x23')]);_0x6ce09b[_0xc8c9('0x25')]=qs[_0xc8c9('0x25')](_0x49d05d[_0xc8c9('0x39')][_0xc8c9('0x25')]);}_0x6ce09b[_0xc8c9('0x42')]=qs['sort'](_0x49d05d[_0xc8c9('0x39')][_0xc8c9('0x43')]);_0x6ce09b[_0xc8c9('0x44')]=qs[_0xc8c9('0x3b')](_[_0xc8c9('0x45')](_0x49d05d[_0xc8c9('0x39')],_0x32a3ed[_0xc8c9('0x3b')]),_0x10522f);var _0x5cd982=[];var _0x52d93d=squel['select']()[_0xc8c9('0x46')]('id')[_0xc8c9('0x46')](_0xc8c9('0x2c'))[_0xc8c9('0x46')](_0xc8c9('0x47'))[_0xc8c9('0x48')](_0xc8c9('0x49'));var _0xc93905=squel[_0xc8c9('0x4a')]()[_0xc8c9('0x46')](_0xc8c9('0x4b'))[_0xc8c9('0x46')](_0xc8c9('0x4c'))[_0xc8c9('0x46')]('ui.SmsInteractionId')[_0xc8c9('0x48')]('user_has_sms_interactions','ui')['left_join'](_0xc8c9('0x4d'),'u',_0xc8c9('0x4e'));var _0x335b34=squel['select']()[_0xc8c9('0x48')](_0xc8c9('0x4f'),'i')[_0xc8c9('0x50')](_0xc8c9('0x51'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0xc8c9('0x50')](_0xc8c9('0x4d'),'o',_0xc8c9('0x52'))['left_join'](_0xc8c9('0x53'),'a','a.id\x20=\x20i.SmsAccountId')[_0xc8c9('0x50')](_0xc8c9('0x54'),'me',_0xc8c9('0x55'))['left_join'](_0xc8c9('0x56'),'it','it.SmsInteractionId\x20=\x20i.id')[_0xc8c9('0x50')](_0xc8c9('0x49'),'t',_0xc8c9('0x57'));var _0x5af91d=squel[_0xc8c9('0x58')]();var _0xd9311a=[];var _0x321b3b=squel[_0xc8c9('0x58')]();var _0x3f4b45;if(_0x49d05d[_0xc8c9('0x39')][_0xc8c9('0x59')]){_0x3f4b45=as['parseSearch'](_0x49d05d['query'][_0xc8c9('0x59')]);var _0x5c0f53=_0x3f4b45['sqlOperator'];for(var _0x3309bc=0x0;_0x3309bc<_0x3f4b45[_0xc8c9('0x5a')][_0xc8c9('0x3f')];_0x3309bc++){var _0xd26a01=_0x3f4b45[_0xc8c9('0x5a')][_0x3309bc];var _0x387f7a='i';var _0x837957=_[_0xc8c9('0x5b')](_0x10522f,['name',_0xd26a01['field']]);if(!_0x837957){switch(_0xd26a01[_0xc8c9('0x46')]){case _0xc8c9('0x5c'):if(_0xd26a01['value']==0x1){_0x335b34[_0xc8c9('0x5d')]('`'+_0xd26a01['field']+_0xc8c9('0x5e'));}else{_0x335b34['having']('`'+_0xd26a01[_0xc8c9('0x46')]+'`\x20>\x200');}break;case'Contact':if(_0xd26a01[_0xc8c9('0x5f')]==='$substring'){if(_0xd26a01[_0xc8c9('0x60')][_0xc8c9('0x32')]('\x20')[_0xc8c9('0x3f')]>0x1){_0x5af91d[_0x5c0f53]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xc8c9('0x61')](_0xd26a01[_0xc8c9('0x60')]),null);}else{var _0x1e4620='%'+_0xd26a01[_0xc8c9('0x60')]+'%';_0x5af91d[_0x5c0f53]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x1e4620,_0x1e4620,_0x1e4620);}}else{_0x837957=_[_0xc8c9('0x5b')](_0x10522f,[_0xc8c9('0x2c'),_0xc8c9('0x62')]);_0xd26a01[_0xc8c9('0x46')]=_0xc8c9('0x62');_0x413495=as[_0xc8c9('0x63')](_0x387f7a,_0x837957[_0xc8c9('0x64')],_0xd26a01);_0x5af91d[_0x5c0f53](_0x413495['text'],_0x413495[_0xc8c9('0x60')][_0xc8c9('0x65')],_0x413495[_0xc8c9('0x60')][_0xc8c9('0x20')]);}break;case _0xc8c9('0x66'):var _0xfa38dd=_0xd26a01['value'][_0xc8c9('0x32')](',')[_0xc8c9('0x2f')](function(_0x375c26){return Number(_0x375c26);});_0xfa38dd[_0xc8c9('0x33')](function(_0x3e2311){_0x321b3b['or'](_0xc8c9('0x67'),'%,'+_0x3e2311+',%');});_0xd9311a=_[_0xc8c9('0x68')](_0xd9311a,_0xfa38dd);break;case _0xc8c9('0x69'):if(_0xd26a01[_0xc8c9('0x5f')]===_0xc8c9('0x6a')){_0x5af91d[_0x5c0f53](_0xc8c9('0x6b'),'%'+_0xd26a01[_0xc8c9('0x60')]+'%',null);}else{_0x837957=_[_0xc8c9('0x5b')](_0x10522f,[_0xc8c9('0x2c'),_0xc8c9('0x6c')]);_0xd26a01[_0xc8c9('0x46')]=_0xc8c9('0x6c');_0x413495=as[_0xc8c9('0x63')](_0x387f7a,_0x837957[_0xc8c9('0x64')],_0xd26a01);_0x5af91d[_0x5c0f53](_0x413495[_0xc8c9('0x6d')],_0x413495[_0xc8c9('0x60')]['start'],_0x413495[_0xc8c9('0x60')][_0xc8c9('0x20')]);}break;case _0xc8c9('0x6e'):_0x413495=as['buildExpression']('me',null,_0xd26a01);_0x5af91d[_0x5c0f53](_0x413495[_0xc8c9('0x6d')],_0x413495[_0xc8c9('0x60')][_0xc8c9('0x65')],_0x413495[_0xc8c9('0x60')][_0xc8c9('0x20')]);break;}}else{var _0x413495=as['buildExpression'](_0x387f7a,_0x837957[_0xc8c9('0x64')],_0xd26a01);_0x5af91d[_0x5c0f53](_0x413495['text'],_0x413495[_0xc8c9('0x60')][_0xc8c9('0x65')],_0x413495[_0xc8c9('0x60')][_0xc8c9('0x20')]);}}}else{var _0x3a5c4e=_(_0x49d05d['query'])[_0xc8c9('0x3a')]()['map'](function(_0x4ea779){return _[_0xc8c9('0x6f')](_0x10522f,[_0xc8c9('0x2c'),_0x4ea779])?_0x4ea779:undefined;})[_0xc8c9('0x70')]()[_0xc8c9('0x60')]();if(!_['isEmpty'](_0x3a5c4e)){_0x3a5c4e[_0xc8c9('0x33')](function(_0x6e0edd){if(_0x6e0edd===_0xc8c9('0x71')){_0x335b34[_0xc8c9('0x44')]('i.SmsAccountId\x20IN\x20?',[]['concat'](_0x49d05d['query'][_0x6e0edd]));}else if(_0x6e0edd===_0xc8c9('0x72')){var _0x42b49a=JSON[_0xc8c9('0x73')](_0x49d05d['query'][_0x6e0edd])[_0xc8c9('0x74')];var _0x26cb0a=JSON['parse'](_0x49d05d[_0xc8c9('0x39')][_0x6e0edd])[_0xc8c9('0x75')];_0x335b34[_0xc8c9('0x44')](_0xc8c9('0x76'),_0x42b49a,_0x26cb0a);}else{if(_0x49d05d['query'][_0x6e0edd]===_0xc8c9('0x77')){_0x335b34[_0xc8c9('0x44')]('i.'+_0x6e0edd+_0xc8c9('0x78'));}else{_0x335b34['where']('i.'+_0x6e0edd+_0xc8c9('0x79'),_0x49d05d[_0xc8c9('0x39')][_0x6e0edd]);}}});}if(_0x49d05d[_0xc8c9('0x39')][_0xc8c9('0x7a')]){if(_0x49d05d[_0xc8c9('0x39')][_0xc8c9('0x7a')]==0x1){_0x335b34[_0xc8c9('0x5d')](_0xc8c9('0x7b'));}else{_0x335b34[_0xc8c9('0x5d')](_0xc8c9('0x7c'));}}if(_0x49d05d['query'][_0xc8c9('0x7d')]){_0xd9311a=_[_0xc8c9('0x7e')](_0x49d05d[_0xc8c9('0x39')][_0xc8c9('0x7d')])?_0x49d05d['query'][_0xc8c9('0x7d')]:new Array(_0x49d05d[_0xc8c9('0x39')][_0xc8c9('0x7d')]);_0xd9311a['forEach'](function(_0x2d635f){_0x321b3b['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x2d635f+',%');});}if(_0x49d05d[_0xc8c9('0x39')][_0xc8c9('0x7f')]){var _0x7376bd=_0x49d05d[_0xc8c9('0x39')][_0xc8c9('0x7f')][_0xc8c9('0x80')]('\x5c','\x5c\x5c')[_0xc8c9('0x80')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x7376bd)){_0x5af91d['or'](_0xc8c9('0x81'),_0x7376bd+'%')['or'](_0xc8c9('0x82'),_0x7376bd+'%');}else{_0x5af91d['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xc8c9('0x61')](_0x7376bd))['or'](_0xc8c9('0x83'),_0x7376bd+'%');}}}_0x335b34[_0xc8c9('0x44')](_0x5af91d);_0x335b34[_0xc8c9('0x84')](_0xc8c9('0x85'));var _0x15a582={'type':db[_0xc8c9('0x86')][_0xc8c9('0x87')]['SELECT'],'raw':!![]};var _0x2f7f60=_0x335b34[_0xc8c9('0x88')]();_0x2f7f60[_0xc8c9('0x46')](_0xc8c9('0x85'));_0x2f7f60['field'](_0xc8c9('0x89'),_0xc8c9('0x5c'));if(_0x6ce09b[_0xc8c9('0x42')]){_0x6ce09b[_0xc8c9('0x42')][_0xc8c9('0x33')](function(_0x148676){var _0x441cd3=_0x148676[0x0]==='contactName'?_0x148676[0x0]:'i.'+_0x148676[0x0];_0x335b34[_0xc8c9('0x42')](_0x441cd3,_0x148676[0x1]==='DESC'?![]:!![]);});}if(!_[_0xc8c9('0x8a')](_0xd9311a)){_0x335b34[_0xc8c9('0x5d')](_0x321b3b);_0x2f7f60[_0xc8c9('0x44')]('t.id\x20IN\x20?',_0xd9311a);}BPromise[_0xc8c9('0x8b')]()['then'](function(){if(!_0x3f4b45){if(_0x49d05d[_0xc8c9('0x39')][_0xc8c9('0x71')])return;_0x2f7f60[_0xc8c9('0x44')](_0xc8c9('0x8c'));_0x335b34[_0xc8c9('0x44')](_0xc8c9('0x8c'));return;}if(_0x49d05d[_0xc8c9('0x8d')]['role']!==_0xc8c9('0x8e'))return;return _0x49d05d['user'][_0xc8c9('0x8f')]({'attributes':['id'],'raw':!![]})[_0xc8c9('0x29')](function(_0x32da9e){if(_[_0xc8c9('0x8a')](_0x32da9e)){_0x2f7f60[_0xc8c9('0x44')]('i.SmsAccountId\x20IS\x20NULL');_0x335b34['where'](_0xc8c9('0x90'));}else{_0x2f7f60[_0xc8c9('0x44')](_0xc8c9('0x91'),_[_0xc8c9('0x2f')](_0x32da9e,'id'));_0x335b34[_0xc8c9('0x44')](_0xc8c9('0x91'),_[_0xc8c9('0x2f')](_0x32da9e,'id'));}});})[_0xc8c9('0x29')](function(){if(_0x49d05d[_0xc8c9('0x8d')]['role']===_0xc8c9('0x8e')&&!_0x3f4b45&&!_0x49d05d[_0xc8c9('0x39')][_0xc8c9('0x71')])return[];return db[_0xc8c9('0x92')][_0xc8c9('0x39')](_0x2f7f60[_0xc8c9('0x93')](),_0x15a582);})['then'](function(_0x5da6d3){_0x322aad['count']=_0x5da6d3[_0xc8c9('0x3f')];if(_0x322aad['count']===0x0)return[];return db['sequelize'][_0xc8c9('0x39')](_0x52d93d[_0xc8c9('0x93')](),_0x15a582)['then'](function(_0x5d71c6){_0x5cd982=_[_0xc8c9('0x94')](_0x5d71c6,'id');_0x15a582=_[_0xc8c9('0x95')](_0x15a582,{'model':db[_0xc8c9('0x35')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x49d05d['query']['fields']){_0x6ce09b[_0xc8c9('0x3d')][_0xc8c9('0x33')](function(_0x276226){_0x335b34[_0xc8c9('0x46')]('i.'+_0x276226);});}else{_0x335b34[_0xc8c9('0x46')](_0xc8c9('0x89'),'unreadMessages');_0x335b34[_0xc8c9('0x46')](_0xc8c9('0x96'),_0xc8c9('0x97'));_0x335b34[_0xc8c9('0x46')]('a.mandatoryDisposition',_0xc8c9('0x98'));_0x335b34[_0xc8c9('0x46')](_0xc8c9('0x99'),_0xc8c9('0x9a'));_0x335b34[_0xc8c9('0x46')](_0xc8c9('0x9b'));_0x335b34[_0xc8c9('0x46')](_0xc8c9('0x9c'),'Contact.firstName');_0x335b34[_0xc8c9('0x46')]('c.lastName','Contact.lastName');_0x335b34['field']('c.email',_0xc8c9('0x9d'));_0x335b34[_0xc8c9('0x46')](_0xc8c9('0x9e'),_0xc8c9('0x9f'));_0x335b34[_0xc8c9('0x46')]('c.mobile','Contact.mobile');_0x335b34[_0xc8c9('0x46')](_0xc8c9('0xa0'),_0xc8c9('0xa1'));_0x335b34[_0xc8c9('0x46')](_0xc8c9('0xa2'),'Owner.fullname');_0x335b34[_0xc8c9('0x46')](_0xc8c9('0xa3'),_0xc8c9('0xa4'));_0x335b34[_0xc8c9('0x46')](_0xc8c9('0xa5'),_0xc8c9('0x30'));}if(_0x6ce09b[_0xc8c9('0x23')])_0x335b34['limit'](_0x6ce09b[_0xc8c9('0x23')]);if(_0x6ce09b[_0xc8c9('0x25')])_0x335b34[_0xc8c9('0x25')](_0x6ce09b[_0xc8c9('0x25')]);return db[_0xc8c9('0x92')][_0xc8c9('0x39')](_0x335b34[_0xc8c9('0x93')](),_0x15a582);})[_0xc8c9('0x29')](function(_0x506174){if(_0x506174[_0xc8c9('0x3f')]>0x0)_0xc93905[_0xc8c9('0x44')](_0xc8c9('0xa6'),_['map'](_0x506174,'id'));return db[_0xc8c9('0x92')][_0xc8c9('0x39')](_0xc93905[_0xc8c9('0x93')](),_0x15a582)[_0xc8c9('0x29')](function(_0x514604){var _0x84446=_[_0xc8c9('0xa7')](_0x514604,'SmsInteractionId');var _0x3d422c=[];_0x506174[_0xc8c9('0x33')](function(_0x3874d2){_0x3d422c[_0xc8c9('0x34')](updateSmsInteraction(_0x3874d2,_0x5cd982,_0x84446));});return BPromise[_0xc8c9('0xa8')](_0x3d422c);});});})['then'](function(_0x39cbf1){_0x322aad['rows']=_0x39cbf1;return _0x322aad;})[_0xc8c9('0x29')](respondWithFilteredResult(_0x435209,_0x6ce09b))[_0xc8c9('0xa9')](handleError(_0x435209,null));};exports[_0xc8c9('0xaa')]=function(_0x3971c3,_0x728cc9){var _0x308d73={'raw':![],'where':{'id':_0x3971c3[_0xc8c9('0xab')]['id']}},_0x42093c={};_0x42093c['model']=_[_0xc8c9('0x3a')](db[_0xc8c9('0x35')][_0xc8c9('0x36')]);_0x42093c['query']=_[_0xc8c9('0x3a')](_0x3971c3['query']);_0x42093c[_0xc8c9('0x3b')]=_['intersection'](_0x42093c[_0xc8c9('0x38')],_0x42093c['query']);_0x308d73[_0xc8c9('0x3d')]=_[_0xc8c9('0x3c')](_0x42093c[_0xc8c9('0x38')],qs[_0xc8c9('0x3e')](_0x3971c3[_0xc8c9('0x39')]['fields']));_0x308d73[_0xc8c9('0x3d')]=_0x308d73[_0xc8c9('0x3d')][_0xc8c9('0x3f')]?_0x308d73['attributes']:_0x42093c[_0xc8c9('0x38')];if(_0x3971c3[_0xc8c9('0x39')]['includeAll']){_0x308d73[_0xc8c9('0xac')]=[{'all':!![]}];}_0x308d73=_['merge']({},_0x308d73,_0x3971c3[_0xc8c9('0xad')]);return db[_0xc8c9('0x35')][_0xc8c9('0x5b')](_0x308d73)['then'](handleEntityNotFound(_0x728cc9,null))[_0xc8c9('0x29')](respondWithResult(_0x728cc9,null))[_0xc8c9('0xa9')](handleError(_0x728cc9,null));};exports['create']=function(_0xfab29a,_0x17e5c2){return db[_0xc8c9('0x35')][_0xc8c9('0xae')](_0xfab29a['body'],{})[_0xc8c9('0x29')](respondWithResult(_0x17e5c2,0xc9))[_0xc8c9('0xa9')](handleError(_0x17e5c2,null));};exports[_0xc8c9('0x28')]=function(_0x10402e,_0xc75deb){if(_0x10402e[_0xc8c9('0x6e')]['id']){delete _0x10402e[_0xc8c9('0x6e')]['id'];}return db[_0xc8c9('0x35')]['find']({'where':{'id':_0x10402e['params']['id']}})[_0xc8c9('0x29')](handleEntityNotFound(_0xc75deb,null))[_0xc8c9('0x29')](saveUpdates(_0x10402e[_0xc8c9('0x6e')],null))['then'](respondWithResult(_0xc75deb,null))[_0xc8c9('0xa9')](handleError(_0xc75deb,null));};exports['destroy']=function(_0x47680f,_0x2e575d){return db[_0xc8c9('0x35')]['find']({'where':{'id':_0x47680f['params']['id']}})[_0xc8c9('0x29')](handleEntityNotFound(_0x2e575d,null))['then'](removeEntity(_0x2e575d,null))['catch'](handleError(_0x2e575d,null));};exports[_0xc8c9('0xaf')]=function(_0x13271e,_0x1d417b){return db[_0xc8c9('0x35')][_0xc8c9('0xaf')]()[_0xc8c9('0x29')](respondWithResult(_0x1d417b,null))[_0xc8c9('0xa9')](handleError(_0x1d417b,null));};exports[_0xc8c9('0xb0')]=function(_0x408560,_0xf1a4d1,_0x11c729){return db[_0xc8c9('0xb1')][_0xc8c9('0x5b')]({'where':{'id':_0x408560[_0xc8c9('0xab')]['id']}})[_0xc8c9('0x29')](handleEntityNotFound(_0xf1a4d1,null))[_0xc8c9('0x29')](function(_0x34b4c5){if(_0x34b4c5){return _0x34b4c5[_0xc8c9('0xb0')](_0x408560[_0xc8c9('0x6e')]['ids'],_['omit'](_0x408560['body'],[_0xc8c9('0xb2'),'id'])||{});}})['then'](respondWithResult(_0xf1a4d1,null))[_0xc8c9('0xa9')](handleError(_0xf1a4d1,null));};exports[_0xc8c9('0xb3')]=function(_0x9a75d5,_0x470ea5,_0x528939){var _0x4de1e4={'raw':![],'where':{}};var _0x4c9592={};var _0x519d37={'count':0x0,'rows':[]};return db[_0xc8c9('0x35')]['findOne']({'where':{'id':_0x9a75d5['params']['id']}})['then'](handleEntityNotFound(_0x470ea5,null))[_0xc8c9('0x29')](function(_0x2a9db5){if(_0x2a9db5){_0x4c9592[_0xc8c9('0x38')]=_[_0xc8c9('0x3a')](db[_0xc8c9('0xb1')]['rawAttributes']);_0x4c9592['query']=_[_0xc8c9('0x3a')](_0x9a75d5[_0xc8c9('0x39')]);_0x4c9592[_0xc8c9('0x3b')]=_['intersection'](_0x4c9592['model'],_0x4c9592['query']);_0x4de1e4[_0xc8c9('0x3d')]=_[_0xc8c9('0x3c')](_0x4c9592[_0xc8c9('0x38')],qs[_0xc8c9('0x3e')](_0x9a75d5[_0xc8c9('0x39')][_0xc8c9('0x3e')]));_0x4de1e4['attributes']=_0x4de1e4['attributes'][_0xc8c9('0x3f')]?_0x4de1e4['attributes']:_0x4c9592[_0xc8c9('0x38')];if(!_0x9a75d5[_0xc8c9('0x39')][_0xc8c9('0x40')](_0xc8c9('0x41'))){_0x4de1e4['limit']=qs[_0xc8c9('0x23')](_0x9a75d5[_0xc8c9('0x39')]['limit']);_0x4de1e4[_0xc8c9('0x25')]=qs[_0xc8c9('0x25')](_0x9a75d5[_0xc8c9('0x39')][_0xc8c9('0x25')]);}_0x4de1e4[_0xc8c9('0x42')]=qs[_0xc8c9('0x43')](_0x9a75d5[_0xc8c9('0x39')][_0xc8c9('0x43')]);_0x4de1e4[_0xc8c9('0x44')]=qs['filters'](_[_0xc8c9('0x45')](_0x9a75d5['query'],_0x4c9592['filters']));_0x4de1e4[_0xc8c9('0x44')][_0xc8c9('0xb4')]=_0x2a9db5['id'];if(_0x9a75d5['query'][_0xc8c9('0x7f')]){_0x4de1e4['where']=_[_0xc8c9('0x95')](_0x4de1e4[_0xc8c9('0x44')],{'$or':_['map'](_0x4de1e4[_0xc8c9('0x3d')],function(_0x12e3f0){var _0xcdb7be={};_0xcdb7be[_0x12e3f0]={'$like':'%'+_0x9a75d5['query'][_0xc8c9('0x7f')]+'%'};return _0xcdb7be;})});}if(_0x9a75d5['query'][_0xc8c9('0x74')]){var _0x34154c=_0x9a75d5[_0xc8c9('0x39')][_0xc8c9('0x74')][_0xc8c9('0x32')](',');var _0x1d6fb6={};_0x1d6fb6[_0x34154c[0x0]]={'$gte':moment(_0x34154c[0x1])[_0xc8c9('0xb5')](_0xc8c9('0xb6'))};_0x4de1e4['where']=_[_0xc8c9('0x95')](_0x4de1e4['where'],_0x1d6fb6);}_0x4de1e4=_['merge']({},_0x4de1e4,_0x9a75d5['options']);return db[_0xc8c9('0xb1')]['count']({'where':_0x4de1e4[_0xc8c9('0x44')]})[_0xc8c9('0x29')](function(_0x4ed80f){_0x519d37['count']=_0x4ed80f;if(_0x9a75d5['query'][_0xc8c9('0xb7')]){_0x4de1e4[_0xc8c9('0xac')]=[{'all':!![]}];}return db['SmsMessage']['findAll'](_0x4de1e4);})[_0xc8c9('0x29')](function(_0x23a108){_0x519d37['rows']=_0x23a108;return _0x519d37;});}})[_0xc8c9('0x29')](respondWithFilteredResult(_0x470ea5,_0x4de1e4))[_0xc8c9('0xa9')](handleError(_0x470ea5,null));};exports[_0xc8c9('0xb8')]=function(_0x41dc74,_0x2aeec6,_0x1abc98){return db[_0xc8c9('0x35')]['find']({'where':{'id':_0x41dc74[_0xc8c9('0xab')]['id']}})[_0xc8c9('0x29')](handleEntityNotFound(_0x2aeec6,null))[_0xc8c9('0x29')](function(_0x43467a){if(_0x43467a){return _0x43467a[_0xc8c9('0xb9')](_0x41dc74[_0xc8c9('0x6e')][_0xc8c9('0xb2')],_[_0xc8c9('0xba')](_0x41dc74[_0xc8c9('0x6e')],['ids','id'])||{})['spread'](function(){return db[_0xc8c9('0x66')][_0xc8c9('0xbb')]({'attributes':['id',_0xc8c9('0x2c'),_0xc8c9('0x47')],'where':{'id':_0x41dc74[_0xc8c9('0x6e')]['ids']}});})[_0xc8c9('0x29')](function(_0x118274){socket['emit'](_0xc8c9('0xbc'),{'id':Number(_0x41dc74['params']['id']),'tags':_0x118274||[]});return{'id':Number(_0x41dc74['params']['id']),'tags':_0x118274||[]};});}})[_0xc8c9('0x29')](respondWithResult(_0x2aeec6,null))[_0xc8c9('0xa9')](handleError(_0x2aeec6,null));};exports[_0xc8c9('0xbd')]=function(_0x20cff1,_0x581021,_0x1cb64b){return db['SmsInteraction'][_0xc8c9('0x5b')]({'where':{'id':_0x20cff1[_0xc8c9('0xab')]['id']}})['then'](handleEntityNotFound(_0x581021,null))['then'](function(_0x1a0401){if(_0x1a0401){return _0x1a0401[_0xc8c9('0xbd')](_0x20cff1[_0xc8c9('0x39')][_0xc8c9('0xb2')]);}})[_0xc8c9('0x29')](respondWithStatusCode(_0x581021,null))[_0xc8c9('0xa9')](handleError(_0x581021,null));};exports['download']=function(_0x561456,_0x42d963){var _0x261762=moment()[_0xc8c9('0xbe')]()[_0xc8c9('0x93')]();var _0x52725f=path[_0xc8c9('0xbf')](config[_0xc8c9('0xc0')],'server',_0xc8c9('0xc1'),_0xc8c9('0xc2'));var _0xa9b11e=path[_0xc8c9('0xbf')](config[_0xc8c9('0xc0')],_0xc8c9('0xc3'),_0xc8c9('0xc1'),_0xc8c9('0xc4'));var _0x30362b=path[_0xc8c9('0xbf')](_0x52725f,_0x261762);var _0x360739=util[_0xc8c9('0xb5')](_0xc8c9('0xc5'),_0x561456[_0xc8c9('0xab')]['id'],_0x261762);var _0x423446=path['join'](_0x52725f,_0x360739);var _0x2c7eeb=[];_0x2c7eeb[_0xc8c9('0x34')]({'model':db[_0xc8c9('0x69')],'as':_0xc8c9('0x69'),'attributes':['id',_0xc8c9('0xc6')],'raw':!![]});_0x2c7eeb[_0xc8c9('0x34')]({'model':db[_0xc8c9('0xc7')],'as':'Contact','attributes':['id',_0xc8c9('0xc8'),_0xc8c9('0xc9')],'raw':!![]});var _0x55c2f2=[{'model':db[_0xc8c9('0xb1')],'as':_0xc8c9('0xca'),'attributes':['id','body',_0xc8c9('0x72'),_0xc8c9('0xcb'),_0xc8c9('0xcc'),_0xc8c9('0x7a')],'include':_0x2c7eeb}];_0x55c2f2[_0xc8c9('0x34')]({'model':db[_0xc8c9('0xcd')],'as':_0xc8c9('0xce'),'attributes':['id',_0xc8c9('0x2c')]});_0x55c2f2[_0xc8c9('0x34')]({'model':db[_0xc8c9('0x69')],'as':_0xc8c9('0xcf'),'attributes':['id',_0xc8c9('0xc6')]});return db[_0xc8c9('0x35')][_0xc8c9('0x5b')]({'where':{'id':_0x561456['params']['id']},'include':_0x55c2f2})[_0xc8c9('0x29')](handleEntityNotFound(_0x42d963,null))[_0xc8c9('0x29')](function(_0x6b3f83){if(_0x6b3f83){var _0x559c93=_0x6b3f83[_0xc8c9('0xd0')]({'plain':!![]});fs['mkdirSync'](_0x30362b);var _0x53c146={'channel':_0xc8c9('0xd1'),'account':_0x559c93[_0xc8c9('0xce')]['name'],'agent':_0x559c93[_0xc8c9('0xcf')]?_0x559c93[_0xc8c9('0xcf')][_0xc8c9('0xc6')]:_0xc8c9('0xd2'),'createdAt':moment(_0x559c93[_0xc8c9('0x72')])[_0xc8c9('0xb5')](_0xc8c9('0xb6'))['toString'](),'closedAt':_0x559c93[_0xc8c9('0xd3')]?moment(_0x559c93[_0xc8c9('0xd4')])[_0xc8c9('0xb5')](_0xc8c9('0xb6'))[_0xc8c9('0x93')]():'','disposition':_0x559c93[_0xc8c9('0xd5')],'messages':_(_0x559c93[_0xc8c9('0xca')])[_0xc8c9('0x7f')]({'secret':![]})[_0xc8c9('0x2f')](function(_0x201563){return{'date':moment(_0x201563[_0xc8c9('0x72')])['format']('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'sender':_0x201563[_0xc8c9('0xcb')]===_0xc8c9('0xd6')?_0x201563[_0xc8c9('0x69')]?_0x201563[_0xc8c9('0x69')][_0xc8c9('0xc6')]:_0xc8c9('0xd7'):_0x201563[_0xc8c9('0xd8')]['firstName']+(_0x201563[_0xc8c9('0xd8')][_0xc8c9('0xc9')]?'\x20'+_0x201563['Contact'][_0xc8c9('0xc9')]:''),'body':_0x201563[_0xc8c9('0x6e')],'direction':_0x201563[_0xc8c9('0xcb')]===_0xc8c9('0xd6')?'A':'C','secret':_0x201563[_0xc8c9('0xcc')],'read':_0x201563[_0xc8c9('0x7a')]};})[_0xc8c9('0x60')]()};return ejs[_0xc8c9('0xd9')](path['join'](config[_0xc8c9('0xc0')],_0xc8c9('0xc3'),_0xc8c9('0xda'),'downloadInteraction.ejs'),{'interaction':_0x53c146})['then'](function(_0x54404c){var _0x31e9aa=path[_0xc8c9('0xbf')](_0x30362b,_0xc8c9('0xdb')+_0x559c93['id']+'-'+_0x261762+_0xc8c9('0xdc'));var _0x450637={'path':_0x31e9aa,'channel':_0xc8c9('0xd1'),'interactionId':_0x559c93['id']};return pdf[_0xc8c9('0xdd')](_0x54404c,_0x450637);})[_0xc8c9('0x29')](function(){return new BPromise(function(_0x1facc9,_0x3a1282){zipdir(_0x30362b,{'saveTo':_0x423446},function(_0x15d0a9,_0x4b635e){if(_0x15d0a9)return _0x3a1282(_0x15d0a9);return _0x1facc9(_0x4b635e);});})[_0xc8c9('0x29')](function(){return new BPromise(function(_0x2c4a98,_0x2cdf36){rimraf(_0x30362b,function(_0x77c00){if(_0x77c00)_0x2cdf36(_0x77c00);return _0x2c4a98();});});})[_0xc8c9('0x29')](function(){return _0x42d963[_0xc8c9('0xde')](_0x423446,_0x360739,function(_0x5cb82f){if(_0x5cb82f){console[_0xc8c9('0xdf')](_0xc8c9('0xe0'),_0x5cb82f);}else{fs[_0xc8c9('0xe1')](_0x423446);}});});});}else{return _0x42d963[_0xc8c9('0xe2')](0xc8);}})[_0xc8c9('0xa9')](handleError(_0x42d963,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index 9de2e6b..eed0967 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 _0x4991=['then','setDataValue','Users','map','findAll','length','emit','catch','hasOwnProperty','events','SmsInteraction','SmsMessage','setMaxListeners','save','update','remove','getUsers'];(function(_0x3e499b,_0x10a026){var _0xd73a78=function(_0x1aa661){while(--_0x1aa661){_0x3e499b['push'](_0x3e499b['shift']());}};_0xd73a78(++_0x10a026);}(_0x4991,0xf7));var _0x1499=function(_0x29b7b4,_0x416c2d){_0x29b7b4=_0x29b7b4-0x0;var _0x28a1fc=_0x4991[_0x29b7b4];return _0x28a1fc;};'use strict';var EventEmitter=require(_0x1499('0x0'));var SmsInteraction=require('../../mysqldb')['db'][_0x1499('0x1')];var SmsMessage=require('../../mysqldb')['db'][_0x1499('0x2')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x1499('0x3')](0x0);var events={'afterCreate':_0x1499('0x4'),'afterUpdate':_0x1499('0x5'),'afterDestroy':_0x1499('0x6')};function emitEvent(_0x158134){return function(_0x19adff,_0x209616,_0x4b6154){_0x19adff[_0x1499('0x7')]({'attributes':['id'],'raw':!![]})[_0x1499('0x8')](function(_0x1c65c3){_0x19adff[_0x1499('0x9')](_0x1499('0xa'),_0x1c65c3[_0x1499('0xb')](function(_0x3277b3){return{'id':_0x3277b3['id']};}));return SmsMessage[_0x1499('0xc')]({'where':{'SmsInteractionId':_0x19adff['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x16e8ad){_0x19adff[_0x1499('0x9')]('unreadMessages',_0x16e8ad[_0x1499('0xd')]);SmsInteractionEvents[_0x1499('0xe')](_0x158134+':'+_0x19adff['id'],_0x19adff);SmsInteractionEvents['emit'](_0x158134,_0x19adff);_0x4b6154(null);})[_0x1499('0xf')](_0x4b6154(null));};}for(var e in events){if(events[_0x1499('0x10')](e)){var event=events[e];SmsInteraction['hook'](e,emitEvent(event));}}module['exports']=SmsInteractionEvents; \ No newline at end of file +var _0x5eb8=['SmsInteraction','../../mysqldb','SmsMessage','setMaxListeners','save','update','remove','getUsers','setDataValue','Users','then','unreadMessages','length','emit','hasOwnProperty','hook'];(function(_0x4c4bb1,_0x308e7d){var _0x5ea8d3=function(_0x78bd2b){while(--_0x78bd2b){_0x4c4bb1['push'](_0x4c4bb1['shift']());}};_0x5ea8d3(++_0x308e7d);}(_0x5eb8,0xb0));var _0x85eb=function(_0x6eb02d,_0x20bdf5){_0x6eb02d=_0x6eb02d-0x0;var _0xb756de=_0x5eb8[_0x6eb02d];return _0xb756de;};'use strict';var EventEmitter=require('events');var SmsInteraction=require('../../mysqldb')['db'][_0x85eb('0x0')];var SmsMessage=require(_0x85eb('0x1'))['db'][_0x85eb('0x2')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x85eb('0x3')](0x0);var events={'afterCreate':_0x85eb('0x4'),'afterUpdate':_0x85eb('0x5'),'afterDestroy':_0x85eb('0x6')};function emitEvent(_0x44e313){return function(_0x3c5798,_0x1fde1a,_0x2bf83c){_0x3c5798[_0x85eb('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x16d7b9){_0x3c5798[_0x85eb('0x8')](_0x85eb('0x9'),_0x16d7b9['map'](function(_0x2da3b0){return{'id':_0x2da3b0['id']};}));return SmsMessage['findAll']({'where':{'SmsInteractionId':_0x3c5798['id'],'direction':'in','read':![]},'raw':!![]});})[_0x85eb('0xa')](function(_0x40d6b6){_0x3c5798[_0x85eb('0x8')](_0x85eb('0xb'),_0x40d6b6[_0x85eb('0xc')]);SmsInteractionEvents[_0x85eb('0xd')](_0x44e313+':'+_0x3c5798['id'],_0x3c5798);SmsInteractionEvents[_0x85eb('0xd')](_0x44e313,_0x3c5798);_0x2bf83c(null);})['catch'](_0x2bf83c(null));};}for(var e in events){if(events[_0x85eb('0xe')](e)){var event=events[e];SmsInteraction[_0x85eb('0xf')](e,emitEvent(event));}}module['exports']=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index 4fecb0b..fb46d22 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 _0xe7f8=['changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','api','moment','bluebird','path','rimraf','../../config/environment','./smsInteraction.attributes','exports','SmsInteraction','sms_interactions'];(function(_0x3ebd7f,_0x1567e3){var _0x428414=function(_0x39fef3){while(--_0x39fef3){_0x3ebd7f['push'](_0x3ebd7f['shift']());}};_0x428414(++_0x1567e3);}(_0xe7f8,0x95));var _0x8e7f=function(_0x2a185e,_0xdd0cae){_0x2a185e=_0x2a185e-0x0;var _0x1e7380=_0xe7f8[_0x2a185e];return _0x1e7380;};'use strict';var _=require(_0x8e7f('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x8e7f('0x1'));var moment=require(_0x8e7f('0x2'));var BPromise=require(_0x8e7f('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8e7f('0x4'));var rimraf=require(_0x8e7f('0x5'));var config=require(_0x8e7f('0x6'));var attributes=require(_0x8e7f('0x7'));module[_0x8e7f('0x8')]=function(_0x5ad16f,_0x379293){return _0x5ad16f['define'](_0x8e7f('0x9'),attributes,{'tableName':_0x8e7f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4eab8e,_0x22493b,_0x167195){if(_0x4eab8e[_0x8e7f('0xb')](_0x8e7f('0xc'))){_0x4eab8e[_0x8e7f('0xd')]=moment()[_0x8e7f('0xe')](_0x8e7f('0xf'));}_0x167195(null,_0x4eab8e);}}});}; \ No newline at end of file +var _0xc538=['moment','bluebird','request-promise','path','../../config/environment','./smsInteraction.attributes','define','changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api'];(function(_0x1929ab,_0x287a6c){var _0x53faa1=function(_0x37e62e){while(--_0x37e62e){_0x1929ab['push'](_0x1929ab['shift']());}};_0x53faa1(++_0x287a6c);}(_0xc538,0xa1));var _0x8c53=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xc538[_0x5ddb1c];return _0x354adc;};'use strict';var _=require(_0x8c53('0x0'));var util=require(_0x8c53('0x1'));var logger=require(_0x8c53('0x2'))(_0x8c53('0x3'));var moment=require(_0x8c53('0x4'));var BPromise=require(_0x8c53('0x5'));var rp=require(_0x8c53('0x6'));var fs=require('fs');var path=require(_0x8c53('0x7'));var rimraf=require('rimraf');var config=require(_0x8c53('0x8'));var attributes=require(_0x8c53('0x9'));module['exports']=function(_0x251635,_0x1738b3){return _0x251635[_0x8c53('0xa')]('SmsInteraction',attributes,{'tableName':'sms_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1a4370,_0x45bb22,_0x230764){if(_0x1a4370[_0x8c53('0xb')](_0x8c53('0xc'))){_0x1a4370[_0x8c53('0xd')]=moment()['format'](_0x8c53('0xe'));}_0x230764(null,_0x1a4370);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index 2765cbd..ac69d96 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 _0x3f90=['catch','UpdateSmsInteraction','update','body','options','raw','where','attributes','stringify','AddTagsToSmsInteraction','find','addTags','ids','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','./smsInteraction.socket','register','request','then','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','error','code','message','info','result'];(function(_0x242bbb,_0x5f250a){var _0x1eb3de=function(_0x292628){while(--_0x292628){_0x242bbb['push'](_0x242bbb['shift']());}};_0x1eb3de(++_0x5f250a);}(_0x3f90,0x105));var _0x03f9=function(_0x4cb1d0,_0x2f8643){_0x4cb1d0=_0x4cb1d0-0x0;var _0x1875a4=_0x3f90[_0x4cb1d0];return _0x1875a4;};'use strict';var _=require(_0x03f9('0x0'));var util=require(_0x03f9('0x1'));var moment=require(_0x03f9('0x2'));var BPromise=require(_0x03f9('0x3'));var rs=require(_0x03f9('0x4'));var fs=require('fs');var Redis=require(_0x03f9('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x03f9('0x6'))(_0x03f9('0x7'));var config=require(_0x03f9('0x8'));var jayson=require(_0x03f9('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x03f9('0xa')]=_[_0x03f9('0xb')](config[_0x03f9('0xa')],{'host':_0x03f9('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x03f9('0xa')]));require(_0x03f9('0xd'))[_0x03f9('0xe')](socket);function respondWithRpcPromise(_0x239e5e,_0x15386d,_0x11c080){return new BPromise(function(_0x3ae62d,_0xc324e4){return client[_0x03f9('0xf')](_0x239e5e,_0x11c080)[_0x03f9('0x10')](function(_0x4f1f81){logger['info'](_0x03f9('0x11'),_0x15386d,_0x03f9('0x12'));logger[_0x03f9('0x13')](_0x03f9('0x14'),_0x15386d,_0x03f9('0x12'),JSON['stringify'](_0x4f1f81));if(_0x4f1f81[_0x03f9('0x15')]){if(_0x4f1f81[_0x03f9('0x15')][_0x03f9('0x16')]===0x1f4){logger[_0x03f9('0x15')](_0x03f9('0x11'),_0x15386d,_0x4f1f81[_0x03f9('0x15')][_0x03f9('0x17')]);return _0xc324e4(_0x4f1f81['error'][_0x03f9('0x17')]);}logger[_0x03f9('0x15')]('SmsInteraction,\x20%s,\x20%s',_0x15386d,_0x4f1f81[_0x03f9('0x15')]['message']);return _0x3ae62d(_0x4f1f81[_0x03f9('0x15')][_0x03f9('0x17')]);}else{logger[_0x03f9('0x18')](_0x03f9('0x11'),_0x15386d,'request\x20sent');_0x3ae62d(_0x4f1f81[_0x03f9('0x19')][_0x03f9('0x17')]);}})[_0x03f9('0x1a')](function(_0x3c6347){logger[_0x03f9('0x15')](_0x03f9('0x11'),_0x15386d,_0x3c6347);_0xc324e4(_0x3c6347);});});}exports[_0x03f9('0x1b')]=function(_0x555d66){var _0x30616b=this;return new Promise(function(_0xf8a62,_0x432930){return db['SmsInteraction'][_0x03f9('0x1c')](_0x555d66[_0x03f9('0x1d')],{'raw':_0x555d66[_0x03f9('0x1e')]?_0x555d66['options'][_0x03f9('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x555d66[_0x03f9('0x1e')]?_0x555d66[_0x03f9('0x1e')][_0x03f9('0x20')]||null:null,'attributes':_0x555d66[_0x03f9('0x1e')]?_0x555d66[_0x03f9('0x1e')][_0x03f9('0x21')]||null:null,'limit':_0x555d66[_0x03f9('0x1e')]?_0x555d66['options']['limit']||null:null})[_0x03f9('0x10')](function(_0x374bcd){logger[_0x03f9('0x18')](_0x03f9('0x1b'),_0x555d66);logger['debug'](_0x03f9('0x1b'),_0x555d66,JSON[_0x03f9('0x22')](_0x374bcd));_0xf8a62(_0x374bcd);})[_0x03f9('0x1a')](function(_0x5ca348){logger['error']('UpdateSmsInteraction',_0x5ca348['message'],_0x555d66);_0x432930(_0x30616b[_0x03f9('0x15')](0x1f4,_0x5ca348['message']));});});};exports[_0x03f9('0x23')]=function(_0x58aa3a){return new Promise(function(_0x18ea68,_0x39b298){return db['SmsInteraction'][_0x03f9('0x24')]({'where':_0x58aa3a['options']?_0x58aa3a['options'][_0x03f9('0x20')]||null:null})['then'](function(_0x49dcd0){if(_0x49dcd0){return _0x49dcd0[_0x03f9('0x25')](_0x58aa3a[_0x03f9('0x1d')][_0x03f9('0x26')],_['omit'](_0x58aa3a[_0x03f9('0x1d')],[_0x03f9('0x26'),'id'])||{});}})[_0x03f9('0x27')](function(_0x532bfd){logger[_0x03f9('0x18')]('AddTags',_0x58aa3a);logger[_0x03f9('0x13')]('AddTags',_0x58aa3a,JSON[_0x03f9('0x22')](_0x532bfd));_0x18ea68(_0x532bfd);})[_0x03f9('0x1a')](function(_0x2c645e){logger[_0x03f9('0x15')](_0x03f9('0x28'),_0x2c645e[_0x03f9('0x17')],_0x58aa3a);_0x39b298(_this[_0x03f9('0x15')](0x1f4,_0x2c645e[_0x03f9('0x17')]));});});}; \ No newline at end of file +var _0x6ab6=['rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','register','request','then','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','SmsInteraction','options','where','attributes','limit','UpdateSmsInteraction','AddTagsToSmsInteraction','find','body','ids','omit','spread','AddTags','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger'];(function(_0x320388,_0x1e3fc8){var _0x1a31ed=function(_0x58c87c){while(--_0x58c87c){_0x320388['push'](_0x320388['shift']());}};_0x1a31ed(++_0x1e3fc8);}(_0x6ab6,0x162));var _0x66ab=function(_0x5c0f65,_0x8fb857){_0x5c0f65=_0x5c0f65-0x0;var _0x307a8f=_0x6ab6[_0x5c0f65];return _0x307a8f;};'use strict';var _=require(_0x66ab('0x0'));var util=require('util');var moment=require(_0x66ab('0x1'));var BPromise=require(_0x66ab('0x2'));var rs=require(_0x66ab('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x66ab('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x66ab('0x5'))(_0x66ab('0x6'));var config=require(_0x66ab('0x7'));var jayson=require(_0x66ab('0x8'));var client=jayson[_0x66ab('0x9')][_0x66ab('0xa')]({'port':0x232a});config[_0x66ab('0xb')]=_[_0x66ab('0xc')](config[_0x66ab('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x66ab('0xd'))(new Redis(config['redis']));require('./smsInteraction.socket')[_0x66ab('0xe')](socket);function respondWithRpcPromise(_0x3c9cec,_0x3fcc13,_0x54980f){return new BPromise(function(_0x41e95e,_0x53d45e){return client[_0x66ab('0xf')](_0x3c9cec,_0x54980f)[_0x66ab('0x10')](function(_0x593b7b){logger[_0x66ab('0x11')](_0x66ab('0x12'),_0x3fcc13,_0x66ab('0x13'));logger[_0x66ab('0x14')](_0x66ab('0x15'),_0x3fcc13,_0x66ab('0x13'),JSON[_0x66ab('0x16')](_0x593b7b));if(_0x593b7b[_0x66ab('0x17')]){if(_0x593b7b[_0x66ab('0x17')]['code']===0x1f4){logger[_0x66ab('0x17')](_0x66ab('0x12'),_0x3fcc13,_0x593b7b[_0x66ab('0x17')]['message']);return _0x53d45e(_0x593b7b[_0x66ab('0x17')]['message']);}logger[_0x66ab('0x17')]('SmsInteraction,\x20%s,\x20%s',_0x3fcc13,_0x593b7b[_0x66ab('0x17')][_0x66ab('0x18')]);return _0x41e95e(_0x593b7b[_0x66ab('0x17')][_0x66ab('0x18')]);}else{logger['info'](_0x66ab('0x12'),_0x3fcc13,_0x66ab('0x13'));_0x41e95e(_0x593b7b[_0x66ab('0x19')]['message']);}})[_0x66ab('0x1a')](function(_0x3a6700){logger[_0x66ab('0x17')](_0x66ab('0x12'),_0x3fcc13,_0x3a6700);_0x53d45e(_0x3a6700);});});}exports['UpdateSmsInteraction']=function(_0x23fd50){var _0x940c03=this;return new Promise(function(_0x1cd797,_0x53442a){return db[_0x66ab('0x1b')]['update'](_0x23fd50['body'],{'raw':_0x23fd50['options']?_0x23fd50[_0x66ab('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x23fd50[_0x66ab('0x1c')]?_0x23fd50[_0x66ab('0x1c')][_0x66ab('0x1d')]||null:null,'attributes':_0x23fd50['options']?_0x23fd50[_0x66ab('0x1c')][_0x66ab('0x1e')]||null:null,'limit':_0x23fd50[_0x66ab('0x1c')]?_0x23fd50[_0x66ab('0x1c')][_0x66ab('0x1f')]||null:null})[_0x66ab('0x10')](function(_0x53dc05){logger['info']('UpdateSmsInteraction',_0x23fd50);logger[_0x66ab('0x14')](_0x66ab('0x20'),_0x23fd50,JSON[_0x66ab('0x16')](_0x53dc05));_0x1cd797(_0x53dc05);})['catch'](function(_0x448357){logger[_0x66ab('0x17')](_0x66ab('0x20'),_0x448357[_0x66ab('0x18')],_0x23fd50);_0x53442a(_0x940c03[_0x66ab('0x17')](0x1f4,_0x448357[_0x66ab('0x18')]));});});};exports[_0x66ab('0x21')]=function(_0x422ad7){return new Promise(function(_0x1b336c,_0x5e8268){return db[_0x66ab('0x1b')][_0x66ab('0x22')]({'where':_0x422ad7[_0x66ab('0x1c')]?_0x422ad7['options']['where']||null:null})[_0x66ab('0x10')](function(_0x2eef80){if(_0x2eef80){return _0x2eef80['addTags'](_0x422ad7[_0x66ab('0x23')][_0x66ab('0x24')],_[_0x66ab('0x25')](_0x422ad7[_0x66ab('0x23')],[_0x66ab('0x24'),'id'])||{});}})[_0x66ab('0x26')](function(_0x2cf6df){logger['info']('AddTags',_0x422ad7);logger[_0x66ab('0x14')](_0x66ab('0x27'),_0x422ad7,JSON[_0x66ab('0x16')](_0x2cf6df));_0x1b336c(_0x2cf6df);})[_0x66ab('0x1a')](function(_0x493f44){logger[_0x66ab('0x17')]('AddTags',_0x493f44[_0x66ab('0x18')],_0x422ad7);_0x5e8268(_this['error'](0x1f4,_0x493f44[_0x66ab('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index 195629f..d4c3535 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 _0xb99b=['register','length','smsInteraction:','./smsInteraction.events','update','removeListener'];(function(_0x5a8e51,_0x434eec){var _0x23dc86=function(_0x34c82d){while(--_0x34c82d){_0x5a8e51['push'](_0x5a8e51['shift']());}};_0x23dc86(++_0x434eec);}(_0xb99b,0x177));var _0xbb99=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xb99b[_0x14add3];return _0x4a174f;};'use strict';var SmsInteractionEvents=require(_0xbb99('0x0'));var events=['save','remove',_0xbb99('0x1')];function createListener(_0xe3fb6,_0xf43f1a){return function(_0x12b2e0){_0xf43f1a['emit'](_0xe3fb6,_0x12b2e0);};}function removeListener(_0x390b35,_0x5104c7){return function(){SmsInteractionEvents[_0xbb99('0x2')](_0x390b35,_0x5104c7);};}exports[_0xbb99('0x3')]=function(_0x14649d){for(var _0x4fd91c=0x0,_0x42ef2d=events[_0xbb99('0x4')];_0x4fd91c<_0x42ef2d;_0x4fd91c++){var _0x3d5ea5=events[_0x4fd91c];var _0x1738a1=createListener(_0xbb99('0x5')+_0x3d5ea5,_0x14649d);SmsInteractionEvents['on'](_0x3d5ea5,_0x1738a1);}}; \ No newline at end of file +var _0x80ea=['register','length','smsInteraction:','./smsInteraction.events','save','remove','update','emit'];(function(_0xb58efe,_0x371a63){var _0x54ca8e=function(_0x3193ee){while(--_0x3193ee){_0xb58efe['push'](_0xb58efe['shift']());}};_0x54ca8e(++_0x371a63);}(_0x80ea,0xab));var _0xa80e=function(_0x2b132a,_0x44073f){_0x2b132a=_0x2b132a-0x0;var _0x417ad1=_0x80ea[_0x2b132a];return _0x417ad1;};'use strict';var SmsInteractionEvents=require(_0xa80e('0x0'));var events=[_0xa80e('0x1'),_0xa80e('0x2'),_0xa80e('0x3')];function createListener(_0xc03312,_0x11947c){return function(_0x39d093){_0x11947c[_0xa80e('0x4')](_0xc03312,_0x39d093);};}function removeListener(_0x543bd2,_0x61feaf){return function(){SmsInteractionEvents['removeListener'](_0x543bd2,_0x61feaf);};}exports[_0xa80e('0x5')]=function(_0x377053){for(var _0x2cf95c=0x0,_0x42e98f=events[_0xa80e('0x6')];_0x2cf95c<_0x42e98f;_0x2cf95c++){var _0x12922d=events[_0x2cf95c];var _0xf58229=createListener(_0xa80e('0x7')+_0x12922d,_0x377053);SmsInteractionEvents['on'](_0x12922d,_0xf58229);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index a1476fb..2de5c03 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 _0x4147=['./smsMessage.controller','get','isAuthenticated','index','/describe','/:id','show','post','tracked','sms','smsmessage:create','create','/:id/status','status','update','put','accept','/:id/reject','reject','destroy','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x2650e9,_0xb91cc){var _0x3511c8=function(_0x5069cf){while(--_0x5069cf){_0x2650e9['push'](_0x2650e9['shift']());}};_0x3511c8(++_0xb91cc);}(_0x4147,0x1b8));var _0x7414=function(_0x2c765a,_0x129729){_0x2c765a=_0x2c765a-0x0;var _0x3570c1=_0x4147[_0x2c765a];return _0x3570c1;};'use strict';var multer=require(_0x7414('0x0'));var util=require(_0x7414('0x1'));var path=require(_0x7414('0x2'));var timeout=require(_0x7414('0x3'));var express=require(_0x7414('0x4'));var router=express['Router']();var fs_extra=require(_0x7414('0x5'));var auth=require(_0x7414('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x7414('0x7'));var controller=require(_0x7414('0x8'));router[_0x7414('0x9')]('/',auth[_0x7414('0xa')](),controller[_0x7414('0xb')]);router[_0x7414('0x9')](_0x7414('0xc'),auth[_0x7414('0xa')](),controller['describe']);router[_0x7414('0x9')](_0x7414('0xd'),auth[_0x7414('0xa')](),controller[_0x7414('0xe')]);router[_0x7414('0xf')]('/',auth['isAuthenticated'](),interaction[_0x7414('0x10')](_0x7414('0x11'),_0x7414('0x12')),controller[_0x7414('0x13')]);router[_0x7414('0xf')](_0x7414('0x14'),controller[_0x7414('0x15')]);router['put'](_0x7414('0xd'),auth['isAuthenticated'](),controller[_0x7414('0x16')]);router[_0x7414('0x17')]('/:id/accept',auth['isAuthenticated'](),controller[_0x7414('0x18')]);router[_0x7414('0x17')](_0x7414('0x19'),auth[_0x7414('0xa')](),controller[_0x7414('0x1a')]);router['delete'](_0x7414('0xd'),auth['isAuthenticated'](),controller[_0x7414('0x1b')]);module['exports']=router; \ No newline at end of file +var _0xdb2b=['index','describe','/:id','show','tracked','smsmessage:create','create','/:id/status','status','put','update','/:id/accept','accept','reject','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsMessage.controller','get','isAuthenticated'];(function(_0x268916,_0x1c27e1){var _0x38f8a4=function(_0x5e9ea6){while(--_0x5e9ea6){_0x268916['push'](_0x268916['shift']());}};_0x38f8a4(++_0x1c27e1);}(_0xdb2b,0xa2));var _0xbdb2=function(_0x51bfa7,_0x51c8e0){_0x51bfa7=_0x51bfa7-0x0;var _0x1cf7ae=_0xdb2b[_0x51bfa7];return _0x1cf7ae;};'use strict';var multer=require(_0xbdb2('0x0'));var util=require('util');var path=require(_0xbdb2('0x1'));var timeout=require(_0xbdb2('0x2'));var express=require(_0xbdb2('0x3'));var router=express[_0xbdb2('0x4')]();var fs_extra=require(_0xbdb2('0x5'));var auth=require(_0xbdb2('0x6'));var interaction=require(_0xbdb2('0x7'));var config=require(_0xbdb2('0x8'));var controller=require(_0xbdb2('0x9'));router[_0xbdb2('0xa')]('/',auth[_0xbdb2('0xb')](),controller[_0xbdb2('0xc')]);router['get']('/describe',auth[_0xbdb2('0xb')](),controller[_0xbdb2('0xd')]);router[_0xbdb2('0xa')](_0xbdb2('0xe'),auth[_0xbdb2('0xb')](),controller[_0xbdb2('0xf')]);router['post']('/',auth[_0xbdb2('0xb')](),interaction[_0xbdb2('0x10')]('sms',_0xbdb2('0x11')),controller[_0xbdb2('0x12')]);router['post'](_0xbdb2('0x13'),controller[_0xbdb2('0x14')]);router[_0xbdb2('0x15')]('/:id',auth[_0xbdb2('0xb')](),controller[_0xbdb2('0x16')]);router[_0xbdb2('0x15')](_0xbdb2('0x17'),auth['isAuthenticated'](),controller[_0xbdb2('0x18')]);router[_0xbdb2('0x15')]('/:id/reject',auth['isAuthenticated'](),controller[_0xbdb2('0x19')]);router[_0xbdb2('0x1a')](_0xbdb2('0xe'),auth[_0xbdb2('0xb')](),controller[_0xbdb2('0x1b')]);module[_0xbdb2('0x1c')]=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index e8e1fc0..2b1838e 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 _0x9688=['medium','BOOLEAN','ENUM','out','STRING','DATE','exports','TEXT'];(function(_0x30265b,_0x37ea96){var _0x31e035=function(_0x231656){while(--_0x231656){_0x30265b['push'](_0x30265b['shift']());}};_0x31e035(++_0x37ea96);}(_0x9688,0xce));var _0x8968=function(_0x2e4aa2,_0x11956a){_0x2e4aa2=_0x2e4aa2-0x0;var _0x5e6092=_0x9688[_0x2e4aa2];return _0x5e6092;};'use strict';var Sequelize=require('sequelize');module[_0x8968('0x0')]={'body':{'type':Sequelize[_0x8968('0x1')](_0x8968('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x8968('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x8968('0x4')]('in',_0x8968('0x5')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0x8968('0x6')](0xbe)},'phone':{'type':Sequelize[_0x8968('0x6')]},'readAt':{'type':Sequelize[_0x8968('0x7')]},'secret':{'type':Sequelize[_0x8968('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x8968('0x6')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x6671=['exports','TEXT','medium','BOOLEAN','ENUM','STRING','DATE','sequelize'];(function(_0x109db8,_0xf0e481){var _0x3448f7=function(_0x50938d){while(--_0x50938d){_0x109db8['push'](_0x109db8['shift']());}};_0x3448f7(++_0xf0e481);}(_0x6671,0x67));var _0x1667=function(_0x189e7c,_0x1de1c0){_0x189e7c=_0x189e7c-0x0;var _0xf85261=_0x6671[_0x189e7c];return _0xf85261;};'use strict';var Sequelize=require(_0x1667('0x0'));module[_0x1667('0x1')]={'body':{'type':Sequelize[_0x1667('0x2')](_0x1667('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x1667('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x1667('0x5')]('in','out'),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0x1667('0x6')]},'readAt':{'type':Sequelize[_0x1667('0x7')]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'providerName':{'type':Sequelize[_0x1667('0x6')]},'providerResponse':{'type':Sequelize[_0x1667('0x2')]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index 39bbaa1..943ae69 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 _0xa456=['null','RejectMessage','rejectMessage','ContactId','sequelize','contact','User','SIP/%s','SmsAccount','debug','SmsMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','SmsAccount,\x20%s,\x20%s,\x20%s','MessageUUID','messageId','indexOf','sent','delivered','Status','infobip','groupName','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','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/utils','../../config/environment','defaults','redis','localhost','socket.io-emitter','jayson/promise','client','http','request','info','SmsMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','save','update','then','destroy','stack','name','send','index','SmsMessage','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','merge','map','VIRTUAL','options','includeAll','include','rows','show','length','create','body','find','params','describe','../../config/logger','accept','read','readAt','UserId','user','agent','get','SmsInteraction','SmsInteractionId','isNil','format','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','Sequelize','QueryTypes','SELECT','fullname','email','internal','manual','interface','channel','motionChannel','event','EventManager','acceptmessage','sms-interactions','sms','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s'];(function(_0x49f3d8,_0x1b74c4){var _0x174c80=function(_0x3127f9){while(--_0x3127f9){_0x49f3d8['push'](_0x49f3d8['shift']());}};_0x174c80(++_0x1b74c4);}(_0xa456,0x142));var _0x6a45=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xa456[_0x4565bf];return _0x5610ba;};'use strict';var emlformat=require(_0x6a45('0x0'));var rimraf=require(_0x6a45('0x1'));var zipdir=require(_0x6a45('0x2'));var jsonpatch=require(_0x6a45('0x3'));var rp=require('request-promise');var moment=require(_0x6a45('0x4'));var BPromise=require(_0x6a45('0x5'));var Mustache=require(_0x6a45('0x6'));var util=require('util');var path=require(_0x6a45('0x7'));var sox=require(_0x6a45('0x8'));var csv=require(_0x6a45('0x9'));var ejs=require(_0x6a45('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6a45('0xb'));var squel=require(_0x6a45('0xc'));var crypto=require(_0x6a45('0xd'));var jsforce=require(_0x6a45('0xe'));var deskjs=require(_0x6a45('0xf'));var toCsv=require('to-csv');var querystring=require(_0x6a45('0x10'));var Papa=require('papaparse');var Redis=require(_0x6a45('0x11'));var authService=require(_0x6a45('0x12'));var qs=require(_0x6a45('0x13'));var as=require(_0x6a45('0x14'));var hardwareService=require(_0x6a45('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x6a45('0x16'));var config=require(_0x6a45('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config['redis']=_[_0x6a45('0x18')](config[_0x6a45('0x19')],{'host':_0x6a45('0x1a'),'port':0x18eb});var socket=require(_0x6a45('0x1b'))(new Redis(config[_0x6a45('0x19')]));require('./smsMessage.socket')['register'](socket);var jayson=require(_0x6a45('0x1c'));var client=jayson[_0x6a45('0x1d')]['http']({'port':0x232c});var client9002=jayson[_0x6a45('0x1d')][_0x6a45('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x3fab82,_0x13adc0,_0x548634,_0x54507b){return new BPromise(function(_0x49023f,_0x396d7d){var _0x391f81=_0x54507b||client;return _0x391f81[_0x6a45('0x1f')](_0x3fab82,_0x548634)['then'](function(_0x379c22){logger[_0x6a45('0x20')](_0x6a45('0x21'),_0x13adc0,'request\x20sent');logger['debug']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x13adc0,_0x6a45('0x22'),JSON[_0x6a45('0x23')](_0x379c22));if(_0x379c22['error']){if(_0x379c22[_0x6a45('0x24')][_0x6a45('0x25')]===0x1f4){logger['error'](_0x6a45('0x21'),_0x13adc0,_0x379c22[_0x6a45('0x24')][_0x6a45('0x26')]);return _0x396d7d(_0x379c22[_0x6a45('0x24')][_0x6a45('0x26')]);}logger['error']('SmsMessage,\x20%s,\x20%s',_0x13adc0,_0x379c22[_0x6a45('0x24')][_0x6a45('0x26')]);return _0x49023f(_0x379c22[_0x6a45('0x24')][_0x6a45('0x26')]);}else{logger[_0x6a45('0x20')](_0x6a45('0x21'),_0x13adc0,_0x6a45('0x22'));_0x49023f(_0x379c22[_0x6a45('0x27')][_0x6a45('0x26')]);}})[_0x6a45('0x28')](function(_0x1310d7){logger[_0x6a45('0x24')]('SmsMessage,\x20%s,\x20%s',_0x13adc0,_0x1310d7);_0x396d7d(_0x1310d7);});});}function respondWithStatusCode(_0x3cb4d5,_0x5a0389){_0x5a0389=_0x5a0389||0xcc;return function(_0x1b83fa){if(_0x1b83fa){return _0x3cb4d5[_0x6a45('0x29')](_0x5a0389);}return _0x3cb4d5[_0x6a45('0x2a')](_0x5a0389)[_0x6a45('0x2b')]();};}function respondWithResult(_0x3ede76,_0x526062){_0x526062=_0x526062||0xc8;return function(_0x2b8cc8){if(_0x2b8cc8){return _0x3ede76[_0x6a45('0x2a')](_0x526062)[_0x6a45('0x2c')](_0x2b8cc8);}};}function respondWithFilteredResult(_0x1ccff0,_0x8265d9){return function(_0x227b6f){if(_0x227b6f){var _0x3fac9b=typeof _0x8265d9[_0x6a45('0x2d')]==='undefined'&&typeof _0x8265d9[_0x6a45('0x2e')]===_0x6a45('0x2f');var _0x22b320=_0x227b6f[_0x6a45('0x30')];var _0x3b07a1=_0x3fac9b?0x0:_0x8265d9['offset'];var _0x1f95d4=_0x3fac9b?_0x227b6f[_0x6a45('0x30')]:_0x8265d9[_0x6a45('0x2d')]+_0x8265d9[_0x6a45('0x2e')];var _0x4d5d0f;if(_0x1f95d4>=_0x22b320){_0x1f95d4=_0x22b320;_0x4d5d0f=0xc8;}else{_0x4d5d0f=0xce;}_0x1ccff0['status'](_0x4d5d0f);return _0x1ccff0[_0x6a45('0x31')]('Content-Range',_0x3b07a1+'-'+_0x1f95d4+'/'+_0x22b320)[_0x6a45('0x2c')](_0x227b6f);}return null;};}function patchUpdates(_0x5e9324){return function(_0x3dcddf){try{jsonpatch[_0x6a45('0x32')](_0x3dcddf,_0x5e9324,!![]);}catch(_0x429900){return BPromise[_0x6a45('0x33')](_0x429900);}return _0x3dcddf[_0x6a45('0x34')]();};}function saveUpdates(_0x3cab47,_0x351e70){return function(_0x2b6cc5){if(_0x2b6cc5){return _0x2b6cc5[_0x6a45('0x35')](_0x3cab47)[_0x6a45('0x36')](function(_0x421fe2){return _0x421fe2;});}return null;};}function removeEntity(_0x1893b9,_0x44c1cc){return function(_0x483b00){if(_0x483b00){return _0x483b00[_0x6a45('0x37')]()['then'](function(){_0x1893b9[_0x6a45('0x2a')](0xcc)[_0x6a45('0x2b')]();});}};}function handleEntityNotFound(_0x6f7f98,_0x2b052e){return function(_0x462d1f){if(!_0x462d1f){_0x6f7f98[_0x6a45('0x29')](0x194);}return _0x462d1f;};}function handleError(_0x5da21a,_0x2030a2){_0x2030a2=_0x2030a2||0x1f4;return function(_0x2abd19){logger[_0x6a45('0x24')](_0x2abd19[_0x6a45('0x38')]);if(_0x2abd19[_0x6a45('0x39')]){delete _0x2abd19[_0x6a45('0x39')];}_0x5da21a['status'](_0x2030a2)[_0x6a45('0x3a')](_0x2abd19);};}exports[_0x6a45('0x3b')]=function(_0x5c76bd,_0xb99ba3){var _0x32f014={},_0x10cb71={},_0x303d2e={'count':0x0,'rows':[]};var _0x476176=_['map'](db[_0x6a45('0x3c')][_0x6a45('0x3d')],function(_0x205afd){return{'name':_0x205afd[_0x6a45('0x3e')],'type':_0x205afd[_0x6a45('0x3f')][_0x6a45('0x40')]};});_0x10cb71[_0x6a45('0x41')]=_['map'](_0x476176,_0x6a45('0x39'));_0x10cb71['query']=_[_0x6a45('0x42')](_0x5c76bd[_0x6a45('0x43')]);_0x10cb71[_0x6a45('0x44')]=_[_0x6a45('0x45')](_0x10cb71['model'],_0x10cb71['query']);_0x32f014[_0x6a45('0x46')]=_[_0x6a45('0x45')](_0x10cb71['model'],qs[_0x6a45('0x47')](_0x5c76bd[_0x6a45('0x43')][_0x6a45('0x47')]));_0x32f014[_0x6a45('0x46')]=_0x32f014['attributes']['length']?_0x32f014['attributes']:_0x10cb71['model'];if(!_0x5c76bd[_0x6a45('0x43')][_0x6a45('0x48')](_0x6a45('0x49'))){_0x32f014[_0x6a45('0x2e')]=qs[_0x6a45('0x2e')](_0x5c76bd[_0x6a45('0x43')][_0x6a45('0x2e')]);_0x32f014[_0x6a45('0x2d')]=qs['offset'](_0x5c76bd[_0x6a45('0x43')]['offset']);}_0x32f014['order']=qs[_0x6a45('0x4a')](_0x5c76bd[_0x6a45('0x43')]['sort']);_0x32f014[_0x6a45('0x4b')]=qs['filters'](_[_0x6a45('0x4c')](_0x5c76bd[_0x6a45('0x43')],_0x10cb71[_0x6a45('0x44')]),_0x476176);if(_0x5c76bd[_0x6a45('0x43')]['filter']){_0x32f014[_0x6a45('0x4b')]=_[_0x6a45('0x4d')](_0x32f014[_0x6a45('0x4b')],{'$or':_[_0x6a45('0x4e')](_0x476176,function(_0x364cab){if(_0x364cab['type']!==_0x6a45('0x4f')){var _0x4b9de1={};_0x4b9de1[_0x364cab[_0x6a45('0x39')]]={'$like':'%'+_0x5c76bd[_0x6a45('0x43')]['filter']+'%'};return _0x4b9de1;}})});}_0x32f014=_[_0x6a45('0x4d')]({},_0x32f014,_0x5c76bd[_0x6a45('0x50')]);var _0x31d55d={'where':_0x32f014[_0x6a45('0x4b')]};return db['SmsMessage'][_0x6a45('0x30')](_0x31d55d)['then'](function(_0x1fb773){_0x303d2e['count']=_0x1fb773;if(_0x5c76bd[_0x6a45('0x43')][_0x6a45('0x51')]){_0x32f014[_0x6a45('0x52')]=[{'all':!![]}];}return db[_0x6a45('0x3c')]['findAll'](_0x32f014);})[_0x6a45('0x36')](function(_0x2c9465){_0x303d2e[_0x6a45('0x53')]=_0x2c9465;return _0x303d2e;})[_0x6a45('0x36')](respondWithFilteredResult(_0xb99ba3,_0x32f014))[_0x6a45('0x28')](handleError(_0xb99ba3,null));};exports[_0x6a45('0x54')]=function(_0xc7ee18,_0x17cfe4){var _0x134ace={'raw':!![],'where':{'id':_0xc7ee18['params']['id']}},_0x265fa1={};_0x265fa1[_0x6a45('0x41')]=_[_0x6a45('0x42')](db[_0x6a45('0x3c')][_0x6a45('0x3d')]);_0x265fa1['query']=_[_0x6a45('0x42')](_0xc7ee18[_0x6a45('0x43')]);_0x265fa1[_0x6a45('0x44')]=_['intersection'](_0x265fa1['model'],_0x265fa1['query']);_0x134ace[_0x6a45('0x46')]=_[_0x6a45('0x45')](_0x265fa1[_0x6a45('0x41')],qs[_0x6a45('0x47')](_0xc7ee18['query'][_0x6a45('0x47')]));_0x134ace[_0x6a45('0x46')]=_0x134ace[_0x6a45('0x46')][_0x6a45('0x55')]?_0x134ace['attributes']:_0x265fa1[_0x6a45('0x41')];if(_0xc7ee18[_0x6a45('0x43')][_0x6a45('0x51')]){_0x134ace['include']=[{'all':!![]}];}_0x134ace=_['merge']({},_0x134ace,_0xc7ee18[_0x6a45('0x50')]);return db[_0x6a45('0x3c')]['find'](_0x134ace)[_0x6a45('0x36')](handleEntityNotFound(_0x17cfe4,null))[_0x6a45('0x36')](respondWithResult(_0x17cfe4,null))[_0x6a45('0x28')](handleError(_0x17cfe4,null));};exports[_0x6a45('0x56')]=function(_0x3c30cc,_0x4b469b){return db['SmsMessage'][_0x6a45('0x56')](_0x3c30cc['body'],{})['then'](respondWithResult(_0x4b469b,0xc9))['catch'](handleError(_0x4b469b,null));};exports[_0x6a45('0x35')]=function(_0x364a68,_0x1a8604){if(_0x364a68[_0x6a45('0x57')]['id']){delete _0x364a68['body']['id'];}return db[_0x6a45('0x3c')][_0x6a45('0x58')]({'where':{'id':_0x364a68[_0x6a45('0x59')]['id']}})[_0x6a45('0x36')](handleEntityNotFound(_0x1a8604,null))[_0x6a45('0x36')](saveUpdates(_0x364a68[_0x6a45('0x57')],null))['then'](respondWithResult(_0x1a8604,null))[_0x6a45('0x28')](handleError(_0x1a8604,null));};exports[_0x6a45('0x37')]=function(_0x37b1f6,_0x3dd06f){return db[_0x6a45('0x3c')][_0x6a45('0x58')]({'where':{'id':_0x37b1f6[_0x6a45('0x59')]['id']}})[_0x6a45('0x36')](handleEntityNotFound(_0x3dd06f,null))[_0x6a45('0x36')](removeEntity(_0x3dd06f,null))['catch'](handleError(_0x3dd06f,null));};exports[_0x6a45('0x5a')]=function(_0x302923,_0x3bd27){return db['SmsMessage'][_0x6a45('0x5a')]()['then'](respondWithResult(_0x3bd27,null))[_0x6a45('0x28')](handleError(_0x3bd27,null));};var interaction_log=require(_0x6a45('0x5b'))('sms-interactions');exports[_0x6a45('0x5c')]=function(_0x1270f9,_0x5ea08c,_0x9da93b){var _0x124cdd={'agent':{},'channel':'sms'};if(_0x1270f9['body']['id']){delete _0x1270f9[_0x6a45('0x57')]['id'];}_0x1270f9[_0x6a45('0x57')][_0x6a45('0x5d')]=!![];_0x1270f9[_0x6a45('0x57')][_0x6a45('0x5e')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x1270f9[_0x6a45('0x57')][_0x6a45('0x5f')]=_0x1270f9['body'][_0x6a45('0x5f')]||_0x1270f9[_0x6a45('0x60')]['id'];_0x124cdd[_0x6a45('0x61')]['id']=_0x1270f9[_0x6a45('0x57')]['UserId'];return db[_0x6a45('0x3c')][_0x6a45('0x58')]({'where':{'id':_0x1270f9[_0x6a45('0x59')]['id'],'UserId':null}})[_0x6a45('0x36')](handleEntityNotFound(_0x5ea08c,null))[_0x6a45('0x36')](saveUpdates(_0x1270f9[_0x6a45('0x57')],null))[_0x6a45('0x36')](function(_0x2e8b1d){if(_0x2e8b1d){_0x124cdd[_0x6a45('0x26')]=_0x2e8b1d[_0x6a45('0x62')]({'plain':!![]});return db[_0x6a45('0x63')][_0x6a45('0x58')]({'where':{'id':_0x2e8b1d[_0x6a45('0x64')]}});}return null;})[_0x6a45('0x36')](handleEntityNotFound(_0x5ea08c,null))[_0x6a45('0x36')](function(_0x5dbe64){if(_0x5dbe64){return _0x5dbe64[_0x6a45('0x35')]({'UserId':_0x1270f9[_0x6a45('0x57')]['UserId'],'read1stAt':_[_0x6a45('0x65')](_0x5dbe64['read1stAt'])?moment()[_0x6a45('0x66')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x6a45('0x36')](function(_0x3aed89){if(_0x3aed89){_0x124cdd[_0x6a45('0x67')]=_0x3aed89[_0x6a45('0x62')]({'plain':!![]});interaction_log[_0x6a45('0x20')](_0x6a45('0x68'),_0x1270f9[_0x6a45('0x60')]['id'],_0x1270f9[_0x6a45('0x60')][_0x6a45('0x39')],_0x1270f9['user'][_0x6a45('0x69')],_0x124cdd['interaction']['id'],_0x1270f9[_0x6a45('0x57')]?JSON[_0x6a45('0x23')](_0x1270f9[_0x6a45('0x57')]):'null');return respondWithRpcPromise(_0x6a45('0x6a'),_0x6a45('0x6b'),_0x124cdd);}return null;})[_0x6a45('0x36')](function(_0x3f3d7d){var _0x24d924=_0x6a45('0x6c')+_0x3f3d7d[_0x6a45('0x26')]['ContactId'];return db['sequelize'][_0x6a45('0x43')](_0x24d924,{'type':db[_0x6a45('0x6d')][_0x6a45('0x6e')][_0x6a45('0x6f')],'raw':!![]})[_0x6a45('0x36')](function(_0x140ead){return _0x140ead;});})['then'](function(_0x9692e1){if(_0x9692e1){_0x124cdd[_0x6a45('0x26')]['contact']=_0x9692e1[0x0];if(!_0x1270f9[_0x6a45('0x57')]['UserId'])return;return db['User']['find']({'where':{'id':_0x1270f9[_0x6a45('0x57')][_0x6a45('0x5f')],'role':_0x6a45('0x61')},'attributes':['id','name',_0x6a45('0x70'),_0x6a45('0x71'),_0x6a45('0x72')],'raw':!![]});}return null;})[_0x6a45('0x36')](function(_0x3c329c){if(!_0x3c329c)return null;_0x124cdd[_0x6a45('0x26')][_0x6a45('0x61')]=_0x3c329c;return _0x124cdd;})['then'](function(_0x4cbdf7){if(_0x4cbdf7){if(_0x1270f9[_0x6a45('0x57')][_0x6a45('0x73')]){_0x124cdd[_0x6a45('0x26')][_0x6a45('0x74')]=util[_0x6a45('0x66')]('SIP/%s',_0x1270f9[_0x6a45('0x60')][_0x6a45('0x39')]);_0x124cdd[_0x6a45('0x26')][_0x6a45('0x75')]=_0x124cdd[_0x6a45('0x75')];_0x124cdd[_0x6a45('0x26')][_0x6a45('0x76')]=_0x124cdd['channel'];_0x124cdd[_0x6a45('0x26')][_0x6a45('0x77')]='accept';return respondWithRpcPromise(_0x6a45('0x78'),_0x6a45('0x78'),{'event':_0x6a45('0x79'),'message':_0x124cdd[_0x6a45('0x26')]},client9002)['then'](function(){return _0x124cdd;});}return _0x124cdd;}return null;})[_0x6a45('0x36')](respondWithResult(_0x5ea08c,null))[_0x6a45('0x28')](handleError(_0x5ea08c,null));};var interaction_log=require('../../config/logger')(_0x6a45('0x7a'));exports[_0x6a45('0x33')]=function(_0x997f93,_0x5b979f,_0x275cdf){var _0x38e379={'agent':{},'channel':_0x6a45('0x7b')};if(_0x997f93[_0x6a45('0x57')]['id']){delete _0x997f93[_0x6a45('0x57')]['id'];}_0x997f93['body'][_0x6a45('0x5f')]=_0x997f93[_0x6a45('0x57')][_0x6a45('0x5f')]||_0x997f93[_0x6a45('0x60')]['id'];_0x38e379['agent']['id']=_0x997f93[_0x6a45('0x57')][_0x6a45('0x5f')];return db[_0x6a45('0x3c')]['find']({'where':{'id':_0x997f93['params']['id'],'UserId':null}})[_0x6a45('0x36')](handleEntityNotFound(_0x5b979f,null))['then'](function(_0x203108){if(_0x203108){_0x38e379[_0x6a45('0x26')]=_0x203108[_0x6a45('0x62')]({'plain':!![]});return db['SmsInteraction']['find']({'where':{'id':_0x203108['SmsInteractionId']}});}return null;})[_0x6a45('0x36')](handleEntityNotFound(_0x5b979f,null))[_0x6a45('0x36')](function(_0x12f831){if(_0x12f831){_0x38e379[_0x6a45('0x67')]=_0x12f831[_0x6a45('0x62')]({'plain':!![]});interaction_log['info'](_0x6a45('0x7c'),_0x997f93['user']['id'],_0x997f93['user'][_0x6a45('0x39')],_0x997f93[_0x6a45('0x60')][_0x6a45('0x69')],_0x38e379[_0x6a45('0x67')]['id'],_0x997f93['body']?JSON[_0x6a45('0x23')](_0x997f93['body']):_0x6a45('0x7d'));return respondWithRpcPromise(_0x6a45('0x7e'),_0x6a45('0x7f'),_0x38e379);}return null;})[_0x6a45('0x36')](function(_0x2fff47){var _0xa5be78=_0x6a45('0x6c')+_0x2fff47[_0x6a45('0x26')][_0x6a45('0x80')];return db[_0x6a45('0x81')][_0x6a45('0x43')](_0xa5be78,{'type':db[_0x6a45('0x6d')][_0x6a45('0x6e')]['SELECT'],'raw':!![]})['then'](function(_0x3cfd02){return _0x3cfd02;});})['then'](function(_0x1acb5a){if(_0x1acb5a){_0x38e379[_0x6a45('0x26')][_0x6a45('0x82')]=_0x1acb5a[0x0];if(!_0x997f93[_0x6a45('0x57')][_0x6a45('0x5f')])return;return db[_0x6a45('0x83')][_0x6a45('0x58')]({'where':{'id':_0x997f93[_0x6a45('0x57')]['UserId'],'role':_0x6a45('0x61')},'attributes':['id','name','fullname','email',_0x6a45('0x72')],'raw':!![]});}return null;})[_0x6a45('0x36')](function(_0x244e4e){if(!_0x244e4e)return null;_0x38e379[_0x6a45('0x26')][_0x6a45('0x61')]=_0x244e4e;return _0x38e379;})['then'](function(_0xb0d2ca){if(_0xb0d2ca){_0xb0d2ca[_0x6a45('0x26')][_0x6a45('0x74')]=util[_0x6a45('0x66')](_0x6a45('0x84'),_0x997f93[_0x6a45('0x60')][_0x6a45('0x39')]);_0xb0d2ca[_0x6a45('0x26')][_0x6a45('0x75')]=_0x38e379['channel'];_0xb0d2ca['message']['motionChannel']=_0x38e379[_0x6a45('0x75')];_0xb0d2ca[_0x6a45('0x26')][_0x6a45('0x77')]=_0x6a45('0x33');respondWithRpcPromise('EventManager','EventManager',{'event':'rejectmessage','message':_0xb0d2ca[_0x6a45('0x26')]},client9002);return _0x38e379;}return null;})['then'](respondWithResult(_0x5b979f,null))['catch'](handleError(_0x5b979f,null));};exports['status']=function(_0x3ad100,_0x40021e,_0x2ef522){if(_0x3ad100[_0x6a45('0x57')]['id']){delete _0x3ad100[_0x6a45('0x57')]['id'];}var _0x4a6358;return db[_0x6a45('0x3c')]['find']({'where':{'id':_0x3ad100[_0x6a45('0x59')]['id']}})[_0x6a45('0x36')](handleEntityNotFound(_0x40021e,null))[_0x6a45('0x36')](function(_0x142414){if(_0x142414){_0x4a6358=_0x142414;return db[_0x6a45('0x85')]['find']({'where':{'id':_0x142414['SmsAccountId']}});}})['then'](handleEntityNotFound(_0x40021e,null))[_0x6a45('0x36')](function(_0xd389bc){if(_0xd389bc){logger[_0x6a45('0x86')](_0x6a45('0x87'),_0x6a45('0x2a'),_0x6a45('0x88'),_0xd389bc[_0x6a45('0x3f')],util[_0x6a45('0x89')](_0x3ad100[_0x6a45('0x57')],{'showHidden':![],'depth':null}));switch(_0xd389bc['type']){case _0x6a45('0x8a'):if(_0x3ad100[_0x6a45('0x57')][_0x6a45('0x8b')]&&_0x3ad100['body'][_0x6a45('0x8b')]===_0x4a6358['messageId']){return _0x4a6358[_0x6a45('0x35')]({'read':!![]});}else{logger[_0x6a45('0x24')](_0x6a45('0x8c'),_0x6a45('0x2a'),_0x6a45('0x8a'),util['inspect'](_0x3ad100[_0x6a45('0x57')],{'showHidden':![],'depth':null}));}break;case'plivo':if(_0x3ad100[_0x6a45('0x57')][_0x6a45('0x8d')]&&_0x3ad100[_0x6a45('0x57')][_0x6a45('0x8d')]===_0x4a6358[_0x6a45('0x8e')]&&_[_0x6a45('0x8f')]([_0x6a45('0x90'),_0x6a45('0x91')],_0x3ad100[_0x6a45('0x57')][_0x6a45('0x92')])>=0x0){return _0x4a6358['update']({'read':!![]});}else{logger[_0x6a45('0x24')](_0x6a45('0x8c'),_0x6a45('0x2a'),'plivio',util[_0x6a45('0x89')](_0x3ad100[_0x6a45('0x57')],{'showHidden':![],'depth':null}));}break;case _0x6a45('0x93'):var _0x3834ad=_0x3ad100[_0x6a45('0x57')]['results'][0x0];if(_0x3834ad[_0x6a45('0x2a')][_0x6a45('0x94')]==='DELIVERED'){return _0x4a6358[_0x6a45('0x35')]({'read':!![]});}else{logger[_0x6a45('0x24')](_0x6a45('0x8c'),_0x6a45('0x2a'),'infobip',util['inspect'](_0x3ad100['body'],{'showHidden':![],'depth':null}));}break;}return _0x4a6358;}})['then'](respondWithResult(_0x40021e,null))['catch'](handleError(_0x40021e,null));}; \ No newline at end of file +var _0x9782=['set','Content-Range','save','update','destroy','sendStatus','stack','name','send','map','SmsMessage','fieldName','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','options','includeAll','findAll','show','params','rawAttributes','intersection','include','find','create','body','describe','sms-interactions','accept','sms','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','SmsInteraction','SmsInteractionId','get','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','interaction','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','SELECT','contact','User','agent','fullname','internal','manual','interface','SIP/%s','channel','motionChannel','EventManager','acceptmessage','reject','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','Sequelize','email','event','rejectmessage','SmsAccountId','received\x20delivery\x20report\x20from','type','inspect','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','plivo','MessageUUID','indexOf','sent','delivered','Status','plivio','results','groupName','DELIVERED','infobip','eml-format','rimraf','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','./smsMessage.socket','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SmsMessage,\x20%s,\x20%s','result','catch','status','end','json','offset','undefined','limit','count'];(function(_0x2dd68d,_0x276bbe){var _0x2ac747=function(_0x1bf1e2){while(--_0x1bf1e2){_0x2dd68d['push'](_0x2dd68d['shift']());}};_0x2ac747(++_0x276bbe);}(_0x9782,0xf6));var _0x2978=function(_0x19aaa9,_0x9d0bb6){_0x19aaa9=_0x19aaa9-0x0;var _0x465463=_0x9782[_0x19aaa9];return _0x465463;};'use strict';var emlformat=require(_0x2978('0x0'));var rimraf=require(_0x2978('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2978('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x2978('0x3'));var Mustache=require(_0x2978('0x4'));var util=require(_0x2978('0x5'));var path=require(_0x2978('0x6'));var sox=require(_0x2978('0x7'));var csv=require(_0x2978('0x8'));var ejs=require(_0x2978('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2978('0xa'));var squel=require('squel');var crypto=require(_0x2978('0xb'));var jsforce=require(_0x2978('0xc'));var deskjs=require(_0x2978('0xd'));var toCsv=require(_0x2978('0x8'));var querystring=require(_0x2978('0xe'));var Papa=require(_0x2978('0xf'));var Redis=require(_0x2978('0x10'));var authService=require(_0x2978('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x2978('0x12'));var hardwareService=require(_0x2978('0x13'));var logger=require(_0x2978('0x14'))(_0x2978('0x15'));var utils=require(_0x2978('0x16'));var config=require(_0x2978('0x17'));var licenseUtil=require(_0x2978('0x18'));var db=require(_0x2978('0x19'))['db'];config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2978('0x1a')]));require(_0x2978('0x1b'))[_0x2978('0x1c')](socket);var jayson=require(_0x2978('0x1d'));var client=jayson[_0x2978('0x1e')][_0x2978('0x1f')]({'port':0x232c});var client9002=jayson[_0x2978('0x1e')][_0x2978('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x1b7e53,_0x5a3947,_0x3cdf8c,_0x431055){return new BPromise(function(_0x177081,_0x5ede11){var _0x3db1c6=_0x431055||client;return _0x3db1c6[_0x2978('0x20')](_0x1b7e53,_0x3cdf8c)[_0x2978('0x21')](function(_0x18cf58){logger[_0x2978('0x22')]('SmsMessage,\x20%s,\x20%s',_0x5a3947,_0x2978('0x23'));logger[_0x2978('0x24')](_0x2978('0x25'),_0x5a3947,_0x2978('0x23'),JSON[_0x2978('0x26')](_0x18cf58));if(_0x18cf58[_0x2978('0x27')]){if(_0x18cf58['error'][_0x2978('0x28')]===0x1f4){logger[_0x2978('0x27')]('SmsMessage,\x20%s,\x20%s',_0x5a3947,_0x18cf58[_0x2978('0x27')]['message']);return _0x5ede11(_0x18cf58[_0x2978('0x27')]['message']);}logger[_0x2978('0x27')]('SmsMessage,\x20%s,\x20%s',_0x5a3947,_0x18cf58['error']['message']);return _0x177081(_0x18cf58[_0x2978('0x27')][_0x2978('0x29')]);}else{logger['info'](_0x2978('0x2a'),_0x5a3947,_0x2978('0x23'));_0x177081(_0x18cf58[_0x2978('0x2b')][_0x2978('0x29')]);}})[_0x2978('0x2c')](function(_0x3faaad){logger[_0x2978('0x27')](_0x2978('0x2a'),_0x5a3947,_0x3faaad);_0x5ede11(_0x3faaad);});});}function respondWithStatusCode(_0x593027,_0x4995fb){_0x4995fb=_0x4995fb||0xcc;return function(_0x37cb52){if(_0x37cb52){return _0x593027['sendStatus'](_0x4995fb);}return _0x593027[_0x2978('0x2d')](_0x4995fb)[_0x2978('0x2e')]();};}function respondWithResult(_0x125fbc,_0x2658c1){_0x2658c1=_0x2658c1||0xc8;return function(_0x40b5fe){if(_0x40b5fe){return _0x125fbc[_0x2978('0x2d')](_0x2658c1)[_0x2978('0x2f')](_0x40b5fe);}};}function respondWithFilteredResult(_0x1e2d06,_0x9d3489){return function(_0x31e276){if(_0x31e276){var _0x500958=typeof _0x9d3489[_0x2978('0x30')]===_0x2978('0x31')&&typeof _0x9d3489[_0x2978('0x32')]===_0x2978('0x31');var _0x56eab0=_0x31e276[_0x2978('0x33')];var _0x30c939=_0x500958?0x0:_0x9d3489['offset'];var _0x6348a5=_0x500958?_0x31e276[_0x2978('0x33')]:_0x9d3489[_0x2978('0x30')]+_0x9d3489[_0x2978('0x32')];var _0x1fb3c0;if(_0x6348a5>=_0x56eab0){_0x6348a5=_0x56eab0;_0x1fb3c0=0xc8;}else{_0x1fb3c0=0xce;}_0x1e2d06[_0x2978('0x2d')](_0x1fb3c0);return _0x1e2d06[_0x2978('0x34')](_0x2978('0x35'),_0x30c939+'-'+_0x6348a5+'/'+_0x56eab0)[_0x2978('0x2f')](_0x31e276);}return null;};}function patchUpdates(_0x1c46cb){return function(_0x471a4b){try{jsonpatch['apply'](_0x471a4b,_0x1c46cb,!![]);}catch(_0x5c98cf){return BPromise['reject'](_0x5c98cf);}return _0x471a4b[_0x2978('0x36')]();};}function saveUpdates(_0x1c16fc,_0x5083f3){return function(_0x3b88fd){if(_0x3b88fd){return _0x3b88fd[_0x2978('0x37')](_0x1c16fc)[_0x2978('0x21')](function(_0x3caa64){return _0x3caa64;});}return null;};}function removeEntity(_0x5ec98a,_0x12a4dc){return function(_0x3e2792){if(_0x3e2792){return _0x3e2792[_0x2978('0x38')]()[_0x2978('0x21')](function(){_0x5ec98a['status'](0xcc)[_0x2978('0x2e')]();});}};}function handleEntityNotFound(_0x2f8751,_0x10e2c1){return function(_0x553c54){if(!_0x553c54){_0x2f8751[_0x2978('0x39')](0x194);}return _0x553c54;};}function handleError(_0x49e599,_0x4a55cd){_0x4a55cd=_0x4a55cd||0x1f4;return function(_0x212bdc){logger['error'](_0x212bdc[_0x2978('0x3a')]);if(_0x212bdc[_0x2978('0x3b')]){delete _0x212bdc[_0x2978('0x3b')];}_0x49e599[_0x2978('0x2d')](_0x4a55cd)[_0x2978('0x3c')](_0x212bdc);};}exports['index']=function(_0x29e9ab,_0x307d36){var _0x4adcd8={},_0x2ff3da={},_0xd484c7={'count':0x0,'rows':[]};var _0x8c1455=_[_0x2978('0x3d')](db[_0x2978('0x3e')]['rawAttributes'],function(_0x5093ee){return{'name':_0x5093ee[_0x2978('0x3f')],'type':_0x5093ee['type'][_0x2978('0x40')]};});_0x2ff3da[_0x2978('0x41')]=_['map'](_0x8c1455,'name');_0x2ff3da[_0x2978('0x42')]=_[_0x2978('0x43')](_0x29e9ab['query']);_0x2ff3da[_0x2978('0x44')]=_['intersection'](_0x2ff3da[_0x2978('0x41')],_0x2ff3da['query']);_0x4adcd8[_0x2978('0x45')]=_['intersection'](_0x2ff3da['model'],qs['fields'](_0x29e9ab[_0x2978('0x42')][_0x2978('0x46')]));_0x4adcd8[_0x2978('0x45')]=_0x4adcd8[_0x2978('0x45')][_0x2978('0x47')]?_0x4adcd8['attributes']:_0x2ff3da[_0x2978('0x41')];if(!_0x29e9ab[_0x2978('0x42')][_0x2978('0x48')](_0x2978('0x49'))){_0x4adcd8[_0x2978('0x32')]=qs['limit'](_0x29e9ab[_0x2978('0x42')][_0x2978('0x32')]);_0x4adcd8['offset']=qs['offset'](_0x29e9ab['query'][_0x2978('0x30')]);}_0x4adcd8['order']=qs[_0x2978('0x4a')](_0x29e9ab['query'][_0x2978('0x4a')]);_0x4adcd8['where']=qs[_0x2978('0x44')](_[_0x2978('0x4b')](_0x29e9ab['query'],_0x2ff3da[_0x2978('0x44')]),_0x8c1455);if(_0x29e9ab[_0x2978('0x42')][_0x2978('0x4c')]){_0x4adcd8[_0x2978('0x4d')]=_['merge'](_0x4adcd8['where'],{'$or':_[_0x2978('0x3d')](_0x8c1455,function(_0x23a5de){if(_0x23a5de['type']!=='VIRTUAL'){var _0x3d6850={};_0x3d6850[_0x23a5de[_0x2978('0x3b')]]={'$like':'%'+_0x29e9ab[_0x2978('0x42')][_0x2978('0x4c')]+'%'};return _0x3d6850;}})});}_0x4adcd8=_[_0x2978('0x4e')]({},_0x4adcd8,_0x29e9ab[_0x2978('0x4f')]);var _0x306d55={'where':_0x4adcd8[_0x2978('0x4d')]};return db[_0x2978('0x3e')]['count'](_0x306d55)[_0x2978('0x21')](function(_0x28ef21){_0xd484c7[_0x2978('0x33')]=_0x28ef21;if(_0x29e9ab[_0x2978('0x42')][_0x2978('0x50')]){_0x4adcd8['include']=[{'all':!![]}];}return db[_0x2978('0x3e')][_0x2978('0x51')](_0x4adcd8);})[_0x2978('0x21')](function(_0x203070){_0xd484c7['rows']=_0x203070;return _0xd484c7;})[_0x2978('0x21')](respondWithFilteredResult(_0x307d36,_0x4adcd8))[_0x2978('0x2c')](handleError(_0x307d36,null));};exports[_0x2978('0x52')]=function(_0x146c88,_0x49ca6b){var _0x2f3674={'raw':!![],'where':{'id':_0x146c88[_0x2978('0x53')]['id']}},_0x27821b={};_0x27821b['model']=_[_0x2978('0x43')](db['SmsMessage'][_0x2978('0x54')]);_0x27821b[_0x2978('0x42')]=_[_0x2978('0x43')](_0x146c88[_0x2978('0x42')]);_0x27821b['filters']=_[_0x2978('0x55')](_0x27821b[_0x2978('0x41')],_0x27821b[_0x2978('0x42')]);_0x2f3674[_0x2978('0x45')]=_[_0x2978('0x55')](_0x27821b[_0x2978('0x41')],qs[_0x2978('0x46')](_0x146c88[_0x2978('0x42')][_0x2978('0x46')]));_0x2f3674[_0x2978('0x45')]=_0x2f3674[_0x2978('0x45')][_0x2978('0x47')]?_0x2f3674[_0x2978('0x45')]:_0x27821b[_0x2978('0x41')];if(_0x146c88[_0x2978('0x42')][_0x2978('0x50')]){_0x2f3674[_0x2978('0x56')]=[{'all':!![]}];}_0x2f3674=_[_0x2978('0x4e')]({},_0x2f3674,_0x146c88[_0x2978('0x4f')]);return db[_0x2978('0x3e')][_0x2978('0x57')](_0x2f3674)[_0x2978('0x21')](handleEntityNotFound(_0x49ca6b,null))[_0x2978('0x21')](respondWithResult(_0x49ca6b,null))[_0x2978('0x2c')](handleError(_0x49ca6b,null));};exports[_0x2978('0x58')]=function(_0x113139,_0x520708){return db[_0x2978('0x3e')][_0x2978('0x58')](_0x113139[_0x2978('0x59')],{})[_0x2978('0x21')](respondWithResult(_0x520708,0xc9))[_0x2978('0x2c')](handleError(_0x520708,null));};exports[_0x2978('0x37')]=function(_0x33a8fa,_0x1f31d2){if(_0x33a8fa[_0x2978('0x59')]['id']){delete _0x33a8fa[_0x2978('0x59')]['id'];}return db[_0x2978('0x3e')][_0x2978('0x57')]({'where':{'id':_0x33a8fa[_0x2978('0x53')]['id']}})[_0x2978('0x21')](handleEntityNotFound(_0x1f31d2,null))[_0x2978('0x21')](saveUpdates(_0x33a8fa['body'],null))['then'](respondWithResult(_0x1f31d2,null))[_0x2978('0x2c')](handleError(_0x1f31d2,null));};exports[_0x2978('0x38')]=function(_0x51c03b,_0x28baf7){return db[_0x2978('0x3e')][_0x2978('0x57')]({'where':{'id':_0x51c03b[_0x2978('0x53')]['id']}})['then'](handleEntityNotFound(_0x28baf7,null))['then'](removeEntity(_0x28baf7,null))[_0x2978('0x2c')](handleError(_0x28baf7,null));};exports[_0x2978('0x5a')]=function(_0x334b03,_0x4a347a){return db[_0x2978('0x3e')][_0x2978('0x5a')]()[_0x2978('0x21')](respondWithResult(_0x4a347a,null))[_0x2978('0x2c')](handleError(_0x4a347a,null));};var interaction_log=require(_0x2978('0x14'))(_0x2978('0x5b'));exports[_0x2978('0x5c')]=function(_0x15cbfb,_0x204dc2,_0x12f9d8){var _0x119318={'agent':{},'channel':_0x2978('0x5d')};if(_0x15cbfb[_0x2978('0x59')]['id']){delete _0x15cbfb[_0x2978('0x59')]['id'];}_0x15cbfb['body'][_0x2978('0x5e')]=!![];_0x15cbfb['body'][_0x2978('0x5f')]=moment()[_0x2978('0x60')](_0x2978('0x61'));_0x15cbfb[_0x2978('0x59')]['UserId']=_0x15cbfb[_0x2978('0x59')]['UserId']||_0x15cbfb['user']['id'];_0x119318['agent']['id']=_0x15cbfb['body'][_0x2978('0x62')];return db[_0x2978('0x3e')]['find']({'where':{'id':_0x15cbfb[_0x2978('0x53')]['id'],'UserId':null}})[_0x2978('0x21')](handleEntityNotFound(_0x204dc2,null))[_0x2978('0x21')](saveUpdates(_0x15cbfb['body'],null))['then'](function(_0x11ac0b){if(_0x11ac0b){_0x119318[_0x2978('0x29')]=_0x11ac0b['get']({'plain':!![]});return db[_0x2978('0x63')]['find']({'where':{'id':_0x11ac0b[_0x2978('0x64')]}});}return null;})[_0x2978('0x21')](handleEntityNotFound(_0x204dc2,null))[_0x2978('0x21')](function(_0x1c4109){if(_0x1c4109){return _0x1c4109['update']({'UserId':_0x15cbfb[_0x2978('0x59')][_0x2978('0x62')],'read1stAt':_['isNil'](_0x1c4109['read1stAt'])?moment()[_0x2978('0x60')](_0x2978('0x61')):undefined});}return null;})[_0x2978('0x21')](function(_0x2cf33f){if(_0x2cf33f){_0x119318['interaction']=_0x2cf33f[_0x2978('0x65')]({'plain':!![]});interaction_log[_0x2978('0x22')](_0x2978('0x66'),_0x15cbfb['user']['id'],_0x15cbfb[_0x2978('0x67')]['name'],_0x15cbfb['user'][_0x2978('0x68')],_0x119318[_0x2978('0x69')]['id'],_0x15cbfb['body']?JSON[_0x2978('0x26')](_0x15cbfb['body']):_0x2978('0x6a'));return respondWithRpcPromise('AcceptMessage',_0x2978('0x6b'),_0x119318);}return null;})[_0x2978('0x21')](function(_0x322435){var _0x3b43f8=_0x2978('0x6c')+_0x322435[_0x2978('0x29')]['ContactId'];return db[_0x2978('0x6d')]['query'](_0x3b43f8,{'type':db['Sequelize']['QueryTypes'][_0x2978('0x6e')],'raw':!![]})['then'](function(_0x3ab8ab){return _0x3ab8ab;});})[_0x2978('0x21')](function(_0x117a83){if(_0x117a83){_0x119318[_0x2978('0x29')][_0x2978('0x6f')]=_0x117a83[0x0];if(!_0x15cbfb[_0x2978('0x59')][_0x2978('0x62')])return;return db[_0x2978('0x70')][_0x2978('0x57')]({'where':{'id':_0x15cbfb[_0x2978('0x59')][_0x2978('0x62')],'role':_0x2978('0x71')},'attributes':['id',_0x2978('0x3b'),_0x2978('0x72'),'email',_0x2978('0x73')],'raw':!![]});}return null;})[_0x2978('0x21')](function(_0x3c2230){if(!_0x3c2230)return null;_0x119318[_0x2978('0x29')][_0x2978('0x71')]=_0x3c2230;return _0x119318;})[_0x2978('0x21')](function(_0x46a2f3){if(_0x46a2f3){if(_0x15cbfb[_0x2978('0x59')][_0x2978('0x74')]){_0x119318['message'][_0x2978('0x75')]=util[_0x2978('0x60')](_0x2978('0x76'),_0x15cbfb['user'][_0x2978('0x3b')]);_0x119318[_0x2978('0x29')][_0x2978('0x77')]=_0x119318[_0x2978('0x77')];_0x119318['message'][_0x2978('0x78')]=_0x119318['channel'];_0x119318[_0x2978('0x29')]['event']=_0x2978('0x5c');return respondWithRpcPromise(_0x2978('0x79'),'EventManager',{'event':_0x2978('0x7a'),'message':_0x119318['message']},client9002)[_0x2978('0x21')](function(){return _0x119318;});}return _0x119318;}return null;})[_0x2978('0x21')](respondWithResult(_0x204dc2,null))[_0x2978('0x2c')](handleError(_0x204dc2,null));};var interaction_log=require(_0x2978('0x14'))(_0x2978('0x5b'));exports[_0x2978('0x7b')]=function(_0x4c2e4f,_0x14e14b,_0x3f14a9){var _0x310e8f={'agent':{},'channel':_0x2978('0x5d')};if(_0x4c2e4f['body']['id']){delete _0x4c2e4f['body']['id'];}_0x4c2e4f[_0x2978('0x59')]['UserId']=_0x4c2e4f[_0x2978('0x59')][_0x2978('0x62')]||_0x4c2e4f[_0x2978('0x67')]['id'];_0x310e8f[_0x2978('0x71')]['id']=_0x4c2e4f[_0x2978('0x59')]['UserId'];return db['SmsMessage'][_0x2978('0x57')]({'where':{'id':_0x4c2e4f[_0x2978('0x53')]['id'],'UserId':null}})[_0x2978('0x21')](handleEntityNotFound(_0x14e14b,null))[_0x2978('0x21')](function(_0xb21d6b){if(_0xb21d6b){_0x310e8f['message']=_0xb21d6b[_0x2978('0x65')]({'plain':!![]});return db[_0x2978('0x63')][_0x2978('0x57')]({'where':{'id':_0xb21d6b[_0x2978('0x64')]}});}return null;})[_0x2978('0x21')](handleEntityNotFound(_0x14e14b,null))['then'](function(_0x4f281d){if(_0x4f281d){_0x310e8f['interaction']=_0x4f281d[_0x2978('0x65')]({'plain':!![]});interaction_log[_0x2978('0x22')](_0x2978('0x7c'),_0x4c2e4f[_0x2978('0x67')]['id'],_0x4c2e4f[_0x2978('0x67')]['name'],_0x4c2e4f['user']['role'],_0x310e8f[_0x2978('0x69')]['id'],_0x4c2e4f[_0x2978('0x59')]?JSON[_0x2978('0x26')](_0x4c2e4f[_0x2978('0x59')]):_0x2978('0x6a'));return respondWithRpcPromise(_0x2978('0x7d'),_0x2978('0x7e'),_0x310e8f);}return null;})[_0x2978('0x21')](function(_0x1c7d16){var _0x347d98=_0x2978('0x6c')+_0x1c7d16['message']['ContactId'];return db[_0x2978('0x6d')][_0x2978('0x42')](_0x347d98,{'type':db[_0x2978('0x7f')]['QueryTypes'][_0x2978('0x6e')],'raw':!![]})['then'](function(_0x48f0f7){return _0x48f0f7;});})[_0x2978('0x21')](function(_0xdbb527){if(_0xdbb527){_0x310e8f[_0x2978('0x29')][_0x2978('0x6f')]=_0xdbb527[0x0];if(!_0x4c2e4f[_0x2978('0x59')]['UserId'])return;return db['User'][_0x2978('0x57')]({'where':{'id':_0x4c2e4f[_0x2978('0x59')][_0x2978('0x62')],'role':'agent'},'attributes':['id','name','fullname',_0x2978('0x80'),_0x2978('0x73')],'raw':!![]});}return null;})[_0x2978('0x21')](function(_0x4bc467){if(!_0x4bc467)return null;_0x310e8f[_0x2978('0x29')][_0x2978('0x71')]=_0x4bc467;return _0x310e8f;})[_0x2978('0x21')](function(_0x22e0f4){if(_0x22e0f4){_0x22e0f4[_0x2978('0x29')][_0x2978('0x75')]=util[_0x2978('0x60')](_0x2978('0x76'),_0x4c2e4f[_0x2978('0x67')][_0x2978('0x3b')]);_0x22e0f4[_0x2978('0x29')]['channel']=_0x310e8f[_0x2978('0x77')];_0x22e0f4[_0x2978('0x29')][_0x2978('0x78')]=_0x310e8f['channel'];_0x22e0f4[_0x2978('0x29')][_0x2978('0x81')]=_0x2978('0x7b');respondWithRpcPromise(_0x2978('0x79'),_0x2978('0x79'),{'event':_0x2978('0x82'),'message':_0x22e0f4[_0x2978('0x29')]},client9002);return _0x310e8f;}return null;})[_0x2978('0x21')](respondWithResult(_0x14e14b,null))[_0x2978('0x2c')](handleError(_0x14e14b,null));};exports[_0x2978('0x2d')]=function(_0x1d6957,_0x2ddcc2,_0x204daa){if(_0x1d6957[_0x2978('0x59')]['id']){delete _0x1d6957[_0x2978('0x59')]['id'];}var _0x3f41e1;return db[_0x2978('0x3e')][_0x2978('0x57')]({'where':{'id':_0x1d6957[_0x2978('0x53')]['id']}})[_0x2978('0x21')](handleEntityNotFound(_0x2ddcc2,null))[_0x2978('0x21')](function(_0x29b39e){if(_0x29b39e){_0x3f41e1=_0x29b39e;return db['SmsAccount'][_0x2978('0x57')]({'where':{'id':_0x29b39e[_0x2978('0x83')]}});}})[_0x2978('0x21')](handleEntityNotFound(_0x2ddcc2,null))[_0x2978('0x21')](function(_0x529e81){if(_0x529e81){logger[_0x2978('0x24')](_0x2978('0x25'),'status',_0x2978('0x84'),_0x529e81[_0x2978('0x85')],util[_0x2978('0x86')](_0x1d6957[_0x2978('0x59')],{'showHidden':![],'depth':null}));switch(_0x529e81['type']){case'twilio':if(_0x1d6957[_0x2978('0x59')][_0x2978('0x87')]&&_0x1d6957[_0x2978('0x59')]['MessageSid']===_0x3f41e1[_0x2978('0x88')]){return _0x3f41e1['update']({'read':!![]});}else{logger[_0x2978('0x27')](_0x2978('0x89'),_0x2978('0x2d'),'twilio',util['inspect'](_0x1d6957[_0x2978('0x59')],{'showHidden':![],'depth':null}));}break;case _0x2978('0x8a'):if(_0x1d6957[_0x2978('0x59')][_0x2978('0x8b')]&&_0x1d6957['body']['MessageUUID']===_0x3f41e1[_0x2978('0x88')]&&_[_0x2978('0x8c')]([_0x2978('0x8d'),_0x2978('0x8e')],_0x1d6957[_0x2978('0x59')][_0x2978('0x8f')])>=0x0){return _0x3f41e1[_0x2978('0x37')]({'read':!![]});}else{logger[_0x2978('0x27')](_0x2978('0x89'),'status',_0x2978('0x90'),util[_0x2978('0x86')](_0x1d6957[_0x2978('0x59')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x2bee10=_0x1d6957[_0x2978('0x59')][_0x2978('0x91')][0x0];if(_0x2bee10[_0x2978('0x2d')][_0x2978('0x92')]===_0x2978('0x93')){return _0x3f41e1[_0x2978('0x37')]({'read':!![]});}else{logger[_0x2978('0x27')](_0x2978('0x89'),_0x2978('0x2d'),_0x2978('0x94'),util[_0x2978('0x86')](_0x1d6957[_0x2978('0x59')],{'showHidden':![],'depth':null}));}break;}return _0x3f41e1;}})[_0x2978('0x21')](respondWithResult(_0x2ddcc2,null))[_0x2978('0x2c')](handleError(_0x2ddcc2,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index db7111d..2355dcf 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 _0xfbba=['events','../../mysqldb','setMaxListeners','save','update','emit','hook','exports'];(function(_0x5d2365,_0x16ca11){var _0x41c80f=function(_0x296060){while(--_0x296060){_0x5d2365['push'](_0x5d2365['shift']());}};_0x41c80f(++_0x16ca11);}(_0xfbba,0x100));var _0xafbb=function(_0x5b9236,_0x35d61d){_0x5b9236=_0x5b9236-0x0;var _0x466544=_0xfbba[_0x5b9236];return _0x466544;};'use strict';var EventEmitter=require(_0xafbb('0x0'));var SmsMessage=require(_0xafbb('0x1'))['db']['SmsMessage'];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0xafbb('0x2')](0x0);var events={'afterCreate':_0xafbb('0x3'),'afterUpdate':_0xafbb('0x4'),'afterDestroy':'remove'};function emitEvent(_0x2e72a5){return function(_0x5daf60,_0x491865,_0x267bea){SmsMessageEvents[_0xafbb('0x5')](_0x2e72a5+':'+_0x5daf60['id'],_0x5daf60);SmsMessageEvents[_0xafbb('0x5')](_0x2e72a5,_0x5daf60);_0x267bea(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsMessage[_0xafbb('0x6')](e,emitEvent(event));}}module[_0xafbb('0x7')]=SmsMessageEvents; \ No newline at end of file +var _0xd266=['events','../../mysqldb','SmsMessage','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports'];(function(_0x350905,_0x43ddd0){var _0x575740=function(_0x5f195b){while(--_0x5f195b){_0x350905['push'](_0x350905['shift']());}};_0x575740(++_0x43ddd0);}(_0xd266,0xf0));var _0x6d26=function(_0x15fcc6,_0x337a40){_0x15fcc6=_0x15fcc6-0x0;var _0x425150=_0xd266[_0x15fcc6];return _0x425150;};'use strict';var EventEmitter=require(_0x6d26('0x0'));var SmsMessage=require(_0x6d26('0x1'))['db'][_0x6d26('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x6d26('0x3')](0x0);var events={'afterCreate':_0x6d26('0x4'),'afterUpdate':_0x6d26('0x5'),'afterDestroy':'remove'};function emitEvent(_0x43bff7){return function(_0x3184d9,_0xc5f61e,_0x39d983){SmsMessageEvents['emit'](_0x43bff7+':'+_0x3184d9['id'],_0x3184d9);SmsMessageEvents[_0x6d26('0x6')](_0x43bff7,_0x3184d9);_0x39d983(null);};}for(var e in events){if(events[_0x6d26('0x7')](e)){var event=events[e];SmsMessage[_0x6d26('0x8')](e,emitEvent(event));}}module[_0x6d26('0x9')]=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index b6df97c..dd723a6 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 _0x710e=['https://smsapi.connectel.se/api/v2/send/','requestid','deliveryReport','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','%s:%s','https://rest.clicksend.com/v3/sms/send','format','Basic\x20%s','toString','http_code','data','queued_count','head','messages','message_id','clickSend','plivo','authId','https://api.plivo.com/v1/Account/%s/Message/','base64','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','token','application/json','IBSSO\x20','csc','crypto','login','timestamp','keys','sort','length','createHash','md5','digest','hex','signature=','GET','/external/get/send.php?','id_sms','Missing\x20parameters:\x20apiKey','apiKey','apiMessageId','clickatell','bandwidth','https://messaging.bandwidth.com/api/v2/users/','accountId','/messages','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','Token\x20not\x20received','finally','utf8mb4','lodash','api','moment','bluebird','request-promise','path','../../config/environment','./smsMessage.attributes','define','SmsMessage','sms_messages','messageId','models','get','direction','toLowerCase','out','secret','SmsInteraction','findOne','SmsInteractionId','then','update','catch','error','SmsAccount','find','SmsAccountId','type','authToken','phone','create','body','remote','/api/sms/messages/','/status?token=','sid','afterCreate','twilio','inspect','SmsMessage,\x20%s,\x20%s,\x20%s','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','username','smsMethod','sender','login?username=','&password=','password','split','POST','user_key','session_key','total_sent','internal_order_id','read','Missing\x20parameters:\x20username,\x20password','connectel','senderString'];(function(_0x243694,_0x5619a3){var _0x16b6d5=function(_0x271100){while(--_0x271100){_0x243694['push'](_0x243694['shift']());}};_0x16b6d5(++_0x5619a3);}(_0x710e,0xb6));var _0xe710=function(_0x273419,_0x4c3fb5){_0x273419=_0x273419-0x0;var _0x32d493=_0x710e[_0x273419];return _0x32d493;};'use strict';var _=require(_0xe710('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xe710('0x1'));var moment=require(_0xe710('0x2'));var BPromise=require(_0xe710('0x3'));var rp=require(_0xe710('0x4'));var fs=require('fs');var path=require(_0xe710('0x5'));var rimraf=require('rimraf');var config=require(_0xe710('0x6'));var attributes=require(_0xe710('0x7'));module['exports']=function(_0x5a9e4c,_0xd8271b){return _0x5a9e4c[_0xe710('0x8')](_0xe710('0x9'),attributes,{'tableName':_0xe710('0xa'),'paranoid':![],'indexes':[{'name':_0xe710('0xb'),'fields':[_0xe710('0xb')]},{'name':'fti_sms_messages','fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x21aa4f,_0x1d1160,_0x3c11a4){var _0x3a8adf=_0x5a9e4c[_0xe710('0xc')];var _0xef820e=_0x21aa4f[_0xe710('0xd')]({'plain':!![]});if(_0xef820e[_0xe710('0xe')][_0xe710('0xf')]()==='in'||_0xef820e[_0xe710('0xe')][_0xe710('0xf')]()===_0xe710('0x10')&&!_0xef820e[_0xe710('0x11')]&&!_['isNil'](_0xef820e['UserId'])){_0x3a8adf[_0xe710('0x12')][_0xe710('0x13')]({'where':{'id':_0xef820e[_0xe710('0x14')]}})[_0xe710('0x15')](function(_0x422a84){if(_0x422a84){_0x422a84[_0xe710('0x16')]({'lastMsgAt':_0xef820e['createdAt'],'lastMsgDirection':_0xef820e[_0xe710('0xe')][_0xe710('0xf')]()});}})[_0xe710('0x17')](function(_0x145312){console[_0xe710('0x18')](_0x145312);});}if(_0xef820e[_0xe710('0xe')]===_0xe710('0x10')&&!_0xef820e[_0xe710('0x11')]){var _0x3daac1;_0x3a8adf[_0xe710('0x19')][_0xe710('0x1a')]({'where':{'id':_0xef820e[_0xe710('0x1b')]},'raw':!![]})[_0xe710('0x15')](function(_0x5f28a4){_0x3daac1=_0x5f28a4;if(_0x3daac1&&_0x3daac1[_0xe710('0x1c')]){switch(_0x3daac1['type']){case'twilio':var _0x5dbfa5=require('twilio');if(_0x3daac1['accountSid']&&_0x3daac1[_0xe710('0x1d')]&&_0x3daac1[_0xe710('0x1e')]){var _0x1c3d82=new _0x5dbfa5(_0x3daac1['accountSid'],_0x3daac1[_0xe710('0x1d')]);_0x1c3d82['messages'][_0xe710('0x1f')]({'body':_0xef820e[_0xe710('0x20')],'to':_0xef820e[_0xe710('0x1e')],'from':_0x3daac1[_0xe710('0x1e')],'statusCallback':_0x3daac1[_0xe710('0x21')]+_0xe710('0x22')+_0xef820e['id']+_0xe710('0x23')+_0x3daac1['token']})['then'](function(_0x2401ac){if(_0x2401ac[_0xe710('0x24')]){return _0x21aa4f['update']({'messageId':_0x2401ac[_0xe710('0x24')]});}})[_0xe710('0x17')](function(_0x34ab78){logger[_0xe710('0x18')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xe710('0x25'),_0xe710('0x26'),util[_0xe710('0x27')](_0x34ab78,{'showHidden':![],'depth':null}));});}else{logger[_0xe710('0x18')](_0xe710('0x28'),_0xe710('0x25'),_0xe710('0x26'),_0xe710('0x29'));}break;case _0xe710('0x2a'):var _0x2541ce=_0xe710('0x2b');if(_0x3daac1[_0xe710('0x2c')]&&_0x3daac1['password']){var _0x20cf73={'recipient':[_0xef820e[_0xe710('0x1e')]],'message':_0xef820e[_0xe710('0x20')],'message_type':_0x3daac1[_0xe710('0x2d')]};if(_0x3daac1[_0xe710('0x2d')]&&_0x3daac1[_0xe710('0x2d')]!=='SI'){_0x20cf73[_0xe710('0x2e')]=_0x3daac1[_0xe710('0x1e')];}var _0x1a0989={'url':_0x2541ce+_0xe710('0x2f')+_0x3daac1[_0xe710('0x2c')]+_0xe710('0x30')+_0x3daac1[_0xe710('0x31')],'method':'GET'};rp(_0x1a0989)[_0xe710('0x15')](function(_0x5c816c){var _0x4e8aff=_0x5c816c[_0xe710('0x32')](';');var _0x1482f8={'user_key':_0x4e8aff[0x0],'session_key':_0x4e8aff[0x1]};_0x1a0989={'url':_0x2541ce+'sms','method':_0xe710('0x33'),'headers':{'user_key':_0x1482f8[_0xe710('0x34')],'Session_key':_0x1482f8[_0xe710('0x35')]},'json':!![],'body':_0x20cf73};return rp(_0x1a0989);})[_0xe710('0x15')](function(_0x167268){if(_0x167268[_0xe710('0x36')]>=0x1){var _0x148fe2={'messageId':_0x167268[_0xe710('0x37')]};if(_0x3daac1['smsMethod']!=='GP'||!_0x3daac1['deliveryReport']){_0x148fe2[_0xe710('0x38')]=!![];}return _0x21aa4f[_0xe710('0x16')](_0x148fe2);}else{return logger['error'](_0xe710('0x28'),_0xe710('0x25'),_0xe710('0x2a'),util[_0xe710('0x27')](_0x167268,{'showHidden':![],'depth':null}));}})[_0xe710('0x17')](function(_0x5ce14d){return logger[_0xe710('0x18')](_0xe710('0x28'),_0xe710('0x25'),_0xe710('0x2a'),util[_0xe710('0x27')](_0x5ce14d,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xe710('0x28'),_0xe710('0x25'),_0xe710('0x2a'),_0xe710('0x39'));}break;case _0xe710('0x3a'):if(_0x3daac1['authToken']){var _0x44af9f={'recipient':_0xef820e[_0xe710('0x1e')],'message':_0xef820e['body'],'sender':_0x3daac1[_0xe710('0x3b')]||_0x3daac1[_0xe710('0x1e')],'authorization':_0x3daac1[_0xe710('0x1d')]};var _0x1d1160={'method':_0xe710('0x33'),'uri':_0xe710('0x3c'),'body':_0x44af9f,'json':!![]};rp(_0x1d1160)[_0xe710('0x15')](function(_0x424b40){var _0x435202={'messageId':_0x424b40[_0xe710('0x3d')]};if(!_0x3daac1[_0xe710('0x3e')]){_0x435202[_0xe710('0x38')]=!![];}return _0x21aa4f[_0xe710('0x16')](_0x435202);})[_0xe710('0x17')](function(_0x446c90){logger[_0xe710('0x18')](_0xe710('0x28'),_0xe710('0x25'),_0xe710('0x3a'),util[_0xe710('0x27')](_0x446c90,{'showHidden':![],'depth':null}));});}else{logger[_0xe710('0x18')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xe710('0x25'),_0xe710('0x3a'),_0xe710('0x3f'));}break;case _0xe710('0x40'):if(_0x3daac1[_0xe710('0x2c')]&&_0x3daac1[_0xe710('0x31')]){var _0x44af9f={'messages':[{'source':_0xe710('0x41'),'to':_0xef820e[_0xe710('0x1e')],'body':_0xef820e[_0xe710('0x20')],'from':_0x3daac1[_0xe710('0x3b')]||_0x3daac1['phone']}]};var _0x528a91=util['format'](_0xe710('0x42'),_0x3daac1[_0xe710('0x2c')],_0x3daac1['password']);var _0x1d1160={'method':'POST','uri':_0xe710('0x43'),'body':_0x44af9f,'headers':{'Authorization':util[_0xe710('0x44')](_0xe710('0x45'),new Buffer(_0x528a91)[_0xe710('0x46')]('base64'))},'json':!![]};rp(_0x1d1160)[_0xe710('0x15')](function(_0x1307ac){if(_0x1307ac[_0xe710('0x47')]>=0xc8&&_0x1307ac[_0xe710('0x47')]<=0xce){if(_0x1307ac[_0xe710('0x48')]&&_0x1307ac[_0xe710('0x48')][_0xe710('0x49')]>0x0){var _0x597f74=_[_0xe710('0x4a')](_0x1307ac[_0xe710('0x48')][_0xe710('0x4b')]);var _0x3d5de7={'messageId':_0x597f74[_0xe710('0x4c')]};if(!_0x3daac1[_0xe710('0x3e')]){_0x3d5de7[_0xe710('0x38')]=!![];}return _0x21aa4f['update'](_0x3d5de7);}else{logger[_0xe710('0x18')](_0xe710('0x28'),_0xe710('0x25'),'clickSend',util['inspect'](_0x1307ac,{'showHidden':![],'depth':null}));}}else{logger[_0xe710('0x18')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xe710('0x4d'),util[_0xe710('0x27')](_0x1307ac,{'showHidden':![],'depth':null}));}})['catch'](function(_0x5e4943){logger[_0xe710('0x18')](_0xe710('0x28'),'afterCreate',_0xe710('0x4d'),util[_0xe710('0x27')](_0x5e4943,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xe710('0x28'),_0xe710('0x25'),_0xe710('0x4d'),_0xe710('0x39'));}break;case _0xe710('0x4e'):if(_0x3daac1[_0xe710('0x4f')]&&_0x3daac1[_0xe710('0x1d')]){var _0x44af9f={'dst':_0xef820e['phone'],'text':_0xef820e['body'],'src':_0x3daac1[_0xe710('0x3b')]||_0x3daac1[_0xe710('0x1e')],'url':_0x3daac1['remote']+_0xe710('0x22')+_0xef820e['id']+_0xe710('0x23')+_0x3daac1['token']};var _0x528a91=util[_0xe710('0x44')](_0xe710('0x42'),_0x3daac1['authId'],_0x3daac1[_0xe710('0x1d')]);var _0x1d1160={'method':_0xe710('0x33'),'uri':util['format'](_0xe710('0x50'),_0x3daac1[_0xe710('0x4f')]),'body':_0x44af9f,'headers':{'Authorization':util[_0xe710('0x44')](_0xe710('0x45'),new Buffer(_0x528a91)[_0xe710('0x46')](_0xe710('0x51')))},'json':!![]};rp(_0x1d1160)['then'](function(_0x2275b){var _0x441f67={'messageId':_0x2275b[_0xe710('0x52')][0x0]};return _0x21aa4f['update'](_0x441f67);})[_0xe710('0x17')](function(_0x60fc34){logger['error'](_0xe710('0x28'),'afterCreate',_0xe710('0x4e'),util[_0xe710('0x27')](_0x60fc34,{'showHidden':![],'depth':null}));});}else{logger[_0xe710('0x18')](_0xe710('0x28'),_0xe710('0x25'),'plivo',_0xe710('0x53'));}break;case _0xe710('0x54'):if(_0x3daac1['username']&&_0x3daac1[_0xe710('0x31')]){if(_0x3daac1[_0xe710('0x55')]){var _0x102bdd={'method':'POST','uri':_0x3daac1[_0xe710('0x55')]+'/auth/1/session','body':{'username':_0x3daac1[_0xe710('0x2c')],'password':_0x3daac1[_0xe710('0x31')]},'json':!![]};return rp(_0x102bdd)[_0xe710('0x15')](function(_0x4557b0){var _0x36750e={'method':_0xe710('0x33'),'uri':_0x3daac1[_0xe710('0x55')]+'/sms/2/text/advanced','body':{'messages':[{'from':_0x3daac1[_0xe710('0x1e')],'destinations':[{'to':_0xef820e['phone']}],'text':_0xef820e[_0xe710('0x20')],'notifyUrl':_0x3daac1[_0xe710('0x21')]+_0xe710('0x22')+_0xef820e['id']+_0xe710('0x23')+_0x3daac1[_0xe710('0x56')],'notifyContentType':_0xe710('0x57'),'callbackData':_0x3daac1[_0xe710('0x1e')]+';'+_0xef820e[_0xe710('0x20')]}]},'headers':{'Authorization':_0xe710('0x58')+_0x4557b0[_0xe710('0x56')]},'json':!![]};return rp(_0x36750e)[_0xe710('0x15')](function(_0x802c48){if(_0x802c48['messages']){var _0x43e2b7={'messageId':_0x802c48[_0xe710('0x4b')][0x0]['messageId']};if(!_0x3daac1[_0xe710('0x3e')]){_0x43e2b7['read']=!![];}return _0x21aa4f[_0xe710('0x16')](_0x43e2b7);}else{return logger[_0xe710('0x18')](_0xe710('0x28'),_0xe710('0x25'),'infobip',util['inspect'](_0x802c48,{'showHidden':![],'depth':null}));}});})[_0xe710('0x17')](function(_0x3df7bc){return logger[_0xe710('0x18')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xe710('0x25'),'infobip',util[_0xe710('0x27')](_0x3df7bc,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xe710('0x25'),'infobip','Missing\x20parameters:\x20base_url');}}else{logger[_0xe710('0x18')](_0xe710('0x28'),'afterCreate',_0xe710('0x54'),_0xe710('0x39'));}break;case _0xe710('0x59'):var _0x5e4e23=require(_0xe710('0x5a'));if(_0x3daac1['apiKey']){var _0xcee43b={};_0xcee43b[_0xe710('0x5b')]=_0x3daac1[_0xe710('0x2c')];_0xcee43b[_0xe710('0x1e')]=_0xef820e[_0xe710('0x1e')];_0xcee43b[_0xe710('0x2e')]=_0x3daac1[_0xe710('0x1e')];_0xcee43b['text']=_0xef820e['body'];_0xcee43b[_0xe710('0x5c')]=+new Date();var _0x2dae6b='';var _0x2ac34d='';var _0x4d1b3a=Object[_0xe710('0x5d')](_0xcee43b);_0x4d1b3a[_0xe710('0x5e')]();for(var _0x27cd4e=0x0;_0x27cd4e<_0x4d1b3a[_0xe710('0x5f')];_0x27cd4e++){if(_0x2dae6b!=''){_0x2dae6b+='&';}_0x2dae6b+=_0x4d1b3a[_0x27cd4e]+'='+encodeURIComponent(_0xcee43b[_0x4d1b3a[_0x27cd4e]]);_0x2ac34d+=_0xcee43b[_0x4d1b3a[_0x27cd4e]];}_0x2ac34d+=_0x3daac1['apiKey'];_0x2ac34d=_0x5e4e23[_0xe710('0x60')](_0xe710('0x61'))[_0xe710('0x16')](_0x2ac34d)[_0xe710('0x62')](_0xe710('0x63'));if(_0x2dae6b!==''){_0x2dae6b+='&';}_0x2dae6b+=_0xe710('0x64')+_0x2ac34d;var _0x1a0989={'method':_0xe710('0x65'),'uri':_0x3daac1[_0xe710('0x55')]+_0xe710('0x66')+_0x2dae6b,'json':!![]};return rp(_0x1a0989)[_0xe710('0x15')](function(_0xb3aeb6){var _0x480e43=Object[_0xe710('0x5d')](_0xb3aeb6);if(_0xb3aeb6[_0x480e43[0x0]][_0xe710('0x18')]&&parseInt(_0xb3aeb6[_0x480e43[0x0]]['error'])===0x0){var _0x45a795={'messageId':_0xb3aeb6[_0x480e43[0x0]][_0xe710('0x67')]};if(!_0x3daac1['deliveryReport']){_0x45a795[_0xe710('0x38')]=!![];}return _0x21aa4f[_0xe710('0x16')](_0x45a795);}else{return logger['error'](_0xe710('0x28'),_0xe710('0x25'),'csc',util[_0xe710('0x27')](_0xb3aeb6[_0xe710('0x18')],{'showHidden':![],'depth':null}));}})[_0xe710('0x17')](function(_0x2710ee){return logger[_0xe710('0x18')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xe710('0x59'),util[_0xe710('0x27')](_0x2710ee,{'showHidden':![],'depth':null}));});}else{logger[_0xe710('0x18')](_0xe710('0x28'),_0xe710('0x25'),_0xe710('0x59'),_0xe710('0x68'));}break;case'clickatell':if(_0x3daac1['apiKey']){var _0x1a73ad={'method':'POST','uri':'https://platform.clickatell.com/messages','headers':{'Authorization':_0x3daac1[_0xe710('0x69')]},'body':{'content':_0xef820e['body'],'to':[_0xef820e[_0xe710('0x1e')]],'from':_0x3daac1[_0xe710('0x1e')],'binary':![],'clientMessageId':'uuid','charset':'UTF-8'},'json':!![]};rp(_0x1a73ad)[_0xe710('0x15')](function(_0x4a3d85){if(!_0x4a3d85['error']){var _0x2d590f={'messageId':_0x4a3d85[_0xe710('0x4b')][0x0][_0xe710('0x6a')]};if(!_0x3daac1[_0xe710('0x3e')]){_0x2d590f[_0xe710('0x38')]=!![];}return _0x21aa4f[_0xe710('0x16')](_0x2d590f);}else{return logger[_0xe710('0x18')](_0xe710('0x28'),_0xe710('0x25'),_0xe710('0x6b'),util[_0xe710('0x27')](_0x4a3d85[_0xe710('0x18')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x296bca){return logger[_0xe710('0x18')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xe710('0x6b'),util['inspect'](_0x296bca,{'showHidden':![],'depth':null}));});}else{logger[_0xe710('0x18')](_0xe710('0x28'),_0xe710('0x25'),_0xe710('0x6b'),'Missing\x20parameters:\x20apiKey');}break;case _0xe710('0x6c'):if(_0x3daac1[_0xe710('0x2c')]&&_0x3daac1[_0xe710('0x31')]){var _0x528a91=util[_0xe710('0x44')](_0xe710('0x42'),_0x3daac1[_0xe710('0x2c')],_0x3daac1[_0xe710('0x31')]);var _0x1d1160={'method':_0xe710('0x33'),'uri':_0xe710('0x6d')+_0x3daac1[_0xe710('0x6e')]+_0xe710('0x6f'),'body':{'to':[_0xef820e['phone']],'text':_0xef820e['body'],'from':_0x3daac1[_0xe710('0x1e')],'applicationId':_0x3daac1['applicationId']},'headers':{'Authorization':util[_0xe710('0x44')](_0xe710('0x45'),new Buffer(_0x528a91)[_0xe710('0x46')](_0xe710('0x51')))},'json':!![]};rp(_0x1d1160)[_0xe710('0x15')](function(_0x301eca){if(_0x301eca['id']){var _0x3b373b={'messageId':_0x301eca['id']};return _0x21aa4f['update'](_0x3b373b);}else{logger[_0xe710('0x18')](_0xe710('0x28'),_0xe710('0x25'),_0xe710('0x6c'),util['inspect'](_0x301eca,{'showHidden':![],'depth':null}));}})[_0xe710('0x17')](function(_0x36a7a8){logger[_0xe710('0x18')](_0xe710('0x28'),_0xe710('0x25'),_0xe710('0x6c'),util[_0xe710('0x27')](_0x36a7a8,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xe710('0x28'),'afterCreate',_0xe710('0x6c'),'Missing\x20parameters:\x20username,\x20password');}break;case _0xe710('0x70'):if(_0x3daac1[_0xe710('0x69')]){var _0x375d66={};var _0x1a0989={'method':_0xe710('0x33'),'uri':_0xe710('0x71'),'headers':{'Authorization':'Bearer\x20'+_0x3daac1[_0xe710('0x69')],'Content-Type':_0xe710('0x57')},'body':{'from':_0x3daac1[_0xe710('0x1e')],'to':_0xef820e[_0xe710('0x1e')],'text':_0xef820e['body']},'json':!![]};return rp(_0x1a0989)[_0xe710('0x15')](function(_0x3d591d){if(_0x3d591d[_0xe710('0x72')]==0xca){_0x375d66[_0xe710('0x73')]=_0x3d591d;var _0x213da8={'method':'POST','uri':_0xe710('0x74'),'headers':{'Authorization':'Bearer\x20'+_0x3daac1[_0xe710('0x69')],'Content-Type':'application/json'},'body':{'refid':_0x375d66[_0xe710('0x73')][_0xe710('0x75')]},'json':!![]};return rp(_0x213da8)[_0xe710('0x15')](function(_0x35bfa1){_0x375d66['status']=_0x35bfa1;var _0xbcc64c={'messageId':_0x375d66[_0xe710('0x73')]['refid'],'read':!![]};return _0x21aa4f[_0xe710('0x16')](_0xbcc64c);});}else{return logger['error'](_0xe710('0x28'),_0xe710('0x25'),_0xe710('0x70'),util[_0xe710('0x27')](_0x3d591d,{'showHidden':![],'depth':null}));}})[_0xe710('0x17')](function(_0x117d9e){return logger['error'](_0xe710('0x28'),_0xe710('0x25'),_0xe710('0x70'),util[_0xe710('0x27')](_0x117d9e,{'showHidden':![],'depth':null}));});}else{return logger[_0xe710('0x18')](_0xe710('0x28'),'afterCreate',_0xe710('0x70'),_0xe710('0x76'));}break;}}})[_0xe710('0x77')](function(){_0x3c11a4();});}else{_0x3c11a4();}}},'charset':_0xe710('0x78'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x6c76=['message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','status','Token\x20not\x20received','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','rimraf','../../config/environment','exports','define','messageId','fti_sms_messages','FULLTEXT','models','get','direction','toLowerCase','secret','isNil','UserId','SmsInteraction','findOne','SmsInteractionId','then','update','catch','error','out','SmsAccountId','type','twilio','phone','accountSid','authToken','messages','create','/api/sms/messages/','/status?token=','token','sid','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','body','smsMethod','login?username=','&password=','GET','sms','POST','user_key','session_key','total_sent','internal_order_id','deliveryReport','read','inspect','Missing\x20parameters:\x20username,\x20password','connectel','senderString','https://smsapi.connectel.se/api/v2/send/','requestid','Missing\x20parameters:\x20authToken','clicksend','xCALLY\x20Motion','format','%s:%s','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','base64','http_code','data','head','message_id','clickSend','plivo','authId','remote','https://api.plivo.com/v1/Account/%s/Message/','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','IBSSO\x20','Missing\x20parameters:\x20base_url','csc','crypto','login','sender','timestamp','keys','sort','length','apiKey','createHash','md5','digest','hex','signature=','/external/get/send.php?','id_sms','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','uuid','UTF-8','bandwidth','https://messaging.bandwidth.com/api/v2/users/','accountId','/messages','applicationId','toString','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','application/json','code'];(function(_0x765490,_0x9bb495){var _0x5d04dc=function(_0x19f690){while(--_0x19f690){_0x765490['push'](_0x765490['shift']());}};_0x5d04dc(++_0x9bb495);}(_0x6c76,0x184));var _0x66c7=function(_0x3ddb4b,_0x5b62f9){_0x3ddb4b=_0x3ddb4b-0x0;var _0x360ab2=_0x6c76[_0x3ddb4b];return _0x360ab2;};'use strict';var _=require(_0x66c7('0x0'));var util=require(_0x66c7('0x1'));var logger=require(_0x66c7('0x2'))('api');var moment=require(_0x66c7('0x3'));var BPromise=require(_0x66c7('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x66c7('0x5'));var config=require(_0x66c7('0x6'));var attributes=require('./smsMessage.attributes');module[_0x66c7('0x7')]=function(_0x45b0a5,_0x52f71b){return _0x45b0a5[_0x66c7('0x8')]('SmsMessage',attributes,{'tableName':'sms_messages','paranoid':![],'indexes':[{'name':_0x66c7('0x9'),'fields':[_0x66c7('0x9')]},{'name':_0x66c7('0xa'),'fields':['body'],'type':_0x66c7('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0xbc35d9,_0xf44e2,_0x2fff5e){var _0x492634=_0x45b0a5[_0x66c7('0xc')];var _0x45db57=_0xbc35d9[_0x66c7('0xd')]({'plain':!![]});if(_0x45db57[_0x66c7('0xe')][_0x66c7('0xf')]()==='in'||_0x45db57[_0x66c7('0xe')][_0x66c7('0xf')]()==='out'&&!_0x45db57[_0x66c7('0x10')]&&!_[_0x66c7('0x11')](_0x45db57[_0x66c7('0x12')])){_0x492634[_0x66c7('0x13')][_0x66c7('0x14')]({'where':{'id':_0x45db57[_0x66c7('0x15')]}})[_0x66c7('0x16')](function(_0xf3b04){if(_0xf3b04){_0xf3b04[_0x66c7('0x17')]({'lastMsgAt':_0x45db57['createdAt'],'lastMsgDirection':_0x45db57[_0x66c7('0xe')]['toLowerCase']()});}})[_0x66c7('0x18')](function(_0x39f951){console[_0x66c7('0x19')](_0x39f951);});}if(_0x45db57[_0x66c7('0xe')]===_0x66c7('0x1a')&&!_0x45db57['secret']){var _0x5cf913;_0x492634['SmsAccount']['find']({'where':{'id':_0x45db57[_0x66c7('0x1b')]},'raw':!![]})[_0x66c7('0x16')](function(_0x47a299){_0x5cf913=_0x47a299;if(_0x5cf913&&_0x5cf913['type']){switch(_0x5cf913[_0x66c7('0x1c')]){case _0x66c7('0x1d'):var _0x4756f7=require(_0x66c7('0x1d'));if(_0x5cf913['accountSid']&&_0x5cf913['authToken']&&_0x5cf913[_0x66c7('0x1e')]){var _0x237177=new _0x4756f7(_0x5cf913[_0x66c7('0x1f')],_0x5cf913[_0x66c7('0x20')]);_0x237177[_0x66c7('0x21')][_0x66c7('0x22')]({'body':_0x45db57['body'],'to':_0x45db57[_0x66c7('0x1e')],'from':_0x5cf913[_0x66c7('0x1e')],'statusCallback':_0x5cf913['remote']+_0x66c7('0x23')+_0x45db57['id']+_0x66c7('0x24')+_0x5cf913[_0x66c7('0x25')]})[_0x66c7('0x16')](function(_0x5bfaf6){if(_0x5bfaf6[_0x66c7('0x26')]){return _0xbc35d9[_0x66c7('0x17')]({'messageId':_0x5bfaf6['sid']});}})[_0x66c7('0x18')](function(_0x11a6b9){logger[_0x66c7('0x19')](_0x66c7('0x27'),_0x66c7('0x28'),'twilio',util['inspect'](_0x11a6b9,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x66c7('0x27'),_0x66c7('0x28'),'twilio',_0x66c7('0x29'));}break;case _0x66c7('0x2a'):var _0x205b7e=_0x66c7('0x2b');if(_0x5cf913[_0x66c7('0x2c')]&&_0x5cf913[_0x66c7('0x2d')]){var _0x570f0d={'recipient':[_0x45db57[_0x66c7('0x1e')]],'message':_0x45db57[_0x66c7('0x2e')],'message_type':_0x5cf913[_0x66c7('0x2f')]};if(_0x5cf913[_0x66c7('0x2f')]&&_0x5cf913[_0x66c7('0x2f')]!=='SI'){_0x570f0d['sender']=_0x5cf913[_0x66c7('0x1e')];}var _0x3e73a8={'url':_0x205b7e+_0x66c7('0x30')+_0x5cf913['username']+_0x66c7('0x31')+_0x5cf913[_0x66c7('0x2d')],'method':_0x66c7('0x32')};rp(_0x3e73a8)[_0x66c7('0x16')](function(_0xb26028){var _0x24e776=_0xb26028['split'](';');var _0x520bd2={'user_key':_0x24e776[0x0],'session_key':_0x24e776[0x1]};_0x3e73a8={'url':_0x205b7e+_0x66c7('0x33'),'method':_0x66c7('0x34'),'headers':{'user_key':_0x520bd2[_0x66c7('0x35')],'Session_key':_0x520bd2[_0x66c7('0x36')]},'json':!![],'body':_0x570f0d};return rp(_0x3e73a8);})[_0x66c7('0x16')](function(_0x131f24){if(_0x131f24[_0x66c7('0x37')]>=0x1){var _0x255ac3={'messageId':_0x131f24[_0x66c7('0x38')]};if(_0x5cf913[_0x66c7('0x2f')]!=='GP'||!_0x5cf913[_0x66c7('0x39')]){_0x255ac3[_0x66c7('0x3a')]=!![];}return _0xbc35d9['update'](_0x255ac3);}else{return logger['error'](_0x66c7('0x27'),_0x66c7('0x28'),_0x66c7('0x2a'),util[_0x66c7('0x3b')](_0x131f24,{'showHidden':![],'depth':null}));}})[_0x66c7('0x18')](function(_0x2bf7c2){return logger[_0x66c7('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x66c7('0x28'),_0x66c7('0x2a'),util[_0x66c7('0x3b')](_0x2bf7c2,{'showHidden':![],'depth':null}));});}else{logger[_0x66c7('0x19')](_0x66c7('0x27'),_0x66c7('0x28'),_0x66c7('0x2a'),_0x66c7('0x3c'));}break;case _0x66c7('0x3d'):if(_0x5cf913[_0x66c7('0x20')]){var _0x5b343a={'recipient':_0x45db57['phone'],'message':_0x45db57['body'],'sender':_0x5cf913[_0x66c7('0x3e')]||_0x5cf913[_0x66c7('0x1e')],'authorization':_0x5cf913[_0x66c7('0x20')]};var _0xf44e2={'method':'POST','uri':_0x66c7('0x3f'),'body':_0x5b343a,'json':!![]};rp(_0xf44e2)[_0x66c7('0x16')](function(_0x501771){var _0x2d98e4={'messageId':_0x501771[_0x66c7('0x40')]};if(!_0x5cf913[_0x66c7('0x39')]){_0x2d98e4['read']=!![];}return _0xbc35d9[_0x66c7('0x17')](_0x2d98e4);})[_0x66c7('0x18')](function(_0x9f6ca8){logger[_0x66c7('0x19')](_0x66c7('0x27'),_0x66c7('0x28'),_0x66c7('0x3d'),util[_0x66c7('0x3b')](_0x9f6ca8,{'showHidden':![],'depth':null}));});}else{logger[_0x66c7('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x66c7('0x28'),_0x66c7('0x3d'),_0x66c7('0x41'));}break;case _0x66c7('0x42'):if(_0x5cf913[_0x66c7('0x2c')]&&_0x5cf913[_0x66c7('0x2d')]){var _0x5b343a={'messages':[{'source':_0x66c7('0x43'),'to':_0x45db57[_0x66c7('0x1e')],'body':_0x45db57[_0x66c7('0x2e')],'from':_0x5cf913['senderString']||_0x5cf913['phone']}]};var _0x2f18b3=util[_0x66c7('0x44')](_0x66c7('0x45'),_0x5cf913['username'],_0x5cf913['password']);var _0xf44e2={'method':_0x66c7('0x34'),'uri':_0x66c7('0x46'),'body':_0x5b343a,'headers':{'Authorization':util[_0x66c7('0x44')](_0x66c7('0x47'),new Buffer(_0x2f18b3)['toString'](_0x66c7('0x48')))},'json':!![]};rp(_0xf44e2)['then'](function(_0x5b1a61){if(_0x5b1a61[_0x66c7('0x49')]>=0xc8&&_0x5b1a61[_0x66c7('0x49')]<=0xce){if(_0x5b1a61[_0x66c7('0x4a')]&&_0x5b1a61[_0x66c7('0x4a')]['queued_count']>0x0){var _0x5cf5c1=_[_0x66c7('0x4b')](_0x5b1a61['data']['messages']);var _0x1ec272={'messageId':_0x5cf5c1[_0x66c7('0x4c')]};if(!_0x5cf913[_0x66c7('0x39')]){_0x1ec272[_0x66c7('0x3a')]=!![];}return _0xbc35d9['update'](_0x1ec272);}else{logger[_0x66c7('0x19')](_0x66c7('0x27'),_0x66c7('0x28'),'clickSend',util[_0x66c7('0x3b')](_0x5b1a61,{'showHidden':![],'depth':null}));}}else{logger[_0x66c7('0x19')](_0x66c7('0x27'),_0x66c7('0x28'),_0x66c7('0x4d'),util[_0x66c7('0x3b')](_0x5b1a61,{'showHidden':![],'depth':null}));}})[_0x66c7('0x18')](function(_0x465a3d){logger['error'](_0x66c7('0x27'),_0x66c7('0x28'),_0x66c7('0x4d'),util[_0x66c7('0x3b')](_0x465a3d,{'showHidden':![],'depth':null}));});}else{logger[_0x66c7('0x19')](_0x66c7('0x27'),_0x66c7('0x28'),_0x66c7('0x4d'),_0x66c7('0x3c'));}break;case _0x66c7('0x4e'):if(_0x5cf913[_0x66c7('0x4f')]&&_0x5cf913[_0x66c7('0x20')]){var _0x5b343a={'dst':_0x45db57[_0x66c7('0x1e')],'text':_0x45db57['body'],'src':_0x5cf913[_0x66c7('0x3e')]||_0x5cf913[_0x66c7('0x1e')],'url':_0x5cf913[_0x66c7('0x50')]+_0x66c7('0x23')+_0x45db57['id']+'/status?token='+_0x5cf913[_0x66c7('0x25')]};var _0x2f18b3=util['format'](_0x66c7('0x45'),_0x5cf913[_0x66c7('0x4f')],_0x5cf913[_0x66c7('0x20')]);var _0xf44e2={'method':_0x66c7('0x34'),'uri':util[_0x66c7('0x44')](_0x66c7('0x51'),_0x5cf913['authId']),'body':_0x5b343a,'headers':{'Authorization':util[_0x66c7('0x44')](_0x66c7('0x47'),new Buffer(_0x2f18b3)['toString'](_0x66c7('0x48')))},'json':!![]};rp(_0xf44e2)[_0x66c7('0x16')](function(_0x3ef4cf){var _0x5df6d1={'messageId':_0x3ef4cf[_0x66c7('0x52')][0x0]};return _0xbc35d9[_0x66c7('0x17')](_0x5df6d1);})[_0x66c7('0x18')](function(_0x187623){logger[_0x66c7('0x19')](_0x66c7('0x27'),_0x66c7('0x28'),_0x66c7('0x4e'),util['inspect'](_0x187623,{'showHidden':![],'depth':null}));});}else{logger[_0x66c7('0x19')](_0x66c7('0x27'),'afterCreate',_0x66c7('0x4e'),_0x66c7('0x53'));}break;case _0x66c7('0x54'):if(_0x5cf913['username']&&_0x5cf913['password']){if(_0x5cf913[_0x66c7('0x55')]){var _0x5388e1={'method':_0x66c7('0x34'),'uri':_0x5cf913[_0x66c7('0x55')]+_0x66c7('0x56'),'body':{'username':_0x5cf913[_0x66c7('0x2c')],'password':_0x5cf913[_0x66c7('0x2d')]},'json':!![]};return rp(_0x5388e1)[_0x66c7('0x16')](function(_0x5b35cf){var _0x58f938={'method':_0x66c7('0x34'),'uri':_0x5cf913[_0x66c7('0x55')]+'/sms/2/text/advanced','body':{'messages':[{'from':_0x5cf913['phone'],'destinations':[{'to':_0x45db57[_0x66c7('0x1e')]}],'text':_0x45db57['body'],'notifyUrl':_0x5cf913[_0x66c7('0x50')]+_0x66c7('0x23')+_0x45db57['id']+_0x66c7('0x24')+_0x5cf913[_0x66c7('0x25')],'notifyContentType':'application/json','callbackData':_0x5cf913[_0x66c7('0x1e')]+';'+_0x45db57[_0x66c7('0x2e')]}]},'headers':{'Authorization':_0x66c7('0x57')+_0x5b35cf[_0x66c7('0x25')]},'json':!![]};return rp(_0x58f938)[_0x66c7('0x16')](function(_0x137c4f){if(_0x137c4f['messages']){var _0x24f22d={'messageId':_0x137c4f[_0x66c7('0x21')][0x0][_0x66c7('0x9')]};if(!_0x5cf913['deliveryReport']){_0x24f22d[_0x66c7('0x3a')]=!![];}return _0xbc35d9['update'](_0x24f22d);}else{return logger[_0x66c7('0x19')](_0x66c7('0x27'),_0x66c7('0x28'),_0x66c7('0x54'),util[_0x66c7('0x3b')](_0x137c4f,{'showHidden':![],'depth':null}));}});})[_0x66c7('0x18')](function(_0x4b36d2){return logger[_0x66c7('0x19')](_0x66c7('0x27'),_0x66c7('0x28'),_0x66c7('0x54'),util[_0x66c7('0x3b')](_0x4b36d2,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x66c7('0x27'),_0x66c7('0x28'),_0x66c7('0x54'),_0x66c7('0x58'));}}else{logger[_0x66c7('0x19')](_0x66c7('0x27'),_0x66c7('0x28'),_0x66c7('0x54'),_0x66c7('0x3c'));}break;case _0x66c7('0x59'):var _0x2e26e=require(_0x66c7('0x5a'));if(_0x5cf913['apiKey']){var _0x15fd0e={};_0x15fd0e[_0x66c7('0x5b')]=_0x5cf913[_0x66c7('0x2c')];_0x15fd0e[_0x66c7('0x1e')]=_0x45db57[_0x66c7('0x1e')];_0x15fd0e[_0x66c7('0x5c')]=_0x5cf913[_0x66c7('0x1e')];_0x15fd0e['text']=_0x45db57[_0x66c7('0x2e')];_0x15fd0e[_0x66c7('0x5d')]=+new Date();var _0x17ae53='';var _0x217ccf='';var _0x169efb=Object[_0x66c7('0x5e')](_0x15fd0e);_0x169efb[_0x66c7('0x5f')]();for(var _0x3e8f4c=0x0;_0x3e8f4c<_0x169efb[_0x66c7('0x60')];_0x3e8f4c++){if(_0x17ae53!=''){_0x17ae53+='&';}_0x17ae53+=_0x169efb[_0x3e8f4c]+'='+encodeURIComponent(_0x15fd0e[_0x169efb[_0x3e8f4c]]);_0x217ccf+=_0x15fd0e[_0x169efb[_0x3e8f4c]];}_0x217ccf+=_0x5cf913[_0x66c7('0x61')];_0x217ccf=_0x2e26e[_0x66c7('0x62')](_0x66c7('0x63'))[_0x66c7('0x17')](_0x217ccf)[_0x66c7('0x64')](_0x66c7('0x65'));if(_0x17ae53!==''){_0x17ae53+='&';}_0x17ae53+=_0x66c7('0x66')+_0x217ccf;var _0x3e73a8={'method':_0x66c7('0x32'),'uri':_0x5cf913[_0x66c7('0x55')]+_0x66c7('0x67')+_0x17ae53,'json':!![]};return rp(_0x3e73a8)[_0x66c7('0x16')](function(_0x2e8052){var _0x2c9af2=Object[_0x66c7('0x5e')](_0x2e8052);if(_0x2e8052[_0x2c9af2[0x0]][_0x66c7('0x19')]&&parseInt(_0x2e8052[_0x2c9af2[0x0]][_0x66c7('0x19')])===0x0){var _0x47605c={'messageId':_0x2e8052[_0x2c9af2[0x0]][_0x66c7('0x68')]};if(!_0x5cf913[_0x66c7('0x39')]){_0x47605c[_0x66c7('0x3a')]=!![];}return _0xbc35d9[_0x66c7('0x17')](_0x47605c);}else{return logger[_0x66c7('0x19')](_0x66c7('0x27'),_0x66c7('0x28'),'csc',util[_0x66c7('0x3b')](_0x2e8052[_0x66c7('0x19')],{'showHidden':![],'depth':null}));}})[_0x66c7('0x18')](function(_0x1585cd){return logger[_0x66c7('0x19')](_0x66c7('0x27'),'afterCreate','csc',util[_0x66c7('0x3b')](_0x1585cd,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x66c7('0x27'),_0x66c7('0x28'),_0x66c7('0x59'),_0x66c7('0x69'));}break;case _0x66c7('0x6a'):if(_0x5cf913[_0x66c7('0x61')]){var _0x25f945={'method':_0x66c7('0x34'),'uri':_0x66c7('0x6b'),'headers':{'Authorization':_0x5cf913[_0x66c7('0x61')]},'body':{'content':_0x45db57[_0x66c7('0x2e')],'to':[_0x45db57[_0x66c7('0x1e')]],'from':_0x5cf913['phone'],'binary':![],'clientMessageId':_0x66c7('0x6c'),'charset':_0x66c7('0x6d')},'json':!![]};rp(_0x25f945)[_0x66c7('0x16')](function(_0x369fe0){if(!_0x369fe0['error']){var _0x1c5ffc={'messageId':_0x369fe0[_0x66c7('0x21')][0x0]['apiMessageId']};if(!_0x5cf913[_0x66c7('0x39')]){_0x1c5ffc[_0x66c7('0x3a')]=!![];}return _0xbc35d9[_0x66c7('0x17')](_0x1c5ffc);}else{return logger[_0x66c7('0x19')](_0x66c7('0x27'),_0x66c7('0x28'),'clickatell',util['inspect'](_0x369fe0[_0x66c7('0x19')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x570a63){return logger[_0x66c7('0x19')](_0x66c7('0x27'),_0x66c7('0x28'),_0x66c7('0x6a'),util[_0x66c7('0x3b')](_0x570a63,{'showHidden':![],'depth':null}));});}else{logger[_0x66c7('0x19')](_0x66c7('0x27'),_0x66c7('0x28'),'clickatell',_0x66c7('0x69'));}break;case _0x66c7('0x6e'):if(_0x5cf913[_0x66c7('0x2c')]&&_0x5cf913[_0x66c7('0x2d')]){var _0x2f18b3=util[_0x66c7('0x44')](_0x66c7('0x45'),_0x5cf913[_0x66c7('0x2c')],_0x5cf913[_0x66c7('0x2d')]);var _0xf44e2={'method':_0x66c7('0x34'),'uri':_0x66c7('0x6f')+_0x5cf913[_0x66c7('0x70')]+_0x66c7('0x71'),'body':{'to':[_0x45db57[_0x66c7('0x1e')]],'text':_0x45db57[_0x66c7('0x2e')],'from':_0x5cf913[_0x66c7('0x1e')],'applicationId':_0x5cf913[_0x66c7('0x72')]},'headers':{'Authorization':util[_0x66c7('0x44')](_0x66c7('0x47'),new Buffer(_0x2f18b3)[_0x66c7('0x73')](_0x66c7('0x48')))},'json':!![]};rp(_0xf44e2)[_0x66c7('0x16')](function(_0x300ff4){if(_0x300ff4['id']){var _0x418090={'messageId':_0x300ff4['id']};return _0xbc35d9[_0x66c7('0x17')](_0x418090);}else{logger[_0x66c7('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x66c7('0x28'),_0x66c7('0x6e'),util[_0x66c7('0x3b')](_0x300ff4,{'showHidden':![],'depth':null}));}})['catch'](function(_0x321bb8){logger[_0x66c7('0x19')](_0x66c7('0x27'),'afterCreate',_0x66c7('0x6e'),util[_0x66c7('0x3b')](_0x321bb8,{'showHidden':![],'depth':null}));});}else{logger[_0x66c7('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x66c7('0x28'),_0x66c7('0x6e'),_0x66c7('0x3c'));}break;case _0x66c7('0x74'):if(_0x5cf913['apiKey']){var _0x228f85={};var _0x3e73a8={'method':_0x66c7('0x34'),'uri':_0x66c7('0x75'),'headers':{'Authorization':'Bearer\x20'+_0x5cf913['apiKey'],'Content-Type':_0x66c7('0x76')},'body':{'from':_0x5cf913[_0x66c7('0x1e')],'to':_0x45db57[_0x66c7('0x1e')],'text':_0x45db57[_0x66c7('0x2e')]},'json':!![]};return rp(_0x3e73a8)[_0x66c7('0x16')](function(_0x50f3de){if(_0x50f3de[_0x66c7('0x77')]==0xca){_0x228f85[_0x66c7('0x78')]=_0x50f3de;var _0x174a79={'method':_0x66c7('0x34'),'uri':_0x66c7('0x79'),'headers':{'Authorization':'Bearer\x20'+_0x5cf913[_0x66c7('0x61')],'Content-Type':_0x66c7('0x76')},'body':{'refid':_0x228f85[_0x66c7('0x78')][_0x66c7('0x7a')]},'json':!![]};return rp(_0x174a79)[_0x66c7('0x16')](function(_0x4310e6){_0x228f85[_0x66c7('0x7b')]=_0x4310e6;var _0x22fbc8={'messageId':_0x228f85['message'][_0x66c7('0x7a')],'read':!![]};return _0xbc35d9[_0x66c7('0x17')](_0x22fbc8);});}else{return logger[_0x66c7('0x19')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x66c7('0x28'),_0x66c7('0x74'),util[_0x66c7('0x3b')](_0x50f3de,{'showHidden':![],'depth':null}));}})[_0x66c7('0x18')](function(_0x14045a){return logger[_0x66c7('0x19')](_0x66c7('0x27'),_0x66c7('0x28'),'intelepeer',util[_0x66c7('0x3b')](_0x14045a,{'showHidden':![],'depth':null}));});}else{return logger[_0x66c7('0x19')](_0x66c7('0x27'),_0x66c7('0x28'),_0x66c7('0x74'),_0x66c7('0x7c'));}break;}}})['finally'](function(){_0x2fff5e();});}else{_0x2fff5e();}}},'charset':_0x66c7('0x7d'),'collate':_0x66c7('0x7e')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index 177b373..57c3b89 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 _0xd4fd=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','body','options','raw','CreateSmsMessage','lodash','util'];(function(_0x5dec97,_0x1454c7){var _0x47992d=function(_0x204e5c){while(--_0x204e5c){_0x5dec97['push'](_0x5dec97['shift']());}};_0x47992d(++_0x1454c7);}(_0xd4fd,0x106));var _0xdd4f=function(_0x3446e1,_0x5d58b2){_0x3446e1=_0x3446e1-0x0;var _0x36c55c=_0xd4fd[_0x3446e1];return _0x36c55c;};'use strict';var _=require(_0xdd4f('0x0'));var util=require(_0xdd4f('0x1'));var moment=require(_0xdd4f('0x2'));var BPromise=require(_0xdd4f('0x3'));var rs=require(_0xdd4f('0x4'));var fs=require('fs');var Redis=require(_0xdd4f('0x5'));var db=require(_0xdd4f('0x6'))['db'];var utils=require(_0xdd4f('0x7'));var logger=require('../../config/logger')(_0xdd4f('0x8'));var config=require(_0xdd4f('0x9'));var jayson=require(_0xdd4f('0xa'));var client=jayson[_0xdd4f('0xb')][_0xdd4f('0xc')]({'port':0x232a});config[_0xdd4f('0xd')]=_[_0xdd4f('0xe')](config['redis'],{'host':_0xdd4f('0xf'),'port':0x18eb});var socket=require(_0xdd4f('0x10'))(new Redis(config[_0xdd4f('0xd')]));require('./smsMessage.socket')[_0xdd4f('0x11')](socket);function respondWithRpcPromise(_0x1b2fc1,_0x570694,_0xaa98f4){return new BPromise(function(_0xbce99a,_0x51cfaa){return client[_0xdd4f('0x12')](_0x1b2fc1,_0xaa98f4)[_0xdd4f('0x13')](function(_0x4660ca){logger[_0xdd4f('0x14')](_0xdd4f('0x15'),_0x570694,_0xdd4f('0x16'));logger[_0xdd4f('0x17')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x570694,_0xdd4f('0x16'),JSON[_0xdd4f('0x18')](_0x4660ca));if(_0x4660ca[_0xdd4f('0x19')]){if(_0x4660ca['error']['code']===0x1f4){logger[_0xdd4f('0x19')](_0xdd4f('0x15'),_0x570694,_0x4660ca[_0xdd4f('0x19')][_0xdd4f('0x1a')]);return _0x51cfaa(_0x4660ca[_0xdd4f('0x19')][_0xdd4f('0x1a')]);}logger[_0xdd4f('0x19')](_0xdd4f('0x15'),_0x570694,_0x4660ca['error']['message']);return _0xbce99a(_0x4660ca[_0xdd4f('0x19')]['message']);}else{logger[_0xdd4f('0x14')](_0xdd4f('0x15'),_0x570694,_0xdd4f('0x16'));_0xbce99a(_0x4660ca[_0xdd4f('0x1b')][_0xdd4f('0x1a')]);}})[_0xdd4f('0x1c')](function(_0x414936){logger[_0xdd4f('0x19')]('SmsMessage,\x20%s,\x20%s',_0x570694,_0x414936);_0x51cfaa(_0x414936);});});}exports['CreateSmsMessage']=function(_0x52ba6f){var _0x4bb2e2=this;return new Promise(function(_0x31399d,_0x20ac82){return db['SmsMessage']['create'](_0x52ba6f[_0xdd4f('0x1d')],{'raw':_0x52ba6f['options']?_0x52ba6f[_0xdd4f('0x1e')][_0xdd4f('0x1f')]===undefined?!![]:![]:!![]})[_0xdd4f('0x13')](function(_0x4cbf1b){logger['info'](_0xdd4f('0x20'),_0x52ba6f);logger[_0xdd4f('0x17')](_0xdd4f('0x20'),_0x52ba6f,JSON[_0xdd4f('0x18')](_0x4cbf1b));_0x31399d(_0x4cbf1b);})[_0xdd4f('0x1c')](function(_0xafdfbb){logger[_0xdd4f('0x19')](_0xdd4f('0x20'),_0xafdfbb[_0xdd4f('0x1a')],_0x52ba6f);_0x20ac82(_0x4bb2e2[_0xdd4f('0x19')](0x1f4,_0xafdfbb[_0xdd4f('0x1a')]));});});}; \ No newline at end of file +var _0x5195=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','socket.io-emitter','./smsMessage.socket','register','request','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','body','options','raw','then','CreateSmsMessage','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x7b68cc,_0x3f522e){var _0x36470e=function(_0x3b80ad){while(--_0x3b80ad){_0x7b68cc['push'](_0x7b68cc['shift']());}};_0x36470e(++_0x3f522e);}(_0x5195,0x122));var _0x5519=function(_0x90d843,_0x5902fe){_0x90d843=_0x90d843-0x0;var _0x1963b1=_0x5195[_0x90d843];return _0x1963b1;};'use strict';var _=require(_0x5519('0x0'));var util=require(_0x5519('0x1'));var moment=require(_0x5519('0x2'));var BPromise=require(_0x5519('0x3'));var rs=require(_0x5519('0x4'));var fs=require('fs');var Redis=require(_0x5519('0x5'));var db=require(_0x5519('0x6'))['db'];var utils=require(_0x5519('0x7'));var logger=require(_0x5519('0x8'))('rpc');var config=require(_0x5519('0x9'));var jayson=require(_0x5519('0xa'));var client=jayson[_0x5519('0xb')]['http']({'port':0x232a});config[_0x5519('0xc')]=_[_0x5519('0xd')](config[_0x5519('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x5519('0xe'))(new Redis(config[_0x5519('0xc')]));require(_0x5519('0xf'))[_0x5519('0x10')](socket);function respondWithRpcPromise(_0x6c6f11,_0x1e8fc0,_0xd0f42b){return new BPromise(function(_0xaa8976,_0x2f8ace){return client[_0x5519('0x11')](_0x6c6f11,_0xd0f42b)['then'](function(_0x4567bb){logger[_0x5519('0x12')](_0x5519('0x13'),_0x1e8fc0,_0x5519('0x14'));logger[_0x5519('0x15')](_0x5519('0x16'),_0x1e8fc0,_0x5519('0x14'),JSON[_0x5519('0x17')](_0x4567bb));if(_0x4567bb[_0x5519('0x18')]){if(_0x4567bb[_0x5519('0x18')][_0x5519('0x19')]===0x1f4){logger[_0x5519('0x18')](_0x5519('0x13'),_0x1e8fc0,_0x4567bb['error'][_0x5519('0x1a')]);return _0x2f8ace(_0x4567bb[_0x5519('0x18')][_0x5519('0x1a')]);}logger['error']('SmsMessage,\x20%s,\x20%s',_0x1e8fc0,_0x4567bb['error'][_0x5519('0x1a')]);return _0xaa8976(_0x4567bb[_0x5519('0x18')][_0x5519('0x1a')]);}else{logger[_0x5519('0x12')](_0x5519('0x13'),_0x1e8fc0,_0x5519('0x14'));_0xaa8976(_0x4567bb[_0x5519('0x1b')][_0x5519('0x1a')]);}})['catch'](function(_0x154a44){logger[_0x5519('0x18')](_0x5519('0x13'),_0x1e8fc0,_0x154a44);_0x2f8ace(_0x154a44);});});}exports['CreateSmsMessage']=function(_0x3778c9){var _0x442dc8=this;return new Promise(function(_0x1c4b70,_0x274407){return db['SmsMessage']['create'](_0x3778c9[_0x5519('0x1c')],{'raw':_0x3778c9['options']?_0x3778c9[_0x5519('0x1d')][_0x5519('0x1e')]===undefined?!![]:![]:!![]})[_0x5519('0x1f')](function(_0x21e608){logger[_0x5519('0x12')](_0x5519('0x20'),_0x3778c9);logger['debug'](_0x5519('0x20'),_0x3778c9,JSON[_0x5519('0x17')](_0x21e608));_0x1c4b70(_0x21e608);})['catch'](function(_0x430976){logger[_0x5519('0x18')]('CreateSmsMessage',_0x430976['message'],_0x3778c9);_0x274407(_0x442dc8[_0x5519('0x18')](0x1f4,_0x430976['message']));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index 482a4b5..f487e2b 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 _0x0d9a=['./smsMessage.events','save','update','emit','removeListener','register','smsMessage:'];(function(_0x54fda5,_0x1093c6){var _0x34c133=function(_0x4da6ac){while(--_0x4da6ac){_0x54fda5['push'](_0x54fda5['shift']());}};_0x34c133(++_0x1093c6);}(_0x0d9a,0x13b));var _0xa0d9=function(_0x4b0db2,_0x654f7d){_0x4b0db2=_0x4b0db2-0x0;var _0x1e87c1=_0x0d9a[_0x4b0db2];return _0x1e87c1;};'use strict';var SmsMessageEvents=require(_0xa0d9('0x0'));var events=[_0xa0d9('0x1'),'remove',_0xa0d9('0x2')];function createListener(_0x5d425d,_0x18047f){return function(_0x5ba23f){_0x18047f[_0xa0d9('0x3')](_0x5d425d,_0x5ba23f);};}function removeListener(_0x3222a2,_0x3b9d1d){return function(){SmsMessageEvents[_0xa0d9('0x4')](_0x3222a2,_0x3b9d1d);};}exports[_0xa0d9('0x5')]=function(_0xf19d3c){for(var _0x1955d6=0x0,_0xb7cce6=events['length'];_0x1955d6<_0xb7cce6;_0x1955d6++){var _0x912149=events[_0x1955d6];var _0xb76152=createListener(_0xa0d9('0x6')+_0x912149,_0xf19d3c);SmsMessageEvents['on'](_0x912149,_0xb76152);}}; \ No newline at end of file +var _0x4257=['update','emit','register','length','smsMessage:','./smsMessage.events','remove'];(function(_0xad57ee,_0x2823a6){var _0x3eaea9=function(_0x185650){while(--_0x185650){_0xad57ee['push'](_0xad57ee['shift']());}};_0x3eaea9(++_0x2823a6);}(_0x4257,0xfa));var _0x7425=function(_0x1e8690,_0x5c6b4c){_0x1e8690=_0x1e8690-0x0;var _0x414bea=_0x4257[_0x1e8690];return _0x414bea;};'use strict';var SmsMessageEvents=require(_0x7425('0x0'));var events=['save',_0x7425('0x1'),_0x7425('0x2')];function createListener(_0x33c3f2,_0x49aa62){return function(_0x13b53a){_0x49aa62[_0x7425('0x3')](_0x33c3f2,_0x13b53a);};}function removeListener(_0x51808a,_0x3c6693){return function(){SmsMessageEvents['removeListener'](_0x51808a,_0x3c6693);};}exports[_0x7425('0x4')]=function(_0x4f2122){for(var _0x31bcfc=0x0,_0x29afd5=events[_0x7425('0x5')];_0x31bcfc<_0x29afd5;_0x31bcfc++){var _0x26006b=events[_0x31bcfc];var _0x399d8c=createListener(_0x7425('0x6')+_0x26006b,_0x4f2122);SmsMessageEvents['on'](_0x26006b,_0x399d8c);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index 2c62f05..91e5bd7 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 _0x0df6=['show','/:id/members','/:id/teams','getAgents','post','create','addTeams','/:id/users','update','delete','removeTeams','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueue.controller','get','isAuthenticated','index','/describe','/:id'];(function(_0x4108ee,_0xecfeee){var _0x12cb40=function(_0x3950a9){while(--_0x3950a9){_0x4108ee['push'](_0x4108ee['shift']());}};_0x12cb40(++_0xecfeee);}(_0x0df6,0x1cd));var _0x60df=function(_0x4f657c,_0x2c485a){_0x4f657c=_0x4f657c-0x0;var _0x21fcc=_0x0df6[_0x4f657c];return _0x21fcc;};'use strict';var multer=require(_0x60df('0x0'));var util=require(_0x60df('0x1'));var path=require('path');var timeout=require(_0x60df('0x2'));var express=require(_0x60df('0x3'));var router=express[_0x60df('0x4')]();var fs_extra=require(_0x60df('0x5'));var auth=require(_0x60df('0x6'));var interaction=require(_0x60df('0x7'));var config=require(_0x60df('0x8'));var controller=require(_0x60df('0x9'));router[_0x60df('0xa')]('/',auth[_0x60df('0xb')](),controller[_0x60df('0xc')]);router['get'](_0x60df('0xd'),auth[_0x60df('0xb')](),controller['describe']);router['get'](_0x60df('0xe'),auth[_0x60df('0xb')](),controller[_0x60df('0xf')]);router[_0x60df('0xa')](_0x60df('0x10'),auth[_0x60df('0xb')](),controller['getMembers']);router[_0x60df('0xa')](_0x60df('0x11'),auth[_0x60df('0xb')](),controller['getTeams']);router[_0x60df('0xa')]('/:id/users',auth[_0x60df('0xb')](),controller[_0x60df('0x12')]);router[_0x60df('0x13')]('/',auth['isAuthenticated'](),controller[_0x60df('0x14')]);router['post'](_0x60df('0x11'),auth['isAuthenticated'](),controller[_0x60df('0x15')]);router[_0x60df('0x13')](_0x60df('0x16'),auth['isAuthenticated'](),controller['addAgents']);router['put']('/:id',auth[_0x60df('0xb')](),controller[_0x60df('0x17')]);router[_0x60df('0x18')](_0x60df('0xe'),auth[_0x60df('0xb')](),controller['destroy']);router[_0x60df('0x18')](_0x60df('0x11'),auth['isAuthenticated'](),controller[_0x60df('0x19')]);router[_0x60df('0x18')]('/:id/users',auth[_0x60df('0xb')](),controller[_0x60df('0x1a')]);module[_0x60df('0x1b')]=router; \ No newline at end of file +var _0xf68e=['Router','fs-extra','../../components/auth/service','../../config/environment','./smsQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','getMembers','getTeams','/:id/users','getAgents','post','create','/:id/teams','addTeams','put','update','delete','destroy','removeTeams','removeAgents','util','connect-timeout','express'];(function(_0x134cab,_0xdcaa87){var _0xe5a8ab=function(_0x1d1ef5){while(--_0x1d1ef5){_0x134cab['push'](_0x134cab['shift']());}};_0xe5a8ab(++_0xdcaa87);}(_0xf68e,0x14d));var _0xef68=function(_0x249fb5,_0x2285b8){_0x249fb5=_0x249fb5-0x0;var _0x54a5f6=_0xf68e[_0x249fb5];return _0x54a5f6;};'use strict';var multer=require('multer');var util=require(_0xef68('0x0'));var path=require('path');var timeout=require(_0xef68('0x1'));var express=require(_0xef68('0x2'));var router=express[_0xef68('0x3')]();var fs_extra=require(_0xef68('0x4'));var auth=require(_0xef68('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xef68('0x6'));var controller=require(_0xef68('0x7'));router[_0xef68('0x8')]('/',auth[_0xef68('0x9')](),controller[_0xef68('0xa')]);router['get'](_0xef68('0xb'),auth[_0xef68('0x9')](),controller[_0xef68('0xc')]);router[_0xef68('0x8')](_0xef68('0xd'),auth[_0xef68('0x9')](),controller['show']);router['get']('/:id/members',auth['isAuthenticated'](),controller[_0xef68('0xe')]);router['get']('/:id/teams',auth[_0xef68('0x9')](),controller[_0xef68('0xf')]);router[_0xef68('0x8')](_0xef68('0x10'),auth[_0xef68('0x9')](),controller[_0xef68('0x11')]);router[_0xef68('0x12')]('/',auth[_0xef68('0x9')](),controller[_0xef68('0x13')]);router[_0xef68('0x12')](_0xef68('0x14'),auth['isAuthenticated'](),controller[_0xef68('0x15')]);router[_0xef68('0x12')](_0xef68('0x10'),auth['isAuthenticated'](),controller['addAgents']);router[_0xef68('0x16')](_0xef68('0xd'),auth['isAuthenticated'](),controller[_0xef68('0x17')]);router[_0xef68('0x18')](_0xef68('0xd'),auth['isAuthenticated'](),controller[_0xef68('0x19')]);router['delete'](_0xef68('0x14'),auth[_0xef68('0x9')](),controller[_0xef68('0x1a')]);router['delete'](_0xef68('0x10'),auth[_0xef68('0x9')](),controller[_0xef68('0x1b')]);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 508350e..5059477 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 _0xddd3=['STRING','name','INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize'];(function(_0x47903a,_0x540e6b){var _0xa98e35=function(_0x4f4eb6){while(--_0x4f4eb6){_0x47903a['push'](_0x47903a['shift']());}};_0xa98e35(++_0x540e6b);}(_0xddd3,0x9f));var _0x3ddd=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0xddd3[_0xae7c2f];return _0x5d7001;};'use strict';var Sequelize=require(_0x3ddd('0x0'));module['exports']={'name':{'type':Sequelize[_0x3ddd('0x1')],'unique':_0x3ddd('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x3ddd('0x1')]},'timeout':{'type':Sequelize[_0x3ddd('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x3ddd('0x4')](_0x3ddd('0x5'),_0x3ddd('0x6'),_0x3ddd('0x7'))}}; \ No newline at end of file +var _0x8dd0=['STRING','name','INTEGER','ENUM','rrmemory','beepall','roundrobin'];(function(_0x1f83a5,_0x59843f){var _0x45edf0=function(_0x431e25){while(--_0x431e25){_0x1f83a5['push'](_0x1f83a5['shift']());}};_0x45edf0(++_0x59843f);}(_0x8dd0,0x18f));var _0x08dd=function(_0x99955e,_0x10d70c){_0x99955e=_0x99955e-0x0;var _0x548289=_0x8dd0[_0x99955e];return _0x548289;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x08dd('0x0')],'unique':_0x08dd('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x08dd('0x0')]},'timeout':{'type':Sequelize[_0x08dd('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x08dd('0x3')](_0x08dd('0x4'),_0x08dd('0x5'),_0x08dd('0x6'))}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index cf29f8a..c38626d 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 _0xe0a8=['userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserSmsQueue','SmsQueueId','User','findAndCountAll','agent','smsPause','updatedAt','format','%s/%s','createdAt','getTeams','Team','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','select','field','tq.TeamId','from','team_has_sms_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','clone','push','toString','SELECT','every','TeamId','includes','union','compact','value','removeTeams','isEmpty','userSmsQueue:remove','addAgents','omit','spread','userSmsQueue:save','removeAgents','isArray','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./smsQueue.socket','register','sendStatus','status','json','offset','limit','undefined','count','apply','reject','save','update','then','get','UserProfileResource','destroy','end','name','map','SmsQueue','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','create','body','user','role','SmsQueues','UserProfileSection','find'];(function(_0x293188,_0xee98e){var _0x5f242e=function(_0x291ba2){while(--_0x291ba2){_0x293188['push'](_0x293188['shift']());}};_0x5f242e(++_0xee98e);}(_0xe0a8,0x161));var _0x8e0a=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xe0a8[_0x4565bf];return _0x5610ba;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8e0a('0x0'));var zipdir=require(_0x8e0a('0x1'));var jsonpatch=require(_0x8e0a('0x2'));var rp=require(_0x8e0a('0x3'));var moment=require(_0x8e0a('0x4'));var BPromise=require(_0x8e0a('0x5'));var Mustache=require(_0x8e0a('0x6'));var util=require(_0x8e0a('0x7'));var path=require(_0x8e0a('0x8'));var sox=require(_0x8e0a('0x9'));var csv=require('to-csv');var ejs=require(_0x8e0a('0xa'));var fs=require('fs');var fs_extra=require(_0x8e0a('0xb'));var _=require(_0x8e0a('0xc'));var squel=require('squel');var crypto=require(_0x8e0a('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x8e0a('0xe'));var toCsv=require(_0x8e0a('0xf'));var querystring=require(_0x8e0a('0x10'));var Papa=require(_0x8e0a('0x11'));var Redis=require(_0x8e0a('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x8e0a('0x13'));var as=require(_0x8e0a('0x14'));var hardwareService=require(_0x8e0a('0x15'));var logger=require(_0x8e0a('0x16'))('api');var utils=require('../../config/utils');var config=require(_0x8e0a('0x17'));var licenseUtil=require(_0x8e0a('0x18'));var db=require(_0x8e0a('0x19'))['db'];config[_0x8e0a('0x1a')]=_[_0x8e0a('0x1b')](config['redis'],{'host':_0x8e0a('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x8e0a('0x1d'))[_0x8e0a('0x1e')](socket);function respondWithStatusCode(_0x5a2df7,_0x481617){_0x481617=_0x481617||0xcc;return function(_0x4cc4f7){if(_0x4cc4f7){return _0x5a2df7[_0x8e0a('0x1f')](_0x481617);}return _0x5a2df7[_0x8e0a('0x20')](_0x481617)['end']();};}function respondWithResult(_0x5eb144,_0x38dd37){_0x38dd37=_0x38dd37||0xc8;return function(_0x635f4b){if(_0x635f4b){return _0x5eb144[_0x8e0a('0x20')](_0x38dd37)[_0x8e0a('0x21')](_0x635f4b);}};}function respondWithFilteredResult(_0x2b2007,_0x36aee7){return function(_0x5d1b00){if(_0x5d1b00){var _0x1c71ad=typeof _0x36aee7[_0x8e0a('0x22')]==='undefined'&&typeof _0x36aee7[_0x8e0a('0x23')]===_0x8e0a('0x24');var _0x190c13=_0x5d1b00[_0x8e0a('0x25')];var _0x339e3b=_0x1c71ad?0x0:_0x36aee7[_0x8e0a('0x22')];var _0x102415=_0x1c71ad?_0x5d1b00['count']:_0x36aee7[_0x8e0a('0x22')]+_0x36aee7[_0x8e0a('0x23')];var _0x4f2703;if(_0x102415>=_0x190c13){_0x102415=_0x190c13;_0x4f2703=0xc8;}else{_0x4f2703=0xce;}_0x2b2007['status'](_0x4f2703);return _0x2b2007['set']('Content-Range',_0x339e3b+'-'+_0x102415+'/'+_0x190c13)['json'](_0x5d1b00);}return null;};}function patchUpdates(_0x29625a){return function(_0x3c1527){try{jsonpatch[_0x8e0a('0x26')](_0x3c1527,_0x29625a,!![]);}catch(_0x3095b9){return BPromise[_0x8e0a('0x27')](_0x3095b9);}return _0x3c1527[_0x8e0a('0x28')]();};}function saveUpdates(_0x4a29c5,_0xcff72d){return function(_0x45edc4){if(_0x45edc4){return _0x45edc4[_0x8e0a('0x29')](_0x4a29c5)[_0x8e0a('0x2a')](function(_0x1feba5){return _0x1feba5;});}return null;};}function removeEntity(_0x418e19,_0x11895b){return function(_0x209518){if(_0x209518){return _0x209518['destroy']()[_0x8e0a('0x2a')](function(){var _0x43dad9=_0x209518[_0x8e0a('0x2b')]({'plain':!![]});var _0x22fcbe='SmsQueues';return db[_0x8e0a('0x2c')][_0x8e0a('0x2d')]({'where':{'type':_0x22fcbe,'resourceId':_0x43dad9['id']}})[_0x8e0a('0x2a')](function(){return _0x209518;});})[_0x8e0a('0x2a')](function(){_0x418e19[_0x8e0a('0x20')](0xcc)[_0x8e0a('0x2e')]();});}};}function handleEntityNotFound(_0x3e6b24,_0x554e24){return function(_0x2230f9){if(!_0x2230f9){_0x3e6b24[_0x8e0a('0x1f')](0x194);}return _0x2230f9;};}function handleError(_0x4b6c4c,_0x4d0d11){_0x4d0d11=_0x4d0d11||0x1f4;return function(_0x416eed){logger['error'](_0x416eed['stack']);if(_0x416eed[_0x8e0a('0x2f')]){delete _0x416eed[_0x8e0a('0x2f')];}_0x4b6c4c[_0x8e0a('0x20')](_0x4d0d11)['send'](_0x416eed);};}exports['index']=function(_0x2daa94,_0x26d7b2){var _0x4b8a9d={},_0x46d810={},_0x589005={'count':0x0,'rows':[]};var _0x2ce503=_[_0x8e0a('0x30')](db[_0x8e0a('0x31')][_0x8e0a('0x32')],function(_0x303a0c){return{'name':_0x303a0c['fieldName'],'type':_0x303a0c[_0x8e0a('0x33')][_0x8e0a('0x34')]};});_0x46d810['model']=_[_0x8e0a('0x30')](_0x2ce503,_0x8e0a('0x2f'));_0x46d810[_0x8e0a('0x35')]=_[_0x8e0a('0x36')](_0x2daa94[_0x8e0a('0x35')]);_0x46d810[_0x8e0a('0x37')]=_[_0x8e0a('0x38')](_0x46d810[_0x8e0a('0x39')],_0x46d810[_0x8e0a('0x35')]);_0x4b8a9d[_0x8e0a('0x3a')]=_[_0x8e0a('0x38')](_0x46d810[_0x8e0a('0x39')],qs[_0x8e0a('0x3b')](_0x2daa94[_0x8e0a('0x35')][_0x8e0a('0x3b')]));_0x4b8a9d['attributes']=_0x4b8a9d[_0x8e0a('0x3a')][_0x8e0a('0x3c')]?_0x4b8a9d[_0x8e0a('0x3a')]:_0x46d810[_0x8e0a('0x39')];if(!_0x2daa94[_0x8e0a('0x35')][_0x8e0a('0x3d')](_0x8e0a('0x3e'))){_0x4b8a9d[_0x8e0a('0x23')]=qs[_0x8e0a('0x23')](_0x2daa94[_0x8e0a('0x35')][_0x8e0a('0x23')]);_0x4b8a9d[_0x8e0a('0x22')]=qs[_0x8e0a('0x22')](_0x2daa94['query'][_0x8e0a('0x22')]);}_0x4b8a9d[_0x8e0a('0x3f')]=qs[_0x8e0a('0x40')](_0x2daa94[_0x8e0a('0x35')][_0x8e0a('0x40')]);_0x4b8a9d[_0x8e0a('0x41')]=qs['filters'](_[_0x8e0a('0x42')](_0x2daa94['query'],_0x46d810[_0x8e0a('0x37')]),_0x2ce503);if(_0x2daa94[_0x8e0a('0x35')][_0x8e0a('0x43')]){_0x4b8a9d[_0x8e0a('0x41')]=_[_0x8e0a('0x44')](_0x4b8a9d['where'],{'$or':_[_0x8e0a('0x30')](_0x2ce503,function(_0x35d4dc){if(_0x35d4dc[_0x8e0a('0x33')]!==_0x8e0a('0x45')){var _0x4d3749={};_0x4d3749[_0x35d4dc[_0x8e0a('0x2f')]]={'$like':'%'+_0x2daa94[_0x8e0a('0x35')][_0x8e0a('0x43')]+'%'};return _0x4d3749;}})});}_0x4b8a9d=_[_0x8e0a('0x44')]({},_0x4b8a9d,_0x2daa94[_0x8e0a('0x46')]);var _0x28a02e={'where':_0x4b8a9d['where']};return db[_0x8e0a('0x31')][_0x8e0a('0x25')](_0x28a02e)['then'](function(_0xb2a7c7){_0x589005[_0x8e0a('0x25')]=_0xb2a7c7;if(_0x2daa94[_0x8e0a('0x35')][_0x8e0a('0x47')]){_0x4b8a9d['include']=[{'all':!![]}];}return db[_0x8e0a('0x31')][_0x8e0a('0x48')](_0x4b8a9d);})[_0x8e0a('0x2a')](function(_0x4c6ef0){_0x589005[_0x8e0a('0x49')]=_0x4c6ef0;return _0x589005;})[_0x8e0a('0x2a')](respondWithFilteredResult(_0x26d7b2,_0x4b8a9d))[_0x8e0a('0x4a')](handleError(_0x26d7b2,null));};exports[_0x8e0a('0x4b')]=function(_0x51bf04,_0x4431c9){var _0x2f2d86={'raw':!![],'where':{'id':_0x51bf04[_0x8e0a('0x4c')]['id']}},_0xaa831a={};_0xaa831a[_0x8e0a('0x39')]=_[_0x8e0a('0x36')](db[_0x8e0a('0x31')][_0x8e0a('0x32')]);_0xaa831a[_0x8e0a('0x35')]=_[_0x8e0a('0x36')](_0x51bf04[_0x8e0a('0x35')]);_0xaa831a[_0x8e0a('0x37')]=_['intersection'](_0xaa831a['model'],_0xaa831a[_0x8e0a('0x35')]);_0x2f2d86[_0x8e0a('0x3a')]=_[_0x8e0a('0x38')](_0xaa831a[_0x8e0a('0x39')],qs[_0x8e0a('0x3b')](_0x51bf04['query']['fields']));_0x2f2d86['attributes']=_0x2f2d86[_0x8e0a('0x3a')]['length']?_0x2f2d86['attributes']:_0xaa831a['model'];if(_0x51bf04[_0x8e0a('0x35')][_0x8e0a('0x47')]){_0x2f2d86[_0x8e0a('0x4d')]=[{'all':!![]}];}_0x2f2d86=_['merge']({},_0x2f2d86,_0x51bf04[_0x8e0a('0x46')]);return db[_0x8e0a('0x31')]['find'](_0x2f2d86)[_0x8e0a('0x2a')](handleEntityNotFound(_0x4431c9,null))[_0x8e0a('0x2a')](respondWithResult(_0x4431c9,null))[_0x8e0a('0x4a')](handleError(_0x4431c9,null));};exports[_0x8e0a('0x4e')]=function(_0xe37838,_0x1674b8){return db['SmsQueue'][_0x8e0a('0x4e')](_0xe37838[_0x8e0a('0x4f')],{})[_0x8e0a('0x2a')](function(_0x704770){var _0x55795b=_0xe37838[_0x8e0a('0x50')]['get']({'plain':!![]});if(!_0x55795b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x55795b[_0x8e0a('0x51')]==='user'){var _0x6ba9d0=_0x704770[_0x8e0a('0x2b')]({'plain':!![]});var _0x92d311=_0x8e0a('0x52');return db[_0x8e0a('0x53')][_0x8e0a('0x54')]({'where':{'name':_0x92d311,'userProfileId':_0x55795b[_0x8e0a('0x55')]},'raw':!![]})[_0x8e0a('0x2a')](function(_0x51c8d3){if(_0x51c8d3&&_0x51c8d3[_0x8e0a('0x56')]===0x0){return db[_0x8e0a('0x2c')][_0x8e0a('0x4e')]({'name':_0x6ba9d0['name'],'resourceId':_0x6ba9d0['id'],'type':_0x51c8d3['name'],'sectionId':_0x51c8d3['id']},{})[_0x8e0a('0x2a')](function(){return _0x704770;});}else{return _0x704770;}})[_0x8e0a('0x4a')](function(_0x11abef){logger[_0x8e0a('0x57')](_0x8e0a('0x58'),_0x11abef);throw _0x11abef;});}return _0x704770;})[_0x8e0a('0x2a')](respondWithResult(_0x1674b8,0xc9))[_0x8e0a('0x4a')](handleError(_0x1674b8,null));};exports['update']=function(_0x3f3b46,_0x1f6930){if(_0x3f3b46[_0x8e0a('0x4f')]['id']){delete _0x3f3b46['body']['id'];}return db[_0x8e0a('0x31')]['find']({'where':{'id':_0x3f3b46[_0x8e0a('0x4c')]['id']}})[_0x8e0a('0x2a')](handleEntityNotFound(_0x1f6930,null))[_0x8e0a('0x2a')](saveUpdates(_0x3f3b46['body'],null))[_0x8e0a('0x2a')](respondWithResult(_0x1f6930,null))[_0x8e0a('0x4a')](handleError(_0x1f6930,null));};exports[_0x8e0a('0x2d')]=function(_0x8d34a3,_0x1d6a58){return db[_0x8e0a('0x31')][_0x8e0a('0x54')]({'where':{'id':_0x8d34a3[_0x8e0a('0x4c')]['id']}})[_0x8e0a('0x2a')](handleEntityNotFound(_0x1d6a58,null))[_0x8e0a('0x2a')](removeEntity(_0x1d6a58,null))[_0x8e0a('0x4a')](handleError(_0x1d6a58,null));};exports['describe']=function(_0x1362ce,_0x5e775d){return db['SmsQueue'][_0x8e0a('0x59')]()['then'](respondWithResult(_0x5e775d,null))[_0x8e0a('0x4a')](handleError(_0x5e775d,null));};exports[_0x8e0a('0x5a')]=function(_0x1e4446,_0x350538,_0x28e868){var _0x46ce59={'raw':!![],'where':{}},_0x4549eb={},_0x56e466;return db[_0x8e0a('0x31')][_0x8e0a('0x5b')]({'where':{'id':_0x1e4446[_0x8e0a('0x4c')]['id']}})[_0x8e0a('0x2a')](handleEntityNotFound(_0x350538,null))['then'](function(_0x52f10d){if(_0x52f10d){_0x56e466=_0x52f10d['get']({'plain':!![]});_0x4549eb['model']=_[_0x8e0a('0x36')](db[_0x8e0a('0x5c')][_0x8e0a('0x32')]);_0x4549eb['query']=_['keys'](_0x1e4446[_0x8e0a('0x35')]);_0x4549eb[_0x8e0a('0x37')]=_[_0x8e0a('0x38')](_0x4549eb[_0x8e0a('0x39')],_0x4549eb[_0x8e0a('0x35')]);_0x46ce59[_0x8e0a('0x3a')]=_['intersection'](_0x4549eb[_0x8e0a('0x39')],qs[_0x8e0a('0x3b')](_0x1e4446['query'][_0x8e0a('0x3b')]));_0x46ce59[_0x8e0a('0x3a')]=_0x46ce59['attributes'][_0x8e0a('0x3c')]?_0x46ce59[_0x8e0a('0x3a')]:_0x4549eb[_0x8e0a('0x39')];if(!_0x1e4446[_0x8e0a('0x35')][_0x8e0a('0x3d')]('nolimit')){_0x46ce59[_0x8e0a('0x23')]=qs[_0x8e0a('0x23')](_0x1e4446[_0x8e0a('0x35')][_0x8e0a('0x23')]);_0x46ce59[_0x8e0a('0x22')]=qs[_0x8e0a('0x22')](_0x1e4446['query'][_0x8e0a('0x22')]);}_0x46ce59[_0x8e0a('0x3f')]=qs[_0x8e0a('0x40')](_0x1e4446[_0x8e0a('0x35')][_0x8e0a('0x40')]);_0x46ce59[_0x8e0a('0x41')]=qs[_0x8e0a('0x37')](_[_0x8e0a('0x42')](_0x1e4446[_0x8e0a('0x35')],_0x4549eb[_0x8e0a('0x37')]));_0x46ce59[_0x8e0a('0x41')][_0x8e0a('0x5d')]=_0x52f10d['id'];if(_0x1e4446[_0x8e0a('0x35')][_0x8e0a('0x43')]){_0x46ce59[_0x8e0a('0x41')]=_[_0x8e0a('0x44')](_0x46ce59[_0x8e0a('0x41')],{'$or':_[_0x8e0a('0x30')](_0x46ce59['attributes'],function(_0x4f2b51){var _0x50bbc0={};_0x50bbc0[_0x4f2b51]={'$like':'%'+_0x1e4446['query'][_0x8e0a('0x43')]+'%'};return _0x50bbc0;})});}_0x46ce59=_[_0x8e0a('0x44')]({},_0x46ce59,_0x1e4446[_0x8e0a('0x46')]);return db[_0x8e0a('0x5c')]['findAll'](_0x46ce59);}})[_0x8e0a('0x2a')](function(_0x5de647){if(_0x5de647){return db[_0x8e0a('0x5e')][_0x8e0a('0x5f')]({'where':{'id':_[_0x8e0a('0x30')](_0x5de647,'UserId'),'role':_0x8e0a('0x60')},'attributes':['id',_0x8e0a('0x2f'),_0x8e0a('0x61'),_0x8e0a('0x62'),'createdAt']});}})[_0x8e0a('0x2a')](function(_0x2e775d){if(_0x2e775d){return{'count':_0x2e775d[_0x8e0a('0x25')],'rows':_['map'](_0x2e775d['rows'],function(_0x1cb48e){return{'membername':_0x1cb48e[_0x8e0a('0x2f')],'UserId':_0x1cb48e['id'],'queue_name':_0x56e466[_0x8e0a('0x2f')],'SmsQueueId':_0x56e466['id'],'interface':util[_0x8e0a('0x63')](_0x8e0a('0x64'),'SIP',_0x1cb48e[_0x8e0a('0x2f')]),'penalty':0x0,'paused':_0x1cb48e[_0x8e0a('0x61')],'createdAt':_0x1cb48e[_0x8e0a('0x65')],'updatedAt':_0x1cb48e['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x8e0a('0x2a')](respondWithFilteredResult(_0x350538,_0x46ce59))[_0x8e0a('0x4a')](handleError(_0x350538,null));};exports[_0x8e0a('0x66')]=function(_0x223e25,_0x6b5d90,_0x4ca2ad){var _0x2d1a2a={};var _0x200912={};var _0x56d3c1;var _0x2981dc;return db[_0x8e0a('0x31')][_0x8e0a('0x5b')]({'where':{'id':_0x223e25['params']['id']}})[_0x8e0a('0x2a')](handleEntityNotFound(_0x6b5d90,null))[_0x8e0a('0x2a')](function(_0x7e3227){if(_0x7e3227){_0x56d3c1=_0x7e3227;_0x200912[_0x8e0a('0x39')]=_[_0x8e0a('0x36')](db[_0x8e0a('0x67')][_0x8e0a('0x32')]);_0x200912[_0x8e0a('0x35')]=_[_0x8e0a('0x36')](_0x223e25[_0x8e0a('0x35')]);_0x200912['filters']=_[_0x8e0a('0x38')](_0x200912['model'],_0x200912[_0x8e0a('0x35')]);_0x2d1a2a[_0x8e0a('0x3a')]=_[_0x8e0a('0x38')](_0x200912[_0x8e0a('0x39')],qs[_0x8e0a('0x3b')](_0x223e25[_0x8e0a('0x35')]['fields']));_0x2d1a2a['attributes']=_0x2d1a2a['attributes']['length']?_0x2d1a2a[_0x8e0a('0x3a')]:_0x200912['model'];_0x2d1a2a[_0x8e0a('0x3f')]=qs[_0x8e0a('0x40')](_0x223e25['query'][_0x8e0a('0x40')]);_0x2d1a2a[_0x8e0a('0x41')]=qs['filters'](_[_0x8e0a('0x42')](_0x223e25[_0x8e0a('0x35')],_0x200912['filters']));if(_0x223e25[_0x8e0a('0x35')]['filter']){_0x2d1a2a[_0x8e0a('0x41')]=_['merge'](_0x2d1a2a['where'],{'$or':_['map'](_0x2d1a2a[_0x8e0a('0x3a')],function(_0x549b56){var _0xf0ffd2={};_0xf0ffd2[_0x549b56]={'$like':'%'+_0x223e25[_0x8e0a('0x35')][_0x8e0a('0x43')]+'%'};return _0xf0ffd2;})});}_0x2d1a2a=_['merge']({},_0x2d1a2a,_0x223e25[_0x8e0a('0x46')]);return _0x56d3c1[_0x8e0a('0x66')](_0x2d1a2a);}})[_0x8e0a('0x2a')](function(_0x4b75d1){if(_0x4b75d1){_0x2981dc=_0x4b75d1[_0x8e0a('0x3c')];if(!_0x223e25[_0x8e0a('0x35')]['hasOwnProperty'](_0x8e0a('0x3e'))){_0x2d1a2a[_0x8e0a('0x23')]=qs[_0x8e0a('0x23')](_0x223e25[_0x8e0a('0x35')]['limit']);_0x2d1a2a[_0x8e0a('0x22')]=qs[_0x8e0a('0x22')](_0x223e25[_0x8e0a('0x35')][_0x8e0a('0x22')]);}return _0x56d3c1['getTeams'](_0x2d1a2a);}})[_0x8e0a('0x2a')](function(_0x5eb7f7){if(_0x5eb7f7){return _0x5eb7f7?{'count':_0x2981dc,'rows':_0x5eb7f7}:null;}})['then'](respondWithResult(_0x6b5d90,null))[_0x8e0a('0x4a')](handleError(_0x6b5d90,null));};exports[_0x8e0a('0x68')]=function(_0x1e0c64,_0x828ce4,_0x3e4fb4){var _0x54d1a6=_0x1e0c64[_0x8e0a('0x4f')][_0x8e0a('0x69')];return db[_0x8e0a('0x67')][_0x8e0a('0x48')]({'where':{'id':_0x54d1a6},'attributes':['id'],'include':[{'model':db[_0x8e0a('0x5e')],'as':_0x8e0a('0x6a'),'attributes':['id','name',_0x8e0a('0x6b'),_0x8e0a('0x6c'),_0x8e0a('0x6d')],'raw':!![]}]})['then'](function(_0x259f66){if(_0x259f66){var _0x25da85=_[_0x8e0a('0x6e')](_0x259f66,function(_0x1682dc){var _0x756692=_0x1682dc[_0x8e0a('0x2b')]({'plain':!![]});return _0x756692['Agents'];});return db[_0x8e0a('0x31')][_0x8e0a('0x54')]({'where':{'id':_0x1e0c64[_0x8e0a('0x4c')]['id']}})[_0x8e0a('0x2a')](function(_0x544fe5){return db[_0x8e0a('0x6f')][_0x8e0a('0x70')](function(_0x35ecad){return _0x544fe5[_0x8e0a('0x68')](_0x54d1a6,{'transaction':_0x35ecad})[_0x8e0a('0x2a')](function(){return BPromise[_0x8e0a('0x71')](_0x25da85,function(_0xeb6faa){return db['UserSmsQueue'][_0x8e0a('0x72')]({'where':{'UserId':_0xeb6faa['id'],'SmsQueueId':_0x1e0c64['params']['id']},'transaction':_0x35ecad});});})[_0x8e0a('0x2a')](function(){_0x25da85[_0x8e0a('0x73')](function(_0x870906){socket[_0x8e0a('0x74')]('userSmsQueue:save',{'UserId':_0x870906['id'],'SmsQueueId':_0x544fe5['id']});});});});});}})[_0x8e0a('0x2a')](respondWithStatusCode(_0x828ce4,null))[_0x8e0a('0x4a')](handleError(_0x828ce4,null));};exports['removeTeams']=function(_0x751214,_0x268ed2,_0x3ad0bf){return db[_0x8e0a('0x67')][_0x8e0a('0x48')]({'where':{'id':_0x751214[_0x8e0a('0x35')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0x8e0a('0x6a'),'attributes':['id'],'raw':!![]}]})[_0x8e0a('0x2a')](handleEntityNotFound(_0x268ed2,null))[_0x8e0a('0x2a')](function(_0x282e79){var _0x264c7a=_['map'](_0x282e79,'id');var _0x465cdc=[];var _0x432efa=[];var _0x2d2ca5=squel[_0x8e0a('0x75')]();_0x2d2ca5[_0x8e0a('0x76')](_0x8e0a('0x77'))[_0x8e0a('0x78')](_0x8e0a('0x79'),'tq')[_0x8e0a('0x7a')](_0x8e0a('0x7b'),'ut',_0x8e0a('0x7c'))[_0x8e0a('0x41')](_0x8e0a('0x7d'),_0x751214[_0x8e0a('0x4c')]['id']);for(var _0x15a792=0x0;_0x15a792<_0x282e79[_0x8e0a('0x3c')];_0x15a792+=0x1){let _0x3e7d30=_0x282e79[_0x15a792];for(var _0x20566c=0x0;_0x20566c<_0x3e7d30[_0x8e0a('0x6a')][_0x8e0a('0x3c')];_0x20566c+=0x1){let _0x1cc944=_0x3e7d30[_0x8e0a('0x6a')][_0x20566c];var _0x43df3c=_0x2d2ca5[_0x8e0a('0x7e')]();_0x43df3c['where']('ut.UserId\x20=\x20?',_0x1cc944['id']);_0x432efa[_0x8e0a('0x7f')](db['sequelize'][_0x8e0a('0x35')](_0x43df3c[_0x8e0a('0x80')](),{'type':db[_0x8e0a('0x6f')]['QueryTypes'][_0x8e0a('0x81')]})[_0x8e0a('0x2a')](function(_0x50c855){if(_0x50c855[_0x8e0a('0x3c')]===0x1){return _0x1cc944['id'];}else{var _0x52775a=_[_0x8e0a('0x82')](_['map'](_0x50c855,_0x8e0a('0x83')),function(_0x4131e1){return _[_0x8e0a('0x84')](_0x264c7a,_0x4131e1);});if(_0x52775a){return _0x1cc944['id'];}}}));}}return BPromise['all'](_0x432efa)['then'](function(_0x3c5639){_0x465cdc=_(_0x465cdc)[_0x8e0a('0x85')](_0x3c5639)[_0x8e0a('0x86')]()[_0x8e0a('0x87')]();return db[_0x8e0a('0x31')][_0x8e0a('0x54')]({'where':{'id':_0x751214[_0x8e0a('0x4c')]['id']}})['then'](function(_0x1ee98e){return db['sequelize'][_0x8e0a('0x70')](function(_0x3beb00){return _0x1ee98e[_0x8e0a('0x88')](_0x751214[_0x8e0a('0x35')][_0x8e0a('0x69')],{'transaction':_0x3beb00})['then'](function(){if(!_[_0x8e0a('0x89')](_0x465cdc)){return _0x1ee98e['removeAgents'](_0x465cdc,{'transaction':_0x3beb00});}})[_0x8e0a('0x2a')](function(){_0x465cdc[_0x8e0a('0x73')](function(_0x4863bd){socket[_0x8e0a('0x74')](_0x8e0a('0x8a'),{'UserId':_0x4863bd,'SmsQueueId':_0x1ee98e['id']});});});});});});})[_0x8e0a('0x2a')](respondWithStatusCode(_0x268ed2,null))[_0x8e0a('0x4a')](handleError(_0x268ed2,null));};exports[_0x8e0a('0x8b')]=function(_0x5f05e3,_0x8498f7,_0x451d23){return db[_0x8e0a('0x31')][_0x8e0a('0x54')]({'where':{'id':_0x5f05e3[_0x8e0a('0x4c')]['id']}})[_0x8e0a('0x2a')](handleEntityNotFound(_0x8498f7,null))['then'](function(_0x4ed2c5){if(_0x4ed2c5){return _0x4ed2c5['addAgents'](_0x5f05e3[_0x8e0a('0x4f')]['ids'],_[_0x8e0a('0x8c')](_0x5f05e3['body'],[_0x8e0a('0x69'),'id'])||{})[_0x8e0a('0x8d')](function(_0x15037a){for(var _0x5af85f=0x0;_0x5af85f<_0x5f05e3['body'][_0x8e0a('0x69')]['length'];_0x5af85f+=0x1){socket[_0x8e0a('0x74')](_0x8e0a('0x8e'),{'UserId':Number(_0x5f05e3[_0x8e0a('0x4f')]['ids'][_0x5af85f]),'SmsQueueId':Number(_0x5f05e3[_0x8e0a('0x4c')]['id'])});}return _0x15037a;});}})[_0x8e0a('0x2a')](respondWithResult(_0x8498f7,null))['catch'](handleError(_0x8498f7,null));};exports[_0x8e0a('0x8f')]=function(_0xecff65,_0x4b274b,_0x440f6d){return db['SmsQueue']['find']({'where':{'id':_0xecff65[_0x8e0a('0x4c')]['id']}})[_0x8e0a('0x2a')](handleEntityNotFound(_0x4b274b,null))['then'](function(_0x2ea517){if(_0x2ea517){return _0x2ea517['removeAgents'](_0xecff65[_0x8e0a('0x35')][_0x8e0a('0x69')])[_0x8e0a('0x2a')](function(){if(_[_0x8e0a('0x90')](_0xecff65['query'][_0x8e0a('0x69')])){for(var _0xb25ec=0x0;_0xb25ec<_0xecff65[_0x8e0a('0x35')][_0x8e0a('0x69')][_0x8e0a('0x3c')];_0xb25ec+=0x1){socket[_0x8e0a('0x74')](_0x8e0a('0x8a'),{'UserId':Number(_0xecff65[_0x8e0a('0x35')][_0x8e0a('0x69')][_0xb25ec]),'SmsQueueId':Number(_0xecff65[_0x8e0a('0x4c')]['id'])});}}else{socket[_0x8e0a('0x74')](_0x8e0a('0x8a'),{'UserId':Number(_0xecff65['query']['ids']),'SmsQueueId':Number(_0xecff65[_0x8e0a('0x4c')]['id'])});}});}})[_0x8e0a('0x2a')](respondWithStatusCode(_0x4b274b,null))[_0x8e0a('0x4a')](handleError(_0x4b274b,null));};exports[_0x8e0a('0x91')]=function(_0x12ca1b,_0x1763a2,_0x489d4f){var _0x261eef={};var _0x542f84={};var _0x152155;var _0x8842;return db[_0x8e0a('0x31')]['findOne']({'where':{'id':_0x12ca1b[_0x8e0a('0x4c')]['id']}})[_0x8e0a('0x2a')](handleEntityNotFound(_0x1763a2,null))[_0x8e0a('0x2a')](function(_0x20bd26){if(_0x20bd26){_0x152155=_0x20bd26;_0x542f84['model']=_[_0x8e0a('0x36')](db[_0x8e0a('0x5e')][_0x8e0a('0x32')]);_0x542f84[_0x8e0a('0x35')]=_['keys'](_0x12ca1b['query']);_0x542f84[_0x8e0a('0x37')]=_[_0x8e0a('0x38')](_0x542f84[_0x8e0a('0x39')],_0x542f84['query']);_0x261eef[_0x8e0a('0x3a')]=_['intersection'](_0x542f84[_0x8e0a('0x39')],qs[_0x8e0a('0x3b')](_0x12ca1b[_0x8e0a('0x35')][_0x8e0a('0x3b')]));_0x261eef[_0x8e0a('0x3a')]=_0x261eef['attributes']['length']?_0x261eef[_0x8e0a('0x3a')]:_0x542f84[_0x8e0a('0x39')];_0x261eef[_0x8e0a('0x3f')]=qs[_0x8e0a('0x40')](_0x12ca1b['query'][_0x8e0a('0x40')]);_0x261eef[_0x8e0a('0x41')]=qs['filters'](_[_0x8e0a('0x42')](_0x12ca1b[_0x8e0a('0x35')],_0x542f84[_0x8e0a('0x37')]));if(_0x12ca1b[_0x8e0a('0x35')]['filter']){_0x261eef[_0x8e0a('0x41')]=_['merge'](_0x261eef[_0x8e0a('0x41')],{'$or':_[_0x8e0a('0x30')](_0x261eef[_0x8e0a('0x3a')],function(_0x580caa){var _0x10927c={};_0x10927c[_0x580caa]={'$like':'%'+_0x12ca1b[_0x8e0a('0x35')][_0x8e0a('0x43')]+'%'};return _0x10927c;})});}_0x261eef=_['merge']({},_0x261eef,_0x12ca1b[_0x8e0a('0x46')]);return _0x152155[_0x8e0a('0x91')](_0x261eef);}})['then'](function(_0x47065a){if(_0x47065a){_0x8842=_0x47065a[_0x8e0a('0x3c')];if(!_0x12ca1b[_0x8e0a('0x35')]['hasOwnProperty'](_0x8e0a('0x3e'))){_0x261eef[_0x8e0a('0x23')]=qs[_0x8e0a('0x23')](_0x12ca1b[_0x8e0a('0x35')][_0x8e0a('0x23')]);_0x261eef[_0x8e0a('0x22')]=qs['offset'](_0x12ca1b[_0x8e0a('0x35')][_0x8e0a('0x22')]);}return _0x152155[_0x8e0a('0x91')](_0x261eef);}})['then'](function(_0xa6bf8c){if(_0xa6bf8c){return _0xa6bf8c?{'count':_0x8842,'rows':_0xa6bf8c}:null;}})[_0x8e0a('0x2a')](respondWithResult(_0x1763a2,null))[_0x8e0a('0x4a')](handleError(_0x1763a2,null));}; \ No newline at end of file +var _0xf7a1=['fieldName','type','key','query','keys','filters','intersection','attributes','model','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','fields','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','UserSmsQueue','SmsQueueId','User','UserId','agent','smsPause','createdAt','format','updatedAt','getTeams','ids','Team','online','voicePause','interface','flatMap','sequelize','transaction','addTeams','findOrCreate','forEach','emit','userSmsQueue:save','removeTeams','Agents','tq.TeamId','from','team_has_sms_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','union','compact','isEmpty','removeAgents','userSmsQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','register','sendStatus','status','limit','undefined','count','offset','set','Content-Range','json','reject','save','update','then','destroy','get','SmsQueues','end','stack','name','send','index','map','SmsQueue','rawAttributes'];(function(_0x2d92a5,_0x4c2a1d){var _0x5410b5=function(_0x57bba8){while(--_0x57bba8){_0x2d92a5['push'](_0x2d92a5['shift']());}};_0x5410b5(++_0x4c2a1d);}(_0xf7a1,0xed));var _0x1f7a=function(_0x25b51d,_0x4a6600){_0x25b51d=_0x25b51d-0x0;var _0x3eeb68=_0xf7a1[_0x25b51d];return _0x3eeb68;};'use strict';var emlformat=require(_0x1f7a('0x0'));var rimraf=require(_0x1f7a('0x1'));var zipdir=require(_0x1f7a('0x2'));var jsonpatch=require(_0x1f7a('0x3'));var rp=require(_0x1f7a('0x4'));var moment=require(_0x1f7a('0x5'));var BPromise=require(_0x1f7a('0x6'));var Mustache=require('mustache');var util=require(_0x1f7a('0x7'));var path=require('path');var sox=require(_0x1f7a('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1f7a('0x9'));var _=require(_0x1f7a('0xa'));var squel=require(_0x1f7a('0xb'));var crypto=require(_0x1f7a('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x1f7a('0xd'));var toCsv=require(_0x1f7a('0xe'));var querystring=require(_0x1f7a('0xf'));var Papa=require(_0x1f7a('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x1f7a('0x11'));var hardwareService=require(_0x1f7a('0x12'));var logger=require('../../config/logger')(_0x1f7a('0x13'));var utils=require('../../config/utils');var config=require(_0x1f7a('0x14'));var licenseUtil=require(_0x1f7a('0x15'));var db=require(_0x1f7a('0x16'))['db'];config[_0x1f7a('0x17')]=_[_0x1f7a('0x18')](config[_0x1f7a('0x17')],{'host':_0x1f7a('0x19'),'port':0x18eb});var socket=require(_0x1f7a('0x1a'))(new Redis(config[_0x1f7a('0x17')]));require(_0x1f7a('0x1b'))[_0x1f7a('0x1c')](socket);function respondWithStatusCode(_0xbc6854,_0x3d7e0f){_0x3d7e0f=_0x3d7e0f||0xcc;return function(_0x43c89b){if(_0x43c89b){return _0xbc6854[_0x1f7a('0x1d')](_0x3d7e0f);}return _0xbc6854[_0x1f7a('0x1e')](_0x3d7e0f)['end']();};}function respondWithResult(_0x44a419,_0x29dff4){_0x29dff4=_0x29dff4||0xc8;return function(_0x2ef907){if(_0x2ef907){return _0x44a419['status'](_0x29dff4)['json'](_0x2ef907);}};}function respondWithFilteredResult(_0x4a056d,_0x1b96de){return function(_0x1d2254){if(_0x1d2254){var _0x29d0f5=typeof _0x1b96de['offset']==='undefined'&&typeof _0x1b96de[_0x1f7a('0x1f')]===_0x1f7a('0x20');var _0x233573=_0x1d2254[_0x1f7a('0x21')];var _0x4f1a32=_0x29d0f5?0x0:_0x1b96de[_0x1f7a('0x22')];var _0x92fcc0=_0x29d0f5?_0x1d2254[_0x1f7a('0x21')]:_0x1b96de[_0x1f7a('0x22')]+_0x1b96de[_0x1f7a('0x1f')];var _0x5b0561;if(_0x92fcc0>=_0x233573){_0x92fcc0=_0x233573;_0x5b0561=0xc8;}else{_0x5b0561=0xce;}_0x4a056d['status'](_0x5b0561);return _0x4a056d[_0x1f7a('0x23')](_0x1f7a('0x24'),_0x4f1a32+'-'+_0x92fcc0+'/'+_0x233573)[_0x1f7a('0x25')](_0x1d2254);}return null;};}function patchUpdates(_0x189434){return function(_0x455f91){try{jsonpatch['apply'](_0x455f91,_0x189434,!![]);}catch(_0x667c16){return BPromise[_0x1f7a('0x26')](_0x667c16);}return _0x455f91[_0x1f7a('0x27')]();};}function saveUpdates(_0x226803,_0xfb5180){return function(_0x1c7b54){if(_0x1c7b54){return _0x1c7b54[_0x1f7a('0x28')](_0x226803)[_0x1f7a('0x29')](function(_0x24dac1){return _0x24dac1;});}return null;};}function removeEntity(_0x2c3874,_0x112c6a){return function(_0x49aad3){if(_0x49aad3){return _0x49aad3[_0x1f7a('0x2a')]()['then'](function(){var _0x4e5c43=_0x49aad3[_0x1f7a('0x2b')]({'plain':!![]});var _0x4060ed=_0x1f7a('0x2c');return db['UserProfileResource']['destroy']({'where':{'type':_0x4060ed,'resourceId':_0x4e5c43['id']}})[_0x1f7a('0x29')](function(){return _0x49aad3;});})[_0x1f7a('0x29')](function(){_0x2c3874[_0x1f7a('0x1e')](0xcc)[_0x1f7a('0x2d')]();});}};}function handleEntityNotFound(_0x40bd54,_0x4f69ab){return function(_0x5f5add){if(!_0x5f5add){_0x40bd54['sendStatus'](0x194);}return _0x5f5add;};}function handleError(_0x1d4086,_0x13bb8b){_0x13bb8b=_0x13bb8b||0x1f4;return function(_0x2634a8){logger['error'](_0x2634a8[_0x1f7a('0x2e')]);if(_0x2634a8[_0x1f7a('0x2f')]){delete _0x2634a8[_0x1f7a('0x2f')];}_0x1d4086[_0x1f7a('0x1e')](_0x13bb8b)[_0x1f7a('0x30')](_0x2634a8);};}exports[_0x1f7a('0x31')]=function(_0x65fad0,_0x19c5d4){var _0x2d13b0={},_0x238b09={},_0x4caf76={'count':0x0,'rows':[]};var _0x2746e8=_[_0x1f7a('0x32')](db[_0x1f7a('0x33')][_0x1f7a('0x34')],function(_0x355136){return{'name':_0x355136[_0x1f7a('0x35')],'type':_0x355136[_0x1f7a('0x36')][_0x1f7a('0x37')]};});_0x238b09['model']=_[_0x1f7a('0x32')](_0x2746e8,_0x1f7a('0x2f'));_0x238b09[_0x1f7a('0x38')]=_[_0x1f7a('0x39')](_0x65fad0[_0x1f7a('0x38')]);_0x238b09[_0x1f7a('0x3a')]=_[_0x1f7a('0x3b')](_0x238b09['model'],_0x238b09['query']);_0x2d13b0[_0x1f7a('0x3c')]=_[_0x1f7a('0x3b')](_0x238b09[_0x1f7a('0x3d')],qs['fields'](_0x65fad0[_0x1f7a('0x38')]['fields']));_0x2d13b0[_0x1f7a('0x3c')]=_0x2d13b0['attributes'][_0x1f7a('0x3e')]?_0x2d13b0[_0x1f7a('0x3c')]:_0x238b09[_0x1f7a('0x3d')];if(!_0x65fad0[_0x1f7a('0x38')][_0x1f7a('0x3f')](_0x1f7a('0x40'))){_0x2d13b0[_0x1f7a('0x1f')]=qs[_0x1f7a('0x1f')](_0x65fad0[_0x1f7a('0x38')][_0x1f7a('0x1f')]);_0x2d13b0[_0x1f7a('0x22')]=qs[_0x1f7a('0x22')](_0x65fad0[_0x1f7a('0x38')]['offset']);}_0x2d13b0[_0x1f7a('0x41')]=qs[_0x1f7a('0x42')](_0x65fad0[_0x1f7a('0x38')][_0x1f7a('0x42')]);_0x2d13b0[_0x1f7a('0x43')]=qs['filters'](_[_0x1f7a('0x44')](_0x65fad0[_0x1f7a('0x38')],_0x238b09[_0x1f7a('0x3a')]),_0x2746e8);if(_0x65fad0['query'][_0x1f7a('0x45')]){_0x2d13b0[_0x1f7a('0x43')]=_[_0x1f7a('0x46')](_0x2d13b0['where'],{'$or':_[_0x1f7a('0x32')](_0x2746e8,function(_0x49331a){if(_0x49331a[_0x1f7a('0x36')]!==_0x1f7a('0x47')){var _0x4eb19d={};_0x4eb19d[_0x49331a[_0x1f7a('0x2f')]]={'$like':'%'+_0x65fad0['query'][_0x1f7a('0x45')]+'%'};return _0x4eb19d;}})});}_0x2d13b0=_[_0x1f7a('0x46')]({},_0x2d13b0,_0x65fad0[_0x1f7a('0x48')]);var _0x4b1d2d={'where':_0x2d13b0[_0x1f7a('0x43')]};return db['SmsQueue'][_0x1f7a('0x21')](_0x4b1d2d)[_0x1f7a('0x29')](function(_0x17fa32){_0x4caf76[_0x1f7a('0x21')]=_0x17fa32;if(_0x65fad0[_0x1f7a('0x38')][_0x1f7a('0x49')]){_0x2d13b0[_0x1f7a('0x4a')]=[{'all':!![]}];}return db[_0x1f7a('0x33')]['findAll'](_0x2d13b0);})['then'](function(_0x240da3){_0x4caf76[_0x1f7a('0x4b')]=_0x240da3;return _0x4caf76;})[_0x1f7a('0x29')](respondWithFilteredResult(_0x19c5d4,_0x2d13b0))[_0x1f7a('0x4c')](handleError(_0x19c5d4,null));};exports[_0x1f7a('0x4d')]=function(_0x2d1f3,_0x50f434){var _0x1232e7={'raw':!![],'where':{'id':_0x2d1f3[_0x1f7a('0x4e')]['id']}},_0x511e8a={};_0x511e8a[_0x1f7a('0x3d')]=_[_0x1f7a('0x39')](db[_0x1f7a('0x33')][_0x1f7a('0x34')]);_0x511e8a['query']=_[_0x1f7a('0x39')](_0x2d1f3['query']);_0x511e8a[_0x1f7a('0x3a')]=_['intersection'](_0x511e8a[_0x1f7a('0x3d')],_0x511e8a[_0x1f7a('0x38')]);_0x1232e7[_0x1f7a('0x3c')]=_['intersection'](_0x511e8a['model'],qs[_0x1f7a('0x4f')](_0x2d1f3[_0x1f7a('0x38')][_0x1f7a('0x4f')]));_0x1232e7['attributes']=_0x1232e7[_0x1f7a('0x3c')][_0x1f7a('0x3e')]?_0x1232e7[_0x1f7a('0x3c')]:_0x511e8a[_0x1f7a('0x3d')];if(_0x2d1f3[_0x1f7a('0x38')][_0x1f7a('0x49')]){_0x1232e7[_0x1f7a('0x4a')]=[{'all':!![]}];}_0x1232e7=_[_0x1f7a('0x46')]({},_0x1232e7,_0x2d1f3[_0x1f7a('0x48')]);return db[_0x1f7a('0x33')][_0x1f7a('0x50')](_0x1232e7)[_0x1f7a('0x29')](handleEntityNotFound(_0x50f434,null))['then'](respondWithResult(_0x50f434,null))[_0x1f7a('0x4c')](handleError(_0x50f434,null));};exports[_0x1f7a('0x51')]=function(_0x41a9b5,_0x23a684){return db[_0x1f7a('0x33')][_0x1f7a('0x51')](_0x41a9b5['body'],{})[_0x1f7a('0x29')](function(_0x27a5ab){var _0x55e053=_0x41a9b5[_0x1f7a('0x52')][_0x1f7a('0x2b')]({'plain':!![]});if(!_0x55e053)throw new Error(_0x1f7a('0x53'));if(_0x55e053['role']===_0x1f7a('0x52')){var _0x4052cd=_0x27a5ab[_0x1f7a('0x2b')]({'plain':!![]});var _0x13b328=_0x1f7a('0x2c');return db[_0x1f7a('0x54')]['find']({'where':{'name':_0x13b328,'userProfileId':_0x55e053[_0x1f7a('0x55')]},'raw':!![]})['then'](function(_0x26d58c){if(_0x26d58c&&_0x26d58c[_0x1f7a('0x56')]===0x0){return db[_0x1f7a('0x57')][_0x1f7a('0x51')]({'name':_0x4052cd[_0x1f7a('0x2f')],'resourceId':_0x4052cd['id'],'type':_0x26d58c[_0x1f7a('0x2f')],'sectionId':_0x26d58c['id']},{})['then'](function(){return _0x27a5ab;});}else{return _0x27a5ab;}})[_0x1f7a('0x4c')](function(_0x37c5f0){logger[_0x1f7a('0x58')](_0x1f7a('0x59'),_0x37c5f0);throw _0x37c5f0;});}return _0x27a5ab;})[_0x1f7a('0x29')](respondWithResult(_0x23a684,0xc9))[_0x1f7a('0x4c')](handleError(_0x23a684,null));};exports[_0x1f7a('0x28')]=function(_0x4112fb,_0x5dc206){if(_0x4112fb['body']['id']){delete _0x4112fb['body']['id'];}return db[_0x1f7a('0x33')][_0x1f7a('0x50')]({'where':{'id':_0x4112fb['params']['id']}})['then'](handleEntityNotFound(_0x5dc206,null))[_0x1f7a('0x29')](saveUpdates(_0x4112fb[_0x1f7a('0x5a')],null))[_0x1f7a('0x29')](respondWithResult(_0x5dc206,null))['catch'](handleError(_0x5dc206,null));};exports[_0x1f7a('0x2a')]=function(_0x5e5e98,_0x45c968){return db[_0x1f7a('0x33')][_0x1f7a('0x50')]({'where':{'id':_0x5e5e98[_0x1f7a('0x4e')]['id']}})[_0x1f7a('0x29')](handleEntityNotFound(_0x45c968,null))['then'](removeEntity(_0x45c968,null))['catch'](handleError(_0x45c968,null));};exports['describe']=function(_0x54b182,_0x37252f){return db[_0x1f7a('0x33')][_0x1f7a('0x5b')]()['then'](respondWithResult(_0x37252f,null))[_0x1f7a('0x4c')](handleError(_0x37252f,null));};exports[_0x1f7a('0x5c')]=function(_0x2826de,_0x25334a,_0x31aa5b){var _0x4e392e={'raw':!![],'where':{}},_0x26f72e={},_0xd77420;return db['SmsQueue'][_0x1f7a('0x5d')]({'where':{'id':_0x2826de['params']['id']}})['then'](handleEntityNotFound(_0x25334a,null))['then'](function(_0x48099f){if(_0x48099f){_0xd77420=_0x48099f[_0x1f7a('0x2b')]({'plain':!![]});_0x26f72e['model']=_['keys'](db[_0x1f7a('0x5e')][_0x1f7a('0x34')]);_0x26f72e[_0x1f7a('0x38')]=_[_0x1f7a('0x39')](_0x2826de['query']);_0x26f72e[_0x1f7a('0x3a')]=_['intersection'](_0x26f72e[_0x1f7a('0x3d')],_0x26f72e[_0x1f7a('0x38')]);_0x4e392e[_0x1f7a('0x3c')]=_[_0x1f7a('0x3b')](_0x26f72e['model'],qs['fields'](_0x2826de[_0x1f7a('0x38')][_0x1f7a('0x4f')]));_0x4e392e[_0x1f7a('0x3c')]=_0x4e392e[_0x1f7a('0x3c')][_0x1f7a('0x3e')]?_0x4e392e[_0x1f7a('0x3c')]:_0x26f72e[_0x1f7a('0x3d')];if(!_0x2826de[_0x1f7a('0x38')][_0x1f7a('0x3f')](_0x1f7a('0x40'))){_0x4e392e['limit']=qs['limit'](_0x2826de['query'][_0x1f7a('0x1f')]);_0x4e392e['offset']=qs[_0x1f7a('0x22')](_0x2826de['query'][_0x1f7a('0x22')]);}_0x4e392e['order']=qs[_0x1f7a('0x42')](_0x2826de[_0x1f7a('0x38')]['sort']);_0x4e392e[_0x1f7a('0x43')]=qs[_0x1f7a('0x3a')](_['pick'](_0x2826de['query'],_0x26f72e[_0x1f7a('0x3a')]));_0x4e392e['where'][_0x1f7a('0x5f')]=_0x48099f['id'];if(_0x2826de['query']['filter']){_0x4e392e[_0x1f7a('0x43')]=_[_0x1f7a('0x46')](_0x4e392e[_0x1f7a('0x43')],{'$or':_[_0x1f7a('0x32')](_0x4e392e[_0x1f7a('0x3c')],function(_0x8a50bd){var _0x45b7bf={};_0x45b7bf[_0x8a50bd]={'$like':'%'+_0x2826de[_0x1f7a('0x38')][_0x1f7a('0x45')]+'%'};return _0x45b7bf;})});}_0x4e392e=_[_0x1f7a('0x46')]({},_0x4e392e,_0x2826de[_0x1f7a('0x48')]);return db[_0x1f7a('0x5e')]['findAll'](_0x4e392e);}})[_0x1f7a('0x29')](function(_0x335054){if(_0x335054){return db[_0x1f7a('0x60')]['findAndCountAll']({'where':{'id':_[_0x1f7a('0x32')](_0x335054,_0x1f7a('0x61')),'role':_0x1f7a('0x62')},'attributes':['id','name',_0x1f7a('0x63'),'updatedAt',_0x1f7a('0x64')]});}})[_0x1f7a('0x29')](function(_0x3089b1){if(_0x3089b1){return{'count':_0x3089b1[_0x1f7a('0x21')],'rows':_[_0x1f7a('0x32')](_0x3089b1[_0x1f7a('0x4b')],function(_0x28586b){return{'membername':_0x28586b[_0x1f7a('0x2f')],'UserId':_0x28586b['id'],'queue_name':_0xd77420[_0x1f7a('0x2f')],'SmsQueueId':_0xd77420['id'],'interface':util[_0x1f7a('0x65')]('%s/%s','SIP',_0x28586b[_0x1f7a('0x2f')]),'penalty':0x0,'paused':_0x28586b[_0x1f7a('0x63')],'createdAt':_0x28586b['createdAt'],'updatedAt':_0x28586b[_0x1f7a('0x66')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x1f7a('0x29')](respondWithFilteredResult(_0x25334a,_0x4e392e))[_0x1f7a('0x4c')](handleError(_0x25334a,null));};exports['getTeams']=function(_0x2a044,_0x4b0d48,_0x185381){var _0x1c855b={};var _0x3151ff={};var _0x3ac6c2;var _0x24f7b8;return db[_0x1f7a('0x33')][_0x1f7a('0x5d')]({'where':{'id':_0x2a044[_0x1f7a('0x4e')]['id']}})['then'](handleEntityNotFound(_0x4b0d48,null))[_0x1f7a('0x29')](function(_0x4e6e70){if(_0x4e6e70){_0x3ac6c2=_0x4e6e70;_0x3151ff[_0x1f7a('0x3d')]=_[_0x1f7a('0x39')](db['Team'][_0x1f7a('0x34')]);_0x3151ff[_0x1f7a('0x38')]=_[_0x1f7a('0x39')](_0x2a044['query']);_0x3151ff[_0x1f7a('0x3a')]=_[_0x1f7a('0x3b')](_0x3151ff[_0x1f7a('0x3d')],_0x3151ff[_0x1f7a('0x38')]);_0x1c855b[_0x1f7a('0x3c')]=_[_0x1f7a('0x3b')](_0x3151ff[_0x1f7a('0x3d')],qs[_0x1f7a('0x4f')](_0x2a044[_0x1f7a('0x38')][_0x1f7a('0x4f')]));_0x1c855b[_0x1f7a('0x3c')]=_0x1c855b[_0x1f7a('0x3c')][_0x1f7a('0x3e')]?_0x1c855b['attributes']:_0x3151ff[_0x1f7a('0x3d')];_0x1c855b[_0x1f7a('0x41')]=qs[_0x1f7a('0x42')](_0x2a044[_0x1f7a('0x38')][_0x1f7a('0x42')]);_0x1c855b[_0x1f7a('0x43')]=qs[_0x1f7a('0x3a')](_[_0x1f7a('0x44')](_0x2a044[_0x1f7a('0x38')],_0x3151ff[_0x1f7a('0x3a')]));if(_0x2a044['query'][_0x1f7a('0x45')]){_0x1c855b[_0x1f7a('0x43')]=_[_0x1f7a('0x46')](_0x1c855b[_0x1f7a('0x43')],{'$or':_[_0x1f7a('0x32')](_0x1c855b['attributes'],function(_0x18e032){var _0x2b95a6={};_0x2b95a6[_0x18e032]={'$like':'%'+_0x2a044[_0x1f7a('0x38')]['filter']+'%'};return _0x2b95a6;})});}_0x1c855b=_[_0x1f7a('0x46')]({},_0x1c855b,_0x2a044['options']);return _0x3ac6c2[_0x1f7a('0x67')](_0x1c855b);}})[_0x1f7a('0x29')](function(_0x5b3714){if(_0x5b3714){_0x24f7b8=_0x5b3714[_0x1f7a('0x3e')];if(!_0x2a044[_0x1f7a('0x38')]['hasOwnProperty'](_0x1f7a('0x40'))){_0x1c855b['limit']=qs[_0x1f7a('0x1f')](_0x2a044[_0x1f7a('0x38')]['limit']);_0x1c855b[_0x1f7a('0x22')]=qs[_0x1f7a('0x22')](_0x2a044[_0x1f7a('0x38')][_0x1f7a('0x22')]);}return _0x3ac6c2[_0x1f7a('0x67')](_0x1c855b);}})[_0x1f7a('0x29')](function(_0x4349f7){if(_0x4349f7){return _0x4349f7?{'count':_0x24f7b8,'rows':_0x4349f7}:null;}})[_0x1f7a('0x29')](respondWithResult(_0x4b0d48,null))['catch'](handleError(_0x4b0d48,null));};exports['addTeams']=function(_0xab416d,_0x2422a7,_0x5cb113){var _0x33fae9=_0xab416d[_0x1f7a('0x5a')][_0x1f7a('0x68')];return db[_0x1f7a('0x69')]['findAll']({'where':{'id':_0x33fae9},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0x1f7a('0x2f'),_0x1f7a('0x6a'),_0x1f7a('0x6b'),_0x1f7a('0x6c')],'raw':!![]}]})[_0x1f7a('0x29')](function(_0x4261d9){if(_0x4261d9){var _0x5c4a53=_[_0x1f7a('0x6d')](_0x4261d9,function(_0x1c8485){var _0x34be08=_0x1c8485[_0x1f7a('0x2b')]({'plain':!![]});return _0x34be08['Agents'];});return db[_0x1f7a('0x33')][_0x1f7a('0x50')]({'where':{'id':_0xab416d[_0x1f7a('0x4e')]['id']}})['then'](function(_0xf0f75e){return db[_0x1f7a('0x6e')][_0x1f7a('0x6f')](function(_0x4f9ce9){return _0xf0f75e[_0x1f7a('0x70')](_0x33fae9,{'transaction':_0x4f9ce9})[_0x1f7a('0x29')](function(){return BPromise['each'](_0x5c4a53,function(_0x1948e9){return db[_0x1f7a('0x5e')][_0x1f7a('0x71')]({'where':{'UserId':_0x1948e9['id'],'SmsQueueId':_0xab416d[_0x1f7a('0x4e')]['id']},'transaction':_0x4f9ce9});});})[_0x1f7a('0x29')](function(){_0x5c4a53[_0x1f7a('0x72')](function(_0x348e29){socket[_0x1f7a('0x73')](_0x1f7a('0x74'),{'UserId':_0x348e29['id'],'SmsQueueId':_0xf0f75e['id']});});});});});}})[_0x1f7a('0x29')](respondWithStatusCode(_0x2422a7,null))[_0x1f7a('0x4c')](handleError(_0x2422a7,null));};exports[_0x1f7a('0x75')]=function(_0x39b4c4,_0x550387,_0x4bbc5b){return db[_0x1f7a('0x69')]['findAll']({'where':{'id':_0x39b4c4[_0x1f7a('0x38')]['ids']},'attributes':['id'],'include':[{'model':db['User'],'as':_0x1f7a('0x76'),'attributes':['id'],'raw':!![]}]})[_0x1f7a('0x29')](handleEntityNotFound(_0x550387,null))['then'](function(_0x315ac2){var _0x55de41=_['map'](_0x315ac2,'id');var _0x14cec3=[];var _0x5ac505=[];var _0xa8d7db=squel['select']();_0xa8d7db['field'](_0x1f7a('0x77'))[_0x1f7a('0x78')](_0x1f7a('0x79'),'tq')[_0x1f7a('0x7a')](_0x1f7a('0x7b'),'ut',_0x1f7a('0x7c'))['where'](_0x1f7a('0x7d'),_0x39b4c4['params']['id']);for(var _0x2ac1a7=0x0;_0x2ac1a7<_0x315ac2[_0x1f7a('0x3e')];_0x2ac1a7+=0x1){let _0x1cf1b7=_0x315ac2[_0x2ac1a7];for(var _0x31d679=0x0;_0x31d679<_0x1cf1b7['Agents'][_0x1f7a('0x3e')];_0x31d679+=0x1){let _0xc61189=_0x1cf1b7['Agents'][_0x31d679];var _0x256069=_0xa8d7db[_0x1f7a('0x7e')]();_0x256069[_0x1f7a('0x43')](_0x1f7a('0x7f'),_0xc61189['id']);_0x5ac505[_0x1f7a('0x80')](db['sequelize'][_0x1f7a('0x38')](_0x256069[_0x1f7a('0x81')](),{'type':db[_0x1f7a('0x6e')][_0x1f7a('0x82')][_0x1f7a('0x83')]})[_0x1f7a('0x29')](function(_0x4054ad){if(_0x4054ad[_0x1f7a('0x3e')]===0x1){return _0xc61189['id'];}else{var _0x2ad87c=_[_0x1f7a('0x84')](_[_0x1f7a('0x32')](_0x4054ad,_0x1f7a('0x85')),function(_0x5d970b){return _[_0x1f7a('0x86')](_0x55de41,_0x5d970b);});if(_0x2ad87c){return _0xc61189['id'];}}}));}}return BPromise['all'](_0x5ac505)['then'](function(_0x1c6bf0){_0x14cec3=_(_0x14cec3)[_0x1f7a('0x87')](_0x1c6bf0)[_0x1f7a('0x88')]()['value']();return db[_0x1f7a('0x33')][_0x1f7a('0x50')]({'where':{'id':_0x39b4c4['params']['id']}})[_0x1f7a('0x29')](function(_0x5e58e2){return db[_0x1f7a('0x6e')][_0x1f7a('0x6f')](function(_0xdff79e){return _0x5e58e2[_0x1f7a('0x75')](_0x39b4c4[_0x1f7a('0x38')]['ids'],{'transaction':_0xdff79e})['then'](function(){if(!_[_0x1f7a('0x89')](_0x14cec3)){return _0x5e58e2[_0x1f7a('0x8a')](_0x14cec3,{'transaction':_0xdff79e});}})[_0x1f7a('0x29')](function(){_0x14cec3['forEach'](function(_0x39dd1b){socket[_0x1f7a('0x73')](_0x1f7a('0x8b'),{'UserId':_0x39dd1b,'SmsQueueId':_0x5e58e2['id']});});});});});});})['then'](respondWithStatusCode(_0x550387,null))[_0x1f7a('0x4c')](handleError(_0x550387,null));};exports['addAgents']=function(_0x2ede7a,_0x387fb6,_0x46b890){return db[_0x1f7a('0x33')]['find']({'where':{'id':_0x2ede7a['params']['id']}})['then'](handleEntityNotFound(_0x387fb6,null))[_0x1f7a('0x29')](function(_0x1c75c4){if(_0x1c75c4){return _0x1c75c4[_0x1f7a('0x8c')](_0x2ede7a['body'][_0x1f7a('0x68')],_[_0x1f7a('0x8d')](_0x2ede7a[_0x1f7a('0x5a')],[_0x1f7a('0x68'),'id'])||{})[_0x1f7a('0x8e')](function(_0x42ba0f){for(var _0x59d667=0x0;_0x59d667<_0x2ede7a['body'][_0x1f7a('0x68')][_0x1f7a('0x3e')];_0x59d667+=0x1){socket[_0x1f7a('0x73')](_0x1f7a('0x74'),{'UserId':Number(_0x2ede7a[_0x1f7a('0x5a')][_0x1f7a('0x68')][_0x59d667]),'SmsQueueId':Number(_0x2ede7a[_0x1f7a('0x4e')]['id'])});}return _0x42ba0f;});}})[_0x1f7a('0x29')](respondWithResult(_0x387fb6,null))['catch'](handleError(_0x387fb6,null));};exports[_0x1f7a('0x8a')]=function(_0x33ef6e,_0x1e9a3a,_0x18ca79){return db[_0x1f7a('0x33')][_0x1f7a('0x50')]({'where':{'id':_0x33ef6e[_0x1f7a('0x4e')]['id']}})[_0x1f7a('0x29')](handleEntityNotFound(_0x1e9a3a,null))[_0x1f7a('0x29')](function(_0x36a288){if(_0x36a288){return _0x36a288['removeAgents'](_0x33ef6e['query'][_0x1f7a('0x68')])[_0x1f7a('0x29')](function(){if(_[_0x1f7a('0x8f')](_0x33ef6e[_0x1f7a('0x38')][_0x1f7a('0x68')])){for(var _0x379d48=0x0;_0x379d48<_0x33ef6e[_0x1f7a('0x38')][_0x1f7a('0x68')][_0x1f7a('0x3e')];_0x379d48+=0x1){socket[_0x1f7a('0x73')](_0x1f7a('0x8b'),{'UserId':Number(_0x33ef6e[_0x1f7a('0x38')][_0x1f7a('0x68')][_0x379d48]),'SmsQueueId':Number(_0x33ef6e['params']['id'])});}}else{socket[_0x1f7a('0x73')]('userSmsQueue:remove',{'UserId':Number(_0x33ef6e[_0x1f7a('0x38')]['ids']),'SmsQueueId':Number(_0x33ef6e[_0x1f7a('0x4e')]['id'])});}});}})[_0x1f7a('0x29')](respondWithStatusCode(_0x1e9a3a,null))[_0x1f7a('0x4c')](handleError(_0x1e9a3a,null));};exports[_0x1f7a('0x90')]=function(_0x5c5a2a,_0xfdda85,_0x3f1dc9){var _0xda7839={};var _0xa5e06={};var _0x147ab2;var _0x4c7857;return db[_0x1f7a('0x33')][_0x1f7a('0x5d')]({'where':{'id':_0x5c5a2a[_0x1f7a('0x4e')]['id']}})[_0x1f7a('0x29')](handleEntityNotFound(_0xfdda85,null))['then'](function(_0xe8c0b2){if(_0xe8c0b2){_0x147ab2=_0xe8c0b2;_0xa5e06[_0x1f7a('0x3d')]=_[_0x1f7a('0x39')](db[_0x1f7a('0x60')]['rawAttributes']);_0xa5e06[_0x1f7a('0x38')]=_[_0x1f7a('0x39')](_0x5c5a2a[_0x1f7a('0x38')]);_0xa5e06[_0x1f7a('0x3a')]=_[_0x1f7a('0x3b')](_0xa5e06[_0x1f7a('0x3d')],_0xa5e06[_0x1f7a('0x38')]);_0xda7839[_0x1f7a('0x3c')]=_[_0x1f7a('0x3b')](_0xa5e06[_0x1f7a('0x3d')],qs['fields'](_0x5c5a2a['query'][_0x1f7a('0x4f')]));_0xda7839[_0x1f7a('0x3c')]=_0xda7839[_0x1f7a('0x3c')][_0x1f7a('0x3e')]?_0xda7839[_0x1f7a('0x3c')]:_0xa5e06[_0x1f7a('0x3d')];_0xda7839['order']=qs[_0x1f7a('0x42')](_0x5c5a2a[_0x1f7a('0x38')]['sort']);_0xda7839[_0x1f7a('0x43')]=qs[_0x1f7a('0x3a')](_[_0x1f7a('0x44')](_0x5c5a2a['query'],_0xa5e06[_0x1f7a('0x3a')]));if(_0x5c5a2a[_0x1f7a('0x38')][_0x1f7a('0x45')]){_0xda7839[_0x1f7a('0x43')]=_[_0x1f7a('0x46')](_0xda7839[_0x1f7a('0x43')],{'$or':_[_0x1f7a('0x32')](_0xda7839['attributes'],function(_0x54e89d){var _0x561d7e={};_0x561d7e[_0x54e89d]={'$like':'%'+_0x5c5a2a['query'][_0x1f7a('0x45')]+'%'};return _0x561d7e;})});}_0xda7839=_['merge']({},_0xda7839,_0x5c5a2a['options']);return _0x147ab2[_0x1f7a('0x90')](_0xda7839);}})[_0x1f7a('0x29')](function(_0x175a17){if(_0x175a17){_0x4c7857=_0x175a17[_0x1f7a('0x3e')];if(!_0x5c5a2a[_0x1f7a('0x38')][_0x1f7a('0x3f')](_0x1f7a('0x40'))){_0xda7839[_0x1f7a('0x1f')]=qs[_0x1f7a('0x1f')](_0x5c5a2a[_0x1f7a('0x38')]['limit']);_0xda7839[_0x1f7a('0x22')]=qs[_0x1f7a('0x22')](_0x5c5a2a[_0x1f7a('0x38')][_0x1f7a('0x22')]);}return _0x147ab2['getAgents'](_0xda7839);}})[_0x1f7a('0x29')](function(_0xc2996e){if(_0xc2996e){return _0xc2996e?{'count':_0x4c7857,'rows':_0xc2996e}:null;}})['then'](respondWithResult(_0xfdda85,null))[_0x1f7a('0x4c')](handleError(_0xfdda85,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index f26c87b..ba05af8 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 _0x2dad=['update','remove','emit','hasOwnProperty','events','../../mysqldb','SmsQueue','setMaxListeners','save'];(function(_0x2bf141,_0x31eac7){var _0x48277b=function(_0x9fe560){while(--_0x9fe560){_0x2bf141['push'](_0x2bf141['shift']());}};_0x48277b(++_0x31eac7);}(_0x2dad,0x1cf));var _0xd2da=function(_0x178867,_0xa3b61){_0x178867=_0x178867-0x0;var _0x1e8aa2=_0x2dad[_0x178867];return _0x1e8aa2;};'use strict';var EventEmitter=require(_0xd2da('0x0'));var SmsQueue=require(_0xd2da('0x1'))['db'][_0xd2da('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xd2da('0x3')](0x0);var events={'afterCreate':_0xd2da('0x4'),'afterUpdate':_0xd2da('0x5'),'afterDestroy':_0xd2da('0x6')};function emitEvent(_0x17ef91){return function(_0x1b02c7,_0x3ca067,_0x5be107){SmsQueueEvents[_0xd2da('0x7')](_0x17ef91+':'+_0x1b02c7['id'],_0x1b02c7);SmsQueueEvents[_0xd2da('0x7')](_0x17ef91,_0x1b02c7);_0x5be107(null);};}for(var e in events){if(events[_0xd2da('0x8')](e)){var event=events[e];SmsQueue['hook'](e,emitEvent(event));}}module['exports']=SmsQueueEvents; \ No newline at end of file +var _0xf836=['emit','hasOwnProperty','exports','events','../../mysqldb','SmsQueue','save','update'];(function(_0x180659,_0xa1b1c4){var _0x224761=function(_0xe29201){while(--_0xe29201){_0x180659['push'](_0x180659['shift']());}};_0x224761(++_0xa1b1c4);}(_0xf836,0x12b));var _0x6f83=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xf836[_0x321bb2];return _0x9c12ed;};'use strict';var EventEmitter=require(_0x6f83('0x0'));var SmsQueue=require(_0x6f83('0x1'))['db'][_0x6f83('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6f83('0x3'),'afterUpdate':_0x6f83('0x4'),'afterDestroy':'remove'};function emitEvent(_0x2a190a){return function(_0x7fabbd,_0x304174,_0xdbb858){SmsQueueEvents[_0x6f83('0x5')](_0x2a190a+':'+_0x7fabbd['id'],_0x7fabbd);SmsQueueEvents[_0x6f83('0x5')](_0x2a190a,_0x7fabbd);_0xdbb858(null);};}for(var e in events){if(events[_0x6f83('0x6')](e)){var event=events[e];SmsQueue['hook'](e,emitEvent(event));}}module[_0x6f83('0x7')]=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index 945cb75..e0c08dd 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 _0xf609=['request-promise','path','rimraf','./smsQueue.attributes','exports','define','SmsQueue','sms_queues','util','../../config/logger'];(function(_0x237625,_0x143187){var _0x59a363=function(_0x292458){while(--_0x292458){_0x237625['push'](_0x237625['shift']());}};_0x59a363(++_0x143187);}(_0xf609,0x1f2));var _0x9f60=function(_0x18b065,_0x5aea14){_0x18b065=_0x18b065-0x0;var _0xb23375=_0xf609[_0x18b065];return _0xb23375;};'use strict';var _=require('lodash');var util=require(_0x9f60('0x0'));var logger=require(_0x9f60('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9f60('0x2'));var fs=require('fs');var path=require(_0x9f60('0x3'));var rimraf=require(_0x9f60('0x4'));var config=require('../../config/environment');var attributes=require(_0x9f60('0x5'));module[_0x9f60('0x6')]=function(_0x43e1b8,_0x3f400e){return _0x43e1b8[_0x9f60('0x7')](_0x9f60('0x8'),attributes,{'tableName':_0x9f60('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6d9b=['request-promise','path','rimraf','../../config/environment','./smsQueue.attributes','exports','define','SmsQueue','sms_queues','../../config/logger','moment'];(function(_0x400917,_0x21ac86){var _0x4d7007=function(_0x3e6851){while(--_0x3e6851){_0x400917['push'](_0x400917['shift']());}};_0x4d7007(++_0x21ac86);}(_0x6d9b,0x1ed));var _0xb6d9=function(_0x13ccd8,_0x1dfef9){_0x13ccd8=_0x13ccd8-0x0;var _0x40b74c=_0x6d9b[_0x13ccd8];return _0x40b74c;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xb6d9('0x0'))('api');var moment=require(_0xb6d9('0x1'));var BPromise=require('bluebird');var rp=require(_0xb6d9('0x2'));var fs=require('fs');var path=require(_0xb6d9('0x3'));var rimraf=require(_0xb6d9('0x4'));var config=require(_0xb6d9('0x5'));var attributes=require(_0xb6d9('0x6'));module[_0xb6d9('0x7')]=function(_0xf0b2c,_0x1a1764){return _0xf0b2c[_0xb6d9('0x8')](_0xb6d9('0x9'),attributes,{'tableName':_0xb6d9('0xa'),'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 a4004ec..4b7b5c2 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 _0xea5b=['code','message','result','catch','GetSmsQueue','SmsQueue','findAll','options','where','attributes','limit','include','model','map','then','ShowSmsQueue','find','raw','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','register','request','info','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x2c50c6,_0x1138cf){var _0x29c06c=function(_0x486927){while(--_0x486927){_0x2c50c6['push'](_0x2c50c6['shift']());}};_0x29c06c(++_0x1138cf);}(_0xea5b,0x183));var _0xbea5=function(_0x7e2eb0,_0x17cd58){_0x7e2eb0=_0x7e2eb0-0x0;var _0xd92de4=_0xea5b[_0x7e2eb0];return _0xd92de4;};'use strict';var _=require(_0xbea5('0x0'));var util=require(_0xbea5('0x1'));var moment=require(_0xbea5('0x2'));var BPromise=require('bluebird');var rs=require(_0xbea5('0x3'));var fs=require('fs');var Redis=require(_0xbea5('0x4'));var db=require(_0xbea5('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xbea5('0x6'))(_0xbea5('0x7'));var config=require(_0xbea5('0x8'));var jayson=require(_0xbea5('0x9'));var client=jayson['client'][_0xbea5('0xa')]({'port':0x232a});config[_0xbea5('0xb')]=_['defaults'](config[_0xbea5('0xb')],{'host':_0xbea5('0xc'),'port':0x18eb});var socket=require(_0xbea5('0xd'))(new Redis(config[_0xbea5('0xb')]));require('./smsQueue.socket')[_0xbea5('0xe')](socket);function respondWithRpcPromise(_0x1cd8aa,_0x3bd99f,_0x2085b0){return new BPromise(function(_0x2229d7,_0x1bf122){return client[_0xbea5('0xf')](_0x1cd8aa,_0x2085b0)['then'](function(_0x22ea72){logger[_0xbea5('0x10')](_0xbea5('0x11'),_0x3bd99f,_0xbea5('0x12'));logger[_0xbea5('0x13')](_0xbea5('0x14'),_0x3bd99f,_0xbea5('0x12'),JSON[_0xbea5('0x15')](_0x22ea72));if(_0x22ea72['error']){if(_0x22ea72[_0xbea5('0x16')][_0xbea5('0x17')]===0x1f4){logger[_0xbea5('0x16')](_0xbea5('0x11'),_0x3bd99f,_0x22ea72[_0xbea5('0x16')][_0xbea5('0x18')]);return _0x1bf122(_0x22ea72[_0xbea5('0x16')][_0xbea5('0x18')]);}logger[_0xbea5('0x16')](_0xbea5('0x11'),_0x3bd99f,_0x22ea72[_0xbea5('0x16')][_0xbea5('0x18')]);return _0x2229d7(_0x22ea72[_0xbea5('0x16')][_0xbea5('0x18')]);}else{logger['info'](_0xbea5('0x11'),_0x3bd99f,_0xbea5('0x12'));_0x2229d7(_0x22ea72[_0xbea5('0x19')]['message']);}})[_0xbea5('0x1a')](function(_0x3af208){logger[_0xbea5('0x16')](_0xbea5('0x11'),_0x3bd99f,_0x3af208);_0x1bf122(_0x3af208);});});}exports[_0xbea5('0x1b')]=function(_0x469ab0){var _0x38a42b=this;return new Promise(function(_0x4c61a1,_0x270712){return db[_0xbea5('0x1c')][_0xbea5('0x1d')]({'raw':_0x469ab0[_0xbea5('0x1e')]?_0x469ab0['options']['raw']===undefined?!![]:![]:!![],'where':_0x469ab0['options']?_0x469ab0[_0xbea5('0x1e')][_0xbea5('0x1f')]||null:null,'attributes':_0x469ab0[_0xbea5('0x1e')]?_0x469ab0[_0xbea5('0x1e')][_0xbea5('0x20')]||null:null,'limit':_0x469ab0['options']?_0x469ab0['options'][_0xbea5('0x21')]||null:null,'include':_0x469ab0['options']?_0x469ab0[_0xbea5('0x1e')]['include']?_['map'](_0x469ab0[_0xbea5('0x1e')][_0xbea5('0x22')],function(_0x175ed9){return{'model':db[_0x175ed9[_0xbea5('0x23')]],'as':_0x175ed9['as'],'attributes':_0x175ed9[_0xbea5('0x20')],'include':_0x175ed9['include']?_['map'](_0x175ed9['include'],function(_0x42ad22){return{'model':db[_0x42ad22['model']],'as':_0x42ad22['as'],'attributes':_0x42ad22[_0xbea5('0x20')],'include':_0x42ad22['include']?_[_0xbea5('0x24')](_0x42ad22['include'],function(_0x522b65){return{'model':db[_0x522b65[_0xbea5('0x23')]],'as':_0x522b65['as'],'attributes':_0x522b65['attributes']};}):[]};}):[]};}):[]:[]})[_0xbea5('0x25')](function(_0x1da0d0){logger['info'](_0xbea5('0x1b'),_0x469ab0);logger['debug']('GetSmsQueue',_0x469ab0,JSON[_0xbea5('0x15')](_0x1da0d0));_0x4c61a1(_0x1da0d0);})['catch'](function(_0x2309fa){logger['error'](_0xbea5('0x1b'),_0x2309fa[_0xbea5('0x18')],_0x469ab0);_0x270712(_0x38a42b[_0xbea5('0x16')](0x1f4,_0x2309fa[_0xbea5('0x18')]));});});};exports[_0xbea5('0x26')]=function(_0x33c03f){var _0x1a1c13=this;return new Promise(function(_0x3d8759,_0x1c99c4){return db['SmsQueue'][_0xbea5('0x27')]({'raw':_0x33c03f[_0xbea5('0x1e')]?_0x33c03f['options'][_0xbea5('0x28')]===undefined?!![]:![]:!![],'where':_0x33c03f['options']?_0x33c03f[_0xbea5('0x1e')][_0xbea5('0x1f')]||null:null,'attributes':_0x33c03f[_0xbea5('0x1e')]?_0x33c03f[_0xbea5('0x1e')]['attributes']||null:null,'include':_0x33c03f[_0xbea5('0x1e')]?_0x33c03f[_0xbea5('0x1e')][_0xbea5('0x22')]?_[_0xbea5('0x24')](_0x33c03f['options']['include'],function(_0x1891b3){return{'model':db[_0x1891b3[_0xbea5('0x23')]],'as':_0x1891b3['as'],'attributes':_0x1891b3['attributes'],'include':_0x1891b3['include']?_[_0xbea5('0x24')](_0x1891b3['include'],function(_0x267a7f){return{'model':db[_0x267a7f[_0xbea5('0x23')]],'as':_0x267a7f['as'],'attributes':_0x267a7f[_0xbea5('0x20')],'include':_0x267a7f[_0xbea5('0x22')]?_[_0xbea5('0x24')](_0x267a7f[_0xbea5('0x22')],function(_0xaad620){return{'model':db[_0xaad620[_0xbea5('0x23')]],'as':_0xaad620['as'],'attributes':_0xaad620[_0xbea5('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x17e259){logger[_0xbea5('0x10')](_0xbea5('0x26'),_0x33c03f);logger[_0xbea5('0x13')](_0xbea5('0x26'),_0x33c03f,JSON[_0xbea5('0x15')](_0x17e259));_0x3d8759(_0x17e259);})[_0xbea5('0x1a')](function(_0x555d92){logger['error'](_0xbea5('0x26'),_0x555d92[_0xbea5('0x18')],_0x33c03f);_0x1c99c4(_0x1a1c13[_0xbea5('0x16')](0x1f4,_0x555d92['message']));});});}; \ No newline at end of file +var _0x60f6=['../../config/logger','rpc','../../config/environment','client','socket.io-emitter','redis','./smsQueue.socket','register','request','then','info','SmsQueue,\x20%s,\x20%s','request\x20sent','SmsQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','findAll','options','raw','where','limit','include','model','attributes','debug','GetSmsQueue','find','map','ShowSmsQueue','stringify','util','ioredis','../../config/utils'];(function(_0x5d48d9,_0x385f83){var _0x9330db=function(_0x19856e){while(--_0x19856e){_0x5d48d9['push'](_0x5d48d9['shift']());}};_0x9330db(++_0x385f83);}(_0x60f6,0x8d));var _0x660f=function(_0x25f39c,_0x4f231a){_0x25f39c=_0x25f39c-0x0;var _0x19bb4a=_0x60f6[_0x25f39c];return _0x19bb4a;};'use strict';var _=require('lodash');var util=require(_0x660f('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x660f('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0x660f('0x2'));var logger=require(_0x660f('0x3'))(_0x660f('0x4'));var config=require(_0x660f('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x660f('0x6')]['http']({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x660f('0x7'))(new Redis(config[_0x660f('0x8')]));require(_0x660f('0x9'))[_0x660f('0xa')](socket);function respondWithRpcPromise(_0xb082fa,_0x583ad4,_0x19bfbf){return new BPromise(function(_0x4773df,_0x1f15c5){return client[_0x660f('0xb')](_0xb082fa,_0x19bfbf)[_0x660f('0xc')](function(_0x5359c6){logger[_0x660f('0xd')](_0x660f('0xe'),_0x583ad4,_0x660f('0xf'));logger['debug'](_0x660f('0x10'),_0x583ad4,'request\x20sent',JSON['stringify'](_0x5359c6));if(_0x5359c6[_0x660f('0x11')]){if(_0x5359c6[_0x660f('0x11')][_0x660f('0x12')]===0x1f4){logger[_0x660f('0x11')](_0x660f('0xe'),_0x583ad4,_0x5359c6[_0x660f('0x11')][_0x660f('0x13')]);return _0x1f15c5(_0x5359c6[_0x660f('0x11')]['message']);}logger[_0x660f('0x11')](_0x660f('0xe'),_0x583ad4,_0x5359c6[_0x660f('0x11')]['message']);return _0x4773df(_0x5359c6[_0x660f('0x11')][_0x660f('0x13')]);}else{logger[_0x660f('0xd')](_0x660f('0xe'),_0x583ad4,_0x660f('0xf'));_0x4773df(_0x5359c6[_0x660f('0x14')][_0x660f('0x13')]);}})[_0x660f('0x15')](function(_0x9c5c9c){logger['error'](_0x660f('0xe'),_0x583ad4,_0x9c5c9c);_0x1f15c5(_0x9c5c9c);});});}exports['GetSmsQueue']=function(_0x593edb){var _0x709a6a=this;return new Promise(function(_0x23f6ce,_0x574d89){return db['SmsQueue'][_0x660f('0x16')]({'raw':_0x593edb[_0x660f('0x17')]?_0x593edb[_0x660f('0x17')][_0x660f('0x18')]===undefined?!![]:![]:!![],'where':_0x593edb[_0x660f('0x17')]?_0x593edb['options'][_0x660f('0x19')]||null:null,'attributes':_0x593edb[_0x660f('0x17')]?_0x593edb['options']['attributes']||null:null,'limit':_0x593edb[_0x660f('0x17')]?_0x593edb[_0x660f('0x17')][_0x660f('0x1a')]||null:null,'include':_0x593edb['options']?_0x593edb[_0x660f('0x17')][_0x660f('0x1b')]?_['map'](_0x593edb[_0x660f('0x17')]['include'],function(_0x3a7e2d){return{'model':db[_0x3a7e2d[_0x660f('0x1c')]],'as':_0x3a7e2d['as'],'attributes':_0x3a7e2d[_0x660f('0x1d')],'include':_0x3a7e2d[_0x660f('0x1b')]?_['map'](_0x3a7e2d[_0x660f('0x1b')],function(_0x5c9590){return{'model':db[_0x5c9590[_0x660f('0x1c')]],'as':_0x5c9590['as'],'attributes':_0x5c9590['attributes'],'include':_0x5c9590['include']?_['map'](_0x5c9590[_0x660f('0x1b')],function(_0x2e9d3d){return{'model':db[_0x2e9d3d[_0x660f('0x1c')]],'as':_0x2e9d3d['as'],'attributes':_0x2e9d3d[_0x660f('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x660f('0xc')](function(_0x7850d2){logger[_0x660f('0xd')]('GetSmsQueue',_0x593edb);logger[_0x660f('0x1e')](_0x660f('0x1f'),_0x593edb,JSON['stringify'](_0x7850d2));_0x23f6ce(_0x7850d2);})[_0x660f('0x15')](function(_0x283769){logger[_0x660f('0x11')](_0x660f('0x1f'),_0x283769[_0x660f('0x13')],_0x593edb);_0x574d89(_0x709a6a[_0x660f('0x11')](0x1f4,_0x283769[_0x660f('0x13')]));});});};exports['ShowSmsQueue']=function(_0x5c9271){var _0x5bed1f=this;return new Promise(function(_0x49748a,_0x50067a){return db['SmsQueue'][_0x660f('0x20')]({'raw':_0x5c9271['options']?_0x5c9271['options'][_0x660f('0x18')]===undefined?!![]:![]:!![],'where':_0x5c9271[_0x660f('0x17')]?_0x5c9271['options']['where']||null:null,'attributes':_0x5c9271[_0x660f('0x17')]?_0x5c9271[_0x660f('0x17')][_0x660f('0x1d')]||null:null,'include':_0x5c9271[_0x660f('0x17')]?_0x5c9271[_0x660f('0x17')][_0x660f('0x1b')]?_[_0x660f('0x21')](_0x5c9271[_0x660f('0x17')][_0x660f('0x1b')],function(_0x1b91df){return{'model':db[_0x1b91df[_0x660f('0x1c')]],'as':_0x1b91df['as'],'attributes':_0x1b91df[_0x660f('0x1d')],'include':_0x1b91df[_0x660f('0x1b')]?_[_0x660f('0x21')](_0x1b91df[_0x660f('0x1b')],function(_0x5293fe){return{'model':db[_0x5293fe['model']],'as':_0x5293fe['as'],'attributes':_0x5293fe['attributes'],'include':_0x5293fe['include']?_['map'](_0x5293fe['include'],function(_0x108097){return{'model':db[_0x108097['model']],'as':_0x108097['as'],'attributes':_0x108097['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2e0281){logger['info'](_0x660f('0x22'),_0x5c9271);logger['debug'](_0x660f('0x22'),_0x5c9271,JSON[_0x660f('0x23')](_0x2e0281));_0x49748a(_0x2e0281);})[_0x660f('0x15')](function(_0x837d99){logger[_0x660f('0x11')](_0x660f('0x22'),_0x837d99['message'],_0x5c9271);_0x50067a(_0x5bed1f[_0x660f('0x11')](0x1f4,_0x837d99[_0x660f('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index 43d07ec..7bb5478 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 _0x9bcb=['register','length','smsQueue:','./smsQueue.events','save','emit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9bcb,0x1ef));var _0xb9bc=function(_0x4f1ae3,_0x56855d){_0x4f1ae3=_0x4f1ae3-0x0;var _0x25b8f0=_0x9bcb[_0x4f1ae3];return _0x25b8f0;};'use strict';var SmsQueueEvents=require(_0xb9bc('0x0'));var events=[_0xb9bc('0x1'),'remove','update'];function createListener(_0x3986ea,_0x193489){return function(_0x58c6c4){_0x193489[_0xb9bc('0x2')](_0x3986ea,_0x58c6c4);};}function removeListener(_0x53c2c5,_0x313d11){return function(){SmsQueueEvents['removeListener'](_0x53c2c5,_0x313d11);};}exports[_0xb9bc('0x3')]=function(_0x21a989){for(var _0x2953fb=0x0,_0x24d2c5=events[_0xb9bc('0x4')];_0x2953fb<_0x24d2c5;_0x2953fb++){var _0x2df6ec=events[_0x2953fb];var _0x41fdb2=createListener(_0xb9bc('0x5')+_0x2df6ec,_0x21a989);SmsQueueEvents['on'](_0x2df6ec,_0x41fdb2);}}; \ No newline at end of file +var _0xd1eb=['remove','update','emit','register','length','smsQueue:','./smsQueue.events','save'];(function(_0x5de6ef,_0x152a5c){var _0x2b3c9c=function(_0x43e2de){while(--_0x43e2de){_0x5de6ef['push'](_0x5de6ef['shift']());}};_0x2b3c9c(++_0x152a5c);}(_0xd1eb,0x86));var _0xbd1e=function(_0x9261b8,_0x7d1a81){_0x9261b8=_0x9261b8-0x0;var _0x58f5e8=_0xd1eb[_0x9261b8];return _0x58f5e8;};'use strict';var SmsQueueEvents=require(_0xbd1e('0x0'));var events=[_0xbd1e('0x1'),_0xbd1e('0x2'),_0xbd1e('0x3')];function createListener(_0x3ec530,_0x32d6b0){return function(_0x23fd54){_0x32d6b0[_0xbd1e('0x4')](_0x3ec530,_0x23fd54);};}function removeListener(_0x36986b,_0x126c1e){return function(){SmsQueueEvents['removeListener'](_0x36986b,_0x126c1e);};}exports[_0xbd1e('0x5')]=function(_0xdf5cd5){for(var _0x205068=0x0,_0x3f3885=events[_0xbd1e('0x6')];_0x205068<_0x3f3885;_0x205068++){var _0x56a09a=events[_0x205068];var _0x1df604=createListener(_0xbd1e('0x7')+_0x56a09a,_0xdf5cd5);SmsQueueEvents['on'](_0x56a09a,_0x1df604);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index cc76df9..3abad57 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 _0x5c91=['show','post','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x14076e,_0x776d5c){var _0x1e9c14=function(_0x4f404f){while(--_0x4f404f){_0x14076e['push'](_0x14076e['shift']());}};_0x1e9c14(++_0x776d5c);}(_0x5c91,0x1e9));var _0x15c9=function(_0x3a190a,_0x2893cb){_0x3a190a=_0x3a190a-0x0;var _0x3065e9=_0x5c91[_0x3a190a];return _0x3065e9;};'use strict';var multer=require(_0x15c9('0x0'));var util=require(_0x15c9('0x1'));var path=require(_0x15c9('0x2'));var timeout=require('connect-timeout');var express=require(_0x15c9('0x3'));var router=express[_0x15c9('0x4')]();var fs_extra=require(_0x15c9('0x5'));var auth=require(_0x15c9('0x6'));var interaction=require(_0x15c9('0x7'));var config=require(_0x15c9('0x8'));var controller=require('./smsQueueReport.controller');router[_0x15c9('0x9')]('/',auth[_0x15c9('0xa')](),controller[_0x15c9('0xb')]);router[_0x15c9('0x9')](_0x15c9('0xc'),auth['isAuthenticated'](),controller[_0x15c9('0xd')]);router[_0x15c9('0x9')](_0x15c9('0xe'),auth['isAuthenticated'](),controller[_0x15c9('0xf')]);router[_0x15c9('0x10')]('/',auth[_0x15c9('0xa')](),controller['create']);router['put'](_0x15c9('0xe'),auth[_0x15c9('0xa')](),controller['update']);router['delete']('/:id',auth[_0x15c9('0xa')](),controller[_0x15c9('0x11')]);module['exports']=router; \ No newline at end of file +var _0x1c9c=['/:id','post','update','delete','destroy','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueueReport.controller','get','index','isAuthenticated','describe'];(function(_0x2ddb34,_0x7e8050){var _0x48e6bb=function(_0x9ba3d9){while(--_0x9ba3d9){_0x2ddb34['push'](_0x2ddb34['shift']());}};_0x48e6bb(++_0x7e8050);}(_0x1c9c,0xa7));var _0xc1c9=function(_0x2d08b9,_0x2fee02){_0x2d08b9=_0x2d08b9-0x0;var _0x34c713=_0x1c9c[_0x2d08b9];return _0x34c713;};'use strict';var multer=require('multer');var util=require(_0xc1c9('0x0'));var path=require(_0xc1c9('0x1'));var timeout=require(_0xc1c9('0x2'));var express=require(_0xc1c9('0x3'));var router=express['Router']();var fs_extra=require(_0xc1c9('0x4'));var auth=require(_0xc1c9('0x5'));var interaction=require(_0xc1c9('0x6'));var config=require(_0xc1c9('0x7'));var controller=require(_0xc1c9('0x8'));router[_0xc1c9('0x9')]('/',auth['isAuthenticated'](),controller[_0xc1c9('0xa')]);router['get']('/describe',auth[_0xc1c9('0xb')](),controller[_0xc1c9('0xc')]);router['get'](_0xc1c9('0xd'),auth['isAuthenticated'](),controller['show']);router[_0xc1c9('0xe')]('/',auth[_0xc1c9('0xb')](),controller['create']);router['put'](_0xc1c9('0xd'),auth[_0xc1c9('0xb')](),controller[_0xc1c9('0xf')]);router[_0xc1c9('0x10')](_0xc1c9('0xd'),auth['isAuthenticated'](),controller[_0xc1c9('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index 44340b5..a7b97c3 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 _0x041d=['STRING','DATE','moment','exports'];(function(_0x59ae8f,_0x148344){var _0x3900b5=function(_0x63af51){while(--_0x63af51){_0x59ae8f['push'](_0x59ae8f['shift']());}};_0x3900b5(++_0x148344);}(_0x041d,0xce));var _0xd041=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0x041d[_0x36eaaa];return _0x461349;};'use strict';var moment=require(_0xd041('0x0'));var Sequelize=require('sequelize');module[_0xd041('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xd041('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xd041('0x3')]},'acceptAt':{'type':Sequelize[_0xd041('0x3')]},'exitAt':{'type':Sequelize[_0xd041('0x3')]},'reason':{'type':Sequelize[_0xd041('0x2')]}}; \ No newline at end of file +var _0xab61=['STRING','DATE','moment','sequelize','exports'];(function(_0x484a6f,_0x41cf25){var _0x4796db=function(_0x3d5222){while(--_0x3d5222){_0x484a6f['push'](_0x484a6f['shift']());}};_0x4796db(++_0x41cf25);}(_0xab61,0x179));var _0x1ab6=function(_0x35cf91,_0x162313){_0x35cf91=_0x35cf91-0x0;var _0x3aab68=_0xab61[_0x35cf91];return _0x3aab68;};'use strict';var moment=require(_0x1ab6('0x0'));var Sequelize=require(_0x1ab6('0x1'));module[_0x1ab6('0x2')]={'uniqueid':{'type':Sequelize[_0x1ab6('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x1ab6('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x1ab6('0x4')]},'acceptAt':{'type':Sequelize[_0x1ab6('0x4')]},'exitAt':{'type':Sequelize[_0x1ab6('0x4')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index 06dfc9c..35cf44e 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 _0x6970=['../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','Content-Range','reject','save','destroy','then','name','map','SmsQueueReport','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','includeAll','findAll','show','rawAttributes','include','find','create','body','update','params','catch','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils'];(function(_0x414594,_0xfc8177){var _0x30700c=function(_0x4668f4){while(--_0x4668f4){_0x414594['push'](_0x414594['shift']());}};_0x30700c(++_0xfc8177);}(_0x6970,0x102));var _0x0697=function(_0x353e5b,_0x2fd6e1){_0x353e5b=_0x353e5b-0x0;var _0xbcb30d=_0x6970[_0x353e5b];return _0xbcb30d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0697('0x0'));var zipdir=require(_0x0697('0x1'));var jsonpatch=require(_0x0697('0x2'));var rp=require(_0x0697('0x3'));var moment=require(_0x0697('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x0697('0x5'));var util=require(_0x0697('0x6'));var path=require(_0x0697('0x7'));var sox=require(_0x0697('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0697('0x9'));var _=require(_0x0697('0xa'));var squel=require(_0x0697('0xb'));var crypto=require('crypto');var jsforce=require(_0x0697('0xc'));var deskjs=require(_0x0697('0xd'));var toCsv=require(_0x0697('0xe'));var querystring=require(_0x0697('0xf'));var Papa=require(_0x0697('0x10'));var Redis=require('ioredis');var authService=require(_0x0697('0x11'));var qs=require(_0x0697('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0697('0x13'));var logger=require('../../config/logger')(_0x0697('0x14'));var utils=require(_0x0697('0x15'));var config=require(_0x0697('0x16'));var licenseUtil=require(_0x0697('0x17'));var db=require(_0x0697('0x18'))['db'];function respondWithStatusCode(_0x45116f,_0x489163){_0x489163=_0x489163||0xcc;return function(_0x2cfc10){if(_0x2cfc10){return _0x45116f[_0x0697('0x19')](_0x489163);}return _0x45116f[_0x0697('0x1a')](_0x489163)[_0x0697('0x1b')]();};}function respondWithResult(_0x366d61,_0x1cc5dc){_0x1cc5dc=_0x1cc5dc||0xc8;return function(_0x269d5d){if(_0x269d5d){return _0x366d61[_0x0697('0x1a')](_0x1cc5dc)['json'](_0x269d5d);}};}function respondWithFilteredResult(_0x32a35d,_0x5b6aac){return function(_0x59e091){if(_0x59e091){var _0x580d4a=typeof _0x5b6aac['offset']===_0x0697('0x1c')&&typeof _0x5b6aac[_0x0697('0x1d')]===_0x0697('0x1c');var _0x2bde38=_0x59e091[_0x0697('0x1e')];var _0x2b882a=_0x580d4a?0x0:_0x5b6aac['offset'];var _0x130d99=_0x580d4a?_0x59e091[_0x0697('0x1e')]:_0x5b6aac[_0x0697('0x1f')]+_0x5b6aac[_0x0697('0x1d')];var _0x485297;if(_0x130d99>=_0x2bde38){_0x130d99=_0x2bde38;_0x485297=0xc8;}else{_0x485297=0xce;}_0x32a35d[_0x0697('0x1a')](_0x485297);return _0x32a35d[_0x0697('0x20')](_0x0697('0x21'),_0x2b882a+'-'+_0x130d99+'/'+_0x2bde38)['json'](_0x59e091);}return null;};}function patchUpdates(_0x249dd6){return function(_0x2a17d4){try{jsonpatch['apply'](_0x2a17d4,_0x249dd6,!![]);}catch(_0xaa5155){return BPromise[_0x0697('0x22')](_0xaa5155);}return _0x2a17d4[_0x0697('0x23')]();};}function saveUpdates(_0x104208,_0x46cb75){return function(_0x1b124c){if(_0x1b124c){return _0x1b124c['update'](_0x104208)['then'](function(_0x461993){return _0x461993;});}return null;};}function removeEntity(_0x5cbe52,_0xaccf0e){return function(_0x150fa2){if(_0x150fa2){return _0x150fa2[_0x0697('0x24')]()[_0x0697('0x25')](function(){_0x5cbe52[_0x0697('0x1a')](0xcc)[_0x0697('0x1b')]();});}};}function handleEntityNotFound(_0x3d4719,_0x4c6270){return function(_0x87965a){if(!_0x87965a){_0x3d4719[_0x0697('0x19')](0x194);}return _0x87965a;};}function handleError(_0x382cc1,_0x15a9b2){_0x15a9b2=_0x15a9b2||0x1f4;return function(_0xbe842e){logger['error'](_0xbe842e['stack']);if(_0xbe842e[_0x0697('0x26')]){delete _0xbe842e['name'];}_0x382cc1[_0x0697('0x1a')](_0x15a9b2)['send'](_0xbe842e);};}exports['index']=function(_0x2d53f8,_0x4ce006){var _0x2f4ba0={},_0x5585be={},_0xd7c884={'count':0x0,'rows':[]};var _0x483fec=_[_0x0697('0x27')](db[_0x0697('0x28')]['rawAttributes'],function(_0x6e9737){return{'name':_0x6e9737['fieldName'],'type':_0x6e9737['type'][_0x0697('0x29')]};});_0x5585be['model']=_[_0x0697('0x27')](_0x483fec,_0x0697('0x26'));_0x5585be[_0x0697('0x2a')]=_[_0x0697('0x2b')](_0x2d53f8[_0x0697('0x2a')]);_0x5585be[_0x0697('0x2c')]=_[_0x0697('0x2d')](_0x5585be[_0x0697('0x2e')],_0x5585be['query']);_0x2f4ba0[_0x0697('0x2f')]=_[_0x0697('0x2d')](_0x5585be['model'],qs[_0x0697('0x30')](_0x2d53f8['query'][_0x0697('0x30')]));_0x2f4ba0[_0x0697('0x2f')]=_0x2f4ba0[_0x0697('0x2f')][_0x0697('0x31')]?_0x2f4ba0[_0x0697('0x2f')]:_0x5585be['model'];if(!_0x2d53f8[_0x0697('0x2a')][_0x0697('0x32')](_0x0697('0x33'))){_0x2f4ba0['limit']=qs['limit'](_0x2d53f8[_0x0697('0x2a')][_0x0697('0x1d')]);_0x2f4ba0[_0x0697('0x1f')]=qs['offset'](_0x2d53f8['query'][_0x0697('0x1f')]);}_0x2f4ba0[_0x0697('0x34')]=qs[_0x0697('0x35')](_0x2d53f8[_0x0697('0x2a')][_0x0697('0x35')]);_0x2f4ba0[_0x0697('0x36')]=qs[_0x0697('0x2c')](_[_0x0697('0x37')](_0x2d53f8[_0x0697('0x2a')],_0x5585be[_0x0697('0x2c')]),_0x483fec);if(_0x2d53f8['query']['filter']){_0x2f4ba0['where']=_[_0x0697('0x38')](_0x2f4ba0['where'],{'$or':_[_0x0697('0x27')](_0x483fec,function(_0x4dde9f){if(_0x4dde9f['type']!=='VIRTUAL'){var _0x409181={};_0x409181[_0x4dde9f[_0x0697('0x26')]]={'$like':'%'+_0x2d53f8[_0x0697('0x2a')][_0x0697('0x39')]+'%'};return _0x409181;}})});}_0x2f4ba0=_[_0x0697('0x38')]({},_0x2f4ba0,_0x2d53f8[_0x0697('0x3a')]);var _0x3e86be={'where':_0x2f4ba0[_0x0697('0x36')]};return db[_0x0697('0x28')][_0x0697('0x1e')](_0x3e86be)[_0x0697('0x25')](function(_0x49d117){_0xd7c884['count']=_0x49d117;if(_0x2d53f8['query'][_0x0697('0x3b')]){_0x2f4ba0['include']=[{'all':!![]}];}return db[_0x0697('0x28')][_0x0697('0x3c')](_0x2f4ba0);})[_0x0697('0x25')](function(_0x364859){_0xd7c884['rows']=_0x364859;return _0xd7c884;})[_0x0697('0x25')](respondWithFilteredResult(_0x4ce006,_0x2f4ba0))['catch'](handleError(_0x4ce006,null));};exports[_0x0697('0x3d')]=function(_0x46d584,_0x22248c){var _0x5b0c5c={'raw':!![],'where':{'id':_0x46d584['params']['id']}},_0x1fc034={};_0x1fc034['model']=_[_0x0697('0x2b')](db[_0x0697('0x28')][_0x0697('0x3e')]);_0x1fc034['query']=_[_0x0697('0x2b')](_0x46d584[_0x0697('0x2a')]);_0x1fc034[_0x0697('0x2c')]=_['intersection'](_0x1fc034[_0x0697('0x2e')],_0x1fc034[_0x0697('0x2a')]);_0x5b0c5c[_0x0697('0x2f')]=_[_0x0697('0x2d')](_0x1fc034['model'],qs[_0x0697('0x30')](_0x46d584[_0x0697('0x2a')][_0x0697('0x30')]));_0x5b0c5c[_0x0697('0x2f')]=_0x5b0c5c['attributes'][_0x0697('0x31')]?_0x5b0c5c[_0x0697('0x2f')]:_0x1fc034['model'];if(_0x46d584['query'][_0x0697('0x3b')]){_0x5b0c5c[_0x0697('0x3f')]=[{'all':!![]}];}_0x5b0c5c=_[_0x0697('0x38')]({},_0x5b0c5c,_0x46d584[_0x0697('0x3a')]);return db[_0x0697('0x28')][_0x0697('0x40')](_0x5b0c5c)[_0x0697('0x25')](handleEntityNotFound(_0x22248c,null))[_0x0697('0x25')](respondWithResult(_0x22248c,null))['catch'](handleError(_0x22248c,null));};exports[_0x0697('0x41')]=function(_0x59fd30,_0x38eb07){return db[_0x0697('0x28')][_0x0697('0x41')](_0x59fd30[_0x0697('0x42')],{})[_0x0697('0x25')](respondWithResult(_0x38eb07,0xc9))['catch'](handleError(_0x38eb07,null));};exports[_0x0697('0x43')]=function(_0x4039d0,_0x47818d){if(_0x4039d0[_0x0697('0x42')]['id']){delete _0x4039d0[_0x0697('0x42')]['id'];}return db[_0x0697('0x28')]['find']({'where':{'id':_0x4039d0[_0x0697('0x44')]['id']}})[_0x0697('0x25')](handleEntityNotFound(_0x47818d,null))[_0x0697('0x25')](saveUpdates(_0x4039d0[_0x0697('0x42')],null))[_0x0697('0x25')](respondWithResult(_0x47818d,null))[_0x0697('0x45')](handleError(_0x47818d,null));};exports[_0x0697('0x24')]=function(_0x4a3773,_0x41f5a0){return db['SmsQueueReport'][_0x0697('0x40')]({'where':{'id':_0x4a3773[_0x0697('0x44')]['id']}})['then'](handleEntityNotFound(_0x41f5a0,null))[_0x0697('0x25')](removeEntity(_0x41f5a0,null))[_0x0697('0x45')](handleError(_0x41f5a0,null));};exports['describe']=function(_0x58b752,_0x2efdea){return db[_0x0697('0x28')]['describe']()['then'](respondWithResult(_0x2efdea,null))[_0x0697('0x45')](handleError(_0x2efdea,null));}; \ No newline at end of file +var _0x2467=['to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','undefined','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','end','sendStatus','name','send','index','rawAttributes','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','SmsQueueReport','includeAll','include','findAll','rows','catch','show','params','options','create','body','find','describe','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox'];(function(_0x117e3e,_0x2da232){var _0x15794b=function(_0x3bdeee){while(--_0x3bdeee){_0x117e3e['push'](_0x117e3e['shift']());}};_0x15794b(++_0x2da232);}(_0x2467,0x1dd));var _0x7246=function(_0x212bde,_0x52bdac){_0x212bde=_0x212bde-0x0;var _0x4a7341=_0x2467[_0x212bde];return _0x4a7341;};'use strict';var emlformat=require(_0x7246('0x0'));var rimraf=require(_0x7246('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x7246('0x2'));var moment=require(_0x7246('0x3'));var BPromise=require(_0x7246('0x4'));var Mustache=require(_0x7246('0x5'));var util=require(_0x7246('0x6'));var path=require(_0x7246('0x7'));var sox=require(_0x7246('0x8'));var csv=require(_0x7246('0x9'));var ejs=require(_0x7246('0xa'));var fs=require('fs');var fs_extra=require(_0x7246('0xb'));var _=require(_0x7246('0xc'));var squel=require(_0x7246('0xd'));var crypto=require(_0x7246('0xe'));var jsforce=require(_0x7246('0xf'));var deskjs=require(_0x7246('0x10'));var toCsv=require(_0x7246('0x9'));var querystring=require(_0x7246('0x11'));var Papa=require(_0x7246('0x12'));var Redis=require(_0x7246('0x13'));var authService=require(_0x7246('0x14'));var qs=require(_0x7246('0x15'));var as=require(_0x7246('0x16'));var hardwareService=require(_0x7246('0x17'));var logger=require(_0x7246('0x18'))(_0x7246('0x19'));var utils=require(_0x7246('0x1a'));var config=require(_0x7246('0x1b'));var licenseUtil=require(_0x7246('0x1c'));var db=require(_0x7246('0x1d'))['db'];function respondWithStatusCode(_0x5890e0,_0x4e140f){_0x4e140f=_0x4e140f||0xcc;return function(_0x2ccae5){if(_0x2ccae5){return _0x5890e0['sendStatus'](_0x4e140f);}return _0x5890e0[_0x7246('0x1e')](_0x4e140f)['end']();};}function respondWithResult(_0x497c04,_0x92dde9){_0x92dde9=_0x92dde9||0xc8;return function(_0x2dd5e0){if(_0x2dd5e0){return _0x497c04[_0x7246('0x1e')](_0x92dde9)[_0x7246('0x1f')](_0x2dd5e0);}};}function respondWithFilteredResult(_0xc22816,_0xd809c4){return function(_0x3265c3){if(_0x3265c3){var _0x32f3eb=typeof _0xd809c4['offset']===_0x7246('0x20')&&typeof _0xd809c4['limit']===_0x7246('0x20');var _0x525112=_0x3265c3[_0x7246('0x21')];var _0x366766=_0x32f3eb?0x0:_0xd809c4['offset'];var _0xe022d0=_0x32f3eb?_0x3265c3[_0x7246('0x21')]:_0xd809c4[_0x7246('0x22')]+_0xd809c4[_0x7246('0x23')];var _0x2df6c8;if(_0xe022d0>=_0x525112){_0xe022d0=_0x525112;_0x2df6c8=0xc8;}else{_0x2df6c8=0xce;}_0xc22816[_0x7246('0x1e')](_0x2df6c8);return _0xc22816['set'](_0x7246('0x24'),_0x366766+'-'+_0xe022d0+'/'+_0x525112)[_0x7246('0x1f')](_0x3265c3);}return null;};}function patchUpdates(_0x4abd14){return function(_0x144d29){try{jsonpatch[_0x7246('0x25')](_0x144d29,_0x4abd14,!![]);}catch(_0x302ef3){return BPromise[_0x7246('0x26')](_0x302ef3);}return _0x144d29[_0x7246('0x27')]();};}function saveUpdates(_0x486ae0,_0x2dc735){return function(_0x7c7593){if(_0x7c7593){return _0x7c7593[_0x7246('0x28')](_0x486ae0)[_0x7246('0x29')](function(_0x4ea1d9){return _0x4ea1d9;});}return null;};}function removeEntity(_0x39796a,_0x207581){return function(_0x8cd40f){if(_0x8cd40f){return _0x8cd40f[_0x7246('0x2a')]()[_0x7246('0x29')](function(){_0x39796a['status'](0xcc)[_0x7246('0x2b')]();});}};}function handleEntityNotFound(_0x32d815,_0x2eaaf7){return function(_0x1c426d){if(!_0x1c426d){_0x32d815[_0x7246('0x2c')](0x194);}return _0x1c426d;};}function handleError(_0x5aaa8d,_0x1c35dc){_0x1c35dc=_0x1c35dc||0x1f4;return function(_0x26735f){logger['error'](_0x26735f['stack']);if(_0x26735f[_0x7246('0x2d')]){delete _0x26735f[_0x7246('0x2d')];}_0x5aaa8d['status'](_0x1c35dc)[_0x7246('0x2e')](_0x26735f);};}exports[_0x7246('0x2f')]=function(_0x11e394,_0x3baa8b){var _0x1a59bf={},_0x9d17be={},_0x4a9b3b={'count':0x0,'rows':[]};var _0x34e667=_['map'](db['SmsQueueReport'][_0x7246('0x30')],function(_0x53b5e7){return{'name':_0x53b5e7['fieldName'],'type':_0x53b5e7['type'][_0x7246('0x31')]};});_0x9d17be[_0x7246('0x32')]=_[_0x7246('0x33')](_0x34e667,_0x7246('0x2d'));_0x9d17be[_0x7246('0x34')]=_[_0x7246('0x35')](_0x11e394['query']);_0x9d17be[_0x7246('0x36')]=_[_0x7246('0x37')](_0x9d17be['model'],_0x9d17be[_0x7246('0x34')]);_0x1a59bf['attributes']=_[_0x7246('0x37')](_0x9d17be[_0x7246('0x32')],qs[_0x7246('0x38')](_0x11e394[_0x7246('0x34')][_0x7246('0x38')]));_0x1a59bf[_0x7246('0x39')]=_0x1a59bf[_0x7246('0x39')][_0x7246('0x3a')]?_0x1a59bf[_0x7246('0x39')]:_0x9d17be['model'];if(!_0x11e394[_0x7246('0x34')][_0x7246('0x3b')](_0x7246('0x3c'))){_0x1a59bf[_0x7246('0x23')]=qs[_0x7246('0x23')](_0x11e394[_0x7246('0x34')][_0x7246('0x23')]);_0x1a59bf[_0x7246('0x22')]=qs[_0x7246('0x22')](_0x11e394[_0x7246('0x34')][_0x7246('0x22')]);}_0x1a59bf[_0x7246('0x3d')]=qs[_0x7246('0x3e')](_0x11e394['query'][_0x7246('0x3e')]);_0x1a59bf[_0x7246('0x3f')]=qs[_0x7246('0x36')](_[_0x7246('0x40')](_0x11e394[_0x7246('0x34')],_0x9d17be[_0x7246('0x36')]),_0x34e667);if(_0x11e394[_0x7246('0x34')]['filter']){_0x1a59bf[_0x7246('0x3f')]=_[_0x7246('0x41')](_0x1a59bf[_0x7246('0x3f')],{'$or':_['map'](_0x34e667,function(_0x459302){if(_0x459302[_0x7246('0x42')]!==_0x7246('0x43')){var _0x681891={};_0x681891[_0x459302[_0x7246('0x2d')]]={'$like':'%'+_0x11e394[_0x7246('0x34')]['filter']+'%'};return _0x681891;}})});}_0x1a59bf=_[_0x7246('0x41')]({},_0x1a59bf,_0x11e394['options']);var _0x2f631f={'where':_0x1a59bf[_0x7246('0x3f')]};return db[_0x7246('0x44')]['count'](_0x2f631f)['then'](function(_0x5c317e){_0x4a9b3b[_0x7246('0x21')]=_0x5c317e;if(_0x11e394[_0x7246('0x34')][_0x7246('0x45')]){_0x1a59bf[_0x7246('0x46')]=[{'all':!![]}];}return db['SmsQueueReport'][_0x7246('0x47')](_0x1a59bf);})['then'](function(_0x11d35e){_0x4a9b3b[_0x7246('0x48')]=_0x11d35e;return _0x4a9b3b;})[_0x7246('0x29')](respondWithFilteredResult(_0x3baa8b,_0x1a59bf))[_0x7246('0x49')](handleError(_0x3baa8b,null));};exports[_0x7246('0x4a')]=function(_0xddabab,_0x548ce0){var _0x48ed63={'raw':!![],'where':{'id':_0xddabab[_0x7246('0x4b')]['id']}},_0x3e816e={};_0x3e816e[_0x7246('0x32')]=_[_0x7246('0x35')](db[_0x7246('0x44')]['rawAttributes']);_0x3e816e[_0x7246('0x34')]=_['keys'](_0xddabab['query']);_0x3e816e[_0x7246('0x36')]=_[_0x7246('0x37')](_0x3e816e['model'],_0x3e816e[_0x7246('0x34')]);_0x48ed63[_0x7246('0x39')]=_[_0x7246('0x37')](_0x3e816e['model'],qs['fields'](_0xddabab['query']['fields']));_0x48ed63[_0x7246('0x39')]=_0x48ed63['attributes'][_0x7246('0x3a')]?_0x48ed63[_0x7246('0x39')]:_0x3e816e['model'];if(_0xddabab[_0x7246('0x34')][_0x7246('0x45')]){_0x48ed63[_0x7246('0x46')]=[{'all':!![]}];}_0x48ed63=_[_0x7246('0x41')]({},_0x48ed63,_0xddabab[_0x7246('0x4c')]);return db['SmsQueueReport']['find'](_0x48ed63)['then'](handleEntityNotFound(_0x548ce0,null))[_0x7246('0x29')](respondWithResult(_0x548ce0,null))[_0x7246('0x49')](handleError(_0x548ce0,null));};exports[_0x7246('0x4d')]=function(_0x1d4221,_0x11701a){return db[_0x7246('0x44')][_0x7246('0x4d')](_0x1d4221[_0x7246('0x4e')],{})[_0x7246('0x29')](respondWithResult(_0x11701a,0xc9))[_0x7246('0x49')](handleError(_0x11701a,null));};exports[_0x7246('0x28')]=function(_0x1b74f1,_0x33f485){if(_0x1b74f1[_0x7246('0x4e')]['id']){delete _0x1b74f1[_0x7246('0x4e')]['id'];}return db[_0x7246('0x44')]['find']({'where':{'id':_0x1b74f1[_0x7246('0x4b')]['id']}})[_0x7246('0x29')](handleEntityNotFound(_0x33f485,null))['then'](saveUpdates(_0x1b74f1[_0x7246('0x4e')],null))['then'](respondWithResult(_0x33f485,null))[_0x7246('0x49')](handleError(_0x33f485,null));};exports[_0x7246('0x2a')]=function(_0x2ee2bc,_0x513076){return db[_0x7246('0x44')][_0x7246('0x4f')]({'where':{'id':_0x2ee2bc[_0x7246('0x4b')]['id']}})['then'](handleEntityNotFound(_0x513076,null))[_0x7246('0x29')](removeEntity(_0x513076,null))['catch'](handleError(_0x513076,null));};exports[_0x7246('0x50')]=function(_0x55abec,_0x4de946){return db[_0x7246('0x44')][_0x7246('0x50')]()[_0x7246('0x29')](respondWithResult(_0x4de946,null))['catch'](handleError(_0x4de946,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index 43d6fcc..482b515 100644 --- a/server/api/smsQueueReport/smsQueueReport.model.js +++ b/server/api/smsQueueReport/smsQueueReport.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['define','SmsQueueReport','uniqueid','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./smsQueueReport.attributes','exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0xa9e0[_0x92c450];return _0x2a9599;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'report_sms_queue','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0a9e('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd8b0=['define','report_sms_queue','uniqueid','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x1427e0,_0x3e8a03){var _0x342b92=function(_0xbdb661){while(--_0xbdb661){_0x1427e0['push'](_0x1427e0['shift']());}};_0x342b92(++_0x3e8a03);}(_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('./smsQueueReport.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('SmsQueueReport',attributes,{'tableName':_0x0d8b('0x8'),'paranoid':![],'indexes':[{'name':_0x0d8b('0x9'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index c4aa7b1..2e87bc0 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 _0x899d=['request','then','info','request\x20sent','debug','stringify','error','code','SmsQueueReport,\x20%s,\x20%s','message','catch','CreateSmsQueueReport','create','options','raw','SmsQueueReport','update','body','where','attributes','limit','UpdateSmsQueueReport','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client'];(function(_0x5c9d90,_0x67a0f){var _0x6bca4c=function(_0x8931b2){while(--_0x8931b2){_0x5c9d90['push'](_0x5c9d90['shift']());}};_0x6bca4c(++_0x67a0f);}(_0x899d,0x160));var _0xd899=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x899d[_0x4b055c];return _0x4b62bb;};'use strict';var _=require(_0xd899('0x0'));var util=require(_0xd899('0x1'));var moment=require(_0xd899('0x2'));var BPromise=require(_0xd899('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd899('0x4'));var db=require(_0xd899('0x5'))['db'];var utils=require(_0xd899('0x6'));var logger=require(_0xd899('0x7'))('rpc');var config=require(_0xd899('0x8'));var jayson=require(_0xd899('0x9'));var client=jayson[_0xd899('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x63f31b,_0x29b977,_0xb3b452){return new BPromise(function(_0x1ee811,_0x39ea09){return client[_0xd899('0xb')](_0x63f31b,_0xb3b452)[_0xd899('0xc')](function(_0x301f1b){logger[_0xd899('0xd')]('SmsQueueReport,\x20%s,\x20%s',_0x29b977,_0xd899('0xe'));logger[_0xd899('0xf')]('SmsQueueReport,\x20%s,\x20%s,\x20%s',_0x29b977,_0xd899('0xe'),JSON[_0xd899('0x10')](_0x301f1b));if(_0x301f1b[_0xd899('0x11')]){if(_0x301f1b[_0xd899('0x11')][_0xd899('0x12')]===0x1f4){logger[_0xd899('0x11')](_0xd899('0x13'),_0x29b977,_0x301f1b[_0xd899('0x11')][_0xd899('0x14')]);return _0x39ea09(_0x301f1b[_0xd899('0x11')]['message']);}logger['error'](_0xd899('0x13'),_0x29b977,_0x301f1b[_0xd899('0x11')][_0xd899('0x14')]);return _0x1ee811(_0x301f1b[_0xd899('0x11')][_0xd899('0x14')]);}else{logger[_0xd899('0xd')](_0xd899('0x13'),_0x29b977,_0xd899('0xe'));_0x1ee811(_0x301f1b['result'][_0xd899('0x14')]);}})[_0xd899('0x15')](function(_0x29b99d){logger['error'](_0xd899('0x13'),_0x29b977,_0x29b99d);_0x39ea09(_0x29b99d);});});}exports[_0xd899('0x16')]=function(_0x2d98ca){var _0x34d02a=this;return new Promise(function(_0x5ac690,_0x18910d){return db['SmsQueueReport'][_0xd899('0x17')](_0x2d98ca['body'],{'raw':_0x2d98ca[_0xd899('0x18')]?_0x2d98ca[_0xd899('0x18')][_0xd899('0x19')]===undefined?!![]:![]:!![]})[_0xd899('0xc')](function(_0x133d30){logger['info'](_0xd899('0x16'),_0x2d98ca);logger['debug']('CreateSmsQueueReport',_0x2d98ca,JSON[_0xd899('0x10')](_0x133d30));_0x5ac690(_0x133d30);})[_0xd899('0x15')](function(_0x58b719){logger[_0xd899('0x11')](_0xd899('0x16'),_0x58b719[_0xd899('0x14')],_0x2d98ca);_0x18910d(_0x34d02a[_0xd899('0x11')](0x1f4,_0x58b719[_0xd899('0x14')]));});});};exports['UpdateSmsQueueReport']=function(_0x4321f7){var _0x275657=this;return new Promise(function(_0x451b4c,_0x1363c8){return db[_0xd899('0x1a')][_0xd899('0x1b')](_0x4321f7[_0xd899('0x1c')],{'raw':_0x4321f7['options']?_0x4321f7[_0xd899('0x18')][_0xd899('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4321f7[_0xd899('0x18')]?_0x4321f7[_0xd899('0x18')][_0xd899('0x1d')]||null:null,'attributes':_0x4321f7[_0xd899('0x18')]?_0x4321f7[_0xd899('0x18')][_0xd899('0x1e')]||null:null,'limit':_0x4321f7[_0xd899('0x18')]?_0x4321f7[_0xd899('0x18')][_0xd899('0x1f')]||null:null})[_0xd899('0xc')](function(_0x96c76a){logger[_0xd899('0xd')](_0xd899('0x20'),_0x4321f7);logger['debug'](_0xd899('0x20'),_0x4321f7,JSON['stringify'](_0x96c76a));_0x451b4c(_0x96c76a);})[_0xd899('0x15')](function(_0x51be12){logger[_0xd899('0x11')]('UpdateSmsQueueReport',_0x51be12[_0xd899('0x14')],_0x4321f7);_0x1363c8(_0x275657['error'](0x1f4,_0x51be12[_0xd899('0x14')]));});});}; \ No newline at end of file +var _0x724e=['jayson/promise','request','info','SmsQueueReport,\x20%s,\x20%s','SmsQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','CreateSmsQueueReport','create','body','options','raw','then','debug','stringify','SmsQueueReport','update','where','limit','UpdateSmsQueueReport','lodash','bluebird','randomstring','ioredis','../../mysqldb','rpc'];(function(_0x2440fe,_0x281a11){var _0x5cf734=function(_0x38e12b){while(--_0x38e12b){_0x2440fe['push'](_0x2440fe['shift']());}};_0x5cf734(++_0x281a11);}(_0x724e,0x6e));var _0xe724=function(_0x442a8d,_0x54c55b){_0x442a8d=_0x442a8d-0x0;var _0x36fb0e=_0x724e[_0x442a8d];return _0x36fb0e;};'use strict';var _=require(_0xe724('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xe724('0x1'));var rs=require(_0xe724('0x2'));var fs=require('fs');var Redis=require(_0xe724('0x3'));var db=require(_0xe724('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xe724('0x5'));var config=require('../../config/environment');var jayson=require(_0xe724('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2565bd,_0x2e6c40,_0x316167){return new BPromise(function(_0x5a74e5,_0x18d40f){return client[_0xe724('0x7')](_0x2565bd,_0x316167)['then'](function(_0x2c56b6){logger[_0xe724('0x8')](_0xe724('0x9'),_0x2e6c40,'request\x20sent');logger['debug'](_0xe724('0xa'),_0x2e6c40,_0xe724('0xb'),JSON['stringify'](_0x2c56b6));if(_0x2c56b6['error']){if(_0x2c56b6[_0xe724('0xc')]['code']===0x1f4){logger[_0xe724('0xc')](_0xe724('0x9'),_0x2e6c40,_0x2c56b6['error']['message']);return _0x18d40f(_0x2c56b6[_0xe724('0xc')][_0xe724('0xd')]);}logger['error'](_0xe724('0x9'),_0x2e6c40,_0x2c56b6[_0xe724('0xc')][_0xe724('0xd')]);return _0x5a74e5(_0x2c56b6[_0xe724('0xc')][_0xe724('0xd')]);}else{logger[_0xe724('0x8')](_0xe724('0x9'),_0x2e6c40,_0xe724('0xb'));_0x5a74e5(_0x2c56b6[_0xe724('0xe')][_0xe724('0xd')]);}})[_0xe724('0xf')](function(_0x4e1625){logger[_0xe724('0xc')](_0xe724('0x9'),_0x2e6c40,_0x4e1625);_0x18d40f(_0x4e1625);});});}exports[_0xe724('0x10')]=function(_0x160326){var _0x3af175=this;return new Promise(function(_0x318757,_0x91ebf1){return db['SmsQueueReport'][_0xe724('0x11')](_0x160326[_0xe724('0x12')],{'raw':_0x160326[_0xe724('0x13')]?_0x160326[_0xe724('0x13')][_0xe724('0x14')]===undefined?!![]:![]:!![]})[_0xe724('0x15')](function(_0x22cf36){logger['info'](_0xe724('0x10'),_0x160326);logger[_0xe724('0x16')](_0xe724('0x10'),_0x160326,JSON[_0xe724('0x17')](_0x22cf36));_0x318757(_0x22cf36);})[_0xe724('0xf')](function(_0x3b560b){logger[_0xe724('0xc')](_0xe724('0x10'),_0x3b560b[_0xe724('0xd')],_0x160326);_0x91ebf1(_0x3af175[_0xe724('0xc')](0x1f4,_0x3b560b['message']));});});};exports['UpdateSmsQueueReport']=function(_0xcffd2a){var _0x539b12=this;return new Promise(function(_0xb09a4d,_0x33101a){return db[_0xe724('0x18')][_0xe724('0x19')](_0xcffd2a[_0xe724('0x12')],{'raw':_0xcffd2a[_0xe724('0x13')]?_0xcffd2a[_0xe724('0x13')][_0xe724('0x14')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xcffd2a[_0xe724('0x13')]?_0xcffd2a[_0xe724('0x13')][_0xe724('0x1a')]||null:null,'attributes':_0xcffd2a['options']?_0xcffd2a['options']['attributes']||null:null,'limit':_0xcffd2a[_0xe724('0x13')]?_0xcffd2a[_0xe724('0x13')][_0xe724('0x1b')]||null:null})[_0xe724('0x15')](function(_0x2ff2df){logger[_0xe724('0x8')](_0xe724('0x1c'),_0xcffd2a);logger['debug'](_0xe724('0x1c'),_0xcffd2a,JSON[_0xe724('0x17')](_0x2ff2df));_0xb09a4d(_0x2ff2df);})['catch'](function(_0x3f185d){logger['error']('UpdateSmsQueueReport',_0x3f185d[_0xe724('0xd')],_0xcffd2a);_0x33101a(_0x539b12[_0xe724('0xc')](0x1f4,_0x3f185d[_0xe724('0xd')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index 50530e3..12c8a48 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 _0x8c46=['destroy','multer','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post'];(function(_0x1a6bde,_0x3e8809){var _0x490911=function(_0x1da913){while(--_0x1da913){_0x1a6bde['push'](_0x1a6bde['shift']());}};_0x490911(++_0x3e8809);}(_0x8c46,0x171));var _0x68c4=function(_0x14d874,_0x482fef){_0x14d874=_0x14d874-0x0;var _0x3f5289=_0x8c46[_0x14d874];return _0x3f5289;};'use strict';var multer=require(_0x68c4('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x68c4('0x1'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x68c4('0x2'));var auth=require(_0x68c4('0x3'));var interaction=require(_0x68c4('0x4'));var config=require(_0x68c4('0x5'));var controller=require(_0x68c4('0x6'));router[_0x68c4('0x7')]('/',auth[_0x68c4('0x8')](),controller[_0x68c4('0x9')]);router[_0x68c4('0x7')](_0x68c4('0xa'),auth['isAuthenticated'](),controller[_0x68c4('0xb')]);router[_0x68c4('0x7')](_0x68c4('0xc'),auth['isAuthenticated'](),controller[_0x68c4('0xd')]);router[_0x68c4('0xe')]('/',auth[_0x68c4('0x8')](),controller['create']);router['put'](_0x68c4('0xc'),auth[_0x68c4('0x8')](),controller['update']);router['delete'](_0x68c4('0xc'),auth[_0x68c4('0x8')](),controller[_0x68c4('0xf')]);module['exports']=router; \ No newline at end of file +var _0x7bae=['isAuthenticated','index','/describe','describe','/:id','post','create','put','update','delete','destroy','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','get'];(function(_0x37d9d2,_0x1d744a){var _0x3dbc84=function(_0x30df4a){while(--_0x30df4a){_0x37d9d2['push'](_0x37d9d2['shift']());}};_0x3dbc84(++_0x1d744a);}(_0x7bae,0x13b));var _0xe7ba=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0x7bae[_0xb0f7c3];return _0x28ea68;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe7ba('0x0'));var timeout=require(_0xe7ba('0x1'));var express=require('express');var router=express[_0xe7ba('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xe7ba('0x3'));var interaction=require(_0xe7ba('0x4'));var config=require(_0xe7ba('0x5'));var controller=require(_0xe7ba('0x6'));router[_0xe7ba('0x7')]('/',auth[_0xe7ba('0x8')](),controller[_0xe7ba('0x9')]);router[_0xe7ba('0x7')](_0xe7ba('0xa'),auth[_0xe7ba('0x8')](),controller[_0xe7ba('0xb')]);router[_0xe7ba('0x7')](_0xe7ba('0xc'),auth[_0xe7ba('0x8')](),controller['show']);router[_0xe7ba('0xd')]('/',auth[_0xe7ba('0x8')](),controller[_0xe7ba('0xe')]);router[_0xe7ba('0xf')](_0xe7ba('0xc'),auth[_0xe7ba('0x8')](),controller[_0xe7ba('0x10')]);router[_0xe7ba('0x11')](_0xe7ba('0xc'),auth['isAuthenticated'](),controller[_0xe7ba('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index 82596b4..35d6210 100644 --- a/server/api/smsTransferReport/smsTransferReport.attributes.js +++ b/server/api/smsTransferReport/smsTransferReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb43b=['DATE','NOW','moment','sequelize','STRING','ENUM','account','queue'];(function(_0x15c421,_0x6366f7){var _0x5e5ed5=function(_0x206e66){while(--_0x206e66){_0x15c421['push'](_0x15c421['shift']());}};_0x5e5ed5(++_0x6366f7);}(_0xb43b,0x1b2));var _0xbb43=function(_0x2ea28a,_0x4c9b3){_0x2ea28a=_0x2ea28a-0x0;var _0x138d21=_0xb43b[_0x2ea28a];return _0x138d21;};'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 _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0x40a7f1,_0x34e6b5){var _0x100441=function(_0x3117e9){while(--_0x3117e9){_0x40a7f1['push'](_0x40a7f1['shift']());}};_0x100441(++_0x34e6b5);}(_0xedd9,0xfc));var _0x9edd=function(_0x576a01,_0x74c2cc){_0x576a01=_0x576a01-0x0;var _0x2b424c=_0xedd9[_0x576a01];return _0x2b424c;};'use strict';var moment=require('moment');var Sequelize=require(_0x9edd('0x0'));module[_0x9edd('0x1')]={'uniqueid':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9edd('0x3')](_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6')),'allowNull':![],'defaultValue':_0x9edd('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x9edd('0x7')]}}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index 7e58714..38c805c 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 _0x53f2=['options','includeAll','include','SmsTransferReport','findAll','rows','catch','show','params','fields','find','create','body','eml-format','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','end','json','offset','limit','undefined','count','set','apply','save','update','then','destroy','error','name','send','index','map','rawAttributes','fieldName','model','keys','filters','intersection','query','attributes','length','sort','where','merge','type','VIRTUAL','filter'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x53f2,0x95));var _0x253f=function(_0x2c34ac,_0x2940ba){_0x2c34ac=_0x2c34ac-0x0;var _0x9cc461=_0x53f2[_0x2c34ac];return _0x9cc461;};'use strict';var emlformat=require(_0x253f('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x253f('0x1'));var rp=require(_0x253f('0x2'));var moment=require(_0x253f('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x253f('0x4'));var util=require(_0x253f('0x5'));var path=require(_0x253f('0x6'));var sox=require('sox');var csv=require(_0x253f('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x253f('0x8'));var _=require('lodash');var squel=require(_0x253f('0x9'));var crypto=require(_0x253f('0xa'));var jsforce=require(_0x253f('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x253f('0xc'));var Papa=require(_0x253f('0xd'));var Redis=require(_0x253f('0xe'));var authService=require(_0x253f('0xf'));var qs=require(_0x253f('0x10'));var as=require(_0x253f('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x253f('0x12'))(_0x253f('0x13'));var utils=require(_0x253f('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x253f('0x15'));var db=require(_0x253f('0x16'))['db'];function respondWithStatusCode(_0x4a6fae,_0x28958e){_0x28958e=_0x28958e||0xcc;return function(_0x1521e1){if(_0x1521e1){return _0x4a6fae['sendStatus'](_0x28958e);}return _0x4a6fae['status'](_0x28958e)[_0x253f('0x17')]();};}function respondWithResult(_0x183a52,_0x313afb){_0x313afb=_0x313afb||0xc8;return function(_0x484ded){if(_0x484ded){return _0x183a52['status'](_0x313afb)[_0x253f('0x18')](_0x484ded);}};}function respondWithFilteredResult(_0x1d425c,_0x24de81){return function(_0x5aea83){if(_0x5aea83){var _0xd6275d=typeof _0x24de81[_0x253f('0x19')]==='undefined'&&typeof _0x24de81[_0x253f('0x1a')]===_0x253f('0x1b');var _0x1f1828=_0x5aea83[_0x253f('0x1c')];var _0x48dc57=_0xd6275d?0x0:_0x24de81['offset'];var _0x5cfdf1=_0xd6275d?_0x5aea83[_0x253f('0x1c')]:_0x24de81['offset']+_0x24de81[_0x253f('0x1a')];var _0x28d6d2;if(_0x5cfdf1>=_0x1f1828){_0x5cfdf1=_0x1f1828;_0x28d6d2=0xc8;}else{_0x28d6d2=0xce;}_0x1d425c['status'](_0x28d6d2);return _0x1d425c[_0x253f('0x1d')]('Content-Range',_0x48dc57+'-'+_0x5cfdf1+'/'+_0x1f1828)[_0x253f('0x18')](_0x5aea83);}return null;};}function patchUpdates(_0x4368d5){return function(_0x9de5e9){try{jsonpatch[_0x253f('0x1e')](_0x9de5e9,_0x4368d5,!![]);}catch(_0x256078){return BPromise['reject'](_0x256078);}return _0x9de5e9[_0x253f('0x1f')]();};}function saveUpdates(_0x4f2929,_0x43915e){return function(_0x29037d){if(_0x29037d){return _0x29037d[_0x253f('0x20')](_0x4f2929)[_0x253f('0x21')](function(_0xbb70c4){return _0xbb70c4;});}return null;};}function removeEntity(_0x5e61c7,_0x16b29f){return function(_0x581610){if(_0x581610){return _0x581610[_0x253f('0x22')]()[_0x253f('0x21')](function(){_0x5e61c7['status'](0xcc)[_0x253f('0x17')]();});}};}function handleEntityNotFound(_0x13e3f0,_0x26cc75){return function(_0x6c1f3f){if(!_0x6c1f3f){_0x13e3f0['sendStatus'](0x194);}return _0x6c1f3f;};}function handleError(_0x17e89b,_0x51aab0){_0x51aab0=_0x51aab0||0x1f4;return function(_0x153222){logger[_0x253f('0x23')](_0x153222['stack']);if(_0x153222['name']){delete _0x153222[_0x253f('0x24')];}_0x17e89b['status'](_0x51aab0)[_0x253f('0x25')](_0x153222);};}exports[_0x253f('0x26')]=function(_0x273062,_0x2a2ddd){var _0x433901={},_0x3ceca4={},_0x2ddf9a={'count':0x0,'rows':[]};var _0x158c88=_[_0x253f('0x27')](db['SmsTransferReport'][_0x253f('0x28')],function(_0xaa0302){return{'name':_0xaa0302[_0x253f('0x29')],'type':_0xaa0302['type']['key']};});_0x3ceca4[_0x253f('0x2a')]=_['map'](_0x158c88,_0x253f('0x24'));_0x3ceca4['query']=_[_0x253f('0x2b')](_0x273062['query']);_0x3ceca4[_0x253f('0x2c')]=_[_0x253f('0x2d')](_0x3ceca4['model'],_0x3ceca4[_0x253f('0x2e')]);_0x433901[_0x253f('0x2f')]=_['intersection'](_0x3ceca4[_0x253f('0x2a')],qs['fields'](_0x273062[_0x253f('0x2e')]['fields']));_0x433901['attributes']=_0x433901[_0x253f('0x2f')][_0x253f('0x30')]?_0x433901[_0x253f('0x2f')]:_0x3ceca4[_0x253f('0x2a')];if(!_0x273062[_0x253f('0x2e')]['hasOwnProperty']('nolimit')){_0x433901[_0x253f('0x1a')]=qs['limit'](_0x273062['query']['limit']);_0x433901[_0x253f('0x19')]=qs[_0x253f('0x19')](_0x273062[_0x253f('0x2e')][_0x253f('0x19')]);}_0x433901['order']=qs[_0x253f('0x31')](_0x273062[_0x253f('0x2e')][_0x253f('0x31')]);_0x433901['where']=qs[_0x253f('0x2c')](_['pick'](_0x273062[_0x253f('0x2e')],_0x3ceca4[_0x253f('0x2c')]),_0x158c88);if(_0x273062[_0x253f('0x2e')]['filter']){_0x433901[_0x253f('0x32')]=_[_0x253f('0x33')](_0x433901[_0x253f('0x32')],{'$or':_[_0x253f('0x27')](_0x158c88,function(_0x2fd2f0){if(_0x2fd2f0[_0x253f('0x34')]!==_0x253f('0x35')){var _0x5d1f3c={};_0x5d1f3c[_0x2fd2f0[_0x253f('0x24')]]={'$like':'%'+_0x273062[_0x253f('0x2e')][_0x253f('0x36')]+'%'};return _0x5d1f3c;}})});}_0x433901=_[_0x253f('0x33')]({},_0x433901,_0x273062[_0x253f('0x37')]);var _0x2a0e46={'where':_0x433901[_0x253f('0x32')]};return db['SmsTransferReport'][_0x253f('0x1c')](_0x2a0e46)['then'](function(_0x42f7c4){_0x2ddf9a[_0x253f('0x1c')]=_0x42f7c4;if(_0x273062['query'][_0x253f('0x38')]){_0x433901[_0x253f('0x39')]=[{'all':!![]}];}return db[_0x253f('0x3a')][_0x253f('0x3b')](_0x433901);})[_0x253f('0x21')](function(_0xa045df){_0x2ddf9a[_0x253f('0x3c')]=_0xa045df;return _0x2ddf9a;})[_0x253f('0x21')](respondWithFilteredResult(_0x2a2ddd,_0x433901))[_0x253f('0x3d')](handleError(_0x2a2ddd,null));};exports[_0x253f('0x3e')]=function(_0x3abcf6,_0x3102e0){var _0x50c78d={'raw':!![],'where':{'id':_0x3abcf6[_0x253f('0x3f')]['id']}},_0x744df1={};_0x744df1['model']=_[_0x253f('0x2b')](db[_0x253f('0x3a')][_0x253f('0x28')]);_0x744df1[_0x253f('0x2e')]=_['keys'](_0x3abcf6['query']);_0x744df1[_0x253f('0x2c')]=_[_0x253f('0x2d')](_0x744df1['model'],_0x744df1[_0x253f('0x2e')]);_0x50c78d[_0x253f('0x2f')]=_['intersection'](_0x744df1['model'],qs[_0x253f('0x40')](_0x3abcf6['query'][_0x253f('0x40')]));_0x50c78d['attributes']=_0x50c78d[_0x253f('0x2f')][_0x253f('0x30')]?_0x50c78d[_0x253f('0x2f')]:_0x744df1[_0x253f('0x2a')];if(_0x3abcf6[_0x253f('0x2e')][_0x253f('0x38')]){_0x50c78d['include']=[{'all':!![]}];}_0x50c78d=_[_0x253f('0x33')]({},_0x50c78d,_0x3abcf6[_0x253f('0x37')]);return db['SmsTransferReport'][_0x253f('0x41')](_0x50c78d)[_0x253f('0x21')](handleEntityNotFound(_0x3102e0,null))[_0x253f('0x21')](respondWithResult(_0x3102e0,null))[_0x253f('0x3d')](handleError(_0x3102e0,null));};exports[_0x253f('0x42')]=function(_0x4c4bd4,_0x8f69fd){return db[_0x253f('0x3a')][_0x253f('0x42')](_0x4c4bd4[_0x253f('0x43')],{})[_0x253f('0x21')](respondWithResult(_0x8f69fd,0xc9))['catch'](handleError(_0x8f69fd,null));};exports[_0x253f('0x20')]=function(_0x2cef78,_0x25110d){if(_0x2cef78[_0x253f('0x43')]['id']){delete _0x2cef78['body']['id'];}return db[_0x253f('0x3a')][_0x253f('0x41')]({'where':{'id':_0x2cef78[_0x253f('0x3f')]['id']}})[_0x253f('0x21')](handleEntityNotFound(_0x25110d,null))[_0x253f('0x21')](saveUpdates(_0x2cef78[_0x253f('0x43')],null))[_0x253f('0x21')](respondWithResult(_0x25110d,null))['catch'](handleError(_0x25110d,null));};exports[_0x253f('0x22')]=function(_0x3f86bf,_0x592b2b){return db['SmsTransferReport']['find']({'where':{'id':_0x3f86bf[_0x253f('0x3f')]['id']}})[_0x253f('0x21')](handleEntityNotFound(_0x592b2b,null))['then'](removeEntity(_0x592b2b,null))['catch'](handleError(_0x592b2b,null));};exports['describe']=function(_0x2eb283,_0x4f5d7b){return db[_0x253f('0x3a')]['describe']()[_0x253f('0x21')](respondWithResult(_0x4f5d7b,null))[_0x253f('0x3d')](handleError(_0x4f5d7b,null));}; \ No newline at end of file +var _0xdc6f=['end','error','stack','name','send','map','SmsTransferReport','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','pick','where','merge','VIRTUAL','filter','options','includeAll','include','rows','catch','show','params','create','body','find','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','reject','update','then'];(function(_0xf5e35f,_0x271b45){var _0x2163ad=function(_0x5763e2){while(--_0x5763e2){_0xf5e35f['push'](_0xf5e35f['shift']());}};_0x2163ad(++_0x271b45);}(_0xdc6f,0x6d));var _0xfdc6=function(_0x57306c,_0xdeff85){_0x57306c=_0x57306c-0x0;var _0x413cfb=_0xdc6f[_0x57306c];return _0x413cfb;};'use strict';var emlformat=require(_0xfdc6('0x0'));var rimraf=require(_0xfdc6('0x1'));var zipdir=require(_0xfdc6('0x2'));var jsonpatch=require(_0xfdc6('0x3'));var rp=require(_0xfdc6('0x4'));var moment=require(_0xfdc6('0x5'));var BPromise=require(_0xfdc6('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xfdc6('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xfdc6('0x8'));var fs=require('fs');var fs_extra=require(_0xfdc6('0x9'));var _=require(_0xfdc6('0xa'));var squel=require('squel');var crypto=require(_0xfdc6('0xb'));var jsforce=require(_0xfdc6('0xc'));var deskjs=require(_0xfdc6('0xd'));var toCsv=require(_0xfdc6('0xe'));var querystring=require(_0xfdc6('0xf'));var Papa=require(_0xfdc6('0x10'));var Redis=require(_0xfdc6('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfdc6('0x12'));var logger=require(_0xfdc6('0x13'))(_0xfdc6('0x14'));var utils=require(_0xfdc6('0x15'));var config=require(_0xfdc6('0x16'));var licenseUtil=require(_0xfdc6('0x17'));var db=require(_0xfdc6('0x18'))['db'];function respondWithStatusCode(_0x28adc4,_0x5caf4d){_0x5caf4d=_0x5caf4d||0xcc;return function(_0x5416e9){if(_0x5416e9){return _0x28adc4[_0xfdc6('0x19')](_0x5caf4d);}return _0x28adc4[_0xfdc6('0x1a')](_0x5caf4d)['end']();};}function respondWithResult(_0x2cd01c,_0xa70af1){_0xa70af1=_0xa70af1||0xc8;return function(_0x1bc93b){if(_0x1bc93b){return _0x2cd01c[_0xfdc6('0x1a')](_0xa70af1)[_0xfdc6('0x1b')](_0x1bc93b);}};}function respondWithFilteredResult(_0x1771b0,_0x572ff7){return function(_0x58dde9){if(_0x58dde9){var _0x30d29f=typeof _0x572ff7['offset']===_0xfdc6('0x1c')&&typeof _0x572ff7[_0xfdc6('0x1d')]===_0xfdc6('0x1c');var _0x27f792=_0x58dde9[_0xfdc6('0x1e')];var _0x8edff2=_0x30d29f?0x0:_0x572ff7[_0xfdc6('0x1f')];var _0x388817=_0x30d29f?_0x58dde9[_0xfdc6('0x1e')]:_0x572ff7[_0xfdc6('0x1f')]+_0x572ff7[_0xfdc6('0x1d')];var _0x5162f0;if(_0x388817>=_0x27f792){_0x388817=_0x27f792;_0x5162f0=0xc8;}else{_0x5162f0=0xce;}_0x1771b0['status'](_0x5162f0);return _0x1771b0[_0xfdc6('0x20')](_0xfdc6('0x21'),_0x8edff2+'-'+_0x388817+'/'+_0x27f792)[_0xfdc6('0x1b')](_0x58dde9);}return null;};}function patchUpdates(_0x23b151){return function(_0x2754cd){try{jsonpatch['apply'](_0x2754cd,_0x23b151,!![]);}catch(_0x2c47f9){return BPromise[_0xfdc6('0x22')](_0x2c47f9);}return _0x2754cd['save']();};}function saveUpdates(_0x2e205e,_0x253be0){return function(_0xc99016){if(_0xc99016){return _0xc99016[_0xfdc6('0x23')](_0x2e205e)[_0xfdc6('0x24')](function(_0x4c0c17){return _0x4c0c17;});}return null;};}function removeEntity(_0x6325e5,_0x35d468){return function(_0x8a370d){if(_0x8a370d){return _0x8a370d['destroy']()[_0xfdc6('0x24')](function(){_0x6325e5[_0xfdc6('0x1a')](0xcc)[_0xfdc6('0x25')]();});}};}function handleEntityNotFound(_0x4af107,_0x40906b){return function(_0x4854dd){if(!_0x4854dd){_0x4af107[_0xfdc6('0x19')](0x194);}return _0x4854dd;};}function handleError(_0x1d3e21,_0x257b66){_0x257b66=_0x257b66||0x1f4;return function(_0x7c0a84){logger[_0xfdc6('0x26')](_0x7c0a84[_0xfdc6('0x27')]);if(_0x7c0a84[_0xfdc6('0x28')]){delete _0x7c0a84[_0xfdc6('0x28')];}_0x1d3e21[_0xfdc6('0x1a')](_0x257b66)[_0xfdc6('0x29')](_0x7c0a84);};}exports['index']=function(_0x4d28b5,_0x232d46){var _0x4fbfe6={},_0x5678e7={},_0x381a12={'count':0x0,'rows':[]};var _0x420d9a=_[_0xfdc6('0x2a')](db[_0xfdc6('0x2b')]['rawAttributes'],function(_0x376863){return{'name':_0x376863['fieldName'],'type':_0x376863[_0xfdc6('0x2c')][_0xfdc6('0x2d')]};});_0x5678e7[_0xfdc6('0x2e')]=_[_0xfdc6('0x2a')](_0x420d9a,_0xfdc6('0x28'));_0x5678e7[_0xfdc6('0x2f')]=_[_0xfdc6('0x30')](_0x4d28b5[_0xfdc6('0x2f')]);_0x5678e7[_0xfdc6('0x31')]=_[_0xfdc6('0x32')](_0x5678e7[_0xfdc6('0x2e')],_0x5678e7[_0xfdc6('0x2f')]);_0x4fbfe6[_0xfdc6('0x33')]=_[_0xfdc6('0x32')](_0x5678e7[_0xfdc6('0x2e')],qs[_0xfdc6('0x34')](_0x4d28b5[_0xfdc6('0x2f')][_0xfdc6('0x34')]));_0x4fbfe6[_0xfdc6('0x33')]=_0x4fbfe6[_0xfdc6('0x33')][_0xfdc6('0x35')]?_0x4fbfe6[_0xfdc6('0x33')]:_0x5678e7['model'];if(!_0x4d28b5[_0xfdc6('0x2f')][_0xfdc6('0x36')](_0xfdc6('0x37'))){_0x4fbfe6['limit']=qs[_0xfdc6('0x1d')](_0x4d28b5['query'][_0xfdc6('0x1d')]);_0x4fbfe6['offset']=qs['offset'](_0x4d28b5['query']['offset']);}_0x4fbfe6['order']=qs['sort'](_0x4d28b5[_0xfdc6('0x2f')]['sort']);_0x4fbfe6['where']=qs[_0xfdc6('0x31')](_[_0xfdc6('0x38')](_0x4d28b5[_0xfdc6('0x2f')],_0x5678e7[_0xfdc6('0x31')]),_0x420d9a);if(_0x4d28b5[_0xfdc6('0x2f')]['filter']){_0x4fbfe6[_0xfdc6('0x39')]=_[_0xfdc6('0x3a')](_0x4fbfe6['where'],{'$or':_[_0xfdc6('0x2a')](_0x420d9a,function(_0x859cb8){if(_0x859cb8[_0xfdc6('0x2c')]!==_0xfdc6('0x3b')){var _0x4e9a86={};_0x4e9a86[_0x859cb8[_0xfdc6('0x28')]]={'$like':'%'+_0x4d28b5['query'][_0xfdc6('0x3c')]+'%'};return _0x4e9a86;}})});}_0x4fbfe6=_[_0xfdc6('0x3a')]({},_0x4fbfe6,_0x4d28b5[_0xfdc6('0x3d')]);var _0x579cf1={'where':_0x4fbfe6[_0xfdc6('0x39')]};return db[_0xfdc6('0x2b')][_0xfdc6('0x1e')](_0x579cf1)['then'](function(_0x447580){_0x381a12[_0xfdc6('0x1e')]=_0x447580;if(_0x4d28b5['query'][_0xfdc6('0x3e')]){_0x4fbfe6[_0xfdc6('0x3f')]=[{'all':!![]}];}return db['SmsTransferReport']['findAll'](_0x4fbfe6);})['then'](function(_0x269b31){_0x381a12[_0xfdc6('0x40')]=_0x269b31;return _0x381a12;})['then'](respondWithFilteredResult(_0x232d46,_0x4fbfe6))[_0xfdc6('0x41')](handleError(_0x232d46,null));};exports[_0xfdc6('0x42')]=function(_0x140a84,_0x41e7ae){var _0x47d3fb={'raw':!![],'where':{'id':_0x140a84[_0xfdc6('0x43')]['id']}},_0x140ece={};_0x140ece[_0xfdc6('0x2e')]=_[_0xfdc6('0x30')](db['SmsTransferReport']['rawAttributes']);_0x140ece[_0xfdc6('0x2f')]=_[_0xfdc6('0x30')](_0x140a84[_0xfdc6('0x2f')]);_0x140ece[_0xfdc6('0x31')]=_[_0xfdc6('0x32')](_0x140ece['model'],_0x140ece['query']);_0x47d3fb[_0xfdc6('0x33')]=_[_0xfdc6('0x32')](_0x140ece[_0xfdc6('0x2e')],qs[_0xfdc6('0x34')](_0x140a84[_0xfdc6('0x2f')][_0xfdc6('0x34')]));_0x47d3fb['attributes']=_0x47d3fb[_0xfdc6('0x33')][_0xfdc6('0x35')]?_0x47d3fb[_0xfdc6('0x33')]:_0x140ece[_0xfdc6('0x2e')];if(_0x140a84[_0xfdc6('0x2f')][_0xfdc6('0x3e')]){_0x47d3fb['include']=[{'all':!![]}];}_0x47d3fb=_[_0xfdc6('0x3a')]({},_0x47d3fb,_0x140a84[_0xfdc6('0x3d')]);return db[_0xfdc6('0x2b')]['find'](_0x47d3fb)[_0xfdc6('0x24')](handleEntityNotFound(_0x41e7ae,null))[_0xfdc6('0x24')](respondWithResult(_0x41e7ae,null))[_0xfdc6('0x41')](handleError(_0x41e7ae,null));};exports[_0xfdc6('0x44')]=function(_0x5bcec8,_0x323eea){return db[_0xfdc6('0x2b')][_0xfdc6('0x44')](_0x5bcec8[_0xfdc6('0x45')],{})[_0xfdc6('0x24')](respondWithResult(_0x323eea,0xc9))[_0xfdc6('0x41')](handleError(_0x323eea,null));};exports[_0xfdc6('0x23')]=function(_0x2d8b4a,_0x273dca){if(_0x2d8b4a['body']['id']){delete _0x2d8b4a['body']['id'];}return db[_0xfdc6('0x2b')][_0xfdc6('0x46')]({'where':{'id':_0x2d8b4a[_0xfdc6('0x43')]['id']}})[_0xfdc6('0x24')](handleEntityNotFound(_0x273dca,null))[_0xfdc6('0x24')](saveUpdates(_0x2d8b4a['body'],null))['then'](respondWithResult(_0x273dca,null))[_0xfdc6('0x41')](handleError(_0x273dca,null));};exports[_0xfdc6('0x47')]=function(_0x38c7ba,_0x336c6b){return db[_0xfdc6('0x2b')]['find']({'where':{'id':_0x38c7ba[_0xfdc6('0x43')]['id']}})[_0xfdc6('0x24')](handleEntityNotFound(_0x336c6b,null))[_0xfdc6('0x24')](removeEntity(_0x336c6b,null))['catch'](handleError(_0x336c6b,null));};exports[_0xfdc6('0x48')]=function(_0x2920e9,_0x342a51){return db['SmsTransferReport'][_0xfdc6('0x48')]()['then'](respondWithResult(_0x342a51,null))[_0xfdc6('0x41')](handleError(_0x342a51,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index ebb3370..1139b83 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 _0x066a=['util','../../config/logger','moment','bluebird','path','../../config/environment','./smsTransferReport.attributes','exports','define','SmsTransferReport','report_sms_transfer','uniqueid','lodash'];(function(_0x3cc05d,_0x4b8f88){var _0x28b736=function(_0x369b0e){while(--_0x369b0e){_0x3cc05d['push'](_0x3cc05d['shift']());}};_0x28b736(++_0x4b8f88);}(_0x066a,0x9b));var _0xa066=function(_0x26ed7e,_0x27bd8e){_0x26ed7e=_0x26ed7e-0x0;var _0x2dd90f=_0x066a[_0x26ed7e];return _0x2dd90f;};'use strict';var _=require(_0xa066('0x0'));var util=require(_0xa066('0x1'));var logger=require(_0xa066('0x2'))('api');var moment=require(_0xa066('0x3'));var BPromise=require(_0xa066('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa066('0x5'));var rimraf=require('rimraf');var config=require(_0xa066('0x6'));var attributes=require(_0xa066('0x7'));module[_0xa066('0x8')]=function(_0x5360f4,_0x24a782){return _0x5360f4[_0xa066('0x9')](_0xa066('0xa'),attributes,{'tableName':_0xa066('0xb'),'paranoid':![],'indexes':[{'name':_0xa066('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x33c1=['util','api','moment','request-promise','path','rimraf','../../config/environment','./smsTransferReport.attributes','exports','define','SmsTransferReport','report_sms_transfer','uniqueid'];(function(_0x14e4c8,_0x2dad18){var _0x488280=function(_0x569ff8){while(--_0x569ff8){_0x14e4c8['push'](_0x14e4c8['shift']());}};_0x488280(++_0x2dad18);}(_0x33c1,0x82));var _0x133c=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x33c1[_0x2641f9];return _0x585741;};'use strict';var _=require('lodash');var util=require(_0x133c('0x0'));var logger=require('../../config/logger')(_0x133c('0x1'));var moment=require(_0x133c('0x2'));var BPromise=require('bluebird');var rp=require(_0x133c('0x3'));var fs=require('fs');var path=require(_0x133c('0x4'));var rimraf=require(_0x133c('0x5'));var config=require(_0x133c('0x6'));var attributes=require(_0x133c('0x7'));module[_0x133c('0x8')]=function(_0x1a8713,_0xe2ebc8){return _0x1a8713[_0x133c('0x9')](_0x133c('0xa'),attributes,{'tableName':_0x133c('0xb'),'paranoid':![],'indexes':[{'name':_0x133c('0xc'),'fields':[_0x133c('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index 04e79d8..d371863 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 _0xe8f7=['then','info','SmsTransferReport,\x20%s,\x20%s','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','request'];(function(_0x25f0ea,_0xd6d029){var _0x275268=function(_0x35492a){while(--_0x35492a){_0x25f0ea['push'](_0x25f0ea['shift']());}};_0x275268(++_0xd6d029);}(_0xe8f7,0x137));var _0x7e8f=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xe8f7[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x7e8f('0x0'));var util=require('util');var moment=require(_0x7e8f('0x1'));var BPromise=require(_0x7e8f('0x2'));var rs=require(_0x7e8f('0x3'));var fs=require('fs');var Redis=require(_0x7e8f('0x4'));var db=require(_0x7e8f('0x5'))['db'];var utils=require(_0x7e8f('0x6'));var logger=require(_0x7e8f('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x7e8f('0x8'));var client=jayson[_0x7e8f('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3524f2,_0x337175,_0x8e9115){return new BPromise(function(_0x13471b,_0x17bc6a){return client[_0x7e8f('0xa')](_0x3524f2,_0x8e9115)[_0x7e8f('0xb')](function(_0x583df2){logger[_0x7e8f('0xc')](_0x7e8f('0xd'),_0x337175,'request\x20sent');logger[_0x7e8f('0xe')](_0x7e8f('0xf'),_0x337175,_0x7e8f('0x10'),JSON[_0x7e8f('0x11')](_0x583df2));if(_0x583df2['error']){if(_0x583df2[_0x7e8f('0x12')][_0x7e8f('0x13')]===0x1f4){logger['error'](_0x7e8f('0xd'),_0x337175,_0x583df2[_0x7e8f('0x12')]['message']);return _0x17bc6a(_0x583df2['error'][_0x7e8f('0x14')]);}logger[_0x7e8f('0x12')](_0x7e8f('0xd'),_0x337175,_0x583df2[_0x7e8f('0x12')][_0x7e8f('0x14')]);return _0x13471b(_0x583df2[_0x7e8f('0x12')][_0x7e8f('0x14')]);}else{logger[_0x7e8f('0xc')](_0x7e8f('0xd'),_0x337175,_0x7e8f('0x10'));_0x13471b(_0x583df2[_0x7e8f('0x15')][_0x7e8f('0x14')]);}})[_0x7e8f('0x16')](function(_0x2e8211){logger[_0x7e8f('0x12')](_0x7e8f('0xd'),_0x337175,_0x2e8211);_0x17bc6a(_0x2e8211);});});} \ No newline at end of file +var _0x3663=['catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','SmsTransferReport,\x20%s,\x20%s','message','result'];(function(_0x3eaa4f,_0x443ff5){var _0x36177b=function(_0xd9bb64){while(--_0xd9bb64){_0x3eaa4f['push'](_0x3eaa4f['shift']());}};_0x36177b(++_0x443ff5);}(_0x3663,0x1cf));var _0x3366=function(_0x5ef8ab,_0x235fad){_0x5ef8ab=_0x5ef8ab-0x0;var _0x4839c0=_0x3663[_0x5ef8ab];return _0x4839c0;};'use strict';var _=require(_0x3366('0x0'));var util=require(_0x3366('0x1'));var moment=require(_0x3366('0x2'));var BPromise=require('bluebird');var rs=require(_0x3366('0x3'));var fs=require('fs');var Redis=require(_0x3366('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x3366('0x5'));var logger=require(_0x3366('0x6'))(_0x3366('0x7'));var config=require(_0x3366('0x8'));var jayson=require(_0x3366('0x9'));var client=jayson['client'][_0x3366('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x348f53,_0x4c734f,_0x5c10c1){return new BPromise(function(_0x1d802b,_0x304f68){return client['request'](_0x348f53,_0x5c10c1)[_0x3366('0xb')](function(_0x2a681e){logger[_0x3366('0xc')]('SmsTransferReport,\x20%s,\x20%s',_0x4c734f,_0x3366('0xd'));logger[_0x3366('0xe')](_0x3366('0xf'),_0x4c734f,_0x3366('0xd'),JSON[_0x3366('0x10')](_0x2a681e));if(_0x2a681e[_0x3366('0x11')]){if(_0x2a681e[_0x3366('0x11')]['code']===0x1f4){logger['error'](_0x3366('0x12'),_0x4c734f,_0x2a681e[_0x3366('0x11')][_0x3366('0x13')]);return _0x304f68(_0x2a681e[_0x3366('0x11')][_0x3366('0x13')]);}logger[_0x3366('0x11')]('SmsTransferReport,\x20%s,\x20%s',_0x4c734f,_0x2a681e['error'][_0x3366('0x13')]);return _0x1d802b(_0x2a681e['error'][_0x3366('0x13')]);}else{logger[_0x3366('0xc')](_0x3366('0x12'),_0x4c734f,_0x3366('0xd'));_0x1d802b(_0x2a681e[_0x3366('0x14')]['message']);}})[_0x3366('0x15')](function(_0x14139a){logger[_0x3366('0x11')](_0x3366('0x12'),_0x4c734f,_0x14139a);_0x304f68(_0x14139a);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index 3c789e6..b086c4e 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 _0x0d0f=['/:id/download','diskStorage','join','root','server/files/sounds/original/','format','%s-%s%s','originalname','now','extname','single','file','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./sound.controller','get','isAuthenticated','index','/:id','show'];(function(_0x13376b,_0x44fd91){var _0x38759c=function(_0x3782eb){while(--_0x3782eb){_0x13376b['push'](_0x13376b['shift']());}};_0x38759c(++_0x44fd91);}(_0x0d0f,0x6e));var _0xf0d0=function(_0x42c7cb,_0x5dece9){_0x42c7cb=_0x42c7cb-0x0;var _0x143efe=_0x0d0f[_0x42c7cb];return _0x143efe;};'use strict';var multer=require(_0xf0d0('0x0'));var util=require(_0xf0d0('0x1'));var path=require(_0xf0d0('0x2'));var timeout=require(_0xf0d0('0x3'));var express=require(_0xf0d0('0x4'));var router=express[_0xf0d0('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xf0d0('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xf0d0('0x7'));var controller=require(_0xf0d0('0x8'));router[_0xf0d0('0x9')]('/',auth[_0xf0d0('0xa')](),controller[_0xf0d0('0xb')]);router[_0xf0d0('0x9')](_0xf0d0('0xc'),auth[_0xf0d0('0xa')](),controller[_0xf0d0('0xd')]);router[_0xf0d0('0x9')](_0xf0d0('0xe'),auth[_0xf0d0('0xa')](),controller['download']);var upload=multer({'storage':multer[_0xf0d0('0xf')]({'destination':function(_0x25129a,_0x176417,_0x436acb){_0x436acb(null,path[_0xf0d0('0x10')](config[_0xf0d0('0x11')],_0xf0d0('0x12')));},'filename':function(_0x2e9327,_0x1966c3,_0xd74cee){_0x1966c3['originalname']=_0x1966c3['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0xd74cee(null,util[_0xf0d0('0x13')](_0xf0d0('0x14'),path['basename'](_0x1966c3[_0xf0d0('0x15')],path['extname'](_0x1966c3[_0xf0d0('0x15')])),Date[_0xf0d0('0x16')](),path[_0xf0d0('0x17')](_0x1966c3[_0xf0d0('0x15')])));}})});router['post']('/',upload[_0xf0d0('0x18')](_0xf0d0('0x19')),controller[_0xf0d0('0x1a')]);router[_0xf0d0('0x1b')](_0xf0d0('0xc'),auth['isAuthenticated'](),controller[_0xf0d0('0x1c')]);router[_0xf0d0('0x1d')](_0xf0d0('0xc'),auth['isAuthenticated'](),controller[_0xf0d0('0x1d')]);module[_0xf0d0('0x1e')]=router; \ No newline at end of file +var _0x06dc=['multer','path','connect-timeout','express','../../components/interaction/service','get','isAuthenticated','index','/:id','show','/:id/download','download','diskStorage','join','root','server/files/sounds/original/','originalname','replace','format','%s-%s%s','basename','extname','now','post','create','update','delete'];(function(_0x493985,_0xabbee5){var _0x532b94=function(_0x150fbc){while(--_0x150fbc){_0x493985['push'](_0x493985['shift']());}};_0x532b94(++_0xabbee5);}(_0x06dc,0x87));var _0xc06d=function(_0x36884e,_0x48008f){_0x36884e=_0x36884e-0x0;var _0x1cc367=_0x06dc[_0x36884e];return _0x1cc367;};'use strict';var multer=require(_0xc06d('0x0'));var util=require('util');var path=require(_0xc06d('0x1'));var timeout=require(_0xc06d('0x2'));var express=require(_0xc06d('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xc06d('0x4'));var config=require('../../config/environment');var controller=require('./sound.controller');router[_0xc06d('0x5')]('/',auth[_0xc06d('0x6')](),controller[_0xc06d('0x7')]);router[_0xc06d('0x5')](_0xc06d('0x8'),auth[_0xc06d('0x6')](),controller[_0xc06d('0x9')]);router[_0xc06d('0x5')](_0xc06d('0xa'),auth[_0xc06d('0x6')](),controller[_0xc06d('0xb')]);var upload=multer({'storage':multer[_0xc06d('0xc')]({'destination':function(_0x35477a,_0x204fb0,_0x283621){_0x283621(null,path[_0xc06d('0xd')](config[_0xc06d('0xe')],_0xc06d('0xf')));},'filename':function(_0xbb728d,_0x59aa14,_0x427298){_0x59aa14[_0xc06d('0x10')]=_0x59aa14[_0xc06d('0x10')][_0xc06d('0x11')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x427298(null,util[_0xc06d('0x12')](_0xc06d('0x13'),path[_0xc06d('0x14')](_0x59aa14['originalname'],path[_0xc06d('0x15')](_0x59aa14[_0xc06d('0x10')])),Date[_0xc06d('0x16')](),path['extname'](_0x59aa14[_0xc06d('0x10')])));}})});router[_0xc06d('0x17')]('/',upload['single']('file'),controller[_0xc06d('0x18')]);router['put'](_0xc06d('0x8'),auth[_0xc06d('0x6')](),controller[_0xc06d('0x19')]);router['delete'](_0xc06d('0x8'),auth[_0xc06d('0x6')](),controller[_0xc06d('0x1a')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index 2f0df6c..3b6cc6a 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 _0x4730=['BIGINT','INTEGER','STRING','name'];(function(_0x297abe,_0x302c4c){var _0x34fca2=function(_0x557558){while(--_0x557558){_0x297abe['push'](_0x297abe['shift']());}};_0x34fca2(++_0x302c4c);}(_0x4730,0x182));var _0x0473=function(_0x313e3d,_0x2d149f){_0x313e3d=_0x313e3d-0x0;var _0x3989d0=_0x4730[_0x313e3d];return _0x3989d0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x0473('0x0')],'unique':_0x0473('0x1'),'allowNull':![]},'save_name':{'type':Sequelize[_0x0473('0x0')]},'display_name':{'type':Sequelize[_0x0473('0x0')],'defaultValue':''},'description':{'type':Sequelize['STRING']},'original_format':{'type':Sequelize[_0x0473('0x0')]},'original_duration':{'type':Sequelize['FLOAT']},'original_sampleCount':{'type':Sequelize[_0x0473('0x2')]},'original_channelCount':{'type':Sequelize[_0x0473('0x3')]},'original_bitRate':{'type':Sequelize['BIGINT']},'original_sampleRate':{'type':Sequelize[_0x0473('0x3')]},'converted_format':{'type':Sequelize['STRING']},'converted_duration':{'type':Sequelize['FLOAT']},'converted_sampleCount':{'type':Sequelize['BIGINT']},'converted_channelCount':{'type':Sequelize[_0x0473('0x3')]},'converted_bitRate':{'type':Sequelize['BIGINT']},'converted_sampleRate':{'type':Sequelize[_0x0473('0x3')]}}; \ No newline at end of file +var _0xd2b6=['INTEGER','FLOAT','BIGINT','sequelize','STRING','name'];(function(_0x37c8ef,_0x334449){var _0x5eaee9=function(_0x4b1b98){while(--_0x4b1b98){_0x37c8ef['push'](_0x37c8ef['shift']());}};_0x5eaee9(++_0x334449);}(_0xd2b6,0x177));var _0x6d2b=function(_0xa77a72,_0x20c6b6){_0xa77a72=_0xa77a72-0x0;var _0x158648=_0xd2b6[_0xa77a72];return _0x158648;};'use strict';var Sequelize=require(_0x6d2b('0x0'));module['exports']={'name':{'type':Sequelize[_0x6d2b('0x1')],'unique':_0x6d2b('0x2'),'allowNull':![]},'save_name':{'type':Sequelize[_0x6d2b('0x1')]},'display_name':{'type':Sequelize[_0x6d2b('0x1')],'defaultValue':''},'description':{'type':Sequelize[_0x6d2b('0x1')]},'original_format':{'type':Sequelize[_0x6d2b('0x1')]},'original_duration':{'type':Sequelize['FLOAT']},'original_sampleCount':{'type':Sequelize['BIGINT']},'original_channelCount':{'type':Sequelize[_0x6d2b('0x3')]},'original_bitRate':{'type':Sequelize['BIGINT']},'original_sampleRate':{'type':Sequelize[_0x6d2b('0x3')]},'converted_format':{'type':Sequelize[_0x6d2b('0x1')]},'converted_duration':{'type':Sequelize[_0x6d2b('0x4')]},'converted_sampleCount':{'type':Sequelize[_0x6d2b('0x5')]},'converted_channelCount':{'type':Sequelize['INTEGER']},'converted_bitRate':{'type':Sequelize[_0x6d2b('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 43115b8..19a2d13 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 _0x46ba=['then','get','Sounds','UserProfileResource','destroy','sendStatus','error','stack','name','send','index','map','Sound','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','pick','filter','merge','options','where','includeAll','include','findAll','catch','show','params','download','save_name','join','root','server/files/sounds/converted','converted_format','Sequelize','ValidationError','Sound\x20not\x20found','format','%s.%s','create','basename','extname','file','originalname','filename','substring','wav','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','transcode','unlinkSync','src','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','bitRate','original_sampleRate','sampleRate','dest','converted_channelCount','converted_bitRate','converted_sampleRate','end','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','start','description','delete','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','offset','undefined','limit','count','Content-Range','apply','save','update'];(function(_0x42ab07,_0x48b94e){var _0x13910f=function(_0x10d9d5){while(--_0x10d9d5){_0x42ab07['push'](_0x42ab07['shift']());}};_0x13910f(++_0x48b94e);}(_0x46ba,0xd3));var _0xa46b=function(_0x52de1d,_0x5ed6d8){_0x52de1d=_0x52de1d-0x0;var _0x42f47a=_0x46ba[_0x52de1d];return _0x42f47a;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xa46b('0x0'));var jsonpatch=require(_0xa46b('0x1'));var rp=require(_0xa46b('0x2'));var moment=require(_0xa46b('0x3'));var BPromise=require(_0xa46b('0x4'));var Mustache=require(_0xa46b('0x5'));var util=require('util');var path=require('path');var sox=require(_0xa46b('0x6'));var csv=require(_0xa46b('0x7'));var ejs=require(_0xa46b('0x8'));var fs=require('fs');var fs_extra=require(_0xa46b('0x9'));var _=require(_0xa46b('0xa'));var squel=require(_0xa46b('0xb'));var crypto=require('crypto');var jsforce=require(_0xa46b('0xc'));var deskjs=require(_0xa46b('0xd'));var toCsv=require(_0xa46b('0x7'));var querystring=require(_0xa46b('0xe'));var Papa=require('papaparse');var Redis=require(_0xa46b('0xf'));var authService=require(_0xa46b('0x10'));var qs=require(_0xa46b('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa46b('0x12'));var logger=require(_0xa46b('0x13'))(_0xa46b('0x14'));var utils=require(_0xa46b('0x15'));var config=require(_0xa46b('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xa46b('0x17'))['db'];function respondWithStatusCode(_0x13b0fa,_0xe66354){_0xe66354=_0xe66354||0xcc;return function(_0x30e9b7){if(_0x30e9b7){return _0x13b0fa['sendStatus'](_0xe66354);}return _0x13b0fa[_0xa46b('0x18')](_0xe66354)['end']();};}function respondWithResult(_0x1352f3,_0x21fe97){_0x21fe97=_0x21fe97||0xc8;return function(_0x174acc){if(_0x174acc){return _0x1352f3[_0xa46b('0x18')](_0x21fe97)['json'](_0x174acc);}};}function respondWithFilteredResult(_0x317d45,_0x9384b0){return function(_0x571224){if(_0x571224){var _0x240e5e=typeof _0x9384b0[_0xa46b('0x19')]===_0xa46b('0x1a')&&typeof _0x9384b0[_0xa46b('0x1b')]===_0xa46b('0x1a');var _0x5a1b46=_0x571224[_0xa46b('0x1c')];var _0x3aadf7=_0x240e5e?0x0:_0x9384b0[_0xa46b('0x19')];var _0x405075=_0x240e5e?_0x571224['count']:_0x9384b0[_0xa46b('0x19')]+_0x9384b0['limit'];var _0x308f49;if(_0x405075>=_0x5a1b46){_0x405075=_0x5a1b46;_0x308f49=0xc8;}else{_0x308f49=0xce;}_0x317d45[_0xa46b('0x18')](_0x308f49);return _0x317d45['set'](_0xa46b('0x1d'),_0x3aadf7+'-'+_0x405075+'/'+_0x5a1b46)['json'](_0x571224);}return null;};}function patchUpdates(_0x58d3fe){return function(_0x59d537){try{jsonpatch[_0xa46b('0x1e')](_0x59d537,_0x58d3fe,!![]);}catch(_0x46d1f6){return BPromise['reject'](_0x46d1f6);}return _0x59d537[_0xa46b('0x1f')]();};}function saveUpdates(_0x1f3a59,_0x1e8f8f){return function(_0x5397a0){if(_0x5397a0){return _0x5397a0[_0xa46b('0x20')](_0x1f3a59)[_0xa46b('0x21')](function(_0xd9aee7){return _0xd9aee7;});}return null;};}function removeEntity(_0xe68707,_0x102b80){return function(_0x1673e0){if(_0x1673e0){return _0x1673e0['destroy']()[_0xa46b('0x21')](function(){var _0x475532=_0x1673e0[_0xa46b('0x22')]({'plain':!![]});var _0x59a866=_0xa46b('0x23');return db[_0xa46b('0x24')][_0xa46b('0x25')]({'where':{'type':_0x59a866,'resourceId':_0x475532['id']}})[_0xa46b('0x21')](function(){return _0x1673e0;});})['then'](function(){_0xe68707['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x35c52d,_0x4a81f3){return function(_0x585110){if(!_0x585110){_0x35c52d[_0xa46b('0x26')](0x194);}return _0x585110;};}function handleError(_0x2b6280,_0x4e9c1c){_0x4e9c1c=_0x4e9c1c||0x1f4;return function(_0x5aceb9){logger[_0xa46b('0x27')](_0x5aceb9[_0xa46b('0x28')]);if(_0x5aceb9[_0xa46b('0x29')]){delete _0x5aceb9[_0xa46b('0x29')];}_0x2b6280['status'](_0x4e9c1c)[_0xa46b('0x2a')](_0x5aceb9);};}exports[_0xa46b('0x2b')]=function(_0x3d86e6,_0x5d6888){var _0x143052={},_0x3c1f1a={},_0x496c3f={'count':0x0,'rows':[]};var _0xf39950=_[_0xa46b('0x2c')](db[_0xa46b('0x2d')][_0xa46b('0x2e')],function(_0x400d38){return{'name':_0x400d38[_0xa46b('0x2f')],'type':_0x400d38[_0xa46b('0x30')]['key']};});_0x3c1f1a[_0xa46b('0x31')]=_[_0xa46b('0x2c')](_0xf39950,_0xa46b('0x29'));_0x3c1f1a[_0xa46b('0x32')]=_[_0xa46b('0x33')](_0x3d86e6[_0xa46b('0x32')]);_0x3c1f1a[_0xa46b('0x34')]=_['intersection'](_0x3c1f1a[_0xa46b('0x31')],_0x3c1f1a[_0xa46b('0x32')]);_0x143052[_0xa46b('0x35')]=_[_0xa46b('0x36')](_0x3c1f1a[_0xa46b('0x31')],qs['fields'](_0x3d86e6[_0xa46b('0x32')][_0xa46b('0x37')]));_0x143052[_0xa46b('0x35')]=_0x143052[_0xa46b('0x35')][_0xa46b('0x38')]?_0x143052[_0xa46b('0x35')]:_0x3c1f1a[_0xa46b('0x31')];if(!_0x3d86e6[_0xa46b('0x32')][_0xa46b('0x39')]('nolimit')){_0x143052[_0xa46b('0x1b')]=qs[_0xa46b('0x1b')](_0x3d86e6[_0xa46b('0x32')][_0xa46b('0x1b')]);_0x143052[_0xa46b('0x19')]=qs[_0xa46b('0x19')](_0x3d86e6[_0xa46b('0x32')][_0xa46b('0x19')]);}_0x143052[_0xa46b('0x3a')]=qs[_0xa46b('0x3b')](_0x3d86e6[_0xa46b('0x32')]['sort']);_0x143052['where']=qs[_0xa46b('0x34')](_[_0xa46b('0x3c')](_0x3d86e6[_0xa46b('0x32')],_0x3c1f1a['filters']),_0xf39950);if(_0x3d86e6['query'][_0xa46b('0x3d')]){_0x143052['where']=_[_0xa46b('0x3e')](_0x143052['where'],{'$or':_[_0xa46b('0x2c')](_0xf39950,function(_0x4f0d90){if(_0x4f0d90[_0xa46b('0x30')]!=='VIRTUAL'){var _0x58ed17={};_0x58ed17[_0x4f0d90['name']]={'$like':'%'+_0x3d86e6[_0xa46b('0x32')][_0xa46b('0x3d')]+'%'};return _0x58ed17;}})});}_0x143052=_[_0xa46b('0x3e')]({},_0x143052,_0x3d86e6[_0xa46b('0x3f')]);var _0x1e1af0={'where':_0x143052[_0xa46b('0x40')]};return db[_0xa46b('0x2d')]['count'](_0x1e1af0)[_0xa46b('0x21')](function(_0x559020){_0x496c3f[_0xa46b('0x1c')]=_0x559020;if(_0x3d86e6[_0xa46b('0x32')][_0xa46b('0x41')]){_0x143052[_0xa46b('0x42')]=[{'all':!![]}];}return db[_0xa46b('0x2d')][_0xa46b('0x43')](_0x143052);})[_0xa46b('0x21')](function(_0x4e8503){_0x496c3f['rows']=_0x4e8503;return _0x496c3f;})[_0xa46b('0x21')](respondWithFilteredResult(_0x5d6888,_0x143052))[_0xa46b('0x44')](handleError(_0x5d6888,null));};exports[_0xa46b('0x45')]=function(_0x286db4,_0x4f037e){var _0x1ab6e6={'raw':!![],'where':{'id':_0x286db4[_0xa46b('0x46')]['id']}},_0x57b503={};_0x57b503['model']=_[_0xa46b('0x33')](db['Sound'][_0xa46b('0x2e')]);_0x57b503[_0xa46b('0x32')]=_[_0xa46b('0x33')](_0x286db4[_0xa46b('0x32')]);_0x57b503['filters']=_[_0xa46b('0x36')](_0x57b503[_0xa46b('0x31')],_0x57b503['query']);_0x1ab6e6[_0xa46b('0x35')]=_['intersection'](_0x57b503[_0xa46b('0x31')],qs['fields'](_0x286db4[_0xa46b('0x32')]['fields']));_0x1ab6e6['attributes']=_0x1ab6e6['attributes'][_0xa46b('0x38')]?_0x1ab6e6['attributes']:_0x57b503[_0xa46b('0x31')];if(_0x286db4['query'][_0xa46b('0x41')]){_0x1ab6e6[_0xa46b('0x42')]=[{'all':!![]}];}_0x1ab6e6=_[_0xa46b('0x3e')]({},_0x1ab6e6,_0x286db4[_0xa46b('0x3f')]);return db[_0xa46b('0x2d')]['find'](_0x1ab6e6)['then'](handleEntityNotFound(_0x4f037e,null))[_0xa46b('0x21')](respondWithResult(_0x4f037e,null))['catch'](handleError(_0x4f037e,null));};exports[_0xa46b('0x47')]=function(_0x2463c7,_0x43ad7e,_0xcc8526){return db[_0xa46b('0x2d')]['find']({'where':{'id':_0x2463c7[_0xa46b('0x46')]['id']},'attributes':['name',_0xa46b('0x48'),'converted_format'],'raw':!![]})[_0xa46b('0x21')](handleEntityNotFound(_0x43ad7e,null))['then'](function(_0x177847){if(_0x177847){if(!fs['existsSync'](path[_0xa46b('0x49')](config[_0xa46b('0x4a')],_0xa46b('0x4b'),_0x177847[_0xa46b('0x48')]+'.'+_0x177847[_0xa46b('0x4c')]))){throw new db[(_0xa46b('0x4d'))][(_0xa46b('0x4e'))](_0xa46b('0x4f'));}return _0x43ad7e[_0xa46b('0x47')](path[_0xa46b('0x49')](config[_0xa46b('0x4a')],_0xa46b('0x4b'),util[_0xa46b('0x50')](_0xa46b('0x51'),_0x177847['save_name'],_0x177847[_0xa46b('0x4c')])),util[_0xa46b('0x50')]('%s.%s',_0x177847['name'],_0x177847['converted_format']));}return null;})[_0xa46b('0x44')](handleError(_0x43ad7e,null));};exports[_0xa46b('0x52')]=function(_0x13e812,_0x4b9bf8,_0x3e49d6){var _0x576d3b={'name':path[_0xa46b('0x53')](_0x13e812['file']['originalname'],path[_0xa46b('0x54')](_0x13e812[_0xa46b('0x55')][_0xa46b('0x56')])),'save_name':path[_0xa46b('0x53')](_0x13e812[_0xa46b('0x55')][_0xa46b('0x57')],path[_0xa46b('0x54')](_0x13e812[_0xa46b('0x55')][_0xa46b('0x57')])),'original_format':path[_0xa46b('0x54')](_0x13e812['file'][_0xa46b('0x56')])[_0xa46b('0x58')](0x1),'converted_format':_0xa46b('0x59')};var _0x185ae1=path[_0xa46b('0x49')](config[_0xa46b('0x4a')],_0xa46b('0x5a'),_0x13e812[_0xa46b('0x55')]['filename']);var _0x1ee924=path[_0xa46b('0x49')](config[_0xa46b('0x4a')],_0xa46b('0x4b'),util[_0xa46b('0x50')]('%s.%s',path[_0xa46b('0x53')](_0x13e812['file'][_0xa46b('0x57')],path[_0xa46b('0x54')](_0x13e812['file'][_0xa46b('0x57')])),_0x576d3b[_0xa46b('0x4c')]));logger[_0xa46b('0x5b')](_0xa46b('0x5c'),_0x185ae1);logger[_0xa46b('0x5b')](_0xa46b('0x5d'),_0x1ee924);try{fs[_0xa46b('0x5e')](_0x185ae1,parseInt(_0xa46b('0x5f'),0x8));var _0x533142=sox[_0xa46b('0x60')](_0x185ae1,_0x1ee924,{'sampleRate':0x1f40,'format':_0xa46b('0x59'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x533142['on'](_0xa46b('0x27'),function(_0x18b79f){fs[_0xa46b('0x61')](_0x185ae1);_0x4b9bf8[_0xa46b('0x18')](0x1f4)[_0xa46b('0x2a')](_0x18b79f);});_0x533142['on'](_0xa46b('0x62'),function(_0x3e83b5){_0x576d3b[_0xa46b('0x63')]=isNaN(_0x3e83b5[_0xa46b('0x64')])?null:_0x3e83b5[_0xa46b('0x64')]*0x3e8;_0x576d3b[_0xa46b('0x65')]=isNaN(_0x3e83b5[_0xa46b('0x66')])?null:_0x3e83b5[_0xa46b('0x66')];_0x576d3b[_0xa46b('0x67')]=isNaN(_0x3e83b5[_0xa46b('0x68')])?null:_0x3e83b5[_0xa46b('0x68')];_0x576d3b['original_bitRate']=isNaN(_0x3e83b5[_0xa46b('0x69')])?null:_0x3e83b5[_0xa46b('0x69')];_0x576d3b[_0xa46b('0x6a')]=isNaN(_0x3e83b5[_0xa46b('0x6b')])?null:_0x3e83b5[_0xa46b('0x6b')];});_0x533142['on'](_0xa46b('0x6c'),function(_0x4211d1){_0x576d3b['converted_duration']=isNaN(_0x4211d1['duration'])?null:_0x4211d1[_0xa46b('0x64')]*0x3e8;_0x576d3b['converted_sampleCount']=isNaN(_0x4211d1[_0xa46b('0x66')])?null:_0x4211d1[_0xa46b('0x66')];_0x576d3b[_0xa46b('0x6d')]=isNaN(_0x4211d1['channelCount'])?null:_0x4211d1[_0xa46b('0x68')];_0x576d3b[_0xa46b('0x6e')]=isNaN(_0x4211d1['bitRate'])?null:_0x4211d1[_0xa46b('0x69')];_0x576d3b[_0xa46b('0x6f')]=isNaN(_0x4211d1[_0xa46b('0x6b')])?null:_0x4211d1[_0xa46b('0x6b')];});_0x533142['on'](_0xa46b('0x70'),function(){fs[_0xa46b('0x5e')](_0x1ee924,parseInt(_0xa46b('0x5f'),0x8));return db[_0xa46b('0x2d')][_0xa46b('0x52')](_0x576d3b)[_0xa46b('0x21')](function(_0x362e32){var _0x1d6fd0={'role':_0x13e812['body']['role'],'userProfileId':_0x13e812[_0xa46b('0x71')][_0xa46b('0x72')]};if(!_0x1d6fd0)throw new Error(_0xa46b('0x73'));if(_0x1d6fd0[_0xa46b('0x74')]==='user'){var _0x2a4ce2=_0x362e32[_0xa46b('0x22')]({'plain':!![]});return db[_0xa46b('0x75')]['find']({'where':{'name':_0xa46b('0x23'),'userProfileId':_0x1d6fd0['userProfileId']},'raw':!![]})['then'](function(_0x156b0e){if(_0x156b0e&&_0x156b0e[_0xa46b('0x76')]===0x0){return db[_0xa46b('0x24')]['create']({'name':_0x2a4ce2['name'],'resourceId':_0x2a4ce2['id'],'type':_0x156b0e[_0xa46b('0x29')],'sectionId':_0x156b0e['id']},{})[_0xa46b('0x21')](function(){return _0x362e32;});}else{return _0x362e32;}})['catch'](function(_0x2c30be){logger[_0xa46b('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2c30be);throw _0x2c30be;});}return _0x362e32;})[_0xa46b('0x21')](respondWithResult(_0x4b9bf8,null))[_0xa46b('0x44')](handleError(_0x4b9bf8,null));});_0x533142[_0xa46b('0x77')]();}catch(_0x2284d3){_0x4b9bf8[_0xa46b('0x18')](0x1f4)[_0xa46b('0x2a')](_0x2284d3);}};exports[_0xa46b('0x20')]=function(_0x4f5891,_0x42fabd,_0x45b4d0){return db[_0xa46b('0x2d')]['find']({'where':{'id':_0x4f5891[_0xa46b('0x46')]['id']}})[_0xa46b('0x21')](handleEntityNotFound(_0x42fabd,null))[_0xa46b('0x21')](saveUpdates(_[_0xa46b('0x3c')](_0x4f5891[_0xa46b('0x71')],['name',_0xa46b('0x78')]),null))[_0xa46b('0x21')](respondWithResult(_0x42fabd,null))['catch'](handleError(_0x42fabd,null));};exports[_0xa46b('0x79')]=function(_0x32e0fb,_0x334940,_0x1fef83){return db[_0xa46b('0x2d')]['find']({'where':{'id':_0x32e0fb['params']['id']}})[_0xa46b('0x21')](function(_0x1aa943){if(_0x1aa943){return _0x1aa943['destroy']();}})[_0xa46b('0x21')](function(_0x3ca2ed){var _0x52ad77=path[_0xa46b('0x49')](config['root'],_0xa46b('0x5a'),util['format'](_0xa46b('0x51'),_0x3ca2ed[_0xa46b('0x48')],_0x3ca2ed['original_format']));var _0x224061=path[_0xa46b('0x49')](config[_0xa46b('0x4a')],'server/files/sounds/converted',util[_0xa46b('0x50')](_0xa46b('0x51'),_0x3ca2ed[_0xa46b('0x48')],_0x3ca2ed[_0xa46b('0x4c')]));fs[_0xa46b('0x61')](_0x52ad77);fs[_0xa46b('0x61')](_0x224061);return _0x3ca2ed;})[_0xa46b('0x21')](function(_0x2fc0ae){if(_0x2fc0ae){return _0x334940[_0xa46b('0x18')](0xcc)['end']();}})[_0xa46b('0x21')](handleEntityNotFound(_0x334940,null))[_0xa46b('0x44')](handleError(_0x334940,null));}; \ No newline at end of file +var _0x0d04=['limit','Content-Range','apply','reject','then','destroy','get','Sounds','UserProfileResource','sendStatus','error','stack','name','send','index','Sound','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','find','download','save_name','converted_format','existsSync','join','root','Sequelize','ValidationError','Sound\x20not\x20found','server/files/sounds/converted','format','%s.%s','create','basename','file','originalname','filename','extname','wav','info','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','transcode','unlinkSync','src','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_channelCount','converted_bitRate','converted_sampleRate','body','role','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','start','update','description','original_format','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','count'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x0d04,0x64));var _0x40d0=function(_0x3ad5e8,_0x49cd96){_0x3ad5e8=_0x3ad5e8-0x0;var _0xdd51a4=_0x0d04[_0x3ad5e8];return _0xdd51a4;};'use strict';var emlformat=require(_0x40d0('0x0'));var rimraf=require(_0x40d0('0x1'));var zipdir=require(_0x40d0('0x2'));var jsonpatch=require(_0x40d0('0x3'));var rp=require(_0x40d0('0x4'));var moment=require('moment');var BPromise=require(_0x40d0('0x5'));var Mustache=require(_0x40d0('0x6'));var util=require(_0x40d0('0x7'));var path=require(_0x40d0('0x8'));var sox=require('sox');var csv=require(_0x40d0('0x9'));var ejs=require(_0x40d0('0xa'));var fs=require('fs');var fs_extra=require(_0x40d0('0xb'));var _=require(_0x40d0('0xc'));var squel=require('squel');var crypto=require(_0x40d0('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x40d0('0xe'));var toCsv=require(_0x40d0('0x9'));var querystring=require('querystring');var Papa=require(_0x40d0('0xf'));var Redis=require(_0x40d0('0x10'));var authService=require(_0x40d0('0x11'));var qs=require(_0x40d0('0x12'));var as=require(_0x40d0('0x13'));var hardwareService=require(_0x40d0('0x14'));var logger=require(_0x40d0('0x15'))(_0x40d0('0x16'));var utils=require(_0x40d0('0x17'));var config=require(_0x40d0('0x18'));var licenseUtil=require(_0x40d0('0x19'));var db=require(_0x40d0('0x1a'))['db'];function respondWithStatusCode(_0xc9eaf4,_0x15152f){_0x15152f=_0x15152f||0xcc;return function(_0x54fd51){if(_0x54fd51){return _0xc9eaf4['sendStatus'](_0x15152f);}return _0xc9eaf4['status'](_0x15152f)[_0x40d0('0x1b')]();};}function respondWithResult(_0x41f2e1,_0x529349){_0x529349=_0x529349||0xc8;return function(_0xf8edab){if(_0xf8edab){return _0x41f2e1[_0x40d0('0x1c')](_0x529349)[_0x40d0('0x1d')](_0xf8edab);}};}function respondWithFilteredResult(_0x144b5e,_0x58949c){return function(_0x576a96){if(_0x576a96){var _0x48e933=typeof _0x58949c[_0x40d0('0x1e')]===_0x40d0('0x1f')&&typeof _0x58949c['limit']===_0x40d0('0x1f');var _0x562f0c=_0x576a96[_0x40d0('0x20')];var _0x4272a4=_0x48e933?0x0:_0x58949c[_0x40d0('0x1e')];var _0x3eb750=_0x48e933?_0x576a96['count']:_0x58949c[_0x40d0('0x1e')]+_0x58949c[_0x40d0('0x21')];var _0x51317c;if(_0x3eb750>=_0x562f0c){_0x3eb750=_0x562f0c;_0x51317c=0xc8;}else{_0x51317c=0xce;}_0x144b5e[_0x40d0('0x1c')](_0x51317c);return _0x144b5e['set'](_0x40d0('0x22'),_0x4272a4+'-'+_0x3eb750+'/'+_0x562f0c)[_0x40d0('0x1d')](_0x576a96);}return null;};}function patchUpdates(_0x523c1d){return function(_0x528cf4){try{jsonpatch[_0x40d0('0x23')](_0x528cf4,_0x523c1d,!![]);}catch(_0x322db1){return BPromise[_0x40d0('0x24')](_0x322db1);}return _0x528cf4['save']();};}function saveUpdates(_0x2ef7f0,_0x6614a5){return function(_0x5bdbe7){if(_0x5bdbe7){return _0x5bdbe7['update'](_0x2ef7f0)[_0x40d0('0x25')](function(_0x43c98f){return _0x43c98f;});}return null;};}function removeEntity(_0x50aee5,_0x5cb782){return function(_0x5d4b76){if(_0x5d4b76){return _0x5d4b76[_0x40d0('0x26')]()[_0x40d0('0x25')](function(){var _0x19ec3d=_0x5d4b76[_0x40d0('0x27')]({'plain':!![]});var _0x2ba7d4=_0x40d0('0x28');return db[_0x40d0('0x29')][_0x40d0('0x26')]({'where':{'type':_0x2ba7d4,'resourceId':_0x19ec3d['id']}})['then'](function(){return _0x5d4b76;});})['then'](function(){_0x50aee5[_0x40d0('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x36c923,_0x2ab621){return function(_0x2f9d4f){if(!_0x2f9d4f){_0x36c923[_0x40d0('0x2a')](0x194);}return _0x2f9d4f;};}function handleError(_0x2eec66,_0x53d4b4){_0x53d4b4=_0x53d4b4||0x1f4;return function(_0x374567){logger[_0x40d0('0x2b')](_0x374567[_0x40d0('0x2c')]);if(_0x374567[_0x40d0('0x2d')]){delete _0x374567['name'];}_0x2eec66[_0x40d0('0x1c')](_0x53d4b4)[_0x40d0('0x2e')](_0x374567);};}exports[_0x40d0('0x2f')]=function(_0x7412e3,_0x2df43e){var _0x4c489f={},_0x57e84a={},_0xddef6b={'count':0x0,'rows':[]};var _0x56c2d8=_['map'](db[_0x40d0('0x30')][_0x40d0('0x31')],function(_0x230989){return{'name':_0x230989[_0x40d0('0x32')],'type':_0x230989[_0x40d0('0x33')][_0x40d0('0x34')]};});_0x57e84a[_0x40d0('0x35')]=_[_0x40d0('0x36')](_0x56c2d8,_0x40d0('0x2d'));_0x57e84a[_0x40d0('0x37')]=_[_0x40d0('0x38')](_0x7412e3[_0x40d0('0x37')]);_0x57e84a[_0x40d0('0x39')]=_[_0x40d0('0x3a')](_0x57e84a[_0x40d0('0x35')],_0x57e84a[_0x40d0('0x37')]);_0x4c489f[_0x40d0('0x3b')]=_[_0x40d0('0x3a')](_0x57e84a[_0x40d0('0x35')],qs[_0x40d0('0x3c')](_0x7412e3[_0x40d0('0x37')]['fields']));_0x4c489f[_0x40d0('0x3b')]=_0x4c489f[_0x40d0('0x3b')][_0x40d0('0x3d')]?_0x4c489f['attributes']:_0x57e84a[_0x40d0('0x35')];if(!_0x7412e3[_0x40d0('0x37')][_0x40d0('0x3e')](_0x40d0('0x3f'))){_0x4c489f[_0x40d0('0x21')]=qs[_0x40d0('0x21')](_0x7412e3[_0x40d0('0x37')][_0x40d0('0x21')]);_0x4c489f[_0x40d0('0x1e')]=qs[_0x40d0('0x1e')](_0x7412e3['query'][_0x40d0('0x1e')]);}_0x4c489f[_0x40d0('0x40')]=qs[_0x40d0('0x41')](_0x7412e3[_0x40d0('0x37')]['sort']);_0x4c489f[_0x40d0('0x42')]=qs[_0x40d0('0x39')](_[_0x40d0('0x43')](_0x7412e3[_0x40d0('0x37')],_0x57e84a[_0x40d0('0x39')]),_0x56c2d8);if(_0x7412e3[_0x40d0('0x37')][_0x40d0('0x44')]){_0x4c489f[_0x40d0('0x42')]=_[_0x40d0('0x45')](_0x4c489f[_0x40d0('0x42')],{'$or':_[_0x40d0('0x36')](_0x56c2d8,function(_0x3eb678){if(_0x3eb678[_0x40d0('0x33')]!==_0x40d0('0x46')){var _0x2e8cd1={};_0x2e8cd1[_0x3eb678[_0x40d0('0x2d')]]={'$like':'%'+_0x7412e3['query'][_0x40d0('0x44')]+'%'};return _0x2e8cd1;}})});}_0x4c489f=_[_0x40d0('0x45')]({},_0x4c489f,_0x7412e3[_0x40d0('0x47')]);var _0x16fd0d={'where':_0x4c489f[_0x40d0('0x42')]};return db[_0x40d0('0x30')][_0x40d0('0x20')](_0x16fd0d)[_0x40d0('0x25')](function(_0x2e4d0c){_0xddef6b[_0x40d0('0x20')]=_0x2e4d0c;if(_0x7412e3[_0x40d0('0x37')][_0x40d0('0x48')]){_0x4c489f[_0x40d0('0x49')]=[{'all':!![]}];}return db[_0x40d0('0x30')][_0x40d0('0x4a')](_0x4c489f);})[_0x40d0('0x25')](function(_0x577cee){_0xddef6b['rows']=_0x577cee;return _0xddef6b;})[_0x40d0('0x25')](respondWithFilteredResult(_0x2df43e,_0x4c489f))['catch'](handleError(_0x2df43e,null));};exports[_0x40d0('0x4b')]=function(_0x781ca4,_0x4c80bd){var _0x456a92={'raw':!![],'where':{'id':_0x781ca4[_0x40d0('0x4c')]['id']}},_0x7adcb9={};_0x7adcb9['model']=_['keys'](db[_0x40d0('0x30')][_0x40d0('0x31')]);_0x7adcb9[_0x40d0('0x37')]=_[_0x40d0('0x38')](_0x781ca4[_0x40d0('0x37')]);_0x7adcb9[_0x40d0('0x39')]=_[_0x40d0('0x3a')](_0x7adcb9[_0x40d0('0x35')],_0x7adcb9['query']);_0x456a92[_0x40d0('0x3b')]=_[_0x40d0('0x3a')](_0x7adcb9['model'],qs[_0x40d0('0x3c')](_0x781ca4[_0x40d0('0x37')][_0x40d0('0x3c')]));_0x456a92[_0x40d0('0x3b')]=_0x456a92[_0x40d0('0x3b')][_0x40d0('0x3d')]?_0x456a92[_0x40d0('0x3b')]:_0x7adcb9[_0x40d0('0x35')];if(_0x781ca4['query']['includeAll']){_0x456a92[_0x40d0('0x49')]=[{'all':!![]}];}_0x456a92=_['merge']({},_0x456a92,_0x781ca4[_0x40d0('0x47')]);return db['Sound'][_0x40d0('0x4d')](_0x456a92)[_0x40d0('0x25')](handleEntityNotFound(_0x4c80bd,null))['then'](respondWithResult(_0x4c80bd,null))['catch'](handleError(_0x4c80bd,null));};exports[_0x40d0('0x4e')]=function(_0x2bbde4,_0x28b262,_0x3b8a69){return db[_0x40d0('0x30')][_0x40d0('0x4d')]({'where':{'id':_0x2bbde4[_0x40d0('0x4c')]['id']},'attributes':[_0x40d0('0x2d'),_0x40d0('0x4f'),_0x40d0('0x50')],'raw':!![]})['then'](handleEntityNotFound(_0x28b262,null))['then'](function(_0x28db08){if(_0x28db08){if(!fs[_0x40d0('0x51')](path[_0x40d0('0x52')](config[_0x40d0('0x53')],'server/files/sounds/converted',_0x28db08[_0x40d0('0x4f')]+'.'+_0x28db08[_0x40d0('0x50')]))){throw new db[(_0x40d0('0x54'))][(_0x40d0('0x55'))](_0x40d0('0x56'));}return _0x28b262[_0x40d0('0x4e')](path[_0x40d0('0x52')](config[_0x40d0('0x53')],_0x40d0('0x57'),util[_0x40d0('0x58')](_0x40d0('0x59'),_0x28db08[_0x40d0('0x4f')],_0x28db08[_0x40d0('0x50')])),util[_0x40d0('0x58')](_0x40d0('0x59'),_0x28db08['name'],_0x28db08[_0x40d0('0x50')]));}return null;})['catch'](handleError(_0x28b262,null));};exports[_0x40d0('0x5a')]=function(_0x13b17c,_0x1a58aa,_0x53772b){var _0x595e23={'name':path[_0x40d0('0x5b')](_0x13b17c[_0x40d0('0x5c')]['originalname'],path['extname'](_0x13b17c[_0x40d0('0x5c')][_0x40d0('0x5d')])),'save_name':path[_0x40d0('0x5b')](_0x13b17c['file'][_0x40d0('0x5e')],path[_0x40d0('0x5f')](_0x13b17c[_0x40d0('0x5c')][_0x40d0('0x5e')])),'original_format':path[_0x40d0('0x5f')](_0x13b17c[_0x40d0('0x5c')][_0x40d0('0x5d')])['substring'](0x1),'converted_format':_0x40d0('0x60')};var _0x5a50b6=path[_0x40d0('0x52')](config['root'],'server/files/sounds/original',_0x13b17c[_0x40d0('0x5c')]['filename']);var _0x2d7d73=path[_0x40d0('0x52')](config[_0x40d0('0x53')],_0x40d0('0x57'),util[_0x40d0('0x58')]('%s.%s',path[_0x40d0('0x5b')](_0x13b17c[_0x40d0('0x5c')][_0x40d0('0x5e')],path[_0x40d0('0x5f')](_0x13b17c['file'][_0x40d0('0x5e')])),_0x595e23[_0x40d0('0x50')]));logger[_0x40d0('0x61')](_0x40d0('0x62'),_0x5a50b6);logger['info'](_0x40d0('0x63'),_0x2d7d73);try{fs[_0x40d0('0x64')](_0x5a50b6,parseInt(_0x40d0('0x65'),0x8));var _0x95b254=sox[_0x40d0('0x66')](_0x5a50b6,_0x2d7d73,{'sampleRate':0x1f40,'format':_0x40d0('0x60'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x95b254['on']('error',function(_0x41bf31){fs[_0x40d0('0x67')](_0x5a50b6);_0x1a58aa['status'](0x1f4)[_0x40d0('0x2e')](_0x41bf31);});_0x95b254['on'](_0x40d0('0x68'),function(_0x1840b){_0x595e23[_0x40d0('0x69')]=isNaN(_0x1840b[_0x40d0('0x6a')])?null:_0x1840b[_0x40d0('0x6a')]*0x3e8;_0x595e23[_0x40d0('0x6b')]=isNaN(_0x1840b[_0x40d0('0x6c')])?null:_0x1840b[_0x40d0('0x6c')];_0x595e23[_0x40d0('0x6d')]=isNaN(_0x1840b[_0x40d0('0x6e')])?null:_0x1840b[_0x40d0('0x6e')];_0x595e23[_0x40d0('0x6f')]=isNaN(_0x1840b[_0x40d0('0x70')])?null:_0x1840b['bitRate'];_0x595e23[_0x40d0('0x71')]=isNaN(_0x1840b['sampleRate'])?null:_0x1840b[_0x40d0('0x72')];});_0x95b254['on'](_0x40d0('0x73'),function(_0x3e3c16){_0x595e23[_0x40d0('0x74')]=isNaN(_0x3e3c16['duration'])?null:_0x3e3c16['duration']*0x3e8;_0x595e23[_0x40d0('0x75')]=isNaN(_0x3e3c16[_0x40d0('0x6c')])?null:_0x3e3c16['sampleCount'];_0x595e23[_0x40d0('0x76')]=isNaN(_0x3e3c16['channelCount'])?null:_0x3e3c16[_0x40d0('0x6e')];_0x595e23[_0x40d0('0x77')]=isNaN(_0x3e3c16[_0x40d0('0x70')])?null:_0x3e3c16['bitRate'];_0x595e23[_0x40d0('0x78')]=isNaN(_0x3e3c16[_0x40d0('0x72')])?null:_0x3e3c16[_0x40d0('0x72')];});_0x95b254['on'](_0x40d0('0x1b'),function(){fs[_0x40d0('0x64')](_0x2d7d73,parseInt(_0x40d0('0x65'),0x8));return db[_0x40d0('0x30')][_0x40d0('0x5a')](_0x595e23)[_0x40d0('0x25')](function(_0x2ddef4){var _0x63e81d={'role':_0x13b17c[_0x40d0('0x79')][_0x40d0('0x7a')],'userProfileId':_0x13b17c[_0x40d0('0x79')]['userProfileId']};if(!_0x63e81d)throw new Error(_0x40d0('0x7b'));if(_0x63e81d['role']===_0x40d0('0x7c')){var _0x266044=_0x2ddef4[_0x40d0('0x27')]({'plain':!![]});return db[_0x40d0('0x7d')][_0x40d0('0x4d')]({'where':{'name':_0x40d0('0x28'),'userProfileId':_0x63e81d[_0x40d0('0x7e')]},'raw':!![]})[_0x40d0('0x25')](function(_0x2cc294){if(_0x2cc294&&_0x2cc294['autoAssociation']===0x0){return db['UserProfileResource'][_0x40d0('0x5a')]({'name':_0x266044[_0x40d0('0x2d')],'resourceId':_0x266044['id'],'type':_0x2cc294[_0x40d0('0x2d')],'sectionId':_0x2cc294['id']},{})[_0x40d0('0x25')](function(){return _0x2ddef4;});}else{return _0x2ddef4;}})['catch'](function(_0x199df4){logger[_0x40d0('0x2b')](_0x40d0('0x7f'),_0x199df4);throw _0x199df4;});}return _0x2ddef4;})['then'](respondWithResult(_0x1a58aa,null))[_0x40d0('0x80')](handleError(_0x1a58aa,null));});_0x95b254[_0x40d0('0x81')]();}catch(_0x1f16b5){_0x1a58aa[_0x40d0('0x1c')](0x1f4)[_0x40d0('0x2e')](_0x1f16b5);}};exports[_0x40d0('0x82')]=function(_0x3ec99a,_0x543322,_0x332a0d){return db[_0x40d0('0x30')][_0x40d0('0x4d')]({'where':{'id':_0x3ec99a[_0x40d0('0x4c')]['id']}})[_0x40d0('0x25')](handleEntityNotFound(_0x543322,null))[_0x40d0('0x25')](saveUpdates(_['pick'](_0x3ec99a[_0x40d0('0x79')],[_0x40d0('0x2d'),_0x40d0('0x83')]),null))[_0x40d0('0x25')](respondWithResult(_0x543322,null))[_0x40d0('0x80')](handleError(_0x543322,null));};exports['delete']=function(_0x17b938,_0x1bca9a,_0x2eb705){return db[_0x40d0('0x30')][_0x40d0('0x4d')]({'where':{'id':_0x17b938[_0x40d0('0x4c')]['id']}})[_0x40d0('0x25')](function(_0x5c627c){if(_0x5c627c){return _0x5c627c['destroy']();}})[_0x40d0('0x25')](function(_0x43d623){var _0x4c2f4b=path[_0x40d0('0x52')](config[_0x40d0('0x53')],'server/files/sounds/original',util[_0x40d0('0x58')](_0x40d0('0x59'),_0x43d623[_0x40d0('0x4f')],_0x43d623[_0x40d0('0x84')]));var _0x4bd94b=path['join'](config[_0x40d0('0x53')],_0x40d0('0x57'),util[_0x40d0('0x58')]('%s.%s',_0x43d623[_0x40d0('0x4f')],_0x43d623['converted_format']));fs[_0x40d0('0x67')](_0x4c2f4b);fs[_0x40d0('0x67')](_0x4bd94b);return _0x43d623;})[_0x40d0('0x25')](function(_0x4e8540){if(_0x4e8540){return _0x1bca9a['status'](0xcc)['end']();}})[_0x40d0('0x25')](handleEntityNotFound(_0x1bca9a,null))['catch'](handleError(_0x1bca9a,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index 6c3c588..40acc9b 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 _0x51af=['../../config/environment','./sound.attributes','exports','define','lodash','util','../../config/logger','moment','bluebird','rimraf'];(function(_0x53a1ba,_0x17136b){var _0xf7e6cb=function(_0x50d7be){while(--_0x50d7be){_0x53a1ba['push'](_0x53a1ba['shift']());}};_0xf7e6cb(++_0x17136b);}(_0x51af,0xf4));var _0xf51a=function(_0x4ff09b,_0x53f67d){_0x4ff09b=_0x4ff09b-0x0;var _0x3f5c2e=_0x51af[_0x4ff09b];return _0x3f5c2e;};'use strict';var _=require(_0xf51a('0x0'));var util=require(_0xf51a('0x1'));var logger=require(_0xf51a('0x2'))('api');var moment=require(_0xf51a('0x3'));var BPromise=require(_0xf51a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xf51a('0x5'));var config=require(_0xf51a('0x6'));var attributes=require(_0xf51a('0x7'));module[_0xf51a('0x8')]=function(_0xc66017,_0x999f3a){return _0xc66017[_0xf51a('0x9')]('Sound',attributes,{'tableName':'tools_sounds','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfc46=['lodash','../../config/logger','moment','bluebird','path','../../config/environment','./sound.attributes','exports','define','Sound'];(function(_0x288f5e,_0x205edd){var _0x476cc9=function(_0x796f53){while(--_0x796f53){_0x288f5e['push'](_0x288f5e['shift']());}};_0x476cc9(++_0x205edd);}(_0xfc46,0x78));var _0x6fc4=function(_0x263a2f,_0x1e81e3){_0x263a2f=_0x263a2f-0x0;var _0x8020e8=_0xfc46[_0x263a2f];return _0x8020e8;};'use strict';var _=require(_0x6fc4('0x0'));var util=require('util');var logger=require(_0x6fc4('0x1'))('api');var moment=require(_0x6fc4('0x2'));var BPromise=require(_0x6fc4('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6fc4('0x4'));var rimraf=require('rimraf');var config=require(_0x6fc4('0x5'));var attributes=require(_0x6fc4('0x6'));module[_0x6fc4('0x7')]=function(_0x3b1940,_0x58910f){return _0x3b1940[_0x6fc4('0x8')](_0x6fc4('0x9'),attributes,{'tableName':'tools_sounds','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/sound/sound.rpc.js b/server/api/sound/sound.rpc.js index 9955236..9c10459 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 _0x1ad7=['Sound','find','options','raw','where','include','map','model','attributes','then','debug','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','Sound,\x20%s,\x20%s','Sound,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','ShowSound'];(function(_0x141bd8,_0xde2cfa){var _0x343827=function(_0x3fbed9){while(--_0x3fbed9){_0x141bd8['push'](_0x141bd8['shift']());}};_0x343827(++_0xde2cfa);}(_0x1ad7,0x16b));var _0x71ad=function(_0x5c619e,_0x1bccdf){_0x5c619e=_0x5c619e-0x0;var _0x445cf8=_0x1ad7[_0x5c619e];return _0x445cf8;};'use strict';var _=require('lodash');var util=require(_0x71ad('0x0'));var moment=require(_0x71ad('0x1'));var BPromise=require(_0x71ad('0x2'));var rs=require(_0x71ad('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x71ad('0x4'));var logger=require(_0x71ad('0x5'))(_0x71ad('0x6'));var config=require(_0x71ad('0x7'));var jayson=require(_0x71ad('0x8'));var client=jayson['client'][_0x71ad('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x432e49,_0x331cb2,_0xe7327f){return new BPromise(function(_0x551f96,_0x4bb973){return client[_0x71ad('0xa')](_0x432e49,_0xe7327f)['then'](function(_0x416863){logger[_0x71ad('0xb')](_0x71ad('0xc'),_0x331cb2,'request\x20sent');logger['debug'](_0x71ad('0xd'),_0x331cb2,_0x71ad('0xe'),JSON[_0x71ad('0xf')](_0x416863));if(_0x416863[_0x71ad('0x10')]){if(_0x416863['error']['code']===0x1f4){logger[_0x71ad('0x10')]('Sound,\x20%s,\x20%s',_0x331cb2,_0x416863[_0x71ad('0x10')][_0x71ad('0x11')]);return _0x4bb973(_0x416863['error'][_0x71ad('0x11')]);}logger[_0x71ad('0x10')](_0x71ad('0xc'),_0x331cb2,_0x416863['error'][_0x71ad('0x11')]);return _0x551f96(_0x416863[_0x71ad('0x10')][_0x71ad('0x11')]);}else{logger[_0x71ad('0xb')](_0x71ad('0xc'),_0x331cb2,_0x71ad('0xe'));_0x551f96(_0x416863[_0x71ad('0x12')][_0x71ad('0x11')]);}})[_0x71ad('0x13')](function(_0x10cc9d){logger[_0x71ad('0x10')]('Sound,\x20%s,\x20%s',_0x331cb2,_0x10cc9d);_0x4bb973(_0x10cc9d);});});}exports[_0x71ad('0x14')]=function(_0x3e6be8){var _0x26ddde=this;return new Promise(function(_0x59898d,_0x4daef6){return db[_0x71ad('0x15')][_0x71ad('0x16')]({'raw':_0x3e6be8['options']?_0x3e6be8[_0x71ad('0x17')][_0x71ad('0x18')]===undefined?!![]:![]:!![],'where':_0x3e6be8['options']?_0x3e6be8['options'][_0x71ad('0x19')]||null:null,'attributes':_0x3e6be8[_0x71ad('0x17')]?_0x3e6be8['options']['attributes']||null:null,'include':_0x3e6be8[_0x71ad('0x17')]?_0x3e6be8[_0x71ad('0x17')][_0x71ad('0x1a')]?_[_0x71ad('0x1b')](_0x3e6be8['options'][_0x71ad('0x1a')],function(_0xb523e0){return{'model':db[_0xb523e0[_0x71ad('0x1c')]],'as':_0xb523e0['as'],'attributes':_0xb523e0[_0x71ad('0x1d')],'include':_0xb523e0[_0x71ad('0x1a')]?_[_0x71ad('0x1b')](_0xb523e0[_0x71ad('0x1a')],function(_0x4150b2){return{'model':db[_0x4150b2[_0x71ad('0x1c')]],'as':_0x4150b2['as'],'attributes':_0x4150b2[_0x71ad('0x1d')],'include':_0x4150b2[_0x71ad('0x1a')]?_[_0x71ad('0x1b')](_0x4150b2['include'],function(_0x33ea1f){return{'model':db[_0x33ea1f[_0x71ad('0x1c')]],'as':_0x33ea1f['as'],'attributes':_0x33ea1f[_0x71ad('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x71ad('0x1e')](function(_0x22c83e){logger['info'](_0x71ad('0x14'),_0x3e6be8);logger[_0x71ad('0x1f')](_0x71ad('0x14'),_0x3e6be8,JSON[_0x71ad('0xf')](_0x22c83e));_0x59898d(_0x22c83e);})['catch'](function(_0x340704){logger[_0x71ad('0x10')](_0x71ad('0x14'),_0x340704[_0x71ad('0x11')],_0x3e6be8);_0x4daef6(_0x26ddde[_0x71ad('0x10')](0x1f4,_0x340704[_0x71ad('0x11')]));});});}; \ No newline at end of file +var _0x86e1=['stringify','error','code','message','result','catch','ShowSound','Sound','options','where','attributes','map','include','model','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','Sound,\x20%s,\x20%s','debug','Sound,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x28fe57,_0x1702bb){var _0x543e71=function(_0x22034a){while(--_0x22034a){_0x28fe57['push'](_0x28fe57['shift']());}};_0x543e71(++_0x1702bb);}(_0x86e1,0xee));var _0x186e=function(_0xe80f7e,_0x1d1ad5){_0xe80f7e=_0xe80f7e-0x0;var _0x54d253=_0x86e1[_0xe80f7e];return _0x54d253;};'use strict';var _=require(_0x186e('0x0'));var util=require(_0x186e('0x1'));var moment=require(_0x186e('0x2'));var BPromise=require(_0x186e('0x3'));var rs=require(_0x186e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x186e('0x5'))['db'];var utils=require(_0x186e('0x6'));var logger=require('../../config/logger')(_0x186e('0x7'));var config=require(_0x186e('0x8'));var jayson=require(_0x186e('0x9'));var client=jayson[_0x186e('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2db6e6,_0x4d1c4a,_0xec4a15){return new BPromise(function(_0xe8f6df,_0x1d0e21){return client[_0x186e('0xb')](_0x2db6e6,_0xec4a15)[_0x186e('0xc')](function(_0x2c1c88){logger[_0x186e('0xd')](_0x186e('0xe'),_0x4d1c4a,'request\x20sent');logger[_0x186e('0xf')](_0x186e('0x10'),_0x4d1c4a,_0x186e('0x11'),JSON[_0x186e('0x12')](_0x2c1c88));if(_0x2c1c88['error']){if(_0x2c1c88[_0x186e('0x13')][_0x186e('0x14')]===0x1f4){logger[_0x186e('0x13')](_0x186e('0xe'),_0x4d1c4a,_0x2c1c88[_0x186e('0x13')]['message']);return _0x1d0e21(_0x2c1c88[_0x186e('0x13')][_0x186e('0x15')]);}logger[_0x186e('0x13')]('Sound,\x20%s,\x20%s',_0x4d1c4a,_0x2c1c88[_0x186e('0x13')][_0x186e('0x15')]);return _0xe8f6df(_0x2c1c88[_0x186e('0x13')][_0x186e('0x15')]);}else{logger[_0x186e('0xd')](_0x186e('0xe'),_0x4d1c4a,_0x186e('0x11'));_0xe8f6df(_0x2c1c88[_0x186e('0x16')][_0x186e('0x15')]);}})[_0x186e('0x17')](function(_0x57bba1){logger[_0x186e('0x13')](_0x186e('0xe'),_0x4d1c4a,_0x57bba1);_0x1d0e21(_0x57bba1);});});}exports[_0x186e('0x18')]=function(_0x509fe6){var _0x30e6bf=this;return new Promise(function(_0x55b3ee,_0x3a5117){return db[_0x186e('0x19')]['find']({'raw':_0x509fe6[_0x186e('0x1a')]?_0x509fe6['options']['raw']===undefined?!![]:![]:!![],'where':_0x509fe6['options']?_0x509fe6[_0x186e('0x1a')][_0x186e('0x1b')]||null:null,'attributes':_0x509fe6[_0x186e('0x1a')]?_0x509fe6[_0x186e('0x1a')][_0x186e('0x1c')]||null:null,'include':_0x509fe6[_0x186e('0x1a')]?_0x509fe6[_0x186e('0x1a')]['include']?_[_0x186e('0x1d')](_0x509fe6['options'][_0x186e('0x1e')],function(_0x430703){return{'model':db[_0x430703[_0x186e('0x1f')]],'as':_0x430703['as'],'attributes':_0x430703[_0x186e('0x1c')],'include':_0x430703[_0x186e('0x1e')]?_['map'](_0x430703[_0x186e('0x1e')],function(_0x17144f){return{'model':db[_0x17144f[_0x186e('0x1f')]],'as':_0x17144f['as'],'attributes':_0x17144f['attributes'],'include':_0x17144f[_0x186e('0x1e')]?_['map'](_0x17144f[_0x186e('0x1e')],function(_0x486b6a){return{'model':db[_0x486b6a[_0x186e('0x1f')]],'as':_0x486b6a['as'],'attributes':_0x486b6a['attributes']};}):[]};}):[]};}):[]:[]})[_0x186e('0xc')](function(_0x2371b4){logger[_0x186e('0xd')]('ShowSound',_0x509fe6);logger['debug'](_0x186e('0x18'),_0x509fe6,JSON['stringify'](_0x2371b4));_0x55b3ee(_0x2371b4);})['catch'](function(_0x11bc93){logger[_0x186e('0x13')](_0x186e('0x18'),_0x11bc93[_0x186e('0x15')],_0x509fe6);_0x3a5117(_0x30e6bf[_0x186e('0x13')](0x1f4,_0x11bc93['message']));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index e6989ce..77487e5 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 _0xb7e7=['exports','multer','path','express','fs-extra','../../components/interaction/service','../../config/environment','./squareMessage.controller','index','get','/:id','show','post','isAuthenticated','create','put','delete','destroy'];(function(_0x306409,_0x2971a5){var _0x1712bc=function(_0x368efc){while(--_0x368efc){_0x306409['push'](_0x306409['shift']());}};_0x1712bc(++_0x2971a5);}(_0xb7e7,0x121));var _0x7b7e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xb7e7[_0x20a584];return _0x4b41a8;};'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('0xb')]('/',auth[_0x7b7e('0xc')](),controller[_0x7b7e('0xd')]);router[_0x7b7e('0xe')](_0x7b7e('0x9'),auth[_0x7b7e('0xc')](),controller['update']);router[_0x7b7e('0xf')](_0x7b7e('0x9'),auth[_0x7b7e('0xc')](),controller[_0x7b7e('0x10')]);module[_0x7b7e('0x11')]=router; \ No newline at end of file +var _0xda3f=['../../config/environment','get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports','util','path','fs-extra','../../components/interaction/service'];(function(_0x2fa157,_0x5376b){var _0x3c0392=function(_0x4af424){while(--_0x4af424){_0x2fa157['push'](_0x2fa157['shift']());}};_0x3c0392(++_0x5376b);}(_0xda3f,0xec));var _0xfda3=function(_0x2690b7,_0x178d3e){_0x2690b7=_0x2690b7-0x0;var _0x333c4c=_0xda3f[_0x2690b7];return _0x333c4c;};'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('./squareMessage.controller');router[_0xfda3('0x5')]('/',auth[_0xfda3('0x6')](),controller['index']);router['get'](_0xfda3('0x7'),auth[_0xfda3('0x6')](),controller[_0xfda3('0x8')]);router[_0xfda3('0x9')]('/',auth[_0xfda3('0x6')](),controller[_0xfda3('0xa')]);router[_0xfda3('0xb')](_0xfda3('0x7'),auth[_0xfda3('0x6')](),controller[_0xfda3('0xc')]);router[_0xfda3('0xd')](_0xfda3('0x7'),auth['isAuthenticated'](),controller[_0xfda3('0xe')]);module[_0xfda3('0xf')]=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index a906ce0..e8a4ed3 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 _0xc779=['sequelize','exports','TEXT','medium','ENUM','out'];(function(_0x45161c,_0x5494fc){var _0x186581=function(_0x78fada){while(--_0x78fada){_0x45161c['push'](_0x45161c['shift']());}};_0x186581(++_0x5494fc);}(_0xc779,0xde));var _0x9c77=function(_0x176167,_0x5d0d05){_0x176167=_0x176167-0x0;var _0x987919=_0xc779[_0x176167];return _0x987919;};'use strict';var Sequelize=require(_0x9c77('0x0'));module[_0x9c77('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'body':{'type':Sequelize[_0x9c77('0x2')](_0x9c77('0x3')),'allowNull':![]},'direction':{'type':Sequelize[_0x9c77('0x4')]('in',_0x9c77('0x5')),'defaultValue':_0x9c77('0x5'),'allowNull':![]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x4a66=['TEXT','sequelize','exports','medium','out','STRING'];(function(_0x102ff9,_0x907658){var _0x24fa97=function(_0x3622ff){while(--_0x3622ff){_0x102ff9['push'](_0x102ff9['shift']());}};_0x24fa97(++_0x907658);}(_0x4a66,0xf7));var _0x64a6=function(_0x337748,_0x402b05){_0x337748=_0x337748-0x0;var _0x3bb03f=_0x4a66[_0x337748];return _0x3bb03f;};'use strict';var Sequelize=require(_0x64a6('0x0'));module[_0x64a6('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'body':{'type':Sequelize['TEXT'](_0x64a6('0x2')),'allowNull':![]},'direction':{'type':Sequelize['ENUM']('in',_0x64a6('0x3')),'defaultValue':'out','allowNull':![]},'providerName':{'type':Sequelize[_0x64a6('0x4')]},'providerResponse':{'type':Sequelize[_0x64a6('0x5')]}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index 2eda417..1c8ec48 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 _0xa6f8=['eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','status','json','undefined','count','offset','limit','set','apply','reject','save','update','then','end','sendStatus','error','stack','name','send','index','map','SquareMessage','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','includeAll','findAll','catch','show','params','include','find','create','body','destroy'];(function(_0x7a84f2,_0x1e1e67){var _0x2822f0=function(_0x5eac00){while(--_0x5eac00){_0x7a84f2['push'](_0x7a84f2['shift']());}};_0x2822f0(++_0x1e1e67);}(_0xa6f8,0x94));var _0x8a6f=function(_0x1b3f52,_0x4f5b13){_0x1b3f52=_0x1b3f52-0x0;var _0x36bf2c=_0xa6f8[_0x1b3f52];return _0x36bf2c;};'use strict';var emlformat=require(_0x8a6f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8a6f('0x1'));var jsonpatch=require(_0x8a6f('0x2'));var rp=require(_0x8a6f('0x3'));var moment=require(_0x8a6f('0x4'));var BPromise=require(_0x8a6f('0x5'));var Mustache=require(_0x8a6f('0x6'));var util=require(_0x8a6f('0x7'));var path=require(_0x8a6f('0x8'));var sox=require(_0x8a6f('0x9'));var csv=require('to-csv');var ejs=require(_0x8a6f('0xa'));var fs=require('fs');var fs_extra=require(_0x8a6f('0xb'));var _=require(_0x8a6f('0xc'));var squel=require('squel');var crypto=require(_0x8a6f('0xd'));var jsforce=require(_0x8a6f('0xe'));var deskjs=require(_0x8a6f('0xf'));var toCsv=require(_0x8a6f('0x10'));var querystring=require(_0x8a6f('0x11'));var Papa=require(_0x8a6f('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x8a6f('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8a6f('0x14'))('api');var utils=require(_0x8a6f('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x8a6f('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x140c65,_0x1fff9f){_0x1fff9f=_0x1fff9f||0xcc;return function(_0x2c40db){if(_0x2c40db){return _0x140c65['sendStatus'](_0x1fff9f);}return _0x140c65[_0x8a6f('0x17')](_0x1fff9f)['end']();};}function respondWithResult(_0x5568c4,_0x3e1c07){_0x3e1c07=_0x3e1c07||0xc8;return function(_0x5aacc9){if(_0x5aacc9){return _0x5568c4[_0x8a6f('0x17')](_0x3e1c07)[_0x8a6f('0x18')](_0x5aacc9);}};}function respondWithFilteredResult(_0x478c3a,_0x2fde81){return function(_0x8418d){if(_0x8418d){var _0x496a5f=typeof _0x2fde81['offset']==='undefined'&&typeof _0x2fde81['limit']===_0x8a6f('0x19');var _0x4cd281=_0x8418d[_0x8a6f('0x1a')];var _0x3f7760=_0x496a5f?0x0:_0x2fde81[_0x8a6f('0x1b')];var _0x4ec3fb=_0x496a5f?_0x8418d[_0x8a6f('0x1a')]:_0x2fde81[_0x8a6f('0x1b')]+_0x2fde81[_0x8a6f('0x1c')];var _0x28e9df;if(_0x4ec3fb>=_0x4cd281){_0x4ec3fb=_0x4cd281;_0x28e9df=0xc8;}else{_0x28e9df=0xce;}_0x478c3a[_0x8a6f('0x17')](_0x28e9df);return _0x478c3a[_0x8a6f('0x1d')]('Content-Range',_0x3f7760+'-'+_0x4ec3fb+'/'+_0x4cd281)['json'](_0x8418d);}return null;};}function patchUpdates(_0x3fad42){return function(_0x4b453a){try{jsonpatch[_0x8a6f('0x1e')](_0x4b453a,_0x3fad42,!![]);}catch(_0xe08190){return BPromise[_0x8a6f('0x1f')](_0xe08190);}return _0x4b453a[_0x8a6f('0x20')]();};}function saveUpdates(_0x3f6f5c,_0x189c35){return function(_0x4a380a){if(_0x4a380a){return _0x4a380a[_0x8a6f('0x21')](_0x3f6f5c)[_0x8a6f('0x22')](function(_0x1ae4c4){return _0x1ae4c4;});}return null;};}function removeEntity(_0x1b943b,_0xf124b2){return function(_0x15cebe){if(_0x15cebe){return _0x15cebe['destroy']()[_0x8a6f('0x22')](function(){_0x1b943b[_0x8a6f('0x17')](0xcc)[_0x8a6f('0x23')]();});}};}function handleEntityNotFound(_0x245007,_0x1f2607){return function(_0x4266e0){if(!_0x4266e0){_0x245007[_0x8a6f('0x24')](0x194);}return _0x4266e0;};}function handleError(_0x33fa2e,_0x4d11c6){_0x4d11c6=_0x4d11c6||0x1f4;return function(_0x3ac959){logger[_0x8a6f('0x25')](_0x3ac959[_0x8a6f('0x26')]);if(_0x3ac959['name']){delete _0x3ac959[_0x8a6f('0x27')];}_0x33fa2e[_0x8a6f('0x17')](_0x4d11c6)[_0x8a6f('0x28')](_0x3ac959);};}exports[_0x8a6f('0x29')]=function(_0x104d04,_0x5395ae){var _0x5e42fc={},_0x5b87b4={},_0x37c966={'count':0x0,'rows':[]};var _0x2cc465=_[_0x8a6f('0x2a')](db[_0x8a6f('0x2b')][_0x8a6f('0x2c')],function(_0x27a35b){return{'name':_0x27a35b[_0x8a6f('0x2d')],'type':_0x27a35b[_0x8a6f('0x2e')]['key']};});_0x5b87b4[_0x8a6f('0x2f')]=_[_0x8a6f('0x2a')](_0x2cc465,_0x8a6f('0x27'));_0x5b87b4[_0x8a6f('0x30')]=_[_0x8a6f('0x31')](_0x104d04[_0x8a6f('0x30')]);_0x5b87b4[_0x8a6f('0x32')]=_[_0x8a6f('0x33')](_0x5b87b4[_0x8a6f('0x2f')],_0x5b87b4[_0x8a6f('0x30')]);_0x5e42fc[_0x8a6f('0x34')]=_[_0x8a6f('0x33')](_0x5b87b4['model'],qs[_0x8a6f('0x35')](_0x104d04[_0x8a6f('0x30')][_0x8a6f('0x35')]));_0x5e42fc[_0x8a6f('0x34')]=_0x5e42fc[_0x8a6f('0x34')][_0x8a6f('0x36')]?_0x5e42fc[_0x8a6f('0x34')]:_0x5b87b4[_0x8a6f('0x2f')];if(!_0x104d04[_0x8a6f('0x30')][_0x8a6f('0x37')](_0x8a6f('0x38'))){_0x5e42fc['limit']=qs[_0x8a6f('0x1c')](_0x104d04[_0x8a6f('0x30')]['limit']);_0x5e42fc[_0x8a6f('0x1b')]=qs[_0x8a6f('0x1b')](_0x104d04['query'][_0x8a6f('0x1b')]);}_0x5e42fc[_0x8a6f('0x39')]=qs[_0x8a6f('0x3a')](_0x104d04['query'][_0x8a6f('0x3a')]);_0x5e42fc[_0x8a6f('0x3b')]=qs['filters'](_[_0x8a6f('0x3c')](_0x104d04[_0x8a6f('0x30')],_0x5b87b4[_0x8a6f('0x32')]),_0x2cc465);if(_0x104d04[_0x8a6f('0x30')]['filter']){_0x5e42fc[_0x8a6f('0x3b')]=_[_0x8a6f('0x3d')](_0x5e42fc[_0x8a6f('0x3b')],{'$or':_[_0x8a6f('0x2a')](_0x2cc465,function(_0x21cdee){if(_0x21cdee[_0x8a6f('0x2e')]!==_0x8a6f('0x3e')){var _0x1b1942={};_0x1b1942[_0x21cdee[_0x8a6f('0x27')]]={'$like':'%'+_0x104d04[_0x8a6f('0x30')]['filter']+'%'};return _0x1b1942;}})});}_0x5e42fc=_[_0x8a6f('0x3d')]({},_0x5e42fc,_0x104d04[_0x8a6f('0x3f')]);var _0x180f9b={'where':_0x5e42fc[_0x8a6f('0x3b')]};return db[_0x8a6f('0x2b')][_0x8a6f('0x1a')](_0x180f9b)['then'](function(_0x327993){_0x37c966[_0x8a6f('0x1a')]=_0x327993;if(_0x104d04[_0x8a6f('0x30')][_0x8a6f('0x40')]){_0x5e42fc['include']=[{'all':!![]}];}return db['SquareMessage'][_0x8a6f('0x41')](_0x5e42fc);})[_0x8a6f('0x22')](function(_0x1d696d){_0x37c966['rows']=_0x1d696d;return _0x37c966;})[_0x8a6f('0x22')](respondWithFilteredResult(_0x5395ae,_0x5e42fc))[_0x8a6f('0x42')](handleError(_0x5395ae,null));};exports[_0x8a6f('0x43')]=function(_0x129d73,_0x49d28e){var _0x3f92f6={'raw':!![],'where':{'id':_0x129d73[_0x8a6f('0x44')]['id']}},_0xabf44a={};_0xabf44a['model']=_[_0x8a6f('0x31')](db[_0x8a6f('0x2b')][_0x8a6f('0x2c')]);_0xabf44a['query']=_[_0x8a6f('0x31')](_0x129d73[_0x8a6f('0x30')]);_0xabf44a[_0x8a6f('0x32')]=_[_0x8a6f('0x33')](_0xabf44a[_0x8a6f('0x2f')],_0xabf44a[_0x8a6f('0x30')]);_0x3f92f6[_0x8a6f('0x34')]=_[_0x8a6f('0x33')](_0xabf44a[_0x8a6f('0x2f')],qs[_0x8a6f('0x35')](_0x129d73['query']['fields']));_0x3f92f6[_0x8a6f('0x34')]=_0x3f92f6[_0x8a6f('0x34')]['length']?_0x3f92f6[_0x8a6f('0x34')]:_0xabf44a['model'];if(_0x129d73[_0x8a6f('0x30')]['includeAll']){_0x3f92f6[_0x8a6f('0x45')]=[{'all':!![]}];}_0x3f92f6=_[_0x8a6f('0x3d')]({},_0x3f92f6,_0x129d73[_0x8a6f('0x3f')]);return db[_0x8a6f('0x2b')][_0x8a6f('0x46')](_0x3f92f6)[_0x8a6f('0x22')](handleEntityNotFound(_0x49d28e,null))[_0x8a6f('0x22')](respondWithResult(_0x49d28e,null))['catch'](handleError(_0x49d28e,null));};exports[_0x8a6f('0x47')]=function(_0x208c21,_0x52c655){return db['SquareMessage']['create'](_0x208c21[_0x8a6f('0x48')],{})[_0x8a6f('0x22')](respondWithResult(_0x52c655,0xc9))['catch'](handleError(_0x52c655,null));};exports[_0x8a6f('0x21')]=function(_0x576e31,_0x39507c){if(_0x576e31[_0x8a6f('0x48')]['id']){delete _0x576e31[_0x8a6f('0x48')]['id'];}return db[_0x8a6f('0x2b')]['find']({'where':{'id':_0x576e31[_0x8a6f('0x44')]['id']}})[_0x8a6f('0x22')](handleEntityNotFound(_0x39507c,null))[_0x8a6f('0x22')](saveUpdates(_0x576e31[_0x8a6f('0x48')],null))['then'](respondWithResult(_0x39507c,null))[_0x8a6f('0x42')](handleError(_0x39507c,null));};exports[_0x8a6f('0x49')]=function(_0x5c9848,_0x23cc12){return db['SquareMessage'][_0x8a6f('0x46')]({'where':{'id':_0x5c9848[_0x8a6f('0x44')]['id']}})[_0x8a6f('0x22')](handleEntityNotFound(_0x23cc12,null))[_0x8a6f('0x22')](removeEntity(_0x23cc12,null))[_0x8a6f('0x42')](handleError(_0x23cc12,null));}; \ No newline at end of file +var _0xb22c=['map','SquareMessage','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','sort','where','filters','filter','merge','VIRTUAL','then','includeAll','include','findAll','rows','catch','params','keys','find','create','body','update','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','destroy','error','name','send','index'];(function(_0xa8a85b,_0x410076){var _0x4266bc=function(_0x3a321f){while(--_0x3a321f){_0xa8a85b['push'](_0xa8a85b['shift']());}};_0x4266bc(++_0x410076);}(_0xb22c,0x66));var _0xcb22=function(_0x4e3013,_0x3c7b90){_0x4e3013=_0x4e3013-0x0;var _0x17ddbd=_0xb22c[_0x4e3013];return _0x17ddbd;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xcb22('0x0'));var zipdir=require(_0xcb22('0x1'));var jsonpatch=require(_0xcb22('0x2'));var rp=require(_0xcb22('0x3'));var moment=require(_0xcb22('0x4'));var BPromise=require(_0xcb22('0x5'));var Mustache=require(_0xcb22('0x6'));var util=require(_0xcb22('0x7'));var path=require(_0xcb22('0x8'));var sox=require('sox');var csv=require(_0xcb22('0x9'));var ejs=require(_0xcb22('0xa'));var fs=require('fs');var fs_extra=require(_0xcb22('0xb'));var _=require(_0xcb22('0xc'));var squel=require(_0xcb22('0xd'));var crypto=require('crypto');var jsforce=require(_0xcb22('0xe'));var deskjs=require(_0xcb22('0xf'));var toCsv=require('to-csv');var querystring=require(_0xcb22('0x10'));var Papa=require('papaparse');var Redis=require(_0xcb22('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xcb22('0x12'));var as=require(_0xcb22('0x13'));var hardwareService=require(_0xcb22('0x14'));var logger=require(_0xcb22('0x15'))(_0xcb22('0x16'));var utils=require(_0xcb22('0x17'));var config=require(_0xcb22('0x18'));var licenseUtil=require(_0xcb22('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x596005,_0x1442ed){_0x1442ed=_0x1442ed||0xcc;return function(_0x9ae8ac){if(_0x9ae8ac){return _0x596005[_0xcb22('0x1a')](_0x1442ed);}return _0x596005[_0xcb22('0x1b')](_0x1442ed)[_0xcb22('0x1c')]();};}function respondWithResult(_0x60ec3,_0x20ddc4){_0x20ddc4=_0x20ddc4||0xc8;return function(_0x23cb99){if(_0x23cb99){return _0x60ec3[_0xcb22('0x1b')](_0x20ddc4)['json'](_0x23cb99);}};}function respondWithFilteredResult(_0x43e44a,_0x960661){return function(_0x15d617){if(_0x15d617){var _0x28f9e5=typeof _0x960661[_0xcb22('0x1d')]===_0xcb22('0x1e')&&typeof _0x960661[_0xcb22('0x1f')]==='undefined';var _0x2a8b74=_0x15d617['count'];var _0x32e07d=_0x28f9e5?0x0:_0x960661[_0xcb22('0x1d')];var _0x1e7f97=_0x28f9e5?_0x15d617[_0xcb22('0x20')]:_0x960661[_0xcb22('0x1d')]+_0x960661[_0xcb22('0x1f')];var _0x22d795;if(_0x1e7f97>=_0x2a8b74){_0x1e7f97=_0x2a8b74;_0x22d795=0xc8;}else{_0x22d795=0xce;}_0x43e44a['status'](_0x22d795);return _0x43e44a[_0xcb22('0x21')](_0xcb22('0x22'),_0x32e07d+'-'+_0x1e7f97+'/'+_0x2a8b74)[_0xcb22('0x23')](_0x15d617);}return null;};}function patchUpdates(_0xc7bbb0){return function(_0x21e0b5){try{jsonpatch['apply'](_0x21e0b5,_0xc7bbb0,!![]);}catch(_0x2b1630){return BPromise[_0xcb22('0x24')](_0x2b1630);}return _0x21e0b5['save']();};}function saveUpdates(_0x6e2e9b,_0x378b09){return function(_0x4fe498){if(_0x4fe498){return _0x4fe498['update'](_0x6e2e9b)['then'](function(_0x4e749b){return _0x4e749b;});}return null;};}function removeEntity(_0x562686,_0x353c85){return function(_0x4f4a37){if(_0x4f4a37){return _0x4f4a37[_0xcb22('0x25')]()['then'](function(){_0x562686['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2256ec,_0x2ee3c0){return function(_0x578b0a){if(!_0x578b0a){_0x2256ec[_0xcb22('0x1a')](0x194);}return _0x578b0a;};}function handleError(_0x5a6b30,_0x16cfb3){_0x16cfb3=_0x16cfb3||0x1f4;return function(_0x30b28c){logger[_0xcb22('0x26')](_0x30b28c['stack']);if(_0x30b28c[_0xcb22('0x27')]){delete _0x30b28c['name'];}_0x5a6b30[_0xcb22('0x1b')](_0x16cfb3)[_0xcb22('0x28')](_0x30b28c);};}exports[_0xcb22('0x29')]=function(_0x1da794,_0x548f90){var _0x12c2d8={},_0x4f7d79={},_0xac928d={'count':0x0,'rows':[]};var _0x2c1997=_[_0xcb22('0x2a')](db[_0xcb22('0x2b')]['rawAttributes'],function(_0x59f8bf){return{'name':_0x59f8bf[_0xcb22('0x2c')],'type':_0x59f8bf[_0xcb22('0x2d')][_0xcb22('0x2e')]};});_0x4f7d79[_0xcb22('0x2f')]=_[_0xcb22('0x2a')](_0x2c1997,_0xcb22('0x27'));_0x4f7d79[_0xcb22('0x30')]=_['keys'](_0x1da794[_0xcb22('0x30')]);_0x4f7d79['filters']=_[_0xcb22('0x31')](_0x4f7d79[_0xcb22('0x2f')],_0x4f7d79[_0xcb22('0x30')]);_0x12c2d8[_0xcb22('0x32')]=_[_0xcb22('0x31')](_0x4f7d79[_0xcb22('0x2f')],qs[_0xcb22('0x33')](_0x1da794[_0xcb22('0x30')][_0xcb22('0x33')]));_0x12c2d8[_0xcb22('0x32')]=_0x12c2d8[_0xcb22('0x32')][_0xcb22('0x34')]?_0x12c2d8[_0xcb22('0x32')]:_0x4f7d79[_0xcb22('0x2f')];if(!_0x1da794[_0xcb22('0x30')][_0xcb22('0x35')]('nolimit')){_0x12c2d8['limit']=qs[_0xcb22('0x1f')](_0x1da794[_0xcb22('0x30')][_0xcb22('0x1f')]);_0x12c2d8[_0xcb22('0x1d')]=qs['offset'](_0x1da794[_0xcb22('0x30')][_0xcb22('0x1d')]);}_0x12c2d8['order']=qs[_0xcb22('0x36')](_0x1da794[_0xcb22('0x30')][_0xcb22('0x36')]);_0x12c2d8[_0xcb22('0x37')]=qs[_0xcb22('0x38')](_['pick'](_0x1da794['query'],_0x4f7d79['filters']),_0x2c1997);if(_0x1da794['query'][_0xcb22('0x39')]){_0x12c2d8[_0xcb22('0x37')]=_[_0xcb22('0x3a')](_0x12c2d8[_0xcb22('0x37')],{'$or':_[_0xcb22('0x2a')](_0x2c1997,function(_0x3ff8ac){if(_0x3ff8ac[_0xcb22('0x2d')]!==_0xcb22('0x3b')){var _0x461d62={};_0x461d62[_0x3ff8ac[_0xcb22('0x27')]]={'$like':'%'+_0x1da794[_0xcb22('0x30')][_0xcb22('0x39')]+'%'};return _0x461d62;}})});}_0x12c2d8=_[_0xcb22('0x3a')]({},_0x12c2d8,_0x1da794['options']);var _0x3c1dd2={'where':_0x12c2d8[_0xcb22('0x37')]};return db['SquareMessage'][_0xcb22('0x20')](_0x3c1dd2)[_0xcb22('0x3c')](function(_0x3e5df3){_0xac928d[_0xcb22('0x20')]=_0x3e5df3;if(_0x1da794[_0xcb22('0x30')][_0xcb22('0x3d')]){_0x12c2d8[_0xcb22('0x3e')]=[{'all':!![]}];}return db[_0xcb22('0x2b')][_0xcb22('0x3f')](_0x12c2d8);})[_0xcb22('0x3c')](function(_0x2b1399){_0xac928d[_0xcb22('0x40')]=_0x2b1399;return _0xac928d;})[_0xcb22('0x3c')](respondWithFilteredResult(_0x548f90,_0x12c2d8))[_0xcb22('0x41')](handleError(_0x548f90,null));};exports['show']=function(_0x58e0c8,_0x500a9e){var _0x5dcd51={'raw':!![],'where':{'id':_0x58e0c8[_0xcb22('0x42')]['id']}},_0x439acf={};_0x439acf['model']=_[_0xcb22('0x43')](db['SquareMessage']['rawAttributes']);_0x439acf[_0xcb22('0x30')]=_['keys'](_0x58e0c8['query']);_0x439acf[_0xcb22('0x38')]=_['intersection'](_0x439acf[_0xcb22('0x2f')],_0x439acf[_0xcb22('0x30')]);_0x5dcd51[_0xcb22('0x32')]=_[_0xcb22('0x31')](_0x439acf[_0xcb22('0x2f')],qs['fields'](_0x58e0c8[_0xcb22('0x30')][_0xcb22('0x33')]));_0x5dcd51['attributes']=_0x5dcd51[_0xcb22('0x32')][_0xcb22('0x34')]?_0x5dcd51[_0xcb22('0x32')]:_0x439acf[_0xcb22('0x2f')];if(_0x58e0c8[_0xcb22('0x30')][_0xcb22('0x3d')]){_0x5dcd51[_0xcb22('0x3e')]=[{'all':!![]}];}_0x5dcd51=_[_0xcb22('0x3a')]({},_0x5dcd51,_0x58e0c8['options']);return db[_0xcb22('0x2b')][_0xcb22('0x44')](_0x5dcd51)[_0xcb22('0x3c')](handleEntityNotFound(_0x500a9e,null))[_0xcb22('0x3c')](respondWithResult(_0x500a9e,null))[_0xcb22('0x41')](handleError(_0x500a9e,null));};exports[_0xcb22('0x45')]=function(_0x18715f,_0x1adfc5){return db['SquareMessage'][_0xcb22('0x45')](_0x18715f[_0xcb22('0x46')],{})[_0xcb22('0x3c')](respondWithResult(_0x1adfc5,0xc9))[_0xcb22('0x41')](handleError(_0x1adfc5,null));};exports[_0xcb22('0x47')]=function(_0x5d5f47,_0x18f792){if(_0x5d5f47[_0xcb22('0x46')]['id']){delete _0x5d5f47[_0xcb22('0x46')]['id'];}return db[_0xcb22('0x2b')][_0xcb22('0x44')]({'where':{'id':_0x5d5f47[_0xcb22('0x42')]['id']}})[_0xcb22('0x3c')](handleEntityNotFound(_0x18f792,null))[_0xcb22('0x3c')](saveUpdates(_0x5d5f47[_0xcb22('0x46')],null))[_0xcb22('0x3c')](respondWithResult(_0x18f792,null))[_0xcb22('0x41')](handleError(_0x18f792,null));};exports['destroy']=function(_0x38e69d,_0x59f814){return db[_0xcb22('0x2b')][_0xcb22('0x44')]({'where':{'id':_0x38e69d[_0xcb22('0x42')]['id']}})[_0xcb22('0x3c')](handleEntityNotFound(_0x59f814,null))[_0xcb22('0x3c')](removeEntity(_0x59f814,null))['catch'](handleError(_0x59f814,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index 42ea48e..82b4229 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 _0xc000=['../../config/environment','./squareMessage.attributes','exports','SquareMessage','lodash','util','api','moment','bluebird','request-promise','rimraf'];(function(_0x397572,_0x23a6d9){var _0x209d0e=function(_0x44aa8d){while(--_0x44aa8d){_0x397572['push'](_0x397572['shift']());}};_0x209d0e(++_0x23a6d9);}(_0xc000,0x185));var _0x0c00=function(_0x3f7eb0,_0x480023){_0x3f7eb0=_0x3f7eb0-0x0;var _0x1e202d=_0xc000[_0x3f7eb0];return _0x1e202d;};'use strict';var _=require(_0x0c00('0x0'));var util=require(_0x0c00('0x1'));var logger=require('../../config/logger')(_0x0c00('0x2'));var moment=require(_0x0c00('0x3'));var BPromise=require(_0x0c00('0x4'));var rp=require(_0x0c00('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0c00('0x6'));var config=require(_0x0c00('0x7'));var attributes=require(_0x0c00('0x8'));module[_0x0c00('0x9')]=function(_0x4036b1,_0x4c0a3d){return _0x4036b1['define'](_0x0c00('0xa'),attributes,{'tableName':'square_messages','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3766=['exports','define','SquareMessage','square_messages','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareMessage.attributes'];(function(_0x511d17,_0x9ad3ba){var _0x4f42e3=function(_0x5cc40f){while(--_0x5cc40f){_0x511d17['push'](_0x511d17['shift']());}};_0x4f42e3(++_0x9ad3ba);}(_0x3766,0x1a8));var _0x6376=function(_0x518d6a,_0x5a0164){_0x518d6a=_0x518d6a-0x0;var _0x58446b=_0x3766[_0x518d6a];return _0x58446b;};'use strict';var _=require(_0x6376('0x0'));var util=require(_0x6376('0x1'));var logger=require('../../config/logger')(_0x6376('0x2'));var moment=require(_0x6376('0x3'));var BPromise=require(_0x6376('0x4'));var rp=require(_0x6376('0x5'));var fs=require('fs');var path=require(_0x6376('0x6'));var rimraf=require(_0x6376('0x7'));var config=require(_0x6376('0x8'));var attributes=require(_0x6376('0x9'));module[_0x6376('0xa')]=function(_0x13f834,_0x2f6576){return _0x13f834[_0x6376('0xb')](_0x6376('0xc'),attributes,{'tableName':_0x6376('0xd'),'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 3b138bd..da25e37 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 _0x9895=['lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateSquareMessage','SquareMessage','body','options','raw','catch'];(function(_0x5ce327,_0x7f17c8){var _0x193098=function(_0x3811f2){while(--_0x3811f2){_0x5ce327['push'](_0x5ce327['shift']());}};_0x193098(++_0x7f17c8);}(_0x9895,0x16c));var _0x5989=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x9895[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0x5989('0x0'));var util=require(_0x5989('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5989('0x2'));var fs=require('fs');var Redis=require(_0x5989('0x3'));var db=require(_0x5989('0x4'))['db'];var utils=require(_0x5989('0x5'));var logger=require(_0x5989('0x6'))('rpc');var config=require(_0x5989('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x5989('0x8')][_0x5989('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5ecc53,_0x90aeb,_0x58ad88){return new BPromise(function(_0x290382,_0x4f9294){return client[_0x5989('0xa')](_0x5ecc53,_0x58ad88)[_0x5989('0xb')](function(_0x465d30){logger[_0x5989('0xc')](_0x5989('0xd'),_0x90aeb,_0x5989('0xe'));logger[_0x5989('0xf')](_0x5989('0x10'),_0x90aeb,'request\x20sent',JSON[_0x5989('0x11')](_0x465d30));if(_0x465d30[_0x5989('0x12')]){if(_0x465d30[_0x5989('0x12')][_0x5989('0x13')]===0x1f4){logger[_0x5989('0x12')](_0x5989('0xd'),_0x90aeb,_0x465d30['error'][_0x5989('0x14')]);return _0x4f9294(_0x465d30[_0x5989('0x12')]['message']);}logger['error']('SquareMessage,\x20%s,\x20%s',_0x90aeb,_0x465d30['error']['message']);return _0x290382(_0x465d30['error'][_0x5989('0x14')]);}else{logger['info']('SquareMessage,\x20%s,\x20%s',_0x90aeb,_0x5989('0xe'));_0x290382(_0x465d30[_0x5989('0x15')][_0x5989('0x14')]);}})['catch'](function(_0x2cd0f0){logger['error']('SquareMessage,\x20%s,\x20%s',_0x90aeb,_0x2cd0f0);_0x4f9294(_0x2cd0f0);});});}exports[_0x5989('0x16')]=function(_0xb00ebc){var _0x59a3ce=this;return new Promise(function(_0x5a7205,_0x5ce4e7){return db[_0x5989('0x17')]['create'](_0xb00ebc[_0x5989('0x18')],{'raw':_0xb00ebc[_0x5989('0x19')]?_0xb00ebc[_0x5989('0x19')][_0x5989('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x1c1f5d){logger[_0x5989('0xc')](_0x5989('0x16'),_0xb00ebc);logger[_0x5989('0xf')](_0x5989('0x16'),_0xb00ebc,JSON[_0x5989('0x11')](_0x1c1f5d));_0x5a7205(_0x1c1f5d);})[_0x5989('0x1b')](function(_0x1b3af6){logger[_0x5989('0x12')](_0x5989('0x16'),_0x1b3af6[_0x5989('0x14')],_0xb00ebc);_0x5ce4e7(_0x59a3ce['error'](0x1f4,_0x1b3af6[_0x5989('0x14')]));});});}; \ No newline at end of file +var _0x69d3=['debug','stringify','error','code','SquareMessage,\x20%s,\x20%s','message','result','catch','CreateSquareMessage','SquareMessage','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','info','request\x20sent'];(function(_0x4bfe5c,_0x218523){var _0x4f2e0a=function(_0x33cb01){while(--_0x33cb01){_0x4bfe5c['push'](_0x4bfe5c['shift']());}};_0x4f2e0a(++_0x218523);}(_0x69d3,0x150));var _0x369d=function(_0x39b087,_0x18b033){_0x39b087=_0x39b087-0x0;var _0x5d91ea=_0x69d3[_0x39b087];return _0x5d91ea;};'use strict';var _=require(_0x369d('0x0'));var util=require(_0x369d('0x1'));var moment=require(_0x369d('0x2'));var BPromise=require(_0x369d('0x3'));var rs=require(_0x369d('0x4'));var fs=require('fs');var Redis=require(_0x369d('0x5'));var db=require(_0x369d('0x6'))['db'];var utils=require(_0x369d('0x7'));var logger=require(_0x369d('0x8'))(_0x369d('0x9'));var config=require(_0x369d('0xa'));var jayson=require('jayson/promise');var client=jayson['client'][_0x369d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x192566,_0x9575d2,_0x37abdc){return new BPromise(function(_0x3a6af7,_0x4dda2c){return client['request'](_0x192566,_0x37abdc)[_0x369d('0xc')](function(_0x269ecd){logger[_0x369d('0xd')]('SquareMessage,\x20%s,\x20%s',_0x9575d2,_0x369d('0xe'));logger[_0x369d('0xf')]('SquareMessage,\x20%s,\x20%s,\x20%s',_0x9575d2,_0x369d('0xe'),JSON[_0x369d('0x10')](_0x269ecd));if(_0x269ecd[_0x369d('0x11')]){if(_0x269ecd['error'][_0x369d('0x12')]===0x1f4){logger[_0x369d('0x11')](_0x369d('0x13'),_0x9575d2,_0x269ecd['error'][_0x369d('0x14')]);return _0x4dda2c(_0x269ecd[_0x369d('0x11')][_0x369d('0x14')]);}logger['error'](_0x369d('0x13'),_0x9575d2,_0x269ecd['error'][_0x369d('0x14')]);return _0x3a6af7(_0x269ecd['error'][_0x369d('0x14')]);}else{logger[_0x369d('0xd')]('SquareMessage,\x20%s,\x20%s',_0x9575d2,_0x369d('0xe'));_0x3a6af7(_0x269ecd[_0x369d('0x15')][_0x369d('0x14')]);}})[_0x369d('0x16')](function(_0x2bbce0){logger['error'](_0x369d('0x13'),_0x9575d2,_0x2bbce0);_0x4dda2c(_0x2bbce0);});});}exports[_0x369d('0x17')]=function(_0x3814f8){var _0x5ebe7f=this;return new Promise(function(_0xcac716,_0x45f007){return db[_0x369d('0x18')]['create'](_0x3814f8['body'],{'raw':_0x3814f8[_0x369d('0x19')]?_0x3814f8[_0x369d('0x19')][_0x369d('0x1a')]===undefined?!![]:![]:!![]})[_0x369d('0xc')](function(_0x230f89){logger['info']('CreateSquareMessage',_0x3814f8);logger['debug'](_0x369d('0x17'),_0x3814f8,JSON[_0x369d('0x10')](_0x230f89));_0xcac716(_0x230f89);})[_0x369d('0x16')](function(_0x47388f){logger[_0x369d('0x11')]('CreateSquareMessage',_0x47388f[_0x369d('0x14')],_0x3814f8);_0x45f007(_0x5ebe7f['error'](0x1f4,_0x47388f[_0x369d('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index d0dc509..0b81cb4 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 _0xd7fd=['show','/:id/test','15s','test','post','create','put','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareOdbc.controller','get','isAuthenticated','index','/:id'];(function(_0x514da6,_0x3b61d9){var _0x3a47e7=function(_0x14f081){while(--_0x14f081){_0x514da6['push'](_0x514da6['shift']());}};_0x3a47e7(++_0x3b61d9);}(_0xd7fd,0xab));var _0xdd7f=function(_0x2962d5,_0x38deda){_0x2962d5=_0x2962d5-0x0;var _0x273406=_0xd7fd[_0x2962d5];return _0x273406;};'use strict';var multer=require('multer');var util=require(_0xdd7f('0x0'));var path=require(_0xdd7f('0x1'));var timeout=require(_0xdd7f('0x2'));var express=require(_0xdd7f('0x3'));var router=express[_0xdd7f('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xdd7f('0x5'));var interaction=require(_0xdd7f('0x6'));var config=require(_0xdd7f('0x7'));var controller=require(_0xdd7f('0x8'));router[_0xdd7f('0x9')]('/',auth[_0xdd7f('0xa')](),controller[_0xdd7f('0xb')]);router[_0xdd7f('0x9')](_0xdd7f('0xc'),auth[_0xdd7f('0xa')](),controller[_0xdd7f('0xd')]);router['get'](_0xdd7f('0xe'),auth[_0xdd7f('0xa')](),timeout(_0xdd7f('0xf')),controller[_0xdd7f('0x10')]);router[_0xdd7f('0x11')]('/',auth['isAuthenticated'](),controller[_0xdd7f('0x12')]);router[_0xdd7f('0x13')]('/:id',auth[_0xdd7f('0xa')](),controller['update']);router[_0xdd7f('0x14')](_0xdd7f('0xc'),auth['isAuthenticated'](),controller[_0xdd7f('0x15')]);module[_0xdd7f('0x16')]=router; \ No newline at end of file +var _0xd657=['../../config/environment','./squareOdbc.controller','get','index','/:id','isAuthenticated','show','15s','test','put','delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x107df9,_0x4d1825){var _0x2df84a=function(_0x3330ed){while(--_0x3330ed){_0x107df9['push'](_0x107df9['shift']());}};_0x2df84a(++_0x4d1825);}(_0xd657,0x71));var _0x7d65=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd657[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x7d65('0x0'));var util=require('util');var path=require(_0x7d65('0x1'));var timeout=require(_0x7d65('0x2'));var express=require('express');var router=express[_0x7d65('0x3')]();var fs_extra=require(_0x7d65('0x4'));var auth=require(_0x7d65('0x5'));var interaction=require(_0x7d65('0x6'));var config=require(_0x7d65('0x7'));var controller=require(_0x7d65('0x8'));router[_0x7d65('0x9')]('/',auth['isAuthenticated'](),controller[_0x7d65('0xa')]);router[_0x7d65('0x9')](_0x7d65('0xb'),auth[_0x7d65('0xc')](),controller[_0x7d65('0xd')]);router[_0x7d65('0x9')]('/:id/test',auth[_0x7d65('0xc')](),timeout(_0x7d65('0xe')),controller[_0x7d65('0xf')]);router['post']('/',auth[_0x7d65('0xc')](),controller['create']);router[_0x7d65('0x10')](_0x7d65('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x7d65('0x11')](_0x7d65('0xb'),auth[_0x7d65('0xc')](),controller[_0x7d65('0x12')]);module[_0x7d65('0x13')]=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index 6664ee2..191be82 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 _0x0e5c=['STRING','sequelize'];(function(_0x1ee60e,_0x5b3033){var _0x35599a=function(_0x41daa7){while(--_0x41daa7){_0x1ee60e['push'](_0x1ee60e['shift']());}};_0x35599a(++_0x5b3033);}(_0x0e5c,0x1a3));var _0xc0e5=function(_0x54b396,_0x3612ee){_0x54b396=_0x54b396-0x0;var _0x532e6d=_0x0e5c[_0x54b396];return _0x532e6d;};'use strict';var Sequelize=require(_0xc0e5('0x0'));module['exports']={'name':{'type':Sequelize[_0xc0e5('0x1')],'unique':'name','allowNull':![]},'dsn':{'type':Sequelize[_0xc0e5('0x1')]},'description':{'type':Sequelize[_0xc0e5('0x1')]}}; \ No newline at end of file +var _0x360c=['exports','STRING','name','sequelize'];(function(_0x2ac433,_0x2d6a32){var _0x2efb0f=function(_0x516de2){while(--_0x516de2){_0x2ac433['push'](_0x2ac433['shift']());}};_0x2efb0f(++_0x2d6a32);}(_0x360c,0x1db));var _0xc360=function(_0xbc2bc2,_0x3f1041){_0xbc2bc2=_0xbc2bc2-0x0;var _0x35c8bf=_0x360c[_0xbc2bc2];return _0x35c8bf;};'use strict';var Sequelize=require(_0xc360('0x0'));module[_0xc360('0x1')]={'name':{'type':Sequelize[_0xc360('0x2')],'unique':_0xc360('0x3'),'allowNull':![]},'dsn':{'type':Sequelize[_0xc360('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 0629cce..34fdc49 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 _0x2d9c=['end','error','stack','name','index','map','fieldName','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','SquareOdbc','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','test','odbc','openSync','dsn','closeSync','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','get','ODBC','UserProfileResource','destroy'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x2d9c,0x87));var _0xc2d9=function(_0x47cc0f,_0x41c47e){_0x47cc0f=_0x47cc0f-0x0;var _0x5396a0=_0x2d9c[_0x47cc0f];return _0x5396a0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc2d9('0x0'));var zipdir=require(_0xc2d9('0x1'));var jsonpatch=require(_0xc2d9('0x2'));var rp=require(_0xc2d9('0x3'));var moment=require('moment');var BPromise=require(_0xc2d9('0x4'));var Mustache=require(_0xc2d9('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xc2d9('0x6'));var ejs=require(_0xc2d9('0x7'));var fs=require('fs');var fs_extra=require(_0xc2d9('0x8'));var _=require(_0xc2d9('0x9'));var squel=require(_0xc2d9('0xa'));var crypto=require(_0xc2d9('0xb'));var jsforce=require(_0xc2d9('0xc'));var deskjs=require(_0xc2d9('0xd'));var toCsv=require('to-csv');var querystring=require(_0xc2d9('0xe'));var Papa=require(_0xc2d9('0xf'));var Redis=require(_0xc2d9('0x10'));var authService=require(_0xc2d9('0x11'));var qs=require(_0xc2d9('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc2d9('0x13'));var logger=require('../../config/logger')(_0xc2d9('0x14'));var utils=require('../../config/utils');var config=require(_0xc2d9('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xc2d9('0x16'))['db'];function respondWithStatusCode(_0x5b2c1e,_0x576abc){_0x576abc=_0x576abc||0xcc;return function(_0x1ef119){if(_0x1ef119){return _0x5b2c1e[_0xc2d9('0x17')](_0x576abc);}return _0x5b2c1e[_0xc2d9('0x18')](_0x576abc)['end']();};}function respondWithResult(_0x2ae4bc,_0x55111b){_0x55111b=_0x55111b||0xc8;return function(_0x3efbdf){if(_0x3efbdf){return _0x2ae4bc[_0xc2d9('0x18')](_0x55111b)[_0xc2d9('0x19')](_0x3efbdf);}};}function respondWithFilteredResult(_0x5d0b92,_0x45ea26){return function(_0x3e5eef){if(_0x3e5eef){var _0x499587=typeof _0x45ea26[_0xc2d9('0x1a')]===_0xc2d9('0x1b')&&typeof _0x45ea26[_0xc2d9('0x1c')]===_0xc2d9('0x1b');var _0x4d747d=_0x3e5eef[_0xc2d9('0x1d')];var _0xffe9ab=_0x499587?0x0:_0x45ea26[_0xc2d9('0x1a')];var _0x54314b=_0x499587?_0x3e5eef[_0xc2d9('0x1d')]:_0x45ea26[_0xc2d9('0x1a')]+_0x45ea26[_0xc2d9('0x1c')];var _0x31b39b;if(_0x54314b>=_0x4d747d){_0x54314b=_0x4d747d;_0x31b39b=0xc8;}else{_0x31b39b=0xce;}_0x5d0b92[_0xc2d9('0x18')](_0x31b39b);return _0x5d0b92[_0xc2d9('0x1e')](_0xc2d9('0x1f'),_0xffe9ab+'-'+_0x54314b+'/'+_0x4d747d)[_0xc2d9('0x19')](_0x3e5eef);}return null;};}function patchUpdates(_0x4bcf22){return function(_0x318393){try{jsonpatch[_0xc2d9('0x20')](_0x318393,_0x4bcf22,!![]);}catch(_0x5a5787){return BPromise[_0xc2d9('0x21')](_0x5a5787);}return _0x318393[_0xc2d9('0x22')]();};}function saveUpdates(_0x890676,_0x185dba){return function(_0x4db999){if(_0x4db999){return _0x4db999[_0xc2d9('0x23')](_0x890676)['then'](function(_0x542c53){return _0x542c53;});}return null;};}function removeEntity(_0x2851aa,_0x37ef34){return function(_0xcdd532){if(_0xcdd532){return _0xcdd532['destroy']()[_0xc2d9('0x24')](function(){var _0x5b7474=_0xcdd532[_0xc2d9('0x25')]({'plain':!![]});var _0x2d17d8=_0xc2d9('0x26');return db[_0xc2d9('0x27')][_0xc2d9('0x28')]({'where':{'type':_0x2d17d8,'resourceId':_0x5b7474['id']}})[_0xc2d9('0x24')](function(){return _0xcdd532;});})['then'](function(){_0x2851aa[_0xc2d9('0x18')](0xcc)[_0xc2d9('0x29')]();});}};}function handleEntityNotFound(_0x2fc5b7,_0xb59443){return function(_0x37e59d){if(!_0x37e59d){_0x2fc5b7[_0xc2d9('0x17')](0x194);}return _0x37e59d;};}function handleError(_0x42522a,_0x40f59d){_0x40f59d=_0x40f59d||0x1f4;return function(_0x5e45f4){logger[_0xc2d9('0x2a')](_0x5e45f4[_0xc2d9('0x2b')]);if(_0x5e45f4[_0xc2d9('0x2c')]){delete _0x5e45f4[_0xc2d9('0x2c')];}_0x42522a[_0xc2d9('0x18')](_0x40f59d)['send'](_0x5e45f4);};}exports[_0xc2d9('0x2d')]=function(_0x2ea996,_0x4b33d4){var _0x42902f={},_0x5a6986={},_0x37451f={'count':0x0,'rows':[]};var _0x5aa177=_[_0xc2d9('0x2e')](db['SquareOdbc']['rawAttributes'],function(_0x436f10){return{'name':_0x436f10[_0xc2d9('0x2f')],'type':_0x436f10['type']['key']};});_0x5a6986[_0xc2d9('0x30')]=_[_0xc2d9('0x2e')](_0x5aa177,_0xc2d9('0x2c'));_0x5a6986[_0xc2d9('0x31')]=_[_0xc2d9('0x32')](_0x2ea996[_0xc2d9('0x31')]);_0x5a6986[_0xc2d9('0x33')]=_[_0xc2d9('0x34')](_0x5a6986[_0xc2d9('0x30')],_0x5a6986[_0xc2d9('0x31')]);_0x42902f[_0xc2d9('0x35')]=_[_0xc2d9('0x34')](_0x5a6986[_0xc2d9('0x30')],qs[_0xc2d9('0x36')](_0x2ea996[_0xc2d9('0x31')][_0xc2d9('0x36')]));_0x42902f['attributes']=_0x42902f[_0xc2d9('0x35')]['length']?_0x42902f[_0xc2d9('0x35')]:_0x5a6986[_0xc2d9('0x30')];if(!_0x2ea996[_0xc2d9('0x31')][_0xc2d9('0x37')](_0xc2d9('0x38'))){_0x42902f[_0xc2d9('0x1c')]=qs[_0xc2d9('0x1c')](_0x2ea996['query'][_0xc2d9('0x1c')]);_0x42902f[_0xc2d9('0x1a')]=qs[_0xc2d9('0x1a')](_0x2ea996['query'][_0xc2d9('0x1a')]);}_0x42902f[_0xc2d9('0x39')]=qs[_0xc2d9('0x3a')](_0x2ea996[_0xc2d9('0x31')][_0xc2d9('0x3a')]);_0x42902f[_0xc2d9('0x3b')]=qs[_0xc2d9('0x33')](_[_0xc2d9('0x3c')](_0x2ea996['query'],_0x5a6986[_0xc2d9('0x33')]),_0x5aa177);if(_0x2ea996[_0xc2d9('0x31')]['filter']){_0x42902f[_0xc2d9('0x3b')]=_[_0xc2d9('0x3d')](_0x42902f[_0xc2d9('0x3b')],{'$or':_[_0xc2d9('0x2e')](_0x5aa177,function(_0x4a1a74){if(_0x4a1a74[_0xc2d9('0x3e')]!==_0xc2d9('0x3f')){var _0x346daa={};_0x346daa[_0x4a1a74[_0xc2d9('0x2c')]]={'$like':'%'+_0x2ea996['query'][_0xc2d9('0x40')]+'%'};return _0x346daa;}})});}_0x42902f=_[_0xc2d9('0x3d')]({},_0x42902f,_0x2ea996[_0xc2d9('0x41')]);var _0x49290f={'where':_0x42902f[_0xc2d9('0x3b')]};return db[_0xc2d9('0x42')][_0xc2d9('0x1d')](_0x49290f)[_0xc2d9('0x24')](function(_0x1a9594){_0x37451f[_0xc2d9('0x1d')]=_0x1a9594;if(_0x2ea996[_0xc2d9('0x31')][_0xc2d9('0x43')]){_0x42902f[_0xc2d9('0x44')]=[{'all':!![]}];}return db[_0xc2d9('0x42')][_0xc2d9('0x45')](_0x42902f);})[_0xc2d9('0x24')](function(_0x40c484){_0x37451f[_0xc2d9('0x46')]=_0x40c484;return _0x37451f;})[_0xc2d9('0x24')](respondWithFilteredResult(_0x4b33d4,_0x42902f))[_0xc2d9('0x47')](handleError(_0x4b33d4,null));};exports[_0xc2d9('0x48')]=function(_0x10b5cc,_0x174807){var _0x40d67f={'raw':!![],'where':{'id':_0x10b5cc[_0xc2d9('0x49')]['id']}},_0xd0b673={};_0xd0b673[_0xc2d9('0x30')]=_[_0xc2d9('0x32')](db[_0xc2d9('0x42')][_0xc2d9('0x4a')]);_0xd0b673[_0xc2d9('0x31')]=_[_0xc2d9('0x32')](_0x10b5cc[_0xc2d9('0x31')]);_0xd0b673['filters']=_[_0xc2d9('0x34')](_0xd0b673[_0xc2d9('0x30')],_0xd0b673[_0xc2d9('0x31')]);_0x40d67f['attributes']=_['intersection'](_0xd0b673[_0xc2d9('0x30')],qs[_0xc2d9('0x36')](_0x10b5cc[_0xc2d9('0x31')][_0xc2d9('0x36')]));_0x40d67f[_0xc2d9('0x35')]=_0x40d67f[_0xc2d9('0x35')]['length']?_0x40d67f[_0xc2d9('0x35')]:_0xd0b673[_0xc2d9('0x30')];if(_0x10b5cc[_0xc2d9('0x31')][_0xc2d9('0x43')]){_0x40d67f[_0xc2d9('0x44')]=[{'all':!![]}];}_0x40d67f=_['merge']({},_0x40d67f,_0x10b5cc[_0xc2d9('0x41')]);return db[_0xc2d9('0x42')][_0xc2d9('0x4b')](_0x40d67f)[_0xc2d9('0x24')](handleEntityNotFound(_0x174807,null))[_0xc2d9('0x24')](respondWithResult(_0x174807,null))[_0xc2d9('0x47')](handleError(_0x174807,null));};exports['create']=function(_0x507630,_0x3e3da5){return db[_0xc2d9('0x42')][_0xc2d9('0x4c')](_0x507630[_0xc2d9('0x4d')],{})[_0xc2d9('0x24')](function(_0x2f9f9d){var _0x5d8b51=_0x507630[_0xc2d9('0x4e')][_0xc2d9('0x25')]({'plain':!![]});if(!_0x5d8b51)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5d8b51[_0xc2d9('0x4f')]===_0xc2d9('0x4e')){var _0x2066da=_0x2f9f9d['get']({'plain':!![]});var _0x812c2e=_0xc2d9('0x26');return db[_0xc2d9('0x50')][_0xc2d9('0x4b')]({'where':{'name':_0x812c2e,'userProfileId':_0x5d8b51[_0xc2d9('0x51')]},'raw':!![]})[_0xc2d9('0x24')](function(_0x383bee){if(_0x383bee&&_0x383bee['autoAssociation']===0x0){return db[_0xc2d9('0x27')][_0xc2d9('0x4c')]({'name':_0x2066da[_0xc2d9('0x2c')],'resourceId':_0x2066da['id'],'type':_0x383bee[_0xc2d9('0x2c')],'sectionId':_0x383bee['id']},{})['then'](function(){return _0x2f9f9d;});}else{return _0x2f9f9d;}})[_0xc2d9('0x47')](function(_0x305e28){logger[_0xc2d9('0x2a')](_0xc2d9('0x52'),_0x305e28);throw _0x305e28;});}return _0x2f9f9d;})[_0xc2d9('0x24')](respondWithResult(_0x3e3da5,0xc9))[_0xc2d9('0x47')](handleError(_0x3e3da5,null));};exports[_0xc2d9('0x23')]=function(_0x5da35a,_0x437019){if(_0x5da35a[_0xc2d9('0x4d')]['id']){delete _0x5da35a[_0xc2d9('0x4d')]['id'];}return db[_0xc2d9('0x42')][_0xc2d9('0x4b')]({'where':{'id':_0x5da35a['params']['id']}})[_0xc2d9('0x24')](handleEntityNotFound(_0x437019,null))[_0xc2d9('0x24')](saveUpdates(_0x5da35a[_0xc2d9('0x4d')],null))['then'](respondWithResult(_0x437019,null))[_0xc2d9('0x47')](handleError(_0x437019,null));};exports[_0xc2d9('0x28')]=function(_0x258e47,_0x2ce85d){return db[_0xc2d9('0x42')][_0xc2d9('0x4b')]({'where':{'id':_0x258e47[_0xc2d9('0x49')]['id']}})[_0xc2d9('0x24')](handleEntityNotFound(_0x2ce85d,null))['then'](removeEntity(_0x2ce85d,null))['catch'](handleError(_0x2ce85d,null));};exports[_0xc2d9('0x53')]=function(_0x1845e2,_0x56c38b,_0x5845f5){var _0x2f02b1;return db[_0xc2d9('0x42')][_0xc2d9('0x4b')]({'where':{'id':_0x1845e2[_0xc2d9('0x49')]['id']},'attributes':['id','dsn']})[_0xc2d9('0x24')](handleEntityNotFound(_0x56c38b,null))[_0xc2d9('0x24')](function(_0x4c46c6){if(_0x4c46c6){var _0x5264b9=require(_0xc2d9('0x54'))();_0x5264b9[_0xc2d9('0x55')](_0x4c46c6[_0xc2d9('0x56')]);_0x5264b9[_0xc2d9('0x57')]();return _0x4c46c6;}})[_0xc2d9('0x24')](respondWithResult(_0x56c38b,null))['catch'](handleError(_0x56c38b,null));}; \ No newline at end of file +var _0xa738=['fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','destroy','ODBC','UserProfileResource','end','stack','name','send','index','map','SquareOdbc','rawAttributes','fieldName','model','keys','query','intersection','attributes','fields','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','findAll','catch','show','params','length','includeAll','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','test','dsn','odbc','openSync','rimraf','zip-dir'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xa738,0xa4));var _0x8a73=function(_0x217cff,_0x25a079){_0x217cff=_0x217cff-0x0;var _0x1ed2fb=_0xa738[_0x217cff];return _0x1ed2fb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8a73('0x0'));var zipdir=require(_0x8a73('0x1'));var jsonpatch=require(_0x8a73('0x2'));var rp=require(_0x8a73('0x3'));var moment=require(_0x8a73('0x4'));var BPromise=require(_0x8a73('0x5'));var Mustache=require(_0x8a73('0x6'));var util=require('util');var path=require('path');var sox=require(_0x8a73('0x7'));var csv=require(_0x8a73('0x8'));var ejs=require(_0x8a73('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8a73('0xa'));var squel=require('squel');var crypto=require(_0x8a73('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x8a73('0xc'));var toCsv=require('to-csv');var querystring=require(_0x8a73('0xd'));var Papa=require('papaparse');var Redis=require(_0x8a73('0xe'));var authService=require(_0x8a73('0xf'));var qs=require(_0x8a73('0x10'));var as=require(_0x8a73('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x8a73('0x12'));var config=require(_0x8a73('0x13'));var licenseUtil=require(_0x8a73('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x381a7d,_0x2b93a2){_0x2b93a2=_0x2b93a2||0xcc;return function(_0xb89018){if(_0xb89018){return _0x381a7d[_0x8a73('0x15')](_0x2b93a2);}return _0x381a7d[_0x8a73('0x16')](_0x2b93a2)['end']();};}function respondWithResult(_0x4fc050,_0x25ea94){_0x25ea94=_0x25ea94||0xc8;return function(_0x10ca30){if(_0x10ca30){return _0x4fc050[_0x8a73('0x16')](_0x25ea94)['json'](_0x10ca30);}};}function respondWithFilteredResult(_0x177f75,_0xe618ab){return function(_0x13c752){if(_0x13c752){var _0x3c23ef=typeof _0xe618ab[_0x8a73('0x17')]===_0x8a73('0x18')&&typeof _0xe618ab[_0x8a73('0x19')]==='undefined';var _0x5af347=_0x13c752[_0x8a73('0x1a')];var _0xb8f24=_0x3c23ef?0x0:_0xe618ab[_0x8a73('0x17')];var _0x40e041=_0x3c23ef?_0x13c752[_0x8a73('0x1a')]:_0xe618ab['offset']+_0xe618ab[_0x8a73('0x19')];var _0x4c0efe;if(_0x40e041>=_0x5af347){_0x40e041=_0x5af347;_0x4c0efe=0xc8;}else{_0x4c0efe=0xce;}_0x177f75['status'](_0x4c0efe);return _0x177f75[_0x8a73('0x1b')](_0x8a73('0x1c'),_0xb8f24+'-'+_0x40e041+'/'+_0x5af347)[_0x8a73('0x1d')](_0x13c752);}return null;};}function patchUpdates(_0x27b7da){return function(_0xe0e6b9){try{jsonpatch[_0x8a73('0x1e')](_0xe0e6b9,_0x27b7da,!![]);}catch(_0x38d7ac){return BPromise[_0x8a73('0x1f')](_0x38d7ac);}return _0xe0e6b9['save']();};}function saveUpdates(_0x13fb19,_0x12a842){return function(_0x2b1eaa){if(_0x2b1eaa){return _0x2b1eaa[_0x8a73('0x20')](_0x13fb19)[_0x8a73('0x21')](function(_0x5f0c4e){return _0x5f0c4e;});}return null;};}function removeEntity(_0x16e2d5,_0x3ff0ee){return function(_0x4daccf){if(_0x4daccf){return _0x4daccf[_0x8a73('0x22')]()[_0x8a73('0x21')](function(){var _0x41492a=_0x4daccf['get']({'plain':!![]});var _0x32121f=_0x8a73('0x23');return db[_0x8a73('0x24')][_0x8a73('0x22')]({'where':{'type':_0x32121f,'resourceId':_0x41492a['id']}})[_0x8a73('0x21')](function(){return _0x4daccf;});})[_0x8a73('0x21')](function(){_0x16e2d5['status'](0xcc)[_0x8a73('0x25')]();});}};}function handleEntityNotFound(_0x2d8048,_0x393a43){return function(_0x32af7a){if(!_0x32af7a){_0x2d8048[_0x8a73('0x15')](0x194);}return _0x32af7a;};}function handleError(_0x396504,_0x531ca4){_0x531ca4=_0x531ca4||0x1f4;return function(_0x248c81){logger['error'](_0x248c81[_0x8a73('0x26')]);if(_0x248c81[_0x8a73('0x27')]){delete _0x248c81['name'];}_0x396504[_0x8a73('0x16')](_0x531ca4)[_0x8a73('0x28')](_0x248c81);};}exports[_0x8a73('0x29')]=function(_0x42d2d5,_0x296e4a){var _0x1cf050={},_0x26f521={},_0x425dfa={'count':0x0,'rows':[]};var _0x596751=_[_0x8a73('0x2a')](db[_0x8a73('0x2b')][_0x8a73('0x2c')],function(_0x168552){return{'name':_0x168552[_0x8a73('0x2d')],'type':_0x168552['type']['key']};});_0x26f521[_0x8a73('0x2e')]=_[_0x8a73('0x2a')](_0x596751,_0x8a73('0x27'));_0x26f521['query']=_[_0x8a73('0x2f')](_0x42d2d5[_0x8a73('0x30')]);_0x26f521['filters']=_[_0x8a73('0x31')](_0x26f521[_0x8a73('0x2e')],_0x26f521['query']);_0x1cf050[_0x8a73('0x32')]=_[_0x8a73('0x31')](_0x26f521[_0x8a73('0x2e')],qs['fields'](_0x42d2d5[_0x8a73('0x30')][_0x8a73('0x33')]));_0x1cf050[_0x8a73('0x32')]=_0x1cf050[_0x8a73('0x32')]['length']?_0x1cf050[_0x8a73('0x32')]:_0x26f521[_0x8a73('0x2e')];if(!_0x42d2d5['query']['hasOwnProperty'](_0x8a73('0x34'))){_0x1cf050[_0x8a73('0x19')]=qs['limit'](_0x42d2d5['query']['limit']);_0x1cf050['offset']=qs[_0x8a73('0x17')](_0x42d2d5[_0x8a73('0x30')][_0x8a73('0x17')]);}_0x1cf050['order']=qs[_0x8a73('0x35')](_0x42d2d5[_0x8a73('0x30')]['sort']);_0x1cf050[_0x8a73('0x36')]=qs[_0x8a73('0x37')](_[_0x8a73('0x38')](_0x42d2d5['query'],_0x26f521[_0x8a73('0x37')]),_0x596751);if(_0x42d2d5[_0x8a73('0x30')][_0x8a73('0x39')]){_0x1cf050[_0x8a73('0x36')]=_[_0x8a73('0x3a')](_0x1cf050[_0x8a73('0x36')],{'$or':_[_0x8a73('0x2a')](_0x596751,function(_0x6e2119){if(_0x6e2119['type']!==_0x8a73('0x3b')){var _0x4e8b70={};_0x4e8b70[_0x6e2119['name']]={'$like':'%'+_0x42d2d5[_0x8a73('0x30')][_0x8a73('0x39')]+'%'};return _0x4e8b70;}})});}_0x1cf050=_[_0x8a73('0x3a')]({},_0x1cf050,_0x42d2d5[_0x8a73('0x3c')]);var _0x438e02={'where':_0x1cf050['where']};return db['SquareOdbc'][_0x8a73('0x1a')](_0x438e02)[_0x8a73('0x21')](function(_0x154e5d){_0x425dfa[_0x8a73('0x1a')]=_0x154e5d;if(_0x42d2d5[_0x8a73('0x30')]['includeAll']){_0x1cf050[_0x8a73('0x3d')]=[{'all':!![]}];}return db[_0x8a73('0x2b')][_0x8a73('0x3e')](_0x1cf050);})[_0x8a73('0x21')](function(_0x928ebe){_0x425dfa['rows']=_0x928ebe;return _0x425dfa;})[_0x8a73('0x21')](respondWithFilteredResult(_0x296e4a,_0x1cf050))[_0x8a73('0x3f')](handleError(_0x296e4a,null));};exports[_0x8a73('0x40')]=function(_0x54c6db,_0x4e4f4e){var _0x1b4cac={'raw':!![],'where':{'id':_0x54c6db[_0x8a73('0x41')]['id']}},_0x1d9208={};_0x1d9208[_0x8a73('0x2e')]=_[_0x8a73('0x2f')](db[_0x8a73('0x2b')][_0x8a73('0x2c')]);_0x1d9208[_0x8a73('0x30')]=_[_0x8a73('0x2f')](_0x54c6db['query']);_0x1d9208[_0x8a73('0x37')]=_['intersection'](_0x1d9208[_0x8a73('0x2e')],_0x1d9208[_0x8a73('0x30')]);_0x1b4cac[_0x8a73('0x32')]=_[_0x8a73('0x31')](_0x1d9208[_0x8a73('0x2e')],qs['fields'](_0x54c6db[_0x8a73('0x30')][_0x8a73('0x33')]));_0x1b4cac['attributes']=_0x1b4cac['attributes'][_0x8a73('0x42')]?_0x1b4cac[_0x8a73('0x32')]:_0x1d9208['model'];if(_0x54c6db[_0x8a73('0x30')][_0x8a73('0x43')]){_0x1b4cac[_0x8a73('0x3d')]=[{'all':!![]}];}_0x1b4cac=_[_0x8a73('0x3a')]({},_0x1b4cac,_0x54c6db[_0x8a73('0x3c')]);return db[_0x8a73('0x2b')][_0x8a73('0x44')](_0x1b4cac)[_0x8a73('0x21')](handleEntityNotFound(_0x4e4f4e,null))[_0x8a73('0x21')](respondWithResult(_0x4e4f4e,null))[_0x8a73('0x3f')](handleError(_0x4e4f4e,null));};exports['create']=function(_0xa63b14,_0x3a3f55){return db[_0x8a73('0x2b')][_0x8a73('0x45')](_0xa63b14[_0x8a73('0x46')],{})[_0x8a73('0x21')](function(_0x46b2d5){var _0xd49b36=_0xa63b14[_0x8a73('0x47')][_0x8a73('0x48')]({'plain':!![]});if(!_0xd49b36)throw new Error(_0x8a73('0x49'));if(_0xd49b36[_0x8a73('0x4a')]===_0x8a73('0x47')){var _0x3a6b15=_0x46b2d5[_0x8a73('0x48')]({'plain':!![]});var _0x4a2ac6=_0x8a73('0x23');return db[_0x8a73('0x4b')][_0x8a73('0x44')]({'where':{'name':_0x4a2ac6,'userProfileId':_0xd49b36[_0x8a73('0x4c')]},'raw':!![]})[_0x8a73('0x21')](function(_0x152216){if(_0x152216&&_0x152216[_0x8a73('0x4d')]===0x0){return db['UserProfileResource'][_0x8a73('0x45')]({'name':_0x3a6b15[_0x8a73('0x27')],'resourceId':_0x3a6b15['id'],'type':_0x152216[_0x8a73('0x27')],'sectionId':_0x152216['id']},{})[_0x8a73('0x21')](function(){return _0x46b2d5;});}else{return _0x46b2d5;}})['catch'](function(_0x449c2c){logger[_0x8a73('0x4e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x449c2c);throw _0x449c2c;});}return _0x46b2d5;})[_0x8a73('0x21')](respondWithResult(_0x3a3f55,0xc9))['catch'](handleError(_0x3a3f55,null));};exports[_0x8a73('0x20')]=function(_0x26c608,_0x131540){if(_0x26c608['body']['id']){delete _0x26c608['body']['id'];}return db[_0x8a73('0x2b')][_0x8a73('0x44')]({'where':{'id':_0x26c608[_0x8a73('0x41')]['id']}})['then'](handleEntityNotFound(_0x131540,null))['then'](saveUpdates(_0x26c608['body'],null))[_0x8a73('0x21')](respondWithResult(_0x131540,null))[_0x8a73('0x3f')](handleError(_0x131540,null));};exports['destroy']=function(_0x262a57,_0x7ceb86){return db[_0x8a73('0x2b')][_0x8a73('0x44')]({'where':{'id':_0x262a57['params']['id']}})[_0x8a73('0x21')](handleEntityNotFound(_0x7ceb86,null))['then'](removeEntity(_0x7ceb86,null))['catch'](handleError(_0x7ceb86,null));};exports[_0x8a73('0x4f')]=function(_0x27a50f,_0x27e46f,_0x346412){var _0x465c82;return db[_0x8a73('0x2b')]['find']({'where':{'id':_0x27a50f[_0x8a73('0x41')]['id']},'attributes':['id',_0x8a73('0x50')]})[_0x8a73('0x21')](handleEntityNotFound(_0x27e46f,null))[_0x8a73('0x21')](function(_0x2236b2){if(_0x2236b2){var _0x2fb15c=require(_0x8a73('0x51'))();_0x2fb15c[_0x8a73('0x52')](_0x2236b2[_0x8a73('0x50')]);_0x2fb15c['closeSync']();return _0x2236b2;}})[_0x8a73('0x21')](respondWithResult(_0x27e46f,null))[_0x8a73('0x3f')](handleError(_0x27e46f,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index 421d15f..11ee8ec 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 _0x5d11=['path','rimraf','exports','define','SquareOdbc','lodash','util','moment','request-promise'];(function(_0x3a45eb,_0x39690e){var _0x5ae6ea=function(_0x563f52){while(--_0x563f52){_0x3a45eb['push'](_0x3a45eb['shift']());}};_0x5ae6ea(++_0x39690e);}(_0x5d11,0x101));var _0x15d1=function(_0x1f2422,_0x125fd2){_0x1f2422=_0x1f2422-0x0;var _0x4fb420=_0x5d11[_0x1f2422];return _0x4fb420;};'use strict';var _=require(_0x15d1('0x0'));var util=require(_0x15d1('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x15d1('0x2'));var BPromise=require('bluebird');var rp=require(_0x15d1('0x3'));var fs=require('fs');var path=require(_0x15d1('0x4'));var rimraf=require(_0x15d1('0x5'));var config=require('../../config/environment');var attributes=require('./squareOdbc.attributes');module[_0x15d1('0x6')]=function(_0x1b6d9f,_0x3054bd){return _0x1b6d9f[_0x15d1('0x7')](_0x15d1('0x8'),attributes,{'tableName':'square_odbc','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa0f7=['request-promise','path','rimraf','../../config/environment','./squareOdbc.attributes','exports','define','SquareOdbc','square_odbc','api','moment','bluebird'];(function(_0x37572f,_0x48b00e){var _0x1bcbce=function(_0x5d8e95){while(--_0x5d8e95){_0x37572f['push'](_0x37572f['shift']());}};_0x1bcbce(++_0x48b00e);}(_0xa0f7,0x105));var _0x7a0f=function(_0x591322,_0x2c550e){_0x591322=_0x591322-0x0;var _0x27ab23=_0xa0f7[_0x591322];return _0x27ab23;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x7a0f('0x0'));var moment=require(_0x7a0f('0x1'));var BPromise=require(_0x7a0f('0x2'));var rp=require(_0x7a0f('0x3'));var fs=require('fs');var path=require(_0x7a0f('0x4'));var rimraf=require(_0x7a0f('0x5'));var config=require(_0x7a0f('0x6'));var attributes=require(_0x7a0f('0x7'));module[_0x7a0f('0x8')]=function(_0x4d3c14,_0x2f4a67){return _0x4d3c14[_0x7a0f('0x9')](_0x7a0f('0xa'),attributes,{'tableName':_0x7a0f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.rpc.js b/server/api/squareOdbc/squareOdbc.rpc.js index b53793f..7315b43 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 _0x25c8=['rpc','../../config/environment','jayson/promise','http','request','then','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SquareOdbc,\x20%s,\x20%s','info','result','catch','ShowSquareOdbc','find','options','raw','where','attributes','include','map','model','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x40220a,_0x22feb1){var _0x3903cc=function(_0x33a296){while(--_0x33a296){_0x40220a['push'](_0x40220a['shift']());}};_0x3903cc(++_0x22feb1);}(_0x25c8,0xba));var _0x825c=function(_0x4345ee,_0x77183b){_0x4345ee=_0x4345ee-0x0;var _0x37094a=_0x25c8[_0x4345ee];return _0x37094a;};'use strict';var _=require(_0x825c('0x0'));var util=require(_0x825c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x825c('0x2'));var fs=require('fs');var Redis=require(_0x825c('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x825c('0x4'));var logger=require(_0x825c('0x5'))(_0x825c('0x6'));var config=require(_0x825c('0x7'));var jayson=require(_0x825c('0x8'));var client=jayson['client'][_0x825c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3c322f,_0x3811ea,_0xb1b479){return new BPromise(function(_0x4e7508,_0x1f0a75){return client[_0x825c('0xa')](_0x3c322f,_0xb1b479)[_0x825c('0xb')](function(_0x48c69a){logger['info']('SquareOdbc,\x20%s,\x20%s',_0x3811ea,_0x825c('0xc'));logger[_0x825c('0xd')](_0x825c('0xe'),_0x3811ea,'request\x20sent',JSON[_0x825c('0xf')](_0x48c69a));if(_0x48c69a[_0x825c('0x10')]){if(_0x48c69a[_0x825c('0x10')][_0x825c('0x11')]===0x1f4){logger[_0x825c('0x10')]('SquareOdbc,\x20%s,\x20%s',_0x3811ea,_0x48c69a[_0x825c('0x10')]['message']);return _0x1f0a75(_0x48c69a[_0x825c('0x10')][_0x825c('0x12')]);}logger[_0x825c('0x10')](_0x825c('0x13'),_0x3811ea,_0x48c69a[_0x825c('0x10')][_0x825c('0x12')]);return _0x4e7508(_0x48c69a[_0x825c('0x10')][_0x825c('0x12')]);}else{logger[_0x825c('0x14')](_0x825c('0x13'),_0x3811ea,_0x825c('0xc'));_0x4e7508(_0x48c69a[_0x825c('0x15')][_0x825c('0x12')]);}})[_0x825c('0x16')](function(_0x48eb42){logger[_0x825c('0x10')]('SquareOdbc,\x20%s,\x20%s',_0x3811ea,_0x48eb42);_0x1f0a75(_0x48eb42);});});}exports[_0x825c('0x17')]=function(_0x5db50d){var _0x5bca98=this;return new Promise(function(_0x57f2a3,_0xa4f644){return db['SquareOdbc'][_0x825c('0x18')]({'raw':_0x5db50d[_0x825c('0x19')]?_0x5db50d[_0x825c('0x19')][_0x825c('0x1a')]===undefined?!![]:![]:!![],'where':_0x5db50d[_0x825c('0x19')]?_0x5db50d[_0x825c('0x19')][_0x825c('0x1b')]||null:null,'attributes':_0x5db50d['options']?_0x5db50d[_0x825c('0x19')][_0x825c('0x1c')]||null:null,'include':_0x5db50d['options']?_0x5db50d[_0x825c('0x19')][_0x825c('0x1d')]?_[_0x825c('0x1e')](_0x5db50d[_0x825c('0x19')][_0x825c('0x1d')],function(_0x5d7b88){return{'model':db[_0x5d7b88[_0x825c('0x1f')]],'as':_0x5d7b88['as'],'attributes':_0x5d7b88[_0x825c('0x1c')],'include':_0x5d7b88['include']?_[_0x825c('0x1e')](_0x5d7b88[_0x825c('0x1d')],function(_0x127670){return{'model':db[_0x127670['model']],'as':_0x127670['as'],'attributes':_0x127670[_0x825c('0x1c')],'include':_0x127670[_0x825c('0x1d')]?_[_0x825c('0x1e')](_0x127670[_0x825c('0x1d')],function(_0x38502d){return{'model':db[_0x38502d['model']],'as':_0x38502d['as'],'attributes':_0x38502d[_0x825c('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x825c('0xb')](function(_0x27c3ff){logger[_0x825c('0x14')](_0x825c('0x17'),_0x5db50d);logger[_0x825c('0xd')]('ShowSquareOdbc',_0x5db50d,JSON['stringify'](_0x27c3ff));_0x57f2a3(_0x27c3ff);})[_0x825c('0x16')](function(_0x1d3579){logger[_0x825c('0x10')](_0x825c('0x17'),_0x1d3579[_0x825c('0x12')],_0x5db50d);_0xa4f644(_0x5bca98[_0x825c('0x10')](0x1f4,_0x1d3579[_0x825c('0x12')]));});});}; \ No newline at end of file +var _0xdd96=['jayson/promise','client','http','request','then','SquareOdbc,\x20%s,\x20%s','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','ShowSquareOdbc','find','options','raw','where','attributes','include','map','model','info','catch','moment','bluebird','ioredis','../../config/utils'];(function(_0x2a4fe2,_0x3ec53a){var _0x225c4a=function(_0x1eccfa){while(--_0x1eccfa){_0x2a4fe2['push'](_0x2a4fe2['shift']());}};_0x225c4a(++_0x3ec53a);}(_0xdd96,0x192));var _0x6dd9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdd96[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x6dd9('0x0'));var BPromise=require(_0x6dd9('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6dd9('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x6dd9('0x3'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x6dd9('0x4'));var client=jayson[_0x6dd9('0x5')][_0x6dd9('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x3d1142,_0x2ba4d0,_0x26cef6){return new BPromise(function(_0x4d379b,_0x2b5fe6){return client[_0x6dd9('0x7')](_0x3d1142,_0x26cef6)[_0x6dd9('0x8')](function(_0x542f4d){logger['info'](_0x6dd9('0x9'),_0x2ba4d0,'request\x20sent');logger[_0x6dd9('0xa')](_0x6dd9('0xb'),_0x2ba4d0,_0x6dd9('0xc'),JSON[_0x6dd9('0xd')](_0x542f4d));if(_0x542f4d[_0x6dd9('0xe')]){if(_0x542f4d[_0x6dd9('0xe')][_0x6dd9('0xf')]===0x1f4){logger[_0x6dd9('0xe')](_0x6dd9('0x9'),_0x2ba4d0,_0x542f4d[_0x6dd9('0xe')][_0x6dd9('0x10')]);return _0x2b5fe6(_0x542f4d['error'][_0x6dd9('0x10')]);}logger[_0x6dd9('0xe')](_0x6dd9('0x9'),_0x2ba4d0,_0x542f4d[_0x6dd9('0xe')][_0x6dd9('0x10')]);return _0x4d379b(_0x542f4d[_0x6dd9('0xe')]['message']);}else{logger['info'](_0x6dd9('0x9'),_0x2ba4d0,'request\x20sent');_0x4d379b(_0x542f4d[_0x6dd9('0x11')][_0x6dd9('0x10')]);}})['catch'](function(_0x5e3450){logger[_0x6dd9('0xe')]('SquareOdbc,\x20%s,\x20%s',_0x2ba4d0,_0x5e3450);_0x2b5fe6(_0x5e3450);});});}exports[_0x6dd9('0x12')]=function(_0x3caf09){var _0x4f2c0e=this;return new Promise(function(_0x12b053,_0x152b0c){return db['SquareOdbc'][_0x6dd9('0x13')]({'raw':_0x3caf09['options']?_0x3caf09[_0x6dd9('0x14')][_0x6dd9('0x15')]===undefined?!![]:![]:!![],'where':_0x3caf09[_0x6dd9('0x14')]?_0x3caf09[_0x6dd9('0x14')][_0x6dd9('0x16')]||null:null,'attributes':_0x3caf09['options']?_0x3caf09[_0x6dd9('0x14')][_0x6dd9('0x17')]||null:null,'include':_0x3caf09[_0x6dd9('0x14')]?_0x3caf09[_0x6dd9('0x14')][_0x6dd9('0x18')]?_[_0x6dd9('0x19')](_0x3caf09[_0x6dd9('0x14')][_0x6dd9('0x18')],function(_0x1fe23d){return{'model':db[_0x1fe23d['model']],'as':_0x1fe23d['as'],'attributes':_0x1fe23d[_0x6dd9('0x17')],'include':_0x1fe23d[_0x6dd9('0x18')]?_['map'](_0x1fe23d[_0x6dd9('0x18')],function(_0x45d9fe){return{'model':db[_0x45d9fe[_0x6dd9('0x1a')]],'as':_0x45d9fe['as'],'attributes':_0x45d9fe[_0x6dd9('0x17')],'include':_0x45d9fe[_0x6dd9('0x18')]?_[_0x6dd9('0x19')](_0x45d9fe['include'],function(_0x1fbeb5){return{'model':db[_0x1fbeb5[_0x6dd9('0x1a')]],'as':_0x1fbeb5['as'],'attributes':_0x1fbeb5['attributes']};}):[]};}):[]};}):[]:[]})[_0x6dd9('0x8')](function(_0xb6f86c){logger[_0x6dd9('0x1b')](_0x6dd9('0x12'),_0x3caf09);logger[_0x6dd9('0xa')](_0x6dd9('0x12'),_0x3caf09,JSON[_0x6dd9('0xd')](_0xb6f86c));_0x12b053(_0xb6f86c);})[_0x6dd9('0x1c')](function(_0xd33d29){logger['error'](_0x6dd9('0x12'),_0xd33d29[_0x6dd9('0x10')],_0x3caf09);_0x152b0c(_0x4f2c0e['error'](0x1f4,_0xd33d29['message']));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index fb4c744..849b04e 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 _0x8893=['show','/:id/users','getUsers','post','create','addUsers','put','delete','/:id','destroy','removeUsers','exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./squareProject.controller','get','isAuthenticated'];(function(_0x20a558,_0x160e0e){var _0x53d3f7=function(_0x259bd8){while(--_0x259bd8){_0x20a558['push'](_0x20a558['shift']());}};_0x53d3f7(++_0x160e0e);}(_0x8893,0x1ae));var _0x3889=function(_0x47e085,_0x14d47a){_0x47e085=_0x47e085-0x0;var _0x559315=_0x8893[_0x47e085];return _0x559315;};'use strict';var multer=require('multer');var util=require(_0x3889('0x0'));var path=require(_0x3889('0x1'));var timeout=require(_0x3889('0x2'));var express=require('express');var router=express[_0x3889('0x3')]();var fs_extra=require(_0x3889('0x4'));var auth=require(_0x3889('0x5'));var interaction=require(_0x3889('0x6'));var config=require('../../config/environment');var controller=require(_0x3889('0x7'));router[_0x3889('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x3889('0x8')]('/:id',auth[_0x3889('0x9')](),controller[_0x3889('0xa')]);router[_0x3889('0x8')](_0x3889('0xb'),auth['isAuthenticated'](),controller[_0x3889('0xc')]);router[_0x3889('0xd')]('/',auth['isAuthenticated'](),controller[_0x3889('0xe')]);router['post'](_0x3889('0xb'),auth[_0x3889('0x9')](),controller[_0x3889('0xf')]);router[_0x3889('0x10')]('/:id',auth[_0x3889('0x9')](),controller['update']);router[_0x3889('0x11')](_0x3889('0x12'),auth[_0x3889('0x9')](),controller[_0x3889('0x13')]);router['delete'](_0x3889('0xb'),auth[_0x3889('0x9')](),controller[_0x3889('0x14')]);module[_0x3889('0x15')]=router; \ No newline at end of file +var _0x41f6=['/:id','delete','removeUsers','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller','get','isAuthenticated','show','/:id/users','getUsers','post','create','addUsers','put'];(function(_0x31133c,_0x2003b1){var _0x4afba0=function(_0x4c4b61){while(--_0x4c4b61){_0x31133c['push'](_0x31133c['shift']());}};_0x4afba0(++_0x2003b1);}(_0x41f6,0x8e));var _0x641f=function(_0xda464c,_0x26e47d){_0xda464c=_0xda464c-0x0;var _0x19e222=_0x41f6[_0xda464c];return _0x19e222;};'use strict';var multer=require(_0x641f('0x0'));var util=require('util');var path=require(_0x641f('0x1'));var timeout=require(_0x641f('0x2'));var express=require(_0x641f('0x3'));var router=express[_0x641f('0x4')]();var fs_extra=require(_0x641f('0x5'));var auth=require(_0x641f('0x6'));var interaction=require(_0x641f('0x7'));var config=require(_0x641f('0x8'));var controller=require(_0x641f('0x9'));router[_0x641f('0xa')]('/',auth[_0x641f('0xb')](),controller['index']);router[_0x641f('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x641f('0xc')]);router[_0x641f('0xa')](_0x641f('0xd'),auth[_0x641f('0xb')](),controller[_0x641f('0xe')]);router[_0x641f('0xf')]('/',auth['isAuthenticated'](),controller[_0x641f('0x10')]);router[_0x641f('0xf')](_0x641f('0xd'),auth[_0x641f('0xb')](),controller[_0x641f('0x11')]);router[_0x641f('0x12')](_0x641f('0x13'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x641f('0x13'),auth[_0x641f('0xb')](),controller['destroy']);router[_0x641f('0x14')](_0x641f('0xd'),auth[_0x641f('0xb')](),controller[_0x641f('0x15')]);module[_0x641f('0x16')]=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index 21acff6..bd491c4 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 _0xfda2=['exports','STRING','name','BLOB','long','getDataValue','preproduction','toString','utf8','production','DATE','sequelize'];(function(_0x52ab8a,_0xee034b){var _0x5d6ddc=function(_0x283fa6){while(--_0x283fa6){_0x52ab8a['push'](_0x52ab8a['shift']());}};_0x5d6ddc(++_0xee034b);}(_0xfda2,0x8f));var _0x2fda=function(_0x34dea5,_0x548a2d){_0x34dea5=_0x34dea5-0x0;var _0xdc3a50=_0xfda2[_0x34dea5];return _0xdc3a50;};'use strict';var Sequelize=require(_0x2fda('0x0'));module[_0x2fda('0x1')]={'name':{'type':Sequelize[_0x2fda('0x2')],'unique':_0x2fda('0x3'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'notes':{'type':Sequelize['TEXT']},'preproduction':{'type':Sequelize[_0x2fda('0x4')](_0x2fda('0x5')),'get':function(){if(this['getDataValue']('preproduction')){return this[_0x2fda('0x6')](_0x2fda('0x7'))[_0x2fda('0x8')](_0x2fda('0x9'));}}},'production':{'type':Sequelize[_0x2fda('0x4')](_0x2fda('0x5')),'get':function(){if(this[_0x2fda('0x6')](_0x2fda('0xa'))){return this[_0x2fda('0x6')](_0x2fda('0xa'))[_0x2fda('0x8')](_0x2fda('0x9'));}}},'savedAt':{'type':Sequelize[_0x2fda('0xb')]},'publishedAt':{'type':Sequelize[_0x2fda('0xb')]}}; \ No newline at end of file +var _0x94cb=['getDataValue','preproduction','toString','utf8','production','DATE','sequelize','exports','STRING','TEXT','BLOB','long'];(function(_0x5efd23,_0x2fa9cf){var _0x4cf463=function(_0x124c1c){while(--_0x124c1c){_0x5efd23['push'](_0x5efd23['shift']());}};_0x4cf463(++_0x2fa9cf);}(_0x94cb,0x1c2));var _0xb94c=function(_0x1165ff,_0x375a85){_0x1165ff=_0x1165ff-0x0;var _0x169b79=_0x94cb[_0x1165ff];return _0x169b79;};'use strict';var Sequelize=require(_0xb94c('0x0'));module[_0xb94c('0x1')]={'name':{'type':Sequelize[_0xb94c('0x2')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0xb94c('0x2')]},'notes':{'type':Sequelize[_0xb94c('0x3')]},'preproduction':{'type':Sequelize[_0xb94c('0x4')](_0xb94c('0x5')),'get':function(){if(this[_0xb94c('0x6')](_0xb94c('0x7'))){return this['getDataValue']('preproduction')[_0xb94c('0x8')](_0xb94c('0x9'));}}},'production':{'type':Sequelize[_0xb94c('0x4')](_0xb94c('0x5')),'get':function(){if(this['getDataValue'](_0xb94c('0xa'))){return this[_0xb94c('0x6')](_0xb94c('0xa'))[_0xb94c('0x8')](_0xb94c('0x9'));}}},'savedAt':{'type':Sequelize[_0xb94c('0xb')]},'publishedAt':{'type':Sequelize[_0xb94c('0xb')]}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index 302782e..5a08eea 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 _0xec83=['UserProfileSection','userProfileId','autoAssociation','catch','params','addUsers','omit','ids','removeUsers','isArray','emit','userSquareProject:remove','getUsers','User','order','filter','hasOwnProperty','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','lodash','squel','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./squareProject.socket','sendStatus','status','offset','undefined','limit','count','json','apply','reject','update','then','get','SquareProjects','UserProfileResource','destroy','error','stack','name','index','map','SquareProject','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','nolimit','sort','where','filters','pick','options','includeAll','include','findAll','rows','show','rawAttributes','merge','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user'];(function(_0x2590fc,_0x676871){var _0x1defb7=function(_0x418aa4){while(--_0x418aa4){_0x2590fc['push'](_0x2590fc['shift']());}};_0x1defb7(++_0x676871);}(_0xec83,0x6d));var _0x3ec8=function(_0x1f1511,_0x4ea911){_0x1f1511=_0x1f1511-0x0;var _0x1d9ab8=_0xec83[_0x1f1511];return _0x1d9ab8;};'use strict';var emlformat=require(_0x3ec8('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3ec8('0x1'));var jsonpatch=require(_0x3ec8('0x2'));var rp=require(_0x3ec8('0x3'));var moment=require('moment');var BPromise=require(_0x3ec8('0x4'));var Mustache=require('mustache');var util=require(_0x3ec8('0x5'));var path=require(_0x3ec8('0x6'));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(_0x3ec8('0x7'));var squel=require(_0x3ec8('0x8'));var crypto=require('crypto');var jsforce=require(_0x3ec8('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x3ec8('0xa'));var querystring=require(_0x3ec8('0xb'));var Papa=require('papaparse');var Redis=require(_0x3ec8('0xc'));var authService=require(_0x3ec8('0xd'));var qs=require(_0x3ec8('0xe'));var as=require(_0x3ec8('0xf'));var hardwareService=require(_0x3ec8('0x10'));var logger=require('../../config/logger')(_0x3ec8('0x11'));var utils=require(_0x3ec8('0x12'));var config=require(_0x3ec8('0x13'));var licenseUtil=require(_0x3ec8('0x14'));var db=require(_0x3ec8('0x15'))['db'];config[_0x3ec8('0x16')]=_['defaults'](config[_0x3ec8('0x16')],{'host':_0x3ec8('0x17'),'port':0x18eb});var socket=require(_0x3ec8('0x18'))(new Redis(config[_0x3ec8('0x16')]));require(_0x3ec8('0x19'))['register'](socket);function respondWithStatusCode(_0x3f9438,_0x25c2f6){_0x25c2f6=_0x25c2f6||0xcc;return function(_0x2c96a4){if(_0x2c96a4){return _0x3f9438[_0x3ec8('0x1a')](_0x25c2f6);}return _0x3f9438[_0x3ec8('0x1b')](_0x25c2f6)['end']();};}function respondWithResult(_0x42eb7f,_0x217671){_0x217671=_0x217671||0xc8;return function(_0x3a8d6d){if(_0x3a8d6d){return _0x42eb7f[_0x3ec8('0x1b')](_0x217671)['json'](_0x3a8d6d);}};}function respondWithFilteredResult(_0x280b56,_0x10607b){return function(_0x59ad42){if(_0x59ad42){var _0x5b81c8=typeof _0x10607b[_0x3ec8('0x1c')]===_0x3ec8('0x1d')&&typeof _0x10607b[_0x3ec8('0x1e')]===_0x3ec8('0x1d');var _0x332421=_0x59ad42['count'];var _0x28135e=_0x5b81c8?0x0:_0x10607b[_0x3ec8('0x1c')];var _0x3960e3=_0x5b81c8?_0x59ad42[_0x3ec8('0x1f')]:_0x10607b[_0x3ec8('0x1c')]+_0x10607b['limit'];var _0x457f45;if(_0x3960e3>=_0x332421){_0x3960e3=_0x332421;_0x457f45=0xc8;}else{_0x457f45=0xce;}_0x280b56['status'](_0x457f45);return _0x280b56['set']('Content-Range',_0x28135e+'-'+_0x3960e3+'/'+_0x332421)[_0x3ec8('0x20')](_0x59ad42);}return null;};}function patchUpdates(_0x3330c5){return function(_0x188ec2){try{jsonpatch[_0x3ec8('0x21')](_0x188ec2,_0x3330c5,!![]);}catch(_0x1f549c){return BPromise[_0x3ec8('0x22')](_0x1f549c);}return _0x188ec2['save']();};}function saveUpdates(_0x4329c0,_0x106168){return function(_0x319056){if(_0x319056){return _0x319056[_0x3ec8('0x23')](_0x4329c0)['then'](function(_0x51a565){return _0x51a565;});}return null;};}function removeEntity(_0x26802c,_0x3c337b){return function(_0x45828c){if(_0x45828c){return _0x45828c['destroy']()[_0x3ec8('0x24')](function(){var _0x205fe9=_0x45828c[_0x3ec8('0x25')]({'plain':!![]});var _0x5ec797=_0x3ec8('0x26');return db[_0x3ec8('0x27')][_0x3ec8('0x28')]({'where':{'type':_0x5ec797,'resourceId':_0x205fe9['id']}})[_0x3ec8('0x24')](function(){return _0x45828c;});})[_0x3ec8('0x24')](function(){_0x26802c[_0x3ec8('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x148823,_0x43508d){return function(_0x293676){if(!_0x293676){_0x148823[_0x3ec8('0x1a')](0x194);}return _0x293676;};}function handleError(_0x1a8c39,_0x248700){_0x248700=_0x248700||0x1f4;return function(_0x27a7bb){logger[_0x3ec8('0x29')](_0x27a7bb[_0x3ec8('0x2a')]);if(_0x27a7bb['name']){delete _0x27a7bb[_0x3ec8('0x2b')];}_0x1a8c39[_0x3ec8('0x1b')](_0x248700)['send'](_0x27a7bb);};}exports[_0x3ec8('0x2c')]=function(_0xda71cc,_0x5f5dbe){var _0x3345ba={},_0x4587fe={},_0x468837={'count':0x0,'rows':[]};var _0x192cdd=_[_0x3ec8('0x2d')](db[_0x3ec8('0x2e')]['rawAttributes'],function(_0x1eb105){return{'name':_0x1eb105[_0x3ec8('0x2f')],'type':_0x1eb105[_0x3ec8('0x30')][_0x3ec8('0x31')]};});_0x4587fe['model']=_[_0x3ec8('0x2d')](_0x192cdd,_0x3ec8('0x2b'));_0x4587fe[_0x3ec8('0x32')]=_[_0x3ec8('0x33')](_0xda71cc['query']);_0x4587fe['filters']=_[_0x3ec8('0x34')](_0x4587fe[_0x3ec8('0x35')],_0x4587fe[_0x3ec8('0x32')]);_0x3345ba[_0x3ec8('0x36')]=_[_0x3ec8('0x34')](_0x4587fe[_0x3ec8('0x35')],qs[_0x3ec8('0x37')](_0xda71cc[_0x3ec8('0x32')]['fields']));_0x3345ba['attributes']=_0x3345ba['attributes'][_0x3ec8('0x38')]?_0x3345ba[_0x3ec8('0x36')]:_0x4587fe[_0x3ec8('0x35')];if(!_0xda71cc['query']['hasOwnProperty'](_0x3ec8('0x39'))){_0x3345ba[_0x3ec8('0x1e')]=qs[_0x3ec8('0x1e')](_0xda71cc[_0x3ec8('0x32')][_0x3ec8('0x1e')]);_0x3345ba['offset']=qs['offset'](_0xda71cc[_0x3ec8('0x32')][_0x3ec8('0x1c')]);}_0x3345ba['order']=qs[_0x3ec8('0x3a')](_0xda71cc[_0x3ec8('0x32')]['sort']);_0x3345ba[_0x3ec8('0x3b')]=qs[_0x3ec8('0x3c')](_[_0x3ec8('0x3d')](_0xda71cc[_0x3ec8('0x32')],_0x4587fe['filters']),_0x192cdd);if(_0xda71cc['query']['filter']){_0x3345ba[_0x3ec8('0x3b')]=_['merge'](_0x3345ba[_0x3ec8('0x3b')],{'$or':_[_0x3ec8('0x2d')](_0x192cdd,function(_0x434f27){if(_0x434f27[_0x3ec8('0x30')]!=='VIRTUAL'){var _0x222139={};_0x222139[_0x434f27[_0x3ec8('0x2b')]]={'$like':'%'+_0xda71cc[_0x3ec8('0x32')]['filter']+'%'};return _0x222139;}})});}_0x3345ba=_['merge']({},_0x3345ba,_0xda71cc[_0x3ec8('0x3e')]);var _0x1bdfaf={'where':_0x3345ba['where']};return db[_0x3ec8('0x2e')][_0x3ec8('0x1f')](_0x1bdfaf)[_0x3ec8('0x24')](function(_0x1cf0ba){_0x468837[_0x3ec8('0x1f')]=_0x1cf0ba;if(_0xda71cc[_0x3ec8('0x32')][_0x3ec8('0x3f')]){_0x3345ba[_0x3ec8('0x40')]=[{'all':!![]}];}return db[_0x3ec8('0x2e')][_0x3ec8('0x41')](_0x3345ba);})['then'](function(_0x5e995a){_0x468837[_0x3ec8('0x42')]=_0x5e995a;return _0x468837;})[_0x3ec8('0x24')](respondWithFilteredResult(_0x5f5dbe,_0x3345ba))['catch'](handleError(_0x5f5dbe,null));};exports[_0x3ec8('0x43')]=function(_0x499d86,_0x4f9f46){var _0x496046={'raw':![],'where':{'id':_0x499d86['params']['id']}},_0x49e816={};_0x49e816[_0x3ec8('0x35')]=_[_0x3ec8('0x33')](db[_0x3ec8('0x2e')][_0x3ec8('0x44')]);_0x49e816['query']=_[_0x3ec8('0x33')](_0x499d86[_0x3ec8('0x32')]);_0x49e816['filters']=_[_0x3ec8('0x34')](_0x49e816[_0x3ec8('0x35')],_0x49e816[_0x3ec8('0x32')]);_0x496046[_0x3ec8('0x36')]=_[_0x3ec8('0x34')](_0x49e816[_0x3ec8('0x35')],qs[_0x3ec8('0x37')](_0x499d86[_0x3ec8('0x32')]['fields']));_0x496046['attributes']=_0x496046[_0x3ec8('0x36')][_0x3ec8('0x38')]?_0x496046[_0x3ec8('0x36')]:_0x49e816[_0x3ec8('0x35')];if(_0x499d86[_0x3ec8('0x32')]['includeAll']){_0x496046[_0x3ec8('0x40')]=[{'all':!![]}];}_0x496046=_[_0x3ec8('0x45')]({},_0x496046,_0x499d86[_0x3ec8('0x3e')]);return db[_0x3ec8('0x2e')][_0x3ec8('0x46')](_0x496046)['then'](handleEntityNotFound(_0x4f9f46,null))[_0x3ec8('0x24')](respondWithResult(_0x4f9f46,null))['catch'](handleError(_0x4f9f46,null));};exports[_0x3ec8('0x47')]=function(_0x2d6966,_0x1ddee5){return db['SquareProject'][_0x3ec8('0x47')](_0x2d6966[_0x3ec8('0x48')],{})[_0x3ec8('0x24')](function(_0x27dc3d){var _0x4fb9f3=_0x2d6966['user']['get']({'plain':!![]});if(!_0x4fb9f3)throw new Error(_0x3ec8('0x49'));if(_0x4fb9f3['role']===_0x3ec8('0x4a')){var _0x5251aa=_0x27dc3d[_0x3ec8('0x25')]({'plain':!![]});var _0x80e270='SquareProjects';return db[_0x3ec8('0x4b')][_0x3ec8('0x46')]({'where':{'name':_0x80e270,'userProfileId':_0x4fb9f3[_0x3ec8('0x4c')]},'raw':!![]})[_0x3ec8('0x24')](function(_0x502847){if(_0x502847&&_0x502847[_0x3ec8('0x4d')]===0x0){return db[_0x3ec8('0x27')][_0x3ec8('0x47')]({'name':_0x5251aa[_0x3ec8('0x2b')],'resourceId':_0x5251aa['id'],'type':_0x502847[_0x3ec8('0x2b')],'sectionId':_0x502847['id']},{})[_0x3ec8('0x24')](function(){return _0x27dc3d;});}else{return _0x27dc3d;}})[_0x3ec8('0x4e')](function(_0x435339){logger[_0x3ec8('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x435339);throw _0x435339;});}return _0x27dc3d;})['then'](respondWithResult(_0x1ddee5,0xc9))['catch'](handleError(_0x1ddee5,null));};exports[_0x3ec8('0x23')]=function(_0x26175e,_0x1b58ed){if(_0x26175e[_0x3ec8('0x48')]['id']){delete _0x26175e[_0x3ec8('0x48')]['id'];}return db[_0x3ec8('0x2e')]['find']({'where':{'id':_0x26175e[_0x3ec8('0x4f')]['id']}})[_0x3ec8('0x24')](handleEntityNotFound(_0x1b58ed,null))[_0x3ec8('0x24')](saveUpdates(_0x26175e['body'],null))[_0x3ec8('0x24')](respondWithResult(_0x1b58ed,null))['catch'](handleError(_0x1b58ed,null));};exports['destroy']=function(_0x584f4f,_0x13c3ef){return db[_0x3ec8('0x2e')][_0x3ec8('0x46')]({'where':{'id':_0x584f4f['params']['id']}})[_0x3ec8('0x24')](handleEntityNotFound(_0x13c3ef,null))[_0x3ec8('0x24')](removeEntity(_0x13c3ef,null))[_0x3ec8('0x4e')](handleError(_0x13c3ef,null));};exports[_0x3ec8('0x50')]=function(_0x218d2d,_0x19f1d5,_0x48093a){return db['SquareProject'][_0x3ec8('0x46')]({'where':{'id':_0x218d2d[_0x3ec8('0x4f')]['id']}})['then'](handleEntityNotFound(_0x19f1d5,null))[_0x3ec8('0x24')](function(_0x1edb9c){if(_0x1edb9c){return _0x1edb9c[_0x3ec8('0x50')](_0x218d2d[_0x3ec8('0x48')]['ids'],_[_0x3ec8('0x51')](_0x218d2d[_0x3ec8('0x48')],[_0x3ec8('0x52'),'id'])||{});}})[_0x3ec8('0x24')](respondWithResult(_0x19f1d5,null))[_0x3ec8('0x4e')](handleError(_0x19f1d5,null));};exports['removeUsers']=function(_0x376030,_0xb4e365,_0x3ffb10){return db[_0x3ec8('0x2e')]['find']({'where':{'id':_0x376030[_0x3ec8('0x4f')]['id']}})[_0x3ec8('0x24')](handleEntityNotFound(_0xb4e365,null))[_0x3ec8('0x24')](function(_0x44a259){if(_0x44a259){return _0x44a259[_0x3ec8('0x53')](_0x376030[_0x3ec8('0x32')]['ids'])['then'](function(){if(_[_0x3ec8('0x54')](_0x376030[_0x3ec8('0x32')][_0x3ec8('0x52')])){for(var _0x230044=0x0;_0x230044<_0x376030[_0x3ec8('0x32')][_0x3ec8('0x52')][_0x3ec8('0x38')];_0x230044+=0x1){socket[_0x3ec8('0x55')](_0x3ec8('0x56'),{'UserId':Number(_0x376030[_0x3ec8('0x32')]['ids'][_0x230044]),'SquareProjectId':Number(_0x376030['params']['id'])});}}else{socket[_0x3ec8('0x55')](_0x3ec8('0x56'),{'UserId':Number(_0x376030[_0x3ec8('0x32')]['ids']),'SquareProjectId':Number(_0x376030[_0x3ec8('0x4f')]['id'])});}});}})['then'](respondWithStatusCode(_0xb4e365,null))[_0x3ec8('0x4e')](handleError(_0xb4e365,null));};exports[_0x3ec8('0x57')]=function(_0x19afcc,_0x2224e6,_0x183b34){var _0x1cd334={};var _0x2592be={};var _0x8a707d;var _0x29359d;return db['SquareProject']['findOne']({'where':{'id':_0x19afcc[_0x3ec8('0x4f')]['id']}})['then'](handleEntityNotFound(_0x2224e6,null))[_0x3ec8('0x24')](function(_0x14fb80){if(_0x14fb80){_0x8a707d=_0x14fb80;_0x2592be['model']=_[_0x3ec8('0x33')](db[_0x3ec8('0x58')][_0x3ec8('0x44')]);_0x2592be[_0x3ec8('0x32')]=_[_0x3ec8('0x33')](_0x19afcc[_0x3ec8('0x32')]);_0x2592be[_0x3ec8('0x3c')]=_[_0x3ec8('0x34')](_0x2592be[_0x3ec8('0x35')],_0x2592be[_0x3ec8('0x32')]);_0x1cd334[_0x3ec8('0x36')]=_[_0x3ec8('0x34')](_0x2592be['model'],qs[_0x3ec8('0x37')](_0x19afcc[_0x3ec8('0x32')][_0x3ec8('0x37')]));_0x1cd334[_0x3ec8('0x36')]=_0x1cd334[_0x3ec8('0x36')]['length']?_0x1cd334[_0x3ec8('0x36')]:_0x2592be[_0x3ec8('0x35')];_0x1cd334[_0x3ec8('0x59')]=qs[_0x3ec8('0x3a')](_0x19afcc[_0x3ec8('0x32')][_0x3ec8('0x3a')]);_0x1cd334['where']=qs[_0x3ec8('0x3c')](_[_0x3ec8('0x3d')](_0x19afcc[_0x3ec8('0x32')],_0x2592be[_0x3ec8('0x3c')]));if(_0x19afcc['query'][_0x3ec8('0x5a')]){_0x1cd334[_0x3ec8('0x3b')]=_[_0x3ec8('0x45')](_0x1cd334[_0x3ec8('0x3b')],{'$or':_[_0x3ec8('0x2d')](_0x1cd334[_0x3ec8('0x36')],function(_0x28a20c){var _0x4e4ede={};_0x4e4ede[_0x28a20c]={'$like':'%'+_0x19afcc['query']['filter']+'%'};return _0x4e4ede;})});}_0x1cd334=_[_0x3ec8('0x45')]({},_0x1cd334,_0x19afcc[_0x3ec8('0x3e')]);return _0x8a707d['getUsers'](_0x1cd334);}})[_0x3ec8('0x24')](function(_0x3290fc){if(_0x3290fc){_0x29359d=_0x3290fc[_0x3ec8('0x38')];if(!_0x19afcc[_0x3ec8('0x32')][_0x3ec8('0x5b')](_0x3ec8('0x39'))){_0x1cd334[_0x3ec8('0x1e')]=qs[_0x3ec8('0x1e')](_0x19afcc[_0x3ec8('0x32')]['limit']);_0x1cd334[_0x3ec8('0x1c')]=qs[_0x3ec8('0x1c')](_0x19afcc[_0x3ec8('0x32')][_0x3ec8('0x1c')]);}return _0x8a707d[_0x3ec8('0x57')](_0x1cd334);}})[_0x3ec8('0x24')](function(_0xe4b30e){if(_0xe4b30e){return _0xe4b30e?{'count':_0x29359d,'rows':_0xe4b30e}:null;}})[_0x3ec8('0x24')](respondWithResult(_0x2224e6,null))[_0x3ec8('0x4e')](handleError(_0x2224e6,null));}; \ No newline at end of file +var _0x8bd9=['bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','reject','update','then','get','SquareProjects','UserProfileResource','error','stack','send','index','SquareProject','rawAttributes','type','key','model','map','name','keys','query','intersection','fields','attributes','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','catch','show','params','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','addUsers','ids','removeUsers','isArray','emit','userSquareProject:remove','getUsers','findOne','User','order','hasOwnProperty','eml-format','zip-dir','fast-json-patch','request-promise','moment'];(function(_0xfa5eae,_0x128ae1){var _0x519f2b=function(_0x5ec3a6){while(--_0x5ec3a6){_0xfa5eae['push'](_0xfa5eae['shift']());}};_0x519f2b(++_0x128ae1);}(_0x8bd9,0x17f));var _0x98bd=function(_0x5806c3,_0x5105d8){_0x5806c3=_0x5806c3-0x0;var _0x48ac77=_0x8bd9[_0x5806c3];return _0x48ac77;};'use strict';var emlformat=require(_0x98bd('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x98bd('0x1'));var jsonpatch=require(_0x98bd('0x2'));var rp=require(_0x98bd('0x3'));var moment=require(_0x98bd('0x4'));var BPromise=require(_0x98bd('0x5'));var Mustache=require(_0x98bd('0x6'));var util=require(_0x98bd('0x7'));var path=require(_0x98bd('0x8'));var sox=require(_0x98bd('0x9'));var csv=require(_0x98bd('0xa'));var ejs=require(_0x98bd('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x98bd('0xc'));var squel=require(_0x98bd('0xd'));var crypto=require(_0x98bd('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x98bd('0xa'));var querystring=require(_0x98bd('0xf'));var Papa=require(_0x98bd('0x10'));var Redis=require(_0x98bd('0x11'));var authService=require(_0x98bd('0x12'));var qs=require(_0x98bd('0x13'));var as=require(_0x98bd('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x98bd('0x15'))(_0x98bd('0x16'));var utils=require(_0x98bd('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x98bd('0x18'));var db=require(_0x98bd('0x19'))['db'];config[_0x98bd('0x1a')]=_['defaults'](config[_0x98bd('0x1a')],{'host':_0x98bd('0x1b'),'port':0x18eb});var socket=require(_0x98bd('0x1c'))(new Redis(config[_0x98bd('0x1a')]));require('./squareProject.socket')['register'](socket);function respondWithStatusCode(_0x5e1093,_0x1a04e4){_0x1a04e4=_0x1a04e4||0xcc;return function(_0x560dae){if(_0x560dae){return _0x5e1093[_0x98bd('0x1d')](_0x1a04e4);}return _0x5e1093['status'](_0x1a04e4)[_0x98bd('0x1e')]();};}function respondWithResult(_0x3dae53,_0x17d596){_0x17d596=_0x17d596||0xc8;return function(_0x1d0194){if(_0x1d0194){return _0x3dae53['status'](_0x17d596)[_0x98bd('0x1f')](_0x1d0194);}};}function respondWithFilteredResult(_0x3ac95a,_0x337659){return function(_0x3fb044){if(_0x3fb044){var _0x5d5dd6=typeof _0x337659[_0x98bd('0x20')]===_0x98bd('0x21')&&typeof _0x337659[_0x98bd('0x22')]===_0x98bd('0x21');var _0x9f6f73=_0x3fb044[_0x98bd('0x23')];var _0x4a274b=_0x5d5dd6?0x0:_0x337659[_0x98bd('0x20')];var _0x3b7a79=_0x5d5dd6?_0x3fb044[_0x98bd('0x23')]:_0x337659[_0x98bd('0x20')]+_0x337659[_0x98bd('0x22')];var _0x290b5b;if(_0x3b7a79>=_0x9f6f73){_0x3b7a79=_0x9f6f73;_0x290b5b=0xc8;}else{_0x290b5b=0xce;}_0x3ac95a[_0x98bd('0x24')](_0x290b5b);return _0x3ac95a[_0x98bd('0x25')](_0x98bd('0x26'),_0x4a274b+'-'+_0x3b7a79+'/'+_0x9f6f73)[_0x98bd('0x1f')](_0x3fb044);}return null;};}function patchUpdates(_0x197405){return function(_0xb001e2){try{jsonpatch['apply'](_0xb001e2,_0x197405,!![]);}catch(_0x545162){return BPromise[_0x98bd('0x27')](_0x545162);}return _0xb001e2['save']();};}function saveUpdates(_0x331239,_0xa0cdf5){return function(_0x28a7a2){if(_0x28a7a2){return _0x28a7a2[_0x98bd('0x28')](_0x331239)[_0x98bd('0x29')](function(_0x4546dd){return _0x4546dd;});}return null;};}function removeEntity(_0xb48843,_0x585f5d){return function(_0x3475a3){if(_0x3475a3){return _0x3475a3['destroy']()[_0x98bd('0x29')](function(){var _0x16fb8c=_0x3475a3[_0x98bd('0x2a')]({'plain':!![]});var _0xfce8b4=_0x98bd('0x2b');return db[_0x98bd('0x2c')]['destroy']({'where':{'type':_0xfce8b4,'resourceId':_0x16fb8c['id']}})['then'](function(){return _0x3475a3;});})['then'](function(){_0xb48843[_0x98bd('0x24')](0xcc)[_0x98bd('0x1e')]();});}};}function handleEntityNotFound(_0x108671,_0x1db4dc){return function(_0x403de6){if(!_0x403de6){_0x108671[_0x98bd('0x1d')](0x194);}return _0x403de6;};}function handleError(_0x346b73,_0x2d67d3){_0x2d67d3=_0x2d67d3||0x1f4;return function(_0x4635b7){logger[_0x98bd('0x2d')](_0x4635b7[_0x98bd('0x2e')]);if(_0x4635b7['name']){delete _0x4635b7['name'];}_0x346b73[_0x98bd('0x24')](_0x2d67d3)[_0x98bd('0x2f')](_0x4635b7);};}exports[_0x98bd('0x30')]=function(_0x53d3b1,_0x549193){var _0x1dc242={},_0x4c3b45={},_0x5535eb={'count':0x0,'rows':[]};var _0x2068aa=_['map'](db[_0x98bd('0x31')][_0x98bd('0x32')],function(_0x50c706){return{'name':_0x50c706['fieldName'],'type':_0x50c706[_0x98bd('0x33')][_0x98bd('0x34')]};});_0x4c3b45[_0x98bd('0x35')]=_[_0x98bd('0x36')](_0x2068aa,_0x98bd('0x37'));_0x4c3b45['query']=_[_0x98bd('0x38')](_0x53d3b1[_0x98bd('0x39')]);_0x4c3b45['filters']=_[_0x98bd('0x3a')](_0x4c3b45[_0x98bd('0x35')],_0x4c3b45[_0x98bd('0x39')]);_0x1dc242['attributes']=_[_0x98bd('0x3a')](_0x4c3b45['model'],qs[_0x98bd('0x3b')](_0x53d3b1['query']['fields']));_0x1dc242[_0x98bd('0x3c')]=_0x1dc242['attributes']['length']?_0x1dc242['attributes']:_0x4c3b45[_0x98bd('0x35')];if(!_0x53d3b1['query']['hasOwnProperty'](_0x98bd('0x3d'))){_0x1dc242[_0x98bd('0x22')]=qs['limit'](_0x53d3b1[_0x98bd('0x39')][_0x98bd('0x22')]);_0x1dc242[_0x98bd('0x20')]=qs[_0x98bd('0x20')](_0x53d3b1[_0x98bd('0x39')][_0x98bd('0x20')]);}_0x1dc242['order']=qs[_0x98bd('0x3e')](_0x53d3b1[_0x98bd('0x39')][_0x98bd('0x3e')]);_0x1dc242[_0x98bd('0x3f')]=qs[_0x98bd('0x40')](_[_0x98bd('0x41')](_0x53d3b1[_0x98bd('0x39')],_0x4c3b45[_0x98bd('0x40')]),_0x2068aa);if(_0x53d3b1[_0x98bd('0x39')][_0x98bd('0x42')]){_0x1dc242[_0x98bd('0x3f')]=_[_0x98bd('0x43')](_0x1dc242[_0x98bd('0x3f')],{'$or':_['map'](_0x2068aa,function(_0x2ee2e6){if(_0x2ee2e6[_0x98bd('0x33')]!==_0x98bd('0x44')){var _0x4d6b42={};_0x4d6b42[_0x2ee2e6[_0x98bd('0x37')]]={'$like':'%'+_0x53d3b1[_0x98bd('0x39')][_0x98bd('0x42')]+'%'};return _0x4d6b42;}})});}_0x1dc242=_[_0x98bd('0x43')]({},_0x1dc242,_0x53d3b1[_0x98bd('0x45')]);var _0x2c3dfe={'where':_0x1dc242[_0x98bd('0x3f')]};return db['SquareProject'][_0x98bd('0x23')](_0x2c3dfe)[_0x98bd('0x29')](function(_0x1b9ac1){_0x5535eb[_0x98bd('0x23')]=_0x1b9ac1;if(_0x53d3b1['query'][_0x98bd('0x46')]){_0x1dc242['include']=[{'all':!![]}];}return db[_0x98bd('0x31')]['findAll'](_0x1dc242);})[_0x98bd('0x29')](function(_0xa00b5b){_0x5535eb['rows']=_0xa00b5b;return _0x5535eb;})[_0x98bd('0x29')](respondWithFilteredResult(_0x549193,_0x1dc242))[_0x98bd('0x47')](handleError(_0x549193,null));};exports[_0x98bd('0x48')]=function(_0x3ee2e4,_0x454a98){var _0x1224a5={'raw':![],'where':{'id':_0x3ee2e4[_0x98bd('0x49')]['id']}},_0x1a99d8={};_0x1a99d8['model']=_['keys'](db[_0x98bd('0x31')][_0x98bd('0x32')]);_0x1a99d8[_0x98bd('0x39')]=_[_0x98bd('0x38')](_0x3ee2e4[_0x98bd('0x39')]);_0x1a99d8[_0x98bd('0x40')]=_[_0x98bd('0x3a')](_0x1a99d8[_0x98bd('0x35')],_0x1a99d8[_0x98bd('0x39')]);_0x1224a5[_0x98bd('0x3c')]=_['intersection'](_0x1a99d8[_0x98bd('0x35')],qs[_0x98bd('0x3b')](_0x3ee2e4['query'][_0x98bd('0x3b')]));_0x1224a5[_0x98bd('0x3c')]=_0x1224a5[_0x98bd('0x3c')][_0x98bd('0x4a')]?_0x1224a5[_0x98bd('0x3c')]:_0x1a99d8['model'];if(_0x3ee2e4[_0x98bd('0x39')][_0x98bd('0x46')]){_0x1224a5['include']=[{'all':!![]}];}_0x1224a5=_[_0x98bd('0x43')]({},_0x1224a5,_0x3ee2e4['options']);return db[_0x98bd('0x31')][_0x98bd('0x4b')](_0x1224a5)[_0x98bd('0x29')](handleEntityNotFound(_0x454a98,null))[_0x98bd('0x29')](respondWithResult(_0x454a98,null))[_0x98bd('0x47')](handleError(_0x454a98,null));};exports[_0x98bd('0x4c')]=function(_0x3a558e,_0xab5abd){return db[_0x98bd('0x31')][_0x98bd('0x4c')](_0x3a558e[_0x98bd('0x4d')],{})[_0x98bd('0x29')](function(_0x2ee364){var _0x26ceba=_0x3a558e[_0x98bd('0x4e')][_0x98bd('0x2a')]({'plain':!![]});if(!_0x26ceba)throw new Error(_0x98bd('0x4f'));if(_0x26ceba[_0x98bd('0x50')]===_0x98bd('0x4e')){var _0x49e347=_0x2ee364[_0x98bd('0x2a')]({'plain':!![]});var _0x5e6b2b=_0x98bd('0x2b');return db[_0x98bd('0x51')][_0x98bd('0x4b')]({'where':{'name':_0x5e6b2b,'userProfileId':_0x26ceba[_0x98bd('0x52')]},'raw':!![]})[_0x98bd('0x29')](function(_0x489336){if(_0x489336&&_0x489336[_0x98bd('0x53')]===0x0){return db[_0x98bd('0x2c')][_0x98bd('0x4c')]({'name':_0x49e347[_0x98bd('0x37')],'resourceId':_0x49e347['id'],'type':_0x489336[_0x98bd('0x37')],'sectionId':_0x489336['id']},{})[_0x98bd('0x29')](function(){return _0x2ee364;});}else{return _0x2ee364;}})[_0x98bd('0x47')](function(_0x503515){logger[_0x98bd('0x2d')](_0x98bd('0x54'),_0x503515);throw _0x503515;});}return _0x2ee364;})[_0x98bd('0x29')](respondWithResult(_0xab5abd,0xc9))['catch'](handleError(_0xab5abd,null));};exports[_0x98bd('0x28')]=function(_0x1d88c8,_0x256603){if(_0x1d88c8[_0x98bd('0x4d')]['id']){delete _0x1d88c8['body']['id'];}return db[_0x98bd('0x31')][_0x98bd('0x4b')]({'where':{'id':_0x1d88c8['params']['id']}})['then'](handleEntityNotFound(_0x256603,null))[_0x98bd('0x29')](saveUpdates(_0x1d88c8['body'],null))[_0x98bd('0x29')](respondWithResult(_0x256603,null))[_0x98bd('0x47')](handleError(_0x256603,null));};exports[_0x98bd('0x55')]=function(_0x5d3a67,_0x2510f8){return db[_0x98bd('0x31')]['find']({'where':{'id':_0x5d3a67[_0x98bd('0x49')]['id']}})[_0x98bd('0x29')](handleEntityNotFound(_0x2510f8,null))['then'](removeEntity(_0x2510f8,null))[_0x98bd('0x47')](handleError(_0x2510f8,null));};exports['addUsers']=function(_0x409972,_0x5d140f,_0x5ea127){return db['SquareProject'][_0x98bd('0x4b')]({'where':{'id':_0x409972[_0x98bd('0x49')]['id']}})[_0x98bd('0x29')](handleEntityNotFound(_0x5d140f,null))[_0x98bd('0x29')](function(_0x2806c7){if(_0x2806c7){return _0x2806c7[_0x98bd('0x56')](_0x409972[_0x98bd('0x4d')]['ids'],_['omit'](_0x409972['body'],[_0x98bd('0x57'),'id'])||{});}})['then'](respondWithResult(_0x5d140f,null))['catch'](handleError(_0x5d140f,null));};exports['removeUsers']=function(_0x4677a9,_0x4910ba,_0x32a271){return db[_0x98bd('0x31')][_0x98bd('0x4b')]({'where':{'id':_0x4677a9[_0x98bd('0x49')]['id']}})[_0x98bd('0x29')](handleEntityNotFound(_0x4910ba,null))[_0x98bd('0x29')](function(_0x25e2b8){if(_0x25e2b8){return _0x25e2b8[_0x98bd('0x58')](_0x4677a9[_0x98bd('0x39')]['ids'])['then'](function(){if(_[_0x98bd('0x59')](_0x4677a9['query'][_0x98bd('0x57')])){for(var _0x1a634e=0x0;_0x1a634e<_0x4677a9[_0x98bd('0x39')][_0x98bd('0x57')][_0x98bd('0x4a')];_0x1a634e+=0x1){socket[_0x98bd('0x5a')](_0x98bd('0x5b'),{'UserId':Number(_0x4677a9['query'][_0x98bd('0x57')][_0x1a634e]),'SquareProjectId':Number(_0x4677a9[_0x98bd('0x49')]['id'])});}}else{socket[_0x98bd('0x5a')]('userSquareProject:remove',{'UserId':Number(_0x4677a9[_0x98bd('0x39')]['ids']),'SquareProjectId':Number(_0x4677a9['params']['id'])});}});}})[_0x98bd('0x29')](respondWithStatusCode(_0x4910ba,null))[_0x98bd('0x47')](handleError(_0x4910ba,null));};exports[_0x98bd('0x5c')]=function(_0x33a928,_0xd3d882,_0x4ccc60){var _0x10cfdf={};var _0x50f847={};var _0x57a053;var _0x5bda4a;return db[_0x98bd('0x31')][_0x98bd('0x5d')]({'where':{'id':_0x33a928[_0x98bd('0x49')]['id']}})[_0x98bd('0x29')](handleEntityNotFound(_0xd3d882,null))[_0x98bd('0x29')](function(_0x31404b){if(_0x31404b){_0x57a053=_0x31404b;_0x50f847[_0x98bd('0x35')]=_[_0x98bd('0x38')](db[_0x98bd('0x5e')]['rawAttributes']);_0x50f847[_0x98bd('0x39')]=_[_0x98bd('0x38')](_0x33a928[_0x98bd('0x39')]);_0x50f847[_0x98bd('0x40')]=_[_0x98bd('0x3a')](_0x50f847[_0x98bd('0x35')],_0x50f847[_0x98bd('0x39')]);_0x10cfdf[_0x98bd('0x3c')]=_['intersection'](_0x50f847['model'],qs[_0x98bd('0x3b')](_0x33a928[_0x98bd('0x39')][_0x98bd('0x3b')]));_0x10cfdf[_0x98bd('0x3c')]=_0x10cfdf[_0x98bd('0x3c')][_0x98bd('0x4a')]?_0x10cfdf[_0x98bd('0x3c')]:_0x50f847[_0x98bd('0x35')];_0x10cfdf[_0x98bd('0x5f')]=qs[_0x98bd('0x3e')](_0x33a928[_0x98bd('0x39')][_0x98bd('0x3e')]);_0x10cfdf[_0x98bd('0x3f')]=qs['filters'](_[_0x98bd('0x41')](_0x33a928[_0x98bd('0x39')],_0x50f847[_0x98bd('0x40')]));if(_0x33a928[_0x98bd('0x39')][_0x98bd('0x42')]){_0x10cfdf[_0x98bd('0x3f')]=_[_0x98bd('0x43')](_0x10cfdf[_0x98bd('0x3f')],{'$or':_['map'](_0x10cfdf[_0x98bd('0x3c')],function(_0x16a869){var _0x302b8d={};_0x302b8d[_0x16a869]={'$like':'%'+_0x33a928['query'][_0x98bd('0x42')]+'%'};return _0x302b8d;})});}_0x10cfdf=_[_0x98bd('0x43')]({},_0x10cfdf,_0x33a928['options']);return _0x57a053['getUsers'](_0x10cfdf);}})[_0x98bd('0x29')](function(_0x5cb784){if(_0x5cb784){_0x5bda4a=_0x5cb784[_0x98bd('0x4a')];if(!_0x33a928[_0x98bd('0x39')][_0x98bd('0x60')](_0x98bd('0x3d'))){_0x10cfdf[_0x98bd('0x22')]=qs[_0x98bd('0x22')](_0x33a928[_0x98bd('0x39')]['limit']);_0x10cfdf[_0x98bd('0x20')]=qs['offset'](_0x33a928['query'][_0x98bd('0x20')]);}return _0x57a053['getUsers'](_0x10cfdf);}})[_0x98bd('0x29')](function(_0x3414fb){if(_0x3414fb){return _0x3414fb?{'count':_0x5bda4a,'rows':_0x3414fb}:null;}})[_0x98bd('0x29')](respondWithResult(_0xd3d882,null))[_0x98bd('0x47')](handleError(_0xd3d882,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index 3ad45e1..7229619 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 _0x529c=['exports','events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x529c,0xdd));var _0xc529=function(_0x2d6c96,_0x3515d2){_0x2d6c96=_0x2d6c96-0x0;var _0x2e99aa=_0x529c[_0x2d6c96];return _0x2e99aa;};'use strict';var EventEmitter=require(_0xc529('0x0'));var SquareProject=require(_0xc529('0x1'))['db']['SquareProject'];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0xc529('0x2')](0x0);var events={'afterCreate':_0xc529('0x3'),'afterUpdate':_0xc529('0x4'),'afterDestroy':_0xc529('0x5')};function emitEvent(_0x315b5b){return function(_0x40c5f0,_0x3bb9af,_0x5adca8){SquareProjectEvents[_0xc529('0x6')](_0x315b5b+':'+_0x40c5f0['id'],_0x40c5f0);SquareProjectEvents[_0xc529('0x6')](_0x315b5b,_0x40c5f0);_0x5adca8(null);};}for(var e in events){if(events[_0xc529('0x7')](e)){var event=events[e];SquareProject[_0xc529('0x8')](e,emitEvent(event));}}module[_0xc529('0x9')]=SquareProjectEvents; \ No newline at end of file +var _0xfbfc=['exports','events','../../mysqldb','SquareProject','setMaxListeners','save','update','remove','emit'];(function(_0x10523e,_0x7a662a){var _0x143762=function(_0x1a7c71){while(--_0x1a7c71){_0x10523e['push'](_0x10523e['shift']());}};_0x143762(++_0x7a662a);}(_0xfbfc,0xb5));var _0xcfbf=function(_0x161803,_0x5e7af0){_0x161803=_0x161803-0x0;var _0x41b215=_0xfbfc[_0x161803];return _0x41b215;};'use strict';var EventEmitter=require(_0xcfbf('0x0'));var SquareProject=require(_0xcfbf('0x1'))['db'][_0xcfbf('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0xcfbf('0x3')](0x0);var events={'afterCreate':_0xcfbf('0x4'),'afterUpdate':_0xcfbf('0x5'),'afterDestroy':_0xcfbf('0x6')};function emitEvent(_0xb86d72){return function(_0x4bf3c7,_0x56e134,_0x5e17e3){SquareProjectEvents[_0xcfbf('0x7')](_0xb86d72+':'+_0x4bf3c7['id'],_0x4bf3c7);SquareProjectEvents['emit'](_0xb86d72,_0x4bf3c7);_0x5e17e3(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SquareProject['hook'](e,emitEvent(event));}}module[_0xcfbf('0x8')]=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index da92959..1bd45c0 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 _0xb0fa=['bluebird','request-promise','rimraf','define','square_projects','changed','preproduction','savedAt','format','production','publishedAt','YYYY-MM-DD\x20HH:mm:ss','util','api'];(function(_0x4d2652,_0x4dc964){var _0x1a37ac=function(_0x9f8454){while(--_0x9f8454){_0x4d2652['push'](_0x4d2652['shift']());}};_0x1a37ac(++_0x4dc964);}(_0xb0fa,0xa6));var _0xab0f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb0fa[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xab0f('0x0'));var logger=require('../../config/logger')(_0xab0f('0x1'));var moment=require('moment');var BPromise=require(_0xab0f('0x2'));var rp=require(_0xab0f('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xab0f('0x4'));var config=require('../../config/environment');var attributes=require('./squareProject.attributes');module['exports']=function(_0x2d467d,_0x15df90){return _0x2d467d[_0xab0f('0x5')]('SquareProject',attributes,{'tableName':_0xab0f('0x6'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2f8ccf,_0x1e9922,_0x18ed62){if(_0x2f8ccf[_0xab0f('0x7')](_0xab0f('0x8'))){_0x2f8ccf[_0xab0f('0x9')]=moment()[_0xab0f('0xa')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x2f8ccf[_0xab0f('0x7')](_0xab0f('0xb'))){_0x2f8ccf[_0xab0f('0xc')]=moment()[_0xab0f('0xa')](_0xab0f('0xd'));}_0x18ed62(null,_0x2f8ccf);}}});}; \ No newline at end of file +var _0x4905=['changed','production','publishedAt','util','api','moment','bluebird','path','../../config/environment','./squareProject.attributes','exports','define','SquareProject','square_projects','savedAt','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x261c5a,_0x1c2dfa){var _0x4d8c6c=function(_0x54baba){while(--_0x54baba){_0x261c5a['push'](_0x261c5a['shift']());}};_0x4d8c6c(++_0x1c2dfa);}(_0x4905,0xcf));var _0x5490=function(_0x3e531a,_0x28a82a){_0x3e531a=_0x3e531a-0x0;var _0x3c2574=_0x4905[_0x3e531a];return _0x3c2574;};'use strict';var _=require('lodash');var util=require(_0x5490('0x0'));var logger=require('../../config/logger')(_0x5490('0x1'));var moment=require(_0x5490('0x2'));var BPromise=require(_0x5490('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5490('0x4'));var rimraf=require('rimraf');var config=require(_0x5490('0x5'));var attributes=require(_0x5490('0x6'));module[_0x5490('0x7')]=function(_0x469345,_0x39bae8){return _0x469345[_0x5490('0x8')](_0x5490('0x9'),attributes,{'tableName':_0x5490('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x45c6b1,_0x4fd877,_0x2a66cf){if(_0x45c6b1['changed']('preproduction')){_0x45c6b1[_0x5490('0xb')]=moment()[_0x5490('0xc')](_0x5490('0xd'));}if(_0x45c6b1[_0x5490('0xe')](_0x5490('0xf'))){_0x45c6b1[_0x5490('0x10')]=moment()[_0x5490('0xc')](_0x5490('0xd'));}_0x2a66cf(null,_0x45c6b1);}}});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index d12bba1..654d60f 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 _0x7dca=['localhost','socket.io-emitter','./squareProject.socket','then','info','SquareProject,\x20%s,\x20%s','request\x20sent','SquareProject,\x20%s,\x20%s,\x20%s','error','message','result','catch','ShowSquareProject','find','options','raw','include','map','model','attributes','debug','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis'];(function(_0x23e7c1,_0x35110c){var _0x1add43=function(_0x238918){while(--_0x238918){_0x23e7c1['push'](_0x23e7c1['shift']());}};_0x1add43(++_0x35110c);}(_0x7dca,0x13e));var _0xa7dc=function(_0x280f4a,_0x2ed8d6){_0x280f4a=_0x280f4a-0x0;var _0x1bb157=_0x7dca[_0x280f4a];return _0x1bb157;};'use strict';var _=require(_0xa7dc('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xa7dc('0x1'));var rs=require(_0xa7dc('0x2'));var fs=require('fs');var Redis=require(_0xa7dc('0x3'));var db=require(_0xa7dc('0x4'))['db'];var utils=require(_0xa7dc('0x5'));var logger=require(_0xa7dc('0x6'))('rpc');var config=require(_0xa7dc('0x7'));var jayson=require(_0xa7dc('0x8'));var client=jayson[_0xa7dc('0x9')][_0xa7dc('0xa')]({'port':0x232a});config[_0xa7dc('0xb')]=_['defaults'](config[_0xa7dc('0xb')],{'host':_0xa7dc('0xc'),'port':0x18eb});var socket=require(_0xa7dc('0xd'))(new Redis(config[_0xa7dc('0xb')]));require(_0xa7dc('0xe'))['register'](socket);function respondWithRpcPromise(_0x3a1547,_0x565c30,_0x1f0c33){return new BPromise(function(_0x272153,_0xb2d756){return client['request'](_0x3a1547,_0x1f0c33)[_0xa7dc('0xf')](function(_0x3aad81){logger[_0xa7dc('0x10')](_0xa7dc('0x11'),_0x565c30,_0xa7dc('0x12'));logger['debug'](_0xa7dc('0x13'),_0x565c30,'request\x20sent',JSON['stringify'](_0x3aad81));if(_0x3aad81[_0xa7dc('0x14')]){if(_0x3aad81[_0xa7dc('0x14')]['code']===0x1f4){logger[_0xa7dc('0x14')](_0xa7dc('0x11'),_0x565c30,_0x3aad81[_0xa7dc('0x14')][_0xa7dc('0x15')]);return _0xb2d756(_0x3aad81[_0xa7dc('0x14')]['message']);}logger[_0xa7dc('0x14')](_0xa7dc('0x11'),_0x565c30,_0x3aad81[_0xa7dc('0x14')][_0xa7dc('0x15')]);return _0x272153(_0x3aad81[_0xa7dc('0x14')][_0xa7dc('0x15')]);}else{logger[_0xa7dc('0x10')](_0xa7dc('0x11'),_0x565c30,_0xa7dc('0x12'));_0x272153(_0x3aad81[_0xa7dc('0x16')]['message']);}})[_0xa7dc('0x17')](function(_0x1092ec){logger[_0xa7dc('0x14')](_0xa7dc('0x11'),_0x565c30,_0x1092ec);_0xb2d756(_0x1092ec);});});}exports[_0xa7dc('0x18')]=function(_0x40ae63){var _0x5cc9d8=this;return new Promise(function(_0x355223,_0x21ccb2){return db['SquareProject'][_0xa7dc('0x19')]({'raw':_0x40ae63[_0xa7dc('0x1a')]?_0x40ae63[_0xa7dc('0x1a')][_0xa7dc('0x1b')]===undefined?!![]:![]:!![],'where':_0x40ae63[_0xa7dc('0x1a')]?_0x40ae63[_0xa7dc('0x1a')]['where']||null:null,'attributes':_0x40ae63[_0xa7dc('0x1a')]?_0x40ae63['options']['attributes']||null:null,'include':_0x40ae63[_0xa7dc('0x1a')]?_0x40ae63[_0xa7dc('0x1a')][_0xa7dc('0x1c')]?_[_0xa7dc('0x1d')](_0x40ae63['options'][_0xa7dc('0x1c')],function(_0x1039db){return{'model':db[_0x1039db[_0xa7dc('0x1e')]],'as':_0x1039db['as'],'attributes':_0x1039db[_0xa7dc('0x1f')],'include':_0x1039db[_0xa7dc('0x1c')]?_[_0xa7dc('0x1d')](_0x1039db[_0xa7dc('0x1c')],function(_0x407d1b){return{'model':db[_0x407d1b['model']],'as':_0x407d1b['as'],'attributes':_0x407d1b[_0xa7dc('0x1f')],'include':_0x407d1b[_0xa7dc('0x1c')]?_[_0xa7dc('0x1d')](_0x407d1b[_0xa7dc('0x1c')],function(_0x54487b){return{'model':db[_0x54487b[_0xa7dc('0x1e')]],'as':_0x54487b['as'],'attributes':_0x54487b['attributes']};}):[]};}):[]};}):[]:[]})[_0xa7dc('0xf')](function(_0x15e03e){logger[_0xa7dc('0x10')](_0xa7dc('0x18'),_0x40ae63);logger[_0xa7dc('0x20')](_0xa7dc('0x18'),_0x40ae63,JSON['stringify'](_0x15e03e));_0x355223(_0x15e03e);})[_0xa7dc('0x17')](function(_0x2e2584){logger[_0xa7dc('0x14')](_0xa7dc('0x18'),_0x2e2584['message'],_0x40ae63);_0x21ccb2(_0x5cc9d8[_0xa7dc('0x14')](0x1f4,_0x2e2584[_0xa7dc('0x15')]));});});}; \ No newline at end of file +var _0x5649=['map','catch','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','info','SquareProject,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','ShowSquareProject','SquareProject','find','options','raw','where','attributes','include','model'];(function(_0x3c4e0c,_0xe29da2){var _0x1905d5=function(_0x2817b6){while(--_0x2817b6){_0x3c4e0c['push'](_0x3c4e0c['shift']());}};_0x1905d5(++_0xe29da2);}(_0x5649,0x160));var _0x9564=function(_0x15c8e0,_0x332c04){_0x15c8e0=_0x15c8e0-0x0;var _0xcf223b=_0x5649[_0x15c8e0];return _0xcf223b;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x9564('0x0'));var rs=require(_0x9564('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9564('0x2'))['db'];var utils=require(_0x9564('0x3'));var logger=require(_0x9564('0x4'))(_0x9564('0x5'));var config=require(_0x9564('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x9564('0x7')][_0x9564('0x8')]({'port':0x232a});config[_0x9564('0x9')]=_[_0x9564('0xa')](config['redis'],{'host':_0x9564('0xb'),'port':0x18eb});var socket=require(_0x9564('0xc'))(new Redis(config['redis']));require(_0x9564('0xd'))[_0x9564('0xe')](socket);function respondWithRpcPromise(_0x367db4,_0x3efd14,_0x2e8542){return new BPromise(function(_0x3bbcb0,_0x88ce5e){return client['request'](_0x367db4,_0x2e8542)['then'](function(_0x241a6b){logger[_0x9564('0xf')](_0x9564('0x10'),_0x3efd14,'request\x20sent');logger[_0x9564('0x11')]('SquareProject,\x20%s,\x20%s,\x20%s',_0x3efd14,_0x9564('0x12'),JSON[_0x9564('0x13')](_0x241a6b));if(_0x241a6b[_0x9564('0x14')]){if(_0x241a6b['error'][_0x9564('0x15')]===0x1f4){logger[_0x9564('0x14')](_0x9564('0x10'),_0x3efd14,_0x241a6b[_0x9564('0x14')][_0x9564('0x16')]);return _0x88ce5e(_0x241a6b[_0x9564('0x14')][_0x9564('0x16')]);}logger['error'](_0x9564('0x10'),_0x3efd14,_0x241a6b[_0x9564('0x14')][_0x9564('0x16')]);return _0x3bbcb0(_0x241a6b[_0x9564('0x14')][_0x9564('0x16')]);}else{logger[_0x9564('0xf')](_0x9564('0x10'),_0x3efd14,_0x9564('0x12'));_0x3bbcb0(_0x241a6b[_0x9564('0x17')][_0x9564('0x16')]);}})['catch'](function(_0x465a77){logger['error'](_0x9564('0x10'),_0x3efd14,_0x465a77);_0x88ce5e(_0x465a77);});});}exports[_0x9564('0x18')]=function(_0x4991e0){var _0x5228f4=this;return new Promise(function(_0x141fa5,_0x55a1c1){return db[_0x9564('0x19')][_0x9564('0x1a')]({'raw':_0x4991e0[_0x9564('0x1b')]?_0x4991e0[_0x9564('0x1b')][_0x9564('0x1c')]===undefined?!![]:![]:!![],'where':_0x4991e0[_0x9564('0x1b')]?_0x4991e0[_0x9564('0x1b')][_0x9564('0x1d')]||null:null,'attributes':_0x4991e0[_0x9564('0x1b')]?_0x4991e0[_0x9564('0x1b')][_0x9564('0x1e')]||null:null,'include':_0x4991e0[_0x9564('0x1b')]?_0x4991e0['options'][_0x9564('0x1f')]?_['map'](_0x4991e0[_0x9564('0x1b')][_0x9564('0x1f')],function(_0x2212e8){return{'model':db[_0x2212e8[_0x9564('0x20')]],'as':_0x2212e8['as'],'attributes':_0x2212e8['attributes'],'include':_0x2212e8['include']?_['map'](_0x2212e8[_0x9564('0x1f')],function(_0x2d51fe){return{'model':db[_0x2d51fe['model']],'as':_0x2d51fe['as'],'attributes':_0x2d51fe['attributes'],'include':_0x2d51fe['include']?_[_0x9564('0x21')](_0x2d51fe[_0x9564('0x1f')],function(_0x25965b){return{'model':db[_0x25965b[_0x9564('0x20')]],'as':_0x25965b['as'],'attributes':_0x25965b[_0x9564('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3c8804){logger[_0x9564('0xf')](_0x9564('0x18'),_0x4991e0);logger[_0x9564('0x11')](_0x9564('0x18'),_0x4991e0,JSON['stringify'](_0x3c8804));_0x141fa5(_0x3c8804);})[_0x9564('0x22')](function(_0xf463c2){logger[_0x9564('0x14')]('ShowSquareProject',_0xf463c2[_0x9564('0x16')],_0x4991e0);_0x55a1c1(_0x5228f4[_0x9564('0x14')](0x1f4,_0xf463c2[_0x9564('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index d8fcbcb..5fbd48c 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 _0x527e=['removeListener','register','length','./squareProject.events','save','update','emit'];(function(_0x1d7c5e,_0x37f142){var _0x9232a7=function(_0x531b27){while(--_0x531b27){_0x1d7c5e['push'](_0x1d7c5e['shift']());}};_0x9232a7(++_0x37f142);}(_0x527e,0xc7));var _0xe527=function(_0x32dcfd,_0x1ec0f3){_0x32dcfd=_0x32dcfd-0x0;var _0x472ad3=_0x527e[_0x32dcfd];return _0x472ad3;};'use strict';var SquareProjectEvents=require(_0xe527('0x0'));var events=[_0xe527('0x1'),'remove',_0xe527('0x2')];function createListener(_0x539a2c,_0x1315dc){return function(_0x403979){_0x1315dc[_0xe527('0x3')](_0x539a2c,_0x403979);};}function removeListener(_0x106a1f,_0x2c35a7){return function(){SquareProjectEvents[_0xe527('0x4')](_0x106a1f,_0x2c35a7);};}exports[_0xe527('0x5')]=function(_0x2a5eb5){for(var _0x54fb13=0x0,_0x485eaa=events[_0xe527('0x6')];_0x54fb13<_0x485eaa;_0x54fb13++){var _0x1798b8=events[_0x54fb13];var _0x3ae9a0=createListener('squareProject:'+_0x1798b8,_0x2a5eb5);SquareProjectEvents['on'](_0x1798b8,_0x3ae9a0);}}; \ No newline at end of file +var _0x1602=['removeListener','register','length','squareProject:','./squareProject.events','save','remove','emit'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x1602,0x1dc));var _0x2160=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x1602[_0x2dafbe];return _0x58a45a;};'use strict';var SquareProjectEvents=require(_0x2160('0x0'));var events=[_0x2160('0x1'),_0x2160('0x2'),'update'];function createListener(_0x277147,_0x19f663){return function(_0x45b3d6){_0x19f663[_0x2160('0x3')](_0x277147,_0x45b3d6);};}function removeListener(_0xc6087,_0x301a25){return function(){SquareProjectEvents[_0x2160('0x4')](_0xc6087,_0x301a25);};}exports[_0x2160('0x5')]=function(_0x2e2c8c){for(var _0x40a303=0x0,_0x52021f=events[_0x2160('0x6')];_0x40a303<_0x52021f;_0x40a303++){var _0x3e9f23=events[_0x40a303];var _0x5d22d1=createListener(_0x2160('0x7')+_0x3e9f23,_0x2e2c8c);SquareProjectEvents['on'](_0x3e9f23,_0x5d22d1);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index fc1a622..44aea96 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 _0x814b=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','isAuthenticated','/:id','show','/:id/download','download','post','create','put','delete','destroy','exports'];(function(_0x49436b,_0x2d06b4){var _0x261047=function(_0x1beb4a){while(--_0x1beb4a){_0x49436b['push'](_0x49436b['shift']());}};_0x261047(++_0x2d06b4);}(_0x814b,0x1a2));var _0xb814=function(_0x2f02d4,_0x27b24a){_0x2f02d4=_0x2f02d4-0x0;var _0x4b707d=_0x814b[_0x2f02d4];return _0x4b707d;};'use strict';var multer=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var path=require(_0xb814('0x2'));var timeout=require(_0xb814('0x3'));var express=require(_0xb814('0x4'));var router=express[_0xb814('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb814('0x6'));var interaction=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var controller=require(_0xb814('0x9'));router[_0xb814('0xa')]('/',auth[_0xb814('0xb')](),controller['index']);router[_0xb814('0xa')](_0xb814('0xc'),auth['isAuthenticated'](),controller[_0xb814('0xd')]);router[_0xb814('0xa')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0xf')]);router[_0xb814('0x10')]('/',auth[_0xb814('0xb')](),controller[_0xb814('0x11')]);router[_0xb814('0x12')](_0xb814('0xc'),auth[_0xb814('0xb')](),controller['update']);router[_0xb814('0x13')]('/:id',auth[_0xb814('0xb')](),controller[_0xb814('0x14')]);module[_0xb814('0x15')]=router; \ No newline at end of file +var _0x53ec=['update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./squareRecording.controller','isAuthenticated','get','/:id','show','/:id/download','download','post','create','put'];(function(_0x10b01b,_0xaecac4){var _0x1adbb3=function(_0x372a3d){while(--_0x372a3d){_0x10b01b['push'](_0x10b01b['shift']());}};_0x1adbb3(++_0xaecac4);}(_0x53ec,0x192));var _0xc53e=function(_0x267f04,_0x18005d){_0x267f04=_0x267f04-0x0;var _0x324621=_0x53ec[_0x267f04];return _0x324621;};'use strict';var multer=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var path=require(_0xc53e('0x2'));var timeout=require(_0xc53e('0x3'));var express=require(_0xc53e('0x4'));var router=express[_0xc53e('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xc53e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc53e('0x7'));var controller=require(_0xc53e('0x8'));router['get']('/',auth[_0xc53e('0x9')](),controller['index']);router[_0xc53e('0xa')](_0xc53e('0xb'),auth['isAuthenticated'](),controller[_0xc53e('0xc')]);router[_0xc53e('0xa')](_0xc53e('0xd'),auth[_0xc53e('0x9')](),controller[_0xc53e('0xe')]);router[_0xc53e('0xf')]('/',auth[_0xc53e('0x9')](),controller[_0xc53e('0x10')]);router[_0xc53e('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xc53e('0x12')]);router['delete']('/:id',auth[_0xc53e('0x9')](),controller[_0xc53e('0x13')]);module[_0xc53e('0x14')]=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index 6ef78d7..f879a01 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 _0xe14b=['VIRTUAL','lastIndexOf','sequelize','exports','STRING'];(function(_0x2cd23b,_0x15bca3){var _0x354343=function(_0x5d0467){while(--_0x5d0467){_0x2cd23b['push'](_0x2cd23b['shift']());}};_0x354343(++_0x15bca3);}(_0xe14b,0x93));var _0xbe14=function(_0x1f4738,_0x1a6bbb){_0x1f4738=_0x1f4738-0x0;var _0x314206=_0xe14b[_0x1f4738];return _0x314206;};'use strict';var Sequelize=require(_0xbe14('0x0'));module[_0xbe14('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xbe14('0x2')]},'context':{'type':Sequelize[_0xbe14('0x2')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xbe14('0x2')]},'accountcode':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize['STRING']},'projectName':{'type':Sequelize[_0xbe14('0x2')]},'saveName':{'type':Sequelize[_0xbe14('0x2')]},'filename':{'type':Sequelize[_0xbe14('0x2')]},'savePath':{'type':Sequelize[_0xbe14('0x2')]},'format':{'type':Sequelize[_0xbe14('0x3')],'get':function(){var _0x39387e='';var _0x196fca=this['getDataValue']('savePath');if(_0x196fca){_0x39387e=_0x196fca['substring'](_0x196fca[_0xbe14('0x4')]('.'));}return _0x39387e;}}}; \ No newline at end of file +var _0x3eea=['getDataValue','substring','sequelize','STRING'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3eea,0x1ca));var _0xa3ee=function(_0x395c93,_0x6a874){_0x395c93=_0x395c93-0x0;var _0x5af9c9=_0x3eea[_0x395c93];return _0x5af9c9;};'use strict';var Sequelize=require(_0xa3ee('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xa3ee('0x1')]},'callerid':{'type':Sequelize[_0xa3ee('0x1')]},'calleridname':{'type':Sequelize[_0xa3ee('0x1')]},'context':{'type':Sequelize[_0xa3ee('0x1')]},'extension':{'type':Sequelize[_0xa3ee('0x1')]},'priority':{'type':Sequelize[_0xa3ee('0x1')]},'accountcode':{'type':Sequelize[_0xa3ee('0x1')]},'dnid':{'type':Sequelize[_0xa3ee('0x1')]},'projectName':{'type':Sequelize[_0xa3ee('0x1')]},'saveName':{'type':Sequelize[_0xa3ee('0x1')]},'filename':{'type':Sequelize[_0xa3ee('0x1')]},'savePath':{'type':Sequelize['STRING']},'format':{'type':Sequelize['VIRTUAL'],'get':function(){var _0x4183ee='';var _0x4e4588=this[_0xa3ee('0x2')]('savePath');if(_0x4e4588){_0x4183ee=_0x4e4588[_0xa3ee('0x3')](_0x4e4588['lastIndexOf']('.'));}return _0x4183ee;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index 565b840..5c5a5b7 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 _0xf492=['send','index','map','SquareRecording','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','rows','catch','show','rawAttributes','include','create','body','find','../../components/encryptor','uniqueid','params','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','SquareRecording\x20not\x20found','filename','extname','unlink','download','message','Not\x20found','isNil','savePath','cancellazione\x20fisica\x20documento\x20%s','info','File:\x20\x22','rimraf','request-promise','moment','bluebird','mustache','util','to-csv','fs-extra','squel','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','end','status','json','undefined','limit','count','offset','set','Content-Range','apply','update','then','destroy','error','name'];(function(_0x6e8248,_0x44d2c1){var _0x88d71e=function(_0x34d0a7){while(--_0x34d0a7){_0x6e8248['push'](_0x6e8248['shift']());}};_0x88d71e(++_0x44d2c1);}(_0xf492,0x14a));var _0x2f49=function(_0x26bee7,_0x3da1af){_0x26bee7=_0x26bee7-0x0;var _0x162702=_0xf492[_0x26bee7];return _0x162702;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x2f49('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x2f49('0x1'));var moment=require(_0x2f49('0x2'));var BPromise=require(_0x2f49('0x3'));var Mustache=require(_0x2f49('0x4'));var util=require(_0x2f49('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x2f49('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2f49('0x7'));var _=require('lodash');var squel=require(_0x2f49('0x8'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x2f49('0x9'));var toCsv=require(_0x2f49('0x6'));var querystring=require(_0x2f49('0xa'));var Papa=require(_0x2f49('0xb'));var Redis=require(_0x2f49('0xc'));var authService=require(_0x2f49('0xd'));var qs=require(_0x2f49('0xe'));var as=require(_0x2f49('0xf'));var hardwareService=require(_0x2f49('0x10'));var logger=require(_0x2f49('0x11'))(_0x2f49('0x12'));var utils=require(_0x2f49('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x2f49('0x14'));var db=require(_0x2f49('0x15'))['db'];function respondWithStatusCode(_0x3d6d98,_0x176203){_0x176203=_0x176203||0xcc;return function(_0xf37bb0){if(_0xf37bb0){return _0x3d6d98[_0x2f49('0x16')](_0x176203);}return _0x3d6d98['status'](_0x176203)[_0x2f49('0x17')]();};}function respondWithResult(_0x49bdec,_0x5882b6){_0x5882b6=_0x5882b6||0xc8;return function(_0x27e0a4){if(_0x27e0a4){return _0x49bdec[_0x2f49('0x18')](_0x5882b6)[_0x2f49('0x19')](_0x27e0a4);}};}function respondWithFilteredResult(_0x43f554,_0x465ade){return function(_0x95b84f){if(_0x95b84f){var _0x177102=typeof _0x465ade['offset']===_0x2f49('0x1a')&&typeof _0x465ade[_0x2f49('0x1b')]==='undefined';var _0x26d8e0=_0x95b84f[_0x2f49('0x1c')];var _0x148b18=_0x177102?0x0:_0x465ade[_0x2f49('0x1d')];var _0x2f3256=_0x177102?_0x95b84f[_0x2f49('0x1c')]:_0x465ade[_0x2f49('0x1d')]+_0x465ade[_0x2f49('0x1b')];var _0x488b54;if(_0x2f3256>=_0x26d8e0){_0x2f3256=_0x26d8e0;_0x488b54=0xc8;}else{_0x488b54=0xce;}_0x43f554['status'](_0x488b54);return _0x43f554[_0x2f49('0x1e')](_0x2f49('0x1f'),_0x148b18+'-'+_0x2f3256+'/'+_0x26d8e0)[_0x2f49('0x19')](_0x95b84f);}return null;};}function patchUpdates(_0x28fb00){return function(_0x4731f0){try{jsonpatch[_0x2f49('0x20')](_0x4731f0,_0x28fb00,!![]);}catch(_0x56372e){return BPromise['reject'](_0x56372e);}return _0x4731f0['save']();};}function saveUpdates(_0x7b735d,_0x572638){return function(_0x9db557){if(_0x9db557){return _0x9db557[_0x2f49('0x21')](_0x7b735d)[_0x2f49('0x22')](function(_0x5e8138){return _0x5e8138;});}return null;};}function removeEntity(_0x1740d2,_0x2dc126){return function(_0x5bc4dc){if(_0x5bc4dc){return _0x5bc4dc[_0x2f49('0x23')]()[_0x2f49('0x22')](function(){_0x1740d2[_0x2f49('0x18')](0xcc)[_0x2f49('0x17')]();});}};}function handleEntityNotFound(_0x30e746,_0x542201){return function(_0x3c8f19){if(!_0x3c8f19){_0x30e746[_0x2f49('0x16')](0x194);}return _0x3c8f19;};}function handleError(_0x551df1,_0x21ef41){_0x21ef41=_0x21ef41||0x1f4;return function(_0x1a727e){logger[_0x2f49('0x24')](_0x1a727e['stack']);if(_0x1a727e[_0x2f49('0x25')]){delete _0x1a727e[_0x2f49('0x25')];}_0x551df1[_0x2f49('0x18')](_0x21ef41)[_0x2f49('0x26')](_0x1a727e);};}exports[_0x2f49('0x27')]=function(_0x401401,_0x284b1c){var _0x43438f={},_0x544670={},_0x49464a={'count':0x0,'rows':[]};var _0x227f64=_[_0x2f49('0x28')](db[_0x2f49('0x29')]['rawAttributes'],function(_0x182c8e){return{'name':_0x182c8e[_0x2f49('0x2a')],'type':_0x182c8e['type'][_0x2f49('0x2b')]};});_0x544670[_0x2f49('0x2c')]=_[_0x2f49('0x28')](_0x227f64,_0x2f49('0x25'));_0x544670[_0x2f49('0x2d')]=_[_0x2f49('0x2e')](_0x401401[_0x2f49('0x2d')]);_0x544670[_0x2f49('0x2f')]=_[_0x2f49('0x30')](_0x544670[_0x2f49('0x2c')],_0x544670[_0x2f49('0x2d')]);_0x43438f[_0x2f49('0x31')]=_['intersection'](_0x544670[_0x2f49('0x2c')],qs['fields'](_0x401401[_0x2f49('0x2d')][_0x2f49('0x32')]));_0x43438f[_0x2f49('0x31')]=_0x43438f[_0x2f49('0x31')][_0x2f49('0x33')]?_0x43438f['attributes']:_0x544670[_0x2f49('0x2c')];if(!_0x401401[_0x2f49('0x2d')]['hasOwnProperty'](_0x2f49('0x34'))){_0x43438f[_0x2f49('0x1b')]=qs[_0x2f49('0x1b')](_0x401401[_0x2f49('0x2d')][_0x2f49('0x1b')]);_0x43438f['offset']=qs[_0x2f49('0x1d')](_0x401401[_0x2f49('0x2d')][_0x2f49('0x1d')]);}_0x43438f[_0x2f49('0x35')]=qs[_0x2f49('0x36')](_0x401401[_0x2f49('0x2d')][_0x2f49('0x36')]);_0x43438f[_0x2f49('0x37')]=qs[_0x2f49('0x2f')](_[_0x2f49('0x38')](_0x401401['query'],_0x544670[_0x2f49('0x2f')]),_0x227f64);if(_0x401401[_0x2f49('0x2d')][_0x2f49('0x39')]){_0x43438f[_0x2f49('0x37')]=_[_0x2f49('0x3a')](_0x43438f[_0x2f49('0x37')],{'$or':_[_0x2f49('0x28')](_0x227f64,function(_0x1cf085){if(_0x1cf085[_0x2f49('0x3b')]!==_0x2f49('0x3c')){var _0x3be2e6={};_0x3be2e6[_0x1cf085['name']]={'$like':'%'+_0x401401[_0x2f49('0x2d')]['filter']+'%'};return _0x3be2e6;}})});}_0x43438f=_[_0x2f49('0x3a')]({},_0x43438f,_0x401401[_0x2f49('0x3d')]);var _0xcb89ab={'where':_0x43438f['where']};return db[_0x2f49('0x29')][_0x2f49('0x1c')](_0xcb89ab)['then'](function(_0x1f4e9e){_0x49464a[_0x2f49('0x1c')]=_0x1f4e9e;if(_0x401401['query']['includeAll']){_0x43438f['include']=[{'all':!![]}];}return db[_0x2f49('0x29')]['findAll'](_0x43438f);})[_0x2f49('0x22')](function(_0x3ed240){_0x49464a[_0x2f49('0x3e')]=_0x3ed240;return _0x49464a;})[_0x2f49('0x22')](respondWithFilteredResult(_0x284b1c,_0x43438f))[_0x2f49('0x3f')](handleError(_0x284b1c,null));};exports[_0x2f49('0x40')]=function(_0x26f741,_0xabbbdf){var _0x17e1d3={'raw':!![],'where':{'id':_0x26f741['params']['id']}},_0x571ef4={};_0x571ef4[_0x2f49('0x2c')]=_[_0x2f49('0x2e')](db[_0x2f49('0x29')][_0x2f49('0x41')]);_0x571ef4['query']=_['keys'](_0x26f741['query']);_0x571ef4[_0x2f49('0x2f')]=_['intersection'](_0x571ef4[_0x2f49('0x2c')],_0x571ef4[_0x2f49('0x2d')]);_0x17e1d3[_0x2f49('0x31')]=_['intersection'](_0x571ef4[_0x2f49('0x2c')],qs['fields'](_0x26f741[_0x2f49('0x2d')][_0x2f49('0x32')]));_0x17e1d3[_0x2f49('0x31')]=_0x17e1d3[_0x2f49('0x31')][_0x2f49('0x33')]?_0x17e1d3[_0x2f49('0x31')]:_0x571ef4['model'];if(_0x26f741[_0x2f49('0x2d')]['includeAll']){_0x17e1d3[_0x2f49('0x42')]=[{'all':!![]}];}_0x17e1d3=_[_0x2f49('0x3a')]({},_0x17e1d3,_0x26f741['options']);return db[_0x2f49('0x29')]['find'](_0x17e1d3)['then'](handleEntityNotFound(_0xabbbdf,null))['then'](respondWithResult(_0xabbbdf,null))[_0x2f49('0x3f')](handleError(_0xabbbdf,null));};exports[_0x2f49('0x43')]=function(_0x43c7d9,_0x53ddeb){return db[_0x2f49('0x29')]['create'](_0x43c7d9['body'],{})['then'](respondWithResult(_0x53ddeb,0xc9))[_0x2f49('0x3f')](handleError(_0x53ddeb,null));};exports[_0x2f49('0x21')]=function(_0xfcf4a,_0xd0c007){if(_0xfcf4a[_0x2f49('0x44')]['id']){delete _0xfcf4a[_0x2f49('0x44')]['id'];}return db['SquareRecording'][_0x2f49('0x45')]({'where':{'id':_0xfcf4a['params']['id']}})[_0x2f49('0x22')](handleEntityNotFound(_0xd0c007,null))[_0x2f49('0x22')](saveUpdates(_0xfcf4a['body'],null))[_0x2f49('0x22')](respondWithResult(_0xd0c007,null))['catch'](handleError(_0xd0c007,null));};exports['download']=function(_0x5ebeb6,_0x2d49dd,_0x4f7a20){var _0x5dbf25=require(_0x2f49('0x46'));var _0xe0557=![];var _0x20ced4={};if(_0x5ebeb6[_0x2f49('0x2d')][_0x2f49('0x3b')]&&_0x5ebeb6['query'][_0x2f49('0x3b')]==='uniqueid'){_0x20ced4[_0x2f49('0x47')]=_0x5ebeb6['params']['id'];}else{_0x20ced4['id']=_0x5ebeb6[_0x2f49('0x48')]['id'];}return db[_0x2f49('0x29')][_0x2f49('0x45')]({'where':_0x20ced4,'attributes':['id','savePath','filename'],'raw':!![]})[_0x2f49('0x22')](handleEntityNotFound(_0x2d49dd,null))['then'](function(_0x4ce5a9){if(_0x4ce5a9){var _0x447ef3=_0x4ce5a9['savePath'];var _0x12b5b2=util['format'](_0x2f49('0x49'),_0x447ef3);if(fs[_0x2f49('0x4a')](_0x12b5b2)){_0xe0557=!![];return _0x5dbf25[_0x2f49('0x4b')](_0x12b5b2,_0x447ef3,config[_0x2f49('0x4c')][_0x2f49('0x4d')])[_0x2f49('0x22')](function(){return _0x4ce5a9;});}return _0x4ce5a9;}})[_0x2f49('0x22')](function(_0x36803b){if(_0x36803b){var _0x16dc13=_0x36803b['savePath'];if(!fs['existsSync'](_0x16dc13)){throw new db[(_0x2f49('0x4e'))][(_0x2f49('0x4f'))](_0x2f49('0x50'));}if(_0x36803b[_0x2f49('0x51')]){return _0x2d49dd['download'](_0x16dc13,_0x36803b[_0x2f49('0x51')]+path[_0x2f49('0x52')](_0x16dc13),function(){if(_0xe0557){fs[_0x2f49('0x53')](_0x16dc13);}});}else{return _0x2d49dd[_0x2f49('0x54')](_0x16dc13,function(_0x27a213){if(_0xe0557){fs[_0x2f49('0x53')](_0x16dc13);}});}}})[_0x2f49('0x3f')](function(_0xb7c7e6){if(_0xb7c7e6[_0x2f49('0x55')]===_0x2f49('0x50')){_0x2d49dd['status'](0x194)[_0x2f49('0x26')](_0x2f49('0x56'));}else{return handleError(_0x2d49dd,null);}});};exports[_0x2f49('0x23')]=function(_0x260bd2,_0x43fcee){return db['SquareRecording'][_0x2f49('0x45')]({'where':{'id':_0x260bd2[_0x2f49('0x48')]['id']}})[_0x2f49('0x22')](function(_0x1d0e19){if(_[_0x2f49('0x57')](_0x1d0e19)){throw new ReferenceError('Entity\x20not\x20found');}return _0x1d0e19;})[_0x2f49('0x22')](function(_0x3fa88e){var _0x39e4e3=_0x3fa88e[_0x2f49('0x58')];logger['info'](_0x2f49('0x59'),_0x39e4e3);if(!_[_0x2f49('0x57')](_0x3fa88e[_0x2f49('0x58')])&&fs[_0x2f49('0x4a')](_0x39e4e3)){logger[_0x2f49('0x5a')](_0x2f49('0x5b')+_0x39e4e3+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x39e4e3);}_0x39e4e3=_0x39e4e3+'.cypher';if(!_['isNil'](_0x3fa88e[_0x2f49('0x58')])&&fs[_0x2f49('0x4a')](_0x39e4e3)){logger[_0x2f49('0x5a')]('File:\x20\x22'+_0x39e4e3+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x39e4e3);}return _0x3fa88e;})['then'](function(_0x3b12a8){if(!_0x3b12a8)throw new InternalError();return _0x3b12a8[_0x2f49('0x23')]();})[_0x2f49('0x22')](function(){_0x43fcee[_0x2f49('0x18')](0xcc)[_0x2f49('0x17')]();})['catch'](handleError(_0x43fcee,null));}; \ No newline at end of file +var _0x6731=['moment','bluebird','util','path','sox','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','json','apply','save','update','destroy','then','end','error','index','map','SquareRecording','rawAttributes','fieldName','type','key','model','name','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','includeAll','findAll','rows','params','include','options','find','catch','create','body','download','../../components/encryptor','uniqueid','savePath','format','existsSync','decryptFile','secrets','Sequelize','SquareRecording\x20not\x20found','filename','extname','unlink','message','send','Not\x20found','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','unlinkSync','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','eml-format','rimraf','zip-dir'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0x6731,0x17d));var _0x1673=function(_0x57f91f,_0x21cf17){_0x57f91f=_0x57f91f-0x0;var _0x4deca6=_0x6731[_0x57f91f];return _0x4deca6;};'use strict';var emlformat=require(_0x1673('0x0'));var rimraf=require(_0x1673('0x1'));var zipdir=require(_0x1673('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x1673('0x3'));var BPromise=require(_0x1673('0x4'));var Mustache=require('mustache');var util=require(_0x1673('0x5'));var path=require(_0x1673('0x6'));var sox=require(_0x1673('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1673('0x8'));var _=require(_0x1673('0x9'));var squel=require(_0x1673('0xa'));var crypto=require('crypto');var jsforce=require(_0x1673('0xb'));var deskjs=require(_0x1673('0xc'));var toCsv=require(_0x1673('0xd'));var querystring=require(_0x1673('0xe'));var Papa=require('papaparse');var Redis=require(_0x1673('0xf'));var authService=require(_0x1673('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x1673('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1673('0x12'))(_0x1673('0x13'));var utils=require(_0x1673('0x14'));var config=require(_0x1673('0x15'));var licenseUtil=require(_0x1673('0x16'));var db=require(_0x1673('0x17'))['db'];function respondWithStatusCode(_0x493b47,_0x4577fe){_0x4577fe=_0x4577fe||0xcc;return function(_0x1f1389){if(_0x1f1389){return _0x493b47[_0x1673('0x18')](_0x4577fe);}return _0x493b47[_0x1673('0x19')](_0x4577fe)['end']();};}function respondWithResult(_0x4ffd0f,_0x150041){_0x150041=_0x150041||0xc8;return function(_0x8f617){if(_0x8f617){return _0x4ffd0f['status'](_0x150041)['json'](_0x8f617);}};}function respondWithFilteredResult(_0x5c0020,_0x33615e){return function(_0x21ad74){if(_0x21ad74){var _0x1b66f9=typeof _0x33615e[_0x1673('0x1a')]===_0x1673('0x1b')&&typeof _0x33615e[_0x1673('0x1c')]===_0x1673('0x1b');var _0x4d1f48=_0x21ad74[_0x1673('0x1d')];var _0x1e44d2=_0x1b66f9?0x0:_0x33615e['offset'];var _0x5c8c06=_0x1b66f9?_0x21ad74['count']:_0x33615e[_0x1673('0x1a')]+_0x33615e[_0x1673('0x1c')];var _0x2aaec9;if(_0x5c8c06>=_0x4d1f48){_0x5c8c06=_0x4d1f48;_0x2aaec9=0xc8;}else{_0x2aaec9=0xce;}_0x5c0020[_0x1673('0x19')](_0x2aaec9);return _0x5c0020[_0x1673('0x1e')]('Content-Range',_0x1e44d2+'-'+_0x5c8c06+'/'+_0x4d1f48)[_0x1673('0x1f')](_0x21ad74);}return null;};}function patchUpdates(_0x16b7e0){return function(_0x2ede67){try{jsonpatch[_0x1673('0x20')](_0x2ede67,_0x16b7e0,!![]);}catch(_0x28cc1d){return BPromise['reject'](_0x28cc1d);}return _0x2ede67[_0x1673('0x21')]();};}function saveUpdates(_0x3bbe42,_0x393c21){return function(_0x54ca65){if(_0x54ca65){return _0x54ca65[_0x1673('0x22')](_0x3bbe42)['then'](function(_0x3226dd){return _0x3226dd;});}return null;};}function removeEntity(_0x2d0443,_0x179120){return function(_0x48d199){if(_0x48d199){return _0x48d199[_0x1673('0x23')]()[_0x1673('0x24')](function(){_0x2d0443[_0x1673('0x19')](0xcc)[_0x1673('0x25')]();});}};}function handleEntityNotFound(_0x517caa,_0x49b223){return function(_0x274d6d){if(!_0x274d6d){_0x517caa[_0x1673('0x18')](0x194);}return _0x274d6d;};}function handleError(_0x767a6b,_0x3f6ebf){_0x3f6ebf=_0x3f6ebf||0x1f4;return function(_0x1b0c17){logger[_0x1673('0x26')](_0x1b0c17['stack']);if(_0x1b0c17['name']){delete _0x1b0c17['name'];}_0x767a6b[_0x1673('0x19')](_0x3f6ebf)['send'](_0x1b0c17);};}exports[_0x1673('0x27')]=function(_0x2900b2,_0x27448e){var _0x8a98fb={},_0x2194d6={},_0x11ac72={'count':0x0,'rows':[]};var _0xe84278=_[_0x1673('0x28')](db[_0x1673('0x29')][_0x1673('0x2a')],function(_0x27013a){return{'name':_0x27013a[_0x1673('0x2b')],'type':_0x27013a[_0x1673('0x2c')][_0x1673('0x2d')]};});_0x2194d6[_0x1673('0x2e')]=_[_0x1673('0x28')](_0xe84278,_0x1673('0x2f'));_0x2194d6[_0x1673('0x30')]=_[_0x1673('0x31')](_0x2900b2[_0x1673('0x30')]);_0x2194d6['filters']=_[_0x1673('0x32')](_0x2194d6['model'],_0x2194d6[_0x1673('0x30')]);_0x8a98fb[_0x1673('0x33')]=_[_0x1673('0x32')](_0x2194d6[_0x1673('0x2e')],qs[_0x1673('0x34')](_0x2900b2[_0x1673('0x30')][_0x1673('0x34')]));_0x8a98fb[_0x1673('0x33')]=_0x8a98fb['attributes'][_0x1673('0x35')]?_0x8a98fb[_0x1673('0x33')]:_0x2194d6['model'];if(!_0x2900b2['query'][_0x1673('0x36')](_0x1673('0x37'))){_0x8a98fb[_0x1673('0x1c')]=qs[_0x1673('0x1c')](_0x2900b2[_0x1673('0x30')][_0x1673('0x1c')]);_0x8a98fb[_0x1673('0x1a')]=qs[_0x1673('0x1a')](_0x2900b2[_0x1673('0x30')][_0x1673('0x1a')]);}_0x8a98fb[_0x1673('0x38')]=qs[_0x1673('0x39')](_0x2900b2[_0x1673('0x30')][_0x1673('0x39')]);_0x8a98fb['where']=qs[_0x1673('0x3a')](_[_0x1673('0x3b')](_0x2900b2[_0x1673('0x30')],_0x2194d6[_0x1673('0x3a')]),_0xe84278);if(_0x2900b2[_0x1673('0x30')][_0x1673('0x3c')]){_0x8a98fb[_0x1673('0x3d')]=_[_0x1673('0x3e')](_0x8a98fb[_0x1673('0x3d')],{'$or':_[_0x1673('0x28')](_0xe84278,function(_0xb843bc){if(_0xb843bc[_0x1673('0x2c')]!=='VIRTUAL'){var _0x2dc740={};_0x2dc740[_0xb843bc['name']]={'$like':'%'+_0x2900b2['query'][_0x1673('0x3c')]+'%'};return _0x2dc740;}})});}_0x8a98fb=_['merge']({},_0x8a98fb,_0x2900b2['options']);var _0x262afe={'where':_0x8a98fb[_0x1673('0x3d')]};return db['SquareRecording'][_0x1673('0x1d')](_0x262afe)[_0x1673('0x24')](function(_0x277772){_0x11ac72[_0x1673('0x1d')]=_0x277772;if(_0x2900b2['query'][_0x1673('0x3f')]){_0x8a98fb['include']=[{'all':!![]}];}return db[_0x1673('0x29')][_0x1673('0x40')](_0x8a98fb);})['then'](function(_0xee93f0){_0x11ac72[_0x1673('0x41')]=_0xee93f0;return _0x11ac72;})[_0x1673('0x24')](respondWithFilteredResult(_0x27448e,_0x8a98fb))['catch'](handleError(_0x27448e,null));};exports['show']=function(_0x42eeac,_0x4c1c48){var _0x464d6f={'raw':!![],'where':{'id':_0x42eeac[_0x1673('0x42')]['id']}},_0x137596={};_0x137596[_0x1673('0x2e')]=_[_0x1673('0x31')](db[_0x1673('0x29')][_0x1673('0x2a')]);_0x137596[_0x1673('0x30')]=_[_0x1673('0x31')](_0x42eeac[_0x1673('0x30')]);_0x137596[_0x1673('0x3a')]=_[_0x1673('0x32')](_0x137596[_0x1673('0x2e')],_0x137596[_0x1673('0x30')]);_0x464d6f[_0x1673('0x33')]=_[_0x1673('0x32')](_0x137596[_0x1673('0x2e')],qs['fields'](_0x42eeac[_0x1673('0x30')][_0x1673('0x34')]));_0x464d6f[_0x1673('0x33')]=_0x464d6f['attributes'][_0x1673('0x35')]?_0x464d6f[_0x1673('0x33')]:_0x137596[_0x1673('0x2e')];if(_0x42eeac['query'][_0x1673('0x3f')]){_0x464d6f[_0x1673('0x43')]=[{'all':!![]}];}_0x464d6f=_[_0x1673('0x3e')]({},_0x464d6f,_0x42eeac[_0x1673('0x44')]);return db[_0x1673('0x29')][_0x1673('0x45')](_0x464d6f)['then'](handleEntityNotFound(_0x4c1c48,null))[_0x1673('0x24')](respondWithResult(_0x4c1c48,null))[_0x1673('0x46')](handleError(_0x4c1c48,null));};exports[_0x1673('0x47')]=function(_0x2b4156,_0x1d30a9){return db['SquareRecording'][_0x1673('0x47')](_0x2b4156['body'],{})['then'](respondWithResult(_0x1d30a9,0xc9))[_0x1673('0x46')](handleError(_0x1d30a9,null));};exports[_0x1673('0x22')]=function(_0x207b04,_0x54eea9){if(_0x207b04['body']['id']){delete _0x207b04[_0x1673('0x48')]['id'];}return db['SquareRecording'][_0x1673('0x45')]({'where':{'id':_0x207b04['params']['id']}})['then'](handleEntityNotFound(_0x54eea9,null))[_0x1673('0x24')](saveUpdates(_0x207b04[_0x1673('0x48')],null))[_0x1673('0x24')](respondWithResult(_0x54eea9,null))[_0x1673('0x46')](handleError(_0x54eea9,null));};exports[_0x1673('0x49')]=function(_0x14b95c,_0x58d14b,_0x1a6afb){var _0x120108=require(_0x1673('0x4a'));var _0x43c224=![];var _0x3d5508={};if(_0x14b95c['query']['type']&&_0x14b95c[_0x1673('0x30')][_0x1673('0x2c')]===_0x1673('0x4b')){_0x3d5508[_0x1673('0x4b')]=_0x14b95c[_0x1673('0x42')]['id'];}else{_0x3d5508['id']=_0x14b95c['params']['id'];}return db[_0x1673('0x29')]['find']({'where':_0x3d5508,'attributes':['id',_0x1673('0x4c'),'filename'],'raw':!![]})['then'](handleEntityNotFound(_0x58d14b,null))[_0x1673('0x24')](function(_0x4d590a){if(_0x4d590a){var _0x201d86=_0x4d590a['savePath'];var _0x20f820=util[_0x1673('0x4d')]('%s.cypher',_0x201d86);if(fs[_0x1673('0x4e')](_0x20f820)){_0x43c224=!![];return _0x120108[_0x1673('0x4f')](_0x20f820,_0x201d86,config[_0x1673('0x50')]['recording'])[_0x1673('0x24')](function(){return _0x4d590a;});}return _0x4d590a;}})[_0x1673('0x24')](function(_0x3e9609){if(_0x3e9609){var _0xeca785=_0x3e9609['savePath'];if(!fs[_0x1673('0x4e')](_0xeca785)){throw new db[(_0x1673('0x51'))]['ValidationError'](_0x1673('0x52'));}if(_0x3e9609[_0x1673('0x53')]){return _0x58d14b['download'](_0xeca785,_0x3e9609[_0x1673('0x53')]+path[_0x1673('0x54')](_0xeca785),function(){if(_0x43c224){fs[_0x1673('0x55')](_0xeca785);}});}else{return _0x58d14b['download'](_0xeca785,function(_0x264aec){if(_0x43c224){fs['unlink'](_0xeca785);}});}}})[_0x1673('0x46')](function(_0x5d4791){if(_0x5d4791[_0x1673('0x56')]==='SquareRecording\x20not\x20found'){_0x58d14b['status'](0x194)[_0x1673('0x57')](_0x1673('0x58'));}else{return handleError(_0x58d14b,null);}});};exports[_0x1673('0x23')]=function(_0x3a5fff,_0x4364f5){return db[_0x1673('0x29')][_0x1673('0x45')]({'where':{'id':_0x3a5fff[_0x1673('0x42')]['id']}})[_0x1673('0x24')](function(_0x2182a4){if(_[_0x1673('0x59')](_0x2182a4)){throw new ReferenceError(_0x1673('0x5a'));}return _0x2182a4;})[_0x1673('0x24')](function(_0x15a14d){var _0x40852b=_0x15a14d['savePath'];logger[_0x1673('0x5b')](_0x1673('0x5c'),_0x40852b);if(!_[_0x1673('0x59')](_0x15a14d[_0x1673('0x4c')])&&fs[_0x1673('0x4e')](_0x40852b)){logger['info'](_0x1673('0x5d')+_0x40852b+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x1673('0x5e')](_0x40852b);}_0x40852b=_0x40852b+'.cypher';if(!_[_0x1673('0x59')](_0x15a14d[_0x1673('0x4c')])&&fs[_0x1673('0x4e')](_0x40852b)){logger[_0x1673('0x5b')](_0x1673('0x5d')+_0x40852b+_0x1673('0x5f'));fs[_0x1673('0x5e')](_0x40852b);}return _0x15a14d;})[_0x1673('0x24')](function(_0x5851c3){if(!_0x5851c3)throw new InternalError();return _0x5851c3['destroy']();})[_0x1673('0x24')](function(){_0x4364f5[_0x1673('0x19')](0xcc)[_0x1673('0x25')]();})[_0x1673('0x46')](handleError(_0x4364f5,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index df2848e..e7a5b2b 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 _0x07fa=['../../config/logger','api','moment','bluebird','path','rimraf','SquareRecording','util'];(function(_0x4860c0,_0x3b2564){var _0x2f1938=function(_0x20da29){while(--_0x20da29){_0x4860c0['push'](_0x4860c0['shift']());}};_0x2f1938(++_0x3b2564);}(_0x07fa,0x177));var _0xa07f=function(_0x1589dd,_0x2b9d22){_0x1589dd=_0x1589dd-0x0;var _0x1bddd1=_0x07fa[_0x1589dd];return _0x1bddd1;};'use strict';var _=require('lodash');var util=require(_0xa07f('0x0'));var logger=require(_0xa07f('0x1'))(_0xa07f('0x2'));var moment=require(_0xa07f('0x3'));var BPromise=require(_0xa07f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa07f('0x5'));var rimraf=require(_0xa07f('0x6'));var config=require('../../config/environment');var attributes=require('./squareRecording.attributes');module['exports']=function(_0x3fb738,_0x362c91){return _0x3fb738['define'](_0xa07f('0x7'),attributes,{'tableName':'square_recordings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb296=['request-promise','rimraf','./squareRecording.attributes','exports','define','SquareRecording','square_recordings','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x3a5df1,_0x1bdcf3){var _0x4d2c49=function(_0x3ef946){while(--_0x3ef946){_0x3a5df1['push'](_0x3a5df1['shift']());}};_0x4d2c49(++_0x1bdcf3);}(_0xb296,0xa3));var _0x6b29=function(_0x2de921,_0x79ed01){_0x2de921=_0x2de921-0x0;var _0x35f960=_0xb296[_0x2de921];return _0x35f960;};'use strict';var _=require(_0x6b29('0x0'));var util=require(_0x6b29('0x1'));var logger=require(_0x6b29('0x2'))(_0x6b29('0x3'));var moment=require(_0x6b29('0x4'));var BPromise=require(_0x6b29('0x5'));var rp=require(_0x6b29('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6b29('0x7'));var config=require('../../config/environment');var attributes=require(_0x6b29('0x8'));module[_0x6b29('0x9')]=function(_0x5e0aa1,_0x327329){return _0x5e0aa1[_0x6b29('0xa')](_0x6b29('0xb'),attributes,{'tableName':_0x6b29('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 a7f9202..bf5d178 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 _0x2582=['CreateSquareRecording','SquareRecording','body','options','raw','then','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','client','http','info','debug','request\x20sent','error','code','message','SquareRecording,\x20%s,\x20%s'];(function(_0x3557e7,_0x556071){var _0x20287b=function(_0x2167f9){while(--_0x2167f9){_0x3557e7['push'](_0x3557e7['shift']());}};_0x20287b(++_0x556071);}(_0x2582,0x11a));var _0x2258=function(_0x47f84a,_0x33b10f){_0x47f84a=_0x47f84a-0x0;var _0x328233=_0x2582[_0x47f84a];return _0x328233;};'use strict';var _=require(_0x2258('0x0'));var util=require(_0x2258('0x1'));var moment=require(_0x2258('0x2'));var BPromise=require(_0x2258('0x3'));var rs=require(_0x2258('0x4'));var fs=require('fs');var Redis=require(_0x2258('0x5'));var db=require(_0x2258('0x6'))['db'];var utils=require(_0x2258('0x7'));var logger=require('../../config/logger')(_0x2258('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x2258('0x9')][_0x2258('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x293e4a,_0xc313d7,_0x4def66){return new BPromise(function(_0x5b94fc,_0x2461e3){return client['request'](_0x293e4a,_0x4def66)['then'](function(_0x3c94e4){logger[_0x2258('0xb')]('SquareRecording,\x20%s,\x20%s',_0xc313d7,'request\x20sent');logger[_0x2258('0xc')]('SquareRecording,\x20%s,\x20%s,\x20%s',_0xc313d7,_0x2258('0xd'),JSON['stringify'](_0x3c94e4));if(_0x3c94e4[_0x2258('0xe')]){if(_0x3c94e4['error'][_0x2258('0xf')]===0x1f4){logger['error']('SquareRecording,\x20%s,\x20%s',_0xc313d7,_0x3c94e4[_0x2258('0xe')][_0x2258('0x10')]);return _0x2461e3(_0x3c94e4['error'][_0x2258('0x10')]);}logger['error'](_0x2258('0x11'),_0xc313d7,_0x3c94e4[_0x2258('0xe')][_0x2258('0x10')]);return _0x5b94fc(_0x3c94e4[_0x2258('0xe')][_0x2258('0x10')]);}else{logger[_0x2258('0xb')](_0x2258('0x11'),_0xc313d7,_0x2258('0xd'));_0x5b94fc(_0x3c94e4['result'][_0x2258('0x10')]);}})['catch'](function(_0x5a2688){logger[_0x2258('0xe')](_0x2258('0x11'),_0xc313d7,_0x5a2688);_0x2461e3(_0x5a2688);});});}exports[_0x2258('0x12')]=function(_0x451706){var _0x4ecc76=this;return new Promise(function(_0x16b262,_0xbb4ca5){return db[_0x2258('0x13')]['create'](_0x451706[_0x2258('0x14')],{'raw':_0x451706[_0x2258('0x15')]?_0x451706[_0x2258('0x15')][_0x2258('0x16')]===undefined?!![]:![]:!![]})[_0x2258('0x17')](function(_0x4005e4){logger['info'](_0x2258('0x12'),_0x451706);logger[_0x2258('0xc')](_0x2258('0x12'),_0x451706,JSON[_0x2258('0x18')](_0x4005e4));_0x16b262(_0x4005e4);})['catch'](function(_0x39813d){logger[_0x2258('0xe')](_0x2258('0x12'),_0x39813d[_0x2258('0x10')],_0x451706);_0xbb4ca5(_0x4ecc76[_0x2258('0xe')](0x1f4,_0x39813d['message']));});});}; \ No newline at end of file +var _0x429c=['then','info','debug','SquareRecording,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','SquareRecording,\x20%s,\x20%s','message','result','CreateSquareRecording','SquareRecording','options','raw','stringify','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x400404,_0x4d9785){var _0xef693c=function(_0x6f964a){while(--_0x6f964a){_0x400404['push'](_0x400404['shift']());}};_0xef693c(++_0x4d9785);}(_0x429c,0x16c));var _0xc429=function(_0x3cb164,_0x47afdf){_0x3cb164=_0x3cb164-0x0;var _0x5721cd=_0x429c[_0x3cb164];return _0x5721cd;};'use strict';var _=require(_0xc429('0x0'));var util=require(_0xc429('0x1'));var moment=require(_0xc429('0x2'));var BPromise=require(_0xc429('0x3'));var rs=require(_0xc429('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc429('0x5'))['db'];var utils=require(_0xc429('0x6'));var logger=require(_0xc429('0x7'))(_0xc429('0x8'));var config=require(_0xc429('0x9'));var jayson=require(_0xc429('0xa'));var client=jayson['client'][_0xc429('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x351062,_0x494407,_0x2d36c0){return new BPromise(function(_0x5a50d5,_0xcf682e){return client[_0xc429('0xc')](_0x351062,_0x2d36c0)[_0xc429('0xd')](function(_0x3185b0){logger[_0xc429('0xe')]('SquareRecording,\x20%s,\x20%s',_0x494407,'request\x20sent');logger[_0xc429('0xf')](_0xc429('0x10'),_0x494407,_0xc429('0x11'),JSON['stringify'](_0x3185b0));if(_0x3185b0['error']){if(_0x3185b0[_0xc429('0x12')][_0xc429('0x13')]===0x1f4){logger[_0xc429('0x12')](_0xc429('0x14'),_0x494407,_0x3185b0[_0xc429('0x12')][_0xc429('0x15')]);return _0xcf682e(_0x3185b0[_0xc429('0x12')][_0xc429('0x15')]);}logger[_0xc429('0x12')]('SquareRecording,\x20%s,\x20%s',_0x494407,_0x3185b0[_0xc429('0x12')][_0xc429('0x15')]);return _0x5a50d5(_0x3185b0[_0xc429('0x12')][_0xc429('0x15')]);}else{logger['info'](_0xc429('0x14'),_0x494407,_0xc429('0x11'));_0x5a50d5(_0x3185b0[_0xc429('0x16')][_0xc429('0x15')]);}})['catch'](function(_0x28c1f9){logger[_0xc429('0x12')]('SquareRecording,\x20%s,\x20%s',_0x494407,_0x28c1f9);_0xcf682e(_0x28c1f9);});});}exports[_0xc429('0x17')]=function(_0x7cc043){var _0x1ee8ad=this;return new Promise(function(_0x8e8f5d,_0x2d4432){return db[_0xc429('0x18')]['create'](_0x7cc043['body'],{'raw':_0x7cc043[_0xc429('0x19')]?_0x7cc043['options'][_0xc429('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x16ac80){logger[_0xc429('0xe')](_0xc429('0x17'),_0x7cc043);logger['debug'](_0xc429('0x17'),_0x7cc043,JSON[_0xc429('0x1b')](_0x16ac80));_0x8e8f5d(_0x16ac80);})[_0xc429('0x1c')](function(_0x2a7e65){logger[_0xc429('0x12')]('CreateSquareRecording',_0x2a7e65[_0xc429('0x15')],_0x7cc043);_0x2d4432(_0x1ee8ad[_0xc429('0x12')](0x1f4,_0x2a7e65[_0xc429('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index 1fdde1e..74a1c6f 100644 --- a/server/api/squareReport/index.js +++ b/server/api/squareReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbaf0=['/:id','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index','/describe','show','post','create','put'];(function(_0x508a24,_0x7e0da7){var _0x1957f3=function(_0x6fec50){while(--_0x6fec50){_0x508a24['push'](_0x508a24['shift']());}};_0x1957f3(++_0x7e0da7);}(_0xbaf0,0x12a));var _0x0baf=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xbaf0[_0x6131cd];return _0x47e916;};'use strict';var multer=require('multer');var util=require(_0x0baf('0x0'));var path=require(_0x0baf('0x1'));var timeout=require(_0x0baf('0x2'));var express=require(_0x0baf('0x3'));var router=express[_0x0baf('0x4')]();var fs_extra=require(_0x0baf('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var controller=require(_0x0baf('0x8'));router[_0x0baf('0x9')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xb')]);router[_0x0baf('0x9')](_0x0baf('0xc'),auth[_0x0baf('0xa')](),controller['describe']);router[_0x0baf('0x9')]('/:id',auth[_0x0baf('0xa')](),controller[_0x0baf('0xd')]);router[_0x0baf('0xe')]('/',auth[_0x0baf('0xa')](),controller[_0x0baf('0xf')]);router[_0x0baf('0x10')](_0x0baf('0x11'),auth[_0x0baf('0xa')](),controller[_0x0baf('0x12')]);router[_0x0baf('0x13')](_0x0baf('0x11'),auth['isAuthenticated'](),controller['destroy']);module[_0x0baf('0x14')]=router; \ No newline at end of file +var _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(_0x2dbcf0,_0x1c9ce9){var _0x185a15=function(_0x51b059){while(--_0x51b059){_0x2dbcf0['push'](_0x2dbcf0['shift']());}};_0x185a15(++_0x1c9ce9);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./squareReport.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index d5a6b1f..22cd96a 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 _0xcf10=['exports','STRING','DATE','BOOLEAN','sequelize'];(function(_0x2f54b6,_0x3cc6cb){var _0x169f21=function(_0x4dac27){while(--_0x4dac27){_0x2f54b6['push'](_0x2f54b6['shift']());}};_0x169f21(++_0x3cc6cb);}(_0xcf10,0x72));var _0x0cf1=function(_0x48df04,_0x1522b1){_0x48df04=_0x48df04-0x0;var _0x4de5fa=_0xcf10[_0x48df04];return _0x4de5fa;};'use strict';var Sequelize=require(_0x0cf1('0x0'));module[_0x0cf1('0x1')]={'network':{'type':Sequelize['STRING']},'network_script':{'type':Sequelize[_0x0cf1('0x2')]},'request':{'type':Sequelize[_0x0cf1('0x2')]},'channel':{'type':Sequelize[_0x0cf1('0x2')]},'language':{'type':Sequelize[_0x0cf1('0x2')]},'type':{'type':Sequelize[_0x0cf1('0x2')]},'uniqueid':{'type':Sequelize[_0x0cf1('0x2')]},'version':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0x0cf1('0x2')]},'calleridname':{'type':Sequelize['STRING']},'callingpres':{'type':Sequelize['STRING']},'callingani2':{'type':Sequelize['STRING']},'callington':{'type':Sequelize[_0x0cf1('0x2')]},'callingtns':{'type':Sequelize[_0x0cf1('0x2')]},'dnid':{'type':Sequelize[_0x0cf1('0x2')]},'rdnis':{'type':Sequelize[_0x0cf1('0x2')]},'context':{'type':Sequelize[_0x0cf1('0x2')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x0cf1('0x2')]},'enhanced':{'type':Sequelize[_0x0cf1('0x2')]},'accountcode':{'type':Sequelize[_0x0cf1('0x2')]},'threadid':{'type':Sequelize['STRING']},'project_name':{'type':Sequelize[_0x0cf1('0x2')]},'joinAt':{'type':Sequelize[_0x0cf1('0x3')]},'leaveAt':{'type':Sequelize[_0x0cf1('0x3')]},'bot':{'type':Sequelize[_0x0cf1('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0x63e1=['STRING','DATE','sequelize','exports'];(function(_0x775f37,_0x4efcf3){var _0x5bb2d3=function(_0x51bd90){while(--_0x51bd90){_0x775f37['push'](_0x775f37['shift']());}};_0x5bb2d3(++_0x4efcf3);}(_0x63e1,0xf6));var _0x163e=function(_0x300afb,_0x5472a6){_0x300afb=_0x300afb-0x0;var _0x266455=_0x63e1[_0x300afb];return _0x266455;};'use strict';var Sequelize=require(_0x163e('0x0'));module[_0x163e('0x1')]={'network':{'type':Sequelize[_0x163e('0x2')]},'network_script':{'type':Sequelize[_0x163e('0x2')]},'request':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x163e('0x2')]},'type':{'type':Sequelize[_0x163e('0x2')]},'uniqueid':{'type':Sequelize[_0x163e('0x2')]},'version':{'type':Sequelize[_0x163e('0x2')]},'callerid':{'type':Sequelize[_0x163e('0x2')]},'calleridname':{'type':Sequelize[_0x163e('0x2')]},'callingpres':{'type':Sequelize[_0x163e('0x2')]},'callingani2':{'type':Sequelize[_0x163e('0x2')]},'callington':{'type':Sequelize[_0x163e('0x2')]},'callingtns':{'type':Sequelize[_0x163e('0x2')]},'dnid':{'type':Sequelize['STRING']},'rdnis':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x163e('0x2')]},'extension':{'type':Sequelize[_0x163e('0x2')]},'priority':{'type':Sequelize[_0x163e('0x2')]},'enhanced':{'type':Sequelize[_0x163e('0x2')]},'accountcode':{'type':Sequelize[_0x163e('0x2')]},'threadid':{'type':Sequelize['STRING']},'project_name':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x163e('0x3')]},'leaveAt':{'type':Sequelize[_0x163e('0x3')]},'bot':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.controller.js b/server/api/squareReport/squareReport.controller.js index 6bc8846..ca0b3c6 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 _0x7893=['crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','count','limit','set','update','destroy','then','status','error','name','send','map','SquareReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','includeAll','include','findAll','show','params','find','catch','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','fs-extra','lodash'];(function(_0x2aec52,_0x59d962){var _0x3b8835=function(_0x3e2604){while(--_0x3e2604){_0x2aec52['push'](_0x2aec52['shift']());}};_0x3b8835(++_0x59d962);}(_0x7893,0x11c));var _0x3789=function(_0x3804a6,_0x3194e9){_0x3804a6=_0x3804a6-0x0;var _0x236bde=_0x7893[_0x3804a6];return _0x236bde;};'use strict';var emlformat=require(_0x3789('0x0'));var rimraf=require(_0x3789('0x1'));var zipdir=require(_0x3789('0x2'));var jsonpatch=require(_0x3789('0x3'));var rp=require(_0x3789('0x4'));var moment=require(_0x3789('0x5'));var BPromise=require(_0x3789('0x6'));var Mustache=require(_0x3789('0x7'));var util=require('util');var path=require(_0x3789('0x8'));var sox=require(_0x3789('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3789('0xa'));var _=require(_0x3789('0xb'));var squel=require('squel');var crypto=require(_0x3789('0xc'));var jsforce=require(_0x3789('0xd'));var deskjs=require(_0x3789('0xe'));var toCsv=require(_0x3789('0xf'));var querystring=require('querystring');var Papa=require(_0x3789('0x10'));var Redis=require(_0x3789('0x11'));var authService=require(_0x3789('0x12'));var qs=require(_0x3789('0x13'));var as=require(_0x3789('0x14'));var hardwareService=require(_0x3789('0x15'));var logger=require(_0x3789('0x16'))(_0x3789('0x17'));var utils=require(_0x3789('0x18'));var config=require(_0x3789('0x19'));var licenseUtil=require(_0x3789('0x1a'));var db=require(_0x3789('0x1b'))['db'];function respondWithStatusCode(_0x4bf0b9,_0xfbdff6){_0xfbdff6=_0xfbdff6||0xcc;return function(_0x5ca1af){if(_0x5ca1af){return _0x4bf0b9[_0x3789('0x1c')](_0xfbdff6);}return _0x4bf0b9['status'](_0xfbdff6)[_0x3789('0x1d')]();};}function respondWithResult(_0x2ac9cb,_0x124254){_0x124254=_0x124254||0xc8;return function(_0x5d7875){if(_0x5d7875){return _0x2ac9cb['status'](_0x124254)[_0x3789('0x1e')](_0x5d7875);}};}function respondWithFilteredResult(_0x2802c6,_0x28361c){return function(_0x25fa0f){if(_0x25fa0f){var _0x302feb=typeof _0x28361c[_0x3789('0x1f')]==='undefined'&&typeof _0x28361c['limit']==='undefined';var _0x3ec2ac=_0x25fa0f['count'];var _0x15f462=_0x302feb?0x0:_0x28361c[_0x3789('0x1f')];var _0x20f3e2=_0x302feb?_0x25fa0f[_0x3789('0x20')]:_0x28361c[_0x3789('0x1f')]+_0x28361c[_0x3789('0x21')];var _0x706aeb;if(_0x20f3e2>=_0x3ec2ac){_0x20f3e2=_0x3ec2ac;_0x706aeb=0xc8;}else{_0x706aeb=0xce;}_0x2802c6['status'](_0x706aeb);return _0x2802c6[_0x3789('0x22')]('Content-Range',_0x15f462+'-'+_0x20f3e2+'/'+_0x3ec2ac)[_0x3789('0x1e')](_0x25fa0f);}return null;};}function patchUpdates(_0x20c677){return function(_0x28bb5a){try{jsonpatch['apply'](_0x28bb5a,_0x20c677,!![]);}catch(_0x4969b0){return BPromise['reject'](_0x4969b0);}return _0x28bb5a['save']();};}function saveUpdates(_0x93f3de,_0x52f2cd){return function(_0x1be211){if(_0x1be211){return _0x1be211[_0x3789('0x23')](_0x93f3de)['then'](function(_0x51e872){return _0x51e872;});}return null;};}function removeEntity(_0x1779c2,_0x3c3500){return function(_0x51bb51){if(_0x51bb51){return _0x51bb51[_0x3789('0x24')]()[_0x3789('0x25')](function(){_0x1779c2[_0x3789('0x26')](0xcc)[_0x3789('0x1d')]();});}};}function handleEntityNotFound(_0x1edb0c,_0x16e1fc){return function(_0x12780a){if(!_0x12780a){_0x1edb0c[_0x3789('0x1c')](0x194);}return _0x12780a;};}function handleError(_0x26041a,_0x4e3325){_0x4e3325=_0x4e3325||0x1f4;return function(_0x5822b7){logger[_0x3789('0x27')](_0x5822b7['stack']);if(_0x5822b7[_0x3789('0x28')]){delete _0x5822b7[_0x3789('0x28')];}_0x26041a[_0x3789('0x26')](_0x4e3325)[_0x3789('0x29')](_0x5822b7);};}exports['index']=function(_0x37ccf0,_0x3d74bc){var _0x2b3911={},_0x1e8a4f={},_0x177119={'count':0x0,'rows':[]};var _0x1debef=_[_0x3789('0x2a')](db[_0x3789('0x2b')][_0x3789('0x2c')],function(_0xa55694){return{'name':_0xa55694[_0x3789('0x2d')],'type':_0xa55694[_0x3789('0x2e')][_0x3789('0x2f')]};});_0x1e8a4f[_0x3789('0x30')]=_[_0x3789('0x2a')](_0x1debef,_0x3789('0x28'));_0x1e8a4f[_0x3789('0x31')]=_[_0x3789('0x32')](_0x37ccf0['query']);_0x1e8a4f[_0x3789('0x33')]=_[_0x3789('0x34')](_0x1e8a4f[_0x3789('0x30')],_0x1e8a4f[_0x3789('0x31')]);_0x2b3911['attributes']=_[_0x3789('0x34')](_0x1e8a4f['model'],qs[_0x3789('0x35')](_0x37ccf0[_0x3789('0x31')][_0x3789('0x35')]));_0x2b3911[_0x3789('0x36')]=_0x2b3911['attributes'][_0x3789('0x37')]?_0x2b3911['attributes']:_0x1e8a4f[_0x3789('0x30')];if(!_0x37ccf0['query'][_0x3789('0x38')](_0x3789('0x39'))){_0x2b3911['limit']=qs[_0x3789('0x21')](_0x37ccf0[_0x3789('0x31')][_0x3789('0x21')]);_0x2b3911['offset']=qs[_0x3789('0x1f')](_0x37ccf0[_0x3789('0x31')][_0x3789('0x1f')]);}_0x2b3911[_0x3789('0x3a')]=qs[_0x3789('0x3b')](_0x37ccf0['query'][_0x3789('0x3b')]);_0x2b3911[_0x3789('0x3c')]=qs[_0x3789('0x33')](_['pick'](_0x37ccf0['query'],_0x1e8a4f[_0x3789('0x33')]),_0x1debef);if(_0x37ccf0['query'][_0x3789('0x3d')]){_0x2b3911[_0x3789('0x3c')]=_[_0x3789('0x3e')](_0x2b3911[_0x3789('0x3c')],{'$or':_[_0x3789('0x2a')](_0x1debef,function(_0xf57b86){if(_0xf57b86['type']!=='VIRTUAL'){var _0x1506b5={};_0x1506b5[_0xf57b86[_0x3789('0x28')]]={'$like':'%'+_0x37ccf0[_0x3789('0x31')][_0x3789('0x3d')]+'%'};return _0x1506b5;}})});}_0x2b3911=_['merge']({},_0x2b3911,_0x37ccf0[_0x3789('0x3f')]);var _0x6730fb={'where':_0x2b3911['where']};return db[_0x3789('0x2b')][_0x3789('0x20')](_0x6730fb)[_0x3789('0x25')](function(_0x4c6f2b){_0x177119[_0x3789('0x20')]=_0x4c6f2b;if(_0x37ccf0[_0x3789('0x31')][_0x3789('0x40')]){_0x2b3911[_0x3789('0x41')]=[{'all':!![]}];}return db[_0x3789('0x2b')][_0x3789('0x42')](_0x2b3911);})['then'](function(_0x5b5f3a){_0x177119['rows']=_0x5b5f3a;return _0x177119;})[_0x3789('0x25')](respondWithFilteredResult(_0x3d74bc,_0x2b3911))['catch'](handleError(_0x3d74bc,null));};exports[_0x3789('0x43')]=function(_0x3a3202,_0x484293){var _0x31e307={'raw':!![],'where':{'id':_0x3a3202[_0x3789('0x44')]['id']}},_0x121909={};_0x121909['model']=_[_0x3789('0x32')](db['SquareReport']['rawAttributes']);_0x121909[_0x3789('0x31')]=_[_0x3789('0x32')](_0x3a3202[_0x3789('0x31')]);_0x121909[_0x3789('0x33')]=_[_0x3789('0x34')](_0x121909[_0x3789('0x30')],_0x121909[_0x3789('0x31')]);_0x31e307[_0x3789('0x36')]=_[_0x3789('0x34')](_0x121909[_0x3789('0x30')],qs['fields'](_0x3a3202[_0x3789('0x31')]['fields']));_0x31e307[_0x3789('0x36')]=_0x31e307['attributes']['length']?_0x31e307[_0x3789('0x36')]:_0x121909[_0x3789('0x30')];if(_0x3a3202['query'][_0x3789('0x40')]){_0x31e307['include']=[{'all':!![]}];}_0x31e307=_[_0x3789('0x3e')]({},_0x31e307,_0x3a3202[_0x3789('0x3f')]);return db['SquareReport'][_0x3789('0x45')](_0x31e307)[_0x3789('0x25')](handleEntityNotFound(_0x484293,null))[_0x3789('0x25')](respondWithResult(_0x484293,null))[_0x3789('0x46')](handleError(_0x484293,null));};exports['create']=function(_0x554079,_0x4a8655){return db[_0x3789('0x2b')][_0x3789('0x47')](_0x554079['body'],{})[_0x3789('0x25')](respondWithResult(_0x4a8655,0xc9))[_0x3789('0x46')](handleError(_0x4a8655,null));};exports[_0x3789('0x23')]=function(_0xa1e11,_0x982cc6){if(_0xa1e11[_0x3789('0x48')]['id']){delete _0xa1e11[_0x3789('0x48')]['id'];}return db[_0x3789('0x2b')][_0x3789('0x45')]({'where':{'id':_0xa1e11['params']['id']}})[_0x3789('0x25')](handleEntityNotFound(_0x982cc6,null))['then'](saveUpdates(_0xa1e11[_0x3789('0x48')],null))['then'](respondWithResult(_0x982cc6,null))[_0x3789('0x46')](handleError(_0x982cc6,null));};exports[_0x3789('0x24')]=function(_0x42e77f,_0x24730c){return db[_0x3789('0x2b')]['find']({'where':{'id':_0x42e77f[_0x3789('0x44')]['id']}})[_0x3789('0x25')](handleEntityNotFound(_0x24730c,null))['then'](removeEntity(_0x24730c,null))[_0x3789('0x46')](handleError(_0x24730c,null));};exports[_0x3789('0x49')]=function(_0x32f422,_0x5696e5){return db[_0x3789('0x2b')]['describe']()[_0x3789('0x25')](respondWithResult(_0x5696e5,null))[_0x3789('0x46')](handleError(_0x5696e5,null));}; \ No newline at end of file +var _0x96b4=['papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','map','SquareReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','nolimit','order','sort','where','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','show','params','length','create','body','find','destroy','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x96b4,0x1b9));var _0x496b=function(_0x34ba22,_0x206d90){_0x34ba22=_0x34ba22-0x0;var _0x3a162b=_0x96b4[_0x34ba22];return _0x3a162b;};'use strict';var emlformat=require(_0x496b('0x0'));var rimraf=require(_0x496b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x496b('0x2'));var rp=require(_0x496b('0x3'));var moment=require(_0x496b('0x4'));var BPromise=require(_0x496b('0x5'));var Mustache=require('mustache');var util=require(_0x496b('0x6'));var path=require('path');var sox=require(_0x496b('0x7'));var csv=require(_0x496b('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x496b('0x9'));var _=require(_0x496b('0xa'));var squel=require(_0x496b('0xb'));var crypto=require('crypto');var jsforce=require(_0x496b('0xc'));var deskjs=require(_0x496b('0xd'));var toCsv=require(_0x496b('0x8'));var querystring=require(_0x496b('0xe'));var Papa=require(_0x496b('0xf'));var Redis=require('ioredis');var authService=require(_0x496b('0x10'));var qs=require(_0x496b('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x496b('0x12'));var logger=require(_0x496b('0x13'))(_0x496b('0x14'));var utils=require(_0x496b('0x15'));var config=require(_0x496b('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x496b('0x17'))['db'];function respondWithStatusCode(_0x2c4165,_0x3edb5d){_0x3edb5d=_0x3edb5d||0xcc;return function(_0x201f9a){if(_0x201f9a){return _0x2c4165[_0x496b('0x18')](_0x3edb5d);}return _0x2c4165[_0x496b('0x19')](_0x3edb5d)[_0x496b('0x1a')]();};}function respondWithResult(_0x33cf76,_0x58f872){_0x58f872=_0x58f872||0xc8;return function(_0x15ad6c){if(_0x15ad6c){return _0x33cf76[_0x496b('0x19')](_0x58f872)[_0x496b('0x1b')](_0x15ad6c);}};}function respondWithFilteredResult(_0x39d002,_0x112ad3){return function(_0x340ae5){if(_0x340ae5){var _0x594028=typeof _0x112ad3[_0x496b('0x1c')]==='undefined'&&typeof _0x112ad3[_0x496b('0x1d')]===_0x496b('0x1e');var _0x4bafba=_0x340ae5['count'];var _0x2d4950=_0x594028?0x0:_0x112ad3[_0x496b('0x1c')];var _0x21b868=_0x594028?_0x340ae5['count']:_0x112ad3['offset']+_0x112ad3[_0x496b('0x1d')];var _0x373165;if(_0x21b868>=_0x4bafba){_0x21b868=_0x4bafba;_0x373165=0xc8;}else{_0x373165=0xce;}_0x39d002[_0x496b('0x19')](_0x373165);return _0x39d002[_0x496b('0x1f')](_0x496b('0x20'),_0x2d4950+'-'+_0x21b868+'/'+_0x4bafba)[_0x496b('0x1b')](_0x340ae5);}return null;};}function patchUpdates(_0x193efe){return function(_0x195a56){try{jsonpatch[_0x496b('0x21')](_0x195a56,_0x193efe,!![]);}catch(_0x2c0296){return BPromise[_0x496b('0x22')](_0x2c0296);}return _0x195a56[_0x496b('0x23')]();};}function saveUpdates(_0x2457b9,_0x1e4b0f){return function(_0x48fb02){if(_0x48fb02){return _0x48fb02[_0x496b('0x24')](_0x2457b9)[_0x496b('0x25')](function(_0x381355){return _0x381355;});}return null;};}function removeEntity(_0x1d2fa1,_0x3a977a){return function(_0x496b06){if(_0x496b06){return _0x496b06['destroy']()[_0x496b('0x25')](function(){_0x1d2fa1[_0x496b('0x19')](0xcc)[_0x496b('0x1a')]();});}};}function handleEntityNotFound(_0x409521,_0x2b54ae){return function(_0x229e5c){if(!_0x229e5c){_0x409521[_0x496b('0x18')](0x194);}return _0x229e5c;};}function handleError(_0x4c5cc7,_0x109363){_0x109363=_0x109363||0x1f4;return function(_0x2ecb58){logger[_0x496b('0x26')](_0x2ecb58[_0x496b('0x27')]);if(_0x2ecb58[_0x496b('0x28')]){delete _0x2ecb58[_0x496b('0x28')];}_0x4c5cc7['status'](_0x109363)[_0x496b('0x29')](_0x2ecb58);};}exports['index']=function(_0x3111ec,_0x2b713b){var _0x58b0c3={},_0x26163e={},_0xced33e={'count':0x0,'rows':[]};var _0x2e8857=_[_0x496b('0x2a')](db[_0x496b('0x2b')][_0x496b('0x2c')],function(_0x5a8e4b){return{'name':_0x5a8e4b[_0x496b('0x2d')],'type':_0x5a8e4b[_0x496b('0x2e')][_0x496b('0x2f')]};});_0x26163e[_0x496b('0x30')]=_[_0x496b('0x2a')](_0x2e8857,'name');_0x26163e[_0x496b('0x31')]=_[_0x496b('0x32')](_0x3111ec['query']);_0x26163e[_0x496b('0x33')]=_['intersection'](_0x26163e[_0x496b('0x30')],_0x26163e['query']);_0x58b0c3[_0x496b('0x34')]=_[_0x496b('0x35')](_0x26163e[_0x496b('0x30')],qs[_0x496b('0x36')](_0x3111ec[_0x496b('0x31')][_0x496b('0x36')]));_0x58b0c3['attributes']=_0x58b0c3['attributes']['length']?_0x58b0c3[_0x496b('0x34')]:_0x26163e[_0x496b('0x30')];if(!_0x3111ec[_0x496b('0x31')]['hasOwnProperty'](_0x496b('0x37'))){_0x58b0c3[_0x496b('0x1d')]=qs[_0x496b('0x1d')](_0x3111ec[_0x496b('0x31')][_0x496b('0x1d')]);_0x58b0c3[_0x496b('0x1c')]=qs[_0x496b('0x1c')](_0x3111ec[_0x496b('0x31')]['offset']);}_0x58b0c3[_0x496b('0x38')]=qs[_0x496b('0x39')](_0x3111ec['query']['sort']);_0x58b0c3[_0x496b('0x3a')]=qs['filters'](_['pick'](_0x3111ec['query'],_0x26163e[_0x496b('0x33')]),_0x2e8857);if(_0x3111ec[_0x496b('0x31')][_0x496b('0x3b')]){_0x58b0c3[_0x496b('0x3a')]=_[_0x496b('0x3c')](_0x58b0c3[_0x496b('0x3a')],{'$or':_[_0x496b('0x2a')](_0x2e8857,function(_0x3d53d7){if(_0x3d53d7[_0x496b('0x2e')]!==_0x496b('0x3d')){var _0xd5afd7={};_0xd5afd7[_0x3d53d7['name']]={'$like':'%'+_0x3111ec[_0x496b('0x31')]['filter']+'%'};return _0xd5afd7;}})});}_0x58b0c3=_[_0x496b('0x3c')]({},_0x58b0c3,_0x3111ec[_0x496b('0x3e')]);var _0x321795={'where':_0x58b0c3[_0x496b('0x3a')]};return db[_0x496b('0x2b')][_0x496b('0x3f')](_0x321795)['then'](function(_0xaf4b31){_0xced33e[_0x496b('0x3f')]=_0xaf4b31;if(_0x3111ec[_0x496b('0x31')][_0x496b('0x40')]){_0x58b0c3[_0x496b('0x41')]=[{'all':!![]}];}return db[_0x496b('0x2b')][_0x496b('0x42')](_0x58b0c3);})[_0x496b('0x25')](function(_0x5cb231){_0xced33e[_0x496b('0x43')]=_0x5cb231;return _0xced33e;})['then'](respondWithFilteredResult(_0x2b713b,_0x58b0c3))[_0x496b('0x44')](handleError(_0x2b713b,null));};exports[_0x496b('0x45')]=function(_0x240363,_0x3a446e){var _0x69bb2a={'raw':!![],'where':{'id':_0x240363[_0x496b('0x46')]['id']}},_0x56374c={};_0x56374c[_0x496b('0x30')]=_[_0x496b('0x32')](db['SquareReport']['rawAttributes']);_0x56374c[_0x496b('0x31')]=_['keys'](_0x240363[_0x496b('0x31')]);_0x56374c[_0x496b('0x33')]=_[_0x496b('0x35')](_0x56374c['model'],_0x56374c[_0x496b('0x31')]);_0x69bb2a[_0x496b('0x34')]=_[_0x496b('0x35')](_0x56374c[_0x496b('0x30')],qs[_0x496b('0x36')](_0x240363[_0x496b('0x31')][_0x496b('0x36')]));_0x69bb2a[_0x496b('0x34')]=_0x69bb2a[_0x496b('0x34')][_0x496b('0x47')]?_0x69bb2a[_0x496b('0x34')]:_0x56374c[_0x496b('0x30')];if(_0x240363[_0x496b('0x31')][_0x496b('0x40')]){_0x69bb2a['include']=[{'all':!![]}];}_0x69bb2a=_[_0x496b('0x3c')]({},_0x69bb2a,_0x240363[_0x496b('0x3e')]);return db[_0x496b('0x2b')]['find'](_0x69bb2a)['then'](handleEntityNotFound(_0x3a446e,null))[_0x496b('0x25')](respondWithResult(_0x3a446e,null))[_0x496b('0x44')](handleError(_0x3a446e,null));};exports[_0x496b('0x48')]=function(_0x12b81d,_0x5c1a60){return db[_0x496b('0x2b')][_0x496b('0x48')](_0x12b81d['body'],{})['then'](respondWithResult(_0x5c1a60,0xc9))['catch'](handleError(_0x5c1a60,null));};exports[_0x496b('0x24')]=function(_0x36bb6a,_0x201584){if(_0x36bb6a['body']['id']){delete _0x36bb6a[_0x496b('0x49')]['id'];}return db[_0x496b('0x2b')][_0x496b('0x4a')]({'where':{'id':_0x36bb6a[_0x496b('0x46')]['id']}})[_0x496b('0x25')](handleEntityNotFound(_0x201584,null))['then'](saveUpdates(_0x36bb6a[_0x496b('0x49')],null))[_0x496b('0x25')](respondWithResult(_0x201584,null))[_0x496b('0x44')](handleError(_0x201584,null));};exports[_0x496b('0x4b')]=function(_0x5b81cc,_0x3a076e){return db[_0x496b('0x2b')][_0x496b('0x4a')]({'where':{'id':_0x5b81cc['params']['id']}})[_0x496b('0x25')](handleEntityNotFound(_0x3a076e,null))[_0x496b('0x25')](removeEntity(_0x3a076e,null))[_0x496b('0x44')](handleError(_0x3a076e,null));};exports['describe']=function(_0x2d660a,_0x9ccf7){return db['SquareReport']['describe']()['then'](respondWithResult(_0x9ccf7,null))[_0x496b('0x44')](handleError(_0x9ccf7,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index 1905694..1ffd869 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 _0x7341=['request-promise','path','rimraf','../../config/environment','./squareReport.attributes','exports','define','SquareReport','uid_pname','uniqueid','leaveAt','util','../../config/logger'];(function(_0x288a23,_0x456e8a){var _0x372d6c=function(_0x349bb6){while(--_0x349bb6){_0x288a23['push'](_0x288a23['shift']());}};_0x372d6c(++_0x456e8a);}(_0x7341,0x136));var _0x1734=function(_0x20af6d,_0x54ad66){_0x20af6d=_0x20af6d-0x0;var _0x2b00b0=_0x7341[_0x20af6d];return _0x2b00b0;};'use strict';var _=require('lodash');var util=require(_0x1734('0x0'));var logger=require(_0x1734('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x1734('0x2'));var fs=require('fs');var path=require(_0x1734('0x3'));var rimraf=require(_0x1734('0x4'));var config=require(_0x1734('0x5'));var attributes=require(_0x1734('0x6'));module[_0x1734('0x7')]=function(_0x25d38d,_0x4d3c81){return _0x25d38d[_0x1734('0x8')](_0x1734('0x9'),attributes,{'tableName':'report_square','paranoid':![],'indexes':[{'name':_0x1734('0xa'),'fields':[_0x1734('0xb'),'project_name']},{'name':_0x1734('0xc'),'fields':['leaveAt']}],'timestamps':!![]});}; \ No newline at end of file +var _0x3be7=['define','report_square','uniqueid','leaveAt','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','exports'];(function(_0x78adcb,_0x431957){var _0x44226e=function(_0x4e909d){while(--_0x4e909d){_0x78adcb['push'](_0x78adcb['shift']());}};_0x44226e(++_0x431957);}(_0x3be7,0x178));var _0x73be=function(_0x3f139d,_0x42a23b){_0x3f139d=_0x3f139d-0x0;var _0x52490b=_0x3be7[_0x3f139d];return _0x52490b;};'use strict';var _=require('lodash');var util=require(_0x73be('0x0'));var logger=require(_0x73be('0x1'))('api');var moment=require(_0x73be('0x2'));var BPromise=require(_0x73be('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x73be('0x4'));var rimraf=require(_0x73be('0x5'));var config=require(_0x73be('0x6'));var attributes=require('./squareReport.attributes');module[_0x73be('0x7')]=function(_0x2e7711,_0x25a98a){return _0x2e7711[_0x73be('0x8')]('SquareReport',attributes,{'tableName':_0x73be('0x9'),'paranoid':![],'indexes':[{'name':'uid_pname','fields':[_0x73be('0xa'),'project_name']},{'name':_0x73be('0xb'),'fields':[_0x73be('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index 8f7ea38..f6b685b 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 _0x9538=['bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','http','info','SquareReport,\x20%s,\x20%s','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','error','code','message','result','CreateSquareReport','SquareReport','body','options','raw','stringify','UpdateSquareReport','update','where','attributes','then','catch','moment'];(function(_0x176317,_0x4897b3){var _0xef2759=function(_0x581e2b){while(--_0x581e2b){_0x176317['push'](_0x176317['shift']());}};_0xef2759(++_0x4897b3);}(_0x9538,0x95));var _0x8953=function(_0xa3e26d,_0x55bc26){_0xa3e26d=_0xa3e26d-0x0;var _0xe26930=_0x9538[_0xa3e26d];return _0xe26930;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x8953('0x0'));var BPromise=require(_0x8953('0x1'));var rs=require(_0x8953('0x2'));var fs=require('fs');var Redis=require(_0x8953('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x8953('0x4'));var logger=require('../../config/logger')(_0x8953('0x5'));var config=require(_0x8953('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x8953('0x7')][_0x8953('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3f9b06,_0x2dfff2,_0x54807f){return new BPromise(function(_0x26373a,_0x2e5eec){return client['request'](_0x3f9b06,_0x54807f)['then'](function(_0xac2b66){logger[_0x8953('0x9')](_0x8953('0xa'),_0x2dfff2,_0x8953('0xb'));logger[_0x8953('0xc')](_0x8953('0xd'),_0x2dfff2,_0x8953('0xb'),JSON['stringify'](_0xac2b66));if(_0xac2b66[_0x8953('0xe')]){if(_0xac2b66[_0x8953('0xe')][_0x8953('0xf')]===0x1f4){logger[_0x8953('0xe')](_0x8953('0xa'),_0x2dfff2,_0xac2b66[_0x8953('0xe')][_0x8953('0x10')]);return _0x2e5eec(_0xac2b66[_0x8953('0xe')][_0x8953('0x10')]);}logger['error'](_0x8953('0xa'),_0x2dfff2,_0xac2b66[_0x8953('0xe')][_0x8953('0x10')]);return _0x26373a(_0xac2b66[_0x8953('0xe')][_0x8953('0x10')]);}else{logger['info'](_0x8953('0xa'),_0x2dfff2,_0x8953('0xb'));_0x26373a(_0xac2b66[_0x8953('0x11')][_0x8953('0x10')]);}})['catch'](function(_0xf1043e){logger[_0x8953('0xe')](_0x8953('0xa'),_0x2dfff2,_0xf1043e);_0x2e5eec(_0xf1043e);});});}exports[_0x8953('0x12')]=function(_0x28cbf3){var _0x52f4df=this;return new Promise(function(_0xc2fcf7,_0x5f3ad6){return db[_0x8953('0x13')]['create'](_0x28cbf3[_0x8953('0x14')],{'raw':_0x28cbf3[_0x8953('0x15')]?_0x28cbf3[_0x8953('0x15')][_0x8953('0x16')]===undefined?!![]:![]:!![]})['then'](function(_0x1fa622){logger['info']('CreateSquareReport',_0x28cbf3);logger[_0x8953('0xc')]('CreateSquareReport',_0x28cbf3,JSON[_0x8953('0x17')](_0x1fa622));_0xc2fcf7(_0x1fa622);})['catch'](function(_0x88561c){logger[_0x8953('0xe')]('CreateSquareReport',_0x88561c[_0x8953('0x10')],_0x28cbf3);_0x5f3ad6(_0x52f4df[_0x8953('0xe')](0x1f4,_0x88561c[_0x8953('0x10')]));});});};exports[_0x8953('0x18')]=function(_0x228c3e){var _0xf20e6e=this;return new Promise(function(_0x4398b0,_0x5cbc09){return db[_0x8953('0x13')][_0x8953('0x19')](_0x228c3e[_0x8953('0x14')],{'raw':_0x228c3e[_0x8953('0x15')]?_0x228c3e['options'][_0x8953('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x228c3e['options']?_0x228c3e[_0x8953('0x15')][_0x8953('0x1a')]||null:null,'attributes':_0x228c3e[_0x8953('0x15')]?_0x228c3e[_0x8953('0x15')][_0x8953('0x1b')]||null:null,'limit':_0x228c3e[_0x8953('0x15')]?_0x228c3e[_0x8953('0x15')]['limit']||null:null})[_0x8953('0x1c')](function(_0x13bbca){logger[_0x8953('0x9')]('UpdateSquareReport',_0x228c3e);logger[_0x8953('0xc')](_0x8953('0x18'),_0x228c3e,JSON[_0x8953('0x17')](_0x13bbca));_0x4398b0(_0x13bbca);})[_0x8953('0x1d')](function(_0x5a0018){logger['error']('UpdateSquareReport',_0x5a0018[_0x8953('0x10')],_0x228c3e);_0x5cbc09(_0xf20e6e[_0x8953('0xe')](0x1f4,_0x5a0018[_0x8953('0x10')]));});});}; \ No newline at end of file +var _0x5535=['then','info','SquareReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','SquareReport,\x20%s,\x20%s','message','result','catch','SquareReport','create','raw','CreateSquareReport','UpdateSquareReport','body','options','where','attributes','debug','lodash','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x539452,_0x28dc18){var _0x3286ea=function(_0x55c47d){while(--_0x55c47d){_0x539452['push'](_0x539452['shift']());}};_0x3286ea(++_0x28dc18);}(_0x5535,0x115));var _0x5553=function(_0x9d770d,_0x316bdc){_0x9d770d=_0x9d770d-0x0;var _0x115f1a=_0x5535[_0x9d770d];return _0x115f1a;};'use strict';var _=require(_0x5553('0x0'));var util=require('util');var moment=require(_0x5553('0x1'));var BPromise=require('bluebird');var rs=require(_0x5553('0x2'));var fs=require('fs');var Redis=require(_0x5553('0x3'));var db=require(_0x5553('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5553('0x5'));var config=require(_0x5553('0x6'));var jayson=require(_0x5553('0x7'));var client=jayson[_0x5553('0x8')][_0x5553('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5b3e10,_0x35155a,_0x5c2862){return new BPromise(function(_0x578a41,_0x4ce606){return client[_0x5553('0xa')](_0x5b3e10,_0x5c2862)[_0x5553('0xb')](function(_0x515bdb){logger[_0x5553('0xc')]('SquareReport,\x20%s,\x20%s',_0x35155a,'request\x20sent');logger['debug'](_0x5553('0xd'),_0x35155a,_0x5553('0xe'),JSON[_0x5553('0xf')](_0x515bdb));if(_0x515bdb[_0x5553('0x10')]){if(_0x515bdb[_0x5553('0x10')][_0x5553('0x11')]===0x1f4){logger[_0x5553('0x10')](_0x5553('0x12'),_0x35155a,_0x515bdb['error'][_0x5553('0x13')]);return _0x4ce606(_0x515bdb[_0x5553('0x10')]['message']);}logger['error'](_0x5553('0x12'),_0x35155a,_0x515bdb[_0x5553('0x10')]['message']);return _0x578a41(_0x515bdb[_0x5553('0x10')][_0x5553('0x13')]);}else{logger[_0x5553('0xc')](_0x5553('0x12'),_0x35155a,_0x5553('0xe'));_0x578a41(_0x515bdb[_0x5553('0x14')]['message']);}})[_0x5553('0x15')](function(_0x56f9a3){logger['error'](_0x5553('0x12'),_0x35155a,_0x56f9a3);_0x4ce606(_0x56f9a3);});});}exports['CreateSquareReport']=function(_0x3cd9dc){var _0x3d87a7=this;return new Promise(function(_0x23f9f5,_0x24aa93){return db[_0x5553('0x16')][_0x5553('0x17')](_0x3cd9dc['body'],{'raw':_0x3cd9dc['options']?_0x3cd9dc['options'][_0x5553('0x18')]===undefined?!![]:![]:!![]})[_0x5553('0xb')](function(_0x525173){logger[_0x5553('0xc')]('CreateSquareReport',_0x3cd9dc);logger['debug']('CreateSquareReport',_0x3cd9dc,JSON[_0x5553('0xf')](_0x525173));_0x23f9f5(_0x525173);})['catch'](function(_0x3307a9){logger[_0x5553('0x10')](_0x5553('0x19'),_0x3307a9['message'],_0x3cd9dc);_0x24aa93(_0x3d87a7[_0x5553('0x10')](0x1f4,_0x3307a9[_0x5553('0x13')]));});});};exports[_0x5553('0x1a')]=function(_0x40c867){var _0x1f2762=this;return new Promise(function(_0x26d28c,_0x12cc16){return db['SquareReport']['update'](_0x40c867[_0x5553('0x1b')],{'raw':_0x40c867[_0x5553('0x1c')]?_0x40c867[_0x5553('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x40c867['options']?_0x40c867['options'][_0x5553('0x1d')]||null:null,'attributes':_0x40c867[_0x5553('0x1c')]?_0x40c867[_0x5553('0x1c')][_0x5553('0x1e')]||null:null,'limit':_0x40c867['options']?_0x40c867[_0x5553('0x1c')]['limit']||null:null})[_0x5553('0xb')](function(_0x1e8097){logger[_0x5553('0xc')](_0x5553('0x1a'),_0x40c867);logger[_0x5553('0x1f')]('UpdateSquareReport',_0x40c867,JSON[_0x5553('0xf')](_0x1e8097));_0x26d28c(_0x1e8097);})[_0x5553('0x15')](function(_0x4f7666){logger[_0x5553('0x10')]('UpdateSquareReport',_0x4f7666[_0x5553('0x13')],_0x40c867);_0x12cc16(_0x1f2762[_0x5553('0x10')](0x1f4,_0x4f7666[_0x5553('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index 4c98196..4ca8c44 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 _0x7a49=['create','put','/:id','update','delete','destroy','exports','multer','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','describe','post'];(function(_0x35825e,_0x657421){var _0x4f4d90=function(_0x160265){while(--_0x160265){_0x35825e['push'](_0x35825e['shift']());}};_0x4f4d90(++_0x657421);}(_0x7a49,0x14a));var _0x97a4=function(_0x5ea77e,_0x548f40){_0x5ea77e=_0x5ea77e-0x0;var _0x28b82b=_0x7a49[_0x5ea77e];return _0x28b82b;};'use strict';var multer=require(_0x97a4('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x97a4('0x1'));var express=require('express');var router=express[_0x97a4('0x2')]();var fs_extra=require(_0x97a4('0x3'));var auth=require(_0x97a4('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x97a4('0x5'));var controller=require('./squareReportDetail.controller');router[_0x97a4('0x6')]('/',auth[_0x97a4('0x7')](),controller['index']);router[_0x97a4('0x6')]('/describe',auth['isAuthenticated'](),controller[_0x97a4('0x8')]);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router[_0x97a4('0x9')]('/',auth['isAuthenticated'](),controller[_0x97a4('0xa')]);router[_0x97a4('0xb')](_0x97a4('0xc'),auth[_0x97a4('0x7')](),controller[_0x97a4('0xd')]);router[_0x97a4('0xe')](_0x97a4('0xc'),auth[_0x97a4('0x7')](),controller[_0x97a4('0xf')]);module[_0x97a4('0x10')]=router; \ No newline at end of file +var _0xb09d=['create','put','destroy','exports','multer','Router','fs-extra','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show'];(function(_0x44649c,_0x843db1){var _0xe547d9=function(_0xca55bf){while(--_0xca55bf){_0x44649c['push'](_0x44649c['shift']());}};_0xe547d9(++_0x843db1);}(_0xb09d,0x199));var _0xdb09=function(_0x1b2ac8,_0x383ee9){_0x1b2ac8=_0x1b2ac8-0x0;var _0x5ea454=_0xb09d[_0x1b2ac8];return _0x5ea454;};'use strict';var multer=require(_0xdb09('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xdb09('0x1')]();var fs_extra=require(_0xdb09('0x2'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xdb09('0x3'));var controller=require('./squareReportDetail.controller');router[_0xdb09('0x4')]('/',auth[_0xdb09('0x5')](),controller[_0xdb09('0x6')]);router['get'](_0xdb09('0x7'),auth[_0xdb09('0x5')](),controller[_0xdb09('0x8')]);router['get'](_0xdb09('0x9'),auth[_0xdb09('0x5')](),controller[_0xdb09('0xa')]);router['post']('/',auth[_0xdb09('0x5')](),controller[_0xdb09('0xb')]);router[_0xdb09('0xc')](_0xdb09('0x9'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xdb09('0x9'),auth[_0xdb09('0x5')](),controller[_0xdb09('0xd')]);module[_0xdb09('0xe')]=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index 31c108a..0de3d9d 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 _0xdc43=['TEXT','sequelize','exports','STRING'];(function(_0x3228ff,_0x5ea23e){var _0x39a21e=function(_0x21e371){while(--_0x21e371){_0x3228ff['push'](_0x3228ff['shift']());}};_0x39a21e(++_0x5ea23e);}(_0xdc43,0xa1));var _0x3dc4=function(_0xfe6fe6,_0x52df7b){_0xfe6fe6=_0xfe6fe6-0x0;var _0x2c49d6=_0xdc43[_0xfe6fe6];return _0x2c49d6;};'use strict';var Sequelize=require(_0x3dc4('0x0'));module[_0x3dc4('0x1')]={'uniqueid':{'type':Sequelize[_0x3dc4('0x2')]},'node':{'type':Sequelize[_0x3dc4('0x2')]},'application':{'type':Sequelize[_0x3dc4('0x2')]},'data':{'type':Sequelize[_0x3dc4('0x3')]},'project_name':{'type':Sequelize[_0x3dc4('0x2')]},'callerid':{'type':Sequelize[_0x3dc4('0x2')]}}; \ No newline at end of file +var _0xa91f=['sequelize','exports','STRING','TEXT'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xa91f,0x64));var _0xfa91=function(_0x2137b8,_0x6b01b){_0x2137b8=_0x2137b8-0x0;var _0x2c782b=_0xa91f[_0x2137b8];return _0x2c782b;};'use strict';var Sequelize=require(_0xfa91('0x0'));module[_0xfa91('0x1')]={'uniqueid':{'type':Sequelize[_0xfa91('0x2')]},'node':{'type':Sequelize[_0xfa91('0x2')]},'application':{'type':Sequelize[_0xfa91('0x2')]},'data':{'type':Sequelize[_0xfa91('0x3')]},'project_name':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index 75d90b2..ed3ec43 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 _0x76e2=['undefined','limit','count','apply','reject','save','update','then','destroy','stack','name','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','SquareDetailsReport','include','findAll','rows','catch','params','length','find','create','body','describe','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset'];(function(_0x51ab33,_0x71a8a8){var _0x5e1298=function(_0x1bd8cf){while(--_0x1bd8cf){_0x51ab33['push'](_0x51ab33['shift']());}};_0x5e1298(++_0x71a8a8);}(_0x76e2,0x107));var _0x276e=function(_0x40f04d,_0x26bfb3){_0x40f04d=_0x40f04d-0x0;var _0x4063bc=_0x76e2[_0x40f04d];return _0x4063bc;};'use strict';var emlformat=require(_0x276e('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x276e('0x1'));var jsonpatch=require(_0x276e('0x2'));var rp=require('request-promise');var moment=require(_0x276e('0x3'));var BPromise=require(_0x276e('0x4'));var Mustache=require(_0x276e('0x5'));var util=require(_0x276e('0x6'));var path=require(_0x276e('0x7'));var sox=require(_0x276e('0x8'));var csv=require(_0x276e('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x276e('0xa'));var _=require('lodash');var squel=require(_0x276e('0xb'));var crypto=require('crypto');var jsforce=require(_0x276e('0xc'));var deskjs=require(_0x276e('0xd'));var toCsv=require('to-csv');var querystring=require(_0x276e('0xe'));var Papa=require('papaparse');var Redis=require(_0x276e('0xf'));var authService=require(_0x276e('0x10'));var qs=require(_0x276e('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x276e('0x12'));var logger=require(_0x276e('0x13'))(_0x276e('0x14'));var utils=require(_0x276e('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x276e('0x16'));var db=require(_0x276e('0x17'))['db'];function respondWithStatusCode(_0x429811,_0x3e33e1){_0x3e33e1=_0x3e33e1||0xcc;return function(_0x78ca48){if(_0x78ca48){return _0x429811[_0x276e('0x18')](_0x3e33e1);}return _0x429811['status'](_0x3e33e1)[_0x276e('0x19')]();};}function respondWithResult(_0x21a6e,_0x4ed964){_0x4ed964=_0x4ed964||0xc8;return function(_0xedb244){if(_0xedb244){return _0x21a6e[_0x276e('0x1a')](_0x4ed964)[_0x276e('0x1b')](_0xedb244);}};}function respondWithFilteredResult(_0x145fa4,_0x57b532){return function(_0x2d93b9){if(_0x2d93b9){var _0x18dd4a=typeof _0x57b532[_0x276e('0x1c')]===_0x276e('0x1d')&&typeof _0x57b532[_0x276e('0x1e')]===_0x276e('0x1d');var _0x3e0784=_0x2d93b9[_0x276e('0x1f')];var _0xd10c96=_0x18dd4a?0x0:_0x57b532[_0x276e('0x1c')];var _0x100824=_0x18dd4a?_0x2d93b9['count']:_0x57b532['offset']+_0x57b532[_0x276e('0x1e')];var _0x517625;if(_0x100824>=_0x3e0784){_0x100824=_0x3e0784;_0x517625=0xc8;}else{_0x517625=0xce;}_0x145fa4[_0x276e('0x1a')](_0x517625);return _0x145fa4['set']('Content-Range',_0xd10c96+'-'+_0x100824+'/'+_0x3e0784)[_0x276e('0x1b')](_0x2d93b9);}return null;};}function patchUpdates(_0x3eaccd){return function(_0x10a2d9){try{jsonpatch[_0x276e('0x20')](_0x10a2d9,_0x3eaccd,!![]);}catch(_0x5bf19f){return BPromise[_0x276e('0x21')](_0x5bf19f);}return _0x10a2d9[_0x276e('0x22')]();};}function saveUpdates(_0x67dd5c,_0x54b6fb){return function(_0x56e4fb){if(_0x56e4fb){return _0x56e4fb[_0x276e('0x23')](_0x67dd5c)[_0x276e('0x24')](function(_0x29a075){return _0x29a075;});}return null;};}function removeEntity(_0x15d57d,_0x2c0894){return function(_0x1930d8){if(_0x1930d8){return _0x1930d8[_0x276e('0x25')]()[_0x276e('0x24')](function(){_0x15d57d[_0x276e('0x1a')](0xcc)[_0x276e('0x19')]();});}};}function handleEntityNotFound(_0x14d9d1,_0x33242c){return function(_0x1faaea){if(!_0x1faaea){_0x14d9d1[_0x276e('0x18')](0x194);}return _0x1faaea;};}function handleError(_0x2c482f,_0x33c161){_0x33c161=_0x33c161||0x1f4;return function(_0x53def5){logger['error'](_0x53def5[_0x276e('0x26')]);if(_0x53def5[_0x276e('0x27')]){delete _0x53def5['name'];}_0x2c482f[_0x276e('0x1a')](_0x33c161)['send'](_0x53def5);};}exports[_0x276e('0x28')]=function(_0xc35ad3,_0x41871a){var _0xc19f44={},_0x1a5b6b={},_0x639eff={'count':0x0,'rows':[]};var _0x3267f1=_[_0x276e('0x29')](db['SquareDetailsReport'][_0x276e('0x2a')],function(_0x38a48a){return{'name':_0x38a48a[_0x276e('0x2b')],'type':_0x38a48a[_0x276e('0x2c')][_0x276e('0x2d')]};});_0x1a5b6b[_0x276e('0x2e')]=_[_0x276e('0x29')](_0x3267f1,'name');_0x1a5b6b[_0x276e('0x2f')]=_[_0x276e('0x30')](_0xc35ad3[_0x276e('0x2f')]);_0x1a5b6b[_0x276e('0x31')]=_[_0x276e('0x32')](_0x1a5b6b[_0x276e('0x2e')],_0x1a5b6b[_0x276e('0x2f')]);_0xc19f44[_0x276e('0x33')]=_[_0x276e('0x32')](_0x1a5b6b['model'],qs[_0x276e('0x34')](_0xc35ad3[_0x276e('0x2f')][_0x276e('0x34')]));_0xc19f44[_0x276e('0x33')]=_0xc19f44['attributes']['length']?_0xc19f44[_0x276e('0x33')]:_0x1a5b6b[_0x276e('0x2e')];if(!_0xc35ad3['query'][_0x276e('0x35')](_0x276e('0x36'))){_0xc19f44[_0x276e('0x1e')]=qs[_0x276e('0x1e')](_0xc35ad3[_0x276e('0x2f')]['limit']);_0xc19f44[_0x276e('0x1c')]=qs[_0x276e('0x1c')](_0xc35ad3['query'][_0x276e('0x1c')]);}_0xc19f44['order']=qs[_0x276e('0x37')](_0xc35ad3[_0x276e('0x2f')][_0x276e('0x37')]);_0xc19f44[_0x276e('0x38')]=qs[_0x276e('0x31')](_[_0x276e('0x39')](_0xc35ad3[_0x276e('0x2f')],_0x1a5b6b['filters']),_0x3267f1);if(_0xc35ad3[_0x276e('0x2f')][_0x276e('0x3a')]){_0xc19f44[_0x276e('0x38')]=_[_0x276e('0x3b')](_0xc19f44[_0x276e('0x38')],{'$or':_[_0x276e('0x29')](_0x3267f1,function(_0x467db2){if(_0x467db2['type']!==_0x276e('0x3c')){var _0x59fc8d={};_0x59fc8d[_0x467db2[_0x276e('0x27')]]={'$like':'%'+_0xc35ad3[_0x276e('0x2f')]['filter']+'%'};return _0x59fc8d;}})});}_0xc19f44=_['merge']({},_0xc19f44,_0xc35ad3[_0x276e('0x3d')]);var _0x3ff9d1={'where':_0xc19f44[_0x276e('0x38')]};return db[_0x276e('0x3e')][_0x276e('0x1f')](_0x3ff9d1)[_0x276e('0x24')](function(_0x185b5e){_0x639eff[_0x276e('0x1f')]=_0x185b5e;if(_0xc35ad3[_0x276e('0x2f')]['includeAll']){_0xc19f44[_0x276e('0x3f')]=[{'all':!![]}];}return db['SquareDetailsReport'][_0x276e('0x40')](_0xc19f44);})[_0x276e('0x24')](function(_0x453561){_0x639eff[_0x276e('0x41')]=_0x453561;return _0x639eff;})[_0x276e('0x24')](respondWithFilteredResult(_0x41871a,_0xc19f44))[_0x276e('0x42')](handleError(_0x41871a,null));};exports['show']=function(_0x41b0e0,_0x182389){var _0xd26582={'raw':!![],'where':{'id':_0x41b0e0[_0x276e('0x43')]['id']}},_0x2656b3={};_0x2656b3[_0x276e('0x2e')]=_[_0x276e('0x30')](db[_0x276e('0x3e')][_0x276e('0x2a')]);_0x2656b3['query']=_['keys'](_0x41b0e0[_0x276e('0x2f')]);_0x2656b3[_0x276e('0x31')]=_[_0x276e('0x32')](_0x2656b3[_0x276e('0x2e')],_0x2656b3['query']);_0xd26582[_0x276e('0x33')]=_['intersection'](_0x2656b3['model'],qs[_0x276e('0x34')](_0x41b0e0[_0x276e('0x2f')][_0x276e('0x34')]));_0xd26582[_0x276e('0x33')]=_0xd26582[_0x276e('0x33')][_0x276e('0x44')]?_0xd26582[_0x276e('0x33')]:_0x2656b3[_0x276e('0x2e')];if(_0x41b0e0['query']['includeAll']){_0xd26582['include']=[{'all':!![]}];}_0xd26582=_[_0x276e('0x3b')]({},_0xd26582,_0x41b0e0[_0x276e('0x3d')]);return db[_0x276e('0x3e')][_0x276e('0x45')](_0xd26582)[_0x276e('0x24')](handleEntityNotFound(_0x182389,null))[_0x276e('0x24')](respondWithResult(_0x182389,null))[_0x276e('0x42')](handleError(_0x182389,null));};exports[_0x276e('0x46')]=function(_0x6138d8,_0x223b54){return db['SquareDetailsReport'][_0x276e('0x46')](_0x6138d8[_0x276e('0x47')],{})[_0x276e('0x24')](respondWithResult(_0x223b54,0xc9))['catch'](handleError(_0x223b54,null));};exports['update']=function(_0x2cb17c,_0x72a117){if(_0x2cb17c[_0x276e('0x47')]['id']){delete _0x2cb17c[_0x276e('0x47')]['id'];}return db['SquareDetailsReport'][_0x276e('0x45')]({'where':{'id':_0x2cb17c['params']['id']}})[_0x276e('0x24')](handleEntityNotFound(_0x72a117,null))[_0x276e('0x24')](saveUpdates(_0x2cb17c[_0x276e('0x47')],null))['then'](respondWithResult(_0x72a117,null))[_0x276e('0x42')](handleError(_0x72a117,null));};exports[_0x276e('0x25')]=function(_0x3d2867,_0x4344e1){return db['SquareDetailsReport']['find']({'where':{'id':_0x3d2867[_0x276e('0x43')]['id']}})['then'](handleEntityNotFound(_0x4344e1,null))['then'](removeEntity(_0x4344e1,null))[_0x276e('0x42')](handleError(_0x4344e1,null));};exports[_0x276e('0x48')]=function(_0x3efe36,_0x563315){return db[_0x276e('0x3e')][_0x276e('0x48')]()[_0x276e('0x24')](respondWithResult(_0x563315,null))['catch'](handleError(_0x563315,null));}; \ No newline at end of file +var _0x8d75=['catch','show','params','create','update','body','find','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','offset','set','reject','save','then','error','stack','name','send','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','VIRTUAL','merge','options','SquareDetailsReport','count','include','findAll','rows'];(function(_0x1c9eeb,_0x1c260b){var _0x2cc1ed=function(_0x226561){while(--_0x226561){_0x1c9eeb['push'](_0x1c9eeb['shift']());}};_0x2cc1ed(++_0x1c260b);}(_0x8d75,0x17b));var _0x58d7=function(_0x1c5aff,_0x3cea4b){_0x1c5aff=_0x1c5aff-0x0;var _0x35e23e=_0x8d75[_0x1c5aff];return _0x35e23e;};'use strict';var emlformat=require(_0x58d7('0x0'));var rimraf=require(_0x58d7('0x1'));var zipdir=require(_0x58d7('0x2'));var jsonpatch=require(_0x58d7('0x3'));var rp=require(_0x58d7('0x4'));var moment=require(_0x58d7('0x5'));var BPromise=require(_0x58d7('0x6'));var Mustache=require(_0x58d7('0x7'));var util=require(_0x58d7('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x58d7('0x9'));var ejs=require(_0x58d7('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x58d7('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x58d7('0xc'));var deskjs=require(_0x58d7('0xd'));var toCsv=require('to-csv');var querystring=require(_0x58d7('0xe'));var Papa=require(_0x58d7('0xf'));var Redis=require(_0x58d7('0x10'));var authService=require(_0x58d7('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x58d7('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x58d7('0x13'))(_0x58d7('0x14'));var utils=require(_0x58d7('0x15'));var config=require(_0x58d7('0x16'));var licenseUtil=require(_0x58d7('0x17'));var db=require(_0x58d7('0x18'))['db'];function respondWithStatusCode(_0x26013e,_0x3d5b96){_0x3d5b96=_0x3d5b96||0xcc;return function(_0x2cf0e0){if(_0x2cf0e0){return _0x26013e[_0x58d7('0x19')](_0x3d5b96);}return _0x26013e[_0x58d7('0x1a')](_0x3d5b96)[_0x58d7('0x1b')]();};}function respondWithResult(_0x322717,_0x5c8b18){_0x5c8b18=_0x5c8b18||0xc8;return function(_0x4616ba){if(_0x4616ba){return _0x322717[_0x58d7('0x1a')](_0x5c8b18)[_0x58d7('0x1c')](_0x4616ba);}};}function respondWithFilteredResult(_0x5eff1e,_0x4eaa46){return function(_0x583954){if(_0x583954){var _0x1bf252=typeof _0x4eaa46['offset']===_0x58d7('0x1d')&&typeof _0x4eaa46[_0x58d7('0x1e')]===_0x58d7('0x1d');var _0x18b40c=_0x583954['count'];var _0x5ab022=_0x1bf252?0x0:_0x4eaa46[_0x58d7('0x1f')];var _0xb241fb=_0x1bf252?_0x583954['count']:_0x4eaa46[_0x58d7('0x1f')]+_0x4eaa46[_0x58d7('0x1e')];var _0x15f66e;if(_0xb241fb>=_0x18b40c){_0xb241fb=_0x18b40c;_0x15f66e=0xc8;}else{_0x15f66e=0xce;}_0x5eff1e[_0x58d7('0x1a')](_0x15f66e);return _0x5eff1e[_0x58d7('0x20')]('Content-Range',_0x5ab022+'-'+_0xb241fb+'/'+_0x18b40c)['json'](_0x583954);}return null;};}function patchUpdates(_0xd08111){return function(_0x47ba94){try{jsonpatch['apply'](_0x47ba94,_0xd08111,!![]);}catch(_0x3ba4e7){return BPromise[_0x58d7('0x21')](_0x3ba4e7);}return _0x47ba94[_0x58d7('0x22')]();};}function saveUpdates(_0x581f7d,_0x35ee03){return function(_0x202df7){if(_0x202df7){return _0x202df7['update'](_0x581f7d)[_0x58d7('0x23')](function(_0x511035){return _0x511035;});}return null;};}function removeEntity(_0x1e3852,_0x237853){return function(_0x487a40){if(_0x487a40){return _0x487a40['destroy']()[_0x58d7('0x23')](function(){_0x1e3852[_0x58d7('0x1a')](0xcc)[_0x58d7('0x1b')]();});}};}function handleEntityNotFound(_0x529e95,_0x13135f){return function(_0x2d5699){if(!_0x2d5699){_0x529e95[_0x58d7('0x19')](0x194);}return _0x2d5699;};}function handleError(_0x388281,_0x475e1d){_0x475e1d=_0x475e1d||0x1f4;return function(_0x3501cf){logger[_0x58d7('0x24')](_0x3501cf[_0x58d7('0x25')]);if(_0x3501cf['name']){delete _0x3501cf[_0x58d7('0x26')];}_0x388281[_0x58d7('0x1a')](_0x475e1d)[_0x58d7('0x27')](_0x3501cf);};}exports['index']=function(_0x1755b8,_0x10ad38){var _0x268c2d={},_0x3e9aa6={},_0x1e7ac7={'count':0x0,'rows':[]};var _0x219529=_[_0x58d7('0x28')](db['SquareDetailsReport'][_0x58d7('0x29')],function(_0x1c4b0f){return{'name':_0x1c4b0f[_0x58d7('0x2a')],'type':_0x1c4b0f[_0x58d7('0x2b')]['key']};});_0x3e9aa6[_0x58d7('0x2c')]=_[_0x58d7('0x28')](_0x219529,_0x58d7('0x26'));_0x3e9aa6[_0x58d7('0x2d')]=_[_0x58d7('0x2e')](_0x1755b8[_0x58d7('0x2d')]);_0x3e9aa6[_0x58d7('0x2f')]=_[_0x58d7('0x30')](_0x3e9aa6[_0x58d7('0x2c')],_0x3e9aa6[_0x58d7('0x2d')]);_0x268c2d[_0x58d7('0x31')]=_[_0x58d7('0x30')](_0x3e9aa6['model'],qs[_0x58d7('0x32')](_0x1755b8['query']['fields']));_0x268c2d['attributes']=_0x268c2d[_0x58d7('0x31')][_0x58d7('0x33')]?_0x268c2d['attributes']:_0x3e9aa6[_0x58d7('0x2c')];if(!_0x1755b8['query']['hasOwnProperty'](_0x58d7('0x34'))){_0x268c2d['limit']=qs[_0x58d7('0x1e')](_0x1755b8['query'][_0x58d7('0x1e')]);_0x268c2d['offset']=qs['offset'](_0x1755b8['query'][_0x58d7('0x1f')]);}_0x268c2d[_0x58d7('0x35')]=qs[_0x58d7('0x36')](_0x1755b8['query'][_0x58d7('0x36')]);_0x268c2d[_0x58d7('0x37')]=qs[_0x58d7('0x2f')](_['pick'](_0x1755b8[_0x58d7('0x2d')],_0x3e9aa6[_0x58d7('0x2f')]),_0x219529);if(_0x1755b8[_0x58d7('0x2d')][_0x58d7('0x38')]){_0x268c2d[_0x58d7('0x37')]=_['merge'](_0x268c2d[_0x58d7('0x37')],{'$or':_['map'](_0x219529,function(_0x40f538){if(_0x40f538[_0x58d7('0x2b')]!==_0x58d7('0x39')){var _0xe1fc82={};_0xe1fc82[_0x40f538[_0x58d7('0x26')]]={'$like':'%'+_0x1755b8[_0x58d7('0x2d')][_0x58d7('0x38')]+'%'};return _0xe1fc82;}})});}_0x268c2d=_[_0x58d7('0x3a')]({},_0x268c2d,_0x1755b8[_0x58d7('0x3b')]);var _0x5522b6={'where':_0x268c2d[_0x58d7('0x37')]};return db[_0x58d7('0x3c')]['count'](_0x5522b6)['then'](function(_0x2faea2){_0x1e7ac7[_0x58d7('0x3d')]=_0x2faea2;if(_0x1755b8[_0x58d7('0x2d')]['includeAll']){_0x268c2d[_0x58d7('0x3e')]=[{'all':!![]}];}return db[_0x58d7('0x3c')][_0x58d7('0x3f')](_0x268c2d);})[_0x58d7('0x23')](function(_0x51ae7a){_0x1e7ac7[_0x58d7('0x40')]=_0x51ae7a;return _0x1e7ac7;})[_0x58d7('0x23')](respondWithFilteredResult(_0x10ad38,_0x268c2d))[_0x58d7('0x41')](handleError(_0x10ad38,null));};exports[_0x58d7('0x42')]=function(_0x10012d,_0x2a1a1b){var _0x50c295={'raw':!![],'where':{'id':_0x10012d[_0x58d7('0x43')]['id']}},_0x2c0c={};_0x2c0c['model']=_[_0x58d7('0x2e')](db['SquareDetailsReport'][_0x58d7('0x29')]);_0x2c0c[_0x58d7('0x2d')]=_['keys'](_0x10012d[_0x58d7('0x2d')]);_0x2c0c[_0x58d7('0x2f')]=_[_0x58d7('0x30')](_0x2c0c[_0x58d7('0x2c')],_0x2c0c[_0x58d7('0x2d')]);_0x50c295[_0x58d7('0x31')]=_[_0x58d7('0x30')](_0x2c0c[_0x58d7('0x2c')],qs['fields'](_0x10012d[_0x58d7('0x2d')][_0x58d7('0x32')]));_0x50c295[_0x58d7('0x31')]=_0x50c295['attributes']['length']?_0x50c295[_0x58d7('0x31')]:_0x2c0c['model'];if(_0x10012d[_0x58d7('0x2d')]['includeAll']){_0x50c295[_0x58d7('0x3e')]=[{'all':!![]}];}_0x50c295=_[_0x58d7('0x3a')]({},_0x50c295,_0x10012d['options']);return db[_0x58d7('0x3c')]['find'](_0x50c295)[_0x58d7('0x23')](handleEntityNotFound(_0x2a1a1b,null))[_0x58d7('0x23')](respondWithResult(_0x2a1a1b,null))[_0x58d7('0x41')](handleError(_0x2a1a1b,null));};exports[_0x58d7('0x44')]=function(_0x188c38,_0x30d2fd){return db[_0x58d7('0x3c')][_0x58d7('0x44')](_0x188c38['body'],{})[_0x58d7('0x23')](respondWithResult(_0x30d2fd,0xc9))[_0x58d7('0x41')](handleError(_0x30d2fd,null));};exports[_0x58d7('0x45')]=function(_0x14a1bb,_0x575153){if(_0x14a1bb[_0x58d7('0x46')]['id']){delete _0x14a1bb[_0x58d7('0x46')]['id'];}return db[_0x58d7('0x3c')][_0x58d7('0x47')]({'where':{'id':_0x14a1bb[_0x58d7('0x43')]['id']}})['then'](handleEntityNotFound(_0x575153,null))[_0x58d7('0x23')](saveUpdates(_0x14a1bb[_0x58d7('0x46')],null))[_0x58d7('0x23')](respondWithResult(_0x575153,null))[_0x58d7('0x41')](handleError(_0x575153,null));};exports[_0x58d7('0x48')]=function(_0x381515,_0x2082c7){return db[_0x58d7('0x3c')][_0x58d7('0x47')]({'where':{'id':_0x381515['params']['id']}})[_0x58d7('0x23')](handleEntityNotFound(_0x2082c7,null))[_0x58d7('0x23')](removeEntity(_0x2082c7,null))[_0x58d7('0x41')](handleError(_0x2082c7,null));};exports['describe']=function(_0x2d9068,_0x3a3a1c){return db[_0x58d7('0x3c')][_0x58d7('0x49')]()['then'](respondWithResult(_0x3a3a1c,null))['catch'](handleError(_0x3a3a1c,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index a1084e8..c9c9c69 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 _0x3e81=['bluebird','path','rimraf','../../config/environment','./squareReportDetail.attributes','exports','define','util','../../config/logger','api','moment'];(function(_0xf79bd7,_0x56c2a1){var _0x8d016f=function(_0x152068){while(--_0x152068){_0xf79bd7['push'](_0xf79bd7['shift']());}};_0x8d016f(++_0x56c2a1);}(_0x3e81,0x1a9));var _0x13e8=function(_0x2cefd6,_0x320d0b){_0x2cefd6=_0x2cefd6-0x0;var _0x56d9ea=_0x3e81[_0x2cefd6];return _0x56d9ea;};'use strict';var _=require('lodash');var util=require(_0x13e8('0x0'));var logger=require(_0x13e8('0x1'))(_0x13e8('0x2'));var moment=require(_0x13e8('0x3'));var BPromise=require(_0x13e8('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x13e8('0x5'));var rimraf=require(_0x13e8('0x6'));var config=require(_0x13e8('0x7'));var attributes=require(_0x13e8('0x8'));module[_0x13e8('0x9')]=function(_0x22b606,_0x6fe334){return _0x22b606[_0x13e8('0xa')]('SquareDetailsReport',attributes,{'tableName':'report_square_details','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7948=['SquareDetailsReport','report_square_details','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareReportDetail.attributes','exports','define'];(function(_0x410f48,_0x34979c){var _0x3ade5f=function(_0x231e6b){while(--_0x231e6b){_0x410f48['push'](_0x410f48['shift']());}};_0x3ade5f(++_0x34979c);}(_0x7948,0xf2));var _0x8794=function(_0x492535,_0x46524a){_0x492535=_0x492535-0x0;var _0x256620=_0x7948[_0x492535];return _0x256620;};'use strict';var _=require(_0x8794('0x0'));var util=require(_0x8794('0x1'));var logger=require(_0x8794('0x2'))(_0x8794('0x3'));var moment=require(_0x8794('0x4'));var BPromise=require(_0x8794('0x5'));var rp=require(_0x8794('0x6'));var fs=require('fs');var path=require(_0x8794('0x7'));var rimraf=require(_0x8794('0x8'));var config=require(_0x8794('0x9'));var attributes=require(_0x8794('0xa'));module[_0x8794('0xb')]=function(_0x5d9f1,_0x4dc9f6){return _0x5d9f1[_0x8794('0xc')](_0x8794('0xd'),attributes,{'tableName':_0x8794('0xe'),'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 02a61d8..8ae1ab7 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 _0xd523=['jayson/promise','client','request','then','info','SquareDetailsReport,\x20%s,\x20%s','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateSquareDetailsReport','create','body','options','raw','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x58c299,_0x35e6bc){var _0x2763dc=function(_0x13dca8){while(--_0x13dca8){_0x58c299['push'](_0x58c299['shift']());}};_0x2763dc(++_0x35e6bc);}(_0xd523,0x153));var _0x3d52=function(_0x1fff63,_0xc9abad){_0x1fff63=_0x1fff63-0x0;var _0xd93023=_0xd523[_0x1fff63];return _0xd93023;};'use strict';var _=require(_0x3d52('0x0'));var util=require(_0x3d52('0x1'));var moment=require(_0x3d52('0x2'));var BPromise=require(_0x3d52('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3d52('0x4'));var db=require(_0x3d52('0x5'))['db'];var utils=require(_0x3d52('0x6'));var logger=require('../../config/logger')(_0x3d52('0x7'));var config=require(_0x3d52('0x8'));var jayson=require(_0x3d52('0x9'));var client=jayson[_0x3d52('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4fcc92,_0x189147,_0x2f3ebc){return new BPromise(function(_0x232bd4,_0x2e03c0){return client[_0x3d52('0xb')](_0x4fcc92,_0x2f3ebc)[_0x3d52('0xc')](function(_0x34c184){logger[_0x3d52('0xd')](_0x3d52('0xe'),_0x189147,'request\x20sent');logger[_0x3d52('0xf')](_0x3d52('0x10'),_0x189147,_0x3d52('0x11'),JSON[_0x3d52('0x12')](_0x34c184));if(_0x34c184[_0x3d52('0x13')]){if(_0x34c184['error'][_0x3d52('0x14')]===0x1f4){logger['error']('SquareDetailsReport,\x20%s,\x20%s',_0x189147,_0x34c184[_0x3d52('0x13')][_0x3d52('0x15')]);return _0x2e03c0(_0x34c184['error']['message']);}logger['error'](_0x3d52('0xe'),_0x189147,_0x34c184[_0x3d52('0x13')][_0x3d52('0x15')]);return _0x232bd4(_0x34c184[_0x3d52('0x13')][_0x3d52('0x15')]);}else{logger[_0x3d52('0xd')](_0x3d52('0xe'),_0x189147,_0x3d52('0x11'));_0x232bd4(_0x34c184[_0x3d52('0x16')][_0x3d52('0x15')]);}})[_0x3d52('0x17')](function(_0x15cc02){logger[_0x3d52('0x13')](_0x3d52('0xe'),_0x189147,_0x15cc02);_0x2e03c0(_0x15cc02);});});}exports[_0x3d52('0x18')]=function(_0x5bce9a){var _0x163d88=this;return new Promise(function(_0x3b3451,_0x386cdb){return db['SquareDetailsReport'][_0x3d52('0x19')](_0x5bce9a[_0x3d52('0x1a')],{'raw':_0x5bce9a[_0x3d52('0x1b')]?_0x5bce9a['options'][_0x3d52('0x1c')]===undefined?!![]:![]:!![]})[_0x3d52('0xc')](function(_0x1163c5){logger[_0x3d52('0xd')](_0x3d52('0x18'),_0x5bce9a);logger[_0x3d52('0xf')](_0x3d52('0x18'),_0x5bce9a,JSON[_0x3d52('0x12')](_0x1163c5));_0x3b3451(_0x1163c5);})['catch'](function(_0x419c05){logger[_0x3d52('0x13')](_0x3d52('0x18'),_0x419c05['message'],_0x5bce9a);_0x386cdb(_0x163d88[_0x3d52('0x13')](0x1f4,_0x419c05[_0x3d52('0x15')]));});});}; \ No newline at end of file +var _0xe1e3=['jayson/promise','client','http','request','then','request\x20sent','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','SquareDetailsReport,\x20%s,\x20%s','message','info','result','CreateSquareDetailsReport','options','raw','debug','catch','lodash','util','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x29400f,_0x32dfba){var _0x50d1d3=function(_0x317f4b){while(--_0x317f4b){_0x29400f['push'](_0x29400f['shift']());}};_0x50d1d3(++_0x32dfba);}(_0xe1e3,0x1bb));var _0x3e1e=function(_0x444742,_0x7c33c9){_0x444742=_0x444742-0x0;var _0x1c079f=_0xe1e3[_0x444742];return _0x1c079f;};'use strict';var _=require(_0x3e1e('0x0'));var util=require(_0x3e1e('0x1'));var moment=require('moment');var BPromise=require(_0x3e1e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3e1e('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x3e1e('0x4'))(_0x3e1e('0x5'));var config=require(_0x3e1e('0x6'));var jayson=require(_0x3e1e('0x7'));var client=jayson[_0x3e1e('0x8')][_0x3e1e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x55cfba,_0x1574e5,_0x13926d){return new BPromise(function(_0x2f0e12,_0xa67e35){return client[_0x3e1e('0xa')](_0x55cfba,_0x13926d)[_0x3e1e('0xb')](function(_0x5e7d1f){logger['info']('SquareDetailsReport,\x20%s,\x20%s',_0x1574e5,_0x3e1e('0xc'));logger['debug'](_0x3e1e('0xd'),_0x1574e5,_0x3e1e('0xc'),JSON[_0x3e1e('0xe')](_0x5e7d1f));if(_0x5e7d1f['error']){if(_0x5e7d1f[_0x3e1e('0xf')]['code']===0x1f4){logger['error']('SquareDetailsReport,\x20%s,\x20%s',_0x1574e5,_0x5e7d1f['error']['message']);return _0xa67e35(_0x5e7d1f[_0x3e1e('0xf')]['message']);}logger['error'](_0x3e1e('0x10'),_0x1574e5,_0x5e7d1f[_0x3e1e('0xf')][_0x3e1e('0x11')]);return _0x2f0e12(_0x5e7d1f['error']['message']);}else{logger[_0x3e1e('0x12')](_0x3e1e('0x10'),_0x1574e5,'request\x20sent');_0x2f0e12(_0x5e7d1f[_0x3e1e('0x13')][_0x3e1e('0x11')]);}})['catch'](function(_0x11c07f){logger['error'](_0x3e1e('0x10'),_0x1574e5,_0x11c07f);_0xa67e35(_0x11c07f);});});}exports[_0x3e1e('0x14')]=function(_0x1d786c){var _0x39eaa7=this;return new Promise(function(_0x791ed8,_0x1c181b){return db['SquareDetailsReport']['create'](_0x1d786c['body'],{'raw':_0x1d786c[_0x3e1e('0x15')]?_0x1d786c[_0x3e1e('0x15')][_0x3e1e('0x16')]===undefined?!![]:![]:!![]})['then'](function(_0x1c5acd){logger['info'](_0x3e1e('0x14'),_0x1d786c);logger[_0x3e1e('0x17')](_0x3e1e('0x14'),_0x1d786c,JSON['stringify'](_0x1c5acd));_0x791ed8(_0x1c5acd);})[_0x3e1e('0x18')](function(_0x96396){logger[_0x3e1e('0xf')]('CreateSquareDetailsReport',_0x96396['message'],_0x1d786c);_0x1c181b(_0x39eaa7[_0x3e1e('0xf')](0x1f4,_0x96396[_0x3e1e('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index bbf2be7..78144df 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 _0xaa7c=['../../components/auth/service','./system.controller','get','isAuthenticated','exports','express'];(function(_0xb935ec,_0x2e217e){var _0x309513=function(_0x20339f){while(--_0x20339f){_0xb935ec['push'](_0xb935ec['shift']());}};_0x309513(++_0x2e217e);}(_0xaa7c,0x7d));var _0xcaa7=function(_0x363f5d,_0x166886){_0x363f5d=_0x363f5d-0x0;var _0x2e41a8=_0xaa7c[_0x363f5d];return _0x2e41a8;};'use strict';var express=require(_0xcaa7('0x0'));var router=express['Router']();var auth=require(_0xcaa7('0x1'));var controller=require(_0xcaa7('0x2'));router[_0xcaa7('0x3')]('/',auth[_0xcaa7('0x4')](),controller['index']);router[_0xcaa7('0x3')]('/process/:pid/kill',auth['isAuthenticated'](),controller['killProcess']);module[_0xcaa7('0x5')]=router; \ No newline at end of file +var _0x6485=['./system.controller','get','isAuthenticated','index','/process/:pid/kill','killProcess','exports','express','Router','../../components/auth/service'];(function(_0x242ffa,_0x24f6f9){var _0x26d594=function(_0x2802d4){while(--_0x2802d4){_0x242ffa['push'](_0x242ffa['shift']());}};_0x26d594(++_0x24f6f9);}(_0x6485,0x93));var _0x5648=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6485[_0x3dd15e];return _0x231fd0;};'use strict';var express=require(_0x5648('0x0'));var router=express[_0x5648('0x1')]();var auth=require(_0x5648('0x2'));var controller=require(_0x5648('0x3'));router[_0x5648('0x4')]('/',auth[_0x5648('0x5')](),controller[_0x5648('0x6')]);router['get'](_0x5648('0x7'),auth['isAuthenticated'](),controller[_0x5648('0x8')]);module[_0x5648('0x9')]=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index c80bccc..9921b72 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 _0xdb06=['killProcess','systeminformation','child_process','error','name','status','send','index','getAllData','then','json','catch','components/import/cm','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','split','indexOf','format','Process\x20with\x20pid\x20%s\x20not\x20found!','pid','kill'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xdb06,0x13c));var _0x6db0=function(_0x2a2ea0,_0x5a6a33){_0x2a2ea0=_0x2a2ea0-0x0;var _0x18f49d=_0xdb06[_0x2a2ea0];return _0x18f49d;};'use strict';var info=require(_0x6db0('0x0'));var exec=require(_0x6db0('0x1'))['exec'];var logger=require('../../config/logger')('api');var util=require('util');var BPromise=require('bluebird');var _=require('lodash');function handleError(_0x470e8c,_0x4be41d,_0x502a85){_0x4be41d=_0x4be41d||0x1f4;return function(_0x5b8a3d){logger[_0x6db0('0x2')]('<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s',_0x502a85,_0x4be41d,util['inspect'](_0x5b8a3d,{'showHidden':![],'depth':null}));delete _0x5b8a3d[_0x6db0('0x3')];_0x470e8c[_0x6db0('0x4')](_0x4be41d)[_0x6db0('0x5')](_0x5b8a3d);};}exports[_0x6db0('0x6')]=function(_0x6d5995,_0x3904da){return info[_0x6db0('0x7')]()[_0x6db0('0x8')](function(_0x31d6d8){return _0x3904da['status'](0xc8)[_0x6db0('0x9')](_0x31d6d8);})[_0x6db0('0xa')](function(_0x519f70){return _0x3904da[_0x6db0('0x4')](0x1f4)['json'](_0x519f70);});};exports['killProcess']=function(_0x2c967a,_0x494ac6){var _0x24f675=[_0x6db0('0xb')];return new BPromise(function(_0xf11c43,_0x359eb3){return exec(util['format'](_0x6db0('0xc'),_0x2c967a[_0x6db0('0xd')]['pid']),function(_0x540bf1,_0x3ef758,_0x388788){if(_0x540bf1){return _0x359eb3(_0x540bf1);}return _0xf11c43(_0x3ef758);});})[_0x6db0('0x8')](function(_0x12bc5f){var _0x57e31e=![];var _0xcb3022=_0x12bc5f[_0x6db0('0xe')](/\n/);for(var _0x47f066=0x0,_0x3059c5=_0x24f675['length'];_0x47f066<_0x3059c5,_0x57e31e===![];_0x47f066+=0x1){if(_0x12bc5f[_0x6db0('0xf')](_0x24f675[_0x47f066])>=0x0){_0x57e31e=!![];}}if(!_0x57e31e){throw new Error(util[_0x6db0('0x10')](_0x6db0('0x11'),_0x2c967a[_0x6db0('0xd')][_0x6db0('0x12')]));}process[_0x6db0('0x13')](_0x2c967a[_0x6db0('0xd')][_0x6db0('0x12')],'SIGINT');return _0x494ac6[_0x6db0('0x4')](0xc8)['json']({'message':util[_0x6db0('0x10')]('Process\x20with\x20pid\x20%s\x20killed\x20correctly',_0x2c967a[_0x6db0('0xd')][_0x6db0('0x12')])});})['catch'](handleError(_0x494ac6,null,_0x6db0('0x14')));}; \ No newline at end of file +var _0x767b=['error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','status','send','index','getAllData','then','catch','json','killProcess','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','pid','split','length','indexOf','kill','params','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','child_process','exec','../../config/logger','api','util','bluebird','lodash'];(function(_0x22aef1,_0x33f813){var _0x1fab54=function(_0x419c9e){while(--_0x419c9e){_0x22aef1['push'](_0x22aef1['shift']());}};_0x1fab54(++_0x33f813);}(_0x767b,0x124));var _0xb767=function(_0x2a56ce,_0x448f12){_0x2a56ce=_0x2a56ce-0x0;var _0x1f9977=_0x767b[_0x2a56ce];return _0x1f9977;};'use strict';var info=require(_0xb767('0x0'));var exec=require(_0xb767('0x1'))[_0xb767('0x2')];var logger=require(_0xb767('0x3'))(_0xb767('0x4'));var util=require(_0xb767('0x5'));var BPromise=require(_0xb767('0x6'));var _=require(_0xb767('0x7'));function handleError(_0x1137b0,_0x1cbd7e,_0x3d3af9){_0x1cbd7e=_0x1cbd7e||0x1f4;return function(_0x1c2219){logger[_0xb767('0x8')](_0xb767('0x9'),_0x3d3af9,_0x1cbd7e,util[_0xb767('0xa')](_0x1c2219,{'showHidden':![],'depth':null}));delete _0x1c2219['name'];_0x1137b0[_0xb767('0xb')](_0x1cbd7e)[_0xb767('0xc')](_0x1c2219);};}exports[_0xb767('0xd')]=function(_0x186639,_0x3d1f36){return info[_0xb767('0xe')]()[_0xb767('0xf')](function(_0x2864c1){return _0x3d1f36[_0xb767('0xb')](0xc8)['json'](_0x2864c1);})[_0xb767('0x10')](function(_0x1882b7){return _0x3d1f36[_0xb767('0xb')](0x1f4)[_0xb767('0x11')](_0x1882b7);});};exports[_0xb767('0x12')]=function(_0x160e62,_0x121cb9){var _0x3105db=[_0xb767('0x13')];return new BPromise(function(_0x55b272,_0x470ab9){return exec(util[_0xb767('0x14')](_0xb767('0x15'),_0x160e62['params'][_0xb767('0x16')]),function(_0x1c9a46,_0x59cea2,_0x3c9669){if(_0x1c9a46){return _0x470ab9(_0x1c9a46);}return _0x55b272(_0x59cea2);});})[_0xb767('0xf')](function(_0x26fd98){var _0x4db75b=![];var _0x583b95=_0x26fd98[_0xb767('0x17')](/\n/);for(var _0x583017=0x0,_0x14323b=_0x3105db[_0xb767('0x18')];_0x583017<_0x14323b,_0x4db75b===![];_0x583017+=0x1){if(_0x26fd98[_0xb767('0x19')](_0x3105db[_0x583017])>=0x0){_0x4db75b=!![];}}if(!_0x4db75b){throw new Error(util[_0xb767('0x14')]('Process\x20with\x20pid\x20%s\x20not\x20found!',_0x160e62['params'][_0xb767('0x16')]));}process[_0xb767('0x1a')](_0x160e62[_0xb767('0x1b')][_0xb767('0x16')],_0xb767('0x1c'));return _0x121cb9['status'](0xc8)[_0xb767('0x11')]({'message':util[_0xb767('0x14')](_0xb767('0x1d'),_0x160e62[_0xb767('0x1b')][_0xb767('0x16')])});})[_0xb767('0x10')](handleError(_0x121cb9,null,_0xb767('0x12')));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index 8610e03..3150e0a 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 _0x4074=['create','put','update','destroy','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./tag.controller','get','/:id','isAuthenticated','show','post'];(function(_0xb460c3,_0x526b34){var _0x23f75b=function(_0xcc9d3){while(--_0xcc9d3){_0xb460c3['push'](_0xb460c3['shift']());}};_0x23f75b(++_0x526b34);}(_0x4074,0x1b4));var _0x4407=function(_0x4a8733,_0x21b30c){_0x4a8733=_0x4a8733-0x0;var _0x52b67b=_0x4074[_0x4a8733];return _0x52b67b;};'use strict';var multer=require(_0x4407('0x0'));var util=require(_0x4407('0x1'));var path=require(_0x4407('0x2'));var timeout=require(_0x4407('0x3'));var express=require(_0x4407('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x4407('0x5'));var interaction=require(_0x4407('0x6'));var config=require(_0x4407('0x7'));var controller=require(_0x4407('0x8'));router[_0x4407('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x4407('0x9')](_0x4407('0xa'),auth[_0x4407('0xb')](),controller[_0x4407('0xc')]);router[_0x4407('0xd')]('/',auth[_0x4407('0xb')](),controller[_0x4407('0xe')]);router[_0x4407('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x4407('0x10')]);router['delete']('/:id',auth[_0x4407('0xb')](),controller[_0x4407('0x11')]);module['exports']=router; \ No newline at end of file +var _0x1312=['util','path','Router','fs-extra','../../components/auth/service','../../config/environment','./tag.controller','get','isAuthenticated','/:id','show','post','create','put','delete','destroy','exports','multer'];(function(_0x3b3444,_0x3a110f){var _0x441b44=function(_0x424af){while(--_0x424af){_0x3b3444['push'](_0x3b3444['shift']());}};_0x441b44(++_0x3a110f);}(_0x1312,0x167));var _0x2131=function(_0x17a28b,_0x5d1465){_0x17a28b=_0x17a28b-0x0;var _0x9cbb5a=_0x1312[_0x17a28b];return _0x9cbb5a;};'use strict';var multer=require(_0x2131('0x0'));var util=require(_0x2131('0x1'));var path=require(_0x2131('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x2131('0x3')]();var fs_extra=require(_0x2131('0x4'));var auth=require(_0x2131('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x2131('0x6'));var controller=require(_0x2131('0x7'));router[_0x2131('0x8')]('/',auth[_0x2131('0x9')](),controller['index']);router[_0x2131('0x8')](_0x2131('0xa'),auth[_0x2131('0x9')](),controller[_0x2131('0xb')]);router[_0x2131('0xc')]('/',auth[_0x2131('0x9')](),controller[_0x2131('0xd')]);router[_0x2131('0xe')](_0x2131('0xa'),auth[_0x2131('0x9')](),controller['update']);router[_0x2131('0xf')](_0x2131('0xa'),auth['isAuthenticated'](),controller[_0x2131('0x10')]);module[_0x2131('0x11')]=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index 87635ae..c153d4c 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 _0x9458=['STRING','#0091EA'];(function(_0x5a43b8,_0x2e0eb2){var _0x26eeef=function(_0x4b1451){while(--_0x4b1451){_0x5a43b8['push'](_0x5a43b8['shift']());}};_0x26eeef(++_0x2e0eb2);}(_0x9458,0x1b8));var _0x8945=function(_0x1cd52d,_0x2b3bb5){_0x1cd52d=_0x1cd52d-0x0;var _0x7b5de1=_0x9458[_0x1cd52d];return _0x7b5de1;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x8945('0x0')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize['STRING'],'defaultValue':_0x8945('0x1')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xe027=['name','#0091EA','sequelize','exports','STRING'];(function(_0x1993a8,_0xd34e39){var _0x353428=function(_0x1b5ab5){while(--_0x1b5ab5){_0x1993a8['push'](_0x1993a8['shift']());}};_0x353428(++_0xd34e39);}(_0xe027,0x106));var _0x7e02=function(_0x4d2357,_0x409ad8){_0x4d2357=_0x4d2357-0x0;var _0x45bcf8=_0xe027[_0x4d2357];return _0x45bcf8;};'use strict';var Sequelize=require(_0x7e02('0x0'));module[_0x7e02('0x1')]={'name':{'type':Sequelize[_0x7e02('0x2')],'unique':_0x7e02('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x7e02('0x2')],'defaultValue':_0x7e02('0x4')},'description':{'type':Sequelize[_0x7e02('0x2')]}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index 0944a43..f475d9d 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 _0x5178=['../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','apply','reject','update','then','destroy','get','UserProfileResource','error','stack','name','send','map','Tag','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','fields','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment'];(function(_0x5057a0,_0xff7a76){var _0x556c47=function(_0x290ab7){while(--_0x290ab7){_0x5057a0['push'](_0x5057a0['shift']());}};_0x556c47(++_0xff7a76);}(_0x5178,0x171));var _0x8517=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x5178[_0xbca1b1];return _0x4e1686;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8517('0x0'));var zipdir=require(_0x8517('0x1'));var jsonpatch=require(_0x8517('0x2'));var rp=require(_0x8517('0x3'));var moment=require(_0x8517('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x8517('0x5'));var path=require(_0x8517('0x6'));var sox=require('sox');var csv=require(_0x8517('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8517('0x8'));var _=require(_0x8517('0x9'));var squel=require(_0x8517('0xa'));var crypto=require(_0x8517('0xb'));var jsforce=require(_0x8517('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x8517('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x8517('0xd'));var authService=require(_0x8517('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x8517('0xf'));var hardwareService=require(_0x8517('0x10'));var logger=require(_0x8517('0x11'))(_0x8517('0x12'));var utils=require(_0x8517('0x13'));var config=require(_0x8517('0x14'));var licenseUtil=require(_0x8517('0x15'));var db=require(_0x8517('0x16'))['db'];function respondWithStatusCode(_0x4b9768,_0x9c57de){_0x9c57de=_0x9c57de||0xcc;return function(_0x7f429a){if(_0x7f429a){return _0x4b9768[_0x8517('0x17')](_0x9c57de);}return _0x4b9768[_0x8517('0x18')](_0x9c57de)[_0x8517('0x19')]();};}function respondWithResult(_0x49eba7,_0x385219){_0x385219=_0x385219||0xc8;return function(_0x19dd9d){if(_0x19dd9d){return _0x49eba7[_0x8517('0x18')](_0x385219)[_0x8517('0x1a')](_0x19dd9d);}};}function respondWithFilteredResult(_0x411d29,_0x18a984){return function(_0x260a15){if(_0x260a15){var _0x30cea1=typeof _0x18a984[_0x8517('0x1b')]===_0x8517('0x1c')&&typeof _0x18a984[_0x8517('0x1d')]===_0x8517('0x1c');var _0x50e2de=_0x260a15[_0x8517('0x1e')];var _0x100b76=_0x30cea1?0x0:_0x18a984[_0x8517('0x1b')];var _0xf1b53b=_0x30cea1?_0x260a15[_0x8517('0x1e')]:_0x18a984[_0x8517('0x1b')]+_0x18a984[_0x8517('0x1d')];var _0x5b5408;if(_0xf1b53b>=_0x50e2de){_0xf1b53b=_0x50e2de;_0x5b5408=0xc8;}else{_0x5b5408=0xce;}_0x411d29[_0x8517('0x18')](_0x5b5408);return _0x411d29['set']('Content-Range',_0x100b76+'-'+_0xf1b53b+'/'+_0x50e2de)[_0x8517('0x1a')](_0x260a15);}return null;};}function patchUpdates(_0x157bea){return function(_0xf35d95){try{jsonpatch[_0x8517('0x1f')](_0xf35d95,_0x157bea,!![]);}catch(_0x238d75){return BPromise[_0x8517('0x20')](_0x238d75);}return _0xf35d95['save']();};}function saveUpdates(_0x4b145f,_0x2dd1df){return function(_0x37861d){if(_0x37861d){return _0x37861d[_0x8517('0x21')](_0x4b145f)[_0x8517('0x22')](function(_0x3a5f0b){return _0x3a5f0b;});}return null;};}function removeEntity(_0x2e6e47,_0x5f02ee){return function(_0x181500){if(_0x181500){return _0x181500[_0x8517('0x23')]()['then'](function(){var _0x7f4cf8=_0x181500[_0x8517('0x24')]({'plain':!![]});var _0x42c779='Tags';return db[_0x8517('0x25')]['destroy']({'where':{'type':_0x42c779,'resourceId':_0x7f4cf8['id']}})[_0x8517('0x22')](function(){return _0x181500;});})[_0x8517('0x22')](function(){_0x2e6e47[_0x8517('0x18')](0xcc)[_0x8517('0x19')]();});}};}function handleEntityNotFound(_0x238f2c,_0x300e3f){return function(_0x481ceb){if(!_0x481ceb){_0x238f2c[_0x8517('0x17')](0x194);}return _0x481ceb;};}function handleError(_0x51d516,_0x197aaf){_0x197aaf=_0x197aaf||0x1f4;return function(_0x70ee9d){logger[_0x8517('0x26')](_0x70ee9d[_0x8517('0x27')]);if(_0x70ee9d[_0x8517('0x28')]){delete _0x70ee9d[_0x8517('0x28')];}_0x51d516['status'](_0x197aaf)[_0x8517('0x29')](_0x70ee9d);};}exports['index']=function(_0x3b1928,_0x4b9983){var _0x1dd9fb={},_0x2d360c={},_0x3cf945={'count':0x0,'rows':[]};var _0x14eb04=_[_0x8517('0x2a')](db[_0x8517('0x2b')][_0x8517('0x2c')],function(_0x559707){return{'name':_0x559707[_0x8517('0x2d')],'type':_0x559707[_0x8517('0x2e')][_0x8517('0x2f')]};});_0x2d360c['model']=_['map'](_0x14eb04,'name');_0x2d360c[_0x8517('0x30')]=_[_0x8517('0x31')](_0x3b1928[_0x8517('0x30')]);_0x2d360c[_0x8517('0x32')]=_[_0x8517('0x33')](_0x2d360c[_0x8517('0x34')],_0x2d360c['query']);_0x1dd9fb[_0x8517('0x35')]=_[_0x8517('0x33')](_0x2d360c[_0x8517('0x34')],qs['fields'](_0x3b1928[_0x8517('0x30')]['fields']));_0x1dd9fb[_0x8517('0x35')]=_0x1dd9fb[_0x8517('0x35')]['length']?_0x1dd9fb['attributes']:_0x2d360c[_0x8517('0x34')];if(!_0x3b1928[_0x8517('0x30')][_0x8517('0x36')](_0x8517('0x37'))){_0x1dd9fb['limit']=qs['limit'](_0x3b1928[_0x8517('0x30')][_0x8517('0x1d')]);_0x1dd9fb[_0x8517('0x1b')]=qs['offset'](_0x3b1928[_0x8517('0x30')][_0x8517('0x1b')]);}_0x1dd9fb['order']=qs[_0x8517('0x38')](_0x3b1928[_0x8517('0x30')][_0x8517('0x38')]);_0x1dd9fb[_0x8517('0x39')]=qs['filters'](_[_0x8517('0x3a')](_0x3b1928[_0x8517('0x30')],_0x2d360c[_0x8517('0x32')]),_0x14eb04);if(_0x3b1928[_0x8517('0x30')][_0x8517('0x3b')]){_0x1dd9fb[_0x8517('0x39')]=_[_0x8517('0x3c')](_0x1dd9fb[_0x8517('0x39')],{'$or':_[_0x8517('0x2a')](_0x14eb04,function(_0x183310){if(_0x183310[_0x8517('0x2e')]!==_0x8517('0x3d')){var _0x232e49={};_0x232e49[_0x183310['name']]={'$like':'%'+_0x3b1928['query'][_0x8517('0x3b')]+'%'};return _0x232e49;}})});}_0x1dd9fb=_[_0x8517('0x3c')]({},_0x1dd9fb,_0x3b1928[_0x8517('0x3e')]);var _0x30942f={'where':_0x1dd9fb[_0x8517('0x39')]};return db['Tag'][_0x8517('0x1e')](_0x30942f)[_0x8517('0x22')](function(_0x531ca7){_0x3cf945[_0x8517('0x1e')]=_0x531ca7;if(_0x3b1928[_0x8517('0x30')][_0x8517('0x3f')]){_0x1dd9fb[_0x8517('0x40')]=[{'all':!![]}];}return db['Tag'][_0x8517('0x41')](_0x1dd9fb);})[_0x8517('0x22')](function(_0x5c342c){_0x3cf945[_0x8517('0x42')]=_0x5c342c;return _0x3cf945;})[_0x8517('0x22')](respondWithFilteredResult(_0x4b9983,_0x1dd9fb))[_0x8517('0x43')](handleError(_0x4b9983,null));};exports['show']=function(_0x368bb8,_0x31c0b9){var _0x35adf2={'raw':!![],'where':{'id':_0x368bb8[_0x8517('0x44')]['id']}},_0x404a40={};_0x404a40[_0x8517('0x34')]=_[_0x8517('0x31')](db['Tag'][_0x8517('0x2c')]);_0x404a40[_0x8517('0x30')]=_['keys'](_0x368bb8[_0x8517('0x30')]);_0x404a40[_0x8517('0x32')]=_[_0x8517('0x33')](_0x404a40[_0x8517('0x34')],_0x404a40[_0x8517('0x30')]);_0x35adf2[_0x8517('0x35')]=_['intersection'](_0x404a40[_0x8517('0x34')],qs[_0x8517('0x45')](_0x368bb8[_0x8517('0x30')]['fields']));_0x35adf2[_0x8517('0x35')]=_0x35adf2[_0x8517('0x35')]['length']?_0x35adf2[_0x8517('0x35')]:_0x404a40[_0x8517('0x34')];if(_0x368bb8['query']['includeAll']){_0x35adf2['include']=[{'all':!![]}];}_0x35adf2=_[_0x8517('0x3c')]({},_0x35adf2,_0x368bb8[_0x8517('0x3e')]);return db['Tag'][_0x8517('0x46')](_0x35adf2)['then'](handleEntityNotFound(_0x31c0b9,null))['then'](respondWithResult(_0x31c0b9,null))[_0x8517('0x43')](handleError(_0x31c0b9,null));};exports[_0x8517('0x47')]=function(_0x3c8ecb,_0x6c2607){return db['Tag'][_0x8517('0x47')](_0x3c8ecb[_0x8517('0x48')],{})[_0x8517('0x22')](function(_0x5a6812){var _0x15102f=_0x3c8ecb[_0x8517('0x49')][_0x8517('0x24')]({'plain':!![]});if(!_0x15102f)throw new Error(_0x8517('0x4a'));if(_0x15102f[_0x8517('0x4b')]===_0x8517('0x49')){var _0x3cccd9=_0x5a6812['get']({'plain':!![]});var _0x3a5adb='Tags';return db['UserProfileSection'][_0x8517('0x46')]({'where':{'name':_0x3a5adb,'userProfileId':_0x15102f[_0x8517('0x4c')]},'raw':!![]})[_0x8517('0x22')](function(_0x2d604f){if(_0x2d604f&&_0x2d604f['autoAssociation']===0x0){return db[_0x8517('0x25')][_0x8517('0x47')]({'name':_0x3cccd9['name'],'resourceId':_0x3cccd9['id'],'type':_0x2d604f['name'],'sectionId':_0x2d604f['id']},{})[_0x8517('0x22')](function(){return _0x5a6812;});}else{return _0x5a6812;}})[_0x8517('0x43')](function(_0x28c1fb){logger['error'](_0x8517('0x4d'),_0x28c1fb);throw _0x28c1fb;});}return _0x5a6812;})['then'](respondWithResult(_0x6c2607,0xc9))[_0x8517('0x43')](handleError(_0x6c2607,null));};exports[_0x8517('0x21')]=function(_0x1ba2f,_0x58c98b){if(_0x1ba2f[_0x8517('0x48')]['id']){delete _0x1ba2f[_0x8517('0x48')]['id'];}return db[_0x8517('0x2b')][_0x8517('0x46')]({'where':{'id':_0x1ba2f[_0x8517('0x44')]['id']}})['then'](handleEntityNotFound(_0x58c98b,null))['then'](saveUpdates(_0x1ba2f[_0x8517('0x48')],null))[_0x8517('0x22')](respondWithResult(_0x58c98b,null))[_0x8517('0x43')](handleError(_0x58c98b,null));};exports['destroy']=function(_0x4dcf7b,_0x1ce476){return db[_0x8517('0x2b')]['find']({'where':{'id':_0x4dcf7b['params']['id']}})[_0x8517('0x22')](handleEntityNotFound(_0x1ce476,null))[_0x8517('0x22')](removeEntity(_0x1ce476,null))[_0x8517('0x43')](handleError(_0x1ce476,null));}; \ No newline at end of file +var _0x984b=['create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','fast-json-patch','request-promise','moment','util','path','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','undefined','limit','offset','count','set','Content-Range','json','reject','update','then','destroy','get','Tags','UserProfileResource','error','name','send','map','Tag','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','find'];(function(_0x5123de,_0xce954f){var _0x386668=function(_0x2ec2e1){while(--_0x2ec2e1){_0x5123de['push'](_0x5123de['shift']());}};_0x386668(++_0xce954f);}(_0x984b,0xee));var _0xb984=function(_0x546124,_0x4de4bd){_0x546124=_0x546124-0x0;var _0x4fdd39=_0x984b[_0x546124];return _0x4fdd39;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xb984('0x0'));var rp=require(_0xb984('0x1'));var moment=require(_0xb984('0x2'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xb984('0x3'));var path=require(_0xb984('0x4'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xb984('0x5'));var fs=require('fs');var fs_extra=require(_0xb984('0x6'));var _=require('lodash');var squel=require(_0xb984('0x7'));var crypto=require(_0xb984('0x8'));var jsforce=require('jsforce');var deskjs=require(_0xb984('0x9'));var toCsv=require('to-csv');var querystring=require(_0xb984('0xa'));var Papa=require(_0xb984('0xb'));var Redis=require(_0xb984('0xc'));var authService=require(_0xb984('0xd'));var qs=require(_0xb984('0xe'));var as=require(_0xb984('0xf'));var hardwareService=require(_0xb984('0x10'));var logger=require(_0xb984('0x11'))(_0xb984('0x12'));var utils=require(_0xb984('0x13'));var config=require(_0xb984('0x14'));var licenseUtil=require(_0xb984('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1b922b,_0x4b9c75){_0x4b9c75=_0x4b9c75||0xcc;return function(_0x61432f){if(_0x61432f){return _0x1b922b[_0xb984('0x16')](_0x4b9c75);}return _0x1b922b['status'](_0x4b9c75)[_0xb984('0x17')]();};}function respondWithResult(_0x2e7986,_0x564d24){_0x564d24=_0x564d24||0xc8;return function(_0x203dba){if(_0x203dba){return _0x2e7986[_0xb984('0x18')](_0x564d24)['json'](_0x203dba);}};}function respondWithFilteredResult(_0xede12d,_0x4073cb){return function(_0x57365c){if(_0x57365c){var _0x6fae41=typeof _0x4073cb['offset']===_0xb984('0x19')&&typeof _0x4073cb[_0xb984('0x1a')]===_0xb984('0x19');var _0x3f7cff=_0x57365c['count'];var _0x396c36=_0x6fae41?0x0:_0x4073cb[_0xb984('0x1b')];var _0x3a5c96=_0x6fae41?_0x57365c[_0xb984('0x1c')]:_0x4073cb[_0xb984('0x1b')]+_0x4073cb[_0xb984('0x1a')];var _0x5c2e25;if(_0x3a5c96>=_0x3f7cff){_0x3a5c96=_0x3f7cff;_0x5c2e25=0xc8;}else{_0x5c2e25=0xce;}_0xede12d[_0xb984('0x18')](_0x5c2e25);return _0xede12d[_0xb984('0x1d')](_0xb984('0x1e'),_0x396c36+'-'+_0x3a5c96+'/'+_0x3f7cff)[_0xb984('0x1f')](_0x57365c);}return null;};}function patchUpdates(_0x32831b){return function(_0xcf9365){try{jsonpatch['apply'](_0xcf9365,_0x32831b,!![]);}catch(_0x39d16f){return BPromise[_0xb984('0x20')](_0x39d16f);}return _0xcf9365['save']();};}function saveUpdates(_0x44b570,_0x97af5c){return function(_0x14734a){if(_0x14734a){return _0x14734a[_0xb984('0x21')](_0x44b570)[_0xb984('0x22')](function(_0x286033){return _0x286033;});}return null;};}function removeEntity(_0x41510a,_0x52c581){return function(_0x391a1e){if(_0x391a1e){return _0x391a1e[_0xb984('0x23')]()[_0xb984('0x22')](function(){var _0x5d4d38=_0x391a1e[_0xb984('0x24')]({'plain':!![]});var _0x2e806e=_0xb984('0x25');return db[_0xb984('0x26')][_0xb984('0x23')]({'where':{'type':_0x2e806e,'resourceId':_0x5d4d38['id']}})[_0xb984('0x22')](function(){return _0x391a1e;});})[_0xb984('0x22')](function(){_0x41510a[_0xb984('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x249d47,_0x469af6){return function(_0x3e254b){if(!_0x3e254b){_0x249d47[_0xb984('0x16')](0x194);}return _0x3e254b;};}function handleError(_0x4fb896,_0xa44895){_0xa44895=_0xa44895||0x1f4;return function(_0x67e4d3){logger[_0xb984('0x27')](_0x67e4d3['stack']);if(_0x67e4d3[_0xb984('0x28')]){delete _0x67e4d3[_0xb984('0x28')];}_0x4fb896[_0xb984('0x18')](_0xa44895)[_0xb984('0x29')](_0x67e4d3);};}exports['index']=function(_0x5b8da1,_0x4dcf73){var _0x10b9ac={},_0x23ecf6={},_0x58a98c={'count':0x0,'rows':[]};var _0x320bef=_[_0xb984('0x2a')](db[_0xb984('0x2b')][_0xb984('0x2c')],function(_0x518bef){return{'name':_0x518bef['fieldName'],'type':_0x518bef[_0xb984('0x2d')][_0xb984('0x2e')]};});_0x23ecf6[_0xb984('0x2f')]=_[_0xb984('0x2a')](_0x320bef,'name');_0x23ecf6[_0xb984('0x30')]=_[_0xb984('0x31')](_0x5b8da1[_0xb984('0x30')]);_0x23ecf6[_0xb984('0x32')]=_[_0xb984('0x33')](_0x23ecf6[_0xb984('0x2f')],_0x23ecf6['query']);_0x10b9ac[_0xb984('0x34')]=_[_0xb984('0x33')](_0x23ecf6[_0xb984('0x2f')],qs[_0xb984('0x35')](_0x5b8da1[_0xb984('0x30')][_0xb984('0x35')]));_0x10b9ac['attributes']=_0x10b9ac[_0xb984('0x34')][_0xb984('0x36')]?_0x10b9ac['attributes']:_0x23ecf6['model'];if(!_0x5b8da1[_0xb984('0x30')]['hasOwnProperty'](_0xb984('0x37'))){_0x10b9ac[_0xb984('0x1a')]=qs['limit'](_0x5b8da1[_0xb984('0x30')]['limit']);_0x10b9ac[_0xb984('0x1b')]=qs['offset'](_0x5b8da1[_0xb984('0x30')]['offset']);}_0x10b9ac['order']=qs[_0xb984('0x38')](_0x5b8da1[_0xb984('0x30')]['sort']);_0x10b9ac[_0xb984('0x39')]=qs[_0xb984('0x32')](_['pick'](_0x5b8da1[_0xb984('0x30')],_0x23ecf6[_0xb984('0x32')]),_0x320bef);if(_0x5b8da1[_0xb984('0x30')][_0xb984('0x3a')]){_0x10b9ac['where']=_[_0xb984('0x3b')](_0x10b9ac[_0xb984('0x39')],{'$or':_[_0xb984('0x2a')](_0x320bef,function(_0x474fbd){if(_0x474fbd[_0xb984('0x2d')]!==_0xb984('0x3c')){var _0xc257ee={};_0xc257ee[_0x474fbd[_0xb984('0x28')]]={'$like':'%'+_0x5b8da1[_0xb984('0x30')][_0xb984('0x3a')]+'%'};return _0xc257ee;}})});}_0x10b9ac=_['merge']({},_0x10b9ac,_0x5b8da1[_0xb984('0x3d')]);var _0xd10521={'where':_0x10b9ac[_0xb984('0x39')]};return db[_0xb984('0x2b')][_0xb984('0x1c')](_0xd10521)[_0xb984('0x22')](function(_0x1e8323){_0x58a98c[_0xb984('0x1c')]=_0x1e8323;if(_0x5b8da1['query']['includeAll']){_0x10b9ac[_0xb984('0x3e')]=[{'all':!![]}];}return db['Tag'][_0xb984('0x3f')](_0x10b9ac);})[_0xb984('0x22')](function(_0x216df6){_0x58a98c[_0xb984('0x40')]=_0x216df6;return _0x58a98c;})['then'](respondWithFilteredResult(_0x4dcf73,_0x10b9ac))[_0xb984('0x41')](handleError(_0x4dcf73,null));};exports[_0xb984('0x42')]=function(_0x5d5e85,_0x21a5bb){var _0xb61add={'raw':!![],'where':{'id':_0x5d5e85[_0xb984('0x43')]['id']}},_0x38a025={};_0x38a025[_0xb984('0x2f')]=_[_0xb984('0x31')](db[_0xb984('0x2b')]['rawAttributes']);_0x38a025[_0xb984('0x30')]=_[_0xb984('0x31')](_0x5d5e85['query']);_0x38a025['filters']=_[_0xb984('0x33')](_0x38a025[_0xb984('0x2f')],_0x38a025[_0xb984('0x30')]);_0xb61add[_0xb984('0x34')]=_[_0xb984('0x33')](_0x38a025['model'],qs[_0xb984('0x35')](_0x5d5e85[_0xb984('0x30')][_0xb984('0x35')]));_0xb61add[_0xb984('0x34')]=_0xb61add[_0xb984('0x34')][_0xb984('0x36')]?_0xb61add[_0xb984('0x34')]:_0x38a025[_0xb984('0x2f')];if(_0x5d5e85[_0xb984('0x30')][_0xb984('0x44')]){_0xb61add['include']=[{'all':!![]}];}_0xb61add=_[_0xb984('0x3b')]({},_0xb61add,_0x5d5e85[_0xb984('0x3d')]);return db['Tag'][_0xb984('0x45')](_0xb61add)[_0xb984('0x22')](handleEntityNotFound(_0x21a5bb,null))[_0xb984('0x22')](respondWithResult(_0x21a5bb,null))[_0xb984('0x41')](handleError(_0x21a5bb,null));};exports[_0xb984('0x46')]=function(_0x49dde7,_0x10f813){return db[_0xb984('0x2b')][_0xb984('0x46')](_0x49dde7[_0xb984('0x47')],{})['then'](function(_0x2753e3){var _0x303280=_0x49dde7[_0xb984('0x48')][_0xb984('0x24')]({'plain':!![]});if(!_0x303280)throw new Error(_0xb984('0x49'));if(_0x303280[_0xb984('0x4a')]===_0xb984('0x48')){var _0x445f90=_0x2753e3[_0xb984('0x24')]({'plain':!![]});var _0x5c3d82=_0xb984('0x25');return db[_0xb984('0x4b')][_0xb984('0x45')]({'where':{'name':_0x5c3d82,'userProfileId':_0x303280['userProfileId']},'raw':!![]})[_0xb984('0x22')](function(_0x42a9f8){if(_0x42a9f8&&_0x42a9f8['autoAssociation']===0x0){return db[_0xb984('0x26')]['create']({'name':_0x445f90[_0xb984('0x28')],'resourceId':_0x445f90['id'],'type':_0x42a9f8[_0xb984('0x28')],'sectionId':_0x42a9f8['id']},{})['then'](function(){return _0x2753e3;});}else{return _0x2753e3;}})[_0xb984('0x41')](function(_0x38b1cb){logger[_0xb984('0x27')](_0xb984('0x4c'),_0x38b1cb);throw _0x38b1cb;});}return _0x2753e3;})[_0xb984('0x22')](respondWithResult(_0x10f813,0xc9))[_0xb984('0x41')](handleError(_0x10f813,null));};exports['update']=function(_0x1774a3,_0x5d06f8){if(_0x1774a3[_0xb984('0x47')]['id']){delete _0x1774a3[_0xb984('0x47')]['id'];}return db[_0xb984('0x2b')]['find']({'where':{'id':_0x1774a3['params']['id']}})[_0xb984('0x22')](handleEntityNotFound(_0x5d06f8,null))[_0xb984('0x22')](saveUpdates(_0x1774a3['body'],null))['then'](respondWithResult(_0x5d06f8,null))[_0xb984('0x41')](handleError(_0x5d06f8,null));};exports[_0xb984('0x23')]=function(_0x38cca4,_0x3daaa0){return db[_0xb984('0x2b')][_0xb984('0x45')]({'where':{'id':_0x38cca4['params']['id']}})['then'](handleEntityNotFound(_0x3daaa0,null))[_0xb984('0x22')](removeEntity(_0x3daaa0,null))[_0xb984('0x41')](handleError(_0x3daaa0,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index b494c46..c47d50c 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 _0x4793=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./tag.attributes','exports','tools_tags','lodash','util','../../config/logger'];(function(_0x42623b,_0x1a5488){var _0x8ae8f2=function(_0x36c76c){while(--_0x36c76c){_0x42623b['push'](_0x42623b['shift']());}};_0x8ae8f2(++_0x1a5488);}(_0x4793,0xb3));var _0x3479=function(_0x54603a,_0x199824){_0x54603a=_0x54603a-0x0;var _0x467b1d=_0x4793[_0x54603a];return _0x467b1d;};'use strict';var _=require(_0x3479('0x0'));var util=require(_0x3479('0x1'));var logger=require(_0x3479('0x2'))(_0x3479('0x3'));var moment=require(_0x3479('0x4'));var BPromise=require(_0x3479('0x5'));var rp=require(_0x3479('0x6'));var fs=require('fs');var path=require(_0x3479('0x7'));var rimraf=require(_0x3479('0x8'));var config=require(_0x3479('0x9'));var attributes=require(_0x3479('0xa'));module[_0x3479('0xb')]=function(_0x13319a,_0x1ac355){return _0x13319a['define']('Tag',attributes,{'tableName':_0x3479('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5e58=['./tag.attributes','exports','Tag','tools_tags','lodash','request-promise','../../config/environment'];(function(_0x4a3898,_0x4c9853){var _0x25ceb0=function(_0x528b6d){while(--_0x528b6d){_0x4a3898['push'](_0x4a3898['shift']());}};_0x25ceb0(++_0x4c9853);}(_0x5e58,0x14d));var _0x85e5=function(_0x176d14,_0x3984ea){_0x176d14=_0x176d14-0x0;var _0x89522c=_0x5e58[_0x176d14];return _0x89522c;};'use strict';var _=require(_0x85e5('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x85e5('0x1'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x85e5('0x2'));var attributes=require(_0x85e5('0x3'));module[_0x85e5('0x4')]=function(_0x6008b8,_0x5a2706){return _0x6008b8['define'](_0x85e5('0x5'),attributes,{'tableName':_0x85e5('0x6'),'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 45ae87f..ef3cc3d 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 _0xbd50=['Tag,\x20%s,\x20%s','request\x20sent','Tag,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','request','then'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xbd50,0x196));var _0x0bd5=function(_0x5ddbb4,_0x550725){_0x5ddbb4=_0x5ddbb4-0x0;var _0x4d6592=_0xbd50[_0x5ddbb4];return _0x4d6592;};'use strict';var _=require(_0x0bd5('0x0'));var util=require(_0x0bd5('0x1'));var moment=require(_0x0bd5('0x2'));var BPromise=require('bluebird');var rs=require(_0x0bd5('0x3'));var fs=require('fs');var Redis=require(_0x0bd5('0x4'));var db=require(_0x0bd5('0x5'))['db'];var utils=require(_0x0bd5('0x6'));var logger=require(_0x0bd5('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0bd5('0x8')][_0x0bd5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xcc6cfa,_0x2c0db1,_0x1b99f3){return new BPromise(function(_0x5ebe64,_0x47e78d){return client[_0x0bd5('0xa')](_0xcc6cfa,_0x1b99f3)[_0x0bd5('0xb')](function(_0x259f4c){logger['info'](_0x0bd5('0xc'),_0x2c0db1,_0x0bd5('0xd'));logger['debug'](_0x0bd5('0xe'),_0x2c0db1,_0x0bd5('0xd'),JSON['stringify'](_0x259f4c));if(_0x259f4c[_0x0bd5('0xf')]){if(_0x259f4c[_0x0bd5('0xf')][_0x0bd5('0x10')]===0x1f4){logger['error'](_0x0bd5('0xc'),_0x2c0db1,_0x259f4c[_0x0bd5('0xf')][_0x0bd5('0x11')]);return _0x47e78d(_0x259f4c[_0x0bd5('0xf')][_0x0bd5('0x11')]);}logger[_0x0bd5('0xf')](_0x0bd5('0xc'),_0x2c0db1,_0x259f4c[_0x0bd5('0xf')]['message']);return _0x5ebe64(_0x259f4c[_0x0bd5('0xf')][_0x0bd5('0x11')]);}else{logger['info'](_0x0bd5('0xc'),_0x2c0db1,_0x0bd5('0xd'));_0x5ebe64(_0x259f4c[_0x0bd5('0x12')][_0x0bd5('0x11')]);}})['catch'](function(_0x14f32c){logger[_0x0bd5('0xf')](_0x0bd5('0xc'),_0x2c0db1,_0x14f32c);_0x47e78d(_0x14f32c);});});} \ No newline at end of file +var _0x0e9f=['debug','Tag,\x20%s,\x20%s,\x20%s','stringify','error','code','Tag,\x20%s,\x20%s','message','catch','lodash','util','randomstring','../../config/utils','../../config/environment','jayson/promise','http','then','info','request\x20sent'];(function(_0x3a2a3c,_0x37bd31){var _0x50ac9a=function(_0x494a7f){while(--_0x494a7f){_0x3a2a3c['push'](_0x3a2a3c['shift']());}};_0x50ac9a(++_0x37bd31);}(_0x0e9f,0x116));var _0xf0e9=function(_0xbccb4c,_0x5aaf8d){_0xbccb4c=_0xbccb4c-0x0;var _0x5d3ba5=_0x0e9f[_0xbccb4c];return _0x5d3ba5;};'use strict';var _=require(_0xf0e9('0x0'));var util=require(_0xf0e9('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xf0e9('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xf0e9('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0xf0e9('0x4'));var jayson=require(_0xf0e9('0x5'));var client=jayson['client'][_0xf0e9('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x4a35a3,_0x3f9792,_0x2fa08f){return new BPromise(function(_0x106ba0,_0x58edfe){return client['request'](_0x4a35a3,_0x2fa08f)[_0xf0e9('0x7')](function(_0x7b3146){logger[_0xf0e9('0x8')]('Tag,\x20%s,\x20%s',_0x3f9792,_0xf0e9('0x9'));logger[_0xf0e9('0xa')](_0xf0e9('0xb'),_0x3f9792,'request\x20sent',JSON[_0xf0e9('0xc')](_0x7b3146));if(_0x7b3146[_0xf0e9('0xd')]){if(_0x7b3146[_0xf0e9('0xd')][_0xf0e9('0xe')]===0x1f4){logger['error'](_0xf0e9('0xf'),_0x3f9792,_0x7b3146['error'][_0xf0e9('0x10')]);return _0x58edfe(_0x7b3146[_0xf0e9('0xd')]['message']);}logger[_0xf0e9('0xd')](_0xf0e9('0xf'),_0x3f9792,_0x7b3146[_0xf0e9('0xd')][_0xf0e9('0x10')]);return _0x106ba0(_0x7b3146[_0xf0e9('0xd')][_0xf0e9('0x10')]);}else{logger['info'](_0xf0e9('0xf'),_0x3f9792,_0xf0e9('0x9'));_0x106ba0(_0x7b3146['result'][_0xf0e9('0x10')]);}})[_0xf0e9('0x11')](function(_0x3d0b4d){logger[_0xf0e9('0xd')]('Tag,\x20%s,\x20%s',_0x3f9792,_0x3d0b4d);_0x58edfe(_0x3d0b4d);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index 731dcb5..427d048 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(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_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'));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(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0xa9e0,0x123));var _0x0a9e=function(_0x521929,_0x479be5){_0x521929=_0x521929-0x0;var _0x632436=_0xa9e0[_0x521929];return _0x632436;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));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 a6c1c05..ae32356 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 _0xb7e7=['STRING','sequelize'];(function(_0x255d5b,_0x4f6f35){var _0x3e141a=function(_0x249ee2){while(--_0x249ee2){_0x255d5b['push'](_0x255d5b['shift']());}};_0x3e141a(++_0x4f6f35);}(_0xb7e7,0x121));var _0x7b7e=function(_0x42f009,_0x5e27b1){_0x42f009=_0x42f009-0x0;var _0x22a1e0=_0xb7e7[_0x42f009];return _0x22a1e0;};'use strict';var Sequelize=require(_0x7b7e('0x0'));module['exports']={'name':{'type':Sequelize[_0x7b7e('0x1')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize[_0x7b7e('0x1')]}}; \ No newline at end of file +var _0x0713=['STRING','name'];(function(_0x38d887,_0x261d68){var _0x84c717=function(_0x4c5a40){while(--_0x4c5a40){_0x38d887['push'](_0x38d887['shift']());}};_0x84c717(++_0x261d68);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3071('0x0')],'allowNull':![],'unique':_0x3071('0x1')},'description':{'type':Sequelize[_0x3071('0x0')]}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index 0625833..dbea0ad 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 _0x149f=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','register','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','error','stack','name','index','map','rawAttributes','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','Team','includeAll','show','params','keys','include','find','catch','create','body','user','get','role','Teams','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','sequelize','transaction','TeamVoicePrefix','VoicePrefixId','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','Sequelize','QueryTypes','UserId','UserVoicePrefix','end','send','findOne','channel','isValidChannel','ValidationError','Unknown\x20channel','toLowerCase','Queue','Queues','addQueues','capitalize','ids','removeQueues','Voice','Mail','Sms','Openchannel','Whatsapp','penalty','QueueId','TeamVoiceQueue','User','emit','Queue:save','findAll','online','voicePause','interface','UserVoiceQueueRt','upsert','isNil','format','SIP/%s','all','addAgents','removeAgents','Chat','Queue:remove','getAgents','eml-format','zip-dir','request-promise','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x482da9,_0x37d4f4){var _0x3a0624=function(_0x593a13){while(--_0x593a13){_0x482da9['push'](_0x482da9['shift']());}};_0x3a0624(++_0x37d4f4);}(_0x149f,0x180));var _0xf149=function(_0x2ec461,_0x5f588a){_0x2ec461=_0x2ec461-0x0;var _0x28603d=_0x149f[_0x2ec461];return _0x28603d;};'use strict';var emlformat=require(_0xf149('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf149('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf149('0x2'));var moment=require('moment');var BPromise=require(_0xf149('0x3'));var Mustache=require('mustache');var util=require(_0xf149('0x4'));var path=require('path');var sox=require(_0xf149('0x5'));var csv=require(_0xf149('0x6'));var ejs=require(_0xf149('0x7'));var fs=require('fs');var fs_extra=require(_0xf149('0x8'));var _=require(_0xf149('0x9'));var squel=require(_0xf149('0xa'));var crypto=require(_0xf149('0xb'));var jsforce=require(_0xf149('0xc'));var deskjs=require(_0xf149('0xd'));var toCsv=require(_0xf149('0x6'));var querystring=require(_0xf149('0xe'));var Papa=require('papaparse');var Redis=require(_0xf149('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xf149('0x10'));var as=require(_0xf149('0x11'));var hardwareService=require(_0xf149('0x12'));var logger=require(_0xf149('0x13'))(_0xf149('0x14'));var utils=require(_0xf149('0x15'));var config=require(_0xf149('0x16'));var licenseUtil=require(_0xf149('0x17'));var db=require(_0xf149('0x18'))['db'];config[_0xf149('0x19')]=_[_0xf149('0x1a')](config[_0xf149('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xf149('0x1b'))(new Redis(config[_0xf149('0x19')]));require('./team.socket')[_0xf149('0x1c')](socket);function respondWithStatusCode(_0x227c74,_0x20c864){_0x20c864=_0x20c864||0xcc;return function(_0x22b569){if(_0x22b569){return _0x227c74[_0xf149('0x1d')](_0x20c864);}return _0x227c74[_0xf149('0x1e')](_0x20c864)['end']();};}function respondWithResult(_0x189114,_0x1ed4b1){_0x1ed4b1=_0x1ed4b1||0xc8;return function(_0xdea1d0){if(_0xdea1d0){return _0x189114[_0xf149('0x1e')](_0x1ed4b1)['json'](_0xdea1d0);}};}function respondWithFilteredResult(_0x528a60,_0x5f2639){return function(_0x50cdda){if(_0x50cdda){var _0x529538=typeof _0x5f2639[_0xf149('0x1f')]===_0xf149('0x20')&&typeof _0x5f2639[_0xf149('0x21')]==='undefined';var _0x4fbd07=_0x50cdda[_0xf149('0x22')];var _0x457420=_0x529538?0x0:_0x5f2639[_0xf149('0x1f')];var _0x41c9c6=_0x529538?_0x50cdda[_0xf149('0x22')]:_0x5f2639[_0xf149('0x1f')]+_0x5f2639[_0xf149('0x21')];var _0x227ab6;if(_0x41c9c6>=_0x4fbd07){_0x41c9c6=_0x4fbd07;_0x227ab6=0xc8;}else{_0x227ab6=0xce;}_0x528a60[_0xf149('0x1e')](_0x227ab6);return _0x528a60[_0xf149('0x23')](_0xf149('0x24'),_0x457420+'-'+_0x41c9c6+'/'+_0x4fbd07)[_0xf149('0x25')](_0x50cdda);}return null;};}function patchUpdates(_0x47ee84){return function(_0x3f031d){try{jsonpatch[_0xf149('0x26')](_0x3f031d,_0x47ee84,!![]);}catch(_0x409a51){return BPromise[_0xf149('0x27')](_0x409a51);}return _0x3f031d['save']();};}function saveUpdates(_0x3a9446,_0x1b4dde){return function(_0x57b9f3){if(_0x57b9f3){return _0x57b9f3[_0xf149('0x28')](_0x3a9446)[_0xf149('0x29')](function(_0x7132de){return _0x7132de;});}return null;};}function handleEntityNotFound(_0x4dd499,_0x1a51b7){return function(_0x4b272f){if(!_0x4b272f){_0x4dd499[_0xf149('0x1d')](0x194);}return _0x4b272f;};}function handleError(_0x5d337f,_0x2cd891){_0x2cd891=_0x2cd891||0x1f4;return function(_0x6c4afa){logger[_0xf149('0x2a')](_0x6c4afa[_0xf149('0x2b')]);if(_0x6c4afa[_0xf149('0x2c')]){delete _0x6c4afa['name'];}_0x5d337f[_0xf149('0x1e')](_0x2cd891)['send'](_0x6c4afa);};}exports[_0xf149('0x2d')]=function(_0x31bba4,_0x3391e3){var _0xd06dc={},_0x37ec4b={},_0x176223={'count':0x0,'rows':[]};var _0x162e7a=_[_0xf149('0x2e')](db['Team'][_0xf149('0x2f')],function(_0x1af42e){return{'name':_0x1af42e['fieldName'],'type':_0x1af42e[_0xf149('0x30')][_0xf149('0x31')]};});_0x37ec4b['model']=_[_0xf149('0x2e')](_0x162e7a,_0xf149('0x2c'));_0x37ec4b[_0xf149('0x32')]=_['keys'](_0x31bba4['query']);_0x37ec4b[_0xf149('0x33')]=_[_0xf149('0x34')](_0x37ec4b[_0xf149('0x35')],_0x37ec4b[_0xf149('0x32')]);_0xd06dc[_0xf149('0x36')]=_[_0xf149('0x34')](_0x37ec4b['model'],qs[_0xf149('0x37')](_0x31bba4[_0xf149('0x32')][_0xf149('0x37')]));_0xd06dc[_0xf149('0x36')]=_0xd06dc[_0xf149('0x36')][_0xf149('0x38')]?_0xd06dc[_0xf149('0x36')]:_0x37ec4b[_0xf149('0x35')];if(!_0x31bba4[_0xf149('0x32')][_0xf149('0x39')](_0xf149('0x3a'))){_0xd06dc[_0xf149('0x21')]=qs[_0xf149('0x21')](_0x31bba4[_0xf149('0x32')][_0xf149('0x21')]);_0xd06dc[_0xf149('0x1f')]=qs['offset'](_0x31bba4[_0xf149('0x32')][_0xf149('0x1f')]);}_0xd06dc[_0xf149('0x3b')]=qs[_0xf149('0x3c')](_0x31bba4[_0xf149('0x32')]['sort']);_0xd06dc[_0xf149('0x3d')]=qs[_0xf149('0x33')](_[_0xf149('0x3e')](_0x31bba4['query'],_0x37ec4b[_0xf149('0x33')]),_0x162e7a);if(_0x31bba4[_0xf149('0x32')][_0xf149('0x3f')]){_0xd06dc[_0xf149('0x3d')]=_[_0xf149('0x40')](_0xd06dc[_0xf149('0x3d')],{'$or':_['map'](_0x162e7a,function(_0x1c5976){if(_0x1c5976['type']!==_0xf149('0x41')){var _0xf08e9={};_0xf08e9[_0x1c5976[_0xf149('0x2c')]]={'$like':'%'+_0x31bba4[_0xf149('0x32')][_0xf149('0x3f')]+'%'};return _0xf08e9;}})});}_0xd06dc=_[_0xf149('0x40')]({},_0xd06dc,_0x31bba4[_0xf149('0x42')]);var _0x24129b={'where':_0xd06dc[_0xf149('0x3d')]};return db[_0xf149('0x43')][_0xf149('0x22')](_0x24129b)['then'](function(_0x412aac){_0x176223[_0xf149('0x22')]=_0x412aac;if(_0x31bba4[_0xf149('0x32')][_0xf149('0x44')]){_0xd06dc['include']=[{'all':!![]}];}return db['Team']['findAll'](_0xd06dc);})[_0xf149('0x29')](function(_0x51f3d7){_0x176223['rows']=_0x51f3d7;return _0x176223;})[_0xf149('0x29')](respondWithFilteredResult(_0x3391e3,_0xd06dc))['catch'](handleError(_0x3391e3,null));};exports[_0xf149('0x45')]=function(_0x4beb8a,_0x2f450b){var _0x2e8aba={'raw':![],'where':{'id':_0x4beb8a[_0xf149('0x46')]['id']}},_0x338bea={};_0x338bea['model']=_[_0xf149('0x47')](db['Team'][_0xf149('0x2f')]);_0x338bea[_0xf149('0x32')]=_[_0xf149('0x47')](_0x4beb8a[_0xf149('0x32')]);_0x338bea[_0xf149('0x33')]=_[_0xf149('0x34')](_0x338bea[_0xf149('0x35')],_0x338bea[_0xf149('0x32')]);_0x2e8aba[_0xf149('0x36')]=_['intersection'](_0x338bea[_0xf149('0x35')],qs['fields'](_0x4beb8a[_0xf149('0x32')][_0xf149('0x37')]));_0x2e8aba[_0xf149('0x36')]=_0x2e8aba[_0xf149('0x36')][_0xf149('0x38')]?_0x2e8aba[_0xf149('0x36')]:_0x338bea[_0xf149('0x35')];if(_0x4beb8a['query'][_0xf149('0x44')]){_0x2e8aba[_0xf149('0x48')]=[{'all':!![]}];}_0x2e8aba=_[_0xf149('0x40')]({},_0x2e8aba,_0x4beb8a[_0xf149('0x42')]);return db[_0xf149('0x43')][_0xf149('0x49')](_0x2e8aba)[_0xf149('0x29')](handleEntityNotFound(_0x2f450b,null))[_0xf149('0x29')](respondWithResult(_0x2f450b,null))[_0xf149('0x4a')](handleError(_0x2f450b,null));};exports[_0xf149('0x4b')]=function(_0x545668,_0x2b3b78){return db['Team'][_0xf149('0x4b')](_0x545668[_0xf149('0x4c')],{})['then'](function(_0x15330e){var _0xc573e9=_0x545668[_0xf149('0x4d')][_0xf149('0x4e')]({'plain':!![]});if(!_0xc573e9)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xc573e9[_0xf149('0x4f')]==='user'){var _0x47dbf1=_0x15330e[_0xf149('0x4e')]({'plain':!![]});var _0x5dbacc=_0xf149('0x50');return db[_0xf149('0x51')]['find']({'where':{'name':_0x5dbacc,'userProfileId':_0xc573e9[_0xf149('0x52')]},'raw':!![]})['then'](function(_0x2fa699){if(_0x2fa699&&_0x2fa699['autoAssociation']===0x0){return db[_0xf149('0x53')][_0xf149('0x4b')]({'name':_0x47dbf1[_0xf149('0x2c')],'resourceId':_0x47dbf1['id'],'type':_0x2fa699['name'],'sectionId':_0x2fa699['id']},{})[_0xf149('0x29')](function(){return _0x15330e;});}else{return _0x15330e;}})[_0xf149('0x4a')](function(_0x38fb9d){logger['error'](_0xf149('0x54'),_0x38fb9d);throw _0x38fb9d;});}return _0x15330e;})['then'](respondWithResult(_0x2b3b78,0xc9))['catch'](handleError(_0x2b3b78,null));};exports[_0xf149('0x28')]=function(_0x5375d5,_0x3b7faf){if(_0x5375d5[_0xf149('0x4c')]['id']){delete _0x5375d5[_0xf149('0x4c')]['id'];}return db[_0xf149('0x43')][_0xf149('0x49')]({'where':{'id':_0x5375d5['params']['id']}})['then'](handleEntityNotFound(_0x3b7faf,null))['then'](saveUpdates(_0x5375d5['body'],null))[_0xf149('0x29')](respondWithResult(_0x3b7faf,null))[_0xf149('0x4a')](handleError(_0x3b7faf,null));};exports[_0xf149('0x55')]=function(_0x4503f0,_0x2a94ad){var _0x501f98=_0x4503f0[_0xf149('0x46')]['id'];var _0x210e45=0x0;return db[_0xf149('0x56')][_0xf149('0x57')](function(_0x25dc53){return db[_0xf149('0x58')][_0xf149('0x49')]({'where':{'TeamId':_0x501f98}})[_0xf149('0x29')](function(_0x213867){if(_0x213867===null){return;}_0x210e45=_0x213867[_0xf149('0x59')];var _0x22b7ed=_0xf149('0x5a')+_0x501f98;return db['sequelize'][_0xf149('0x32')](_0x22b7ed,{'type':db[_0xf149('0x5b')][_0xf149('0x5c')]['SELECT'],'raw':!![],'transaction':_0x25dc53})[_0xf149('0x29')](function(_0x24017c){var _0x1ff39c=_[_0xf149('0x2e')](_0x24017c,function(_0x2ce2bf){return Number(_0x2ce2bf[_0xf149('0x5d')]);});return db[_0xf149('0x5e')][_0xf149('0x55')]({'where':{'UserId':{'$in':_0x1ff39c},'VoicePrefixId':_0x210e45},'transaction':_0x25dc53});})[_0xf149('0x29')](function(){return db[_0xf149('0x43')][_0xf149('0x55')]({'where':{'id':_0x501f98},'cascade':!![],'transaction':_0x25dc53});})['then'](function(_0x4b50b0){if(_0x4b50b0===0x0){_0x2a94ad[_0xf149('0x1d')](0x194);}else{return db[_0xf149('0x53')][_0xf149('0x55')]({'where':{'type':_0xf149('0x50'),'resourceId':_0x501f98},'cascade':!![],'transaction':_0x25dc53})['then'](function(){_0x2a94ad[_0xf149('0x1e')](0xcc)[_0xf149('0x5f')]();});}})[_0xf149('0x4a')](function(_0x16dbf2){_0x2a94ad[_0xf149('0x1e')](0x1f4)[_0xf149('0x60')](_0x16dbf2);});});});};exports['getQueues']=function(_0x20a73b,_0x156255,_0x39b421){return db[_0xf149('0x43')][_0xf149('0x61')]({'where':{'id':_0x20a73b[_0xf149('0x46')]['id']}})[_0xf149('0x29')](handleEntityNotFound(_0x156255,null))[_0xf149('0x29')](function(_0xb32e0a){if(!_0x20a73b[_0xf149('0x32')][_0xf149('0x62')]||!utils[_0xf149('0x63')](_0x20a73b[_0xf149('0x32')][_0xf149('0x62')])){throw new db[(_0xf149('0x5b'))][(_0xf149('0x64'))](_0xf149('0x65'));}var _0x235dc0={};var _0x488506={};_0x488506[_0xf149('0x35')]=_[_0xf149('0x47')](db[_['capitalize'](_0x20a73b['query'][_0xf149('0x62')][_0xf149('0x66')]())+_0xf149('0x67')][_0xf149('0x2f')]);_0x488506[_0xf149('0x32')]=_['keys'](_0x20a73b[_0xf149('0x32')]);_0x488506[_0xf149('0x33')]=_['intersection'](_0x488506[_0xf149('0x35')],_0x488506[_0xf149('0x32')]);_0x235dc0['attributes']=_['intersection'](_0x488506['model'],qs[_0xf149('0x37')](_0x20a73b['query'][_0xf149('0x37')]));_0x235dc0[_0xf149('0x36')]=_0x235dc0[_0xf149('0x36')]['length']?_0x235dc0[_0xf149('0x36')]:_0x488506[_0xf149('0x35')];_0x235dc0[_0xf149('0x21')]=qs[_0xf149('0x21')](_0x20a73b[_0xf149('0x32')][_0xf149('0x21')]);_0x235dc0['offset']=qs[_0xf149('0x1f')](_0x20a73b[_0xf149('0x32')]['offset']);_0x235dc0[_0xf149('0x3b')]=qs[_0xf149('0x3c')](_0x20a73b['query']['sort']);_0x235dc0[_0xf149('0x3d')]=qs['filters'](_['pick'](_0x20a73b[_0xf149('0x32')],_0x488506['filters']));_0x235dc0=_[_0xf149('0x40')]({},_0x235dc0,_0x20a73b[_0xf149('0x42')]);return _0xb32e0a[_0xf149('0x4e')+_['capitalize'](_0x20a73b[_0xf149('0x32')][_0xf149('0x62')][_0xf149('0x66')]())+_0xf149('0x68')](_0x235dc0);})['then'](respondWithResult(_0x156255,null))[_0xf149('0x4a')](handleError(_0x156255,null));};exports[_0xf149('0x69')]=function(_0x2834bc,_0x5ea1d8,_0x174190){return db[_0xf149('0x43')][_0xf149('0x61')]({'where':{'id':_0x2834bc[_0xf149('0x46')]['id']}})[_0xf149('0x29')](function(_0x1c49c3){if(_0x1c49c3){if(!_0x2834bc[_0xf149('0x4c')][_0xf149('0x62')]||!utils[_0xf149('0x63')](_0x2834bc[_0xf149('0x4c')][_0xf149('0x62')])){throw new db[(_0xf149('0x5b'))]['ValidationError'](_0xf149('0x65'));}return _0x1c49c3['add'+_[_0xf149('0x6a')](_0x2834bc[_0xf149('0x4c')][_0xf149('0x62')][_0xf149('0x66')]())+_0xf149('0x68')](_0x2834bc[_0xf149('0x4c')][_0xf149('0x6b')]);}return null;})['then'](handleEntityNotFound(_0x5ea1d8,null))[_0xf149('0x29')](respondWithStatusCode(_0x5ea1d8,null))[_0xf149('0x4a')](handleError(_0x5ea1d8,null));};exports[_0xf149('0x6c')]=function(_0x70c70b,_0x312a3e,_0x4ea55d){return db[_0xf149('0x43')]['findOne']({'where':{'id':_0x70c70b['params']['id']}})['then'](function(_0x3d869a){if(_0x3d869a){if(!_0x70c70b[_0xf149('0x32')][_0xf149('0x62')]||!utils[_0xf149('0x63')](_0x70c70b[_0xf149('0x32')][_0xf149('0x62')])){throw new db[(_0xf149('0x5b'))]['ValidationError'](_0xf149('0x65'));}return _0x3d869a['remove'+_[_0xf149('0x6a')](_0x70c70b[_0xf149('0x32')][_0xf149('0x62')][_0xf149('0x66')]())+'Queues'](_0x70c70b[_0xf149('0x32')][_0xf149('0x6b')]);}return null;})[_0xf149('0x29')](handleEntityNotFound(_0x312a3e,null))['then'](respondWithStatusCode(_0x312a3e,null))[_0xf149('0x4a')](handleError(_0x312a3e,null));};exports['addAgents']=function(_0x2cc3b7,_0x4d9737){var _0x121648=_['isArray'](_0x2cc3b7['body'][_0xf149('0x6b')])?_0x2cc3b7[_0xf149('0x4c')][_0xf149('0x6b')]:[_0x2cc3b7['body'][_0xf149('0x6b')]];var _0x172491=_0x2cc3b7[_0xf149('0x46')]['id'];return db[_0xf149('0x43')][_0xf149('0x49')]({'where':{'id':_0x172491}})[_0xf149('0x29')](handleEntityNotFound(_0x4d9737,null))[_0xf149('0x29')](function(_0x215ab2){if(_0x215ab2){var _0x39f8ef=[_0xf149('0x6d'),'Chat',_0xf149('0x6e'),_0xf149('0x6f'),'Fax',_0xf149('0x70'),_0xf149('0x71')];return db['sequelize'][_0xf149('0x57')](function(_0x318173){var _0x500324=_[_0xf149('0x2e')](_0x39f8ef,function(_0x2244b7){var _0x209a2d={'attributes':['id',_0xf149('0x2c')]};if(_0x2244b7===_0xf149('0x6d')){_0x209a2d['through']={'attributes':[_0xf149('0x72')]};}return _0x215ab2[_0xf149('0x4e')+_0x2244b7+_0xf149('0x68')](_0x209a2d)[_0xf149('0x29')](function(_0xb1cc3){var _0x15ad23=_['map'](_0xb1cc3,function(_0x45d625){var _0x5b9517=_[_0xf149('0x2e')](_0x121648,function(_0x3ac2d4){var _0x1c9e3d={'where':{'UserId':_0x3ac2d4,[_0x2244b7+_0xf149('0x73')]:_0x45d625['id']},'transaction':_0x318173};if(_0x2244b7===_0xf149('0x6d')){_0x1c9e3d[_0xf149('0x1a')]={'penalty':_0x45d625[_0xf149('0x74')]['penalty']};}return db[_0xf149('0x75')+_0x2244b7+_0xf149('0x67')]['findOrCreate'](_0x1c9e3d)[_0xf149('0x29')](function(){socket[_0xf149('0x76')](_0xf149('0x4d')+_0x2244b7+_0xf149('0x77'),{'UserId':_0x3ac2d4,[_0x2244b7+_0xf149('0x73')]:_0x45d625['id']});if(_0x2244b7!=='Voice'){return;}return db[_0xf149('0x75')][_0xf149('0x78')]({'where':{'id':_0x121648,'online':0x1},'attributes':['id',_0xf149('0x2c'),_0xf149('0x79'),_0xf149('0x7a'),_0xf149('0x7b')],'raw':!![]})[_0xf149('0x29')](function(_0x382d0a){var _0x48fdf9=_[_0xf149('0x2e')](_0x382d0a,function(_0x4c0645){return db[_0xf149('0x7c')][_0xf149('0x7d')]({'membername':_0x4c0645[_0xf149('0x2c')],'UserId':_0x4c0645['id'],'queue_name':_0x45d625[_0xf149('0x2c')],'VoiceQueueId':_0x45d625['id'],'interface':_[_0xf149('0x7e')](_0x4c0645['interface'])?util[_0xf149('0x7f')](_0xf149('0x80'),_0x4c0645['name']):_0x4c0645[_0xf149('0x7b')],'paused':_0x4c0645['voicePause']||![],'penalty':_0x45d625[_0xf149('0x74')]['penalty']},{'transaction':_0x318173});});return Promise[_0xf149('0x81')](_0x48fdf9);});});});return Promise[_0xf149('0x81')](_0x5b9517);});return Promise[_0xf149('0x81')](_0x15ad23);})[_0xf149('0x29')](function(){return db['TeamVoicePrefix'][_0xf149('0x61')]({'where':{'teamId':_0x172491}})[_0xf149('0x29')](function(_0x2090f3){if(_0x2090f3){var _0x2e9e20=_[_0xf149('0x2e')](_0x121648,function(_0x529bd7){db[_0xf149('0x5e')][_0xf149('0x7d')]({'UserId':_0x529bd7,'VoicePrefixId':_0x2090f3['VoicePrefixId']});});return Promise['all'](_0x2e9e20);}});});});return Promise[_0xf149('0x81')](_0x500324)['then'](function(){return _0x215ab2[_0xf149('0x82')](_0x121648,{'transaction':_0x318173})['spread'](function(_0x57b826){return _0x57b826;});});});}})['then'](respondWithResult(_0x4d9737,null))['catch'](handleError(_0x4d9737,null));};exports[_0xf149('0x83')]=function(_0x13fafc,_0x29c39c){var _0x13ddf7=_['isArray'](_0x13fafc[_0xf149('0x32')][_0xf149('0x6b')])?_0x13fafc[_0xf149('0x32')][_0xf149('0x6b')]:[_0x13fafc[_0xf149('0x32')][_0xf149('0x6b')]];var _0x143680=_0x13fafc[_0xf149('0x46')]['id'];return db[_0xf149('0x43')][_0xf149('0x49')]({'where':{'id':_0x143680}})['then'](handleEntityNotFound(_0x29c39c,null))[_0xf149('0x29')](function(_0x558585){if(_0x558585){var _0x5a91f4=['Voice',_0xf149('0x84'),_0xf149('0x6e'),'Sms','Fax','Openchannel',_0xf149('0x71')];return db[_0xf149('0x56')][_0xf149('0x57')](function(_0x593644){var _0x31bae6=_[_0xf149('0x2e')](_0x5a91f4,function(_0x1eeb80){var _0x12ccf6={'attributes':['id',_0xf149('0x2c')]};return _0x558585[_0xf149('0x4e')+_0x1eeb80+_0xf149('0x68')](_0x12ccf6)[_0xf149('0x29')](function(_0x48b7de){var _0x4778d6=_[_0xf149('0x2e')](_0x48b7de,function(_0x5921a3){return _0x5921a3[_0xf149('0x83')](_0x13ddf7,{'transaction':_0x593644})[_0xf149('0x29')](function(){var _0x19ecd1=_[_0xf149('0x2e')](_0x13ddf7,function(_0xd5fe2d){socket['emit'](_0xf149('0x4d')+_0x1eeb80+_0xf149('0x85'),{'UserId':Number(_0xd5fe2d),[_0x1eeb80+_0xf149('0x73')]:_0x5921a3['id']});if(_0x1eeb80!==_0xf149('0x6d')){return;}return db['UserVoiceQueueRt'][_0xf149('0x55')]({'where':{'VoiceQueueId':_0x5921a3['id'],'UserId':_0xd5fe2d},'transaction':_0x593644});});return Promise[_0xf149('0x81')](_0x19ecd1);});});return Promise[_0xf149('0x81')](_0x4778d6);});});return Promise[_0xf149('0x81')](_0x31bae6)['then'](function(){return _0x558585[_0xf149('0x83')](_0x13ddf7,{'transaction':_0x593644});})[_0xf149('0x29')](function(){return db[_0xf149('0x58')][_0xf149('0x61')]({'where':{'teamId':_0x143680}})[_0xf149('0x29')](function(_0x4ab3fa){if(_0x4ab3fa){var _0x4a83ac=_[_0xf149('0x2e')](_0x13ddf7,function(_0x4f04bd){db[_0xf149('0x5e')][_0xf149('0x55')]({'where':{'UserId':_0x4f04bd,'VoicePrefixId':_0x4ab3fa[_0xf149('0x59')]}});});return Promise[_0xf149('0x81')](_0x4a83ac);}});});});}})[_0xf149('0x29')](respondWithStatusCode(_0x29c39c,null))[_0xf149('0x4a')](handleError(_0x29c39c,null));};exports[_0xf149('0x86')]=function(_0x48b18b,_0xff71fa,_0x4547de){var _0x25a464={};var _0x61654f={};var _0x477a0f;var _0x2b1135;return db[_0xf149('0x43')]['findOne']({'where':{'id':_0x48b18b[_0xf149('0x46')]['id']}})[_0xf149('0x29')](handleEntityNotFound(_0xff71fa,null))[_0xf149('0x29')](function(_0x5cd71a){if(_0x5cd71a){_0x477a0f=_0x5cd71a;_0x61654f[_0xf149('0x35')]=_[_0xf149('0x47')](db[_0xf149('0x75')][_0xf149('0x2f')]);_0x61654f[_0xf149('0x32')]=_['keys'](_0x48b18b[_0xf149('0x32')]);_0x61654f[_0xf149('0x33')]=_['intersection'](_0x61654f[_0xf149('0x35')],_0x61654f[_0xf149('0x32')]);_0x25a464[_0xf149('0x36')]=_[_0xf149('0x34')](_0x61654f['model'],qs[_0xf149('0x37')](_0x48b18b[_0xf149('0x32')][_0xf149('0x37')]));_0x25a464[_0xf149('0x36')]=_0x25a464[_0xf149('0x36')][_0xf149('0x38')]?_0x25a464[_0xf149('0x36')]:_0x61654f[_0xf149('0x35')];_0x25a464[_0xf149('0x3b')]=qs[_0xf149('0x3c')](_0x48b18b[_0xf149('0x32')][_0xf149('0x3c')]);_0x25a464['where']=qs['filters'](_[_0xf149('0x3e')](_0x48b18b['query'],_0x61654f[_0xf149('0x33')]));if(_0x48b18b[_0xf149('0x32')][_0xf149('0x3f')]){_0x25a464[_0xf149('0x3d')]=_[_0xf149('0x40')](_0x25a464[_0xf149('0x3d')],{'$or':_['map'](_0x25a464[_0xf149('0x36')],function(_0x211433){var _0x843ca1={};_0x843ca1[_0x211433]={'$like':'%'+_0x48b18b[_0xf149('0x32')][_0xf149('0x3f')]+'%'};return _0x843ca1;})});}_0x25a464=_[_0xf149('0x40')]({},_0x25a464,_0x48b18b[_0xf149('0x42')]);return _0x477a0f[_0xf149('0x86')](_0x25a464);}})[_0xf149('0x29')](function(_0x24ab34){if(_0x24ab34){_0x2b1135=_0x24ab34[_0xf149('0x38')];if(!_0x48b18b['query'][_0xf149('0x39')](_0xf149('0x3a'))){_0x25a464[_0xf149('0x21')]=qs[_0xf149('0x21')](_0x48b18b[_0xf149('0x32')][_0xf149('0x21')]);_0x25a464[_0xf149('0x1f')]=qs[_0xf149('0x1f')](_0x48b18b['query'][_0xf149('0x1f')]);}return _0x477a0f[_0xf149('0x86')](_0x25a464);}})[_0xf149('0x29')](function(_0x2c5da0){if(_0x2c5da0){return _0x2c5da0?{'count':_0x2b1135,'rows':_0x2c5da0}:null;}})[_0xf149('0x29')](respondWithResult(_0xff71fa,null))[_0xf149('0x4a')](handleError(_0xff71fa,null));}; \ No newline at end of file +var _0xba38=['jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','register','status','end','limit','offset','set','apply','update','sendStatus','error','stack','name','send','index','map','Team','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','merge','VIRTUAL','filter','count','then','includeAll','findAll','rows','params','options','find','catch','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Teams','userProfileId','autoAssociation','UserProfileResource','destroy','sequelize','transaction','TeamVoicePrefix','VoicePrefixId','SELECT\x20UserId\x20FROM\x20user_has_teams\x20WHERE\x20TeamId\x20=\x20','QueryTypes','getQueues','channel','Sequelize','Unknown\x20channel','capitalize','toLowerCase','Queue','rawAttributes','Queues','addQueues','isValidChannel','ValidationError','add','ids','removeQueues','findOne','remove','addAgents','isArray','Chat','Mail','Sms','Fax','Openchannel','Whatsapp','Voice','through','penalty','defaults','TeamVoiceQueue','findOrCreate','Queue:save','QueueId','online','interface','isNil','format','all','upsert','spread','removeAgents','emit','Queue:remove','UserVoiceQueueRt','UserVoicePrefix','getAgents','User','nolimit','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto'];(function(_0x1bd5f7,_0x3a3e1d){var _0x309d5b=function(_0x3a14a5){while(--_0x3a14a5){_0x1bd5f7['push'](_0x1bd5f7['shift']());}};_0x309d5b(++_0x3a3e1d);}(_0xba38,0x190));var _0x8ba3=function(_0x5ba633,_0x128f9f){_0x5ba633=_0x5ba633-0x0;var _0x4cb6de=_0xba38[_0x5ba633];return _0x4cb6de;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8ba3('0x0'));var zipdir=require(_0x8ba3('0x1'));var jsonpatch=require(_0x8ba3('0x2'));var rp=require('request-promise');var moment=require(_0x8ba3('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x8ba3('0x4'));var util=require(_0x8ba3('0x5'));var path=require(_0x8ba3('0x6'));var sox=require(_0x8ba3('0x7'));var csv=require(_0x8ba3('0x8'));var ejs=require(_0x8ba3('0x9'));var fs=require('fs');var fs_extra=require(_0x8ba3('0xa'));var _=require(_0x8ba3('0xb'));var squel=require(_0x8ba3('0xc'));var crypto=require(_0x8ba3('0xd'));var jsforce=require(_0x8ba3('0xe'));var deskjs=require(_0x8ba3('0xf'));var toCsv=require('to-csv');var querystring=require(_0x8ba3('0x10'));var Papa=require(_0x8ba3('0x11'));var Redis=require('ioredis');var authService=require(_0x8ba3('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x8ba3('0x13'));var hardwareService=require(_0x8ba3('0x14'));var logger=require(_0x8ba3('0x15'))(_0x8ba3('0x16'));var utils=require(_0x8ba3('0x17'));var config=require(_0x8ba3('0x18'));var licenseUtil=require(_0x8ba3('0x19'));var db=require(_0x8ba3('0x1a'))['db'];config[_0x8ba3('0x1b')]=_['defaults'](config[_0x8ba3('0x1b')],{'host':_0x8ba3('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8ba3('0x1b')]));require('./team.socket')[_0x8ba3('0x1d')](socket);function respondWithStatusCode(_0x59764d,_0x33581c){_0x33581c=_0x33581c||0xcc;return function(_0x167e86){if(_0x167e86){return _0x59764d['sendStatus'](_0x33581c);}return _0x59764d[_0x8ba3('0x1e')](_0x33581c)[_0x8ba3('0x1f')]();};}function respondWithResult(_0x48577c,_0x3aa5c1){_0x3aa5c1=_0x3aa5c1||0xc8;return function(_0x44d260){if(_0x44d260){return _0x48577c['status'](_0x3aa5c1)['json'](_0x44d260);}};}function respondWithFilteredResult(_0x47020f,_0x4e8bd6){return function(_0x5a8f04){if(_0x5a8f04){var _0x2e2ed7=typeof _0x4e8bd6['offset']==='undefined'&&typeof _0x4e8bd6[_0x8ba3('0x20')]==='undefined';var _0x118c50=_0x5a8f04['count'];var _0x3d0a29=_0x2e2ed7?0x0:_0x4e8bd6[_0x8ba3('0x21')];var _0x3c9367=_0x2e2ed7?_0x5a8f04['count']:_0x4e8bd6[_0x8ba3('0x21')]+_0x4e8bd6[_0x8ba3('0x20')];var _0x2f264d;if(_0x3c9367>=_0x118c50){_0x3c9367=_0x118c50;_0x2f264d=0xc8;}else{_0x2f264d=0xce;}_0x47020f[_0x8ba3('0x1e')](_0x2f264d);return _0x47020f[_0x8ba3('0x22')]('Content-Range',_0x3d0a29+'-'+_0x3c9367+'/'+_0x118c50)['json'](_0x5a8f04);}return null;};}function patchUpdates(_0xb15432){return function(_0x35ca98){try{jsonpatch[_0x8ba3('0x23')](_0x35ca98,_0xb15432,!![]);}catch(_0x11e3e7){return BPromise['reject'](_0x11e3e7);}return _0x35ca98['save']();};}function saveUpdates(_0x10f3e2,_0x410f69){return function(_0x460799){if(_0x460799){return _0x460799[_0x8ba3('0x24')](_0x10f3e2)['then'](function(_0x199ad6){return _0x199ad6;});}return null;};}function handleEntityNotFound(_0x56a391,_0x2f253f){return function(_0x1f1085){if(!_0x1f1085){_0x56a391[_0x8ba3('0x25')](0x194);}return _0x1f1085;};}function handleError(_0x8b2237,_0x43e306){_0x43e306=_0x43e306||0x1f4;return function(_0x428277){logger[_0x8ba3('0x26')](_0x428277[_0x8ba3('0x27')]);if(_0x428277[_0x8ba3('0x28')]){delete _0x428277[_0x8ba3('0x28')];}_0x8b2237[_0x8ba3('0x1e')](_0x43e306)[_0x8ba3('0x29')](_0x428277);};}exports[_0x8ba3('0x2a')]=function(_0x2df77c,_0x309a89){var _0xee2109={},_0x148aac={},_0x4570d3={'count':0x0,'rows':[]};var _0x595f3b=_[_0x8ba3('0x2b')](db[_0x8ba3('0x2c')]['rawAttributes'],function(_0x52e795){return{'name':_0x52e795[_0x8ba3('0x2d')],'type':_0x52e795[_0x8ba3('0x2e')][_0x8ba3('0x2f')]};});_0x148aac[_0x8ba3('0x30')]=_[_0x8ba3('0x2b')](_0x595f3b,_0x8ba3('0x28'));_0x148aac[_0x8ba3('0x31')]=_[_0x8ba3('0x32')](_0x2df77c[_0x8ba3('0x31')]);_0x148aac['filters']=_[_0x8ba3('0x33')](_0x148aac[_0x8ba3('0x30')],_0x148aac[_0x8ba3('0x31')]);_0xee2109[_0x8ba3('0x34')]=_[_0x8ba3('0x33')](_0x148aac[_0x8ba3('0x30')],qs[_0x8ba3('0x35')](_0x2df77c['query']['fields']));_0xee2109[_0x8ba3('0x34')]=_0xee2109[_0x8ba3('0x34')][_0x8ba3('0x36')]?_0xee2109[_0x8ba3('0x34')]:_0x148aac['model'];if(!_0x2df77c['query'][_0x8ba3('0x37')]('nolimit')){_0xee2109['limit']=qs[_0x8ba3('0x20')](_0x2df77c['query'][_0x8ba3('0x20')]);_0xee2109[_0x8ba3('0x21')]=qs['offset'](_0x2df77c[_0x8ba3('0x31')][_0x8ba3('0x21')]);}_0xee2109[_0x8ba3('0x38')]=qs[_0x8ba3('0x39')](_0x2df77c[_0x8ba3('0x31')][_0x8ba3('0x39')]);_0xee2109[_0x8ba3('0x3a')]=qs[_0x8ba3('0x3b')](_[_0x8ba3('0x3c')](_0x2df77c[_0x8ba3('0x31')],_0x148aac[_0x8ba3('0x3b')]),_0x595f3b);if(_0x2df77c[_0x8ba3('0x31')]['filter']){_0xee2109[_0x8ba3('0x3a')]=_[_0x8ba3('0x3d')](_0xee2109[_0x8ba3('0x3a')],{'$or':_[_0x8ba3('0x2b')](_0x595f3b,function(_0x2067c3){if(_0x2067c3[_0x8ba3('0x2e')]!==_0x8ba3('0x3e')){var _0x314909={};_0x314909[_0x2067c3[_0x8ba3('0x28')]]={'$like':'%'+_0x2df77c[_0x8ba3('0x31')][_0x8ba3('0x3f')]+'%'};return _0x314909;}})});}_0xee2109=_[_0x8ba3('0x3d')]({},_0xee2109,_0x2df77c['options']);var _0x1e0069={'where':_0xee2109['where']};return db['Team'][_0x8ba3('0x40')](_0x1e0069)[_0x8ba3('0x41')](function(_0x579e4e){_0x4570d3['count']=_0x579e4e;if(_0x2df77c['query'][_0x8ba3('0x42')]){_0xee2109['include']=[{'all':!![]}];}return db['Team'][_0x8ba3('0x43')](_0xee2109);})['then'](function(_0x2c1bc4){_0x4570d3[_0x8ba3('0x44')]=_0x2c1bc4;return _0x4570d3;})[_0x8ba3('0x41')](respondWithFilteredResult(_0x309a89,_0xee2109))['catch'](handleError(_0x309a89,null));};exports['show']=function(_0x5cb74a,_0x4f524d){var _0x31f5c8={'raw':![],'where':{'id':_0x5cb74a[_0x8ba3('0x45')]['id']}},_0x6f4f75={};_0x6f4f75['model']=_[_0x8ba3('0x32')](db[_0x8ba3('0x2c')]['rawAttributes']);_0x6f4f75[_0x8ba3('0x31')]=_[_0x8ba3('0x32')](_0x5cb74a[_0x8ba3('0x31')]);_0x6f4f75['filters']=_[_0x8ba3('0x33')](_0x6f4f75[_0x8ba3('0x30')],_0x6f4f75[_0x8ba3('0x31')]);_0x31f5c8['attributes']=_[_0x8ba3('0x33')](_0x6f4f75['model'],qs[_0x8ba3('0x35')](_0x5cb74a[_0x8ba3('0x31')][_0x8ba3('0x35')]));_0x31f5c8[_0x8ba3('0x34')]=_0x31f5c8[_0x8ba3('0x34')]['length']?_0x31f5c8[_0x8ba3('0x34')]:_0x6f4f75['model'];if(_0x5cb74a[_0x8ba3('0x31')]['includeAll']){_0x31f5c8['include']=[{'all':!![]}];}_0x31f5c8=_['merge']({},_0x31f5c8,_0x5cb74a[_0x8ba3('0x46')]);return db['Team'][_0x8ba3('0x47')](_0x31f5c8)[_0x8ba3('0x41')](handleEntityNotFound(_0x4f524d,null))[_0x8ba3('0x41')](respondWithResult(_0x4f524d,null))[_0x8ba3('0x48')](handleError(_0x4f524d,null));};exports[_0x8ba3('0x49')]=function(_0x211933,_0x46ea58){return db[_0x8ba3('0x2c')]['create'](_0x211933[_0x8ba3('0x4a')],{})[_0x8ba3('0x41')](function(_0x291311){var _0x4c5571=_0x211933['user'][_0x8ba3('0x4b')]({'plain':!![]});if(!_0x4c5571)throw new Error(_0x8ba3('0x4c'));if(_0x4c5571[_0x8ba3('0x4d')]===_0x8ba3('0x4e')){var _0x4ad033=_0x291311[_0x8ba3('0x4b')]({'plain':!![]});var _0x36cbd9=_0x8ba3('0x4f');return db['UserProfileSection'][_0x8ba3('0x47')]({'where':{'name':_0x36cbd9,'userProfileId':_0x4c5571[_0x8ba3('0x50')]},'raw':!![]})[_0x8ba3('0x41')](function(_0x2ab289){if(_0x2ab289&&_0x2ab289[_0x8ba3('0x51')]===0x0){return db[_0x8ba3('0x52')][_0x8ba3('0x49')]({'name':_0x4ad033['name'],'resourceId':_0x4ad033['id'],'type':_0x2ab289[_0x8ba3('0x28')],'sectionId':_0x2ab289['id']},{})[_0x8ba3('0x41')](function(){return _0x291311;});}else{return _0x291311;}})['catch'](function(_0x28dd6d){logger[_0x8ba3('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x28dd6d);throw _0x28dd6d;});}return _0x291311;})[_0x8ba3('0x41')](respondWithResult(_0x46ea58,0xc9))['catch'](handleError(_0x46ea58,null));};exports[_0x8ba3('0x24')]=function(_0x1b5237,_0x310ff6){if(_0x1b5237[_0x8ba3('0x4a')]['id']){delete _0x1b5237[_0x8ba3('0x4a')]['id'];}return db[_0x8ba3('0x2c')][_0x8ba3('0x47')]({'where':{'id':_0x1b5237[_0x8ba3('0x45')]['id']}})[_0x8ba3('0x41')](handleEntityNotFound(_0x310ff6,null))[_0x8ba3('0x41')](saveUpdates(_0x1b5237[_0x8ba3('0x4a')],null))[_0x8ba3('0x41')](respondWithResult(_0x310ff6,null))[_0x8ba3('0x48')](handleError(_0x310ff6,null));};exports[_0x8ba3('0x53')]=function(_0x5c4b80,_0x13e8bf){var _0xd7bb77=_0x5c4b80[_0x8ba3('0x45')]['id'];var _0x30a0c5=0x0;return db[_0x8ba3('0x54')][_0x8ba3('0x55')](function(_0x54b005){return db[_0x8ba3('0x56')][_0x8ba3('0x47')]({'where':{'TeamId':_0xd7bb77}})[_0x8ba3('0x41')](function(_0x46d262){if(_0x46d262===null){return;}_0x30a0c5=_0x46d262[_0x8ba3('0x57')];var _0xd68f03=_0x8ba3('0x58')+_0xd7bb77;return db[_0x8ba3('0x54')]['query'](_0xd68f03,{'type':db['Sequelize'][_0x8ba3('0x59')]['SELECT'],'raw':!![],'transaction':_0x54b005})[_0x8ba3('0x41')](function(_0x1f0f56){var _0x1f9392=_[_0x8ba3('0x2b')](_0x1f0f56,function(_0x174357){return Number(_0x174357['UserId']);});return db['UserVoicePrefix'][_0x8ba3('0x53')]({'where':{'UserId':{'$in':_0x1f9392},'VoicePrefixId':_0x30a0c5},'transaction':_0x54b005});});})[_0x8ba3('0x41')](function(){return db[_0x8ba3('0x2c')]['destroy']({'where':{'id':_0xd7bb77},'cascade':!![],'transaction':_0x54b005});})[_0x8ba3('0x41')](function(_0xab2b6e){if(_0xab2b6e===0x0){_0x13e8bf[_0x8ba3('0x25')](0x194);}else{return db[_0x8ba3('0x52')][_0x8ba3('0x53')]({'where':{'type':'Teams','resourceId':_0xd7bb77},'cascade':!![],'transaction':_0x54b005})[_0x8ba3('0x41')](function(){_0x13e8bf[_0x8ba3('0x1e')](0xcc)[_0x8ba3('0x1f')]();});}})[_0x8ba3('0x48')](function(_0x17cc36){_0x13e8bf[_0x8ba3('0x1e')](0x1f4)['send'](_0x17cc36);});});};exports[_0x8ba3('0x5a')]=function(_0x348b1d,_0x105cc2,_0x1e0f6a){return db[_0x8ba3('0x2c')]['findOne']({'where':{'id':_0x348b1d[_0x8ba3('0x45')]['id']}})[_0x8ba3('0x41')](handleEntityNotFound(_0x105cc2,null))[_0x8ba3('0x41')](function(_0x51c508){if(!_0x348b1d[_0x8ba3('0x31')][_0x8ba3('0x5b')]||!utils['isValidChannel'](_0x348b1d[_0x8ba3('0x31')][_0x8ba3('0x5b')])){throw new db[(_0x8ba3('0x5c'))]['ValidationError'](_0x8ba3('0x5d'));}var _0x2dc74b={};var _0x28856a={};_0x28856a[_0x8ba3('0x30')]=_['keys'](db[_[_0x8ba3('0x5e')](_0x348b1d[_0x8ba3('0x31')][_0x8ba3('0x5b')][_0x8ba3('0x5f')]())+_0x8ba3('0x60')][_0x8ba3('0x61')]);_0x28856a['query']=_[_0x8ba3('0x32')](_0x348b1d['query']);_0x28856a[_0x8ba3('0x3b')]=_[_0x8ba3('0x33')](_0x28856a[_0x8ba3('0x30')],_0x28856a[_0x8ba3('0x31')]);_0x2dc74b['attributes']=_[_0x8ba3('0x33')](_0x28856a[_0x8ba3('0x30')],qs[_0x8ba3('0x35')](_0x348b1d[_0x8ba3('0x31')]['fields']));_0x2dc74b['attributes']=_0x2dc74b['attributes'][_0x8ba3('0x36')]?_0x2dc74b['attributes']:_0x28856a['model'];_0x2dc74b[_0x8ba3('0x20')]=qs[_0x8ba3('0x20')](_0x348b1d['query']['limit']);_0x2dc74b['offset']=qs['offset'](_0x348b1d[_0x8ba3('0x31')][_0x8ba3('0x21')]);_0x2dc74b[_0x8ba3('0x38')]=qs[_0x8ba3('0x39')](_0x348b1d[_0x8ba3('0x31')][_0x8ba3('0x39')]);_0x2dc74b[_0x8ba3('0x3a')]=qs[_0x8ba3('0x3b')](_['pick'](_0x348b1d[_0x8ba3('0x31')],_0x28856a[_0x8ba3('0x3b')]));_0x2dc74b=_[_0x8ba3('0x3d')]({},_0x2dc74b,_0x348b1d[_0x8ba3('0x46')]);return _0x51c508[_0x8ba3('0x4b')+_[_0x8ba3('0x5e')](_0x348b1d[_0x8ba3('0x31')]['channel'][_0x8ba3('0x5f')]())+_0x8ba3('0x62')](_0x2dc74b);})['then'](respondWithResult(_0x105cc2,null))[_0x8ba3('0x48')](handleError(_0x105cc2,null));};exports[_0x8ba3('0x63')]=function(_0x109b08,_0x1d38c4,_0x3ff7c7){return db[_0x8ba3('0x2c')]['findOne']({'where':{'id':_0x109b08[_0x8ba3('0x45')]['id']}})['then'](function(_0x2a8e9f){if(_0x2a8e9f){if(!_0x109b08['body']['channel']||!utils[_0x8ba3('0x64')](_0x109b08[_0x8ba3('0x4a')][_0x8ba3('0x5b')])){throw new db[(_0x8ba3('0x5c'))][(_0x8ba3('0x65'))](_0x8ba3('0x5d'));}return _0x2a8e9f[_0x8ba3('0x66')+_[_0x8ba3('0x5e')](_0x109b08[_0x8ba3('0x4a')][_0x8ba3('0x5b')]['toLowerCase']())+_0x8ba3('0x62')](_0x109b08[_0x8ba3('0x4a')][_0x8ba3('0x67')]);}return null;})[_0x8ba3('0x41')](handleEntityNotFound(_0x1d38c4,null))['then'](respondWithStatusCode(_0x1d38c4,null))['catch'](handleError(_0x1d38c4,null));};exports[_0x8ba3('0x68')]=function(_0x50b2d8,_0x4b322c,_0x1a05f7){return db[_0x8ba3('0x2c')][_0x8ba3('0x69')]({'where':{'id':_0x50b2d8[_0x8ba3('0x45')]['id']}})[_0x8ba3('0x41')](function(_0x133b53){if(_0x133b53){if(!_0x50b2d8[_0x8ba3('0x31')][_0x8ba3('0x5b')]||!utils['isValidChannel'](_0x50b2d8[_0x8ba3('0x31')][_0x8ba3('0x5b')])){throw new db['Sequelize'][(_0x8ba3('0x65'))](_0x8ba3('0x5d'));}return _0x133b53[_0x8ba3('0x6a')+_[_0x8ba3('0x5e')](_0x50b2d8[_0x8ba3('0x31')][_0x8ba3('0x5b')][_0x8ba3('0x5f')]())+_0x8ba3('0x62')](_0x50b2d8[_0x8ba3('0x31')]['ids']);}return null;})['then'](handleEntityNotFound(_0x4b322c,null))[_0x8ba3('0x41')](respondWithStatusCode(_0x4b322c,null))['catch'](handleError(_0x4b322c,null));};exports[_0x8ba3('0x6b')]=function(_0x238ee8,_0xb87bf8){var _0xdb93a8=_[_0x8ba3('0x6c')](_0x238ee8[_0x8ba3('0x4a')][_0x8ba3('0x67')])?_0x238ee8[_0x8ba3('0x4a')][_0x8ba3('0x67')]:[_0x238ee8[_0x8ba3('0x4a')][_0x8ba3('0x67')]];var _0x3e6adf=_0x238ee8[_0x8ba3('0x45')]['id'];return db[_0x8ba3('0x2c')][_0x8ba3('0x47')]({'where':{'id':_0x3e6adf}})[_0x8ba3('0x41')](handleEntityNotFound(_0xb87bf8,null))[_0x8ba3('0x41')](function(_0x568024){if(_0x568024){var _0x25e90f=['Voice',_0x8ba3('0x6d'),_0x8ba3('0x6e'),_0x8ba3('0x6f'),_0x8ba3('0x70'),_0x8ba3('0x71'),_0x8ba3('0x72')];return db[_0x8ba3('0x54')][_0x8ba3('0x55')](function(_0x31ed6b){var _0x3e9a5f=_['map'](_0x25e90f,function(_0x5931f9){var _0x5bc7f1={'attributes':['id',_0x8ba3('0x28')]};if(_0x5931f9===_0x8ba3('0x73')){_0x5bc7f1[_0x8ba3('0x74')]={'attributes':[_0x8ba3('0x75')]};}return _0x568024[_0x8ba3('0x4b')+_0x5931f9+_0x8ba3('0x62')](_0x5bc7f1)[_0x8ba3('0x41')](function(_0x28c6da){var _0x5d6f70=_['map'](_0x28c6da,function(_0x345c93){var _0x13ac62=_[_0x8ba3('0x2b')](_0xdb93a8,function(_0x486b){var _0x250845={'where':{'UserId':_0x486b,[_0x5931f9+'QueueId']:_0x345c93['id']},'transaction':_0x31ed6b};if(_0x5931f9===_0x8ba3('0x73')){_0x250845[_0x8ba3('0x76')]={'penalty':_0x345c93[_0x8ba3('0x77')][_0x8ba3('0x75')]};}return db['User'+_0x5931f9+_0x8ba3('0x60')][_0x8ba3('0x78')](_0x250845)['then'](function(){socket['emit'](_0x8ba3('0x4e')+_0x5931f9+_0x8ba3('0x79'),{'UserId':_0x486b,[_0x5931f9+_0x8ba3('0x7a')]:_0x345c93['id']});if(_0x5931f9!==_0x8ba3('0x73')){return;}return db['User'][_0x8ba3('0x43')]({'where':{'id':_0xdb93a8,'online':0x1},'attributes':['id',_0x8ba3('0x28'),_0x8ba3('0x7b'),'voicePause',_0x8ba3('0x7c')],'raw':!![]})[_0x8ba3('0x41')](function(_0x11b486){var _0x2d4162=_['map'](_0x11b486,function(_0x47b10){return db['UserVoiceQueueRt']['upsert']({'membername':_0x47b10['name'],'UserId':_0x47b10['id'],'queue_name':_0x345c93[_0x8ba3('0x28')],'VoiceQueueId':_0x345c93['id'],'interface':_[_0x8ba3('0x7d')](_0x47b10[_0x8ba3('0x7c')])?util[_0x8ba3('0x7e')]('SIP/%s',_0x47b10[_0x8ba3('0x28')]):_0x47b10[_0x8ba3('0x7c')],'paused':_0x47b10['voicePause']||![],'penalty':_0x345c93[_0x8ba3('0x77')][_0x8ba3('0x75')]},{'transaction':_0x31ed6b});});return Promise[_0x8ba3('0x7f')](_0x2d4162);});});});return Promise[_0x8ba3('0x7f')](_0x13ac62);});return Promise[_0x8ba3('0x7f')](_0x5d6f70);})['then'](function(){return db[_0x8ba3('0x56')][_0x8ba3('0x69')]({'where':{'teamId':_0x3e6adf}})[_0x8ba3('0x41')](function(_0x58d3f9){if(_0x58d3f9){var _0x17b840=_[_0x8ba3('0x2b')](_0xdb93a8,function(_0x40b483){db['UserVoicePrefix'][_0x8ba3('0x80')]({'UserId':_0x40b483,'VoicePrefixId':_0x58d3f9[_0x8ba3('0x57')]});});return Promise['all'](_0x17b840);}});});});return Promise[_0x8ba3('0x7f')](_0x3e9a5f)[_0x8ba3('0x41')](function(){return _0x568024[_0x8ba3('0x6b')](_0xdb93a8,{'transaction':_0x31ed6b})[_0x8ba3('0x81')](function(_0x3aa395){return _0x3aa395;});});});}})[_0x8ba3('0x41')](respondWithResult(_0xb87bf8,null))['catch'](handleError(_0xb87bf8,null));};exports[_0x8ba3('0x82')]=function(_0x260628,_0x536624){var _0x3d0d73=_[_0x8ba3('0x6c')](_0x260628[_0x8ba3('0x31')]['ids'])?_0x260628[_0x8ba3('0x31')][_0x8ba3('0x67')]:[_0x260628[_0x8ba3('0x31')][_0x8ba3('0x67')]];var _0x2c4eb4=_0x260628[_0x8ba3('0x45')]['id'];return db[_0x8ba3('0x2c')][_0x8ba3('0x47')]({'where':{'id':_0x2c4eb4}})[_0x8ba3('0x41')](handleEntityNotFound(_0x536624,null))[_0x8ba3('0x41')](function(_0xfd1c88){if(_0xfd1c88){var _0x25b12d=[_0x8ba3('0x73'),'Chat',_0x8ba3('0x6e'),_0x8ba3('0x6f'),_0x8ba3('0x70'),'Openchannel',_0x8ba3('0x72')];return db[_0x8ba3('0x54')][_0x8ba3('0x55')](function(_0x4de771){var _0x3cbf9f=_['map'](_0x25b12d,function(_0x42e7db){var _0x26c4c8={'attributes':['id',_0x8ba3('0x28')]};return _0xfd1c88[_0x8ba3('0x4b')+_0x42e7db+_0x8ba3('0x62')](_0x26c4c8)['then'](function(_0x1a2465){var _0x62d2de=_['map'](_0x1a2465,function(_0x183125){return _0x183125['removeAgents'](_0x3d0d73,{'transaction':_0x4de771})[_0x8ba3('0x41')](function(){var _0x5a9e4d=_[_0x8ba3('0x2b')](_0x3d0d73,function(_0x406c31){socket[_0x8ba3('0x83')]('user'+_0x42e7db+_0x8ba3('0x84'),{'UserId':Number(_0x406c31),[_0x42e7db+'QueueId']:_0x183125['id']});if(_0x42e7db!==_0x8ba3('0x73')){return;}return db[_0x8ba3('0x85')][_0x8ba3('0x53')]({'where':{'VoiceQueueId':_0x183125['id'],'UserId':_0x406c31},'transaction':_0x4de771});});return Promise['all'](_0x5a9e4d);});});return Promise[_0x8ba3('0x7f')](_0x62d2de);});});return Promise[_0x8ba3('0x7f')](_0x3cbf9f)[_0x8ba3('0x41')](function(){return _0xfd1c88[_0x8ba3('0x82')](_0x3d0d73,{'transaction':_0x4de771});})[_0x8ba3('0x41')](function(){return db['TeamVoicePrefix'][_0x8ba3('0x69')]({'where':{'teamId':_0x2c4eb4}})[_0x8ba3('0x41')](function(_0x6df568){if(_0x6df568){var _0x3e28af=_[_0x8ba3('0x2b')](_0x3d0d73,function(_0x182310){db[_0x8ba3('0x86')][_0x8ba3('0x53')]({'where':{'UserId':_0x182310,'VoicePrefixId':_0x6df568[_0x8ba3('0x57')]}});});return Promise['all'](_0x3e28af);}});});});}})[_0x8ba3('0x41')](respondWithStatusCode(_0x536624,null))[_0x8ba3('0x48')](handleError(_0x536624,null));};exports[_0x8ba3('0x87')]=function(_0x31629a,_0x325140,_0x5381b2){var _0x1bf64a={};var _0x7f522d={};var _0x2ff297;var _0x47a0be;return db[_0x8ba3('0x2c')][_0x8ba3('0x69')]({'where':{'id':_0x31629a[_0x8ba3('0x45')]['id']}})['then'](handleEntityNotFound(_0x325140,null))['then'](function(_0x5bd6c7){if(_0x5bd6c7){_0x2ff297=_0x5bd6c7;_0x7f522d['model']=_[_0x8ba3('0x32')](db[_0x8ba3('0x88')][_0x8ba3('0x61')]);_0x7f522d[_0x8ba3('0x31')]=_[_0x8ba3('0x32')](_0x31629a[_0x8ba3('0x31')]);_0x7f522d[_0x8ba3('0x3b')]=_[_0x8ba3('0x33')](_0x7f522d[_0x8ba3('0x30')],_0x7f522d['query']);_0x1bf64a[_0x8ba3('0x34')]=_[_0x8ba3('0x33')](_0x7f522d[_0x8ba3('0x30')],qs[_0x8ba3('0x35')](_0x31629a[_0x8ba3('0x31')]['fields']));_0x1bf64a[_0x8ba3('0x34')]=_0x1bf64a[_0x8ba3('0x34')][_0x8ba3('0x36')]?_0x1bf64a[_0x8ba3('0x34')]:_0x7f522d[_0x8ba3('0x30')];_0x1bf64a[_0x8ba3('0x38')]=qs[_0x8ba3('0x39')](_0x31629a[_0x8ba3('0x31')][_0x8ba3('0x39')]);_0x1bf64a[_0x8ba3('0x3a')]=qs[_0x8ba3('0x3b')](_['pick'](_0x31629a[_0x8ba3('0x31')],_0x7f522d[_0x8ba3('0x3b')]));if(_0x31629a[_0x8ba3('0x31')][_0x8ba3('0x3f')]){_0x1bf64a[_0x8ba3('0x3a')]=_[_0x8ba3('0x3d')](_0x1bf64a[_0x8ba3('0x3a')],{'$or':_['map'](_0x1bf64a['attributes'],function(_0x3a1257){var _0x179345={};_0x179345[_0x3a1257]={'$like':'%'+_0x31629a['query'][_0x8ba3('0x3f')]+'%'};return _0x179345;})});}_0x1bf64a=_['merge']({},_0x1bf64a,_0x31629a[_0x8ba3('0x46')]);return _0x2ff297[_0x8ba3('0x87')](_0x1bf64a);}})[_0x8ba3('0x41')](function(_0x533f2d){if(_0x533f2d){_0x47a0be=_0x533f2d[_0x8ba3('0x36')];if(!_0x31629a[_0x8ba3('0x31')]['hasOwnProperty'](_0x8ba3('0x89'))){_0x1bf64a[_0x8ba3('0x20')]=qs[_0x8ba3('0x20')](_0x31629a[_0x8ba3('0x31')][_0x8ba3('0x20')]);_0x1bf64a['offset']=qs['offset'](_0x31629a[_0x8ba3('0x31')][_0x8ba3('0x21')]);}return _0x2ff297['getAgents'](_0x1bf64a);}})[_0x8ba3('0x41')](function(_0x29d3ec){if(_0x29d3ec){return _0x29d3ec?{'count':_0x47a0be,'rows':_0x29d3ec}:null;}})[_0x8ba3('0x41')](respondWithResult(_0x325140,null))[_0x8ba3('0x48')](handleError(_0x325140,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index 6f12d70..889f846 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 _0x3fd5=['emit','hook','exports','../../mysqldb','Team','setMaxListeners','save','remove'];(function(_0x25806f,_0x16dbdd){var _0x163f12=function(_0x3d1990){while(--_0x3d1990){_0x25806f['push'](_0x25806f['shift']());}};_0x163f12(++_0x16dbdd);}(_0x3fd5,0x143));var _0x53fd=function(_0x147e91,_0x17aae8){_0x147e91=_0x147e91-0x0;var _0x3a2e14=_0x3fd5[_0x147e91];return _0x3a2e14;};'use strict';var EventEmitter=require('events');var Team=require(_0x53fd('0x0'))['db'][_0x53fd('0x1')];var TeamEvents=new EventEmitter();TeamEvents[_0x53fd('0x2')](0x0);var events={'afterCreate':_0x53fd('0x3'),'afterUpdate':'update','afterDestroy':_0x53fd('0x4')};function emitEvent(_0x58e978){return function(_0x209cff,_0x12ac9f,_0x147063){TeamEvents['emit'](_0x58e978+':'+_0x209cff['id'],_0x209cff);TeamEvents[_0x53fd('0x5')](_0x58e978,_0x209cff);_0x147063(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Team[_0x53fd('0x6')](e,emitEvent(event));}}module[_0x53fd('0x7')]=TeamEvents; \ No newline at end of file +var _0xf9c2=['events','Team','setMaxListeners','remove','hook','exports'];(function(_0x15eeef,_0xf55dfc){var _0x17c0ca=function(_0x4d55f0){while(--_0x4d55f0){_0x15eeef['push'](_0x15eeef['shift']());}};_0x17c0ca(++_0xf55dfc);}(_0xf9c2,0x1ce));var _0x2f9c=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xf9c2[_0x321bb2];return _0x9c12ed;};'use strict';var EventEmitter=require(_0x2f9c('0x0'));var Team=require('../../mysqldb')['db'][_0x2f9c('0x1')];var TeamEvents=new EventEmitter();TeamEvents[_0x2f9c('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x2f9c('0x3')};function emitEvent(_0x1ca136){return function(_0x193469,_0x4dd385,_0x18f44d){TeamEvents['emit'](_0x1ca136+':'+_0x193469['id'],_0x193469);TeamEvents['emit'](_0x1ca136,_0x193469);_0x18f44d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Team[_0x2f9c('0x4')](e,emitEvent(event));}}module[_0x2f9c('0x5')]=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index d6d6285..d516763 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 _0x1d60=['Team','teams','lodash','util','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./team.attributes','exports','define'];(function(_0xd62e7a,_0xac4f19){var _0x1bf0c8=function(_0x5f6f96){while(--_0x5f6f96){_0xd62e7a['push'](_0xd62e7a['shift']());}};_0x1bf0c8(++_0xac4f19);}(_0x1d60,0x106));var _0x01d6=function(_0x58fd90,_0x21358b){_0x58fd90=_0x58fd90-0x0;var _0x1542d4=_0x1d60[_0x58fd90];return _0x1542d4;};'use strict';var _=require(_0x01d6('0x0'));var util=require(_0x01d6('0x1'));var logger=require(_0x01d6('0x2'))('api');var moment=require(_0x01d6('0x3'));var BPromise=require('bluebird');var rp=require(_0x01d6('0x4'));var fs=require('fs');var path=require(_0x01d6('0x5'));var rimraf=require(_0x01d6('0x6'));var config=require(_0x01d6('0x7'));var attributes=require(_0x01d6('0x8'));module[_0x01d6('0x9')]=function(_0x562d26,_0x7d0c10){return _0x562d26[_0x01d6('0xa')](_0x01d6('0xb'),attributes,{'tableName':_0x01d6('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3369=['define','Team','teams','lodash','util','../../config/logger','moment','bluebird','request-promise','path','./team.attributes','exports'];(function(_0x11fda4,_0x465374){var _0x188e31=function(_0x50e774){while(--_0x50e774){_0x11fda4['push'](_0x11fda4['shift']());}};_0x188e31(++_0x465374);}(_0x3369,0x1ef));var _0x9336=function(_0x128056,_0x4f314b){_0x128056=_0x128056-0x0;var _0x47da14=_0x3369[_0x128056];return _0x47da14;};'use strict';var _=require(_0x9336('0x0'));var util=require(_0x9336('0x1'));var logger=require(_0x9336('0x2'))('api');var moment=require(_0x9336('0x3'));var BPromise=require(_0x9336('0x4'));var rp=require(_0x9336('0x5'));var fs=require('fs');var path=require(_0x9336('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x9336('0x7'));module[_0x9336('0x8')]=function(_0x52f171,_0x17caae){return _0x52f171[_0x9336('0x9')](_0x9336('0xa'),attributes,{'tableName':_0x9336('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/team/team.rpc.js b/server/api/team/team.rpc.js index a6fe249..5f801df 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 _0x9738=['redis','localhost','./team.socket','register','request','then','info','Team,\x20%s,\x20%s','request\x20sent','Team,\x20%s,\x20%s,\x20%s','stringify','error','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http'];(function(_0x307101,_0x45fd0a){var _0x5d4775=function(_0x5864ff){while(--_0x5864ff){_0x307101['push'](_0x307101['shift']());}};_0x5d4775(++_0x45fd0a);}(_0x9738,0x75));var _0x8973=function(_0x5bfdbb,_0x7c3752){_0x5bfdbb=_0x5bfdbb-0x0;var _0x5a62b6=_0x9738[_0x5bfdbb];return _0x5a62b6;};'use strict';var _=require(_0x8973('0x0'));var util=require(_0x8973('0x1'));var moment=require(_0x8973('0x2'));var BPromise=require(_0x8973('0x3'));var rs=require(_0x8973('0x4'));var fs=require('fs');var Redis=require(_0x8973('0x5'));var db=require(_0x8973('0x6'))['db'];var utils=require(_0x8973('0x7'));var logger=require(_0x8973('0x8'))(_0x8973('0x9'));var config=require('../../config/environment');var jayson=require(_0x8973('0xa'));var client=jayson[_0x8973('0xb')][_0x8973('0xc')]({'port':0x232a});config[_0x8973('0xd')]=_['defaults'](config[_0x8973('0xd')],{'host':_0x8973('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x8973('0xf'))[_0x8973('0x10')](socket);function respondWithRpcPromise(_0x106425,_0x2bc43f,_0x1a3f9d){return new BPromise(function(_0x481cee,_0xf1f545){return client[_0x8973('0x11')](_0x106425,_0x1a3f9d)[_0x8973('0x12')](function(_0x4dd5c8){logger[_0x8973('0x13')](_0x8973('0x14'),_0x2bc43f,_0x8973('0x15'));logger['debug'](_0x8973('0x16'),_0x2bc43f,'request\x20sent',JSON[_0x8973('0x17')](_0x4dd5c8));if(_0x4dd5c8[_0x8973('0x18')]){if(_0x4dd5c8[_0x8973('0x18')]['code']===0x1f4){logger['error']('Team,\x20%s,\x20%s',_0x2bc43f,_0x4dd5c8[_0x8973('0x18')][_0x8973('0x19')]);return _0xf1f545(_0x4dd5c8['error'][_0x8973('0x19')]);}logger[_0x8973('0x18')](_0x8973('0x14'),_0x2bc43f,_0x4dd5c8[_0x8973('0x18')][_0x8973('0x19')]);return _0x481cee(_0x4dd5c8['error'][_0x8973('0x19')]);}else{logger['info']('Team,\x20%s,\x20%s',_0x2bc43f,_0x8973('0x15'));_0x481cee(_0x4dd5c8['result'][_0x8973('0x19')]);}})['catch'](function(_0x4beed0){logger[_0x8973('0x18')](_0x8973('0x14'),_0x2bc43f,_0x4beed0);_0xf1f545(_0x4beed0);});});} \ No newline at end of file +var _0xe6e3=['request\x20sent','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','./team.socket','request','then','info','Team,\x20%s,\x20%s','debug','Team,\x20%s,\x20%s,\x20%s'];(function(_0x38d18a,_0x5d53df){var _0x58e1e5=function(_0x2769fa){while(--_0x2769fa){_0x38d18a['push'](_0x38d18a['shift']());}};_0x58e1e5(++_0x5d53df);}(_0xe6e3,0x72));var _0x3e6e=function(_0x3e8930,_0x154364){_0x3e8930=_0x3e8930-0x0;var _0x15b38f=_0xe6e3[_0x3e8930];return _0x15b38f;};'use strict';var _=require(_0x3e6e('0x0'));var util=require('util');var moment=require(_0x3e6e('0x1'));var BPromise=require(_0x3e6e('0x2'));var rs=require(_0x3e6e('0x3'));var fs=require('fs');var Redis=require(_0x3e6e('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x3e6e('0x5'));var logger=require(_0x3e6e('0x6'))(_0x3e6e('0x7'));var config=require(_0x3e6e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x3e6e('0x9')][_0x3e6e('0xa')]({'port':0x232a});config[_0x3e6e('0xb')]=_[_0x3e6e('0xc')](config[_0x3e6e('0xb')],{'host':_0x3e6e('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3e6e('0xb')]));require(_0x3e6e('0xe'))['register'](socket);function respondWithRpcPromise(_0x22e286,_0x2d5f09,_0x2054de){return new BPromise(function(_0x103c62,_0x59e7fa){return client[_0x3e6e('0xf')](_0x22e286,_0x2054de)[_0x3e6e('0x10')](function(_0x316e42){logger[_0x3e6e('0x11')](_0x3e6e('0x12'),_0x2d5f09,'request\x20sent');logger[_0x3e6e('0x13')](_0x3e6e('0x14'),_0x2d5f09,_0x3e6e('0x15'),JSON['stringify'](_0x316e42));if(_0x316e42[_0x3e6e('0x16')]){if(_0x316e42['error'][_0x3e6e('0x17')]===0x1f4){logger[_0x3e6e('0x16')]('Team,\x20%s,\x20%s',_0x2d5f09,_0x316e42['error'][_0x3e6e('0x18')]);return _0x59e7fa(_0x316e42[_0x3e6e('0x16')][_0x3e6e('0x18')]);}logger[_0x3e6e('0x16')](_0x3e6e('0x12'),_0x2d5f09,_0x316e42['error']['message']);return _0x103c62(_0x316e42[_0x3e6e('0x16')][_0x3e6e('0x18')]);}else{logger['info'](_0x3e6e('0x12'),_0x2d5f09,_0x3e6e('0x15'));_0x103c62(_0x316e42[_0x3e6e('0x19')][_0x3e6e('0x18')]);}})[_0x3e6e('0x1a')](function(_0x4798f3){logger[_0x3e6e('0x16')]('Team,\x20%s,\x20%s',_0x2d5f09,_0x4798f3);_0x59e7fa(_0x4798f3);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index f7c3660..c61db40 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 _0x7b10=['emit','removeListener','length','team:','./team.events','save','remove','update'];(function(_0x5a6644,_0x45d612){var _0x3a2a5d=function(_0x54159e){while(--_0x54159e){_0x5a6644['push'](_0x5a6644['shift']());}};_0x3a2a5d(++_0x45d612);}(_0x7b10,0x1ac));var _0x07b1=function(_0x323460,_0x134f2b){_0x323460=_0x323460-0x0;var _0x3c540d=_0x7b10[_0x323460];return _0x3c540d;};'use strict';var TeamEvents=require(_0x07b1('0x0'));var events=[_0x07b1('0x1'),_0x07b1('0x2'),_0x07b1('0x3')];function createListener(_0x2493b7,_0x5711dc){return function(_0xbc25fb){_0x5711dc[_0x07b1('0x4')](_0x2493b7,_0xbc25fb);};}function removeListener(_0x7c39e7,_0x443b4f){return function(){TeamEvents[_0x07b1('0x5')](_0x7c39e7,_0x443b4f);};}exports['register']=function(_0x3cf5e4){for(var _0x106f8d=0x0,_0xece33d=events[_0x07b1('0x6')];_0x106f8d<_0xece33d;_0x106f8d++){var _0x1bfc1d=events[_0x106f8d];var _0x2bd721=createListener(_0x07b1('0x7')+_0x1bfc1d,_0x3cf5e4);TeamEvents['on'](_0x1bfc1d,_0x2bd721);}}; \ No newline at end of file +var _0x0419=['register','length','team:','remove','update','removeListener'];(function(_0x20ef64,_0x4a8fe9){var _0x3707d8=function(_0x5b9a88){while(--_0x5b9a88){_0x20ef64['push'](_0x20ef64['shift']());}};_0x3707d8(++_0x4a8fe9);}(_0x0419,0x153));var _0x9041=function(_0x3bae28,_0x5ca4f5){_0x3bae28=_0x3bae28-0x0;var _0xb431b=_0x0419[_0x3bae28];return _0xb431b;};'use strict';var TeamEvents=require('./team.events');var events=['save',_0x9041('0x0'),_0x9041('0x1')];function createListener(_0x381e11,_0x4e1e14){return function(_0x25ac9b){_0x4e1e14['emit'](_0x381e11,_0x25ac9b);};}function removeListener(_0x5063e4,_0x277249){return function(){TeamEvents[_0x9041('0x2')](_0x5063e4,_0x277249);};}exports[_0x9041('0x3')]=function(_0x1be327){for(var _0x570cdf=0x0,_0x118c44=events[_0x9041('0x4')];_0x570cdf<_0x118c44;_0x570cdf++){var _0x5457be=events[_0x570cdf];var _0x48ac45=createListener(_0x9041('0x5')+_0x5457be,_0x1be327);TeamEvents['on'](_0x5457be,_0x48ac45);}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js b/server/api/teamVoicePrefix/teamVoicePrefix.attributes.js index 1c17034..3e688ae 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 _0xb088=['sequelize','exports','INTEGER'];(function(_0x1542f1,_0x5dd8b0){var _0x1e54c6=function(_0x30b197){while(--_0x30b197){_0x1542f1['push'](_0x1542f1['shift']());}};_0x1e54c6(++_0x5dd8b0);}(_0xb088,0x7b));var _0x8b08=function(_0x8b1c66,_0x280022){_0x8b1c66=_0x8b1c66-0x0;var _0x4d73a2=_0xb088[_0x8b1c66];return _0x4d73a2;};'use strict';var Sequelize=require(_0x8b08('0x0'));module[_0x8b08('0x1')]={'TeamId':{'type':Sequelize[_0x8b08('0x2')]},'VoicePrefixId':{'type':Sequelize[_0x8b08('0x2')]}}; \ No newline at end of file +var _0xbca8=['sequelize','exports','INTEGER'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbca8,0xcc));var _0x8bca=function(_0xd5e8a4,_0x3d6078){_0xd5e8a4=_0xd5e8a4-0x0;var _0x5d9f55=_0xbca8[_0xd5e8a4];return _0x5d9f55;};'use strict';var Sequelize=require(_0x8bca('0x0'));module[_0x8bca('0x1')]={'TeamId':{'type':Sequelize[_0x8bca('0x2')]},'VoicePrefixId':{'type':Sequelize[_0x8bca('0x2')]}}; \ No newline at end of file diff --git a/server/api/teamVoicePrefix/teamVoicePrefix.model.js b/server/api/teamVoicePrefix/teamVoicePrefix.model.js index 215665c..f77c846 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 _0x7980=['../../config/environment','./teamVoicePrefix.attributes','define','TeamVoicePrefix','team_has_voice_prefixes','lodash','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x491608,_0x328619){var _0x1e4c05=function(_0x24bd8b){while(--_0x24bd8b){_0x491608['push'](_0x491608['shift']());}};_0x1e4c05(++_0x328619);}(_0x7980,0x123));var _0x0798=function(_0x50ffd4,_0x54eced){_0x50ffd4=_0x50ffd4-0x0;var _0x244f3f=_0x7980[_0x50ffd4];return _0x244f3f;};'use strict';var _=require(_0x0798('0x0'));var util=require(_0x0798('0x1'));var logger=require('../../config/logger')(_0x0798('0x2'));var moment=require(_0x0798('0x3'));var BPromise=require(_0x0798('0x4'));var rp=require(_0x0798('0x5'));var fs=require('fs');var path=require(_0x0798('0x6'));var rimraf=require(_0x0798('0x7'));var config=require(_0x0798('0x8'));var attributes=require(_0x0798('0x9'));module['exports']=function(_0x12ea59,_0x22a15f){return _0x12ea59[_0x0798('0xa')](_0x0798('0xb'),attributes,{'tableName':_0x0798('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x065e=['moment','bluebird','request-promise','../../config/environment','./teamVoicePrefix.attributes','define','team_has_voice_prefixes','lodash'];(function(_0x2d378e,_0x685d14){var _0x1f3ea5=function(_0x3780a9){while(--_0x3780a9){_0x2d378e['push'](_0x2d378e['shift']());}};_0x1f3ea5(++_0x685d14);}(_0x065e,0x1a7));var _0xe065=function(_0x5af93d,_0xa9ecba){_0x5af93d=_0x5af93d-0x0;var _0x16cc7e=_0x065e[_0x5af93d];return _0x16cc7e;};'use strict';var _=require(_0xe065('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xe065('0x1'));var BPromise=require(_0xe065('0x2'));var rp=require(_0xe065('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xe065('0x4'));var attributes=require(_0xe065('0x5'));module['exports']=function(_0x10b45f,_0x1e7e69){return _0x10b45f[_0xe065('0x6')]('TeamVoicePrefix',attributes,{'tableName':_0xe065('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/index.js b/server/api/teamVoiceQueue/index.js index 4675b10..8aa5ae6 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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x2f965f,_0x100aca){var _0x73f2b9=function(_0x25705d){while(--_0x25705d){_0x2f965f['push'](_0x2f965f['shift']());}};_0x73f2b9(++_0x100aca);}(_0x9c44,0x178));var _0x49c4=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x9c44[_0x8c43de];return _0xa6591b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file +var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x2577f2,_0x52a299){var _0x1b0666=function(_0x57b06c){while(--_0x57b06c){_0x2577f2['push'](_0x2577f2['shift']());}};_0x1b0666(++_0x52a299);}(_0xa9e0,0x123));var _0x0a9e=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0xa9e0[_0x54d4fe];return _0x1ab5bb;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js b/server/api/teamVoiceQueue/teamVoiceQueue.attributes.js index f734644..3d82279 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 _0xb524=['INTEGER','exports'];(function(_0x368bba,_0x1f625b){var _0x409f8f=function(_0x463373){while(--_0x463373){_0x368bba['push'](_0x368bba['shift']());}};_0x409f8f(++_0x1f625b);}(_0xb524,0xcd));var _0x4b52=function(_0x411365,_0xad8c71){_0x411365=_0x411365-0x0;var _0x3f3c29=_0xb524[_0x411365];return _0x3f3c29;};'use strict';var Sequelize=require('sequelize');module[_0x4b52('0x0')]={'penalty':{'type':Sequelize[_0x4b52('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x46b6=['INTEGER','sequelize'];(function(_0x1034bb,_0x4e20b3){var _0x453fdb=function(_0x455356){while(--_0x455356){_0x1034bb['push'](_0x1034bb['shift']());}};_0x453fdb(++_0x4e20b3);}(_0x46b6,0x1eb));var _0x646b=function(_0x1f6d36,_0x4ccab6){_0x1f6d36=_0x1f6d36-0x0;var _0x1df99e=_0x46b6[_0x1f6d36];return _0x1df99e;};'use strict';var Sequelize=require(_0x646b('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x646b('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/teamVoiceQueue/teamVoiceQueue.model.js b/server/api/teamVoiceQueue/teamVoiceQueue.model.js index 6e0950f..e9685a6 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 _0x2333=['../../config/environment','./teamVoiceQueue.attributes','exports','define','TeamVoiceQueue','team_has_voice_queues','lodash','util','moment','bluebird','path','rimraf'];(function(_0x575c59,_0x69a429){var _0x1af0f1=function(_0x1f1d09){while(--_0x1f1d09){_0x575c59['push'](_0x575c59['shift']());}};_0x1af0f1(++_0x69a429);}(_0x2333,0x11a));var _0x3233=function(_0x338940,_0x17ce8a){_0x338940=_0x338940-0x0;var _0x3ca9a9=_0x2333[_0x338940];return _0x3ca9a9;};'use strict';var _=require(_0x3233('0x0'));var util=require(_0x3233('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x3233('0x2'));var BPromise=require(_0x3233('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3233('0x4'));var rimraf=require(_0x3233('0x5'));var config=require(_0x3233('0x6'));var attributes=require(_0x3233('0x7'));module[_0x3233('0x8')]=function(_0x31452c,_0x4120f6){return _0x31452c[_0x3233('0x9')](_0x3233('0xa'),attributes,{'tableName':_0x3233('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb205=['lodash','util','../../config/logger','api','moment','path','../../config/environment','./teamVoiceQueue.attributes','define','team_has_voice_queues'];(function(_0x4cb5fa,_0x5a23dd){var _0xfe7cd8=function(_0x5b6c88){while(--_0x5b6c88){_0x4cb5fa['push'](_0x4cb5fa['shift']());}};_0xfe7cd8(++_0x5a23dd);}(_0xb205,0xf0));var _0x5b20=function(_0xe90020,_0x232bcd){_0xe90020=_0xe90020-0x0;var _0x50ed82=_0xb205[_0xe90020];return _0x50ed82;};'use strict';var _=require(_0x5b20('0x0'));var util=require(_0x5b20('0x1'));var logger=require(_0x5b20('0x2'))(_0x5b20('0x3'));var moment=require(_0x5b20('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x5b20('0x5'));var rimraf=require('rimraf');var config=require(_0x5b20('0x6'));var attributes=require(_0x5b20('0x7'));module['exports']=function(_0x3206cd,_0x29d926){return _0x3206cd[_0x5b20('0x8')]('TeamVoiceQueue',attributes,{'tableName':_0x5b20('0x9'),'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 c65e05a..2c0de24 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 _0x7d19=['randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','TeamVoiceQueue,\x20%s,\x20%s','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','moment','bluebird'];(function(_0x2aa4e8,_0x2dafe5){var _0x251709=function(_0x203184){while(--_0x203184){_0x2aa4e8['push'](_0x2aa4e8['shift']());}};_0x251709(++_0x2dafe5);}(_0x7d19,0x9e));var _0x97d1=function(_0xa0ab99,_0x5496c1){_0xa0ab99=_0xa0ab99-0x0;var _0x3bf6b5=_0x7d19[_0xa0ab99];return _0x3bf6b5;};'use strict';var _=require(_0x97d1('0x0'));var util=require('util');var moment=require(_0x97d1('0x1'));var BPromise=require(_0x97d1('0x2'));var rs=require(_0x97d1('0x3'));var fs=require('fs');var Redis=require(_0x97d1('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x97d1('0x5'));var logger=require(_0x97d1('0x6'))(_0x97d1('0x7'));var config=require(_0x97d1('0x8'));var jayson=require(_0x97d1('0x9'));var client=jayson[_0x97d1('0xa')][_0x97d1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3c26e0,_0x494a1e,_0x5236c6){return new BPromise(function(_0x58312a,_0x2f0b27){return client[_0x97d1('0xc')](_0x3c26e0,_0x5236c6)[_0x97d1('0xd')](function(_0x25ed01){logger[_0x97d1('0xe')](_0x97d1('0xf'),_0x494a1e,'request\x20sent');logger['debug'](_0x97d1('0x10'),_0x494a1e,_0x97d1('0x11'),JSON[_0x97d1('0x12')](_0x25ed01));if(_0x25ed01[_0x97d1('0x13')]){if(_0x25ed01[_0x97d1('0x13')][_0x97d1('0x14')]===0x1f4){logger['error'](_0x97d1('0xf'),_0x494a1e,_0x25ed01[_0x97d1('0x13')]['message']);return _0x2f0b27(_0x25ed01[_0x97d1('0x13')]['message']);}logger[_0x97d1('0x13')](_0x97d1('0xf'),_0x494a1e,_0x25ed01[_0x97d1('0x13')][_0x97d1('0x15')]);return _0x58312a(_0x25ed01[_0x97d1('0x13')][_0x97d1('0x15')]);}else{logger[_0x97d1('0xe')]('TeamVoiceQueue,\x20%s,\x20%s',_0x494a1e,_0x97d1('0x11'));_0x58312a(_0x25ed01['result'][_0x97d1('0x15')]);}})[_0x97d1('0x16')](function(_0x4b67be){logger[_0x97d1('0x13')]('TeamVoiceQueue,\x20%s,\x20%s',_0x494a1e,_0x4b67be);_0x2f0b27(_0x4b67be);});});} \ No newline at end of file +var _0x6ccc=['jayson/promise','TeamVoiceQueue,\x20%s,\x20%s','request\x20sent','TeamVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x28d18d,_0x55896b){var _0x470640=function(_0x57e78b){while(--_0x57e78b){_0x28d18d['push'](_0x28d18d['shift']());}};_0x470640(++_0x55896b);}(_0x6ccc,0x14d));var _0xc6cc=function(_0x17e75e,_0x24753e){_0x17e75e=_0x17e75e-0x0;var _0x25f451=_0x6ccc[_0x17e75e];return _0x25f451;};'use strict';var _=require(_0xc6cc('0x0'));var util=require(_0xc6cc('0x1'));var moment=require(_0xc6cc('0x2'));var BPromise=require(_0xc6cc('0x3'));var rs=require(_0xc6cc('0x4'));var fs=require('fs');var Redis=require(_0xc6cc('0x5'));var db=require(_0xc6cc('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xc6cc('0x7'))(_0xc6cc('0x8'));var config=require('../../config/environment');var jayson=require(_0xc6cc('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5a752d,_0xfb4d00,_0x393e8f){return new BPromise(function(_0x1afa5c,_0x2c7607){return client['request'](_0x5a752d,_0x393e8f)['then'](function(_0xe1b01b){logger['info'](_0xc6cc('0xa'),_0xfb4d00,_0xc6cc('0xb'));logger['debug'](_0xc6cc('0xc'),_0xfb4d00,_0xc6cc('0xb'),JSON[_0xc6cc('0xd')](_0xe1b01b));if(_0xe1b01b[_0xc6cc('0xe')]){if(_0xe1b01b[_0xc6cc('0xe')][_0xc6cc('0xf')]===0x1f4){logger[_0xc6cc('0xe')]('TeamVoiceQueue,\x20%s,\x20%s',_0xfb4d00,_0xe1b01b[_0xc6cc('0xe')][_0xc6cc('0x10')]);return _0x2c7607(_0xe1b01b['error']['message']);}logger['error'](_0xc6cc('0xa'),_0xfb4d00,_0xe1b01b[_0xc6cc('0xe')][_0xc6cc('0x10')]);return _0x1afa5c(_0xe1b01b[_0xc6cc('0xe')][_0xc6cc('0x10')]);}else{logger['info']('TeamVoiceQueue,\x20%s,\x20%s',_0xfb4d00,'request\x20sent');_0x1afa5c(_0xe1b01b[_0xc6cc('0x11')][_0xc6cc('0x10')]);}})[_0xc6cc('0x12')](function(_0x3f2994){logger[_0xc6cc('0xe')]('TeamVoiceQueue,\x20%s,\x20%s',_0xfb4d00,_0x3f2994);_0x2c7607(_0x3f2994);});});} \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index a0313e3..f14506d 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 _0xb78e=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./template.controller','isAuthenticated','index','get','/:id','show','post','create','put','update','delete','destroy','multer','util','connect-timeout','express','Router'];(function(_0x1d05c2,_0x1a6c2d){var _0x4766f5=function(_0xa0df0){while(--_0xa0df0){_0x1d05c2['push'](_0x1d05c2['shift']());}};_0x4766f5(++_0x1a6c2d);}(_0xb78e,0x1c9));var _0xeb78=function(_0x49df93,_0x524a6e){_0x49df93=_0x49df93-0x0;var _0x4c6eb3=_0xb78e[_0x49df93];return _0x4c6eb3;};'use strict';var multer=require(_0xeb78('0x0'));var util=require(_0xeb78('0x1'));var path=require('path');var timeout=require(_0xeb78('0x2'));var express=require(_0xeb78('0x3'));var router=express[_0xeb78('0x4')]();var fs_extra=require(_0xeb78('0x5'));var auth=require(_0xeb78('0x6'));var interaction=require(_0xeb78('0x7'));var config=require(_0xeb78('0x8'));var controller=require(_0xeb78('0x9'));router['get']('/',auth[_0xeb78('0xa')](),controller[_0xeb78('0xb')]);router[_0xeb78('0xc')](_0xeb78('0xd'),auth[_0xeb78('0xa')](),controller[_0xeb78('0xe')]);router[_0xeb78('0xf')]('/',auth['isAuthenticated'](),controller[_0xeb78('0x10')]);router[_0xeb78('0x11')](_0xeb78('0xd'),auth[_0xeb78('0xa')](),controller[_0xeb78('0x12')]);router[_0xeb78('0x13')](_0xeb78('0xd'),auth[_0xeb78('0xa')](),controller[_0xeb78('0x14')]);module['exports']=router; \ No newline at end of file +var _0x34bd=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','multer','connect-timeout'];(function(_0x546dbb,_0x1a6352){var _0x4f08d7=function(_0x1ec4ce){while(--_0x1ec4ce){_0x546dbb['push'](_0x546dbb['shift']());}};_0x4f08d7(++_0x1a6352);}(_0x34bd,0x1d2));var _0xd34b=function(_0x449842,_0x3d7507){_0x449842=_0x449842-0x0;var _0x99e21f=_0x34bd[_0x449842];return _0x99e21f;};'use strict';var multer=require(_0xd34b('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xd34b('0x1'));var express=require(_0xd34b('0x2'));var router=express[_0xd34b('0x3')]();var fs_extra=require(_0xd34b('0x4'));var auth=require(_0xd34b('0x5'));var interaction=require(_0xd34b('0x6'));var config=require(_0xd34b('0x7'));var controller=require('./template.controller');router[_0xd34b('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xd34b('0x9'),auth[_0xd34b('0xa')](),controller[_0xd34b('0xb')]);router[_0xd34b('0xc')]('/',auth[_0xd34b('0xa')](),controller[_0xd34b('0xd')]);router[_0xd34b('0xe')](_0xd34b('0x9'),auth[_0xd34b('0xa')](),controller[_0xd34b('0xf')]);router[_0xd34b('0x10')](_0xd34b('0x9'),auth['isAuthenticated'](),controller[_0xd34b('0x11')]);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 d2cf18c..624e6bd 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 _0xf45a=['TEXT','sequelize','exports','STRING'];(function(_0x13d529,_0x3ac403){var _0x163cad=function(_0x5bf2c6){while(--_0x5bf2c6){_0x13d529['push'](_0x13d529['shift']());}};_0x163cad(++_0x3ac403);}(_0xf45a,0x85));var _0xaf45=function(_0x44b24b,_0x20c709){_0x44b24b=_0x44b24b-0x0;var _0xe682c0=_0xf45a[_0x44b24b];return _0xe682c0;};'use strict';var Sequelize=require(_0xaf45('0x0'));module[_0xaf45('0x1')]={'name':{'type':Sequelize[_0xaf45('0x2')]},'description':{'type':Sequelize[_0xaf45('0x2')]},'html':{'type':Sequelize[_0xaf45('0x3')]}}; \ No newline at end of file +var _0xce9f=['TEXT','sequelize','STRING'];(function(_0x31b1d1,_0x34295f){var _0x1a1337=function(_0x48a541){while(--_0x48a541){_0x31b1d1['push'](_0x31b1d1['shift']());}};_0x1a1337(++_0x34295f);}(_0xce9f,0x6d));var _0xfce9=function(_0x1e8758,_0xf85141){_0x1e8758=_0x1e8758-0x0;var _0x5d6e6f=_0xce9f[_0x1e8758];return _0x5d6e6f;};'use strict';var Sequelize=require(_0xfce9('0x0'));module['exports']={'name':{'type':Sequelize[_0xfce9('0x1')]},'description':{'type':Sequelize['STRING']},'html':{'type':Sequelize[_0xfce9('0x2')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index 8cfd250..dd7e8e0 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 _0x6ea1=['map','rawAttributes','fieldName','type','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','filter','merge','options','Template','includeAll','findAll','catch','show','params','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','reject','update','destroy','then','get','Templates','error','stack','name','send','index'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x6ea1,0x121));var _0x16ea=function(_0x1d558a,_0x2b74aa){_0x1d558a=_0x1d558a-0x0;var _0x8936ff=_0x6ea1[_0x1d558a];return _0x8936ff;};'use strict';var emlformat=require(_0x16ea('0x0'));var rimraf=require(_0x16ea('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x16ea('0x2'));var rp=require('request-promise');var moment=require(_0x16ea('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x16ea('0x4'));var util=require(_0x16ea('0x5'));var path=require(_0x16ea('0x6'));var sox=require(_0x16ea('0x7'));var csv=require(_0x16ea('0x8'));var ejs=require(_0x16ea('0x9'));var fs=require('fs');var fs_extra=require(_0x16ea('0xa'));var _=require(_0x16ea('0xb'));var squel=require(_0x16ea('0xc'));var crypto=require('crypto');var jsforce=require(_0x16ea('0xd'));var deskjs=require(_0x16ea('0xe'));var toCsv=require(_0x16ea('0x8'));var querystring=require('querystring');var Papa=require(_0x16ea('0xf'));var Redis=require(_0x16ea('0x10'));var authService=require(_0x16ea('0x11'));var qs=require(_0x16ea('0x12'));var as=require(_0x16ea('0x13'));var hardwareService=require(_0x16ea('0x14'));var logger=require(_0x16ea('0x15'))(_0x16ea('0x16'));var utils=require(_0x16ea('0x17'));var config=require(_0x16ea('0x18'));var licenseUtil=require(_0x16ea('0x19'));var db=require(_0x16ea('0x1a'))['db'];function respondWithStatusCode(_0x3850e2,_0x440421){_0x440421=_0x440421||0xcc;return function(_0x15a809){if(_0x15a809){return _0x3850e2[_0x16ea('0x1b')](_0x440421);}return _0x3850e2[_0x16ea('0x1c')](_0x440421)[_0x16ea('0x1d')]();};}function respondWithResult(_0x19145f,_0x2479d0){_0x2479d0=_0x2479d0||0xc8;return function(_0x286fb5){if(_0x286fb5){return _0x19145f[_0x16ea('0x1c')](_0x2479d0)[_0x16ea('0x1e')](_0x286fb5);}};}function respondWithFilteredResult(_0x18d987,_0x1d8844){return function(_0x45ed75){if(_0x45ed75){var _0x52d39d=typeof _0x1d8844[_0x16ea('0x1f')]===_0x16ea('0x20')&&typeof _0x1d8844['limit']===_0x16ea('0x20');var _0x2181a9=_0x45ed75[_0x16ea('0x21')];var _0x4976bf=_0x52d39d?0x0:_0x1d8844['offset'];var _0x452b09=_0x52d39d?_0x45ed75[_0x16ea('0x21')]:_0x1d8844[_0x16ea('0x1f')]+_0x1d8844[_0x16ea('0x22')];var _0x4f108c;if(_0x452b09>=_0x2181a9){_0x452b09=_0x2181a9;_0x4f108c=0xc8;}else{_0x4f108c=0xce;}_0x18d987[_0x16ea('0x1c')](_0x4f108c);return _0x18d987[_0x16ea('0x23')]('Content-Range',_0x4976bf+'-'+_0x452b09+'/'+_0x2181a9)[_0x16ea('0x1e')](_0x45ed75);}return null;};}function patchUpdates(_0x9cd543){return function(_0x5b18b2){try{jsonpatch['apply'](_0x5b18b2,_0x9cd543,!![]);}catch(_0x51f31a){return BPromise[_0x16ea('0x24')](_0x51f31a);}return _0x5b18b2['save']();};}function saveUpdates(_0x4c7bf8,_0x252718){return function(_0x2011bc){if(_0x2011bc){return _0x2011bc[_0x16ea('0x25')](_0x4c7bf8)['then'](function(_0x5ee07e){return _0x5ee07e;});}return null;};}function removeEntity(_0xb5c0f8,_0x264666){return function(_0x6fd0c6){if(_0x6fd0c6){return _0x6fd0c6[_0x16ea('0x26')]()[_0x16ea('0x27')](function(){var _0x15ae18=_0x6fd0c6[_0x16ea('0x28')]({'plain':!![]});var _0x1d6466=_0x16ea('0x29');return db['UserProfileResource'][_0x16ea('0x26')]({'where':{'type':_0x1d6466,'resourceId':_0x15ae18['id']}})[_0x16ea('0x27')](function(){return _0x6fd0c6;});})[_0x16ea('0x27')](function(){_0xb5c0f8[_0x16ea('0x1c')](0xcc)[_0x16ea('0x1d')]();});}};}function handleEntityNotFound(_0xb1d708,_0x4a9b8c){return function(_0x2fbd52){if(!_0x2fbd52){_0xb1d708[_0x16ea('0x1b')](0x194);}return _0x2fbd52;};}function handleError(_0x7a1ee1,_0x100e40){_0x100e40=_0x100e40||0x1f4;return function(_0x2995ad){logger[_0x16ea('0x2a')](_0x2995ad[_0x16ea('0x2b')]);if(_0x2995ad[_0x16ea('0x2c')]){delete _0x2995ad[_0x16ea('0x2c')];}_0x7a1ee1[_0x16ea('0x1c')](_0x100e40)[_0x16ea('0x2d')](_0x2995ad);};}exports[_0x16ea('0x2e')]=function(_0x15ed8f,_0x3f3881){var _0x1c733a={},_0x4ff111={},_0x1a8a0d={'count':0x0,'rows':[]};var _0x195f20=_[_0x16ea('0x2f')](db['Template'][_0x16ea('0x30')],function(_0x4a59a2){return{'name':_0x4a59a2[_0x16ea('0x31')],'type':_0x4a59a2[_0x16ea('0x32')]['key']};});_0x4ff111[_0x16ea('0x33')]=_[_0x16ea('0x2f')](_0x195f20,'name');_0x4ff111['query']=_[_0x16ea('0x34')](_0x15ed8f[_0x16ea('0x35')]);_0x4ff111['filters']=_[_0x16ea('0x36')](_0x4ff111[_0x16ea('0x33')],_0x4ff111[_0x16ea('0x35')]);_0x1c733a[_0x16ea('0x37')]=_[_0x16ea('0x36')](_0x4ff111[_0x16ea('0x33')],qs[_0x16ea('0x38')](_0x15ed8f['query']['fields']));_0x1c733a[_0x16ea('0x37')]=_0x1c733a[_0x16ea('0x37')][_0x16ea('0x39')]?_0x1c733a[_0x16ea('0x37')]:_0x4ff111[_0x16ea('0x33')];if(!_0x15ed8f[_0x16ea('0x35')][_0x16ea('0x3a')]('nolimit')){_0x1c733a['limit']=qs[_0x16ea('0x22')](_0x15ed8f[_0x16ea('0x35')][_0x16ea('0x22')]);_0x1c733a[_0x16ea('0x1f')]=qs[_0x16ea('0x1f')](_0x15ed8f[_0x16ea('0x35')][_0x16ea('0x1f')]);}_0x1c733a[_0x16ea('0x3b')]=qs[_0x16ea('0x3c')](_0x15ed8f[_0x16ea('0x35')][_0x16ea('0x3c')]);_0x1c733a[_0x16ea('0x3d')]=qs[_0x16ea('0x3e')](_['pick'](_0x15ed8f[_0x16ea('0x35')],_0x4ff111[_0x16ea('0x3e')]),_0x195f20);if(_0x15ed8f[_0x16ea('0x35')][_0x16ea('0x3f')]){_0x1c733a[_0x16ea('0x3d')]=_['merge'](_0x1c733a[_0x16ea('0x3d')],{'$or':_['map'](_0x195f20,function(_0x78a8d3){if(_0x78a8d3[_0x16ea('0x32')]!=='VIRTUAL'){var _0xbe4891={};_0xbe4891[_0x78a8d3[_0x16ea('0x2c')]]={'$like':'%'+_0x15ed8f[_0x16ea('0x35')][_0x16ea('0x3f')]+'%'};return _0xbe4891;}})});}_0x1c733a=_[_0x16ea('0x40')]({},_0x1c733a,_0x15ed8f[_0x16ea('0x41')]);var _0x41f694={'where':_0x1c733a[_0x16ea('0x3d')]};return db[_0x16ea('0x42')][_0x16ea('0x21')](_0x41f694)[_0x16ea('0x27')](function(_0x47ddb0){_0x1a8a0d['count']=_0x47ddb0;if(_0x15ed8f[_0x16ea('0x35')][_0x16ea('0x43')]){_0x1c733a['include']=[{'all':!![]}];}return db[_0x16ea('0x42')][_0x16ea('0x44')](_0x1c733a);})[_0x16ea('0x27')](function(_0x2c4495){_0x1a8a0d['rows']=_0x2c4495;return _0x1a8a0d;})[_0x16ea('0x27')](respondWithFilteredResult(_0x3f3881,_0x1c733a))[_0x16ea('0x45')](handleError(_0x3f3881,null));};exports[_0x16ea('0x46')]=function(_0x2d0bc0,_0x396800){var _0x8e9e4={'raw':!![],'where':{'id':_0x2d0bc0[_0x16ea('0x47')]['id']}},_0x4ea8e2={};_0x4ea8e2['model']=_['keys'](db[_0x16ea('0x42')][_0x16ea('0x30')]);_0x4ea8e2[_0x16ea('0x35')]=_[_0x16ea('0x34')](_0x2d0bc0[_0x16ea('0x35')]);_0x4ea8e2['filters']=_['intersection'](_0x4ea8e2[_0x16ea('0x33')],_0x4ea8e2[_0x16ea('0x35')]);_0x8e9e4[_0x16ea('0x37')]=_['intersection'](_0x4ea8e2['model'],qs['fields'](_0x2d0bc0[_0x16ea('0x35')][_0x16ea('0x38')]));_0x8e9e4[_0x16ea('0x37')]=_0x8e9e4['attributes'][_0x16ea('0x39')]?_0x8e9e4[_0x16ea('0x37')]:_0x4ea8e2['model'];if(_0x2d0bc0[_0x16ea('0x35')][_0x16ea('0x43')]){_0x8e9e4[_0x16ea('0x48')]=[{'all':!![]}];}_0x8e9e4=_['merge']({},_0x8e9e4,_0x2d0bc0['options']);return db['Template']['find'](_0x8e9e4)[_0x16ea('0x27')](handleEntityNotFound(_0x396800,null))['then'](respondWithResult(_0x396800,null))[_0x16ea('0x45')](handleError(_0x396800,null));};exports[_0x16ea('0x49')]=function(_0x730203,_0x1e7d16){return db[_0x16ea('0x42')][_0x16ea('0x49')](_0x730203[_0x16ea('0x4a')],{})['then'](function(_0x3db447){var _0x432f6e=_0x730203[_0x16ea('0x4b')][_0x16ea('0x28')]({'plain':!![]});if(!_0x432f6e)throw new Error(_0x16ea('0x4c'));if(_0x432f6e[_0x16ea('0x4d')]===_0x16ea('0x4b')){var _0x142968=_0x3db447[_0x16ea('0x28')]({'plain':!![]});var _0x26daf8=_0x16ea('0x29');return db[_0x16ea('0x4e')][_0x16ea('0x4f')]({'where':{'name':_0x26daf8,'userProfileId':_0x432f6e[_0x16ea('0x50')]},'raw':!![]})[_0x16ea('0x27')](function(_0x596776){if(_0x596776&&_0x596776[_0x16ea('0x51')]===0x0){return db[_0x16ea('0x52')][_0x16ea('0x49')]({'name':_0x142968[_0x16ea('0x2c')],'resourceId':_0x142968['id'],'type':_0x596776[_0x16ea('0x2c')],'sectionId':_0x596776['id']},{})['then'](function(){return _0x3db447;});}else{return _0x3db447;}})[_0x16ea('0x45')](function(_0x1b5792){logger[_0x16ea('0x2a')](_0x16ea('0x53'),_0x1b5792);throw _0x1b5792;});}return _0x3db447;})['then'](respondWithResult(_0x1e7d16,0xc9))[_0x16ea('0x45')](handleError(_0x1e7d16,null));};exports[_0x16ea('0x25')]=function(_0x324db1,_0x2ee0b0){if(_0x324db1[_0x16ea('0x4a')]['id']){delete _0x324db1[_0x16ea('0x4a')]['id'];}return db['Template']['find']({'where':{'id':_0x324db1[_0x16ea('0x47')]['id']}})['then'](handleEntityNotFound(_0x2ee0b0,null))['then'](saveUpdates(_0x324db1[_0x16ea('0x4a')],null))[_0x16ea('0x27')](respondWithResult(_0x2ee0b0,null))[_0x16ea('0x45')](handleError(_0x2ee0b0,null));};exports[_0x16ea('0x26')]=function(_0x367d2a,_0x13d194){return db[_0x16ea('0x42')][_0x16ea('0x4f')]({'where':{'id':_0x367d2a['params']['id']}})['then'](handleEntityNotFound(_0x13d194,null))[_0x16ea('0x27')](removeEntity(_0x13d194,null))[_0x16ea('0x45')](handleError(_0x13d194,null));}; \ No newline at end of file +var _0x584b=['index','map','Template','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','limit','order','sort','where','filter','VIRTUAL','merge','options','count','include','findAll','rows','show','params','keys','length','includeAll','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','catch','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','to-csv','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','set','Content-Range','apply','save','Templates','UserProfileResource','then','error','stack','name','send'];(function(_0x21a3b0,_0x1b2689){var _0x4aa977=function(_0x2ff82a){while(--_0x2ff82a){_0x21a3b0['push'](_0x21a3b0['shift']());}};_0x4aa977(++_0x1b2689);}(_0x584b,0x119));var _0xb584=function(_0x1203f,_0x554bbc){_0x1203f=_0x1203f-0x0;var _0x365f0a=_0x584b[_0x1203f];return _0x365f0a;};'use strict';var emlformat=require(_0xb584('0x0'));var rimraf=require(_0xb584('0x1'));var zipdir=require(_0xb584('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb584('0x3'));var moment=require(_0xb584('0x4'));var BPromise=require(_0xb584('0x5'));var Mustache=require(_0xb584('0x6'));var util=require(_0xb584('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xb584('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb584('0x9'));var squel=require(_0xb584('0xa'));var crypto=require('crypto');var jsforce=require(_0xb584('0xb'));var deskjs=require(_0xb584('0xc'));var toCsv=require(_0xb584('0x8'));var querystring=require('querystring');var Papa=require(_0xb584('0xd'));var Redis=require(_0xb584('0xe'));var authService=require(_0xb584('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xb584('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xb584('0x11'));var utils=require(_0xb584('0x12'));var config=require(_0xb584('0x13'));var licenseUtil=require(_0xb584('0x14'));var db=require(_0xb584('0x15'))['db'];function respondWithStatusCode(_0x5c1c82,_0x5ae1b0){_0x5ae1b0=_0x5ae1b0||0xcc;return function(_0x541a74){if(_0x541a74){return _0x5c1c82[_0xb584('0x16')](_0x5ae1b0);}return _0x5c1c82[_0xb584('0x17')](_0x5ae1b0)[_0xb584('0x18')]();};}function respondWithResult(_0x119b05,_0x35e077){_0x35e077=_0x35e077||0xc8;return function(_0xe5771c){if(_0xe5771c){return _0x119b05['status'](_0x35e077)[_0xb584('0x19')](_0xe5771c);}};}function respondWithFilteredResult(_0x587352,_0xe5e815){return function(_0x584ac0){if(_0x584ac0){var _0x20f213=typeof _0xe5e815[_0xb584('0x1a')]===_0xb584('0x1b')&&typeof _0xe5e815['limit']===_0xb584('0x1b');var _0x367836=_0x584ac0['count'];var _0x3237c3=_0x20f213?0x0:_0xe5e815[_0xb584('0x1a')];var _0x5b660b=_0x20f213?_0x584ac0['count']:_0xe5e815[_0xb584('0x1a')]+_0xe5e815['limit'];var _0x59a10a;if(_0x5b660b>=_0x367836){_0x5b660b=_0x367836;_0x59a10a=0xc8;}else{_0x59a10a=0xce;}_0x587352[_0xb584('0x17')](_0x59a10a);return _0x587352[_0xb584('0x1c')](_0xb584('0x1d'),_0x3237c3+'-'+_0x5b660b+'/'+_0x367836)['json'](_0x584ac0);}return null;};}function patchUpdates(_0x316c72){return function(_0x3dbf18){try{jsonpatch[_0xb584('0x1e')](_0x3dbf18,_0x316c72,!![]);}catch(_0x4b08a2){return BPromise['reject'](_0x4b08a2);}return _0x3dbf18[_0xb584('0x1f')]();};}function saveUpdates(_0x3126e4,_0x4bbddb){return function(_0x3c25e4){if(_0x3c25e4){return _0x3c25e4['update'](_0x3126e4)['then'](function(_0x277c50){return _0x277c50;});}return null;};}function removeEntity(_0x328832,_0x2c9495){return function(_0x480793){if(_0x480793){return _0x480793['destroy']()['then'](function(){var _0x24ef0c=_0x480793['get']({'plain':!![]});var _0x4b2edf=_0xb584('0x20');return db[_0xb584('0x21')]['destroy']({'where':{'type':_0x4b2edf,'resourceId':_0x24ef0c['id']}})[_0xb584('0x22')](function(){return _0x480793;});})[_0xb584('0x22')](function(){_0x328832[_0xb584('0x17')](0xcc)[_0xb584('0x18')]();});}};}function handleEntityNotFound(_0x26bdd8,_0x41b18d){return function(_0x4ba56a){if(!_0x4ba56a){_0x26bdd8[_0xb584('0x16')](0x194);}return _0x4ba56a;};}function handleError(_0x17eb93,_0x1d40d3){_0x1d40d3=_0x1d40d3||0x1f4;return function(_0x470778){logger[_0xb584('0x23')](_0x470778[_0xb584('0x24')]);if(_0x470778[_0xb584('0x25')]){delete _0x470778[_0xb584('0x25')];}_0x17eb93['status'](_0x1d40d3)[_0xb584('0x26')](_0x470778);};}exports[_0xb584('0x27')]=function(_0x2b5269,_0x2a7224){var _0x1b6514={},_0xcc7eb8={},_0x2128c6={'count':0x0,'rows':[]};var _0xf61b9=_[_0xb584('0x28')](db[_0xb584('0x29')][_0xb584('0x2a')],function(_0xe5e309){return{'name':_0xe5e309[_0xb584('0x2b')],'type':_0xe5e309[_0xb584('0x2c')][_0xb584('0x2d')]};});_0xcc7eb8[_0xb584('0x2e')]=_[_0xb584('0x28')](_0xf61b9,'name');_0xcc7eb8[_0xb584('0x2f')]=_['keys'](_0x2b5269[_0xb584('0x2f')]);_0xcc7eb8[_0xb584('0x30')]=_[_0xb584('0x31')](_0xcc7eb8['model'],_0xcc7eb8['query']);_0x1b6514['attributes']=_[_0xb584('0x31')](_0xcc7eb8[_0xb584('0x2e')],qs[_0xb584('0x32')](_0x2b5269['query']['fields']));_0x1b6514[_0xb584('0x33')]=_0x1b6514[_0xb584('0x33')]['length']?_0x1b6514[_0xb584('0x33')]:_0xcc7eb8[_0xb584('0x2e')];if(!_0x2b5269[_0xb584('0x2f')][_0xb584('0x34')]('nolimit')){_0x1b6514['limit']=qs[_0xb584('0x35')](_0x2b5269[_0xb584('0x2f')][_0xb584('0x35')]);_0x1b6514[_0xb584('0x1a')]=qs[_0xb584('0x1a')](_0x2b5269[_0xb584('0x2f')][_0xb584('0x1a')]);}_0x1b6514[_0xb584('0x36')]=qs[_0xb584('0x37')](_0x2b5269[_0xb584('0x2f')]['sort']);_0x1b6514[_0xb584('0x38')]=qs[_0xb584('0x30')](_['pick'](_0x2b5269['query'],_0xcc7eb8[_0xb584('0x30')]),_0xf61b9);if(_0x2b5269[_0xb584('0x2f')][_0xb584('0x39')]){_0x1b6514[_0xb584('0x38')]=_['merge'](_0x1b6514[_0xb584('0x38')],{'$or':_[_0xb584('0x28')](_0xf61b9,function(_0x150ac7){if(_0x150ac7[_0xb584('0x2c')]!==_0xb584('0x3a')){var _0x515c47={};_0x515c47[_0x150ac7[_0xb584('0x25')]]={'$like':'%'+_0x2b5269[_0xb584('0x2f')][_0xb584('0x39')]+'%'};return _0x515c47;}})});}_0x1b6514=_[_0xb584('0x3b')]({},_0x1b6514,_0x2b5269[_0xb584('0x3c')]);var _0x58a1d0={'where':_0x1b6514[_0xb584('0x38')]};return db['Template'][_0xb584('0x3d')](_0x58a1d0)['then'](function(_0x133f2){_0x2128c6[_0xb584('0x3d')]=_0x133f2;if(_0x2b5269[_0xb584('0x2f')]['includeAll']){_0x1b6514[_0xb584('0x3e')]=[{'all':!![]}];}return db[_0xb584('0x29')][_0xb584('0x3f')](_0x1b6514);})[_0xb584('0x22')](function(_0xbf0163){_0x2128c6[_0xb584('0x40')]=_0xbf0163;return _0x2128c6;})[_0xb584('0x22')](respondWithFilteredResult(_0x2a7224,_0x1b6514))['catch'](handleError(_0x2a7224,null));};exports[_0xb584('0x41')]=function(_0xa2fcc9,_0x1a52f7){var _0x378db9={'raw':!![],'where':{'id':_0xa2fcc9[_0xb584('0x42')]['id']}},_0x3b84a9={};_0x3b84a9[_0xb584('0x2e')]=_[_0xb584('0x43')](db['Template'][_0xb584('0x2a')]);_0x3b84a9['query']=_[_0xb584('0x43')](_0xa2fcc9[_0xb584('0x2f')]);_0x3b84a9[_0xb584('0x30')]=_[_0xb584('0x31')](_0x3b84a9[_0xb584('0x2e')],_0x3b84a9['query']);_0x378db9[_0xb584('0x33')]=_[_0xb584('0x31')](_0x3b84a9[_0xb584('0x2e')],qs[_0xb584('0x32')](_0xa2fcc9[_0xb584('0x2f')]['fields']));_0x378db9[_0xb584('0x33')]=_0x378db9[_0xb584('0x33')][_0xb584('0x44')]?_0x378db9['attributes']:_0x3b84a9['model'];if(_0xa2fcc9[_0xb584('0x2f')][_0xb584('0x45')]){_0x378db9[_0xb584('0x3e')]=[{'all':!![]}];}_0x378db9=_[_0xb584('0x3b')]({},_0x378db9,_0xa2fcc9[_0xb584('0x3c')]);return db[_0xb584('0x29')][_0xb584('0x46')](_0x378db9)[_0xb584('0x22')](handleEntityNotFound(_0x1a52f7,null))['then'](respondWithResult(_0x1a52f7,null))['catch'](handleError(_0x1a52f7,null));};exports['create']=function(_0x1f9d74,_0x2de060){return db[_0xb584('0x29')][_0xb584('0x47')](_0x1f9d74[_0xb584('0x48')],{})[_0xb584('0x22')](function(_0x52c4fe){var _0x1d246d=_0x1f9d74['user'][_0xb584('0x49')]({'plain':!![]});if(!_0x1d246d)throw new Error(_0xb584('0x4a'));if(_0x1d246d['role']==='user'){var _0x29d8c1=_0x52c4fe['get']({'plain':!![]});var _0x25a306=_0xb584('0x20');return db['UserProfileSection'][_0xb584('0x46')]({'where':{'name':_0x25a306,'userProfileId':_0x1d246d[_0xb584('0x4b')]},'raw':!![]})[_0xb584('0x22')](function(_0x219248){if(_0x219248&&_0x219248[_0xb584('0x4c')]===0x0){return db[_0xb584('0x21')][_0xb584('0x47')]({'name':_0x29d8c1['name'],'resourceId':_0x29d8c1['id'],'type':_0x219248[_0xb584('0x25')],'sectionId':_0x219248['id']},{})[_0xb584('0x22')](function(){return _0x52c4fe;});}else{return _0x52c4fe;}})['catch'](function(_0x4bff90){logger[_0xb584('0x23')](_0xb584('0x4d'),_0x4bff90);throw _0x4bff90;});}return _0x52c4fe;})[_0xb584('0x22')](respondWithResult(_0x2de060,0xc9))['catch'](handleError(_0x2de060,null));};exports[_0xb584('0x4e')]=function(_0x5ab7f7,_0x503d39){if(_0x5ab7f7[_0xb584('0x48')]['id']){delete _0x5ab7f7[_0xb584('0x48')]['id'];}return db[_0xb584('0x29')]['find']({'where':{'id':_0x5ab7f7[_0xb584('0x42')]['id']}})['then'](handleEntityNotFound(_0x503d39,null))[_0xb584('0x22')](saveUpdates(_0x5ab7f7['body'],null))[_0xb584('0x22')](respondWithResult(_0x503d39,null))[_0xb584('0x4f')](handleError(_0x503d39,null));};exports['destroy']=function(_0x1ac8aa,_0x39a841){return db[_0xb584('0x29')][_0xb584('0x46')]({'where':{'id':_0x1ac8aa[_0xb584('0x42')]['id']}})[_0xb584('0x22')](handleEntityNotFound(_0x39a841,null))[_0xb584('0x22')](removeEntity(_0x39a841,null))[_0xb584('0x4f')](handleError(_0x39a841,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index 7238e7c..f48dd9a 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 _0xa84c=['path','rimraf','../../config/environment','./template.attributes','define','Template','tools_templates','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x43b89d,_0x30fcc2){var _0x54fdaf=function(_0x592a82){while(--_0x592a82){_0x43b89d['push'](_0x43b89d['shift']());}};_0x54fdaf(++_0x30fcc2);}(_0xa84c,0x1a7));var _0xca84=function(_0x385380,_0x1a8069){_0x385380=_0x385380-0x0;var _0x1cfcd3=_0xa84c[_0x385380];return _0x1cfcd3;};'use strict';var _=require(_0xca84('0x0'));var util=require('util');var logger=require(_0xca84('0x1'))(_0xca84('0x2'));var moment=require(_0xca84('0x3'));var BPromise=require(_0xca84('0x4'));var rp=require(_0xca84('0x5'));var fs=require('fs');var path=require(_0xca84('0x6'));var rimraf=require(_0xca84('0x7'));var config=require(_0xca84('0x8'));var attributes=require(_0xca84('0x9'));module['exports']=function(_0x31a197,_0xf6a360){return _0x31a197[_0xca84('0xa')](_0xca84('0xb'),attributes,{'tableName':_0xca84('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x52f3=['../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./template.attributes','exports','define','Template','tools_templates','lodash','util'];(function(_0x51c82c,_0x7cf8c8){var _0x305663=function(_0x2b51aa){while(--_0x2b51aa){_0x51c82c['push'](_0x51c82c['shift']());}};_0x305663(++_0x7cf8c8);}(_0x52f3,0x98));var _0x352f=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x52f3[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x352f('0x0'));var util=require(_0x352f('0x1'));var logger=require(_0x352f('0x2'))(_0x352f('0x3'));var moment=require(_0x352f('0x4'));var BPromise=require(_0x352f('0x5'));var rp=require(_0x352f('0x6'));var fs=require('fs');var path=require(_0x352f('0x7'));var rimraf=require('rimraf');var config=require(_0x352f('0x8'));var attributes=require(_0x352f('0x9'));module[_0x352f('0xa')]=function(_0xa45501,_0xc6bb9){return _0xa45501[_0x352f('0xb')](_0x352f('0xc'),attributes,{'tableName':_0x352f('0xd'),'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 db83d4f..3af9c6b 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 _0xdaa8=['client','request','then','Template,\x20%s,\x20%s','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetTemplate','Template','raw','options','attributes','include','model','map','lodash','util','moment','bluebird','../../config/environment','jayson/promise'];(function(_0x20afbf,_0x55041c){var _0x55dd65=function(_0x4481cb){while(--_0x4481cb){_0x20afbf['push'](_0x20afbf['shift']());}};_0x55dd65(++_0x55041c);}(_0xdaa8,0xe4));var _0x8daa=function(_0x5eac79,_0x417188){_0x5eac79=_0x5eac79-0x0;var _0x44088e=_0xdaa8[_0x5eac79];return _0x44088e;};'use strict';var _=require(_0x8daa('0x0'));var util=require(_0x8daa('0x1'));var moment=require(_0x8daa('0x2'));var BPromise=require(_0x8daa('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x8daa('0x4'));var jayson=require(_0x8daa('0x5'));var client=jayson[_0x8daa('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4e8116,_0x1f5a97,_0x48bf41){return new BPromise(function(_0x41de3e,_0x2df1a0){return client[_0x8daa('0x7')](_0x4e8116,_0x48bf41)[_0x8daa('0x8')](function(_0x207291){logger['info'](_0x8daa('0x9'),_0x1f5a97,_0x8daa('0xa'));logger[_0x8daa('0xb')](_0x8daa('0xc'),_0x1f5a97,_0x8daa('0xa'),JSON[_0x8daa('0xd')](_0x207291));if(_0x207291[_0x8daa('0xe')]){if(_0x207291[_0x8daa('0xe')][_0x8daa('0xf')]===0x1f4){logger[_0x8daa('0xe')](_0x8daa('0x9'),_0x1f5a97,_0x207291['error'][_0x8daa('0x10')]);return _0x2df1a0(_0x207291[_0x8daa('0xe')][_0x8daa('0x10')]);}logger['error'](_0x8daa('0x9'),_0x1f5a97,_0x207291['error'][_0x8daa('0x10')]);return _0x41de3e(_0x207291[_0x8daa('0xe')][_0x8daa('0x10')]);}else{logger['info'](_0x8daa('0x9'),_0x1f5a97,_0x8daa('0xa'));_0x41de3e(_0x207291['result']['message']);}})[_0x8daa('0x11')](function(_0x2fc822){logger[_0x8daa('0xe')](_0x8daa('0x9'),_0x1f5a97,_0x2fc822);_0x2df1a0(_0x2fc822);});});}exports[_0x8daa('0x12')]=function(_0x1bca53){var _0x87f873=this;return new Promise(function(_0x15ab40,_0x1304f0){return db[_0x8daa('0x13')]['findAll']({'raw':_0x1bca53['options']?_0x1bca53['options'][_0x8daa('0x14')]===undefined?!![]:![]:!![],'where':_0x1bca53[_0x8daa('0x15')]?_0x1bca53[_0x8daa('0x15')]['where']||null:null,'attributes':_0x1bca53[_0x8daa('0x15')]?_0x1bca53['options'][_0x8daa('0x16')]||null:null,'limit':_0x1bca53[_0x8daa('0x15')]?_0x1bca53[_0x8daa('0x15')]['limit']||null:null,'include':_0x1bca53[_0x8daa('0x15')]?_0x1bca53['options'][_0x8daa('0x17')]?_['map'](_0x1bca53['options'][_0x8daa('0x17')],function(_0x15a4be){return{'model':db[_0x15a4be[_0x8daa('0x18')]],'as':_0x15a4be['as'],'attributes':_0x15a4be['attributes'],'include':_0x15a4be[_0x8daa('0x17')]?_[_0x8daa('0x19')](_0x15a4be['include'],function(_0x35dbc1){return{'model':db[_0x35dbc1[_0x8daa('0x18')]],'as':_0x35dbc1['as'],'attributes':_0x35dbc1[_0x8daa('0x16')],'include':_0x35dbc1[_0x8daa('0x17')]?_[_0x8daa('0x19')](_0x35dbc1[_0x8daa('0x17')],function(_0x23c938){return{'model':db[_0x23c938['model']],'as':_0x23c938['as'],'attributes':_0x23c938[_0x8daa('0x16')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x41e96a){logger['info'](_0x8daa('0x12'),_0x1bca53);logger['debug'](_0x8daa('0x12'),_0x1bca53,JSON[_0x8daa('0xd')](_0x41e96a));_0x15ab40(_0x41e96a);})[_0x8daa('0x11')](function(_0x1981db){logger['error'](_0x8daa('0x12'),_0x1981db[_0x8daa('0x10')],_0x1bca53);_0x1304f0(_0x87f873[_0x8daa('0xe')](0x1f4,_0x1981db[_0x8daa('0x10')]));});});}; \ No newline at end of file +var _0x13b5=['message','catch','GetTemplate','Template','findAll','options','raw','attributes','include','map','model','stringify','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','error','code','Template,\x20%s,\x20%s'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x13b5,0x69));var _0x513b=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0x13b5[_0x36c5b0];return _0xf19333;};'use strict';var _=require('lodash');var util=require(_0x513b('0x0'));var moment=require('moment');var BPromise=require(_0x513b('0x1'));var rs=require(_0x513b('0x2'));var fs=require('fs');var Redis=require(_0x513b('0x3'));var db=require(_0x513b('0x4'))['db'];var utils=require(_0x513b('0x5'));var logger=require(_0x513b('0x6'))(_0x513b('0x7'));var config=require('../../config/environment');var jayson=require(_0x513b('0x8'));var client=jayson[_0x513b('0x9')][_0x513b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xd3932c,_0x37b9c4,_0x8a2dd6){return new BPromise(function(_0x109513,_0x16630d){return client['request'](_0xd3932c,_0x8a2dd6)[_0x513b('0xb')](function(_0x477973){logger[_0x513b('0xc')]('Template,\x20%s,\x20%s',_0x37b9c4,_0x513b('0xd'));logger[_0x513b('0xe')](_0x513b('0xf'),_0x37b9c4,_0x513b('0xd'),JSON['stringify'](_0x477973));if(_0x477973['error']){if(_0x477973[_0x513b('0x10')][_0x513b('0x11')]===0x1f4){logger[_0x513b('0x10')](_0x513b('0x12'),_0x37b9c4,_0x477973['error']['message']);return _0x16630d(_0x477973[_0x513b('0x10')][_0x513b('0x13')]);}logger[_0x513b('0x10')](_0x513b('0x12'),_0x37b9c4,_0x477973[_0x513b('0x10')][_0x513b('0x13')]);return _0x109513(_0x477973[_0x513b('0x10')][_0x513b('0x13')]);}else{logger[_0x513b('0xc')](_0x513b('0x12'),_0x37b9c4,'request\x20sent');_0x109513(_0x477973['result'][_0x513b('0x13')]);}})[_0x513b('0x14')](function(_0x2fe84b){logger[_0x513b('0x10')](_0x513b('0x12'),_0x37b9c4,_0x2fe84b);_0x16630d(_0x2fe84b);});});}exports[_0x513b('0x15')]=function(_0x28c4ba){var _0x3b46f4=this;return new Promise(function(_0x28398c,_0x4326af){return db[_0x513b('0x16')][_0x513b('0x17')]({'raw':_0x28c4ba[_0x513b('0x18')]?_0x28c4ba[_0x513b('0x18')][_0x513b('0x19')]===undefined?!![]:![]:!![],'where':_0x28c4ba[_0x513b('0x18')]?_0x28c4ba[_0x513b('0x18')]['where']||null:null,'attributes':_0x28c4ba[_0x513b('0x18')]?_0x28c4ba[_0x513b('0x18')][_0x513b('0x1a')]||null:null,'limit':_0x28c4ba[_0x513b('0x18')]?_0x28c4ba['options']['limit']||null:null,'include':_0x28c4ba[_0x513b('0x18')]?_0x28c4ba[_0x513b('0x18')][_0x513b('0x1b')]?_[_0x513b('0x1c')](_0x28c4ba['options'][_0x513b('0x1b')],function(_0x99e022){return{'model':db[_0x99e022[_0x513b('0x1d')]],'as':_0x99e022['as'],'attributes':_0x99e022[_0x513b('0x1a')],'include':_0x99e022[_0x513b('0x1b')]?_[_0x513b('0x1c')](_0x99e022[_0x513b('0x1b')],function(_0x249b36){return{'model':db[_0x249b36['model']],'as':_0x249b36['as'],'attributes':_0x249b36[_0x513b('0x1a')],'include':_0x249b36[_0x513b('0x1b')]?_[_0x513b('0x1c')](_0x249b36[_0x513b('0x1b')],function(_0x2f7e73){return{'model':db[_0x2f7e73['model']],'as':_0x2f7e73['as'],'attributes':_0x2f7e73[_0x513b('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2c1927){logger[_0x513b('0xc')]('GetTemplate',_0x28c4ba);logger[_0x513b('0xe')](_0x513b('0x15'),_0x28c4ba,JSON[_0x513b('0x1e')](_0x2c1927));_0x28398c(_0x2c1927);})['catch'](function(_0x1ae0be){logger[_0x513b('0x10')]('GetTemplate',_0x1ae0be[_0x513b('0x13')],_0x28c4ba);_0x4326af(_0x3b46f4[_0x513b('0x10')](0x1f4,_0x1ae0be[_0x513b('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index 118f1fd..66ce9cb 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 _0xafcb=['../../components/interaction/service','../../config/environment','./trigger.controller','isAuthenticated','index','get','/:id','show','/:id/all_conditions','getAllConditions','/:id/any_conditions','getAnyConditions','/:id/actions','getActions','create','post','addAction','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xafcb,0xb6));var _0xbafc=function(_0x1bf3fa,_0x3acffc){_0x1bf3fa=_0x1bf3fa-0x0;var _0x5df8a2=_0xafcb[_0x1bf3fa];return _0x5df8a2;};'use strict';var multer=require(_0xbafc('0x0'));var util=require(_0xbafc('0x1'));var path=require(_0xbafc('0x2'));var timeout=require(_0xbafc('0x3'));var express=require(_0xbafc('0x4'));var router=express[_0xbafc('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xbafc('0x6'));var interaction=require(_0xbafc('0x7'));var config=require(_0xbafc('0x8'));var controller=require(_0xbafc('0x9'));router['get']('/',auth[_0xbafc('0xa')](),controller[_0xbafc('0xb')]);router[_0xbafc('0xc')](_0xbafc('0xd'),auth['isAuthenticated'](),controller[_0xbafc('0xe')]);router[_0xbafc('0xc')](_0xbafc('0xf'),auth['isAuthenticated'](),controller[_0xbafc('0x10')]);router['get'](_0xbafc('0x11'),auth[_0xbafc('0xa')](),controller[_0xbafc('0x12')]);router[_0xbafc('0xc')](_0xbafc('0x13'),auth[_0xbafc('0xa')](),controller[_0xbafc('0x14')]);router['post']('/',auth[_0xbafc('0xa')](),controller[_0xbafc('0x15')]);router[_0xbafc('0x16')](_0xbafc('0xf'),auth[_0xbafc('0xa')](),controller['addAllCondition']);router[_0xbafc('0x16')]('/:id/any_conditions',auth[_0xbafc('0xa')](),controller['addAnyCondition']);router['post']('/:id/actions',auth[_0xbafc('0xa')](),controller[_0xbafc('0x17')]);router['put'](_0xbafc('0xd'),auth['isAuthenticated'](),controller[_0xbafc('0x18')]);router['delete'](_0xbafc('0xd'),auth['isAuthenticated'](),controller[_0xbafc('0x19')]);module[_0xbafc('0x1a')]=router; \ No newline at end of file +var _0x3a8d=['connect-timeout','express','fs-extra','../../components/auth/service','./trigger.controller','get','index','/:id','show','/:id/all_conditions','isAuthenticated','/:id/any_conditions','getAnyConditions','/:id/actions','getActions','post','create','addAllCondition','addAction','put','update','delete','destroy','exports','multer','path'];(function(_0x4af01e,_0x543f5c){var _0x178c11=function(_0x2c2f76){while(--_0x2c2f76){_0x4af01e['push'](_0x4af01e['shift']());}};_0x178c11(++_0x543f5c);}(_0x3a8d,0x150));var _0xd3a8=function(_0x1399d6,_0x2c1661){_0x1399d6=_0x1399d6-0x0;var _0x4a9db4=_0x3a8d[_0x1399d6];return _0x4a9db4;};'use strict';var multer=require(_0xd3a8('0x0'));var util=require('util');var path=require(_0xd3a8('0x1'));var timeout=require(_0xd3a8('0x2'));var express=require(_0xd3a8('0x3'));var router=express['Router']();var fs_extra=require(_0xd3a8('0x4'));var auth=require(_0xd3a8('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xd3a8('0x6'));router[_0xd3a8('0x7')]('/',auth['isAuthenticated'](),controller[_0xd3a8('0x8')]);router['get'](_0xd3a8('0x9'),auth['isAuthenticated'](),controller[_0xd3a8('0xa')]);router[_0xd3a8('0x7')](_0xd3a8('0xb'),auth[_0xd3a8('0xc')](),controller['getAllConditions']);router[_0xd3a8('0x7')](_0xd3a8('0xd'),auth[_0xd3a8('0xc')](),controller[_0xd3a8('0xe')]);router['get'](_0xd3a8('0xf'),auth['isAuthenticated'](),controller[_0xd3a8('0x10')]);router[_0xd3a8('0x11')]('/',auth[_0xd3a8('0xc')](),controller[_0xd3a8('0x12')]);router[_0xd3a8('0x11')](_0xd3a8('0xb'),auth['isAuthenticated'](),controller[_0xd3a8('0x13')]);router['post'](_0xd3a8('0xd'),auth[_0xd3a8('0xc')](),controller['addAnyCondition']);router['post'](_0xd3a8('0xf'),auth[_0xd3a8('0xc')](),controller[_0xd3a8('0x14')]);router[_0xd3a8('0x15')]('/:id',auth['isAuthenticated'](),controller[_0xd3a8('0x16')]);router[_0xd3a8('0x17')](_0xd3a8('0x9'),auth[_0xd3a8('0xc')](),controller[_0xd3a8('0x18')]);module[_0xd3a8('0x19')]=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index fdda28a..86e883e 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 _0x2dad=['BOOLEAN','sequelize','STRING'];(function(_0x46ccd5,_0x2c29ac){var _0x46fd6c=function(_0x4f4b84){while(--_0x4f4b84){_0x46ccd5['push'](_0x46ccd5['shift']());}};_0x46fd6c(++_0x2c29ac);}(_0x2dad,0xd9));var _0xd2da=function(_0x1b903e,_0x214e55){_0x1b903e=_0x1b903e-0x0;var _0x37727a=_0x2dad[_0x1b903e];return _0x37727a;};'use strict';var Sequelize=require(_0xd2da('0x0'));module['exports']={'name':{'type':Sequelize[_0xd2da('0x1')]},'channel':{'type':Sequelize[_0xd2da('0x1')]},'description':{'type':Sequelize[_0xd2da('0x1')]},'status':{'type':Sequelize[_0xd2da('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x6e82=['exports','STRING','sequelize'];(function(_0x54d2e2,_0x174ed8){var _0x14364d=function(_0x1f534d){while(--_0x1f534d){_0x54d2e2['push'](_0x54d2e2['shift']());}};_0x14364d(++_0x174ed8);}(_0x6e82,0x13a));var _0x26e8=function(_0x3a3a7d,_0x58e12f){_0x3a3a7d=_0x3a3a7d-0x0;var _0x82c974=_0x6e82[_0x3a3a7d];return _0x82c974;};'use strict';var Sequelize=require(_0x26e8('0x0'));module[_0x26e8('0x1')]={'name':{'type':Sequelize[_0x26e8('0x2')]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x26e8('0x2')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index 4d81d2a..195e58d 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 _0x988b=['model','query','filters','intersection','attributes','fields','hasOwnProperty','sort','where','pick','filter','merge','includeAll','include','findAll','catch','show','params','keys','options','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Triggers','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addAllCondition','TriggerAllId','addAnyCondition','TriggerAnyId','Condition','getAllConditions','findOne','length','order','nolimit','getAnyConditions','addAction','Action','getActions','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','destroy','UserProfileResource','end','error','stack','name','send','index','map','Trigger','rawAttributes','fieldName','key'];(function(_0x1ed182,_0x13b3c5){var _0x22dde0=function(_0x653387){while(--_0x653387){_0x1ed182['push'](_0x1ed182['shift']());}};_0x22dde0(++_0x13b3c5);}(_0x988b,0xef));var _0xb988=function(_0x45806b,_0x53eeae){_0x45806b=_0x45806b-0x0;var _0x3e228e=_0x988b[_0x45806b];return _0x3e228e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb988('0x0'));var zipdir=require(_0xb988('0x1'));var jsonpatch=require(_0xb988('0x2'));var rp=require(_0xb988('0x3'));var moment=require(_0xb988('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xb988('0x5'));var util=require(_0xb988('0x6'));var path=require(_0xb988('0x7'));var sox=require(_0xb988('0x8'));var csv=require(_0xb988('0x9'));var ejs=require(_0xb988('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb988('0xb'));var crypto=require(_0xb988('0xc'));var jsforce=require(_0xb988('0xd'));var deskjs=require(_0xb988('0xe'));var toCsv=require('to-csv');var querystring=require(_0xb988('0xf'));var Papa=require(_0xb988('0x10'));var Redis=require(_0xb988('0x11'));var authService=require(_0xb988('0x12'));var qs=require(_0xb988('0x13'));var as=require(_0xb988('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb988('0x15'))(_0xb988('0x16'));var utils=require(_0xb988('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xb988('0x18'));var db=require(_0xb988('0x19'))['db'];function respondWithStatusCode(_0x175328,_0x2307e0){_0x2307e0=_0x2307e0||0xcc;return function(_0x444e03){if(_0x444e03){return _0x175328[_0xb988('0x1a')](_0x2307e0);}return _0x175328['status'](_0x2307e0)['end']();};}function respondWithResult(_0x4e92e9,_0x216866){_0x216866=_0x216866||0xc8;return function(_0x38a46a){if(_0x38a46a){return _0x4e92e9[_0xb988('0x1b')](_0x216866)[_0xb988('0x1c')](_0x38a46a);}};}function respondWithFilteredResult(_0x26687d,_0x42403b){return function(_0x532cf8){if(_0x532cf8){var _0xafa788=typeof _0x42403b[_0xb988('0x1d')]===_0xb988('0x1e')&&typeof _0x42403b['limit']===_0xb988('0x1e');var _0x3cf474=_0x532cf8[_0xb988('0x1f')];var _0x337689=_0xafa788?0x0:_0x42403b[_0xb988('0x1d')];var _0x3541a9=_0xafa788?_0x532cf8[_0xb988('0x1f')]:_0x42403b['offset']+_0x42403b[_0xb988('0x20')];var _0x5363e3;if(_0x3541a9>=_0x3cf474){_0x3541a9=_0x3cf474;_0x5363e3=0xc8;}else{_0x5363e3=0xce;}_0x26687d[_0xb988('0x1b')](_0x5363e3);return _0x26687d['set'](_0xb988('0x21'),_0x337689+'-'+_0x3541a9+'/'+_0x3cf474)[_0xb988('0x1c')](_0x532cf8);}return null;};}function patchUpdates(_0x468eeb){return function(_0x5291b6){try{jsonpatch[_0xb988('0x22')](_0x5291b6,_0x468eeb,!![]);}catch(_0x5231a7){return BPromise[_0xb988('0x23')](_0x5231a7);}return _0x5291b6[_0xb988('0x24')]();};}function saveUpdates(_0x1687b,_0xbd995b){return function(_0x416f7f){if(_0x416f7f){return _0x416f7f[_0xb988('0x25')](_0x1687b)[_0xb988('0x26')](function(_0x3d46a0){return _0x3d46a0;});}return null;};}function removeEntity(_0x14d8cc,_0x2745fb){return function(_0x304ee4){if(_0x304ee4){return _0x304ee4[_0xb988('0x27')]()['then'](function(){var _0x261e37=_0x304ee4['get']({'plain':!![]});var _0x2595de='Triggers';return db[_0xb988('0x28')][_0xb988('0x27')]({'where':{'type':_0x2595de,'resourceId':_0x261e37['id']}})[_0xb988('0x26')](function(){return _0x304ee4;});})['then'](function(){_0x14d8cc[_0xb988('0x1b')](0xcc)[_0xb988('0x29')]();});}};}function handleEntityNotFound(_0x4bfe81,_0x101ba9){return function(_0x25fb49){if(!_0x25fb49){_0x4bfe81[_0xb988('0x1a')](0x194);}return _0x25fb49;};}function handleError(_0x2f0808,_0x3246a4){_0x3246a4=_0x3246a4||0x1f4;return function(_0x1f52be){logger[_0xb988('0x2a')](_0x1f52be[_0xb988('0x2b')]);if(_0x1f52be[_0xb988('0x2c')]){delete _0x1f52be[_0xb988('0x2c')];}_0x2f0808[_0xb988('0x1b')](_0x3246a4)[_0xb988('0x2d')](_0x1f52be);};}exports[_0xb988('0x2e')]=function(_0x2f7979,_0x5c44c5){var _0x2a4ad6={},_0x8c39a3={},_0x45d3e7={'count':0x0,'rows':[]};var _0x2244c6=_[_0xb988('0x2f')](db[_0xb988('0x30')][_0xb988('0x31')],function(_0x4f73a8){return{'name':_0x4f73a8[_0xb988('0x32')],'type':_0x4f73a8['type'][_0xb988('0x33')]};});_0x8c39a3[_0xb988('0x34')]=_['map'](_0x2244c6,_0xb988('0x2c'));_0x8c39a3[_0xb988('0x35')]=_['keys'](_0x2f7979[_0xb988('0x35')]);_0x8c39a3[_0xb988('0x36')]=_[_0xb988('0x37')](_0x8c39a3[_0xb988('0x34')],_0x8c39a3['query']);_0x2a4ad6[_0xb988('0x38')]=_[_0xb988('0x37')](_0x8c39a3[_0xb988('0x34')],qs[_0xb988('0x39')](_0x2f7979[_0xb988('0x35')][_0xb988('0x39')]));_0x2a4ad6[_0xb988('0x38')]=_0x2a4ad6[_0xb988('0x38')]['length']?_0x2a4ad6[_0xb988('0x38')]:_0x8c39a3['model'];if(!_0x2f7979[_0xb988('0x35')][_0xb988('0x3a')]('nolimit')){_0x2a4ad6[_0xb988('0x20')]=qs[_0xb988('0x20')](_0x2f7979['query'][_0xb988('0x20')]);_0x2a4ad6[_0xb988('0x1d')]=qs[_0xb988('0x1d')](_0x2f7979['query'][_0xb988('0x1d')]);}_0x2a4ad6['order']=qs[_0xb988('0x3b')](_0x2f7979[_0xb988('0x35')][_0xb988('0x3b')]);_0x2a4ad6[_0xb988('0x3c')]=qs[_0xb988('0x36')](_[_0xb988('0x3d')](_0x2f7979[_0xb988('0x35')],_0x8c39a3['filters']),_0x2244c6);if(_0x2f7979[_0xb988('0x35')][_0xb988('0x3e')]){_0x2a4ad6[_0xb988('0x3c')]=_[_0xb988('0x3f')](_0x2a4ad6[_0xb988('0x3c')],{'$or':_[_0xb988('0x2f')](_0x2244c6,function(_0x584f92){if(_0x584f92['type']!=='VIRTUAL'){var _0x53737b={};_0x53737b[_0x584f92[_0xb988('0x2c')]]={'$like':'%'+_0x2f7979['query']['filter']+'%'};return _0x53737b;}})});}_0x2a4ad6=_[_0xb988('0x3f')]({},_0x2a4ad6,_0x2f7979['options']);var _0xb51b93={'where':_0x2a4ad6[_0xb988('0x3c')]};return db['Trigger'][_0xb988('0x1f')](_0xb51b93)[_0xb988('0x26')](function(_0x5c7d68){_0x45d3e7[_0xb988('0x1f')]=_0x5c7d68;if(_0x2f7979[_0xb988('0x35')][_0xb988('0x40')]){_0x2a4ad6[_0xb988('0x41')]=[{'all':!![]}];}return db[_0xb988('0x30')][_0xb988('0x42')](_0x2a4ad6);})['then'](function(_0xb8b80e){_0x45d3e7['rows']=_0xb8b80e;return _0x45d3e7;})[_0xb988('0x26')](respondWithFilteredResult(_0x5c44c5,_0x2a4ad6))[_0xb988('0x43')](handleError(_0x5c44c5,null));};exports[_0xb988('0x44')]=function(_0xd21d50,_0x4b8882){var _0x21660a={'raw':![],'where':{'id':_0xd21d50[_0xb988('0x45')]['id']}},_0x37d4df={};_0x37d4df[_0xb988('0x34')]=_['keys'](db[_0xb988('0x30')]['rawAttributes']);_0x37d4df[_0xb988('0x35')]=_[_0xb988('0x46')](_0xd21d50[_0xb988('0x35')]);_0x37d4df['filters']=_[_0xb988('0x37')](_0x37d4df[_0xb988('0x34')],_0x37d4df[_0xb988('0x35')]);_0x21660a['attributes']=_[_0xb988('0x37')](_0x37d4df[_0xb988('0x34')],qs['fields'](_0xd21d50['query'][_0xb988('0x39')]));_0x21660a[_0xb988('0x38')]=_0x21660a[_0xb988('0x38')]['length']?_0x21660a[_0xb988('0x38')]:_0x37d4df['model'];if(_0xd21d50[_0xb988('0x35')]['includeAll']){_0x21660a['include']=[{'all':!![]}];}_0x21660a=_[_0xb988('0x3f')]({},_0x21660a,_0xd21d50[_0xb988('0x47')]);return db[_0xb988('0x30')]['find'](_0x21660a)[_0xb988('0x26')](handleEntityNotFound(_0x4b8882,null))[_0xb988('0x26')](respondWithResult(_0x4b8882,null))[_0xb988('0x43')](handleError(_0x4b8882,null));};exports[_0xb988('0x48')]=function(_0x1cfd1f,_0x4fa07b){return db[_0xb988('0x30')][_0xb988('0x48')](_0x1cfd1f[_0xb988('0x49')],{})['then'](function(_0x5e7fe9){var _0x477c95=_0x1cfd1f[_0xb988('0x4a')][_0xb988('0x4b')]({'plain':!![]});if(!_0x477c95)throw new Error(_0xb988('0x4c'));if(_0x477c95[_0xb988('0x4d')]===_0xb988('0x4a')){var _0x4ab340=_0x5e7fe9[_0xb988('0x4b')]({'plain':!![]});var _0x3c5d31=_0xb988('0x4e');return db[_0xb988('0x4f')][_0xb988('0x50')]({'where':{'name':_0x3c5d31,'userProfileId':_0x477c95['userProfileId']},'raw':!![]})[_0xb988('0x26')](function(_0x5bf883){if(_0x5bf883&&_0x5bf883[_0xb988('0x51')]===0x0){return db[_0xb988('0x28')][_0xb988('0x48')]({'name':_0x4ab340[_0xb988('0x2c')],'resourceId':_0x4ab340['id'],'type':_0x5bf883[_0xb988('0x2c')],'sectionId':_0x5bf883['id']},{})[_0xb988('0x26')](function(){return _0x5e7fe9;});}else{return _0x5e7fe9;}})[_0xb988('0x43')](function(_0x2a5c1c){logger[_0xb988('0x2a')](_0xb988('0x52'),_0x2a5c1c);throw _0x2a5c1c;});}return _0x5e7fe9;})[_0xb988('0x26')](respondWithResult(_0x4fa07b,0xc9))['catch'](handleError(_0x4fa07b,null));};exports[_0xb988('0x25')]=function(_0x58825e,_0x2dcc60){if(_0x58825e[_0xb988('0x49')]['id']){delete _0x58825e[_0xb988('0x49')]['id'];}return db[_0xb988('0x30')][_0xb988('0x50')]({'where':{'id':_0x58825e[_0xb988('0x45')]['id']}})[_0xb988('0x26')](handleEntityNotFound(_0x2dcc60,null))[_0xb988('0x26')](saveUpdates(_0x58825e[_0xb988('0x49')],null))[_0xb988('0x26')](respondWithResult(_0x2dcc60,null))['catch'](handleError(_0x2dcc60,null));};exports[_0xb988('0x27')]=function(_0x30103c,_0x59dce9){return db[_0xb988('0x30')][_0xb988('0x50')]({'where':{'id':_0x30103c[_0xb988('0x45')]['id']}})['then'](handleEntityNotFound(_0x59dce9,null))[_0xb988('0x26')](removeEntity(_0x59dce9,null))[_0xb988('0x43')](handleError(_0x59dce9,null));};exports[_0xb988('0x53')]=function(_0x354f19,_0x333ca3,_0x363bc3){if(_0x354f19['body']['id']){delete _0x354f19[_0xb988('0x49')]['id'];}return db[_0xb988('0x30')][_0xb988('0x50')]({'where':{'id':_0x354f19['params']['id']}})[_0xb988('0x26')](handleEntityNotFound(_0x333ca3,null))['then'](function(_0x2da4cb){if(_0x2da4cb){_0x354f19[_0xb988('0x49')][_0xb988('0x54')]=_0x2da4cb['id'];return db['Condition']['create'](_0x354f19[_0xb988('0x49')]);}})['then'](respondWithResult(_0x333ca3,null))['catch'](handleError(_0x333ca3,null));};exports[_0xb988('0x55')]=function(_0x440c59,_0x582c17,_0x46a8ec){if(_0x440c59[_0xb988('0x49')]['id']){delete _0x440c59[_0xb988('0x49')]['id'];}return db[_0xb988('0x30')][_0xb988('0x50')]({'where':{'id':_0x440c59[_0xb988('0x45')]['id']}})[_0xb988('0x26')](handleEntityNotFound(_0x582c17,null))[_0xb988('0x26')](function(_0x1b280e){if(_0x1b280e){_0x440c59[_0xb988('0x49')][_0xb988('0x56')]=_0x1b280e['id'];return db[_0xb988('0x57')]['create'](_0x440c59[_0xb988('0x49')]);}})[_0xb988('0x26')](respondWithResult(_0x582c17,null))['catch'](handleError(_0x582c17,null));};exports[_0xb988('0x58')]=function(_0x164c4c,_0x34d8ce,_0x261043){var _0x5161d7={};var _0x2e2194={};var _0x51cddb;var _0x2cef7f;return db[_0xb988('0x30')][_0xb988('0x59')]({'where':{'id':_0x164c4c[_0xb988('0x45')]['id']}})[_0xb988('0x26')](handleEntityNotFound(_0x34d8ce,null))[_0xb988('0x26')](function(_0x57d1e6){if(_0x57d1e6){_0x51cddb=_0x57d1e6;_0x2e2194[_0xb988('0x34')]=_[_0xb988('0x46')](db[_0xb988('0x57')][_0xb988('0x31')]);_0x2e2194[_0xb988('0x35')]=_['keys'](_0x164c4c['query']);_0x2e2194['filters']=_[_0xb988('0x37')](_0x2e2194[_0xb988('0x34')],_0x2e2194[_0xb988('0x35')]);_0x5161d7[_0xb988('0x38')]=_['intersection'](_0x2e2194['model'],qs[_0xb988('0x39')](_0x164c4c[_0xb988('0x35')]['fields']));_0x5161d7['attributes']=_0x5161d7[_0xb988('0x38')][_0xb988('0x5a')]?_0x5161d7[_0xb988('0x38')]:_0x2e2194[_0xb988('0x34')];_0x5161d7[_0xb988('0x5b')]=qs[_0xb988('0x3b')](_0x164c4c[_0xb988('0x35')][_0xb988('0x3b')]);_0x5161d7[_0xb988('0x3c')]=qs[_0xb988('0x36')](_['pick'](_0x164c4c[_0xb988('0x35')],_0x2e2194[_0xb988('0x36')]));if(_0x164c4c[_0xb988('0x35')][_0xb988('0x3e')]){_0x5161d7[_0xb988('0x3c')]=_[_0xb988('0x3f')](_0x5161d7['where'],{'$or':_['map'](_0x5161d7[_0xb988('0x38')],function(_0x2cab84){var _0x248cec={};_0x248cec[_0x2cab84]={'$like':'%'+_0x164c4c['query'][_0xb988('0x3e')]+'%'};return _0x248cec;})});}_0x5161d7=_[_0xb988('0x3f')]({},_0x5161d7,_0x164c4c['options']);return _0x51cddb[_0xb988('0x58')](_0x5161d7);}})[_0xb988('0x26')](function(_0x462e37){if(_0x462e37){_0x2cef7f=_0x462e37[_0xb988('0x5a')];if(!_0x164c4c[_0xb988('0x35')][_0xb988('0x3a')](_0xb988('0x5c'))){_0x5161d7[_0xb988('0x20')]=qs[_0xb988('0x20')](_0x164c4c[_0xb988('0x35')][_0xb988('0x20')]);_0x5161d7[_0xb988('0x1d')]=qs[_0xb988('0x1d')](_0x164c4c[_0xb988('0x35')][_0xb988('0x1d')]);}return _0x51cddb['getAllConditions'](_0x5161d7);}})[_0xb988('0x26')](function(_0x13aacc){if(_0x13aacc){return _0x13aacc?{'count':_0x2cef7f,'rows':_0x13aacc}:null;}})[_0xb988('0x26')](respondWithResult(_0x34d8ce,null))[_0xb988('0x43')](handleError(_0x34d8ce,null));};exports['getAnyConditions']=function(_0x32e376,_0x690e61,_0x505352){var _0x2691ad={};var _0x51f169={};var _0x42d1c8;var _0x50a48e;return db[_0xb988('0x30')][_0xb988('0x59')]({'where':{'id':_0x32e376[_0xb988('0x45')]['id']}})['then'](handleEntityNotFound(_0x690e61,null))[_0xb988('0x26')](function(_0x40960e){if(_0x40960e){_0x42d1c8=_0x40960e;_0x51f169[_0xb988('0x34')]=_[_0xb988('0x46')](db[_0xb988('0x57')]['rawAttributes']);_0x51f169[_0xb988('0x35')]=_['keys'](_0x32e376[_0xb988('0x35')]);_0x51f169[_0xb988('0x36')]=_[_0xb988('0x37')](_0x51f169['model'],_0x51f169[_0xb988('0x35')]);_0x2691ad[_0xb988('0x38')]=_[_0xb988('0x37')](_0x51f169[_0xb988('0x34')],qs[_0xb988('0x39')](_0x32e376['query']['fields']));_0x2691ad[_0xb988('0x38')]=_0x2691ad['attributes'][_0xb988('0x5a')]?_0x2691ad[_0xb988('0x38')]:_0x51f169[_0xb988('0x34')];_0x2691ad[_0xb988('0x5b')]=qs[_0xb988('0x3b')](_0x32e376[_0xb988('0x35')][_0xb988('0x3b')]);_0x2691ad[_0xb988('0x3c')]=qs['filters'](_[_0xb988('0x3d')](_0x32e376['query'],_0x51f169[_0xb988('0x36')]));if(_0x32e376[_0xb988('0x35')][_0xb988('0x3e')]){_0x2691ad['where']=_[_0xb988('0x3f')](_0x2691ad['where'],{'$or':_[_0xb988('0x2f')](_0x2691ad[_0xb988('0x38')],function(_0x2f4255){var _0x59bffe={};_0x59bffe[_0x2f4255]={'$like':'%'+_0x32e376[_0xb988('0x35')][_0xb988('0x3e')]+'%'};return _0x59bffe;})});}_0x2691ad=_[_0xb988('0x3f')]({},_0x2691ad,_0x32e376[_0xb988('0x47')]);return _0x42d1c8[_0xb988('0x5d')](_0x2691ad);}})['then'](function(_0x105af0){if(_0x105af0){_0x50a48e=_0x105af0[_0xb988('0x5a')];if(!_0x32e376['query'][_0xb988('0x3a')](_0xb988('0x5c'))){_0x2691ad[_0xb988('0x20')]=qs[_0xb988('0x20')](_0x32e376['query'][_0xb988('0x20')]);_0x2691ad['offset']=qs[_0xb988('0x1d')](_0x32e376[_0xb988('0x35')][_0xb988('0x1d')]);}return _0x42d1c8[_0xb988('0x5d')](_0x2691ad);}})[_0xb988('0x26')](function(_0x18a147){if(_0x18a147){return _0x18a147?{'count':_0x50a48e,'rows':_0x18a147}:null;}})[_0xb988('0x26')](respondWithResult(_0x690e61,null))[_0xb988('0x43')](handleError(_0x690e61,null));};exports[_0xb988('0x5e')]=function(_0x1622a6,_0x2996b1,_0x49946c){if(_0x1622a6['body']['id']){delete _0x1622a6[_0xb988('0x49')]['id'];}return db['Trigger']['find']({'where':{'id':_0x1622a6['params']['id']}})[_0xb988('0x26')](handleEntityNotFound(_0x2996b1,null))['then'](function(_0x4e9ab1){if(_0x4e9ab1){_0x1622a6[_0xb988('0x49')]['TriggerId']=_0x4e9ab1['id'];return db['Action'][_0xb988('0x48')](_0x1622a6['body']);}})[_0xb988('0x26')](respondWithResult(_0x2996b1,null))[_0xb988('0x43')](handleError(_0x2996b1,null));};exports['getActions']=function(_0x27db71,_0x28c605,_0x33ab2a){var _0x5e082f={};var _0x574fe6={};var _0x3e3bf2;var _0x25b0d3;return db['Trigger'][_0xb988('0x59')]({'where':{'id':_0x27db71[_0xb988('0x45')]['id']}})['then'](handleEntityNotFound(_0x28c605,null))[_0xb988('0x26')](function(_0x204780){if(_0x204780){_0x3e3bf2=_0x204780;_0x574fe6[_0xb988('0x34')]=_[_0xb988('0x46')](db[_0xb988('0x5f')]['rawAttributes']);_0x574fe6[_0xb988('0x35')]=_['keys'](_0x27db71[_0xb988('0x35')]);_0x574fe6[_0xb988('0x36')]=_[_0xb988('0x37')](_0x574fe6[_0xb988('0x34')],_0x574fe6[_0xb988('0x35')]);_0x5e082f[_0xb988('0x38')]=_[_0xb988('0x37')](_0x574fe6[_0xb988('0x34')],qs[_0xb988('0x39')](_0x27db71['query'][_0xb988('0x39')]));_0x5e082f[_0xb988('0x38')]=_0x5e082f[_0xb988('0x38')][_0xb988('0x5a')]?_0x5e082f['attributes']:_0x574fe6['model'];_0x5e082f[_0xb988('0x5b')]=qs[_0xb988('0x3b')](_0x27db71[_0xb988('0x35')]['sort']);_0x5e082f['where']=qs[_0xb988('0x36')](_[_0xb988('0x3d')](_0x27db71[_0xb988('0x35')],_0x574fe6['filters']));if(_0x27db71[_0xb988('0x35')][_0xb988('0x3e')]){_0x5e082f[_0xb988('0x3c')]=_[_0xb988('0x3f')](_0x5e082f[_0xb988('0x3c')],{'$or':_['map'](_0x5e082f[_0xb988('0x38')],function(_0x3423eb){var _0x61431a={};_0x61431a[_0x3423eb]={'$like':'%'+_0x27db71[_0xb988('0x35')][_0xb988('0x3e')]+'%'};return _0x61431a;})});}_0x5e082f=_[_0xb988('0x3f')]({},_0x5e082f,_0x27db71[_0xb988('0x47')]);return _0x3e3bf2[_0xb988('0x60')](_0x5e082f);}})[_0xb988('0x26')](function(_0x4e9903){if(_0x4e9903){_0x25b0d3=_0x4e9903[_0xb988('0x5a')];if(!_0x27db71[_0xb988('0x35')]['hasOwnProperty'](_0xb988('0x5c'))){_0x5e082f[_0xb988('0x20')]=qs[_0xb988('0x20')](_0x27db71['query'][_0xb988('0x20')]);_0x5e082f[_0xb988('0x1d')]=qs[_0xb988('0x1d')](_0x27db71[_0xb988('0x35')][_0xb988('0x1d')]);}return _0x3e3bf2['getActions'](_0x5e082f);}})[_0xb988('0x26')](function(_0x4d5cff){if(_0x4d5cff){return _0x4d5cff?{'count':_0x25b0d3,'rows':_0x4d5cff}:null;}})[_0xb988('0x26')](respondWithResult(_0x28c605,null))[_0xb988('0x43')](handleError(_0x28c605,null));}; \ No newline at end of file +var _0x2729=['rows','show','params','catch','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','get','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','TriggerAllId','TriggerAnyId','Condition','getAllConditions','findOne','nolimit','pick','getAnyConditions','addAction','TriggerId','Action','getActions','eml-format','zip-dir','request-promise','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','offset','undefined','count','limit','json','apply','update','then','destroy','UserProfileResource','end','error','stack','name','send','index','Trigger','rawAttributes','fieldName','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','filter','where','merge','type','VIRTUAL','options','includeAll','include','findAll'];(function(_0xedeb50,_0x5481cf){var _0x48ded6=function(_0x14af51){while(--_0x14af51){_0xedeb50['push'](_0xedeb50['shift']());}};_0x48ded6(++_0x5481cf);}(_0x2729,0x1e5));var _0x9272=function(_0x4a5420,_0x9cac3a){_0x4a5420=_0x4a5420-0x0;var _0x480c02=_0x2729[_0x4a5420];return _0x480c02;};'use strict';var emlformat=require(_0x9272('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9272('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9272('0x2'));var moment=require('moment');var BPromise=require(_0x9272('0x3'));var Mustache=require(_0x9272('0x4'));var util=require('util');var path=require(_0x9272('0x5'));var sox=require('sox');var csv=require(_0x9272('0x6'));var ejs=require(_0x9272('0x7'));var fs=require('fs');var fs_extra=require(_0x9272('0x8'));var _=require(_0x9272('0x9'));var squel=require(_0x9272('0xa'));var crypto=require(_0x9272('0xb'));var jsforce=require(_0x9272('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x9272('0x6'));var querystring=require(_0x9272('0xd'));var Papa=require(_0x9272('0xe'));var Redis=require(_0x9272('0xf'));var authService=require(_0x9272('0x10'));var qs=require(_0x9272('0x11'));var as=require(_0x9272('0x12'));var hardwareService=require(_0x9272('0x13'));var logger=require(_0x9272('0x14'))(_0x9272('0x15'));var utils=require(_0x9272('0x16'));var config=require(_0x9272('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x229fa7,_0x26c684){_0x26c684=_0x26c684||0xcc;return function(_0x32c904){if(_0x32c904){return _0x229fa7[_0x9272('0x18')](_0x26c684);}return _0x229fa7[_0x9272('0x19')](_0x26c684)['end']();};}function respondWithResult(_0x1a0843,_0x435af5){_0x435af5=_0x435af5||0xc8;return function(_0xa4a6e4){if(_0xa4a6e4){return _0x1a0843[_0x9272('0x19')](_0x435af5)['json'](_0xa4a6e4);}};}function respondWithFilteredResult(_0x55757a,_0x5491a5){return function(_0xea4e29){if(_0xea4e29){var _0x228c46=typeof _0x5491a5[_0x9272('0x1a')]===_0x9272('0x1b')&&typeof _0x5491a5['limit']===_0x9272('0x1b');var _0x3e3117=_0xea4e29[_0x9272('0x1c')];var _0x1154e2=_0x228c46?0x0:_0x5491a5['offset'];var _0x3758a3=_0x228c46?_0xea4e29[_0x9272('0x1c')]:_0x5491a5['offset']+_0x5491a5[_0x9272('0x1d')];var _0x5802ae;if(_0x3758a3>=_0x3e3117){_0x3758a3=_0x3e3117;_0x5802ae=0xc8;}else{_0x5802ae=0xce;}_0x55757a['status'](_0x5802ae);return _0x55757a['set']('Content-Range',_0x1154e2+'-'+_0x3758a3+'/'+_0x3e3117)[_0x9272('0x1e')](_0xea4e29);}return null;};}function patchUpdates(_0x4f3b85){return function(_0x17765e){try{jsonpatch[_0x9272('0x1f')](_0x17765e,_0x4f3b85,!![]);}catch(_0x433eaf){return BPromise['reject'](_0x433eaf);}return _0x17765e['save']();};}function saveUpdates(_0x456c1a,_0x270944){return function(_0x284d27){if(_0x284d27){return _0x284d27[_0x9272('0x20')](_0x456c1a)[_0x9272('0x21')](function(_0x4fc623){return _0x4fc623;});}return null;};}function removeEntity(_0x4fa2d0,_0x451e57){return function(_0xd001a4){if(_0xd001a4){return _0xd001a4[_0x9272('0x22')]()[_0x9272('0x21')](function(){var _0x1ed961=_0xd001a4['get']({'plain':!![]});var _0x5b0c70='Triggers';return db[_0x9272('0x23')][_0x9272('0x22')]({'where':{'type':_0x5b0c70,'resourceId':_0x1ed961['id']}})[_0x9272('0x21')](function(){return _0xd001a4;});})['then'](function(){_0x4fa2d0['status'](0xcc)[_0x9272('0x24')]();});}};}function handleEntityNotFound(_0x29d61c,_0x39ed8d){return function(_0x517f58){if(!_0x517f58){_0x29d61c[_0x9272('0x18')](0x194);}return _0x517f58;};}function handleError(_0x1e12db,_0x5a37c0){_0x5a37c0=_0x5a37c0||0x1f4;return function(_0x43ce85){logger[_0x9272('0x25')](_0x43ce85[_0x9272('0x26')]);if(_0x43ce85[_0x9272('0x27')]){delete _0x43ce85[_0x9272('0x27')];}_0x1e12db[_0x9272('0x19')](_0x5a37c0)[_0x9272('0x28')](_0x43ce85);};}exports[_0x9272('0x29')]=function(_0x228488,_0x1bd810){var _0x1430c9={},_0xb2f316={},_0x202324={'count':0x0,'rows':[]};var _0x35f582=_['map'](db[_0x9272('0x2a')][_0x9272('0x2b')],function(_0x49c4ca){return{'name':_0x49c4ca[_0x9272('0x2c')],'type':_0x49c4ca['type'][_0x9272('0x2d')]};});_0xb2f316[_0x9272('0x2e')]=_[_0x9272('0x2f')](_0x35f582,'name');_0xb2f316['query']=_[_0x9272('0x30')](_0x228488[_0x9272('0x31')]);_0xb2f316[_0x9272('0x32')]=_[_0x9272('0x33')](_0xb2f316[_0x9272('0x2e')],_0xb2f316[_0x9272('0x31')]);_0x1430c9[_0x9272('0x34')]=_[_0x9272('0x33')](_0xb2f316[_0x9272('0x2e')],qs['fields'](_0x228488[_0x9272('0x31')][_0x9272('0x35')]));_0x1430c9['attributes']=_0x1430c9[_0x9272('0x34')][_0x9272('0x36')]?_0x1430c9[_0x9272('0x34')]:_0xb2f316[_0x9272('0x2e')];if(!_0x228488[_0x9272('0x31')][_0x9272('0x37')]('nolimit')){_0x1430c9[_0x9272('0x1d')]=qs['limit'](_0x228488[_0x9272('0x31')][_0x9272('0x1d')]);_0x1430c9[_0x9272('0x1a')]=qs[_0x9272('0x1a')](_0x228488[_0x9272('0x31')][_0x9272('0x1a')]);}_0x1430c9[_0x9272('0x38')]=qs[_0x9272('0x39')](_0x228488[_0x9272('0x31')]['sort']);_0x1430c9['where']=qs['filters'](_['pick'](_0x228488[_0x9272('0x31')],_0xb2f316[_0x9272('0x32')]),_0x35f582);if(_0x228488[_0x9272('0x31')][_0x9272('0x3a')]){_0x1430c9[_0x9272('0x3b')]=_[_0x9272('0x3c')](_0x1430c9[_0x9272('0x3b')],{'$or':_[_0x9272('0x2f')](_0x35f582,function(_0x2bc335){if(_0x2bc335[_0x9272('0x3d')]!==_0x9272('0x3e')){var _0x3d6b87={};_0x3d6b87[_0x2bc335[_0x9272('0x27')]]={'$like':'%'+_0x228488[_0x9272('0x31')][_0x9272('0x3a')]+'%'};return _0x3d6b87;}})});}_0x1430c9=_[_0x9272('0x3c')]({},_0x1430c9,_0x228488[_0x9272('0x3f')]);var _0x9d883f={'where':_0x1430c9['where']};return db[_0x9272('0x2a')][_0x9272('0x1c')](_0x9d883f)[_0x9272('0x21')](function(_0x563470){_0x202324[_0x9272('0x1c')]=_0x563470;if(_0x228488[_0x9272('0x31')][_0x9272('0x40')]){_0x1430c9[_0x9272('0x41')]=[{'all':!![]}];}return db['Trigger'][_0x9272('0x42')](_0x1430c9);})[_0x9272('0x21')](function(_0x361bde){_0x202324[_0x9272('0x43')]=_0x361bde;return _0x202324;})[_0x9272('0x21')](respondWithFilteredResult(_0x1bd810,_0x1430c9))['catch'](handleError(_0x1bd810,null));};exports[_0x9272('0x44')]=function(_0x3f8d61,_0x2120a3){var _0x42ffcb={'raw':![],'where':{'id':_0x3f8d61[_0x9272('0x45')]['id']}},_0x5849e4={};_0x5849e4[_0x9272('0x2e')]=_['keys'](db[_0x9272('0x2a')][_0x9272('0x2b')]);_0x5849e4['query']=_[_0x9272('0x30')](_0x3f8d61[_0x9272('0x31')]);_0x5849e4[_0x9272('0x32')]=_[_0x9272('0x33')](_0x5849e4[_0x9272('0x2e')],_0x5849e4[_0x9272('0x31')]);_0x42ffcb['attributes']=_[_0x9272('0x33')](_0x5849e4['model'],qs[_0x9272('0x35')](_0x3f8d61[_0x9272('0x31')][_0x9272('0x35')]));_0x42ffcb['attributes']=_0x42ffcb[_0x9272('0x34')][_0x9272('0x36')]?_0x42ffcb['attributes']:_0x5849e4[_0x9272('0x2e')];if(_0x3f8d61[_0x9272('0x31')]['includeAll']){_0x42ffcb[_0x9272('0x41')]=[{'all':!![]}];}_0x42ffcb=_['merge']({},_0x42ffcb,_0x3f8d61[_0x9272('0x3f')]);return db['Trigger']['find'](_0x42ffcb)[_0x9272('0x21')](handleEntityNotFound(_0x2120a3,null))[_0x9272('0x21')](respondWithResult(_0x2120a3,null))[_0x9272('0x46')](handleError(_0x2120a3,null));};exports['create']=function(_0x43ee1e,_0x333de6){return db[_0x9272('0x2a')][_0x9272('0x47')](_0x43ee1e['body'],{})[_0x9272('0x21')](function(_0x2037a3){var _0x26ccf4=_0x43ee1e['user']['get']({'plain':!![]});if(!_0x26ccf4)throw new Error(_0x9272('0x48'));if(_0x26ccf4[_0x9272('0x49')]===_0x9272('0x4a')){var _0x48a139=_0x2037a3[_0x9272('0x4b')]({'plain':!![]});var _0x4d28a1='Triggers';return db['UserProfileSection'][_0x9272('0x4c')]({'where':{'name':_0x4d28a1,'userProfileId':_0x26ccf4['userProfileId']},'raw':!![]})[_0x9272('0x21')](function(_0x2578e6){if(_0x2578e6&&_0x2578e6[_0x9272('0x4d')]===0x0){return db[_0x9272('0x23')][_0x9272('0x47')]({'name':_0x48a139[_0x9272('0x27')],'resourceId':_0x48a139['id'],'type':_0x2578e6[_0x9272('0x27')],'sectionId':_0x2578e6['id']},{})[_0x9272('0x21')](function(){return _0x2037a3;});}else{return _0x2037a3;}})['catch'](function(_0x52ce9e){logger[_0x9272('0x25')](_0x9272('0x4e'),_0x52ce9e);throw _0x52ce9e;});}return _0x2037a3;})[_0x9272('0x21')](respondWithResult(_0x333de6,0xc9))['catch'](handleError(_0x333de6,null));};exports['update']=function(_0x49aab1,_0x6d7835){if(_0x49aab1[_0x9272('0x4f')]['id']){delete _0x49aab1[_0x9272('0x4f')]['id'];}return db[_0x9272('0x2a')][_0x9272('0x4c')]({'where':{'id':_0x49aab1[_0x9272('0x45')]['id']}})['then'](handleEntityNotFound(_0x6d7835,null))[_0x9272('0x21')](saveUpdates(_0x49aab1[_0x9272('0x4f')],null))['then'](respondWithResult(_0x6d7835,null))[_0x9272('0x46')](handleError(_0x6d7835,null));};exports[_0x9272('0x22')]=function(_0x2c58ee,_0x61f74f){return db[_0x9272('0x2a')][_0x9272('0x4c')]({'where':{'id':_0x2c58ee[_0x9272('0x45')]['id']}})[_0x9272('0x21')](handleEntityNotFound(_0x61f74f,null))['then'](removeEntity(_0x61f74f,null))[_0x9272('0x46')](handleError(_0x61f74f,null));};exports['addAllCondition']=function(_0xcb14b8,_0x474b78,_0x358301){if(_0xcb14b8[_0x9272('0x4f')]['id']){delete _0xcb14b8[_0x9272('0x4f')]['id'];}return db[_0x9272('0x2a')][_0x9272('0x4c')]({'where':{'id':_0xcb14b8[_0x9272('0x45')]['id']}})[_0x9272('0x21')](handleEntityNotFound(_0x474b78,null))[_0x9272('0x21')](function(_0x36fefb){if(_0x36fefb){_0xcb14b8[_0x9272('0x4f')][_0x9272('0x50')]=_0x36fefb['id'];return db['Condition']['create'](_0xcb14b8[_0x9272('0x4f')]);}})['then'](respondWithResult(_0x474b78,null))[_0x9272('0x46')](handleError(_0x474b78,null));};exports['addAnyCondition']=function(_0x245cfd,_0x1685c5,_0x58dcff){if(_0x245cfd[_0x9272('0x4f')]['id']){delete _0x245cfd[_0x9272('0x4f')]['id'];}return db['Trigger']['find']({'where':{'id':_0x245cfd[_0x9272('0x45')]['id']}})['then'](handleEntityNotFound(_0x1685c5,null))[_0x9272('0x21')](function(_0x45bd94){if(_0x45bd94){_0x245cfd[_0x9272('0x4f')][_0x9272('0x51')]=_0x45bd94['id'];return db[_0x9272('0x52')][_0x9272('0x47')](_0x245cfd[_0x9272('0x4f')]);}})['then'](respondWithResult(_0x1685c5,null))[_0x9272('0x46')](handleError(_0x1685c5,null));};exports[_0x9272('0x53')]=function(_0x112431,_0x2bbdd8,_0x5152f8){var _0xad6cfe={};var _0x3fe104={};var _0x1ddb90;var _0x4a445c;return db['Trigger'][_0x9272('0x54')]({'where':{'id':_0x112431[_0x9272('0x45')]['id']}})[_0x9272('0x21')](handleEntityNotFound(_0x2bbdd8,null))['then'](function(_0x3957cc){if(_0x3957cc){_0x1ddb90=_0x3957cc;_0x3fe104[_0x9272('0x2e')]=_[_0x9272('0x30')](db[_0x9272('0x52')][_0x9272('0x2b')]);_0x3fe104[_0x9272('0x31')]=_[_0x9272('0x30')](_0x112431[_0x9272('0x31')]);_0x3fe104['filters']=_['intersection'](_0x3fe104[_0x9272('0x2e')],_0x3fe104[_0x9272('0x31')]);_0xad6cfe[_0x9272('0x34')]=_[_0x9272('0x33')](_0x3fe104['model'],qs[_0x9272('0x35')](_0x112431['query']['fields']));_0xad6cfe[_0x9272('0x34')]=_0xad6cfe['attributes'][_0x9272('0x36')]?_0xad6cfe[_0x9272('0x34')]:_0x3fe104['model'];_0xad6cfe[_0x9272('0x38')]=qs[_0x9272('0x39')](_0x112431[_0x9272('0x31')][_0x9272('0x39')]);_0xad6cfe[_0x9272('0x3b')]=qs[_0x9272('0x32')](_['pick'](_0x112431[_0x9272('0x31')],_0x3fe104[_0x9272('0x32')]));if(_0x112431[_0x9272('0x31')][_0x9272('0x3a')]){_0xad6cfe[_0x9272('0x3b')]=_[_0x9272('0x3c')](_0xad6cfe[_0x9272('0x3b')],{'$or':_['map'](_0xad6cfe[_0x9272('0x34')],function(_0x329324){var _0x1a6ebf={};_0x1a6ebf[_0x329324]={'$like':'%'+_0x112431['query'][_0x9272('0x3a')]+'%'};return _0x1a6ebf;})});}_0xad6cfe=_['merge']({},_0xad6cfe,_0x112431[_0x9272('0x3f')]);return _0x1ddb90['getAllConditions'](_0xad6cfe);}})[_0x9272('0x21')](function(_0x5132a9){if(_0x5132a9){_0x4a445c=_0x5132a9[_0x9272('0x36')];if(!_0x112431[_0x9272('0x31')]['hasOwnProperty'](_0x9272('0x55'))){_0xad6cfe[_0x9272('0x1d')]=qs[_0x9272('0x1d')](_0x112431['query'][_0x9272('0x1d')]);_0xad6cfe[_0x9272('0x1a')]=qs[_0x9272('0x1a')](_0x112431[_0x9272('0x31')][_0x9272('0x1a')]);}return _0x1ddb90[_0x9272('0x53')](_0xad6cfe);}})[_0x9272('0x21')](function(_0x3af6fe){if(_0x3af6fe){return _0x3af6fe?{'count':_0x4a445c,'rows':_0x3af6fe}:null;}})['then'](respondWithResult(_0x2bbdd8,null))['catch'](handleError(_0x2bbdd8,null));};exports['getAnyConditions']=function(_0x2fce97,_0x17b170,_0x5a6885){var _0xcfe6d0={};var _0x24d3ca={};var _0x2028e0;var _0x3bfa56;return db[_0x9272('0x2a')][_0x9272('0x54')]({'where':{'id':_0x2fce97[_0x9272('0x45')]['id']}})[_0x9272('0x21')](handleEntityNotFound(_0x17b170,null))['then'](function(_0xeb9fe6){if(_0xeb9fe6){_0x2028e0=_0xeb9fe6;_0x24d3ca[_0x9272('0x2e')]=_[_0x9272('0x30')](db[_0x9272('0x52')][_0x9272('0x2b')]);_0x24d3ca[_0x9272('0x31')]=_[_0x9272('0x30')](_0x2fce97[_0x9272('0x31')]);_0x24d3ca[_0x9272('0x32')]=_[_0x9272('0x33')](_0x24d3ca[_0x9272('0x2e')],_0x24d3ca[_0x9272('0x31')]);_0xcfe6d0[_0x9272('0x34')]=_[_0x9272('0x33')](_0x24d3ca[_0x9272('0x2e')],qs[_0x9272('0x35')](_0x2fce97[_0x9272('0x31')]['fields']));_0xcfe6d0['attributes']=_0xcfe6d0[_0x9272('0x34')][_0x9272('0x36')]?_0xcfe6d0[_0x9272('0x34')]:_0x24d3ca['model'];_0xcfe6d0[_0x9272('0x38')]=qs[_0x9272('0x39')](_0x2fce97[_0x9272('0x31')]['sort']);_0xcfe6d0['where']=qs[_0x9272('0x32')](_[_0x9272('0x56')](_0x2fce97['query'],_0x24d3ca[_0x9272('0x32')]));if(_0x2fce97[_0x9272('0x31')][_0x9272('0x3a')]){_0xcfe6d0['where']=_[_0x9272('0x3c')](_0xcfe6d0['where'],{'$or':_[_0x9272('0x2f')](_0xcfe6d0['attributes'],function(_0x313faa){var _0x3521b0={};_0x3521b0[_0x313faa]={'$like':'%'+_0x2fce97[_0x9272('0x31')][_0x9272('0x3a')]+'%'};return _0x3521b0;})});}_0xcfe6d0=_[_0x9272('0x3c')]({},_0xcfe6d0,_0x2fce97[_0x9272('0x3f')]);return _0x2028e0['getAnyConditions'](_0xcfe6d0);}})[_0x9272('0x21')](function(_0x164040){if(_0x164040){_0x3bfa56=_0x164040['length'];if(!_0x2fce97[_0x9272('0x31')]['hasOwnProperty'](_0x9272('0x55'))){_0xcfe6d0[_0x9272('0x1d')]=qs[_0x9272('0x1d')](_0x2fce97[_0x9272('0x31')][_0x9272('0x1d')]);_0xcfe6d0['offset']=qs[_0x9272('0x1a')](_0x2fce97[_0x9272('0x31')][_0x9272('0x1a')]);}return _0x2028e0[_0x9272('0x57')](_0xcfe6d0);}})['then'](function(_0x480b75){if(_0x480b75){return _0x480b75?{'count':_0x3bfa56,'rows':_0x480b75}:null;}})[_0x9272('0x21')](respondWithResult(_0x17b170,null))[_0x9272('0x46')](handleError(_0x17b170,null));};exports[_0x9272('0x58')]=function(_0x3254f0,_0x4b4f61,_0x50b718){if(_0x3254f0['body']['id']){delete _0x3254f0['body']['id'];}return db[_0x9272('0x2a')][_0x9272('0x4c')]({'where':{'id':_0x3254f0[_0x9272('0x45')]['id']}})[_0x9272('0x21')](handleEntityNotFound(_0x4b4f61,null))['then'](function(_0x3717a7){if(_0x3717a7){_0x3254f0[_0x9272('0x4f')][_0x9272('0x59')]=_0x3717a7['id'];return db[_0x9272('0x5a')]['create'](_0x3254f0[_0x9272('0x4f')]);}})[_0x9272('0x21')](respondWithResult(_0x4b4f61,null))[_0x9272('0x46')](handleError(_0x4b4f61,null));};exports[_0x9272('0x5b')]=function(_0x3681ce,_0x44b553,_0x3cbe20){var _0x257211={};var _0x355c75={};var _0x487d50;var _0x254ddc;return db[_0x9272('0x2a')][_0x9272('0x54')]({'where':{'id':_0x3681ce[_0x9272('0x45')]['id']}})[_0x9272('0x21')](handleEntityNotFound(_0x44b553,null))[_0x9272('0x21')](function(_0x311638){if(_0x311638){_0x487d50=_0x311638;_0x355c75[_0x9272('0x2e')]=_[_0x9272('0x30')](db[_0x9272('0x5a')][_0x9272('0x2b')]);_0x355c75['query']=_['keys'](_0x3681ce[_0x9272('0x31')]);_0x355c75[_0x9272('0x32')]=_[_0x9272('0x33')](_0x355c75['model'],_0x355c75[_0x9272('0x31')]);_0x257211[_0x9272('0x34')]=_['intersection'](_0x355c75['model'],qs[_0x9272('0x35')](_0x3681ce[_0x9272('0x31')][_0x9272('0x35')]));_0x257211['attributes']=_0x257211[_0x9272('0x34')]['length']?_0x257211[_0x9272('0x34')]:_0x355c75[_0x9272('0x2e')];_0x257211[_0x9272('0x38')]=qs[_0x9272('0x39')](_0x3681ce['query']['sort']);_0x257211['where']=qs[_0x9272('0x32')](_[_0x9272('0x56')](_0x3681ce[_0x9272('0x31')],_0x355c75[_0x9272('0x32')]));if(_0x3681ce['query'][_0x9272('0x3a')]){_0x257211[_0x9272('0x3b')]=_[_0x9272('0x3c')](_0x257211[_0x9272('0x3b')],{'$or':_[_0x9272('0x2f')](_0x257211[_0x9272('0x34')],function(_0xa55aa7){var _0x2f8021={};_0x2f8021[_0xa55aa7]={'$like':'%'+_0x3681ce[_0x9272('0x31')][_0x9272('0x3a')]+'%'};return _0x2f8021;})});}_0x257211=_[_0x9272('0x3c')]({},_0x257211,_0x3681ce[_0x9272('0x3f')]);return _0x487d50[_0x9272('0x5b')](_0x257211);}})[_0x9272('0x21')](function(_0xc47efa){if(_0xc47efa){_0x254ddc=_0xc47efa[_0x9272('0x36')];if(!_0x3681ce[_0x9272('0x31')][_0x9272('0x37')](_0x9272('0x55'))){_0x257211[_0x9272('0x1d')]=qs[_0x9272('0x1d')](_0x3681ce[_0x9272('0x31')][_0x9272('0x1d')]);_0x257211['offset']=qs[_0x9272('0x1a')](_0x3681ce[_0x9272('0x31')]['offset']);}return _0x487d50[_0x9272('0x5b')](_0x257211);}})[_0x9272('0x21')](function(_0x2aecf5){if(_0x2aecf5){return _0x2aecf5?{'count':_0x254ddc,'rows':_0x2aecf5}:null;}})[_0x9272('0x21')](respondWithResult(_0x44b553,null))[_0x9272('0x46')](handleError(_0x44b553,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index f752b40..9ccb127 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 _0x4a25=['path','../../config/environment','./trigger.attributes','exports','Trigger','tools_triggers','lodash','../../config/logger','moment','bluebird','request-promise'];(function(_0x280f4a,_0x2ed8d6){var _0x1bb157=function(_0x37de94){while(--_0x37de94){_0x280f4a['push'](_0x280f4a['shift']());}};_0x1bb157(++_0x2ed8d6);}(_0x4a25,0x1d4));var _0x54a2=function(_0x71e493,_0x4308b7){_0x71e493=_0x71e493-0x0;var _0x3d40ab=_0x4a25[_0x71e493];return _0x3d40ab;};'use strict';var _=require(_0x54a2('0x0'));var util=require('util');var logger=require(_0x54a2('0x1'))('api');var moment=require(_0x54a2('0x2'));var BPromise=require(_0x54a2('0x3'));var rp=require(_0x54a2('0x4'));var fs=require('fs');var path=require(_0x54a2('0x5'));var rimraf=require('rimraf');var config=require(_0x54a2('0x6'));var attributes=require(_0x54a2('0x7'));module[_0x54a2('0x8')]=function(_0x3ecde5,_0x472eed){return _0x3ecde5['define'](_0x54a2('0x9'),attributes,{'tableName':_0x54a2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbc8d=['moment','bluebird','path','rimraf','../../config/environment','exports','Trigger','lodash','../../config/logger','api'];(function(_0x45b1ba,_0x5a6a21){var _0x145ddb=function(_0x650d42){while(--_0x650d42){_0x45b1ba['push'](_0x45b1ba['shift']());}};_0x145ddb(++_0x5a6a21);}(_0xbc8d,0x15b));var _0xdbc8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbc8d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xdbc8('0x0'));var util=require('util');var logger=require(_0xdbc8('0x1'))(_0xdbc8('0x2'));var moment=require(_0xdbc8('0x3'));var BPromise=require(_0xdbc8('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdbc8('0x5'));var rimraf=require(_0xdbc8('0x6'));var config=require(_0xdbc8('0x7'));var attributes=require('./trigger.attributes');module[_0xdbc8('0x8')]=function(_0x10ede0,_0x3ee39d){return _0x10ede0['define'](_0xdbc8('0x9'),attributes,{'tableName':'tools_triggers','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 215b24d..ef8d741 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 _0xf9c2=['http','request','then','info','request\x20sent','stringify','error','code','Trigger,\x20%s,\x20%s','message','result','catch','findAll','options','where','attributes','include','model','map','GetTrigger','debug','ShowTrigger','Trigger','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x10aa73,_0xc744f4){var _0x3496d9=function(_0x71c780){while(--_0x71c780){_0x10aa73['push'](_0x10aa73['shift']());}};_0x3496d9(++_0xc744f4);}(_0xf9c2,0xcc));var _0x2f9c=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xf9c2[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x2f9c('0x0'));var util=require(_0x2f9c('0x1'));var moment=require(_0x2f9c('0x2'));var BPromise=require(_0x2f9c('0x3'));var rs=require(_0x2f9c('0x4'));var fs=require('fs');var Redis=require(_0x2f9c('0x5'));var db=require(_0x2f9c('0x6'))['db'];var utils=require(_0x2f9c('0x7'));var logger=require(_0x2f9c('0x8'))(_0x2f9c('0x9'));var config=require(_0x2f9c('0xa'));var jayson=require(_0x2f9c('0xb'));var client=jayson['client'][_0x2f9c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x35b1da,_0x584b0d,_0xa8b904){return new BPromise(function(_0x1c65ce,_0x2fb8f9){return client[_0x2f9c('0xd')](_0x35b1da,_0xa8b904)[_0x2f9c('0xe')](function(_0x308796){logger[_0x2f9c('0xf')]('Trigger,\x20%s,\x20%s',_0x584b0d,_0x2f9c('0x10'));logger['debug']('Trigger,\x20%s,\x20%s,\x20%s',_0x584b0d,_0x2f9c('0x10'),JSON[_0x2f9c('0x11')](_0x308796));if(_0x308796['error']){if(_0x308796[_0x2f9c('0x12')][_0x2f9c('0x13')]===0x1f4){logger[_0x2f9c('0x12')](_0x2f9c('0x14'),_0x584b0d,_0x308796[_0x2f9c('0x12')]['message']);return _0x2fb8f9(_0x308796[_0x2f9c('0x12')][_0x2f9c('0x15')]);}logger[_0x2f9c('0x12')](_0x2f9c('0x14'),_0x584b0d,_0x308796[_0x2f9c('0x12')]['message']);return _0x1c65ce(_0x308796['error']['message']);}else{logger['info'](_0x2f9c('0x14'),_0x584b0d,_0x2f9c('0x10'));_0x1c65ce(_0x308796[_0x2f9c('0x16')][_0x2f9c('0x15')]);}})[_0x2f9c('0x17')](function(_0x1e2503){logger[_0x2f9c('0x12')](_0x2f9c('0x14'),_0x584b0d,_0x1e2503);_0x2fb8f9(_0x1e2503);});});}exports['GetTrigger']=function(_0x157ef1){var _0x147dbe=this;return new Promise(function(_0x5c2397,_0x9b983b){return db['Trigger'][_0x2f9c('0x18')]({'raw':_0x157ef1['options']?_0x157ef1[_0x2f9c('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x157ef1[_0x2f9c('0x19')]?_0x157ef1['options'][_0x2f9c('0x1a')]||null:null,'attributes':_0x157ef1[_0x2f9c('0x19')]?_0x157ef1[_0x2f9c('0x19')][_0x2f9c('0x1b')]||null:null,'limit':_0x157ef1['options']?_0x157ef1['options']['limit']||null:null,'include':_0x157ef1[_0x2f9c('0x19')]?_0x157ef1[_0x2f9c('0x19')][_0x2f9c('0x1c')]?_['map'](_0x157ef1[_0x2f9c('0x19')][_0x2f9c('0x1c')],function(_0x43aae6){return{'model':db[_0x43aae6[_0x2f9c('0x1d')]],'as':_0x43aae6['as'],'attributes':_0x43aae6[_0x2f9c('0x1b')],'include':_0x43aae6[_0x2f9c('0x1c')]?_['map'](_0x43aae6[_0x2f9c('0x1c')],function(_0x507918){return{'model':db[_0x507918[_0x2f9c('0x1d')]],'as':_0x507918['as'],'attributes':_0x507918['attributes'],'include':_0x507918['include']?_[_0x2f9c('0x1e')](_0x507918[_0x2f9c('0x1c')],function(_0x5ab900){return{'model':db[_0x5ab900['model']],'as':_0x5ab900['as'],'attributes':_0x5ab900[_0x2f9c('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x2f9c('0xe')](function(_0x14bdea){logger['info'](_0x2f9c('0x1f'),_0x157ef1);logger[_0x2f9c('0x20')](_0x2f9c('0x1f'),_0x157ef1,JSON['stringify'](_0x14bdea));_0x5c2397(_0x14bdea);})[_0x2f9c('0x17')](function(_0x42dec8){logger[_0x2f9c('0x12')](_0x2f9c('0x1f'),_0x42dec8[_0x2f9c('0x15')],_0x157ef1);_0x9b983b(_0x147dbe['error'](0x1f4,_0x42dec8[_0x2f9c('0x15')]));});});};exports[_0x2f9c('0x21')]=function(_0x33201c){var _0x58eff6=this;return new Promise(function(_0x1e93a5,_0x3f8b9d){return db[_0x2f9c('0x22')]['find']({'raw':_0x33201c[_0x2f9c('0x19')]?_0x33201c['options'][_0x2f9c('0x23')]===undefined?!![]:![]:!![],'where':_0x33201c['options']?_0x33201c[_0x2f9c('0x19')][_0x2f9c('0x1a')]||null:null,'attributes':_0x33201c[_0x2f9c('0x19')]?_0x33201c[_0x2f9c('0x19')][_0x2f9c('0x1b')]||null:null,'include':_0x33201c[_0x2f9c('0x19')]?_0x33201c[_0x2f9c('0x19')][_0x2f9c('0x1c')]?_[_0x2f9c('0x1e')](_0x33201c[_0x2f9c('0x19')]['include'],function(_0x89f093){return{'model':db[_0x89f093[_0x2f9c('0x1d')]],'as':_0x89f093['as'],'attributes':_0x89f093[_0x2f9c('0x1b')],'include':_0x89f093[_0x2f9c('0x1c')]?_[_0x2f9c('0x1e')](_0x89f093[_0x2f9c('0x1c')],function(_0x30a32f){return{'model':db[_0x30a32f[_0x2f9c('0x1d')]],'as':_0x30a32f['as'],'attributes':_0x30a32f[_0x2f9c('0x1b')],'include':_0x30a32f[_0x2f9c('0x1c')]?_[_0x2f9c('0x1e')](_0x30a32f[_0x2f9c('0x1c')],function(_0x26dd98){return{'model':db[_0x26dd98[_0x2f9c('0x1d')]],'as':_0x26dd98['as'],'attributes':_0x26dd98[_0x2f9c('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3a01dd){logger[_0x2f9c('0xf')](_0x2f9c('0x21'),_0x33201c);logger[_0x2f9c('0x20')](_0x2f9c('0x21'),_0x33201c,JSON[_0x2f9c('0x11')](_0x3a01dd));_0x1e93a5(_0x3a01dd);})[_0x2f9c('0x17')](function(_0x30c40c){logger[_0x2f9c('0x12')](_0x2f9c('0x21'),_0x30c40c[_0x2f9c('0x15')],_0x33201c);_0x3f8b9d(_0x58eff6[_0x2f9c('0x12')](0x1f4,_0x30c40c['message']));});});}; \ No newline at end of file +var _0x05ae=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','Trigger,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','GetTrigger','Trigger','findAll','options','where','attributes','limit','include','map','model','debug','stringify','ShowTrigger','find','lodash','bluebird','randomstring','../../mysqldb'];(function(_0x4382dd,_0x2b30f2){var _0x53a9ed=function(_0x114563){while(--_0x114563){_0x4382dd['push'](_0x4382dd['shift']());}};_0x53a9ed(++_0x2b30f2);}(_0x05ae,0x150));var _0xe05a=function(_0x22e577,_0x59400d){_0x22e577=_0x22e577-0x0;var _0x2e9fb1=_0x05ae[_0x22e577];return _0x2e9fb1;};'use strict';var _=require(_0xe05a('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xe05a('0x1'));var rs=require(_0xe05a('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe05a('0x3'))['db'];var utils=require(_0xe05a('0x4'));var logger=require(_0xe05a('0x5'))(_0xe05a('0x6'));var config=require(_0xe05a('0x7'));var jayson=require(_0xe05a('0x8'));var client=jayson[_0xe05a('0x9')][_0xe05a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xc627a0,_0x5a4b0b,_0x2c071e){return new BPromise(function(_0x4dc1df,_0x364737){return client['request'](_0xc627a0,_0x2c071e)[_0xe05a('0xb')](function(_0x1e8019){logger[_0xe05a('0xc')](_0xe05a('0xd'),_0x5a4b0b,_0xe05a('0xe'));logger['debug']('Trigger,\x20%s,\x20%s,\x20%s',_0x5a4b0b,_0xe05a('0xe'),JSON['stringify'](_0x1e8019));if(_0x1e8019['error']){if(_0x1e8019[_0xe05a('0xf')][_0xe05a('0x10')]===0x1f4){logger[_0xe05a('0xf')](_0xe05a('0xd'),_0x5a4b0b,_0x1e8019[_0xe05a('0xf')][_0xe05a('0x11')]);return _0x364737(_0x1e8019[_0xe05a('0xf')][_0xe05a('0x11')]);}logger[_0xe05a('0xf')](_0xe05a('0xd'),_0x5a4b0b,_0x1e8019[_0xe05a('0xf')]['message']);return _0x4dc1df(_0x1e8019[_0xe05a('0xf')][_0xe05a('0x11')]);}else{logger[_0xe05a('0xc')](_0xe05a('0xd'),_0x5a4b0b,'request\x20sent');_0x4dc1df(_0x1e8019[_0xe05a('0x12')][_0xe05a('0x11')]);}})[_0xe05a('0x13')](function(_0x107e9d){logger[_0xe05a('0xf')](_0xe05a('0xd'),_0x5a4b0b,_0x107e9d);_0x364737(_0x107e9d);});});}exports[_0xe05a('0x14')]=function(_0x563cfa){var _0x4a2cae=this;return new Promise(function(_0x3cd9a7,_0x334e82){return db[_0xe05a('0x15')][_0xe05a('0x16')]({'raw':_0x563cfa[_0xe05a('0x17')]?_0x563cfa[_0xe05a('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x563cfa['options']?_0x563cfa['options'][_0xe05a('0x18')]||null:null,'attributes':_0x563cfa[_0xe05a('0x17')]?_0x563cfa['options'][_0xe05a('0x19')]||null:null,'limit':_0x563cfa[_0xe05a('0x17')]?_0x563cfa[_0xe05a('0x17')][_0xe05a('0x1a')]||null:null,'include':_0x563cfa[_0xe05a('0x17')]?_0x563cfa['options'][_0xe05a('0x1b')]?_[_0xe05a('0x1c')](_0x563cfa['options']['include'],function(_0x1c43df){return{'model':db[_0x1c43df[_0xe05a('0x1d')]],'as':_0x1c43df['as'],'attributes':_0x1c43df['attributes'],'include':_0x1c43df[_0xe05a('0x1b')]?_['map'](_0x1c43df[_0xe05a('0x1b')],function(_0x576573){return{'model':db[_0x576573[_0xe05a('0x1d')]],'as':_0x576573['as'],'attributes':_0x576573[_0xe05a('0x19')],'include':_0x576573[_0xe05a('0x1b')]?_[_0xe05a('0x1c')](_0x576573[_0xe05a('0x1b')],function(_0x2e1e21){return{'model':db[_0x2e1e21[_0xe05a('0x1d')]],'as':_0x2e1e21['as'],'attributes':_0x2e1e21['attributes']};}):[]};}):[]};}):[]:[]})[_0xe05a('0xb')](function(_0x34ac98){logger[_0xe05a('0xc')](_0xe05a('0x14'),_0x563cfa);logger[_0xe05a('0x1e')](_0xe05a('0x14'),_0x563cfa,JSON[_0xe05a('0x1f')](_0x34ac98));_0x3cd9a7(_0x34ac98);})['catch'](function(_0x1b6614){logger[_0xe05a('0xf')](_0xe05a('0x14'),_0x1b6614[_0xe05a('0x11')],_0x563cfa);_0x334e82(_0x4a2cae['error'](0x1f4,_0x1b6614[_0xe05a('0x11')]));});});};exports[_0xe05a('0x20')]=function(_0x5768f0){var _0x253794=this;return new Promise(function(_0x334502,_0x336ca8){return db[_0xe05a('0x15')][_0xe05a('0x21')]({'raw':_0x5768f0[_0xe05a('0x17')]?_0x5768f0['options']['raw']===undefined?!![]:![]:!![],'where':_0x5768f0[_0xe05a('0x17')]?_0x5768f0[_0xe05a('0x17')]['where']||null:null,'attributes':_0x5768f0[_0xe05a('0x17')]?_0x5768f0[_0xe05a('0x17')][_0xe05a('0x19')]||null:null,'include':_0x5768f0['options']?_0x5768f0['options'][_0xe05a('0x1b')]?_['map'](_0x5768f0['options'][_0xe05a('0x1b')],function(_0xbe7977){return{'model':db[_0xbe7977['model']],'as':_0xbe7977['as'],'attributes':_0xbe7977[_0xe05a('0x19')],'include':_0xbe7977['include']?_[_0xe05a('0x1c')](_0xbe7977[_0xe05a('0x1b')],function(_0x69aa4a){return{'model':db[_0x69aa4a[_0xe05a('0x1d')]],'as':_0x69aa4a['as'],'attributes':_0x69aa4a['attributes'],'include':_0x69aa4a['include']?_['map'](_0x69aa4a[_0xe05a('0x1b')],function(_0xcef624){return{'model':db[_0xcef624['model']],'as':_0xcef624['as'],'attributes':_0xcef624[_0xe05a('0x19')]};}):[]};}):[]};}):[]:[]})[_0xe05a('0xb')](function(_0x2dd392){logger[_0xe05a('0xc')](_0xe05a('0x20'),_0x5768f0);logger[_0xe05a('0x1e')](_0xe05a('0x20'),_0x5768f0,JSON[_0xe05a('0x1f')](_0x2dd392));_0x334502(_0x2dd392);})['catch'](function(_0x334df9){logger['error'](_0xe05a('0x20'),_0x334df9[_0xe05a('0x11')],_0x5768f0);_0x336ca8(_0x253794[_0xe05a('0xf')](0x1f4,_0x334df9['message']));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index eaeeff9..30eec30 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 _0xb7ff=['post','/:id/clone','clone','create','put','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./trunk.controller','get','isAuthenticated','index','/:id'];(function(_0xd35dfe,_0x2f4036){var _0xa3c281=function(_0x18212d){while(--_0x18212d){_0xd35dfe['push'](_0xd35dfe['shift']());}};_0xa3c281(++_0x2f4036);}(_0xb7ff,0x142));var _0xfb7f=function(_0x3d72b3,_0x2a68e7){_0x3d72b3=_0x3d72b3-0x0;var _0x4588d7=_0xb7ff[_0x3d72b3];return _0x4588d7;};'use strict';var multer=require(_0xfb7f('0x0'));var util=require(_0xfb7f('0x1'));var path=require(_0xfb7f('0x2'));var timeout=require(_0xfb7f('0x3'));var express=require(_0xfb7f('0x4'));var router=express[_0xfb7f('0x5')]();var fs_extra=require(_0xfb7f('0x6'));var auth=require(_0xfb7f('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xfb7f('0x8'));var controller=require(_0xfb7f('0x9'));router[_0xfb7f('0xa')]('/',auth[_0xfb7f('0xb')](),controller[_0xfb7f('0xc')]);router[_0xfb7f('0xa')](_0xfb7f('0xd'),auth[_0xfb7f('0xb')](),controller['show']);router[_0xfb7f('0xe')](_0xfb7f('0xf'),auth[_0xfb7f('0xb')](),controller[_0xfb7f('0x10')]);router['post']('/',auth[_0xfb7f('0xb')](),controller[_0xfb7f('0x11')]);router[_0xfb7f('0x12')]('/:id',auth[_0xfb7f('0xb')](),controller['update']);router['delete'](_0xfb7f('0xd'),auth[_0xfb7f('0xb')](),controller[_0xfb7f('0x13')]);module[_0xfb7f('0x14')]=router; \ No newline at end of file +var _0x2fc1=['/:id','show','post','/:id/clone','clone','create','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./trunk.controller','isAuthenticated','index'];(function(_0x1a755b,_0x74d6fc){var _0x242e19=function(_0x500cf7){while(--_0x500cf7){_0x1a755b['push'](_0x1a755b['shift']());}};_0x242e19(++_0x74d6fc);}(_0x2fc1,0x130));var _0x12fc=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x2fc1[_0x17d9e3];return _0x14192d;};'use strict';var multer=require(_0x12fc('0x0'));var util=require(_0x12fc('0x1'));var path=require(_0x12fc('0x2'));var timeout=require(_0x12fc('0x3'));var express=require('express');var router=express[_0x12fc('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x12fc('0x5'));var interaction=require(_0x12fc('0x6'));var config=require(_0x12fc('0x7'));var controller=require(_0x12fc('0x8'));router['get']('/',auth[_0x12fc('0x9')](),controller[_0x12fc('0xa')]);router['get'](_0x12fc('0xb'),auth[_0x12fc('0x9')](),controller[_0x12fc('0xc')]);router[_0x12fc('0xd')](_0x12fc('0xe'),auth['isAuthenticated'](),controller[_0x12fc('0xf')]);router[_0x12fc('0xd')]('/',auth[_0x12fc('0x9')](),controller[_0x12fc('0x10')]);router['put'](_0x12fc('0xb'),auth['isAuthenticated'](),controller[_0x12fc('0x11')]);router[_0x12fc('0x12')](_0x12fc('0xb'),auth[_0x12fc('0x9')](),controller[_0x12fc('0x13')]);module[_0x12fc('0x14')]=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index 4b26bc5..29fb234 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 _0x9c7d=['allow','insecure','never','\x22\x22\x20<>','INTEGER','refuse','originate','uas','fingerprint','certificate','active','actpass','dynamic','update','update,nonat','BOOLEAN','exports','name','ENUM','friend','user','from-voip-provider','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_FAILED_SCREEN','PROHIB','STRING','udp','setDataValue','transport','join','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','nonat','outgoing','yes','force_rport,comedia','getDataValue','nat','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm'];(function(_0x470886,_0x47b767){var _0x13619b=function(_0x141f54){while(--_0x141f54){_0x470886['push'](_0x470886['shift']());}};_0x13619b(++_0x47b767);}(_0x9c7d,0xfb));var _0xd9c7=function(_0x24fa1a,_0x16d9c2){_0x24fa1a=_0x24fa1a-0x0;var _0xc5621f=_0x9c7d[_0x24fa1a];return _0xc5621f;};'use strict';var Sequelize=require('sequelize');module[_0xd9c7('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xd9c7('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xd9c7('0x2')](_0xd9c7('0x3'),_0xd9c7('0x4'),'peer'),'allowNull':![],'defaultValue':_0xd9c7('0x3')},'context':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xd9c7('0x5')},'callingpres':{'type':Sequelize[_0xd9c7('0x2')]('ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN',_0xd9c7('0x6'),_0xd9c7('0x7'),'PROHIB_PASSED_SCREEN',_0xd9c7('0x8'),_0xd9c7('0x9'))},'deny':{'type':Sequelize[_0xd9c7('0xa')]},'permit':{'type':Sequelize[_0xd9c7('0xa')]},'secret':{'type':Sequelize[_0xd9c7('0xa')]},'md5secret':{'type':Sequelize[_0xd9c7('0xa')]},'remotesecret':{'type':Sequelize[_0xd9c7('0xa')]},'transport':{'type':Sequelize[_0xd9c7('0xa')],'defaultValue':_0xd9c7('0xb'),'set':function(_0xc25ef9){this[_0xd9c7('0xc')](_0xd9c7('0xd'),_0xc25ef9?_0xc25ef9[_0xd9c7('0xe')](','):null);},'get':function(){return this['getDataValue'](_0xd9c7('0xd'))?this['getDataValue'](_0xd9c7('0xd'))['split'](','):null;},'comment':_0xd9c7('0xf')},'dtmfmode':{'type':Sequelize[_0xd9c7('0x2')](_0xd9c7('0x10'),_0xd9c7('0x11'),_0xd9c7('0x12'),_0xd9c7('0x13'),_0xd9c7('0x14')),'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0xd9c7('0x2')]('yes','no',_0xd9c7('0x15'),'update',_0xd9c7('0x16')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xd9c7('0x2')](_0xd9c7('0x17'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xd9c7('0xa')]},'directmediadeny':{'type':Sequelize[_0xd9c7('0xa')]},'nat':{'type':Sequelize[_0xd9c7('0xa')],'defaultValue':_0xd9c7('0x18'),'set':function(_0x2dc55a){this['setDataValue']('nat',_0x2dc55a?_0x2dc55a[_0xd9c7('0xe')](','):null);},'get':function(){return this[_0xd9c7('0x19')](_0xd9c7('0x1a'))?this[_0xd9c7('0x19')](_0xd9c7('0x1a'))[_0xd9c7('0x1b')](','):null;},'comment':_0xd9c7('0x1c')},'callgroup':{'type':Sequelize[_0xd9c7('0xa')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize[_0xd9c7('0xa')]},'language':{'type':Sequelize[_0xd9c7('0xa')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING'],'allowNull':!![]},'disallow':{'type':Sequelize['STRING'],'defaultValue':_0xd9c7('0x1d')},'allow':{'type':Sequelize[_0xd9c7('0xa')],'allowNull':![],'defaultValue':_0xd9c7('0x1e'),'set':function(_0x358caa){this[_0xd9c7('0xc')]('allow',_0x358caa?_0x358caa[_0xd9c7('0xe')](';'):_0xd9c7('0x1e'));},'get':function(){return this[_0xd9c7('0x19')](_0xd9c7('0x1f'))?this[_0xd9c7('0x19')](_0xd9c7('0x1f'))[_0xd9c7('0x1b')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]'},'autoframing':{'type':Sequelize['ENUM'](_0xd9c7('0x17'),'no')},'insecure':{'type':Sequelize['STRING'],'defaultValue':'port,invite','set':function(_0x2be692){this[_0xd9c7('0xc')](_0xd9c7('0x20'),_0x2be692?_0x2be692[_0xd9c7('0xe')](','):null);},'get':function(){return this[_0xd9c7('0x19')]('insecure')?this[_0xd9c7('0x19')]('insecure')[_0xd9c7('0x1b')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize['ENUM'](_0xd9c7('0x17'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xd9c7('0x2')]('yes','no',_0xd9c7('0x21'))},'promiscredir':{'type':Sequelize[_0xd9c7('0x2')](_0xd9c7('0x17'),'no')},'useclientcode':{'type':Sequelize[_0xd9c7('0x2')](_0xd9c7('0x17'),'no')},'accountcode':{'type':Sequelize['INTEGER'](0xb)},'setvar':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize['STRING'],'defaultValue':_0xd9c7('0x22')},'amaflags':{'type':Sequelize[_0xd9c7('0xa')]},'callcounter':{'type':Sequelize['ENUM'](_0xd9c7('0x17'),'no'),'defaultValue':_0xd9c7('0x17')},'busylevel':{'type':Sequelize[_0xd9c7('0x23')](0xb)},'allowoverlap':{'type':Sequelize[_0xd9c7('0x2')](_0xd9c7('0x17'),'no')},'allowsubscribe':{'type':Sequelize[_0xd9c7('0x2')](_0xd9c7('0x17'),'no')},'allowtransfer':{'type':Sequelize[_0xd9c7('0x2')](_0xd9c7('0x17'),'no')},'ignoresdpversion':{'type':Sequelize['ENUM'](_0xd9c7('0x17'),'no')},'subscribecontext':{'type':Sequelize[_0xd9c7('0xa')]},'template':{'type':Sequelize[_0xd9c7('0xa')]},'videosupport':{'type':Sequelize[_0xd9c7('0x2')](_0xd9c7('0x17'),'no','always'),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xd9c7('0x23')](0xb)},'rfc2833compensate':{'type':Sequelize[_0xd9c7('0x2')](_0xd9c7('0x17'),'no')},'mailbox':{'type':Sequelize[_0xd9c7('0xa')]},'session_timers':{'type':Sequelize['ENUM']('accept',_0xd9c7('0x24'),_0xd9c7('0x25'))},'session_expires':{'type':Sequelize[_0xd9c7('0x23')](0xb)},'session_minse':{'type':Sequelize[_0xd9c7('0x23')](0xb)},'session_refresher':{'type':Sequelize['ENUM']('uac',_0xd9c7('0x26')),'defaultValue':_0xd9c7('0x26')},'t38pt_usertpsource':{'type':Sequelize[_0xd9c7('0xa')]},'regexten':{'type':Sequelize[_0xd9c7('0xa')]},'fromdomain':{'type':Sequelize[_0xd9c7('0xa')]},'fromuser':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0xd9c7('0x23')](0x5)},'qualify':{'type':Sequelize['ENUM'](_0xd9c7('0x17'),'no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0xd9c7('0x23')](0xb)},'defaultip':{'type':Sequelize['STRING']},'defaultuser':{'type':Sequelize['STRING']},'rtptimeout':{'type':Sequelize[_0xd9c7('0x23')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0xd9c7('0x23')](0xb)},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb)},'sendrpid':{'type':Sequelize[_0xd9c7('0x2')](_0xd9c7('0x17'),'no','pai'),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xd9c7('0xa')]},'callbackextension':{'type':Sequelize['STRING']},'timert1':{'type':Sequelize[_0xd9c7('0x23')](0xb)},'timerb':{'type':Sequelize[_0xd9c7('0x23')](0xb)},'qualifyfreq':{'type':Sequelize[_0xd9c7('0x23')](0xb)},'contactpermit':{'type':Sequelize[_0xd9c7('0xa')]},'contactdeny':{'type':Sequelize[_0xd9c7('0xa')]},'contactacl':{'type':Sequelize[_0xd9c7('0xa')]},'unsolicited_mailbox':{'type':Sequelize[_0xd9c7('0xa')]},'use_q850_reason':{'type':Sequelize[_0xd9c7('0xa')]},'maxforwards':{'type':Sequelize['INTEGER'](0xb)},'encryption':{'type':Sequelize[_0xd9c7('0x2')](_0xd9c7('0x17'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0xd9c7('0x2')](_0xd9c7('0x17'),'no')},'force_avp':{'type':Sequelize[_0xd9c7('0x2')](_0xd9c7('0x17'),'no')},'icesupport':{'type':Sequelize[_0xd9c7('0x2')](_0xd9c7('0x17'),'no')},'dtlsenable':{'type':Sequelize['ENUM'](_0xd9c7('0x17'),'no')},'dtlsverify':{'type':Sequelize[_0xd9c7('0x2')](_0xd9c7('0x17'),'no',_0xd9c7('0x27'),_0xd9c7('0x28'))},'dtlsrekey':{'type':Sequelize[_0xd9c7('0x23')](0xb)},'dtlscertfile':{'type':Sequelize[_0xd9c7('0xa')]},'dtlsprivatekey':{'type':Sequelize[_0xd9c7('0xa')]},'dtlscipher':{'type':Sequelize[_0xd9c7('0xa')]},'dtlscafile':{'type':Sequelize[_0xd9c7('0xa')]},'dtlscapath':{'type':Sequelize['STRING']},'dtlssetup':{'type':Sequelize[_0xd9c7('0x2')](_0xd9c7('0x29'),'passive',_0xd9c7('0x2a')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xd9c7('0xa')]},'usereqphone':{'type':Sequelize['ENUM'](_0xd9c7('0x17'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING']},'recordofffeature':{'type':Sequelize[_0xd9c7('0xa')]},'call_limit':{'type':Sequelize[_0xd9c7('0x23')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0xd9c7('0x2')]('yes','no')},'subscribemwi':{'type':Sequelize[_0xd9c7('0x2')](_0xd9c7('0x17'),'no')},'vmexten':{'type':Sequelize[_0xd9c7('0xa')]},'mohinterpret':{'type':Sequelize[_0xd9c7('0xa')]},'mohsuggest':{'type':Sequelize[_0xd9c7('0xa')]},'parkinglot':{'type':Sequelize[_0xd9c7('0xa')]},'description':{'type':Sequelize[_0xd9c7('0xa')]},'host':{'type':Sequelize[_0xd9c7('0xa')],'defaultValue':_0xd9c7('0x2b')},'canreinvite':{'type':Sequelize[_0xd9c7('0x2')](_0xd9c7('0x17'),'no',_0xd9c7('0x15'),_0xd9c7('0x2c'),_0xd9c7('0x2d')),'defaultValue':'no'},'registry':{'type':Sequelize[_0xd9c7('0xa')]},'otherFields':{'type':Sequelize[_0xd9c7('0xa')]},'active':{'type':Sequelize[_0xd9c7('0x2e')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize['STRING'],'defaultValue':'no'}}; \ No newline at end of file +var _0x3975=['fingerprint','active','passive','actpass','dynamic','sequelize','STRING','name','ENUM','friend','user','peer','from-voip-provider','ALLOWED_PASSED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_FAILED_SCREEN','PROHIB','udp','setDataValue','join','getDataValue','transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','inband','auto','yes','nonat','update','outgoing','force_rport,comedia','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','INTEGER','\x22\x22\x20<>','always','refuse','originate','uac','uas','pai'];(function(_0x174b3e,_0x46faae){var _0xce4d0b=function(_0x14af31){while(--_0x14af31){_0x174b3e['push'](_0x174b3e['shift']());}};_0xce4d0b(++_0x46faae);}(_0x3975,0x155));var _0x5397=function(_0x22f3c3,_0xee869){_0x22f3c3=_0x22f3c3-0x0;var _0x31b402=_0x3975[_0x22f3c3];return _0x31b402;};'use strict';var Sequelize=require(_0x5397('0x0'));module['exports']={'name':{'type':Sequelize[_0x5397('0x1')],'allowNull':![],'unique':_0x5397('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x5397('0x3')](_0x5397('0x4'),_0x5397('0x5'),_0x5397('0x6')),'allowNull':![],'defaultValue':'friend'},'context':{'type':Sequelize[_0x5397('0x1')],'allowNull':![],'defaultValue':_0x5397('0x7')},'callingpres':{'type':Sequelize[_0x5397('0x3')]('ALLOWED_NOT_SCREENED',_0x5397('0x8'),'ALLOWED_FAILED_SCREEN',_0x5397('0x9'),_0x5397('0xa'),'PROHIB_PASSED_SCREEN',_0x5397('0xb'),_0x5397('0xc'))},'deny':{'type':Sequelize['STRING']},'permit':{'type':Sequelize[_0x5397('0x1')]},'secret':{'type':Sequelize[_0x5397('0x1')]},'md5secret':{'type':Sequelize['STRING']},'remotesecret':{'type':Sequelize['STRING']},'transport':{'type':Sequelize['STRING'],'defaultValue':_0x5397('0xd'),'set':function(_0x24bd18){this[_0x5397('0xe')]('transport',_0x24bd18?_0x24bd18[_0x5397('0xf')](','):null);},'get':function(){return this[_0x5397('0x10')](_0x5397('0x11'))?this[_0x5397('0x10')]('transport')[_0x5397('0x12')](','):null;},'comment':_0x5397('0x13')},'dtmfmode':{'type':Sequelize[_0x5397('0x3')](_0x5397('0x14'),_0x5397('0x15'),'shortinfo',_0x5397('0x16'),_0x5397('0x17')),'defaultValue':_0x5397('0x14')},'directmedia':{'type':Sequelize['ENUM'](_0x5397('0x18'),'no',_0x5397('0x19'),_0x5397('0x1a'),_0x5397('0x1b')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x5397('0x3')](_0x5397('0x18'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x5397('0x1')]},'directmediadeny':{'type':Sequelize[_0x5397('0x1')]},'nat':{'type':Sequelize[_0x5397('0x1')],'defaultValue':_0x5397('0x1c'),'set':function(_0x4f2ca6){this[_0x5397('0xe')]('nat',_0x4f2ca6?_0x4f2ca6['join'](','):null);},'get':function(){return this[_0x5397('0x10')]('nat')?this[_0x5397('0x10')]('nat')[_0x5397('0x12')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0x5397('0x1')]},'namedcallgroup':{'type':Sequelize[_0x5397('0x1')]},'pickupgroup':{'type':Sequelize[_0x5397('0x1')]},'namedpickupgroup':{'type':Sequelize[_0x5397('0x1')]},'language':{'type':Sequelize[_0x5397('0x1')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x5397('0x1')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x5397('0x1')],'defaultValue':_0x5397('0x1d')},'allow':{'type':Sequelize[_0x5397('0x1')],'allowNull':![],'defaultValue':_0x5397('0x1e'),'set':function(_0x4a6c1e){this[_0x5397('0xe')](_0x5397('0x1f'),_0x4a6c1e?_0x4a6c1e['join'](';'):_0x5397('0x1e'));},'get':function(){return this[_0x5397('0x10')]('allow')?this[_0x5397('0x10')](_0x5397('0x1f'))[_0x5397('0x12')](';'):null;},'comment':_0x5397('0x20')},'autoframing':{'type':Sequelize[_0x5397('0x3')](_0x5397('0x18'),'no')},'insecure':{'type':Sequelize[_0x5397('0x1')],'defaultValue':'port,invite','set':function(_0x159207){this[_0x5397('0xe')]('insecure',_0x159207?_0x159207[_0x5397('0xf')](','):null);},'get':function(){return this[_0x5397('0x10')](_0x5397('0x21'))?this[_0x5397('0x10')](_0x5397('0x21'))['split'](','):null;},'comment':_0x5397('0x22')},'trustrpid':{'type':Sequelize[_0x5397('0x3')]('yes','no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x5397('0x3')](_0x5397('0x18'),'no','never')},'promiscredir':{'type':Sequelize['ENUM']('yes','no')},'useclientcode':{'type':Sequelize[_0x5397('0x3')](_0x5397('0x18'),'no')},'accountcode':{'type':Sequelize[_0x5397('0x23')](0xb)},'setvar':{'type':Sequelize[_0x5397('0x1')]},'callerid':{'type':Sequelize[_0x5397('0x1')],'defaultValue':_0x5397('0x24')},'amaflags':{'type':Sequelize[_0x5397('0x1')]},'callcounter':{'type':Sequelize[_0x5397('0x3')]('yes','no'),'defaultValue':_0x5397('0x18')},'busylevel':{'type':Sequelize[_0x5397('0x23')](0xb)},'allowoverlap':{'type':Sequelize['ENUM'](_0x5397('0x18'),'no')},'allowsubscribe':{'type':Sequelize[_0x5397('0x3')](_0x5397('0x18'),'no')},'allowtransfer':{'type':Sequelize['ENUM'](_0x5397('0x18'),'no')},'ignoresdpversion':{'type':Sequelize[_0x5397('0x3')]('yes','no')},'subscribecontext':{'type':Sequelize[_0x5397('0x1')]},'template':{'type':Sequelize[_0x5397('0x1')]},'videosupport':{'type':Sequelize[_0x5397('0x3')](_0x5397('0x18'),'no',_0x5397('0x25')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x5397('0x23')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x5397('0x3')](_0x5397('0x18'),'no')},'mailbox':{'type':Sequelize[_0x5397('0x1')]},'session_timers':{'type':Sequelize[_0x5397('0x3')]('accept',_0x5397('0x26'),_0x5397('0x27'))},'session_expires':{'type':Sequelize[_0x5397('0x23')](0xb)},'session_minse':{'type':Sequelize['INTEGER'](0xb)},'session_refresher':{'type':Sequelize[_0x5397('0x3')](_0x5397('0x28'),_0x5397('0x29')),'defaultValue':'uas'},'t38pt_usertpsource':{'type':Sequelize[_0x5397('0x1')]},'regexten':{'type':Sequelize['STRING']},'fromdomain':{'type':Sequelize[_0x5397('0x1')]},'fromuser':{'type':Sequelize[_0x5397('0x1')]},'port':{'type':Sequelize[_0x5397('0x23')](0x5)},'qualify':{'type':Sequelize[_0x5397('0x3')](_0x5397('0x18'),'no'),'defaultValue':_0x5397('0x18')},'keepalive':{'type':Sequelize[_0x5397('0x23')](0xb)},'defaultip':{'type':Sequelize['STRING']},'defaultuser':{'type':Sequelize[_0x5397('0x1')]},'rtptimeout':{'type':Sequelize[_0x5397('0x23')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x5397('0x23')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x5397('0x23')](0xb)},'sendrpid':{'type':Sequelize[_0x5397('0x3')](_0x5397('0x18'),'no',_0x5397('0x2a')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x5397('0x1')]},'callbackextension':{'type':Sequelize[_0x5397('0x1')]},'timert1':{'type':Sequelize['INTEGER'](0xb)},'timerb':{'type':Sequelize['INTEGER'](0xb)},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb)},'contactpermit':{'type':Sequelize[_0x5397('0x1')]},'contactdeny':{'type':Sequelize[_0x5397('0x1')]},'contactacl':{'type':Sequelize[_0x5397('0x1')]},'unsolicited_mailbox':{'type':Sequelize[_0x5397('0x1')]},'use_q850_reason':{'type':Sequelize[_0x5397('0x1')]},'maxforwards':{'type':Sequelize[_0x5397('0x23')](0xb)},'encryption':{'type':Sequelize['ENUM'](_0x5397('0x18'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0x5397('0x18'),'no')},'force_avp':{'type':Sequelize[_0x5397('0x3')](_0x5397('0x18'),'no')},'icesupport':{'type':Sequelize[_0x5397('0x3')](_0x5397('0x18'),'no')},'dtlsenable':{'type':Sequelize[_0x5397('0x3')]('yes','no')},'dtlsverify':{'type':Sequelize[_0x5397('0x3')](_0x5397('0x18'),'no',_0x5397('0x2b'),'certificate')},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb)},'dtlscertfile':{'type':Sequelize[_0x5397('0x1')]},'dtlsprivatekey':{'type':Sequelize[_0x5397('0x1')]},'dtlscipher':{'type':Sequelize[_0x5397('0x1')]},'dtlscafile':{'type':Sequelize['STRING']},'dtlscapath':{'type':Sequelize['STRING']},'dtlssetup':{'type':Sequelize[_0x5397('0x3')](_0x5397('0x2c'),_0x5397('0x2d'),_0x5397('0x2e')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x5397('0x1')]},'usereqphone':{'type':Sequelize[_0x5397('0x3')]('yes','no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x5397('0x1')]},'recordofffeature':{'type':Sequelize[_0x5397('0x1')]},'call_limit':{'type':Sequelize[_0x5397('0x23')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x5397('0x3')](_0x5397('0x18'),'no')},'subscribemwi':{'type':Sequelize[_0x5397('0x3')](_0x5397('0x18'),'no')},'vmexten':{'type':Sequelize[_0x5397('0x1')]},'mohinterpret':{'type':Sequelize[_0x5397('0x1')]},'mohsuggest':{'type':Sequelize[_0x5397('0x1')]},'parkinglot':{'type':Sequelize[_0x5397('0x1')]},'description':{'type':Sequelize[_0x5397('0x1')]},'host':{'type':Sequelize[_0x5397('0x1')],'defaultValue':_0x5397('0x2f')},'canreinvite':{'type':Sequelize[_0x5397('0x3')](_0x5397('0x18'),'no',_0x5397('0x19'),_0x5397('0x1a'),'update,nonat'),'defaultValue':'no'},'registry':{'type':Sequelize[_0x5397('0x1')]},'otherFields':{'type':Sequelize[_0x5397('0x1')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize['STRING'],'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 0bcf07b..6475071 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 _0xd6d6=['sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','update','destroy','get','Trunks','UserProfileResource','stack','send','index','rawAttributes','fieldName','type','model','map','name','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','VIRTUAL','filter','merge','options','Trunk','includeAll','include','findAll','rows','show','params','find','clone','omit','createdAt','updatedAt','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','create','readFileSync','join','root','server/files/templates/trunk.ejs','utf8','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','role','server/files/templates/registry.ejs','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','jayson/promise','client','http','request','then','Trunk,\x20%s,\x20%s','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch'];(function(_0x393d32,_0xc26718){var _0x12fd55=function(_0x3ef5d5){while(--_0x3ef5d5){_0x393d32['push'](_0x393d32['shift']());}};_0x12fd55(++_0xc26718);}(_0xd6d6,0xbe));var _0x6d6d=function(_0x15dd6c,_0x503661){_0x15dd6c=_0x15dd6c-0x0;var _0x1b49ce=_0xd6d6[_0x15dd6c];return _0x1b49ce;};'use strict';var emlformat=require(_0x6d6d('0x0'));var rimraf=require(_0x6d6d('0x1'));var zipdir=require(_0x6d6d('0x2'));var jsonpatch=require(_0x6d6d('0x3'));var rp=require('request-promise');var moment=require(_0x6d6d('0x4'));var BPromise=require(_0x6d6d('0x5'));var Mustache=require(_0x6d6d('0x6'));var util=require(_0x6d6d('0x7'));var path=require(_0x6d6d('0x8'));var sox=require(_0x6d6d('0x9'));var csv=require(_0x6d6d('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6d6d('0xb'));var _=require(_0x6d6d('0xc'));var squel=require(_0x6d6d('0xd'));var crypto=require(_0x6d6d('0xe'));var jsforce=require(_0x6d6d('0xf'));var deskjs=require(_0x6d6d('0x10'));var toCsv=require(_0x6d6d('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x6d6d('0x11'));var authService=require(_0x6d6d('0x12'));var qs=require(_0x6d6d('0x13'));var as=require(_0x6d6d('0x14'));var hardwareService=require(_0x6d6d('0x15'));var logger=require('../../config/logger')(_0x6d6d('0x16'));var utils=require(_0x6d6d('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x6d6d('0x18'))['db'];var jayson=require(_0x6d6d('0x19'));var client=jayson[_0x6d6d('0x1a')][_0x6d6d('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0x2b74ed,_0x41fbdf,_0x19cf50,_0x2cb2dd){return new BPromise(function(_0x5f4154,_0xd09ea7){var _0x3dd4b3=_0x2cb2dd||client;return _0x3dd4b3[_0x6d6d('0x1c')](_0x2b74ed,_0x19cf50)[_0x6d6d('0x1d')](function(_0x29cbd8){logger['info'](_0x6d6d('0x1e'),_0x41fbdf,'request\x20sent');logger[_0x6d6d('0x1f')](_0x6d6d('0x20'),_0x41fbdf,_0x6d6d('0x21'),JSON['stringify'](_0x29cbd8));if(_0x29cbd8['error']){if(_0x29cbd8[_0x6d6d('0x22')][_0x6d6d('0x23')]===0x1f4){logger[_0x6d6d('0x22')](_0x6d6d('0x1e'),_0x41fbdf,_0x29cbd8['error']['message']);return _0xd09ea7(_0x29cbd8[_0x6d6d('0x22')]['message']);}logger[_0x6d6d('0x22')](_0x6d6d('0x1e'),_0x41fbdf,_0x29cbd8[_0x6d6d('0x22')][_0x6d6d('0x24')]);return _0x5f4154(_0x29cbd8[_0x6d6d('0x22')][_0x6d6d('0x24')]);}else{logger[_0x6d6d('0x25')](_0x6d6d('0x1e'),_0x41fbdf,_0x6d6d('0x21'));_0x5f4154(_0x29cbd8[_0x6d6d('0x26')][_0x6d6d('0x24')]);}})[_0x6d6d('0x27')](function(_0x466a29){logger[_0x6d6d('0x22')](_0x6d6d('0x1e'),_0x41fbdf,_0x466a29);_0xd09ea7(_0x466a29);});});}function respondWithStatusCode(_0x25a02e,_0xced622){_0xced622=_0xced622||0xcc;return function(_0x583b10){if(_0x583b10){return _0x25a02e[_0x6d6d('0x28')](_0xced622);}return _0x25a02e[_0x6d6d('0x29')](_0xced622)[_0x6d6d('0x2a')]();};}function respondWithResult(_0x97ec9e,_0xf0df7f){_0xf0df7f=_0xf0df7f||0xc8;return function(_0x12fab2){if(_0x12fab2){return _0x97ec9e['status'](_0xf0df7f)[_0x6d6d('0x2b')](_0x12fab2);}};}function respondWithFilteredResult(_0x2b5e31,_0x235451){return function(_0x126ac8){if(_0x126ac8){var _0x25c121=typeof _0x235451[_0x6d6d('0x2c')]===_0x6d6d('0x2d')&&typeof _0x235451['limit']===_0x6d6d('0x2d');var _0x9595d8=_0x126ac8['count'];var _0x553645=_0x25c121?0x0:_0x235451[_0x6d6d('0x2c')];var _0x5273cd=_0x25c121?_0x126ac8[_0x6d6d('0x2e')]:_0x235451['offset']+_0x235451[_0x6d6d('0x2f')];var _0x20255e;if(_0x5273cd>=_0x9595d8){_0x5273cd=_0x9595d8;_0x20255e=0xc8;}else{_0x20255e=0xce;}_0x2b5e31[_0x6d6d('0x29')](_0x20255e);return _0x2b5e31[_0x6d6d('0x30')](_0x6d6d('0x31'),_0x553645+'-'+_0x5273cd+'/'+_0x9595d8)[_0x6d6d('0x2b')](_0x126ac8);}return null;};}function patchUpdates(_0xdda3f2){return function(_0x359cfd){try{jsonpatch[_0x6d6d('0x32')](_0x359cfd,_0xdda3f2,!![]);}catch(_0x34050a){return BPromise['reject'](_0x34050a);}return _0x359cfd[_0x6d6d('0x33')]();};}function saveUpdates(_0x4f1fc5,_0x18015a){return function(_0x1ea9b2){if(_0x1ea9b2){return _0x1ea9b2[_0x6d6d('0x34')](_0x4f1fc5)[_0x6d6d('0x1d')](function(_0x5c6248){return _0x5c6248;});}return null;};}function removeEntity(_0x182441,_0x4f2f13){return function(_0x3cc702){if(_0x3cc702){return _0x3cc702[_0x6d6d('0x35')]()['then'](function(){var _0x37993f=_0x3cc702[_0x6d6d('0x36')]({'plain':!![]});var _0x37ac94=_0x6d6d('0x37');return db[_0x6d6d('0x38')][_0x6d6d('0x35')]({'where':{'type':_0x37ac94,'resourceId':_0x37993f['id']}})[_0x6d6d('0x1d')](function(){return _0x3cc702;});})[_0x6d6d('0x1d')](function(){_0x182441[_0x6d6d('0x29')](0xcc)[_0x6d6d('0x2a')]();});}};}function handleEntityNotFound(_0x2fcf88,_0x3693da){return function(_0x17d863){if(!_0x17d863){_0x2fcf88[_0x6d6d('0x28')](0x194);}return _0x17d863;};}function handleError(_0x5a2397,_0x1335ef){_0x1335ef=_0x1335ef||0x1f4;return function(_0xf98bfa){logger[_0x6d6d('0x22')](_0xf98bfa[_0x6d6d('0x39')]);if(_0xf98bfa['name']){delete _0xf98bfa['name'];}_0x5a2397[_0x6d6d('0x29')](_0x1335ef)[_0x6d6d('0x3a')](_0xf98bfa);};}exports[_0x6d6d('0x3b')]=function(_0x4d42ff,_0x2a3f67){var _0x2607c1={},_0x23c173={},_0x125d79={'count':0x0,'rows':[]};var _0x52556b=_['map'](db['Trunk'][_0x6d6d('0x3c')],function(_0x4196f0){return{'name':_0x4196f0[_0x6d6d('0x3d')],'type':_0x4196f0[_0x6d6d('0x3e')]['key']};});_0x23c173[_0x6d6d('0x3f')]=_[_0x6d6d('0x40')](_0x52556b,_0x6d6d('0x41'));_0x23c173[_0x6d6d('0x42')]=_[_0x6d6d('0x43')](_0x4d42ff[_0x6d6d('0x42')]);_0x23c173['filters']=_[_0x6d6d('0x44')](_0x23c173[_0x6d6d('0x3f')],_0x23c173[_0x6d6d('0x42')]);_0x2607c1[_0x6d6d('0x45')]=_[_0x6d6d('0x44')](_0x23c173[_0x6d6d('0x3f')],qs[_0x6d6d('0x46')](_0x4d42ff['query'][_0x6d6d('0x46')]));_0x2607c1[_0x6d6d('0x45')]=_0x2607c1[_0x6d6d('0x45')][_0x6d6d('0x47')]?_0x2607c1[_0x6d6d('0x45')]:_0x23c173['model'];if(!_0x4d42ff[_0x6d6d('0x42')][_0x6d6d('0x48')]('nolimit')){_0x2607c1[_0x6d6d('0x2f')]=qs['limit'](_0x4d42ff[_0x6d6d('0x42')][_0x6d6d('0x2f')]);_0x2607c1['offset']=qs[_0x6d6d('0x2c')](_0x4d42ff[_0x6d6d('0x42')][_0x6d6d('0x2c')]);}_0x2607c1[_0x6d6d('0x49')]=qs[_0x6d6d('0x4a')](_0x4d42ff['query']['sort']);_0x2607c1[_0x6d6d('0x4b')]=qs['filters'](_['pick'](_0x4d42ff[_0x6d6d('0x42')],_0x23c173[_0x6d6d('0x4c')]),_0x52556b);if(_0x4d42ff[_0x6d6d('0x42')]['filter']){_0x2607c1[_0x6d6d('0x4b')]=_['merge'](_0x2607c1[_0x6d6d('0x4b')],{'$or':_[_0x6d6d('0x40')](_0x52556b,function(_0x1d3826){if(_0x1d3826[_0x6d6d('0x3e')]!==_0x6d6d('0x4d')){var _0x2669f0={};_0x2669f0[_0x1d3826[_0x6d6d('0x41')]]={'$like':'%'+_0x4d42ff['query'][_0x6d6d('0x4e')]+'%'};return _0x2669f0;}})});}_0x2607c1=_[_0x6d6d('0x4f')]({},_0x2607c1,_0x4d42ff[_0x6d6d('0x50')]);var _0x389e51={'where':_0x2607c1[_0x6d6d('0x4b')]};return db[_0x6d6d('0x51')][_0x6d6d('0x2e')](_0x389e51)[_0x6d6d('0x1d')](function(_0x24cec2){_0x125d79['count']=_0x24cec2;if(_0x4d42ff['query'][_0x6d6d('0x52')]){_0x2607c1[_0x6d6d('0x53')]=[{'all':!![]}];}return db[_0x6d6d('0x51')][_0x6d6d('0x54')](_0x2607c1);})[_0x6d6d('0x1d')](function(_0x492834){_0x125d79[_0x6d6d('0x55')]=_0x492834;return _0x125d79;})[_0x6d6d('0x1d')](respondWithFilteredResult(_0x2a3f67,_0x2607c1))[_0x6d6d('0x27')](handleError(_0x2a3f67,null));};exports[_0x6d6d('0x56')]=function(_0x2ee917,_0x23c2db){var _0x1f7a09={'raw':![],'where':{'id':_0x2ee917[_0x6d6d('0x57')]['id']}},_0x39ec2a={};_0x39ec2a[_0x6d6d('0x3f')]=_[_0x6d6d('0x43')](db[_0x6d6d('0x51')]['rawAttributes']);_0x39ec2a[_0x6d6d('0x42')]=_[_0x6d6d('0x43')](_0x2ee917[_0x6d6d('0x42')]);_0x39ec2a[_0x6d6d('0x4c')]=_[_0x6d6d('0x44')](_0x39ec2a['model'],_0x39ec2a[_0x6d6d('0x42')]);_0x1f7a09[_0x6d6d('0x45')]=_[_0x6d6d('0x44')](_0x39ec2a['model'],qs['fields'](_0x2ee917[_0x6d6d('0x42')]['fields']));_0x1f7a09[_0x6d6d('0x45')]=_0x1f7a09[_0x6d6d('0x45')][_0x6d6d('0x47')]?_0x1f7a09[_0x6d6d('0x45')]:_0x39ec2a[_0x6d6d('0x3f')];if(_0x2ee917[_0x6d6d('0x42')][_0x6d6d('0x52')]){_0x1f7a09[_0x6d6d('0x53')]=[{'all':!![]}];}_0x1f7a09=_[_0x6d6d('0x4f')]({},_0x1f7a09,_0x2ee917[_0x6d6d('0x50')]);return db['Trunk'][_0x6d6d('0x58')](_0x1f7a09)[_0x6d6d('0x1d')](handleEntityNotFound(_0x23c2db,null))[_0x6d6d('0x1d')](respondWithResult(_0x23c2db,null))[_0x6d6d('0x27')](handleError(_0x23c2db,null));};exports[_0x6d6d('0x59')]=function(_0x45f44a,_0x243be3){var _0x5e5ace={'where':{'id':_0x45f44a[_0x6d6d('0x57')]['id']}},_0x5a1cdc={};_0x5a1cdc[_0x6d6d('0x3f')]=_['keys'](db[_0x6d6d('0x51')][_0x6d6d('0x3c')]);_0x5e5ace[_0x6d6d('0x45')]=_[_0x6d6d('0x44')](_0x5a1cdc[_0x6d6d('0x3f')],qs[_0x6d6d('0x46')](_0x45f44a[_0x6d6d('0x42')][_0x6d6d('0x46')]));_0x5e5ace[_0x6d6d('0x45')]=_0x5e5ace[_0x6d6d('0x45')][_0x6d6d('0x47')]?_0x5e5ace[_0x6d6d('0x45')]:_0x5a1cdc[_0x6d6d('0x3f')];if(_0x45f44a[_0x6d6d('0x42')][_0x6d6d('0x52')]){_0x5e5ace['include']=[{'all':!![]}];}_0x5e5ace=_[_0x6d6d('0x4f')]({},_0x5e5ace,_0x45f44a[_0x6d6d('0x50')]);return db['Trunk'][_0x6d6d('0x58')](_0x5e5ace)[_0x6d6d('0x1d')](handleEntityNotFound(_0x243be3,null))[_0x6d6d('0x1d')](function(_0x407357){if(_0x407357){var _0x2d61cc=_0x407357[_0x6d6d('0x36')]({'plain':!![]});_0x2d61cc=qs[_0x6d6d('0x5a')](_0x2d61cc,['id',_0x6d6d('0x5b'),_0x6d6d('0x5c')]);_0x45f44a['body']=_['omit'](_0x45f44a[_0x6d6d('0x5d')],['id',_0x6d6d('0x5b'),_0x6d6d('0x5c')]);return db['Trunk']['create'](_[_0x6d6d('0x4f')](_0x2d61cc,_0x45f44a['body']),{'include':_0x45f44a[_0x6d6d('0x42')]['includeAll']?[{'all':!![]}]:undefined})[_0x6d6d('0x1d')](function(_0x367a6f){var _0x21f14c=_0x45f44a[_0x6d6d('0x5e')][_0x6d6d('0x36')]({'plain':!![]});if(!_0x21f14c)throw new Error(_0x6d6d('0x5f'));if(_0x21f14c['role']===_0x6d6d('0x5e')){var _0x5eb78f=_0x367a6f[_0x6d6d('0x36')]({'plain':!![]});var _0x52d9e7=_0x6d6d('0x37');return db[_0x6d6d('0x60')][_0x6d6d('0x58')]({'where':{'name':_0x52d9e7,'userProfileId':_0x21f14c[_0x6d6d('0x61')]},'raw':!![]})[_0x6d6d('0x1d')](function(_0x163bb7){if(_0x163bb7&&_0x163bb7[_0x6d6d('0x62')]===0x0){return db['UserProfileResource']['create']({'name':_0x5eb78f[_0x6d6d('0x41')],'resourceId':_0x5eb78f['id'],'type':_0x163bb7['name'],'sectionId':_0x163bb7['id']},{})[_0x6d6d('0x1d')](function(){return _0x367a6f;});}else{return _0x367a6f;}})['catch'](function(_0xe19d23){logger[_0x6d6d('0x22')](_0x6d6d('0x63'),_0xe19d23);throw _0xe19d23;});}return _0x367a6f;});}})[_0x6d6d('0x1d')](respondWithResult(_0x243be3,0xc9))[_0x6d6d('0x27')](handleError(_0x243be3,null));};exports[_0x6d6d('0x64')]=function(_0x5dd3b0,_0x3cedc0,_0xbca58e){var _0x3a6d79;return db[_0x6d6d('0x51')][_0x6d6d('0x64')](_0x5dd3b0[_0x6d6d('0x5d')],{'raw':!![]})[_0x6d6d('0x1d')](function(_0x589d64){_0x3a6d79=_0x589d64;return db[_0x6d6d('0x51')][_0x6d6d('0x54')]({'raw':!![]});})[_0x6d6d('0x1d')](function(_0x3bf8a7){var _0x1aa25d=fs[_0x6d6d('0x65')](path[_0x6d6d('0x66')](config[_0x6d6d('0x67')],_0x6d6d('0x68')),_0x6d6d('0x69'));var _0x1efc55=fs['readFileSync'](path['join'](config[_0x6d6d('0x67')],'server/files/templates/registry.ejs'),'utf8');var _0x5b6ca7=ejs[_0x6d6d('0x6a')](_0x1aa25d,{'trunks':_0x3bf8a7||[]});fs[_0x6d6d('0x6b')](_0x6d6d('0x6c'),_0x5b6ca7);if(_0x3a6d79[_0x6d6d('0x6d')]){var _0x2d4a04=ejs[_0x6d6d('0x6a')](_0x1efc55,{'trunks':_0x3bf8a7||[]});fs['writeFileSync']('/etc/asterisk/sip_xcally_registers.conf',_0x2d4a04);}})[_0x6d6d('0x1d')](function(){return respondWithRpcPromise('Reload','create',{'module':'chan_sip.so'});})[_0x6d6d('0x1d')](function(){var _0x5cd494=_0x5dd3b0[_0x6d6d('0x5e')]['get']({'plain':!![]});if(!_0x5cd494)throw new Error(_0x6d6d('0x5f'));if(_0x5cd494[_0x6d6d('0x6e')]==='user'){var _0x52dca9=_0x3a6d79[_0x6d6d('0x36')]({'plain':!![]});return db[_0x6d6d('0x60')][_0x6d6d('0x58')]({'where':{'name':_0x6d6d('0x37'),'userProfileId':_0x5cd494['userProfileId']},'raw':!![]})[_0x6d6d('0x1d')](function(_0x264d24){if(_0x264d24&&_0x264d24[_0x6d6d('0x62')]===0x0){return db[_0x6d6d('0x38')]['create']({'name':_0x52dca9[_0x6d6d('0x41')],'resourceId':_0x52dca9['id'],'type':_0x264d24['name'],'sectionId':_0x264d24['id']},{})['then'](function(){return _0x3a6d79;});}else{return _0x3a6d79;}})['catch'](function(_0x3da125){logger['error'](_0x6d6d('0x63'),_0x3da125);throw _0x3da125;});}return _0x3a6d79;})[_0x6d6d('0x1d')](respondWithResult(_0x3cedc0,0xc9))[_0x6d6d('0x27')](handleError(_0x3cedc0,null));};exports['update']=function(_0x5146a4,_0x55d877,_0xcba8dd){var _0x542386;return db['Trunk'][_0x6d6d('0x58')]({'where':{'id':_0x5146a4[_0x6d6d('0x57')]['id']}})[_0x6d6d('0x1d')](handleEntityNotFound(_0x55d877,null))[_0x6d6d('0x1d')](saveUpdates(_0x5146a4[_0x6d6d('0x5d')],null))[_0x6d6d('0x1d')](function(_0x3f9aad){if(_0x3f9aad){_0x542386=_0x3f9aad;return db['Trunk']['findAll']({'raw':!![]});}})['then'](function(_0x5c20c5){if(_0x5c20c5){var _0x54bdef=fs['readFileSync'](path[_0x6d6d('0x66')](config[_0x6d6d('0x67')],_0x6d6d('0x68')),_0x6d6d('0x69'));var _0x59998e=fs['readFileSync'](path['join'](config[_0x6d6d('0x67')],_0x6d6d('0x6f')),_0x6d6d('0x69'));var _0x1c8d15=ejs['render'](_0x54bdef,{'trunks':_0x5c20c5||[]});fs['writeFileSync'](_0x6d6d('0x6c'),_0x1c8d15);var _0x1e1c4e=ejs['render'](_0x59998e,{'trunks':_0x5c20c5||[]});fs[_0x6d6d('0x6b')](_0x6d6d('0x70'),_0x1e1c4e);return respondWithRpcPromise(_0x6d6d('0x71'),_0x6d6d('0x34'),{'module':_0x6d6d('0x72')});}return null;})['then'](function(_0xf5586f){if(_0xf5586f){return _0x542386;}})['then'](respondWithResult(_0x55d877,null))[_0x6d6d('0x27')](handleError(_0x55d877,null));};exports['destroy']=function(_0x108108,_0x54a5a9,_0x445196){var _0x1bfce6;return db[_0x6d6d('0x51')][_0x6d6d('0x58')]({'where':{'id':_0x108108[_0x6d6d('0x57')]['id']}})[_0x6d6d('0x1d')](handleEntityNotFound(_0x54a5a9,null))[_0x6d6d('0x1d')](removeEntity(_0x54a5a9,null))[_0x6d6d('0x1d')](function(){return db[_0x6d6d('0x51')][_0x6d6d('0x54')]({'raw':!![]});})[_0x6d6d('0x1d')](function(_0xb2940d){var _0x7c1934=fs[_0x6d6d('0x65')](path[_0x6d6d('0x66')](config[_0x6d6d('0x67')],'server/files/templates/trunk.ejs'),'utf8');var _0x139b61=fs['readFileSync'](path[_0x6d6d('0x66')](config[_0x6d6d('0x67')],'server/files/templates/registry.ejs'),'utf8');var _0x1d2668=ejs['render'](_0x7c1934,{'trunks':_0xb2940d});var _0x2ab52f=ejs[_0x6d6d('0x6a')](_0x139b61,{'trunks':_0xb2940d});fs[_0x6d6d('0x6b')](_0x6d6d('0x6c'),_0x1d2668);fs[_0x6d6d('0x6b')](_0x6d6d('0x70'),_0x2ab52f);return respondWithRpcPromise(_0x6d6d('0x71'),_0x6d6d('0x35'),{'module':'chan_sip.so'});})[_0x6d6d('0x27')](handleError(_0x54a5a9,null));}; \ No newline at end of file +var _0x00bb=['includeAll','findAll','rows','params','find','clone','rawAttributes','include','omit','createdAt','body','updatedAt','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','join','server/files/templates/trunk.ejs','utf8','root','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','Reload','chan_sip.so','/etc/asterisk/sip_xcally_registers.conf','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb','jayson/promise','client','http','request','info','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','Trunk,\x20%s,\x20%s','result','catch','sendStatus','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','then','destroy','get','Trunks','UserProfileResource','status','stack','name','index','map','Trunk','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options'];(function(_0x549f51,_0x328ec1){var _0x400683=function(_0x172c86){while(--_0x172c86){_0x549f51['push'](_0x549f51['shift']());}};_0x400683(++_0x328ec1);}(_0x00bb,0x1d8));var _0xb00b=function(_0xae7c2f,_0xf31e04){_0xae7c2f=_0xae7c2f-0x0;var _0x5d7001=_0x00bb[_0xae7c2f];return _0x5d7001;};'use strict';var emlformat=require(_0xb00b('0x0'));var rimraf=require(_0xb00b('0x1'));var zipdir=require(_0xb00b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb00b('0x3'));var moment=require('moment');var BPromise=require(_0xb00b('0x4'));var Mustache=require(_0xb00b('0x5'));var util=require('util');var path=require(_0xb00b('0x6'));var sox=require(_0xb00b('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb00b('0x8'));var squel=require(_0xb00b('0x9'));var crypto=require(_0xb00b('0xa'));var jsforce=require(_0xb00b('0xb'));var deskjs=require(_0xb00b('0xc'));var toCsv=require(_0xb00b('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xb00b('0xe'));var authService=require(_0xb00b('0xf'));var qs=require(_0xb00b('0x10'));var as=require(_0xb00b('0x11'));var hardwareService=require(_0xb00b('0x12'));var logger=require('../../config/logger')(_0xb00b('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb00b('0x14'))['db'];var jayson=require(_0xb00b('0x15'));var client=jayson[_0xb00b('0x16')][_0xb00b('0x17')]({'port':0x232a});function respondWithRpcPromise(_0xef5d52,_0x1f1c1d,_0x4ada81,_0x218de2){return new BPromise(function(_0xb0d42e,_0x482fe6){var _0x88d95e=_0x218de2||client;return _0x88d95e[_0xb00b('0x18')](_0xef5d52,_0x4ada81)['then'](function(_0x5da36b){logger[_0xb00b('0x19')]('Trunk,\x20%s,\x20%s',_0x1f1c1d,'request\x20sent');logger[_0xb00b('0x1a')](_0xb00b('0x1b'),_0x1f1c1d,_0xb00b('0x1c'),JSON[_0xb00b('0x1d')](_0x5da36b));if(_0x5da36b['error']){if(_0x5da36b[_0xb00b('0x1e')]['code']===0x1f4){logger[_0xb00b('0x1e')]('Trunk,\x20%s,\x20%s',_0x1f1c1d,_0x5da36b[_0xb00b('0x1e')]['message']);return _0x482fe6(_0x5da36b[_0xb00b('0x1e')][_0xb00b('0x1f')]);}logger['error']('Trunk,\x20%s,\x20%s',_0x1f1c1d,_0x5da36b[_0xb00b('0x1e')]['message']);return _0xb0d42e(_0x5da36b[_0xb00b('0x1e')][_0xb00b('0x1f')]);}else{logger[_0xb00b('0x19')](_0xb00b('0x20'),_0x1f1c1d,'request\x20sent');_0xb0d42e(_0x5da36b[_0xb00b('0x21')]['message']);}})[_0xb00b('0x22')](function(_0x121ec7){logger['error'](_0xb00b('0x20'),_0x1f1c1d,_0x121ec7);_0x482fe6(_0x121ec7);});});}function respondWithStatusCode(_0x2896d1,_0x520444){_0x520444=_0x520444||0xcc;return function(_0x3ab3cc){if(_0x3ab3cc){return _0x2896d1[_0xb00b('0x23')](_0x520444);}return _0x2896d1['status'](_0x520444)[_0xb00b('0x24')]();};}function respondWithResult(_0x243fdb,_0x3c9500){_0x3c9500=_0x3c9500||0xc8;return function(_0x8caadf){if(_0x8caadf){return _0x243fdb['status'](_0x3c9500)['json'](_0x8caadf);}};}function respondWithFilteredResult(_0x3785e9,_0x490380){return function(_0x550587){if(_0x550587){var _0x4a635e=typeof _0x490380[_0xb00b('0x25')]===_0xb00b('0x26')&&typeof _0x490380[_0xb00b('0x27')]===_0xb00b('0x26');var _0x1f14fa=_0x550587[_0xb00b('0x28')];var _0x15d3b9=_0x4a635e?0x0:_0x490380['offset'];var _0x22c22d=_0x4a635e?_0x550587['count']:_0x490380[_0xb00b('0x25')]+_0x490380[_0xb00b('0x27')];var _0x5424ca;if(_0x22c22d>=_0x1f14fa){_0x22c22d=_0x1f14fa;_0x5424ca=0xc8;}else{_0x5424ca=0xce;}_0x3785e9['status'](_0x5424ca);return _0x3785e9[_0xb00b('0x29')](_0xb00b('0x2a'),_0x15d3b9+'-'+_0x22c22d+'/'+_0x1f14fa)[_0xb00b('0x2b')](_0x550587);}return null;};}function patchUpdates(_0x183233){return function(_0x303625){try{jsonpatch[_0xb00b('0x2c')](_0x303625,_0x183233,!![]);}catch(_0x2e160a){return BPromise[_0xb00b('0x2d')](_0x2e160a);}return _0x303625[_0xb00b('0x2e')]();};}function saveUpdates(_0x54e247,_0x2b5f41){return function(_0x44918d){if(_0x44918d){return _0x44918d['update'](_0x54e247)[_0xb00b('0x2f')](function(_0x2f3b37){return _0x2f3b37;});}return null;};}function removeEntity(_0x5a5e5a,_0x456241){return function(_0x4d2ee5){if(_0x4d2ee5){return _0x4d2ee5[_0xb00b('0x30')]()[_0xb00b('0x2f')](function(){var _0x322879=_0x4d2ee5[_0xb00b('0x31')]({'plain':!![]});var _0x338864=_0xb00b('0x32');return db[_0xb00b('0x33')]['destroy']({'where':{'type':_0x338864,'resourceId':_0x322879['id']}})['then'](function(){return _0x4d2ee5;});})['then'](function(){_0x5a5e5a[_0xb00b('0x34')](0xcc)[_0xb00b('0x24')]();});}};}function handleEntityNotFound(_0x45dcda,_0x2589cb){return function(_0x5cfa60){if(!_0x5cfa60){_0x45dcda[_0xb00b('0x23')](0x194);}return _0x5cfa60;};}function handleError(_0x266f8e,_0x341f46){_0x341f46=_0x341f46||0x1f4;return function(_0x1c7a9f){logger[_0xb00b('0x1e')](_0x1c7a9f[_0xb00b('0x35')]);if(_0x1c7a9f[_0xb00b('0x36')]){delete _0x1c7a9f[_0xb00b('0x36')];}_0x266f8e['status'](_0x341f46)['send'](_0x1c7a9f);};}exports[_0xb00b('0x37')]=function(_0x56022e,_0x1c8258){var _0x1c5400={},_0x29579b={},_0x45ca74={'count':0x0,'rows':[]};var _0x37c017=_[_0xb00b('0x38')](db[_0xb00b('0x39')]['rawAttributes'],function(_0x35f1ca){return{'name':_0x35f1ca[_0xb00b('0x3a')],'type':_0x35f1ca[_0xb00b('0x3b')][_0xb00b('0x3c')]};});_0x29579b[_0xb00b('0x3d')]=_[_0xb00b('0x38')](_0x37c017,'name');_0x29579b[_0xb00b('0x3e')]=_[_0xb00b('0x3f')](_0x56022e['query']);_0x29579b[_0xb00b('0x40')]=_[_0xb00b('0x41')](_0x29579b[_0xb00b('0x3d')],_0x29579b[_0xb00b('0x3e')]);_0x1c5400[_0xb00b('0x42')]=_['intersection'](_0x29579b[_0xb00b('0x3d')],qs[_0xb00b('0x43')](_0x56022e[_0xb00b('0x3e')][_0xb00b('0x43')]));_0x1c5400['attributes']=_0x1c5400['attributes'][_0xb00b('0x44')]?_0x1c5400[_0xb00b('0x42')]:_0x29579b[_0xb00b('0x3d')];if(!_0x56022e[_0xb00b('0x3e')][_0xb00b('0x45')](_0xb00b('0x46'))){_0x1c5400[_0xb00b('0x27')]=qs['limit'](_0x56022e[_0xb00b('0x3e')][_0xb00b('0x27')]);_0x1c5400[_0xb00b('0x25')]=qs[_0xb00b('0x25')](_0x56022e[_0xb00b('0x3e')][_0xb00b('0x25')]);}_0x1c5400[_0xb00b('0x47')]=qs[_0xb00b('0x48')](_0x56022e[_0xb00b('0x3e')][_0xb00b('0x48')]);_0x1c5400[_0xb00b('0x49')]=qs[_0xb00b('0x40')](_['pick'](_0x56022e[_0xb00b('0x3e')],_0x29579b[_0xb00b('0x40')]),_0x37c017);if(_0x56022e[_0xb00b('0x3e')][_0xb00b('0x4a')]){_0x1c5400[_0xb00b('0x49')]=_[_0xb00b('0x4b')](_0x1c5400[_0xb00b('0x49')],{'$or':_[_0xb00b('0x38')](_0x37c017,function(_0x10ba60){if(_0x10ba60[_0xb00b('0x3b')]!==_0xb00b('0x4c')){var _0x3b3031={};_0x3b3031[_0x10ba60['name']]={'$like':'%'+_0x56022e['query']['filter']+'%'};return _0x3b3031;}})});}_0x1c5400=_[_0xb00b('0x4b')]({},_0x1c5400,_0x56022e[_0xb00b('0x4d')]);var _0x481154={'where':_0x1c5400[_0xb00b('0x49')]};return db[_0xb00b('0x39')][_0xb00b('0x28')](_0x481154)[_0xb00b('0x2f')](function(_0x4b62b3){_0x45ca74['count']=_0x4b62b3;if(_0x56022e[_0xb00b('0x3e')][_0xb00b('0x4e')]){_0x1c5400['include']=[{'all':!![]}];}return db['Trunk'][_0xb00b('0x4f')](_0x1c5400);})[_0xb00b('0x2f')](function(_0x4e0be4){_0x45ca74[_0xb00b('0x50')]=_0x4e0be4;return _0x45ca74;})['then'](respondWithFilteredResult(_0x1c8258,_0x1c5400))['catch'](handleError(_0x1c8258,null));};exports['show']=function(_0x465d90,_0x481515){var _0x1f7b86={'raw':![],'where':{'id':_0x465d90[_0xb00b('0x51')]['id']}},_0x3178aa={};_0x3178aa[_0xb00b('0x3d')]=_[_0xb00b('0x3f')](db[_0xb00b('0x39')]['rawAttributes']);_0x3178aa['query']=_[_0xb00b('0x3f')](_0x465d90[_0xb00b('0x3e')]);_0x3178aa['filters']=_[_0xb00b('0x41')](_0x3178aa[_0xb00b('0x3d')],_0x3178aa['query']);_0x1f7b86[_0xb00b('0x42')]=_[_0xb00b('0x41')](_0x3178aa[_0xb00b('0x3d')],qs['fields'](_0x465d90['query'][_0xb00b('0x43')]));_0x1f7b86[_0xb00b('0x42')]=_0x1f7b86[_0xb00b('0x42')][_0xb00b('0x44')]?_0x1f7b86['attributes']:_0x3178aa[_0xb00b('0x3d')];if(_0x465d90[_0xb00b('0x3e')]['includeAll']){_0x1f7b86['include']=[{'all':!![]}];}_0x1f7b86=_[_0xb00b('0x4b')]({},_0x1f7b86,_0x465d90['options']);return db[_0xb00b('0x39')][_0xb00b('0x52')](_0x1f7b86)[_0xb00b('0x2f')](handleEntityNotFound(_0x481515,null))[_0xb00b('0x2f')](respondWithResult(_0x481515,null))[_0xb00b('0x22')](handleError(_0x481515,null));};exports[_0xb00b('0x53')]=function(_0x5a3b85,_0x5d52a5){var _0x51c9e3={'where':{'id':_0x5a3b85[_0xb00b('0x51')]['id']}},_0x37d4d2={};_0x37d4d2[_0xb00b('0x3d')]=_['keys'](db[_0xb00b('0x39')][_0xb00b('0x54')]);_0x51c9e3[_0xb00b('0x42')]=_['intersection'](_0x37d4d2[_0xb00b('0x3d')],qs[_0xb00b('0x43')](_0x5a3b85[_0xb00b('0x3e')][_0xb00b('0x43')]));_0x51c9e3[_0xb00b('0x42')]=_0x51c9e3[_0xb00b('0x42')][_0xb00b('0x44')]?_0x51c9e3[_0xb00b('0x42')]:_0x37d4d2['model'];if(_0x5a3b85[_0xb00b('0x3e')][_0xb00b('0x4e')]){_0x51c9e3[_0xb00b('0x55')]=[{'all':!![]}];}_0x51c9e3=_['merge']({},_0x51c9e3,_0x5a3b85[_0xb00b('0x4d')]);return db[_0xb00b('0x39')][_0xb00b('0x52')](_0x51c9e3)[_0xb00b('0x2f')](handleEntityNotFound(_0x5d52a5,null))[_0xb00b('0x2f')](function(_0x4bfe0b){if(_0x4bfe0b){var _0xfd4ecc=_0x4bfe0b[_0xb00b('0x31')]({'plain':!![]});_0xfd4ecc=qs[_0xb00b('0x56')](_0xfd4ecc,['id',_0xb00b('0x57'),'updatedAt']);_0x5a3b85[_0xb00b('0x58')]=_[_0xb00b('0x56')](_0x5a3b85[_0xb00b('0x58')],['id',_0xb00b('0x57'),_0xb00b('0x59')]);return db[_0xb00b('0x39')][_0xb00b('0x5a')](_['merge'](_0xfd4ecc,_0x5a3b85[_0xb00b('0x58')]),{'include':_0x5a3b85['query'][_0xb00b('0x4e')]?[{'all':!![]}]:undefined})['then'](function(_0x3b3272){var _0x530d4a=_0x5a3b85[_0xb00b('0x5b')]['get']({'plain':!![]});if(!_0x530d4a)throw new Error(_0xb00b('0x5c'));if(_0x530d4a[_0xb00b('0x5d')]===_0xb00b('0x5b')){var _0x4d1cec=_0x3b3272['get']({'plain':!![]});var _0x4f7a59=_0xb00b('0x32');return db[_0xb00b('0x5e')][_0xb00b('0x52')]({'where':{'name':_0x4f7a59,'userProfileId':_0x530d4a['userProfileId']},'raw':!![]})[_0xb00b('0x2f')](function(_0x37ae88){if(_0x37ae88&&_0x37ae88[_0xb00b('0x5f')]===0x0){return db[_0xb00b('0x33')][_0xb00b('0x5a')]({'name':_0x4d1cec['name'],'resourceId':_0x4d1cec['id'],'type':_0x37ae88[_0xb00b('0x36')],'sectionId':_0x37ae88['id']},{})[_0xb00b('0x2f')](function(){return _0x3b3272;});}else{return _0x3b3272;}})['catch'](function(_0xe1316d){logger[_0xb00b('0x1e')](_0xb00b('0x60'),_0xe1316d);throw _0xe1316d;});}return _0x3b3272;});}})['then'](respondWithResult(_0x5d52a5,0xc9))['catch'](handleError(_0x5d52a5,null));};exports[_0xb00b('0x5a')]=function(_0x188da7,_0x23762e,_0x49f0a2){var _0x5aac5f;return db['Trunk']['create'](_0x188da7[_0xb00b('0x58')],{'raw':!![]})['then'](function(_0x2434a0){_0x5aac5f=_0x2434a0;return db[_0xb00b('0x39')]['findAll']({'raw':!![]});})[_0xb00b('0x2f')](function(_0x1e7f3a){var _0x2d21ec=fs[_0xb00b('0x61')](path[_0xb00b('0x62')](config['root'],_0xb00b('0x63')),_0xb00b('0x64'));var _0x3d4482=fs[_0xb00b('0x61')](path[_0xb00b('0x62')](config[_0xb00b('0x65')],_0xb00b('0x66')),'utf8');var _0x27b3ae=ejs[_0xb00b('0x67')](_0x2d21ec,{'trunks':_0x1e7f3a||[]});fs[_0xb00b('0x68')](_0xb00b('0x69'),_0x27b3ae);if(_0x5aac5f[_0xb00b('0x6a')]){var _0x432b68=ejs[_0xb00b('0x67')](_0x3d4482,{'trunks':_0x1e7f3a||[]});fs[_0xb00b('0x68')]('/etc/asterisk/sip_xcally_registers.conf',_0x432b68);}})[_0xb00b('0x2f')](function(){return respondWithRpcPromise(_0xb00b('0x6b'),_0xb00b('0x5a'),{'module':_0xb00b('0x6c')});})[_0xb00b('0x2f')](function(){var _0xfb2b68=_0x188da7[_0xb00b('0x5b')][_0xb00b('0x31')]({'plain':!![]});if(!_0xfb2b68)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xfb2b68[_0xb00b('0x5d')]===_0xb00b('0x5b')){var _0x7803a0=_0x5aac5f[_0xb00b('0x31')]({'plain':!![]});return db[_0xb00b('0x5e')][_0xb00b('0x52')]({'where':{'name':_0xb00b('0x32'),'userProfileId':_0xfb2b68['userProfileId']},'raw':!![]})[_0xb00b('0x2f')](function(_0x37a4c0){if(_0x37a4c0&&_0x37a4c0[_0xb00b('0x5f')]===0x0){return db[_0xb00b('0x33')][_0xb00b('0x5a')]({'name':_0x7803a0[_0xb00b('0x36')],'resourceId':_0x7803a0['id'],'type':_0x37a4c0['name'],'sectionId':_0x37a4c0['id']},{})[_0xb00b('0x2f')](function(){return _0x5aac5f;});}else{return _0x5aac5f;}})['catch'](function(_0x135cbf){logger['error'](_0xb00b('0x60'),_0x135cbf);throw _0x135cbf;});}return _0x5aac5f;})[_0xb00b('0x2f')](respondWithResult(_0x23762e,0xc9))[_0xb00b('0x22')](handleError(_0x23762e,null));};exports['update']=function(_0x5287cc,_0x9ad1c6,_0x3c4850){var _0x33a483;return db[_0xb00b('0x39')][_0xb00b('0x52')]({'where':{'id':_0x5287cc[_0xb00b('0x51')]['id']}})[_0xb00b('0x2f')](handleEntityNotFound(_0x9ad1c6,null))[_0xb00b('0x2f')](saveUpdates(_0x5287cc[_0xb00b('0x58')],null))[_0xb00b('0x2f')](function(_0x257430){if(_0x257430){_0x33a483=_0x257430;return db[_0xb00b('0x39')][_0xb00b('0x4f')]({'raw':!![]});}})[_0xb00b('0x2f')](function(_0x4eb17d){if(_0x4eb17d){var _0x59503c=fs[_0xb00b('0x61')](path[_0xb00b('0x62')](config['root'],'server/files/templates/trunk.ejs'),_0xb00b('0x64'));var _0x391e98=fs[_0xb00b('0x61')](path['join'](config[_0xb00b('0x65')],_0xb00b('0x66')),_0xb00b('0x64'));var _0x45c9cd=ejs[_0xb00b('0x67')](_0x59503c,{'trunks':_0x4eb17d||[]});fs[_0xb00b('0x68')](_0xb00b('0x69'),_0x45c9cd);var _0x4a9125=ejs[_0xb00b('0x67')](_0x391e98,{'trunks':_0x4eb17d||[]});fs['writeFileSync'](_0xb00b('0x6d'),_0x4a9125);return respondWithRpcPromise(_0xb00b('0x6b'),'update',{'module':_0xb00b('0x6c')});}return null;})[_0xb00b('0x2f')](function(_0xe80a21){if(_0xe80a21){return _0x33a483;}})[_0xb00b('0x2f')](respondWithResult(_0x9ad1c6,null))[_0xb00b('0x22')](handleError(_0x9ad1c6,null));};exports[_0xb00b('0x30')]=function(_0xc41c1f,_0x2423b2,_0x36ba5c){var _0x383d16;return db[_0xb00b('0x39')][_0xb00b('0x52')]({'where':{'id':_0xc41c1f['params']['id']}})[_0xb00b('0x2f')](handleEntityNotFound(_0x2423b2,null))[_0xb00b('0x2f')](removeEntity(_0x2423b2,null))[_0xb00b('0x2f')](function(){return db[_0xb00b('0x39')]['findAll']({'raw':!![]});})[_0xb00b('0x2f')](function(_0x17503d){var _0x32508b=fs[_0xb00b('0x61')](path[_0xb00b('0x62')](config['root'],_0xb00b('0x63')),_0xb00b('0x64'));var _0xa4fe1e=fs[_0xb00b('0x61')](path['join'](config[_0xb00b('0x65')],'server/files/templates/registry.ejs'),_0xb00b('0x64'));var _0x202d5f=ejs[_0xb00b('0x67')](_0x32508b,{'trunks':_0x17503d});var _0x165442=ejs[_0xb00b('0x67')](_0xa4fe1e,{'trunks':_0x17503d});fs[_0xb00b('0x68')](_0xb00b('0x69'),_0x202d5f);fs[_0xb00b('0x68')](_0xb00b('0x6d'),_0x165442);return respondWithRpcPromise(_0xb00b('0x6b'),_0xb00b('0x30'),{'module':'chan_sip.so'});})[_0xb00b('0x22')](handleError(_0x2423b2,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index 57eb5ef..e8540cc 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 _0x8640=['util','api','bluebird','request-promise','path','rimraf','./trunk.attributes','exports','tools_trunks'];(function(_0x3f4070,_0x3ff2a6){var _0x1063be=function(_0x13aa61){while(--_0x13aa61){_0x3f4070['push'](_0x3f4070['shift']());}};_0x1063be(++_0x3ff2a6);}(_0x8640,0x17a));var _0x0864=function(_0x3154bf,_0x5577bb){_0x3154bf=_0x3154bf-0x0;var _0x41e6e5=_0x8640[_0x3154bf];return _0x41e6e5;};'use strict';var _=require('lodash');var util=require(_0x0864('0x0'));var logger=require('../../config/logger')(_0x0864('0x1'));var moment=require('moment');var BPromise=require(_0x0864('0x2'));var rp=require(_0x0864('0x3'));var fs=require('fs');var path=require(_0x0864('0x4'));var rimraf=require(_0x0864('0x5'));var config=require('../../config/environment');var attributes=require(_0x0864('0x6'));module[_0x0864('0x7')]=function(_0x473b3f,_0x16927a){return _0x473b3f['define']('Trunk',attributes,{'tableName':_0x0864('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf4df=['path','rimraf','./trunk.attributes','exports','Trunk','tools_trunks','lodash','util','../../config/logger','moment','bluebird'];(function(_0x13f1eb,_0x55bf2b){var _0x4c3be0=function(_0x389ae4){while(--_0x389ae4){_0x13f1eb['push'](_0x13f1eb['shift']());}};_0x4c3be0(++_0x55bf2b);}(_0xf4df,0x171));var _0xff4d=function(_0x41285f,_0x242ecb){_0x41285f=_0x41285f-0x0;var _0x358377=_0xf4df[_0x41285f];return _0x358377;};'use strict';var _=require(_0xff4d('0x0'));var util=require(_0xff4d('0x1'));var logger=require(_0xff4d('0x2'))('api');var moment=require(_0xff4d('0x3'));var BPromise=require(_0xff4d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xff4d('0x5'));var rimraf=require(_0xff4d('0x6'));var config=require('../../config/environment');var attributes=require(_0xff4d('0x7'));module[_0xff4d('0x8')]=function(_0x4255b2,_0xac40ce){return _0x4255b2['define'](_0xff4d('0x9'),attributes,{'tableName':_0xff4d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/trunk/trunk.rpc.js b/server/api/trunk/trunk.rpc.js index 68dbacf..bebad8d 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 _0xf995=['result','GetTrunk','Trunk','options','where','attributes','limit','include','map','model','ShowTrunk','find','raw','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','Trunk,\x20%s,\x20%s','message','info'];(function(_0x1ae287,_0x19ad7c){var _0x5ba363=function(_0x222319){while(--_0x222319){_0x1ae287['push'](_0x1ae287['shift']());}};_0x5ba363(++_0x19ad7c);}(_0xf995,0xd4));var _0x5f99=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xf995[_0xa464c9];return _0x3d73c4;};'use strict';var _=require('lodash');var util=require(_0x5f99('0x0'));var moment=require('moment');var BPromise=require(_0x5f99('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5f99('0x2'));var db=require(_0x5f99('0x3'))['db'];var utils=require(_0x5f99('0x4'));var logger=require(_0x5f99('0x5'))('rpc');var config=require(_0x5f99('0x6'));var jayson=require(_0x5f99('0x7'));var client=jayson['client'][_0x5f99('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x49d033,_0x55c879,_0x32bfb9){return new BPromise(function(_0x5c1893,_0x1f849d){return client[_0x5f99('0x9')](_0x49d033,_0x32bfb9)[_0x5f99('0xa')](function(_0x482dcd){logger['info']('Trunk,\x20%s,\x20%s',_0x55c879,_0x5f99('0xb'));logger[_0x5f99('0xc')](_0x5f99('0xd'),_0x55c879,_0x5f99('0xb'),JSON[_0x5f99('0xe')](_0x482dcd));if(_0x482dcd[_0x5f99('0xf')]){if(_0x482dcd[_0x5f99('0xf')]['code']===0x1f4){logger['error'](_0x5f99('0x10'),_0x55c879,_0x482dcd[_0x5f99('0xf')][_0x5f99('0x11')]);return _0x1f849d(_0x482dcd[_0x5f99('0xf')][_0x5f99('0x11')]);}logger[_0x5f99('0xf')](_0x5f99('0x10'),_0x55c879,_0x482dcd[_0x5f99('0xf')][_0x5f99('0x11')]);return _0x5c1893(_0x482dcd['error'][_0x5f99('0x11')]);}else{logger[_0x5f99('0x12')](_0x5f99('0x10'),_0x55c879,_0x5f99('0xb'));_0x5c1893(_0x482dcd[_0x5f99('0x13')][_0x5f99('0x11')]);}})['catch'](function(_0x55bd8c){logger['error']('Trunk,\x20%s,\x20%s',_0x55c879,_0x55bd8c);_0x1f849d(_0x55bd8c);});});}exports[_0x5f99('0x14')]=function(_0x2f46cf){var _0x348329=this;return new Promise(function(_0x4c92dd,_0x31d988){return db[_0x5f99('0x15')]['findAll']({'raw':_0x2f46cf[_0x5f99('0x16')]?_0x2f46cf[_0x5f99('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x2f46cf[_0x5f99('0x16')]?_0x2f46cf[_0x5f99('0x16')][_0x5f99('0x17')]||null:null,'attributes':_0x2f46cf[_0x5f99('0x16')]?_0x2f46cf[_0x5f99('0x16')][_0x5f99('0x18')]||null:null,'limit':_0x2f46cf[_0x5f99('0x16')]?_0x2f46cf[_0x5f99('0x16')][_0x5f99('0x19')]||null:null,'include':_0x2f46cf[_0x5f99('0x16')]?_0x2f46cf['options'][_0x5f99('0x1a')]?_[_0x5f99('0x1b')](_0x2f46cf['options'][_0x5f99('0x1a')],function(_0x289a42){return{'model':db[_0x289a42[_0x5f99('0x1c')]],'as':_0x289a42['as'],'attributes':_0x289a42[_0x5f99('0x18')],'include':_0x289a42[_0x5f99('0x1a')]?_[_0x5f99('0x1b')](_0x289a42[_0x5f99('0x1a')],function(_0x18feaa){return{'model':db[_0x18feaa[_0x5f99('0x1c')]],'as':_0x18feaa['as'],'attributes':_0x18feaa['attributes'],'include':_0x18feaa[_0x5f99('0x1a')]?_['map'](_0x18feaa[_0x5f99('0x1a')],function(_0x56129b){return{'model':db[_0x56129b[_0x5f99('0x1c')]],'as':_0x56129b['as'],'attributes':_0x56129b[_0x5f99('0x18')]};}):[]};}):[]};}):[]:[]})[_0x5f99('0xa')](function(_0x20c557){logger[_0x5f99('0x12')](_0x5f99('0x14'),_0x2f46cf);logger[_0x5f99('0xc')](_0x5f99('0x14'),_0x2f46cf,JSON[_0x5f99('0xe')](_0x20c557));_0x4c92dd(_0x20c557);})['catch'](function(_0x4f8d04){logger['error']('GetTrunk',_0x4f8d04[_0x5f99('0x11')],_0x2f46cf);_0x31d988(_0x348329[_0x5f99('0xf')](0x1f4,_0x4f8d04[_0x5f99('0x11')]));});});};exports[_0x5f99('0x1d')]=function(_0x466c60){var _0x42b5a0=this;return new Promise(function(_0x36fcd5,_0x30a928){return db[_0x5f99('0x15')][_0x5f99('0x1e')]({'raw':_0x466c60[_0x5f99('0x16')]?_0x466c60[_0x5f99('0x16')][_0x5f99('0x1f')]===undefined?!![]:![]:!![],'where':_0x466c60[_0x5f99('0x16')]?_0x466c60[_0x5f99('0x16')][_0x5f99('0x17')]||null:null,'attributes':_0x466c60[_0x5f99('0x16')]?_0x466c60[_0x5f99('0x16')]['attributes']||null:null,'include':_0x466c60[_0x5f99('0x16')]?_0x466c60[_0x5f99('0x16')]['include']?_[_0x5f99('0x1b')](_0x466c60[_0x5f99('0x16')]['include'],function(_0x2b3f4f){return{'model':db[_0x2b3f4f[_0x5f99('0x1c')]],'as':_0x2b3f4f['as'],'attributes':_0x2b3f4f[_0x5f99('0x18')],'include':_0x2b3f4f['include']?_['map'](_0x2b3f4f['include'],function(_0x26bfda){return{'model':db[_0x26bfda[_0x5f99('0x1c')]],'as':_0x26bfda['as'],'attributes':_0x26bfda['attributes'],'include':_0x26bfda[_0x5f99('0x1a')]?_['map'](_0x26bfda['include'],function(_0x185dea){return{'model':db[_0x185dea[_0x5f99('0x1c')]],'as':_0x185dea['as'],'attributes':_0x185dea[_0x5f99('0x18')]};}):[]};}):[]};}):[]:[]})[_0x5f99('0xa')](function(_0x5d44f6){logger[_0x5f99('0x12')](_0x5f99('0x1d'),_0x466c60);logger[_0x5f99('0xc')]('ShowTrunk',_0x466c60,JSON[_0x5f99('0xe')](_0x5d44f6));_0x36fcd5(_0x5d44f6);})[_0x5f99('0x20')](function(_0x7e9c8c){logger[_0x5f99('0xf')](_0x5f99('0x1d'),_0x7e9c8c[_0x5f99('0x11')],_0x466c60);_0x30a928(_0x42b5a0['error'](0x1f4,_0x7e9c8c['message']));});});}; \ No newline at end of file +var _0x76d4=['Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','GetTrunk','Trunk','findAll','options','where','attributes','limit','include','map','model','then','info','ShowTrunk','find','raw','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','request','Trunk,\x20%s,\x20%s','debug'];(function(_0x4e6425,_0x50e4ac){var _0x2fb861=function(_0xbf6df5){while(--_0xbf6df5){_0x4e6425['push'](_0x4e6425['shift']());}};_0x2fb861(++_0x50e4ac);}(_0x76d4,0x16a));var _0x476d=function(_0x312f00,_0x79300c){_0x312f00=_0x312f00-0x0;var _0x23d919=_0x76d4[_0x312f00];return _0x23d919;};'use strict';var _=require('lodash');var util=require(_0x476d('0x0'));var moment=require(_0x476d('0x1'));var BPromise=require(_0x476d('0x2'));var rs=require(_0x476d('0x3'));var fs=require('fs');var Redis=require(_0x476d('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x476d('0x5'))(_0x476d('0x6'));var config=require('../../config/environment');var jayson=require(_0x476d('0x7'));var client=jayson[_0x476d('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4a4474,_0x241a56,_0x3b5a06){return new BPromise(function(_0x27960a,_0x1cc3e5){return client[_0x476d('0x9')](_0x4a4474,_0x3b5a06)['then'](function(_0xfa6814){logger['info'](_0x476d('0xa'),_0x241a56,'request\x20sent');logger[_0x476d('0xb')](_0x476d('0xc'),_0x241a56,_0x476d('0xd'),JSON[_0x476d('0xe')](_0xfa6814));if(_0xfa6814[_0x476d('0xf')]){if(_0xfa6814[_0x476d('0xf')][_0x476d('0x10')]===0x1f4){logger[_0x476d('0xf')](_0x476d('0xa'),_0x241a56,_0xfa6814[_0x476d('0xf')][_0x476d('0x11')]);return _0x1cc3e5(_0xfa6814[_0x476d('0xf')]['message']);}logger[_0x476d('0xf')](_0x476d('0xa'),_0x241a56,_0xfa6814[_0x476d('0xf')][_0x476d('0x11')]);return _0x27960a(_0xfa6814[_0x476d('0xf')][_0x476d('0x11')]);}else{logger['info'](_0x476d('0xa'),_0x241a56,_0x476d('0xd'));_0x27960a(_0xfa6814['result'][_0x476d('0x11')]);}})[_0x476d('0x12')](function(_0x423fd8){logger[_0x476d('0xf')](_0x476d('0xa'),_0x241a56,_0x423fd8);_0x1cc3e5(_0x423fd8);});});}exports[_0x476d('0x13')]=function(_0x1bfecf){var _0x5c3dc4=this;return new Promise(function(_0x333a4f,_0x59c0d8){return db[_0x476d('0x14')][_0x476d('0x15')]({'raw':_0x1bfecf[_0x476d('0x16')]?_0x1bfecf['options']['raw']===undefined?!![]:![]:!![],'where':_0x1bfecf[_0x476d('0x16')]?_0x1bfecf[_0x476d('0x16')][_0x476d('0x17')]||null:null,'attributes':_0x1bfecf[_0x476d('0x16')]?_0x1bfecf[_0x476d('0x16')][_0x476d('0x18')]||null:null,'limit':_0x1bfecf[_0x476d('0x16')]?_0x1bfecf[_0x476d('0x16')][_0x476d('0x19')]||null:null,'include':_0x1bfecf['options']?_0x1bfecf['options'][_0x476d('0x1a')]?_[_0x476d('0x1b')](_0x1bfecf[_0x476d('0x16')][_0x476d('0x1a')],function(_0x474902){return{'model':db[_0x474902[_0x476d('0x1c')]],'as':_0x474902['as'],'attributes':_0x474902['attributes'],'include':_0x474902[_0x476d('0x1a')]?_[_0x476d('0x1b')](_0x474902[_0x476d('0x1a')],function(_0x2ef09f){return{'model':db[_0x2ef09f[_0x476d('0x1c')]],'as':_0x2ef09f['as'],'attributes':_0x2ef09f[_0x476d('0x18')],'include':_0x2ef09f[_0x476d('0x1a')]?_['map'](_0x2ef09f['include'],function(_0x46ea6e){return{'model':db[_0x46ea6e['model']],'as':_0x46ea6e['as'],'attributes':_0x46ea6e[_0x476d('0x18')]};}):[]};}):[]};}):[]:[]})[_0x476d('0x1d')](function(_0x359364){logger[_0x476d('0x1e')](_0x476d('0x13'),_0x1bfecf);logger[_0x476d('0xb')]('GetTrunk',_0x1bfecf,JSON['stringify'](_0x359364));_0x333a4f(_0x359364);})[_0x476d('0x12')](function(_0x4b956b){logger[_0x476d('0xf')](_0x476d('0x13'),_0x4b956b['message'],_0x1bfecf);_0x59c0d8(_0x5c3dc4[_0x476d('0xf')](0x1f4,_0x4b956b[_0x476d('0x11')]));});});};exports[_0x476d('0x1f')]=function(_0x34e599){var _0x3296e1=this;return new Promise(function(_0x51b944,_0x14580a){return db[_0x476d('0x14')][_0x476d('0x20')]({'raw':_0x34e599[_0x476d('0x16')]?_0x34e599['options'][_0x476d('0x21')]===undefined?!![]:![]:!![],'where':_0x34e599['options']?_0x34e599['options'][_0x476d('0x17')]||null:null,'attributes':_0x34e599[_0x476d('0x16')]?_0x34e599[_0x476d('0x16')][_0x476d('0x18')]||null:null,'include':_0x34e599[_0x476d('0x16')]?_0x34e599[_0x476d('0x16')][_0x476d('0x1a')]?_[_0x476d('0x1b')](_0x34e599[_0x476d('0x16')]['include'],function(_0x5cc733){return{'model':db[_0x5cc733[_0x476d('0x1c')]],'as':_0x5cc733['as'],'attributes':_0x5cc733[_0x476d('0x18')],'include':_0x5cc733[_0x476d('0x1a')]?_[_0x476d('0x1b')](_0x5cc733[_0x476d('0x1a')],function(_0x2451cb){return{'model':db[_0x2451cb[_0x476d('0x1c')]],'as':_0x2451cb['as'],'attributes':_0x2451cb[_0x476d('0x18')],'include':_0x2451cb[_0x476d('0x1a')]?_[_0x476d('0x1b')](_0x2451cb[_0x476d('0x1a')],function(_0x5cd214){return{'model':db[_0x5cd214[_0x476d('0x1c')]],'as':_0x5cd214['as'],'attributes':_0x5cd214[_0x476d('0x18')]};}):[]};}):[]};}):[]:[]})[_0x476d('0x1d')](function(_0x573500){logger[_0x476d('0x1e')](_0x476d('0x1f'),_0x34e599);logger[_0x476d('0xb')](_0x476d('0x1f'),_0x34e599,JSON['stringify'](_0x573500));_0x51b944(_0x573500);})[_0x476d('0x12')](function(_0x417eb1){logger[_0x476d('0xf')]('ShowTrunk',_0x417eb1[_0x476d('0x11')],_0x34e599);_0x14580a(_0x3296e1[_0x476d('0xf')](0x1f4,_0x417eb1['message']));});});}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index fbe609b..06284aa 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 _0x2944=['addFaxAccounts','addMailAccounts','addOpenchannelAccounts','addSmsAccounts','/:id/whatsapp_accounts','addSquareProjects','createApiKey','update','/:id/password','changePassword','delete','destroy','removeChatInteractions','removeMailInteractions','removeFaxInteractions','removeSmsInteractions','/:id/whatsapp_interactions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeWhatsappAccounts','removeSquareProjects','exports','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','describe','whoami','/presence','getPresence','/:id','show','/:id/avatar','getAvatar','/:id/open_tabs','/:id/contacts','/:id/queues','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','getRecordings','/:id/screen_recordings','getScreenRecordings','/:id/openchannel/interactions','getOpenchannelInteractions','getMailInteractions','/:id/sms/interactions','/:id/fax/interactions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','getTeams','/:id/agents','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','getWhatsappAccounts','/:id/square_projects','getSquareProjects','/:id/scheduled_calls','getScheduledCalls','/:id/api_key','getApiKey','post','create','/create_many','bulkCreate','addQueues','diskStorage','join','root','server/files/images/','format','%s-%s','now','originalname','single','file','addAvatar','/:id/login','login','/:id/logout','logout','pause','/:id/unpause','unpause','addTeams','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','addWhatsappInteractions'];(function(_0x330708,_0x13e6fe){var _0x503314=function(_0x674b1){while(--_0x674b1){_0x330708['push'](_0x330708['shift']());}};_0x503314(++_0x13e6fe);}(_0x2944,0x91));var _0x4294=function(_0x243b2f,_0x30aa15){_0x243b2f=_0x243b2f-0x0;var _0xcb3c2d=_0x2944[_0x243b2f];return _0xcb3c2d;};'use strict';var multer=require('multer');var util=require(_0x4294('0x0'));var path=require('path');var timeout=require(_0x4294('0x1'));var express=require(_0x4294('0x2'));var router=express[_0x4294('0x3')]();var fs_extra=require(_0x4294('0x4'));var auth=require(_0x4294('0x5'));var interaction=require(_0x4294('0x6'));var config=require(_0x4294('0x7'));var controller=require('./user.controller');router[_0x4294('0x8')]('/',auth['isAuthenticated'](),controller[_0x4294('0x9')]);router[_0x4294('0x8')]('/describe',auth[_0x4294('0xa')](),controller[_0x4294('0xb')]);router[_0x4294('0x8')]('/whoami',auth[_0x4294('0xa')](),controller[_0x4294('0xc')]);router['get'](_0x4294('0xd'),auth[_0x4294('0xa')](),controller[_0x4294('0xe')]);router[_0x4294('0x8')](_0x4294('0xf'),auth[_0x4294('0xa')](),controller[_0x4294('0x10')]);router[_0x4294('0x8')](_0x4294('0x11'),controller[_0x4294('0x12')]);router['get'](_0x4294('0x13'),auth[_0x4294('0xa')](),controller['getOpenTabs']);router[_0x4294('0x8')](_0x4294('0x14'),auth['isAuthenticated'](),controller['getContacts']);router[_0x4294('0x8')](_0x4294('0x15'),auth[_0x4294('0xa')](),controller[_0x4294('0x16')]);router[_0x4294('0x8')](_0x4294('0x17'),auth[_0x4294('0xa')](),controller[_0x4294('0x18')]);router[_0x4294('0x8')](_0x4294('0x19'),auth['isAuthenticated'](),controller[_0x4294('0x1a')]);router[_0x4294('0x8')](_0x4294('0x1b'),auth[_0x4294('0xa')](),controller[_0x4294('0x1c')]);router[_0x4294('0x8')](_0x4294('0x1d'),auth[_0x4294('0xa')](),controller[_0x4294('0x1e')]);router[_0x4294('0x8')]('/:id/chat/interactions',auth[_0x4294('0xa')](),controller['getChatInteractions']);router[_0x4294('0x8')](_0x4294('0x1f'),auth['isAuthenticated'](),controller[_0x4294('0x20')]);router[_0x4294('0x8')]('/:id/mail/interactions',auth[_0x4294('0xa')](),controller[_0x4294('0x21')]);router['get'](_0x4294('0x22'),auth[_0x4294('0xa')](),controller['getSmsInteractions']);router['get'](_0x4294('0x23'),auth[_0x4294('0xa')](),controller[_0x4294('0x24')]);router[_0x4294('0x8')](_0x4294('0x25'),auth[_0x4294('0xa')](),controller[_0x4294('0x26')]);router[_0x4294('0x8')](_0x4294('0x27'),auth[_0x4294('0xa')](),controller[_0x4294('0x28')]);router[_0x4294('0x8')]('/:id/lists',auth[_0x4294('0xa')](),controller['getLists']);router[_0x4294('0x8')](_0x4294('0x29'),auth[_0x4294('0xa')](),controller['getAgents']);router[_0x4294('0x8')](_0x4294('0x2a'),auth['isAuthenticated'](),controller[_0x4294('0x2b')]);router[_0x4294('0x8')](_0x4294('0x2c'),auth[_0x4294('0xa')](),controller[_0x4294('0x2d')]);router['get'](_0x4294('0x2e'),auth[_0x4294('0xa')](),controller[_0x4294('0x2f')]);router[_0x4294('0x8')](_0x4294('0x30'),auth['isAuthenticated'](),controller['getOpenchannelAccounts']);router[_0x4294('0x8')](_0x4294('0x31'),auth[_0x4294('0xa')](),controller[_0x4294('0x32')]);router[_0x4294('0x8')](_0x4294('0x33'),auth['isAuthenticated'](),controller[_0x4294('0x34')]);router[_0x4294('0x8')]('/:id/whatsapp_accounts',auth['isAuthenticated'](),controller[_0x4294('0x35')]);router[_0x4294('0x8')](_0x4294('0x36'),auth[_0x4294('0xa')](),controller[_0x4294('0x37')]);router[_0x4294('0x8')](_0x4294('0x38'),auth[_0x4294('0xa')](),controller[_0x4294('0x39')]);router['get'](_0x4294('0x3a'),auth[_0x4294('0xa')](),controller[_0x4294('0x3b')]);router[_0x4294('0x3c')](_0x4294('0x14'),auth[_0x4294('0xa')](),controller['addContacts']);router['post']('/',auth[_0x4294('0xa')](),controller[_0x4294('0x3d')]);router[_0x4294('0x3c')](_0x4294('0x3e'),auth[_0x4294('0xa')](),controller[_0x4294('0x3f')]);router[_0x4294('0x3c')](_0x4294('0x15'),auth[_0x4294('0xa')](),controller[_0x4294('0x40')]);var upload=multer({'storage':multer[_0x4294('0x41')]({'destination':function(_0x40b141,_0x397556,_0x5082f8){_0x5082f8(null,path[_0x4294('0x42')](config[_0x4294('0x43')],_0x4294('0x44')));},'filename':function(_0x54be1b,_0x8092f6,_0x304e66){_0x304e66(null,util[_0x4294('0x45')](_0x4294('0x46'),Date[_0x4294('0x47')](),_0x8092f6[_0x4294('0x48')]));}})});router['post'](_0x4294('0x11'),upload[_0x4294('0x49')](_0x4294('0x4a')),controller[_0x4294('0x4b')]);router[_0x4294('0x3c')](_0x4294('0x4c'),auth[_0x4294('0xa')](),controller[_0x4294('0x4d')]);router[_0x4294('0x3c')](_0x4294('0x4e'),auth[_0x4294('0xa')](),controller[_0x4294('0x4f')]);router['post']('/:id/pause',auth[_0x4294('0xa')](),controller[_0x4294('0x50')]);router['post'](_0x4294('0x51'),auth[_0x4294('0xa')](),controller[_0x4294('0x52')]);router[_0x4294('0x3c')](_0x4294('0x27'),auth[_0x4294('0xa')](),controller[_0x4294('0x53')]);router[_0x4294('0x3c')](_0x4294('0x54'),auth[_0x4294('0xa')](),controller[_0x4294('0x55')]);router['post'](_0x4294('0x56'),auth[_0x4294('0xa')](),controller[_0x4294('0x57')]);router['post'](_0x4294('0x58'),auth[_0x4294('0xa')](),controller[_0x4294('0x59')]);router[_0x4294('0x3c')](_0x4294('0x5a'),auth['isAuthenticated'](),controller[_0x4294('0x5b')]);router[_0x4294('0x3c')](_0x4294('0x5c'),auth[_0x4294('0xa')](),controller[_0x4294('0x5d')]);router[_0x4294('0x3c')]('/:id/whatsapp_interactions',auth[_0x4294('0xa')](),controller[_0x4294('0x5e')]);router[_0x4294('0x3c')](_0x4294('0x2c'),auth[_0x4294('0xa')](),controller[_0x4294('0x5f')]);router[_0x4294('0x3c')](_0x4294('0x2e'),auth['isAuthenticated'](),controller[_0x4294('0x60')]);router[_0x4294('0x3c')](_0x4294('0x30'),auth[_0x4294('0xa')](),controller[_0x4294('0x61')]);router[_0x4294('0x3c')](_0x4294('0x31'),auth[_0x4294('0xa')](),controller[_0x4294('0x62')]);router[_0x4294('0x3c')](_0x4294('0x33'),auth[_0x4294('0xa')](),controller['addChatWebsites']);router[_0x4294('0x3c')](_0x4294('0x63'),auth[_0x4294('0xa')](),controller['addWhatsappAccounts']);router[_0x4294('0x3c')](_0x4294('0x36'),auth['isAuthenticated'](),controller[_0x4294('0x64')]);router[_0x4294('0x3c')]('/:id/api_key',auth[_0x4294('0xa')](),controller[_0x4294('0x65')]);router['put'](_0x4294('0xf'),auth[_0x4294('0xa')](),controller[_0x4294('0x66')]);router['put'](_0x4294('0x67'),auth[_0x4294('0xa')](),controller[_0x4294('0x68')]);router['delete'](_0x4294('0x15'),auth[_0x4294('0xa')](),controller['removeQueues']);router['delete'](_0x4294('0x27'),auth[_0x4294('0xa')](),controller['removeTeams']);router[_0x4294('0x69')](_0x4294('0xf'),auth['isAuthenticated'](),controller[_0x4294('0x6a')]);router[_0x4294('0x69')](_0x4294('0x54'),auth[_0x4294('0xa')](),controller[_0x4294('0x6b')]);router['delete'](_0x4294('0x56'),auth[_0x4294('0xa')](),controller[_0x4294('0x6c')]);router['delete'](_0x4294('0x58'),auth[_0x4294('0xa')](),controller[_0x4294('0x6d')]);router['delete'](_0x4294('0x5a'),auth['isAuthenticated'](),controller[_0x4294('0x6e')]);router[_0x4294('0x69')](_0x4294('0x5c'),auth[_0x4294('0xa')](),controller['removeOpenchannelInteractions']);router[_0x4294('0x69')](_0x4294('0x6f'),auth[_0x4294('0xa')](),controller['removeWhatsappInteractions']);router[_0x4294('0x69')]('/:id/fax_accounts',auth[_0x4294('0xa')](),controller[_0x4294('0x70')]);router[_0x4294('0x69')]('/:id/mail_accounts',auth[_0x4294('0xa')](),controller[_0x4294('0x71')]);router[_0x4294('0x69')](_0x4294('0x30'),auth[_0x4294('0xa')](),controller[_0x4294('0x72')]);router['delete'](_0x4294('0x31'),auth[_0x4294('0xa')](),controller[_0x4294('0x73')]);router[_0x4294('0x69')](_0x4294('0x33'),auth['isAuthenticated'](),controller[_0x4294('0x74')]);router['delete'](_0x4294('0x63'),auth[_0x4294('0xa')](),controller[_0x4294('0x75')]);router[_0x4294('0x69')](_0x4294('0x36'),auth[_0x4294('0xa')](),controller[_0x4294('0x76')]);router[_0x4294('0x69')]('/:id/api_key',auth[_0x4294('0xa')](),controller['removeApiKey']);module[_0x4294('0x77')]=router; \ No newline at end of file +var _0x1904=['bulkCreate','addQueues','join','root','server/files/images/','format','%s-%s','file','addAvatar','/:id/login','/:id/logout','logout','/:id/pause','/:id/unpause','unpause','addTeams','addChatInteractions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','/:id/whatsapp_interactions','addFaxAccounts','addMailAccounts','addOpenchannelAccounts','addChatWebsites','addWhatsappAccounts','addSquareProjects','createApiKey','update','put','/:id/password','changePassword','delete','removeQueues','removeTeams','destroy','/:id/chat_interactions','removeChatInteractions','/:id/mail_interactions','removeMailInteractions','removeFaxInteractions','removeSmsInteractions','removeOpenchannelInteractions','removeWhatsappInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeWhatsappAccounts','removeSquareProjects','removeApiKey','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./user.controller','index','get','/describe','/whoami','isAuthenticated','whoami','/presence','/:id','show','/:id/avatar','getAvatar','/:id/open_tabs','getOpenTabs','getContacts','/:id/queues','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/recordings','getRecordings','/:id/screen_recordings','getScreenRecordings','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','getFaxInteractions','/:id/whatsapp/interactions','getWhatsappInteractions','/:id/teams','/:id/lists','getLists','/:id/agents','getAgents','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','/:id/whatsapp_accounts','getWhatsappAccounts','/:id/square_projects','getSquareProjects','getScheduledCalls','/:id/api_key','/:id/contacts','addContacts','post','create'];(function(_0x466082,_0xc63d4f){var _0x22080f=function(_0x12e889){while(--_0x12e889){_0x466082['push'](_0x466082['shift']());}};_0x22080f(++_0xc63d4f);}(_0x1904,0x133));var _0x4190=function(_0x5b3fb4,_0x32f165){_0x5b3fb4=_0x5b3fb4-0x0;var _0x42c374=_0x1904[_0x5b3fb4];return _0x42c374;};'use strict';var multer=require(_0x4190('0x0'));var util=require(_0x4190('0x1'));var path=require('path');var timeout=require(_0x4190('0x2'));var express=require(_0x4190('0x3'));var router=express[_0x4190('0x4')]();var fs_extra=require(_0x4190('0x5'));var auth=require(_0x4190('0x6'));var interaction=require(_0x4190('0x7'));var config=require(_0x4190('0x8'));var controller=require(_0x4190('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x4190('0xa')]);router[_0x4190('0xb')](_0x4190('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0x4190('0xb')](_0x4190('0xd'),auth[_0x4190('0xe')](),controller[_0x4190('0xf')]);router['get'](_0x4190('0x10'),auth[_0x4190('0xe')](),controller['getPresence']);router[_0x4190('0xb')](_0x4190('0x11'),auth[_0x4190('0xe')](),controller[_0x4190('0x12')]);router[_0x4190('0xb')](_0x4190('0x13'),controller[_0x4190('0x14')]);router[_0x4190('0xb')](_0x4190('0x15'),auth['isAuthenticated'](),controller[_0x4190('0x16')]);router[_0x4190('0xb')]('/:id/contacts',auth[_0x4190('0xe')](),controller[_0x4190('0x17')]);router[_0x4190('0xb')](_0x4190('0x18'),auth['isAuthenticated'](),controller[_0x4190('0x19')]);router['get'](_0x4190('0x1a'),auth[_0x4190('0xe')](),controller[_0x4190('0x1b')]);router[_0x4190('0xb')]('/:id/groups',auth[_0x4190('0xe')](),controller['getGroups']);router[_0x4190('0xb')](_0x4190('0x1c'),auth[_0x4190('0xe')](),controller[_0x4190('0x1d')]);router[_0x4190('0xb')](_0x4190('0x1e'),auth[_0x4190('0xe')](),controller[_0x4190('0x1f')]);router[_0x4190('0xb')]('/:id/chat/interactions',auth['isAuthenticated'](),controller[_0x4190('0x20')]);router[_0x4190('0xb')](_0x4190('0x21'),auth[_0x4190('0xe')](),controller[_0x4190('0x22')]);router[_0x4190('0xb')]('/:id/mail/interactions',auth[_0x4190('0xe')](),controller[_0x4190('0x23')]);router[_0x4190('0xb')](_0x4190('0x24'),auth[_0x4190('0xe')](),controller[_0x4190('0x25')]);router[_0x4190('0xb')]('/:id/fax/interactions',auth[_0x4190('0xe')](),controller[_0x4190('0x26')]);router[_0x4190('0xb')](_0x4190('0x27'),auth[_0x4190('0xe')](),controller[_0x4190('0x28')]);router[_0x4190('0xb')](_0x4190('0x29'),auth['isAuthenticated'](),controller['getTeams']);router[_0x4190('0xb')](_0x4190('0x2a'),auth[_0x4190('0xe')](),controller[_0x4190('0x2b')]);router[_0x4190('0xb')](_0x4190('0x2c'),auth[_0x4190('0xe')](),controller[_0x4190('0x2d')]);router[_0x4190('0xb')](_0x4190('0x2e'),auth['isAuthenticated'](),controller[_0x4190('0x2f')]);router[_0x4190('0xb')](_0x4190('0x30'),auth['isAuthenticated'](),controller[_0x4190('0x31')]);router[_0x4190('0xb')](_0x4190('0x32'),auth[_0x4190('0xe')](),controller[_0x4190('0x33')]);router[_0x4190('0xb')](_0x4190('0x34'),auth[_0x4190('0xe')](),controller[_0x4190('0x35')]);router['get'](_0x4190('0x36'),auth['isAuthenticated'](),controller[_0x4190('0x37')]);router['get'](_0x4190('0x38'),auth[_0x4190('0xe')](),controller[_0x4190('0x39')]);router[_0x4190('0xb')](_0x4190('0x3a'),auth[_0x4190('0xe')](),controller[_0x4190('0x3b')]);router['get'](_0x4190('0x3c'),auth[_0x4190('0xe')](),controller[_0x4190('0x3d')]);router['get']('/:id/scheduled_calls',auth[_0x4190('0xe')](),controller[_0x4190('0x3e')]);router[_0x4190('0xb')](_0x4190('0x3f'),auth[_0x4190('0xe')](),controller['getApiKey']);router['post'](_0x4190('0x40'),auth[_0x4190('0xe')](),controller[_0x4190('0x41')]);router[_0x4190('0x42')]('/',auth['isAuthenticated'](),controller[_0x4190('0x43')]);router[_0x4190('0x42')]('/create_many',auth[_0x4190('0xe')](),controller[_0x4190('0x44')]);router[_0x4190('0x42')]('/:id/queues',auth[_0x4190('0xe')](),controller[_0x4190('0x45')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3561a3,_0x51d334,_0x23455d){_0x23455d(null,path[_0x4190('0x46')](config[_0x4190('0x47')],_0x4190('0x48')));},'filename':function(_0x120ba2,_0x16f9b8,_0x1466a7){_0x1466a7(null,util[_0x4190('0x49')](_0x4190('0x4a'),Date['now'](),_0x16f9b8['originalname']));}})});router['post']('/:id/avatar',upload['single'](_0x4190('0x4b')),controller[_0x4190('0x4c')]);router[_0x4190('0x42')](_0x4190('0x4d'),auth[_0x4190('0xe')](),controller['login']);router[_0x4190('0x42')](_0x4190('0x4e'),auth[_0x4190('0xe')](),controller[_0x4190('0x4f')]);router[_0x4190('0x42')](_0x4190('0x50'),auth[_0x4190('0xe')](),controller['pause']);router['post'](_0x4190('0x51'),auth[_0x4190('0xe')](),controller[_0x4190('0x52')]);router[_0x4190('0x42')](_0x4190('0x29'),auth[_0x4190('0xe')](),controller[_0x4190('0x53')]);router[_0x4190('0x42')]('/:id/chat_interactions',auth[_0x4190('0xe')](),controller[_0x4190('0x54')]);router[_0x4190('0x42')]('/:id/mail_interactions',auth[_0x4190('0xe')](),controller[_0x4190('0x55')]);router['post'](_0x4190('0x56'),auth[_0x4190('0xe')](),controller[_0x4190('0x57')]);router[_0x4190('0x42')](_0x4190('0x58'),auth['isAuthenticated'](),controller[_0x4190('0x59')]);router[_0x4190('0x42')](_0x4190('0x5a'),auth[_0x4190('0xe')](),controller[_0x4190('0x5b')]);router['post'](_0x4190('0x5c'),auth[_0x4190('0xe')](),controller['addWhatsappInteractions']);router[_0x4190('0x42')](_0x4190('0x30'),auth[_0x4190('0xe')](),controller[_0x4190('0x5d')]);router[_0x4190('0x42')](_0x4190('0x32'),auth[_0x4190('0xe')](),controller[_0x4190('0x5e')]);router[_0x4190('0x42')](_0x4190('0x34'),auth[_0x4190('0xe')](),controller[_0x4190('0x5f')]);router['post'](_0x4190('0x36'),auth[_0x4190('0xe')](),controller['addSmsAccounts']);router[_0x4190('0x42')](_0x4190('0x38'),auth[_0x4190('0xe')](),controller[_0x4190('0x60')]);router['post'](_0x4190('0x3a'),auth[_0x4190('0xe')](),controller[_0x4190('0x61')]);router[_0x4190('0x42')](_0x4190('0x3c'),auth[_0x4190('0xe')](),controller[_0x4190('0x62')]);router['post'](_0x4190('0x3f'),auth[_0x4190('0xe')](),controller[_0x4190('0x63')]);router['put'](_0x4190('0x11'),auth[_0x4190('0xe')](),controller[_0x4190('0x64')]);router[_0x4190('0x65')](_0x4190('0x66'),auth[_0x4190('0xe')](),controller[_0x4190('0x67')]);router[_0x4190('0x68')](_0x4190('0x18'),auth[_0x4190('0xe')](),controller[_0x4190('0x69')]);router[_0x4190('0x68')]('/:id/teams',auth[_0x4190('0xe')](),controller[_0x4190('0x6a')]);router[_0x4190('0x68')](_0x4190('0x11'),auth[_0x4190('0xe')](),controller[_0x4190('0x6b')]);router[_0x4190('0x68')](_0x4190('0x6c'),auth[_0x4190('0xe')](),controller[_0x4190('0x6d')]);router['delete'](_0x4190('0x6e'),auth[_0x4190('0xe')](),controller[_0x4190('0x6f')]);router[_0x4190('0x68')](_0x4190('0x56'),auth[_0x4190('0xe')](),controller[_0x4190('0x70')]);router[_0x4190('0x68')]('/:id/sms_interactions',auth[_0x4190('0xe')](),controller[_0x4190('0x71')]);router['delete'](_0x4190('0x5a'),auth['isAuthenticated'](),controller[_0x4190('0x72')]);router[_0x4190('0x68')](_0x4190('0x5c'),auth['isAuthenticated'](),controller[_0x4190('0x73')]);router[_0x4190('0x68')](_0x4190('0x30'),auth['isAuthenticated'](),controller[_0x4190('0x74')]);router[_0x4190('0x68')](_0x4190('0x32'),auth[_0x4190('0xe')](),controller[_0x4190('0x75')]);router[_0x4190('0x68')](_0x4190('0x34'),auth[_0x4190('0xe')](),controller[_0x4190('0x76')]);router[_0x4190('0x68')](_0x4190('0x36'),auth[_0x4190('0xe')](),controller[_0x4190('0x77')]);router[_0x4190('0x68')]('/:id/chat_websites',auth['isAuthenticated'](),controller[_0x4190('0x78')]);router[_0x4190('0x68')](_0x4190('0x3a'),auth['isAuthenticated'](),controller[_0x4190('0x79')]);router[_0x4190('0x68')](_0x4190('0x3c'),auth[_0x4190('0xe')](),controller[_0x4190('0x7a')]);router[_0x4190('0x68')](_0x4190('0x3f'),auth[_0x4190('0xe')](),controller[_0x4190('0x7b')]);module[_0x4190('0x7c')]=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index 341b203..d67229c 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 _0xa6b0=['setDataValue','defaultuser','The\x20name\x20of\x20the\x20user','fullname','callerid','format','internal','email','toLowerCase','ENUM','admin','user','agent','telephone','INTEGER','accountcode','getDataValue','BOOLEAN','DATE','dynamic','friend','peer','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED','PROHIB_FAILED_SCREEN','PROHIB','udp','join','transport','split','rfc2833','info','shortinfo','inband','auto','yes','nonat','update','outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','ulaw;alaw;gsm','allow','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','\x22\x22\x20<>','always','accept','refuse','originate','uac','uas','certificate','passive','TEXT','showWebBar','get','isArray','wss','encryption','avpf','force_avp','icesupport','dtlsverify','dtlssetup','dtlscertfile','dtlsprivatekey','rtcp_mux','dtlsenable','actpass','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','map','permissions','string','true','screenrecording','blocked','blockedAt','loginAttempts','UNSIGNED','sequelize','moment','exports','STRING','name'];(function(_0xd19218,_0x334bb9){var _0x5df03c=function(_0xad15be){while(--_0xad15be){_0xd19218['push'](_0xd19218['shift']());}};_0x5df03c(++_0x334bb9);}(_0xa6b0,0xaf));var _0x0a6b=function(_0x4423b3,_0x552266){_0x4423b3=_0x4423b3-0x0;var _0xd3fc58=_0xa6b0[_0x4423b3];return _0xd3fc58;};'use strict';var Sequelize=require(_0x0a6b('0x0'));var moment=require(_0x0a6b('0x1'));var util=require('util');var _=require('lodash');module[_0x0a6b('0x2')]={'name':{'type':Sequelize[_0x0a6b('0x3')],'allowNull':![],'unique':_0x0a6b('0x4'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x4c9a84){this[_0x0a6b('0x5')](_0x0a6b('0x4'),_0x4c9a84);this[_0x0a6b('0x5')](_0x0a6b('0x6'),_0x4c9a84);},'comment':_0x0a6b('0x7')},'fullname':{'type':Sequelize[_0x0a6b('0x3')],'allowNull':![],'set':function(_0x1b5fb5){this[_0x0a6b('0x5')](_0x0a6b('0x8'),_0x1b5fb5);this[_0x0a6b('0x5')](_0x0a6b('0x9'),util[_0x0a6b('0xa')]('\x22%s\x22\x20<%s>',_0x1b5fb5,this['getDataValue'](_0x0a6b('0xb'))));}},'alias':{'type':Sequelize[_0x0a6b('0x3')]},'email':{'type':Sequelize[_0x0a6b('0x3')],'allowNull':![],'unique':_0x0a6b('0xc'),'validate':{'isEmail':!![]},'set':function(_0x81a412){if(_0x81a412){this[_0x0a6b('0x5')](_0x0a6b('0xc'),_0x81a412[_0x0a6b('0xd')]());}}},'role':{'type':Sequelize[_0x0a6b('0xe')](_0x0a6b('0xf'),_0x0a6b('0x10'),_0x0a6b('0x11'),_0x0a6b('0x12')),'allowNull':![]},'password':{'type':Sequelize[_0x0a6b('0x3')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize['STRING'],'defaultValue':'local'},'internal':{'type':Sequelize[_0x0a6b('0x13')](0xb),'allowNull':![],'unique':_0x0a6b('0xb'),'set':function(_0x2abc4e){this[_0x0a6b('0x5')](_0x0a6b('0xb'),_0x2abc4e);this[_0x0a6b('0x5')](_0x0a6b('0x14'),_0x2abc4e);this[_0x0a6b('0x5')](_0x0a6b('0x9'),util[_0x0a6b('0xa')]('\x22%s\x22\x20<%s>',this[_0x0a6b('0x15')](_0x0a6b('0x8')),_0x2abc4e));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x0a6b('0x3')]},'mobile':{'type':Sequelize['STRING']},'address':{'type':Sequelize[_0x0a6b('0x3')]},'zipcode':{'type':Sequelize[_0x0a6b('0x3')]},'userpic':{'type':Sequelize[_0x0a6b('0x3')]},'city':{'type':Sequelize[_0x0a6b('0x3')]},'country':{'type':Sequelize['STRING']},'online':{'type':Sequelize[_0x0a6b('0x16')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x0a6b('0x17')]},'voicePause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x0a6b('0x16')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x0a6b('0x16')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x0a6b('0x16')],'defaultValue':![]},'smsPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x0a6b('0x16')],'defaultValue':![]},'openchannelPause':{'type':Sequelize[_0x0a6b('0x16')],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x0a6b('0x3')],'defaultValue':'DEFAULT\x20PAUSE'},'lastPauseAt':{'type':Sequelize[_0x0a6b('0x17')]},'chatCapacity':{'type':Sequelize[_0x0a6b('0x13')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x0a6b('0x13')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x0a6b('0x13')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x0a6b('0x13')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x0a6b('0x13')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x0a6b('0x16')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x0a6b('0x16')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x0a6b('0x13')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x0a6b('0x16')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x0a6b('0x13')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x0a6b('0x16')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x0a6b('0x16')],'defaultValue':![]},'chanspy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0x0a6b('0x3')],'allowNull':!![]},'host':{'type':Sequelize[_0x0a6b('0x3')],'allowNull':!![],'defaultValue':_0x0a6b('0x18')},'ipaddr':{'type':Sequelize['STRING'],'allowNull':!![]},'port':{'type':Sequelize[_0x0a6b('0x13')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x0a6b('0x3')],'allowNull':!![]},'regserver':{'type':Sequelize[_0x0a6b('0x3')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x0a6b('0x3')],'allowNull':!![]},'lastms':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'type':{'type':Sequelize['ENUM'](_0x0a6b('0x19'),_0x0a6b('0x10'),_0x0a6b('0x1a')),'allowNull':!![],'defaultValue':_0x0a6b('0x19')},'context':{'type':Sequelize[_0x0a6b('0x3')],'allowNull':!![],'defaultValue':_0x0a6b('0x1b')},'callingpres':{'type':Sequelize['ENUM'](_0x0a6b('0x1c'),_0x0a6b('0x1d'),'ALLOWED_FAILED_SCREEN',_0x0a6b('0x1e'),'PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN',_0x0a6b('0x1f'),_0x0a6b('0x20')),'allowNull':!![]},'deny':{'type':Sequelize[_0x0a6b('0x3')],'allowNull':!![]},'permit':{'type':Sequelize[_0x0a6b('0x3')],'allowNull':!![]},'secret':{'type':Sequelize[_0x0a6b('0x3')],'allowNull':!![]},'md5secret':{'type':Sequelize['STRING'],'allowNull':!![]},'remotesecret':{'type':Sequelize['STRING'],'allowNull':!![]},'transport':{'type':Sequelize[_0x0a6b('0x3')],'allowNull':!![],'defaultValue':_0x0a6b('0x21'),'set':function(_0x235cc3){this[_0x0a6b('0x5')]('transport',_0x235cc3?_0x235cc3[_0x0a6b('0x22')](','):null);},'get':function(){return this[_0x0a6b('0x15')]('transport')?this['getDataValue'](_0x0a6b('0x23'))[_0x0a6b('0x24')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize[_0x0a6b('0xe')](_0x0a6b('0x25'),_0x0a6b('0x26'),_0x0a6b('0x27'),_0x0a6b('0x28'),_0x0a6b('0x29')),'allowNull':!![],'defaultValue':_0x0a6b('0x25')},'directmedia':{'type':Sequelize[_0x0a6b('0xe')](_0x0a6b('0x2a'),'no',_0x0a6b('0x2b'),_0x0a6b('0x2c'),_0x0a6b('0x2d')),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM'](_0x0a6b('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x0a6b('0x3')],'allowNull':!![]},'directmediadeny':{'type':Sequelize['STRING'],'allowNull':!![]},'nat':{'type':Sequelize[_0x0a6b('0x3')],'allowNull':!![],'defaultValue':_0x0a6b('0x2e'),'set':function(_0x206612){this[_0x0a6b('0x5')](_0x0a6b('0x2f'),_0x206612?_0x206612[_0x0a6b('0x22')](','):null);},'get':function(){return this[_0x0a6b('0x15')](_0x0a6b('0x2f'))?this[_0x0a6b('0x15')]('nat')[_0x0a6b('0x24')](','):null;},'comment':_0x0a6b('0x30')},'callgroup':{'type':Sequelize[_0x0a6b('0x3')]},'namedcallgroup':{'type':Sequelize[_0x0a6b('0x3')]},'pickupgroup':{'type':Sequelize[_0x0a6b('0x3')]},'namedpickupgroup':{'type':Sequelize[_0x0a6b('0x3')]},'language':{'type':Sequelize[_0x0a6b('0x3')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x0a6b('0x3')]},'disallow':{'type':Sequelize[_0x0a6b('0x3')],'allowNull':![],'defaultValue':'all'},'allow':{'type':Sequelize[_0x0a6b('0x3')],'allowNull':![],'defaultValue':_0x0a6b('0x31'),'set':function(_0x3aa7d5){this[_0x0a6b('0x5')](_0x0a6b('0x32'),_0x3aa7d5?_0x3aa7d5[_0x0a6b('0x22')](';'):_0x0a6b('0x31'));},'get':function(){return this[_0x0a6b('0x15')](_0x0a6b('0x32'))?this['getDataValue'](_0x0a6b('0x32'))['split'](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]'},'autoframing':{'type':Sequelize[_0x0a6b('0xe')]('yes','no'),'allowNull':!![]},'insecure':{'type':Sequelize['STRING'],'allowNull':!![],'set':function(_0x2f1221){this[_0x0a6b('0x5')](_0x0a6b('0x33'),_0x2f1221?_0x2f1221['join'](','):null);},'get':function(){return this[_0x0a6b('0x15')]('insecure')?this['getDataValue'](_0x0a6b('0x33'))['split'](','):null;},'comment':_0x0a6b('0x34')},'trustrpid':{'type':Sequelize['ENUM'](_0x0a6b('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x0a6b('0xe')](_0x0a6b('0x2a'),'no',_0x0a6b('0x35')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x0a6b('0xe')]('yes','no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x0a6b('0xe')](_0x0a6b('0x2a'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x0a6b('0x13')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x0a6b('0x3')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x0a6b('0x3')],'allowNull':!![],'defaultValue':_0x0a6b('0x36')},'amaflags':{'type':Sequelize[_0x0a6b('0x3')],'allowNull':!![]},'callcounter':{'type':Sequelize['ENUM'](_0x0a6b('0x2a'),'no'),'allowNull':!![],'defaultValue':_0x0a6b('0x2a')},'busylevel':{'type':Sequelize[_0x0a6b('0x13')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x0a6b('0xe')](_0x0a6b('0x2a'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x0a6b('0xe')](_0x0a6b('0x2a'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x0a6b('0xe')](_0x0a6b('0x2a'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize['ENUM'](_0x0a6b('0x2a'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x0a6b('0x3')],'allowNull':!![]},'template':{'type':Sequelize[_0x0a6b('0x3')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x0a6b('0xe')](_0x0a6b('0x2a'),'no',_0x0a6b('0x37')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x0a6b('0x13')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x0a6b('0x3')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x0a6b('0xe')](_0x0a6b('0x38'),_0x0a6b('0x39'),_0x0a6b('0x3a')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x0a6b('0x13')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x0a6b('0x13')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x0a6b('0xe')](_0x0a6b('0x3b'),'uas'),'allowNull':!![],'defaultValue':_0x0a6b('0x3c')},'t38pt_usertpsource':{'type':Sequelize[_0x0a6b('0x3')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x0a6b('0x3')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x0a6b('0x3')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x0a6b('0x3')],'allowNull':!![]},'qualify':{'type':Sequelize['ENUM'](_0x0a6b('0x2a'),'no'),'allowNull':!![],'defaultValue':_0x0a6b('0x2a')},'keepalive':{'type':Sequelize[_0x0a6b('0x13')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize[_0x0a6b('0x3')],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x0a6b('0x3')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x0a6b('0x13')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x0a6b('0x13')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize[_0x0a6b('0x13')](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x0a6b('0xe')](_0x0a6b('0x2a'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING'],'allowNull':!![]},'callbackextension':{'type':Sequelize['STRING'],'allowNull':!![]},'timert1':{'type':Sequelize[_0x0a6b('0x13')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x0a6b('0x13')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize['STRING'],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x0a6b('0x3')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x0a6b('0x3')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x0a6b('0x3')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize['STRING'],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x0a6b('0x13')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x0a6b('0xe')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x0a6b('0xe')]('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x0a6b('0xe')](_0x0a6b('0x2a'),'no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM'](_0x0a6b('0x2a'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize['ENUM'](_0x0a6b('0x2a'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x0a6b('0xe')](_0x0a6b('0x2a'),'no','fingerprint',_0x0a6b('0x3d')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize[_0x0a6b('0x13')](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x0a6b('0x3')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x0a6b('0x3')],'allowNull':!![]},'dtlscipher':{'type':Sequelize[_0x0a6b('0x3')],'allowNull':!![]},'dtlscafile':{'type':Sequelize[_0x0a6b('0x3')],'allowNull':!![]},'dtlscapath':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlssetup':{'type':Sequelize['ENUM']('active',_0x0a6b('0x3e'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x0a6b('0x3')],'allowNull':!![]},'usereqphone':{'type':Sequelize[_0x0a6b('0xe')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING'],'allowNull':!![]},'recordofffeature':{'type':Sequelize['STRING'],'allowNull':!![]},'call_limit':{'type':Sequelize[_0x0a6b('0x13')](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x0a6b('0xe')]('yes','no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x0a6b('0xe')](_0x0a6b('0x2a'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x0a6b('0x3')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x0a6b('0x3')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x0a6b('0x3')],'allowNull':!![]},'parkinglot':{'type':Sequelize['STRING'],'allowNull':!![]},'canreinvite':{'type':Sequelize['ENUM']('yes','no',_0x0a6b('0x2b'),_0x0a6b('0x2c'),'update,nonat'),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x0a6b('0x16')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize['STRING']},'resetPasswordExpires':{'type':Sequelize[_0x0a6b('0x17')]},'passwordResetAt':{'type':Sequelize[_0x0a6b('0x17')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x0a6b('0x3f')]},'showWebBar':{'type':Sequelize[_0x0a6b('0x13')],'defaultValue':0x0,'set':function(_0x450a32){this['setDataValue'](_0x0a6b('0x40'),_0x450a32);var _0x34bebd=this[_0x0a6b('0x41')]({'plain':!![]});switch(_0x450a32){case 0x0:case 0x1:var _0x38974c=_0x34bebd['transport']?_[_0x0a6b('0x42')](_0x34bebd[_0x0a6b('0x23')])?_0x34bebd[_0x0a6b('0x23')][_0x0a6b('0x22')]():_0x34bebd[_0x0a6b('0x23')]:'udp';if(_0x38974c===_0x0a6b('0x43')){_0x38974c=_0x0a6b('0x21');}this[_0x0a6b('0x5')](_0x0a6b('0x23'),_0x38974c);this[_0x0a6b('0x5')](_0x0a6b('0x44'),'no');this[_0x0a6b('0x5')](_0x0a6b('0x45'),null);this['setDataValue'](_0x0a6b('0x46'),null);this[_0x0a6b('0x5')](_0x0a6b('0x47'),null);this[_0x0a6b('0x5')]('dtlsenable',null);this[_0x0a6b('0x5')](_0x0a6b('0x48'),null);this[_0x0a6b('0x5')](_0x0a6b('0x49'),null);this[_0x0a6b('0x5')](_0x0a6b('0x4a'),null);this[_0x0a6b('0x5')](_0x0a6b('0x4b'),null);this[_0x0a6b('0x5')](_0x0a6b('0x4c'),'no');break;case 0x2:this[_0x0a6b('0x5')](_0x0a6b('0x23'),_0x0a6b('0x43'));this[_0x0a6b('0x5')](_0x0a6b('0x44'),'yes');this['setDataValue'](_0x0a6b('0x45'),_0x0a6b('0x2a'));this['setDataValue'](_0x0a6b('0x46'),_0x0a6b('0x2a'));this[_0x0a6b('0x5')](_0x0a6b('0x47'),_0x0a6b('0x2a'));this[_0x0a6b('0x5')](_0x0a6b('0x4d'),_0x0a6b('0x2a'));this[_0x0a6b('0x5')](_0x0a6b('0x48'),'no');this[_0x0a6b('0x5')]('dtlssetup',_0x0a6b('0x4e'));this['setDataValue'](_0x0a6b('0x4a'),_0x34bebd[_0x0a6b('0x4a')]||_0x0a6b('0x4f'));this[_0x0a6b('0x5')](_0x0a6b('0x4b'),_0x34bebd[_0x0a6b('0x4b')]||_0x0a6b('0x50'));this['setDataValue'](_0x0a6b('0x4c'),_0x0a6b('0x2a'));break;default:}}},'permissions':{'type':Sequelize[_0x0a6b('0x3f')],'set':function(_0x356d70){this[_0x0a6b('0x5')]('permissions',_0x356d70?_0x356d70[_0x0a6b('0x22')](','):[]);},'get':function(){return this['getDataValue']('permissions')?_[_0x0a6b('0x51')](this[_0x0a6b('0x15')](_0x0a6b('0x52'))[_0x0a6b('0x24')](','),function(_0xec326b){return parseInt(_0xec326b,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x0a6b('0x3')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x0a6b('0x3')]},'phoneBarBusyNumber':{'type':Sequelize[_0x0a6b('0x3')]},'phoneBarUnconditional':{'type':Sequelize[_0x0a6b('0x16')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x0a6b('0x16')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize[_0x0a6b('0x16')],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x0a6b('0x16')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x0a6b('0x16')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize[_0x0a6b('0x13')],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x0a6b('0x3')],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x0a6b('0x13')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize['ENUM'](_0x0a6b('0x2a'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x0a6b('0x3')]},'phoneBarEnableJaws':{'type':Sequelize[_0x0a6b('0x16')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x0a6b('0x15')]('phoneBarEnableScreenRecordingByAgent')?this[_0x0a6b('0x15')]('phoneBarEnableScreenRecordingByAgent'):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x0a6b('0x16')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x0a6b('0x16')],'defaultValue':![]},'interface':{'type':Sequelize[_0x0a6b('0x3')],'defaultValue':null},'privacyEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize['STRING'],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x0a6b('0x3')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x0a6b('0x16')],'defaultValue':![],'set':function(_0x239be5){if(typeof _0x239be5===_0x0a6b('0x53')){var _0x571800=_0x239be5==='1'?!![]:_0x239be5==='0'?![]:_0x239be5===_0x0a6b('0x54')?!![]:_0x239be5==='false'?![]:![];this[_0x0a6b('0x5')](_0x0a6b('0x55'),_0x571800);}else{this[_0x0a6b('0x5')](_0x0a6b('0x55'),_0x239be5);}}},'blocked':{'type':Sequelize[_0x0a6b('0x16')],'defaultValue':![],'set':function(_0x1374c3){this[_0x0a6b('0x5')](_0x0a6b('0x56'),_0x1374c3);if(_0x1374c3===!![]){this['setDataValue'](_0x0a6b('0x57'),moment());this['setDataValue'](_0x0a6b('0x58'),0x0);}else{this[_0x0a6b('0x5')](_0x0a6b('0x57'),null);}}},'blockedAt':{'type':Sequelize[_0x0a6b('0x17')],'defaultValue':null},'loginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x0a6b('0x16')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x0a6b('0x16')],'defaultValue':!![]},'wssPort':{'type':Sequelize['INTEGER'](0x5)[_0x0a6b('0x59')],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x0a6b('0x16')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x0a6b('0x16')],'defaultValue':!![]}}; \ No newline at end of file +var _0x2f74=['originate','uac','uas','fingerprint','certificate','passive','actpass','update,nonat','TEXT','showWebBar','wss','encryption','avpf','force_avp','icesupport','dtlsenable','dtlsverify','dtlssetup','dtlscertfile','rtcp_mux','/etc/pki/tls/certs/motion.crt','dtlsprivatekey','/etc/pki/tls/private/motion.key','permissions','map','VIRTUAL','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','loginAttempts','blockedAt','sequelize','util','lodash','exports','STRING','name','setDataValue','fullname','callerid','format','\x22%s\x22\x20<%s>','internal','email','toLowerCase','ENUM','admin','user','agent','telephone','getDataValue','BOOLEAN','DATE','INTEGER','dynamic','peer','friend','from-sip','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','udp','join','transport','split','rfc2833','info','shortinfo','inband','auto','nonat','update','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','allow','ulaw;alaw;gsm','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','yes','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','\x22\x22\x20<>','always','accept','refuse'];(function(_0x35007a,_0x58a0d4){var _0x574f68=function(_0xd1c129){while(--_0xd1c129){_0x35007a['push'](_0x35007a['shift']());}};_0x574f68(++_0x58a0d4);}(_0x2f74,0x7b));var _0x42f7=function(_0x27d10a,_0x35ff44){_0x27d10a=_0x27d10a-0x0;var _0x63302e=_0x2f74[_0x27d10a];return _0x63302e;};'use strict';var Sequelize=require(_0x42f7('0x0'));var moment=require('moment');var util=require(_0x42f7('0x1'));var _=require(_0x42f7('0x2'));module[_0x42f7('0x3')]={'name':{'type':Sequelize[_0x42f7('0x4')],'allowNull':![],'unique':_0x42f7('0x5'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x3fcf64){this[_0x42f7('0x6')](_0x42f7('0x5'),_0x3fcf64);this['setDataValue']('defaultuser',_0x3fcf64);},'comment':'The\x20name\x20of\x20the\x20user'},'fullname':{'type':Sequelize[_0x42f7('0x4')],'allowNull':![],'set':function(_0x1cb6e0){this[_0x42f7('0x6')](_0x42f7('0x7'),_0x1cb6e0);this[_0x42f7('0x6')](_0x42f7('0x8'),util[_0x42f7('0x9')](_0x42f7('0xa'),_0x1cb6e0,this['getDataValue'](_0x42f7('0xb'))));}},'alias':{'type':Sequelize[_0x42f7('0x4')]},'email':{'type':Sequelize[_0x42f7('0x4')],'allowNull':![],'unique':_0x42f7('0xc'),'validate':{'isEmail':!![]},'set':function(_0x1f56d2){if(_0x1f56d2){this[_0x42f7('0x6')]('email',_0x1f56d2[_0x42f7('0xd')]());}}},'role':{'type':Sequelize[_0x42f7('0xe')](_0x42f7('0xf'),_0x42f7('0x10'),_0x42f7('0x11'),_0x42f7('0x12')),'allowNull':![]},'password':{'type':Sequelize[_0x42f7('0x4')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x42f7('0x4')],'defaultValue':'local'},'internal':{'type':Sequelize['INTEGER'](0xb),'allowNull':![],'unique':_0x42f7('0xb'),'set':function(_0xc274ff){this[_0x42f7('0x6')](_0x42f7('0xb'),_0xc274ff);this[_0x42f7('0x6')]('accountcode',_0xc274ff);this[_0x42f7('0x6')]('callerid',util[_0x42f7('0x9')](_0x42f7('0xa'),this[_0x42f7('0x13')](_0x42f7('0x7')),_0xc274ff));}},'salt':{'type':Sequelize[_0x42f7('0x4')]},'phone':{'type':Sequelize[_0x42f7('0x4')]},'mobile':{'type':Sequelize[_0x42f7('0x4')]},'address':{'type':Sequelize['STRING']},'zipcode':{'type':Sequelize[_0x42f7('0x4')]},'userpic':{'type':Sequelize[_0x42f7('0x4')]},'city':{'type':Sequelize[_0x42f7('0x4')]},'country':{'type':Sequelize[_0x42f7('0x4')]},'online':{'type':Sequelize[_0x42f7('0x14')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x42f7('0x15')]},'voicePause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x42f7('0x14')],'defaultValue':![]},'mailPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x42f7('0x14')],'defaultValue':![]},'smsPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'whatsappPause':{'type':Sequelize[_0x42f7('0x14')],'defaultValue':![]},'openchannelPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'pauseType':{'type':Sequelize['STRING'],'defaultValue':'DEFAULT\x20PAUSE'},'lastPauseAt':{'type':Sequelize[_0x42f7('0x15')]},'chatCapacity':{'type':Sequelize[_0x42f7('0x16')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize[_0x42f7('0x16')],'defaultValue':0x0},'faxCapacity':{'type':Sequelize[_0x42f7('0x16')],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x42f7('0x16')],'defaultValue':0x0},'whatsappCapacity':{'type':Sequelize[_0x42f7('0x16')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x42f7('0x16')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x42f7('0x14')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x42f7('0x14')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize[_0x42f7('0x16')](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x42f7('0x16')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x42f7('0x14')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x42f7('0x16')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x42f7('0x14')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'chanspy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize[_0x42f7('0x4')],'allowNull':!![]},'host':{'type':Sequelize[_0x42f7('0x4')],'allowNull':!![],'defaultValue':_0x42f7('0x17')},'ipaddr':{'type':Sequelize[_0x42f7('0x4')],'allowNull':!![]},'port':{'type':Sequelize[_0x42f7('0x16')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x42f7('0x16')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x42f7('0x4')],'allowNull':!![]},'regserver':{'type':Sequelize[_0x42f7('0x4')],'allowNull':!![]},'useragent':{'type':Sequelize[_0x42f7('0x4')],'allowNull':!![]},'lastms':{'type':Sequelize[_0x42f7('0x16')](0xb),'allowNull':!![]},'type':{'type':Sequelize['ENUM']('friend',_0x42f7('0x10'),_0x42f7('0x18')),'allowNull':!![],'defaultValue':_0x42f7('0x19')},'context':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x42f7('0x1a')},'callingpres':{'type':Sequelize[_0x42f7('0xe')]('ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN',_0x42f7('0x1b'),_0x42f7('0x1c'),_0x42f7('0x1d'),_0x42f7('0x1e'),_0x42f7('0x1f'),_0x42f7('0x20')),'allowNull':!![]},'deny':{'type':Sequelize[_0x42f7('0x4')],'allowNull':!![]},'permit':{'type':Sequelize[_0x42f7('0x4')],'allowNull':!![]},'secret':{'type':Sequelize[_0x42f7('0x4')],'allowNull':!![]},'md5secret':{'type':Sequelize['STRING'],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x42f7('0x4')],'allowNull':!![]},'transport':{'type':Sequelize[_0x42f7('0x4')],'allowNull':!![],'defaultValue':_0x42f7('0x21'),'set':function(_0xd26ccf){this[_0x42f7('0x6')]('transport',_0xd26ccf?_0xd26ccf[_0x42f7('0x22')](','):null);},'get':function(){return this[_0x42f7('0x13')](_0x42f7('0x23'))?this[_0x42f7('0x13')]('transport')[_0x42f7('0x24')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize[_0x42f7('0xe')](_0x42f7('0x25'),_0x42f7('0x26'),_0x42f7('0x27'),_0x42f7('0x28'),_0x42f7('0x29')),'allowNull':!![],'defaultValue':_0x42f7('0x25')},'directmedia':{'type':Sequelize['ENUM']('yes','no',_0x42f7('0x2a'),_0x42f7('0x2b'),'outgoing'),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x42f7('0xe')]('yes','no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x42f7('0x4')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x42f7('0x4')],'allowNull':!![]},'nat':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'force_rport,comedia','set':function(_0x48b79e){this[_0x42f7('0x6')]('nat',_0x48b79e?_0x48b79e[_0x42f7('0x22')](','):null);},'get':function(){return this[_0x42f7('0x13')](_0x42f7('0x2c'))?this[_0x42f7('0x13')](_0x42f7('0x2c'))['split'](','):null;},'comment':_0x42f7('0x2d')},'callgroup':{'type':Sequelize[_0x42f7('0x4')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize[_0x42f7('0x4')]},'language':{'type':Sequelize[_0x42f7('0x4')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x42f7('0x4')]},'disallow':{'type':Sequelize[_0x42f7('0x4')],'allowNull':![],'defaultValue':_0x42f7('0x2e')},'allow':{'type':Sequelize[_0x42f7('0x4')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x3037f8){this['setDataValue'](_0x42f7('0x2f'),_0x3037f8?_0x3037f8[_0x42f7('0x22')](';'):_0x42f7('0x30'));},'get':function(){return this['getDataValue'](_0x42f7('0x2f'))?this['getDataValue'](_0x42f7('0x2f'))[_0x42f7('0x24')](';'):null;},'comment':_0x42f7('0x31')},'autoframing':{'type':Sequelize['ENUM'](_0x42f7('0x32'),'no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x42f7('0x4')],'allowNull':!![],'set':function(_0x5f2365){this[_0x42f7('0x6')]('insecure',_0x5f2365?_0x5f2365[_0x42f7('0x22')](','):null);},'get':function(){return this['getDataValue'](_0x42f7('0x33'))?this[_0x42f7('0x13')]('insecure')[_0x42f7('0x24')](','):null;},'comment':_0x42f7('0x34')},'trustrpid':{'type':Sequelize['ENUM'](_0x42f7('0x32'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x42f7('0xe')](_0x42f7('0x32'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x42f7('0xe')](_0x42f7('0x32'),'no','never'),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x42f7('0xe')]('yes','no'),'allowNull':!![]},'useclientcode':{'type':Sequelize[_0x42f7('0xe')](_0x42f7('0x32'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x42f7('0x16')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x42f7('0x4')],'allowNull':!![]},'callerid':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x42f7('0x35')},'amaflags':{'type':Sequelize[_0x42f7('0x4')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x42f7('0xe')](_0x42f7('0x32'),'no'),'allowNull':!![],'defaultValue':_0x42f7('0x32')},'busylevel':{'type':Sequelize[_0x42f7('0x16')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize['ENUM']('yes','no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize[_0x42f7('0xe')](_0x42f7('0x32'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize['ENUM'](_0x42f7('0x32'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x42f7('0xe')](_0x42f7('0x32'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x42f7('0x4')],'allowNull':!![]},'template':{'type':Sequelize[_0x42f7('0x4')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x42f7('0xe')](_0x42f7('0x32'),'no',_0x42f7('0x36')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x42f7('0x16')](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize['ENUM'](_0x42f7('0x32'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x42f7('0x4')],'allowNull':!![]},'session_timers':{'type':Sequelize[_0x42f7('0xe')](_0x42f7('0x37'),_0x42f7('0x38'),_0x42f7('0x39')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x42f7('0x16')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x42f7('0x16')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize['ENUM'](_0x42f7('0x3a'),_0x42f7('0x3b')),'allowNull':!![],'defaultValue':_0x42f7('0x3b')},'t38pt_usertpsource':{'type':Sequelize[_0x42f7('0x4')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x42f7('0x4')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x42f7('0x4')],'allowNull':!![]},'fromuser':{'type':Sequelize['STRING'],'allowNull':!![]},'qualify':{'type':Sequelize[_0x42f7('0xe')](_0x42f7('0x32'),'no'),'allowNull':!![],'defaultValue':'yes'},'keepalive':{'type':Sequelize[_0x42f7('0x16')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x42f7('0x4')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x42f7('0x16')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize[_0x42f7('0x16')](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize[_0x42f7('0xe')](_0x42f7('0x32'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize['STRING'],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x42f7('0x4')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x42f7('0x16')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x42f7('0x16')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x42f7('0x16')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x42f7('0x4')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x42f7('0x4')],'allowNull':!![]},'contactacl':{'type':Sequelize[_0x42f7('0x4')],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize[_0x42f7('0x4')],'allowNull':!![]},'use_q850_reason':{'type':Sequelize[_0x42f7('0x4')],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x42f7('0x16')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x42f7('0xe')](_0x42f7('0x32'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize[_0x42f7('0xe')]('yes','no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x42f7('0xe')]('yes','no'),'allowNull':!![]},'icesupport':{'type':Sequelize[_0x42f7('0xe')](_0x42f7('0x32'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize[_0x42f7('0xe')](_0x42f7('0x32'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize[_0x42f7('0xe')](_0x42f7('0x32'),'no',_0x42f7('0x3c'),_0x42f7('0x3d')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x42f7('0x4')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x42f7('0x4')],'allowNull':!![]},'dtlscipher':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscafile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x42f7('0x4')],'allowNull':!![]},'dtlssetup':{'type':Sequelize['ENUM']('active',_0x42f7('0x3e'),_0x42f7('0x3f')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize['STRING'],'allowNull':!![]},'usereqphone':{'type':Sequelize['ENUM'](_0x42f7('0x32'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING'],'allowNull':!![]},'recordofffeature':{'type':Sequelize[_0x42f7('0x4')],'allowNull':!![]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize['ENUM'](_0x42f7('0x32'),'no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x42f7('0xe')]('yes','no'),'allowNull':!![]},'vmexten':{'type':Sequelize['STRING'],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x42f7('0x4')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x42f7('0x4')],'allowNull':!![]},'parkinglot':{'type':Sequelize['STRING'],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x42f7('0xe')](_0x42f7('0x32'),'no',_0x42f7('0x2a'),_0x42f7('0x2b'),_0x42f7('0x40')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x42f7('0x4')]},'resetPasswordExpires':{'type':Sequelize['DATE']},'passwordResetAt':{'type':Sequelize[_0x42f7('0x15')],'defaultValue':null},'previousPasswords':{'type':Sequelize[_0x42f7('0x41')]},'showWebBar':{'type':Sequelize[_0x42f7('0x16')],'defaultValue':0x0,'set':function(_0x98a670){this[_0x42f7('0x6')](_0x42f7('0x42'),_0x98a670);var _0x3affa4=this['get']({'plain':!![]});switch(_0x98a670){case 0x0:case 0x1:var _0x419be3=_0x3affa4[_0x42f7('0x23')]?_['isArray'](_0x3affa4[_0x42f7('0x23')])?_0x3affa4[_0x42f7('0x23')][_0x42f7('0x22')]():_0x3affa4[_0x42f7('0x23')]:'udp';if(_0x419be3===_0x42f7('0x43')){_0x419be3='udp';}this[_0x42f7('0x6')](_0x42f7('0x23'),_0x419be3);this['setDataValue'](_0x42f7('0x44'),'no');this[_0x42f7('0x6')](_0x42f7('0x45'),null);this[_0x42f7('0x6')](_0x42f7('0x46'),null);this[_0x42f7('0x6')](_0x42f7('0x47'),null);this['setDataValue'](_0x42f7('0x48'),null);this[_0x42f7('0x6')](_0x42f7('0x49'),null);this['setDataValue'](_0x42f7('0x4a'),null);this['setDataValue'](_0x42f7('0x4b'),null);this['setDataValue']('dtlsprivatekey',null);this['setDataValue'](_0x42f7('0x4c'),'no');break;case 0x2:this['setDataValue'](_0x42f7('0x23'),_0x42f7('0x43'));this['setDataValue']('encryption',_0x42f7('0x32'));this['setDataValue'](_0x42f7('0x45'),'yes');this[_0x42f7('0x6')]('force_avp',_0x42f7('0x32'));this[_0x42f7('0x6')](_0x42f7('0x47'),_0x42f7('0x32'));this[_0x42f7('0x6')](_0x42f7('0x48'),_0x42f7('0x32'));this['setDataValue'](_0x42f7('0x49'),'no');this[_0x42f7('0x6')](_0x42f7('0x4a'),_0x42f7('0x3f'));this['setDataValue'](_0x42f7('0x4b'),_0x3affa4[_0x42f7('0x4b')]||_0x42f7('0x4d'));this['setDataValue'](_0x42f7('0x4e'),_0x3affa4[_0x42f7('0x4e')]||_0x42f7('0x4f'));this['setDataValue'](_0x42f7('0x4c'),'yes');break;default:}}},'permissions':{'type':Sequelize[_0x42f7('0x41')],'set':function(_0x390f27){this[_0x42f7('0x6')](_0x42f7('0x50'),_0x390f27?_0x390f27[_0x42f7('0x22')](','):[]);},'get':function(){return this[_0x42f7('0x13')](_0x42f7('0x50'))?_[_0x42f7('0x51')](this[_0x42f7('0x13')]('permissions')['split'](','),function(_0x42259e){return parseInt(_0x42259e,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x42f7('0x4')]},'phoneBarNoReplyNumber':{'type':Sequelize['STRING']},'phoneBarBusyNumber':{'type':Sequelize[_0x42f7('0x4')]},'phoneBarUnconditional':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x42f7('0x14')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x42f7('0x14')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x42f7('0x14')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize['STRING'],'defaultValue':''},'crudPermissions':{'type':Sequelize[_0x42f7('0x16')],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize['ENUM'](_0x42f7('0x32'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize[_0x42f7('0x14')],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x42f7('0x4')]},'phoneBarEnableJaws':{'type':Sequelize[_0x42f7('0x14')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x42f7('0x14')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize[_0x42f7('0x52')],'get':function(){return this[_0x42f7('0x13')](_0x42f7('0x53'))?this['getDataValue'](_0x42f7('0x53')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize[_0x42f7('0x14')],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x42f7('0x14')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x42f7('0x14')],'defaultValue':![]},'interface':{'type':Sequelize['STRING'],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x42f7('0x14')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize[_0x42f7('0x4')],'allowNull':!![]},'apiKeyIat':{'type':Sequelize['STRING'],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x42f7('0x14')],'defaultValue':![],'set':function(_0x28643d){if(typeof _0x28643d===_0x42f7('0x54')){var _0x53d029=_0x28643d==='1'?!![]:_0x28643d==='0'?![]:_0x28643d===_0x42f7('0x55')?!![]:_0x28643d===_0x42f7('0x56')?![]:![];this[_0x42f7('0x6')](_0x42f7('0x57'),_0x53d029);}else{this[_0x42f7('0x6')](_0x42f7('0x57'),_0x28643d);}}},'blocked':{'type':Sequelize[_0x42f7('0x14')],'defaultValue':![],'set':function(_0x3e3b1e){this[_0x42f7('0x6')]('blocked',_0x3e3b1e);if(_0x3e3b1e===!![]){this[_0x42f7('0x6')]('blockedAt',moment());this[_0x42f7('0x6')](_0x42f7('0x58'),0x0);}else{this[_0x42f7('0x6')](_0x42f7('0x59'),null);}}},'blockedAt':{'type':Sequelize[_0x42f7('0x15')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x42f7('0x16')],'defaultValue':0x0},'disabled':{'type':Sequelize[_0x42f7('0x14')],'defaultValue':![]},'settingsEnabled':{'type':Sequelize[_0x42f7('0x14')],'defaultValue':!![]},'wssPort':{'type':Sequelize[_0x42f7('0x16')](0x5)['UNSIGNED'],'defaultValue':0x1f99},'downloadAttachments':{'type':Sequelize[_0x42f7('0x14')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x42f7('0x14')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x42f7('0x14')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index 17f7bec..a87ebae 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 _0x6fad=['json','limit','count','offset','set','Content-Range','update','destroy','get','role','admin','user','Agents','agent','Telephones','filter','map','includes','find','value','name','UserProfileResource','User','rawAttributes','fieldName','type','key','password','getOptions','where','query','includeAll','include','attributes','findAll','rows','true','length','push','chat','dataValues','sms','fax','mail','openchannel','whatsapp','all','catch','show','params','model','filters','intersection','fields','merge','options','openTabs','body','describe','addContacts','internal','securePassword','max','isNil','min_internal','sequelize','select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)','SELECT','from','voicemail','mailbox','email','permissions','101','102','103','113','110','104','105','106','107','108','109','111','115','create','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','userProfileId','VoiceMail','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Unauthorized','some','Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator','each','telephone','UserProfileSection','compact','changePassword','oldPassword','newPassword','Sequelize','Invalid\x20body\x20format.\x20Use\x20oldPassword\x20and\x20newPassword','ValidationError','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','Setting','findOne','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','validatePasswordHistory','previousPasswords','addQueues','channel','online','loginInPause','voicePause','interface','isValidChannel','Unknown\x20channel','add','capitalize','toLowerCase','penalty','ids','QueueId','Queue:save','voice','VoiceQueue','SIP/%s','UserVoiceQueueRt','upsert','removeQueues','remove','Queues','isArray','emit','Queue:remove','addAvatar','userpic','file','filename','getAvatar','join','root','download','existsSync','server/files/images/','ChatOpenTabs','CHAT','createdAt','FaxOpenTabs','FAX','OpenchannelOpenTabs','OPENCHANNEL','MailOpenTabs','MAIL','SmsOpenTabs','SMS','WhatsappOpenTabs','WHATSAPP','getContacts','keys','CmContact','order','sort','pick','hasOwnProperty','CmList','List','Tag','Tags','color','tag','nolimit','getQueues','Queue','Unknown\x20role','getVoiceQueuesRt','getGroups','ChatGroup','VoiceRecording','UserId','ScreenRecording','getChatInteractions','ChatInteraction','getOpenchannelInteractions','OpenchannelInteraction','getMailInteractions','MailInteraction','SmsInteraction','getSmsInteractions','getFaxInteractions','FaxInteraction','getWhatsappInteractions','login','phone','format','LOCAL/%s@from-sip/n','intrf','user:%s','user:forcelogout','headers','x-forwarded-for','remoteAddress','connection','socket','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','UserVoiceQueue.penalty','MemberReport','forEach','YYYY-MM-DD\x20HH:mm:ss','getChannels','LOGIN','device','PAUSE','bulkCreate','concat','LOGININPAUSE','isMiddleware','pause','QueuePause','DEFAULT\x20PAUSE','unpause','mailPause','chatPause','faxPause','openchannelPause','smsPause','whatsapppause','lastPauseAt','manual','Pause','getTeams','Team','addTeams','omit','getVoiceQueues','setDataValue','Voice','Chat','getMailQueues','Mail','getSmsQueues','Whatsapp','Fax','getOpenchannelQueues','Openchannel','transaction','addAgent','TeamVoicePrefix','UserVoicePrefix','VoicePrefixId','removeTeams','getChatQueues','Sms','getWhatsappQueues','getFaxQueues','flatten','getLists','getAgents','values','send','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','spread','user_has_chat_interactions:save','removeChatInteractions','user_has_chat_interactions:remove','addMailInteractions','user_has_mail_interactions:save','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','user_has_sms_interactions:save','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','user_has_openchannel_interactions:save','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','addWhatsappInteractions','user_has_whatsapp_interactions:save','removeWhatsappInteractions','getVoicePrefixes','getFaxAccounts','addFaxAccounts','removeFaxAccounts','getMailAccounts','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','OpenchannelAccount','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','SmsAccount','addSmsAccounts','removeSmsAccounts','getChatWebsites','ChatWebsite','addChatWebsites','WhatsappAccount','getWhatsappAccounts','addWhatsappAccounts','removeWhatsappAccounts','getSquareProjects','addSquareProjects','removeSquareProjects','getScheduledCalls','CmHopper','$and','$or','$gt','$gte','$lt','$lte','$ne','$between','$notBetween','$in','$notIn','$notLike','$notILike','$like','$overlap','$contains','$contained','$any','firstName','lastName','Contact','getApiKey','retrieveApiKey','No\x20API\x20access\x20key\x20found!','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','generateApiKey','iat','nonce','token','removeApiKey','apiKeyNonce','apiKeyIat','whoami','Unable\x20to\x20retrieve\x20the\x20current\x20user','teams','queues','isEmpty','col','toString','asc','uniqBy','orderBy','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(AMI)','Unable\x20to\x20retrieve\x20RPC\x20agents\x20(Routing)','offline','idle','ringing','voiceStatus','slice','charAt','select','field','ui.','InteractionId','ui.createdAt','user_has_','_interactions','ui.UserId\x20=\x20?','OpenTabs','moment','bluebird','util','path','lodash','jayson/promise','../../components/auth/service','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','socket.io-emitter','redis','./user.socket','localhost','client','http','request','then','info','User,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','sendStatus','end','status'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0x6fad,0x17a));var _0xd6fa=function(_0x3cfc01,_0x4ea6b9){_0x3cfc01=_0x3cfc01-0x0;var _0x52d02c=_0x6fad[_0x3cfc01];return _0x52d02c;};'use strict';var moment=require(_0xd6fa('0x0'));var BPromise=require(_0xd6fa('0x1'));var util=require(_0xd6fa('0x2'));var path=require(_0xd6fa('0x3'));var fs=require('fs');var _=require(_0xd6fa('0x4'));var squel=require('squel');var jayson=require(_0xd6fa('0x5'));var Redis=require('ioredis');var authService=require(_0xd6fa('0x6'));var qs=require('../../components/parsers/qs');var logger=require(_0xd6fa('0x7'))('api');var utils=require(_0xd6fa('0x8'));var config=require(_0xd6fa('0x9'));var licenseUtil=require(_0xd6fa('0xa'));var db=require(_0xd6fa('0xb'))['db'];var socket=require(_0xd6fa('0xc'))(new Redis(config[_0xd6fa('0xd')]));require(_0xd6fa('0xe'))['register'](socket);config[_0xd6fa('0xd')]=_['defaults'](config[_0xd6fa('0xd')],{'host':_0xd6fa('0xf'),'port':0x18eb});var client=jayson[_0xd6fa('0x10')][_0xd6fa('0x11')]({'port':0x232a});var values;function respondWithRpcPromise(_0x31286a,_0x4d4a23,_0x5c2ae3,_0x28f2e6){return new BPromise(function(_0x3f5eaa,_0x34496b){var _0x54eb74=_0x28f2e6||client;return _0x54eb74[_0xd6fa('0x12')](_0x31286a,_0x5c2ae3)[_0xd6fa('0x13')](function(_0x25accb){logger[_0xd6fa('0x14')](_0xd6fa('0x15'),_0x4d4a23,_0xd6fa('0x16'));logger[_0xd6fa('0x17')]('User,\x20%s,\x20%s,\x20%s',_0x4d4a23,_0xd6fa('0x16'),JSON['stringify'](_0x25accb));if(_0x25accb['error']){if(_0x25accb[_0xd6fa('0x18')][_0xd6fa('0x19')]===0x1f4){logger['error'](_0xd6fa('0x15'),_0x4d4a23,_0x25accb[_0xd6fa('0x18')]['message']);return _0x34496b(_0x25accb[_0xd6fa('0x18')][_0xd6fa('0x1a')]);}logger[_0xd6fa('0x18')]('User,\x20%s,\x20%s',_0x4d4a23,_0x25accb[_0xd6fa('0x18')]['message']);return _0x3f5eaa(_0x25accb[_0xd6fa('0x18')][_0xd6fa('0x1a')]);}else{logger[_0xd6fa('0x14')](_0xd6fa('0x15'),_0x4d4a23,_0xd6fa('0x16'));_0x3f5eaa(_0x25accb[_0xd6fa('0x1b')]['message']);}})['catch'](function(_0x45ebf9){logger[_0xd6fa('0x18')]('User,\x20%s,\x20%s',_0x4d4a23,_0x45ebf9);_0x34496b(_0x45ebf9);});});}function respondWithStatusCode(_0x5563a0,_0x3683c2){_0x3683c2=_0x3683c2||0xcc;return function(_0x3c25de){if(_0x3c25de){return _0x5563a0[_0xd6fa('0x1c')](_0x3683c2);}return _0x5563a0['status'](_0x3683c2)[_0xd6fa('0x1d')]();};}function respondWithResult(_0x4bab05,_0x1bd7a4){_0x1bd7a4=_0x1bd7a4||0xc8;return function(_0x374802){if(_0x374802){return _0x4bab05[_0xd6fa('0x1e')](_0x1bd7a4)[_0xd6fa('0x1f')](_0x374802);}};}function respondWithFilteredResult(_0x37e4e6,_0x456e0a){return function(_0x7ec231){if(_0x7ec231){var _0x558f6a=typeof _0x456e0a['offset']==='undefined'&&typeof _0x456e0a[_0xd6fa('0x20')]==='undefined';var _0x51a354=_0x7ec231[_0xd6fa('0x21')];var _0x4ac15b=_0x558f6a?0x0:_0x456e0a[_0xd6fa('0x22')];var _0x3e82ec=_0x558f6a?_0x7ec231[_0xd6fa('0x21')]:_0x456e0a['offset']+_0x456e0a[_0xd6fa('0x20')];var _0x218d45;if(_0x3e82ec>=_0x51a354){_0x3e82ec=_0x51a354;_0x218d45=0xc8;}else{_0x218d45=0xce;}_0x37e4e6['status'](_0x218d45);return _0x37e4e6[_0xd6fa('0x23')](_0xd6fa('0x24'),_0x4ac15b+'-'+_0x3e82ec+'/'+_0x51a354)[_0xd6fa('0x1f')](_0x7ec231);}return null;};}function saveUpdates(_0x17d36f){return function(_0x1f9575){if(_0x1f9575){return _0x1f9575[_0xd6fa('0x25')](_0x17d36f)[_0xd6fa('0x13')](function(_0x1e7785){return _0x1e7785;});}return null;};}function removeEntity(_0x1b9ca6){return function(_0x3e5f85){if(_0x3e5f85){return _0x3e5f85[_0xd6fa('0x26')]()[_0xd6fa('0x13')](function(){var _0x18f470=_0x3e5f85[_0xd6fa('0x27')]({'plain':!![]});if(_0x18f470[_0xd6fa('0x28')]===_0xd6fa('0x29'))return;var _0x42600c=[{'name':'Users','value':_0xd6fa('0x2a'),'ignore':!![]},{'name':_0xd6fa('0x2b'),'value':_0xd6fa('0x2c'),'ignore':![]},{'name':_0xd6fa('0x2d'),'value':'telephone','ignore':![]}];var _0x4f6540=_(_0x42600c)[_0xd6fa('0x2e')]('ignore')[_0xd6fa('0x2f')]('value')['value']();if(_[_0xd6fa('0x30')](_0x4f6540,_0x18f470[_0xd6fa('0x28')])){return;}var _0x5e35e7=_[_0xd6fa('0x31')](_0x42600c,[_0xd6fa('0x32'),_0x18f470[_0xd6fa('0x28')]])[_0xd6fa('0x33')];return db[_0xd6fa('0x34')][_0xd6fa('0x26')]({'where':{'type':_0x5e35e7,'resourceId':_0x18f470['id']}})[_0xd6fa('0x13')](function(){return _0x3e5f85;});})['then'](function(){_0x1b9ca6['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x22db87){return function(_0x464ac9){if(!_0x464ac9){_0x22db87[_0xd6fa('0x1c')](0x194);}return _0x464ac9;};}function handleError(_0x5c1405,_0x1dda13){_0x1dda13=_0x1dda13||0x1f4;return function(_0x479b0e){logger[_0xd6fa('0x18')](_0x479b0e['stack']);if(_0x479b0e[_0xd6fa('0x33')]){delete _0x479b0e[_0xd6fa('0x33')];}_0x5c1405[_0xd6fa('0x1e')](_0x1dda13)['send'](_0x479b0e);};}exports['index']=function(_0x142e00,_0x16d3e5){var _0x3022de={},_0x17fa34={'count':0x0,'rows':[]};var _0x239b64=_(db[_0xd6fa('0x35')][_0xd6fa('0x36')])[_0xd6fa('0x2f')](function(_0x19d87c){return{'name':_0x19d87c[_0xd6fa('0x37')],'type':_0x19d87c[_0xd6fa('0x38')][_0xd6fa('0x39')]};})['filter'](function(_0x2ce991){return!_[_0xd6fa('0x30')]([_0xd6fa('0x3a'),'salt'],_0x2ce991['name']);})['value']();_0x3022de=qs[_0xd6fa('0x3b')](_0x239b64,_0x142e00);var _0x351ceb={'where':_0x3022de[_0xd6fa('0x3c')]};return db['User'][_0xd6fa('0x21')](_0x351ceb)[_0xd6fa('0x13')](function(_0x43f43c){_0x17fa34[_0xd6fa('0x21')]=_0x43f43c;if(_0x142e00[_0xd6fa('0x3d')][_0xd6fa('0x3e')]){_0x3022de[_0xd6fa('0x3f')]=[{'all':!![]}];}if(!_[_0xd6fa('0x30')](_0x3022de['attributes'],'id')){_0x3022de[_0xd6fa('0x40')]['push']('id');}return db[_0xd6fa('0x35')][_0xd6fa('0x41')](_0x3022de);})[_0xd6fa('0x13')](function(_0x4ba055){_0x17fa34[_0xd6fa('0x42')]=_0x4ba055;if(_0x142e00[_0xd6fa('0x3d')]['openTabs']===_0xd6fa('0x43')){var _0x124302=[];for(var _0x4f3c41=0x0;_0x4f3c41<_0x17fa34['rows'][_0xd6fa('0x44')];_0x4f3c41++){_0x124302[_0xd6fa('0x45')](get_open_tabs(_0xd6fa('0x46'),_0x17fa34[_0xd6fa('0x42')][_0x4f3c41][_0xd6fa('0x47')]));_0x124302[_0xd6fa('0x45')](get_open_tabs(_0xd6fa('0x48'),_0x17fa34[_0xd6fa('0x42')][_0x4f3c41][_0xd6fa('0x47')]));_0x124302['push'](get_open_tabs(_0xd6fa('0x49'),_0x17fa34[_0xd6fa('0x42')][_0x4f3c41]['dataValues']));_0x124302[_0xd6fa('0x45')](get_open_tabs(_0xd6fa('0x4a'),_0x17fa34['rows'][_0x4f3c41][_0xd6fa('0x47')]));_0x124302[_0xd6fa('0x45')](get_open_tabs(_0xd6fa('0x4b'),_0x17fa34[_0xd6fa('0x42')][_0x4f3c41]['dataValues']));_0x124302['push'](get_open_tabs(_0xd6fa('0x4c'),_0x17fa34[_0xd6fa('0x42')][_0x4f3c41]['dataValues']));}return BPromise[_0xd6fa('0x4d')](_0x124302)[_0xd6fa('0x13')](function(_0x1c4c91){return _0x17fa34;});}else{return _0x17fa34;}})[_0xd6fa('0x13')](respondWithFilteredResult(_0x16d3e5,_0x3022de))[_0xd6fa('0x4e')](handleError(_0x16d3e5,null));};exports[_0xd6fa('0x4f')]=function(_0x28e0b6,_0x5be576){var _0x4bac02={'raw':![],'where':{'id':_0x28e0b6[_0xd6fa('0x50')]['id']}},_0x3f0cd3={};_0x3f0cd3[_0xd6fa('0x51')]=_['differenceBy'](_['keys'](db[_0xd6fa('0x35')][_0xd6fa('0x36')]),[_0xd6fa('0x3a'),'salt']);_0x3f0cd3[_0xd6fa('0x3d')]=_['keys'](_0x28e0b6[_0xd6fa('0x3d')]);_0x3f0cd3[_0xd6fa('0x52')]=_[_0xd6fa('0x53')](_0x3f0cd3[_0xd6fa('0x51')],_0x3f0cd3[_0xd6fa('0x3d')]);_0x4bac02[_0xd6fa('0x40')]=_[_0xd6fa('0x53')](_0x3f0cd3[_0xd6fa('0x51')],qs[_0xd6fa('0x54')](_0x28e0b6[_0xd6fa('0x3d')]['fields']));_0x4bac02[_0xd6fa('0x40')]=_0x4bac02[_0xd6fa('0x40')][_0xd6fa('0x44')]?_0x4bac02[_0xd6fa('0x40')]:_0x3f0cd3[_0xd6fa('0x51')];if(_0x28e0b6[_0xd6fa('0x3d')]['includeAll']){_0x4bac02[_0xd6fa('0x3f')]=[{'all':!![]}];}_0x4bac02=_[_0xd6fa('0x55')]({},_0x4bac02,_0x28e0b6[_0xd6fa('0x56')]);if(!_['includes'](_0x4bac02[_0xd6fa('0x40')],'id')){_0x4bac02[_0xd6fa('0x40')][_0xd6fa('0x45')]('id');}return db['User'][_0xd6fa('0x31')](_0x4bac02)[_0xd6fa('0x13')](handleEntityNotFound(_0x5be576,null))[_0xd6fa('0x13')](function(_0x596d5f){var _0x3f48e6=[];values=_0x596d5f;if(_0x28e0b6[_0xd6fa('0x3d')][_0xd6fa('0x57')]===_0xd6fa('0x43')){_0x3f48e6[_0xd6fa('0x45')](get_open_tabs('chat',_0x596d5f[_0xd6fa('0x47')]));_0x3f48e6[_0xd6fa('0x45')](get_open_tabs(_0xd6fa('0x48'),_0x596d5f[_0xd6fa('0x47')]));_0x3f48e6[_0xd6fa('0x45')](get_open_tabs(_0xd6fa('0x4b'),_0x596d5f[_0xd6fa('0x47')]));_0x3f48e6[_0xd6fa('0x45')](get_open_tabs(_0xd6fa('0x4c'),_0x596d5f[_0xd6fa('0x47')]));_0x3f48e6[_0xd6fa('0x45')](get_open_tabs('fax',_0x596d5f['dataValues']));_0x3f48e6[_0xd6fa('0x45')](get_open_tabs(_0xd6fa('0x4a'),_0x596d5f[_0xd6fa('0x47')]));return BPromise[_0xd6fa('0x4d')](_0x3f48e6);}else{return values;}})[_0xd6fa('0x13')](function(_0x16f85a){return values;})['then'](respondWithResult(_0x5be576,null))[_0xd6fa('0x4e')](handleError(_0x5be576,null));};exports['update']=function(_0x3f305e,_0x135900){if(_0x3f305e[_0xd6fa('0x58')]['id']){delete _0x3f305e[_0xd6fa('0x58')]['id'];}delete _0x3f305e[_0xd6fa('0x58')]['role'];return db[_0xd6fa('0x35')][_0xd6fa('0x31')]({'where':{'id':_0x3f305e[_0xd6fa('0x50')]['id']}})[_0xd6fa('0x13')](handleEntityNotFound(_0x135900,null))[_0xd6fa('0x13')](saveUpdates(_0x3f305e[_0xd6fa('0x58')],null))[_0xd6fa('0x13')](respondWithResult(_0x135900,null))['catch'](handleError(_0x135900,null));};exports[_0xd6fa('0x59')]=function(_0x5f50a0,_0x23e3e5){return db[_0xd6fa('0x35')][_0xd6fa('0x59')]()[_0xd6fa('0x13')](respondWithResult(_0x23e3e5,null))[_0xd6fa('0x4e')](handleError(_0x23e3e5,null));};exports['addContacts']=function(_0x2d2764,_0x495eb4){return db[_0xd6fa('0x35')]['find']({'where':{'id':_0x2d2764[_0xd6fa('0x50')]['id']}})[_0xd6fa('0x13')](handleEntityNotFound(_0x495eb4,null))['then'](function(_0x3be929){if(_0x3be929){return _0x3be929[_0xd6fa('0x5a')](_0x2d2764['body']['ids'],_['omit'](_0x2d2764['body'],['ids','id'])||{});}})[_0xd6fa('0x13')](respondWithResult(_0x495eb4,null))[_0xd6fa('0x4e')](handleError(_0x495eb4,null));};function validateUser(_0x3e766e){return new BPromise(function(_0x137213,_0x495e77){if(_0x3e766e[_0xd6fa('0x5b')])return _0x137213(_0x3e766e);return db['Setting']['findById'](0x1)[_0xd6fa('0x13')](function(_0x6a60e5){if(_0x6a60e5[_0xd6fa('0x5c')])authService['validatePasswordPattern'](_0x3e766e[_0xd6fa('0x3a')]);db[_0xd6fa('0x35')][_0xd6fa('0x5d')](_0xd6fa('0x5b'))['then'](function(_0x1564b0){if(_[_0xd6fa('0x5e')](_0x1564b0)){_0x3e766e[_0xd6fa('0x5b')]=_0x6a60e5[_0xd6fa('0x5f')]||0x1;return;}if(_['isNil'](_0x6a60e5['min_internal'])||_0x6a60e5[_0xd6fa('0x5f')]===_0x1564b0){_0x3e766e[_0xd6fa('0x5b')]=_0x1564b0+0x1;return;}if(_0x6a60e5['min_internal']>_0x1564b0){_0x3e766e[_0xd6fa('0x5b')]=_0x6a60e5['min_internal'];return;}return db[_0xd6fa('0x60')][_0xd6fa('0x3d')](_0xd6fa('0x61'),{'type':db[_0xd6fa('0x60')]['QueryTypes'][_0xd6fa('0x62')]})['then'](function(_0x4d9f51){if(_0x4d9f51&&_0x4d9f51[_0xd6fa('0x44')]){for(var _0x31c4fa=0x0,_0x271498=_0x4d9f51[_0xd6fa('0x44')];_0x31c4fa<_0x271498&&_['isNil'](_0x3e766e[_0xd6fa('0x5b')]);_0x31c4fa++){if(_0x6a60e5[_0xd6fa('0x5f')]<=_0x4d9f51[_0x31c4fa]['from']){_0x3e766e[_0xd6fa('0x5b')]=_0x4d9f51[_0x31c4fa][_0xd6fa('0x63')];}else if(_0x6a60e5[_0xd6fa('0x5f')]>_0x4d9f51[_0x31c4fa][_0xd6fa('0x63')]&&_0x6a60e5[_0xd6fa('0x5f')]<=_0x4d9f51[_0x31c4fa]['to']){_0x3e766e[_0xd6fa('0x5b')]=_0x6a60e5[_0xd6fa('0x5f')];}}}if(_[_0xd6fa('0x5e')](_0x3e766e[_0xd6fa('0x5b')])){_0x3e766e['internal']=_0x1564b0+0x1;}return _0x137213(_0x3e766e);});});})['catch'](function(_0x30a586){_0x495e77(_0x30a586);});});}function updateUser(_0x5a9d1c){return new BPromise(function(_0x403c4c,_0x50e5be){try{if(_0x5a9d1c[_0xd6fa('0x64')]){_0x5a9d1c[_0xd6fa('0x65')]=_0x5a9d1c[_0xd6fa('0x5b')];_0x5a9d1c['VoiceMail']={'mailbox':_0x5a9d1c[_0xd6fa('0x5b')],'password':_0x5a9d1c[_0xd6fa('0x3a')],'fullname':_0x5a9d1c['fullname'],'email':_0x5a9d1c[_0xd6fa('0x66')]};}if(_0x5a9d1c[_0xd6fa('0x28')]===_0xd6fa('0x2c')){if(!_0x5a9d1c[_0xd6fa('0x67')])_0x5a9d1c[_0xd6fa('0x67')]=[_0xd6fa('0x68'),_0xd6fa('0x69'),_0xd6fa('0x6a'),_0xd6fa('0x6b'),_0xd6fa('0x6c'),_0xd6fa('0x6d'),_0xd6fa('0x6e'),_0xd6fa('0x6f'),_0xd6fa('0x70'),_0xd6fa('0x71'),_0xd6fa('0x72'),'100',_0xd6fa('0x73'),'114',_0xd6fa('0x74')];}_0x403c4c(_0x5a9d1c);}catch(_0x1bda28){_0x50e5be(_0x1bda28);}});}exports[_0xd6fa('0x75')]=function(_0x22e28d,_0x1b7699){if(_0x22e28d[_0xd6fa('0x2a')][_0xd6fa('0x28')]===_0xd6fa('0x2c'))throw new Error('Unauthorized');if(_0x22e28d[_0xd6fa('0x58')][_0xd6fa('0x28')]===_0xd6fa('0x2a')&&_0x22e28d[_0xd6fa('0x2a')][_0xd6fa('0x28')]!==_0xd6fa('0x29')){throw new Error(_0xd6fa('0x76'));}if(_0x22e28d[_0xd6fa('0x58')][_0xd6fa('0x28')]===_0xd6fa('0x29')&&_0x22e28d[_0xd6fa('0x2a')][_0xd6fa('0x28')]!==_0xd6fa('0x29')){throw new Error(_0xd6fa('0x77'));}return licenseUtil[_0xd6fa('0x78')]([_0x22e28d[_0xd6fa('0x58')]])[_0xd6fa('0x13')](function(){return validateUser(_0x22e28d[_0xd6fa('0x58')]);})[_0xd6fa('0x13')](function(_0x6c0927){return updateUser(_0x6c0927)[_0xd6fa('0x13')](function(_0x5c5dc7){if(_0x5c5dc7['role']===_0xd6fa('0x29')){_0x5c5dc7[_0xd6fa('0x79')]=_0x22e28d['user'][_0xd6fa('0x79')];delete _0x5c5dc7[_0xd6fa('0x7a')];}return _0x5c5dc7;});})[_0xd6fa('0x13')](function(_0x8961c2){return db['User']['create'](_0x8961c2,{'include':[{'model':db[_0xd6fa('0x7b')],'as':_0xd6fa('0x7b')}]});})['then'](function(_0x560b7a){if(_0x22e28d[_0xd6fa('0x58')][_0xd6fa('0x28')]===_0xd6fa('0x2a'))return _0x560b7a;if(_0x22e28d[_0xd6fa('0x2a')][_0xd6fa('0x28')]!=='user')return _0x560b7a;return db['UserProfileSection']['find']({'where':{'name':_0x560b7a[_0xd6fa('0x28')]==='agent'?_0xd6fa('0x2b'):_0xd6fa('0x2d'),'userProfileId':_0x22e28d[_0xd6fa('0x2a')][_0xd6fa('0x7a')]},'raw':!![]})[_0xd6fa('0x13')](function(_0x40b575){if(!_0x40b575||_0x40b575[_0xd6fa('0x7c')]!=0x0)return _0x560b7a;return db[_0xd6fa('0x34')][_0xd6fa('0x75')]({'name':_0x560b7a['name'],'resourceId':_0x560b7a['id'],'type':_0x40b575[_0xd6fa('0x33')],'sectionId':_0x40b575['id']},{})[_0xd6fa('0x13')](function(){return _0x560b7a;});})[_0xd6fa('0x4e')](function(_0x31573e){logger['error'](_0xd6fa('0x7d'),_0x31573e);throw _0x31573e;});})[_0xd6fa('0x13')](respondWithResult(_0x1b7699,0xc9))[_0xd6fa('0x4e')](handleError(_0x1b7699,null));};exports['bulkCreate']=function(_0x2e0e7b,_0x4aca21){var _0x3b7154=_0x2e0e7b[_0xd6fa('0x58')];var _0x209a65=[];if(_0x2e0e7b[_0xd6fa('0x2a')][_0xd6fa('0x28')]==='agent')throw new Error(_0xd6fa('0x7e'));if(_['some'](_0x3b7154,['role',_0xd6fa('0x2a')])&&_0x2e0e7b['user'][_0xd6fa('0x28')]!==_0xd6fa('0x29')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_[_0xd6fa('0x7f')](_0x3b7154,[_0xd6fa('0x28'),_0xd6fa('0x29')])&&_0x2e0e7b['user']['role']!==_0xd6fa('0x29')){throw new Error(_0xd6fa('0x80'));}return licenseUtil[_0xd6fa('0x78')](_0x3b7154)[_0xd6fa('0x13')](function(){return validateUser(_0x3b7154[0x0]);})['then'](function(){for(var _0x23d15c=0x1;_0x23d15c<_0x3b7154[_0xd6fa('0x44')];_0x23d15c++){var _0x21df6f=_0x3b7154[_0x23d15c-0x1][_0xd6fa('0x5b')];if(!_0x3b7154[_0x23d15c]['internal'])_0x3b7154[_0x23d15c]['internal']=_0x21df6f+0x1;_0x209a65[_0xd6fa('0x45')](validateUser(_0x3b7154[_0x23d15c]));}return BPromise[_0xd6fa('0x4d')](_0x209a65);})[_0xd6fa('0x13')](function(){_0x209a65=[];for(var _0x2d1833=0x0;_0x2d1833<_0x3b7154[_0xd6fa('0x44')];_0x2d1833++){_0x209a65[_0xd6fa('0x45')](updateUser(_0x3b7154[_0x2d1833]));}return BPromise[_0xd6fa('0x4d')](_0x209a65);})[_0xd6fa('0x13')](function(){return BPromise[_0xd6fa('0x81')](_0x3b7154,function(_0x6feb10){return db['User'][_0xd6fa('0x75')](_0x6feb10,{'include':[{'model':db['VoiceMail'],'as':_0xd6fa('0x7b')}]})[_0xd6fa('0x13')](function(_0x563a05){_0x6feb10['id']=_0x563a05['id'];return _0x6feb10;});});})[_0xd6fa('0x13')](function(_0x58bcfd){if(_0x2e0e7b[_0xd6fa('0x58')][_0xd6fa('0x28')]===_0xd6fa('0x2a'))return _0x58bcfd;if(_0x2e0e7b[_0xd6fa('0x2a')][_0xd6fa('0x28')]!==_0xd6fa('0x2a'))return _0x58bcfd;var _0x10bb9a=_[_0xd6fa('0x7f')](_0x58bcfd,function(_0x3337df){return _0x3337df[_0xd6fa('0x28')]===_0xd6fa('0x2c')||_0x3337df[_0xd6fa('0x28')]===_0xd6fa('0x82');});if(!_0x10bb9a)return _0x58bcfd;return db[_0xd6fa('0x83')]['findAll']({'where':{'name':{'$or':[_0xd6fa('0x2b'),'Telephones']},'userProfileId':_0x2e0e7b[_0xd6fa('0x2a')][_0xd6fa('0x7a')]},'raw':!![]})[_0xd6fa('0x13')](function(_0x556043){if(_['isEmpty'](_0x556043)||!_[_0xd6fa('0x7f')](_0x556043,[_0xd6fa('0x7c'),0x0]))return _0x58bcfd;_0x209a65=[];var _0x911492=_(_0x556043)[_0xd6fa('0x2f')](function(_0x559f29){if(_0x559f29[_0xd6fa('0x7c')]===0x1)return;return _0x559f29[_0xd6fa('0x33')]===_0xd6fa('0x2b')?_0xd6fa('0x2c'):_0xd6fa('0x82');})[_0xd6fa('0x84')]()[_0xd6fa('0x32')]();for(var _0x341d9f=0x0;_0x341d9f<_0x58bcfd[_0xd6fa('0x44')];_0x341d9f++){if(!_[_0xd6fa('0x30')](_0x911492,_0x58bcfd[_0x341d9f]['role']))return;var _0x404005=_0x58bcfd[_0x341d9f][_0xd6fa('0x28')]==='agent'?_0xd6fa('0x2b'):'Telephones';_0x209a65['push'](db[_0xd6fa('0x34')][_0xd6fa('0x75')]({'name':_0x58bcfd[_0x341d9f][_0xd6fa('0x33')],'resourceId':_0x58bcfd[_0x341d9f]['id'],'type':_0x404005,'sectionId':_[_0xd6fa('0x31')](_0x556043,[_0xd6fa('0x33'),_0x404005])['id']},{}));}return BPromise['all'](_0x209a65);});})[_0xd6fa('0x13')](respondWithResult(_0x4aca21,0xc9))[_0xd6fa('0x4e')](handleError(_0x4aca21,null));};exports[_0xd6fa('0x85')]=function(_0x2443b1,_0x550302){if(_0x2443b1['body']['id']){delete _0x2443b1[_0xd6fa('0x58')]['id'];}return db[_0xd6fa('0x35')][_0xd6fa('0x31')]({'where':{'id':_0x2443b1['params']['id']}})[_0xd6fa('0x13')](function(_0x37ec61){if(!_0x37ec61)return null;if(_0x37ec61['id']===_0x2443b1[_0xd6fa('0x2a')]['id']){if(!_0x2443b1['body'][_0xd6fa('0x86')]||!_0x2443b1[_0xd6fa('0x58')][_0xd6fa('0x87')]){throw new db[(_0xd6fa('0x88'))]['ValidationError'](_0xd6fa('0x89'));}if(!_0x37ec61['authenticate'](_0x2443b1[_0xd6fa('0x58')][_0xd6fa('0x86')])){throw new db[(_0xd6fa('0x88'))][(_0xd6fa('0x8a'))]('Wrong\x20credentials');}if(_0x2443b1[_0xd6fa('0x58')][_0xd6fa('0x86')]===_0x2443b1[_0xd6fa('0x58')]['newPassword']){throw new db[(_0xd6fa('0x88'))][(_0xd6fa('0x8a'))](_0xd6fa('0x8b'));}}else if(_0x2443b1[_0xd6fa('0x2a')][_0xd6fa('0x28')]===_0xd6fa('0x29')){if(!_0x2443b1[_0xd6fa('0x58')][_0xd6fa('0x87')]){throw new db[(_0xd6fa('0x88'))][(_0xd6fa('0x8a'))](_0xd6fa('0x8c'));}}else if(_0x2443b1[_0xd6fa('0x2a')]['role']===_0xd6fa('0x2a')){if(!_0x2443b1[_0xd6fa('0x58')][_0xd6fa('0x87')]){throw new db[(_0xd6fa('0x88'))][(_0xd6fa('0x8a'))](_0xd6fa('0x8c'));}if(_0x37ec61[_0xd6fa('0x28')]!==_0xd6fa('0x2c')){throw new db[(_0xd6fa('0x88'))][(_0xd6fa('0x8a'))](_0xd6fa('0x7e'));}}else{throw new db[(_0xd6fa('0x88'))][(_0xd6fa('0x8a'))](_0xd6fa('0x7e'));}return _0x37ec61;})[_0xd6fa('0x13')](handleEntityNotFound(_0x550302,null))[_0xd6fa('0x13')](function(_0x11ef8d){return db[_0xd6fa('0x8d')][_0xd6fa('0x8e')]({'attributes':['id',_0xd6fa('0x5c'),_0xd6fa('0x8f'),_0xd6fa('0x90')]})[_0xd6fa('0x13')](function(_0x43ba34){if(_0x43ba34[_0xd6fa('0x5c')])authService[_0xd6fa('0x91')](_0x2443b1[_0xd6fa('0x58')][_0xd6fa('0x87')]);if(!_0x43ba34[_0xd6fa('0x8f')]||!_0x11ef8d['previousPasswords'])return _0x11ef8d;authService[_0xd6fa('0x92')](_0x2443b1[_0xd6fa('0x58')][_0xd6fa('0x87')],_0x11ef8d['previousPasswords'],_0x43ba34[_0xd6fa('0x90')]);return _0x11ef8d;})[_0xd6fa('0x13')](saveUpdates({'password':_0x2443b1[_0xd6fa('0x58')]['newPassword'],'passwordResetAt':_0x2443b1['user']['id']==_0x2443b1[_0xd6fa('0x50')]['id']?moment():null,'previousPasswords':authService['updatePasswordsHistory'](_0x2443b1[_0xd6fa('0x58')][_0xd6fa('0x87')],_0x11ef8d[_0xd6fa('0x93')])},null));})[_0xd6fa('0x13')](respondWithResult(_0x550302,null))[_0xd6fa('0x4e')](handleError(_0x550302,null));};exports[_0xd6fa('0x94')]=function(_0x2a8a7e,_0x3f84a3){var _0x5f4543=_0x2a8a7e[_0xd6fa('0x58')][_0xd6fa('0x95')];return db[_0xd6fa('0x35')][_0xd6fa('0x31')]({'where':{'id':_0x2a8a7e[_0xd6fa('0x50')]['id']},'attributes':['id',_0xd6fa('0x33'),_0xd6fa('0x28'),_0xd6fa('0x96'),_0xd6fa('0x97'),_0xd6fa('0x98'),_0xd6fa('0x99')]})[_0xd6fa('0x13')](handleEntityNotFound(_0x3f84a3,null))[_0xd6fa('0x13')](function(_0xbf08ef){if(_0xbf08ef){if(!utils[_0xd6fa('0x9a')](_0x5f4543)){throw new db[(_0xd6fa('0x88'))]['ValidationError'](_0xd6fa('0x9b'));}return _0xbf08ef[_0xd6fa('0x9c')+_[_0xd6fa('0x9d')](_0x5f4543[_0xd6fa('0x9e')]())+'Queues'](_0x2a8a7e[_0xd6fa('0x58')]['ids'],{'penalty':_0x2a8a7e[_0xd6fa('0x58')][_0xd6fa('0x9f')]||0x0})['spread'](function(_0x2995de){for(var _0x302c14=0x0;_0x302c14<_0x2a8a7e['body'][_0xd6fa('0xa0')][_0xd6fa('0x44')];_0x302c14+=0x1){var _0x5864ec={'UserId':Number(_0x2a8a7e[_0xd6fa('0x50')]['id'])};_0x5864ec[_[_0xd6fa('0x9d')](_0x5f4543[_0xd6fa('0x9e')]())+_0xd6fa('0xa1')]=Number(_0x2a8a7e['body'][_0xd6fa('0xa0')][_0x302c14]);socket['emit'](_0xd6fa('0x2a')+_[_0xd6fa('0x9d')](_0x5f4543['toLowerCase']())+_0xd6fa('0xa2'),_0x5864ec);}return _0x2995de;})['then'](function(){if(_0x5f4543===_0xd6fa('0xa3')){return db[_0xd6fa('0xa4')][_0xd6fa('0x41')]({'where':{'id':_0x2a8a7e[_0xd6fa('0x58')][_0xd6fa('0xa0')]||[]},'raw':!![],'attributes':['id','name']});}})['then'](function(_0x1e8b46){var _0x39740a=_0xbf08ef[_0xd6fa('0x27')]({'plain':!![]});var _0x2470f6=[];if(_0x5f4543===_0xd6fa('0xa3')&&_0x39740a['role']===_0xd6fa('0x2c')&&_0x39740a['online']){for(var _0x5e8ad7=0x0;_0x5e8ad7<_0x1e8b46[_0xd6fa('0x44')];_0x5e8ad7+=0x1){_0x2470f6['push']({'membername':_0x39740a['name'],'UserId':_0x39740a['id'],'queue_name':_0x1e8b46[_0x5e8ad7][_0xd6fa('0x33')],'VoiceQueueId':_0x1e8b46[_0x5e8ad7]['id'],'interface':_[_0xd6fa('0x5e')](_0x39740a[_0xd6fa('0x99')])?util['format'](_0xd6fa('0xa5'),_0x39740a[_0xd6fa('0x33')]):_0x39740a['interface'],'paused':_0x39740a[_0xd6fa('0x98')]||![],'penalty':_0x2a8a7e['body'][_0xd6fa('0x9f')]||0x0});}return BPromise[_0xd6fa('0x81')](_0x2470f6,function(_0x3e29ee){return db[_0xd6fa('0xa6')][_0xd6fa('0xa7')](_0x3e29ee);});}return _0xbf08ef;});}})[_0xd6fa('0x13')](respondWithStatusCode(_0x3f84a3,null))[_0xd6fa('0x4e')](handleError(_0x3f84a3,null));};exports[_0xd6fa('0xa8')]=function(_0x4f72f0,_0x83bcab){var _0xb83875;return db['User'][_0xd6fa('0x31')]({'where':{'id':_0x4f72f0[_0xd6fa('0x50')]['id']},'attributes':['id',_0xd6fa('0x33'),_0xd6fa('0x28')]})[_0xd6fa('0x13')](handleEntityNotFound(_0x83bcab,null))['then'](function(_0x36db2c){if(_0x36db2c){_0xb83875=_0x36db2c;if(!_0x4f72f0['query']['channel']||!utils[_0xd6fa('0x9a')](_0x4f72f0[_0xd6fa('0x3d')][_0xd6fa('0x95')])){throw new db[(_0xd6fa('0x88'))]['ValidationError']('Unknown\x20channel');}return _0x36db2c[_0xd6fa('0xa9')+_[_0xd6fa('0x9d')](_0x4f72f0[_0xd6fa('0x3d')][_0xd6fa('0x95')][_0xd6fa('0x9e')]())+_0xd6fa('0xaa')](_0x4f72f0[_0xd6fa('0x3d')][_0xd6fa('0xa0')]);}})[_0xd6fa('0x13')](function(_0x52bd33){if(_[_0xd6fa('0xab')](_0x4f72f0[_0xd6fa('0x3d')][_0xd6fa('0xa0')])){for(var _0x240cf5=0x0;_0x240cf5<_0x4f72f0[_0xd6fa('0x3d')][_0xd6fa('0xa0')][_0xd6fa('0x44')];_0x240cf5+=0x1){var _0x52f0c1={'UserId':Number(_0x4f72f0[_0xd6fa('0x50')]['id'])};_0x52f0c1[_['capitalize'](_0x4f72f0[_0xd6fa('0x3d')][_0xd6fa('0x95')]['toLowerCase']())+_0xd6fa('0xa1')]=Number(_0x4f72f0[_0xd6fa('0x3d')][_0xd6fa('0xa0')][_0x240cf5]);socket[_0xd6fa('0xac')]('user'+_['capitalize'](_0x4f72f0[_0xd6fa('0x3d')][_0xd6fa('0x95')][_0xd6fa('0x9e')]())+_0xd6fa('0xad'),_0x52f0c1);}}else{var _0x52f0c1={'UserId':Number(_0x4f72f0[_0xd6fa('0x50')]['id'])};_0x52f0c1[_[_0xd6fa('0x9d')](_0x4f72f0[_0xd6fa('0x3d')][_0xd6fa('0x95')]['toLowerCase']())+_0xd6fa('0xa1')]=Number(_0x4f72f0[_0xd6fa('0x3d')][_0xd6fa('0xa0')]);socket['emit'](_0xd6fa('0x2a')+_['capitalize'](_0x4f72f0[_0xd6fa('0x3d')]['channel'][_0xd6fa('0x9e')]())+_0xd6fa('0xad'),_0x52f0c1);}return _0x52bd33;})[_0xd6fa('0x13')](function(){if(_0x4f72f0['query'][_0xd6fa('0x95')]===_0xd6fa('0xa3')){return db[_0xd6fa('0xa6')]['destroy']({'where':{'UserId':_0x4f72f0[_0xd6fa('0x50')]['id'],'VoiceQueueId':_0x4f72f0['query'][_0xd6fa('0xa0')]},'individualHooks':!![]})[_0xd6fa('0x13')](function(){return _0xb83875;});}return _0xb83875;})[_0xd6fa('0x13')](respondWithStatusCode(_0x83bcab,null))[_0xd6fa('0x4e')](handleError(_0x83bcab,null));};exports[_0xd6fa('0xae')]=function(_0xce3581,_0xd9ebce){_0xce3581[_0xd6fa('0x58')][_0xd6fa('0xaf')]=_0xce3581[_0xd6fa('0xb0')][_0xd6fa('0xb1')];return db['User'][_0xd6fa('0x31')]({'where':{'id':_0xce3581[_0xd6fa('0x50')]['id']}})[_0xd6fa('0x13')](handleEntityNotFound(_0xd9ebce,null))[_0xd6fa('0x13')](saveUpdates(_0xce3581[_0xd6fa('0x58')],null))['then'](respondWithResult(_0xd9ebce,null))[_0xd6fa('0x4e')](handleError(_0xd9ebce,null));};exports[_0xd6fa('0xb2')]=function(_0x1f6d1c,_0x563516){var _0x422ffd=path[_0xd6fa('0xb3')](config[_0xd6fa('0xb4')],'server/files/images/logos/default_profile.png');return db[_0xd6fa('0x35')][_0xd6fa('0x31')]({'where':{'id':_0x1f6d1c['params']['id']},'attributes':['id',_0xd6fa('0xaf')],'raw':!![]})[_0xd6fa('0x13')](handleEntityNotFound(_0x563516,null))[_0xd6fa('0x13')](function(_0x7fe85e){if(_0x7fe85e){if(_[_0xd6fa('0x5e')](_0x7fe85e[_0xd6fa('0xaf')])){return _0x563516[_0xd6fa('0xb5')](_0x422ffd);}else{if(!fs[_0xd6fa('0xb6')](path[_0xd6fa('0xb3')](config[_0xd6fa('0xb4')],_0xd6fa('0xb7'),_0x7fe85e['userpic']))){return _0x563516[_0xd6fa('0xb5')](_0x422ffd);}return _0x563516['download'](path[_0xd6fa('0xb3')](config[_0xd6fa('0xb4')],'server/files/images/',_0x7fe85e[_0xd6fa('0xaf')]));}}})[_0xd6fa('0x4e')](handleError(_0x563516,null));};exports['getOpenTabs']=function(_0x142d90,_0x567d39){return db[_0xd6fa('0x35')][_0xd6fa('0x31')]({'where':{'id':_0x142d90[_0xd6fa('0x50')]['id']},'attributes':['id']})[_0xd6fa('0x13')](handleEntityNotFound(_0x567d39,null))['then'](function(_0x281d92){var _0x4fc8c2=[];values=_0x281d92['dataValues'];_0x4fc8c2[_0xd6fa('0x45')](get_open_tabs(_0xd6fa('0x46'),_0x281d92['dataValues']));_0x4fc8c2[_0xd6fa('0x45')](get_open_tabs('sms',_0x281d92[_0xd6fa('0x47')]));_0x4fc8c2[_0xd6fa('0x45')](get_open_tabs(_0xd6fa('0x4b'),_0x281d92[_0xd6fa('0x47')]));_0x4fc8c2[_0xd6fa('0x45')](get_open_tabs(_0xd6fa('0x4c'),_0x281d92[_0xd6fa('0x47')]));_0x4fc8c2['push'](get_open_tabs(_0xd6fa('0x49'),_0x281d92[_0xd6fa('0x47')]));_0x4fc8c2[_0xd6fa('0x45')](get_open_tabs(_0xd6fa('0x4a'),_0x281d92[_0xd6fa('0x47')]));return BPromise['all'](_0x4fc8c2);})[_0xd6fa('0x13')](function(_0x183274){var _0x36fd68=[];if(_0x183274){for(var _0x33e11c=0x0;_0x33e11c=_0x1c0c52){_0x2df9bf=_0x1c0c52;_0x17e458=0xc8;}else{_0x17e458=0xce;}_0x5838d1[_0x4055('0x1c')](_0x17e458);return _0x5838d1[_0x4055('0x23')]('Content-Range',_0x50c85c+'-'+_0x2df9bf+'/'+_0x1c0c52)['json'](_0x5d7800);}return null;};}function saveUpdates(_0x657e51){return function(_0x115487){if(_0x115487){return _0x115487[_0x4055('0x24')](_0x657e51)[_0x4055('0x25')](function(_0x31379b){return _0x31379b;});}return null;};}function removeEntity(_0x157b9a){return function(_0x22c81f){if(_0x22c81f){return _0x22c81f['destroy']()[_0x4055('0x25')](function(){var _0x4a1533=_0x22c81f[_0x4055('0x26')]({'plain':!![]});if(_0x4a1533[_0x4055('0x27')]===_0x4055('0x28'))return;var _0x1394d0=[{'name':_0x4055('0x29'),'value':_0x4055('0x2a'),'ignore':!![]},{'name':_0x4055('0x2b'),'value':_0x4055('0x2c'),'ignore':![]},{'name':'Telephones','value':_0x4055('0x2d'),'ignore':![]}];var _0x25cce9=_(_0x1394d0)['filter']('ignore')[_0x4055('0x2e')](_0x4055('0x2f'))[_0x4055('0x2f')]();if(_[_0x4055('0x30')](_0x25cce9,_0x4a1533['role'])){return;}var _0x1ee83b=_[_0x4055('0x31')](_0x1394d0,['value',_0x4a1533['role']])['name'];return db['UserProfileResource'][_0x4055('0x32')]({'where':{'type':_0x1ee83b,'resourceId':_0x4a1533['id']}})[_0x4055('0x25')](function(){return _0x22c81f;});})[_0x4055('0x25')](function(){_0x157b9a[_0x4055('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0xce2e1c){return function(_0x1465bf){if(!_0x1465bf){_0xce2e1c[_0x4055('0x1b')](0x194);}return _0x1465bf;};}function handleError(_0x4e5532,_0x58b85a){_0x58b85a=_0x58b85a||0x1f4;return function(_0x4f773e){logger[_0x4055('0x16')](_0x4f773e['stack']);if(_0x4f773e[_0x4055('0x33')]){delete _0x4f773e[_0x4055('0x33')];}_0x4e5532[_0x4055('0x1c')](_0x58b85a)['send'](_0x4f773e);};}exports[_0x4055('0x34')]=function(_0x110c97,_0x30d331){var _0x2ecd03={},_0x3de270={'count':0x0,'rows':[]};var _0x157f3e=_(db[_0x4055('0x35')][_0x4055('0x36')])[_0x4055('0x2e')](function(_0x7434c0){return{'name':_0x7434c0['fieldName'],'type':_0x7434c0[_0x4055('0x37')][_0x4055('0x38')]};})[_0x4055('0x39')](function(_0x480665){return!_['includes']([_0x4055('0x3a'),_0x4055('0x3b')],_0x480665['name']);})[_0x4055('0x2f')]();_0x2ecd03=qs['getOptions'](_0x157f3e,_0x110c97);var _0x43a243={'where':_0x2ecd03[_0x4055('0x3c')]};return db[_0x4055('0x35')]['count'](_0x43a243)['then'](function(_0x195944){_0x3de270[_0x4055('0x22')]=_0x195944;if(_0x110c97[_0x4055('0x3d')][_0x4055('0x3e')]){_0x2ecd03[_0x4055('0x3f')]=[{'all':!![]}];}if(!_['includes'](_0x2ecd03[_0x4055('0x40')],'id')){_0x2ecd03[_0x4055('0x40')]['push']('id');}return db[_0x4055('0x35')]['findAll'](_0x2ecd03);})[_0x4055('0x25')](function(_0x3a0b10){_0x3de270['rows']=_0x3a0b10;if(_0x110c97[_0x4055('0x3d')][_0x4055('0x41')]===_0x4055('0x42')){var _0xb1c6f8=[];for(var _0x35a454=0x0;_0x35a454<_0x3de270['rows'][_0x4055('0x43')];_0x35a454++){_0xb1c6f8[_0x4055('0x44')](get_open_tabs(_0x4055('0x45'),_0x3de270[_0x4055('0x46')][_0x35a454]['dataValues']));_0xb1c6f8[_0x4055('0x44')](get_open_tabs(_0x4055('0x47'),_0x3de270[_0x4055('0x46')][_0x35a454]['dataValues']));_0xb1c6f8[_0x4055('0x44')](get_open_tabs(_0x4055('0x48'),_0x3de270[_0x4055('0x46')][_0x35a454][_0x4055('0x49')]));_0xb1c6f8[_0x4055('0x44')](get_open_tabs('mail',_0x3de270[_0x4055('0x46')][_0x35a454][_0x4055('0x49')]));_0xb1c6f8['push'](get_open_tabs('openchannel',_0x3de270[_0x4055('0x46')][_0x35a454][_0x4055('0x49')]));_0xb1c6f8[_0x4055('0x44')](get_open_tabs('whatsapp',_0x3de270[_0x4055('0x46')][_0x35a454][_0x4055('0x49')]));}return BPromise[_0x4055('0x4a')](_0xb1c6f8)[_0x4055('0x25')](function(_0x30e9dd){return _0x3de270;});}else{return _0x3de270;}})[_0x4055('0x25')](respondWithFilteredResult(_0x30d331,_0x2ecd03))[_0x4055('0x1a')](handleError(_0x30d331,null));};exports['show']=function(_0x4e909d,_0x5100a5){var _0x5411f5={'raw':![],'where':{'id':_0x4e909d[_0x4055('0x4b')]['id']}},_0x339a85={};_0x339a85[_0x4055('0x4c')]=_[_0x4055('0x4d')](_[_0x4055('0x4e')](db[_0x4055('0x35')][_0x4055('0x36')]),[_0x4055('0x3a'),'salt']);_0x339a85[_0x4055('0x3d')]=_[_0x4055('0x4e')](_0x4e909d[_0x4055('0x3d')]);_0x339a85[_0x4055('0x4f')]=_['intersection'](_0x339a85['model'],_0x339a85[_0x4055('0x3d')]);_0x5411f5[_0x4055('0x40')]=_[_0x4055('0x50')](_0x339a85['model'],qs[_0x4055('0x51')](_0x4e909d[_0x4055('0x3d')][_0x4055('0x51')]));_0x5411f5[_0x4055('0x40')]=_0x5411f5[_0x4055('0x40')][_0x4055('0x43')]?_0x5411f5[_0x4055('0x40')]:_0x339a85['model'];if(_0x4e909d[_0x4055('0x3d')][_0x4055('0x3e')]){_0x5411f5['include']=[{'all':!![]}];}_0x5411f5=_[_0x4055('0x52')]({},_0x5411f5,_0x4e909d['options']);if(!_[_0x4055('0x30')](_0x5411f5[_0x4055('0x40')],'id')){_0x5411f5[_0x4055('0x40')][_0x4055('0x44')]('id');}return db[_0x4055('0x35')]['find'](_0x5411f5)[_0x4055('0x25')](handleEntityNotFound(_0x5100a5,null))[_0x4055('0x25')](function(_0x4fc94c){var _0x52d112=[];values=_0x4fc94c;if(_0x4e909d[_0x4055('0x3d')]['openTabs']===_0x4055('0x42')){_0x52d112[_0x4055('0x44')](get_open_tabs(_0x4055('0x45'),_0x4fc94c[_0x4055('0x49')]));_0x52d112[_0x4055('0x44')](get_open_tabs(_0x4055('0x47'),_0x4fc94c[_0x4055('0x49')]));_0x52d112[_0x4055('0x44')](get_open_tabs(_0x4055('0x53'),_0x4fc94c[_0x4055('0x49')]));_0x52d112['push'](get_open_tabs(_0x4055('0x54'),_0x4fc94c['dataValues']));_0x52d112['push'](get_open_tabs('fax',_0x4fc94c[_0x4055('0x49')]));_0x52d112[_0x4055('0x44')](get_open_tabs(_0x4055('0x55'),_0x4fc94c['dataValues']));return BPromise[_0x4055('0x4a')](_0x52d112);}else{return values;}})['then'](function(_0xac4667){return values;})[_0x4055('0x25')](respondWithResult(_0x5100a5,null))[_0x4055('0x1a')](handleError(_0x5100a5,null));};exports[_0x4055('0x24')]=function(_0x594960,_0x1700e0){if(_0x594960['body']['id']){delete _0x594960[_0x4055('0x56')]['id'];}delete _0x594960[_0x4055('0x56')]['role'];return db['User'][_0x4055('0x31')]({'where':{'id':_0x594960['params']['id']}})[_0x4055('0x25')](handleEntityNotFound(_0x1700e0,null))[_0x4055('0x25')](saveUpdates(_0x594960[_0x4055('0x56')],null))[_0x4055('0x25')](respondWithResult(_0x1700e0,null))[_0x4055('0x1a')](handleError(_0x1700e0,null));};exports['describe']=function(_0x4f2d49,_0x3f6ff9){return db[_0x4055('0x35')][_0x4055('0x57')]()[_0x4055('0x25')](respondWithResult(_0x3f6ff9,null))['catch'](handleError(_0x3f6ff9,null));};exports[_0x4055('0x58')]=function(_0x6ea57f,_0xcb9d46){return db['User']['find']({'where':{'id':_0x6ea57f[_0x4055('0x4b')]['id']}})[_0x4055('0x25')](handleEntityNotFound(_0xcb9d46,null))[_0x4055('0x25')](function(_0x3ec1f9){if(_0x3ec1f9){return _0x3ec1f9[_0x4055('0x58')](_0x6ea57f[_0x4055('0x56')][_0x4055('0x59')],_[_0x4055('0x5a')](_0x6ea57f[_0x4055('0x56')],['ids','id'])||{});}})['then'](respondWithResult(_0xcb9d46,null))[_0x4055('0x1a')](handleError(_0xcb9d46,null));};function validateUser(_0x1bfe99){return new BPromise(function(_0x2ae2d6,_0x12c144){if(_0x1bfe99['internal'])return _0x2ae2d6(_0x1bfe99);return db[_0x4055('0x5b')]['findById'](0x1)[_0x4055('0x25')](function(_0x285724){if(_0x285724['securePassword'])authService[_0x4055('0x5c')](_0x1bfe99['password']);db[_0x4055('0x35')][_0x4055('0x5d')]('internal')[_0x4055('0x25')](function(_0x374499){if(_[_0x4055('0x5e')](_0x374499)){_0x1bfe99[_0x4055('0x5f')]=_0x285724['min_internal']||0x1;return;}if(_['isNil'](_0x285724['min_internal'])||_0x285724[_0x4055('0x60')]===_0x374499){_0x1bfe99[_0x4055('0x5f')]=_0x374499+0x1;return;}if(_0x285724['min_internal']>_0x374499){_0x1bfe99[_0x4055('0x5f')]=_0x285724[_0x4055('0x60')];return;}return db['sequelize']['query'](_0x4055('0x61'),{'type':db[_0x4055('0x62')]['QueryTypes']['SELECT']})[_0x4055('0x25')](function(_0x1e0d92){if(_0x1e0d92&&_0x1e0d92[_0x4055('0x43')]){for(var _0x4ae94d=0x0,_0x1fba4e=_0x1e0d92[_0x4055('0x43')];_0x4ae94d<_0x1fba4e&&_[_0x4055('0x5e')](_0x1bfe99[_0x4055('0x5f')]);_0x4ae94d++){if(_0x285724[_0x4055('0x60')]<=_0x1e0d92[_0x4ae94d][_0x4055('0x63')]){_0x1bfe99[_0x4055('0x5f')]=_0x1e0d92[_0x4ae94d][_0x4055('0x63')];}else if(_0x285724['min_internal']>_0x1e0d92[_0x4ae94d][_0x4055('0x63')]&&_0x285724[_0x4055('0x60')]<=_0x1e0d92[_0x4ae94d]['to']){_0x1bfe99[_0x4055('0x5f')]=_0x285724[_0x4055('0x60')];}}}if(_[_0x4055('0x5e')](_0x1bfe99['internal'])){_0x1bfe99[_0x4055('0x5f')]=_0x374499+0x1;}return _0x2ae2d6(_0x1bfe99);});});})[_0x4055('0x1a')](function(_0x37c6b5){_0x12c144(_0x37c6b5);});});}function updateUser(_0x5a5f30){return new BPromise(function(_0x2faa5c,_0x51ce68){try{if(_0x5a5f30[_0x4055('0x64')]){_0x5a5f30[_0x4055('0x65')]=_0x5a5f30[_0x4055('0x5f')];_0x5a5f30[_0x4055('0x66')]={'mailbox':_0x5a5f30[_0x4055('0x5f')],'password':_0x5a5f30[_0x4055('0x3a')],'fullname':_0x5a5f30['fullname'],'email':_0x5a5f30[_0x4055('0x67')]};}if(_0x5a5f30[_0x4055('0x27')]===_0x4055('0x2c')){if(!_0x5a5f30['permissions'])_0x5a5f30[_0x4055('0x68')]=[_0x4055('0x69'),'102',_0x4055('0x6a'),_0x4055('0x6b'),'110',_0x4055('0x6c'),_0x4055('0x6d'),'106','107',_0x4055('0x6e'),_0x4055('0x6f'),_0x4055('0x70'),'111',_0x4055('0x71'),_0x4055('0x72')];}_0x2faa5c(_0x5a5f30);}catch(_0x59a35c){_0x51ce68(_0x59a35c);}});}exports[_0x4055('0x73')]=function(_0x466de8,_0x1545c0){if(_0x466de8[_0x4055('0x2a')]['role']===_0x4055('0x2c'))throw new Error(_0x4055('0x74'));if(_0x466de8[_0x4055('0x56')]['role']===_0x4055('0x2a')&&_0x466de8[_0x4055('0x2a')][_0x4055('0x27')]!==_0x4055('0x28')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20user');}if(_0x466de8[_0x4055('0x56')][_0x4055('0x27')]==='admin'&&_0x466de8[_0x4055('0x2a')][_0x4055('0x27')]!==_0x4055('0x28')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20another\x20administrator');}return licenseUtil['checkUserLimits']([_0x466de8['body']])[_0x4055('0x25')](function(){return validateUser(_0x466de8['body']);})['then'](function(_0xca8cde){return updateUser(_0xca8cde)[_0x4055('0x25')](function(_0x414b87){if(_0x414b87[_0x4055('0x27')]===_0x4055('0x28')){_0x414b87[_0x4055('0x75')]=_0x466de8[_0x4055('0x2a')][_0x4055('0x75')];delete _0x414b87['userProfileId'];}return _0x414b87;});})[_0x4055('0x25')](function(_0x1d23ec){return db['User'][_0x4055('0x73')](_0x1d23ec,{'include':[{'model':db[_0x4055('0x66')],'as':_0x4055('0x66')}]});})[_0x4055('0x25')](function(_0x339907){if(_0x466de8[_0x4055('0x56')][_0x4055('0x27')]===_0x4055('0x2a'))return _0x339907;if(_0x466de8[_0x4055('0x2a')][_0x4055('0x27')]!==_0x4055('0x2a'))return _0x339907;return db[_0x4055('0x76')][_0x4055('0x31')]({'where':{'name':_0x339907[_0x4055('0x27')]===_0x4055('0x2c')?_0x4055('0x2b'):_0x4055('0x77'),'userProfileId':_0x466de8[_0x4055('0x2a')][_0x4055('0x78')]},'raw':!![]})[_0x4055('0x25')](function(_0x60db2f){if(!_0x60db2f||_0x60db2f[_0x4055('0x79')]!=0x0)return _0x339907;return db[_0x4055('0x7a')][_0x4055('0x73')]({'name':_0x339907[_0x4055('0x33')],'resourceId':_0x339907['id'],'type':_0x60db2f[_0x4055('0x33')],'sectionId':_0x60db2f['id']},{})[_0x4055('0x25')](function(){return _0x339907;});})['catch'](function(_0x50e899){logger[_0x4055('0x16')](_0x4055('0x7b'),_0x50e899);throw _0x50e899;});})['then'](respondWithResult(_0x1545c0,0xc9))[_0x4055('0x1a')](handleError(_0x1545c0,null));};exports['bulkCreate']=function(_0xc99305,_0x494f55){var _0x5f04bf=_0xc99305[_0x4055('0x56')];var _0x1ae328=[];if(_0xc99305[_0x4055('0x2a')][_0x4055('0x27')]===_0x4055('0x2c'))throw new Error('Unauthorized');if(_[_0x4055('0x7c')](_0x5f04bf,['role','user'])&&_0xc99305['user'][_0x4055('0x27')]!==_0x4055('0x28')){throw new Error(_0x4055('0x7d'));}if(_['some'](_0x5f04bf,[_0x4055('0x27'),_0x4055('0x28')])&&_0xc99305[_0x4055('0x2a')][_0x4055('0x27')]!==_0x4055('0x28')){throw new Error('Unauthorized.\x20You\x20must\x20be\x20an\x20administrator\x20in\x20order\x20to\x20create\x20an\x20administrator');}return licenseUtil[_0x4055('0x7e')](_0x5f04bf)[_0x4055('0x25')](function(){return validateUser(_0x5f04bf[0x0]);})['then'](function(){for(var _0x3f6f12=0x1;_0x3f6f12<_0x5f04bf[_0x4055('0x43')];_0x3f6f12++){var _0xcfd31b=_0x5f04bf[_0x3f6f12-0x1][_0x4055('0x5f')];if(!_0x5f04bf[_0x3f6f12][_0x4055('0x5f')])_0x5f04bf[_0x3f6f12][_0x4055('0x5f')]=_0xcfd31b+0x1;_0x1ae328[_0x4055('0x44')](validateUser(_0x5f04bf[_0x3f6f12]));}return BPromise[_0x4055('0x4a')](_0x1ae328);})[_0x4055('0x25')](function(){_0x1ae328=[];for(var _0x2e14a8=0x0;_0x2e14a8<_0x5f04bf[_0x4055('0x43')];_0x2e14a8++){_0x1ae328[_0x4055('0x44')](updateUser(_0x5f04bf[_0x2e14a8]));}return BPromise['all'](_0x1ae328);})[_0x4055('0x25')](function(){return BPromise[_0x4055('0x7f')](_0x5f04bf,function(_0x935617){return db[_0x4055('0x35')]['create'](_0x935617,{'include':[{'model':db['VoiceMail'],'as':_0x4055('0x66')}]})['then'](function(_0x565928){_0x935617['id']=_0x565928['id'];return _0x935617;});});})[_0x4055('0x25')](function(_0xcbbdf){if(_0xc99305[_0x4055('0x56')][_0x4055('0x27')]===_0x4055('0x2a'))return _0xcbbdf;if(_0xc99305['user'][_0x4055('0x27')]!=='user')return _0xcbbdf;var _0x58083c=_[_0x4055('0x7c')](_0xcbbdf,function(_0x165d71){return _0x165d71[_0x4055('0x27')]===_0x4055('0x2c')||_0x165d71[_0x4055('0x27')]===_0x4055('0x2d');});if(!_0x58083c)return _0xcbbdf;return db[_0x4055('0x76')][_0x4055('0x80')]({'where':{'name':{'$or':[_0x4055('0x2b'),_0x4055('0x77')]},'userProfileId':_0xc99305[_0x4055('0x2a')][_0x4055('0x78')]},'raw':!![]})[_0x4055('0x25')](function(_0x1c5938){if(_[_0x4055('0x81')](_0x1c5938)||!_[_0x4055('0x7c')](_0x1c5938,[_0x4055('0x79'),0x0]))return _0xcbbdf;_0x1ae328=[];var _0x103d03=_(_0x1c5938)[_0x4055('0x2e')](function(_0xb4043f){if(_0xb4043f[_0x4055('0x79')]===0x1)return;return _0xb4043f['name']===_0x4055('0x2b')?'agent':_0x4055('0x2d');})[_0x4055('0x82')]()[_0x4055('0x2f')]();for(var _0xa54396=0x0;_0xa54396<_0xcbbdf['length'];_0xa54396++){if(!_[_0x4055('0x30')](_0x103d03,_0xcbbdf[_0xa54396][_0x4055('0x27')]))return;var _0x55209c=_0xcbbdf[_0xa54396][_0x4055('0x27')]===_0x4055('0x2c')?'Agents':_0x4055('0x77');_0x1ae328[_0x4055('0x44')](db[_0x4055('0x7a')][_0x4055('0x73')]({'name':_0xcbbdf[_0xa54396][_0x4055('0x33')],'resourceId':_0xcbbdf[_0xa54396]['id'],'type':_0x55209c,'sectionId':_[_0x4055('0x31')](_0x1c5938,[_0x4055('0x33'),_0x55209c])['id']},{}));}return BPromise[_0x4055('0x4a')](_0x1ae328);});})[_0x4055('0x25')](respondWithResult(_0x494f55,0xc9))[_0x4055('0x1a')](handleError(_0x494f55,null));};exports['changePassword']=function(_0x936c3a,_0x5360f5){if(_0x936c3a['body']['id']){delete _0x936c3a[_0x4055('0x56')]['id'];}return db[_0x4055('0x35')][_0x4055('0x31')]({'where':{'id':_0x936c3a['params']['id']}})['then'](function(_0x13fecb){if(!_0x13fecb)return null;if(_0x13fecb['id']===_0x936c3a[_0x4055('0x2a')]['id']){if(!_0x936c3a[_0x4055('0x56')][_0x4055('0x83')]||!_0x936c3a[_0x4055('0x56')]['newPassword']){throw new db[(_0x4055('0x84'))][(_0x4055('0x85'))](_0x4055('0x86'));}if(!_0x13fecb[_0x4055('0x87')](_0x936c3a[_0x4055('0x56')][_0x4055('0x83')])){throw new db[(_0x4055('0x84'))][(_0x4055('0x85'))]('Wrong\x20credentials');}if(_0x936c3a[_0x4055('0x56')][_0x4055('0x83')]===_0x936c3a[_0x4055('0x56')][_0x4055('0x88')]){throw new db['Sequelize']['ValidationError'](_0x4055('0x89'));}}else if(_0x936c3a[_0x4055('0x2a')]['role']===_0x4055('0x28')){if(!_0x936c3a[_0x4055('0x56')][_0x4055('0x88')]){throw new db[(_0x4055('0x84'))][(_0x4055('0x85'))](_0x4055('0x8a'));}}else if(_0x936c3a['user'][_0x4055('0x27')]===_0x4055('0x2a')){if(!_0x936c3a[_0x4055('0x56')]['newPassword']){throw new db[(_0x4055('0x84'))][(_0x4055('0x85'))](_0x4055('0x8a'));}if(_0x13fecb['role']!=='agent'){throw new db[(_0x4055('0x84'))][(_0x4055('0x85'))]('Unauthorized');}}else{throw new db[(_0x4055('0x84'))][(_0x4055('0x85'))]('Unauthorized');}return _0x13fecb;})[_0x4055('0x25')](handleEntityNotFound(_0x5360f5,null))[_0x4055('0x25')](function(_0x373ebc){return db[_0x4055('0x5b')][_0x4055('0x8b')]({'attributes':['id','securePassword',_0x4055('0x8c'),_0x4055('0x8d')]})['then'](function(_0x1f680f){if(_0x1f680f[_0x4055('0x8e')])authService['validatePasswordPattern'](_0x936c3a[_0x4055('0x56')][_0x4055('0x88')]);if(!_0x1f680f['enforcePasswordHistory']||!_0x373ebc[_0x4055('0x8f')])return _0x373ebc;authService[_0x4055('0x90')](_0x936c3a['body']['newPassword'],_0x373ebc['previousPasswords'],_0x1f680f[_0x4055('0x8d')]);return _0x373ebc;})[_0x4055('0x25')](saveUpdates({'password':_0x936c3a[_0x4055('0x56')][_0x4055('0x88')],'passwordResetAt':_0x936c3a[_0x4055('0x2a')]['id']==_0x936c3a[_0x4055('0x4b')]['id']?moment():null,'previousPasswords':authService[_0x4055('0x91')](_0x936c3a['body']['newPassword'],_0x373ebc['previousPasswords'])},null));})[_0x4055('0x25')](respondWithResult(_0x5360f5,null))[_0x4055('0x1a')](handleError(_0x5360f5,null));};exports[_0x4055('0x92')]=function(_0x438aa5,_0x2463fa){var _0x292fbc=_0x438aa5['body']['channel'];return db[_0x4055('0x35')][_0x4055('0x31')]({'where':{'id':_0x438aa5[_0x4055('0x4b')]['id']},'attributes':['id',_0x4055('0x33'),_0x4055('0x27'),_0x4055('0x93'),'loginInPause',_0x4055('0x94'),_0x4055('0x95')]})[_0x4055('0x25')](handleEntityNotFound(_0x2463fa,null))[_0x4055('0x25')](function(_0x4370c1){if(_0x4370c1){if(!utils['isValidChannel'](_0x292fbc)){throw new db['Sequelize'][(_0x4055('0x85'))](_0x4055('0x96'));}return _0x4370c1[_0x4055('0x97')+_['capitalize'](_0x292fbc[_0x4055('0x98')]())+_0x4055('0x99')](_0x438aa5['body'][_0x4055('0x59')],{'penalty':_0x438aa5[_0x4055('0x56')][_0x4055('0x9a')]||0x0})[_0x4055('0x9b')](function(_0xe137fe){for(var _0x23bd8c=0x0;_0x23bd8c<_0x438aa5[_0x4055('0x56')][_0x4055('0x59')][_0x4055('0x43')];_0x23bd8c+=0x1){var _0x505131={'UserId':Number(_0x438aa5[_0x4055('0x4b')]['id'])};_0x505131[_[_0x4055('0x9c')](_0x292fbc['toLowerCase']())+'QueueId']=Number(_0x438aa5[_0x4055('0x56')][_0x4055('0x59')][_0x23bd8c]);socket[_0x4055('0x9d')](_0x4055('0x2a')+_['capitalize'](_0x292fbc['toLowerCase']())+'Queue:save',_0x505131);}return _0xe137fe;})['then'](function(){if(_0x292fbc===_0x4055('0x9e')){return db[_0x4055('0x9f')][_0x4055('0x80')]({'where':{'id':_0x438aa5['body'][_0x4055('0x59')]||[]},'raw':!![],'attributes':['id','name']});}})[_0x4055('0x25')](function(_0x409910){var _0x153d75=_0x4370c1['get']({'plain':!![]});var _0x3703d1=[];if(_0x292fbc===_0x4055('0x9e')&&_0x153d75[_0x4055('0x27')]===_0x4055('0x2c')&&_0x153d75[_0x4055('0x93')]){for(var _0x1d3feb=0x0;_0x1d3feb<_0x409910[_0x4055('0x43')];_0x1d3feb+=0x1){_0x3703d1[_0x4055('0x44')]({'membername':_0x153d75['name'],'UserId':_0x153d75['id'],'queue_name':_0x409910[_0x1d3feb]['name'],'VoiceQueueId':_0x409910[_0x1d3feb]['id'],'interface':_[_0x4055('0x5e')](_0x153d75['interface'])?util[_0x4055('0xa0')](_0x4055('0xa1'),_0x153d75[_0x4055('0x33')]):_0x153d75[_0x4055('0x95')],'paused':_0x153d75[_0x4055('0x94')]||![],'penalty':_0x438aa5[_0x4055('0x56')][_0x4055('0x9a')]||0x0});}return BPromise['each'](_0x3703d1,function(_0x4e226d){return db[_0x4055('0xa2')][_0x4055('0xa3')](_0x4e226d);});}return _0x4370c1;});}})[_0x4055('0x25')](respondWithStatusCode(_0x2463fa,null))['catch'](handleError(_0x2463fa,null));};exports[_0x4055('0xa4')]=function(_0xaca91a,_0x479bcd){var _0x362875;return db[_0x4055('0x35')]['find']({'where':{'id':_0xaca91a[_0x4055('0x4b')]['id']},'attributes':['id',_0x4055('0x33'),'role']})[_0x4055('0x25')](handleEntityNotFound(_0x479bcd,null))[_0x4055('0x25')](function(_0x2f7d28){if(_0x2f7d28){_0x362875=_0x2f7d28;if(!_0xaca91a[_0x4055('0x3d')][_0x4055('0xa5')]||!utils[_0x4055('0xa6')](_0xaca91a[_0x4055('0x3d')][_0x4055('0xa5')])){throw new db['Sequelize'][(_0x4055('0x85'))](_0x4055('0x96'));}return _0x2f7d28['remove'+_[_0x4055('0x9c')](_0xaca91a[_0x4055('0x3d')]['channel'][_0x4055('0x98')]())+_0x4055('0x99')](_0xaca91a[_0x4055('0x3d')]['ids']);}})['then'](function(_0x6aeff3){if(_[_0x4055('0xa7')](_0xaca91a[_0x4055('0x3d')][_0x4055('0x59')])){for(var _0x183257=0x0;_0x183257<_0xaca91a[_0x4055('0x3d')][_0x4055('0x59')][_0x4055('0x43')];_0x183257+=0x1){var _0x22a6b7={'UserId':Number(_0xaca91a['params']['id'])};_0x22a6b7[_['capitalize'](_0xaca91a[_0x4055('0x3d')]['channel'][_0x4055('0x98')]())+'QueueId']=Number(_0xaca91a['query'][_0x4055('0x59')][_0x183257]);socket[_0x4055('0x9d')](_0x4055('0x2a')+_[_0x4055('0x9c')](_0xaca91a[_0x4055('0x3d')]['channel'][_0x4055('0x98')]())+_0x4055('0xa8'),_0x22a6b7);}}else{var _0x22a6b7={'UserId':Number(_0xaca91a['params']['id'])};_0x22a6b7[_[_0x4055('0x9c')](_0xaca91a['query'][_0x4055('0xa5')][_0x4055('0x98')]())+'QueueId']=Number(_0xaca91a['query']['ids']);socket[_0x4055('0x9d')](_0x4055('0x2a')+_[_0x4055('0x9c')](_0xaca91a['query']['channel'][_0x4055('0x98')]())+_0x4055('0xa8'),_0x22a6b7);}return _0x6aeff3;})[_0x4055('0x25')](function(){if(_0xaca91a['query'][_0x4055('0xa5')]==='voice'){return db['UserVoiceQueueRt'][_0x4055('0x32')]({'where':{'UserId':_0xaca91a[_0x4055('0x4b')]['id'],'VoiceQueueId':_0xaca91a[_0x4055('0x3d')][_0x4055('0x59')]},'individualHooks':!![]})['then'](function(){return _0x362875;});}return _0x362875;})[_0x4055('0x25')](respondWithStatusCode(_0x479bcd,null))['catch'](handleError(_0x479bcd,null));};exports[_0x4055('0xa9')]=function(_0x1f9817,_0x2d9ae9){_0x1f9817[_0x4055('0x56')][_0x4055('0xaa')]=_0x1f9817[_0x4055('0xab')][_0x4055('0xac')];return db[_0x4055('0x35')][_0x4055('0x31')]({'where':{'id':_0x1f9817['params']['id']}})['then'](handleEntityNotFound(_0x2d9ae9,null))[_0x4055('0x25')](saveUpdates(_0x1f9817[_0x4055('0x56')],null))[_0x4055('0x25')](respondWithResult(_0x2d9ae9,null))['catch'](handleError(_0x2d9ae9,null));};exports[_0x4055('0xad')]=function(_0x29bb75,_0x1db55e){var _0x4db5bb=path[_0x4055('0xae')](config[_0x4055('0xaf')],_0x4055('0xb0'));return db[_0x4055('0x35')]['find']({'where':{'id':_0x29bb75[_0x4055('0x4b')]['id']},'attributes':['id',_0x4055('0xaa')],'raw':!![]})[_0x4055('0x25')](handleEntityNotFound(_0x1db55e,null))[_0x4055('0x25')](function(_0x363939){if(_0x363939){if(_[_0x4055('0x5e')](_0x363939[_0x4055('0xaa')])){return _0x1db55e[_0x4055('0xb1')](_0x4db5bb);}else{if(!fs[_0x4055('0xb2')](path[_0x4055('0xae')](config[_0x4055('0xaf')],_0x4055('0xb3'),_0x363939[_0x4055('0xaa')]))){return _0x1db55e[_0x4055('0xb1')](_0x4db5bb);}return _0x1db55e[_0x4055('0xb1')](path[_0x4055('0xae')](config[_0x4055('0xaf')],'server/files/images/',_0x363939['userpic']));}}})['catch'](handleError(_0x1db55e,null));};exports[_0x4055('0xb4')]=function(_0x318261,_0x4ddf72){return db['User'][_0x4055('0x31')]({'where':{'id':_0x318261['params']['id']},'attributes':['id']})[_0x4055('0x25')](handleEntityNotFound(_0x4ddf72,null))[_0x4055('0x25')](function(_0x10a902){var _0xa27c69=[];values=_0x10a902[_0x4055('0x49')];_0xa27c69[_0x4055('0x44')](get_open_tabs(_0x4055('0x45'),_0x10a902[_0x4055('0x49')]));_0xa27c69[_0x4055('0x44')](get_open_tabs(_0x4055('0x47'),_0x10a902[_0x4055('0x49')]));_0xa27c69[_0x4055('0x44')](get_open_tabs(_0x4055('0x53'),_0x10a902[_0x4055('0x49')]));_0xa27c69[_0x4055('0x44')](get_open_tabs('whatsapp',_0x10a902[_0x4055('0x49')]));_0xa27c69['push'](get_open_tabs('fax',_0x10a902[_0x4055('0x49')]));_0xa27c69['push'](get_open_tabs(_0x4055('0x55'),_0x10a902[_0x4055('0x49')]));return BPromise[_0x4055('0x4a')](_0xa27c69);})[_0x4055('0x25')](function(_0x38cd12){var _0x40d04c=[];if(_0x38cd12){for(var _0x12a241=0x0;_0x12a241=_0x39c03d['agents']){throw new Error(_0x91e0('0x57'));}})['then'](function(){if(_0x101cc9){return db[_0x91e0('0x2c')][_0x91e0('0x58')]({'where':{'membername':_0x101cc9['name']},'individualHooks':!![]});}})[_0x91e0('0x12')](function(){if(_0x101cc9){return _0x101cc9[_0x91e0('0x59')]({'raw':!![]});}})[_0x91e0('0x12')](function(_0x2f3c69){if(_0x101cc9){if(_0x2f3c69){var _0x2227eb=[];_0x317d41=_0x2f3c69;if(_0x317d41[_0x91e0('0x2f')]){for(var _0x348f74=0x0;_0x348f74<_0x317d41[_0x91e0('0x2f')];_0x348f74++){_0x2227eb['push'](db[_0x91e0('0x2c')][_0x91e0('0x5a')]({'membername':_0x101cc9[_0x91e0('0x2e')],'UserId':_0x101cc9['id'],'queue_name':_0x317d41[_0x348f74]['name'],'VoiceQueueId':_0x317d41[_0x348f74]['id'],'interface':_0x20299f,'paused':_0x101cc9[_0x91e0('0x51')]||![],'penalty':_0x317d41[_0x348f74][_0x91e0('0x5b')]||0x0}));}return BPromise[_0x91e0('0x4d')](_0x2227eb);}}}})[_0x91e0('0x12')](function(){if(_0x101cc9){return db[_0x91e0('0x2d')]['findAll']({'where':{'membername':_0x101cc9[_0x91e0('0x2e')],'exitAt':null}});}})[_0x91e0('0x12')](function(_0x47c717){if(_0x101cc9){if(_0x47c717&&_0x47c717['length']){var _0x15ee1c=[];_0x47c717[_0x91e0('0x34')](function(_0x55e407){_0x15ee1c[_0x91e0('0x35')](_0x55e407[_0x91e0('0x3f')]({'exitAt':moment()[_0x91e0('0x30')](_0x91e0('0x31'))}));});return BPromise[_0x91e0('0x4d')](_0x15ee1c);}}})[_0x91e0('0x12')](function(_0x49346e){if(_0x101cc9){var _0x1674f1=[];var _0x16868a=[];var _0x2d77ad=utils[_0x91e0('0x33')]();var _0x34c79f={'membername':_0x101cc9[_0x91e0('0x2e')],'interface':_0x20299f,'enterAt':moment()[_0x91e0('0x30')](_0x91e0('0x31')),'role':_0x101cc9[_0x91e0('0x3c')],'internal':_0x101cc9['internal']};_0x2d77ad['forEach'](function(_0x407453){_0x1674f1[_0x91e0('0x35')](_[_0x91e0('0x5c')]({'channel':_0x407453,'type':_0x91e0('0x5d'),'data1':_0x91e0('0x5e'),'data2':_0x20299f},_0x34c79f));if(_0x101cc9['loginInPause']){_0x16868a[_0x91e0('0x35')](_[_0x91e0('0x5c')]({'channel':_0x407453,'type':_0x91e0('0x38'),'data1':_0x91e0('0x5f')},_0x34c79f));}});return db[_0x91e0('0x2d')][_0x91e0('0x3e')](_0x1674f1['concat'](_0x16868a),{'individualHooks':!![]});}})[_0x91e0('0x12')](function(){if(_0x101cc9){return _0x101cc9[_0x91e0('0x3f')]({'online':!![],'lastLoginAt':moment()[_0x91e0('0x30')](_0x91e0('0x31')),'voicePause':_0x101cc9[_0x91e0('0x51')]||![],'mailPause':_0x101cc9[_0x91e0('0x51')]||![],'chatPause':_0x101cc9[_0x91e0('0x51')]||![],'faxPause':_0x101cc9[_0x91e0('0x51')]||![],'smsPause':_0x101cc9['loginInPause']||![],'openchannelPause':_0x101cc9[_0x91e0('0x51')]||![],'pauseType':_0x101cc9['loginInPause']?_0x91e0('0x5f'):null,'lastPauseAt':moment()[_0x91e0('0x30')](_0x91e0('0x31')),'interface':_0x20299f});}})[_0x91e0('0x12')](function(_0x2431af){_0x844fc(_0x2431af);})[_0x91e0('0x1b')](function(_0x575d9b){_0x5e2093(_0x1842f1[_0x91e0('0x18')](0x1f4,_0x575d9b[_0x91e0('0x1a')]));});});}; \ No newline at end of file +var _0x4949=['debug','User,\x20%s,\x20%s,\x20%s','error','code','User,\x20%s,\x20%s','message','result','GetUser','User','findAll','options','where','attributes','limit','include','map','model','catch','raw','ShowUser','stringify','PauseUser','find','name','role','internal','UserVoiceQueueRt','update','MemberReport','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','forEach','isNil','interface','PAUSE','type','DEFAULT\x20PAUSE','body','bulkCreate','findOne','channel','isValidChannel','Unknown\x20channel','chat','fax','openchannel','whatsapp','system','%s%s','Pause','push','all','LogoutUser','LoginUser','count','agent','../../config/license/util','getLicense','agents','destroy','getChannels','merge','LOGIN','callysquare','loginInPause','LOGININPAUSE','concat','lodash','util','moment','bluebird','ioredis','rpc','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','request\x20sent'];(function(_0x32e797,_0x599d27){var _0x3df080=function(_0x1761f6){while(--_0x1761f6){_0x32e797['push'](_0x32e797['shift']());}};_0x3df080(++_0x599d27);}(_0x4949,0x147));var _0x9494=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x4949[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x9494('0x0'));var util=require(_0x9494('0x1'));var moment=require(_0x9494('0x2'));var BPromise=require(_0x9494('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9494('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x9494('0x5'));var config=require(_0x9494('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x9494('0x7')]({'port':0x232a});config[_0x9494('0x8')]=_[_0x9494('0x9')](config[_0x9494('0x8')],{'host':_0x9494('0xa'),'port':0x18eb});var socket=require(_0x9494('0xb'))(new Redis(config[_0x9494('0x8')]));require('./user.socket')[_0x9494('0xc')](socket);function respondWithRpcPromise(_0x3da94d,_0xa8e3b2,_0x34f5eb){return new BPromise(function(_0x21f197,_0x52f5bf){return client[_0x9494('0xd')](_0x3da94d,_0x34f5eb)[_0x9494('0xe')](function(_0x135561){logger[_0x9494('0xf')]('User,\x20%s,\x20%s',_0xa8e3b2,_0x9494('0x10'));logger[_0x9494('0x11')](_0x9494('0x12'),_0xa8e3b2,_0x9494('0x10'),JSON['stringify'](_0x135561));if(_0x135561[_0x9494('0x13')]){if(_0x135561[_0x9494('0x13')][_0x9494('0x14')]===0x1f4){logger['error'](_0x9494('0x15'),_0xa8e3b2,_0x135561['error'][_0x9494('0x16')]);return _0x52f5bf(_0x135561[_0x9494('0x13')][_0x9494('0x16')]);}logger['error']('User,\x20%s,\x20%s',_0xa8e3b2,_0x135561[_0x9494('0x13')][_0x9494('0x16')]);return _0x21f197(_0x135561[_0x9494('0x13')][_0x9494('0x16')]);}else{logger[_0x9494('0xf')](_0x9494('0x15'),_0xa8e3b2,_0x9494('0x10'));_0x21f197(_0x135561[_0x9494('0x17')][_0x9494('0x16')]);}})['catch'](function(_0x3dbe0e){logger[_0x9494('0x13')](_0x9494('0x15'),_0xa8e3b2,_0x3dbe0e);_0x52f5bf(_0x3dbe0e);});});}exports[_0x9494('0x18')]=function(_0x268fb2){var _0x1a08f9=this;return new Promise(function(_0x48c929,_0x558a5a){return db[_0x9494('0x19')][_0x9494('0x1a')]({'raw':_0x268fb2[_0x9494('0x1b')]?_0x268fb2[_0x9494('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x268fb2[_0x9494('0x1b')]?_0x268fb2[_0x9494('0x1b')][_0x9494('0x1c')]||null:null,'attributes':_0x268fb2[_0x9494('0x1b')]?_0x268fb2[_0x9494('0x1b')][_0x9494('0x1d')]||null:null,'limit':_0x268fb2['options']?_0x268fb2[_0x9494('0x1b')][_0x9494('0x1e')]||null:null,'include':_0x268fb2['options']?_0x268fb2['options'][_0x9494('0x1f')]?_[_0x9494('0x20')](_0x268fb2[_0x9494('0x1b')]['include'],function(_0x30e939){return{'model':db[_0x30e939['model']],'as':_0x30e939['as'],'attributes':_0x30e939[_0x9494('0x1d')],'include':_0x30e939[_0x9494('0x1f')]?_[_0x9494('0x20')](_0x30e939[_0x9494('0x1f')],function(_0x3383d4){return{'model':db[_0x3383d4[_0x9494('0x21')]],'as':_0x3383d4['as'],'attributes':_0x3383d4[_0x9494('0x1d')],'include':_0x3383d4[_0x9494('0x1f')]?_[_0x9494('0x20')](_0x3383d4[_0x9494('0x1f')],function(_0x34d314){return{'model':db[_0x34d314[_0x9494('0x21')]],'as':_0x34d314['as'],'attributes':_0x34d314[_0x9494('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x9494('0xe')](function(_0x45189b){logger[_0x9494('0xf')](_0x9494('0x18'),_0x268fb2);logger['debug'](_0x9494('0x18'),_0x268fb2,JSON['stringify'](_0x45189b));_0x48c929(_0x45189b);})[_0x9494('0x22')](function(_0x146b54){logger[_0x9494('0x13')](_0x9494('0x18'),_0x146b54['message'],_0x268fb2);_0x558a5a(_0x1a08f9['error'](0x1f4,_0x146b54[_0x9494('0x16')]));});});};exports['ShowUser']=function(_0x28c91c){var _0x2aa5e8=this;return new Promise(function(_0x91f5dc,_0x415b92){return db[_0x9494('0x19')]['find']({'raw':_0x28c91c[_0x9494('0x1b')]?_0x28c91c[_0x9494('0x1b')][_0x9494('0x23')]===undefined?!![]:![]:!![],'where':_0x28c91c[_0x9494('0x1b')]?_0x28c91c[_0x9494('0x1b')][_0x9494('0x1c')]||null:null,'attributes':_0x28c91c['options']?_0x28c91c[_0x9494('0x1b')]['attributes']||null:null,'include':_0x28c91c['options']?_0x28c91c['options'][_0x9494('0x1f')]?_[_0x9494('0x20')](_0x28c91c[_0x9494('0x1b')][_0x9494('0x1f')],function(_0x27f400){return{'model':db[_0x27f400[_0x9494('0x21')]],'as':_0x27f400['as'],'attributes':_0x27f400['attributes'],'include':_0x27f400[_0x9494('0x1f')]?_[_0x9494('0x20')](_0x27f400[_0x9494('0x1f')],function(_0x284d89){return{'model':db[_0x284d89[_0x9494('0x21')]],'as':_0x284d89['as'],'attributes':_0x284d89[_0x9494('0x1d')],'include':_0x284d89[_0x9494('0x1f')]?_[_0x9494('0x20')](_0x284d89['include'],function(_0xd7d5b0){return{'model':db[_0xd7d5b0[_0x9494('0x21')]],'as':_0xd7d5b0['as'],'attributes':_0xd7d5b0[_0x9494('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x9494('0xe')](function(_0x4099f1){logger[_0x9494('0xf')](_0x9494('0x24'),_0x28c91c);logger[_0x9494('0x11')](_0x9494('0x24'),_0x28c91c,JSON[_0x9494('0x25')](_0x4099f1));_0x91f5dc(_0x4099f1);})[_0x9494('0x22')](function(_0x59c356){logger[_0x9494('0x13')]('ShowUser',_0x59c356[_0x9494('0x16')],_0x28c91c);_0x415b92(_0x2aa5e8['error'](0x1f4,_0x59c356[_0x9494('0x16')]));});});};exports[_0x9494('0x26')]=function(_0x5d047e){var _0x397e25=this;return new Promise(function(_0x170d07,_0x61a802){var _0x219dd8;return db[_0x9494('0x19')][_0x9494('0x27')]({'where':_0x5d047e['options'][_0x9494('0x1c')]||{},'attributes':['id',_0x9494('0x28'),_0x9494('0x29'),_0x9494('0x2a'),'interface']})[_0x9494('0xe')](function(_0x1a5b0c){if(_0x1a5b0c){_0x219dd8=_0x1a5b0c;return db[_0x9494('0x2b')][_0x9494('0x2c')]({'paused':0x1},{'where':{'UserId':_0x219dd8['id']},'individualHooks':!![]});}})[_0x9494('0xe')](function(){if(_0x219dd8){return db[_0x9494('0x2d')][_0x9494('0x1a')]({'where':{'membername':_0x219dd8[_0x9494('0x28')],'type':'PAUSE','exitAt':null}});}})[_0x9494('0xe')](function(_0x1876ed){if(_0x219dd8){if(_0x1876ed&&_0x1876ed[_0x9494('0x2e')]){var _0x20200b=moment()[_0x9494('0x2f')](_0x9494('0x30'));for(var _0x25fdfe=0x0,_0x137bcf=_0x1876ed[_0x9494('0x2e')];_0x25fdfe<_0x137bcf;_0x25fdfe++){_0x1876ed[_0x25fdfe][_0x9494('0x31')]({'exitAt':_0x20200b});}}}})[_0x9494('0xe')](function(){if(_0x219dd8){var _0x2cb2e5=[];var _0x25241e=utils['getChannels']();_0x25241e[_0x9494('0x32')](function(_0x15426e){_0x2cb2e5['push']({'channel':_0x15426e,'membername':_0x219dd8[_0x9494('0x28')],'interface':_[_0x9494('0x33')](_0x219dd8[_0x9494('0x34')])?util[_0x9494('0x2f')]('SIP/%s',_0x219dd8[_0x9494('0x28')]):_0x219dd8[_0x9494('0x34')],'type':_0x9494('0x35'),'enterAt':moment()[_0x9494('0x2f')](_0x9494('0x30')),'data1':_0x5d047e['body'][_0x9494('0x36')]||_0x9494('0x37'),'role':_0x219dd8[_0x9494('0x29')],'internal':_0x219dd8[_0x9494('0x2a')],'uniqueid':_0x5d047e[_0x9494('0x38')]['uniqueid']||null});});return db[_0x9494('0x2d')][_0x9494('0x39')](_0x2cb2e5,{'individualHooks':!![]});}})[_0x9494('0xe')](function(){if(_0x219dd8){return _0x219dd8['update']({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'whatsappPause':!![],'pauseType':_0x5d047e['body'][_0x9494('0x36')]||_0x9494('0x37'),'lastPauseAt':moment()[_0x9494('0x2f')]('YYYY-MM-DD\x20HH:mm:ss')});}})[_0x9494('0xe')](function(_0x4356c7){_0x170d07(_0x4356c7);})[_0x9494('0x22')](function(_0x47f8c3){_0x61a802(_0x397e25[_0x9494('0x13')](0x1f4,_0x47f8c3[_0x9494('0x16')]));});});};exports['UnpauseUser']=function(_0x4faf1f){var _0x45daf5=this;return new Promise(function(_0x575d3f,_0x19daeb){var _0xaf7e1f;return db[_0x9494('0x19')][_0x9494('0x3a')]({'where':_0x4faf1f[_0x9494('0x1b')][_0x9494('0x1c')]||{},'attributes':['id','name']})[_0x9494('0xe')](function(_0x493402){if(_0x493402){_0xaf7e1f=_0x493402;if(_0x4faf1f['body'][_0x9494('0x3b')]&&!utils[_0x9494('0x3c')](_0x4faf1f['body'][_0x9494('0x3b')])){throw new Error(_0x9494('0x3d'));}switch(_0x4faf1f[_0x9494('0x38')]['channel']){case'voice':return db[_0x9494('0x2b')][_0x9494('0x2c')]({'paused':0x0},{'where':{'UserId':_0xaf7e1f['id']}})[_0x9494('0xe')](function(){return db[_0x9494('0x2d')][_0x9494('0x27')]({'where':{'channel':_0x4faf1f[_0x9494('0x38')][_0x9494('0x3b')],'membername':_0xaf7e1f[_0x9494('0x28')],'type':'PAUSE','exitAt':null}});})[_0x9494('0xe')](function(_0x44b03c){if(_0x44b03c){return _0x44b03c[_0x9494('0x2c')]({'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'data2':'system'},{'individualHooks':!![]});}return null;})[_0x9494('0xe')](function(){return _0xaf7e1f['update']({'voicePause':![]});});case'mail':case _0x9494('0x3e'):case _0x9494('0x3f'):case'sms':case _0x9494('0x40'):case _0x9494('0x41'):return db['MemberReport'][_0x9494('0x27')]({'where':{'channel':_0x4faf1f['body']['channel'],'membername':_0xaf7e1f['name'],'type':'PAUSE','exitAt':null}})['then'](function(_0xf738){return _0xf738[_0x9494('0x2c')]({'exitAt':moment()[_0x9494('0x2f')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0x9494('0x42')},{'individualHooks':!![]});})[_0x9494('0xe')](function(){var _0x5bc845={};_['set'](_0x5bc845,util[_0x9494('0x2f')](_0x9494('0x43'),_0x4faf1f[_0x9494('0x38')][_0x9494('0x3b')],_0x9494('0x44')),![]);return _0xaf7e1f[_0x9494('0x2c')](_0x5bc845);});default:return db[_0x9494('0x2b')][_0x9494('0x2c')]({'paused':0x0},{'where':{'UserId':_0xaf7e1f['id']}})[_0x9494('0xe')](function(){return db[_0x9494('0x2d')][_0x9494('0x1a')]({'where':{'membername':_0xaf7e1f['name'],'type':'PAUSE','exitAt':null}});})[_0x9494('0xe')](function(_0x4d2b29){var _0x5e389f=[];_0x4d2b29[_0x9494('0x32')](function(_0x3e6a4c){_0x5e389f[_0x9494('0x45')](_0x3e6a4c['update']({'exitAt':moment()[_0x9494('0x2f')](_0x9494('0x30')),'data2':'system'}));});return BPromise[_0x9494('0x46')](_0x5e389f);})['then'](function(){return _0xaf7e1f[_0x9494('0x2c')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'whatsappPause':![]});});}}})['then'](function(_0x33177c){_0x575d3f(_0x33177c);})[_0x9494('0x22')](function(_0x5e50c6){_0x19daeb(_0x45daf5[_0x9494('0x13')](0x1f4,_0x5e50c6[_0x9494('0x16')]));});});};exports[_0x9494('0x47')]=function(_0x450c96){var _0x41c7c7=this;return new Promise(function(_0x1a35bb,_0x1e9eb9){var _0x1bbc11;return db[_0x9494('0x19')]['findOne']({'where':_0x450c96[_0x9494('0x1b')][_0x9494('0x1c')]||{},'attributes':['id','name']})[_0x9494('0xe')](function(_0x5176d9){if(_0x5176d9){_0x1bbc11=_0x5176d9;return db[_0x9494('0x2b')]['destroy']({'where':{'membername':_0x1bbc11[_0x9494('0x28')]},'individualHooks':!![]});}})[_0x9494('0xe')](function(){if(_0x1bbc11){return db['MemberReport'][_0x9494('0x1a')]({'where':{'membername':_0x1bbc11[_0x9494('0x28')],'exitAt':null}});}})[_0x9494('0xe')](function(_0x6d83af){if(_0x1bbc11){if(_0x6d83af&&_0x6d83af[_0x9494('0x2e')]){var _0xb5ddf3=[];_0x6d83af[_0x9494('0x32')](function(_0x237db5){_0xb5ddf3[_0x9494('0x45')](_0x237db5[_0x9494('0x2c')]({'exitAt':moment()[_0x9494('0x2f')](_0x9494('0x30'))}));});return BPromise[_0x9494('0x46')](_0xb5ddf3);}}})[_0x9494('0xe')](function(){if(_0x1bbc11){return _0x1bbc11[_0x9494('0x2c')]({'online':![],'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0x9494('0xe')](function(_0x492394){_0x1a35bb(_0x492394);})[_0x9494('0x22')](function(_0xb3e3c1){_0x1e9eb9(_0x41c7c7[_0x9494('0x13')](0x1f4,_0xb3e3c1['message']));});});};exports[_0x9494('0x48')]=function(_0x548cc0){var _0x944f49=this;return new Promise(function(_0x10cbee,_0x4e8fa3){var _0x4e6344;var _0x1aaa21;var _0x4b9cc0;var _0x37f6cb;return db[_0x9494('0x19')]['findOne']({'where':_0x548cc0['options'][_0x9494('0x1c')]||{},'attributes':['id',_0x9494('0x28'),'role','mobile','phone','internal','loginInPause',_0x9494('0x34')]})['then'](function(_0x3e4ffe){if(_0x3e4ffe){_0x4e6344=_0x3e4ffe;_0x37f6cb=_0x548cc0[_0x9494('0x38')][_0x9494('0x34')]?_0x548cc0[_0x9494('0x38')][_0x9494('0x34')]:util[_0x9494('0x2f')]('SIP/%s',_0x4e6344[_0x9494('0x28')]);return db[_0x9494('0x19')][_0x9494('0x49')]({'where':{'role':_0x9494('0x4a'),'online':!![],'id':{'$ne':_0x4e6344['id']}}});}})['then'](function(_0x3fdeff){if(_0x3fdeff){_0x4b9cc0=_0x3fdeff;return require(_0x9494('0x4b'))[_0x9494('0x4c')]();}})['then'](function(_0x5b608e){if(_0x5b608e&&_0x5b608e[_0x9494('0x4d')]&&_0x4b9cc0>=_0x5b608e[_0x9494('0x4d')]){throw new Error('Maximum\x20login\x20has\x20been\x20reached');}})['then'](function(){if(_0x4e6344){return db['UserVoiceQueueRt'][_0x9494('0x4e')]({'where':{'membername':_0x4e6344[_0x9494('0x28')]},'individualHooks':!![]});}})[_0x9494('0xe')](function(){if(_0x4e6344){return _0x4e6344['getVoiceQueues']({'raw':!![]});}})[_0x9494('0xe')](function(_0x39b261){if(_0x4e6344){if(_0x39b261){var _0x4354ac=[];_0x1aaa21=_0x39b261;if(_0x1aaa21[_0x9494('0x2e')]){for(var _0x15e233=0x0;_0x15e233<_0x1aaa21[_0x9494('0x2e')];_0x15e233++){_0x4354ac[_0x9494('0x45')](db[_0x9494('0x2b')]['upsert']({'membername':_0x4e6344[_0x9494('0x28')],'UserId':_0x4e6344['id'],'queue_name':_0x1aaa21[_0x15e233][_0x9494('0x28')],'VoiceQueueId':_0x1aaa21[_0x15e233]['id'],'interface':_0x37f6cb,'paused':_0x4e6344['loginInPause']||![],'penalty':_0x1aaa21[_0x15e233]['UserVoiceQueue.penalty']||0x0}));}return BPromise[_0x9494('0x46')](_0x4354ac);}}}})[_0x9494('0xe')](function(){if(_0x4e6344){return db[_0x9494('0x2d')][_0x9494('0x1a')]({'where':{'membername':_0x4e6344[_0x9494('0x28')],'exitAt':null}});}})[_0x9494('0xe')](function(_0x4fa799){if(_0x4e6344){if(_0x4fa799&&_0x4fa799[_0x9494('0x2e')]){var _0x5f14e4=[];_0x4fa799['forEach'](function(_0x19d684){_0x5f14e4[_0x9494('0x45')](_0x19d684['update']({'exitAt':moment()[_0x9494('0x2f')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0x9494('0x46')](_0x5f14e4);}}})[_0x9494('0xe')](function(_0x3ba15e){if(_0x4e6344){var _0x5bf122=[];var _0x4c0c78=[];var _0x32db96=utils[_0x9494('0x4f')]();var _0x275c41={'membername':_0x4e6344[_0x9494('0x28')],'interface':_0x37f6cb,'enterAt':moment()[_0x9494('0x2f')](_0x9494('0x30')),'role':_0x4e6344[_0x9494('0x29')],'internal':_0x4e6344[_0x9494('0x2a')]};_0x32db96[_0x9494('0x32')](function(_0x36a008){_0x5bf122['push'](_[_0x9494('0x50')]({'channel':_0x36a008,'type':_0x9494('0x51'),'data1':_0x9494('0x52'),'data2':_0x37f6cb},_0x275c41));if(_0x4e6344[_0x9494('0x53')]){_0x4c0c78[_0x9494('0x45')](_[_0x9494('0x50')]({'channel':_0x36a008,'type':_0x9494('0x35'),'data1':_0x9494('0x54')},_0x275c41));}});return db[_0x9494('0x2d')][_0x9494('0x39')](_0x5bf122[_0x9494('0x55')](_0x4c0c78),{'individualHooks':!![]});}})[_0x9494('0xe')](function(){if(_0x4e6344){return _0x4e6344[_0x9494('0x2c')]({'online':!![],'lastLoginAt':moment()[_0x9494('0x2f')](_0x9494('0x30')),'voicePause':_0x4e6344[_0x9494('0x53')]||![],'mailPause':_0x4e6344['loginInPause']||![],'chatPause':_0x4e6344['loginInPause']||![],'faxPause':_0x4e6344['loginInPause']||![],'smsPause':_0x4e6344['loginInPause']||![],'openchannelPause':_0x4e6344[_0x9494('0x53')]||![],'pauseType':_0x4e6344[_0x9494('0x53')]?'LOGININPAUSE':null,'lastPauseAt':moment()['format'](_0x9494('0x30')),'interface':_0x37f6cb});}})['then'](function(_0x51a483){_0x10cbee(_0x51a483);})[_0x9494('0x22')](function(_0x181f34){_0x4e8fa3(_0x944f49[_0x9494('0x13')](0x1f4,_0x181f34[_0x9494('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index 9911c79..86dad28 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 _0xa2c1=['length','user:','./user.events','remove','update','emit','register'];(function(_0x4792c8,_0x5158a1){var _0x35edb1=function(_0x2472d3){while(--_0x2472d3){_0x4792c8['push'](_0x4792c8['shift']());}};_0x35edb1(++_0x5158a1);}(_0xa2c1,0x1b4));var _0x1a2c=function(_0x4099eb,_0x4e6d67){_0x4099eb=_0x4099eb-0x0;var _0x7637ee=_0xa2c1[_0x4099eb];return _0x7637ee;};'use strict';var UserEvents=require(_0x1a2c('0x0'));var events=['save',_0x1a2c('0x1'),_0x1a2c('0x2')];function createListener(_0xef8053,_0x5d6285){return function(_0x3d9b3a){_0x5d6285[_0x1a2c('0x3')](_0xef8053,_0x3d9b3a);};}function removeListener(_0x449e59,_0xc7d7a1){return function(){UserEvents['removeListener'](_0x449e59,_0xc7d7a1);};}exports[_0x1a2c('0x4')]=function(_0x371227){for(var _0x3d9951=0x0,_0x15cc78=events[_0x1a2c('0x5')];_0x3d9951<_0x15cc78;_0x3d9951++){var _0x1a161e=events[_0x3d9951];var _0x47d57a=createListener(_0x1a2c('0x6')+_0x1a161e,_0x371227);UserEvents['on'](_0x1a161e,_0x47d57a);}}; \ No newline at end of file +var _0xb8db=['remove','update','emit','removeListener','register','length','user:','./user.events','save'];(function(_0x5d4042,_0x384d19){var _0x37b91d=function(_0x2e9d23){while(--_0x2e9d23){_0x5d4042['push'](_0x5d4042['shift']());}};_0x37b91d(++_0x384d19);}(_0xb8db,0xc4));var _0xbb8d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xb8db[_0x20a584];return _0x4b41a8;};'use strict';var UserEvents=require(_0xbb8d('0x0'));var events=[_0xbb8d('0x1'),_0xbb8d('0x2'),_0xbb8d('0x3')];function createListener(_0x450c73,_0x5a7fa2){return function(_0x341ca9){_0x5a7fa2[_0xbb8d('0x4')](_0x450c73,_0x341ca9);};}function removeListener(_0x1a861e,_0x5d8315){return function(){UserEvents[_0xbb8d('0x5')](_0x1a861e,_0x5d8315);};}exports[_0xbb8d('0x6')]=function(_0x48c311){for(var _0x1a76a2=0x0,_0x11bd17=events[_0xbb8d('0x7')];_0x1a76a2<_0x11bd17;_0x1a76a2++){var _0x1bcccf=events[_0x1a76a2];var _0x3e097c=createListener(_0xbb8d('0x8')+_0x1bcccf,_0x48c311);UserEvents['on'](_0x1bcccf,_0x3e097c);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index a190c60..450c138 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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x227ec4,_0x38d0d5){var _0x3ce2d5=function(_0x1d338c){while(--_0x1d338c){_0x227ec4['push'](_0x227ec4['shift']());}};_0x3ce2d5(++_0x38d0d5);}(_0x70e0,0x17b));var _0x070e=function(_0x4b0959,_0xa50ec7){_0x4b0959=_0x4b0959-0x0;var _0x4f8f44=_0x70e0[_0x4b0959];return _0x4f8f44;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file +var _0x0713=['../../config/environment','exports','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x56eb95,_0x32bc16){var _0x51f27b=function(_0x6c5a57){while(--_0x6c5a57){_0x56eb95['push'](_0x56eb95['shift']());}};_0x51f27b(++_0x32bc16);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var fs_extra=require(_0x3071('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x3071('0x5'));var config=require(_0x3071('0x6'));module[_0x3071('0x7')]=router; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index e15fe74..5980478 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 _0x1597=['exports','INTEGER'];(function(_0x1f6251,_0x23b4a4){var _0x2ade1c=function(_0xdbbcb6){while(--_0xdbbcb6){_0x1f6251['push'](_0x1f6251['shift']());}};_0x2ade1c(++_0x23b4a4);}(_0x1597,0x192));var _0x7159=function(_0x4f0a3a,_0x14f8d9){_0x4f0a3a=_0x4f0a3a-0x0;var _0x430cca=_0x1597[_0x4f0a3a];return _0x430cca;};'use strict';var Sequelize=require('sequelize');module[_0x7159('0x0')]={'penalty':{'type':Sequelize[_0x7159('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xbfb3=['sequelize','exports','INTEGER'];(function(_0x2732cc,_0x413e85){var _0x13d48f=function(_0x365d93){while(--_0x365d93){_0x2732cc['push'](_0x2732cc['shift']());}};_0x13d48f(++_0x413e85);}(_0xbfb3,0xa5));var _0x3bfb=function(_0x28c17c,_0x5014b3){_0x28c17c=_0x28c17c-0x0;var _0x21dfad=_0xbfb3[_0x28c17c];return _0x21dfad;};'use strict';var Sequelize=require(_0x3bfb('0x0'));module[_0x3bfb('0x1')]={'penalty':{'type':Sequelize[_0x3bfb('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 91dcc92..7f0cd08 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 _0x82a2=['./userChatQueue.attributes','exports','UserChatQueue','user_has_chat_queues','util','../../config/logger','api','request-promise','path','rimraf'];(function(_0x154459,_0x42dfcc){var _0x4899a5=function(_0x5576de){while(--_0x5576de){_0x154459['push'](_0x154459['shift']());}};_0x4899a5(++_0x42dfcc);}(_0x82a2,0x1ee));var _0x282a=function(_0x49d8b6,_0x77eb60){_0x49d8b6=_0x49d8b6-0x0;var _0x3458bd=_0x82a2[_0x49d8b6];return _0x3458bd;};'use strict';var _=require('lodash');var util=require(_0x282a('0x0'));var logger=require(_0x282a('0x1'))(_0x282a('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x282a('0x3'));var fs=require('fs');var path=require(_0x282a('0x4'));var rimraf=require(_0x282a('0x5'));var config=require('../../config/environment');var attributes=require(_0x282a('0x6'));module[_0x282a('0x7')]=function(_0x5e2247,_0x264396){return _0x5e2247['define'](_0x282a('0x8'),attributes,{'tableName':_0x282a('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd2a8=['util','../../config/logger','moment','request-promise','path','rimraf','exports','UserChatQueue','user_has_chat_queues','lodash'];(function(_0x45f87b,_0x2ad6e0){var _0x2167de=function(_0x3b4b4f){while(--_0x3b4b4f){_0x45f87b['push'](_0x45f87b['shift']());}};_0x2167de(++_0x2ad6e0);}(_0xd2a8,0x103));var _0x8d2a=function(_0x42ffba,_0x3a4001){_0x42ffba=_0x42ffba-0x0;var _0x21ee98=_0xd2a8[_0x42ffba];return _0x21ee98;};'use strict';var _=require(_0x8d2a('0x0'));var util=require(_0x8d2a('0x1'));var logger=require(_0x8d2a('0x2'))('api');var moment=require(_0x8d2a('0x3'));var BPromise=require('bluebird');var rp=require(_0x8d2a('0x4'));var fs=require('fs');var path=require(_0x8d2a('0x5'));var rimraf=require(_0x8d2a('0x6'));var config=require('../../config/environment');var attributes=require('./userChatQueue.attributes');module[_0x8d2a('0x7')]=function(_0x129d25,_0x33afcf){return _0x129d25['define'](_0x8d2a('0x8'),attributes,{'tableName':_0x8d2a('0x9'),'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 9d584c6..a66e9d9 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 _0x29cb=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','UserChatQueue,\x20%s,\x20%s','UserChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','moment','bluebird','randomstring'];(function(_0x1ef1fd,_0x4f6b60){var _0x5031d4=function(_0x470071){while(--_0x470071){_0x1ef1fd['push'](_0x1ef1fd['shift']());}};_0x5031d4(++_0x4f6b60);}(_0x29cb,0x1d8));var _0xb29c=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x29cb[_0x167cc1];return _0x10bc4b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xb29c('0x0'));var BPromise=require(_0xb29c('0x1'));var rs=require(_0xb29c('0x2'));var fs=require('fs');var Redis=require(_0xb29c('0x3'));var db=require(_0xb29c('0x4'))['db'];var utils=require(_0xb29c('0x5'));var logger=require(_0xb29c('0x6'))(_0xb29c('0x7'));var config=require(_0xb29c('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xb29c('0x9')][_0xb29c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x40b4cf,_0xa74856,_0x205307){return new BPromise(function(_0x8fab6d,_0x2d4052){return client['request'](_0x40b4cf,_0x205307)['then'](function(_0x4dbc36){logger['info'](_0xb29c('0xb'),_0xa74856,'request\x20sent');logger['debug'](_0xb29c('0xc'),_0xa74856,_0xb29c('0xd'),JSON[_0xb29c('0xe')](_0x4dbc36));if(_0x4dbc36[_0xb29c('0xf')]){if(_0x4dbc36['error'][_0xb29c('0x10')]===0x1f4){logger[_0xb29c('0xf')]('UserChatQueue,\x20%s,\x20%s',_0xa74856,_0x4dbc36[_0xb29c('0xf')][_0xb29c('0x11')]);return _0x2d4052(_0x4dbc36[_0xb29c('0xf')][_0xb29c('0x11')]);}logger[_0xb29c('0xf')](_0xb29c('0xb'),_0xa74856,_0x4dbc36['error']['message']);return _0x8fab6d(_0x4dbc36['error'][_0xb29c('0x11')]);}else{logger['info'](_0xb29c('0xb'),_0xa74856,'request\x20sent');_0x8fab6d(_0x4dbc36[_0xb29c('0x12')][_0xb29c('0x11')]);}})['catch'](function(_0x5e197b){logger['error'](_0xb29c('0xb'),_0xa74856,_0x5e197b);_0x2d4052(_0x5e197b);});});} \ No newline at end of file +var _0x064b=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','UserChatQueue,\x20%s,\x20%s','message','result','catch','util','bluebird','ioredis'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x064b,0x1b6));var _0xb064=function(_0x4c5b52,_0x1a945a){_0x4c5b52=_0x4c5b52-0x0;var _0x24fce3=_0x064b[_0x4c5b52];return _0x24fce3;};'use strict';var _=require('lodash');var util=require(_0xb064('0x0'));var moment=require('moment');var BPromise=require(_0xb064('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb064('0x2'));var db=require(_0xb064('0x3'))['db'];var utils=require(_0xb064('0x4'));var logger=require(_0xb064('0x5'))(_0xb064('0x6'));var config=require(_0xb064('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xb064('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2aa550,_0x340004,_0x16d5fa){return new BPromise(function(_0x468380,_0x37587c){return client[_0xb064('0x9')](_0x2aa550,_0x16d5fa)[_0xb064('0xa')](function(_0x49313c){logger['info']('UserChatQueue,\x20%s,\x20%s',_0x340004,_0xb064('0xb'));logger[_0xb064('0xc')](_0xb064('0xd'),_0x340004,_0xb064('0xb'),JSON[_0xb064('0xe')](_0x49313c));if(_0x49313c[_0xb064('0xf')]){if(_0x49313c[_0xb064('0xf')][_0xb064('0x10')]===0x1f4){logger[_0xb064('0xf')](_0xb064('0x11'),_0x340004,_0x49313c[_0xb064('0xf')][_0xb064('0x12')]);return _0x37587c(_0x49313c[_0xb064('0xf')]['message']);}logger[_0xb064('0xf')]('UserChatQueue,\x20%s,\x20%s',_0x340004,_0x49313c[_0xb064('0xf')][_0xb064('0x12')]);return _0x468380(_0x49313c[_0xb064('0xf')][_0xb064('0x12')]);}else{logger['info'](_0xb064('0x11'),_0x340004,_0xb064('0xb'));_0x468380(_0x49313c[_0xb064('0x13')]['message']);}})[_0xb064('0x14')](function(_0x6fa158){logger[_0xb064('0xf')](_0xb064('0x11'),_0x340004,_0x6fa158);_0x37587c(_0x6fa158);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index 0ccd41f..91b2f10 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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0x1cf0b3,_0x2637af){var _0x1a516e=function(_0x11ee29){while(--_0x11ee29){_0x1cf0b3['push'](_0x1cf0b3['shift']());}};_0x1a516e(++_0x2637af);}(_0x70e0,0x17b));var _0x070e=function(_0xc1f02a,_0x870e07){_0xc1f02a=_0xc1f02a-0x0;var _0x1fd5db=_0x70e0[_0xc1f02a];return _0x1fd5db;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file +var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x24a1c2,_0x1f05b6){var _0x425c05=function(_0x3e9527){while(--_0x3e9527){_0x24a1c2['push'](_0x24a1c2['shift']());}};_0x425c05(++_0x1f05b6);}(_0xe706,0xa3));var _0x6e70=function(_0x175e89,_0x20835f){_0x175e89=_0x175e89-0x0;var _0x2ed996=_0xe706[_0x175e89];return _0x2ed996;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index dc86ba7..fa62ff8 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 _0xed89=['STRING','sequelize','INTEGER'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0xed89,0x1ae));var _0x9ed8=function(_0x4e1e83,_0x4efcd0){_0x4e1e83=_0x4e1e83-0x0;var _0x2081ca=_0xed89[_0x4e1e83];return _0x2081ca;};'use strict';var Sequelize=require(_0x9ed8('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x9ed8('0x1')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x9ed8('0x1')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x9ed8('0x2')]}}; \ No newline at end of file +var _0xde2d=['exports','INTEGER','STRING'];(function(_0x3f6672,_0xfd583d){var _0x4e6607=function(_0x5a1784){while(--_0x5a1784){_0x3f6672['push'](_0x3f6672['shift']());}};_0x4e6607(++_0xfd583d);}(_0xde2d,0x141));var _0xdde2=function(_0x4169ff,_0x546a37){_0x4169ff=_0x4169ff-0x0;var _0x4f8185=_0xde2d[_0x4169ff];return _0x4f8185;};'use strict';var Sequelize=require('sequelize');module[_0xdde2('0x0')]={'penalty':{'type':Sequelize[_0xdde2('0x1')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xdde2('0x1')],'defaultValue':0x0},'queue':{'type':Sequelize[_0xdde2('0x2')]}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index fcd3252..7af430f 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 _0x1e1c=['../../config/environment','exports','define','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x7d9e6a,_0x9346c4){var _0x56828b=function(_0x2b7990){while(--_0x2b7990){_0x7d9e6a['push'](_0x7d9e6a['shift']());}};_0x56828b(++_0x9346c4);}(_0x1e1c,0x87));var _0xc1e1=function(_0x201262,_0x3e4cb3){_0x201262=_0x201262-0x0;var _0x28c662=_0x1e1c[_0x201262];return _0x28c662;};'use strict';var _=require(_0xc1e1('0x0'));var util=require(_0xc1e1('0x1'));var logger=require(_0xc1e1('0x2'))(_0xc1e1('0x3'));var moment=require(_0xc1e1('0x4'));var BPromise=require(_0xc1e1('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc1e1('0x6'));var rimraf=require(_0xc1e1('0x7'));var config=require(_0xc1e1('0x8'));var attributes=require('./userFaxQueue.attributes');module[_0xc1e1('0x9')]=function(_0x170b34,_0x1f8c66){return _0x170b34[_0xc1e1('0xa')]('UserFaxQueue',attributes,{'tableName':'user_has_fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0d3a=['api','moment','bluebird','path','rimraf','./userFaxQueue.attributes','exports','UserFaxQueue','user_has_fax_queues','util','../../config/logger'];(function(_0x471f68,_0x502ee6){var _0x5343e0=function(_0x36df57){while(--_0x36df57){_0x471f68['push'](_0x471f68['shift']());}};_0x5343e0(++_0x502ee6);}(_0x0d3a,0x77));var _0xa0d3=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x0d3a[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0xa0d3('0x0'));var logger=require(_0xa0d3('0x1'))(_0xa0d3('0x2'));var moment=require(_0xa0d3('0x3'));var BPromise=require(_0xa0d3('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa0d3('0x5'));var rimraf=require(_0xa0d3('0x6'));var config=require('../../config/environment');var attributes=require(_0xa0d3('0x7'));module[_0xa0d3('0x8')]=function(_0x3e478d,_0x49c617){return _0x3e478d['define'](_0xa0d3('0x9'),attributes,{'tableName':_0xa0d3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.rpc.js b/server/api/userFaxQueue/userFaxQueue.rpc.js index 7d40d55..16243e0 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 _0x97b9=['UserFaxQueue,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x29b609,_0x19d388){var _0x54c952=function(_0xb3c38d){while(--_0xb3c38d){_0x29b609['push'](_0x29b609['shift']());}};_0x54c952(++_0x19d388);}(_0x97b9,0xbb));var _0x997b=function(_0x587858,_0x5663e6){_0x587858=_0x587858-0x0;var _0x2c06b2=_0x97b9[_0x587858];return _0x2c06b2;};'use strict';var _=require(_0x997b('0x0'));var util=require(_0x997b('0x1'));var moment=require('moment');var BPromise=require(_0x997b('0x2'));var rs=require(_0x997b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x997b('0x4'))['db'];var utils=require(_0x997b('0x5'));var logger=require(_0x997b('0x6'))('rpc');var config=require(_0x997b('0x7'));var jayson=require(_0x997b('0x8'));var client=jayson[_0x997b('0x9')][_0x997b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x506dcd,_0x4b1e00,_0xaca5c0){return new BPromise(function(_0x266e1b,_0x458280){return client[_0x997b('0xb')](_0x506dcd,_0xaca5c0)[_0x997b('0xc')](function(_0x5055a8){logger['info'](_0x997b('0xd'),_0x4b1e00,_0x997b('0xe'));logger['debug']('UserFaxQueue,\x20%s,\x20%s,\x20%s',_0x4b1e00,_0x997b('0xe'),JSON[_0x997b('0xf')](_0x5055a8));if(_0x5055a8[_0x997b('0x10')]){if(_0x5055a8[_0x997b('0x10')]['code']===0x1f4){logger['error'](_0x997b('0xd'),_0x4b1e00,_0x5055a8['error'][_0x997b('0x11')]);return _0x458280(_0x5055a8[_0x997b('0x10')][_0x997b('0x11')]);}logger['error'](_0x997b('0xd'),_0x4b1e00,_0x5055a8[_0x997b('0x10')][_0x997b('0x11')]);return _0x266e1b(_0x5055a8[_0x997b('0x10')][_0x997b('0x11')]);}else{logger['info'](_0x997b('0xd'),_0x4b1e00,'request\x20sent');_0x266e1b(_0x5055a8[_0x997b('0x12')][_0x997b('0x11')]);}})[_0x997b('0x13')](function(_0xb7f4b5){logger['error']('UserFaxQueue,\x20%s,\x20%s',_0x4b1e00,_0xb7f4b5);_0x458280(_0xb7f4b5);});});} \ No newline at end of file +var _0x0e07=['UserFaxQueue,\x20%s,\x20%s','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','info'];(function(_0x358e3b,_0x72233f){var _0x4906c0=function(_0x5d25fb){while(--_0x5d25fb){_0x358e3b['push'](_0x358e3b['shift']());}};_0x4906c0(++_0x72233f);}(_0x0e07,0x1e4));var _0x70e0=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x0e07[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x70e0('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x70e0('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x70e0('0x2'))['db'];var utils=require(_0x70e0('0x3'));var logger=require('../../config/logger')(_0x70e0('0x4'));var config=require('../../config/environment');var jayson=require(_0x70e0('0x5'));var client=jayson[_0x70e0('0x6')][_0x70e0('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x57c3cd,_0x233546,_0x59e180){return new BPromise(function(_0x558cae,_0x374334){return client[_0x70e0('0x8')](_0x57c3cd,_0x59e180)['then'](function(_0x1e2a0d){logger[_0x70e0('0x9')](_0x70e0('0xa'),_0x233546,_0x70e0('0xb'));logger[_0x70e0('0xc')](_0x70e0('0xd'),_0x233546,_0x70e0('0xb'),JSON['stringify'](_0x1e2a0d));if(_0x1e2a0d['error']){if(_0x1e2a0d[_0x70e0('0xe')][_0x70e0('0xf')]===0x1f4){logger[_0x70e0('0xe')](_0x70e0('0xa'),_0x233546,_0x1e2a0d[_0x70e0('0xe')][_0x70e0('0x10')]);return _0x374334(_0x1e2a0d[_0x70e0('0xe')][_0x70e0('0x10')]);}logger[_0x70e0('0xe')](_0x70e0('0xa'),_0x233546,_0x1e2a0d[_0x70e0('0xe')][_0x70e0('0x10')]);return _0x558cae(_0x1e2a0d[_0x70e0('0xe')][_0x70e0('0x10')]);}else{logger[_0x70e0('0x9')](_0x70e0('0xa'),_0x233546,_0x70e0('0xb'));_0x558cae(_0x1e2a0d[_0x70e0('0x11')]['message']);}})[_0x70e0('0x12')](function(_0x39b76c){logger['error'](_0x70e0('0xa'),_0x233546,_0x39b76c);_0x374334(_0x39b76c);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index d5793bc..1245b09 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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0xff4075,_0x7d6e69){var _0x286922=function(_0x3e6df4){while(--_0x3e6df4){_0xff4075['push'](_0xff4075['shift']());}};_0x286922(++_0x7d6e69);}(_0x70e0,0x17b));var _0x070e=function(_0x137773,_0x23e2ec){_0x137773=_0x137773-0x0;var _0x168cf6=_0x70e0[_0x137773];return _0x168cf6;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var fs_extra=require(_0x070e('0x4'));var auth=require(_0x070e('0x5'));var interaction=require(_0x070e('0x6'));var config=require('../../config/environment');module[_0x070e('0x7')]=router; \ No newline at end of file +var _0xe706=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service'];(function(_0x2c634e,_0x4ac477){var _0x587fd1=function(_0x483783){while(--_0x483783){_0x2c634e['push'](_0x2c634e['shift']());}};_0x587fd1(++_0x4ac477);}(_0xe706,0xa3));var _0x6e70=function(_0xc54c54,_0x59053b){_0xc54c54=_0xc54c54-0x0;var _0x476786=_0xe706[_0xc54c54];return _0x476786;};'use strict';var multer=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var path=require(_0x6e70('0x2'));var timeout=require('connect-timeout');var express=require(_0x6e70('0x3'));var router=express[_0x6e70('0x4')]();var fs_extra=require(_0x6e70('0x5'));var auth=require(_0x6e70('0x6'));var interaction=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));module[_0x6e70('0x9')]=router; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index 27eff01..d1246f8 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 _0xb2f4=['exports','INTEGER','sequelize'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xb2f4,0x14f));var _0x4b2f=function(_0x276de9,_0x2c2f75){_0x276de9=_0x276de9-0x0;var _0xbac321=_0xb2f4[_0x276de9];return _0xbac321;};'use strict';var Sequelize=require(_0x4b2f('0x0'));module[_0x4b2f('0x1')]={'penalty':{'type':Sequelize[_0x4b2f('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x74c7=['sequelize','INTEGER'];(function(_0x2ad6ff,_0x24f9d8){var _0x42de5d=function(_0x127b2e){while(--_0x127b2e){_0x2ad6ff['push'](_0x2ad6ff['shift']());}};_0x42de5d(++_0x24f9d8);}(_0x74c7,0x8e));var _0x774c=function(_0x4038bf,_0x2d76a2){_0x4038bf=_0x4038bf-0x0;var _0x298d54=_0x74c7[_0x4038bf];return _0x298d54;};'use strict';var Sequelize=require(_0x774c('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x774c('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.model.js b/server/api/userMailQueue/userMailQueue.model.js index 167fcfc..3650600 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 _0x3a77=['api','moment','bluebird','request-promise','path','../../config/environment','exports','define','UserMailQueue','lodash','../../config/logger'];(function(_0x381677,_0x372171){var _0x33b10a=function(_0x4679e2){while(--_0x4679e2){_0x381677['push'](_0x381677['shift']());}};_0x33b10a(++_0x372171);}(_0x3a77,0x1ed));var _0x73a7=function(_0x3b3750,_0x28f3b8){_0x3b3750=_0x3b3750-0x0;var _0x1b9e8b=_0x3a77[_0x3b3750];return _0x1b9e8b;};'use strict';var _=require(_0x73a7('0x0'));var util=require('util');var logger=require(_0x73a7('0x1'))(_0x73a7('0x2'));var moment=require(_0x73a7('0x3'));var BPromise=require(_0x73a7('0x4'));var rp=require(_0x73a7('0x5'));var fs=require('fs');var path=require(_0x73a7('0x6'));var rimraf=require('rimraf');var config=require(_0x73a7('0x7'));var attributes=require('./userMailQueue.attributes');module[_0x73a7('0x8')]=function(_0x1103a7,_0xeb00f4){return _0x1103a7[_0x73a7('0x9')](_0x73a7('0xa'),attributes,{'tableName':'user_has_mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x14f6=['UserMailQueue','user_has_mail_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userMailQueue.attributes','exports'];(function(_0xa33ea,_0xbbb170){var _0x211a53=function(_0xbe39da){while(--_0xbe39da){_0xa33ea['push'](_0xa33ea['shift']());}};_0x211a53(++_0xbbb170);}(_0x14f6,0x18a));var _0x614f=function(_0x3c89ab,_0x345da8){_0x3c89ab=_0x3c89ab-0x0;var _0x189851=_0x14f6[_0x3c89ab];return _0x189851;};'use strict';var _=require(_0x614f('0x0'));var util=require(_0x614f('0x1'));var logger=require(_0x614f('0x2'))(_0x614f('0x3'));var moment=require(_0x614f('0x4'));var BPromise=require(_0x614f('0x5'));var rp=require(_0x614f('0x6'));var fs=require('fs');var path=require(_0x614f('0x7'));var rimraf=require(_0x614f('0x8'));var config=require(_0x614f('0x9'));var attributes=require(_0x614f('0xa'));module[_0x614f('0xb')]=function(_0x45aa26,_0x5e049){return _0x45aa26['define'](_0x614f('0xc'),attributes,{'tableName':_0x614f('0xd'),'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 a76fdbe..3f75205 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 _0x34e8=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x9a30dc,_0x533531){var _0x1956bf=function(_0x4fa9a1){while(--_0x4fa9a1){_0x9a30dc['push'](_0x9a30dc['shift']());}};_0x1956bf(++_0x533531);}(_0x34e8,0x12c));var _0x834e=function(_0x5a76dc,_0x270dfe){_0x5a76dc=_0x5a76dc-0x0;var _0x76628b=_0x34e8[_0x5a76dc];return _0x76628b;};'use strict';var _=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var moment=require(_0x834e('0x2'));var BPromise=require(_0x834e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x834e('0x4'));var db=require(_0x834e('0x5'))['db'];var utils=require(_0x834e('0x6'));var logger=require(_0x834e('0x7'))(_0x834e('0x8'));var config=require(_0x834e('0x9'));var jayson=require(_0x834e('0xa'));var client=jayson['client'][_0x834e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x52056d,_0x3e16d2,_0x3cc2e3){return new BPromise(function(_0x3a3ef6,_0x2e69e2){return client[_0x834e('0xc')](_0x52056d,_0x3cc2e3)[_0x834e('0xd')](function(_0x363786){logger[_0x834e('0xe')](_0x834e('0xf'),_0x3e16d2,_0x834e('0x10'));logger[_0x834e('0x11')](_0x834e('0x12'),_0x3e16d2,_0x834e('0x10'),JSON[_0x834e('0x13')](_0x363786));if(_0x363786[_0x834e('0x14')]){if(_0x363786[_0x834e('0x14')][_0x834e('0x15')]===0x1f4){logger['error'](_0x834e('0xf'),_0x3e16d2,_0x363786[_0x834e('0x14')]['message']);return _0x2e69e2(_0x363786[_0x834e('0x14')][_0x834e('0x16')]);}logger[_0x834e('0x14')](_0x834e('0xf'),_0x3e16d2,_0x363786['error'][_0x834e('0x16')]);return _0x3a3ef6(_0x363786[_0x834e('0x14')]['message']);}else{logger[_0x834e('0xe')]('UserMailQueue,\x20%s,\x20%s',_0x3e16d2,_0x834e('0x10'));_0x3a3ef6(_0x363786[_0x834e('0x17')]['message']);}})[_0x834e('0x18')](function(_0x22106e){logger[_0x834e('0x14')]('UserMailQueue,\x20%s,\x20%s',_0x3e16d2,_0x22106e);_0x2e69e2(_0x22106e);});});} \ No newline at end of file +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(_0x3d6097,_0x4373f0){var _0x339ea4=function(_0x3732f1){while(--_0x3732f1){_0x3d6097['push'](_0x3d6097['shift']());}};_0x339ea4(++_0x4373f0);}(_0x55ca,0x126));var _0xa55c=function(_0x14d250,_0x4b2e12){_0x14d250=_0x14d250-0x0;var _0xb991d8=_0x55ca[_0x14d250];return _0xb991d8;};'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 a305fc6..688d8b2 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 _0x220b=['../../config/environment','post','sendUserNotification','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x139405,_0x99fc12){var _0x4c9f3a=function(_0x260567){while(--_0x260567){_0x139405['push'](_0x139405['shift']());}};_0x4c9f3a(++_0x99fc12);}(_0x220b,0x190));var _0xb220=function(_0x595bd1,_0xb1e7a){_0x595bd1=_0x595bd1-0x0;var _0xd0344f=_0x220b[_0x595bd1];return _0xd0344f;};'use strict';var multer=require(_0xb220('0x0'));var util=require(_0xb220('0x1'));var path=require(_0xb220('0x2'));var timeout=require(_0xb220('0x3'));var express=require(_0xb220('0x4'));var router=express[_0xb220('0x5')]();var fs_extra=require(_0xb220('0x6'));var auth=require(_0xb220('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xb220('0x8'));var controller=require('./userNotification.controller');router[_0xb220('0x9')]('/',auth['isAuthenticated'](),controller[_0xb220('0xa')]);module[_0xb220('0xb')]=router; \ No newline at end of file +var _0x813e=['../../components/interaction/service','../../config/environment','./userNotification.controller','exports','multer','util','path','connect-timeout','express','fs-extra'];(function(_0x8dcb51,_0x10e4aa){var _0x4d3580=function(_0x3e8e49){while(--_0x3e8e49){_0x8dcb51['push'](_0x8dcb51['shift']());}};_0x4d3580(++_0x10e4aa);}(_0x813e,0xe0));var _0xe813=function(_0x122415,_0xb08425){_0x122415=_0x122415-0x0;var _0x3ac79d=_0x813e[_0x122415];return _0x3ac79d;};'use strict';var multer=require(_0xe813('0x0'));var util=require(_0xe813('0x1'));var path=require(_0xe813('0x2'));var timeout=require(_0xe813('0x3'));var express=require(_0xe813('0x4'));var router=express['Router']();var fs_extra=require(_0xe813('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xe813('0x6'));var config=require(_0xe813('0x7'));var controller=require(_0xe813('0x8'));router['post']('/',auth['isAuthenticated'](),controller['sendUserNotification']);module[_0xe813('0x9')]=router; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.attributes.js b/server/api/userNotification/userNotification.attributes.js index f8af6c0..a7b6e72 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 _0xae41=['TEXT','STRING','sequelize'];(function(_0x5ebc04,_0x14a363){var _0x17845c=function(_0x360850){while(--_0x360850){_0x5ebc04['push'](_0x5ebc04['shift']());}};_0x17845c(++_0x14a363);}(_0xae41,0x1cd));var _0x1ae4=function(_0x442528,_0x107937){_0x442528=_0x442528-0x0;var _0xc5b336=_0xae41[_0x442528];return _0xc5b336;};'use strict';var Sequelize=require(_0x1ae4('0x0'));module['exports']={'body':{'type':Sequelize[_0x1ae4('0x1')]},'senderName':{'type':Sequelize[_0x1ae4('0x2')]},'recipientsId':{'type':Sequelize['TEXT']},'recipientsDescription':{'type':Sequelize[_0x1ae4('0x2')]},'beep':{'type':Sequelize['BOOLEAN']}}; \ No newline at end of file +var _0x83a8=['BOOLEAN','sequelize','exports','TEXT','STRING'];(function(_0x2c1853,_0x42efc4){var _0x44a7ba=function(_0x2a5e28){while(--_0x2a5e28){_0x2c1853['push'](_0x2c1853['shift']());}};_0x44a7ba(++_0x42efc4);}(_0x83a8,0x123));var _0x883a=function(_0x3034ff,_0x145ca3){_0x3034ff=_0x3034ff-0x0;var _0x494367=_0x83a8[_0x3034ff];return _0x494367;};'use strict';var Sequelize=require(_0x883a('0x0'));module[_0x883a('0x1')]={'body':{'type':Sequelize[_0x883a('0x2')]},'senderName':{'type':Sequelize[_0x883a('0x3')]},'recipientsId':{'type':Sequelize['TEXT']},'recipientsDescription':{'type':Sequelize[_0x883a('0x3')]},'beep':{'type':Sequelize[_0x883a('0x4')]}}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.controller.js b/server/api/userNotification/userNotification.controller.js index fd197b4..c9b67dc 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 _0xa9f9=['push','all','union','getAgents','map','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','update','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','recipients','parse','Invalid\x20\x27recipients\x27\x20object','chatqueue','faxqueue','smsqueue','voicequeue','whatsappqueue','user','some','toLowerCase','Invalid\x20model\x20in\x20\x27recipients\x27\x20object','senderName','recipientsDescription','isEmpty','beep','SenderId','then','recipientsId','join','sequelize','transaction','create','forEach','recipient','emit','catch','Template','findOne','Invalid\x20\x27TemplateId\x27\x20parameter','html','startCase','model','User','ids','includes','queue','replace'];(function(_0x1e9ae1,_0x10dc5d){var _0xc6bc15=function(_0x1a6a7d){while(--_0x1a6a7d){_0x1e9ae1['push'](_0x1e9ae1['shift']());}};_0xc6bc15(++_0x10dc5d);}(_0xa9f9,0x191));var _0x9a9f=function(_0x54a973,_0x4552f8){_0x54a973=_0x54a973-0x0;var _0x3176e2=_0xa9f9[_0x54a973];return _0x3176e2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9a9f('0x0'));var zipdir=require(_0x9a9f('0x1'));var jsonpatch=require(_0x9a9f('0x2'));var rp=require(_0x9a9f('0x3'));var moment=require(_0x9a9f('0x4'));var BPromise=require(_0x9a9f('0x5'));var Mustache=require(_0x9a9f('0x6'));var util=require(_0x9a9f('0x7'));var path=require('path');var sox=require(_0x9a9f('0x8'));var csv=require(_0x9a9f('0x9'));var ejs=require(_0x9a9f('0xa'));var fs=require('fs');var fs_extra=require(_0x9a9f('0xb'));var _=require(_0x9a9f('0xc'));var squel=require(_0x9a9f('0xd'));var crypto=require('crypto');var jsforce=require(_0x9a9f('0xe'));var deskjs=require(_0x9a9f('0xf'));var toCsv=require('to-csv');var querystring=require(_0x9a9f('0x10'));var Papa=require('papaparse');var Redis=require(_0x9a9f('0x11'));var authService=require(_0x9a9f('0x12'));var qs=require(_0x9a9f('0x13'));var as=require(_0x9a9f('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x9a9f('0x15'));var config=require(_0x9a9f('0x16'));var licenseUtil=require(_0x9a9f('0x17'));var db=require(_0x9a9f('0x18'))['db'];config[_0x9a9f('0x19')]=_[_0x9a9f('0x1a')](config[_0x9a9f('0x19')],{'host':_0x9a9f('0x1b'),'port':0x18eb});var socket=require(_0x9a9f('0x1c'))(new Redis(config['redis']));require('./userNotification.socket')[_0x9a9f('0x1d')](socket);function respondWithStatusCode(_0x5dcede,_0x5b4bb7){_0x5b4bb7=_0x5b4bb7||0xcc;return function(_0x2d72e3){if(_0x2d72e3){return _0x5dcede[_0x9a9f('0x1e')](_0x5b4bb7);}return _0x5dcede[_0x9a9f('0x1f')](_0x5b4bb7)[_0x9a9f('0x20')]();};}function respondWithResult(_0x46ec2a,_0x341db8){_0x341db8=_0x341db8||0xc8;return function(_0x2ed957){if(_0x2ed957){return _0x46ec2a[_0x9a9f('0x1f')](_0x341db8)[_0x9a9f('0x21')](_0x2ed957);}};}function respondWithFilteredResult(_0x9910c8,_0x3ad831){return function(_0x4dcf58){if(_0x4dcf58){var _0x43d796=typeof _0x3ad831[_0x9a9f('0x22')]==='undefined'&&typeof _0x3ad831['limit']===_0x9a9f('0x23');var _0x711b85=_0x4dcf58['count'];var _0xc14948=_0x43d796?0x0:_0x3ad831[_0x9a9f('0x22')];var _0x70985b=_0x43d796?_0x4dcf58[_0x9a9f('0x24')]:_0x3ad831[_0x9a9f('0x22')]+_0x3ad831[_0x9a9f('0x25')];var _0x23f6b7;if(_0x70985b>=_0x711b85){_0x70985b=_0x711b85;_0x23f6b7=0xc8;}else{_0x23f6b7=0xce;}_0x9910c8['status'](_0x23f6b7);return _0x9910c8[_0x9a9f('0x26')](_0x9a9f('0x27'),_0xc14948+'-'+_0x70985b+'/'+_0x711b85)[_0x9a9f('0x21')](_0x4dcf58);}return null;};}function patchUpdates(_0x3e3f1e){return function(_0x3f7d3b){try{jsonpatch[_0x9a9f('0x28')](_0x3f7d3b,_0x3e3f1e,!![]);}catch(_0x73ddec){return BPromise[_0x9a9f('0x29')](_0x73ddec);}return _0x3f7d3b['save']();};}function saveUpdates(_0x41856d,_0x5a44a6){return function(_0x1f886c){if(_0x1f886c){return _0x1f886c[_0x9a9f('0x2a')](_0x41856d)['then'](function(_0x46ec65){return _0x46ec65;});}return null;};}function removeEntity(_0xca338c,_0x463b40){return function(_0x56fefb){if(_0x56fefb){return _0x56fefb['destroy']()['then'](function(){_0xca338c['status'](0xcc)[_0x9a9f('0x20')]();});}};}function handleEntityNotFound(_0x5c1102,_0x1aad4f){return function(_0x3cd581){if(!_0x3cd581){_0x5c1102[_0x9a9f('0x1e')](0x194);}return _0x3cd581;};}function handleError(_0x1b6685,_0x16b3e2){_0x16b3e2=_0x16b3e2||0x1f4;return function(_0x3c75a8){logger[_0x9a9f('0x2b')](_0x3c75a8[_0x9a9f('0x2c')]);if(_0x3c75a8[_0x9a9f('0x2d')]){delete _0x3c75a8[_0x9a9f('0x2d')];}_0x1b6685[_0x9a9f('0x1f')](_0x16b3e2)[_0x9a9f('0x2e')](_0x3c75a8);};}exports[_0x9a9f('0x2f')]=function(_0x1f6ae9,_0x59ab68,_0xa626cb){if(!_0x1f6ae9[_0x9a9f('0x30')][_0x9a9f('0x31')](_0x9a9f('0x32'))&&!_0x1f6ae9[_0x9a9f('0x30')][_0x9a9f('0x31')](_0x9a9f('0x33'))){throw new db[(_0x9a9f('0x34'))][(_0x9a9f('0x35'))](_0x9a9f('0x36'));}else{if(_0x1f6ae9[_0x9a9f('0x30')][_0x9a9f('0x31')]('TemplateId')&&!_0x1f6ae9[_0x9a9f('0x30')]['hasOwnProperty'](_0x9a9f('0x37'))){throw new db[(_0x9a9f('0x34'))][(_0x9a9f('0x35'))]('Missing\x20\x27view\x27\x20parameter');}if(!_0x1f6ae9[_0x9a9f('0x30')][_0x9a9f('0x31')](_0x9a9f('0x38'))){throw new db[(_0x9a9f('0x34'))][(_0x9a9f('0x35'))]('Missing\x20\x27recipients\x27\x20parameter');}else{try{var _0x31a1ee=JSON[_0x9a9f('0x39')](_0x1f6ae9[_0x9a9f('0x30')]['recipients']);}catch(_0x5badfe){logger[_0x9a9f('0x2b')](_0x5badfe);throw new db[(_0x9a9f('0x34'))][(_0x9a9f('0x35'))](_0x9a9f('0x3a'));}var _0x28b28d=[_0x9a9f('0x3b'),_0x9a9f('0x3c'),'mailqueue','openchannelqueue',_0x9a9f('0x3d'),_0x9a9f('0x3e'),_0x9a9f('0x3f'),'team',_0x9a9f('0x40')];if(_[_0x9a9f('0x41')](_0x31a1ee,function(_0x4d9db8){return!_['includes'](_0x28b28d,_0x4d9db8['model'][_0x9a9f('0x42')]());})){throw new db[(_0x9a9f('0x34'))][(_0x9a9f('0x35'))](_0x9a9f('0x43'));}}}var _0x22578a={};_0x22578a[_0x9a9f('0x44')]=_0x1f6ae9['body']['hasOwnProperty']('senderName')?_0x1f6ae9[_0x9a9f('0x30')][_0x9a9f('0x44')]:_0x1f6ae9[_0x9a9f('0x40')]['fullname'];_0x22578a[_0x9a9f('0x45')]=_[_0x9a9f('0x46')](_0x1f6ae9['body'][_0x9a9f('0x45')])?null:_0x1f6ae9[_0x9a9f('0x30')]['recipientsDescription'];_0x22578a[_0x9a9f('0x47')]=_0x1f6ae9[_0x9a9f('0x30')]['beep']||![];_0x22578a[_0x9a9f('0x48')]=_0x1f6ae9[_0x9a9f('0x40')]['id'];return getContent(_0x1f6ae9[_0x9a9f('0x30')])[_0x9a9f('0x49')](function(_0x32db95){_0x22578a[_0x9a9f('0x30')]=_0x32db95;return getRecipients(_0x31a1ee);})['then'](function(_0x1c0a96){_0x22578a[_0x9a9f('0x4a')]=_['sortBy'](_0x1c0a96)[_0x9a9f('0x4b')](',');return db[_0x9a9f('0x4c')][_0x9a9f('0x4d')](function(_0x418e74){return db['UserNotification'][_0x9a9f('0x4e')](_0x22578a,{'raw':!![],'transaction':_0x418e74})[_0x9a9f('0x49')](function(_0x9a42d9){var _0x3db984={'sender':_0x22578a[_0x9a9f('0x44')],'description':_0x22578a[_0x9a9f('0x45')],'content':_0x22578a[_0x9a9f('0x30')],'beep':_0x22578a[_0x9a9f('0x47')]};_0x1c0a96[_0x9a9f('0x4f')](function(_0x3eaccd){_0x3db984[_0x9a9f('0x50')]=_0x3eaccd;socket[_0x9a9f('0x51')]('userNotification:send',_0x3db984);});return _0x9a42d9;});});})['then'](respondWithResult(_0x59ab68,0xc9))[_0x9a9f('0x52')](handleError(_0x59ab68,null));};function getContent(_0x4f8e1c){return new BPromise(function(_0x3e04f6,_0xfb9704){if(_0x4f8e1c[_0x9a9f('0x32')]){_0x3e04f6(_0x4f8e1c[_0x9a9f('0x32')]);return;}return db[_0x9a9f('0x53')][_0x9a9f('0x54')]({'attributes':['html'],'where':{'id':_0x4f8e1c[_0x9a9f('0x33')]},'raw':!![]})['then'](function(_0xb03a8c){if(!_0xb03a8c)throw new db[(_0x9a9f('0x34'))][(_0x9a9f('0x35'))](_0x9a9f('0x55'));var _0x51d81f=Mustache['render'](_0xb03a8c[_0x9a9f('0x56')],_0x4f8e1c[_0x9a9f('0x37')]);_0x3e04f6(_0x51d81f);})['catch'](function(_0x3e0300){_0xfb9704(_0x3e0300);});});}function getRecipients(_0x2753d5){return new BPromise(function(_0x3c5cc7,_0x5899bb){var _0x194f3c=[];var _0x3fdda4=[];_0x2753d5[_0x9a9f('0x4f')](function(_0x3d5313){var _0x574c95=_[_0x9a9f('0x57')](_0x3d5313[_0x9a9f('0x58')]['toLowerCase']());if(_0x574c95===_0x9a9f('0x59')){_0x194f3c=_['union'](_0x194f3c,_0x3d5313[_0x9a9f('0x5a')]);}else{if(_[_0x9a9f('0x5b')](_0x574c95,_0x9a9f('0x5c')))_0x574c95=_0x574c95[_0x9a9f('0x5d')]('queue','Queue');_0x3d5313[_0x9a9f('0x5a')][_0x9a9f('0x4f')](function(_0x47311f){_0x3fdda4[_0x9a9f('0x5e')](getAgents(_0x574c95,_0x47311f));});}});return BPromise[_0x9a9f('0x5f')](_0x3fdda4)['then'](function(_0x2d5fd0){_0x194f3c=_[_0x9a9f('0x60')](_0x194f3c,_['flatten'](_0x2d5fd0));_0x3c5cc7(_0x194f3c);})['catch'](function(_0x21f737){_0x5899bb(_0x21f737);});});}function getAgents(_0x278c2a,_0x5df491){return new BPromise(function(_0x98ed70,_0x7570ba){return db[_0x278c2a][_0x9a9f('0x54')]({'where':{'id':_0x5df491}})[_0x9a9f('0x49')](function(_0x5535f7){return _0x5535f7[_0x9a9f('0x61')]({'attributes':['id'],'raw':!![]})[_0x9a9f('0x49')](function(_0x384165){var _0x1863b2=_[_0x9a9f('0x62')](_0x384165,'id');_0x98ed70(_0x1863b2);});})['catch'](function(_0x5bfbd1){_0x7570ba(_0x5bfbd1);});});} \ No newline at end of file +var _0x9470=['bluebird','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','./userNotification.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','then','error','stack','name','sendUserNotification','body','hasOwnProperty','text','ValidationError','Must\x20specify\x20at\x20least\x20one\x20argument\x20for\x20\x27text\x27\x20or\x20\x27TemplateId\x27','TemplateId','view','Sequelize','recipients','parse','Invalid\x20\x27recipients\x27\x20object','faxqueue','mailqueue','openchannelqueue','smsqueue','voicequeue','whatsappqueue','team','user','some','includes','model','toLowerCase','senderName','isEmpty','recipientsDescription','beep','SenderId','recipientsId','sortBy','join','sequelize','create','forEach','recipient','emit','userNotification:send','catch','Template','findOne','Invalid\x20\x27TemplateId\x27\x20parameter','render','html','startCase','User','union','ids','queue','Queue','push','all','flatten','getAgents','map','eml-format','rimraf','zip-dir','request-promise','moment'];(function(_0x210ede,_0x1e354c){var _0x509663=function(_0x346b02){while(--_0x346b02){_0x210ede['push'](_0x210ede['shift']());}};_0x509663(++_0x1e354c);}(_0x9470,0x127));var _0x0947=function(_0x5abb00,_0x342d70){_0x5abb00=_0x5abb00-0x0;var _0xf9b854=_0x9470[_0x5abb00];return _0xf9b854;};'use strict';var emlformat=require(_0x0947('0x0'));var rimraf=require(_0x0947('0x1'));var zipdir=require(_0x0947('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0947('0x3'));var moment=require(_0x0947('0x4'));var BPromise=require(_0x0947('0x5'));var Mustache=require(_0x0947('0x6'));var util=require(_0x0947('0x7'));var path=require('path');var sox=require(_0x0947('0x8'));var csv=require(_0x0947('0x9'));var ejs=require(_0x0947('0xa'));var fs=require('fs');var fs_extra=require(_0x0947('0xb'));var _=require('lodash');var squel=require(_0x0947('0xc'));var crypto=require(_0x0947('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x0947('0xe'));var toCsv=require(_0x0947('0x9'));var querystring=require(_0x0947('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x0947('0x10'));var qs=require(_0x0947('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x0947('0x12'))(_0x0947('0x13'));var utils=require(_0x0947('0x14'));var config=require(_0x0947('0x15'));var licenseUtil=require(_0x0947('0x16'));var db=require(_0x0947('0x17'))['db'];config[_0x0947('0x18')]=_[_0x0947('0x19')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0947('0x18')]));require(_0x0947('0x1a'))[_0x0947('0x1b')](socket);function respondWithStatusCode(_0x578ce4,_0x4fe3fb){_0x4fe3fb=_0x4fe3fb||0xcc;return function(_0x90d12f){if(_0x90d12f){return _0x578ce4[_0x0947('0x1c')](_0x4fe3fb);}return _0x578ce4[_0x0947('0x1d')](_0x4fe3fb)[_0x0947('0x1e')]();};}function respondWithResult(_0x1b230f,_0x5199aa){_0x5199aa=_0x5199aa||0xc8;return function(_0x16fc96){if(_0x16fc96){return _0x1b230f[_0x0947('0x1d')](_0x5199aa)[_0x0947('0x1f')](_0x16fc96);}};}function respondWithFilteredResult(_0x4765ea,_0x3854ef){return function(_0x14df51){if(_0x14df51){var _0x1cc36c=typeof _0x3854ef[_0x0947('0x20')]===_0x0947('0x21')&&typeof _0x3854ef[_0x0947('0x22')]==='undefined';var _0x25c120=_0x14df51[_0x0947('0x23')];var _0x3a4522=_0x1cc36c?0x0:_0x3854ef['offset'];var _0x2e4dba=_0x1cc36c?_0x14df51[_0x0947('0x23')]:_0x3854ef[_0x0947('0x20')]+_0x3854ef['limit'];var _0x3b5d97;if(_0x2e4dba>=_0x25c120){_0x2e4dba=_0x25c120;_0x3b5d97=0xc8;}else{_0x3b5d97=0xce;}_0x4765ea[_0x0947('0x1d')](_0x3b5d97);return _0x4765ea[_0x0947('0x24')]('Content-Range',_0x3a4522+'-'+_0x2e4dba+'/'+_0x25c120)[_0x0947('0x1f')](_0x14df51);}return null;};}function patchUpdates(_0x15d1c2){return function(_0x276790){try{jsonpatch[_0x0947('0x25')](_0x276790,_0x15d1c2,!![]);}catch(_0x3822d9){return BPromise[_0x0947('0x26')](_0x3822d9);}return _0x276790[_0x0947('0x27')]();};}function saveUpdates(_0x118cc1,_0x5777ed){return function(_0x569c2e){if(_0x569c2e){return _0x569c2e[_0x0947('0x28')](_0x118cc1)[_0x0947('0x29')](function(_0x5eca0d){return _0x5eca0d;});}return null;};}function removeEntity(_0x566689,_0x191b93){return function(_0x72b850){if(_0x72b850){return _0x72b850['destroy']()['then'](function(){_0x566689[_0x0947('0x1d')](0xcc)[_0x0947('0x1e')]();});}};}function handleEntityNotFound(_0x3e3e1d,_0x343197){return function(_0x160b88){if(!_0x160b88){_0x3e3e1d[_0x0947('0x1c')](0x194);}return _0x160b88;};}function handleError(_0x4a91e7,_0x41cf47){_0x41cf47=_0x41cf47||0x1f4;return function(_0x4ba3f2){logger[_0x0947('0x2a')](_0x4ba3f2[_0x0947('0x2b')]);if(_0x4ba3f2[_0x0947('0x2c')]){delete _0x4ba3f2[_0x0947('0x2c')];}_0x4a91e7['status'](_0x41cf47)['send'](_0x4ba3f2);};}exports[_0x0947('0x2d')]=function(_0x4f963c,_0x6cdefa,_0x4e4f52){if(!_0x4f963c[_0x0947('0x2e')][_0x0947('0x2f')](_0x0947('0x30'))&&!_0x4f963c[_0x0947('0x2e')]['hasOwnProperty']('TemplateId')){throw new db['Sequelize'][(_0x0947('0x31'))](_0x0947('0x32'));}else{if(_0x4f963c[_0x0947('0x2e')][_0x0947('0x2f')](_0x0947('0x33'))&&!_0x4f963c['body'][_0x0947('0x2f')](_0x0947('0x34'))){throw new db[(_0x0947('0x35'))][(_0x0947('0x31'))]('Missing\x20\x27view\x27\x20parameter');}if(!_0x4f963c[_0x0947('0x2e')]['hasOwnProperty'](_0x0947('0x36'))){throw new db[(_0x0947('0x35'))]['ValidationError']('Missing\x20\x27recipients\x27\x20parameter');}else{try{var _0x2a7ff5=JSON[_0x0947('0x37')](_0x4f963c['body']['recipients']);}catch(_0x17537c){logger[_0x0947('0x2a')](_0x17537c);throw new db[(_0x0947('0x35'))][(_0x0947('0x31'))](_0x0947('0x38'));}var _0x35635e=['chatqueue',_0x0947('0x39'),_0x0947('0x3a'),_0x0947('0x3b'),_0x0947('0x3c'),_0x0947('0x3d'),_0x0947('0x3e'),_0x0947('0x3f'),_0x0947('0x40')];if(_[_0x0947('0x41')](_0x2a7ff5,function(_0x45feae){return!_[_0x0947('0x42')](_0x35635e,_0x45feae[_0x0947('0x43')][_0x0947('0x44')]());})){throw new db[(_0x0947('0x35'))][(_0x0947('0x31'))]('Invalid\x20model\x20in\x20\x27recipients\x27\x20object');}}}var _0x44c846={};_0x44c846[_0x0947('0x45')]=_0x4f963c[_0x0947('0x2e')][_0x0947('0x2f')]('senderName')?_0x4f963c[_0x0947('0x2e')][_0x0947('0x45')]:_0x4f963c[_0x0947('0x40')]['fullname'];_0x44c846['recipientsDescription']=_[_0x0947('0x46')](_0x4f963c[_0x0947('0x2e')][_0x0947('0x47')])?null:_0x4f963c[_0x0947('0x2e')][_0x0947('0x47')];_0x44c846['beep']=_0x4f963c[_0x0947('0x2e')][_0x0947('0x48')]||![];_0x44c846[_0x0947('0x49')]=_0x4f963c['user']['id'];return getContent(_0x4f963c['body'])[_0x0947('0x29')](function(_0x2a241f){_0x44c846[_0x0947('0x2e')]=_0x2a241f;return getRecipients(_0x2a7ff5);})[_0x0947('0x29')](function(_0x29bfb3){_0x44c846[_0x0947('0x4a')]=_[_0x0947('0x4b')](_0x29bfb3)[_0x0947('0x4c')](',');return db[_0x0947('0x4d')]['transaction'](function(_0x2c0862){return db['UserNotification'][_0x0947('0x4e')](_0x44c846,{'raw':!![],'transaction':_0x2c0862})['then'](function(_0x20a8b8){var _0x4da950={'sender':_0x44c846['senderName'],'description':_0x44c846[_0x0947('0x47')],'content':_0x44c846['body'],'beep':_0x44c846['beep']};_0x29bfb3[_0x0947('0x4f')](function(_0x109296){_0x4da950[_0x0947('0x50')]=_0x109296;socket[_0x0947('0x51')](_0x0947('0x52'),_0x4da950);});return _0x20a8b8;});});})[_0x0947('0x29')](respondWithResult(_0x6cdefa,0xc9))[_0x0947('0x53')](handleError(_0x6cdefa,null));};function getContent(_0x3ee6fa){return new BPromise(function(_0x212807,_0x5e01f5){if(_0x3ee6fa['text']){_0x212807(_0x3ee6fa[_0x0947('0x30')]);return;}return db[_0x0947('0x54')][_0x0947('0x55')]({'attributes':['html'],'where':{'id':_0x3ee6fa[_0x0947('0x33')]},'raw':!![]})[_0x0947('0x29')](function(_0x16fc19){if(!_0x16fc19)throw new db[(_0x0947('0x35'))][(_0x0947('0x31'))](_0x0947('0x56'));var _0xa58ac6=Mustache[_0x0947('0x57')](_0x16fc19[_0x0947('0x58')],_0x3ee6fa[_0x0947('0x34')]);_0x212807(_0xa58ac6);})[_0x0947('0x53')](function(_0x472f89){_0x5e01f5(_0x472f89);});});}function getRecipients(_0x2ddee7){return new BPromise(function(_0x550831,_0x2319b9){var _0x592f32=[];var _0x27b526=[];_0x2ddee7[_0x0947('0x4f')](function(_0x4c4ea3){var _0x5d7b6a=_[_0x0947('0x59')](_0x4c4ea3[_0x0947('0x43')][_0x0947('0x44')]());if(_0x5d7b6a===_0x0947('0x5a')){_0x592f32=_[_0x0947('0x5b')](_0x592f32,_0x4c4ea3[_0x0947('0x5c')]);}else{if(_[_0x0947('0x42')](_0x5d7b6a,_0x0947('0x5d')))_0x5d7b6a=_0x5d7b6a['replace'](_0x0947('0x5d'),_0x0947('0x5e'));_0x4c4ea3[_0x0947('0x5c')][_0x0947('0x4f')](function(_0x398ae5){_0x27b526[_0x0947('0x5f')](getAgents(_0x5d7b6a,_0x398ae5));});}});return BPromise[_0x0947('0x60')](_0x27b526)[_0x0947('0x29')](function(_0xa77c5f){_0x592f32=_[_0x0947('0x5b')](_0x592f32,_[_0x0947('0x61')](_0xa77c5f));_0x550831(_0x592f32);})[_0x0947('0x53')](function(_0x219a53){_0x2319b9(_0x219a53);});});}function getAgents(_0x2033a2,_0x57e48d){return new BPromise(function(_0x28e8de,_0xf6c11f){return db[_0x2033a2][_0x0947('0x55')]({'where':{'id':_0x57e48d}})['then'](function(_0x2c9131){return _0x2c9131[_0x0947('0x62')]({'attributes':['id'],'raw':!![]})['then'](function(_0x3393c2){var _0x116e6f=_[_0x0947('0x63')](_0x3393c2,'id');_0x28e8de(_0x116e6f);});})['catch'](function(_0xf48f82){_0xf6c11f(_0xf48f82);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.events.js b/server/api/userNotification/userNotification.events.js index 7a8e3c7..84ef847 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 _0x30b3=['hook','exports','events','../../mysqldb','UserNotification','save','remove','emit','hasOwnProperty'];(function(_0x1a0600,_0x41feef){var _0x734670=function(_0x2da4e4){while(--_0x2da4e4){_0x1a0600['push'](_0x1a0600['shift']());}};_0x734670(++_0x41feef);}(_0x30b3,0x1f1));var _0x330b=function(_0x5a2d6e,_0x3d3a47){_0x5a2d6e=_0x5a2d6e-0x0;var _0x30ff59=_0x30b3[_0x5a2d6e];return _0x30ff59;};'use strict';var EventEmitter=require(_0x330b('0x0'));var UserNotification=require(_0x330b('0x1'))['db'][_0x330b('0x2')];var UserNotificationEvents=new EventEmitter();UserNotificationEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x330b('0x3'),'afterUpdate':'update','afterDestroy':_0x330b('0x4')};function emitEvent(_0x2f6ef8){return function(_0x1cd7ff,_0x20bf32,_0x53fea2){UserNotificationEvents[_0x330b('0x5')](_0x2f6ef8+':'+_0x1cd7ff['id'],_0x1cd7ff);UserNotificationEvents[_0x330b('0x5')](_0x2f6ef8,_0x1cd7ff);_0x53fea2(null);};}for(var e in events){if(events[_0x330b('0x6')](e)){var event=events[e];UserNotification[_0x330b('0x7')](e,emitEvent(event));}}module[_0x330b('0x8')]=UserNotificationEvents; \ No newline at end of file +var _0xdb5c=['save','update','remove','emit','hasOwnProperty','hook'];(function(_0x45b034,_0x3a57dd){var _0x509cb0=function(_0x3a89d5){while(--_0x3a89d5){_0x45b034['push'](_0x45b034['shift']());}};_0x509cb0(++_0x3a57dd);}(_0xdb5c,0x108));var _0xcdb5=function(_0x3f9252,_0x144228){_0x3f9252=_0x3f9252-0x0;var _0x2a1080=_0xdb5c[_0x3f9252];return _0x2a1080;};'use strict';var EventEmitter=require('events');var UserNotification=require('../../mysqldb')['db']['UserNotification'];var UserNotificationEvents=new EventEmitter();UserNotificationEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xcdb5('0x0'),'afterUpdate':_0xcdb5('0x1'),'afterDestroy':_0xcdb5('0x2')};function emitEvent(_0x518be8){return function(_0x1c9201,_0x3721a5,_0x54fa2e){UserNotificationEvents['emit'](_0x518be8+':'+_0x1c9201['id'],_0x1c9201);UserNotificationEvents[_0xcdb5('0x3')](_0x518be8,_0x1c9201);_0x54fa2e(null);};}for(var e in events){if(events[_0xcdb5('0x4')](e)){var event=events[e];UserNotification[_0xcdb5('0x5')](e,emitEvent(event));}}module['exports']=UserNotificationEvents; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.model.js b/server/api/userNotification/userNotification.model.js index 46e9640..6290966 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 _0x00b2=['exports','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userNotification.attributes'];(function(_0x41fb84,_0x3770b8){var _0x231304=function(_0x40ce59){while(--_0x40ce59){_0x41fb84['push'](_0x41fb84['shift']());}};_0x231304(++_0x3770b8);}(_0x00b2,0x16a));var _0x200b=function(_0x2397eb,_0x5b855e){_0x2397eb=_0x2397eb-0x0;var _0x2d104e=_0x00b2[_0x2397eb];return _0x2d104e;};'use strict';var _=require(_0x200b('0x0'));var util=require(_0x200b('0x1'));var logger=require('../../config/logger')(_0x200b('0x2'));var moment=require(_0x200b('0x3'));var BPromise=require(_0x200b('0x4'));var rp=require(_0x200b('0x5'));var fs=require('fs');var path=require(_0x200b('0x6'));var rimraf=require(_0x200b('0x7'));var config=require(_0x200b('0x8'));var attributes=require(_0x200b('0x9'));module[_0x200b('0xa')]=function(_0x391cae,_0x14ff75){return _0x391cae['define']('UserNotification',attributes,{'tableName':'userNotifications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x200b('0xb')});}; \ No newline at end of file +var _0xcc6d=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./userNotification.attributes','exports','define','UserNotification','userNotifications','utf8mb4','lodash','util','../../config/logger','api'];(function(_0x4fa5e5,_0x156384){var _0x28e375=function(_0x54baee){while(--_0x54baee){_0x4fa5e5['push'](_0x4fa5e5['shift']());}};_0x28e375(++_0x156384);}(_0xcc6d,0x9c));var _0xdcc6=function(_0x4e8c16,_0x230a6f){_0x4e8c16=_0x4e8c16-0x0;var _0x19ffd4=_0xcc6d[_0x4e8c16];return _0x19ffd4;};'use strict';var _=require(_0xdcc6('0x0'));var util=require(_0xdcc6('0x1'));var logger=require(_0xdcc6('0x2'))(_0xdcc6('0x3'));var moment=require(_0xdcc6('0x4'));var BPromise=require(_0xdcc6('0x5'));var rp=require(_0xdcc6('0x6'));var fs=require('fs');var path=require(_0xdcc6('0x7'));var rimraf=require(_0xdcc6('0x8'));var config=require(_0xdcc6('0x9'));var attributes=require(_0xdcc6('0xa'));module[_0xdcc6('0xb')]=function(_0x56e2b4,_0x279042){return _0x56e2b4[_0xdcc6('0xc')](_0xdcc6('0xd'),attributes,{'tableName':_0xdcc6('0xe'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xdcc6('0xf'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/userNotification/userNotification.rpc.js b/server/api/userNotification/userNotification.rpc.js index bb20892..13cb5fe 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 _0xb6d9=['request\x20sent','debug','UserNotification,\x20%s,\x20%s,\x20%s','stringify','error','code','UserNotification,\x20%s,\x20%s','message','info','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./userNotification.socket','request','then'];(function(_0x4ae0bd,_0x10a367){var _0x917580=function(_0x34b2ee){while(--_0x34b2ee){_0x4ae0bd['push'](_0x4ae0bd['shift']());}};_0x917580(++_0x10a367);}(_0xb6d9,0x19f));var _0x9b6d=function(_0x39010b,_0x17e844){_0x39010b=_0x39010b-0x0;var _0x3d8797=_0xb6d9[_0x39010b];return _0x3d8797;};'use strict';var _=require(_0x9b6d('0x0'));var util=require(_0x9b6d('0x1'));var moment=require('moment');var BPromise=require(_0x9b6d('0x2'));var rs=require(_0x9b6d('0x3'));var fs=require('fs');var Redis=require(_0x9b6d('0x4'));var db=require(_0x9b6d('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x9b6d('0x6'));var config=require('../../config/environment');var jayson=require(_0x9b6d('0x7'));var client=jayson[_0x9b6d('0x8')][_0x9b6d('0x9')]({'port':0x232a});config[_0x9b6d('0xa')]=_[_0x9b6d('0xb')](config[_0x9b6d('0xa')],{'host':_0x9b6d('0xc'),'port':0x18eb});var socket=require(_0x9b6d('0xd'))(new Redis(config['redis']));require(_0x9b6d('0xe'))['register'](socket);function respondWithRpcPromise(_0x5d4092,_0x378187,_0xb60672){return new BPromise(function(_0x56ec2c,_0x4e0f54){return client[_0x9b6d('0xf')](_0x5d4092,_0xb60672)[_0x9b6d('0x10')](function(_0xad3394){logger['info']('UserNotification,\x20%s,\x20%s',_0x378187,_0x9b6d('0x11'));logger[_0x9b6d('0x12')](_0x9b6d('0x13'),_0x378187,'request\x20sent',JSON[_0x9b6d('0x14')](_0xad3394));if(_0xad3394[_0x9b6d('0x15')]){if(_0xad3394[_0x9b6d('0x15')][_0x9b6d('0x16')]===0x1f4){logger[_0x9b6d('0x15')](_0x9b6d('0x17'),_0x378187,_0xad3394[_0x9b6d('0x15')][_0x9b6d('0x18')]);return _0x4e0f54(_0xad3394['error'][_0x9b6d('0x18')]);}logger['error'](_0x9b6d('0x17'),_0x378187,_0xad3394['error']['message']);return _0x56ec2c(_0xad3394[_0x9b6d('0x15')][_0x9b6d('0x18')]);}else{logger[_0x9b6d('0x19')](_0x9b6d('0x17'),_0x378187,'request\x20sent');_0x56ec2c(_0xad3394['result']['message']);}})[_0x9b6d('0x1a')](function(_0xe2b502){logger[_0x9b6d('0x15')](_0x9b6d('0x17'),_0x378187,_0xe2b502);_0x4e0f54(_0xe2b502);});});} \ No newline at end of file +var _0x921f=['client','http','redis','defaults','socket.io-emitter','./userNotification.socket','request','info','request\x20sent','stringify','error','code','UserNotification,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x33cdff,_0x5299e1){var _0x16a78c=function(_0x12c23c){while(--_0x12c23c){_0x33cdff['push'](_0x33cdff['shift']());}};_0x16a78c(++_0x5299e1);}(_0x921f,0x1db));var _0xf921=function(_0x21bcfd,_0x290b83){_0x21bcfd=_0x21bcfd-0x0;var _0x589f2c=_0x921f[_0x21bcfd];return _0x589f2c;};'use strict';var _=require(_0xf921('0x0'));var util=require(_0xf921('0x1'));var moment=require(_0xf921('0x2'));var BPromise=require(_0xf921('0x3'));var rs=require(_0xf921('0x4'));var fs=require('fs');var Redis=require(_0xf921('0x5'));var db=require(_0xf921('0x6'))['db'];var utils=require(_0xf921('0x7'));var logger=require(_0xf921('0x8'))('rpc');var config=require(_0xf921('0x9'));var jayson=require(_0xf921('0xa'));var client=jayson[_0xf921('0xb')][_0xf921('0xc')]({'port':0x232a});config[_0xf921('0xd')]=_[_0xf921('0xe')](config[_0xf921('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0xf921('0xf'))(new Redis(config[_0xf921('0xd')]));require(_0xf921('0x10'))['register'](socket);function respondWithRpcPromise(_0x5b3a97,_0x25b1a2,_0x26b5c0){return new BPromise(function(_0x19a772,_0x5150df){return client[_0xf921('0x11')](_0x5b3a97,_0x26b5c0)['then'](function(_0x47961f){logger[_0xf921('0x12')]('UserNotification,\x20%s,\x20%s',_0x25b1a2,_0xf921('0x13'));logger['debug']('UserNotification,\x20%s,\x20%s,\x20%s',_0x25b1a2,_0xf921('0x13'),JSON[_0xf921('0x14')](_0x47961f));if(_0x47961f[_0xf921('0x15')]){if(_0x47961f['error'][_0xf921('0x16')]===0x1f4){logger['error'](_0xf921('0x17'),_0x25b1a2,_0x47961f['error'][_0xf921('0x18')]);return _0x5150df(_0x47961f['error'][_0xf921('0x18')]);}logger[_0xf921('0x15')](_0xf921('0x17'),_0x25b1a2,_0x47961f[_0xf921('0x15')][_0xf921('0x18')]);return _0x19a772(_0x47961f[_0xf921('0x15')][_0xf921('0x18')]);}else{logger[_0xf921('0x12')](_0xf921('0x17'),_0x25b1a2,_0xf921('0x13'));_0x19a772(_0x47961f[_0xf921('0x19')]['message']);}})[_0xf921('0x1a')](function(_0x540e51){logger[_0xf921('0x15')](_0xf921('0x17'),_0x25b1a2,_0x540e51);_0x5150df(_0x540e51);});});} \ No newline at end of file diff --git a/server/api/userNotification/userNotification.socket.js b/server/api/userNotification/userNotification.socket.js index 48a0800..86b3fe6 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 _0xc058=['./userNotification.events','save','remove','update','emit','removeListener','register','length'];(function(_0x754ab4,_0x56daa7){var _0x34079a=function(_0x295ec1){while(--_0x295ec1){_0x754ab4['push'](_0x754ab4['shift']());}};_0x34079a(++_0x56daa7);}(_0xc058,0x188));var _0x8c05=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xc058[_0x20a584];return _0x4b41a8;};'use strict';var UserNotificationEvents=require(_0x8c05('0x0'));var events=[_0x8c05('0x1'),_0x8c05('0x2'),_0x8c05('0x3')];function createListener(_0x3436fa,_0x5b9a47){return function(_0xc405c5){_0x5b9a47[_0x8c05('0x4')](_0x3436fa,_0xc405c5);};}function removeListener(_0x4a56c1,_0x1a150e){return function(){UserNotificationEvents[_0x8c05('0x5')](_0x4a56c1,_0x1a150e);};}exports[_0x8c05('0x6')]=function(_0x38ed77){for(var _0x269c85=0x0,_0x464738=events[_0x8c05('0x7')];_0x269c85<_0x464738;_0x269c85++){var _0x44a6c3=events[_0x269c85];var _0x354d70=createListener('userNotification:'+_0x44a6c3,_0x38ed77);UserNotificationEvents['on'](_0x44a6c3,_0x354d70);}}; \ No newline at end of file +var _0x1b5a=['remove','update','emit','removeListener','register','length','userNotification:','./userNotification.events','save'];(function(_0x5c49c3,_0x2b582d){var _0x849b5=function(_0x4d338d){while(--_0x4d338d){_0x5c49c3['push'](_0x5c49c3['shift']());}};_0x849b5(++_0x2b582d);}(_0x1b5a,0x1a5));var _0xa1b5=function(_0x35d063,_0x21b5a5){_0x35d063=_0x35d063-0x0;var _0xd9f385=_0x1b5a[_0x35d063];return _0xd9f385;};'use strict';var UserNotificationEvents=require(_0xa1b5('0x0'));var events=[_0xa1b5('0x1'),_0xa1b5('0x2'),_0xa1b5('0x3')];function createListener(_0x3f6cf4,_0x2aba30){return function(_0x16afb6){_0x2aba30[_0xa1b5('0x4')](_0x3f6cf4,_0x16afb6);};}function removeListener(_0xa68b9c,_0x16b728){return function(){UserNotificationEvents[_0xa1b5('0x5')](_0xa68b9c,_0x16b728);};}exports[_0xa1b5('0x6')]=function(_0x4b5606){for(var _0x29676b=0x0,_0x56e7af=events[_0xa1b5('0x7')];_0x29676b<_0x56e7af;_0x29676b++){var _0x11a62a=events[_0x29676b];var _0x45c38e=createListener(_0xa1b5('0x8')+_0x11a62a,_0x4b5606);UserNotificationEvents['on'](_0x11a62a,_0x45c38e);}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index 8074bde..e25b10b 100644 --- a/server/api/userOpenchannelQueue/index.js +++ b/server/api/userOpenchannelQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x23b36b,_0x150dce){var _0x29308a=function(_0x5d194d){while(--_0x5d194d){_0x23b36b['push'](_0x23b36b['shift']());}};_0x29308a(++_0x150dce);}(_0x9c44,0x178));var _0x49c4=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x9c44[_0x8c43de];return _0xa6591b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file +var _0xd8b0=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x1d10ef,_0x1ef46d){var _0x167327=function(_0x540b71){while(--_0x540b71){_0x1d10ef['push'](_0x1d10ef['shift']());}};_0x167327(++_0x1ef46d);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));module['exports']=router; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index 3ebb8c1..bd3acb3 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 _0x2094=['INTEGER','sequelize'];(function(_0x5b2f98,_0x3d4d1f){var _0x468dab=function(_0x407e68){while(--_0x407e68){_0x5b2f98['push'](_0x5b2f98['shift']());}};_0x468dab(++_0x3d4d1f);}(_0x2094,0x10d));var _0x4209=function(_0x3a35f5,_0xebd0fb){_0x3a35f5=_0x3a35f5-0x0;var _0x1c95a6=_0x2094[_0x3a35f5];return _0x1c95a6;};'use strict';var Sequelize=require(_0x4209('0x0'));module['exports']={'penalty':{'type':Sequelize[_0x4209('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x0eac=['sequelize','exports'];(function(_0x1b5fff,_0x21d5e5){var _0x1536a4=function(_0x1f5acb){while(--_0x1f5acb){_0x1b5fff['push'](_0x1b5fff['shift']());}};_0x1536a4(++_0x21d5e5);}(_0x0eac,0x7e));var _0xc0ea=function(_0x542da8,_0x509c26){_0x542da8=_0x542da8-0x0;var _0x533d7e=_0x0eac[_0x542da8];return _0x533d7e;};'use strict';var Sequelize=require(_0xc0ea('0x0'));module[_0xc0ea('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js index cee222d..f453f72 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 _0x6cd9=['bluebird','request-promise','path','rimraf','./userOpenchannelQueue.attributes','exports','define','UserOpenchannelQueue','lodash','util','api'];(function(_0x27e9b3,_0x1b17af){var _0x553cac=function(_0x5c368e){while(--_0x5c368e){_0x27e9b3['push'](_0x27e9b3['shift']());}};_0x553cac(++_0x1b17af);}(_0x6cd9,0xfa));var _0x96cd=function(_0x44452b,_0x2d41b3){_0x44452b=_0x44452b-0x0;var _0x23f8b4=_0x6cd9[_0x44452b];return _0x23f8b4;};'use strict';var _=require(_0x96cd('0x0'));var util=require(_0x96cd('0x1'));var logger=require('../../config/logger')(_0x96cd('0x2'));var moment=require('moment');var BPromise=require(_0x96cd('0x3'));var rp=require(_0x96cd('0x4'));var fs=require('fs');var path=require(_0x96cd('0x5'));var rimraf=require(_0x96cd('0x6'));var config=require('../../config/environment');var attributes=require(_0x96cd('0x7'));module[_0x96cd('0x8')]=function(_0x4f3204,_0x5123ce){return _0x4f3204[_0x96cd('0x9')](_0x96cd('0xa'),attributes,{'tableName':'user_has_openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5cad=['path','rimraf','../../config/environment','exports','define','user_has_openchannel_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x594e11,_0x28f652){var _0x5418ad=function(_0x5dcfa7){while(--_0x5dcfa7){_0x594e11['push'](_0x594e11['shift']());}};_0x5418ad(++_0x28f652);}(_0x5cad,0x17f));var _0xd5ca=function(_0x2c0dc0,_0x19900d){_0x2c0dc0=_0x2c0dc0-0x0;var _0x4c0990=_0x5cad[_0x2c0dc0];return _0x4c0990;};'use strict';var _=require(_0xd5ca('0x0'));var util=require(_0xd5ca('0x1'));var logger=require(_0xd5ca('0x2'))(_0xd5ca('0x3'));var moment=require(_0xd5ca('0x4'));var BPromise=require(_0xd5ca('0x5'));var rp=require(_0xd5ca('0x6'));var fs=require('fs');var path=require(_0xd5ca('0x7'));var rimraf=require(_0xd5ca('0x8'));var config=require(_0xd5ca('0x9'));var attributes=require('./userOpenchannelQueue.attributes');module[_0xd5ca('0xa')]=function(_0x55b285,_0x20ad88){return _0x55b285[_0xd5ca('0xb')]('UserOpenchannelQueue',attributes,{'tableName':_0xd5ca('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js index a232817..1cf6c8f 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 _0x1957=['info','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','error','code','UserOpenchannelQueue,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then'];(function(_0x3ec333,_0x26bcbe){var _0x15ccb8=function(_0x2c4d0c){while(--_0x2c4d0c){_0x3ec333['push'](_0x3ec333['shift']());}};_0x15ccb8(++_0x26bcbe);}(_0x1957,0x1a8));var _0x7195=function(_0x3042d5,_0x349534){_0x3042d5=_0x3042d5-0x0;var _0x1acfef=_0x1957[_0x3042d5];return _0x1acfef;};'use strict';var _=require('lodash');var util=require(_0x7195('0x0'));var moment=require(_0x7195('0x1'));var BPromise=require(_0x7195('0x2'));var rs=require(_0x7195('0x3'));var fs=require('fs');var Redis=require(_0x7195('0x4'));var db=require(_0x7195('0x5'))['db'];var utils=require(_0x7195('0x6'));var logger=require(_0x7195('0x7'))(_0x7195('0x8'));var config=require('../../config/environment');var jayson=require(_0x7195('0x9'));var client=jayson['client'][_0x7195('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x50a223,_0x5178c7,_0x15b163){return new BPromise(function(_0x98ad90,_0x1d50b1){return client[_0x7195('0xb')](_0x50a223,_0x15b163)[_0x7195('0xc')](function(_0x1aa746){logger[_0x7195('0xd')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x5178c7,_0x7195('0xe'));logger[_0x7195('0xf')](_0x7195('0x10'),_0x5178c7,_0x7195('0xe'),JSON['stringify'](_0x1aa746));if(_0x1aa746[_0x7195('0x11')]){if(_0x1aa746[_0x7195('0x11')][_0x7195('0x12')]===0x1f4){logger[_0x7195('0x11')](_0x7195('0x13'),_0x5178c7,_0x1aa746[_0x7195('0x11')][_0x7195('0x14')]);return _0x1d50b1(_0x1aa746[_0x7195('0x11')][_0x7195('0x14')]);}logger[_0x7195('0x11')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x5178c7,_0x1aa746[_0x7195('0x11')]['message']);return _0x98ad90(_0x1aa746['error'][_0x7195('0x14')]);}else{logger[_0x7195('0xd')](_0x7195('0x13'),_0x5178c7,'request\x20sent');_0x98ad90(_0x1aa746[_0x7195('0x15')][_0x7195('0x14')]);}})[_0x7195('0x16')](function(_0x5d488d){logger['error'](_0x7195('0x13'),_0x5178c7,_0x5d488d);_0x1d50b1(_0x5d488d);});});} \ No newline at end of file +var _0xd70c=['rpc','jayson/promise','client','http','then','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','../../config/utils'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd70c,0x1b3));var _0xcd70=function(_0xa2ea5f,_0x5bfcef){_0xa2ea5f=_0xa2ea5f-0x0;var _0x3f2d9a=_0xd70c[_0xa2ea5f];return _0x3f2d9a;};'use strict';var _=require(_0xcd70('0x0'));var util=require(_0xcd70('0x1'));var moment=require(_0xcd70('0x2'));var BPromise=require(_0xcd70('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xcd70('0x4'));var logger=require('../../config/logger')(_0xcd70('0x5'));var config=require('../../config/environment');var jayson=require(_0xcd70('0x6'));var client=jayson[_0xcd70('0x7')][_0xcd70('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xdf3de1,_0x582f62,_0x5c0e82){return new BPromise(function(_0x289cd3,_0x4e36b5){return client['request'](_0xdf3de1,_0x5c0e82)[_0xcd70('0x9')](function(_0x112b69){logger[_0xcd70('0xa')](_0xcd70('0xb'),_0x582f62,_0xcd70('0xc'));logger[_0xcd70('0xd')](_0xcd70('0xe'),_0x582f62,'request\x20sent',JSON[_0xcd70('0xf')](_0x112b69));if(_0x112b69[_0xcd70('0x10')]){if(_0x112b69[_0xcd70('0x10')]['code']===0x1f4){logger['error'](_0xcd70('0xb'),_0x582f62,_0x112b69[_0xcd70('0x10')][_0xcd70('0x11')]);return _0x4e36b5(_0x112b69['error'][_0xcd70('0x11')]);}logger[_0xcd70('0x10')](_0xcd70('0xb'),_0x582f62,_0x112b69[_0xcd70('0x10')]['message']);return _0x289cd3(_0x112b69[_0xcd70('0x10')][_0xcd70('0x11')]);}else{logger[_0xcd70('0xa')](_0xcd70('0xb'),_0x582f62,_0xcd70('0xc'));_0x289cd3(_0x112b69[_0xcd70('0x12')][_0xcd70('0x11')]);}})[_0xcd70('0x13')](function(_0x10d7cb){logger[_0xcd70('0x10')](_0xcd70('0xb'),_0x582f62,_0x10d7cb);_0x4e36b5(_0x10d7cb);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index b5d2f56..acd534f 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 _0x849e=['removeSections','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfile.controller','get','isAuthenticated','/describe','describe','/:id','/:id/sections','getSections','getResources','post','create','clone','/:id/resources','delete','destroy'];(function(_0x87d5c4,_0xfa4a9f){var _0x2dcea4=function(_0x2cedaf){while(--_0x2cedaf){_0x87d5c4['push'](_0x87d5c4['shift']());}};_0x2dcea4(++_0xfa4a9f);}(_0x849e,0x187));var _0xe849=function(_0x2d056d,_0x53f6c3){_0x2d056d=_0x2d056d-0x0;var _0x430fca=_0x849e[_0x2d056d];return _0x430fca;};'use strict';var multer=require(_0xe849('0x0'));var util=require(_0xe849('0x1'));var path=require(_0xe849('0x2'));var timeout=require(_0xe849('0x3'));var express=require(_0xe849('0x4'));var router=express[_0xe849('0x5')]();var fs_extra=require(_0xe849('0x6'));var auth=require(_0xe849('0x7'));var interaction=require(_0xe849('0x8'));var config=require(_0xe849('0x9'));var controller=require(_0xe849('0xa'));router[_0xe849('0xb')]('/',auth[_0xe849('0xc')](),controller['index']);router[_0xe849('0xb')](_0xe849('0xd'),auth[_0xe849('0xc')](),controller[_0xe849('0xe')]);router[_0xe849('0xb')](_0xe849('0xf'),auth['isAuthenticated'](),controller['show']);router[_0xe849('0xb')](_0xe849('0x10'),auth['isAuthenticated'](),controller[_0xe849('0x11')]);router[_0xe849('0xb')]('/:id/resources',auth[_0xe849('0xc')](),controller[_0xe849('0x12')]);router[_0xe849('0x13')]('/',auth[_0xe849('0xc')](),controller[_0xe849('0x14')]);router[_0xe849('0x13')]('/:id/clone',auth[_0xe849('0xc')](),controller[_0xe849('0x15')]);router[_0xe849('0x13')]('/:id/sections',auth['isAuthenticated'](),controller['addSections']);router['post'](_0xe849('0x16'),auth['isAuthenticated'](),controller['addResources']);router['put'](_0xe849('0xf'),auth[_0xe849('0xc')](),controller['update']);router[_0xe849('0x17')](_0xe849('0xf'),auth[_0xe849('0xc')](),controller[_0xe849('0x18')]);router[_0xe849('0x17')](_0xe849('0x10'),auth['isAuthenticated'](),controller[_0xe849('0x19')]);router[_0xe849('0x17')]('/:id/resources',auth[_0xe849('0xc')](),controller['removeResources']);module['exports']=router; \ No newline at end of file +var _0x0fcd=['post','create','clone','addSections','addResources','put','delete','removeSections','removeResources','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./userProfile.controller','get','index','isAuthenticated','/:id','/:id/sections','/:id/resources'];(function(_0x368711,_0xc21342){var _0x4f0ab7=function(_0x57d081){while(--_0x57d081){_0x368711['push'](_0x368711['shift']());}};_0x4f0ab7(++_0xc21342);}(_0x0fcd,0x129));var _0xd0fc=function(_0x3f2067,_0x3aeaba){_0x3f2067=_0x3f2067-0x0;var _0x3f82c3=_0x0fcd[_0x3f2067];return _0x3f82c3;};'use strict';var multer=require('multer');var util=require(_0xd0fc('0x0'));var path=require(_0xd0fc('0x1'));var timeout=require(_0xd0fc('0x2'));var express=require(_0xd0fc('0x3'));var router=express[_0xd0fc('0x4')]();var fs_extra=require(_0xd0fc('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xd0fc('0x6'));var config=require(_0xd0fc('0x7'));var controller=require(_0xd0fc('0x8'));router[_0xd0fc('0x9')]('/',auth['isAuthenticated'](),controller[_0xd0fc('0xa')]);router['get']('/describe',auth[_0xd0fc('0xb')](),controller['describe']);router[_0xd0fc('0x9')](_0xd0fc('0xc'),auth[_0xd0fc('0xb')](),controller['show']);router[_0xd0fc('0x9')](_0xd0fc('0xd'),auth['isAuthenticated'](),controller['getSections']);router[_0xd0fc('0x9')](_0xd0fc('0xe'),auth[_0xd0fc('0xb')](),controller['getResources']);router[_0xd0fc('0xf')]('/',auth['isAuthenticated'](),controller[_0xd0fc('0x10')]);router[_0xd0fc('0xf')]('/:id/clone',auth[_0xd0fc('0xb')](),controller[_0xd0fc('0x11')]);router[_0xd0fc('0xf')]('/:id/sections',auth[_0xd0fc('0xb')](),controller[_0xd0fc('0x12')]);router[_0xd0fc('0xf')]('/:id/resources',auth['isAuthenticated'](),controller[_0xd0fc('0x13')]);router[_0xd0fc('0x14')](_0xd0fc('0xc'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0xd0fc('0xb')](),controller['destroy']);router[_0xd0fc('0x15')]('/:id/sections',auth[_0xd0fc('0xb')](),controller[_0xd0fc('0x16')]);router[_0xd0fc('0x15')]('/:id/resources',auth['isAuthenticated'](),controller[_0xd0fc('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index 8b28fb1..1a51540 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 _0x0839=['sequelize','exports','STRING','name','setDataValue','crudPermissions','join','getDataValue','split','BOOLEAN'];(function(_0x2d6dd4,_0x3abb75){var _0xdd0fea=function(_0x6f27d8){while(--_0x6f27d8){_0x2d6dd4['push'](_0x2d6dd4['shift']());}};_0xdd0fea(++_0x3abb75);}(_0x0839,0xdc));var _0x9083=function(_0x5774a7,_0x10ba6c){_0x5774a7=_0x5774a7-0x0;var _0x94d0ee=_0x0839[_0x5774a7];return _0x94d0ee;};'use strict';var Sequelize=require(_0x9083('0x0'));module[_0x9083('0x1')]={'name':{'type':Sequelize[_0x9083('0x2')],'allowNull':![],'unique':_0x9083('0x3')},'crudPermissions':{'type':Sequelize[_0x9083('0x2')],'set':function(_0x3a4712){this[_0x9083('0x4')](_0x9083('0x5'),_0x3a4712?_0x3a4712[_0x9083('0x6')](''):[]);},'get':function(){return this['getDataValue'](_0x9083('0x5'))?this[_0x9083('0x7')](_0x9083('0x5'))[_0x9083('0x8')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x9083('0x2')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x9083('0x9')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x9083('0x9')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x9083('0x9')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x9083('0x9')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x9083('0x9')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x9083('0x9')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x9083('0x9')],'defaultValue':!![]},'downloadVoiceRecordings':{'type':Sequelize[_0x9083('0x9')],'defaultValue':!![]}}; \ No newline at end of file +var _0xb454=['join','getDataValue','BOOLEAN','sequelize','exports','STRING','name','setDataValue','crudPermissions'];(function(_0x33af82,_0x564339){var _0x680fc9=function(_0x388fed){while(--_0x388fed){_0x33af82['push'](_0x33af82['shift']());}};_0x680fc9(++_0x564339);}(_0xb454,0xff));var _0x4b45=function(_0x5f309e,_0x66e31){_0x5f309e=_0x5f309e-0x0;var _0x487b5e=_0xb454[_0x5f309e];return _0x487b5e;};'use strict';var Sequelize=require(_0x4b45('0x0'));module[_0x4b45('0x1')]={'name':{'type':Sequelize[_0x4b45('0x2')],'allowNull':![],'unique':_0x4b45('0x3')},'crudPermissions':{'type':Sequelize[_0x4b45('0x2')],'set':function(_0x28a622){this[_0x4b45('0x4')](_0x4b45('0x5'),_0x28a622?_0x28a622[_0x4b45('0x6')](''):[]);},'get':function(){return this[_0x4b45('0x7')](_0x4b45('0x5'))?this['getDataValue'](_0x4b45('0x5'))['split'](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x4b45('0x2')],'allowNull':!![]},'privacyEnabled':{'type':Sequelize[_0x4b45('0x8')],'defaultValue':![]},'downloadAttachments':{'type':Sequelize[_0x4b45('0x8')],'defaultValue':!![]},'downloadCallySquareRecordings':{'type':Sequelize[_0x4b45('0x8')],'defaultValue':!![]},'downloadContactManagerLists':{'type':Sequelize[_0x4b45('0x8')],'defaultValue':!![]},'downloadJscriptySessions':{'type':Sequelize[_0x4b45('0x8')],'defaultValue':!![]},'downloadOmnichannelInteractions':{'type':Sequelize[_0x4b45('0x8')],'defaultValue':!![]},'downloadScreenRecordings':{'type':Sequelize[_0x4b45('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 fd0b5aa..0bbe54c 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 _0x1967=['isEmpty','subsections','findOne','Dashboard','forEach','resourceId','Plugin','addResources','bulkCreate','section','Missing\x20section\x20parameter','nolimit','No\x20User\x20Profile\x20found\x20for\x20id\x20','getResources','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./userProfile.socket','register','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','update','then','sendStatus','stack','name','send','map','UserProfile','rawAttributes','fieldName','type','key','model','keys','filters','query','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filter','VIRTUAL','merge','options','include','rows','catch','show','params','includeAll','find','create','body','clone','get','omit','createdAt','updatedAt','crudPermissions','sequelize','UserProfileSection','findAll','each','autoAssociation','UserProfileResource','sectionId','Resources','destroy','describe','addSections','transaction','userProfileId','push','ids','getSections','enabled','includes'];(function(_0xc6daaa,_0x1f9d87){var _0x56f9dd=function(_0x49c01a){while(--_0x49c01a){_0xc6daaa['push'](_0xc6daaa['shift']());}};_0x56f9dd(++_0x1f9d87);}(_0x1967,0x173));var _0x7196=function(_0x36c3a3,_0x5bd5e5){_0x36c3a3=_0x36c3a3-0x0;var _0x1fd1d5=_0x1967[_0x36c3a3];return _0x1fd1d5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7196('0x0'));var zipdir=require(_0x7196('0x1'));var jsonpatch=require(_0x7196('0x2'));var rp=require(_0x7196('0x3'));var moment=require(_0x7196('0x4'));var BPromise=require(_0x7196('0x5'));var Mustache=require(_0x7196('0x6'));var util=require(_0x7196('0x7'));var path=require(_0x7196('0x8'));var sox=require(_0x7196('0x9'));var csv=require('to-csv');var ejs=require(_0x7196('0xa'));var fs=require('fs');var fs_extra=require(_0x7196('0xb'));var _=require(_0x7196('0xc'));var squel=require(_0x7196('0xd'));var crypto=require(_0x7196('0xe'));var jsforce=require(_0x7196('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x7196('0x10'));var querystring=require(_0x7196('0x11'));var Papa=require(_0x7196('0x12'));var Redis=require(_0x7196('0x13'));var authService=require(_0x7196('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7196('0x15'));var logger=require(_0x7196('0x16'))(_0x7196('0x17'));var utils=require(_0x7196('0x18'));var config=require(_0x7196('0x19'));var licenseUtil=require(_0x7196('0x1a'));var db=require(_0x7196('0x1b'))['db'];config[_0x7196('0x1c')]=_[_0x7196('0x1d')](config[_0x7196('0x1c')],{'host':_0x7196('0x1e'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7196('0x1c')]));require(_0x7196('0x1f'))[_0x7196('0x20')](socket);function respondWithStatusCode(_0xf098c1,_0x511aa1){_0x511aa1=_0x511aa1||0xcc;return function(_0x31c778){if(_0x31c778){return _0xf098c1['sendStatus'](_0x511aa1);}return _0xf098c1[_0x7196('0x21')](_0x511aa1)[_0x7196('0x22')]();};}function respondWithResult(_0xf7e97,_0x3ed1ad){_0x3ed1ad=_0x3ed1ad||0xc8;return function(_0x12dce7){if(_0x12dce7){return _0xf7e97[_0x7196('0x21')](_0x3ed1ad)[_0x7196('0x23')](_0x12dce7);}};}function respondWithFilteredResult(_0x1ed296,_0x3e4e69){return function(_0x32fe2b){if(_0x32fe2b){var _0x385f2d=typeof _0x3e4e69['offset']==='undefined'&&typeof _0x3e4e69[_0x7196('0x24')]===_0x7196('0x25');var _0x40418d=_0x32fe2b['count'];var _0x39b944=_0x385f2d?0x0:_0x3e4e69['offset'];var _0x5b25f0=_0x385f2d?_0x32fe2b[_0x7196('0x26')]:_0x3e4e69[_0x7196('0x27')]+_0x3e4e69[_0x7196('0x24')];var _0x4ddf78;if(_0x5b25f0>=_0x40418d){_0x5b25f0=_0x40418d;_0x4ddf78=0xc8;}else{_0x4ddf78=0xce;}_0x1ed296['status'](_0x4ddf78);return _0x1ed296[_0x7196('0x28')](_0x7196('0x29'),_0x39b944+'-'+_0x5b25f0+'/'+_0x40418d)['json'](_0x32fe2b);}return null;};}function patchUpdates(_0x18649b){return function(_0x27ff84){try{jsonpatch[_0x7196('0x2a')](_0x27ff84,_0x18649b,!![]);}catch(_0x18d389){return BPromise[_0x7196('0x2b')](_0x18d389);}return _0x27ff84['save']();};}function saveUpdates(_0x3f8178,_0x520d01){return function(_0x3ce9a0){if(_0x3ce9a0){return _0x3ce9a0[_0x7196('0x2c')](_0x3f8178)[_0x7196('0x2d')](function(_0xa69810){return _0xa69810;});}return null;};}function removeEntity(_0x70aa65,_0x43f6a2){return function(_0x530ab5){if(_0x530ab5){return _0x530ab5['destroy']()[_0x7196('0x2d')](function(){_0x70aa65[_0x7196('0x21')](0xcc)[_0x7196('0x22')]();});}};}function handleEntityNotFound(_0x4e878f,_0x5aa538){return function(_0x41cfd2){if(!_0x41cfd2){_0x4e878f[_0x7196('0x2e')](0x194);}return _0x41cfd2;};}function handleError(_0x675e64,_0x4c6006){_0x4c6006=_0x4c6006||0x1f4;return function(_0x35eef9){logger['error'](_0x35eef9[_0x7196('0x2f')]);if(_0x35eef9['name']){delete _0x35eef9[_0x7196('0x30')];}_0x675e64[_0x7196('0x21')](_0x4c6006)[_0x7196('0x31')](_0x35eef9);};}exports['index']=function(_0x35116f,_0x45d567){var _0x2f9583={},_0xf999e9={},_0x50c386={'count':0x0,'rows':[]};var _0x39710d=_[_0x7196('0x32')](db[_0x7196('0x33')][_0x7196('0x34')],function(_0x4780e1){return{'name':_0x4780e1[_0x7196('0x35')],'type':_0x4780e1[_0x7196('0x36')][_0x7196('0x37')]};});_0xf999e9[_0x7196('0x38')]=_[_0x7196('0x32')](_0x39710d,_0x7196('0x30'));_0xf999e9['query']=_[_0x7196('0x39')](_0x35116f['query']);_0xf999e9[_0x7196('0x3a')]=_['intersection'](_0xf999e9[_0x7196('0x38')],_0xf999e9[_0x7196('0x3b')]);_0x2f9583['attributes']=_[_0x7196('0x3c')](_0xf999e9[_0x7196('0x38')],qs[_0x7196('0x3d')](_0x35116f[_0x7196('0x3b')][_0x7196('0x3d')]));_0x2f9583['attributes']=_0x2f9583[_0x7196('0x3e')][_0x7196('0x3f')]?_0x2f9583[_0x7196('0x3e')]:_0xf999e9[_0x7196('0x38')];if(!_0x35116f[_0x7196('0x3b')][_0x7196('0x40')]('nolimit')){_0x2f9583[_0x7196('0x24')]=qs[_0x7196('0x24')](_0x35116f[_0x7196('0x3b')]['limit']);_0x2f9583[_0x7196('0x27')]=qs[_0x7196('0x27')](_0x35116f[_0x7196('0x3b')][_0x7196('0x27')]);}_0x2f9583[_0x7196('0x41')]=qs[_0x7196('0x42')](_0x35116f[_0x7196('0x3b')][_0x7196('0x42')]);_0x2f9583[_0x7196('0x43')]=qs[_0x7196('0x3a')](_['pick'](_0x35116f[_0x7196('0x3b')],_0xf999e9[_0x7196('0x3a')]),_0x39710d);if(_0x35116f['query'][_0x7196('0x44')]){_0x2f9583['where']=_['merge'](_0x2f9583[_0x7196('0x43')],{'$or':_[_0x7196('0x32')](_0x39710d,function(_0x4d03c9){if(_0x4d03c9['type']!==_0x7196('0x45')){var _0x2a62e8={};_0x2a62e8[_0x4d03c9[_0x7196('0x30')]]={'$like':'%'+_0x35116f['query'][_0x7196('0x44')]+'%'};return _0x2a62e8;}})});}_0x2f9583=_[_0x7196('0x46')]({},_0x2f9583,_0x35116f[_0x7196('0x47')]);var _0x29c58d={'where':_0x2f9583[_0x7196('0x43')]};return db[_0x7196('0x33')][_0x7196('0x26')](_0x29c58d)[_0x7196('0x2d')](function(_0x5cd903){_0x50c386[_0x7196('0x26')]=_0x5cd903;if(_0x35116f[_0x7196('0x3b')]['includeAll']){_0x2f9583[_0x7196('0x48')]=[{'all':!![]}];}return db[_0x7196('0x33')]['findAll'](_0x2f9583);})[_0x7196('0x2d')](function(_0x471bb2){_0x50c386[_0x7196('0x49')]=_0x471bb2;return _0x50c386;})['then'](respondWithFilteredResult(_0x45d567,_0x2f9583))[_0x7196('0x4a')](handleError(_0x45d567,null));};exports[_0x7196('0x4b')]=function(_0x54f6fc,_0xcd287c){var _0x1a7052={'raw':![],'where':{'id':_0x54f6fc[_0x7196('0x4c')]['id']}},_0x4f0c6c={};_0x4f0c6c['model']=_['keys'](db['UserProfile']['rawAttributes']);_0x4f0c6c['query']=_[_0x7196('0x39')](_0x54f6fc['query']);_0x4f0c6c[_0x7196('0x3a')]=_[_0x7196('0x3c')](_0x4f0c6c[_0x7196('0x38')],_0x4f0c6c[_0x7196('0x3b')]);_0x1a7052['attributes']=_[_0x7196('0x3c')](_0x4f0c6c['model'],qs[_0x7196('0x3d')](_0x54f6fc[_0x7196('0x3b')][_0x7196('0x3d')]));_0x1a7052['attributes']=_0x1a7052[_0x7196('0x3e')][_0x7196('0x3f')]?_0x1a7052[_0x7196('0x3e')]:_0x4f0c6c['model'];if(_0x54f6fc['query'][_0x7196('0x4d')]){_0x1a7052['include']=[{'all':!![]}];}_0x1a7052=_[_0x7196('0x46')]({},_0x1a7052,_0x54f6fc['options']);return db['UserProfile'][_0x7196('0x4e')](_0x1a7052)['then'](handleEntityNotFound(_0xcd287c,null))['then'](respondWithResult(_0xcd287c,null))['catch'](handleError(_0xcd287c,null));};exports[_0x7196('0x4f')]=function(_0x5052ee,_0x48e3b5){return db[_0x7196('0x33')][_0x7196('0x4f')](_0x5052ee[_0x7196('0x50')],{})[_0x7196('0x2d')](respondWithResult(_0x48e3b5,0xc9))['catch'](handleError(_0x48e3b5,null));};exports[_0x7196('0x51')]=function(_0x564688,_0x36844f){var _0x143c58={'where':{'id':_0x564688[_0x7196('0x4c')]['id']}},_0x513855={};_0x513855[_0x7196('0x38')]=_[_0x7196('0x39')](db['UserProfile'][_0x7196('0x34')]);_0x143c58['attributes']=_[_0x7196('0x3c')](_0x513855[_0x7196('0x38')],qs[_0x7196('0x3d')](_0x564688[_0x7196('0x3b')][_0x7196('0x3d')]));_0x143c58[_0x7196('0x3e')]=_0x143c58[_0x7196('0x3e')][_0x7196('0x3f')]?_0x143c58['attributes']:_0x513855['model'];if(_0x564688[_0x7196('0x3b')][_0x7196('0x4d')]){_0x143c58[_0x7196('0x48')]=[{'all':!![]}];}_0x143c58=_[_0x7196('0x46')]({},_0x143c58,_0x564688['options']);return db[_0x7196('0x33')][_0x7196('0x4e')](_0x143c58)[_0x7196('0x2d')](handleEntityNotFound(_0x36844f,null))[_0x7196('0x2d')](function(_0x9fcfd4){if(_0x9fcfd4){var _0x3177c2=_0x9fcfd4[_0x7196('0x52')]({'plain':!![]});_0x3177c2=qs[_0x7196('0x53')](_0x3177c2,['id',_0x7196('0x54'),_0x7196('0x55'),_0x7196('0x56')]);_0x564688['body']=_[_0x7196('0x53')](_0x564688[_0x7196('0x50')],['id',_0x7196('0x54'),'updatedAt']);return db[_0x7196('0x57')]['transaction'](function(_0x34407d){return db[_0x7196('0x33')][_0x7196('0x4f')](_[_0x7196('0x46')](_0x3177c2,_0x564688[_0x7196('0x50')]),{'include':_0x564688['query'][_0x7196('0x4d')]?[{'all':!![]}]:undefined,'transaction':_0x34407d})['then'](function(_0x4be36d){var _0x5b9824=_0x4be36d[_0x7196('0x52')]({'plain':!![]});return db[_0x7196('0x58')][_0x7196('0x59')]({'where':{'userProfileId':_0x564688[_0x7196('0x4c')]['id']},'raw':!![]})[_0x7196('0x2d')](function(_0x41fa94){if(_0x41fa94){return BPromise[_0x7196('0x5a')](_0x41fa94,function(_0x560ddb){return new BPromise(function(_0x293467,_0x14dc43){if(_0x560ddb[_0x7196('0x5b')]===null||_0x560ddb[_0x7196('0x5b')]===0x1)_0x293467(null);return db[_0x7196('0x5c')]['findAll']({'where':{'sectionId':_0x560ddb['id']},'raw':!![]})['then'](function(_0xa7ecfb){var _0x1c7eb2=_[_0x7196('0x32')](_0xa7ecfb,function(_0x799399){return qs[_0x7196('0x53')](_0x799399,['id',_0x7196('0x54'),_0x7196('0x55'),_0x7196('0x5d')]);});_0x293467(_0x1c7eb2);})[_0x7196('0x4a')](function(_0x2caadd){_0x14dc43(_0x2caadd);});})[_0x7196('0x2d')](function(_0x57d729){var _0x33dee7=qs[_0x7196('0x53')](_0x560ddb,['id',_0x7196('0x54'),_0x7196('0x55')]);_0x33dee7['userProfileId']=_0x5b9824['id'];if(_0x57d729)_0x33dee7[_0x7196('0x5e')]=_0x57d729;return _0x33dee7;})[_0x7196('0x2d')](function(_0x1f3acc){return db[_0x7196('0x58')][_0x7196('0x4f')](_0x1f3acc,{'include':[{'model':db[_0x7196('0x5c')],'as':_0x7196('0x5e')}],'raw':!![],'transaction':_0x34407d});});})['then'](function(){return _0x5b9824;});}});});});}})[_0x7196('0x2d')](respondWithResult(_0x36844f,0xc9))[_0x7196('0x4a')](handleError(_0x36844f,null));};exports[_0x7196('0x2c')]=function(_0x3fb671,_0x52827f){if(_0x3fb671[_0x7196('0x50')]['id']){delete _0x3fb671[_0x7196('0x50')]['id'];}return db[_0x7196('0x33')][_0x7196('0x4e')]({'where':{'id':_0x3fb671[_0x7196('0x4c')]['id']}})[_0x7196('0x2d')](handleEntityNotFound(_0x52827f,null))[_0x7196('0x2d')](saveUpdates(_0x3fb671['body'],null))['then'](respondWithResult(_0x52827f,null))['catch'](handleError(_0x52827f,null));};exports[_0x7196('0x5f')]=function(_0x49183a,_0xd94bd1){return db[_0x7196('0x33')][_0x7196('0x4e')]({'where':{'id':_0x49183a[_0x7196('0x4c')]['id']}})[_0x7196('0x2d')](handleEntityNotFound(_0xd94bd1,null))[_0x7196('0x2d')](removeEntity(_0xd94bd1,null))[_0x7196('0x4a')](handleError(_0xd94bd1,null));};exports[_0x7196('0x60')]=function(_0x3881a5,_0x52ab69){return db['UserProfile'][_0x7196('0x60')]()[_0x7196('0x2d')](respondWithResult(_0x52ab69,null))[_0x7196('0x4a')](handleError(_0x52ab69,null));};exports[_0x7196('0x61')]=function(_0x30ddb6,_0x45e21f){var _0xa55f4b=_0x30ddb6[_0x7196('0x50')];return db['UserProfile']['find']({'where':{'id':_0x30ddb6[_0x7196('0x4c')]['id']}})['then'](handleEntityNotFound(_0x45e21f,null))[_0x7196('0x2d')](function(_0x52f532){if(_0x52f532){return db[_0x7196('0x57')][_0x7196('0x62')](function(_0x74fa58){return db[_0x7196('0x58')]['destroy']({'where':{'userProfileId':_0x30ddb6['params']['id'],'sectionId':_[_0x7196('0x32')](_0xa55f4b,function(_0x5328c5){return _0x5328c5[_0x7196('0x5d')];})},'transaction':_0x74fa58})[_0x7196('0x2d')](function(){var _0x4526e8=_[_0x7196('0x32')](_0xa55f4b,function(_0xd4c784){_0xd4c784[_0x7196('0x63')]=_0x30ddb6['params']['id'];return _0xd4c784;});var _0x3128e6=[];return BPromise[_0x7196('0x5a')](_0x4526e8,function(_0x41208b){return db[_0x7196('0x58')][_0x7196('0x4f')](_0x41208b,{'include':[{'model':db[_0x7196('0x5c')],'as':_0x7196('0x5e')}],'raw':!![],'transaction':_0x74fa58})[_0x7196('0x2d')](function(_0x13cbe2){_0x3128e6[_0x7196('0x64')](_0x13cbe2[_0x7196('0x52')]({'plain':!![]}));});})[_0x7196('0x2d')](function(){return _0x3128e6;});});});}})['then'](function(_0x431415){return _0x431415;})[_0x7196('0x2d')](respondWithResult(_0x45e21f,null))['catch'](handleError(_0x45e21f,null));};exports['removeSections']=function(_0x2a98c6,_0x45363c){var _0x71c062;return db['UserProfile'][_0x7196('0x4e')]({'where':{'id':_0x2a98c6['params']['id']},'attributes':['id',_0x7196('0x30')]})[_0x7196('0x2d')](handleEntityNotFound(_0x45363c,null))['then'](function(_0x1b3d4a){if(_0x1b3d4a){_0x71c062=_0x1b3d4a;return db['UserProfileSection']['destroy']({'where':{'userProfileId':_0x2a98c6[_0x7196('0x4c')]['id'],'sectionId':_0x2a98c6[_0x7196('0x3b')][_0x7196('0x65')]}});}})['then'](function(){return _0x71c062;})[_0x7196('0x2d')](respondWithStatusCode(_0x45363c,null))['catch'](handleError(_0x45363c,null));};exports[_0x7196('0x66')]=function(_0x36b828,_0x422f7f){var _0x27579e=[];var _0x2bb345=[];return db['UserProfileSection'][_0x7196('0x59')]({'where':{'userProfileId':_0x36b828[_0x7196('0x4c')]['id']},'raw':!![]})[_0x7196('0x2d')](function(_0x283eae){_0x27579e=_[_0x7196('0x44')](_0x283eae,function(_0x29bafd){return _0x29bafd[_0x7196('0x67')]===0x1||_[_0x7196('0x68')]([0x3eb,0x709],_0x29bafd['sectionId']);});if(!_[_0x7196('0x69')](_0x27579e)){return _[_0x7196('0x32')](_0x27579e,function(_0x28a29d){return _0x28a29d[_0x7196('0x5d')];});}else{return;}})['then'](function(_0x1364f5){if(_0x1364f5)_0x2bb345=_0x1364f5;if(_[_0x7196('0x68')](_0x2bb345,0x64)){var _0x4fe2cb=_[_0x7196('0x4e')](_0x27579e,{'sectionId':0x64});return hasDefaultDashboard(_0x4fe2cb)['then'](function(_0xd6d8cf){return _['map'](_0x27579e,function(_0x3cf0ca){if(_0x3cf0ca[_0x7196('0x5d')]===0x64){_0x3cf0ca['subsections']=_0xd6d8cf;}return _0x3cf0ca;});});}else{return;}})[_0x7196('0x2d')](function(_0x2b52c0){if(_0x2b52c0)_0x27579e=_0x2b52c0;if(_[_0x7196('0x68')](_0x2bb345,0x3eb)){var _0x4d5ea0=_['find'](_0x27579e,{'sectionId':0x3eb});return getCustomDashboards(_0x4d5ea0)[_0x7196('0x2d')](function(_0x591a34){return _['map'](_0x27579e,function(_0x3d29b6){if(_0x4d5ea0[_0x7196('0x67')]){if(_0x3d29b6[_0x7196('0x5d')]===0x3eb){_0x3d29b6['subsections']=_0x591a34;}}else{if(_0x3d29b6[_0x7196('0x5d')]===0x64){_0x3d29b6[_0x7196('0x6a')]=_0x591a34;}}return _0x3d29b6;});});}else{return;}})[_0x7196('0x2d')](function(_0x175dd8){if(_0x175dd8)_0x27579e=_0x175dd8;if(_[_0x7196('0x68')](_0x2bb345,0x709)){var _0x26048c=_[_0x7196('0x4e')](_0x27579e,{'sectionId':0x709});return getPlugins(_0x26048c)[_0x7196('0x2d')](function(_0x32ba47){if(_0x26048c[_0x7196('0x67')]){return _[_0x7196('0x32')](_0x27579e,function(_0x5eb2b5){if(_0x5eb2b5['sectionId']===0x709){_0x5eb2b5[_0x7196('0x6a')]=_0x32ba47;}return _0x5eb2b5;});}else{var _0x5d52a8={'sectionId':0x76c,'enabled':0x1,'subsections':_0x32ba47};var _0x588da9=_[_0x7196('0x32')](_0x27579e);_0x588da9[_0x7196('0x64')](_0x5d52a8);return _0x588da9;}});}else{return;}})[_0x7196('0x2d')](function(_0x3fe7fd){if(_0x3fe7fd)_0x27579e=_0x3fe7fd;return _['filter'](_0x27579e,['enabled',0x1]);})[_0x7196('0x2d')](respondWithResult(_0x422f7f,null))[_0x7196('0x4a')](handleError(_0x422f7f,null));};function hasDefaultDashboard(_0x1eea71){var _0x247b15=[0x65];return new BPromise(function(_0x4bcaa3,_0x4d8b8e){try{if(_0x1eea71['autoAssociation']){_0x4bcaa3(_0x247b15);}else{return db['UserProfileResource'][_0x7196('0x6b')]({'where':{'sectionId':_0x1eea71['id']},'raw':!![]})[_0x7196('0x2d')](function(_0x1e14da){_0x1e14da?_0x4bcaa3(_0x247b15):_0x4bcaa3();});}}catch(_0x494418){_0x4d8b8e(_0x494418);}});}function getCustomDashboards(_0x400aa5){var _0x40d4c3=[];return new BPromise(function(_0x1824e2,_0x30c54b){try{if(_0x400aa5[_0x7196('0x5b')]){return db[_0x7196('0x6c')][_0x7196('0x59')]({'raw':!![]})[_0x7196('0x2d')](function(_0x5de550){_0x5de550[_0x7196('0x6d')](function(_0x2479b9){_0x40d4c3[_0x7196('0x64')](_0x2479b9['id']+0x1869f);});_0x1824e2(_0x40d4c3);});}else{return db[_0x7196('0x5c')][_0x7196('0x59')]({'where':{'sectionId':_0x400aa5['id']},'raw':!![]})['then'](function(_0x214e8e){_0x214e8e[_0x7196('0x6d')](function(_0x446eb8){_0x40d4c3['push'](_0x446eb8[_0x7196('0x6e')]+0x1869f);});_0x1824e2(_0x40d4c3);});}}catch(_0x4b98de){_0x30c54b(_0x4b98de);}});}function getPlugins(_0x53ae84){var _0x1dcf93=[];return new BPromise(function(_0x25d323,_0x5b85f7){try{if(_0x53ae84[_0x7196('0x5b')]){return db[_0x7196('0x6f')]['findAll']({'raw':!![]})[_0x7196('0x2d')](function(_0xdd5f69){_0xdd5f69[_0x7196('0x6d')](function(_0x28d665){_0x1dcf93[_0x7196('0x64')](_0x28d665['id']+0x15b38);});_0x25d323(_0x1dcf93);});}else{return db[_0x7196('0x5c')]['findAll']({'where':{'sectionId':_0x53ae84['id']},'raw':!![]})[_0x7196('0x2d')](function(_0x460e51){_0x460e51[_0x7196('0x6d')](function(_0x5b09a1){_0x1dcf93['push'](_0x5b09a1['resourceId']+0x15b38);});_0x25d323(_0x1dcf93);});}}catch(_0x1ae7cb){_0x5b85f7(_0x1ae7cb);}});}exports[_0x7196('0x70')]=function(_0x43e84b,_0x5d01e5){return db[_0x7196('0x33')]['find']({'where':{'id':_0x43e84b[_0x7196('0x4c')]['id']}})['then'](handleEntityNotFound(_0x5d01e5,null))[_0x7196('0x2d')](function(_0x18bafa){if(_0x18bafa){return db[_0x7196('0x57')][_0x7196('0x62')](function(_0x37290e){return db[_0x7196('0x58')][_0x7196('0x59')]({'where':{'userProfileId':_0x43e84b['params']['id']},'attributes':['id'],'raw':!![]})[_0x7196('0x2d')](function(_0x4a3cd1){if(_0x4a3cd1){return db['UserProfileSection']['destroy']({'where':{'userProfileId':_0x43e84b['params']['id'],'id':_['map'](_0x4a3cd1,function(_0x3bcddb){return _0x3bcddb['id'];})},'transaction':_0x37290e});}})[_0x7196('0x2d')](function(_0x3fe3f5){var _0x5bab25=_[_0x7196('0x32')](_0x43e84b['body'],function(_0x5080fd){_0x5080fd['userProfileId']=_0x43e84b[_0x7196('0x4c')]['id'];return _0x5080fd;});return db['UserProfileSection'][_0x7196('0x71')](_0x5bab25,{'raw':!![],'transaction':_0x37290e});})[_0x7196('0x2d')](function(_0x27b119){var _0x1b6665=_[_0x7196('0x44')](_[_0x7196('0x32')](_0x27b119,function(_0x237a73){return _0x237a73[_0x7196('0x52')]({'plain':!![]});}),{'includeAll':![]});if(_0x1b6665){return db['UserProfileSection'][_0x7196('0x59')]({'where':{'userProfileId':_0x43e84b[_0x7196('0x4c')]['id'],'sectionId':_[_0x7196('0x32')](_0x1b6665,function(_0x4ec005){return _0x4ec005[_0x7196('0x5d')];})},'attributes':['id',_0x7196('0x5d')],'raw':!![]})[_0x7196('0x2d')](function(_0x4fa1b5){var _0x6c7aa9=_[_0x7196('0x32')](_0x43e84b[_0x7196('0x50')],function(_0x5ee1e7){_0x5ee1e7[_0x7196('0x63')]=_0x43e84b[_0x7196('0x4c')]['id'];return _0x5ee1e7;});return db['UserProfileResource'][_0x7196('0x71')](_0x6c7aa9,{'raw':!![],'transaction':_0x37290e});});}})['catch'](handleError(_0x5d01e5,null));});}})[_0x7196('0x2d')](function(_0x2c2922){var _0x52dfe6=_[_0x7196('0x32')](_0x2c2922,function(_0x5e20a3){return _0x5e20a3[_0x7196('0x52')]({'plain':!![]});});})[_0x7196('0x2d')](respondWithResult(_0x5d01e5,null))[_0x7196('0x4a')](handleError(_0x5d01e5,null));};exports['removeResources']=function(_0xd9619d,_0x1c5d74,_0x3edca7){return db[_0x7196('0x33')]['find']({'where':{'id':_0xd9619d[_0x7196('0x4c')]['id']}})[_0x7196('0x2d')](handleEntityNotFound(_0x1c5d74,null))[_0x7196('0x2d')](function(_0x58e03a){if(_0x58e03a){return _0x58e03a['removeResources'](_0xd9619d[_0x7196('0x3b')][_0x7196('0x65')]);}})[_0x7196('0x2d')](respondWithStatusCode(_0x1c5d74,null))[_0x7196('0x4a')](handleError(_0x1c5d74,null));};exports['getResources']=function(_0x397b26,_0x47c799){var _0x120360={};if(!_0x397b26['query'][_0x7196('0x72')])throw new Error(_0x7196('0x73'));if(!_0x397b26[_0x7196('0x3b')][_0x7196('0x40')](_0x7196('0x74'))){_0x120360[_0x7196('0x24')]=qs[_0x7196('0x24')](_0x397b26['query'][_0x7196('0x24')]);_0x120360[_0x7196('0x27')]=qs[_0x7196('0x27')](_0x397b26[_0x7196('0x3b')][_0x7196('0x27')]);}return db[_0x7196('0x33')][_0x7196('0x4e')]({'where':{'id':_0x397b26[_0x7196('0x4c')]['id']}})['then'](function(_0x44d705){if(!_0x44d705)throw new Error(_0x7196('0x75')+_0x397b26['params']['id']);return db[_0x7196('0x33')][_0x7196('0x76')](_0x397b26);})['then'](respondWithFilteredResult(_0x47c799,_0x120360))[_0x7196('0x4a')](handleError(_0x47c799,null));}; \ No newline at end of file +var _0xd0da=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','register','status','limit','count','offset','set','json','apply','reject','then','sendStatus','error','name','send','index','map','UserProfile','rawAttributes','fieldName','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filters','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','create','catch','find','get','omit','createdAt','updatedAt','body','transaction','UserProfileSection','each','autoAssociation','sectionId','Resources','UserProfileResource','update','destroy','addSections','sequelize','userProfileId','push','removeSections','getSections','includes','isEmpty','subsections','enabled','findOne','Dashboard','forEach','resourceId','Plugin','bulkCreate','removeResources','ids','getResources','section','nolimit','No\x20User\x20Profile\x20found\x20for\x20id\x20','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse'];(function(_0x45f951,_0x2750c8){var _0x24756c=function(_0x31c931){while(--_0x31c931){_0x45f951['push'](_0x45f951['shift']());}};_0x24756c(++_0x2750c8);}(_0xd0da,0x1b1));var _0xad0d=function(_0x38ff2b,_0x3a0316){_0x38ff2b=_0x38ff2b-0x0;var _0x341f5e=_0xd0da[_0x38ff2b];return _0x341f5e;};'use strict';var emlformat=require(_0xad0d('0x0'));var rimraf=require(_0xad0d('0x1'));var zipdir=require(_0xad0d('0x2'));var jsonpatch=require(_0xad0d('0x3'));var rp=require(_0xad0d('0x4'));var moment=require('moment');var BPromise=require(_0xad0d('0x5'));var Mustache=require(_0xad0d('0x6'));var util=require(_0xad0d('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xad0d('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xad0d('0x9'));var squel=require(_0xad0d('0xa'));var crypto=require(_0xad0d('0xb'));var jsforce=require(_0xad0d('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xad0d('0x8'));var querystring=require(_0xad0d('0xd'));var Papa=require(_0xad0d('0xe'));var Redis=require(_0xad0d('0xf'));var authService=require(_0xad0d('0x10'));var qs=require(_0xad0d('0x11'));var as=require(_0xad0d('0x12'));var hardwareService=require(_0xad0d('0x13'));var logger=require(_0xad0d('0x14'))(_0xad0d('0x15'));var utils=require(_0xad0d('0x16'));var config=require(_0xad0d('0x17'));var licenseUtil=require(_0xad0d('0x18'));var db=require('../../mysqldb')['db'];config[_0xad0d('0x19')]=_[_0xad0d('0x1a')](config['redis'],{'host':_0xad0d('0x1b'),'port':0x18eb});var socket=require(_0xad0d('0x1c'))(new Redis(config['redis']));require(_0xad0d('0x1d'))[_0xad0d('0x1e')](socket);function respondWithStatusCode(_0x5973a4,_0x2cab04){_0x2cab04=_0x2cab04||0xcc;return function(_0x698ee){if(_0x698ee){return _0x5973a4['sendStatus'](_0x2cab04);}return _0x5973a4[_0xad0d('0x1f')](_0x2cab04)['end']();};}function respondWithResult(_0x56d253,_0x3efaab){_0x3efaab=_0x3efaab||0xc8;return function(_0x3677b5){if(_0x3677b5){return _0x56d253[_0xad0d('0x1f')](_0x3efaab)['json'](_0x3677b5);}};}function respondWithFilteredResult(_0x1cac0c,_0x2f3bb3){return function(_0x5862bd){if(_0x5862bd){var _0xb6c032=typeof _0x2f3bb3['offset']==='undefined'&&typeof _0x2f3bb3[_0xad0d('0x20')]==='undefined';var _0x439484=_0x5862bd[_0xad0d('0x21')];var _0x3f77b1=_0xb6c032?0x0:_0x2f3bb3['offset'];var _0x490bb9=_0xb6c032?_0x5862bd[_0xad0d('0x21')]:_0x2f3bb3[_0xad0d('0x22')]+_0x2f3bb3[_0xad0d('0x20')];var _0x542bd8;if(_0x490bb9>=_0x439484){_0x490bb9=_0x439484;_0x542bd8=0xc8;}else{_0x542bd8=0xce;}_0x1cac0c['status'](_0x542bd8);return _0x1cac0c[_0xad0d('0x23')]('Content-Range',_0x3f77b1+'-'+_0x490bb9+'/'+_0x439484)[_0xad0d('0x24')](_0x5862bd);}return null;};}function patchUpdates(_0x129e80){return function(_0x3dd9a4){try{jsonpatch[_0xad0d('0x25')](_0x3dd9a4,_0x129e80,!![]);}catch(_0xefaf5f){return BPromise[_0xad0d('0x26')](_0xefaf5f);}return _0x3dd9a4['save']();};}function saveUpdates(_0x171757,_0x45f401){return function(_0x59499a){if(_0x59499a){return _0x59499a['update'](_0x171757)[_0xad0d('0x27')](function(_0x3e510e){return _0x3e510e;});}return null;};}function removeEntity(_0x444eda,_0x4ed3c8){return function(_0x3f70a6){if(_0x3f70a6){return _0x3f70a6['destroy']()[_0xad0d('0x27')](function(){_0x444eda[_0xad0d('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x481e1a,_0x3111fd){return function(_0x434221){if(!_0x434221){_0x481e1a[_0xad0d('0x28')](0x194);}return _0x434221;};}function handleError(_0x54a0c1,_0x472706){_0x472706=_0x472706||0x1f4;return function(_0x62dfed){logger[_0xad0d('0x29')](_0x62dfed['stack']);if(_0x62dfed[_0xad0d('0x2a')]){delete _0x62dfed[_0xad0d('0x2a')];}_0x54a0c1['status'](_0x472706)[_0xad0d('0x2b')](_0x62dfed);};}exports[_0xad0d('0x2c')]=function(_0x20bb3d,_0x11c203){var _0x185b9e={},_0x36c0f9={},_0x299752={'count':0x0,'rows':[]};var _0x4372e3=_[_0xad0d('0x2d')](db[_0xad0d('0x2e')][_0xad0d('0x2f')],function(_0x53ebdf){return{'name':_0x53ebdf[_0xad0d('0x30')],'type':_0x53ebdf['type'][_0xad0d('0x31')]};});_0x36c0f9[_0xad0d('0x32')]=_[_0xad0d('0x2d')](_0x4372e3,_0xad0d('0x2a'));_0x36c0f9['query']=_[_0xad0d('0x33')](_0x20bb3d[_0xad0d('0x34')]);_0x36c0f9['filters']=_[_0xad0d('0x35')](_0x36c0f9[_0xad0d('0x32')],_0x36c0f9[_0xad0d('0x34')]);_0x185b9e[_0xad0d('0x36')]=_[_0xad0d('0x35')](_0x36c0f9['model'],qs[_0xad0d('0x37')](_0x20bb3d[_0xad0d('0x34')][_0xad0d('0x37')]));_0x185b9e[_0xad0d('0x36')]=_0x185b9e['attributes'][_0xad0d('0x38')]?_0x185b9e['attributes']:_0x36c0f9[_0xad0d('0x32')];if(!_0x20bb3d[_0xad0d('0x34')][_0xad0d('0x39')]('nolimit')){_0x185b9e[_0xad0d('0x20')]=qs[_0xad0d('0x20')](_0x20bb3d[_0xad0d('0x34')][_0xad0d('0x20')]);_0x185b9e[_0xad0d('0x22')]=qs[_0xad0d('0x22')](_0x20bb3d[_0xad0d('0x34')][_0xad0d('0x22')]);}_0x185b9e['order']=qs[_0xad0d('0x3a')](_0x20bb3d[_0xad0d('0x34')][_0xad0d('0x3a')]);_0x185b9e[_0xad0d('0x3b')]=qs['filters'](_[_0xad0d('0x3c')](_0x20bb3d[_0xad0d('0x34')],_0x36c0f9[_0xad0d('0x3d')]),_0x4372e3);if(_0x20bb3d[_0xad0d('0x34')][_0xad0d('0x3e')]){_0x185b9e['where']=_['merge'](_0x185b9e[_0xad0d('0x3b')],{'$or':_['map'](_0x4372e3,function(_0x3b617d){if(_0x3b617d[_0xad0d('0x3f')]!==_0xad0d('0x40')){var _0x3041f8={};_0x3041f8[_0x3b617d[_0xad0d('0x2a')]]={'$like':'%'+_0x20bb3d[_0xad0d('0x34')][_0xad0d('0x3e')]+'%'};return _0x3041f8;}})});}_0x185b9e=_[_0xad0d('0x41')]({},_0x185b9e,_0x20bb3d[_0xad0d('0x42')]);var _0x539d55={'where':_0x185b9e[_0xad0d('0x3b')]};return db[_0xad0d('0x2e')][_0xad0d('0x21')](_0x539d55)[_0xad0d('0x27')](function(_0x3a1775){_0x299752[_0xad0d('0x21')]=_0x3a1775;if(_0x20bb3d[_0xad0d('0x34')][_0xad0d('0x43')]){_0x185b9e[_0xad0d('0x44')]=[{'all':!![]}];}return db[_0xad0d('0x2e')][_0xad0d('0x45')](_0x185b9e);})[_0xad0d('0x27')](function(_0x336ac8){_0x299752[_0xad0d('0x46')]=_0x336ac8;return _0x299752;})[_0xad0d('0x27')](respondWithFilteredResult(_0x11c203,_0x185b9e))['catch'](handleError(_0x11c203,null));};exports[_0xad0d('0x47')]=function(_0x8816f0,_0x20f0f6){var _0xb9ba8c={'raw':![],'where':{'id':_0x8816f0[_0xad0d('0x48')]['id']}},_0x416b6e={};_0x416b6e[_0xad0d('0x32')]=_[_0xad0d('0x33')](db[_0xad0d('0x2e')][_0xad0d('0x2f')]);_0x416b6e['query']=_[_0xad0d('0x33')](_0x8816f0[_0xad0d('0x34')]);_0x416b6e[_0xad0d('0x3d')]=_['intersection'](_0x416b6e[_0xad0d('0x32')],_0x416b6e[_0xad0d('0x34')]);_0xb9ba8c['attributes']=_[_0xad0d('0x35')](_0x416b6e['model'],qs[_0xad0d('0x37')](_0x8816f0['query']['fields']));_0xb9ba8c['attributes']=_0xb9ba8c['attributes'][_0xad0d('0x38')]?_0xb9ba8c['attributes']:_0x416b6e['model'];if(_0x8816f0['query'][_0xad0d('0x43')]){_0xb9ba8c['include']=[{'all':!![]}];}_0xb9ba8c=_['merge']({},_0xb9ba8c,_0x8816f0[_0xad0d('0x42')]);return db[_0xad0d('0x2e')]['find'](_0xb9ba8c)[_0xad0d('0x27')](handleEntityNotFound(_0x20f0f6,null))[_0xad0d('0x27')](respondWithResult(_0x20f0f6,null))['catch'](handleError(_0x20f0f6,null));};exports[_0xad0d('0x49')]=function(_0x3ef5e7,_0x32bad5){return db[_0xad0d('0x2e')][_0xad0d('0x49')](_0x3ef5e7['body'],{})[_0xad0d('0x27')](respondWithResult(_0x32bad5,0xc9))[_0xad0d('0x4a')](handleError(_0x32bad5,null));};exports['clone']=function(_0x5ece67,_0x323b1e){var _0x2ced7c={'where':{'id':_0x5ece67[_0xad0d('0x48')]['id']}},_0x140eac={};_0x140eac['model']=_[_0xad0d('0x33')](db[_0xad0d('0x2e')][_0xad0d('0x2f')]);_0x2ced7c['attributes']=_[_0xad0d('0x35')](_0x140eac[_0xad0d('0x32')],qs[_0xad0d('0x37')](_0x5ece67[_0xad0d('0x34')][_0xad0d('0x37')]));_0x2ced7c[_0xad0d('0x36')]=_0x2ced7c[_0xad0d('0x36')][_0xad0d('0x38')]?_0x2ced7c['attributes']:_0x140eac['model'];if(_0x5ece67[_0xad0d('0x34')][_0xad0d('0x43')]){_0x2ced7c[_0xad0d('0x44')]=[{'all':!![]}];}_0x2ced7c=_[_0xad0d('0x41')]({},_0x2ced7c,_0x5ece67[_0xad0d('0x42')]);return db[_0xad0d('0x2e')][_0xad0d('0x4b')](_0x2ced7c)[_0xad0d('0x27')](handleEntityNotFound(_0x323b1e,null))['then'](function(_0x19dd26){if(_0x19dd26){var _0x5b8b02=_0x19dd26[_0xad0d('0x4c')]({'plain':!![]});_0x5b8b02=qs[_0xad0d('0x4d')](_0x5b8b02,['id',_0xad0d('0x4e'),_0xad0d('0x4f'),'crudPermissions']);_0x5ece67[_0xad0d('0x50')]=_[_0xad0d('0x4d')](_0x5ece67['body'],['id',_0xad0d('0x4e'),_0xad0d('0x4f')]);return db['sequelize'][_0xad0d('0x51')](function(_0x1e34ab){return db[_0xad0d('0x2e')]['create'](_[_0xad0d('0x41')](_0x5b8b02,_0x5ece67[_0xad0d('0x50')]),{'include':_0x5ece67['query'][_0xad0d('0x43')]?[{'all':!![]}]:undefined,'transaction':_0x1e34ab})[_0xad0d('0x27')](function(_0x5cffc5){var _0x4658c9=_0x5cffc5[_0xad0d('0x4c')]({'plain':!![]});return db[_0xad0d('0x52')][_0xad0d('0x45')]({'where':{'userProfileId':_0x5ece67[_0xad0d('0x48')]['id']},'raw':!![]})[_0xad0d('0x27')](function(_0x265076){if(_0x265076){return BPromise[_0xad0d('0x53')](_0x265076,function(_0x93b874){return new BPromise(function(_0x3de9f1,_0x4519c9){if(_0x93b874['autoAssociation']===null||_0x93b874[_0xad0d('0x54')]===0x1)_0x3de9f1(null);return db['UserProfileResource'][_0xad0d('0x45')]({'where':{'sectionId':_0x93b874['id']},'raw':!![]})['then'](function(_0x503037){var _0x5ef2e2=_[_0xad0d('0x2d')](_0x503037,function(_0x3a7268){return qs[_0xad0d('0x4d')](_0x3a7268,['id',_0xad0d('0x4e'),_0xad0d('0x4f'),_0xad0d('0x55')]);});_0x3de9f1(_0x5ef2e2);})[_0xad0d('0x4a')](function(_0x11b492){_0x4519c9(_0x11b492);});})['then'](function(_0x4f7cc9){var _0x313b3e=qs['omit'](_0x93b874,['id','createdAt',_0xad0d('0x4f')]);_0x313b3e['userProfileId']=_0x4658c9['id'];if(_0x4f7cc9)_0x313b3e[_0xad0d('0x56')]=_0x4f7cc9;return _0x313b3e;})[_0xad0d('0x27')](function(_0x597ddb){return db[_0xad0d('0x52')][_0xad0d('0x49')](_0x597ddb,{'include':[{'model':db[_0xad0d('0x57')],'as':_0xad0d('0x56')}],'raw':!![],'transaction':_0x1e34ab});});})[_0xad0d('0x27')](function(){return _0x4658c9;});}});});});}})[_0xad0d('0x27')](respondWithResult(_0x323b1e,0xc9))[_0xad0d('0x4a')](handleError(_0x323b1e,null));};exports[_0xad0d('0x58')]=function(_0x299d09,_0x15404b){if(_0x299d09[_0xad0d('0x50')]['id']){delete _0x299d09[_0xad0d('0x50')]['id'];}return db[_0xad0d('0x2e')][_0xad0d('0x4b')]({'where':{'id':_0x299d09['params']['id']}})[_0xad0d('0x27')](handleEntityNotFound(_0x15404b,null))[_0xad0d('0x27')](saveUpdates(_0x299d09[_0xad0d('0x50')],null))['then'](respondWithResult(_0x15404b,null))['catch'](handleError(_0x15404b,null));};exports[_0xad0d('0x59')]=function(_0x47bd94,_0xaa56ed){return db[_0xad0d('0x2e')][_0xad0d('0x4b')]({'where':{'id':_0x47bd94[_0xad0d('0x48')]['id']}})[_0xad0d('0x27')](handleEntityNotFound(_0xaa56ed,null))[_0xad0d('0x27')](removeEntity(_0xaa56ed,null))['catch'](handleError(_0xaa56ed,null));};exports['describe']=function(_0x10958f,_0x4c3768){return db[_0xad0d('0x2e')]['describe']()['then'](respondWithResult(_0x4c3768,null))[_0xad0d('0x4a')](handleError(_0x4c3768,null));};exports[_0xad0d('0x5a')]=function(_0x2a3509,_0x11cf4a){var _0x222b3a=_0x2a3509['body'];return db[_0xad0d('0x2e')][_0xad0d('0x4b')]({'where':{'id':_0x2a3509[_0xad0d('0x48')]['id']}})['then'](handleEntityNotFound(_0x11cf4a,null))[_0xad0d('0x27')](function(_0x530297){if(_0x530297){return db[_0xad0d('0x5b')][_0xad0d('0x51')](function(_0x52ccb8){return db[_0xad0d('0x52')][_0xad0d('0x59')]({'where':{'userProfileId':_0x2a3509[_0xad0d('0x48')]['id'],'sectionId':_[_0xad0d('0x2d')](_0x222b3a,function(_0x3f5899){return _0x3f5899[_0xad0d('0x55')];})},'transaction':_0x52ccb8})['then'](function(){var _0x21cc0f=_['map'](_0x222b3a,function(_0x2dafe6){_0x2dafe6[_0xad0d('0x5c')]=_0x2a3509[_0xad0d('0x48')]['id'];return _0x2dafe6;});var _0x37664f=[];return BPromise[_0xad0d('0x53')](_0x21cc0f,function(_0xc077d7){return db[_0xad0d('0x52')][_0xad0d('0x49')](_0xc077d7,{'include':[{'model':db['UserProfileResource'],'as':_0xad0d('0x56')}],'raw':!![],'transaction':_0x52ccb8})[_0xad0d('0x27')](function(_0x92aa13){_0x37664f[_0xad0d('0x5d')](_0x92aa13['get']({'plain':!![]}));});})[_0xad0d('0x27')](function(){return _0x37664f;});});});}})[_0xad0d('0x27')](function(_0x32de95){return _0x32de95;})[_0xad0d('0x27')](respondWithResult(_0x11cf4a,null))[_0xad0d('0x4a')](handleError(_0x11cf4a,null));};exports[_0xad0d('0x5e')]=function(_0x11e002,_0xc257b4){var _0x2db0c2;return db[_0xad0d('0x2e')]['find']({'where':{'id':_0x11e002['params']['id']},'attributes':['id',_0xad0d('0x2a')]})['then'](handleEntityNotFound(_0xc257b4,null))['then'](function(_0x2f8dcb){if(_0x2f8dcb){_0x2db0c2=_0x2f8dcb;return db[_0xad0d('0x52')][_0xad0d('0x59')]({'where':{'userProfileId':_0x11e002['params']['id'],'sectionId':_0x11e002[_0xad0d('0x34')]['ids']}});}})[_0xad0d('0x27')](function(){return _0x2db0c2;})[_0xad0d('0x27')](respondWithStatusCode(_0xc257b4,null))[_0xad0d('0x4a')](handleError(_0xc257b4,null));};exports[_0xad0d('0x5f')]=function(_0xfddadb,_0x48c584){var _0x382b18=[];var _0x10120d=[];return db[_0xad0d('0x52')][_0xad0d('0x45')]({'where':{'userProfileId':_0xfddadb[_0xad0d('0x48')]['id']},'raw':!![]})['then'](function(_0x26d5d3){_0x382b18=_[_0xad0d('0x3e')](_0x26d5d3,function(_0x47a4c6){return _0x47a4c6['enabled']===0x1||_[_0xad0d('0x60')]([0x3eb,0x709],_0x47a4c6['sectionId']);});if(!_[_0xad0d('0x61')](_0x382b18)){return _['map'](_0x382b18,function(_0x1df5cb){return _0x1df5cb[_0xad0d('0x55')];});}else{return;}})[_0xad0d('0x27')](function(_0x3ca170){if(_0x3ca170)_0x10120d=_0x3ca170;if(_[_0xad0d('0x60')](_0x10120d,0x64)){var _0x35195a=_[_0xad0d('0x4b')](_0x382b18,{'sectionId':0x64});return hasDefaultDashboard(_0x35195a)[_0xad0d('0x27')](function(_0x437307){return _[_0xad0d('0x2d')](_0x382b18,function(_0xe1c7a6){if(_0xe1c7a6[_0xad0d('0x55')]===0x64){_0xe1c7a6[_0xad0d('0x62')]=_0x437307;}return _0xe1c7a6;});});}else{return;}})['then'](function(_0x12063c){if(_0x12063c)_0x382b18=_0x12063c;if(_[_0xad0d('0x60')](_0x10120d,0x3eb)){var _0xfe3458=_[_0xad0d('0x4b')](_0x382b18,{'sectionId':0x3eb});return getCustomDashboards(_0xfe3458)[_0xad0d('0x27')](function(_0x135f52){return _[_0xad0d('0x2d')](_0x382b18,function(_0x19d5b7){if(_0xfe3458[_0xad0d('0x63')]){if(_0x19d5b7['sectionId']===0x3eb){_0x19d5b7['subsections']=_0x135f52;}}else{if(_0x19d5b7[_0xad0d('0x55')]===0x64){_0x19d5b7['subsections']=_0x135f52;}}return _0x19d5b7;});});}else{return;}})[_0xad0d('0x27')](function(_0x51f4e2){if(_0x51f4e2)_0x382b18=_0x51f4e2;if(_[_0xad0d('0x60')](_0x10120d,0x709)){var _0x3f70a7=_[_0xad0d('0x4b')](_0x382b18,{'sectionId':0x709});return getPlugins(_0x3f70a7)[_0xad0d('0x27')](function(_0x554f78){if(_0x3f70a7[_0xad0d('0x63')]){return _[_0xad0d('0x2d')](_0x382b18,function(_0x5e64cf){if(_0x5e64cf[_0xad0d('0x55')]===0x709){_0x5e64cf[_0xad0d('0x62')]=_0x554f78;}return _0x5e64cf;});}else{var _0x152332={'sectionId':0x76c,'enabled':0x1,'subsections':_0x554f78};var _0x428e83=_[_0xad0d('0x2d')](_0x382b18);_0x428e83['push'](_0x152332);return _0x428e83;}});}else{return;}})['then'](function(_0x59841c){if(_0x59841c)_0x382b18=_0x59841c;return _[_0xad0d('0x3e')](_0x382b18,['enabled',0x1]);})[_0xad0d('0x27')](respondWithResult(_0x48c584,null))[_0xad0d('0x4a')](handleError(_0x48c584,null));};function hasDefaultDashboard(_0x29c4b8){var _0x51f788=[0x65];return new BPromise(function(_0x572196,_0x486b23){try{if(_0x29c4b8[_0xad0d('0x54')]){_0x572196(_0x51f788);}else{return db['UserProfileResource'][_0xad0d('0x64')]({'where':{'sectionId':_0x29c4b8['id']},'raw':!![]})['then'](function(_0x29c307){_0x29c307?_0x572196(_0x51f788):_0x572196();});}}catch(_0x461ba8){_0x486b23(_0x461ba8);}});}function getCustomDashboards(_0x476bb4){var _0x3a6373=[];return new BPromise(function(_0x469987,_0xcfde6){try{if(_0x476bb4['autoAssociation']){return db[_0xad0d('0x65')][_0xad0d('0x45')]({'raw':!![]})['then'](function(_0x207a06){_0x207a06['forEach'](function(_0x259d65){_0x3a6373[_0xad0d('0x5d')](_0x259d65['id']+0x1869f);});_0x469987(_0x3a6373);});}else{return db[_0xad0d('0x57')]['findAll']({'where':{'sectionId':_0x476bb4['id']},'raw':!![]})['then'](function(_0x9436a5){_0x9436a5[_0xad0d('0x66')](function(_0x41a462){_0x3a6373[_0xad0d('0x5d')](_0x41a462[_0xad0d('0x67')]+0x1869f);});_0x469987(_0x3a6373);});}}catch(_0x2b3dfc){_0xcfde6(_0x2b3dfc);}});}function getPlugins(_0x100dc4){var _0x46e828=[];return new BPromise(function(_0x1e418f,_0x53bfbe){try{if(_0x100dc4[_0xad0d('0x54')]){return db[_0xad0d('0x68')][_0xad0d('0x45')]({'raw':!![]})[_0xad0d('0x27')](function(_0x3530c1){_0x3530c1[_0xad0d('0x66')](function(_0x3b54f3){_0x46e828[_0xad0d('0x5d')](_0x3b54f3['id']+0x15b38);});_0x1e418f(_0x46e828);});}else{return db[_0xad0d('0x57')][_0xad0d('0x45')]({'where':{'sectionId':_0x100dc4['id']},'raw':!![]})[_0xad0d('0x27')](function(_0x529c53){_0x529c53[_0xad0d('0x66')](function(_0x9e3216){_0x46e828[_0xad0d('0x5d')](_0x9e3216[_0xad0d('0x67')]+0x15b38);});_0x1e418f(_0x46e828);});}}catch(_0x1d2116){_0x53bfbe(_0x1d2116);}});}exports['addResources']=function(_0x167f0f,_0x10fd8f){return db[_0xad0d('0x2e')]['find']({'where':{'id':_0x167f0f['params']['id']}})[_0xad0d('0x27')](handleEntityNotFound(_0x10fd8f,null))[_0xad0d('0x27')](function(_0x118180){if(_0x118180){return db['sequelize']['transaction'](function(_0x4b8691){return db[_0xad0d('0x52')][_0xad0d('0x45')]({'where':{'userProfileId':_0x167f0f[_0xad0d('0x48')]['id']},'attributes':['id'],'raw':!![]})['then'](function(_0x13892d){if(_0x13892d){return db[_0xad0d('0x52')]['destroy']({'where':{'userProfileId':_0x167f0f[_0xad0d('0x48')]['id'],'id':_[_0xad0d('0x2d')](_0x13892d,function(_0x34f3db){return _0x34f3db['id'];})},'transaction':_0x4b8691});}})[_0xad0d('0x27')](function(_0x3b05ef){var _0x15a94e=_[_0xad0d('0x2d')](_0x167f0f[_0xad0d('0x50')],function(_0x3d8e4a){_0x3d8e4a[_0xad0d('0x5c')]=_0x167f0f[_0xad0d('0x48')]['id'];return _0x3d8e4a;});return db[_0xad0d('0x52')]['bulkCreate'](_0x15a94e,{'raw':!![],'transaction':_0x4b8691});})[_0xad0d('0x27')](function(_0x4f33f2){var _0x28a7b3=_[_0xad0d('0x3e')](_[_0xad0d('0x2d')](_0x4f33f2,function(_0x37d48){return _0x37d48['get']({'plain':!![]});}),{'includeAll':![]});if(_0x28a7b3){return db[_0xad0d('0x52')][_0xad0d('0x45')]({'where':{'userProfileId':_0x167f0f[_0xad0d('0x48')]['id'],'sectionId':_['map'](_0x28a7b3,function(_0x2d2620){return _0x2d2620['sectionId'];})},'attributes':['id',_0xad0d('0x55')],'raw':!![]})[_0xad0d('0x27')](function(_0x19c57d){var _0x1b3def=_['map'](_0x167f0f[_0xad0d('0x50')],function(_0x5e065c){_0x5e065c[_0xad0d('0x5c')]=_0x167f0f[_0xad0d('0x48')]['id'];return _0x5e065c;});return db[_0xad0d('0x57')][_0xad0d('0x69')](_0x1b3def,{'raw':!![],'transaction':_0x4b8691});});}})[_0xad0d('0x4a')](handleError(_0x10fd8f,null));});}})['then'](function(_0x5f22ce){var _0x3820ed=_['map'](_0x5f22ce,function(_0x3b909c){return _0x3b909c[_0xad0d('0x4c')]({'plain':!![]});});})[_0xad0d('0x27')](respondWithResult(_0x10fd8f,null))[_0xad0d('0x4a')](handleError(_0x10fd8f,null));};exports[_0xad0d('0x6a')]=function(_0x5dff1a,_0x21c59f,_0x12e3a3){return db['UserProfile'][_0xad0d('0x4b')]({'where':{'id':_0x5dff1a[_0xad0d('0x48')]['id']}})[_0xad0d('0x27')](handleEntityNotFound(_0x21c59f,null))['then'](function(_0x2f9ac7){if(_0x2f9ac7){return _0x2f9ac7[_0xad0d('0x6a')](_0x5dff1a['query'][_0xad0d('0x6b')]);}})[_0xad0d('0x27')](respondWithStatusCode(_0x21c59f,null))[_0xad0d('0x4a')](handleError(_0x21c59f,null));};exports[_0xad0d('0x6c')]=function(_0x1e40b4,_0x32e6ff){var _0x4cdec6={};if(!_0x1e40b4[_0xad0d('0x34')][_0xad0d('0x6d')])throw new Error('Missing\x20section\x20parameter');if(!_0x1e40b4[_0xad0d('0x34')][_0xad0d('0x39')](_0xad0d('0x6e'))){_0x4cdec6[_0xad0d('0x20')]=qs[_0xad0d('0x20')](_0x1e40b4[_0xad0d('0x34')]['limit']);_0x4cdec6[_0xad0d('0x22')]=qs['offset'](_0x1e40b4[_0xad0d('0x34')][_0xad0d('0x22')]);}return db[_0xad0d('0x2e')][_0xad0d('0x4b')]({'where':{'id':_0x1e40b4[_0xad0d('0x48')]['id']}})[_0xad0d('0x27')](function(_0x17d86e){if(!_0x17d86e)throw new Error(_0xad0d('0x6f')+_0x1e40b4[_0xad0d('0x48')]['id']);return db[_0xad0d('0x2e')][_0xad0d('0x6c')](_0x1e40b4);})[_0xad0d('0x27')](respondWithFilteredResult(_0x32e6ff,_0x4cdec6))[_0xad0d('0x4a')](handleError(_0x32e6ff,null));}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index 8d7b616..403a28f 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 _0x16ce=['exports','../../mysqldb','UserProfile','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x2b33e8,_0x2e01fe){var _0x1e9cce=function(_0x2d4e95){while(--_0x2d4e95){_0x2b33e8['push'](_0x2b33e8['shift']());}};_0x1e9cce(++_0x2e01fe);}(_0x16ce,0xfb));var _0xe16c=function(_0x45c3ae,_0x413f38){_0x45c3ae=_0x45c3ae-0x0;var _0x2c82f9=_0x16ce[_0x45c3ae];return _0x2c82f9;};'use strict';var EventEmitter=require('events');var UserProfile=require(_0xe16c('0x0'))['db'][_0xe16c('0x1')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0xe16c('0x2')](0x0);var events={'afterCreate':_0xe16c('0x3'),'afterUpdate':_0xe16c('0x4'),'afterDestroy':_0xe16c('0x5')};function emitEvent(_0x546ed6){return function(_0x55c37e,_0x4a5fc8,_0x884769){UserProfileEvents['emit'](_0x546ed6+':'+_0x55c37e['id'],_0x55c37e);UserProfileEvents[_0xe16c('0x6')](_0x546ed6,_0x55c37e);_0x884769(null);};}for(var e in events){if(events[_0xe16c('0x7')](e)){var event=events[e];UserProfile[_0xe16c('0x8')](e,emitEvent(event));}}module[_0xe16c('0x9')]=UserProfileEvents; \ No newline at end of file +var _0x3fc6=['setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events','UserProfile'];(function(_0x3cf652,_0x230f70){var _0x20dc3a=function(_0x4c4327){while(--_0x4c4327){_0x3cf652['push'](_0x3cf652['shift']());}};_0x20dc3a(++_0x230f70);}(_0x3fc6,0x115));var _0x63fc=function(_0x313607,_0xacb47c){_0x313607=_0x313607-0x0;var _0x411462=_0x3fc6[_0x313607];return _0x411462;};'use strict';var EventEmitter=require(_0x63fc('0x0'));var UserProfile=require('../../mysqldb')['db'][_0x63fc('0x1')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x63fc('0x2')](0x0);var events={'afterCreate':_0x63fc('0x3'),'afterUpdate':_0x63fc('0x4'),'afterDestroy':'remove'};function emitEvent(_0x3ceadb){return function(_0x26d57e,_0x237af7,_0x5ce071){UserProfileEvents[_0x63fc('0x5')](_0x3ceadb+':'+_0x26d57e['id'],_0x26d57e);UserProfileEvents['emit'](_0x3ceadb,_0x26d57e);_0x5ce071(null);};}for(var e in events){if(events[_0x63fc('0x6')](e)){var event=events[e];UserProfile[_0x63fc('0x7')](e,emitEvent(event));}}module[_0x63fc('0x8')]=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index 2823839..a67833e 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 _0xaa3f=['lodash','./userProfile.attributes','../../components/parsers/qs','squel','exports','models','filter','field','value','findAll','associatedResources','map','name','catch','resolve','AnalyticExtractedReport','resourceId','toLowerCase','squareprojects','childModel','odbc','SquareOdbc','squarerecordings','SquareRecording','parentSections','SquareProjects','projectName','projects','JscriptyProject','contacts','Lists','ListId','companies','CmCompany','globalcustomfields','CmCustomField','chatqueues','ChatQueue','chatwebsites','ChatWebsite','faxqueues','FaxQueue','faxaccounts','FaxAccount','inboundroutes','internalroutes','outboundroutes','VoiceExtension','contexts','VoiceContext','voicemails','VoiceMail','voicerecordings','VoiceRecording','Agents','membername','role','agent','Telephones','User','telephone','VoiceQueues','queue','VoiceQueue','type','outbound','VoiceMusicOnHold','chanspies','VoiceChanSpy','voiceprefixes','VoicePrefix','MailQueue','MailAccount','mailsubstatuses','openchannelqueues','OpenchannelQueue','OpenchannelAccount','smsqueues','SmsQueue','whatsappqueues','WhatsappQueue','WhatsappAccount','Team','voicequeues','queuecampaigns','QueueCampaigns','agents','telephones','admin','user','zendeskaccounts','ZendeskAccount','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','DeskAccount','zohoaccounts','ZohoAccount','Disposition','customdashboards','Dashboard','intervals','Interval','Schedule','sounds','Sound','tags','Tag','templates','Template','triggers','Trigger','trunks','Trunk','Variable','plugins','Plugin','extractedreports','reportId','metrics','AnalyticMetric','charAt','toUpperCase','slice','QueryTypes','SELECT','select','ui.','InteractionId','ui.createdAt','from','user_has_','_interactions','sequelize','then','OpenTabs','define','user_profiles','query','mergeResources','isEmpty','length','push','UserProfileSection','find','params','all','ignore','autoAssociation','model','rawAttributes','keys','attributes','fields','nolimit','limit','offset','order','sort','where','pick','filters','merge','VIRTUAL','foreignKey','options','include','forEach','default','DefaultReports','custom','CustomReports','rows','count','includeAll','CmContact','color','tag','ThroughTags','openTabs','true','dataValues','sms','fax','mail','openchannel'];(function(_0x1d7434,_0x57c6ef){var _0x50c619=function(_0x397393){while(--_0x397393){_0x1d7434['push'](_0x1d7434['shift']());}};_0x50c619(++_0x57c6ef);}(_0xaa3f,0xbb));var _0xfaa3=function(_0x1e3e1e,_0x1fe697){_0x1e3e1e=_0x1e3e1e-0x0;var _0xc9d950=_0xaa3f[_0x1e3e1e];return _0xc9d950;};'use strict';var _=require(_0xfaa3('0x0'));var attributes=require(_0xfaa3('0x1'));var qs=require(_0xfaa3('0x2'));var squel=require(_0xfaa3('0x3'));module[_0xfaa3('0x4')]=function(_0x1da39b){var _0x408343=_0x1da39b[_0xfaa3('0x5')];function _0x32f4e1(_0x5123a3,_0x513eea){return new Promise(function(_0x2ac57f,_0x4bac92){if(!_0x513eea)return _0x2ac57f(null);var _0x3d09aa=_0x513eea[_0xfaa3('0x6')]?{[_0x513eea[_0xfaa3('0x6')][_0xfaa3('0x7')]]:_0x513eea[_0xfaa3('0x6')][_0xfaa3('0x8')]}:undefined;return _0x408343[_0x5123a3][_0xfaa3('0x9')]({'where':_0x3d09aa,'raw':!![]})['then'](function(_0x37bcd5){_0x513eea[_0xfaa3('0xa')]=_['map'](_0x37bcd5,'id');_0x2ac57f(_0x513eea);})['catch'](function(_0x44d88e){_0x4bac92(_0x44d88e);});});}function _0xce3b1f(_0x34d3dc,_0x278e6c){return new Promise(function(_0x23e4b6,_0x32866b){var _0x5e1b29=_0x34d3dc[_0xfaa3('0x6')]?{[_0x34d3dc['filter'][_0xfaa3('0x7')]]:_0x34d3dc[_0xfaa3('0x6')][_0xfaa3('0x8')]}:undefined;return _0x408343[_0x34d3dc['model']][_0xfaa3('0x9')]({'where':_0x5e1b29,'raw':!![]})['then'](function(_0xdf7551){_0x278e6c[_0xfaa3('0xa')]=_[_0xfaa3('0xb')](_0xdf7551,function(_0x3ddb40){return _0x3ddb40[_0xfaa3('0xc')];});_0x23e4b6(_0x278e6c);})[_0xfaa3('0xd')](function(_0x4da250){_0x32866b(_0x4da250);});});}function _0x5f47dd(_0x46e112,_0xe1a082,_0x407384){if(!_0xe1a082)return Promise[_0xfaa3('0xe')](null);return new Promise(function(_0x4e54e4,_0x5dd38c){return _0x408343['UserProfileResource']['findAll']({'where':{'sectionId':_0xe1a082['id']},'raw':!![]})['then'](function(_0x275a07){if(_0x46e112['field']&&_0x46e112[_0xfaa3('0x7')]!=='id'){_0xe1a082[_0xfaa3('0xa')]=_[_0xfaa3('0xb')](_0x275a07,function(_0x34b276){return _0x34b276[_0x46e112[_0xfaa3('0x7')]];});}else{if(_0x407384===_0xfaa3('0xf')){_0xe1a082[_0xfaa3('0xa')]=_[_0xfaa3('0xb')](_0x275a07,function(_0x220c9e){return{'id':_0x220c9e[_0xfaa3('0x10')],'type':_0x220c9e['type']};});}else{_0xe1a082[_0xfaa3('0xa')]=_[_0xfaa3('0xb')](_0x275a07,function(_0x26d9ef){return _0x26d9ef[_0xfaa3('0x10')];});}}_0x4e54e4(_0xe1a082);})['catch'](function(_0x1f7324){_0x5dd38c(_0x1f7324);});});}function _0x2d4087(_0x2f077c,_0x22156a){var _0x16a3e3={'parentSections':[]};switch(_0x2f077c[_0xfaa3('0x11')]()){case _0xfaa3('0x12'):_0x16a3e3[_0xfaa3('0x13')]='SquareProject';break;case _0xfaa3('0x14'):_0x16a3e3[_0xfaa3('0x13')]=_0xfaa3('0x15');break;case _0xfaa3('0x16'):_0x16a3e3[_0xfaa3('0x13')]=_0xfaa3('0x17');_0x16a3e3[_0xfaa3('0x18')]=[{'name':_0xfaa3('0x19'),'field':_0xfaa3('0xc'),'foreignKey':_0xfaa3('0x1a')}];break;case _0xfaa3('0x1b'):_0x16a3e3[_0xfaa3('0x13')]=_0xfaa3('0x1c');break;case _0xfaa3('0x1d'):_0x16a3e3[_0xfaa3('0x13')]='CmContact';_0x16a3e3[_0xfaa3('0x18')]=[{'name':_0xfaa3('0x1e'),'field':'id','foreignKey':_0xfaa3('0x1f')}];break;case'lists':_0x16a3e3[_0xfaa3('0x13')]='CmList';break;case _0xfaa3('0x20'):_0x16a3e3['childModel']=_0xfaa3('0x21');break;case _0xfaa3('0x22'):_0x16a3e3[_0xfaa3('0x13')]=_0xfaa3('0x23');break;case _0xfaa3('0x24'):_0x16a3e3[_0xfaa3('0x13')]=_0xfaa3('0x25');break;case _0xfaa3('0x26'):_0x16a3e3['childModel']=_0xfaa3('0x27');break;case _0xfaa3('0x28'):_0x16a3e3[_0xfaa3('0x13')]=_0xfaa3('0x29');break;case _0xfaa3('0x2a'):_0x16a3e3[_0xfaa3('0x13')]=_0xfaa3('0x2b');break;case _0xfaa3('0x2c'):case _0xfaa3('0x2d'):case _0xfaa3('0x2e'):_0x16a3e3[_0xfaa3('0x13')]=_0xfaa3('0x2f');break;case _0xfaa3('0x30'):_0x16a3e3[_0xfaa3('0x13')]=_0xfaa3('0x31');break;case _0xfaa3('0x32'):_0x16a3e3['childModel']=_0xfaa3('0x33');break;case _0xfaa3('0x34'):_0x16a3e3[_0xfaa3('0x13')]=_0xfaa3('0x35');_0x16a3e3[_0xfaa3('0x18')]=[{'name':_0xfaa3('0x36'),'field':_0xfaa3('0xc'),'foreignKey':_0xfaa3('0x37'),'model':'User','filter':{'field':_0xfaa3('0x38'),'value':[_0xfaa3('0x39')]}},{'name':_0xfaa3('0x3a'),'field':'name','foreignKey':_0xfaa3('0x37'),'model':_0xfaa3('0x3b'),'filter':{'field':'role','value':[_0xfaa3('0x3c')]}},{'name':_0xfaa3('0x3d'),'field':_0xfaa3('0xc'),'foreignKey':_0xfaa3('0x3e'),'model':_0xfaa3('0x3f'),'filter':{'field':_0xfaa3('0x40'),'value':['inbound']}},{'name':'QueueCampaigns','field':_0xfaa3('0xc'),'foreignKey':_0xfaa3('0x3e'),'model':'VoiceQueue','filter':{'field':'type','value':[_0xfaa3('0x41')]}}];break;case'musiconholds':_0x16a3e3[_0xfaa3('0x13')]=_0xfaa3('0x42');break;case _0xfaa3('0x43'):_0x16a3e3[_0xfaa3('0x13')]=_0xfaa3('0x44');break;case _0xfaa3('0x45'):_0x16a3e3[_0xfaa3('0x13')]=_0xfaa3('0x46');break;case'ivrcampaigns':_0x16a3e3['childModel']='Campaign';break;case'mailqueues':_0x16a3e3[_0xfaa3('0x13')]=_0xfaa3('0x47');break;case'mailaccounts':_0x16a3e3[_0xfaa3('0x13')]=_0xfaa3('0x48');break;case _0xfaa3('0x49'):_0x16a3e3['childModel']='MailSubstatus';break;case _0xfaa3('0x4a'):_0x16a3e3['childModel']=_0xfaa3('0x4b');break;case'openchannelaccounts':_0x16a3e3['childModel']=_0xfaa3('0x4c');break;case _0xfaa3('0x4d'):_0x16a3e3['childModel']=_0xfaa3('0x4e');break;case'smsaccounts':_0x16a3e3[_0xfaa3('0x13')]='SmsAccount';break;case _0xfaa3('0x4f'):_0x16a3e3[_0xfaa3('0x13')]=_0xfaa3('0x50');break;case'whatsappaccounts':_0x16a3e3[_0xfaa3('0x13')]=_0xfaa3('0x51');break;case'teams':_0x16a3e3[_0xfaa3('0x13')]=_0xfaa3('0x52');break;case _0xfaa3('0x53'):case _0xfaa3('0x54'):_0x16a3e3['childModel']=_0xfaa3('0x3f');if(_0x22156a){_0x16a3e3[_0xfaa3('0x18')]=[{'name':'VoiceQueues'},{'name':_0xfaa3('0x55')}];}break;case'users':case _0xfaa3('0x56'):case _0xfaa3('0x57'):_0x16a3e3[_0xfaa3('0x13')]='User';if(_0x22156a){_0x16a3e3[_0xfaa3('0x18')]=[{'name':'Users','filter':{'field':'role','value':[_0xfaa3('0x58'),_0xfaa3('0x59')]},'ignore':!![]},{'name':_0xfaa3('0x36')},{'name':_0xfaa3('0x3a')}];}break;case _0xfaa3('0x5a'):_0x16a3e3[_0xfaa3('0x13')]=_0xfaa3('0x5b');break;case'salesforceaccounts':_0x16a3e3[_0xfaa3('0x13')]=_0xfaa3('0x5c');break;case _0xfaa3('0x5d'):_0x16a3e3[_0xfaa3('0x13')]=_0xfaa3('0x5e');break;case _0xfaa3('0x5f'):_0x16a3e3[_0xfaa3('0x13')]='SugarcrmAccount';break;case'deskaccounts':_0x16a3e3['childModel']=_0xfaa3('0x60');break;case _0xfaa3('0x61'):_0x16a3e3[_0xfaa3('0x13')]=_0xfaa3('0x62');break;case'vtigeraccounts':_0x16a3e3[_0xfaa3('0x13')]='User';break;case'cannedanswers':_0x16a3e3['childModel']='CannedAnswer';break;case'dispositions':_0x16a3e3[_0xfaa3('0x13')]=_0xfaa3('0x63');break;case _0xfaa3('0x64'):_0x16a3e3[_0xfaa3('0x13')]=_0xfaa3('0x65');break;case _0xfaa3('0x66'):_0x16a3e3[_0xfaa3('0x13')]=_0xfaa3('0x67');break;case'pauses':_0x16a3e3[_0xfaa3('0x13')]='Pause';break;case'scheduler':_0x16a3e3[_0xfaa3('0x13')]=_0xfaa3('0x68');break;case _0xfaa3('0x69'):_0x16a3e3[_0xfaa3('0x13')]=_0xfaa3('0x6a');break;case _0xfaa3('0x6b'):_0x16a3e3[_0xfaa3('0x13')]=_0xfaa3('0x6c');break;case _0xfaa3('0x6d'):_0x16a3e3[_0xfaa3('0x13')]=_0xfaa3('0x6e');break;case _0xfaa3('0x6f'):_0x16a3e3[_0xfaa3('0x13')]=_0xfaa3('0x70');break;case _0xfaa3('0x71'):_0x16a3e3['childModel']=_0xfaa3('0x72');break;case'variables':_0x16a3e3[_0xfaa3('0x13')]=_0xfaa3('0x73');break;case _0xfaa3('0x74'):_0x16a3e3[_0xfaa3('0x13')]=_0xfaa3('0x75');break;case _0xfaa3('0x76'):_0x16a3e3[_0xfaa3('0x13')]=_0xfaa3('0xf');_0x16a3e3[_0xfaa3('0x18')]=[{'name':'Reports','field':'id','foreignKey':_0xfaa3('0x77')}];break;case _0xfaa3('0x78'):_0x16a3e3[_0xfaa3('0x13')]=_0xfaa3('0x79');break;}return _0x16a3e3;}function _0x5ccb10(_0x1fd6d7,_0x1cf28e){var _0x172a2c=_0x1fd6d7[_0xfaa3('0x7a')](0x0)[_0xfaa3('0x7b')]()+_0x1fd6d7[_0xfaa3('0x7c')](0x1);var _0x42e7f9={'type':_0x408343['Sequelize'][_0xfaa3('0x7d')][_0xfaa3('0x7e')],'raw':!![]};return new Promise(function(_0x22ce8c,_0x17e10a){var _0x5d8277=squel[_0xfaa3('0x7f')]()[_0xfaa3('0x7')](_0xfaa3('0x80')+_0x172a2c+_0xfaa3('0x81'),'id')[_0xfaa3('0x7')](_0xfaa3('0x82'))[_0xfaa3('0x83')](_0xfaa3('0x84')+_0x1fd6d7+_0xfaa3('0x85'),'ui')['where']('ui.UserId\x20=\x20?',_0x1cf28e['id']);return _0x408343[_0xfaa3('0x86')]['query'](_0x5d8277['toString'](),_0x42e7f9)[_0xfaa3('0x87')](function(_0x8b7c){_0x1cf28e[_0x172a2c+_0xfaa3('0x88')]=_0x8b7c;_0x22ce8c(_0x8b7c);})['catch'](function(_0x142f5b){_0x17e10a(_0x142f5b);});});}return _0x1da39b[_0xfaa3('0x89')]('UserProfile',attributes,{'tableName':_0xfaa3('0x8a'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x2a1dde){var _0x2ef70d={'raw':![],'where':{}};var _0x304af6={};var _0x4a537f={'count':0x0,'rows':[]};var _0x1fd9cf=_0x2a1dde[_0xfaa3('0x8b')]['section'];var _0x345291=_0x2a1dde[_0xfaa3('0x8b')][_0xfaa3('0x8c')]||![];var _0x1df722=_0x2d4087(_0x1fd9cf,_0x345291);if(!_0x1df722[_0xfaa3('0x13')])throw new Error('Invalid\x20section\x20\x27'+_0x1fd9cf+'\x27');var _0x17b747=[{'name':_0x1fd9cf}];if(!_[_0xfaa3('0x8d')](_0x1df722['parentSections']))_0x17b747=_0x1df722['parentSections'];var _0x5b3a99=[];for(var _0x4e1069=0x0;_0x4e1069<_0x17b747[_0xfaa3('0x8e')];_0x4e1069++){_0x5b3a99[_0xfaa3('0x8f')](_0x408343[_0xfaa3('0x90')][_0xfaa3('0x91')]({'where':{'userProfileId':_0x2a1dde[_0xfaa3('0x92')]['id'],'name':_0x17b747[_0x4e1069][_0xfaa3('0xc')]},'raw':!![]}));}return Promise[_0xfaa3('0x93')](_0x5b3a99)[_0xfaa3('0x87')](function(_0x1cc322){var _0x19fd0e=_[_0xfaa3('0x6')](_0x1cc322,function(_0x517769){return _0x517769?_0x517769:undefined;});var _0xbbad66=_['filter'](_0x17b747,[_0xfaa3('0x94'),!![]]);var _0x5f02d4=_[_0xfaa3('0x8d')](_0x19fd0e)&&_[_0xfaa3('0x8d')](_0xbbad66)?null:_['union'](_0xbbad66,_0x19fd0e);if(!_0x5f02d4)return null;var _0x5d573e=[];for(var _0x16f059=0x0;_0x16f059<_0x5f02d4[_0xfaa3('0x8e')];_0x16f059++){var _0x2bc04c=_[_0xfaa3('0x91')](_0x17b747,function(_0x60adb2){return _0x5f02d4[_0x16f059]?_0x60adb2[_0xfaa3('0xc')]===_0x5f02d4[_0x16f059][_0xfaa3('0xc')]:null;});if(_0x2bc04c){if(_0x5f02d4[_0x16f059]['ignore']){_0x5d573e[_0xfaa3('0x8f')](_0x32f4e1(_0x1df722[_0xfaa3('0x13')],_0x5f02d4[_0x16f059]));}else{if(!_0x5f02d4[_0x16f059][_0xfaa3('0x95')]){_0x5d573e['push'](_0x5f47dd(_0x2bc04c,_0x5f02d4[_0x16f059],_0x1df722[_0xfaa3('0x13')]));}else{if(_0x2bc04c[_0xfaa3('0x96')]){_0x5d573e[_0xfaa3('0x8f')](_0xce3b1f(_0x2bc04c,_0x5f02d4[_0x16f059]));}}}}}return Promise[_0xfaa3('0x93')](_0x5d573e);})['then'](function(_0x6ea54e){var _0x5a6e29=_0x6ea54e;var _0x5e71bd=null;if(_0x5a6e29){_0x5e71bd=_0x5a6e29[_0xfaa3('0x8e')]===0x1?_0x5a6e29[0x0]:null;}if(!_0x5e71bd&&!_0x5a6e29)return _0x4a537f;var _0x38c1fb=_0x408343[_0x1df722[_0xfaa3('0x13')]][_0xfaa3('0x97')];_0x304af6[_0xfaa3('0x96')]=_[_0xfaa3('0x98')](_0x38c1fb);_0x304af6[_0xfaa3('0x8b')]=_['keys'](_0x2a1dde[_0xfaa3('0x8b')]);_0x304af6['filters']=_['intersection'](_0x304af6[_0xfaa3('0x96')],_0x304af6['query']);_0x2ef70d[_0xfaa3('0x99')]=_['intersection'](_0x304af6['model'],qs[_0xfaa3('0x9a')](_0x2a1dde[_0xfaa3('0x8b')][_0xfaa3('0x9a')]));_0x2ef70d['attributes']=_0x2ef70d[_0xfaa3('0x99')][_0xfaa3('0x8e')]?_0x2ef70d[_0xfaa3('0x99')]:_0x304af6[_0xfaa3('0x96')];if(!_0x2a1dde[_0xfaa3('0x8b')]['hasOwnProperty'](_0xfaa3('0x9b'))){_0x2ef70d[_0xfaa3('0x9c')]=qs['limit'](_0x2a1dde[_0xfaa3('0x8b')][_0xfaa3('0x9c')]);_0x2ef70d[_0xfaa3('0x9d')]=qs[_0xfaa3('0x9d')](_0x2a1dde[_0xfaa3('0x8b')][_0xfaa3('0x9d')]);}_0x2ef70d[_0xfaa3('0x9e')]=qs[_0xfaa3('0x9f')](_0x2a1dde['query'][_0xfaa3('0x9f')]);_0x2ef70d[_0xfaa3('0xa0')]=qs['filters'](_[_0xfaa3('0xa1')](_0x2a1dde[_0xfaa3('0x8b')],_0x304af6[_0xfaa3('0xa2')]));if(_0x2a1dde[_0xfaa3('0x8b')][_0xfaa3('0x6')]){_0x2ef70d['where']=_[_0xfaa3('0xa3')](_0x2ef70d[_0xfaa3('0xa0')],{'$or':_[_0xfaa3('0xb')](_0x38c1fb,function(_0x479203){if(_0x479203[_0xfaa3('0x40')]['key']!==_0xfaa3('0xa4')){var _0x2d8f04={};_0x2d8f04[_0x479203[_0xfaa3('0x7')]]={'$like':'%'+_0x2a1dde['query'][_0xfaa3('0x6')]+'%'};return _0x2d8f04;}})});}var _0x248b55=[];var _0x1f48f4=null;var _0x1d8ff5={};if(_0x5e71bd){_0x1f48f4=_['find'](_0x17b747,['name',_0x5e71bd['name']]);if(_0x1f48f4[_0xfaa3('0x7')]){_0x1d8ff5={};if(_0x1df722[_0xfaa3('0x13')]===_0xfaa3('0xf')){_0x1d8ff5[_0x1f48f4[_0xfaa3('0xa5')]]=_[_0xfaa3('0xb')](_0x5e71bd['associatedResources'],'id');}else{_0x1d8ff5[_0x1f48f4[_0xfaa3('0xa5')]]=_0x5e71bd[_0xfaa3('0xa')];}_0x248b55[_0xfaa3('0x8f')](_0x1d8ff5);}else{_0x2ef70d['where']['id']=_0x5e71bd[_0xfaa3('0xa')];}}else{for(var _0x509231=0x0;_0x509231<_0x5a6e29[_0xfaa3('0x8e')];_0x509231++){_0x1f48f4=_['find'](_0x17b747,[_0xfaa3('0xc'),_0x5a6e29[_0x509231][_0xfaa3('0xc')]]);if(_0x1f48f4[_0xfaa3('0x7')]){_0x1d8ff5={};_0x1d8ff5[_0x1f48f4[_0xfaa3('0xa5')]]=_0x5a6e29[_0x509231]['associatedResources'];_0x248b55[_0xfaa3('0x8f')](_0x1d8ff5);}else{if(!_0x2ef70d[_0xfaa3('0xa0')]['id'])_0x2ef70d[_0xfaa3('0xa0')]['id']=[];_0x5a6e29[_0x509231][_0xfaa3('0xa')]['forEach'](function(_0x3cc53c){_0x2ef70d[_0xfaa3('0xa0')]['id'][_0xfaa3('0x8f')](_0x3cc53c);});}}}if(!_[_0xfaa3('0x8d')](_0x248b55)){_0x2ef70d[_0xfaa3('0xa0')]=_['merge'](_0x2ef70d[_0xfaa3('0xa0')],{'$and':{'$or':_0x248b55}});}_0x2ef70d=_[_0xfaa3('0xa3')]({},_0x2ef70d,_0x2a1dde[_0xfaa3('0xa6')]);if(_0x5e71bd&&!_0x5e71bd['autoAssociation']&&_0x1df722[_0xfaa3('0x13')]===_0xfaa3('0xf')){if(_0x2a1dde[_0xfaa3('0x8b')]['includeAll']){_0x2ef70d[_0xfaa3('0xa7')]=[{'all':!![]}];}return _0x408343[_0x1df722['childModel']][_0xfaa3('0x9')](_0x2ef70d)['then'](function(_0x1956a6){var _0x4f8505=[];_0x1956a6[_0xfaa3('0xa8')](function(_0xa932d5){var _0x4fb738;switch(_0xa932d5['reportType']){case _0xfaa3('0xa9'):_0x4fb738=_[_0xfaa3('0x91')](_0x5e71bd[_0xfaa3('0xa')],function(_0x31f074){return _0x31f074['id']===_0xa932d5[_0xfaa3('0x77')]&&_0x31f074['type']===_0xfaa3('0xaa');});break;case _0xfaa3('0xab'):_0x4fb738=_[_0xfaa3('0x91')](_0x5e71bd[_0xfaa3('0xa')],function(_0x259139){return _0x259139['id']===_0xa932d5[_0xfaa3('0x77')]&&_0x259139[_0xfaa3('0x40')]===_0xfaa3('0xac');});break;}if(_0x4fb738)_0x4f8505[_0xfaa3('0x8f')](_0xa932d5);});_0x4a537f['count']=_0x4f8505['length'];_0x4a537f[_0xfaa3('0xad')]=_0x4f8505;return _0x4a537f;});}else{return _0x408343[_0x1df722[_0xfaa3('0x13')]]['count']({'where':_0x2ef70d[_0xfaa3('0xa0')]})[_0xfaa3('0x87')](function(_0x16dc21){_0x4a537f[_0xfaa3('0xae')]=_0x16dc21;if(_0x2a1dde[_0xfaa3('0x8b')][_0xfaa3('0xaf')]){if(_0x1df722[_0xfaa3('0x13')]===_0xfaa3('0xb0')){_0x2ef70d[_0xfaa3('0xa7')]=[{'model':_0x408343['Tag'],'as':'Tags','attributes':['id',_0xfaa3('0xc'),_0xfaa3('0xb1')],'required':_0x2a1dde[_0xfaa3('0x8b')][_0xfaa3('0xb2')]?!![]:![]},{'model':_0x408343[_0xfaa3('0x6c')],'as':_0xfaa3('0xb3'),'attributes':['id',_0xfaa3('0xc'),_0xfaa3('0xb1')],'through':_0x2a1dde['query']['tag']?{'attributes':[],'where':{'TagId':_0x2a1dde[_0xfaa3('0x8b')][_0xfaa3('0xb2')]||undefined}}:{},'required':_0x2a1dde[_0xfaa3('0x8b')]['tag']?!![]:![]}];}else{_0x2ef70d[_0xfaa3('0xa7')]=[{'all':!![]}];}}return _0x408343[_0x1df722[_0xfaa3('0x13')]][_0xfaa3('0x9')](_0x2ef70d);})[_0xfaa3('0x87')](function(_0x1f458b){_0x4a537f[_0xfaa3('0xad')]=_0x1f458b;if(_0x1fd9cf===_0xfaa3('0x36')&&_0x2a1dde['query'][_0xfaa3('0xb4')]===_0xfaa3('0xb5')){var _0x4d8ce7=[];for(var _0x875fea=0x0;_0x875fea<_0x4a537f[_0xfaa3('0xad')][_0xfaa3('0x8e')];_0x875fea++){_0x4d8ce7[_0xfaa3('0x8f')](_0x5ccb10('chat',_0x4a537f[_0xfaa3('0xad')][_0x875fea][_0xfaa3('0xb6')]));_0x4d8ce7['push'](_0x5ccb10(_0xfaa3('0xb7'),_0x4a537f['rows'][_0x875fea]['dataValues']));_0x4d8ce7['push'](_0x5ccb10(_0xfaa3('0xb8'),_0x4a537f['rows'][_0x875fea][_0xfaa3('0xb6')]));_0x4d8ce7['push'](_0x5ccb10(_0xfaa3('0xb9'),_0x4a537f['rows'][_0x875fea][_0xfaa3('0xb6')]));_0x4d8ce7['push'](_0x5ccb10(_0xfaa3('0xba'),_0x4a537f[_0xfaa3('0xad')][_0x875fea][_0xfaa3('0xb6')]));_0x4d8ce7['push'](_0x5ccb10('whatsapp',_0x4a537f['rows'][_0x875fea][_0xfaa3('0xb6')]));}return Promise[_0xfaa3('0x93')](_0x4d8ce7)[_0xfaa3('0x87')](function(){return _0x4a537f;});}return _0x4a537f;});}});}}});}; \ No newline at end of file +var _0x0a6b=['fields','hasOwnProperty','limit','offset','sort','where','key','VIRTUAL','foreignKey','forEach','merge','options','AnalyticExtractedReport','includeAll','reportType','reportId','DefaultReports','CustomReports','count','Tag','Tags','color','ThroughTags','tag','include','rows','openTabs','true','chat','sms','dataValues','fax','mail','openchannel','lodash','exports','models','filter','field','associatedResources','map','catch','value','model','findAll','name','resolve','UserProfileResource','then','resourceId','type','toLowerCase','squareprojects','SquareProject','odbc','childModel','SquareOdbc','SquareRecording','parentSections','SquareProjects','projectName','projects','JscriptyProject','contacts','CmContact','Lists','lists','CmList','globalcustomfields','CmCustomField','chatqueues','ChatQueue','chatwebsites','ChatWebsite','faxqueues','faxaccounts','FaxAccount','inboundroutes','internalroutes','outboundroutes','VoiceExtension','VoiceContext','VoiceMail','VoiceRecording','Agents','membername','User','agent','VoiceQueues','queue','VoiceQueue','QueueCampaigns','outbound','musiconholds','VoiceMusicOnHold','chanspies','voiceprefixes','VoicePrefix','ivrcampaigns','Campaign','mailqueues','mailaccounts','MailAccount','mailsubstatuses','openchannelqueues','OpenchannelQueue','smsqueues','SmsQueue','smsaccounts','SmsAccount','whatsappqueues','WhatsappQueue','whatsappaccounts','WhatsappAccount','Team','queuecampaigns','users','agents','telephones','Users','role','user','Telephones','zendeskaccounts','FreshdeskAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','ZohoAccount','vtigeraccounts','cannedanswers','CannedAnswer','Disposition','customdashboards','Dashboard','intervals','Interval','pauses','scheduler','Schedule','tags','templates','triggers','Trigger','Trunk','Variable','plugins','Plugin','metrics','charAt','toUpperCase','Sequelize','QueryTypes','SELECT','InteractionId','ui.createdAt','user_has_','_interactions','ui.UserId\x20=\x20?','sequelize','query','toString','OpenTabs','define','UserProfile','user_profiles','section','Invalid\x20section\x20\x27','isEmpty','length','push','UserProfileSection','find','params','all','ignore','union','autoAssociation','keys','filters'];(function(_0x50267b,_0x24abfe){var _0x4c357b=function(_0x21d318){while(--_0x21d318){_0x50267b['push'](_0x50267b['shift']());}};_0x4c357b(++_0x24abfe);}(_0x0a6b,0x18e));var _0xb0a6=function(_0xc3f6e5,_0x1094cc){_0xc3f6e5=_0xc3f6e5-0x0;var _0x36b33c=_0x0a6b[_0xc3f6e5];return _0x36b33c;};'use strict';var _=require(_0xb0a6('0x0'));var attributes=require('./userProfile.attributes');var qs=require('../../components/parsers/qs');var squel=require('squel');module[_0xb0a6('0x1')]=function(_0x50d3d5){var _0x2245d7=_0x50d3d5[_0xb0a6('0x2')];function _0x1d3b78(_0x544a64,_0x102ecd){return new Promise(function(_0x4cc3ae,_0xbbdf89){if(!_0x102ecd)return _0x4cc3ae(null);var _0x415e9e=_0x102ecd['filter']?{[_0x102ecd[_0xb0a6('0x3')][_0xb0a6('0x4')]]:_0x102ecd[_0xb0a6('0x3')]['value']}:undefined;return _0x2245d7[_0x544a64]['findAll']({'where':_0x415e9e,'raw':!![]})['then'](function(_0x2ded05){_0x102ecd[_0xb0a6('0x5')]=_[_0xb0a6('0x6')](_0x2ded05,'id');_0x4cc3ae(_0x102ecd);})[_0xb0a6('0x7')](function(_0x5252ed){_0xbbdf89(_0x5252ed);});});}function _0x35c956(_0x19b144,_0x5d1bf0){return new Promise(function(_0x23eade,_0x24e4fd){var _0x304167=_0x19b144[_0xb0a6('0x3')]?{[_0x19b144[_0xb0a6('0x3')][_0xb0a6('0x4')]]:_0x19b144[_0xb0a6('0x3')][_0xb0a6('0x8')]}:undefined;return _0x2245d7[_0x19b144[_0xb0a6('0x9')]][_0xb0a6('0xa')]({'where':_0x304167,'raw':!![]})['then'](function(_0x2b801a){_0x5d1bf0['associatedResources']=_[_0xb0a6('0x6')](_0x2b801a,function(_0x5351ed){return _0x5351ed[_0xb0a6('0xb')];});_0x23eade(_0x5d1bf0);})['catch'](function(_0x1d837f){_0x24e4fd(_0x1d837f);});});}function _0x382c2f(_0x93243e,_0x5673ad,_0x56b594){if(!_0x5673ad)return Promise[_0xb0a6('0xc')](null);return new Promise(function(_0x295b53,_0x59bc9c){return _0x2245d7[_0xb0a6('0xd')][_0xb0a6('0xa')]({'where':{'sectionId':_0x5673ad['id']},'raw':!![]})[_0xb0a6('0xe')](function(_0x567dd5){if(_0x93243e[_0xb0a6('0x4')]&&_0x93243e[_0xb0a6('0x4')]!=='id'){_0x5673ad[_0xb0a6('0x5')]=_[_0xb0a6('0x6')](_0x567dd5,function(_0x4406d0){return _0x4406d0[_0x93243e[_0xb0a6('0x4')]];});}else{if(_0x56b594==='AnalyticExtractedReport'){_0x5673ad[_0xb0a6('0x5')]=_[_0xb0a6('0x6')](_0x567dd5,function(_0x2d0fca){return{'id':_0x2d0fca[_0xb0a6('0xf')],'type':_0x2d0fca[_0xb0a6('0x10')]};});}else{_0x5673ad[_0xb0a6('0x5')]=_[_0xb0a6('0x6')](_0x567dd5,function(_0x16e053){return _0x16e053['resourceId'];});}}_0x295b53(_0x5673ad);})[_0xb0a6('0x7')](function(_0x5c6e66){_0x59bc9c(_0x5c6e66);});});}function _0x1322ec(_0x2f1e97,_0x4997df){var _0x4aa68d={'parentSections':[]};switch(_0x2f1e97[_0xb0a6('0x11')]()){case _0xb0a6('0x12'):_0x4aa68d['childModel']=_0xb0a6('0x13');break;case _0xb0a6('0x14'):_0x4aa68d[_0xb0a6('0x15')]=_0xb0a6('0x16');break;case'squarerecordings':_0x4aa68d['childModel']=_0xb0a6('0x17');_0x4aa68d[_0xb0a6('0x18')]=[{'name':_0xb0a6('0x19'),'field':'name','foreignKey':_0xb0a6('0x1a')}];break;case _0xb0a6('0x1b'):_0x4aa68d[_0xb0a6('0x15')]=_0xb0a6('0x1c');break;case _0xb0a6('0x1d'):_0x4aa68d[_0xb0a6('0x15')]=_0xb0a6('0x1e');_0x4aa68d[_0xb0a6('0x18')]=[{'name':_0xb0a6('0x1f'),'field':'id','foreignKey':'ListId'}];break;case _0xb0a6('0x20'):_0x4aa68d[_0xb0a6('0x15')]=_0xb0a6('0x21');break;case'companies':_0x4aa68d[_0xb0a6('0x15')]='CmCompany';break;case _0xb0a6('0x22'):_0x4aa68d[_0xb0a6('0x15')]=_0xb0a6('0x23');break;case _0xb0a6('0x24'):_0x4aa68d[_0xb0a6('0x15')]=_0xb0a6('0x25');break;case _0xb0a6('0x26'):_0x4aa68d[_0xb0a6('0x15')]=_0xb0a6('0x27');break;case _0xb0a6('0x28'):_0x4aa68d['childModel']='FaxQueue';break;case _0xb0a6('0x29'):_0x4aa68d[_0xb0a6('0x15')]=_0xb0a6('0x2a');break;case _0xb0a6('0x2b'):case _0xb0a6('0x2c'):case _0xb0a6('0x2d'):_0x4aa68d[_0xb0a6('0x15')]=_0xb0a6('0x2e');break;case'contexts':_0x4aa68d[_0xb0a6('0x15')]=_0xb0a6('0x2f');break;case'voicemails':_0x4aa68d[_0xb0a6('0x15')]=_0xb0a6('0x30');break;case'voicerecordings':_0x4aa68d['childModel']=_0xb0a6('0x31');_0x4aa68d[_0xb0a6('0x18')]=[{'name':_0xb0a6('0x32'),'field':_0xb0a6('0xb'),'foreignKey':_0xb0a6('0x33'),'model':_0xb0a6('0x34'),'filter':{'field':'role','value':[_0xb0a6('0x35')]}},{'name':'Telephones','field':_0xb0a6('0xb'),'foreignKey':_0xb0a6('0x33'),'model':'User','filter':{'field':'role','value':['telephone']}},{'name':_0xb0a6('0x36'),'field':_0xb0a6('0xb'),'foreignKey':_0xb0a6('0x37'),'model':_0xb0a6('0x38'),'filter':{'field':_0xb0a6('0x10'),'value':['inbound']}},{'name':_0xb0a6('0x39'),'field':_0xb0a6('0xb'),'foreignKey':_0xb0a6('0x37'),'model':_0xb0a6('0x38'),'filter':{'field':'type','value':[_0xb0a6('0x3a')]}}];break;case _0xb0a6('0x3b'):_0x4aa68d[_0xb0a6('0x15')]=_0xb0a6('0x3c');break;case _0xb0a6('0x3d'):_0x4aa68d['childModel']='VoiceChanSpy';break;case _0xb0a6('0x3e'):_0x4aa68d[_0xb0a6('0x15')]=_0xb0a6('0x3f');break;case _0xb0a6('0x40'):_0x4aa68d[_0xb0a6('0x15')]=_0xb0a6('0x41');break;case _0xb0a6('0x42'):_0x4aa68d[_0xb0a6('0x15')]='MailQueue';break;case _0xb0a6('0x43'):_0x4aa68d[_0xb0a6('0x15')]=_0xb0a6('0x44');break;case _0xb0a6('0x45'):_0x4aa68d[_0xb0a6('0x15')]='MailSubstatus';break;case _0xb0a6('0x46'):_0x4aa68d['childModel']=_0xb0a6('0x47');break;case'openchannelaccounts':_0x4aa68d[_0xb0a6('0x15')]='OpenchannelAccount';break;case _0xb0a6('0x48'):_0x4aa68d[_0xb0a6('0x15')]=_0xb0a6('0x49');break;case _0xb0a6('0x4a'):_0x4aa68d[_0xb0a6('0x15')]=_0xb0a6('0x4b');break;case _0xb0a6('0x4c'):_0x4aa68d[_0xb0a6('0x15')]=_0xb0a6('0x4d');break;case _0xb0a6('0x4e'):_0x4aa68d[_0xb0a6('0x15')]=_0xb0a6('0x4f');break;case'teams':_0x4aa68d[_0xb0a6('0x15')]=_0xb0a6('0x50');break;case'voicequeues':case _0xb0a6('0x51'):_0x4aa68d['childModel']=_0xb0a6('0x38');if(_0x4997df){_0x4aa68d[_0xb0a6('0x18')]=[{'name':_0xb0a6('0x36')},{'name':'QueueCampaigns'}];}break;case _0xb0a6('0x52'):case _0xb0a6('0x53'):case _0xb0a6('0x54'):_0x4aa68d[_0xb0a6('0x15')]=_0xb0a6('0x34');if(_0x4997df){_0x4aa68d[_0xb0a6('0x18')]=[{'name':_0xb0a6('0x55'),'filter':{'field':_0xb0a6('0x56'),'value':['admin',_0xb0a6('0x57')]},'ignore':!![]},{'name':_0xb0a6('0x32')},{'name':_0xb0a6('0x58')}];}break;case _0xb0a6('0x59'):_0x4aa68d['childModel']='ZendeskAccount';break;case'salesforceaccounts':_0x4aa68d['childModel']='SalesforceAccount';break;case'freshdeskaccounts':_0x4aa68d['childModel']=_0xb0a6('0x5a');break;case _0xb0a6('0x5b'):_0x4aa68d[_0xb0a6('0x15')]=_0xb0a6('0x5c');break;case _0xb0a6('0x5d'):_0x4aa68d[_0xb0a6('0x15')]=_0xb0a6('0x5e');break;case _0xb0a6('0x5f'):_0x4aa68d[_0xb0a6('0x15')]=_0xb0a6('0x60');break;case _0xb0a6('0x61'):_0x4aa68d[_0xb0a6('0x15')]=_0xb0a6('0x34');break;case _0xb0a6('0x62'):_0x4aa68d[_0xb0a6('0x15')]=_0xb0a6('0x63');break;case'dispositions':_0x4aa68d[_0xb0a6('0x15')]=_0xb0a6('0x64');break;case _0xb0a6('0x65'):_0x4aa68d[_0xb0a6('0x15')]=_0xb0a6('0x66');break;case _0xb0a6('0x67'):_0x4aa68d[_0xb0a6('0x15')]=_0xb0a6('0x68');break;case _0xb0a6('0x69'):_0x4aa68d['childModel']='Pause';break;case _0xb0a6('0x6a'):_0x4aa68d[_0xb0a6('0x15')]=_0xb0a6('0x6b');break;case'sounds':_0x4aa68d[_0xb0a6('0x15')]='Sound';break;case _0xb0a6('0x6c'):_0x4aa68d[_0xb0a6('0x15')]='Tag';break;case _0xb0a6('0x6d'):_0x4aa68d[_0xb0a6('0x15')]='Template';break;case _0xb0a6('0x6e'):_0x4aa68d['childModel']=_0xb0a6('0x6f');break;case'trunks':_0x4aa68d[_0xb0a6('0x15')]=_0xb0a6('0x70');break;case'variables':_0x4aa68d[_0xb0a6('0x15')]=_0xb0a6('0x71');break;case _0xb0a6('0x72'):_0x4aa68d[_0xb0a6('0x15')]=_0xb0a6('0x73');break;case'extractedreports':_0x4aa68d[_0xb0a6('0x15')]='AnalyticExtractedReport';_0x4aa68d[_0xb0a6('0x18')]=[{'name':'Reports','field':'id','foreignKey':'reportId'}];break;case _0xb0a6('0x74'):_0x4aa68d[_0xb0a6('0x15')]='AnalyticMetric';break;}return _0x4aa68d;}function _0x1deac4(_0x59c08a,_0x2fe48f){var _0x3a8d71=_0x59c08a[_0xb0a6('0x75')](0x0)[_0xb0a6('0x76')]()+_0x59c08a['slice'](0x1);var _0x384d9f={'type':_0x2245d7[_0xb0a6('0x77')][_0xb0a6('0x78')][_0xb0a6('0x79')],'raw':!![]};return new Promise(function(_0x21da0d,_0x4123e8){var _0x51b614=squel['select']()[_0xb0a6('0x4')]('ui.'+_0x3a8d71+_0xb0a6('0x7a'),'id')[_0xb0a6('0x4')](_0xb0a6('0x7b'))['from'](_0xb0a6('0x7c')+_0x59c08a+_0xb0a6('0x7d'),'ui')['where'](_0xb0a6('0x7e'),_0x2fe48f['id']);return _0x2245d7[_0xb0a6('0x7f')][_0xb0a6('0x80')](_0x51b614[_0xb0a6('0x81')](),_0x384d9f)[_0xb0a6('0xe')](function(_0x578c7a){_0x2fe48f[_0x3a8d71+_0xb0a6('0x82')]=_0x578c7a;_0x21da0d(_0x578c7a);})[_0xb0a6('0x7')](function(_0x4dbb6e){_0x4123e8(_0x4dbb6e);});});}return _0x50d3d5[_0xb0a6('0x83')](_0xb0a6('0x84'),attributes,{'tableName':_0xb0a6('0x85'),'paranoid':![],'indexes':[],'timestamps':!![],'classMethods':{'getResources':function(_0x1e8c10){var _0x173a44={'raw':![],'where':{}};var _0x3739b1={};var _0x1415e5={'count':0x0,'rows':[]};var _0x2b9800=_0x1e8c10[_0xb0a6('0x80')][_0xb0a6('0x86')];var _0x32abed=_0x1e8c10[_0xb0a6('0x80')]['mergeResources']||![];var _0x281f99=_0x1322ec(_0x2b9800,_0x32abed);if(!_0x281f99['childModel'])throw new Error(_0xb0a6('0x87')+_0x2b9800+'\x27');var _0x1178d9=[{'name':_0x2b9800}];if(!_[_0xb0a6('0x88')](_0x281f99[_0xb0a6('0x18')]))_0x1178d9=_0x281f99['parentSections'];var _0x22521a=[];for(var _0x1363e9=0x0;_0x1363e9<_0x1178d9[_0xb0a6('0x89')];_0x1363e9++){_0x22521a[_0xb0a6('0x8a')](_0x2245d7[_0xb0a6('0x8b')][_0xb0a6('0x8c')]({'where':{'userProfileId':_0x1e8c10[_0xb0a6('0x8d')]['id'],'name':_0x1178d9[_0x1363e9][_0xb0a6('0xb')]},'raw':!![]}));}return Promise[_0xb0a6('0x8e')](_0x22521a)[_0xb0a6('0xe')](function(_0x100b4f){var _0x2f0139=_[_0xb0a6('0x3')](_0x100b4f,function(_0x2f1b5a){return _0x2f1b5a?_0x2f1b5a:undefined;});var _0x3e3060=_[_0xb0a6('0x3')](_0x1178d9,[_0xb0a6('0x8f'),!![]]);var _0x3ce4c1=_['isEmpty'](_0x2f0139)&&_[_0xb0a6('0x88')](_0x3e3060)?null:_[_0xb0a6('0x90')](_0x3e3060,_0x2f0139);if(!_0x3ce4c1)return null;var _0x2b5ec8=[];for(var _0x35e3fb=0x0;_0x35e3fb<_0x3ce4c1[_0xb0a6('0x89')];_0x35e3fb++){var _0x37a77d=_['find'](_0x1178d9,function(_0x49a7fa){return _0x3ce4c1[_0x35e3fb]?_0x49a7fa[_0xb0a6('0xb')]===_0x3ce4c1[_0x35e3fb][_0xb0a6('0xb')]:null;});if(_0x37a77d){if(_0x3ce4c1[_0x35e3fb][_0xb0a6('0x8f')]){_0x2b5ec8[_0xb0a6('0x8a')](_0x1d3b78(_0x281f99['childModel'],_0x3ce4c1[_0x35e3fb]));}else{if(!_0x3ce4c1[_0x35e3fb][_0xb0a6('0x91')]){_0x2b5ec8[_0xb0a6('0x8a')](_0x382c2f(_0x37a77d,_0x3ce4c1[_0x35e3fb],_0x281f99[_0xb0a6('0x15')]));}else{if(_0x37a77d[_0xb0a6('0x9')]){_0x2b5ec8[_0xb0a6('0x8a')](_0x35c956(_0x37a77d,_0x3ce4c1[_0x35e3fb]));}}}}}return Promise[_0xb0a6('0x8e')](_0x2b5ec8);})[_0xb0a6('0xe')](function(_0x5a1887){var _0xea7f55=_0x5a1887;var _0xb21bfb=null;if(_0xea7f55){_0xb21bfb=_0xea7f55['length']===0x1?_0xea7f55[0x0]:null;}if(!_0xb21bfb&&!_0xea7f55)return _0x1415e5;var _0x48a60f=_0x2245d7[_0x281f99[_0xb0a6('0x15')]]['rawAttributes'];_0x3739b1[_0xb0a6('0x9')]=_[_0xb0a6('0x92')](_0x48a60f);_0x3739b1[_0xb0a6('0x80')]=_[_0xb0a6('0x92')](_0x1e8c10['query']);_0x3739b1[_0xb0a6('0x93')]=_['intersection'](_0x3739b1[_0xb0a6('0x9')],_0x3739b1[_0xb0a6('0x80')]);_0x173a44['attributes']=_['intersection'](_0x3739b1[_0xb0a6('0x9')],qs[_0xb0a6('0x94')](_0x1e8c10[_0xb0a6('0x80')]['fields']));_0x173a44['attributes']=_0x173a44['attributes'][_0xb0a6('0x89')]?_0x173a44['attributes']:_0x3739b1[_0xb0a6('0x9')];if(!_0x1e8c10[_0xb0a6('0x80')][_0xb0a6('0x95')]('nolimit')){_0x173a44[_0xb0a6('0x96')]=qs[_0xb0a6('0x96')](_0x1e8c10[_0xb0a6('0x80')][_0xb0a6('0x96')]);_0x173a44[_0xb0a6('0x97')]=qs[_0xb0a6('0x97')](_0x1e8c10[_0xb0a6('0x80')]['offset']);}_0x173a44['order']=qs[_0xb0a6('0x98')](_0x1e8c10[_0xb0a6('0x80')][_0xb0a6('0x98')]);_0x173a44[_0xb0a6('0x99')]=qs['filters'](_['pick'](_0x1e8c10[_0xb0a6('0x80')],_0x3739b1[_0xb0a6('0x93')]));if(_0x1e8c10[_0xb0a6('0x80')][_0xb0a6('0x3')]){_0x173a44[_0xb0a6('0x99')]=_['merge'](_0x173a44[_0xb0a6('0x99')],{'$or':_[_0xb0a6('0x6')](_0x48a60f,function(_0x53f05d){if(_0x53f05d[_0xb0a6('0x10')][_0xb0a6('0x9a')]!==_0xb0a6('0x9b')){var _0x42634d={};_0x42634d[_0x53f05d[_0xb0a6('0x4')]]={'$like':'%'+_0x1e8c10[_0xb0a6('0x80')]['filter']+'%'};return _0x42634d;}})});}var _0x34a4de=[];var _0x10ad85=null;var _0x285767={};if(_0xb21bfb){_0x10ad85=_[_0xb0a6('0x8c')](_0x1178d9,[_0xb0a6('0xb'),_0xb21bfb['name']]);if(_0x10ad85['field']){_0x285767={};if(_0x281f99[_0xb0a6('0x15')]==='AnalyticExtractedReport'){_0x285767[_0x10ad85[_0xb0a6('0x9c')]]=_['map'](_0xb21bfb[_0xb0a6('0x5')],'id');}else{_0x285767[_0x10ad85['foreignKey']]=_0xb21bfb[_0xb0a6('0x5')];}_0x34a4de[_0xb0a6('0x8a')](_0x285767);}else{_0x173a44[_0xb0a6('0x99')]['id']=_0xb21bfb[_0xb0a6('0x5')];}}else{for(var _0x3e1c43=0x0;_0x3e1c43<_0xea7f55[_0xb0a6('0x89')];_0x3e1c43++){_0x10ad85=_[_0xb0a6('0x8c')](_0x1178d9,[_0xb0a6('0xb'),_0xea7f55[_0x3e1c43][_0xb0a6('0xb')]]);if(_0x10ad85[_0xb0a6('0x4')]){_0x285767={};_0x285767[_0x10ad85['foreignKey']]=_0xea7f55[_0x3e1c43]['associatedResources'];_0x34a4de['push'](_0x285767);}else{if(!_0x173a44[_0xb0a6('0x99')]['id'])_0x173a44[_0xb0a6('0x99')]['id']=[];_0xea7f55[_0x3e1c43][_0xb0a6('0x5')][_0xb0a6('0x9d')](function(_0x51b473){_0x173a44[_0xb0a6('0x99')]['id'][_0xb0a6('0x8a')](_0x51b473);});}}}if(!_[_0xb0a6('0x88')](_0x34a4de)){_0x173a44[_0xb0a6('0x99')]=_[_0xb0a6('0x9e')](_0x173a44['where'],{'$and':{'$or':_0x34a4de}});}_0x173a44=_['merge']({},_0x173a44,_0x1e8c10[_0xb0a6('0x9f')]);if(_0xb21bfb&&!_0xb21bfb[_0xb0a6('0x91')]&&_0x281f99[_0xb0a6('0x15')]===_0xb0a6('0xa0')){if(_0x1e8c10[_0xb0a6('0x80')][_0xb0a6('0xa1')]){_0x173a44['include']=[{'all':!![]}];}return _0x2245d7[_0x281f99['childModel']]['findAll'](_0x173a44)[_0xb0a6('0xe')](function(_0x40cd4d){var _0x39149a=[];_0x40cd4d[_0xb0a6('0x9d')](function(_0xd3d3df){var _0x167303;switch(_0xd3d3df[_0xb0a6('0xa2')]){case'default':_0x167303=_[_0xb0a6('0x8c')](_0xb21bfb[_0xb0a6('0x5')],function(_0x1c3a58){return _0x1c3a58['id']===_0xd3d3df[_0xb0a6('0xa3')]&&_0x1c3a58[_0xb0a6('0x10')]===_0xb0a6('0xa4');});break;case'custom':_0x167303=_[_0xb0a6('0x8c')](_0xb21bfb[_0xb0a6('0x5')],function(_0x20ec12){return _0x20ec12['id']===_0xd3d3df[_0xb0a6('0xa3')]&&_0x20ec12[_0xb0a6('0x10')]===_0xb0a6('0xa5');});break;}if(_0x167303)_0x39149a[_0xb0a6('0x8a')](_0xd3d3df);});_0x1415e5['count']=_0x39149a[_0xb0a6('0x89')];_0x1415e5['rows']=_0x39149a;return _0x1415e5;});}else{return _0x2245d7[_0x281f99[_0xb0a6('0x15')]]['count']({'where':_0x173a44[_0xb0a6('0x99')]})[_0xb0a6('0xe')](function(_0x24f82a){_0x1415e5[_0xb0a6('0xa6')]=_0x24f82a;if(_0x1e8c10[_0xb0a6('0x80')][_0xb0a6('0xa1')]){if(_0x281f99[_0xb0a6('0x15')]===_0xb0a6('0x1e')){_0x173a44['include']=[{'model':_0x2245d7[_0xb0a6('0xa7')],'as':_0xb0a6('0xa8'),'attributes':['id','name',_0xb0a6('0xa9')],'required':_0x1e8c10[_0xb0a6('0x80')]['tag']?!![]:![]},{'model':_0x2245d7['Tag'],'as':_0xb0a6('0xaa'),'attributes':['id','name',_0xb0a6('0xa9')],'through':_0x1e8c10[_0xb0a6('0x80')][_0xb0a6('0xab')]?{'attributes':[],'where':{'TagId':_0x1e8c10[_0xb0a6('0x80')][_0xb0a6('0xab')]||undefined}}:{},'required':_0x1e8c10[_0xb0a6('0x80')]['tag']?!![]:![]}];}else{_0x173a44[_0xb0a6('0xac')]=[{'all':!![]}];}}return _0x2245d7[_0x281f99[_0xb0a6('0x15')]]['findAll'](_0x173a44);})['then'](function(_0xc729cd){_0x1415e5[_0xb0a6('0xad')]=_0xc729cd;if(_0x2b9800===_0xb0a6('0x32')&&_0x1e8c10[_0xb0a6('0x80')][_0xb0a6('0xae')]===_0xb0a6('0xaf')){var _0x47d4f7=[];for(var _0x1ae3d8=0x0;_0x1ae3d8<_0x1415e5['rows'][_0xb0a6('0x89')];_0x1ae3d8++){_0x47d4f7[_0xb0a6('0x8a')](_0x1deac4(_0xb0a6('0xb0'),_0x1415e5['rows'][_0x1ae3d8]['dataValues']));_0x47d4f7['push'](_0x1deac4(_0xb0a6('0xb1'),_0x1415e5[_0xb0a6('0xad')][_0x1ae3d8][_0xb0a6('0xb2')]));_0x47d4f7[_0xb0a6('0x8a')](_0x1deac4(_0xb0a6('0xb3'),_0x1415e5[_0xb0a6('0xad')][_0x1ae3d8][_0xb0a6('0xb2')]));_0x47d4f7[_0xb0a6('0x8a')](_0x1deac4(_0xb0a6('0xb4'),_0x1415e5[_0xb0a6('0xad')][_0x1ae3d8][_0xb0a6('0xb2')]));_0x47d4f7[_0xb0a6('0x8a')](_0x1deac4(_0xb0a6('0xb5'),_0x1415e5[_0xb0a6('0xad')][_0x1ae3d8]['dataValues']));_0x47d4f7[_0xb0a6('0x8a')](_0x1deac4('whatsapp',_0x1415e5[_0xb0a6('0xad')][_0x1ae3d8][_0xb0a6('0xb2')]));}return Promise['all'](_0x47d4f7)[_0xb0a6('0xe')](function(){return _0x1415e5;});}return _0x1415e5;});}});}}});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index 6899df4..25db2db 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 _0x0619=['client','http','redis','defaults','localhost','./userProfile.socket','register','request','then','info','UserProfile,\x20%s,\x20%s','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x3a2fe5,_0x4f3adf){var _0x5aacd1=function(_0x329940){while(--_0x329940){_0x3a2fe5['push'](_0x3a2fe5['shift']());}};_0x5aacd1(++_0x4f3adf);}(_0x0619,0x90));var _0x9061=function(_0x30ffa0,_0x889dc2){_0x30ffa0=_0x30ffa0-0x0;var _0x86fa9c=_0x0619[_0x30ffa0];return _0x86fa9c;};'use strict';var _=require(_0x9061('0x0'));var util=require(_0x9061('0x1'));var moment=require(_0x9061('0x2'));var BPromise=require(_0x9061('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9061('0x4'));var db=require(_0x9061('0x5'))['db'];var utils=require(_0x9061('0x6'));var logger=require(_0x9061('0x7'))(_0x9061('0x8'));var config=require(_0x9061('0x9'));var jayson=require(_0x9061('0xa'));var client=jayson[_0x9061('0xb')][_0x9061('0xc')]({'port':0x232a});config[_0x9061('0xd')]=_[_0x9061('0xe')](config['redis'],{'host':_0x9061('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x9061('0x10'))[_0x9061('0x11')](socket);function respondWithRpcPromise(_0x4cf332,_0x502660,_0x3bc693){return new BPromise(function(_0x2fc757,_0x13d226){return client[_0x9061('0x12')](_0x4cf332,_0x3bc693)[_0x9061('0x13')](function(_0x25ce5d){logger[_0x9061('0x14')](_0x9061('0x15'),_0x502660,_0x9061('0x16'));logger[_0x9061('0x17')](_0x9061('0x18'),_0x502660,_0x9061('0x16'),JSON[_0x9061('0x19')](_0x25ce5d));if(_0x25ce5d['error']){if(_0x25ce5d['error'][_0x9061('0x1a')]===0x1f4){logger[_0x9061('0x1b')](_0x9061('0x15'),_0x502660,_0x25ce5d[_0x9061('0x1b')][_0x9061('0x1c')]);return _0x13d226(_0x25ce5d['error']['message']);}logger[_0x9061('0x1b')](_0x9061('0x15'),_0x502660,_0x25ce5d['error'][_0x9061('0x1c')]);return _0x2fc757(_0x25ce5d['error'][_0x9061('0x1c')]);}else{logger['info'](_0x9061('0x15'),_0x502660,'request\x20sent');_0x2fc757(_0x25ce5d[_0x9061('0x1d')][_0x9061('0x1c')]);}})[_0x9061('0x1e')](function(_0x11fc9e){logger[_0x9061('0x1b')](_0x9061('0x15'),_0x502660,_0x11fc9e);_0x13d226(_0x11fc9e);});});} \ No newline at end of file +var _0xf55c=['error','code','UserProfile,\x20%s,\x20%s','message','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./userProfile.socket','register','then','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x20d105,_0x187dc2){var _0xde2471=function(_0x183e7c){while(--_0x183e7c){_0x20d105['push'](_0x20d105['shift']());}};_0xde2471(++_0x187dc2);}(_0xf55c,0x1e7));var _0xcf55=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0xf55c[_0x3ce3c];return _0x55a2c9;};'use strict';var _=require(_0xcf55('0x0'));var util=require('util');var moment=require(_0xcf55('0x1'));var BPromise=require(_0xcf55('0x2'));var rs=require(_0xcf55('0x3'));var fs=require('fs');var Redis=require(_0xcf55('0x4'));var db=require(_0xcf55('0x5'))['db'];var utils=require(_0xcf55('0x6'));var logger=require(_0xcf55('0x7'))('rpc');var config=require(_0xcf55('0x8'));var jayson=require(_0xcf55('0x9'));var client=jayson[_0xcf55('0xa')][_0xcf55('0xb')]({'port':0x232a});config['redis']=_[_0xcf55('0xc')](config[_0xcf55('0xd')],{'host':_0xcf55('0xe'),'port':0x18eb});var socket=require(_0xcf55('0xf'))(new Redis(config['redis']));require(_0xcf55('0x10'))[_0xcf55('0x11')](socket);function respondWithRpcPromise(_0x13f181,_0x8f499a,_0x68c2b6){return new BPromise(function(_0x1d8ffc,_0xa8cc0d){return client['request'](_0x13f181,_0x68c2b6)[_0xcf55('0x12')](function(_0x133c22){logger['info']('UserProfile,\x20%s,\x20%s',_0x8f499a,_0xcf55('0x13'));logger[_0xcf55('0x14')](_0xcf55('0x15'),_0x8f499a,_0xcf55('0x13'),JSON[_0xcf55('0x16')](_0x133c22));if(_0x133c22[_0xcf55('0x17')]){if(_0x133c22[_0xcf55('0x17')][_0xcf55('0x18')]===0x1f4){logger[_0xcf55('0x17')](_0xcf55('0x19'),_0x8f499a,_0x133c22[_0xcf55('0x17')][_0xcf55('0x1a')]);return _0xa8cc0d(_0x133c22['error'][_0xcf55('0x1a')]);}logger[_0xcf55('0x17')](_0xcf55('0x19'),_0x8f499a,_0x133c22[_0xcf55('0x17')][_0xcf55('0x1a')]);return _0x1d8ffc(_0x133c22['error'][_0xcf55('0x1a')]);}else{logger[_0xcf55('0x1b')](_0xcf55('0x19'),_0x8f499a,_0xcf55('0x13'));_0x1d8ffc(_0x133c22[_0xcf55('0x1c')]['message']);}})[_0xcf55('0x1d')](function(_0x486436){logger[_0xcf55('0x17')](_0xcf55('0x19'),_0x8f499a,_0x486436);_0xa8cc0d(_0x486436);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index 8feceee..9dec168 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 _0xf1f1=['save','update','emit','register','length','userProfile:'];(function(_0x5e4052,_0xc57e67){var _0x470a47=function(_0x26c34f){while(--_0x26c34f){_0x5e4052['push'](_0x5e4052['shift']());}};_0x470a47(++_0xc57e67);}(_0xf1f1,0xc6));var _0x1f1f=function(_0x3ad121,_0x266507){_0x3ad121=_0x3ad121-0x0;var _0x464f92=_0xf1f1[_0x3ad121];return _0x464f92;};'use strict';var UserProfileEvents=require('./userProfile.events');var events=[_0x1f1f('0x0'),'remove',_0x1f1f('0x1')];function createListener(_0xe60a89,_0x364f53){return function(_0x4e5a80){_0x364f53[_0x1f1f('0x2')](_0xe60a89,_0x4e5a80);};}function removeListener(_0x458e1a,_0x2b52ab){return function(){UserProfileEvents['removeListener'](_0x458e1a,_0x2b52ab);};}exports[_0x1f1f('0x3')]=function(_0x4d5564){for(var _0x412895=0x0,_0x4f1243=events[_0x1f1f('0x4')];_0x412895<_0x4f1243;_0x412895++){var _0x2bfe35=events[_0x412895];var _0x108521=createListener(_0x1f1f('0x5')+_0x2bfe35,_0x4d5564);UserProfileEvents['on'](_0x2bfe35,_0x108521);}}; \ No newline at end of file +var _0xa106=['length','./userProfile.events','save','update','emit','removeListener','register'];(function(_0x15812c,_0x484ceb){var _0x2ab4a5=function(_0x33fba8){while(--_0x33fba8){_0x15812c['push'](_0x15812c['shift']());}};_0x2ab4a5(++_0x484ceb);}(_0xa106,0x8d));var _0x6a10=function(_0x32b4aa,_0x12eba6){_0x32b4aa=_0x32b4aa-0x0;var _0x473160=_0xa106[_0x32b4aa];return _0x473160;};'use strict';var UserProfileEvents=require(_0x6a10('0x0'));var events=[_0x6a10('0x1'),'remove',_0x6a10('0x2')];function createListener(_0x4b6a8b,_0x1cd3d4){return function(_0x9b5faa){_0x1cd3d4[_0x6a10('0x3')](_0x4b6a8b,_0x9b5faa);};}function removeListener(_0x578350,_0x2d1b09){return function(){UserProfileEvents[_0x6a10('0x4')](_0x578350,_0x2d1b09);};}exports[_0x6a10('0x5')]=function(_0x330a65){for(var _0xcabc29=0x0,_0x5e709e=events[_0x6a10('0x6')];_0xcabc29<_0x5e709e;_0xcabc29++){var _0xa3f02=events[_0xcabc29];var _0x27d935=createListener('userProfile:'+_0xa3f02,_0x330a65);UserProfileEvents['on'](_0xa3f02,_0x27d935);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index f2fe958..d4e7aea 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 _0x273b=['multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./userProfileResource.controller','get','isAuthenticated','/describe','describe','show','post','create','put','/:id','destroy'];(function(_0x58bd7e,_0x30e73e){var _0x3ae06c=function(_0xd63985){while(--_0xd63985){_0x58bd7e['push'](_0x58bd7e['shift']());}};_0x3ae06c(++_0x30e73e);}(_0x273b,0xfc));var _0xb273=function(_0x2cfacf,_0x51ce72){_0x2cfacf=_0x2cfacf-0x0;var _0x449b65=_0x273b[_0x2cfacf];return _0x449b65;};'use strict';var multer=require(_0xb273('0x0'));var util=require('util');var path=require(_0xb273('0x1'));var timeout=require(_0xb273('0x2'));var express=require(_0xb273('0x3'));var router=express[_0xb273('0x4')]();var fs_extra=require(_0xb273('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xb273('0x6'));var config=require('../../config/environment');var controller=require(_0xb273('0x7'));router[_0xb273('0x8')]('/',auth[_0xb273('0x9')](),controller['index']);router[_0xb273('0x8')](_0xb273('0xa'),auth[_0xb273('0x9')](),controller[_0xb273('0xb')]);router[_0xb273('0x8')]('/:id',auth[_0xb273('0x9')](),controller[_0xb273('0xc')]);router[_0xb273('0xd')]('/',auth[_0xb273('0x9')](),controller[_0xb273('0xe')]);router[_0xb273('0xf')](_0xb273('0x10'),auth[_0xb273('0x9')](),controller['update']);router['delete']('/:id',auth[_0xb273('0x9')](),controller[_0xb273('0x11')]);module['exports']=router; \ No newline at end of file +var _0x28ef=['update','delete','exports','util','path','connect-timeout','fs-extra','../../components/auth/service','isAuthenticated','describe','get','/:id','create','put'];(function(_0x45ce4e,_0x3a367c){var _0x4a105a=function(_0x52f8bb){while(--_0x52f8bb){_0x45ce4e['push'](_0x45ce4e['shift']());}};_0x4a105a(++_0x3a367c);}(_0x28ef,0x1df));var _0xf28e=function(_0x3ab904,_0x2d8df6){_0x3ab904=_0x3ab904-0x0;var _0x2a7f77=_0x28ef[_0x3ab904];return _0x2a7f77;};'use strict';var multer=require('multer');var util=require(_0xf28e('0x0'));var path=require(_0xf28e('0x1'));var timeout=require(_0xf28e('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xf28e('0x3'));var auth=require(_0xf28e('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./userProfileResource.controller');router['get']('/',auth[_0xf28e('0x5')](),controller['index']);router['get']('/describe',auth[_0xf28e('0x5')](),controller[_0xf28e('0x6')]);router[_0xf28e('0x7')](_0xf28e('0x8'),auth[_0xf28e('0x5')](),controller['show']);router['post']('/',auth[_0xf28e('0x5')](),controller[_0xf28e('0x9')]);router[_0xf28e('0xa')](_0xf28e('0x8'),auth['isAuthenticated'](),controller[_0xf28e('0xb')]);router[_0xf28e('0xc')](_0xf28e('0x8'),auth['isAuthenticated'](),controller['destroy']);module[_0xf28e('0xd')]=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index 5201136..8314159 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 _0xca1c=['sequelize','STRING','INTEGER'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0xca1c,0x1e0));var _0xcca1=function(_0x3bd49e,_0x3e2799){_0x3bd49e=_0x3bd49e-0x0;var _0x16475e=_0xca1c[_0x3bd49e];return _0x16475e;};'use strict';var Sequelize=require(_0xcca1('0x0'));module['exports']={'name':{'type':Sequelize[_0xcca1('0x1')],'allowNull':![]},'resourceId':{'type':Sequelize[_0xcca1('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xcca1('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x8409=['INTEGER','sequelize','exports','STRING'];(function(_0x551b0a,_0x41348c){var _0x5dacb8=function(_0x1123cf){while(--_0x1123cf){_0x551b0a['push'](_0x551b0a['shift']());}};_0x5dacb8(++_0x41348c);}(_0x8409,0x175));var _0x9840=function(_0x5aba4f,_0x1afb63){_0x5aba4f=_0x5aba4f-0x0;var _0x10cf5c=_0x8409[_0x5aba4f];return _0x10cf5c;};'use strict';var Sequelize=require(_0x9840('0x0'));module[_0x9840('0x1')]={'name':{'type':Sequelize[_0x9840('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x9840('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x9840('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js index d13dc2f..757ead1 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 _0x1a85=['describe','zip-dir','fast-json-patch','request-promise','mustache','util','path','to-csv','fs-extra','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','end','error','stack','name','send','index','UserProfileResource','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','length','hasOwnProperty','nolimit','sort','where','pick','map','VIRTUAL','merge','options','include','findAll','rows','catch','show','fields','includeAll','find','create','body','params','destroy'];(function(_0x4ff457,_0x2a3ef4){var _0x1fe23d=function(_0x30fea4){while(--_0x30fea4){_0x4ff457['push'](_0x4ff457['shift']());}};_0x1fe23d(++_0x2a3ef4);}(_0x1a85,0x178));var _0x51a8=function(_0x2741d1,_0x501426){_0x2741d1=_0x2741d1-0x0;var _0x521e37=_0x1a85[_0x2741d1];return _0x521e37;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x51a8('0x0'));var jsonpatch=require(_0x51a8('0x1'));var rp=require(_0x51a8('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x51a8('0x3'));var util=require(_0x51a8('0x4'));var path=require(_0x51a8('0x5'));var sox=require('sox');var csv=require(_0x51a8('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x51a8('0x7'));var _=require('lodash');var squel=require(_0x51a8('0x8'));var crypto=require(_0x51a8('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x51a8('0xa'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x51a8('0xb'));var Redis=require(_0x51a8('0xc'));var authService=require(_0x51a8('0xd'));var qs=require(_0x51a8('0xe'));var as=require(_0x51a8('0xf'));var hardwareService=require(_0x51a8('0x10'));var logger=require(_0x51a8('0x11'))(_0x51a8('0x12'));var utils=require(_0x51a8('0x13'));var config=require(_0x51a8('0x14'));var licenseUtil=require(_0x51a8('0x15'));var db=require(_0x51a8('0x16'))['db'];function respondWithStatusCode(_0x38a1d2,_0x1827e6){_0x1827e6=_0x1827e6||0xcc;return function(_0x43c042){if(_0x43c042){return _0x38a1d2[_0x51a8('0x17')](_0x1827e6);}return _0x38a1d2[_0x51a8('0x18')](_0x1827e6)['end']();};}function respondWithResult(_0x461f5c,_0x7a4c36){_0x7a4c36=_0x7a4c36||0xc8;return function(_0xaec066){if(_0xaec066){return _0x461f5c['status'](_0x7a4c36)[_0x51a8('0x19')](_0xaec066);}};}function respondWithFilteredResult(_0x547d40,_0x10584b){return function(_0x2b8d37){if(_0x2b8d37){var _0x39cd45=typeof _0x10584b[_0x51a8('0x1a')]===_0x51a8('0x1b')&&typeof _0x10584b[_0x51a8('0x1c')]===_0x51a8('0x1b');var _0x516abc=_0x2b8d37[_0x51a8('0x1d')];var _0x45a433=_0x39cd45?0x0:_0x10584b[_0x51a8('0x1a')];var _0x23539e=_0x39cd45?_0x2b8d37[_0x51a8('0x1d')]:_0x10584b[_0x51a8('0x1a')]+_0x10584b['limit'];var _0x1df8c2;if(_0x23539e>=_0x516abc){_0x23539e=_0x516abc;_0x1df8c2=0xc8;}else{_0x1df8c2=0xce;}_0x547d40[_0x51a8('0x18')](_0x1df8c2);return _0x547d40[_0x51a8('0x1e')](_0x51a8('0x1f'),_0x45a433+'-'+_0x23539e+'/'+_0x516abc)[_0x51a8('0x19')](_0x2b8d37);}return null;};}function patchUpdates(_0x3bc044){return function(_0x28aea0){try{jsonpatch[_0x51a8('0x20')](_0x28aea0,_0x3bc044,!![]);}catch(_0x5ac1c0){return BPromise[_0x51a8('0x21')](_0x5ac1c0);}return _0x28aea0['save']();};}function saveUpdates(_0xfe0ddb,_0x12c029){return function(_0x8bda40){if(_0x8bda40){return _0x8bda40[_0x51a8('0x22')](_0xfe0ddb)['then'](function(_0xae3588){return _0xae3588;});}return null;};}function removeEntity(_0x4b9cdd,_0x47f063){return function(_0x23d26a){if(_0x23d26a){return _0x23d26a['destroy']()[_0x51a8('0x23')](function(){_0x4b9cdd[_0x51a8('0x18')](0xcc)[_0x51a8('0x24')]();});}};}function handleEntityNotFound(_0x18e2f3,_0x157554){return function(_0x2f2f05){if(!_0x2f2f05){_0x18e2f3[_0x51a8('0x17')](0x194);}return _0x2f2f05;};}function handleError(_0x1326a2,_0x5b3f49){_0x5b3f49=_0x5b3f49||0x1f4;return function(_0x273ce2){logger[_0x51a8('0x25')](_0x273ce2[_0x51a8('0x26')]);if(_0x273ce2[_0x51a8('0x27')]){delete _0x273ce2[_0x51a8('0x27')];}_0x1326a2[_0x51a8('0x18')](_0x5b3f49)[_0x51a8('0x28')](_0x273ce2);};}exports[_0x51a8('0x29')]=function(_0xec08ae,_0x4b5cda){var _0x20c6b5={},_0x347a02={},_0x4a1548={'count':0x0,'rows':[]};var _0x2f9d53=_['map'](db[_0x51a8('0x2a')][_0x51a8('0x2b')],function(_0x143f46){return{'name':_0x143f46[_0x51a8('0x2c')],'type':_0x143f46[_0x51a8('0x2d')]['key']};});_0x347a02[_0x51a8('0x2e')]=_['map'](_0x2f9d53,_0x51a8('0x27'));_0x347a02[_0x51a8('0x2f')]=_[_0x51a8('0x30')](_0xec08ae['query']);_0x347a02[_0x51a8('0x31')]=_['intersection'](_0x347a02[_0x51a8('0x2e')],_0x347a02[_0x51a8('0x2f')]);_0x20c6b5[_0x51a8('0x32')]=_[_0x51a8('0x33')](_0x347a02[_0x51a8('0x2e')],qs['fields'](_0xec08ae[_0x51a8('0x2f')]['fields']));_0x20c6b5[_0x51a8('0x32')]=_0x20c6b5[_0x51a8('0x32')][_0x51a8('0x34')]?_0x20c6b5['attributes']:_0x347a02[_0x51a8('0x2e')];if(!_0xec08ae[_0x51a8('0x2f')][_0x51a8('0x35')](_0x51a8('0x36'))){_0x20c6b5[_0x51a8('0x1c')]=qs['limit'](_0xec08ae['query']['limit']);_0x20c6b5[_0x51a8('0x1a')]=qs[_0x51a8('0x1a')](_0xec08ae['query'][_0x51a8('0x1a')]);}_0x20c6b5['order']=qs[_0x51a8('0x37')](_0xec08ae[_0x51a8('0x2f')][_0x51a8('0x37')]);_0x20c6b5[_0x51a8('0x38')]=qs[_0x51a8('0x31')](_[_0x51a8('0x39')](_0xec08ae['query'],_0x347a02['filters']),_0x2f9d53);if(_0xec08ae[_0x51a8('0x2f')]['filter']){_0x20c6b5['where']=_['merge'](_0x20c6b5[_0x51a8('0x38')],{'$or':_[_0x51a8('0x3a')](_0x2f9d53,function(_0x3cbf97){if(_0x3cbf97['type']!==_0x51a8('0x3b')){var _0x25d772={};_0x25d772[_0x3cbf97[_0x51a8('0x27')]]={'$like':'%'+_0xec08ae[_0x51a8('0x2f')]['filter']+'%'};return _0x25d772;}})});}_0x20c6b5=_[_0x51a8('0x3c')]({},_0x20c6b5,_0xec08ae[_0x51a8('0x3d')]);var _0x1b0333={'where':_0x20c6b5['where']};return db[_0x51a8('0x2a')]['count'](_0x1b0333)[_0x51a8('0x23')](function(_0x1e637a){_0x4a1548[_0x51a8('0x1d')]=_0x1e637a;if(_0xec08ae[_0x51a8('0x2f')]['includeAll']){_0x20c6b5[_0x51a8('0x3e')]=[{'all':!![]}];}return db[_0x51a8('0x2a')][_0x51a8('0x3f')](_0x20c6b5);})[_0x51a8('0x23')](function(_0xa33fc){_0x4a1548[_0x51a8('0x40')]=_0xa33fc;return _0x4a1548;})[_0x51a8('0x23')](respondWithFilteredResult(_0x4b5cda,_0x20c6b5))[_0x51a8('0x41')](handleError(_0x4b5cda,null));};exports[_0x51a8('0x42')]=function(_0x4b8467,_0x22e6e6){var _0x2afb74={'raw':![],'where':{'id':_0x4b8467['params']['id']}},_0x4c7c67={};_0x4c7c67[_0x51a8('0x2e')]=_[_0x51a8('0x30')](db[_0x51a8('0x2a')][_0x51a8('0x2b')]);_0x4c7c67[_0x51a8('0x2f')]=_[_0x51a8('0x30')](_0x4b8467[_0x51a8('0x2f')]);_0x4c7c67[_0x51a8('0x31')]=_[_0x51a8('0x33')](_0x4c7c67[_0x51a8('0x2e')],_0x4c7c67['query']);_0x2afb74[_0x51a8('0x32')]=_[_0x51a8('0x33')](_0x4c7c67[_0x51a8('0x2e')],qs[_0x51a8('0x43')](_0x4b8467[_0x51a8('0x2f')][_0x51a8('0x43')]));_0x2afb74['attributes']=_0x2afb74[_0x51a8('0x32')]['length']?_0x2afb74[_0x51a8('0x32')]:_0x4c7c67[_0x51a8('0x2e')];if(_0x4b8467[_0x51a8('0x2f')][_0x51a8('0x44')]){_0x2afb74[_0x51a8('0x3e')]=[{'all':!![]}];}_0x2afb74=_['merge']({},_0x2afb74,_0x4b8467['options']);return db[_0x51a8('0x2a')][_0x51a8('0x45')](_0x2afb74)[_0x51a8('0x23')](handleEntityNotFound(_0x22e6e6,null))[_0x51a8('0x23')](respondWithResult(_0x22e6e6,null))[_0x51a8('0x41')](handleError(_0x22e6e6,null));};exports['create']=function(_0x504a43,_0xcbd998){return db[_0x51a8('0x2a')][_0x51a8('0x46')](_0x504a43[_0x51a8('0x47')],{})[_0x51a8('0x23')](respondWithResult(_0xcbd998,0xc9))[_0x51a8('0x41')](handleError(_0xcbd998,null));};exports[_0x51a8('0x22')]=function(_0x1103a3,_0x301578){if(_0x1103a3['body']['id']){delete _0x1103a3['body']['id'];}return db['UserProfileResource'][_0x51a8('0x45')]({'where':{'id':_0x1103a3[_0x51a8('0x48')]['id']}})[_0x51a8('0x23')](handleEntityNotFound(_0x301578,null))['then'](saveUpdates(_0x1103a3[_0x51a8('0x47')],null))[_0x51a8('0x23')](respondWithResult(_0x301578,null))['catch'](handleError(_0x301578,null));};exports[_0x51a8('0x49')]=function(_0x4fb93c,_0x50a2f8){return db[_0x51a8('0x2a')][_0x51a8('0x45')]({'where':{'id':_0x4fb93c[_0x51a8('0x48')]['id']}})['then'](handleEntityNotFound(_0x50a2f8,null))['then'](removeEntity(_0x50a2f8,null))[_0x51a8('0x41')](handleError(_0x50a2f8,null));};exports['describe']=function(_0x21c4da,_0xc89617){return db[_0x51a8('0x2a')][_0x51a8('0x4a')]()[_0x51a8('0x23')](respondWithResult(_0xc89617,null))[_0x51a8('0x41')](handleError(_0xc89617,null));}; \ No newline at end of file +var _0xfcf0=['nolimit','order','sort','where','VIRTUAL','filter','includeAll','include','catch','params','merge','options','create','body','find','describe','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','UserProfileResource','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty'];(function(_0x42245d,_0x51758f){var _0x4b211a=function(_0x2634e){while(--_0x2634e){_0x42245d['push'](_0x42245d['shift']());}};_0x4b211a(++_0x51758f);}(_0xfcf0,0x138));var _0x0fcf=function(_0x514c15,_0x486901){_0x514c15=_0x514c15-0x0;var _0x16283e=_0xfcf0[_0x514c15];return _0x16283e;};'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['UserProfileResource']['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));};exports[_0x0fcf('0x49')]=function(_0x389d71,_0x3a473c){return db[_0x0fcf('0x2b')][_0x0fcf('0x49')]()[_0x0fcf('0x24')](respondWithResult(_0x3a473c,null))[_0x0fcf('0x42')](handleError(_0x3a473c,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index 03aec9e..8be8f4d 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 _0xda1c=['moment','bluebird','request-promise','path','rimraf','../../config/environment','define','UserProfileResource','user_profile_has_resources','compositeIndex','resourceId','sectionId','../../config/logger','api'];(function(_0x30887f,_0xe13792){var _0x110805=function(_0x2e3b66){while(--_0x2e3b66){_0x30887f['push'](_0x30887f['shift']());}};_0x110805(++_0xe13792);}(_0xda1c,0x8a));var _0xcda1=function(_0x14c392,_0x511799){_0x14c392=_0x14c392-0x0;var _0x3507e9=_0xda1c[_0x14c392];return _0x3507e9;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xcda1('0x0'))(_0xcda1('0x1'));var moment=require(_0xcda1('0x2'));var BPromise=require(_0xcda1('0x3'));var rp=require(_0xcda1('0x4'));var fs=require('fs');var path=require(_0xcda1('0x5'));var rimraf=require(_0xcda1('0x6'));var config=require(_0xcda1('0x7'));var attributes=require('./userProfileResource.attributes');module['exports']=function(_0x4ee6f7,_0x4bd298){return _0x4ee6f7[_0xcda1('0x8')](_0xcda1('0x9'),attributes,{'tableName':_0xcda1('0xa'),'paranoid':![],'indexes':[{'name':_0xcda1('0xb'),'fields':[_0xcda1('0xc'),_0xcda1('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8159=['util','api','moment','bluebird','request-promise','path','../../config/environment','exports','user_profile_has_resources','resourceId','sectionId','lodash'];(function(_0xf3f4fa,_0x5f0511){var _0x2b9c52=function(_0x1f43dd){while(--_0x1f43dd){_0xf3f4fa['push'](_0xf3f4fa['shift']());}};_0x2b9c52(++_0x5f0511);}(_0x8159,0x15b));var _0x9815=function(_0x5ef646,_0x4bd341){_0x5ef646=_0x5ef646-0x0;var _0x1288ce=_0x8159[_0x5ef646];return _0x1288ce;};'use strict';var _=require(_0x9815('0x0'));var util=require(_0x9815('0x1'));var logger=require('../../config/logger')(_0x9815('0x2'));var moment=require(_0x9815('0x3'));var BPromise=require(_0x9815('0x4'));var rp=require(_0x9815('0x5'));var fs=require('fs');var path=require(_0x9815('0x6'));var rimraf=require('rimraf');var config=require(_0x9815('0x7'));var attributes=require('./userProfileResource.attributes');module[_0x9815('0x8')]=function(_0x25c947,_0xf5a42){return _0x25c947['define']('UserProfileResource',attributes,{'tableName':_0x9815('0x9'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0x9815('0xa'),_0x9815('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index b871588..0fa68d4 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 _0xb57e=['request\x20sent','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','UserProfileResource,\x20%s,\x20%s'];(function(_0x38b3cb,_0x4ad7b3){var _0x5a9a84=function(_0x237634){while(--_0x237634){_0x38b3cb['push'](_0x38b3cb['shift']());}};_0x5a9a84(++_0x4ad7b3);}(_0xb57e,0x181));var _0xeb57=function(_0x224f30,_0x4483c7){_0x224f30=_0x224f30-0x0;var _0x2a67ad=_0xb57e[_0x224f30];return _0x2a67ad;};'use strict';var _=require(_0xeb57('0x0'));var util=require(_0xeb57('0x1'));var moment=require('moment');var BPromise=require(_0xeb57('0x2'));var rs=require(_0xeb57('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xeb57('0x4'))['db'];var utils=require(_0xeb57('0x5'));var logger=require(_0xeb57('0x6'))(_0xeb57('0x7'));var config=require(_0xeb57('0x8'));var jayson=require(_0xeb57('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2be16a,_0x371793,_0x26f98d){return new BPromise(function(_0x4304f2,_0x243787){return client[_0xeb57('0xa')](_0x2be16a,_0x26f98d)[_0xeb57('0xb')](function(_0x5cb947){logger[_0xeb57('0xc')](_0xeb57('0xd'),_0x371793,'request\x20sent');logger['debug']('UserProfileResource,\x20%s,\x20%s,\x20%s',_0x371793,_0xeb57('0xe'),JSON[_0xeb57('0xf')](_0x5cb947));if(_0x5cb947['error']){if(_0x5cb947[_0xeb57('0x10')][_0xeb57('0x11')]===0x1f4){logger[_0xeb57('0x10')](_0xeb57('0xd'),_0x371793,_0x5cb947[_0xeb57('0x10')]['message']);return _0x243787(_0x5cb947[_0xeb57('0x10')][_0xeb57('0x12')]);}logger[_0xeb57('0x10')](_0xeb57('0xd'),_0x371793,_0x5cb947[_0xeb57('0x10')][_0xeb57('0x12')]);return _0x4304f2(_0x5cb947[_0xeb57('0x10')][_0xeb57('0x12')]);}else{logger[_0xeb57('0xc')](_0xeb57('0xd'),_0x371793,_0xeb57('0xe'));_0x4304f2(_0x5cb947[_0xeb57('0x13')][_0xeb57('0x12')]);}})[_0xeb57('0x14')](function(_0x353928){logger[_0xeb57('0x10')](_0xeb57('0xd'),_0x371793,_0x353928);_0x243787(_0x353928);});});} \ No newline at end of file +var _0xee1b=['request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','jayson/promise','http','request','UserProfileResource,\x20%s,\x20%s'];(function(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0xee1b,0x8e));var _0xbee1=function(_0x57a4c6,_0x585c51){_0x57a4c6=_0x57a4c6-0x0;var _0x42120a=_0xee1b[_0x57a4c6];return _0x42120a;};'use strict';var _=require(_0xbee1('0x0'));var util=require('util');var moment=require(_0xbee1('0x1'));var BPromise=require(_0xbee1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbee1('0x3'));var db=require(_0xbee1('0x4'))['db'];var utils=require(_0xbee1('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xbee1('0x6'));var client=jayson['client'][_0xbee1('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x114bd2,_0x16ceb4,_0x2c433d){return new BPromise(function(_0x3be3a6,_0x5040ba){return client[_0xbee1('0x8')](_0x114bd2,_0x2c433d)['then'](function(_0x7bc718){logger['info'](_0xbee1('0x9'),_0x16ceb4,_0xbee1('0xa'));logger[_0xbee1('0xb')](_0xbee1('0xc'),_0x16ceb4,_0xbee1('0xa'),JSON['stringify'](_0x7bc718));if(_0x7bc718[_0xbee1('0xd')]){if(_0x7bc718['error'][_0xbee1('0xe')]===0x1f4){logger[_0xbee1('0xd')](_0xbee1('0x9'),_0x16ceb4,_0x7bc718['error'][_0xbee1('0xf')]);return _0x5040ba(_0x7bc718[_0xbee1('0xd')][_0xbee1('0xf')]);}logger[_0xbee1('0xd')]('UserProfileResource,\x20%s,\x20%s',_0x16ceb4,_0x7bc718[_0xbee1('0xd')][_0xbee1('0xf')]);return _0x3be3a6(_0x7bc718[_0xbee1('0xd')][_0xbee1('0xf')]);}else{logger[_0xbee1('0x10')](_0xbee1('0x9'),_0x16ceb4,_0xbee1('0xa'));_0x3be3a6(_0x7bc718[_0xbee1('0x11')][_0xbee1('0xf')]);}})[_0xbee1('0x12')](function(_0x2f588b){logger[_0xbee1('0xd')]('UserProfileResource,\x20%s,\x20%s',_0x16ceb4,_0x2f588b);_0x5040ba(_0x2f588b);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index b89ffc2..fdc76bf 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 _0x1ac4=['exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileSection.controller','get','isAuthenticated','index','describe','/:id','post','create','put','destroy'];(function(_0x56af64,_0xf7cc03){var _0x49fca3=function(_0x4419ae){while(--_0x4419ae){_0x56af64['push'](_0x56af64['shift']());}};_0x49fca3(++_0xf7cc03);}(_0x1ac4,0x112));var _0x41ac=function(_0x923e53,_0x2cc867){_0x923e53=_0x923e53-0x0;var _0x4d0120=_0x1ac4[_0x923e53];return _0x4d0120;};'use strict';var multer=require(_0x41ac('0x0'));var util=require(_0x41ac('0x1'));var path=require(_0x41ac('0x2'));var timeout=require(_0x41ac('0x3'));var express=require(_0x41ac('0x4'));var router=express[_0x41ac('0x5')]();var fs_extra=require(_0x41ac('0x6'));var auth=require(_0x41ac('0x7'));var interaction=require(_0x41ac('0x8'));var config=require(_0x41ac('0x9'));var controller=require(_0x41ac('0xa'));router[_0x41ac('0xb')]('/',auth[_0x41ac('0xc')](),controller[_0x41ac('0xd')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x41ac('0xe')]);router[_0x41ac('0xb')](_0x41ac('0xf'),auth[_0x41ac('0xc')](),controller['show']);router[_0x41ac('0x10')]('/',auth['isAuthenticated'](),controller[_0x41ac('0x11')]);router[_0x41ac('0x12')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0x41ac('0xf'),auth[_0x41ac('0xc')](),controller[_0x41ac('0x13')]);module[_0x41ac('0x14')]=router; \ No newline at end of file +var _0xd121=['update','delete','/:id','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileSection.controller','get','isAuthenticated','describe','show','post','create','put'];(function(_0x357d20,_0x29446e){var _0x78d39f=function(_0x18625b){while(--_0x18625b){_0x357d20['push'](_0x357d20['shift']());}};_0x78d39f(++_0x29446e);}(_0xd121,0x194));var _0x1d12=function(_0x35372d,_0x41aece){_0x35372d=_0x35372d-0x0;var _0x3898ff=_0xd121[_0x35372d];return _0x3898ff;};'use strict';var multer=require(_0x1d12('0x0'));var util=require(_0x1d12('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x1d12('0x2'));var router=express[_0x1d12('0x3')]();var fs_extra=require(_0x1d12('0x4'));var auth=require(_0x1d12('0x5'));var interaction=require(_0x1d12('0x6'));var config=require(_0x1d12('0x7'));var controller=require(_0x1d12('0x8'));router[_0x1d12('0x9')]('/',auth[_0x1d12('0xa')](),controller['index']);router[_0x1d12('0x9')]('/describe',auth['isAuthenticated'](),controller[_0x1d12('0xb')]);router[_0x1d12('0x9')]('/:id',auth[_0x1d12('0xa')](),controller[_0x1d12('0xc')]);router[_0x1d12('0xd')]('/',auth[_0x1d12('0xa')](),controller[_0x1d12('0xe')]);router[_0x1d12('0xf')]('/:id',auth[_0x1d12('0xa')](),controller[_0x1d12('0x10')]);router[_0x1d12('0x11')](_0x1d12('0x12'),auth[_0x1d12('0xa')](),controller[_0x1d12('0x13')]);module[_0x1d12('0x14')]=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index bf562d7..4c8e5d6 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 _0x34b7=['BOOLEAN','crudPermissions','join','getDataValue','STRING','INTEGER'];(function(_0x34fc32,_0x1b372f){var _0x567758=function(_0x54ca0f){while(--_0x54ca0f){_0x34fc32['push'](_0x34fc32['shift']());}};_0x567758(++_0x1b372f);}(_0x34b7,0x196));var _0x734b=function(_0x2b0a86,_0x2ecebd){_0x2b0a86=_0x2b0a86-0x0;var _0x955940=_0x34b7[_0x2b0a86];return _0x955940;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x734b('0x0')],'allowNull':![]},'category':{'type':Sequelize[_0x734b('0x0')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x734b('0x1')],'allowNull':![]},'enabled':{'type':Sequelize[_0x734b('0x2')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x734b('0x2')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x734b('0x0')],'set':function(_0x5de1ae){this['setDataValue'](_0x734b('0x3'),_0x5de1ae?_0x5de1ae[_0x734b('0x4')](''):[]);},'get':function(){return this[_0x734b('0x5')](_0x734b('0x3'))?this[_0x734b('0x5')](_0x734b('0x3'))['split'](''):[];}}}; \ No newline at end of file +var _0x0fd9=['join','getDataValue','exports','STRING','INTEGER','setDataValue','crudPermissions'];(function(_0xe06513,_0x1c110b){var _0x429d33=function(_0x8e06a7){while(--_0x8e06a7){_0xe06513['push'](_0xe06513['shift']());}};_0x429d33(++_0x1c110b);}(_0x0fd9,0xa3));var _0x90fd=function(_0x1acc2d,_0x597696){_0x1acc2d=_0x1acc2d-0x0;var _0xabfa6d=_0x0fd9[_0x1acc2d];return _0xabfa6d;};'use strict';var Sequelize=require('sequelize');module[_0x90fd('0x0')]={'name':{'type':Sequelize[_0x90fd('0x1')],'allowNull':![]},'category':{'type':Sequelize[_0x90fd('0x1')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x90fd('0x2')],'allowNull':![]},'enabled':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'autoAssociation':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x90fd('0x1')],'set':function(_0x2a5f76){this[_0x90fd('0x3')](_0x90fd('0x4'),_0x2a5f76?_0x2a5f76[_0x90fd('0x5')](''):[]);},'get':function(){return this[_0x90fd('0x6')]('crudPermissions')?this['getDataValue'](_0x90fd('0x4'))['split'](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index 6de261a..a882f47 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 _0x4db0=['findAll','rows','catch','show','params','find','create','body','describe','eml-format','rimraf','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','reject','save','update','then','destroy','error','stack','name','send','index','map','UserProfileSection','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','options','includeAll','include'];(function(_0x3eaa9d,_0x57f561){var _0x3e7a6f=function(_0x54174c){while(--_0x54174c){_0x3eaa9d['push'](_0x3eaa9d['shift']());}};_0x3e7a6f(++_0x57f561);}(_0x4db0,0x1c5));var _0x04db=function(_0x49f67f,_0x4113a4){_0x49f67f=_0x49f67f-0x0;var _0x4779a1=_0x4db0[_0x49f67f];return _0x4779a1;};'use strict';var emlformat=require(_0x04db('0x0'));var rimraf=require(_0x04db('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x04db('0x2'));var Mustache=require(_0x04db('0x3'));var util=require(_0x04db('0x4'));var path=require(_0x04db('0x5'));var sox=require('sox');var csv=require(_0x04db('0x6'));var ejs=require(_0x04db('0x7'));var fs=require('fs');var fs_extra=require(_0x04db('0x8'));var _=require('lodash');var squel=require(_0x04db('0x9'));var crypto=require(_0x04db('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x04db('0xb'));var toCsv=require(_0x04db('0x6'));var querystring=require(_0x04db('0xc'));var Papa=require(_0x04db('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x04db('0xe'));var logger=require(_0x04db('0xf'))(_0x04db('0x10'));var utils=require(_0x04db('0x11'));var config=require(_0x04db('0x12'));var licenseUtil=require(_0x04db('0x13'));var db=require(_0x04db('0x14'))['db'];function respondWithStatusCode(_0x1fe499,_0x268fd9){_0x268fd9=_0x268fd9||0xcc;return function(_0x4ce9a6){if(_0x4ce9a6){return _0x1fe499[_0x04db('0x15')](_0x268fd9);}return _0x1fe499[_0x04db('0x16')](_0x268fd9)[_0x04db('0x17')]();};}function respondWithResult(_0x327350,_0x547146){_0x547146=_0x547146||0xc8;return function(_0x20fc0e){if(_0x20fc0e){return _0x327350[_0x04db('0x16')](_0x547146)[_0x04db('0x18')](_0x20fc0e);}};}function respondWithFilteredResult(_0x83316b,_0x4011ec){return function(_0xe514e){if(_0xe514e){var _0x91a000=typeof _0x4011ec['offset']===_0x04db('0x19')&&typeof _0x4011ec[_0x04db('0x1a')]===_0x04db('0x19');var _0x529b27=_0xe514e[_0x04db('0x1b')];var _0x327629=_0x91a000?0x0:_0x4011ec[_0x04db('0x1c')];var _0x53c4b6=_0x91a000?_0xe514e[_0x04db('0x1b')]:_0x4011ec[_0x04db('0x1c')]+_0x4011ec[_0x04db('0x1a')];var _0x47961c;if(_0x53c4b6>=_0x529b27){_0x53c4b6=_0x529b27;_0x47961c=0xc8;}else{_0x47961c=0xce;}_0x83316b[_0x04db('0x16')](_0x47961c);return _0x83316b[_0x04db('0x1d')]('Content-Range',_0x327629+'-'+_0x53c4b6+'/'+_0x529b27)[_0x04db('0x18')](_0xe514e);}return null;};}function patchUpdates(_0xa61dd5){return function(_0x47146f){try{jsonpatch['apply'](_0x47146f,_0xa61dd5,!![]);}catch(_0x5bc05b){return BPromise[_0x04db('0x1e')](_0x5bc05b);}return _0x47146f[_0x04db('0x1f')]();};}function saveUpdates(_0x56d513,_0x3cd309){return function(_0x534c63){if(_0x534c63){return _0x534c63[_0x04db('0x20')](_0x56d513)[_0x04db('0x21')](function(_0x49d429){return _0x49d429;});}return null;};}function removeEntity(_0x4846c2,_0x20a49c){return function(_0x47bd04){if(_0x47bd04){return _0x47bd04[_0x04db('0x22')]()[_0x04db('0x21')](function(){_0x4846c2[_0x04db('0x16')](0xcc)[_0x04db('0x17')]();});}};}function handleEntityNotFound(_0x4d9e56,_0x280098){return function(_0x2e5f2f){if(!_0x2e5f2f){_0x4d9e56[_0x04db('0x15')](0x194);}return _0x2e5f2f;};}function handleError(_0x1c22e0,_0x5e090e){_0x5e090e=_0x5e090e||0x1f4;return function(_0x64eed4){logger[_0x04db('0x23')](_0x64eed4[_0x04db('0x24')]);if(_0x64eed4['name']){delete _0x64eed4[_0x04db('0x25')];}_0x1c22e0[_0x04db('0x16')](_0x5e090e)[_0x04db('0x26')](_0x64eed4);};}exports[_0x04db('0x27')]=function(_0x55e0f8,_0x48d68d){var _0x16c537={},_0x451c23={},_0x1847be={'count':0x0,'rows':[]};var _0x18cae6=_[_0x04db('0x28')](db[_0x04db('0x29')][_0x04db('0x2a')],function(_0x2e3542){return{'name':_0x2e3542[_0x04db('0x2b')],'type':_0x2e3542[_0x04db('0x2c')][_0x04db('0x2d')]};});_0x451c23[_0x04db('0x2e')]=_['map'](_0x18cae6,_0x04db('0x25'));_0x451c23['query']=_[_0x04db('0x2f')](_0x55e0f8[_0x04db('0x30')]);_0x451c23[_0x04db('0x31')]=_[_0x04db('0x32')](_0x451c23[_0x04db('0x2e')],_0x451c23[_0x04db('0x30')]);_0x16c537[_0x04db('0x33')]=_['intersection'](_0x451c23[_0x04db('0x2e')],qs[_0x04db('0x34')](_0x55e0f8[_0x04db('0x30')][_0x04db('0x34')]));_0x16c537[_0x04db('0x33')]=_0x16c537[_0x04db('0x33')][_0x04db('0x35')]?_0x16c537[_0x04db('0x33')]:_0x451c23[_0x04db('0x2e')];if(!_0x55e0f8[_0x04db('0x30')][_0x04db('0x36')](_0x04db('0x37'))){_0x16c537[_0x04db('0x1a')]=qs[_0x04db('0x1a')](_0x55e0f8[_0x04db('0x30')][_0x04db('0x1a')]);_0x16c537[_0x04db('0x1c')]=qs['offset'](_0x55e0f8[_0x04db('0x30')][_0x04db('0x1c')]);}_0x16c537[_0x04db('0x38')]=qs['sort'](_0x55e0f8[_0x04db('0x30')]['sort']);_0x16c537[_0x04db('0x39')]=qs[_0x04db('0x31')](_[_0x04db('0x3a')](_0x55e0f8[_0x04db('0x30')],_0x451c23[_0x04db('0x31')]),_0x18cae6);if(_0x55e0f8[_0x04db('0x30')][_0x04db('0x3b')]){_0x16c537[_0x04db('0x39')]=_[_0x04db('0x3c')](_0x16c537[_0x04db('0x39')],{'$or':_[_0x04db('0x28')](_0x18cae6,function(_0x2adacc){if(_0x2adacc[_0x04db('0x2c')]!==_0x04db('0x3d')){var _0x54a573={};_0x54a573[_0x2adacc['name']]={'$like':'%'+_0x55e0f8[_0x04db('0x30')]['filter']+'%'};return _0x54a573;}})});}_0x16c537=_[_0x04db('0x3c')]({},_0x16c537,_0x55e0f8[_0x04db('0x3e')]);var _0xb9130b={'where':_0x16c537[_0x04db('0x39')]};return db[_0x04db('0x29')][_0x04db('0x1b')](_0xb9130b)[_0x04db('0x21')](function(_0xa65022){_0x1847be[_0x04db('0x1b')]=_0xa65022;if(_0x55e0f8[_0x04db('0x30')][_0x04db('0x3f')]){_0x16c537[_0x04db('0x40')]=[{'all':!![]}];}return db[_0x04db('0x29')][_0x04db('0x41')](_0x16c537);})[_0x04db('0x21')](function(_0x577fad){_0x1847be[_0x04db('0x42')]=_0x577fad;return _0x1847be;})['then'](respondWithFilteredResult(_0x48d68d,_0x16c537))[_0x04db('0x43')](handleError(_0x48d68d,null));};exports[_0x04db('0x44')]=function(_0x579ee9,_0x35d50a){var _0x2c8dac={'raw':![],'where':{'id':_0x579ee9[_0x04db('0x45')]['id']}},_0x2556f0={};_0x2556f0[_0x04db('0x2e')]=_[_0x04db('0x2f')](db['UserProfileSection'][_0x04db('0x2a')]);_0x2556f0[_0x04db('0x30')]=_[_0x04db('0x2f')](_0x579ee9[_0x04db('0x30')]);_0x2556f0[_0x04db('0x31')]=_[_0x04db('0x32')](_0x2556f0[_0x04db('0x2e')],_0x2556f0[_0x04db('0x30')]);_0x2c8dac[_0x04db('0x33')]=_[_0x04db('0x32')](_0x2556f0['model'],qs[_0x04db('0x34')](_0x579ee9['query'][_0x04db('0x34')]));_0x2c8dac['attributes']=_0x2c8dac[_0x04db('0x33')][_0x04db('0x35')]?_0x2c8dac[_0x04db('0x33')]:_0x2556f0[_0x04db('0x2e')];if(_0x579ee9['query']['includeAll']){_0x2c8dac[_0x04db('0x40')]=[{'all':!![]}];}_0x2c8dac=_[_0x04db('0x3c')]({},_0x2c8dac,_0x579ee9[_0x04db('0x3e')]);return db['UserProfileSection'][_0x04db('0x46')](_0x2c8dac)[_0x04db('0x21')](handleEntityNotFound(_0x35d50a,null))[_0x04db('0x21')](respondWithResult(_0x35d50a,null))[_0x04db('0x43')](handleError(_0x35d50a,null));};exports[_0x04db('0x47')]=function(_0x4b9d7d,_0x3cf7fc){return db[_0x04db('0x29')][_0x04db('0x47')](_0x4b9d7d[_0x04db('0x48')],{})['then'](respondWithResult(_0x3cf7fc,0xc9))['catch'](handleError(_0x3cf7fc,null));};exports[_0x04db('0x20')]=function(_0x4f48af,_0x32cf48){if(_0x4f48af[_0x04db('0x48')]['id']){delete _0x4f48af[_0x04db('0x48')]['id'];}return db['UserProfileSection'][_0x04db('0x46')]({'where':{'id':_0x4f48af[_0x04db('0x45')]['id']}})[_0x04db('0x21')](handleEntityNotFound(_0x32cf48,null))[_0x04db('0x21')](saveUpdates(_0x4f48af['body'],null))[_0x04db('0x21')](respondWithResult(_0x32cf48,null))[_0x04db('0x43')](handleError(_0x32cf48,null));};exports['destroy']=function(_0x34445c,_0x282427){return db[_0x04db('0x29')][_0x04db('0x46')]({'where':{'id':_0x34445c[_0x04db('0x45')]['id']}})['then'](handleEntityNotFound(_0x282427,null))[_0x04db('0x21')](removeEntity(_0x282427,null))[_0x04db('0x43')](handleError(_0x282427,null));};exports['describe']=function(_0x28a105,_0x464a1d){return db[_0x04db('0x29')][_0x04db('0x49')]()[_0x04db('0x21')](respondWithResult(_0x464a1d,null))['catch'](handleError(_0x464a1d,null));}; \ No newline at end of file +var _0x2a6f=['model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','show','params','options','find','catch','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','reject','save','update','then','destroy','error','name','send','index','map','UserProfileSection','rawAttributes','fieldName','type','key'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x2a6f,0x69));var _0xf2a6=function(_0x4aa318,_0x54a903){_0x4aa318=_0x4aa318-0x0;var _0x551b0c=_0x2a6f[_0x4aa318];return _0x551b0c;};'use strict';var emlformat=require(_0xf2a6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf2a6('0x1'));var jsonpatch=require(_0xf2a6('0x2'));var rp=require(_0xf2a6('0x3'));var moment=require(_0xf2a6('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xf2a6('0x5'));var path=require(_0xf2a6('0x6'));var sox=require('sox');var csv=require(_0xf2a6('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf2a6('0x8'));var _=require(_0xf2a6('0x9'));var squel=require(_0xf2a6('0xa'));var crypto=require(_0xf2a6('0xb'));var jsforce=require(_0xf2a6('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xf2a6('0x7'));var querystring=require(_0xf2a6('0xd'));var Papa=require('papaparse');var Redis=require(_0xf2a6('0xe'));var authService=require(_0xf2a6('0xf'));var qs=require(_0xf2a6('0x10'));var as=require(_0xf2a6('0x11'));var hardwareService=require(_0xf2a6('0x12'));var logger=require(_0xf2a6('0x13'))(_0xf2a6('0x14'));var utils=require(_0xf2a6('0x15'));var config=require(_0xf2a6('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xf2a6('0x17'))['db'];function respondWithStatusCode(_0x3b45d2,_0x3382f2){_0x3382f2=_0x3382f2||0xcc;return function(_0x44023f){if(_0x44023f){return _0x3b45d2[_0xf2a6('0x18')](_0x3382f2);}return _0x3b45d2[_0xf2a6('0x19')](_0x3382f2)[_0xf2a6('0x1a')]();};}function respondWithResult(_0x4a1d9a,_0x395bf7){_0x395bf7=_0x395bf7||0xc8;return function(_0x3ebcf2){if(_0x3ebcf2){return _0x4a1d9a[_0xf2a6('0x19')](_0x395bf7)[_0xf2a6('0x1b')](_0x3ebcf2);}};}function respondWithFilteredResult(_0x46b4d5,_0x348b90){return function(_0x26063e){if(_0x26063e){var _0xff5a60=typeof _0x348b90[_0xf2a6('0x1c')]==='undefined'&&typeof _0x348b90[_0xf2a6('0x1d')]===_0xf2a6('0x1e');var _0x11406c=_0x26063e[_0xf2a6('0x1f')];var _0x34c603=_0xff5a60?0x0:_0x348b90['offset'];var _0xd4bfa7=_0xff5a60?_0x26063e['count']:_0x348b90[_0xf2a6('0x1c')]+_0x348b90[_0xf2a6('0x1d')];var _0x13e28f;if(_0xd4bfa7>=_0x11406c){_0xd4bfa7=_0x11406c;_0x13e28f=0xc8;}else{_0x13e28f=0xce;}_0x46b4d5[_0xf2a6('0x19')](_0x13e28f);return _0x46b4d5[_0xf2a6('0x20')]('Content-Range',_0x34c603+'-'+_0xd4bfa7+'/'+_0x11406c)[_0xf2a6('0x1b')](_0x26063e);}return null;};}function patchUpdates(_0x2d4dce){return function(_0x4f75f8){try{jsonpatch[_0xf2a6('0x21')](_0x4f75f8,_0x2d4dce,!![]);}catch(_0x1f6fff){return BPromise[_0xf2a6('0x22')](_0x1f6fff);}return _0x4f75f8[_0xf2a6('0x23')]();};}function saveUpdates(_0x3a6adb,_0x42cd51){return function(_0x4e8e96){if(_0x4e8e96){return _0x4e8e96[_0xf2a6('0x24')](_0x3a6adb)[_0xf2a6('0x25')](function(_0x163680){return _0x163680;});}return null;};}function removeEntity(_0x1dceb3,_0x12f96c){return function(_0x19a0dc){if(_0x19a0dc){return _0x19a0dc[_0xf2a6('0x26')]()['then'](function(){_0x1dceb3[_0xf2a6('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1e4f47,_0x23592e){return function(_0x360b44){if(!_0x360b44){_0x1e4f47['sendStatus'](0x194);}return _0x360b44;};}function handleError(_0x31cee3,_0x3ee6b1){_0x3ee6b1=_0x3ee6b1||0x1f4;return function(_0x3fc8b5){logger[_0xf2a6('0x27')](_0x3fc8b5['stack']);if(_0x3fc8b5[_0xf2a6('0x28')]){delete _0x3fc8b5[_0xf2a6('0x28')];}_0x31cee3[_0xf2a6('0x19')](_0x3ee6b1)[_0xf2a6('0x29')](_0x3fc8b5);};}exports[_0xf2a6('0x2a')]=function(_0x5668e8,_0x484307){var _0x4ac65e={},_0x262a6e={},_0x2c4bf5={'count':0x0,'rows':[]};var _0x56bd51=_[_0xf2a6('0x2b')](db[_0xf2a6('0x2c')][_0xf2a6('0x2d')],function(_0x4936d3){return{'name':_0x4936d3[_0xf2a6('0x2e')],'type':_0x4936d3[_0xf2a6('0x2f')][_0xf2a6('0x30')]};});_0x262a6e[_0xf2a6('0x31')]=_[_0xf2a6('0x2b')](_0x56bd51,_0xf2a6('0x28'));_0x262a6e[_0xf2a6('0x32')]=_[_0xf2a6('0x33')](_0x5668e8[_0xf2a6('0x32')]);_0x262a6e[_0xf2a6('0x34')]=_[_0xf2a6('0x35')](_0x262a6e['model'],_0x262a6e[_0xf2a6('0x32')]);_0x4ac65e['attributes']=_[_0xf2a6('0x35')](_0x262a6e[_0xf2a6('0x31')],qs[_0xf2a6('0x36')](_0x5668e8[_0xf2a6('0x32')]['fields']));_0x4ac65e['attributes']=_0x4ac65e[_0xf2a6('0x37')][_0xf2a6('0x38')]?_0x4ac65e[_0xf2a6('0x37')]:_0x262a6e['model'];if(!_0x5668e8[_0xf2a6('0x32')][_0xf2a6('0x39')](_0xf2a6('0x3a'))){_0x4ac65e[_0xf2a6('0x1d')]=qs[_0xf2a6('0x1d')](_0x5668e8[_0xf2a6('0x32')][_0xf2a6('0x1d')]);_0x4ac65e[_0xf2a6('0x1c')]=qs['offset'](_0x5668e8['query'][_0xf2a6('0x1c')]);}_0x4ac65e[_0xf2a6('0x3b')]=qs[_0xf2a6('0x3c')](_0x5668e8[_0xf2a6('0x32')][_0xf2a6('0x3c')]);_0x4ac65e[_0xf2a6('0x3d')]=qs[_0xf2a6('0x34')](_[_0xf2a6('0x3e')](_0x5668e8[_0xf2a6('0x32')],_0x262a6e[_0xf2a6('0x34')]),_0x56bd51);if(_0x5668e8[_0xf2a6('0x32')][_0xf2a6('0x3f')]){_0x4ac65e[_0xf2a6('0x3d')]=_[_0xf2a6('0x40')](_0x4ac65e['where'],{'$or':_['map'](_0x56bd51,function(_0x2caad1){if(_0x2caad1[_0xf2a6('0x2f')]!==_0xf2a6('0x41')){var _0x597e2c={};_0x597e2c[_0x2caad1[_0xf2a6('0x28')]]={'$like':'%'+_0x5668e8[_0xf2a6('0x32')][_0xf2a6('0x3f')]+'%'};return _0x597e2c;}})});}_0x4ac65e=_['merge']({},_0x4ac65e,_0x5668e8['options']);var _0x5267c2={'where':_0x4ac65e[_0xf2a6('0x3d')]};return db[_0xf2a6('0x2c')][_0xf2a6('0x1f')](_0x5267c2)[_0xf2a6('0x25')](function(_0x4bea6f){_0x2c4bf5[_0xf2a6('0x1f')]=_0x4bea6f;if(_0x5668e8[_0xf2a6('0x32')][_0xf2a6('0x42')]){_0x4ac65e[_0xf2a6('0x43')]=[{'all':!![]}];}return db[_0xf2a6('0x2c')][_0xf2a6('0x44')](_0x4ac65e);})[_0xf2a6('0x25')](function(_0x1d6675){_0x2c4bf5['rows']=_0x1d6675;return _0x2c4bf5;})[_0xf2a6('0x25')](respondWithFilteredResult(_0x484307,_0x4ac65e))['catch'](handleError(_0x484307,null));};exports[_0xf2a6('0x45')]=function(_0x1f6def,_0x7ba8c7){var _0x26a997={'raw':![],'where':{'id':_0x1f6def[_0xf2a6('0x46')]['id']}},_0x4bd8a2={};_0x4bd8a2['model']=_[_0xf2a6('0x33')](db[_0xf2a6('0x2c')][_0xf2a6('0x2d')]);_0x4bd8a2[_0xf2a6('0x32')]=_['keys'](_0x1f6def[_0xf2a6('0x32')]);_0x4bd8a2[_0xf2a6('0x34')]=_[_0xf2a6('0x35')](_0x4bd8a2[_0xf2a6('0x31')],_0x4bd8a2[_0xf2a6('0x32')]);_0x26a997[_0xf2a6('0x37')]=_[_0xf2a6('0x35')](_0x4bd8a2['model'],qs[_0xf2a6('0x36')](_0x1f6def[_0xf2a6('0x32')][_0xf2a6('0x36')]));_0x26a997[_0xf2a6('0x37')]=_0x26a997['attributes'][_0xf2a6('0x38')]?_0x26a997[_0xf2a6('0x37')]:_0x4bd8a2[_0xf2a6('0x31')];if(_0x1f6def[_0xf2a6('0x32')][_0xf2a6('0x42')]){_0x26a997[_0xf2a6('0x43')]=[{'all':!![]}];}_0x26a997=_['merge']({},_0x26a997,_0x1f6def[_0xf2a6('0x47')]);return db[_0xf2a6('0x2c')][_0xf2a6('0x48')](_0x26a997)[_0xf2a6('0x25')](handleEntityNotFound(_0x7ba8c7,null))['then'](respondWithResult(_0x7ba8c7,null))[_0xf2a6('0x49')](handleError(_0x7ba8c7,null));};exports[_0xf2a6('0x4a')]=function(_0x4a435f,_0x3b3f99){return db[_0xf2a6('0x2c')]['create'](_0x4a435f[_0xf2a6('0x4b')],{})[_0xf2a6('0x25')](respondWithResult(_0x3b3f99,0xc9))['catch'](handleError(_0x3b3f99,null));};exports[_0xf2a6('0x24')]=function(_0x822a7e,_0x2a5149){if(_0x822a7e[_0xf2a6('0x4b')]['id']){delete _0x822a7e[_0xf2a6('0x4b')]['id'];}return db[_0xf2a6('0x2c')][_0xf2a6('0x48')]({'where':{'id':_0x822a7e['params']['id']}})[_0xf2a6('0x25')](handleEntityNotFound(_0x2a5149,null))[_0xf2a6('0x25')](saveUpdates(_0x822a7e[_0xf2a6('0x4b')],null))[_0xf2a6('0x25')](respondWithResult(_0x2a5149,null))['catch'](handleError(_0x2a5149,null));};exports[_0xf2a6('0x26')]=function(_0x480611,_0x47ab3e){return db['UserProfileSection'][_0xf2a6('0x48')]({'where':{'id':_0x480611['params']['id']}})[_0xf2a6('0x25')](handleEntityNotFound(_0x47ab3e,null))[_0xf2a6('0x25')](removeEntity(_0x47ab3e,null))[_0xf2a6('0x49')](handleError(_0x47ab3e,null));};exports[_0xf2a6('0x4c')]=function(_0x28a7da,_0x242ca3){return db[_0xf2a6('0x2c')][_0xf2a6('0x4c')]()[_0xf2a6('0x25')](respondWithResult(_0x242ca3,null))[_0xf2a6('0x49')](handleError(_0x242ca3,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index 6cb6c7d..17875fb 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 _0x86ab=['sectionId','userProfileId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./userProfileSection.attributes','define','UserProfileSection','user_profile_has_sections'];(function(_0x1eda22,_0x1df6f1){var _0x38f523=function(_0x35c9aa){while(--_0x35c9aa){_0x1eda22['push'](_0x1eda22['shift']());}};_0x38f523(++_0x1df6f1);}(_0x86ab,0xa7));var _0xb86a=function(_0x1cf52a,_0x4e02bc){_0x1cf52a=_0x1cf52a-0x0;var _0x5112ed=_0x86ab[_0x1cf52a];return _0x5112ed;};'use strict';var _=require(_0xb86a('0x0'));var util=require(_0xb86a('0x1'));var logger=require(_0xb86a('0x2'))(_0xb86a('0x3'));var moment=require(_0xb86a('0x4'));var BPromise=require(_0xb86a('0x5'));var rp=require(_0xb86a('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb86a('0x7'));var config=require(_0xb86a('0x8'));var attributes=require(_0xb86a('0x9'));module['exports']=function(_0x3080b7,_0x35a8a4){return _0x3080b7[_0xb86a('0xa')](_0xb86a('0xb'),attributes,{'tableName':_0xb86a('0xc'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0xb86a('0xd'),_0xb86a('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9133=['api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','sectionId','userProfileId','lodash','util'];(function(_0x348337,_0xc5b3ab){var _0xb9f38e=function(_0x530f9c){while(--_0x530f9c){_0x348337['push'](_0x348337['shift']());}};_0xb9f38e(++_0xc5b3ab);}(_0x9133,0x196));var _0x3913=function(_0x1e2c73,_0x12cd55){_0x1e2c73=_0x1e2c73-0x0;var _0x46f8d5=_0x9133[_0x1e2c73];return _0x46f8d5;};'use strict';var _=require(_0x3913('0x0'));var util=require(_0x3913('0x1'));var logger=require('../../config/logger')(_0x3913('0x2'));var moment=require(_0x3913('0x3'));var BPromise=require(_0x3913('0x4'));var rp=require(_0x3913('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3913('0x6'));var config=require(_0x3913('0x7'));var attributes=require('./userProfileSection.attributes');module[_0x3913('0x8')]=function(_0x4518f0,_0x53d3f8){return _0x4518f0[_0x3913('0x9')]('UserProfileSection',attributes,{'tableName':'user_profile_has_sections','paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0x3913('0xa'),_0x3913('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index ce3c9f0..35f6bba 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 _0x1403=['request\x20sent','stringify','error','message','UserProfileSection,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info'];(function(_0x212fcc,_0x1a8867){var _0x4d8190=function(_0x347f7b){while(--_0x347f7b){_0x212fcc['push'](_0x212fcc['shift']());}};_0x4d8190(++_0x1a8867);}(_0x1403,0x167));var _0x3140=function(_0xf969eb,_0x4c6c2d){_0xf969eb=_0xf969eb-0x0;var _0x2de570=_0x1403[_0xf969eb];return _0x2de570;};'use strict';var _=require(_0x3140('0x0'));var util=require(_0x3140('0x1'));var moment=require(_0x3140('0x2'));var BPromise=require(_0x3140('0x3'));var rs=require(_0x3140('0x4'));var fs=require('fs');var Redis=require(_0x3140('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x3140('0x6'));var logger=require(_0x3140('0x7'))(_0x3140('0x8'));var config=require('../../config/environment');var jayson=require(_0x3140('0x9'));var client=jayson[_0x3140('0xa')][_0x3140('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x444f49,_0x2693ae,_0x3b5e21){return new BPromise(function(_0x225494,_0x197ae2){return client[_0x3140('0xc')](_0x444f49,_0x3b5e21)[_0x3140('0xd')](function(_0x503cfc){logger[_0x3140('0xe')]('UserProfileSection,\x20%s,\x20%s',_0x2693ae,_0x3140('0xf'));logger['debug']('UserProfileSection,\x20%s,\x20%s,\x20%s',_0x2693ae,'request\x20sent',JSON[_0x3140('0x10')](_0x503cfc));if(_0x503cfc['error']){if(_0x503cfc['error']['code']===0x1f4){logger[_0x3140('0x11')]('UserProfileSection,\x20%s,\x20%s',_0x2693ae,_0x503cfc[_0x3140('0x11')]['message']);return _0x197ae2(_0x503cfc[_0x3140('0x11')][_0x3140('0x12')]);}logger[_0x3140('0x11')](_0x3140('0x13'),_0x2693ae,_0x503cfc[_0x3140('0x11')][_0x3140('0x12')]);return _0x225494(_0x503cfc[_0x3140('0x11')][_0x3140('0x12')]);}else{logger['info'](_0x3140('0x13'),_0x2693ae,_0x3140('0xf'));_0x225494(_0x503cfc[_0x3140('0x14')][_0x3140('0x12')]);}})[_0x3140('0x15')](function(_0x2df24f){logger[_0x3140('0x11')](_0x3140('0x13'),_0x2693ae,_0x2df24f);_0x197ae2(_0x2df24f);});});} \ No newline at end of file +var _0x6a4f=['error','message','catch','util','moment','randomstring','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','UserProfileSection,\x20%s,\x20%s','debug','request\x20sent','stringify','code'];(function(_0x263204,_0x19286b){var _0xed3987=function(_0x282bf1){while(--_0x282bf1){_0x263204['push'](_0x263204['shift']());}};_0xed3987(++_0x19286b);}(_0x6a4f,0x17d));var _0xf6a4=function(_0x4b6400,_0x4fd4fa){_0x4b6400=_0x4b6400-0x0;var _0x108597=_0x6a4f[_0x4b6400];return _0x108597;};'use strict';var _=require('lodash');var util=require(_0xf6a4('0x0'));var moment=require(_0xf6a4('0x1'));var BPromise=require('bluebird');var rs=require(_0xf6a4('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xf6a4('0x3'));var logger=require(_0xf6a4('0x4'))('rpc');var config=require(_0xf6a4('0x5'));var jayson=require(_0xf6a4('0x6'));var client=jayson['client'][_0xf6a4('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3488b3,_0x465a06,_0x857827){return new BPromise(function(_0x16d707,_0x43110f){return client[_0xf6a4('0x8')](_0x3488b3,_0x857827)[_0xf6a4('0x9')](function(_0x53683c){logger['info'](_0xf6a4('0xa'),_0x465a06,'request\x20sent');logger[_0xf6a4('0xb')]('UserProfileSection,\x20%s,\x20%s,\x20%s',_0x465a06,_0xf6a4('0xc'),JSON[_0xf6a4('0xd')](_0x53683c));if(_0x53683c['error']){if(_0x53683c['error'][_0xf6a4('0xe')]===0x1f4){logger[_0xf6a4('0xf')](_0xf6a4('0xa'),_0x465a06,_0x53683c['error']['message']);return _0x43110f(_0x53683c['error'][_0xf6a4('0x10')]);}logger[_0xf6a4('0xf')]('UserProfileSection,\x20%s,\x20%s',_0x465a06,_0x53683c[_0xf6a4('0xf')][_0xf6a4('0x10')]);return _0x16d707(_0x53683c[_0xf6a4('0xf')][_0xf6a4('0x10')]);}else{logger['info'](_0xf6a4('0xa'),_0x465a06,'request\x20sent');_0x16d707(_0x53683c['result']['message']);}})[_0xf6a4('0x11')](function(_0x2988fc){logger[_0xf6a4('0xf')](_0xf6a4('0xa'),_0x465a06,_0x2988fc);_0x43110f(_0x2988fc);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index 8f8069c..1ab1f79 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 _0x70e0=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','Router','fs-extra'];(function(_0xdf3a06,_0x42e85b){var _0x5a3f28=function(_0x37e885){while(--_0x37e885){_0xdf3a06['push'](_0xdf3a06['shift']());}};_0x5a3f28(++_0x42e85b);}(_0x70e0,0x17b));var _0x070e=function(_0x3d1d44,_0x720874){_0x3d1d44=_0x3d1d44-0x0;var _0x1fd4c9=_0x70e0[_0x3d1d44];return _0x1fd4c9;};'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 _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x372df5,_0x4c3340){var _0x55d332=function(_0x3890ca){while(--_0x3890ca){_0x372df5['push'](_0x372df5['shift']());}};_0x55d332(++_0x4c3340);}(_0x9c44,0x178));var _0x49c4=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0x9c44[_0x273c39];return _0x46d6b5;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index 64e3b90..39dd5b2 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 _0x9686=['exports','INTEGER','sequelize'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x9686,0xbc));var _0x6968=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9686[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x6968('0x0'));module[_0x6968('0x1')]={'penalty':{'type':Sequelize[_0x6968('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0x2138=['sequelize','exports','INTEGER'];(function(_0x4fcfdd,_0x18af5d){var _0x360e0b=function(_0x2143e3){while(--_0x2143e3){_0x4fcfdd['push'](_0x4fcfdd['shift']());}};_0x360e0b(++_0x18af5d);}(_0x2138,0x1ce));var _0x8213=function(_0x2a2ffc,_0x47a33){_0x2a2ffc=_0x2a2ffc-0x0;var _0x132de8=_0x2138[_0x2a2ffc];return _0x132de8;};'use strict';var Sequelize=require(_0x8213('0x0'));module[_0x8213('0x1')]={'penalty':{'type':Sequelize[_0x8213('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.model.js b/server/api/userSmsQueue/userSmsQueue.model.js index 8155c1e..14f8811 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 _0xfc65=['UserSmsQueue','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userSmsQueue.attributes','exports','define'];(function(_0x55e836,_0x50b958){var _0x5d1a4b=function(_0x31f212){while(--_0x31f212){_0x55e836['push'](_0x55e836['shift']());}};_0x5d1a4b(++_0x50b958);}(_0xfc65,0x1e1));var _0x5fc6=function(_0x49ebcc,_0xaa4119){_0x49ebcc=_0x49ebcc-0x0;var _0x4df085=_0xfc65[_0x49ebcc];return _0x4df085;};'use strict';var _=require(_0x5fc6('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x5fc6('0x1'));var moment=require(_0x5fc6('0x2'));var BPromise=require(_0x5fc6('0x3'));var rp=require(_0x5fc6('0x4'));var fs=require('fs');var path=require(_0x5fc6('0x5'));var rimraf=require(_0x5fc6('0x6'));var config=require(_0x5fc6('0x7'));var attributes=require(_0x5fc6('0x8'));module[_0x5fc6('0x9')]=function(_0x441b3e,_0x3100b4){return _0x441b3e[_0x5fc6('0xa')](_0x5fc6('0xb'),attributes,{'tableName':'user_has_sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3e24=['util','../../config/logger','api','moment','request-promise','path','../../config/environment','./userSmsQueue.attributes','exports','define','UserSmsQueue','lodash'];(function(_0x2e75d7,_0x3c84a1){var _0xad8375=function(_0x410b95){while(--_0x410b95){_0x2e75d7['push'](_0x2e75d7['shift']());}};_0xad8375(++_0x3c84a1);}(_0x3e24,0x167));var _0x43e2=function(_0x2fb16e,_0x161667){_0x2fb16e=_0x2fb16e-0x0;var _0x5e0882=_0x3e24[_0x2fb16e];return _0x5e0882;};'use strict';var _=require(_0x43e2('0x0'));var util=require(_0x43e2('0x1'));var logger=require(_0x43e2('0x2'))(_0x43e2('0x3'));var moment=require(_0x43e2('0x4'));var BPromise=require('bluebird');var rp=require(_0x43e2('0x5'));var fs=require('fs');var path=require(_0x43e2('0x6'));var rimraf=require('rimraf');var config=require(_0x43e2('0x7'));var attributes=require(_0x43e2('0x8'));module[_0x43e2('0x9')]=function(_0x28b144,_0x43b5a7){return _0x28b144[_0x43e2('0xa')](_0x43e2('0xb'),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 0f6d189..551e43e 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 _0xd6c9=['../../mysqldb','../../config/utils','../../config/environment','request','then','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','error','code','message','catch','moment','bluebird','ioredis'];(function(_0xd7b0a4,_0x53c7d3){var _0x184e9e=function(_0x325bbd){while(--_0x325bbd){_0xd7b0a4['push'](_0xd7b0a4['shift']());}};_0x184e9e(++_0x53c7d3);}(_0xd6c9,0xfc));var _0x9d6c=function(_0x4adfa4,_0x121c5a){_0x4adfa4=_0x4adfa4-0x0;var _0x14cec1=_0xd6c9[_0x4adfa4];return _0x14cec1;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9d6c('0x0'));var BPromise=require(_0x9d6c('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9d6c('0x2'));var db=require(_0x9d6c('0x3'))['db'];var utils=require(_0x9d6c('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x9d6c('0x5'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3e05db,_0x2d89ae,_0x57a6fb){return new BPromise(function(_0x4090d8,_0x27e5df){return client[_0x9d6c('0x6')](_0x3e05db,_0x57a6fb)[_0x9d6c('0x7')](function(_0x3cb210){logger[_0x9d6c('0x8')](_0x9d6c('0x9'),_0x2d89ae,_0x9d6c('0xa'));logger[_0x9d6c('0xb')](_0x9d6c('0xc'),_0x2d89ae,_0x9d6c('0xa'),JSON['stringify'](_0x3cb210));if(_0x3cb210[_0x9d6c('0xd')]){if(_0x3cb210[_0x9d6c('0xd')][_0x9d6c('0xe')]===0x1f4){logger[_0x9d6c('0xd')](_0x9d6c('0x9'),_0x2d89ae,_0x3cb210['error'][_0x9d6c('0xf')]);return _0x27e5df(_0x3cb210[_0x9d6c('0xd')]['message']);}logger[_0x9d6c('0xd')](_0x9d6c('0x9'),_0x2d89ae,_0x3cb210['error'][_0x9d6c('0xf')]);return _0x4090d8(_0x3cb210['error'][_0x9d6c('0xf')]);}else{logger[_0x9d6c('0x8')]('UserSmsQueue,\x20%s,\x20%s',_0x2d89ae,'request\x20sent');_0x4090d8(_0x3cb210['result'][_0x9d6c('0xf')]);}})[_0x9d6c('0x10')](function(_0x1ffa1b){logger['error'](_0x9d6c('0x9'),_0x2d89ae,_0x1ffa1b);_0x27e5df(_0x1ffa1b);});});} \ No newline at end of file +var _0xbf8a=['jayson/promise','client','http','request','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','UserSmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x1d7e80,_0x3fa685){var _0x152244=function(_0x44e6b6){while(--_0x44e6b6){_0x1d7e80['push'](_0x1d7e80['shift']());}};_0x152244(++_0x3fa685);}(_0xbf8a,0x11f));var _0xabf8=function(_0x1a611e,_0x11c716){_0x1a611e=_0x1a611e-0x0;var _0x53f593=_0xbf8a[_0x1a611e];return _0x53f593;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xabf8('0x0'));var BPromise=require(_0xabf8('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xabf8('0x2'));var db=require(_0xabf8('0x3'))['db'];var utils=require(_0xabf8('0x4'));var logger=require(_0xabf8('0x5'))(_0xabf8('0x6'));var config=require('../../config/environment');var jayson=require(_0xabf8('0x7'));var client=jayson[_0xabf8('0x8')][_0xabf8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x368454,_0x3a0cda,_0x12d210){return new BPromise(function(_0x560c66,_0x43cd8d){return client[_0xabf8('0xa')](_0x368454,_0x12d210)['then'](function(_0x36e1a3){logger[_0xabf8('0xb')](_0xabf8('0xc'),_0x3a0cda,_0xabf8('0xd'));logger['debug'](_0xabf8('0xe'),_0x3a0cda,_0xabf8('0xd'),JSON[_0xabf8('0xf')](_0x36e1a3));if(_0x36e1a3[_0xabf8('0x10')]){if(_0x36e1a3[_0xabf8('0x10')][_0xabf8('0x11')]===0x1f4){logger[_0xabf8('0x10')](_0xabf8('0xc'),_0x3a0cda,_0x36e1a3[_0xabf8('0x10')]['message']);return _0x43cd8d(_0x36e1a3['error'][_0xabf8('0x12')]);}logger[_0xabf8('0x10')]('UserSmsQueue,\x20%s,\x20%s',_0x3a0cda,_0x36e1a3[_0xabf8('0x10')][_0xabf8('0x12')]);return _0x560c66(_0x36e1a3['error']['message']);}else{logger[_0xabf8('0xb')](_0xabf8('0xc'),_0x3a0cda,_0xabf8('0xd'));_0x560c66(_0x36e1a3[_0xabf8('0x13')][_0xabf8('0x12')]);}})[_0xabf8('0x14')](function(_0x3c9eab){logger[_0xabf8('0x10')](_0xabf8('0xc'),_0x3a0cda,_0x3c9eab);_0x43cd8d(_0x3c9eab);});});} \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.attributes.js b/server/api/userVoicePrefix/userVoicePrefix.attributes.js index c4afe85..cadc99d 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 _0xe770=['INTEGER','exports'];(function(_0xa8b91a,_0x887c31){var _0x2242c4=function(_0x3255b3){while(--_0x3255b3){_0xa8b91a['push'](_0xa8b91a['shift']());}};_0x2242c4(++_0x887c31);}(_0xe770,0x1dd));var _0x0e77=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe770[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require('sequelize');module[_0x0e77('0x0')]={'UserId':{'type':Sequelize[_0x0e77('0x1')]},'VoicePrefixId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x9d5e=['exports','INTEGER','sequelize'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x9d5e,0x1be));var _0xe9d5=function(_0x5e2152,_0x172f3d){_0x5e2152=_0x5e2152-0x0;var _0x5ddcf6=_0x9d5e[_0x5e2152];return _0x5ddcf6;};'use strict';var Sequelize=require(_0xe9d5('0x0'));module[_0xe9d5('0x1')]={'UserId':{'type':Sequelize['INTEGER']},'VoicePrefixId':{'type':Sequelize[_0xe9d5('0x2')]}}; \ No newline at end of file diff --git a/server/api/userVoicePrefix/userVoicePrefix.model.js b/server/api/userVoicePrefix/userVoicePrefix.model.js index 63a0845..e633c98 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(_0x5aaf21,_0x3398d5){var _0x33ef95=function(_0x210763){while(--_0x210763){_0x5aaf21['push'](_0x5aaf21['shift']());}};_0x33ef95(++_0x3398d5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xa9e0[_0x4fc9e6];return _0x551d28;};'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(_0x403320,_0x4fdb46){var _0xfe4c0=function(_0x1b7eb0){while(--_0x1b7eb0){_0x403320['push'](_0x403320['shift']());}};_0xfe4c0(++_0x4fdb46);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0xa9e0[_0x3635ce];return _0x97ecd0;};'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 b3d4c4b..d88295a 100644 --- a/server/api/userVoiceQueue/index.js +++ b/server/api/userVoiceQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x4d5e00,_0x4d3c5d){var _0x3fe9b2=function(_0x4f7f85){while(--_0x4f7f85){_0x4d5e00['push'](_0x4d5e00['shift']());}};_0x3fe9b2(++_0x4d3c5d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xa9e0[_0x501510];return _0x1e6ee5;};'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(_0x2087de,_0x15a898){var _0x507219=function(_0x3e0875){while(--_0x3e0875){_0x2087de['push'](_0x2087de['shift']());}};_0x507219(++_0x15a898);}(_0x70e0,0x17b));var _0x070e=function(_0x5a7add,_0x198f2d){_0x5a7add=_0x5a7add-0x0;var _0x4961c8=_0x70e0[_0x5a7add];return _0x4961c8;};'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 a667cbd..01ae591 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 _0x226a=['sequelize','exports','INTEGER'];(function(_0x435f9c,_0x1bcc2c){var _0x4896f8=function(_0x9ab37a){while(--_0x9ab37a){_0x435f9c['push'](_0x435f9c['shift']());}};_0x4896f8(++_0x1bcc2c);}(_0x226a,0x177));var _0xa226=function(_0x2dbcef,_0x1cfecb){_0x2dbcef=_0x2dbcef-0x0;var _0x5a90ea=_0x226a[_0x2dbcef];return _0x5a90ea;};'use strict';var Sequelize=require(_0xa226('0x0'));module[_0xa226('0x1')]={'penalty':{'type':Sequelize[_0xa226('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xd06d=['INTEGER','exports'];(function(_0x3305de,_0x16582f){var _0x3b5a84=function(_0x57d7e1){while(--_0x57d7e1){_0x3305de['push'](_0x3305de['shift']());}};_0x3b5a84(++_0x16582f);}(_0xd06d,0xb1));var _0xdd06=function(_0x1acf4b,_0x5a750c){_0x1acf4b=_0x1acf4b-0x0;var _0x4eca09=_0xd06d[_0x1acf4b];return _0x4eca09;};'use strict';var Sequelize=require('sequelize');module[_0xdd06('0x0')]={'penalty':{'type':Sequelize[_0xdd06('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.model.js b/server/api/userVoiceQueue/userVoiceQueue.model.js index 8a31e83..792cfe8 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 _0xb20f=['rimraf','./userVoiceQueue.attributes','define','UserVoiceQueue','user_has_voice_queues','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x22f1f9,_0x8661aa){var _0x444a44=function(_0x38d3b9){while(--_0x38d3b9){_0x22f1f9['push'](_0x22f1f9['shift']());}};_0x444a44(++_0x8661aa);}(_0xb20f,0x7d));var _0xfb20=function(_0x543981,_0x1c047c){_0x543981=_0x543981-0x0;var _0x448129=_0xb20f[_0x543981];return _0x448129;};'use strict';var _=require(_0xfb20('0x0'));var util=require(_0xfb20('0x1'));var logger=require('../../config/logger')(_0xfb20('0x2'));var moment=require(_0xfb20('0x3'));var BPromise=require(_0xfb20('0x4'));var rp=require(_0xfb20('0x5'));var fs=require('fs');var path=require(_0xfb20('0x6'));var rimraf=require(_0xfb20('0x7'));var config=require('../../config/environment');var attributes=require(_0xfb20('0x8'));module['exports']=function(_0x5635a2,_0x3fed77){return _0x5635a2[_0xfb20('0x9')](_0xfb20('0xa'),attributes,{'tableName':_0xfb20('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8191=['api','moment','path','rimraf','exports','define','UserVoiceQueue','user_has_voice_queues','util','../../config/logger'];(function(_0x270c09,_0x4cae59){var _0x12db5c=function(_0x377bb8){while(--_0x377bb8){_0x270c09['push'](_0x270c09['shift']());}};_0x12db5c(++_0x4cae59);}(_0x8191,0x166));var _0x1819=function(_0x1261ac,_0x357a74){_0x1261ac=_0x1261ac-0x0;var _0x363168=_0x8191[_0x1261ac];return _0x363168;};'use strict';var _=require('lodash');var util=require(_0x1819('0x0'));var logger=require(_0x1819('0x1'))(_0x1819('0x2'));var moment=require(_0x1819('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x1819('0x4'));var rimraf=require(_0x1819('0x5'));var config=require('../../config/environment');var attributes=require('./userVoiceQueue.attributes');module[_0x1819('0x6')]=function(_0x57dcd5,_0x823f80){return _0x57dcd5[_0x1819('0x7')](_0x1819('0x8'),attributes,{'tableName':_0x1819('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.rpc.js b/server/api/userVoiceQueue/userVoiceQueue.rpc.js index 55627f4..aba3018 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 _0x0413=['ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','request','then','info','UserVoiceQueue,\x20%s,\x20%s','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','lodash','util','bluebird','randomstring'];(function(_0x5b8899,_0x291160){var _0x4f1e13=function(_0x41af50){while(--_0x41af50){_0x5b8899['push'](_0x5b8899['shift']());}};_0x4f1e13(++_0x291160);}(_0x0413,0x11a));var _0x3041=function(_0x14ff51,_0x14491b){_0x14ff51=_0x14ff51-0x0;var _0x4e0122=_0x0413[_0x14ff51];return _0x4e0122;};'use strict';var _=require(_0x3041('0x0'));var util=require(_0x3041('0x1'));var moment=require('moment');var BPromise=require(_0x3041('0x2'));var rs=require(_0x3041('0x3'));var fs=require('fs');var Redis=require(_0x3041('0x4'));var db=require(_0x3041('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x3041('0x6'))(_0x3041('0x7'));var config=require('../../config/environment');var jayson=require(_0x3041('0x8'));var client=jayson[_0x3041('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x44be9e,_0x248eb9,_0x3a520b){return new BPromise(function(_0x1b2ad9,_0x1417f7){return client[_0x3041('0xa')](_0x44be9e,_0x3a520b)[_0x3041('0xb')](function(_0x35077c){logger[_0x3041('0xc')](_0x3041('0xd'),_0x248eb9,'request\x20sent');logger[_0x3041('0xe')](_0x3041('0xf'),_0x248eb9,'request\x20sent',JSON[_0x3041('0x10')](_0x35077c));if(_0x35077c[_0x3041('0x11')]){if(_0x35077c[_0x3041('0x11')]['code']===0x1f4){logger[_0x3041('0x11')](_0x3041('0xd'),_0x248eb9,_0x35077c[_0x3041('0x11')][_0x3041('0x12')]);return _0x1417f7(_0x35077c['error'][_0x3041('0x12')]);}logger[_0x3041('0x11')](_0x3041('0xd'),_0x248eb9,_0x35077c[_0x3041('0x11')][_0x3041('0x12')]);return _0x1b2ad9(_0x35077c[_0x3041('0x11')]['message']);}else{logger['info'](_0x3041('0xd'),_0x248eb9,_0x3041('0x13'));_0x1b2ad9(_0x35077c[_0x3041('0x14')][_0x3041('0x12')]);}})[_0x3041('0x15')](function(_0x272996){logger['error']('UserVoiceQueue,\x20%s,\x20%s',_0x248eb9,_0x272996);_0x1417f7(_0x272996);});});} \ No newline at end of file +var _0x0835=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','moment','randomstring','ioredis','../../mysqldb'];(function(_0x1dd532,_0x36e81c){var _0x3732aa=function(_0x19d50a){while(--_0x19d50a){_0x1dd532['push'](_0x1dd532['shift']());}};_0x3732aa(++_0x36e81c);}(_0x0835,0x1ca));var _0x5083=function(_0x5938de,_0x1e709b){_0x5938de=_0x5938de-0x0;var _0x1f7b8d=_0x0835[_0x5938de];return _0x1f7b8d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x5083('0x0'));var BPromise=require('bluebird');var rs=require(_0x5083('0x1'));var fs=require('fs');var Redis=require(_0x5083('0x2'));var db=require(_0x5083('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x5083('0x4'))(_0x5083('0x5'));var config=require(_0x5083('0x6'));var jayson=require(_0x5083('0x7'));var client=jayson[_0x5083('0x8')][_0x5083('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xae1028,_0x370f6,_0x94e609){return new BPromise(function(_0x5bc19e,_0x2b820e){return client[_0x5083('0xa')](_0xae1028,_0x94e609)[_0x5083('0xb')](function(_0x4004bb){logger[_0x5083('0xc')](_0x5083('0xd'),_0x370f6,_0x5083('0xe'));logger[_0x5083('0xf')](_0x5083('0x10'),_0x370f6,_0x5083('0xe'),JSON[_0x5083('0x11')](_0x4004bb));if(_0x4004bb[_0x5083('0x12')]){if(_0x4004bb[_0x5083('0x12')][_0x5083('0x13')]===0x1f4){logger['error'](_0x5083('0xd'),_0x370f6,_0x4004bb[_0x5083('0x12')][_0x5083('0x14')]);return _0x2b820e(_0x4004bb[_0x5083('0x12')][_0x5083('0x14')]);}logger['error'](_0x5083('0xd'),_0x370f6,_0x4004bb['error'][_0x5083('0x14')]);return _0x5bc19e(_0x4004bb[_0x5083('0x12')][_0x5083('0x14')]);}else{logger[_0x5083('0xc')](_0x5083('0xd'),_0x370f6,_0x5083('0xe'));_0x5bc19e(_0x4004bb['result'][_0x5083('0x14')]);}})[_0x5083('0x15')](function(_0x265ebb){logger[_0x5083('0x12')](_0x5083('0xd'),_0x370f6,_0x265ebb);_0x2b820e(_0x265ebb);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index ec56743..dde5c91 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 _0xa9e0=['../../components/interaction/service','../../config/environment','exports','multer','util','path','Router','../../components/auth/service'];(function(_0x415429,_0x1e15b8){var _0x5f3cc5=function(_0x18e389){while(--_0x18e389){_0x415429['push'](_0x415429['shift']());}};_0x5f3cc5(++_0x1e15b8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x521929,_0x479be5){_0x521929=_0x521929-0x0;var _0x632436=_0xa9e0[_0x521929];return _0x632436;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));module[_0x0a9e('0x7')]=router; \ No newline at end of file +var _0xcb91=['express','Router','../../components/auth/service','../../components/interaction/service','exports','path','connect-timeout'];(function(_0x496d93,_0x188384){var _0x25b783=function(_0x32d58f){while(--_0x32d58f){_0x496d93['push'](_0x496d93['shift']());}};_0x25b783(++_0x188384);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x3dfeb9,_0x1cc6e4){_0x3dfeb9=_0x3dfeb9-0x0;var _0x412314=_0xcb91[_0x3dfeb9];return _0x412314;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1cb9('0x0'));var timeout=require(_0x1cb9('0x1'));var express=require(_0x1cb9('0x2'));var router=express[_0x1cb9('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x1cb9('0x4'));var interaction=require(_0x1cb9('0x5'));var config=require('../../config/environment');module[_0x1cb9('0x6')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index 7a9ba00..0b59a6e 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 _0x9270=['queue_interface','INTEGER','sequelize','Required\x20by\x20Asterisk','STRING'];(function(_0x49dd11,_0xfb0a87){var _0x5b6b02=function(_0x272a24){while(--_0x272a24){_0x49dd11['push'](_0x49dd11['shift']());}};_0x5b6b02(++_0xfb0a87);}(_0x9270,0x1d8));var _0x0927=function(_0x5ecadc,_0x1cf9f1){_0x5ecadc=_0x5ecadc-0x0;var _0x565037=_0x9270[_0x5ecadc];return _0x565037;};'use strict';var Sequelize=require(_0x0927('0x0'));module['exports']={'uniqueid':{'type':Sequelize['INTEGER'],'primaryKey':!![],'autoIncrement':!![],'comment':_0x0927('0x1')},'membername':{'type':Sequelize['STRING'],'allowNull':![],'comment':_0x0927('0x1')},'UserId':{'type':Sequelize['INTEGER'],'allowNull':![]},'queue_name':{'type':Sequelize[_0x0927('0x2')],'allowNull':![],'unique':_0x0927('0x3'),'comment':_0x0927('0x1')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'allowNull':![]},'interface':{'type':Sequelize[_0x0927('0x2')],'allowNull':![],'unique':_0x0927('0x3'),'comment':'Required\x20by\x20Asterisk'},'penalty':{'type':Sequelize[_0x0927('0x4')](0xb),'defaultValue':0x0,'comment':_0x0927('0x1')},'paused':{'type':Sequelize[_0x0927('0x4')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'}}; \ No newline at end of file +var _0xc67e=['exports','INTEGER','Required\x20by\x20Asterisk','queue_interface','STRING','sequelize'];(function(_0x2c1123,_0x2ddfb3){var _0x1ffd5a=function(_0x1611b9){while(--_0x1611b9){_0x2c1123['push'](_0x2c1123['shift']());}};_0x1ffd5a(++_0x2ddfb3);}(_0xc67e,0x65));var _0xec67=function(_0x301962,_0x35ed17){_0x301962=_0x301962-0x0;var _0x5d565d=_0xc67e[_0x301962];return _0x5d565d;};'use strict';var Sequelize=require(_0xec67('0x0'));module[_0xec67('0x1')]={'uniqueid':{'type':Sequelize[_0xec67('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':_0xec67('0x3')},'membername':{'type':Sequelize['STRING'],'allowNull':![],'comment':_0xec67('0x3')},'UserId':{'type':Sequelize[_0xec67('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xec67('0x4'),'comment':_0xec67('0x3')},'VoiceQueueId':{'type':Sequelize[_0xec67('0x2')],'allowNull':![]},'interface':{'type':Sequelize[_0xec67('0x5')],'allowNull':![],'unique':_0xec67('0x4'),'comment':'Required\x20by\x20Asterisk'},'penalty':{'type':Sequelize[_0xec67('0x2')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'},'paused':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0xec67('0x3')}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index 4568bb2..6ee2008 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 _0xdf38=['hook','exports','../../mysqldb','setMaxListeners','save','update','remove','emit'];(function(_0x505e6b,_0x1defed){var _0x493cb3=function(_0x2cb96c){while(--_0x2cb96c){_0x505e6b['push'](_0x505e6b['shift']());}};_0x493cb3(++_0x1defed);}(_0xdf38,0x1c2));var _0x8df3=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0xdf38[_0x465a0c];return _0x1e202e;};'use strict';var EventEmitter=require('events');var UserVoiceQueueRt=require(_0x8df3('0x0'))['db']['UserVoiceQueueRt'];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x8df3('0x1')](0x0);var events={'afterCreate':_0x8df3('0x2'),'afterUpdate':_0x8df3('0x3'),'afterDestroy':_0x8df3('0x4')};function emitEvent(_0x31d72a){return function(_0x589133,_0x5f0a8d,_0xca92e3){UserVoiceQueueRtEvents['emit'](_0x31d72a+':'+_0x589133['id'],_0x589133);UserVoiceQueueRtEvents[_0x8df3('0x5')](_0x31d72a,_0x589133);_0xca92e3(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserVoiceQueueRt[_0x8df3('0x6')](e,emitEvent(event));}}module[_0x8df3('0x7')]=UserVoiceQueueRtEvents; \ No newline at end of file +var _0xb755=['hook','exports','events','../../mysqldb','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb755,0x65));var _0x5b75=function(_0xa47cc2,_0xd009a5){_0xa47cc2=_0xa47cc2-0x0;var _0x32cd42=_0xb755[_0xa47cc2];return _0x32cd42;};'use strict';var EventEmitter=require(_0x5b75('0x0'));var UserVoiceQueueRt=require(_0x5b75('0x1'))['db']['UserVoiceQueueRt'];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x5b75('0x2')](0x0);var events={'afterCreate':_0x5b75('0x3'),'afterUpdate':_0x5b75('0x4'),'afterDestroy':'remove'};function emitEvent(_0x130116){return function(_0x46ce59,_0x34dc15,_0xb23204){UserVoiceQueueRtEvents[_0x5b75('0x5')](_0x130116+':'+_0x46ce59['id'],_0x46ce59);UserVoiceQueueRtEvents[_0x5b75('0x5')](_0x130116,_0x46ce59);_0xb23204(null);};}for(var e in events){if(events[_0x5b75('0x6')](e)){var event=events[e];UserVoiceQueueRt[_0x5b75('0x7')](e,emitEvent(event));}}module[_0x5b75('0x8')]=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index fb149ea..8f62f41 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 _0x4ccf=['rimraf','../../config/environment','./userVoiceQueueRt.attributes','exports','define','UserVoiceQueueRt','user_has_voice_queues_rt','lodash','util','../../config/logger','moment'];(function(_0x15d085,_0x49986f){var _0x1e89e4=function(_0x252b9f){while(--_0x252b9f){_0x15d085['push'](_0x15d085['shift']());}};_0x1e89e4(++_0x49986f);}(_0x4ccf,0xd8));var _0xf4cc=function(_0x4f7105,_0x40640c){_0x4f7105=_0x4f7105-0x0;var _0x5ed1f0=_0x4ccf[_0x4f7105];return _0x5ed1f0;};'use strict';var _=require(_0xf4cc('0x0'));var util=require(_0xf4cc('0x1'));var logger=require(_0xf4cc('0x2'))('api');var moment=require(_0xf4cc('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xf4cc('0x4'));var config=require(_0xf4cc('0x5'));var attributes=require(_0xf4cc('0x6'));module[_0xf4cc('0x7')]=function(_0x4a8885,_0x556546){return _0x4a8885[_0xf4cc('0x8')](_0xf4cc('0x9'),attributes,{'tableName':_0xf4cc('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1d90=['define','UserVoiceQueueRt','user_has_voice_queues_rt','lodash','util','api','bluebird','request-promise','../../config/environment','exports'];(function(_0x1db35a,_0x5d9432){var _0x54e539=function(_0x2b2358){while(--_0x2b2358){_0x1db35a['push'](_0x1db35a['shift']());}};_0x54e539(++_0x5d9432);}(_0x1d90,0x11b));var _0x01d9=function(_0x1ee41b,_0x1874af){_0x1ee41b=_0x1ee41b-0x0;var _0x1f5200=_0x1d90[_0x1ee41b];return _0x1f5200;};'use strict';var _=require(_0x01d9('0x0'));var util=require(_0x01d9('0x1'));var logger=require('../../config/logger')(_0x01d9('0x2'));var moment=require('moment');var BPromise=require(_0x01d9('0x3'));var rp=require(_0x01d9('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x01d9('0x5'));var attributes=require('./userVoiceQueueRt.attributes');module[_0x01d9('0x6')]=function(_0x510b5c,_0x298fe3){return _0x510b5c[_0x01d9('0x7')](_0x01d9('0x8'),attributes,{'tableName':_0x01d9('0x9'),'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 dd367fd..b422757 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 _0x7328=['raw','options','where','COUNT','sequelize','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','then','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./userVoiceQueueRt.socket','register','request','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt'];(function(_0x2d3755,_0x49abfd){var _0x44a935=function(_0x10e902){while(--_0x10e902){_0x2d3755['push'](_0x2d3755['shift']());}};_0x44a935(++_0x49abfd);}(_0x7328,0xd6));var _0x8732=function(_0x977c4f,_0x22e694){_0x977c4f=_0x977c4f-0x0;var _0x58eb63=_0x7328[_0x977c4f];return _0x58eb63;};'use strict';var _=require(_0x8732('0x0'));var util=require(_0x8732('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x8732('0x2'));var fs=require('fs');var Redis=require(_0x8732('0x3'));var db=require(_0x8732('0x4'))['db'];var utils=require(_0x8732('0x5'));var logger=require(_0x8732('0x6'))(_0x8732('0x7'));var config=require(_0x8732('0x8'));var jayson=require(_0x8732('0x9'));var client=jayson[_0x8732('0xa')][_0x8732('0xb')]({'port':0x232a});config[_0x8732('0xc')]=_[_0x8732('0xd')](config[_0x8732('0xc')],{'host':_0x8732('0xe'),'port':0x18eb});var socket=require(_0x8732('0xf'))(new Redis(config[_0x8732('0xc')]));require(_0x8732('0x10'))[_0x8732('0x11')](socket);function respondWithRpcPromise(_0x55d24d,_0x325330,_0x2731aa){return new BPromise(function(_0xc8df0a,_0x349525){return client[_0x8732('0x12')](_0x55d24d,_0x2731aa)['then'](function(_0x35b555){logger[_0x8732('0x13')](_0x8732('0x14'),_0x325330,_0x8732('0x15'));logger[_0x8732('0x16')](_0x8732('0x17'),_0x325330,'request\x20sent',JSON[_0x8732('0x18')](_0x35b555));if(_0x35b555[_0x8732('0x19')]){if(_0x35b555[_0x8732('0x19')][_0x8732('0x1a')]===0x1f4){logger[_0x8732('0x19')](_0x8732('0x14'),_0x325330,_0x35b555[_0x8732('0x19')][_0x8732('0x1b')]);return _0x349525(_0x35b555[_0x8732('0x19')][_0x8732('0x1b')]);}logger['error'](_0x8732('0x14'),_0x325330,_0x35b555[_0x8732('0x19')][_0x8732('0x1b')]);return _0xc8df0a(_0x35b555[_0x8732('0x19')]['message']);}else{logger['info'](_0x8732('0x14'),_0x325330,_0x8732('0x15'));_0xc8df0a(_0x35b555[_0x8732('0x1c')][_0x8732('0x1b')]);}})[_0x8732('0x1d')](function(_0x24caf4){logger['error'](_0x8732('0x14'),_0x325330,_0x24caf4);_0x349525(_0x24caf4);});});}exports[_0x8732('0x1e')]=function(_0x28325f){var _0x2fea26=this;return new Promise(function(_0x4e12a5,_0x5038ad){return db[_0x8732('0x1f')]['findAll']({'raw':_0x28325f['options']?_0x28325f['options'][_0x8732('0x20')]===undefined?!![]:![]:!![],'where':_0x28325f[_0x8732('0x21')]?_0x28325f[_0x8732('0x21')][_0x8732('0x22')]||null:null,'attributes':[[db['sequelize']['fn'](_0x8732('0x23'),db['sequelize']['fn']('IF',db[_0x8732('0x24')][_0x8732('0x25')](_0x8732('0x26')))),_0x8732('0x27')]]})[_0x8732('0x28')](function(_0x10a0b5){logger[_0x8732('0x13')](_0x8732('0x1e'),_0x28325f);logger['debug'](_0x8732('0x1e'),_0x28325f,JSON[_0x8732('0x18')](_0x10a0b5));_0x4e12a5(_0x10a0b5);})[_0x8732('0x1d')](function(_0x357fda){logger[_0x8732('0x19')](_0x8732('0x1e'),_0x357fda[_0x8732('0x1b')],_0x28325f);_0x5038ad(_0x2fea26[_0x8732('0x19')](0x1f4,_0x357fda[_0x8732('0x1b')]));});});}; \ No newline at end of file +var _0x6562=['request\x20sent','debug','error','code','message','result','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','raw','where','COUNT','sequelize','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','stringify','lodash','moment','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','register','then','info','UserVoiceQueueRt,\x20%s,\x20%s'];(function(_0x7fab38,_0x501063){var _0xb5c718=function(_0x471181){while(--_0x471181){_0x7fab38['push'](_0x7fab38['shift']());}};_0xb5c718(++_0x501063);}(_0x6562,0x17c));var _0x2656=function(_0xdbd4f7,_0x4e3bdd){_0xdbd4f7=_0xdbd4f7-0x0;var _0x5c3f9d=_0x6562[_0xdbd4f7];return _0x5c3f9d;};'use strict';var _=require(_0x2656('0x0'));var util=require('util');var moment=require(_0x2656('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2656('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0x2656('0x3'))(_0x2656('0x4'));var config=require(_0x2656('0x5'));var jayson=require(_0x2656('0x6'));var client=jayson[_0x2656('0x7')][_0x2656('0x8')]({'port':0x232a});config[_0x2656('0x9')]=_['defaults'](config[_0x2656('0x9')],{'host':_0x2656('0xa'),'port':0x18eb});var socket=require(_0x2656('0xb'))(new Redis(config[_0x2656('0x9')]));require('./userVoiceQueueRt.socket')[_0x2656('0xc')](socket);function respondWithRpcPromise(_0x405d43,_0x4d2004,_0x1a55ef){return new BPromise(function(_0x197812,_0x58a8b4){return client['request'](_0x405d43,_0x1a55ef)[_0x2656('0xd')](function(_0x49f7cb){logger[_0x2656('0xe')](_0x2656('0xf'),_0x4d2004,_0x2656('0x10'));logger[_0x2656('0x11')]('UserVoiceQueueRt,\x20%s,\x20%s,\x20%s',_0x4d2004,_0x2656('0x10'),JSON['stringify'](_0x49f7cb));if(_0x49f7cb[_0x2656('0x12')]){if(_0x49f7cb[_0x2656('0x12')][_0x2656('0x13')]===0x1f4){logger['error']('UserVoiceQueueRt,\x20%s,\x20%s',_0x4d2004,_0x49f7cb[_0x2656('0x12')][_0x2656('0x14')]);return _0x58a8b4(_0x49f7cb[_0x2656('0x12')][_0x2656('0x14')]);}logger[_0x2656('0x12')](_0x2656('0xf'),_0x4d2004,_0x49f7cb[_0x2656('0x12')][_0x2656('0x14')]);return _0x197812(_0x49f7cb[_0x2656('0x12')][_0x2656('0x14')]);}else{logger[_0x2656('0xe')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x4d2004,'request\x20sent');_0x197812(_0x49f7cb[_0x2656('0x15')][_0x2656('0x14')]);}})['catch'](function(_0xbb6cc6){logger[_0x2656('0x12')](_0x2656('0xf'),_0x4d2004,_0xbb6cc6);_0x58a8b4(_0xbb6cc6);});});}exports[_0x2656('0x16')]=function(_0x448168){var _0x1e7e79=this;return new Promise(function(_0x26bd1c,_0x5f068e){return db[_0x2656('0x17')][_0x2656('0x18')]({'raw':_0x448168['options']?_0x448168[_0x2656('0x19')][_0x2656('0x1a')]===undefined?!![]:![]:!![],'where':_0x448168[_0x2656('0x19')]?_0x448168[_0x2656('0x19')][_0x2656('0x1b')]||null:null,'attributes':[[db['sequelize']['fn'](_0x2656('0x1c'),db[_0x2656('0x1d')]['fn']('IF',db[_0x2656('0x1d')]['literal'](_0x2656('0x1e')))),_0x2656('0x1f')]]})['then'](function(_0x2a7ea4){logger[_0x2656('0xe')](_0x2656('0x16'),_0x448168);logger[_0x2656('0x11')](_0x2656('0x16'),_0x448168,JSON[_0x2656('0x20')](_0x2a7ea4));_0x26bd1c(_0x2a7ea4);})['catch'](function(_0x2e0ef8){logger['error'](_0x2656('0x16'),_0x2e0ef8['message'],_0x448168);_0x5f068e(_0x1e7e79[_0x2656('0x12')](0x1f4,_0x2e0ef8[_0x2656('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index d8dc6da..3c6dfcd 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 _0x22da=['length','userVoiceQueueRt:','remove','update','emit','removeListener'];(function(_0x34f31b,_0x41be74){var _0x3e9679=function(_0x1331e8){while(--_0x1331e8){_0x34f31b['push'](_0x34f31b['shift']());}};_0x3e9679(++_0x41be74);}(_0x22da,0x80));var _0xa22d=function(_0xed16f3,_0x4514d7){_0xed16f3=_0xed16f3-0x0;var _0x12c069=_0x22da[_0xed16f3];return _0x12c069;};'use strict';var UserVoiceQueueRtEvents=require('./userVoiceQueueRt.events');var events=['save',_0xa22d('0x0'),_0xa22d('0x1')];function createListener(_0x3d295f,_0x38c995){return function(_0x5a6dc9){_0x38c995[_0xa22d('0x2')](_0x3d295f,_0x5a6dc9);};}function removeListener(_0x34da8c,_0x3e2232){return function(){UserVoiceQueueRtEvents[_0xa22d('0x3')](_0x34da8c,_0x3e2232);};}exports['register']=function(_0x4007bd){for(var _0x9bc0eb=0x0,_0x4c67ad=events[_0xa22d('0x4')];_0x9bc0eb<_0x4c67ad;_0x9bc0eb++){var _0x44a5c7=events[_0x9bc0eb];var _0x5678bc=createListener(_0xa22d('0x5')+_0x44a5c7,_0x4007bd);UserVoiceQueueRtEvents['on'](_0x44a5c7,_0x5678bc);}}; \ No newline at end of file +var _0xa498=['save','remove','emit','removeListener','register','userVoiceQueueRt:','./userVoiceQueueRt.events'];(function(_0x5b561d,_0x422b7c){var _0x431060=function(_0x401409){while(--_0x401409){_0x5b561d['push'](_0x5b561d['shift']());}};_0x431060(++_0x422b7c);}(_0xa498,0x179));var _0x8a49=function(_0x221ba2,_0x79208){_0x221ba2=_0x221ba2-0x0;var _0x47d08e=_0xa498[_0x221ba2];return _0x47d08e;};'use strict';var UserVoiceQueueRtEvents=require(_0x8a49('0x0'));var events=[_0x8a49('0x1'),_0x8a49('0x2'),'update'];function createListener(_0x35e092,_0x3c8f12){return function(_0x59c55a){_0x3c8f12[_0x8a49('0x3')](_0x35e092,_0x59c55a);};}function removeListener(_0x4630fe,_0xecc049){return function(){UserVoiceQueueRtEvents[_0x8a49('0x4')](_0x4630fe,_0xecc049);};}exports[_0x8a49('0x5')]=function(_0x35a826){for(var _0x580bd3=0x0,_0x3208de=events['length'];_0x580bd3<_0x3208de;_0x580bd3++){var _0x560516=events[_0x580bd3];var _0x534f3e=createListener(_0x8a49('0x6')+_0x560516,_0x35a826);UserVoiceQueueRtEvents['on'](_0x560516,_0x534f3e);}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/index.js b/server/api/userWhatsappQueue/index.js index f0eb75c..8818a23 100644 --- a/server/api/userWhatsappQueue/index.js +++ b/server/api/userWhatsappQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9c44=['express','Router','fs-extra','../../components/auth/service','exports','path','connect-timeout'];(function(_0x1cd23d,_0xec4ea5){var _0x5e8ad5=function(_0x1603d8){while(--_0x1603d8){_0x1cd23d['push'](_0x1cd23d['shift']());}};_0x5e8ad5(++_0xec4ea5);}(_0x9c44,0x178));var _0x49c4=function(_0x24061a,_0x1c9f4d){_0x24061a=_0x24061a-0x0;var _0x82054e=_0x9c44[_0x24061a];return _0x82054e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x49c4('0x0'));var timeout=require(_0x49c4('0x1'));var express=require(_0x49c4('0x2'));var router=express[_0x49c4('0x3')]();var fs_extra=require(_0x49c4('0x4'));var auth=require(_0x49c4('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x49c4('0x6')]=router; \ No newline at end of file +var _0xedd9=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x474f68,_0x194973){var _0x49d3fe=function(_0x2ee551){while(--_0x2ee551){_0x474f68['push'](_0x474f68['shift']());}};_0x49d3fe(++_0x194973);}(_0xedd9,0xfc));var _0x9edd=function(_0x5adf1a,_0x1b587c){_0x5adf1a=_0x5adf1a-0x0;var _0x4f5d86=_0xedd9[_0x5adf1a];return _0x4f5d86;};'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/userWhatsappQueue/userWhatsappQueue.attributes.js b/server/api/userWhatsappQueue/userWhatsappQueue.attributes.js index 6427d7a..f9907e1 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 _0x9ac8=['INTEGER','sequelize','exports'];(function(_0x4b4a64,_0x212f0f){var _0x3580e3=function(_0x30454c){while(--_0x30454c){_0x4b4a64['push'](_0x4b4a64['shift']());}};_0x3580e3(++_0x212f0f);}(_0x9ac8,0x184));var _0x89ac=function(_0x2b9641,_0x289d0a){_0x2b9641=_0x2b9641-0x0;var _0x15817e=_0x9ac8[_0x2b9641];return _0x15817e;};'use strict';var Sequelize=require(_0x89ac('0x0'));module[_0x89ac('0x1')]={'penalty':{'type':Sequelize[_0x89ac('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xa12e=['sequelize','exports','INTEGER'];(function(_0x424a50,_0x1fd66d){var _0x1427b2=function(_0x35f2a0){while(--_0x35f2a0){_0x424a50['push'](_0x424a50['shift']());}};_0x1427b2(++_0x1fd66d);}(_0xa12e,0x6f));var _0xea12=function(_0xa76cbe,_0x53b6b6){_0xa76cbe=_0xa76cbe-0x0;var _0x4e47a8=_0xa12e[_0xa76cbe];return _0x4e47a8;};'use strict';var Sequelize=require(_0xea12('0x0'));module[_0xea12('0x1')]={'penalty':{'type':Sequelize[_0xea12('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userWhatsappQueue/userWhatsappQueue.model.js b/server/api/userWhatsappQueue/userWhatsappQueue.model.js index da63232..fe3b2a9 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 _0x3362=['../../config/environment','./userWhatsappQueue.attributes','exports','UserWhatsappQueue','user_has_whatsapp_queues','../../config/logger','api','moment','request-promise','path'];(function(_0x44f900,_0x1e7aa2){var _0x512f92=function(_0x126b9b){while(--_0x126b9b){_0x44f900['push'](_0x44f900['shift']());}};_0x512f92(++_0x1e7aa2);}(_0x3362,0x13b));var _0x2336=function(_0x3ea953,_0x36ed10){_0x3ea953=_0x3ea953-0x0;var _0xa32c2f=_0x3362[_0x3ea953];return _0xa32c2f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2336('0x0'))(_0x2336('0x1'));var moment=require(_0x2336('0x2'));var BPromise=require('bluebird');var rp=require(_0x2336('0x3'));var fs=require('fs');var path=require(_0x2336('0x4'));var rimraf=require('rimraf');var config=require(_0x2336('0x5'));var attributes=require(_0x2336('0x6'));module[_0x2336('0x7')]=function(_0x1c779b,_0x4cdb90){return _0x1c779b['define'](_0x2336('0x8'),attributes,{'tableName':_0x2336('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4fab=['UserWhatsappQueue','user_has_whatsapp_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./userWhatsappQueue.attributes','exports','define'];(function(_0x11c3c1,_0x139297){var _0x1a05d3=function(_0x5a348a){while(--_0x5a348a){_0x11c3c1['push'](_0x11c3c1['shift']());}};_0x1a05d3(++_0x139297);}(_0x4fab,0x1de));var _0xb4fa=function(_0x4af504,_0x4c8af9){_0x4af504=_0x4af504-0x0;var _0x6badaf=_0x4fab[_0x4af504];return _0x6badaf;};'use strict';var _=require(_0xb4fa('0x0'));var util=require(_0xb4fa('0x1'));var logger=require(_0xb4fa('0x2'))(_0xb4fa('0x3'));var moment=require(_0xb4fa('0x4'));var BPromise=require(_0xb4fa('0x5'));var rp=require(_0xb4fa('0x6'));var fs=require('fs');var path=require(_0xb4fa('0x7'));var rimraf=require('rimraf');var config=require(_0xb4fa('0x8'));var attributes=require(_0xb4fa('0x9'));module[_0xb4fa('0xa')]=function(_0x5d8415,_0x210186){return _0x5d8415[_0xb4fa('0xb')](_0xb4fa('0xc'),attributes,{'tableName':_0xb4fa('0xd'),'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 5462fb0..bea36a8 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 _0xb3ef=['UserWhatsappQueue,\x20%s,\x20%s','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xb3ef,0x1ea));var _0xfb3e=function(_0x153246,_0x4167af){_0x153246=_0x153246-0x0;var _0x4a20ee=_0xb3ef[_0x153246];return _0x4a20ee;};'use strict';var _=require('lodash');var util=require(_0xfb3e('0x0'));var moment=require(_0xfb3e('0x1'));var BPromise=require(_0xfb3e('0x2'));var rs=require(_0xfb3e('0x3'));var fs=require('fs');var Redis=require(_0xfb3e('0x4'));var db=require(_0xfb3e('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xfb3e('0x6'))(_0xfb3e('0x7'));var config=require(_0xfb3e('0x8'));var jayson=require(_0xfb3e('0x9'));var client=jayson[_0xfb3e('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2961d1,_0x99b51a,_0x454531){return new BPromise(function(_0x126767,_0x547530){return client[_0xfb3e('0xb')](_0x2961d1,_0x454531)[_0xfb3e('0xc')](function(_0x4a62aa){logger[_0xfb3e('0xd')](_0xfb3e('0xe'),_0x99b51a,'request\x20sent');logger[_0xfb3e('0xf')](_0xfb3e('0x10'),_0x99b51a,_0xfb3e('0x11'),JSON[_0xfb3e('0x12')](_0x4a62aa));if(_0x4a62aa[_0xfb3e('0x13')]){if(_0x4a62aa[_0xfb3e('0x13')][_0xfb3e('0x14')]===0x1f4){logger[_0xfb3e('0x13')](_0xfb3e('0xe'),_0x99b51a,_0x4a62aa[_0xfb3e('0x13')][_0xfb3e('0x15')]);return _0x547530(_0x4a62aa[_0xfb3e('0x13')][_0xfb3e('0x15')]);}logger[_0xfb3e('0x13')](_0xfb3e('0xe'),_0x99b51a,_0x4a62aa[_0xfb3e('0x13')][_0xfb3e('0x15')]);return _0x126767(_0x4a62aa[_0xfb3e('0x13')][_0xfb3e('0x15')]);}else{logger['info'](_0xfb3e('0xe'),_0x99b51a,'request\x20sent');_0x126767(_0x4a62aa[_0xfb3e('0x16')][_0xfb3e('0x15')]);}})[_0xfb3e('0x17')](function(_0x2dd0c6){logger[_0xfb3e('0x13')](_0xfb3e('0xe'),_0x99b51a,_0x2dd0c6);_0x547530(_0x2dd0c6);});});} \ No newline at end of file +var _0x59c5=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','UserWhatsappQueue,\x20%s,\x20%s','debug','UserWhatsappQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','util','bluebird','../../mysqldb'];(function(_0x3642c9,_0x4a3ae4){var _0x81cd5a=function(_0x22c4d7){while(--_0x22c4d7){_0x3642c9['push'](_0x3642c9['shift']());}};_0x81cd5a(++_0x4a3ae4);}(_0x59c5,0x6f));var _0x559c=function(_0xca3a68,_0x52614f){_0xca3a68=_0xca3a68-0x0;var _0x1166a8=_0x59c5[_0xca3a68];return _0x1166a8;};'use strict';var _=require(_0x559c('0x0'));var util=require(_0x559c('0x1'));var moment=require('moment');var BPromise=require(_0x559c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x559c('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x559c('0x4'))(_0x559c('0x5'));var config=require(_0x559c('0x6'));var jayson=require(_0x559c('0x7'));var client=jayson[_0x559c('0x8')][_0x559c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x27a5b2,_0x1d18e8,_0x494aa7){return new BPromise(function(_0x4844e4,_0x24a328){return client[_0x559c('0xa')](_0x27a5b2,_0x494aa7)[_0x559c('0xb')](function(_0x2858aa){logger['info'](_0x559c('0xc'),_0x1d18e8,'request\x20sent');logger[_0x559c('0xd')](_0x559c('0xe'),_0x1d18e8,_0x559c('0xf'),JSON[_0x559c('0x10')](_0x2858aa));if(_0x2858aa[_0x559c('0x11')]){if(_0x2858aa[_0x559c('0x11')][_0x559c('0x12')]===0x1f4){logger[_0x559c('0x11')](_0x559c('0xc'),_0x1d18e8,_0x2858aa[_0x559c('0x11')][_0x559c('0x13')]);return _0x24a328(_0x2858aa[_0x559c('0x11')][_0x559c('0x13')]);}logger['error'](_0x559c('0xc'),_0x1d18e8,_0x2858aa[_0x559c('0x11')][_0x559c('0x13')]);return _0x4844e4(_0x2858aa['error'][_0x559c('0x13')]);}else{logger[_0x559c('0x14')]('UserWhatsappQueue,\x20%s,\x20%s',_0x1d18e8,_0x559c('0xf'));_0x4844e4(_0x2858aa[_0x559c('0x15')]['message']);}})[_0x559c('0x16')](function(_0x14f839){logger[_0x559c('0x11')](_0x559c('0xc'),_0x1d18e8,_0x14f839);_0x24a328(_0x14f839);});});} \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index 9d994bd..f379d6a 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 _0xf50b=['destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./variable.controller','get','isAuthenticated','index','/:id','post','create','update','delete'];(function(_0x2e6bba,_0x739666){var _0x7d93ff=function(_0x51002d){while(--_0x51002d){_0x2e6bba['push'](_0x2e6bba['shift']());}};_0x7d93ff(++_0x739666);}(_0xf50b,0xc8));var _0xbf50=function(_0x568a32,_0x17c98a){_0x568a32=_0x568a32-0x0;var _0x2a8e4f=_0xf50b[_0x568a32];return _0x2a8e4f;};'use strict';var multer=require(_0xbf50('0x0'));var util=require(_0xbf50('0x1'));var path=require('path');var timeout=require(_0xbf50('0x2'));var express=require(_0xbf50('0x3'));var router=express[_0xbf50('0x4')]();var fs_extra=require(_0xbf50('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xbf50('0x6'));var config=require('../../config/environment');var controller=require(_0xbf50('0x7'));router[_0xbf50('0x8')]('/',auth[_0xbf50('0x9')](),controller[_0xbf50('0xa')]);router[_0xbf50('0x8')](_0xbf50('0xb'),auth[_0xbf50('0x9')](),controller['show']);router[_0xbf50('0xc')]('/',auth[_0xbf50('0x9')](),controller[_0xbf50('0xd')]);router['put']('/:id',auth[_0xbf50('0x9')](),controller[_0xbf50('0xe')]);router[_0xbf50('0xf')]('/:id',auth[_0xbf50('0x9')](),controller[_0xbf50('0x10')]);module[_0xbf50('0x11')]=router; \ No newline at end of file +var _0xf6c1=['path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./variable.controller','get','isAuthenticated','index','/:id','show','post','create','put','destroy','exports'];(function(_0x3dedf3,_0xf67a6a){var _0xf676fc=function(_0x237736){while(--_0x237736){_0x3dedf3['push'](_0x3dedf3['shift']());}};_0xf676fc(++_0xf67a6a);}(_0xf6c1,0x99));var _0x1f6c=function(_0x1271d1,_0x36b091){_0x1271d1=_0x1271d1-0x0;var _0x4c4ca9=_0xf6c1[_0x1271d1];return _0x4c4ca9;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x1f6c('0x0'));var timeout=require(_0x1f6c('0x1'));var express=require(_0x1f6c('0x2'));var router=express['Router']();var fs_extra=require(_0x1f6c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x1f6c('0x4'));var config=require(_0x1f6c('0x5'));var controller=require(_0x1f6c('0x6'));router[_0x1f6c('0x7')]('/',auth[_0x1f6c('0x8')](),controller[_0x1f6c('0x9')]);router['get'](_0x1f6c('0xa'),auth[_0x1f6c('0x8')](),controller[_0x1f6c('0xb')]);router[_0x1f6c('0xc')]('/',auth[_0x1f6c('0x8')](),controller[_0x1f6c('0xd')]);router[_0x1f6c('0xe')](_0x1f6c('0xa'),auth[_0x1f6c('0x8')](),controller['update']);router['delete']('/:id',auth[_0x1f6c('0x8')](),controller[_0x1f6c('0xf')]);module[_0x1f6c('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 6cc360b..44e4b08 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 _0x0dec=['sequelize','exports','STRING','name'];(function(_0x5df18c,_0x1958a4){var _0x286d6e=function(_0x858d00){while(--_0x858d00){_0x5df18c['push'](_0x5df18c['shift']());}};_0x286d6e(++_0x1958a4);}(_0x0dec,0x11c));var _0xc0de=function(_0x236d97,_0xd27b85){_0x236d97=_0x236d97-0x0;var _0x8314cc=_0x0dec[_0x236d97];return _0x8314cc;};'use strict';var Sequelize=require(_0xc0de('0x0'));module[_0xc0de('0x1')]={'name':{'type':Sequelize[_0xc0de('0x2')],'unique':_0xc0de('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xe562=['STRING','name','sequelize'];(function(_0x9df060,_0x253d33){var _0x338dfe=function(_0x17d9a5){while(--_0x17d9a5){_0x9df060['push'](_0x9df060['shift']());}};_0x338dfe(++_0x253d33);}(_0xe562,0x6b));var _0x2e56=function(_0xecb6e0,_0x112a43){_0xecb6e0=_0xecb6e0-0x0;var _0x1b49aa=_0xe562[_0xecb6e0];return _0x1b49aa;};'use strict';var Sequelize=require(_0x2e56('0x0'));module['exports']={'name':{'type':Sequelize[_0x2e56('0x1')],'unique':_0x2e56('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 596b128..5a15b83 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 _0xef2f=['nolimit','order','sort','where','filter','merge','VIRTUAL','includeAll','include','Variable','findAll','rows','catch','show','params','length','options','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','count','Content-Range','apply','reject','save','then','destroy','get','Variables','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes'];(function(_0x4bdfe7,_0x3fc94c){var _0x1860df=function(_0x5ca456){while(--_0x5ca456){_0x4bdfe7['push'](_0x4bdfe7['shift']());}};_0x1860df(++_0x3fc94c);}(_0xef2f,0x1bf));var _0xfef2=function(_0x55e08b,_0x421620){_0x55e08b=_0x55e08b-0x0;var _0xd1a7ff=_0xef2f[_0x55e08b];return _0xd1a7ff;};'use strict';var emlformat=require(_0xfef2('0x0'));var rimraf=require(_0xfef2('0x1'));var zipdir=require(_0xfef2('0x2'));var jsonpatch=require(_0xfef2('0x3'));var rp=require(_0xfef2('0x4'));var moment=require(_0xfef2('0x5'));var BPromise=require(_0xfef2('0x6'));var Mustache=require(_0xfef2('0x7'));var util=require(_0xfef2('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0xfef2('0x9'));var ejs=require(_0xfef2('0xa'));var fs=require('fs');var fs_extra=require(_0xfef2('0xb'));var _=require(_0xfef2('0xc'));var squel=require(_0xfef2('0xd'));var crypto=require('crypto');var jsforce=require(_0xfef2('0xe'));var deskjs=require(_0xfef2('0xf'));var toCsv=require(_0xfef2('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xfef2('0x10'));var authService=require(_0xfef2('0x11'));var qs=require(_0xfef2('0x12'));var as=require(_0xfef2('0x13'));var hardwareService=require(_0xfef2('0x14'));var logger=require('../../config/logger')(_0xfef2('0x15'));var utils=require('../../config/utils');var config=require(_0xfef2('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xfef2('0x17'))['db'];function respondWithStatusCode(_0x52420a,_0x543f1b){_0x543f1b=_0x543f1b||0xcc;return function(_0x24cb96){if(_0x24cb96){return _0x52420a[_0xfef2('0x18')](_0x543f1b);}return _0x52420a['status'](_0x543f1b)[_0xfef2('0x19')]();};}function respondWithResult(_0xc7ba06,_0x4a1207){_0x4a1207=_0x4a1207||0xc8;return function(_0x3b4290){if(_0x3b4290){return _0xc7ba06[_0xfef2('0x1a')](_0x4a1207)[_0xfef2('0x1b')](_0x3b4290);}};}function respondWithFilteredResult(_0x4a4420,_0x51220d){return function(_0x2c10fd){if(_0x2c10fd){var _0x41fbdc=typeof _0x51220d['offset']===_0xfef2('0x1c')&&typeof _0x51220d[_0xfef2('0x1d')]===_0xfef2('0x1c');var _0xee8bb7=_0x2c10fd['count'];var _0x183ad8=_0x41fbdc?0x0:_0x51220d[_0xfef2('0x1e')];var _0x158f19=_0x41fbdc?_0x2c10fd[_0xfef2('0x1f')]:_0x51220d['offset']+_0x51220d[_0xfef2('0x1d')];var _0x14188a;if(_0x158f19>=_0xee8bb7){_0x158f19=_0xee8bb7;_0x14188a=0xc8;}else{_0x14188a=0xce;}_0x4a4420['status'](_0x14188a);return _0x4a4420['set'](_0xfef2('0x20'),_0x183ad8+'-'+_0x158f19+'/'+_0xee8bb7)[_0xfef2('0x1b')](_0x2c10fd);}return null;};}function patchUpdates(_0x547dae){return function(_0x2f5aee){try{jsonpatch[_0xfef2('0x21')](_0x2f5aee,_0x547dae,!![]);}catch(_0x585a38){return BPromise[_0xfef2('0x22')](_0x585a38);}return _0x2f5aee[_0xfef2('0x23')]();};}function saveUpdates(_0xcc28ae,_0x4ccacb){return function(_0x1d0211){if(_0x1d0211){return _0x1d0211['update'](_0xcc28ae)[_0xfef2('0x24')](function(_0x40b1b4){return _0x40b1b4;});}return null;};}function removeEntity(_0x185afa,_0x57cbe5){return function(_0x15021b){if(_0x15021b){return _0x15021b[_0xfef2('0x25')]()[_0xfef2('0x24')](function(){var _0x124ec1=_0x15021b[_0xfef2('0x26')]({'plain':!![]});var _0x262a26=_0xfef2('0x27');return db[_0xfef2('0x28')][_0xfef2('0x25')]({'where':{'type':_0x262a26,'resourceId':_0x124ec1['id']}})[_0xfef2('0x24')](function(){return _0x15021b;});})[_0xfef2('0x24')](function(){_0x185afa['status'](0xcc)[_0xfef2('0x19')]();});}};}function handleEntityNotFound(_0x690636,_0x3a38cb){return function(_0x598d7d){if(!_0x598d7d){_0x690636[_0xfef2('0x18')](0x194);}return _0x598d7d;};}function handleError(_0x4f2482,_0x43f0c4){_0x43f0c4=_0x43f0c4||0x1f4;return function(_0x4ecc21){logger[_0xfef2('0x29')](_0x4ecc21[_0xfef2('0x2a')]);if(_0x4ecc21[_0xfef2('0x2b')]){delete _0x4ecc21[_0xfef2('0x2b')];}_0x4f2482[_0xfef2('0x1a')](_0x43f0c4)[_0xfef2('0x2c')](_0x4ecc21);};}exports[_0xfef2('0x2d')]=function(_0x58a494,_0x13de47){var _0x2e9617={},_0x27b498={},_0x3515e6={'count':0x0,'rows':[]};var _0x26c492=_[_0xfef2('0x2e')](db['Variable'][_0xfef2('0x2f')],function(_0x3f1ed0){return{'name':_0x3f1ed0[_0xfef2('0x30')],'type':_0x3f1ed0[_0xfef2('0x31')]['key']};});_0x27b498[_0xfef2('0x32')]=_['map'](_0x26c492,_0xfef2('0x2b'));_0x27b498[_0xfef2('0x33')]=_[_0xfef2('0x34')](_0x58a494['query']);_0x27b498[_0xfef2('0x35')]=_[_0xfef2('0x36')](_0x27b498[_0xfef2('0x32')],_0x27b498[_0xfef2('0x33')]);_0x2e9617['attributes']=_['intersection'](_0x27b498[_0xfef2('0x32')],qs[_0xfef2('0x37')](_0x58a494[_0xfef2('0x33')]['fields']));_0x2e9617[_0xfef2('0x38')]=_0x2e9617[_0xfef2('0x38')]['length']?_0x2e9617[_0xfef2('0x38')]:_0x27b498[_0xfef2('0x32')];if(!_0x58a494[_0xfef2('0x33')]['hasOwnProperty'](_0xfef2('0x39'))){_0x2e9617['limit']=qs[_0xfef2('0x1d')](_0x58a494[_0xfef2('0x33')][_0xfef2('0x1d')]);_0x2e9617[_0xfef2('0x1e')]=qs[_0xfef2('0x1e')](_0x58a494[_0xfef2('0x33')][_0xfef2('0x1e')]);}_0x2e9617[_0xfef2('0x3a')]=qs[_0xfef2('0x3b')](_0x58a494[_0xfef2('0x33')][_0xfef2('0x3b')]);_0x2e9617[_0xfef2('0x3c')]=qs['filters'](_['pick'](_0x58a494[_0xfef2('0x33')],_0x27b498[_0xfef2('0x35')]),_0x26c492);if(_0x58a494['query'][_0xfef2('0x3d')]){_0x2e9617[_0xfef2('0x3c')]=_[_0xfef2('0x3e')](_0x2e9617['where'],{'$or':_['map'](_0x26c492,function(_0x55b485){if(_0x55b485[_0xfef2('0x31')]!==_0xfef2('0x3f')){var _0x544c29={};_0x544c29[_0x55b485[_0xfef2('0x2b')]]={'$like':'%'+_0x58a494[_0xfef2('0x33')][_0xfef2('0x3d')]+'%'};return _0x544c29;}})});}_0x2e9617=_[_0xfef2('0x3e')]({},_0x2e9617,_0x58a494['options']);var _0x8fc9a2={'where':_0x2e9617[_0xfef2('0x3c')]};return db['Variable'][_0xfef2('0x1f')](_0x8fc9a2)[_0xfef2('0x24')](function(_0x58b16a){_0x3515e6[_0xfef2('0x1f')]=_0x58b16a;if(_0x58a494['query'][_0xfef2('0x40')]){_0x2e9617[_0xfef2('0x41')]=[{'all':!![]}];}return db[_0xfef2('0x42')][_0xfef2('0x43')](_0x2e9617);})[_0xfef2('0x24')](function(_0x244ee5){_0x3515e6[_0xfef2('0x44')]=_0x244ee5;return _0x3515e6;})[_0xfef2('0x24')](respondWithFilteredResult(_0x13de47,_0x2e9617))[_0xfef2('0x45')](handleError(_0x13de47,null));};exports[_0xfef2('0x46')]=function(_0x26447b,_0x1b5143){var _0x227b1f={'raw':!![],'where':{'id':_0x26447b[_0xfef2('0x47')]['id']}},_0x1cfc50={};_0x1cfc50[_0xfef2('0x32')]=_[_0xfef2('0x34')](db[_0xfef2('0x42')]['rawAttributes']);_0x1cfc50[_0xfef2('0x33')]=_['keys'](_0x26447b[_0xfef2('0x33')]);_0x1cfc50[_0xfef2('0x35')]=_['intersection'](_0x1cfc50[_0xfef2('0x32')],_0x1cfc50[_0xfef2('0x33')]);_0x227b1f['attributes']=_[_0xfef2('0x36')](_0x1cfc50[_0xfef2('0x32')],qs[_0xfef2('0x37')](_0x26447b[_0xfef2('0x33')][_0xfef2('0x37')]));_0x227b1f[_0xfef2('0x38')]=_0x227b1f['attributes'][_0xfef2('0x48')]?_0x227b1f[_0xfef2('0x38')]:_0x1cfc50['model'];if(_0x26447b[_0xfef2('0x33')][_0xfef2('0x40')]){_0x227b1f[_0xfef2('0x41')]=[{'all':!![]}];}_0x227b1f=_[_0xfef2('0x3e')]({},_0x227b1f,_0x26447b[_0xfef2('0x49')]);return db['Variable'][_0xfef2('0x4a')](_0x227b1f)['then'](handleEntityNotFound(_0x1b5143,null))[_0xfef2('0x24')](respondWithResult(_0x1b5143,null))[_0xfef2('0x45')](handleError(_0x1b5143,null));};exports[_0xfef2('0x4b')]=function(_0x2fe03b,_0x23aca8){return db[_0xfef2('0x42')][_0xfef2('0x4b')](_0x2fe03b['body'],{})[_0xfef2('0x24')](function(_0x376c50){var _0x11250d=_0x2fe03b[_0xfef2('0x4c')]['get']({'plain':!![]});if(!_0x11250d)throw new Error(_0xfef2('0x4d'));if(_0x11250d[_0xfef2('0x4e')]===_0xfef2('0x4c')){var _0x5d20c1=_0x376c50[_0xfef2('0x26')]({'plain':!![]});var _0xefd160=_0xfef2('0x27');return db[_0xfef2('0x4f')][_0xfef2('0x4a')]({'where':{'name':_0xefd160,'userProfileId':_0x11250d['userProfileId']},'raw':!![]})['then'](function(_0x533bf1){if(_0x533bf1&&_0x533bf1[_0xfef2('0x50')]===0x0){return db[_0xfef2('0x28')]['create']({'name':_0x5d20c1[_0xfef2('0x2b')],'resourceId':_0x5d20c1['id'],'type':_0x533bf1['name'],'sectionId':_0x533bf1['id']},{})[_0xfef2('0x24')](function(){return _0x376c50;});}else{return _0x376c50;}})[_0xfef2('0x45')](function(_0x1e4cb6){logger[_0xfef2('0x29')](_0xfef2('0x51'),_0x1e4cb6);throw _0x1e4cb6;});}return _0x376c50;})[_0xfef2('0x24')](respondWithResult(_0x23aca8,0xc9))[_0xfef2('0x45')](handleError(_0x23aca8,null));};exports[_0xfef2('0x52')]=function(_0x20b56f,_0x19d0c4){if(_0x20b56f[_0xfef2('0x53')]['id']){delete _0x20b56f[_0xfef2('0x53')]['id'];}return db[_0xfef2('0x42')][_0xfef2('0x4a')]({'where':{'id':_0x20b56f[_0xfef2('0x47')]['id']}})[_0xfef2('0x24')](handleEntityNotFound(_0x19d0c4,null))[_0xfef2('0x24')](saveUpdates(_0x20b56f[_0xfef2('0x53')],null))[_0xfef2('0x24')](respondWithResult(_0x19d0c4,null))[_0xfef2('0x45')](handleError(_0x19d0c4,null));};exports['destroy']=function(_0x29da76,_0x2391db){return db[_0xfef2('0x42')][_0xfef2('0x4a')]({'where':{'id':_0x29da76[_0xfef2('0x47')]['id']}})[_0xfef2('0x24')](handleEntityNotFound(_0x2391db,null))[_0xfef2('0x24')](removeEntity(_0x2391db,null))[_0xfef2('0x45')](handleError(_0x2391db,null));}; \ No newline at end of file +var _0x110b=['moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','get','UserProfileResource','destroy','stack','name','index','map','Variable','type','key','model','query','filters','intersection','attributes','fields','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','keys','rawAttributes','length','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','eml-format','zip-dir','fast-json-patch','request-promise'];(function(_0x5581c9,_0x3792da){var _0x1a2ef7=function(_0x47ca00){while(--_0x47ca00){_0x5581c9['push'](_0x5581c9['shift']());}};_0x1a2ef7(++_0x3792da);}(_0x110b,0x1f4));var _0xb110=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0x110b[_0x36c5b0];return _0xf19333;};'use strict';var emlformat=require(_0xb110('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb110('0x1'));var jsonpatch=require(_0xb110('0x2'));var rp=require(_0xb110('0x3'));var moment=require(_0xb110('0x4'));var BPromise=require(_0xb110('0x5'));var Mustache=require('mustache');var util=require(_0xb110('0x6'));var path=require(_0xb110('0x7'));var sox=require(_0xb110('0x8'));var csv=require(_0xb110('0x9'));var ejs=require(_0xb110('0xa'));var fs=require('fs');var fs_extra=require(_0xb110('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xb110('0xc'));var jsforce=require(_0xb110('0xd'));var deskjs=require(_0xb110('0xe'));var toCsv=require(_0xb110('0x9'));var querystring=require(_0xb110('0xf'));var Papa=require(_0xb110('0x10'));var Redis=require(_0xb110('0x11'));var authService=require(_0xb110('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xb110('0x13'))('api');var utils=require(_0xb110('0x14'));var config=require(_0xb110('0x15'));var licenseUtil=require(_0xb110('0x16'));var db=require(_0xb110('0x17'))['db'];function respondWithStatusCode(_0x19ab82,_0x2cbc70){_0x2cbc70=_0x2cbc70||0xcc;return function(_0x54bc2f){if(_0x54bc2f){return _0x19ab82[_0xb110('0x18')](_0x2cbc70);}return _0x19ab82[_0xb110('0x19')](_0x2cbc70)[_0xb110('0x1a')]();};}function respondWithResult(_0x5c167a,_0xe44f4b){_0xe44f4b=_0xe44f4b||0xc8;return function(_0x1b8827){if(_0x1b8827){return _0x5c167a[_0xb110('0x19')](_0xe44f4b)[_0xb110('0x1b')](_0x1b8827);}};}function respondWithFilteredResult(_0x326d75,_0x4baf49){return function(_0x3e9344){if(_0x3e9344){var _0x504dba=typeof _0x4baf49[_0xb110('0x1c')]==='undefined'&&typeof _0x4baf49['limit']===_0xb110('0x1d');var _0x4ce540=_0x3e9344[_0xb110('0x1e')];var _0x4695a8=_0x504dba?0x0:_0x4baf49[_0xb110('0x1c')];var _0x2e1e90=_0x504dba?_0x3e9344[_0xb110('0x1e')]:_0x4baf49[_0xb110('0x1c')]+_0x4baf49[_0xb110('0x1f')];var _0x4c8b14;if(_0x2e1e90>=_0x4ce540){_0x2e1e90=_0x4ce540;_0x4c8b14=0xc8;}else{_0x4c8b14=0xce;}_0x326d75[_0xb110('0x19')](_0x4c8b14);return _0x326d75[_0xb110('0x20')](_0xb110('0x21'),_0x4695a8+'-'+_0x2e1e90+'/'+_0x4ce540)[_0xb110('0x1b')](_0x3e9344);}return null;};}function patchUpdates(_0x9b438b){return function(_0x5a80e8){try{jsonpatch[_0xb110('0x22')](_0x5a80e8,_0x9b438b,!![]);}catch(_0x103011){return BPromise[_0xb110('0x23')](_0x103011);}return _0x5a80e8[_0xb110('0x24')]();};}function saveUpdates(_0x480c4c,_0x2ac850){return function(_0x5ddc9c){if(_0x5ddc9c){return _0x5ddc9c[_0xb110('0x25')](_0x480c4c)[_0xb110('0x26')](function(_0x517f20){return _0x517f20;});}return null;};}function removeEntity(_0x492aaa,_0x4b406a){return function(_0x1aca8e){if(_0x1aca8e){return _0x1aca8e['destroy']()[_0xb110('0x26')](function(){var _0xc1773d=_0x1aca8e[_0xb110('0x27')]({'plain':!![]});var _0x28c7e1='Variables';return db[_0xb110('0x28')][_0xb110('0x29')]({'where':{'type':_0x28c7e1,'resourceId':_0xc1773d['id']}})['then'](function(){return _0x1aca8e;});})[_0xb110('0x26')](function(){_0x492aaa[_0xb110('0x19')](0xcc)[_0xb110('0x1a')]();});}};}function handleEntityNotFound(_0x25cfad,_0x24b902){return function(_0x135eb1){if(!_0x135eb1){_0x25cfad[_0xb110('0x18')](0x194);}return _0x135eb1;};}function handleError(_0x39653f,_0x15b049){_0x15b049=_0x15b049||0x1f4;return function(_0x11cafa){logger['error'](_0x11cafa[_0xb110('0x2a')]);if(_0x11cafa[_0xb110('0x2b')]){delete _0x11cafa[_0xb110('0x2b')];}_0x39653f[_0xb110('0x19')](_0x15b049)['send'](_0x11cafa);};}exports[_0xb110('0x2c')]=function(_0x1bdbc0,_0x39d361){var _0x50fd92={},_0x550d0b={},_0x58534f={'count':0x0,'rows':[]};var _0x1f83db=_[_0xb110('0x2d')](db[_0xb110('0x2e')]['rawAttributes'],function(_0x535342){return{'name':_0x535342['fieldName'],'type':_0x535342[_0xb110('0x2f')][_0xb110('0x30')]};});_0x550d0b[_0xb110('0x31')]=_[_0xb110('0x2d')](_0x1f83db,_0xb110('0x2b'));_0x550d0b[_0xb110('0x32')]=_['keys'](_0x1bdbc0[_0xb110('0x32')]);_0x550d0b[_0xb110('0x33')]=_[_0xb110('0x34')](_0x550d0b['model'],_0x550d0b['query']);_0x50fd92[_0xb110('0x35')]=_['intersection'](_0x550d0b[_0xb110('0x31')],qs[_0xb110('0x36')](_0x1bdbc0['query']['fields']));_0x50fd92['attributes']=_0x50fd92['attributes']['length']?_0x50fd92['attributes']:_0x550d0b[_0xb110('0x31')];if(!_0x1bdbc0[_0xb110('0x32')]['hasOwnProperty'](_0xb110('0x37'))){_0x50fd92[_0xb110('0x1f')]=qs['limit'](_0x1bdbc0[_0xb110('0x32')]['limit']);_0x50fd92[_0xb110('0x1c')]=qs[_0xb110('0x1c')](_0x1bdbc0[_0xb110('0x32')][_0xb110('0x1c')]);}_0x50fd92['order']=qs[_0xb110('0x38')](_0x1bdbc0[_0xb110('0x32')][_0xb110('0x38')]);_0x50fd92[_0xb110('0x39')]=qs[_0xb110('0x33')](_[_0xb110('0x3a')](_0x1bdbc0[_0xb110('0x32')],_0x550d0b[_0xb110('0x33')]),_0x1f83db);if(_0x1bdbc0[_0xb110('0x32')][_0xb110('0x3b')]){_0x50fd92['where']=_[_0xb110('0x3c')](_0x50fd92[_0xb110('0x39')],{'$or':_[_0xb110('0x2d')](_0x1f83db,function(_0x556048){if(_0x556048['type']!==_0xb110('0x3d')){var _0x3ba396={};_0x3ba396[_0x556048[_0xb110('0x2b')]]={'$like':'%'+_0x1bdbc0[_0xb110('0x32')]['filter']+'%'};return _0x3ba396;}})});}_0x50fd92=_['merge']({},_0x50fd92,_0x1bdbc0[_0xb110('0x3e')]);var _0x6e52d0={'where':_0x50fd92[_0xb110('0x39')]};return db[_0xb110('0x2e')][_0xb110('0x1e')](_0x6e52d0)['then'](function(_0x100892){_0x58534f[_0xb110('0x1e')]=_0x100892;if(_0x1bdbc0[_0xb110('0x32')][_0xb110('0x3f')]){_0x50fd92[_0xb110('0x40')]=[{'all':!![]}];}return db[_0xb110('0x2e')][_0xb110('0x41')](_0x50fd92);})[_0xb110('0x26')](function(_0x578b57){_0x58534f[_0xb110('0x42')]=_0x578b57;return _0x58534f;})[_0xb110('0x26')](respondWithFilteredResult(_0x39d361,_0x50fd92))[_0xb110('0x43')](handleError(_0x39d361,null));};exports[_0xb110('0x44')]=function(_0xd7c85f,_0x1471e8){var _0x3ddbef={'raw':!![],'where':{'id':_0xd7c85f['params']['id']}},_0x367a6e={};_0x367a6e[_0xb110('0x31')]=_[_0xb110('0x45')](db[_0xb110('0x2e')][_0xb110('0x46')]);_0x367a6e[_0xb110('0x32')]=_[_0xb110('0x45')](_0xd7c85f['query']);_0x367a6e[_0xb110('0x33')]=_[_0xb110('0x34')](_0x367a6e[_0xb110('0x31')],_0x367a6e['query']);_0x3ddbef[_0xb110('0x35')]=_[_0xb110('0x34')](_0x367a6e[_0xb110('0x31')],qs[_0xb110('0x36')](_0xd7c85f[_0xb110('0x32')][_0xb110('0x36')]));_0x3ddbef[_0xb110('0x35')]=_0x3ddbef[_0xb110('0x35')][_0xb110('0x47')]?_0x3ddbef[_0xb110('0x35')]:_0x367a6e[_0xb110('0x31')];if(_0xd7c85f['query'][_0xb110('0x3f')]){_0x3ddbef[_0xb110('0x40')]=[{'all':!![]}];}_0x3ddbef=_[_0xb110('0x3c')]({},_0x3ddbef,_0xd7c85f['options']);return db[_0xb110('0x2e')]['find'](_0x3ddbef)['then'](handleEntityNotFound(_0x1471e8,null))['then'](respondWithResult(_0x1471e8,null))[_0xb110('0x43')](handleError(_0x1471e8,null));};exports[_0xb110('0x48')]=function(_0x1da787,_0x5ebe7c){return db['Variable']['create'](_0x1da787['body'],{})[_0xb110('0x26')](function(_0xddd32e){var _0x4fbad5=_0x1da787[_0xb110('0x49')][_0xb110('0x27')]({'plain':!![]});if(!_0x4fbad5)throw new Error(_0xb110('0x4a'));if(_0x4fbad5[_0xb110('0x4b')]===_0xb110('0x49')){var _0x2df443=_0xddd32e[_0xb110('0x27')]({'plain':!![]});var _0x407d22='Variables';return db[_0xb110('0x4c')][_0xb110('0x4d')]({'where':{'name':_0x407d22,'userProfileId':_0x4fbad5[_0xb110('0x4e')]},'raw':!![]})['then'](function(_0x3277e3){if(_0x3277e3&&_0x3277e3[_0xb110('0x4f')]===0x0){return db[_0xb110('0x28')][_0xb110('0x48')]({'name':_0x2df443['name'],'resourceId':_0x2df443['id'],'type':_0x3277e3[_0xb110('0x2b')],'sectionId':_0x3277e3['id']},{})[_0xb110('0x26')](function(){return _0xddd32e;});}else{return _0xddd32e;}})[_0xb110('0x43')](function(_0xac5404){logger[_0xb110('0x50')](_0xb110('0x51'),_0xac5404);throw _0xac5404;});}return _0xddd32e;})['then'](respondWithResult(_0x5ebe7c,0xc9))[_0xb110('0x43')](handleError(_0x5ebe7c,null));};exports[_0xb110('0x25')]=function(_0x5c9e7b,_0x471d8e){if(_0x5c9e7b[_0xb110('0x52')]['id']){delete _0x5c9e7b[_0xb110('0x52')]['id'];}return db['Variable'][_0xb110('0x4d')]({'where':{'id':_0x5c9e7b[_0xb110('0x53')]['id']}})[_0xb110('0x26')](handleEntityNotFound(_0x471d8e,null))['then'](saveUpdates(_0x5c9e7b[_0xb110('0x52')],null))['then'](respondWithResult(_0x471d8e,null))[_0xb110('0x43')](handleError(_0x471d8e,null));};exports['destroy']=function(_0x45fd90,_0x16eab2){return db['Variable'][_0xb110('0x4d')]({'where':{'id':_0x45fd90[_0xb110('0x53')]['id']}})[_0xb110('0x26')](handleEntityNotFound(_0x16eab2,null))[_0xb110('0x26')](removeEntity(_0x16eab2,null))[_0xb110('0x43')](handleError(_0x16eab2,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index ba49a7e..1b894a9 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 _0x7e25=['moment','request-promise','path','rimraf','../../config/environment','./variable.attributes','exports','define','Variable','lodash','util','../../config/logger','api'];(function(_0x1caf6a,_0x26a5bf){var _0x1bf493=function(_0x3982f5){while(--_0x3982f5){_0x1caf6a['push'](_0x1caf6a['shift']());}};_0x1bf493(++_0x26a5bf);}(_0x7e25,0x1ea));var _0x57e2=function(_0x5dbb84,_0x1bbce9){_0x5dbb84=_0x5dbb84-0x0;var _0x1d6eae=_0x7e25[_0x5dbb84];return _0x1d6eae;};'use strict';var _=require(_0x57e2('0x0'));var util=require(_0x57e2('0x1'));var logger=require(_0x57e2('0x2'))(_0x57e2('0x3'));var moment=require(_0x57e2('0x4'));var BPromise=require('bluebird');var rp=require(_0x57e2('0x5'));var fs=require('fs');var path=require(_0x57e2('0x6'));var rimraf=require(_0x57e2('0x7'));var config=require(_0x57e2('0x8'));var attributes=require(_0x57e2('0x9'));module[_0x57e2('0xa')]=function(_0x3f25eb,_0x46922f){return _0x3f25eb[_0x57e2('0xb')](_0x57e2('0xc'),attributes,{'tableName':'tools_variables','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1c44=['path','./variable.attributes','exports','define','util','../../config/logger','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1c44,0x193));var _0x41c4=function(_0x43892b,_0x567346){_0x43892b=_0x43892b-0x0;var _0xcc6b6=_0x1c44[_0x43892b];return _0xcc6b6;};'use strict';var _=require('lodash');var util=require(_0x41c4('0x0'));var logger=require(_0x41c4('0x1'))('api');var moment=require('moment');var BPromise=require(_0x41c4('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x41c4('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x41c4('0x4'));module[_0x41c4('0x5')]=function(_0x89e4e4,_0x5b49df){return _0x89e4e4[_0x41c4('0x6')]('Variable',attributes,{'tableName':'tools_variables','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/variable/variable.rpc.js b/server/api/variable/variable.rpc.js index 0a34be0..a4e16e2 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 _0x326f=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info','Variable,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','ShowVariable','Variable','raw','options','include','model','attributes','map','then','stringify','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x326f,0xd1));var _0xf326=function(_0x4d8940,_0x34fb97){_0x4d8940=_0x4d8940-0x0;var _0x16c0ee=_0x326f[_0x4d8940];return _0x16c0ee;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf326('0x1'));var rs=require(_0xf326('0x2'));var fs=require('fs');var Redis=require(_0xf326('0x3'));var db=require(_0xf326('0x4'))['db'];var utils=require(_0xf326('0x5'));var logger=require(_0xf326('0x6'))(_0xf326('0x7'));var config=require(_0xf326('0x8'));var jayson=require(_0xf326('0x9'));var client=jayson[_0xf326('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c254d,_0x3851eb,_0x165f95){return new BPromise(function(_0x1e7b8a,_0x515bfa){return client['request'](_0x3c254d,_0x165f95)['then'](function(_0x3bacf2){logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));logger[_0xf326('0xe')]('Variable,\x20%s,\x20%s,\x20%s',_0x3851eb,_0xf326('0xd'),JSON['stringify'](_0x3bacf2));if(_0x3bacf2[_0xf326('0xf')]){if(_0x3bacf2['error'][_0xf326('0x10')]===0x1f4){logger['error'](_0xf326('0xc'),_0x3851eb,_0x3bacf2[_0xf326('0xf')]['message']);return _0x515bfa(_0x3bacf2[_0xf326('0xf')][_0xf326('0x11')]);}logger[_0xf326('0xf')](_0xf326('0xc'),_0x3851eb,_0x3bacf2['error'][_0xf326('0x11')]);return _0x1e7b8a(_0x3bacf2['error']['message']);}else{logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));_0x1e7b8a(_0x3bacf2[_0xf326('0x12')][_0xf326('0x11')]);}})[_0xf326('0x13')](function(_0x34128e){logger[_0xf326('0xf')]('Variable,\x20%s,\x20%s',_0x3851eb,_0x34128e);_0x515bfa(_0x34128e);});});}exports[_0xf326('0x14')]=function(_0x453100){var _0x18bee3=this;return new Promise(function(_0x31ffb9,_0xcef2b5){return db[_0xf326('0x15')]['find']({'raw':_0x453100['options']?_0x453100['options'][_0xf326('0x16')]===undefined?!![]:![]:!![],'where':_0x453100[_0xf326('0x17')]?_0x453100['options']['where']||null:null,'attributes':_0x453100[_0xf326('0x17')]?_0x453100['options']['attributes']||null:null,'include':_0x453100[_0xf326('0x17')]?_0x453100[_0xf326('0x17')]['include']?_['map'](_0x453100[_0xf326('0x17')][_0xf326('0x18')],function(_0x5f21a2){return{'model':db[_0x5f21a2[_0xf326('0x19')]],'as':_0x5f21a2['as'],'attributes':_0x5f21a2[_0xf326('0x1a')],'include':_0x5f21a2[_0xf326('0x18')]?_[_0xf326('0x1b')](_0x5f21a2[_0xf326('0x18')],function(_0x2049ec){return{'model':db[_0x2049ec['model']],'as':_0x2049ec['as'],'attributes':_0x2049ec['attributes'],'include':_0x2049ec['include']?_[_0xf326('0x1b')](_0x2049ec[_0xf326('0x18')],function(_0x2cd45a){return{'model':db[_0x2cd45a[_0xf326('0x19')]],'as':_0x2cd45a['as'],'attributes':_0x2cd45a[_0xf326('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xf326('0x1c')](function(_0x5217d4){logger[_0xf326('0xb')](_0xf326('0x14'),_0x453100);logger[_0xf326('0xe')]('ShowVariable',_0x453100,JSON[_0xf326('0x1d')](_0x5217d4));_0x31ffb9(_0x5217d4);})['catch'](function(_0x4a9abf){logger[_0xf326('0xf')](_0xf326('0x14'),_0x4a9abf[_0xf326('0x11')],_0x453100);_0xcef2b5(_0x18bee3['error'](0x1f4,_0x4a9abf[_0xf326('0x11')]));});});}; \ No newline at end of file +var _0x3e74=['catch','Variable','find','options','raw','where','attributes','include','map','model','then','ShowVariable','stringify','lodash','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','debug','error','Variable,\x20%s,\x20%s','message','info'];(function(_0x103762,_0x39d529){var _0x24844e=function(_0x47c09e){while(--_0x47c09e){_0x103762['push'](_0x103762['shift']());}};_0x24844e(++_0x39d529);}(_0x3e74,0x175));var _0x43e7=function(_0x27a2ed,_0x5cda69){_0x27a2ed=_0x27a2ed-0x0;var _0x3ee7cb=_0x3e74[_0x27a2ed];return _0x3ee7cb;};'use strict';var _=require(_0x43e7('0x0'));var util=require('util');var moment=require(_0x43e7('0x1'));var BPromise=require(_0x43e7('0x2'));var rs=require(_0x43e7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x43e7('0x4'));var logger=require('../../config/logger')(_0x43e7('0x5'));var config=require(_0x43e7('0x6'));var jayson=require(_0x43e7('0x7'));var client=jayson[_0x43e7('0x8')][_0x43e7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x503698,_0x45a0d1,_0x3491d6){return new BPromise(function(_0x2ede2d,_0x8528fc){return client[_0x43e7('0xa')](_0x503698,_0x3491d6)['then'](function(_0x212c6c){logger['info']('Variable,\x20%s,\x20%s',_0x45a0d1,_0x43e7('0xb'));logger[_0x43e7('0xc')]('Variable,\x20%s,\x20%s,\x20%s',_0x45a0d1,_0x43e7('0xb'),JSON['stringify'](_0x212c6c));if(_0x212c6c[_0x43e7('0xd')]){if(_0x212c6c[_0x43e7('0xd')]['code']===0x1f4){logger[_0x43e7('0xd')](_0x43e7('0xe'),_0x45a0d1,_0x212c6c[_0x43e7('0xd')][_0x43e7('0xf')]);return _0x8528fc(_0x212c6c['error']['message']);}logger[_0x43e7('0xd')](_0x43e7('0xe'),_0x45a0d1,_0x212c6c[_0x43e7('0xd')]['message']);return _0x2ede2d(_0x212c6c['error'][_0x43e7('0xf')]);}else{logger[_0x43e7('0x10')](_0x43e7('0xe'),_0x45a0d1,_0x43e7('0xb'));_0x2ede2d(_0x212c6c['result']['message']);}})[_0x43e7('0x11')](function(_0x264575){logger[_0x43e7('0xd')]('Variable,\x20%s,\x20%s',_0x45a0d1,_0x264575);_0x8528fc(_0x264575);});});}exports['ShowVariable']=function(_0x446986){var _0x1ca758=this;return new Promise(function(_0x9037d3,_0x140657){return db[_0x43e7('0x12')][_0x43e7('0x13')]({'raw':_0x446986[_0x43e7('0x14')]?_0x446986[_0x43e7('0x14')][_0x43e7('0x15')]===undefined?!![]:![]:!![],'where':_0x446986[_0x43e7('0x14')]?_0x446986[_0x43e7('0x14')][_0x43e7('0x16')]||null:null,'attributes':_0x446986['options']?_0x446986[_0x43e7('0x14')][_0x43e7('0x17')]||null:null,'include':_0x446986['options']?_0x446986[_0x43e7('0x14')][_0x43e7('0x18')]?_[_0x43e7('0x19')](_0x446986[_0x43e7('0x14')][_0x43e7('0x18')],function(_0x2f4cb4){return{'model':db[_0x2f4cb4['model']],'as':_0x2f4cb4['as'],'attributes':_0x2f4cb4[_0x43e7('0x17')],'include':_0x2f4cb4['include']?_['map'](_0x2f4cb4[_0x43e7('0x18')],function(_0x43f4ff){return{'model':db[_0x43f4ff['model']],'as':_0x43f4ff['as'],'attributes':_0x43f4ff[_0x43e7('0x17')],'include':_0x43f4ff['include']?_[_0x43e7('0x19')](_0x43f4ff['include'],function(_0x1af208){return{'model':db[_0x1af208[_0x43e7('0x1a')]],'as':_0x1af208['as'],'attributes':_0x1af208[_0x43e7('0x17')]};}):[]};}):[]};}):[]:[]})[_0x43e7('0x1b')](function(_0x51f4d7){logger['info'](_0x43e7('0x1c'),_0x446986);logger['debug'](_0x43e7('0x1c'),_0x446986,JSON[_0x43e7('0x1d')](_0x51f4d7));_0x9037d3(_0x51f4d7);})[_0x43e7('0x11')](function(_0xb1fc63){logger['error'](_0x43e7('0x1c'),_0xb1fc63[_0x43e7('0xf')],_0x446986);_0x140657(_0x1ca758[_0x43e7('0xd')](0x1f4,_0xb1fc63[_0x43e7('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index a2deaaa..71b9f4a 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 _0x97ba=['exports','../../components/auth/service','./version.controller','get','index','/fetch','isAuthenticated','canUpdate','/reset','reset','/restart'];(function(_0x4953da,_0x5adaca){var _0x2d3780=function(_0x458f36){while(--_0x458f36){_0x4953da['push'](_0x4953da['shift']());}};_0x2d3780(++_0x5adaca);}(_0x97ba,0x1ae));var _0xa97b=function(_0x407f1c,_0x163fd1){_0x407f1c=_0x407f1c-0x0;var _0x29d8ce=_0x97ba[_0x407f1c];return _0x29d8ce;};'use strict';var express=require('express');var router=express['Router']();var auth=require(_0xa97b('0x0'));var controller=require(_0xa97b('0x1'));router[_0xa97b('0x2')]('/',controller[_0xa97b('0x3')]);router['get'](_0xa97b('0x4'),auth[_0xa97b('0x5')](),auth[_0xa97b('0x6')](),controller['fetch']);router['get'](_0xa97b('0x7'),auth['isAuthenticated'](),auth[_0xa97b('0x6')](),controller[_0xa97b('0x8')]);router[_0xa97b('0x2')]('/pull',auth['isAuthenticated'](),auth[_0xa97b('0x6')](),controller['pull']);router[_0xa97b('0x2')](_0xa97b('0x9'),auth[_0xa97b('0x5')](),controller['restart']);router['get']('/migrations',controller['migrations']);module[_0xa97b('0xa')]=router; \ No newline at end of file +var _0x9132=['restart','migrations','exports','../../components/auth/service','./version.controller','get','index','/fetch','isAuthenticated','canUpdate','reset','/pull'];(function(_0x3522c8,_0x1e7c82){var _0x22f498=function(_0x5bf143){while(--_0x5bf143){_0x3522c8['push'](_0x3522c8['shift']());}};_0x22f498(++_0x1e7c82);}(_0x9132,0x93));var _0x2913=function(_0x428971,_0x450bba){_0x428971=_0x428971-0x0;var _0x537226=_0x9132[_0x428971];return _0x537226;};'use strict';var express=require('express');var router=express['Router']();var auth=require(_0x2913('0x0'));var controller=require(_0x2913('0x1'));router[_0x2913('0x2')]('/',controller[_0x2913('0x3')]);router[_0x2913('0x2')](_0x2913('0x4'),auth[_0x2913('0x5')](),auth[_0x2913('0x6')](),controller['fetch']);router[_0x2913('0x2')]('/reset',auth[_0x2913('0x5')](),auth[_0x2913('0x6')](),controller[_0x2913('0x7')]);router[_0x2913('0x2')](_0x2913('0x8'),auth['isAuthenticated'](),auth[_0x2913('0x6')](),controller['pull']);router['get']('/restart',auth['isAuthenticated'](),controller[_0x2913('0x9')]);router['get']('/migrations',controller[_0x2913('0xa')]);module[_0x2913('0xb')]=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index cdf8ea4..dbc7f07 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 _0x737b=['../../mysqldb','../../config/pm2','../../config/logger','update','simple-git','root','index','query','latest','fetch','tags','2.0.0','status','json','origin','error','info','git\x20fetch','reset','--hard','FETCH_HEAD','restart','motion2','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','readdirSync','join','server','length','replace','.js','exports','sort','sequelize','Migration','getQueryInterface','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','map','then','\x20to\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','lodash','pkginfo','version','child_process'];(function(_0x5a33e5,_0xf91e32){var _0x3e73dd=function(_0x56660f){while(--_0x56660f){_0x5a33e5['push'](_0x5a33e5['shift']());}};_0x3e73dd(++_0xf91e32);}(_0x737b,0x93));var _0xb737=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x737b[_0x3dd15e];return _0x231fd0;};'use strict';var Umzug=require(_0xb737('0x0'));var path=require(_0xb737('0x1'));var fs=require('fs');var _=require(_0xb737('0x2'));var pkginfo=require(_0xb737('0x3'))(module,_0xb737('0x4'));var compareVersions=require('compare-versions');var exec=require(_0xb737('0x5'))['exec'];var db=require(_0xb737('0x6'))['db'];var config=require('../../config/environment');var pm2=require(_0xb737('0x7'));var logger=require(_0xb737('0x8'))(_0xb737('0x9'));var git=require(_0xb737('0xa'))(config[_0xb737('0xb')]);exports[_0xb737('0xc')]=function(_0x3d6dad,_0x47ffce){var _0x1f61e0={'current':module['exports'][_0xb737('0x4')],'phonebar':0x2};if(_0x3d6dad[_0xb737('0xd')]&&_0x3d6dad[_0xb737('0xd')][_0xb737('0xe')]){return git[_0xb737('0xf')]()[_0xb737('0x10')](function(_0x50451e,_0xf6ab81){_0x1f61e0[_0xb737('0xe')]=(_0x50451e?module['exports'][_0xb737('0x4')]:_0xf6ab81[_0xb737('0xe')])||_0xb737('0x11');return _0x47ffce[_0xb737('0x12')](0xc8)['json'](_0x1f61e0);});}else{return _0x47ffce[_0xb737('0x12')](0xc8)[_0xb737('0x13')](_0x1f61e0);}};exports[_0xb737('0xf')]=function(_0x59b593,_0x241ce1){return git[_0xb737('0xf')]([_0xb737('0x14'),'master'],function(_0x4bfe9a){if(_0x4bfe9a){logger[_0xb737('0x15')](_0x4bfe9a);return _0x241ce1['status'](0x1f4)[_0xb737('0x13')](_0x4bfe9a);}logger[_0xb737('0x16')](_0xb737('0x17'));return _0x241ce1[_0xb737('0x12')](0xc8)[_0xb737('0x13')]({'output':'git\x20fetch\x20origin\x20master'});});};exports[_0xb737('0x18')]=function(_0x53d9e9,_0x32e6fb){return git['reset']([_0xb737('0x19'),_0xb737('0x1a')],function(_0x100cae){if(_0x100cae){logger[_0xb737('0x15')](_0x100cae);return _0x32e6fb[_0xb737('0x12')](0x1f4)[_0xb737('0x13')](_0x100cae);}logger[_0xb737('0x16')]('git\x20reset\x20--hard\x20FETCH_HEAD');return _0x32e6fb[_0xb737('0x12')](0xc8)['json']({'output':'git\x20reset\x20--hard'});});};exports['pull']=function(_0x26999b,_0x49f80f){exec('npm\x20install\x20--production',function(_0x15bc00,_0x15b6a7,_0x47d551){logger[_0xb737('0x16')](_0x15b6a7);logger['info'](_0x47d551);if(_0x15bc00){logger[_0xb737('0x15')](_0x15bc00);return _0x49f80f[_0xb737('0x12')](0x1f4)[_0xb737('0x13')](_0x15bc00);}return _0x49f80f[_0xb737('0x12')](0xc8)[_0xb737('0x13')]({'output':_0x15b6a7});});};exports[_0xb737('0x1b')]=function(_0x56f44b,_0x1e1a5e){return pm2[_0xb737('0x1b')](_0xb737('0x1c'))['then'](function(_0x3718e7){logger[_0xb737('0x16')]('pm2\x20restart\x20motion\x20%s',_0x3718e7);return _0x1e1a5e[_0xb737('0x12')](0xc8)[_0xb737('0x13')]({'output':_0xb737('0x1d')});})[_0xb737('0x1e')](function(_0x49b94c){logger[_0xb737('0x15')](_0x49b94c);return _0x1e1a5e[_0xb737('0x12')](0x1f4)[_0xb737('0x13')](_0x49b94c);});};exports[_0xb737('0x1f')]=function(_0x4b0ed0,_0x45a5f8){var _0x16acd4=fs[_0xb737('0x20')](path[_0xb737('0x21')](config[_0xb737('0xb')],_0xb737('0x22'),_0xb737('0x1f')));var _0x102dda=[];for(var _0x66e2f2=0x0;_0x66e2f2<_0x16acd4[_0xb737('0x23')];_0x66e2f2++){var _0x313040=_0x16acd4[_0x66e2f2][_0xb737('0x24')](_0xb737('0x25'),'');if(compareVersions(module[_0xb737('0x26')][_0xb737('0x4')],_0x313040)===-0x1){_0x102dda['push'](_0x313040);}}if(_0x102dda[_0xb737('0x23')]){var _0x756afd=_0x102dda[_0xb737('0x27')](compareVersions);var _0x15cbe5=new Umzug({'storage':_0xb737('0x28'),'storageOptions':{'model':db['Migration'],'modelName':_0xb737('0x29'),'columnName':'version'},'migrations':{'params':[db['sequelize'][_0xb737('0x2a')](),db['sequelize'][_0xb737('0x2b')],function(){throw new Error(_0xb737('0x2c'));}],'path':path[_0xb737('0x21')](config[_0xb737('0xb')],_0xb737('0x22'),_0xb737('0x1f')),'pattern':/\.js$/}});_0x15cbe5['up']({'migrations':_[_0xb737('0x2d')](_0x756afd,function(_0xb49582){return _0xb49582+'.js';})})[_0xb737('0x2e')](function(){return _0x45a5f8['status'](0xc8)['json']({'output':'Database\x20migrated\x20successfully\x20from\x20version\x20'+module['exports'][_0xb737('0x4')]+_0xb737('0x2f')+_[_0xb737('0x30')](_0x756afd),'migrations':_[_0xb737('0x21')](_0x756afd)});})['catch'](function(_0x339eac){if(_0x339eac instanceof db[_0xb737('0x28')][_0xb737('0x31')]){return _0x45a5f8[_0xb737('0x12')](0xc8)[_0xb737('0x13')]({'output':_0xb737('0x32')});}else{return _0x45a5f8[_0xb737('0x12')](0x1f4)[_0xb737('0x13')](_0x339eac);}});}else{return _0x45a5f8['status'](0xc8)[_0xb737('0x13')]({'output':_0xb737('0x32')});}}; \ No newline at end of file +var _0xeb6a=['lodash','pkginfo','version','compare-versions','child_process','exec','../../mysqldb','../../config/environment','../../config/pm2','../../config/logger','update','query','latest','fetch','exports','2.0.0','status','json','origin','master','error','info','git\x20fetch','git\x20fetch\x20origin\x20master','reset','FETCH_HEAD','git\x20reset\x20--hard\x20FETCH_HEAD','npm\x20install\x20--production','restart','then','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','readdirSync','join','root','server','length','replace','.js','sequelize','Migration','map','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','UniqueConstraintError','Database\x20already\x20up-to-date','umzug'];(function(_0x5cca9f,_0x154684){var _0x55edda=function(_0x115aa2){while(--_0x115aa2){_0x5cca9f['push'](_0x5cca9f['shift']());}};_0x55edda(++_0x154684);}(_0xeb6a,0x1af));var _0xaeb6=function(_0x15f852,_0x5e3986){_0x15f852=_0x15f852-0x0;var _0x5410b8=_0xeb6a[_0x15f852];return _0x5410b8;};'use strict';var Umzug=require(_0xaeb6('0x0'));var path=require('path');var fs=require('fs');var _=require(_0xaeb6('0x1'));var pkginfo=require(_0xaeb6('0x2'))(module,_0xaeb6('0x3'));var compareVersions=require(_0xaeb6('0x4'));var exec=require(_0xaeb6('0x5'))[_0xaeb6('0x6')];var db=require(_0xaeb6('0x7'))['db'];var config=require(_0xaeb6('0x8'));var pm2=require(_0xaeb6('0x9'));var logger=require(_0xaeb6('0xa'))(_0xaeb6('0xb'));var git=require('simple-git')(config['root']);exports['index']=function(_0x25daaa,_0x36f693){var _0x22d3c2={'current':module['exports']['version'],'phonebar':0x2};if(_0x25daaa[_0xaeb6('0xc')]&&_0x25daaa[_0xaeb6('0xc')][_0xaeb6('0xd')]){return git[_0xaeb6('0xe')]()['tags'](function(_0xf4d305,_0x27e92f){_0x22d3c2[_0xaeb6('0xd')]=(_0xf4d305?module[_0xaeb6('0xf')]['version']:_0x27e92f[_0xaeb6('0xd')])||_0xaeb6('0x10');return _0x36f693[_0xaeb6('0x11')](0xc8)[_0xaeb6('0x12')](_0x22d3c2);});}else{return _0x36f693['status'](0xc8)[_0xaeb6('0x12')](_0x22d3c2);}};exports[_0xaeb6('0xe')]=function(_0x36517c,_0x43138c){return git[_0xaeb6('0xe')]([_0xaeb6('0x13'),_0xaeb6('0x14')],function(_0x80f7aa){if(_0x80f7aa){logger[_0xaeb6('0x15')](_0x80f7aa);return _0x43138c[_0xaeb6('0x11')](0x1f4)['json'](_0x80f7aa);}logger[_0xaeb6('0x16')](_0xaeb6('0x17'));return _0x43138c[_0xaeb6('0x11')](0xc8)['json']({'output':_0xaeb6('0x18')});});};exports[_0xaeb6('0x19')]=function(_0x5a981b,_0x42e14c){return git[_0xaeb6('0x19')](['--hard',_0xaeb6('0x1a')],function(_0x3c42c2){if(_0x3c42c2){logger[_0xaeb6('0x15')](_0x3c42c2);return _0x42e14c[_0xaeb6('0x11')](0x1f4)[_0xaeb6('0x12')](_0x3c42c2);}logger[_0xaeb6('0x16')](_0xaeb6('0x1b'));return _0x42e14c['status'](0xc8)[_0xaeb6('0x12')]({'output':'git\x20reset\x20--hard'});});};exports['pull']=function(_0x31486a,_0x1d383d){exec(_0xaeb6('0x1c'),function(_0xd809d1,_0xdf0b4c,_0x522f8d){logger[_0xaeb6('0x16')](_0xdf0b4c);logger[_0xaeb6('0x16')](_0x522f8d);if(_0xd809d1){logger[_0xaeb6('0x15')](_0xd809d1);return _0x1d383d[_0xaeb6('0x11')](0x1f4)[_0xaeb6('0x12')](_0xd809d1);}return _0x1d383d['status'](0xc8)[_0xaeb6('0x12')]({'output':_0xdf0b4c});});};exports[_0xaeb6('0x1d')]=function(_0x3fc6fa,_0x30ff5e){return pm2[_0xaeb6('0x1d')]('motion2')[_0xaeb6('0x1e')](function(_0x11e042){logger['info']('pm2\x20restart\x20motion\x20%s',_0x11e042);return _0x30ff5e[_0xaeb6('0x11')](0xc8)['json']({'output':_0xaeb6('0x1f')});})[_0xaeb6('0x20')](function(_0x448841){logger[_0xaeb6('0x15')](_0x448841);return _0x30ff5e[_0xaeb6('0x11')](0x1f4)[_0xaeb6('0x12')](_0x448841);});};exports[_0xaeb6('0x21')]=function(_0x522236,_0x20ec52){var _0x48b59d=fs[_0xaeb6('0x22')](path[_0xaeb6('0x23')](config[_0xaeb6('0x24')],_0xaeb6('0x25'),'migrations'));var _0x219d31=[];for(var _0x311b08=0x0;_0x311b08<_0x48b59d[_0xaeb6('0x26')];_0x311b08++){var _0x1950e2=_0x48b59d[_0x311b08][_0xaeb6('0x27')](_0xaeb6('0x28'),'');if(compareVersions(module[_0xaeb6('0xf')][_0xaeb6('0x3')],_0x1950e2)===-0x1){_0x219d31['push'](_0x1950e2);}}if(_0x219d31[_0xaeb6('0x26')]){var _0x49bf4b=_0x219d31['sort'](compareVersions);var _0xb739de=new Umzug({'storage':_0xaeb6('0x29'),'storageOptions':{'model':db['Migration'],'modelName':_0xaeb6('0x2a'),'columnName':'version'},'migrations':{'params':[db[_0xaeb6('0x29')]['getQueryInterface'](),db[_0xaeb6('0x29')]['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[_0xaeb6('0x23')](config[_0xaeb6('0x24')],_0xaeb6('0x25'),'migrations'),'pattern':/\.js$/}});_0xb739de['up']({'migrations':_[_0xaeb6('0x2b')](_0x49bf4b,function(_0x1db82b){return _0x1db82b+_0xaeb6('0x28');})})['then'](function(){return _0x20ec52[_0xaeb6('0x11')](0xc8)['json']({'output':_0xaeb6('0x2c')+module[_0xaeb6('0xf')]['version']+_0xaeb6('0x2d')+_['last'](_0x49bf4b),'migrations':_['join'](_0x49bf4b)});})[_0xaeb6('0x20')](function(_0x4ba100){if(_0x4ba100 instanceof db[_0xaeb6('0x29')][_0xaeb6('0x2e')]){return _0x20ec52[_0xaeb6('0x11')](0xc8)[_0xaeb6('0x12')]({'output':_0xaeb6('0x2f')});}else{return _0x20ec52['status'](0x1f4)['json'](_0x4ba100);}});}else{return _0x20ec52[_0xaeb6('0x11')](0xc8)[_0xaeb6('0x12')]({'output':'Database\x20already\x20up-to-date'});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index 6b92580..9037a4c 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 _0x1ff0=['create','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceAgentReport.controller','isAuthenticated','get','describe','/:id','show'];(function(_0x279de4,_0x5d552d){var _0x104a16=function(_0x365e5a){while(--_0x365e5a){_0x279de4['push'](_0x279de4['shift']());}};_0x104a16(++_0x5d552d);}(_0x1ff0,0x16c));var _0x01ff=function(_0x57251b,_0x4efa43){_0x57251b=_0x57251b-0x0;var _0x1371c4=_0x1ff0[_0x57251b];return _0x1371c4;};'use strict';var multer=require(_0x01ff('0x0'));var util=require(_0x01ff('0x1'));var path=require(_0x01ff('0x2'));var timeout=require('connect-timeout');var express=require(_0x01ff('0x3'));var router=express[_0x01ff('0x4')]();var fs_extra=require(_0x01ff('0x5'));var auth=require(_0x01ff('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x01ff('0x7'));var controller=require(_0x01ff('0x8'));router['get']('/',auth[_0x01ff('0x9')](),controller['index']);router[_0x01ff('0xa')]('/describe',auth['isAuthenticated'](),controller[_0x01ff('0xb')]);router['get'](_0x01ff('0xc'),auth[_0x01ff('0x9')](),controller[_0x01ff('0xd')]);router['post']('/',auth[_0x01ff('0x9')](),controller[_0x01ff('0xe')]);router['put'](_0x01ff('0xc'),auth[_0x01ff('0x9')](),controller['update']);router[_0x01ff('0xf')](_0x01ff('0xc'),auth[_0x01ff('0x9')](),controller[_0x01ff('0x10')]);module[_0x01ff('0x11')]=router; \ No newline at end of file +var _0xe9d3=['create','/:id','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../config/environment','./voiceAgentReport.controller','get','isAuthenticated','index','/describe','describe','show','post'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xe9d3,0x12c));var _0x3e9d=function(_0x39a223,_0x298093){_0x39a223=_0x39a223-0x0;var _0x5e0db2=_0xe9d3[_0x39a223];return _0x5e0db2;};'use strict';var multer=require(_0x3e9d('0x0'));var util=require(_0x3e9d('0x1'));var path=require(_0x3e9d('0x2'));var timeout=require('connect-timeout');var express=require(_0x3e9d('0x3'));var router=express[_0x3e9d('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x3e9d('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x3e9d('0x6'));var controller=require(_0x3e9d('0x7'));router[_0x3e9d('0x8')]('/',auth[_0x3e9d('0x9')](),controller[_0x3e9d('0xa')]);router[_0x3e9d('0x8')](_0x3e9d('0xb'),auth[_0x3e9d('0x9')](),controller[_0x3e9d('0xc')]);router[_0x3e9d('0x8')]('/:id',auth[_0x3e9d('0x9')](),controller[_0x3e9d('0xd')]);router[_0x3e9d('0xe')]('/',auth[_0x3e9d('0x9')](),controller[_0x3e9d('0xf')]);router['put'](_0x3e9d('0x10'),auth['isAuthenticated'](),controller[_0x3e9d('0x11')]);router[_0x3e9d('0x12')](_0x3e9d('0x10'),auth[_0x3e9d('0x9')](),controller[_0x3e9d('0x13')]);module[_0x3e9d('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 e7eefb0..3581af3 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 _0x6215=['BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports','STRING','DATE','INTEGER'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x6215,0x198));var _0x5621=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6215[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x5621('0x0'));module[_0x5621('0x1')]={'type':{'type':Sequelize[_0x5621('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x5621('0x2')]},'calleridname':{'type':Sequelize[_0x5621('0x2')]},'queue':{'type':Sequelize[_0x5621('0x2')]},'interface':{'type':Sequelize[_0x5621('0x2')]},'membername':{'type':Sequelize[_0x5621('0x2')]},'agentcalledAt':{'type':Sequelize[_0x5621('0x3')]},'agentconnectAt':{'type':Sequelize['DATE']},'agentcompleteAt':{'type':Sequelize['DATE']},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdumpAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0x5621('0x4')]},'agentcomplete':{'type':Sequelize[_0x5621('0x5')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x5621('0x5')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x5621('0x5')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x5621('0x4')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x5621('0x4')]},'reason':{'type':Sequelize[_0x5621('0x2')]},'lastevent':{'type':Sequelize[_0x5621('0x2')]},'channel':{'type':Sequelize[_0x5621('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x5621('0x2')]},'connectedlinenum':{'type':Sequelize[_0x5621('0x2')]},'connectedlinename':{'type':Sequelize[_0x5621('0x2')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x5621('0x2')]},'context':{'type':Sequelize[_0x5621('0x2')]},'exten':{'type':Sequelize[_0x5621('0x2')]},'priority':{'type':Sequelize[_0x5621('0x2')]},'destchannel':{'type':Sequelize[_0x5621('0x2')]},'destchannelstate':{'type':Sequelize[_0x5621('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0x5621('0x2')]},'destcalleridnum':{'type':Sequelize[_0x5621('0x2')]},'destcalleridname':{'type':Sequelize[_0x5621('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x5621('0x2')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x5621('0x2')]},'destaccountcode':{'type':Sequelize[_0x5621('0x2')]},'destcontext':{'type':Sequelize[_0x5621('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x5621('0x2')]},'destuniqueid':{'type':Sequelize[_0x5621('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize['STRING']},'answeredelsewheremembername':{'type':Sequelize[_0x5621('0x2')]},'transfer':{'type':Sequelize[_0x5621('0x5')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x5621('0x2')],'comment':_0x5621('0x6')},'transferexten':{'type':Sequelize[_0x5621('0x2')]},'transferuniqueid':{'type':Sequelize[_0x5621('0x2')]},'agententerreason':{'type':Sequelize[_0x5621('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x5423=['exports','STRING','DATE','INTEGER','BOOLEAN','sequelize'];(function(_0x35a274,_0x98b399){var _0x40d905=function(_0x5c8455){while(--_0x5c8455){_0x35a274['push'](_0x35a274['shift']());}};_0x40d905(++_0x98b399);}(_0x5423,0xe3));var _0x3542=function(_0x910d0,_0x527681){_0x910d0=_0x910d0-0x0;var _0x88124f=_0x5423[_0x910d0];return _0x88124f;};'use strict';var Sequelize=require(_0x3542('0x0'));module[_0x3542('0x1')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x3542('0x2')]},'calleridnum':{'type':Sequelize[_0x3542('0x2')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x3542('0x2')]},'interface':{'type':Sequelize[_0x3542('0x2')]},'membername':{'type':Sequelize[_0x3542('0x2')]},'agentcalledAt':{'type':Sequelize[_0x3542('0x3')]},'agentconnectAt':{'type':Sequelize['DATE']},'agentcompleteAt':{'type':Sequelize[_0x3542('0x3')]},'agentringnoanswerAt':{'type':Sequelize[_0x3542('0x3')]},'agentdumpAt':{'type':Sequelize[_0x3542('0x3')]},'holdtime':{'type':Sequelize[_0x3542('0x4')]},'agentcomplete':{'type':Sequelize[_0x3542('0x5')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'talktime':{'type':Sequelize[_0x3542('0x4')]},'agentacw':{'type':Sequelize[_0x3542('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0x3542('0x2')]},'lastevent':{'type':Sequelize[_0x3542('0x2')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0x3542('0x4')]},'channelstatedesc':{'type':Sequelize[_0x3542('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x3542('0x2')]},'language':{'type':Sequelize[_0x3542('0x2')]},'accountcode':{'type':Sequelize[_0x3542('0x2')]},'context':{'type':Sequelize[_0x3542('0x2')]},'exten':{'type':Sequelize[_0x3542('0x2')]},'priority':{'type':Sequelize[_0x3542('0x2')]},'destchannel':{'type':Sequelize[_0x3542('0x2')]},'destchannelstate':{'type':Sequelize[_0x3542('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0x3542('0x2')]},'destcalleridnum':{'type':Sequelize[_0x3542('0x2')]},'destcalleridname':{'type':Sequelize[_0x3542('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0x3542('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x3542('0x2')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0x3542('0x2')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x3542('0x2')]},'destpriority':{'type':Sequelize[_0x3542('0x2')]},'destuniqueid':{'type':Sequelize[_0x3542('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize['STRING']},'answeredelsewheremembername':{'type':Sequelize[_0x3542('0x2')]},'transfer':{'type':Sequelize[_0x3542('0x5')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x3542('0x2')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0x3542('0x2')]},'transferuniqueid':{'type':Sequelize[_0x3542('0x2')]},'agententerreason':{'type':Sequelize[_0x3542('0x4')],'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 89af2b1..c10af45 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(_0x4fbfd9,_0x3ab91a){var _0x31dc94=function(_0x11e53b){while(--_0x11e53b){_0x4fbfd9['push'](_0x4fbfd9['shift']());}};_0x31dc94(++_0x3ab91a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x32d457,_0x1a39c9){_0x32d457=_0x32d457-0x0;var _0x338386=_0xa9e0[_0x32d457];return _0x338386;};'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(_0x40a825,_0x3bac79){var _0x273a54=function(_0x5628d8){while(--_0x5628d8){_0x40a825['push'](_0x40a825['shift']());}};_0x273a54(++_0x3bac79);}(_0xa9e0,0x123));var _0x0a9e=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0xa9e0[_0x40ac5e];return _0x2839d6;};'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 0c9404f..ebdb552 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 _0x2b83=['./voiceAgentReport.attributes','define','VoiceAgentReport','report_agent','uniqueid','util','../../config/logger','moment','bluebird','request-promise','../../config/environment'];(function(_0x3974dd,_0x3b2c04){var _0x1c4983=function(_0x2a1b26){while(--_0x2a1b26){_0x3974dd['push'](_0x3974dd['shift']());}};_0x1c4983(++_0x3b2c04);}(_0x2b83,0x1d3));var _0x32b8=function(_0x354d04,_0x2b4aa3){_0x354d04=_0x354d04-0x0;var _0x51eb0b=_0x2b83[_0x354d04];return _0x51eb0b;};'use strict';var _=require('lodash');var util=require(_0x32b8('0x0'));var logger=require(_0x32b8('0x1'))('api');var moment=require(_0x32b8('0x2'));var BPromise=require(_0x32b8('0x3'));var rp=require(_0x32b8('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x32b8('0x5'));var attributes=require(_0x32b8('0x6'));module['exports']=function(_0x6bbc3d,_0x55abd0){return _0x6bbc3d[_0x32b8('0x7')](_0x32b8('0x8'),attributes,{'tableName':_0x32b8('0x9'),'paranoid':![],'indexes':[{'fields':[_0x32b8('0xa'),'destuniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xb194=['report_agent','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','VoiceAgentReport'];(function(_0x3fba9f,_0x3b7b9b){var _0x192cf1=function(_0x557290){while(--_0x557290){_0x3fba9f['push'](_0x3fba9f['shift']());}};_0x192cf1(++_0x3b7b9b);}(_0xb194,0x1b2));var _0x4b19=function(_0x189c0c,_0x3c8aff){_0x189c0c=_0x189c0c-0x0;var _0x533076=_0xb194[_0x189c0c];return _0x533076;};'use strict';var _=require(_0x4b19('0x0'));var util=require('util');var logger=require(_0x4b19('0x1'))(_0x4b19('0x2'));var moment=require(_0x4b19('0x3'));var BPromise=require(_0x4b19('0x4'));var rp=require(_0x4b19('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4b19('0x6'));var config=require(_0x4b19('0x7'));var attributes=require('./voiceAgentReport.attributes');module[_0x4b19('0x8')]=function(_0x570374,_0x22033b){return _0x570374['define'](_0x4b19('0x9'),attributes,{'tableName':_0x4b19('0xa'),'paranoid':![],'indexes':[{'fields':[_0x4b19('0xb'),'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 b2085af..ed8f02b 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 _0x9256=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','request','then','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateVoiceAgentReport','VoiceAgentReport','create','body','options','raw','UpdateVoiceAgentReport','attributes','limit','bluebird','randomstring'];(function(_0x3cba93,_0x5c2fd8){var _0x4a2991=function(_0x3cf95b){while(--_0x3cf95b){_0x3cba93['push'](_0x3cba93['shift']());}};_0x4a2991(++_0x5c2fd8);}(_0x9256,0xf1));var _0x6925=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x9256[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x6925('0x0'));var rs=require(_0x6925('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6925('0x2'))['db'];var utils=require(_0x6925('0x3'));var logger=require(_0x6925('0x4'))('rpc');var config=require(_0x6925('0x5'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x52f1dc,_0x5c822c,_0x2f8d8a){return new BPromise(function(_0x26de19,_0x345366){return client[_0x6925('0x6')](_0x52f1dc,_0x2f8d8a)[_0x6925('0x7')](function(_0x88407e){logger[_0x6925('0x8')](_0x6925('0x9'),_0x5c822c,_0x6925('0xa'));logger[_0x6925('0xb')](_0x6925('0xc'),_0x5c822c,_0x6925('0xa'),JSON[_0x6925('0xd')](_0x88407e));if(_0x88407e[_0x6925('0xe')]){if(_0x88407e[_0x6925('0xe')]['code']===0x1f4){logger[_0x6925('0xe')](_0x6925('0x9'),_0x5c822c,_0x88407e[_0x6925('0xe')][_0x6925('0xf')]);return _0x345366(_0x88407e[_0x6925('0xe')][_0x6925('0xf')]);}logger[_0x6925('0xe')](_0x6925('0x9'),_0x5c822c,_0x88407e[_0x6925('0xe')][_0x6925('0xf')]);return _0x26de19(_0x88407e[_0x6925('0xe')][_0x6925('0xf')]);}else{logger[_0x6925('0x8')](_0x6925('0x9'),_0x5c822c,_0x6925('0xa'));_0x26de19(_0x88407e[_0x6925('0x10')][_0x6925('0xf')]);}})[_0x6925('0x11')](function(_0x5f2854){logger['error']('VoiceAgentReport,\x20%s,\x20%s',_0x5c822c,_0x5f2854);_0x345366(_0x5f2854);});});}exports[_0x6925('0x12')]=function(_0x4658c9){var _0x8574c0=this;return new Promise(function(_0xfd57ba,_0x1a595b){return db[_0x6925('0x13')][_0x6925('0x14')](_0x4658c9[_0x6925('0x15')],{'raw':_0x4658c9[_0x6925('0x16')]?_0x4658c9['options'][_0x6925('0x17')]===undefined?!![]:![]:!![]})[_0x6925('0x7')](function(_0x121ce0){logger[_0x6925('0x8')](_0x6925('0x12'),_0x4658c9);logger[_0x6925('0xb')](_0x6925('0x12'),_0x4658c9,JSON[_0x6925('0xd')](_0x121ce0));_0xfd57ba(_0x121ce0);})[_0x6925('0x11')](function(_0x51e125){logger[_0x6925('0xe')](_0x6925('0x12'),_0x51e125[_0x6925('0xf')],_0x4658c9);_0x1a595b(_0x8574c0[_0x6925('0xe')](0x1f4,_0x51e125['message']));});});};exports[_0x6925('0x18')]=function(_0x1655a6){var _0xa7e21a=this;return new Promise(function(_0x44a4df,_0x3a066a){return db['VoiceAgentReport']['update'](_0x1655a6['body'],{'raw':_0x1655a6[_0x6925('0x16')]?_0x1655a6['options'][_0x6925('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1655a6[_0x6925('0x16')]?_0x1655a6['options']['where']||null:null,'attributes':_0x1655a6[_0x6925('0x16')]?_0x1655a6[_0x6925('0x16')][_0x6925('0x19')]||null:null,'limit':_0x1655a6[_0x6925('0x16')]?_0x1655a6[_0x6925('0x16')][_0x6925('0x1a')]||null:null})['then'](function(_0x5c282d){logger[_0x6925('0x8')]('UpdateVoiceAgentReport',_0x1655a6);logger[_0x6925('0xb')](_0x6925('0x18'),_0x1655a6,JSON[_0x6925('0xd')](_0x5c282d));_0x44a4df(_0x5c282d);})[_0x6925('0x11')](function(_0x4fdc27){logger[_0x6925('0xe')](_0x6925('0x18'),_0x4fdc27[_0x6925('0xf')],_0x1655a6);_0x3a066a(_0xa7e21a[_0x6925('0xe')](0x1f4,_0x4fdc27[_0x6925('0xf')]));});});}; \ No newline at end of file +var _0xfc30=['where','attributes','limit','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','CreateVoiceAgentReport','VoiceAgentReport','create','body','options','UpdateVoiceAgentReport','raw'];(function(_0x185b1f,_0x479856){var _0x5106c1=function(_0x93ce2d){while(--_0x93ce2d){_0x185b1f['push'](_0x185b1f['shift']());}};_0x5106c1(++_0x479856);}(_0xfc30,0x12c));var _0x0fc3=function(_0x3b1b08,_0x308e95){_0x3b1b08=_0x3b1b08-0x0;var _0x46ff1f=_0xfc30[_0x3b1b08];return _0x46ff1f;};'use strict';var _=require(_0x0fc3('0x0'));var util=require(_0x0fc3('0x1'));var moment=require(_0x0fc3('0x2'));var BPromise=require(_0x0fc3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0fc3('0x4'));var db=require(_0x0fc3('0x5'))['db'];var utils=require(_0x0fc3('0x6'));var logger=require(_0x0fc3('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x0fc3('0x8'));var client=jayson[_0x0fc3('0x9')][_0x0fc3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4ec3a1,_0x4fb311,_0x24d033){return new BPromise(function(_0xd3d14a,_0x1ec41c){return client[_0x0fc3('0xb')](_0x4ec3a1,_0x24d033)[_0x0fc3('0xc')](function(_0x36107e){logger['info'](_0x0fc3('0xd'),_0x4fb311,_0x0fc3('0xe'));logger[_0x0fc3('0xf')](_0x0fc3('0x10'),_0x4fb311,_0x0fc3('0xe'),JSON[_0x0fc3('0x11')](_0x36107e));if(_0x36107e[_0x0fc3('0x12')]){if(_0x36107e['error'][_0x0fc3('0x13')]===0x1f4){logger[_0x0fc3('0x12')](_0x0fc3('0xd'),_0x4fb311,_0x36107e['error'][_0x0fc3('0x14')]);return _0x1ec41c(_0x36107e[_0x0fc3('0x12')]['message']);}logger[_0x0fc3('0x12')](_0x0fc3('0xd'),_0x4fb311,_0x36107e[_0x0fc3('0x12')][_0x0fc3('0x14')]);return _0xd3d14a(_0x36107e['error'][_0x0fc3('0x14')]);}else{logger[_0x0fc3('0x15')](_0x0fc3('0xd'),_0x4fb311,_0x0fc3('0xe'));_0xd3d14a(_0x36107e['result']['message']);}})[_0x0fc3('0x16')](function(_0x2a61ea){logger[_0x0fc3('0x12')](_0x0fc3('0xd'),_0x4fb311,_0x2a61ea);_0x1ec41c(_0x2a61ea);});});}exports[_0x0fc3('0x17')]=function(_0x326f7d){var _0x5cc348=this;return new Promise(function(_0x2c996f,_0x320e45){return db[_0x0fc3('0x18')][_0x0fc3('0x19')](_0x326f7d[_0x0fc3('0x1a')],{'raw':_0x326f7d[_0x0fc3('0x1b')]?_0x326f7d[_0x0fc3('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0x0fc3('0xc')](function(_0x27140e){logger[_0x0fc3('0x15')](_0x0fc3('0x17'),_0x326f7d);logger[_0x0fc3('0xf')]('CreateVoiceAgentReport',_0x326f7d,JSON[_0x0fc3('0x11')](_0x27140e));_0x2c996f(_0x27140e);})['catch'](function(_0x1b08fa){logger['error'](_0x0fc3('0x17'),_0x1b08fa[_0x0fc3('0x14')],_0x326f7d);_0x320e45(_0x5cc348[_0x0fc3('0x12')](0x1f4,_0x1b08fa[_0x0fc3('0x14')]));});});};exports[_0x0fc3('0x1c')]=function(_0x5d8b34){var _0x284e52=this;return new Promise(function(_0x210478,_0xba07a9){return db[_0x0fc3('0x18')]['update'](_0x5d8b34['body'],{'raw':_0x5d8b34[_0x0fc3('0x1b')]?_0x5d8b34[_0x0fc3('0x1b')][_0x0fc3('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5d8b34['options']?_0x5d8b34[_0x0fc3('0x1b')][_0x0fc3('0x1e')]||null:null,'attributes':_0x5d8b34[_0x0fc3('0x1b')]?_0x5d8b34[_0x0fc3('0x1b')][_0x0fc3('0x1f')]||null:null,'limit':_0x5d8b34[_0x0fc3('0x1b')]?_0x5d8b34[_0x0fc3('0x1b')][_0x0fc3('0x20')]||null:null})[_0x0fc3('0xc')](function(_0x560936){logger[_0x0fc3('0x15')](_0x0fc3('0x1c'),_0x5d8b34);logger[_0x0fc3('0xf')](_0x0fc3('0x1c'),_0x5d8b34,JSON['stringify'](_0x560936));_0x210478(_0x560936);})[_0x0fc3('0x16')](function(_0x29aa01){logger['error'](_0x0fc3('0x1c'),_0x29aa01[_0x0fc3('0x14')],_0x5d8b34);_0xba07a9(_0x284e52['error'](0x1f4,_0x29aa01[_0x0fc3('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index da87e93..e7bde44 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 _0x9a19=['delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','get','isAuthenticated','index','/:id','post','create','put','update'];(function(_0x4741bc,_0x250493){var _0x5c8a1c=function(_0x4b53bc){while(--_0x4b53bc){_0x4741bc['push'](_0x4741bc['shift']());}};_0x5c8a1c(++_0x250493);}(_0x9a19,0x114));var _0x99a1=function(_0x4c6d6f,_0x291557){_0x4c6d6f=_0x4c6d6f-0x0;var _0x2d4478=_0x9a19[_0x4c6d6f];return _0x2d4478;};'use strict';var multer=require(_0x99a1('0x0'));var util=require(_0x99a1('0x1'));var path=require(_0x99a1('0x2'));var timeout=require('connect-timeout');var express=require(_0x99a1('0x3'));var router=express[_0x99a1('0x4')]();var fs_extra=require(_0x99a1('0x5'));var auth=require(_0x99a1('0x6'));var interaction=require(_0x99a1('0x7'));var config=require(_0x99a1('0x8'));var controller=require(_0x99a1('0x9'));router[_0x99a1('0xa')]('/',auth[_0x99a1('0xb')](),controller[_0x99a1('0xc')]);router[_0x99a1('0xa')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x99a1('0xa')](_0x99a1('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x99a1('0xe')]('/',auth[_0x99a1('0xb')](),controller[_0x99a1('0xf')]);router[_0x99a1('0x10')](_0x99a1('0xd'),auth['isAuthenticated'](),controller[_0x99a1('0x11')]);router[_0x99a1('0x12')](_0x99a1('0xd'),auth[_0x99a1('0xb')](),controller[_0x99a1('0x13')]);module[_0x99a1('0x14')]=router; \ No newline at end of file +var _0xac9d=['../../components/auth/service','../../config/environment','get','isAuthenticated','index','/describe','show','post','create','put','/:id','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0xac9d,0x14d));var _0xdac9=function(_0x5581ba,_0x268887){_0x5581ba=_0x5581ba-0x0;var _0x1e927f=_0xac9d[_0x5581ba];return _0x1e927f;};'use strict';var multer=require(_0xdac9('0x0'));var util=require(_0xdac9('0x1'));var path=require(_0xdac9('0x2'));var timeout=require(_0xdac9('0x3'));var express=require(_0xdac9('0x4'));var router=express[_0xdac9('0x5')]();var fs_extra=require(_0xdac9('0x6'));var auth=require(_0xdac9('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xdac9('0x8'));var controller=require('./voiceCallReport.controller');router[_0xdac9('0x9')]('/',auth[_0xdac9('0xa')](),controller[_0xdac9('0xb')]);router[_0xdac9('0x9')](_0xdac9('0xc'),auth[_0xdac9('0xa')](),controller['describe']);router[_0xdac9('0x9')]('/:id',auth[_0xdac9('0xa')](),controller[_0xdac9('0xd')]);router[_0xdac9('0xe')]('/',auth[_0xdac9('0xa')](),controller[_0xdac9('0xf')]);router[_0xdac9('0x10')](_0xdac9('0x11'),auth[_0xdac9('0xa')](),controller[_0xdac9('0x12')]);router['delete'](_0xdac9('0x11'),auth[_0xdac9('0xa')](),controller['destroy']);module[_0xdac9('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index 2186a60..92eca86 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 _0xab9c=['dialer','TEXT','DATE','INTEGER','exports','STRING','ENUM','inbound','internal','outbound','inbound-fax','outbound-fax'];(function(_0x5caf94,_0x1310ab){var _0x33dc6e=function(_0x1cf75c){while(--_0x1cf75c){_0x5caf94['push'](_0x5caf94['shift']());}};_0x33dc6e(++_0x1310ab);}(_0xab9c,0xd0));var _0xcab9=function(_0xb61a78,_0x4397e2){_0xb61a78=_0xb61a78-0x0;var _0x5946e4=_0xab9c[_0xb61a78];return _0x5946e4;};'use strict';var Sequelize=require('sequelize');module[_0xcab9('0x0')]={'uniqueid':{'type':Sequelize[_0xcab9('0x1')]},'type':{'type':Sequelize[_0xcab9('0x2')](_0xcab9('0x3'),_0xcab9('0x4'),_0xcab9('0x5'),_0xcab9('0x6'),_0xcab9('0x7'),_0xcab9('0x8'))},'tag':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xcab9('0x1')]},'source':{'type':Sequelize[_0xcab9('0x1')]},'destination':{'type':Sequelize[_0xcab9('0x1')]},'destinationcontext':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xcab9('0x1')]},'channel':{'type':Sequelize[_0xcab9('0x1')]},'destinationchannel':{'type':Sequelize[_0xcab9('0x1')]},'lastapplication':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0xcab9('0x9')]},'starttime':{'type':Sequelize[_0xcab9('0xa')]},'systemanswertime':{'type':Sequelize[_0xcab9('0xa')]},'answertime':{'type':Sequelize[_0xcab9('0xa')]},'endtime':{'type':Sequelize[_0xcab9('0xa')]},'duration':{'type':Sequelize[_0xcab9('0xb')]},'billableseconds':{'type':Sequelize[_0xcab9('0xb')]},'mohtime':{'type':Sequelize[_0xcab9('0xb')],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xcab9('0x1')]},'amaflags':{'type':Sequelize[_0xcab9('0x1')]},'userfield':{'type':Sequelize[_0xcab9('0x1')]},'userDisposition':{'type':Sequelize[_0xcab9('0x1')]},'userSecondDisposition':{'type':Sequelize[_0xcab9('0x1')]},'userThirdDisposition':{'type':Sequelize[_0xcab9('0x1')]},'note':{'type':Sequelize[_0xcab9('0x1')]},'prefix':{'type':Sequelize[_0xcab9('0x1')]},'routeid':{'type':Sequelize[_0xcab9('0xb')]},'sipcallid':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x9d9a=['DATE','INTEGER','exports','STRING','inbound','internal','inbound-fax','outbound-fax','dialer','TEXT'];(function(_0x352d4b,_0x55a2c7){var _0x57be3b=function(_0x15a974){while(--_0x15a974){_0x352d4b['push'](_0x352d4b['shift']());}};_0x57be3b(++_0x55a2c7);}(_0x9d9a,0x1ba));var _0xa9d9=function(_0x18ec3f,_0x7c819e){_0x18ec3f=_0x18ec3f-0x0;var _0x2dbfec=_0x9d9a[_0x18ec3f];return _0x2dbfec;};'use strict';var Sequelize=require('sequelize');module[_0xa9d9('0x0')]={'uniqueid':{'type':Sequelize[_0xa9d9('0x1')]},'type':{'type':Sequelize['ENUM'](_0xa9d9('0x2'),_0xa9d9('0x3'),'outbound',_0xa9d9('0x4'),_0xa9d9('0x5'),_0xa9d9('0x6'))},'tag':{'type':Sequelize[_0xa9d9('0x1')]},'accountcode':{'type':Sequelize['STRING']},'source':{'type':Sequelize[_0xa9d9('0x1')]},'destination':{'type':Sequelize[_0xa9d9('0x1')]},'destinationcontext':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xa9d9('0x1')]},'channel':{'type':Sequelize[_0xa9d9('0x1')]},'destinationchannel':{'type':Sequelize['STRING']},'lastapplication':{'type':Sequelize[_0xa9d9('0x1')]},'lastdata':{'type':Sequelize[_0xa9d9('0x7')]},'starttime':{'type':Sequelize[_0xa9d9('0x8')]},'systemanswertime':{'type':Sequelize[_0xa9d9('0x8')]},'answertime':{'type':Sequelize[_0xa9d9('0x8')]},'endtime':{'type':Sequelize[_0xa9d9('0x8')]},'duration':{'type':Sequelize[_0xa9d9('0x9')]},'billableseconds':{'type':Sequelize[_0xa9d9('0x9')]},'mohtime':{'type':Sequelize[_0xa9d9('0x9')],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0xa9d9('0x1')]},'userfield':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize[_0xa9d9('0x1')]},'userSecondDisposition':{'type':Sequelize[_0xa9d9('0x1')]},'userThirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xa9d9('0x1')]},'prefix':{'type':Sequelize[_0xa9d9('0x1')]},'routeid':{'type':Sequelize['INTEGER']},'sipcallid':{'type':Sequelize[_0xa9d9('0x1')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index 16eaf3b..77287b0 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 _0x5f66=['../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','apply','reject','save','destroy','then','error','name','send','index','map','VoiceCallReport','rawAttributes','fieldName','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','merge','type','VIRTUAL','includeAll','include','fullname','alias','User','rows','catch','show','params','find','create','body','describe','uniqueid','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x5f66,0x1a0));var _0x65f6=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0x5f66[_0x278e3c];return _0x3e2d9b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x65f6('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x65f6('0x1'));var rp=require(_0x65f6('0x2'));var moment=require(_0x65f6('0x3'));var BPromise=require(_0x65f6('0x4'));var Mustache=require(_0x65f6('0x5'));var util=require('util');var path=require(_0x65f6('0x6'));var sox=require('sox');var csv=require(_0x65f6('0x7'));var ejs=require(_0x65f6('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x65f6('0x9'));var crypto=require(_0x65f6('0xa'));var jsforce=require(_0x65f6('0xb'));var deskjs=require(_0x65f6('0xc'));var toCsv=require(_0x65f6('0x7'));var querystring=require(_0x65f6('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x65f6('0xe'));var qs=require(_0x65f6('0xf'));var as=require(_0x65f6('0x10'));var hardwareService=require(_0x65f6('0x11'));var logger=require('../../config/logger')(_0x65f6('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x65f6('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x419819,_0x4862a5){_0x4862a5=_0x4862a5||0xcc;return function(_0x2f964a){if(_0x2f964a){return _0x419819[_0x65f6('0x14')](_0x4862a5);}return _0x419819[_0x65f6('0x15')](_0x4862a5)[_0x65f6('0x16')]();};}function respondWithResult(_0x369f96,_0x1d29fd){_0x1d29fd=_0x1d29fd||0xc8;return function(_0x44144b){if(_0x44144b){return _0x369f96[_0x65f6('0x15')](_0x1d29fd)[_0x65f6('0x17')](_0x44144b);}};}function respondWithFilteredResult(_0x3440af,_0x59154e){return function(_0x19b9ff){if(_0x19b9ff){var _0x49a913=typeof _0x59154e['offset']===_0x65f6('0x18')&&typeof _0x59154e[_0x65f6('0x19')]===_0x65f6('0x18');var _0x1c955c=_0x19b9ff[_0x65f6('0x1a')];var _0x1f974c=_0x49a913?0x0:_0x59154e[_0x65f6('0x1b')];var _0x18380e=_0x49a913?_0x19b9ff['count']:_0x59154e['offset']+_0x59154e[_0x65f6('0x19')];var _0x5b4055;if(_0x18380e>=_0x1c955c){_0x18380e=_0x1c955c;_0x5b4055=0xc8;}else{_0x5b4055=0xce;}_0x3440af['status'](_0x5b4055);return _0x3440af['set'](_0x65f6('0x1c'),_0x1f974c+'-'+_0x18380e+'/'+_0x1c955c)[_0x65f6('0x17')](_0x19b9ff);}return null;};}function patchUpdates(_0x5114a4){return function(_0x39e19f){try{jsonpatch[_0x65f6('0x1d')](_0x39e19f,_0x5114a4,!![]);}catch(_0xbee6a4){return BPromise[_0x65f6('0x1e')](_0xbee6a4);}return _0x39e19f[_0x65f6('0x1f')]();};}function saveUpdates(_0xc139c2,_0x581374){return function(_0x197a49){if(_0x197a49){return _0x197a49['update'](_0xc139c2)['then'](function(_0x212247){return _0x212247;});}return null;};}function removeEntity(_0xd173f4,_0x524e42){return function(_0x1eeaaa){if(_0x1eeaaa){return _0x1eeaaa[_0x65f6('0x20')]()[_0x65f6('0x21')](function(){_0xd173f4[_0x65f6('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9d7bb0,_0x59ea32){return function(_0x20a161){if(!_0x20a161){_0x9d7bb0['sendStatus'](0x194);}return _0x20a161;};}function handleError(_0x5cb131,_0x4fde2f){_0x4fde2f=_0x4fde2f||0x1f4;return function(_0x29abdb){logger[_0x65f6('0x22')](_0x29abdb['stack']);if(_0x29abdb[_0x65f6('0x23')]){delete _0x29abdb[_0x65f6('0x23')];}_0x5cb131['status'](_0x4fde2f)[_0x65f6('0x24')](_0x29abdb);};}exports[_0x65f6('0x25')]=function(_0x28d0df,_0x559330){var _0x4ac04b={},_0x488d36={},_0x266cfe={'count':0x0,'rows':[]};var _0x3c032f=_[_0x65f6('0x26')](db[_0x65f6('0x27')][_0x65f6('0x28')],function(_0x14a387){return{'name':_0x14a387[_0x65f6('0x29')],'type':_0x14a387['type']['key']};});_0x488d36[_0x65f6('0x2a')]=_[_0x65f6('0x26')](_0x3c032f,'name');_0x488d36['query']=_[_0x65f6('0x2b')](_0x28d0df[_0x65f6('0x2c')]);_0x488d36[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x488d36[_0x65f6('0x2a')],_0x488d36[_0x65f6('0x2c')]);_0x4ac04b['attributes']=_[_0x65f6('0x2e')](_0x488d36[_0x65f6('0x2a')],qs[_0x65f6('0x2f')](_0x28d0df['query'][_0x65f6('0x2f')]));_0x4ac04b[_0x65f6('0x30')]=_0x4ac04b[_0x65f6('0x30')][_0x65f6('0x31')]?_0x4ac04b[_0x65f6('0x30')]:_0x488d36[_0x65f6('0x2a')];if(!_0x28d0df['query'][_0x65f6('0x32')](_0x65f6('0x33'))){_0x4ac04b['limit']=qs[_0x65f6('0x19')](_0x28d0df['query'][_0x65f6('0x19')]);_0x4ac04b['offset']=qs[_0x65f6('0x1b')](_0x28d0df[_0x65f6('0x2c')]['offset']);}_0x4ac04b[_0x65f6('0x34')]=qs[_0x65f6('0x35')](_0x28d0df[_0x65f6('0x2c')]['sort']);_0x4ac04b['where']=qs[_0x65f6('0x2d')](_['pick'](_0x28d0df[_0x65f6('0x2c')],_0x488d36['filters']),_0x3c032f);if(_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x36')]){_0x4ac04b['where']=_[_0x65f6('0x37')](_0x4ac04b['where'],{'$or':_['map'](_0x3c032f,function(_0x71b16b){if(_0x71b16b[_0x65f6('0x38')]!==_0x65f6('0x39')){var _0x313be5={};_0x313be5[_0x71b16b[_0x65f6('0x23')]]={'$like':'%'+_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x36')]+'%'};return _0x313be5;}})});}_0x4ac04b=_[_0x65f6('0x37')]({},_0x4ac04b,_0x28d0df['options']);var _0x3aa254={'where':_0x4ac04b['where']};return db[_0x65f6('0x27')][_0x65f6('0x1a')](_0x3aa254)[_0x65f6('0x21')](function(_0x2ea7f7){_0x266cfe['count']=_0x2ea7f7;if(_0x28d0df[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x4ac04b[_0x65f6('0x3b')]=[{'attributes':['id',_0x65f6('0x23'),_0x65f6('0x3c'),_0x65f6('0x3d')],'model':db[_0x65f6('0x3e')],'as':_0x65f6('0x3e')}];}return db[_0x65f6('0x27')]['findAll'](_0x4ac04b);})[_0x65f6('0x21')](function(_0x400ed2){_0x266cfe[_0x65f6('0x3f')]=_0x400ed2;return _0x266cfe;})[_0x65f6('0x21')](respondWithFilteredResult(_0x559330,_0x4ac04b))[_0x65f6('0x40')](handleError(_0x559330,null));};exports[_0x65f6('0x41')]=function(_0xe0b72d,_0x2e91e8){var _0x461393={'raw':!![],'where':{'id':_0xe0b72d[_0x65f6('0x42')]['id']}},_0x2abbed={};_0x2abbed[_0x65f6('0x2a')]=_[_0x65f6('0x2b')](db[_0x65f6('0x27')][_0x65f6('0x28')]);_0x2abbed[_0x65f6('0x2c')]=_['keys'](_0xe0b72d[_0x65f6('0x2c')]);_0x2abbed[_0x65f6('0x2d')]=_[_0x65f6('0x2e')](_0x2abbed[_0x65f6('0x2a')],_0x2abbed['query']);_0x461393[_0x65f6('0x30')]=_[_0x65f6('0x2e')](_0x2abbed[_0x65f6('0x2a')],qs['fields'](_0xe0b72d[_0x65f6('0x2c')][_0x65f6('0x2f')]));_0x461393[_0x65f6('0x30')]=_0x461393[_0x65f6('0x30')]['length']?_0x461393[_0x65f6('0x30')]:_0x2abbed['model'];if(_0xe0b72d[_0x65f6('0x2c')][_0x65f6('0x3a')]){_0x461393['include']=[{'all':!![]}];}_0x461393=_[_0x65f6('0x37')]({},_0x461393,_0xe0b72d['options']);return db[_0x65f6('0x27')][_0x65f6('0x43')](_0x461393)[_0x65f6('0x21')](handleEntityNotFound(_0x2e91e8,null))[_0x65f6('0x21')](respondWithResult(_0x2e91e8,null))[_0x65f6('0x40')](handleError(_0x2e91e8,null));};exports[_0x65f6('0x44')]=function(_0x4d30c5,_0x51bf6c){return db[_0x65f6('0x27')][_0x65f6('0x44')](_0x4d30c5[_0x65f6('0x45')],{})[_0x65f6('0x21')](respondWithResult(_0x51bf6c,0xc9))[_0x65f6('0x40')](handleError(_0x51bf6c,null));};exports[_0x65f6('0x20')]=function(_0x149c28,_0x41690c){return db[_0x65f6('0x27')]['find']({'where':{'id':_0x149c28[_0x65f6('0x42')]['id']}})[_0x65f6('0x21')](handleEntityNotFound(_0x41690c,null))[_0x65f6('0x21')](removeEntity(_0x41690c,null))['catch'](handleError(_0x41690c,null));};exports[_0x65f6('0x46')]=function(_0x42d453,_0x49ba5a){return db[_0x65f6('0x27')][_0x65f6('0x46')]()['then'](respondWithResult(_0x49ba5a,null))[_0x65f6('0x40')](handleError(_0x49ba5a,null));};exports['update']=function(_0x247be3,_0x3b241f){if(_0x247be3[_0x65f6('0x45')]['uniqueid']){delete _0x247be3[_0x65f6('0x45')][_0x65f6('0x47')];}return db['VoiceCallReport'][_0x65f6('0x43')]({'where':{'uniqueid':_0x247be3[_0x65f6('0x42')]['id'],'UserId':{'$or':[null,_0x247be3['user']['id']]}}})[_0x65f6('0x21')](handleEntityNotFound(_0x3b241f,null))[_0x65f6('0x21')](saveUpdates(_0x247be3[_0x65f6('0x45')],null))[_0x65f6('0x21')](respondWithResult(_0x3b241f,null))[_0x65f6('0x40')](handleError(_0x3b241f,null));}; \ No newline at end of file +var _0xadb5=['filter','VIRTUAL','merge','options','includeAll','include','fullname','User','findAll','rows','show','rawAttributes','length','find','catch','body','params','describe','uniqueid','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','stack','name','send','index','map','VoiceCallReport','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filters'];(function(_0x2067e9,_0x5e6a97){var _0x280ce4=function(_0x2eca23){while(--_0x2eca23){_0x2067e9['push'](_0x2067e9['shift']());}};_0x280ce4(++_0x5e6a97);}(_0xadb5,0xad));var _0x5adb=function(_0x101bd5,_0x1ce1b2){_0x101bd5=_0x101bd5-0x0;var _0x2f299a=_0xadb5[_0x101bd5];return _0x2f299a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5adb('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5adb('0x1'));var rp=require(_0x5adb('0x2'));var moment=require(_0x5adb('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5adb('0x4'));var util=require(_0x5adb('0x5'));var path=require(_0x5adb('0x6'));var sox=require('sox');var csv=require(_0x5adb('0x7'));var ejs=require(_0x5adb('0x8'));var fs=require('fs');var fs_extra=require(_0x5adb('0x9'));var _=require(_0x5adb('0xa'));var squel=require(_0x5adb('0xb'));var crypto=require(_0x5adb('0xc'));var jsforce=require(_0x5adb('0xd'));var deskjs=require(_0x5adb('0xe'));var toCsv=require(_0x5adb('0x7'));var querystring=require(_0x5adb('0xf'));var Papa=require(_0x5adb('0x10'));var Redis=require(_0x5adb('0x11'));var authService=require(_0x5adb('0x12'));var qs=require(_0x5adb('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5adb('0x14'))(_0x5adb('0x15'));var utils=require(_0x5adb('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x5adb('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2a0b70,_0x5433bf){_0x5433bf=_0x5433bf||0xcc;return function(_0x8cfcc6){if(_0x8cfcc6){return _0x2a0b70[_0x5adb('0x18')](_0x5433bf);}return _0x2a0b70[_0x5adb('0x19')](_0x5433bf)['end']();};}function respondWithResult(_0x2a545b,_0x34af2c){_0x34af2c=_0x34af2c||0xc8;return function(_0xf82f72){if(_0xf82f72){return _0x2a545b['status'](_0x34af2c)[_0x5adb('0x1a')](_0xf82f72);}};}function respondWithFilteredResult(_0x518823,_0x367d82){return function(_0x42a482){if(_0x42a482){var _0x30614e=typeof _0x367d82[_0x5adb('0x1b')]===_0x5adb('0x1c')&&typeof _0x367d82[_0x5adb('0x1d')]===_0x5adb('0x1c');var _0x42f4c6=_0x42a482[_0x5adb('0x1e')];var _0x529b65=_0x30614e?0x0:_0x367d82[_0x5adb('0x1b')];var _0x5de028=_0x30614e?_0x42a482[_0x5adb('0x1e')]:_0x367d82['offset']+_0x367d82[_0x5adb('0x1d')];var _0x50e84f;if(_0x5de028>=_0x42f4c6){_0x5de028=_0x42f4c6;_0x50e84f=0xc8;}else{_0x50e84f=0xce;}_0x518823['status'](_0x50e84f);return _0x518823[_0x5adb('0x1f')](_0x5adb('0x20'),_0x529b65+'-'+_0x5de028+'/'+_0x42f4c6)[_0x5adb('0x1a')](_0x42a482);}return null;};}function patchUpdates(_0x1fd4a7){return function(_0x99bc6c){try{jsonpatch['apply'](_0x99bc6c,_0x1fd4a7,!![]);}catch(_0x3255b3){return BPromise['reject'](_0x3255b3);}return _0x99bc6c['save']();};}function saveUpdates(_0x3754cc,_0x379b33){return function(_0x1a38d3){if(_0x1a38d3){return _0x1a38d3[_0x5adb('0x21')](_0x3754cc)[_0x5adb('0x22')](function(_0x413911){return _0x413911;});}return null;};}function removeEntity(_0xfd9bb9,_0x4ca150){return function(_0x4b1957){if(_0x4b1957){return _0x4b1957[_0x5adb('0x23')]()[_0x5adb('0x22')](function(){_0xfd9bb9[_0x5adb('0x19')](0xcc)[_0x5adb('0x24')]();});}};}function handleEntityNotFound(_0x49f203,_0x2fee18){return function(_0x2e1e63){if(!_0x2e1e63){_0x49f203['sendStatus'](0x194);}return _0x2e1e63;};}function handleError(_0x1feecf,_0x1ded9f){_0x1ded9f=_0x1ded9f||0x1f4;return function(_0x1a0acd){logger['error'](_0x1a0acd[_0x5adb('0x25')]);if(_0x1a0acd[_0x5adb('0x26')]){delete _0x1a0acd[_0x5adb('0x26')];}_0x1feecf[_0x5adb('0x19')](_0x1ded9f)[_0x5adb('0x27')](_0x1a0acd);};}exports[_0x5adb('0x28')]=function(_0x4a5d46,_0x49992e){var _0x5d457e={},_0x39bddd={},_0x1eac55={'count':0x0,'rows':[]};var _0x60a672=_[_0x5adb('0x29')](db[_0x5adb('0x2a')]['rawAttributes'],function(_0x11ec2a){return{'name':_0x11ec2a[_0x5adb('0x2b')],'type':_0x11ec2a[_0x5adb('0x2c')][_0x5adb('0x2d')]};});_0x39bddd[_0x5adb('0x2e')]=_[_0x5adb('0x29')](_0x60a672,_0x5adb('0x26'));_0x39bddd[_0x5adb('0x2f')]=_[_0x5adb('0x30')](_0x4a5d46[_0x5adb('0x2f')]);_0x39bddd['filters']=_[_0x5adb('0x31')](_0x39bddd['model'],_0x39bddd[_0x5adb('0x2f')]);_0x5d457e[_0x5adb('0x32')]=_['intersection'](_0x39bddd[_0x5adb('0x2e')],qs[_0x5adb('0x33')](_0x4a5d46[_0x5adb('0x2f')]['fields']));_0x5d457e[_0x5adb('0x32')]=_0x5d457e[_0x5adb('0x32')]['length']?_0x5d457e['attributes']:_0x39bddd[_0x5adb('0x2e')];if(!_0x4a5d46['query'][_0x5adb('0x34')](_0x5adb('0x35'))){_0x5d457e[_0x5adb('0x1d')]=qs[_0x5adb('0x1d')](_0x4a5d46[_0x5adb('0x2f')]['limit']);_0x5d457e[_0x5adb('0x1b')]=qs[_0x5adb('0x1b')](_0x4a5d46[_0x5adb('0x2f')]['offset']);}_0x5d457e['order']=qs[_0x5adb('0x36')](_0x4a5d46[_0x5adb('0x2f')]['sort']);_0x5d457e[_0x5adb('0x37')]=qs['filters'](_[_0x5adb('0x38')](_0x4a5d46['query'],_0x39bddd[_0x5adb('0x39')]),_0x60a672);if(_0x4a5d46['query'][_0x5adb('0x3a')]){_0x5d457e[_0x5adb('0x37')]=_['merge'](_0x5d457e[_0x5adb('0x37')],{'$or':_['map'](_0x60a672,function(_0xadbe37){if(_0xadbe37[_0x5adb('0x2c')]!==_0x5adb('0x3b')){var _0x50edd1={};_0x50edd1[_0xadbe37[_0x5adb('0x26')]]={'$like':'%'+_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3a')]+'%'};return _0x50edd1;}})});}_0x5d457e=_[_0x5adb('0x3c')]({},_0x5d457e,_0x4a5d46[_0x5adb('0x3d')]);var _0x52d74f={'where':_0x5d457e['where']};return db['VoiceCallReport']['count'](_0x52d74f)[_0x5adb('0x22')](function(_0x2fbe14){_0x1eac55[_0x5adb('0x1e')]=_0x2fbe14;if(_0x4a5d46[_0x5adb('0x2f')][_0x5adb('0x3e')]){_0x5d457e[_0x5adb('0x3f')]=[{'attributes':['id',_0x5adb('0x26'),_0x5adb('0x40'),'alias'],'model':db['User'],'as':_0x5adb('0x41')}];}return db['VoiceCallReport'][_0x5adb('0x42')](_0x5d457e);})[_0x5adb('0x22')](function(_0x299746){_0x1eac55[_0x5adb('0x43')]=_0x299746;return _0x1eac55;})[_0x5adb('0x22')](respondWithFilteredResult(_0x49992e,_0x5d457e))['catch'](handleError(_0x49992e,null));};exports[_0x5adb('0x44')]=function(_0x565b03,_0x508690){var _0x4160ad={'raw':!![],'where':{'id':_0x565b03['params']['id']}},_0x1a256c={};_0x1a256c[_0x5adb('0x2e')]=_[_0x5adb('0x30')](db[_0x5adb('0x2a')][_0x5adb('0x45')]);_0x1a256c[_0x5adb('0x2f')]=_[_0x5adb('0x30')](_0x565b03[_0x5adb('0x2f')]);_0x1a256c['filters']=_['intersection'](_0x1a256c[_0x5adb('0x2e')],_0x1a256c[_0x5adb('0x2f')]);_0x4160ad[_0x5adb('0x32')]=_[_0x5adb('0x31')](_0x1a256c['model'],qs['fields'](_0x565b03[_0x5adb('0x2f')][_0x5adb('0x33')]));_0x4160ad[_0x5adb('0x32')]=_0x4160ad[_0x5adb('0x32')][_0x5adb('0x46')]?_0x4160ad['attributes']:_0x1a256c[_0x5adb('0x2e')];if(_0x565b03[_0x5adb('0x2f')]['includeAll']){_0x4160ad[_0x5adb('0x3f')]=[{'all':!![]}];}_0x4160ad=_[_0x5adb('0x3c')]({},_0x4160ad,_0x565b03[_0x5adb('0x3d')]);return db[_0x5adb('0x2a')][_0x5adb('0x47')](_0x4160ad)[_0x5adb('0x22')](handleEntityNotFound(_0x508690,null))[_0x5adb('0x22')](respondWithResult(_0x508690,null))[_0x5adb('0x48')](handleError(_0x508690,null));};exports['create']=function(_0x3a925b,_0x57dc8b){return db['VoiceCallReport']['create'](_0x3a925b[_0x5adb('0x49')],{})[_0x5adb('0x22')](respondWithResult(_0x57dc8b,0xc9))[_0x5adb('0x48')](handleError(_0x57dc8b,null));};exports['destroy']=function(_0x2ad69d,_0x5cbab5){return db[_0x5adb('0x2a')][_0x5adb('0x47')]({'where':{'id':_0x2ad69d[_0x5adb('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5cbab5,null))[_0x5adb('0x22')](removeEntity(_0x5cbab5,null))['catch'](handleError(_0x5cbab5,null));};exports[_0x5adb('0x4b')]=function(_0x6dc067,_0x55c535){return db[_0x5adb('0x2a')][_0x5adb('0x4b')]()[_0x5adb('0x22')](respondWithResult(_0x55c535,null))[_0x5adb('0x48')](handleError(_0x55c535,null));};exports[_0x5adb('0x21')]=function(_0x4cb36c,_0x36b847){if(_0x4cb36c[_0x5adb('0x49')][_0x5adb('0x4c')]){delete _0x4cb36c[_0x5adb('0x49')]['uniqueid'];}return db[_0x5adb('0x2a')][_0x5adb('0x47')]({'where':{'uniqueid':_0x4cb36c[_0x5adb('0x4a')]['id'],'UserId':{'$or':[null,_0x4cb36c['user']['id']]}}})[_0x5adb('0x22')](handleEntityNotFound(_0x36b847,null))[_0x5adb('0x22')](saveUpdates(_0x4cb36c[_0x5adb('0x49')],null))[_0x5adb('0x22')](respondWithResult(_0x36b847,null))['catch'](handleError(_0x36b847,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index 05bfeac..27dbbee 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 _0xccb9=['define','VoiceCallReport','report_call','uniqueid','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x471dcc,_0x28d02e){var _0x578b40=function(_0x59a8a9){while(--_0x59a8a9){_0x471dcc['push'](_0x471dcc['shift']());}};_0x578b40(++_0x28d02e);}(_0xccb9,0x124));var _0x9ccb=function(_0x38eb23,_0x196e8b){_0x38eb23=_0x38eb23-0x0;var _0x48506a=_0xccb9[_0x38eb23];return _0x48506a;};'use strict';var _=require(_0x9ccb('0x0'));var util=require('util');var logger=require(_0x9ccb('0x1'))(_0x9ccb('0x2'));var moment=require(_0x9ccb('0x3'));var BPromise=require(_0x9ccb('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9ccb('0x5'));var rimraf=require(_0x9ccb('0x6'));var config=require(_0x9ccb('0x7'));var attributes=require('./voiceCallReport.attributes');module['exports']=function(_0x453264,_0x273f4e){return _0x453264[_0x9ccb('0x8')](_0x9ccb('0x9'),attributes,{'tableName':_0x9ccb('0xa'),'paranoid':![],'indexes':[{'fields':[_0x9ccb('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf51c=['lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./voiceCallReport.attributes','exports','define','VoiceCallReport','report_call'];(function(_0x50c3f6,_0x4829c9){var _0x5d778f=function(_0x420414){while(--_0x420414){_0x50c3f6['push'](_0x50c3f6['shift']());}};_0x5d778f(++_0x4829c9);}(_0xf51c,0x145));var _0xcf51=function(_0x15b716,_0x25c587){_0x15b716=_0x15b716-0x0;var _0x3208a7=_0xf51c[_0x15b716];return _0x3208a7;};'use strict';var _=require(_0xcf51('0x0'));var util=require(_0xcf51('0x1'));var logger=require(_0xcf51('0x2'))(_0xcf51('0x3'));var moment=require(_0xcf51('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xcf51('0x5'));var rimraf=require(_0xcf51('0x6'));var config=require(_0xcf51('0x7'));var attributes=require(_0xcf51('0x8'));module[_0xcf51('0x9')]=function(_0x4a04ac,_0x3bd644){return _0x4a04ac[_0xcf51('0xa')](_0xcf51('0xb'),attributes,{'tableName':_0xcf51('0xc'),'paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index 59c6acc..9a880b0 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 _0xa23b=['catch','GetVoiceCallReport','VoiceCallReport','findAll','options','raw','where','attributes','include','model','map','CreateVoiceCallReport','UpdateVoiceCallReport','update','limit','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','stringify','error','code','VoiceCallReport,\x20%s,\x20%s','message','request\x20sent','result'];(function(_0x38ae97,_0x2a2b73){var _0x503914=function(_0xdbfc93){while(--_0xdbfc93){_0x38ae97['push'](_0x38ae97['shift']());}};_0x503914(++_0x2a2b73);}(_0xa23b,0x18b));var _0xba23=function(_0x24718b,_0x5433aa){_0x24718b=_0x24718b-0x0;var _0x59ecd3=_0xa23b[_0x24718b];return _0x59ecd3;};'use strict';var _=require(_0xba23('0x0'));var util=require(_0xba23('0x1'));var moment=require(_0xba23('0x2'));var BPromise=require('bluebird');var rs=require(_0xba23('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xba23('0x4'))['db'];var utils=require(_0xba23('0x5'));var logger=require(_0xba23('0x6'))(_0xba23('0x7'));var config=require(_0xba23('0x8'));var jayson=require(_0xba23('0x9'));var client=jayson[_0xba23('0xa')][_0xba23('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x283cae,_0x11c9f1,_0x1903d0){return new BPromise(function(_0x214948,_0x1a5873){return client[_0xba23('0xc')](_0x283cae,_0x1903d0)[_0xba23('0xd')](function(_0xb5274c){logger[_0xba23('0xe')]('VoiceCallReport,\x20%s,\x20%s',_0x11c9f1,'request\x20sent');logger[_0xba23('0xf')]('VoiceCallReport,\x20%s,\x20%s,\x20%s',_0x11c9f1,'request\x20sent',JSON[_0xba23('0x10')](_0xb5274c));if(_0xb5274c[_0xba23('0x11')]){if(_0xb5274c[_0xba23('0x11')][_0xba23('0x12')]===0x1f4){logger[_0xba23('0x11')](_0xba23('0x13'),_0x11c9f1,_0xb5274c[_0xba23('0x11')][_0xba23('0x14')]);return _0x1a5873(_0xb5274c[_0xba23('0x11')][_0xba23('0x14')]);}logger[_0xba23('0x11')](_0xba23('0x13'),_0x11c9f1,_0xb5274c[_0xba23('0x11')]['message']);return _0x214948(_0xb5274c[_0xba23('0x11')]['message']);}else{logger[_0xba23('0xe')](_0xba23('0x13'),_0x11c9f1,_0xba23('0x15'));_0x214948(_0xb5274c[_0xba23('0x16')][_0xba23('0x14')]);}})[_0xba23('0x17')](function(_0x34225f){logger[_0xba23('0x11')](_0xba23('0x13'),_0x11c9f1,_0x34225f);_0x1a5873(_0x34225f);});});}exports[_0xba23('0x18')]=function(_0x5f3c9f){var _0x446932=this;return new Promise(function(_0x325a11,_0x357349){return db[_0xba23('0x19')][_0xba23('0x1a')]({'raw':_0x5f3c9f['options']?_0x5f3c9f[_0xba23('0x1b')][_0xba23('0x1c')]===undefined?!![]:![]:!![],'where':_0x5f3c9f['options']?_0x5f3c9f[_0xba23('0x1b')][_0xba23('0x1d')]||null:null,'attributes':_0x5f3c9f[_0xba23('0x1b')]?_0x5f3c9f['options'][_0xba23('0x1e')]||null:null,'limit':_0x5f3c9f[_0xba23('0x1b')]?_0x5f3c9f[_0xba23('0x1b')]['limit']||null:null,'include':_0x5f3c9f[_0xba23('0x1b')]?_0x5f3c9f[_0xba23('0x1b')][_0xba23('0x1f')]?_['map'](_0x5f3c9f[_0xba23('0x1b')]['include'],function(_0x516ccc){return{'model':db[_0x516ccc[_0xba23('0x20')]],'as':_0x516ccc['as'],'attributes':_0x516ccc['attributes'],'include':_0x516ccc['include']?_[_0xba23('0x21')](_0x516ccc[_0xba23('0x1f')],function(_0xbd5008){return{'model':db[_0xbd5008[_0xba23('0x20')]],'as':_0xbd5008['as'],'attributes':_0xbd5008[_0xba23('0x1e')],'include':_0xbd5008['include']?_['map'](_0xbd5008[_0xba23('0x1f')],function(_0x21c287){return{'model':db[_0x21c287[_0xba23('0x20')]],'as':_0x21c287['as'],'attributes':_0x21c287[_0xba23('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5746b7){logger[_0xba23('0xe')](_0xba23('0x18'),_0x5f3c9f);logger['debug']('GetVoiceCallReport',_0x5f3c9f,JSON['stringify'](_0x5746b7));_0x325a11(_0x5746b7);})[_0xba23('0x17')](function(_0x4a17c2){logger[_0xba23('0x11')](_0xba23('0x18'),_0x4a17c2[_0xba23('0x14')],_0x5f3c9f);_0x357349(_0x446932['error'](0x1f4,_0x4a17c2['message']));});});};exports[_0xba23('0x22')]=function(_0xa34b6){var _0xcbbc4f=this;return new Promise(function(_0x52a4ff,_0x58004b){return db['VoiceCallReport']['create'](_0xa34b6['body'],{'raw':_0xa34b6[_0xba23('0x1b')]?_0xa34b6[_0xba23('0x1b')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x423c20){logger[_0xba23('0xe')](_0xba23('0x22'),_0xa34b6);logger[_0xba23('0xf')]('CreateVoiceCallReport',_0xa34b6,JSON[_0xba23('0x10')](_0x423c20));_0x52a4ff(_0x423c20);})[_0xba23('0x17')](function(_0x368984){logger[_0xba23('0x11')]('CreateVoiceCallReport',_0x368984[_0xba23('0x14')],_0xa34b6);_0x58004b(_0xcbbc4f[_0xba23('0x11')](0x1f4,_0x368984[_0xba23('0x14')]));});});};exports[_0xba23('0x23')]=function(_0x1d18e8){var _0x2508a9=this;return new Promise(function(_0x11feae,_0x1e3317){return db[_0xba23('0x19')][_0xba23('0x24')](_0x1d18e8['body'],{'raw':_0x1d18e8[_0xba23('0x1b')]?_0x1d18e8['options'][_0xba23('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1d18e8['options']?_0x1d18e8[_0xba23('0x1b')]['where']||null:null,'attributes':_0x1d18e8[_0xba23('0x1b')]?_0x1d18e8[_0xba23('0x1b')][_0xba23('0x1e')]||null:null,'limit':_0x1d18e8[_0xba23('0x1b')]?_0x1d18e8[_0xba23('0x1b')][_0xba23('0x25')]||null:null})['then'](function(_0x4e23f6){logger[_0xba23('0xe')](_0xba23('0x23'),_0x1d18e8);logger[_0xba23('0xf')](_0xba23('0x23'),_0x1d18e8,JSON[_0xba23('0x10')](_0x4e23f6));_0x11feae(_0x4e23f6);})['catch'](function(_0x5410b1){logger['error']('UpdateVoiceCallReport',_0x5410b1[_0xba23('0x14')],_0x1d18e8);_0x1e3317(_0x2508a9[_0xba23('0x11')](0x1f4,_0x5410b1['message']));});});}; \ No newline at end of file +var _0x5cc7=['body','UpdateVoiceCallReport','limit','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','then','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','VoiceCallReport,\x20%s,\x20%s','message','result','GetVoiceCallReport','options','raw','where','attributes','map','include','model','info','catch','CreateVoiceCallReport','VoiceCallReport','create'];(function(_0x22c240,_0x2f04ae){var _0x21496a=function(_0x399895){while(--_0x399895){_0x22c240['push'](_0x22c240['shift']());}};_0x21496a(++_0x2f04ae);}(_0x5cc7,0x18f));var _0x75cc=function(_0xba5841,_0x506a2b){_0xba5841=_0xba5841-0x0;var _0xec2d04=_0x5cc7[_0xba5841];return _0xec2d04;};'use strict';var _=require(_0x75cc('0x0'));var util=require('util');var moment=require(_0x75cc('0x1'));var BPromise=require(_0x75cc('0x2'));var rs=require(_0x75cc('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x75cc('0x4'))['db'];var utils=require(_0x75cc('0x5'));var logger=require('../../config/logger')(_0x75cc('0x6'));var config=require(_0x75cc('0x7'));var jayson=require(_0x75cc('0x8'));var client=jayson['client'][_0x75cc('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4412b1,_0x73caeb,_0x435ab1){return new BPromise(function(_0xe051c3,_0x4a8da8){return client['request'](_0x4412b1,_0x435ab1)[_0x75cc('0xa')](function(_0x7db961){logger['info']('VoiceCallReport,\x20%s,\x20%s',_0x73caeb,'request\x20sent');logger[_0x75cc('0xb')](_0x75cc('0xc'),_0x73caeb,_0x75cc('0xd'),JSON[_0x75cc('0xe')](_0x7db961));if(_0x7db961[_0x75cc('0xf')]){if(_0x7db961[_0x75cc('0xf')][_0x75cc('0x10')]===0x1f4){logger[_0x75cc('0xf')](_0x75cc('0x11'),_0x73caeb,_0x7db961[_0x75cc('0xf')]['message']);return _0x4a8da8(_0x7db961[_0x75cc('0xf')][_0x75cc('0x12')]);}logger[_0x75cc('0xf')](_0x75cc('0x11'),_0x73caeb,_0x7db961['error'][_0x75cc('0x12')]);return _0xe051c3(_0x7db961[_0x75cc('0xf')]['message']);}else{logger['info'](_0x75cc('0x11'),_0x73caeb,_0x75cc('0xd'));_0xe051c3(_0x7db961[_0x75cc('0x13')][_0x75cc('0x12')]);}})['catch'](function(_0x3c09e7){logger[_0x75cc('0xf')](_0x75cc('0x11'),_0x73caeb,_0x3c09e7);_0x4a8da8(_0x3c09e7);});});}exports[_0x75cc('0x14')]=function(_0x594d1e){var _0x943975=this;return new Promise(function(_0x329b07,_0x3cd549){return db['VoiceCallReport']['findAll']({'raw':_0x594d1e[_0x75cc('0x15')]?_0x594d1e[_0x75cc('0x15')][_0x75cc('0x16')]===undefined?!![]:![]:!![],'where':_0x594d1e[_0x75cc('0x15')]?_0x594d1e['options'][_0x75cc('0x17')]||null:null,'attributes':_0x594d1e[_0x75cc('0x15')]?_0x594d1e[_0x75cc('0x15')][_0x75cc('0x18')]||null:null,'limit':_0x594d1e[_0x75cc('0x15')]?_0x594d1e[_0x75cc('0x15')]['limit']||null:null,'include':_0x594d1e[_0x75cc('0x15')]?_0x594d1e[_0x75cc('0x15')]['include']?_[_0x75cc('0x19')](_0x594d1e[_0x75cc('0x15')][_0x75cc('0x1a')],function(_0x58aeb4){return{'model':db[_0x58aeb4[_0x75cc('0x1b')]],'as':_0x58aeb4['as'],'attributes':_0x58aeb4[_0x75cc('0x18')],'include':_0x58aeb4[_0x75cc('0x1a')]?_[_0x75cc('0x19')](_0x58aeb4[_0x75cc('0x1a')],function(_0x57d2ed){return{'model':db[_0x57d2ed[_0x75cc('0x1b')]],'as':_0x57d2ed['as'],'attributes':_0x57d2ed[_0x75cc('0x18')],'include':_0x57d2ed[_0x75cc('0x1a')]?_['map'](_0x57d2ed['include'],function(_0x143378){return{'model':db[_0x143378[_0x75cc('0x1b')]],'as':_0x143378['as'],'attributes':_0x143378[_0x75cc('0x18')]};}):[]};}):[]};}):[]:[]})[_0x75cc('0xa')](function(_0x41d30d){logger[_0x75cc('0x1c')](_0x75cc('0x14'),_0x594d1e);logger[_0x75cc('0xb')](_0x75cc('0x14'),_0x594d1e,JSON[_0x75cc('0xe')](_0x41d30d));_0x329b07(_0x41d30d);})[_0x75cc('0x1d')](function(_0x4d9d01){logger[_0x75cc('0xf')](_0x75cc('0x14'),_0x4d9d01[_0x75cc('0x12')],_0x594d1e);_0x3cd549(_0x943975[_0x75cc('0xf')](0x1f4,_0x4d9d01['message']));});});};exports[_0x75cc('0x1e')]=function(_0x1ebfe9){var _0xf88507=this;return new Promise(function(_0x5ac401,_0x9fc666){return db[_0x75cc('0x1f')][_0x75cc('0x20')](_0x1ebfe9[_0x75cc('0x21')],{'raw':_0x1ebfe9[_0x75cc('0x15')]?_0x1ebfe9[_0x75cc('0x15')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x51d4fd){logger[_0x75cc('0x1c')](_0x75cc('0x1e'),_0x1ebfe9);logger[_0x75cc('0xb')](_0x75cc('0x1e'),_0x1ebfe9,JSON[_0x75cc('0xe')](_0x51d4fd));_0x5ac401(_0x51d4fd);})[_0x75cc('0x1d')](function(_0xa7e935){logger[_0x75cc('0xf')](_0x75cc('0x1e'),_0xa7e935[_0x75cc('0x12')],_0x1ebfe9);_0x9fc666(_0xf88507['error'](0x1f4,_0xa7e935['message']));});});};exports[_0x75cc('0x22')]=function(_0x2915a9){var _0xe03dab=this;return new Promise(function(_0x3279a7,_0x475ec7){return db['VoiceCallReport']['update'](_0x2915a9['body'],{'raw':_0x2915a9[_0x75cc('0x15')]?_0x2915a9[_0x75cc('0x15')][_0x75cc('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2915a9[_0x75cc('0x15')]?_0x2915a9['options'][_0x75cc('0x17')]||null:null,'attributes':_0x2915a9[_0x75cc('0x15')]?_0x2915a9[_0x75cc('0x15')][_0x75cc('0x18')]||null:null,'limit':_0x2915a9[_0x75cc('0x15')]?_0x2915a9['options'][_0x75cc('0x23')]||null:null})[_0x75cc('0xa')](function(_0x1d0707){logger['info'](_0x75cc('0x22'),_0x2915a9);logger['debug'](_0x75cc('0x22'),_0x2915a9,JSON[_0x75cc('0xe')](_0x1d0707));_0x3279a7(_0x1d0707);})[_0x75cc('0x1d')](function(_0x5786d4){logger[_0x75cc('0xf')](_0x75cc('0x22'),_0x5786d4[_0x75cc('0x12')],_0x2915a9);_0x475ec7(_0xe03dab[_0x75cc('0xf')](0x1f4,_0x5786d4[_0x75cc('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index 9937848..34065c6 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 _0x7e10=['multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller','index','get','isAuthenticated','show','post','create','put','/:id','delete','destroy','exports'];(function(_0x22f8ab,_0x15d8ff){var _0x2a70e5=function(_0x5e6895){while(--_0x5e6895){_0x22f8ab['push'](_0x22f8ab['shift']());}};_0x2a70e5(++_0x15d8ff);}(_0x7e10,0x78));var _0x07e1=function(_0x285f10,_0x2e6e7d){_0x285f10=_0x285f10-0x0;var _0x5804d4=_0x7e10[_0x285f10];return _0x5804d4;};'use strict';var multer=require(_0x07e1('0x0'));var util=require(_0x07e1('0x1'));var path=require('path');var timeout=require(_0x07e1('0x2'));var express=require('express');var router=express[_0x07e1('0x3')]();var fs_extra=require(_0x07e1('0x4'));var auth=require(_0x07e1('0x5'));var interaction=require(_0x07e1('0x6'));var config=require(_0x07e1('0x7'));var controller=require(_0x07e1('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x07e1('0x9')]);router[_0x07e1('0xa')]('/:id',auth[_0x07e1('0xb')](),controller[_0x07e1('0xc')]);router[_0x07e1('0xd')]('/',auth['isAuthenticated'](),controller[_0x07e1('0xe')]);router[_0x07e1('0xf')](_0x07e1('0x10'),auth[_0x07e1('0xb')](),controller['update']);router[_0x07e1('0x11')](_0x07e1('0x10'),auth[_0x07e1('0xb')](),controller[_0x07e1('0x12')]);module[_0x07e1('0x13')]=router; \ No newline at end of file +var _0xf3e6=['exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','create','put','update','delete','destroy'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xf3e6,0x10f));var _0x6f3e=function(_0x34cdb5,_0x251322){_0x34cdb5=_0x34cdb5-0x0;var _0x4632a9=_0xf3e6[_0x34cdb5];return _0x4632a9;};'use strict';var multer=require(_0x6f3e('0x0'));var util=require(_0x6f3e('0x1'));var path=require(_0x6f3e('0x2'));var timeout=require(_0x6f3e('0x3'));var express=require(_0x6f3e('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x6f3e('0x5'));var interaction=require(_0x6f3e('0x6'));var config=require(_0x6f3e('0x7'));var controller=require('./voiceChanSpy.controller');router[_0x6f3e('0x8')]('/',auth[_0x6f3e('0x9')](),controller['index']);router[_0x6f3e('0x8')](_0x6f3e('0xa'),auth[_0x6f3e('0x9')](),controller[_0x6f3e('0xb')]);router['post']('/',auth[_0x6f3e('0x9')](),controller[_0x6f3e('0xc')]);router[_0x6f3e('0xd')](_0x6f3e('0xa'),auth['isAuthenticated'](),controller[_0x6f3e('0xe')]);router[_0x6f3e('0xf')](_0x6f3e('0xa'),auth[_0x6f3e('0x9')](),controller[_0x6f3e('0x10')]);module[_0x6f3e('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index d8208f3..e524d5f 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 _0x63c8=['setDataValue','options','join','getDataValue','BOOLEAN','sequelize','exports','STRING','name'];(function(_0x5bc777,_0xd25a32){var _0x50ff29=function(_0x37e012){while(--_0x37e012){_0x5bc777['push'](_0x5bc777['shift']());}};_0x50ff29(++_0xd25a32);}(_0x63c8,0x176));var _0x863c=function(_0x198772,_0x2ea3a0){_0x198772=_0x198772-0x0;var _0x3beeeb=_0x63c8[_0x198772];return _0x3beeeb;};'use strict';var Sequelize=require(_0x863c('0x0'));module[_0x863c('0x1')]={'name':{'type':Sequelize[_0x863c('0x2')]},'prefix':{'type':Sequelize['STRING'],'unique':_0x863c('0x3'),'allowNull':![]},'options':{'type':Sequelize['STRING'],'set':function(_0x423e5e){this[_0x863c('0x4')](_0x863c('0x5'),_0x423e5e?_0x423e5e[_0x863c('0x6')](''):[]);},'get':function(){return this[_0x863c('0x7')](_0x863c('0x5'))?this[_0x863c('0x7')](_0x863c('0x5'))['split'](''):[];}},'auth':{'type':Sequelize[_0x863c('0x8')],'defaultValue':![]},'password':{'type':Sequelize[_0x863c('0x2')]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x863c('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x3004=['BOOLEAN','sequelize','exports','STRING','setDataValue','join','getDataValue','options','split'];(function(_0x38bc6e,_0x3200fd){var _0x5de1b0=function(_0x48bd83){while(--_0x48bd83){_0x38bc6e['push'](_0x38bc6e['shift']());}};_0x5de1b0(++_0x3200fd);}(_0x3004,0x88));var _0x4300=function(_0x52f1e6,_0xf70489){_0x52f1e6=_0x52f1e6-0x0;var _0x21f104=_0x3004[_0x52f1e6];return _0x21f104;};'use strict';var Sequelize=require(_0x4300('0x0'));module[_0x4300('0x1')]={'name':{'type':Sequelize[_0x4300('0x2')]},'prefix':{'type':Sequelize[_0x4300('0x2')],'unique':'name','allowNull':![]},'options':{'type':Sequelize[_0x4300('0x2')],'set':function(_0x36a0fa){this[_0x4300('0x3')]('options',_0x36a0fa?_0x36a0fa[_0x4300('0x4')](''):[]);},'get':function(){return this[_0x4300('0x5')](_0x4300('0x6'))?this[_0x4300('0x5')](_0x4300('0x6'))[_0x4300('0x7')](''):[];}},'auth':{'type':Sequelize[_0x4300('0x8')],'defaultValue':![]},'password':{'type':Sequelize[_0x4300('0x2')]},'record':{'type':Sequelize[_0x4300('0x8')],'defaultValue':![]},'recordingFormat':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index 7bac394..6565c53 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 _0x01d3=['undefined','limit','count','apply','reject','save','update','then','destroy','get','ChanSpies','UserProfileResource','error','stack','name','index','VoiceChanSpy','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','offset'];(function(_0x5dea03,_0x5edc15){var _0x18a82d=function(_0x23f170){while(--_0x23f170){_0x5dea03['push'](_0x5dea03['shift']());}};_0x18a82d(++_0x5edc15);}(_0x01d3,0xdb));var _0x301d=function(_0x44e8da,_0x39a103){_0x44e8da=_0x44e8da-0x0;var _0xdda219=_0x01d3[_0x44e8da];return _0xdda219;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x301d('0x0'));var jsonpatch=require(_0x301d('0x1'));var rp=require(_0x301d('0x2'));var moment=require('moment');var BPromise=require(_0x301d('0x3'));var Mustache=require(_0x301d('0x4'));var util=require(_0x301d('0x5'));var path=require(_0x301d('0x6'));var sox=require(_0x301d('0x7'));var csv=require('to-csv');var ejs=require(_0x301d('0x8'));var fs=require('fs');var fs_extra=require(_0x301d('0x9'));var _=require(_0x301d('0xa'));var squel=require(_0x301d('0xb'));var crypto=require(_0x301d('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x301d('0xd'));var toCsv=require(_0x301d('0xe'));var querystring=require(_0x301d('0xf'));var Papa=require(_0x301d('0x10'));var Redis=require(_0x301d('0x11'));var authService=require(_0x301d('0x12'));var qs=require(_0x301d('0x13'));var as=require(_0x301d('0x14'));var hardwareService=require(_0x301d('0x15'));var logger=require('../../config/logger')(_0x301d('0x16'));var utils=require(_0x301d('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x301d('0x18'));var db=require(_0x301d('0x19'))['db'];function respondWithStatusCode(_0x2eb3af,_0x53bfe2){_0x53bfe2=_0x53bfe2||0xcc;return function(_0x496f0c){if(_0x496f0c){return _0x2eb3af[_0x301d('0x1a')](_0x53bfe2);}return _0x2eb3af[_0x301d('0x1b')](_0x53bfe2)[_0x301d('0x1c')]();};}function respondWithResult(_0x377c7f,_0x11bacf){_0x11bacf=_0x11bacf||0xc8;return function(_0x5bdd8a){if(_0x5bdd8a){return _0x377c7f[_0x301d('0x1b')](_0x11bacf)['json'](_0x5bdd8a);}};}function respondWithFilteredResult(_0x1d4fb4,_0xc35239){return function(_0x4fd833){if(_0x4fd833){var _0x10d277=typeof _0xc35239[_0x301d('0x1d')]===_0x301d('0x1e')&&typeof _0xc35239[_0x301d('0x1f')]===_0x301d('0x1e');var _0x1c409b=_0x4fd833[_0x301d('0x20')];var _0x2c7afb=_0x10d277?0x0:_0xc35239[_0x301d('0x1d')];var _0x3a2ad2=_0x10d277?_0x4fd833[_0x301d('0x20')]:_0xc35239[_0x301d('0x1d')]+_0xc35239[_0x301d('0x1f')];var _0x3d75e5;if(_0x3a2ad2>=_0x1c409b){_0x3a2ad2=_0x1c409b;_0x3d75e5=0xc8;}else{_0x3d75e5=0xce;}_0x1d4fb4[_0x301d('0x1b')](_0x3d75e5);return _0x1d4fb4['set']('Content-Range',_0x2c7afb+'-'+_0x3a2ad2+'/'+_0x1c409b)['json'](_0x4fd833);}return null;};}function patchUpdates(_0x31c94e){return function(_0x17ee2a){try{jsonpatch[_0x301d('0x21')](_0x17ee2a,_0x31c94e,!![]);}catch(_0x4d8006){return BPromise[_0x301d('0x22')](_0x4d8006);}return _0x17ee2a[_0x301d('0x23')]();};}function saveUpdates(_0x5b6631,_0x485f96){return function(_0x292c89){if(_0x292c89){return _0x292c89[_0x301d('0x24')](_0x5b6631)[_0x301d('0x25')](function(_0x3fa47d){return _0x3fa47d;});}return null;};}function removeEntity(_0x549e57,_0x1119da){return function(_0x2491b8){if(_0x2491b8){return _0x2491b8[_0x301d('0x26')]()[_0x301d('0x25')](function(){var _0x290201=_0x2491b8[_0x301d('0x27')]({'plain':!![]});var _0x4fae3d=_0x301d('0x28');return db[_0x301d('0x29')][_0x301d('0x26')]({'where':{'type':_0x4fae3d,'resourceId':_0x290201['id']}})[_0x301d('0x25')](function(){return _0x2491b8;});})[_0x301d('0x25')](function(){_0x549e57[_0x301d('0x1b')](0xcc)[_0x301d('0x1c')]();});}};}function handleEntityNotFound(_0x2dd5b8,_0x5d05db){return function(_0x1c7074){if(!_0x1c7074){_0x2dd5b8['sendStatus'](0x194);}return _0x1c7074;};}function handleError(_0x5d7835,_0x320819){_0x320819=_0x320819||0x1f4;return function(_0x52eb42){logger[_0x301d('0x2a')](_0x52eb42[_0x301d('0x2b')]);if(_0x52eb42[_0x301d('0x2c')]){delete _0x52eb42[_0x301d('0x2c')];}_0x5d7835[_0x301d('0x1b')](_0x320819)['send'](_0x52eb42);};}exports[_0x301d('0x2d')]=function(_0x5f06f2,_0x2385ef){var _0x24b1d5={},_0x4a8356={},_0x5b4930={'count':0x0,'rows':[]};var _0x4d1b99=_['map'](db[_0x301d('0x2e')][_0x301d('0x2f')],function(_0x27c3a1){return{'name':_0x27c3a1[_0x301d('0x30')],'type':_0x27c3a1[_0x301d('0x31')][_0x301d('0x32')]};});_0x4a8356[_0x301d('0x33')]=_[_0x301d('0x34')](_0x4d1b99,_0x301d('0x2c'));_0x4a8356[_0x301d('0x35')]=_['keys'](_0x5f06f2[_0x301d('0x35')]);_0x4a8356[_0x301d('0x36')]=_[_0x301d('0x37')](_0x4a8356[_0x301d('0x33')],_0x4a8356[_0x301d('0x35')]);_0x24b1d5[_0x301d('0x38')]=_[_0x301d('0x37')](_0x4a8356[_0x301d('0x33')],qs[_0x301d('0x39')](_0x5f06f2[_0x301d('0x35')]['fields']));_0x24b1d5['attributes']=_0x24b1d5[_0x301d('0x38')][_0x301d('0x3a')]?_0x24b1d5[_0x301d('0x38')]:_0x4a8356[_0x301d('0x33')];if(!_0x5f06f2[_0x301d('0x35')]['hasOwnProperty'](_0x301d('0x3b'))){_0x24b1d5[_0x301d('0x1f')]=qs[_0x301d('0x1f')](_0x5f06f2['query'][_0x301d('0x1f')]);_0x24b1d5['offset']=qs[_0x301d('0x1d')](_0x5f06f2[_0x301d('0x35')][_0x301d('0x1d')]);}_0x24b1d5[_0x301d('0x3c')]=qs[_0x301d('0x3d')](_0x5f06f2[_0x301d('0x35')][_0x301d('0x3d')]);_0x24b1d5[_0x301d('0x3e')]=qs['filters'](_[_0x301d('0x3f')](_0x5f06f2[_0x301d('0x35')],_0x4a8356[_0x301d('0x36')]),_0x4d1b99);if(_0x5f06f2[_0x301d('0x35')][_0x301d('0x40')]){_0x24b1d5['where']=_['merge'](_0x24b1d5['where'],{'$or':_[_0x301d('0x34')](_0x4d1b99,function(_0x5b3056){if(_0x5b3056[_0x301d('0x31')]!==_0x301d('0x41')){var _0x30bc21={};_0x30bc21[_0x5b3056[_0x301d('0x2c')]]={'$like':'%'+_0x5f06f2[_0x301d('0x35')]['filter']+'%'};return _0x30bc21;}})});}_0x24b1d5=_[_0x301d('0x42')]({},_0x24b1d5,_0x5f06f2['options']);var _0x512fd4={'where':_0x24b1d5[_0x301d('0x3e')]};return db['VoiceChanSpy']['count'](_0x512fd4)[_0x301d('0x25')](function(_0x168211){_0x5b4930[_0x301d('0x20')]=_0x168211;if(_0x5f06f2[_0x301d('0x35')][_0x301d('0x43')]){_0x24b1d5[_0x301d('0x44')]=[{'all':!![]}];}return db['VoiceChanSpy'][_0x301d('0x45')](_0x24b1d5);})[_0x301d('0x25')](function(_0x3dd5f5){_0x5b4930[_0x301d('0x46')]=_0x3dd5f5;return _0x5b4930;})[_0x301d('0x25')](respondWithFilteredResult(_0x2385ef,_0x24b1d5))[_0x301d('0x47')](handleError(_0x2385ef,null));};exports[_0x301d('0x48')]=function(_0x5085cf,_0x46a3c7){var _0x53d704={'raw':![],'where':{'id':_0x5085cf[_0x301d('0x49')]['id']}},_0x4bfd37={};_0x4bfd37[_0x301d('0x33')]=_['keys'](db[_0x301d('0x2e')][_0x301d('0x2f')]);_0x4bfd37['query']=_['keys'](_0x5085cf[_0x301d('0x35')]);_0x4bfd37[_0x301d('0x36')]=_[_0x301d('0x37')](_0x4bfd37['model'],_0x4bfd37['query']);_0x53d704[_0x301d('0x38')]=_[_0x301d('0x37')](_0x4bfd37[_0x301d('0x33')],qs[_0x301d('0x39')](_0x5085cf[_0x301d('0x35')]['fields']));_0x53d704[_0x301d('0x38')]=_0x53d704[_0x301d('0x38')][_0x301d('0x3a')]?_0x53d704['attributes']:_0x4bfd37[_0x301d('0x33')];if(_0x5085cf[_0x301d('0x35')][_0x301d('0x43')]){_0x53d704[_0x301d('0x44')]=[{'all':!![]}];}_0x53d704=_['merge']({},_0x53d704,_0x5085cf[_0x301d('0x4a')]);return db['VoiceChanSpy'][_0x301d('0x4b')](_0x53d704)['then'](handleEntityNotFound(_0x46a3c7,null))[_0x301d('0x25')](respondWithResult(_0x46a3c7,null))[_0x301d('0x47')](handleError(_0x46a3c7,null));};exports[_0x301d('0x4c')]=function(_0x155912,_0x2ed897){return db[_0x301d('0x2e')][_0x301d('0x4c')](_0x155912[_0x301d('0x4d')],{})[_0x301d('0x25')](function(_0x588c44){var _0xe6648f=_0x155912[_0x301d('0x4e')][_0x301d('0x27')]({'plain':!![]});if(!_0xe6648f)throw new Error(_0x301d('0x4f'));if(_0xe6648f['role']===_0x301d('0x4e')){var _0x5c1d19=_0x588c44['get']({'plain':!![]});var _0x5de307=_0x301d('0x28');return db['UserProfileSection']['find']({'where':{'name':_0x5de307,'userProfileId':_0xe6648f[_0x301d('0x50')]},'raw':!![]})[_0x301d('0x25')](function(_0x291384){if(_0x291384&&_0x291384[_0x301d('0x51')]===0x0){return db[_0x301d('0x29')][_0x301d('0x4c')]({'name':_0x5c1d19[_0x301d('0x2c')],'resourceId':_0x5c1d19['id'],'type':_0x291384[_0x301d('0x2c')],'sectionId':_0x291384['id']},{})[_0x301d('0x25')](function(){return _0x588c44;});}else{return _0x588c44;}})[_0x301d('0x47')](function(_0x367ff8){logger[_0x301d('0x2a')](_0x301d('0x52'),_0x367ff8);throw _0x367ff8;});}return _0x588c44;})[_0x301d('0x25')](respondWithResult(_0x2ed897,0xc9))[_0x301d('0x47')](handleError(_0x2ed897,null));};exports[_0x301d('0x24')]=function(_0xd17e9b,_0x15da05){if(_0xd17e9b['body']['id']){delete _0xd17e9b[_0x301d('0x4d')]['id'];}return db[_0x301d('0x2e')][_0x301d('0x4b')]({'where':{'id':_0xd17e9b[_0x301d('0x49')]['id']}})[_0x301d('0x25')](handleEntityNotFound(_0x15da05,null))[_0x301d('0x25')](saveUpdates(_0xd17e9b[_0x301d('0x4d')],null))['then'](respondWithResult(_0x15da05,null))[_0x301d('0x47')](handleError(_0x15da05,null));};exports[_0x301d('0x26')]=function(_0x5308be,_0x29eafe){return db['VoiceChanSpy']['find']({'where':{'id':_0x5308be['params']['id']}})[_0x301d('0x25')](handleEntityNotFound(_0x29eafe,null))[_0x301d('0x25')](removeEntity(_0x29eafe,null))[_0x301d('0x47')](handleError(_0x29eafe,null));}; \ No newline at end of file +var _0x3164=['send','VoiceChanSpy','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','update','then','destroy','get','ChanSpies','UserProfileResource','end','error','stack','name'];(function(_0x21e4b4,_0x45e984){var _0x80845=function(_0x8aa7c5){while(--_0x8aa7c5){_0x21e4b4['push'](_0x21e4b4['shift']());}};_0x80845(++_0x45e984);}(_0x3164,0x182));var _0x4316=function(_0x2e29d9,_0x37e372){_0x2e29d9=_0x2e29d9-0x0;var _0x29cd7a=_0x3164[_0x2e29d9];return _0x29cd7a;};'use strict';var emlformat=require(_0x4316('0x0'));var rimraf=require(_0x4316('0x1'));var zipdir=require(_0x4316('0x2'));var jsonpatch=require(_0x4316('0x3'));var rp=require(_0x4316('0x4'));var moment=require('moment');var BPromise=require(_0x4316('0x5'));var Mustache=require(_0x4316('0x6'));var util=require(_0x4316('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x4316('0x8'));var ejs=require(_0x4316('0x9'));var fs=require('fs');var fs_extra=require(_0x4316('0xa'));var _=require(_0x4316('0xb'));var squel=require(_0x4316('0xc'));var crypto=require(_0x4316('0xd'));var jsforce=require(_0x4316('0xe'));var deskjs=require(_0x4316('0xf'));var toCsv=require(_0x4316('0x8'));var querystring=require(_0x4316('0x10'));var Papa=require(_0x4316('0x11'));var Redis=require(_0x4316('0x12'));var authService=require(_0x4316('0x13'));var qs=require(_0x4316('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4316('0x15'));var logger=require(_0x4316('0x16'))(_0x4316('0x17'));var utils=require(_0x4316('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x4316('0x19'));var db=require(_0x4316('0x1a'))['db'];function respondWithStatusCode(_0x1e8f1a,_0x2a1f2c){_0x2a1f2c=_0x2a1f2c||0xcc;return function(_0x5cf490){if(_0x5cf490){return _0x1e8f1a[_0x4316('0x1b')](_0x2a1f2c);}return _0x1e8f1a['status'](_0x2a1f2c)['end']();};}function respondWithResult(_0x524c3c,_0x266777){_0x266777=_0x266777||0xc8;return function(_0x3bb6cf){if(_0x3bb6cf){return _0x524c3c['status'](_0x266777)[_0x4316('0x1c')](_0x3bb6cf);}};}function respondWithFilteredResult(_0x486a64,_0x133121){return function(_0x3e9ab8){if(_0x3e9ab8){var _0x211d87=typeof _0x133121[_0x4316('0x1d')]===_0x4316('0x1e')&&typeof _0x133121[_0x4316('0x1f')]===_0x4316('0x1e');var _0x38e68c=_0x3e9ab8[_0x4316('0x20')];var _0x3bf044=_0x211d87?0x0:_0x133121['offset'];var _0x43069f=_0x211d87?_0x3e9ab8[_0x4316('0x20')]:_0x133121['offset']+_0x133121['limit'];var _0x40f660;if(_0x43069f>=_0x38e68c){_0x43069f=_0x38e68c;_0x40f660=0xc8;}else{_0x40f660=0xce;}_0x486a64[_0x4316('0x21')](_0x40f660);return _0x486a64[_0x4316('0x22')](_0x4316('0x23'),_0x3bf044+'-'+_0x43069f+'/'+_0x38e68c)[_0x4316('0x1c')](_0x3e9ab8);}return null;};}function patchUpdates(_0x5865a3){return function(_0x888097){try{jsonpatch[_0x4316('0x24')](_0x888097,_0x5865a3,!![]);}catch(_0x599c48){return BPromise[_0x4316('0x25')](_0x599c48);}return _0x888097[_0x4316('0x26')]();};}function saveUpdates(_0x38195f,_0x494f82){return function(_0x1736d0){if(_0x1736d0){return _0x1736d0[_0x4316('0x27')](_0x38195f)[_0x4316('0x28')](function(_0x4f42aa){return _0x4f42aa;});}return null;};}function removeEntity(_0x3b994a,_0x3388ae){return function(_0x37043c){if(_0x37043c){return _0x37043c[_0x4316('0x29')]()[_0x4316('0x28')](function(){var _0x270688=_0x37043c[_0x4316('0x2a')]({'plain':!![]});var _0x46bd61=_0x4316('0x2b');return db[_0x4316('0x2c')][_0x4316('0x29')]({'where':{'type':_0x46bd61,'resourceId':_0x270688['id']}})[_0x4316('0x28')](function(){return _0x37043c;});})[_0x4316('0x28')](function(){_0x3b994a[_0x4316('0x21')](0xcc)[_0x4316('0x2d')]();});}};}function handleEntityNotFound(_0x31cd5f,_0x28e2a2){return function(_0x4cdb10){if(!_0x4cdb10){_0x31cd5f['sendStatus'](0x194);}return _0x4cdb10;};}function handleError(_0x83a6b,_0x46b619){_0x46b619=_0x46b619||0x1f4;return function(_0xa8dd01){logger[_0x4316('0x2e')](_0xa8dd01[_0x4316('0x2f')]);if(_0xa8dd01['name']){delete _0xa8dd01[_0x4316('0x30')];}_0x83a6b['status'](_0x46b619)[_0x4316('0x31')](_0xa8dd01);};}exports['index']=function(_0x46df48,_0x50e099){var _0x205e3e={},_0x26218d={},_0x4f88a2={'count':0x0,'rows':[]};var _0x22eedf=_['map'](db[_0x4316('0x32')][_0x4316('0x33')],function(_0x2d7e64){return{'name':_0x2d7e64[_0x4316('0x34')],'type':_0x2d7e64[_0x4316('0x35')][_0x4316('0x36')]};});_0x26218d[_0x4316('0x37')]=_[_0x4316('0x38')](_0x22eedf,'name');_0x26218d[_0x4316('0x39')]=_[_0x4316('0x3a')](_0x46df48['query']);_0x26218d['filters']=_[_0x4316('0x3b')](_0x26218d[_0x4316('0x37')],_0x26218d[_0x4316('0x39')]);_0x205e3e[_0x4316('0x3c')]=_[_0x4316('0x3b')](_0x26218d['model'],qs[_0x4316('0x3d')](_0x46df48[_0x4316('0x39')][_0x4316('0x3d')]));_0x205e3e[_0x4316('0x3c')]=_0x205e3e[_0x4316('0x3c')][_0x4316('0x3e')]?_0x205e3e['attributes']:_0x26218d[_0x4316('0x37')];if(!_0x46df48['query'][_0x4316('0x3f')]('nolimit')){_0x205e3e[_0x4316('0x1f')]=qs[_0x4316('0x1f')](_0x46df48[_0x4316('0x39')][_0x4316('0x1f')]);_0x205e3e['offset']=qs[_0x4316('0x1d')](_0x46df48[_0x4316('0x39')]['offset']);}_0x205e3e[_0x4316('0x40')]=qs[_0x4316('0x41')](_0x46df48[_0x4316('0x39')]['sort']);_0x205e3e[_0x4316('0x42')]=qs[_0x4316('0x43')](_[_0x4316('0x44')](_0x46df48[_0x4316('0x39')],_0x26218d[_0x4316('0x43')]),_0x22eedf);if(_0x46df48[_0x4316('0x39')][_0x4316('0x45')]){_0x205e3e[_0x4316('0x42')]=_[_0x4316('0x46')](_0x205e3e[_0x4316('0x42')],{'$or':_[_0x4316('0x38')](_0x22eedf,function(_0x2fa6f6){if(_0x2fa6f6[_0x4316('0x35')]!==_0x4316('0x47')){var _0x26817b={};_0x26817b[_0x2fa6f6[_0x4316('0x30')]]={'$like':'%'+_0x46df48[_0x4316('0x39')][_0x4316('0x45')]+'%'};return _0x26817b;}})});}_0x205e3e=_[_0x4316('0x46')]({},_0x205e3e,_0x46df48[_0x4316('0x48')]);var _0x568adf={'where':_0x205e3e[_0x4316('0x42')]};return db['VoiceChanSpy']['count'](_0x568adf)[_0x4316('0x28')](function(_0xf98933){_0x4f88a2[_0x4316('0x20')]=_0xf98933;if(_0x46df48['query'][_0x4316('0x49')]){_0x205e3e[_0x4316('0x4a')]=[{'all':!![]}];}return db['VoiceChanSpy'][_0x4316('0x4b')](_0x205e3e);})['then'](function(_0x410532){_0x4f88a2[_0x4316('0x4c')]=_0x410532;return _0x4f88a2;})[_0x4316('0x28')](respondWithFilteredResult(_0x50e099,_0x205e3e))[_0x4316('0x4d')](handleError(_0x50e099,null));};exports['show']=function(_0x1f1eaf,_0x30e03a){var _0x26b7e3={'raw':![],'where':{'id':_0x1f1eaf['params']['id']}},_0xce3f27={};_0xce3f27[_0x4316('0x37')]=_[_0x4316('0x3a')](db[_0x4316('0x32')][_0x4316('0x33')]);_0xce3f27['query']=_['keys'](_0x1f1eaf['query']);_0xce3f27[_0x4316('0x43')]=_[_0x4316('0x3b')](_0xce3f27['model'],_0xce3f27[_0x4316('0x39')]);_0x26b7e3[_0x4316('0x3c')]=_[_0x4316('0x3b')](_0xce3f27['model'],qs['fields'](_0x1f1eaf[_0x4316('0x39')][_0x4316('0x3d')]));_0x26b7e3['attributes']=_0x26b7e3['attributes']['length']?_0x26b7e3[_0x4316('0x3c')]:_0xce3f27[_0x4316('0x37')];if(_0x1f1eaf[_0x4316('0x39')][_0x4316('0x49')]){_0x26b7e3[_0x4316('0x4a')]=[{'all':!![]}];}_0x26b7e3=_[_0x4316('0x46')]({},_0x26b7e3,_0x1f1eaf['options']);return db[_0x4316('0x32')][_0x4316('0x4e')](_0x26b7e3)[_0x4316('0x28')](handleEntityNotFound(_0x30e03a,null))['then'](respondWithResult(_0x30e03a,null))[_0x4316('0x4d')](handleError(_0x30e03a,null));};exports[_0x4316('0x4f')]=function(_0x3ceb88,_0x5e6155){return db[_0x4316('0x32')][_0x4316('0x4f')](_0x3ceb88[_0x4316('0x50')],{})[_0x4316('0x28')](function(_0x3fb8ae){var _0x4d2011=_0x3ceb88['user'][_0x4316('0x2a')]({'plain':!![]});if(!_0x4d2011)throw new Error(_0x4316('0x51'));if(_0x4d2011[_0x4316('0x52')]===_0x4316('0x53')){var _0x56d541=_0x3fb8ae[_0x4316('0x2a')]({'plain':!![]});var _0x4e4cbe='ChanSpies';return db['UserProfileSection'][_0x4316('0x4e')]({'where':{'name':_0x4e4cbe,'userProfileId':_0x4d2011['userProfileId']},'raw':!![]})[_0x4316('0x28')](function(_0x1df4d6){if(_0x1df4d6&&_0x1df4d6[_0x4316('0x54')]===0x0){return db[_0x4316('0x2c')][_0x4316('0x4f')]({'name':_0x56d541[_0x4316('0x30')],'resourceId':_0x56d541['id'],'type':_0x1df4d6[_0x4316('0x30')],'sectionId':_0x1df4d6['id']},{})[_0x4316('0x28')](function(){return _0x3fb8ae;});}else{return _0x3fb8ae;}})[_0x4316('0x4d')](function(_0x427351){logger['error'](_0x4316('0x55'),_0x427351);throw _0x427351;});}return _0x3fb8ae;})['then'](respondWithResult(_0x5e6155,0xc9))[_0x4316('0x4d')](handleError(_0x5e6155,null));};exports[_0x4316('0x27')]=function(_0x2b35de,_0x47242){if(_0x2b35de[_0x4316('0x50')]['id']){delete _0x2b35de[_0x4316('0x50')]['id'];}return db['VoiceChanSpy'][_0x4316('0x4e')]({'where':{'id':_0x2b35de[_0x4316('0x56')]['id']}})[_0x4316('0x28')](handleEntityNotFound(_0x47242,null))['then'](saveUpdates(_0x2b35de['body'],null))[_0x4316('0x28')](respondWithResult(_0x47242,null))[_0x4316('0x4d')](handleError(_0x47242,null));};exports['destroy']=function(_0x5e80e2,_0x4a3767){return db[_0x4316('0x32')][_0x4316('0x4e')]({'where':{'id':_0x5e80e2[_0x4316('0x56')]['id']}})[_0x4316('0x28')](handleEntityNotFound(_0x4a3767,null))[_0x4316('0x28')](removeEntity(_0x4a3767,null))[_0x4316('0x4d')](handleError(_0x4a3767,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index 44ddf1f..0bbbf45 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 _0x5e96=['join','length','concat','internal','findAll','then','catch','exports','models','define','VoiceChanSpy','voice_chanspy','VoiceExtension','bulkCreate','destroy','lodash','util','context','format','%s%s','prefix','system','push','Set','CDR(type)=%s','chanspy','record','merge','${UNIQUEID}.%s,a','recordingFormat','auth','Authenticate','password','ChanSpy','SIP/%s,%s','name','options'];(function(_0x1ac120,_0x3e7e45){var _0x19b703=function(_0x5f32cb){while(--_0x5f32cb){_0x1ac120['push'](_0x1ac120['shift']());}};_0x19b703(++_0x3e7e45);}(_0x5e96,0xa3));var _0x65e9=function(_0x2f630f,_0x2b20ae){_0x2f630f=_0x2f630f-0x0;var _0xfc1fa4=_0x5e96[_0x2f630f];return _0xfc1fa4;};'use strict';var _=require(_0x65e9('0x0'));var util=require(_0x65e9('0x1'));var BPromise=require('bluebird');var attributes=require('./voiceChanSpy.attributes');var getUserApplications=function(_0x25bd7a,_0x14d15c,_0x1a839e){var _0x1fc770=0x1;var _0x32ec4a=[];var _0x192813={'context':_0x14d15c[_0x65e9('0x2')]||'from-sip','exten':util[_0x65e9('0x3')](_0x65e9('0x4'),_0x25bd7a[_0x65e9('0x5')],_0x1a839e),'type':_0x65e9('0x6'),'isApp':![],'ChanSpyId':_0x25bd7a['id'],'UserId':_0x14d15c['id']};_0x32ec4a[_0x65e9('0x7')](_['merge']({'app':_0x65e9('0x8'),'appdata':util[_0x65e9('0x3')](_0x65e9('0x9'),_0x65e9('0xa')),'priority':_0x1fc770++},_0x192813));if(_0x25bd7a[_0x65e9('0xb')]){_0x32ec4a[_0x65e9('0x7')](_[_0x65e9('0xc')]({'app':'MixMonitor','appdata':util[_0x65e9('0x3')](_0x65e9('0xd'),_0x25bd7a[_0x65e9('0xe')]),'priority':_0x1fc770++},_0x192813));}if(_0x25bd7a[_0x65e9('0xf')]){_0x32ec4a[_0x65e9('0x7')](_['merge']({'app':_0x65e9('0x10'),'appdata':_0x25bd7a[_0x65e9('0x11')],'priority':_0x1fc770++},_0x192813));}_0x32ec4a[_0x65e9('0x7')](_['merge']({'app':_0x65e9('0x12'),'appdata':util[_0x65e9('0x3')](_0x65e9('0x13'),_0x14d15c[_0x65e9('0x14')],_0x25bd7a[_0x65e9('0x15')]?_0x25bd7a[_0x65e9('0x15')][_0x65e9('0x16')](''):''),'priority':_0x1fc770++},_0x192813));if(_0x25bd7a[_0x65e9('0xb')]){_0x32ec4a[_0x65e9('0x7')](_['merge']({'app':'StopMixMonitor','priority':_0x1fc770++},_0x192813));}return _0x32ec4a;};var getChanSpyApplications=function(_0xf14247,_0x16e5c7){var _0x1844f6=[];for(var _0x50b2d6=0x0,_0x1e53af=0x1;_0x50b2d6<_0x16e5c7[_0x65e9('0x17')];_0x50b2d6++,_0x1e53af=0x1){_0x1844f6=_0x1844f6[_0x65e9('0x18')](getUserApplications(_0xf14247,_0x16e5c7[_0x50b2d6],_0x16e5c7[_0x50b2d6][_0x65e9('0x19')]));if(_0x16e5c7[_0x50b2d6][_0x65e9('0x19')]!=_0x16e5c7[_0x50b2d6]['name']){_0x1844f6=_0x1844f6[_0x65e9('0x18')](getUserApplications(_0xf14247,_0x16e5c7[_0x50b2d6],_0x16e5c7[_0x50b2d6]['name']));}}return _0x1844f6;};var getChanSpyPromise=function(_0x1869f4,_0x51ff2b){return new BPromise(function(_0x4e91c4,_0x32070c){return _0x1869f4['User'][_0x65e9('0x1a')]({'attributes':['id',_0x65e9('0x14'),_0x65e9('0x19')],'where':{'role':'agent','chanspy':!![]},'raw':!![]})[_0x65e9('0x1b')](function(_0x2685e8){if(_0x2685e8){return _0x4e91c4(getChanSpyApplications(_0x51ff2b,_0x2685e8));}return _0x4e91c4([]);})[_0x65e9('0x1c')](function(_0x16b645){_0x32070c(_0x16b645);});});};module[_0x65e9('0x1d')]=function(_0x14c3bb,_0x26c619){var _0x3e4911=_0x14c3bb[_0x65e9('0x1e')];return _0x14c3bb[_0x65e9('0x1f')](_0x65e9('0x20'),attributes,{'tableName':_0x65e9('0x21'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x4560ff,_0x30e567,_0x2971c1){return getChanSpyPromise(_0x3e4911,_0x4560ff)[_0x65e9('0x1b')](function(_0x32df78){if(_0x32df78&&_0x32df78[_0x65e9('0x17')]){return _0x3e4911[_0x65e9('0x22')][_0x65e9('0x23')](_0x32df78);}})['then'](function(){_0x2971c1();})[_0x65e9('0x1c')](function(_0x2edfce){_0x2971c1(_0x2edfce);});},'afterUpdate':function(_0x3e9923,_0x1f5a24,_0x6f03f3){return _0x3e4911['VoiceExtension'][_0x65e9('0x24')]({'where':{'ChanSpyId':_0x3e9923['id']}})[_0x65e9('0x1b')](function(){return getChanSpyPromise(_0x3e4911,_0x3e9923);})['then'](function(_0x5470f0){if(_0x5470f0&&_0x5470f0[_0x65e9('0x17')]){return _0x3e4911[_0x65e9('0x22')][_0x65e9('0x23')](_0x5470f0);}})[_0x65e9('0x1b')](function(){_0x6f03f3();})['catch'](function(_0x26ee7c){_0x6f03f3(_0x26ee7c);});},'afterDestroy':function(_0x23bced,_0x19050b,_0x1a55f1){return _0x3e4911['VoiceExtension'][_0x65e9('0x24')]({'where':{'ChanSpyId':_0x23bced['id']}})['then'](function(){_0x1a55f1();})[_0x65e9('0x1c')](function(_0x295c30){_0x1a55f1(_0x295c30);});}}});}; \ No newline at end of file +var _0x9dd3=['from-sip','%s%s','prefix','push','merge','Set','format','record','MixMonitor','${UNIQUEID}.%s,a','recordingFormat','auth','Authenticate','ChanSpy','SIP/%s,%s','name','options','join','StopMixMonitor','length','concat','internal','User','findAll','agent','then','exports','models','define','VoiceExtension','catch','destroy','lodash','util','bluebird','./voiceChanSpy.attributes'];(function(_0x50d84b,_0x1d7ea7){var _0x6d4270=function(_0x883f21){while(--_0x883f21){_0x50d84b['push'](_0x50d84b['shift']());}};_0x6d4270(++_0x1d7ea7);}(_0x9dd3,0x11c));var _0x39dd=function(_0x18d9b7,_0x53f09e){_0x18d9b7=_0x18d9b7-0x0;var _0x3354a6=_0x9dd3[_0x18d9b7];return _0x3354a6;};'use strict';var _=require(_0x39dd('0x0'));var util=require(_0x39dd('0x1'));var BPromise=require(_0x39dd('0x2'));var attributes=require(_0x39dd('0x3'));var getUserApplications=function(_0x5b29b4,_0x4c54c4,_0x198c1e){var _0x339513=0x1;var _0x19b119=[];var _0x452f30={'context':_0x4c54c4['context']||_0x39dd('0x4'),'exten':util['format'](_0x39dd('0x5'),_0x5b29b4[_0x39dd('0x6')],_0x198c1e),'type':'system','isApp':![],'ChanSpyId':_0x5b29b4['id'],'UserId':_0x4c54c4['id']};_0x19b119[_0x39dd('0x7')](_[_0x39dd('0x8')]({'app':_0x39dd('0x9'),'appdata':util[_0x39dd('0xa')]('CDR(type)=%s','chanspy'),'priority':_0x339513++},_0x452f30));if(_0x5b29b4[_0x39dd('0xb')]){_0x19b119[_0x39dd('0x7')](_[_0x39dd('0x8')]({'app':_0x39dd('0xc'),'appdata':util[_0x39dd('0xa')](_0x39dd('0xd'),_0x5b29b4[_0x39dd('0xe')]),'priority':_0x339513++},_0x452f30));}if(_0x5b29b4[_0x39dd('0xf')]){_0x19b119['push'](_['merge']({'app':_0x39dd('0x10'),'appdata':_0x5b29b4['password'],'priority':_0x339513++},_0x452f30));}_0x19b119['push'](_[_0x39dd('0x8')]({'app':_0x39dd('0x11'),'appdata':util[_0x39dd('0xa')](_0x39dd('0x12'),_0x4c54c4[_0x39dd('0x13')],_0x5b29b4['options']?_0x5b29b4[_0x39dd('0x14')][_0x39dd('0x15')](''):''),'priority':_0x339513++},_0x452f30));if(_0x5b29b4['record']){_0x19b119[_0x39dd('0x7')](_['merge']({'app':_0x39dd('0x16'),'priority':_0x339513++},_0x452f30));}return _0x19b119;};var getChanSpyApplications=function(_0x2fd5cd,_0x382582){var _0x400358=[];for(var _0x4ffc01=0x0,_0xb9def1=0x1;_0x4ffc01<_0x382582[_0x39dd('0x17')];_0x4ffc01++,_0xb9def1=0x1){_0x400358=_0x400358[_0x39dd('0x18')](getUserApplications(_0x2fd5cd,_0x382582[_0x4ffc01],_0x382582[_0x4ffc01][_0x39dd('0x19')]));if(_0x382582[_0x4ffc01]['internal']!=_0x382582[_0x4ffc01]['name']){_0x400358=_0x400358[_0x39dd('0x18')](getUserApplications(_0x2fd5cd,_0x382582[_0x4ffc01],_0x382582[_0x4ffc01]['name']));}}return _0x400358;};var getChanSpyPromise=function(_0x264b2d,_0x425ccf){return new BPromise(function(_0x3d90e8,_0xf174d){return _0x264b2d[_0x39dd('0x1a')][_0x39dd('0x1b')]({'attributes':['id',_0x39dd('0x13'),_0x39dd('0x19')],'where':{'role':_0x39dd('0x1c'),'chanspy':!![]},'raw':!![]})[_0x39dd('0x1d')](function(_0x1e4df7){if(_0x1e4df7){return _0x3d90e8(getChanSpyApplications(_0x425ccf,_0x1e4df7));}return _0x3d90e8([]);})['catch'](function(_0x3e409d){_0xf174d(_0x3e409d);});});};module[_0x39dd('0x1e')]=function(_0x2be8fd,_0x55e26f){var _0x1d3d95=_0x2be8fd[_0x39dd('0x1f')];return _0x2be8fd[_0x39dd('0x20')]('VoiceChanSpy',attributes,{'tableName':'voice_chanspy','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x55a8bd,_0x4682d4,_0x5e258e){return getChanSpyPromise(_0x1d3d95,_0x55a8bd)[_0x39dd('0x1d')](function(_0x5b065b){if(_0x5b065b&&_0x5b065b['length']){return _0x1d3d95[_0x39dd('0x21')]['bulkCreate'](_0x5b065b);}})['then'](function(){_0x5e258e();})[_0x39dd('0x22')](function(_0x1734b6){_0x5e258e(_0x1734b6);});},'afterUpdate':function(_0x233551,_0x11cde6,_0xd590e7){return _0x1d3d95[_0x39dd('0x21')][_0x39dd('0x23')]({'where':{'ChanSpyId':_0x233551['id']}})[_0x39dd('0x1d')](function(){return getChanSpyPromise(_0x1d3d95,_0x233551);})[_0x39dd('0x1d')](function(_0x2f5b93){if(_0x2f5b93&&_0x2f5b93[_0x39dd('0x17')]){return _0x1d3d95[_0x39dd('0x21')]['bulkCreate'](_0x2f5b93);}})[_0x39dd('0x1d')](function(){_0xd590e7();})[_0x39dd('0x22')](function(_0x2e15b9){_0xd590e7(_0x2e15b9);});},'afterDestroy':function(_0x5b7946,_0x75cb6b,_0x852f4d){return _0x1d3d95['VoiceExtension'][_0x39dd('0x23')]({'where':{'ChanSpyId':_0x5b7946['id']}})[_0x39dd('0x1d')](function(){_0x852f4d();})[_0x39dd('0x22')](function(_0x1fb7cf){_0x852f4d(_0x1fb7cf);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index 6889975..1b7a7e8 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 _0xac55=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','VoiceChanSpy,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','bluebird'];(function(_0x3386fd,_0x8596f4){var _0x19e6f6=function(_0x4bd4ec){while(--_0x4bd4ec){_0x3386fd['push'](_0x3386fd['shift']());}};_0x19e6f6(++_0x8596f4);}(_0xac55,0x1c8));var _0x5ac5=function(_0x232ebb,_0x48e724){_0x232ebb=_0x232ebb-0x0;var _0x12b8d6=_0xac55[_0x232ebb];return _0x12b8d6;};'use strict';var _=require(_0x5ac5('0x0'));var util=require(_0x5ac5('0x1'));var moment=require(_0x5ac5('0x2'));var BPromise=require(_0x5ac5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5ac5('0x4'));var db=require(_0x5ac5('0x5'))['db'];var utils=require(_0x5ac5('0x6'));var logger=require(_0x5ac5('0x7'))(_0x5ac5('0x8'));var config=require(_0x5ac5('0x9'));var jayson=require(_0x5ac5('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x34093b,_0x247752,_0x2bee03){return new BPromise(function(_0x42551a,_0x455a94){return client[_0x5ac5('0xb')](_0x34093b,_0x2bee03)[_0x5ac5('0xc')](function(_0x5b84a3){logger['info'](_0x5ac5('0xd'),_0x247752,_0x5ac5('0xe'));logger['debug'](_0x5ac5('0xf'),_0x247752,_0x5ac5('0xe'),JSON['stringify'](_0x5b84a3));if(_0x5b84a3[_0x5ac5('0x10')]){if(_0x5b84a3[_0x5ac5('0x10')]['code']===0x1f4){logger[_0x5ac5('0x10')](_0x5ac5('0xd'),_0x247752,_0x5b84a3[_0x5ac5('0x10')][_0x5ac5('0x11')]);return _0x455a94(_0x5b84a3[_0x5ac5('0x10')]['message']);}logger[_0x5ac5('0x10')]('VoiceChanSpy,\x20%s,\x20%s',_0x247752,_0x5b84a3[_0x5ac5('0x10')][_0x5ac5('0x11')]);return _0x42551a(_0x5b84a3['error'][_0x5ac5('0x11')]);}else{logger['info'](_0x5ac5('0xd'),_0x247752,_0x5ac5('0xe'));_0x42551a(_0x5b84a3[_0x5ac5('0x12')][_0x5ac5('0x11')]);}})[_0x5ac5('0x13')](function(_0x3e35e9){logger[_0x5ac5('0x10')]('VoiceChanSpy,\x20%s,\x20%s',_0x247752,_0x3e35e9);_0x455a94(_0x3e35e9);});});} \ No newline at end of file +var _0xe28e=['../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','stringify','error','code','VoiceChanSpy,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x27062d,_0x24b179){var _0x4f1478=function(_0x3b4489){while(--_0x3b4489){_0x27062d['push'](_0x27062d['shift']());}};_0x4f1478(++_0x24b179);}(_0xe28e,0x1ba));var _0xee28=function(_0x4b7f61,_0x32bfd8){_0x4b7f61=_0x4b7f61-0x0;var _0x3d43fe=_0xe28e[_0x4b7f61];return _0x3d43fe;};'use strict';var _=require(_0xee28('0x0'));var util=require(_0xee28('0x1'));var moment=require(_0xee28('0x2'));var BPromise=require(_0xee28('0x3'));var rs=require(_0xee28('0x4'));var fs=require('fs');var Redis=require(_0xee28('0x5'));var db=require(_0xee28('0x6'))['db'];var utils=require(_0xee28('0x7'));var logger=require(_0xee28('0x8'))(_0xee28('0x9'));var config=require(_0xee28('0xa'));var jayson=require(_0xee28('0xb'));var client=jayson[_0xee28('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x39b337,_0x30224a,_0x3f9bd9){return new BPromise(function(_0x66d0b6,_0x156aad){return client[_0xee28('0xd')](_0x39b337,_0x3f9bd9)[_0xee28('0xe')](function(_0x5d7562){logger['info']('VoiceChanSpy,\x20%s,\x20%s',_0x30224a,_0xee28('0xf'));logger[_0xee28('0x10')]('VoiceChanSpy,\x20%s,\x20%s,\x20%s',_0x30224a,_0xee28('0xf'),JSON[_0xee28('0x11')](_0x5d7562));if(_0x5d7562['error']){if(_0x5d7562[_0xee28('0x12')][_0xee28('0x13')]===0x1f4){logger[_0xee28('0x12')](_0xee28('0x14'),_0x30224a,_0x5d7562[_0xee28('0x12')][_0xee28('0x15')]);return _0x156aad(_0x5d7562[_0xee28('0x12')]['message']);}logger[_0xee28('0x12')](_0xee28('0x14'),_0x30224a,_0x5d7562[_0xee28('0x12')][_0xee28('0x15')]);return _0x66d0b6(_0x5d7562[_0xee28('0x12')]['message']);}else{logger[_0xee28('0x16')](_0xee28('0x14'),_0x30224a,_0xee28('0xf'));_0x66d0b6(_0x5d7562[_0xee28('0x17')][_0xee28('0x15')]);}})[_0xee28('0x18')](function(_0x4c0eb9){logger[_0xee28('0x12')]('VoiceChanSpy,\x20%s,\x20%s',_0x30224a,_0x4c0eb9);_0x156aad(_0x4c0eb9);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index 4f31197..057ef25 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 _0x39db=['get','isAuthenticated','index','show','post','put','/:id','update','destroy','exports','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceContext.controller'];(function(_0x55e08b,_0x421620){var _0xd1a7ff=function(_0x58c7ff){while(--_0x58c7ff){_0x55e08b['push'](_0x55e08b['shift']());}};_0xd1a7ff(++_0x421620);}(_0x39db,0x88));var _0xb39d=function(_0x5149c7,_0xfd2f67){_0x5149c7=_0x5149c7-0x0;var _0x5010b0=_0x39db[_0x5149c7];return _0x5010b0;};'use strict';var multer=require(_0xb39d('0x0'));var util=require(_0xb39d('0x1'));var path=require('path');var timeout=require(_0xb39d('0x2'));var express=require(_0xb39d('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xb39d('0x4'));var interaction=require(_0xb39d('0x5'));var config=require(_0xb39d('0x6'));var controller=require(_0xb39d('0x7'));router[_0xb39d('0x8')]('/',auth[_0xb39d('0x9')](),controller[_0xb39d('0xa')]);router[_0xb39d('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xb39d('0xb')]);router[_0xb39d('0xc')]('/',auth[_0xb39d('0x9')](),controller['create']);router[_0xb39d('0xd')](_0xb39d('0xe'),auth[_0xb39d('0x9')](),controller[_0xb39d('0xf')]);router['delete'](_0xb39d('0xe'),auth[_0xb39d('0x9')](),controller[_0xb39d('0x10')]);module[_0xb39d('0x11')]=router; \ No newline at end of file +var _0x7a90=['./voiceContext.controller','isAuthenticated','show','post','create','put','/:id','update','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment'];(function(_0x1488cd,_0x25a893){var _0x63fa13=function(_0x57dd1c){while(--_0x57dd1c){_0x1488cd['push'](_0x1488cd['shift']());}};_0x63fa13(++_0x25a893);}(_0x7a90,0x16e));var _0x07a9=function(_0x18dae8,_0x4334d7){_0x18dae8=_0x18dae8-0x0;var _0x570782=_0x7a90[_0x18dae8];return _0x570782;};'use strict';var multer=require(_0x07a9('0x0'));var util=require(_0x07a9('0x1'));var path=require(_0x07a9('0x2'));var timeout=require(_0x07a9('0x3'));var express=require(_0x07a9('0x4'));var router=express[_0x07a9('0x5')]();var fs_extra=require(_0x07a9('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x07a9('0x7'));var controller=require(_0x07a9('0x8'));router['get']('/',auth[_0x07a9('0x9')](),controller['index']);router['get']('/:id',auth[_0x07a9('0x9')](),controller[_0x07a9('0xa')]);router[_0x07a9('0xb')]('/',auth[_0x07a9('0x9')](),controller[_0x07a9('0xc')]);router[_0x07a9('0xd')](_0x07a9('0xe'),auth['isAuthenticated'](),controller[_0x07a9('0xf')]);router['delete'](_0x07a9('0xe'),auth[_0x07a9('0x9')](),controller['destroy']);module[_0x07a9('0x10')]=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index 7ee88e7..aa73f5e 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 _0xf109=['exports','STRING','sequelize'];(function(_0x3c97e3,_0x321677){var _0x9bb0ed=function(_0x3a0cb6){while(--_0x3a0cb6){_0x3c97e3['push'](_0x3c97e3['shift']());}};_0x9bb0ed(++_0x321677);}(_0xf109,0xce));var _0x9f10=function(_0x35da42,_0x5c2610){_0x35da42=_0x35da42-0x0;var _0x370035=_0xf109[_0x35da42];return _0x370035;};'use strict';var Sequelize=require(_0x9f10('0x0'));module[_0x9f10('0x1')]={'name':{'type':Sequelize[_0x9f10('0x2')],'unique':'name'},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}}; \ No newline at end of file +var _0x665a=['exports','STRING','name','BOOLEAN'];(function(_0x316e2b,_0x40efd7){var _0x2e4809=function(_0x145130){while(--_0x145130){_0x316e2b['push'](_0x316e2b['shift']());}};_0x2e4809(++_0x40efd7);}(_0x665a,0x168));var _0xa665=function(_0x2e78fd,_0x474e23){_0x2e78fd=_0x2e78fd-0x0;var _0x1f2d6a=_0x665a[_0x2e78fd];return _0x1f2d6a;};'use strict';var Sequelize=require('sequelize');module[_0xa665('0x0')]={'name':{'type':Sequelize[_0xa665('0x1')],'unique':_0xa665('0x2')},'description':{'type':Sequelize[_0xa665('0x1')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0xa665('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 459dc64..0d06f0b 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 _0x86eb=['Contexts','UserProfileResource','end','stack','name','send','index','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','attributes','model','fields','length','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','findAll','rows','show','params','VoiceContext','include','find','create','readFileSync','join','root','server/files/templates/context.ejs','utf8','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','crypto','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','jayson/promise','client','http','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','get'];(function(_0x65d13d,_0x49e929){var _0x309bb3=function(_0x2d7f73){while(--_0x2d7f73){_0x65d13d['push'](_0x65d13d['shift']());}};_0x309bb3(++_0x49e929);}(_0x86eb,0x16b));var _0xb86e=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x86eb[_0x122ef9];return _0x42fba0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb86e('0x0'));var zipdir=require(_0xb86e('0x1'));var jsonpatch=require(_0xb86e('0x2'));var rp=require('request-promise');var moment=require(_0xb86e('0x3'));var BPromise=require(_0xb86e('0x4'));var Mustache=require(_0xb86e('0x5'));var util=require(_0xb86e('0x6'));var path=require(_0xb86e('0x7'));var sox=require(_0xb86e('0x8'));var csv=require('to-csv');var ejs=require(_0xb86e('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require(_0xb86e('0xa'));var jsforce=require(_0xb86e('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xb86e('0xc'));var querystring=require('querystring');var Papa=require(_0xb86e('0xd'));var Redis=require(_0xb86e('0xe'));var authService=require(_0xb86e('0xf'));var qs=require(_0xb86e('0x10'));var as=require(_0xb86e('0x11'));var hardwareService=require(_0xb86e('0x12'));var logger=require(_0xb86e('0x13'))(_0xb86e('0x14'));var utils=require(_0xb86e('0x15'));var config=require(_0xb86e('0x16'));var licenseUtil=require(_0xb86e('0x17'));var db=require(_0xb86e('0x18'))['db'];var jayson=require(_0xb86e('0x19'));var client=jayson[_0xb86e('0x1a')][_0xb86e('0x1b')]({'port':0x232a});function respondWithRpcPromise(_0xbf848f,_0x16a842,_0x47772c,_0x486dad){return new BPromise(function(_0x4df60d,_0x4264cb){var _0x346cae=_0x486dad||client;return _0x346cae['request'](_0xbf848f,_0x47772c)[_0xb86e('0x1c')](function(_0x3bc3ba){logger[_0xb86e('0x1d')](_0xb86e('0x1e'),_0x16a842,_0xb86e('0x1f'));logger[_0xb86e('0x20')](_0xb86e('0x21'),_0x16a842,_0xb86e('0x1f'),JSON['stringify'](_0x3bc3ba));if(_0x3bc3ba[_0xb86e('0x22')]){if(_0x3bc3ba[_0xb86e('0x22')][_0xb86e('0x23')]===0x1f4){logger['error'](_0xb86e('0x1e'),_0x16a842,_0x3bc3ba[_0xb86e('0x22')][_0xb86e('0x24')]);return _0x4264cb(_0x3bc3ba[_0xb86e('0x22')][_0xb86e('0x24')]);}logger[_0xb86e('0x22')]('VoiceContext,\x20%s,\x20%s',_0x16a842,_0x3bc3ba[_0xb86e('0x22')]['message']);return _0x4df60d(_0x3bc3ba[_0xb86e('0x22')][_0xb86e('0x24')]);}else{logger[_0xb86e('0x1d')]('VoiceContext,\x20%s,\x20%s',_0x16a842,_0xb86e('0x1f'));_0x4df60d(_0x3bc3ba[_0xb86e('0x25')]['message']);}})[_0xb86e('0x26')](function(_0x1648e2){logger['error']('VoiceContext,\x20%s,\x20%s',_0x16a842,_0x1648e2);_0x4264cb(_0x1648e2);});});}function respondWithStatusCode(_0x49ad01,_0x53de97){_0x53de97=_0x53de97||0xcc;return function(_0x324789){if(_0x324789){return _0x49ad01[_0xb86e('0x27')](_0x53de97);}return _0x49ad01[_0xb86e('0x28')](_0x53de97)['end']();};}function respondWithResult(_0x1ec92f,_0x194286){_0x194286=_0x194286||0xc8;return function(_0x535f2c){if(_0x535f2c){return _0x1ec92f[_0xb86e('0x28')](_0x194286)[_0xb86e('0x29')](_0x535f2c);}};}function respondWithFilteredResult(_0x5bc058,_0x33a389){return function(_0x355c00){if(_0x355c00){var _0x256641=typeof _0x33a389[_0xb86e('0x2a')]===_0xb86e('0x2b')&&typeof _0x33a389[_0xb86e('0x2c')]===_0xb86e('0x2b');var _0xdafcd1=_0x355c00['count'];var _0x19de54=_0x256641?0x0:_0x33a389[_0xb86e('0x2a')];var _0x45835a=_0x256641?_0x355c00[_0xb86e('0x2d')]:_0x33a389[_0xb86e('0x2a')]+_0x33a389[_0xb86e('0x2c')];var _0x326bef;if(_0x45835a>=_0xdafcd1){_0x45835a=_0xdafcd1;_0x326bef=0xc8;}else{_0x326bef=0xce;}_0x5bc058[_0xb86e('0x28')](_0x326bef);return _0x5bc058[_0xb86e('0x2e')](_0xb86e('0x2f'),_0x19de54+'-'+_0x45835a+'/'+_0xdafcd1)['json'](_0x355c00);}return null;};}function patchUpdates(_0x4a32e3){return function(_0xf805cc){try{jsonpatch[_0xb86e('0x30')](_0xf805cc,_0x4a32e3,!![]);}catch(_0x43b742){return BPromise[_0xb86e('0x31')](_0x43b742);}return _0xf805cc['save']();};}function saveUpdates(_0x47446a,_0x1ea3cb){return function(_0x5ec65f){if(_0x5ec65f){return _0x5ec65f[_0xb86e('0x32')](_0x47446a)[_0xb86e('0x1c')](function(_0x7fdae5){return _0x7fdae5;});}return null;};}function removeEntity(_0x110e97,_0x58f97c){return function(_0x447c84){if(_0x447c84){return _0x447c84[_0xb86e('0x33')]()['then'](function(){var _0x1137ea=_0x447c84[_0xb86e('0x34')]({'plain':!![]});var _0x2fd755=_0xb86e('0x35');return db[_0xb86e('0x36')][_0xb86e('0x33')]({'where':{'type':_0x2fd755,'resourceId':_0x1137ea['id']}})[_0xb86e('0x1c')](function(){return _0x447c84;});})[_0xb86e('0x1c')](function(){_0x110e97[_0xb86e('0x28')](0xcc)[_0xb86e('0x37')]();});}};}function handleEntityNotFound(_0x5d672a,_0x8ea709){return function(_0x11e704){if(!_0x11e704){_0x5d672a[_0xb86e('0x27')](0x194);}return _0x11e704;};}function handleError(_0x165f41,_0xd3b071){_0xd3b071=_0xd3b071||0x1f4;return function(_0x638235){logger['error'](_0x638235[_0xb86e('0x38')]);if(_0x638235[_0xb86e('0x39')]){delete _0x638235['name'];}_0x165f41['status'](_0xd3b071)[_0xb86e('0x3a')](_0x638235);};}exports[_0xb86e('0x3b')]=function(_0x3254ab,_0x2f496f){var _0x26e5b2={},_0x56cc5b={},_0x4a70e4={'count':0x0,'rows':[]};var _0x56d6e6=_['map'](db['VoiceContext'][_0xb86e('0x3c')],function(_0x4fe817){return{'name':_0x4fe817[_0xb86e('0x3d')],'type':_0x4fe817[_0xb86e('0x3e')][_0xb86e('0x3f')]};});_0x56cc5b['model']=_[_0xb86e('0x40')](_0x56d6e6,_0xb86e('0x39'));_0x56cc5b[_0xb86e('0x41')]=_[_0xb86e('0x42')](_0x3254ab[_0xb86e('0x41')]);_0x56cc5b[_0xb86e('0x43')]=_[_0xb86e('0x44')](_0x56cc5b['model'],_0x56cc5b[_0xb86e('0x41')]);_0x26e5b2[_0xb86e('0x45')]=_[_0xb86e('0x44')](_0x56cc5b[_0xb86e('0x46')],qs[_0xb86e('0x47')](_0x3254ab[_0xb86e('0x41')][_0xb86e('0x47')]));_0x26e5b2[_0xb86e('0x45')]=_0x26e5b2[_0xb86e('0x45')][_0xb86e('0x48')]?_0x26e5b2[_0xb86e('0x45')]:_0x56cc5b[_0xb86e('0x46')];if(!_0x3254ab[_0xb86e('0x41')]['hasOwnProperty'](_0xb86e('0x49'))){_0x26e5b2['limit']=qs[_0xb86e('0x2c')](_0x3254ab['query'][_0xb86e('0x2c')]);_0x26e5b2['offset']=qs[_0xb86e('0x2a')](_0x3254ab[_0xb86e('0x41')]['offset']);}_0x26e5b2[_0xb86e('0x4a')]=qs[_0xb86e('0x4b')](_0x3254ab[_0xb86e('0x41')]['sort']);_0x26e5b2['where']=qs[_0xb86e('0x43')](_[_0xb86e('0x4c')](_0x3254ab['query'],_0x56cc5b[_0xb86e('0x43')]),_0x56d6e6);if(_0x3254ab[_0xb86e('0x41')][_0xb86e('0x4d')]){_0x26e5b2[_0xb86e('0x4e')]=_[_0xb86e('0x4f')](_0x26e5b2[_0xb86e('0x4e')],{'$or':_[_0xb86e('0x40')](_0x56d6e6,function(_0x3cc08f){if(_0x3cc08f[_0xb86e('0x3e')]!==_0xb86e('0x50')){var _0xb1b135={};_0xb1b135[_0x3cc08f[_0xb86e('0x39')]]={'$like':'%'+_0x3254ab[_0xb86e('0x41')][_0xb86e('0x4d')]+'%'};return _0xb1b135;}})});}_0x26e5b2=_['merge']({},_0x26e5b2,_0x3254ab['options']);var _0x41859c={'where':_0x26e5b2[_0xb86e('0x4e')]};return db['VoiceContext'][_0xb86e('0x2d')](_0x41859c)[_0xb86e('0x1c')](function(_0x57adb7){_0x4a70e4['count']=_0x57adb7;if(_0x3254ab[_0xb86e('0x41')][_0xb86e('0x51')]){_0x26e5b2['include']=[{'all':!![]}];}return db['VoiceContext'][_0xb86e('0x52')](_0x26e5b2);})['then'](function(_0x5eefc6){_0x4a70e4[_0xb86e('0x53')]=_0x5eefc6;return _0x4a70e4;})[_0xb86e('0x1c')](respondWithFilteredResult(_0x2f496f,_0x26e5b2))[_0xb86e('0x26')](handleError(_0x2f496f,null));};exports[_0xb86e('0x54')]=function(_0x46c2a4,_0x160fcf){var _0xb10ba7={'raw':![],'where':{'id':_0x46c2a4[_0xb86e('0x55')]['id']}},_0x370265={};_0x370265[_0xb86e('0x46')]=_[_0xb86e('0x42')](db[_0xb86e('0x56')]['rawAttributes']);_0x370265[_0xb86e('0x41')]=_['keys'](_0x46c2a4['query']);_0x370265[_0xb86e('0x43')]=_['intersection'](_0x370265[_0xb86e('0x46')],_0x370265[_0xb86e('0x41')]);_0xb10ba7['attributes']=_['intersection'](_0x370265['model'],qs[_0xb86e('0x47')](_0x46c2a4[_0xb86e('0x41')]['fields']));_0xb10ba7['attributes']=_0xb10ba7['attributes'][_0xb86e('0x48')]?_0xb10ba7['attributes']:_0x370265[_0xb86e('0x46')];if(_0x46c2a4[_0xb86e('0x41')][_0xb86e('0x51')]){_0xb10ba7[_0xb86e('0x57')]=[{'all':!![]}];}_0xb10ba7=_[_0xb86e('0x4f')]({},_0xb10ba7,_0x46c2a4['options']);return db[_0xb86e('0x56')][_0xb86e('0x58')](_0xb10ba7)[_0xb86e('0x1c')](handleEntityNotFound(_0x160fcf,null))[_0xb86e('0x1c')](respondWithResult(_0x160fcf,null))[_0xb86e('0x26')](handleError(_0x160fcf,null));};exports[_0xb86e('0x59')]=function(_0x1a576e,_0x5275b7,_0x289ae2){var _0x44b1d4;return db[_0xb86e('0x56')][_0xb86e('0x59')](_0x1a576e['body'],{'raw':!![]})[_0xb86e('0x1c')](function(_0xade600){_0x44b1d4=_0xade600;return db[_0xb86e('0x56')][_0xb86e('0x52')]({'raw':!![]});})[_0xb86e('0x1c')](function(_0x4e94d2){var _0x339d81=fs[_0xb86e('0x5a')](path[_0xb86e('0x5b')](config[_0xb86e('0x5c')],_0xb86e('0x5d')),_0xb86e('0x5e'));var _0x2f9986=ejs[_0xb86e('0x5f')](_0x339d81,{'contexts':_0x4e94d2||[]});fs[_0xb86e('0x60')](_0xb86e('0x61'),_0x2f9986);})[_0xb86e('0x1c')](function(){return respondWithRpcPromise(_0xb86e('0x62'),_0xb86e('0x59'),{'module':_0xb86e('0x63')});})[_0xb86e('0x1c')](function(){var _0x5164d9=_0x1a576e[_0xb86e('0x64')][_0xb86e('0x34')]({'plain':!![]});if(!_0x5164d9)throw new Error(_0xb86e('0x65'));if(_0x5164d9['role']==='user'){var _0x5ccee6=_0x44b1d4[_0xb86e('0x34')]({'plain':!![]});return db[_0xb86e('0x66')][_0xb86e('0x58')]({'where':{'name':'Contexts','userProfileId':_0x5164d9['userProfileId']},'raw':!![]})[_0xb86e('0x1c')](function(_0x5820cb){if(_0x5820cb&&_0x5820cb['autoAssociation']===0x0){return db['UserProfileResource'][_0xb86e('0x59')]({'name':_0x5ccee6[_0xb86e('0x39')],'resourceId':_0x5ccee6['id'],'type':_0x5820cb[_0xb86e('0x39')],'sectionId':_0x5820cb['id']},{})[_0xb86e('0x1c')](function(){return _0x44b1d4;});}else{return _0x44b1d4;}})[_0xb86e('0x26')](function(_0x3cc774){logger[_0xb86e('0x22')](_0xb86e('0x67'),_0x3cc774);throw _0x3cc774;});}return _0x44b1d4;})[_0xb86e('0x1c')](respondWithResult(_0x5275b7,0xc9))[_0xb86e('0x26')](handleError(_0x5275b7,null));};exports[_0xb86e('0x32')]=function(_0x5eb3ec,_0x1cf2fe,_0x1ba6f3){var _0x10baca;return db[_0xb86e('0x56')][_0xb86e('0x58')]({'where':{'id':_0x5eb3ec[_0xb86e('0x55')]['id']}})[_0xb86e('0x1c')](handleEntityNotFound(_0x1cf2fe,null))[_0xb86e('0x1c')](saveUpdates(_0x5eb3ec['body'],null))['then'](function(_0x1afe36){if(_0x1afe36){_0x10baca=_0x1afe36;return db[_0xb86e('0x56')][_0xb86e('0x52')]({'raw':!![]});}})[_0xb86e('0x1c')](function(_0x620b1d){var _0x56aebf=fs[_0xb86e('0x5a')](path[_0xb86e('0x5b')](config[_0xb86e('0x5c')],_0xb86e('0x5d')),_0xb86e('0x5e'));var _0x3ef057=ejs[_0xb86e('0x5f')](_0x56aebf,{'contexts':_0x620b1d||[]});fs[_0xb86e('0x60')](_0xb86e('0x61'),_0x3ef057);})[_0xb86e('0x1c')](function(){return respondWithRpcPromise('Reload','update',{'module':_0xb86e('0x63')});})['then'](function(){return _0x10baca;})[_0xb86e('0x1c')](respondWithResult(_0x1cf2fe,null))[_0xb86e('0x26')](handleError(_0x1cf2fe,null));};exports[_0xb86e('0x33')]=function(_0x122974,_0x48031f,_0x4642e9){var _0x5bf97e;return db[_0xb86e('0x56')]['find']({'where':{'id':_0x122974[_0xb86e('0x55')]['id']}})[_0xb86e('0x1c')](handleEntityNotFound(_0x48031f,null))[_0xb86e('0x1c')](removeEntity(_0x48031f,null))[_0xb86e('0x1c')](function(){return db[_0xb86e('0x56')][_0xb86e('0x52')]({'raw':!![]});})[_0xb86e('0x1c')](function(_0x220580){var _0x1de7cb=fs['readFileSync'](path[_0xb86e('0x5b')](config[_0xb86e('0x5c')],_0xb86e('0x5d')),_0xb86e('0x5e'));var _0x29621b=ejs[_0xb86e('0x5f')](_0x1de7cb,{'contexts':_0x220580});fs['writeFileSync']('/etc/asterisk/extensions_xcally_contexts.conf',_0x29621b);return respondWithRpcPromise(_0xb86e('0x62'),_0xb86e('0x33'),{'module':'chan_sip.so'});})[_0xb86e('0x26')](handleError(_0x48031f,null));}; \ No newline at end of file +var _0x574b=['name','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filter','where','VIRTUAL','merge','options','includeAll','findAll','rows','show','params','length','include','create','readFileSync','root','server/files/templates/context.ejs','utf8','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','autoAssociation','body','join','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','http','request','then','VoiceContext,\x20%s,\x20%s','request\x20sent','VoiceContext,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','status','offset','undefined','count','limit','set','Content-Range','apply','save','update','destroy','get','Contexts','UserProfileResource','end','sendStatus','send','map','VoiceContext','rawAttributes','type','model'];(function(_0x2aaaa4,_0x384ec2){var _0x5984bb=function(_0x5a2e8a){while(--_0x5a2e8a){_0x2aaaa4['push'](_0x2aaaa4['shift']());}};_0x5984bb(++_0x384ec2);}(_0x574b,0xea));var _0xb574=function(_0x50ea15,_0x59af60){_0x50ea15=_0x50ea15-0x0;var _0x7c41b5=_0x574b[_0x50ea15];return _0x7c41b5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb574('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb574('0x1'));var rp=require(_0xb574('0x2'));var moment=require('moment');var BPromise=require(_0xb574('0x3'));var Mustache=require(_0xb574('0x4'));var util=require(_0xb574('0x5'));var path=require('path');var sox=require(_0xb574('0x6'));var csv=require(_0xb574('0x7'));var ejs=require(_0xb574('0x8'));var fs=require('fs');var fs_extra=require(_0xb574('0x9'));var _=require(_0xb574('0xa'));var squel=require(_0xb574('0xb'));var crypto=require(_0xb574('0xc'));var jsforce=require(_0xb574('0xd'));var deskjs=require(_0xb574('0xe'));var toCsv=require('to-csv');var querystring=require(_0xb574('0xf'));var Papa=require(_0xb574('0x10'));var Redis=require(_0xb574('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xb574('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb574('0x13'));var logger=require(_0xb574('0x14'))(_0xb574('0x15'));var utils=require('../../config/utils');var config=require(_0xb574('0x16'));var licenseUtil=require(_0xb574('0x17'));var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var client=jayson['client'][_0xb574('0x18')]({'port':0x232a});function respondWithRpcPromise(_0x3d42d3,_0x74de04,_0x256c3e,_0x2fe8c1){return new BPromise(function(_0x5c1d1c,_0x1092d5){var _0x2e8ae0=_0x2fe8c1||client;return _0x2e8ae0[_0xb574('0x19')](_0x3d42d3,_0x256c3e)[_0xb574('0x1a')](function(_0x350a92){logger['info'](_0xb574('0x1b'),_0x74de04,_0xb574('0x1c'));logger['debug'](_0xb574('0x1d'),_0x74de04,'request\x20sent',JSON['stringify'](_0x350a92));if(_0x350a92[_0xb574('0x1e')]){if(_0x350a92[_0xb574('0x1e')]['code']===0x1f4){logger[_0xb574('0x1e')](_0xb574('0x1b'),_0x74de04,_0x350a92['error'][_0xb574('0x1f')]);return _0x1092d5(_0x350a92[_0xb574('0x1e')][_0xb574('0x1f')]);}logger[_0xb574('0x1e')]('VoiceContext,\x20%s,\x20%s',_0x74de04,_0x350a92[_0xb574('0x1e')][_0xb574('0x1f')]);return _0x5c1d1c(_0x350a92[_0xb574('0x1e')][_0xb574('0x1f')]);}else{logger[_0xb574('0x20')](_0xb574('0x1b'),_0x74de04,_0xb574('0x1c'));_0x5c1d1c(_0x350a92[_0xb574('0x21')][_0xb574('0x1f')]);}})[_0xb574('0x22')](function(_0x2bc072){logger[_0xb574('0x1e')](_0xb574('0x1b'),_0x74de04,_0x2bc072);_0x1092d5(_0x2bc072);});});}function respondWithStatusCode(_0x118a2c,_0x44cf29){_0x44cf29=_0x44cf29||0xcc;return function(_0x23a5c5){if(_0x23a5c5){return _0x118a2c['sendStatus'](_0x44cf29);}return _0x118a2c[_0xb574('0x23')](_0x44cf29)['end']();};}function respondWithResult(_0x2d16d3,_0x438707){_0x438707=_0x438707||0xc8;return function(_0x1b808f){if(_0x1b808f){return _0x2d16d3['status'](_0x438707)['json'](_0x1b808f);}};}function respondWithFilteredResult(_0x293b30,_0x37e107){return function(_0x41f37a){if(_0x41f37a){var _0x2f36bd=typeof _0x37e107[_0xb574('0x24')]===_0xb574('0x25')&&typeof _0x37e107['limit']===_0xb574('0x25');var _0x5b0b33=_0x41f37a[_0xb574('0x26')];var _0x21320b=_0x2f36bd?0x0:_0x37e107['offset'];var _0x35474c=_0x2f36bd?_0x41f37a[_0xb574('0x26')]:_0x37e107['offset']+_0x37e107[_0xb574('0x27')];var _0x1eb1e9;if(_0x35474c>=_0x5b0b33){_0x35474c=_0x5b0b33;_0x1eb1e9=0xc8;}else{_0x1eb1e9=0xce;}_0x293b30[_0xb574('0x23')](_0x1eb1e9);return _0x293b30[_0xb574('0x28')](_0xb574('0x29'),_0x21320b+'-'+_0x35474c+'/'+_0x5b0b33)['json'](_0x41f37a);}return null;};}function patchUpdates(_0x3baf4b){return function(_0x9957cb){try{jsonpatch[_0xb574('0x2a')](_0x9957cb,_0x3baf4b,!![]);}catch(_0x35bcf3){return BPromise['reject'](_0x35bcf3);}return _0x9957cb[_0xb574('0x2b')]();};}function saveUpdates(_0x3845ae,_0x445c75){return function(_0x278f23){if(_0x278f23){return _0x278f23[_0xb574('0x2c')](_0x3845ae)[_0xb574('0x1a')](function(_0x1cc07d){return _0x1cc07d;});}return null;};}function removeEntity(_0x2fb408,_0x14ea42){return function(_0x334c21){if(_0x334c21){return _0x334c21[_0xb574('0x2d')]()[_0xb574('0x1a')](function(){var _0x52aa6d=_0x334c21[_0xb574('0x2e')]({'plain':!![]});var _0x80f854=_0xb574('0x2f');return db[_0xb574('0x30')][_0xb574('0x2d')]({'where':{'type':_0x80f854,'resourceId':_0x52aa6d['id']}})['then'](function(){return _0x334c21;});})[_0xb574('0x1a')](function(){_0x2fb408[_0xb574('0x23')](0xcc)[_0xb574('0x31')]();});}};}function handleEntityNotFound(_0x578aba,_0x3c7575){return function(_0x5a58ac){if(!_0x5a58ac){_0x578aba[_0xb574('0x32')](0x194);}return _0x5a58ac;};}function handleError(_0x2ed449,_0x24c3cc){_0x24c3cc=_0x24c3cc||0x1f4;return function(_0x28f254){logger[_0xb574('0x1e')](_0x28f254['stack']);if(_0x28f254['name']){delete _0x28f254['name'];}_0x2ed449[_0xb574('0x23')](_0x24c3cc)[_0xb574('0x33')](_0x28f254);};}exports['index']=function(_0x33b23b,_0x59e2fe){var _0x589afb={},_0x1a0221={},_0x328942={'count':0x0,'rows':[]};var _0x35bc89=_[_0xb574('0x34')](db[_0xb574('0x35')][_0xb574('0x36')],function(_0x22835e){return{'name':_0x22835e['fieldName'],'type':_0x22835e[_0xb574('0x37')]['key']};});_0x1a0221[_0xb574('0x38')]=_[_0xb574('0x34')](_0x35bc89,_0xb574('0x39'));_0x1a0221[_0xb574('0x3a')]=_[_0xb574('0x3b')](_0x33b23b['query']);_0x1a0221[_0xb574('0x3c')]=_[_0xb574('0x3d')](_0x1a0221[_0xb574('0x38')],_0x1a0221[_0xb574('0x3a')]);_0x589afb[_0xb574('0x3e')]=_['intersection'](_0x1a0221[_0xb574('0x38')],qs[_0xb574('0x3f')](_0x33b23b[_0xb574('0x3a')][_0xb574('0x3f')]));_0x589afb[_0xb574('0x3e')]=_0x589afb[_0xb574('0x3e')]['length']?_0x589afb[_0xb574('0x3e')]:_0x1a0221[_0xb574('0x38')];if(!_0x33b23b[_0xb574('0x3a')][_0xb574('0x40')](_0xb574('0x41'))){_0x589afb[_0xb574('0x27')]=qs[_0xb574('0x27')](_0x33b23b[_0xb574('0x3a')]['limit']);_0x589afb['offset']=qs[_0xb574('0x24')](_0x33b23b['query'][_0xb574('0x24')]);}_0x589afb[_0xb574('0x42')]=qs[_0xb574('0x43')](_0x33b23b[_0xb574('0x3a')][_0xb574('0x43')]);_0x589afb['where']=qs[_0xb574('0x3c')](_['pick'](_0x33b23b[_0xb574('0x3a')],_0x1a0221[_0xb574('0x3c')]),_0x35bc89);if(_0x33b23b[_0xb574('0x3a')][_0xb574('0x44')]){_0x589afb[_0xb574('0x45')]=_['merge'](_0x589afb[_0xb574('0x45')],{'$or':_[_0xb574('0x34')](_0x35bc89,function(_0x4b344c){if(_0x4b344c[_0xb574('0x37')]!==_0xb574('0x46')){var _0x2f2f07={};_0x2f2f07[_0x4b344c[_0xb574('0x39')]]={'$like':'%'+_0x33b23b[_0xb574('0x3a')]['filter']+'%'};return _0x2f2f07;}})});}_0x589afb=_[_0xb574('0x47')]({},_0x589afb,_0x33b23b[_0xb574('0x48')]);var _0x37dac3={'where':_0x589afb[_0xb574('0x45')]};return db[_0xb574('0x35')][_0xb574('0x26')](_0x37dac3)[_0xb574('0x1a')](function(_0x18ad81){_0x328942[_0xb574('0x26')]=_0x18ad81;if(_0x33b23b[_0xb574('0x3a')][_0xb574('0x49')]){_0x589afb['include']=[{'all':!![]}];}return db[_0xb574('0x35')][_0xb574('0x4a')](_0x589afb);})[_0xb574('0x1a')](function(_0x14a9ba){_0x328942[_0xb574('0x4b')]=_0x14a9ba;return _0x328942;})['then'](respondWithFilteredResult(_0x59e2fe,_0x589afb))[_0xb574('0x22')](handleError(_0x59e2fe,null));};exports[_0xb574('0x4c')]=function(_0x6ad2e5,_0x349c39){var _0x4ddd13={'raw':![],'where':{'id':_0x6ad2e5[_0xb574('0x4d')]['id']}},_0x4d719f={};_0x4d719f[_0xb574('0x38')]=_[_0xb574('0x3b')](db[_0xb574('0x35')][_0xb574('0x36')]);_0x4d719f['query']=_[_0xb574('0x3b')](_0x6ad2e5['query']);_0x4d719f[_0xb574('0x3c')]=_[_0xb574('0x3d')](_0x4d719f[_0xb574('0x38')],_0x4d719f[_0xb574('0x3a')]);_0x4ddd13['attributes']=_[_0xb574('0x3d')](_0x4d719f[_0xb574('0x38')],qs[_0xb574('0x3f')](_0x6ad2e5[_0xb574('0x3a')]['fields']));_0x4ddd13['attributes']=_0x4ddd13[_0xb574('0x3e')][_0xb574('0x4e')]?_0x4ddd13['attributes']:_0x4d719f[_0xb574('0x38')];if(_0x6ad2e5[_0xb574('0x3a')][_0xb574('0x49')]){_0x4ddd13[_0xb574('0x4f')]=[{'all':!![]}];}_0x4ddd13=_[_0xb574('0x47')]({},_0x4ddd13,_0x6ad2e5[_0xb574('0x48')]);return db[_0xb574('0x35')]['find'](_0x4ddd13)[_0xb574('0x1a')](handleEntityNotFound(_0x349c39,null))['then'](respondWithResult(_0x349c39,null))[_0xb574('0x22')](handleError(_0x349c39,null));};exports[_0xb574('0x50')]=function(_0x1e4e31,_0x3f7757,_0x39125a){var _0x39f028;return db[_0xb574('0x35')][_0xb574('0x50')](_0x1e4e31['body'],{'raw':!![]})[_0xb574('0x1a')](function(_0x2dde1a){_0x39f028=_0x2dde1a;return db[_0xb574('0x35')]['findAll']({'raw':!![]});})[_0xb574('0x1a')](function(_0xd9a66b){var _0x4ce537=fs[_0xb574('0x51')](path['join'](config[_0xb574('0x52')],_0xb574('0x53')),_0xb574('0x54'));var _0x271d56=ejs[_0xb574('0x55')](_0x4ce537,{'contexts':_0xd9a66b||[]});fs[_0xb574('0x56')](_0xb574('0x57'),_0x271d56);})[_0xb574('0x1a')](function(){return respondWithRpcPromise(_0xb574('0x58'),_0xb574('0x50'),{'module':_0xb574('0x59')});})[_0xb574('0x1a')](function(){var _0x125819=_0x1e4e31[_0xb574('0x5a')][_0xb574('0x2e')]({'plain':!![]});if(!_0x125819)throw new Error(_0xb574('0x5b'));if(_0x125819['role']===_0xb574('0x5a')){var _0x5cf898=_0x39f028['get']({'plain':!![]});return db[_0xb574('0x5c')][_0xb574('0x5d')]({'where':{'name':_0xb574('0x2f'),'userProfileId':_0x125819['userProfileId']},'raw':!![]})['then'](function(_0x1d6787){if(_0x1d6787&&_0x1d6787[_0xb574('0x5e')]===0x0){return db[_0xb574('0x30')][_0xb574('0x50')]({'name':_0x5cf898[_0xb574('0x39')],'resourceId':_0x5cf898['id'],'type':_0x1d6787[_0xb574('0x39')],'sectionId':_0x1d6787['id']},{})[_0xb574('0x1a')](function(){return _0x39f028;});}else{return _0x39f028;}})[_0xb574('0x22')](function(_0x5b34d0){logger[_0xb574('0x1e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5b34d0);throw _0x5b34d0;});}return _0x39f028;})[_0xb574('0x1a')](respondWithResult(_0x3f7757,0xc9))['catch'](handleError(_0x3f7757,null));};exports['update']=function(_0x59f461,_0x3f72d9,_0xaa4c76){var _0x1d4349;return db['VoiceContext'][_0xb574('0x5d')]({'where':{'id':_0x59f461['params']['id']}})[_0xb574('0x1a')](handleEntityNotFound(_0x3f72d9,null))[_0xb574('0x1a')](saveUpdates(_0x59f461[_0xb574('0x5f')],null))[_0xb574('0x1a')](function(_0x5a9e44){if(_0x5a9e44){_0x1d4349=_0x5a9e44;return db[_0xb574('0x35')][_0xb574('0x4a')]({'raw':!![]});}})[_0xb574('0x1a')](function(_0x11f6d1){var _0x195c0b=fs[_0xb574('0x51')](path[_0xb574('0x60')](config['root'],_0xb574('0x53')),_0xb574('0x54'));var _0x4acdce=ejs[_0xb574('0x55')](_0x195c0b,{'contexts':_0x11f6d1||[]});fs[_0xb574('0x56')](_0xb574('0x57'),_0x4acdce);})['then'](function(){return respondWithRpcPromise(_0xb574('0x58'),_0xb574('0x2c'),{'module':_0xb574('0x59')});})[_0xb574('0x1a')](function(){return _0x1d4349;})[_0xb574('0x1a')](respondWithResult(_0x3f72d9,null))[_0xb574('0x22')](handleError(_0x3f72d9,null));};exports[_0xb574('0x2d')]=function(_0x40a4d2,_0x3c50b1,_0x999cc5){var _0x286c89;return db[_0xb574('0x35')][_0xb574('0x5d')]({'where':{'id':_0x40a4d2[_0xb574('0x4d')]['id']}})[_0xb574('0x1a')](handleEntityNotFound(_0x3c50b1,null))[_0xb574('0x1a')](removeEntity(_0x3c50b1,null))[_0xb574('0x1a')](function(){return db['VoiceContext'][_0xb574('0x4a')]({'raw':!![]});})['then'](function(_0x465f1c){var _0x2efe93=fs[_0xb574('0x51')](path[_0xb574('0x60')](config[_0xb574('0x52')],'server/files/templates/context.ejs'),_0xb574('0x54'));var _0x2c2dd=ejs[_0xb574('0x55')](_0x2efe93,{'contexts':_0x465f1c});fs[_0xb574('0x56')](_0xb574('0x57'),_0x2c2dd);return respondWithRpcPromise('Reload',_0xb574('0x2d'),{'module':_0xb574('0x59')});})['catch'](handleError(_0x3c50b1,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index 38be710..2e6cca1 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 _0x4700=['voice_contexts','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./voiceContext.attributes','exports','define','VoiceContext'];(function(_0x29db36,_0x410ae9){var _0x234e87=function(_0x48697b){while(--_0x48697b){_0x29db36['push'](_0x29db36['shift']());}};_0x234e87(++_0x410ae9);}(_0x4700,0x15d));var _0x0470=function(_0x38bd14,_0x3e77b5){_0x38bd14=_0x38bd14-0x0;var _0x214c08=_0x4700[_0x38bd14];return _0x214c08;};'use strict';var _=require('lodash');var util=require(_0x0470('0x0'));var logger=require(_0x0470('0x1'))('api');var moment=require(_0x0470('0x2'));var BPromise=require(_0x0470('0x3'));var rp=require(_0x0470('0x4'));var fs=require('fs');var path=require(_0x0470('0x5'));var rimraf=require(_0x0470('0x6'));var config=require('../../config/environment');var attributes=require(_0x0470('0x7'));module[_0x0470('0x8')]=function(_0x20bf5e,_0x509f45){return _0x20bf5e[_0x0470('0x9')](_0x0470('0xa'),attributes,{'tableName':_0x0470('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6888=['VoiceContext','lodash','../../config/logger','api','moment','bluebird','request-promise','path','./voiceContext.attributes','exports','define'];(function(_0x4065dd,_0x3d1762){var _0x537725=function(_0x331be2){while(--_0x331be2){_0x4065dd['push'](_0x4065dd['shift']());}};_0x537725(++_0x3d1762);}(_0x6888,0xd2));var _0x8688=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x6888[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0x8688('0x0'));var util=require('util');var logger=require(_0x8688('0x1'))(_0x8688('0x2'));var moment=require(_0x8688('0x3'));var BPromise=require(_0x8688('0x4'));var rp=require(_0x8688('0x5'));var fs=require('fs');var path=require(_0x8688('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x8688('0x7'));module[_0x8688('0x8')]=function(_0x37c051,_0x33a806){return _0x37c051[_0x8688('0x9')](_0x8688('0xa'),attributes,{'tableName':'voice_contexts','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 5258890..be8c144 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 _0xd1f1=['../../config/environment','jayson/promise','http','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x50f0e9,_0x54378e){var _0x37ccd4=function(_0x50f00a){while(--_0x50f00a){_0x50f0e9['push'](_0x50f0e9['shift']());}};_0x37ccd4(++_0x54378e);}(_0xd1f1,0x84));var _0x1d1f=function(_0x4b60cc,_0x2e5e22){_0x4b60cc=_0x4b60cc-0x0;var _0x116ffe=_0xd1f1[_0x4b60cc];return _0x116ffe;};'use strict';var _=require(_0x1d1f('0x0'));var util=require(_0x1d1f('0x1'));var moment=require(_0x1d1f('0x2'));var BPromise=require(_0x1d1f('0x3'));var rs=require(_0x1d1f('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1d1f('0x5'))['db'];var utils=require(_0x1d1f('0x6'));var logger=require(_0x1d1f('0x7'))('rpc');var config=require(_0x1d1f('0x8'));var jayson=require(_0x1d1f('0x9'));var client=jayson['client'][_0x1d1f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5c285a,_0xfe2b9,_0xf6f6ab){return new BPromise(function(_0x44f6c1,_0x20d937){return client['request'](_0x5c285a,_0xf6f6ab)['then'](function(_0x5372be){logger[_0x1d1f('0xb')](_0x1d1f('0xc'),_0xfe2b9,_0x1d1f('0xd'));logger[_0x1d1f('0xe')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0xfe2b9,_0x1d1f('0xd'),JSON[_0x1d1f('0xf')](_0x5372be));if(_0x5372be[_0x1d1f('0x10')]){if(_0x5372be[_0x1d1f('0x10')][_0x1d1f('0x11')]===0x1f4){logger[_0x1d1f('0x10')]('VoiceContext,\x20%s,\x20%s',_0xfe2b9,_0x5372be['error']['message']);return _0x20d937(_0x5372be[_0x1d1f('0x10')][_0x1d1f('0x12')]);}logger[_0x1d1f('0x10')](_0x1d1f('0xc'),_0xfe2b9,_0x5372be[_0x1d1f('0x10')][_0x1d1f('0x12')]);return _0x44f6c1(_0x5372be[_0x1d1f('0x10')][_0x1d1f('0x12')]);}else{logger[_0x1d1f('0xb')](_0x1d1f('0xc'),_0xfe2b9,_0x1d1f('0xd'));_0x44f6c1(_0x5372be[_0x1d1f('0x13')][_0x1d1f('0x12')]);}})['catch'](function(_0xc11b2e){logger[_0x1d1f('0x10')](_0x1d1f('0xc'),_0xfe2b9,_0xc11b2e);_0x20d937(_0xc11b2e);});});} \ No newline at end of file +var _0x3d5d=['VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','catch','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','VoiceContext,\x20%s,\x20%s','debug'];(function(_0x9bd09e,_0xe01a07){var _0x3900a4=function(_0x311597){while(--_0x311597){_0x9bd09e['push'](_0x9bd09e['shift']());}};_0x3900a4(++_0xe01a07);}(_0x3d5d,0xe2));var _0xd3d5=function(_0x151418,_0x2cbffa){_0x151418=_0x151418-0x0;var _0x40e29a=_0x3d5d[_0x151418];return _0x40e29a;};'use strict';var _=require(_0xd3d5('0x0'));var util=require('util');var moment=require(_0xd3d5('0x1'));var BPromise=require(_0xd3d5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd3d5('0x3'))['db'];var utils=require(_0xd3d5('0x4'));var logger=require(_0xd3d5('0x5'))(_0xd3d5('0x6'));var config=require(_0xd3d5('0x7'));var jayson=require(_0xd3d5('0x8'));var client=jayson['client'][_0xd3d5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1a449d,_0x155a2e,_0x40ae47){return new BPromise(function(_0x2b4892,_0x9e67b4){return client['request'](_0x1a449d,_0x40ae47)[_0xd3d5('0xa')](function(_0x48c5fd){logger[_0xd3d5('0xb')](_0xd3d5('0xc'),_0x155a2e,'request\x20sent');logger[_0xd3d5('0xd')](_0xd3d5('0xe'),_0x155a2e,'request\x20sent',JSON[_0xd3d5('0xf')](_0x48c5fd));if(_0x48c5fd[_0xd3d5('0x10')]){if(_0x48c5fd[_0xd3d5('0x10')]['code']===0x1f4){logger['error'](_0xd3d5('0xc'),_0x155a2e,_0x48c5fd[_0xd3d5('0x10')]['message']);return _0x9e67b4(_0x48c5fd[_0xd3d5('0x10')]['message']);}logger[_0xd3d5('0x10')](_0xd3d5('0xc'),_0x155a2e,_0x48c5fd[_0xd3d5('0x10')]['message']);return _0x2b4892(_0x48c5fd['error'][_0xd3d5('0x11')]);}else{logger[_0xd3d5('0xb')]('VoiceContext,\x20%s,\x20%s',_0x155a2e,_0xd3d5('0x12'));_0x2b4892(_0x48c5fd['result'][_0xd3d5('0x11')]);}})[_0xd3d5('0x13')](function(_0x2bb7b9){logger['error'](_0xd3d5('0xc'),_0x155a2e,_0x2bb7b9);_0x9e67b4(_0x2bb7b9);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index ebe7096..25ec88b 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 _0x264f=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','destroy','exports'];(function(_0x2d3fc9,_0x1ee4e8){var _0x3aa007=function(_0x4b0c72){while(--_0x4b0c72){_0x2d3fc9['push'](_0x2d3fc9['shift']());}};_0x3aa007(++_0x1ee4e8);}(_0x264f,0x19e));var _0xf264=function(_0x1df593,_0x180149){_0x1df593=_0x1df593-0x0;var _0x36111b=_0x264f[_0x1df593];return _0x36111b;};'use strict';var multer=require(_0xf264('0x0'));var util=require(_0xf264('0x1'));var path=require(_0xf264('0x2'));var timeout=require(_0xf264('0x3'));var express=require(_0xf264('0x4'));var router=express[_0xf264('0x5')]();var fs_extra=require(_0xf264('0x6'));var auth=require(_0xf264('0x7'));var interaction=require(_0xf264('0x8'));var config=require(_0xf264('0x9'));var controller=require('./voiceDialReport.controller');router[_0xf264('0xa')]('/',auth[_0xf264('0xb')](),controller[_0xf264('0xc')]);router['get'](_0xf264('0xd'),auth[_0xf264('0xb')](),controller[_0xf264('0xe')]);router['get'](_0xf264('0xf'),auth[_0xf264('0xb')](),controller[_0xf264('0x10')]);router[_0xf264('0x11')]('/',auth['isAuthenticated'](),controller[_0xf264('0x12')]);router[_0xf264('0x13')](_0xf264('0xf'),auth[_0xf264('0xb')](),controller[_0xf264('0x14')]);router['delete'](_0xf264('0xf'),auth['isAuthenticated'](),controller[_0xf264('0x15')]);module[_0xf264('0x16')]=router; \ No newline at end of file +var _0xada8=['isAuthenticated','describe','/:id','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','index','/describe'];(function(_0x80d9e8,_0x3e6a7f){var _0x8dddc=function(_0x397ad3){while(--_0x397ad3){_0x80d9e8['push'](_0x80d9e8['shift']());}};_0x8dddc(++_0x3e6a7f);}(_0xada8,0x74));var _0x8ada=function(_0x42eb17,_0x2c5cef){_0x42eb17=_0x42eb17-0x0;var _0x262541=_0xada8[_0x42eb17];return _0x262541;};'use strict';var multer=require(_0x8ada('0x0'));var util=require(_0x8ada('0x1'));var path=require(_0x8ada('0x2'));var timeout=require(_0x8ada('0x3'));var express=require(_0x8ada('0x4'));var router=express[_0x8ada('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x8ada('0x6'));var config=require(_0x8ada('0x7'));var controller=require('./voiceDialReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x8ada('0x8')]);router['get'](_0x8ada('0x9'),auth[_0x8ada('0xa')](),controller[_0x8ada('0xb')]);router['get'](_0x8ada('0xc'),auth[_0x8ada('0xa')](),controller['show']);router['post']('/',auth[_0x8ada('0xa')](),controller[_0x8ada('0xd')]);router['put'](_0x8ada('0xc'),auth[_0x8ada('0xa')](),controller[_0x8ada('0xe')]);router[_0x8ada('0xf')](_0x8ada('0xc'),auth[_0x8ada('0xa')](),controller[_0x8ada('0x10')]);module[_0x8ada('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index cb2baec..0fe98ea 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 _0x98a8=['sequelize','exports','STRING','INTEGER','DATE'];(function(_0x1d5c20,_0x4e6e61){var _0x19ff06=function(_0x2a0de9){while(--_0x2a0de9){_0x1d5c20['push'](_0x1d5c20['shift']());}};_0x19ff06(++_0x4e6e61);}(_0x98a8,0x12c));var _0x898a=function(_0x28097b,_0x115c6e){_0x28097b=_0x28097b-0x0;var _0x451403=_0x98a8[_0x28097b];return _0x451403;};'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 +var _0x425d=['sequelize','STRING','INTEGER','DATE'];(function(_0x589c10,_0x42100c){var _0x4ca933=function(_0x24ea3c){while(--_0x24ea3c){_0x589c10['push'](_0x589c10['shift']());}};_0x4ca933(++_0x42100c);}(_0x425d,0x1e0));var _0xd425=function(_0x2cf2ce,_0x9c970){_0x2cf2ce=_0x2cf2ce-0x0;var _0x11f24d=_0x425d[_0x2cf2ce];return _0x11f24d;};'use strict';var Sequelize=require(_0xd425('0x0'));module['exports']={'privilege':{'type':Sequelize[_0xd425('0x1')]},'channel':{'type':Sequelize[_0xd425('0x1')]},'channelstate':{'type':Sequelize[_0xd425('0x2')]},'channelstatedesc':{'type':Sequelize[_0xd425('0x1')]},'calleridnum':{'type':Sequelize[_0xd425('0x1')]},'calleridname':{'type':Sequelize[_0xd425('0x1')]},'connectedlinenum':{'type':Sequelize[_0xd425('0x1')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xd425('0x1')]},'accountcode':{'type':Sequelize[_0xd425('0x1')]},'context':{'type':Sequelize[_0xd425('0x1')]},'exten':{'type':Sequelize[_0xd425('0x1')]},'priority':{'type':Sequelize[_0xd425('0x2')]},'uniqueid':{'type':Sequelize[_0xd425('0x1')]},'linkedid':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0xd425('0x1')]},'destchannelstate':{'type':Sequelize[_0xd425('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0xd425('0x1')]},'destcalleridnum':{'type':Sequelize[_0xd425('0x1')]},'destcalleridname':{'type':Sequelize[_0xd425('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0xd425('0x1')]},'destconnectedlinename':{'type':Sequelize[_0xd425('0x1')]},'destlanguage':{'type':Sequelize[_0xd425('0x1')]},'destaccountcode':{'type':Sequelize[_0xd425('0x1')]},'destcontext':{'type':Sequelize[_0xd425('0x1')]},'destexten':{'type':Sequelize[_0xd425('0x1')]},'destpriority':{'type':Sequelize[_0xd425('0x2')]},'destuniqueid':{'type':Sequelize[_0xd425('0x1')]},'destlinkedid':{'type':Sequelize[_0xd425('0x1')]},'dialstring':{'type':Sequelize[_0xd425('0x1')]},'dialstatus':{'type':Sequelize[_0xd425('0x1')]},'starttime':{'type':Sequelize[_0xd425('0x3')]},'answertime':{'type':Sequelize[_0xd425('0x3')]},'endtime':{'type':Sequelize[_0xd425('0x3')]},'lastevent':{'type':Sequelize[_0xd425('0x1')],'comment':'called,connect,complete'},'routeId':{'type':Sequelize[_0xd425('0x2')]},'duration':{'type':Sequelize[_0xd425('0x2')]},'holdtime':{'type':Sequelize[_0xd425('0x2')]},'billableseconds':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index b1dfe15..038eb12 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 _0x08b7=['../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','VoiceDialReport','rawAttributes','fieldName','type','key','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','options','catch','params','include','create','find','body','describe','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger'];(function(_0x59f6be,_0x472a09){var _0x2aef59=function(_0x4d72d9){while(--_0x4d72d9){_0x59f6be['push'](_0x59f6be['shift']());}};_0x2aef59(++_0x472a09);}(_0x08b7,0x1b0));var _0x708b=function(_0x2d9179,_0x1e95d9){_0x2d9179=_0x2d9179-0x0;var _0x1025a=_0x08b7[_0x2d9179];return _0x1025a;};'use strict';var emlformat=require(_0x708b('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x708b('0x1'));var rp=require(_0x708b('0x2'));var moment=require(_0x708b('0x3'));var BPromise=require(_0x708b('0x4'));var Mustache=require(_0x708b('0x5'));var util=require(_0x708b('0x6'));var path=require(_0x708b('0x7'));var sox=require(_0x708b('0x8'));var csv=require(_0x708b('0x9'));var ejs=require(_0x708b('0xa'));var fs=require('fs');var fs_extra=require(_0x708b('0xb'));var _=require(_0x708b('0xc'));var squel=require(_0x708b('0xd'));var crypto=require(_0x708b('0xe'));var jsforce=require(_0x708b('0xf'));var deskjs=require(_0x708b('0x10'));var toCsv=require(_0x708b('0x9'));var querystring=require(_0x708b('0x11'));var Papa=require(_0x708b('0x12'));var Redis=require(_0x708b('0x13'));var authService=require(_0x708b('0x14'));var qs=require(_0x708b('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x708b('0x16'));var logger=require(_0x708b('0x17'))('api');var utils=require(_0x708b('0x18'));var config=require(_0x708b('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x708b('0x1a'))['db'];function respondWithStatusCode(_0x549544,_0x199ff4){_0x199ff4=_0x199ff4||0xcc;return function(_0x84cca){if(_0x84cca){return _0x549544[_0x708b('0x1b')](_0x199ff4);}return _0x549544[_0x708b('0x1c')](_0x199ff4)[_0x708b('0x1d')]();};}function respondWithResult(_0x1632c6,_0x5df8fa){_0x5df8fa=_0x5df8fa||0xc8;return function(_0x381326){if(_0x381326){return _0x1632c6[_0x708b('0x1c')](_0x5df8fa)[_0x708b('0x1e')](_0x381326);}};}function respondWithFilteredResult(_0x3ee11b,_0x51cc93){return function(_0x4ef2b5){if(_0x4ef2b5){var _0x121d3=typeof _0x51cc93[_0x708b('0x1f')]===_0x708b('0x20')&&typeof _0x51cc93[_0x708b('0x21')]===_0x708b('0x20');var _0x1e34aa=_0x4ef2b5[_0x708b('0x22')];var _0x635820=_0x121d3?0x0:_0x51cc93[_0x708b('0x1f')];var _0x1018ea=_0x121d3?_0x4ef2b5[_0x708b('0x22')]:_0x51cc93[_0x708b('0x1f')]+_0x51cc93[_0x708b('0x21')];var _0x2a59fd;if(_0x1018ea>=_0x1e34aa){_0x1018ea=_0x1e34aa;_0x2a59fd=0xc8;}else{_0x2a59fd=0xce;}_0x3ee11b['status'](_0x2a59fd);return _0x3ee11b[_0x708b('0x23')](_0x708b('0x24'),_0x635820+'-'+_0x1018ea+'/'+_0x1e34aa)[_0x708b('0x1e')](_0x4ef2b5);}return null;};}function patchUpdates(_0x154f92){return function(_0x4934f){try{jsonpatch[_0x708b('0x25')](_0x4934f,_0x154f92,!![]);}catch(_0x444834){return BPromise[_0x708b('0x26')](_0x444834);}return _0x4934f[_0x708b('0x27')]();};}function saveUpdates(_0x4495b1,_0x53b10b){return function(_0x92bf62){if(_0x92bf62){return _0x92bf62[_0x708b('0x28')](_0x4495b1)[_0x708b('0x29')](function(_0x4d12cd){return _0x4d12cd;});}return null;};}function removeEntity(_0x2d1a16,_0x12ada0){return function(_0x25dc11){if(_0x25dc11){return _0x25dc11[_0x708b('0x2a')]()[_0x708b('0x29')](function(){_0x2d1a16['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3b3ea1,_0x5208c5){return function(_0x55b75f){if(!_0x55b75f){_0x3b3ea1[_0x708b('0x1b')](0x194);}return _0x55b75f;};}function handleError(_0x360165,_0x1db930){_0x1db930=_0x1db930||0x1f4;return function(_0x51336b){logger['error'](_0x51336b[_0x708b('0x2b')]);if(_0x51336b[_0x708b('0x2c')]){delete _0x51336b[_0x708b('0x2c')];}_0x360165['status'](_0x1db930)[_0x708b('0x2d')](_0x51336b);};}exports[_0x708b('0x2e')]=function(_0x526069,_0x2bf47c){var _0xda0566={},_0x3544c1={},_0x106daf={'count':0x0,'rows':[]};var _0x52d298=_[_0x708b('0x2f')](db[_0x708b('0x30')][_0x708b('0x31')],function(_0x4bb62e){return{'name':_0x4bb62e[_0x708b('0x32')],'type':_0x4bb62e[_0x708b('0x33')][_0x708b('0x34')]};});_0x3544c1[_0x708b('0x35')]=_[_0x708b('0x2f')](_0x52d298,'name');_0x3544c1['query']=_[_0x708b('0x36')](_0x526069['query']);_0x3544c1['filters']=_['intersection'](_0x3544c1[_0x708b('0x35')],_0x3544c1[_0x708b('0x37')]);_0xda0566[_0x708b('0x38')]=_[_0x708b('0x39')](_0x3544c1[_0x708b('0x35')],qs[_0x708b('0x3a')](_0x526069[_0x708b('0x37')]['fields']));_0xda0566[_0x708b('0x38')]=_0xda0566[_0x708b('0x38')][_0x708b('0x3b')]?_0xda0566[_0x708b('0x38')]:_0x3544c1[_0x708b('0x35')];if(!_0x526069[_0x708b('0x37')][_0x708b('0x3c')](_0x708b('0x3d'))){_0xda0566[_0x708b('0x21')]=qs['limit'](_0x526069[_0x708b('0x37')][_0x708b('0x21')]);_0xda0566[_0x708b('0x1f')]=qs[_0x708b('0x1f')](_0x526069['query'][_0x708b('0x1f')]);}_0xda0566[_0x708b('0x3e')]=qs['sort'](_0x526069['query'][_0x708b('0x3f')]);_0xda0566[_0x708b('0x40')]=qs[_0x708b('0x41')](_[_0x708b('0x42')](_0x526069[_0x708b('0x37')],_0x3544c1[_0x708b('0x41')]),_0x52d298);if(_0x526069[_0x708b('0x37')]['filter']){_0xda0566[_0x708b('0x40')]=_[_0x708b('0x43')](_0xda0566[_0x708b('0x40')],{'$or':_[_0x708b('0x2f')](_0x52d298,function(_0x45c049){if(_0x45c049[_0x708b('0x33')]!=='VIRTUAL'){var _0x530208={};_0x530208[_0x45c049['name']]={'$like':'%'+_0x526069[_0x708b('0x37')]['filter']+'%'};return _0x530208;}})});}_0xda0566=_['merge']({},_0xda0566,_0x526069[_0x708b('0x44')]);var _0x46d477={'where':_0xda0566[_0x708b('0x40')]};return db['VoiceDialReport'][_0x708b('0x22')](_0x46d477)[_0x708b('0x29')](function(_0x4502a9){_0x106daf['count']=_0x4502a9;if(_0x526069[_0x708b('0x37')]['includeAll']){_0xda0566['include']=[{'all':!![]}];}return db['VoiceDialReport']['findAll'](_0xda0566);})['then'](function(_0x5a462a){_0x106daf['rows']=_0x5a462a;return _0x106daf;})['then'](respondWithFilteredResult(_0x2bf47c,_0xda0566))[_0x708b('0x45')](handleError(_0x2bf47c,null));};exports['show']=function(_0x797de2,_0x8dc35c){var _0x54ae7a={'raw':!![],'where':{'id':_0x797de2[_0x708b('0x46')]['id']}},_0x391c40={};_0x391c40[_0x708b('0x35')]=_['keys'](db['VoiceDialReport']['rawAttributes']);_0x391c40[_0x708b('0x37')]=_[_0x708b('0x36')](_0x797de2['query']);_0x391c40[_0x708b('0x41')]=_[_0x708b('0x39')](_0x391c40['model'],_0x391c40[_0x708b('0x37')]);_0x54ae7a[_0x708b('0x38')]=_[_0x708b('0x39')](_0x391c40['model'],qs[_0x708b('0x3a')](_0x797de2[_0x708b('0x37')]['fields']));_0x54ae7a[_0x708b('0x38')]=_0x54ae7a[_0x708b('0x38')][_0x708b('0x3b')]?_0x54ae7a[_0x708b('0x38')]:_0x391c40[_0x708b('0x35')];if(_0x797de2[_0x708b('0x37')]['includeAll']){_0x54ae7a[_0x708b('0x47')]=[{'all':!![]}];}_0x54ae7a=_[_0x708b('0x43')]({},_0x54ae7a,_0x797de2[_0x708b('0x44')]);return db['VoiceDialReport']['find'](_0x54ae7a)[_0x708b('0x29')](handleEntityNotFound(_0x8dc35c,null))[_0x708b('0x29')](respondWithResult(_0x8dc35c,null))[_0x708b('0x45')](handleError(_0x8dc35c,null));};exports[_0x708b('0x48')]=function(_0x5e6884,_0x2af121){return db[_0x708b('0x30')][_0x708b('0x48')](_0x5e6884['body'],{})[_0x708b('0x29')](respondWithResult(_0x2af121,0xc9))[_0x708b('0x45')](handleError(_0x2af121,null));};exports[_0x708b('0x28')]=function(_0x21a766,_0x53357b){if(_0x21a766['body']['id']){delete _0x21a766['body']['id'];}return db[_0x708b('0x30')][_0x708b('0x49')]({'where':{'id':_0x21a766[_0x708b('0x46')]['id']}})[_0x708b('0x29')](handleEntityNotFound(_0x53357b,null))[_0x708b('0x29')](saveUpdates(_0x21a766[_0x708b('0x4a')],null))['then'](respondWithResult(_0x53357b,null))['catch'](handleError(_0x53357b,null));};exports[_0x708b('0x2a')]=function(_0x552a90,_0x352810){return db[_0x708b('0x30')][_0x708b('0x49')]({'where':{'id':_0x552a90[_0x708b('0x46')]['id']}})[_0x708b('0x29')](handleEntityNotFound(_0x352810,null))['then'](removeEntity(_0x352810,null))[_0x708b('0x45')](handleError(_0x352810,null));};exports[_0x708b('0x4b')]=function(_0x4a643e,_0xd4f386){return db[_0x708b('0x30')]['describe']()['then'](respondWithResult(_0xd4f386,null))[_0x708b('0x45')](handleError(_0xd4f386,null));}; \ No newline at end of file +var _0x90c9=['findAll','rows','catch','show','params','keys','include','options','create','body','update','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','reject','save','then','destroy','error','stack','name','index','map','VoiceDialReport','rawAttributes','type','key','query','filters','intersection','model','attributes','fields','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll'];(function(_0xc7132e,_0x53f62f){var _0x5db9f4=function(_0x1aaf28){while(--_0x1aaf28){_0xc7132e['push'](_0xc7132e['shift']());}};_0x5db9f4(++_0x53f62f);}(_0x90c9,0x139));var _0x990c=function(_0x401531,_0x582a70){_0x401531=_0x401531-0x0;var _0x51b83c=_0x90c9[_0x401531];return _0x51b83c;};'use strict';var emlformat=require(_0x990c('0x0'));var rimraf=require(_0x990c('0x1'));var zipdir=require(_0x990c('0x2'));var jsonpatch=require(_0x990c('0x3'));var rp=require(_0x990c('0x4'));var moment=require(_0x990c('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x990c('0x6'));var util=require('util');var path=require('path');var sox=require(_0x990c('0x7'));var csv=require('to-csv');var ejs=require(_0x990c('0x8'));var fs=require('fs');var fs_extra=require(_0x990c('0x9'));var _=require(_0x990c('0xa'));var squel=require(_0x990c('0xb'));var crypto=require(_0x990c('0xc'));var jsforce=require(_0x990c('0xd'));var deskjs=require(_0x990c('0xe'));var toCsv=require(_0x990c('0xf'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x990c('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x990c('0x11'));var as=require(_0x990c('0x12'));var hardwareService=require(_0x990c('0x13'));var logger=require(_0x990c('0x14'))(_0x990c('0x15'));var utils=require('../../config/utils');var config=require(_0x990c('0x16'));var licenseUtil=require(_0x990c('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x7331ce,_0x23ed0e){_0x23ed0e=_0x23ed0e||0xcc;return function(_0x5b3948){if(_0x5b3948){return _0x7331ce[_0x990c('0x18')](_0x23ed0e);}return _0x7331ce[_0x990c('0x19')](_0x23ed0e)[_0x990c('0x1a')]();};}function respondWithResult(_0x252400,_0x155749){_0x155749=_0x155749||0xc8;return function(_0x32d851){if(_0x32d851){return _0x252400[_0x990c('0x19')](_0x155749)['json'](_0x32d851);}};}function respondWithFilteredResult(_0x16e87c,_0xbf69e2){return function(_0x56934b){if(_0x56934b){var _0x3f3a7b=typeof _0xbf69e2[_0x990c('0x1b')]==='undefined'&&typeof _0xbf69e2[_0x990c('0x1c')]===_0x990c('0x1d');var _0x2e7e0e=_0x56934b[_0x990c('0x1e')];var _0x35cb7f=_0x3f3a7b?0x0:_0xbf69e2[_0x990c('0x1b')];var _0x2c3c4e=_0x3f3a7b?_0x56934b[_0x990c('0x1e')]:_0xbf69e2['offset']+_0xbf69e2[_0x990c('0x1c')];var _0x5e0f32;if(_0x2c3c4e>=_0x2e7e0e){_0x2c3c4e=_0x2e7e0e;_0x5e0f32=0xc8;}else{_0x5e0f32=0xce;}_0x16e87c[_0x990c('0x19')](_0x5e0f32);return _0x16e87c[_0x990c('0x1f')](_0x990c('0x20'),_0x35cb7f+'-'+_0x2c3c4e+'/'+_0x2e7e0e)[_0x990c('0x21')](_0x56934b);}return null;};}function patchUpdates(_0x5a62a2){return function(_0x4261f9){try{jsonpatch[_0x990c('0x22')](_0x4261f9,_0x5a62a2,!![]);}catch(_0x5b2c7a){return BPromise[_0x990c('0x23')](_0x5b2c7a);}return _0x4261f9[_0x990c('0x24')]();};}function saveUpdates(_0x35b6a5,_0x5df32e){return function(_0x36048c){if(_0x36048c){return _0x36048c['update'](_0x35b6a5)[_0x990c('0x25')](function(_0x238d8e){return _0x238d8e;});}return null;};}function removeEntity(_0x5db05c,_0x3a29c7){return function(_0x1f60c6){if(_0x1f60c6){return _0x1f60c6[_0x990c('0x26')]()['then'](function(){_0x5db05c['status'](0xcc)[_0x990c('0x1a')]();});}};}function handleEntityNotFound(_0xbc87e3,_0x24caa8){return function(_0x7465cb){if(!_0x7465cb){_0xbc87e3[_0x990c('0x18')](0x194);}return _0x7465cb;};}function handleError(_0x4bc808,_0x3589f0){_0x3589f0=_0x3589f0||0x1f4;return function(_0x27bbec){logger[_0x990c('0x27')](_0x27bbec[_0x990c('0x28')]);if(_0x27bbec[_0x990c('0x29')]){delete _0x27bbec[_0x990c('0x29')];}_0x4bc808[_0x990c('0x19')](_0x3589f0)['send'](_0x27bbec);};}exports[_0x990c('0x2a')]=function(_0xe3bb7c,_0x2e91e2){var _0x25bbab={},_0x4b94c9={},_0x474942={'count':0x0,'rows':[]};var _0x15121e=_[_0x990c('0x2b')](db[_0x990c('0x2c')][_0x990c('0x2d')],function(_0x45195f){return{'name':_0x45195f['fieldName'],'type':_0x45195f[_0x990c('0x2e')][_0x990c('0x2f')]};});_0x4b94c9['model']=_[_0x990c('0x2b')](_0x15121e,_0x990c('0x29'));_0x4b94c9['query']=_['keys'](_0xe3bb7c[_0x990c('0x30')]);_0x4b94c9[_0x990c('0x31')]=_[_0x990c('0x32')](_0x4b94c9[_0x990c('0x33')],_0x4b94c9[_0x990c('0x30')]);_0x25bbab[_0x990c('0x34')]=_['intersection'](_0x4b94c9[_0x990c('0x33')],qs['fields'](_0xe3bb7c['query'][_0x990c('0x35')]));_0x25bbab[_0x990c('0x34')]=_0x25bbab[_0x990c('0x34')]['length']?_0x25bbab['attributes']:_0x4b94c9[_0x990c('0x33')];if(!_0xe3bb7c[_0x990c('0x30')]['hasOwnProperty'](_0x990c('0x36'))){_0x25bbab['limit']=qs['limit'](_0xe3bb7c[_0x990c('0x30')][_0x990c('0x1c')]);_0x25bbab[_0x990c('0x1b')]=qs['offset'](_0xe3bb7c['query'][_0x990c('0x1b')]);}_0x25bbab['order']=qs[_0x990c('0x37')](_0xe3bb7c[_0x990c('0x30')]['sort']);_0x25bbab[_0x990c('0x38')]=qs[_0x990c('0x31')](_[_0x990c('0x39')](_0xe3bb7c[_0x990c('0x30')],_0x4b94c9['filters']),_0x15121e);if(_0xe3bb7c[_0x990c('0x30')][_0x990c('0x3a')]){_0x25bbab['where']=_[_0x990c('0x3b')](_0x25bbab[_0x990c('0x38')],{'$or':_[_0x990c('0x2b')](_0x15121e,function(_0x43d7f5){if(_0x43d7f5[_0x990c('0x2e')]!==_0x990c('0x3c')){var _0x5c8f28={};_0x5c8f28[_0x43d7f5['name']]={'$like':'%'+_0xe3bb7c[_0x990c('0x30')][_0x990c('0x3a')]+'%'};return _0x5c8f28;}})});}_0x25bbab=_[_0x990c('0x3b')]({},_0x25bbab,_0xe3bb7c['options']);var _0x51e617={'where':_0x25bbab[_0x990c('0x38')]};return db[_0x990c('0x2c')][_0x990c('0x1e')](_0x51e617)['then'](function(_0xccf48b){_0x474942[_0x990c('0x1e')]=_0xccf48b;if(_0xe3bb7c[_0x990c('0x30')][_0x990c('0x3d')]){_0x25bbab['include']=[{'all':!![]}];}return db[_0x990c('0x2c')][_0x990c('0x3e')](_0x25bbab);})[_0x990c('0x25')](function(_0x498848){_0x474942[_0x990c('0x3f')]=_0x498848;return _0x474942;})[_0x990c('0x25')](respondWithFilteredResult(_0x2e91e2,_0x25bbab))[_0x990c('0x40')](handleError(_0x2e91e2,null));};exports[_0x990c('0x41')]=function(_0x11e762,_0x48df01){var _0x465c39={'raw':!![],'where':{'id':_0x11e762[_0x990c('0x42')]['id']}},_0x388309={};_0x388309[_0x990c('0x33')]=_[_0x990c('0x43')](db[_0x990c('0x2c')]['rawAttributes']);_0x388309['query']=_[_0x990c('0x43')](_0x11e762[_0x990c('0x30')]);_0x388309[_0x990c('0x31')]=_[_0x990c('0x32')](_0x388309[_0x990c('0x33')],_0x388309['query']);_0x465c39[_0x990c('0x34')]=_[_0x990c('0x32')](_0x388309[_0x990c('0x33')],qs[_0x990c('0x35')](_0x11e762[_0x990c('0x30')]['fields']));_0x465c39['attributes']=_0x465c39[_0x990c('0x34')]['length']?_0x465c39[_0x990c('0x34')]:_0x388309[_0x990c('0x33')];if(_0x11e762['query']['includeAll']){_0x465c39[_0x990c('0x44')]=[{'all':!![]}];}_0x465c39=_['merge']({},_0x465c39,_0x11e762[_0x990c('0x45')]);return db[_0x990c('0x2c')]['find'](_0x465c39)['then'](handleEntityNotFound(_0x48df01,null))[_0x990c('0x25')](respondWithResult(_0x48df01,null))['catch'](handleError(_0x48df01,null));};exports[_0x990c('0x46')]=function(_0x355f2a,_0x56255d){return db[_0x990c('0x2c')][_0x990c('0x46')](_0x355f2a[_0x990c('0x47')],{})[_0x990c('0x25')](respondWithResult(_0x56255d,0xc9))['catch'](handleError(_0x56255d,null));};exports[_0x990c('0x48')]=function(_0x54bfec,_0x3f9f56){if(_0x54bfec['body']['id']){delete _0x54bfec['body']['id'];}return db['VoiceDialReport'][_0x990c('0x49')]({'where':{'id':_0x54bfec['params']['id']}})[_0x990c('0x25')](handleEntityNotFound(_0x3f9f56,null))[_0x990c('0x25')](saveUpdates(_0x54bfec[_0x990c('0x47')],null))[_0x990c('0x25')](respondWithResult(_0x3f9f56,null))['catch'](handleError(_0x3f9f56,null));};exports['destroy']=function(_0x255ce3,_0x5b0ada){return db[_0x990c('0x2c')]['find']({'where':{'id':_0x255ce3[_0x990c('0x42')]['id']}})[_0x990c('0x25')](handleEntityNotFound(_0x5b0ada,null))[_0x990c('0x25')](removeEntity(_0x5b0ada,null))[_0x990c('0x40')](handleError(_0x5b0ada,null));};exports[_0x990c('0x4a')]=function(_0x4ccbae,_0x20ab9b){return db[_0x990c('0x2c')][_0x990c('0x4a')]()[_0x990c('0x25')](respondWithResult(_0x20ab9b,null))[_0x990c('0x40')](handleError(_0x20ab9b,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index 08866d9..c9b7786 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 _0x2eb1=['path','../../config/environment','exports','define','VoiceDialReport','report_dial','uniqueid','lodash','util','api','moment','bluebird','request-promise'];(function(_0x5a9788,_0x1768ef){var _0x2c513b=function(_0x4e18cd){while(--_0x4e18cd){_0x5a9788['push'](_0x5a9788['shift']());}};_0x2c513b(++_0x1768ef);}(_0x2eb1,0xb0));var _0x12eb=function(_0x3a09ea,_0x45b8f4){_0x3a09ea=_0x3a09ea-0x0;var _0x1e2d27=_0x2eb1[_0x3a09ea];return _0x1e2d27;};'use strict';var _=require(_0x12eb('0x0'));var util=require(_0x12eb('0x1'));var logger=require('../../config/logger')(_0x12eb('0x2'));var moment=require(_0x12eb('0x3'));var BPromise=require(_0x12eb('0x4'));var rp=require(_0x12eb('0x5'));var fs=require('fs');var path=require(_0x12eb('0x6'));var rimraf=require('rimraf');var config=require(_0x12eb('0x7'));var attributes=require('./voiceDialReport.attributes');module[_0x12eb('0x8')]=function(_0x261315,_0x19cdd2){return _0x261315[_0x12eb('0x9')](_0x12eb('0xa'),attributes,{'tableName':_0x12eb('0xb'),'paranoid':![],'indexes':[{'fields':[_0x12eb('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x254a=['../../config/environment','exports','report_dial','uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x3e62b5,_0x5f4f72){var _0x5ea773=function(_0x2f5a6f){while(--_0x2f5a6f){_0x3e62b5['push'](_0x3e62b5['shift']());}};_0x5ea773(++_0x5f4f72);}(_0x254a,0x138));var _0xa254=function(_0x4c836d,_0x144891){_0x4c836d=_0x4c836d-0x0;var _0x299319=_0x254a[_0x4c836d];return _0x299319;};'use strict';var _=require(_0xa254('0x0'));var util=require(_0xa254('0x1'));var logger=require(_0xa254('0x2'))('api');var moment=require(_0xa254('0x3'));var BPromise=require(_0xa254('0x4'));var rp=require(_0xa254('0x5'));var fs=require('fs');var path=require(_0xa254('0x6'));var rimraf=require('rimraf');var config=require(_0xa254('0x7'));var attributes=require('./voiceDialReport.attributes');module[_0xa254('0x8')]=function(_0x3d5886,_0x1201ae){return _0x3d5886['define']('VoiceDialReport',attributes,{'tableName':_0xa254('0x9'),'paranoid':![],'indexes':[{'fields':[_0xa254('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index 5cadf04..33b37ad 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 _0xc181=['limit','UpdateVoiceDialReport','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','result','message','catch','CreateVoiceDialReport','VoiceDialReport','create','body','options','raw','update','where','attributes'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xc181,0x183));var _0x1c18=function(_0x8fa4bc,_0x5cd2af){_0x8fa4bc=_0x8fa4bc-0x0;var _0x35b6a7=_0xc181[_0x8fa4bc];return _0x35b6a7;};'use strict';var _=require(_0x1c18('0x0'));var util=require(_0x1c18('0x1'));var moment=require(_0x1c18('0x2'));var BPromise=require(_0x1c18('0x3'));var rs=require(_0x1c18('0x4'));var fs=require('fs');var Redis=require(_0x1c18('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x1c18('0x6'));var logger=require(_0x1c18('0x7'))(_0x1c18('0x8'));var config=require(_0x1c18('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x1c18('0xa')][_0x1c18('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3cb558,_0x1d4083,_0x6822e8){return new BPromise(function(_0x153bd4,_0x65fb24){return client[_0x1c18('0xc')](_0x3cb558,_0x6822e8)[_0x1c18('0xd')](function(_0x90d2d3){logger[_0x1c18('0xe')](_0x1c18('0xf'),_0x1d4083,_0x1c18('0x10'));logger[_0x1c18('0x11')](_0x1c18('0x12'),_0x1d4083,_0x1c18('0x10'),JSON[_0x1c18('0x13')](_0x90d2d3));if(_0x90d2d3[_0x1c18('0x14')]){if(_0x90d2d3[_0x1c18('0x14')]['code']===0x1f4){logger['error']('VoiceDialReport,\x20%s,\x20%s',_0x1d4083,_0x90d2d3[_0x1c18('0x14')]['message']);return _0x65fb24(_0x90d2d3[_0x1c18('0x14')]['message']);}logger[_0x1c18('0x14')](_0x1c18('0xf'),_0x1d4083,_0x90d2d3['error']['message']);return _0x153bd4(_0x90d2d3[_0x1c18('0x14')]['message']);}else{logger[_0x1c18('0xe')]('VoiceDialReport,\x20%s,\x20%s',_0x1d4083,_0x1c18('0x10'));_0x153bd4(_0x90d2d3[_0x1c18('0x15')][_0x1c18('0x16')]);}})[_0x1c18('0x17')](function(_0x5eabdd){logger['error'](_0x1c18('0xf'),_0x1d4083,_0x5eabdd);_0x65fb24(_0x5eabdd);});});}exports[_0x1c18('0x18')]=function(_0x33db88){var _0x88aebe=this;return new Promise(function(_0xc1d06f,_0x9bafdc){return db[_0x1c18('0x19')][_0x1c18('0x1a')](_0x33db88[_0x1c18('0x1b')],{'raw':_0x33db88[_0x1c18('0x1c')]?_0x33db88[_0x1c18('0x1c')][_0x1c18('0x1d')]===undefined?!![]:![]:!![]})[_0x1c18('0xd')](function(_0x22549b){logger['info'](_0x1c18('0x18'),_0x33db88);logger[_0x1c18('0x11')](_0x1c18('0x18'),_0x33db88,JSON['stringify'](_0x22549b));_0xc1d06f(_0x22549b);})[_0x1c18('0x17')](function(_0x3d4e77){logger[_0x1c18('0x14')]('CreateVoiceDialReport',_0x3d4e77[_0x1c18('0x16')],_0x33db88);_0x9bafdc(_0x88aebe[_0x1c18('0x14')](0x1f4,_0x3d4e77[_0x1c18('0x16')]));});});};exports['UpdateVoiceDialReport']=function(_0x121ef1){var _0x19b7c5=this;return new Promise(function(_0x5cf141,_0x2fed65){return db[_0x1c18('0x19')][_0x1c18('0x1e')](_0x121ef1[_0x1c18('0x1b')],{'raw':_0x121ef1[_0x1c18('0x1c')]?_0x121ef1['options'][_0x1c18('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x121ef1[_0x1c18('0x1c')]?_0x121ef1['options'][_0x1c18('0x1f')]||null:null,'attributes':_0x121ef1[_0x1c18('0x1c')]?_0x121ef1['options'][_0x1c18('0x20')]||null:null,'limit':_0x121ef1[_0x1c18('0x1c')]?_0x121ef1[_0x1c18('0x1c')][_0x1c18('0x21')]||null:null})[_0x1c18('0xd')](function(_0x1d2ed7){logger[_0x1c18('0xe')](_0x1c18('0x22'),_0x121ef1);logger[_0x1c18('0x11')]('UpdateVoiceDialReport',_0x121ef1,JSON[_0x1c18('0x13')](_0x1d2ed7));_0x5cf141(_0x1d2ed7);})[_0x1c18('0x17')](function(_0x6e276d){logger[_0x1c18('0x14')]('UpdateVoiceDialReport',_0x6e276d[_0x1c18('0x16')],_0x121ef1);_0x2fed65(_0x19b7c5['error'](0x1f4,_0x6e276d[_0x1c18('0x16')]));});});}; \ No newline at end of file +var _0x79a3=['request','then','info','request\x20sent','debug','error','code','message','VoiceDialReport,\x20%s,\x20%s','result','catch','VoiceDialReport','create','options','raw','CreateVoiceDialReport','stringify','UpdateVoiceDialReport','where','attributes','limit','util','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x2f9587,_0xefd444){var _0xdb16e4=function(_0x18ec54){while(--_0x18ec54){_0x2f9587['push'](_0x2f9587['shift']());}};_0xdb16e4(++_0xefd444);}(_0x79a3,0x69));var _0x379a=function(_0x3637f1,_0x4aa045){_0x3637f1=_0x3637f1-0x0;var _0x13519b=_0x79a3[_0x3637f1];return _0x13519b;};'use strict';var _=require('lodash');var util=require(_0x379a('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x379a('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x379a('0x2'))['db'];var utils=require(_0x379a('0x3'));var logger=require('../../config/logger')(_0x379a('0x4'));var config=require(_0x379a('0x5'));var jayson=require(_0x379a('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x32312f,_0x1f1968,_0x1035d6){return new BPromise(function(_0x361386,_0x145ec9){return client[_0x379a('0x7')](_0x32312f,_0x1035d6)[_0x379a('0x8')](function(_0x50faf9){logger[_0x379a('0x9')]('VoiceDialReport,\x20%s,\x20%s',_0x1f1968,_0x379a('0xa'));logger[_0x379a('0xb')]('VoiceDialReport,\x20%s,\x20%s,\x20%s',_0x1f1968,'request\x20sent',JSON['stringify'](_0x50faf9));if(_0x50faf9[_0x379a('0xc')]){if(_0x50faf9[_0x379a('0xc')][_0x379a('0xd')]===0x1f4){logger[_0x379a('0xc')]('VoiceDialReport,\x20%s,\x20%s',_0x1f1968,_0x50faf9[_0x379a('0xc')][_0x379a('0xe')]);return _0x145ec9(_0x50faf9[_0x379a('0xc')][_0x379a('0xe')]);}logger[_0x379a('0xc')](_0x379a('0xf'),_0x1f1968,_0x50faf9[_0x379a('0xc')]['message']);return _0x361386(_0x50faf9[_0x379a('0xc')]['message']);}else{logger[_0x379a('0x9')](_0x379a('0xf'),_0x1f1968,_0x379a('0xa'));_0x361386(_0x50faf9[_0x379a('0x10')][_0x379a('0xe')]);}})[_0x379a('0x11')](function(_0x2294b5){logger[_0x379a('0xc')]('VoiceDialReport,\x20%s,\x20%s',_0x1f1968,_0x2294b5);_0x145ec9(_0x2294b5);});});}exports['CreateVoiceDialReport']=function(_0x4bcf1f){var _0x1c2056=this;return new Promise(function(_0x599824,_0x287d5d){return db[_0x379a('0x12')][_0x379a('0x13')](_0x4bcf1f['body'],{'raw':_0x4bcf1f[_0x379a('0x14')]?_0x4bcf1f['options'][_0x379a('0x15')]===undefined?!![]:![]:!![]})[_0x379a('0x8')](function(_0xfae20b){logger[_0x379a('0x9')]('CreateVoiceDialReport',_0x4bcf1f);logger['debug'](_0x379a('0x16'),_0x4bcf1f,JSON[_0x379a('0x17')](_0xfae20b));_0x599824(_0xfae20b);})[_0x379a('0x11')](function(_0x4d5227){logger[_0x379a('0xc')](_0x379a('0x16'),_0x4d5227[_0x379a('0xe')],_0x4bcf1f);_0x287d5d(_0x1c2056[_0x379a('0xc')](0x1f4,_0x4d5227['message']));});});};exports[_0x379a('0x18')]=function(_0x8dae5d){var _0x143df3=this;return new Promise(function(_0x144581,_0x52ffad){return db['VoiceDialReport']['update'](_0x8dae5d['body'],{'raw':_0x8dae5d[_0x379a('0x14')]?_0x8dae5d[_0x379a('0x14')][_0x379a('0x15')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x8dae5d['options']?_0x8dae5d['options'][_0x379a('0x19')]||null:null,'attributes':_0x8dae5d[_0x379a('0x14')]?_0x8dae5d['options'][_0x379a('0x1a')]||null:null,'limit':_0x8dae5d['options']?_0x8dae5d[_0x379a('0x14')][_0x379a('0x1b')]||null:null})[_0x379a('0x8')](function(_0x2caafb){logger[_0x379a('0x9')](_0x379a('0x18'),_0x8dae5d);logger[_0x379a('0xb')](_0x379a('0x18'),_0x8dae5d,JSON[_0x379a('0x17')](_0x2caafb));_0x144581(_0x2caafb);})[_0x379a('0x11')](function(_0x3c3ee7){logger['error'](_0x379a('0x18'),_0x3c3ee7[_0x379a('0xe')],_0x8dae5d);_0x52ffad(_0x143df3['error'](0x1f4,_0x3c3ee7[_0x379a('0xe')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index 250cf5b..9d49c93 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 _0x2295=['create','/:id/applications','isAuthenticated','addApplications','put','delete','destroy','connect-timeout','express','get','/:id','post'];(function(_0x36a94f,_0x3fcc6c){var _0x4ba69f=function(_0x362371){while(--_0x362371){_0x36a94f['push'](_0x36a94f['shift']());}};_0x4ba69f(++_0x3fcc6c);}(_0x2295,0x1f3));var _0x5229=function(_0x1b3825,_0x30dfab){_0x1b3825=_0x1b3825-0x0;var _0x21c16b=_0x2295[_0x1b3825];return _0x21c16b;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x5229('0x0'));var express=require(_0x5229('0x1'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./voiceExtension.controller');router[_0x5229('0x2')]('/',auth['isAuthenticated'](),controller['index']);router[_0x5229('0x2')](_0x5229('0x3'),auth['isAuthenticated'](),controller['show']);router[_0x5229('0x4')]('/',auth['isAuthenticated'](),controller[_0x5229('0x5')]);router[_0x5229('0x4')](_0x5229('0x6'),auth[_0x5229('0x7')](),controller[_0x5229('0x8')]);router[_0x5229('0x9')](_0x5229('0x3'),auth[_0x5229('0x7')](),controller['update']);router[_0x5229('0xa')](_0x5229('0x3'),auth[_0x5229('0x7')](),controller[_0x5229('0xb')]);module['exports']=router; \ No newline at end of file +var _0xbcf2=['update','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceExtension.controller','get','isAuthenticated','index','/:id','show','post','create','/:id/applications','put'];(function(_0x314412,_0x24a728){var _0x125fed=function(_0xd1a959){while(--_0xd1a959){_0x314412['push'](_0x314412['shift']());}};_0x125fed(++_0x24a728);}(_0xbcf2,0xbf));var _0x2bcf=function(_0x5de6c9,_0x471538){_0x5de6c9=_0x5de6c9-0x0;var _0x4f45f6=_0xbcf2[_0x5de6c9];return _0x4f45f6;};'use strict';var multer=require(_0x2bcf('0x0'));var util=require(_0x2bcf('0x1'));var path=require('path');var timeout=require(_0x2bcf('0x2'));var express=require(_0x2bcf('0x3'));var router=express[_0x2bcf('0x4')]();var fs_extra=require(_0x2bcf('0x5'));var auth=require(_0x2bcf('0x6'));var interaction=require(_0x2bcf('0x7'));var config=require(_0x2bcf('0x8'));var controller=require(_0x2bcf('0x9'));router[_0x2bcf('0xa')]('/',auth[_0x2bcf('0xb')](),controller[_0x2bcf('0xc')]);router[_0x2bcf('0xa')](_0x2bcf('0xd'),auth[_0x2bcf('0xb')](),controller[_0x2bcf('0xe')]);router[_0x2bcf('0xf')]('/',auth['isAuthenticated'](),controller[_0x2bcf('0x10')]);router[_0x2bcf('0xf')](_0x2bcf('0x11'),auth[_0x2bcf('0xb')](),controller['addApplications']);router[_0x2bcf('0x12')](_0x2bcf('0xd'),auth[_0x2bcf('0xb')](),controller[_0x2bcf('0x13')]);router['delete'](_0x2bcf('0xd'),auth['isAuthenticated'](),controller['destroy']);module[_0x2bcf('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index cbea2de..a897cb8 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 _0xdbf0=['BOOLEAN','exten','sequelize','exports','STRING','compositeIndex','NoOp','ENUM','inbound','outbound','internal','inbound-fax','system','any','*,*,*,*','INTEGER'];(function(_0xce35b0,_0x54dc88){var _0x3c7d3a=function(_0x4dd36d){while(--_0x4dd36d){_0xce35b0['push'](_0xce35b0['shift']());}};_0x3c7d3a(++_0x54dc88);}(_0xdbf0,0x162));var _0x0dbf=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0xdbf0[_0x3e5086];return _0xfeb102;};'use strict';var Sequelize=require(_0x0dbf('0x0'));module[_0x0dbf('0x1')]={'context':{'type':Sequelize[_0x0dbf('0x2')],'allowNull':![],'unique':_0x0dbf('0x3'),'validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x0dbf('0x2')],'allowNull':![],'unique':_0x0dbf('0x3')},'priority':{'type':Sequelize[_0x0dbf('0x2')],'allowNull':![],'defaultValue':'1','unique':'compositeIndex'},'tag':{'type':Sequelize[_0x0dbf('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x0dbf('0x2')],'allowNull':![],'defaultValue':_0x0dbf('0x4')},'appdata':{'type':Sequelize[_0x0dbf('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x0dbf('0x5')](_0x0dbf('0x6'),_0x0dbf('0x7'),_0x0dbf('0x8'),_0x0dbf('0x9'),'outbound-fax',_0x0dbf('0xa'),_0x0dbf('0xb')),'allowNull':![]},'description':{'type':Sequelize[_0x0dbf('0x2')]},'interval':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x0dbf('0xc')},'IntervalId':{'type':Sequelize[_0x0dbf('0xd')]},'isApp':{'type':Sequelize[_0x0dbf('0xe')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x0dbf('0x2')],'defaultValue':null},'callerID':{'type':Sequelize[_0x0dbf('0x2')],'allowNull':!![]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x0dbf('0xd')]},'recordingFormat':{'type':Sequelize[_0x0dbf('0x2')],'defaultValue':'wav'},'answer':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x51fab3){return this['getDataValue'](_0x0dbf('0xf'));}},'alias':{'type':Sequelize[_0x0dbf('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0x2df4=['compositeIndex','ENUM','inbound','outbound','internal','inbound-fax','outbound-fax','system','any','*,*,*,*','INTEGER','BOOLEAN','getDataValue','exten','sequelize','exports','STRING'];(function(_0x468af7,_0xe49fc9){var _0x20f6ad=function(_0x3146c1){while(--_0x3146c1){_0x468af7['push'](_0x468af7['shift']());}};_0x20f6ad(++_0xe49fc9);}(_0x2df4,0xa7));var _0x42df=function(_0x15cae3,_0x458cb9){_0x15cae3=_0x15cae3-0x0;var _0x20596f=_0x2df4[_0x15cae3];return _0x20596f;};'use strict';var Sequelize=require(_0x42df('0x0'));module[_0x42df('0x1')]={'context':{'type':Sequelize[_0x42df('0x2')],'allowNull':![],'unique':'compositeIndex','validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize[_0x42df('0x2')],'allowNull':![],'unique':_0x42df('0x3')},'priority':{'type':Sequelize[_0x42df('0x2')],'allowNull':![],'defaultValue':'1','unique':'compositeIndex'},'tag':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x42df('0x2')],'allowNull':![],'defaultValue':'NoOp'},'appdata':{'type':Sequelize['STRING'](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize[_0x42df('0x4')](_0x42df('0x5'),_0x42df('0x6'),_0x42df('0x7'),_0x42df('0x8'),_0x42df('0x9'),_0x42df('0xa'),_0x42df('0xb')),'allowNull':![]},'description':{'type':Sequelize[_0x42df('0x2')]},'interval':{'type':Sequelize[_0x42df('0x2')],'allowNull':![],'defaultValue':_0x42df('0xc')},'IntervalId':{'type':Sequelize[_0x42df('0xd')]},'isApp':{'type':Sequelize[_0x42df('0xe')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x42df('0x2')],'defaultValue':null},'callerID':{'type':Sequelize[_0x42df('0x2')],'allowNull':!![]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'cutdigits':{'type':Sequelize[_0x42df('0xd')]},'recordingFormat':{'type':Sequelize['STRING'],'defaultValue':'wav'},'answer':{'type':Sequelize[_0x42df('0xe')],'defaultValue':!![]},'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x28542b){return this[_0x42df('0xf')](_0x42df('0x10'));}},'alias':{'type':Sequelize[_0x42df('0x2')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index fc32b75..50130bf 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 _0x28a5=['findAll','rows','catch','show','params','includeAll','include','body','exten','concat','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','OutboundRoutes','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','description','recordingFormat','cutdigits','mandatoryDisposition','context','addApplications','findOne','sequelize','transaction','VoiceExtensionId','isApp','rewriteDial','toLowerCase','bulkCreate','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','reject','destroy','then','get','inbound','outbound','InternalRoutes','internal','filter','ignore','map','value','includes','find','type','name','UserProfileResource','error','stack','send','VoiceExtension','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','merge','where','options'];(function(_0x436570,_0xdf34e4){var _0x5936c3=function(_0x25ba64){while(--_0x25ba64){_0x436570['push'](_0x436570['shift']());}};_0x5936c3(++_0xdf34e4);}(_0x28a5,0x175));var _0x528a=function(_0x5311e8,_0x57c5bb){_0x5311e8=_0x5311e8-0x0;var _0x582ad8=_0x28a5[_0x5311e8];return _0x582ad8;};'use strict';var emlformat=require(_0x528a('0x0'));var rimraf=require(_0x528a('0x1'));var zipdir=require(_0x528a('0x2'));var jsonpatch=require(_0x528a('0x3'));var rp=require(_0x528a('0x4'));var moment=require(_0x528a('0x5'));var BPromise=require(_0x528a('0x6'));var Mustache=require(_0x528a('0x7'));var util=require(_0x528a('0x8'));var path=require(_0x528a('0x9'));var sox=require(_0x528a('0xa'));var csv=require(_0x528a('0xb'));var ejs=require(_0x528a('0xc'));var fs=require('fs');var fs_extra=require(_0x528a('0xd'));var _=require('lodash');var squel=require(_0x528a('0xe'));var crypto=require(_0x528a('0xf'));var jsforce=require(_0x528a('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x528a('0xb'));var querystring=require(_0x528a('0x11'));var Papa=require(_0x528a('0x12'));var Redis=require(_0x528a('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x528a('0x14'));var as=require(_0x528a('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x528a('0x16'));var utils=require(_0x528a('0x17'));var config=require(_0x528a('0x18'));var licenseUtil=require(_0x528a('0x19'));var db=require(_0x528a('0x1a'))['db'];config[_0x528a('0x1b')]=_[_0x528a('0x1c')](config['redis'],{'host':_0x528a('0x1d'),'port':0x18eb});var socket=require(_0x528a('0x1e'))(new Redis(config[_0x528a('0x1b')]));require('./voiceExtension.socket')[_0x528a('0x1f')](socket);function respondWithStatusCode(_0x3c6257,_0x190a47){_0x190a47=_0x190a47||0xcc;return function(_0x4b9089){if(_0x4b9089){return _0x3c6257[_0x528a('0x20')](_0x190a47);}return _0x3c6257[_0x528a('0x21')](_0x190a47)[_0x528a('0x22')]();};}function respondWithResult(_0x409f0f,_0x48854f){_0x48854f=_0x48854f||0xc8;return function(_0x35125f){if(_0x35125f){return _0x409f0f[_0x528a('0x21')](_0x48854f)[_0x528a('0x23')](_0x35125f);}};}function respondWithFilteredResult(_0x589fd4,_0x4636da){return function(_0x4ce97a){if(_0x4ce97a){var _0x5967a5=typeof _0x4636da[_0x528a('0x24')]===_0x528a('0x25')&&typeof _0x4636da['limit']===_0x528a('0x25');var _0x137105=_0x4ce97a[_0x528a('0x26')];var _0x348ea5=_0x5967a5?0x0:_0x4636da['offset'];var _0x53e5f4=_0x5967a5?_0x4ce97a['count']:_0x4636da[_0x528a('0x24')]+_0x4636da[_0x528a('0x27')];var _0x1cf461;if(_0x53e5f4>=_0x137105){_0x53e5f4=_0x137105;_0x1cf461=0xc8;}else{_0x1cf461=0xce;}_0x589fd4[_0x528a('0x21')](_0x1cf461);return _0x589fd4['set'](_0x528a('0x28'),_0x348ea5+'-'+_0x53e5f4+'/'+_0x137105)[_0x528a('0x23')](_0x4ce97a);}return null;};}function patchUpdates(_0x26d2fd){return function(_0x1603ff){try{jsonpatch['apply'](_0x1603ff,_0x26d2fd,!![]);}catch(_0x31f61f){return BPromise[_0x528a('0x29')](_0x31f61f);}return _0x1603ff['save']();};}function saveUpdates(_0x439b8b,_0x155061){return function(_0x3a211a){if(_0x3a211a){return _0x3a211a['update'](_0x439b8b)['then'](function(_0x8d9e29){return _0x8d9e29;});}return null;};}function removeEntity(_0x561b69,_0x2b51f6){return function(_0x521afa){if(_0x521afa){return _0x521afa[_0x528a('0x2a')]()[_0x528a('0x2b')](function(){var _0x1496a0=_0x521afa[_0x528a('0x2c')]({'plain':!![]});var _0x23a067=[{'name':'InboundRoutes','value':_0x528a('0x2d'),'ignore':![]},{'name':'OutboundRoutes','value':_0x528a('0x2e'),'ignore':![]},{'name':_0x528a('0x2f'),'value':_0x528a('0x30'),'ignore':![]}];var _0x1b3f58=_(_0x23a067)[_0x528a('0x31')](_0x528a('0x32'))[_0x528a('0x33')]('value')[_0x528a('0x34')]();if(_[_0x528a('0x35')](_0x1b3f58,_0x1496a0['type'])){return;}var _0x46bb4f=_[_0x528a('0x36')](_0x23a067,[_0x528a('0x34'),_0x1496a0[_0x528a('0x37')]])[_0x528a('0x38')];return db[_0x528a('0x39')][_0x528a('0x2a')]({'where':{'type':_0x46bb4f,'resourceId':_0x1496a0['id']}})[_0x528a('0x2b')](function(){return _0x521afa;});})[_0x528a('0x2b')](function(){_0x561b69[_0x528a('0x21')](0xcc)[_0x528a('0x22')]();});}};}function handleEntityNotFound(_0x527196,_0x23985d){return function(_0x53f057){if(!_0x53f057){_0x527196[_0x528a('0x20')](0x194);}return _0x53f057;};}function handleError(_0xbefe6e,_0x41c745){_0x41c745=_0x41c745||0x1f4;return function(_0x3a725f){logger[_0x528a('0x3a')](_0x3a725f[_0x528a('0x3b')]);if(_0x3a725f['name']){delete _0x3a725f[_0x528a('0x38')];}_0xbefe6e['status'](_0x41c745)[_0x528a('0x3c')](_0x3a725f);};}exports['index']=function(_0xf9abb5,_0x5cd5e5){var _0x363284={},_0x6d23f4={},_0x3c0744={'count':0x0,'rows':[]};var _0x3d6799=_['map'](db[_0x528a('0x3d')][_0x528a('0x3e')],function(_0x8b86a8){return{'name':_0x8b86a8['fieldName'],'type':_0x8b86a8['type'][_0x528a('0x3f')]};});_0x6d23f4[_0x528a('0x40')]=_[_0x528a('0x33')](_0x3d6799,'name');_0x6d23f4[_0x528a('0x41')]=_[_0x528a('0x42')](_0xf9abb5[_0x528a('0x41')]);_0x6d23f4[_0x528a('0x43')]=_[_0x528a('0x44')](_0x6d23f4[_0x528a('0x40')],_0x6d23f4[_0x528a('0x41')]);_0x363284[_0x528a('0x45')]=_[_0x528a('0x44')](_0x6d23f4['model'],qs['fields'](_0xf9abb5[_0x528a('0x41')][_0x528a('0x46')]));_0x363284[_0x528a('0x45')]=_0x363284[_0x528a('0x45')][_0x528a('0x47')]?_0x363284[_0x528a('0x45')]:_0x6d23f4[_0x528a('0x40')];if(!_0xf9abb5['query'][_0x528a('0x48')]('nolimit')){_0x363284[_0x528a('0x27')]=qs[_0x528a('0x27')](_0xf9abb5[_0x528a('0x41')]['limit']);_0x363284['offset']=qs[_0x528a('0x24')](_0xf9abb5[_0x528a('0x41')]['offset']);}_0x363284[_0x528a('0x49')]=qs[_0x528a('0x4a')](_0xf9abb5[_0x528a('0x41')][_0x528a('0x4a')]);_0x363284['where']=qs[_0x528a('0x43')](_[_0x528a('0x4b')](_0xf9abb5[_0x528a('0x41')],_0x6d23f4[_0x528a('0x43')]),_0x3d6799);if(_0xf9abb5['query'][_0x528a('0x31')]){_0x363284['where']=_[_0x528a('0x4c')](_0x363284[_0x528a('0x4d')],{'$or':_['map'](_0x3d6799,function(_0xa2e0a2){if(_0xa2e0a2[_0x528a('0x37')]!=='VIRTUAL'){var _0x26a618={};_0x26a618[_0xa2e0a2[_0x528a('0x38')]]={'$like':'%'+_0xf9abb5['query']['filter']+'%'};return _0x26a618;}})});}_0x363284=_['merge']({},_0x363284,_0xf9abb5[_0x528a('0x4e')]);var _0x1017da={'where':_0x363284['where']};return db[_0x528a('0x3d')]['count'](_0x1017da)[_0x528a('0x2b')](function(_0x29f53a){_0x3c0744[_0x528a('0x26')]=_0x29f53a;if(_0xf9abb5[_0x528a('0x41')]['includeAll']){_0x363284['include']=[{'all':!![]}];}return db[_0x528a('0x3d')][_0x528a('0x4f')](_0x363284);})[_0x528a('0x2b')](function(_0x35cfdf){_0x3c0744[_0x528a('0x50')]=_0x35cfdf;return _0x3c0744;})[_0x528a('0x2b')](respondWithFilteredResult(_0x5cd5e5,_0x363284))[_0x528a('0x51')](handleError(_0x5cd5e5,null));};exports[_0x528a('0x52')]=function(_0x88da53,_0x286b8a){var _0x136ff8={'raw':![],'where':{'id':_0x88da53[_0x528a('0x53')]['id']}},_0x5a6ee5={};_0x5a6ee5[_0x528a('0x40')]=_[_0x528a('0x42')](db[_0x528a('0x3d')][_0x528a('0x3e')]);_0x5a6ee5[_0x528a('0x41')]=_[_0x528a('0x42')](_0x88da53[_0x528a('0x41')]);_0x5a6ee5[_0x528a('0x43')]=_[_0x528a('0x44')](_0x5a6ee5[_0x528a('0x40')],_0x5a6ee5[_0x528a('0x41')]);_0x136ff8[_0x528a('0x45')]=_[_0x528a('0x44')](_0x5a6ee5[_0x528a('0x40')],qs[_0x528a('0x46')](_0x88da53[_0x528a('0x41')][_0x528a('0x46')]));_0x136ff8['attributes']=_0x136ff8[_0x528a('0x45')][_0x528a('0x47')]?_0x136ff8['attributes']:_0x5a6ee5[_0x528a('0x40')];if(_0x88da53['query'][_0x528a('0x54')]){_0x136ff8[_0x528a('0x55')]=[{'all':!![]}];}_0x136ff8=_[_0x528a('0x4c')]({},_0x136ff8,_0x88da53[_0x528a('0x4e')]);return db['VoiceExtension'][_0x528a('0x36')](_0x136ff8)[_0x528a('0x2b')](handleEntityNotFound(_0x286b8a,null))[_0x528a('0x2b')](respondWithResult(_0x286b8a,null))[_0x528a('0x51')](handleError(_0x286b8a,null));};exports[_0x528a('0x2a')]=function(_0x16e7de,_0x4926c3){return db[_0x528a('0x3d')][_0x528a('0x36')]({'where':{'id':_0x16e7de['params']['id']}})['then'](handleEntityNotFound(_0x4926c3,null))[_0x528a('0x2b')](removeEntity(_0x4926c3,null))[_0x528a('0x51')](handleError(_0x4926c3,null));};exports['create']=function(_0x28331f,_0x3ddc29){if(_0x28331f['body']['type']===_0x528a('0x2e')&&!_['startsWith'](_0x28331f[_0x528a('0x56')][_0x528a('0x57')],'_')){_0x28331f[_0x528a('0x56')]['exten']='_'[_0x528a('0x58')](_0x28331f['body']['exten']);}return db[_0x528a('0x3d')][_0x528a('0x59')](_0x28331f[_0x528a('0x56')],{'raw':![]})['then'](function(_0x4232a0){var _0x5cca05=_0x28331f[_0x528a('0x5a')][_0x528a('0x2c')]({'plain':!![]});if(!_0x5cca05)throw new Error(_0x528a('0x5b'));if(_0x5cca05[_0x528a('0x5c')]===_0x528a('0x5a')){var _0x327a06=_0x4232a0[_0x528a('0x2c')]({'plain':!![]});var _0x4f10bd=[{'name':'InboundRoutes','value':'inbound'},{'name':_0x528a('0x5d'),'value':_0x528a('0x2e')},{'name':_0x528a('0x2f'),'value':_0x528a('0x30')}];var _0x3b771f=_[_0x528a('0x36')](_0x4f10bd,[_0x528a('0x34'),_0x327a06[_0x528a('0x37')]])[_0x528a('0x38')];return db[_0x528a('0x5e')]['find']({'where':{'name':_0x3b771f,'userProfileId':_0x5cca05[_0x528a('0x5f')]},'raw':!![]})[_0x528a('0x2b')](function(_0x2af297){if(_0x2af297&&_0x2af297[_0x528a('0x60')]===0x0){return db[_0x528a('0x39')][_0x528a('0x59')]({'name':_0x327a06['name'],'resourceId':_0x327a06['id'],'type':_0x2af297['name'],'sectionId':_0x2af297['id']},{})['then'](function(){return _0x4232a0;});}else{return _0x4232a0;}})['catch'](function(_0x3e28ad){logger[_0x528a('0x3a')](_0x528a('0x61'),_0x3e28ad);throw _0x3e28ad;});}return _0x4232a0;})['then'](respondWithResult(_0x3ddc29,0xc9))[_0x528a('0x51')](handleError(_0x3ddc29,null));};exports[_0x528a('0x62')]=function(_0x126c01,_0x328ab0){if(_0x126c01[_0x528a('0x56')]['id']){delete _0x126c01[_0x528a('0x56')]['id'];}return db['VoiceExtension']['find']({'where':{'id':_0x126c01[_0x528a('0x53')]['id']}})[_0x528a('0x2b')](handleEntityNotFound(_0x328ab0,null))['then'](function(_0x24b641){if(_0x24b641){return db['VoiceExtension'][_0x528a('0x62')](_[_0x528a('0x4b')](_0x126c01[_0x528a('0x56')],[_0x528a('0x57'),'context',_0x528a('0x63'),_0x528a('0x64'),_0x528a('0x65'),_0x528a('0x66'),'alias']),{'where':{'context':_0x24b641[_0x528a('0x67')],'exten':_0x24b641[_0x528a('0x57')]},'individualHooks':!![]})[_0x528a('0x2b')](function(_0x386bff){return _0x386bff;});}return null;})['then'](respondWithStatusCode(_0x328ab0,null))[_0x528a('0x51')](handleError(_0x328ab0,null));};exports[_0x528a('0x68')]=function(_0x24f172,_0x487816){return db[_0x528a('0x3d')][_0x528a('0x69')]({'where':{'id':_0x24f172[_0x528a('0x53')]['id']}})[_0x528a('0x2b')](function(_0x1c4160){if(_0x1c4160){return db[_0x528a('0x6a')][_0x528a('0x6b')](function(_0x510a92){return db['VoiceExtension'][_0x528a('0x2a')]({'where':{'VoiceExtensionId':_0x24f172[_0x528a('0x53')]['id']},'transaction':_0x510a92})[_0x528a('0x2b')](function(){var _0x36fc1c=_[_0x528a('0x33')](_0x24f172[_0x528a('0x56')],function(_0x33abb0){_0x33abb0[_0x528a('0x6c')]=_0x24f172[_0x528a('0x53')]['id'];_0x33abb0[_0x528a('0x6d')]=!![];return _0x33abb0;});var _0x2a1880=_0x24f172['query'][_0x528a('0x6e')]&&_0x24f172['query']['rewriteDial'][_0x528a('0x6f')]()==='true'?!![]:![];return _0x1c4160['createRouting'](_0x36fc1c,_0x2a1880);})[_0x528a('0x2b')](function(_0x2db5f3){return db[_0x528a('0x3d')][_0x528a('0x70')](_0x2db5f3,{'transaction':_0x510a92});});})[_0x528a('0x2b')](function(){return db['VoiceExtension']['findAndCountAll']({'where':{'isApp':!![],'VoiceExtensionId':_0x24f172['params']['id']},'order':'cast(priority\x20as\x20unsigned)'});});}})[_0x528a('0x2b')](respondWithResult(_0x487816,null))['catch'](handleError(_0x487816,null));}; \ No newline at end of file +var _0xa630=['undefined','limit','count','set','apply','save','update','then','destroy','get','InboundRoutes','inbound','OutboundRoutes','outbound','internal','filter','ignore','value','type','name','UserProfileResource','stack','send','VoiceExtension','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','body','startsWith','exten','concat','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','InternalRoutes','find','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','description','recordingFormat','mandatoryDisposition','addApplications','findOne','sequelize','transaction','VoiceExtensionId','rewriteDial','toLowerCase','true','createRouting','bulkCreate','findAndCountAll','zip-dir','request-promise','bluebird','mustache','util','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost','socket.io-emitter','./voiceExtension.socket','register','status','end','json','offset'];(function(_0x27537c,_0x146582){var _0x446efb=function(_0x508222){while(--_0x508222){_0x27537c['push'](_0x27537c['shift']());}};_0x446efb(++_0x146582);}(_0xa630,0xbe));var _0x0a63=function(_0x5e4530,_0x3e528e){_0x5e4530=_0x5e4530-0x0;var _0x2bde7c=_0xa630[_0x5e4530];return _0x2bde7c;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x0a63('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0a63('0x1'));var moment=require('moment');var BPromise=require(_0x0a63('0x2'));var Mustache=require(_0x0a63('0x3'));var util=require(_0x0a63('0x4'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0a63('0x5'));var fs=require('fs');var fs_extra=require(_0x0a63('0x6'));var _=require(_0x0a63('0x7'));var squel=require('squel');var crypto=require(_0x0a63('0x8'));var jsforce=require(_0x0a63('0x9'));var deskjs=require(_0x0a63('0xa'));var toCsv=require(_0x0a63('0xb'));var querystring=require(_0x0a63('0xc'));var Papa=require('papaparse');var Redis=require(_0x0a63('0xd'));var authService=require(_0x0a63('0xe'));var qs=require(_0x0a63('0xf'));var as=require(_0x0a63('0x10'));var hardwareService=require(_0x0a63('0x11'));var logger=require(_0x0a63('0x12'))('api');var utils=require(_0x0a63('0x13'));var config=require(_0x0a63('0x14'));var licenseUtil=require(_0x0a63('0x15'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x0a63('0x16')](config[_0x0a63('0x17')],{'host':_0x0a63('0x18'),'port':0x18eb});var socket=require(_0x0a63('0x19'))(new Redis(config[_0x0a63('0x17')]));require(_0x0a63('0x1a'))[_0x0a63('0x1b')](socket);function respondWithStatusCode(_0x2eb8ce,_0x1a0f6e){_0x1a0f6e=_0x1a0f6e||0xcc;return function(_0x686b95){if(_0x686b95){return _0x2eb8ce['sendStatus'](_0x1a0f6e);}return _0x2eb8ce[_0x0a63('0x1c')](_0x1a0f6e)[_0x0a63('0x1d')]();};}function respondWithResult(_0x3669db,_0x3b1ee8){_0x3b1ee8=_0x3b1ee8||0xc8;return function(_0x1d23bc){if(_0x1d23bc){return _0x3669db[_0x0a63('0x1c')](_0x3b1ee8)[_0x0a63('0x1e')](_0x1d23bc);}};}function respondWithFilteredResult(_0xd677fc,_0x4cb605){return function(_0x1dbad9){if(_0x1dbad9){var _0x58c2fd=typeof _0x4cb605[_0x0a63('0x1f')]===_0x0a63('0x20')&&typeof _0x4cb605[_0x0a63('0x21')]===_0x0a63('0x20');var _0x1d7745=_0x1dbad9[_0x0a63('0x22')];var _0x149dce=_0x58c2fd?0x0:_0x4cb605[_0x0a63('0x1f')];var _0x40825b=_0x58c2fd?_0x1dbad9[_0x0a63('0x22')]:_0x4cb605[_0x0a63('0x1f')]+_0x4cb605['limit'];var _0x17d618;if(_0x40825b>=_0x1d7745){_0x40825b=_0x1d7745;_0x17d618=0xc8;}else{_0x17d618=0xce;}_0xd677fc[_0x0a63('0x1c')](_0x17d618);return _0xd677fc[_0x0a63('0x23')]('Content-Range',_0x149dce+'-'+_0x40825b+'/'+_0x1d7745)[_0x0a63('0x1e')](_0x1dbad9);}return null;};}function patchUpdates(_0x558095){return function(_0x292721){try{jsonpatch[_0x0a63('0x24')](_0x292721,_0x558095,!![]);}catch(_0x5cf65f){return BPromise['reject'](_0x5cf65f);}return _0x292721[_0x0a63('0x25')]();};}function saveUpdates(_0xe91d93,_0x81cb96){return function(_0x1b80e3){if(_0x1b80e3){return _0x1b80e3[_0x0a63('0x26')](_0xe91d93)[_0x0a63('0x27')](function(_0x4ab981){return _0x4ab981;});}return null;};}function removeEntity(_0x122596,_0x1dc698){return function(_0x375720){if(_0x375720){return _0x375720[_0x0a63('0x28')]()[_0x0a63('0x27')](function(){var _0x19214f=_0x375720[_0x0a63('0x29')]({'plain':!![]});var _0x5b7a87=[{'name':_0x0a63('0x2a'),'value':_0x0a63('0x2b'),'ignore':![]},{'name':_0x0a63('0x2c'),'value':_0x0a63('0x2d'),'ignore':![]},{'name':'InternalRoutes','value':_0x0a63('0x2e'),'ignore':![]}];var _0x2d6635=_(_0x5b7a87)[_0x0a63('0x2f')](_0x0a63('0x30'))['map'](_0x0a63('0x31'))['value']();if(_['includes'](_0x2d6635,_0x19214f[_0x0a63('0x32')])){return;}var _0x53e46a=_['find'](_0x5b7a87,['value',_0x19214f[_0x0a63('0x32')]])[_0x0a63('0x33')];return db[_0x0a63('0x34')][_0x0a63('0x28')]({'where':{'type':_0x53e46a,'resourceId':_0x19214f['id']}})['then'](function(){return _0x375720;});})[_0x0a63('0x27')](function(){_0x122596[_0x0a63('0x1c')](0xcc)[_0x0a63('0x1d')]();});}};}function handleEntityNotFound(_0x33eeb1,_0x3e64f7){return function(_0x4d834a){if(!_0x4d834a){_0x33eeb1['sendStatus'](0x194);}return _0x4d834a;};}function handleError(_0x36f0f7,_0x19d0bd){_0x19d0bd=_0x19d0bd||0x1f4;return function(_0x2f9ad4){logger['error'](_0x2f9ad4[_0x0a63('0x35')]);if(_0x2f9ad4[_0x0a63('0x33')]){delete _0x2f9ad4[_0x0a63('0x33')];}_0x36f0f7[_0x0a63('0x1c')](_0x19d0bd)[_0x0a63('0x36')](_0x2f9ad4);};}exports['index']=function(_0x2f21d9,_0x19ba32){var _0x31a150={},_0x278889={},_0x294949={'count':0x0,'rows':[]};var _0x4acb23=_['map'](db[_0x0a63('0x37')][_0x0a63('0x38')],function(_0x1c22aa){return{'name':_0x1c22aa['fieldName'],'type':_0x1c22aa['type'][_0x0a63('0x39')]};});_0x278889[_0x0a63('0x3a')]=_['map'](_0x4acb23,'name');_0x278889[_0x0a63('0x3b')]=_[_0x0a63('0x3c')](_0x2f21d9['query']);_0x278889[_0x0a63('0x3d')]=_[_0x0a63('0x3e')](_0x278889[_0x0a63('0x3a')],_0x278889['query']);_0x31a150[_0x0a63('0x3f')]=_[_0x0a63('0x3e')](_0x278889['model'],qs['fields'](_0x2f21d9[_0x0a63('0x3b')][_0x0a63('0x40')]));_0x31a150[_0x0a63('0x3f')]=_0x31a150[_0x0a63('0x3f')][_0x0a63('0x41')]?_0x31a150[_0x0a63('0x3f')]:_0x278889[_0x0a63('0x3a')];if(!_0x2f21d9[_0x0a63('0x3b')][_0x0a63('0x42')](_0x0a63('0x43'))){_0x31a150[_0x0a63('0x21')]=qs['limit'](_0x2f21d9[_0x0a63('0x3b')]['limit']);_0x31a150['offset']=qs[_0x0a63('0x1f')](_0x2f21d9[_0x0a63('0x3b')][_0x0a63('0x1f')]);}_0x31a150['order']=qs[_0x0a63('0x44')](_0x2f21d9['query']['sort']);_0x31a150[_0x0a63('0x45')]=qs[_0x0a63('0x3d')](_[_0x0a63('0x46')](_0x2f21d9['query'],_0x278889['filters']),_0x4acb23);if(_0x2f21d9['query']['filter']){_0x31a150[_0x0a63('0x45')]=_[_0x0a63('0x47')](_0x31a150[_0x0a63('0x45')],{'$or':_[_0x0a63('0x48')](_0x4acb23,function(_0xf96702){if(_0xf96702[_0x0a63('0x32')]!==_0x0a63('0x49')){var _0x35549f={};_0x35549f[_0xf96702['name']]={'$like':'%'+_0x2f21d9['query'][_0x0a63('0x2f')]+'%'};return _0x35549f;}})});}_0x31a150=_['merge']({},_0x31a150,_0x2f21d9[_0x0a63('0x4a')]);var _0x41b6b7={'where':_0x31a150[_0x0a63('0x45')]};return db[_0x0a63('0x37')][_0x0a63('0x22')](_0x41b6b7)[_0x0a63('0x27')](function(_0x5618d1){_0x294949[_0x0a63('0x22')]=_0x5618d1;if(_0x2f21d9['query'][_0x0a63('0x4b')]){_0x31a150[_0x0a63('0x4c')]=[{'all':!![]}];}return db[_0x0a63('0x37')][_0x0a63('0x4d')](_0x31a150);})[_0x0a63('0x27')](function(_0x8d83e7){_0x294949[_0x0a63('0x4e')]=_0x8d83e7;return _0x294949;})[_0x0a63('0x27')](respondWithFilteredResult(_0x19ba32,_0x31a150))[_0x0a63('0x4f')](handleError(_0x19ba32,null));};exports[_0x0a63('0x50')]=function(_0x8fdc50,_0x440b84){var _0x5382fb={'raw':![],'where':{'id':_0x8fdc50[_0x0a63('0x51')]['id']}},_0x21aef4={};_0x21aef4[_0x0a63('0x3a')]=_['keys'](db[_0x0a63('0x37')][_0x0a63('0x38')]);_0x21aef4[_0x0a63('0x3b')]=_[_0x0a63('0x3c')](_0x8fdc50['query']);_0x21aef4[_0x0a63('0x3d')]=_[_0x0a63('0x3e')](_0x21aef4[_0x0a63('0x3a')],_0x21aef4['query']);_0x5382fb['attributes']=_[_0x0a63('0x3e')](_0x21aef4[_0x0a63('0x3a')],qs[_0x0a63('0x40')](_0x8fdc50['query'][_0x0a63('0x40')]));_0x5382fb[_0x0a63('0x3f')]=_0x5382fb[_0x0a63('0x3f')][_0x0a63('0x41')]?_0x5382fb[_0x0a63('0x3f')]:_0x21aef4['model'];if(_0x8fdc50['query'][_0x0a63('0x4b')]){_0x5382fb[_0x0a63('0x4c')]=[{'all':!![]}];}_0x5382fb=_[_0x0a63('0x47')]({},_0x5382fb,_0x8fdc50['options']);return db['VoiceExtension']['find'](_0x5382fb)[_0x0a63('0x27')](handleEntityNotFound(_0x440b84,null))[_0x0a63('0x27')](respondWithResult(_0x440b84,null))[_0x0a63('0x4f')](handleError(_0x440b84,null));};exports[_0x0a63('0x28')]=function(_0x401c2a,_0x27f746){return db[_0x0a63('0x37')]['find']({'where':{'id':_0x401c2a['params']['id']}})['then'](handleEntityNotFound(_0x27f746,null))[_0x0a63('0x27')](removeEntity(_0x27f746,null))[_0x0a63('0x4f')](handleError(_0x27f746,null));};exports['create']=function(_0x468e3d,_0x40b399){if(_0x468e3d[_0x0a63('0x52')][_0x0a63('0x32')]==='outbound'&&!_[_0x0a63('0x53')](_0x468e3d['body'][_0x0a63('0x54')],'_')){_0x468e3d[_0x0a63('0x52')][_0x0a63('0x54')]='_'[_0x0a63('0x55')](_0x468e3d[_0x0a63('0x52')][_0x0a63('0x54')]);}return db[_0x0a63('0x37')][_0x0a63('0x56')](_0x468e3d[_0x0a63('0x52')],{'raw':![]})[_0x0a63('0x27')](function(_0x29da0a){var _0xc3e8e3=_0x468e3d[_0x0a63('0x57')][_0x0a63('0x29')]({'plain':!![]});if(!_0xc3e8e3)throw new Error(_0x0a63('0x58'));if(_0xc3e8e3['role']===_0x0a63('0x57')){var _0x8d5178=_0x29da0a[_0x0a63('0x29')]({'plain':!![]});var _0x40c9f5=[{'name':_0x0a63('0x2a'),'value':_0x0a63('0x2b')},{'name':'OutboundRoutes','value':'outbound'},{'name':_0x0a63('0x59'),'value':_0x0a63('0x2e')}];var _0x3722d4=_[_0x0a63('0x5a')](_0x40c9f5,[_0x0a63('0x31'),_0x8d5178[_0x0a63('0x32')]])[_0x0a63('0x33')];return db[_0x0a63('0x5b')][_0x0a63('0x5a')]({'where':{'name':_0x3722d4,'userProfileId':_0xc3e8e3[_0x0a63('0x5c')]},'raw':!![]})['then'](function(_0x51338a){if(_0x51338a&&_0x51338a[_0x0a63('0x5d')]===0x0){return db[_0x0a63('0x34')]['create']({'name':_0x8d5178[_0x0a63('0x33')],'resourceId':_0x8d5178['id'],'type':_0x51338a[_0x0a63('0x33')],'sectionId':_0x51338a['id']},{})[_0x0a63('0x27')](function(){return _0x29da0a;});}else{return _0x29da0a;}})[_0x0a63('0x4f')](function(_0x31c557){logger[_0x0a63('0x5e')](_0x0a63('0x5f'),_0x31c557);throw _0x31c557;});}return _0x29da0a;})[_0x0a63('0x27')](respondWithResult(_0x40b399,0xc9))[_0x0a63('0x4f')](handleError(_0x40b399,null));};exports[_0x0a63('0x26')]=function(_0x5d93a6,_0x2f187a){if(_0x5d93a6[_0x0a63('0x52')]['id']){delete _0x5d93a6[_0x0a63('0x52')]['id'];}return db[_0x0a63('0x37')][_0x0a63('0x5a')]({'where':{'id':_0x5d93a6[_0x0a63('0x51')]['id']}})['then'](handleEntityNotFound(_0x2f187a,null))[_0x0a63('0x27')](function(_0x445637){if(_0x445637){return db['VoiceExtension'][_0x0a63('0x26')](_['pick'](_0x5d93a6[_0x0a63('0x52')],[_0x0a63('0x54'),_0x0a63('0x60'),_0x0a63('0x61'),_0x0a63('0x62'),'cutdigits',_0x0a63('0x63'),'alias']),{'where':{'context':_0x445637[_0x0a63('0x60')],'exten':_0x445637['exten']},'individualHooks':!![]})[_0x0a63('0x27')](function(_0x56a8ab){return _0x56a8ab;});}return null;})[_0x0a63('0x27')](respondWithStatusCode(_0x2f187a,null))[_0x0a63('0x4f')](handleError(_0x2f187a,null));};exports[_0x0a63('0x64')]=function(_0xb1aa65,_0x2d1132){return db['VoiceExtension'][_0x0a63('0x65')]({'where':{'id':_0xb1aa65[_0x0a63('0x51')]['id']}})[_0x0a63('0x27')](function(_0x5e9213){if(_0x5e9213){return db[_0x0a63('0x66')][_0x0a63('0x67')](function(_0x582258){return db[_0x0a63('0x37')]['destroy']({'where':{'VoiceExtensionId':_0xb1aa65[_0x0a63('0x51')]['id']},'transaction':_0x582258})[_0x0a63('0x27')](function(){var _0x38e6ea=_[_0x0a63('0x48')](_0xb1aa65[_0x0a63('0x52')],function(_0x523343){_0x523343[_0x0a63('0x68')]=_0xb1aa65[_0x0a63('0x51')]['id'];_0x523343['isApp']=!![];return _0x523343;});var _0x33cda0=_0xb1aa65[_0x0a63('0x3b')][_0x0a63('0x69')]&&_0xb1aa65[_0x0a63('0x3b')][_0x0a63('0x69')][_0x0a63('0x6a')]()===_0x0a63('0x6b')?!![]:![];return _0x5e9213[_0x0a63('0x6c')](_0x38e6ea,_0x33cda0);})[_0x0a63('0x27')](function(_0x516e37){return db['VoiceExtension'][_0x0a63('0x6d')](_0x516e37,{'transaction':_0x582258});});})[_0x0a63('0x27')](function(){return db[_0x0a63('0x37')][_0x0a63('0x6e')]({'where':{'isApp':!![],'VoiceExtensionId':_0xb1aa65[_0x0a63('0x51')]['id']},'order':'cast(priority\x20as\x20unsigned)'});});}})[_0x0a63('0x27')](respondWithResult(_0x2d1132,null))[_0x0a63('0x4f')](handleError(_0x2d1132,null));}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index 126ac5c..afe5a4a 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 _0x2e32=['VoiceExtension','setMaxListeners','save','update','remove','emit','exports','events','../../mysqldb'];(function(_0x5ae022,_0x403c1e){var _0x27f81e=function(_0x91ae24){while(--_0x91ae24){_0x5ae022['push'](_0x5ae022['shift']());}};_0x27f81e(++_0x403c1e);}(_0x2e32,0x73));var _0x22e3=function(_0x580647,_0x43d2c3){_0x580647=_0x580647-0x0;var _0x5f0792=_0x2e32[_0x580647];return _0x5f0792;};'use strict';var EventEmitter=require(_0x22e3('0x0'));var VoiceExtension=require(_0x22e3('0x1'))['db'][_0x22e3('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x22e3('0x3')](0x0);var events={'afterCreate':_0x22e3('0x4'),'afterUpdate':_0x22e3('0x5'),'afterDestroy':_0x22e3('0x6')};function emitEvent(_0xb17bd){return function(_0x1fedb9,_0x10a48d,_0x26a5d7){VoiceExtensionEvents[_0x22e3('0x7')](_0xb17bd+':'+_0x1fedb9['id'],_0x1fedb9);VoiceExtensionEvents[_0x22e3('0x7')](_0xb17bd,_0x1fedb9);_0x26a5d7(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceExtension['hook'](e,emitEvent(event));}}module[_0x22e3('0x8')]=VoiceExtensionEvents; \ No newline at end of file +var _0x98a0=['save','remove','emit','hook','exports','events','../../mysqldb','VoiceExtension'];(function(_0xc5d906,_0x53e0c2){var _0x42f80e=function(_0x1d6f11){while(--_0x1d6f11){_0xc5d906['push'](_0xc5d906['shift']());}};_0x42f80e(++_0x53e0c2);}(_0x98a0,0x14d));var _0x098a=function(_0x172280,_0x1049de){_0x172280=_0x172280-0x0;var _0x10b1aa=_0x98a0[_0x172280];return _0x10b1aa;};'use strict';var EventEmitter=require(_0x098a('0x0'));var VoiceExtension=require(_0x098a('0x1'))['db'][_0x098a('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x098a('0x3'),'afterUpdate':'update','afterDestroy':_0x098a('0x4')};function emitEvent(_0x376fad){return function(_0x375d29,_0x4e2470,_0x5e882f){VoiceExtensionEvents[_0x098a('0x5')](_0x376fad+':'+_0x375d29['id'],_0x375d29);VoiceExtensionEvents['emit'](_0x376fad,_0x375d29);_0x5e882f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceExtension[_0x098a('0x6')](e,emitEvent(event));}}module[_0x098a('0x7')]=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index 88edb14..4310cf0 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 _0x829f=[',${EXTEN},','appType','outboundDial','appdata','last','priority','catch','define','voice_extensions','concat','Hangup','util','lodash','./voiceExtension.attributes','models','type','Set','CDR(type)=','context','exten','alias','NoOp','CDR(routeAlias)=','No\x20alias\x20set','push','CDR(routeid)=','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','ExecIf','):Goto(','CDR(prefix)=${EXTEN:0:','hasOwnProperty','recordingFormat','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','trunk','timeout','options','url','length','name','param','split','phone','prefix','join','none','indexOf','U(xcally-mixmonitor-context)','isEmpty','Interval','findAll','interval','IntervalId','then','*,*,*,*','intervals','map','filter','toLowerCase','tag','CDR(tag)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','Set(CALLERID(all)=','callerID','playback','includes','app','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','GotoIfTime'];(function(_0x4e480b,_0x5bb729){var _0x39f546=function(_0x22b797){while(--_0x22b797){_0x4e480b['push'](_0x4e480b['shift']());}};_0x39f546(++_0x5bb729);}(_0x829f,0x1f1));var _0xf829=function(_0x36884b,_0x5cb6e3){_0x36884b=_0x36884b-0x0;var _0x557e28=_0x829f[_0x36884b];return _0x557e28;};'use strict';var util=require(_0xf829('0x0'));var _=require(_0xf829('0x1'));var attributes=require(_0xf829('0x2'));module['exports']=function(_0x325833){var _0x3f5d1a=_0x325833[_0xf829('0x3')];function _0x1ec465(_0x22ea6b){var _0x1d0646=0x2;var _0x4906a1=[{'type':_0x22ea6b[_0xf829('0x4')],'app':_0xf829('0x5'),'appdata':_0xf829('0x6')+_0x22ea6b['type'],'context':_0x22ea6b[_0xf829('0x7')],'exten':_0x22ea6b[_0xf829('0x8')],'priority':_0x1d0646++,'VoiceExtensionId':_0x22ea6b['id']},{'type':_0x22ea6b[_0xf829('0x4')],'app':_0x22ea6b[_0xf829('0x9')]?'Set':_0xf829('0xa'),'appdata':_0x22ea6b[_0xf829('0x9')]?_0xf829('0xb')+_0x22ea6b[_0xf829('0x9')]:_0xf829('0xc'),'context':_0x22ea6b[_0xf829('0x7')],'exten':_0x22ea6b[_0xf829('0x8')],'priority':_0x1d0646++,'VoiceExtensionId':_0x22ea6b['id']}];if(_0x22ea6b['type']==='inbound'){_0x4906a1[_0xf829('0xd')]({'type':'inbound','app':_0xf829('0x5'),'appdata':_0xf829('0xe')+_0x22ea6b['id'],'context':_0x22ea6b[_0xf829('0x7')],'exten':_0x22ea6b[_0xf829('0x8')],'priority':_0x1d0646++,'VoiceExtensionId':_0x22ea6b['id']});}_0x4906a1[_0xf829('0xd')]({'type':_0x22ea6b[_0xf829('0x4')],'app':_0xf829('0x5'),'appdata':_0xf829('0xf'),'context':_0x22ea6b[_0xf829('0x7')],'exten':_0x22ea6b['exten'],'priority':_0x1d0646++,'VoiceExtensionId':_0x22ea6b['id']},{'type':_0x22ea6b[_0xf829('0x4')],'app':_0xf829('0x5'),'appdata':_0xf829('0x10'),'context':_0x22ea6b[_0xf829('0x7')],'exten':_0x22ea6b[_0xf829('0x8')],'priority':_0x1d0646++,'VoiceExtensionId':_0x22ea6b['id']},{'type':_0x22ea6b['type'],'app':_0xf829('0x5'),'appdata':_0xf829('0x11'),'context':_0x22ea6b[_0xf829('0x7')],'exten':_0x22ea6b[_0xf829('0x8')],'priority':_0x1d0646++,'VoiceExtensionId':_0x22ea6b['id']});return _0x4906a1;}function _0x36b126(_0x43f1b0){var _0x4d7f66=0x2;var _0x5b62ec=[{'type':_0xf829('0x12'),'app':_0xf829('0x5'),'appdata':_0xf829('0x13'),'context':_0x43f1b0[_0xf829('0x7')],'exten':_0x43f1b0[_0xf829('0x8')],'priority':_0x4d7f66++,'VoiceExtensionId':_0x43f1b0['id']},{'type':'outbound','app':_0x43f1b0['alias']?_0xf829('0x5'):_0xf829('0xa'),'appdata':_0x43f1b0['alias']?_0xf829('0xb')+_0x43f1b0[_0xf829('0x9')]:_0xf829('0xc'),'context':_0x43f1b0[_0xf829('0x7')],'exten':_0x43f1b0[_0xf829('0x8')],'priority':_0x4d7f66++,'VoiceExtensionId':_0x43f1b0['id']},{'type':_0xf829('0x12'),'app':_0xf829('0x5'),'appdata':_0xf829('0x14')+(_0x43f1b0[_0xf829('0x15')]?_0xf829('0x16')+_0x43f1b0[_0xf829('0x15')]+'}':_0xf829('0x17')),'context':_0x43f1b0[_0xf829('0x7')],'exten':_0x43f1b0['exten'],'priority':_0x4d7f66++,'VoiceExtensionId':_0x43f1b0['id']},{'type':_0xf829('0x12'),'app':_0xf829('0x5'),'appdata':'CDR(routeid)='+_0x43f1b0['id'],'context':_0x43f1b0['context'],'exten':_0x43f1b0['exten'],'priority':_0x4d7f66++,'VoiceExtensionId':_0x43f1b0['id']},{'type':_0xf829('0x12'),'app':_0xf829('0x18'),'appdata':'$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto('+(_0x4d7f66+0x2)+_0xf829('0x19')+(_0x4d7f66+0x1)+')','context':_0x43f1b0[_0xf829('0x7')],'exten':_0x43f1b0[_0xf829('0x8')],'priority':_0x4d7f66++,'VoiceExtensionId':_0x43f1b0['id']},{'type':_0xf829('0x12'),'app':_0xf829('0x5'),'appdata':_0x43f1b0[_0xf829('0x15')]?_0xf829('0x1a')+_0x43f1b0[_0xf829('0x15')]+'}':'CDR(prefix)=noprefix','context':_0x43f1b0[_0xf829('0x7')],'exten':_0x43f1b0[_0xf829('0x8')],'priority':_0x4d7f66++,'VoiceExtensionId':_0x43f1b0['id']},{'type':_0xf829('0x12'),'app':_0xf829('0x5'),'appdata':_0xf829('0xf'),'context':_0x43f1b0['context'],'exten':_0x43f1b0[_0xf829('0x8')],'priority':_0x4d7f66++,'VoiceExtensionId':_0x43f1b0['id']},{'type':_0xf829('0x12'),'app':'Set','appdata':_0xf829('0x10'),'context':_0x43f1b0[_0xf829('0x7')],'exten':_0x43f1b0[_0xf829('0x8')],'priority':_0x4d7f66++,'VoiceExtensionId':_0x43f1b0['id']},{'type':_0xf829('0x12'),'app':'Set','appdata':_0xf829('0x11'),'context':_0x43f1b0['context'],'exten':_0x43f1b0[_0xf829('0x8')],'priority':_0x4d7f66++,'VoiceExtensionId':_0x43f1b0['id']},{'type':_0xf829('0x12'),'app':_0xf829('0x5'),'appdata':'outboundrouteid='+_0x43f1b0['id'],'context':_0x43f1b0[_0xf829('0x7')],'exten':_0x43f1b0[_0xf829('0x8')],'priority':_0x4d7f66++,'VoiceExtensionId':_0x43f1b0['id']}];if(_0x43f1b0[_0xf829('0x1b')](_0xf829('0x1c'))&&_0x43f1b0[_0xf829('0x1c')]!=='none'){_0x5b62ec[_0xf829('0xd')]({'type':_0xf829('0x12'),'app':_0xf829('0x5'),'appdata':_0xf829('0x1d'),'context':_0x43f1b0['context'],'exten':_0x43f1b0[_0xf829('0x8')],'priority':_0x4d7f66++,'VoiceExtensionId':_0x43f1b0['id']},{'type':_0xf829('0x12'),'app':_0xf829('0x5'),'appdata':_0xf829('0x1e')+_0x43f1b0[_0xf829('0x1c')]||'wav','context':_0x43f1b0[_0xf829('0x7')],'exten':_0x43f1b0[_0xf829('0x8')],'priority':_0x4d7f66++,'VoiceExtensionId':_0x43f1b0['id']});}return _0x5b62ec;}function _0x2f2fa9(_0x3e74bf){var _0x38c23c=[{'name':_0xf829('0x1f'),'param':0x0},{'name':_0xf829('0x20'),'param':0x1},{'name':_0xf829('0x21'),'param':0x2},{'name':_0xf829('0x22'),'param':0x3}];var _0x23242c={};var _0x1bd87d=_0x3e74bf['split'](',');var _0x146361=[];for(var _0x5b93f4=0x0;_0x5b93f4<_0x38c23c[_0xf829('0x23')];_0x5b93f4++){switch(_0x38c23c[_0x5b93f4][_0xf829('0x24')]){case'trunk':_0x23242c['trunk']=_0x1bd87d[_0x38c23c[_0x5b93f4][_0xf829('0x25')]][_0xf829('0x26')]('/')[0x1];_0x23242c[_0xf829('0x27')]=_0x1bd87d[_0x38c23c[_0x5b93f4][_0xf829('0x25')]][_0xf829('0x26')]('/')[0x2];_0x23242c[_0xf829('0x28')]=_0x23242c[_0xf829('0x27')]?_0x23242c[_0xf829('0x27')]['split']('$')[0x0]:undefined;_0x23242c[_0xf829('0x27')]=route[_0xf829('0x15')]?(_0x23242c[_0xf829('0x28')]||'')+'${EXTEN:'+route['cutdigits']+'}':(_0x23242c[_0xf829('0x28')]||'')+_0xf829('0x17');_0x146361[_0x38c23c[_0x5b93f4][_0xf829('0x25')]]=['SIP',_0x23242c['trunk'],_0x23242c[_0xf829('0x27')]][_0xf829('0x29')]('/');break;case _0xf829('0x21'):_0x23242c[_0xf829('0x21')]=_0x1bd87d[_0x38c23c[_0x5b93f4][_0xf829('0x25')]];if(route[_0xf829('0x1c')]!==_0xf829('0x2a')){if(_0x23242c[_0xf829('0x21')][_0xf829('0x2b')](_0xf829('0x2c'))<0x0){_0x23242c[_0xf829('0x21')]+='U(xcally-mixmonitor-context)';}}else{_0x23242c[_0xf829('0x21')]=_0x23242c[_0xf829('0x21')]['replace'](_0xf829('0x2c'),'');}_0x146361[_0x38c23c[_0x5b93f4][_0xf829('0x25')]]=_0x23242c[_0xf829('0x21')];break;default:_0x146361[_0x38c23c[_0x5b93f4][_0xf829('0x25')]]=_0x1bd87d[_0x38c23c[_0x5b93f4][_0xf829('0x25')]];}}return _0x146361[_0xf829('0x29')](',');}function _0xef6a70(_0x5431c8,_0x4630f4,_0x34803d,_0x1d34cc){return new Promise(function(_0x2b35b0,_0x5e99e3){var _0xbb704c=[];if(_[_0xf829('0x2d')](_0x4630f4))return _0x2b35b0(_0xbb704c);_0x3f5d1a[_0xf829('0x2e')][_0xf829('0x2f')]({'attributes':['id',_0xf829('0x30'),_0xf829('0x31')],'raw':!![]})[_0xf829('0x32')](function(_0x369ad5){for(var _0x34b22e=0x0,_0x1891b6=0x0;_0x34b22e<_0x4630f4[_0xf829('0x23')];_0x34b22e++,_0x1891b6=0x0){var _0x1f2fea=_0x4630f4[_0x34b22e];var _0x38b016=[];var _0x4e39c2=[];if(_0x1f2fea[_0xf829('0x30')]!==_0xf829('0x33')){_0x1f2fea[_0xf829('0x34')]=[_0x1f2fea[_0xf829('0x30')]];}else{_0x1f2fea[_0xf829('0x34')]=_0x1f2fea[_0xf829('0x31')]?_[_0xf829('0x35')](_[_0xf829('0x36')](_0x369ad5,{'IntervalId':_0x1f2fea[_0xf829('0x31')]}),_0xf829('0x30')):[];}_0x1f2fea[_0xf829('0x7')]=_0x5431c8[_0xf829('0x7')];_0x1f2fea[_0xf829('0x8')]=_0x5431c8['exten'];if(_0x1f2fea[_0xf829('0x4')])_0x1f2fea['type']=_0x1f2fea[_0xf829('0x4')][_0xf829('0x37')]();if(_0x5431c8[_0xf829('0x4')]===_0xf829('0x12')){if(_0x1f2fea[_0xf829('0x1b')]('tag')&&_0x1f2fea[_0xf829('0x38')]&&_0x1f2fea[_0xf829('0x38')]!=='--'){_0x38b016[_0xf829('0xd')]({'type':_0x1f2fea[_0xf829('0x4')][_0xf829('0x37')](),'app':_0xf829('0x5'),'appdata':_0xf829('0x39')+_0x1f2fea['tag'],'context':_0x5431c8['context'],'exten':_0x5431c8[_0xf829('0x8')],'priority':_0x1f2fea[_0xf829('0x34')][_0xf829('0x23')]+_0x34803d+_0x1891b6++,'VoiceExtensionId':_0x5431c8['id']});}_0x38b016[_0xf829('0xd')]({'type':_0x1f2fea['type'][_0xf829('0x37')](),'app':'ExecIf','appdata':_0xf829('0x3a')+(_0x1f2fea['callerID']?_0xf829('0x3b')+_0x1f2fea[_0xf829('0x3c')]+')':'NoOp(No\x20number\x20available)'),'context':_0x5431c8[_0xf829('0x7')],'exten':_0x5431c8[_0xf829('0x8')],'priority':_0x1f2fea[_0xf829('0x34')]['length']+_0x34803d+_0x1891b6++,'VoiceExtensionId':_0x5431c8['id']});}else{if(_0x1f2fea[_0xf829('0x1b')]('answer')){if(['queue',_0xf829('0x3d')][_0xf829('0x3e')](_0x1f2fea[_0xf829('0x3f')][_0xf829('0x37')]())&&_0x1f2fea['appType']!==_0xf829('0x40')){if(_0x1f2fea['answer']){_0x38b016['push']({'type':_0x1f2fea['type'][_0xf829('0x37')](),'app':_0xf829('0x18'),'appdata':_0xf829('0x41'),'context':_0x5431c8[_0xf829('0x7')],'exten':_0x5431c8['exten'],'priority':_0x1f2fea[_0xf829('0x34')][_0xf829('0x23')]+_0x34803d+_0x1891b6++,'VoiceExtensionId':_0x5431c8['id']});_0x38b016[_0xf829('0xd')]({'type':_0x1f2fea[_0xf829('0x4')][_0xf829('0x37')](),'app':'Set','appdata':_0xf829('0x42'),'context':_0x5431c8[_0xf829('0x7')],'exten':_0x5431c8['exten'],'priority':_0x1f2fea['intervals']['length']+_0x34803d+_0x1891b6++,'VoiceExtensionId':_0x5431c8['id']});}else{_0x38b016['push']({'type':_0x1f2fea[_0xf829('0x4')][_0xf829('0x37')](),'app':_0xf829('0x18'),'appdata':_0xf829('0x43'),'context':_0x5431c8[_0xf829('0x7')],'exten':_0x5431c8[_0xf829('0x8')],'priority':_0x1f2fea[_0xf829('0x34')][_0xf829('0x23')]+_0x34803d+_0x1891b6++,'VoiceExtensionId':_0x5431c8['id']});_0x38b016[_0xf829('0xd')]({'type':_0x1f2fea[_0xf829('0x4')][_0xf829('0x37')](),'app':'Set','appdata':_0xf829('0x44'),'context':_0x5431c8['context'],'exten':_0x5431c8['exten'],'priority':_0x1f2fea[_0xf829('0x34')][_0xf829('0x23')]+_0x34803d+_0x1891b6++,'VoiceExtensionId':_0x5431c8['id']});}}}}for(var _0x3f1f1b=0x0;_0x3f1f1b<_0x1f2fea[_0xf829('0x34')]['length'];_0x3f1f1b++){var _0x3f5943=_0x34803d+_0x1f2fea[_0xf829('0x34')]['length'];var _0x2180d2=_0x3f1f1b===_0x1f2fea[_0xf829('0x34')][_0xf829('0x23')]-0x1?_0x34803d+_0x38b016[_0xf829('0x23')]+_0x4e39c2[_0xf829('0x23')]+0x2:_0x34803d+_0x3f1f1b+0x1;_0x38b016['splice'](_0x3f1f1b,0x0,{'type':_0x5431c8[_0xf829('0x4')],'app':_0xf829('0x45'),'appdata':_0x1f2fea[_0xf829('0x34')][_0x3f1f1b]+'?'+_0x5431c8['context']+_0xf829('0x46')+_0x3f5943+':'+_0x5431c8['context']+',${EXTEN},'+_0x2180d2,'exten':_0x5431c8[_0xf829('0x8')],'context':_0x5431c8[_0xf829('0x7')],'priority':_0x34803d+_0x3f1f1b,'VoiceExtensionId':_0x5431c8['id']});}if(_0x1d34cc&&_0x1f2fea[_0xf829('0x47')]===_0xf829('0x48'))_0x1f2fea['appdata']=_0x2f2fa9(_0x1f2fea[_0xf829('0x49')]);_0x1f2fea['priority']=_0x38b016[_0xf829('0x23')]?_[_0xf829('0x4a')](_0x38b016)[_0xf829('0x4b')]+0x1:_0x34803d;_0xbb704c=_['concat'](_0xbb704c,_0x38b016,[_0x1f2fea],_0x4e39c2);_0x34803d=_[_0xf829('0x4a')](_0xbb704c)[_0xf829('0x4b')]+0x1;}return _0x2b35b0(_0xbb704c);})[_0xf829('0x4c')](function(_0x2b4299){_0x5e99e3(_0x2b4299);});});}return _0x325833[_0xf829('0x4d')]('VoiceExtension',attributes,{'tableName':_0xf829('0x4e'),'paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0xcf5fb7,_0x455c64){var _0x429591=this;var _0xe83416=_0x429591[_0xf829('0x4')]===_0xf829('0x12')?_0x36b126(_0x429591):_0x1ec465(_0x429591);return _0xef6a70(_0x429591,_0xcf5fb7,_[_0xf829('0x4a')](_0xe83416)[_0xf829('0x4b')]+0x1,_0x455c64)[_0xf829('0x32')](function(_0x582ca6){var _0x200cb9=_[_0xf829('0x4f')](_0xe83416,_0x582ca6);_0x200cb9[_0xf829('0xd')]({'type':_0x429591['type'],'app':_0xf829('0x50'),'exten':_0x429591[_0xf829('0x8')],'context':_0x429591[_0xf829('0x7')],'priority':_[_0xf829('0x4a')](_0x200cb9)[_0xf829('0x4b')]+0x1,'VoiceExtensionId':_0x429591['id']});return _0x200cb9;});}}});}; \ No newline at end of file +var _0xaefb=['isEmpty','findAll','IntervalId','interval','*,*,*,*','intervals','toLowerCase','tag','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):','callerID','Set(CALLERID(all)=','NoOp(No\x20number\x20available)','queue','includes','appType','custom','answer','XCALLY-MOTION-ANSWER=1',',${EXTEN},','appdata','priority','last','concat','catch','define','VoiceExtension','then','Hangup','util','./voiceExtension.attributes','exports','models','type','Set','CDR(type)=','context','exten','alias','CDR(routeAlias)=','inbound','push','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','outbound','CDR(type)=outbound','NoOp','No\x20alias\x20set','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','CDR(routeid)=','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','CDR(prefix)=${EXTEN:0:','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','timeout','split','length','name','trunk','param','prefix','phone','SIP','join','options','indexOf','U(xcally-mixmonitor-context)','replace'];(function(_0x1b6c0c,_0x51ef20){var _0x178991=function(_0x3b6f64){while(--_0x3b6f64){_0x1b6c0c['push'](_0x1b6c0c['shift']());}};_0x178991(++_0x51ef20);}(_0xaefb,0x67));var _0xbaef=function(_0x17266e,_0x5d273d){_0x17266e=_0x17266e-0x0;var _0x8eeaf4=_0xaefb[_0x17266e];return _0x8eeaf4;};'use strict';var util=require(_0xbaef('0x0'));var _=require('lodash');var attributes=require(_0xbaef('0x1'));module[_0xbaef('0x2')]=function(_0x2ffa83){var _0x14f7a4=_0x2ffa83[_0xbaef('0x3')];function _0x1104cb(_0x20dd1a){var _0x41078d=0x2;var _0x47d363=[{'type':_0x20dd1a[_0xbaef('0x4')],'app':_0xbaef('0x5'),'appdata':_0xbaef('0x6')+_0x20dd1a[_0xbaef('0x4')],'context':_0x20dd1a[_0xbaef('0x7')],'exten':_0x20dd1a[_0xbaef('0x8')],'priority':_0x41078d++,'VoiceExtensionId':_0x20dd1a['id']},{'type':_0x20dd1a[_0xbaef('0x4')],'app':_0x20dd1a[_0xbaef('0x9')]?'Set':'NoOp','appdata':_0x20dd1a[_0xbaef('0x9')]?_0xbaef('0xa')+_0x20dd1a['alias']:'No\x20alias\x20set','context':_0x20dd1a[_0xbaef('0x7')],'exten':_0x20dd1a[_0xbaef('0x8')],'priority':_0x41078d++,'VoiceExtensionId':_0x20dd1a['id']}];if(_0x20dd1a['type']===_0xbaef('0xb')){_0x47d363[_0xbaef('0xc')]({'type':_0xbaef('0xb'),'app':_0xbaef('0x5'),'appdata':'CDR(routeid)='+_0x20dd1a['id'],'context':_0x20dd1a[_0xbaef('0x7')],'exten':_0x20dd1a[_0xbaef('0x8')],'priority':_0x41078d++,'VoiceExtensionId':_0x20dd1a['id']});}_0x47d363[_0xbaef('0xc')]({'type':_0x20dd1a['type'],'app':_0xbaef('0x5'),'appdata':_0xbaef('0xd'),'context':_0x20dd1a[_0xbaef('0x7')],'exten':_0x20dd1a[_0xbaef('0x8')],'priority':_0x41078d++,'VoiceExtensionId':_0x20dd1a['id']},{'type':_0x20dd1a[_0xbaef('0x4')],'app':_0xbaef('0x5'),'appdata':_0xbaef('0xe'),'context':_0x20dd1a[_0xbaef('0x7')],'exten':_0x20dd1a[_0xbaef('0x8')],'priority':_0x41078d++,'VoiceExtensionId':_0x20dd1a['id']},{'type':_0x20dd1a['type'],'app':_0xbaef('0x5'),'appdata':_0xbaef('0xf'),'context':_0x20dd1a['context'],'exten':_0x20dd1a[_0xbaef('0x8')],'priority':_0x41078d++,'VoiceExtensionId':_0x20dd1a['id']});return _0x47d363;}function _0x35cf11(_0x5e99ae){var _0x5e7ba1=0x2;var _0x3a2814=[{'type':_0xbaef('0x10'),'app':_0xbaef('0x5'),'appdata':_0xbaef('0x11'),'context':_0x5e99ae[_0xbaef('0x7')],'exten':_0x5e99ae[_0xbaef('0x8')],'priority':_0x5e7ba1++,'VoiceExtensionId':_0x5e99ae['id']},{'type':'outbound','app':_0x5e99ae[_0xbaef('0x9')]?'Set':_0xbaef('0x12'),'appdata':_0x5e99ae[_0xbaef('0x9')]?_0xbaef('0xa')+_0x5e99ae[_0xbaef('0x9')]:_0xbaef('0x13'),'context':_0x5e99ae[_0xbaef('0x7')],'exten':_0x5e99ae[_0xbaef('0x8')],'priority':_0x5e7ba1++,'VoiceExtensionId':_0x5e99ae['id']},{'type':'outbound','app':_0xbaef('0x5'),'appdata':_0xbaef('0x14')+(_0x5e99ae[_0xbaef('0x15')]?_0xbaef('0x16')+_0x5e99ae[_0xbaef('0x15')]+'}':_0xbaef('0x17')),'context':_0x5e99ae[_0xbaef('0x7')],'exten':_0x5e99ae[_0xbaef('0x8')],'priority':_0x5e7ba1++,'VoiceExtensionId':_0x5e99ae['id']},{'type':_0xbaef('0x10'),'app':_0xbaef('0x5'),'appdata':_0xbaef('0x18')+_0x5e99ae['id'],'context':_0x5e99ae[_0xbaef('0x7')],'exten':_0x5e99ae[_0xbaef('0x8')],'priority':_0x5e7ba1++,'VoiceExtensionId':_0x5e99ae['id']},{'type':_0xbaef('0x10'),'app':_0xbaef('0x19'),'appdata':_0xbaef('0x1a')+(_0x5e7ba1+0x2)+'):Goto('+(_0x5e7ba1+0x1)+')','context':_0x5e99ae[_0xbaef('0x7')],'exten':_0x5e99ae[_0xbaef('0x8')],'priority':_0x5e7ba1++,'VoiceExtensionId':_0x5e99ae['id']},{'type':_0xbaef('0x10'),'app':'Set','appdata':_0x5e99ae[_0xbaef('0x15')]?_0xbaef('0x1b')+_0x5e99ae[_0xbaef('0x15')]+'}':'CDR(prefix)=noprefix','context':_0x5e99ae[_0xbaef('0x7')],'exten':_0x5e99ae[_0xbaef('0x8')],'priority':_0x5e7ba1++,'VoiceExtensionId':_0x5e99ae['id']},{'type':'outbound','app':_0xbaef('0x5'),'appdata':_0xbaef('0xd'),'context':_0x5e99ae['context'],'exten':_0x5e99ae[_0xbaef('0x8')],'priority':_0x5e7ba1++,'VoiceExtensionId':_0x5e99ae['id']},{'type':'outbound','app':_0xbaef('0x5'),'appdata':_0xbaef('0xe'),'context':_0x5e99ae[_0xbaef('0x7')],'exten':_0x5e99ae[_0xbaef('0x8')],'priority':_0x5e7ba1++,'VoiceExtensionId':_0x5e99ae['id']},{'type':'outbound','app':_0xbaef('0x5'),'appdata':_0xbaef('0xf'),'context':_0x5e99ae['context'],'exten':_0x5e99ae[_0xbaef('0x8')],'priority':_0x5e7ba1++,'VoiceExtensionId':_0x5e99ae['id']},{'type':'outbound','app':_0xbaef('0x5'),'appdata':'outboundrouteid='+_0x5e99ae['id'],'context':_0x5e99ae['context'],'exten':_0x5e99ae['exten'],'priority':_0x5e7ba1++,'VoiceExtensionId':_0x5e99ae['id']}];if(_0x5e99ae[_0xbaef('0x1c')](_0xbaef('0x1d'))&&_0x5e99ae['recordingFormat']!==_0xbaef('0x1e')){_0x3a2814['push']({'type':'outbound','app':_0xbaef('0x5'),'appdata':_0xbaef('0x1f'),'context':_0x5e99ae[_0xbaef('0x7')],'exten':_0x5e99ae[_0xbaef('0x8')],'priority':_0x5e7ba1++,'VoiceExtensionId':_0x5e99ae['id']},{'type':_0xbaef('0x10'),'app':_0xbaef('0x5'),'appdata':_0xbaef('0x20')+_0x5e99ae[_0xbaef('0x1d')]||'wav','context':_0x5e99ae[_0xbaef('0x7')],'exten':_0x5e99ae[_0xbaef('0x8')],'priority':_0x5e7ba1++,'VoiceExtensionId':_0x5e99ae['id']});}return _0x3a2814;}function _0x5d9974(_0x2a896a){var _0xcb2af2=[{'name':'trunk','param':0x0},{'name':_0xbaef('0x21'),'param':0x1},{'name':'options','param':0x2},{'name':'url','param':0x3}];var _0x5111b5={};var _0x1e51f1=_0x2a896a[_0xbaef('0x22')](',');var _0x1b5e3f=[];for(var _0x4b4c25=0x0;_0x4b4c25<_0xcb2af2[_0xbaef('0x23')];_0x4b4c25++){switch(_0xcb2af2[_0x4b4c25][_0xbaef('0x24')]){case'trunk':_0x5111b5[_0xbaef('0x25')]=_0x1e51f1[_0xcb2af2[_0x4b4c25][_0xbaef('0x26')]][_0xbaef('0x22')]('/')[0x1];_0x5111b5['phone']=_0x1e51f1[_0xcb2af2[_0x4b4c25][_0xbaef('0x26')]][_0xbaef('0x22')]('/')[0x2];_0x5111b5[_0xbaef('0x27')]=_0x5111b5['phone']?_0x5111b5['phone'][_0xbaef('0x22')]('$')[0x0]:undefined;_0x5111b5[_0xbaef('0x28')]=route[_0xbaef('0x15')]?(_0x5111b5[_0xbaef('0x27')]||'')+_0xbaef('0x16')+route['cutdigits']+'}':(_0x5111b5[_0xbaef('0x27')]||'')+_0xbaef('0x17');_0x1b5e3f[_0xcb2af2[_0x4b4c25][_0xbaef('0x26')]]=[_0xbaef('0x29'),_0x5111b5[_0xbaef('0x25')],_0x5111b5['phone']][_0xbaef('0x2a')]('/');break;case _0xbaef('0x2b'):_0x5111b5[_0xbaef('0x2b')]=_0x1e51f1[_0xcb2af2[_0x4b4c25]['param']];if(route['recordingFormat']!=='none'){if(_0x5111b5[_0xbaef('0x2b')][_0xbaef('0x2c')](_0xbaef('0x2d'))<0x0){_0x5111b5['options']+='U(xcally-mixmonitor-context)';}}else{_0x5111b5[_0xbaef('0x2b')]=_0x5111b5[_0xbaef('0x2b')][_0xbaef('0x2e')](_0xbaef('0x2d'),'');}_0x1b5e3f[_0xcb2af2[_0x4b4c25][_0xbaef('0x26')]]=_0x5111b5['options'];break;default:_0x1b5e3f[_0xcb2af2[_0x4b4c25][_0xbaef('0x26')]]=_0x1e51f1[_0xcb2af2[_0x4b4c25][_0xbaef('0x26')]];}}return _0x1b5e3f['join'](',');}function _0x10b67d(_0x11646e,_0x171c48,_0x3f2ff5,_0x210b37){return new Promise(function(_0x33fc40,_0x2f6ba2){var _0x1753cc=[];if(_[_0xbaef('0x2f')](_0x171c48))return _0x33fc40(_0x1753cc);_0x14f7a4['Interval'][_0xbaef('0x30')]({'attributes':['id','interval',_0xbaef('0x31')],'raw':!![]})['then'](function(_0xef3356){for(var _0x470435=0x0,_0x11bde3=0x0;_0x470435<_0x171c48[_0xbaef('0x23')];_0x470435++,_0x11bde3=0x0){var _0x244288=_0x171c48[_0x470435];var _0x4c10d0=[];var _0x4803e2=[];if(_0x244288[_0xbaef('0x32')]!==_0xbaef('0x33')){_0x244288[_0xbaef('0x34')]=[_0x244288['interval']];}else{_0x244288[_0xbaef('0x34')]=_0x244288[_0xbaef('0x31')]?_['map'](_['filter'](_0xef3356,{'IntervalId':_0x244288['IntervalId']}),_0xbaef('0x32')):[];}_0x244288[_0xbaef('0x7')]=_0x11646e[_0xbaef('0x7')];_0x244288[_0xbaef('0x8')]=_0x11646e[_0xbaef('0x8')];if(_0x244288[_0xbaef('0x4')])_0x244288[_0xbaef('0x4')]=_0x244288[_0xbaef('0x4')][_0xbaef('0x35')]();if(_0x11646e[_0xbaef('0x4')]===_0xbaef('0x10')){if(_0x244288[_0xbaef('0x1c')](_0xbaef('0x36'))&&_0x244288[_0xbaef('0x36')]&&_0x244288[_0xbaef('0x36')]!=='--'){_0x4c10d0[_0xbaef('0xc')]({'type':_0x244288[_0xbaef('0x4')][_0xbaef('0x35')](),'app':_0xbaef('0x5'),'appdata':'CDR(tag)='+_0x244288[_0xbaef('0x36')],'context':_0x11646e[_0xbaef('0x7')],'exten':_0x11646e[_0xbaef('0x8')],'priority':_0x244288['intervals'][_0xbaef('0x23')]+_0x3f2ff5+_0x11bde3++,'VoiceExtensionId':_0x11646e['id']});}_0x4c10d0[_0xbaef('0xc')]({'type':_0x244288[_0xbaef('0x4')][_0xbaef('0x35')](),'app':_0xbaef('0x19'),'appdata':_0xbaef('0x37')+(_0x244288[_0xbaef('0x38')]?_0xbaef('0x39')+_0x244288['callerID']+')':_0xbaef('0x3a')),'context':_0x11646e[_0xbaef('0x7')],'exten':_0x11646e[_0xbaef('0x8')],'priority':_0x244288[_0xbaef('0x34')][_0xbaef('0x23')]+_0x3f2ff5+_0x11bde3++,'VoiceExtensionId':_0x11646e['id']});}else{if(_0x244288[_0xbaef('0x1c')]('answer')){if([_0xbaef('0x3b'),'playback'][_0xbaef('0x3c')](_0x244288['app']['toLowerCase']())&&_0x244288[_0xbaef('0x3d')]!==_0xbaef('0x3e')){if(_0x244288[_0xbaef('0x3f')]){_0x4c10d0[_0xbaef('0xc')]({'type':_0x244288[_0xbaef('0x4')][_0xbaef('0x35')](),'app':_0xbaef('0x19'),'appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x11646e[_0xbaef('0x7')],'exten':_0x11646e[_0xbaef('0x8')],'priority':_0x244288[_0xbaef('0x34')][_0xbaef('0x23')]+_0x3f2ff5+_0x11bde3++,'VoiceExtensionId':_0x11646e['id']});_0x4c10d0['push']({'type':_0x244288['type']['toLowerCase'](),'app':_0xbaef('0x5'),'appdata':_0xbaef('0x40'),'context':_0x11646e[_0xbaef('0x7')],'exten':_0x11646e[_0xbaef('0x8')],'priority':_0x244288[_0xbaef('0x34')][_0xbaef('0x23')]+_0x3f2ff5+_0x11bde3++,'VoiceExtensionId':_0x11646e['id']});}else{_0x4c10d0[_0xbaef('0xc')]({'type':_0x244288['type'][_0xbaef('0x35')](),'app':_0xbaef('0x19'),'appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x11646e['context'],'exten':_0x11646e['exten'],'priority':_0x244288[_0xbaef('0x34')]['length']+_0x3f2ff5+_0x11bde3++,'VoiceExtensionId':_0x11646e['id']});_0x4c10d0[_0xbaef('0xc')]({'type':_0x244288[_0xbaef('0x4')][_0xbaef('0x35')](),'app':_0xbaef('0x5'),'appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x11646e[_0xbaef('0x7')],'exten':_0x11646e[_0xbaef('0x8')],'priority':_0x244288[_0xbaef('0x34')][_0xbaef('0x23')]+_0x3f2ff5+_0x11bde3++,'VoiceExtensionId':_0x11646e['id']});}}}}for(var _0xa283a0=0x0;_0xa283a0<_0x244288[_0xbaef('0x34')][_0xbaef('0x23')];_0xa283a0++){var _0x2f3dd4=_0x3f2ff5+_0x244288[_0xbaef('0x34')][_0xbaef('0x23')];var _0x4d6735=_0xa283a0===_0x244288['intervals'][_0xbaef('0x23')]-0x1?_0x3f2ff5+_0x4c10d0[_0xbaef('0x23')]+_0x4803e2[_0xbaef('0x23')]+0x2:_0x3f2ff5+_0xa283a0+0x1;_0x4c10d0['splice'](_0xa283a0,0x0,{'type':_0x11646e[_0xbaef('0x4')],'app':'GotoIfTime','appdata':_0x244288[_0xbaef('0x34')][_0xa283a0]+'?'+_0x11646e[_0xbaef('0x7')]+_0xbaef('0x41')+_0x2f3dd4+':'+_0x11646e[_0xbaef('0x7')]+_0xbaef('0x41')+_0x4d6735,'exten':_0x11646e[_0xbaef('0x8')],'context':_0x11646e[_0xbaef('0x7')],'priority':_0x3f2ff5+_0xa283a0,'VoiceExtensionId':_0x11646e['id']});}if(_0x210b37&&_0x244288[_0xbaef('0x3d')]==='outboundDial')_0x244288[_0xbaef('0x42')]=_0x5d9974(_0x244288[_0xbaef('0x42')]);_0x244288[_0xbaef('0x43')]=_0x4c10d0[_0xbaef('0x23')]?_[_0xbaef('0x44')](_0x4c10d0)[_0xbaef('0x43')]+0x1:_0x3f2ff5;_0x1753cc=_[_0xbaef('0x45')](_0x1753cc,_0x4c10d0,[_0x244288],_0x4803e2);_0x3f2ff5=_[_0xbaef('0x44')](_0x1753cc)['priority']+0x1;}return _0x33fc40(_0x1753cc);})[_0xbaef('0x46')](function(_0xf77b34){_0x2f6ba2(_0xf77b34);});});}return _0x2ffa83[_0xbaef('0x47')](_0xbaef('0x48'),attributes,{'tableName':'voice_extensions','paranoid':![],'indexes':[],'timestamps':!![],'instanceMethods':{'createRouting':function(_0x1f9f70,_0x5e80bd){var _0x35a593=this;var _0x36e530=_0x35a593[_0xbaef('0x4')]==='outbound'?_0x35cf11(_0x35a593):_0x1104cb(_0x35a593);return _0x10b67d(_0x35a593,_0x1f9f70,_['last'](_0x36e530)[_0xbaef('0x43')]+0x1,_0x5e80bd)[_0xbaef('0x49')](function(_0x443c8f){var _0x264f1a=_[_0xbaef('0x45')](_0x36e530,_0x443c8f);_0x264f1a[_0xbaef('0xc')]({'type':_0x35a593[_0xbaef('0x4')],'app':_0xbaef('0x4a'),'exten':_0x35a593[_0xbaef('0x8')],'context':_0x35a593[_0xbaef('0x7')],'priority':_[_0xbaef('0x44')](_0x264f1a)[_0xbaef('0x43')]+0x1,'VoiceExtensionId':_0x35a593['id']});return _0x264f1a;});}}});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index 5f103ec..b1e612b 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 _0x8458=['catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','./voiceExtension.socket','register','request','then','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetVoiceExtension','options','attributes','include','map','model'];(function(_0x1c6941,_0x26af8f){var _0x431d37=function(_0x5812f1){while(--_0x5812f1){_0x1c6941['push'](_0x1c6941['shift']());}};_0x431d37(++_0x26af8f);}(_0x8458,0x1a5));var _0x8845=function(_0x11cc77,_0x17d347){_0x11cc77=_0x11cc77-0x0;var _0x37fb19=_0x8458[_0x11cc77];return _0x37fb19;};'use strict';var _=require(_0x8845('0x0'));var util=require('util');var moment=require(_0x8845('0x1'));var BPromise=require(_0x8845('0x2'));var rs=require(_0x8845('0x3'));var fs=require('fs');var Redis=require(_0x8845('0x4'));var db=require(_0x8845('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x8845('0x6'))(_0x8845('0x7'));var config=require(_0x8845('0x8'));var jayson=require(_0x8845('0x9'));var client=jayson[_0x8845('0xa')]['http']({'port':0x232a});config[_0x8845('0xb')]=_['defaults'](config[_0x8845('0xb')],{'host':_0x8845('0xc'),'port':0x18eb});var socket=require(_0x8845('0xd'))(new Redis(config['redis']));require(_0x8845('0xe'))[_0x8845('0xf')](socket);function respondWithRpcPromise(_0x59cd0b,_0x33d23e,_0xd846f1){return new BPromise(function(_0x55703d,_0x3b9c78){return client[_0x8845('0x10')](_0x59cd0b,_0xd846f1)[_0x8845('0x11')](function(_0x1f1027){logger[_0x8845('0x12')](_0x8845('0x13'),_0x33d23e,_0x8845('0x14'));logger[_0x8845('0x15')](_0x8845('0x16'),_0x33d23e,_0x8845('0x14'),JSON[_0x8845('0x17')](_0x1f1027));if(_0x1f1027[_0x8845('0x18')]){if(_0x1f1027[_0x8845('0x18')][_0x8845('0x19')]===0x1f4){logger['error'](_0x8845('0x13'),_0x33d23e,_0x1f1027[_0x8845('0x18')]['message']);return _0x3b9c78(_0x1f1027[_0x8845('0x18')][_0x8845('0x1a')]);}logger[_0x8845('0x18')]('VoiceExtension,\x20%s,\x20%s',_0x33d23e,_0x1f1027['error']['message']);return _0x55703d(_0x1f1027[_0x8845('0x18')][_0x8845('0x1a')]);}else{logger[_0x8845('0x12')](_0x8845('0x13'),_0x33d23e,_0x8845('0x14'));_0x55703d(_0x1f1027[_0x8845('0x1b')][_0x8845('0x1a')]);}})['catch'](function(_0x4e6a6f){logger['error'](_0x8845('0x13'),_0x33d23e,_0x4e6a6f);_0x3b9c78(_0x4e6a6f);});});}exports[_0x8845('0x1c')]=function(_0x122c92){var _0x380010=this;return new Promise(function(_0x49ec66,_0x2e94f5){return db['VoiceExtension']['findAll']({'raw':_0x122c92[_0x8845('0x1d')]?_0x122c92[_0x8845('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x122c92[_0x8845('0x1d')]?_0x122c92[_0x8845('0x1d')]['where']||null:null,'attributes':_0x122c92[_0x8845('0x1d')]?_0x122c92[_0x8845('0x1d')][_0x8845('0x1e')]||null:null,'limit':_0x122c92[_0x8845('0x1d')]?_0x122c92['options']['limit']||null:null,'include':_0x122c92[_0x8845('0x1d')]?_0x122c92[_0x8845('0x1d')][_0x8845('0x1f')]?_[_0x8845('0x20')](_0x122c92[_0x8845('0x1d')][_0x8845('0x1f')],function(_0x37eea4){return{'model':db[_0x37eea4[_0x8845('0x21')]],'as':_0x37eea4['as'],'attributes':_0x37eea4[_0x8845('0x1e')],'include':_0x37eea4[_0x8845('0x1f')]?_[_0x8845('0x20')](_0x37eea4[_0x8845('0x1f')],function(_0x3d8c5d){return{'model':db[_0x3d8c5d[_0x8845('0x21')]],'as':_0x3d8c5d['as'],'attributes':_0x3d8c5d[_0x8845('0x1e')],'include':_0x3d8c5d[_0x8845('0x1f')]?_[_0x8845('0x20')](_0x3d8c5d['include'],function(_0x47dfff){return{'model':db[_0x47dfff[_0x8845('0x21')]],'as':_0x47dfff['as'],'attributes':_0x47dfff[_0x8845('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x8845('0x11')](function(_0x3cc594){logger[_0x8845('0x12')](_0x8845('0x1c'),_0x122c92);logger[_0x8845('0x15')]('GetVoiceExtension',_0x122c92,JSON[_0x8845('0x17')](_0x3cc594));_0x49ec66(_0x3cc594);})[_0x8845('0x22')](function(_0x501362){logger[_0x8845('0x18')](_0x8845('0x1c'),_0x501362[_0x8845('0x1a')],_0x122c92);_0x2e94f5(_0x380010[_0x8845('0x18')](0x1f4,_0x501362[_0x8845('0x1a')]));});});}; \ No newline at end of file +var _0x1c88=['options','where','attributes','limit','include','map','model','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','VoiceExtension,\x20%s,\x20%s','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetVoiceExtension','raw'];(function(_0x565ed7,_0x398228){var _0x183ad7=function(_0x5a43d7){while(--_0x5a43d7){_0x565ed7['push'](_0x565ed7['shift']());}};_0x183ad7(++_0x398228);}(_0x1c88,0x1a9));var _0x81c8=function(_0xc55c68,_0x292a8b){_0xc55c68=_0xc55c68-0x0;var _0x148523=_0x1c88[_0xc55c68];return _0x148523;};'use strict';var _=require(_0x81c8('0x0'));var util=require('util');var moment=require(_0x81c8('0x1'));var BPromise=require(_0x81c8('0x2'));var rs=require(_0x81c8('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x81c8('0x4'));var logger=require(_0x81c8('0x5'))(_0x81c8('0x6'));var config=require(_0x81c8('0x7'));var jayson=require(_0x81c8('0x8'));var client=jayson[_0x81c8('0x9')][_0x81c8('0xa')]({'port':0x232a});config[_0x81c8('0xb')]=_[_0x81c8('0xc')](config[_0x81c8('0xb')],{'host':_0x81c8('0xd'),'port':0x18eb});var socket=require(_0x81c8('0xe'))(new Redis(config[_0x81c8('0xb')]));require('./voiceExtension.socket')[_0x81c8('0xf')](socket);function respondWithRpcPromise(_0x3b326c,_0xed3907,_0x5c7dde){return new BPromise(function(_0x4cc5b3,_0x2495a6){return client[_0x81c8('0x10')](_0x3b326c,_0x5c7dde)[_0x81c8('0x11')](function(_0x47b6f6){logger[_0x81c8('0x12')](_0x81c8('0x13'),_0xed3907,'request\x20sent');logger[_0x81c8('0x14')](_0x81c8('0x15'),_0xed3907,_0x81c8('0x16'),JSON[_0x81c8('0x17')](_0x47b6f6));if(_0x47b6f6['error']){if(_0x47b6f6[_0x81c8('0x18')][_0x81c8('0x19')]===0x1f4){logger[_0x81c8('0x18')]('VoiceExtension,\x20%s,\x20%s',_0xed3907,_0x47b6f6[_0x81c8('0x18')][_0x81c8('0x1a')]);return _0x2495a6(_0x47b6f6[_0x81c8('0x18')]['message']);}logger[_0x81c8('0x18')](_0x81c8('0x13'),_0xed3907,_0x47b6f6[_0x81c8('0x18')][_0x81c8('0x1a')]);return _0x4cc5b3(_0x47b6f6[_0x81c8('0x18')]['message']);}else{logger[_0x81c8('0x12')](_0x81c8('0x13'),_0xed3907,'request\x20sent');_0x4cc5b3(_0x47b6f6[_0x81c8('0x1b')][_0x81c8('0x1a')]);}})[_0x81c8('0x1c')](function(_0x2f8d75){logger[_0x81c8('0x18')](_0x81c8('0x13'),_0xed3907,_0x2f8d75);_0x2495a6(_0x2f8d75);});});}exports[_0x81c8('0x1d')]=function(_0x325e90){var _0x336ebf=this;return new Promise(function(_0x47a6bb,_0x2af7b6){return db['VoiceExtension']['findAll']({'raw':_0x325e90['options']?_0x325e90['options'][_0x81c8('0x1e')]===undefined?!![]:![]:!![],'where':_0x325e90['options']?_0x325e90[_0x81c8('0x1f')][_0x81c8('0x20')]||null:null,'attributes':_0x325e90[_0x81c8('0x1f')]?_0x325e90[_0x81c8('0x1f')][_0x81c8('0x21')]||null:null,'limit':_0x325e90[_0x81c8('0x1f')]?_0x325e90[_0x81c8('0x1f')][_0x81c8('0x22')]||null:null,'include':_0x325e90[_0x81c8('0x1f')]?_0x325e90[_0x81c8('0x1f')][_0x81c8('0x23')]?_[_0x81c8('0x24')](_0x325e90[_0x81c8('0x1f')]['include'],function(_0xb71afc){return{'model':db[_0xb71afc[_0x81c8('0x25')]],'as':_0xb71afc['as'],'attributes':_0xb71afc[_0x81c8('0x21')],'include':_0xb71afc[_0x81c8('0x23')]?_['map'](_0xb71afc[_0x81c8('0x23')],function(_0x4c10e5){return{'model':db[_0x4c10e5[_0x81c8('0x25')]],'as':_0x4c10e5['as'],'attributes':_0x4c10e5[_0x81c8('0x21')],'include':_0x4c10e5[_0x81c8('0x23')]?_[_0x81c8('0x24')](_0x4c10e5[_0x81c8('0x23')],function(_0x3ac0e4){return{'model':db[_0x3ac0e4[_0x81c8('0x25')]],'as':_0x3ac0e4['as'],'attributes':_0x3ac0e4[_0x81c8('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x363724){logger['info'](_0x81c8('0x1d'),_0x325e90);logger[_0x81c8('0x14')](_0x81c8('0x1d'),_0x325e90,JSON[_0x81c8('0x17')](_0x363724));_0x47a6bb(_0x363724);})[_0x81c8('0x1c')](function(_0x1d580f){logger[_0x81c8('0x18')]('GetVoiceExtension',_0x1d580f[_0x81c8('0x1a')],_0x325e90);_0x2af7b6(_0x336ebf['error'](0x1f4,_0x1d580f[_0x81c8('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index 6948ab0..3acde6a 100644 --- a/server/api/voiceExtension/voiceExtension.socket.js +++ b/server/api/voiceExtension/voiceExtension.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe14b=['removeListener','register','length','./voiceExtension.events','save','emit'];(function(_0x382f48,_0x1dcf6c){var _0x17d345=function(_0x31ee10){while(--_0x31ee10){_0x382f48['push'](_0x382f48['shift']());}};_0x17d345(++_0x1dcf6c);}(_0xe14b,0x93));var _0xbe14=function(_0xc2188c,_0x282cd6){_0xc2188c=_0xc2188c-0x0;var _0x2287c4=_0xe14b[_0xc2188c];return _0x2287c4;};'use strict';var VoiceExtensionEvents=require(_0xbe14('0x0'));var events=[_0xbe14('0x1'),'remove','update'];function createListener(_0x11c3a0,_0x36393a){return function(_0x48a116){_0x36393a[_0xbe14('0x2')](_0x11c3a0,_0x48a116);};}function removeListener(_0x5ce8fb,_0x496c04){return function(){VoiceExtensionEvents[_0xbe14('0x3')](_0x5ce8fb,_0x496c04);};}exports[_0xbe14('0x4')]=function(_0x1fe204){for(var _0x1ff100=0x0,_0x1d9ade=events[_0xbe14('0x5')];_0x1ff100<_0x1d9ade;_0x1ff100++){var _0x196fca=events[_0x1ff100];var _0x566ae7=createListener('voiceExtension:'+_0x196fca,_0x1fe204);VoiceExtensionEvents['on'](_0x196fca,_0x566ae7);}}; \ No newline at end of file +var _0x2ef3=['update','emit','removeListener','register','length','voiceExtension:','./voiceExtension.events','save','remove'];(function(_0x1b281e,_0xf48af0){var _0x504175=function(_0x466f4e){while(--_0x466f4e){_0x1b281e['push'](_0x1b281e['shift']());}};_0x504175(++_0xf48af0);}(_0x2ef3,0xba));var _0x32ef=function(_0x504195,_0xeecada){_0x504195=_0x504195-0x0;var _0xf6a2f5=_0x2ef3[_0x504195];return _0xf6a2f5;};'use strict';var VoiceExtensionEvents=require(_0x32ef('0x0'));var events=[_0x32ef('0x1'),_0x32ef('0x2'),_0x32ef('0x3')];function createListener(_0x3944df,_0x38047b){return function(_0x48106c){_0x38047b[_0x32ef('0x4')](_0x3944df,_0x48106c);};}function removeListener(_0x38b7f3,_0x524ab6){return function(){VoiceExtensionEvents[_0x32ef('0x5')](_0x38b7f3,_0x524ab6);};}exports[_0x32ef('0x6')]=function(_0x4c8104){for(var _0x5dfa09=0x0,_0x2c0089=events[_0x32ef('0x7')];_0x5dfa09<_0x2c0089;_0x5dfa09++){var _0x367c39=events[_0x5dfa09];var _0x2fb8eb=createListener(_0x32ef('0x8')+_0x367c39,_0x4c8104);VoiceExtensionEvents['on'](_0x367c39,_0x2fb8eb);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index 52fa695..456e28a 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 _0x4325=['get','/:id/messages','getMessages','put','update','destroy','multer','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./voiceMail.controller','isAuthenticated','index','/:id','show'];(function(_0x1115ee,_0x3480c6){var _0x34de4b=function(_0xe229c6){while(--_0xe229c6){_0x1115ee['push'](_0x1115ee['shift']());}};_0x34de4b(++_0x3480c6);}(_0x4325,0x1da));var _0x5432=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x4325[_0x3bf83f];return _0x22c4a9;};'use strict';var multer=require(_0x5432('0x0'));var util=require(_0x5432('0x1'));var path=require('path');var timeout=require(_0x5432('0x2'));var express=require(_0x5432('0x3'));var router=express[_0x5432('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x5432('0x5'));var config=require(_0x5432('0x6'));var controller=require(_0x5432('0x7'));router['get']('/',auth[_0x5432('0x8')](),controller[_0x5432('0x9')]);router['get'](_0x5432('0xa'),auth['isAuthenticated'](),controller[_0x5432('0xb')]);router[_0x5432('0xc')](_0x5432('0xd'),auth[_0x5432('0x8')](),controller[_0x5432('0xe')]);router['post']('/',auth[_0x5432('0x8')](),controller['create']);router[_0x5432('0xf')](_0x5432('0xa'),auth[_0x5432('0x8')](),controller[_0x5432('0x10')]);router['delete']('/:id',auth[_0x5432('0x8')](),controller[_0x5432('0x11')]);module['exports']=router; \ No newline at end of file +var _0xbff5=['fs-extra','../../components/interaction/service','get','isAuthenticated','index','/:id','show','/:id/messages','getMessages','create','update','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x1992f1,_0x5c61f0){var _0x413dfe=function(_0x2136e5){while(--_0x2136e5){_0x1992f1['push'](_0x1992f1['shift']());}};_0x413dfe(++_0x5c61f0);}(_0xbff5,0x1bc));var _0x5bff=function(_0x363a90,_0x50979f){_0x363a90=_0x363a90-0x0;var _0x32dce0=_0xbff5[_0x363a90];return _0x32dce0;};'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('./voiceMail.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['post']('/',auth[_0x5bff('0x9')](),controller[_0x5bff('0xf')]);router['put'](_0x5bff('0xb'),auth['isAuthenticated'](),controller[_0x5bff('0x10')]);router['delete'](_0x5bff('0xb'),auth[_0x5bff('0x9')](),controller['destroy']);module[_0x5bff('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index 3dbe325..062f950 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 _0x8815=['VIRTUAL','getDataValue','fullname','\x20-\x20','mailbox','exports','STRING','from-voicemail','contest_mailbox','setDataValue','email','string','trim','central','ENUM','yes','INTEGER'];(function(_0x2d9bb4,_0x315ed0){var _0x3d6b43=function(_0x311f5d){while(--_0x311f5d){_0x2d9bb4['push'](_0x2d9bb4['shift']());}};_0x3d6b43(++_0x315ed0);}(_0x8815,0x1e1));var _0x5881=function(_0x1fa381,_0x758c2a){_0x1fa381=_0x1fa381-0x0;var _0x47eefe=_0x8815[_0x1fa381];return _0x47eefe;};'use strict';var Sequelize=require('sequelize');module[_0x5881('0x0')]={'customer_id':{'type':Sequelize[_0x5881('0x1')]},'context':{'type':Sequelize[_0x5881('0x1')],'defaultValue':_0x5881('0x2'),'unique':_0x5881('0x3')},'mailbox':{'type':Sequelize[_0x5881('0x1')],'defaultValue':'','allowNull':![],'unique':_0x5881('0x3')},'password':{'type':Sequelize[_0x5881('0x1')]},'fullname':{'type':Sequelize[_0x5881('0x1')]},'email':{'type':Sequelize[_0x5881('0x1')],'validate':{'isEmail':!![]},'set':function(_0x4cac80){this[_0x5881('0x4')](_0x5881('0x5'),typeof _0x4cac80===_0x5881('0x6')&&_0x4cac80[_0x5881('0x7')]()?_0x4cac80[_0x5881('0x7')]():null);}},'pager':{'type':Sequelize[_0x5881('0x1')]},'tz':{'type':Sequelize['STRING'],'defaultValue':_0x5881('0x8')},'attach':{'type':Sequelize[_0x5881('0x9')](_0x5881('0xa'),'no'),'defaultValue':_0x5881('0xa'),'allowNull':![]},'saycid':{'type':Sequelize[_0x5881('0x9')](_0x5881('0xa'),'no'),'defaultValue':'yes','allowNull':![]},'dialout':{'type':Sequelize[_0x5881('0x1')]},'callback':{'type':Sequelize[_0x5881('0x1')]},'review':{'type':Sequelize[_0x5881('0x9')](_0x5881('0xa'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x5881('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize['ENUM'](_0x5881('0xa'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x5881('0x9')](_0x5881('0xa'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':'TINYINT(4)','defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize['ENUM'](_0x5881('0xa'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x5881('0x9')]('yes','no'),'defaultValue':_0x5881('0xa'),'allowNull':![]},'forcename':{'type':Sequelize[_0x5881('0x9')](_0x5881('0xa'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x5881('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x5881('0x9')]('yes','no'),'defaultValue':_0x5881('0xa'),'allowNull':![]},'stamp':{'type':'TIMESTAMP'},'emailsubject':{'type':Sequelize[_0x5881('0x1')]},'emailbody':{'type':Sequelize[_0x5881('0x1')]},'maxsecs':{'type':Sequelize[_0x5881('0xb')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x5881('0xb')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x5881('0xc')],'get':function(){return this[_0x5881('0xd')](_0x5881('0xe'))+_0x5881('0xf')+this[_0x5881('0xd')](_0x5881('0x10'));}}}; \ No newline at end of file +var _0x886a=['email','string','trim','central','ENUM','yes','INTEGER','VIRTUAL','getDataValue','fullname','\x20-\x20','STRING','contest_mailbox'];(function(_0x1bf04a,_0x1322b4){var _0xdd5417=function(_0x15fb90){while(--_0x15fb90){_0x1bf04a['push'](_0x1bf04a['shift']());}};_0xdd5417(++_0x1322b4);}(_0x886a,0x66));var _0xa886=function(_0x1fd675,_0x165dfe){_0x1fd675=_0x1fd675-0x0;var _0x16b554=_0x886a[_0x1fd675];return _0x16b554;};'use strict';var Sequelize=require('sequelize');module['exports']={'customer_id':{'type':Sequelize[_0xa886('0x0')]},'context':{'type':Sequelize['STRING'],'defaultValue':'from-voicemail','unique':_0xa886('0x1')},'mailbox':{'type':Sequelize[_0xa886('0x0')],'defaultValue':'','allowNull':![],'unique':_0xa886('0x1')},'password':{'type':Sequelize['STRING']},'fullname':{'type':Sequelize[_0xa886('0x0')]},'email':{'type':Sequelize[_0xa886('0x0')],'validate':{'isEmail':!![]},'set':function(_0x54cc39){this['setDataValue'](_0xa886('0x2'),typeof _0x54cc39===_0xa886('0x3')&&_0x54cc39[_0xa886('0x4')]()?_0x54cc39['trim']():null);}},'pager':{'type':Sequelize[_0xa886('0x0')]},'tz':{'type':Sequelize['STRING'],'defaultValue':_0xa886('0x5')},'attach':{'type':Sequelize[_0xa886('0x6')](_0xa886('0x7'),'no'),'defaultValue':_0xa886('0x7'),'allowNull':![]},'saycid':{'type':Sequelize[_0xa886('0x6')](_0xa886('0x7'),'no'),'defaultValue':_0xa886('0x7'),'allowNull':![]},'dialout':{'type':Sequelize[_0xa886('0x0')]},'callback':{'type':Sequelize[_0xa886('0x0')]},'review':{'type':Sequelize[_0xa886('0x6')](_0xa886('0x7'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0xa886('0x6')](_0xa886('0x7'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize['ENUM'](_0xa886('0x7'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0xa886('0x6')](_0xa886('0x7'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':'TINYINT(4)','defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize['ENUM'](_0xa886('0x7'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize['ENUM'](_0xa886('0x7'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0xa886('0x6')]('yes','no'),'defaultValue':_0xa886('0x7'),'allowNull':![]},'forcename':{'type':Sequelize[_0xa886('0x6')](_0xa886('0x7'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0xa886('0x6')]('yes','no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0xa886('0x6')](_0xa886('0x7'),'no'),'defaultValue':_0xa886('0x7'),'allowNull':![]},'stamp':{'type':'TIMESTAMP'},'emailsubject':{'type':Sequelize[_0xa886('0x0')]},'emailbody':{'type':Sequelize[_0xa886('0x0')]},'maxsecs':{'type':Sequelize[_0xa886('0x8')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0xa886('0x8')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0xa886('0x9')],'get':function(){return this[_0xa886('0xa')](_0xa886('0xb'))+_0xa886('0xc')+this[_0xa886('0xa')]('mailbox');}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index 01be31c..c99df7f 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 _0xcf66=['nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','findOne','VoiceMailMessage','pick','mailbox','findAndCountAll','eml-format','rimraf','zip-dir','request-promise','moment','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','get','Voicemails','UserProfileResource','error','stack','name','VoiceMail','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty'];(function(_0x1ebeea,_0x2f54f4){var _0x576465=function(_0x47fc77){while(--_0x47fc77){_0x1ebeea['push'](_0x1ebeea['shift']());}};_0x576465(++_0x2f54f4);}(_0xcf66,0x71));var _0x6cf6=function(_0x43c51e,_0x286898){_0x43c51e=_0x43c51e-0x0;var _0x4428db=_0xcf66[_0x43c51e];return _0x4428db;};'use strict';var emlformat=require(_0x6cf6('0x0'));var rimraf=require(_0x6cf6('0x1'));var zipdir=require(_0x6cf6('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6cf6('0x3'));var moment=require(_0x6cf6('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x6cf6('0x5'));var path=require(_0x6cf6('0x6'));var sox=require('sox');var csv=require(_0x6cf6('0x7'));var ejs=require(_0x6cf6('0x8'));var fs=require('fs');var fs_extra=require(_0x6cf6('0x9'));var _=require('lodash');var squel=require(_0x6cf6('0xa'));var crypto=require(_0x6cf6('0xb'));var jsforce=require(_0x6cf6('0xc'));var deskjs=require(_0x6cf6('0xd'));var toCsv=require(_0x6cf6('0x7'));var querystring=require(_0x6cf6('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x6cf6('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6cf6('0x10'));var logger=require(_0x6cf6('0x11'))(_0x6cf6('0x12'));var utils=require(_0x6cf6('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3fdfea,_0x13b1ad){_0x13b1ad=_0x13b1ad||0xcc;return function(_0x372d12){if(_0x372d12){return _0x3fdfea[_0x6cf6('0x14')](_0x13b1ad);}return _0x3fdfea[_0x6cf6('0x15')](_0x13b1ad)[_0x6cf6('0x16')]();};}function respondWithResult(_0x57909f,_0x32fe64){_0x32fe64=_0x32fe64||0xc8;return function(_0x494ece){if(_0x494ece){return _0x57909f[_0x6cf6('0x15')](_0x32fe64)[_0x6cf6('0x17')](_0x494ece);}};}function respondWithFilteredResult(_0x4b073f,_0x40e413){return function(_0x1b40f8){if(_0x1b40f8){var _0x2d23ab=typeof _0x40e413[_0x6cf6('0x18')]===_0x6cf6('0x19')&&typeof _0x40e413[_0x6cf6('0x1a')]===_0x6cf6('0x19');var _0x39ec25=_0x1b40f8[_0x6cf6('0x1b')];var _0x2ca2b1=_0x2d23ab?0x0:_0x40e413['offset'];var _0x11d994=_0x2d23ab?_0x1b40f8[_0x6cf6('0x1b')]:_0x40e413[_0x6cf6('0x18')]+_0x40e413['limit'];var _0x18abd9;if(_0x11d994>=_0x39ec25){_0x11d994=_0x39ec25;_0x18abd9=0xc8;}else{_0x18abd9=0xce;}_0x4b073f[_0x6cf6('0x15')](_0x18abd9);return _0x4b073f[_0x6cf6('0x1c')](_0x6cf6('0x1d'),_0x2ca2b1+'-'+_0x11d994+'/'+_0x39ec25)[_0x6cf6('0x17')](_0x1b40f8);}return null;};}function patchUpdates(_0x21e903){return function(_0x123993){try{jsonpatch['apply'](_0x123993,_0x21e903,!![]);}catch(_0x19f2cd){return BPromise[_0x6cf6('0x1e')](_0x19f2cd);}return _0x123993[_0x6cf6('0x1f')]();};}function saveUpdates(_0x380a40,_0x5cba3a){return function(_0x470ea4){if(_0x470ea4){return _0x470ea4[_0x6cf6('0x20')](_0x380a40)[_0x6cf6('0x21')](function(_0x5b2767){return _0x5b2767;});}return null;};}function removeEntity(_0x5b30e0,_0x276225){return function(_0x59f838){if(_0x59f838){return _0x59f838[_0x6cf6('0x22')]()[_0x6cf6('0x21')](function(){var _0x14ae3e=_0x59f838[_0x6cf6('0x23')]({'plain':!![]});var _0x3f9871=_0x6cf6('0x24');return db[_0x6cf6('0x25')]['destroy']({'where':{'type':_0x3f9871,'resourceId':_0x14ae3e['id']}})[_0x6cf6('0x21')](function(){return _0x59f838;});})[_0x6cf6('0x21')](function(){_0x5b30e0[_0x6cf6('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0xf4eec5,_0x2e56ca){return function(_0x2224db){if(!_0x2224db){_0xf4eec5[_0x6cf6('0x14')](0x194);}return _0x2224db;};}function handleError(_0x5c9236,_0x584594){_0x584594=_0x584594||0x1f4;return function(_0x2afe84){logger[_0x6cf6('0x26')](_0x2afe84[_0x6cf6('0x27')]);if(_0x2afe84[_0x6cf6('0x28')]){delete _0x2afe84['name'];}_0x5c9236[_0x6cf6('0x15')](_0x584594)['send'](_0x2afe84);};}exports['index']=function(_0x519a70,_0x10bde5){var _0x65433={},_0x33d308={},_0x42f488={'count':0x0,'rows':[]};var _0x11c848=_['map'](db[_0x6cf6('0x29')][_0x6cf6('0x2a')],function(_0x356340){return{'name':_0x356340['fieldName'],'type':_0x356340[_0x6cf6('0x2b')][_0x6cf6('0x2c')]};});_0x33d308[_0x6cf6('0x2d')]=_[_0x6cf6('0x2e')](_0x11c848,_0x6cf6('0x28'));_0x33d308[_0x6cf6('0x2f')]=_[_0x6cf6('0x30')](_0x519a70[_0x6cf6('0x2f')]);_0x33d308[_0x6cf6('0x31')]=_[_0x6cf6('0x32')](_0x33d308[_0x6cf6('0x2d')],_0x33d308[_0x6cf6('0x2f')]);_0x65433[_0x6cf6('0x33')]=_[_0x6cf6('0x32')](_0x33d308[_0x6cf6('0x2d')],qs[_0x6cf6('0x34')](_0x519a70[_0x6cf6('0x2f')][_0x6cf6('0x34')]));_0x65433['attributes']=_0x65433[_0x6cf6('0x33')][_0x6cf6('0x35')]?_0x65433[_0x6cf6('0x33')]:_0x33d308[_0x6cf6('0x2d')];if(!_0x519a70[_0x6cf6('0x2f')][_0x6cf6('0x36')](_0x6cf6('0x37'))){_0x65433[_0x6cf6('0x1a')]=qs[_0x6cf6('0x1a')](_0x519a70[_0x6cf6('0x2f')][_0x6cf6('0x1a')]);_0x65433['offset']=qs[_0x6cf6('0x18')](_0x519a70[_0x6cf6('0x2f')][_0x6cf6('0x18')]);}_0x65433[_0x6cf6('0x38')]=qs[_0x6cf6('0x39')](_0x519a70[_0x6cf6('0x2f')][_0x6cf6('0x39')]);_0x65433[_0x6cf6('0x3a')]=qs[_0x6cf6('0x31')](_['pick'](_0x519a70[_0x6cf6('0x2f')],_0x33d308[_0x6cf6('0x31')]),_0x11c848);if(_0x519a70[_0x6cf6('0x2f')][_0x6cf6('0x3b')]){_0x65433[_0x6cf6('0x3a')]=_[_0x6cf6('0x3c')](_0x65433[_0x6cf6('0x3a')],{'$or':_[_0x6cf6('0x2e')](_0x11c848,function(_0x3a7c3b){if(_0x3a7c3b['type']!==_0x6cf6('0x3d')){var _0x5a9727={};_0x5a9727[_0x3a7c3b[_0x6cf6('0x28')]]={'$like':'%'+_0x519a70[_0x6cf6('0x2f')][_0x6cf6('0x3b')]+'%'};return _0x5a9727;}})});}_0x65433=_[_0x6cf6('0x3c')]({},_0x65433,_0x519a70[_0x6cf6('0x3e')]);var _0x29541e={'where':_0x65433[_0x6cf6('0x3a')]};return db[_0x6cf6('0x29')]['count'](_0x29541e)[_0x6cf6('0x21')](function(_0x335dce){_0x42f488['count']=_0x335dce;if(_0x519a70[_0x6cf6('0x2f')][_0x6cf6('0x3f')]){_0x65433[_0x6cf6('0x40')]=[{'all':!![]}];}return db['VoiceMail'][_0x6cf6('0x41')](_0x65433);})[_0x6cf6('0x21')](function(_0x51d915){_0x42f488[_0x6cf6('0x42')]=_0x51d915;return _0x42f488;})[_0x6cf6('0x21')](respondWithFilteredResult(_0x10bde5,_0x65433))[_0x6cf6('0x43')](handleError(_0x10bde5,null));};exports[_0x6cf6('0x44')]=function(_0x41195e,_0x20dacd){var _0xbcb6a7={'raw':!![],'where':{'id':_0x41195e[_0x6cf6('0x45')]['id']}},_0x5a2ef8={};_0x5a2ef8['model']=_[_0x6cf6('0x30')](db[_0x6cf6('0x29')]['rawAttributes']);_0x5a2ef8[_0x6cf6('0x2f')]=_[_0x6cf6('0x30')](_0x41195e[_0x6cf6('0x2f')]);_0x5a2ef8[_0x6cf6('0x31')]=_[_0x6cf6('0x32')](_0x5a2ef8['model'],_0x5a2ef8[_0x6cf6('0x2f')]);_0xbcb6a7[_0x6cf6('0x33')]=_[_0x6cf6('0x32')](_0x5a2ef8['model'],qs[_0x6cf6('0x34')](_0x41195e[_0x6cf6('0x2f')][_0x6cf6('0x34')]));_0xbcb6a7['attributes']=_0xbcb6a7[_0x6cf6('0x33')]['length']?_0xbcb6a7['attributes']:_0x5a2ef8[_0x6cf6('0x2d')];if(_0x41195e[_0x6cf6('0x2f')][_0x6cf6('0x3f')]){_0xbcb6a7[_0x6cf6('0x40')]=[{'all':!![]}];}_0xbcb6a7=_[_0x6cf6('0x3c')]({},_0xbcb6a7,_0x41195e[_0x6cf6('0x3e')]);return db[_0x6cf6('0x29')][_0x6cf6('0x46')](_0xbcb6a7)[_0x6cf6('0x21')](handleEntityNotFound(_0x20dacd,null))[_0x6cf6('0x21')](respondWithResult(_0x20dacd,null))[_0x6cf6('0x43')](handleError(_0x20dacd,null));};exports[_0x6cf6('0x47')]=function(_0x3786d1,_0x4c8ada){return db[_0x6cf6('0x29')][_0x6cf6('0x47')](_0x3786d1['body'],{})['then'](function(_0x10047a){var _0x17dd6e=_0x3786d1[_0x6cf6('0x48')][_0x6cf6('0x23')]({'plain':!![]});if(!_0x17dd6e)throw new Error(_0x6cf6('0x49'));if(_0x17dd6e[_0x6cf6('0x4a')]==='user'){var _0x115b9b=_0x10047a[_0x6cf6('0x23')]({'plain':!![]});var _0x2503dc='Voicemails';return db['UserProfileSection'][_0x6cf6('0x46')]({'where':{'name':_0x2503dc,'userProfileId':_0x17dd6e[_0x6cf6('0x4b')]},'raw':!![]})[_0x6cf6('0x21')](function(_0x255e88){if(_0x255e88&&_0x255e88[_0x6cf6('0x4c')]===0x0){return db[_0x6cf6('0x25')][_0x6cf6('0x47')]({'name':_0x115b9b[_0x6cf6('0x28')],'resourceId':_0x115b9b['id'],'type':_0x255e88[_0x6cf6('0x28')],'sectionId':_0x255e88['id']},{})[_0x6cf6('0x21')](function(){return _0x10047a;});}else{return _0x10047a;}})['catch'](function(_0x217072){logger[_0x6cf6('0x26')](_0x6cf6('0x4d'),_0x217072);throw _0x217072;});}return _0x10047a;})[_0x6cf6('0x21')](respondWithResult(_0x4c8ada,0xc9))[_0x6cf6('0x43')](handleError(_0x4c8ada,null));};exports[_0x6cf6('0x20')]=function(_0x2e1ee7,_0xce361){if(_0x2e1ee7[_0x6cf6('0x4e')]['id']){delete _0x2e1ee7[_0x6cf6('0x4e')]['id'];}return db[_0x6cf6('0x29')]['find']({'where':{'id':_0x2e1ee7[_0x6cf6('0x45')]['id']}})['then'](handleEntityNotFound(_0xce361,null))[_0x6cf6('0x21')](saveUpdates(_0x2e1ee7[_0x6cf6('0x4e')],null))['then'](respondWithResult(_0xce361,null))[_0x6cf6('0x43')](handleError(_0xce361,null));};exports[_0x6cf6('0x22')]=function(_0x4699d5,_0x1bdbc1){return db[_0x6cf6('0x29')][_0x6cf6('0x46')]({'where':{'id':_0x4699d5['params']['id']}})[_0x6cf6('0x21')](handleEntityNotFound(_0x1bdbc1,null))[_0x6cf6('0x21')](removeEntity(_0x1bdbc1,null))[_0x6cf6('0x43')](handleError(_0x1bdbc1,null));};exports['getMessages']=function(_0x4f1de3,_0x2c8736,_0x140ed2){return db['VoiceMail'][_0x6cf6('0x4f')]({'where':{'id':_0x4f1de3[_0x6cf6('0x45')]['id']}})[_0x6cf6('0x21')](handleEntityNotFound(_0x2c8736,null))[_0x6cf6('0x21')](function(_0x2e460a){var _0x58ec7e;var _0x3e7e5b={},_0x40b31f={};_0x40b31f['model']=_['keys'](db[_0x6cf6('0x50')][_0x6cf6('0x2a')]);_0x40b31f[_0x6cf6('0x2f')]=_[_0x6cf6('0x30')](_0x4f1de3[_0x6cf6('0x2f')]);_0x40b31f['filters']=_['intersection'](_0x40b31f[_0x6cf6('0x2d')],_0x40b31f[_0x6cf6('0x2f')]);_0x3e7e5b[_0x6cf6('0x33')]=_[_0x6cf6('0x32')](_0x40b31f[_0x6cf6('0x2d')],qs['fields'](_0x4f1de3['query']['fields']));_0x3e7e5b[_0x6cf6('0x33')]=_0x3e7e5b[_0x6cf6('0x33')][_0x6cf6('0x35')]?_0x3e7e5b[_0x6cf6('0x33')]:_0x40b31f['model'];if(!_0x4f1de3[_0x6cf6('0x2f')]['hasOwnProperty'](_0x6cf6('0x37'))){_0x3e7e5b['limit']=qs[_0x6cf6('0x1a')](_0x4f1de3[_0x6cf6('0x2f')][_0x6cf6('0x1a')]);_0x3e7e5b[_0x6cf6('0x18')]=qs[_0x6cf6('0x18')](_0x4f1de3['query'][_0x6cf6('0x18')]);}_0x3e7e5b['order']=qs[_0x6cf6('0x39')](_0x4f1de3['query'][_0x6cf6('0x39')]);_0x3e7e5b['where']=qs[_0x6cf6('0x31')](_[_0x6cf6('0x51')](_0x4f1de3['query'],_0x40b31f[_0x6cf6('0x31')]));if(_0x4f1de3[_0x6cf6('0x2f')][_0x6cf6('0x3b')]){_0x3e7e5b[_0x6cf6('0x3a')]=_[_0x6cf6('0x3c')](_0x3e7e5b[_0x6cf6('0x3a')],{'$or':_[_0x6cf6('0x2e')](_0x3e7e5b['attributes'],function(_0x4ff62b){var _0x2df3ea={};_0x2df3ea[_0x4ff62b]={'$like':'%'+_0x4f1de3[_0x6cf6('0x2f')]['filter']+'%'};return _0x2df3ea;})});}_0x3e7e5b[_0x6cf6('0x3a')]=_['merge'](_0x3e7e5b['where'],{'mailboxuser':_0x2e460a[_0x6cf6('0x52')]});_0x3e7e5b=_['merge']({},_0x3e7e5b,_0x4f1de3['options']);return db[_0x6cf6('0x50')][_0x6cf6('0x53')](_0x3e7e5b)[_0x6cf6('0x21')](respondWithFilteredResult(_0x2c8736,_0x3e7e5b));})['catch'](handleError(_0x2c8736,null));}; \ No newline at end of file +var _0xa571=['includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','findOne','params','VoiceMailMessage','filter','mailbox','findAndCountAll','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','save','update','then','destroy','get','Voicemails','UserProfileResource','end','error','stack','name','send','index','map','VoiceMail','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','where','merge','options','include','findAll','rows','catch'];(function(_0x4c245f,_0x2bb619){var _0x4a2b5a=function(_0x5b1279){while(--_0x5b1279){_0x4c245f['push'](_0x4c245f['shift']());}};_0x4a2b5a(++_0x2bb619);}(_0xa571,0x107));var _0x1a57=function(_0x5ccf18,_0x5d96d3){_0x5ccf18=_0x5ccf18-0x0;var _0xc33d73=_0xa571[_0x5ccf18];return _0xc33d73;};'use strict';var emlformat=require(_0x1a57('0x0'));var rimraf=require(_0x1a57('0x1'));var zipdir=require(_0x1a57('0x2'));var jsonpatch=require(_0x1a57('0x3'));var rp=require('request-promise');var moment=require(_0x1a57('0x4'));var BPromise=require(_0x1a57('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x1a57('0x6'));var sox=require('sox');var csv=require(_0x1a57('0x7'));var ejs=require(_0x1a57('0x8'));var fs=require('fs');var fs_extra=require(_0x1a57('0x9'));var _=require(_0x1a57('0xa'));var squel=require(_0x1a57('0xb'));var crypto=require(_0x1a57('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x1a57('0xd'));var toCsv=require(_0x1a57('0x7'));var querystring=require(_0x1a57('0xe'));var Papa=require('papaparse');var Redis=require(_0x1a57('0xf'));var authService=require(_0x1a57('0x10'));var qs=require(_0x1a57('0x11'));var as=require(_0x1a57('0x12'));var hardwareService=require(_0x1a57('0x13'));var logger=require(_0x1a57('0x14'))(_0x1a57('0x15'));var utils=require(_0x1a57('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x1a57('0x17'))['db'];function respondWithStatusCode(_0x1911b2,_0x202d9a){_0x202d9a=_0x202d9a||0xcc;return function(_0x5ae643){if(_0x5ae643){return _0x1911b2[_0x1a57('0x18')](_0x202d9a);}return _0x1911b2[_0x1a57('0x19')](_0x202d9a)['end']();};}function respondWithResult(_0x503278,_0x587422){_0x587422=_0x587422||0xc8;return function(_0xd08107){if(_0xd08107){return _0x503278[_0x1a57('0x19')](_0x587422)[_0x1a57('0x1a')](_0xd08107);}};}function respondWithFilteredResult(_0x153d01,_0x5802d6){return function(_0x20f7ad){if(_0x20f7ad){var _0x53c61f=typeof _0x5802d6['offset']===_0x1a57('0x1b')&&typeof _0x5802d6[_0x1a57('0x1c')]===_0x1a57('0x1b');var _0x51b4c2=_0x20f7ad[_0x1a57('0x1d')];var _0x1662a3=_0x53c61f?0x0:_0x5802d6[_0x1a57('0x1e')];var _0x53bb20=_0x53c61f?_0x20f7ad[_0x1a57('0x1d')]:_0x5802d6[_0x1a57('0x1e')]+_0x5802d6[_0x1a57('0x1c')];var _0xcba6b7;if(_0x53bb20>=_0x51b4c2){_0x53bb20=_0x51b4c2;_0xcba6b7=0xc8;}else{_0xcba6b7=0xce;}_0x153d01[_0x1a57('0x19')](_0xcba6b7);return _0x153d01['set']('Content-Range',_0x1662a3+'-'+_0x53bb20+'/'+_0x51b4c2)[_0x1a57('0x1a')](_0x20f7ad);}return null;};}function patchUpdates(_0x21e811){return function(_0x211c63){try{jsonpatch['apply'](_0x211c63,_0x21e811,!![]);}catch(_0x5c200e){return BPromise['reject'](_0x5c200e);}return _0x211c63[_0x1a57('0x1f')]();};}function saveUpdates(_0x113ad4,_0x3f52b9){return function(_0xee133b){if(_0xee133b){return _0xee133b[_0x1a57('0x20')](_0x113ad4)[_0x1a57('0x21')](function(_0x2efa49){return _0x2efa49;});}return null;};}function removeEntity(_0x2f8b00,_0x183ca3){return function(_0x35d5dc){if(_0x35d5dc){return _0x35d5dc[_0x1a57('0x22')]()[_0x1a57('0x21')](function(){var _0x26cdd3=_0x35d5dc[_0x1a57('0x23')]({'plain':!![]});var _0x2f9454=_0x1a57('0x24');return db[_0x1a57('0x25')][_0x1a57('0x22')]({'where':{'type':_0x2f9454,'resourceId':_0x26cdd3['id']}})[_0x1a57('0x21')](function(){return _0x35d5dc;});})[_0x1a57('0x21')](function(){_0x2f8b00[_0x1a57('0x19')](0xcc)[_0x1a57('0x26')]();});}};}function handleEntityNotFound(_0x5a53c8,_0x530401){return function(_0x139d8c){if(!_0x139d8c){_0x5a53c8[_0x1a57('0x18')](0x194);}return _0x139d8c;};}function handleError(_0x545041,_0x46dac6){_0x46dac6=_0x46dac6||0x1f4;return function(_0x54f6a5){logger[_0x1a57('0x27')](_0x54f6a5[_0x1a57('0x28')]);if(_0x54f6a5['name']){delete _0x54f6a5[_0x1a57('0x29')];}_0x545041[_0x1a57('0x19')](_0x46dac6)[_0x1a57('0x2a')](_0x54f6a5);};}exports[_0x1a57('0x2b')]=function(_0x492b90,_0x366d5f){var _0x396832={},_0x4374f0={},_0x160536={'count':0x0,'rows':[]};var _0x5763ba=_[_0x1a57('0x2c')](db[_0x1a57('0x2d')][_0x1a57('0x2e')],function(_0x32f79f){return{'name':_0x32f79f[_0x1a57('0x2f')],'type':_0x32f79f[_0x1a57('0x30')][_0x1a57('0x31')]};});_0x4374f0[_0x1a57('0x32')]=_[_0x1a57('0x2c')](_0x5763ba,'name');_0x4374f0[_0x1a57('0x33')]=_[_0x1a57('0x34')](_0x492b90['query']);_0x4374f0['filters']=_[_0x1a57('0x35')](_0x4374f0[_0x1a57('0x32')],_0x4374f0[_0x1a57('0x33')]);_0x396832[_0x1a57('0x36')]=_[_0x1a57('0x35')](_0x4374f0[_0x1a57('0x32')],qs[_0x1a57('0x37')](_0x492b90[_0x1a57('0x33')][_0x1a57('0x37')]));_0x396832[_0x1a57('0x36')]=_0x396832[_0x1a57('0x36')][_0x1a57('0x38')]?_0x396832[_0x1a57('0x36')]:_0x4374f0[_0x1a57('0x32')];if(!_0x492b90[_0x1a57('0x33')][_0x1a57('0x39')](_0x1a57('0x3a'))){_0x396832[_0x1a57('0x1c')]=qs['limit'](_0x492b90[_0x1a57('0x33')][_0x1a57('0x1c')]);_0x396832[_0x1a57('0x1e')]=qs[_0x1a57('0x1e')](_0x492b90[_0x1a57('0x33')][_0x1a57('0x1e')]);}_0x396832[_0x1a57('0x3b')]=qs[_0x1a57('0x3c')](_0x492b90[_0x1a57('0x33')]['sort']);_0x396832['where']=qs['filters'](_['pick'](_0x492b90[_0x1a57('0x33')],_0x4374f0[_0x1a57('0x3d')]),_0x5763ba);if(_0x492b90[_0x1a57('0x33')]['filter']){_0x396832[_0x1a57('0x3e')]=_[_0x1a57('0x3f')](_0x396832[_0x1a57('0x3e')],{'$or':_[_0x1a57('0x2c')](_0x5763ba,function(_0x5bf186){if(_0x5bf186[_0x1a57('0x30')]!=='VIRTUAL'){var _0xd39e5a={};_0xd39e5a[_0x5bf186[_0x1a57('0x29')]]={'$like':'%'+_0x492b90[_0x1a57('0x33')]['filter']+'%'};return _0xd39e5a;}})});}_0x396832=_[_0x1a57('0x3f')]({},_0x396832,_0x492b90[_0x1a57('0x40')]);var _0x61e9f6={'where':_0x396832[_0x1a57('0x3e')]};return db[_0x1a57('0x2d')]['count'](_0x61e9f6)[_0x1a57('0x21')](function(_0x47e998){_0x160536['count']=_0x47e998;if(_0x492b90[_0x1a57('0x33')]['includeAll']){_0x396832[_0x1a57('0x41')]=[{'all':!![]}];}return db[_0x1a57('0x2d')][_0x1a57('0x42')](_0x396832);})['then'](function(_0x188a50){_0x160536[_0x1a57('0x43')]=_0x188a50;return _0x160536;})[_0x1a57('0x21')](respondWithFilteredResult(_0x366d5f,_0x396832))[_0x1a57('0x44')](handleError(_0x366d5f,null));};exports['show']=function(_0xc7bab4,_0x150fb6){var _0x4fdd29={'raw':!![],'where':{'id':_0xc7bab4['params']['id']}},_0x32d05b={};_0x32d05b['model']=_[_0x1a57('0x34')](db[_0x1a57('0x2d')][_0x1a57('0x2e')]);_0x32d05b[_0x1a57('0x33')]=_['keys'](_0xc7bab4[_0x1a57('0x33')]);_0x32d05b[_0x1a57('0x3d')]=_[_0x1a57('0x35')](_0x32d05b[_0x1a57('0x32')],_0x32d05b[_0x1a57('0x33')]);_0x4fdd29['attributes']=_[_0x1a57('0x35')](_0x32d05b[_0x1a57('0x32')],qs[_0x1a57('0x37')](_0xc7bab4[_0x1a57('0x33')]['fields']));_0x4fdd29[_0x1a57('0x36')]=_0x4fdd29['attributes'][_0x1a57('0x38')]?_0x4fdd29[_0x1a57('0x36')]:_0x32d05b[_0x1a57('0x32')];if(_0xc7bab4[_0x1a57('0x33')][_0x1a57('0x45')]){_0x4fdd29[_0x1a57('0x41')]=[{'all':!![]}];}_0x4fdd29=_[_0x1a57('0x3f')]({},_0x4fdd29,_0xc7bab4[_0x1a57('0x40')]);return db[_0x1a57('0x2d')][_0x1a57('0x46')](_0x4fdd29)[_0x1a57('0x21')](handleEntityNotFound(_0x150fb6,null))[_0x1a57('0x21')](respondWithResult(_0x150fb6,null))[_0x1a57('0x44')](handleError(_0x150fb6,null));};exports['create']=function(_0xf4d056,_0x480aff){return db[_0x1a57('0x2d')][_0x1a57('0x47')](_0xf4d056[_0x1a57('0x48')],{})[_0x1a57('0x21')](function(_0x323af1){var _0x3cbb9e=_0xf4d056[_0x1a57('0x49')][_0x1a57('0x23')]({'plain':!![]});if(!_0x3cbb9e)throw new Error(_0x1a57('0x4a'));if(_0x3cbb9e['role']===_0x1a57('0x49')){var _0x439a42=_0x323af1['get']({'plain':!![]});var _0x15f1f5=_0x1a57('0x24');return db['UserProfileSection'][_0x1a57('0x46')]({'where':{'name':_0x15f1f5,'userProfileId':_0x3cbb9e[_0x1a57('0x4b')]},'raw':!![]})['then'](function(_0x4d3177){if(_0x4d3177&&_0x4d3177['autoAssociation']===0x0){return db[_0x1a57('0x25')][_0x1a57('0x47')]({'name':_0x439a42['name'],'resourceId':_0x439a42['id'],'type':_0x4d3177[_0x1a57('0x29')],'sectionId':_0x4d3177['id']},{})[_0x1a57('0x21')](function(){return _0x323af1;});}else{return _0x323af1;}})['catch'](function(_0x5e510e){logger['error'](_0x1a57('0x4c'),_0x5e510e);throw _0x5e510e;});}return _0x323af1;})[_0x1a57('0x21')](respondWithResult(_0x480aff,0xc9))[_0x1a57('0x44')](handleError(_0x480aff,null));};exports[_0x1a57('0x20')]=function(_0x28738e,_0x33379c){if(_0x28738e[_0x1a57('0x48')]['id']){delete _0x28738e[_0x1a57('0x48')]['id'];}return db['VoiceMail']['find']({'where':{'id':_0x28738e['params']['id']}})['then'](handleEntityNotFound(_0x33379c,null))['then'](saveUpdates(_0x28738e[_0x1a57('0x48')],null))[_0x1a57('0x21')](respondWithResult(_0x33379c,null))[_0x1a57('0x44')](handleError(_0x33379c,null));};exports[_0x1a57('0x22')]=function(_0x26cf80,_0x2f09e7){return db[_0x1a57('0x2d')][_0x1a57('0x46')]({'where':{'id':_0x26cf80['params']['id']}})['then'](handleEntityNotFound(_0x2f09e7,null))['then'](removeEntity(_0x2f09e7,null))[_0x1a57('0x44')](handleError(_0x2f09e7,null));};exports['getMessages']=function(_0x301db9,_0x10c058,_0x408e67){return db[_0x1a57('0x2d')][_0x1a57('0x4d')]({'where':{'id':_0x301db9[_0x1a57('0x4e')]['id']}})[_0x1a57('0x21')](handleEntityNotFound(_0x10c058,null))['then'](function(_0x4e56b5){var _0x4d5b1d;var _0xc936a7={},_0x562775={};_0x562775[_0x1a57('0x32')]=_[_0x1a57('0x34')](db[_0x1a57('0x4f')][_0x1a57('0x2e')]);_0x562775[_0x1a57('0x33')]=_['keys'](_0x301db9['query']);_0x562775[_0x1a57('0x3d')]=_[_0x1a57('0x35')](_0x562775[_0x1a57('0x32')],_0x562775[_0x1a57('0x33')]);_0xc936a7[_0x1a57('0x36')]=_[_0x1a57('0x35')](_0x562775['model'],qs['fields'](_0x301db9[_0x1a57('0x33')][_0x1a57('0x37')]));_0xc936a7['attributes']=_0xc936a7['attributes'][_0x1a57('0x38')]?_0xc936a7[_0x1a57('0x36')]:_0x562775[_0x1a57('0x32')];if(!_0x301db9[_0x1a57('0x33')][_0x1a57('0x39')](_0x1a57('0x3a'))){_0xc936a7[_0x1a57('0x1c')]=qs['limit'](_0x301db9['query'][_0x1a57('0x1c')]);_0xc936a7[_0x1a57('0x1e')]=qs[_0x1a57('0x1e')](_0x301db9[_0x1a57('0x33')]['offset']);}_0xc936a7[_0x1a57('0x3b')]=qs[_0x1a57('0x3c')](_0x301db9[_0x1a57('0x33')][_0x1a57('0x3c')]);_0xc936a7[_0x1a57('0x3e')]=qs['filters'](_['pick'](_0x301db9['query'],_0x562775[_0x1a57('0x3d')]));if(_0x301db9[_0x1a57('0x33')][_0x1a57('0x50')]){_0xc936a7[_0x1a57('0x3e')]=_[_0x1a57('0x3f')](_0xc936a7[_0x1a57('0x3e')],{'$or':_[_0x1a57('0x2c')](_0xc936a7[_0x1a57('0x36')],function(_0x482508){var _0xe8ef76={};_0xe8ef76[_0x482508]={'$like':'%'+_0x301db9[_0x1a57('0x33')]['filter']+'%'};return _0xe8ef76;})});}_0xc936a7['where']=_[_0x1a57('0x3f')](_0xc936a7['where'],{'mailboxuser':_0x4e56b5[_0x1a57('0x51')]});_0xc936a7=_[_0x1a57('0x3f')]({},_0xc936a7,_0x301db9[_0x1a57('0x40')]);return db[_0x1a57('0x4f')][_0x1a57('0x52')](_0xc936a7)[_0x1a57('0x21')](respondWithFilteredResult(_0x10c058,_0xc936a7));})[_0x1a57('0x44')](handleError(_0x10c058,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index fffaec4..1069ffc 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 _0x0f78=['../../config/environment','./voiceMail.attributes','exports','define','VoiceMail','voice_voicemail','mailbox','context','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x47e7cb,_0x4c1b8d){var _0x2a8874=function(_0x36498f){while(--_0x36498f){_0x47e7cb['push'](_0x47e7cb['shift']());}};_0x2a8874(++_0x4c1b8d);}(_0x0f78,0x68));var _0x80f7=function(_0x184609,_0x2ec389){_0x184609=_0x184609-0x0;var _0x5ac0ab=_0x0f78[_0x184609];return _0x5ac0ab;};'use strict';var _=require(_0x80f7('0x0'));var util=require(_0x80f7('0x1'));var logger=require(_0x80f7('0x2'))(_0x80f7('0x3'));var moment=require(_0x80f7('0x4'));var BPromise=require(_0x80f7('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x80f7('0x6'));var rimraf=require(_0x80f7('0x7'));var config=require(_0x80f7('0x8'));var attributes=require(_0x80f7('0x9'));module[_0x80f7('0xa')]=function(_0x32873c,_0x3cf19a){return _0x32873c[_0x80f7('0xb')](_0x80f7('0xc'),attributes,{'tableName':_0x80f7('0xd'),'paranoid':![],'indexes':[{'name':'mailbox_context','fields':[_0x80f7('0xe'),_0x80f7('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf9d7=['util','../../config/logger','api','rimraf','../../config/environment','./voiceMail.attributes','exports','define','VoiceMail','mailbox','context','lodash'];(function(_0x47b748,_0x5149b3){var _0x4c20b8=function(_0x351bc2){while(--_0x351bc2){_0x47b748['push'](_0x47b748['shift']());}};_0x4c20b8(++_0x5149b3);}(_0xf9d7,0xbf));var _0x7f9d=function(_0x227cce,_0x46477b){_0x227cce=_0x227cce-0x0;var _0x339dfb=_0xf9d7[_0x227cce];return _0x339dfb;};'use strict';var _=require(_0x7f9d('0x0'));var util=require(_0x7f9d('0x1'));var logger=require(_0x7f9d('0x2'))(_0x7f9d('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x7f9d('0x4'));var config=require(_0x7f9d('0x5'));var attributes=require(_0x7f9d('0x6'));module[_0x7f9d('0x7')]=function(_0x151890,_0x315a75){return _0x151890[_0x7f9d('0x8')](_0x7f9d('0x9'),attributes,{'tableName':'voice_voicemail','paranoid':![],'indexes':[{'name':'mailbox_context','fields':[_0x7f9d('0xa'),_0x7f9d('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index 6fe409b..0baef53 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 _0x4a05=['request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','VoiceMail,\x20%s,\x20%s'];(function(_0x585199,_0x10d223){var _0x4f5eaf=function(_0x19f4cf){while(--_0x19f4cf){_0x585199['push'](_0x585199['shift']());}};_0x4f5eaf(++_0x10d223);}(_0x4a05,0x1ad));var _0x54a0=function(_0x398437,_0x382e5f){_0x398437=_0x398437-0x0;var _0x539597=_0x4a05[_0x398437];return _0x539597;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x54a0('0x0'));var BPromise=require(_0x54a0('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x54a0('0x2'));var db=require(_0x54a0('0x3'))['db'];var utils=require(_0x54a0('0x4'));var logger=require(_0x54a0('0x5'))(_0x54a0('0x6'));var config=require(_0x54a0('0x7'));var jayson=require(_0x54a0('0x8'));var client=jayson[_0x54a0('0x9')][_0x54a0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4c757d,_0x1080ef,_0x26bf39){return new BPromise(function(_0x4e9344,_0x275ab0){return client['request'](_0x4c757d,_0x26bf39)['then'](function(_0x269d45){logger['info'](_0x54a0('0xb'),_0x1080ef,_0x54a0('0xc'));logger[_0x54a0('0xd')](_0x54a0('0xe'),_0x1080ef,_0x54a0('0xc'),JSON['stringify'](_0x269d45));if(_0x269d45[_0x54a0('0xf')]){if(_0x269d45[_0x54a0('0xf')][_0x54a0('0x10')]===0x1f4){logger['error']('VoiceMail,\x20%s,\x20%s',_0x1080ef,_0x269d45[_0x54a0('0xf')][_0x54a0('0x11')]);return _0x275ab0(_0x269d45[_0x54a0('0xf')][_0x54a0('0x11')]);}logger[_0x54a0('0xf')](_0x54a0('0xb'),_0x1080ef,_0x269d45['error'][_0x54a0('0x11')]);return _0x4e9344(_0x269d45[_0x54a0('0xf')]['message']);}else{logger[_0x54a0('0x12')](_0x54a0('0xb'),_0x1080ef,_0x54a0('0xc'));_0x4e9344(_0x269d45[_0x54a0('0x13')][_0x54a0('0x11')]);}})[_0x54a0('0x14')](function(_0x1e2323){logger['error'](_0x54a0('0xb'),_0x1080ef,_0x1e2323);_0x275ab0(_0x1e2323);});});} \ No newline at end of file +var _0x9765=['client','request','then','info','VoiceMail,\x20%s,\x20%s','debug','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x42e8f2,_0x70bb1e){var _0x3a92f4=function(_0x3d8906){while(--_0x3d8906){_0x42e8f2['push'](_0x42e8f2['shift']());}};_0x3a92f4(++_0x70bb1e);}(_0x9765,0x1aa));var _0x5976=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x9765[_0x4565bf];return _0x5610ba;};'use strict';var _=require('lodash');var util=require(_0x5976('0x0'));var moment=require(_0x5976('0x1'));var BPromise=require(_0x5976('0x2'));var rs=require(_0x5976('0x3'));var fs=require('fs');var Redis=require(_0x5976('0x4'));var db=require(_0x5976('0x5'))['db'];var utils=require(_0x5976('0x6'));var logger=require(_0x5976('0x7'))(_0x5976('0x8'));var config=require(_0x5976('0x9'));var jayson=require(_0x5976('0xa'));var client=jayson[_0x5976('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x321707,_0x2f9e50,_0xfb0fcd){return new BPromise(function(_0x257c28,_0x1d1c2f){return client[_0x5976('0xc')](_0x321707,_0xfb0fcd)[_0x5976('0xd')](function(_0x53867){logger[_0x5976('0xe')](_0x5976('0xf'),_0x2f9e50,'request\x20sent');logger[_0x5976('0x10')](_0x5976('0x11'),_0x2f9e50,'request\x20sent',JSON[_0x5976('0x12')](_0x53867));if(_0x53867[_0x5976('0x13')]){if(_0x53867[_0x5976('0x13')][_0x5976('0x14')]===0x1f4){logger[_0x5976('0x13')](_0x5976('0xf'),_0x2f9e50,_0x53867[_0x5976('0x13')]['message']);return _0x1d1c2f(_0x53867[_0x5976('0x13')][_0x5976('0x15')]);}logger[_0x5976('0x13')](_0x5976('0xf'),_0x2f9e50,_0x53867[_0x5976('0x13')][_0x5976('0x15')]);return _0x257c28(_0x53867[_0x5976('0x13')][_0x5976('0x15')]);}else{logger[_0x5976('0xe')]('VoiceMail,\x20%s,\x20%s',_0x2f9e50,'request\x20sent');_0x257c28(_0x53867[_0x5976('0x16')][_0x5976('0x15')]);}})['catch'](function(_0x43e011){logger[_0x5976('0x13')](_0x5976('0xf'),_0x2f9e50,_0x43e011);_0x1d1c2f(_0x43e011);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index ada3b57..d7a317b 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 _0x82fa=['exports','multer','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','get','isAuthenticated','index','/:id','/:id/download','post','put','update','delete','destroy'];(function(_0x34bc6c,_0x10d089){var _0x168820=function(_0xb058d9){while(--_0xb058d9){_0x34bc6c['push'](_0x34bc6c['shift']());}};_0x168820(++_0x10d089);}(_0x82fa,0xac));var _0xa82f=function(_0x1d2379,_0x229877){_0x1d2379=_0x1d2379-0x0;var _0x369e37=_0x82fa[_0x1d2379];return _0x369e37;};'use strict';var multer=require(_0xa82f('0x0'));var util=require('util');var path=require(_0xa82f('0x1'));var timeout=require('connect-timeout');var express=require(_0xa82f('0x2'));var router=express['Router']();var fs_extra=require(_0xa82f('0x3'));var auth=require(_0xa82f('0x4'));var interaction=require(_0xa82f('0x5'));var config=require(_0xa82f('0x6'));var controller=require(_0xa82f('0x7'));router[_0xa82f('0x8')]('/',auth[_0xa82f('0x9')](),controller[_0xa82f('0xa')]);router[_0xa82f('0x8')](_0xa82f('0xb'),auth[_0xa82f('0x9')](),controller['show']);router[_0xa82f('0x8')](_0xa82f('0xc'),auth[_0xa82f('0x9')](),controller['download']);router[_0xa82f('0xd')]('/',auth[_0xa82f('0x9')](),controller['create']);router[_0xa82f('0xe')]('/:id',auth[_0xa82f('0x9')](),controller[_0xa82f('0xf')]);router[_0xa82f('0x10')]('/:id',auth[_0xa82f('0x9')](),controller[_0xa82f('0x11')]);module[_0xa82f('0x12')]=router; \ No newline at end of file +var _0x5c2a=['show','/:id/download','isAuthenticated','download','post','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./voiceMailMessage.controller','get','index','/:id'];(function(_0x90dc6a,_0x463b62){var _0x5da3c5=function(_0x1d9afb){while(--_0x1d9afb){_0x90dc6a['push'](_0x90dc6a['shift']());}};_0x5da3c5(++_0x463b62);}(_0x5c2a,0x1c2));var _0xa5c2=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0x5c2a[_0x2b10c6];return _0x3789d2;};'use strict';var multer=require(_0xa5c2('0x0'));var util=require(_0xa5c2('0x1'));var path=require(_0xa5c2('0x2'));var timeout=require(_0xa5c2('0x3'));var express=require(_0xa5c2('0x4'));var router=express[_0xa5c2('0x5')]();var fs_extra=require(_0xa5c2('0x6'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xa5c2('0x7'));var controller=require(_0xa5c2('0x8'));router[_0xa5c2('0x9')]('/',auth['isAuthenticated'](),controller[_0xa5c2('0xa')]);router['get'](_0xa5c2('0xb'),auth['isAuthenticated'](),controller[_0xa5c2('0xc')]);router[_0xa5c2('0x9')](_0xa5c2('0xd'),auth[_0xa5c2('0xe')](),controller[_0xa5c2('0xf')]);router[_0xa5c2('0x10')]('/',auth[_0xa5c2('0xe')](),controller['create']);router['put'](_0xa5c2('0xb'),auth[_0xa5c2('0xe')](),controller[_0xa5c2('0x11')]);router[_0xa5c2('0x12')](_0xa5c2('0xb'),auth['isAuthenticated'](),controller[_0xa5c2('0x13')]);module[_0xa5c2('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index 627971c..ead4fbb 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 _0x9fd5=['TIMESTAMP','literal','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','exports','VIRTUAL','getDataValue','INTEGER','STRING','BLOB','long'];(function(_0x375521,_0x413159){var _0x1fb976=function(_0x2eddfc){while(--_0x2eddfc){_0x375521['push'](_0x375521['shift']());}};_0x1fb976(++_0x413159);}(_0x9fd5,0x143));var _0x59fd=function(_0x373389,_0x39c241){_0x373389=_0x373389-0x0;var _0x34d38b=_0x9fd5[_0x373389];return _0x34d38b;};'use strict';var Sequelize=require('sequelize');module[_0x59fd('0x0')]={'name':{'type':Sequelize[_0x59fd('0x1')],'get':function(_0x50fa72){return this[_0x59fd('0x2')]('id');}},'msgnum':{'type':Sequelize[_0x59fd('0x3')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x59fd('0x4')],'defaultValue':''},'context':{'type':Sequelize[_0x59fd('0x4')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x59fd('0x4')],'defaultValue':''},'callerid':{'type':Sequelize[_0x59fd('0x4')],'defaultValue':''},'origtime':{'type':Sequelize[_0x59fd('0x4')],'defaultValue':''},'duration':{'type':Sequelize[_0x59fd('0x4')],'defaultValue':''},'mailboxuser':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x59fd('0x4')],'defaultValue':''},'recording':{'type':Sequelize[_0x59fd('0x5')](_0x59fd('0x6')),'defaultValue':null},'flag':{'type':Sequelize[_0x59fd('0x4')],'defaultValue':''},'msg_id':{'type':Sequelize['STRING'],'defaultValue':''},'stamp':{'type':_0x59fd('0x7'),'defaultValue':Sequelize[_0x59fd('0x8')](_0x59fd('0x9'))}}; \ No newline at end of file +var _0x6aa5=['exports','VIRTUAL','getDataValue','STRING','BLOB','long','TIMESTAMP','CURRENT_TIMESTAMP\x20ON\x20UPDATE\x20CURRENT_TIMESTAMP','sequelize'];(function(_0x1b674f,_0x85f509){var _0x1ce9b9=function(_0x5ead93){while(--_0x5ead93){_0x1b674f['push'](_0x1b674f['shift']());}};_0x1ce9b9(++_0x85f509);}(_0x6aa5,0x10d));var _0x56aa=function(_0x13f5a2,_0x435893){_0x13f5a2=_0x13f5a2-0x0;var _0x1c2719=_0x6aa5[_0x13f5a2];return _0x1c2719;};'use strict';var Sequelize=require(_0x56aa('0x0'));module[_0x56aa('0x1')]={'name':{'type':Sequelize[_0x56aa('0x2')],'get':function(_0x11fbf4){return this[_0x56aa('0x3')]('id');}},'msgnum':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x56aa('0x4')],'defaultValue':''},'context':{'type':Sequelize[_0x56aa('0x4')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x56aa('0x4')],'defaultValue':''},'callerid':{'type':Sequelize[_0x56aa('0x4')],'defaultValue':''},'origtime':{'type':Sequelize[_0x56aa('0x4')],'defaultValue':''},'duration':{'type':Sequelize[_0x56aa('0x4')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x56aa('0x4')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x56aa('0x4')],'defaultValue':''},'recording':{'type':Sequelize[_0x56aa('0x5')](_0x56aa('0x6')),'defaultValue':null},'flag':{'type':Sequelize[_0x56aa('0x4')],'defaultValue':''},'msg_id':{'type':Sequelize[_0x56aa('0x4')],'defaultValue':''},'stamp':{'type':_0x56aa('0x7'),'defaultValue':Sequelize['literal'](_0x56aa('0x8'))}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index ab3a024..f5ad63b 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 _0xf368=['key','model','differenceBy','query','keys','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','VoiceMailMessage','includeAll','include','findAll','rows','catch','show','params','rawAttributes','fields','options','find','create','body','download','recording','msg_id','VoiceMailMessage\x20not\x20found','attachment','attachment;\x20filename=\x22','.wav\x22','send','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','map','fieldName','type'];(function(_0x4f595b,_0x21875e){var _0xc9597c=function(_0x4d6235){while(--_0x4d6235){_0x4f595b['push'](_0x4f595b['shift']());}};_0xc9597c(++_0x21875e);}(_0xf368,0x1db));var _0x8f36=function(_0x6ae3b9,_0x4a1909){_0x6ae3b9=_0x6ae3b9-0x0;var _0x28a5bd=_0xf368[_0x6ae3b9];return _0x28a5bd;};'use strict';var emlformat=require(_0x8f36('0x0'));var rimraf=require(_0x8f36('0x1'));var zipdir=require(_0x8f36('0x2'));var jsonpatch=require(_0x8f36('0x3'));var rp=require(_0x8f36('0x4'));var moment=require(_0x8f36('0x5'));var BPromise=require(_0x8f36('0x6'));var Mustache=require(_0x8f36('0x7'));var util=require('util');var path=require(_0x8f36('0x8'));var sox=require(_0x8f36('0x9'));var csv=require(_0x8f36('0xa'));var ejs=require(_0x8f36('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8f36('0xc'));var squel=require('squel');var crypto=require(_0x8f36('0xd'));var jsforce=require(_0x8f36('0xe'));var deskjs=require(_0x8f36('0xf'));var toCsv=require('to-csv');var querystring=require(_0x8f36('0x10'));var Papa=require(_0x8f36('0x11'));var Redis=require(_0x8f36('0x12'));var authService=require(_0x8f36('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x8f36('0x14'));var hardwareService=require(_0x8f36('0x15'));var logger=require('../../config/logger')(_0x8f36('0x16'));var utils=require(_0x8f36('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x8f36('0x18'))['db'];function respondWithStatusCode(_0x5cf973,_0x158a0e){_0x158a0e=_0x158a0e||0xcc;return function(_0x248634){if(_0x248634){return _0x5cf973[_0x8f36('0x19')](_0x158a0e);}return _0x5cf973[_0x8f36('0x1a')](_0x158a0e)['end']();};}function respondWithResult(_0x2126dd,_0x2e167a){_0x2e167a=_0x2e167a||0xc8;return function(_0x5139c7){if(_0x5139c7){return _0x2126dd[_0x8f36('0x1a')](_0x2e167a)[_0x8f36('0x1b')](_0x5139c7);}};}function respondWithFilteredResult(_0x2579df,_0x40c3b3){return function(_0x26e856){if(_0x26e856){var _0x3e17b4=typeof _0x40c3b3[_0x8f36('0x1c')]===_0x8f36('0x1d')&&typeof _0x40c3b3[_0x8f36('0x1e')]===_0x8f36('0x1d');var _0x435aef=_0x26e856[_0x8f36('0x1f')];var _0x12b6a1=_0x3e17b4?0x0:_0x40c3b3[_0x8f36('0x1c')];var _0x3d5ab8=_0x3e17b4?_0x26e856['count']:_0x40c3b3[_0x8f36('0x1c')]+_0x40c3b3[_0x8f36('0x1e')];var _0x112b24;if(_0x3d5ab8>=_0x435aef){_0x3d5ab8=_0x435aef;_0x112b24=0xc8;}else{_0x112b24=0xce;}_0x2579df[_0x8f36('0x1a')](_0x112b24);return _0x2579df[_0x8f36('0x20')](_0x8f36('0x21'),_0x12b6a1+'-'+_0x3d5ab8+'/'+_0x435aef)[_0x8f36('0x1b')](_0x26e856);}return null;};}function patchUpdates(_0x2079a7){return function(_0x5e39d2){try{jsonpatch[_0x8f36('0x22')](_0x5e39d2,_0x2079a7,!![]);}catch(_0x4a00aa){return BPromise[_0x8f36('0x23')](_0x4a00aa);}return _0x5e39d2[_0x8f36('0x24')]();};}function saveUpdates(_0x14a5c1,_0x31edec){return function(_0x2e470b){if(_0x2e470b){return _0x2e470b[_0x8f36('0x25')](_0x14a5c1)[_0x8f36('0x26')](function(_0x52e0b2){return _0x52e0b2;});}return null;};}function removeEntity(_0x1fc063,_0x403188){return function(_0x3aebfc){if(_0x3aebfc){return _0x3aebfc[_0x8f36('0x27')]()[_0x8f36('0x26')](function(){_0x1fc063[_0x8f36('0x1a')](0xcc)[_0x8f36('0x28')]();});}};}function handleEntityNotFound(_0x2fadad,_0x264558){return function(_0x4e8a61){if(!_0x4e8a61){_0x2fadad[_0x8f36('0x19')](0x194);}return _0x4e8a61;};}function handleError(_0x21f388,_0x2c7926){_0x2c7926=_0x2c7926||0x1f4;return function(_0x1bf66e){logger[_0x8f36('0x29')](_0x1bf66e[_0x8f36('0x2a')]);if(_0x1bf66e['name']){delete _0x1bf66e[_0x8f36('0x2b')];}_0x21f388[_0x8f36('0x1a')](_0x2c7926)['send'](_0x1bf66e);};}exports['index']=function(_0x5b1fef,_0x1e90d0){var _0x2cdafa={},_0x1713e3={},_0x54817c={'count':0x0,'rows':[]};var _0x39ab2d=_[_0x8f36('0x2c')](db['VoiceMailMessage']['rawAttributes'],function(_0x4b61d9){return{'name':_0x4b61d9[_0x8f36('0x2d')],'type':_0x4b61d9[_0x8f36('0x2e')][_0x8f36('0x2f')]};});_0x1713e3[_0x8f36('0x30')]=_[_0x8f36('0x31')](_['map'](_0x39ab2d,_0x8f36('0x2b')),[_0x8f36('0x2b')]);_0x1713e3[_0x8f36('0x32')]=_[_0x8f36('0x33')](_0x5b1fef[_0x8f36('0x32')]);_0x1713e3['filters']=_[_0x8f36('0x34')](_0x1713e3[_0x8f36('0x30')],_0x1713e3[_0x8f36('0x32')]);_0x2cdafa[_0x8f36('0x35')]=_[_0x8f36('0x34')](_0x1713e3[_0x8f36('0x30')],qs['fields'](_0x5b1fef[_0x8f36('0x32')]['fields']));_0x2cdafa[_0x8f36('0x35')]=_0x2cdafa[_0x8f36('0x35')][_0x8f36('0x36')]?_0x2cdafa[_0x8f36('0x35')]:_0x1713e3[_0x8f36('0x30')];if(!_0x5b1fef[_0x8f36('0x32')][_0x8f36('0x37')](_0x8f36('0x38'))){_0x2cdafa['limit']=qs['limit'](_0x5b1fef['query'][_0x8f36('0x1e')]);_0x2cdafa[_0x8f36('0x1c')]=qs[_0x8f36('0x1c')](_0x5b1fef['query']['offset']);}_0x2cdafa[_0x8f36('0x39')]=qs[_0x8f36('0x3a')](_0x5b1fef[_0x8f36('0x32')][_0x8f36('0x3a')]);_0x2cdafa[_0x8f36('0x3b')]=qs['filters'](_[_0x8f36('0x3c')](_0x5b1fef['query'],_0x1713e3[_0x8f36('0x3d')]),_0x39ab2d);if(_0x5b1fef[_0x8f36('0x32')][_0x8f36('0x3e')]){_0x2cdafa[_0x8f36('0x3b')]=_[_0x8f36('0x3f')](_0x2cdafa['where'],{'$or':_[_0x8f36('0x2c')](_0x39ab2d,function(_0x15bc1a){if(_0x15bc1a[_0x8f36('0x2e')]!==_0x8f36('0x40')){var _0x46cfea={};_0x46cfea[_0x15bc1a['name']]={'$like':'%'+_0x5b1fef[_0x8f36('0x32')][_0x8f36('0x3e')]+'%'};return _0x46cfea;}})});}_0x2cdafa=_[_0x8f36('0x3f')]({},_0x2cdafa,_0x5b1fef['options']);var _0x5c99e6={'where':_0x2cdafa[_0x8f36('0x3b')]};return db[_0x8f36('0x41')][_0x8f36('0x1f')](_0x5c99e6)[_0x8f36('0x26')](function(_0x58b5c7){_0x54817c[_0x8f36('0x1f')]=_0x58b5c7;if(_0x5b1fef[_0x8f36('0x32')][_0x8f36('0x42')]){_0x2cdafa[_0x8f36('0x43')]=[{'all':!![]}];}return db['VoiceMailMessage'][_0x8f36('0x44')](_0x2cdafa);})[_0x8f36('0x26')](function(_0x26f407){_0x54817c[_0x8f36('0x45')]=_0x26f407;return _0x54817c;})[_0x8f36('0x26')](respondWithFilteredResult(_0x1e90d0,_0x2cdafa))[_0x8f36('0x46')](handleError(_0x1e90d0,null));};exports[_0x8f36('0x47')]=function(_0xc4eb73,_0xd14f0){var _0x4234f0={'raw':!![],'where':{'id':_0xc4eb73[_0x8f36('0x48')]['id']}},_0x46fe0b={};_0x46fe0b[_0x8f36('0x30')]=_[_0x8f36('0x33')](db[_0x8f36('0x41')][_0x8f36('0x49')]);_0x46fe0b[_0x8f36('0x32')]=_['keys'](_0xc4eb73[_0x8f36('0x32')]);_0x46fe0b[_0x8f36('0x3d')]=_[_0x8f36('0x34')](_0x46fe0b['model'],_0x46fe0b[_0x8f36('0x32')]);_0x4234f0[_0x8f36('0x35')]=_[_0x8f36('0x34')](_0x46fe0b[_0x8f36('0x30')],qs[_0x8f36('0x4a')](_0xc4eb73['query'][_0x8f36('0x4a')]));_0x4234f0[_0x8f36('0x35')]=_0x4234f0[_0x8f36('0x35')][_0x8f36('0x36')]?_0x4234f0[_0x8f36('0x35')]:_0x46fe0b['model'];if(_0xc4eb73[_0x8f36('0x32')][_0x8f36('0x42')]){_0x4234f0[_0x8f36('0x43')]=[{'all':!![]}];}_0x4234f0=_[_0x8f36('0x3f')]({},_0x4234f0,_0xc4eb73[_0x8f36('0x4b')]);return db[_0x8f36('0x41')][_0x8f36('0x4c')](_0x4234f0)[_0x8f36('0x26')](handleEntityNotFound(_0xd14f0,null))[_0x8f36('0x26')](respondWithResult(_0xd14f0,null))[_0x8f36('0x46')](handleError(_0xd14f0,null));};exports[_0x8f36('0x4d')]=function(_0x30b707,_0x2a5af1){return db[_0x8f36('0x41')][_0x8f36('0x4d')](_0x30b707[_0x8f36('0x4e')],{})[_0x8f36('0x26')](respondWithResult(_0x2a5af1,0xc9))[_0x8f36('0x46')](handleError(_0x2a5af1,null));};exports[_0x8f36('0x25')]=function(_0x5c24c2,_0x326b44){if(_0x5c24c2[_0x8f36('0x4e')]['id']){delete _0x5c24c2[_0x8f36('0x4e')]['id'];}return db[_0x8f36('0x41')][_0x8f36('0x4c')]({'where':{'id':_0x5c24c2[_0x8f36('0x48')]['id']}})[_0x8f36('0x26')](handleEntityNotFound(_0x326b44,null))[_0x8f36('0x26')](saveUpdates(_0x5c24c2[_0x8f36('0x4e')],null))[_0x8f36('0x26')](respondWithResult(_0x326b44,null))[_0x8f36('0x46')](handleError(_0x326b44,null));};exports[_0x8f36('0x27')]=function(_0x45cc1c,_0x1b5558){return db[_0x8f36('0x41')][_0x8f36('0x4c')]({'where':{'id':_0x45cc1c['params']['id']}})['then'](handleEntityNotFound(_0x1b5558,null))[_0x8f36('0x26')](removeEntity(_0x1b5558,null))[_0x8f36('0x46')](handleError(_0x1b5558,null));};exports[_0x8f36('0x4f')]=function(_0x22e47a,_0x23757e,_0x219e7e){return db['VoiceMailMessage'][_0x8f36('0x4c')]({'where':{'id':_0x22e47a[_0x8f36('0x48')]['id']},'attributes':['id',_0x8f36('0x50'),_0x8f36('0x51')]})[_0x8f36('0x26')](handleEntityNotFound(_0x23757e,null))[_0x8f36('0x26')](function(_0x5ce62b){if(_0x5ce62b){if(!_0x5ce62b[_0x8f36('0x50')]){throw new db['Sequelize']['ValidationError'](_0x8f36('0x52'));}var _0xf49a2d={'Content-Type':'audio/wav','Content-Disposition':_0x8f36('0x53')};if(_0x5ce62b[_0x8f36('0x51')]){_0xf49a2d['Content-Disposition']=_0x8f36('0x54')+_0x5ce62b[_0x8f36('0x51')]+_0x8f36('0x55');}_0x23757e['set'](_0xf49a2d);return _0x23757e[_0x8f36('0x56')](new Buffer(_0x5ce62b[_0x8f36('0x50')]));}})['catch'](handleError(_0x23757e,null));}; \ No newline at end of file +var _0x37b8=['merge','VIRTUAL','filter','options','includeAll','include','findAll','catch','show','params','rawAttributes','find','body','download','recording','msg_id','Sequelize','VoiceMailMessage\x20not\x20found','audio/wav','Content-Disposition','attachment;\x20filename=\x22','.wav\x22','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path','sox','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/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','VoiceMailMessage','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0x4a747d,_0x3b747f){var _0x3a5b5c=function(_0x4b3e81){while(--_0x4b3e81){_0x4a747d['push'](_0x4a747d['shift']());}};_0x3a5b5c(++_0x3b747f);}(_0x37b8,0x118));var _0x837b=function(_0x5628a0,_0x1adf2b){_0x5628a0=_0x5628a0-0x0;var _0x12f9a9=_0x37b8[_0x5628a0];return _0x12f9a9;};'use strict';var emlformat=require(_0x837b('0x0'));var rimraf=require(_0x837b('0x1'));var zipdir=require(_0x837b('0x2'));var jsonpatch=require(_0x837b('0x3'));var rp=require('request-promise');var moment=require(_0x837b('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x837b('0x5'));var util=require('util');var path=require(_0x837b('0x6'));var sox=require(_0x837b('0x7'));var csv=require(_0x837b('0x8'));var ejs=require(_0x837b('0x9'));var fs=require('fs');var fs_extra=require(_0x837b('0xa'));var _=require('lodash');var squel=require(_0x837b('0xb'));var crypto=require('crypto');var jsforce=require(_0x837b('0xc'));var deskjs=require(_0x837b('0xd'));var toCsv=require(_0x837b('0x8'));var querystring=require(_0x837b('0xe'));var Papa=require(_0x837b('0xf'));var Redis=require(_0x837b('0x10'));var authService=require(_0x837b('0x11'));var qs=require(_0x837b('0x12'));var as=require(_0x837b('0x13'));var hardwareService=require(_0x837b('0x14'));var logger=require(_0x837b('0x15'))(_0x837b('0x16'));var utils=require(_0x837b('0x17'));var config=require(_0x837b('0x18'));var licenseUtil=require(_0x837b('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x49d653,_0x5249d3){_0x5249d3=_0x5249d3||0xcc;return function(_0x3dddc8){if(_0x3dddc8){return _0x49d653[_0x837b('0x1a')](_0x5249d3);}return _0x49d653['status'](_0x5249d3)[_0x837b('0x1b')]();};}function respondWithResult(_0x1213b8,_0x357b49){_0x357b49=_0x357b49||0xc8;return function(_0x2d2d99){if(_0x2d2d99){return _0x1213b8[_0x837b('0x1c')](_0x357b49)[_0x837b('0x1d')](_0x2d2d99);}};}function respondWithFilteredResult(_0x507862,_0x16e18e){return function(_0x2b68dd){if(_0x2b68dd){var _0x5a3182=typeof _0x16e18e[_0x837b('0x1e')]===_0x837b('0x1f')&&typeof _0x16e18e[_0x837b('0x20')]===_0x837b('0x1f');var _0x3dba4a=_0x2b68dd[_0x837b('0x21')];var _0x316adf=_0x5a3182?0x0:_0x16e18e[_0x837b('0x1e')];var _0x1a4b85=_0x5a3182?_0x2b68dd[_0x837b('0x21')]:_0x16e18e[_0x837b('0x1e')]+_0x16e18e[_0x837b('0x20')];var _0x2bb9d2;if(_0x1a4b85>=_0x3dba4a){_0x1a4b85=_0x3dba4a;_0x2bb9d2=0xc8;}else{_0x2bb9d2=0xce;}_0x507862['status'](_0x2bb9d2);return _0x507862[_0x837b('0x22')](_0x837b('0x23'),_0x316adf+'-'+_0x1a4b85+'/'+_0x3dba4a)['json'](_0x2b68dd);}return null;};}function patchUpdates(_0x4835b0){return function(_0x380bf6){try{jsonpatch[_0x837b('0x24')](_0x380bf6,_0x4835b0,!![]);}catch(_0x27b2e2){return BPromise[_0x837b('0x25')](_0x27b2e2);}return _0x380bf6[_0x837b('0x26')]();};}function saveUpdates(_0x4a75f9,_0x17db20){return function(_0x120542){if(_0x120542){return _0x120542[_0x837b('0x27')](_0x4a75f9)['then'](function(_0x199880){return _0x199880;});}return null;};}function removeEntity(_0x35672d,_0x29bf2f){return function(_0x168676){if(_0x168676){return _0x168676[_0x837b('0x28')]()[_0x837b('0x29')](function(){_0x35672d[_0x837b('0x1c')](0xcc)[_0x837b('0x1b')]();});}};}function handleEntityNotFound(_0x24190e,_0x5974a9){return function(_0x26333f){if(!_0x26333f){_0x24190e[_0x837b('0x1a')](0x194);}return _0x26333f;};}function handleError(_0x5b8e4f,_0x587cc8){_0x587cc8=_0x587cc8||0x1f4;return function(_0x100dbc){logger[_0x837b('0x2a')](_0x100dbc[_0x837b('0x2b')]);if(_0x100dbc[_0x837b('0x2c')]){delete _0x100dbc[_0x837b('0x2c')];}_0x5b8e4f[_0x837b('0x1c')](_0x587cc8)[_0x837b('0x2d')](_0x100dbc);};}exports[_0x837b('0x2e')]=function(_0x5a6278,_0x4f10a4){var _0x33462a={},_0x2e02e2={},_0x4e9ea0={'count':0x0,'rows':[]};var _0x5df584=_[_0x837b('0x2f')](db[_0x837b('0x30')]['rawAttributes'],function(_0x1fb26d){return{'name':_0x1fb26d[_0x837b('0x31')],'type':_0x1fb26d[_0x837b('0x32')]['key']};});_0x2e02e2[_0x837b('0x33')]=_['differenceBy'](_['map'](_0x5df584,_0x837b('0x2c')),[_0x837b('0x2c')]);_0x2e02e2['query']=_[_0x837b('0x34')](_0x5a6278[_0x837b('0x35')]);_0x2e02e2[_0x837b('0x36')]=_[_0x837b('0x37')](_0x2e02e2[_0x837b('0x33')],_0x2e02e2[_0x837b('0x35')]);_0x33462a[_0x837b('0x38')]=_[_0x837b('0x37')](_0x2e02e2[_0x837b('0x33')],qs[_0x837b('0x39')](_0x5a6278[_0x837b('0x35')]['fields']));_0x33462a[_0x837b('0x38')]=_0x33462a[_0x837b('0x38')][_0x837b('0x3a')]?_0x33462a[_0x837b('0x38')]:_0x2e02e2[_0x837b('0x33')];if(!_0x5a6278[_0x837b('0x35')][_0x837b('0x3b')](_0x837b('0x3c'))){_0x33462a['limit']=qs[_0x837b('0x20')](_0x5a6278[_0x837b('0x35')][_0x837b('0x20')]);_0x33462a['offset']=qs[_0x837b('0x1e')](_0x5a6278['query'][_0x837b('0x1e')]);}_0x33462a[_0x837b('0x3d')]=qs['sort'](_0x5a6278[_0x837b('0x35')][_0x837b('0x3e')]);_0x33462a[_0x837b('0x3f')]=qs[_0x837b('0x36')](_['pick'](_0x5a6278[_0x837b('0x35')],_0x2e02e2[_0x837b('0x36')]),_0x5df584);if(_0x5a6278[_0x837b('0x35')]['filter']){_0x33462a[_0x837b('0x3f')]=_[_0x837b('0x40')](_0x33462a[_0x837b('0x3f')],{'$or':_[_0x837b('0x2f')](_0x5df584,function(_0x4d1063){if(_0x4d1063[_0x837b('0x32')]!==_0x837b('0x41')){var _0x4e14b4={};_0x4e14b4[_0x4d1063[_0x837b('0x2c')]]={'$like':'%'+_0x5a6278[_0x837b('0x35')][_0x837b('0x42')]+'%'};return _0x4e14b4;}})});}_0x33462a=_[_0x837b('0x40')]({},_0x33462a,_0x5a6278[_0x837b('0x43')]);var _0x4f50e3={'where':_0x33462a[_0x837b('0x3f')]};return db[_0x837b('0x30')]['count'](_0x4f50e3)[_0x837b('0x29')](function(_0x459219){_0x4e9ea0[_0x837b('0x21')]=_0x459219;if(_0x5a6278['query'][_0x837b('0x44')]){_0x33462a[_0x837b('0x45')]=[{'all':!![]}];}return db['VoiceMailMessage'][_0x837b('0x46')](_0x33462a);})[_0x837b('0x29')](function(_0x1bfe8f){_0x4e9ea0['rows']=_0x1bfe8f;return _0x4e9ea0;})['then'](respondWithFilteredResult(_0x4f10a4,_0x33462a))[_0x837b('0x47')](handleError(_0x4f10a4,null));};exports[_0x837b('0x48')]=function(_0xe2441b,_0x48ca07){var _0x4ea661={'raw':!![],'where':{'id':_0xe2441b[_0x837b('0x49')]['id']}},_0x2d59be={};_0x2d59be['model']=_[_0x837b('0x34')](db['VoiceMailMessage'][_0x837b('0x4a')]);_0x2d59be[_0x837b('0x35')]=_[_0x837b('0x34')](_0xe2441b['query']);_0x2d59be[_0x837b('0x36')]=_[_0x837b('0x37')](_0x2d59be[_0x837b('0x33')],_0x2d59be[_0x837b('0x35')]);_0x4ea661[_0x837b('0x38')]=_['intersection'](_0x2d59be[_0x837b('0x33')],qs[_0x837b('0x39')](_0xe2441b[_0x837b('0x35')][_0x837b('0x39')]));_0x4ea661[_0x837b('0x38')]=_0x4ea661[_0x837b('0x38')][_0x837b('0x3a')]?_0x4ea661['attributes']:_0x2d59be['model'];if(_0xe2441b[_0x837b('0x35')][_0x837b('0x44')]){_0x4ea661[_0x837b('0x45')]=[{'all':!![]}];}_0x4ea661=_[_0x837b('0x40')]({},_0x4ea661,_0xe2441b[_0x837b('0x43')]);return db['VoiceMailMessage'][_0x837b('0x4b')](_0x4ea661)['then'](handleEntityNotFound(_0x48ca07,null))[_0x837b('0x29')](respondWithResult(_0x48ca07,null))[_0x837b('0x47')](handleError(_0x48ca07,null));};exports['create']=function(_0x4007a6,_0xa47a97){return db[_0x837b('0x30')]['create'](_0x4007a6[_0x837b('0x4c')],{})[_0x837b('0x29')](respondWithResult(_0xa47a97,0xc9))[_0x837b('0x47')](handleError(_0xa47a97,null));};exports['update']=function(_0x2c7fc3,_0x4b30dc){if(_0x2c7fc3[_0x837b('0x4c')]['id']){delete _0x2c7fc3[_0x837b('0x4c')]['id'];}return db[_0x837b('0x30')][_0x837b('0x4b')]({'where':{'id':_0x2c7fc3['params']['id']}})['then'](handleEntityNotFound(_0x4b30dc,null))[_0x837b('0x29')](saveUpdates(_0x2c7fc3['body'],null))[_0x837b('0x29')](respondWithResult(_0x4b30dc,null))[_0x837b('0x47')](handleError(_0x4b30dc,null));};exports[_0x837b('0x28')]=function(_0x1f2823,_0xd5bc5e){return db[_0x837b('0x30')][_0x837b('0x4b')]({'where':{'id':_0x1f2823[_0x837b('0x49')]['id']}})[_0x837b('0x29')](handleEntityNotFound(_0xd5bc5e,null))[_0x837b('0x29')](removeEntity(_0xd5bc5e,null))[_0x837b('0x47')](handleError(_0xd5bc5e,null));};exports[_0x837b('0x4d')]=function(_0x3dd102,_0x1742df,_0x50b626){return db[_0x837b('0x30')][_0x837b('0x4b')]({'where':{'id':_0x3dd102['params']['id']},'attributes':['id',_0x837b('0x4e'),_0x837b('0x4f')]})['then'](handleEntityNotFound(_0x1742df,null))[_0x837b('0x29')](function(_0x505d16){if(_0x505d16){if(!_0x505d16[_0x837b('0x4e')]){throw new db[(_0x837b('0x50'))]['ValidationError'](_0x837b('0x51'));}var _0xab3370={'Content-Type':_0x837b('0x52'),'Content-Disposition':'attachment'};if(_0x505d16[_0x837b('0x4f')]){_0xab3370[_0x837b('0x53')]=_0x837b('0x54')+_0x505d16['msg_id']+_0x837b('0x55');}_0x1742df[_0x837b('0x22')](_0xab3370);return _0x1742df[_0x837b('0x2d')](new Buffer(_0x505d16['recording']));}})[_0x837b('0x47')](handleError(_0x1742df,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index 6ba94f8..b99816d 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 _0xe4b7=['bluebird','request-promise','path','../../config/environment','./voiceMailMessage.attributes','exports','define','VoiceMailMessage','voice_voicemail_messages','dir','lodash','../../config/logger','api'];(function(_0x1d87fc,_0x1e5321){var _0x492b56=function(_0x4c6b16){while(--_0x4c6b16){_0x1d87fc['push'](_0x1d87fc['shift']());}};_0x492b56(++_0x1e5321);}(_0xe4b7,0x11b));var _0x7e4b=function(_0x56ce7d,_0x57d050){_0x56ce7d=_0x56ce7d-0x0;var _0x72a880=_0xe4b7[_0x56ce7d];return _0x72a880;};'use strict';var _=require(_0x7e4b('0x0'));var util=require('util');var logger=require(_0x7e4b('0x1'))(_0x7e4b('0x2'));var moment=require('moment');var BPromise=require(_0x7e4b('0x3'));var rp=require(_0x7e4b('0x4'));var fs=require('fs');var path=require(_0x7e4b('0x5'));var rimraf=require('rimraf');var config=require(_0x7e4b('0x6'));var attributes=require(_0x7e4b('0x7'));module[_0x7e4b('0x8')]=function(_0x36c825,_0x18bd91){return _0x36c825[_0x7e4b('0x9')](_0x7e4b('0xa'),attributes,{'tableName':_0x7e4b('0xb'),'paranoid':![],'indexes':[{'name':_0x7e4b('0xc'),'fields':[_0x7e4b('0xc')]}],'timestamps':![]});}; \ No newline at end of file +var _0xa83f=['exports','define','VoiceMailMessage','voice_voicemail_messages','dir','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x517515,_0x2e3be3){var _0x42126d=function(_0x7f08cc){while(--_0x7f08cc){_0x517515['push'](_0x517515['shift']());}};_0x42126d(++_0x2e3be3);}(_0xa83f,0x101));var _0xfa83=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa83f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xfa83('0x0'));var logger=require(_0xfa83('0x1'))(_0xfa83('0x2'));var moment=require(_0xfa83('0x3'));var BPromise=require(_0xfa83('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfa83('0x5'));var rimraf=require(_0xfa83('0x6'));var config=require('../../config/environment');var attributes=require('./voiceMailMessage.attributes');module[_0xfa83('0x7')]=function(_0x4cffc0,_0x3a753f){return _0x4cffc0[_0xfa83('0x8')](_0xfa83('0x9'),attributes,{'tableName':_0xfa83('0xa'),'paranoid':![],'indexes':[{'name':'dir','fields':[_0xfa83('0xb')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index 28df84d..6a3de36 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 _0x71df=['request\x20sent','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','../../config/utils','../../config/environment','client','http','request','then','info','VoiceMailMessage,\x20%s,\x20%s'];(function(_0x560b55,_0xcaec1f){var _0x289d05=function(_0x41c2cb){while(--_0x41c2cb){_0x560b55['push'](_0x560b55['shift']());}};_0x289d05(++_0xcaec1f);}(_0x71df,0x80));var _0xf71d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x71df[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf71d('0x0'));var util=require(_0xf71d('0x1'));var moment=require(_0xf71d('0x2'));var BPromise=require('bluebird');var rs=require(_0xf71d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xf71d('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xf71d('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xf71d('0x6')][_0xf71d('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2ad93a,_0x1fbc3a,_0x3d3738){return new BPromise(function(_0x237d8b,_0x339d9c){return client[_0xf71d('0x8')](_0x2ad93a,_0x3d3738)[_0xf71d('0x9')](function(_0x1d71a1){logger[_0xf71d('0xa')](_0xf71d('0xb'),_0x1fbc3a,_0xf71d('0xc'));logger['debug'](_0xf71d('0xd'),_0x1fbc3a,_0xf71d('0xc'),JSON[_0xf71d('0xe')](_0x1d71a1));if(_0x1d71a1[_0xf71d('0xf')]){if(_0x1d71a1['error'][_0xf71d('0x10')]===0x1f4){logger['error']('VoiceMailMessage,\x20%s,\x20%s',_0x1fbc3a,_0x1d71a1[_0xf71d('0xf')][_0xf71d('0x11')]);return _0x339d9c(_0x1d71a1['error']['message']);}logger[_0xf71d('0xf')](_0xf71d('0xb'),_0x1fbc3a,_0x1d71a1['error']['message']);return _0x237d8b(_0x1d71a1[_0xf71d('0xf')][_0xf71d('0x11')]);}else{logger[_0xf71d('0xa')](_0xf71d('0xb'),_0x1fbc3a,_0xf71d('0xc'));_0x237d8b(_0x1d71a1[_0xf71d('0x12')][_0xf71d('0x11')]);}})[_0xf71d('0x13')](function(_0x2eb2f4){logger[_0xf71d('0xf')]('VoiceMailMessage,\x20%s,\x20%s',_0x1fbc3a,_0x2eb2f4);_0x339d9c(_0x2eb2f4);});});} \ No newline at end of file +var _0x3a31=['catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','info','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x6abf40,_0x185668){var _0x542746=function(_0x40b765){while(--_0x40b765){_0x6abf40['push'](_0x6abf40['shift']());}};_0x542746(++_0x185668);}(_0x3a31,0x1b9));var _0x13a3=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x3a31[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require(_0x13a3('0x0'));var util=require(_0x13a3('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x13a3('0x2'));var fs=require('fs');var Redis=require(_0x13a3('0x3'));var db=require(_0x13a3('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x13a3('0x5'))(_0x13a3('0x6'));var config=require(_0x13a3('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x13a3('0x8')][_0x13a3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x17ed7a,_0x488b89,_0x4a9a1e){return new BPromise(function(_0xe8094a,_0x52beed){return client[_0x13a3('0xa')](_0x17ed7a,_0x4a9a1e)['then'](function(_0x4b5992){logger[_0x13a3('0xb')](_0x13a3('0xc'),_0x488b89,_0x13a3('0xd'));logger[_0x13a3('0xe')](_0x13a3('0xf'),_0x488b89,_0x13a3('0xd'),JSON[_0x13a3('0x10')](_0x4b5992));if(_0x4b5992['error']){if(_0x4b5992[_0x13a3('0x11')][_0x13a3('0x12')]===0x1f4){logger[_0x13a3('0x11')](_0x13a3('0xc'),_0x488b89,_0x4b5992[_0x13a3('0x11')][_0x13a3('0x13')]);return _0x52beed(_0x4b5992[_0x13a3('0x11')]['message']);}logger[_0x13a3('0x11')](_0x13a3('0xc'),_0x488b89,_0x4b5992[_0x13a3('0x11')][_0x13a3('0x13')]);return _0xe8094a(_0x4b5992['error']['message']);}else{logger[_0x13a3('0xb')]('VoiceMailMessage,\x20%s,\x20%s',_0x488b89,'request\x20sent');_0xe8094a(_0x4b5992[_0x13a3('0x14')][_0x13a3('0x13')]);}})[_0x13a3('0x15')](function(_0x2c39c9){logger[_0x13a3('0x11')](_0x13a3('0xc'),_0x488b89,_0x2c39c9);_0x52beed(_0x2c39c9);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index 323fdc6..e254709 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 _0x18bd=['get','isAuthenticated','index','/:id','/:id/sounds','getSounds','post','put','update','delete','destroy','/:id/sounds/:id2','removeSound','multer','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller'];(function(_0x2a554a,_0x16586c){var _0x299fa9=function(_0x3521cb){while(--_0x3521cb){_0x2a554a['push'](_0x2a554a['shift']());}};_0x299fa9(++_0x16586c);}(_0x18bd,0xf4));var _0xd18b=function(_0x21b514,_0x357214){_0x21b514=_0x21b514-0x0;var _0x1e38b0=_0x18bd[_0x21b514];return _0x1e38b0;};'use strict';var multer=require(_0xd18b('0x0'));var util=require(_0xd18b('0x1'));var path=require('path');var timeout=require(_0xd18b('0x2'));var express=require(_0xd18b('0x3'));var router=express[_0xd18b('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xd18b('0x5'));var config=require(_0xd18b('0x6'));var controller=require(_0xd18b('0x7'));router[_0xd18b('0x8')]('/',auth[_0xd18b('0x9')](),controller[_0xd18b('0xa')]);router[_0xd18b('0x8')](_0xd18b('0xb'),auth[_0xd18b('0x9')](),controller['show']);router[_0xd18b('0x8')](_0xd18b('0xc'),auth[_0xd18b('0x9')](),controller[_0xd18b('0xd')]);router[_0xd18b('0xe')]('/',auth[_0xd18b('0x9')](),controller['create']);router['post']('/:id/sounds',auth[_0xd18b('0x9')](),controller['addSound']);router[_0xd18b('0xf')](_0xd18b('0xb'),auth[_0xd18b('0x9')](),controller[_0xd18b('0x10')]);router[_0xd18b('0x11')](_0xd18b('0xb'),auth[_0xd18b('0x9')](),controller[_0xd18b('0x12')]);router[_0xd18b('0x11')](_0xd18b('0x13'),auth['isAuthenticated'](),controller[_0xd18b('0x14')]);module['exports']=router; \ No newline at end of file +var _0x81f6=['show','/:id/sounds','isAuthenticated','post','addSound','put','update','delete','destroy','/:id/sounds/:id2','exports','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','get','index','/:id'];(function(_0xaa6a06,_0xdab694){var _0x280d6f=function(_0xf154fd){while(--_0xf154fd){_0xaa6a06['push'](_0xaa6a06['shift']());}};_0x280d6f(++_0xdab694);}(_0x81f6,0xbb));var _0x681f=function(_0x202045,_0xf1aa80){_0x202045=_0x202045-0x0;var _0x3d413d=_0x81f6[_0x202045];return _0x3d413d;};'use strict';var multer=require('multer');var util=require(_0x681f('0x0'));var path=require(_0x681f('0x1'));var timeout=require('connect-timeout');var express=require(_0x681f('0x2'));var router=express['Router']();var fs_extra=require(_0x681f('0x3'));var auth=require(_0x681f('0x4'));var interaction=require(_0x681f('0x5'));var config=require(_0x681f('0x6'));var controller=require(_0x681f('0x7'));router[_0x681f('0x8')]('/',auth['isAuthenticated'](),controller[_0x681f('0x9')]);router['get'](_0x681f('0xa'),auth['isAuthenticated'](),controller[_0x681f('0xb')]);router[_0x681f('0x8')](_0x681f('0xc'),auth[_0x681f('0xd')](),controller['getSounds']);router[_0x681f('0xe')]('/',auth[_0x681f('0xd')](),controller['create']);router[_0x681f('0xe')]('/:id/sounds',auth[_0x681f('0xd')](),controller[_0x681f('0xf')]);router[_0x681f('0x10')](_0x681f('0xa'),auth['isAuthenticated'](),controller[_0x681f('0x11')]);router[_0x681f('0x12')](_0x681f('0xa'),auth[_0x681f('0xd')](),controller[_0x681f('0x13')]);router[_0x681f('0x12')](_0x681f('0x14'),auth[_0x681f('0xd')](),controller['removeSound']);module[_0x681f('0x15')]=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index d37bb22..3c00d5c 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 _0x3d2e=['alpha','BOOLEAN','sequelize','exports','STRING','name','ENUM','custom','files','quietmp3nb'];(function(_0x395bfe,_0x4db521){var _0x35c81c=function(_0x484a1b){while(--_0x484a1b){_0x395bfe['push'](_0x395bfe['shift']());}};_0x35c81c(++_0x4db521);}(_0x3d2e,0xb6));var _0xe3d2=function(_0x4b3afd,_0x36dbc2){_0x4b3afd=_0x4b3afd-0x0;var _0x4e3f4b=_0x3d2e[_0x4b3afd];return _0x4e3f4b;};'use strict';var Sequelize=require(_0xe3d2('0x0'));module[_0xe3d2('0x1')]={'name':{'type':Sequelize[_0xe3d2('0x2')],'allowNull':![],'unique':_0xe3d2('0x3')},'mode':{'type':Sequelize[_0xe3d2('0x4')](_0xe3d2('0x5'),_0xe3d2('0x6'),'mp3nb',_0xe3d2('0x7'),'quietmp3','mp3'),'allowNull':!![],'defaultValue':'files'},'directory':{'type':Sequelize['STRING'],'allowNull':!![]},'application':{'type':Sequelize[_0xe3d2('0x2')],'allowNull':!![]},'digit':{'type':Sequelize[_0xe3d2('0x2')],'allowNull':!![]},'sort':{'type':Sequelize[_0xe3d2('0x2')],'allowNull':!![],'defaultValue':_0xe3d2('0x8')},'format':{'type':Sequelize[_0xe3d2('0x2')],'allowNull':!![]},'stamp':{'type':'TIMESTAMP'},'defaultEntry':{'type':Sequelize[_0xe3d2('0x9')],'defaultValue':0x0}}; \ No newline at end of file +var _0x43e5=['alpha','TIMESTAMP','sequelize','STRING','name','ENUM','custom','mp3nb','quietmp3nb','quietmp3','mp3','files'];(function(_0xbce3ad,_0x200db7){var _0x49be52=function(_0x36feef){while(--_0x36feef){_0xbce3ad['push'](_0xbce3ad['shift']());}};_0x49be52(++_0x200db7);}(_0x43e5,0x176));var _0x543e=function(_0x1af373,_0x2d36aa){_0x1af373=_0x1af373-0x0;var _0x57dcc6=_0x43e5[_0x1af373];return _0x57dcc6;};'use strict';var Sequelize=require(_0x543e('0x0'));module['exports']={'name':{'type':Sequelize[_0x543e('0x1')],'allowNull':![],'unique':_0x543e('0x2')},'mode':{'type':Sequelize[_0x543e('0x3')](_0x543e('0x4'),'files',_0x543e('0x5'),_0x543e('0x6'),_0x543e('0x7'),_0x543e('0x8')),'allowNull':!![],'defaultValue':_0x543e('0x9')},'directory':{'type':Sequelize['STRING'],'allowNull':!![]},'application':{'type':Sequelize['STRING'],'allowNull':!![]},'digit':{'type':Sequelize['STRING'],'allowNull':!![]},'sort':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x543e('0xa')},'format':{'type':Sequelize[_0x543e('0x1')],'allowNull':!![]},'stamp':{'type':_0x543e('0xb')},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js index fbf0f78..c4dee23 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 _0x2fbf=['join','server/files/sounds/converted','format','%s.%s','basename','extname','symlinkSync','removeSound','findOne','id2','getSounds','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','limit','undefined','count','set','apply','reject','save','update','then','destroy','get','MusicOnHolds','UserProfileResource','error','name','send','map','VoiceMusicOnHold','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','filter','where','merge','include','findAll','rows','catch','show','params','keys','includeAll','options','find','body','create','sequelize','root','server/files/moh','mode','mkdirSync','0777','role','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','transaction','directory','forEach','unlinkSync','rmdirSync','Sequelize','ValidationError','message','addSound','Sound','save_name','converted_format','createdAt'];(function(_0x318bd5,_0x2bbc00){var _0x3ffdfe=function(_0xb51d0d){while(--_0xb51d0d){_0x318bd5['push'](_0x318bd5['shift']());}};_0x3ffdfe(++_0x2bbc00);}(_0x2fbf,0x7c));var _0xf2fb=function(_0x4f3e83,_0xa463d6){_0x4f3e83=_0x4f3e83-0x0;var _0x571072=_0x2fbf[_0x4f3e83];return _0x571072;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf2fb('0x0'));var zipdir=require(_0xf2fb('0x1'));var jsonpatch=require(_0xf2fb('0x2'));var rp=require(_0xf2fb('0x3'));var moment=require(_0xf2fb('0x4'));var BPromise=require(_0xf2fb('0x5'));var Mustache=require(_0xf2fb('0x6'));var util=require(_0xf2fb('0x7'));var path=require(_0xf2fb('0x8'));var sox=require(_0xf2fb('0x9'));var csv=require(_0xf2fb('0xa'));var ejs=require(_0xf2fb('0xb'));var fs=require('fs');var fs_extra=require(_0xf2fb('0xc'));var _=require(_0xf2fb('0xd'));var squel=require(_0xf2fb('0xe'));var crypto=require(_0xf2fb('0xf'));var jsforce=require(_0xf2fb('0x10'));var deskjs=require(_0xf2fb('0x11'));var toCsv=require(_0xf2fb('0xa'));var querystring=require(_0xf2fb('0x12'));var Papa=require(_0xf2fb('0x13'));var Redis=require(_0xf2fb('0x14'));var authService=require(_0xf2fb('0x15'));var qs=require(_0xf2fb('0x16'));var as=require(_0xf2fb('0x17'));var hardwareService=require(_0xf2fb('0x18'));var logger=require('../../config/logger')('api');var utils=require(_0xf2fb('0x19'));var config=require(_0xf2fb('0x1a'));var licenseUtil=require(_0xf2fb('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x15f328,_0x197660){_0x197660=_0x197660||0xcc;return function(_0x4e8866){if(_0x4e8866){return _0x15f328[_0xf2fb('0x1c')](_0x197660);}return _0x15f328[_0xf2fb('0x1d')](_0x197660)['end']();};}function respondWithResult(_0x152d60,_0x5eb67d){_0x5eb67d=_0x5eb67d||0xc8;return function(_0x288397){if(_0x288397){return _0x152d60[_0xf2fb('0x1d')](_0x5eb67d)[_0xf2fb('0x1e')](_0x288397);}};}function respondWithFilteredResult(_0x755973,_0x19b0f7){return function(_0x59ae2b){if(_0x59ae2b){var _0x2e3d32=typeof _0x19b0f7[_0xf2fb('0x1f')]==='undefined'&&typeof _0x19b0f7[_0xf2fb('0x20')]===_0xf2fb('0x21');var _0x4a93fe=_0x59ae2b[_0xf2fb('0x22')];var _0x34a3e9=_0x2e3d32?0x0:_0x19b0f7[_0xf2fb('0x1f')];var _0x2e817b=_0x2e3d32?_0x59ae2b[_0xf2fb('0x22')]:_0x19b0f7[_0xf2fb('0x1f')]+_0x19b0f7[_0xf2fb('0x20')];var _0x4c50da;if(_0x2e817b>=_0x4a93fe){_0x2e817b=_0x4a93fe;_0x4c50da=0xc8;}else{_0x4c50da=0xce;}_0x755973[_0xf2fb('0x1d')](_0x4c50da);return _0x755973[_0xf2fb('0x23')]('Content-Range',_0x34a3e9+'-'+_0x2e817b+'/'+_0x4a93fe)[_0xf2fb('0x1e')](_0x59ae2b);}return null;};}function patchUpdates(_0x505e48){return function(_0x204cae){try{jsonpatch[_0xf2fb('0x24')](_0x204cae,_0x505e48,!![]);}catch(_0xb9f7cc){return BPromise[_0xf2fb('0x25')](_0xb9f7cc);}return _0x204cae[_0xf2fb('0x26')]();};}function saveUpdates(_0x263800,_0x2dc3fb){return function(_0x1e1a2a){if(_0x1e1a2a){return _0x1e1a2a[_0xf2fb('0x27')](_0x263800)[_0xf2fb('0x28')](function(_0x40f447){return _0x40f447;});}return null;};}function removeEntity(_0x541a7b,_0x11a49a){return function(_0x36f326){if(_0x36f326){return _0x36f326[_0xf2fb('0x29')]()[_0xf2fb('0x28')](function(){var _0x4bc308=_0x36f326[_0xf2fb('0x2a')]({'plain':!![]});var _0x4b6a2e=_0xf2fb('0x2b');return db[_0xf2fb('0x2c')]['destroy']({'where':{'type':_0x4b6a2e,'resourceId':_0x4bc308['id']}})[_0xf2fb('0x28')](function(){return _0x36f326;});})['then'](function(){_0x541a7b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x188c70,_0xd0def5){return function(_0xa4da1f){if(!_0xa4da1f){_0x188c70['sendStatus'](0x194);}return _0xa4da1f;};}function handleError(_0x1fb17e,_0x46b49e){_0x46b49e=_0x46b49e||0x1f4;return function(_0x1aea8d){logger[_0xf2fb('0x2d')](_0x1aea8d['stack']);if(_0x1aea8d[_0xf2fb('0x2e')]){delete _0x1aea8d[_0xf2fb('0x2e')];}_0x1fb17e[_0xf2fb('0x1d')](_0x46b49e)[_0xf2fb('0x2f')](_0x1aea8d);};}exports['index']=function(_0x22fc18,_0x5ea797){var _0x2f624f={},_0x1c624c={},_0x41df08={'count':0x0,'rows':[]};var _0x9e43b=_[_0xf2fb('0x30')](db[_0xf2fb('0x31')][_0xf2fb('0x32')],function(_0x804d0){return{'name':_0x804d0[_0xf2fb('0x33')],'type':_0x804d0['type'][_0xf2fb('0x34')]};});_0x1c624c[_0xf2fb('0x35')]=_[_0xf2fb('0x30')](_0x9e43b,_0xf2fb('0x2e'));_0x1c624c[_0xf2fb('0x36')]=_['keys'](_0x22fc18['query']);_0x1c624c[_0xf2fb('0x37')]=_[_0xf2fb('0x38')](_0x1c624c[_0xf2fb('0x35')],_0x1c624c[_0xf2fb('0x36')]);_0x2f624f[_0xf2fb('0x39')]=_[_0xf2fb('0x38')](_0x1c624c[_0xf2fb('0x35')],qs[_0xf2fb('0x3a')](_0x22fc18['query'][_0xf2fb('0x3a')]));_0x2f624f[_0xf2fb('0x39')]=_0x2f624f[_0xf2fb('0x39')][_0xf2fb('0x3b')]?_0x2f624f[_0xf2fb('0x39')]:_0x1c624c['model'];if(!_0x22fc18[_0xf2fb('0x36')]['hasOwnProperty'](_0xf2fb('0x3c'))){_0x2f624f[_0xf2fb('0x20')]=qs[_0xf2fb('0x20')](_0x22fc18['query'][_0xf2fb('0x20')]);_0x2f624f[_0xf2fb('0x1f')]=qs[_0xf2fb('0x1f')](_0x22fc18['query']['offset']);}_0x2f624f[_0xf2fb('0x3d')]=qs[_0xf2fb('0x3e')](_0x22fc18[_0xf2fb('0x36')]['sort']);delete _0x22fc18[_0xf2fb('0x36')][_0xf2fb('0x3e')];_0x2f624f['where']=qs[_0xf2fb('0x37')](_['pick'](_0x22fc18[_0xf2fb('0x36')],_0x1c624c['filters']),_0x9e43b);if(_0x22fc18['query'][_0xf2fb('0x3f')]){_0x2f624f['where']=_['merge'](_0x2f624f[_0xf2fb('0x40')],{'$or':_[_0xf2fb('0x30')](_0x9e43b,function(_0x38f0b8){if(_0x38f0b8['type']!=='VIRTUAL'){var _0x28d575={};_0x28d575[_0x38f0b8[_0xf2fb('0x2e')]]={'$like':'%'+_0x22fc18[_0xf2fb('0x36')][_0xf2fb('0x3f')]+'%'};return _0x28d575;}})});}_0x2f624f=_[_0xf2fb('0x41')]({},_0x2f624f,_0x22fc18['options']);var _0x5efdcb={'where':_0x2f624f[_0xf2fb('0x40')]};return db[_0xf2fb('0x31')]['count'](_0x5efdcb)['then'](function(_0x4be7ab){_0x41df08[_0xf2fb('0x22')]=_0x4be7ab;if(_0x22fc18[_0xf2fb('0x36')]['includeAll']){_0x2f624f[_0xf2fb('0x42')]=[{'all':!![]}];}return db['VoiceMusicOnHold'][_0xf2fb('0x43')](_0x2f624f);})[_0xf2fb('0x28')](function(_0x4fcc14){_0x41df08[_0xf2fb('0x44')]=_0x4fcc14;return _0x41df08;})['then'](respondWithFilteredResult(_0x5ea797,_0x2f624f))[_0xf2fb('0x45')](handleError(_0x5ea797,null));};exports[_0xf2fb('0x46')]=function(_0x2c5e0a,_0x195403){var _0x253bbc={'raw':![],'where':{'id':_0x2c5e0a[_0xf2fb('0x47')]['id']}},_0x2da8fc={};_0x2da8fc[_0xf2fb('0x35')]=_['keys'](db['VoiceMusicOnHold']['rawAttributes']);_0x2da8fc[_0xf2fb('0x36')]=_[_0xf2fb('0x48')](_0x2c5e0a[_0xf2fb('0x36')]);_0x2da8fc['filters']=_[_0xf2fb('0x38')](_0x2da8fc['model'],_0x2da8fc['query']);_0x253bbc[_0xf2fb('0x39')]=_[_0xf2fb('0x38')](_0x2da8fc['model'],qs[_0xf2fb('0x3a')](_0x2c5e0a['query'][_0xf2fb('0x3a')]));_0x253bbc['attributes']=_0x253bbc[_0xf2fb('0x39')][_0xf2fb('0x3b')]?_0x253bbc[_0xf2fb('0x39')]:_0x2da8fc[_0xf2fb('0x35')];if(_0x2c5e0a['query'][_0xf2fb('0x49')]){_0x253bbc['include']=[{'all':!![]}];}_0x253bbc=_[_0xf2fb('0x41')]({},_0x253bbc,_0x2c5e0a[_0xf2fb('0x4a')]);return db[_0xf2fb('0x31')][_0xf2fb('0x4b')](_0x253bbc)[_0xf2fb('0x28')](handleEntityNotFound(_0x195403,null))[_0xf2fb('0x28')](respondWithResult(_0x195403,null))[_0xf2fb('0x45')](handleError(_0x195403,null));};exports[_0xf2fb('0x27')]=function(_0x166b7e,_0x3ebbe6){if(_0x166b7e[_0xf2fb('0x4c')]['id']){delete _0x166b7e[_0xf2fb('0x4c')]['id'];}return db[_0xf2fb('0x31')][_0xf2fb('0x4b')]({'where':{'id':_0x166b7e[_0xf2fb('0x47')]['id']}})[_0xf2fb('0x28')](handleEntityNotFound(_0x3ebbe6,null))[_0xf2fb('0x28')](saveUpdates(_0x166b7e['body'],null))[_0xf2fb('0x28')](respondWithResult(_0x3ebbe6,null))['catch'](handleError(_0x3ebbe6,null));};exports[_0xf2fb('0x4d')]=function(_0x50f716,_0x31ca22,_0x2c1296){return db[_0xf2fb('0x4e')]['transaction'](function(_0x180dc1){if(_0x50f716[_0xf2fb('0x4c')]['mode']==='files'){_0x50f716[_0xf2fb('0x4c')]['directory']=path['join'](config[_0xf2fb('0x4f')],_0xf2fb('0x50'),_0x50f716['body']['name']);}return db[_0xf2fb('0x31')][_0xf2fb('0x4d')](_0x50f716[_0xf2fb('0x4c')],{'transaction':_0x180dc1})[_0xf2fb('0x28')](function(_0x174089){if(_0x50f716[_0xf2fb('0x4c')][_0xf2fb('0x51')]==='files'){fs[_0xf2fb('0x52')](_0x174089['directory'],parseInt(_0xf2fb('0x53'),0x8));}var _0x53c255=_0x50f716['user'][_0xf2fb('0x2a')]({'plain':!![]});if(!_0x53c255)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x53c255[_0xf2fb('0x54')]===_0xf2fb('0x55')){var _0x16b4cf=_0x174089['get']({'plain':!![]});return db['UserProfileSection'][_0xf2fb('0x4b')]({'where':{'name':_0xf2fb('0x2b'),'userProfileId':_0x53c255[_0xf2fb('0x56')]},'raw':!![]})['then'](function(_0x14cb6c){if(_0x14cb6c&&_0x14cb6c[_0xf2fb('0x57')]===0x0){return db[_0xf2fb('0x2c')][_0xf2fb('0x4d')]({'name':_0x16b4cf[_0xf2fb('0x2e')],'resourceId':_0x16b4cf['id'],'type':_0x14cb6c[_0xf2fb('0x2e')],'sectionId':_0x14cb6c['id']},{})[_0xf2fb('0x28')](function(){return _0x174089;});}else{return _0x174089;}})['catch'](function(_0x3e049c){logger[_0xf2fb('0x2d')](_0xf2fb('0x58'),_0x3e049c);});}return _0x174089;});})['then'](respondWithResult(_0x31ca22,0xc9))['catch'](handleError(_0x31ca22,null));};exports[_0xf2fb('0x29')]=function(_0x2bf7a6,_0x451589,_0x8dc321){var _0x200722;return db[_0xf2fb('0x31')][_0xf2fb('0x4b')]({'where':{'id':_0x2bf7a6[_0xf2fb('0x47')]['id']}})['then'](function(_0x22715f){if(_0x22715f){return db['sequelize'][_0xf2fb('0x59')](function(_0x27cb52){return _0x22715f[_0xf2fb('0x29')]({'transaction':_0x27cb52,'raw':!![]})[_0xf2fb('0x28')](function(_0x20e59d){if(_0x20e59d['directory']){fs['readdirSync'](_0x20e59d[_0xf2fb('0x5a')])[_0xf2fb('0x5b')](function(_0x596a79){fs[_0xf2fb('0x5c')](path['join'](_0x20e59d['directory'],_0x596a79));});fs[_0xf2fb('0x5d')](_0x20e59d['directory']);}return _0x20e59d;});})[_0xf2fb('0x45')](function(_0x1a56ed){throw new db[(_0xf2fb('0x5e'))][(_0xf2fb('0x5f'))](_0x1a56ed[_0xf2fb('0x60')]);});}})[_0xf2fb('0x28')](handleEntityNotFound(_0x451589,null))[_0xf2fb('0x28')](removeEntity(_0x451589,null))[_0xf2fb('0x45')](handleError(_0x451589,null));};exports['addSound']=function(_0x1f69bc,_0x289aa3,_0x4e84f2){return db[_0xf2fb('0x4e')]['transaction'](function(_0x1689d3){var _0x488d4f;return db[_0xf2fb('0x31')][_0xf2fb('0x4b')]({'where':{'id':_0x1f69bc['params']['id']}})['then'](function(_0x315e18){if(_0x315e18){_0x488d4f=_0x315e18;return _0x315e18[_0xf2fb('0x61')](_0x1f69bc[_0xf2fb('0x4c')]['id'],{'transaction':_0x1689d3});}})[_0xf2fb('0x28')](function(_0x59417d){if(_0x59417d){return db[_0xf2fb('0x62')]['findOne']({'where':{'id':_0x1f69bc[_0xf2fb('0x4c')]['id']},'attributes':['id',_0xf2fb('0x2e'),_0xf2fb('0x63'),_0xf2fb('0x64'),_0xf2fb('0x65')],'raw':!![]});}})[_0xf2fb('0x28')](function(_0x3f319b){if(_0x3f319b){var _0x41f540=path[_0xf2fb('0x66')](config['root'],_0xf2fb('0x67'),util[_0xf2fb('0x68')](_0xf2fb('0x69'),path[_0xf2fb('0x6a')](_0x3f319b[_0xf2fb('0x63')],path[_0xf2fb('0x6b')](_0x3f319b[_0xf2fb('0x63')])),_0x3f319b['converted_format']));var _0x511560=path[_0xf2fb('0x66')](config[_0xf2fb('0x4f')],'server/files/moh',_0x488d4f[_0xf2fb('0x2e')],util[_0xf2fb('0x68')](_0xf2fb('0x69'),_0x3f319b['name'],_0x3f319b['converted_format']));fs[_0xf2fb('0x6c')](_0x41f540,_0x511560);return _0x3f319b;}})[_0xf2fb('0x45')](function(_0x10d3fe){throw new db['Sequelize']['ValidationError'](_0x10d3fe[_0xf2fb('0x60')]);});})[_0xf2fb('0x28')](handleEntityNotFound(_0x289aa3,null))['then'](respondWithResult(_0x289aa3,0xc9))['catch'](handleError(_0x289aa3,null));};exports[_0xf2fb('0x6d')]=function(_0x12c6d4,_0x236266,_0xbdfc74){return db['sequelize'][_0xf2fb('0x59')](function(_0x4b8729){var _0x124724;return db[_0xf2fb('0x31')][_0xf2fb('0x6e')]({'where':{'id':_0x12c6d4[_0xf2fb('0x47')]['id']}})[_0xf2fb('0x28')](handleEntityNotFound(_0x236266,null))['then'](function(_0x472af7){if(_0x472af7){_0x124724=_0x472af7;return _0x472af7[_0xf2fb('0x6d')](_0x12c6d4[_0xf2fb('0x47')][_0xf2fb('0x6f')]);}})[_0xf2fb('0x28')](function(_0x2294a3){if(_0x2294a3){return db['Sound']['findOne']({'where':{'id':_0x12c6d4[_0xf2fb('0x47')][_0xf2fb('0x6f')]},'attributes':['id',_0xf2fb('0x2e'),'save_name',_0xf2fb('0x64'),_0xf2fb('0x65')],'raw':!![]});}})[_0xf2fb('0x28')](function(_0x1be125){if(_0x1be125){fs[_0xf2fb('0x5c')](path['join'](_0x124724['directory'],util[_0xf2fb('0x68')](_0xf2fb('0x69'),_0x1be125[_0xf2fb('0x2e')],_0x1be125['converted_format'])));return _0x1be125;}})[_0xf2fb('0x45')](function(_0x4469be){throw new db[(_0xf2fb('0x5e'))][(_0xf2fb('0x5f'))](_0x4469be[_0xf2fb('0x60')]);});})[_0xf2fb('0x28')](handleEntityNotFound(_0x236266,null))[_0xf2fb('0x28')](respondWithStatusCode(_0x236266,0xcc))[_0xf2fb('0x45')](handleError(_0x236266,null));};exports[_0xf2fb('0x70')]=function(_0x2bb8d2,_0x4deb08,_0x52f79){var _0xc08366={};var _0x26fbe5={};var _0x2a03b5;var _0x56e9fd;return db[_0xf2fb('0x31')][_0xf2fb('0x6e')]({'where':{'id':_0x2bb8d2['params']['id']}})[_0xf2fb('0x28')](handleEntityNotFound(_0x4deb08,null))['then'](function(_0x2fa19a){if(_0x2fa19a){_0x2a03b5=_0x2fa19a;_0x26fbe5[_0xf2fb('0x35')]=_[_0xf2fb('0x48')](db[_0xf2fb('0x62')][_0xf2fb('0x32')]);_0x26fbe5[_0xf2fb('0x36')]=_[_0xf2fb('0x48')](_0x2bb8d2[_0xf2fb('0x36')]);_0x26fbe5[_0xf2fb('0x37')]=_['intersection'](_0x26fbe5[_0xf2fb('0x35')],_0x26fbe5[_0xf2fb('0x36')]);_0xc08366[_0xf2fb('0x39')]=_[_0xf2fb('0x38')](_0x26fbe5[_0xf2fb('0x35')],qs[_0xf2fb('0x3a')](_0x2bb8d2['query'][_0xf2fb('0x3a')]));_0xc08366[_0xf2fb('0x39')]=_0xc08366[_0xf2fb('0x39')][_0xf2fb('0x3b')]?_0xc08366[_0xf2fb('0x39')]:_0x26fbe5['model'];_0xc08366[_0xf2fb('0x3d')]=qs[_0xf2fb('0x3e')](_0x2bb8d2[_0xf2fb('0x36')][_0xf2fb('0x3e')]);_0xc08366['where']=qs[_0xf2fb('0x37')](_['pick'](_0x2bb8d2[_0xf2fb('0x36')],_0x26fbe5[_0xf2fb('0x37')]));if(_0x2bb8d2[_0xf2fb('0x36')]['filter']){_0xc08366[_0xf2fb('0x40')]=_[_0xf2fb('0x41')](_0xc08366[_0xf2fb('0x40')],{'$or':_[_0xf2fb('0x30')](_0xc08366[_0xf2fb('0x39')],function(_0x1d67a0){var _0x40b0ac={};_0x40b0ac[_0x1d67a0]={'$like':'%'+_0x2bb8d2[_0xf2fb('0x36')]['filter']+'%'};return _0x40b0ac;})});}_0xc08366=_[_0xf2fb('0x41')]({},_0xc08366,_0x2bb8d2['options']);return _0x2a03b5['getSounds'](_0xc08366);}})[_0xf2fb('0x28')](function(_0x2a497b){if(_0x2a497b){_0x56e9fd=_0x2a497b[_0xf2fb('0x3b')];if(!_0x2bb8d2[_0xf2fb('0x36')]['hasOwnProperty'](_0xf2fb('0x3c'))){_0xc08366[_0xf2fb('0x20')]=qs[_0xf2fb('0x20')](_0x2bb8d2[_0xf2fb('0x36')][_0xf2fb('0x20')]);_0xc08366[_0xf2fb('0x1f')]=qs[_0xf2fb('0x1f')](_0x2bb8d2['query'][_0xf2fb('0x1f')]);}return _0x2a03b5['getSounds'](_0xc08366);}})['then'](function(_0x534539){if(_0x534539){return _0x534539?{'count':_0x56e9fd,'rows':_0x534539}:null;}})[_0xf2fb('0x28')](respondWithResult(_0x4deb08,null))[_0xf2fb('0x45')](handleError(_0x4deb08,null));}; \ No newline at end of file +var _0x63c8=['where','pick','filter','type','VIRTUAL','includeAll','include','VoiceMusicOnHold','findAll','rows','catch','show','merge','body','find','params','create','sequelize','transaction','mode','files','root','server/files/moh','directory','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','MusicOnHolds','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readdirSync','unlinkSync','join','rmdirSync','ValidationError','message','addSound','save_name','createdAt','format','basename','extname','%s.%s','converted_format','symlinkSync','Sequelize','removeSound','findOne','id2','Sound','getSounds','options','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','offset','set','Content-Range','reject','save','update','then','get','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort'];(function(_0x12b9d7,_0x453df1){var _0x2afe8b=function(_0x24a36f){while(--_0x24a36f){_0x12b9d7['push'](_0x12b9d7['shift']());}};_0x2afe8b(++_0x453df1);}(_0x63c8,0xaa));var _0x863c=function(_0x476119,_0x397fac){_0x476119=_0x476119-0x0;var _0x32826a=_0x63c8[_0x476119];return _0x32826a;};'use strict';var emlformat=require(_0x863c('0x0'));var rimraf=require(_0x863c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x863c('0x2'));var moment=require(_0x863c('0x3'));var BPromise=require(_0x863c('0x4'));var Mustache=require(_0x863c('0x5'));var util=require(_0x863c('0x6'));var path=require(_0x863c('0x7'));var sox=require('sox');var csv=require(_0x863c('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x863c('0x9'));var _=require(_0x863c('0xa'));var squel=require('squel');var crypto=require(_0x863c('0xb'));var jsforce=require(_0x863c('0xc'));var deskjs=require(_0x863c('0xd'));var toCsv=require(_0x863c('0x8'));var querystring=require(_0x863c('0xe'));var Papa=require('papaparse');var Redis=require(_0x863c('0xf'));var authService=require(_0x863c('0x10'));var qs=require(_0x863c('0x11'));var as=require(_0x863c('0x12'));var hardwareService=require(_0x863c('0x13'));var logger=require(_0x863c('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x863c('0x15'));var licenseUtil=require(_0x863c('0x16'));var db=require(_0x863c('0x17'))['db'];function respondWithStatusCode(_0xf15180,_0x2d7871){_0x2d7871=_0x2d7871||0xcc;return function(_0x3b04d4){if(_0x3b04d4){return _0xf15180[_0x863c('0x18')](_0x2d7871);}return _0xf15180['status'](_0x2d7871)[_0x863c('0x19')]();};}function respondWithResult(_0x564d30,_0x5f4eb5){_0x5f4eb5=_0x5f4eb5||0xc8;return function(_0x3554c3){if(_0x3554c3){return _0x564d30[_0x863c('0x1a')](_0x5f4eb5)[_0x863c('0x1b')](_0x3554c3);}};}function respondWithFilteredResult(_0x39e5dc,_0x43c277){return function(_0x2c88e3){if(_0x2c88e3){var _0x5dd439=typeof _0x43c277['offset']===_0x863c('0x1c')&&typeof _0x43c277[_0x863c('0x1d')]==='undefined';var _0x2285c2=_0x2c88e3[_0x863c('0x1e')];var _0x4364fa=_0x5dd439?0x0:_0x43c277[_0x863c('0x1f')];var _0x521164=_0x5dd439?_0x2c88e3[_0x863c('0x1e')]:_0x43c277[_0x863c('0x1f')]+_0x43c277[_0x863c('0x1d')];var _0x271bfd;if(_0x521164>=_0x2285c2){_0x521164=_0x2285c2;_0x271bfd=0xc8;}else{_0x271bfd=0xce;}_0x39e5dc['status'](_0x271bfd);return _0x39e5dc[_0x863c('0x20')](_0x863c('0x21'),_0x4364fa+'-'+_0x521164+'/'+_0x2285c2)[_0x863c('0x1b')](_0x2c88e3);}return null;};}function patchUpdates(_0x33cd5a){return function(_0x29dcc5){try{jsonpatch['apply'](_0x29dcc5,_0x33cd5a,!![]);}catch(_0x2f1812){return BPromise[_0x863c('0x22')](_0x2f1812);}return _0x29dcc5[_0x863c('0x23')]();};}function saveUpdates(_0xbdbba,_0x24c6b5){return function(_0x48fc4e){if(_0x48fc4e){return _0x48fc4e[_0x863c('0x24')](_0xbdbba)['then'](function(_0x59fe63){return _0x59fe63;});}return null;};}function removeEntity(_0x2975a7,_0x1a038c){return function(_0x26852a){if(_0x26852a){return _0x26852a['destroy']()[_0x863c('0x25')](function(){var _0x3a13c1=_0x26852a[_0x863c('0x26')]({'plain':!![]});var _0x802a5e='MusicOnHolds';return db['UserProfileResource'][_0x863c('0x27')]({'where':{'type':_0x802a5e,'resourceId':_0x3a13c1['id']}})[_0x863c('0x25')](function(){return _0x26852a;});})[_0x863c('0x25')](function(){_0x2975a7['status'](0xcc)[_0x863c('0x19')]();});}};}function handleEntityNotFound(_0x57db64,_0x427d46){return function(_0x6c6838){if(!_0x6c6838){_0x57db64['sendStatus'](0x194);}return _0x6c6838;};}function handleError(_0x3f2f72,_0x330eaa){_0x330eaa=_0x330eaa||0x1f4;return function(_0xd9b2a1){logger[_0x863c('0x28')](_0xd9b2a1[_0x863c('0x29')]);if(_0xd9b2a1[_0x863c('0x2a')]){delete _0xd9b2a1[_0x863c('0x2a')];}_0x3f2f72[_0x863c('0x1a')](_0x330eaa)[_0x863c('0x2b')](_0xd9b2a1);};}exports[_0x863c('0x2c')]=function(_0x23d6c5,_0x24c4e5){var _0x350fef={},_0x182f34={},_0x5e9a7c={'count':0x0,'rows':[]};var _0xdb4c8a=_[_0x863c('0x2d')](db['VoiceMusicOnHold'][_0x863c('0x2e')],function(_0x16f76a){return{'name':_0x16f76a[_0x863c('0x2f')],'type':_0x16f76a['type']['key']};});_0x182f34[_0x863c('0x30')]=_['map'](_0xdb4c8a,_0x863c('0x2a'));_0x182f34['query']=_[_0x863c('0x31')](_0x23d6c5[_0x863c('0x32')]);_0x182f34[_0x863c('0x33')]=_[_0x863c('0x34')](_0x182f34['model'],_0x182f34['query']);_0x350fef['attributes']=_[_0x863c('0x34')](_0x182f34[_0x863c('0x30')],qs[_0x863c('0x35')](_0x23d6c5[_0x863c('0x32')][_0x863c('0x35')]));_0x350fef[_0x863c('0x36')]=_0x350fef[_0x863c('0x36')][_0x863c('0x37')]?_0x350fef['attributes']:_0x182f34[_0x863c('0x30')];if(!_0x23d6c5[_0x863c('0x32')][_0x863c('0x38')](_0x863c('0x39'))){_0x350fef[_0x863c('0x1d')]=qs['limit'](_0x23d6c5[_0x863c('0x32')][_0x863c('0x1d')]);_0x350fef['offset']=qs[_0x863c('0x1f')](_0x23d6c5[_0x863c('0x32')]['offset']);}_0x350fef[_0x863c('0x3a')]=qs[_0x863c('0x3b')](_0x23d6c5[_0x863c('0x32')][_0x863c('0x3b')]);delete _0x23d6c5[_0x863c('0x32')][_0x863c('0x3b')];_0x350fef[_0x863c('0x3c')]=qs[_0x863c('0x33')](_[_0x863c('0x3d')](_0x23d6c5[_0x863c('0x32')],_0x182f34[_0x863c('0x33')]),_0xdb4c8a);if(_0x23d6c5[_0x863c('0x32')][_0x863c('0x3e')]){_0x350fef['where']=_['merge'](_0x350fef[_0x863c('0x3c')],{'$or':_[_0x863c('0x2d')](_0xdb4c8a,function(_0x1350cf){if(_0x1350cf[_0x863c('0x3f')]!==_0x863c('0x40')){var _0x3e63e0={};_0x3e63e0[_0x1350cf[_0x863c('0x2a')]]={'$like':'%'+_0x23d6c5[_0x863c('0x32')][_0x863c('0x3e')]+'%'};return _0x3e63e0;}})});}_0x350fef=_['merge']({},_0x350fef,_0x23d6c5['options']);var _0xab3424={'where':_0x350fef[_0x863c('0x3c')]};return db['VoiceMusicOnHold']['count'](_0xab3424)[_0x863c('0x25')](function(_0x137c1f){_0x5e9a7c[_0x863c('0x1e')]=_0x137c1f;if(_0x23d6c5['query'][_0x863c('0x41')]){_0x350fef[_0x863c('0x42')]=[{'all':!![]}];}return db[_0x863c('0x43')][_0x863c('0x44')](_0x350fef);})['then'](function(_0x592320){_0x5e9a7c[_0x863c('0x45')]=_0x592320;return _0x5e9a7c;})['then'](respondWithFilteredResult(_0x24c4e5,_0x350fef))[_0x863c('0x46')](handleError(_0x24c4e5,null));};exports[_0x863c('0x47')]=function(_0x129a8a,_0x330d72){var _0x1993d7={'raw':![],'where':{'id':_0x129a8a['params']['id']}},_0x6e1504={};_0x6e1504['model']=_[_0x863c('0x31')](db[_0x863c('0x43')][_0x863c('0x2e')]);_0x6e1504[_0x863c('0x32')]=_[_0x863c('0x31')](_0x129a8a[_0x863c('0x32')]);_0x6e1504[_0x863c('0x33')]=_[_0x863c('0x34')](_0x6e1504['model'],_0x6e1504['query']);_0x1993d7[_0x863c('0x36')]=_[_0x863c('0x34')](_0x6e1504[_0x863c('0x30')],qs['fields'](_0x129a8a[_0x863c('0x32')][_0x863c('0x35')]));_0x1993d7[_0x863c('0x36')]=_0x1993d7[_0x863c('0x36')]['length']?_0x1993d7[_0x863c('0x36')]:_0x6e1504['model'];if(_0x129a8a[_0x863c('0x32')]['includeAll']){_0x1993d7[_0x863c('0x42')]=[{'all':!![]}];}_0x1993d7=_[_0x863c('0x48')]({},_0x1993d7,_0x129a8a['options']);return db[_0x863c('0x43')]['find'](_0x1993d7)[_0x863c('0x25')](handleEntityNotFound(_0x330d72,null))['then'](respondWithResult(_0x330d72,null))[_0x863c('0x46')](handleError(_0x330d72,null));};exports['update']=function(_0x597e45,_0x4fddf){if(_0x597e45['body']['id']){delete _0x597e45[_0x863c('0x49')]['id'];}return db[_0x863c('0x43')][_0x863c('0x4a')]({'where':{'id':_0x597e45[_0x863c('0x4b')]['id']}})['then'](handleEntityNotFound(_0x4fddf,null))[_0x863c('0x25')](saveUpdates(_0x597e45[_0x863c('0x49')],null))[_0x863c('0x25')](respondWithResult(_0x4fddf,null))['catch'](handleError(_0x4fddf,null));};exports[_0x863c('0x4c')]=function(_0x5be871,_0x3292c4,_0x133e37){return db[_0x863c('0x4d')][_0x863c('0x4e')](function(_0x408de5){if(_0x5be871['body'][_0x863c('0x4f')]===_0x863c('0x50')){_0x5be871[_0x863c('0x49')]['directory']=path['join'](config[_0x863c('0x51')],_0x863c('0x52'),_0x5be871['body'][_0x863c('0x2a')]);}return db[_0x863c('0x43')]['create'](_0x5be871[_0x863c('0x49')],{'transaction':_0x408de5})['then'](function(_0x445c61){if(_0x5be871['body']['mode']===_0x863c('0x50')){fs['mkdirSync'](_0x445c61[_0x863c('0x53')],parseInt('0777',0x8));}var _0x4bcd2a=_0x5be871['user'][_0x863c('0x26')]({'plain':!![]});if(!_0x4bcd2a)throw new Error(_0x863c('0x54'));if(_0x4bcd2a[_0x863c('0x55')]===_0x863c('0x56')){var _0x3cc857=_0x445c61[_0x863c('0x26')]({'plain':!![]});return db[_0x863c('0x57')][_0x863c('0x4a')]({'where':{'name':_0x863c('0x58'),'userProfileId':_0x4bcd2a[_0x863c('0x59')]},'raw':!![]})[_0x863c('0x25')](function(_0x596221){if(_0x596221&&_0x596221[_0x863c('0x5a')]===0x0){return db[_0x863c('0x5b')][_0x863c('0x4c')]({'name':_0x3cc857[_0x863c('0x2a')],'resourceId':_0x3cc857['id'],'type':_0x596221[_0x863c('0x2a')],'sectionId':_0x596221['id']},{})[_0x863c('0x25')](function(){return _0x445c61;});}else{return _0x445c61;}})['catch'](function(_0x251826){logger[_0x863c('0x28')](_0x863c('0x5c'),_0x251826);});}return _0x445c61;});})[_0x863c('0x25')](respondWithResult(_0x3292c4,0xc9))['catch'](handleError(_0x3292c4,null));};exports[_0x863c('0x27')]=function(_0x5b42d3,_0x3cfffb,_0x34a581){var _0x35a733;return db['VoiceMusicOnHold'][_0x863c('0x4a')]({'where':{'id':_0x5b42d3['params']['id']}})[_0x863c('0x25')](function(_0x2f8ff2){if(_0x2f8ff2){return db['sequelize'][_0x863c('0x4e')](function(_0x35bf97){return _0x2f8ff2[_0x863c('0x27')]({'transaction':_0x35bf97,'raw':!![]})[_0x863c('0x25')](function(_0x28a909){if(_0x28a909['directory']){fs[_0x863c('0x5d')](_0x28a909[_0x863c('0x53')])['forEach'](function(_0x48b78c){fs[_0x863c('0x5e')](path[_0x863c('0x5f')](_0x28a909['directory'],_0x48b78c));});fs[_0x863c('0x60')](_0x28a909[_0x863c('0x53')]);}return _0x28a909;});})['catch'](function(_0x59bbe2){throw new db['Sequelize'][(_0x863c('0x61'))](_0x59bbe2[_0x863c('0x62')]);});}})['then'](handleEntityNotFound(_0x3cfffb,null))[_0x863c('0x25')](removeEntity(_0x3cfffb,null))[_0x863c('0x46')](handleError(_0x3cfffb,null));};exports[_0x863c('0x63')]=function(_0x2b57cf,_0x7a605c,_0x24cc8d){return db['sequelize'][_0x863c('0x4e')](function(_0x1e6a5a){var _0x261b27;return db[_0x863c('0x43')][_0x863c('0x4a')]({'where':{'id':_0x2b57cf[_0x863c('0x4b')]['id']}})[_0x863c('0x25')](function(_0x4b4612){if(_0x4b4612){_0x261b27=_0x4b4612;return _0x4b4612['addSound'](_0x2b57cf[_0x863c('0x49')]['id'],{'transaction':_0x1e6a5a});}})['then'](function(_0x4d79e8){if(_0x4d79e8){return db['Sound']['findOne']({'where':{'id':_0x2b57cf[_0x863c('0x49')]['id']},'attributes':['id',_0x863c('0x2a'),_0x863c('0x64'),'converted_format',_0x863c('0x65')],'raw':!![]});}})['then'](function(_0xdf0cdf){if(_0xdf0cdf){var _0xb3e3d4=path['join'](config[_0x863c('0x51')],'server/files/sounds/converted',util[_0x863c('0x66')]('%s.%s',path[_0x863c('0x67')](_0xdf0cdf[_0x863c('0x64')],path[_0x863c('0x68')](_0xdf0cdf[_0x863c('0x64')])),_0xdf0cdf['converted_format']));var _0x37c000=path[_0x863c('0x5f')](config[_0x863c('0x51')],_0x863c('0x52'),_0x261b27[_0x863c('0x2a')],util[_0x863c('0x66')](_0x863c('0x69'),_0xdf0cdf[_0x863c('0x2a')],_0xdf0cdf[_0x863c('0x6a')]));fs[_0x863c('0x6b')](_0xb3e3d4,_0x37c000);return _0xdf0cdf;}})[_0x863c('0x46')](function(_0x164726){throw new db[(_0x863c('0x6c'))][(_0x863c('0x61'))](_0x164726['message']);});})['then'](handleEntityNotFound(_0x7a605c,null))[_0x863c('0x25')](respondWithResult(_0x7a605c,0xc9))['catch'](handleError(_0x7a605c,null));};exports[_0x863c('0x6d')]=function(_0x5e3fb0,_0x3ba6f2,_0x223cc4){return db[_0x863c('0x4d')][_0x863c('0x4e')](function(_0x7391ba){var _0x27f3e4;return db['VoiceMusicOnHold'][_0x863c('0x6e')]({'where':{'id':_0x5e3fb0[_0x863c('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3ba6f2,null))[_0x863c('0x25')](function(_0x4b94de){if(_0x4b94de){_0x27f3e4=_0x4b94de;return _0x4b94de[_0x863c('0x6d')](_0x5e3fb0['params'][_0x863c('0x6f')]);}})[_0x863c('0x25')](function(_0x5ccdfd){if(_0x5ccdfd){return db[_0x863c('0x70')][_0x863c('0x6e')]({'where':{'id':_0x5e3fb0[_0x863c('0x4b')][_0x863c('0x6f')]},'attributes':['id',_0x863c('0x2a'),'save_name',_0x863c('0x6a'),_0x863c('0x65')],'raw':!![]});}})[_0x863c('0x25')](function(_0x2a9b15){if(_0x2a9b15){fs[_0x863c('0x5e')](path[_0x863c('0x5f')](_0x27f3e4[_0x863c('0x53')],util[_0x863c('0x66')](_0x863c('0x69'),_0x2a9b15['name'],_0x2a9b15[_0x863c('0x6a')])));return _0x2a9b15;}})[_0x863c('0x46')](function(_0x56ed47){throw new db[(_0x863c('0x6c'))][(_0x863c('0x61'))](_0x56ed47[_0x863c('0x62')]);});})[_0x863c('0x25')](handleEntityNotFound(_0x3ba6f2,null))[_0x863c('0x25')](respondWithStatusCode(_0x3ba6f2,0xcc))[_0x863c('0x46')](handleError(_0x3ba6f2,null));};exports[_0x863c('0x71')]=function(_0x31acab,_0x1ebc9d,_0x2c2f53){var _0x4219c5={};var _0x272632={};var _0x52f661;var _0x5c3f91;return db['VoiceMusicOnHold'][_0x863c('0x6e')]({'where':{'id':_0x31acab[_0x863c('0x4b')]['id']}})[_0x863c('0x25')](handleEntityNotFound(_0x1ebc9d,null))[_0x863c('0x25')](function(_0x308001){if(_0x308001){_0x52f661=_0x308001;_0x272632[_0x863c('0x30')]=_[_0x863c('0x31')](db['Sound'][_0x863c('0x2e')]);_0x272632[_0x863c('0x32')]=_[_0x863c('0x31')](_0x31acab[_0x863c('0x32')]);_0x272632[_0x863c('0x33')]=_[_0x863c('0x34')](_0x272632[_0x863c('0x30')],_0x272632[_0x863c('0x32')]);_0x4219c5[_0x863c('0x36')]=_[_0x863c('0x34')](_0x272632['model'],qs[_0x863c('0x35')](_0x31acab[_0x863c('0x32')][_0x863c('0x35')]));_0x4219c5[_0x863c('0x36')]=_0x4219c5[_0x863c('0x36')][_0x863c('0x37')]?_0x4219c5['attributes']:_0x272632[_0x863c('0x30')];_0x4219c5['order']=qs['sort'](_0x31acab[_0x863c('0x32')][_0x863c('0x3b')]);_0x4219c5[_0x863c('0x3c')]=qs['filters'](_[_0x863c('0x3d')](_0x31acab[_0x863c('0x32')],_0x272632[_0x863c('0x33')]));if(_0x31acab[_0x863c('0x32')][_0x863c('0x3e')]){_0x4219c5[_0x863c('0x3c')]=_[_0x863c('0x48')](_0x4219c5[_0x863c('0x3c')],{'$or':_[_0x863c('0x2d')](_0x4219c5[_0x863c('0x36')],function(_0x4b524a){var _0xc50fa={};_0xc50fa[_0x4b524a]={'$like':'%'+_0x31acab[_0x863c('0x32')]['filter']+'%'};return _0xc50fa;})});}_0x4219c5=_[_0x863c('0x48')]({},_0x4219c5,_0x31acab[_0x863c('0x72')]);return _0x52f661['getSounds'](_0x4219c5);}})['then'](function(_0x38c167){if(_0x38c167){_0x5c3f91=_0x38c167[_0x863c('0x37')];if(!_0x31acab['query'][_0x863c('0x38')](_0x863c('0x39'))){_0x4219c5[_0x863c('0x1d')]=qs['limit'](_0x31acab[_0x863c('0x32')][_0x863c('0x1d')]);_0x4219c5['offset']=qs[_0x863c('0x1f')](_0x31acab[_0x863c('0x32')][_0x863c('0x1f')]);}return _0x52f661[_0x863c('0x71')](_0x4219c5);}})[_0x863c('0x25')](function(_0x2b5bcb){if(_0x2b5bcb){return _0x2b5bcb?{'count':_0x5c3f91,'rows':_0x2b5bcb}:null;}})[_0x863c('0x25')](respondWithResult(_0x1ebc9d,null))[_0x863c('0x46')](handleError(_0x1ebc9d,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index 910d087..6de3423 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 _0xa562=['voice_musiconhold','lodash','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','define','VoiceMusicOnHold'];(function(_0x1ec156,_0x4abcf8){var _0xf55840=function(_0x28200a){while(--_0x28200a){_0x1ec156['push'](_0x1ec156['shift']());}};_0xf55840(++_0x4abcf8);}(_0xa562,0x1eb));var _0x2a56=function(_0x29e3ec,_0x138a18){_0x29e3ec=_0x29e3ec-0x0;var _0x25727e=_0xa562[_0x29e3ec];return _0x25727e;};'use strict';var _=require(_0x2a56('0x0'));var util=require('util');var logger=require(_0x2a56('0x1'))(_0x2a56('0x2'));var moment=require('moment');var BPromise=require(_0x2a56('0x3'));var rp=require(_0x2a56('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2a56('0x5'));var config=require(_0x2a56('0x6'));var attributes=require('./voiceMusicOnHold.attributes');module['exports']=function(_0x15ad33,_0x14cbc2){return _0x15ad33[_0x2a56('0x7')](_0x2a56('0x8'),attributes,{'tableName':_0x2a56('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe380=['define','../../config/logger','api','moment','request-promise','path','../../config/environment','exports'];(function(_0x51e2e4,_0x4ae454){var _0x267a11=function(_0x333250){while(--_0x333250){_0x51e2e4['push'](_0x51e2e4['shift']());}};_0x267a11(++_0x4ae454);}(_0xe380,0x119));var _0x0e38=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe380[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x0e38('0x0'))(_0x0e38('0x1'));var moment=require(_0x0e38('0x2'));var BPromise=require('bluebird');var rp=require(_0x0e38('0x3'));var fs=require('fs');var path=require(_0x0e38('0x4'));var rimraf=require('rimraf');var config=require(_0x0e38('0x5'));var attributes=require('./voiceMusicOnHold.attributes');module[_0x0e38('0x6')]=function(_0x2f2674,_0x40ce7f){return _0x2f2674[_0x0e38('0x7')]('VoiceMusicOnHold',attributes,{'tableName':'voice_musiconhold','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.rpc.js index 6bb393f..4730b66 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 _0xcb91=['stringify','error','code','message','catch','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s'];(function(_0x348118,_0xabe94e){var _0x292b18=function(_0x41e246){while(--_0x41e246){_0x348118['push'](_0x348118['shift']());}};_0x292b18(++_0xabe94e);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x163040,_0x38a58c){_0x163040=_0x163040-0x0;var _0x364667=_0xcb91[_0x163040];return _0x364667;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1cb9('0x0'));var BPromise=require(_0x1cb9('0x1'));var rs=require(_0x1cb9('0x2'));var fs=require('fs');var Redis=require(_0x1cb9('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1cb9('0x4'));var logger=require(_0x1cb9('0x5'))('rpc');var config=require(_0x1cb9('0x6'));var jayson=require(_0x1cb9('0x7'));var client=jayson['client'][_0x1cb9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3f7deb,_0x4ffe20,_0x38737d){return new BPromise(function(_0x12567c,_0x59d1be){return client[_0x1cb9('0x9')](_0x3f7deb,_0x38737d)['then'](function(_0x567139){logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,_0x1cb9('0xc'));logger[_0x1cb9('0xd')](_0x1cb9('0xe'),_0x4ffe20,'request\x20sent',JSON[_0x1cb9('0xf')](_0x567139));if(_0x567139[_0x1cb9('0x10')]){if(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x11')]===0x1f4){logger[_0x1cb9('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x4ffe20,_0x567139['error']['message']);return _0x59d1be(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x567139['error'][_0x1cb9('0x12')]);return _0x12567c(_0x567139[_0x1cb9('0x10')][_0x1cb9('0x12')]);}else{logger[_0x1cb9('0xa')](_0x1cb9('0xb'),_0x4ffe20,'request\x20sent');_0x12567c(_0x567139['result'][_0x1cb9('0x12')]);}})[_0x1cb9('0x13')](function(_0x3904b7){logger[_0x1cb9('0x10')](_0x1cb9('0xb'),_0x4ffe20,_0x3904b7);_0x59d1be(_0x3904b7);});});} \ No newline at end of file +var _0x0713=['VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x11558b,_0xbf94bb){var _0x351819=function(_0x503dba){while(--_0x503dba){_0x11558b['push'](_0x11558b['shift']());}};_0x351819(++_0xbf94bb);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3071('0x0'));var BPromise=require(_0x3071('0x1'));var rs=require(_0x3071('0x2'));var fs=require('fs');var Redis=require(_0x3071('0x3'));var db=require(_0x3071('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3071('0x5'))(_0x3071('0x6'));var config=require(_0x3071('0x7'));var jayson=require(_0x3071('0x8'));var client=jayson[_0x3071('0x9')][_0x3071('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d3dd6,_0x2f1e87,_0xbd737f){return new BPromise(function(_0x22274c,_0x3e9a5e){return client[_0x3071('0xb')](_0x1d3dd6,_0xbd737f)[_0x3071('0xc')](function(_0x4a36ec){logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));logger[_0x3071('0x10')](_0x3071('0x11'),_0x2f1e87,'request\x20sent',JSON[_0x3071('0x12')](_0x4a36ec));if(_0x4a36ec[_0x3071('0x13')]){if(_0x4a36ec[_0x3071('0x13')][_0x3071('0x14')]===0x1f4){logger[_0x3071('0x13')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec['error'][_0x3071('0x15')]);return _0x3e9a5e(_0x4a36ec['error'][_0x3071('0x15')]);}logger[_0x3071('0x13')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec[_0x3071('0x13')]['message']);return _0x22274c(_0x4a36ec[_0x3071('0x13')][_0x3071('0x15')]);}else{logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));_0x22274c(_0x4a36ec[_0x3071('0x16')][_0x3071('0x15')]);}})[_0x3071('0x17')](function(_0x21aad3){logger[_0x3071('0x13')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x2f1e87,_0x21aad3);_0x3e9a5e(_0x21aad3);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index 33c9004..00db0da 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 _0x67d1=['describe','/:id','show','/:id/users','/:id/teams','getTeams','create','post','addAgents','addTeams','put','destroy','delete','removeAgents','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','get','isAuthenticated','index','/describe'];(function(_0x16bded,_0x64a93c){var _0x32b231=function(_0x43cbd7){while(--_0x43cbd7){_0x16bded['push'](_0x16bded['shift']());}};_0x32b231(++_0x64a93c);}(_0x67d1,0xdf));var _0x167d=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0x67d1[_0x2be8c2];return _0x97f531;};'use strict';var multer=require(_0x167d('0x0'));var util=require(_0x167d('0x1'));var path=require(_0x167d('0x2'));var timeout=require(_0x167d('0x3'));var express=require('express');var router=express[_0x167d('0x4')]();var fs_extra=require(_0x167d('0x5'));var auth=require(_0x167d('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./voicePrefix.controller');router[_0x167d('0x7')]('/',auth[_0x167d('0x8')](),controller[_0x167d('0x9')]);router[_0x167d('0x7')](_0x167d('0xa'),auth[_0x167d('0x8')](),controller[_0x167d('0xb')]);router['get'](_0x167d('0xc'),auth[_0x167d('0x8')](),controller[_0x167d('0xd')]);router[_0x167d('0x7')](_0x167d('0xe'),auth[_0x167d('0x8')](),controller['getAgents']);router[_0x167d('0x7')](_0x167d('0xf'),auth[_0x167d('0x8')](),controller[_0x167d('0x10')]);router['post']('/',auth[_0x167d('0x8')](),controller[_0x167d('0x11')]);router[_0x167d('0x12')](_0x167d('0xe'),auth[_0x167d('0x8')](),controller[_0x167d('0x13')]);router[_0x167d('0x12')](_0x167d('0xf'),auth[_0x167d('0x8')](),controller[_0x167d('0x14')]);router[_0x167d('0x15')](_0x167d('0xc'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x167d('0xc'),auth[_0x167d('0x8')](),controller[_0x167d('0x16')]);router[_0x167d('0x17')](_0x167d('0xe'),auth[_0x167d('0x8')](),controller[_0x167d('0x18')]);router['delete'](_0x167d('0xf'),auth[_0x167d('0x8')](),controller['removeTeams']);module[_0x167d('0x19')]=router; \ No newline at end of file +var _0xe9e8=['delete','removeTeams','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./voicePrefix.controller','get','isAuthenticated','/describe','describe','/:id','/:id/users','getAgents','/:id/teams','getTeams','post','create','addAgents','addTeams','put'];(function(_0x3c0cc6,_0x225fa0){var _0x21f774=function(_0x34255a){while(--_0x34255a){_0x3c0cc6['push'](_0x3c0cc6['shift']());}};_0x21f774(++_0x225fa0);}(_0xe9e8,0x179));var _0x8e9e=function(_0x53454f,_0x4dc272){_0x53454f=_0x53454f-0x0;var _0x2134a2=_0xe9e8[_0x53454f];return _0x2134a2;};'use strict';var multer=require(_0x8e9e('0x0'));var util=require(_0x8e9e('0x1'));var path=require(_0x8e9e('0x2'));var timeout=require(_0x8e9e('0x3'));var express=require(_0x8e9e('0x4'));var router=express[_0x8e9e('0x5')]();var fs_extra=require(_0x8e9e('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x8e9e('0x7'));var config=require('../../config/environment');var controller=require(_0x8e9e('0x8'));router[_0x8e9e('0x9')]('/',auth[_0x8e9e('0xa')](),controller['index']);router['get'](_0x8e9e('0xb'),auth[_0x8e9e('0xa')](),controller[_0x8e9e('0xc')]);router[_0x8e9e('0x9')](_0x8e9e('0xd'),auth[_0x8e9e('0xa')](),controller['show']);router['get'](_0x8e9e('0xe'),auth[_0x8e9e('0xa')](),controller[_0x8e9e('0xf')]);router[_0x8e9e('0x9')](_0x8e9e('0x10'),auth[_0x8e9e('0xa')](),controller[_0x8e9e('0x11')]);router[_0x8e9e('0x12')]('/',auth[_0x8e9e('0xa')](),controller[_0x8e9e('0x13')]);router[_0x8e9e('0x12')](_0x8e9e('0xe'),auth[_0x8e9e('0xa')](),controller[_0x8e9e('0x14')]);router['post'](_0x8e9e('0x10'),auth[_0x8e9e('0xa')](),controller[_0x8e9e('0x15')]);router[_0x8e9e('0x16')]('/:id',auth[_0x8e9e('0xa')](),controller['update']);router[_0x8e9e('0x17')](_0x8e9e('0xd'),auth[_0x8e9e('0xa')](),controller['destroy']);router['delete'](_0x8e9e('0xe'),auth[_0x8e9e('0xa')](),controller['removeAgents']);router[_0x8e9e('0x17')](_0x8e9e('0x10'),auth[_0x8e9e('0xa')](),controller[_0x8e9e('0x18')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index 3a280cd..d62eb02 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 _0x3abc=['sequelize','exports','STRING','name','VIRTUAL','system-','INTEGER'];(function(_0x42ab35,_0x52f604){var _0xbc470c=function(_0x1a4c3b){while(--_0x1a4c3b){_0x42ab35['push'](_0x42ab35['shift']());}};_0xbc470c(++_0x52f604);}(_0x3abc,0x1f1));var _0xc3ab=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0x3abc[_0x92c450];return _0x2a9599;};'use strict';var Sequelize=require(_0xc3ab('0x0'));module[_0xc3ab('0x1')]={'name':{'type':Sequelize[_0xc3ab('0x2')],'allowNull':![],'unique':_0xc3ab('0x3')},'prefix':{'type':Sequelize[_0xc3ab('0x4')],'get':function(_0xf7fbe4){return _0xc3ab('0x5')+this['getDataValue'](_0xc3ab('0x3'))+'-';}},'description':{'type':Sequelize[_0xc3ab('0x2')]},'callerIdAll':{'type':Sequelize[_0xc3ab('0x2')]},'VoiceExtensionId':{'type':Sequelize[_0xc3ab('0x6')]}}; \ No newline at end of file +var _0x81b9=['VIRTUAL','system-','getDataValue','name','STRING','INTEGER','sequelize','exports'];(function(_0x5c78d9,_0x2736c7){var _0x69ae1f=function(_0x4b31ac){while(--_0x4b31ac){_0x5c78d9['push'](_0x5c78d9['shift']());}};_0x69ae1f(++_0x2736c7);}(_0x81b9,0xde));var _0x981b=function(_0x4fe3d0,_0xbc954c){_0x4fe3d0=_0x4fe3d0-0x0;var _0x3e28de=_0x81b9[_0x4fe3d0];return _0x3e28de;};'use strict';var Sequelize=require(_0x981b('0x0'));module[_0x981b('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'prefix':{'type':Sequelize[_0x981b('0x2')],'get':function(_0x3d8ff7){return _0x981b('0x3')+this[_0x981b('0x4')](_0x981b('0x5'))+'-';}},'description':{'type':Sequelize[_0x981b('0x6')]},'callerIdAll':{'type':Sequelize[_0x981b('0x6')]},'VoiceExtensionId':{'type':Sequelize[_0x981b('0x7')]}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index aa304ef..6503176 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 _0x4b17=['status','end','json','offset','limit','undefined','count','set','apply','reject','save','update','then','destroy','get','VoicePrefixes','error','stack','name','send','map','VoicePrefix','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','include','findAll','catch','params','rawAttributes','includeAll','options','find','describe','create','sequelize','transaction','VoiceExtension','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','context','from-sip','exten','app','type','system','description','Voice\x20Prefix\x20Extension','priority','appdata','prefix','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','push','CDR(prefix)=','callerIdAll','Set','NoOp','No\x20callerid\x20available','goto','${EXTEN:','charAt','body','system-','findById','addAgents','ids','omit','spread','emit','userVoicePrefix:save','removeAgents','userVoicePrefix:remove','getAgents','findOne','User','Team','getTeams','addTeams','Agents','voicePause','flatMap','each','upsert','findOrCreate','forEach','removeTeams','field','tq.TeamId','team_has_voice_prefixes','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','clone','toString','QueryTypes','SELECT','every','TeamId','isEmpty','eml-format','zip-dir','request-promise','moment','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','register','sendStatus'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0x4b17,0x10f));var _0x74b1=function(_0x364b32,_0x4dec35){_0x364b32=_0x364b32-0x0;var _0x3f3ea0=_0x4b17[_0x364b32];return _0x3f3ea0;};'use strict';var emlformat=require(_0x74b1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x74b1('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x74b1('0x2'));var moment=require(_0x74b1('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x74b1('0x4'));var util=require('util');var path=require('path');var sox=require(_0x74b1('0x5'));var csv=require(_0x74b1('0x6'));var ejs=require(_0x74b1('0x7'));var fs=require('fs');var fs_extra=require(_0x74b1('0x8'));var _=require(_0x74b1('0x9'));var squel=require(_0x74b1('0xa'));var crypto=require(_0x74b1('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x74b1('0xc'));var toCsv=require(_0x74b1('0x6'));var querystring=require(_0x74b1('0xd'));var Papa=require(_0x74b1('0xe'));var Redis=require(_0x74b1('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x74b1('0x10'));var as=require(_0x74b1('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x74b1('0x12'))(_0x74b1('0x13'));var utils=require(_0x74b1('0x14'));var config=require(_0x74b1('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x74b1('0x16'))['db'];config['redis']=_['defaults'](config[_0x74b1('0x17')],{'host':_0x74b1('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./voicePrefix.socket')[_0x74b1('0x19')](socket);function respondWithStatusCode(_0x5c12eb,_0x4e289b){_0x4e289b=_0x4e289b||0xcc;return function(_0x2ccba6){if(_0x2ccba6){return _0x5c12eb[_0x74b1('0x1a')](_0x4e289b);}return _0x5c12eb[_0x74b1('0x1b')](_0x4e289b)[_0x74b1('0x1c')]();};}function respondWithResult(_0x16b147,_0x10138e){_0x10138e=_0x10138e||0xc8;return function(_0x528e8c){if(_0x528e8c){return _0x16b147[_0x74b1('0x1b')](_0x10138e)[_0x74b1('0x1d')](_0x528e8c);}};}function respondWithFilteredResult(_0x1a0851,_0x2cfcc3){return function(_0xde2736){if(_0xde2736){var _0x8c9510=typeof _0x2cfcc3[_0x74b1('0x1e')]==='undefined'&&typeof _0x2cfcc3[_0x74b1('0x1f')]===_0x74b1('0x20');var _0x524ece=_0xde2736[_0x74b1('0x21')];var _0x38d932=_0x8c9510?0x0:_0x2cfcc3[_0x74b1('0x1e')];var _0x25704e=_0x8c9510?_0xde2736[_0x74b1('0x21')]:_0x2cfcc3[_0x74b1('0x1e')]+_0x2cfcc3[_0x74b1('0x1f')];var _0xaac5f7;if(_0x25704e>=_0x524ece){_0x25704e=_0x524ece;_0xaac5f7=0xc8;}else{_0xaac5f7=0xce;}_0x1a0851['status'](_0xaac5f7);return _0x1a0851[_0x74b1('0x22')]('Content-Range',_0x38d932+'-'+_0x25704e+'/'+_0x524ece)['json'](_0xde2736);}return null;};}function patchUpdates(_0x481bf2){return function(_0x27fd1a){try{jsonpatch[_0x74b1('0x23')](_0x27fd1a,_0x481bf2,!![]);}catch(_0x405a22){return BPromise[_0x74b1('0x24')](_0x405a22);}return _0x27fd1a[_0x74b1('0x25')]();};}function saveUpdates(_0x4ee88b,_0x3c78e5){return function(_0x4eca36){if(_0x4eca36){return _0x4eca36[_0x74b1('0x26')](_0x4ee88b)[_0x74b1('0x27')](function(_0xb5af0){return _0xb5af0;});}return null;};}function removeEntity(_0x14a651,_0x3239d8){return function(_0x322de5){if(_0x322de5){return _0x322de5[_0x74b1('0x28')]()[_0x74b1('0x27')](function(){var _0x4c7f05=_0x322de5[_0x74b1('0x29')]({'plain':!![]});var _0x42b69d=_0x74b1('0x2a');return db['UserProfileResource'][_0x74b1('0x28')]({'where':{'type':_0x42b69d,'resourceId':_0x4c7f05['id']}})[_0x74b1('0x27')](function(){return _0x322de5;});})[_0x74b1('0x27')](function(){_0x14a651[_0x74b1('0x1b')](0xcc)[_0x74b1('0x1c')]();});}};}function handleEntityNotFound(_0x273ff1,_0x436eda){return function(_0x3ce043){if(!_0x3ce043){_0x273ff1['sendStatus'](0x194);}return _0x3ce043;};}function handleError(_0xe74c82,_0x40b32a){_0x40b32a=_0x40b32a||0x1f4;return function(_0x51ce6d){logger[_0x74b1('0x2b')](_0x51ce6d[_0x74b1('0x2c')]);if(_0x51ce6d[_0x74b1('0x2d')]){delete _0x51ce6d['name'];}_0xe74c82[_0x74b1('0x1b')](_0x40b32a)[_0x74b1('0x2e')](_0x51ce6d);};}exports['index']=function(_0x3dbf18,_0x33ec7c){var _0x2211b2={},_0x31c321={},_0x68a3bd={'count':0x0,'rows':[]};var _0x32a8d6=_[_0x74b1('0x2f')](db[_0x74b1('0x30')]['rawAttributes'],function(_0x3d5fc0){return{'name':_0x3d5fc0['fieldName'],'type':_0x3d5fc0['type'][_0x74b1('0x31')]};});_0x31c321['model']=_['map'](_0x32a8d6,_0x74b1('0x2d'));_0x31c321[_0x74b1('0x32')]=_[_0x74b1('0x33')](_0x3dbf18[_0x74b1('0x32')]);_0x31c321[_0x74b1('0x34')]=_[_0x74b1('0x35')](_0x31c321[_0x74b1('0x36')],_0x31c321[_0x74b1('0x32')]);_0x2211b2['attributes']=_['intersection'](_0x31c321['model'],qs[_0x74b1('0x37')](_0x3dbf18['query']['fields']));_0x2211b2[_0x74b1('0x38')]=_0x2211b2[_0x74b1('0x38')][_0x74b1('0x39')]?_0x2211b2['attributes']:_0x31c321[_0x74b1('0x36')];if(!_0x3dbf18['query'][_0x74b1('0x3a')](_0x74b1('0x3b'))){_0x2211b2['limit']=qs['limit'](_0x3dbf18[_0x74b1('0x32')][_0x74b1('0x1f')]);_0x2211b2['offset']=qs['offset'](_0x3dbf18[_0x74b1('0x32')]['offset']);}_0x2211b2[_0x74b1('0x3c')]=qs[_0x74b1('0x3d')](_0x3dbf18[_0x74b1('0x32')][_0x74b1('0x3d')]);_0x2211b2[_0x74b1('0x3e')]=qs['filters'](_[_0x74b1('0x3f')](_0x3dbf18['query'],_0x31c321[_0x74b1('0x34')]),_0x32a8d6);if(_0x3dbf18['query'][_0x74b1('0x40')]){_0x2211b2['where']=_['merge'](_0x2211b2[_0x74b1('0x3e')],{'$or':_[_0x74b1('0x2f')](_0x32a8d6,function(_0x2725fd){if(_0x2725fd['type']!==_0x74b1('0x41')){var _0x327334={};_0x327334[_0x2725fd[_0x74b1('0x2d')]]={'$like':'%'+_0x3dbf18['query'][_0x74b1('0x40')]+'%'};return _0x327334;}})});}_0x2211b2=_[_0x74b1('0x42')]({},_0x2211b2,_0x3dbf18['options']);var _0x48ac05={'where':_0x2211b2[_0x74b1('0x3e')]};return db[_0x74b1('0x30')][_0x74b1('0x21')](_0x48ac05)[_0x74b1('0x27')](function(_0x1d9f5b){_0x68a3bd[_0x74b1('0x21')]=_0x1d9f5b;if(_0x3dbf18[_0x74b1('0x32')]['includeAll']){_0x2211b2[_0x74b1('0x43')]=[{'all':!![]}];}return db[_0x74b1('0x30')][_0x74b1('0x44')](_0x2211b2);})[_0x74b1('0x27')](function(_0x17a44f){_0x68a3bd['rows']=_0x17a44f;return _0x68a3bd;})[_0x74b1('0x27')](respondWithFilteredResult(_0x33ec7c,_0x2211b2))[_0x74b1('0x45')](handleError(_0x33ec7c,null));};exports['show']=function(_0x50d9de,_0x1b7a58){var _0x3c3c3c={'raw':![],'where':{'id':_0x50d9de[_0x74b1('0x46')]['id']}},_0x54c94b={};_0x54c94b[_0x74b1('0x36')]=_[_0x74b1('0x33')](db[_0x74b1('0x30')][_0x74b1('0x47')]);_0x54c94b[_0x74b1('0x32')]=_[_0x74b1('0x33')](_0x50d9de['query']);_0x54c94b['filters']=_['intersection'](_0x54c94b[_0x74b1('0x36')],_0x54c94b[_0x74b1('0x32')]);_0x3c3c3c[_0x74b1('0x38')]=_[_0x74b1('0x35')](_0x54c94b[_0x74b1('0x36')],qs['fields'](_0x50d9de[_0x74b1('0x32')][_0x74b1('0x37')]));_0x3c3c3c[_0x74b1('0x38')]=_0x3c3c3c[_0x74b1('0x38')][_0x74b1('0x39')]?_0x3c3c3c[_0x74b1('0x38')]:_0x54c94b[_0x74b1('0x36')];if(_0x50d9de[_0x74b1('0x32')][_0x74b1('0x48')]){_0x3c3c3c[_0x74b1('0x43')]=[{'all':!![]}];}_0x3c3c3c=_[_0x74b1('0x42')]({},_0x3c3c3c,_0x50d9de[_0x74b1('0x49')]);return db['VoicePrefix'][_0x74b1('0x4a')](_0x3c3c3c)[_0x74b1('0x27')](handleEntityNotFound(_0x1b7a58,null))['then'](respondWithResult(_0x1b7a58,null))[_0x74b1('0x45')](handleError(_0x1b7a58,null));};exports['destroy']=function(_0x4b1add,_0x2073eb){return db['VoicePrefix'][_0x74b1('0x4a')]({'where':{'id':_0x4b1add[_0x74b1('0x46')]['id']}})[_0x74b1('0x27')](handleEntityNotFound(_0x2073eb,null))['then'](removeEntity(_0x2073eb,null))[_0x74b1('0x45')](handleError(_0x2073eb,null));};exports[_0x74b1('0x4b')]=function(_0x1b2d51,_0x3d199b){return db[_0x74b1('0x30')]['describe']()[_0x74b1('0x27')](respondWithResult(_0x3d199b,null))['catch'](handleError(_0x3d199b,null));};exports[_0x74b1('0x4c')]=function(_0x4085b8,_0x5e458c){var _0x1be639;return db[_0x74b1('0x4d')][_0x74b1('0x4e')](function(_0x54a221){return db[_0x74b1('0x30')][_0x74b1('0x4c')](_0x4085b8['body'],{'transaction':_0x54a221})[_0x74b1('0x27')](function(_0x4fdd6b){_0x1be639=_0x4fdd6b['get']({'plain':!![]});return db[_0x74b1('0x4f')][_0x74b1('0x4a')]({'where':{'id':_0x1be639[_0x74b1('0x50')]},'raw':!![]})[_0x74b1('0x27')](function(_0x41b45f){return createVoicePrefixExtensions(_0x1be639,_0x41b45f,_0x54a221);});});})['then'](function(){var _0x145ce3=_0x4085b8[_0x74b1('0x51')]['get']({'plain':!![]});if(!_0x145ce3)throw new Error(_0x74b1('0x52'));if(_0x145ce3[_0x74b1('0x53')]===_0x74b1('0x51')){var _0x5634d1=_0x1be639;return db[_0x74b1('0x54')][_0x74b1('0x4a')]({'where':{'name':_0x74b1('0x2a'),'userProfileId':_0x145ce3['userProfileId']},'raw':!![]})[_0x74b1('0x27')](function(_0x3b4338){if(_0x3b4338&&_0x3b4338[_0x74b1('0x55')]===0x0){return db[_0x74b1('0x56')][_0x74b1('0x4c')]({'name':_0x5634d1[_0x74b1('0x2d')],'resourceId':_0x5634d1['id'],'type':_0x3b4338['name'],'sectionId':_0x3b4338['id']},{})[_0x74b1('0x27')](function(){return _0x1be639;});}else{return _0x1be639;}})['catch'](function(_0x5343c4){logger[_0x74b1('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5343c4);throw _0x5343c4;});}return _0x1be639;})['then'](respondWithResult(_0x5e458c,null))[_0x74b1('0x45')](handleError(_0x5e458c,null));};function Extension(_0x29ab63,_0x16db5c,_0x515a8e,_0x204b7d){this[_0x74b1('0x57')]=_0x74b1('0x58');this[_0x74b1('0x59')]=_0x29ab63;this[_0x74b1('0x5a')]=_0x515a8e;this[_0x74b1('0x5b')]=_0x74b1('0x5c');this[_0x74b1('0x5d')]=_0x74b1('0x5e');this[_0x74b1('0x5f')]=_0x16db5c;this[_0x74b1('0x60')]=_0x204b7d;}function createVoicePrefixExtensions(_0x112721,_0x516e44,_0x598daa){return new BPromise(function(_0x2a46ca,_0x553615){var _0x15eb38=new Extension(formatPrefixName(_0x112721[_0x74b1('0x61')]),0x1,'NoOp','Voice\x20Prefix');_0x15eb38[_0x74b1('0x62')]=_0x112721['id'];return db[_0x74b1('0x4f')][_0x74b1('0x4c')](_0x15eb38,{'transaction':_0x598daa})[_0x74b1('0x27')](function(_0x3dd0c3){var _0x1f879f=_0x3dd0c3[_0x74b1('0x29')]({'plain':!![]});var _0x1fb137=_[_0x74b1('0x2f')](addVoicePrefixExtensions(_0x112721,_0x516e44),function(_0x128a7e){_0x128a7e[_0x74b1('0x50')]=_0x1f879f['id'];_0x128a7e[_0x74b1('0x62')]=_0x112721['id'];return _0x128a7e;});return db['VoiceExtension'][_0x74b1('0x63')](_0x1fb137,{'transaction':_0x598daa})[_0x74b1('0x27')](function(_0x378f63){if(!_0x378f63){return _0x553615(_0x74b1('0x64'));}else{return _0x2a46ca(_0x378f63);}})['catch'](function(_0x308b98){return _0x553615(_0x308b98);});});;});};function addVoicePrefixExtensions(_0x1709d9,_0x5ada76){var _0x425f9f=[];var _0x4d2fcb=formatPrefixName(_0x1709d9[_0x74b1('0x61')]);_0x425f9f[_0x74b1('0x65')](new Extension(_0x4d2fcb,0x2,'Set',_0x74b1('0x66')+_0x1709d9[_0x74b1('0x2d')]));if(_0x1709d9[_0x74b1('0x67')]){_0x425f9f['push'](new Extension(_0x4d2fcb,0x3,_0x74b1('0x68'),'PREFIX-CALLERIDALL='+_0x1709d9[_0x74b1('0x67')]));}else{_0x425f9f[_0x74b1('0x65')](new Extension(_0x4d2fcb,0x3,_0x74b1('0x69'),_0x74b1('0x6a')));}_0x425f9f[_0x74b1('0x65')](new Extension(_0x4d2fcb,0x4,_0x74b1('0x6b'),_0x5ada76[_0x74b1('0x57')]+','+_0x74b1('0x6c')+(0x8+_0x1709d9[_0x74b1('0x2d')][_0x74b1('0x39')])+'}'+','+0x1));return _0x425f9f;}function formatPrefixName(_0x8b4902){var _0x44563d='_';for(var _0x2a33c9=0x0;_0x2a33c9<_0x8b4902['length'];_0x2a33c9++){if(_0x8b4902[_0x74b1('0x6d')](_0x2a33c9)=='-'){_0x44563d+=_0x8b4902[_0x74b1('0x6d')](_0x2a33c9);}else{_0x44563d+='['+_0x8b4902[_0x74b1('0x6d')](_0x2a33c9)+']';}}_0x44563d+='.';return _0x44563d;}exports[_0x74b1('0x26')]=function(_0x30692c,_0x228f8f,_0x2e94d6){var _0x7e2bcc=_0x30692c[_0x74b1('0x6e')];_0x7e2bcc['prefix']=_0x74b1('0x6f')+_0x7e2bcc['name']+'-';return db[_0x74b1('0x4d')]['transaction'](function(_0x5886d1){return db[_0x74b1('0x30')][_0x74b1('0x26')](_0x7e2bcc,{'where':{'id':_0x7e2bcc['id']},'transaction':_0x5886d1})[_0x74b1('0x27')](function(){return db['VoiceExtension'][_0x74b1('0x28')]({'where':{'VoicePrefixId':_0x7e2bcc['id']},'transaction':_0x5886d1})[_0x74b1('0x27')](function(){return db['VoiceExtension'][_0x74b1('0x4a')]({'where':{'id':_0x7e2bcc[_0x74b1('0x50')]},'raw':!![]})[_0x74b1('0x27')](function(_0x21e767){return createVoicePrefixExtensions(_0x7e2bcc,_0x21e767,_0x5886d1);});});});})[_0x74b1('0x27')](function(){return db[_0x74b1('0x30')][_0x74b1('0x70')](_0x7e2bcc['id']);})[_0x74b1('0x27')](respondWithResult(_0x228f8f,null))[_0x74b1('0x45')](handleError(_0x228f8f,null));};exports[_0x74b1('0x71')]=function(_0x542ee7,_0x2b1119,_0x3267ef){return db[_0x74b1('0x30')]['find']({'where':{'id':_0x542ee7[_0x74b1('0x46')]['id']}})[_0x74b1('0x27')](handleEntityNotFound(_0x2b1119,null))[_0x74b1('0x27')](function(_0x1a6a70){if(_0x1a6a70){return _0x1a6a70[_0x74b1('0x71')](_0x542ee7['body'][_0x74b1('0x72')],_[_0x74b1('0x73')](_0x542ee7[_0x74b1('0x6e')],[_0x74b1('0x72'),'id'])||{})[_0x74b1('0x74')](function(_0x36733f){for(var _0x359e05=0x0;_0x359e05<_0x542ee7[_0x74b1('0x6e')]['ids'][_0x74b1('0x39')];_0x359e05+=0x1){socket[_0x74b1('0x75')](_0x74b1('0x76'),{'UserId':Number(_0x542ee7['body']['ids'][_0x359e05]),'VoicePrefixId':Number(_0x542ee7[_0x74b1('0x46')]['id'])});}return _0x36733f;});}})[_0x74b1('0x27')](respondWithResult(_0x2b1119,null))[_0x74b1('0x45')](handleError(_0x2b1119,null));};exports[_0x74b1('0x77')]=function(_0x2de935,_0x5d8729,_0x42a630){return db['VoicePrefix']['find']({'where':{'id':_0x2de935[_0x74b1('0x46')]['id']}})[_0x74b1('0x27')](handleEntityNotFound(_0x5d8729,null))[_0x74b1('0x27')](function(_0x2da0f2){if(_0x2da0f2){return _0x2da0f2[_0x74b1('0x77')](_0x2de935[_0x74b1('0x32')][_0x74b1('0x72')])[_0x74b1('0x27')](function(){if(_['isArray'](_0x2de935['query']['ids'])){for(var _0x7ec28f=0x0;_0x7ec28f<_0x2de935[_0x74b1('0x32')][_0x74b1('0x72')][_0x74b1('0x39')];_0x7ec28f+=0x1){socket[_0x74b1('0x75')](_0x74b1('0x78'),{'UserId':Number(_0x2de935[_0x74b1('0x32')][_0x74b1('0x72')][_0x7ec28f]),'VoicePrefixId':Number(_0x2de935[_0x74b1('0x46')]['id'])});}}else{socket[_0x74b1('0x75')](_0x74b1('0x78'),{'UserId':Number(_0x2de935[_0x74b1('0x32')]['ids']),'VoicePrefixId':Number(_0x2de935[_0x74b1('0x46')]['id'])});}});}})[_0x74b1('0x27')](respondWithStatusCode(_0x5d8729,null))[_0x74b1('0x45')](handleError(_0x5d8729,null));};exports[_0x74b1('0x79')]=function(_0x25f929,_0x138f79,_0x5a07a6){var _0x2567d7={};var _0x32eb2d={};var _0x21c54f;var _0x4b025c;return db[_0x74b1('0x30')][_0x74b1('0x7a')]({'where':{'id':_0x25f929[_0x74b1('0x46')]['id']}})[_0x74b1('0x27')](handleEntityNotFound(_0x138f79,null))['then'](function(_0x7d3f08){if(_0x7d3f08){_0x21c54f=_0x7d3f08;_0x32eb2d[_0x74b1('0x36')]=_[_0x74b1('0x33')](db[_0x74b1('0x7b')][_0x74b1('0x47')]);_0x32eb2d['query']=_[_0x74b1('0x33')](_0x25f929[_0x74b1('0x32')]);_0x32eb2d['filters']=_[_0x74b1('0x35')](_0x32eb2d[_0x74b1('0x36')],_0x32eb2d['query']);_0x2567d7[_0x74b1('0x38')]=_[_0x74b1('0x35')](_0x32eb2d[_0x74b1('0x36')],qs[_0x74b1('0x37')](_0x25f929['query']['fields']));_0x2567d7[_0x74b1('0x38')]=_0x2567d7[_0x74b1('0x38')][_0x74b1('0x39')]?_0x2567d7['attributes']:_0x32eb2d[_0x74b1('0x36')];_0x2567d7[_0x74b1('0x3c')]=qs['sort'](_0x25f929['query'][_0x74b1('0x3d')]);_0x2567d7[_0x74b1('0x3e')]=qs[_0x74b1('0x34')](_['pick'](_0x25f929[_0x74b1('0x32')],_0x32eb2d[_0x74b1('0x34')]));if(_0x25f929[_0x74b1('0x32')][_0x74b1('0x40')]){_0x2567d7['where']=_['merge'](_0x2567d7[_0x74b1('0x3e')],{'$or':_[_0x74b1('0x2f')](_0x2567d7['attributes'],function(_0x1bf4a4){var _0x258b8f={};_0x258b8f[_0x1bf4a4]={'$like':'%'+_0x25f929[_0x74b1('0x32')][_0x74b1('0x40')]+'%'};return _0x258b8f;})});}_0x2567d7=_[_0x74b1('0x42')]({},_0x2567d7,_0x25f929[_0x74b1('0x49')]);return _0x21c54f[_0x74b1('0x79')](_0x2567d7);}})[_0x74b1('0x27')](function(_0x21453e){if(_0x21453e){_0x4b025c=_0x21453e[_0x74b1('0x39')];if(!_0x25f929['query'][_0x74b1('0x3a')](_0x74b1('0x3b'))){_0x2567d7[_0x74b1('0x1f')]=qs[_0x74b1('0x1f')](_0x25f929[_0x74b1('0x32')][_0x74b1('0x1f')]);_0x2567d7['offset']=qs[_0x74b1('0x1e')](_0x25f929['query'][_0x74b1('0x1e')]);}return _0x21c54f[_0x74b1('0x79')](_0x2567d7);}})[_0x74b1('0x27')](function(_0x4fcd9a){if(_0x4fcd9a){return _0x4fcd9a?{'count':_0x4b025c,'rows':_0x4fcd9a}:null;}})[_0x74b1('0x27')](respondWithResult(_0x138f79,null))[_0x74b1('0x45')](handleError(_0x138f79,null));};exports['getTeams']=function(_0x4a9ec5,_0x5c02fc,_0x1cbfde){var _0x6ac5ae={};var _0x1a223d={};var _0x25624b;var _0xb24035;return db[_0x74b1('0x30')][_0x74b1('0x7a')]({'where':{'id':_0x4a9ec5[_0x74b1('0x46')]['id']}})[_0x74b1('0x27')](handleEntityNotFound(_0x5c02fc,null))[_0x74b1('0x27')](function(_0x220cbf){if(_0x220cbf){_0x25624b=_0x220cbf;_0x1a223d[_0x74b1('0x36')]=_['keys'](db[_0x74b1('0x7c')][_0x74b1('0x47')]);_0x1a223d[_0x74b1('0x32')]=_['keys'](_0x4a9ec5[_0x74b1('0x32')]);_0x1a223d[_0x74b1('0x34')]=_[_0x74b1('0x35')](_0x1a223d['model'],_0x1a223d[_0x74b1('0x32')]);_0x6ac5ae[_0x74b1('0x38')]=_[_0x74b1('0x35')](_0x1a223d['model'],qs[_0x74b1('0x37')](_0x4a9ec5[_0x74b1('0x32')][_0x74b1('0x37')]));_0x6ac5ae[_0x74b1('0x38')]=_0x6ac5ae[_0x74b1('0x38')][_0x74b1('0x39')]?_0x6ac5ae[_0x74b1('0x38')]:_0x1a223d[_0x74b1('0x36')];_0x6ac5ae[_0x74b1('0x3c')]=qs[_0x74b1('0x3d')](_0x4a9ec5[_0x74b1('0x32')][_0x74b1('0x3d')]);_0x6ac5ae[_0x74b1('0x3e')]=qs[_0x74b1('0x34')](_[_0x74b1('0x3f')](_0x4a9ec5[_0x74b1('0x32')],_0x1a223d[_0x74b1('0x34')]));if(_0x4a9ec5['query'][_0x74b1('0x40')]){_0x6ac5ae[_0x74b1('0x3e')]=_['merge'](_0x6ac5ae[_0x74b1('0x3e')],{'$or':_[_0x74b1('0x2f')](_0x6ac5ae[_0x74b1('0x38')],function(_0x3e3dfb){var _0x1a5c1e={};_0x1a5c1e[_0x3e3dfb]={'$like':'%'+_0x4a9ec5[_0x74b1('0x32')]['filter']+'%'};return _0x1a5c1e;})});}_0x6ac5ae=_['merge']({},_0x6ac5ae,_0x4a9ec5[_0x74b1('0x49')]);return _0x25624b[_0x74b1('0x7d')](_0x6ac5ae);}})[_0x74b1('0x27')](function(_0x401599){if(_0x401599){_0xb24035=_0x401599[_0x74b1('0x39')];if(!_0x4a9ec5[_0x74b1('0x32')]['hasOwnProperty'](_0x74b1('0x3b'))){_0x6ac5ae[_0x74b1('0x1f')]=qs[_0x74b1('0x1f')](_0x4a9ec5[_0x74b1('0x32')]['limit']);_0x6ac5ae[_0x74b1('0x1e')]=qs[_0x74b1('0x1e')](_0x4a9ec5['query'][_0x74b1('0x1e')]);}return _0x25624b[_0x74b1('0x7d')](_0x6ac5ae);}})[_0x74b1('0x27')](function(_0x29de45){if(_0x29de45){return _0x29de45?{'count':_0xb24035,'rows':_0x29de45}:null;}})[_0x74b1('0x27')](respondWithResult(_0x5c02fc,null))[_0x74b1('0x45')](handleError(_0x5c02fc,null));};exports[_0x74b1('0x7e')]=function(_0x33b136,_0x4f9b6a,_0x8366b){var _0x2d356c=_0x33b136['body'][_0x74b1('0x72')];var _0x3719d7;return db[_0x74b1('0x7c')][_0x74b1('0x44')]({'where':{'id':_0x2d356c},'attributes':['id'],'include':[{'model':db[_0x74b1('0x7b')],'as':_0x74b1('0x7f'),'attributes':['id',_0x74b1('0x2d'),'online',_0x74b1('0x80'),'interface'],'raw':!![]}]})[_0x74b1('0x27')](function(_0x3bd788){if(_0x3bd788){_0x3719d7=_0x3bd788;var _0x5b4ecf=_[_0x74b1('0x81')](_0x3bd788,function(_0x5dbc1f){var _0x4aa62a=_0x5dbc1f[_0x74b1('0x29')]({'plain':!![]});return _0x4aa62a['Agents'];});return db[_0x74b1('0x30')]['find']({'where':{'id':_0x33b136[_0x74b1('0x46')]['id']}})['then'](function(_0x5b8ba6){return db[_0x74b1('0x4d')]['transaction'](function(_0x2ea97c){return _0x5b8ba6[_0x74b1('0x7e')](_0x2d356c,{'transaction':_0x2ea97c})[_0x74b1('0x27')](function(){return BPromise[_0x74b1('0x82')](_0x3719d7,function(_0x433293){return db['TeamVoicePrefix'][_0x74b1('0x83')]({'TeamId':_0x433293['id'],'VoicePrefixId':_0x33b136['params']['id']},{'transaction':_0x2ea97c});});})[_0x74b1('0x27')](function(){return BPromise[_0x74b1('0x82')](_0x5b4ecf,function(_0x110bb6){return db['UserVoicePrefix'][_0x74b1('0x84')]({'where':{'UserId':_0x110bb6['id'],'VoicePrefixId':_0x33b136[_0x74b1('0x46')]['id']},'transaction':_0x2ea97c});});})['then'](function(){_0x5b4ecf[_0x74b1('0x85')](function(_0xbaf7f4){socket[_0x74b1('0x75')](_0x74b1('0x76'),{'UserId':_0xbaf7f4['id'],'VoicePrefixId':_0x5b8ba6['id']});});});});});}})['then'](respondWithStatusCode(_0x4f9b6a,null))[_0x74b1('0x45')](handleError(_0x4f9b6a,null));};exports[_0x74b1('0x86')]=function(_0x1f2add,_0x1ab4ea,_0x5b3ae9){return db[_0x74b1('0x7c')][_0x74b1('0x44')]({'where':{'id':_0x1f2add['query'][_0x74b1('0x72')]},'attributes':['id'],'include':[{'model':db[_0x74b1('0x7b')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x74b1('0x27')](handleEntityNotFound(_0x1ab4ea,null))[_0x74b1('0x27')](function(_0x39354d){var _0x484368=_['map'](_0x39354d,'id');var _0xfcd9b=[];var _0x1b3847=[];var _0x4880f6=squel['select']();_0x4880f6[_0x74b1('0x87')](_0x74b1('0x88'))['from'](_0x74b1('0x89'),'tq')[_0x74b1('0x8a')](_0x74b1('0x8b'),'ut',_0x74b1('0x8c'))[_0x74b1('0x3e')](_0x74b1('0x8d'),_0x1f2add[_0x74b1('0x46')]['id']);for(var _0x523ec1=0x0;_0x523ec1<_0x39354d[_0x74b1('0x39')];_0x523ec1+=0x1){let _0x304756=_0x39354d[_0x523ec1];for(var _0x3039d7=0x0;_0x3039d7<_0x304756[_0x74b1('0x7f')][_0x74b1('0x39')];_0x3039d7+=0x1){let _0x367373=_0x304756[_0x74b1('0x7f')][_0x3039d7];var _0x2ee3a7=_0x4880f6[_0x74b1('0x8e')]();_0x2ee3a7[_0x74b1('0x3e')]('ut.UserId\x20=\x20?',_0x367373['id']);_0x1b3847['push'](db['sequelize'][_0x74b1('0x32')](_0x2ee3a7[_0x74b1('0x8f')](),{'type':db['sequelize'][_0x74b1('0x90')][_0x74b1('0x91')]})[_0x74b1('0x27')](function(_0x399c7c){if(_0x399c7c['length']===0x1){return _0x367373['id'];}else{var _0xe421dc=_[_0x74b1('0x92')](_[_0x74b1('0x2f')](_0x399c7c,_0x74b1('0x93')),function(_0x58896f){return _['includes'](_0x484368,_0x58896f);});if(_0xe421dc){return _0x367373['id'];}}}));}}return BPromise['all'](_0x1b3847)[_0x74b1('0x27')](function(_0x20f41b){_0xfcd9b=_(_0xfcd9b)['union'](_0x20f41b)['compact']()['value']();return db[_0x74b1('0x30')]['find']({'where':{'id':_0x1f2add[_0x74b1('0x46')]['id']}})[_0x74b1('0x27')](function(_0x1326b3){return db['sequelize'][_0x74b1('0x4e')](function(_0x155534){return _0x1326b3['removeTeams'](_0x1f2add[_0x74b1('0x32')][_0x74b1('0x72')],{'transaction':_0x155534})[_0x74b1('0x27')](function(){if(!_[_0x74b1('0x94')](_0xfcd9b)){return _0x1326b3['removeAgents'](_0xfcd9b,{'transaction':_0x155534});}})[_0x74b1('0x27')](function(){_0xfcd9b[_0x74b1('0x85')](function(_0x4a9046){socket[_0x74b1('0x75')]('userVoicePrefix:remove',{'UserId':_0x4a9046,'VoicePrefixId':_0x1326b3['id']});});});});});});})[_0x74b1('0x27')](respondWithStatusCode(_0x1ab4ea,null))[_0x74b1('0x45')](handleError(_0x1ab4ea,null));}; \ No newline at end of file +var _0xef0f=['sequelize','transaction','addAgents','ids','omit','emit','userVoicePrefix:save','removeAgents','isArray','userVoicePrefix:remove','getAgents','User','order','where','filter','getTeams','findOne','Team','online','interface','Agents','addTeams','each','TeamVoicePrefix','upsert','UserVoicePrefix','findOrCreate','forEach','removeTeams','select','field','tq.TeamId','from','team_has_voice_prefixes','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoicePrefixId\x20=\x20?','clone','toString','SELECT','every','TeamId','includes','all','compact','isEmpty','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./voicePrefix.socket','register','end','status','json','offset','undefined','limit','count','set','reject','save','destroy','then','get','UserProfileResource','sendStatus','error','name','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','merge','VIRTUAL','options','VoicePrefix','includeAll','include','findAll','catch','show','params','rawAttributes','find','describe','create','body','VoiceExtension','VoiceExtensionId','user','role','UserProfileSection','VoicePrefixes','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','from-sip','exten','app','system','Voice\x20Prefix\x20Extension','appdata','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','map','bulkCreate','Extensions\x20creation\x20failed','Set','CDR(prefix)=','callerIdAll','push','PREFIX-CALLERIDALL=','No\x20callerid\x20available','context','${EXTEN:','charAt','update','system-'];(function(_0x2361e4,_0xc3a9a){var _0xb09007=function(_0x5d1b1a){while(--_0x5d1b1a){_0x2361e4['push'](_0x2361e4['shift']());}};_0xb09007(++_0xc3a9a);}(_0xef0f,0x168));var _0xfef0=function(_0x1a17a4,_0x5837b4){_0x1a17a4=_0x1a17a4-0x0;var _0x35adf8=_0xef0f[_0x1a17a4];return _0x35adf8;};'use strict';var emlformat=require(_0xfef0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfef0('0x1'));var jsonpatch=require(_0xfef0('0x2'));var rp=require(_0xfef0('0x3'));var moment=require('moment');var BPromise=require(_0xfef0('0x4'));var Mustache=require(_0xfef0('0x5'));var util=require(_0xfef0('0x6'));var path=require('path');var sox=require(_0xfef0('0x7'));var csv=require(_0xfef0('0x8'));var ejs=require(_0xfef0('0x9'));var fs=require('fs');var fs_extra=require(_0xfef0('0xa'));var _=require(_0xfef0('0xb'));var squel=require(_0xfef0('0xc'));var crypto=require('crypto');var jsforce=require(_0xfef0('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xfef0('0x8'));var querystring=require(_0xfef0('0xe'));var Papa=require(_0xfef0('0xf'));var Redis=require(_0xfef0('0x10'));var authService=require(_0xfef0('0x11'));var qs=require(_0xfef0('0x12'));var as=require(_0xfef0('0x13'));var hardwareService=require(_0xfef0('0x14'));var logger=require(_0xfef0('0x15'))(_0xfef0('0x16'));var utils=require(_0xfef0('0x17'));var config=require(_0xfef0('0x18'));var licenseUtil=require(_0xfef0('0x19'));var db=require(_0xfef0('0x1a'))['db'];config['redis']=_[_0xfef0('0x1b')](config[_0xfef0('0x1c')],{'host':_0xfef0('0x1d'),'port':0x18eb});var socket=require(_0xfef0('0x1e'))(new Redis(config[_0xfef0('0x1c')]));require(_0xfef0('0x1f'))[_0xfef0('0x20')](socket);function respondWithStatusCode(_0x573ae7,_0x3d1f02){_0x3d1f02=_0x3d1f02||0xcc;return function(_0x554aaa){if(_0x554aaa){return _0x573ae7['sendStatus'](_0x3d1f02);}return _0x573ae7['status'](_0x3d1f02)[_0xfef0('0x21')]();};}function respondWithResult(_0x284b6d,_0x3510a7){_0x3510a7=_0x3510a7||0xc8;return function(_0x1bce2f){if(_0x1bce2f){return _0x284b6d[_0xfef0('0x22')](_0x3510a7)[_0xfef0('0x23')](_0x1bce2f);}};}function respondWithFilteredResult(_0x155833,_0x2887e6){return function(_0x581459){if(_0x581459){var _0xd60678=typeof _0x2887e6[_0xfef0('0x24')]===_0xfef0('0x25')&&typeof _0x2887e6[_0xfef0('0x26')]===_0xfef0('0x25');var _0x55912f=_0x581459[_0xfef0('0x27')];var _0x4e24de=_0xd60678?0x0:_0x2887e6[_0xfef0('0x24')];var _0x1a0aa0=_0xd60678?_0x581459[_0xfef0('0x27')]:_0x2887e6['offset']+_0x2887e6[_0xfef0('0x26')];var _0x4c304d;if(_0x1a0aa0>=_0x55912f){_0x1a0aa0=_0x55912f;_0x4c304d=0xc8;}else{_0x4c304d=0xce;}_0x155833[_0xfef0('0x22')](_0x4c304d);return _0x155833[_0xfef0('0x28')]('Content-Range',_0x4e24de+'-'+_0x1a0aa0+'/'+_0x55912f)['json'](_0x581459);}return null;};}function patchUpdates(_0x4b8b22){return function(_0x19fde8){try{jsonpatch['apply'](_0x19fde8,_0x4b8b22,!![]);}catch(_0x1f9970){return BPromise[_0xfef0('0x29')](_0x1f9970);}return _0x19fde8[_0xfef0('0x2a')]();};}function saveUpdates(_0x4483f2,_0x249fe4){return function(_0xd687ed){if(_0xd687ed){return _0xd687ed['update'](_0x4483f2)['then'](function(_0x316e20){return _0x316e20;});}return null;};}function removeEntity(_0x1ffaa4,_0x924f6e){return function(_0x34ca65){if(_0x34ca65){return _0x34ca65[_0xfef0('0x2b')]()[_0xfef0('0x2c')](function(){var _0x5df04f=_0x34ca65[_0xfef0('0x2d')]({'plain':!![]});var _0x391279='VoicePrefixes';return db[_0xfef0('0x2e')][_0xfef0('0x2b')]({'where':{'type':_0x391279,'resourceId':_0x5df04f['id']}})[_0xfef0('0x2c')](function(){return _0x34ca65;});})[_0xfef0('0x2c')](function(){_0x1ffaa4[_0xfef0('0x22')](0xcc)[_0xfef0('0x21')]();});}};}function handleEntityNotFound(_0x3e3c4c,_0x3e026a){return function(_0x26cb9a){if(!_0x26cb9a){_0x3e3c4c[_0xfef0('0x2f')](0x194);}return _0x26cb9a;};}function handleError(_0x3ee42f,_0x3ffea0){_0x3ffea0=_0x3ffea0||0x1f4;return function(_0x51af0f){logger[_0xfef0('0x30')](_0x51af0f['stack']);if(_0x51af0f['name']){delete _0x51af0f[_0xfef0('0x31')];}_0x3ee42f[_0xfef0('0x22')](_0x3ffea0)['send'](_0x51af0f);};}exports['index']=function(_0x5cf518,_0x4f65cd){var _0x4cce8a={},_0x417535={},_0x172d94={'count':0x0,'rows':[]};var _0x2fffae=_['map'](db['VoicePrefix']['rawAttributes'],function(_0x1f8110){return{'name':_0x1f8110['fieldName'],'type':_0x1f8110[_0xfef0('0x32')][_0xfef0('0x33')]};});_0x417535[_0xfef0('0x34')]=_['map'](_0x2fffae,_0xfef0('0x31'));_0x417535['query']=_[_0xfef0('0x35')](_0x5cf518[_0xfef0('0x36')]);_0x417535[_0xfef0('0x37')]=_[_0xfef0('0x38')](_0x417535[_0xfef0('0x34')],_0x417535[_0xfef0('0x36')]);_0x4cce8a[_0xfef0('0x39')]=_[_0xfef0('0x38')](_0x417535['model'],qs[_0xfef0('0x3a')](_0x5cf518[_0xfef0('0x36')][_0xfef0('0x3a')]));_0x4cce8a[_0xfef0('0x39')]=_0x4cce8a[_0xfef0('0x39')][_0xfef0('0x3b')]?_0x4cce8a[_0xfef0('0x39')]:_0x417535[_0xfef0('0x34')];if(!_0x5cf518[_0xfef0('0x36')][_0xfef0('0x3c')](_0xfef0('0x3d'))){_0x4cce8a[_0xfef0('0x26')]=qs[_0xfef0('0x26')](_0x5cf518['query'][_0xfef0('0x26')]);_0x4cce8a['offset']=qs[_0xfef0('0x24')](_0x5cf518[_0xfef0('0x36')][_0xfef0('0x24')]);}_0x4cce8a['order']=qs[_0xfef0('0x3e')](_0x5cf518[_0xfef0('0x36')][_0xfef0('0x3e')]);_0x4cce8a['where']=qs[_0xfef0('0x37')](_[_0xfef0('0x3f')](_0x5cf518[_0xfef0('0x36')],_0x417535['filters']),_0x2fffae);if(_0x5cf518[_0xfef0('0x36')]['filter']){_0x4cce8a['where']=_[_0xfef0('0x40')](_0x4cce8a['where'],{'$or':_['map'](_0x2fffae,function(_0xbf6ddd){if(_0xbf6ddd[_0xfef0('0x32')]!==_0xfef0('0x41')){var _0x1a6593={};_0x1a6593[_0xbf6ddd[_0xfef0('0x31')]]={'$like':'%'+_0x5cf518[_0xfef0('0x36')]['filter']+'%'};return _0x1a6593;}})});}_0x4cce8a=_[_0xfef0('0x40')]({},_0x4cce8a,_0x5cf518[_0xfef0('0x42')]);var _0x5a9ed3={'where':_0x4cce8a['where']};return db[_0xfef0('0x43')]['count'](_0x5a9ed3)[_0xfef0('0x2c')](function(_0x22c940){_0x172d94[_0xfef0('0x27')]=_0x22c940;if(_0x5cf518[_0xfef0('0x36')][_0xfef0('0x44')]){_0x4cce8a[_0xfef0('0x45')]=[{'all':!![]}];}return db[_0xfef0('0x43')][_0xfef0('0x46')](_0x4cce8a);})['then'](function(_0x1813dc){_0x172d94['rows']=_0x1813dc;return _0x172d94;})['then'](respondWithFilteredResult(_0x4f65cd,_0x4cce8a))[_0xfef0('0x47')](handleError(_0x4f65cd,null));};exports[_0xfef0('0x48')]=function(_0x5bf416,_0x2af79f){var _0x5587a9={'raw':![],'where':{'id':_0x5bf416[_0xfef0('0x49')]['id']}},_0x39df7c={};_0x39df7c[_0xfef0('0x34')]=_[_0xfef0('0x35')](db['VoicePrefix'][_0xfef0('0x4a')]);_0x39df7c[_0xfef0('0x36')]=_['keys'](_0x5bf416['query']);_0x39df7c[_0xfef0('0x37')]=_['intersection'](_0x39df7c[_0xfef0('0x34')],_0x39df7c[_0xfef0('0x36')]);_0x5587a9[_0xfef0('0x39')]=_[_0xfef0('0x38')](_0x39df7c[_0xfef0('0x34')],qs[_0xfef0('0x3a')](_0x5bf416['query'][_0xfef0('0x3a')]));_0x5587a9['attributes']=_0x5587a9['attributes'][_0xfef0('0x3b')]?_0x5587a9[_0xfef0('0x39')]:_0x39df7c[_0xfef0('0x34')];if(_0x5bf416['query'][_0xfef0('0x44')]){_0x5587a9['include']=[{'all':!![]}];}_0x5587a9=_['merge']({},_0x5587a9,_0x5bf416['options']);return db[_0xfef0('0x43')][_0xfef0('0x4b')](_0x5587a9)[_0xfef0('0x2c')](handleEntityNotFound(_0x2af79f,null))[_0xfef0('0x2c')](respondWithResult(_0x2af79f,null))[_0xfef0('0x47')](handleError(_0x2af79f,null));};exports[_0xfef0('0x2b')]=function(_0x1b78af,_0x3853bb){return db[_0xfef0('0x43')]['find']({'where':{'id':_0x1b78af['params']['id']}})[_0xfef0('0x2c')](handleEntityNotFound(_0x3853bb,null))[_0xfef0('0x2c')](removeEntity(_0x3853bb,null))[_0xfef0('0x47')](handleError(_0x3853bb,null));};exports[_0xfef0('0x4c')]=function(_0x393fee,_0x1e1458){return db[_0xfef0('0x43')][_0xfef0('0x4c')]()['then'](respondWithResult(_0x1e1458,null))[_0xfef0('0x47')](handleError(_0x1e1458,null));};exports[_0xfef0('0x4d')]=function(_0x247caf,_0x10378e){var _0x6591d4;return db['sequelize']['transaction'](function(_0x523763){return db[_0xfef0('0x43')][_0xfef0('0x4d')](_0x247caf[_0xfef0('0x4e')],{'transaction':_0x523763})[_0xfef0('0x2c')](function(_0x4e959e){_0x6591d4=_0x4e959e[_0xfef0('0x2d')]({'plain':!![]});return db[_0xfef0('0x4f')][_0xfef0('0x4b')]({'where':{'id':_0x6591d4[_0xfef0('0x50')]},'raw':!![]})[_0xfef0('0x2c')](function(_0x2f94c4){return createVoicePrefixExtensions(_0x6591d4,_0x2f94c4,_0x523763);});});})[_0xfef0('0x2c')](function(){var _0x4cd0fd=_0x247caf[_0xfef0('0x51')][_0xfef0('0x2d')]({'plain':!![]});if(!_0x4cd0fd)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4cd0fd[_0xfef0('0x52')]==='user'){var _0x175e97=_0x6591d4;return db[_0xfef0('0x53')]['find']({'where':{'name':_0xfef0('0x54'),'userProfileId':_0x4cd0fd['userProfileId']},'raw':!![]})['then'](function(_0x4812c7){if(_0x4812c7&&_0x4812c7[_0xfef0('0x55')]===0x0){return db[_0xfef0('0x2e')][_0xfef0('0x4d')]({'name':_0x175e97[_0xfef0('0x31')],'resourceId':_0x175e97['id'],'type':_0x4812c7[_0xfef0('0x31')],'sectionId':_0x4812c7['id']},{})[_0xfef0('0x2c')](function(){return _0x6591d4;});}else{return _0x6591d4;}})['catch'](function(_0xa365e5){logger[_0xfef0('0x30')](_0xfef0('0x56'),_0xa365e5);throw _0xa365e5;});}return _0x6591d4;})[_0xfef0('0x2c')](respondWithResult(_0x10378e,null))[_0xfef0('0x47')](handleError(_0x10378e,null));};function Extension(_0x58d95e,_0x59d1b6,_0x4aef94,_0x135653){this['context']=_0xfef0('0x57');this[_0xfef0('0x58')]=_0x58d95e;this[_0xfef0('0x59')]=_0x4aef94;this[_0xfef0('0x32')]=_0xfef0('0x5a');this['description']=_0xfef0('0x5b');this['priority']=_0x59d1b6;this[_0xfef0('0x5c')]=_0x135653;}function createVoicePrefixExtensions(_0x4a1316,_0x4a4d36,_0x3a12c5){return new BPromise(function(_0x3c5640,_0xd6de4d){var _0x35a486=new Extension(formatPrefixName(_0x4a1316[_0xfef0('0x5d')]),0x1,_0xfef0('0x5e'),_0xfef0('0x5f'));_0x35a486[_0xfef0('0x60')]=_0x4a1316['id'];return db[_0xfef0('0x4f')][_0xfef0('0x4d')](_0x35a486,{'transaction':_0x3a12c5})[_0xfef0('0x2c')](function(_0x46d0bb){var _0x5df358=_0x46d0bb[_0xfef0('0x2d')]({'plain':!![]});var _0x3b660c=_[_0xfef0('0x61')](addVoicePrefixExtensions(_0x4a1316,_0x4a4d36),function(_0x312dcf){_0x312dcf[_0xfef0('0x50')]=_0x5df358['id'];_0x312dcf['VoicePrefixId']=_0x4a1316['id'];return _0x312dcf;});return db[_0xfef0('0x4f')][_0xfef0('0x62')](_0x3b660c,{'transaction':_0x3a12c5})[_0xfef0('0x2c')](function(_0x3c6bb8){if(!_0x3c6bb8){return _0xd6de4d(_0xfef0('0x63'));}else{return _0x3c5640(_0x3c6bb8);}})[_0xfef0('0x47')](function(_0xb9693b){return _0xd6de4d(_0xb9693b);});});;});};function addVoicePrefixExtensions(_0x103ca3,_0x14d53d){var _0x3f26d9=[];var _0x4f7ad3=formatPrefixName(_0x103ca3[_0xfef0('0x5d')]);_0x3f26d9['push'](new Extension(_0x4f7ad3,0x2,_0xfef0('0x64'),_0xfef0('0x65')+_0x103ca3['name']));if(_0x103ca3[_0xfef0('0x66')]){_0x3f26d9[_0xfef0('0x67')](new Extension(_0x4f7ad3,0x3,_0xfef0('0x64'),_0xfef0('0x68')+_0x103ca3[_0xfef0('0x66')]));}else{_0x3f26d9['push'](new Extension(_0x4f7ad3,0x3,_0xfef0('0x5e'),_0xfef0('0x69')));}_0x3f26d9[_0xfef0('0x67')](new Extension(_0x4f7ad3,0x4,'goto',_0x14d53d[_0xfef0('0x6a')]+','+_0xfef0('0x6b')+(0x8+_0x103ca3[_0xfef0('0x31')][_0xfef0('0x3b')])+'}'+','+0x1));return _0x3f26d9;}function formatPrefixName(_0x7186c8){var _0x3cfe32='_';for(var _0x45ba65=0x0;_0x45ba65<_0x7186c8['length'];_0x45ba65++){if(_0x7186c8[_0xfef0('0x6c')](_0x45ba65)=='-'){_0x3cfe32+=_0x7186c8[_0xfef0('0x6c')](_0x45ba65);}else{_0x3cfe32+='['+_0x7186c8[_0xfef0('0x6c')](_0x45ba65)+']';}}_0x3cfe32+='.';return _0x3cfe32;}exports[_0xfef0('0x6d')]=function(_0x317eda,_0x2dde67,_0x488db4){var _0x340517=_0x317eda[_0xfef0('0x4e')];_0x340517[_0xfef0('0x5d')]=_0xfef0('0x6e')+_0x340517['name']+'-';return db[_0xfef0('0x6f')][_0xfef0('0x70')](function(_0x5a33a1){return db[_0xfef0('0x43')][_0xfef0('0x6d')](_0x340517,{'where':{'id':_0x340517['id']},'transaction':_0x5a33a1})[_0xfef0('0x2c')](function(){return db[_0xfef0('0x4f')][_0xfef0('0x2b')]({'where':{'VoicePrefixId':_0x340517['id']},'transaction':_0x5a33a1})['then'](function(){return db['VoiceExtension']['find']({'where':{'id':_0x340517[_0xfef0('0x50')]},'raw':!![]})[_0xfef0('0x2c')](function(_0x2474b2){return createVoicePrefixExtensions(_0x340517,_0x2474b2,_0x5a33a1);});});});})['then'](function(){return db[_0xfef0('0x43')]['findById'](_0x340517['id']);})['then'](respondWithResult(_0x2dde67,null))['catch'](handleError(_0x2dde67,null));};exports[_0xfef0('0x71')]=function(_0x1cf182,_0x50cd7a,_0x166aab){return db[_0xfef0('0x43')][_0xfef0('0x4b')]({'where':{'id':_0x1cf182['params']['id']}})[_0xfef0('0x2c')](handleEntityNotFound(_0x50cd7a,null))['then'](function(_0x5ee0c0){if(_0x5ee0c0){return _0x5ee0c0[_0xfef0('0x71')](_0x1cf182[_0xfef0('0x4e')][_0xfef0('0x72')],_[_0xfef0('0x73')](_0x1cf182['body'],['ids','id'])||{})['spread'](function(_0xd973d3){for(var _0x546455=0x0;_0x546455<_0x1cf182[_0xfef0('0x4e')][_0xfef0('0x72')][_0xfef0('0x3b')];_0x546455+=0x1){socket[_0xfef0('0x74')](_0xfef0('0x75'),{'UserId':Number(_0x1cf182['body'][_0xfef0('0x72')][_0x546455]),'VoicePrefixId':Number(_0x1cf182['params']['id'])});}return _0xd973d3;});}})['then'](respondWithResult(_0x50cd7a,null))[_0xfef0('0x47')](handleError(_0x50cd7a,null));};exports[_0xfef0('0x76')]=function(_0xc30175,_0x3bfe3f,_0x5a17a9){return db['VoicePrefix'][_0xfef0('0x4b')]({'where':{'id':_0xc30175[_0xfef0('0x49')]['id']}})['then'](handleEntityNotFound(_0x3bfe3f,null))[_0xfef0('0x2c')](function(_0x3bbb7e){if(_0x3bbb7e){return _0x3bbb7e[_0xfef0('0x76')](_0xc30175[_0xfef0('0x36')][_0xfef0('0x72')])[_0xfef0('0x2c')](function(){if(_[_0xfef0('0x77')](_0xc30175[_0xfef0('0x36')][_0xfef0('0x72')])){for(var _0x52fe45=0x0;_0x52fe45<_0xc30175[_0xfef0('0x36')][_0xfef0('0x72')][_0xfef0('0x3b')];_0x52fe45+=0x1){socket[_0xfef0('0x74')](_0xfef0('0x78'),{'UserId':Number(_0xc30175[_0xfef0('0x36')][_0xfef0('0x72')][_0x52fe45]),'VoicePrefixId':Number(_0xc30175['params']['id'])});}}else{socket[_0xfef0('0x74')](_0xfef0('0x78'),{'UserId':Number(_0xc30175[_0xfef0('0x36')][_0xfef0('0x72')]),'VoicePrefixId':Number(_0xc30175[_0xfef0('0x49')]['id'])});}});}})[_0xfef0('0x2c')](respondWithStatusCode(_0x3bfe3f,null))[_0xfef0('0x47')](handleError(_0x3bfe3f,null));};exports[_0xfef0('0x79')]=function(_0x32944e,_0x39c591,_0x1f2413){var _0x17c350={};var _0x283d5a={};var _0x5630a6;var _0x32aab6;return db['VoicePrefix']['findOne']({'where':{'id':_0x32944e[_0xfef0('0x49')]['id']}})[_0xfef0('0x2c')](handleEntityNotFound(_0x39c591,null))['then'](function(_0x299116){if(_0x299116){_0x5630a6=_0x299116;_0x283d5a['model']=_['keys'](db[_0xfef0('0x7a')][_0xfef0('0x4a')]);_0x283d5a[_0xfef0('0x36')]=_[_0xfef0('0x35')](_0x32944e['query']);_0x283d5a[_0xfef0('0x37')]=_[_0xfef0('0x38')](_0x283d5a['model'],_0x283d5a[_0xfef0('0x36')]);_0x17c350[_0xfef0('0x39')]=_[_0xfef0('0x38')](_0x283d5a['model'],qs['fields'](_0x32944e[_0xfef0('0x36')]['fields']));_0x17c350['attributes']=_0x17c350[_0xfef0('0x39')]['length']?_0x17c350[_0xfef0('0x39')]:_0x283d5a[_0xfef0('0x34')];_0x17c350[_0xfef0('0x7b')]=qs[_0xfef0('0x3e')](_0x32944e[_0xfef0('0x36')][_0xfef0('0x3e')]);_0x17c350[_0xfef0('0x7c')]=qs[_0xfef0('0x37')](_[_0xfef0('0x3f')](_0x32944e[_0xfef0('0x36')],_0x283d5a['filters']));if(_0x32944e[_0xfef0('0x36')]['filter']){_0x17c350['where']=_[_0xfef0('0x40')](_0x17c350['where'],{'$or':_[_0xfef0('0x61')](_0x17c350[_0xfef0('0x39')],function(_0x2e7268){var _0x34b802={};_0x34b802[_0x2e7268]={'$like':'%'+_0x32944e[_0xfef0('0x36')][_0xfef0('0x7d')]+'%'};return _0x34b802;})});}_0x17c350=_['merge']({},_0x17c350,_0x32944e[_0xfef0('0x42')]);return _0x5630a6[_0xfef0('0x79')](_0x17c350);}})[_0xfef0('0x2c')](function(_0x17a514){if(_0x17a514){_0x32aab6=_0x17a514[_0xfef0('0x3b')];if(!_0x32944e[_0xfef0('0x36')][_0xfef0('0x3c')](_0xfef0('0x3d'))){_0x17c350['limit']=qs[_0xfef0('0x26')](_0x32944e[_0xfef0('0x36')]['limit']);_0x17c350[_0xfef0('0x24')]=qs[_0xfef0('0x24')](_0x32944e[_0xfef0('0x36')]['offset']);}return _0x5630a6[_0xfef0('0x79')](_0x17c350);}})['then'](function(_0x1cb952){if(_0x1cb952){return _0x1cb952?{'count':_0x32aab6,'rows':_0x1cb952}:null;}})[_0xfef0('0x2c')](respondWithResult(_0x39c591,null))['catch'](handleError(_0x39c591,null));};exports[_0xfef0('0x7e')]=function(_0x51f79b,_0x1fa881,_0x8c4979){var _0x1b8ee7={};var _0x3eff14={};var _0x14d871;var _0x306319;return db[_0xfef0('0x43')][_0xfef0('0x7f')]({'where':{'id':_0x51f79b[_0xfef0('0x49')]['id']}})[_0xfef0('0x2c')](handleEntityNotFound(_0x1fa881,null))[_0xfef0('0x2c')](function(_0x5b7ffa){if(_0x5b7ffa){_0x14d871=_0x5b7ffa;_0x3eff14[_0xfef0('0x34')]=_['keys'](db['Team'][_0xfef0('0x4a')]);_0x3eff14['query']=_[_0xfef0('0x35')](_0x51f79b['query']);_0x3eff14['filters']=_[_0xfef0('0x38')](_0x3eff14['model'],_0x3eff14['query']);_0x1b8ee7['attributes']=_[_0xfef0('0x38')](_0x3eff14[_0xfef0('0x34')],qs[_0xfef0('0x3a')](_0x51f79b[_0xfef0('0x36')]['fields']));_0x1b8ee7[_0xfef0('0x39')]=_0x1b8ee7[_0xfef0('0x39')][_0xfef0('0x3b')]?_0x1b8ee7[_0xfef0('0x39')]:_0x3eff14[_0xfef0('0x34')];_0x1b8ee7['order']=qs['sort'](_0x51f79b[_0xfef0('0x36')][_0xfef0('0x3e')]);_0x1b8ee7['where']=qs[_0xfef0('0x37')](_[_0xfef0('0x3f')](_0x51f79b[_0xfef0('0x36')],_0x3eff14[_0xfef0('0x37')]));if(_0x51f79b[_0xfef0('0x36')][_0xfef0('0x7d')]){_0x1b8ee7[_0xfef0('0x7c')]=_[_0xfef0('0x40')](_0x1b8ee7['where'],{'$or':_['map'](_0x1b8ee7[_0xfef0('0x39')],function(_0x4135b0){var _0x14fc20={};_0x14fc20[_0x4135b0]={'$like':'%'+_0x51f79b[_0xfef0('0x36')][_0xfef0('0x7d')]+'%'};return _0x14fc20;})});}_0x1b8ee7=_[_0xfef0('0x40')]({},_0x1b8ee7,_0x51f79b[_0xfef0('0x42')]);return _0x14d871[_0xfef0('0x7e')](_0x1b8ee7);}})['then'](function(_0x5d7df9){if(_0x5d7df9){_0x306319=_0x5d7df9[_0xfef0('0x3b')];if(!_0x51f79b[_0xfef0('0x36')][_0xfef0('0x3c')](_0xfef0('0x3d'))){_0x1b8ee7[_0xfef0('0x26')]=qs[_0xfef0('0x26')](_0x51f79b['query'][_0xfef0('0x26')]);_0x1b8ee7[_0xfef0('0x24')]=qs['offset'](_0x51f79b[_0xfef0('0x36')][_0xfef0('0x24')]);}return _0x14d871[_0xfef0('0x7e')](_0x1b8ee7);}})[_0xfef0('0x2c')](function(_0x3b8b10){if(_0x3b8b10){return _0x3b8b10?{'count':_0x306319,'rows':_0x3b8b10}:null;}})[_0xfef0('0x2c')](respondWithResult(_0x1fa881,null))['catch'](handleError(_0x1fa881,null));};exports['addTeams']=function(_0x1084b9,_0xd7c5b,_0xd2c0be){var _0x15eefc=_0x1084b9[_0xfef0('0x4e')][_0xfef0('0x72')];var _0x4df302;return db[_0xfef0('0x80')]['findAll']({'where':{'id':_0x15eefc},'attributes':['id'],'include':[{'model':db[_0xfef0('0x7a')],'as':'Agents','attributes':['id',_0xfef0('0x31'),_0xfef0('0x81'),'voicePause',_0xfef0('0x82')],'raw':!![]}]})[_0xfef0('0x2c')](function(_0xc91fea){if(_0xc91fea){_0x4df302=_0xc91fea;var _0x4d56e5=_['flatMap'](_0xc91fea,function(_0x57083a){var _0x3a28b2=_0x57083a['get']({'plain':!![]});return _0x3a28b2[_0xfef0('0x83')];});return db[_0xfef0('0x43')]['find']({'where':{'id':_0x1084b9[_0xfef0('0x49')]['id']}})['then'](function(_0x43ee5f){return db[_0xfef0('0x6f')][_0xfef0('0x70')](function(_0x1a9ed3){return _0x43ee5f[_0xfef0('0x84')](_0x15eefc,{'transaction':_0x1a9ed3})[_0xfef0('0x2c')](function(){return BPromise[_0xfef0('0x85')](_0x4df302,function(_0x53ecba){return db[_0xfef0('0x86')][_0xfef0('0x87')]({'TeamId':_0x53ecba['id'],'VoicePrefixId':_0x1084b9[_0xfef0('0x49')]['id']},{'transaction':_0x1a9ed3});});})[_0xfef0('0x2c')](function(){return BPromise[_0xfef0('0x85')](_0x4d56e5,function(_0x110ef9){return db[_0xfef0('0x88')][_0xfef0('0x89')]({'where':{'UserId':_0x110ef9['id'],'VoicePrefixId':_0x1084b9[_0xfef0('0x49')]['id']},'transaction':_0x1a9ed3});});})[_0xfef0('0x2c')](function(){_0x4d56e5[_0xfef0('0x8a')](function(_0x34f1db){socket[_0xfef0('0x74')](_0xfef0('0x75'),{'UserId':_0x34f1db['id'],'VoicePrefixId':_0x43ee5f['id']});});});});});}})['then'](respondWithStatusCode(_0xd7c5b,null))[_0xfef0('0x47')](handleError(_0xd7c5b,null));};exports[_0xfef0('0x8b')]=function(_0x29ad24,_0x1ee5ad,_0xeea2ff){return db[_0xfef0('0x80')][_0xfef0('0x46')]({'where':{'id':_0x29ad24[_0xfef0('0x36')][_0xfef0('0x72')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xfef0('0x2c')](handleEntityNotFound(_0x1ee5ad,null))['then'](function(_0x63704){var _0x3d85ec=_[_0xfef0('0x61')](_0x63704,'id');var _0x17ab00=[];var _0xd9c290=[];var _0x365938=squel[_0xfef0('0x8c')]();_0x365938[_0xfef0('0x8d')](_0xfef0('0x8e'))[_0xfef0('0x8f')](_0xfef0('0x90'),'tq')['join'](_0xfef0('0x91'),'ut',_0xfef0('0x92'))['where'](_0xfef0('0x93'),_0x29ad24[_0xfef0('0x49')]['id']);for(var _0x524db7=0x0;_0x524db7<_0x63704[_0xfef0('0x3b')];_0x524db7+=0x1){let _0x591f01=_0x63704[_0x524db7];for(var _0x6ccbf8=0x0;_0x6ccbf8<_0x591f01[_0xfef0('0x83')][_0xfef0('0x3b')];_0x6ccbf8+=0x1){let _0xdf3db9=_0x591f01[_0xfef0('0x83')][_0x6ccbf8];var _0x520ff3=_0x365938[_0xfef0('0x94')]();_0x520ff3[_0xfef0('0x7c')]('ut.UserId\x20=\x20?',_0xdf3db9['id']);_0xd9c290[_0xfef0('0x67')](db['sequelize'][_0xfef0('0x36')](_0x520ff3[_0xfef0('0x95')](),{'type':db[_0xfef0('0x6f')]['QueryTypes'][_0xfef0('0x96')]})['then'](function(_0x5dde37){if(_0x5dde37[_0xfef0('0x3b')]===0x1){return _0xdf3db9['id'];}else{var _0x57b2b4=_[_0xfef0('0x97')](_[_0xfef0('0x61')](_0x5dde37,_0xfef0('0x98')),function(_0x11c5f0){return _[_0xfef0('0x99')](_0x3d85ec,_0x11c5f0);});if(_0x57b2b4){return _0xdf3db9['id'];}}}));}}return BPromise[_0xfef0('0x9a')](_0xd9c290)[_0xfef0('0x2c')](function(_0x547b4d){_0x17ab00=_(_0x17ab00)['union'](_0x547b4d)[_0xfef0('0x9b')]()['value']();return db[_0xfef0('0x43')][_0xfef0('0x4b')]({'where':{'id':_0x29ad24[_0xfef0('0x49')]['id']}})[_0xfef0('0x2c')](function(_0x3f9588){return db[_0xfef0('0x6f')][_0xfef0('0x70')](function(_0x326c85){return _0x3f9588['removeTeams'](_0x29ad24['query'][_0xfef0('0x72')],{'transaction':_0x326c85})[_0xfef0('0x2c')](function(){if(!_[_0xfef0('0x9c')](_0x17ab00)){return _0x3f9588[_0xfef0('0x76')](_0x17ab00,{'transaction':_0x326c85});}})[_0xfef0('0x2c')](function(){_0x17ab00['forEach'](function(_0x54d98e){socket['emit'](_0xfef0('0x78'),{'UserId':_0x54d98e,'VoicePrefixId':_0x3f9588['id']});});});});});});})[_0xfef0('0x2c')](respondWithStatusCode(_0x1ee5ad,null))['catch'](handleError(_0x1ee5ad,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index 974191d..7a363fb 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 _0x5992=['setMaxListeners','save','update','remove','emit','hasOwnProperty','events','../../mysqldb','VoicePrefix'];(function(_0x413240,_0x2f8f26){var _0x4fd588=function(_0xc4773a){while(--_0xc4773a){_0x413240['push'](_0x413240['shift']());}};_0x4fd588(++_0x2f8f26);}(_0x5992,0x1ec));var _0x2599=function(_0x13b02f,_0x462a53){_0x13b02f=_0x13b02f-0x0;var _0x12e9a6=_0x5992[_0x13b02f];return _0x12e9a6;};'use strict';var EventEmitter=require(_0x2599('0x0'));var VoicePrefix=require(_0x2599('0x1'))['db'][_0x2599('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x2599('0x3')](0x0);var events={'afterCreate':_0x2599('0x4'),'afterUpdate':_0x2599('0x5'),'afterDestroy':_0x2599('0x6')};function emitEvent(_0x507990){return function(_0x46d3cf,_0x46d795,_0x2bfcaf){VoicePrefixEvents[_0x2599('0x7')](_0x507990+':'+_0x46d3cf['id'],_0x46d3cf);VoicePrefixEvents[_0x2599('0x7')](_0x507990,_0x46d3cf);_0x2bfcaf(null);};}for(var e in events){if(events[_0x2599('0x8')](e)){var event=events[e];VoicePrefix['hook'](e,emitEvent(event));}}module['exports']=VoicePrefixEvents; \ No newline at end of file +var _0xa8ef=['VoicePrefix','save','remove','emit','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0x152b25,_0x5da2a5){var _0x41b54a=function(_0x515690){while(--_0x515690){_0x152b25['push'](_0x152b25['shift']());}};_0x41b54a(++_0x5da2a5);}(_0xa8ef,0xd7));var _0xfa8e=function(_0x46dc4c,_0x932e19){_0x46dc4c=_0x46dc4c-0x0;var _0x27fb27=_0xa8ef[_0x46dc4c];return _0x27fb27;};'use strict';var EventEmitter=require('events');var VoicePrefix=require(_0xfa8e('0x0'))['db'][_0xfa8e('0x1')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xfa8e('0x2'),'afterUpdate':'update','afterDestroy':_0xfa8e('0x3')};function emitEvent(_0x1d12ed){return function(_0x484e2b,_0x579bf9,_0xd94df8){VoicePrefixEvents[_0xfa8e('0x4')](_0x1d12ed+':'+_0x484e2b['id'],_0x484e2b);VoicePrefixEvents[_0xfa8e('0x4')](_0x1d12ed,_0x484e2b);_0xd94df8(null);};}for(var e in events){if(events[_0xfa8e('0x5')](e)){var event=events[e];VoicePrefix[_0xfa8e('0x6')](e,emitEvent(event));}}module[_0xfa8e('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 10e9835..88ebe74 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 _0x9e15=['./voicePrefix.attributes','exports','lodash','util','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x319050,_0x4ea414){var _0x4c0907=function(_0x1a644f){while(--_0x1a644f){_0x319050['push'](_0x319050['shift']());}};_0x4c0907(++_0x4ea414);}(_0x9e15,0x142));var _0x59e1=function(_0x2d34d6,_0x397ff9){_0x2d34d6=_0x2d34d6-0x0;var _0x1d3d12=_0x9e15[_0x2d34d6];return _0x1d3d12;};'use strict';var _=require(_0x59e1('0x0'));var util=require(_0x59e1('0x1'));var logger=require('../../config/logger')(_0x59e1('0x2'));var moment=require(_0x59e1('0x3'));var BPromise=require(_0x59e1('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x59e1('0x5'));var rimraf=require(_0x59e1('0x6'));var config=require(_0x59e1('0x7'));var attributes=require(_0x59e1('0x8'));module[_0x59e1('0x9')]=function(_0x2eec34,_0x7a25ec){return _0x2eec34['define']('VoicePrefix',attributes,{'tableName':'voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2d62=['api','moment','bluebird','path','rimraf','../../config/environment','./voicePrefix.attributes','define','lodash','util','../../config/logger'];(function(_0xb65e77,_0x238c3d){var _0x38134b=function(_0x39da21){while(--_0x39da21){_0xb65e77['push'](_0xb65e77['shift']());}};_0x38134b(++_0x238c3d);}(_0x2d62,0x189));var _0x22d6=function(_0x3cfd5c,_0x43d4d3){_0x3cfd5c=_0x3cfd5c-0x0;var _0x4d3840=_0x2d62[_0x3cfd5c];return _0x4d3840;};'use strict';var _=require(_0x22d6('0x0'));var util=require(_0x22d6('0x1'));var logger=require(_0x22d6('0x2'))(_0x22d6('0x3'));var moment=require(_0x22d6('0x4'));var BPromise=require(_0x22d6('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x22d6('0x6'));var rimraf=require(_0x22d6('0x7'));var config=require(_0x22d6('0x8'));var attributes=require(_0x22d6('0x9'));module['exports']=function(_0xfcfb3,_0x214301){return _0xfcfb3[_0x22d6('0xa')]('VoicePrefix',attributes,{'tableName':'voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.rpc.js b/server/api/voicePrefix/voicePrefix.rpc.js index 917f8e2..da0be82 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 _0xd3c8=['stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','request','then','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s'];(function(_0x408e38,_0x23cda8){var _0x426b0e=function(_0x8f2898){while(--_0x8f2898){_0x408e38['push'](_0x408e38['shift']());}};_0x426b0e(++_0x23cda8);}(_0xd3c8,0x161));var _0x8d3c=function(_0xeefca4,_0x5834fe){_0xeefca4=_0xeefca4-0x0;var _0x2927fb=_0xd3c8[_0xeefca4];return _0x2927fb;};'use strict';var _=require(_0x8d3c('0x0'));var util=require(_0x8d3c('0x1'));var moment=require(_0x8d3c('0x2'));var BPromise=require(_0x8d3c('0x3'));var rs=require(_0x8d3c('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8d3c('0x5'))['db'];var utils=require(_0x8d3c('0x6'));var logger=require(_0x8d3c('0x7'))(_0x8d3c('0x8'));var config=require('../../config/environment');var jayson=require(_0x8d3c('0x9'));var client=jayson[_0x8d3c('0xa')][_0x8d3c('0xb')]({'port':0x232a});config[_0x8d3c('0xc')]=_[_0x8d3c('0xd')](config[_0x8d3c('0xc')],{'host':_0x8d3c('0xe'),'port':0x18eb});var socket=require(_0x8d3c('0xf'))(new Redis(config[_0x8d3c('0xc')]));require(_0x8d3c('0x10'))['register'](socket);function respondWithRpcPromise(_0x566c3c,_0x5dff75,_0x4500ba){return new BPromise(function(_0x1c47ef,_0xf8e143){return client[_0x8d3c('0x11')](_0x566c3c,_0x4500ba)[_0x8d3c('0x12')](function(_0x6446fb){logger[_0x8d3c('0x13')](_0x8d3c('0x14'),_0x5dff75,_0x8d3c('0x15'));logger[_0x8d3c('0x16')](_0x8d3c('0x17'),_0x5dff75,_0x8d3c('0x15'),JSON[_0x8d3c('0x18')](_0x6446fb));if(_0x6446fb[_0x8d3c('0x19')]){if(_0x6446fb[_0x8d3c('0x19')][_0x8d3c('0x1a')]===0x1f4){logger[_0x8d3c('0x19')](_0x8d3c('0x14'),_0x5dff75,_0x6446fb[_0x8d3c('0x19')][_0x8d3c('0x1b')]);return _0xf8e143(_0x6446fb['error'][_0x8d3c('0x1b')]);}logger[_0x8d3c('0x19')](_0x8d3c('0x14'),_0x5dff75,_0x6446fb[_0x8d3c('0x19')][_0x8d3c('0x1b')]);return _0x1c47ef(_0x6446fb[_0x8d3c('0x19')][_0x8d3c('0x1b')]);}else{logger[_0x8d3c('0x13')](_0x8d3c('0x14'),_0x5dff75,_0x8d3c('0x15'));_0x1c47ef(_0x6446fb[_0x8d3c('0x1c')][_0x8d3c('0x1b')]);}})['catch'](function(_0x5cf870){logger[_0x8d3c('0x19')](_0x8d3c('0x14'),_0x5dff75,_0x5cf870);_0xf8e143(_0x5cf870);});});} \ No newline at end of file +var _0x5ae0=['randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./voicePrefix.socket','register','request','then','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','util','moment'];(function(_0x37e0f8,_0x28c2b7){var _0x2ed3ae=function(_0x228fc6){while(--_0x228fc6){_0x37e0f8['push'](_0x37e0f8['shift']());}};_0x2ed3ae(++_0x28c2b7);}(_0x5ae0,0xf8));var _0x05ae=function(_0x29be3f,_0x5f2aa7){_0x29be3f=_0x29be3f-0x0;var _0x306dcb=_0x5ae0[_0x29be3f];return _0x306dcb;};'use strict';var _=require('lodash');var util=require(_0x05ae('0x0'));var moment=require(_0x05ae('0x1'));var BPromise=require('bluebird');var rs=require(_0x05ae('0x2'));var fs=require('fs');var Redis=require(_0x05ae('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x05ae('0x4'));var logger=require(_0x05ae('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x05ae('0x6'));var client=jayson[_0x05ae('0x7')][_0x05ae('0x8')]({'port':0x232a});config['redis']=_[_0x05ae('0x9')](config[_0x05ae('0xa')],{'host':_0x05ae('0xb'),'port':0x18eb});var socket=require(_0x05ae('0xc'))(new Redis(config[_0x05ae('0xa')]));require(_0x05ae('0xd'))[_0x05ae('0xe')](socket);function respondWithRpcPromise(_0x42169a,_0x40d1bf,_0x272094){return new BPromise(function(_0x3e0498,_0x1629c0){return client[_0x05ae('0xf')](_0x42169a,_0x272094)[_0x05ae('0x10')](function(_0xb5944b){logger[_0x05ae('0x11')](_0x05ae('0x12'),_0x40d1bf,_0x05ae('0x13'));logger[_0x05ae('0x14')]('VoicePrefix,\x20%s,\x20%s,\x20%s',_0x40d1bf,'request\x20sent',JSON['stringify'](_0xb5944b));if(_0xb5944b['error']){if(_0xb5944b[_0x05ae('0x15')][_0x05ae('0x16')]===0x1f4){logger[_0x05ae('0x15')](_0x05ae('0x12'),_0x40d1bf,_0xb5944b[_0x05ae('0x15')][_0x05ae('0x17')]);return _0x1629c0(_0xb5944b[_0x05ae('0x15')][_0x05ae('0x17')]);}logger[_0x05ae('0x15')]('VoicePrefix,\x20%s,\x20%s',_0x40d1bf,_0xb5944b[_0x05ae('0x15')][_0x05ae('0x17')]);return _0x3e0498(_0xb5944b[_0x05ae('0x15')][_0x05ae('0x17')]);}else{logger[_0x05ae('0x11')](_0x05ae('0x12'),_0x40d1bf,_0x05ae('0x13'));_0x3e0498(_0xb5944b[_0x05ae('0x18')][_0x05ae('0x17')]);}})['catch'](function(_0x1bfea0){logger[_0x05ae('0x15')]('VoicePrefix,\x20%s,\x20%s',_0x40d1bf,_0x1bfea0);_0x1629c0(_0x1bfea0);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index 1fc14b9..b82ce2c 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 _0x6d2e=['voicePrefix:','save','remove','update','register','length'];(function(_0x7e36d0,_0x332b85){var _0x4a5ea3=function(_0x1c0575){while(--_0x1c0575){_0x7e36d0['push'](_0x7e36d0['shift']());}};_0x4a5ea3(++_0x332b85);}(_0x6d2e,0x97));var _0xe6d2=function(_0x59eefb,_0x2151ce){_0x59eefb=_0x59eefb-0x0;var _0x1a49e8=_0x6d2e[_0x59eefb];return _0x1a49e8;};'use strict';var VoicePrefixEvents=require('./voicePrefix.events');var events=[_0xe6d2('0x0'),_0xe6d2('0x1'),_0xe6d2('0x2')];function createListener(_0x3ff4b6,_0x412889){return function(_0xf81df7){_0x412889['emit'](_0x3ff4b6,_0xf81df7);};}function removeListener(_0x2dee74,_0x5dc6e4){return function(){VoicePrefixEvents['removeListener'](_0x2dee74,_0x5dc6e4);};}exports[_0xe6d2('0x3')]=function(_0x2b4bf0){for(var _0x3c0fab=0x0,_0x4d9c9f=events[_0xe6d2('0x4')];_0x3c0fab<_0x4d9c9f;_0x3c0fab++){var _0x53906e=events[_0x3c0fab];var _0x2e227e=createListener(_0xe6d2('0x5')+_0x53906e,_0x2b4bf0);VoicePrefixEvents['on'](_0x53906e,_0x2e227e);}}; \ No newline at end of file +var _0x2c54=['length','voicePrefix:','./voicePrefix.events','save','remove','emit','register'];(function(_0xed6352,_0x57a783){var _0x4f83a0=function(_0x46a33d){while(--_0x46a33d){_0xed6352['push'](_0xed6352['shift']());}};_0x4f83a0(++_0x57a783);}(_0x2c54,0x136));var _0x42c5=function(_0x732ddb,_0xf2467a){_0x732ddb=_0x732ddb-0x0;var _0x1eeda0=_0x2c54[_0x732ddb];return _0x1eeda0;};'use strict';var VoicePrefixEvents=require(_0x42c5('0x0'));var events=[_0x42c5('0x1'),_0x42c5('0x2'),'update'];function createListener(_0xbe3529,_0x46bcc4){return function(_0x3d5e1d){_0x46bcc4[_0x42c5('0x3')](_0xbe3529,_0x3d5e1d);};}function removeListener(_0x2407d0,_0x17924f){return function(){VoicePrefixEvents['removeListener'](_0x2407d0,_0x17924f);};}exports[_0x42c5('0x4')]=function(_0x551181){for(var _0x4d9ed4=0x0,_0x1959c1=events[_0x42c5('0x5')];_0x4d9ed4<_0x1959c1;_0x4d9ed4++){var _0x38d528=events[_0x4d9ed4];var _0x134cb6=createListener(_0x42c5('0x6')+_0x38d528,_0x551181);VoicePrefixEvents['on'](_0x38d528,_0x134cb6);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index 2afc772..a8246d6 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 _0x1db7=['/:id/blacklists','addBlackLists','put','/:id','delete','destroy','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','path','connect-timeout','express','Router','fs-extra','../../config/environment','./voiceQueue.controller','get','index','isAuthenticated','/:id/hoppers','getHoppers','getHopperHistories','/:id/hopper_finals','getHopperFinals','getHopperBlacks','/:id/users','getAgents','/:id/members','getMembers','getLists','getBlackLists','post','create','/:id/clone','clone','/:id/teams','addTeams','addAgents','/:id/lists'];(function(_0xae7c2f,_0xf31e04){var _0x5d7001=function(_0x4eeadb){while(--_0x4eeadb){_0xae7c2f['push'](_0xae7c2f['shift']());}};_0x5d7001(++_0xf31e04);}(_0x1db7,0x131));var _0x71db=function(_0x11d8e4,_0x33e1bd){_0x11d8e4=_0x11d8e4-0x0;var _0x28b1ca=_0x1db7[_0x11d8e4];return _0x28b1ca;};'use strict';var multer=require(_0x71db('0x0'));var util=require('util');var path=require(_0x71db('0x1'));var timeout=require(_0x71db('0x2'));var express=require(_0x71db('0x3'));var router=express[_0x71db('0x4')]();var fs_extra=require(_0x71db('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x71db('0x6'));var controller=require(_0x71db('0x7'));router[_0x71db('0x8')]('/',auth['isAuthenticated'](),controller[_0x71db('0x9')]);router[_0x71db('0x8')]('/:id',auth[_0x71db('0xa')](),controller['show']);router[_0x71db('0x8')](_0x71db('0xb'),auth[_0x71db('0xa')](),controller[_0x71db('0xc')]);router[_0x71db('0x8')]('/:id/hopper_histories',auth[_0x71db('0xa')](),controller[_0x71db('0xd')]);router[_0x71db('0x8')](_0x71db('0xe'),auth[_0x71db('0xa')](),controller[_0x71db('0xf')]);router['get']('/:id/hopper_black',auth['isAuthenticated'](),controller[_0x71db('0x10')]);router[_0x71db('0x8')]('/:id/teams',auth[_0x71db('0xa')](),controller['getTeams']);router[_0x71db('0x8')](_0x71db('0x11'),auth[_0x71db('0xa')](),controller[_0x71db('0x12')]);router['get'](_0x71db('0x13'),auth[_0x71db('0xa')](),controller[_0x71db('0x14')]);router[_0x71db('0x8')]('/:id/lists',auth[_0x71db('0xa')](),controller[_0x71db('0x15')]);router[_0x71db('0x8')]('/:id/blacklists',auth[_0x71db('0xa')](),controller[_0x71db('0x16')]);router[_0x71db('0x17')]('/',auth[_0x71db('0xa')](),controller[_0x71db('0x18')]);router[_0x71db('0x17')](_0x71db('0x19'),auth[_0x71db('0xa')](),controller[_0x71db('0x1a')]);router[_0x71db('0x17')](_0x71db('0x1b'),auth['isAuthenticated'](),controller[_0x71db('0x1c')]);router[_0x71db('0x17')](_0x71db('0x11'),auth[_0x71db('0xa')](),controller[_0x71db('0x1d')]);router[_0x71db('0x17')](_0x71db('0x1e'),auth['isAuthenticated'](),controller['addLists']);router[_0x71db('0x17')](_0x71db('0x1f'),auth[_0x71db('0xa')](),controller[_0x71db('0x20')]);router[_0x71db('0x21')](_0x71db('0x22'),auth[_0x71db('0xa')](),controller['update']);router[_0x71db('0x23')](_0x71db('0x22'),auth[_0x71db('0xa')](),controller[_0x71db('0x24')]);router['delete'](_0x71db('0x1b'),auth['isAuthenticated'](),controller[_0x71db('0x25')]);router['delete'](_0x71db('0x11'),auth[_0x71db('0xa')](),controller[_0x71db('0x26')]);router[_0x71db('0x23')]('/:id/lists',auth[_0x71db('0xa')](),controller[_0x71db('0x27')]);router[_0x71db('0x23')](_0x71db('0x1f'),auth[_0x71db('0xa')](),controller[_0x71db('0x28')]);module[_0x71db('0x29')]=router; \ No newline at end of file +var _0x3694=['destroy','delete','removeAgents','removeLists','removeBlackLists','exports','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','isAuthenticated','index','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/teams','getTeams','/:id/users','/:id/members','getMembers','/:id/blacklists','getBlackLists','/:id/clone','clone','post','/:id/lists','addLists','addBlackLists','put','update'];(function(_0x304b58,_0x42c729){var _0x4aec3a=function(_0x5bdd94){while(--_0x5bdd94){_0x304b58['push'](_0x304b58['shift']());}};_0x4aec3a(++_0x42c729);}(_0x3694,0x1e6));var _0x4369=function(_0x53f282,_0x2e2d20){_0x53f282=_0x53f282-0x0;var _0x188ffb=_0x3694[_0x53f282];return _0x188ffb;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4369('0x0'));var timeout=require('connect-timeout');var express=require(_0x4369('0x1'));var router=express['Router']();var fs_extra=require(_0x4369('0x2'));var auth=require(_0x4369('0x3'));var interaction=require(_0x4369('0x4'));var config=require(_0x4369('0x5'));var controller=require(_0x4369('0x6'));router[_0x4369('0x7')]('/',auth[_0x4369('0x8')](),controller[_0x4369('0x9')]);router[_0x4369('0x7')]('/:id',auth[_0x4369('0x8')](),controller[_0x4369('0xa')]);router[_0x4369('0x7')](_0x4369('0xb'),auth['isAuthenticated'](),controller[_0x4369('0xc')]);router[_0x4369('0x7')](_0x4369('0xd'),auth['isAuthenticated'](),controller[_0x4369('0xe')]);router[_0x4369('0x7')](_0x4369('0xf'),auth['isAuthenticated'](),controller[_0x4369('0x10')]);router[_0x4369('0x7')](_0x4369('0x11'),auth['isAuthenticated'](),controller[_0x4369('0x12')]);router['get'](_0x4369('0x13'),auth[_0x4369('0x8')](),controller[_0x4369('0x14')]);router[_0x4369('0x7')](_0x4369('0x15'),auth[_0x4369('0x8')](),controller['getAgents']);router[_0x4369('0x7')](_0x4369('0x16'),auth[_0x4369('0x8')](),controller[_0x4369('0x17')]);router[_0x4369('0x7')]('/:id/lists',auth[_0x4369('0x8')](),controller['getLists']);router[_0x4369('0x7')](_0x4369('0x18'),auth['isAuthenticated'](),controller[_0x4369('0x19')]);router['post']('/',auth[_0x4369('0x8')](),controller['create']);router['post'](_0x4369('0x1a'),auth[_0x4369('0x8')](),controller[_0x4369('0x1b')]);router[_0x4369('0x1c')](_0x4369('0x13'),auth['isAuthenticated'](),controller['addTeams']);router[_0x4369('0x1c')](_0x4369('0x15'),auth[_0x4369('0x8')](),controller['addAgents']);router[_0x4369('0x1c')](_0x4369('0x1d'),auth[_0x4369('0x8')](),controller[_0x4369('0x1e')]);router['post']('/:id/blacklists',auth['isAuthenticated'](),controller[_0x4369('0x1f')]);router[_0x4369('0x20')]('/:id',auth['isAuthenticated'](),controller[_0x4369('0x21')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x4369('0x22')]);router[_0x4369('0x23')](_0x4369('0x13'),auth['isAuthenticated'](),controller['removeTeams']);router[_0x4369('0x23')](_0x4369('0x15'),auth[_0x4369('0x8')](),controller[_0x4369('0x24')]);router['delete'](_0x4369('0x1d'),auth['isAuthenticated'](),controller[_0x4369('0x25')]);router[_0x4369('0x23')](_0x4369('0x18'),auth[_0x4369('0x8')](),controller[_0x4369('0x26')]);module[_0x4369('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 f325d6a..671201d 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 _0x4d61=['Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','sequelize','exports','STRING','name','ENUM','inbound','outbound','ringall','leastrecent','fewestcalls','random','rrmemory','wrandom','setDataValue','strategy','getDataValue','type','dialMethod','booked','roundrobin','progressive','predictive','power','INTEGER','yes','all','periodic_announce','join','split','joinempty','leavewhenempty','BOOLEAN','wrapuptime','preview','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','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)','#Congestion\x20Retry\x20(min:1,\x20max:999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\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)'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x4d61,0x147));var _0x14d6=function(_0x55d91,_0x351fae){_0x55d91=_0x55d91-0x0;var _0x46d0b3=_0x4d61[_0x55d91];return _0x46d0b3;};'use strict';var Sequelize=require(_0x14d6('0x0'));module[_0x14d6('0x1')]={'name':{'type':Sequelize[_0x14d6('0x2')],'allowNull':![],'unique':_0x14d6('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x14d6('0x4')](_0x14d6('0x5'),_0x14d6('0x6')),'allowNull':![],'defaultValue':_0x14d6('0x5')},'musiconhold':{'type':Sequelize[_0x14d6('0x2')],'defaultValue':'default'},'announce':{'type':Sequelize[_0x14d6('0x2')],'defaultValue':''},'strategy':{'type':Sequelize[_0x14d6('0x4')]('rr',_0x14d6('0x7'),_0x14d6('0x8'),_0x14d6('0x9'),_0x14d6('0xa'),_0x14d6('0xb'),'linear',_0x14d6('0xc'),'rrordered'),'allowNull':![],'defaultValue':_0x14d6('0x7'),'set':function(_0x590979){this[_0x14d6('0xd')](_0x14d6('0xe'),_0x590979?_0x590979:'rrmemory');},'get':function(){var _0x16db02=this[_0x14d6('0xf')](_0x14d6('0x10'));var _0x1c2baf=this[_0x14d6('0xf')](_0x14d6('0x11'));var _0x36a070=this[_0x14d6('0xf')](_0x14d6('0xe'));if(_0x16db02===_0x14d6('0x5')){return _0x36a070;}if(_0x1c2baf===_0x14d6('0x12')&&_0x36a070==='rrmemory'||_0x1c2baf===_0x14d6('0x12')&&_0x36a070===_0x14d6('0x13')){return _0x36a070;}if(_0x1c2baf===_0x14d6('0x14')||_0x1c2baf===_0x14d6('0x15')||_0x1c2baf===_0x14d6('0x16')){return _0x36a070;}return null;}},'servicelevel':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x14d6('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x14d6('0x17')](0xb)},'timeout':{'type':Sequelize[_0x14d6('0x17')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x14d6('0x17')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize['STRING']},'weight':{'type':Sequelize[_0x14d6('0x17')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x14d6('0x17')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x14d6('0x4')]('yes','no'),'defaultValue':_0x14d6('0x18')},'autopause':{'type':Sequelize[_0x14d6('0x4')](_0x14d6('0x18'),'no',_0x14d6('0x19')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x14d6('0x17')](0xb)},'autopausebusy':{'type':Sequelize[_0x14d6('0x4')](_0x14d6('0x18'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x14d6('0x4')](_0x14d6('0x18'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x14d6('0x17')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x14d6('0x4')]('yes','no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x14d6('0x4')](_0x14d6('0x18'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x14d6('0x4')]('yes','no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x14d6('0x4')](_0x14d6('0x18'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize['STRING'],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x14d6('0x17')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x14d6('0x4')](_0x14d6('0x18'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x14d6('0x4')](_0x14d6('0x18'),'no'),'defaultValue':_0x14d6('0x18')},'announce_holdtime':{'type':Sequelize[_0x14d6('0x4')](_0x14d6('0x18'),'no','once'),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x14d6('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x14d6('0x4')](_0x14d6('0x18'),'no')},'announce_position_limit':{'type':Sequelize['INTEGER'](0xb)},'announce_round_seconds':{'type':Sequelize[_0x14d6('0x4')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x14d6('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x14d6('0x2')]},'queue_youarenext':{'type':Sequelize[_0x14d6('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x14d6('0x2')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x14d6('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x14d6('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x14d6('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x14d6('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x14d6('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x14d6('0x2')]},'queue_quantity1':{'type':Sequelize[_0x14d6('0x2')]},'queue_quantity2':{'type':Sequelize[_0x14d6('0x2')]},'queue_periodic_announce':{'type':Sequelize[_0x14d6('0x2')]},'queue_less_than':{'type':Sequelize['STRING']},'periodic_announce':{'type':Sequelize['TEXT'],'set':function(_0x15d098){this[_0x14d6('0xd')](_0x14d6('0x1a'),_0x15d098?_0x15d098[_0x14d6('0x1b')](','):[]);},'get':function(){return this['getDataValue'](_0x14d6('0x1a'))?this[_0x14d6('0xf')](_0x14d6('0x1a'))[_0x14d6('0x1c')](','):[];}},'joinempty':{'type':Sequelize[_0x14d6('0x2')],'defaultValue':'yes','set':function(_0xde044d){this['setDataValue'](_0x14d6('0x1d'),_0xde044d?_0xde044d[_0x14d6('0x1b')](','):undefined);},'get':function(){return this[_0x14d6('0xf')](_0x14d6('0x1d'))?this[_0x14d6('0xf')](_0x14d6('0x1d'))['split'](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x14d6('0x2')],'defaultValue':'no','set':function(_0x1e4a29){this[_0x14d6('0xd')](_0x14d6('0x1e'),_0x1e4a29?_0x1e4a29[_0x14d6('0x1b')](','):undefined);},'get':function(){return this['getDataValue'](_0x14d6('0x1e'))?this[_0x14d6('0xf')](_0x14d6('0x1e'))[_0x14d6('0x1c')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x14d6('0x4')](_0x14d6('0x18'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x14d6('0x4')](_0x14d6('0x18'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x14d6('0x17')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x14d6('0x2')]},'description':{'type':Sequelize['STRING']},'acw':{'type':Sequelize[_0x14d6('0x1f')],'defaultValue':0x0,'set':function(_0xd31054){this['setDataValue']('acw',_0xd31054);if(_0xd31054){if(this[_0x14d6('0xf')]('wrapuptime')<0x2){this[_0x14d6('0xd')](_0x14d6('0x20'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x14d6('0x17')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x14d6('0x1f')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'dialMethod':{'type':Sequelize[_0x14d6('0x4')](_0x14d6('0x21'),_0x14d6('0x14'),_0x14d6('0x16'),'predictive',_0x14d6('0x12')),'defaultValue':'progressive','comment':'Dial\x20Method.'},'dialLimitChannel':{'type':Sequelize[_0x14d6('0x17')](0x4)[_0x14d6('0x22')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x14d6('0x23')},'dialLimitQueue':{'type':Sequelize[_0x14d6('0x17')](0x4)[_0x14d6('0x22')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x14d6('0x24')},'dialPowerLevel':{'type':Sequelize[_0x14d6('0x25')](0x2)[_0x14d6('0x22')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x14d6('0x26')},'dialPredictiveOptimization':{'type':Sequelize[_0x14d6('0x4')](_0x14d6('0x27'),_0x14d6('0x28')),'defaultValue':_0x14d6('0x28'),'comment':_0x14d6('0x29')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x14d6('0x25')](0x2)[_0x14d6('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x14d6('0x2a')},'dialPredictiveInterval':{'type':Sequelize[_0x14d6('0x17')](0x3)[_0x14d6('0x22')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x14d6('0x2b')},'dialOriginateCallerIdName':{'type':Sequelize[_0x14d6('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x14d6('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x14d6('0x17')](0x3)[_0x14d6('0x22')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x14d6('0x2c')},'dialQueueOptions':{'type':Sequelize[_0x14d6('0x2')],'defaultValue':_0x14d6('0x2d'),'comment':_0x14d6('0x2e')},'dialQueueTimeout':{'type':Sequelize[_0x14d6('0x17')](0x3)[_0x14d6('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x14d6('0x2f')},'dialQueueProject':{'type':Sequelize['STRING'],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x14d6('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x14d6('0x30')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x14d6('0x17')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0x14d6('0x17')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x14d6('0x31')},'dialBusyRetryFrequency':{'type':Sequelize[_0x14d6('0x17')](0x5)[_0x14d6('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x14d6('0x32')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x14d6('0x17')](0x3)[_0x14d6('0x22')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x14d6('0x17')](0x5)[_0x14d6('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x14d6('0x33')},'dialGlobalMaxRetry':{'type':Sequelize[_0x14d6('0x17')](0x3)[_0x14d6('0x22')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x14d6('0x34')},'dialTimezone':{'type':Sequelize[_0x14d6('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0x14d6('0x35')},'dialPrefix':{'type':Sequelize[_0x14d6('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x14d6('0x4')](_0x14d6('0x36'),'never',_0x14d6('0x37')),'defaultValue':_0x14d6('0x36')},'dialAMDActive':{'type':Sequelize[_0x14d6('0x1f')],'defaultValue':0x0,'comment':_0x14d6('0x38')},'dialAMDInitialSilence':{'type':Sequelize[_0x14d6('0x17')](0x9)[_0x14d6('0x22')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x14d6('0x39')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0x14d6('0x22')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x14d6('0x3a')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x14d6('0x17')](0x9)[_0x14d6('0x22')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x14d6('0x3b')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0x14d6('0x22')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x14d6('0x3c')},'dialAMDMinWordLength':{'type':Sequelize[_0x14d6('0x17')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x14d6('0x3d')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x14d6('0x17')](0x9)[_0x14d6('0x22')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x14d6('0x3e')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x14d6('0x17')](0x5)[_0x14d6('0x22')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x14d6('0x22')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x14d6('0x3f')},'dialRecallMeTimeout':{'type':Sequelize[_0x14d6('0x17')](0x5)[_0x14d6('0x22')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x14d6('0x40')},'dialRecallInQueue':{'type':Sequelize[_0x14d6('0x1f')],'defaultValue':0x0,'comment':_0x14d6('0x41')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0x14d6('0x42'),'ASC'),'defaultValue':_0x14d6('0x42')},'dialQueueProject2':{'type':Sequelize['STRING'],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialAgiAfterHangupClient':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x14d6('0x1f')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x14d6('0x17')](0x3)[_0x14d6('0x22')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x14d6('0x43')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x14d6('0x22')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x14d6('0x44')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x14d6('0x17')](0x3)[_0x14d6('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x14d6('0x45')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x14d6('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0x14d6('0x17')](0x3)[_0x14d6('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x14d6('0x46')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x14d6('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x14d6('0x47')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x14d6('0x17')](0x3)[_0x14d6('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x14d6('0x48')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x14d6('0x17')](0x5)[_0x14d6('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x14d6('0x49')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x14d6('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x14d6('0x4a')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x14d6('0x22')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x14d6('0x4b')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x14d6('0x17')](0x3)[_0x14d6('0x22')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x14d6('0x4c')},'dialAgentRejectRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x14d6('0x4d')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x14d6('0x17')],'allowNull':!![],'comment':_0x14d6('0x4e')},'mandatoryDisposition':{'type':Sequelize[_0x14d6('0x1f')],'defaultValue':![],'comment':_0x14d6('0x4f'),'set':function(_0x43bcf3){if(!_0x43bcf3)this[_0x14d6('0xd')](_0x14d6('0x50'),null);this[_0x14d6('0xd')]('mandatoryDisposition',_0x43bcf3);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x14d6('0x17')](0x3)['UNSIGNED'],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x14d6('0x17')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}}}; \ No newline at end of file +var _0x4397=['predictive','power','INTEGER','yes','all','once','periodic_announce','split','joinempty','join','leavewhenempty','BOOLEAN','acw','wrapuptime','Active/Disactive\x20Campaign','preview','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','never','onlyIfOpen','always','Active/Disactive\x20AMD','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#RecallMe\x20Timeout\x20(min:1)','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)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','name','ENUM','outbound','inbound','default','leastrecent','fewestcalls','rrmemory','linear','wrandom','rrordered','setDataValue','strategy','type','getDataValue','dialMethod','booked','progressive'];(function(_0x2ccede,_0x44cbb1){var _0x114b13=function(_0x3b6191){while(--_0x3b6191){_0x2ccede['push'](_0x2ccede['shift']());}};_0x114b13(++_0x44cbb1);}(_0x4397,0xe4));var _0x7439=function(_0x2defb5,_0x1cda14){_0x2defb5=_0x2defb5-0x0;var _0x229c53=_0x4397[_0x2defb5];return _0x229c53;};'use strict';var Sequelize=require(_0x7439('0x0'));module[_0x7439('0x1')]={'name':{'type':Sequelize[_0x7439('0x2')],'allowNull':![],'unique':_0x7439('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x7439('0x4')]('inbound',_0x7439('0x5')),'allowNull':![],'defaultValue':_0x7439('0x6')},'musiconhold':{'type':Sequelize[_0x7439('0x2')],'defaultValue':_0x7439('0x7')},'announce':{'type':Sequelize[_0x7439('0x2')],'defaultValue':''},'strategy':{'type':Sequelize['ENUM']('rr','ringall',_0x7439('0x8'),_0x7439('0x9'),'random',_0x7439('0xa'),_0x7439('0xb'),_0x7439('0xc'),_0x7439('0xd')),'allowNull':![],'defaultValue':'ringall','set':function(_0x2a7bcb){this[_0x7439('0xe')](_0x7439('0xf'),_0x2a7bcb?_0x2a7bcb:_0x7439('0xa'));},'get':function(){var _0x1593d6=this['getDataValue'](_0x7439('0x10'));var _0x29a4ef=this[_0x7439('0x11')](_0x7439('0x12'));var _0x18da18=this['getDataValue']('strategy');if(_0x1593d6==='inbound'){return _0x18da18;}if(_0x29a4ef==='booked'&&_0x18da18===_0x7439('0xa')||_0x29a4ef===_0x7439('0x13')&&_0x18da18==='roundrobin'){return _0x18da18;}if(_0x29a4ef===_0x7439('0x14')||_0x29a4ef===_0x7439('0x15')||_0x29a4ef===_0x7439('0x16')){return _0x18da18;}return null;}},'servicelevel':{'type':Sequelize[_0x7439('0x17')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x7439('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize['INTEGER'](0xb)},'timeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x7439('0x17')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x7439('0x2')]},'weight':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x7439('0x4')](_0x7439('0x18'),'no'),'defaultValue':_0x7439('0x18')},'autopause':{'type':Sequelize['ENUM'](_0x7439('0x18'),'no',_0x7439('0x19')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x7439('0x17')](0xb)},'autopausebusy':{'type':Sequelize[_0x7439('0x4')](_0x7439('0x18'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x7439('0x4')](_0x7439('0x18'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x7439('0x4')](_0x7439('0x18'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x7439('0x4')](_0x7439('0x18'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x7439('0x4')](_0x7439('0x18'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x7439('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x7439('0x17')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x7439('0x17')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x7439('0x17')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x7439('0x4')](_0x7439('0x18'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize['ENUM'](_0x7439('0x18'),'no'),'defaultValue':'yes'},'announce_holdtime':{'type':Sequelize[_0x7439('0x4')](_0x7439('0x18'),'no',_0x7439('0x1a')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x7439('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize['ENUM'](_0x7439('0x18'),'no')},'announce_position_limit':{'type':Sequelize[_0x7439('0x17')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x7439('0x4')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x7439('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x7439('0x2')]},'queue_youarenext':{'type':Sequelize[_0x7439('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x7439('0x2')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x7439('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x7439('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x7439('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize['STRING'],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x7439('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x7439('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x7439('0x2')]},'queue_quantity1':{'type':Sequelize['STRING']},'queue_quantity2':{'type':Sequelize[_0x7439('0x2')]},'queue_periodic_announce':{'type':Sequelize[_0x7439('0x2')]},'queue_less_than':{'type':Sequelize[_0x7439('0x2')]},'periodic_announce':{'type':Sequelize['TEXT'],'set':function(_0x445464){this[_0x7439('0xe')]('periodic_announce',_0x445464?_0x445464['join'](','):[]);},'get':function(){return this[_0x7439('0x11')](_0x7439('0x1b'))?this['getDataValue'](_0x7439('0x1b'))[_0x7439('0x1c')](','):[];}},'joinempty':{'type':Sequelize['STRING'],'defaultValue':_0x7439('0x18'),'set':function(_0x20488a){this[_0x7439('0xe')](_0x7439('0x1d'),_0x20488a?_0x20488a[_0x7439('0x1e')](','):undefined);},'get':function(){return this[_0x7439('0x11')](_0x7439('0x1d'))?this[_0x7439('0x11')]('joinempty')[_0x7439('0x1c')](','):undefined;}},'leavewhenempty':{'type':Sequelize['STRING'],'defaultValue':'no','set':function(_0x3a3ae4){this['setDataValue'](_0x7439('0x1f'),_0x3a3ae4?_0x3a3ae4['join'](','):undefined);},'get':function(){return this[_0x7439('0x11')](_0x7439('0x1f'))?this['getDataValue'](_0x7439('0x1f'))[_0x7439('0x1c')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x7439('0x4')](_0x7439('0x18'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x7439('0x4')]('yes','no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x7439('0x17')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x7439('0x4')](_0x7439('0x18'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x7439('0x2')]},'description':{'type':Sequelize[_0x7439('0x2')]},'acw':{'type':Sequelize[_0x7439('0x20')],'defaultValue':0x0,'set':function(_0x33c5cf){this[_0x7439('0xe')](_0x7439('0x21'),_0x33c5cf);if(_0x33c5cf){if(this[_0x7439('0x11')](_0x7439('0x22'))<0x2){this[_0x7439('0xe')](_0x7439('0x22'),0x2);}}}},'acwTimeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x7439('0x20')],'defaultValue':0x0,'comment':_0x7439('0x23')},'dialMethod':{'type':Sequelize[_0x7439('0x4')](_0x7439('0x24'),_0x7439('0x14'),_0x7439('0x16'),_0x7439('0x15'),_0x7439('0x13')),'defaultValue':_0x7439('0x14'),'comment':'Dial\x20Method.'},'dialLimitChannel':{'type':Sequelize[_0x7439('0x17')](0x4)[_0x7439('0x25')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x7439('0x26')},'dialLimitQueue':{'type':Sequelize['INTEGER'](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x7439('0x27')},'dialPowerLevel':{'type':Sequelize[_0x7439('0x28')](0x2)[_0x7439('0x25')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x7439('0x29')},'dialPredictiveOptimization':{'type':Sequelize[_0x7439('0x4')](_0x7439('0x2a'),_0x7439('0x2b')),'defaultValue':'dropRate','comment':'Only\x20for\x20predictive\x20method.'},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x7439('0x28')](0x2)[_0x7439('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x7439('0x2c')},'dialPredictiveInterval':{'type':Sequelize['INTEGER'](0x3)[_0x7439('0x25')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x7439('0x2d')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x7439('0x2')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x7439('0x25')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueOptions':{'type':Sequelize[_0x7439('0x2')],'defaultValue':_0x7439('0x2e'),'comment':_0x7439('0x2f')},'dialQueueTimeout':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7439('0x30')},'dialQueueProject':{'type':Sequelize['STRING'],'comment':_0x7439('0x31')},'dialCongestionMaxRetry':{'type':Sequelize[_0x7439('0x17')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7439('0x32')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x7439('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7439('0x33')},'dialBusyMaxRetry':{'type':Sequelize[_0x7439('0x17')](0x3)[_0x7439('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7439('0x34')},'dialBusyRetryFrequency':{'type':Sequelize[_0x7439('0x17')](0x5)[_0x7439('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7439('0x35')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x7439('0x17')](0x3)[_0x7439('0x25')],'defaultValue':0x3,'comment':_0x7439('0x36')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x7439('0x17')](0x5)[_0x7439('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7439('0x37')},'dialGlobalMaxRetry':{'type':Sequelize[_0x7439('0x17')](0x3)[_0x7439('0x25')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x7439('0x38')},'dialTimezone':{'type':Sequelize[_0x7439('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0x7439('0x39')},'dialPrefix':{'type':Sequelize[_0x7439('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x7439('0x4')]('always',_0x7439('0x3a'),_0x7439('0x3b')),'defaultValue':_0x7439('0x3c')},'dialAMDActive':{'type':Sequelize[_0x7439('0x20')],'defaultValue':0x0,'comment':_0x7439('0x3d')},'dialAMDInitialSilence':{'type':Sequelize[_0x7439('0x17')](0x9)[_0x7439('0x25')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x7439('0x17')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x7439('0x17')](0x9)[_0x7439('0x25')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x7439('0x17')](0x9)[_0x7439('0x25')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x7439('0x3e')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x7439('0x25')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x7439('0x3f')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x7439('0x17')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x7439('0x40')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0x7439('0x25')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x7439('0x41')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x7439('0x17')](0x5)[_0x7439('0x25')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x7439('0x42')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x7439('0x17')](0x9)[_0x7439('0x25')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialRecallMeTimeout':{'type':Sequelize[_0x7439('0x17')](0x5)[_0x7439('0x25')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x7439('0x43')},'dialRecallInQueue':{'type':Sequelize[_0x7439('0x20')],'defaultValue':0x0,'comment':_0x7439('0x44')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM']('DESC','ASC'),'defaultValue':_0x7439('0x45')},'dialQueueProject2':{'type':Sequelize[_0x7439('0x2')],'comment':_0x7439('0x31')},'dialAgiAfterHangupClient':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x7439('0x20')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0x7439('0x25')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x7439('0x46')},'dialCutDigit':{'type':Sequelize[_0x7439('0x17')](0x3)[_0x7439('0x25')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x7439('0x47')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x7439('0x17')](0x3)[_0x7439('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7439('0x48')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x7439('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7439('0x49')},'dialDropMaxRetry':{'type':Sequelize[_0x7439('0x17')](0x3)[_0x7439('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7439('0x4a')},'dialDropRetryFrequency':{'type':Sequelize[_0x7439('0x17')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7439('0x4b')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x7439('0x17')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7439('0x4c')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x7439('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7439('0x4d')},'dialMachineMaxRetry':{'type':Sequelize[_0x7439('0x17')](0x3)[_0x7439('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x7439('0x17')](0x5)[_0x7439('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x7439('0x4e')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x7439('0x17')](0x3)[_0x7439('0x25')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x7439('0x4f')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x7439('0x17')](0x5)[_0x7439('0x25')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'mandatoryDispositionPauseId':{'type':Sequelize[_0x7439('0x17')],'allowNull':!![],'comment':_0x7439('0x50')},'mandatoryDisposition':{'type':Sequelize[_0x7439('0x20')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x2b8951){if(!_0x2b8951)this['setDataValue'](_0x7439('0x51'),null);this['setDataValue'](_0x7439('0x52'),_0x2b8951);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x7439('0x17')](0x3)[_0x7439('0x25')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x7439('0x17')](0x3)[_0x7439('0x25')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index a73d817..0ef90b1 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 _0x90c9=['findOne','VoiceQueueId','CmHopper','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','addTeams','teams','online','voicePause','interface','flatMap','Agents','penalty','TeamVoiceQueue','upsert','each','UserVoiceQueue','findOrCreate','format','SIP/%s','forEach','userVoiceQueue:save','removeTeams','ids','User','select','field','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','push','sequelize','every','TeamId','union','removeAgents','emit','addAgents','omit','spread','isEmpty','UserVoiceQueueRt','isNil','all','userVoiceQueue:remove','getAgents','getMembers','getLists','addLists','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','ListId','phone','NOW()','CmListId','toString','cm_contacts','phone\x20IS\x20NOT\x20NULL','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','phone\x20NOT\x20IN\x20(?)','COALESCE(phone,\x27\x27)','onlyIfOpen','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','removeLists','getBlackLists','CmList','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','fast-json-patch','moment','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','VoiceQueues','inbound','outbound','filter','ignore','map','value','includes','type','find','name','UserProfileResource','end','error','stack','VoiceQueue','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','rawAttributes','includeAll','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','QueueCampaigns','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','createdAt','updatedAt','body','getHoppers'];(function(_0x1c83c9,_0x2a0efc){var _0x49c840=function(_0x2945e2){while(--_0x2945e2){_0x1c83c9['push'](_0x1c83c9['shift']());}};_0x49c840(++_0x2a0efc);}(_0x90c9,0x1c6));var _0x990c=function(_0x4c2d60,_0x92e137){_0x4c2d60=_0x4c2d60-0x0;var _0x29664f=_0x90c9[_0x4c2d60];return _0x29664f;};'use strict';var emlformat=require(_0x990c('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x990c('0x1'));var rp=require('request-promise');var moment=require(_0x990c('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x990c('0x3'));var util=require(_0x990c('0x4'));var path=require('path');var sox=require(_0x990c('0x5'));var csv=require(_0x990c('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x990c('0x7'));var _=require(_0x990c('0x8'));var squel=require(_0x990c('0x9'));var crypto=require(_0x990c('0xa'));var jsforce=require(_0x990c('0xb'));var deskjs=require(_0x990c('0xc'));var toCsv=require(_0x990c('0x6'));var querystring=require(_0x990c('0xd'));var Papa=require(_0x990c('0xe'));var Redis=require('ioredis');var authService=require(_0x990c('0xf'));var qs=require(_0x990c('0x10'));var as=require(_0x990c('0x11'));var hardwareService=require(_0x990c('0x12'));var logger=require(_0x990c('0x13'))(_0x990c('0x14'));var utils=require(_0x990c('0x15'));var config=require(_0x990c('0x16'));var licenseUtil=require(_0x990c('0x17'));var db=require(_0x990c('0x18'))['db'];config[_0x990c('0x19')]=_[_0x990c('0x1a')](config[_0x990c('0x19')],{'host':_0x990c('0x1b'),'port':0x18eb});var socket=require(_0x990c('0x1c'))(new Redis(config['redis']));require(_0x990c('0x1d'))['register'](socket);function respondWithStatusCode(_0x46437e,_0x53b2f8){_0x53b2f8=_0x53b2f8||0xcc;return function(_0x57bfb9){if(_0x57bfb9){return _0x46437e[_0x990c('0x1e')](_0x53b2f8);}return _0x46437e[_0x990c('0x1f')](_0x53b2f8)['end']();};}function respondWithResult(_0x347703,_0x5aa0b7){_0x5aa0b7=_0x5aa0b7||0xc8;return function(_0x2c46fc){if(_0x2c46fc){return _0x347703[_0x990c('0x1f')](_0x5aa0b7)[_0x990c('0x20')](_0x2c46fc);}};}function respondWithFilteredResult(_0x27cd7f,_0x58c5a3){return function(_0x10e03a){if(_0x10e03a){var _0x6f436d=typeof _0x58c5a3[_0x990c('0x21')]===_0x990c('0x22')&&typeof _0x58c5a3[_0x990c('0x23')]===_0x990c('0x22');var _0x46e382=_0x10e03a[_0x990c('0x24')];var _0x356501=_0x6f436d?0x0:_0x58c5a3[_0x990c('0x21')];var _0x58fb3a=_0x6f436d?_0x10e03a['count']:_0x58c5a3['offset']+_0x58c5a3[_0x990c('0x23')];var _0x4ea7f2;if(_0x58fb3a>=_0x46e382){_0x58fb3a=_0x46e382;_0x4ea7f2=0xc8;}else{_0x4ea7f2=0xce;}_0x27cd7f[_0x990c('0x1f')](_0x4ea7f2);return _0x27cd7f[_0x990c('0x25')](_0x990c('0x26'),_0x356501+'-'+_0x58fb3a+'/'+_0x46e382)[_0x990c('0x20')](_0x10e03a);}return null;};}function patchUpdates(_0x972fa6){return function(_0xa52c62){try{jsonpatch[_0x990c('0x27')](_0xa52c62,_0x972fa6,!![]);}catch(_0x264fd8){return BPromise[_0x990c('0x28')](_0x264fd8);}return _0xa52c62[_0x990c('0x29')]();};}function saveUpdates(_0x126ddf,_0x7bdbc7){return function(_0x881097){if(_0x881097){return _0x881097[_0x990c('0x2a')](_0x126ddf)[_0x990c('0x2b')](function(_0x50e54b){return _0x50e54b;});}return null;};}function removeEntity(_0x114558,_0x333165){return function(_0x564290){if(_0x564290){return _0x564290[_0x990c('0x2c')]()[_0x990c('0x2b')](function(){var _0x110cc5=_0x564290['get']({'plain':!![]});var _0x59c3a9=[{'name':_0x990c('0x2d'),'value':_0x990c('0x2e'),'ignore':![]},{'name':'QueueCampaigns','value':_0x990c('0x2f'),'ignore':![]}];var _0x38c21f=_(_0x59c3a9)[_0x990c('0x30')](_0x990c('0x31'))[_0x990c('0x32')](_0x990c('0x33'))[_0x990c('0x33')]();if(_[_0x990c('0x34')](_0x38c21f,_0x110cc5[_0x990c('0x35')])){return;}var _0x4a0a6f=_[_0x990c('0x36')](_0x59c3a9,['value',_0x110cc5[_0x990c('0x35')]])[_0x990c('0x37')];return db[_0x990c('0x38')]['destroy']({'where':{'type':_0x4a0a6f,'resourceId':_0x110cc5['id']}})['then'](function(){return _0x564290;});})[_0x990c('0x2b')](function(){_0x114558['status'](0xcc)[_0x990c('0x39')]();});}};}function handleEntityNotFound(_0x1dcaa2,_0x2f4df6){return function(_0x592b1f){if(!_0x592b1f){_0x1dcaa2[_0x990c('0x1e')](0x194);}return _0x592b1f;};}function handleError(_0x5c1b3c,_0x172518){_0x172518=_0x172518||0x1f4;return function(_0x12f290){logger[_0x990c('0x3a')](_0x12f290[_0x990c('0x3b')]);if(_0x12f290[_0x990c('0x37')]){delete _0x12f290[_0x990c('0x37')];}_0x5c1b3c[_0x990c('0x1f')](_0x172518)['send'](_0x12f290);};}exports['index']=function(_0x4a194f,_0x4e6729){var _0x45842e={},_0x165936={},_0x855c83={'count':0x0,'rows':[]};var _0x5d39d6=_[_0x990c('0x32')](db[_0x990c('0x3c')]['rawAttributes'],function(_0x4e3f58){return{'name':_0x4e3f58[_0x990c('0x3d')],'type':_0x4e3f58[_0x990c('0x35')][_0x990c('0x3e')]};});_0x165936[_0x990c('0x3f')]=_[_0x990c('0x32')](_0x5d39d6,_0x990c('0x37'));_0x165936['query']=_[_0x990c('0x40')](_0x4a194f[_0x990c('0x41')]);_0x165936[_0x990c('0x42')]=_[_0x990c('0x43')](_0x165936[_0x990c('0x3f')],_0x165936['query']);_0x45842e[_0x990c('0x44')]=_[_0x990c('0x43')](_0x165936['model'],qs[_0x990c('0x45')](_0x4a194f['query'][_0x990c('0x45')]));_0x45842e[_0x990c('0x44')]=_0x45842e['attributes'][_0x990c('0x46')]?_0x45842e[_0x990c('0x44')]:_0x165936['model'];if(!_0x4a194f[_0x990c('0x41')][_0x990c('0x47')](_0x990c('0x48'))){_0x45842e[_0x990c('0x23')]=qs[_0x990c('0x23')](_0x4a194f[_0x990c('0x41')][_0x990c('0x23')]);_0x45842e[_0x990c('0x21')]=qs['offset'](_0x4a194f[_0x990c('0x41')][_0x990c('0x21')]);}_0x45842e[_0x990c('0x49')]=qs[_0x990c('0x4a')](_0x4a194f['query']['sort']);_0x45842e[_0x990c('0x4b')]=qs[_0x990c('0x42')](_[_0x990c('0x4c')](_0x4a194f[_0x990c('0x41')],_0x165936['filters']),_0x5d39d6);if(_0x4a194f[_0x990c('0x41')]['filter']){_0x45842e[_0x990c('0x4b')]=_[_0x990c('0x4d')](_0x45842e[_0x990c('0x4b')],{'$or':_[_0x990c('0x32')](_0x5d39d6,function(_0x124d15){if(_0x124d15[_0x990c('0x35')]!==_0x990c('0x4e')){var _0x595a7b={};_0x595a7b[_0x124d15[_0x990c('0x37')]]={'$like':'%'+_0x4a194f[_0x990c('0x41')][_0x990c('0x30')]+'%'};return _0x595a7b;}})});}_0x45842e=_[_0x990c('0x4d')]({},_0x45842e,_0x4a194f[_0x990c('0x4f')]);var _0x2a3d01={'where':_0x45842e[_0x990c('0x4b')]};return db['VoiceQueue']['count'](_0x2a3d01)[_0x990c('0x2b')](function(_0x2f73bc){_0x855c83[_0x990c('0x24')]=_0x2f73bc;if(_0x4a194f[_0x990c('0x41')]['includeAll']){_0x45842e[_0x990c('0x50')]=[{'all':!![]}];}return db['VoiceQueue'][_0x990c('0x51')](_0x45842e);})[_0x990c('0x2b')](function(_0x2bf419){_0x855c83[_0x990c('0x52')]=_0x2bf419;return _0x855c83;})[_0x990c('0x2b')](respondWithFilteredResult(_0x4e6729,_0x45842e))[_0x990c('0x53')](handleError(_0x4e6729,null));};exports[_0x990c('0x54')]=function(_0x4b03c9,_0x26cd12){var _0x2d842c={'raw':![],'where':{'id':_0x4b03c9[_0x990c('0x55')]['id']}},_0x48a885={};_0x48a885['model']=_[_0x990c('0x40')](db[_0x990c('0x3c')][_0x990c('0x56')]);_0x48a885[_0x990c('0x41')]=_[_0x990c('0x40')](_0x4b03c9[_0x990c('0x41')]);_0x48a885[_0x990c('0x42')]=_['intersection'](_0x48a885[_0x990c('0x3f')],_0x48a885['query']);_0x2d842c[_0x990c('0x44')]=_[_0x990c('0x43')](_0x48a885[_0x990c('0x3f')],qs['fields'](_0x4b03c9[_0x990c('0x41')][_0x990c('0x45')]));_0x2d842c['attributes']=_0x2d842c[_0x990c('0x44')]['length']?_0x2d842c['attributes']:_0x48a885[_0x990c('0x3f')];if(_0x4b03c9['query'][_0x990c('0x57')]){_0x2d842c['include']=[{'all':!![]}];}_0x2d842c=_['merge']({},_0x2d842c,_0x4b03c9[_0x990c('0x4f')]);return db['VoiceQueue'][_0x990c('0x36')](_0x2d842c)[_0x990c('0x2b')](handleEntityNotFound(_0x26cd12,null))['then'](respondWithResult(_0x26cd12,null))[_0x990c('0x53')](handleError(_0x26cd12,null));};exports[_0x990c('0x58')]=function(_0x193d7e,_0xebe95){return db[_0x990c('0x3c')][_0x990c('0x58')](_0x193d7e['body'],{})[_0x990c('0x2b')](function(_0x21cf9f){var _0x40f014=_0x193d7e['user'][_0x990c('0x59')]({'plain':!![]});if(!_0x40f014)throw new Error(_0x990c('0x5a'));if(_0x40f014[_0x990c('0x5b')]===_0x990c('0x5c')){var _0x383d97=_0x21cf9f[_0x990c('0x59')]({'plain':!![]});var _0x44bd01=[{'name':_0x990c('0x2d'),'value':_0x990c('0x2e')},{'name':_0x990c('0x5d'),'value':'outbound'}];var _0x26c49d=_[_0x990c('0x36')](_0x44bd01,[_0x990c('0x33'),_0x383d97['type']])[_0x990c('0x37')];return db['UserProfileSection'][_0x990c('0x36')]({'where':{'name':_0x26c49d,'userProfileId':_0x40f014[_0x990c('0x5e')]},'raw':!![]})[_0x990c('0x2b')](function(_0x295869){if(_0x295869&&_0x295869[_0x990c('0x5f')]===0x0){return db[_0x990c('0x38')][_0x990c('0x58')]({'name':_0x383d97[_0x990c('0x37')],'resourceId':_0x383d97['id'],'type':_0x295869['name'],'sectionId':_0x295869['id']},{})[_0x990c('0x2b')](function(){return _0x21cf9f;});}else{return _0x21cf9f;}})['catch'](function(_0x3a76fd){logger['error'](_0x990c('0x60'),_0x3a76fd);throw _0x3a76fd;});}return _0x21cf9f;})[_0x990c('0x2b')](respondWithResult(_0xebe95,0xc9))['catch'](handleError(_0xebe95,null));};exports['clone']=function(_0x808a84,_0x402634){var _0x15bd31={'where':{'id':_0x808a84[_0x990c('0x55')]['id']}},_0x4cee6a={};_0x4cee6a[_0x990c('0x3f')]=_[_0x990c('0x40')](db['VoiceQueue'][_0x990c('0x56')]);_0x15bd31[_0x990c('0x44')]=_[_0x990c('0x43')](_0x4cee6a['model'],qs[_0x990c('0x45')](_0x808a84[_0x990c('0x41')][_0x990c('0x45')]));_0x15bd31[_0x990c('0x44')]=_0x15bd31[_0x990c('0x44')]['length']?_0x15bd31['attributes']:_0x4cee6a['model'];if(_0x808a84['query']['includeAll']){_0x15bd31['include']=[{'all':!![]}];}_0x15bd31=_[_0x990c('0x4d')]({},_0x15bd31,_0x808a84['options']);return db[_0x990c('0x3c')][_0x990c('0x36')](_0x15bd31)['then'](handleEntityNotFound(_0x402634,null))[_0x990c('0x2b')](function(_0xba9fe){if(_0xba9fe){var _0x377cd4=_0xba9fe[_0x990c('0x59')]({'plain':!![]});_0x377cd4=qs['omit'](_0x377cd4,['id',_0x990c('0x61'),_0x990c('0x62')]);_0x808a84[_0x990c('0x63')]=_['omit'](_0x808a84[_0x990c('0x63')],['id',_0x990c('0x61'),'updatedAt']);return db[_0x990c('0x3c')][_0x990c('0x58')](_['merge'](_0x377cd4,_0x808a84[_0x990c('0x63')]),{'include':_0x808a84[_0x990c('0x41')][_0x990c('0x57')]?[{'all':!![]}]:undefined})[_0x990c('0x2b')](function(_0x129b9b){var _0x4c789b=_0x808a84['user']['get']({'plain':!![]});if(!_0x4c789b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4c789b['role']===_0x990c('0x5c')){var _0xe58f4e=_0x129b9b['get']({'plain':!![]});var _0x3e9383=[{'name':_0x990c('0x2d'),'value':_0x990c('0x2e')},{'name':_0x990c('0x5d'),'value':_0x990c('0x2f')}];var _0x4d18cc=_['find'](_0x3e9383,[_0x990c('0x33'),_0xe58f4e['type']])[_0x990c('0x37')];return db['UserProfileSection'][_0x990c('0x36')]({'where':{'name':_0x4d18cc,'userProfileId':_0x4c789b[_0x990c('0x5e')]},'raw':!![]})[_0x990c('0x2b')](function(_0x1c6693){if(_0x1c6693&&_0x1c6693[_0x990c('0x5f')]===0x0){return db[_0x990c('0x38')]['create']({'name':_0xe58f4e[_0x990c('0x37')],'resourceId':_0xe58f4e['id'],'type':_0x1c6693[_0x990c('0x37')],'sectionId':_0x1c6693['id']},{})[_0x990c('0x2b')](function(){return _0x129b9b;});}else{return _0x129b9b;}})[_0x990c('0x53')](function(_0x58de72){logger[_0x990c('0x3a')](_0x990c('0x60'),_0x58de72);throw _0x58de72;});}return _0x129b9b;});}})[_0x990c('0x2b')](respondWithResult(_0x402634,0xc9))[_0x990c('0x53')](handleError(_0x402634,null));};exports[_0x990c('0x2a')]=function(_0x17827a,_0x29b6a7){if(_0x17827a['body']['id']){delete _0x17827a[_0x990c('0x63')]['id'];}return db[_0x990c('0x3c')][_0x990c('0x36')]({'where':{'id':_0x17827a['params']['id']}})[_0x990c('0x2b')](handleEntityNotFound(_0x29b6a7,null))[_0x990c('0x2b')](saveUpdates(_0x17827a[_0x990c('0x63')],null))[_0x990c('0x2b')](respondWithResult(_0x29b6a7,null))[_0x990c('0x53')](handleError(_0x29b6a7,null));};exports[_0x990c('0x2c')]=function(_0x45eab3,_0x33afc4){return db[_0x990c('0x3c')][_0x990c('0x36')]({'where':{'id':_0x45eab3['params']['id']}})[_0x990c('0x2b')](handleEntityNotFound(_0x33afc4,null))[_0x990c('0x2b')](removeEntity(_0x33afc4,null))[_0x990c('0x53')](handleError(_0x33afc4,null));};exports[_0x990c('0x64')]=function(_0x13f3ab,_0x2762e8,_0x2f71b8){var _0xa3d830={'raw':![],'where':{}};var _0x1a00ec={};var _0x487a81={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x990c('0x65')]({'where':{'id':_0x13f3ab[_0x990c('0x55')]['id']}})[_0x990c('0x2b')](handleEntityNotFound(_0x2762e8,null))[_0x990c('0x2b')](function(_0x2fc5ce){if(_0x2fc5ce){_0x1a00ec[_0x990c('0x3f')]=_['keys'](db['CmHopper'][_0x990c('0x56')]);_0x1a00ec[_0x990c('0x41')]=_['keys'](_0x13f3ab[_0x990c('0x41')]);_0x1a00ec['filters']=_['intersection'](_0x1a00ec[_0x990c('0x3f')],_0x1a00ec[_0x990c('0x41')]);_0xa3d830[_0x990c('0x44')]=_['intersection'](_0x1a00ec[_0x990c('0x3f')],qs[_0x990c('0x45')](_0x13f3ab['query'][_0x990c('0x45')]));_0xa3d830[_0x990c('0x44')]=_0xa3d830[_0x990c('0x44')]['length']?_0xa3d830['attributes']:_0x1a00ec['model'];if(!_0x13f3ab['query'][_0x990c('0x47')]('nolimit')){_0xa3d830[_0x990c('0x23')]=qs[_0x990c('0x23')](_0x13f3ab['query'][_0x990c('0x23')]);_0xa3d830[_0x990c('0x21')]=qs[_0x990c('0x21')](_0x13f3ab[_0x990c('0x41')][_0x990c('0x21')]);}_0xa3d830[_0x990c('0x49')]=qs[_0x990c('0x4a')](_0x13f3ab[_0x990c('0x41')][_0x990c('0x4a')]);_0xa3d830['where']=qs[_0x990c('0x42')](_['pick'](_0x13f3ab['query'],_0x1a00ec[_0x990c('0x42')]));_0xa3d830[_0x990c('0x4b')][_0x990c('0x66')]=_0x2fc5ce['id'];if(_0x13f3ab[_0x990c('0x41')][_0x990c('0x30')]){_0xa3d830[_0x990c('0x4b')]=_['merge'](_0xa3d830[_0x990c('0x4b')],{'$or':_['map'](_0xa3d830[_0x990c('0x44')],function(_0x4b3d9c){var _0x2bccf4={};_0x2bccf4[_0x4b3d9c]={'$like':'%'+_0x13f3ab[_0x990c('0x41')][_0x990c('0x30')]+'%'};return _0x2bccf4;})});}_0xa3d830=_[_0x990c('0x4d')]({},_0xa3d830,_0x13f3ab['options']);return db[_0x990c('0x67')]['count']({'where':_0xa3d830[_0x990c('0x4b')]})[_0x990c('0x2b')](function(_0x47466d){_0x487a81['count']=_0x47466d;if(_0x13f3ab[_0x990c('0x41')][_0x990c('0x57')]){_0xa3d830[_0x990c('0x50')]=[{'all':!![]}];}return db[_0x990c('0x67')][_0x990c('0x51')](_0xa3d830);})[_0x990c('0x2b')](function(_0x2e8d5f){_0x487a81[_0x990c('0x52')]=_0x2e8d5f;return _0x487a81;});}})[_0x990c('0x2b')](respondWithFilteredResult(_0x2762e8,_0xa3d830))[_0x990c('0x53')](handleError(_0x2762e8,null));};exports['getHopperHistories']=function(_0x28eae8,_0x3850c5,_0x4cb850){var _0x2bfac2={'raw':!![],'where':{}};var _0x2694a3={};var _0x2d9efd={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x990c('0x65')]({'where':{'id':_0x28eae8['params']['id']}})['then'](handleEntityNotFound(_0x3850c5,null))['then'](function(_0x453f74){if(_0x453f74){_0x2694a3['model']=_[_0x990c('0x40')](db[_0x990c('0x68')][_0x990c('0x56')]);_0x2694a3[_0x990c('0x41')]=_[_0x990c('0x40')](_0x28eae8['query']);_0x2694a3[_0x990c('0x42')]=_[_0x990c('0x43')](_0x2694a3[_0x990c('0x3f')],_0x2694a3[_0x990c('0x41')]);_0x2bfac2['attributes']=_['intersection'](_0x2694a3[_0x990c('0x3f')],qs['fields'](_0x28eae8[_0x990c('0x41')][_0x990c('0x45')]));_0x2bfac2[_0x990c('0x44')]=_0x2bfac2[_0x990c('0x44')][_0x990c('0x46')]?_0x2bfac2[_0x990c('0x44')]:_0x2694a3[_0x990c('0x3f')];if(!_0x28eae8[_0x990c('0x41')]['hasOwnProperty'](_0x990c('0x48'))){_0x2bfac2[_0x990c('0x23')]=qs[_0x990c('0x23')](_0x28eae8['query'][_0x990c('0x23')]);_0x2bfac2[_0x990c('0x21')]=qs[_0x990c('0x21')](_0x28eae8[_0x990c('0x41')][_0x990c('0x21')]);}_0x2bfac2[_0x990c('0x49')]=qs[_0x990c('0x4a')](_0x28eae8['query'][_0x990c('0x4a')]);_0x2bfac2[_0x990c('0x4b')]=qs[_0x990c('0x42')](_[_0x990c('0x4c')](_0x28eae8['query'],_0x2694a3[_0x990c('0x42')]));_0x2bfac2[_0x990c('0x4b')][_0x990c('0x66')]=_0x453f74['id'];if(_0x28eae8['query'][_0x990c('0x30')]){_0x2bfac2[_0x990c('0x4b')]=_[_0x990c('0x4d')](_0x2bfac2[_0x990c('0x4b')],{'$or':_['map'](_0x2bfac2['attributes'],function(_0x3d1a2e){var _0x5c1592={};_0x5c1592[_0x3d1a2e]={'$like':'%'+_0x28eae8[_0x990c('0x41')][_0x990c('0x30')]+'%'};return _0x5c1592;})});}_0x2bfac2=_[_0x990c('0x4d')]({},_0x2bfac2,_0x28eae8[_0x990c('0x4f')]);return db[_0x990c('0x68')]['count']({'where':_0x2bfac2[_0x990c('0x4b')]})[_0x990c('0x2b')](function(_0x302ad8){_0x2d9efd[_0x990c('0x24')]=_0x302ad8;if(_0x28eae8['query'][_0x990c('0x57')]){_0x2bfac2[_0x990c('0x50')]=[{'all':!![]}];}return db[_0x990c('0x68')]['findAll'](_0x2bfac2);})[_0x990c('0x2b')](function(_0x41133f){_0x2d9efd[_0x990c('0x52')]=_0x41133f;return _0x2d9efd;});}})['then'](respondWithFilteredResult(_0x3850c5,_0x2bfac2))['catch'](handleError(_0x3850c5,null));};exports[_0x990c('0x69')]=function(_0x4b8571,_0x258fa9,_0xc9964f){var _0x2692c0={'raw':!![],'where':{}};var _0xd30a65={};var _0x53b143={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x990c('0x65')]({'where':{'id':_0x4b8571[_0x990c('0x55')]['id']}})[_0x990c('0x2b')](handleEntityNotFound(_0x258fa9,null))[_0x990c('0x2b')](function(_0x531f5a){if(_0x531f5a){_0xd30a65[_0x990c('0x3f')]=_[_0x990c('0x40')](db[_0x990c('0x6a')]['rawAttributes']);_0xd30a65[_0x990c('0x41')]=_[_0x990c('0x40')](_0x4b8571[_0x990c('0x41')]);_0xd30a65['filters']=_['intersection'](_0xd30a65['model'],_0xd30a65[_0x990c('0x41')]);_0x2692c0[_0x990c('0x44')]=_[_0x990c('0x43')](_0xd30a65[_0x990c('0x3f')],qs[_0x990c('0x45')](_0x4b8571[_0x990c('0x41')][_0x990c('0x45')]));_0x2692c0[_0x990c('0x44')]=_0x2692c0[_0x990c('0x44')][_0x990c('0x46')]?_0x2692c0['attributes']:_0xd30a65['model'];if(!_0x4b8571[_0x990c('0x41')][_0x990c('0x47')](_0x990c('0x48'))){_0x2692c0[_0x990c('0x23')]=qs['limit'](_0x4b8571[_0x990c('0x41')][_0x990c('0x23')]);_0x2692c0[_0x990c('0x21')]=qs[_0x990c('0x21')](_0x4b8571['query'][_0x990c('0x21')]);}_0x2692c0[_0x990c('0x49')]=qs[_0x990c('0x4a')](_0x4b8571[_0x990c('0x41')]['sort']);_0x2692c0['where']=qs['filters'](_[_0x990c('0x4c')](_0x4b8571[_0x990c('0x41')],_0xd30a65[_0x990c('0x42')]));_0x2692c0[_0x990c('0x4b')][_0x990c('0x66')]=_0x531f5a['id'];if(_0x4b8571[_0x990c('0x41')]['filter']){_0x2692c0[_0x990c('0x4b')]=_[_0x990c('0x4d')](_0x2692c0[_0x990c('0x4b')],{'$or':_[_0x990c('0x32')](_0x2692c0[_0x990c('0x44')],function(_0x4b8f11){var _0x5c6e72={};_0x5c6e72[_0x4b8f11]={'$like':'%'+_0x4b8571[_0x990c('0x41')][_0x990c('0x30')]+'%'};return _0x5c6e72;})});}_0x2692c0=_[_0x990c('0x4d')]({},_0x2692c0,_0x4b8571['options']);return db[_0x990c('0x6a')][_0x990c('0x24')]({'where':_0x2692c0[_0x990c('0x4b')]})[_0x990c('0x2b')](function(_0x3b536d){_0x53b143[_0x990c('0x24')]=_0x3b536d;if(_0x4b8571[_0x990c('0x41')][_0x990c('0x57')]){_0x2692c0[_0x990c('0x50')]=[{'all':!![]}];}return db[_0x990c('0x6a')]['findAll'](_0x2692c0);})[_0x990c('0x2b')](function(_0x2bfdc6){_0x53b143[_0x990c('0x52')]=_0x2bfdc6;return _0x53b143;});}})[_0x990c('0x2b')](respondWithFilteredResult(_0x258fa9,_0x2692c0))[_0x990c('0x53')](handleError(_0x258fa9,null));};exports[_0x990c('0x6b')]=function(_0x1024df,_0x2376ea,_0x537527){var _0x379441={'raw':!![],'where':{}};var _0xbc75ba={};var _0x2ed21c={'count':0x0,'rows':[]};return db[_0x990c('0x3c')][_0x990c('0x65')]({'where':{'id':_0x1024df[_0x990c('0x55')]['id']}})[_0x990c('0x2b')](handleEntityNotFound(_0x2376ea,null))[_0x990c('0x2b')](function(_0x2be0ad){if(_0x2be0ad){_0xbc75ba[_0x990c('0x3f')]=_[_0x990c('0x40')](db[_0x990c('0x6c')][_0x990c('0x56')]);_0xbc75ba[_0x990c('0x41')]=_[_0x990c('0x40')](_0x1024df[_0x990c('0x41')]);_0xbc75ba[_0x990c('0x42')]=_[_0x990c('0x43')](_0xbc75ba[_0x990c('0x3f')],_0xbc75ba[_0x990c('0x41')]);_0x379441[_0x990c('0x44')]=_['intersection'](_0xbc75ba['model'],qs[_0x990c('0x45')](_0x1024df['query'][_0x990c('0x45')]));_0x379441[_0x990c('0x44')]=_0x379441[_0x990c('0x44')][_0x990c('0x46')]?_0x379441[_0x990c('0x44')]:_0xbc75ba[_0x990c('0x3f')];if(!_0x1024df[_0x990c('0x41')]['hasOwnProperty']('nolimit')){_0x379441[_0x990c('0x23')]=qs[_0x990c('0x23')](_0x1024df[_0x990c('0x41')]['limit']);_0x379441[_0x990c('0x21')]=qs[_0x990c('0x21')](_0x1024df[_0x990c('0x41')]['offset']);}_0x379441[_0x990c('0x49')]=qs[_0x990c('0x4a')](_0x1024df[_0x990c('0x41')][_0x990c('0x4a')]);_0x379441['where']=qs[_0x990c('0x42')](_['pick'](_0x1024df[_0x990c('0x41')],_0xbc75ba[_0x990c('0x42')]));_0x379441[_0x990c('0x4b')]['VoiceQueueId']=_0x2be0ad['id'];if(_0x1024df['query'][_0x990c('0x30')]){_0x379441[_0x990c('0x4b')]=_['merge'](_0x379441[_0x990c('0x4b')],{'$or':_[_0x990c('0x32')](_0x379441[_0x990c('0x44')],function(_0x1bfd1b){var _0x176804={};_0x176804[_0x1bfd1b]={'$like':'%'+_0x1024df[_0x990c('0x41')][_0x990c('0x30')]+'%'};return _0x176804;})});}_0x379441=_[_0x990c('0x4d')]({},_0x379441,_0x1024df[_0x990c('0x4f')]);return db[_0x990c('0x6c')][_0x990c('0x24')]({'where':_0x379441[_0x990c('0x4b')]})['then'](function(_0x142e70){_0x2ed21c[_0x990c('0x24')]=_0x142e70;if(_0x1024df[_0x990c('0x41')][_0x990c('0x57')]){_0x379441[_0x990c('0x50')]=[{'all':!![]}];}return db['CmHopperBlack'][_0x990c('0x51')](_0x379441);})[_0x990c('0x2b')](function(_0x150c11){_0x2ed21c['rows']=_0x150c11;return _0x2ed21c;});}})[_0x990c('0x2b')](respondWithFilteredResult(_0x2376ea,_0x379441))[_0x990c('0x53')](handleError(_0x2376ea,null));};exports[_0x990c('0x6d')]=function(_0x16ed48,_0x2aac56,_0x4d4d94){var _0x5f071a={};var _0x10461e={};var _0x5d1c1a;var _0x1855b3;return db[_0x990c('0x3c')][_0x990c('0x65')]({'where':{'id':_0x16ed48[_0x990c('0x55')]['id']}})['then'](handleEntityNotFound(_0x2aac56,null))['then'](function(_0x18a128){if(_0x18a128){_0x5d1c1a=_0x18a128;_0x10461e[_0x990c('0x3f')]=_[_0x990c('0x40')](db[_0x990c('0x6e')][_0x990c('0x56')]);_0x10461e[_0x990c('0x41')]=_[_0x990c('0x40')](_0x16ed48[_0x990c('0x41')]);_0x10461e['filters']=_[_0x990c('0x43')](_0x10461e[_0x990c('0x3f')],_0x10461e[_0x990c('0x41')]);_0x5f071a[_0x990c('0x44')]=_[_0x990c('0x43')](_0x10461e[_0x990c('0x3f')],qs['fields'](_0x16ed48[_0x990c('0x41')][_0x990c('0x45')]));_0x5f071a[_0x990c('0x44')]=_0x5f071a['attributes'][_0x990c('0x46')]?_0x5f071a[_0x990c('0x44')]:_0x10461e[_0x990c('0x3f')];_0x5f071a[_0x990c('0x49')]=qs[_0x990c('0x4a')](_0x16ed48[_0x990c('0x41')][_0x990c('0x4a')]);_0x5f071a[_0x990c('0x4b')]=qs['filters'](_['pick'](_0x16ed48[_0x990c('0x41')],_0x10461e[_0x990c('0x42')]));if(_0x16ed48[_0x990c('0x41')][_0x990c('0x30')]){_0x5f071a[_0x990c('0x4b')]=_[_0x990c('0x4d')](_0x5f071a['where'],{'$or':_[_0x990c('0x32')](_0x5f071a[_0x990c('0x44')],function(_0x2ab228){var _0x376054={};_0x376054[_0x2ab228]={'$like':'%'+_0x16ed48[_0x990c('0x41')][_0x990c('0x30')]+'%'};return _0x376054;})});}_0x5f071a=_[_0x990c('0x4d')]({},_0x5f071a,_0x16ed48[_0x990c('0x4f')]);return _0x5d1c1a[_0x990c('0x6d')](_0x5f071a);}})[_0x990c('0x2b')](function(_0x47923b){if(_0x47923b){_0x1855b3=_0x47923b[_0x990c('0x46')];if(!_0x16ed48[_0x990c('0x41')][_0x990c('0x47')]('nolimit')){_0x5f071a[_0x990c('0x23')]=qs[_0x990c('0x23')](_0x16ed48[_0x990c('0x41')][_0x990c('0x23')]);_0x5f071a[_0x990c('0x21')]=qs[_0x990c('0x21')](_0x16ed48['query'][_0x990c('0x21')]);}return _0x5d1c1a['getTeams'](_0x5f071a);}})[_0x990c('0x2b')](function(_0x29d2dc){if(_0x29d2dc){return _0x29d2dc?{'count':_0x1855b3,'rows':_0x29d2dc}:null;}})[_0x990c('0x2b')](respondWithResult(_0x2aac56,null))[_0x990c('0x53')](handleError(_0x2aac56,null));};exports[_0x990c('0x6f')]=function(_0x443441,_0x549ed,_0x1d0ddd){var _0x4c6cb5=_0x443441['body'][_0x990c('0x70')];var _0x22d406=_[_0x990c('0x32')](_0x4c6cb5,'id');return db[_0x990c('0x6e')][_0x990c('0x51')]({'where':{'id':_0x22d406},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id',_0x990c('0x37'),_0x990c('0x71'),_0x990c('0x72'),_0x990c('0x73')],'raw':!![]}]})[_0x990c('0x2b')](function(_0x2817a2){if(_0x2817a2){var _0x57449a=_[_0x990c('0x74')](_0x2817a2,function(_0x1fff00){var _0x482c48=_0x1fff00[_0x990c('0x59')]({'plain':!![]});_0x482c48[_0x990c('0x75')]['forEach'](function(_0x2e8652){_0x2e8652[_0x990c('0x76')]=_[_0x990c('0x36')](_0x4c6cb5,{'id':_0x482c48['id']})[_0x990c('0x76')];});return _0x482c48['Agents'];});return db[_0x990c('0x3c')]['find']({'where':{'id':_0x443441[_0x990c('0x55')]['id']}})[_0x990c('0x2b')](function(_0x138d61){return db['sequelize']['transaction'](function(_0xbcdf3e){return _0x138d61[_0x990c('0x6f')](_0x22d406,{'transaction':_0xbcdf3e})[_0x990c('0x2b')](function(){return BPromise['each'](_0x4c6cb5,function(_0x42c333){return db[_0x990c('0x77')][_0x990c('0x78')]({'TeamId':_0x42c333['id'],'VoiceQueueId':_0x443441['params']['id'],'penalty':_0x42c333[_0x990c('0x76')]},{'transaction':_0xbcdf3e});});})[_0x990c('0x2b')](function(){return BPromise[_0x990c('0x79')](_0x57449a,function(_0x16d146){return db[_0x990c('0x7a')][_0x990c('0x7b')]({'where':{'UserId':_0x16d146['id'],'VoiceQueueId':_0x443441[_0x990c('0x55')]['id']},'defaults':{'penalty':_0x16d146[_0x990c('0x76')]},'transaction':_0xbcdf3e});});})[_0x990c('0x2b')](function(){return BPromise[_0x990c('0x79')](_[_0x990c('0x30')](_0x57449a,{'online':!![]}),function(_0x21304e){return db['UserVoiceQueueRt'][_0x990c('0x78')]({'membername':_0x21304e['name'],'UserId':_0x21304e['id'],'queue_name':_0x138d61[_0x990c('0x37')],'VoiceQueueId':_0x138d61['id'],'interface':_['isNil'](_0x21304e[_0x990c('0x73')])?util[_0x990c('0x7c')](_0x990c('0x7d'),_0x21304e[_0x990c('0x37')]):_0x21304e['interface'],'paused':_0x21304e['voicePause']||![],'penalty':_0x21304e[_0x990c('0x76')]},{'transaction':_0xbcdf3e});});})[_0x990c('0x2b')](function(){_0x57449a[_0x990c('0x7e')](function(_0x18b512){socket['emit'](_0x990c('0x7f'),{'UserId':_0x18b512['id'],'VoiceQueueId':_0x138d61['id']});});});});});}})['then'](respondWithStatusCode(_0x549ed,null))['catch'](handleError(_0x549ed,null));};exports[_0x990c('0x80')]=function(_0x5182f3,_0x3a9d2c,_0x15b877){return db[_0x990c('0x6e')][_0x990c('0x51')]({'where':{'id':_0x5182f3[_0x990c('0x41')][_0x990c('0x81')]},'attributes':['id'],'include':[{'model':db[_0x990c('0x82')],'as':_0x990c('0x75'),'attributes':['id'],'raw':!![]}]})[_0x990c('0x2b')](handleEntityNotFound(_0x3a9d2c,null))[_0x990c('0x2b')](function(_0x3db190){var _0x4ed33b=_[_0x990c('0x32')](_0x3db190,'id');var _0x324f1f=[];var _0x99e936=[];var _0x59f0df=squel[_0x990c('0x83')]();_0x59f0df[_0x990c('0x84')]('tq.TeamId')[_0x990c('0x85')]('team_has_voice_queues','tq')[_0x990c('0x86')](_0x990c('0x87'),'ut',_0x990c('0x88'))[_0x990c('0x4b')](_0x990c('0x89'),_0x5182f3[_0x990c('0x55')]['id']);for(var _0x30cf1b=0x0;_0x30cf1b<_0x3db190[_0x990c('0x46')];_0x30cf1b+=0x1){let _0x379495=_0x3db190[_0x30cf1b];for(var _0x3513f8=0x0;_0x3513f8<_0x379495[_0x990c('0x75')][_0x990c('0x46')];_0x3513f8+=0x1){let _0x3a758b=_0x379495['Agents'][_0x3513f8];var _0x41bd1c=_0x59f0df['clone']();_0x41bd1c[_0x990c('0x4b')]('ut.UserId\x20=\x20?',_0x3a758b['id']);_0x99e936[_0x990c('0x8a')](db[_0x990c('0x8b')][_0x990c('0x41')](_0x41bd1c['toString'](),{'type':db['sequelize']['QueryTypes']['SELECT']})[_0x990c('0x2b')](function(_0x32d695){if(_0x32d695['length']===0x1){return _0x3a758b['id'];}else{var _0x39a89a=_[_0x990c('0x8c')](_[_0x990c('0x32')](_0x32d695,_0x990c('0x8d')),function(_0x5ddab5){return _[_0x990c('0x34')](_0x4ed33b,_0x5ddab5);});if(_0x39a89a){return _0x3a758b['id'];}}}));}}return BPromise['all'](_0x99e936)['then'](function(_0x163e70){_0x324f1f=_(_0x324f1f)[_0x990c('0x8e')](_0x163e70)['compact']()[_0x990c('0x33')]();return db[_0x990c('0x3c')]['find']({'where':{'id':_0x5182f3[_0x990c('0x55')]['id']}})[_0x990c('0x2b')](function(_0x1308e0){return db[_0x990c('0x8b')]['transaction'](function(_0x59141a){return _0x1308e0[_0x990c('0x80')](_0x5182f3['query'][_0x990c('0x81')],{'transaction':_0x59141a})['then'](function(){if(!_['isEmpty'](_0x324f1f)){return _0x1308e0[_0x990c('0x8f')](_0x324f1f,{'transaction':_0x59141a})[_0x990c('0x2b')](function(){return db['UserVoiceQueueRt'][_0x990c('0x2c')]({'where':{'VoiceQueueId':_0x5182f3[_0x990c('0x55')]['id'],'UserId':_0x324f1f},'transaction':_0x59141a});});}})[_0x990c('0x2b')](function(){_0x324f1f[_0x990c('0x7e')](function(_0x4a33d6){socket[_0x990c('0x90')]('userVoiceQueue:remove',{'UserId':_0x4a33d6,'VoiceQueueId':_0x1308e0['id']});});});});});});})['then'](respondWithStatusCode(_0x3a9d2c,null))['catch'](handleError(_0x3a9d2c,null));};exports[_0x990c('0x91')]=function(_0x1244a7,_0x82e15d,_0xaec708){var _0x4e69f8,_0x514da1;return db[_0x990c('0x3c')][_0x990c('0x36')]({'where':{'id':_0x1244a7[_0x990c('0x55')]['id']}})[_0x990c('0x2b')](handleEntityNotFound(_0x82e15d,null))[_0x990c('0x2b')](function(_0x45ad9c){if(_0x45ad9c){_0x514da1=_0x45ad9c;return _0x45ad9c[_0x990c('0x91')](_0x1244a7[_0x990c('0x63')][_0x990c('0x81')],_[_0x990c('0x92')](_0x1244a7[_0x990c('0x63')],[_0x990c('0x81'),'id'])||{})[_0x990c('0x93')](function(_0x2db566){for(var _0x201890=0x0;_0x201890<_0x1244a7['body']['ids'][_0x990c('0x46')];_0x201890+=0x1){socket[_0x990c('0x90')](_0x990c('0x7f'),{'UserId':Number(_0x1244a7[_0x990c('0x63')]['ids'][_0x201890]),'VoiceQueueId':Number(_0x1244a7[_0x990c('0x55')]['id'])});}return _0x2db566;});}})[_0x990c('0x2b')](function(_0x337ece){_0x4e69f8=_0x337ece||[];if(_0x514da1){return db[_0x990c('0x82')][_0x990c('0x51')]({'where':{'id':_0x1244a7[_0x990c('0x63')][_0x990c('0x81')]},'attributes':['id',_0x990c('0x37'),_0x990c('0x71'),_0x990c('0x72'),'interface'],'raw':!![]});}})['then'](function(_0x4aa92b){if(!_[_0x990c('0x94')](_0x4aa92b)){var _0x9b41fa=[];for(var _0x80c1b9=0x0;_0x80c1b9<_0x4aa92b['length'];_0x80c1b9++){if(_0x4aa92b[_0x80c1b9]['online']){_0x9b41fa[_0x990c('0x8a')](db[_0x990c('0x95')][_0x990c('0x78')]({'membername':_0x4aa92b[_0x80c1b9]['name'],'UserId':_0x4aa92b[_0x80c1b9]['id'],'queue_name':_0x514da1[_0x990c('0x37')],'VoiceQueueId':_0x514da1['id'],'interface':_[_0x990c('0x96')](_0x4aa92b[_0x80c1b9][_0x990c('0x73')])?util[_0x990c('0x7c')]('SIP/%s',_0x4aa92b[_0x80c1b9][_0x990c('0x37')]):_0x4aa92b[_0x80c1b9]['interface'],'paused':_0x4aa92b[_0x80c1b9][_0x990c('0x72')]||![],'penalty':_0x1244a7[_0x990c('0x63')]['penalty']||0x0}));}}return BPromise[_0x990c('0x97')](_0x9b41fa);}})[_0x990c('0x2b')](function(){return _0x4e69f8;})[_0x990c('0x2b')](respondWithResult(_0x82e15d,null))['catch'](handleError(_0x82e15d,null));};exports[_0x990c('0x8f')]=function(_0x3017c1,_0x240ff5,_0x13ef8d){return db[_0x990c('0x3c')][_0x990c('0x36')]({'where':{'id':_0x3017c1[_0x990c('0x55')]['id']}})['then'](handleEntityNotFound(_0x240ff5,null))[_0x990c('0x2b')](function(_0x1f421d){if(_0x1f421d){return _0x1f421d['removeAgents'](_0x3017c1[_0x990c('0x41')][_0x990c('0x81')])[_0x990c('0x2b')](function(){if(_['isArray'](_0x3017c1[_0x990c('0x41')][_0x990c('0x81')])){for(var _0x1d10ae=0x0;_0x1d10ae<_0x3017c1[_0x990c('0x41')][_0x990c('0x81')][_0x990c('0x46')];_0x1d10ae+=0x1){socket['emit'](_0x990c('0x98'),{'UserId':Number(_0x3017c1[_0x990c('0x41')]['ids'][_0x1d10ae]),'VoiceQueueId':Number(_0x3017c1[_0x990c('0x55')]['id'])});}}else{socket[_0x990c('0x90')](_0x990c('0x98'),{'UserId':Number(_0x3017c1[_0x990c('0x41')][_0x990c('0x81')]),'VoiceQueueId':Number(_0x3017c1['params']['id'])});}});}})[_0x990c('0x2b')](function(_0x3b3d88){return db[_0x990c('0x95')][_0x990c('0x2c')]({'where':{'VoiceQueueId':_0x3017c1['params']['id'],'UserId':_0x3017c1[_0x990c('0x41')]['ids']}})['then'](function(){return _0x3b3d88;});})[_0x990c('0x2b')](respondWithStatusCode(_0x240ff5,null))[_0x990c('0x53')](handleError(_0x240ff5,null));};exports[_0x990c('0x99')]=function(_0x615337,_0x544bb4,_0x475c1a){var _0x437306={};var _0x2d7024={};var _0xb6570a;var _0x4e77c2;return db[_0x990c('0x3c')][_0x990c('0x65')]({'where':{'id':_0x615337['params']['id']}})['then'](handleEntityNotFound(_0x544bb4,null))[_0x990c('0x2b')](function(_0x4c4b93){if(_0x4c4b93){_0xb6570a=_0x4c4b93;_0x2d7024[_0x990c('0x3f')]=_[_0x990c('0x40')](db[_0x990c('0x82')]['rawAttributes']);_0x2d7024['query']=_[_0x990c('0x40')](_0x615337[_0x990c('0x41')]);_0x2d7024[_0x990c('0x42')]=_[_0x990c('0x43')](_0x2d7024[_0x990c('0x3f')],_0x2d7024[_0x990c('0x41')]);_0x437306['attributes']=_[_0x990c('0x43')](_0x2d7024[_0x990c('0x3f')],qs[_0x990c('0x45')](_0x615337['query'][_0x990c('0x45')]));_0x437306[_0x990c('0x44')]=_0x437306[_0x990c('0x44')][_0x990c('0x46')]?_0x437306[_0x990c('0x44')]:_0x2d7024['model'];_0x437306[_0x990c('0x49')]=qs[_0x990c('0x4a')](_0x615337['query'][_0x990c('0x4a')]);_0x437306['where']=qs['filters'](_[_0x990c('0x4c')](_0x615337['query'],_0x2d7024['filters']));if(_0x615337[_0x990c('0x41')][_0x990c('0x30')]){_0x437306[_0x990c('0x4b')]=_[_0x990c('0x4d')](_0x437306[_0x990c('0x4b')],{'$or':_[_0x990c('0x32')](_0x437306[_0x990c('0x44')],function(_0x2f3075){var _0x95b2c2={};_0x95b2c2[_0x2f3075]={'$like':'%'+_0x615337[_0x990c('0x41')][_0x990c('0x30')]+'%'};return _0x95b2c2;})});}_0x437306=_[_0x990c('0x4d')]({},_0x437306,_0x615337[_0x990c('0x4f')]);return _0xb6570a['getAgents'](_0x437306);}})[_0x990c('0x2b')](function(_0x1baac4){if(_0x1baac4){_0x4e77c2=_0x1baac4[_0x990c('0x46')];if(!_0x615337[_0x990c('0x41')][_0x990c('0x47')](_0x990c('0x48'))){_0x437306[_0x990c('0x23')]=qs[_0x990c('0x23')](_0x615337[_0x990c('0x41')]['limit']);_0x437306[_0x990c('0x21')]=qs['offset'](_0x615337[_0x990c('0x41')][_0x990c('0x21')]);}return _0xb6570a['getAgents'](_0x437306);}})[_0x990c('0x2b')](function(_0x261ab3){if(_0x261ab3){return _0x261ab3?{'count':_0x4e77c2,'rows':_0x261ab3}:null;}})[_0x990c('0x2b')](respondWithResult(_0x544bb4,null))[_0x990c('0x53')](handleError(_0x544bb4,null));};exports[_0x990c('0x9a')]=function(_0x1ee77f,_0x295a07,_0xc0f5f4){var _0x393156={};var _0x436247={};var _0x212785;var _0x48ceb2;return db[_0x990c('0x3c')][_0x990c('0x65')]({'where':{'id':_0x1ee77f[_0x990c('0x55')]['id']}})[_0x990c('0x2b')](handleEntityNotFound(_0x295a07,null))['then'](function(_0x1a3852){if(_0x1a3852){_0x212785=_0x1a3852;_0x436247[_0x990c('0x3f')]=_[_0x990c('0x40')](db[_0x990c('0x95')][_0x990c('0x56')]);_0x436247[_0x990c('0x41')]=_['keys'](_0x1ee77f['query']);_0x436247[_0x990c('0x42')]=_['intersection'](_0x436247[_0x990c('0x3f')],_0x436247[_0x990c('0x41')]);_0x393156[_0x990c('0x44')]=_[_0x990c('0x43')](_0x436247[_0x990c('0x3f')],qs[_0x990c('0x45')](_0x1ee77f[_0x990c('0x41')][_0x990c('0x45')]));_0x393156[_0x990c('0x44')]=_0x393156['attributes']['length']?_0x393156[_0x990c('0x44')]:_0x436247[_0x990c('0x3f')];_0x393156[_0x990c('0x49')]=qs[_0x990c('0x4a')](_0x1ee77f[_0x990c('0x41')]['sort']);_0x393156[_0x990c('0x4b')]=qs[_0x990c('0x42')](_['pick'](_0x1ee77f[_0x990c('0x41')],_0x436247[_0x990c('0x42')]));if(_0x1ee77f[_0x990c('0x41')][_0x990c('0x30')]){_0x393156[_0x990c('0x4b')]=_['merge'](_0x393156[_0x990c('0x4b')],{'$or':_['map'](_0x393156['attributes'],function(_0x5ed087){var _0x37e75a={};_0x37e75a[_0x5ed087]={'$like':'%'+_0x1ee77f[_0x990c('0x41')][_0x990c('0x30')]+'%'};return _0x37e75a;})});}_0x393156=_['merge']({},_0x393156,_0x1ee77f['options']);return _0x212785['getMembers'](_0x393156);}})[_0x990c('0x2b')](function(_0x38c0e6){if(_0x38c0e6){_0x48ceb2=_0x38c0e6['length'];if(!_0x1ee77f[_0x990c('0x41')][_0x990c('0x47')](_0x990c('0x48'))){_0x393156[_0x990c('0x23')]=qs['limit'](_0x1ee77f['query'][_0x990c('0x23')]);_0x393156[_0x990c('0x21')]=qs[_0x990c('0x21')](_0x1ee77f[_0x990c('0x41')][_0x990c('0x21')]);}return _0x212785[_0x990c('0x9a')](_0x393156);}})[_0x990c('0x2b')](function(_0xeceab8){return _0xeceab8?{'count':_0x48ceb2,'rows':_0xeceab8}:null;})[_0x990c('0x2b')](respondWithResult(_0x295a07,null))['catch'](handleError(_0x295a07,null));};exports[_0x990c('0x9b')]=function(_0x1e5ccd,_0x15006a,_0x3c9326){var _0x31683a={};var _0x31144c={};var _0x379428;var _0xd3aa39;return db[_0x990c('0x3c')][_0x990c('0x65')]({'where':{'id':_0x1e5ccd[_0x990c('0x55')]['id']}})['then'](handleEntityNotFound(_0x15006a,null))[_0x990c('0x2b')](function(_0x489358){if(_0x489358){_0x379428=_0x489358;_0x31144c['model']=_[_0x990c('0x40')](db['CmList'][_0x990c('0x56')]);_0x31144c[_0x990c('0x41')]=_[_0x990c('0x40')](_0x1e5ccd[_0x990c('0x41')]);_0x31144c[_0x990c('0x42')]=_[_0x990c('0x43')](_0x31144c[_0x990c('0x3f')],_0x31144c[_0x990c('0x41')]);_0x31683a[_0x990c('0x44')]=_[_0x990c('0x43')](_0x31144c[_0x990c('0x3f')],qs[_0x990c('0x45')](_0x1e5ccd[_0x990c('0x41')][_0x990c('0x45')]));_0x31683a['attributes']=_0x31683a['attributes'][_0x990c('0x46')]?_0x31683a[_0x990c('0x44')]:_0x31144c[_0x990c('0x3f')];_0x31683a[_0x990c('0x49')]=qs['sort'](_0x1e5ccd['query'][_0x990c('0x4a')]);_0x31683a[_0x990c('0x4b')]=qs[_0x990c('0x42')](_[_0x990c('0x4c')](_0x1e5ccd['query'],_0x31144c['filters']));if(_0x1e5ccd['query'][_0x990c('0x30')]){_0x31683a[_0x990c('0x4b')]=_[_0x990c('0x4d')](_0x31683a[_0x990c('0x4b')],{'$or':_[_0x990c('0x32')](_0x31683a[_0x990c('0x44')],function(_0x525736){var _0x1fa533={};_0x1fa533[_0x525736]={'$like':'%'+_0x1e5ccd[_0x990c('0x41')][_0x990c('0x30')]+'%'};return _0x1fa533;})});}_0x31683a=_[_0x990c('0x4d')]({},_0x31683a,_0x1e5ccd[_0x990c('0x4f')]);return _0x379428['getLists'](_0x31683a);}})['then'](function(_0x487d77){if(_0x487d77){_0xd3aa39=_0x487d77['length'];if(!_0x1e5ccd[_0x990c('0x41')][_0x990c('0x47')](_0x990c('0x48'))){_0x31683a[_0x990c('0x23')]=qs[_0x990c('0x23')](_0x1e5ccd[_0x990c('0x41')][_0x990c('0x23')]);_0x31683a[_0x990c('0x21')]=qs['offset'](_0x1e5ccd[_0x990c('0x41')][_0x990c('0x21')]);}return _0x379428[_0x990c('0x9b')](_0x31683a);}})['then'](function(_0x55906c){if(_0x55906c){return _0x55906c?{'count':_0xd3aa39,'rows':_0x55906c}:null;}})[_0x990c('0x2b')](respondWithResult(_0x15006a,null))[_0x990c('0x53')](handleError(_0x15006a,null));};exports[_0x990c('0x9c')]=function(_0x47f240,_0x4b6ea9,_0x3f2422){var _0x48a3e1,_0x2c589c;return db['VoiceQueue']['find']({'where':{'id':_0x47f240[_0x990c('0x55')]['id']}})[_0x990c('0x2b')](handleEntityNotFound(_0x4b6ea9,null))[_0x990c('0x2b')](function(_0x286c0c){if(_0x286c0c){_0x2c589c=_0x286c0c;return _0x286c0c[_0x990c('0x9c')](_0x47f240[_0x990c('0x63')]['ids'],_[_0x990c('0x92')](_0x47f240['body'],[_0x990c('0x81'),'id'])||{});}return null;})[_0x990c('0x93')](function(_0xd1a5c9){var _0x58211c;_0x48a3e1=_0xd1a5c9||[];var _0x57f596=[];if(_0xd1a5c9){for(var _0x50484d=0x0;_0x50484d<_0xd1a5c9[_0x990c('0x46')];_0x50484d+=0x1){var _0x1fea5e=_0xd1a5c9[_0x50484d][_0x990c('0x59')]({'plain':!![]});_0x2c589c[_0x990c('0x9d')]=_0x47f240[_0x990c('0x63')]['dialCheckDuplicateType']?_0x47f240[_0x990c('0x63')]['dialCheckDuplicateType']:_0x2c589c[_0x990c('0x9d')];switch(_0x2c589c[_0x990c('0x9d')]){case _0x990c('0x9e'):_0x58211c=squel[_0x990c('0x9f')]()[_0x990c('0xa0')](_0x990c('0xa1'))[_0x990c('0xa2')](['phone',_0x990c('0xa3'),_0x990c('0xa4'),_0x990c('0xa5'),_0x990c('0x66'),'createdAt',_0x990c('0x62')],squel[_0x990c('0x83')]()[_0x990c('0x84')](_0x990c('0xa6'),'phone')[_0x990c('0x84')](_0x990c('0xa7'),_0x990c('0xa3'))['field']('id',_0x990c('0xa4'))['field'](_0x1fea5e[_0x990c('0xa8')][_0x990c('0xa9')](),_0x990c('0xa5'))[_0x990c('0x84')](_0x47f240[_0x990c('0x55')]['id'][_0x990c('0xa9')](),_0x990c('0x66'))[_0x990c('0x84')](_0x990c('0xa7'),'createdAt')['field'](_0x990c('0xa7'),'updatedAt')[_0x990c('0x85')](_0x990c('0xaa'))[_0x990c('0x4b')]('deletedAt\x20IS\x20NULL')[_0x990c('0x4b')]('ListId\x20=\x20?',_0x1fea5e[_0x990c('0xa8')]['toString']())[_0x990c('0x4b')](_0x990c('0xab'))[_0x990c('0x4b')]('phone\x20NOT\x20IN\x20(?)',squel[_0x990c('0x83')]()['field'](_0x990c('0xac'))['from'](_0x990c('0xad'))['where'](_0x990c('0x89'),_0x47f240[_0x990c('0x55')]['id'][_0x990c('0xa9')]()))[_0x990c('0x4b')](_0x990c('0xae'),squel[_0x990c('0x83')]()['field'](_0x990c('0xaf'))[_0x990c('0x85')](_0x990c('0xa1'))[_0x990c('0x4b')](_0x990c('0x89'),_0x47f240[_0x990c('0x55')]['id'][_0x990c('0xa9')]())))[_0x990c('0xa9')]();break;case _0x990c('0xb0'):_0x58211c=squel[_0x990c('0x9f')]()[_0x990c('0xa0')](_0x990c('0xa1'))[_0x990c('0xa2')]([_0x990c('0xa6'),'scheduledAt',_0x990c('0xa4'),_0x990c('0xa5'),_0x990c('0x66'),'createdAt','updatedAt'],squel['select']()[_0x990c('0x84')](_0x990c('0xa6'),_0x990c('0xa6'))['field'](_0x990c('0xa7'),_0x990c('0xa3'))[_0x990c('0x84')]('id',_0x990c('0xa4'))[_0x990c('0x84')](_0x1fea5e['CmListId']['toString'](),_0x990c('0xa5'))[_0x990c('0x84')](_0x47f240['params']['id'][_0x990c('0xa9')](),_0x990c('0x66'))[_0x990c('0x84')](_0x990c('0xa7'),_0x990c('0x61'))[_0x990c('0x84')](_0x990c('0xa7'),'updatedAt')[_0x990c('0x85')](_0x990c('0xaa'))[_0x990c('0x4b')](_0x990c('0xb1'))[_0x990c('0x4b')]('ListId\x20=\x20?',_0x1fea5e[_0x990c('0xa8')][_0x990c('0xa9')]())[_0x990c('0x4b')](_0x990c('0xab'))['where'](_0x990c('0xae'),squel[_0x990c('0x83')]()['field'](_0x990c('0xaf'))['from'](_0x990c('0xa1'))['where'](_0x990c('0x89'),_0x47f240[_0x990c('0x55')]['id'][_0x990c('0xa9')]())))[_0x990c('0xa9')]();break;default:_0x58211c=squel[_0x990c('0x9f')]()['into'](_0x990c('0xa1'))['fromQuery'](['phone',_0x990c('0xa3'),_0x990c('0xa4'),_0x990c('0xa5'),_0x990c('0x66'),_0x990c('0x61'),_0x990c('0x62')],squel[_0x990c('0x83')]()[_0x990c('0x84')](_0x990c('0xa6'),_0x990c('0xa6'))[_0x990c('0x84')]('NOW()',_0x990c('0xa3'))[_0x990c('0x84')]('id',_0x990c('0xa4'))['field'](_0x1fea5e[_0x990c('0xa8')][_0x990c('0xa9')](),'ListId')[_0x990c('0x84')](_0x47f240[_0x990c('0x55')]['id']['toString'](),'VoiceQueueId')[_0x990c('0x84')](_0x990c('0xa7'),_0x990c('0x61'))[_0x990c('0x84')](_0x990c('0xa7'),_0x990c('0x62'))['from']('cm_contacts')[_0x990c('0x4b')](_0x990c('0xb1'))[_0x990c('0x4b')](_0x990c('0xb2'),_0x1fea5e[_0x990c('0xa8')]['toString']())[_0x990c('0x4b')](_0x990c('0xab')))[_0x990c('0xa9')]();}_0x57f596['push'](db[_0x990c('0x8b')]['query'](_0x58211c));}return BPromise[_0x990c('0x97')](_0x57f596);}})['then'](function(){return _0x48a3e1;})[_0x990c('0x2b')](respondWithResult(_0x4b6ea9,null))[_0x990c('0x53')](handleError(_0x4b6ea9,null));};exports[_0x990c('0xb3')]=function(_0x161a3e,_0x41c142,_0x401534){return db[_0x990c('0x3c')][_0x990c('0x36')]({'where':{'id':_0x161a3e[_0x990c('0x55')]['id']}})[_0x990c('0x2b')](handleEntityNotFound(_0x41c142,null))[_0x990c('0x2b')](function(_0x5243d2){if(_0x5243d2){return _0x5243d2[_0x990c('0xb3')](_0x161a3e['query'][_0x990c('0x81')]);}})[_0x990c('0x2b')](function(_0x4774b5){if(_0x4774b5){return db[_0x990c('0x67')][_0x990c('0x2c')]({'where':{'ListId':_0x161a3e['query'][_0x990c('0x81')],'VoiceQueueId':_0x161a3e[_0x990c('0x55')]['id']}})[_0x990c('0x2b')](function(){return _0x4774b5;});}})['then'](respondWithStatusCode(_0x41c142,null))['catch'](handleError(_0x41c142,null));};exports[_0x990c('0xb4')]=function(_0x3cea89,_0x4a3772,_0x18b0bf){var _0xd703cb={};var _0x2ffc11={};var _0x2e84b7;var _0x48e196;return db[_0x990c('0x3c')][_0x990c('0x65')]({'where':{'id':_0x3cea89['params']['id']}})['then'](handleEntityNotFound(_0x4a3772,null))[_0x990c('0x2b')](function(_0x37e1cc){if(_0x37e1cc){_0x2e84b7=_0x37e1cc;_0x2ffc11['model']=_[_0x990c('0x40')](db[_0x990c('0xb5')]['rawAttributes']);_0x2ffc11[_0x990c('0x41')]=_[_0x990c('0x40')](_0x3cea89['query']);_0x2ffc11['filters']=_['intersection'](_0x2ffc11[_0x990c('0x3f')],_0x2ffc11[_0x990c('0x41')]);_0xd703cb['attributes']=_[_0x990c('0x43')](_0x2ffc11[_0x990c('0x3f')],qs['fields'](_0x3cea89[_0x990c('0x41')]['fields']));_0xd703cb['attributes']=_0xd703cb[_0x990c('0x44')][_0x990c('0x46')]?_0xd703cb[_0x990c('0x44')]:_0x2ffc11['model'];_0xd703cb['order']=qs[_0x990c('0x4a')](_0x3cea89[_0x990c('0x41')][_0x990c('0x4a')]);_0xd703cb[_0x990c('0x4b')]=qs['filters'](_[_0x990c('0x4c')](_0x3cea89[_0x990c('0x41')],_0x2ffc11[_0x990c('0x42')]));if(_0x3cea89[_0x990c('0x41')]['filter']){_0xd703cb[_0x990c('0x4b')]=_[_0x990c('0x4d')](_0xd703cb[_0x990c('0x4b')],{'$or':_['map'](_0xd703cb['attributes'],function(_0x22cfea){var _0x3c1af5={};_0x3c1af5[_0x22cfea]={'$like':'%'+_0x3cea89[_0x990c('0x41')][_0x990c('0x30')]+'%'};return _0x3c1af5;})});}_0xd703cb=_[_0x990c('0x4d')]({},_0xd703cb,_0x3cea89[_0x990c('0x4f')]);return _0x2e84b7['getBlackLists'](_0xd703cb);}})[_0x990c('0x2b')](function(_0x34407d){if(_0x34407d){_0x48e196=_0x34407d[_0x990c('0x46')];if(!_0x3cea89['query'][_0x990c('0x47')]('nolimit')){_0xd703cb[_0x990c('0x23')]=qs[_0x990c('0x23')](_0x3cea89[_0x990c('0x41')]['limit']);_0xd703cb[_0x990c('0x21')]=qs['offset'](_0x3cea89['query']['offset']);}return _0x2e84b7[_0x990c('0xb4')](_0xd703cb);}})[_0x990c('0x2b')](function(_0x31f41e){if(_0x31f41e){return _0x31f41e?{'count':_0x48e196,'rows':_0x31f41e}:null;}})[_0x990c('0x2b')](respondWithResult(_0x4a3772,null))[_0x990c('0x53')](handleError(_0x4a3772,null));};exports[_0x990c('0xb6')]=function(_0x41cead,_0xf769b6,_0x2655f7){var _0x4cb1a6,_0x269ce5;return db['VoiceQueue'][_0x990c('0x36')]({'where':{'id':_0x41cead['params']['id']}})[_0x990c('0x2b')](handleEntityNotFound(_0xf769b6,null))['then'](function(_0x1ea565){if(_0x1ea565){_0x269ce5=_0x1ea565;return _0x1ea565[_0x990c('0xb6')](_0x41cead[_0x990c('0x63')][_0x990c('0x81')],_['omit'](_0x41cead['body'],[_0x990c('0x81'),'id'])||{});}return null;})[_0x990c('0x93')](function(_0x4d917e){var _0x2e9db4;_0x4cb1a6=_0x4d917e||[];var _0xd31b09=[];if(_0x4d917e){for(var _0x2df855=0x0;_0x2df855<_0x4d917e[_0x990c('0x46')];_0x2df855+=0x1){var _0x358f66=_0x4d917e[_0x2df855][_0x990c('0x59')]({'plain':!![]});_0x2e9db4=squel[_0x990c('0x9f')]()[_0x990c('0xa0')](_0x990c('0xb7'))[_0x990c('0xa2')]([_0x990c('0xa6'),_0x990c('0xa4'),_0x990c('0xa5'),_0x990c('0x66'),_0x990c('0x61'),_0x990c('0x62')],squel[_0x990c('0x83')]()[_0x990c('0x84')](_0x990c('0xa6'),_0x990c('0xa6'))[_0x990c('0x84')]('id',_0x990c('0xa4'))[_0x990c('0x84')](_0x358f66[_0x990c('0xa8')][_0x990c('0xa9')](),_0x990c('0xa5'))['field'](_0x41cead[_0x990c('0x55')]['id'][_0x990c('0xa9')](),_0x990c('0x66'))[_0x990c('0x84')](_0x990c('0xa7'),_0x990c('0x61'))['field'](_0x990c('0xa7'),_0x990c('0x62'))[_0x990c('0x85')](_0x990c('0xaa'))[_0x990c('0x4b')](_0x990c('0xb1'))[_0x990c('0x4b')](_0x990c('0xb2'),_0x358f66[_0x990c('0xa8')][_0x990c('0xa9')]())[_0x990c('0x4b')](_0x990c('0xab')))[_0x990c('0xa9')]();_0xd31b09[_0x990c('0x8a')](db[_0x990c('0x8b')][_0x990c('0x41')](_0x2e9db4));}return BPromise[_0x990c('0x97')](_0xd31b09);}})['then'](function(){return _0x4cb1a6;})[_0x990c('0x2b')](respondWithResult(_0xf769b6,null))[_0x990c('0x53')](handleError(_0xf769b6,null));};exports[_0x990c('0xb8')]=function(_0x11f973,_0x3f0906,_0x1c68e8){return db[_0x990c('0x3c')][_0x990c('0x36')]({'where':{'id':_0x11f973[_0x990c('0x55')]['id']}})['then'](handleEntityNotFound(_0x3f0906,null))[_0x990c('0x2b')](function(_0x461ab3){if(_0x461ab3){return _0x461ab3[_0x990c('0xb8')](_0x11f973[_0x990c('0x41')][_0x990c('0x81')]);}})[_0x990c('0x2b')](function(_0x483db0){if(_0x483db0){return db[_0x990c('0x6c')][_0x990c('0x2c')]({'where':{'ListId':_0x11f973['query'][_0x990c('0x81')],'VoiceQueueId':_0x11f973[_0x990c('0x55')]['id']}})[_0x990c('0x2b')](function(){return _0x483db0;});}})[_0x990c('0x2b')](respondWithStatusCode(_0x3f0906,null))['catch'](handleError(_0x3f0906,null));}; \ No newline at end of file +var _0xecd1=['sort','where','merge','VIRTUAL','includeAll','findAll','rows','catch','show','params','keys','options','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','include','createdAt','updatedAt','body','role','error','CmHopper','getHopperHistories','findOne','nolimit','VoiceQueueId','CmHopperHistory','getHopperFinals','pick','CmHopperFinal','CmHopperBlack','getTeams','teams','Team','User','Agents','online','voicePause','interface','flatMap','sequelize','TeamVoiceQueue','penalty','each','UserVoiceQueue','UserVoiceQueueRt','upsert','isNil','format','SIP/%s','emit','userVoiceQueue:save','removeTeams','ids','select','field','tq.TeamId','from','team_has_voice_queues','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','clone','push','toString','SELECT','union','compact','transaction','isEmpty','forEach','userVoiceQueue:remove','addAgents','removeAgents','getAgents','getMembers','getLists','CmList','addLists','omit','spread','dialCheckDuplicateType','always','into','cm_hopper','fromQuery','phone','scheduledAt','NOW()','ContactId','CmListId','ListId','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','COALESCE(phone,\x27\x27)','onlyIfOpen','insert','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./voiceQueue.socket','register','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','reject','save','update','then','destroy','get','VoiceQueues','inbound','QueueCampaigns','outbound','filter','ignore','map','value','includes','type','find','UserProfileResource','name','index','VoiceQueue','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order'];(function(_0x4b2863,_0x494899){var _0x567d67=function(_0x751f03){while(--_0x751f03){_0x4b2863['push'](_0x4b2863['shift']());}};_0x567d67(++_0x494899);}(_0xecd1,0x126));var _0x1ecd=function(_0x33d07e,_0x3edeb0){_0x33d07e=_0x33d07e-0x0;var _0x24b1c0=_0xecd1[_0x33d07e];return _0x24b1c0;};'use strict';var emlformat=require(_0x1ecd('0x0'));var rimraf=require(_0x1ecd('0x1'));var zipdir=require(_0x1ecd('0x2'));var jsonpatch=require(_0x1ecd('0x3'));var rp=require('request-promise');var moment=require(_0x1ecd('0x4'));var BPromise=require(_0x1ecd('0x5'));var Mustache=require(_0x1ecd('0x6'));var util=require(_0x1ecd('0x7'));var path=require(_0x1ecd('0x8'));var sox=require(_0x1ecd('0x9'));var csv=require(_0x1ecd('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1ecd('0xb'));var _=require(_0x1ecd('0xc'));var squel=require(_0x1ecd('0xd'));var crypto=require('crypto');var jsforce=require(_0x1ecd('0xe'));var deskjs=require(_0x1ecd('0xf'));var toCsv=require(_0x1ecd('0xa'));var querystring=require('querystring');var Papa=require(_0x1ecd('0x10'));var Redis=require(_0x1ecd('0x11'));var authService=require(_0x1ecd('0x12'));var qs=require(_0x1ecd('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1ecd('0x14'));var logger=require(_0x1ecd('0x15'))(_0x1ecd('0x16'));var utils=require(_0x1ecd('0x17'));var config=require(_0x1ecd('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x1ecd('0x19'))['db'];config[_0x1ecd('0x1a')]=_[_0x1ecd('0x1b')](config['redis'],{'host':_0x1ecd('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1ecd('0x1a')]));require(_0x1ecd('0x1d'))[_0x1ecd('0x1e')](socket);function respondWithStatusCode(_0x3d60f7,_0x4acb36){_0x4acb36=_0x4acb36||0xcc;return function(_0x506ed5){if(_0x506ed5){return _0x3d60f7[_0x1ecd('0x1f')](_0x4acb36);}return _0x3d60f7[_0x1ecd('0x20')](_0x4acb36)[_0x1ecd('0x21')]();};}function respondWithResult(_0x12390d,_0x24f330){_0x24f330=_0x24f330||0xc8;return function(_0x50ad4){if(_0x50ad4){return _0x12390d['status'](_0x24f330)['json'](_0x50ad4);}};}function respondWithFilteredResult(_0x2c850d,_0x5101dc){return function(_0x12b8c5){if(_0x12b8c5){var _0x3ea951=typeof _0x5101dc[_0x1ecd('0x22')]==='undefined'&&typeof _0x5101dc[_0x1ecd('0x23')]===_0x1ecd('0x24');var _0x583e96=_0x12b8c5[_0x1ecd('0x25')];var _0x44e99d=_0x3ea951?0x0:_0x5101dc['offset'];var _0x2a82ea=_0x3ea951?_0x12b8c5[_0x1ecd('0x25')]:_0x5101dc[_0x1ecd('0x22')]+_0x5101dc['limit'];var _0x49768c;if(_0x2a82ea>=_0x583e96){_0x2a82ea=_0x583e96;_0x49768c=0xc8;}else{_0x49768c=0xce;}_0x2c850d[_0x1ecd('0x20')](_0x49768c);return _0x2c850d[_0x1ecd('0x26')](_0x1ecd('0x27'),_0x44e99d+'-'+_0x2a82ea+'/'+_0x583e96)[_0x1ecd('0x28')](_0x12b8c5);}return null;};}function patchUpdates(_0x19dbd2){return function(_0x1e7be4){try{jsonpatch['apply'](_0x1e7be4,_0x19dbd2,!![]);}catch(_0x10c41c){return BPromise[_0x1ecd('0x29')](_0x10c41c);}return _0x1e7be4[_0x1ecd('0x2a')]();};}function saveUpdates(_0x3e3344,_0x247491){return function(_0x5d1f03){if(_0x5d1f03){return _0x5d1f03[_0x1ecd('0x2b')](_0x3e3344)[_0x1ecd('0x2c')](function(_0x837385){return _0x837385;});}return null;};}function removeEntity(_0x2fa98f,_0xbea318){return function(_0x1b1ba7){if(_0x1b1ba7){return _0x1b1ba7[_0x1ecd('0x2d')]()['then'](function(){var _0x349216=_0x1b1ba7[_0x1ecd('0x2e')]({'plain':!![]});var _0x2e4bdb=[{'name':_0x1ecd('0x2f'),'value':_0x1ecd('0x30'),'ignore':![]},{'name':_0x1ecd('0x31'),'value':_0x1ecd('0x32'),'ignore':![]}];var _0x31ab88=_(_0x2e4bdb)[_0x1ecd('0x33')](_0x1ecd('0x34'))[_0x1ecd('0x35')]('value')[_0x1ecd('0x36')]();if(_[_0x1ecd('0x37')](_0x31ab88,_0x349216[_0x1ecd('0x38')])){return;}var _0x1ecda1=_[_0x1ecd('0x39')](_0x2e4bdb,[_0x1ecd('0x36'),_0x349216[_0x1ecd('0x38')]])['name'];return db[_0x1ecd('0x3a')][_0x1ecd('0x2d')]({'where':{'type':_0x1ecda1,'resourceId':_0x349216['id']}})[_0x1ecd('0x2c')](function(){return _0x1b1ba7;});})[_0x1ecd('0x2c')](function(){_0x2fa98f['status'](0xcc)[_0x1ecd('0x21')]();});}};}function handleEntityNotFound(_0x57bc47,_0x5c000b){return function(_0x27febb){if(!_0x27febb){_0x57bc47[_0x1ecd('0x1f')](0x194);}return _0x27febb;};}function handleError(_0x5ec078,_0xa1a6d6){_0xa1a6d6=_0xa1a6d6||0x1f4;return function(_0x4eaf44){logger['error'](_0x4eaf44['stack']);if(_0x4eaf44[_0x1ecd('0x3b')]){delete _0x4eaf44[_0x1ecd('0x3b')];}_0x5ec078[_0x1ecd('0x20')](_0xa1a6d6)['send'](_0x4eaf44);};}exports[_0x1ecd('0x3c')]=function(_0x2f2c5c,_0x4eb9a2){var _0x519188={},_0x1371a9={},_0xc8de79={'count':0x0,'rows':[]};var _0x15fbce=_['map'](db[_0x1ecd('0x3d')][_0x1ecd('0x3e')],function(_0x1b537a){return{'name':_0x1b537a[_0x1ecd('0x3f')],'type':_0x1b537a['type'][_0x1ecd('0x40')]};});_0x1371a9[_0x1ecd('0x41')]=_[_0x1ecd('0x35')](_0x15fbce,'name');_0x1371a9[_0x1ecd('0x42')]=_['keys'](_0x2f2c5c['query']);_0x1371a9[_0x1ecd('0x43')]=_[_0x1ecd('0x44')](_0x1371a9[_0x1ecd('0x41')],_0x1371a9[_0x1ecd('0x42')]);_0x519188[_0x1ecd('0x45')]=_[_0x1ecd('0x44')](_0x1371a9['model'],qs[_0x1ecd('0x46')](_0x2f2c5c['query']['fields']));_0x519188[_0x1ecd('0x45')]=_0x519188['attributes'][_0x1ecd('0x47')]?_0x519188[_0x1ecd('0x45')]:_0x1371a9['model'];if(!_0x2f2c5c[_0x1ecd('0x42')][_0x1ecd('0x48')]('nolimit')){_0x519188[_0x1ecd('0x23')]=qs['limit'](_0x2f2c5c['query'][_0x1ecd('0x23')]);_0x519188[_0x1ecd('0x22')]=qs['offset'](_0x2f2c5c[_0x1ecd('0x42')][_0x1ecd('0x22')]);}_0x519188[_0x1ecd('0x49')]=qs[_0x1ecd('0x4a')](_0x2f2c5c[_0x1ecd('0x42')][_0x1ecd('0x4a')]);_0x519188[_0x1ecd('0x4b')]=qs['filters'](_['pick'](_0x2f2c5c[_0x1ecd('0x42')],_0x1371a9[_0x1ecd('0x43')]),_0x15fbce);if(_0x2f2c5c[_0x1ecd('0x42')][_0x1ecd('0x33')]){_0x519188['where']=_[_0x1ecd('0x4c')](_0x519188['where'],{'$or':_[_0x1ecd('0x35')](_0x15fbce,function(_0x29d786){if(_0x29d786[_0x1ecd('0x38')]!==_0x1ecd('0x4d')){var _0x4ac318={};_0x4ac318[_0x29d786['name']]={'$like':'%'+_0x2f2c5c['query'][_0x1ecd('0x33')]+'%'};return _0x4ac318;}})});}_0x519188=_[_0x1ecd('0x4c')]({},_0x519188,_0x2f2c5c['options']);var _0x4fa01f={'where':_0x519188[_0x1ecd('0x4b')]};return db[_0x1ecd('0x3d')][_0x1ecd('0x25')](_0x4fa01f)[_0x1ecd('0x2c')](function(_0x3cf342){_0xc8de79[_0x1ecd('0x25')]=_0x3cf342;if(_0x2f2c5c[_0x1ecd('0x42')][_0x1ecd('0x4e')]){_0x519188['include']=[{'all':!![]}];}return db[_0x1ecd('0x3d')][_0x1ecd('0x4f')](_0x519188);})[_0x1ecd('0x2c')](function(_0x44869e){_0xc8de79[_0x1ecd('0x50')]=_0x44869e;return _0xc8de79;})[_0x1ecd('0x2c')](respondWithFilteredResult(_0x4eb9a2,_0x519188))[_0x1ecd('0x51')](handleError(_0x4eb9a2,null));};exports[_0x1ecd('0x52')]=function(_0xdddaed,_0x5aee68){var _0x5adf04={'raw':![],'where':{'id':_0xdddaed[_0x1ecd('0x53')]['id']}},_0x37f79a={};_0x37f79a['model']=_[_0x1ecd('0x54')](db['VoiceQueue'][_0x1ecd('0x3e')]);_0x37f79a['query']=_['keys'](_0xdddaed[_0x1ecd('0x42')]);_0x37f79a[_0x1ecd('0x43')]=_[_0x1ecd('0x44')](_0x37f79a['model'],_0x37f79a[_0x1ecd('0x42')]);_0x5adf04[_0x1ecd('0x45')]=_[_0x1ecd('0x44')](_0x37f79a['model'],qs[_0x1ecd('0x46')](_0xdddaed[_0x1ecd('0x42')][_0x1ecd('0x46')]));_0x5adf04[_0x1ecd('0x45')]=_0x5adf04[_0x1ecd('0x45')]['length']?_0x5adf04[_0x1ecd('0x45')]:_0x37f79a[_0x1ecd('0x41')];if(_0xdddaed[_0x1ecd('0x42')][_0x1ecd('0x4e')]){_0x5adf04['include']=[{'all':!![]}];}_0x5adf04=_[_0x1ecd('0x4c')]({},_0x5adf04,_0xdddaed[_0x1ecd('0x55')]);return db['VoiceQueue'][_0x1ecd('0x39')](_0x5adf04)[_0x1ecd('0x2c')](handleEntityNotFound(_0x5aee68,null))[_0x1ecd('0x2c')](respondWithResult(_0x5aee68,null))[_0x1ecd('0x51')](handleError(_0x5aee68,null));};exports['create']=function(_0x2cfbcf,_0x580ef5){return db[_0x1ecd('0x3d')][_0x1ecd('0x56')](_0x2cfbcf['body'],{})[_0x1ecd('0x2c')](function(_0x2c4172){var _0xdbc0ef=_0x2cfbcf[_0x1ecd('0x57')][_0x1ecd('0x2e')]({'plain':!![]});if(!_0xdbc0ef)throw new Error(_0x1ecd('0x58'));if(_0xdbc0ef['role']===_0x1ecd('0x57')){var _0x516ba6=_0x2c4172['get']({'plain':!![]});var _0x446e44=[{'name':_0x1ecd('0x2f'),'value':'inbound'},{'name':_0x1ecd('0x31'),'value':_0x1ecd('0x32')}];var _0x1676b2=_[_0x1ecd('0x39')](_0x446e44,[_0x1ecd('0x36'),_0x516ba6[_0x1ecd('0x38')]])[_0x1ecd('0x3b')];return db[_0x1ecd('0x59')][_0x1ecd('0x39')]({'where':{'name':_0x1676b2,'userProfileId':_0xdbc0ef[_0x1ecd('0x5a')]},'raw':!![]})[_0x1ecd('0x2c')](function(_0x18e62d){if(_0x18e62d&&_0x18e62d[_0x1ecd('0x5b')]===0x0){return db[_0x1ecd('0x3a')][_0x1ecd('0x56')]({'name':_0x516ba6[_0x1ecd('0x3b')],'resourceId':_0x516ba6['id'],'type':_0x18e62d['name'],'sectionId':_0x18e62d['id']},{})[_0x1ecd('0x2c')](function(){return _0x2c4172;});}else{return _0x2c4172;}})[_0x1ecd('0x51')](function(_0x297584){logger['error'](_0x1ecd('0x5c'),_0x297584);throw _0x297584;});}return _0x2c4172;})[_0x1ecd('0x2c')](respondWithResult(_0x580ef5,0xc9))[_0x1ecd('0x51')](handleError(_0x580ef5,null));};exports['clone']=function(_0x3e4907,_0x287c33){var _0x5af5f0={'where':{'id':_0x3e4907[_0x1ecd('0x53')]['id']}},_0x1cf577={};_0x1cf577[_0x1ecd('0x41')]=_['keys'](db[_0x1ecd('0x3d')]['rawAttributes']);_0x5af5f0[_0x1ecd('0x45')]=_[_0x1ecd('0x44')](_0x1cf577[_0x1ecd('0x41')],qs[_0x1ecd('0x46')](_0x3e4907[_0x1ecd('0x42')][_0x1ecd('0x46')]));_0x5af5f0[_0x1ecd('0x45')]=_0x5af5f0[_0x1ecd('0x45')][_0x1ecd('0x47')]?_0x5af5f0[_0x1ecd('0x45')]:_0x1cf577[_0x1ecd('0x41')];if(_0x3e4907[_0x1ecd('0x42')][_0x1ecd('0x4e')]){_0x5af5f0[_0x1ecd('0x5d')]=[{'all':!![]}];}_0x5af5f0=_[_0x1ecd('0x4c')]({},_0x5af5f0,_0x3e4907['options']);return db[_0x1ecd('0x3d')][_0x1ecd('0x39')](_0x5af5f0)['then'](handleEntityNotFound(_0x287c33,null))['then'](function(_0xede684){if(_0xede684){var _0x4c7368=_0xede684[_0x1ecd('0x2e')]({'plain':!![]});_0x4c7368=qs['omit'](_0x4c7368,['id',_0x1ecd('0x5e'),_0x1ecd('0x5f')]);_0x3e4907['body']=_['omit'](_0x3e4907['body'],['id','createdAt',_0x1ecd('0x5f')]);return db['VoiceQueue']['create'](_[_0x1ecd('0x4c')](_0x4c7368,_0x3e4907[_0x1ecd('0x60')]),{'include':_0x3e4907[_0x1ecd('0x42')]['includeAll']?[{'all':!![]}]:undefined})[_0x1ecd('0x2c')](function(_0x327cf8){var _0x38e071=_0x3e4907[_0x1ecd('0x57')]['get']({'plain':!![]});if(!_0x38e071)throw new Error(_0x1ecd('0x58'));if(_0x38e071[_0x1ecd('0x61')]===_0x1ecd('0x57')){var _0x227e12=_0x327cf8[_0x1ecd('0x2e')]({'plain':!![]});var _0x1b7a8b=[{'name':_0x1ecd('0x2f'),'value':_0x1ecd('0x30')},{'name':'QueueCampaigns','value':_0x1ecd('0x32')}];var _0x27a7df=_[_0x1ecd('0x39')](_0x1b7a8b,[_0x1ecd('0x36'),_0x227e12[_0x1ecd('0x38')]])[_0x1ecd('0x3b')];return db[_0x1ecd('0x59')][_0x1ecd('0x39')]({'where':{'name':_0x27a7df,'userProfileId':_0x38e071[_0x1ecd('0x5a')]},'raw':!![]})[_0x1ecd('0x2c')](function(_0x541c48){if(_0x541c48&&_0x541c48[_0x1ecd('0x5b')]===0x0){return db[_0x1ecd('0x3a')]['create']({'name':_0x227e12['name'],'resourceId':_0x227e12['id'],'type':_0x541c48[_0x1ecd('0x3b')],'sectionId':_0x541c48['id']},{})[_0x1ecd('0x2c')](function(){return _0x327cf8;});}else{return _0x327cf8;}})[_0x1ecd('0x51')](function(_0x5883cc){logger[_0x1ecd('0x62')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5883cc);throw _0x5883cc;});}return _0x327cf8;});}})['then'](respondWithResult(_0x287c33,0xc9))[_0x1ecd('0x51')](handleError(_0x287c33,null));};exports[_0x1ecd('0x2b')]=function(_0x24a2dd,_0x13051b){if(_0x24a2dd['body']['id']){delete _0x24a2dd[_0x1ecd('0x60')]['id'];}return db['VoiceQueue'][_0x1ecd('0x39')]({'where':{'id':_0x24a2dd[_0x1ecd('0x53')]['id']}})['then'](handleEntityNotFound(_0x13051b,null))[_0x1ecd('0x2c')](saveUpdates(_0x24a2dd['body'],null))['then'](respondWithResult(_0x13051b,null))[_0x1ecd('0x51')](handleError(_0x13051b,null));};exports[_0x1ecd('0x2d')]=function(_0x2f6f93,_0x3e8523){return db['VoiceQueue'][_0x1ecd('0x39')]({'where':{'id':_0x2f6f93[_0x1ecd('0x53')]['id']}})['then'](handleEntityNotFound(_0x3e8523,null))['then'](removeEntity(_0x3e8523,null))[_0x1ecd('0x51')](handleError(_0x3e8523,null));};exports['getHoppers']=function(_0x30d647,_0x134a0c,_0x2d82d5){var _0x373628={'raw':![],'where':{}};var _0x4a6b10={};var _0x3306c2={'count':0x0,'rows':[]};return db[_0x1ecd('0x3d')]['findOne']({'where':{'id':_0x30d647[_0x1ecd('0x53')]['id']}})[_0x1ecd('0x2c')](handleEntityNotFound(_0x134a0c,null))[_0x1ecd('0x2c')](function(_0x51429d){if(_0x51429d){_0x4a6b10[_0x1ecd('0x41')]=_[_0x1ecd('0x54')](db[_0x1ecd('0x63')][_0x1ecd('0x3e')]);_0x4a6b10['query']=_[_0x1ecd('0x54')](_0x30d647['query']);_0x4a6b10[_0x1ecd('0x43')]=_['intersection'](_0x4a6b10[_0x1ecd('0x41')],_0x4a6b10[_0x1ecd('0x42')]);_0x373628[_0x1ecd('0x45')]=_[_0x1ecd('0x44')](_0x4a6b10['model'],qs[_0x1ecd('0x46')](_0x30d647[_0x1ecd('0x42')]['fields']));_0x373628[_0x1ecd('0x45')]=_0x373628[_0x1ecd('0x45')][_0x1ecd('0x47')]?_0x373628['attributes']:_0x4a6b10[_0x1ecd('0x41')];if(!_0x30d647['query'][_0x1ecd('0x48')]('nolimit')){_0x373628[_0x1ecd('0x23')]=qs[_0x1ecd('0x23')](_0x30d647[_0x1ecd('0x42')][_0x1ecd('0x23')]);_0x373628[_0x1ecd('0x22')]=qs[_0x1ecd('0x22')](_0x30d647[_0x1ecd('0x42')][_0x1ecd('0x22')]);}_0x373628[_0x1ecd('0x49')]=qs[_0x1ecd('0x4a')](_0x30d647['query'][_0x1ecd('0x4a')]);_0x373628['where']=qs['filters'](_['pick'](_0x30d647[_0x1ecd('0x42')],_0x4a6b10['filters']));_0x373628[_0x1ecd('0x4b')]['VoiceQueueId']=_0x51429d['id'];if(_0x30d647[_0x1ecd('0x42')][_0x1ecd('0x33')]){_0x373628[_0x1ecd('0x4b')]=_['merge'](_0x373628[_0x1ecd('0x4b')],{'$or':_[_0x1ecd('0x35')](_0x373628[_0x1ecd('0x45')],function(_0x1733ad){var _0x1039d2={};_0x1039d2[_0x1733ad]={'$like':'%'+_0x30d647[_0x1ecd('0x42')][_0x1ecd('0x33')]+'%'};return _0x1039d2;})});}_0x373628=_['merge']({},_0x373628,_0x30d647[_0x1ecd('0x55')]);return db[_0x1ecd('0x63')][_0x1ecd('0x25')]({'where':_0x373628[_0x1ecd('0x4b')]})[_0x1ecd('0x2c')](function(_0x14f727){_0x3306c2[_0x1ecd('0x25')]=_0x14f727;if(_0x30d647[_0x1ecd('0x42')][_0x1ecd('0x4e')]){_0x373628[_0x1ecd('0x5d')]=[{'all':!![]}];}return db[_0x1ecd('0x63')][_0x1ecd('0x4f')](_0x373628);})[_0x1ecd('0x2c')](function(_0x44c22f){_0x3306c2[_0x1ecd('0x50')]=_0x44c22f;return _0x3306c2;});}})['then'](respondWithFilteredResult(_0x134a0c,_0x373628))[_0x1ecd('0x51')](handleError(_0x134a0c,null));};exports[_0x1ecd('0x64')]=function(_0x1cbde7,_0x1979d6,_0x52a70c){var _0x135719={'raw':!![],'where':{}};var _0x44aabd={};var _0x1a315f={'count':0x0,'rows':[]};return db[_0x1ecd('0x3d')][_0x1ecd('0x65')]({'where':{'id':_0x1cbde7[_0x1ecd('0x53')]['id']}})['then'](handleEntityNotFound(_0x1979d6,null))[_0x1ecd('0x2c')](function(_0x4b8fbe){if(_0x4b8fbe){_0x44aabd[_0x1ecd('0x41')]=_[_0x1ecd('0x54')](db['CmHopperHistory'][_0x1ecd('0x3e')]);_0x44aabd[_0x1ecd('0x42')]=_[_0x1ecd('0x54')](_0x1cbde7[_0x1ecd('0x42')]);_0x44aabd[_0x1ecd('0x43')]=_['intersection'](_0x44aabd[_0x1ecd('0x41')],_0x44aabd[_0x1ecd('0x42')]);_0x135719['attributes']=_[_0x1ecd('0x44')](_0x44aabd['model'],qs[_0x1ecd('0x46')](_0x1cbde7[_0x1ecd('0x42')][_0x1ecd('0x46')]));_0x135719[_0x1ecd('0x45')]=_0x135719['attributes']['length']?_0x135719[_0x1ecd('0x45')]:_0x44aabd['model'];if(!_0x1cbde7[_0x1ecd('0x42')][_0x1ecd('0x48')](_0x1ecd('0x66'))){_0x135719['limit']=qs[_0x1ecd('0x23')](_0x1cbde7[_0x1ecd('0x42')][_0x1ecd('0x23')]);_0x135719[_0x1ecd('0x22')]=qs['offset'](_0x1cbde7[_0x1ecd('0x42')][_0x1ecd('0x22')]);}_0x135719[_0x1ecd('0x49')]=qs['sort'](_0x1cbde7[_0x1ecd('0x42')][_0x1ecd('0x4a')]);_0x135719['where']=qs[_0x1ecd('0x43')](_['pick'](_0x1cbde7['query'],_0x44aabd[_0x1ecd('0x43')]));_0x135719[_0x1ecd('0x4b')][_0x1ecd('0x67')]=_0x4b8fbe['id'];if(_0x1cbde7[_0x1ecd('0x42')][_0x1ecd('0x33')]){_0x135719['where']=_[_0x1ecd('0x4c')](_0x135719['where'],{'$or':_[_0x1ecd('0x35')](_0x135719[_0x1ecd('0x45')],function(_0x424572){var _0x2f909e={};_0x2f909e[_0x424572]={'$like':'%'+_0x1cbde7[_0x1ecd('0x42')][_0x1ecd('0x33')]+'%'};return _0x2f909e;})});}_0x135719=_[_0x1ecd('0x4c')]({},_0x135719,_0x1cbde7[_0x1ecd('0x55')]);return db['CmHopperHistory']['count']({'where':_0x135719[_0x1ecd('0x4b')]})[_0x1ecd('0x2c')](function(_0xda15a4){_0x1a315f[_0x1ecd('0x25')]=_0xda15a4;if(_0x1cbde7[_0x1ecd('0x42')][_0x1ecd('0x4e')]){_0x135719['include']=[{'all':!![]}];}return db[_0x1ecd('0x68')][_0x1ecd('0x4f')](_0x135719);})[_0x1ecd('0x2c')](function(_0x42a206){_0x1a315f[_0x1ecd('0x50')]=_0x42a206;return _0x1a315f;});}})[_0x1ecd('0x2c')](respondWithFilteredResult(_0x1979d6,_0x135719))[_0x1ecd('0x51')](handleError(_0x1979d6,null));};exports[_0x1ecd('0x69')]=function(_0x4da071,_0x3c4c4,_0x375c14){var _0x1a06c8={'raw':!![],'where':{}};var _0x45a623={};var _0xab2ba5={'count':0x0,'rows':[]};return db[_0x1ecd('0x3d')][_0x1ecd('0x65')]({'where':{'id':_0x4da071['params']['id']}})['then'](handleEntityNotFound(_0x3c4c4,null))[_0x1ecd('0x2c')](function(_0x444cbf){if(_0x444cbf){_0x45a623[_0x1ecd('0x41')]=_[_0x1ecd('0x54')](db['CmHopperFinal'][_0x1ecd('0x3e')]);_0x45a623['query']=_['keys'](_0x4da071[_0x1ecd('0x42')]);_0x45a623[_0x1ecd('0x43')]=_[_0x1ecd('0x44')](_0x45a623[_0x1ecd('0x41')],_0x45a623['query']);_0x1a06c8[_0x1ecd('0x45')]=_['intersection'](_0x45a623[_0x1ecd('0x41')],qs[_0x1ecd('0x46')](_0x4da071[_0x1ecd('0x42')][_0x1ecd('0x46')]));_0x1a06c8['attributes']=_0x1a06c8['attributes'][_0x1ecd('0x47')]?_0x1a06c8[_0x1ecd('0x45')]:_0x45a623[_0x1ecd('0x41')];if(!_0x4da071[_0x1ecd('0x42')][_0x1ecd('0x48')](_0x1ecd('0x66'))){_0x1a06c8[_0x1ecd('0x23')]=qs[_0x1ecd('0x23')](_0x4da071[_0x1ecd('0x42')][_0x1ecd('0x23')]);_0x1a06c8[_0x1ecd('0x22')]=qs[_0x1ecd('0x22')](_0x4da071[_0x1ecd('0x42')][_0x1ecd('0x22')]);}_0x1a06c8[_0x1ecd('0x49')]=qs[_0x1ecd('0x4a')](_0x4da071[_0x1ecd('0x42')][_0x1ecd('0x4a')]);_0x1a06c8[_0x1ecd('0x4b')]=qs['filters'](_[_0x1ecd('0x6a')](_0x4da071[_0x1ecd('0x42')],_0x45a623[_0x1ecd('0x43')]));_0x1a06c8[_0x1ecd('0x4b')][_0x1ecd('0x67')]=_0x444cbf['id'];if(_0x4da071['query'][_0x1ecd('0x33')]){_0x1a06c8[_0x1ecd('0x4b')]=_[_0x1ecd('0x4c')](_0x1a06c8[_0x1ecd('0x4b')],{'$or':_[_0x1ecd('0x35')](_0x1a06c8[_0x1ecd('0x45')],function(_0x224898){var _0xf73256={};_0xf73256[_0x224898]={'$like':'%'+_0x4da071[_0x1ecd('0x42')][_0x1ecd('0x33')]+'%'};return _0xf73256;})});}_0x1a06c8=_[_0x1ecd('0x4c')]({},_0x1a06c8,_0x4da071[_0x1ecd('0x55')]);return db[_0x1ecd('0x6b')]['count']({'where':_0x1a06c8[_0x1ecd('0x4b')]})['then'](function(_0x302dc0){_0xab2ba5['count']=_0x302dc0;if(_0x4da071[_0x1ecd('0x42')]['includeAll']){_0x1a06c8[_0x1ecd('0x5d')]=[{'all':!![]}];}return db[_0x1ecd('0x6b')]['findAll'](_0x1a06c8);})[_0x1ecd('0x2c')](function(_0x3845ec){_0xab2ba5[_0x1ecd('0x50')]=_0x3845ec;return _0xab2ba5;});}})[_0x1ecd('0x2c')](respondWithFilteredResult(_0x3c4c4,_0x1a06c8))[_0x1ecd('0x51')](handleError(_0x3c4c4,null));};exports['getHopperBlacks']=function(_0x296726,_0x2e4c07,_0x5193f7){var _0x33202d={'raw':!![],'where':{}};var _0x269333={};var _0x375801={'count':0x0,'rows':[]};return db[_0x1ecd('0x3d')][_0x1ecd('0x65')]({'where':{'id':_0x296726[_0x1ecd('0x53')]['id']}})[_0x1ecd('0x2c')](handleEntityNotFound(_0x2e4c07,null))[_0x1ecd('0x2c')](function(_0x5d6972){if(_0x5d6972){_0x269333[_0x1ecd('0x41')]=_[_0x1ecd('0x54')](db['CmHopperBlack']['rawAttributes']);_0x269333[_0x1ecd('0x42')]=_[_0x1ecd('0x54')](_0x296726[_0x1ecd('0x42')]);_0x269333[_0x1ecd('0x43')]=_['intersection'](_0x269333[_0x1ecd('0x41')],_0x269333[_0x1ecd('0x42')]);_0x33202d[_0x1ecd('0x45')]=_[_0x1ecd('0x44')](_0x269333['model'],qs[_0x1ecd('0x46')](_0x296726[_0x1ecd('0x42')]['fields']));_0x33202d['attributes']=_0x33202d['attributes'][_0x1ecd('0x47')]?_0x33202d[_0x1ecd('0x45')]:_0x269333['model'];if(!_0x296726[_0x1ecd('0x42')][_0x1ecd('0x48')](_0x1ecd('0x66'))){_0x33202d[_0x1ecd('0x23')]=qs[_0x1ecd('0x23')](_0x296726[_0x1ecd('0x42')]['limit']);_0x33202d[_0x1ecd('0x22')]=qs[_0x1ecd('0x22')](_0x296726[_0x1ecd('0x42')][_0x1ecd('0x22')]);}_0x33202d[_0x1ecd('0x49')]=qs[_0x1ecd('0x4a')](_0x296726[_0x1ecd('0x42')][_0x1ecd('0x4a')]);_0x33202d[_0x1ecd('0x4b')]=qs[_0x1ecd('0x43')](_[_0x1ecd('0x6a')](_0x296726[_0x1ecd('0x42')],_0x269333[_0x1ecd('0x43')]));_0x33202d[_0x1ecd('0x4b')]['VoiceQueueId']=_0x5d6972['id'];if(_0x296726['query'][_0x1ecd('0x33')]){_0x33202d[_0x1ecd('0x4b')]=_[_0x1ecd('0x4c')](_0x33202d[_0x1ecd('0x4b')],{'$or':_[_0x1ecd('0x35')](_0x33202d[_0x1ecd('0x45')],function(_0x2c9518){var _0x5f16fc={};_0x5f16fc[_0x2c9518]={'$like':'%'+_0x296726[_0x1ecd('0x42')]['filter']+'%'};return _0x5f16fc;})});}_0x33202d=_[_0x1ecd('0x4c')]({},_0x33202d,_0x296726[_0x1ecd('0x55')]);return db[_0x1ecd('0x6c')][_0x1ecd('0x25')]({'where':_0x33202d['where']})[_0x1ecd('0x2c')](function(_0x271795){_0x375801[_0x1ecd('0x25')]=_0x271795;if(_0x296726[_0x1ecd('0x42')][_0x1ecd('0x4e')]){_0x33202d[_0x1ecd('0x5d')]=[{'all':!![]}];}return db['CmHopperBlack'][_0x1ecd('0x4f')](_0x33202d);})['then'](function(_0x29d873){_0x375801[_0x1ecd('0x50')]=_0x29d873;return _0x375801;});}})['then'](respondWithFilteredResult(_0x2e4c07,_0x33202d))[_0x1ecd('0x51')](handleError(_0x2e4c07,null));};exports['getTeams']=function(_0x394416,_0x2e39f5,_0x370e2f){var _0x2e3c95={};var _0xb3a0da={};var _0x5f30bc;var _0x4b6930;return db['VoiceQueue'][_0x1ecd('0x65')]({'where':{'id':_0x394416[_0x1ecd('0x53')]['id']}})[_0x1ecd('0x2c')](handleEntityNotFound(_0x2e39f5,null))[_0x1ecd('0x2c')](function(_0x56b254){if(_0x56b254){_0x5f30bc=_0x56b254;_0xb3a0da['model']=_[_0x1ecd('0x54')](db['Team'][_0x1ecd('0x3e')]);_0xb3a0da[_0x1ecd('0x42')]=_[_0x1ecd('0x54')](_0x394416[_0x1ecd('0x42')]);_0xb3a0da[_0x1ecd('0x43')]=_[_0x1ecd('0x44')](_0xb3a0da[_0x1ecd('0x41')],_0xb3a0da['query']);_0x2e3c95['attributes']=_['intersection'](_0xb3a0da[_0x1ecd('0x41')],qs[_0x1ecd('0x46')](_0x394416[_0x1ecd('0x42')][_0x1ecd('0x46')]));_0x2e3c95['attributes']=_0x2e3c95[_0x1ecd('0x45')][_0x1ecd('0x47')]?_0x2e3c95[_0x1ecd('0x45')]:_0xb3a0da[_0x1ecd('0x41')];_0x2e3c95[_0x1ecd('0x49')]=qs[_0x1ecd('0x4a')](_0x394416[_0x1ecd('0x42')][_0x1ecd('0x4a')]);_0x2e3c95['where']=qs[_0x1ecd('0x43')](_['pick'](_0x394416['query'],_0xb3a0da[_0x1ecd('0x43')]));if(_0x394416[_0x1ecd('0x42')][_0x1ecd('0x33')]){_0x2e3c95[_0x1ecd('0x4b')]=_[_0x1ecd('0x4c')](_0x2e3c95['where'],{'$or':_[_0x1ecd('0x35')](_0x2e3c95[_0x1ecd('0x45')],function(_0x127902){var _0x20d204={};_0x20d204[_0x127902]={'$like':'%'+_0x394416[_0x1ecd('0x42')][_0x1ecd('0x33')]+'%'};return _0x20d204;})});}_0x2e3c95=_[_0x1ecd('0x4c')]({},_0x2e3c95,_0x394416[_0x1ecd('0x55')]);return _0x5f30bc[_0x1ecd('0x6d')](_0x2e3c95);}})[_0x1ecd('0x2c')](function(_0x5cac28){if(_0x5cac28){_0x4b6930=_0x5cac28['length'];if(!_0x394416[_0x1ecd('0x42')]['hasOwnProperty'](_0x1ecd('0x66'))){_0x2e3c95['limit']=qs[_0x1ecd('0x23')](_0x394416[_0x1ecd('0x42')]['limit']);_0x2e3c95[_0x1ecd('0x22')]=qs[_0x1ecd('0x22')](_0x394416['query']['offset']);}return _0x5f30bc[_0x1ecd('0x6d')](_0x2e3c95);}})[_0x1ecd('0x2c')](function(_0xc810ae){if(_0xc810ae){return _0xc810ae?{'count':_0x4b6930,'rows':_0xc810ae}:null;}})[_0x1ecd('0x2c')](respondWithResult(_0x2e39f5,null))[_0x1ecd('0x51')](handleError(_0x2e39f5,null));};exports['addTeams']=function(_0x179a56,_0x190d2d,_0x13b81d){var _0x50fb48=_0x179a56[_0x1ecd('0x60')][_0x1ecd('0x6e')];var _0x17df95=_['map'](_0x50fb48,'id');return db[_0x1ecd('0x6f')]['findAll']({'where':{'id':_0x17df95},'attributes':['id'],'include':[{'model':db[_0x1ecd('0x70')],'as':_0x1ecd('0x71'),'attributes':['id',_0x1ecd('0x3b'),_0x1ecd('0x72'),_0x1ecd('0x73'),_0x1ecd('0x74')],'raw':!![]}]})[_0x1ecd('0x2c')](function(_0x28f276){if(_0x28f276){var _0x4ba3bc=_[_0x1ecd('0x75')](_0x28f276,function(_0x56fcba){var _0x673a8e=_0x56fcba[_0x1ecd('0x2e')]({'plain':!![]});_0x673a8e['Agents']['forEach'](function(_0x181070){_0x181070['penalty']=_[_0x1ecd('0x39')](_0x50fb48,{'id':_0x673a8e['id']})['penalty'];});return _0x673a8e[_0x1ecd('0x71')];});return db['VoiceQueue'][_0x1ecd('0x39')]({'where':{'id':_0x179a56[_0x1ecd('0x53')]['id']}})[_0x1ecd('0x2c')](function(_0xbb534c){return db[_0x1ecd('0x76')]['transaction'](function(_0x3fa253){return _0xbb534c['addTeams'](_0x17df95,{'transaction':_0x3fa253})[_0x1ecd('0x2c')](function(){return BPromise['each'](_0x50fb48,function(_0x2de97b){return db[_0x1ecd('0x77')]['upsert']({'TeamId':_0x2de97b['id'],'VoiceQueueId':_0x179a56[_0x1ecd('0x53')]['id'],'penalty':_0x2de97b[_0x1ecd('0x78')]},{'transaction':_0x3fa253});});})[_0x1ecd('0x2c')](function(){return BPromise[_0x1ecd('0x79')](_0x4ba3bc,function(_0x575492){return db[_0x1ecd('0x7a')]['findOrCreate']({'where':{'UserId':_0x575492['id'],'VoiceQueueId':_0x179a56[_0x1ecd('0x53')]['id']},'defaults':{'penalty':_0x575492['penalty']},'transaction':_0x3fa253});});})[_0x1ecd('0x2c')](function(){return BPromise[_0x1ecd('0x79')](_[_0x1ecd('0x33')](_0x4ba3bc,{'online':!![]}),function(_0x41ff82){return db[_0x1ecd('0x7b')][_0x1ecd('0x7c')]({'membername':_0x41ff82['name'],'UserId':_0x41ff82['id'],'queue_name':_0xbb534c['name'],'VoiceQueueId':_0xbb534c['id'],'interface':_[_0x1ecd('0x7d')](_0x41ff82['interface'])?util[_0x1ecd('0x7e')](_0x1ecd('0x7f'),_0x41ff82['name']):_0x41ff82[_0x1ecd('0x74')],'paused':_0x41ff82[_0x1ecd('0x73')]||![],'penalty':_0x41ff82[_0x1ecd('0x78')]},{'transaction':_0x3fa253});});})[_0x1ecd('0x2c')](function(){_0x4ba3bc['forEach'](function(_0x2a2410){socket[_0x1ecd('0x80')](_0x1ecd('0x81'),{'UserId':_0x2a2410['id'],'VoiceQueueId':_0xbb534c['id']});});});});});}})[_0x1ecd('0x2c')](respondWithStatusCode(_0x190d2d,null))['catch'](handleError(_0x190d2d,null));};exports[_0x1ecd('0x82')]=function(_0x513860,_0x1a6dbd,_0x534f6c){return db['Team']['findAll']({'where':{'id':_0x513860['query'][_0x1ecd('0x83')]},'attributes':['id'],'include':[{'model':db[_0x1ecd('0x70')],'as':_0x1ecd('0x71'),'attributes':['id'],'raw':!![]}]})[_0x1ecd('0x2c')](handleEntityNotFound(_0x1a6dbd,null))[_0x1ecd('0x2c')](function(_0x1954d5){var _0x4fef56=_[_0x1ecd('0x35')](_0x1954d5,'id');var _0x3652b4=[];var _0x4a6c55=[];var _0x57339e=squel[_0x1ecd('0x84')]();_0x57339e[_0x1ecd('0x85')](_0x1ecd('0x86'))[_0x1ecd('0x87')](_0x1ecd('0x88'),'tq')['join']('user_has_teams','ut',_0x1ecd('0x89'))[_0x1ecd('0x4b')](_0x1ecd('0x8a'),_0x513860[_0x1ecd('0x53')]['id']);for(var _0x36b7af=0x0;_0x36b7af<_0x1954d5['length'];_0x36b7af+=0x1){let _0x3128fc=_0x1954d5[_0x36b7af];for(var _0xe011cc=0x0;_0xe011cc<_0x3128fc[_0x1ecd('0x71')][_0x1ecd('0x47')];_0xe011cc+=0x1){let _0x2b1dab=_0x3128fc[_0x1ecd('0x71')][_0xe011cc];var _0x52f215=_0x57339e[_0x1ecd('0x8b')]();_0x52f215[_0x1ecd('0x4b')]('ut.UserId\x20=\x20?',_0x2b1dab['id']);_0x4a6c55[_0x1ecd('0x8c')](db[_0x1ecd('0x76')][_0x1ecd('0x42')](_0x52f215[_0x1ecd('0x8d')](),{'type':db[_0x1ecd('0x76')]['QueryTypes'][_0x1ecd('0x8e')]})[_0x1ecd('0x2c')](function(_0x37adac){if(_0x37adac[_0x1ecd('0x47')]===0x1){return _0x2b1dab['id'];}else{var _0x13a2f7=_['every'](_[_0x1ecd('0x35')](_0x37adac,'TeamId'),function(_0x571981){return _['includes'](_0x4fef56,_0x571981);});if(_0x13a2f7){return _0x2b1dab['id'];}}}));}}return BPromise['all'](_0x4a6c55)[_0x1ecd('0x2c')](function(_0x543dea){_0x3652b4=_(_0x3652b4)[_0x1ecd('0x8f')](_0x543dea)[_0x1ecd('0x90')]()[_0x1ecd('0x36')]();return db[_0x1ecd('0x3d')][_0x1ecd('0x39')]({'where':{'id':_0x513860[_0x1ecd('0x53')]['id']}})[_0x1ecd('0x2c')](function(_0x52e99c){return db[_0x1ecd('0x76')][_0x1ecd('0x91')](function(_0x1dbef4){return _0x52e99c[_0x1ecd('0x82')](_0x513860[_0x1ecd('0x42')][_0x1ecd('0x83')],{'transaction':_0x1dbef4})[_0x1ecd('0x2c')](function(){if(!_[_0x1ecd('0x92')](_0x3652b4)){return _0x52e99c['removeAgents'](_0x3652b4,{'transaction':_0x1dbef4})[_0x1ecd('0x2c')](function(){return db[_0x1ecd('0x7b')][_0x1ecd('0x2d')]({'where':{'VoiceQueueId':_0x513860[_0x1ecd('0x53')]['id'],'UserId':_0x3652b4},'transaction':_0x1dbef4});});}})['then'](function(){_0x3652b4[_0x1ecd('0x93')](function(_0x32c734){socket[_0x1ecd('0x80')](_0x1ecd('0x94'),{'UserId':_0x32c734,'VoiceQueueId':_0x52e99c['id']});});});});});});})['then'](respondWithStatusCode(_0x1a6dbd,null))[_0x1ecd('0x51')](handleError(_0x1a6dbd,null));};exports['addAgents']=function(_0x2e08b1,_0x3070f2,_0x29568e){var _0x438afe,_0x24a9c3;return db[_0x1ecd('0x3d')]['find']({'where':{'id':_0x2e08b1[_0x1ecd('0x53')]['id']}})[_0x1ecd('0x2c')](handleEntityNotFound(_0x3070f2,null))['then'](function(_0x4aa7ed){if(_0x4aa7ed){_0x24a9c3=_0x4aa7ed;return _0x4aa7ed[_0x1ecd('0x95')](_0x2e08b1['body'][_0x1ecd('0x83')],_['omit'](_0x2e08b1[_0x1ecd('0x60')],[_0x1ecd('0x83'),'id'])||{})['spread'](function(_0x5ce686){for(var _0x218126=0x0;_0x218126<_0x2e08b1[_0x1ecd('0x60')][_0x1ecd('0x83')]['length'];_0x218126+=0x1){socket[_0x1ecd('0x80')](_0x1ecd('0x81'),{'UserId':Number(_0x2e08b1[_0x1ecd('0x60')][_0x1ecd('0x83')][_0x218126]),'VoiceQueueId':Number(_0x2e08b1[_0x1ecd('0x53')]['id'])});}return _0x5ce686;});}})[_0x1ecd('0x2c')](function(_0x4d8175){_0x438afe=_0x4d8175||[];if(_0x24a9c3){return db[_0x1ecd('0x70')][_0x1ecd('0x4f')]({'where':{'id':_0x2e08b1[_0x1ecd('0x60')]['ids']},'attributes':['id',_0x1ecd('0x3b'),_0x1ecd('0x72'),_0x1ecd('0x73'),_0x1ecd('0x74')],'raw':!![]});}})[_0x1ecd('0x2c')](function(_0x2be71f){if(!_[_0x1ecd('0x92')](_0x2be71f)){var _0x198d5d=[];for(var _0x4d04ad=0x0;_0x4d04ad<_0x2be71f[_0x1ecd('0x47')];_0x4d04ad++){if(_0x2be71f[_0x4d04ad][_0x1ecd('0x72')]){_0x198d5d[_0x1ecd('0x8c')](db[_0x1ecd('0x7b')]['upsert']({'membername':_0x2be71f[_0x4d04ad][_0x1ecd('0x3b')],'UserId':_0x2be71f[_0x4d04ad]['id'],'queue_name':_0x24a9c3[_0x1ecd('0x3b')],'VoiceQueueId':_0x24a9c3['id'],'interface':_[_0x1ecd('0x7d')](_0x2be71f[_0x4d04ad][_0x1ecd('0x74')])?util['format'](_0x1ecd('0x7f'),_0x2be71f[_0x4d04ad][_0x1ecd('0x3b')]):_0x2be71f[_0x4d04ad][_0x1ecd('0x74')],'paused':_0x2be71f[_0x4d04ad]['voicePause']||![],'penalty':_0x2e08b1['body']['penalty']||0x0}));}}return BPromise['all'](_0x198d5d);}})[_0x1ecd('0x2c')](function(){return _0x438afe;})[_0x1ecd('0x2c')](respondWithResult(_0x3070f2,null))['catch'](handleError(_0x3070f2,null));};exports['removeAgents']=function(_0x1a8210,_0x4a06fe,_0x4a0050){return db['VoiceQueue'][_0x1ecd('0x39')]({'where':{'id':_0x1a8210[_0x1ecd('0x53')]['id']}})[_0x1ecd('0x2c')](handleEntityNotFound(_0x4a06fe,null))[_0x1ecd('0x2c')](function(_0x5ef1c8){if(_0x5ef1c8){return _0x5ef1c8[_0x1ecd('0x96')](_0x1a8210['query'][_0x1ecd('0x83')])[_0x1ecd('0x2c')](function(){if(_['isArray'](_0x1a8210[_0x1ecd('0x42')][_0x1ecd('0x83')])){for(var _0x3c5a36=0x0;_0x3c5a36<_0x1a8210[_0x1ecd('0x42')][_0x1ecd('0x83')][_0x1ecd('0x47')];_0x3c5a36+=0x1){socket[_0x1ecd('0x80')](_0x1ecd('0x94'),{'UserId':Number(_0x1a8210['query'][_0x1ecd('0x83')][_0x3c5a36]),'VoiceQueueId':Number(_0x1a8210['params']['id'])});}}else{socket[_0x1ecd('0x80')](_0x1ecd('0x94'),{'UserId':Number(_0x1a8210['query'][_0x1ecd('0x83')]),'VoiceQueueId':Number(_0x1a8210[_0x1ecd('0x53')]['id'])});}});}})['then'](function(_0x5c30f7){return db[_0x1ecd('0x7b')][_0x1ecd('0x2d')]({'where':{'VoiceQueueId':_0x1a8210[_0x1ecd('0x53')]['id'],'UserId':_0x1a8210[_0x1ecd('0x42')][_0x1ecd('0x83')]}})[_0x1ecd('0x2c')](function(){return _0x5c30f7;});})[_0x1ecd('0x2c')](respondWithStatusCode(_0x4a06fe,null))[_0x1ecd('0x51')](handleError(_0x4a06fe,null));};exports[_0x1ecd('0x97')]=function(_0x185906,_0x391f17,_0x123b5a){var _0x20b30c={};var _0x1fae13={};var _0xe36b4f;var _0x110d8a;return db[_0x1ecd('0x3d')]['findOne']({'where':{'id':_0x185906[_0x1ecd('0x53')]['id']}})[_0x1ecd('0x2c')](handleEntityNotFound(_0x391f17,null))['then'](function(_0x13e79f){if(_0x13e79f){_0xe36b4f=_0x13e79f;_0x1fae13['model']=_[_0x1ecd('0x54')](db[_0x1ecd('0x70')][_0x1ecd('0x3e')]);_0x1fae13[_0x1ecd('0x42')]=_[_0x1ecd('0x54')](_0x185906['query']);_0x1fae13[_0x1ecd('0x43')]=_['intersection'](_0x1fae13[_0x1ecd('0x41')],_0x1fae13[_0x1ecd('0x42')]);_0x20b30c[_0x1ecd('0x45')]=_[_0x1ecd('0x44')](_0x1fae13[_0x1ecd('0x41')],qs[_0x1ecd('0x46')](_0x185906['query']['fields']));_0x20b30c[_0x1ecd('0x45')]=_0x20b30c[_0x1ecd('0x45')][_0x1ecd('0x47')]?_0x20b30c[_0x1ecd('0x45')]:_0x1fae13[_0x1ecd('0x41')];_0x20b30c[_0x1ecd('0x49')]=qs[_0x1ecd('0x4a')](_0x185906['query'][_0x1ecd('0x4a')]);_0x20b30c[_0x1ecd('0x4b')]=qs[_0x1ecd('0x43')](_[_0x1ecd('0x6a')](_0x185906[_0x1ecd('0x42')],_0x1fae13[_0x1ecd('0x43')]));if(_0x185906['query']['filter']){_0x20b30c[_0x1ecd('0x4b')]=_[_0x1ecd('0x4c')](_0x20b30c['where'],{'$or':_[_0x1ecd('0x35')](_0x20b30c['attributes'],function(_0x3bbb05){var _0x7fd69a={};_0x7fd69a[_0x3bbb05]={'$like':'%'+_0x185906[_0x1ecd('0x42')][_0x1ecd('0x33')]+'%'};return _0x7fd69a;})});}_0x20b30c=_[_0x1ecd('0x4c')]({},_0x20b30c,_0x185906[_0x1ecd('0x55')]);return _0xe36b4f[_0x1ecd('0x97')](_0x20b30c);}})[_0x1ecd('0x2c')](function(_0xb42db8){if(_0xb42db8){_0x110d8a=_0xb42db8[_0x1ecd('0x47')];if(!_0x185906['query'][_0x1ecd('0x48')](_0x1ecd('0x66'))){_0x20b30c[_0x1ecd('0x23')]=qs[_0x1ecd('0x23')](_0x185906['query'][_0x1ecd('0x23')]);_0x20b30c[_0x1ecd('0x22')]=qs[_0x1ecd('0x22')](_0x185906[_0x1ecd('0x42')][_0x1ecd('0x22')]);}return _0xe36b4f['getAgents'](_0x20b30c);}})[_0x1ecd('0x2c')](function(_0x51590b){if(_0x51590b){return _0x51590b?{'count':_0x110d8a,'rows':_0x51590b}:null;}})[_0x1ecd('0x2c')](respondWithResult(_0x391f17,null))['catch'](handleError(_0x391f17,null));};exports[_0x1ecd('0x98')]=function(_0x3d4e92,_0x14d51e,_0x52bfd2){var _0xa2e3a6={};var _0x24fdd6={};var _0xc84aaf;var _0x20fb7a;return db['VoiceQueue'][_0x1ecd('0x65')]({'where':{'id':_0x3d4e92[_0x1ecd('0x53')]['id']}})[_0x1ecd('0x2c')](handleEntityNotFound(_0x14d51e,null))[_0x1ecd('0x2c')](function(_0x59ad0c){if(_0x59ad0c){_0xc84aaf=_0x59ad0c;_0x24fdd6[_0x1ecd('0x41')]=_[_0x1ecd('0x54')](db[_0x1ecd('0x7b')][_0x1ecd('0x3e')]);_0x24fdd6[_0x1ecd('0x42')]=_[_0x1ecd('0x54')](_0x3d4e92[_0x1ecd('0x42')]);_0x24fdd6[_0x1ecd('0x43')]=_[_0x1ecd('0x44')](_0x24fdd6['model'],_0x24fdd6[_0x1ecd('0x42')]);_0xa2e3a6[_0x1ecd('0x45')]=_[_0x1ecd('0x44')](_0x24fdd6[_0x1ecd('0x41')],qs[_0x1ecd('0x46')](_0x3d4e92[_0x1ecd('0x42')][_0x1ecd('0x46')]));_0xa2e3a6[_0x1ecd('0x45')]=_0xa2e3a6['attributes']['length']?_0xa2e3a6[_0x1ecd('0x45')]:_0x24fdd6[_0x1ecd('0x41')];_0xa2e3a6[_0x1ecd('0x49')]=qs[_0x1ecd('0x4a')](_0x3d4e92['query'][_0x1ecd('0x4a')]);_0xa2e3a6[_0x1ecd('0x4b')]=qs[_0x1ecd('0x43')](_[_0x1ecd('0x6a')](_0x3d4e92[_0x1ecd('0x42')],_0x24fdd6[_0x1ecd('0x43')]));if(_0x3d4e92[_0x1ecd('0x42')][_0x1ecd('0x33')]){_0xa2e3a6[_0x1ecd('0x4b')]=_[_0x1ecd('0x4c')](_0xa2e3a6[_0x1ecd('0x4b')],{'$or':_[_0x1ecd('0x35')](_0xa2e3a6[_0x1ecd('0x45')],function(_0x1dc5ae){var _0x34b6c0={};_0x34b6c0[_0x1dc5ae]={'$like':'%'+_0x3d4e92[_0x1ecd('0x42')][_0x1ecd('0x33')]+'%'};return _0x34b6c0;})});}_0xa2e3a6=_['merge']({},_0xa2e3a6,_0x3d4e92[_0x1ecd('0x55')]);return _0xc84aaf[_0x1ecd('0x98')](_0xa2e3a6);}})['then'](function(_0x513687){if(_0x513687){_0x20fb7a=_0x513687[_0x1ecd('0x47')];if(!_0x3d4e92[_0x1ecd('0x42')][_0x1ecd('0x48')](_0x1ecd('0x66'))){_0xa2e3a6[_0x1ecd('0x23')]=qs[_0x1ecd('0x23')](_0x3d4e92[_0x1ecd('0x42')][_0x1ecd('0x23')]);_0xa2e3a6[_0x1ecd('0x22')]=qs[_0x1ecd('0x22')](_0x3d4e92[_0x1ecd('0x42')][_0x1ecd('0x22')]);}return _0xc84aaf['getMembers'](_0xa2e3a6);}})[_0x1ecd('0x2c')](function(_0x43f6e8){return _0x43f6e8?{'count':_0x20fb7a,'rows':_0x43f6e8}:null;})[_0x1ecd('0x2c')](respondWithResult(_0x14d51e,null))[_0x1ecd('0x51')](handleError(_0x14d51e,null));};exports[_0x1ecd('0x99')]=function(_0x1711ab,_0x2846cb,_0x1de0b8){var _0x5b3030={};var _0x328506={};var _0x36da29;var _0x16b6f8;return db['VoiceQueue'][_0x1ecd('0x65')]({'where':{'id':_0x1711ab['params']['id']}})[_0x1ecd('0x2c')](handleEntityNotFound(_0x2846cb,null))[_0x1ecd('0x2c')](function(_0x485273){if(_0x485273){_0x36da29=_0x485273;_0x328506['model']=_[_0x1ecd('0x54')](db[_0x1ecd('0x9a')][_0x1ecd('0x3e')]);_0x328506[_0x1ecd('0x42')]=_[_0x1ecd('0x54')](_0x1711ab[_0x1ecd('0x42')]);_0x328506['filters']=_[_0x1ecd('0x44')](_0x328506['model'],_0x328506[_0x1ecd('0x42')]);_0x5b3030[_0x1ecd('0x45')]=_[_0x1ecd('0x44')](_0x328506[_0x1ecd('0x41')],qs[_0x1ecd('0x46')](_0x1711ab['query'][_0x1ecd('0x46')]));_0x5b3030[_0x1ecd('0x45')]=_0x5b3030[_0x1ecd('0x45')]['length']?_0x5b3030['attributes']:_0x328506[_0x1ecd('0x41')];_0x5b3030[_0x1ecd('0x49')]=qs[_0x1ecd('0x4a')](_0x1711ab['query']['sort']);_0x5b3030[_0x1ecd('0x4b')]=qs['filters'](_['pick'](_0x1711ab[_0x1ecd('0x42')],_0x328506[_0x1ecd('0x43')]));if(_0x1711ab[_0x1ecd('0x42')][_0x1ecd('0x33')]){_0x5b3030[_0x1ecd('0x4b')]=_[_0x1ecd('0x4c')](_0x5b3030['where'],{'$or':_[_0x1ecd('0x35')](_0x5b3030['attributes'],function(_0x436ea5){var _0x44b6ad={};_0x44b6ad[_0x436ea5]={'$like':'%'+_0x1711ab['query'][_0x1ecd('0x33')]+'%'};return _0x44b6ad;})});}_0x5b3030=_[_0x1ecd('0x4c')]({},_0x5b3030,_0x1711ab[_0x1ecd('0x55')]);return _0x36da29[_0x1ecd('0x99')](_0x5b3030);}})[_0x1ecd('0x2c')](function(_0x3ff107){if(_0x3ff107){_0x16b6f8=_0x3ff107[_0x1ecd('0x47')];if(!_0x1711ab[_0x1ecd('0x42')][_0x1ecd('0x48')](_0x1ecd('0x66'))){_0x5b3030[_0x1ecd('0x23')]=qs[_0x1ecd('0x23')](_0x1711ab['query'][_0x1ecd('0x23')]);_0x5b3030[_0x1ecd('0x22')]=qs[_0x1ecd('0x22')](_0x1711ab[_0x1ecd('0x42')][_0x1ecd('0x22')]);}return _0x36da29[_0x1ecd('0x99')](_0x5b3030);}})[_0x1ecd('0x2c')](function(_0x1ed433){if(_0x1ed433){return _0x1ed433?{'count':_0x16b6f8,'rows':_0x1ed433}:null;}})[_0x1ecd('0x2c')](respondWithResult(_0x2846cb,null))[_0x1ecd('0x51')](handleError(_0x2846cb,null));};exports[_0x1ecd('0x9b')]=function(_0x465a40,_0x3878ba,_0x2f4969){var _0x43aaae,_0x3dc690;return db[_0x1ecd('0x3d')][_0x1ecd('0x39')]({'where':{'id':_0x465a40[_0x1ecd('0x53')]['id']}})[_0x1ecd('0x2c')](handleEntityNotFound(_0x3878ba,null))['then'](function(_0x3e5033){if(_0x3e5033){_0x3dc690=_0x3e5033;return _0x3e5033['addLists'](_0x465a40[_0x1ecd('0x60')][_0x1ecd('0x83')],_[_0x1ecd('0x9c')](_0x465a40[_0x1ecd('0x60')],[_0x1ecd('0x83'),'id'])||{});}return null;})[_0x1ecd('0x9d')](function(_0x25dee0){var _0x8c073f;_0x43aaae=_0x25dee0||[];var _0x1daa65=[];if(_0x25dee0){for(var _0xc0e380=0x0;_0xc0e380<_0x25dee0['length'];_0xc0e380+=0x1){var _0xb8c089=_0x25dee0[_0xc0e380][_0x1ecd('0x2e')]({'plain':!![]});_0x3dc690['dialCheckDuplicateType']=_0x465a40['body']['dialCheckDuplicateType']?_0x465a40['body'][_0x1ecd('0x9e')]:_0x3dc690[_0x1ecd('0x9e')];switch(_0x3dc690[_0x1ecd('0x9e')]){case _0x1ecd('0x9f'):_0x8c073f=squel['insert']()[_0x1ecd('0xa0')](_0x1ecd('0xa1'))[_0x1ecd('0xa2')]([_0x1ecd('0xa3'),_0x1ecd('0xa4'),'ContactId','ListId','VoiceQueueId',_0x1ecd('0x5e'),_0x1ecd('0x5f')],squel['select']()[_0x1ecd('0x85')](_0x1ecd('0xa3'),_0x1ecd('0xa3'))[_0x1ecd('0x85')](_0x1ecd('0xa5'),_0x1ecd('0xa4'))[_0x1ecd('0x85')]('id',_0x1ecd('0xa6'))[_0x1ecd('0x85')](_0xb8c089[_0x1ecd('0xa7')][_0x1ecd('0x8d')](),_0x1ecd('0xa8'))['field'](_0x465a40[_0x1ecd('0x53')]['id']['toString'](),'VoiceQueueId')[_0x1ecd('0x85')](_0x1ecd('0xa5'),'createdAt')[_0x1ecd('0x85')]('NOW()','updatedAt')['from'](_0x1ecd('0xa9'))[_0x1ecd('0x4b')](_0x1ecd('0xaa'))[_0x1ecd('0x4b')](_0x1ecd('0xab'),_0xb8c089[_0x1ecd('0xa7')][_0x1ecd('0x8d')]())[_0x1ecd('0x4b')](_0x1ecd('0xac'))['where'](_0x1ecd('0xad'),squel['select']()[_0x1ecd('0x85')](_0x1ecd('0xae'))[_0x1ecd('0x87')]('cm_hopper_final')['where'](_0x1ecd('0x8a'),_0x465a40[_0x1ecd('0x53')]['id']['toString']()))[_0x1ecd('0x4b')](_0x1ecd('0xad'),squel[_0x1ecd('0x84')]()[_0x1ecd('0x85')](_0x1ecd('0xaf'))[_0x1ecd('0x87')](_0x1ecd('0xa1'))['where']('VoiceQueueId\x20=\x20?',_0x465a40[_0x1ecd('0x53')]['id'][_0x1ecd('0x8d')]())))['toString']();break;case _0x1ecd('0xb0'):_0x8c073f=squel[_0x1ecd('0xb1')]()[_0x1ecd('0xa0')](_0x1ecd('0xa1'))[_0x1ecd('0xa2')]([_0x1ecd('0xa3'),_0x1ecd('0xa4'),'ContactId','ListId',_0x1ecd('0x67'),_0x1ecd('0x5e'),_0x1ecd('0x5f')],squel[_0x1ecd('0x84')]()[_0x1ecd('0x85')](_0x1ecd('0xa3'),_0x1ecd('0xa3'))[_0x1ecd('0x85')](_0x1ecd('0xa5'),_0x1ecd('0xa4'))['field']('id',_0x1ecd('0xa6'))['field'](_0xb8c089[_0x1ecd('0xa7')][_0x1ecd('0x8d')](),_0x1ecd('0xa8'))[_0x1ecd('0x85')](_0x465a40[_0x1ecd('0x53')]['id']['toString'](),_0x1ecd('0x67'))[_0x1ecd('0x85')](_0x1ecd('0xa5'),_0x1ecd('0x5e'))['field'](_0x1ecd('0xa5'),_0x1ecd('0x5f'))[_0x1ecd('0x87')](_0x1ecd('0xa9'))[_0x1ecd('0x4b')](_0x1ecd('0xaa'))[_0x1ecd('0x4b')]('ListId\x20=\x20?',_0xb8c089[_0x1ecd('0xa7')][_0x1ecd('0x8d')]())[_0x1ecd('0x4b')](_0x1ecd('0xac'))[_0x1ecd('0x4b')]('phone\x20NOT\x20IN\x20(?)',squel['select']()['field'](_0x1ecd('0xaf'))['from'](_0x1ecd('0xa1'))[_0x1ecd('0x4b')](_0x1ecd('0x8a'),_0x465a40['params']['id'][_0x1ecd('0x8d')]())))[_0x1ecd('0x8d')]();break;default:_0x8c073f=squel['insert']()[_0x1ecd('0xa0')]('cm_hopper')[_0x1ecd('0xa2')]([_0x1ecd('0xa3'),_0x1ecd('0xa4'),_0x1ecd('0xa6'),_0x1ecd('0xa8'),_0x1ecd('0x67'),_0x1ecd('0x5e'),_0x1ecd('0x5f')],squel['select']()[_0x1ecd('0x85')]('phone',_0x1ecd('0xa3'))[_0x1ecd('0x85')](_0x1ecd('0xa5'),_0x1ecd('0xa4'))[_0x1ecd('0x85')]('id',_0x1ecd('0xa6'))[_0x1ecd('0x85')](_0xb8c089[_0x1ecd('0xa7')][_0x1ecd('0x8d')](),_0x1ecd('0xa8'))[_0x1ecd('0x85')](_0x465a40[_0x1ecd('0x53')]['id']['toString'](),'VoiceQueueId')[_0x1ecd('0x85')](_0x1ecd('0xa5'),_0x1ecd('0x5e'))[_0x1ecd('0x85')](_0x1ecd('0xa5'),'updatedAt')['from'](_0x1ecd('0xa9'))[_0x1ecd('0x4b')](_0x1ecd('0xaa'))[_0x1ecd('0x4b')](_0x1ecd('0xab'),_0xb8c089[_0x1ecd('0xa7')][_0x1ecd('0x8d')]())[_0x1ecd('0x4b')](_0x1ecd('0xac')))[_0x1ecd('0x8d')]();}_0x1daa65[_0x1ecd('0x8c')](db['sequelize'][_0x1ecd('0x42')](_0x8c073f));}return BPromise[_0x1ecd('0xb2')](_0x1daa65);}})['then'](function(){return _0x43aaae;})['then'](respondWithResult(_0x3878ba,null))['catch'](handleError(_0x3878ba,null));};exports[_0x1ecd('0xb3')]=function(_0x5c057e,_0x472400,_0x29bec6){return db['VoiceQueue']['find']({'where':{'id':_0x5c057e[_0x1ecd('0x53')]['id']}})['then'](handleEntityNotFound(_0x472400,null))[_0x1ecd('0x2c')](function(_0xe32889){if(_0xe32889){return _0xe32889[_0x1ecd('0xb3')](_0x5c057e['query'][_0x1ecd('0x83')]);}})[_0x1ecd('0x2c')](function(_0x36069d){if(_0x36069d){return db[_0x1ecd('0x63')][_0x1ecd('0x2d')]({'where':{'ListId':_0x5c057e[_0x1ecd('0x42')][_0x1ecd('0x83')],'VoiceQueueId':_0x5c057e[_0x1ecd('0x53')]['id']}})[_0x1ecd('0x2c')](function(){return _0x36069d;});}})[_0x1ecd('0x2c')](respondWithStatusCode(_0x472400,null))[_0x1ecd('0x51')](handleError(_0x472400,null));};exports[_0x1ecd('0xb4')]=function(_0x39997b,_0xee945b,_0x2a2682){var _0x1baa79={};var _0x21f9a7={};var _0x405529;var _0xfeee65;return db[_0x1ecd('0x3d')][_0x1ecd('0x65')]({'where':{'id':_0x39997b[_0x1ecd('0x53')]['id']}})['then'](handleEntityNotFound(_0xee945b,null))['then'](function(_0x44314){if(_0x44314){_0x405529=_0x44314;_0x21f9a7[_0x1ecd('0x41')]=_[_0x1ecd('0x54')](db[_0x1ecd('0x9a')][_0x1ecd('0x3e')]);_0x21f9a7['query']=_['keys'](_0x39997b[_0x1ecd('0x42')]);_0x21f9a7['filters']=_[_0x1ecd('0x44')](_0x21f9a7[_0x1ecd('0x41')],_0x21f9a7[_0x1ecd('0x42')]);_0x1baa79[_0x1ecd('0x45')]=_[_0x1ecd('0x44')](_0x21f9a7['model'],qs[_0x1ecd('0x46')](_0x39997b['query'][_0x1ecd('0x46')]));_0x1baa79[_0x1ecd('0x45')]=_0x1baa79[_0x1ecd('0x45')][_0x1ecd('0x47')]?_0x1baa79[_0x1ecd('0x45')]:_0x21f9a7[_0x1ecd('0x41')];_0x1baa79[_0x1ecd('0x49')]=qs[_0x1ecd('0x4a')](_0x39997b['query'][_0x1ecd('0x4a')]);_0x1baa79['where']=qs[_0x1ecd('0x43')](_['pick'](_0x39997b[_0x1ecd('0x42')],_0x21f9a7['filters']));if(_0x39997b['query'][_0x1ecd('0x33')]){_0x1baa79[_0x1ecd('0x4b')]=_[_0x1ecd('0x4c')](_0x1baa79[_0x1ecd('0x4b')],{'$or':_[_0x1ecd('0x35')](_0x1baa79[_0x1ecd('0x45')],function(_0x1e9fe5){var _0x225ade={};_0x225ade[_0x1e9fe5]={'$like':'%'+_0x39997b['query'][_0x1ecd('0x33')]+'%'};return _0x225ade;})});}_0x1baa79=_[_0x1ecd('0x4c')]({},_0x1baa79,_0x39997b[_0x1ecd('0x55')]);return _0x405529[_0x1ecd('0xb4')](_0x1baa79);}})[_0x1ecd('0x2c')](function(_0x5e96db){if(_0x5e96db){_0xfeee65=_0x5e96db['length'];if(!_0x39997b[_0x1ecd('0x42')][_0x1ecd('0x48')]('nolimit')){_0x1baa79[_0x1ecd('0x23')]=qs[_0x1ecd('0x23')](_0x39997b[_0x1ecd('0x42')]['limit']);_0x1baa79[_0x1ecd('0x22')]=qs['offset'](_0x39997b[_0x1ecd('0x42')]['offset']);}return _0x405529[_0x1ecd('0xb4')](_0x1baa79);}})['then'](function(_0x2e6bc0){if(_0x2e6bc0){return _0x2e6bc0?{'count':_0xfeee65,'rows':_0x2e6bc0}:null;}})[_0x1ecd('0x2c')](respondWithResult(_0xee945b,null))[_0x1ecd('0x51')](handleError(_0xee945b,null));};exports['addBlackLists']=function(_0x3253d8,_0x1a522c,_0x4e02f4){var _0x5ca9ce,_0x5b8e61;return db[_0x1ecd('0x3d')][_0x1ecd('0x39')]({'where':{'id':_0x3253d8[_0x1ecd('0x53')]['id']}})[_0x1ecd('0x2c')](handleEntityNotFound(_0x1a522c,null))[_0x1ecd('0x2c')](function(_0x1e6bd6){if(_0x1e6bd6){_0x5b8e61=_0x1e6bd6;return _0x1e6bd6[_0x1ecd('0xb5')](_0x3253d8[_0x1ecd('0x60')]['ids'],_[_0x1ecd('0x9c')](_0x3253d8['body'],[_0x1ecd('0x83'),'id'])||{});}return null;})[_0x1ecd('0x9d')](function(_0x25ced3){var _0x759e9;_0x5ca9ce=_0x25ced3||[];var _0x866213=[];if(_0x25ced3){for(var _0x240b37=0x0;_0x240b37<_0x25ced3[_0x1ecd('0x47')];_0x240b37+=0x1){var _0x62e10b=_0x25ced3[_0x240b37][_0x1ecd('0x2e')]({'plain':!![]});_0x759e9=squel['insert']()[_0x1ecd('0xa0')](_0x1ecd('0xb6'))['fromQuery']([_0x1ecd('0xa3'),_0x1ecd('0xa6'),'ListId',_0x1ecd('0x67'),_0x1ecd('0x5e'),'updatedAt'],squel[_0x1ecd('0x84')]()[_0x1ecd('0x85')](_0x1ecd('0xa3'),'phone')['field']('id',_0x1ecd('0xa6'))[_0x1ecd('0x85')](_0x62e10b[_0x1ecd('0xa7')][_0x1ecd('0x8d')](),_0x1ecd('0xa8'))[_0x1ecd('0x85')](_0x3253d8[_0x1ecd('0x53')]['id'][_0x1ecd('0x8d')](),_0x1ecd('0x67'))[_0x1ecd('0x85')]('NOW()','createdAt')[_0x1ecd('0x85')](_0x1ecd('0xa5'),_0x1ecd('0x5f'))[_0x1ecd('0x87')](_0x1ecd('0xa9'))[_0x1ecd('0x4b')]('deletedAt\x20IS\x20NULL')[_0x1ecd('0x4b')](_0x1ecd('0xab'),_0x62e10b[_0x1ecd('0xa7')][_0x1ecd('0x8d')]())[_0x1ecd('0x4b')]('phone\x20IS\x20NOT\x20NULL'))['toString']();_0x866213[_0x1ecd('0x8c')](db[_0x1ecd('0x76')][_0x1ecd('0x42')](_0x759e9));}return BPromise['all'](_0x866213);}})[_0x1ecd('0x2c')](function(){return _0x5ca9ce;})[_0x1ecd('0x2c')](respondWithResult(_0x1a522c,null))[_0x1ecd('0x51')](handleError(_0x1a522c,null));};exports[_0x1ecd('0xb7')]=function(_0x263100,_0xc6d142,_0x90d63b){return db[_0x1ecd('0x3d')][_0x1ecd('0x39')]({'where':{'id':_0x263100[_0x1ecd('0x53')]['id']}})['then'](handleEntityNotFound(_0xc6d142,null))[_0x1ecd('0x2c')](function(_0x2c915c){if(_0x2c915c){return _0x2c915c[_0x1ecd('0xb7')](_0x263100[_0x1ecd('0x42')]['ids']);}})[_0x1ecd('0x2c')](function(_0x370085){if(_0x370085){return db['CmHopperBlack'][_0x1ecd('0x2d')]({'where':{'ListId':_0x263100[_0x1ecd('0x42')]['ids'],'VoiceQueueId':_0x263100['params']['id']}})['then'](function(){return _0x370085;});}})[_0x1ecd('0x2c')](respondWithStatusCode(_0xc6d142,null))[_0x1ecd('0x51')](handleError(_0xc6d142,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index 03bfc6e..a17714d 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 _0x2691=['exports','events','../../mysqldb','VoiceQueue','setMaxListeners','save','update','emit','hasOwnProperty','hook'];(function(_0x9e7f3a,_0x37105f){var _0x5ab145=function(_0x5b3bad){while(--_0x5b3bad){_0x9e7f3a['push'](_0x9e7f3a['shift']());}};_0x5ab145(++_0x37105f);}(_0x2691,0x1c3));var _0x1269=function(_0x4a1d58,_0x230fe9){_0x4a1d58=_0x4a1d58-0x0;var _0x18fcc3=_0x2691[_0x4a1d58];return _0x18fcc3;};'use strict';var EventEmitter=require(_0x1269('0x0'));var VoiceQueue=require(_0x1269('0x1'))['db'][_0x1269('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x1269('0x3')](0x0);var events={'afterCreate':_0x1269('0x4'),'afterUpdate':_0x1269('0x5'),'afterDestroy':'remove'};function emitEvent(_0x1779dc){return function(_0x263585,_0x3ae947,_0x2b1250){VoiceQueueEvents[_0x1269('0x6')](_0x1779dc+':'+_0x263585['id'],_0x263585);VoiceQueueEvents[_0x1269('0x6')](_0x1779dc,_0x263585);_0x2b1250(null);};}for(var e in events){if(events[_0x1269('0x7')](e)){var event=events[e];VoiceQueue[_0x1269('0x8')](e,emitEvent(event));}}module[_0x1269('0x9')]=VoiceQueueEvents; \ No newline at end of file +var _0x23f0=['../../mysqldb','VoiceQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x1e2de8,_0x27779c){var _0x4a2f76=function(_0x31e19a){while(--_0x31e19a){_0x1e2de8['push'](_0x1e2de8['shift']());}};_0x4a2f76(++_0x27779c);}(_0x23f0,0x77));var _0x023f=function(_0x5aaae1,_0x264302){_0x5aaae1=_0x5aaae1-0x0;var _0x1d7e43=_0x23f0[_0x5aaae1];return _0x1d7e43;};'use strict';var EventEmitter=require(_0x023f('0x0'));var VoiceQueue=require(_0x023f('0x1'))['db'][_0x023f('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x023f('0x3')](0x0);var events={'afterCreate':_0x023f('0x4'),'afterUpdate':_0x023f('0x5'),'afterDestroy':_0x023f('0x6')};function emitEvent(_0x16897b){return function(_0x4c5703,_0x3e1cc4,_0x246e2c){VoiceQueueEvents[_0x023f('0x7')](_0x16897b+':'+_0x4c5703['id'],_0x4c5703);VoiceQueueEvents['emit'](_0x16897b,_0x4c5703);_0x246e2c(null);};}for(var e in events){if(events[_0x023f('0x8')](e)){var event=events[e];VoiceQueue[_0x023f('0x9')](e,emitEvent(event));}}module['exports']=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index 940a79b..961b89b 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 _0x008c=['define','voice_queues','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./voiceQueue.attributes','exports'];(function(_0x1877e2,_0x2b76d4){var _0x44e96a=function(_0x8760bf){while(--_0x8760bf){_0x1877e2['push'](_0x1877e2['shift']());}};_0x44e96a(++_0x2b76d4);}(_0x008c,0x188));var _0xc008=function(_0xa72e3a,_0x4d3bd1){_0xa72e3a=_0xa72e3a-0x0;var _0x41cff3=_0x008c[_0xa72e3a];return _0x41cff3;};'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')]('VoiceQueue',attributes,{'tableName':_0xc008('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x008c=['define','voice_queues','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./voiceQueue.attributes','exports'];(function(_0x40348a,_0x5c0bb3){var _0x290d46=function(_0x5dc702){while(--_0x5dc702){_0x40348a['push'](_0x40348a['shift']());}};_0x290d46(++_0x5c0bb3);}(_0x008c,0x188));var _0xc008=function(_0x50521f,_0x4375b3){_0x50521f=_0x50521f-0x0;var _0x29b4be=_0x008c[_0x50521f];return _0x29b4be;};'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')]('VoiceQueue',attributes,{'tableName':_0xc008('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.rpc.js b/server/api/voiceQueue/voiceQueue.rpc.js index b61a53b..d8f56d6 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 _0xaeea=['defaults','localhost','./voiceQueue.socket','register','then','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','GetVoiceQueue','findAll','options','where','include','map','attributes','model','VoiceQueue','find','raw','ShowVoiceQueue','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis'];(function(_0x21a01c,_0x22a078){var _0x12c123=function(_0x40b1f8){while(--_0x40b1f8){_0x21a01c['push'](_0x21a01c['shift']());}};_0x12c123(++_0x22a078);}(_0xaeea,0x8a));var _0xaaee=function(_0x121ab0,_0x56fcd3){_0x121ab0=_0x121ab0-0x0;var _0x4d94f0=_0xaeea[_0x121ab0];return _0x4d94f0;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xaaee('0x0'));var db=require(_0xaaee('0x1'))['db'];var utils=require(_0xaaee('0x2'));var logger=require(_0xaaee('0x3'))(_0xaaee('0x4'));var config=require(_0xaaee('0x5'));var jayson=require(_0xaaee('0x6'));var client=jayson[_0xaaee('0x7')][_0xaaee('0x8')]({'port':0x232a});config[_0xaaee('0x9')]=_[_0xaaee('0xa')](config[_0xaaee('0x9')],{'host':_0xaaee('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xaaee('0x9')]));require(_0xaaee('0xc'))[_0xaaee('0xd')](socket);function respondWithRpcPromise(_0x1932f9,_0x28db60,_0x4d2c06){return new BPromise(function(_0x5541b8,_0x37165d){return client['request'](_0x1932f9,_0x4d2c06)[_0xaaee('0xe')](function(_0x2914a8){logger[_0xaaee('0xf')](_0xaaee('0x10'),_0x28db60,_0xaaee('0x11'));logger[_0xaaee('0x12')]('VoiceQueue,\x20%s,\x20%s,\x20%s',_0x28db60,_0xaaee('0x11'),JSON[_0xaaee('0x13')](_0x2914a8));if(_0x2914a8[_0xaaee('0x14')]){if(_0x2914a8['error'][_0xaaee('0x15')]===0x1f4){logger[_0xaaee('0x14')](_0xaaee('0x10'),_0x28db60,_0x2914a8['error'][_0xaaee('0x16')]);return _0x37165d(_0x2914a8[_0xaaee('0x14')][_0xaaee('0x16')]);}logger[_0xaaee('0x14')]('VoiceQueue,\x20%s,\x20%s',_0x28db60,_0x2914a8['error'][_0xaaee('0x16')]);return _0x5541b8(_0x2914a8[_0xaaee('0x14')][_0xaaee('0x16')]);}else{logger[_0xaaee('0xf')](_0xaaee('0x10'),_0x28db60,'request\x20sent');_0x5541b8(_0x2914a8[_0xaaee('0x17')][_0xaaee('0x16')]);}})[_0xaaee('0x18')](function(_0x2b67f0){logger['error'](_0xaaee('0x10'),_0x28db60,_0x2b67f0);_0x37165d(_0x2b67f0);});});}exports[_0xaaee('0x19')]=function(_0x46dd1a){var _0x47e4d9=this;return new Promise(function(_0x33c63d,_0x3728e8){return db['VoiceQueue'][_0xaaee('0x1a')]({'raw':_0x46dd1a[_0xaaee('0x1b')]?_0x46dd1a[_0xaaee('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x46dd1a[_0xaaee('0x1b')]?_0x46dd1a[_0xaaee('0x1b')][_0xaaee('0x1c')]||null:null,'attributes':_0x46dd1a[_0xaaee('0x1b')]?_0x46dd1a[_0xaaee('0x1b')]['attributes']||null:null,'limit':_0x46dd1a[_0xaaee('0x1b')]?_0x46dd1a['options']['limit']||null:null,'include':_0x46dd1a[_0xaaee('0x1b')]?_0x46dd1a['options'][_0xaaee('0x1d')]?_[_0xaaee('0x1e')](_0x46dd1a['options'][_0xaaee('0x1d')],function(_0x2adb26){return{'model':db[_0x2adb26['model']],'as':_0x2adb26['as'],'attributes':_0x2adb26[_0xaaee('0x1f')],'include':_0x2adb26[_0xaaee('0x1d')]?_['map'](_0x2adb26[_0xaaee('0x1d')],function(_0x2a2f58){return{'model':db[_0x2a2f58['model']],'as':_0x2a2f58['as'],'attributes':_0x2a2f58[_0xaaee('0x1f')],'include':_0x2a2f58['include']?_['map'](_0x2a2f58[_0xaaee('0x1d')],function(_0x529d84){return{'model':db[_0x529d84[_0xaaee('0x20')]],'as':_0x529d84['as'],'attributes':_0x529d84[_0xaaee('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xaaee('0xe')](function(_0x438243){logger[_0xaaee('0xf')](_0xaaee('0x19'),_0x46dd1a);logger[_0xaaee('0x12')](_0xaaee('0x19'),_0x46dd1a,JSON[_0xaaee('0x13')](_0x438243));_0x33c63d(_0x438243);})[_0xaaee('0x18')](function(_0x3ca61e){logger[_0xaaee('0x14')](_0xaaee('0x19'),_0x3ca61e[_0xaaee('0x16')],_0x46dd1a);_0x3728e8(_0x47e4d9[_0xaaee('0x14')](0x1f4,_0x3ca61e[_0xaaee('0x16')]));});});};exports['ShowVoiceQueue']=function(_0x65dfea){var _0x55febc=this;return new Promise(function(_0x407d0c,_0x1ab17e){return db[_0xaaee('0x21')][_0xaaee('0x22')]({'raw':_0x65dfea[_0xaaee('0x1b')]?_0x65dfea[_0xaaee('0x1b')][_0xaaee('0x23')]===undefined?!![]:![]:!![],'where':_0x65dfea[_0xaaee('0x1b')]?_0x65dfea[_0xaaee('0x1b')][_0xaaee('0x1c')]||null:null,'attributes':_0x65dfea['options']?_0x65dfea[_0xaaee('0x1b')][_0xaaee('0x1f')]||null:null,'include':_0x65dfea[_0xaaee('0x1b')]?_0x65dfea[_0xaaee('0x1b')][_0xaaee('0x1d')]?_[_0xaaee('0x1e')](_0x65dfea[_0xaaee('0x1b')]['include'],function(_0x18e2f4){return{'model':db[_0x18e2f4[_0xaaee('0x20')]],'as':_0x18e2f4['as'],'attributes':_0x18e2f4[_0xaaee('0x1f')],'include':_0x18e2f4[_0xaaee('0x1d')]?_[_0xaaee('0x1e')](_0x18e2f4[_0xaaee('0x1d')],function(_0x1be841){return{'model':db[_0x1be841['model']],'as':_0x1be841['as'],'attributes':_0x1be841[_0xaaee('0x1f')],'include':_0x1be841[_0xaaee('0x1d')]?_[_0xaaee('0x1e')](_0x1be841['include'],function(_0xb0c49d){return{'model':db[_0xb0c49d[_0xaaee('0x20')]],'as':_0xb0c49d['as'],'attributes':_0xb0c49d[_0xaaee('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1f56f3){logger[_0xaaee('0xf')]('ShowVoiceQueue',_0x65dfea);logger[_0xaaee('0x12')](_0xaaee('0x24'),_0x65dfea,JSON[_0xaaee('0x13')](_0x1f56f3));_0x407d0c(_0x1f56f3);})['catch'](function(_0x5bd328){logger['error'](_0xaaee('0x24'),_0x5bd328[_0xaaee('0x16')],_0x65dfea);_0x1ab17e(_0x55febc[_0xaaee('0x14')](0x1f4,_0x5bd328[_0xaaee('0x16')]));});});}; \ No newline at end of file +var _0x8832=['limit','include','model','map','stringify','ShowVoiceQueue','find','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','register','request','then','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','GetVoiceQueue','VoiceQueue','options','raw','where','attributes'];(function(_0x2bb438,_0x25ff3d){var _0x453f04=function(_0x85d185){while(--_0x85d185){_0x2bb438['push'](_0x2bb438['shift']());}};_0x453f04(++_0x25ff3d);}(_0x8832,0x150));var _0x2883=function(_0x14fa01,_0x4c66c4){_0x14fa01=_0x14fa01-0x0;var _0x1084cd=_0x8832[_0x14fa01];return _0x1084cd;};'use strict';var _=require(_0x2883('0x0'));var util=require(_0x2883('0x1'));var moment=require(_0x2883('0x2'));var BPromise=require(_0x2883('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2883('0x4'))['db'];var utils=require(_0x2883('0x5'));var logger=require(_0x2883('0x6'))(_0x2883('0x7'));var config=require(_0x2883('0x8'));var jayson=require(_0x2883('0x9'));var client=jayson[_0x2883('0xa')][_0x2883('0xb')]({'port':0x232a});config[_0x2883('0xc')]=_[_0x2883('0xd')](config['redis'],{'host':_0x2883('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2883('0xc')]));require('./voiceQueue.socket')[_0x2883('0xf')](socket);function respondWithRpcPromise(_0x3fd157,_0x21b368,_0x4cc71d){return new BPromise(function(_0x3f8dd4,_0x2ff26a){return client[_0x2883('0x10')](_0x3fd157,_0x4cc71d)[_0x2883('0x11')](function(_0x431b02){logger[_0x2883('0x12')](_0x2883('0x13'),_0x21b368,_0x2883('0x14'));logger[_0x2883('0x15')](_0x2883('0x16'),_0x21b368,_0x2883('0x14'),JSON['stringify'](_0x431b02));if(_0x431b02[_0x2883('0x17')]){if(_0x431b02[_0x2883('0x17')][_0x2883('0x18')]===0x1f4){logger[_0x2883('0x17')]('VoiceQueue,\x20%s,\x20%s',_0x21b368,_0x431b02[_0x2883('0x17')]['message']);return _0x2ff26a(_0x431b02[_0x2883('0x17')][_0x2883('0x19')]);}logger['error'](_0x2883('0x13'),_0x21b368,_0x431b02[_0x2883('0x17')][_0x2883('0x19')]);return _0x3f8dd4(_0x431b02[_0x2883('0x17')]['message']);}else{logger[_0x2883('0x12')](_0x2883('0x13'),_0x21b368,_0x2883('0x14'));_0x3f8dd4(_0x431b02[_0x2883('0x1a')][_0x2883('0x19')]);}})['catch'](function(_0x4f7fc9){logger[_0x2883('0x17')]('VoiceQueue,\x20%s,\x20%s',_0x21b368,_0x4f7fc9);_0x2ff26a(_0x4f7fc9);});});}exports[_0x2883('0x1b')]=function(_0x148988){var _0x3f5d10=this;return new Promise(function(_0x5d9100,_0x359b85){return db[_0x2883('0x1c')]['findAll']({'raw':_0x148988[_0x2883('0x1d')]?_0x148988[_0x2883('0x1d')][_0x2883('0x1e')]===undefined?!![]:![]:!![],'where':_0x148988[_0x2883('0x1d')]?_0x148988[_0x2883('0x1d')][_0x2883('0x1f')]||null:null,'attributes':_0x148988['options']?_0x148988['options'][_0x2883('0x20')]||null:null,'limit':_0x148988[_0x2883('0x1d')]?_0x148988['options'][_0x2883('0x21')]||null:null,'include':_0x148988[_0x2883('0x1d')]?_0x148988[_0x2883('0x1d')]['include']?_['map'](_0x148988[_0x2883('0x1d')][_0x2883('0x22')],function(_0xba58ad){return{'model':db[_0xba58ad[_0x2883('0x23')]],'as':_0xba58ad['as'],'attributes':_0xba58ad[_0x2883('0x20')],'include':_0xba58ad[_0x2883('0x22')]?_[_0x2883('0x24')](_0xba58ad['include'],function(_0x73c4fd){return{'model':db[_0x73c4fd[_0x2883('0x23')]],'as':_0x73c4fd['as'],'attributes':_0x73c4fd[_0x2883('0x20')],'include':_0x73c4fd[_0x2883('0x22')]?_[_0x2883('0x24')](_0x73c4fd[_0x2883('0x22')],function(_0xa7d482){return{'model':db[_0xa7d482[_0x2883('0x23')]],'as':_0xa7d482['as'],'attributes':_0xa7d482[_0x2883('0x20')]};}):[]};}):[]};}):[]:[]})[_0x2883('0x11')](function(_0x13d568){logger[_0x2883('0x12')](_0x2883('0x1b'),_0x148988);logger[_0x2883('0x15')](_0x2883('0x1b'),_0x148988,JSON[_0x2883('0x25')](_0x13d568));_0x5d9100(_0x13d568);})['catch'](function(_0x50e4b4){logger[_0x2883('0x17')](_0x2883('0x1b'),_0x50e4b4[_0x2883('0x19')],_0x148988);_0x359b85(_0x3f5d10[_0x2883('0x17')](0x1f4,_0x50e4b4[_0x2883('0x19')]));});});};exports[_0x2883('0x26')]=function(_0x1395fc){var _0x501d0f=this;return new Promise(function(_0x3343cb,_0x208b8c){return db[_0x2883('0x1c')][_0x2883('0x27')]({'raw':_0x1395fc[_0x2883('0x1d')]?_0x1395fc[_0x2883('0x1d')][_0x2883('0x1e')]===undefined?!![]:![]:!![],'where':_0x1395fc['options']?_0x1395fc[_0x2883('0x1d')][_0x2883('0x1f')]||null:null,'attributes':_0x1395fc[_0x2883('0x1d')]?_0x1395fc['options']['attributes']||null:null,'include':_0x1395fc['options']?_0x1395fc[_0x2883('0x1d')]['include']?_[_0x2883('0x24')](_0x1395fc[_0x2883('0x1d')][_0x2883('0x22')],function(_0x1e28ed){return{'model':db[_0x1e28ed[_0x2883('0x23')]],'as':_0x1e28ed['as'],'attributes':_0x1e28ed['attributes'],'include':_0x1e28ed[_0x2883('0x22')]?_[_0x2883('0x24')](_0x1e28ed[_0x2883('0x22')],function(_0x1b2e02){return{'model':db[_0x1b2e02[_0x2883('0x23')]],'as':_0x1b2e02['as'],'attributes':_0x1b2e02[_0x2883('0x20')],'include':_0x1b2e02[_0x2883('0x22')]?_['map'](_0x1b2e02['include'],function(_0x14e455){return{'model':db[_0x14e455[_0x2883('0x23')]],'as':_0x14e455['as'],'attributes':_0x14e455['attributes']};}):[]};}):[]};}):[]:[]})[_0x2883('0x11')](function(_0x452dac){logger[_0x2883('0x12')](_0x2883('0x26'),_0x1395fc);logger['debug'](_0x2883('0x26'),_0x1395fc,JSON[_0x2883('0x25')](_0x452dac));_0x3343cb(_0x452dac);})[_0x2883('0x28')](function(_0x5369a5){logger[_0x2883('0x17')](_0x2883('0x26'),_0x5369a5[_0x2883('0x19')],_0x1395fc);_0x208b8c(_0x501d0f[_0x2883('0x17')](0x1f4,_0x5369a5[_0x2883('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index 9008ec3..7319e5d 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 _0x07d8=['removeListener','register','length','voiceQueue:','save','remove','update'];(function(_0x4fe95c,_0x5c291e){var _0xfd71b7=function(_0x943ead){while(--_0x943ead){_0x4fe95c['push'](_0x4fe95c['shift']());}};_0xfd71b7(++_0x5c291e);}(_0x07d8,0x169));var _0x807d=function(_0x279f0d,_0x1538c5){_0x279f0d=_0x279f0d-0x0;var _0x3d5289=_0x07d8[_0x279f0d];return _0x3d5289;};'use strict';var VoiceQueueEvents=require('./voiceQueue.events');var events=[_0x807d('0x0'),_0x807d('0x1'),_0x807d('0x2')];function createListener(_0x1cedea,_0x5612f9){return function(_0x1d4792){_0x5612f9['emit'](_0x1cedea,_0x1d4792);};}function removeListener(_0x1e951d,_0x5a85a1){return function(){VoiceQueueEvents[_0x807d('0x3')](_0x1e951d,_0x5a85a1);};}exports[_0x807d('0x4')]=function(_0x341c24){for(var _0x37dadf=0x0,_0x2bc6e3=events[_0x807d('0x5')];_0x37dadf<_0x2bc6e3;_0x37dadf++){var _0x123633=events[_0x37dadf];var _0x2f7530=createListener(_0x807d('0x6')+_0x123633,_0x341c24);VoiceQueueEvents['on'](_0x123633,_0x2f7530);}}; \ No newline at end of file +var _0x0b7f=['update','emit','removeListener','register','length','./voiceQueue.events'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0b7f,0x1c7));var _0xf0b7=function(_0xdbd1cf,_0x8d319d){_0xdbd1cf=_0xdbd1cf-0x0;var _0x3668c4=_0x0b7f[_0xdbd1cf];return _0x3668c4;};'use strict';var VoiceQueueEvents=require(_0xf0b7('0x0'));var events=['save','remove',_0xf0b7('0x1')];function createListener(_0xddff2f,_0x36a9e9){return function(_0x1135b3){_0x36a9e9[_0xf0b7('0x2')](_0xddff2f,_0x1135b3);};}function removeListener(_0x380c73,_0x460c34){return function(){VoiceQueueEvents[_0xf0b7('0x3')](_0x380c73,_0x460c34);};}exports[_0xf0b7('0x4')]=function(_0x1537c5){for(var _0x1dfe7c=0x0,_0xcba94a=events[_0xf0b7('0x5')];_0x1dfe7c<_0xcba94a;_0x1dfe7c++){var _0x1a4737=events[_0x1dfe7c];var _0x35a1b1=createListener('voiceQueue:'+_0x1a4737,_0x1537c5);VoiceQueueEvents['on'](_0x1a4737,_0x35a1b1);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index 4ea5b86..7895d53 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 _0x7f25=['get','/index','getVoiceQueuesReport','show','create','put','/:id','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceQueueReport.controller','isAuthenticated','index','/describe'];(function(_0x572ef4,_0x952e77){var _0x872eff=function(_0x4d1dc8){while(--_0x4d1dc8){_0x572ef4['push'](_0x572ef4['shift']());}};_0x872eff(++_0x952e77);}(_0x7f25,0x138));var _0x57f2=function(_0xfb0281,_0x3ff38b){_0xfb0281=_0xfb0281-0x0;var _0x408dd3=_0x7f25[_0xfb0281];return _0x408dd3;};'use strict';var multer=require('multer');var util=require(_0x57f2('0x0'));var path=require(_0x57f2('0x1'));var timeout=require('connect-timeout');var express=require(_0x57f2('0x2'));var router=express[_0x57f2('0x3')]();var fs_extra=require(_0x57f2('0x4'));var auth=require(_0x57f2('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x57f2('0x6'));var controller=require(_0x57f2('0x7'));router['get']('/',auth[_0x57f2('0x8')](),controller[_0x57f2('0x9')]);router['get'](_0x57f2('0xa'),auth[_0x57f2('0x8')](),controller['describe']);router[_0x57f2('0xb')](_0x57f2('0xc'),auth[_0x57f2('0x8')](),controller[_0x57f2('0xd')]);router[_0x57f2('0xb')]('/:id',auth[_0x57f2('0x8')](),controller[_0x57f2('0xe')]);router['post']('/',auth[_0x57f2('0x8')](),controller[_0x57f2('0xf')]);router[_0x57f2('0x10')](_0x57f2('0x11'),auth[_0x57f2('0x8')](),controller['update']);router['delete'](_0x57f2('0x11'),auth[_0x57f2('0x8')](),controller['destroy']);module[_0x57f2('0x12')]=router; \ No newline at end of file +var _0x38fa=['./voiceQueueReport.controller','get','isAuthenticated','index','/describe','describe','getVoiceQueuesReport','show','post','create','/:id','delete','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x2aa639,_0x1f0504){var _0x489951=function(_0x28c760){while(--_0x28c760){_0x2aa639['push'](_0x2aa639['shift']());}};_0x489951(++_0x1f0504);}(_0x38fa,0x1f1));var _0xa38f=function(_0x2f9922,_0xdac98f){_0x2f9922=_0x2f9922-0x0;var _0x56e8b9=_0x38fa[_0x2f9922];return _0x56e8b9;};'use strict';var multer=require(_0xa38f('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xa38f('0x1'));var express=require(_0xa38f('0x2'));var router=express[_0xa38f('0x3')]();var fs_extra=require(_0xa38f('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0xa38f('0x5'));var config=require(_0xa38f('0x6'));var controller=require(_0xa38f('0x7'));router[_0xa38f('0x8')]('/',auth[_0xa38f('0x9')](),controller[_0xa38f('0xa')]);router[_0xa38f('0x8')](_0xa38f('0xb'),auth[_0xa38f('0x9')](),controller[_0xa38f('0xc')]);router['get']('/index',auth[_0xa38f('0x9')](),controller[_0xa38f('0xd')]);router[_0xa38f('0x8')]('/:id',auth[_0xa38f('0x9')](),controller[_0xa38f('0xe')]);router[_0xa38f('0xf')]('/',auth['isAuthenticated'](),controller[_0xa38f('0x10')]);router['put'](_0xa38f('0x11'),auth[_0xa38f('0x9')](),controller['update']);router[_0xa38f('0x12')](_0xa38f('0x11'),auth['isAuthenticated'](),controller[_0xa38f('0x13')]);module[_0xa38f('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index ba297cc..561a209 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 _0x1538=['BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','moment','exports','STRING','DATE','getDataValue','format','diff','seconds','queuecallerleaveAt','setDataValue','holdtime','INTEGER'];(function(_0x19ff2a,_0x2775e6){var _0x1ac4b6=function(_0x2e22bd){while(--_0x2e22bd){_0x19ff2a['push'](_0x19ff2a['shift']());}};_0x1ac4b6(++_0x2775e6);}(_0x1538,0x16a));var _0x8153=function(_0x4b12ae,_0xf2b3b){_0x4b12ae=_0x4b12ae-0x0;var _0x16957b=_0x1538[_0x4b12ae];return _0x16957b;};'use strict';var Sequelize=require(_0x8153('0x0'));var moment=require(_0x8153('0x1'));module[_0x8153('0x2')]={'type':{'type':Sequelize[_0x8153('0x3')]},'uniqueid':{'type':Sequelize[_0x8153('0x3')]},'calleridnum':{'type':Sequelize[_0x8153('0x3')]},'calleridname':{'type':Sequelize[_0x8153('0x3')]},'queue':{'type':Sequelize['STRING']},'queuecallerjoinAt':{'type':Sequelize[_0x8153('0x4')]},'queuecallerleaveAt':{'type':Sequelize[_0x8153('0x4')],'set':function(_0x462154){var _0xf01a85=moment(_0x462154);var _0x4b9223=moment(this[_0x8153('0x5')]('queuecallerjoinAt'))[_0x8153('0x6')]('YYYY-MM-DD\x20HH:mm:ss');var _0x27ee1c=_0xf01a85[_0x8153('0x7')](_0x4b9223,_0x8153('0x8'));this['setDataValue'](_0x8153('0x9'),_0x462154);this[_0x8153('0xa')](_0x8153('0xb'),_0x27ee1c||null);}},'position':{'type':Sequelize['INTEGER']},'count':{'type':Sequelize[_0x8153('0xc')]},'queuecallerabandon':{'type':Sequelize[_0x8153('0xd')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x8153('0x4')]},'queuecallercomplete':{'type':Sequelize[_0x8153('0xd')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x8153('0x4')]},'queuecallerexit':{'type':Sequelize[_0x8153('0xd')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x8153('0x4')]},'queuecallerexitreason':{'type':Sequelize['STRING'],'comment':'COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT'},'originalposition':{'type':Sequelize[_0x8153('0xc')]},'channel':{'type':Sequelize[_0x8153('0x3')]},'connectedlinenum':{'type':Sequelize[_0x8153('0x3')]},'connectedlinename':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x8153('0x3')]},'context':{'type':Sequelize[_0x8153('0x3')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x8153('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'mohtime':{'type':Sequelize[_0x8153('0xc')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x8153('0xd')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x8153('0x3')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x8153('0x3')],'comment':_0x8153('0xe')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0x8153('0x3')]},'disposition':{'type':Sequelize[_0x8153('0x3')]},'secondDisposition':{'type':Sequelize[_0x8153('0x3')]},'thirdDisposition':{'type':Sequelize['STRING']},'queuecallerenterreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xb373=['seconds','queuecallerleaveAt','setDataValue','holdtime','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports','STRING','DATE','getDataValue','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','diff'];(function(_0x2155bc,_0x5e750b){var _0x34ad4a=function(_0x4312ad){while(--_0x4312ad){_0x2155bc['push'](_0x2155bc['shift']());}};_0x34ad4a(++_0x5e750b);}(_0xb373,0xf7));var _0x3b37=function(_0xb2b81c,_0x4c2994){_0xb2b81c=_0xb2b81c-0x0;var _0x3c5245=_0xb373[_0xb2b81c];return _0x3c5245;};'use strict';var Sequelize=require(_0x3b37('0x0'));var moment=require('moment');module[_0x3b37('0x1')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x3b37('0x2')]},'calleridnum':{'type':Sequelize[_0x3b37('0x2')]},'calleridname':{'type':Sequelize[_0x3b37('0x2')]},'queue':{'type':Sequelize[_0x3b37('0x2')]},'queuecallerjoinAt':{'type':Sequelize[_0x3b37('0x3')]},'queuecallerleaveAt':{'type':Sequelize[_0x3b37('0x3')],'set':function(_0x43c367){var _0x496a5b=moment(_0x43c367);var _0x2b0a62=moment(this[_0x3b37('0x4')](_0x3b37('0x5')))[_0x3b37('0x6')](_0x3b37('0x7'));var _0x2eb02f=_0x496a5b[_0x3b37('0x8')](_0x2b0a62,_0x3b37('0x9'));this['setDataValue'](_0x3b37('0xa'),_0x43c367);this[_0x3b37('0xb')](_0x3b37('0xc'),_0x2eb02f||null);}},'position':{'type':Sequelize[_0x3b37('0xd')]},'count':{'type':Sequelize[_0x3b37('0xd')]},'queuecallerabandon':{'type':Sequelize[_0x3b37('0xe')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize['DATE']},'queuecallercomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x3b37('0x3')]},'queuecallerexit':{'type':Sequelize[_0x3b37('0xe')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x3b37('0x3')]},'queuecallerexitreason':{'type':Sequelize[_0x3b37('0x2')],'comment':'COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT'},'originalposition':{'type':Sequelize[_0x3b37('0xd')]},'channel':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x3b37('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x3b37('0x2')]},'context':{'type':Sequelize[_0x3b37('0x2')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x3b37('0x2')]},'holdtime':{'type':Sequelize[_0x3b37('0xd')]},'mohtime':{'type':Sequelize[_0x3b37('0xd')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x3b37('0xe')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x3b37('0x2')]},'transfer':{'type':Sequelize[_0x3b37('0xe')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x3b37('0x2')],'comment':_0x3b37('0xf')},'transferexten':{'type':Sequelize[_0x3b37('0x2')]},'transferuniqueid':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0x3b37('0x2')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x3b37('0x2')]},'queuecallerenterreason':{'type':Sequelize[_0x3b37('0xd')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.controller.js b/server/api/voiceQueueReport/voiceQueueReport.controller.js index 7a24d1d..c069ed4 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 _0x4135=['ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','end','status','json','undefined','limit','count','set','Content-Range','apply','save','destroy','then','sendStatus','error','stack','name','send','index','rawAttributes','fieldName','model','map','keys','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','offset','order','sort','pick','where','merge','type','VIRTUAL','filter','options','VoiceQueueReport','include','findAll','rows','catch','show','params','fields','includeAll','find','create','body','update','describe','getVoiceQueuesReport','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util'];(function(_0x1ca4fc,_0x292296){var _0x159709=function(_0x508a24){while(--_0x508a24){_0x1ca4fc['push'](_0x1ca4fc['shift']());}};_0x159709(++_0x292296);}(_0x4135,0x14d));var _0x5413=function(_0x27b72,_0xd89c92){_0x27b72=_0x27b72-0x0;var _0xeeb64a=_0x4135[_0x27b72];return _0xeeb64a;};'use strict';var emlformat=require(_0x5413('0x0'));var rimraf=require(_0x5413('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5413('0x2'));var rp=require(_0x5413('0x3'));var moment=require(_0x5413('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x5413('0x5'));var util=require(_0x5413('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x5413('0x7'));var fs=require('fs');var fs_extra=require(_0x5413('0x8'));var _=require(_0x5413('0x9'));var squel=require(_0x5413('0xa'));var crypto=require(_0x5413('0xb'));var jsforce=require(_0x5413('0xc'));var deskjs=require(_0x5413('0xd'));var toCsv=require(_0x5413('0xe'));var querystring=require(_0x5413('0xf'));var Papa=require(_0x5413('0x10'));var Redis=require(_0x5413('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x5413('0x12'));var as=require(_0x5413('0x13'));var hardwareService=require(_0x5413('0x14'));var logger=require('../../config/logger')(_0x5413('0x15'));var utils=require(_0x5413('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x5413('0x17'))['db'];config[_0x5413('0x18')]=_[_0x5413('0x19')](config[_0x5413('0x18')],{'host':_0x5413('0x1a'),'port':0x18eb});var socket=require(_0x5413('0x1b'))(new Redis(config[_0x5413('0x18')]));require(_0x5413('0x1c'))[_0x5413('0x1d')](socket);function respondWithStatusCode(_0x2c9081,_0x40d3d2){_0x40d3d2=_0x40d3d2||0xcc;return function(_0xa1880){if(_0xa1880){return _0x2c9081['sendStatus'](_0x40d3d2);}return _0x2c9081['status'](_0x40d3d2)[_0x5413('0x1e')]();};}function respondWithResult(_0x15fef1,_0x36c6ba){_0x36c6ba=_0x36c6ba||0xc8;return function(_0x24ca96){if(_0x24ca96){return _0x15fef1[_0x5413('0x1f')](_0x36c6ba)[_0x5413('0x20')](_0x24ca96);}};}function respondWithFilteredResult(_0x53d310,_0x1cd974){return function(_0x1a1f2c){if(_0x1a1f2c){var _0x19e32c=typeof _0x1cd974['offset']===_0x5413('0x21')&&typeof _0x1cd974[_0x5413('0x22')]===_0x5413('0x21');var _0x2de765=_0x1a1f2c[_0x5413('0x23')];var _0x213806=_0x19e32c?0x0:_0x1cd974['offset'];var _0x1de0fb=_0x19e32c?_0x1a1f2c[_0x5413('0x23')]:_0x1cd974['offset']+_0x1cd974['limit'];var _0x5af9a4;if(_0x1de0fb>=_0x2de765){_0x1de0fb=_0x2de765;_0x5af9a4=0xc8;}else{_0x5af9a4=0xce;}_0x53d310[_0x5413('0x1f')](_0x5af9a4);return _0x53d310[_0x5413('0x24')](_0x5413('0x25'),_0x213806+'-'+_0x1de0fb+'/'+_0x2de765)[_0x5413('0x20')](_0x1a1f2c);}return null;};}function patchUpdates(_0x50cd87){return function(_0x45c7f6){try{jsonpatch[_0x5413('0x26')](_0x45c7f6,_0x50cd87,!![]);}catch(_0x504e1c){return BPromise['reject'](_0x504e1c);}return _0x45c7f6[_0x5413('0x27')]();};}function saveUpdates(_0x377e74,_0x4b20e1){return function(_0x39c58b){if(_0x39c58b){return _0x39c58b['update'](_0x377e74)['then'](function(_0x2bb07f){return _0x2bb07f;});}return null;};}function removeEntity(_0x49e991,_0x6bcc93){return function(_0x3cfb78){if(_0x3cfb78){return _0x3cfb78[_0x5413('0x28')]()[_0x5413('0x29')](function(){_0x49e991[_0x5413('0x1f')](0xcc)[_0x5413('0x1e')]();});}};}function handleEntityNotFound(_0x3e6a89,_0xaa8ec9){return function(_0x18ca1e){if(!_0x18ca1e){_0x3e6a89[_0x5413('0x2a')](0x194);}return _0x18ca1e;};}function handleError(_0x586e8b,_0xed8968){_0xed8968=_0xed8968||0x1f4;return function(_0x7b0796){logger[_0x5413('0x2b')](_0x7b0796[_0x5413('0x2c')]);if(_0x7b0796[_0x5413('0x2d')]){delete _0x7b0796[_0x5413('0x2d')];}_0x586e8b[_0x5413('0x1f')](_0xed8968)[_0x5413('0x2e')](_0x7b0796);};}exports[_0x5413('0x2f')]=function(_0x29ddd7,_0x460e03){var _0x58e192={},_0x5dcaf5={},_0x400991={'count':0x0,'rows':[]};var _0x54c8b8=_['map'](db['VoiceQueueReport'][_0x5413('0x30')],function(_0x38a62b){return{'name':_0x38a62b[_0x5413('0x31')],'type':_0x38a62b['type']['key']};});_0x5dcaf5[_0x5413('0x32')]=_[_0x5413('0x33')](_0x54c8b8,_0x5413('0x2d'));_0x5dcaf5['query']=_[_0x5413('0x34')](_0x29ddd7[_0x5413('0x35')]);_0x5dcaf5[_0x5413('0x36')]=_[_0x5413('0x37')](_0x5dcaf5[_0x5413('0x32')],_0x5dcaf5['query']);_0x58e192[_0x5413('0x38')]=_[_0x5413('0x37')](_0x5dcaf5['model'],qs['fields'](_0x29ddd7[_0x5413('0x35')]['fields']));_0x58e192[_0x5413('0x38')]=_0x58e192[_0x5413('0x38')][_0x5413('0x39')]?_0x58e192[_0x5413('0x38')]:_0x5dcaf5[_0x5413('0x32')];if(!_0x29ddd7[_0x5413('0x35')][_0x5413('0x3a')](_0x5413('0x3b'))){_0x58e192[_0x5413('0x22')]=qs[_0x5413('0x22')](_0x29ddd7[_0x5413('0x35')][_0x5413('0x22')]);_0x58e192[_0x5413('0x3c')]=qs[_0x5413('0x3c')](_0x29ddd7[_0x5413('0x35')][_0x5413('0x3c')]);}_0x58e192[_0x5413('0x3d')]=qs[_0x5413('0x3e')](_0x29ddd7[_0x5413('0x35')][_0x5413('0x3e')]);_0x58e192['where']=qs[_0x5413('0x36')](_[_0x5413('0x3f')](_0x29ddd7[_0x5413('0x35')],_0x5dcaf5[_0x5413('0x36')]),_0x54c8b8);if(_0x29ddd7[_0x5413('0x35')]['filter']){_0x58e192[_0x5413('0x40')]=_[_0x5413('0x41')](_0x58e192[_0x5413('0x40')],{'$or':_['map'](_0x54c8b8,function(_0x4104fa){if(_0x4104fa[_0x5413('0x42')]!==_0x5413('0x43')){var _0xad3eed={};_0xad3eed[_0x4104fa[_0x5413('0x2d')]]={'$like':'%'+_0x29ddd7[_0x5413('0x35')][_0x5413('0x44')]+'%'};return _0xad3eed;}})});}_0x58e192=_[_0x5413('0x41')]({},_0x58e192,_0x29ddd7[_0x5413('0x45')]);var _0x261244={'where':_0x58e192['where']};return db[_0x5413('0x46')][_0x5413('0x23')](_0x261244)[_0x5413('0x29')](function(_0x579834){_0x400991['count']=_0x579834;if(_0x29ddd7[_0x5413('0x35')]['includeAll']){_0x58e192[_0x5413('0x47')]=[{'all':!![]}];}return db[_0x5413('0x46')][_0x5413('0x48')](_0x58e192);})['then'](function(_0x449174){_0x400991[_0x5413('0x49')]=_0x449174;return _0x400991;})[_0x5413('0x29')](respondWithFilteredResult(_0x460e03,_0x58e192))[_0x5413('0x4a')](handleError(_0x460e03,null));};exports[_0x5413('0x4b')]=function(_0x14df5a,_0x4e807d){var _0x16afee={'raw':![],'where':{'id':_0x14df5a[_0x5413('0x4c')]['id']}},_0x189b63={};_0x189b63[_0x5413('0x32')]=_['keys'](db[_0x5413('0x46')][_0x5413('0x30')]);_0x189b63['query']=_[_0x5413('0x34')](_0x14df5a['query']);_0x189b63['filters']=_[_0x5413('0x37')](_0x189b63[_0x5413('0x32')],_0x189b63[_0x5413('0x35')]);_0x16afee[_0x5413('0x38')]=_[_0x5413('0x37')](_0x189b63[_0x5413('0x32')],qs['fields'](_0x14df5a[_0x5413('0x35')][_0x5413('0x4d')]));_0x16afee['attributes']=_0x16afee['attributes'][_0x5413('0x39')]?_0x16afee[_0x5413('0x38')]:_0x189b63[_0x5413('0x32')];if(_0x14df5a[_0x5413('0x35')][_0x5413('0x4e')]){_0x16afee[_0x5413('0x47')]=[{'all':!![]}];}_0x16afee=_[_0x5413('0x41')]({},_0x16afee,_0x14df5a['options']);return db[_0x5413('0x46')][_0x5413('0x4f')](_0x16afee)[_0x5413('0x29')](handleEntityNotFound(_0x4e807d,null))[_0x5413('0x29')](respondWithResult(_0x4e807d,null))[_0x5413('0x4a')](handleError(_0x4e807d,null));};exports['create']=function(_0x349834,_0x70e765){return db[_0x5413('0x46')][_0x5413('0x50')](_0x349834[_0x5413('0x51')],{})[_0x5413('0x29')](respondWithResult(_0x70e765,0xc9))[_0x5413('0x4a')](handleError(_0x70e765,null));};exports[_0x5413('0x52')]=function(_0x5894eb,_0x5babc6){if(_0x5894eb[_0x5413('0x51')]['id']){delete _0x5894eb['body']['id'];}return db[_0x5413('0x46')][_0x5413('0x4f')]({'where':{'id':_0x5894eb[_0x5413('0x4c')]['id']}})[_0x5413('0x29')](handleEntityNotFound(_0x5babc6,null))[_0x5413('0x29')](saveUpdates(_0x5894eb[_0x5413('0x51')],null))[_0x5413('0x29')](respondWithResult(_0x5babc6,null))[_0x5413('0x4a')](handleError(_0x5babc6,null));};exports[_0x5413('0x28')]=function(_0x1817de,_0x43c6cc){return db[_0x5413('0x46')][_0x5413('0x4f')]({'where':{'id':_0x1817de[_0x5413('0x4c')]['id']}})[_0x5413('0x29')](handleEntityNotFound(_0x43c6cc,null))[_0x5413('0x29')](removeEntity(_0x43c6cc,null))[_0x5413('0x4a')](handleError(_0x43c6cc,null));};exports[_0x5413('0x53')]=function(_0x3ecd23,_0xa1d1ac){return db['VoiceQueueReport'][_0x5413('0x53')]()[_0x5413('0x29')](respondWithResult(_0xa1d1ac,null))[_0x5413('0x4a')](handleError(_0xa1d1ac,null));};exports[_0x5413('0x54')]=function(_0x3d6d9a,_0x4e2556){var _0x337747={},_0x5f2e24={},_0x4b9c1f={'count':0x0,'rows':[]};_0x5f2e24[_0x5413('0x32')]=_[_0x5413('0x34')](db[_0x5413('0x46')][_0x5413('0x30')]);_0x5f2e24[_0x5413('0x35')]=_[_0x5413('0x34')](_0x3d6d9a[_0x5413('0x35')]);_0x5f2e24[_0x5413('0x36')]=_[_0x5413('0x37')](_0x5f2e24[_0x5413('0x32')],_0x5f2e24[_0x5413('0x35')]);_0x337747[_0x5413('0x38')]=_[_0x5413('0x37')](_0x5f2e24['model'],qs['fields'](_0x3d6d9a[_0x5413('0x35')][_0x5413('0x4d')]));_0x337747[_0x5413('0x38')]=_0x337747[_0x5413('0x38')][_0x5413('0x39')]?_0x337747[_0x5413('0x38')]:_0x5f2e24[_0x5413('0x32')];if(!_0x3d6d9a[_0x5413('0x35')]['hasOwnProperty'](_0x5413('0x3b'))){_0x337747[_0x5413('0x22')]=qs[_0x5413('0x22')](_0x3d6d9a[_0x5413('0x35')][_0x5413('0x22')]);_0x337747[_0x5413('0x3c')]=qs[_0x5413('0x3c')](_0x3d6d9a[_0x5413('0x35')][_0x5413('0x3c')]);}_0x337747[_0x5413('0x3d')]=qs[_0x5413('0x3e')](_0x3d6d9a['query'][_0x5413('0x3e')]);_0x337747[_0x5413('0x40')]=qs[_0x5413('0x36')](_[_0x5413('0x3f')](_0x3d6d9a[_0x5413('0x35')],_0x5f2e24[_0x5413('0x36')]));if(_0x3d6d9a[_0x5413('0x35')]['filter']){_0x337747[_0x5413('0x40')]=_[_0x5413('0x41')](_0x337747[_0x5413('0x40')],{'$or':_[_0x5413('0x33')](_0x337747['attributes'],function(_0x4fa268){var _0x48b79f={};_0x48b79f[_0x4fa268]={'$like':'%'+_0x3d6d9a[_0x5413('0x35')][_0x5413('0x44')]+'%'};return _0x48b79f;})});}_0x337747=_[_0x5413('0x41')]({},_0x337747,_0x3d6d9a[_0x5413('0x45')]);var _0x5e6564={'where':_0x337747[_0x5413('0x40')]};return db[_0x5413('0x46')]['count'](_0x5e6564)[_0x5413('0x29')](function(_0x29d37a){_0x4b9c1f[_0x5413('0x23')]=_0x29d37a;if(_0x3d6d9a[_0x5413('0x35')][_0x5413('0x4e')]){_0x337747[_0x5413('0x47')]=[{'all':!![]}];}return db['VoiceQueueReport'][_0x5413('0x48')](_0x337747);})[_0x5413('0x29')](function(_0x162c49){_0x4b9c1f['rows']=_0x162c49;return _0x4b9c1f;})['then'](respondWithFilteredResult(_0x4e2556,_0x337747,_0x5413('0x54')))['catch'](handleError(_0x4e2556,null,_0x5413('0x54')));}; \ No newline at end of file +var _0x67aa=['socket.io-emitter','./voiceQueueReport.socket','sendStatus','status','end','undefined','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','VoiceQueueReport','rawAttributes','fieldName','type','model','map','query','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','intersection','create','body','find','describe','getVoiceQueuesReport','keys','nolimit','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','redis','defaults'];(function(_0x412b02,_0x55e5f6){var _0x56c40d=function(_0x433852){while(--_0x433852){_0x412b02['push'](_0x412b02['shift']());}};_0x56c40d(++_0x55e5f6);}(_0x67aa,0xda));var _0xa67a=function(_0x51ed62,_0x574379){_0x51ed62=_0x51ed62-0x0;var _0x34aee3=_0x67aa[_0x51ed62];return _0x34aee3;};'use strict';var emlformat=require(_0xa67a('0x0'));var rimraf=require(_0xa67a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa67a('0x2'));var rp=require(_0xa67a('0x3'));var moment=require(_0xa67a('0x4'));var BPromise=require(_0xa67a('0x5'));var Mustache=require(_0xa67a('0x6'));var util=require(_0xa67a('0x7'));var path=require(_0xa67a('0x8'));var sox=require('sox');var csv=require(_0xa67a('0x9'));var ejs=require(_0xa67a('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa67a('0xb'));var squel=require('squel');var crypto=require(_0xa67a('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xa67a('0xd'));var toCsv=require(_0xa67a('0x9'));var querystring=require(_0xa67a('0xe'));var Papa=require('papaparse');var Redis=require(_0xa67a('0xf'));var authService=require(_0xa67a('0x10'));var qs=require(_0xa67a('0x11'));var as=require(_0xa67a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa67a('0x13'))(_0xa67a('0x14'));var utils=require(_0xa67a('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xa67a('0x16'));var db=require('../../mysqldb')['db'];config[_0xa67a('0x17')]=_[_0xa67a('0x18')](config[_0xa67a('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0xa67a('0x19'))(new Redis(config[_0xa67a('0x17')]));require(_0xa67a('0x1a'))['register'](socket);function respondWithStatusCode(_0x5c4bb5,_0xb3d76d){_0xb3d76d=_0xb3d76d||0xcc;return function(_0x419243){if(_0x419243){return _0x5c4bb5[_0xa67a('0x1b')](_0xb3d76d);}return _0x5c4bb5[_0xa67a('0x1c')](_0xb3d76d)[_0xa67a('0x1d')]();};}function respondWithResult(_0x118c2f,_0x31acb6){_0x31acb6=_0x31acb6||0xc8;return function(_0xccfc7f){if(_0xccfc7f){return _0x118c2f[_0xa67a('0x1c')](_0x31acb6)['json'](_0xccfc7f);}};}function respondWithFilteredResult(_0x26a00c,_0x6338eb){return function(_0x366ce7){if(_0x366ce7){var _0x3f3a10=typeof _0x6338eb['offset']===_0xa67a('0x1e')&&typeof _0x6338eb['limit']===_0xa67a('0x1e');var _0x2c266b=_0x366ce7[_0xa67a('0x1f')];var _0x51251b=_0x3f3a10?0x0:_0x6338eb[_0xa67a('0x20')];var _0x29b1f3=_0x3f3a10?_0x366ce7[_0xa67a('0x1f')]:_0x6338eb['offset']+_0x6338eb[_0xa67a('0x21')];var _0xe45ed5;if(_0x29b1f3>=_0x2c266b){_0x29b1f3=_0x2c266b;_0xe45ed5=0xc8;}else{_0xe45ed5=0xce;}_0x26a00c['status'](_0xe45ed5);return _0x26a00c[_0xa67a('0x22')](_0xa67a('0x23'),_0x51251b+'-'+_0x29b1f3+'/'+_0x2c266b)[_0xa67a('0x24')](_0x366ce7);}return null;};}function patchUpdates(_0x3b747f){return function(_0x463dc8){try{jsonpatch[_0xa67a('0x25')](_0x463dc8,_0x3b747f,!![]);}catch(_0x3eeed2){return BPromise[_0xa67a('0x26')](_0x3eeed2);}return _0x463dc8[_0xa67a('0x27')]();};}function saveUpdates(_0x16406e,_0x9ef33a){return function(_0x19627b){if(_0x19627b){return _0x19627b[_0xa67a('0x28')](_0x16406e)[_0xa67a('0x29')](function(_0x547a92){return _0x547a92;});}return null;};}function removeEntity(_0x98a81d,_0x390aed){return function(_0xe4b4a6){if(_0xe4b4a6){return _0xe4b4a6[_0xa67a('0x2a')]()['then'](function(){_0x98a81d[_0xa67a('0x1c')](0xcc)[_0xa67a('0x1d')]();});}};}function handleEntityNotFound(_0x5a8ef9,_0x8e45cb){return function(_0x2c2923){if(!_0x2c2923){_0x5a8ef9[_0xa67a('0x1b')](0x194);}return _0x2c2923;};}function handleError(_0x2abf64,_0x3fd84c){_0x3fd84c=_0x3fd84c||0x1f4;return function(_0x5c0333){logger[_0xa67a('0x2b')](_0x5c0333[_0xa67a('0x2c')]);if(_0x5c0333[_0xa67a('0x2d')]){delete _0x5c0333[_0xa67a('0x2d')];}_0x2abf64['status'](_0x3fd84c)[_0xa67a('0x2e')](_0x5c0333);};}exports[_0xa67a('0x2f')]=function(_0x5317f9,_0x1336c8){var _0x21843c={},_0x3e0db7={},_0xc15d63={'count':0x0,'rows':[]};var _0x1777cb=_['map'](db[_0xa67a('0x30')][_0xa67a('0x31')],function(_0x5e216c){return{'name':_0x5e216c[_0xa67a('0x32')],'type':_0x5e216c[_0xa67a('0x33')]['key']};});_0x3e0db7[_0xa67a('0x34')]=_[_0xa67a('0x35')](_0x1777cb,_0xa67a('0x2d'));_0x3e0db7[_0xa67a('0x36')]=_['keys'](_0x5317f9['query']);_0x3e0db7['filters']=_['intersection'](_0x3e0db7['model'],_0x3e0db7['query']);_0x21843c[_0xa67a('0x37')]=_['intersection'](_0x3e0db7['model'],qs[_0xa67a('0x38')](_0x5317f9[_0xa67a('0x36')][_0xa67a('0x38')]));_0x21843c[_0xa67a('0x37')]=_0x21843c['attributes'][_0xa67a('0x39')]?_0x21843c['attributes']:_0x3e0db7[_0xa67a('0x34')];if(!_0x5317f9[_0xa67a('0x36')][_0xa67a('0x3a')]('nolimit')){_0x21843c['limit']=qs['limit'](_0x5317f9[_0xa67a('0x36')][_0xa67a('0x21')]);_0x21843c[_0xa67a('0x20')]=qs[_0xa67a('0x20')](_0x5317f9[_0xa67a('0x36')][_0xa67a('0x20')]);}_0x21843c[_0xa67a('0x3b')]=qs[_0xa67a('0x3c')](_0x5317f9[_0xa67a('0x36')][_0xa67a('0x3c')]);_0x21843c[_0xa67a('0x3d')]=qs[_0xa67a('0x3e')](_[_0xa67a('0x3f')](_0x5317f9[_0xa67a('0x36')],_0x3e0db7[_0xa67a('0x3e')]),_0x1777cb);if(_0x5317f9[_0xa67a('0x36')][_0xa67a('0x40')]){_0x21843c['where']=_[_0xa67a('0x41')](_0x21843c[_0xa67a('0x3d')],{'$or':_['map'](_0x1777cb,function(_0x3241cb){if(_0x3241cb[_0xa67a('0x33')]!==_0xa67a('0x42')){var _0x25fdba={};_0x25fdba[_0x3241cb[_0xa67a('0x2d')]]={'$like':'%'+_0x5317f9['query'][_0xa67a('0x40')]+'%'};return _0x25fdba;}})});}_0x21843c=_[_0xa67a('0x41')]({},_0x21843c,_0x5317f9[_0xa67a('0x43')]);var _0x374772={'where':_0x21843c['where']};return db['VoiceQueueReport'][_0xa67a('0x1f')](_0x374772)[_0xa67a('0x29')](function(_0x75cc72){_0xc15d63[_0xa67a('0x1f')]=_0x75cc72;if(_0x5317f9[_0xa67a('0x36')][_0xa67a('0x44')]){_0x21843c[_0xa67a('0x45')]=[{'all':!![]}];}return db[_0xa67a('0x30')][_0xa67a('0x46')](_0x21843c);})[_0xa67a('0x29')](function(_0x4593cb){_0xc15d63['rows']=_0x4593cb;return _0xc15d63;})[_0xa67a('0x29')](respondWithFilteredResult(_0x1336c8,_0x21843c))[_0xa67a('0x47')](handleError(_0x1336c8,null));};exports[_0xa67a('0x48')]=function(_0x5a0dbd,_0x343de9){var _0x494012={'raw':![],'where':{'id':_0x5a0dbd['params']['id']}},_0x303396={};_0x303396['model']=_['keys'](db[_0xa67a('0x30')][_0xa67a('0x31')]);_0x303396[_0xa67a('0x36')]=_['keys'](_0x5a0dbd[_0xa67a('0x36')]);_0x303396[_0xa67a('0x3e')]=_['intersection'](_0x303396[_0xa67a('0x34')],_0x303396[_0xa67a('0x36')]);_0x494012[_0xa67a('0x37')]=_[_0xa67a('0x49')](_0x303396['model'],qs[_0xa67a('0x38')](_0x5a0dbd[_0xa67a('0x36')][_0xa67a('0x38')]));_0x494012[_0xa67a('0x37')]=_0x494012[_0xa67a('0x37')]['length']?_0x494012[_0xa67a('0x37')]:_0x303396[_0xa67a('0x34')];if(_0x5a0dbd['query'][_0xa67a('0x44')]){_0x494012[_0xa67a('0x45')]=[{'all':!![]}];}_0x494012=_[_0xa67a('0x41')]({},_0x494012,_0x5a0dbd[_0xa67a('0x43')]);return db[_0xa67a('0x30')]['find'](_0x494012)[_0xa67a('0x29')](handleEntityNotFound(_0x343de9,null))['then'](respondWithResult(_0x343de9,null))[_0xa67a('0x47')](handleError(_0x343de9,null));};exports[_0xa67a('0x4a')]=function(_0x4e4276,_0x3f04e3){return db[_0xa67a('0x30')][_0xa67a('0x4a')](_0x4e4276['body'],{})[_0xa67a('0x29')](respondWithResult(_0x3f04e3,0xc9))[_0xa67a('0x47')](handleError(_0x3f04e3,null));};exports['update']=function(_0x1d0ca2,_0x1ece4d){if(_0x1d0ca2[_0xa67a('0x4b')]['id']){delete _0x1d0ca2[_0xa67a('0x4b')]['id'];}return db[_0xa67a('0x30')][_0xa67a('0x4c')]({'where':{'id':_0x1d0ca2['params']['id']}})[_0xa67a('0x29')](handleEntityNotFound(_0x1ece4d,null))['then'](saveUpdates(_0x1d0ca2[_0xa67a('0x4b')],null))[_0xa67a('0x29')](respondWithResult(_0x1ece4d,null))[_0xa67a('0x47')](handleError(_0x1ece4d,null));};exports['destroy']=function(_0x361b0d,_0x12895b){return db[_0xa67a('0x30')][_0xa67a('0x4c')]({'where':{'id':_0x361b0d['params']['id']}})[_0xa67a('0x29')](handleEntityNotFound(_0x12895b,null))['then'](removeEntity(_0x12895b,null))[_0xa67a('0x47')](handleError(_0x12895b,null));};exports[_0xa67a('0x4d')]=function(_0x756c51,_0x8bd415){return db['VoiceQueueReport'][_0xa67a('0x4d')]()[_0xa67a('0x29')](respondWithResult(_0x8bd415,null))[_0xa67a('0x47')](handleError(_0x8bd415,null));};exports[_0xa67a('0x4e')]=function(_0x1c5d58,_0x5b7177){var _0x327511={},_0x136f82={},_0xa9e0c={'count':0x0,'rows':[]};_0x136f82[_0xa67a('0x34')]=_[_0xa67a('0x4f')](db[_0xa67a('0x30')][_0xa67a('0x31')]);_0x136f82['query']=_[_0xa67a('0x4f')](_0x1c5d58[_0xa67a('0x36')]);_0x136f82['filters']=_['intersection'](_0x136f82[_0xa67a('0x34')],_0x136f82[_0xa67a('0x36')]);_0x327511['attributes']=_[_0xa67a('0x49')](_0x136f82[_0xa67a('0x34')],qs['fields'](_0x1c5d58[_0xa67a('0x36')][_0xa67a('0x38')]));_0x327511[_0xa67a('0x37')]=_0x327511[_0xa67a('0x37')][_0xa67a('0x39')]?_0x327511['attributes']:_0x136f82[_0xa67a('0x34')];if(!_0x1c5d58[_0xa67a('0x36')]['hasOwnProperty'](_0xa67a('0x50'))){_0x327511[_0xa67a('0x21')]=qs['limit'](_0x1c5d58['query'][_0xa67a('0x21')]);_0x327511['offset']=qs[_0xa67a('0x20')](_0x1c5d58['query']['offset']);}_0x327511['order']=qs['sort'](_0x1c5d58[_0xa67a('0x36')][_0xa67a('0x3c')]);_0x327511[_0xa67a('0x3d')]=qs[_0xa67a('0x3e')](_[_0xa67a('0x3f')](_0x1c5d58[_0xa67a('0x36')],_0x136f82[_0xa67a('0x3e')]));if(_0x1c5d58['query'][_0xa67a('0x40')]){_0x327511[_0xa67a('0x3d')]=_[_0xa67a('0x41')](_0x327511['where'],{'$or':_[_0xa67a('0x35')](_0x327511[_0xa67a('0x37')],function(_0xcff111){var _0x429089={};_0x429089[_0xcff111]={'$like':'%'+_0x1c5d58['query'][_0xa67a('0x40')]+'%'};return _0x429089;})});}_0x327511=_[_0xa67a('0x41')]({},_0x327511,_0x1c5d58['options']);var _0x41f099={'where':_0x327511[_0xa67a('0x3d')]};return db['VoiceQueueReport']['count'](_0x41f099)[_0xa67a('0x29')](function(_0x141e92){_0xa9e0c[_0xa67a('0x1f')]=_0x141e92;if(_0x1c5d58[_0xa67a('0x36')][_0xa67a('0x44')]){_0x327511['include']=[{'all':!![]}];}return db['VoiceQueueReport'][_0xa67a('0x46')](_0x327511);})[_0xa67a('0x29')](function(_0x219959){_0xa9e0c['rows']=_0x219959;return _0xa9e0c;})['then'](respondWithFilteredResult(_0x5b7177,_0x327511,_0xa67a('0x4e')))[_0xa67a('0x47')](handleError(_0x5b7177,null,_0xa67a('0x4e')));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index df5208b..93d3171 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 _0xe299=['exports','events','../../mysqldb','VoiceQueueReport','setMaxListeners','save','update','emit','hasOwnProperty','hook'];(function(_0x1e4cc4,_0x4014a9){var _0x34276b=function(_0x233e33){while(--_0x233e33){_0x1e4cc4['push'](_0x1e4cc4['shift']());}};_0x34276b(++_0x4014a9);}(_0xe299,0x79));var _0x9e29=function(_0x4fd8a8,_0x46e5b1){_0x4fd8a8=_0x4fd8a8-0x0;var _0x3f3d2b=_0xe299[_0x4fd8a8];return _0x3f3d2b;};'use strict';var EventEmitter=require(_0x9e29('0x0'));var VoiceQueueReport=require(_0x9e29('0x1'))['db'][_0x9e29('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x9e29('0x3')](0x0);var events={'afterCreate':_0x9e29('0x4'),'afterUpdate':_0x9e29('0x5'),'afterDestroy':'remove'};function emitEvent(_0xddee41){return function(_0x22c305,_0x4b18ce,_0x35cec5){VoiceQueueReportEvents[_0x9e29('0x6')](_0xddee41+':'+_0x22c305['id'],_0x22c305);VoiceQueueReportEvents[_0x9e29('0x6')](_0xddee41,_0x22c305);_0x35cec5(null);};}for(var e in events){if(events[_0x9e29('0x7')](e)){var event=events[e];VoiceQueueReport[_0x9e29('0x8')](e,emitEvent(event));}}module[_0x9e29('0x9')]=VoiceQueueReportEvents; \ No newline at end of file +var _0xafe1=['events','../../mysqldb','VoiceQueueReport','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0xb1174e,_0x1e68a7){var _0x285bac=function(_0x32c505){while(--_0x32c505){_0xb1174e['push'](_0xb1174e['shift']());}};_0x285bac(++_0x1e68a7);}(_0xafe1,0x1ae));var _0x1afe=function(_0x47abc5,_0x56b515){_0x47abc5=_0x47abc5-0x0;var _0x3bd4ef=_0xafe1[_0x47abc5];return _0x3bd4ef;};'use strict';var EventEmitter=require(_0x1afe('0x0'));var VoiceQueueReport=require(_0x1afe('0x1'))['db'][_0x1afe('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x1afe('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x1afe('0x4'),'afterDestroy':_0x1afe('0x5')};function emitEvent(_0x4a9acf){return function(_0x53b794,_0x5a2bb9,_0x267e87){VoiceQueueReportEvents[_0x1afe('0x6')](_0x4a9acf+':'+_0x53b794['id'],_0x53b794);VoiceQueueReportEvents[_0x1afe('0x6')](_0x4a9acf,_0x53b794);_0x267e87(null);};}for(var e in events){if(events[_0x1afe('0x7')](e)){var event=events[e];VoiceQueueReport[_0x1afe('0x8')](e,emitEvent(event));}}module[_0x1afe('0x9')]=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index e5765a1..e1f5b88 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 _0x9a57=['util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./voiceQueueReport.attributes','define','VoiceQueueReport','report_queue','uniqueid','calleridnum','lodash'];(function(_0x4e304e,_0x1f9804){var _0x50a4a8=function(_0xc42293){while(--_0xc42293){_0x4e304e['push'](_0x4e304e['shift']());}};_0x50a4a8(++_0x1f9804);}(_0x9a57,0x1e9));var _0x79a5=function(_0x1ab180,_0x382b2c){_0x1ab180=_0x1ab180-0x0;var _0xfb2c2d=_0x9a57[_0x1ab180];return _0xfb2c2d;};'use strict';var _=require(_0x79a5('0x0'));var util=require(_0x79a5('0x1'));var logger=require(_0x79a5('0x2'))('api');var moment=require(_0x79a5('0x3'));var BPromise=require(_0x79a5('0x4'));var rp=require(_0x79a5('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x79a5('0x6'));var config=require(_0x79a5('0x7'));var attributes=require(_0x79a5('0x8'));module['exports']=function(_0x19d849,_0x1a7c4c){return _0x19d849[_0x79a5('0x9')](_0x79a5('0xa'),attributes,{'tableName':_0x79a5('0xb'),'paranoid':![],'indexes':[{'fields':[_0x79a5('0xc')]},{'fields':[_0x79a5('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x63d1=['bluebird','request-promise','path','../../config/environment','./voiceQueueReport.attributes','exports','define','VoiceQueueReport','report_queue','uniqueid','lodash','../../config/logger','api','moment'];(function(_0x3ce0d5,_0x203024){var _0x2e5731=function(_0x4be620){while(--_0x4be620){_0x3ce0d5['push'](_0x3ce0d5['shift']());}};_0x2e5731(++_0x203024);}(_0x63d1,0x122));var _0x163d=function(_0x439a24,_0x183240){_0x439a24=_0x439a24-0x0;var _0x2c8319=_0x63d1[_0x439a24];return _0x2c8319;};'use strict';var _=require(_0x163d('0x0'));var util=require('util');var logger=require(_0x163d('0x1'))(_0x163d('0x2'));var moment=require(_0x163d('0x3'));var BPromise=require(_0x163d('0x4'));var rp=require(_0x163d('0x5'));var fs=require('fs');var path=require(_0x163d('0x6'));var rimraf=require('rimraf');var config=require(_0x163d('0x7'));var attributes=require(_0x163d('0x8'));module[_0x163d('0x9')]=function(_0x401f73,_0x5d4320){return _0x401f73[_0x163d('0xa')](_0x163d('0xb'),attributes,{'tableName':_0x163d('0xc'),'paranoid':![],'indexes':[{'fields':[_0x163d('0xd')]},{'fields':['calleridnum']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index dd8070b..b107d24 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 _0x3e63=['defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','request','then','info','VoiceQueueReport,\x20%s,\x20%s','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetVoiceQueueReport','VoiceQueueReport','findAll','options','raw','where','attributes','include','map','model','CreateVoiceQueueReport','body','UpdateVoiceQueueReport','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','redis'];(function(_0x2e2138,_0x35dad0){var _0xf445e8=function(_0x3b2084){while(--_0x3b2084){_0x2e2138['push'](_0x2e2138['shift']());}};_0xf445e8(++_0x35dad0);}(_0x3e63,0xc3));var _0x33e6=function(_0x2cd1fb,_0x291f55){_0x2cd1fb=_0x2cd1fb-0x0;var _0x48fd2b=_0x3e63[_0x2cd1fb];return _0x48fd2b;};'use strict';var _=require('lodash');var util=require(_0x33e6('0x0'));var moment=require('moment');var BPromise=require(_0x33e6('0x1'));var rs=require(_0x33e6('0x2'));var fs=require('fs');var Redis=require(_0x33e6('0x3'));var db=require(_0x33e6('0x4'))['db'];var utils=require(_0x33e6('0x5'));var logger=require(_0x33e6('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x33e6('0x7'));var client=jayson['client'][_0x33e6('0x8')]({'port':0x232a});config[_0x33e6('0x9')]=_[_0x33e6('0xa')](config['redis'],{'host':_0x33e6('0xb'),'port':0x18eb});var socket=require(_0x33e6('0xc'))(new Redis(config['redis']));require(_0x33e6('0xd'))[_0x33e6('0xe')](socket);function respondWithRpcPromise(_0x11396c,_0x36e31c,_0x479733){return new BPromise(function(_0x47670e,_0x2da9dd){return client[_0x33e6('0xf')](_0x11396c,_0x479733)[_0x33e6('0x10')](function(_0x4964e4){logger[_0x33e6('0x11')](_0x33e6('0x12'),_0x36e31c,'request\x20sent');logger[_0x33e6('0x13')](_0x33e6('0x14'),_0x36e31c,_0x33e6('0x15'),JSON[_0x33e6('0x16')](_0x4964e4));if(_0x4964e4[_0x33e6('0x17')]){if(_0x4964e4[_0x33e6('0x17')][_0x33e6('0x18')]===0x1f4){logger[_0x33e6('0x17')](_0x33e6('0x12'),_0x36e31c,_0x4964e4[_0x33e6('0x17')][_0x33e6('0x19')]);return _0x2da9dd(_0x4964e4[_0x33e6('0x17')]['message']);}logger[_0x33e6('0x17')](_0x33e6('0x12'),_0x36e31c,_0x4964e4[_0x33e6('0x17')][_0x33e6('0x19')]);return _0x47670e(_0x4964e4[_0x33e6('0x17')][_0x33e6('0x19')]);}else{logger[_0x33e6('0x11')]('VoiceQueueReport,\x20%s,\x20%s',_0x36e31c,_0x33e6('0x15'));_0x47670e(_0x4964e4[_0x33e6('0x1a')][_0x33e6('0x19')]);}})[_0x33e6('0x1b')](function(_0xd42d37){logger[_0x33e6('0x17')](_0x33e6('0x12'),_0x36e31c,_0xd42d37);_0x2da9dd(_0xd42d37);});});}exports[_0x33e6('0x1c')]=function(_0x1e54b7){var _0x2228f7=this;return new Promise(function(_0x34863c,_0x1e677f){return db[_0x33e6('0x1d')][_0x33e6('0x1e')]({'raw':_0x1e54b7[_0x33e6('0x1f')]?_0x1e54b7[_0x33e6('0x1f')][_0x33e6('0x20')]===undefined?!![]:![]:!![],'where':_0x1e54b7[_0x33e6('0x1f')]?_0x1e54b7[_0x33e6('0x1f')][_0x33e6('0x21')]||null:null,'attributes':_0x1e54b7['options']?_0x1e54b7[_0x33e6('0x1f')][_0x33e6('0x22')]||null:null,'limit':_0x1e54b7['options']?_0x1e54b7[_0x33e6('0x1f')]['limit']||null:null,'include':_0x1e54b7[_0x33e6('0x1f')]?_0x1e54b7[_0x33e6('0x1f')][_0x33e6('0x23')]?_[_0x33e6('0x24')](_0x1e54b7['options']['include'],function(_0x213c80){return{'model':db[_0x213c80[_0x33e6('0x25')]],'as':_0x213c80['as'],'attributes':_0x213c80[_0x33e6('0x22')],'include':_0x213c80[_0x33e6('0x23')]?_[_0x33e6('0x24')](_0x213c80[_0x33e6('0x23')],function(_0x228d5c){return{'model':db[_0x228d5c[_0x33e6('0x25')]],'as':_0x228d5c['as'],'attributes':_0x228d5c['attributes'],'include':_0x228d5c[_0x33e6('0x23')]?_['map'](_0x228d5c['include'],function(_0x444dc5){return{'model':db[_0x444dc5[_0x33e6('0x25')]],'as':_0x444dc5['as'],'attributes':_0x444dc5['attributes']};}):[]};}):[]};}):[]:[]})[_0x33e6('0x10')](function(_0x476fd0){logger[_0x33e6('0x11')](_0x33e6('0x1c'),_0x1e54b7);logger['debug']('GetVoiceQueueReport',_0x1e54b7,JSON[_0x33e6('0x16')](_0x476fd0));_0x34863c(_0x476fd0);})['catch'](function(_0x57e85f){logger[_0x33e6('0x17')]('GetVoiceQueueReport',_0x57e85f[_0x33e6('0x19')],_0x1e54b7);_0x1e677f(_0x2228f7[_0x33e6('0x17')](0x1f4,_0x57e85f['message']));});});};exports[_0x33e6('0x26')]=function(_0x5c0cc2){var _0x1f7bfc=this;return new Promise(function(_0x3e863b,_0x271f78){return db[_0x33e6('0x1d')]['create'](_0x5c0cc2[_0x33e6('0x27')],{'raw':_0x5c0cc2[_0x33e6('0x1f')]?_0x5c0cc2[_0x33e6('0x1f')][_0x33e6('0x20')]===undefined?!![]:![]:!![]})[_0x33e6('0x10')](function(_0x28872a){logger[_0x33e6('0x11')]('CreateVoiceQueueReport',_0x5c0cc2);logger['debug'](_0x33e6('0x26'),_0x5c0cc2,JSON[_0x33e6('0x16')](_0x28872a));_0x3e863b(_0x28872a);})[_0x33e6('0x1b')](function(_0x3f4b81){logger['error'](_0x33e6('0x26'),_0x3f4b81[_0x33e6('0x19')],_0x5c0cc2);_0x271f78(_0x1f7bfc['error'](0x1f4,_0x3f4b81[_0x33e6('0x19')]));});});};exports[_0x33e6('0x28')]=function(_0x263514){var _0x1ef3c7=this;return new Promise(function(_0x5ab1ee,_0x178963){return db[_0x33e6('0x1d')]['update'](_0x263514[_0x33e6('0x27')],{'raw':_0x263514['options']?_0x263514['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x263514['options']?_0x263514['options'][_0x33e6('0x21')]||null:null,'attributes':_0x263514[_0x33e6('0x1f')]?_0x263514[_0x33e6('0x1f')][_0x33e6('0x22')]||null:null,'limit':_0x263514[_0x33e6('0x1f')]?_0x263514[_0x33e6('0x1f')]['limit']||null:null})[_0x33e6('0x10')](function(_0x2f1807){logger[_0x33e6('0x11')](_0x33e6('0x28'),_0x263514);logger[_0x33e6('0x13')](_0x33e6('0x28'),_0x263514,JSON['stringify'](_0x2f1807));_0x5ab1ee(_0x2f1807);})[_0x33e6('0x1b')](function(_0x43e9dd){logger['error'](_0x33e6('0x28'),_0x43e9dd[_0x33e6('0x19')],_0x263514);_0x178963(_0x1ef3c7[_0x33e6('0x17')](0x1f4,_0x43e9dd[_0x33e6('0x19')]));});});}; \ No newline at end of file +var _0xf3b9=['result','catch','GetVoiceQueueReport','VoiceQueueReport','findAll','options','raw','where','attributes','limit','include','map','model','create','body','CreateVoiceQueueReport','UpdateVoiceQueueReport','update','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./voiceQueueReport.socket','register','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x1c9721,_0x3f83a4){var _0x5b1a4c=function(_0x44f048){while(--_0x44f048){_0x1c9721['push'](_0x1c9721['shift']());}};_0x5b1a4c(++_0x3f83a4);}(_0xf3b9,0x1eb));var _0x9f3b=function(_0x495af5,_0x4da751){_0x495af5=_0x495af5-0x0;var _0x27fc50=_0xf3b9[_0x495af5];return _0x27fc50;};'use strict';var _=require(_0x9f3b('0x0'));var util=require('util');var moment=require(_0x9f3b('0x1'));var BPromise=require('bluebird');var rs=require(_0x9f3b('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9f3b('0x3'))['db'];var utils=require(_0x9f3b('0x4'));var logger=require(_0x9f3b('0x5'))('rpc');var config=require(_0x9f3b('0x6'));var jayson=require(_0x9f3b('0x7'));var client=jayson[_0x9f3b('0x8')][_0x9f3b('0x9')]({'port':0x232a});config[_0x9f3b('0xa')]=_[_0x9f3b('0xb')](config[_0x9f3b('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x9f3b('0xc'))(new Redis(config[_0x9f3b('0xa')]));require(_0x9f3b('0xd'))[_0x9f3b('0xe')](socket);function respondWithRpcPromise(_0x5ee96b,_0x19ebb9,_0xa9141){return new BPromise(function(_0x259727,_0x21e692){return client['request'](_0x5ee96b,_0xa9141)[_0x9f3b('0xf')](function(_0x4ee244){logger[_0x9f3b('0x10')](_0x9f3b('0x11'),_0x19ebb9,_0x9f3b('0x12'));logger[_0x9f3b('0x13')](_0x9f3b('0x14'),_0x19ebb9,_0x9f3b('0x12'),JSON[_0x9f3b('0x15')](_0x4ee244));if(_0x4ee244['error']){if(_0x4ee244[_0x9f3b('0x16')][_0x9f3b('0x17')]===0x1f4){logger[_0x9f3b('0x16')](_0x9f3b('0x11'),_0x19ebb9,_0x4ee244[_0x9f3b('0x16')]['message']);return _0x21e692(_0x4ee244['error'][_0x9f3b('0x18')]);}logger[_0x9f3b('0x16')](_0x9f3b('0x11'),_0x19ebb9,_0x4ee244[_0x9f3b('0x16')]['message']);return _0x259727(_0x4ee244[_0x9f3b('0x16')]['message']);}else{logger[_0x9f3b('0x10')](_0x9f3b('0x11'),_0x19ebb9,_0x9f3b('0x12'));_0x259727(_0x4ee244[_0x9f3b('0x19')][_0x9f3b('0x18')]);}})[_0x9f3b('0x1a')](function(_0x24f7a2){logger[_0x9f3b('0x16')](_0x9f3b('0x11'),_0x19ebb9,_0x24f7a2);_0x21e692(_0x24f7a2);});});}exports[_0x9f3b('0x1b')]=function(_0xbcd169){var _0x2496df=this;return new Promise(function(_0x47b530,_0x3c5127){return db[_0x9f3b('0x1c')][_0x9f3b('0x1d')]({'raw':_0xbcd169[_0x9f3b('0x1e')]?_0xbcd169[_0x9f3b('0x1e')][_0x9f3b('0x1f')]===undefined?!![]:![]:!![],'where':_0xbcd169[_0x9f3b('0x1e')]?_0xbcd169[_0x9f3b('0x1e')][_0x9f3b('0x20')]||null:null,'attributes':_0xbcd169[_0x9f3b('0x1e')]?_0xbcd169[_0x9f3b('0x1e')][_0x9f3b('0x21')]||null:null,'limit':_0xbcd169[_0x9f3b('0x1e')]?_0xbcd169[_0x9f3b('0x1e')][_0x9f3b('0x22')]||null:null,'include':_0xbcd169[_0x9f3b('0x1e')]?_0xbcd169[_0x9f3b('0x1e')][_0x9f3b('0x23')]?_[_0x9f3b('0x24')](_0xbcd169[_0x9f3b('0x1e')]['include'],function(_0xbf86ef){return{'model':db[_0xbf86ef[_0x9f3b('0x25')]],'as':_0xbf86ef['as'],'attributes':_0xbf86ef['attributes'],'include':_0xbf86ef[_0x9f3b('0x23')]?_[_0x9f3b('0x24')](_0xbf86ef[_0x9f3b('0x23')],function(_0x3ad948){return{'model':db[_0x3ad948[_0x9f3b('0x25')]],'as':_0x3ad948['as'],'attributes':_0x3ad948['attributes'],'include':_0x3ad948[_0x9f3b('0x23')]?_[_0x9f3b('0x24')](_0x3ad948['include'],function(_0x5a1da9){return{'model':db[_0x5a1da9[_0x9f3b('0x25')]],'as':_0x5a1da9['as'],'attributes':_0x5a1da9[_0x9f3b('0x21')]};}):[]};}):[]};}):[]:[]})[_0x9f3b('0xf')](function(_0x485cb4){logger['info'](_0x9f3b('0x1b'),_0xbcd169);logger['debug']('GetVoiceQueueReport',_0xbcd169,JSON[_0x9f3b('0x15')](_0x485cb4));_0x47b530(_0x485cb4);})[_0x9f3b('0x1a')](function(_0x58822a){logger[_0x9f3b('0x16')](_0x9f3b('0x1b'),_0x58822a[_0x9f3b('0x18')],_0xbcd169);_0x3c5127(_0x2496df[_0x9f3b('0x16')](0x1f4,_0x58822a['message']));});});};exports['CreateVoiceQueueReport']=function(_0x4fad33){var _0x400380=this;return new Promise(function(_0xcf5254,_0x3ec930){return db[_0x9f3b('0x1c')][_0x9f3b('0x26')](_0x4fad33[_0x9f3b('0x27')],{'raw':_0x4fad33['options']?_0x4fad33[_0x9f3b('0x1e')][_0x9f3b('0x1f')]===undefined?!![]:![]:!![]})[_0x9f3b('0xf')](function(_0x38d8dd){logger[_0x9f3b('0x10')](_0x9f3b('0x28'),_0x4fad33);logger['debug'](_0x9f3b('0x28'),_0x4fad33,JSON[_0x9f3b('0x15')](_0x38d8dd));_0xcf5254(_0x38d8dd);})[_0x9f3b('0x1a')](function(_0x43fee8){logger[_0x9f3b('0x16')](_0x9f3b('0x28'),_0x43fee8[_0x9f3b('0x18')],_0x4fad33);_0x3ec930(_0x400380[_0x9f3b('0x16')](0x1f4,_0x43fee8[_0x9f3b('0x18')]));});});};exports[_0x9f3b('0x29')]=function(_0x36326f){var _0x1007da=this;return new Promise(function(_0x2a3277,_0x5a4d3c){return db[_0x9f3b('0x1c')][_0x9f3b('0x2a')](_0x36326f[_0x9f3b('0x27')],{'raw':_0x36326f[_0x9f3b('0x1e')]?_0x36326f[_0x9f3b('0x1e')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x36326f[_0x9f3b('0x1e')]?_0x36326f[_0x9f3b('0x1e')][_0x9f3b('0x20')]||null:null,'attributes':_0x36326f[_0x9f3b('0x1e')]?_0x36326f['options'][_0x9f3b('0x21')]||null:null,'limit':_0x36326f[_0x9f3b('0x1e')]?_0x36326f[_0x9f3b('0x1e')]['limit']||null:null})[_0x9f3b('0xf')](function(_0x113aa1){logger[_0x9f3b('0x10')](_0x9f3b('0x29'),_0x36326f);logger[_0x9f3b('0x13')](_0x9f3b('0x29'),_0x36326f,JSON[_0x9f3b('0x15')](_0x113aa1));_0x2a3277(_0x113aa1);})['catch'](function(_0x4beca5){logger['error'](_0x9f3b('0x29'),_0x4beca5[_0x9f3b('0x18')],_0x36326f);_0x5a4d3c(_0x1007da['error'](0x1f4,_0x4beca5[_0x9f3b('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index 734ae7b..26de466 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 _0x938a=['register','voiceQueueReport:','./voiceQueueReport.events','save','remove','update','emit','removeListener'];(function(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0x938a,0x1f2));var _0xa938=function(_0x2762fc,_0x4d21a6){_0x2762fc=_0x2762fc-0x0;var _0x1ae50b=_0x938a[_0x2762fc];return _0x1ae50b;};'use strict';var VoiceQueueReportEvents=require(_0xa938('0x0'));var events=[_0xa938('0x1'),_0xa938('0x2'),_0xa938('0x3')];function createListener(_0x530fb4,_0x4a6fd8){return function(_0x110fcc){_0x4a6fd8[_0xa938('0x4')](_0x530fb4,_0x110fcc);};}function removeListener(_0x42c636,_0x5625ce){return function(){VoiceQueueReportEvents[_0xa938('0x5')](_0x42c636,_0x5625ce);};}exports[_0xa938('0x6')]=function(_0x4ac3a2){for(var _0x27efe9=0x0,_0x22b3bc=events['length'];_0x27efe9<_0x22b3bc;_0x27efe9++){var _0x56ad1d=events[_0x27efe9];var _0x570280=createListener(_0xa938('0x7')+_0x56ad1d,_0x4ac3a2);VoiceQueueReportEvents['on'](_0x56ad1d,_0x570280);}}; \ No newline at end of file +var _0x295f=['register','length','voiceQueueReport:','save','remove','update','removeListener'];(function(_0x3bccb6,_0x560dff){var _0x3a26cd=function(_0x193f65){while(--_0x193f65){_0x3bccb6['push'](_0x3bccb6['shift']());}};_0x3a26cd(++_0x560dff);}(_0x295f,0x168));var _0xf295=function(_0x59ce9e,_0x1f8d77){_0x59ce9e=_0x59ce9e-0x0;var _0x22e97f=_0x295f[_0x59ce9e];return _0x22e97f;};'use strict';var VoiceQueueReportEvents=require('./voiceQueueReport.events');var events=[_0xf295('0x0'),_0xf295('0x1'),_0xf295('0x2')];function createListener(_0x588a38,_0x45a403){return function(_0x1c653b){_0x45a403['emit'](_0x588a38,_0x1c653b);};}function removeListener(_0x511ab5,_0x269439){return function(){VoiceQueueReportEvents[_0xf295('0x3')](_0x511ab5,_0x269439);};}exports[_0xf295('0x4')]=function(_0x2b37d8){for(var _0x36b69d=0x0,_0x50a890=events[_0xf295('0x5')];_0x36b69d<_0x50a890;_0x36b69d++){var _0x44e292=events[_0x36b69d];var _0x1f3320=createListener(_0xf295('0x6')+_0x44e292,_0x2b37d8);VoiceQueueReportEvents['on'](_0x44e292,_0x1f3320);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index 605ff50..f39927f 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 _0x0447=['create','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./voiceQueuesLog.controller','isAuthenticated','index','/:id','show'];(function(_0x2c3fef,_0x49a276){var _0x297f9b=function(_0x3a50a6){while(--_0x3a50a6){_0x2c3fef['push'](_0x2c3fef['shift']());}};_0x297f9b(++_0x49a276);}(_0x0447,0x1f0));var _0x7044=function(_0x38aafa,_0x6453a7){_0x38aafa=_0x38aafa-0x0;var _0x31beb2=_0x0447[_0x38aafa];return _0x31beb2;};'use strict';var multer=require(_0x7044('0x0'));var util=require(_0x7044('0x1'));var path=require(_0x7044('0x2'));var timeout=require(_0x7044('0x3'));var express=require(_0x7044('0x4'));var router=express[_0x7044('0x5')]();var fs_extra=require(_0x7044('0x6'));var auth=require(_0x7044('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x7044('0x8'));var controller=require(_0x7044('0x9'));router['get']('/',auth[_0x7044('0xa')](),controller[_0x7044('0xb')]);router['get'](_0x7044('0xc'),auth[_0x7044('0xa')](),controller[_0x7044('0xd')]);router['post']('/',auth[_0x7044('0xa')](),controller[_0x7044('0xe')]);router['put']('/:id',auth[_0x7044('0xa')](),controller['update']);router[_0x7044('0xf')](_0x7044('0xc'),auth[_0x7044('0xa')](),controller[_0x7044('0x10')]);module['exports']=router; \ No newline at end of file +var _0x9fca=['get','post','create','/:id','update','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','isAuthenticated','index'];(function(_0x3a8d07,_0x45869d){var _0x4c3097=function(_0x2b490a){while(--_0x2b490a){_0x3a8d07['push'](_0x3a8d07['shift']());}};_0x4c3097(++_0x45869d);}(_0x9fca,0x7f));var _0xa9fc=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x9fca[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0xa9fc('0x0'));var util=require(_0xa9fc('0x1'));var path=require(_0xa9fc('0x2'));var timeout=require(_0xa9fc('0x3'));var express=require(_0xa9fc('0x4'));var router=express[_0xa9fc('0x5')]();var fs_extra=require(_0xa9fc('0x6'));var auth=require(_0xa9fc('0x7'));var interaction=require(_0xa9fc('0x8'));var config=require(_0xa9fc('0x9'));var controller=require(_0xa9fc('0xa'));router['get']('/',auth[_0xa9fc('0xb')](),controller[_0xa9fc('0xc')]);router[_0xa9fc('0xd')]('/:id',auth[_0xa9fc('0xb')](),controller['show']);router[_0xa9fc('0xe')]('/',auth[_0xa9fc('0xb')](),controller[_0xa9fc('0xf')]);router['put'](_0xa9fc('0x10'),auth[_0xa9fc('0xb')](),controller[_0xa9fc('0x11')]);router[_0xa9fc('0x12')]('/:id',auth['isAuthenticated'](),controller[_0xa9fc('0x13')]);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 86a7d5d..4d6e485 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 _0xf88f=['format','YYYY-MM-DD\x20HH:mm:ss','sequelize','moment','exports','STRING','DATE'];(function(_0x5b7e6d,_0x432a98){var _0xd8f106=function(_0x5b2058){while(--_0x5b2058){_0x5b7e6d['push'](_0x5b7e6d['shift']());}};_0xd8f106(++_0x432a98);}(_0xf88f,0x1bb));var _0xff88=function(_0x5b1903,_0x5c77fd){_0x5b1903=_0x5b1903-0x0;var _0x551e14=_0xf88f[_0x5b1903];return _0x551e14;};'use strict';var Sequelize=require(_0xff88('0x0'));var moment=require(_0xff88('0x1'));module[_0xff88('0x2')]={'time':{'type':Sequelize[_0xff88('0x3')]},'callid':{'type':Sequelize[_0xff88('0x3')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0xff88('0x3')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0xff88('0x3')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0xff88('0x3')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0xff88('0x3')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0xff88('0x3')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0xff88('0x3')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0xff88('0x3')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xff88('0x4')],'allowNull':![],'defaultValue':moment()[_0xff88('0x5')](_0xff88('0x6'))}}; \ No newline at end of file +var _0x98ae=['STRING','DATE','sequelize','moment','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x98ae,0x142));var _0xe98a=function(_0x55118a,_0x107bd2){_0x55118a=_0x55118a-0x0;var _0x215354=_0x98ae[_0x55118a];return _0x215354;};'use strict';var Sequelize=require(_0xe98a('0x0'));var moment=require(_0xe98a('0x1'));module[_0xe98a('0x2')]={'time':{'type':Sequelize[_0xe98a('0x3')]},'callid':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0xe98a('0x3')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0xe98a('0x3')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0xe98a('0x3')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0xe98a('0x3')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0xe98a('0x3')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0xe98a('0x3')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0xe98a('0x3')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xe98a('0x4')],'allowNull':![],'defaultValue':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index 14225ac..3cb5d28 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 _0x3f8f=['find','create','update','body','destroy','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','sox','ejs','fs-extra','lodash','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','offset','undefined','count','limit','set','apply','reject','then','sendStatus','name','send','map','VoiceQueuesLog','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','findAll','catch','params','rawAttributes','includeAll'];(function(_0x38c3c4,_0x22fa29){var _0x2cf445=function(_0x31a6cd){while(--_0x31a6cd){_0x38c3c4['push'](_0x38c3c4['shift']());}};_0x2cf445(++_0x22fa29);}(_0x3f8f,0x91));var _0xf3f8=function(_0x1a4f72,_0x235e0a){_0x1a4f72=_0x1a4f72-0x0;var _0x2b5a22=_0x3f8f[_0x1a4f72];return _0x2b5a22;};'use strict';var emlformat=require(_0xf3f8('0x0'));var rimraf=require(_0xf3f8('0x1'));var zipdir=require(_0xf3f8('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf3f8('0x3'));var moment=require(_0xf3f8('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xf3f8('0x5'));var util=require(_0xf3f8('0x6'));var path=require('path');var sox=require(_0xf3f8('0x7'));var csv=require('to-csv');var ejs=require(_0xf3f8('0x8'));var fs=require('fs');var fs_extra=require(_0xf3f8('0x9'));var _=require(_0xf3f8('0xa'));var squel=require(_0xf3f8('0xb'));var crypto=require('crypto');var jsforce=require(_0xf3f8('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xf3f8('0xd'));var querystring=require(_0xf3f8('0xe'));var Papa=require(_0xf3f8('0xf'));var Redis=require(_0xf3f8('0x10'));var authService=require(_0xf3f8('0x11'));var qs=require(_0xf3f8('0x12'));var as=require(_0xf3f8('0x13'));var hardwareService=require(_0xf3f8('0x14'));var logger=require(_0xf3f8('0x15'))(_0xf3f8('0x16'));var utils=require(_0xf3f8('0x17'));var config=require(_0xf3f8('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xf3f8('0x19'))['db'];function respondWithStatusCode(_0x2fc557,_0x2efaea){_0x2efaea=_0x2efaea||0xcc;return function(_0x7a01f1){if(_0x7a01f1){return _0x2fc557['sendStatus'](_0x2efaea);}return _0x2fc557[_0xf3f8('0x1a')](_0x2efaea)[_0xf3f8('0x1b')]();};}function respondWithResult(_0x771cdc,_0x482adb){_0x482adb=_0x482adb||0xc8;return function(_0x1036ab){if(_0x1036ab){return _0x771cdc['status'](_0x482adb)['json'](_0x1036ab);}};}function respondWithFilteredResult(_0xe03620,_0x39db24){return function(_0x396a87){if(_0x396a87){var _0x41324c=typeof _0x39db24[_0xf3f8('0x1c')]===_0xf3f8('0x1d')&&typeof _0x39db24['limit']===_0xf3f8('0x1d');var _0x55d935=_0x396a87[_0xf3f8('0x1e')];var _0x554cc6=_0x41324c?0x0:_0x39db24['offset'];var _0x57402b=_0x41324c?_0x396a87[_0xf3f8('0x1e')]:_0x39db24[_0xf3f8('0x1c')]+_0x39db24[_0xf3f8('0x1f')];var _0x451557;if(_0x57402b>=_0x55d935){_0x57402b=_0x55d935;_0x451557=0xc8;}else{_0x451557=0xce;}_0xe03620[_0xf3f8('0x1a')](_0x451557);return _0xe03620[_0xf3f8('0x20')]('Content-Range',_0x554cc6+'-'+_0x57402b+'/'+_0x55d935)['json'](_0x396a87);}return null;};}function patchUpdates(_0x552fd7){return function(_0x48aba4){try{jsonpatch[_0xf3f8('0x21')](_0x48aba4,_0x552fd7,!![]);}catch(_0x47b53a){return BPromise[_0xf3f8('0x22')](_0x47b53a);}return _0x48aba4['save']();};}function saveUpdates(_0x4dc38a,_0x4e45c2){return function(_0x42caba){if(_0x42caba){return _0x42caba['update'](_0x4dc38a)['then'](function(_0x4417de){return _0x4417de;});}return null;};}function removeEntity(_0x6d899f,_0x19126b){return function(_0x251cab){if(_0x251cab){return _0x251cab['destroy']()[_0xf3f8('0x23')](function(){_0x6d899f[_0xf3f8('0x1a')](0xcc)[_0xf3f8('0x1b')]();});}};}function handleEntityNotFound(_0x1e0783,_0x4cf922){return function(_0x32c79c){if(!_0x32c79c){_0x1e0783[_0xf3f8('0x24')](0x194);}return _0x32c79c;};}function handleError(_0x38d6eb,_0x1ca236){_0x1ca236=_0x1ca236||0x1f4;return function(_0x3430b3){logger['error'](_0x3430b3['stack']);if(_0x3430b3[_0xf3f8('0x25')]){delete _0x3430b3[_0xf3f8('0x25')];}_0x38d6eb['status'](_0x1ca236)[_0xf3f8('0x26')](_0x3430b3);};}exports['index']=function(_0x22f8c9,_0x45ccfc){var _0x4855f2={},_0x18f656={},_0x2363ce={'count':0x0,'rows':[]};var _0x25c6c1=_[_0xf3f8('0x27')](db[_0xf3f8('0x28')]['rawAttributes'],function(_0x37ef9c){return{'name':_0x37ef9c[_0xf3f8('0x29')],'type':_0x37ef9c[_0xf3f8('0x2a')][_0xf3f8('0x2b')]};});_0x18f656[_0xf3f8('0x2c')]=_['map'](_0x25c6c1,'name');_0x18f656[_0xf3f8('0x2d')]=_[_0xf3f8('0x2e')](_0x22f8c9[_0xf3f8('0x2d')]);_0x18f656[_0xf3f8('0x2f')]=_[_0xf3f8('0x30')](_0x18f656[_0xf3f8('0x2c')],_0x18f656['query']);_0x4855f2[_0xf3f8('0x31')]=_[_0xf3f8('0x30')](_0x18f656[_0xf3f8('0x2c')],qs[_0xf3f8('0x32')](_0x22f8c9['query'][_0xf3f8('0x32')]));_0x4855f2[_0xf3f8('0x31')]=_0x4855f2[_0xf3f8('0x31')][_0xf3f8('0x33')]?_0x4855f2[_0xf3f8('0x31')]:_0x18f656[_0xf3f8('0x2c')];if(!_0x22f8c9[_0xf3f8('0x2d')][_0xf3f8('0x34')](_0xf3f8('0x35'))){_0x4855f2[_0xf3f8('0x1f')]=qs[_0xf3f8('0x1f')](_0x22f8c9[_0xf3f8('0x2d')][_0xf3f8('0x1f')]);_0x4855f2['offset']=qs[_0xf3f8('0x1c')](_0x22f8c9[_0xf3f8('0x2d')][_0xf3f8('0x1c')]);}_0x4855f2[_0xf3f8('0x36')]=qs[_0xf3f8('0x37')](_0x22f8c9[_0xf3f8('0x2d')][_0xf3f8('0x37')]);_0x4855f2[_0xf3f8('0x38')]=qs[_0xf3f8('0x2f')](_['pick'](_0x22f8c9[_0xf3f8('0x2d')],_0x18f656[_0xf3f8('0x2f')]),_0x25c6c1);if(_0x22f8c9[_0xf3f8('0x2d')][_0xf3f8('0x39')]){_0x4855f2['where']=_['merge'](_0x4855f2['where'],{'$or':_[_0xf3f8('0x27')](_0x25c6c1,function(_0x36777e){if(_0x36777e['type']!=='VIRTUAL'){var _0x55be11={};_0x55be11[_0x36777e[_0xf3f8('0x25')]]={'$like':'%'+_0x22f8c9[_0xf3f8('0x2d')][_0xf3f8('0x39')]+'%'};return _0x55be11;}})});}_0x4855f2=_[_0xf3f8('0x3a')]({},_0x4855f2,_0x22f8c9[_0xf3f8('0x3b')]);var _0x4c2042={'where':_0x4855f2[_0xf3f8('0x38')]};return db[_0xf3f8('0x28')]['count'](_0x4c2042)['then'](function(_0x32ece4){_0x2363ce['count']=_0x32ece4;if(_0x22f8c9[_0xf3f8('0x2d')]['includeAll']){_0x4855f2['include']=[{'all':!![]}];}return db[_0xf3f8('0x28')][_0xf3f8('0x3c')](_0x4855f2);})['then'](function(_0x2757dd){_0x2363ce['rows']=_0x2757dd;return _0x2363ce;})[_0xf3f8('0x23')](respondWithFilteredResult(_0x45ccfc,_0x4855f2))[_0xf3f8('0x3d')](handleError(_0x45ccfc,null));};exports['show']=function(_0x25f7cb,_0x55d01d){var _0xca667a={'raw':!![],'where':{'id':_0x25f7cb[_0xf3f8('0x3e')]['id']}},_0x38cbe5={};_0x38cbe5[_0xf3f8('0x2c')]=_[_0xf3f8('0x2e')](db['VoiceQueuesLog'][_0xf3f8('0x3f')]);_0x38cbe5[_0xf3f8('0x2d')]=_[_0xf3f8('0x2e')](_0x25f7cb[_0xf3f8('0x2d')]);_0x38cbe5['filters']=_[_0xf3f8('0x30')](_0x38cbe5[_0xf3f8('0x2c')],_0x38cbe5[_0xf3f8('0x2d')]);_0xca667a['attributes']=_['intersection'](_0x38cbe5['model'],qs[_0xf3f8('0x32')](_0x25f7cb['query'][_0xf3f8('0x32')]));_0xca667a[_0xf3f8('0x31')]=_0xca667a[_0xf3f8('0x31')]['length']?_0xca667a[_0xf3f8('0x31')]:_0x38cbe5[_0xf3f8('0x2c')];if(_0x25f7cb[_0xf3f8('0x2d')][_0xf3f8('0x40')]){_0xca667a['include']=[{'all':!![]}];}_0xca667a=_[_0xf3f8('0x3a')]({},_0xca667a,_0x25f7cb[_0xf3f8('0x3b')]);return db[_0xf3f8('0x28')][_0xf3f8('0x41')](_0xca667a)['then'](handleEntityNotFound(_0x55d01d,null))[_0xf3f8('0x23')](respondWithResult(_0x55d01d,null))[_0xf3f8('0x3d')](handleError(_0x55d01d,null));};exports[_0xf3f8('0x42')]=function(_0xbd182d,_0x3eba62){return db[_0xf3f8('0x28')][_0xf3f8('0x42')](_0xbd182d['body'],{})[_0xf3f8('0x23')](respondWithResult(_0x3eba62,0xc9))[_0xf3f8('0x3d')](handleError(_0x3eba62,null));};exports[_0xf3f8('0x43')]=function(_0x254ba6,_0x529d6f){if(_0x254ba6[_0xf3f8('0x44')]['id']){delete _0x254ba6['body']['id'];}return db['VoiceQueuesLog']['find']({'where':{'id':_0x254ba6['params']['id']}})[_0xf3f8('0x23')](handleEntityNotFound(_0x529d6f,null))[_0xf3f8('0x23')](saveUpdates(_0x254ba6[_0xf3f8('0x44')],null))['then'](respondWithResult(_0x529d6f,null))[_0xf3f8('0x3d')](handleError(_0x529d6f,null));};exports[_0xf3f8('0x45')]=function(_0x484607,_0x2b22a9){return db[_0xf3f8('0x28')][_0xf3f8('0x41')]({'where':{'id':_0x484607['params']['id']}})[_0xf3f8('0x23')](handleEntityNotFound(_0x2b22a9,null))[_0xf3f8('0x23')](removeEntity(_0x2b22a9,null))[_0xf3f8('0x3d')](handleError(_0x2b22a9,null));}; \ No newline at end of file +var _0x9162=['jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/license/util','status','json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','end','sendStatus','name','index','VoiceQueuesLog','rawAttributes','fieldName','type','key','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','filters','pick','merge','filter','options','includeAll','include','findAll','rows','catch','params','find','create','body','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto'];(function(_0x519139,_0x562b0a){var _0x1cf0b4=function(_0x1d113b){while(--_0x1d113b){_0x519139['push'](_0x519139['shift']());}};_0x1cf0b4(++_0x562b0a);}(_0x9162,0x80));var _0x2916=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x9162[_0x502c7d];return _0x30b7ed;};'use strict';var emlformat=require(_0x2916('0x0'));var rimraf=require(_0x2916('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2916('0x2'));var rp=require(_0x2916('0x3'));var moment=require(_0x2916('0x4'));var BPromise=require(_0x2916('0x5'));var Mustache=require(_0x2916('0x6'));var util=require(_0x2916('0x7'));var path=require(_0x2916('0x8'));var sox=require(_0x2916('0x9'));var csv=require(_0x2916('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2916('0xb'));var squel=require(_0x2916('0xc'));var crypto=require(_0x2916('0xd'));var jsforce=require(_0x2916('0xe'));var deskjs=require(_0x2916('0xf'));var toCsv=require(_0x2916('0xa'));var querystring=require('querystring');var Papa=require(_0x2916('0x10'));var Redis=require(_0x2916('0x11'));var authService=require(_0x2916('0x12'));var qs=require(_0x2916('0x13'));var as=require(_0x2916('0x14'));var hardwareService=require(_0x2916('0x15'));var logger=require(_0x2916('0x16'))('api');var utils=require(_0x2916('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x2916('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x529038,_0x50077e){_0x50077e=_0x50077e||0xcc;return function(_0x2ae316){if(_0x2ae316){return _0x529038['sendStatus'](_0x50077e);}return _0x529038[_0x2916('0x19')](_0x50077e)['end']();};}function respondWithResult(_0x4126c1,_0x667a0c){_0x667a0c=_0x667a0c||0xc8;return function(_0x400133){if(_0x400133){return _0x4126c1['status'](_0x667a0c)[_0x2916('0x1a')](_0x400133);}};}function respondWithFilteredResult(_0x398e03,_0x37aecd){return function(_0x223030){if(_0x223030){var _0x5b8263=typeof _0x37aecd[_0x2916('0x1b')]===_0x2916('0x1c')&&typeof _0x37aecd[_0x2916('0x1d')]===_0x2916('0x1c');var _0x2a2c68=_0x223030[_0x2916('0x1e')];var _0xf5e6b7=_0x5b8263?0x0:_0x37aecd[_0x2916('0x1b')];var _0x215ca5=_0x5b8263?_0x223030['count']:_0x37aecd[_0x2916('0x1b')]+_0x37aecd[_0x2916('0x1d')];var _0x183a04;if(_0x215ca5>=_0x2a2c68){_0x215ca5=_0x2a2c68;_0x183a04=0xc8;}else{_0x183a04=0xce;}_0x398e03[_0x2916('0x19')](_0x183a04);return _0x398e03[_0x2916('0x1f')](_0x2916('0x20'),_0xf5e6b7+'-'+_0x215ca5+'/'+_0x2a2c68)[_0x2916('0x1a')](_0x223030);}return null;};}function patchUpdates(_0x5e5c75){return function(_0x2be3c1){try{jsonpatch['apply'](_0x2be3c1,_0x5e5c75,!![]);}catch(_0x3b4a2e){return BPromise['reject'](_0x3b4a2e);}return _0x2be3c1[_0x2916('0x21')]();};}function saveUpdates(_0x973586,_0x194dfa){return function(_0x4fff88){if(_0x4fff88){return _0x4fff88[_0x2916('0x22')](_0x973586)[_0x2916('0x23')](function(_0x225829){return _0x225829;});}return null;};}function removeEntity(_0x5f0306,_0x1fe3a5){return function(_0x4ed8f2){if(_0x4ed8f2){return _0x4ed8f2[_0x2916('0x24')]()[_0x2916('0x23')](function(){_0x5f0306['status'](0xcc)[_0x2916('0x25')]();});}};}function handleEntityNotFound(_0x39a2d4,_0x258363){return function(_0x5454de){if(!_0x5454de){_0x39a2d4[_0x2916('0x26')](0x194);}return _0x5454de;};}function handleError(_0x31d8e0,_0x4ea98f){_0x4ea98f=_0x4ea98f||0x1f4;return function(_0x4f4694){logger['error'](_0x4f4694['stack']);if(_0x4f4694[_0x2916('0x27')]){delete _0x4f4694[_0x2916('0x27')];}_0x31d8e0[_0x2916('0x19')](_0x4ea98f)['send'](_0x4f4694);};}exports[_0x2916('0x28')]=function(_0x5c9051,_0x161bf8){var _0x5e57f5={},_0x475136={},_0x3f243a={'count':0x0,'rows':[]};var _0x1ef9a8=_['map'](db[_0x2916('0x29')][_0x2916('0x2a')],function(_0x3cd293){return{'name':_0x3cd293[_0x2916('0x2b')],'type':_0x3cd293[_0x2916('0x2c')][_0x2916('0x2d')]};});_0x475136['model']=_['map'](_0x1ef9a8,_0x2916('0x27'));_0x475136[_0x2916('0x2e')]=_[_0x2916('0x2f')](_0x5c9051[_0x2916('0x2e')]);_0x475136['filters']=_[_0x2916('0x30')](_0x475136[_0x2916('0x31')],_0x475136[_0x2916('0x2e')]);_0x5e57f5['attributes']=_[_0x2916('0x30')](_0x475136[_0x2916('0x31')],qs[_0x2916('0x32')](_0x5c9051[_0x2916('0x2e')][_0x2916('0x32')]));_0x5e57f5[_0x2916('0x33')]=_0x5e57f5['attributes'][_0x2916('0x34')]?_0x5e57f5[_0x2916('0x33')]:_0x475136[_0x2916('0x31')];if(!_0x5c9051[_0x2916('0x2e')][_0x2916('0x35')]('nolimit')){_0x5e57f5[_0x2916('0x1d')]=qs[_0x2916('0x1d')](_0x5c9051[_0x2916('0x2e')][_0x2916('0x1d')]);_0x5e57f5[_0x2916('0x1b')]=qs[_0x2916('0x1b')](_0x5c9051['query'][_0x2916('0x1b')]);}_0x5e57f5[_0x2916('0x36')]=qs[_0x2916('0x37')](_0x5c9051[_0x2916('0x2e')]['sort']);_0x5e57f5[_0x2916('0x38')]=qs[_0x2916('0x39')](_[_0x2916('0x3a')](_0x5c9051[_0x2916('0x2e')],_0x475136[_0x2916('0x39')]),_0x1ef9a8);if(_0x5c9051[_0x2916('0x2e')]['filter']){_0x5e57f5[_0x2916('0x38')]=_[_0x2916('0x3b')](_0x5e57f5[_0x2916('0x38')],{'$or':_['map'](_0x1ef9a8,function(_0x5bda40){if(_0x5bda40[_0x2916('0x2c')]!=='VIRTUAL'){var _0xb8ed6a={};_0xb8ed6a[_0x5bda40[_0x2916('0x27')]]={'$like':'%'+_0x5c9051[_0x2916('0x2e')][_0x2916('0x3c')]+'%'};return _0xb8ed6a;}})});}_0x5e57f5=_[_0x2916('0x3b')]({},_0x5e57f5,_0x5c9051[_0x2916('0x3d')]);var _0x1b0ac4={'where':_0x5e57f5[_0x2916('0x38')]};return db[_0x2916('0x29')][_0x2916('0x1e')](_0x1b0ac4)[_0x2916('0x23')](function(_0x145a3b){_0x3f243a[_0x2916('0x1e')]=_0x145a3b;if(_0x5c9051['query'][_0x2916('0x3e')]){_0x5e57f5[_0x2916('0x3f')]=[{'all':!![]}];}return db[_0x2916('0x29')][_0x2916('0x40')](_0x5e57f5);})[_0x2916('0x23')](function(_0x1cfe8f){_0x3f243a[_0x2916('0x41')]=_0x1cfe8f;return _0x3f243a;})[_0x2916('0x23')](respondWithFilteredResult(_0x161bf8,_0x5e57f5))[_0x2916('0x42')](handleError(_0x161bf8,null));};exports['show']=function(_0x3391e0,_0x3a23a0){var _0x2b95bf={'raw':!![],'where':{'id':_0x3391e0[_0x2916('0x43')]['id']}},_0x85e2eb={};_0x85e2eb[_0x2916('0x31')]=_[_0x2916('0x2f')](db['VoiceQueuesLog'][_0x2916('0x2a')]);_0x85e2eb[_0x2916('0x2e')]=_['keys'](_0x3391e0[_0x2916('0x2e')]);_0x85e2eb[_0x2916('0x39')]=_['intersection'](_0x85e2eb[_0x2916('0x31')],_0x85e2eb[_0x2916('0x2e')]);_0x2b95bf['attributes']=_['intersection'](_0x85e2eb['model'],qs['fields'](_0x3391e0[_0x2916('0x2e')][_0x2916('0x32')]));_0x2b95bf[_0x2916('0x33')]=_0x2b95bf['attributes'][_0x2916('0x34')]?_0x2b95bf[_0x2916('0x33')]:_0x85e2eb[_0x2916('0x31')];if(_0x3391e0['query'][_0x2916('0x3e')]){_0x2b95bf[_0x2916('0x3f')]=[{'all':!![]}];}_0x2b95bf=_['merge']({},_0x2b95bf,_0x3391e0[_0x2916('0x3d')]);return db[_0x2916('0x29')][_0x2916('0x44')](_0x2b95bf)[_0x2916('0x23')](handleEntityNotFound(_0x3a23a0,null))[_0x2916('0x23')](respondWithResult(_0x3a23a0,null))[_0x2916('0x42')](handleError(_0x3a23a0,null));};exports[_0x2916('0x45')]=function(_0x256411,_0x494127){return db['VoiceQueuesLog']['create'](_0x256411[_0x2916('0x46')],{})[_0x2916('0x23')](respondWithResult(_0x494127,0xc9))['catch'](handleError(_0x494127,null));};exports[_0x2916('0x22')]=function(_0x43812d,_0x1b871f){if(_0x43812d[_0x2916('0x46')]['id']){delete _0x43812d[_0x2916('0x46')]['id'];}return db[_0x2916('0x29')][_0x2916('0x44')]({'where':{'id':_0x43812d[_0x2916('0x43')]['id']}})['then'](handleEntityNotFound(_0x1b871f,null))[_0x2916('0x23')](saveUpdates(_0x43812d[_0x2916('0x46')],null))[_0x2916('0x23')](respondWithResult(_0x1b871f,null))[_0x2916('0x42')](handleError(_0x1b871f,null));};exports[_0x2916('0x24')]=function(_0x54e70d,_0x54b6fa){return db[_0x2916('0x29')][_0x2916('0x44')]({'where':{'id':_0x54e70d[_0x2916('0x43')]['id']}})['then'](handleEntityNotFound(_0x54b6fa,null))[_0x2916('0x23')](removeEntity(_0x54b6fa,null))[_0x2916('0x42')](handleError(_0x54b6fa,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index e348567..757a224 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 _0xbdeb=['dtm','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./voiceQueuesLog.attributes','define','voice_queues_log','event'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbdeb,0x1ef));var _0xbbde=function(_0x2e5a33,_0x2e768c){_0x2e5a33=_0x2e5a33-0x0;var _0x1f5221=_0xbdeb[_0x2e5a33];return _0x1f5221;};'use strict';var _=require(_0xbbde('0x0'));var util=require('util');var logger=require(_0xbbde('0x1'))(_0xbbde('0x2'));var moment=require(_0xbbde('0x3'));var BPromise=require(_0xbbde('0x4'));var rp=require(_0xbbde('0x5'));var fs=require('fs');var path=require(_0xbbde('0x6'));var rimraf=require('rimraf');var config=require(_0xbbde('0x7'));var attributes=require(_0xbbde('0x8'));module['exports']=function(_0x49a834,_0x459cdd){return _0x49a834[_0xbbde('0x9')]('VoiceQueuesLog',attributes,{'tableName':_0xbbde('0xa'),'paranoid':![],'indexes':[{'name':'event_dtm','fields':[_0xbbde('0xb'),_0xbbde('0xc')]}],'timestamps':![]});}; \ No newline at end of file +var _0xe5ec=['./voiceQueuesLog.attributes','exports','VoiceQueuesLog','voice_queues_log','event_dtm','event','dtm','lodash','../../config/logger','api','moment','rimraf','../../config/environment'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0xe5ec,0x1b4));var _0xce5e=function(_0x56dbc3,_0x41c87a){_0x56dbc3=_0x56dbc3-0x0;var _0x58cf7f=_0xe5ec[_0x56dbc3];return _0x58cf7f;};'use strict';var _=require(_0xce5e('0x0'));var util=require('util');var logger=require(_0xce5e('0x1'))(_0xce5e('0x2'));var moment=require(_0xce5e('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xce5e('0x4'));var config=require(_0xce5e('0x5'));var attributes=require(_0xce5e('0x6'));module[_0xce5e('0x7')]=function(_0x10d862,_0x538418){return _0x10d862['define'](_0xce5e('0x8'),attributes,{'tableName':_0xce5e('0x9'),'paranoid':![],'indexes':[{'name':_0xce5e('0xa'),'fields':[_0xce5e('0xb'),_0xce5e('0xc')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index 481de91..6297290 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 _0x0b3e=['debug','stringify','error','message','info','VoiceQueuesLog,\x20%s,\x20%s','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','then','request\x20sent'];(function(_0x2c071b,_0x2b57ba){var _0x25749b=function(_0x2d475c){while(--_0x2d475c){_0x2c071b['push'](_0x2c071b['shift']());}};_0x25749b(++_0x2b57ba);}(_0x0b3e,0xfe));var _0xe0b3=function(_0x445bf2,_0x3c9a29){_0x445bf2=_0x445bf2-0x0;var _0x4add18=_0x0b3e[_0x445bf2];return _0x4add18;};'use strict';var _=require('lodash');var util=require(_0xe0b3('0x0'));var moment=require(_0xe0b3('0x1'));var BPromise=require(_0xe0b3('0x2'));var rs=require(_0xe0b3('0x3'));var fs=require('fs');var Redis=require(_0xe0b3('0x4'));var db=require(_0xe0b3('0x5'))['db'];var utils=require(_0xe0b3('0x6'));var logger=require('../../config/logger')(_0xe0b3('0x7'));var config=require(_0xe0b3('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xe0b3('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2c465f,_0x206ba2,_0x42d537){return new BPromise(function(_0x4ceb89,_0x4b62f2){return client['request'](_0x2c465f,_0x42d537)[_0xe0b3('0xa')](function(_0x4c841b){logger['info']('VoiceQueuesLog,\x20%s,\x20%s',_0x206ba2,_0xe0b3('0xb'));logger[_0xe0b3('0xc')]('VoiceQueuesLog,\x20%s,\x20%s,\x20%s',_0x206ba2,'request\x20sent',JSON[_0xe0b3('0xd')](_0x4c841b));if(_0x4c841b[_0xe0b3('0xe')]){if(_0x4c841b[_0xe0b3('0xe')]['code']===0x1f4){logger[_0xe0b3('0xe')]('VoiceQueuesLog,\x20%s,\x20%s',_0x206ba2,_0x4c841b[_0xe0b3('0xe')]['message']);return _0x4b62f2(_0x4c841b[_0xe0b3('0xe')]['message']);}logger[_0xe0b3('0xe')]('VoiceQueuesLog,\x20%s,\x20%s',_0x206ba2,_0x4c841b[_0xe0b3('0xe')][_0xe0b3('0xf')]);return _0x4ceb89(_0x4c841b[_0xe0b3('0xe')][_0xe0b3('0xf')]);}else{logger[_0xe0b3('0x10')](_0xe0b3('0x11'),_0x206ba2,_0xe0b3('0xb'));_0x4ceb89(_0x4c841b[_0xe0b3('0x12')][_0xe0b3('0xf')]);}})['catch'](function(_0x4eeced){logger['error'](_0xe0b3('0x11'),_0x206ba2,_0x4eeced);_0x4b62f2(_0x4eeced);});});} \ No newline at end of file +var _0x867f=['then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http'];(function(_0x5e980d,_0x316987){var _0x347477=function(_0x5566a8){while(--_0x5566a8){_0x5e980d['push'](_0x5e980d['shift']());}};_0x347477(++_0x316987);}(_0x867f,0xe6));var _0xf867=function(_0x30f395,_0x3629b5){_0x30f395=_0x30f395-0x0;var _0x2ea0ee=_0x867f[_0x30f395];return _0x2ea0ee;};'use strict';var _=require(_0xf867('0x0'));var util=require(_0xf867('0x1'));var moment=require(_0xf867('0x2'));var BPromise=require(_0xf867('0x3'));var rs=require(_0xf867('0x4'));var fs=require('fs');var Redis=require(_0xf867('0x5'));var db=require(_0xf867('0x6'))['db'];var utils=require(_0xf867('0x7'));var logger=require(_0xf867('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0xf867('0x9'));var client=jayson[_0xf867('0xa')][_0xf867('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2841d1,_0x3fe5d1,_0x5c35f9){return new BPromise(function(_0x583f87,_0x26cfba){return client['request'](_0x2841d1,_0x5c35f9)[_0xf867('0xc')](function(_0x2b1c12){logger[_0xf867('0xd')](_0xf867('0xe'),_0x3fe5d1,_0xf867('0xf'));logger[_0xf867('0x10')](_0xf867('0x11'),_0x3fe5d1,_0xf867('0xf'),JSON['stringify'](_0x2b1c12));if(_0x2b1c12[_0xf867('0x12')]){if(_0x2b1c12['error']['code']===0x1f4){logger[_0xf867('0x12')](_0xf867('0xe'),_0x3fe5d1,_0x2b1c12[_0xf867('0x12')]['message']);return _0x26cfba(_0x2b1c12['error'][_0xf867('0x13')]);}logger['error'](_0xf867('0xe'),_0x3fe5d1,_0x2b1c12['error']['message']);return _0x583f87(_0x2b1c12[_0xf867('0x12')][_0xf867('0x13')]);}else{logger[_0xf867('0xd')](_0xf867('0xe'),_0x3fe5d1,_0xf867('0xf'));_0x583f87(_0x2b1c12[_0xf867('0x14')][_0xf867('0x13')]);}})[_0xf867('0x15')](function(_0x33c10b){logger['error'](_0xf867('0xe'),_0x3fe5d1,_0x33c10b);_0x26cfba(_0x33c10b);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index c627af9..0184b4e 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 _0xacbe=['post','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./voiceRecording.controller','get','index','/describe','isAuthenticated','/:id/download','download','downloads','/:id/transcribe','downloadTranscribe'];(function(_0x571a56,_0x36a8fe){var _0x25fd65=function(_0x329c41){while(--_0x329c41){_0x571a56['push'](_0x571a56['shift']());}};_0x25fd65(++_0x36a8fe);}(_0xacbe,0xe8));var _0xeacb=function(_0x2d9d5f,_0x3591bd){_0x2d9d5f=_0x2d9d5f-0x0;var _0x11174b=_0xacbe[_0x2d9d5f];return _0x11174b;};'use strict';var multer=require(_0xeacb('0x0'));var util=require(_0xeacb('0x1'));var path=require(_0xeacb('0x2'));var timeout=require(_0xeacb('0x3'));var express=require(_0xeacb('0x4'));var router=express[_0xeacb('0x5')]();var fs_extra=require(_0xeacb('0x6'));var auth=require(_0xeacb('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xeacb('0x8'));router[_0xeacb('0x9')]('/',auth['isAuthenticated'](),controller[_0xeacb('0xa')]);router[_0xeacb('0x9')](_0xeacb('0xb'),auth[_0xeacb('0xc')](),controller['describe']);router[_0xeacb('0x9')]('/:id',auth[_0xeacb('0xc')](),controller['show']);router[_0xeacb('0x9')](_0xeacb('0xd'),auth['isAuthenticated'](),controller[_0xeacb('0xe')]);router['get']('/:id/downloads',controller[_0xeacb('0xf')]);router[_0xeacb('0x9')](_0xeacb('0x10'),auth[_0xeacb('0xc')](),controller[_0xeacb('0x11')]);router[_0xeacb('0x12')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0xeacb('0x10'),auth[_0xeacb('0xc')](),controller['runTranscribe']);router[_0xeacb('0x13')](_0xeacb('0x14'),auth[_0xeacb('0xc')](),controller[_0xeacb('0x15')]);router[_0xeacb('0x16')](_0xeacb('0x14'),auth[_0xeacb('0xc')](),controller[_0xeacb('0x17')]);module[_0xeacb('0x18')]=router; \ No newline at end of file +var _0xac48=['/:id/download','/:id/downloads','downloads','/:id/transcribe','downloadTranscribe','post','create','put','update','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./voiceRecording.controller','isAuthenticated','index','get','/describe','describe','/:id','show'];(function(_0x563e99,_0x181622){var _0x196311=function(_0x2d7dac){while(--_0x2d7dac){_0x563e99['push'](_0x563e99['shift']());}};_0x196311(++_0x181622);}(_0xac48,0xf4));var _0x8ac4=function(_0x5b12a0,_0xb8dcbf){_0x5b12a0=_0x5b12a0-0x0;var _0x383d87=_0xac48[_0x5b12a0];return _0x383d87;};'use strict';var multer=require('multer');var util=require(_0x8ac4('0x0'));var path=require(_0x8ac4('0x1'));var timeout=require(_0x8ac4('0x2'));var express=require(_0x8ac4('0x3'));var router=express[_0x8ac4('0x4')]();var fs_extra=require(_0x8ac4('0x5'));var auth=require(_0x8ac4('0x6'));var interaction=require(_0x8ac4('0x7'));var config=require('../../config/environment');var controller=require(_0x8ac4('0x8'));router['get']('/',auth[_0x8ac4('0x9')](),controller[_0x8ac4('0xa')]);router[_0x8ac4('0xb')](_0x8ac4('0xc'),auth[_0x8ac4('0x9')](),controller[_0x8ac4('0xd')]);router[_0x8ac4('0xb')](_0x8ac4('0xe'),auth[_0x8ac4('0x9')](),controller[_0x8ac4('0xf')]);router['get'](_0x8ac4('0x10'),auth[_0x8ac4('0x9')](),controller['download']);router[_0x8ac4('0xb')](_0x8ac4('0x11'),controller[_0x8ac4('0x12')]);router[_0x8ac4('0xb')](_0x8ac4('0x13'),auth[_0x8ac4('0x9')](),controller[_0x8ac4('0x14')]);router[_0x8ac4('0x15')]('/',auth[_0x8ac4('0x9')](),controller[_0x8ac4('0x16')]);router['post'](_0x8ac4('0x13'),auth[_0x8ac4('0x9')](),controller['runTranscribe']);router[_0x8ac4('0x17')](_0x8ac4('0xe'),auth['isAuthenticated'](),controller[_0x8ac4('0x18')]);router['delete'](_0x8ac4('0xe'),auth[_0x8ac4('0x9')](),controller['destroy']);module[_0x8ac4('0x19')]=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index 511e725..f28d6a5 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(_0x45d3f0,_0x4be53f){var _0x314b79=function(_0x563d32){while(--_0x563d32){_0x45d3f0['push'](_0x45d3f0['shift']());}};_0x314b79(++_0x4be53f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0xa9e0[_0x5037ab];return _0x512adb;};'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(_0x39096d,_0x51f8a0){var _0x13da4f=function(_0x11e6b2){while(--_0x11e6b2){_0x39096d['push'](_0x39096d['shift']());}};_0x13da4f(++_0x51f8a0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xa9e0[_0x501510];return _0x1e6ee5;};'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 1ec5f31..5c6a196 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 _0xf010=['Transcript\x20not\x20available','eml-format','rimraf','zip-dir','request-promise','mustache','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','aws-sdk','uuid/v4','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','destroy','then','error','name','send','index','VoiceRecording','rawAttributes','fieldName','type','key','model','differenceBy','format','query','keys','intersection','attributes','fields','length','order','sort','where','filters','filter','merge','map','VIRTUAL','options','includeAll','include','catch','show','params','create','body','find','describe','../../components/encryptor','uniqueid','value','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','download','extname','unlink','message','Not\x20found','downloads','sequelize','MD5','col','$and','push','%s.cypher','isNil','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','unlinkSync','.cypher','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','listBuckets','createBucket','upload','TranscribeService','startTranscriptionJob','basename','readFileSync','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','Bucket','location','[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request','[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created','TranscriptionJob','TranscriptionJobName','transcribeName','transcribeStatus','TranscriptionJobStatus','runTranscribe','findOne','Voice\x20Recording\x20not\x20found','Setting','transcribe','transcribeRegion','runSentiment','sentiment','sentimentAccountId','language','bucket','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','transcribeAccountId','Cloud\x20Provider\x20not\x20available','data1','data2','Cloud\x20Provider\x20not\x20configured','Buckets','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested','IN_PROGRESS','tempSentiment','downloadTranscribe','fileText','root'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf010,0x96));var _0x0f01=function(_0x2bd380,_0xbda074){_0x2bd380=_0x2bd380-0x0;var _0x8716fc=_0xf010[_0x2bd380];return _0x8716fc;};'use strict';var emlformat=require(_0x0f01('0x0'));var rimraf=require(_0x0f01('0x1'));var zipdir=require(_0x0f01('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0f01('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x0f01('0x4'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x0f01('0x5'));var ejs=require(_0x0f01('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x0f01('0x7'));var squel=require(_0x0f01('0x8'));var crypto=require(_0x0f01('0x9'));var jsforce=require(_0x0f01('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x0f01('0x5'));var querystring=require('querystring');var Papa=require(_0x0f01('0xb'));var AWS=require(_0x0f01('0xc'));var uuidv4=require(_0x0f01('0xd'));var Redis=require('ioredis');var authService=require(_0x0f01('0xe'));var qs=require(_0x0f01('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x0f01('0x10'))('api');var utils=require(_0x0f01('0x11'));var config=require(_0x0f01('0x12'));var licenseUtil=require(_0x0f01('0x13'));var db=require(_0x0f01('0x14'))['db'];function respondWithStatusCode(_0x36f1e6,_0x3ea7a9){_0x3ea7a9=_0x3ea7a9||0xcc;return function(_0x260584){if(_0x260584){return _0x36f1e6[_0x0f01('0x15')](_0x3ea7a9);}return _0x36f1e6[_0x0f01('0x16')](_0x3ea7a9)[_0x0f01('0x17')]();};}function respondWithResult(_0x106d50,_0x32439b){_0x32439b=_0x32439b||0xc8;return function(_0x208862){if(_0x208862){return _0x106d50[_0x0f01('0x16')](_0x32439b)[_0x0f01('0x18')](_0x208862);}};}function respondWithFilteredResult(_0x40256f,_0x2f6813){return function(_0x2bcc3a){if(_0x2bcc3a){var _0x551dcd=typeof _0x2f6813[_0x0f01('0x19')]===_0x0f01('0x1a')&&typeof _0x2f6813[_0x0f01('0x1b')]==='undefined';var _0x2821d8=_0x2bcc3a['count'];var _0x2793e5=_0x551dcd?0x0:_0x2f6813['offset'];var _0x23ab01=_0x551dcd?_0x2bcc3a[_0x0f01('0x1c')]:_0x2f6813['offset']+_0x2f6813[_0x0f01('0x1b')];var _0x254288;if(_0x23ab01>=_0x2821d8){_0x23ab01=_0x2821d8;_0x254288=0xc8;}else{_0x254288=0xce;}_0x40256f[_0x0f01('0x16')](_0x254288);return _0x40256f[_0x0f01('0x1d')](_0x0f01('0x1e'),_0x2793e5+'-'+_0x23ab01+'/'+_0x2821d8)[_0x0f01('0x18')](_0x2bcc3a);}return null;};}function patchUpdates(_0x26ff78){return function(_0x50e053){try{jsonpatch['apply'](_0x50e053,_0x26ff78,!![]);}catch(_0x581a7d){return BPromise[_0x0f01('0x1f')](_0x581a7d);}return _0x50e053['save']();};}function saveUpdates(_0x32a1b7,_0x501159){return function(_0x51e46c){if(_0x51e46c){return _0x51e46c[_0x0f01('0x20')](_0x32a1b7)['then'](function(_0x57ae86){return _0x57ae86;});}return null;};}function removeEntity(_0x467c94,_0x3acd78){return function(_0x36cd0f){if(_0x36cd0f){return _0x36cd0f[_0x0f01('0x21')]()[_0x0f01('0x22')](function(){_0x467c94[_0x0f01('0x16')](0xcc)[_0x0f01('0x17')]();});}};}function handleEntityNotFound(_0x860c76,_0x2618ed){return function(_0x492a87){if(!_0x492a87){_0x860c76[_0x0f01('0x15')](0x194);}return _0x492a87;};}function handleError(_0x2f95ac,_0x32001e){_0x32001e=_0x32001e||0x1f4;return function(_0x39e964){logger[_0x0f01('0x23')](_0x39e964['stack']);if(_0x39e964[_0x0f01('0x24')]){delete _0x39e964['name'];}_0x2f95ac['status'](_0x32001e)[_0x0f01('0x25')](_0x39e964);};}exports[_0x0f01('0x26')]=function(_0x1f451d,_0x8e762a){var _0x493938={},_0x386d5c={},_0x3754a0={'count':0x0,'rows':[]};var _0xa5bd4e=_['map'](db[_0x0f01('0x27')][_0x0f01('0x28')],function(_0x4b7b18){return{'name':_0x4b7b18[_0x0f01('0x29')],'type':_0x4b7b18[_0x0f01('0x2a')][_0x0f01('0x2b')]};});_0x386d5c[_0x0f01('0x2c')]=_[_0x0f01('0x2d')](_['map'](_0xa5bd4e,_0x0f01('0x24')),[_0x0f01('0x2e')]);_0x386d5c[_0x0f01('0x2f')]=_[_0x0f01('0x30')](_0x1f451d[_0x0f01('0x2f')]);_0x386d5c['filters']=_[_0x0f01('0x31')](_0x386d5c['model'],_0x386d5c[_0x0f01('0x2f')]);_0x493938[_0x0f01('0x32')]=_[_0x0f01('0x31')](_0x386d5c[_0x0f01('0x2c')],qs[_0x0f01('0x33')](_0x1f451d[_0x0f01('0x2f')][_0x0f01('0x33')]));_0x493938['attributes']=_0x493938[_0x0f01('0x32')][_0x0f01('0x34')]?_0x493938[_0x0f01('0x32')]:_0x386d5c['model'];if(!_0x1f451d['query']['hasOwnProperty']('nolimit')){_0x493938[_0x0f01('0x1b')]=qs[_0x0f01('0x1b')](_0x1f451d[_0x0f01('0x2f')][_0x0f01('0x1b')]);_0x493938[_0x0f01('0x19')]=qs[_0x0f01('0x19')](_0x1f451d[_0x0f01('0x2f')][_0x0f01('0x19')]);}_0x493938[_0x0f01('0x35')]=qs['sort'](_0x1f451d[_0x0f01('0x2f')][_0x0f01('0x36')]);_0x493938[_0x0f01('0x37')]=qs[_0x0f01('0x38')](_['pick'](_0x1f451d[_0x0f01('0x2f')],_0x386d5c[_0x0f01('0x38')]),_0xa5bd4e);if(_0x1f451d[_0x0f01('0x2f')][_0x0f01('0x39')]){_0x493938[_0x0f01('0x37')]=_[_0x0f01('0x3a')](_0x493938['where'],{'$or':_[_0x0f01('0x3b')](_0xa5bd4e,function(_0x2ace8a){if(_0x2ace8a['type']!==_0x0f01('0x3c')){var _0x66a7ab={};_0x66a7ab[_0x2ace8a[_0x0f01('0x24')]]={'$like':'%'+_0x1f451d[_0x0f01('0x2f')][_0x0f01('0x39')]+'%'};return _0x66a7ab;}})});}_0x493938=_['merge']({},_0x493938,_0x1f451d[_0x0f01('0x3d')]);var _0x4cd91b={'where':_0x493938[_0x0f01('0x37')]};return db[_0x0f01('0x27')]['count'](_0x4cd91b)['then'](function(_0x492358){_0x3754a0[_0x0f01('0x1c')]=_0x492358;if(_0x1f451d[_0x0f01('0x2f')][_0x0f01('0x3e')]){_0x493938[_0x0f01('0x3f')]=[{'all':!![]}];}return db[_0x0f01('0x27')]['findAll'](_0x493938);})[_0x0f01('0x22')](function(_0x822545){_0x3754a0['rows']=_0x822545;return _0x3754a0;})[_0x0f01('0x22')](respondWithFilteredResult(_0x8e762a,_0x493938))[_0x0f01('0x40')](handleError(_0x8e762a,null));};exports[_0x0f01('0x41')]=function(_0xa64819,_0x56b9c6){var _0x1f902c={'raw':![],'where':{'id':_0xa64819[_0x0f01('0x42')]['id']}},_0x596476={};_0x596476[_0x0f01('0x2c')]=_[_0x0f01('0x30')](db[_0x0f01('0x27')][_0x0f01('0x28')]);_0x596476['query']=_[_0x0f01('0x30')](_0xa64819[_0x0f01('0x2f')]);_0x596476[_0x0f01('0x38')]=_['intersection'](_0x596476['model'],_0x596476['query']);_0x1f902c[_0x0f01('0x32')]=_[_0x0f01('0x31')](_0x596476[_0x0f01('0x2c')],qs[_0x0f01('0x33')](_0xa64819[_0x0f01('0x2f')][_0x0f01('0x33')]));_0x1f902c[_0x0f01('0x32')]=_0x1f902c[_0x0f01('0x32')]['length']?_0x1f902c[_0x0f01('0x32')]:_0x596476[_0x0f01('0x2c')];if(_0xa64819[_0x0f01('0x2f')][_0x0f01('0x3e')]){_0x1f902c[_0x0f01('0x3f')]=[{'all':!![]}];}_0x1f902c=_[_0x0f01('0x3a')]({},_0x1f902c,_0xa64819['options']);return db[_0x0f01('0x27')]['find'](_0x1f902c)[_0x0f01('0x22')](handleEntityNotFound(_0x56b9c6,null))[_0x0f01('0x22')](respondWithResult(_0x56b9c6,null))['catch'](handleError(_0x56b9c6,null));};exports[_0x0f01('0x43')]=function(_0x28a16e,_0x5a3ac8){return db[_0x0f01('0x27')][_0x0f01('0x43')](_0x28a16e[_0x0f01('0x44')],{})[_0x0f01('0x22')](respondWithResult(_0x5a3ac8,0xc9))[_0x0f01('0x40')](handleError(_0x5a3ac8,null));};exports[_0x0f01('0x20')]=function(_0x4e2db6,_0x33cbb6){if(_0x4e2db6[_0x0f01('0x44')]['id']){delete _0x4e2db6['body']['id'];}return db[_0x0f01('0x27')][_0x0f01('0x45')]({'where':{'id':_0x4e2db6[_0x0f01('0x42')]['id']}})['then'](handleEntityNotFound(_0x33cbb6,null))['then'](saveUpdates(_0x4e2db6['body'],null))[_0x0f01('0x22')](respondWithResult(_0x33cbb6,null))[_0x0f01('0x40')](handleError(_0x33cbb6,null));};exports[_0x0f01('0x46')]=function(_0x1784a5,_0x39706f){return db[_0x0f01('0x27')][_0x0f01('0x46')]()[_0x0f01('0x22')](respondWithResult(_0x39706f,null))[_0x0f01('0x40')](handleError(_0x39706f,null));};exports['download']=function(_0x46322b,_0x4607cd,_0x36a6b6){var _0x6981b8=require(_0x0f01('0x47'));var _0x27a70c=![];var _0x5c4ba5={};if(_0x46322b['query'][_0x0f01('0x2a')]&&_0x46322b['query'][_0x0f01('0x2a')]===_0x0f01('0x48')){_0x5c4ba5[_0x0f01('0x48')]=_0x46322b[_0x0f01('0x42')]['id'];}else{_0x5c4ba5['id']=_0x46322b[_0x0f01('0x42')]['id'];}return db['VoiceRecording'][_0x0f01('0x45')]({'where':_0x5c4ba5,'attributes':['id',_0x0f01('0x49')],'raw':!![]})[_0x0f01('0x22')](handleEntityNotFound(_0x4607cd,null))[_0x0f01('0x22')](function(_0x2a4ee4){if(_0x2a4ee4){var _0x4a6dd0=_0x2a4ee4[_0x0f01('0x49')];var _0x8f7a43=util[_0x0f01('0x2e')]('%s.cypher',_0x4a6dd0);if(fs[_0x0f01('0x4a')](_0x8f7a43)){_0x27a70c=!![];return _0x6981b8[_0x0f01('0x4b')](_0x8f7a43,_0x4a6dd0,config[_0x0f01('0x4c')][_0x0f01('0x4d')])['then'](function(){return _0x2a4ee4;});}return _0x2a4ee4;}})[_0x0f01('0x22')](function(_0x1ba005){if(_0x1ba005){var _0xb9bedd=_0x1ba005[_0x0f01('0x49')];if(!fs[_0x0f01('0x4a')](_0xb9bedd)){throw new db[(_0x0f01('0x4e'))][(_0x0f01('0x4f'))](_0x0f01('0x50'));}if(_0x1ba005[_0x0f01('0x51')]){return _0x4607cd[_0x0f01('0x52')](_0xb9bedd,_0x1ba005[_0x0f01('0x51')]+path[_0x0f01('0x53')](_0xb9bedd),function(){if(_0x27a70c){fs[_0x0f01('0x54')](_0xb9bedd);}});}else{return _0x4607cd[_0x0f01('0x52')](_0xb9bedd,function(_0x5b2585){if(_0x27a70c){fs['unlink'](_0xb9bedd);}});}}})[_0x0f01('0x40')](function(_0x4d57d6){if(_0x4d57d6[_0x0f01('0x55')]==='VoiceRecording\x20not\x20found'){_0x4607cd[_0x0f01('0x16')](0x194)[_0x0f01('0x25')](_0x0f01('0x56'));}else{return handleError(_0x4607cd,null);}});};exports[_0x0f01('0x57')]=function(_0x4cee0b,_0xcab2e3,_0x174df2){var _0x35cd2b=require('../../components/encryptor');var _0x10a1e1=![];var _0x94ff99={'$and':[db[_0x0f01('0x58')]['where'](db[_0x0f01('0x58')]['fn'](_0x0f01('0x59'),db[_0x0f01('0x58')][_0x0f01('0x5a')](_0x0f01('0x48'))),_0x4cee0b[_0x0f01('0x2f')]['token'])]};if(_0x4cee0b[_0x0f01('0x2f')][_0x0f01('0x2a')]&&_0x4cee0b['query']['type']===_0x0f01('0x48')){_0x94ff99[_0x0f01('0x5b')][_0x0f01('0x5c')]({'uniqueid':_0x4cee0b[_0x0f01('0x42')]['id']});}else{_0x94ff99[_0x0f01('0x5b')][_0x0f01('0x5c')]({'id':_0x4cee0b[_0x0f01('0x42')]['id']});}return db[_0x0f01('0x27')][_0x0f01('0x45')]({'where':_0x94ff99,'attributes':['id',_0x0f01('0x49')],'raw':!![]})['then'](handleEntityNotFound(_0xcab2e3,null))[_0x0f01('0x22')](function(_0x3bb3e7){if(_0x3bb3e7){var _0x8f1f61=util[_0x0f01('0x2e')](_0x0f01('0x5d'),_0x3bb3e7['value']);if(fs[_0x0f01('0x4a')](_0x8f1f61)){_0x10a1e1=!![];return _0x35cd2b[_0x0f01('0x4b')](_0x8f1f61,_0x3bb3e7[_0x0f01('0x49')],config[_0x0f01('0x4c')][_0x0f01('0x4d')])[_0x0f01('0x22')](function(){return _0x3bb3e7;});}return _0x3bb3e7;}})[_0x0f01('0x22')](function(_0x2e7841){if(_0x2e7841){if(!fs['existsSync'](_0x2e7841['value'])){throw new db[(_0x0f01('0x4e'))][(_0x0f01('0x4f'))]('VoiceRecording\x20not\x20found');}if(_0x2e7841[_0x0f01('0x51')]){return _0xcab2e3[_0x0f01('0x52')](_0x2e7841[_0x0f01('0x49')],_0x2e7841[_0x0f01('0x51')]+path[_0x0f01('0x53')](_0x2e7841[_0x0f01('0x49')]),function(){if(_0x10a1e1){fs[_0x0f01('0x54')](_0x2e7841[_0x0f01('0x49')]);}});}else{return _0xcab2e3[_0x0f01('0x52')](_0x2e7841[_0x0f01('0x49')],function(_0x1dee09){if(_0x10a1e1){fs[_0x0f01('0x54')](_0x2e7841['value']);}});}}})[_0x0f01('0x40')](handleError(_0xcab2e3,null));};exports['destroy']=function(_0x30a0de,_0x5cd958){return db[_0x0f01('0x27')][_0x0f01('0x45')]({'where':{'id':_0x30a0de[_0x0f01('0x42')]['id']}})[_0x0f01('0x22')](function(_0x619b43){if(_[_0x0f01('0x5e')](_0x619b43)){throw new ReferenceError(_0x0f01('0x5f'));}return _0x619b43;})[_0x0f01('0x22')](function(_0x4561fb){var _0x8c682e=_0x4561fb[_0x0f01('0x49')];logger[_0x0f01('0x60')](_0x0f01('0x61'),_0x8c682e);if(!_['isNil'](_0x4561fb[_0x0f01('0x49')])&&fs[_0x0f01('0x4a')](_0x8c682e)){logger[_0x0f01('0x60')](_0x0f01('0x62')+_0x8c682e+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x0f01('0x63')](_0x8c682e);}_0x8c682e=_0x8c682e+_0x0f01('0x64');if(!_[_0x0f01('0x5e')](_0x4561fb[_0x0f01('0x49')])&&fs[_0x0f01('0x4a')](_0x8c682e)){logger[_0x0f01('0x60')](_0x0f01('0x62')+_0x8c682e+_0x0f01('0x65'));fs['unlinkSync'](_0x8c682e);}return _0x4561fb;})[_0x0f01('0x22')](function(_0x252094){if(!_0x252094)throw new InternalError();return _0x252094['destroy']();})[_0x0f01('0x22')](function(){_0x5cd958[_0x0f01('0x16')](0xcc)[_0x0f01('0x17')]();})[_0x0f01('0x40')](handleError(_0x5cd958,null));};function getBucketslist(_0x39e0ab,_0x402a49,_0x4f340e){return new Promise(function(_0x2c21b7,_0x346e05){var _0x52e5b2=new AWS['S3']({'accessKeyId':_0x402a49,'secretAccessKey':_0x39e0ab,'region':_0x4f340e});_0x52e5b2[_0x0f01('0x66')]({},function(_0xfd2d3e,_0x23f23a){if(_0xfd2d3e){return _0x346e05(_0xfd2d3e);}else{return _0x2c21b7(_0x23f23a);}});});}function createBucket(_0x1f577b,_0x452501,_0x2ab2bf,_0x31c20d){return new Promise(function(_0x22097e,_0x4c7903){var _0x5c0e85=new AWS['S3']({'accessKeyId':_0x452501,'secretAccessKey':_0x1f577b,'region':_0x2ab2bf});_0x5c0e85[_0x0f01('0x67')]({'Bucket':_0x31c20d},function(_0x51cd35,_0x237aad){if(_0x51cd35){return _0x4c7903(_0x51cd35);}else{return _0x22097e(_0x237aad);}});});}function uploadFile(_0x5daed8,_0x50db66,_0x478645,_0x223836,_0x340145,_0x379642){return new Promise(function(_0x1cfef0,_0x2d7abc){var _0x125fb5=new AWS['S3']({'accessKeyId':_0x50db66,'secretAccessKey':_0x5daed8,'region':_0x478645});_0x125fb5[_0x0f01('0x68')]({'Bucket':_0x223836,'Key':_0x340145,'Body':_0x379642},function(_0x2c992f,_0x1d34b3){if(_0x2c992f){return _0x2d7abc(_0x2c992f);}else{return _0x1cfef0(_0x1d34b3);}});});}function startTranscribe(_0x560d24,_0x2ee5f2,_0x262f44,_0x342418,_0x3c6cd5,_0x3fc543){return new Promise(function(_0x1a05ed,_0x25f05b){var _0x50caf5=new AWS[(_0x0f01('0x69'))]({'accessKeyId':_0x2ee5f2,'secretAccessKey':_0x560d24,'region':_0x262f44});_0x50caf5[_0x0f01('0x6a')]({'TranscriptionJobName':_0x342418,'LanguageCode':_0x3c6cd5,'Media':{'MediaFileUri':_0x3fc543}},function(_0x598900,_0x3fef69){if(_0x598900){return _0x25f05b(_0x598900);}else{return _0x1a05ed(_0x3fef69);}});});}function transcribe(_0x5d7937,_0x1fab71,_0x1f97fc,_0x2c9a43,_0x2c6866,_0x2e5c3d,_0x4ab035){return new Promise(function(_0x2b0f40,_0x1a50d4){var _0x1733e2={};logger[_0x0f01('0x60')](util[_0x0f01('0x2e')]('[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s',_0x5d7937,_0x2c6866));return uploadFile(_0x1fab71,_0x1f97fc,_0x2c9a43,_0x2c6866,path[_0x0f01('0x6b')](_0x2e5c3d),fs[_0x0f01('0x6c')](_0x2e5c3d))['then'](function(_0x2d8df3){logger[_0x0f01('0x60')](util[_0x0f01('0x2e')](_0x0f01('0x6d'),_0x5d7937,_0x2c6866,_0x2d8df3[_0x0f01('0x6e')]));_0x1733e2['bucket']=_0x2d8df3[_0x0f01('0x6f')];_0x1733e2[_0x0f01('0x70')]=_0x2d8df3['Location'];logger[_0x0f01('0x60')](util[_0x0f01('0x2e')](_0x0f01('0x71'),_0x5d7937));return startTranscribe(_0x1fab71,_0x1f97fc,_0x2c9a43,uuidv4(),_0x4ab035,_0x2d8df3[_0x0f01('0x6e')]);})[_0x0f01('0x22')](function(_0x4ec10c){logger['info'](util[_0x0f01('0x2e')](_0x0f01('0x72'),_0x5d7937,_0x4ec10c[_0x0f01('0x73')][_0x0f01('0x74')]));_0x1733e2[_0x0f01('0x75')]=_0x4ec10c[_0x0f01('0x73')][_0x0f01('0x74')];_0x1733e2[_0x0f01('0x76')]=_0x4ec10c[_0x0f01('0x73')][_0x0f01('0x77')];return _0x2b0f40(_0x1733e2);})[_0x0f01('0x40')](function(_0x3515a8){return _0x1a50d4(_0x3515a8);});});}exports[_0x0f01('0x78')]=function(_0x26164a,_0x293f47,_0x15b91e){var _0x476710;var _0x1b4e29;var _0xf244ea;var _0x527455=require(_0x0f01('0x47'));return db[_0x0f01('0x27')][_0x0f01('0x79')]({'where':{'id':_0x26164a[_0x0f01('0x42')]['id']}})[_0x0f01('0x22')](function(_0x2eaf6b){if(_0x2eaf6b){var _0x94e132=util[_0x0f01('0x2e')](_0x0f01('0x5d'),_0x2eaf6b['value']);if(fs[_0x0f01('0x4a')](_0x94e132)){cypher=!![];return _0x527455[_0x0f01('0x4b')](_0x94e132,_0x2eaf6b[_0x0f01('0x49')],config[_0x0f01('0x4c')][_0x0f01('0x4d')])[_0x0f01('0x22')](function(){return _0x2eaf6b;});}return _0x2eaf6b;}})[_0x0f01('0x22')](function(_0x111d09){if(!_0x111d09){throw new db['Sequelize'][(_0x0f01('0x4f'))](_0x0f01('0x7a'));}_0x1b4e29=_0x111d09;return db[_0x0f01('0x7b')][_0x0f01('0x79')]({'where':{'id':0x1}});})['then'](handleEntityNotFound(_0x293f47,null))[_0x0f01('0x22')](function(_0x168be5){if(_0x168be5){_0x476710=_0x168be5;if(!_0x476710[_0x0f01('0x7c')]||!_0x476710['transcribeAccountId']||!_0x476710[_0x0f01('0x7d')]||!_0x476710['language']||!_0x476710['bucket']){throw new db[(_0x0f01('0x4e'))][(_0x0f01('0x4f'))]('Transcribe\x20not\x20configured');}if(_0x26164a[_0x0f01('0x44')][_0x0f01('0x7e')]&&(!_0x476710[_0x0f01('0x7f')]||!_0x476710[_0x0f01('0x80')]||!_0x476710['sentimentRegion']||!_0x476710[_0x0f01('0x81')]||!_0x476710[_0x0f01('0x82')])){throw new db[(_0x0f01('0x4e'))][(_0x0f01('0x4f'))](_0x0f01('0x83'));}return db[_0x0f01('0x84')][_0x0f01('0x79')]({'where':{'id':_0x476710[_0x0f01('0x85')]}});}})[_0x0f01('0x22')](function(_0x63be9){if(!_0x63be9){throw new db[(_0x0f01('0x4e'))][(_0x0f01('0x4f'))](_0x0f01('0x86'));}if(!_0x63be9[_0x0f01('0x87')]||!_0x63be9[_0x0f01('0x88')]){throw new db[(_0x0f01('0x4e'))][(_0x0f01('0x4f'))](_0x0f01('0x89'));}_0xf244ea=_0x63be9;return getBucketslist(_0xf244ea[_0x0f01('0x87')],_0xf244ea[_0x0f01('0x88')],_0x476710[_0x0f01('0x7d')]);})[_0x0f01('0x22')](function(_0x719587){if(_0x719587&&_0x719587['Buckets']){var _0x6add66=_[_0x0f01('0x45')](_0x719587[_0x0f01('0x8a')],function(_0xdb5d1e){return _0xdb5d1e['Name']===_0x476710[_0x0f01('0x82')];});if(!_0x6add66){logger[_0x0f01('0x60')](util[_0x0f01('0x2e')](_0x0f01('0x8b'),_0x26164a[_0x0f01('0x42')]['id'],_0x476710[_0x0f01('0x82')]));return createBucket(_0xf244ea[_0x0f01('0x87')],_0xf244ea[_0x0f01('0x88')],_0x476710[_0x0f01('0x7d')],_0x476710[_0x0f01('0x82')]);}logger['info'](util[_0x0f01('0x2e')](_0x0f01('0x8c'),_0x26164a[_0x0f01('0x42')]['id'],_0x476710['bucket']));return;}})[_0x0f01('0x22')](function(_0x3453f7){if(_0x1b4e29[_0x0f01('0x76')]===_0x0f01('0x8d')){return transcribe(_0x26164a[_0x0f01('0x42')]['id'],_0xf244ea[_0x0f01('0x87')],_0xf244ea[_0x0f01('0x88')],_0x476710[_0x0f01('0x7d')],_0x476710[_0x0f01('0x82')],_0x1b4e29[_0x0f01('0x49')],_0x476710['language']);}else{logger[_0x0f01('0x60')](util[_0x0f01('0x2e')](_0x0f01('0x8e'),_0x26164a['params']['id']));return{'transcribeStatus':_0x0f01('0x8f')};}})['then'](function(_0xef4f53){if(_0xef4f53){_0xef4f53[_0x0f01('0x90')]=_0x26164a[_0x0f01('0x44')]['runSentiment'];return _0x1b4e29['updateAttributes'](_0xef4f53);}})[_0x0f01('0x22')](respondWithResult(_0x293f47,null))[_0x0f01('0x40')](handleError(_0x293f47,null));};function writeFile(_0x51f31e,_0xa9e832){return new Promise(function(_0x10fb7a,_0xaa04a1){fs['writeFile'](_0xa9e832,_0x51f31e,function(_0x2192d6,_0x7f83b0){if(_0x2192d6){return _0xaa04a1(_0x2192d6);}else{return _0x10fb7a(_0x7f83b0);}});});}exports[_0x0f01('0x91')]=function(_0x36149d,_0x36cbc1,_0x5f00ac){return db[_0x0f01('0x27')][_0x0f01('0x79')]({'where':{'id':_0x36149d['params']['id']}})['then'](handleEntityNotFound(_0x36cbc1))['then'](function(_0x2b2d58){if(_0x2b2d58&&_0x2b2d58[_0x0f01('0x92')]){var _0x450d77=_0x2b2d58['fileText'];var _0x1dd897=config[_0x0f01('0x93')]+'/server/files/transcribes/transcribe_'+_0x2b2d58['id']+'.txt';if(fs[_0x0f01('0x4a')](_0x1dd897)){return _0x1dd897;}return writeFile(_0x450d77,_0x1dd897)[_0x0f01('0x22')](function(){return _0x1dd897;});}else{throw new db[(_0x0f01('0x4e'))][(_0x0f01('0x4f'))](_0x0f01('0x94'));}})[_0x0f01('0x22')](function(_0x49e163){return _0x36cbc1[_0x0f01('0x52')](_0x49e163);})[_0x0f01('0x40')](handleError(_0x36cbc1));}; \ No newline at end of file +var _0xce4c=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','squel','jsforce','querystring','papaparse','aws-sdk','uuid/v4','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','then','error','name','index','VoiceRecording','rawAttributes','fieldName','type','differenceBy','map','format','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','rows','catch','show','options','create','body','update','params','describe','download','../../components/encryptor','uniqueid','find','value','%s.cypher','decryptFile','secrets','recording','existsSync','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','extname','unlink','send','Not\x20found','downloads','sequelize','MD5','col','token','push','$and','destroy','isNil','info','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','File:\x20\x22','listBuckets','createBucket','startTranscriptionJob','basename','[RUNTRANSCRIPT][%d]\x20Voice\x20recording\x20uploaded\x20in\x20bucket\x20%s\x20(%s)','Location','bucket','TranscriptionJob','TranscriptionJobName','transcribeName','TranscriptionJobStatus','runTranscribe','findOne','transcribeAccountId','transcribeRegion','Transcribe\x20not\x20configured','sentimentAccountId','sentimentRegion','language','Sentiment\x20Analysis\x20not\x20configured','CloudProvider','Cloud\x20Provider\x20not\x20available','data1','data2','Cloud\x20Provider\x20not\x20configured','Buckets','Name','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20not\x20available','[RUNTRANSCRIPT][%d]\x20Bucket\x20%s\x20available','NEW','IN_PROGRESS','tempSentiment','updateAttributes','downloadTranscribe','fileText','root','/server/files/transcribes/transcribe_','.txt','Transcript\x20not\x20available','eml-format','rimraf'];(function(_0x5161fa,_0x69710b){var _0x467e3f=function(_0x4916ef){while(--_0x4916ef){_0x5161fa['push'](_0x5161fa['shift']());}};_0x467e3f(++_0x69710b);}(_0xce4c,0x8d));var _0xcce4=function(_0x35e00a,_0x4f48d4){_0x35e00a=_0x35e00a-0x0;var _0x3594d5=_0xce4c[_0x35e00a];return _0x3594d5;};'use strict';var emlformat=require(_0xcce4('0x0'));var rimraf=require(_0xcce4('0x1'));var zipdir=require(_0xcce4('0x2'));var jsonpatch=require(_0xcce4('0x3'));var rp=require(_0xcce4('0x4'));var moment=require(_0xcce4('0x5'));var BPromise=require(_0xcce4('0x6'));var Mustache=require(_0xcce4('0x7'));var util=require(_0xcce4('0x8'));var path=require('path');var sox=require(_0xcce4('0x9'));var csv=require(_0xcce4('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcce4('0xb'));var _=require('lodash');var squel=require(_0xcce4('0xc'));var crypto=require('crypto');var jsforce=require(_0xcce4('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xcce4('0xe'));var Papa=require(_0xcce4('0xf'));var AWS=require(_0xcce4('0x10'));var uuidv4=require(_0xcce4('0x11'));var Redis=require(_0xcce4('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xcce4('0x13'));var as=require(_0xcce4('0x14'));var hardwareService=require(_0xcce4('0x15'));var logger=require('../../config/logger')(_0xcce4('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xcce4('0x17'));var db=require(_0xcce4('0x18'))['db'];function respondWithStatusCode(_0x11edf2,_0xc95901){_0xc95901=_0xc95901||0xcc;return function(_0x4d9a36){if(_0x4d9a36){return _0x11edf2[_0xcce4('0x19')](_0xc95901);}return _0x11edf2[_0xcce4('0x1a')](_0xc95901)[_0xcce4('0x1b')]();};}function respondWithResult(_0x83f088,_0x506638){_0x506638=_0x506638||0xc8;return function(_0x3d7805){if(_0x3d7805){return _0x83f088[_0xcce4('0x1a')](_0x506638)['json'](_0x3d7805);}};}function respondWithFilteredResult(_0x4c8739,_0x278a32){return function(_0x2f8968){if(_0x2f8968){var _0x3fff21=typeof _0x278a32[_0xcce4('0x1c')]===_0xcce4('0x1d')&&typeof _0x278a32[_0xcce4('0x1e')]===_0xcce4('0x1d');var _0x4102e4=_0x2f8968[_0xcce4('0x1f')];var _0x57b781=_0x3fff21?0x0:_0x278a32[_0xcce4('0x1c')];var _0x15683c=_0x3fff21?_0x2f8968[_0xcce4('0x1f')]:_0x278a32[_0xcce4('0x1c')]+_0x278a32['limit'];var _0x18bf2e;if(_0x15683c>=_0x4102e4){_0x15683c=_0x4102e4;_0x18bf2e=0xc8;}else{_0x18bf2e=0xce;}_0x4c8739[_0xcce4('0x1a')](_0x18bf2e);return _0x4c8739[_0xcce4('0x20')](_0xcce4('0x21'),_0x57b781+'-'+_0x15683c+'/'+_0x4102e4)[_0xcce4('0x22')](_0x2f8968);}return null;};}function patchUpdates(_0x3a9f4c){return function(_0x44ffb4){try{jsonpatch['apply'](_0x44ffb4,_0x3a9f4c,!![]);}catch(_0x1422b7){return BPromise[_0xcce4('0x23')](_0x1422b7);}return _0x44ffb4['save']();};}function saveUpdates(_0x25272b,_0x49ae62){return function(_0x2081d4){if(_0x2081d4){return _0x2081d4['update'](_0x25272b)[_0xcce4('0x24')](function(_0x46a7fc){return _0x46a7fc;});}return null;};}function removeEntity(_0x1fadce,_0x791cea){return function(_0x2a1ba1){if(_0x2a1ba1){return _0x2a1ba1['destroy']()['then'](function(){_0x1fadce[_0xcce4('0x1a')](0xcc)[_0xcce4('0x1b')]();});}};}function handleEntityNotFound(_0x5af199,_0x428c45){return function(_0x23580d){if(!_0x23580d){_0x5af199[_0xcce4('0x19')](0x194);}return _0x23580d;};}function handleError(_0x3a2f27,_0x110a28){_0x110a28=_0x110a28||0x1f4;return function(_0x3a9f41){logger[_0xcce4('0x25')](_0x3a9f41['stack']);if(_0x3a9f41[_0xcce4('0x26')]){delete _0x3a9f41[_0xcce4('0x26')];}_0x3a2f27[_0xcce4('0x1a')](_0x110a28)['send'](_0x3a9f41);};}exports[_0xcce4('0x27')]=function(_0x3c752e,_0x58ecdf){var _0x2d980a={},_0x30e180={},_0x258c9a={'count':0x0,'rows':[]};var _0x17a5fd=_['map'](db[_0xcce4('0x28')][_0xcce4('0x29')],function(_0x10c22b){return{'name':_0x10c22b[_0xcce4('0x2a')],'type':_0x10c22b[_0xcce4('0x2b')]['key']};});_0x30e180['model']=_[_0xcce4('0x2c')](_[_0xcce4('0x2d')](_0x17a5fd,_0xcce4('0x26')),[_0xcce4('0x2e')]);_0x30e180[_0xcce4('0x2f')]=_[_0xcce4('0x30')](_0x3c752e[_0xcce4('0x2f')]);_0x30e180[_0xcce4('0x31')]=_[_0xcce4('0x32')](_0x30e180[_0xcce4('0x33')],_0x30e180[_0xcce4('0x2f')]);_0x2d980a[_0xcce4('0x34')]=_[_0xcce4('0x32')](_0x30e180[_0xcce4('0x33')],qs[_0xcce4('0x35')](_0x3c752e[_0xcce4('0x2f')][_0xcce4('0x35')]));_0x2d980a['attributes']=_0x2d980a[_0xcce4('0x34')]['length']?_0x2d980a['attributes']:_0x30e180['model'];if(!_0x3c752e[_0xcce4('0x2f')][_0xcce4('0x36')](_0xcce4('0x37'))){_0x2d980a[_0xcce4('0x1e')]=qs[_0xcce4('0x1e')](_0x3c752e['query'][_0xcce4('0x1e')]);_0x2d980a[_0xcce4('0x1c')]=qs[_0xcce4('0x1c')](_0x3c752e[_0xcce4('0x2f')][_0xcce4('0x1c')]);}_0x2d980a['order']=qs[_0xcce4('0x38')](_0x3c752e[_0xcce4('0x2f')][_0xcce4('0x38')]);_0x2d980a[_0xcce4('0x39')]=qs[_0xcce4('0x31')](_[_0xcce4('0x3a')](_0x3c752e[_0xcce4('0x2f')],_0x30e180[_0xcce4('0x31')]),_0x17a5fd);if(_0x3c752e[_0xcce4('0x2f')][_0xcce4('0x3b')]){_0x2d980a[_0xcce4('0x39')]=_[_0xcce4('0x3c')](_0x2d980a['where'],{'$or':_[_0xcce4('0x2d')](_0x17a5fd,function(_0x1a4df0){if(_0x1a4df0[_0xcce4('0x2b')]!==_0xcce4('0x3d')){var _0x59f9e0={};_0x59f9e0[_0x1a4df0[_0xcce4('0x26')]]={'$like':'%'+_0x3c752e['query']['filter']+'%'};return _0x59f9e0;}})});}_0x2d980a=_[_0xcce4('0x3c')]({},_0x2d980a,_0x3c752e['options']);var _0x420cf5={'where':_0x2d980a['where']};return db['VoiceRecording'][_0xcce4('0x1f')](_0x420cf5)[_0xcce4('0x24')](function(_0x4eff94){_0x258c9a['count']=_0x4eff94;if(_0x3c752e['query'][_0xcce4('0x3e')]){_0x2d980a[_0xcce4('0x3f')]=[{'all':!![]}];}return db[_0xcce4('0x28')]['findAll'](_0x2d980a);})[_0xcce4('0x24')](function(_0x27e6f4){_0x258c9a[_0xcce4('0x40')]=_0x27e6f4;return _0x258c9a;})[_0xcce4('0x24')](respondWithFilteredResult(_0x58ecdf,_0x2d980a))[_0xcce4('0x41')](handleError(_0x58ecdf,null));};exports[_0xcce4('0x42')]=function(_0xbb1c3a,_0x1aeb93){var _0x494667={'raw':![],'where':{'id':_0xbb1c3a['params']['id']}},_0x5f3abf={};_0x5f3abf[_0xcce4('0x33')]=_[_0xcce4('0x30')](db[_0xcce4('0x28')][_0xcce4('0x29')]);_0x5f3abf['query']=_[_0xcce4('0x30')](_0xbb1c3a[_0xcce4('0x2f')]);_0x5f3abf['filters']=_['intersection'](_0x5f3abf[_0xcce4('0x33')],_0x5f3abf[_0xcce4('0x2f')]);_0x494667[_0xcce4('0x34')]=_['intersection'](_0x5f3abf[_0xcce4('0x33')],qs[_0xcce4('0x35')](_0xbb1c3a[_0xcce4('0x2f')][_0xcce4('0x35')]));_0x494667['attributes']=_0x494667[_0xcce4('0x34')]['length']?_0x494667['attributes']:_0x5f3abf[_0xcce4('0x33')];if(_0xbb1c3a[_0xcce4('0x2f')][_0xcce4('0x3e')]){_0x494667[_0xcce4('0x3f')]=[{'all':!![]}];}_0x494667=_['merge']({},_0x494667,_0xbb1c3a[_0xcce4('0x43')]);return db[_0xcce4('0x28')]['find'](_0x494667)[_0xcce4('0x24')](handleEntityNotFound(_0x1aeb93,null))[_0xcce4('0x24')](respondWithResult(_0x1aeb93,null))['catch'](handleError(_0x1aeb93,null));};exports[_0xcce4('0x44')]=function(_0x58fbb5,_0x3c5383){return db[_0xcce4('0x28')][_0xcce4('0x44')](_0x58fbb5[_0xcce4('0x45')],{})[_0xcce4('0x24')](respondWithResult(_0x3c5383,0xc9))[_0xcce4('0x41')](handleError(_0x3c5383,null));};exports[_0xcce4('0x46')]=function(_0xc8344c,_0x32d4de){if(_0xc8344c[_0xcce4('0x45')]['id']){delete _0xc8344c[_0xcce4('0x45')]['id'];}return db[_0xcce4('0x28')]['find']({'where':{'id':_0xc8344c[_0xcce4('0x47')]['id']}})[_0xcce4('0x24')](handleEntityNotFound(_0x32d4de,null))[_0xcce4('0x24')](saveUpdates(_0xc8344c['body'],null))[_0xcce4('0x24')](respondWithResult(_0x32d4de,null))['catch'](handleError(_0x32d4de,null));};exports['describe']=function(_0x4425e9,_0x51470f){return db['VoiceRecording'][_0xcce4('0x48')]()[_0xcce4('0x24')](respondWithResult(_0x51470f,null))[_0xcce4('0x41')](handleError(_0x51470f,null));};exports[_0xcce4('0x49')]=function(_0x1149bc,_0x2f6875,_0x5de252){var _0x5b4a00=require(_0xcce4('0x4a'));var _0x2f6138=![];var _0xda4b52={};if(_0x1149bc[_0xcce4('0x2f')][_0xcce4('0x2b')]&&_0x1149bc['query'][_0xcce4('0x2b')]===_0xcce4('0x4b')){_0xda4b52['uniqueid']=_0x1149bc['params']['id'];}else{_0xda4b52['id']=_0x1149bc[_0xcce4('0x47')]['id'];}return db[_0xcce4('0x28')][_0xcce4('0x4c')]({'where':_0xda4b52,'attributes':['id',_0xcce4('0x4d')],'raw':!![]})[_0xcce4('0x24')](handleEntityNotFound(_0x2f6875,null))[_0xcce4('0x24')](function(_0x2c79ec){if(_0x2c79ec){var _0x43fa82=_0x2c79ec[_0xcce4('0x4d')];var _0x254fb8=util[_0xcce4('0x2e')](_0xcce4('0x4e'),_0x43fa82);if(fs['existsSync'](_0x254fb8)){_0x2f6138=!![];return _0x5b4a00[_0xcce4('0x4f')](_0x254fb8,_0x43fa82,config[_0xcce4('0x50')][_0xcce4('0x51')])[_0xcce4('0x24')](function(){return _0x2c79ec;});}return _0x2c79ec;}})[_0xcce4('0x24')](function(_0x58d0a7){if(_0x58d0a7){var _0x3ad032=_0x58d0a7[_0xcce4('0x4d')];if(!fs[_0xcce4('0x52')](_0x3ad032)){throw new db[(_0xcce4('0x53'))][(_0xcce4('0x54'))](_0xcce4('0x55'));}if(_0x58d0a7[_0xcce4('0x56')]){return _0x2f6875['download'](_0x3ad032,_0x58d0a7[_0xcce4('0x56')]+path[_0xcce4('0x57')](_0x3ad032),function(){if(_0x2f6138){fs[_0xcce4('0x58')](_0x3ad032);}});}else{return _0x2f6875[_0xcce4('0x49')](_0x3ad032,function(_0x5b92bc){if(_0x2f6138){fs[_0xcce4('0x58')](_0x3ad032);}});}}})[_0xcce4('0x41')](function(_0x443a18){if(_0x443a18['message']===_0xcce4('0x55')){_0x2f6875[_0xcce4('0x1a')](0x194)[_0xcce4('0x59')](_0xcce4('0x5a'));}else{return handleError(_0x2f6875,null);}});};exports[_0xcce4('0x5b')]=function(_0x154095,_0x5b40cc,_0x44e522){var _0x45e978=require(_0xcce4('0x4a'));var _0x11b647=![];var _0x1d0c5d={'$and':[db[_0xcce4('0x5c')][_0xcce4('0x39')](db[_0xcce4('0x5c')]['fn'](_0xcce4('0x5d'),db['sequelize'][_0xcce4('0x5e')](_0xcce4('0x4b'))),_0x154095[_0xcce4('0x2f')][_0xcce4('0x5f')])]};if(_0x154095['query'][_0xcce4('0x2b')]&&_0x154095[_0xcce4('0x2f')][_0xcce4('0x2b')]===_0xcce4('0x4b')){_0x1d0c5d['$and'][_0xcce4('0x60')]({'uniqueid':_0x154095['params']['id']});}else{_0x1d0c5d[_0xcce4('0x61')][_0xcce4('0x60')]({'id':_0x154095[_0xcce4('0x47')]['id']});}return db[_0xcce4('0x28')][_0xcce4('0x4c')]({'where':_0x1d0c5d,'attributes':['id',_0xcce4('0x4d')],'raw':!![]})[_0xcce4('0x24')](handleEntityNotFound(_0x5b40cc,null))[_0xcce4('0x24')](function(_0x5ac752){if(_0x5ac752){var _0x43cf52=util['format'](_0xcce4('0x4e'),_0x5ac752[_0xcce4('0x4d')]);if(fs[_0xcce4('0x52')](_0x43cf52)){_0x11b647=!![];return _0x45e978[_0xcce4('0x4f')](_0x43cf52,_0x5ac752[_0xcce4('0x4d')],config[_0xcce4('0x50')][_0xcce4('0x51')])[_0xcce4('0x24')](function(){return _0x5ac752;});}return _0x5ac752;}})['then'](function(_0x55a726){if(_0x55a726){if(!fs[_0xcce4('0x52')](_0x55a726[_0xcce4('0x4d')])){throw new db[(_0xcce4('0x53'))][(_0xcce4('0x54'))](_0xcce4('0x55'));}if(_0x55a726[_0xcce4('0x56')]){return _0x5b40cc[_0xcce4('0x49')](_0x55a726[_0xcce4('0x4d')],_0x55a726[_0xcce4('0x56')]+path['extname'](_0x55a726[_0xcce4('0x4d')]),function(){if(_0x11b647){fs[_0xcce4('0x58')](_0x55a726[_0xcce4('0x4d')]);}});}else{return _0x5b40cc[_0xcce4('0x49')](_0x55a726[_0xcce4('0x4d')],function(_0x375a9a){if(_0x11b647){fs[_0xcce4('0x58')](_0x55a726[_0xcce4('0x4d')]);}});}}})[_0xcce4('0x41')](handleError(_0x5b40cc,null));};exports[_0xcce4('0x62')]=function(_0x43a6f1,_0x529d6c){return db[_0xcce4('0x28')]['find']({'where':{'id':_0x43a6f1[_0xcce4('0x47')]['id']}})['then'](function(_0x1a2607){if(_[_0xcce4('0x63')](_0x1a2607)){throw new ReferenceError('Entity\x20not\x20found');}return _0x1a2607;})[_0xcce4('0x24')](function(_0x25e067){var _0x5e688a=_0x25e067[_0xcce4('0x4d')];logger[_0xcce4('0x64')]('cancellazione\x20fisica\x20documento\x20%s',_0x5e688a);if(!_['isNil'](_0x25e067[_0xcce4('0x4d')])&&fs[_0xcce4('0x52')](_0x5e688a)){logger[_0xcce4('0x64')]('File:\x20\x22'+_0x5e688a+_0xcce4('0x65'));fs[_0xcce4('0x66')](_0x5e688a);}_0x5e688a=_0x5e688a+'.cypher';if(!_[_0xcce4('0x63')](_0x25e067[_0xcce4('0x4d')])&&fs[_0xcce4('0x52')](_0x5e688a)){logger['info'](_0xcce4('0x67')+_0x5e688a+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xcce4('0x66')](_0x5e688a);}return _0x25e067;})[_0xcce4('0x24')](function(_0x3baa58){if(!_0x3baa58)throw new InternalError();return _0x3baa58[_0xcce4('0x62')]();})[_0xcce4('0x24')](function(){_0x529d6c[_0xcce4('0x1a')](0xcc)[_0xcce4('0x1b')]();})['catch'](handleError(_0x529d6c,null));};function getBucketslist(_0x24a947,_0x4e035b,_0x1ae40a){return new Promise(function(_0x1d9d0d,_0x5c2299){var _0x32d940=new AWS['S3']({'accessKeyId':_0x4e035b,'secretAccessKey':_0x24a947,'region':_0x1ae40a});_0x32d940[_0xcce4('0x68')]({},function(_0x13569c,_0x5cf981){if(_0x13569c){return _0x5c2299(_0x13569c);}else{return _0x1d9d0d(_0x5cf981);}});});}function createBucket(_0x28efc0,_0x3a2011,_0x863c96,_0x3d01ef){return new Promise(function(_0x298f2f,_0x477b87){var _0x3789e1=new AWS['S3']({'accessKeyId':_0x3a2011,'secretAccessKey':_0x28efc0,'region':_0x863c96});_0x3789e1[_0xcce4('0x69')]({'Bucket':_0x3d01ef},function(_0x3053f0,_0x11925e){if(_0x3053f0){return _0x477b87(_0x3053f0);}else{return _0x298f2f(_0x11925e);}});});}function uploadFile(_0x355a92,_0x430e6f,_0x227185,_0x4a4e65,_0x2e4dbf,_0x22aa46){return new Promise(function(_0x52d2a2,_0x3ab938){var _0xb3a811=new AWS['S3']({'accessKeyId':_0x430e6f,'secretAccessKey':_0x355a92,'region':_0x227185});_0xb3a811['upload']({'Bucket':_0x4a4e65,'Key':_0x2e4dbf,'Body':_0x22aa46},function(_0x230571,_0xcb91c5){if(_0x230571){return _0x3ab938(_0x230571);}else{return _0x52d2a2(_0xcb91c5);}});});}function startTranscribe(_0x7ed7e3,_0x31133d,_0xc09aed,_0x37e5b2,_0x29c9f6,_0x3e8976){return new Promise(function(_0x5cf575,_0x3c17bc){var _0x4835d4=new AWS['TranscribeService']({'accessKeyId':_0x31133d,'secretAccessKey':_0x7ed7e3,'region':_0xc09aed});_0x4835d4[_0xcce4('0x6a')]({'TranscriptionJobName':_0x37e5b2,'LanguageCode':_0x29c9f6,'Media':{'MediaFileUri':_0x3e8976}},function(_0x5f0141,_0x33e520){if(_0x5f0141){return _0x3c17bc(_0x5f0141);}else{return _0x5cf575(_0x33e520);}});});}function transcribe(_0x10b6e7,_0x4566e9,_0x4c4fc0,_0x58ad97,_0x3cacc8,_0x2be0ce,_0x4262a4){return new Promise(function(_0xbef705,_0x3a1d9e){var _0x413168={};logger[_0xcce4('0x64')](util[_0xcce4('0x2e')]('[RUNTRANSCRIPT][%d]\x20Starting\x20voice\x20recording\x20upload\x20in\x20bucket\x20%s',_0x10b6e7,_0x3cacc8));return uploadFile(_0x4566e9,_0x4c4fc0,_0x58ad97,_0x3cacc8,path[_0xcce4('0x6b')](_0x2be0ce),fs['readFileSync'](_0x2be0ce))[_0xcce4('0x24')](function(_0xdf7ed7){logger[_0xcce4('0x64')](util[_0xcce4('0x2e')](_0xcce4('0x6c'),_0x10b6e7,_0x3cacc8,_0xdf7ed7[_0xcce4('0x6d')]));_0x413168[_0xcce4('0x6e')]=_0xdf7ed7['Bucket'];_0x413168['location']=_0xdf7ed7[_0xcce4('0x6d')];logger[_0xcce4('0x64')](util[_0xcce4('0x2e')]('[RUNTRANSCRIPT][%d]\x20Sending\x20transcribe\x20request',_0x10b6e7));return startTranscribe(_0x4566e9,_0x4c4fc0,_0x58ad97,uuidv4(),_0x4262a4,_0xdf7ed7['Location']);})[_0xcce4('0x24')](function(_0x30d362){logger[_0xcce4('0x64')](util['format']('[RUNTRANSCRIPT][%d]\x20Transcription\x20job\x20%s\x20created',_0x10b6e7,_0x30d362[_0xcce4('0x6f')][_0xcce4('0x70')]));_0x413168[_0xcce4('0x71')]=_0x30d362['TranscriptionJob']['TranscriptionJobName'];_0x413168['transcribeStatus']=_0x30d362[_0xcce4('0x6f')][_0xcce4('0x72')];return _0xbef705(_0x413168);})[_0xcce4('0x41')](function(_0x227cf5){return _0x3a1d9e(_0x227cf5);});});}exports[_0xcce4('0x73')]=function(_0x48d00d,_0x261582,_0x5583bc){var _0x3b36ae;var _0x38cd8f;var _0x308c47;var _0x39c886=require('../../components/encryptor');return db[_0xcce4('0x28')][_0xcce4('0x74')]({'where':{'id':_0x48d00d[_0xcce4('0x47')]['id']}})[_0xcce4('0x24')](function(_0x24f7fb){if(_0x24f7fb){var _0x1af1ca=util[_0xcce4('0x2e')](_0xcce4('0x4e'),_0x24f7fb['value']);if(fs[_0xcce4('0x52')](_0x1af1ca)){cypher=!![];return _0x39c886[_0xcce4('0x4f')](_0x1af1ca,_0x24f7fb[_0xcce4('0x4d')],config[_0xcce4('0x50')][_0xcce4('0x51')])[_0xcce4('0x24')](function(){return _0x24f7fb;});}return _0x24f7fb;}})[_0xcce4('0x24')](function(_0x463b68){if(!_0x463b68){throw new db['Sequelize'][(_0xcce4('0x54'))]('Voice\x20Recording\x20not\x20found');}_0x38cd8f=_0x463b68;return db['Setting'][_0xcce4('0x74')]({'where':{'id':0x1}});})['then'](handleEntityNotFound(_0x261582,null))[_0xcce4('0x24')](function(_0x341e8c){if(_0x341e8c){_0x3b36ae=_0x341e8c;if(!_0x3b36ae['transcribe']||!_0x3b36ae[_0xcce4('0x75')]||!_0x3b36ae[_0xcce4('0x76')]||!_0x3b36ae['language']||!_0x3b36ae[_0xcce4('0x6e')]){throw new db[(_0xcce4('0x53'))][(_0xcce4('0x54'))](_0xcce4('0x77'));}if(_0x48d00d[_0xcce4('0x45')]['runSentiment']&&(!_0x3b36ae['sentiment']||!_0x3b36ae[_0xcce4('0x78')]||!_0x3b36ae[_0xcce4('0x79')]||!_0x3b36ae[_0xcce4('0x7a')]||!_0x3b36ae['bucket'])){throw new db[(_0xcce4('0x53'))]['ValidationError'](_0xcce4('0x7b'));}return db[_0xcce4('0x7c')]['findOne']({'where':{'id':_0x3b36ae[_0xcce4('0x75')]}});}})[_0xcce4('0x24')](function(_0x2fd9ab){if(!_0x2fd9ab){throw new db['Sequelize'][(_0xcce4('0x54'))](_0xcce4('0x7d'));}if(!_0x2fd9ab[_0xcce4('0x7e')]||!_0x2fd9ab[_0xcce4('0x7f')]){throw new db[(_0xcce4('0x53'))][(_0xcce4('0x54'))](_0xcce4('0x80'));}_0x308c47=_0x2fd9ab;return getBucketslist(_0x308c47[_0xcce4('0x7e')],_0x308c47[_0xcce4('0x7f')],_0x3b36ae[_0xcce4('0x76')]);})[_0xcce4('0x24')](function(_0x3b2ce5){if(_0x3b2ce5&&_0x3b2ce5[_0xcce4('0x81')]){var _0x359fa5=_['find'](_0x3b2ce5['Buckets'],function(_0xf3c99e){return _0xf3c99e[_0xcce4('0x82')]===_0x3b36ae[_0xcce4('0x6e')];});if(!_0x359fa5){logger[_0xcce4('0x64')](util[_0xcce4('0x2e')](_0xcce4('0x83'),_0x48d00d[_0xcce4('0x47')]['id'],_0x3b36ae['bucket']));return createBucket(_0x308c47[_0xcce4('0x7e')],_0x308c47[_0xcce4('0x7f')],_0x3b36ae['transcribeRegion'],_0x3b36ae['bucket']);}logger[_0xcce4('0x64')](util[_0xcce4('0x2e')](_0xcce4('0x84'),_0x48d00d[_0xcce4('0x47')]['id'],_0x3b36ae[_0xcce4('0x6e')]));return;}})['then'](function(_0x1c1d94){if(_0x38cd8f['transcribeStatus']===_0xcce4('0x85')){return transcribe(_0x48d00d[_0xcce4('0x47')]['id'],_0x308c47[_0xcce4('0x7e')],_0x308c47[_0xcce4('0x7f')],_0x3b36ae[_0xcce4('0x76')],_0x3b36ae[_0xcce4('0x6e')],_0x38cd8f[_0xcce4('0x4d')],_0x3b36ae[_0xcce4('0x7a')]);}else{logger[_0xcce4('0x64')](util[_0xcce4('0x2e')]('[RUNTRANSCRIPT][%d]\x20Transcript\x20action\x20already\x20requested',_0x48d00d[_0xcce4('0x47')]['id']));return{'transcribeStatus':_0xcce4('0x86')};}})['then'](function(_0x15d837){if(_0x15d837){_0x15d837[_0xcce4('0x87')]=_0x48d00d[_0xcce4('0x45')]['runSentiment'];return _0x38cd8f[_0xcce4('0x88')](_0x15d837);}})[_0xcce4('0x24')](respondWithResult(_0x261582,null))[_0xcce4('0x41')](handleError(_0x261582,null));};function writeFile(_0x1e5e0b,_0x1b6d55){return new Promise(function(_0x3b41f2,_0x314751){fs['writeFile'](_0x1b6d55,_0x1e5e0b,function(_0x26fb23,_0x549859){if(_0x26fb23){return _0x314751(_0x26fb23);}else{return _0x3b41f2(_0x549859);}});});}exports[_0xcce4('0x89')]=function(_0x2107c5,_0x1099b3,_0xa672fc){return db[_0xcce4('0x28')][_0xcce4('0x74')]({'where':{'id':_0x2107c5['params']['id']}})['then'](handleEntityNotFound(_0x1099b3))[_0xcce4('0x24')](function(_0x1bccab){if(_0x1bccab&&_0x1bccab[_0xcce4('0x8a')]){var _0x1adecc=_0x1bccab[_0xcce4('0x8a')];var _0x5f40ff=config[_0xcce4('0x8b')]+_0xcce4('0x8c')+_0x1bccab['id']+_0xcce4('0x8d');if(fs[_0xcce4('0x52')](_0x5f40ff)){return _0x5f40ff;}return writeFile(_0x1adecc,_0x5f40ff)['then'](function(){return _0x5f40ff;});}else{throw new db[(_0xcce4('0x53'))][(_0xcce4('0x54'))](_0xcce4('0x8e'));}})[_0xcce4('0x24')](function(_0x47c015){return _0x1099b3[_0xcce4('0x49')](_0x47c015);})['catch'](handleError(_0x1099b3));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index 0868e5d..517867f 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 _0x4429=['define','uniqueid','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x45a909,_0x4a2484){var _0xc24293=function(_0x4ca294){while(--_0x4ca294){_0x45a909['push'](_0x45a909['shift']());}};_0xc24293(++_0x4a2484);}(_0x4429,0x1ce));var _0x9442=function(_0x481e80,_0x58f101){_0x481e80=_0x481e80-0x0;var _0x3e0008=_0x4429[_0x481e80];return _0x3e0008;};'use strict';var _=require('lodash');var util=require(_0x9442('0x0'));var logger=require(_0x9442('0x1'))(_0x9442('0x2'));var moment=require(_0x9442('0x3'));var BPromise=require('bluebird');var rp=require(_0x9442('0x4'));var fs=require('fs');var path=require(_0x9442('0x5'));var rimraf=require(_0x9442('0x6'));var config=require(_0x9442('0x7'));var attributes=require('./voiceRecording.attributes');module['exports']=function(_0x4bee35,_0x1a5aa7){return _0x4bee35[_0x9442('0x8')]('VoiceRecording',attributes,{'tableName':'voice_recordings','paranoid':![],'indexes':[{'name':_0x9442('0x9'),'fields':[_0x9442('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x41d5=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceRecording.attributes','exports','define','VoiceRecording','voice_recordings','uniqueid'];(function(_0x3431fb,_0x8bf9e1){var _0x9c6a02=function(_0xf096d0){while(--_0xf096d0){_0x3431fb['push'](_0x3431fb['shift']());}};_0x9c6a02(++_0x8bf9e1);}(_0x41d5,0x7e));var _0x541d=function(_0x43c47a,_0x21a98e){_0x43c47a=_0x43c47a-0x0;var _0x318409=_0x41d5[_0x43c47a];return _0x318409;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x541d('0x0'))(_0x541d('0x1'));var moment=require(_0x541d('0x2'));var BPromise=require(_0x541d('0x3'));var rp=require(_0x541d('0x4'));var fs=require('fs');var path=require(_0x541d('0x5'));var rimraf=require(_0x541d('0x6'));var config=require(_0x541d('0x7'));var attributes=require(_0x541d('0x8'));module[_0x541d('0x9')]=function(_0x48614c,_0x4933a5){return _0x48614c[_0x541d('0xa')](_0x541d('0xb'),attributes,{'tableName':_0x541d('0xc'),'paranoid':![],'indexes':[{'name':_0x541d('0xd'),'fields':[_0x541d('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index 29ed620..f168f8d 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 _0x9582=['UpdateVoiceRecording','catch','CreateVoiceRecording','../../components/encryptor','Setting','findOne','callRecordingEncryption','create','existsSync','value','format','%s.cypher','secrets','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','VoiceRecording,\x20%s,\x20%s','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','VoiceRecording','body','options','where','attributes','limit','then'];(function(_0xa1cd92,_0x46dce6){var _0x243732=function(_0x2af4ff){while(--_0x2af4ff){_0xa1cd92['push'](_0xa1cd92['shift']());}};_0x243732(++_0x46dce6);}(_0x9582,0x95));var _0x2958=function(_0x73199d,_0x3c5647){_0x73199d=_0x73199d-0x0;var _0x403f00=_0x9582[_0x73199d];return _0x403f00;};'use strict';var _=require(_0x2958('0x0'));var util=require(_0x2958('0x1'));var moment=require(_0x2958('0x2'));var BPromise=require(_0x2958('0x3'));var rs=require(_0x2958('0x4'));var fs=require('fs');var Redis=require(_0x2958('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x2958('0x6'));var logger=require(_0x2958('0x7'))(_0x2958('0x8'));var config=require(_0x2958('0x9'));var jayson=require(_0x2958('0xa'));var client=jayson[_0x2958('0xb')][_0x2958('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x309525,_0xa385ec,_0x2e571b){return new BPromise(function(_0x56ca85,_0x5ec1b3){return client[_0x2958('0xd')](_0x309525,_0x2e571b)['then'](function(_0x10db1e){logger['info'](_0x2958('0xe'),_0xa385ec,'request\x20sent');logger[_0x2958('0xf')](_0x2958('0x10'),_0xa385ec,_0x2958('0x11'),JSON[_0x2958('0x12')](_0x10db1e));if(_0x10db1e[_0x2958('0x13')]){if(_0x10db1e['error'][_0x2958('0x14')]===0x1f4){logger[_0x2958('0x13')](_0x2958('0xe'),_0xa385ec,_0x10db1e[_0x2958('0x13')][_0x2958('0x15')]);return _0x5ec1b3(_0x10db1e[_0x2958('0x13')][_0x2958('0x15')]);}logger[_0x2958('0x13')]('VoiceRecording,\x20%s,\x20%s',_0xa385ec,_0x10db1e[_0x2958('0x13')][_0x2958('0x15')]);return _0x56ca85(_0x10db1e['error']['message']);}else{logger[_0x2958('0x16')](_0x2958('0xe'),_0xa385ec,'request\x20sent');_0x56ca85(_0x10db1e[_0x2958('0x17')]['message']);}})['catch'](function(_0x429d42){logger[_0x2958('0x13')]('VoiceRecording,\x20%s,\x20%s',_0xa385ec,_0x429d42);_0x5ec1b3(_0x429d42);});});}exports['UpdateVoiceRecording']=function(_0x28a92c){var _0x160949=this;return new Promise(function(_0x310d07,_0x42bb99){return db[_0x2958('0x18')]['update'](_0x28a92c[_0x2958('0x19')],{'raw':_0x28a92c[_0x2958('0x1a')]?_0x28a92c[_0x2958('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x28a92c[_0x2958('0x1a')]?_0x28a92c['options'][_0x2958('0x1b')]||null:null,'attributes':_0x28a92c['options']?_0x28a92c['options'][_0x2958('0x1c')]||null:null,'limit':_0x28a92c[_0x2958('0x1a')]?_0x28a92c[_0x2958('0x1a')][_0x2958('0x1d')]||null:null})[_0x2958('0x1e')](function(_0x412e42){logger[_0x2958('0x16')](_0x2958('0x1f'),_0x28a92c);logger[_0x2958('0xf')](_0x2958('0x1f'),_0x28a92c,JSON[_0x2958('0x12')](_0x412e42));_0x310d07(_0x412e42);})[_0x2958('0x20')](function(_0x119242){logger[_0x2958('0x13')](_0x2958('0x1f'),_0x119242['message'],_0x28a92c);_0x42bb99(_0x160949['error'](0x1f4,_0x119242[_0x2958('0x15')]));});});};exports[_0x2958('0x21')]=function(_0x28c1f5){var _0x43cf73=this;return new Promise(function(_0x52bd32,_0x2bd1ac){var _0x57ae96=require(_0x2958('0x22'));var _0x40adce;return db[_0x2958('0x23')][_0x2958('0x24')]({'attributes':['id',_0x2958('0x25')],'where':{'id':0x1},'raw':!![]})[_0x2958('0x1e')](function(_0x153958){_0x40adce=_0x153958;return db['VoiceRecording'][_0x2958('0x26')](_0x28c1f5['body']);})['then'](function(_0x28ee09){if(_0x40adce[_0x2958('0x25')]&&fs[_0x2958('0x27')](_0x28ee09[_0x2958('0x28')])){var _0x584179=util[_0x2958('0x29')](_0x2958('0x2a'),_0x28ee09[_0x2958('0x28')]);return _0x57ae96['encryptFile'](_0x28ee09[_0x2958('0x28')],_0x584179,config[_0x2958('0x2b')]['recording'])[_0x2958('0x1e')](function(){fs['unlink'](_0x28ee09[_0x2958('0x28')]);logger['info'](_0x2958('0x2c'));return _0x28ee09;});}return _0x28ee09;})['then'](function(_0x4477b5){logger[_0x2958('0x16')](_0x2958('0x21'),_0x28c1f5);logger[_0x2958('0xf')](_0x2958('0x21'),_0x28c1f5,JSON[_0x2958('0x12')](_0x4477b5));_0x52bd32(_0x4477b5);})[_0x2958('0x20')](function(_0x58f9b4){logger[_0x2958('0x13')]('CreateVoiceRecording',_0x58f9b4[_0x2958('0x15')],_0x28c1f5);_0x2bd1ac(_0x43cf73['error'](0x1f4,_0x58f9b4[_0x2958('0x15')]));});});}; \ No newline at end of file +var _0xacf4=['limit','debug','stringify','CreateVoiceRecording','../../components/encryptor','Setting','findOne','callRecordingEncryption','existsSync','value','%s.cypher','encryptFile','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','then','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','VoiceRecording,\x20%s,\x20%s,\x20%s','error','message','result','catch','UpdateVoiceRecording','VoiceRecording','update','body','options','raw','where','attributes'];(function(_0x201d98,_0x56fd1f){var _0x1ae057=function(_0xb7eeab){while(--_0xb7eeab){_0x201d98['push'](_0x201d98['shift']());}};_0x1ae057(++_0x56fd1f);}(_0xacf4,0xe7));var _0x4acf=function(_0x4d3e97,_0x749913){_0x4d3e97=_0x4d3e97-0x0;var _0x3147d7=_0xacf4[_0x4d3e97];return _0x3147d7;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4acf('0x0'));var BPromise=require(_0x4acf('0x1'));var rs=require(_0x4acf('0x2'));var fs=require('fs');var Redis=require(_0x4acf('0x3'));var db=require(_0x4acf('0x4'))['db'];var utils=require(_0x4acf('0x5'));var logger=require(_0x4acf('0x6'))('rpc');var config=require(_0x4acf('0x7'));var jayson=require(_0x4acf('0x8'));var client=jayson['client'][_0x4acf('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2ba08a,_0x649ad2,_0x45a5a4){return new BPromise(function(_0x25d345,_0x50f5f4){return client['request'](_0x2ba08a,_0x45a5a4)[_0x4acf('0xa')](function(_0x59f559){logger[_0x4acf('0xb')](_0x4acf('0xc'),_0x649ad2,_0x4acf('0xd'));logger['debug'](_0x4acf('0xe'),_0x649ad2,_0x4acf('0xd'),JSON['stringify'](_0x59f559));if(_0x59f559['error']){if(_0x59f559[_0x4acf('0xf')]['code']===0x1f4){logger['error'](_0x4acf('0xc'),_0x649ad2,_0x59f559[_0x4acf('0xf')][_0x4acf('0x10')]);return _0x50f5f4(_0x59f559[_0x4acf('0xf')][_0x4acf('0x10')]);}logger[_0x4acf('0xf')](_0x4acf('0xc'),_0x649ad2,_0x59f559[_0x4acf('0xf')][_0x4acf('0x10')]);return _0x25d345(_0x59f559[_0x4acf('0xf')][_0x4acf('0x10')]);}else{logger['info'](_0x4acf('0xc'),_0x649ad2,'request\x20sent');_0x25d345(_0x59f559[_0x4acf('0x11')][_0x4acf('0x10')]);}})[_0x4acf('0x12')](function(_0x5d934a){logger['error'](_0x4acf('0xc'),_0x649ad2,_0x5d934a);_0x50f5f4(_0x5d934a);});});}exports[_0x4acf('0x13')]=function(_0x240c00){var _0x4b1d93=this;return new Promise(function(_0x2a678b,_0x137302){return db[_0x4acf('0x14')][_0x4acf('0x15')](_0x240c00[_0x4acf('0x16')],{'raw':_0x240c00[_0x4acf('0x17')]?_0x240c00[_0x4acf('0x17')][_0x4acf('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x240c00[_0x4acf('0x17')]?_0x240c00[_0x4acf('0x17')][_0x4acf('0x19')]||null:null,'attributes':_0x240c00['options']?_0x240c00[_0x4acf('0x17')][_0x4acf('0x1a')]||null:null,'limit':_0x240c00['options']?_0x240c00[_0x4acf('0x17')][_0x4acf('0x1b')]||null:null})['then'](function(_0x3b26ac){logger[_0x4acf('0xb')](_0x4acf('0x13'),_0x240c00);logger[_0x4acf('0x1c')]('UpdateVoiceRecording',_0x240c00,JSON[_0x4acf('0x1d')](_0x3b26ac));_0x2a678b(_0x3b26ac);})[_0x4acf('0x12')](function(_0x57e595){logger[_0x4acf('0xf')](_0x4acf('0x13'),_0x57e595['message'],_0x240c00);_0x137302(_0x4b1d93[_0x4acf('0xf')](0x1f4,_0x57e595[_0x4acf('0x10')]));});});};exports[_0x4acf('0x1e')]=function(_0x16458f){var _0x571a30=this;return new Promise(function(_0x50236d,_0x17a756){var _0x3f548a=require(_0x4acf('0x1f'));var _0x42c90c;return db[_0x4acf('0x20')][_0x4acf('0x21')]({'attributes':['id',_0x4acf('0x22')],'where':{'id':0x1},'raw':!![]})[_0x4acf('0xa')](function(_0x382c41){_0x42c90c=_0x382c41;return db[_0x4acf('0x14')]['create'](_0x16458f[_0x4acf('0x16')]);})[_0x4acf('0xa')](function(_0xd027c7){if(_0x42c90c[_0x4acf('0x22')]&&fs[_0x4acf('0x23')](_0xd027c7[_0x4acf('0x24')])){var _0x27384c=util['format'](_0x4acf('0x25'),_0xd027c7[_0x4acf('0x24')]);return _0x3f548a[_0x4acf('0x26')](_0xd027c7['value'],_0x27384c,config[_0x4acf('0x27')][_0x4acf('0x28')])[_0x4acf('0xa')](function(){fs[_0x4acf('0x29')](_0xd027c7['value']);logger[_0x4acf('0xb')](_0x4acf('0x2a'));return _0xd027c7;});}return _0xd027c7;})[_0x4acf('0xa')](function(_0x5e2332){logger[_0x4acf('0xb')](_0x4acf('0x1e'),_0x16458f);logger[_0x4acf('0x1c')](_0x4acf('0x1e'),_0x16458f,JSON[_0x4acf('0x1d')](_0x5e2332));_0x50236d(_0x5e2332);})[_0x4acf('0x12')](function(_0x490880){logger[_0x4acf('0xf')](_0x4acf('0x1e'),_0x490880['message'],_0x16458f);_0x17a756(_0x571a30[_0x4acf('0xf')](0x1f4,_0x490880['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index 247c899..af4f311 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 _0x7d68=['isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get'];(function(_0x25c9de,_0x5045e9){var _0x1f8845=function(_0x4cb8c7){while(--_0x4cb8c7){_0x25c9de['push'](_0x25c9de['shift']());}};_0x1f8845(++_0x5045e9);}(_0x7d68,0x171));var _0x87d6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7d68[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x87d6('0x0'));var util=require(_0x87d6('0x1'));var path=require(_0x87d6('0x2'));var timeout=require(_0x87d6('0x3'));var express=require('express');var router=express[_0x87d6('0x4')]();var fs_extra=require(_0x87d6('0x5'));var auth=require(_0x87d6('0x6'));var interaction=require(_0x87d6('0x7'));var config=require('../../config/environment');var controller=require('./voiceTransferReport.controller');router[_0x87d6('0x8')]('/',auth[_0x87d6('0x9')](),controller[_0x87d6('0xa')]);router[_0x87d6('0x8')](_0x87d6('0xb'),auth[_0x87d6('0x9')](),controller[_0x87d6('0xc')]);router[_0x87d6('0x8')](_0x87d6('0xd'),auth[_0x87d6('0x9')](),controller[_0x87d6('0xe')]);router[_0x87d6('0xf')]('/',auth[_0x87d6('0x9')](),controller[_0x87d6('0x10')]);router[_0x87d6('0x11')](_0x87d6('0xd'),auth[_0x87d6('0x9')](),controller[_0x87d6('0x12')]);router[_0x87d6('0x13')]('/:id',auth[_0x87d6('0x9')](),controller[_0x87d6('0x14')]);module['exports']=router; \ No newline at end of file +var _0x6593=['../../components/interaction/service','./voiceTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0x2435d8,_0x41b4bb){var _0x4b6c60=function(_0x557ab8){while(--_0x557ab8){_0x2435d8['push'](_0x2435d8['shift']());}};_0x4b6c60(++_0x41b4bb);}(_0x6593,0x111));var _0x3659=function(_0x35468d,_0x2a7240){_0x35468d=_0x35468d-0x0;var _0x30da52=_0x6593[_0x35468d];return _0x30da52;};'use strict';var multer=require(_0x3659('0x0'));var util=require(_0x3659('0x1'));var path=require('path');var timeout=require(_0x3659('0x2'));var express=require(_0x3659('0x3'));var router=express[_0x3659('0x4')]();var fs_extra=require(_0x3659('0x5'));var auth=require(_0x3659('0x6'));var interaction=require(_0x3659('0x7'));var config=require('../../config/environment');var controller=require(_0x3659('0x8'));router[_0x3659('0x9')]('/',auth[_0x3659('0xa')](),controller[_0x3659('0xb')]);router[_0x3659('0x9')](_0x3659('0xc'),auth[_0x3659('0xa')](),controller[_0x3659('0xd')]);router[_0x3659('0x9')](_0x3659('0xe'),auth['isAuthenticated'](),controller[_0x3659('0xf')]);router[_0x3659('0x10')]('/',auth[_0x3659('0xa')](),controller[_0x3659('0x11')]);router['put'](_0x3659('0xe'),auth[_0x3659('0xa')](),controller['update']);router['delete'](_0x3659('0xe'),auth['isAuthenticated'](),controller[_0x3659('0x12')]);module[_0x3659('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index 2e6b1f5..d6c70c4 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 _0x6b12=['STRING','Yes','sequelize','exports','ENUM','blind','attended'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6b12,0x1ad));var _0x26b1=function(_0x40fd3f,_0x3f411d){_0x40fd3f=_0x40fd3f-0x0;var _0x3fef6f=_0x6b12[_0x40fd3f];return _0x3fef6f;};'use strict';var Sequelize=require(_0x26b1('0x0'));var moment=require('moment');module[_0x26b1('0x1')]={'type':{'type':Sequelize[_0x26b1('0x2')](_0x26b1('0x3'),_0x26b1('0x4'))},'result':{'type':Sequelize[_0x26b1('0x5')]},'transfererchannel':{'type':Sequelize[_0x26b1('0x5')]},'transferercalleridnum':{'type':Sequelize[_0x26b1('0x5')]},'transferercalleridname':{'type':Sequelize[_0x26b1('0x5')]},'transfererconnectedlinenum':{'type':Sequelize[_0x26b1('0x5')]},'transfererconnectedlinename':{'type':Sequelize[_0x26b1('0x5')]},'transfereraccountcode':{'type':Sequelize['STRING']},'transferercontext':{'type':Sequelize['STRING']},'transfererexten':{'type':Sequelize['STRING']},'transfererlinkedid':{'type':Sequelize[_0x26b1('0x5')]},'transfereechannel':{'type':Sequelize[_0x26b1('0x5')]},'transfereecalleridnum':{'type':Sequelize['STRING']},'transfereecalleridname':{'type':Sequelize[_0x26b1('0x5')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x26b1('0x5')]},'transfereeconnectedlinename':{'type':Sequelize['STRING']},'transfereeaccountcode':{'type':Sequelize['STRING']},'transfereecontext':{'type':Sequelize['STRING']},'transfereeexten':{'type':Sequelize[_0x26b1('0x5')]},'transfereelinkedid':{'type':Sequelize['STRING']},'isexternal':{'type':Sequelize['ENUM'](_0x26b1('0x6'),'No')},'context':{'type':Sequelize[_0x26b1('0x5')]},'extension':{'type':Sequelize[_0x26b1('0x5')]}}; \ No newline at end of file +var _0xd7e2=['blind','attended','STRING','sequelize','moment','exports'];(function(_0x36b037,_0x2b234e){var _0x409194=function(_0xddc9dc){while(--_0xddc9dc){_0x36b037['push'](_0x36b037['shift']());}};_0x409194(++_0x2b234e);}(_0xd7e2,0xe1));var _0x2d7e=function(_0x2f7845,_0xf66c7b){_0x2f7845=_0x2f7845-0x0;var _0x5a5df4=_0xd7e2[_0x2f7845];return _0x5a5df4;};'use strict';var Sequelize=require(_0x2d7e('0x0'));var moment=require(_0x2d7e('0x1'));module[_0x2d7e('0x2')]={'type':{'type':Sequelize['ENUM'](_0x2d7e('0x3'),_0x2d7e('0x4'))},'result':{'type':Sequelize['STRING']},'transfererchannel':{'type':Sequelize[_0x2d7e('0x5')]},'transferercalleridnum':{'type':Sequelize['STRING']},'transferercalleridname':{'type':Sequelize[_0x2d7e('0x5')]},'transfererconnectedlinenum':{'type':Sequelize['STRING']},'transfererconnectedlinename':{'type':Sequelize[_0x2d7e('0x5')]},'transfereraccountcode':{'type':Sequelize['STRING']},'transferercontext':{'type':Sequelize[_0x2d7e('0x5')]},'transfererexten':{'type':Sequelize[_0x2d7e('0x5')]},'transfererlinkedid':{'type':Sequelize[_0x2d7e('0x5')]},'transfereechannel':{'type':Sequelize[_0x2d7e('0x5')]},'transfereecalleridnum':{'type':Sequelize[_0x2d7e('0x5')]},'transfereecalleridname':{'type':Sequelize['STRING']},'transfereeconnectedlinenum':{'type':Sequelize['STRING']},'transfereeconnectedlinename':{'type':Sequelize[_0x2d7e('0x5')]},'transfereeaccountcode':{'type':Sequelize[_0x2d7e('0x5')]},'transfereecontext':{'type':Sequelize['STRING']},'transfereeexten':{'type':Sequelize[_0x2d7e('0x5')]},'transfereelinkedid':{'type':Sequelize['STRING']},'isexternal':{'type':Sequelize['ENUM']('Yes','No')},'context':{'type':Sequelize[_0x2d7e('0x5')]},'extension':{'type':Sequelize[_0x2d7e('0x5')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index e30a4c3..2333117 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 _0x3845=['length','hasOwnProperty','nolimit','offset','sort','where','merge','type','VIRTUAL','filter','options','VoiceTransferReport','includeAll','include','findAll','rows','catch','params','create','update','body','find','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','set','apply','reject','save','destroy','then','error','stack','name','send','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields'];(function(_0x21549c,_0x6d64d1){var _0x426cbd=function(_0x323f5b){while(--_0x323f5b){_0x21549c['push'](_0x21549c['shift']());}};_0x426cbd(++_0x6d64d1);}(_0x3845,0x1eb));var _0x5384=function(_0x412a1e,_0x21fa5c){_0x412a1e=_0x412a1e-0x0;var _0x3f7c1a=_0x3845[_0x412a1e];return _0x3f7c1a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x5384('0x0'));var zipdir=require(_0x5384('0x1'));var jsonpatch=require(_0x5384('0x2'));var rp=require(_0x5384('0x3'));var moment=require(_0x5384('0x4'));var BPromise=require(_0x5384('0x5'));var Mustache=require(_0x5384('0x6'));var util=require(_0x5384('0x7'));var path=require(_0x5384('0x8'));var sox=require(_0x5384('0x9'));var csv=require(_0x5384('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5384('0xb'));var _=require('lodash');var squel=require(_0x5384('0xc'));var crypto=require(_0x5384('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x5384('0xe'));var toCsv=require(_0x5384('0xa'));var querystring=require(_0x5384('0xf'));var Papa=require(_0x5384('0x10'));var Redis=require(_0x5384('0x11'));var authService=require(_0x5384('0x12'));var qs=require(_0x5384('0x13'));var as=require(_0x5384('0x14'));var hardwareService=require(_0x5384('0x15'));var logger=require(_0x5384('0x16'))(_0x5384('0x17'));var utils=require(_0x5384('0x18'));var config=require(_0x5384('0x19'));var licenseUtil=require(_0x5384('0x1a'));var db=require(_0x5384('0x1b'))['db'];function respondWithStatusCode(_0x394575,_0x3bbdea){_0x3bbdea=_0x3bbdea||0xcc;return function(_0x17b575){if(_0x17b575){return _0x394575[_0x5384('0x1c')](_0x3bbdea);}return _0x394575[_0x5384('0x1d')](_0x3bbdea)[_0x5384('0x1e')]();};}function respondWithResult(_0x527f96,_0x303395){_0x303395=_0x303395||0xc8;return function(_0x44d2c9){if(_0x44d2c9){return _0x527f96[_0x5384('0x1d')](_0x303395)['json'](_0x44d2c9);}};}function respondWithFilteredResult(_0x4ec800,_0x2fb260){return function(_0x8b644b){if(_0x8b644b){var _0x893fef=typeof _0x2fb260['offset']===_0x5384('0x1f')&&typeof _0x2fb260[_0x5384('0x20')]===_0x5384('0x1f');var _0x1f7b8d=_0x8b644b['count'];var _0x39eec2=_0x893fef?0x0:_0x2fb260['offset'];var _0x25546f=_0x893fef?_0x8b644b[_0x5384('0x21')]:_0x2fb260['offset']+_0x2fb260['limit'];var _0x197b2b;if(_0x25546f>=_0x1f7b8d){_0x25546f=_0x1f7b8d;_0x197b2b=0xc8;}else{_0x197b2b=0xce;}_0x4ec800[_0x5384('0x1d')](_0x197b2b);return _0x4ec800[_0x5384('0x22')]('Content-Range',_0x39eec2+'-'+_0x25546f+'/'+_0x1f7b8d)['json'](_0x8b644b);}return null;};}function patchUpdates(_0x16f9c5){return function(_0x46c2da){try{jsonpatch[_0x5384('0x23')](_0x46c2da,_0x16f9c5,!![]);}catch(_0x1d707d){return BPromise[_0x5384('0x24')](_0x1d707d);}return _0x46c2da[_0x5384('0x25')]();};}function saveUpdates(_0x17d7d8,_0x5a3798){return function(_0x40a015){if(_0x40a015){return _0x40a015['update'](_0x17d7d8)['then'](function(_0x426243){return _0x426243;});}return null;};}function removeEntity(_0x244b30,_0x120e4c){return function(_0x546583){if(_0x546583){return _0x546583[_0x5384('0x26')]()[_0x5384('0x27')](function(){_0x244b30['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x45ec02,_0x31ee23){return function(_0x587da2){if(!_0x587da2){_0x45ec02[_0x5384('0x1c')](0x194);}return _0x587da2;};}function handleError(_0x165530,_0x2d35d2){_0x2d35d2=_0x2d35d2||0x1f4;return function(_0x32438c){logger[_0x5384('0x28')](_0x32438c[_0x5384('0x29')]);if(_0x32438c[_0x5384('0x2a')]){delete _0x32438c[_0x5384('0x2a')];}_0x165530['status'](_0x2d35d2)[_0x5384('0x2b')](_0x32438c);};}exports['index']=function(_0x34daf7,_0xa7c870){var _0x53a345={},_0x246220={},_0x55fdc8={'count':0x0,'rows':[]};var _0x5607c1=_[_0x5384('0x2c')](db['VoiceTransferReport'][_0x5384('0x2d')],function(_0x2a9988){return{'name':_0x2a9988[_0x5384('0x2e')],'type':_0x2a9988['type'][_0x5384('0x2f')]};});_0x246220[_0x5384('0x30')]=_[_0x5384('0x2c')](_0x5607c1,'name');_0x246220[_0x5384('0x31')]=_[_0x5384('0x32')](_0x34daf7['query']);_0x246220[_0x5384('0x33')]=_[_0x5384('0x34')](_0x246220['model'],_0x246220[_0x5384('0x31')]);_0x53a345[_0x5384('0x35')]=_['intersection'](_0x246220[_0x5384('0x30')],qs[_0x5384('0x36')](_0x34daf7[_0x5384('0x31')][_0x5384('0x36')]));_0x53a345[_0x5384('0x35')]=_0x53a345[_0x5384('0x35')][_0x5384('0x37')]?_0x53a345[_0x5384('0x35')]:_0x246220[_0x5384('0x30')];if(!_0x34daf7[_0x5384('0x31')][_0x5384('0x38')](_0x5384('0x39'))){_0x53a345[_0x5384('0x20')]=qs[_0x5384('0x20')](_0x34daf7[_0x5384('0x31')][_0x5384('0x20')]);_0x53a345[_0x5384('0x3a')]=qs[_0x5384('0x3a')](_0x34daf7['query']['offset']);}_0x53a345['order']=qs['sort'](_0x34daf7[_0x5384('0x31')][_0x5384('0x3b')]);_0x53a345['where']=qs[_0x5384('0x33')](_['pick'](_0x34daf7['query'],_0x246220[_0x5384('0x33')]),_0x5607c1);if(_0x34daf7[_0x5384('0x31')]['filter']){_0x53a345[_0x5384('0x3c')]=_[_0x5384('0x3d')](_0x53a345['where'],{'$or':_[_0x5384('0x2c')](_0x5607c1,function(_0x29431d){if(_0x29431d[_0x5384('0x3e')]!==_0x5384('0x3f')){var _0x84035e={};_0x84035e[_0x29431d[_0x5384('0x2a')]]={'$like':'%'+_0x34daf7['query'][_0x5384('0x40')]+'%'};return _0x84035e;}})});}_0x53a345=_[_0x5384('0x3d')]({},_0x53a345,_0x34daf7[_0x5384('0x41')]);var _0x4e3ae4={'where':_0x53a345[_0x5384('0x3c')]};return db[_0x5384('0x42')]['count'](_0x4e3ae4)['then'](function(_0x5a35af){_0x55fdc8[_0x5384('0x21')]=_0x5a35af;if(_0x34daf7[_0x5384('0x31')][_0x5384('0x43')]){_0x53a345[_0x5384('0x44')]=[{'all':!![]}];}return db[_0x5384('0x42')][_0x5384('0x45')](_0x53a345);})['then'](function(_0x5094f2){_0x55fdc8[_0x5384('0x46')]=_0x5094f2;return _0x55fdc8;})['then'](respondWithFilteredResult(_0xa7c870,_0x53a345))[_0x5384('0x47')](handleError(_0xa7c870,null));};exports['show']=function(_0x3803e1,_0x410c80){var _0x11540c={'raw':!![],'where':{'id':_0x3803e1[_0x5384('0x48')]['id']}},_0x3c217d={};_0x3c217d['model']=_[_0x5384('0x32')](db[_0x5384('0x42')][_0x5384('0x2d')]);_0x3c217d['query']=_[_0x5384('0x32')](_0x3803e1[_0x5384('0x31')]);_0x3c217d[_0x5384('0x33')]=_[_0x5384('0x34')](_0x3c217d['model'],_0x3c217d['query']);_0x11540c[_0x5384('0x35')]=_['intersection'](_0x3c217d[_0x5384('0x30')],qs[_0x5384('0x36')](_0x3803e1[_0x5384('0x31')][_0x5384('0x36')]));_0x11540c['attributes']=_0x11540c['attributes'][_0x5384('0x37')]?_0x11540c['attributes']:_0x3c217d[_0x5384('0x30')];if(_0x3803e1[_0x5384('0x31')][_0x5384('0x43')]){_0x11540c[_0x5384('0x44')]=[{'all':!![]}];}_0x11540c=_['merge']({},_0x11540c,_0x3803e1[_0x5384('0x41')]);return db[_0x5384('0x42')]['find'](_0x11540c)[_0x5384('0x27')](handleEntityNotFound(_0x410c80,null))[_0x5384('0x27')](respondWithResult(_0x410c80,null))[_0x5384('0x47')](handleError(_0x410c80,null));};exports[_0x5384('0x49')]=function(_0x3e7128,_0x3d7bcd){return db['VoiceTransferReport']['create'](_0x3e7128['body'],{})['then'](respondWithResult(_0x3d7bcd,0xc9))[_0x5384('0x47')](handleError(_0x3d7bcd,null));};exports[_0x5384('0x4a')]=function(_0x19511f,_0x14a9e4){if(_0x19511f[_0x5384('0x4b')]['id']){delete _0x19511f[_0x5384('0x4b')]['id'];}return db[_0x5384('0x42')][_0x5384('0x4c')]({'where':{'id':_0x19511f[_0x5384('0x48')]['id']}})['then'](handleEntityNotFound(_0x14a9e4,null))[_0x5384('0x27')](saveUpdates(_0x19511f[_0x5384('0x4b')],null))[_0x5384('0x27')](respondWithResult(_0x14a9e4,null))[_0x5384('0x47')](handleError(_0x14a9e4,null));};exports[_0x5384('0x26')]=function(_0x4930fe,_0x145f40){return db['VoiceTransferReport']['find']({'where':{'id':_0x4930fe[_0x5384('0x48')]['id']}})[_0x5384('0x27')](handleEntityNotFound(_0x145f40,null))[_0x5384('0x27')](removeEntity(_0x145f40,null))['catch'](handleError(_0x145f40,null));};exports[_0x5384('0x4d')]=function(_0x17b248,_0x4506b0){return db[_0x5384('0x42')][_0x5384('0x4d')]()[_0x5384('0x27')](respondWithResult(_0x4506b0,null))[_0x5384('0x47')](handleError(_0x4506b0,null));}; \ No newline at end of file +var _0xc313=['VoiceTransferReport','rawAttributes','type','key','model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','VIRTUAL','filter','includeAll','include','findAll','rows','show','params','keys','options','find','catch','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','stack','name','index'];(function(_0x3c4a85,_0x5f24e0){var _0x3c6faa=function(_0x5b17d1){while(--_0x5b17d1){_0x3c4a85['push'](_0x3c4a85['shift']());}};_0x3c6faa(++_0x5f24e0);}(_0xc313,0xbf));var _0x3c31=function(_0x587d88,_0x5ab5b6){_0x587d88=_0x587d88-0x0;var _0x4c1ae4=_0xc313[_0x587d88];return _0x4c1ae4;};'use strict';var emlformat=require(_0x3c31('0x0'));var rimraf=require(_0x3c31('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3c31('0x2'));var rp=require(_0x3c31('0x3'));var moment=require(_0x3c31('0x4'));var BPromise=require(_0x3c31('0x5'));var Mustache=require(_0x3c31('0x6'));var util=require('util');var path=require(_0x3c31('0x7'));var sox=require(_0x3c31('0x8'));var csv=require('to-csv');var ejs=require(_0x3c31('0x9'));var fs=require('fs');var fs_extra=require(_0x3c31('0xa'));var _=require(_0x3c31('0xb'));var squel=require(_0x3c31('0xc'));var crypto=require(_0x3c31('0xd'));var jsforce=require(_0x3c31('0xe'));var deskjs=require(_0x3c31('0xf'));var toCsv=require('to-csv');var querystring=require(_0x3c31('0x10'));var Papa=require(_0x3c31('0x11'));var Redis=require(_0x3c31('0x12'));var authService=require(_0x3c31('0x13'));var qs=require(_0x3c31('0x14'));var as=require(_0x3c31('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3c31('0x16'))(_0x3c31('0x17'));var utils=require('../../config/utils');var config=require(_0x3c31('0x18'));var licenseUtil=require(_0x3c31('0x19'));var db=require(_0x3c31('0x1a'))['db'];function respondWithStatusCode(_0x47ff07,_0x4c617a){_0x4c617a=_0x4c617a||0xcc;return function(_0x5e2be7){if(_0x5e2be7){return _0x47ff07[_0x3c31('0x1b')](_0x4c617a);}return _0x47ff07[_0x3c31('0x1c')](_0x4c617a)['end']();};}function respondWithResult(_0x1eb55b,_0x4f4bc2){_0x4f4bc2=_0x4f4bc2||0xc8;return function(_0x5dbb2e){if(_0x5dbb2e){return _0x1eb55b[_0x3c31('0x1c')](_0x4f4bc2)[_0x3c31('0x1d')](_0x5dbb2e);}};}function respondWithFilteredResult(_0x53db5a,_0x2fc4e7){return function(_0x299aef){if(_0x299aef){var _0x5c228e=typeof _0x2fc4e7['offset']===_0x3c31('0x1e')&&typeof _0x2fc4e7[_0x3c31('0x1f')]===_0x3c31('0x1e');var _0xdd903d=_0x299aef['count'];var _0xb0cb27=_0x5c228e?0x0:_0x2fc4e7['offset'];var _0x40554d=_0x5c228e?_0x299aef[_0x3c31('0x20')]:_0x2fc4e7[_0x3c31('0x21')]+_0x2fc4e7[_0x3c31('0x1f')];var _0x4fc59f;if(_0x40554d>=_0xdd903d){_0x40554d=_0xdd903d;_0x4fc59f=0xc8;}else{_0x4fc59f=0xce;}_0x53db5a[_0x3c31('0x1c')](_0x4fc59f);return _0x53db5a[_0x3c31('0x22')](_0x3c31('0x23'),_0xb0cb27+'-'+_0x40554d+'/'+_0xdd903d)['json'](_0x299aef);}return null;};}function patchUpdates(_0x3a9015){return function(_0x5e1b43){try{jsonpatch[_0x3c31('0x24')](_0x5e1b43,_0x3a9015,!![]);}catch(_0x24adc1){return BPromise[_0x3c31('0x25')](_0x24adc1);}return _0x5e1b43[_0x3c31('0x26')]();};}function saveUpdates(_0x58eb19,_0x3365d5){return function(_0x3dec4e){if(_0x3dec4e){return _0x3dec4e[_0x3c31('0x27')](_0x58eb19)[_0x3c31('0x28')](function(_0x12190f){return _0x12190f;});}return null;};}function removeEntity(_0xc8b185,_0x59c96f){return function(_0x3dae1b){if(_0x3dae1b){return _0x3dae1b[_0x3c31('0x29')]()[_0x3c31('0x28')](function(){_0xc8b185[_0x3c31('0x1c')](0xcc)[_0x3c31('0x2a')]();});}};}function handleEntityNotFound(_0xe8c779,_0x45a7ae){return function(_0x29fea1){if(!_0x29fea1){_0xe8c779['sendStatus'](0x194);}return _0x29fea1;};}function handleError(_0x4c0222,_0x4b21bc){_0x4b21bc=_0x4b21bc||0x1f4;return function(_0x102fdd){logger['error'](_0x102fdd[_0x3c31('0x2b')]);if(_0x102fdd[_0x3c31('0x2c')]){delete _0x102fdd[_0x3c31('0x2c')];}_0x4c0222[_0x3c31('0x1c')](_0x4b21bc)['send'](_0x102fdd);};}exports[_0x3c31('0x2d')]=function(_0x211cb3,_0x5e8f62){var _0x4c6af1={},_0x33fec6={},_0x568003={'count':0x0,'rows':[]};var _0x5adb77=_['map'](db[_0x3c31('0x2e')][_0x3c31('0x2f')],function(_0x4a5751){return{'name':_0x4a5751['fieldName'],'type':_0x4a5751[_0x3c31('0x30')][_0x3c31('0x31')]};});_0x33fec6[_0x3c31('0x32')]=_['map'](_0x5adb77,'name');_0x33fec6[_0x3c31('0x33')]=_['keys'](_0x211cb3['query']);_0x33fec6[_0x3c31('0x34')]=_['intersection'](_0x33fec6[_0x3c31('0x32')],_0x33fec6[_0x3c31('0x33')]);_0x4c6af1[_0x3c31('0x35')]=_[_0x3c31('0x36')](_0x33fec6[_0x3c31('0x32')],qs['fields'](_0x211cb3[_0x3c31('0x33')][_0x3c31('0x37')]));_0x4c6af1[_0x3c31('0x35')]=_0x4c6af1[_0x3c31('0x35')]['length']?_0x4c6af1['attributes']:_0x33fec6['model'];if(!_0x211cb3[_0x3c31('0x33')][_0x3c31('0x38')](_0x3c31('0x39'))){_0x4c6af1[_0x3c31('0x1f')]=qs[_0x3c31('0x1f')](_0x211cb3['query']['limit']);_0x4c6af1['offset']=qs['offset'](_0x211cb3[_0x3c31('0x33')][_0x3c31('0x21')]);}_0x4c6af1[_0x3c31('0x3a')]=qs[_0x3c31('0x3b')](_0x211cb3['query'][_0x3c31('0x3b')]);_0x4c6af1[_0x3c31('0x3c')]=qs['filters'](_[_0x3c31('0x3d')](_0x211cb3[_0x3c31('0x33')],_0x33fec6[_0x3c31('0x34')]),_0x5adb77);if(_0x211cb3[_0x3c31('0x33')]['filter']){_0x4c6af1[_0x3c31('0x3c')]=_[_0x3c31('0x3e')](_0x4c6af1[_0x3c31('0x3c')],{'$or':_[_0x3c31('0x3f')](_0x5adb77,function(_0x9d56d8){if(_0x9d56d8[_0x3c31('0x30')]!==_0x3c31('0x40')){var _0x120412={};_0x120412[_0x9d56d8[_0x3c31('0x2c')]]={'$like':'%'+_0x211cb3[_0x3c31('0x33')][_0x3c31('0x41')]+'%'};return _0x120412;}})});}_0x4c6af1=_[_0x3c31('0x3e')]({},_0x4c6af1,_0x211cb3['options']);var _0x28db84={'where':_0x4c6af1[_0x3c31('0x3c')]};return db[_0x3c31('0x2e')]['count'](_0x28db84)[_0x3c31('0x28')](function(_0x89779b){_0x568003[_0x3c31('0x20')]=_0x89779b;if(_0x211cb3[_0x3c31('0x33')][_0x3c31('0x42')]){_0x4c6af1[_0x3c31('0x43')]=[{'all':!![]}];}return db[_0x3c31('0x2e')][_0x3c31('0x44')](_0x4c6af1);})['then'](function(_0x26bcb8){_0x568003[_0x3c31('0x45')]=_0x26bcb8;return _0x568003;})['then'](respondWithFilteredResult(_0x5e8f62,_0x4c6af1))['catch'](handleError(_0x5e8f62,null));};exports[_0x3c31('0x46')]=function(_0x3de48a,_0x214658){var _0x5d514f={'raw':!![],'where':{'id':_0x3de48a[_0x3c31('0x47')]['id']}},_0x1d6e8d={};_0x1d6e8d[_0x3c31('0x32')]=_[_0x3c31('0x48')](db[_0x3c31('0x2e')][_0x3c31('0x2f')]);_0x1d6e8d['query']=_[_0x3c31('0x48')](_0x3de48a[_0x3c31('0x33')]);_0x1d6e8d[_0x3c31('0x34')]=_['intersection'](_0x1d6e8d[_0x3c31('0x32')],_0x1d6e8d[_0x3c31('0x33')]);_0x5d514f[_0x3c31('0x35')]=_['intersection'](_0x1d6e8d[_0x3c31('0x32')],qs[_0x3c31('0x37')](_0x3de48a[_0x3c31('0x33')][_0x3c31('0x37')]));_0x5d514f['attributes']=_0x5d514f[_0x3c31('0x35')]['length']?_0x5d514f[_0x3c31('0x35')]:_0x1d6e8d[_0x3c31('0x32')];if(_0x3de48a[_0x3c31('0x33')][_0x3c31('0x42')]){_0x5d514f[_0x3c31('0x43')]=[{'all':!![]}];}_0x5d514f=_[_0x3c31('0x3e')]({},_0x5d514f,_0x3de48a[_0x3c31('0x49')]);return db[_0x3c31('0x2e')][_0x3c31('0x4a')](_0x5d514f)[_0x3c31('0x28')](handleEntityNotFound(_0x214658,null))[_0x3c31('0x28')](respondWithResult(_0x214658,null))[_0x3c31('0x4b')](handleError(_0x214658,null));};exports[_0x3c31('0x4c')]=function(_0x1d1650,_0x66e30f){return db[_0x3c31('0x2e')][_0x3c31('0x4c')](_0x1d1650['body'],{})[_0x3c31('0x28')](respondWithResult(_0x66e30f,0xc9))[_0x3c31('0x4b')](handleError(_0x66e30f,null));};exports['update']=function(_0x5518f5,_0x1c3463){if(_0x5518f5['body']['id']){delete _0x5518f5[_0x3c31('0x4d')]['id'];}return db[_0x3c31('0x2e')]['find']({'where':{'id':_0x5518f5[_0x3c31('0x47')]['id']}})['then'](handleEntityNotFound(_0x1c3463,null))[_0x3c31('0x28')](saveUpdates(_0x5518f5[_0x3c31('0x4d')],null))[_0x3c31('0x28')](respondWithResult(_0x1c3463,null))[_0x3c31('0x4b')](handleError(_0x1c3463,null));};exports['destroy']=function(_0x3bae02,_0x5bff5e){return db[_0x3c31('0x2e')][_0x3c31('0x4a')]({'where':{'id':_0x3bae02[_0x3c31('0x47')]['id']}})[_0x3c31('0x28')](handleEntityNotFound(_0x5bff5e,null))[_0x3c31('0x28')](removeEntity(_0x5bff5e,null))[_0x3c31('0x4b')](handleError(_0x5bff5e,null));};exports[_0x3c31('0x4e')]=function(_0x3ee56c,_0x1a7254){return db[_0x3c31('0x2e')][_0x3c31('0x4e')]()[_0x3c31('0x28')](respondWithResult(_0x1a7254,null))[_0x3c31('0x4b')](handleError(_0x1a7254,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index 3d6f1fc..64a4942 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 _0xa77a=['../../config/environment','./voiceTransferReport.attributes','exports','define','VoiceTransferReport','report_call_transfer','lodash','moment','bluebird','rimraf'];(function(_0x473738,_0x15ea31){var _0x1df4ae=function(_0x417a72){while(--_0x417a72){_0x473738['push'](_0x473738['shift']());}};_0x1df4ae(++_0x15ea31);}(_0xa77a,0x18c));var _0xaa77=function(_0x3e961c,_0x5747e7){_0x3e961c=_0x3e961c-0x0;var _0x474f9c=_0xa77a[_0x3e961c];return _0x474f9c;};'use strict';var _=require(_0xaa77('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xaa77('0x1'));var BPromise=require(_0xaa77('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xaa77('0x3'));var config=require(_0xaa77('0x4'));var attributes=require(_0xaa77('0x5'));module[_0xaa77('0x6')]=function(_0x539101,_0x533bed){return _0x539101[_0xaa77('0x7')](_0xaa77('0x8'),attributes,{'tableName':_0xaa77('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9fce=['define','report_call_transfer','lodash','util','moment','bluebird','request-promise','path','./voiceTransferReport.attributes','exports'];(function(_0x1dbfbf,_0x41e653){var _0x509b85=function(_0x27f0c9){while(--_0x27f0c9){_0x1dbfbf['push'](_0x1dbfbf['shift']());}};_0x509b85(++_0x41e653);}(_0x9fce,0x1c4));var _0xe9fc=function(_0x439d59,_0x11ccdf){_0x439d59=_0x439d59-0x0;var _0x3670c7=_0x9fce[_0x439d59];return _0x3670c7;};'use strict';var _=require(_0xe9fc('0x0'));var util=require(_0xe9fc('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xe9fc('0x2'));var BPromise=require(_0xe9fc('0x3'));var rp=require(_0xe9fc('0x4'));var fs=require('fs');var path=require(_0xe9fc('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xe9fc('0x6'));module[_0xe9fc('0x7')]=function(_0x23a694,_0x316554){return _0x23a694[_0xe9fc('0x8')]('VoiceTransferReport',attributes,{'tableName':_0xe9fc('0x9'),'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 200a562..00d9ba4 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 _0xd1b4=['VoiceTransferReport','create','body','options','raw','CreateVoiceTransferReport','stringify','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','error','message','result','catch'];(function(_0x288d33,_0x58ee36){var _0x1033bd=function(_0x2e22f1){while(--_0x2e22f1){_0x288d33['push'](_0x288d33['shift']());}};_0x1033bd(++_0x58ee36);}(_0xd1b4,0x98));var _0x4d1b=function(_0x30568e,_0x2e4a0f){_0x30568e=_0x30568e-0x0;var _0x1510cd=_0xd1b4[_0x30568e];return _0x1510cd;};'use strict';var _=require(_0x4d1b('0x0'));var util=require(_0x4d1b('0x1'));var moment=require(_0x4d1b('0x2'));var BPromise=require('bluebird');var rs=require(_0x4d1b('0x3'));var fs=require('fs');var Redis=require(_0x4d1b('0x4'));var db=require(_0x4d1b('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x4d1b('0x6'))(_0x4d1b('0x7'));var config=require(_0x4d1b('0x8'));var jayson=require(_0x4d1b('0x9'));var client=jayson['client'][_0x4d1b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2cb31d,_0x669cda,_0x22616f){return new BPromise(function(_0xa1b8c8,_0x3a5d13){return client[_0x4d1b('0xb')](_0x2cb31d,_0x22616f)[_0x4d1b('0xc')](function(_0x58b72c){logger[_0x4d1b('0xd')](_0x4d1b('0xe'),_0x669cda,_0x4d1b('0xf'));logger[_0x4d1b('0x10')](_0x4d1b('0x11'),_0x669cda,_0x4d1b('0xf'),JSON['stringify'](_0x58b72c));if(_0x58b72c[_0x4d1b('0x12')]){if(_0x58b72c[_0x4d1b('0x12')]['code']===0x1f4){logger[_0x4d1b('0x12')](_0x4d1b('0xe'),_0x669cda,_0x58b72c['error'][_0x4d1b('0x13')]);return _0x3a5d13(_0x58b72c[_0x4d1b('0x12')][_0x4d1b('0x13')]);}logger[_0x4d1b('0x12')](_0x4d1b('0xe'),_0x669cda,_0x58b72c['error'][_0x4d1b('0x13')]);return _0xa1b8c8(_0x58b72c['error']['message']);}else{logger[_0x4d1b('0xd')](_0x4d1b('0xe'),_0x669cda,'request\x20sent');_0xa1b8c8(_0x58b72c[_0x4d1b('0x14')][_0x4d1b('0x13')]);}})[_0x4d1b('0x15')](function(_0x34a8e4){logger[_0x4d1b('0x12')](_0x4d1b('0xe'),_0x669cda,_0x34a8e4);_0x3a5d13(_0x34a8e4);});});}exports['CreateVoiceTransferReport']=function(_0x2f08bc){var _0x104aca=this;return new Promise(function(_0x5b0837,_0x52e419){return db[_0x4d1b('0x16')][_0x4d1b('0x17')](_0x2f08bc[_0x4d1b('0x18')],{'raw':_0x2f08bc[_0x4d1b('0x19')]?_0x2f08bc[_0x4d1b('0x19')][_0x4d1b('0x1a')]===undefined?!![]:![]:!![]})[_0x4d1b('0xc')](function(_0x47eb36){logger['info'](_0x4d1b('0x1b'),_0x2f08bc);logger['debug'](_0x4d1b('0x1b'),_0x2f08bc,JSON[_0x4d1b('0x1c')](_0x47eb36));_0x5b0837(_0x47eb36);})[_0x4d1b('0x15')](function(_0x269fff){logger['error'](_0x4d1b('0x1b'),_0x269fff[_0x4d1b('0x13')],_0x2f08bc);_0x52e419(_0x104aca[_0x4d1b('0x12')](0x1f4,_0x269fff[_0x4d1b('0x13')]));});});}; \ No newline at end of file +var _0x9db0=['request\x20sent','debug','stringify','error','code','message','result','catch','VoiceTransferReport,\x20%s,\x20%s','VoiceTransferReport','create','body','options','raw','CreateVoiceTransferReport','lodash','util','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x59befa,_0x4af99b){var _0x1dd63d=function(_0x4c1df4){while(--_0x4c1df4){_0x59befa['push'](_0x59befa['shift']());}};_0x1dd63d(++_0x4af99b);}(_0x9db0,0x96));var _0x09db=function(_0x2ff413,_0x193f98){_0x2ff413=_0x2ff413-0x0;var _0x3bc26b=_0x9db0[_0x2ff413];return _0x3bc26b;};'use strict';var _=require(_0x09db('0x0'));var util=require(_0x09db('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x09db('0x2'))['db'];var utils=require(_0x09db('0x3'));var logger=require(_0x09db('0x4'))('rpc');var config=require(_0x09db('0x5'));var jayson=require(_0x09db('0x6'));var client=jayson[_0x09db('0x7')][_0x09db('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xd37f35,_0x2578a2,_0x42722f){return new BPromise(function(_0x47ad18,_0x2037d0){return client[_0x09db('0x9')](_0xd37f35,_0x42722f)[_0x09db('0xa')](function(_0x1ca9c1){logger[_0x09db('0xb')]('VoiceTransferReport,\x20%s,\x20%s',_0x2578a2,_0x09db('0xc'));logger[_0x09db('0xd')]('VoiceTransferReport,\x20%s,\x20%s,\x20%s',_0x2578a2,_0x09db('0xc'),JSON[_0x09db('0xe')](_0x1ca9c1));if(_0x1ca9c1[_0x09db('0xf')]){if(_0x1ca9c1[_0x09db('0xf')][_0x09db('0x10')]===0x1f4){logger[_0x09db('0xf')]('VoiceTransferReport,\x20%s,\x20%s',_0x2578a2,_0x1ca9c1[_0x09db('0xf')][_0x09db('0x11')]);return _0x2037d0(_0x1ca9c1[_0x09db('0xf')][_0x09db('0x11')]);}logger[_0x09db('0xf')]('VoiceTransferReport,\x20%s,\x20%s',_0x2578a2,_0x1ca9c1[_0x09db('0xf')]['message']);return _0x47ad18(_0x1ca9c1[_0x09db('0xf')][_0x09db('0x11')]);}else{logger[_0x09db('0xb')]('VoiceTransferReport,\x20%s,\x20%s',_0x2578a2,_0x09db('0xc'));_0x47ad18(_0x1ca9c1[_0x09db('0x12')][_0x09db('0x11')]);}})[_0x09db('0x13')](function(_0x314488){logger[_0x09db('0xf')](_0x09db('0x14'),_0x2578a2,_0x314488);_0x2037d0(_0x314488);});});}exports['CreateVoiceTransferReport']=function(_0x559b66){var _0x1b0d67=this;return new Promise(function(_0x25e88b,_0x4f4f27){return db[_0x09db('0x15')][_0x09db('0x16')](_0x559b66[_0x09db('0x17')],{'raw':_0x559b66['options']?_0x559b66[_0x09db('0x18')][_0x09db('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x4c005e){logger[_0x09db('0xb')](_0x09db('0x1a'),_0x559b66);logger[_0x09db('0xd')]('CreateVoiceTransferReport',_0x559b66,JSON[_0x09db('0xe')](_0x4c005e));_0x25e88b(_0x4c005e);})[_0x09db('0x13')](function(_0x5b6963){logger[_0x09db('0xf')]('CreateVoiceTransferReport',_0x5b6963['message'],_0x559b66);_0x4f4f27(_0x1b0d67[_0x09db('0xf')](0x1f4,_0x5b6963[_0x09db('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/webbar/index.js b/server/api/webbar/index.js index 2588539..1173ab8 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 _0x1373=['hangup','/answer','answer','/hold','hold','/unhold','unhold','/calls','calls','/transfer','exports','./webbar.controller','post','/originate','isAuthenticated','canUpdate','originate','/hangup'];(function(_0x497b1e,_0x586379){var _0x3f72e1=function(_0x4c227d){while(--_0x4c227d){_0x497b1e['push'](_0x497b1e['shift']());}};_0x3f72e1(++_0x586379);}(_0x1373,0x77));var _0x3137=function(_0x43a4b5,_0xa3e9bc){_0x43a4b5=_0x43a4b5-0x0;var _0x54ab5e=_0x1373[_0x43a4b5];return _0x54ab5e;};'use strict';var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var controller=require(_0x3137('0x0'));router[_0x3137('0x1')](_0x3137('0x2'),auth[_0x3137('0x3')](),auth[_0x3137('0x4')](),controller[_0x3137('0x5')]);router[_0x3137('0x1')](_0x3137('0x6'),auth[_0x3137('0x3')](),auth[_0x3137('0x4')](),controller[_0x3137('0x7')]);router[_0x3137('0x1')](_0x3137('0x8'),auth[_0x3137('0x3')](),auth[_0x3137('0x4')](),controller[_0x3137('0x9')]);router['post'](_0x3137('0xa'),auth[_0x3137('0x3')](),auth[_0x3137('0x4')](),controller[_0x3137('0xb')]);router[_0x3137('0x1')](_0x3137('0xc'),auth[_0x3137('0x3')](),auth[_0x3137('0x4')](),controller[_0x3137('0xd')]);router[_0x3137('0x1')](_0x3137('0xe'),auth[_0x3137('0x3')](),auth[_0x3137('0x4')](),controller[_0x3137('0xf')]);router[_0x3137('0x1')](_0x3137('0x10'),auth[_0x3137('0x3')](),auth['canUpdate'](),controller['transfer']);module[_0x3137('0x11')]=router; \ No newline at end of file +var _0xab8e=['express','../../components/auth/service','./webbar.controller','/originate','isAuthenticated','originate','post','/hangup','canUpdate','hangup','/hold','hold','unhold','/calls','calls','/transfer','transfer'];(function(_0x5678b5,_0x1c4aa8){var _0x4c09a5=function(_0x2aa89a){while(--_0x2aa89a){_0x5678b5['push'](_0x5678b5['shift']());}};_0x4c09a5(++_0x1c4aa8);}(_0xab8e,0x1cb));var _0xeab8=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0xab8e[_0x5bd426];return _0x23a7eb;};'use strict';var express=require(_0xeab8('0x0'));var router=express['Router']();var auth=require(_0xeab8('0x1'));var controller=require(_0xeab8('0x2'));router['post'](_0xeab8('0x3'),auth[_0xeab8('0x4')](),auth['canUpdate'](),controller[_0xeab8('0x5')]);router[_0xeab8('0x6')](_0xeab8('0x7'),auth[_0xeab8('0x4')](),auth[_0xeab8('0x8')](),controller[_0xeab8('0x9')]);router['post']('/answer',auth[_0xeab8('0x4')](),auth[_0xeab8('0x8')](),controller['answer']);router[_0xeab8('0x6')](_0xeab8('0xa'),auth[_0xeab8('0x4')](),auth[_0xeab8('0x8')](),controller[_0xeab8('0xb')]);router[_0xeab8('0x6')]('/unhold',auth[_0xeab8('0x4')](),auth[_0xeab8('0x8')](),controller[_0xeab8('0xc')]);router[_0xeab8('0x6')](_0xeab8('0xd'),auth[_0xeab8('0x4')](),auth[_0xeab8('0x8')](),controller[_0xeab8('0xe')]);router['post'](_0xeab8('0xf'),auth[_0xeab8('0x4')](),auth['canUpdate'](),controller[_0xeab8('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/webbar/webbar.controller.js b/server/api/webbar/webbar.controller.js index 59b9eb1..b07e3bb 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 _0x6308=['userId\x20is\x20required','transferNumber\x20is\x20required','stringify','emit','log','handleError:','error','stack','name','send','NotFound','request','then','code','message','result','User','findOne','agent','VoiceChannels','all','filter','rows','UserId','length','sessionId\x20','\x20not\x20found!','originate','originate\x20fired:','body','status','json','callNumber','callerId','callbackUrl','info','entityFound:','format','user:%s','hangup','hangup\x20fired:','userId','sessionId','webbar:hangup','catch','answer\x20fired:','webbar:answer','hold','webbar:hold','hold\x20executed!','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls\x20fired:','webbar:conference','conference\x20executed!','transfer\x20fired:','transferNumber','webbar:transfer','transfer\x20executed!','path','../../mysqldb','bluebird','jayson/promise','client','http','../../config/logger','redis','localhost','socket.io-emitter','validate','number','string'];(function(_0x38855d,_0x11ab20){var _0x4f2a29=function(_0x4db53d){while(--_0x4db53d){_0x38855d['push'](_0x38855d['shift']());}};_0x4f2a29(++_0x11ab20);}(_0x6308,0x1f2));var _0x8630=function(_0x474bc0,_0x26989c){_0x474bc0=_0x474bc0-0x0;var _0x4b24cf=_0x6308[_0x474bc0];return _0x4b24cf;};'use strict';var path=require(_0x8630('0x0'));var fs=require('fs');var _=require('lodash');var db=require(_0x8630('0x1'))['db'];var config=require('../../config/environment');var util=require('util');var BPromise=require(_0x8630('0x2'));var jayson=require(_0x8630('0x3'));var amiClient=jayson[_0x8630('0x4')][_0x8630('0x5')]({'port':0x232a});var logger=require(_0x8630('0x6'))('webbarapi');var Redis=require('ioredis');config[_0x8630('0x7')]=_['defaults'](config[_0x8630('0x7')],{'host':_0x8630('0x8'),'port':0x18eb});var io=require(_0x8630('0x9'))(new Redis(config[_0x8630('0x7')]));var Schema=require(_0x8630('0xa'));var originateValidation=new Schema({'userId':{'type':_0x8630('0xb'),'required':[!![],'userId\x20is\x20required']},'callNumber':{'type':_0x8630('0xc'),'required':[!![],'callNumber\x20is\x20required']},'callerId':{'type':_0x8630('0xc')},'callbackUrl':{'type':_0x8630('0xc')}});var hangupValidation=new Schema({'userId':{'type':_0x8630('0xb'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x8630('0xc'),'required':![]}});var answerValidation=new Schema({'userId':{'type':_0x8630('0xb'),'required':[!![],_0x8630('0xd')]},'sessionId':{'type':'string','required':![]}});var transferValidation=new Schema({'userId':{'type':_0x8630('0xb'),'required':[!![],_0x8630('0xd')]},'sessionId':{'type':'string','required':[!![],'sessionId\x20is\x20required']},'transferNumber':{'type':_0x8630('0xc'),'required':[!![],_0x8630('0xe')]}});var holdValidation=new Schema({'userId':{'type':'number','required':[!![],_0x8630('0xd')]},'sessionId':{'type':'string','required':![]}});var unholdValidation=new Schema({'userId':{'type':_0x8630('0xb'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x8630('0xc'),'required':![]}});var callsValidation=new Schema({'userId':{'type':'number','required':[!![],'userId\x20is\x20required']}});var conferenceValidation=new Schema({'userId':{'type':_0x8630('0xb'),'required':[!![],_0x8630('0xd')]}});function emit(_0x49fce1,_0x5c0ba0,_0x3ea754){logger['info'](_0x49fce1,_0x5c0ba0,JSON[_0x8630('0xf')](_0x3ea754));io['to'](_0x49fce1)[_0x8630('0x10')](_0x5c0ba0,_0x3ea754);}function handleError(_0x2c360d){return function(_0x20f462){console[_0x8630('0x11')](_0x8630('0x12'),_0x20f462,_0x20f462 instanceof RangeError);logger[_0x8630('0x13')](_0x20f462[_0x8630('0x14')]);if(_0x20f462 instanceof RangeError){if(_0x20f462[_0x8630('0x15')]){delete _0x20f462['name'];}_0x2c360d['status'](0x194)[_0x8630('0x16')](_0x20f462);}else{if(_0x20f462[_0x8630('0x15')]){delete _0x20f462['name'];}_0x2c360d['status'](0x1f4)[_0x8630('0x16')](_0x20f462);}};}function checkError(){return function(_0x441918){if(!_0x441918){throw new RangeError(_0x8630('0x17'));}return _0x441918;};}function respondWithRpcPromise(_0x491c65,_0x5ce487){return new BPromise(function(_0xcc7454,_0x58c0b5){var _0x30fb4d=amiClient;return _0x30fb4d[_0x8630('0x18')](_0x491c65,_0x5ce487)[_0x8630('0x19')](function(_0x469de3){if(_0x469de3['error']){if(_0x469de3[_0x8630('0x13')][_0x8630('0x1a')]===0x1f4){return _0x58c0b5(_0x469de3[_0x8630('0x13')][_0x8630('0x1b')]);}return _0xcc7454(_0x469de3[_0x8630('0x13')][_0x8630('0x1b')]);}else{_0xcc7454(_0x469de3[_0x8630('0x1c')]);}})['catch'](function(_0x5b2823){_0x58c0b5(_0x5b2823);});});}function getAgent(_0x18fd53){return db[_0x8630('0x1d')][_0x8630('0x1e')]({'where':{'id':_0x18fd53,'role':_0x8630('0x1f')}})[_0x8630('0x19')](checkError());}function getAgentCheckSession(_0x1c012d,_0x149a8e){return new BPromise(function(_0x349c4d,_0x306ca2){var _0x357c15=respondWithRpcPromise(_0x8630('0x20'));var _0x41f74c=getAgent(_0x1c012d);Promise[_0x8630('0x21')]([_0x357c15,_0x41f74c])[_0x8630('0x19')](function(_0xbb1a58){var _0x190216=_0xbb1a58[0x0];var _0x2d3f0b=_0xbb1a58[0x1];var _0x4d42c6=_[_0x8630('0x22')](_0x190216[_0x8630('0x23')],function(_0x24d85d){return _0x24d85d[_0x8630('0x24')]==_0x2d3f0b['id']&&_0x24d85d['sessionId']==_0x149a8e;});if(_0x4d42c6[_0x8630('0x25')]==0x1){_0x349c4d(_0x2d3f0b);}else{_0x306ca2(new RangeError(_0x8630('0x26')+_0x149a8e+_0x8630('0x27')));}});});}exports[_0x8630('0x28')]=function(_0x35b7b2,_0x32f4fd){logger['info'](_0x8630('0x29'),_0x35b7b2[_0x8630('0x2a')]);var _0x24e6af=originateValidation['validate'](_0x35b7b2[_0x8630('0x2a')]);if(_0x24e6af[_0x8630('0x25')]>0x0){return _0x32f4fd[_0x8630('0x2b')](0x190)[_0x8630('0x2c')](_0x24e6af);}var _0x2e0352=_0x35b7b2[_0x8630('0x2a')]['userId'];var _0x7deb1e=_0x35b7b2[_0x8630('0x2a')][_0x8630('0x2d')];var _0x16370e=_0x35b7b2[_0x8630('0x2a')][_0x8630('0x2e')];var _0x2843a6=_0x35b7b2[_0x8630('0x2a')][_0x8630('0x2f')];return getAgent(_0x2e0352)[_0x8630('0x19')](function(_0x396b2c){logger[_0x8630('0x30')](_0x8630('0x31'),_0x396b2c[_0x8630('0x15')]);emit(util[_0x8630('0x32')](_0x8630('0x33'),_0x396b2c[_0x8630('0x15')]),'webbar:originate',{'callNumber':_0x7deb1e,'callerId':_0x16370e,'callbackUrl':_0x2843a6});return _0x32f4fd[_0x8630('0x2b')](0xc8)[_0x8630('0x2c')]({'error':![],'message':'originate\x20executed!'});})['catch'](handleError(_0x32f4fd));};exports[_0x8630('0x34')]=function(_0x1c2281,_0x28f75d){logger[_0x8630('0x30')](_0x8630('0x35'),_0x1c2281['body']);var _0x21e879=hangupValidation[_0x8630('0xa')](_0x1c2281[_0x8630('0x2a')]);if(_0x21e879[_0x8630('0x25')]>0x0){return _0x28f75d['status'](0x190)[_0x8630('0x2c')](_0x21e879);}var _0x437fde=_0x1c2281[_0x8630('0x2a')][_0x8630('0x36')];var _0x411a5c=_0x1c2281[_0x8630('0x2a')][_0x8630('0x37')];return getAgent(_0x437fde)['then'](function(_0x1076f4){logger[_0x8630('0x30')](_0x8630('0x31'),_0x1076f4[_0x8630('0x15')]);emit(util[_0x8630('0x32')](_0x8630('0x33'),_0x1076f4[_0x8630('0x15')]),_0x8630('0x38'),{'sessionId':_0x411a5c});return _0x28f75d[_0x8630('0x2b')](0xc8)[_0x8630('0x2c')]({'error':![],'message':'hangup\x20executed!'});})[_0x8630('0x39')](handleError(_0x28f75d));};exports['answer']=function(_0x8b40e1,_0x475bb4){logger[_0x8630('0x30')](_0x8630('0x3a'),_0x8b40e1[_0x8630('0x2a')]);var _0x2f1fec=answerValidation['validate'](_0x8b40e1[_0x8630('0x2a')]);if(_0x2f1fec[_0x8630('0x25')]>0x0){return _0x475bb4[_0x8630('0x2b')](0x190)['json'](_0x2f1fec);}var _0x79385=_0x8b40e1[_0x8630('0x2a')][_0x8630('0x36')];var _0x327466=_0x8b40e1[_0x8630('0x2a')][_0x8630('0x37')];return getAgent(_0x79385)['then'](function(_0x348bb3){logger[_0x8630('0x30')](_0x8630('0x31'),_0x348bb3['name']);emit(util[_0x8630('0x32')](_0x8630('0x33'),_0x348bb3['name']),_0x8630('0x3b'),{'sessionId':_0x327466});return _0x475bb4[_0x8630('0x2b')](0xc8)[_0x8630('0x2c')]({'error':![],'message':'answer\x20executed!'});})['catch'](handleError(_0x475bb4));};exports[_0x8630('0x3c')]=function(_0x4ab99a,_0x4f33bf){logger[_0x8630('0x30')]('hold\x20fired:',_0x4ab99a[_0x8630('0x2a')]);var _0x35a3c8=holdValidation['validate'](_0x4ab99a[_0x8630('0x2a')]);if(_0x35a3c8[_0x8630('0x25')]>0x0){return _0x4f33bf[_0x8630('0x2b')](0x190)[_0x8630('0x2c')](_0x35a3c8);}var _0x121e83=_0x4ab99a['body'][_0x8630('0x36')];var _0x231289=_0x4ab99a['body'][_0x8630('0x37')];return getAgent(_0x121e83)[_0x8630('0x19')](function(_0x3ff20b){logger['info'](_0x8630('0x31'),_0x3ff20b[_0x8630('0x15')]);emit(util[_0x8630('0x32')](_0x8630('0x33'),_0x3ff20b[_0x8630('0x15')]),_0x8630('0x3d'),{'sessionId':_0x231289});return _0x4f33bf[_0x8630('0x2b')](0xc8)[_0x8630('0x2c')]({'error':![],'message':_0x8630('0x3e')});})['catch'](handleError(_0x4f33bf));};exports['unhold']=function(_0x1b8328,_0x13326d){logger[_0x8630('0x30')](_0x8630('0x3f'),_0x1b8328[_0x8630('0x2a')]);var _0x24a363=unholdValidation[_0x8630('0xa')](_0x1b8328['body']);if(_0x24a363[_0x8630('0x25')]>0x0){return _0x13326d[_0x8630('0x2b')](0x190)[_0x8630('0x2c')](_0x24a363);}var _0x16c286=_0x1b8328[_0x8630('0x2a')]['userId'];var _0x398ea7=_0x1b8328[_0x8630('0x2a')][_0x8630('0x37')];return getAgent(_0x16c286)[_0x8630('0x19')](function(_0x503f2b){logger[_0x8630('0x30')](_0x8630('0x31'),_0x503f2b['name']);emit(util[_0x8630('0x32')](_0x8630('0x33'),_0x503f2b[_0x8630('0x15')]),_0x8630('0x40'),{'sessionId':_0x398ea7});return _0x13326d['status'](0xc8)[_0x8630('0x2c')]({'error':![],'message':_0x8630('0x41')});})['catch'](handleError(_0x13326d));};exports['calls']=function(_0x438a56,_0x9fef86){logger['info'](_0x8630('0x42'),_0x9fef86['body']);var _0x2e49c8=callsValidation[_0x8630('0xa')](_0x438a56[_0x8630('0x2a')]);if(_0x2e49c8['length']>0x0){return _0x9fef86[_0x8630('0x2b')](0x190)[_0x8630('0x2c')](_0x2e49c8);}var _0x7615f5=_0x438a56[_0x8630('0x2a')][_0x8630('0x36')];var _0x1c28dc=respondWithRpcPromise(_0x8630('0x20'));var _0x49c2bc=getAgent(_0x7615f5);return Promise[_0x8630('0x21')]([_0x1c28dc,_0x49c2bc])[_0x8630('0x19')](function(_0x2c3e6e){var _0x50ce41=_0x2c3e6e[0x0];var _0x535add=_0x2c3e6e[0x1];var _0x388e1f=_['filter'](_0x50ce41[_0x8630('0x23')],function(_0x83b818){return _0x83b818['UserId']==_0x535add['id'];});return _0x9fef86[_0x8630('0x2b')](0xc8)[_0x8630('0x2c')]({'count':_0x388e1f[_0x8630('0x25')],'rows':_0x388e1f});})[_0x8630('0x39')](handleError(_0x9fef86));};exports['conference']=function(_0x19af58,_0x1b33c3){logger[_0x8630('0x30')]('conference\x20fired:',_0x19af58['body']);var _0x4d32ac=conferenceValidation[_0x8630('0xa')](_0x19af58[_0x8630('0x2a')]);if(_0x4d32ac[_0x8630('0x25')]>0x0){return _0x1b33c3[_0x8630('0x2b')](0x190)[_0x8630('0x2c')](_0x4d32ac);}var _0x59f0d3=_0x19af58[_0x8630('0x2a')][_0x8630('0x36')];return getAgent(_0x59f0d3)[_0x8630('0x19')](function(_0x4f352b){logger['info'](_0x8630('0x31'),_0x4f352b[_0x8630('0x15')]);emit(util['format'](_0x8630('0x33'),_0x4f352b['name']),_0x8630('0x43'));return _0x1b33c3[_0x8630('0x2b')](0xc8)[_0x8630('0x2c')]({'error':![],'message':_0x8630('0x44')});})[_0x8630('0x39')](handleError(_0x1b33c3));};exports['transfer']=function(_0x5f02ac,_0x5b9d39){logger[_0x8630('0x30')](_0x8630('0x45'),_0x5f02ac[_0x8630('0x2a')]);var _0x3da5cb=transferValidation[_0x8630('0xa')](_0x5f02ac[_0x8630('0x2a')]);if(_0x3da5cb[_0x8630('0x25')]>0x0){return _0x5b9d39[_0x8630('0x2b')](0x190)[_0x8630('0x2c')](_0x3da5cb);}var _0x36a55b=_0x5f02ac[_0x8630('0x2a')][_0x8630('0x36')];var _0x4bccab=_0x5f02ac[_0x8630('0x2a')]['sessionId'];var _0x427d94=_0x5f02ac[_0x8630('0x2a')][_0x8630('0x46')];return getAgent(_0x36a55b)[_0x8630('0x19')](function(_0x4beca1){logger['info'](_0x8630('0x31'),_0x4beca1[_0x8630('0x15')]);emit(util[_0x8630('0x32')]('user:%s',_0x4beca1[_0x8630('0x15')]),_0x8630('0x47'),{'sessionId':_0x4bccab,'transferNumber':_0x427d94});return _0x5b9d39['status'](0xc8)[_0x8630('0x2c')]({'error':![],'message':_0x8630('0x48')});})[_0x8630('0x39')](handleError(_0x5b9d39));}; \ No newline at end of file +var _0x6737=['answer\x20executed!','hold','hold\x20fired:','webbar:hold','hold\x20executed!','unhold\x20fired:','webbar:unhold','unhold\x20executed!','calls','calls\x20fired:','UserId','conference\x20fired:','transfer\x20fired:','transferNumber','webbar:transfer','transfer\x20executed!','lodash','../../mysqldb','util','bluebird','jayson/promise','client','../../config/logger','webbarapi','redis','defaults','validate','userId\x20is\x20required','string','number','sessionId\x20is\x20required','transferNumber\x20is\x20required','info','stringify','handleError:','error','stack','status','send','name','NotFound','request','then','code','message','catch','User','VoiceChannels','filter','rows','sessionId','length','sessionId\x20','\x20not\x20found!','originate\x20fired:','body','json','userId','callNumber','callerId','callbackUrl','entityFound:','format','user:%s','webbar:originate','originate\x20executed!','hangup','webbar:hangup','answer\x20fired:','webbar:answer'];(function(_0x143646,_0x17e889){var _0x1c0a37=function(_0x4c2aa4){while(--_0x4c2aa4){_0x143646['push'](_0x143646['shift']());}};_0x1c0a37(++_0x17e889);}(_0x6737,0xe2));var _0x7673=function(_0x5d6a51,_0x4d9e71){_0x5d6a51=_0x5d6a51-0x0;var _0x40c8df=_0x6737[_0x5d6a51];return _0x40c8df;};'use strict';var path=require('path');var fs=require('fs');var _=require(_0x7673('0x0'));var db=require(_0x7673('0x1'))['db'];var config=require('../../config/environment');var util=require(_0x7673('0x2'));var BPromise=require(_0x7673('0x3'));var jayson=require(_0x7673('0x4'));var amiClient=jayson[_0x7673('0x5')]['http']({'port':0x232a});var logger=require(_0x7673('0x6'))(_0x7673('0x7'));var Redis=require('ioredis');config[_0x7673('0x8')]=_[_0x7673('0x9')](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var Schema=require(_0x7673('0xa'));var originateValidation=new Schema({'userId':{'type':'number','required':[!![],_0x7673('0xb')]},'callNumber':{'type':_0x7673('0xc'),'required':[!![],'callNumber\x20is\x20required']},'callerId':{'type':_0x7673('0xc')},'callbackUrl':{'type':_0x7673('0xc')}});var hangupValidation=new Schema({'userId':{'type':_0x7673('0xd'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':'string','required':![]}});var answerValidation=new Schema({'userId':{'type':_0x7673('0xd'),'required':[!![],'userId\x20is\x20required']},'sessionId':{'type':_0x7673('0xc'),'required':![]}});var transferValidation=new Schema({'userId':{'type':_0x7673('0xd'),'required':[!![],_0x7673('0xb')]},'sessionId':{'type':_0x7673('0xc'),'required':[!![],_0x7673('0xe')]},'transferNumber':{'type':_0x7673('0xc'),'required':[!![],_0x7673('0xf')]}});var holdValidation=new Schema({'userId':{'type':_0x7673('0xd'),'required':[!![],_0x7673('0xb')]},'sessionId':{'type':_0x7673('0xc'),'required':![]}});var unholdValidation=new Schema({'userId':{'type':'number','required':[!![],_0x7673('0xb')]},'sessionId':{'type':_0x7673('0xc'),'required':![]}});var callsValidation=new Schema({'userId':{'type':_0x7673('0xd'),'required':[!![],_0x7673('0xb')]}});var conferenceValidation=new Schema({'userId':{'type':_0x7673('0xd'),'required':[!![],_0x7673('0xb')]}});function emit(_0x2a2840,_0x4a8ea0,_0x5ed354){logger[_0x7673('0x10')](_0x2a2840,_0x4a8ea0,JSON[_0x7673('0x11')](_0x5ed354));io['to'](_0x2a2840)['emit'](_0x4a8ea0,_0x5ed354);}function handleError(_0x3afbb3){return function(_0x17699a){console['log'](_0x7673('0x12'),_0x17699a,_0x17699a instanceof RangeError);logger[_0x7673('0x13')](_0x17699a[_0x7673('0x14')]);if(_0x17699a instanceof RangeError){if(_0x17699a['name']){delete _0x17699a['name'];}_0x3afbb3[_0x7673('0x15')](0x194)[_0x7673('0x16')](_0x17699a);}else{if(_0x17699a['name']){delete _0x17699a[_0x7673('0x17')];}_0x3afbb3[_0x7673('0x15')](0x1f4)[_0x7673('0x16')](_0x17699a);}};}function checkError(){return function(_0x33eb47){if(!_0x33eb47){throw new RangeError(_0x7673('0x18'));}return _0x33eb47;};}function respondWithRpcPromise(_0x3e28ca,_0x59879a){return new BPromise(function(_0x557161,_0xea9b37){var _0x21774f=amiClient;return _0x21774f[_0x7673('0x19')](_0x3e28ca,_0x59879a)[_0x7673('0x1a')](function(_0x16bb16){if(_0x16bb16['error']){if(_0x16bb16[_0x7673('0x13')][_0x7673('0x1b')]===0x1f4){return _0xea9b37(_0x16bb16[_0x7673('0x13')][_0x7673('0x1c')]);}return _0x557161(_0x16bb16[_0x7673('0x13')][_0x7673('0x1c')]);}else{_0x557161(_0x16bb16['result']);}})[_0x7673('0x1d')](function(_0xaca974){_0xea9b37(_0xaca974);});});}function getAgent(_0x425897){return db[_0x7673('0x1e')]['findOne']({'where':{'id':_0x425897,'role':'agent'}})[_0x7673('0x1a')](checkError());}function getAgentCheckSession(_0x11b42b,_0x291d10){return new BPromise(function(_0x9d9eab,_0x119a21){var _0x45a045=respondWithRpcPromise(_0x7673('0x1f'));var _0x5a59f9=getAgent(_0x11b42b);Promise['all']([_0x45a045,_0x5a59f9])[_0x7673('0x1a')](function(_0x2d4c0a){var _0x1dd436=_0x2d4c0a[0x0];var _0x335743=_0x2d4c0a[0x1];var _0x12ac6b=_[_0x7673('0x20')](_0x1dd436[_0x7673('0x21')],function(_0x4f12b9){return _0x4f12b9['UserId']==_0x335743['id']&&_0x4f12b9[_0x7673('0x22')]==_0x291d10;});if(_0x12ac6b[_0x7673('0x23')]==0x1){_0x9d9eab(_0x335743);}else{_0x119a21(new RangeError(_0x7673('0x24')+_0x291d10+_0x7673('0x25')));}});});}exports['originate']=function(_0x3aa249,_0x497760){logger[_0x7673('0x10')](_0x7673('0x26'),_0x3aa249[_0x7673('0x27')]);var _0x1b924f=originateValidation[_0x7673('0xa')](_0x3aa249[_0x7673('0x27')]);if(_0x1b924f[_0x7673('0x23')]>0x0){return _0x497760[_0x7673('0x15')](0x190)[_0x7673('0x28')](_0x1b924f);}var _0x1b6061=_0x3aa249[_0x7673('0x27')][_0x7673('0x29')];var _0x26cccd=_0x3aa249['body'][_0x7673('0x2a')];var _0x42f658=_0x3aa249[_0x7673('0x27')][_0x7673('0x2b')];var _0x30ddec=_0x3aa249[_0x7673('0x27')][_0x7673('0x2c')];return getAgent(_0x1b6061)['then'](function(_0x563e2d){logger[_0x7673('0x10')](_0x7673('0x2d'),_0x563e2d[_0x7673('0x17')]);emit(util[_0x7673('0x2e')](_0x7673('0x2f'),_0x563e2d[_0x7673('0x17')]),_0x7673('0x30'),{'callNumber':_0x26cccd,'callerId':_0x42f658,'callbackUrl':_0x30ddec});return _0x497760['status'](0xc8)[_0x7673('0x28')]({'error':![],'message':_0x7673('0x31')});})['catch'](handleError(_0x497760));};exports[_0x7673('0x32')]=function(_0x400f3c,_0x287eee){logger[_0x7673('0x10')]('hangup\x20fired:',_0x400f3c[_0x7673('0x27')]);var _0x1f77c0=hangupValidation['validate'](_0x400f3c[_0x7673('0x27')]);if(_0x1f77c0[_0x7673('0x23')]>0x0){return _0x287eee[_0x7673('0x15')](0x190)['json'](_0x1f77c0);}var _0xe50aa5=_0x400f3c[_0x7673('0x27')][_0x7673('0x29')];var _0x5dfb9a=_0x400f3c['body'][_0x7673('0x22')];return getAgent(_0xe50aa5)['then'](function(_0x4ba2b4){logger[_0x7673('0x10')](_0x7673('0x2d'),_0x4ba2b4['name']);emit(util[_0x7673('0x2e')](_0x7673('0x2f'),_0x4ba2b4[_0x7673('0x17')]),_0x7673('0x33'),{'sessionId':_0x5dfb9a});return _0x287eee[_0x7673('0x15')](0xc8)[_0x7673('0x28')]({'error':![],'message':'hangup\x20executed!'});})[_0x7673('0x1d')](handleError(_0x287eee));};exports['answer']=function(_0xf43bb7,_0x52f803){logger[_0x7673('0x10')](_0x7673('0x34'),_0xf43bb7['body']);var _0x5b2e69=answerValidation[_0x7673('0xa')](_0xf43bb7['body']);if(_0x5b2e69[_0x7673('0x23')]>0x0){return _0x52f803[_0x7673('0x15')](0x190)[_0x7673('0x28')](_0x5b2e69);}var _0x3b6223=_0xf43bb7[_0x7673('0x27')]['userId'];var _0x4ea8b3=_0xf43bb7[_0x7673('0x27')][_0x7673('0x22')];return getAgent(_0x3b6223)['then'](function(_0x4005ee){logger[_0x7673('0x10')](_0x7673('0x2d'),_0x4005ee['name']);emit(util[_0x7673('0x2e')](_0x7673('0x2f'),_0x4005ee[_0x7673('0x17')]),_0x7673('0x35'),{'sessionId':_0x4ea8b3});return _0x52f803[_0x7673('0x15')](0xc8)[_0x7673('0x28')]({'error':![],'message':_0x7673('0x36')});})[_0x7673('0x1d')](handleError(_0x52f803));};exports[_0x7673('0x37')]=function(_0x4ed31d,_0x126981){logger[_0x7673('0x10')](_0x7673('0x38'),_0x4ed31d[_0x7673('0x27')]);var _0x332b5a=holdValidation[_0x7673('0xa')](_0x4ed31d[_0x7673('0x27')]);if(_0x332b5a['length']>0x0){return _0x126981[_0x7673('0x15')](0x190)[_0x7673('0x28')](_0x332b5a);}var _0x461ac3=_0x4ed31d[_0x7673('0x27')][_0x7673('0x29')];var _0x4b844d=_0x4ed31d[_0x7673('0x27')][_0x7673('0x22')];return getAgent(_0x461ac3)[_0x7673('0x1a')](function(_0x2397fb){logger[_0x7673('0x10')]('entityFound:',_0x2397fb['name']);emit(util[_0x7673('0x2e')](_0x7673('0x2f'),_0x2397fb['name']),_0x7673('0x39'),{'sessionId':_0x4b844d});return _0x126981[_0x7673('0x15')](0xc8)[_0x7673('0x28')]({'error':![],'message':_0x7673('0x3a')});})[_0x7673('0x1d')](handleError(_0x126981));};exports['unhold']=function(_0x23789d,_0x3afffa){logger[_0x7673('0x10')](_0x7673('0x3b'),_0x23789d['body']);var _0x1691a5=unholdValidation[_0x7673('0xa')](_0x23789d[_0x7673('0x27')]);if(_0x1691a5[_0x7673('0x23')]>0x0){return _0x3afffa[_0x7673('0x15')](0x190)[_0x7673('0x28')](_0x1691a5);}var _0x115eef=_0x23789d[_0x7673('0x27')][_0x7673('0x29')];var _0x362409=_0x23789d[_0x7673('0x27')]['sessionId'];return getAgent(_0x115eef)[_0x7673('0x1a')](function(_0x4a0d99){logger[_0x7673('0x10')](_0x7673('0x2d'),_0x4a0d99[_0x7673('0x17')]);emit(util['format'](_0x7673('0x2f'),_0x4a0d99[_0x7673('0x17')]),_0x7673('0x3c'),{'sessionId':_0x362409});return _0x3afffa[_0x7673('0x15')](0xc8)[_0x7673('0x28')]({'error':![],'message':_0x7673('0x3d')});})[_0x7673('0x1d')](handleError(_0x3afffa));};exports[_0x7673('0x3e')]=function(_0x375bca,_0x1064d5){logger[_0x7673('0x10')](_0x7673('0x3f'),_0x1064d5[_0x7673('0x27')]);var _0xb3c9e9=callsValidation['validate'](_0x375bca[_0x7673('0x27')]);if(_0xb3c9e9['length']>0x0){return _0x1064d5[_0x7673('0x15')](0x190)[_0x7673('0x28')](_0xb3c9e9);}var _0x1d424a=_0x375bca['body'][_0x7673('0x29')];var _0x5d71b7=respondWithRpcPromise('VoiceChannels');var _0x1804a4=getAgent(_0x1d424a);return Promise['all']([_0x5d71b7,_0x1804a4])['then'](function(_0x1dd141){var _0x3f6ef3=_0x1dd141[0x0];var _0x215a32=_0x1dd141[0x1];var _0xeaa731=_[_0x7673('0x20')](_0x3f6ef3[_0x7673('0x21')],function(_0x151276){return _0x151276[_0x7673('0x40')]==_0x215a32['id'];});return _0x1064d5[_0x7673('0x15')](0xc8)[_0x7673('0x28')]({'count':_0xeaa731[_0x7673('0x23')],'rows':_0xeaa731});})['catch'](handleError(_0x1064d5));};exports['conference']=function(_0x2aa032,_0x297744){logger[_0x7673('0x10')](_0x7673('0x41'),_0x2aa032[_0x7673('0x27')]);var _0x48e51c=conferenceValidation['validate'](_0x2aa032[_0x7673('0x27')]);if(_0x48e51c[_0x7673('0x23')]>0x0){return _0x297744[_0x7673('0x15')](0x190)[_0x7673('0x28')](_0x48e51c);}var _0x51c617=_0x2aa032['body'][_0x7673('0x29')];return getAgent(_0x51c617)[_0x7673('0x1a')](function(_0x1cf039){logger['info'](_0x7673('0x2d'),_0x1cf039['name']);emit(util[_0x7673('0x2e')](_0x7673('0x2f'),_0x1cf039[_0x7673('0x17')]),'webbar:conference');return _0x297744[_0x7673('0x15')](0xc8)[_0x7673('0x28')]({'error':![],'message':'conference\x20executed!'});})['catch'](handleError(_0x297744));};exports['transfer']=function(_0x32dcfc,_0x2dd367){logger[_0x7673('0x10')](_0x7673('0x42'),_0x32dcfc['body']);var _0xed9040=transferValidation['validate'](_0x32dcfc[_0x7673('0x27')]);if(_0xed9040[_0x7673('0x23')]>0x0){return _0x2dd367[_0x7673('0x15')](0x190)[_0x7673('0x28')](_0xed9040);}var _0x5abb12=_0x32dcfc[_0x7673('0x27')][_0x7673('0x29')];var _0x308a9e=_0x32dcfc['body']['sessionId'];var _0x2d21f2=_0x32dcfc[_0x7673('0x27')][_0x7673('0x43')];return getAgent(_0x5abb12)[_0x7673('0x1a')](function(_0x20e9bd){logger['info'](_0x7673('0x2d'),_0x20e9bd[_0x7673('0x17')]);emit(util['format']('user:%s',_0x20e9bd['name']),_0x7673('0x44'),{'sessionId':_0x308a9e,'transferNumber':_0x2d21f2});return _0x2dd367[_0x7673('0x15')](0xc8)['json']({'error':![],'message':_0x7673('0x45')});})['catch'](handleError(_0x2dd367));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/index.js b/server/api/whatsappAccount/index.js index 0396148..5673bb7 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 _0xfcf0=['/:id/applications','getApplications','post','addAnswer','/:id/users','addAgents','addApplications','notify','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./whatsappAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','getAgents'];(function(_0xc6b50b,_0x42f55a){var _0x45c9f4=function(_0x20a584){while(--_0x20a584){_0xc6b50b['push'](_0xc6b50b['shift']());}};_0x45c9f4(++_0x42f55a);}(_0xfcf0,0x138));var _0x0fcf=function(_0x5beda8,_0x1e8554){_0x5beda8=_0x5beda8-0x0;var _0x2aa042=_0xfcf0[_0x5beda8];return _0x2aa042;};'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('0x9')](_0x0fcf('0x10'),auth['isAuthenticated'](),controller[_0x0fcf('0x11')]);router['get'](_0x0fcf('0x12'),auth[_0x0fcf('0xa')](),controller[_0x0fcf('0x13')]);router['get']('/:id/users',auth[_0x0fcf('0xa')](),controller[_0x0fcf('0x14')]);router['get'](_0x0fcf('0x15'),auth[_0x0fcf('0xa')](),controller[_0x0fcf('0x16')]);router[_0x0fcf('0x17')]('/',auth[_0x0fcf('0xa')](),controller['create']);router[_0x0fcf('0x17')](_0x0fcf('0x10'),auth[_0x0fcf('0xa')](),controller['addDisposition']);router[_0x0fcf('0x17')](_0x0fcf('0x12'),auth[_0x0fcf('0xa')](),controller[_0x0fcf('0x18')]);router['post'](_0x0fcf('0x19'),auth[_0x0fcf('0xa')](),controller[_0x0fcf('0x1a')]);router[_0x0fcf('0x17')](_0x0fcf('0x15'),auth['isAuthenticated'](),controller[_0x0fcf('0x1b')]);router[_0x0fcf('0x17')]('/:id/notify',controller[_0x0fcf('0x1c')]);router[_0x0fcf('0x17')]('/:id/send',auth[_0x0fcf('0xa')](),controller['send']);router[_0x0fcf('0x1d')](_0x0fcf('0xe'),auth['isAuthenticated'](),controller[_0x0fcf('0x1e')]);router[_0x0fcf('0x1f')](_0x0fcf('0xe'),auth['isAuthenticated'](),controller[_0x0fcf('0x20')]);router[_0x0fcf('0x1f')](_0x0fcf('0x10'),auth[_0x0fcf('0xa')](),controller[_0x0fcf('0x21')]);router[_0x0fcf('0x1f')]('/:id/canned_answers',auth[_0x0fcf('0xa')](),controller[_0x0fcf('0x22')]);router[_0x0fcf('0x1f')](_0x0fcf('0x19'),auth[_0x0fcf('0xa')](),controller[_0x0fcf('0x23')]);module[_0x0fcf('0x24')]=router; \ No newline at end of file +var _0xd4a2=['../../components/auth/service','../../config/environment','./whatsappAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','getAnswers','/:id/users','getAgents','/:id/applications','getApplications','post','addDisposition','/:id/canned_answers','addAnswer','addAgents','notify','/:id/send','send','put','update','delete','destroy','removeAnswers','removeAgents','multer','connect-timeout','Router'];(function(_0x457823,_0x5c7f4c){var _0x1387d1=function(_0x535ae5){while(--_0x535ae5){_0x457823['push'](_0x457823['shift']());}};_0x1387d1(++_0x5c7f4c);}(_0xd4a2,0x173));var _0x2d4a=function(_0x24baa4,_0x23a55f){_0x24baa4=_0x24baa4-0x0;var _0x36ea39=_0xd4a2[_0x24baa4];return _0x36ea39;};'use strict';var multer=require(_0x2d4a('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x2d4a('0x1'));var express=require('express');var router=express[_0x2d4a('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x2d4a('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x2d4a('0x4'));var controller=require(_0x2d4a('0x5'));router[_0x2d4a('0x6')]('/',auth[_0x2d4a('0x7')](),controller[_0x2d4a('0x8')]);router['get'](_0x2d4a('0x9'),auth[_0x2d4a('0x7')](),controller[_0x2d4a('0xa')]);router[_0x2d4a('0x6')](_0x2d4a('0xb'),auth[_0x2d4a('0x7')](),controller[_0x2d4a('0xc')]);router[_0x2d4a('0x6')](_0x2d4a('0xd'),auth[_0x2d4a('0x7')](),controller[_0x2d4a('0xe')]);router[_0x2d4a('0x6')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x2d4a('0xf')]);router['get'](_0x2d4a('0x10'),auth[_0x2d4a('0x7')](),controller[_0x2d4a('0x11')]);router[_0x2d4a('0x6')](_0x2d4a('0x12'),auth[_0x2d4a('0x7')](),controller[_0x2d4a('0x13')]);router[_0x2d4a('0x14')]('/',auth['isAuthenticated'](),controller['create']);router[_0x2d4a('0x14')]('/:id/dispositions',auth[_0x2d4a('0x7')](),controller[_0x2d4a('0x15')]);router[_0x2d4a('0x14')](_0x2d4a('0x16'),auth['isAuthenticated'](),controller[_0x2d4a('0x17')]);router['post'](_0x2d4a('0x10'),auth['isAuthenticated'](),controller[_0x2d4a('0x18')]);router[_0x2d4a('0x14')](_0x2d4a('0x12'),auth[_0x2d4a('0x7')](),controller['addApplications']);router['post']('/:id/notify',controller[_0x2d4a('0x19')]);router[_0x2d4a('0x14')](_0x2d4a('0x1a'),auth[_0x2d4a('0x7')](),controller[_0x2d4a('0x1b')]);router[_0x2d4a('0x1c')]('/:id',auth['isAuthenticated'](),controller[_0x2d4a('0x1d')]);router[_0x2d4a('0x1e')](_0x2d4a('0xb'),auth[_0x2d4a('0x7')](),controller[_0x2d4a('0x1f')]);router[_0x2d4a('0x1e')](_0x2d4a('0xd'),auth[_0x2d4a('0x7')](),controller['removeDispositions']);router[_0x2d4a('0x1e')](_0x2d4a('0x16'),auth[_0x2d4a('0x7')](),controller[_0x2d4a('0x20')]);router[_0x2d4a('0x1e')](_0x2d4a('0x10'),auth[_0x2d4a('0x7')](),controller[_0x2d4a('0x21')]);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 7569437..275e661 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 _0x40cd=['Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','exports','STRING','name','generate','ENUM','twilio','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER'];(function(_0x5898d2,_0x2a3dcd){var _0x4934d1=function(_0x5fb6cf){while(--_0x5fb6cf){_0x5898d2['push'](_0x5898d2['shift']());}};_0x4934d1(++_0x2a3dcd);}(_0x40cd,0x154));var _0xd40c=function(_0x293068,_0x383540){_0x293068=_0x293068-0x0;var _0x4542ae=_0x40cd[_0x293068];return _0x4542ae;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module[_0xd40c('0x0')]={'name':{'type':Sequelize[_0xd40c('0x1')],'unique':_0xd40c('0x2'),'allowNull':![]},'key':{'type':Sequelize[_0xd40c('0x1')],'allowNull':![]},'remote':{'type':Sequelize['STRING'],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xd40c('0x3')]();}},'phone':{'type':Sequelize[_0xd40c('0x1')]},'type':{'type':Sequelize[_0xd40c('0x4')](_0xd40c('0x5'))},'accountSid':{'type':Sequelize[_0xd40c('0x1')]},'authToken':{'type':Sequelize[_0xd40c('0x1')]},'notificationTemplate':{'type':Sequelize[_0xd40c('0x6')],'defaultValue':function(){return _0xd40c('0x7');}},'notificationSound':{'type':Sequelize[_0xd40c('0x8')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0xd40c('0x8')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xd40c('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xd40c('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xd40c('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xd40c('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xd40c('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xd40c('0x9')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xd40c('0x8')],'defaultValue':![],'comment':_0xd40c('0xa'),'set':function(_0x3f8d3a){if(!_0x3f8d3a){this[_0xd40c('0xb')](_0xd40c('0xc'),null);}this[_0xd40c('0xb')](_0xd40c('0xd'),_0x3f8d3a);}},'description':{'type':Sequelize[_0xd40c('0x1')]}}; \ No newline at end of file +var _0xac81=['randomstring','exports','STRING','name','generate','ENUM','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize'];(function(_0x110e42,_0x134a3e){var _0x343f58=function(_0x58f189){while(--_0x58f189){_0x110e42['push'](_0x110e42['shift']());}};_0x343f58(++_0x134a3e);}(_0xac81,0x1a3));var _0x1ac8=function(_0xf05097,_0x1c79cb){_0xf05097=_0xf05097-0x0;var _0x63be6=_0xac81[_0xf05097];return _0x63be6;};'use strict';var Sequelize=require(_0x1ac8('0x0'));var rs=require(_0x1ac8('0x1'));module[_0x1ac8('0x2')]={'name':{'type':Sequelize[_0x1ac8('0x3')],'unique':_0x1ac8('0x4'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize[_0x1ac8('0x3')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x1ac8('0x5')]();}},'phone':{'type':Sequelize[_0x1ac8('0x3')]},'type':{'type':Sequelize[_0x1ac8('0x6')]('twilio')},'accountSid':{'type':Sequelize[_0x1ac8('0x3')]},'authToken':{'type':Sequelize[_0x1ac8('0x3')]},'notificationTemplate':{'type':Sequelize[_0x1ac8('0x7')],'defaultValue':function(){return _0x1ac8('0x8');}},'notificationSound':{'type':Sequelize[_0x1ac8('0x9')],'defaultValue':![]},'notificationShake':{'type':Sequelize[_0x1ac8('0x9')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x1ac8('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x1ac8('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x1ac8('0xa')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x1ac8('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x1ac8('0xa')],'comment':_0x1ac8('0xb')},'mandatoryDisposition':{'type':Sequelize[_0x1ac8('0x9')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x516aed){if(!_0x516aed){this[_0x1ac8('0xc')](_0x1ac8('0xd'),null);}this['setDataValue'](_0x1ac8('0xe'),_0x516aed);}},'description':{'type':Sequelize[_0x1ac8('0x3')]}}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.controller.js b/server/api/whatsappAccount/whatsappAccount.controller.js index a7eb31f..3bfdcc8 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 _0xb39c=['name','send','index','mandatoryDispositionPause','map','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','order','sort','filters','pick','VIRTUAL','filter','options','where','WhatsappAccount','includeAll','include','findAll','show','params','Pause','merge','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','describe','addDisposition','Disposition','getDispositions','findOne','WhatsappAccountId','rows','removeDispositions','ids','addAnswer','getAnswers','nolimit','CannedAnswer','removeAnswers','addAgents','omit','spread','emit','userWhatsappAccount:save','userWhatsappAccount:remove','getAgents','User','sequelize','transaction','WhatsappApplication','priority','getApplications','notify','Applications','account','orderBy','asc','CmContact','Sequelize','ValidationError','createdAt','difference','updatedAt','CompanyId','ListId','twilio','from','From','whatsapp:','messageId','MessageSid','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','CmList','Contacts','DESC','list','WhatsappInteraction','interaction','created','autoclose','applications','push','unmanaged','WhatsappMessage','ContactId','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','*,*,*,*','startRouting','receiveMessage','entity\x20found','debug','text/xml','\x0a','to\x20is\x20mandatory','List','defaults','out','dataValues','Messages','eml-format','rimraf','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','redis','localhost','socket.io-emitter','./whatsappAccount.socket','jayson/promise','client','http','request','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','get','WhatsappAccounts','stack'];(function(_0x24594d,_0x18cfaa){var _0x215d28=function(_0x2b4c83){while(--_0x2b4c83){_0x24594d['push'](_0x24594d['shift']());}};_0x215d28(++_0x18cfaa);}(_0xb39c,0x136));var _0xcb39=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xb39c[_0x321bb2];return _0x9c12ed;};'use strict';var emlformat=require(_0xcb39('0x0'));var rimraf=require(_0xcb39('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xcb39('0x2'));var rp=require(_0xcb39('0x3'));var moment=require(_0xcb39('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xcb39('0x5'));var path=require(_0xcb39('0x6'));var sox=require(_0xcb39('0x7'));var csv=require(_0xcb39('0x8'));var ejs=require(_0xcb39('0x9'));var fs=require('fs');var fs_extra=require(_0xcb39('0xa'));var _=require('lodash');var squel=require(_0xcb39('0xb'));var crypto=require('crypto');var jsforce=require(_0xcb39('0xc'));var deskjs=require(_0xcb39('0xd'));var toCsv=require(_0xcb39('0x8'));var querystring=require(_0xcb39('0xe'));var Papa=require(_0xcb39('0xf'));var Redis=require(_0xcb39('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xcb39('0x11'));var as=require(_0xcb39('0x12'));var hardwareService=require(_0xcb39('0x13'));var logger=require('../../config/logger')(_0xcb39('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xcb39('0x15'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0xcb39('0x16')],{'host':_0xcb39('0x17'),'port':0x18eb});var socket=require(_0xcb39('0x18'))(new Redis(config['redis']));require(_0xcb39('0x19'))['register'](socket);var jayson=require(_0xcb39('0x1a'));var client=jayson[_0xcb39('0x1b')][_0xcb39('0x1c')]({'port':0x232c});function respondWithRpcPromise(_0x21ccf3,_0x59bd62,_0x476a9b,_0x33aa93){return new BPromise(function(_0x33b116,_0x42c261){var _0x5c8f20=_0x33aa93||client;return _0x5c8f20[_0xcb39('0x1d')](_0x21ccf3,_0x476a9b)['then'](function(_0xba33eb){logger[_0xcb39('0x1e')](_0xcb39('0x1f'),_0x59bd62,_0xcb39('0x20'));logger['debug'](_0xcb39('0x21'),_0x59bd62,_0xcb39('0x20'),JSON[_0xcb39('0x22')](_0xba33eb));if(_0xba33eb[_0xcb39('0x23')]){if(_0xba33eb[_0xcb39('0x23')][_0xcb39('0x24')]===0x1f4){logger[_0xcb39('0x23')](_0xcb39('0x1f'),_0x59bd62,_0xba33eb[_0xcb39('0x23')][_0xcb39('0x25')]);return _0x42c261(_0xba33eb['error'][_0xcb39('0x25')]);}logger[_0xcb39('0x23')](_0xcb39('0x1f'),_0x59bd62,_0xba33eb['error'][_0xcb39('0x25')]);return _0x33b116(_0xba33eb['error'][_0xcb39('0x25')]);}else{logger[_0xcb39('0x1e')](_0xcb39('0x1f'),_0x59bd62,_0xcb39('0x20'));_0x33b116(_0xba33eb[_0xcb39('0x26')][_0xcb39('0x25')]);}})[_0xcb39('0x27')](function(_0x4abef5){logger[_0xcb39('0x23')](_0xcb39('0x1f'),_0x59bd62,_0x4abef5);_0x42c261(_0x4abef5);});});}function respondWithStatusCode(_0x5d44cd,_0x79874){_0x79874=_0x79874||0xcc;return function(_0x16a436){if(_0x16a436){return _0x5d44cd[_0xcb39('0x28')](_0x79874);}return _0x5d44cd['status'](_0x79874)[_0xcb39('0x29')]();};}function respondWithResult(_0x478897,_0xcb6899){_0xcb6899=_0xcb6899||0xc8;return function(_0x3e7eed){if(_0x3e7eed){return _0x478897[_0xcb39('0x2a')](_0xcb6899)[_0xcb39('0x2b')](_0x3e7eed);}};}function respondWithFilteredResult(_0x3e7f7f,_0x11c70a){return function(_0x3807b4){if(_0x3807b4){var _0x22fb20=typeof _0x11c70a[_0xcb39('0x2c')]===_0xcb39('0x2d')&&typeof _0x11c70a[_0xcb39('0x2e')]===_0xcb39('0x2d');var _0x12560f=_0x3807b4[_0xcb39('0x2f')];var _0x5c7421=_0x22fb20?0x0:_0x11c70a['offset'];var _0x25487c=_0x22fb20?_0x3807b4[_0xcb39('0x2f')]:_0x11c70a[_0xcb39('0x2c')]+_0x11c70a[_0xcb39('0x2e')];var _0x57f21f;if(_0x25487c>=_0x12560f){_0x25487c=_0x12560f;_0x57f21f=0xc8;}else{_0x57f21f=0xce;}_0x3e7f7f[_0xcb39('0x2a')](_0x57f21f);return _0x3e7f7f[_0xcb39('0x30')](_0xcb39('0x31'),_0x5c7421+'-'+_0x25487c+'/'+_0x12560f)[_0xcb39('0x2b')](_0x3807b4);}return null;};}function patchUpdates(_0x3186c7){return function(_0x16134a){try{jsonpatch[_0xcb39('0x32')](_0x16134a,_0x3186c7,!![]);}catch(_0x3ad07e){return BPromise['reject'](_0x3ad07e);}return _0x16134a['save']();};}function saveUpdates(_0x183604,_0x1f8718){return function(_0x43d725){if(_0x43d725){return _0x43d725[_0xcb39('0x33')](_0x183604)[_0xcb39('0x34')](function(_0x54ca96){return _0x54ca96;});}return null;};}function removeEntity(_0x6a163d,_0x2f7deb){return function(_0x48e2e4){if(_0x48e2e4){return _0x48e2e4['destroy']()[_0xcb39('0x34')](function(){var _0xf910e7=_0x48e2e4[_0xcb39('0x35')]({'plain':!![]});var _0x12aa0e=_0xcb39('0x36');return db['UserProfileResource']['destroy']({'where':{'type':_0x12aa0e,'resourceId':_0xf910e7['id']}})[_0xcb39('0x34')](function(){return _0x48e2e4;});})[_0xcb39('0x34')](function(){_0x6a163d[_0xcb39('0x2a')](0xcc)[_0xcb39('0x29')]();});}};}function handleEntityNotFound(_0x1b472e,_0x16f50e){return function(_0x56cc3c){if(!_0x56cc3c){_0x1b472e[_0xcb39('0x28')](0x194);}return _0x56cc3c;};}function handleError(_0x492bb5,_0x56d6ad){_0x56d6ad=_0x56d6ad||0x1f4;return function(_0x4d254a){logger[_0xcb39('0x23')](_0x4d254a[_0xcb39('0x37')]);if(_0x4d254a[_0xcb39('0x38')]){delete _0x4d254a['name'];}_0x492bb5['status'](_0x56d6ad)[_0xcb39('0x39')](_0x4d254a);};}exports[_0xcb39('0x3a')]=function(_0x2cef33,_0x11fd6b){var _0x2c281c={'include':[{'model':db['Pause'],'as':_0xcb39('0x3b')}]},_0x2ba7ab={},_0x4e7e22={'count':0x0,'rows':[]};var _0x5402b7=_[_0xcb39('0x3c')](db['WhatsappAccount'][_0xcb39('0x3d')],function(_0x6d0137){return{'name':_0x6d0137[_0xcb39('0x3e')],'type':_0x6d0137[_0xcb39('0x3f')][_0xcb39('0x40')]};});_0x2ba7ab[_0xcb39('0x41')]=_[_0xcb39('0x3c')](_0x5402b7,_0xcb39('0x38'));_0x2ba7ab[_0xcb39('0x42')]=_[_0xcb39('0x43')](_0x2cef33[_0xcb39('0x42')]);_0x2ba7ab['filters']=_['intersection'](_0x2ba7ab[_0xcb39('0x41')],_0x2ba7ab[_0xcb39('0x42')]);_0x2c281c[_0xcb39('0x44')]=_[_0xcb39('0x45')](_0x2ba7ab['model'],qs[_0xcb39('0x46')](_0x2cef33[_0xcb39('0x42')]['fields']));_0x2c281c[_0xcb39('0x44')]=_0x2c281c['attributes'][_0xcb39('0x47')]?_0x2c281c[_0xcb39('0x44')]:_0x2ba7ab[_0xcb39('0x41')];if(!_0x2cef33[_0xcb39('0x42')][_0xcb39('0x48')]('nolimit')){_0x2c281c[_0xcb39('0x2e')]=qs[_0xcb39('0x2e')](_0x2cef33[_0xcb39('0x42')][_0xcb39('0x2e')]);_0x2c281c[_0xcb39('0x2c')]=qs['offset'](_0x2cef33[_0xcb39('0x42')][_0xcb39('0x2c')]);}_0x2c281c[_0xcb39('0x49')]=qs[_0xcb39('0x4a')](_0x2cef33[_0xcb39('0x42')][_0xcb39('0x4a')]);_0x2c281c['where']=qs[_0xcb39('0x4b')](_[_0xcb39('0x4c')](_0x2cef33[_0xcb39('0x42')],_0x2ba7ab[_0xcb39('0x4b')]),_0x5402b7);if(_0x2cef33[_0xcb39('0x42')]['filter']){_0x2c281c['where']=_['merge'](_0x2c281c['where'],{'$or':_['map'](_0x5402b7,function(_0x17279a){if(_0x17279a[_0xcb39('0x3f')]!==_0xcb39('0x4d')){var _0x2f1423={};_0x2f1423[_0x17279a[_0xcb39('0x38')]]={'$like':'%'+_0x2cef33[_0xcb39('0x42')][_0xcb39('0x4e')]+'%'};return _0x2f1423;}})});}_0x2c281c=_['merge']({},_0x2c281c,_0x2cef33[_0xcb39('0x4f')]);var _0x3b5dae={'where':_0x2c281c[_0xcb39('0x50')]};return db[_0xcb39('0x51')][_0xcb39('0x2f')](_0x3b5dae)[_0xcb39('0x34')](function(_0x14ed07){_0x4e7e22[_0xcb39('0x2f')]=_0x14ed07;if(_0x2cef33[_0xcb39('0x42')][_0xcb39('0x52')]){_0x2c281c[_0xcb39('0x53')]=[{'all':!![]}];}return db['WhatsappAccount'][_0xcb39('0x54')](_0x2c281c);})['then'](function(_0x3b3daf){_0x4e7e22['rows']=_0x3b3daf;return _0x4e7e22;})['then'](respondWithFilteredResult(_0x11fd6b,_0x2c281c))[_0xcb39('0x27')](handleError(_0x11fd6b,null));};exports[_0xcb39('0x55')]=function(_0x2d13b5,_0x1e5aaf){var _0x198e27={'raw':![],'where':{'id':_0x2d13b5[_0xcb39('0x56')]['id']},'include':[{'model':db[_0xcb39('0x57')],'as':'mandatoryDispositionPause'}]},_0x33d0cc={};_0x33d0cc['model']=_[_0xcb39('0x43')](db['WhatsappAccount']['rawAttributes']);_0x33d0cc[_0xcb39('0x42')]=_['keys'](_0x2d13b5['query']);_0x33d0cc[_0xcb39('0x4b')]=_['intersection'](_0x33d0cc[_0xcb39('0x41')],_0x33d0cc[_0xcb39('0x42')]);_0x198e27[_0xcb39('0x44')]=_[_0xcb39('0x45')](_0x33d0cc[_0xcb39('0x41')],qs[_0xcb39('0x46')](_0x2d13b5[_0xcb39('0x42')][_0xcb39('0x46')]));_0x198e27['attributes']=_0x198e27['attributes'][_0xcb39('0x47')]?_0x198e27[_0xcb39('0x44')]:_0x33d0cc[_0xcb39('0x41')];if(_0x2d13b5[_0xcb39('0x42')][_0xcb39('0x52')]){_0x198e27[_0xcb39('0x53')]=[{'all':!![]}];}_0x198e27=_[_0xcb39('0x58')]({},_0x198e27,_0x2d13b5[_0xcb39('0x4f')]);return db[_0xcb39('0x51')]['find'](_0x198e27)[_0xcb39('0x34')](handleEntityNotFound(_0x1e5aaf,null))[_0xcb39('0x34')](respondWithResult(_0x1e5aaf,null))['catch'](handleError(_0x1e5aaf,null));};exports[_0xcb39('0x59')]=function(_0x51fbf7,_0x304aac){return db[_0xcb39('0x51')]['create'](_0x51fbf7[_0xcb39('0x5a')],{})['then'](function(_0x2a33fb){var _0x4bf8a5=_0x51fbf7[_0xcb39('0x5b')][_0xcb39('0x35')]({'plain':!![]});if(!_0x4bf8a5)throw new Error(_0xcb39('0x5c'));if(_0x4bf8a5[_0xcb39('0x5d')]===_0xcb39('0x5b')){var _0x5e6ca7=_0x2a33fb[_0xcb39('0x35')]({'plain':!![]});var _0x3a4872=_0xcb39('0x36');return db[_0xcb39('0x5e')][_0xcb39('0x5f')]({'where':{'name':_0x3a4872,'userProfileId':_0x4bf8a5[_0xcb39('0x60')]},'raw':!![]})[_0xcb39('0x34')](function(_0xbf0512){if(_0xbf0512&&_0xbf0512[_0xcb39('0x61')]===0x0){return db[_0xcb39('0x62')][_0xcb39('0x59')]({'name':_0x5e6ca7[_0xcb39('0x38')],'resourceId':_0x5e6ca7['id'],'type':_0xbf0512['name'],'sectionId':_0xbf0512['id']},{})[_0xcb39('0x34')](function(){return _0x2a33fb;});}else{return _0x2a33fb;}})[_0xcb39('0x27')](function(_0x57aa15){logger[_0xcb39('0x23')](_0xcb39('0x63'),_0x57aa15);throw _0x57aa15;});}return _0x2a33fb;})[_0xcb39('0x34')](respondWithResult(_0x304aac,0xc9))['catch'](handleError(_0x304aac,null));};exports[_0xcb39('0x33')]=function(_0x3a06c2,_0x193e21){if(_0x3a06c2['body']['id']){delete _0x3a06c2['body']['id'];}return db[_0xcb39('0x51')][_0xcb39('0x5f')]({'where':{'id':_0x3a06c2['params']['id']},'include':[{'model':db['Pause'],'as':_0xcb39('0x3b')}]})[_0xcb39('0x34')](handleEntityNotFound(_0x193e21,null))[_0xcb39('0x34')](saveUpdates(_0x3a06c2[_0xcb39('0x5a')],null))[_0xcb39('0x34')](respondWithResult(_0x193e21,null))[_0xcb39('0x27')](handleError(_0x193e21,null));};exports[_0xcb39('0x64')]=function(_0x236cd3,_0x306969){return db['WhatsappAccount'][_0xcb39('0x5f')]({'where':{'id':_0x236cd3[_0xcb39('0x56')]['id']}})[_0xcb39('0x34')](handleEntityNotFound(_0x306969,null))['then'](removeEntity(_0x306969,null))[_0xcb39('0x27')](handleError(_0x306969,null));};exports[_0xcb39('0x65')]=function(_0x135177,_0x510930){return db['WhatsappAccount']['describe']()[_0xcb39('0x34')](respondWithResult(_0x510930,null))[_0xcb39('0x27')](handleError(_0x510930,null));};exports[_0xcb39('0x66')]=function(_0x2bcf45,_0x2a93fa,_0x4cfeff){if(_0x2bcf45[_0xcb39('0x5a')]['id']){delete _0x2bcf45['body']['id'];}return db[_0xcb39('0x51')][_0xcb39('0x5f')]({'where':{'id':_0x2bcf45[_0xcb39('0x56')]['id']}})[_0xcb39('0x34')](handleEntityNotFound(_0x2a93fa,null))['then'](function(_0x4fa4de){if(_0x4fa4de){_0x2bcf45[_0xcb39('0x5a')]['WhatsappAccountId']=_0x4fa4de['id'];return db[_0xcb39('0x67')][_0xcb39('0x59')](_0x2bcf45[_0xcb39('0x5a')]);}})[_0xcb39('0x34')](respondWithResult(_0x2a93fa,null))['catch'](handleError(_0x2a93fa,null));};exports[_0xcb39('0x68')]=function(_0x2d1046,_0x534f82,_0x3d74b3){var _0x2db830={'raw':![],'where':{}};var _0x2bb023={};var _0x4c41e6={'count':0x0,'rows':[]};return db['WhatsappAccount'][_0xcb39('0x69')]({'where':{'id':_0x2d1046['params']['id']}})[_0xcb39('0x34')](handleEntityNotFound(_0x534f82,null))['then'](function(_0x59047c){if(_0x59047c){_0x2bb023[_0xcb39('0x41')]=_[_0xcb39('0x43')](db[_0xcb39('0x67')]['rawAttributes']);_0x2bb023[_0xcb39('0x42')]=_['keys'](_0x2d1046[_0xcb39('0x42')]);_0x2bb023[_0xcb39('0x4b')]=_[_0xcb39('0x45')](_0x2bb023[_0xcb39('0x41')],_0x2bb023[_0xcb39('0x42')]);_0x2db830[_0xcb39('0x44')]=_['intersection'](_0x2bb023[_0xcb39('0x41')],qs[_0xcb39('0x46')](_0x2d1046[_0xcb39('0x42')][_0xcb39('0x46')]));_0x2db830['attributes']=_0x2db830['attributes']['length']?_0x2db830['attributes']:_0x2bb023[_0xcb39('0x41')];if(!_0x2d1046[_0xcb39('0x42')]['hasOwnProperty']('nolimit')){_0x2db830['limit']=qs[_0xcb39('0x2e')](_0x2d1046[_0xcb39('0x42')][_0xcb39('0x2e')]);_0x2db830[_0xcb39('0x2c')]=qs[_0xcb39('0x2c')](_0x2d1046[_0xcb39('0x42')][_0xcb39('0x2c')]);}_0x2db830[_0xcb39('0x49')]=qs[_0xcb39('0x4a')](_0x2d1046[_0xcb39('0x42')][_0xcb39('0x4a')]);_0x2db830[_0xcb39('0x50')]=qs[_0xcb39('0x4b')](_['pick'](_0x2d1046[_0xcb39('0x42')],_0x2bb023[_0xcb39('0x4b')]));_0x2db830[_0xcb39('0x50')][_0xcb39('0x6a')]=_0x59047c['id'];if(_0x2d1046['query']['filter']){_0x2db830['where']=_[_0xcb39('0x58')](_0x2db830[_0xcb39('0x50')],{'$or':_[_0xcb39('0x3c')](_0x2db830[_0xcb39('0x44')],function(_0x4f966c){var _0x4078fa={};_0x4078fa[_0x4f966c]={'$like':'%'+_0x2d1046[_0xcb39('0x42')][_0xcb39('0x4e')]+'%'};return _0x4078fa;})});}_0x2db830=_['merge']({},_0x2db830,_0x2d1046[_0xcb39('0x4f')]);return db[_0xcb39('0x67')][_0xcb39('0x2f')]({'where':_0x2db830[_0xcb39('0x50')]})[_0xcb39('0x34')](function(_0xeff42b){_0x4c41e6[_0xcb39('0x2f')]=_0xeff42b;if(_0x2d1046['query']['includeAll']){_0x2db830[_0xcb39('0x53')]=[{'all':!![]}];}return db[_0xcb39('0x67')][_0xcb39('0x54')](_0x2db830);})[_0xcb39('0x34')](function(_0x440b50){_0x4c41e6[_0xcb39('0x6b')]=_0x440b50;return _0x4c41e6;});}})[_0xcb39('0x34')](respondWithFilteredResult(_0x534f82,_0x2db830))[_0xcb39('0x27')](handleError(_0x534f82,null));};exports[_0xcb39('0x6c')]=function(_0x8f4380,_0xdd9b29,_0x1dc394){return db[_0xcb39('0x51')][_0xcb39('0x5f')]({'where':{'id':_0x8f4380[_0xcb39('0x56')]['id']}})[_0xcb39('0x34')](handleEntityNotFound(_0xdd9b29,null))['then'](function(_0x57b5a4){if(_0x57b5a4){return _0x57b5a4[_0xcb39('0x6c')](_0x8f4380['query'][_0xcb39('0x6d')]);}})[_0xcb39('0x34')](respondWithStatusCode(_0xdd9b29,null))[_0xcb39('0x27')](handleError(_0xdd9b29,null));};exports[_0xcb39('0x6e')]=function(_0x322840,_0x5822d0,_0x31c810){if(_0x322840[_0xcb39('0x5a')]['id']){delete _0x322840[_0xcb39('0x5a')]['id'];}return db[_0xcb39('0x51')]['find']({'where':{'id':_0x322840[_0xcb39('0x56')]['id']}})['then'](handleEntityNotFound(_0x5822d0,null))['then'](function(_0x210586){if(_0x210586){_0x322840[_0xcb39('0x5a')]['WhatsappAccountId']=_0x210586['id'];return db['CannedAnswer']['create'](_0x322840[_0xcb39('0x5a')]);}})[_0xcb39('0x34')](respondWithResult(_0x5822d0,null))[_0xcb39('0x27')](handleError(_0x5822d0,null));};exports[_0xcb39('0x6f')]=function(_0x3c87b1,_0x2f3a39,_0x522dba){var _0x14ae87={'raw':![],'where':{}};var _0x17e110={};var _0x49f569={'count':0x0,'rows':[]};return db[_0xcb39('0x51')][_0xcb39('0x69')]({'where':{'id':_0x3c87b1[_0xcb39('0x56')]['id']}})[_0xcb39('0x34')](handleEntityNotFound(_0x2f3a39,null))[_0xcb39('0x34')](function(_0x1dea57){if(_0x1dea57){_0x17e110[_0xcb39('0x41')]=_[_0xcb39('0x43')](db['CannedAnswer']['rawAttributes']);_0x17e110[_0xcb39('0x42')]=_[_0xcb39('0x43')](_0x3c87b1['query']);_0x17e110[_0xcb39('0x4b')]=_[_0xcb39('0x45')](_0x17e110[_0xcb39('0x41')],_0x17e110[_0xcb39('0x42')]);_0x14ae87['attributes']=_[_0xcb39('0x45')](_0x17e110['model'],qs[_0xcb39('0x46')](_0x3c87b1[_0xcb39('0x42')][_0xcb39('0x46')]));_0x14ae87['attributes']=_0x14ae87[_0xcb39('0x44')]['length']?_0x14ae87['attributes']:_0x17e110['model'];if(!_0x3c87b1[_0xcb39('0x42')][_0xcb39('0x48')](_0xcb39('0x70'))){_0x14ae87[_0xcb39('0x2e')]=qs[_0xcb39('0x2e')](_0x3c87b1[_0xcb39('0x42')][_0xcb39('0x2e')]);_0x14ae87['offset']=qs['offset'](_0x3c87b1[_0xcb39('0x42')][_0xcb39('0x2c')]);}_0x14ae87[_0xcb39('0x49')]=qs[_0xcb39('0x4a')](_0x3c87b1[_0xcb39('0x42')]['sort']);_0x14ae87['where']=qs[_0xcb39('0x4b')](_['pick'](_0x3c87b1['query'],_0x17e110[_0xcb39('0x4b')]));_0x14ae87[_0xcb39('0x50')]['WhatsappAccountId']=_0x1dea57['id'];if(_0x3c87b1[_0xcb39('0x42')][_0xcb39('0x4e')]){_0x14ae87['where']=_[_0xcb39('0x58')](_0x14ae87[_0xcb39('0x50')],{'$or':_[_0xcb39('0x3c')](_0x14ae87[_0xcb39('0x44')],function(_0x142a89){var _0x4bc7a0={};_0x4bc7a0[_0x142a89]={'$like':'%'+_0x3c87b1['query'][_0xcb39('0x4e')]+'%'};return _0x4bc7a0;})});}_0x14ae87=_['merge']({},_0x14ae87,_0x3c87b1['options']);return db[_0xcb39('0x71')][_0xcb39('0x2f')]({'where':_0x14ae87[_0xcb39('0x50')]})[_0xcb39('0x34')](function(_0x4d22cd){_0x49f569[_0xcb39('0x2f')]=_0x4d22cd;if(_0x3c87b1[_0xcb39('0x42')]['includeAll']){_0x14ae87[_0xcb39('0x53')]=[{'all':!![]}];}return db[_0xcb39('0x71')]['findAll'](_0x14ae87);})[_0xcb39('0x34')](function(_0x2cf326){_0x49f569[_0xcb39('0x6b')]=_0x2cf326;return _0x49f569;});}})['then'](respondWithFilteredResult(_0x2f3a39,_0x14ae87))[_0xcb39('0x27')](handleError(_0x2f3a39,null));};exports[_0xcb39('0x72')]=function(_0x26174b,_0x2bf4f2,_0x38d113){return db['WhatsappAccount'][_0xcb39('0x5f')]({'where':{'id':_0x26174b[_0xcb39('0x56')]['id']}})[_0xcb39('0x34')](handleEntityNotFound(_0x2bf4f2,null))[_0xcb39('0x34')](function(_0x2034e5){if(_0x2034e5){return _0x2034e5['removeAnswers'](_0x26174b['query'][_0xcb39('0x6d')]);}})['then'](respondWithStatusCode(_0x2bf4f2,null))[_0xcb39('0x27')](handleError(_0x2bf4f2,null));};exports[_0xcb39('0x73')]=function(_0x5ee3ce,_0x1545cb,_0x115db7){return db[_0xcb39('0x51')][_0xcb39('0x5f')]({'where':{'id':_0x5ee3ce[_0xcb39('0x56')]['id']}})[_0xcb39('0x34')](handleEntityNotFound(_0x1545cb,null))['then'](function(_0x2d1380){if(_0x2d1380){return _0x2d1380['addAgents'](_0x5ee3ce[_0xcb39('0x5a')][_0xcb39('0x6d')],_[_0xcb39('0x74')](_0x5ee3ce[_0xcb39('0x5a')],[_0xcb39('0x6d'),'id'])||{})[_0xcb39('0x75')](function(_0x374873){for(var _0x1813de=0x0;_0x1813de<_0x5ee3ce['body'][_0xcb39('0x6d')]['length'];_0x1813de+=0x1){socket[_0xcb39('0x76')](_0xcb39('0x77'),{'UserId':Number(_0x5ee3ce['body'][_0xcb39('0x6d')][_0x1813de]),'WhatsappAccountId':Number(_0x5ee3ce[_0xcb39('0x56')]['id'])});}return _0x374873;});}})[_0xcb39('0x34')](respondWithResult(_0x1545cb,null))[_0xcb39('0x27')](handleError(_0x1545cb,null));};exports['removeAgents']=function(_0x440019,_0x48e695,_0x11a7f2){return db[_0xcb39('0x51')][_0xcb39('0x5f')]({'where':{'id':_0x440019[_0xcb39('0x56')]['id']}})[_0xcb39('0x34')](handleEntityNotFound(_0x48e695,null))[_0xcb39('0x34')](function(_0x22cdab){if(_0x22cdab){return _0x22cdab['removeAgents'](_0x440019['query'][_0xcb39('0x6d')])[_0xcb39('0x34')](function(){if(_['isArray'](_0x440019[_0xcb39('0x42')][_0xcb39('0x6d')])){for(var _0x2c3f20=0x0;_0x2c3f20<_0x440019['query'][_0xcb39('0x6d')]['length'];_0x2c3f20+=0x1){socket[_0xcb39('0x76')](_0xcb39('0x78'),{'UserId':Number(_0x440019[_0xcb39('0x42')]['ids'][_0x2c3f20]),'WhatsappAccountId':Number(_0x440019['params']['id'])});}}else{socket[_0xcb39('0x76')](_0xcb39('0x78'),{'UserId':Number(_0x440019['query'][_0xcb39('0x6d')]),'WhatsappAccountId':Number(_0x440019['params']['id'])});}});}})[_0xcb39('0x34')](respondWithStatusCode(_0x48e695,null))[_0xcb39('0x27')](handleError(_0x48e695,null));};exports[_0xcb39('0x79')]=function(_0x1d5e52,_0xc97c0e,_0x2d4a77){var _0x4297ab={};var _0x11a00f={};var _0x51b414;var _0xc8d057;return db[_0xcb39('0x51')][_0xcb39('0x69')]({'where':{'id':_0x1d5e52['params']['id']}})[_0xcb39('0x34')](handleEntityNotFound(_0xc97c0e,null))[_0xcb39('0x34')](function(_0x6ac93d){if(_0x6ac93d){_0x51b414=_0x6ac93d;_0x11a00f[_0xcb39('0x41')]=_[_0xcb39('0x43')](db[_0xcb39('0x7a')][_0xcb39('0x3d')]);_0x11a00f[_0xcb39('0x42')]=_[_0xcb39('0x43')](_0x1d5e52[_0xcb39('0x42')]);_0x11a00f[_0xcb39('0x4b')]=_[_0xcb39('0x45')](_0x11a00f[_0xcb39('0x41')],_0x11a00f[_0xcb39('0x42')]);_0x4297ab['attributes']=_[_0xcb39('0x45')](_0x11a00f[_0xcb39('0x41')],qs[_0xcb39('0x46')](_0x1d5e52['query'][_0xcb39('0x46')]));_0x4297ab[_0xcb39('0x44')]=_0x4297ab[_0xcb39('0x44')][_0xcb39('0x47')]?_0x4297ab[_0xcb39('0x44')]:_0x11a00f['model'];_0x4297ab[_0xcb39('0x49')]=qs[_0xcb39('0x4a')](_0x1d5e52[_0xcb39('0x42')][_0xcb39('0x4a')]);_0x4297ab[_0xcb39('0x50')]=qs[_0xcb39('0x4b')](_['pick'](_0x1d5e52[_0xcb39('0x42')],_0x11a00f[_0xcb39('0x4b')]));if(_0x1d5e52[_0xcb39('0x42')]['filter']){_0x4297ab[_0xcb39('0x50')]=_[_0xcb39('0x58')](_0x4297ab[_0xcb39('0x50')],{'$or':_['map'](_0x4297ab[_0xcb39('0x44')],function(_0x4e4cba){var _0x39218c={};_0x39218c[_0x4e4cba]={'$like':'%'+_0x1d5e52[_0xcb39('0x42')][_0xcb39('0x4e')]+'%'};return _0x39218c;})});}_0x4297ab=_[_0xcb39('0x58')]({},_0x4297ab,_0x1d5e52[_0xcb39('0x4f')]);return _0x51b414[_0xcb39('0x79')](_0x4297ab);}})[_0xcb39('0x34')](function(_0x3ca77d){if(_0x3ca77d){_0xc8d057=_0x3ca77d[_0xcb39('0x47')];if(!_0x1d5e52['query'][_0xcb39('0x48')]('nolimit')){_0x4297ab[_0xcb39('0x2e')]=qs['limit'](_0x1d5e52[_0xcb39('0x42')][_0xcb39('0x2e')]);_0x4297ab['offset']=qs[_0xcb39('0x2c')](_0x1d5e52[_0xcb39('0x42')][_0xcb39('0x2c')]);}return _0x51b414[_0xcb39('0x79')](_0x4297ab);}})[_0xcb39('0x34')](function(_0x349dc1){if(_0x349dc1){return _0x349dc1?{'count':_0xc8d057,'rows':_0x349dc1}:null;}})[_0xcb39('0x34')](respondWithResult(_0xc97c0e,null))[_0xcb39('0x27')](handleError(_0xc97c0e,null));};exports['addApplications']=function(_0x22c204,_0x17300d,_0x4c47a9){return db[_0xcb39('0x51')][_0xcb39('0x69')]({'where':{'id':_0x22c204[_0xcb39('0x56')]['id']}})['then'](handleEntityNotFound(_0x17300d,null))['then'](function(_0x5b30a0){if(_0x5b30a0){return db[_0xcb39('0x7b')][_0xcb39('0x7c')](function(_0x26d12f){return db['WhatsappApplication']['destroy']({'where':{'WhatsappAccountId':_0x22c204[_0xcb39('0x56')]['id']},'transaction':_0x26d12f})['then'](function(_0x25b4e2){var _0x38d184=_[_0xcb39('0x3c')](_0x22c204[_0xcb39('0x5a')],function(_0x408b04){_0x408b04[_0xcb39('0x6a')]=_0x22c204['params']['id'];return _0x408b04;});return db['WhatsappApplication']['bulkCreate'](_0x38d184,{'transaction':_0x26d12f});});})[_0xcb39('0x34')](function(){return db[_0xcb39('0x7d')]['findAndCountAll']({'where':{'WhatsappAccountId':_0x22c204[_0xcb39('0x56')]['id']},'order':_0xcb39('0x7e')});});}})[_0xcb39('0x34')](respondWithResult(_0x17300d,null))[_0xcb39('0x27')](handleError(_0x17300d,null));};exports['getApplications']=function(_0x2c53ee,_0x7e1b26,_0x815649){var _0x34e8cb={};var _0x1c7116={};var _0x5bbbff;var _0x361946;return db[_0xcb39('0x51')][_0xcb39('0x69')]({'where':{'id':_0x2c53ee['params']['id']}})[_0xcb39('0x34')](handleEntityNotFound(_0x7e1b26,null))[_0xcb39('0x34')](function(_0x1f0569){if(_0x1f0569){_0x5bbbff=_0x1f0569;_0x1c7116['model']=_[_0xcb39('0x43')](db[_0xcb39('0x7d')][_0xcb39('0x3d')]);_0x1c7116['query']=_[_0xcb39('0x43')](_0x2c53ee[_0xcb39('0x42')]);_0x1c7116['filters']=_['intersection'](_0x1c7116[_0xcb39('0x41')],_0x1c7116[_0xcb39('0x42')]);_0x34e8cb['attributes']=_['intersection'](_0x1c7116['model'],qs[_0xcb39('0x46')](_0x2c53ee[_0xcb39('0x42')][_0xcb39('0x46')]));_0x34e8cb[_0xcb39('0x44')]=_0x34e8cb[_0xcb39('0x44')][_0xcb39('0x47')]?_0x34e8cb[_0xcb39('0x44')]:_0x1c7116[_0xcb39('0x41')];_0x34e8cb['order']=qs[_0xcb39('0x4a')](_0x2c53ee[_0xcb39('0x42')][_0xcb39('0x4a')]);_0x34e8cb['where']=qs[_0xcb39('0x4b')](_[_0xcb39('0x4c')](_0x2c53ee[_0xcb39('0x42')],_0x1c7116[_0xcb39('0x4b')]));if(_0x2c53ee[_0xcb39('0x42')][_0xcb39('0x4e')]){_0x34e8cb[_0xcb39('0x50')]=_['merge'](_0x34e8cb[_0xcb39('0x50')],{'$or':_[_0xcb39('0x3c')](_0x34e8cb[_0xcb39('0x44')],function(_0x509556){var _0x4639af={};_0x4639af[_0x509556]={'$like':'%'+_0x2c53ee['query'][_0xcb39('0x4e')]+'%'};return _0x4639af;})});}_0x34e8cb=_['merge']({},_0x34e8cb,_0x2c53ee[_0xcb39('0x4f')]);return _0x5bbbff[_0xcb39('0x7f')](_0x34e8cb);}})['then'](function(_0x103502){if(_0x103502){_0x361946=_0x103502[_0xcb39('0x47')];if(!_0x2c53ee[_0xcb39('0x42')][_0xcb39('0x48')](_0xcb39('0x70'))){_0x34e8cb['limit']=qs[_0xcb39('0x2e')](_0x2c53ee[_0xcb39('0x42')][_0xcb39('0x2e')]);_0x34e8cb[_0xcb39('0x2c')]=qs[_0xcb39('0x2c')](_0x2c53ee[_0xcb39('0x42')][_0xcb39('0x2c')]);}return _0x5bbbff[_0xcb39('0x7f')](_0x34e8cb);}})[_0xcb39('0x34')](function(_0x372b35){if(_0x372b35){return _0x372b35?{'count':_0x361946,'rows':_0x372b35}:null;}})['then'](respondWithResult(_0x7e1b26,null))['catch'](handleError(_0x7e1b26,null));};exports[_0xcb39('0x80')]=function(_0x13b22a,_0x58fb25,_0x55a3e2){var _0x99194d={'channel':'whatsapp'};var _0x363ab1=[];var _0x4997be=[];var _0x26e093={};return db[_0xcb39('0x51')]['find']({'where':{'id':_0x13b22a[_0xcb39('0x56')]['id']},'include':[{'model':db[_0xcb39('0x7d')],'as':_0xcb39('0x81')}]})[_0xcb39('0x34')](handleEntityNotFound(_0x58fb25,null))['then'](function(_0x3920a2){_0x99194d[_0xcb39('0x82')]=_0x3920a2;_0x99194d['applications']=_[_0xcb39('0x83')](_0x3920a2[_0xcb39('0x81')],[_0xcb39('0x7e')],[_0xcb39('0x84')]);if(_0x99194d[_0xcb39('0x82')][_0xcb39('0x81')]){delete _0x99194d['account'][_0xcb39('0x81')];}return db[_0xcb39('0x85')][_0xcb39('0x65')]();})[_0xcb39('0x34')](function(_0x229c9e){if(!_0x229c9e){throw new db[(_0xcb39('0x86'))][(_0xcb39('0x87'))]('no\x20available\x20attributes');}_0x363ab1=_['difference'](_['keys'](_0x229c9e),[_0xcb39('0x88'),'updatedAt']);_0x4997be=_[_0xcb39('0x89')](_[_0xcb39('0x43')](_0x229c9e),[_0xcb39('0x88'),_0xcb39('0x8a'),_0xcb39('0x8b'),_0xcb39('0x8c')]);_0x99194d[_0xcb39('0x5a')]={'mapKey':'mobile'};if(_0x99194d[_0xcb39('0x82')][_0xcb39('0x3f')]&&_0x99194d[_0xcb39('0x82')][_0xcb39('0x3f')]===_0xcb39('0x8d')){_0x99194d['body'][_0xcb39('0x8e')]=_0x13b22a[_0xcb39('0x5a')][_0xcb39('0x8f')]['replace'](_0xcb39('0x90'),'');_0x99194d['body'][_0xcb39('0x5a')]=_0x13b22a[_0xcb39('0x5a')]['Body'];_0x99194d[_0xcb39('0x5a')][_0xcb39('0x91')]=_0x13b22a[_0xcb39('0x5a')][_0xcb39('0x92')];}if(_0x99194d[_0xcb39('0x5a')]['id']){delete _0x99194d[_0xcb39('0x5a')]['id'];}if(_['isNil'](_0x99194d[_0xcb39('0x5a')][_0xcb39('0x8e')])){throw new db[(_0xcb39('0x86'))][(_0xcb39('0x87'))](_0xcb39('0x93'));}if(_[_0xcb39('0x94')](_0x99194d[_0xcb39('0x5a')][_0xcb39('0x5a')])||_0x99194d['body']['body']===''){throw new db['Sequelize'][(_0xcb39('0x87'))](_0xcb39('0x95'));}if(_[_0xcb39('0x94')](_0x99194d['body']['mapKey'])){throw new db['Sequelize'][(_0xcb39('0x87'))](_0xcb39('0x96')+_0x4997be);}if(!_['includes'](_0x4997be,_0x99194d[_0xcb39('0x5a')][_0xcb39('0x97')])){throw new db['Sequelize'][(_0xcb39('0x87'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4997be);}_0x26e093[_0x99194d[_0xcb39('0x5a')][_0xcb39('0x97')]]=_0x99194d['body'][_0xcb39('0x8e')];return db[_0xcb39('0x98')][_0xcb39('0x5f')]({'where':{'id':_0x99194d['account']['ListId']},'include':[{'model':db[_0xcb39('0x85')],'as':_0xcb39('0x99'),'where':_0x26e093,'limit':0x1,'order':[[_0xcb39('0x8a'),_0xcb39('0x9a')]]}]});})[_0xcb39('0x34')](handleEntityNotFound(_0x58fb25,null))[_0xcb39('0x34')](function(_0x39fc72){if(_0x39fc72){_0x99194d[_0xcb39('0x9b')]=_[_0xcb39('0x74')](_0x39fc72,['Contacts']);if(_0x39fc72[_0xcb39('0x99')][_0xcb39('0x47')]){return _0x39fc72['Contacts'][0x0];}var _0x37fc7f=_['defaults'](_0x99194d[_0xcb39('0x5a')],{'firstName':_0x99194d[_0xcb39('0x5a')][_0xcb39('0x8e')],'ListId':_0x39fc72['id']});_0x37fc7f[_0x99194d[_0xcb39('0x5a')][_0xcb39('0x97')]]=_0x99194d['body'][_0xcb39('0x8e')];return db[_0xcb39('0x85')][_0xcb39('0x59')](_0x37fc7f,{'fields':_0x363ab1,'raw':!![]});}})['then'](handleEntityNotFound(_0x58fb25,null))[_0xcb39('0x34')](function(_0x5353c5){if(_0x5353c5){_0x99194d['contact']=_0x5353c5;var _0x56800d={'ContactId':_0x5353c5['id'],'phone':_0x99194d[_0xcb39('0x5a')]['from'],'WhatsappAccountId':_0x13b22a[_0xcb39('0x56')]['id']};var _0x34488e={'ContactId':_0x5353c5['id'],'WhatsappAccountId':_0x13b22a[_0xcb39('0x56')]['id'],'closed':![]};return db['WhatsappInteraction'][_0xcb39('0x5f')]({'where':_0x34488e})['then'](function(_0x1584c7){if(_0x1584c7){return[_0x1584c7,![]];}return db[_0xcb39('0x9c')][_0xcb39('0x59')](_0x56800d)[_0xcb39('0x34')](function(_0x40e842){return[_0x40e842,!![]];});});}})[_0xcb39('0x75')](function(_0x252b5b,_0x139b2c){_0x99194d[_0xcb39('0x9d')]=_0x252b5b[_0xcb39('0x35')]({'plain':!![]});_0x99194d['interaction'][_0xcb39('0x9e')]=![];if(_0x139b2c){if(_0x99194d[_0xcb39('0x82')][_0xcb39('0x9f')]){_0x99194d[_0xcb39('0xa0')][_0xcb39('0xa1')]({'id':0x0,'priority':_0x99194d[_0xcb39('0xa0')]['length']+0x1,'app':'close','appdata':_0xcb39('0xa2'),'interval':'*,*,*,*'});}_0x99194d['interaction'][_0xcb39('0x9e')]=!![];}return db[_0xcb39('0xa3')][_0xcb39('0x59')]({'phone':_0x99194d[_0xcb39('0x5a')][_0xcb39('0x8e')],'messageId':_0x99194d[_0xcb39('0x5a')]['messageId'],'body':_0x99194d[_0xcb39('0x5a')]['body'],'WhatsappAccountId':_0x13b22a[_0xcb39('0x56')]['id'],'WhatsappInteractionId':_0x252b5b['id'],'direction':'in','ContactId':_0x252b5b[_0xcb39('0xa4')],'AttachmentId':_0x99194d['body'][_0xcb39('0xa5')]});})[_0xcb39('0x34')](function(_0x18b38b){_0x99194d[_0xcb39('0x25')]=_0x18b38b;if(_0x99194d[_0xcb39('0x9d')][_0xcb39('0xa6')]){return db[_0xcb39('0x7a')]['find']({'attributes':['id',_0xcb39('0x38')],'where':{'id':_0x99194d[_0xcb39('0x9d')]['UserId']}})['then'](function(_0x252535){if(_0x252535){_0x99194d[_0xcb39('0xa0')][_0xcb39('0xa7')]({'id':0x0,'priority':0x0,'app':_0xcb39('0xa8'),'appdata':_0x252535[_0xcb39('0x38')]+','+(_0x99194d[_0xcb39('0x82')][_0xcb39('0xa9')]||0xa),'interval':_0xcb39('0xaa')});}return respondWithRpcPromise('Start',_0xcb39('0xab'),_0x99194d);});}return respondWithRpcPromise('Start',_0xcb39('0xab'),_0x99194d);})['then'](function(_0x22cd88){if(_0x22cd88){var _0x2097fc=0xc8;var _0x4517c6=_0xcb39('0xac');logger['info'](_0xcb39('0x21'),_0x4517c6,_0x2097fc,_0xcb39('0xad'));logger[_0xcb39('0xae')]('WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x4517c6,_0x2097fc,_0xcb39('0xad'),JSON[_0xcb39('0x22')](_0x22cd88));if(_0x99194d[_0xcb39('0x82')][_0xcb39('0x3f')]===_0xcb39('0x8d')){return _0x58fb25[_0xcb39('0x2a')](_0x2097fc)[_0xcb39('0x30')]('Content-Type',_0xcb39('0xaf'))[_0xcb39('0x39')](_0xcb39('0xb0'));}else{return _0x58fb25[_0xcb39('0x2a')](_0x2097fc)[_0xcb39('0x2b')](_0x22cd88);}}})['catch'](handleError(_0x58fb25,null));};exports[_0xcb39('0x39')]=function(_0x1dd64b,_0x20f6e4,_0x56f1b0){var _0xdf155,_0x14c649,_0x4e110b;if(_[_0xcb39('0x94')](_0x1dd64b['body'][_0xcb39('0x5a')])||_0x1dd64b[_0xcb39('0x5a')][_0xcb39('0x5a')]===''){throw new db[(_0xcb39('0x86'))]['ValidationError'](_0xcb39('0x95'));}if(_[_0xcb39('0x94')](_0x1dd64b[_0xcb39('0x5a')]['to'])){throw new db[(_0xcb39('0x86'))][(_0xcb39('0x87'))](_0xcb39('0xb1'));}_0xdf155=_0x1dd64b[_0xcb39('0x5a')]['to'];return db['WhatsappAccount'][_0xcb39('0x5f')]({'where':{'id':_0x1dd64b[_0xcb39('0x56')]['id']},'include':[{'model':db['CmList'],'as':_0xcb39('0xb2'),'include':[{'model':db['CmContact'],'as':_0xcb39('0x99'),'where':{'mobile':_0xdf155},'limit':0x1,'order':[[_0xcb39('0x8a'),_0xcb39('0x9a')]]}]}]})[_0xcb39('0x34')](handleEntityNotFound(_0x20f6e4,null))[_0xcb39('0x34')](function(_0x2f9f80){if(_0x2f9f80&&_0x2f9f80[_0xcb39('0xb2')]){_0x14c649=_0x2f9f80[_0xcb39('0x35')]({'plain':!![]});if(_0x14c649[_0xcb39('0xb2')]&&_0x14c649['List']['Contacts'][_0xcb39('0x47')]){return _0x14c649['List']['Contacts'][0x0];}return db[_0xcb39('0x85')]['create'](_[_0xcb39('0xb3')](_0x1dd64b[_0xcb39('0x5a')],{'firstName':_0xdf155,'mobile':_0xdf155,'phone':_0xdf155,'ListId':_0x14c649[_0xcb39('0x8c')]}));}})['then'](handleEntityNotFound(_0x20f6e4,null))['then'](function(_0xd14169){if(_0xd14169){_0x4e110b=_0xd14169;return db[_0xcb39('0x9c')][_0xcb39('0x5f')]({'where':{'ContactId':_0x4e110b['id'],'closed':![],'WhatsappAccountId':_0x14c649['id']}})[_0xcb39('0x34')](function(_0x4bcfa1){if(_0x4bcfa1){return[_0x4bcfa1,![]];}return db[_0xcb39('0x9c')][_0xcb39('0x59')]({'UserId':_0x1dd64b[_0xcb39('0x5b')]['id'],'ContactId':_0x4e110b['id'],'WhatsappAccountId':_0x14c649['id'],'phone':_0xdf155,'firstMsgDirection':_0xcb39('0xb4'),'Messages':[_[_0xcb39('0x58')](_0x1dd64b[_0xcb39('0x5a')],{'read':![],'body':_0x1dd64b[_0xcb39('0x5a')][_0xcb39('0x5a')],'phone':_0xdf155,'WhatsappAccountId':_0x14c649['id'],'UserId':_0x1dd64b[_0xcb39('0x5b')]['id'],'ContactId':_0x4e110b['id']})]},{'include':[{'model':db[_0xcb39('0xa3')],'as':'Messages'}]})[_0xcb39('0x34')](function(_0x1b9883){return[_0x1b9883,!![]];});});}})[_0xcb39('0x75')](function(_0x12217b,_0x52d77){if(_0x52d77){return _0x12217b;}return db['WhatsappMessage'][_0xcb39('0x59')](_[_0xcb39('0x58')](_0x1dd64b[_0xcb39('0x5a')],{'read':![],'body':_0x1dd64b[_0xcb39('0x5a')][_0xcb39('0x5a')],'phone':_0xdf155,'WhatsappAccountId':_0x14c649['id'],'WhatsappInteractionId':_0x12217b['id'],'UserId':_0x1dd64b[_0xcb39('0x5b')]['id'],'ContactId':_0x4e110b['id']}))[_0xcb39('0x34')](function(_0x1acaa9){_0x12217b[_0xcb39('0xb5')][_0xcb39('0xb6')]=[];_0x12217b[_0xcb39('0xb5')][_0xcb39('0xb6')]['push'](_0x1acaa9['dataValues']);return _0x12217b;});})[_0xcb39('0x34')](respondWithResult(_0x20f6e4,null))[_0xcb39('0x27')](handleError(_0x20f6e4,null));}; \ No newline at end of file +var _0x951f=['length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','include','findAll','rows','show','merge','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','params','describe','addDisposition','Disposition','getDispositions','findOne','pick','WhatsappAccountId','options','includeAll','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addAgents','omit','spread','emit','userWhatsappAccount:save','removeAgents','isArray','userWhatsappAccount:remove','getAgents','User','addApplications','sequelize','transaction','WhatsappApplication','bulkCreate','findAndCountAll','priority','getApplications','notify','whatsapp','Applications','account','applications','orderBy','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','From','replace','whatsapp:','Body','messageId','MessageSid','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','list','interaction','autoclose','push','unmanaged','created','WhatsappMessage','ContactId','UserId','Start','startRouting','receiveMessage','entity\x20found','WhatsappAccount,\x20%s,\x20%s,\x20%s,\x20%s','Content-Type','send','to\x20is\x20mandatory','List','WhatsappInteraction','out','Messages','dataValues','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','jayson/promise','client','request','then','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','get','WhatsappAccounts','UserProfileResource','stack','name','Pause','mandatoryDispositionPause','map','WhatsappAccount','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes'];(function(_0x511a17,_0x203ada){var _0xfca535=function(_0x35e4de){while(--_0x35e4de){_0x511a17['push'](_0x511a17['shift']());}};_0xfca535(++_0x203ada);}(_0x951f,0x12c));var _0xf951=function(_0x29d915,_0x54a040){_0x29d915=_0x29d915-0x0;var _0x160f86=_0x951f[_0x29d915];return _0x160f86;};'use strict';var emlformat=require(_0xf951('0x0'));var rimraf=require(_0xf951('0x1'));var zipdir=require(_0xf951('0x2'));var jsonpatch=require(_0xf951('0x3'));var rp=require(_0xf951('0x4'));var moment=require(_0xf951('0x5'));var BPromise=require(_0xf951('0x6'));var Mustache=require(_0xf951('0x7'));var util=require(_0xf951('0x8'));var path=require('path');var sox=require(_0xf951('0x9'));var csv=require(_0xf951('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xf951('0xb'));var squel=require(_0xf951('0xc'));var crypto=require(_0xf951('0xd'));var jsforce=require(_0xf951('0xe'));var deskjs=require(_0xf951('0xf'));var toCsv=require(_0xf951('0xa'));var querystring=require(_0xf951('0x10'));var Papa=require('papaparse');var Redis=require(_0xf951('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xf951('0x12'));var hardwareService=require(_0xf951('0x13'));var logger=require(_0xf951('0x14'))(_0xf951('0x15'));var utils=require(_0xf951('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xf951('0x17'));var db=require(_0xf951('0x18'))['db'];config['redis']=_[_0xf951('0x19')](config[_0xf951('0x1a')],{'host':_0xf951('0x1b'),'port':0x18eb});var socket=require(_0xf951('0x1c'))(new Redis(config['redis']));require('./whatsappAccount.socket')[_0xf951('0x1d')](socket);var jayson=require(_0xf951('0x1e'));var client=jayson[_0xf951('0x1f')]['http']({'port':0x232c});function respondWithRpcPromise(_0x17c11d,_0x2c74c1,_0x2919a2,_0x450e86){return new BPromise(function(_0x1350b0,_0x30a689){var _0x3b2c5a=_0x450e86||client;return _0x3b2c5a[_0xf951('0x20')](_0x17c11d,_0x2919a2)[_0xf951('0x21')](function(_0x12351a){logger[_0xf951('0x22')](_0xf951('0x23'),_0x2c74c1,_0xf951('0x24'));logger[_0xf951('0x25')](_0xf951('0x26'),_0x2c74c1,_0xf951('0x24'),JSON[_0xf951('0x27')](_0x12351a));if(_0x12351a[_0xf951('0x28')]){if(_0x12351a[_0xf951('0x28')]['code']===0x1f4){logger[_0xf951('0x28')](_0xf951('0x23'),_0x2c74c1,_0x12351a['error'][_0xf951('0x29')]);return _0x30a689(_0x12351a[_0xf951('0x28')][_0xf951('0x29')]);}logger['error'](_0xf951('0x23'),_0x2c74c1,_0x12351a[_0xf951('0x28')][_0xf951('0x29')]);return _0x1350b0(_0x12351a[_0xf951('0x28')][_0xf951('0x29')]);}else{logger[_0xf951('0x22')](_0xf951('0x23'),_0x2c74c1,_0xf951('0x24'));_0x1350b0(_0x12351a[_0xf951('0x2a')][_0xf951('0x29')]);}})[_0xf951('0x2b')](function(_0x554b64){logger[_0xf951('0x28')](_0xf951('0x23'),_0x2c74c1,_0x554b64);_0x30a689(_0x554b64);});});}function respondWithStatusCode(_0x19d7c2,_0x41cd2d){_0x41cd2d=_0x41cd2d||0xcc;return function(_0x937ed0){if(_0x937ed0){return _0x19d7c2[_0xf951('0x2c')](_0x41cd2d);}return _0x19d7c2[_0xf951('0x2d')](_0x41cd2d)[_0xf951('0x2e')]();};}function respondWithResult(_0x4f147b,_0x180934){_0x180934=_0x180934||0xc8;return function(_0x567b17){if(_0x567b17){return _0x4f147b[_0xf951('0x2d')](_0x180934)[_0xf951('0x2f')](_0x567b17);}};}function respondWithFilteredResult(_0x5b7c91,_0x5b5e5a){return function(_0x1a94d1){if(_0x1a94d1){var _0x8e5d01=typeof _0x5b5e5a[_0xf951('0x30')]===_0xf951('0x31')&&typeof _0x5b5e5a[_0xf951('0x32')]===_0xf951('0x31');var _0xf398d6=_0x1a94d1[_0xf951('0x33')];var _0x160ca7=_0x8e5d01?0x0:_0x5b5e5a['offset'];var _0x204c3a=_0x8e5d01?_0x1a94d1[_0xf951('0x33')]:_0x5b5e5a[_0xf951('0x30')]+_0x5b5e5a['limit'];var _0x4076f4;if(_0x204c3a>=_0xf398d6){_0x204c3a=_0xf398d6;_0x4076f4=0xc8;}else{_0x4076f4=0xce;}_0x5b7c91[_0xf951('0x2d')](_0x4076f4);return _0x5b7c91[_0xf951('0x34')](_0xf951('0x35'),_0x160ca7+'-'+_0x204c3a+'/'+_0xf398d6)[_0xf951('0x2f')](_0x1a94d1);}return null;};}function patchUpdates(_0x42d1c0){return function(_0x58c8ed){try{jsonpatch[_0xf951('0x36')](_0x58c8ed,_0x42d1c0,!![]);}catch(_0x22b364){return BPromise[_0xf951('0x37')](_0x22b364);}return _0x58c8ed[_0xf951('0x38')]();};}function saveUpdates(_0x4134ba,_0x3f7310){return function(_0x38be69){if(_0x38be69){return _0x38be69['update'](_0x4134ba)[_0xf951('0x21')](function(_0x28f0ab){return _0x28f0ab;});}return null;};}function removeEntity(_0x13e3b9,_0x35476f){return function(_0x49c7c0){if(_0x49c7c0){return _0x49c7c0[_0xf951('0x39')]()['then'](function(){var _0x55cac0=_0x49c7c0[_0xf951('0x3a')]({'plain':!![]});var _0x50c02e=_0xf951('0x3b');return db[_0xf951('0x3c')][_0xf951('0x39')]({'where':{'type':_0x50c02e,'resourceId':_0x55cac0['id']}})['then'](function(){return _0x49c7c0;});})[_0xf951('0x21')](function(){_0x13e3b9[_0xf951('0x2d')](0xcc)[_0xf951('0x2e')]();});}};}function handleEntityNotFound(_0x484d50,_0x3580cc){return function(_0x5c404c){if(!_0x5c404c){_0x484d50[_0xf951('0x2c')](0x194);}return _0x5c404c;};}function handleError(_0x24f834,_0x4a3ff6){_0x4a3ff6=_0x4a3ff6||0x1f4;return function(_0x3eb498){logger['error'](_0x3eb498[_0xf951('0x3d')]);if(_0x3eb498['name']){delete _0x3eb498[_0xf951('0x3e')];}_0x24f834[_0xf951('0x2d')](_0x4a3ff6)['send'](_0x3eb498);};}exports['index']=function(_0x179a7c,_0x2398a2){var _0x24d142={'include':[{'model':db[_0xf951('0x3f')],'as':_0xf951('0x40')}]},_0x2d0ba5={},_0x4f22a4={'count':0x0,'rows':[]};var _0x26df84=_[_0xf951('0x41')](db[_0xf951('0x42')][_0xf951('0x43')],function(_0x4e3df2){return{'name':_0x4e3df2[_0xf951('0x44')],'type':_0x4e3df2[_0xf951('0x45')][_0xf951('0x46')]};});_0x2d0ba5['model']=_['map'](_0x26df84,_0xf951('0x3e'));_0x2d0ba5[_0xf951('0x47')]=_[_0xf951('0x48')](_0x179a7c['query']);_0x2d0ba5[_0xf951('0x49')]=_[_0xf951('0x4a')](_0x2d0ba5[_0xf951('0x4b')],_0x2d0ba5[_0xf951('0x47')]);_0x24d142['attributes']=_[_0xf951('0x4a')](_0x2d0ba5[_0xf951('0x4b')],qs[_0xf951('0x4c')](_0x179a7c['query']['fields']));_0x24d142[_0xf951('0x4d')]=_0x24d142['attributes'][_0xf951('0x4e')]?_0x24d142[_0xf951('0x4d')]:_0x2d0ba5[_0xf951('0x4b')];if(!_0x179a7c[_0xf951('0x47')][_0xf951('0x4f')](_0xf951('0x50'))){_0x24d142[_0xf951('0x32')]=qs['limit'](_0x179a7c['query'][_0xf951('0x32')]);_0x24d142['offset']=qs[_0xf951('0x30')](_0x179a7c[_0xf951('0x47')][_0xf951('0x30')]);}_0x24d142[_0xf951('0x51')]=qs['sort'](_0x179a7c[_0xf951('0x47')][_0xf951('0x52')]);_0x24d142[_0xf951('0x53')]=qs[_0xf951('0x49')](_['pick'](_0x179a7c['query'],_0x2d0ba5[_0xf951('0x49')]),_0x26df84);if(_0x179a7c[_0xf951('0x47')][_0xf951('0x54')]){_0x24d142[_0xf951('0x53')]=_['merge'](_0x24d142[_0xf951('0x53')],{'$or':_[_0xf951('0x41')](_0x26df84,function(_0x32daa6){if(_0x32daa6[_0xf951('0x45')]!==_0xf951('0x55')){var _0x5bdef9={};_0x5bdef9[_0x32daa6[_0xf951('0x3e')]]={'$like':'%'+_0x179a7c[_0xf951('0x47')]['filter']+'%'};return _0x5bdef9;}})});}_0x24d142=_['merge']({},_0x24d142,_0x179a7c['options']);var _0x49939c={'where':_0x24d142[_0xf951('0x53')]};return db[_0xf951('0x42')]['count'](_0x49939c)[_0xf951('0x21')](function(_0xc632){_0x4f22a4['count']=_0xc632;if(_0x179a7c[_0xf951('0x47')]['includeAll']){_0x24d142[_0xf951('0x56')]=[{'all':!![]}];}return db[_0xf951('0x42')][_0xf951('0x57')](_0x24d142);})['then'](function(_0x5c81fd){_0x4f22a4[_0xf951('0x58')]=_0x5c81fd;return _0x4f22a4;})[_0xf951('0x21')](respondWithFilteredResult(_0x2398a2,_0x24d142))[_0xf951('0x2b')](handleError(_0x2398a2,null));};exports[_0xf951('0x59')]=function(_0x537526,_0x426854){var _0x4d2994={'raw':![],'where':{'id':_0x537526['params']['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x19f041={};_0x19f041[_0xf951('0x4b')]=_['keys'](db[_0xf951('0x42')]['rawAttributes']);_0x19f041[_0xf951('0x47')]=_[_0xf951('0x48')](_0x537526[_0xf951('0x47')]);_0x19f041['filters']=_['intersection'](_0x19f041[_0xf951('0x4b')],_0x19f041[_0xf951('0x47')]);_0x4d2994[_0xf951('0x4d')]=_[_0xf951('0x4a')](_0x19f041[_0xf951('0x4b')],qs[_0xf951('0x4c')](_0x537526[_0xf951('0x47')]['fields']));_0x4d2994[_0xf951('0x4d')]=_0x4d2994[_0xf951('0x4d')][_0xf951('0x4e')]?_0x4d2994[_0xf951('0x4d')]:_0x19f041['model'];if(_0x537526[_0xf951('0x47')]['includeAll']){_0x4d2994[_0xf951('0x56')]=[{'all':!![]}];}_0x4d2994=_[_0xf951('0x5a')]({},_0x4d2994,_0x537526['options']);return db[_0xf951('0x42')][_0xf951('0x5b')](_0x4d2994)[_0xf951('0x21')](handleEntityNotFound(_0x426854,null))[_0xf951('0x21')](respondWithResult(_0x426854,null))[_0xf951('0x2b')](handleError(_0x426854,null));};exports[_0xf951('0x5c')]=function(_0xa6a3cc,_0x3186f4){return db[_0xf951('0x42')][_0xf951('0x5c')](_0xa6a3cc['body'],{})[_0xf951('0x21')](function(_0x5be125){var _0x4d9c3b=_0xa6a3cc[_0xf951('0x5d')][_0xf951('0x3a')]({'plain':!![]});if(!_0x4d9c3b)throw new Error(_0xf951('0x5e'));if(_0x4d9c3b[_0xf951('0x5f')]===_0xf951('0x5d')){var _0x480f58=_0x5be125[_0xf951('0x3a')]({'plain':!![]});var _0x9a1e21=_0xf951('0x3b');return db[_0xf951('0x60')][_0xf951('0x5b')]({'where':{'name':_0x9a1e21,'userProfileId':_0x4d9c3b['userProfileId']},'raw':!![]})[_0xf951('0x21')](function(_0x55578c){if(_0x55578c&&_0x55578c[_0xf951('0x61')]===0x0){return db[_0xf951('0x3c')]['create']({'name':_0x480f58[_0xf951('0x3e')],'resourceId':_0x480f58['id'],'type':_0x55578c[_0xf951('0x3e')],'sectionId':_0x55578c['id']},{})['then'](function(){return _0x5be125;});}else{return _0x5be125;}})[_0xf951('0x2b')](function(_0x1b0e7e){logger[_0xf951('0x28')](_0xf951('0x62'),_0x1b0e7e);throw _0x1b0e7e;});}return _0x5be125;})[_0xf951('0x21')](respondWithResult(_0x3186f4,0xc9))['catch'](handleError(_0x3186f4,null));};exports[_0xf951('0x63')]=function(_0x58c5ac,_0x5068c0){if(_0x58c5ac[_0xf951('0x64')]['id']){delete _0x58c5ac[_0xf951('0x64')]['id'];}return db[_0xf951('0x42')][_0xf951('0x5b')]({'where':{'id':_0x58c5ac[_0xf951('0x65')]['id']},'include':[{'model':db[_0xf951('0x3f')],'as':_0xf951('0x40')}]})['then'](handleEntityNotFound(_0x5068c0,null))[_0xf951('0x21')](saveUpdates(_0x58c5ac[_0xf951('0x64')],null))[_0xf951('0x21')](respondWithResult(_0x5068c0,null))[_0xf951('0x2b')](handleError(_0x5068c0,null));};exports['destroy']=function(_0x3d4cf1,_0x298df0){return db[_0xf951('0x42')][_0xf951('0x5b')]({'where':{'id':_0x3d4cf1[_0xf951('0x65')]['id']}})['then'](handleEntityNotFound(_0x298df0,null))['then'](removeEntity(_0x298df0,null))[_0xf951('0x2b')](handleError(_0x298df0,null));};exports[_0xf951('0x66')]=function(_0x2c8961,_0x1f9509){return db['WhatsappAccount']['describe']()[_0xf951('0x21')](respondWithResult(_0x1f9509,null))[_0xf951('0x2b')](handleError(_0x1f9509,null));};exports[_0xf951('0x67')]=function(_0x17653b,_0x192291,_0x2f1d24){if(_0x17653b[_0xf951('0x64')]['id']){delete _0x17653b[_0xf951('0x64')]['id'];}return db[_0xf951('0x42')][_0xf951('0x5b')]({'where':{'id':_0x17653b[_0xf951('0x65')]['id']}})['then'](handleEntityNotFound(_0x192291,null))[_0xf951('0x21')](function(_0x3e4853){if(_0x3e4853){_0x17653b[_0xf951('0x64')]['WhatsappAccountId']=_0x3e4853['id'];return db[_0xf951('0x68')][_0xf951('0x5c')](_0x17653b[_0xf951('0x64')]);}})[_0xf951('0x21')](respondWithResult(_0x192291,null))[_0xf951('0x2b')](handleError(_0x192291,null));};exports[_0xf951('0x69')]=function(_0x889455,_0xe865ee,_0x3c3bf7){var _0x4d59be={'raw':![],'where':{}};var _0x3f5910={};var _0x390124={'count':0x0,'rows':[]};return db[_0xf951('0x42')][_0xf951('0x6a')]({'where':{'id':_0x889455[_0xf951('0x65')]['id']}})[_0xf951('0x21')](handleEntityNotFound(_0xe865ee,null))['then'](function(_0x463c0d){if(_0x463c0d){_0x3f5910['model']=_[_0xf951('0x48')](db[_0xf951('0x68')][_0xf951('0x43')]);_0x3f5910[_0xf951('0x47')]=_['keys'](_0x889455['query']);_0x3f5910[_0xf951('0x49')]=_[_0xf951('0x4a')](_0x3f5910[_0xf951('0x4b')],_0x3f5910[_0xf951('0x47')]);_0x4d59be[_0xf951('0x4d')]=_['intersection'](_0x3f5910['model'],qs[_0xf951('0x4c')](_0x889455[_0xf951('0x47')][_0xf951('0x4c')]));_0x4d59be['attributes']=_0x4d59be['attributes']['length']?_0x4d59be[_0xf951('0x4d')]:_0x3f5910[_0xf951('0x4b')];if(!_0x889455[_0xf951('0x47')]['hasOwnProperty'](_0xf951('0x50'))){_0x4d59be[_0xf951('0x32')]=qs['limit'](_0x889455[_0xf951('0x47')][_0xf951('0x32')]);_0x4d59be[_0xf951('0x30')]=qs['offset'](_0x889455[_0xf951('0x47')][_0xf951('0x30')]);}_0x4d59be[_0xf951('0x51')]=qs['sort'](_0x889455[_0xf951('0x47')][_0xf951('0x52')]);_0x4d59be['where']=qs['filters'](_[_0xf951('0x6b')](_0x889455[_0xf951('0x47')],_0x3f5910[_0xf951('0x49')]));_0x4d59be[_0xf951('0x53')][_0xf951('0x6c')]=_0x463c0d['id'];if(_0x889455[_0xf951('0x47')][_0xf951('0x54')]){_0x4d59be['where']=_[_0xf951('0x5a')](_0x4d59be[_0xf951('0x53')],{'$or':_['map'](_0x4d59be[_0xf951('0x4d')],function(_0x2c5827){var _0x1addf6={};_0x1addf6[_0x2c5827]={'$like':'%'+_0x889455[_0xf951('0x47')]['filter']+'%'};return _0x1addf6;})});}_0x4d59be=_[_0xf951('0x5a')]({},_0x4d59be,_0x889455[_0xf951('0x6d')]);return db[_0xf951('0x68')][_0xf951('0x33')]({'where':_0x4d59be['where']})['then'](function(_0x36b5b1){_0x390124[_0xf951('0x33')]=_0x36b5b1;if(_0x889455[_0xf951('0x47')][_0xf951('0x6e')]){_0x4d59be[_0xf951('0x56')]=[{'all':!![]}];}return db[_0xf951('0x68')][_0xf951('0x57')](_0x4d59be);})[_0xf951('0x21')](function(_0x4447f0){_0x390124[_0xf951('0x58')]=_0x4447f0;return _0x390124;});}})[_0xf951('0x21')](respondWithFilteredResult(_0xe865ee,_0x4d59be))[_0xf951('0x2b')](handleError(_0xe865ee,null));};exports[_0xf951('0x6f')]=function(_0x18a570,_0x2e292f,_0x586ed9){return db['WhatsappAccount'][_0xf951('0x5b')]({'where':{'id':_0x18a570[_0xf951('0x65')]['id']}})[_0xf951('0x21')](handleEntityNotFound(_0x2e292f,null))[_0xf951('0x21')](function(_0x4369cc){if(_0x4369cc){return _0x4369cc[_0xf951('0x6f')](_0x18a570['query'][_0xf951('0x70')]);}})[_0xf951('0x21')](respondWithStatusCode(_0x2e292f,null))[_0xf951('0x2b')](handleError(_0x2e292f,null));};exports[_0xf951('0x71')]=function(_0x536904,_0x26e0d8,_0x594d4d){if(_0x536904[_0xf951('0x64')]['id']){delete _0x536904[_0xf951('0x64')]['id'];}return db[_0xf951('0x42')][_0xf951('0x5b')]({'where':{'id':_0x536904[_0xf951('0x65')]['id']}})['then'](handleEntityNotFound(_0x26e0d8,null))[_0xf951('0x21')](function(_0x5dc7f0){if(_0x5dc7f0){_0x536904['body']['WhatsappAccountId']=_0x5dc7f0['id'];return db[_0xf951('0x72')]['create'](_0x536904[_0xf951('0x64')]);}})[_0xf951('0x21')](respondWithResult(_0x26e0d8,null))[_0xf951('0x2b')](handleError(_0x26e0d8,null));};exports[_0xf951('0x73')]=function(_0x1d2d01,_0x48643b,_0x513295){var _0x1192be={'raw':![],'where':{}};var _0x3956a2={};var _0x5e4911={'count':0x0,'rows':[]};return db[_0xf951('0x42')][_0xf951('0x6a')]({'where':{'id':_0x1d2d01['params']['id']}})[_0xf951('0x21')](handleEntityNotFound(_0x48643b,null))['then'](function(_0x3a90d4){if(_0x3a90d4){_0x3956a2[_0xf951('0x4b')]=_['keys'](db[_0xf951('0x72')][_0xf951('0x43')]);_0x3956a2[_0xf951('0x47')]=_[_0xf951('0x48')](_0x1d2d01[_0xf951('0x47')]);_0x3956a2['filters']=_[_0xf951('0x4a')](_0x3956a2['model'],_0x3956a2[_0xf951('0x47')]);_0x1192be['attributes']=_[_0xf951('0x4a')](_0x3956a2['model'],qs[_0xf951('0x4c')](_0x1d2d01[_0xf951('0x47')][_0xf951('0x4c')]));_0x1192be['attributes']=_0x1192be[_0xf951('0x4d')][_0xf951('0x4e')]?_0x1192be[_0xf951('0x4d')]:_0x3956a2[_0xf951('0x4b')];if(!_0x1d2d01['query'][_0xf951('0x4f')]('nolimit')){_0x1192be['limit']=qs[_0xf951('0x32')](_0x1d2d01[_0xf951('0x47')]['limit']);_0x1192be[_0xf951('0x30')]=qs[_0xf951('0x30')](_0x1d2d01[_0xf951('0x47')][_0xf951('0x30')]);}_0x1192be[_0xf951('0x51')]=qs[_0xf951('0x52')](_0x1d2d01['query'][_0xf951('0x52')]);_0x1192be['where']=qs['filters'](_['pick'](_0x1d2d01[_0xf951('0x47')],_0x3956a2[_0xf951('0x49')]));_0x1192be[_0xf951('0x53')][_0xf951('0x6c')]=_0x3a90d4['id'];if(_0x1d2d01['query'][_0xf951('0x54')]){_0x1192be['where']=_[_0xf951('0x5a')](_0x1192be[_0xf951('0x53')],{'$or':_[_0xf951('0x41')](_0x1192be[_0xf951('0x4d')],function(_0x1c9fc9){var _0x58ceb2={};_0x58ceb2[_0x1c9fc9]={'$like':'%'+_0x1d2d01[_0xf951('0x47')][_0xf951('0x54')]+'%'};return _0x58ceb2;})});}_0x1192be=_[_0xf951('0x5a')]({},_0x1192be,_0x1d2d01['options']);return db[_0xf951('0x72')][_0xf951('0x33')]({'where':_0x1192be[_0xf951('0x53')]})[_0xf951('0x21')](function(_0x5cfb33){_0x5e4911[_0xf951('0x33')]=_0x5cfb33;if(_0x1d2d01[_0xf951('0x47')][_0xf951('0x6e')]){_0x1192be[_0xf951('0x56')]=[{'all':!![]}];}return db['CannedAnswer'][_0xf951('0x57')](_0x1192be);})['then'](function(_0x4bf610){_0x5e4911[_0xf951('0x58')]=_0x4bf610;return _0x5e4911;});}})[_0xf951('0x21')](respondWithFilteredResult(_0x48643b,_0x1192be))['catch'](handleError(_0x48643b,null));};exports['removeAnswers']=function(_0x2f45bf,_0x10b73c,_0x4332fc){return db[_0xf951('0x42')]['find']({'where':{'id':_0x2f45bf[_0xf951('0x65')]['id']}})[_0xf951('0x21')](handleEntityNotFound(_0x10b73c,null))[_0xf951('0x21')](function(_0x30526e){if(_0x30526e){return _0x30526e[_0xf951('0x74')](_0x2f45bf['query'][_0xf951('0x70')]);}})['then'](respondWithStatusCode(_0x10b73c,null))['catch'](handleError(_0x10b73c,null));};exports[_0xf951('0x75')]=function(_0x2be350,_0x3a0899,_0x141cd0){return db[_0xf951('0x42')][_0xf951('0x5b')]({'where':{'id':_0x2be350[_0xf951('0x65')]['id']}})[_0xf951('0x21')](handleEntityNotFound(_0x3a0899,null))[_0xf951('0x21')](function(_0x35a92f){if(_0x35a92f){return _0x35a92f[_0xf951('0x75')](_0x2be350[_0xf951('0x64')][_0xf951('0x70')],_[_0xf951('0x76')](_0x2be350[_0xf951('0x64')],[_0xf951('0x70'),'id'])||{})[_0xf951('0x77')](function(_0x2fda78){for(var _0x29caff=0x0;_0x29caff<_0x2be350[_0xf951('0x64')][_0xf951('0x70')]['length'];_0x29caff+=0x1){socket[_0xf951('0x78')](_0xf951('0x79'),{'UserId':Number(_0x2be350['body'][_0xf951('0x70')][_0x29caff]),'WhatsappAccountId':Number(_0x2be350[_0xf951('0x65')]['id'])});}return _0x2fda78;});}})[_0xf951('0x21')](respondWithResult(_0x3a0899,null))[_0xf951('0x2b')](handleError(_0x3a0899,null));};exports[_0xf951('0x7a')]=function(_0x5382a1,_0x3702d9,_0x13b8d6){return db[_0xf951('0x42')]['find']({'where':{'id':_0x5382a1[_0xf951('0x65')]['id']}})[_0xf951('0x21')](handleEntityNotFound(_0x3702d9,null))[_0xf951('0x21')](function(_0x10640d){if(_0x10640d){return _0x10640d[_0xf951('0x7a')](_0x5382a1[_0xf951('0x47')][_0xf951('0x70')])[_0xf951('0x21')](function(){if(_[_0xf951('0x7b')](_0x5382a1['query'][_0xf951('0x70')])){for(var _0x55ab7e=0x0;_0x55ab7e<_0x5382a1['query'][_0xf951('0x70')][_0xf951('0x4e')];_0x55ab7e+=0x1){socket[_0xf951('0x78')](_0xf951('0x7c'),{'UserId':Number(_0x5382a1['query'][_0xf951('0x70')][_0x55ab7e]),'WhatsappAccountId':Number(_0x5382a1[_0xf951('0x65')]['id'])});}}else{socket['emit'](_0xf951('0x7c'),{'UserId':Number(_0x5382a1[_0xf951('0x47')][_0xf951('0x70')]),'WhatsappAccountId':Number(_0x5382a1[_0xf951('0x65')]['id'])});}});}})['then'](respondWithStatusCode(_0x3702d9,null))[_0xf951('0x2b')](handleError(_0x3702d9,null));};exports[_0xf951('0x7d')]=function(_0x1c99ca,_0xdf60cd,_0x226621){var _0x54e7d7={};var _0x309963={};var _0x53b07b;var _0x39d2e9;return db[_0xf951('0x42')][_0xf951('0x6a')]({'where':{'id':_0x1c99ca['params']['id']}})[_0xf951('0x21')](handleEntityNotFound(_0xdf60cd,null))['then'](function(_0x3dd369){if(_0x3dd369){_0x53b07b=_0x3dd369;_0x309963[_0xf951('0x4b')]=_[_0xf951('0x48')](db[_0xf951('0x7e')][_0xf951('0x43')]);_0x309963[_0xf951('0x47')]=_[_0xf951('0x48')](_0x1c99ca['query']);_0x309963[_0xf951('0x49')]=_['intersection'](_0x309963['model'],_0x309963[_0xf951('0x47')]);_0x54e7d7[_0xf951('0x4d')]=_[_0xf951('0x4a')](_0x309963[_0xf951('0x4b')],qs[_0xf951('0x4c')](_0x1c99ca[_0xf951('0x47')][_0xf951('0x4c')]));_0x54e7d7[_0xf951('0x4d')]=_0x54e7d7[_0xf951('0x4d')]['length']?_0x54e7d7[_0xf951('0x4d')]:_0x309963[_0xf951('0x4b')];_0x54e7d7[_0xf951('0x51')]=qs[_0xf951('0x52')](_0x1c99ca['query'][_0xf951('0x52')]);_0x54e7d7[_0xf951('0x53')]=qs[_0xf951('0x49')](_[_0xf951('0x6b')](_0x1c99ca[_0xf951('0x47')],_0x309963[_0xf951('0x49')]));if(_0x1c99ca[_0xf951('0x47')][_0xf951('0x54')]){_0x54e7d7[_0xf951('0x53')]=_[_0xf951('0x5a')](_0x54e7d7[_0xf951('0x53')],{'$or':_[_0xf951('0x41')](_0x54e7d7[_0xf951('0x4d')],function(_0x34dc4d){var _0x5500a1={};_0x5500a1[_0x34dc4d]={'$like':'%'+_0x1c99ca[_0xf951('0x47')][_0xf951('0x54')]+'%'};return _0x5500a1;})});}_0x54e7d7=_[_0xf951('0x5a')]({},_0x54e7d7,_0x1c99ca[_0xf951('0x6d')]);return _0x53b07b[_0xf951('0x7d')](_0x54e7d7);}})[_0xf951('0x21')](function(_0x351c98){if(_0x351c98){_0x39d2e9=_0x351c98[_0xf951('0x4e')];if(!_0x1c99ca[_0xf951('0x47')][_0xf951('0x4f')](_0xf951('0x50'))){_0x54e7d7[_0xf951('0x32')]=qs['limit'](_0x1c99ca[_0xf951('0x47')][_0xf951('0x32')]);_0x54e7d7[_0xf951('0x30')]=qs[_0xf951('0x30')](_0x1c99ca[_0xf951('0x47')][_0xf951('0x30')]);}return _0x53b07b[_0xf951('0x7d')](_0x54e7d7);}})[_0xf951('0x21')](function(_0x3e5eb3){if(_0x3e5eb3){return _0x3e5eb3?{'count':_0x39d2e9,'rows':_0x3e5eb3}:null;}})[_0xf951('0x21')](respondWithResult(_0xdf60cd,null))[_0xf951('0x2b')](handleError(_0xdf60cd,null));};exports[_0xf951('0x7f')]=function(_0x5262cf,_0x1a1121,_0x704b4a){return db[_0xf951('0x42')][_0xf951('0x6a')]({'where':{'id':_0x5262cf[_0xf951('0x65')]['id']}})[_0xf951('0x21')](handleEntityNotFound(_0x1a1121,null))[_0xf951('0x21')](function(_0x51b273){if(_0x51b273){return db[_0xf951('0x80')][_0xf951('0x81')](function(_0x179b4b){return db[_0xf951('0x82')][_0xf951('0x39')]({'where':{'WhatsappAccountId':_0x5262cf[_0xf951('0x65')]['id']},'transaction':_0x179b4b})[_0xf951('0x21')](function(_0x4931b3){var _0x1e7112=_['map'](_0x5262cf[_0xf951('0x64')],function(_0x1d20a9){_0x1d20a9['WhatsappAccountId']=_0x5262cf[_0xf951('0x65')]['id'];return _0x1d20a9;});return db['WhatsappApplication'][_0xf951('0x83')](_0x1e7112,{'transaction':_0x179b4b});});})[_0xf951('0x21')](function(){return db['WhatsappApplication'][_0xf951('0x84')]({'where':{'WhatsappAccountId':_0x5262cf['params']['id']},'order':_0xf951('0x85')});});}})['then'](respondWithResult(_0x1a1121,null))[_0xf951('0x2b')](handleError(_0x1a1121,null));};exports[_0xf951('0x86')]=function(_0x20bf8d,_0x3a5c48,_0x4c236b){var _0x404822={};var _0x3faf00={};var _0x54fd5e;var _0x5d9aef;return db['WhatsappAccount'][_0xf951('0x6a')]({'where':{'id':_0x20bf8d[_0xf951('0x65')]['id']}})[_0xf951('0x21')](handleEntityNotFound(_0x3a5c48,null))[_0xf951('0x21')](function(_0x52928e){if(_0x52928e){_0x54fd5e=_0x52928e;_0x3faf00[_0xf951('0x4b')]=_[_0xf951('0x48')](db[_0xf951('0x82')][_0xf951('0x43')]);_0x3faf00['query']=_[_0xf951('0x48')](_0x20bf8d[_0xf951('0x47')]);_0x3faf00[_0xf951('0x49')]=_[_0xf951('0x4a')](_0x3faf00[_0xf951('0x4b')],_0x3faf00['query']);_0x404822['attributes']=_['intersection'](_0x3faf00[_0xf951('0x4b')],qs['fields'](_0x20bf8d['query'][_0xf951('0x4c')]));_0x404822['attributes']=_0x404822[_0xf951('0x4d')][_0xf951('0x4e')]?_0x404822[_0xf951('0x4d')]:_0x3faf00[_0xf951('0x4b')];_0x404822[_0xf951('0x51')]=qs['sort'](_0x20bf8d[_0xf951('0x47')]['sort']);_0x404822[_0xf951('0x53')]=qs[_0xf951('0x49')](_[_0xf951('0x6b')](_0x20bf8d[_0xf951('0x47')],_0x3faf00[_0xf951('0x49')]));if(_0x20bf8d[_0xf951('0x47')][_0xf951('0x54')]){_0x404822[_0xf951('0x53')]=_[_0xf951('0x5a')](_0x404822[_0xf951('0x53')],{'$or':_[_0xf951('0x41')](_0x404822['attributes'],function(_0x2cab33){var _0x4b2fa8={};_0x4b2fa8[_0x2cab33]={'$like':'%'+_0x20bf8d[_0xf951('0x47')][_0xf951('0x54')]+'%'};return _0x4b2fa8;})});}_0x404822=_[_0xf951('0x5a')]({},_0x404822,_0x20bf8d[_0xf951('0x6d')]);return _0x54fd5e[_0xf951('0x86')](_0x404822);}})[_0xf951('0x21')](function(_0x305269){if(_0x305269){_0x5d9aef=_0x305269[_0xf951('0x4e')];if(!_0x20bf8d['query'][_0xf951('0x4f')](_0xf951('0x50'))){_0x404822[_0xf951('0x32')]=qs[_0xf951('0x32')](_0x20bf8d[_0xf951('0x47')][_0xf951('0x32')]);_0x404822[_0xf951('0x30')]=qs[_0xf951('0x30')](_0x20bf8d[_0xf951('0x47')][_0xf951('0x30')]);}return _0x54fd5e[_0xf951('0x86')](_0x404822);}})[_0xf951('0x21')](function(_0x1a3ef7){if(_0x1a3ef7){return _0x1a3ef7?{'count':_0x5d9aef,'rows':_0x1a3ef7}:null;}})[_0xf951('0x21')](respondWithResult(_0x3a5c48,null))['catch'](handleError(_0x3a5c48,null));};exports[_0xf951('0x87')]=function(_0x1b6e76,_0x3d9d32,_0x160cd4){var _0x161c15={'channel':_0xf951('0x88')};var _0x4e23b3=[];var _0x39411=[];var _0x14ab4e={};return db[_0xf951('0x42')][_0xf951('0x5b')]({'where':{'id':_0x1b6e76['params']['id']},'include':[{'model':db[_0xf951('0x82')],'as':_0xf951('0x89')}]})[_0xf951('0x21')](handleEntityNotFound(_0x3d9d32,null))[_0xf951('0x21')](function(_0x326d23){_0x161c15[_0xf951('0x8a')]=_0x326d23;_0x161c15[_0xf951('0x8b')]=_[_0xf951('0x8c')](_0x326d23[_0xf951('0x89')],[_0xf951('0x85')],['asc']);if(_0x161c15[_0xf951('0x8a')][_0xf951('0x89')]){delete _0x161c15[_0xf951('0x8a')][_0xf951('0x89')];}return db[_0xf951('0x8d')][_0xf951('0x66')]();})[_0xf951('0x21')](function(_0x4383d6){if(!_0x4383d6){throw new db[(_0xf951('0x8e'))][(_0xf951('0x8f'))](_0xf951('0x90'));}_0x4e23b3=_[_0xf951('0x91')](_[_0xf951('0x48')](_0x4383d6),[_0xf951('0x92'),_0xf951('0x93')]);_0x39411=_['difference'](_['keys'](_0x4383d6),['createdAt',_0xf951('0x93'),_0xf951('0x94'),_0xf951('0x95')]);_0x161c15['body']={'mapKey':_0xf951('0x96')};if(_0x161c15[_0xf951('0x8a')][_0xf951('0x45')]&&_0x161c15['account']['type']===_0xf951('0x97')){_0x161c15[_0xf951('0x64')]['from']=_0x1b6e76[_0xf951('0x64')][_0xf951('0x98')][_0xf951('0x99')](_0xf951('0x9a'),'');_0x161c15['body'][_0xf951('0x64')]=_0x1b6e76['body'][_0xf951('0x9b')];_0x161c15['body'][_0xf951('0x9c')]=_0x1b6e76[_0xf951('0x64')][_0xf951('0x9d')];}if(_0x161c15[_0xf951('0x64')]['id']){delete _0x161c15['body']['id'];}if(_[_0xf951('0x9e')](_0x161c15['body'][_0xf951('0x9f')])){throw new db[(_0xf951('0x8e'))][(_0xf951('0x8f'))](_0xf951('0xa0'));}if(_[_0xf951('0x9e')](_0x161c15[_0xf951('0x64')][_0xf951('0x64')])||_0x161c15[_0xf951('0x64')][_0xf951('0x64')]===''){throw new db[(_0xf951('0x8e'))]['ValidationError'](_0xf951('0xa1'));}if(_[_0xf951('0x9e')](_0x161c15['body']['mapKey'])){throw new db[(_0xf951('0x8e'))][(_0xf951('0x8f'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x39411);}if(!_['includes'](_0x39411,_0x161c15[_0xf951('0x64')][_0xf951('0xa2')])){throw new db[(_0xf951('0x8e'))][(_0xf951('0x8f'))](_0xf951('0xa3')+_0x39411);}_0x14ab4e[_0x161c15[_0xf951('0x64')]['mapKey']]=_0x161c15[_0xf951('0x64')][_0xf951('0x9f')];return db[_0xf951('0xa4')][_0xf951('0x5b')]({'where':{'id':_0x161c15[_0xf951('0x8a')][_0xf951('0x95')]},'include':[{'model':db[_0xf951('0x8d')],'as':_0xf951('0xa5'),'where':_0x14ab4e,'limit':0x1,'order':[[_0xf951('0x93'),_0xf951('0xa6')]]}]});})[_0xf951('0x21')](handleEntityNotFound(_0x3d9d32,null))['then'](function(_0x17a170){if(_0x17a170){_0x161c15[_0xf951('0xa7')]=_[_0xf951('0x76')](_0x17a170,[_0xf951('0xa5')]);if(_0x17a170[_0xf951('0xa5')]['length']){return _0x17a170[_0xf951('0xa5')][0x0];}var _0x111773=_[_0xf951('0x19')](_0x161c15['body'],{'firstName':_0x161c15['body'][_0xf951('0x9f')],'ListId':_0x17a170['id']});_0x111773[_0x161c15[_0xf951('0x64')][_0xf951('0xa2')]]=_0x161c15['body'][_0xf951('0x9f')];return db[_0xf951('0x8d')][_0xf951('0x5c')](_0x111773,{'fields':_0x4e23b3,'raw':!![]});}})[_0xf951('0x21')](handleEntityNotFound(_0x3d9d32,null))[_0xf951('0x21')](function(_0xa3b720){if(_0xa3b720){_0x161c15['contact']=_0xa3b720;var _0x88676c={'ContactId':_0xa3b720['id'],'phone':_0x161c15[_0xf951('0x64')][_0xf951('0x9f')],'WhatsappAccountId':_0x1b6e76['params']['id']};var _0x3d8851={'ContactId':_0xa3b720['id'],'WhatsappAccountId':_0x1b6e76[_0xf951('0x65')]['id'],'closed':![]};return db['WhatsappInteraction'][_0xf951('0x5b')]({'where':_0x3d8851})['then'](function(_0x131ca0){if(_0x131ca0){return[_0x131ca0,![]];}return db['WhatsappInteraction'][_0xf951('0x5c')](_0x88676c)[_0xf951('0x21')](function(_0x41e61a){return[_0x41e61a,!![]];});});}})['spread'](function(_0x423317,_0x29214d){_0x161c15[_0xf951('0xa8')]=_0x423317[_0xf951('0x3a')]({'plain':!![]});_0x161c15['interaction']['created']=![];if(_0x29214d){if(_0x161c15[_0xf951('0x8a')][_0xf951('0xa9')]){_0x161c15[_0xf951('0x8b')][_0xf951('0xaa')]({'id':0x0,'priority':_0x161c15[_0xf951('0x8b')][_0xf951('0x4e')]+0x1,'app':'close','appdata':_0xf951('0xab'),'interval':'*,*,*,*'});}_0x161c15[_0xf951('0xa8')][_0xf951('0xac')]=!![];}return db[_0xf951('0xad')][_0xf951('0x5c')]({'phone':_0x161c15['body'][_0xf951('0x9f')],'messageId':_0x161c15[_0xf951('0x64')][_0xf951('0x9c')],'body':_0x161c15[_0xf951('0x64')]['body'],'WhatsappAccountId':_0x1b6e76['params']['id'],'WhatsappInteractionId':_0x423317['id'],'direction':'in','ContactId':_0x423317[_0xf951('0xae')],'AttachmentId':_0x161c15[_0xf951('0x64')]['AttachmentId']});})[_0xf951('0x21')](function(_0x3d4876){_0x161c15[_0xf951('0x29')]=_0x3d4876;if(_0x161c15[_0xf951('0xa8')]['UserId']){return db[_0xf951('0x7e')][_0xf951('0x5b')]({'attributes':['id',_0xf951('0x3e')],'where':{'id':_0x161c15[_0xf951('0xa8')][_0xf951('0xaf')]}})[_0xf951('0x21')](function(_0x4deb18){if(_0x4deb18){_0x161c15[_0xf951('0x8b')]['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x4deb18[_0xf951('0x3e')]+','+(_0x161c15[_0xf951('0x8a')]['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0xf951('0xb0'),_0xf951('0xb1'),_0x161c15);});}return respondWithRpcPromise(_0xf951('0xb0'),_0xf951('0xb1'),_0x161c15);})[_0xf951('0x21')](function(_0x1084c5){if(_0x1084c5){var _0x3b2a10=0xc8;var _0x2025e3=_0xf951('0xb2');logger[_0xf951('0x22')](_0xf951('0x26'),_0x2025e3,_0x3b2a10,_0xf951('0xb3'));logger['debug'](_0xf951('0xb4'),_0x2025e3,_0x3b2a10,_0xf951('0xb3'),JSON['stringify'](_0x1084c5));if(_0x161c15['account']['type']===_0xf951('0x97')){return _0x3d9d32[_0xf951('0x2d')](_0x3b2a10)[_0xf951('0x34')](_0xf951('0xb5'),'text/xml')[_0xf951('0xb6')]('\x0a');}else{return _0x3d9d32[_0xf951('0x2d')](_0x3b2a10)[_0xf951('0x2f')](_0x1084c5);}}})['catch'](handleError(_0x3d9d32,null));};exports[_0xf951('0xb6')]=function(_0x443c7c,_0xb30e31,_0x58f8c7){var _0x1ae779,_0x371ef5,_0x1232c2;if(_[_0xf951('0x9e')](_0x443c7c['body'][_0xf951('0x64')])||_0x443c7c[_0xf951('0x64')][_0xf951('0x64')]===''){throw new db[(_0xf951('0x8e'))][(_0xf951('0x8f'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xf951('0x9e')](_0x443c7c[_0xf951('0x64')]['to'])){throw new db['Sequelize'][(_0xf951('0x8f'))](_0xf951('0xb7'));}_0x1ae779=_0x443c7c['body']['to'];return db[_0xf951('0x42')]['find']({'where':{'id':_0x443c7c[_0xf951('0x65')]['id']},'include':[{'model':db[_0xf951('0xa4')],'as':_0xf951('0xb8'),'include':[{'model':db[_0xf951('0x8d')],'as':_0xf951('0xa5'),'where':{'mobile':_0x1ae779},'limit':0x1,'order':[[_0xf951('0x93'),'DESC']]}]}]})[_0xf951('0x21')](handleEntityNotFound(_0xb30e31,null))[_0xf951('0x21')](function(_0x2b298d){if(_0x2b298d&&_0x2b298d[_0xf951('0xb8')]){_0x371ef5=_0x2b298d['get']({'plain':!![]});if(_0x371ef5[_0xf951('0xb8')]&&_0x371ef5[_0xf951('0xb8')][_0xf951('0xa5')]['length']){return _0x371ef5[_0xf951('0xb8')][_0xf951('0xa5')][0x0];}return db[_0xf951('0x8d')][_0xf951('0x5c')](_[_0xf951('0x19')](_0x443c7c[_0xf951('0x64')],{'firstName':_0x1ae779,'mobile':_0x1ae779,'phone':_0x1ae779,'ListId':_0x371ef5[_0xf951('0x95')]}));}})[_0xf951('0x21')](handleEntityNotFound(_0xb30e31,null))[_0xf951('0x21')](function(_0x66d9cd){if(_0x66d9cd){_0x1232c2=_0x66d9cd;return db[_0xf951('0xb9')]['find']({'where':{'ContactId':_0x1232c2['id'],'closed':![],'WhatsappAccountId':_0x371ef5['id']}})['then'](function(_0x4c8a1e){if(_0x4c8a1e){return[_0x4c8a1e,![]];}return db[_0xf951('0xb9')][_0xf951('0x5c')]({'UserId':_0x443c7c[_0xf951('0x5d')]['id'],'ContactId':_0x1232c2['id'],'WhatsappAccountId':_0x371ef5['id'],'phone':_0x1ae779,'firstMsgDirection':_0xf951('0xba'),'Messages':[_[_0xf951('0x5a')](_0x443c7c['body'],{'read':![],'body':_0x443c7c['body']['body'],'phone':_0x1ae779,'WhatsappAccountId':_0x371ef5['id'],'UserId':_0x443c7c[_0xf951('0x5d')]['id'],'ContactId':_0x1232c2['id']})]},{'include':[{'model':db[_0xf951('0xad')],'as':_0xf951('0xbb')}]})[_0xf951('0x21')](function(_0x3b644b){return[_0x3b644b,!![]];});});}})[_0xf951('0x77')](function(_0x49e464,_0x10cac3){if(_0x10cac3){return _0x49e464;}return db[_0xf951('0xad')][_0xf951('0x5c')](_['merge'](_0x443c7c[_0xf951('0x64')],{'read':![],'body':_0x443c7c['body']['body'],'phone':_0x1ae779,'WhatsappAccountId':_0x371ef5['id'],'WhatsappInteractionId':_0x49e464['id'],'UserId':_0x443c7c[_0xf951('0x5d')]['id'],'ContactId':_0x1232c2['id']}))[_0xf951('0x21')](function(_0x2911f2){_0x49e464[_0xf951('0xbc')][_0xf951('0xbb')]=[];_0x49e464['dataValues'][_0xf951('0xbb')][_0xf951('0xaa')](_0x2911f2[_0xf951('0xbc')]);return _0x49e464;});})[_0xf951('0x21')](respondWithResult(_0xb30e31,null))[_0xf951('0x2b')](handleError(_0xb30e31,null));}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.events.js b/server/api/whatsappAccount/whatsappAccount.events.js index 495efad..340ac78 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 _0x3b97=['emit','hook','exports','events','../../mysqldb','WhatsappAccount','remove'];(function(_0x407883,_0xb548f){var _0x183ca2=function(_0x48f454){while(--_0x48f454){_0x407883['push'](_0x407883['shift']());}};_0x183ca2(++_0xb548f);}(_0x3b97,0xa4));var _0x73b9=function(_0x20932f,_0x3b9548){_0x20932f=_0x20932f-0x0;var _0x329ced=_0x3b97[_0x20932f];return _0x329ced;};'use strict';var EventEmitter=require(_0x73b9('0x0'));var WhatsappAccount=require(_0x73b9('0x1'))['db'][_0x73b9('0x2')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x73b9('0x3')};function emitEvent(_0x967ace){return function(_0x17465d,_0x2a6bdb,_0x22392c){WhatsappAccountEvents[_0x73b9('0x4')](_0x967ace+':'+_0x17465d['id'],_0x17465d);WhatsappAccountEvents[_0x73b9('0x4')](_0x967ace,_0x17465d);_0x22392c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappAccount[_0x73b9('0x5')](e,emitEvent(event));}}module[_0x73b9('0x6')]=WhatsappAccountEvents; \ No newline at end of file +var _0x4c71=['update','emit','hasOwnProperty','hook','exports','../../mysqldb','WhatsappAccount','setMaxListeners','save'];(function(_0x1f36bb,_0x8af718){var _0xaf97fa=function(_0xeca489){while(--_0xeca489){_0x1f36bb['push'](_0x1f36bb['shift']());}};_0xaf97fa(++_0x8af718);}(_0x4c71,0x1e2));var _0x14c7=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0x4c71[_0x11005e];return _0x29338f;};'use strict';var EventEmitter=require('events');var WhatsappAccount=require(_0x14c7('0x0'))['db'][_0x14c7('0x1')];var WhatsappAccountEvents=new EventEmitter();WhatsappAccountEvents[_0x14c7('0x2')](0x0);var events={'afterCreate':_0x14c7('0x3'),'afterUpdate':_0x14c7('0x4'),'afterDestroy':'remove'};function emitEvent(_0x1d8b07){return function(_0x246967,_0x2cb2fe,_0x15c1df){WhatsappAccountEvents[_0x14c7('0x5')](_0x1d8b07+':'+_0x246967['id'],_0x246967);WhatsappAccountEvents[_0x14c7('0x5')](_0x1d8b07,_0x246967);_0x15c1df(null);};}for(var e in events){if(events[_0x14c7('0x6')](e)){var event=events[e];WhatsappAccount[_0x14c7('0x7')](e,emitEvent(event));}}module[_0x14c7('0x8')]=WhatsappAccountEvents; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.model.js b/server/api/whatsappAccount/whatsappAccount.model.js index 6a3a227..c596d04 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 _0xa3c4=['rimraf','define','whatsapp_accounts','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x491faa,_0x4f2907){var _0x414440=function(_0x310864){while(--_0x310864){_0x491faa['push'](_0x491faa['shift']());}};_0x414440(++_0x4f2907);}(_0xa3c4,0xa3));var _0x4a3c=function(_0x2986b8,_0x4b0089){_0x2986b8=_0x2986b8-0x0;var _0x516c00=_0xa3c4[_0x2986b8];return _0x516c00;};'use strict';var _=require('lodash');var util=require(_0x4a3c('0x0'));var logger=require(_0x4a3c('0x1'))(_0x4a3c('0x2'));var moment=require(_0x4a3c('0x3'));var BPromise=require(_0x4a3c('0x4'));var rp=require(_0x4a3c('0x5'));var fs=require('fs');var path=require(_0x4a3c('0x6'));var rimraf=require(_0x4a3c('0x7'));var config=require('../../config/environment');var attributes=require('./whatsappAccount.attributes');module['exports']=function(_0x5ebf19,_0x4a60b5){return _0x5ebf19[_0x4a3c('0x8')]('WhatsappAccount',attributes,{'tableName':_0x4a3c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x648f=['define','WhatsappAccount','whatsapp_accounts','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./whatsappAccount.attributes','exports'];(function(_0x34966d,_0x46fd96){var _0x37a8e6=function(_0xcf6130){while(--_0xcf6130){_0x34966d['push'](_0x34966d['shift']());}};_0x37a8e6(++_0x46fd96);}(_0x648f,0xe3));var _0xf648=function(_0xa6f90c,_0x1d315b){_0xa6f90c=_0xa6f90c-0x0;var _0x2b19c8=_0x648f[_0xa6f90c];return _0x2b19c8;};'use strict';var _=require(_0xf648('0x0'));var util=require(_0xf648('0x1'));var logger=require(_0xf648('0x2'))(_0xf648('0x3'));var moment=require(_0xf648('0x4'));var BPromise=require('bluebird');var rp=require(_0xf648('0x5'));var fs=require('fs');var path=require(_0xf648('0x6'));var rimraf=require(_0xf648('0x7'));var config=require(_0xf648('0x8'));var attributes=require(_0xf648('0x9'));module[_0xf648('0xa')]=function(_0x5bb52d,_0x984b2e){return _0x5bb52d[_0xf648('0xb')](_0xf648('0xc'),attributes,{'tableName':_0xf648('0xd'),'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 37777c5..ef6bfaf 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 _0x2813=['include','model','then','info','stringify','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','./whatsappAccount.socket','register','request\x20sent','WhatsappAccount,\x20%s,\x20%s,\x20%s','error','message','WhatsappAccount,\x20%s,\x20%s','result','catch','ShowWhatsappAccount','WhatsappAccount','find','options','raw','where','attributes','map'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2813,0x6e));var _0x3281=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2813[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x3281('0x0'));var moment=require(_0x3281('0x1'));var BPromise=require(_0x3281('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3281('0x3'));var db=require(_0x3281('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3281('0x5'))(_0x3281('0x6'));var config=require(_0x3281('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x3281('0x8')][_0x3281('0x9')]({'port':0x232a});config[_0x3281('0xa')]=_[_0x3281('0xb')](config[_0x3281('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x3281('0xc'))(new Redis(config[_0x3281('0xa')]));require(_0x3281('0xd'))[_0x3281('0xe')](socket);function respondWithRpcPromise(_0x538d01,_0x5e1ffe,_0x10fb59){return new BPromise(function(_0x3f5d1a,_0x5bb4af){return client['request'](_0x538d01,_0x10fb59)['then'](function(_0x12a56a){logger['info']('WhatsappAccount,\x20%s,\x20%s',_0x5e1ffe,_0x3281('0xf'));logger['debug'](_0x3281('0x10'),_0x5e1ffe,'request\x20sent',JSON['stringify'](_0x12a56a));if(_0x12a56a['error']){if(_0x12a56a[_0x3281('0x11')]['code']===0x1f4){logger[_0x3281('0x11')]('WhatsappAccount,\x20%s,\x20%s',_0x5e1ffe,_0x12a56a[_0x3281('0x11')][_0x3281('0x12')]);return _0x5bb4af(_0x12a56a[_0x3281('0x11')][_0x3281('0x12')]);}logger['error']('WhatsappAccount,\x20%s,\x20%s',_0x5e1ffe,_0x12a56a[_0x3281('0x11')][_0x3281('0x12')]);return _0x3f5d1a(_0x12a56a[_0x3281('0x11')][_0x3281('0x12')]);}else{logger['info'](_0x3281('0x13'),_0x5e1ffe,'request\x20sent');_0x3f5d1a(_0x12a56a[_0x3281('0x14')]['message']);}})[_0x3281('0x15')](function(_0x300ef9){logger[_0x3281('0x11')](_0x3281('0x13'),_0x5e1ffe,_0x300ef9);_0x5bb4af(_0x300ef9);});});}exports[_0x3281('0x16')]=function(_0x1f8bff){var _0x3bfd4c=this;return new Promise(function(_0x216d7b,_0x264c7c){return db[_0x3281('0x17')][_0x3281('0x18')]({'raw':_0x1f8bff[_0x3281('0x19')]?_0x1f8bff[_0x3281('0x19')][_0x3281('0x1a')]===undefined?!![]:![]:!![],'where':_0x1f8bff['options']?_0x1f8bff[_0x3281('0x19')][_0x3281('0x1b')]||null:null,'attributes':_0x1f8bff[_0x3281('0x19')]?_0x1f8bff[_0x3281('0x19')][_0x3281('0x1c')]||null:null,'include':_0x1f8bff[_0x3281('0x19')]?_0x1f8bff[_0x3281('0x19')]['include']?_[_0x3281('0x1d')](_0x1f8bff[_0x3281('0x19')][_0x3281('0x1e')],function(_0x2fbdbe){return{'model':db[_0x2fbdbe['model']],'as':_0x2fbdbe['as'],'attributes':_0x2fbdbe[_0x3281('0x1c')],'include':_0x2fbdbe[_0x3281('0x1e')]?_[_0x3281('0x1d')](_0x2fbdbe[_0x3281('0x1e')],function(_0x779a3a){return{'model':db[_0x779a3a[_0x3281('0x1f')]],'as':_0x779a3a['as'],'attributes':_0x779a3a[_0x3281('0x1c')],'include':_0x779a3a['include']?_[_0x3281('0x1d')](_0x779a3a[_0x3281('0x1e')],function(_0x480721){return{'model':db[_0x480721[_0x3281('0x1f')]],'as':_0x480721['as'],'attributes':_0x480721[_0x3281('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x3281('0x20')](function(_0x10b87f){logger[_0x3281('0x21')]('ShowWhatsappAccount',_0x1f8bff);logger['debug'](_0x3281('0x16'),_0x1f8bff,JSON[_0x3281('0x22')](_0x10b87f));_0x216d7b(_0x10b87f);})[_0x3281('0x15')](function(_0x27c455){logger[_0x3281('0x11')]('ShowWhatsappAccount',_0x27c455['message'],_0x1f8bff);_0x264c7c(_0x3bfd4c[_0x3281('0x11')](0x1f4,_0x27c455[_0x3281('0x12')]));});});}; \ No newline at end of file +var _0x3e47=['WhatsappAccount','find','options','where','attributes','include','model','map','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','redis','localhost','register','request','info','WhatsappAccount,\x20%s,\x20%s','request\x20sent','debug','WhatsappAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','ShowWhatsappAccount'];(function(_0x22886a,_0x17348a){var _0x1d02f8=function(_0x526cec){while(--_0x526cec){_0x22886a['push'](_0x22886a['shift']());}};_0x1d02f8(++_0x17348a);}(_0x3e47,0x132));var _0x73e4=function(_0x1e5db8,_0x44ef41){_0x1e5db8=_0x1e5db8-0x0;var _0x219a51=_0x3e47[_0x1e5db8];return _0x219a51;};'use strict';var _=require('lodash');var util=require(_0x73e4('0x0'));var moment=require(_0x73e4('0x1'));var BPromise=require(_0x73e4('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x73e4('0x3'));var db=require(_0x73e4('0x4'))['db'];var utils=require(_0x73e4('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x73e4('0x6'));var client=jayson[_0x73e4('0x7')][_0x73e4('0x8')]({'port':0x232a});config[_0x73e4('0x9')]=_['defaults'](config[_0x73e4('0x9')],{'host':_0x73e4('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x73e4('0x9')]));require('./whatsappAccount.socket')[_0x73e4('0xb')](socket);function respondWithRpcPromise(_0x186ccf,_0x4c97f6,_0x279730){return new BPromise(function(_0x2599ac,_0x1bebe8){return client[_0x73e4('0xc')](_0x186ccf,_0x279730)['then'](function(_0x37df09){logger[_0x73e4('0xd')](_0x73e4('0xe'),_0x4c97f6,_0x73e4('0xf'));logger[_0x73e4('0x10')](_0x73e4('0x11'),_0x4c97f6,'request\x20sent',JSON[_0x73e4('0x12')](_0x37df09));if(_0x37df09['error']){if(_0x37df09[_0x73e4('0x13')][_0x73e4('0x14')]===0x1f4){logger[_0x73e4('0x13')](_0x73e4('0xe'),_0x4c97f6,_0x37df09['error']['message']);return _0x1bebe8(_0x37df09[_0x73e4('0x13')][_0x73e4('0x15')]);}logger[_0x73e4('0x13')](_0x73e4('0xe'),_0x4c97f6,_0x37df09[_0x73e4('0x13')][_0x73e4('0x15')]);return _0x2599ac(_0x37df09['error'][_0x73e4('0x15')]);}else{logger[_0x73e4('0xd')]('WhatsappAccount,\x20%s,\x20%s',_0x4c97f6,_0x73e4('0xf'));_0x2599ac(_0x37df09[_0x73e4('0x16')][_0x73e4('0x15')]);}})['catch'](function(_0x2b5dc3){logger[_0x73e4('0x13')](_0x73e4('0xe'),_0x4c97f6,_0x2b5dc3);_0x1bebe8(_0x2b5dc3);});});}exports[_0x73e4('0x17')]=function(_0x3341e2){var _0x55104a=this;return new Promise(function(_0x23b41e,_0x1b6baf){return db[_0x73e4('0x18')][_0x73e4('0x19')]({'raw':_0x3341e2[_0x73e4('0x1a')]?_0x3341e2['options']['raw']===undefined?!![]:![]:!![],'where':_0x3341e2[_0x73e4('0x1a')]?_0x3341e2[_0x73e4('0x1a')][_0x73e4('0x1b')]||null:null,'attributes':_0x3341e2[_0x73e4('0x1a')]?_0x3341e2['options'][_0x73e4('0x1c')]||null:null,'include':_0x3341e2[_0x73e4('0x1a')]?_0x3341e2[_0x73e4('0x1a')][_0x73e4('0x1d')]?_['map'](_0x3341e2[_0x73e4('0x1a')][_0x73e4('0x1d')],function(_0x108759){return{'model':db[_0x108759['model']],'as':_0x108759['as'],'attributes':_0x108759['attributes'],'include':_0x108759[_0x73e4('0x1d')]?_['map'](_0x108759['include'],function(_0x27e274){return{'model':db[_0x27e274[_0x73e4('0x1e')]],'as':_0x27e274['as'],'attributes':_0x27e274['attributes'],'include':_0x27e274[_0x73e4('0x1d')]?_[_0x73e4('0x1f')](_0x27e274[_0x73e4('0x1d')],function(_0x5dcd96){return{'model':db[_0x5dcd96[_0x73e4('0x1e')]],'as':_0x5dcd96['as'],'attributes':_0x5dcd96[_0x73e4('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4a8437){logger[_0x73e4('0xd')]('ShowWhatsappAccount',_0x3341e2);logger[_0x73e4('0x10')](_0x73e4('0x17'),_0x3341e2,JSON[_0x73e4('0x12')](_0x4a8437));_0x23b41e(_0x4a8437);})[_0x73e4('0x20')](function(_0x277808){logger[_0x73e4('0x13')](_0x73e4('0x17'),_0x277808[_0x73e4('0x15')],_0x3341e2);_0x1b6baf(_0x55104a[_0x73e4('0x13')](0x1f4,_0x277808[_0x73e4('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappAccount/whatsappAccount.socket.js b/server/api/whatsappAccount/whatsappAccount.socket.js index 985f72e..be0eeb5 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 _0x9917=['register','length','whatsappAccount:','./whatsappAccount.events','emit'];(function(_0x4e6ae6,_0x49dba6){var _0x23c108=function(_0x1bc103){while(--_0x1bc103){_0x4e6ae6['push'](_0x4e6ae6['shift']());}};_0x23c108(++_0x49dba6);}(_0x9917,0x157));var _0x7991=function(_0x5e03a1,_0x5239a8){_0x5e03a1=_0x5e03a1-0x0;var _0x5308c9=_0x9917[_0x5e03a1];return _0x5308c9;};'use strict';var WhatsappAccountEvents=require(_0x7991('0x0'));var events=['save','remove','update'];function createListener(_0x53ce84,_0x14666b){return function(_0x408402){_0x14666b[_0x7991('0x1')](_0x53ce84,_0x408402);};}function removeListener(_0x44a598,_0x351998){return function(){WhatsappAccountEvents['removeListener'](_0x44a598,_0x351998);};}exports[_0x7991('0x2')]=function(_0x2d04b2){for(var _0x1d493d=0x0,_0x1c7446=events[_0x7991('0x3')];_0x1d493d<_0x1c7446;_0x1d493d++){var _0x5b7e78=events[_0x1d493d];var _0x49c310=createListener(_0x7991('0x4')+_0x5b7e78,_0x2d04b2);WhatsappAccountEvents['on'](_0x5b7e78,_0x49c310);}}; \ No newline at end of file +var _0x61aa=['./whatsappAccount.events','save','update','emit','register','length','whatsappAccount:'];(function(_0x383489,_0x2a9b79){var _0x41d733=function(_0xc86a82){while(--_0xc86a82){_0x383489['push'](_0x383489['shift']());}};_0x41d733(++_0x2a9b79);}(_0x61aa,0x1f1));var _0xa61a=function(_0x19ddfa,_0x4279cd){_0x19ddfa=_0x19ddfa-0x0;var _0x1093e0=_0x61aa[_0x19ddfa];return _0x1093e0;};'use strict';var WhatsappAccountEvents=require(_0xa61a('0x0'));var events=[_0xa61a('0x1'),'remove',_0xa61a('0x2')];function createListener(_0x32b115,_0x6644f5){return function(_0x447bb5){_0x6644f5[_0xa61a('0x3')](_0x32b115,_0x447bb5);};}function removeListener(_0x4abfe6,_0x45d591){return function(){WhatsappAccountEvents['removeListener'](_0x4abfe6,_0x45d591);};}exports[_0xa61a('0x4')]=function(_0x5296ba){for(var _0x1dee20=0x0,_0x3ea079=events[_0xa61a('0x5')];_0x1dee20<_0x3ea079;_0x1dee20++){var _0x12524e=events[_0x1dee20];var _0xe5e403=createListener(_0xa61a('0x6')+_0x12524e,_0x5296ba);WhatsappAccountEvents['on'](_0x12524e,_0xe5e403);}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/index.js b/server/api/whatsappApplication/index.js index 5ac6381..7483579 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 _0x77dd=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappApplication.controller','get','index','/:id','show','post','isAuthenticated','create'];(function(_0x2e2a60,_0xfd3c54){var _0x3a401e=function(_0x11a7b6){while(--_0x11a7b6){_0x2e2a60['push'](_0x2e2a60['shift']());}};_0x3a401e(++_0xfd3c54);}(_0x77dd,0xa6));var _0xd77d=function(_0x7cb10c,_0x2fcc3a){_0x7cb10c=_0x7cb10c-0x0;var _0x11df59=_0x77dd[_0x7cb10c];return _0x11df59;};'use strict';var multer=require(_0xd77d('0x0'));var util=require(_0xd77d('0x1'));var path=require(_0xd77d('0x2'));var timeout=require(_0xd77d('0x3'));var express=require(_0xd77d('0x4'));var router=express[_0xd77d('0x5')]();var fs_extra=require(_0xd77d('0x6'));var auth=require(_0xd77d('0x7'));var interaction=require(_0xd77d('0x8'));var config=require(_0xd77d('0x9'));var controller=require(_0xd77d('0xa'));router[_0xd77d('0xb')]('/',auth['isAuthenticated'](),controller[_0xd77d('0xc')]);router['get'](_0xd77d('0xd'),auth['isAuthenticated'](),controller[_0xd77d('0xe')]);router[_0xd77d('0xf')]('/',auth[_0xd77d('0x10')](),controller[_0xd77d('0x11')]);router[_0xd77d('0x12')](_0xd77d('0xd'),auth[_0xd77d('0x10')](),controller[_0xd77d('0x13')]);router[_0xd77d('0x14')]('/:id',auth[_0xd77d('0x10')](),controller[_0xd77d('0x15')]);module[_0xd77d('0x16')]=router; \ No newline at end of file +var _0x8ebe=['express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','show','post','create','delete','destroy','exports','multer','path','connect-timeout'];(function(_0x147d10,_0x5aa133){var _0xd1219b=function(_0x1c3e86){while(--_0x1c3e86){_0x147d10['push'](_0x147d10['shift']());}};_0xd1219b(++_0x5aa133);}(_0x8ebe,0xd5));var _0xe8eb=function(_0x426711,_0x12264c){_0x426711=_0x426711-0x0;var _0x592991=_0x8ebe[_0x426711];return _0x592991;};'use strict';var multer=require(_0xe8eb('0x0'));var util=require('util');var path=require(_0xe8eb('0x1'));var timeout=require(_0xe8eb('0x2'));var express=require(_0xe8eb('0x3'));var router=express[_0xe8eb('0x4')]();var fs_extra=require(_0xe8eb('0x5'));var auth=require(_0xe8eb('0x6'));var interaction=require(_0xe8eb('0x7'));var config=require(_0xe8eb('0x8'));var controller=require('./whatsappApplication.controller');router[_0xe8eb('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xe8eb('0xa'),auth[_0xe8eb('0xb')](),controller[_0xe8eb('0xc')]);router[_0xe8eb('0xd')]('/',auth[_0xe8eb('0xb')](),controller[_0xe8eb('0xe')]);router['put']('/:id',auth[_0xe8eb('0xb')](),controller['update']);router[_0xe8eb('0xf')]('/:id',auth[_0xe8eb('0xb')](),controller[_0xe8eb('0x10')]);module[_0xe8eb('0x11')]=router; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.attributes.js b/server/api/whatsappApplication/whatsappApplication.attributes.js index f850863..27ed2aa 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 _0x12bd=['TEXT','*,*,*,*','sequelize','exports','INTEGER','STRING','noop'];(function(_0x5c48c1,_0x588152){var _0x1a5618=function(_0x250537){while(--_0x250537){_0x5c48c1['push'](_0x5c48c1['shift']());}};_0x1a5618(++_0x588152);}(_0x12bd,0x19f));var _0xd12b=function(_0x4498ac,_0x30e301){_0x4498ac=_0x4498ac-0x0;var _0x4bf1b6=_0x12bd[_0x4498ac];return _0x4bf1b6;};'use strict';var Sequelize=require(_0xd12b('0x0'));module[_0xd12b('0x1')]={'priority':{'type':Sequelize[_0xd12b('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xd12b('0x3')],'allowNull':![],'defaultValue':_0xd12b('0x4')},'appdata':{'type':Sequelize[_0xd12b('0x5')]()},'description':{'type':Sequelize[_0xd12b('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xd12b('0x6')}}; \ No newline at end of file +var _0x426d=['STRING','noop','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x126006,_0x29d087){var _0x4df414=function(_0xf90add){while(--_0xf90add){_0x126006['push'](_0x126006['shift']());}};_0x4df414(++_0x29d087);}(_0x426d,0xff));var _0xd426=function(_0x2f5f80,_0x221bb3){_0x2f5f80=_0x2f5f80-0x0;var _0x52bdd7=_0x426d[_0x2f5f80];return _0x52bdd7;};'use strict';var Sequelize=require(_0xd426('0x0'));module[_0xd426('0x1')]={'priority':{'type':Sequelize[_0xd426('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xd426('0x3')],'allowNull':![],'defaultValue':_0xd426('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xd426('0x5')}}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.controller.js b/server/api/whatsappApplication/whatsappApplication.controller.js index 7f5513d..045de27 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 _0x80c4=['order','sort','where','merge','type','VIRTUAL','options','includeAll','include','rows','show','params','find','catch','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','name','WhatsappApplication','rawAttributes','fieldName','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit'];(function(_0x56f6ea,_0x47374e){var _0x5053db=function(_0x53cb4f){while(--_0x53cb4f){_0x56f6ea['push'](_0x56f6ea['shift']());}};_0x5053db(++_0x47374e);}(_0x80c4,0xa3));var _0x480c=function(_0x1dc1bc,_0x13522c){_0x1dc1bc=_0x1dc1bc-0x0;var _0xe8656e=_0x80c4[_0x1dc1bc];return _0xe8656e;};'use strict';var emlformat=require(_0x480c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x480c('0x1'));var jsonpatch=require(_0x480c('0x2'));var rp=require(_0x480c('0x3'));var moment=require(_0x480c('0x4'));var BPromise=require(_0x480c('0x5'));var Mustache=require(_0x480c('0x6'));var util=require('util');var path=require(_0x480c('0x7'));var sox=require(_0x480c('0x8'));var csv=require(_0x480c('0x9'));var ejs=require(_0x480c('0xa'));var fs=require('fs');var fs_extra=require(_0x480c('0xb'));var _=require(_0x480c('0xc'));var squel=require(_0x480c('0xd'));var crypto=require(_0x480c('0xe'));var jsforce=require(_0x480c('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x480c('0x9'));var querystring=require(_0x480c('0x10'));var Papa=require(_0x480c('0x11'));var Redis=require(_0x480c('0x12'));var authService=require(_0x480c('0x13'));var qs=require(_0x480c('0x14'));var as=require(_0x480c('0x15'));var hardwareService=require(_0x480c('0x16'));var logger=require(_0x480c('0x17'))(_0x480c('0x18'));var utils=require(_0x480c('0x19'));var config=require(_0x480c('0x1a'));var licenseUtil=require(_0x480c('0x1b'));var db=require(_0x480c('0x1c'))['db'];function respondWithStatusCode(_0x428d08,_0x3f5438){_0x3f5438=_0x3f5438||0xcc;return function(_0x376da3){if(_0x376da3){return _0x428d08[_0x480c('0x1d')](_0x3f5438);}return _0x428d08['status'](_0x3f5438)[_0x480c('0x1e')]();};}function respondWithResult(_0x29613b,_0x5efdbb){_0x5efdbb=_0x5efdbb||0xc8;return function(_0x3b48b6){if(_0x3b48b6){return _0x29613b[_0x480c('0x1f')](_0x5efdbb)[_0x480c('0x20')](_0x3b48b6);}};}function respondWithFilteredResult(_0x513f2d,_0x5ea02c){return function(_0x445635){if(_0x445635){var _0x164428=typeof _0x5ea02c[_0x480c('0x21')]===_0x480c('0x22')&&typeof _0x5ea02c[_0x480c('0x23')]==='undefined';var _0x5b5ea3=_0x445635['count'];var _0xfc8a9f=_0x164428?0x0:_0x5ea02c[_0x480c('0x21')];var _0x54750c=_0x164428?_0x445635[_0x480c('0x24')]:_0x5ea02c['offset']+_0x5ea02c[_0x480c('0x23')];var _0x1507d1;if(_0x54750c>=_0x5b5ea3){_0x54750c=_0x5b5ea3;_0x1507d1=0xc8;}else{_0x1507d1=0xce;}_0x513f2d[_0x480c('0x1f')](_0x1507d1);return _0x513f2d['set'](_0x480c('0x25'),_0xfc8a9f+'-'+_0x54750c+'/'+_0x5b5ea3)[_0x480c('0x20')](_0x445635);}return null;};}function patchUpdates(_0x9e5a12){return function(_0x5840be){try{jsonpatch[_0x480c('0x26')](_0x5840be,_0x9e5a12,!![]);}catch(_0x50bb63){return BPromise[_0x480c('0x27')](_0x50bb63);}return _0x5840be[_0x480c('0x28')]();};}function saveUpdates(_0x5b5a51,_0x3b5bca){return function(_0x3cca31){if(_0x3cca31){return _0x3cca31[_0x480c('0x29')](_0x5b5a51)[_0x480c('0x2a')](function(_0x5dbf8f){return _0x5dbf8f;});}return null;};}function removeEntity(_0x1bc75c,_0x241901){return function(_0x5288f5){if(_0x5288f5){return _0x5288f5[_0x480c('0x2b')]()[_0x480c('0x2a')](function(){_0x1bc75c[_0x480c('0x1f')](0xcc)[_0x480c('0x1e')]();});}};}function handleEntityNotFound(_0x12445d,_0x7f067f){return function(_0x4008ff){if(!_0x4008ff){_0x12445d[_0x480c('0x1d')](0x194);}return _0x4008ff;};}function handleError(_0x72e37b,_0x40def3){_0x40def3=_0x40def3||0x1f4;return function(_0x1363ef){logger['error'](_0x1363ef['stack']);if(_0x1363ef[_0x480c('0x2c')]){delete _0x1363ef['name'];}_0x72e37b['status'](_0x40def3)['send'](_0x1363ef);};}exports['index']=function(_0x4451fe,_0x6019aa){var _0x337816={},_0x377e5c={},_0x592c2b={'count':0x0,'rows':[]};var _0x4a54b2=_['map'](db[_0x480c('0x2d')][_0x480c('0x2e')],function(_0x5c56e5){return{'name':_0x5c56e5[_0x480c('0x2f')],'type':_0x5c56e5['type']['key']};});_0x377e5c[_0x480c('0x30')]=_[_0x480c('0x31')](_0x4a54b2,_0x480c('0x2c'));_0x377e5c[_0x480c('0x32')]=_[_0x480c('0x33')](_0x4451fe[_0x480c('0x32')]);_0x377e5c[_0x480c('0x34')]=_[_0x480c('0x35')](_0x377e5c['model'],_0x377e5c['query']);_0x337816[_0x480c('0x36')]=_[_0x480c('0x35')](_0x377e5c['model'],qs[_0x480c('0x37')](_0x4451fe[_0x480c('0x32')][_0x480c('0x37')]));_0x337816[_0x480c('0x36')]=_0x337816[_0x480c('0x36')][_0x480c('0x38')]?_0x337816[_0x480c('0x36')]:_0x377e5c[_0x480c('0x30')];if(!_0x4451fe[_0x480c('0x32')][_0x480c('0x39')](_0x480c('0x3a'))){_0x337816[_0x480c('0x23')]=qs[_0x480c('0x23')](_0x4451fe[_0x480c('0x32')][_0x480c('0x23')]);_0x337816['offset']=qs[_0x480c('0x21')](_0x4451fe[_0x480c('0x32')][_0x480c('0x21')]);}_0x337816[_0x480c('0x3b')]=qs['sort'](_0x4451fe[_0x480c('0x32')][_0x480c('0x3c')]);_0x337816['where']=qs[_0x480c('0x34')](_['pick'](_0x4451fe[_0x480c('0x32')],_0x377e5c[_0x480c('0x34')]),_0x4a54b2);if(_0x4451fe[_0x480c('0x32')]['filter']){_0x337816[_0x480c('0x3d')]=_[_0x480c('0x3e')](_0x337816[_0x480c('0x3d')],{'$or':_[_0x480c('0x31')](_0x4a54b2,function(_0x588669){if(_0x588669[_0x480c('0x3f')]!==_0x480c('0x40')){var _0x21877b={};_0x21877b[_0x588669[_0x480c('0x2c')]]={'$like':'%'+_0x4451fe[_0x480c('0x32')]['filter']+'%'};return _0x21877b;}})});}_0x337816=_['merge']({},_0x337816,_0x4451fe[_0x480c('0x41')]);var _0x2b5003={'where':_0x337816[_0x480c('0x3d')]};return db[_0x480c('0x2d')]['count'](_0x2b5003)[_0x480c('0x2a')](function(_0x30d983){_0x592c2b[_0x480c('0x24')]=_0x30d983;if(_0x4451fe[_0x480c('0x32')][_0x480c('0x42')]){_0x337816[_0x480c('0x43')]=[{'all':!![]}];}return db[_0x480c('0x2d')]['findAll'](_0x337816);})[_0x480c('0x2a')](function(_0x4ca83c){_0x592c2b[_0x480c('0x44')]=_0x4ca83c;return _0x592c2b;})[_0x480c('0x2a')](respondWithFilteredResult(_0x6019aa,_0x337816))['catch'](handleError(_0x6019aa,null));};exports[_0x480c('0x45')]=function(_0x2aad21,_0x4bee28){var _0xa5e32d={'raw':!![],'where':{'id':_0x2aad21[_0x480c('0x46')]['id']}},_0x4d62fb={};_0x4d62fb[_0x480c('0x30')]=_[_0x480c('0x33')](db['WhatsappApplication'][_0x480c('0x2e')]);_0x4d62fb[_0x480c('0x32')]=_[_0x480c('0x33')](_0x2aad21[_0x480c('0x32')]);_0x4d62fb[_0x480c('0x34')]=_[_0x480c('0x35')](_0x4d62fb[_0x480c('0x30')],_0x4d62fb[_0x480c('0x32')]);_0xa5e32d[_0x480c('0x36')]=_[_0x480c('0x35')](_0x4d62fb[_0x480c('0x30')],qs['fields'](_0x2aad21[_0x480c('0x32')]['fields']));_0xa5e32d[_0x480c('0x36')]=_0xa5e32d['attributes'][_0x480c('0x38')]?_0xa5e32d[_0x480c('0x36')]:_0x4d62fb[_0x480c('0x30')];if(_0x2aad21[_0x480c('0x32')][_0x480c('0x42')]){_0xa5e32d['include']=[{'all':!![]}];}_0xa5e32d=_[_0x480c('0x3e')]({},_0xa5e32d,_0x2aad21['options']);return db[_0x480c('0x2d')][_0x480c('0x47')](_0xa5e32d)['then'](handleEntityNotFound(_0x4bee28,null))['then'](respondWithResult(_0x4bee28,null))[_0x480c('0x48')](handleError(_0x4bee28,null));};exports['create']=function(_0x2649e0,_0x2c1ca6){return db[_0x480c('0x2d')]['create'](_0x2649e0['body'],{})['then'](respondWithResult(_0x2c1ca6,0xc9))[_0x480c('0x48')](handleError(_0x2c1ca6,null));};exports['update']=function(_0x3d7b08,_0x1ec5a2){if(_0x3d7b08[_0x480c('0x49')]['id']){delete _0x3d7b08[_0x480c('0x49')]['id'];}return db['WhatsappApplication'][_0x480c('0x47')]({'where':{'id':_0x3d7b08[_0x480c('0x46')]['id']}})[_0x480c('0x2a')](handleEntityNotFound(_0x1ec5a2,null))[_0x480c('0x2a')](saveUpdates(_0x3d7b08[_0x480c('0x49')],null))[_0x480c('0x2a')](respondWithResult(_0x1ec5a2,null))[_0x480c('0x48')](handleError(_0x1ec5a2,null));};exports[_0x480c('0x2b')]=function(_0x5d5668,_0x41c2d3){return db[_0x480c('0x2d')]['find']({'where':{'id':_0x5d5668['params']['id']}})[_0x480c('0x2a')](handleEntityNotFound(_0x41c2d3,null))['then'](removeEntity(_0x41c2d3,null))['catch'](handleError(_0x41c2d3,null));}; \ No newline at end of file +var _0x3f35=['include','findAll','rows','show','includeAll','create','body','catch','find','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','ejs','fs-extra','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/license/util','status','end','json','offset','undefined','count','limit','set','apply','reject','update','then','destroy','sendStatus','error','name','send','index','WhatsappApplication','rawAttributes','fieldName','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','filter','merge','where','type','VIRTUAL','options'];(function(_0x22bdd3,_0x552e50){var _0x44d9d9=function(_0x2b4ab9){while(--_0x2b4ab9){_0x22bdd3['push'](_0x22bdd3['shift']());}};_0x44d9d9(++_0x552e50);}(_0x3f35,0x1ae));var _0x53f3=function(_0x5d80de,_0x2cf15d){_0x5d80de=_0x5d80de-0x0;var _0x1c7556=_0x3f35[_0x5d80de];return _0x1c7556;};'use strict';var emlformat=require(_0x53f3('0x0'));var rimraf=require(_0x53f3('0x1'));var zipdir=require(_0x53f3('0x2'));var jsonpatch=require(_0x53f3('0x3'));var rp=require(_0x53f3('0x4'));var moment=require(_0x53f3('0x5'));var BPromise=require(_0x53f3('0x6'));var Mustache=require('mustache');var util=require(_0x53f3('0x7'));var path=require('path');var sox=require(_0x53f3('0x8'));var csv=require('to-csv');var ejs=require(_0x53f3('0x9'));var fs=require('fs');var fs_extra=require(_0x53f3('0xa'));var _=require(_0x53f3('0xb'));var squel=require(_0x53f3('0xc'));var crypto=require('crypto');var jsforce=require(_0x53f3('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x53f3('0xe'));var Redis=require(_0x53f3('0xf'));var authService=require(_0x53f3('0x10'));var qs=require(_0x53f3('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x53f3('0x12'))(_0x53f3('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x53f3('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x486bf9,_0x2225dd){_0x2225dd=_0x2225dd||0xcc;return function(_0x57888b){if(_0x57888b){return _0x486bf9['sendStatus'](_0x2225dd);}return _0x486bf9[_0x53f3('0x15')](_0x2225dd)[_0x53f3('0x16')]();};}function respondWithResult(_0x59e7c5,_0x490b27){_0x490b27=_0x490b27||0xc8;return function(_0xfd9652){if(_0xfd9652){return _0x59e7c5['status'](_0x490b27)[_0x53f3('0x17')](_0xfd9652);}};}function respondWithFilteredResult(_0x3d485c,_0x27db9a){return function(_0x2319cd){if(_0x2319cd){var _0x3f2dc3=typeof _0x27db9a[_0x53f3('0x18')]===_0x53f3('0x19')&&typeof _0x27db9a['limit']===_0x53f3('0x19');var _0x1d2319=_0x2319cd[_0x53f3('0x1a')];var _0x5ae118=_0x3f2dc3?0x0:_0x27db9a['offset'];var _0x924dae=_0x3f2dc3?_0x2319cd['count']:_0x27db9a[_0x53f3('0x18')]+_0x27db9a[_0x53f3('0x1b')];var _0x58c850;if(_0x924dae>=_0x1d2319){_0x924dae=_0x1d2319;_0x58c850=0xc8;}else{_0x58c850=0xce;}_0x3d485c[_0x53f3('0x15')](_0x58c850);return _0x3d485c[_0x53f3('0x1c')]('Content-Range',_0x5ae118+'-'+_0x924dae+'/'+_0x1d2319)[_0x53f3('0x17')](_0x2319cd);}return null;};}function patchUpdates(_0x30b6a8){return function(_0x102517){try{jsonpatch[_0x53f3('0x1d')](_0x102517,_0x30b6a8,!![]);}catch(_0x36e191){return BPromise[_0x53f3('0x1e')](_0x36e191);}return _0x102517['save']();};}function saveUpdates(_0xef4593,_0x268a0a){return function(_0x2ba5db){if(_0x2ba5db){return _0x2ba5db[_0x53f3('0x1f')](_0xef4593)[_0x53f3('0x20')](function(_0x5055ce){return _0x5055ce;});}return null;};}function removeEntity(_0x1ab104,_0x41be9b){return function(_0x3bad5b){if(_0x3bad5b){return _0x3bad5b[_0x53f3('0x21')]()[_0x53f3('0x20')](function(){_0x1ab104[_0x53f3('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x11bb9d,_0x5902b7){return function(_0x513d2d){if(!_0x513d2d){_0x11bb9d[_0x53f3('0x22')](0x194);}return _0x513d2d;};}function handleError(_0x51b74b,_0x1772da){_0x1772da=_0x1772da||0x1f4;return function(_0x36aa64){logger[_0x53f3('0x23')](_0x36aa64['stack']);if(_0x36aa64['name']){delete _0x36aa64[_0x53f3('0x24')];}_0x51b74b[_0x53f3('0x15')](_0x1772da)[_0x53f3('0x25')](_0x36aa64);};}exports[_0x53f3('0x26')]=function(_0x173bf8,_0x5a4b2f){var _0x1b172b={},_0x1ccd36={},_0x27d692={'count':0x0,'rows':[]};var _0x17f510=_['map'](db[_0x53f3('0x27')][_0x53f3('0x28')],function(_0x5afd83){return{'name':_0x5afd83[_0x53f3('0x29')],'type':_0x5afd83['type']['key']};});_0x1ccd36[_0x53f3('0x2a')]=_[_0x53f3('0x2b')](_0x17f510,'name');_0x1ccd36['query']=_[_0x53f3('0x2c')](_0x173bf8['query']);_0x1ccd36[_0x53f3('0x2d')]=_[_0x53f3('0x2e')](_0x1ccd36[_0x53f3('0x2a')],_0x1ccd36[_0x53f3('0x2f')]);_0x1b172b[_0x53f3('0x30')]=_[_0x53f3('0x2e')](_0x1ccd36['model'],qs['fields'](_0x173bf8['query'][_0x53f3('0x31')]));_0x1b172b[_0x53f3('0x30')]=_0x1b172b[_0x53f3('0x30')][_0x53f3('0x32')]?_0x1b172b['attributes']:_0x1ccd36[_0x53f3('0x2a')];if(!_0x173bf8['query'][_0x53f3('0x33')](_0x53f3('0x34'))){_0x1b172b[_0x53f3('0x1b')]=qs[_0x53f3('0x1b')](_0x173bf8['query'][_0x53f3('0x1b')]);_0x1b172b['offset']=qs[_0x53f3('0x18')](_0x173bf8['query']['offset']);}_0x1b172b['order']=qs[_0x53f3('0x35')](_0x173bf8[_0x53f3('0x2f')]['sort']);_0x1b172b['where']=qs[_0x53f3('0x2d')](_['pick'](_0x173bf8[_0x53f3('0x2f')],_0x1ccd36['filters']),_0x17f510);if(_0x173bf8['query'][_0x53f3('0x36')]){_0x1b172b['where']=_[_0x53f3('0x37')](_0x1b172b[_0x53f3('0x38')],{'$or':_[_0x53f3('0x2b')](_0x17f510,function(_0x5cdfc1){if(_0x5cdfc1[_0x53f3('0x39')]!==_0x53f3('0x3a')){var _0x502ff1={};_0x502ff1[_0x5cdfc1[_0x53f3('0x24')]]={'$like':'%'+_0x173bf8['query'][_0x53f3('0x36')]+'%'};return _0x502ff1;}})});}_0x1b172b=_[_0x53f3('0x37')]({},_0x1b172b,_0x173bf8[_0x53f3('0x3b')]);var _0x412a0f={'where':_0x1b172b[_0x53f3('0x38')]};return db['WhatsappApplication']['count'](_0x412a0f)[_0x53f3('0x20')](function(_0x4ce79e){_0x27d692[_0x53f3('0x1a')]=_0x4ce79e;if(_0x173bf8[_0x53f3('0x2f')]['includeAll']){_0x1b172b[_0x53f3('0x3c')]=[{'all':!![]}];}return db[_0x53f3('0x27')][_0x53f3('0x3d')](_0x1b172b);})[_0x53f3('0x20')](function(_0x13ac07){_0x27d692[_0x53f3('0x3e')]=_0x13ac07;return _0x27d692;})[_0x53f3('0x20')](respondWithFilteredResult(_0x5a4b2f,_0x1b172b))['catch'](handleError(_0x5a4b2f,null));};exports[_0x53f3('0x3f')]=function(_0x2cc2c9,_0x20a6c0){var _0x41dc94={'raw':!![],'where':{'id':_0x2cc2c9['params']['id']}},_0x1eab17={};_0x1eab17[_0x53f3('0x2a')]=_[_0x53f3('0x2c')](db[_0x53f3('0x27')]['rawAttributes']);_0x1eab17['query']=_[_0x53f3('0x2c')](_0x2cc2c9[_0x53f3('0x2f')]);_0x1eab17['filters']=_['intersection'](_0x1eab17[_0x53f3('0x2a')],_0x1eab17['query']);_0x41dc94[_0x53f3('0x30')]=_[_0x53f3('0x2e')](_0x1eab17[_0x53f3('0x2a')],qs[_0x53f3('0x31')](_0x2cc2c9[_0x53f3('0x2f')][_0x53f3('0x31')]));_0x41dc94[_0x53f3('0x30')]=_0x41dc94[_0x53f3('0x30')][_0x53f3('0x32')]?_0x41dc94[_0x53f3('0x30')]:_0x1eab17['model'];if(_0x2cc2c9[_0x53f3('0x2f')][_0x53f3('0x40')]){_0x41dc94[_0x53f3('0x3c')]=[{'all':!![]}];}_0x41dc94=_[_0x53f3('0x37')]({},_0x41dc94,_0x2cc2c9[_0x53f3('0x3b')]);return db[_0x53f3('0x27')]['find'](_0x41dc94)['then'](handleEntityNotFound(_0x20a6c0,null))['then'](respondWithResult(_0x20a6c0,null))['catch'](handleError(_0x20a6c0,null));};exports[_0x53f3('0x41')]=function(_0x263df8,_0x11dddc){return db[_0x53f3('0x27')][_0x53f3('0x41')](_0x263df8[_0x53f3('0x42')],{})[_0x53f3('0x20')](respondWithResult(_0x11dddc,0xc9))[_0x53f3('0x43')](handleError(_0x11dddc,null));};exports[_0x53f3('0x1f')]=function(_0x2a02bd,_0x3488f0){if(_0x2a02bd['body']['id']){delete _0x2a02bd['body']['id'];}return db[_0x53f3('0x27')][_0x53f3('0x44')]({'where':{'id':_0x2a02bd[_0x53f3('0x45')]['id']}})[_0x53f3('0x20')](handleEntityNotFound(_0x3488f0,null))[_0x53f3('0x20')](saveUpdates(_0x2a02bd[_0x53f3('0x42')],null))[_0x53f3('0x20')](respondWithResult(_0x3488f0,null))[_0x53f3('0x43')](handleError(_0x3488f0,null));};exports[_0x53f3('0x21')]=function(_0x27f2f4,_0xdb5dd8){return db[_0x53f3('0x27')]['find']({'where':{'id':_0x27f2f4[_0x53f3('0x45')]['id']}})[_0x53f3('0x20')](handleEntityNotFound(_0xdb5dd8,null))[_0x53f3('0x20')](removeEntity(_0xdb5dd8,null))['catch'](handleError(_0xdb5dd8,null));}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.model.js b/server/api/whatsappApplication/whatsappApplication.model.js index 4f97fa6..b71084e 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 _0x19da=['exports','define','WhatsappApplication','whatsapp_applications','utf8mb4','util','api','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x220ed6,_0x58fd75){var _0x38ee49=function(_0x222c27){while(--_0x222c27){_0x220ed6['push'](_0x220ed6['shift']());}};_0x38ee49(++_0x58fd75);}(_0x19da,0x9f));var _0xa19d=function(_0x1778e1,_0x3e1727){_0x1778e1=_0x1778e1-0x0;var _0x2bc4c6=_0x19da[_0x1778e1];return _0x2bc4c6;};'use strict';var _=require('lodash');var util=require(_0xa19d('0x0'));var logger=require('../../config/logger')(_0xa19d('0x1'));var moment=require('moment');var BPromise=require(_0xa19d('0x2'));var rp=require(_0xa19d('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa19d('0x4'));var config=require(_0xa19d('0x5'));var attributes=require('./whatsappApplication.attributes');module[_0xa19d('0x6')]=function(_0x330adb,_0x1f6e10){return _0x330adb[_0xa19d('0x7')](_0xa19d('0x8'),attributes,{'tableName':_0xa19d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa19d('0xa'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x99c9=['moment','bluebird','request-promise','rimraf','../../config/environment','./whatsappApplication.attributes','exports','define','WhatsappApplication','whatsapp_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api'];(function(_0x471b3f,_0x20cb13){var _0x4fad9c=function(_0x58d822){while(--_0x58d822){_0x471b3f['push'](_0x471b3f['shift']());}};_0x4fad9c(++_0x20cb13);}(_0x99c9,0x13c));var _0x999c=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x99c9[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0x999c('0x0'));var util=require(_0x999c('0x1'));var logger=require(_0x999c('0x2'))(_0x999c('0x3'));var moment=require(_0x999c('0x4'));var BPromise=require(_0x999c('0x5'));var rp=require(_0x999c('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x999c('0x7'));var config=require(_0x999c('0x8'));var attributes=require(_0x999c('0x9'));module[_0x999c('0xa')]=function(_0x2bdd73,_0x14df32){return _0x2bdd73[_0x999c('0xb')](_0x999c('0xc'),attributes,{'tableName':_0x999c('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x999c('0xe'),'collate':_0x999c('0xf')});}; \ No newline at end of file diff --git a/server/api/whatsappApplication/whatsappApplication.rpc.js b/server/api/whatsappApplication/whatsappApplication.rpc.js index c7c66f2..5c5b214 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 _0x55ca=['rpc','../../config/environment','jayson/promise','client','http','request','then','WhatsappApplication,\x20%s,\x20%s','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','ioredis','../../mysqldb','../../config/logger'];(function(_0x399290,_0x1c758b){var _0x2163d0=function(_0xa3a4fd){while(--_0xa3a4fd){_0x399290['push'](_0x399290['shift']());}};_0x2163d0(++_0x1c758b);}(_0x55ca,0x126));var _0xa55c=function(_0x16cb4b,_0x481b00){_0x16cb4b=_0x16cb4b-0x0;var _0x2e1bd8=_0x55ca[_0x16cb4b];return _0x2e1bd8;};'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')]('WhatsappApplication,\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')]('WhatsappApplication,\x20%s,\x20%s',_0x4d0624,_0xa55c('0xd'));_0x2537f0(_0x52a3bc[_0xa55c('0x15')][_0xa55c('0x13')]);}})[_0xa55c('0x16')](function(_0x1c4cfd){logger[_0xa55c('0x11')](_0xa55c('0xc'),_0x4d0624,_0x1c4cfd);_0x57e069(_0x1c4cfd);});});} \ No newline at end of file +var _0x6aa7=['result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','request','then','info','WhatsappApplication,\x20%s,\x20%s','request\x20sent','debug','WhatsappApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x47dd70,_0x46086d){var _0x5cb210=function(_0x9c5d4a){while(--_0x9c5d4a){_0x47dd70['push'](_0x47dd70['shift']());}};_0x5cb210(++_0x46086d);}(_0x6aa7,0x178));var _0x76aa=function(_0x40db31,_0x2fc757){_0x40db31=_0x40db31-0x0;var _0x395784=_0x6aa7[_0x40db31];return _0x395784;};'use strict';var _=require(_0x76aa('0x0'));var util=require('util');var moment=require(_0x76aa('0x1'));var BPromise=require(_0x76aa('0x2'));var rs=require(_0x76aa('0x3'));var fs=require('fs');var Redis=require(_0x76aa('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x76aa('0x5'));var logger=require(_0x76aa('0x6'))(_0x76aa('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x76aa('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x32dee5,_0x36d12b,_0xa9b695){return new BPromise(function(_0x56d6bc,_0x3dae33){return client[_0x76aa('0x9')](_0x32dee5,_0xa9b695)[_0x76aa('0xa')](function(_0x557d69){logger[_0x76aa('0xb')](_0x76aa('0xc'),_0x36d12b,_0x76aa('0xd'));logger[_0x76aa('0xe')](_0x76aa('0xf'),_0x36d12b,_0x76aa('0xd'),JSON[_0x76aa('0x10')](_0x557d69));if(_0x557d69[_0x76aa('0x11')]){if(_0x557d69[_0x76aa('0x11')][_0x76aa('0x12')]===0x1f4){logger['error'](_0x76aa('0xc'),_0x36d12b,_0x557d69['error'][_0x76aa('0x13')]);return _0x3dae33(_0x557d69[_0x76aa('0x11')][_0x76aa('0x13')]);}logger[_0x76aa('0x11')](_0x76aa('0xc'),_0x36d12b,_0x557d69['error']['message']);return _0x56d6bc(_0x557d69[_0x76aa('0x11')]['message']);}else{logger[_0x76aa('0xb')](_0x76aa('0xc'),_0x36d12b,'request\x20sent');_0x56d6bc(_0x557d69[_0x76aa('0x14')]['message']);}})[_0x76aa('0x15')](function(_0x5181d2){logger[_0x76aa('0x11')](_0x76aa('0xc'),_0x36d12b,_0x5181d2);_0x3dae33(_0x5181d2);});});} \ No newline at end of file diff --git a/server/api/whatsappInteraction/index.js b/server/api/whatsappInteraction/index.js index b127cf7..32bc55b 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 _0x199c=['tracked','whatsapp','put','whatsappinteraction:update','delete','whatsappinteraction:destroy','destroy','removeTags','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/:id','show','getMessages','/:id/download','download','create','post','/:id/messages','/:id/tags'];(function(_0x367195,_0x2a7d8d){var _0x2be48f=function(_0xb2a17a){while(--_0xb2a17a){_0x367195['push'](_0x367195['shift']());}};_0x2be48f(++_0x2a7d8d);}(_0x199c,0x1d8));var _0xc199=function(_0x232a6c,_0x22572e){_0x232a6c=_0x232a6c-0x0;var _0x17cf55=_0x199c[_0x232a6c];return _0x17cf55;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xc199('0x0'));var timeout=require(_0xc199('0x1'));var express=require(_0xc199('0x2'));var router=express[_0xc199('0x3')]();var fs_extra=require(_0xc199('0x4'));var auth=require(_0xc199('0x5'));var interaction=require(_0xc199('0x6'));var config=require(_0xc199('0x7'));var controller=require('./whatsappInteraction.controller');router[_0xc199('0x8')]('/',auth[_0xc199('0x9')](),controller['index']);router['get'](_0xc199('0xa'),auth[_0xc199('0x9')](),controller[_0xc199('0xb')]);router[_0xc199('0x8')](_0xc199('0xc'),auth[_0xc199('0x9')](),controller[_0xc199('0xd')]);router[_0xc199('0x8')]('/:id/messages',auth[_0xc199('0x9')](),controller[_0xc199('0xe')]);router[_0xc199('0x8')](_0xc199('0xf'),auth[_0xc199('0x9')](),controller[_0xc199('0x10')]);router['post']('/',auth[_0xc199('0x9')](),controller[_0xc199('0x11')]);router[_0xc199('0x12')](_0xc199('0x13'),auth[_0xc199('0x9')](),controller['addMessage']);router[_0xc199('0x12')](_0xc199('0x14'),auth[_0xc199('0x9')](),interaction[_0xc199('0x15')](_0xc199('0x16'),'whatsappinteraction:addtags'),controller['addTags']);router[_0xc199('0x17')]('/:id',auth[_0xc199('0x9')](),interaction[_0xc199('0x15')]('whatsapp',_0xc199('0x18')),controller['update']);router[_0xc199('0x19')](_0xc199('0xc'),auth[_0xc199('0x9')](),interaction[_0xc199('0x15')](_0xc199('0x16'),_0xc199('0x1a')),controller[_0xc199('0x1b')]);router[_0xc199('0x19')](_0xc199('0x14'),auth[_0xc199('0x9')](),controller[_0xc199('0x1c')]);module['exports']=router; \ No newline at end of file +var _0x9c5a=['isAuthenticated','show','/:id/messages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','whatsapp','whatsappinteraction:addtags','addTags','put','/:id','whatsappinteraction:update','update','delete','whatsappinteraction:destroy','destroy','removeTags','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','index','describe'];(function(_0x1df130,_0xeba2b5){var _0x28f9f2=function(_0x21e0c1){while(--_0x21e0c1){_0x1df130['push'](_0x1df130['shift']());}};_0x28f9f2(++_0xeba2b5);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0x4ffa01,_0x31e39d){_0x4ffa01=_0x4ffa01-0x0;var _0x721cfd=_0x9c5a[_0x4ffa01];return _0x721cfd;};'use strict';var multer=require(_0xa9c5('0x0'));var util=require(_0xa9c5('0x1'));var path=require('path');var timeout=require(_0xa9c5('0x2'));var express=require(_0xa9c5('0x3'));var router=express[_0xa9c5('0x4')]();var fs_extra=require(_0xa9c5('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xa9c5('0x6'));var config=require(_0xa9c5('0x7'));var controller=require('./whatsappInteraction.controller');router[_0xa9c5('0x8')]('/',auth['isAuthenticated'](),controller[_0xa9c5('0x9')]);router[_0xa9c5('0x8')]('/describe',auth['isAuthenticated'](),controller[_0xa9c5('0xa')]);router[_0xa9c5('0x8')]('/:id',auth[_0xa9c5('0xb')](),controller[_0xa9c5('0xc')]);router['get'](_0xa9c5('0xd'),auth[_0xa9c5('0xb')](),controller['getMessages']);router['get'](_0xa9c5('0xe'),auth[_0xa9c5('0xb')](),controller[_0xa9c5('0xf')]);router[_0xa9c5('0x10')]('/',auth[_0xa9c5('0xb')](),controller[_0xa9c5('0x11')]);router[_0xa9c5('0x10')](_0xa9c5('0xd'),auth[_0xa9c5('0xb')](),controller[_0xa9c5('0x12')]);router['post'](_0xa9c5('0x13'),auth[_0xa9c5('0xb')](),interaction[_0xa9c5('0x14')](_0xa9c5('0x15'),_0xa9c5('0x16')),controller[_0xa9c5('0x17')]);router[_0xa9c5('0x18')](_0xa9c5('0x19'),auth[_0xa9c5('0xb')](),interaction[_0xa9c5('0x14')]('whatsapp',_0xa9c5('0x1a')),controller[_0xa9c5('0x1b')]);router[_0xa9c5('0x1c')]('/:id',auth[_0xa9c5('0xb')](),interaction[_0xa9c5('0x14')](_0xa9c5('0x15'),_0xa9c5('0x1d')),controller[_0xa9c5('0x1e')]);router[_0xa9c5('0x1c')](_0xa9c5('0x13'),auth[_0xa9c5('0xb')](),controller[_0xa9c5('0x1f')]);module[_0xa9c5('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 5ab1803..7d4a110 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 _0xc21c=['out','sequelize','moment','BOOLEAN','DATE','STRING','ENUM'];(function(_0x104ed4,_0x4580d4){var _0x139c0d=function(_0x5e8e6b){while(--_0x5e8e6b){_0x104ed4['push'](_0x104ed4['shift']());}};_0x139c0d(++_0x4580d4);}(_0xc21c,0x166));var _0xcc21=function(_0x269065,_0x48e752){_0x269065=_0x269065-0x0;var _0x5908d3=_0xc21c[_0x269065];return _0x5908d3;};'use strict';var Sequelize=require(_0xcc21('0x0'));var moment=require(_0xcc21('0x1'));module['exports']={'closed':{'type':Sequelize[_0xcc21('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xcc21('0x3')]},'disposition':{'type':Sequelize[_0xcc21('0x4')]},'secondDisposition':{'type':Sequelize[_0xcc21('0x4')]},'thirdDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xcc21('0x4')]},'phone':{'type':Sequelize[_0xcc21('0x4')]},'read1stAt':{'type':Sequelize[_0xcc21('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xcc21('0x5')]('in',_0xcc21('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xcc21('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xcc21('0x5')]('in','out'),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0xcc21('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x28b1=['BOOLEAN','sequelize','moment','exports','DATE','STRING','out'];(function(_0x2109ef,_0x4892e8){var _0x1d0868=function(_0xf1c545){while(--_0xf1c545){_0x2109ef['push'](_0x2109ef['shift']());}};_0x1d0868(++_0x4892e8);}(_0x28b1,0x1d6));var _0x128b=function(_0x1f5881,_0x5eb62d){_0x1f5881=_0x1f5881-0x0;var _0x571e0d=_0x28b1[_0x1f5881];return _0x571e0d;};'use strict';var Sequelize=require(_0x128b('0x0'));var moment=require(_0x128b('0x1'));module[_0x128b('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x128b('0x3')]},'disposition':{'type':Sequelize[_0x128b('0x4')]},'secondDisposition':{'type':Sequelize[_0x128b('0x4')]},'thirdDisposition':{'type':Sequelize[_0x128b('0x4')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x128b('0x3')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x128b('0x3')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x128b('0x5')),'defaultValue':'in','allowNull':![]},'autoreplyExecuted':{'type':Sequelize[_0x128b('0x6')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.controller.js b/server/api/whatsappInteraction/whatsappInteraction.controller.js index cd604d7..5437e4e 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 _0x40ca=['send','Users','map','fullname','TagIds','Tags','split','forEach','push','catch','index','WhatsappInteraction','rawAttributes','fieldName','key','query','keys','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','pick','filters','select','field','from','tools_tags','ui.WhatsappInteractionId','user_has_whatsapp_interactions','u.id\x20=\x20ui.UserId','left_join','cm_contacts','o.id\x20=\x20i.UserId','whatsapp_accounts','a.id\x20=\x20i.WhatsappAccountId','whatsapp_messages','me.WhatsappInteractionId\x20=\x20i.id','whatsapp_interaction_has_tags','it.WhatsappInteractionId\x20=\x20i.id','expr','search','parseSearch','conditions','find','unreadMessages','value','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','type','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','buildExpression','body','text','some','compact','isEmpty','where','i.WhatsappAccountId\x20IN\x20?','concat','createdAt','parse','$lte','null','\x20IS\x20NULL','\x20=\x20?','read','having','`unreadMessages`\x20=\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','contactName','DESC','t.id\x20IN\x20?','resolve','WhatsappAccountId','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','user','getWhatsappAccounts','i.WhatsappAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','Contact.email','c.phone','Contact.mobile','Contact.fax','Owner.internal','ui.WhatsappInteractionId\x20IN\x20?','groupBy','WhatsappInteractionId','all','rows','params','includeAll','include','options','create','destroy','describe','addMessage','ids','omit','getMessages','findOne','WhatsappMessage','sort','$gte','format','YYYY-MM-DD\x20HH:mm:ss','addTags','spread','findAll','color','whatsappInteractionTags:save','removeTags','download','root','server','files','tmp','join','attachments','CmContact','lastName','Attachment','direction','secret','WhatsappAccount','Account','Owner','get','mkdirSync','Whatsapp','disposition','basename','existsSync','createWriteStream','out','System','views','downloadInteraction.ejs','transcript-','createPdfFromHTML','log','err','eml-format','fast-json-patch','request-promise','moment','bluebird','util','sox','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','./whatsappInteraction.socket','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','end','error','stack','name'];(function(_0x6ed519,_0xc1749e){var _0x38f998=function(_0x17db17){while(--_0x17db17){_0x6ed519['push'](_0x6ed519['shift']());}};_0x38f998(++_0xc1749e);}(_0x40ca,0x1a1));var _0xa40c=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0x40ca[_0x30ae5e];return _0x1f2e93;};'use strict';var emlformat=require(_0xa40c('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xa40c('0x1'));var rp=require(_0xa40c('0x2'));var moment=require(_0xa40c('0x3'));var BPromise=require(_0xa40c('0x4'));var Mustache=require('mustache');var util=require(_0xa40c('0x5'));var path=require('path');var sox=require(_0xa40c('0x6'));var csv=require('to-csv');var ejs=require(_0xa40c('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xa40c('0x8'));var squel=require(_0xa40c('0x9'));var crypto=require(_0xa40c('0xa'));var jsforce=require(_0xa40c('0xb'));var deskjs=require(_0xa40c('0xc'));var toCsv=require('to-csv');var querystring=require(_0xa40c('0xd'));var Papa=require(_0xa40c('0xe'));var Redis=require(_0xa40c('0xf'));var authService=require(_0xa40c('0x10'));var qs=require(_0xa40c('0x11'));var as=require(_0xa40c('0x12'));var pdf=require(_0xa40c('0x13'));var hardwareService=require(_0xa40c('0x14'));var logger=require(_0xa40c('0x15'))(_0xa40c('0x16'));var utils=require('../../config/utils');var config=require(_0xa40c('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xa40c('0x18'))['db'];config[_0xa40c('0x19')]=_[_0xa40c('0x1a')](config[_0xa40c('0x19')],{'host':_0xa40c('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa40c('0x19')]));require(_0xa40c('0x1c'))['register'](socket);function respondWithStatusCode(_0x298242,_0x52460c){_0x52460c=_0x52460c||0xcc;return function(_0x39e072){if(_0x39e072){return _0x298242[_0xa40c('0x1d')](_0x52460c);}return _0x298242[_0xa40c('0x1e')](_0x52460c)['end']();};}function respondWithResult(_0x55ff88,_0xbeacab){_0xbeacab=_0xbeacab||0xc8;return function(_0x13c73a){if(_0x13c73a){return _0x55ff88[_0xa40c('0x1e')](_0xbeacab)[_0xa40c('0x1f')](_0x13c73a);}};}function respondWithFilteredResult(_0xa2f9bb,_0x1cd357){return function(_0x224e78){if(_0x224e78){var _0x2b6df4=typeof _0x1cd357[_0xa40c('0x20')]===_0xa40c('0x21')&&typeof _0x1cd357[_0xa40c('0x22')]===_0xa40c('0x21');var _0x4fed31=_0x224e78[_0xa40c('0x23')];var _0x1b82c8=_0x2b6df4?0x0:_0x1cd357['offset'];var _0x508ee7=_0x2b6df4?_0x224e78[_0xa40c('0x23')]:_0x1cd357[_0xa40c('0x20')]+_0x1cd357['limit'];var _0x5c3133;if(_0x508ee7>=_0x4fed31){_0x508ee7=_0x4fed31;_0x5c3133=0xc8;}else{_0x5c3133=0xce;}_0xa2f9bb[_0xa40c('0x1e')](_0x5c3133);return _0xa2f9bb[_0xa40c('0x24')](_0xa40c('0x25'),_0x1b82c8+'-'+_0x508ee7+'/'+_0x4fed31)[_0xa40c('0x1f')](_0x224e78);}return null;};}function patchUpdates(_0xa93761){return function(_0x12d7f8){try{jsonpatch[_0xa40c('0x26')](_0x12d7f8,_0xa93761,!![]);}catch(_0x12324b){return BPromise[_0xa40c('0x27')](_0x12324b);}return _0x12d7f8[_0xa40c('0x28')]();};}function saveUpdates(_0x5bba37,_0x50158d){return function(_0x19d6f3){if(_0x19d6f3){return _0x19d6f3[_0xa40c('0x29')](_0x5bba37)['then'](function(_0xfb5deb){return _0xfb5deb;});}return null;};}function removeEntity(_0xe117f8,_0x990dc1){return function(_0x47dd18){if(_0x47dd18){return _0x47dd18['destroy']()[_0xa40c('0x2a')](function(){_0xe117f8[_0xa40c('0x1e')](0xcc)[_0xa40c('0x2b')]();});}};}function handleEntityNotFound(_0x382e63,_0x4dd589){return function(_0xb9f0c5){if(!_0xb9f0c5){_0x382e63[_0xa40c('0x1d')](0x194);}return _0xb9f0c5;};}function handleError(_0x487145,_0x387951){_0x387951=_0x387951||0x1f4;return function(_0x154389){logger[_0xa40c('0x2c')](_0x154389[_0xa40c('0x2d')]);if(_0x154389[_0xa40c('0x2e')]){delete _0x154389[_0xa40c('0x2e')];}_0x487145['status'](_0x387951)[_0xa40c('0x2f')](_0x154389);};}function getInteractionUsers(_0x39d197,_0x213ba9){return new BPromise(function(_0x36d1b4,_0x3a47a3){try{if(_0x213ba9[_0x39d197['id']]){_0x39d197[_0xa40c('0x30')]=_[_0xa40c('0x31')](_0x213ba9[_0x39d197['id']],function(_0x5551f2){return{'id':_0x5551f2['id'],'fullname':_0x5551f2[_0xa40c('0x32')]};});}}catch(_0xd036ee){_0x3a47a3(_0xd036ee);}_0x36d1b4(_0x39d197);});}function getInteractionTags(_0x483801,_0x431f8c){return new BPromise(function(_0x20bba3,_0x197798){try{if(_0x483801[_0xa40c('0x33')]){_0x483801[_0xa40c('0x34')]=[];_0x483801[_0xa40c('0x33')][_0xa40c('0x35')](',')[_0xa40c('0x36')](function(_0x45c442){_0x483801[_0xa40c('0x34')][_0xa40c('0x37')](_0x431f8c[_0x45c442]);});}delete _0x483801['TagIds'];}catch(_0x5629f7){_0x197798(_0x5629f7);}_0x20bba3(_0x483801);});}function updateWhatsappInteraction(_0x457981,_0x19977d,_0xbfad74){return new BPromise(function(_0x1b981d,_0x3206f5){return getInteractionUsers(_0x457981,_0xbfad74)[_0xa40c('0x2a')](function(_0x42f86c){return getInteractionTags(_0x42f86c,_0x19977d);})['then'](function(_0x42a735){_0x1b981d(_0x42a735);})[_0xa40c('0x38')](function(_0x2f4323){_0x3206f5(_0x2f4323);});});}exports[_0xa40c('0x39')]=function(_0x82f744,_0x24b389){var _0x24008c={},_0x47522f={},_0x160c1a={'count':0x0,'rows':[]};var _0x2e3098=_['map'](db[_0xa40c('0x3a')][_0xa40c('0x3b')],function(_0x13bfe7){return{'name':_0x13bfe7[_0xa40c('0x3c')],'type':_0x13bfe7['type'][_0xa40c('0x3d')]};});_0x47522f['model']=_[_0xa40c('0x31')](_0x2e3098,'name');_0x47522f[_0xa40c('0x3e')]=_[_0xa40c('0x3f')](_0x82f744[_0xa40c('0x3e')]);_0x47522f['filters']=_['intersection'](_0x47522f[_0xa40c('0x40')],_0x47522f[_0xa40c('0x3e')]);_0x24008c[_0xa40c('0x41')]=_[_0xa40c('0x42')](_0x47522f[_0xa40c('0x40')],qs[_0xa40c('0x43')](_0x82f744['query'][_0xa40c('0x43')]));_0x24008c[_0xa40c('0x41')]=_0x24008c[_0xa40c('0x41')][_0xa40c('0x44')]?_0x24008c[_0xa40c('0x41')]:_0x47522f['model'];if(!_0x82f744['query'][_0xa40c('0x45')](_0xa40c('0x46'))){_0x24008c[_0xa40c('0x22')]=qs[_0xa40c('0x22')](_0x82f744[_0xa40c('0x3e')][_0xa40c('0x22')]);_0x24008c[_0xa40c('0x20')]=qs['offset'](_0x82f744['query'][_0xa40c('0x20')]);}_0x24008c['order']=qs['sort'](_0x82f744[_0xa40c('0x3e')]['sort']);_0x24008c['where']=qs['filters'](_[_0xa40c('0x47')](_0x82f744[_0xa40c('0x3e')],_0x47522f[_0xa40c('0x48')]),_0x2e3098);var _0x35badf=[];var _0x4796bf=squel[_0xa40c('0x49')]()[_0xa40c('0x4a')]('id')[_0xa40c('0x4a')](_0xa40c('0x2e'))[_0xa40c('0x4a')]('color')[_0xa40c('0x4b')](_0xa40c('0x4c'));var _0x51d403=squel['select']()[_0xa40c('0x4a')]('u.id')['field']('u.fullname')[_0xa40c('0x4a')](_0xa40c('0x4d'))[_0xa40c('0x4b')](_0xa40c('0x4e'),'ui')['left_join']('users','u',_0xa40c('0x4f'));var _0x404a28=squel['select']()[_0xa40c('0x4b')]('whatsapp_interactions','i')[_0xa40c('0x50')](_0xa40c('0x51'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join']('users','o',_0xa40c('0x52'))[_0xa40c('0x50')](_0xa40c('0x53'),'a',_0xa40c('0x54'))['left_join'](_0xa40c('0x55'),'me',_0xa40c('0x56'))[_0xa40c('0x50')](_0xa40c('0x57'),'it',_0xa40c('0x58'))[_0xa40c('0x50')](_0xa40c('0x4c'),'t','t.id\x20=\x20it.TagId');var _0x4ba3af=squel[_0xa40c('0x59')]();var _0x52b267=[];var _0x81432c=squel[_0xa40c('0x59')]();var _0x7cde92;if(_0x82f744[_0xa40c('0x3e')][_0xa40c('0x5a')]){_0x7cde92=as[_0xa40c('0x5b')](_0x82f744['query']['search']);var _0x59ea8e=_0x7cde92['sqlOperator'];for(var _0xf1c757=0x0;_0xf1c757<_0x7cde92[_0xa40c('0x5c')][_0xa40c('0x44')];_0xf1c757++){var _0x26439b=_0x7cde92[_0xa40c('0x5c')][_0xf1c757];var _0x2b85d8='i';var _0x46781c=_[_0xa40c('0x5d')](_0x2e3098,[_0xa40c('0x2e'),_0x26439b[_0xa40c('0x4a')]]);if(!_0x46781c){switch(_0x26439b[_0xa40c('0x4a')]){case _0xa40c('0x5e'):if(_0x26439b[_0xa40c('0x5f')]==0x1){_0x404a28['having']('`'+_0x26439b[_0xa40c('0x4a')]+_0xa40c('0x60'));}else{_0x404a28['having']('`'+_0x26439b['field']+_0xa40c('0x61'));}break;case _0xa40c('0x62'):if(_0x26439b[_0xa40c('0x63')]===_0xa40c('0x64')){if(_0x26439b[_0xa40c('0x5f')][_0xa40c('0x35')]('\x20')[_0xa40c('0x44')]>0x1){_0x4ba3af[_0x59ea8e](_0xa40c('0x65'),qs[_0xa40c('0x66')](_0x26439b['value']),null);}else{var _0x717047='%'+_0x26439b['value']+'%';_0x4ba3af[_0x59ea8e](_0xa40c('0x67'),_0x717047,_0x717047,_0x717047);}}else{_0x46781c=_['find'](_0x2e3098,[_0xa40c('0x2e'),_0xa40c('0x68')]);_0x26439b['field']=_0xa40c('0x68');_0x170c67=as['buildExpression'](_0x2b85d8,_0x46781c[_0xa40c('0x69')],_0x26439b);_0x4ba3af[_0x59ea8e](_0x170c67['text'],_0x170c67[_0xa40c('0x5f')][_0xa40c('0x6a')],_0x170c67[_0xa40c('0x5f')][_0xa40c('0x2b')]);}break;case _0xa40c('0x6b'):var _0x37eeae=_0x26439b['value'][_0xa40c('0x35')](',')[_0xa40c('0x31')](function(_0x314c47){return Number(_0x314c47);});_0x37eeae['forEach'](function(_0x4100c9){_0x81432c['or'](_0xa40c('0x6c'),'%,'+_0x4100c9+',%');});_0x52b267=_[_0xa40c('0x6d')](_0x52b267,_0x37eeae);break;case _0xa40c('0x6e'):if(_0x26439b[_0xa40c('0x63')]===_0xa40c('0x64')){_0x4ba3af[_0x59ea8e](_0xa40c('0x6f'),'%'+_0x26439b[_0xa40c('0x5f')]+'%',null);}else{_0x46781c=_[_0xa40c('0x5d')](_0x2e3098,['name',_0xa40c('0x70')]);_0x26439b[_0xa40c('0x4a')]=_0xa40c('0x70');_0x170c67=as[_0xa40c('0x71')](_0x2b85d8,_0x46781c['type'],_0x26439b);_0x4ba3af[_0x59ea8e](_0x170c67['text'],_0x170c67['value'][_0xa40c('0x6a')],_0x170c67['value']['end']);}break;case _0xa40c('0x72'):_0x170c67=as[_0xa40c('0x71')]('me',null,_0x26439b);_0x4ba3af[_0x59ea8e](_0x170c67['text'],_0x170c67[_0xa40c('0x5f')]['start'],_0x170c67[_0xa40c('0x5f')][_0xa40c('0x2b')]);break;}}else{var _0x170c67=as['buildExpression'](_0x2b85d8,_0x46781c[_0xa40c('0x69')],_0x26439b);_0x4ba3af[_0x59ea8e](_0x170c67[_0xa40c('0x73')],_0x170c67[_0xa40c('0x5f')][_0xa40c('0x6a')],_0x170c67[_0xa40c('0x5f')][_0xa40c('0x2b')]);}}}else{var _0x4d3f16=_(_0x82f744['query'])[_0xa40c('0x3f')]()['map'](function(_0x331029){return _[_0xa40c('0x74')](_0x2e3098,[_0xa40c('0x2e'),_0x331029])?_0x331029:undefined;})[_0xa40c('0x75')]()[_0xa40c('0x5f')]();if(!_[_0xa40c('0x76')](_0x4d3f16)){_0x4d3f16[_0xa40c('0x36')](function(_0x57cf8a){if(_0x57cf8a==='WhatsappAccountId'){_0x404a28[_0xa40c('0x77')](_0xa40c('0x78'),[][_0xa40c('0x79')](_0x82f744[_0xa40c('0x3e')][_0x57cf8a]));}else if(_0x57cf8a===_0xa40c('0x7a')){var _0x355860=JSON[_0xa40c('0x7b')](_0x82f744[_0xa40c('0x3e')][_0x57cf8a])['$gte'];var _0x717383=JSON[_0xa40c('0x7b')](_0x82f744[_0xa40c('0x3e')][_0x57cf8a])[_0xa40c('0x7c')];_0x404a28[_0xa40c('0x77')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x355860,_0x717383);}else{if(_0x82f744[_0xa40c('0x3e')][_0x57cf8a]===_0xa40c('0x7d')){_0x404a28[_0xa40c('0x77')]('i.'+_0x57cf8a+_0xa40c('0x7e'));}else{_0x404a28[_0xa40c('0x77')]('i.'+_0x57cf8a+_0xa40c('0x7f'),_0x82f744[_0xa40c('0x3e')][_0x57cf8a]);}}});}if(_0x82f744[_0xa40c('0x3e')][_0xa40c('0x80')]){if(_0x82f744[_0xa40c('0x3e')][_0xa40c('0x80')]==0x1){_0x404a28[_0xa40c('0x81')](_0xa40c('0x82'));}else{_0x404a28[_0xa40c('0x81')]('`unreadMessages`\x20>\x200');}}if(_0x82f744[_0xa40c('0x3e')][_0xa40c('0x83')]){_0x52b267=_[_0xa40c('0x84')](_0x82f744[_0xa40c('0x3e')][_0xa40c('0x83')])?_0x82f744['query'][_0xa40c('0x83')]:new Array(_0x82f744[_0xa40c('0x3e')]['tag']);_0x52b267[_0xa40c('0x36')](function(_0x46851b){_0x81432c['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x46851b+',%');});}if(_0x82f744[_0xa40c('0x3e')][_0xa40c('0x85')]){var _0x4d755c=_0x82f744['query']['filter'][_0xa40c('0x86')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0xa40c('0x87')](_0x4d755c)){_0x4ba3af['or'](_0xa40c('0x88'),_0x4d755c+'%')['or'](_0xa40c('0x89'),_0x4d755c+'%');}else{_0x4ba3af['or'](_0xa40c('0x8a'),qs[_0xa40c('0x66')](_0x4d755c))['or'](_0xa40c('0x8b'),_0x4d755c+'%');}}}_0x404a28[_0xa40c('0x77')](_0x4ba3af);_0x404a28[_0xa40c('0x8c')](_0xa40c('0x8d'));var _0x5473b4={'type':db[_0xa40c('0x8e')][_0xa40c('0x8f')]['SELECT'],'raw':!![]};var _0x4bb293=_0x404a28['clone']();_0x4bb293[_0xa40c('0x4a')](_0xa40c('0x8d'));_0x4bb293[_0xa40c('0x4a')](_0xa40c('0x90'),'unreadMessages');if(_0x24008c[_0xa40c('0x91')]){_0x24008c[_0xa40c('0x91')]['forEach'](function(_0x4f6756){var _0x4ad5c4=_0x4f6756[0x0]===_0xa40c('0x92')?_0x4f6756[0x0]:'i.'+_0x4f6756[0x0];_0x404a28[_0xa40c('0x91')](_0x4ad5c4,_0x4f6756[0x1]===_0xa40c('0x93')?![]:!![]);});}if(!_[_0xa40c('0x76')](_0x52b267)){_0x404a28[_0xa40c('0x81')](_0x81432c);_0x4bb293[_0xa40c('0x77')](_0xa40c('0x94'),_0x52b267);}BPromise[_0xa40c('0x95')]()[_0xa40c('0x2a')](function(){if(!_0x7cde92){if(_0x82f744[_0xa40c('0x3e')][_0xa40c('0x96')])return;_0x4bb293['where'](_0xa40c('0x97'));_0x404a28[_0xa40c('0x77')]('i.WhatsappAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x82f744[_0xa40c('0x98')]['role']!=='agent')return;return _0x82f744[_0xa40c('0x98')][_0xa40c('0x99')]({'attributes':['id'],'raw':!![]})[_0xa40c('0x2a')](function(_0x10ce74){if(_['isEmpty'](_0x10ce74)){_0x4bb293[_0xa40c('0x77')](_0xa40c('0x9a'));_0x404a28[_0xa40c('0x77')]('i.WhatsappAccountId\x20IS\x20NULL');}else{_0x4bb293['where'](_0xa40c('0x78'),_[_0xa40c('0x31')](_0x10ce74,'id'));_0x404a28[_0xa40c('0x77')](_0xa40c('0x78'),_[_0xa40c('0x31')](_0x10ce74,'id'));}});})['then'](function(){if(_0x82f744[_0xa40c('0x98')]['role']==='agent'&&!_0x7cde92&&!_0x82f744[_0xa40c('0x3e')][_0xa40c('0x96')])return[];return db['sequelize']['query'](_0x4bb293['toString'](),_0x5473b4);})[_0xa40c('0x2a')](function(_0x173c10){_0x160c1a[_0xa40c('0x23')]=_0x173c10['length'];if(_0x160c1a[_0xa40c('0x23')]===0x0)return[];return db[_0xa40c('0x9b')][_0xa40c('0x3e')](_0x4796bf[_0xa40c('0x9c')](),_0x5473b4)[_0xa40c('0x2a')](function(_0x2b5e7c){_0x35badf=_[_0xa40c('0x9d')](_0x2b5e7c,'id');_0x5473b4=_[_0xa40c('0x9e')](_0x5473b4,{'model':db[_0xa40c('0x3a')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x82f744[_0xa40c('0x3e')][_0xa40c('0x43')]){_0x24008c[_0xa40c('0x41')][_0xa40c('0x36')](function(_0x55ec82){_0x404a28['field']('i.'+_0x55ec82);});}else{_0x404a28[_0xa40c('0x4a')](_0xa40c('0x90'),_0xa40c('0x5e'));_0x404a28[_0xa40c('0x4a')](_0xa40c('0x9f'),_0xa40c('0xa0'));_0x404a28[_0xa40c('0x4a')](_0xa40c('0xa1'),_0xa40c('0xa2'));_0x404a28['field'](_0xa40c('0xa3'),_0xa40c('0x92'));_0x404a28[_0xa40c('0x4a')](_0xa40c('0xa4'));_0x404a28[_0xa40c('0x4a')](_0xa40c('0xa5'),_0xa40c('0xa6'));_0x404a28['field'](_0xa40c('0xa7'),_0xa40c('0xa8'));_0x404a28[_0xa40c('0x4a')]('c.email',_0xa40c('0xa9'));_0x404a28[_0xa40c('0x4a')](_0xa40c('0xaa'),'Contact.phone');_0x404a28['field']('c.mobile',_0xa40c('0xab'));_0x404a28['field']('c.fax',_0xa40c('0xac'));_0x404a28[_0xa40c('0x4a')]('o.fullname','Owner.fullname');_0x404a28['field']('o.internal',_0xa40c('0xad'));_0x404a28['field']('GROUP_CONCAT(DISTINCT\x20t.id)',_0xa40c('0x33'));}if(_0x24008c[_0xa40c('0x22')])_0x404a28[_0xa40c('0x22')](_0x24008c[_0xa40c('0x22')]);if(_0x24008c['offset'])_0x404a28['offset'](_0x24008c[_0xa40c('0x20')]);return db[_0xa40c('0x9b')]['query'](_0x404a28[_0xa40c('0x9c')](),_0x5473b4);})[_0xa40c('0x2a')](function(_0x36aa7c){if(_0x36aa7c[_0xa40c('0x44')]>0x0)_0x51d403['where'](_0xa40c('0xae'),_['map'](_0x36aa7c,'id'));return db[_0xa40c('0x9b')][_0xa40c('0x3e')](_0x51d403[_0xa40c('0x9c')](),_0x5473b4)[_0xa40c('0x2a')](function(_0x11e97c){var _0x371798=_[_0xa40c('0xaf')](_0x11e97c,_0xa40c('0xb0'));var _0x350337=[];_0x36aa7c[_0xa40c('0x36')](function(_0x27e199){_0x350337['push'](updateWhatsappInteraction(_0x27e199,_0x35badf,_0x371798));});return BPromise[_0xa40c('0xb1')](_0x350337);});});})['then'](function(_0x442209){_0x160c1a[_0xa40c('0xb2')]=_0x442209;return _0x160c1a;})[_0xa40c('0x2a')](respondWithFilteredResult(_0x24b389,_0x24008c))['catch'](handleError(_0x24b389,null));};exports['show']=function(_0x1f98f5,_0x529f0e){var _0x5ab9af={'raw':![],'where':{'id':_0x1f98f5[_0xa40c('0xb3')]['id']}},_0x14853d={};_0x14853d['model']=_[_0xa40c('0x3f')](db[_0xa40c('0x3a')]['rawAttributes']);_0x14853d[_0xa40c('0x3e')]=_[_0xa40c('0x3f')](_0x1f98f5[_0xa40c('0x3e')]);_0x14853d[_0xa40c('0x48')]=_['intersection'](_0x14853d[_0xa40c('0x40')],_0x14853d[_0xa40c('0x3e')]);_0x5ab9af['attributes']=_['intersection'](_0x14853d['model'],qs[_0xa40c('0x43')](_0x1f98f5[_0xa40c('0x3e')][_0xa40c('0x43')]));_0x5ab9af[_0xa40c('0x41')]=_0x5ab9af[_0xa40c('0x41')][_0xa40c('0x44')]?_0x5ab9af[_0xa40c('0x41')]:_0x14853d['model'];if(_0x1f98f5[_0xa40c('0x3e')][_0xa40c('0xb4')]){_0x5ab9af[_0xa40c('0xb5')]=[{'all':!![]}];}_0x5ab9af=_[_0xa40c('0x9e')]({},_0x5ab9af,_0x1f98f5[_0xa40c('0xb6')]);return db[_0xa40c('0x3a')][_0xa40c('0x5d')](_0x5ab9af)[_0xa40c('0x2a')](handleEntityNotFound(_0x529f0e,null))[_0xa40c('0x2a')](respondWithResult(_0x529f0e,null))[_0xa40c('0x38')](handleError(_0x529f0e,null));};exports[_0xa40c('0xb7')]=function(_0x3b3ad9,_0x48bf26){return db[_0xa40c('0x3a')]['create'](_0x3b3ad9['body'],{})[_0xa40c('0x2a')](respondWithResult(_0x48bf26,0xc9))['catch'](handleError(_0x48bf26,null));};exports[_0xa40c('0x29')]=function(_0x49fa54,_0x1d62e0){if(_0x49fa54[_0xa40c('0x72')]['id']){delete _0x49fa54[_0xa40c('0x72')]['id'];}return db[_0xa40c('0x3a')]['find']({'where':{'id':_0x49fa54[_0xa40c('0xb3')]['id']}})['then'](handleEntityNotFound(_0x1d62e0,null))[_0xa40c('0x2a')](saveUpdates(_0x49fa54['body'],null))[_0xa40c('0x2a')](respondWithResult(_0x1d62e0,null))[_0xa40c('0x38')](handleError(_0x1d62e0,null));};exports[_0xa40c('0xb8')]=function(_0x7bdc41,_0x21a969){return db[_0xa40c('0x3a')][_0xa40c('0x5d')]({'where':{'id':_0x7bdc41[_0xa40c('0xb3')]['id']}})[_0xa40c('0x2a')](handleEntityNotFound(_0x21a969,null))[_0xa40c('0x2a')](removeEntity(_0x21a969,null))[_0xa40c('0x38')](handleError(_0x21a969,null));};exports[_0xa40c('0xb9')]=function(_0x45832c,_0x1c6847){return db[_0xa40c('0x3a')]['describe']()[_0xa40c('0x2a')](respondWithResult(_0x1c6847,null))[_0xa40c('0x38')](handleError(_0x1c6847,null));};exports[_0xa40c('0xba')]=function(_0x18ad80,_0x42b964,_0x511674){return db['WhatsappMessage'][_0xa40c('0x5d')]({'where':{'id':_0x18ad80[_0xa40c('0xb3')]['id']}})[_0xa40c('0x2a')](handleEntityNotFound(_0x42b964,null))[_0xa40c('0x2a')](function(_0x5b41aa){if(_0x5b41aa){return _0x5b41aa['addMessage'](_0x18ad80[_0xa40c('0x72')][_0xa40c('0xbb')],_[_0xa40c('0xbc')](_0x18ad80[_0xa40c('0x72')],[_0xa40c('0xbb'),'id'])||{});}})['then'](respondWithResult(_0x42b964,null))[_0xa40c('0x38')](handleError(_0x42b964,null));};exports[_0xa40c('0xbd')]=function(_0x328f9c,_0x48cce9,_0x169684){var _0x538ee6={'raw':![],'where':{}};var _0x4f055b={};var _0x108a8a={'count':0x0,'rows':[]};return db[_0xa40c('0x3a')][_0xa40c('0xbe')]({'where':{'id':_0x328f9c['params']['id']}})[_0xa40c('0x2a')](handleEntityNotFound(_0x48cce9,null))[_0xa40c('0x2a')](function(_0x1b84f5){if(_0x1b84f5){_0x4f055b[_0xa40c('0x40')]=_['keys'](db[_0xa40c('0xbf')][_0xa40c('0x3b')]);_0x4f055b[_0xa40c('0x3e')]=_['keys'](_0x328f9c['query']);_0x4f055b[_0xa40c('0x48')]=_[_0xa40c('0x42')](_0x4f055b['model'],_0x4f055b[_0xa40c('0x3e')]);_0x538ee6[_0xa40c('0x41')]=_[_0xa40c('0x42')](_0x4f055b[_0xa40c('0x40')],qs[_0xa40c('0x43')](_0x328f9c[_0xa40c('0x3e')][_0xa40c('0x43')]));_0x538ee6[_0xa40c('0x41')]=_0x538ee6[_0xa40c('0x41')][_0xa40c('0x44')]?_0x538ee6[_0xa40c('0x41')]:_0x4f055b['model'];if(!_0x328f9c[_0xa40c('0x3e')][_0xa40c('0x45')](_0xa40c('0x46'))){_0x538ee6['limit']=qs[_0xa40c('0x22')](_0x328f9c['query'][_0xa40c('0x22')]);_0x538ee6['offset']=qs[_0xa40c('0x20')](_0x328f9c[_0xa40c('0x3e')][_0xa40c('0x20')]);}_0x538ee6[_0xa40c('0x91')]=qs[_0xa40c('0xc0')](_0x328f9c[_0xa40c('0x3e')][_0xa40c('0xc0')]);_0x538ee6[_0xa40c('0x77')]=qs[_0xa40c('0x48')](_[_0xa40c('0x47')](_0x328f9c[_0xa40c('0x3e')],_0x4f055b[_0xa40c('0x48')]));_0x538ee6[_0xa40c('0x77')]['WhatsappInteractionId']=_0x1b84f5['id'];if(_0x328f9c[_0xa40c('0x3e')][_0xa40c('0x85')]){_0x538ee6[_0xa40c('0x77')]=_['merge'](_0x538ee6[_0xa40c('0x77')],{'$or':_['map'](_0x538ee6[_0xa40c('0x41')],function(_0x245b86){var _0x51e2ee={};_0x51e2ee[_0x245b86]={'$like':'%'+_0x328f9c['query'][_0xa40c('0x85')]+'%'};return _0x51e2ee;})});}if(_0x328f9c[_0xa40c('0x3e')]['$gte']){var _0x5b8731=_0x328f9c[_0xa40c('0x3e')][_0xa40c('0xc1')][_0xa40c('0x35')](',');var _0x2fca69={};_0x2fca69[_0x5b8731[0x0]]={'$gte':moment(_0x5b8731[0x1])[_0xa40c('0xc2')](_0xa40c('0xc3'))};_0x538ee6[_0xa40c('0x77')]=_[_0xa40c('0x9e')](_0x538ee6[_0xa40c('0x77')],_0x2fca69);}_0x538ee6=_[_0xa40c('0x9e')]({},_0x538ee6,_0x328f9c[_0xa40c('0xb6')]);return db[_0xa40c('0xbf')]['count']({'where':_0x538ee6['where']})[_0xa40c('0x2a')](function(_0x5ec2ad){_0x108a8a[_0xa40c('0x23')]=_0x5ec2ad;if(_0x328f9c[_0xa40c('0x3e')][_0xa40c('0xb4')]){_0x538ee6[_0xa40c('0xb5')]=[{'all':!![]}];}return db[_0xa40c('0xbf')]['findAll'](_0x538ee6);})[_0xa40c('0x2a')](function(_0x41e0f0){_0x108a8a['rows']=_0x41e0f0;return _0x108a8a;});}})[_0xa40c('0x2a')](respondWithFilteredResult(_0x48cce9,_0x538ee6))[_0xa40c('0x38')](handleError(_0x48cce9,null));};exports[_0xa40c('0xc4')]=function(_0x1a358d,_0x2ef2d7,_0x7e0087){return db[_0xa40c('0x3a')]['find']({'where':{'id':_0x1a358d[_0xa40c('0xb3')]['id']}})['then'](handleEntityNotFound(_0x2ef2d7,null))['then'](function(_0x5c2845){if(_0x5c2845){return _0x5c2845['setTags'](_0x1a358d[_0xa40c('0x72')][_0xa40c('0xbb')],_[_0xa40c('0xbc')](_0x1a358d[_0xa40c('0x72')],[_0xa40c('0xbb'),'id'])||{})[_0xa40c('0xc5')](function(){return db[_0xa40c('0x6b')][_0xa40c('0xc6')]({'attributes':['id','name',_0xa40c('0xc7')],'where':{'id':_0x1a358d[_0xa40c('0x72')][_0xa40c('0xbb')]}});})[_0xa40c('0x2a')](function(_0x3ce844){socket['emit'](_0xa40c('0xc8'),{'id':Number(_0x1a358d[_0xa40c('0xb3')]['id']),'tags':_0x3ce844||[]});return{'id':Number(_0x1a358d[_0xa40c('0xb3')]['id']),'tags':_0x3ce844||[]};});}})[_0xa40c('0x2a')](respondWithResult(_0x2ef2d7,null))[_0xa40c('0x38')](handleError(_0x2ef2d7,null));};exports[_0xa40c('0xc9')]=function(_0x5de20d,_0x12414a,_0x2b334d){return db['WhatsappInteraction'][_0xa40c('0x5d')]({'where':{'id':_0x5de20d[_0xa40c('0xb3')]['id']}})['then'](handleEntityNotFound(_0x12414a,null))[_0xa40c('0x2a')](function(_0x89827d){if(_0x89827d){return _0x89827d[_0xa40c('0xc9')](_0x5de20d[_0xa40c('0x3e')][_0xa40c('0xbb')]);}})[_0xa40c('0x2a')](respondWithStatusCode(_0x12414a,null))[_0xa40c('0x38')](handleError(_0x12414a,null));};exports[_0xa40c('0xca')]=function(_0x15a68c,_0x51657e){var _0x2bf813=moment()['unix']()[_0xa40c('0x9c')]();var _0x2defee=path['join'](config[_0xa40c('0xcb')],_0xa40c('0xcc'),_0xa40c('0xcd'),_0xa40c('0xce'));var _0x17dbc3=path[_0xa40c('0xcf')](config[_0xa40c('0xcb')],_0xa40c('0xcc'),_0xa40c('0xcd'),_0xa40c('0xd0'));var _0x51d071=path[_0xa40c('0xcf')](_0x2defee,_0x2bf813);var _0x9284f0=util['format']('transcript-%d-%s.zip',_0x15a68c[_0xa40c('0xb3')]['id'],_0x2bf813);var _0x34ee1d=path[_0xa40c('0xcf')](_0x2defee,_0x9284f0);var _0x1bed75=[];_0x1bed75[_0xa40c('0x37')]({'model':db[_0xa40c('0x6e')],'as':_0xa40c('0x6e'),'attributes':['id',_0xa40c('0x32')],'raw':!![]});_0x1bed75[_0xa40c('0x37')]({'model':db[_0xa40c('0xd1')],'as':'Contact','attributes':['id','firstName',_0xa40c('0xd2')],'raw':!![]});if(_0x15a68c[_0xa40c('0x3e')][_0xa40c('0xd0')]){_0x1bed75[_0xa40c('0x37')]({'model':db[_0xa40c('0xd3')],'as':_0xa40c('0xd3'),'raw':!![]});}var _0x5b074e=[{'model':db[_0xa40c('0xbf')],'as':'Messages','attributes':['id','body',_0xa40c('0x7a'),_0xa40c('0xd4'),_0xa40c('0xd5'),_0xa40c('0x80')],'include':_0x1bed75}];_0x5b074e[_0xa40c('0x37')]({'model':db[_0xa40c('0xd6')],'as':_0xa40c('0xd7'),'attributes':['id',_0xa40c('0x2e')]});_0x5b074e[_0xa40c('0x37')]({'model':db[_0xa40c('0x6e')],'as':_0xa40c('0xd8'),'attributes':['id',_0xa40c('0x32')]});return db[_0xa40c('0x3a')][_0xa40c('0x5d')]({'where':{'id':_0x15a68c[_0xa40c('0xb3')]['id']},'include':_0x5b074e})['then'](handleEntityNotFound(_0x51657e,null))[_0xa40c('0x2a')](function(_0x463ec3){if(_0x463ec3){var _0x2c1c58=_0x463ec3[_0xa40c('0xd9')]({'plain':!![]});fs[_0xa40c('0xda')](_0x51d071);var _0x12ae3f={'channel':_0xa40c('0xdb'),'account':_0x2c1c58[_0xa40c('0xd7')]['name'],'agent':_0x2c1c58[_0xa40c('0xd8')]?_0x2c1c58[_0xa40c('0xd8')]['fullname']:'N.A.','createdAt':moment(_0x2c1c58[_0xa40c('0x7a')])['format'](_0xa40c('0xc3'))[_0xa40c('0x9c')](),'closedAt':_0x2c1c58['closed']?moment(_0x2c1c58['closedAt'])[_0xa40c('0xc2')](_0xa40c('0xc3'))[_0xa40c('0x9c')]():'','disposition':_0x2c1c58[_0xa40c('0xdc')],'messages':_(_0x2c1c58['Messages'])[_0xa40c('0x85')]({'secret':![]})[_0xa40c('0x31')](function(_0x2f8d27){if(_0x2f8d27[_0xa40c('0xd3')]){var _0x4c7728=path['join'](_0x17dbc3,_0x2f8d27['Attachment'][_0xa40c('0xdd')]);if(fs[_0xa40c('0xde')](_0x4c7728)){fs['createReadStream'](_0x4c7728)['pipe'](fs[_0xa40c('0xdf')](path[_0xa40c('0xcf')](_0x51d071,_0x2f8d27[_0xa40c('0xd3')][_0xa40c('0xdd')])));}}return{'date':moment(_0x2f8d27[_0xa40c('0x7a')])[_0xa40c('0xc2')](_0xa40c('0xc3'))[_0xa40c('0x9c')](),'sender':_0x2f8d27[_0xa40c('0xd4')]===_0xa40c('0xe0')?_0x2f8d27[_0xa40c('0x6e')]?_0x2f8d27['User']['fullname']:_0xa40c('0xe1'):_0x2f8d27['Contact']['firstName']+(_0x2f8d27[_0xa40c('0x62')][_0xa40c('0xd2')]?'\x20'+_0x2f8d27['Contact'][_0xa40c('0xd2')]:''),'body':_0x2f8d27[_0xa40c('0xd3')]?_0x2f8d27['Attachment'][_0xa40c('0xdd')]:_0x2f8d27['body'],'direction':_0x2f8d27[_0xa40c('0xd4')]===_0xa40c('0xe0')?'A':'C','secret':_0x2f8d27['secret'],'read':_0x2f8d27['read'],'attachment':_0x2f8d27[_0xa40c('0xd3')]};})[_0xa40c('0x5f')]()};return ejs['renderFile'](path['join'](config[_0xa40c('0xcb')],_0xa40c('0xcc'),_0xa40c('0xe2'),_0xa40c('0xe3')),{'interaction':_0x12ae3f})[_0xa40c('0x2a')](function(_0x12da4e){var _0x346b73=path['join'](_0x51d071,_0xa40c('0xe4')+_0x2c1c58['id']+'-'+_0x2bf813+'.pdf');var _0x596fdd={'path':_0x346b73,'channel':_0xa40c('0xdb'),'interactionId':_0x2c1c58['id']};return pdf[_0xa40c('0xe5')](_0x12da4e,_0x596fdd);})[_0xa40c('0x2a')](function(){return new BPromise(function(_0x7724b8,_0x35fbd6){zipdir(_0x51d071,{'saveTo':_0x34ee1d},function(_0x4c71d3,_0x2b5cc5){if(_0x4c71d3)return _0x35fbd6(_0x4c71d3);return _0x7724b8(_0x2b5cc5);});})['then'](function(){return new BPromise(function(_0x19c471,_0x34dfc8){rimraf(_0x51d071,function(_0x5446f8){if(_0x5446f8)_0x34dfc8(_0x5446f8);return _0x19c471();});});})['then'](function(){return _0x51657e[_0xa40c('0xca')](_0x34ee1d,_0x9284f0,function(_0xbe007){if(_0xbe007){console[_0xa40c('0xe6')](_0xa40c('0xe7'),_0xbe007);}else{fs['unlinkSync'](_0x34ee1d);}});});});}else{return _0x51657e[_0xa40c('0x1d')](0xc8);}})[_0xa40c('0x38')](handleError(_0x51657e,null));}; \ No newline at end of file +var _0x863f=['../../components/auth/service','../../components/parsers/qs','../../components/export/pdf','../../config/license/hardware','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','Users','map','fullname','TagIds','split','forEach','push','catch','index','WhatsappInteraction','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filters','pick','select','field','color','from','tools_tags','u.id','u.fullname','ui.WhatsappInteractionId','user_has_whatsapp_interactions','left_join','users','u.id\x20=\x20ui.UserId','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','whatsapp_accounts','a.id\x20=\x20i.WhatsappAccountId','whatsapp_messages','me.WhatsappInteractionId\x20=\x20i.id','it.WhatsappInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','value','having','`\x20=\x200','`\x20>\x200','Contact','ContactId','buildExpression','text','start','Tag','operator','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','some','isEmpty','WhatsappAccountId','i.WhatsappAccountId\x20IN\x20?','concat','createdAt','$gte','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','read','`unreadMessages`\x20>\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','contactName','DESC','t.id\x20IN\x20?','i.WhatsappAccountId\x20IS\x20NOT\x20NULL','role','agent','getWhatsappAccounts','i.WhatsappAccountId\x20IS\x20NULL','user','sequelize','toString','keyBy','unreadMessages','Account.key','a.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','c.lastName','c.email','Contact.email','c.phone','Contact.phone','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.WhatsappInteractionId\x20IN\x20?','groupBy','WhatsappInteractionId','all','rows','show','params','rawAttributes','includeAll','merge','options','create','describe','addMessage','WhatsappMessage','ids','omit','getMessages','format','YYYY-MM-DD\x20HH:mm:ss','addTags','spread','findAll','emit','whatsappInteractionTags:save','removeTags','download','unix','join','root','tmp','server','attachments','transcript-%d-%s.zip','User','firstName','lastName','Attachment','Messages','secret','WhatsappAccount','get','mkdirSync','Whatsapp','Account','Owner','N.A.','closed','disposition','basename','existsSync','createReadStream','direction','out','views','downloadInteraction.ejs','transcript-','log','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis'];(function(_0x1b27cf,_0xf1c380){var _0x2314ee=function(_0x8971aa){while(--_0x8971aa){_0x1b27cf['push'](_0x1b27cf['shift']());}};_0x2314ee(++_0xf1c380);}(_0x863f,0xda));var _0xf863=function(_0x1139ea,_0x1e9cc7){_0x1139ea=_0x1139ea-0x0;var _0x2b3ab5=_0x863f[_0x1139ea];return _0x2b3ab5;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf863('0x0'));var zipdir=require(_0xf863('0x1'));var jsonpatch=require(_0xf863('0x2'));var rp=require('request-promise');var moment=require(_0xf863('0x3'));var BPromise=require(_0xf863('0x4'));var Mustache=require('mustache');var util=require(_0xf863('0x5'));var path=require(_0xf863('0x6'));var sox=require(_0xf863('0x7'));var csv=require(_0xf863('0x8'));var ejs=require(_0xf863('0x9'));var fs=require('fs');var fs_extra=require(_0xf863('0xa'));var _=require(_0xf863('0xb'));var squel=require(_0xf863('0xc'));var crypto=require('crypto');var jsforce=require(_0xf863('0xd'));var deskjs=require(_0xf863('0xe'));var toCsv=require(_0xf863('0x8'));var querystring=require(_0xf863('0xf'));var Papa=require(_0xf863('0x10'));var Redis=require(_0xf863('0x11'));var authService=require(_0xf863('0x12'));var qs=require(_0xf863('0x13'));var as=require('../../components/parsers/advancedSearch');var pdf=require(_0xf863('0x14'));var hardwareService=require(_0xf863('0x15'));var logger=require('../../config/logger')(_0xf863('0x16'));var utils=require(_0xf863('0x17'));var config=require(_0xf863('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0xf863('0x19')]=_[_0xf863('0x1a')](config[_0xf863('0x19')],{'host':_0xf863('0x1b'),'port':0x18eb});var socket=require(_0xf863('0x1c'))(new Redis(config[_0xf863('0x19')]));require(_0xf863('0x1d'))[_0xf863('0x1e')](socket);function respondWithStatusCode(_0xe48c3f,_0x319e04){_0x319e04=_0x319e04||0xcc;return function(_0x5d0585){if(_0x5d0585){return _0xe48c3f[_0xf863('0x1f')](_0x319e04);}return _0xe48c3f[_0xf863('0x20')](_0x319e04)[_0xf863('0x21')]();};}function respondWithResult(_0x1656b1,_0xef917b){_0xef917b=_0xef917b||0xc8;return function(_0x3a6805){if(_0x3a6805){return _0x1656b1['status'](_0xef917b)[_0xf863('0x22')](_0x3a6805);}};}function respondWithFilteredResult(_0x3fa1b6,_0x255352){return function(_0x369181){if(_0x369181){var _0x3b1a61=typeof _0x255352[_0xf863('0x23')]===_0xf863('0x24')&&typeof _0x255352['limit']===_0xf863('0x24');var _0x794d43=_0x369181[_0xf863('0x25')];var _0x4044b5=_0x3b1a61?0x0:_0x255352[_0xf863('0x23')];var _0x29d02a=_0x3b1a61?_0x369181['count']:_0x255352[_0xf863('0x23')]+_0x255352[_0xf863('0x26')];var _0x10ba16;if(_0x29d02a>=_0x794d43){_0x29d02a=_0x794d43;_0x10ba16=0xc8;}else{_0x10ba16=0xce;}_0x3fa1b6[_0xf863('0x20')](_0x10ba16);return _0x3fa1b6['set'](_0xf863('0x27'),_0x4044b5+'-'+_0x29d02a+'/'+_0x794d43)[_0xf863('0x22')](_0x369181);}return null;};}function patchUpdates(_0x44dc07){return function(_0x52596f){try{jsonpatch[_0xf863('0x28')](_0x52596f,_0x44dc07,!![]);}catch(_0x429c53){return BPromise[_0xf863('0x29')](_0x429c53);}return _0x52596f[_0xf863('0x2a')]();};}function saveUpdates(_0x448219,_0x2521e8){return function(_0x412a05){if(_0x412a05){return _0x412a05[_0xf863('0x2b')](_0x448219)[_0xf863('0x2c')](function(_0x3e78db){return _0x3e78db;});}return null;};}function removeEntity(_0x27c959,_0x47ee58){return function(_0xc11b43){if(_0xc11b43){return _0xc11b43[_0xf863('0x2d')]()['then'](function(){_0x27c959['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1d2893,_0x4aef9e){return function(_0x3ae6b4){if(!_0x3ae6b4){_0x1d2893[_0xf863('0x1f')](0x194);}return _0x3ae6b4;};}function handleError(_0x379d01,_0x4fc321){_0x4fc321=_0x4fc321||0x1f4;return function(_0x2ff263){logger[_0xf863('0x2e')](_0x2ff263[_0xf863('0x2f')]);if(_0x2ff263[_0xf863('0x30')]){delete _0x2ff263[_0xf863('0x30')];}_0x379d01[_0xf863('0x20')](_0x4fc321)[_0xf863('0x31')](_0x2ff263);};}function getInteractionUsers(_0x303570,_0x3eb959){return new BPromise(function(_0x6d2ba8,_0x5e5119){try{if(_0x3eb959[_0x303570['id']]){_0x303570[_0xf863('0x32')]=_[_0xf863('0x33')](_0x3eb959[_0x303570['id']],function(_0x132ae8){return{'id':_0x132ae8['id'],'fullname':_0x132ae8[_0xf863('0x34')]};});}}catch(_0x24ced2){_0x5e5119(_0x24ced2);}_0x6d2ba8(_0x303570);});}function getInteractionTags(_0xc55609,_0x1ee7ac){return new BPromise(function(_0x1ad48f,_0x239b83){try{if(_0xc55609['TagIds']){_0xc55609['Tags']=[];_0xc55609[_0xf863('0x35')][_0xf863('0x36')](',')[_0xf863('0x37')](function(_0xc1e584){_0xc55609['Tags'][_0xf863('0x38')](_0x1ee7ac[_0xc1e584]);});}delete _0xc55609[_0xf863('0x35')];}catch(_0x53b79d){_0x239b83(_0x53b79d);}_0x1ad48f(_0xc55609);});}function updateWhatsappInteraction(_0x8e0719,_0x25be47,_0x52e15a){return new BPromise(function(_0x5308c4,_0x407b05){return getInteractionUsers(_0x8e0719,_0x52e15a)[_0xf863('0x2c')](function(_0xa1e0e3){return getInteractionTags(_0xa1e0e3,_0x25be47);})[_0xf863('0x2c')](function(_0x3ee54d){_0x5308c4(_0x3ee54d);})[_0xf863('0x39')](function(_0x469562){_0x407b05(_0x469562);});});}exports[_0xf863('0x3a')]=function(_0x162dab,_0x29ca6b){var _0x105f5c={},_0x18ce70={},_0x27f2f9={'count':0x0,'rows':[]};var _0xddfd28=_[_0xf863('0x33')](db[_0xf863('0x3b')]['rawAttributes'],function(_0x4282dc){return{'name':_0x4282dc[_0xf863('0x3c')],'type':_0x4282dc[_0xf863('0x3d')][_0xf863('0x3e')]};});_0x18ce70[_0xf863('0x3f')]=_[_0xf863('0x33')](_0xddfd28,_0xf863('0x30'));_0x18ce70[_0xf863('0x40')]=_[_0xf863('0x41')](_0x162dab[_0xf863('0x40')]);_0x18ce70['filters']=_['intersection'](_0x18ce70[_0xf863('0x3f')],_0x18ce70['query']);_0x105f5c['attributes']=_[_0xf863('0x42')](_0x18ce70['model'],qs[_0xf863('0x43')](_0x162dab[_0xf863('0x40')][_0xf863('0x43')]));_0x105f5c[_0xf863('0x44')]=_0x105f5c[_0xf863('0x44')][_0xf863('0x45')]?_0x105f5c[_0xf863('0x44')]:_0x18ce70[_0xf863('0x3f')];if(!_0x162dab[_0xf863('0x40')][_0xf863('0x46')](_0xf863('0x47'))){_0x105f5c[_0xf863('0x26')]=qs[_0xf863('0x26')](_0x162dab[_0xf863('0x40')][_0xf863('0x26')]);_0x105f5c[_0xf863('0x23')]=qs[_0xf863('0x23')](_0x162dab['query'][_0xf863('0x23')]);}_0x105f5c['order']=qs['sort'](_0x162dab[_0xf863('0x40')][_0xf863('0x48')]);_0x105f5c[_0xf863('0x49')]=qs[_0xf863('0x4a')](_[_0xf863('0x4b')](_0x162dab['query'],_0x18ce70['filters']),_0xddfd28);var _0x39e23b=[];var _0x580bc4=squel[_0xf863('0x4c')]()[_0xf863('0x4d')]('id')[_0xf863('0x4d')]('name')['field'](_0xf863('0x4e'))[_0xf863('0x4f')](_0xf863('0x50'));var _0x5df042=squel['select']()['field'](_0xf863('0x51'))[_0xf863('0x4d')](_0xf863('0x52'))[_0xf863('0x4d')](_0xf863('0x53'))[_0xf863('0x4f')](_0xf863('0x54'),'ui')[_0xf863('0x55')](_0xf863('0x56'),'u',_0xf863('0x57'));var _0x14b04f=squel['select']()[_0xf863('0x4f')]('whatsapp_interactions','i')[_0xf863('0x55')](_0xf863('0x58'),'c',_0xf863('0x59'))[_0xf863('0x55')]('users','o','o.id\x20=\x20i.UserId')[_0xf863('0x55')](_0xf863('0x5a'),'a',_0xf863('0x5b'))[_0xf863('0x55')](_0xf863('0x5c'),'me',_0xf863('0x5d'))[_0xf863('0x55')]('whatsapp_interaction_has_tags','it',_0xf863('0x5e'))[_0xf863('0x55')]('tools_tags','t',_0xf863('0x5f'));var _0x2e4b03=squel['expr']();var _0x9d9a44=[];var _0x236e77=squel[_0xf863('0x60')]();var _0x3fdd22;if(_0x162dab[_0xf863('0x40')][_0xf863('0x61')]){_0x3fdd22=as[_0xf863('0x62')](_0x162dab[_0xf863('0x40')][_0xf863('0x61')]);var _0x2fcde3=_0x3fdd22[_0xf863('0x63')];for(var _0x59f9b0=0x0;_0x59f9b0<_0x3fdd22[_0xf863('0x64')][_0xf863('0x45')];_0x59f9b0++){var _0x4d4cf3=_0x3fdd22[_0xf863('0x64')][_0x59f9b0];var _0x96ce68='i';var _0x393689=_[_0xf863('0x65')](_0xddfd28,[_0xf863('0x30'),_0x4d4cf3[_0xf863('0x4d')]]);if(!_0x393689){switch(_0x4d4cf3['field']){case'unreadMessages':if(_0x4d4cf3[_0xf863('0x66')]==0x1){_0x14b04f[_0xf863('0x67')]('`'+_0x4d4cf3[_0xf863('0x4d')]+_0xf863('0x68'));}else{_0x14b04f['having']('`'+_0x4d4cf3[_0xf863('0x4d')]+_0xf863('0x69'));}break;case _0xf863('0x6a'):if(_0x4d4cf3['operator']==='$substring'){if(_0x4d4cf3[_0xf863('0x66')][_0xf863('0x36')]('\x20')[_0xf863('0x45')]>0x1){_0x2e4b03[_0x2fcde3]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x4d4cf3[_0xf863('0x66')]),null);}else{var _0x494ae3='%'+_0x4d4cf3[_0xf863('0x66')]+'%';_0x2e4b03[_0x2fcde3]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x494ae3,_0x494ae3,_0x494ae3);}}else{_0x393689=_[_0xf863('0x65')](_0xddfd28,[_0xf863('0x30'),_0xf863('0x6b')]);_0x4d4cf3['field']=_0xf863('0x6b');_0x2350c3=as[_0xf863('0x6c')](_0x96ce68,_0x393689['type'],_0x4d4cf3);_0x2e4b03[_0x2fcde3](_0x2350c3[_0xf863('0x6d')],_0x2350c3[_0xf863('0x66')][_0xf863('0x6e')],_0x2350c3[_0xf863('0x66')][_0xf863('0x21')]);}break;case _0xf863('0x6f'):var _0xb2071=_0x4d4cf3['value'][_0xf863('0x36')](',')[_0xf863('0x33')](function(_0x4978e3){return Number(_0x4978e3);});_0xb2071[_0xf863('0x37')](function(_0x3cd417){_0x236e77['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x3cd417+',%');});_0x9d9a44=_['union'](_0x9d9a44,_0xb2071);break;case'User':if(_0x4d4cf3[_0xf863('0x70')]===_0xf863('0x71')){_0x2e4b03[_0x2fcde3](_0xf863('0x72'),'%'+_0x4d4cf3['value']+'%',null);}else{_0x393689=_['find'](_0xddfd28,[_0xf863('0x30'),'UserId']);_0x4d4cf3[_0xf863('0x4d')]=_0xf863('0x73');_0x2350c3=as['buildExpression'](_0x96ce68,_0x393689[_0xf863('0x3d')],_0x4d4cf3);_0x2e4b03[_0x2fcde3](_0x2350c3[_0xf863('0x6d')],_0x2350c3[_0xf863('0x66')][_0xf863('0x6e')],_0x2350c3[_0xf863('0x66')][_0xf863('0x21')]);}break;case _0xf863('0x74'):_0x2350c3=as[_0xf863('0x6c')]('me',null,_0x4d4cf3);_0x2e4b03[_0x2fcde3](_0x2350c3[_0xf863('0x6d')],_0x2350c3['value']['start'],_0x2350c3[_0xf863('0x66')][_0xf863('0x21')]);break;}}else{var _0x2350c3=as[_0xf863('0x6c')](_0x96ce68,_0x393689['type'],_0x4d4cf3);_0x2e4b03[_0x2fcde3](_0x2350c3['text'],_0x2350c3[_0xf863('0x66')][_0xf863('0x6e')],_0x2350c3[_0xf863('0x66')]['end']);}}}else{var _0x22ab1a=_(_0x162dab[_0xf863('0x40')])[_0xf863('0x41')]()[_0xf863('0x33')](function(_0x4e6860){return _[_0xf863('0x75')](_0xddfd28,[_0xf863('0x30'),_0x4e6860])?_0x4e6860:undefined;})['compact']()['value']();if(!_[_0xf863('0x76')](_0x22ab1a)){_0x22ab1a[_0xf863('0x37')](function(_0x13e327){if(_0x13e327===_0xf863('0x77')){_0x14b04f[_0xf863('0x49')](_0xf863('0x78'),[][_0xf863('0x79')](_0x162dab[_0xf863('0x40')][_0x13e327]));}else if(_0x13e327===_0xf863('0x7a')){var _0x4c47fb=JSON['parse'](_0x162dab[_0xf863('0x40')][_0x13e327])[_0xf863('0x7b')];var _0x6a267c=JSON[_0xf863('0x7c')](_0x162dab[_0xf863('0x40')][_0x13e327])[_0xf863('0x7d')];_0x14b04f[_0xf863('0x49')](_0xf863('0x7e'),_0x4c47fb,_0x6a267c);}else{if(_0x162dab['query'][_0x13e327]===_0xf863('0x7f')){_0x14b04f[_0xf863('0x49')]('i.'+_0x13e327+_0xf863('0x80'));}else{_0x14b04f['where']('i.'+_0x13e327+'\x20=\x20?',_0x162dab[_0xf863('0x40')][_0x13e327]);}}});}if(_0x162dab[_0xf863('0x40')][_0xf863('0x81')]){if(_0x162dab[_0xf863('0x40')][_0xf863('0x81')]==0x1){_0x14b04f[_0xf863('0x67')]('`unreadMessages`\x20=\x200');}else{_0x14b04f['having'](_0xf863('0x82'));}}if(_0x162dab[_0xf863('0x40')][_0xf863('0x83')]){_0x9d9a44=_[_0xf863('0x84')](_0x162dab['query'][_0xf863('0x83')])?_0x162dab[_0xf863('0x40')]['tag']:new Array(_0x162dab[_0xf863('0x40')][_0xf863('0x83')]);_0x9d9a44[_0xf863('0x37')](function(_0x5a9dc5){_0x236e77['or'](_0xf863('0x85'),'%,'+_0x5a9dc5+',%');});}if(_0x162dab[_0xf863('0x40')][_0xf863('0x86')]){var _0x5c7e31=_0x162dab['query'][_0xf863('0x86')][_0xf863('0x87')]('\x5c','\x5c\x5c')[_0xf863('0x87')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x5c7e31)){_0x2e4b03['or']('i.id\x20LIKE\x20?',_0x5c7e31+'%')['or']('i.phone\x20LIKE\x20?',_0x5c7e31+'%');}else{_0x2e4b03['or'](_0xf863('0x88'),qs[_0xf863('0x89')](_0x5c7e31))['or'](_0xf863('0x8a'),_0x5c7e31+'%');}}}_0x14b04f['where'](_0x2e4b03);_0x14b04f[_0xf863('0x8b')](_0xf863('0x8c'));var _0x2e7994={'type':db[_0xf863('0x8d')][_0xf863('0x8e')][_0xf863('0x8f')],'raw':!![]};var _0x4e3703=_0x14b04f[_0xf863('0x90')]();_0x4e3703[_0xf863('0x4d')](_0xf863('0x8c'));_0x4e3703[_0xf863('0x4d')](_0xf863('0x91'),'unreadMessages');if(_0x105f5c[_0xf863('0x92')]){_0x105f5c[_0xf863('0x92')][_0xf863('0x37')](function(_0x474555){var _0x48fd4c=_0x474555[0x0]===_0xf863('0x93')?_0x474555[0x0]:'i.'+_0x474555[0x0];_0x14b04f[_0xf863('0x92')](_0x48fd4c,_0x474555[0x1]===_0xf863('0x94')?![]:!![]);});}if(!_[_0xf863('0x76')](_0x9d9a44)){_0x14b04f[_0xf863('0x67')](_0x236e77);_0x4e3703[_0xf863('0x49')](_0xf863('0x95'),_0x9d9a44);}BPromise['resolve']()['then'](function(){if(!_0x3fdd22){if(_0x162dab[_0xf863('0x40')][_0xf863('0x77')])return;_0x4e3703[_0xf863('0x49')](_0xf863('0x96'));_0x14b04f[_0xf863('0x49')]('i.WhatsappAccountId\x20IS\x20NOT\x20NULL');return;}if(_0x162dab['user'][_0xf863('0x97')]!==_0xf863('0x98'))return;return _0x162dab['user'][_0xf863('0x99')]({'attributes':['id'],'raw':!![]})[_0xf863('0x2c')](function(_0x46aa77){if(_['isEmpty'](_0x46aa77)){_0x4e3703[_0xf863('0x49')](_0xf863('0x9a'));_0x14b04f[_0xf863('0x49')](_0xf863('0x9a'));}else{_0x4e3703[_0xf863('0x49')](_0xf863('0x78'),_[_0xf863('0x33')](_0x46aa77,'id'));_0x14b04f['where'](_0xf863('0x78'),_[_0xf863('0x33')](_0x46aa77,'id'));}});})['then'](function(){if(_0x162dab[_0xf863('0x9b')]['role']===_0xf863('0x98')&&!_0x3fdd22&&!_0x162dab[_0xf863('0x40')]['WhatsappAccountId'])return[];return db[_0xf863('0x9c')][_0xf863('0x40')](_0x4e3703[_0xf863('0x9d')](),_0x2e7994);})[_0xf863('0x2c')](function(_0x150e03){_0x27f2f9[_0xf863('0x25')]=_0x150e03[_0xf863('0x45')];if(_0x27f2f9[_0xf863('0x25')]===0x0)return[];return db[_0xf863('0x9c')][_0xf863('0x40')](_0x580bc4[_0xf863('0x9d')](),_0x2e7994)[_0xf863('0x2c')](function(_0x9d38ea){_0x39e23b=_[_0xf863('0x9e')](_0x9d38ea,'id');_0x2e7994=_['merge'](_0x2e7994,{'model':db[_0xf863('0x3b')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x162dab[_0xf863('0x40')][_0xf863('0x43')]){_0x105f5c[_0xf863('0x44')][_0xf863('0x37')](function(_0x269b33){_0x14b04f[_0xf863('0x4d')]('i.'+_0x269b33);});}else{_0x14b04f[_0xf863('0x4d')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xf863('0x9f'));_0x14b04f[_0xf863('0x4d')]('a.key',_0xf863('0xa0'));_0x14b04f[_0xf863('0x4d')](_0xf863('0xa1'),'Account.mandatoryDisposition');_0x14b04f[_0xf863('0x4d')](_0xf863('0xa2'),_0xf863('0x93'));_0x14b04f['field'](_0xf863('0xa3'));_0x14b04f[_0xf863('0x4d')](_0xf863('0xa4'),'Contact.firstName');_0x14b04f[_0xf863('0x4d')](_0xf863('0xa5'),'Contact.lastName');_0x14b04f[_0xf863('0x4d')](_0xf863('0xa6'),_0xf863('0xa7'));_0x14b04f['field'](_0xf863('0xa8'),_0xf863('0xa9'));_0x14b04f[_0xf863('0x4d')]('c.mobile',_0xf863('0xaa'));_0x14b04f[_0xf863('0x4d')](_0xf863('0xab'),_0xf863('0xac'));_0x14b04f['field'](_0xf863('0xad'),_0xf863('0xae'));_0x14b04f[_0xf863('0x4d')](_0xf863('0xaf'),_0xf863('0xb0'));_0x14b04f[_0xf863('0x4d')](_0xf863('0xb1'),_0xf863('0x35'));}if(_0x105f5c[_0xf863('0x26')])_0x14b04f['limit'](_0x105f5c[_0xf863('0x26')]);if(_0x105f5c[_0xf863('0x23')])_0x14b04f[_0xf863('0x23')](_0x105f5c['offset']);return db['sequelize'][_0xf863('0x40')](_0x14b04f[_0xf863('0x9d')](),_0x2e7994);})['then'](function(_0x977e13){if(_0x977e13[_0xf863('0x45')]>0x0)_0x5df042[_0xf863('0x49')](_0xf863('0xb2'),_[_0xf863('0x33')](_0x977e13,'id'));return db[_0xf863('0x9c')]['query'](_0x5df042[_0xf863('0x9d')](),_0x2e7994)['then'](function(_0x153539){var _0x58cdb6=_[_0xf863('0xb3')](_0x153539,_0xf863('0xb4'));var _0x21e9cb=[];_0x977e13[_0xf863('0x37')](function(_0x52de0c){_0x21e9cb[_0xf863('0x38')](updateWhatsappInteraction(_0x52de0c,_0x39e23b,_0x58cdb6));});return BPromise[_0xf863('0xb5')](_0x21e9cb);});});})[_0xf863('0x2c')](function(_0x396f51){_0x27f2f9[_0xf863('0xb6')]=_0x396f51;return _0x27f2f9;})[_0xf863('0x2c')](respondWithFilteredResult(_0x29ca6b,_0x105f5c))['catch'](handleError(_0x29ca6b,null));};exports[_0xf863('0xb7')]=function(_0x5a9350,_0x5adf6d){var _0x39cc00={'raw':![],'where':{'id':_0x5a9350[_0xf863('0xb8')]['id']}},_0x844fc={};_0x844fc[_0xf863('0x3f')]=_[_0xf863('0x41')](db[_0xf863('0x3b')][_0xf863('0xb9')]);_0x844fc[_0xf863('0x40')]=_['keys'](_0x5a9350[_0xf863('0x40')]);_0x844fc[_0xf863('0x4a')]=_[_0xf863('0x42')](_0x844fc[_0xf863('0x3f')],_0x844fc[_0xf863('0x40')]);_0x39cc00['attributes']=_['intersection'](_0x844fc[_0xf863('0x3f')],qs['fields'](_0x5a9350[_0xf863('0x40')][_0xf863('0x43')]));_0x39cc00['attributes']=_0x39cc00['attributes'][_0xf863('0x45')]?_0x39cc00[_0xf863('0x44')]:_0x844fc[_0xf863('0x3f')];if(_0x5a9350['query'][_0xf863('0xba')]){_0x39cc00['include']=[{'all':!![]}];}_0x39cc00=_[_0xf863('0xbb')]({},_0x39cc00,_0x5a9350[_0xf863('0xbc')]);return db['WhatsappInteraction'][_0xf863('0x65')](_0x39cc00)[_0xf863('0x2c')](handleEntityNotFound(_0x5adf6d,null))['then'](respondWithResult(_0x5adf6d,null))[_0xf863('0x39')](handleError(_0x5adf6d,null));};exports[_0xf863('0xbd')]=function(_0x15d5e7,_0x529040){return db[_0xf863('0x3b')][_0xf863('0xbd')](_0x15d5e7[_0xf863('0x74')],{})['then'](respondWithResult(_0x529040,0xc9))['catch'](handleError(_0x529040,null));};exports[_0xf863('0x2b')]=function(_0x1209e3,_0x434d9e){if(_0x1209e3['body']['id']){delete _0x1209e3[_0xf863('0x74')]['id'];}return db[_0xf863('0x3b')]['find']({'where':{'id':_0x1209e3[_0xf863('0xb8')]['id']}})['then'](handleEntityNotFound(_0x434d9e,null))[_0xf863('0x2c')](saveUpdates(_0x1209e3[_0xf863('0x74')],null))[_0xf863('0x2c')](respondWithResult(_0x434d9e,null))[_0xf863('0x39')](handleError(_0x434d9e,null));};exports[_0xf863('0x2d')]=function(_0x25e3db,_0x907425){return db[_0xf863('0x3b')]['find']({'where':{'id':_0x25e3db[_0xf863('0xb8')]['id']}})[_0xf863('0x2c')](handleEntityNotFound(_0x907425,null))[_0xf863('0x2c')](removeEntity(_0x907425,null))[_0xf863('0x39')](handleError(_0x907425,null));};exports[_0xf863('0xbe')]=function(_0x4d378b,_0x4919a4){return db['WhatsappInteraction'][_0xf863('0xbe')]()['then'](respondWithResult(_0x4919a4,null))[_0xf863('0x39')](handleError(_0x4919a4,null));};exports[_0xf863('0xbf')]=function(_0x1e7a92,_0x32f564,_0x3548db){return db[_0xf863('0xc0')]['find']({'where':{'id':_0x1e7a92['params']['id']}})[_0xf863('0x2c')](handleEntityNotFound(_0x32f564,null))[_0xf863('0x2c')](function(_0x55543d){if(_0x55543d){return _0x55543d[_0xf863('0xbf')](_0x1e7a92['body'][_0xf863('0xc1')],_[_0xf863('0xc2')](_0x1e7a92['body'],[_0xf863('0xc1'),'id'])||{});}})[_0xf863('0x2c')](respondWithResult(_0x32f564,null))[_0xf863('0x39')](handleError(_0x32f564,null));};exports[_0xf863('0xc3')]=function(_0x47938c,_0x48b371,_0x1edd87){var _0x22d21f={'raw':![],'where':{}};var _0x304696={};var _0x52a04a={'count':0x0,'rows':[]};return db[_0xf863('0x3b')]['findOne']({'where':{'id':_0x47938c[_0xf863('0xb8')]['id']}})[_0xf863('0x2c')](handleEntityNotFound(_0x48b371,null))[_0xf863('0x2c')](function(_0x437ec){if(_0x437ec){_0x304696[_0xf863('0x3f')]=_['keys'](db[_0xf863('0xc0')][_0xf863('0xb9')]);_0x304696[_0xf863('0x40')]=_[_0xf863('0x41')](_0x47938c['query']);_0x304696[_0xf863('0x4a')]=_['intersection'](_0x304696[_0xf863('0x3f')],_0x304696['query']);_0x22d21f['attributes']=_[_0xf863('0x42')](_0x304696[_0xf863('0x3f')],qs['fields'](_0x47938c['query'][_0xf863('0x43')]));_0x22d21f['attributes']=_0x22d21f['attributes']['length']?_0x22d21f[_0xf863('0x44')]:_0x304696[_0xf863('0x3f')];if(!_0x47938c[_0xf863('0x40')][_0xf863('0x46')](_0xf863('0x47'))){_0x22d21f[_0xf863('0x26')]=qs[_0xf863('0x26')](_0x47938c[_0xf863('0x40')][_0xf863('0x26')]);_0x22d21f[_0xf863('0x23')]=qs[_0xf863('0x23')](_0x47938c[_0xf863('0x40')][_0xf863('0x23')]);}_0x22d21f[_0xf863('0x92')]=qs['sort'](_0x47938c['query'][_0xf863('0x48')]);_0x22d21f['where']=qs[_0xf863('0x4a')](_['pick'](_0x47938c[_0xf863('0x40')],_0x304696[_0xf863('0x4a')]));_0x22d21f[_0xf863('0x49')][_0xf863('0xb4')]=_0x437ec['id'];if(_0x47938c['query'][_0xf863('0x86')]){_0x22d21f[_0xf863('0x49')]=_[_0xf863('0xbb')](_0x22d21f[_0xf863('0x49')],{'$or':_[_0xf863('0x33')](_0x22d21f['attributes'],function(_0x49e42e){var _0x24faef={};_0x24faef[_0x49e42e]={'$like':'%'+_0x47938c['query'][_0xf863('0x86')]+'%'};return _0x24faef;})});}if(_0x47938c['query']['$gte']){var _0x7172a3=_0x47938c[_0xf863('0x40')][_0xf863('0x7b')][_0xf863('0x36')](',');var _0x7f73e6={};_0x7f73e6[_0x7172a3[0x0]]={'$gte':moment(_0x7172a3[0x1])[_0xf863('0xc4')](_0xf863('0xc5'))};_0x22d21f[_0xf863('0x49')]=_[_0xf863('0xbb')](_0x22d21f[_0xf863('0x49')],_0x7f73e6);}_0x22d21f=_[_0xf863('0xbb')]({},_0x22d21f,_0x47938c[_0xf863('0xbc')]);return db[_0xf863('0xc0')][_0xf863('0x25')]({'where':_0x22d21f[_0xf863('0x49')]})['then'](function(_0x63e2df){_0x52a04a['count']=_0x63e2df;if(_0x47938c[_0xf863('0x40')][_0xf863('0xba')]){_0x22d21f['include']=[{'all':!![]}];}return db[_0xf863('0xc0')]['findAll'](_0x22d21f);})[_0xf863('0x2c')](function(_0x1a2e6d){_0x52a04a['rows']=_0x1a2e6d;return _0x52a04a;});}})[_0xf863('0x2c')](respondWithFilteredResult(_0x48b371,_0x22d21f))['catch'](handleError(_0x48b371,null));};exports[_0xf863('0xc6')]=function(_0x19c4da,_0x83ee92,_0x2c2b9a){return db[_0xf863('0x3b')]['find']({'where':{'id':_0x19c4da['params']['id']}})['then'](handleEntityNotFound(_0x83ee92,null))[_0xf863('0x2c')](function(_0x348d2){if(_0x348d2){return _0x348d2['setTags'](_0x19c4da[_0xf863('0x74')][_0xf863('0xc1')],_['omit'](_0x19c4da[_0xf863('0x74')],[_0xf863('0xc1'),'id'])||{})[_0xf863('0xc7')](function(){return db['Tag'][_0xf863('0xc8')]({'attributes':['id',_0xf863('0x30'),_0xf863('0x4e')],'where':{'id':_0x19c4da[_0xf863('0x74')][_0xf863('0xc1')]}});})[_0xf863('0x2c')](function(_0x4eb234){socket[_0xf863('0xc9')](_0xf863('0xca'),{'id':Number(_0x19c4da[_0xf863('0xb8')]['id']),'tags':_0x4eb234||[]});return{'id':Number(_0x19c4da[_0xf863('0xb8')]['id']),'tags':_0x4eb234||[]};});}})[_0xf863('0x2c')](respondWithResult(_0x83ee92,null))['catch'](handleError(_0x83ee92,null));};exports[_0xf863('0xcb')]=function(_0x5c8dc5,_0x2a854f,_0x5b07aa){return db[_0xf863('0x3b')][_0xf863('0x65')]({'where':{'id':_0x5c8dc5[_0xf863('0xb8')]['id']}})[_0xf863('0x2c')](handleEntityNotFound(_0x2a854f,null))[_0xf863('0x2c')](function(_0x4d5b31){if(_0x4d5b31){return _0x4d5b31[_0xf863('0xcb')](_0x5c8dc5[_0xf863('0x40')][_0xf863('0xc1')]);}})[_0xf863('0x2c')](respondWithStatusCode(_0x2a854f,null))['catch'](handleError(_0x2a854f,null));};exports[_0xf863('0xcc')]=function(_0x5de825,_0x2bcfba){var _0x4ed573=moment()[_0xf863('0xcd')]()[_0xf863('0x9d')]();var _0x419d8d=path[_0xf863('0xce')](config[_0xf863('0xcf')],'server','files',_0xf863('0xd0'));var _0x52f0da=path[_0xf863('0xce')](config[_0xf863('0xcf')],_0xf863('0xd1'),'files',_0xf863('0xd2'));var _0x2cef5b=path[_0xf863('0xce')](_0x419d8d,_0x4ed573);var _0x40a70a=util[_0xf863('0xc4')](_0xf863('0xd3'),_0x5de825[_0xf863('0xb8')]['id'],_0x4ed573);var _0xe6bb6e=path[_0xf863('0xce')](_0x419d8d,_0x40a70a);var _0x4143ce=[];_0x4143ce['push']({'model':db[_0xf863('0xd4')],'as':_0xf863('0xd4'),'attributes':['id',_0xf863('0x34')],'raw':!![]});_0x4143ce[_0xf863('0x38')]({'model':db['CmContact'],'as':_0xf863('0x6a'),'attributes':['id',_0xf863('0xd5'),_0xf863('0xd6')],'raw':!![]});if(_0x5de825['query'][_0xf863('0xd2')]){_0x4143ce[_0xf863('0x38')]({'model':db[_0xf863('0xd7')],'as':'Attachment','raw':!![]});}var _0x460c45=[{'model':db[_0xf863('0xc0')],'as':_0xf863('0xd8'),'attributes':['id','body',_0xf863('0x7a'),'direction',_0xf863('0xd9'),_0xf863('0x81')],'include':_0x4143ce}];_0x460c45[_0xf863('0x38')]({'model':db[_0xf863('0xda')],'as':'Account','attributes':['id',_0xf863('0x30')]});_0x460c45['push']({'model':db[_0xf863('0xd4')],'as':'Owner','attributes':['id',_0xf863('0x34')]});return db[_0xf863('0x3b')]['find']({'where':{'id':_0x5de825['params']['id']},'include':_0x460c45})[_0xf863('0x2c')](handleEntityNotFound(_0x2bcfba,null))[_0xf863('0x2c')](function(_0xf38be3){if(_0xf38be3){var _0x20bfc7=_0xf38be3[_0xf863('0xdb')]({'plain':!![]});fs[_0xf863('0xdc')](_0x2cef5b);var _0x36c377={'channel':_0xf863('0xdd'),'account':_0x20bfc7[_0xf863('0xde')][_0xf863('0x30')],'agent':_0x20bfc7[_0xf863('0xdf')]?_0x20bfc7[_0xf863('0xdf')][_0xf863('0x34')]:_0xf863('0xe0'),'createdAt':moment(_0x20bfc7[_0xf863('0x7a')])[_0xf863('0xc4')](_0xf863('0xc5'))[_0xf863('0x9d')](),'closedAt':_0x20bfc7[_0xf863('0xe1')]?moment(_0x20bfc7['closedAt'])[_0xf863('0xc4')](_0xf863('0xc5'))[_0xf863('0x9d')]():'','disposition':_0x20bfc7[_0xf863('0xe2')],'messages':_(_0x20bfc7[_0xf863('0xd8')])['filter']({'secret':![]})[_0xf863('0x33')](function(_0x25b147){if(_0x25b147[_0xf863('0xd7')]){var _0x3756cc=path[_0xf863('0xce')](_0x52f0da,_0x25b147[_0xf863('0xd7')][_0xf863('0xe3')]);if(fs[_0xf863('0xe4')](_0x3756cc)){fs[_0xf863('0xe5')](_0x3756cc)['pipe'](fs['createWriteStream'](path[_0xf863('0xce')](_0x2cef5b,_0x25b147['Attachment']['basename'])));}}return{'date':moment(_0x25b147[_0xf863('0x7a')])[_0xf863('0xc4')](_0xf863('0xc5'))[_0xf863('0x9d')](),'sender':_0x25b147[_0xf863('0xe6')]===_0xf863('0xe7')?_0x25b147[_0xf863('0xd4')]?_0x25b147[_0xf863('0xd4')][_0xf863('0x34')]:'System':_0x25b147[_0xf863('0x6a')][_0xf863('0xd5')]+(_0x25b147['Contact'][_0xf863('0xd6')]?'\x20'+_0x25b147[_0xf863('0x6a')][_0xf863('0xd6')]:''),'body':_0x25b147[_0xf863('0xd7')]?_0x25b147[_0xf863('0xd7')][_0xf863('0xe3')]:_0x25b147[_0xf863('0x74')],'direction':_0x25b147[_0xf863('0xe6')]==='out'?'A':'C','secret':_0x25b147[_0xf863('0xd9')],'read':_0x25b147[_0xf863('0x81')],'attachment':_0x25b147[_0xf863('0xd7')]};})[_0xf863('0x66')]()};return ejs['renderFile'](path[_0xf863('0xce')](config[_0xf863('0xcf')],_0xf863('0xd1'),_0xf863('0xe8'),_0xf863('0xe9')),{'interaction':_0x36c377})[_0xf863('0x2c')](function(_0x45bba9){var _0x59cd51=path[_0xf863('0xce')](_0x2cef5b,_0xf863('0xea')+_0x20bfc7['id']+'-'+_0x4ed573+'.pdf');var _0x1178e3={'path':_0x59cd51,'channel':'Whatsapp','interactionId':_0x20bfc7['id']};return pdf['createPdfFromHTML'](_0x45bba9,_0x1178e3);})[_0xf863('0x2c')](function(){return new BPromise(function(_0x303a38,_0x216dd3){zipdir(_0x2cef5b,{'saveTo':_0xe6bb6e},function(_0x1699b0,_0x2945b9){if(_0x1699b0)return _0x216dd3(_0x1699b0);return _0x303a38(_0x2945b9);});})[_0xf863('0x2c')](function(){return new BPromise(function(_0x463a97,_0x12f40a){rimraf(_0x2cef5b,function(_0x16e206){if(_0x16e206)_0x12f40a(_0x16e206);return _0x463a97();});});})['then'](function(){return _0x2bcfba['download'](_0xe6bb6e,_0x40a70a,function(_0x4d9e71){if(_0x4d9e71){console[_0xf863('0xeb')]('err',_0x4d9e71);}else{fs['unlinkSync'](_0xe6bb6e);}});});});}else{return _0x2bcfba[_0xf863('0x1f')](0xc8);}})[_0xf863('0x39')](handleError(_0x2bcfba,null));}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.events.js b/server/api/whatsappInteraction/whatsappInteraction.events.js index 1e9f690..6a3690d 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 _0x3140=['../../mysqldb','WhatsappInteraction','save','update','remove','getUsers','then','setDataValue','map','unreadMessages','length','emit','catch','hasOwnProperty','exports','events'];(function(_0x151c71,_0x111af7){var _0x1cdf04=function(_0x268e2b){while(--_0x268e2b){_0x151c71['push'](_0x151c71['shift']());}};_0x1cdf04(++_0x111af7);}(_0x3140,0xaf));var _0x0314=function(_0xe07094,_0x1cd13b){_0xe07094=_0xe07094-0x0;var _0x2d447b=_0x3140[_0xe07094];return _0x2d447b;};'use strict';var EventEmitter=require(_0x0314('0x0'));var WhatsappInteraction=require(_0x0314('0x1'))['db'][_0x0314('0x2')];var WhatsappMessage=require(_0x0314('0x1'))['db']['WhatsappMessage'];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x0314('0x3'),'afterUpdate':_0x0314('0x4'),'afterDestroy':_0x0314('0x5')};function emitEvent(_0x3e4284){return function(_0x254566,_0x46c395,_0x9e308d){_0x254566[_0x0314('0x6')]({'attributes':['id'],'raw':!![]})[_0x0314('0x7')](function(_0x44762d){_0x254566[_0x0314('0x8')]('Users',_0x44762d[_0x0314('0x9')](function(_0x2d87d2){return{'id':_0x2d87d2['id']};}));return WhatsappMessage['findAll']({'where':{'WhatsappInteractionId':_0x254566['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0xf2561e){_0x254566['setDataValue'](_0x0314('0xa'),_0xf2561e[_0x0314('0xb')]);WhatsappInteractionEvents[_0x0314('0xc')](_0x3e4284+':'+_0x254566['id'],_0x254566);WhatsappInteractionEvents[_0x0314('0xc')](_0x3e4284,_0x254566);_0x9e308d(null);})[_0x0314('0xd')](_0x9e308d(null));};}for(var e in events){if(events[_0x0314('0xe')](e)){var event=events[e];WhatsappInteraction['hook'](e,emitEvent(event));}}module[_0x0314('0xf')]=WhatsappInteractionEvents; \ No newline at end of file +var _0xe605=['getUsers','then','setDataValue','findAll','unreadMessages','length','emit','hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappMessage','setMaxListeners','save','update','remove'];(function(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0xe605,0x92));var _0x5e60=function(_0x2f32ca,_0x41d031){_0x2f32ca=_0x2f32ca-0x0;var _0x53c235=_0xe605[_0x2f32ca];return _0x53c235;};'use strict';var EventEmitter=require(_0x5e60('0x0'));var WhatsappInteraction=require(_0x5e60('0x1'))['db']['WhatsappInteraction'];var WhatsappMessage=require(_0x5e60('0x1'))['db'][_0x5e60('0x2')];var WhatsappInteractionEvents=new EventEmitter();WhatsappInteractionEvents[_0x5e60('0x3')](0x0);var events={'afterCreate':_0x5e60('0x4'),'afterUpdate':_0x5e60('0x5'),'afterDestroy':_0x5e60('0x6')};function emitEvent(_0x3a6c7c){return function(_0x30d8fb,_0x297ab2,_0xc41535){_0x30d8fb[_0x5e60('0x7')]({'attributes':['id'],'raw':!![]})[_0x5e60('0x8')](function(_0x4e3501){_0x30d8fb[_0x5e60('0x9')]('Users',_0x4e3501['map'](function(_0x53dccb){return{'id':_0x53dccb['id']};}));return WhatsappMessage[_0x5e60('0xa')]({'where':{'WhatsappInteractionId':_0x30d8fb['id'],'direction':'in','read':![]},'raw':!![]});})[_0x5e60('0x8')](function(_0x150a51){_0x30d8fb[_0x5e60('0x9')](_0x5e60('0xb'),_0x150a51[_0x5e60('0xc')]);WhatsappInteractionEvents['emit'](_0x3a6c7c+':'+_0x30d8fb['id'],_0x30d8fb);WhatsappInteractionEvents[_0x5e60('0xd')](_0x3a6c7c,_0x30d8fb);_0xc41535(null);})['catch'](_0xc41535(null));};}for(var e in events){if(events[_0x5e60('0xe')](e)){var event=events[e];WhatsappInteraction[_0x5e60('0xf')](e,emitEvent(event));}}module[_0x5e60('0x10')]=WhatsappInteractionEvents; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.model.js b/server/api/whatsappInteraction/whatsappInteraction.model.js index f3adcef..0a8e3f8 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 _0x6e67=['./whatsappInteraction.attributes','exports','define','WhatsappInteraction','whatsapp_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','api','path','rimraf'];(function(_0xb0fe92,_0x147e42){var _0x41787f=function(_0x42ae35){while(--_0x42ae35){_0xb0fe92['push'](_0xb0fe92['shift']());}};_0x41787f(++_0x147e42);}(_0x6e67,0x136));var _0x76e6=function(_0x4d0d85,_0x1d2bdb){_0x4d0d85=_0x4d0d85-0x0;var _0xf8b08e=_0x6e67[_0x4d0d85];return _0xf8b08e;};'use strict';var _=require(_0x76e6('0x0'));var util=require(_0x76e6('0x1'));var logger=require('../../config/logger')(_0x76e6('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x76e6('0x3'));var rimraf=require(_0x76e6('0x4'));var config=require('../../config/environment');var attributes=require(_0x76e6('0x5'));module[_0x76e6('0x6')]=function(_0xc94e72,_0x4f9761){return _0xc94e72[_0x76e6('0x7')](_0x76e6('0x8'),attributes,{'tableName':_0x76e6('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2401ba,_0x13e5da,_0x35292a){if(_0x2401ba[_0x76e6('0xa')](_0x76e6('0xb'))){_0x2401ba[_0x76e6('0xc')]=moment()[_0x76e6('0xd')](_0x76e6('0xe'));}_0x35292a(null,_0x2401ba);}}});}; \ No newline at end of file +var _0x3b3a=['util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./whatsappInteraction.attributes','define','WhatsappInteraction','whatsapp_interactions','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x133ebe,_0x3b4276){var _0x1239c2=function(_0x12a931){while(--_0x12a931){_0x133ebe['push'](_0x133ebe['shift']());}};_0x1239c2(++_0x3b4276);}(_0x3b3a,0x190));var _0xa3b3=function(_0x259be6,_0x291c94){_0x259be6=_0x259be6-0x0;var _0x4a93c4=_0x3b3a[_0x259be6];return _0x4a93c4;};'use strict';var _=require('lodash');var util=require(_0xa3b3('0x0'));var logger=require(_0xa3b3('0x1'))(_0xa3b3('0x2'));var moment=require(_0xa3b3('0x3'));var BPromise=require(_0xa3b3('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa3b3('0x5'));var rimraf=require(_0xa3b3('0x6'));var config=require(_0xa3b3('0x7'));var attributes=require(_0xa3b3('0x8'));module['exports']=function(_0x40c383,_0x121bbd){return _0x40c383[_0xa3b3('0x9')](_0xa3b3('0xa'),attributes,{'tableName':_0xa3b3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x206480,_0x4e5893,_0x39fa86){if(_0x206480[_0xa3b3('0xc')]('closed')){_0x206480[_0xa3b3('0xd')]=moment()[_0xa3b3('0xe')](_0xa3b3('0xf'));}_0x39fa86(null,_0x206480);}}});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.rpc.js b/server/api/whatsappInteraction/whatsappInteraction.rpc.js index 0e0de7d..ba39a9a 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 _0x3c3d=['result','catch','UpdateWhatsappInteraction','WhatsappInteraction','options','raw','where','attributes','AddTagsToWhatsappInteraction','find','addTags','body','ids','omit','spread','AddTags','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','then','info','debug','WhatsappInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','WhatsappInteraction,\x20%s,\x20%s','message'];(function(_0x2ddd4d,_0x54441c){var _0x3dd14d=function(_0x51f12d){while(--_0x51f12d){_0x2ddd4d['push'](_0x2ddd4d['shift']());}};_0x3dd14d(++_0x54441c);}(_0x3c3d,0xb4));var _0xd3c3=function(_0x320f0b,_0x53fadd){_0x320f0b=_0x320f0b-0x0;var _0x42ee31=_0x3c3d[_0x320f0b];return _0x42ee31;};'use strict';var _=require('lodash');var util=require(_0xd3c3('0x0'));var moment=require(_0xd3c3('0x1'));var BPromise=require(_0xd3c3('0x2'));var rs=require(_0xd3c3('0x3'));var fs=require('fs');var Redis=require(_0xd3c3('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xd3c3('0x5'));var logger=require(_0xd3c3('0x6'))('rpc');var config=require(_0xd3c3('0x7'));var jayson=require(_0xd3c3('0x8'));var client=jayson[_0xd3c3('0x9')]['http']({'port':0x232a});config[_0xd3c3('0xa')]=_[_0xd3c3('0xb')](config['redis'],{'host':_0xd3c3('0xc'),'port':0x18eb});var socket=require(_0xd3c3('0xd'))(new Redis(config[_0xd3c3('0xa')]));require(_0xd3c3('0xe'))['register'](socket);function respondWithRpcPromise(_0xd3998,_0x56e2f7,_0x212981){return new BPromise(function(_0x2a6b49,_0xde191b){return client['request'](_0xd3998,_0x212981)[_0xd3c3('0xf')](function(_0x40f400){logger[_0xd3c3('0x10')]('WhatsappInteraction,\x20%s,\x20%s',_0x56e2f7,'request\x20sent');logger[_0xd3c3('0x11')](_0xd3c3('0x12'),_0x56e2f7,_0xd3c3('0x13'),JSON[_0xd3c3('0x14')](_0x40f400));if(_0x40f400[_0xd3c3('0x15')]){if(_0x40f400[_0xd3c3('0x15')][_0xd3c3('0x16')]===0x1f4){logger[_0xd3c3('0x15')](_0xd3c3('0x17'),_0x56e2f7,_0x40f400['error'][_0xd3c3('0x18')]);return _0xde191b(_0x40f400['error'][_0xd3c3('0x18')]);}logger[_0xd3c3('0x15')](_0xd3c3('0x17'),_0x56e2f7,_0x40f400[_0xd3c3('0x15')][_0xd3c3('0x18')]);return _0x2a6b49(_0x40f400[_0xd3c3('0x15')][_0xd3c3('0x18')]);}else{logger['info'](_0xd3c3('0x17'),_0x56e2f7,_0xd3c3('0x13'));_0x2a6b49(_0x40f400[_0xd3c3('0x19')][_0xd3c3('0x18')]);}})[_0xd3c3('0x1a')](function(_0x43f162){logger['error'](_0xd3c3('0x17'),_0x56e2f7,_0x43f162);_0xde191b(_0x43f162);});});}exports[_0xd3c3('0x1b')]=function(_0x279f5d){var _0x855cd6=this;return new Promise(function(_0x3f961f,_0x59369e){return db[_0xd3c3('0x1c')]['update'](_0x279f5d['body'],{'raw':_0x279f5d[_0xd3c3('0x1d')]?_0x279f5d[_0xd3c3('0x1d')][_0xd3c3('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x279f5d['options']?_0x279f5d[_0xd3c3('0x1d')][_0xd3c3('0x1f')]||null:null,'attributes':_0x279f5d[_0xd3c3('0x1d')]?_0x279f5d['options'][_0xd3c3('0x20')]||null:null,'limit':_0x279f5d[_0xd3c3('0x1d')]?_0x279f5d[_0xd3c3('0x1d')]['limit']||null:null})[_0xd3c3('0xf')](function(_0x14802a){logger[_0xd3c3('0x10')](_0xd3c3('0x1b'),_0x279f5d);logger['debug'](_0xd3c3('0x1b'),_0x279f5d,JSON[_0xd3c3('0x14')](_0x14802a));_0x3f961f(_0x14802a);})[_0xd3c3('0x1a')](function(_0x219f08){logger[_0xd3c3('0x15')](_0xd3c3('0x1b'),_0x219f08[_0xd3c3('0x18')],_0x279f5d);_0x59369e(_0x855cd6[_0xd3c3('0x15')](0x1f4,_0x219f08[_0xd3c3('0x18')]));});});};exports[_0xd3c3('0x21')]=function(_0x1e0b1b){return new Promise(function(_0x3b64a5,_0x4845be){return db[_0xd3c3('0x1c')][_0xd3c3('0x22')]({'where':_0x1e0b1b['options']?_0x1e0b1b['options'][_0xd3c3('0x1f')]||null:null})[_0xd3c3('0xf')](function(_0x290dc3){if(_0x290dc3){return _0x290dc3[_0xd3c3('0x23')](_0x1e0b1b[_0xd3c3('0x24')][_0xd3c3('0x25')],_[_0xd3c3('0x26')](_0x1e0b1b[_0xd3c3('0x24')],[_0xd3c3('0x25'),'id'])||{});}})[_0xd3c3('0x27')](function(_0x176bc5){logger[_0xd3c3('0x10')](_0xd3c3('0x28'),_0x1e0b1b);logger[_0xd3c3('0x11')](_0xd3c3('0x28'),_0x1e0b1b,JSON['stringify'](_0x176bc5));_0x3b64a5(_0x176bc5);})[_0xd3c3('0x1a')](function(_0x50c98a){logger[_0xd3c3('0x15')]('AddTags',_0x50c98a[_0xd3c3('0x18')],_0x1e0b1b);_0x4845be(_this[_0xd3c3('0x15')](0x1f4,_0x50c98a[_0xd3c3('0x18')]));});});}; \ No newline at end of file +var _0xc79f=['WhatsappInteraction','update','body','options','raw','where','attributes','limit','stringify','find','then','addTags','omit','ids','spread','AddTags','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./whatsappInteraction.socket','request','info','WhatsappInteraction,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','UpdateWhatsappInteraction'];(function(_0x5cf17d,_0x16d5dd){var _0x53efb0=function(_0x559aaf){while(--_0x559aaf){_0x5cf17d['push'](_0x5cf17d['shift']());}};_0x53efb0(++_0x16d5dd);}(_0xc79f,0x64));var _0xfc79=function(_0x33e566,_0x3e90f4){_0x33e566=_0x33e566-0x0;var _0x828b80=_0xc79f[_0x33e566];return _0x828b80;};'use strict';var _=require(_0xfc79('0x0'));var util=require(_0xfc79('0x1'));var moment=require(_0xfc79('0x2'));var BPromise=require(_0xfc79('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfc79('0x4'))['db'];var utils=require(_0xfc79('0x5'));var logger=require(_0xfc79('0x6'))(_0xfc79('0x7'));var config=require(_0xfc79('0x8'));var jayson=require(_0xfc79('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0xfc79('0xa')]=_[_0xfc79('0xb')](config[_0xfc79('0xa')],{'host':_0xfc79('0xc'),'port':0x18eb});var socket=require(_0xfc79('0xd'))(new Redis(config[_0xfc79('0xa')]));require(_0xfc79('0xe'))['register'](socket);function respondWithRpcPromise(_0x506428,_0x429817,_0x1250ca){return new BPromise(function(_0x5d0134,_0x36aa30){return client[_0xfc79('0xf')](_0x506428,_0x1250ca)['then'](function(_0x17a9f1){logger[_0xfc79('0x10')](_0xfc79('0x11'),_0x429817,_0xfc79('0x12'));logger[_0xfc79('0x13')]('WhatsappInteraction,\x20%s,\x20%s,\x20%s',_0x429817,_0xfc79('0x12'),JSON['stringify'](_0x17a9f1));if(_0x17a9f1[_0xfc79('0x14')]){if(_0x17a9f1[_0xfc79('0x14')][_0xfc79('0x15')]===0x1f4){logger[_0xfc79('0x14')]('WhatsappInteraction,\x20%s,\x20%s',_0x429817,_0x17a9f1[_0xfc79('0x14')][_0xfc79('0x16')]);return _0x36aa30(_0x17a9f1[_0xfc79('0x14')][_0xfc79('0x16')]);}logger[_0xfc79('0x14')]('WhatsappInteraction,\x20%s,\x20%s',_0x429817,_0x17a9f1[_0xfc79('0x14')][_0xfc79('0x16')]);return _0x5d0134(_0x17a9f1[_0xfc79('0x14')][_0xfc79('0x16')]);}else{logger[_0xfc79('0x10')](_0xfc79('0x11'),_0x429817,'request\x20sent');_0x5d0134(_0x17a9f1[_0xfc79('0x17')][_0xfc79('0x16')]);}})[_0xfc79('0x18')](function(_0x1ba0a6){logger[_0xfc79('0x14')](_0xfc79('0x11'),_0x429817,_0x1ba0a6);_0x36aa30(_0x1ba0a6);});});}exports[_0xfc79('0x19')]=function(_0x50a80f){var _0xec0f98=this;return new Promise(function(_0x55b0f1,_0x4470ee){return db[_0xfc79('0x1a')][_0xfc79('0x1b')](_0x50a80f[_0xfc79('0x1c')],{'raw':_0x50a80f[_0xfc79('0x1d')]?_0x50a80f['options'][_0xfc79('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x50a80f[_0xfc79('0x1d')]?_0x50a80f[_0xfc79('0x1d')][_0xfc79('0x1f')]||null:null,'attributes':_0x50a80f['options']?_0x50a80f[_0xfc79('0x1d')][_0xfc79('0x20')]||null:null,'limit':_0x50a80f['options']?_0x50a80f[_0xfc79('0x1d')][_0xfc79('0x21')]||null:null})['then'](function(_0x2063fc){logger[_0xfc79('0x10')]('UpdateWhatsappInteraction',_0x50a80f);logger[_0xfc79('0x13')](_0xfc79('0x19'),_0x50a80f,JSON[_0xfc79('0x22')](_0x2063fc));_0x55b0f1(_0x2063fc);})[_0xfc79('0x18')](function(_0x27020b){logger[_0xfc79('0x14')]('UpdateWhatsappInteraction',_0x27020b[_0xfc79('0x16')],_0x50a80f);_0x4470ee(_0xec0f98[_0xfc79('0x14')](0x1f4,_0x27020b[_0xfc79('0x16')]));});});};exports['AddTagsToWhatsappInteraction']=function(_0x3f4f9b){return new Promise(function(_0x2745c7,_0x3930d7){return db[_0xfc79('0x1a')][_0xfc79('0x23')]({'where':_0x3f4f9b[_0xfc79('0x1d')]?_0x3f4f9b[_0xfc79('0x1d')]['where']||null:null})[_0xfc79('0x24')](function(_0x4a10d5){if(_0x4a10d5){return _0x4a10d5[_0xfc79('0x25')](_0x3f4f9b['body']['ids'],_[_0xfc79('0x26')](_0x3f4f9b[_0xfc79('0x1c')],[_0xfc79('0x27'),'id'])||{});}})[_0xfc79('0x28')](function(_0x1b9401){logger[_0xfc79('0x10')](_0xfc79('0x29'),_0x3f4f9b);logger[_0xfc79('0x13')]('AddTags',_0x3f4f9b,JSON[_0xfc79('0x22')](_0x1b9401));_0x2745c7(_0x1b9401);})[_0xfc79('0x18')](function(_0x56d364){logger['error'](_0xfc79('0x29'),_0x56d364['message'],_0x3f4f9b);_0x3930d7(_this[_0xfc79('0x14')](0x1f4,_0x56d364[_0xfc79('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappInteraction/whatsappInteraction.socket.js b/server/api/whatsappInteraction/whatsappInteraction.socket.js index a3721db..0d19f1c 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 _0x5585=['whatsappInteraction:','./whatsappInteraction.events','remove','update','emit','removeListener','register'];(function(_0x15876a,_0x15383d){var _0xbd900f=function(_0x103e59){while(--_0x103e59){_0x15876a['push'](_0x15876a['shift']());}};_0xbd900f(++_0x15383d);}(_0x5585,0x1eb));var _0x5558=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x5585[_0x20a584];return _0x4b41a8;};'use strict';var WhatsappInteractionEvents=require(_0x5558('0x0'));var events=['save',_0x5558('0x1'),_0x5558('0x2')];function createListener(_0x3d93f5,_0x12de68){return function(_0x3b6db6){_0x12de68[_0x5558('0x3')](_0x3d93f5,_0x3b6db6);};}function removeListener(_0x5159e3,_0x4c91ca){return function(){WhatsappInteractionEvents[_0x5558('0x4')](_0x5159e3,_0x4c91ca);};}exports[_0x5558('0x5')]=function(_0x429f2d){for(var _0x2621cf=0x0,_0x31b3b2=events['length'];_0x2621cf<_0x31b3b2;_0x2621cf++){var _0x28c4ce=events[_0x2621cf];var _0x29e55c=createListener(_0x5558('0x6')+_0x28c4ce,_0x429f2d);WhatsappInteractionEvents['on'](_0x28c4ce,_0x29e55c);}}; \ No newline at end of file +var _0xfc08=['removeListener','register','length','./whatsappInteraction.events','save','remove','update','emit'];(function(_0xf24612,_0x288e25){var _0x3388ee=function(_0x97ed23){while(--_0x97ed23){_0xf24612['push'](_0xf24612['shift']());}};_0x3388ee(++_0x288e25);}(_0xfc08,0x13b));var _0x8fc0=function(_0xc92421,_0x54089e){_0xc92421=_0xc92421-0x0;var _0x5b22f0=_0xfc08[_0xc92421];return _0x5b22f0;};'use strict';var WhatsappInteractionEvents=require(_0x8fc0('0x0'));var events=[_0x8fc0('0x1'),_0x8fc0('0x2'),_0x8fc0('0x3')];function createListener(_0x590246,_0x4e7fc1){return function(_0x2f3c79){_0x4e7fc1[_0x8fc0('0x4')](_0x590246,_0x2f3c79);};}function removeListener(_0x166d27,_0x43b517){return function(){WhatsappInteractionEvents[_0x8fc0('0x5')](_0x166d27,_0x43b517);};}exports[_0x8fc0('0x6')]=function(_0xe1d8d0){for(var _0x5042b1=0x0,_0xd94bba=events[_0x8fc0('0x7')];_0x5042b1<_0xd94bba;_0x5042b1++){var _0x5f38bf=events[_0x5042b1];var _0x40eb2c=createListener('whatsappInteraction:'+_0x5f38bf,_0xe1d8d0);WhatsappInteractionEvents['on'](_0x5f38bf,_0x40eb2c);}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/index.js b/server/api/whatsappMessage/index.js index c41ffbd..a31a6ba 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 _0x0077=['/:id','update','/:id/accept','accept','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','/describe','describe','show','post','tracked','whatsapp','whatsappmessage:create','create','/:id/status','status','put'];(function(_0x18fb4c,_0x578f22){var _0x4a75b3=function(_0x27d762){while(--_0x27d762){_0x18fb4c['push'](_0x18fb4c['shift']());}};_0x4a75b3(++_0x578f22);}(_0x0077,0xfe));var _0x7007=function(_0x5a5083,_0x3358b0){_0x5a5083=_0x5a5083-0x0;var _0x1f9930=_0x0077[_0x5a5083];return _0x1f9930;};'use strict';var multer=require(_0x7007('0x0'));var util=require('util');var path=require(_0x7007('0x1'));var timeout=require(_0x7007('0x2'));var express=require(_0x7007('0x3'));var router=express[_0x7007('0x4')]();var fs_extra=require(_0x7007('0x5'));var auth=require(_0x7007('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x7007('0x7'));var controller=require('./whatsappMessage.controller');router[_0x7007('0x8')]('/',auth[_0x7007('0x9')](),controller['index']);router[_0x7007('0x8')](_0x7007('0xa'),auth[_0x7007('0x9')](),controller[_0x7007('0xb')]);router[_0x7007('0x8')]('/:id',auth[_0x7007('0x9')](),controller[_0x7007('0xc')]);router[_0x7007('0xd')]('/',auth[_0x7007('0x9')](),interaction[_0x7007('0xe')](_0x7007('0xf'),_0x7007('0x10')),controller[_0x7007('0x11')]);router[_0x7007('0xd')](_0x7007('0x12'),controller[_0x7007('0x13')]);router[_0x7007('0x14')](_0x7007('0x15'),auth[_0x7007('0x9')](),controller[_0x7007('0x16')]);router[_0x7007('0x14')](_0x7007('0x17'),auth['isAuthenticated'](),controller[_0x7007('0x18')]);router['put']('/:id/reject',auth[_0x7007('0x9')](),controller['reject']);router['delete'](_0x7007('0x15'),auth[_0x7007('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xb408=['show','post','tracked','whatsapp','whatsappmessage:create','/:id/status','status','put','/:id/accept','reject','destroy','exports','multer','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./whatsappMessage.controller','get','isAuthenticated','index','/describe','/:id'];(function(_0x5106b8,_0x548af4){var _0x85c2d7=function(_0x58440a){while(--_0x58440a){_0x5106b8['push'](_0x5106b8['shift']());}};_0x85c2d7(++_0x548af4);}(_0xb408,0x1a4));var _0x8b40=function(_0xaa6c53,_0x57e3ec){_0xaa6c53=_0xaa6c53-0x0;var _0xa14007=_0xb408[_0xaa6c53];return _0xa14007;};'use strict';var multer=require(_0x8b40('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x8b40('0x1'));var express=require(_0x8b40('0x2'));var router=express[_0x8b40('0x3')]();var fs_extra=require(_0x8b40('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x8b40('0x5'));var config=require('../../config/environment');var controller=require(_0x8b40('0x6'));router[_0x8b40('0x7')]('/',auth[_0x8b40('0x8')](),controller[_0x8b40('0x9')]);router[_0x8b40('0x7')](_0x8b40('0xa'),auth[_0x8b40('0x8')](),controller['describe']);router[_0x8b40('0x7')](_0x8b40('0xb'),auth[_0x8b40('0x8')](),controller[_0x8b40('0xc')]);router[_0x8b40('0xd')]('/',auth['isAuthenticated'](),interaction[_0x8b40('0xe')](_0x8b40('0xf'),_0x8b40('0x10')),controller['create']);router[_0x8b40('0xd')](_0x8b40('0x11'),controller[_0x8b40('0x12')]);router[_0x8b40('0x13')](_0x8b40('0xb'),auth[_0x8b40('0x8')](),controller['update']);router['put'](_0x8b40('0x14'),auth[_0x8b40('0x8')](),controller['accept']);router[_0x8b40('0x13')]('/:id/reject',auth[_0x8b40('0x8')](),controller[_0x8b40('0x15')]);router['delete'](_0x8b40('0xb'),auth[_0x8b40('0x8')](),controller[_0x8b40('0x16')]);module[_0x8b40('0x17')]=router; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.attributes.js b/server/api/whatsappMessage/whatsappMessage.attributes.js index 32c0cfe..bce7b7d 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 _0xb077=['DATE','exports','medium','BOOLEAN','ENUM','out','STRING'];(function(_0x1a464,_0x28d9a1){var _0x34c526=function(_0x490a87){while(--_0x490a87){_0x1a464['push'](_0x1a464['shift']());}};_0x34c526(++_0x28d9a1);}(_0xb077,0x7f));var _0x7b07=function(_0x1a6be0,_0x317f11){_0x1a6be0=_0x1a6be0-0x0;var _0x1a0e62=_0xb077[_0x1a6be0];return _0x1a0e62;};'use strict';var Sequelize=require('sequelize');module[_0x7b07('0x0')]={'body':{'type':Sequelize['TEXT'](_0x7b07('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x7b07('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x7b07('0x3')]('in','out'),'defaultValue':_0x7b07('0x4'),'allowNull':![]},'messageId':{'type':Sequelize[_0x7b07('0x5')](0xbe)},'phone':{'type':Sequelize[_0x7b07('0x5')]},'readAt':{'type':Sequelize[_0x7b07('0x6')]},'secret':{'type':Sequelize[_0x7b07('0x2')],'defaultValue':![]},'providerName':{'type':Sequelize[_0x7b07('0x5')]},'providerResponse':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0xaa9c=['ENUM','out','STRING','sequelize','exports','TEXT','BOOLEAN'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xaa9c,0x1f4));var _0xcaa9=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0xaa9c[_0xbd08b4];return _0x314f1e;};'use strict';var Sequelize=require(_0xcaa9('0x0'));module[_0xcaa9('0x1')]={'body':{'type':Sequelize[_0xcaa9('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xcaa9('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xcaa9('0x4')]('in',_0xcaa9('0x5')),'defaultValue':_0xcaa9('0x5'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0xcaa9('0x6')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0xcaa9('0x3')],'defaultValue':![]},'providerName':{'type':Sequelize[_0xcaa9('0x6')]},'providerResponse':{'type':Sequelize[_0xcaa9('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.controller.js b/server/api/whatsappMessage/whatsappMessage.controller.js index d31abba..1d41e3e 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 _0xe9ff=['zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./whatsappMessage.socket','register','client','http','then','info','request\x20sent','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','code','error','message','WhatsappMessage,\x20%s,\x20%s','catch','sendStatus','status','end','json','offset','count','limit','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','map','key','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','WhatsappMessage','includeAll','include','findAll','rows','show','params','keys','rawAttributes','length','options','find','create','body','describe','../../config/logger','whatsapp-interactions','accept','whatsapp','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','WhatsappInteraction','WhatsappInteractionId','read1stAt','interaction','get','[WHATSAPPMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','User','agent','fullname','manual','channel','event','EventManager','acceptmessage','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','Sequelize','QueryTypes','SELECT','contact','email','internal','SIP/%s','rejectmessage','WhatsppMessage,\x20%s,\x20%s,\x20%s','type','inspect','twilio','MessageSid','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','eml-format'];(function(_0x48817d,_0x12a7cf){var _0x3ffdae=function(_0x9d0313){while(--_0x9d0313){_0x48817d['push'](_0x48817d['shift']());}};_0x3ffdae(++_0x12a7cf);}(_0xe9ff,0x19a));var _0xfe9f=function(_0x19285b,_0x5b7229){_0x19285b=_0x19285b-0x0;var _0x507e95=_0xe9ff[_0x19285b];return _0x507e95;};'use strict';var emlformat=require(_0xfe9f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfe9f('0x1'));var jsonpatch=require(_0xfe9f('0x2'));var rp=require(_0xfe9f('0x3'));var moment=require(_0xfe9f('0x4'));var BPromise=require(_0xfe9f('0x5'));var Mustache=require('mustache');var util=require(_0xfe9f('0x6'));var path=require(_0xfe9f('0x7'));var sox=require(_0xfe9f('0x8'));var csv=require(_0xfe9f('0x9'));var ejs=require(_0xfe9f('0xa'));var fs=require('fs');var fs_extra=require(_0xfe9f('0xb'));var _=require(_0xfe9f('0xc'));var squel=require(_0xfe9f('0xd'));var crypto=require('crypto');var jsforce=require(_0xfe9f('0xe'));var deskjs=require(_0xfe9f('0xf'));var toCsv=require(_0xfe9f('0x9'));var querystring=require(_0xfe9f('0x10'));var Papa=require('papaparse');var Redis=require(_0xfe9f('0x11'));var authService=require(_0xfe9f('0x12'));var qs=require(_0xfe9f('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xfe9f('0x14'));var utils=require('../../config/utils');var config=require(_0xfe9f('0x15'));var licenseUtil=require(_0xfe9f('0x16'));var db=require('../../mysqldb')['db'];config[_0xfe9f('0x17')]=_[_0xfe9f('0x18')](config[_0xfe9f('0x17')],{'host':_0xfe9f('0x19'),'port':0x18eb});var socket=require(_0xfe9f('0x1a'))(new Redis(config[_0xfe9f('0x17')]));require(_0xfe9f('0x1b'))[_0xfe9f('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson[_0xfe9f('0x1d')][_0xfe9f('0x1e')]({'port':0x232c});var client9002=jayson['client'][_0xfe9f('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x186726,_0x2a072c,_0xe52b42,_0x3601dd){return new BPromise(function(_0x46d8b3,_0x52bc84){var _0x1fafc6=_0x3601dd||client;return _0x1fafc6['request'](_0x186726,_0xe52b42)[_0xfe9f('0x1f')](function(_0x510754){logger[_0xfe9f('0x20')]('WhatsappMessage,\x20%s,\x20%s',_0x2a072c,_0xfe9f('0x21'));logger['debug'](_0xfe9f('0x22'),_0x2a072c,_0xfe9f('0x21'),JSON[_0xfe9f('0x23')](_0x510754));if(_0x510754['error']){if(_0x510754['error'][_0xfe9f('0x24')]===0x1f4){logger[_0xfe9f('0x25')]('WhatsappMessage,\x20%s,\x20%s',_0x2a072c,_0x510754[_0xfe9f('0x25')][_0xfe9f('0x26')]);return _0x52bc84(_0x510754['error'][_0xfe9f('0x26')]);}logger[_0xfe9f('0x25')](_0xfe9f('0x27'),_0x2a072c,_0x510754[_0xfe9f('0x25')][_0xfe9f('0x26')]);return _0x46d8b3(_0x510754[_0xfe9f('0x25')]['message']);}else{logger[_0xfe9f('0x20')](_0xfe9f('0x27'),_0x2a072c,_0xfe9f('0x21'));_0x46d8b3(_0x510754['result']['message']);}})[_0xfe9f('0x28')](function(_0x440fe1){logger[_0xfe9f('0x25')](_0xfe9f('0x27'),_0x2a072c,_0x440fe1);_0x52bc84(_0x440fe1);});});}function respondWithStatusCode(_0x8609da,_0x47c786){_0x47c786=_0x47c786||0xcc;return function(_0x3881cb){if(_0x3881cb){return _0x8609da[_0xfe9f('0x29')](_0x47c786);}return _0x8609da[_0xfe9f('0x2a')](_0x47c786)[_0xfe9f('0x2b')]();};}function respondWithResult(_0x56603d,_0x2e9311){_0x2e9311=_0x2e9311||0xc8;return function(_0x4551f0){if(_0x4551f0){return _0x56603d[_0xfe9f('0x2a')](_0x2e9311)[_0xfe9f('0x2c')](_0x4551f0);}};}function respondWithFilteredResult(_0x5a8af5,_0x5f1cbf){return function(_0x5bbb7f){if(_0x5bbb7f){var _0x26d37c=typeof _0x5f1cbf[_0xfe9f('0x2d')]==='undefined'&&typeof _0x5f1cbf['limit']==='undefined';var _0x30474c=_0x5bbb7f[_0xfe9f('0x2e')];var _0x1b5ca2=_0x26d37c?0x0:_0x5f1cbf[_0xfe9f('0x2d')];var _0x3fa98e=_0x26d37c?_0x5bbb7f['count']:_0x5f1cbf['offset']+_0x5f1cbf[_0xfe9f('0x2f')];var _0x3aaa4c;if(_0x3fa98e>=_0x30474c){_0x3fa98e=_0x30474c;_0x3aaa4c=0xc8;}else{_0x3aaa4c=0xce;}_0x5a8af5[_0xfe9f('0x2a')](_0x3aaa4c);return _0x5a8af5['set'](_0xfe9f('0x30'),_0x1b5ca2+'-'+_0x3fa98e+'/'+_0x30474c)['json'](_0x5bbb7f);}return null;};}function patchUpdates(_0x2e73aa){return function(_0x44ab8e){try{jsonpatch[_0xfe9f('0x31')](_0x44ab8e,_0x2e73aa,!![]);}catch(_0x1c2a3a){return BPromise[_0xfe9f('0x32')](_0x1c2a3a);}return _0x44ab8e[_0xfe9f('0x33')]();};}function saveUpdates(_0x5ced8c,_0x5ea3fd){return function(_0xba882c){if(_0xba882c){return _0xba882c[_0xfe9f('0x34')](_0x5ced8c)[_0xfe9f('0x1f')](function(_0x48f2f9){return _0x48f2f9;});}return null;};}function removeEntity(_0x5e2dad,_0x418d8c){return function(_0x145350){if(_0x145350){return _0x145350[_0xfe9f('0x35')]()['then'](function(){_0x5e2dad['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x164916,_0x32df92){return function(_0x3d1fe4){if(!_0x3d1fe4){_0x164916[_0xfe9f('0x29')](0x194);}return _0x3d1fe4;};}function handleError(_0x554bd5,_0x3553f5){_0x3553f5=_0x3553f5||0x1f4;return function(_0x4059c3){logger[_0xfe9f('0x25')](_0x4059c3[_0xfe9f('0x36')]);if(_0x4059c3[_0xfe9f('0x37')]){delete _0x4059c3[_0xfe9f('0x37')];}_0x554bd5[_0xfe9f('0x2a')](_0x3553f5)[_0xfe9f('0x38')](_0x4059c3);};}exports[_0xfe9f('0x39')]=function(_0x250a09,_0x519b5a){var _0x32e169={},_0x5f2119={},_0x3ca11c={'count':0x0,'rows':[]};var _0x183658=_[_0xfe9f('0x3a')](db['WhatsappMessage']['rawAttributes'],function(_0x225fd8){return{'name':_0x225fd8['fieldName'],'type':_0x225fd8['type'][_0xfe9f('0x3b')]};});_0x5f2119[_0xfe9f('0x3c')]=_[_0xfe9f('0x3a')](_0x183658,_0xfe9f('0x37'));_0x5f2119[_0xfe9f('0x3d')]=_['keys'](_0x250a09[_0xfe9f('0x3d')]);_0x5f2119['filters']=_[_0xfe9f('0x3e')](_0x5f2119['model'],_0x5f2119[_0xfe9f('0x3d')]);_0x32e169[_0xfe9f('0x3f')]=_[_0xfe9f('0x3e')](_0x5f2119[_0xfe9f('0x3c')],qs['fields'](_0x250a09[_0xfe9f('0x3d')][_0xfe9f('0x40')]));_0x32e169[_0xfe9f('0x3f')]=_0x32e169[_0xfe9f('0x3f')]['length']?_0x32e169['attributes']:_0x5f2119[_0xfe9f('0x3c')];if(!_0x250a09[_0xfe9f('0x3d')][_0xfe9f('0x41')](_0xfe9f('0x42'))){_0x32e169[_0xfe9f('0x2f')]=qs[_0xfe9f('0x2f')](_0x250a09[_0xfe9f('0x3d')][_0xfe9f('0x2f')]);_0x32e169['offset']=qs[_0xfe9f('0x2d')](_0x250a09[_0xfe9f('0x3d')][_0xfe9f('0x2d')]);}_0x32e169[_0xfe9f('0x43')]=qs[_0xfe9f('0x44')](_0x250a09[_0xfe9f('0x3d')][_0xfe9f('0x44')]);_0x32e169[_0xfe9f('0x45')]=qs[_0xfe9f('0x46')](_['pick'](_0x250a09[_0xfe9f('0x3d')],_0x5f2119[_0xfe9f('0x46')]),_0x183658);if(_0x250a09[_0xfe9f('0x3d')][_0xfe9f('0x47')]){_0x32e169[_0xfe9f('0x45')]=_['merge'](_0x32e169[_0xfe9f('0x45')],{'$or':_[_0xfe9f('0x3a')](_0x183658,function(_0x3135f8){if(_0x3135f8['type']!=='VIRTUAL'){var _0x45e03c={};_0x45e03c[_0x3135f8['name']]={'$like':'%'+_0x250a09[_0xfe9f('0x3d')][_0xfe9f('0x47')]+'%'};return _0x45e03c;}})});}_0x32e169=_[_0xfe9f('0x48')]({},_0x32e169,_0x250a09['options']);var _0x1736f9={'where':_0x32e169[_0xfe9f('0x45')]};return db[_0xfe9f('0x49')]['count'](_0x1736f9)[_0xfe9f('0x1f')](function(_0x2b81e7){_0x3ca11c[_0xfe9f('0x2e')]=_0x2b81e7;if(_0x250a09[_0xfe9f('0x3d')][_0xfe9f('0x4a')]){_0x32e169[_0xfe9f('0x4b')]=[{'all':!![]}];}return db[_0xfe9f('0x49')][_0xfe9f('0x4c')](_0x32e169);})['then'](function(_0x28eee5){_0x3ca11c[_0xfe9f('0x4d')]=_0x28eee5;return _0x3ca11c;})[_0xfe9f('0x1f')](respondWithFilteredResult(_0x519b5a,_0x32e169))[_0xfe9f('0x28')](handleError(_0x519b5a,null));};exports[_0xfe9f('0x4e')]=function(_0x1e6805,_0x252df9){var _0x154314={'raw':!![],'where':{'id':_0x1e6805[_0xfe9f('0x4f')]['id']}},_0x3666ef={};_0x3666ef[_0xfe9f('0x3c')]=_[_0xfe9f('0x50')](db['WhatsappMessage'][_0xfe9f('0x51')]);_0x3666ef['query']=_[_0xfe9f('0x50')](_0x1e6805[_0xfe9f('0x3d')]);_0x3666ef['filters']=_[_0xfe9f('0x3e')](_0x3666ef['model'],_0x3666ef[_0xfe9f('0x3d')]);_0x154314['attributes']=_['intersection'](_0x3666ef[_0xfe9f('0x3c')],qs['fields'](_0x1e6805[_0xfe9f('0x3d')][_0xfe9f('0x40')]));_0x154314[_0xfe9f('0x3f')]=_0x154314['attributes'][_0xfe9f('0x52')]?_0x154314['attributes']:_0x3666ef[_0xfe9f('0x3c')];if(_0x1e6805[_0xfe9f('0x3d')]['includeAll']){_0x154314[_0xfe9f('0x4b')]=[{'all':!![]}];}_0x154314=_[_0xfe9f('0x48')]({},_0x154314,_0x1e6805[_0xfe9f('0x53')]);return db['WhatsappMessage'][_0xfe9f('0x54')](_0x154314)[_0xfe9f('0x1f')](handleEntityNotFound(_0x252df9,null))[_0xfe9f('0x1f')](respondWithResult(_0x252df9,null))['catch'](handleError(_0x252df9,null));};exports[_0xfe9f('0x55')]=function(_0x214008,_0x47d2de){return db[_0xfe9f('0x49')][_0xfe9f('0x55')](_0x214008[_0xfe9f('0x56')],{})['then'](respondWithResult(_0x47d2de,0xc9))[_0xfe9f('0x28')](handleError(_0x47d2de,null));};exports['update']=function(_0x1d0885,_0x2cc783){if(_0x1d0885['body']['id']){delete _0x1d0885['body']['id'];}return db[_0xfe9f('0x49')][_0xfe9f('0x54')]({'where':{'id':_0x1d0885[_0xfe9f('0x4f')]['id']}})[_0xfe9f('0x1f')](handleEntityNotFound(_0x2cc783,null))[_0xfe9f('0x1f')](saveUpdates(_0x1d0885[_0xfe9f('0x56')],null))[_0xfe9f('0x1f')](respondWithResult(_0x2cc783,null))[_0xfe9f('0x28')](handleError(_0x2cc783,null));};exports[_0xfe9f('0x35')]=function(_0xca53ac,_0x5c3560){return db[_0xfe9f('0x49')][_0xfe9f('0x54')]({'where':{'id':_0xca53ac[_0xfe9f('0x4f')]['id']}})[_0xfe9f('0x1f')](handleEntityNotFound(_0x5c3560,null))[_0xfe9f('0x1f')](removeEntity(_0x5c3560,null))[_0xfe9f('0x28')](handleError(_0x5c3560,null));};exports[_0xfe9f('0x57')]=function(_0xed68b0,_0x318c4e){return db['WhatsappMessage']['describe']()[_0xfe9f('0x1f')](respondWithResult(_0x318c4e,null))[_0xfe9f('0x28')](handleError(_0x318c4e,null));};var interaction_log=require(_0xfe9f('0x58'))(_0xfe9f('0x59'));exports[_0xfe9f('0x5a')]=function(_0x346d72,_0x4e80b2,_0x11e1a6){var _0x4ed8d7={'agent':{},'channel':_0xfe9f('0x5b')};if(_0x346d72[_0xfe9f('0x56')]['id']){delete _0x346d72[_0xfe9f('0x56')]['id'];}_0x346d72['body'][_0xfe9f('0x5c')]=!![];_0x346d72['body'][_0xfe9f('0x5d')]=moment()[_0xfe9f('0x5e')](_0xfe9f('0x5f'));_0x346d72['body'][_0xfe9f('0x60')]=_0x346d72['body']['UserId']||_0x346d72[_0xfe9f('0x61')]['id'];_0x4ed8d7['agent']['id']=_0x346d72[_0xfe9f('0x56')][_0xfe9f('0x60')];return db[_0xfe9f('0x49')][_0xfe9f('0x54')]({'where':{'id':_0x346d72[_0xfe9f('0x4f')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x4e80b2,null))[_0xfe9f('0x1f')](saveUpdates(_0x346d72[_0xfe9f('0x56')],null))[_0xfe9f('0x1f')](function(_0x3631db){if(_0x3631db){_0x4ed8d7[_0xfe9f('0x26')]=_0x3631db['get']({'plain':!![]});return db[_0xfe9f('0x62')][_0xfe9f('0x54')]({'where':{'id':_0x3631db[_0xfe9f('0x63')]}});}return null;})[_0xfe9f('0x1f')](handleEntityNotFound(_0x4e80b2,null))[_0xfe9f('0x1f')](function(_0x22d847){if(_0x22d847){return _0x22d847[_0xfe9f('0x34')]({'UserId':_0x346d72[_0xfe9f('0x56')][_0xfe9f('0x60')],'read1stAt':_['isNil'](_0x22d847[_0xfe9f('0x64')])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xfe9f('0x1f')](function(_0x1934d7){if(_0x1934d7){_0x4ed8d7[_0xfe9f('0x65')]=_0x1934d7[_0xfe9f('0x66')]({'plain':!![]});interaction_log[_0xfe9f('0x20')](_0xfe9f('0x67'),_0x346d72[_0xfe9f('0x61')]['id'],_0x346d72[_0xfe9f('0x61')][_0xfe9f('0x37')],_0x346d72[_0xfe9f('0x61')]['role'],_0x4ed8d7['interaction']['id'],_0x346d72[_0xfe9f('0x56')]?JSON[_0xfe9f('0x23')](_0x346d72[_0xfe9f('0x56')]):_0xfe9f('0x68'));return respondWithRpcPromise(_0xfe9f('0x69'),_0xfe9f('0x6a'),_0x4ed8d7);}return null;})['then'](function(_0x29abe1){var _0x3f9356=_0xfe9f('0x6b')+_0x29abe1['message'][_0xfe9f('0x6c')];return db[_0xfe9f('0x6d')][_0xfe9f('0x3d')](_0x3f9356,{'type':db['Sequelize']['QueryTypes']['SELECT'],'raw':!![]})[_0xfe9f('0x1f')](function(_0x5b9243){return _0x5b9243;});})[_0xfe9f('0x1f')](function(_0x268213){if(_0x268213){_0x4ed8d7[_0xfe9f('0x26')]['contact']=_0x268213[0x0];if(!_0x346d72[_0xfe9f('0x56')][_0xfe9f('0x60')])return;return db[_0xfe9f('0x6e')][_0xfe9f('0x54')]({'where':{'id':_0x346d72[_0xfe9f('0x56')]['UserId'],'role':_0xfe9f('0x6f')},'attributes':['id',_0xfe9f('0x37'),_0xfe9f('0x70'),'email','internal'],'raw':!![]});}return null;})['then'](function(_0x25b133){if(!_0x25b133)return null;_0x4ed8d7[_0xfe9f('0x26')][_0xfe9f('0x6f')]=_0x25b133;return _0x4ed8d7;})[_0xfe9f('0x1f')](function(_0x48ee2e){if(_0x48ee2e){if(_0x346d72[_0xfe9f('0x56')][_0xfe9f('0x71')]){_0x4ed8d7[_0xfe9f('0x26')]['interface']=util[_0xfe9f('0x5e')]('SIP/%s',_0x346d72['user']['name']);_0x4ed8d7[_0xfe9f('0x26')][_0xfe9f('0x72')]=_0x4ed8d7[_0xfe9f('0x72')];_0x4ed8d7[_0xfe9f('0x26')]['motionChannel']=_0x4ed8d7['channel'];_0x4ed8d7[_0xfe9f('0x26')][_0xfe9f('0x73')]=_0xfe9f('0x5a');return respondWithRpcPromise(_0xfe9f('0x74'),_0xfe9f('0x74'),{'event':_0xfe9f('0x75'),'message':_0x4ed8d7[_0xfe9f('0x26')]},client9002)[_0xfe9f('0x1f')](function(){return _0x4ed8d7;});}return _0x4ed8d7;}return null;})[_0xfe9f('0x1f')](respondWithResult(_0x4e80b2,null))[_0xfe9f('0x28')](handleError(_0x4e80b2,null));};var interaction_log=require(_0xfe9f('0x58'))(_0xfe9f('0x59'));exports['reject']=function(_0x1a694f,_0x2ab0f3,_0xa8c581){var _0x1be961={'agent':{},'channel':_0xfe9f('0x5b')};if(_0x1a694f[_0xfe9f('0x56')]['id']){delete _0x1a694f[_0xfe9f('0x56')]['id'];}_0x1a694f[_0xfe9f('0x56')][_0xfe9f('0x60')]=_0x1a694f[_0xfe9f('0x56')][_0xfe9f('0x60')]||_0x1a694f[_0xfe9f('0x61')]['id'];_0x1be961[_0xfe9f('0x6f')]['id']=_0x1a694f[_0xfe9f('0x56')][_0xfe9f('0x60')];return db['WhatsappMessage'][_0xfe9f('0x54')]({'where':{'id':_0x1a694f['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x2ab0f3,null))['then'](function(_0x189d19){if(_0x189d19){_0x1be961[_0xfe9f('0x26')]=_0x189d19[_0xfe9f('0x66')]({'plain':!![]});return db[_0xfe9f('0x62')]['find']({'where':{'id':_0x189d19['WhatsappInteractionId']}});}return null;})[_0xfe9f('0x1f')](handleEntityNotFound(_0x2ab0f3,null))['then'](function(_0x1d8fd2){if(_0x1d8fd2){_0x1be961[_0xfe9f('0x65')]=_0x1d8fd2[_0xfe9f('0x66')]({'plain':!![]});interaction_log[_0xfe9f('0x20')](_0xfe9f('0x76'),_0x1a694f[_0xfe9f('0x61')]['id'],_0x1a694f['user'][_0xfe9f('0x37')],_0x1a694f[_0xfe9f('0x61')][_0xfe9f('0x77')],_0x1be961[_0xfe9f('0x65')]['id'],_0x1a694f[_0xfe9f('0x56')]?JSON[_0xfe9f('0x23')](_0x1a694f['body']):_0xfe9f('0x68'));return respondWithRpcPromise(_0xfe9f('0x78'),_0xfe9f('0x79'),_0x1be961);}return null;})['then'](function(_0x138d7d){var _0x503de7=_0xfe9f('0x6b')+_0x138d7d[_0xfe9f('0x26')][_0xfe9f('0x6c')];return db[_0xfe9f('0x6d')][_0xfe9f('0x3d')](_0x503de7,{'type':db[_0xfe9f('0x7a')][_0xfe9f('0x7b')][_0xfe9f('0x7c')],'raw':!![]})['then'](function(_0x4f4307){return _0x4f4307;});})[_0xfe9f('0x1f')](function(_0x2c9bfe){if(_0x2c9bfe){_0x1be961[_0xfe9f('0x26')][_0xfe9f('0x7d')]=_0x2c9bfe[0x0];if(!_0x1a694f['body'][_0xfe9f('0x60')])return;return db[_0xfe9f('0x6e')]['find']({'where':{'id':_0x1a694f[_0xfe9f('0x56')][_0xfe9f('0x60')],'role':_0xfe9f('0x6f')},'attributes':['id',_0xfe9f('0x37'),'fullname',_0xfe9f('0x7e'),_0xfe9f('0x7f')],'raw':!![]});}return null;})[_0xfe9f('0x1f')](function(_0x15e039){if(!_0x15e039)return null;_0x1be961[_0xfe9f('0x26')][_0xfe9f('0x6f')]=_0x15e039;return _0x1be961;})['then'](function(_0x5bdb40){if(_0x5bdb40){_0x5bdb40[_0xfe9f('0x26')]['interface']=util[_0xfe9f('0x5e')](_0xfe9f('0x80'),_0x1a694f[_0xfe9f('0x61')][_0xfe9f('0x37')]);_0x5bdb40[_0xfe9f('0x26')][_0xfe9f('0x72')]=_0x1be961[_0xfe9f('0x72')];_0x5bdb40[_0xfe9f('0x26')]['motionChannel']=_0x1be961[_0xfe9f('0x72')];_0x5bdb40[_0xfe9f('0x26')][_0xfe9f('0x73')]=_0xfe9f('0x32');respondWithRpcPromise('EventManager',_0xfe9f('0x74'),{'event':_0xfe9f('0x81'),'message':_0x5bdb40[_0xfe9f('0x26')]},client9002);return _0x1be961;}return null;})['then'](respondWithResult(_0x2ab0f3,null))[_0xfe9f('0x28')](handleError(_0x2ab0f3,null));};exports[_0xfe9f('0x2a')]=function(_0xec64c1,_0x535243,_0x5ad91f){if(_0xec64c1[_0xfe9f('0x56')]['id']){delete _0xec64c1[_0xfe9f('0x56')]['id'];}var _0x3f0444;return db[_0xfe9f('0x49')]['find']({'where':{'id':_0xec64c1[_0xfe9f('0x4f')]['id']}})['then'](handleEntityNotFound(_0x535243,null))[_0xfe9f('0x1f')](function(_0x4fc77c){if(_0x4fc77c){_0x3f0444=_0x4fc77c;return db['WhatsappAccount'][_0xfe9f('0x54')]({'where':{'id':_0x4fc77c['WhatsappAccountId']}});}})[_0xfe9f('0x1f')](handleEntityNotFound(_0x535243,null))[_0xfe9f('0x1f')](function(_0x86230f){if(_0x86230f){logger['debug'](_0xfe9f('0x82'),'status','received\x20delivery\x20report\x20from',_0x86230f[_0xfe9f('0x83')],util[_0xfe9f('0x84')](_0xec64c1[_0xfe9f('0x56')],{'showHidden':![],'depth':null}));switch(_0x86230f[_0xfe9f('0x83')]){case _0xfe9f('0x85'):if(_0xec64c1[_0xfe9f('0x56')][_0xfe9f('0x86')]&&_0xec64c1['body'][_0xfe9f('0x86')]===_0x3f0444['messageId']&&_0xec64c1['body']['MessageStatus']&&_0xec64c1['body'][_0xfe9f('0x87')]===_0xfe9f('0x5c')){return _0x3f0444[_0xfe9f('0x34')]({'read':!![]});}else{logger[_0xfe9f('0x25')](_0xfe9f('0x88'),'status',_0xfe9f('0x85'),util[_0xfe9f('0x84')](_0xec64c1['body'],{'showHidden':![],'depth':null}));}break;}return _0x3f0444;}})[_0xfe9f('0x1f')](respondWithResult(_0x535243,null))[_0xfe9f('0x28')](handleError(_0x535243,null));}; \ No newline at end of file +var _0xa204=['get','WhatsappInteractionId','isNil','interaction','[WHATSAPPMESSAGE: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','QueryTypes','SELECT','contact','agent','fullname','email','internal','manual','interface','SIP/%s','motionChannel','channel','EventManager','acceptmessage','../../config/logger','WhatsappInteraction','[WHATSAPPMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','sequelize','User','event','rejectmessage','WhatsappAccount','WhatsappAccountId','WhatsppMessage,\x20%s,\x20%s,\x20%s','received\x20delivery\x20report\x20from','inspect','twilio','messageId','MessageStatus','WhatsappAccount,\x20%s,\x20%s,\x20%s','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','./whatsappMessage.socket','register','jayson/promise','client','http','request','info','WhatsappMessage,\x20%s,\x20%s','request\x20sent','debug','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','status','end','offset','undefined','count','limit','set','Content-Range','apply','reject','update','then','name','send','index','map','rawAttributes','fieldName','type','query','filters','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','WhatsappMessage','findAll','rows','show','params','intersection','include','find','create','body','describe','whatsapp-interactions','accept','whatsapp','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0xa204,0xb7));var _0x4a20=function(_0xf8b3ed,_0x34e092){_0xf8b3ed=_0xf8b3ed-0x0;var _0x325794=_0xa204[_0xf8b3ed];return _0x325794;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4a20('0x0'));var zipdir=require(_0x4a20('0x1'));var jsonpatch=require(_0x4a20('0x2'));var rp=require('request-promise');var moment=require(_0x4a20('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x4a20('0x4'));var util=require(_0x4a20('0x5'));var path=require(_0x4a20('0x6'));var sox=require(_0x4a20('0x7'));var csv=require('to-csv');var ejs=require(_0x4a20('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4a20('0x9'));var squel=require(_0x4a20('0xa'));var crypto=require(_0x4a20('0xb'));var jsforce=require(_0x4a20('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x4a20('0xd'));var querystring=require(_0x4a20('0xe'));var Papa=require(_0x4a20('0xf'));var Redis=require(_0x4a20('0x10'));var authService=require(_0x4a20('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x4a20('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x4a20('0x13'));var config=require(_0x4a20('0x14'));var licenseUtil=require(_0x4a20('0x15'));var db=require(_0x4a20('0x16'))['db'];config[_0x4a20('0x17')]=_[_0x4a20('0x18')](config[_0x4a20('0x17')],{'host':_0x4a20('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4a20('0x17')]));require(_0x4a20('0x1a'))[_0x4a20('0x1b')](socket);var jayson=require(_0x4a20('0x1c'));var client=jayson[_0x4a20('0x1d')][_0x4a20('0x1e')]({'port':0x232c});var client9002=jayson[_0x4a20('0x1d')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3a9694,_0x2a299c,_0x2da603,_0x36e7e0){return new BPromise(function(_0x3e6c53,_0x3c12f2){var _0x214a47=_0x36e7e0||client;return _0x214a47[_0x4a20('0x1f')](_0x3a9694,_0x2da603)['then'](function(_0x56f5d5){logger[_0x4a20('0x20')](_0x4a20('0x21'),_0x2a299c,_0x4a20('0x22'));logger[_0x4a20('0x23')](_0x4a20('0x24'),_0x2a299c,'request\x20sent',JSON[_0x4a20('0x25')](_0x56f5d5));if(_0x56f5d5[_0x4a20('0x26')]){if(_0x56f5d5['error']['code']===0x1f4){logger['error'](_0x4a20('0x21'),_0x2a299c,_0x56f5d5[_0x4a20('0x26')][_0x4a20('0x27')]);return _0x3c12f2(_0x56f5d5[_0x4a20('0x26')][_0x4a20('0x27')]);}logger['error'](_0x4a20('0x21'),_0x2a299c,_0x56f5d5[_0x4a20('0x26')][_0x4a20('0x27')]);return _0x3e6c53(_0x56f5d5[_0x4a20('0x26')][_0x4a20('0x27')]);}else{logger[_0x4a20('0x20')]('WhatsappMessage,\x20%s,\x20%s',_0x2a299c,'request\x20sent');_0x3e6c53(_0x56f5d5[_0x4a20('0x28')]['message']);}})[_0x4a20('0x29')](function(_0x1f53b0){logger[_0x4a20('0x26')]('WhatsappMessage,\x20%s,\x20%s',_0x2a299c,_0x1f53b0);_0x3c12f2(_0x1f53b0);});});}function respondWithStatusCode(_0xcf4015,_0x1bcfe3){_0x1bcfe3=_0x1bcfe3||0xcc;return function(_0x296fa6){if(_0x296fa6){return _0xcf4015['sendStatus'](_0x1bcfe3);}return _0xcf4015[_0x4a20('0x2a')](_0x1bcfe3)[_0x4a20('0x2b')]();};}function respondWithResult(_0x30b65b,_0x3951d9){_0x3951d9=_0x3951d9||0xc8;return function(_0x3b9052){if(_0x3b9052){return _0x30b65b[_0x4a20('0x2a')](_0x3951d9)['json'](_0x3b9052);}};}function respondWithFilteredResult(_0x4754f8,_0x44a608){return function(_0x288f97){if(_0x288f97){var _0x532c7f=typeof _0x44a608[_0x4a20('0x2c')]===_0x4a20('0x2d')&&typeof _0x44a608['limit']===_0x4a20('0x2d');var _0x387062=_0x288f97['count'];var _0x55c59e=_0x532c7f?0x0:_0x44a608[_0x4a20('0x2c')];var _0x15441d=_0x532c7f?_0x288f97[_0x4a20('0x2e')]:_0x44a608[_0x4a20('0x2c')]+_0x44a608[_0x4a20('0x2f')];var _0x44a948;if(_0x15441d>=_0x387062){_0x15441d=_0x387062;_0x44a948=0xc8;}else{_0x44a948=0xce;}_0x4754f8['status'](_0x44a948);return _0x4754f8[_0x4a20('0x30')](_0x4a20('0x31'),_0x55c59e+'-'+_0x15441d+'/'+_0x387062)['json'](_0x288f97);}return null;};}function patchUpdates(_0x60d49a){return function(_0x50e7da){try{jsonpatch[_0x4a20('0x32')](_0x50e7da,_0x60d49a,!![]);}catch(_0x2e356f){return BPromise[_0x4a20('0x33')](_0x2e356f);}return _0x50e7da['save']();};}function saveUpdates(_0xc6de40,_0x4a5190){return function(_0x2d07fc){if(_0x2d07fc){return _0x2d07fc[_0x4a20('0x34')](_0xc6de40)[_0x4a20('0x35')](function(_0xc04d32){return _0xc04d32;});}return null;};}function removeEntity(_0x2d7739,_0x1f0ff1){return function(_0x355f34){if(_0x355f34){return _0x355f34['destroy']()['then'](function(){_0x2d7739[_0x4a20('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4f488c,_0x3258b7){return function(_0x3f01c1){if(!_0x3f01c1){_0x4f488c['sendStatus'](0x194);}return _0x3f01c1;};}function handleError(_0x2a8a14,_0x34a90c){_0x34a90c=_0x34a90c||0x1f4;return function(_0x558f87){logger[_0x4a20('0x26')](_0x558f87['stack']);if(_0x558f87[_0x4a20('0x36')]){delete _0x558f87[_0x4a20('0x36')];}_0x2a8a14['status'](_0x34a90c)[_0x4a20('0x37')](_0x558f87);};}exports[_0x4a20('0x38')]=function(_0x2b45d8,_0x1651e5){var _0x91d54b={},_0x5e9553={},_0x5f1563={'count':0x0,'rows':[]};var _0x48f5ff=_[_0x4a20('0x39')](db['WhatsappMessage'][_0x4a20('0x3a')],function(_0x15bcbc){return{'name':_0x15bcbc[_0x4a20('0x3b')],'type':_0x15bcbc[_0x4a20('0x3c')]['key']};});_0x5e9553['model']=_[_0x4a20('0x39')](_0x48f5ff,_0x4a20('0x36'));_0x5e9553[_0x4a20('0x3d')]=_['keys'](_0x2b45d8['query']);_0x5e9553[_0x4a20('0x3e')]=_['intersection'](_0x5e9553[_0x4a20('0x3f')],_0x5e9553[_0x4a20('0x3d')]);_0x91d54b[_0x4a20('0x40')]=_['intersection'](_0x5e9553['model'],qs[_0x4a20('0x41')](_0x2b45d8['query']['fields']));_0x91d54b[_0x4a20('0x40')]=_0x91d54b[_0x4a20('0x40')][_0x4a20('0x42')]?_0x91d54b[_0x4a20('0x40')]:_0x5e9553[_0x4a20('0x3f')];if(!_0x2b45d8[_0x4a20('0x3d')]['hasOwnProperty'](_0x4a20('0x43'))){_0x91d54b['limit']=qs[_0x4a20('0x2f')](_0x2b45d8[_0x4a20('0x3d')]['limit']);_0x91d54b[_0x4a20('0x2c')]=qs[_0x4a20('0x2c')](_0x2b45d8[_0x4a20('0x3d')][_0x4a20('0x2c')]);}_0x91d54b[_0x4a20('0x44')]=qs[_0x4a20('0x45')](_0x2b45d8[_0x4a20('0x3d')][_0x4a20('0x45')]);_0x91d54b[_0x4a20('0x46')]=qs[_0x4a20('0x3e')](_[_0x4a20('0x47')](_0x2b45d8[_0x4a20('0x3d')],_0x5e9553[_0x4a20('0x3e')]),_0x48f5ff);if(_0x2b45d8['query'][_0x4a20('0x48')]){_0x91d54b['where']=_['merge'](_0x91d54b[_0x4a20('0x46')],{'$or':_[_0x4a20('0x39')](_0x48f5ff,function(_0x9dbebe){if(_0x9dbebe[_0x4a20('0x3c')]!==_0x4a20('0x49')){var _0x260995={};_0x260995[_0x9dbebe[_0x4a20('0x36')]]={'$like':'%'+_0x2b45d8[_0x4a20('0x3d')][_0x4a20('0x48')]+'%'};return _0x260995;}})});}_0x91d54b=_[_0x4a20('0x4a')]({},_0x91d54b,_0x2b45d8[_0x4a20('0x4b')]);var _0x2a2b28={'where':_0x91d54b[_0x4a20('0x46')]};return db['WhatsappMessage'][_0x4a20('0x2e')](_0x2a2b28)[_0x4a20('0x35')](function(_0x2c13ba){_0x5f1563[_0x4a20('0x2e')]=_0x2c13ba;if(_0x2b45d8[_0x4a20('0x3d')][_0x4a20('0x4c')]){_0x91d54b['include']=[{'all':!![]}];}return db[_0x4a20('0x4d')][_0x4a20('0x4e')](_0x91d54b);})[_0x4a20('0x35')](function(_0x14b3e9){_0x5f1563[_0x4a20('0x4f')]=_0x14b3e9;return _0x5f1563;})['then'](respondWithFilteredResult(_0x1651e5,_0x91d54b))['catch'](handleError(_0x1651e5,null));};exports[_0x4a20('0x50')]=function(_0x2519aa,_0x1bd701){var _0x214201={'raw':!![],'where':{'id':_0x2519aa[_0x4a20('0x51')]['id']}},_0x4456ed={};_0x4456ed[_0x4a20('0x3f')]=_['keys'](db[_0x4a20('0x4d')][_0x4a20('0x3a')]);_0x4456ed[_0x4a20('0x3d')]=_['keys'](_0x2519aa['query']);_0x4456ed[_0x4a20('0x3e')]=_[_0x4a20('0x52')](_0x4456ed['model'],_0x4456ed[_0x4a20('0x3d')]);_0x214201['attributes']=_[_0x4a20('0x52')](_0x4456ed[_0x4a20('0x3f')],qs[_0x4a20('0x41')](_0x2519aa[_0x4a20('0x3d')]['fields']));_0x214201[_0x4a20('0x40')]=_0x214201[_0x4a20('0x40')][_0x4a20('0x42')]?_0x214201['attributes']:_0x4456ed[_0x4a20('0x3f')];if(_0x2519aa[_0x4a20('0x3d')][_0x4a20('0x4c')]){_0x214201[_0x4a20('0x53')]=[{'all':!![]}];}_0x214201=_['merge']({},_0x214201,_0x2519aa[_0x4a20('0x4b')]);return db[_0x4a20('0x4d')][_0x4a20('0x54')](_0x214201)['then'](handleEntityNotFound(_0x1bd701,null))[_0x4a20('0x35')](respondWithResult(_0x1bd701,null))['catch'](handleError(_0x1bd701,null));};exports[_0x4a20('0x55')]=function(_0x3f3014,_0x26b4ad){return db['WhatsappMessage']['create'](_0x3f3014['body'],{})['then'](respondWithResult(_0x26b4ad,0xc9))[_0x4a20('0x29')](handleError(_0x26b4ad,null));};exports['update']=function(_0xa95d18,_0x21ac99){if(_0xa95d18[_0x4a20('0x56')]['id']){delete _0xa95d18[_0x4a20('0x56')]['id'];}return db[_0x4a20('0x4d')][_0x4a20('0x54')]({'where':{'id':_0xa95d18[_0x4a20('0x51')]['id']}})[_0x4a20('0x35')](handleEntityNotFound(_0x21ac99,null))[_0x4a20('0x35')](saveUpdates(_0xa95d18[_0x4a20('0x56')],null))[_0x4a20('0x35')](respondWithResult(_0x21ac99,null))[_0x4a20('0x29')](handleError(_0x21ac99,null));};exports['destroy']=function(_0x4fefdd,_0x278725){return db[_0x4a20('0x4d')]['find']({'where':{'id':_0x4fefdd[_0x4a20('0x51')]['id']}})[_0x4a20('0x35')](handleEntityNotFound(_0x278725,null))[_0x4a20('0x35')](removeEntity(_0x278725,null))[_0x4a20('0x29')](handleError(_0x278725,null));};exports[_0x4a20('0x57')]=function(_0x146aab,_0x5c8059){return db['WhatsappMessage'][_0x4a20('0x57')]()[_0x4a20('0x35')](respondWithResult(_0x5c8059,null))[_0x4a20('0x29')](handleError(_0x5c8059,null));};var interaction_log=require('../../config/logger')(_0x4a20('0x58'));exports[_0x4a20('0x59')]=function(_0x24364a,_0x427607,_0x31031f){var _0x1afc8e={'agent':{},'channel':_0x4a20('0x5a')};if(_0x24364a[_0x4a20('0x56')]['id']){delete _0x24364a[_0x4a20('0x56')]['id'];}_0x24364a[_0x4a20('0x56')][_0x4a20('0x5b')]=!![];_0x24364a[_0x4a20('0x56')][_0x4a20('0x5c')]=moment()[_0x4a20('0x5d')](_0x4a20('0x5e'));_0x24364a[_0x4a20('0x56')][_0x4a20('0x5f')]=_0x24364a[_0x4a20('0x56')][_0x4a20('0x5f')]||_0x24364a[_0x4a20('0x60')]['id'];_0x1afc8e['agent']['id']=_0x24364a[_0x4a20('0x56')][_0x4a20('0x5f')];return db[_0x4a20('0x4d')]['find']({'where':{'id':_0x24364a[_0x4a20('0x51')]['id'],'UserId':null}})[_0x4a20('0x35')](handleEntityNotFound(_0x427607,null))[_0x4a20('0x35')](saveUpdates(_0x24364a[_0x4a20('0x56')],null))['then'](function(_0x1e8dc4){if(_0x1e8dc4){_0x1afc8e['message']=_0x1e8dc4[_0x4a20('0x61')]({'plain':!![]});return db['WhatsappInteraction']['find']({'where':{'id':_0x1e8dc4[_0x4a20('0x62')]}});}return null;})[_0x4a20('0x35')](handleEntityNotFound(_0x427607,null))[_0x4a20('0x35')](function(_0x54ea50){if(_0x54ea50){return _0x54ea50[_0x4a20('0x34')]({'UserId':_0x24364a[_0x4a20('0x56')][_0x4a20('0x5f')],'read1stAt':_[_0x4a20('0x63')](_0x54ea50['read1stAt'])?moment()[_0x4a20('0x5d')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x4a20('0x35')](function(_0x33c4c9){if(_0x33c4c9){_0x1afc8e[_0x4a20('0x64')]=_0x33c4c9['get']({'plain':!![]});interaction_log[_0x4a20('0x20')](_0x4a20('0x65'),_0x24364a[_0x4a20('0x60')]['id'],_0x24364a[_0x4a20('0x60')]['name'],_0x24364a['user'][_0x4a20('0x66')],_0x1afc8e[_0x4a20('0x64')]['id'],_0x24364a['body']?JSON[_0x4a20('0x25')](_0x24364a[_0x4a20('0x56')]):_0x4a20('0x67'));return respondWithRpcPromise(_0x4a20('0x68'),_0x4a20('0x69'),_0x1afc8e);}return null;})[_0x4a20('0x35')](function(_0x312f11){var _0x1309e1=_0x4a20('0x6a')+_0x312f11[_0x4a20('0x27')][_0x4a20('0x6b')];return db['sequelize'][_0x4a20('0x3d')](_0x1309e1,{'type':db[_0x4a20('0x6c')][_0x4a20('0x6d')][_0x4a20('0x6e')],'raw':!![]})[_0x4a20('0x35')](function(_0x2f3211){return _0x2f3211;});})[_0x4a20('0x35')](function(_0x4d98bd){if(_0x4d98bd){_0x1afc8e[_0x4a20('0x27')][_0x4a20('0x6f')]=_0x4d98bd[0x0];if(!_0x24364a[_0x4a20('0x56')][_0x4a20('0x5f')])return;return db['User'][_0x4a20('0x54')]({'where':{'id':_0x24364a[_0x4a20('0x56')][_0x4a20('0x5f')],'role':_0x4a20('0x70')},'attributes':['id',_0x4a20('0x36'),_0x4a20('0x71'),_0x4a20('0x72'),_0x4a20('0x73')],'raw':!![]});}return null;})[_0x4a20('0x35')](function(_0x37e682){if(!_0x37e682)return null;_0x1afc8e[_0x4a20('0x27')][_0x4a20('0x70')]=_0x37e682;return _0x1afc8e;})[_0x4a20('0x35')](function(_0x4e5f43){if(_0x4e5f43){if(_0x24364a['body'][_0x4a20('0x74')]){_0x1afc8e[_0x4a20('0x27')][_0x4a20('0x75')]=util[_0x4a20('0x5d')](_0x4a20('0x76'),_0x24364a[_0x4a20('0x60')][_0x4a20('0x36')]);_0x1afc8e[_0x4a20('0x27')]['channel']=_0x1afc8e['channel'];_0x1afc8e[_0x4a20('0x27')][_0x4a20('0x77')]=_0x1afc8e[_0x4a20('0x78')];_0x1afc8e[_0x4a20('0x27')]['event']=_0x4a20('0x59');return respondWithRpcPromise(_0x4a20('0x79'),_0x4a20('0x79'),{'event':_0x4a20('0x7a'),'message':_0x1afc8e[_0x4a20('0x27')]},client9002)[_0x4a20('0x35')](function(){return _0x1afc8e;});}return _0x1afc8e;}return null;})[_0x4a20('0x35')](respondWithResult(_0x427607,null))[_0x4a20('0x29')](handleError(_0x427607,null));};var interaction_log=require(_0x4a20('0x7b'))('whatsapp-interactions');exports[_0x4a20('0x33')]=function(_0xf38844,_0x3b9723,_0x3261de){var _0x498fef={'agent':{},'channel':_0x4a20('0x5a')};if(_0xf38844[_0x4a20('0x56')]['id']){delete _0xf38844[_0x4a20('0x56')]['id'];}_0xf38844['body'][_0x4a20('0x5f')]=_0xf38844[_0x4a20('0x56')][_0x4a20('0x5f')]||_0xf38844[_0x4a20('0x60')]['id'];_0x498fef[_0x4a20('0x70')]['id']=_0xf38844[_0x4a20('0x56')][_0x4a20('0x5f')];return db[_0x4a20('0x4d')]['find']({'where':{'id':_0xf38844[_0x4a20('0x51')]['id'],'UserId':null}})[_0x4a20('0x35')](handleEntityNotFound(_0x3b9723,null))[_0x4a20('0x35')](function(_0x4d8580){if(_0x4d8580){_0x498fef['message']=_0x4d8580['get']({'plain':!![]});return db[_0x4a20('0x7c')][_0x4a20('0x54')]({'where':{'id':_0x4d8580['WhatsappInteractionId']}});}return null;})[_0x4a20('0x35')](handleEntityNotFound(_0x3b9723,null))[_0x4a20('0x35')](function(_0x3703ab){if(_0x3703ab){_0x498fef['interaction']=_0x3703ab[_0x4a20('0x61')]({'plain':!![]});interaction_log['info'](_0x4a20('0x7d'),_0xf38844[_0x4a20('0x60')]['id'],_0xf38844['user'][_0x4a20('0x36')],_0xf38844[_0x4a20('0x60')][_0x4a20('0x66')],_0x498fef[_0x4a20('0x64')]['id'],_0xf38844[_0x4a20('0x56')]?JSON[_0x4a20('0x25')](_0xf38844[_0x4a20('0x56')]):'null');return respondWithRpcPromise('RejectMessage',_0x4a20('0x7e'),_0x498fef);}return null;})[_0x4a20('0x35')](function(_0x118dab){var _0x1198c8='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x118dab['message'][_0x4a20('0x6b')];return db[_0x4a20('0x7f')]['query'](_0x1198c8,{'type':db['Sequelize'][_0x4a20('0x6d')]['SELECT'],'raw':!![]})[_0x4a20('0x35')](function(_0x158010){return _0x158010;});})[_0x4a20('0x35')](function(_0x43ac59){if(_0x43ac59){_0x498fef[_0x4a20('0x27')][_0x4a20('0x6f')]=_0x43ac59[0x0];if(!_0xf38844[_0x4a20('0x56')][_0x4a20('0x5f')])return;return db[_0x4a20('0x80')][_0x4a20('0x54')]({'where':{'id':_0xf38844[_0x4a20('0x56')][_0x4a20('0x5f')],'role':_0x4a20('0x70')},'attributes':['id',_0x4a20('0x36'),_0x4a20('0x71'),_0x4a20('0x72'),_0x4a20('0x73')],'raw':!![]});}return null;})[_0x4a20('0x35')](function(_0x5a45eb){if(!_0x5a45eb)return null;_0x498fef[_0x4a20('0x27')][_0x4a20('0x70')]=_0x5a45eb;return _0x498fef;})[_0x4a20('0x35')](function(_0x97b7f0){if(_0x97b7f0){_0x97b7f0['message'][_0x4a20('0x75')]=util['format'](_0x4a20('0x76'),_0xf38844[_0x4a20('0x60')][_0x4a20('0x36')]);_0x97b7f0[_0x4a20('0x27')]['channel']=_0x498fef['channel'];_0x97b7f0[_0x4a20('0x27')]['motionChannel']=_0x498fef[_0x4a20('0x78')];_0x97b7f0[_0x4a20('0x27')][_0x4a20('0x81')]=_0x4a20('0x33');respondWithRpcPromise(_0x4a20('0x79'),'EventManager',{'event':_0x4a20('0x82'),'message':_0x97b7f0[_0x4a20('0x27')]},client9002);return _0x498fef;}return null;})[_0x4a20('0x35')](respondWithResult(_0x3b9723,null))[_0x4a20('0x29')](handleError(_0x3b9723,null));};exports['status']=function(_0x2f0322,_0x1bd6e6,_0xf8f5d1){if(_0x2f0322[_0x4a20('0x56')]['id']){delete _0x2f0322[_0x4a20('0x56')]['id'];}var _0x206874;return db[_0x4a20('0x4d')][_0x4a20('0x54')]({'where':{'id':_0x2f0322[_0x4a20('0x51')]['id']}})['then'](handleEntityNotFound(_0x1bd6e6,null))['then'](function(_0x23a71c){if(_0x23a71c){_0x206874=_0x23a71c;return db[_0x4a20('0x83')][_0x4a20('0x54')]({'where':{'id':_0x23a71c[_0x4a20('0x84')]}});}})[_0x4a20('0x35')](handleEntityNotFound(_0x1bd6e6,null))['then'](function(_0x476f10){if(_0x476f10){logger['debug'](_0x4a20('0x85'),'status',_0x4a20('0x86'),_0x476f10[_0x4a20('0x3c')],util[_0x4a20('0x87')](_0x2f0322[_0x4a20('0x56')],{'showHidden':![],'depth':null}));switch(_0x476f10['type']){case _0x4a20('0x88'):if(_0x2f0322[_0x4a20('0x56')]['MessageSid']&&_0x2f0322['body']['MessageSid']===_0x206874[_0x4a20('0x89')]&&_0x2f0322[_0x4a20('0x56')][_0x4a20('0x8a')]&&_0x2f0322[_0x4a20('0x56')][_0x4a20('0x8a')]===_0x4a20('0x5b')){return _0x206874[_0x4a20('0x34')]({'read':!![]});}else{logger[_0x4a20('0x26')](_0x4a20('0x8b'),_0x4a20('0x2a'),_0x4a20('0x88'),util[_0x4a20('0x87')](_0x2f0322['body'],{'showHidden':![],'depth':null}));}break;}return _0x206874;}})['then'](respondWithResult(_0x1bd6e6,null))['catch'](handleError(_0x1bd6e6,null));}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.events.js b/server/api/whatsappMessage/whatsappMessage.events.js index 47e4eac..39a0beb 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 _0x98e5=['setMaxListeners','save','remove','emit','hook','exports'];(function(_0x1d2058,_0x56ca50){var _0x29cf87=function(_0x5c3525){while(--_0x5c3525){_0x1d2058['push'](_0x1d2058['shift']());}};_0x29cf87(++_0x56ca50);}(_0x98e5,0x8a));var _0x598e=function(_0x1ef480,_0x3f78f8){_0x1ef480=_0x1ef480-0x0;var _0x36902f=_0x98e5[_0x1ef480];return _0x36902f;};'use strict';var EventEmitter=require('events');var WhatsappMessage=require('../../mysqldb')['db']['WhatsappMessage'];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x598e('0x0')](0x0);var events={'afterCreate':_0x598e('0x1'),'afterUpdate':'update','afterDestroy':_0x598e('0x2')};function emitEvent(_0xc090ec){return function(_0x5cc274,_0x3af01f,_0x5a876c){WhatsappMessageEvents['emit'](_0xc090ec+':'+_0x5cc274['id'],_0x5cc274);WhatsappMessageEvents[_0x598e('0x3')](_0xc090ec,_0x5cc274);_0x5a876c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappMessage[_0x598e('0x4')](e,emitEvent(event));}}module[_0x598e('0x5')]=WhatsappMessageEvents; \ No newline at end of file +var _0xbdb7=['save','update','remove','hasOwnProperty','hook','events','../../mysqldb','WhatsappMessage','setMaxListeners'];(function(_0x9f802f,_0x2edd9d){var _0x2e8e3f=function(_0x290aac){while(--_0x290aac){_0x9f802f['push'](_0x9f802f['shift']());}};_0x2e8e3f(++_0x2edd9d);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x8d823c,_0x4dfa8e){_0x8d823c=_0x8d823c-0x0;var _0x1399a6=_0xbdb7[_0x8d823c];return _0x1399a6;};'use strict';var EventEmitter=require(_0x7bdb('0x0'));var WhatsappMessage=require(_0x7bdb('0x1'))['db'][_0x7bdb('0x2')];var WhatsappMessageEvents=new EventEmitter();WhatsappMessageEvents[_0x7bdb('0x3')](0x0);var events={'afterCreate':_0x7bdb('0x4'),'afterUpdate':_0x7bdb('0x5'),'afterDestroy':_0x7bdb('0x6')};function emitEvent(_0x2c7e07){return function(_0x46c068,_0x47aec5,_0x28542c){WhatsappMessageEvents['emit'](_0x2c7e07+':'+_0x46c068['id'],_0x46c068);WhatsappMessageEvents['emit'](_0x2c7e07,_0x46c068);_0x28542c(null);};}for(var e in events){if(events[_0x7bdb('0x7')](e)){var event=events[e];WhatsappMessage[_0x7bdb('0x8')](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 264db42..bfca812 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 _0x6623=['/api/whatsapp/messages/','token','sid','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','finally','utf8mb4_unicode_ci','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./whatsappMessage.attributes','exports','define','WhatsappMessage','messageId','fti_whatsapp_messages','body','get','direction','toLowerCase','out','secret','isNil','UserId','WhatsappInteraction','findOne','WhatsappInteractionId','then','update','createdAt','catch','error','find','type','twilio','accountSid','authToken','phone','messages','create','whatsapp:','remote'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x6623,0x189));var _0x3662=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6623[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0x3662('0x0'));var logger=require(_0x3662('0x1'))(_0x3662('0x2'));var moment=require(_0x3662('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x3662('0x4'));var rimraf=require(_0x3662('0x5'));var config=require(_0x3662('0x6'));var attributes=require(_0x3662('0x7'));module[_0x3662('0x8')]=function(_0xb2999d,_0x597421){return _0xb2999d[_0x3662('0x9')](_0x3662('0xa'),attributes,{'tableName':'whatsapp_messages','paranoid':![],'indexes':[{'name':_0x3662('0xb'),'fields':[_0x3662('0xb')]},{'name':_0x3662('0xc'),'fields':[_0x3662('0xd')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1cc373,_0x173701,_0x2350cc){var _0x27c807=_0xb2999d['models'];var _0x269554=_0x1cc373[_0x3662('0xe')]({'plain':!![]});if(_0x269554[_0x3662('0xf')][_0x3662('0x10')]()==='in'||_0x269554[_0x3662('0xf')]['toLowerCase']()===_0x3662('0x11')&&!_0x269554[_0x3662('0x12')]&&!_[_0x3662('0x13')](_0x269554[_0x3662('0x14')])){_0x27c807[_0x3662('0x15')][_0x3662('0x16')]({'where':{'id':_0x269554[_0x3662('0x17')]}})[_0x3662('0x18')](function(_0x371002){if(_0x371002){_0x371002[_0x3662('0x19')]({'lastMsgAt':_0x269554[_0x3662('0x1a')],'lastMsgDirection':_0x269554['direction']['toLowerCase']()});}})[_0x3662('0x1b')](function(_0x550f90){console[_0x3662('0x1c')](_0x550f90);});}if(_0x269554[_0x3662('0xf')]===_0x3662('0x11')&&!_0x269554['secret']){var _0x315176;_0x27c807['WhatsappAccount'][_0x3662('0x1d')]({'where':{'id':_0x269554['WhatsappAccountId']},'raw':!![]})[_0x3662('0x18')](function(_0x235eb9){_0x315176=_0x235eb9;if(_0x315176&&_0x315176[_0x3662('0x1e')]){switch(_0x315176[_0x3662('0x1e')]){case _0x3662('0x1f'):var _0x30c936=require('twilio');if(_0x315176[_0x3662('0x20')]&&_0x315176[_0x3662('0x21')]&&_0x315176[_0x3662('0x22')]){var _0x4e9daf=new _0x30c936(_0x315176['accountSid'],_0x315176[_0x3662('0x21')]);_0x4e9daf[_0x3662('0x23')][_0x3662('0x24')]({'body':_0x269554[_0x3662('0xd')],'to':'whatsapp:'+_0x269554[_0x3662('0x22')],'from':_0x3662('0x25')+_0x315176[_0x3662('0x22')],'statusCallback':_0x315176[_0x3662('0x26')]+_0x3662('0x27')+_0x269554['id']+'/status?token='+_0x315176[_0x3662('0x28')]})['then'](function(_0x2786d8){if(_0x2786d8['sid']){return _0x1cc373[_0x3662('0x19')]({'messageId':_0x2786d8[_0x3662('0x29')]});}})[_0x3662('0x1b')](function(_0x470729){logger['error'](_0x3662('0x2a'),_0x3662('0x2b'),_0x3662('0x1f'),util[_0x3662('0x2c')](_0x470729,{'showHidden':![],'depth':null}));});}else{logger[_0x3662('0x1c')](_0x3662('0x2a'),_0x3662('0x2b'),_0x3662('0x1f'),_0x3662('0x2d'));}break;}}})[_0x3662('0x2e')](function(){_0x2350cc();});}else{_0x2350cc();}}},'charset':'utf8mb4','collate':_0x3662('0x2f')});}; \ No newline at end of file +var _0x6d1a=['whatsapp_messages','messageId','fti_whatsapp_messages','body','FULLTEXT','get','direction','toLowerCase','secret','isNil','UserId','WhatsappInteraction','findOne','then','update','error','out','WhatsappAccount','find','WhatsappAccountId','type','twilio','accountSid','authToken','messages','create','whatsapp:','phone','remote','/status?token=','token','sid','catch','inspect','WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','finally','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./whatsappMessage.attributes','exports','WhatsappMessage'];(function(_0xc3c84a,_0x131f05){var _0x6e3e14=function(_0x1fb3cb){while(--_0x1fb3cb){_0xc3c84a['push'](_0xc3c84a['shift']());}};_0x6e3e14(++_0x131f05);}(_0x6d1a,0x1c0));var _0xa6d1=function(_0x34e11f,_0x55c29b){_0x34e11f=_0x34e11f-0x0;var _0x1ab125=_0x6d1a[_0x34e11f];return _0x1ab125;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xa6d1('0x0'))(_0xa6d1('0x1'));var moment=require(_0xa6d1('0x2'));var BPromise=require(_0xa6d1('0x3'));var rp=require(_0xa6d1('0x4'));var fs=require('fs');var path=require(_0xa6d1('0x5'));var rimraf=require(_0xa6d1('0x6'));var config=require(_0xa6d1('0x7'));var attributes=require(_0xa6d1('0x8'));module[_0xa6d1('0x9')]=function(_0x5d6d9e,_0x5c5f20){return _0x5d6d9e['define'](_0xa6d1('0xa'),attributes,{'tableName':_0xa6d1('0xb'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0xa6d1('0xc')]},{'name':_0xa6d1('0xd'),'fields':[_0xa6d1('0xe')],'type':_0xa6d1('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x4005e4,_0x3a770d,_0x1080b9){var _0x5cdfe3=_0x5d6d9e['models'];var _0x53083c=_0x4005e4[_0xa6d1('0x10')]({'plain':!![]});if(_0x53083c[_0xa6d1('0x11')]['toLowerCase']()==='in'||_0x53083c[_0xa6d1('0x11')][_0xa6d1('0x12')]()==='out'&&!_0x53083c[_0xa6d1('0x13')]&&!_[_0xa6d1('0x14')](_0x53083c[_0xa6d1('0x15')])){_0x5cdfe3[_0xa6d1('0x16')][_0xa6d1('0x17')]({'where':{'id':_0x53083c['WhatsappInteractionId']}})[_0xa6d1('0x18')](function(_0x2a2c81){if(_0x2a2c81){_0x2a2c81[_0xa6d1('0x19')]({'lastMsgAt':_0x53083c['createdAt'],'lastMsgDirection':_0x53083c[_0xa6d1('0x11')][_0xa6d1('0x12')]()});}})['catch'](function(_0xcc34a2){console[_0xa6d1('0x1a')](_0xcc34a2);});}if(_0x53083c[_0xa6d1('0x11')]===_0xa6d1('0x1b')&&!_0x53083c[_0xa6d1('0x13')]){var _0x2eb7f6;_0x5cdfe3[_0xa6d1('0x1c')][_0xa6d1('0x1d')]({'where':{'id':_0x53083c[_0xa6d1('0x1e')]},'raw':!![]})[_0xa6d1('0x18')](function(_0x186ab5){_0x2eb7f6=_0x186ab5;if(_0x2eb7f6&&_0x2eb7f6[_0xa6d1('0x1f')]){switch(_0x2eb7f6[_0xa6d1('0x1f')]){case _0xa6d1('0x20'):var _0x29c5bf=require(_0xa6d1('0x20'));if(_0x2eb7f6[_0xa6d1('0x21')]&&_0x2eb7f6[_0xa6d1('0x22')]&&_0x2eb7f6['phone']){var _0x46ee15=new _0x29c5bf(_0x2eb7f6['accountSid'],_0x2eb7f6['authToken']);_0x46ee15[_0xa6d1('0x23')][_0xa6d1('0x24')]({'body':_0x53083c['body'],'to':_0xa6d1('0x25')+_0x53083c[_0xa6d1('0x26')],'from':_0xa6d1('0x25')+_0x2eb7f6['phone'],'statusCallback':_0x2eb7f6[_0xa6d1('0x27')]+'/api/whatsapp/messages/'+_0x53083c['id']+_0xa6d1('0x28')+_0x2eb7f6[_0xa6d1('0x29')]})[_0xa6d1('0x18')](function(_0xf67493){if(_0xf67493['sid']){return _0x4005e4[_0xa6d1('0x19')]({'messageId':_0xf67493[_0xa6d1('0x2a')]});}})[_0xa6d1('0x2b')](function(_0xe525b5){logger['error']('WhatsappMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xa6d1('0x20'),util[_0xa6d1('0x2c')](_0xe525b5,{'showHidden':![],'depth':null}));});}else{logger['error'](_0xa6d1('0x2d'),_0xa6d1('0x2e'),_0xa6d1('0x20'),_0xa6d1('0x2f'));}break;}}})[_0xa6d1('0x30')](function(){_0x1080b9();});}else{_0x1080b9();}}},'charset':_0xa6d1('0x31'),'collate':_0xa6d1('0x32')});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.rpc.js b/server/api/whatsappMessage/whatsappMessage.rpc.js index b6df3f0..0dec539 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 _0x21c6=['http','redis','localhost','socket.io-emitter','./whatsappMessage.socket','then','WhatsappMessage,\x20%s,\x20%s','request\x20sent','WhatsappMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','CreateWhatsappMessage','WhatsappMessage','create','options','raw','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client'];(function(_0x42245d,_0x51758f){var _0x4b211a=function(_0x2634e){while(--_0x2634e){_0x42245d['push'](_0x42245d['shift']());}};_0x4b211a(++_0x51758f);}(_0x21c6,0xf5));var _0x621c=function(_0x4a098c,_0x520905){_0x4a098c=_0x4a098c-0x0;var _0x51e318=_0x21c6[_0x4a098c];return _0x51e318;};'use strict';var _=require(_0x621c('0x0'));var util=require(_0x621c('0x1'));var moment=require(_0x621c('0x2'));var BPromise=require(_0x621c('0x3'));var rs=require(_0x621c('0x4'));var fs=require('fs');var Redis=require(_0x621c('0x5'));var db=require(_0x621c('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x621c('0x7'))(_0x621c('0x8'));var config=require('../../config/environment');var jayson=require(_0x621c('0x9'));var client=jayson[_0x621c('0xa')][_0x621c('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0x621c('0xc')],{'host':_0x621c('0xd'),'port':0x18eb});var socket=require(_0x621c('0xe'))(new Redis(config[_0x621c('0xc')]));require(_0x621c('0xf'))['register'](socket);function respondWithRpcPromise(_0x304159,_0x67db5c,_0x161d8a){return new BPromise(function(_0x134052,_0x2c81c5){return client['request'](_0x304159,_0x161d8a)[_0x621c('0x10')](function(_0x42256e){logger['info'](_0x621c('0x11'),_0x67db5c,_0x621c('0x12'));logger['debug'](_0x621c('0x13'),_0x67db5c,_0x621c('0x12'),JSON[_0x621c('0x14')](_0x42256e));if(_0x42256e[_0x621c('0x15')]){if(_0x42256e[_0x621c('0x15')]['code']===0x1f4){logger[_0x621c('0x15')]('WhatsappMessage,\x20%s,\x20%s',_0x67db5c,_0x42256e[_0x621c('0x15')][_0x621c('0x16')]);return _0x2c81c5(_0x42256e[_0x621c('0x15')]['message']);}logger[_0x621c('0x15')]('WhatsappMessage,\x20%s,\x20%s',_0x67db5c,_0x42256e[_0x621c('0x15')][_0x621c('0x16')]);return _0x134052(_0x42256e['error']['message']);}else{logger[_0x621c('0x17')](_0x621c('0x11'),_0x67db5c,_0x621c('0x12'));_0x134052(_0x42256e[_0x621c('0x18')][_0x621c('0x16')]);}})[_0x621c('0x19')](function(_0x5b28ef){logger['error'](_0x621c('0x11'),_0x67db5c,_0x5b28ef);_0x2c81c5(_0x5b28ef);});});}exports[_0x621c('0x1a')]=function(_0x3b43aa){var _0x2ad9cb=this;return new Promise(function(_0x42088d,_0x4366c9){return db[_0x621c('0x1b')][_0x621c('0x1c')](_0x3b43aa['body'],{'raw':_0x3b43aa[_0x621c('0x1d')]?_0x3b43aa[_0x621c('0x1d')][_0x621c('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0x865858){logger[_0x621c('0x17')]('CreateWhatsappMessage',_0x3b43aa);logger[_0x621c('0x1f')](_0x621c('0x1a'),_0x3b43aa,JSON[_0x621c('0x14')](_0x865858));_0x42088d(_0x865858);})[_0x621c('0x19')](function(_0x5dc142){logger[_0x621c('0x15')](_0x621c('0x1a'),_0x5dc142[_0x621c('0x16')],_0x3b43aa);_0x4366c9(_0x2ad9cb[_0x621c('0x15')](0x1f4,_0x5dc142[_0x621c('0x16')]));});});}; \ No newline at end of file +var _0x6eaf=['create','body','options','CreateWhatsappMessage','stringify','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./whatsappMessage.socket','register','request','then','info','WhatsappMessage,\x20%s,\x20%s','debug','request\x20sent','error','message','catch','WhatsappMessage'];(function(_0x1d70a6,_0x3e32a0){var _0xefb439=function(_0x5bcb9f){while(--_0x5bcb9f){_0x1d70a6['push'](_0x1d70a6['shift']());}};_0xefb439(++_0x3e32a0);}(_0x6eaf,0x113));var _0xf6ea=function(_0x4cd00b,_0x4260ab){_0x4cd00b=_0x4cd00b-0x0;var _0x53be4c=_0x6eaf[_0x4cd00b];return _0x53be4c;};'use strict';var _=require('lodash');var util=require(_0xf6ea('0x0'));var moment=require(_0xf6ea('0x1'));var BPromise=require('bluebird');var rs=require(_0xf6ea('0x2'));var fs=require('fs');var Redis=require(_0xf6ea('0x3'));var db=require(_0xf6ea('0x4'))['db'];var utils=require(_0xf6ea('0x5'));var logger=require('../../config/logger')(_0xf6ea('0x6'));var config=require(_0xf6ea('0x7'));var jayson=require(_0xf6ea('0x8'));var client=jayson[_0xf6ea('0x9')][_0xf6ea('0xa')]({'port':0x232a});config[_0xf6ea('0xb')]=_['defaults'](config[_0xf6ea('0xb')],{'host':_0xf6ea('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf6ea('0xb')]));require(_0xf6ea('0xd'))[_0xf6ea('0xe')](socket);function respondWithRpcPromise(_0x3b0d25,_0x470048,_0x25c48f){return new BPromise(function(_0x466818,_0x544dcc){return client[_0xf6ea('0xf')](_0x3b0d25,_0x25c48f)[_0xf6ea('0x10')](function(_0x1f0fe5){logger[_0xf6ea('0x11')](_0xf6ea('0x12'),_0x470048,'request\x20sent');logger[_0xf6ea('0x13')]('WhatsappMessage,\x20%s,\x20%s,\x20%s',_0x470048,_0xf6ea('0x14'),JSON['stringify'](_0x1f0fe5));if(_0x1f0fe5['error']){if(_0x1f0fe5[_0xf6ea('0x15')]['code']===0x1f4){logger[_0xf6ea('0x15')](_0xf6ea('0x12'),_0x470048,_0x1f0fe5[_0xf6ea('0x15')][_0xf6ea('0x16')]);return _0x544dcc(_0x1f0fe5[_0xf6ea('0x15')]['message']);}logger[_0xf6ea('0x15')](_0xf6ea('0x12'),_0x470048,_0x1f0fe5['error'][_0xf6ea('0x16')]);return _0x466818(_0x1f0fe5[_0xf6ea('0x15')][_0xf6ea('0x16')]);}else{logger[_0xf6ea('0x11')](_0xf6ea('0x12'),_0x470048,_0xf6ea('0x14'));_0x466818(_0x1f0fe5['result'][_0xf6ea('0x16')]);}})[_0xf6ea('0x17')](function(_0x20435f){logger[_0xf6ea('0x15')](_0xf6ea('0x12'),_0x470048,_0x20435f);_0x544dcc(_0x20435f);});});}exports['CreateWhatsappMessage']=function(_0x39d488){var _0x536993=this;return new Promise(function(_0xe43271,_0x12a28a){return db[_0xf6ea('0x18')][_0xf6ea('0x19')](_0x39d488[_0xf6ea('0x1a')],{'raw':_0x39d488[_0xf6ea('0x1b')]?_0x39d488[_0xf6ea('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0xf6ea('0x10')](function(_0x5df24a){logger['info'](_0xf6ea('0x1c'),_0x39d488);logger['debug'](_0xf6ea('0x1c'),_0x39d488,JSON[_0xf6ea('0x1d')](_0x5df24a));_0xe43271(_0x5df24a);})[_0xf6ea('0x17')](function(_0x34bff8){logger[_0xf6ea('0x15')](_0xf6ea('0x1c'),_0x34bff8[_0xf6ea('0x16')],_0x39d488);_0x12a28a(_0x536993[_0xf6ea('0x15')](0x1f4,_0x34bff8[_0xf6ea('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappMessage/whatsappMessage.socket.js b/server/api/whatsappMessage/whatsappMessage.socket.js index 67d3e54..19b8295 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 _0x34e5=['emit','register','length','whatsappMessage:','./whatsappMessage.events','save'];(function(_0x45783c,_0x49c56d){var _0x1161da=function(_0x3c5d41){while(--_0x3c5d41){_0x45783c['push'](_0x45783c['shift']());}};_0x1161da(++_0x49c56d);}(_0x34e5,0x11e));var _0x534e=function(_0x16837b,_0xe27933){_0x16837b=_0x16837b-0x0;var _0x2fed12=_0x34e5[_0x16837b];return _0x2fed12;};'use strict';var WhatsappMessageEvents=require(_0x534e('0x0'));var events=[_0x534e('0x1'),'remove','update'];function createListener(_0x39d691,_0x24d1d7){return function(_0x574c75){_0x24d1d7[_0x534e('0x2')](_0x39d691,_0x574c75);};}function removeListener(_0x509d21,_0x3cf17b){return function(){WhatsappMessageEvents['removeListener'](_0x509d21,_0x3cf17b);};}exports[_0x534e('0x3')]=function(_0x3b898e){for(var _0x82798b=0x0,_0x298168=events[_0x534e('0x4')];_0x82798b<_0x298168;_0x82798b++){var _0x325fae=events[_0x82798b];var _0x4b3144=createListener(_0x534e('0x5')+_0x325fae,_0x3b898e);WhatsappMessageEvents['on'](_0x325fae,_0x4b3144);}}; \ No newline at end of file +var _0x87cd=['length','whatsappMessage:','save','remove','update','emit','removeListener','register'];(function(_0x48e5b4,_0x58743c){var _0x22039d=function(_0x599fbb){while(--_0x599fbb){_0x48e5b4['push'](_0x48e5b4['shift']());}};_0x22039d(++_0x58743c);}(_0x87cd,0x1b2));var _0xd87c=function(_0x27af88,_0x2a3e87){_0x27af88=_0x27af88-0x0;var _0x1cd69f=_0x87cd[_0x27af88];return _0x1cd69f;};'use strict';var WhatsappMessageEvents=require('./whatsappMessage.events');var events=[_0xd87c('0x0'),_0xd87c('0x1'),_0xd87c('0x2')];function createListener(_0x26ad2d,_0x3a8130){return function(_0x4faab3){_0x3a8130[_0xd87c('0x3')](_0x26ad2d,_0x4faab3);};}function removeListener(_0x4b63f6,_0x53ab85){return function(){WhatsappMessageEvents[_0xd87c('0x4')](_0x4b63f6,_0x53ab85);};}exports[_0xd87c('0x5')]=function(_0x361c3f){for(var _0x36e9a6=0x0,_0x505a11=events[_0xd87c('0x6')];_0x36e9a6<_0x505a11;_0x36e9a6++){var _0xcda6a3=events[_0x36e9a6];var _0x17143e=createListener(_0xd87c('0x7')+_0xcda6a3,_0x361c3f);WhatsappMessageEvents['on'](_0xcda6a3,_0x17143e);}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/index.js b/server/api/whatsappQueue/index.js index 057f7eb..d159083 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 _0x793c=['put','delete','destroy','removeTeams','removeAgents','util','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getMembers','/:id/teams','getTeams','/:id/users','post'];(function(_0x4a11f3,_0x5e1a55){var _0x4cc2d0=function(_0x3034c3){while(--_0x3034c3){_0x4a11f3['push'](_0x4a11f3['shift']());}};_0x4cc2d0(++_0x5e1a55);}(_0x793c,0x8f));var _0xc793=function(_0x468b0f,_0x408566){_0x468b0f=_0x468b0f-0x0;var _0x3e74d9=_0x793c[_0x468b0f];return _0x3e74d9;};'use strict';var multer=require('multer');var util=require(_0xc793('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xc793('0x1'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xc793('0x2'));var interaction=require(_0xc793('0x3'));var config=require(_0xc793('0x4'));var controller=require(_0xc793('0x5'));router[_0xc793('0x6')]('/',auth[_0xc793('0x7')](),controller[_0xc793('0x8')]);router[_0xc793('0x6')](_0xc793('0x9'),auth[_0xc793('0x7')](),controller[_0xc793('0xa')]);router[_0xc793('0x6')](_0xc793('0xb'),auth[_0xc793('0x7')](),controller[_0xc793('0xc')]);router[_0xc793('0x6')]('/:id/members',auth['isAuthenticated'](),controller[_0xc793('0xd')]);router[_0xc793('0x6')](_0xc793('0xe'),auth[_0xc793('0x7')](),controller[_0xc793('0xf')]);router[_0xc793('0x6')](_0xc793('0x10'),auth[_0xc793('0x7')](),controller['getAgents']);router[_0xc793('0x11')]('/',auth[_0xc793('0x7')](),controller['create']);router[_0xc793('0x11')]('/:id/teams',auth[_0xc793('0x7')](),controller['addTeams']);router[_0xc793('0x11')](_0xc793('0x10'),auth[_0xc793('0x7')](),controller['addAgents']);router[_0xc793('0x12')](_0xc793('0xb'),auth[_0xc793('0x7')](),controller['update']);router[_0xc793('0x13')](_0xc793('0xb'),auth[_0xc793('0x7')](),controller[_0xc793('0x14')]);router[_0xc793('0x13')](_0xc793('0xe'),auth[_0xc793('0x7')](),controller[_0xc793('0x15')]);router[_0xc793('0x13')](_0xc793('0x10'),auth[_0xc793('0x7')](),controller[_0xc793('0x16')]);module['exports']=router; \ No newline at end of file +var _0x7aba=['delete','destroy','removeTeams','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./whatsappQueue.controller','get','isAuthenticated','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','post','addTeams','/:id/users','addAgents','put','update'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0x7aba,0x1e0));var _0xa7ab=function(_0x3a3cde,_0x1455c1){_0x3a3cde=_0x3a3cde-0x0;var _0x295d58=_0x7aba[_0x3a3cde];return _0x295d58;};'use strict';var multer=require(_0xa7ab('0x0'));var util=require(_0xa7ab('0x1'));var path=require(_0xa7ab('0x2'));var timeout=require('connect-timeout');var express=require(_0xa7ab('0x3'));var router=express[_0xa7ab('0x4')]();var fs_extra=require(_0xa7ab('0x5'));var auth=require(_0xa7ab('0x6'));var interaction=require(_0xa7ab('0x7'));var config=require('../../config/environment');var controller=require(_0xa7ab('0x8'));router[_0xa7ab('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xa7ab('0x9')]('/describe',auth[_0xa7ab('0xa')](),controller[_0xa7ab('0xb')]);router[_0xa7ab('0x9')](_0xa7ab('0xc'),auth[_0xa7ab('0xa')](),controller[_0xa7ab('0xd')]);router['get'](_0xa7ab('0xe'),auth['isAuthenticated'](),controller[_0xa7ab('0xf')]);router[_0xa7ab('0x9')](_0xa7ab('0x10'),auth[_0xa7ab('0xa')](),controller[_0xa7ab('0x11')]);router[_0xa7ab('0x9')]('/:id/users',auth[_0xa7ab('0xa')](),controller['getAgents']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xa7ab('0x12')](_0xa7ab('0x10'),auth[_0xa7ab('0xa')](),controller[_0xa7ab('0x13')]);router['post'](_0xa7ab('0x14'),auth[_0xa7ab('0xa')](),controller[_0xa7ab('0x15')]);router[_0xa7ab('0x16')](_0xa7ab('0xc'),auth['isAuthenticated'](),controller[_0xa7ab('0x17')]);router[_0xa7ab('0x18')](_0xa7ab('0xc'),auth[_0xa7ab('0xa')](),controller[_0xa7ab('0x19')]);router[_0xa7ab('0x18')]('/:id/teams',auth[_0xa7ab('0xa')](),controller[_0xa7ab('0x1a')]);router[_0xa7ab('0x18')](_0xa7ab('0x14'),auth['isAuthenticated'](),controller['removeAgents']);module[_0xa7ab('0x1b')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.attributes.js b/server/api/whatsappQueue/whatsappQueue.attributes.js index c4b58a8..d3a1bcf 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 _0xad53=['rrmemory','beepall','sequelize','exports','STRING','name','INTEGER','ENUM'];(function(_0x340258,_0x5d1e45){var _0x43a183=function(_0x3d88d0){while(--_0x3d88d0){_0x340258['push'](_0x340258['shift']());}};_0x43a183(++_0x5d1e45);}(_0xad53,0x1ea));var _0x3ad5=function(_0x55935b,_0xcaf7ba){_0x55935b=_0x55935b-0x0;var _0x18b1b6=_0xad53[_0x55935b];return _0x18b1b6;};'use strict';var Sequelize=require(_0x3ad5('0x0'));module[_0x3ad5('0x1')]={'name':{'type':Sequelize[_0x3ad5('0x2')],'unique':_0x3ad5('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0x3ad5('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x3ad5('0x5')](_0x3ad5('0x6'),_0x3ad5('0x7'),'roundrobin')},'description':{'type':Sequelize[_0x3ad5('0x2')]}}; \ No newline at end of file +var _0xfc4c=['STRING','INTEGER','ENUM','rrmemory','sequelize','exports'];(function(_0x421ff6,_0x40f195){var _0x177051=function(_0x254bdf){while(--_0x254bdf){_0x421ff6['push'](_0x421ff6['shift']());}};_0x177051(++_0x40f195);}(_0xfc4c,0xca));var _0xcfc4=function(_0x34078f,_0x1c37ba){_0x34078f=_0x34078f-0x0;var _0x448ceb=_0xfc4c[_0x34078f];return _0x448ceb;};'use strict';var Sequelize=require(_0xcfc4('0x0'));module[_0xcfc4('0x1')]={'name':{'type':Sequelize[_0xcfc4('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'timeout':{'type':Sequelize[_0xcfc4('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xcfc4('0x4')](_0xcfc4('0x5'),'beepall','roundrobin')},'description':{'type':Sequelize[_0xcfc4('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.controller.js b/server/api/whatsappQueue/whatsappQueue.controller.js index 67c2158..9e4cd63 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 _0x935a=['getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./whatsappQueue.socket','register','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','destroy','get','UserProfileResource','end','error','stack','name','send','index','map','WhatsappQueue','rawAttributes','fieldName','model','query','keys','filters','attributes','fields','length','nolimit','sort','where','pick','merge','type','options','includeAll','findAll','catch','show','params','intersection','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','WhatsappQueues','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','hasOwnProperty','order','WhatsappQueueId','filter','UserWhatsappQueue','User','findAndCountAll','agent','updatedAt','createdAt','rows','format','SIP','getTeams','Team','addTeams','ids','online','interface','flatMap','Agents','sequelize','transaction','each','forEach','emit','userWhatsappQueue:save','removeTeams','field','tq.TeamId','from','team_has_whatsapp_queues','join','WhatsappQueueId\x20=\x20?','clone','push','SELECT','every','TeamId','includes','all','union','compact','isEmpty','removeAgents','userWhatsappQueue:remove','addAgents','spread','isArray'];(function(_0x5f14ea,_0x375bfd){var _0x33887c=function(_0x263ec2){while(--_0x263ec2){_0x5f14ea['push'](_0x5f14ea['shift']());}};_0x33887c(++_0x375bfd);}(_0x935a,0x8c));var _0xa935=function(_0x24061a,_0x1c9f4d){_0x24061a=_0x24061a-0x0;var _0x82054e=_0x935a[_0x24061a];return _0x82054e;};'use strict';var emlformat=require(_0xa935('0x0'));var rimraf=require(_0xa935('0x1'));var zipdir=require(_0xa935('0x2'));var jsonpatch=require(_0xa935('0x3'));var rp=require(_0xa935('0x4'));var moment=require(_0xa935('0x5'));var BPromise=require(_0xa935('0x6'));var Mustache=require(_0xa935('0x7'));var util=require(_0xa935('0x8'));var path=require(_0xa935('0x9'));var sox=require('sox');var csv=require(_0xa935('0xa'));var ejs=require(_0xa935('0xb'));var fs=require('fs');var fs_extra=require(_0xa935('0xc'));var _=require('lodash');var squel=require(_0xa935('0xd'));var crypto=require(_0xa935('0xe'));var jsforce=require(_0xa935('0xf'));var deskjs=require(_0xa935('0x10'));var toCsv=require(_0xa935('0xa'));var querystring=require(_0xa935('0x11'));var Papa=require('papaparse');var Redis=require(_0xa935('0x12'));var authService=require(_0xa935('0x13'));var qs=require(_0xa935('0x14'));var as=require(_0xa935('0x15'));var hardwareService=require(_0xa935('0x16'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xa935('0x17'));var licenseUtil=require(_0xa935('0x18'));var db=require(_0xa935('0x19'))['db'];config['redis']=_['defaults'](config[_0xa935('0x1a')],{'host':_0xa935('0x1b'),'port':0x18eb});var socket=require(_0xa935('0x1c'))(new Redis(config['redis']));require(_0xa935('0x1d'))[_0xa935('0x1e')](socket);function respondWithStatusCode(_0x388061,_0x522938){_0x522938=_0x522938||0xcc;return function(_0x2d5950){if(_0x2d5950){return _0x388061[_0xa935('0x1f')](_0x522938);}return _0x388061[_0xa935('0x20')](_0x522938)['end']();};}function respondWithResult(_0x5a5ec0,_0x108211){_0x108211=_0x108211||0xc8;return function(_0x4d5910){if(_0x4d5910){return _0x5a5ec0[_0xa935('0x20')](_0x108211)[_0xa935('0x21')](_0x4d5910);}};}function respondWithFilteredResult(_0x42d520,_0x2b321e){return function(_0x5e70ad){if(_0x5e70ad){var _0x197093=typeof _0x2b321e[_0xa935('0x22')]===_0xa935('0x23')&&typeof _0x2b321e[_0xa935('0x24')]===_0xa935('0x23');var _0x4f351b=_0x5e70ad[_0xa935('0x25')];var _0x3b867a=_0x197093?0x0:_0x2b321e[_0xa935('0x22')];var _0x198e49=_0x197093?_0x5e70ad[_0xa935('0x25')]:_0x2b321e[_0xa935('0x22')]+_0x2b321e[_0xa935('0x24')];var _0x36fa40;if(_0x198e49>=_0x4f351b){_0x198e49=_0x4f351b;_0x36fa40=0xc8;}else{_0x36fa40=0xce;}_0x42d520[_0xa935('0x20')](_0x36fa40);return _0x42d520['set'](_0xa935('0x26'),_0x3b867a+'-'+_0x198e49+'/'+_0x4f351b)[_0xa935('0x21')](_0x5e70ad);}return null;};}function patchUpdates(_0x499347){return function(_0x589762){try{jsonpatch[_0xa935('0x27')](_0x589762,_0x499347,!![]);}catch(_0x57fbb4){return BPromise['reject'](_0x57fbb4);}return _0x589762[_0xa935('0x28')]();};}function saveUpdates(_0x431686,_0x3c6c9b){return function(_0x3ac65c){if(_0x3ac65c){return _0x3ac65c[_0xa935('0x29')](_0x431686)[_0xa935('0x2a')](function(_0x5c282d){return _0x5c282d;});}return null;};}function removeEntity(_0x37626b,_0xde272c){return function(_0xb0a913){if(_0xb0a913){return _0xb0a913[_0xa935('0x2b')]()[_0xa935('0x2a')](function(){var _0x2ab6fc=_0xb0a913[_0xa935('0x2c')]({'plain':!![]});var _0xef81a3='WhatsappQueues';return db[_0xa935('0x2d')]['destroy']({'where':{'type':_0xef81a3,'resourceId':_0x2ab6fc['id']}})['then'](function(){return _0xb0a913;});})['then'](function(){_0x37626b[_0xa935('0x20')](0xcc)[_0xa935('0x2e')]();});}};}function handleEntityNotFound(_0x5179b4,_0x469bd9){return function(_0x1c4462){if(!_0x1c4462){_0x5179b4[_0xa935('0x1f')](0x194);}return _0x1c4462;};}function handleError(_0x48d46b,_0x1daedc){_0x1daedc=_0x1daedc||0x1f4;return function(_0x1637cf){logger[_0xa935('0x2f')](_0x1637cf[_0xa935('0x30')]);if(_0x1637cf[_0xa935('0x31')]){delete _0x1637cf[_0xa935('0x31')];}_0x48d46b['status'](_0x1daedc)[_0xa935('0x32')](_0x1637cf);};}exports[_0xa935('0x33')]=function(_0x96d01,_0x2c4116){var _0x48a52b={},_0x2e6627={},_0x4866cf={'count':0x0,'rows':[]};var _0x5befb2=_[_0xa935('0x34')](db[_0xa935('0x35')][_0xa935('0x36')],function(_0x5b964d){return{'name':_0x5b964d[_0xa935('0x37')],'type':_0x5b964d['type']['key']};});_0x2e6627[_0xa935('0x38')]=_[_0xa935('0x34')](_0x5befb2,_0xa935('0x31'));_0x2e6627[_0xa935('0x39')]=_[_0xa935('0x3a')](_0x96d01['query']);_0x2e6627[_0xa935('0x3b')]=_['intersection'](_0x2e6627[_0xa935('0x38')],_0x2e6627[_0xa935('0x39')]);_0x48a52b[_0xa935('0x3c')]=_['intersection'](_0x2e6627[_0xa935('0x38')],qs[_0xa935('0x3d')](_0x96d01[_0xa935('0x39')]['fields']));_0x48a52b['attributes']=_0x48a52b['attributes'][_0xa935('0x3e')]?_0x48a52b[_0xa935('0x3c')]:_0x2e6627[_0xa935('0x38')];if(!_0x96d01['query']['hasOwnProperty'](_0xa935('0x3f'))){_0x48a52b[_0xa935('0x24')]=qs[_0xa935('0x24')](_0x96d01['query'][_0xa935('0x24')]);_0x48a52b['offset']=qs[_0xa935('0x22')](_0x96d01[_0xa935('0x39')][_0xa935('0x22')]);}_0x48a52b['order']=qs['sort'](_0x96d01[_0xa935('0x39')][_0xa935('0x40')]);_0x48a52b[_0xa935('0x41')]=qs[_0xa935('0x3b')](_[_0xa935('0x42')](_0x96d01[_0xa935('0x39')],_0x2e6627['filters']),_0x5befb2);if(_0x96d01[_0xa935('0x39')]['filter']){_0x48a52b[_0xa935('0x41')]=_[_0xa935('0x43')](_0x48a52b[_0xa935('0x41')],{'$or':_['map'](_0x5befb2,function(_0x2a8767){if(_0x2a8767[_0xa935('0x44')]!=='VIRTUAL'){var _0x3b6a5e={};_0x3b6a5e[_0x2a8767[_0xa935('0x31')]]={'$like':'%'+_0x96d01['query']['filter']+'%'};return _0x3b6a5e;}})});}_0x48a52b=_[_0xa935('0x43')]({},_0x48a52b,_0x96d01[_0xa935('0x45')]);var _0x16400e={'where':_0x48a52b['where']};return db[_0xa935('0x35')][_0xa935('0x25')](_0x16400e)[_0xa935('0x2a')](function(_0x3f9f9b){_0x4866cf[_0xa935('0x25')]=_0x3f9f9b;if(_0x96d01['query'][_0xa935('0x46')]){_0x48a52b['include']=[{'all':!![]}];}return db[_0xa935('0x35')][_0xa935('0x47')](_0x48a52b);})[_0xa935('0x2a')](function(_0x154e8d){_0x4866cf['rows']=_0x154e8d;return _0x4866cf;})[_0xa935('0x2a')](respondWithFilteredResult(_0x2c4116,_0x48a52b))[_0xa935('0x48')](handleError(_0x2c4116,null));};exports[_0xa935('0x49')]=function(_0xcf6d40,_0x52e7e2){var _0x3ae4e7={'raw':!![],'where':{'id':_0xcf6d40[_0xa935('0x4a')]['id']}},_0x2b6727={};_0x2b6727[_0xa935('0x38')]=_[_0xa935('0x3a')](db[_0xa935('0x35')]['rawAttributes']);_0x2b6727[_0xa935('0x39')]=_[_0xa935('0x3a')](_0xcf6d40[_0xa935('0x39')]);_0x2b6727[_0xa935('0x3b')]=_['intersection'](_0x2b6727[_0xa935('0x38')],_0x2b6727[_0xa935('0x39')]);_0x3ae4e7[_0xa935('0x3c')]=_[_0xa935('0x4b')](_0x2b6727[_0xa935('0x38')],qs[_0xa935('0x3d')](_0xcf6d40[_0xa935('0x39')][_0xa935('0x3d')]));_0x3ae4e7[_0xa935('0x3c')]=_0x3ae4e7[_0xa935('0x3c')][_0xa935('0x3e')]?_0x3ae4e7[_0xa935('0x3c')]:_0x2b6727[_0xa935('0x38')];if(_0xcf6d40[_0xa935('0x39')]['includeAll']){_0x3ae4e7[_0xa935('0x4c')]=[{'all':!![]}];}_0x3ae4e7=_[_0xa935('0x43')]({},_0x3ae4e7,_0xcf6d40[_0xa935('0x45')]);return db[_0xa935('0x35')][_0xa935('0x4d')](_0x3ae4e7)[_0xa935('0x2a')](handleEntityNotFound(_0x52e7e2,null))[_0xa935('0x2a')](respondWithResult(_0x52e7e2,null))[_0xa935('0x48')](handleError(_0x52e7e2,null));};exports[_0xa935('0x4e')]=function(_0x1b4b05,_0x53e48d){return db[_0xa935('0x35')][_0xa935('0x4e')](_0x1b4b05[_0xa935('0x4f')],{})[_0xa935('0x2a')](function(_0x23cb24){var _0x16d3bb=_0x1b4b05[_0xa935('0x50')][_0xa935('0x2c')]({'plain':!![]});if(!_0x16d3bb)throw new Error(_0xa935('0x51'));if(_0x16d3bb['role']===_0xa935('0x50')){var _0x5210d3=_0x23cb24[_0xa935('0x2c')]({'plain':!![]});var _0x2beea3=_0xa935('0x52');return db['UserProfileSection'][_0xa935('0x4d')]({'where':{'name':_0x2beea3,'userProfileId':_0x16d3bb[_0xa935('0x53')]},'raw':!![]})['then'](function(_0x4f1693){if(_0x4f1693&&_0x4f1693[_0xa935('0x54')]===0x0){return db[_0xa935('0x2d')][_0xa935('0x4e')]({'name':_0x5210d3[_0xa935('0x31')],'resourceId':_0x5210d3['id'],'type':_0x4f1693[_0xa935('0x31')],'sectionId':_0x4f1693['id']},{})[_0xa935('0x2a')](function(){return _0x23cb24;});}else{return _0x23cb24;}})[_0xa935('0x48')](function(_0x4402ce){logger[_0xa935('0x2f')](_0xa935('0x55'),_0x4402ce);throw _0x4402ce;});}return _0x23cb24;})[_0xa935('0x2a')](respondWithResult(_0x53e48d,0xc9))['catch'](handleError(_0x53e48d,null));};exports['update']=function(_0x4a25f4,_0x165797){if(_0x4a25f4[_0xa935('0x4f')]['id']){delete _0x4a25f4[_0xa935('0x4f')]['id'];}return db[_0xa935('0x35')][_0xa935('0x4d')]({'where':{'id':_0x4a25f4['params']['id']}})[_0xa935('0x2a')](handleEntityNotFound(_0x165797,null))[_0xa935('0x2a')](saveUpdates(_0x4a25f4['body'],null))['then'](respondWithResult(_0x165797,null))[_0xa935('0x48')](handleError(_0x165797,null));};exports[_0xa935('0x2b')]=function(_0x539f10,_0x226e60){return db[_0xa935('0x35')][_0xa935('0x4d')]({'where':{'id':_0x539f10[_0xa935('0x4a')]['id']}})[_0xa935('0x2a')](handleEntityNotFound(_0x226e60,null))['then'](removeEntity(_0x226e60,null))[_0xa935('0x48')](handleError(_0x226e60,null));};exports[_0xa935('0x56')]=function(_0x2cb553,_0x1abe9d){return db[_0xa935('0x35')][_0xa935('0x56')]()[_0xa935('0x2a')](respondWithResult(_0x1abe9d,null))[_0xa935('0x48')](handleError(_0x1abe9d,null));};exports[_0xa935('0x57')]=function(_0x23e2c1,_0x35c909,_0x12e9f8){var _0x229225={'raw':!![],'where':{}},_0x5dabdd={},_0x55cf12;return db[_0xa935('0x35')][_0xa935('0x58')]({'where':{'id':_0x23e2c1[_0xa935('0x4a')]['id']}})[_0xa935('0x2a')](handleEntityNotFound(_0x35c909,null))[_0xa935('0x2a')](function(_0x448b82){if(_0x448b82){_0x55cf12=_0x448b82[_0xa935('0x2c')]({'plain':!![]});_0x5dabdd[_0xa935('0x38')]=_[_0xa935('0x3a')](db['UserWhatsappQueue'][_0xa935('0x36')]);_0x5dabdd[_0xa935('0x39')]=_[_0xa935('0x3a')](_0x23e2c1[_0xa935('0x39')]);_0x5dabdd[_0xa935('0x3b')]=_[_0xa935('0x4b')](_0x5dabdd[_0xa935('0x38')],_0x5dabdd[_0xa935('0x39')]);_0x229225['attributes']=_['intersection'](_0x5dabdd[_0xa935('0x38')],qs[_0xa935('0x3d')](_0x23e2c1[_0xa935('0x39')]['fields']));_0x229225['attributes']=_0x229225['attributes'][_0xa935('0x3e')]?_0x229225[_0xa935('0x3c')]:_0x5dabdd['model'];if(!_0x23e2c1[_0xa935('0x39')][_0xa935('0x59')](_0xa935('0x3f'))){_0x229225[_0xa935('0x24')]=qs[_0xa935('0x24')](_0x23e2c1[_0xa935('0x39')][_0xa935('0x24')]);_0x229225[_0xa935('0x22')]=qs[_0xa935('0x22')](_0x23e2c1[_0xa935('0x39')][_0xa935('0x22')]);}_0x229225[_0xa935('0x5a')]=qs[_0xa935('0x40')](_0x23e2c1[_0xa935('0x39')][_0xa935('0x40')]);_0x229225[_0xa935('0x41')]=qs['filters'](_[_0xa935('0x42')](_0x23e2c1[_0xa935('0x39')],_0x5dabdd['filters']));_0x229225[_0xa935('0x41')][_0xa935('0x5b')]=_0x448b82['id'];if(_0x23e2c1['query'][_0xa935('0x5c')]){_0x229225[_0xa935('0x41')]=_[_0xa935('0x43')](_0x229225['where'],{'$or':_[_0xa935('0x34')](_0x229225[_0xa935('0x3c')],function(_0x332642){var _0x1bafba={};_0x1bafba[_0x332642]={'$like':'%'+_0x23e2c1['query'][_0xa935('0x5c')]+'%'};return _0x1bafba;})});}_0x229225=_[_0xa935('0x43')]({},_0x229225,_0x23e2c1[_0xa935('0x45')]);return db[_0xa935('0x5d')][_0xa935('0x47')](_0x229225);}})[_0xa935('0x2a')](function(_0x3792ab){if(_0x3792ab){return db[_0xa935('0x5e')][_0xa935('0x5f')]({'where':{'id':_[_0xa935('0x34')](_0x3792ab,'UserId'),'role':_0xa935('0x60')},'attributes':['id','name','whatsappPause',_0xa935('0x61'),_0xa935('0x62')]});}})[_0xa935('0x2a')](function(_0x5c96fe){if(_0x5c96fe){return{'count':_0x5c96fe['count'],'rows':_['map'](_0x5c96fe[_0xa935('0x63')],function(_0x35ee25){return{'membername':_0x35ee25['name'],'UserId':_0x35ee25['id'],'queue_name':_0x55cf12[_0xa935('0x31')],'WhatsappQueueId':_0x55cf12['id'],'interface':util[_0xa935('0x64')]('%s/%s',_0xa935('0x65'),_0x35ee25[_0xa935('0x31')]),'penalty':0x0,'paused':_0x35ee25['whatsappPause'],'createdAt':_0x35ee25[_0xa935('0x62')],'updatedAt':_0x35ee25[_0xa935('0x61')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x35c909,_0x229225))[_0xa935('0x48')](handleError(_0x35c909,null));};exports[_0xa935('0x66')]=function(_0xa65659,_0x6f9be3,_0x1ce753){var _0x593a32={};var _0x1ba665={};var _0x3e33ef;var _0x1e827c;return db[_0xa935('0x35')][_0xa935('0x58')]({'where':{'id':_0xa65659[_0xa935('0x4a')]['id']}})['then'](handleEntityNotFound(_0x6f9be3,null))[_0xa935('0x2a')](function(_0x22b24a){if(_0x22b24a){_0x3e33ef=_0x22b24a;_0x1ba665[_0xa935('0x38')]=_[_0xa935('0x3a')](db[_0xa935('0x67')]['rawAttributes']);_0x1ba665[_0xa935('0x39')]=_[_0xa935('0x3a')](_0xa65659[_0xa935('0x39')]);_0x1ba665['filters']=_[_0xa935('0x4b')](_0x1ba665['model'],_0x1ba665[_0xa935('0x39')]);_0x593a32[_0xa935('0x3c')]=_[_0xa935('0x4b')](_0x1ba665[_0xa935('0x38')],qs[_0xa935('0x3d')](_0xa65659[_0xa935('0x39')][_0xa935('0x3d')]));_0x593a32[_0xa935('0x3c')]=_0x593a32[_0xa935('0x3c')][_0xa935('0x3e')]?_0x593a32['attributes']:_0x1ba665[_0xa935('0x38')];_0x593a32[_0xa935('0x5a')]=qs['sort'](_0xa65659['query'][_0xa935('0x40')]);_0x593a32[_0xa935('0x41')]=qs[_0xa935('0x3b')](_[_0xa935('0x42')](_0xa65659[_0xa935('0x39')],_0x1ba665[_0xa935('0x3b')]));if(_0xa65659[_0xa935('0x39')][_0xa935('0x5c')]){_0x593a32[_0xa935('0x41')]=_['merge'](_0x593a32[_0xa935('0x41')],{'$or':_['map'](_0x593a32[_0xa935('0x3c')],function(_0x3898a4){var _0x2d07ea={};_0x2d07ea[_0x3898a4]={'$like':'%'+_0xa65659[_0xa935('0x39')][_0xa935('0x5c')]+'%'};return _0x2d07ea;})});}_0x593a32=_[_0xa935('0x43')]({},_0x593a32,_0xa65659['options']);return _0x3e33ef['getTeams'](_0x593a32);}})[_0xa935('0x2a')](function(_0x298e55){if(_0x298e55){_0x1e827c=_0x298e55['length'];if(!_0xa65659[_0xa935('0x39')]['hasOwnProperty'](_0xa935('0x3f'))){_0x593a32[_0xa935('0x24')]=qs['limit'](_0xa65659[_0xa935('0x39')][_0xa935('0x24')]);_0x593a32['offset']=qs['offset'](_0xa65659['query'][_0xa935('0x22')]);}return _0x3e33ef[_0xa935('0x66')](_0x593a32);}})[_0xa935('0x2a')](function(_0x561b77){if(_0x561b77){return _0x561b77?{'count':_0x1e827c,'rows':_0x561b77}:null;}})[_0xa935('0x2a')](respondWithResult(_0x6f9be3,null))[_0xa935('0x48')](handleError(_0x6f9be3,null));};exports[_0xa935('0x68')]=function(_0x1ab8db,_0x184d5c,_0x5e02c1){var _0x45747f=_0x1ab8db[_0xa935('0x4f')][_0xa935('0x69')];return db[_0xa935('0x67')][_0xa935('0x47')]({'where':{'id':_0x45747f},'attributes':['id'],'include':[{'model':db[_0xa935('0x5e')],'as':'Agents','attributes':['id','name',_0xa935('0x6a'),'voicePause',_0xa935('0x6b')],'raw':!![]}]})['then'](function(_0x25f062){if(_0x25f062){var _0x57dc7b=_[_0xa935('0x6c')](_0x25f062,function(_0xe7edd7){var _0x309100=_0xe7edd7[_0xa935('0x2c')]({'plain':!![]});return _0x309100[_0xa935('0x6d')];});return db[_0xa935('0x35')][_0xa935('0x4d')]({'where':{'id':_0x1ab8db[_0xa935('0x4a')]['id']}})[_0xa935('0x2a')](function(_0x23ecff){return db[_0xa935('0x6e')][_0xa935('0x6f')](function(_0x54fda8){return _0x23ecff[_0xa935('0x68')](_0x45747f,{'transaction':_0x54fda8})['then'](function(){return BPromise[_0xa935('0x70')](_0x57dc7b,function(_0x540fa5){return db['UserWhatsappQueue']['findOrCreate']({'where':{'UserId':_0x540fa5['id'],'WhatsappQueueId':_0x1ab8db['params']['id']},'transaction':_0x54fda8});});})[_0xa935('0x2a')](function(){_0x57dc7b[_0xa935('0x71')](function(_0xb27174){socket[_0xa935('0x72')](_0xa935('0x73'),{'UserId':_0xb27174['id'],'WhatsappQueueId':_0x23ecff['id']});});});});});}})[_0xa935('0x2a')](respondWithStatusCode(_0x184d5c,null))[_0xa935('0x48')](handleError(_0x184d5c,null));};exports[_0xa935('0x74')]=function(_0x4bdf44,_0x167e54,_0x3714db){return db[_0xa935('0x67')][_0xa935('0x47')]({'where':{'id':_0x4bdf44[_0xa935('0x39')][_0xa935('0x69')]},'attributes':['id'],'include':[{'model':db[_0xa935('0x5e')],'as':_0xa935('0x6d'),'attributes':['id'],'raw':!![]}]})[_0xa935('0x2a')](handleEntityNotFound(_0x167e54,null))[_0xa935('0x2a')](function(_0x4f1522){var _0x14e154=_['map'](_0x4f1522,'id');var _0x2811cd=[];var _0x323fd=[];var _0x4bafe0=squel['select']();_0x4bafe0[_0xa935('0x75')](_0xa935('0x76'))[_0xa935('0x77')](_0xa935('0x78'),'tq')[_0xa935('0x79')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0xa935('0x41')](_0xa935('0x7a'),_0x4bdf44[_0xa935('0x4a')]['id']);for(var _0x4c3315=0x0;_0x4c3315<_0x4f1522['length'];_0x4c3315+=0x1){let _0x4b9463=_0x4f1522[_0x4c3315];for(var _0x11dbca=0x0;_0x11dbca<_0x4b9463[_0xa935('0x6d')][_0xa935('0x3e')];_0x11dbca+=0x1){let _0x225f1c=_0x4b9463[_0xa935('0x6d')][_0x11dbca];var _0x3ce10e=_0x4bafe0[_0xa935('0x7b')]();_0x3ce10e[_0xa935('0x41')]('ut.UserId\x20=\x20?',_0x225f1c['id']);_0x323fd[_0xa935('0x7c')](db[_0xa935('0x6e')][_0xa935('0x39')](_0x3ce10e['toString'](),{'type':db[_0xa935('0x6e')]['QueryTypes'][_0xa935('0x7d')]})['then'](function(_0xb68234){if(_0xb68234['length']===0x1){return _0x225f1c['id'];}else{var _0x352348=_[_0xa935('0x7e')](_[_0xa935('0x34')](_0xb68234,_0xa935('0x7f')),function(_0x13593b){return _[_0xa935('0x80')](_0x14e154,_0x13593b);});if(_0x352348){return _0x225f1c['id'];}}}));}}return BPromise[_0xa935('0x81')](_0x323fd)[_0xa935('0x2a')](function(_0x1562db){_0x2811cd=_(_0x2811cd)[_0xa935('0x82')](_0x1562db)[_0xa935('0x83')]()['value']();return db['WhatsappQueue'][_0xa935('0x4d')]({'where':{'id':_0x4bdf44[_0xa935('0x4a')]['id']}})['then'](function(_0x43239e){return db[_0xa935('0x6e')][_0xa935('0x6f')](function(_0x34f078){return _0x43239e['removeTeams'](_0x4bdf44[_0xa935('0x39')]['ids'],{'transaction':_0x34f078})[_0xa935('0x2a')](function(){if(!_[_0xa935('0x84')](_0x2811cd)){return _0x43239e[_0xa935('0x85')](_0x2811cd,{'transaction':_0x34f078});}})[_0xa935('0x2a')](function(){_0x2811cd['forEach'](function(_0xeede4e){socket[_0xa935('0x72')](_0xa935('0x86'),{'UserId':_0xeede4e,'WhatsappQueueId':_0x43239e['id']});});});});});});})['then'](respondWithStatusCode(_0x167e54,null))['catch'](handleError(_0x167e54,null));};exports[_0xa935('0x87')]=function(_0x5071a0,_0xb03259,_0x57760b){return db[_0xa935('0x35')][_0xa935('0x4d')]({'where':{'id':_0x5071a0[_0xa935('0x4a')]['id']}})[_0xa935('0x2a')](handleEntityNotFound(_0xb03259,null))[_0xa935('0x2a')](function(_0x303319){if(_0x303319){return _0x303319[_0xa935('0x87')](_0x5071a0[_0xa935('0x4f')]['ids'],_['omit'](_0x5071a0[_0xa935('0x4f')],[_0xa935('0x69'),'id'])||{})[_0xa935('0x88')](function(_0x2eaabf){for(var _0x52ec89=0x0;_0x52ec89<_0x5071a0[_0xa935('0x4f')][_0xa935('0x69')]['length'];_0x52ec89+=0x1){socket[_0xa935('0x72')](_0xa935('0x73'),{'UserId':Number(_0x5071a0[_0xa935('0x4f')][_0xa935('0x69')][_0x52ec89]),'WhatsappQueueId':Number(_0x5071a0[_0xa935('0x4a')]['id'])});}return _0x2eaabf;});}})[_0xa935('0x2a')](respondWithResult(_0xb03259,null))[_0xa935('0x48')](handleError(_0xb03259,null));};exports[_0xa935('0x85')]=function(_0x16e92a,_0x465baf,_0x3dd47f){return db['WhatsappQueue'][_0xa935('0x4d')]({'where':{'id':_0x16e92a['params']['id']}})[_0xa935('0x2a')](handleEntityNotFound(_0x465baf,null))[_0xa935('0x2a')](function(_0xef7afe){if(_0xef7afe){return _0xef7afe['removeAgents'](_0x16e92a['query'][_0xa935('0x69')])[_0xa935('0x2a')](function(){if(_[_0xa935('0x89')](_0x16e92a[_0xa935('0x39')][_0xa935('0x69')])){for(var _0x270f7d=0x0;_0x270f7d<_0x16e92a[_0xa935('0x39')][_0xa935('0x69')][_0xa935('0x3e')];_0x270f7d+=0x1){socket[_0xa935('0x72')](_0xa935('0x86'),{'UserId':Number(_0x16e92a['query'][_0xa935('0x69')][_0x270f7d]),'WhatsappQueueId':Number(_0x16e92a[_0xa935('0x4a')]['id'])});}}else{socket[_0xa935('0x72')](_0xa935('0x86'),{'UserId':Number(_0x16e92a[_0xa935('0x39')]['ids']),'WhatsappQueueId':Number(_0x16e92a[_0xa935('0x4a')]['id'])});}});}})[_0xa935('0x2a')](respondWithStatusCode(_0x465baf,null))[_0xa935('0x48')](handleError(_0x465baf,null));};exports[_0xa935('0x8a')]=function(_0x4949c0,_0x27aac8,_0x59df9b){var _0x4593b1={};var _0x3a48a9={};var _0x59e0a3;var _0x501fcb;return db[_0xa935('0x35')][_0xa935('0x58')]({'where':{'id':_0x4949c0[_0xa935('0x4a')]['id']}})[_0xa935('0x2a')](handleEntityNotFound(_0x27aac8,null))['then'](function(_0x248b8b){if(_0x248b8b){_0x59e0a3=_0x248b8b;_0x3a48a9[_0xa935('0x38')]=_['keys'](db[_0xa935('0x5e')][_0xa935('0x36')]);_0x3a48a9['query']=_[_0xa935('0x3a')](_0x4949c0[_0xa935('0x39')]);_0x3a48a9['filters']=_[_0xa935('0x4b')](_0x3a48a9[_0xa935('0x38')],_0x3a48a9[_0xa935('0x39')]);_0x4593b1[_0xa935('0x3c')]=_['intersection'](_0x3a48a9['model'],qs[_0xa935('0x3d')](_0x4949c0[_0xa935('0x39')]['fields']));_0x4593b1[_0xa935('0x3c')]=_0x4593b1[_0xa935('0x3c')][_0xa935('0x3e')]?_0x4593b1[_0xa935('0x3c')]:_0x3a48a9[_0xa935('0x38')];_0x4593b1[_0xa935('0x5a')]=qs['sort'](_0x4949c0[_0xa935('0x39')][_0xa935('0x40')]);_0x4593b1[_0xa935('0x41')]=qs[_0xa935('0x3b')](_['pick'](_0x4949c0[_0xa935('0x39')],_0x3a48a9[_0xa935('0x3b')]));if(_0x4949c0[_0xa935('0x39')][_0xa935('0x5c')]){_0x4593b1[_0xa935('0x41')]=_[_0xa935('0x43')](_0x4593b1[_0xa935('0x41')],{'$or':_['map'](_0x4593b1[_0xa935('0x3c')],function(_0x5203fe){var _0x5a63a0={};_0x5a63a0[_0x5203fe]={'$like':'%'+_0x4949c0[_0xa935('0x39')][_0xa935('0x5c')]+'%'};return _0x5a63a0;})});}_0x4593b1=_[_0xa935('0x43')]({},_0x4593b1,_0x4949c0[_0xa935('0x45')]);return _0x59e0a3['getAgents'](_0x4593b1);}})['then'](function(_0x915a48){if(_0x915a48){_0x501fcb=_0x915a48[_0xa935('0x3e')];if(!_0x4949c0['query'][_0xa935('0x59')](_0xa935('0x3f'))){_0x4593b1[_0xa935('0x24')]=qs[_0xa935('0x24')](_0x4949c0['query'][_0xa935('0x24')]);_0x4593b1[_0xa935('0x22')]=qs[_0xa935('0x22')](_0x4949c0[_0xa935('0x39')][_0xa935('0x22')]);}return _0x59e0a3['getAgents'](_0x4593b1);}})[_0xa935('0x2a')](function(_0x1bb4d1){if(_0x1bb4d1){return _0x1bb4d1?{'count':_0x501fcb,'rows':_0x1bb4d1}:null;}})[_0xa935('0x2a')](respondWithResult(_0x27aac8,null))[_0xa935('0x48')](handleError(_0x27aac8,null));}; \ No newline at end of file +var _0x931c=['userWhatsappQueue:remove','addAgents','omit','spread','getAgents','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','fs-extra','lodash','crypto','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','register','status','end','json','offset','undefined','limit','set','Content-Range','apply','save','update','then','destroy','UserProfileResource','error','stack','name','send','index','map','WhatsappQueue','rawAttributes','fieldName','type','model','keys','query','filters','attributes','intersection','fields','length','nolimit','order','sort','pick','filter','merge','options','where','count','includeAll','include','findAll','show','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','get','WhatsappQueues','UserProfileSection','find','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','findOne','WhatsappQueueId','User','findAndCountAll','whatsappPause','updatedAt','createdAt','rows','format','%s/%s','SIP','getTeams','Team','hasOwnProperty','addTeams','ids','Agents','online','interface','flatMap','sequelize','transaction','each','UserWhatsappQueue','findOrCreate','forEach','userWhatsappQueue:save','removeTeams','select','tq.TeamId','from','join','user_has_teams','WhatsappQueueId\x20=\x20?','clone','push','QueryTypes','SELECT','TeamId','includes','all','union','isEmpty','removeAgents','emit'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x931c,0x1a6));var _0xc931=function(_0x2bcf99,_0x35c798){_0x2bcf99=_0x2bcf99-0x0;var _0x1593af=_0x931c[_0x2bcf99];return _0x1593af;};'use strict';var emlformat=require(_0xc931('0x0'));var rimraf=require(_0xc931('0x1'));var zipdir=require(_0xc931('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc931('0x3'));var moment=require('moment');var BPromise=require(_0xc931('0x4'));var Mustache=require(_0xc931('0x5'));var util=require(_0xc931('0x6'));var path=require(_0xc931('0x7'));var sox=require(_0xc931('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc931('0x9'));var _=require(_0xc931('0xa'));var squel=require('squel');var crypto=require(_0xc931('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xc931('0xc'));var querystring=require(_0xc931('0xd'));var Papa=require(_0xc931('0xe'));var Redis=require('ioredis');var authService=require(_0xc931('0xf'));var qs=require(_0xc931('0x10'));var as=require(_0xc931('0x11'));var hardwareService=require(_0xc931('0x12'));var logger=require(_0xc931('0x13'))(_0xc931('0x14'));var utils=require(_0xc931('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xc931('0x16'));var db=require('../../mysqldb')['db'];config[_0xc931('0x17')]=_[_0xc931('0x18')](config['redis'],{'host':_0xc931('0x19'),'port':0x18eb});var socket=require(_0xc931('0x1a'))(new Redis(config[_0xc931('0x17')]));require(_0xc931('0x1b'))[_0xc931('0x1c')](socket);function respondWithStatusCode(_0x21817a,_0xc13057){_0xc13057=_0xc13057||0xcc;return function(_0x245147){if(_0x245147){return _0x21817a['sendStatus'](_0xc13057);}return _0x21817a[_0xc931('0x1d')](_0xc13057)[_0xc931('0x1e')]();};}function respondWithResult(_0x5142f2,_0x355c17){_0x355c17=_0x355c17||0xc8;return function(_0x4c915f){if(_0x4c915f){return _0x5142f2['status'](_0x355c17)[_0xc931('0x1f')](_0x4c915f);}};}function respondWithFilteredResult(_0x31598a,_0x27534b){return function(_0xe959f2){if(_0xe959f2){var _0xde60f=typeof _0x27534b[_0xc931('0x20')]===_0xc931('0x21')&&typeof _0x27534b['limit']===_0xc931('0x21');var _0x1c3bf0=_0xe959f2['count'];var _0x4de98b=_0xde60f?0x0:_0x27534b[_0xc931('0x20')];var _0x532666=_0xde60f?_0xe959f2['count']:_0x27534b['offset']+_0x27534b[_0xc931('0x22')];var _0x167b26;if(_0x532666>=_0x1c3bf0){_0x532666=_0x1c3bf0;_0x167b26=0xc8;}else{_0x167b26=0xce;}_0x31598a[_0xc931('0x1d')](_0x167b26);return _0x31598a[_0xc931('0x23')](_0xc931('0x24'),_0x4de98b+'-'+_0x532666+'/'+_0x1c3bf0)['json'](_0xe959f2);}return null;};}function patchUpdates(_0x225eca){return function(_0x440c54){try{jsonpatch[_0xc931('0x25')](_0x440c54,_0x225eca,!![]);}catch(_0x246e49){return BPromise['reject'](_0x246e49);}return _0x440c54[_0xc931('0x26')]();};}function saveUpdates(_0x5decdb,_0x4ab649){return function(_0x3edcbc){if(_0x3edcbc){return _0x3edcbc[_0xc931('0x27')](_0x5decdb)[_0xc931('0x28')](function(_0x4e1107){return _0x4e1107;});}return null;};}function removeEntity(_0x35c51a,_0x459b55){return function(_0x45cebf){if(_0x45cebf){return _0x45cebf[_0xc931('0x29')]()[_0xc931('0x28')](function(){var _0x35b9a4=_0x45cebf['get']({'plain':!![]});var _0x4c2b16='WhatsappQueues';return db[_0xc931('0x2a')][_0xc931('0x29')]({'where':{'type':_0x4c2b16,'resourceId':_0x35b9a4['id']}})[_0xc931('0x28')](function(){return _0x45cebf;});})[_0xc931('0x28')](function(){_0x35c51a[_0xc931('0x1d')](0xcc)[_0xc931('0x1e')]();});}};}function handleEntityNotFound(_0x470562,_0x4aa7e5){return function(_0x1e284e){if(!_0x1e284e){_0x470562['sendStatus'](0x194);}return _0x1e284e;};}function handleError(_0x43d03b,_0x3bfd2d){_0x3bfd2d=_0x3bfd2d||0x1f4;return function(_0x59f13b){logger[_0xc931('0x2b')](_0x59f13b[_0xc931('0x2c')]);if(_0x59f13b[_0xc931('0x2d')]){delete _0x59f13b['name'];}_0x43d03b[_0xc931('0x1d')](_0x3bfd2d)[_0xc931('0x2e')](_0x59f13b);};}exports[_0xc931('0x2f')]=function(_0x4538e8,_0x46362b){var _0x35b2b6={},_0x4651ab={},_0x177936={'count':0x0,'rows':[]};var _0x1a3668=_[_0xc931('0x30')](db[_0xc931('0x31')][_0xc931('0x32')],function(_0xa0894){return{'name':_0xa0894[_0xc931('0x33')],'type':_0xa0894[_0xc931('0x34')]['key']};});_0x4651ab[_0xc931('0x35')]=_['map'](_0x1a3668,_0xc931('0x2d'));_0x4651ab['query']=_[_0xc931('0x36')](_0x4538e8[_0xc931('0x37')]);_0x4651ab[_0xc931('0x38')]=_['intersection'](_0x4651ab[_0xc931('0x35')],_0x4651ab['query']);_0x35b2b6[_0xc931('0x39')]=_[_0xc931('0x3a')](_0x4651ab[_0xc931('0x35')],qs['fields'](_0x4538e8[_0xc931('0x37')][_0xc931('0x3b')]));_0x35b2b6[_0xc931('0x39')]=_0x35b2b6['attributes'][_0xc931('0x3c')]?_0x35b2b6[_0xc931('0x39')]:_0x4651ab[_0xc931('0x35')];if(!_0x4538e8[_0xc931('0x37')]['hasOwnProperty'](_0xc931('0x3d'))){_0x35b2b6[_0xc931('0x22')]=qs[_0xc931('0x22')](_0x4538e8[_0xc931('0x37')][_0xc931('0x22')]);_0x35b2b6['offset']=qs[_0xc931('0x20')](_0x4538e8['query'][_0xc931('0x20')]);}_0x35b2b6[_0xc931('0x3e')]=qs[_0xc931('0x3f')](_0x4538e8['query'][_0xc931('0x3f')]);_0x35b2b6['where']=qs[_0xc931('0x38')](_[_0xc931('0x40')](_0x4538e8[_0xc931('0x37')],_0x4651ab[_0xc931('0x38')]),_0x1a3668);if(_0x4538e8[_0xc931('0x37')][_0xc931('0x41')]){_0x35b2b6['where']=_['merge'](_0x35b2b6['where'],{'$or':_[_0xc931('0x30')](_0x1a3668,function(_0x23ca85){if(_0x23ca85[_0xc931('0x34')]!=='VIRTUAL'){var _0x52173d={};_0x52173d[_0x23ca85[_0xc931('0x2d')]]={'$like':'%'+_0x4538e8['query'][_0xc931('0x41')]+'%'};return _0x52173d;}})});}_0x35b2b6=_[_0xc931('0x42')]({},_0x35b2b6,_0x4538e8[_0xc931('0x43')]);var _0x23c36c={'where':_0x35b2b6[_0xc931('0x44')]};return db['WhatsappQueue']['count'](_0x23c36c)[_0xc931('0x28')](function(_0xf5bd7e){_0x177936[_0xc931('0x45')]=_0xf5bd7e;if(_0x4538e8[_0xc931('0x37')][_0xc931('0x46')]){_0x35b2b6[_0xc931('0x47')]=[{'all':!![]}];}return db['WhatsappQueue'][_0xc931('0x48')](_0x35b2b6);})[_0xc931('0x28')](function(_0x2d1cc4){_0x177936['rows']=_0x2d1cc4;return _0x177936;})['then'](respondWithFilteredResult(_0x46362b,_0x35b2b6))['catch'](handleError(_0x46362b,null));};exports[_0xc931('0x49')]=function(_0x494e4b,_0xae5bda){var _0x4fc217={'raw':!![],'where':{'id':_0x494e4b['params']['id']}},_0x59dd18={};_0x59dd18[_0xc931('0x35')]=_[_0xc931('0x36')](db[_0xc931('0x31')]['rawAttributes']);_0x59dd18['query']=_['keys'](_0x494e4b[_0xc931('0x37')]);_0x59dd18[_0xc931('0x38')]=_[_0xc931('0x3a')](_0x59dd18['model'],_0x59dd18[_0xc931('0x37')]);_0x4fc217[_0xc931('0x39')]=_['intersection'](_0x59dd18[_0xc931('0x35')],qs['fields'](_0x494e4b[_0xc931('0x37')]['fields']));_0x4fc217[_0xc931('0x39')]=_0x4fc217[_0xc931('0x39')][_0xc931('0x3c')]?_0x4fc217[_0xc931('0x39')]:_0x59dd18[_0xc931('0x35')];if(_0x494e4b['query']['includeAll']){_0x4fc217[_0xc931('0x47')]=[{'all':!![]}];}_0x4fc217=_[_0xc931('0x42')]({},_0x4fc217,_0x494e4b[_0xc931('0x43')]);return db['WhatsappQueue']['find'](_0x4fc217)['then'](handleEntityNotFound(_0xae5bda,null))['then'](respondWithResult(_0xae5bda,null))['catch'](handleError(_0xae5bda,null));};exports[_0xc931('0x4a')]=function(_0x23b5d4,_0x3f4004){return db[_0xc931('0x31')][_0xc931('0x4a')](_0x23b5d4[_0xc931('0x4b')],{})['then'](function(_0x3de782){var _0x3ce96e=_0x23b5d4['user']['get']({'plain':!![]});if(!_0x3ce96e)throw new Error(_0xc931('0x4c'));if(_0x3ce96e[_0xc931('0x4d')]===_0xc931('0x4e')){var _0xe0f740=_0x3de782[_0xc931('0x4f')]({'plain':!![]});var _0x11202f=_0xc931('0x50');return db[_0xc931('0x51')][_0xc931('0x52')]({'where':{'name':_0x11202f,'userProfileId':_0x3ce96e['userProfileId']},'raw':!![]})[_0xc931('0x28')](function(_0x168229){if(_0x168229&&_0x168229[_0xc931('0x53')]===0x0){return db[_0xc931('0x2a')][_0xc931('0x4a')]({'name':_0xe0f740[_0xc931('0x2d')],'resourceId':_0xe0f740['id'],'type':_0x168229['name'],'sectionId':_0x168229['id']},{})[_0xc931('0x28')](function(){return _0x3de782;});}else{return _0x3de782;}})[_0xc931('0x54')](function(_0x2f91aa){logger['error'](_0xc931('0x55'),_0x2f91aa);throw _0x2f91aa;});}return _0x3de782;})['then'](respondWithResult(_0x3f4004,0xc9))['catch'](handleError(_0x3f4004,null));};exports[_0xc931('0x27')]=function(_0x32f1f4,_0x4f64d8){if(_0x32f1f4[_0xc931('0x4b')]['id']){delete _0x32f1f4[_0xc931('0x4b')]['id'];}return db[_0xc931('0x31')][_0xc931('0x52')]({'where':{'id':_0x32f1f4[_0xc931('0x56')]['id']}})[_0xc931('0x28')](handleEntityNotFound(_0x4f64d8,null))[_0xc931('0x28')](saveUpdates(_0x32f1f4[_0xc931('0x4b')],null))[_0xc931('0x28')](respondWithResult(_0x4f64d8,null))[_0xc931('0x54')](handleError(_0x4f64d8,null));};exports[_0xc931('0x29')]=function(_0x5760cc,_0x194bbb){return db['WhatsappQueue']['find']({'where':{'id':_0x5760cc[_0xc931('0x56')]['id']}})[_0xc931('0x28')](handleEntityNotFound(_0x194bbb,null))[_0xc931('0x28')](removeEntity(_0x194bbb,null))['catch'](handleError(_0x194bbb,null));};exports[_0xc931('0x57')]=function(_0x4037af,_0x58f362){return db[_0xc931('0x31')]['describe']()['then'](respondWithResult(_0x58f362,null))['catch'](handleError(_0x58f362,null));};exports[_0xc931('0x58')]=function(_0xc9515a,_0x49b799,_0x387b37){var _0x2b29ce={'raw':!![],'where':{}},_0x2b5ddf={},_0x344c65;return db[_0xc931('0x31')][_0xc931('0x59')]({'where':{'id':_0xc9515a[_0xc931('0x56')]['id']}})['then'](handleEntityNotFound(_0x49b799,null))[_0xc931('0x28')](function(_0x5879a4){if(_0x5879a4){_0x344c65=_0x5879a4[_0xc931('0x4f')]({'plain':!![]});_0x2b5ddf[_0xc931('0x35')]=_[_0xc931('0x36')](db['UserWhatsappQueue'][_0xc931('0x32')]);_0x2b5ddf['query']=_[_0xc931('0x36')](_0xc9515a[_0xc931('0x37')]);_0x2b5ddf[_0xc931('0x38')]=_[_0xc931('0x3a')](_0x2b5ddf[_0xc931('0x35')],_0x2b5ddf[_0xc931('0x37')]);_0x2b29ce[_0xc931('0x39')]=_[_0xc931('0x3a')](_0x2b5ddf[_0xc931('0x35')],qs[_0xc931('0x3b')](_0xc9515a[_0xc931('0x37')][_0xc931('0x3b')]));_0x2b29ce[_0xc931('0x39')]=_0x2b29ce['attributes']['length']?_0x2b29ce[_0xc931('0x39')]:_0x2b5ddf[_0xc931('0x35')];if(!_0xc9515a[_0xc931('0x37')]['hasOwnProperty'](_0xc931('0x3d'))){_0x2b29ce['limit']=qs[_0xc931('0x22')](_0xc9515a[_0xc931('0x37')][_0xc931('0x22')]);_0x2b29ce[_0xc931('0x20')]=qs['offset'](_0xc9515a[_0xc931('0x37')]['offset']);}_0x2b29ce['order']=qs[_0xc931('0x3f')](_0xc9515a[_0xc931('0x37')]['sort']);_0x2b29ce[_0xc931('0x44')]=qs[_0xc931('0x38')](_[_0xc931('0x40')](_0xc9515a[_0xc931('0x37')],_0x2b5ddf['filters']));_0x2b29ce[_0xc931('0x44')][_0xc931('0x5a')]=_0x5879a4['id'];if(_0xc9515a[_0xc931('0x37')][_0xc931('0x41')]){_0x2b29ce[_0xc931('0x44')]=_[_0xc931('0x42')](_0x2b29ce[_0xc931('0x44')],{'$or':_[_0xc931('0x30')](_0x2b29ce['attributes'],function(_0x1c5da8){var _0x123cb7={};_0x123cb7[_0x1c5da8]={'$like':'%'+_0xc9515a['query'][_0xc931('0x41')]+'%'};return _0x123cb7;})});}_0x2b29ce=_[_0xc931('0x42')]({},_0x2b29ce,_0xc9515a[_0xc931('0x43')]);return db['UserWhatsappQueue'][_0xc931('0x48')](_0x2b29ce);}})[_0xc931('0x28')](function(_0x164da1){if(_0x164da1){return db[_0xc931('0x5b')][_0xc931('0x5c')]({'where':{'id':_[_0xc931('0x30')](_0x164da1,'UserId'),'role':'agent'},'attributes':['id',_0xc931('0x2d'),_0xc931('0x5d'),_0xc931('0x5e'),_0xc931('0x5f')]});}})['then'](function(_0x1117da){if(_0x1117da){return{'count':_0x1117da[_0xc931('0x45')],'rows':_[_0xc931('0x30')](_0x1117da[_0xc931('0x60')],function(_0x2d9e72){return{'membername':_0x2d9e72[_0xc931('0x2d')],'UserId':_0x2d9e72['id'],'queue_name':_0x344c65[_0xc931('0x2d')],'WhatsappQueueId':_0x344c65['id'],'interface':util[_0xc931('0x61')](_0xc931('0x62'),_0xc931('0x63'),_0x2d9e72[_0xc931('0x2d')]),'penalty':0x0,'paused':_0x2d9e72['whatsappPause'],'createdAt':_0x2d9e72[_0xc931('0x5f')],'updatedAt':_0x2d9e72['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x49b799,_0x2b29ce))[_0xc931('0x54')](handleError(_0x49b799,null));};exports[_0xc931('0x64')]=function(_0x5360d7,_0x5e91f0,_0x331211){var _0x136917={};var _0x5249a1={};var _0x413481;var _0x14c9f4;return db['WhatsappQueue'][_0xc931('0x59')]({'where':{'id':_0x5360d7[_0xc931('0x56')]['id']}})[_0xc931('0x28')](handleEntityNotFound(_0x5e91f0,null))['then'](function(_0x1511f4){if(_0x1511f4){_0x413481=_0x1511f4;_0x5249a1[_0xc931('0x35')]=_[_0xc931('0x36')](db[_0xc931('0x65')][_0xc931('0x32')]);_0x5249a1[_0xc931('0x37')]=_['keys'](_0x5360d7[_0xc931('0x37')]);_0x5249a1[_0xc931('0x38')]=_[_0xc931('0x3a')](_0x5249a1[_0xc931('0x35')],_0x5249a1[_0xc931('0x37')]);_0x136917['attributes']=_['intersection'](_0x5249a1[_0xc931('0x35')],qs[_0xc931('0x3b')](_0x5360d7[_0xc931('0x37')]['fields']));_0x136917['attributes']=_0x136917[_0xc931('0x39')]['length']?_0x136917[_0xc931('0x39')]:_0x5249a1[_0xc931('0x35')];_0x136917['order']=qs[_0xc931('0x3f')](_0x5360d7[_0xc931('0x37')][_0xc931('0x3f')]);_0x136917['where']=qs[_0xc931('0x38')](_[_0xc931('0x40')](_0x5360d7[_0xc931('0x37')],_0x5249a1[_0xc931('0x38')]));if(_0x5360d7['query']['filter']){_0x136917[_0xc931('0x44')]=_[_0xc931('0x42')](_0x136917[_0xc931('0x44')],{'$or':_[_0xc931('0x30')](_0x136917[_0xc931('0x39')],function(_0x142cee){var _0x211e16={};_0x211e16[_0x142cee]={'$like':'%'+_0x5360d7[_0xc931('0x37')]['filter']+'%'};return _0x211e16;})});}_0x136917=_[_0xc931('0x42')]({},_0x136917,_0x5360d7[_0xc931('0x43')]);return _0x413481['getTeams'](_0x136917);}})[_0xc931('0x28')](function(_0x1c14b3){if(_0x1c14b3){_0x14c9f4=_0x1c14b3['length'];if(!_0x5360d7['query'][_0xc931('0x66')](_0xc931('0x3d'))){_0x136917['limit']=qs[_0xc931('0x22')](_0x5360d7[_0xc931('0x37')][_0xc931('0x22')]);_0x136917['offset']=qs[_0xc931('0x20')](_0x5360d7[_0xc931('0x37')][_0xc931('0x20')]);}return _0x413481[_0xc931('0x64')](_0x136917);}})[_0xc931('0x28')](function(_0x8b9016){if(_0x8b9016){return _0x8b9016?{'count':_0x14c9f4,'rows':_0x8b9016}:null;}})[_0xc931('0x28')](respondWithResult(_0x5e91f0,null))[_0xc931('0x54')](handleError(_0x5e91f0,null));};exports[_0xc931('0x67')]=function(_0x202557,_0x248e62,_0x156449){var _0x35c504=_0x202557[_0xc931('0x4b')][_0xc931('0x68')];return db['Team'][_0xc931('0x48')]({'where':{'id':_0x35c504},'attributes':['id'],'include':[{'model':db['User'],'as':_0xc931('0x69'),'attributes':['id',_0xc931('0x2d'),_0xc931('0x6a'),'voicePause',_0xc931('0x6b')],'raw':!![]}]})[_0xc931('0x28')](function(_0x3d4663){if(_0x3d4663){var _0x3512a2=_[_0xc931('0x6c')](_0x3d4663,function(_0x3dcca7){var _0x196588=_0x3dcca7['get']({'plain':!![]});return _0x196588[_0xc931('0x69')];});return db[_0xc931('0x31')][_0xc931('0x52')]({'where':{'id':_0x202557['params']['id']}})['then'](function(_0x59f1d2){return db[_0xc931('0x6d')][_0xc931('0x6e')](function(_0x28a604){return _0x59f1d2[_0xc931('0x67')](_0x35c504,{'transaction':_0x28a604})[_0xc931('0x28')](function(){return BPromise[_0xc931('0x6f')](_0x3512a2,function(_0x36f1c8){return db[_0xc931('0x70')][_0xc931('0x71')]({'where':{'UserId':_0x36f1c8['id'],'WhatsappQueueId':_0x202557[_0xc931('0x56')]['id']},'transaction':_0x28a604});});})['then'](function(){_0x3512a2[_0xc931('0x72')](function(_0x46247f){socket['emit'](_0xc931('0x73'),{'UserId':_0x46247f['id'],'WhatsappQueueId':_0x59f1d2['id']});});});});});}})[_0xc931('0x28')](respondWithStatusCode(_0x248e62,null))[_0xc931('0x54')](handleError(_0x248e62,null));};exports[_0xc931('0x74')]=function(_0x1abd44,_0x40e5d0,_0x288246){return db[_0xc931('0x65')][_0xc931('0x48')]({'where':{'id':_0x1abd44[_0xc931('0x37')][_0xc931('0x68')]},'attributes':['id'],'include':[{'model':db[_0xc931('0x5b')],'as':_0xc931('0x69'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x40e5d0,null))[_0xc931('0x28')](function(_0x4bb75d){var _0x42889f=_[_0xc931('0x30')](_0x4bb75d,'id');var _0x181c47=[];var _0x1d2c52=[];var _0x35eaba=squel[_0xc931('0x75')]();_0x35eaba['field'](_0xc931('0x76'))[_0xc931('0x77')]('team_has_whatsapp_queues','tq')[_0xc931('0x78')](_0xc931('0x79'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xc931('0x44')](_0xc931('0x7a'),_0x1abd44[_0xc931('0x56')]['id']);for(var _0x472a12=0x0;_0x472a12<_0x4bb75d['length'];_0x472a12+=0x1){let _0x2b7523=_0x4bb75d[_0x472a12];for(var _0x390b84=0x0;_0x390b84<_0x2b7523[_0xc931('0x69')][_0xc931('0x3c')];_0x390b84+=0x1){let _0x3e76cc=_0x2b7523[_0xc931('0x69')][_0x390b84];var _0x4030d9=_0x35eaba[_0xc931('0x7b')]();_0x4030d9[_0xc931('0x44')]('ut.UserId\x20=\x20?',_0x3e76cc['id']);_0x1d2c52[_0xc931('0x7c')](db['sequelize'][_0xc931('0x37')](_0x4030d9['toString'](),{'type':db['sequelize'][_0xc931('0x7d')][_0xc931('0x7e')]})['then'](function(_0x1e903b){if(_0x1e903b[_0xc931('0x3c')]===0x1){return _0x3e76cc['id'];}else{var _0x4f42a8=_['every'](_[_0xc931('0x30')](_0x1e903b,_0xc931('0x7f')),function(_0x472e52){return _[_0xc931('0x80')](_0x42889f,_0x472e52);});if(_0x4f42a8){return _0x3e76cc['id'];}}}));}}return BPromise[_0xc931('0x81')](_0x1d2c52)[_0xc931('0x28')](function(_0x318601){_0x181c47=_(_0x181c47)[_0xc931('0x82')](_0x318601)['compact']()['value']();return db[_0xc931('0x31')][_0xc931('0x52')]({'where':{'id':_0x1abd44['params']['id']}})['then'](function(_0x502181){return db['sequelize']['transaction'](function(_0x28bbf3){return _0x502181['removeTeams'](_0x1abd44[_0xc931('0x37')][_0xc931('0x68')],{'transaction':_0x28bbf3})[_0xc931('0x28')](function(){if(!_[_0xc931('0x83')](_0x181c47)){return _0x502181[_0xc931('0x84')](_0x181c47,{'transaction':_0x28bbf3});}})['then'](function(){_0x181c47[_0xc931('0x72')](function(_0x2d5a1c){socket[_0xc931('0x85')](_0xc931('0x86'),{'UserId':_0x2d5a1c,'WhatsappQueueId':_0x502181['id']});});});});});});})[_0xc931('0x28')](respondWithStatusCode(_0x40e5d0,null))[_0xc931('0x54')](handleError(_0x40e5d0,null));};exports[_0xc931('0x87')]=function(_0x4e994b,_0xad86f7,_0x55e194){return db['WhatsappQueue']['find']({'where':{'id':_0x4e994b[_0xc931('0x56')]['id']}})[_0xc931('0x28')](handleEntityNotFound(_0xad86f7,null))[_0xc931('0x28')](function(_0x2659a0){if(_0x2659a0){return _0x2659a0[_0xc931('0x87')](_0x4e994b[_0xc931('0x4b')][_0xc931('0x68')],_[_0xc931('0x88')](_0x4e994b[_0xc931('0x4b')],[_0xc931('0x68'),'id'])||{})[_0xc931('0x89')](function(_0x3b285d){for(var _0xf3c7e3=0x0;_0xf3c7e3<_0x4e994b['body'][_0xc931('0x68')]['length'];_0xf3c7e3+=0x1){socket['emit'](_0xc931('0x73'),{'UserId':Number(_0x4e994b[_0xc931('0x4b')][_0xc931('0x68')][_0xf3c7e3]),'WhatsappQueueId':Number(_0x4e994b[_0xc931('0x56')]['id'])});}return _0x3b285d;});}})['then'](respondWithResult(_0xad86f7,null))[_0xc931('0x54')](handleError(_0xad86f7,null));};exports['removeAgents']=function(_0x33b069,_0x4f5da7,_0xdb5502){return db[_0xc931('0x31')][_0xc931('0x52')]({'where':{'id':_0x33b069[_0xc931('0x56')]['id']}})[_0xc931('0x28')](handleEntityNotFound(_0x4f5da7,null))[_0xc931('0x28')](function(_0x18c260){if(_0x18c260){return _0x18c260[_0xc931('0x84')](_0x33b069['query'][_0xc931('0x68')])[_0xc931('0x28')](function(){if(_['isArray'](_0x33b069[_0xc931('0x37')]['ids'])){for(var _0xd74da=0x0;_0xd74da<_0x33b069[_0xc931('0x37')][_0xc931('0x68')][_0xc931('0x3c')];_0xd74da+=0x1){socket['emit'](_0xc931('0x86'),{'UserId':Number(_0x33b069[_0xc931('0x37')]['ids'][_0xd74da]),'WhatsappQueueId':Number(_0x33b069[_0xc931('0x56')]['id'])});}}else{socket[_0xc931('0x85')](_0xc931('0x86'),{'UserId':Number(_0x33b069['query'][_0xc931('0x68')]),'WhatsappQueueId':Number(_0x33b069[_0xc931('0x56')]['id'])});}});}})['then'](respondWithStatusCode(_0x4f5da7,null))['catch'](handleError(_0x4f5da7,null));};exports[_0xc931('0x8a')]=function(_0x524baf,_0x4d9140,_0xbf9be2){var _0x6fcc6={};var _0x48991c={};var _0xa54130;var _0x49a3f2;return db[_0xc931('0x31')][_0xc931('0x59')]({'where':{'id':_0x524baf[_0xc931('0x56')]['id']}})[_0xc931('0x28')](handleEntityNotFound(_0x4d9140,null))['then'](function(_0x57f994){if(_0x57f994){_0xa54130=_0x57f994;_0x48991c[_0xc931('0x35')]=_[_0xc931('0x36')](db[_0xc931('0x5b')][_0xc931('0x32')]);_0x48991c[_0xc931('0x37')]=_[_0xc931('0x36')](_0x524baf[_0xc931('0x37')]);_0x48991c[_0xc931('0x38')]=_['intersection'](_0x48991c[_0xc931('0x35')],_0x48991c[_0xc931('0x37')]);_0x6fcc6[_0xc931('0x39')]=_[_0xc931('0x3a')](_0x48991c[_0xc931('0x35')],qs[_0xc931('0x3b')](_0x524baf['query'][_0xc931('0x3b')]));_0x6fcc6[_0xc931('0x39')]=_0x6fcc6[_0xc931('0x39')][_0xc931('0x3c')]?_0x6fcc6[_0xc931('0x39')]:_0x48991c[_0xc931('0x35')];_0x6fcc6[_0xc931('0x3e')]=qs[_0xc931('0x3f')](_0x524baf['query'][_0xc931('0x3f')]);_0x6fcc6[_0xc931('0x44')]=qs['filters'](_[_0xc931('0x40')](_0x524baf[_0xc931('0x37')],_0x48991c[_0xc931('0x38')]));if(_0x524baf[_0xc931('0x37')][_0xc931('0x41')]){_0x6fcc6['where']=_[_0xc931('0x42')](_0x6fcc6[_0xc931('0x44')],{'$or':_[_0xc931('0x30')](_0x6fcc6['attributes'],function(_0x28f5a5){var _0x448aa5={};_0x448aa5[_0x28f5a5]={'$like':'%'+_0x524baf[_0xc931('0x37')][_0xc931('0x41')]+'%'};return _0x448aa5;})});}_0x6fcc6=_[_0xc931('0x42')]({},_0x6fcc6,_0x524baf[_0xc931('0x43')]);return _0xa54130['getAgents'](_0x6fcc6);}})[_0xc931('0x28')](function(_0x286255){if(_0x286255){_0x49a3f2=_0x286255[_0xc931('0x3c')];if(!_0x524baf[_0xc931('0x37')][_0xc931('0x66')](_0xc931('0x3d'))){_0x6fcc6[_0xc931('0x22')]=qs[_0xc931('0x22')](_0x524baf[_0xc931('0x37')][_0xc931('0x22')]);_0x6fcc6['offset']=qs[_0xc931('0x20')](_0x524baf[_0xc931('0x37')]['offset']);}return _0xa54130[_0xc931('0x8a')](_0x6fcc6);}})[_0xc931('0x28')](function(_0x23824a){if(_0x23824a){return _0x23824a?{'count':_0x49a3f2,'rows':_0x23824a}:null;}})[_0xc931('0x28')](respondWithResult(_0x4d9140,null))['catch'](handleError(_0x4d9140,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.events.js b/server/api/whatsappQueue/whatsappQueue.events.js index 9c7a9eb..bd1de32 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 _0x4351=['events','../../mysqldb','WhatsappQueue','setMaxListeners','remove','emit','hook'];(function(_0x219bed,_0x594f65){var _0x5ad0b8=function(_0x34b384){while(--_0x34b384){_0x219bed['push'](_0x219bed['shift']());}};_0x5ad0b8(++_0x594f65);}(_0x4351,0x12d));var _0x1435=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0x4351[_0x47b58b];return _0x46bebe;};'use strict';var EventEmitter=require(_0x1435('0x0'));var WhatsappQueue=require(_0x1435('0x1'))['db'][_0x1435('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x1435('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x1435('0x4')};function emitEvent(_0x2fb799){return function(_0xbd8f6f,_0x286e05,_0x25cee3){WhatsappQueueEvents[_0x1435('0x5')](_0x2fb799+':'+_0xbd8f6f['id'],_0xbd8f6f);WhatsappQueueEvents[_0x1435('0x5')](_0x2fb799,_0xbd8f6f);_0x25cee3(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];WhatsappQueue[_0x1435('0x6')](e,emitEvent(event));}}module['exports']=WhatsappQueueEvents; \ No newline at end of file +var _0xf364=['hasOwnProperty','hook','exports','events','../../mysqldb','WhatsappQueue','setMaxListeners','save','update','remove','emit'];(function(_0x4c52c4,_0x197cc2){var _0x13e57b=function(_0x231d72){while(--_0x231d72){_0x4c52c4['push'](_0x4c52c4['shift']());}};_0x13e57b(++_0x197cc2);}(_0xf364,0x163));var _0x4f36=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xf364[_0x432682];return _0x463d05;};'use strict';var EventEmitter=require(_0x4f36('0x0'));var WhatsappQueue=require(_0x4f36('0x1'))['db'][_0x4f36('0x2')];var WhatsappQueueEvents=new EventEmitter();WhatsappQueueEvents[_0x4f36('0x3')](0x0);var events={'afterCreate':_0x4f36('0x4'),'afterUpdate':_0x4f36('0x5'),'afterDestroy':_0x4f36('0x6')};function emitEvent(_0x120130){return function(_0x29d745,_0x57edd4,_0x122adb){WhatsappQueueEvents[_0x4f36('0x7')](_0x120130+':'+_0x29d745['id'],_0x29d745);WhatsappQueueEvents[_0x4f36('0x7')](_0x120130,_0x29d745);_0x122adb(null);};}for(var e in events){if(events[_0x4f36('0x8')](e)){var event=events[e];WhatsappQueue[_0x4f36('0x9')](e,emitEvent(event));}}module[_0x4f36('0xa')]=WhatsappQueueEvents; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.model.js b/server/api/whatsappQueue/whatsappQueue.model.js index a26efe4..cbda463 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 _0x9bfb=['bluebird','request-promise','rimraf','../../config/environment','./whatsappQueue.attributes','exports','define','util','../../config/logger','api'];(function(_0x15461b,_0x4d0707){var _0x139e59=function(_0x3238d4){while(--_0x3238d4){_0x15461b['push'](_0x15461b['shift']());}};_0x139e59(++_0x4d0707);}(_0x9bfb,0xe3));var _0xb9bf=function(_0x5332b1,_0x192941){_0x5332b1=_0x5332b1-0x0;var _0x129b49=_0x9bfb[_0x5332b1];return _0x129b49;};'use strict';var _=require('lodash');var util=require(_0xb9bf('0x0'));var logger=require(_0xb9bf('0x1'))(_0xb9bf('0x2'));var moment=require('moment');var BPromise=require(_0xb9bf('0x3'));var rp=require(_0xb9bf('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb9bf('0x5'));var config=require(_0xb9bf('0x6'));var attributes=require(_0xb9bf('0x7'));module[_0xb9bf('0x8')]=function(_0x156647,_0xf170bf){return _0x156647[_0xb9bf('0x9')]('WhatsappQueue',attributes,{'tableName':'whatsapp_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa740=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./whatsappQueue.attributes','exports','whatsapp_queues','lodash','util','../../config/logger'];(function(_0x570a92,_0x390b5f){var _0x123938=function(_0x1c5ced){while(--_0x1c5ced){_0x570a92['push'](_0x570a92['shift']());}};_0x123938(++_0x390b5f);}(_0xa740,0xd5));var _0x0a74=function(_0x3ed90b,_0x520399){_0x3ed90b=_0x3ed90b-0x0;var _0x2f1aa1=_0xa740[_0x3ed90b];return _0x2f1aa1;};'use strict';var _=require(_0x0a74('0x0'));var util=require(_0x0a74('0x1'));var logger=require(_0x0a74('0x2'))(_0x0a74('0x3'));var moment=require(_0x0a74('0x4'));var BPromise=require(_0x0a74('0x5'));var rp=require(_0x0a74('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0a74('0x7'));var config=require(_0x0a74('0x8'));var attributes=require(_0x0a74('0x9'));module[_0x0a74('0xa')]=function(_0x2da18e,_0x963e67){return _0x2da18e['define']('WhatsappQueue',attributes,{'tableName':_0x0a74('0xb'),'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 4c0360c..3825a0e 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 _0xf811=['map','then','GetWhatsappQueue','find','raw','ShowWhatsappQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','defaults','redis','register','request','WhatsappQueue,\x20%s,\x20%s','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','WhatsappQueue','options','attributes','include','model'];(function(_0xf00f73,_0x147a86){var _0x38e363=function(_0x5af1d2){while(--_0x5af1d2){_0xf00f73['push'](_0xf00f73['shift']());}};_0x38e363(++_0x147a86);}(_0xf811,0x19d));var _0x1f81=function(_0x40bffc,_0x3a45d7){_0x40bffc=_0x40bffc-0x0;var _0x3007e9=_0xf811[_0x40bffc];return _0x3007e9;};'use strict';var _=require(_0x1f81('0x0'));var util=require(_0x1f81('0x1'));var moment=require(_0x1f81('0x2'));var BPromise=require(_0x1f81('0x3'));var rs=require(_0x1f81('0x4'));var fs=require('fs');var Redis=require(_0x1f81('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x1f81('0x6'));var logger=require(_0x1f81('0x7'))('rpc');var config=require(_0x1f81('0x8'));var jayson=require(_0x1f81('0x9'));var client=jayson['client'][_0x1f81('0xa')]({'port':0x232a});config['redis']=_[_0x1f81('0xb')](config[_0x1f81('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1f81('0xc')]));require('./whatsappQueue.socket')[_0x1f81('0xd')](socket);function respondWithRpcPromise(_0x483f73,_0x5feb5f,_0x448d3a){return new BPromise(function(_0x4613b9,_0x59cb37){return client[_0x1f81('0xe')](_0x483f73,_0x448d3a)['then'](function(_0x16e0e0){logger['info'](_0x1f81('0xf'),_0x5feb5f,'request\x20sent');logger[_0x1f81('0x10')](_0x1f81('0x11'),_0x5feb5f,_0x1f81('0x12'),JSON[_0x1f81('0x13')](_0x16e0e0));if(_0x16e0e0[_0x1f81('0x14')]){if(_0x16e0e0[_0x1f81('0x14')][_0x1f81('0x15')]===0x1f4){logger[_0x1f81('0x14')](_0x1f81('0xf'),_0x5feb5f,_0x16e0e0[_0x1f81('0x14')][_0x1f81('0x16')]);return _0x59cb37(_0x16e0e0[_0x1f81('0x14')][_0x1f81('0x16')]);}logger[_0x1f81('0x14')](_0x1f81('0xf'),_0x5feb5f,_0x16e0e0[_0x1f81('0x14')][_0x1f81('0x16')]);return _0x4613b9(_0x16e0e0[_0x1f81('0x14')][_0x1f81('0x16')]);}else{logger[_0x1f81('0x17')](_0x1f81('0xf'),_0x5feb5f,'request\x20sent');_0x4613b9(_0x16e0e0[_0x1f81('0x18')][_0x1f81('0x16')]);}})[_0x1f81('0x19')](function(_0x5b6a3b){logger[_0x1f81('0x14')](_0x1f81('0xf'),_0x5feb5f,_0x5b6a3b);_0x59cb37(_0x5b6a3b);});});}exports['GetWhatsappQueue']=function(_0x2ade74){var _0xab4582=this;return new Promise(function(_0x3181ea,_0x42306a){return db[_0x1f81('0x1a')]['findAll']({'raw':_0x2ade74[_0x1f81('0x1b')]?_0x2ade74[_0x1f81('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x2ade74[_0x1f81('0x1b')]?_0x2ade74[_0x1f81('0x1b')]['where']||null:null,'attributes':_0x2ade74[_0x1f81('0x1b')]?_0x2ade74[_0x1f81('0x1b')][_0x1f81('0x1c')]||null:null,'limit':_0x2ade74[_0x1f81('0x1b')]?_0x2ade74[_0x1f81('0x1b')]['limit']||null:null,'include':_0x2ade74[_0x1f81('0x1b')]?_0x2ade74[_0x1f81('0x1b')][_0x1f81('0x1d')]?_['map'](_0x2ade74[_0x1f81('0x1b')][_0x1f81('0x1d')],function(_0x2010f5){return{'model':db[_0x2010f5[_0x1f81('0x1e')]],'as':_0x2010f5['as'],'attributes':_0x2010f5[_0x1f81('0x1c')],'include':_0x2010f5[_0x1f81('0x1d')]?_[_0x1f81('0x1f')](_0x2010f5['include'],function(_0x259c59){return{'model':db[_0x259c59[_0x1f81('0x1e')]],'as':_0x259c59['as'],'attributes':_0x259c59[_0x1f81('0x1c')],'include':_0x259c59[_0x1f81('0x1d')]?_[_0x1f81('0x1f')](_0x259c59[_0x1f81('0x1d')],function(_0x58ce77){return{'model':db[_0x58ce77['model']],'as':_0x58ce77['as'],'attributes':_0x58ce77['attributes']};}):[]};}):[]};}):[]:[]})[_0x1f81('0x20')](function(_0x291d08){logger[_0x1f81('0x17')](_0x1f81('0x21'),_0x2ade74);logger['debug'](_0x1f81('0x21'),_0x2ade74,JSON['stringify'](_0x291d08));_0x3181ea(_0x291d08);})['catch'](function(_0x863d51){logger[_0x1f81('0x14')]('GetWhatsappQueue',_0x863d51[_0x1f81('0x16')],_0x2ade74);_0x42306a(_0xab4582[_0x1f81('0x14')](0x1f4,_0x863d51['message']));});});};exports['ShowWhatsappQueue']=function(_0x18d05b){var _0x2479a6=this;return new Promise(function(_0x479518,_0x3e4bc7){return db[_0x1f81('0x1a')][_0x1f81('0x22')]({'raw':_0x18d05b[_0x1f81('0x1b')]?_0x18d05b['options'][_0x1f81('0x23')]===undefined?!![]:![]:!![],'where':_0x18d05b[_0x1f81('0x1b')]?_0x18d05b['options']['where']||null:null,'attributes':_0x18d05b[_0x1f81('0x1b')]?_0x18d05b['options'][_0x1f81('0x1c')]||null:null,'include':_0x18d05b[_0x1f81('0x1b')]?_0x18d05b['options'][_0x1f81('0x1d')]?_[_0x1f81('0x1f')](_0x18d05b[_0x1f81('0x1b')][_0x1f81('0x1d')],function(_0x2bcf3b){return{'model':db[_0x2bcf3b[_0x1f81('0x1e')]],'as':_0x2bcf3b['as'],'attributes':_0x2bcf3b[_0x1f81('0x1c')],'include':_0x2bcf3b[_0x1f81('0x1d')]?_[_0x1f81('0x1f')](_0x2bcf3b[_0x1f81('0x1d')],function(_0x15ac03){return{'model':db[_0x15ac03[_0x1f81('0x1e')]],'as':_0x15ac03['as'],'attributes':_0x15ac03['attributes'],'include':_0x15ac03[_0x1f81('0x1d')]?_[_0x1f81('0x1f')](_0x15ac03[_0x1f81('0x1d')],function(_0x2f8194){return{'model':db[_0x2f8194[_0x1f81('0x1e')]],'as':_0x2f8194['as'],'attributes':_0x2f8194[_0x1f81('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3213d6){logger[_0x1f81('0x17')](_0x1f81('0x24'),_0x18d05b);logger[_0x1f81('0x10')]('ShowWhatsappQueue',_0x18d05b,JSON[_0x1f81('0x13')](_0x3213d6));_0x479518(_0x3213d6);})[_0x1f81('0x19')](function(_0x353e50){logger[_0x1f81('0x14')](_0x1f81('0x24'),_0x353e50[_0x1f81('0x16')],_0x18d05b);_0x3e4bc7(_0x2479a6[_0x1f81('0x14')](0x1f4,_0x353e50[_0x1f81('0x16')]));});});}; \ No newline at end of file +var _0x1e33=['http','redis','defaults','localhost','socket.io-emitter','./whatsappQueue.socket','register','request','then','info','WhatsappQueue,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetWhatsappQueue','WhatsappQueue','findAll','options','raw','limit','include','model','attributes','map','ShowWhatsappQueue','where','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x1d9dfa,_0x30598d){var _0x252661=function(_0x4bcc24){while(--_0x4bcc24){_0x1d9dfa['push'](_0x1d9dfa['shift']());}};_0x252661(++_0x30598d);}(_0x1e33,0x1c4));var _0x31e3=function(_0x24c9b1,_0xf8e8cc){_0x24c9b1=_0x24c9b1-0x0;var _0x17c576=_0x1e33[_0x24c9b1];return _0x17c576;};'use strict';var _=require('lodash');var util=require(_0x31e3('0x0'));var moment=require(_0x31e3('0x1'));var BPromise=require(_0x31e3('0x2'));var rs=require(_0x31e3('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x31e3('0x4'))['db'];var utils=require(_0x31e3('0x5'));var logger=require(_0x31e3('0x6'))(_0x31e3('0x7'));var config=require(_0x31e3('0x8'));var jayson=require(_0x31e3('0x9'));var client=jayson['client'][_0x31e3('0xa')]({'port':0x232a});config[_0x31e3('0xb')]=_[_0x31e3('0xc')](config[_0x31e3('0xb')],{'host':_0x31e3('0xd'),'port':0x18eb});var socket=require(_0x31e3('0xe'))(new Redis(config[_0x31e3('0xb')]));require(_0x31e3('0xf'))[_0x31e3('0x10')](socket);function respondWithRpcPromise(_0x305175,_0x3856b4,_0xd83d33){return new BPromise(function(_0x5996db,_0x33c593){return client[_0x31e3('0x11')](_0x305175,_0xd83d33)[_0x31e3('0x12')](function(_0x29c342){logger[_0x31e3('0x13')](_0x31e3('0x14'),_0x3856b4,_0x31e3('0x15'));logger[_0x31e3('0x16')](_0x31e3('0x17'),_0x3856b4,'request\x20sent',JSON[_0x31e3('0x18')](_0x29c342));if(_0x29c342[_0x31e3('0x19')]){if(_0x29c342['error'][_0x31e3('0x1a')]===0x1f4){logger[_0x31e3('0x19')](_0x31e3('0x14'),_0x3856b4,_0x29c342[_0x31e3('0x19')]['message']);return _0x33c593(_0x29c342[_0x31e3('0x19')][_0x31e3('0x1b')]);}logger[_0x31e3('0x19')]('WhatsappQueue,\x20%s,\x20%s',_0x3856b4,_0x29c342[_0x31e3('0x19')][_0x31e3('0x1b')]);return _0x5996db(_0x29c342[_0x31e3('0x19')][_0x31e3('0x1b')]);}else{logger['info'](_0x31e3('0x14'),_0x3856b4,'request\x20sent');_0x5996db(_0x29c342[_0x31e3('0x1c')][_0x31e3('0x1b')]);}})[_0x31e3('0x1d')](function(_0x17597d){logger[_0x31e3('0x19')](_0x31e3('0x14'),_0x3856b4,_0x17597d);_0x33c593(_0x17597d);});});}exports[_0x31e3('0x1e')]=function(_0xb6077f){var _0x5a4750=this;return new Promise(function(_0xe32045,_0x1ff1a1){return db[_0x31e3('0x1f')][_0x31e3('0x20')]({'raw':_0xb6077f['options']?_0xb6077f[_0x31e3('0x21')][_0x31e3('0x22')]===undefined?!![]:![]:!![],'where':_0xb6077f['options']?_0xb6077f[_0x31e3('0x21')]['where']||null:null,'attributes':_0xb6077f[_0x31e3('0x21')]?_0xb6077f['options']['attributes']||null:null,'limit':_0xb6077f[_0x31e3('0x21')]?_0xb6077f[_0x31e3('0x21')][_0x31e3('0x23')]||null:null,'include':_0xb6077f[_0x31e3('0x21')]?_0xb6077f[_0x31e3('0x21')][_0x31e3('0x24')]?_['map'](_0xb6077f[_0x31e3('0x21')][_0x31e3('0x24')],function(_0x908bb2){return{'model':db[_0x908bb2[_0x31e3('0x25')]],'as':_0x908bb2['as'],'attributes':_0x908bb2[_0x31e3('0x26')],'include':_0x908bb2[_0x31e3('0x24')]?_['map'](_0x908bb2[_0x31e3('0x24')],function(_0x10244a){return{'model':db[_0x10244a[_0x31e3('0x25')]],'as':_0x10244a['as'],'attributes':_0x10244a[_0x31e3('0x26')],'include':_0x10244a[_0x31e3('0x24')]?_[_0x31e3('0x27')](_0x10244a[_0x31e3('0x24')],function(_0x1585e4){return{'model':db[_0x1585e4[_0x31e3('0x25')]],'as':_0x1585e4['as'],'attributes':_0x1585e4['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0xe069ac){logger[_0x31e3('0x13')](_0x31e3('0x1e'),_0xb6077f);logger[_0x31e3('0x16')]('GetWhatsappQueue',_0xb6077f,JSON['stringify'](_0xe069ac));_0xe32045(_0xe069ac);})['catch'](function(_0x3e813f){logger[_0x31e3('0x19')](_0x31e3('0x1e'),_0x3e813f[_0x31e3('0x1b')],_0xb6077f);_0x1ff1a1(_0x5a4750[_0x31e3('0x19')](0x1f4,_0x3e813f[_0x31e3('0x1b')]));});});};exports[_0x31e3('0x28')]=function(_0x30d469){var _0x55e425=this;return new Promise(function(_0x2fc019,_0x1ac7d2){return db[_0x31e3('0x1f')]['find']({'raw':_0x30d469[_0x31e3('0x21')]?_0x30d469[_0x31e3('0x21')]['raw']===undefined?!![]:![]:!![],'where':_0x30d469[_0x31e3('0x21')]?_0x30d469[_0x31e3('0x21')][_0x31e3('0x29')]||null:null,'attributes':_0x30d469[_0x31e3('0x21')]?_0x30d469[_0x31e3('0x21')]['attributes']||null:null,'include':_0x30d469['options']?_0x30d469[_0x31e3('0x21')][_0x31e3('0x24')]?_[_0x31e3('0x27')](_0x30d469['options']['include'],function(_0x16f759){return{'model':db[_0x16f759[_0x31e3('0x25')]],'as':_0x16f759['as'],'attributes':_0x16f759[_0x31e3('0x26')],'include':_0x16f759['include']?_[_0x31e3('0x27')](_0x16f759[_0x31e3('0x24')],function(_0x38c74c){return{'model':db[_0x38c74c[_0x31e3('0x25')]],'as':_0x38c74c['as'],'attributes':_0x38c74c[_0x31e3('0x26')],'include':_0x38c74c[_0x31e3('0x24')]?_['map'](_0x38c74c['include'],function(_0x24fe31){return{'model':db[_0x24fe31[_0x31e3('0x25')]],'as':_0x24fe31['as'],'attributes':_0x24fe31[_0x31e3('0x26')]};}):[]};}):[]};}):[]:[]})[_0x31e3('0x12')](function(_0x343f7a){logger[_0x31e3('0x13')](_0x31e3('0x28'),_0x30d469);logger[_0x31e3('0x16')]('ShowWhatsappQueue',_0x30d469,JSON[_0x31e3('0x18')](_0x343f7a));_0x2fc019(_0x343f7a);})['catch'](function(_0x566f3a){logger['error']('ShowWhatsappQueue',_0x566f3a[_0x31e3('0x1b')],_0x30d469);_0x1ac7d2(_0x55e425[_0x31e3('0x19')](0x1f4,_0x566f3a[_0x31e3('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappQueue/whatsappQueue.socket.js b/server/api/whatsappQueue/whatsappQueue.socket.js index 0d59bed..4812ae9 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 _0x3d78=['whatsappQueue:','remove','update','register','length'];(function(_0x10f8c5,_0x3bc148){var _0x16392c=function(_0x56f982){while(--_0x56f982){_0x10f8c5['push'](_0x10f8c5['shift']());}};_0x16392c(++_0x3bc148);}(_0x3d78,0x13c));var _0x83d7=function(_0x13f507,_0x48a562){_0x13f507=_0x13f507-0x0;var _0x176e2f=_0x3d78[_0x13f507];return _0x176e2f;};'use strict';var WhatsappQueueEvents=require('./whatsappQueue.events');var events=['save',_0x83d7('0x0'),_0x83d7('0x1')];function createListener(_0x571ee8,_0x1f08f2){return function(_0x4ea032){_0x1f08f2['emit'](_0x571ee8,_0x4ea032);};}function removeListener(_0x2ee906,_0x1741f2){return function(){WhatsappQueueEvents['removeListener'](_0x2ee906,_0x1741f2);};}exports[_0x83d7('0x2')]=function(_0x42a668){for(var _0x1a2c39=0x0,_0x56d11a=events[_0x83d7('0x3')];_0x1a2c39<_0x56d11a;_0x1a2c39++){var _0x39ec94=events[_0x1a2c39];var _0x468a39=createListener(_0x83d7('0x4')+_0x39ec94,_0x42a668);WhatsappQueueEvents['on'](_0x39ec94,_0x468a39);}}; \ No newline at end of file +var _0x8582=['length','./whatsappQueue.events','save','update','removeListener','register'];(function(_0x37440c,_0x161ca1){var _0x11d16e=function(_0x37d352){while(--_0x37d352){_0x37440c['push'](_0x37440c['shift']());}};_0x11d16e(++_0x161ca1);}(_0x8582,0xdf));var _0x2858=function(_0x402843,_0x469d78){_0x402843=_0x402843-0x0;var _0x21caba=_0x8582[_0x402843];return _0x21caba;};'use strict';var WhatsappQueueEvents=require(_0x2858('0x0'));var events=[_0x2858('0x1'),'remove',_0x2858('0x2')];function createListener(_0x30e742,_0x5ba397){return function(_0x3510df){_0x5ba397['emit'](_0x30e742,_0x3510df);};}function removeListener(_0x500ee9,_0x55390d){return function(){WhatsappQueueEvents[_0x2858('0x3')](_0x500ee9,_0x55390d);};}exports[_0x2858('0x4')]=function(_0x5132e0){for(var _0x2dba4d=0x0,_0x6d97fa=events[_0x2858('0x5')];_0x2dba4d<_0x6d97fa;_0x2dba4d++){var _0x53bd97=events[_0x2dba4d];var _0x43e91c=createListener('whatsappQueue:'+_0x53bd97,_0x5132e0);WhatsappQueueEvents['on'](_0x53bd97,_0x43e91c);}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/index.js b/server/api/whatsappQueueReport/index.js index 5d14d8a..486ff1b 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 _0x1ab1=['show','post','create','put','delete','destroy','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./whatsappQueueReport.controller','get','isAuthenticated','/describe','describe','/:id'];(function(_0x360c26,_0x3592c3){var _0x257503=function(_0x19d02f){while(--_0x19d02f){_0x360c26['push'](_0x360c26['shift']());}};_0x257503(++_0x3592c3);}(_0x1ab1,0x93));var _0x11ab=function(_0x1b046b,_0x24ae3f){_0x1b046b=_0x1b046b-0x0;var _0x464c72=_0x1ab1[_0x1b046b];return _0x464c72;};'use strict';var multer=require('multer');var util=require(_0x11ab('0x0'));var path=require(_0x11ab('0x1'));var timeout=require('connect-timeout');var express=require(_0x11ab('0x2'));var router=express[_0x11ab('0x3')]();var fs_extra=require(_0x11ab('0x4'));var auth=require(_0x11ab('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x11ab('0x6'));var controller=require(_0x11ab('0x7'));router[_0x11ab('0x8')]('/',auth[_0x11ab('0x9')](),controller['index']);router[_0x11ab('0x8')](_0x11ab('0xa'),auth[_0x11ab('0x9')](),controller[_0x11ab('0xb')]);router[_0x11ab('0x8')](_0x11ab('0xc'),auth[_0x11ab('0x9')](),controller[_0x11ab('0xd')]);router[_0x11ab('0xe')]('/',auth['isAuthenticated'](),controller[_0x11ab('0xf')]);router[_0x11ab('0x10')](_0x11ab('0xc'),auth[_0x11ab('0x9')](),controller['update']);router[_0x11ab('0x11')]('/:id',auth[_0x11ab('0x9')](),controller[_0x11ab('0x12')]);module[_0x11ab('0x13')]=router; \ No newline at end of file +var _0xfb56=['exports','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./whatsappQueueReport.controller','get','isAuthenticated','index','describe','/:id','show','create','put','delete','destroy'];(function(_0x1c6cf1,_0x2e7069){var _0x6fee02=function(_0x45f19c){while(--_0x45f19c){_0x1c6cf1['push'](_0x1c6cf1['shift']());}};_0x6fee02(++_0x2e7069);}(_0xfb56,0x131));var _0x6fb5=function(_0x440ba5,_0x573515){_0x440ba5=_0x440ba5-0x0;var _0x218106=_0xfb56[_0x440ba5];return _0x218106;};'use strict';var multer=require('multer');var util=require(_0x6fb5('0x0'));var path=require(_0x6fb5('0x1'));var timeout=require(_0x6fb5('0x2'));var express=require('express');var router=express[_0x6fb5('0x3')]();var fs_extra=require(_0x6fb5('0x4'));var auth=require(_0x6fb5('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x6fb5('0x6'));var controller=require(_0x6fb5('0x7'));router[_0x6fb5('0x8')]('/',auth[_0x6fb5('0x9')](),controller[_0x6fb5('0xa')]);router['get']('/describe',auth[_0x6fb5('0x9')](),controller[_0x6fb5('0xb')]);router[_0x6fb5('0x8')](_0x6fb5('0xc'),auth['isAuthenticated'](),controller[_0x6fb5('0xd')]);router['post']('/',auth[_0x6fb5('0x9')](),controller[_0x6fb5('0xe')]);router[_0x6fb5('0xf')]('/:id',auth[_0x6fb5('0x9')](),controller['update']);router[_0x6fb5('0x10')](_0x6fb5('0xc'),auth[_0x6fb5('0x9')](),controller[_0x6fb5('0x11')]);module[_0x6fb5('0x12')]=router; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js index 5ca7d58..8df2918 100644 --- a/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js +++ b/server/api/whatsappQueueReport/whatsappQueueReport.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['STRING','DATE','sequelize','exports'];(function(_0x573826,_0x2528ff){var _0x52e64e=function(_0x55d151){while(--_0x55d151){_0x573826['push'](_0x573826['shift']());}};_0x52e64e(++_0x2528ff);}(_0x7a54,0x106));var _0x47a5=function(_0x38750b,_0x12ab3b){_0x38750b=_0x38750b-0x0;var _0x28a0ef=_0x7a54[_0x38750b];return _0x28a0ef;};'use strict';var Sequelize=require(_0x47a5('0x0'));module[_0x47a5('0x1')]={'uniqueid':{'type':Sequelize[_0x47a5('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x47a5('0x3')]},'leaveAt':{'type':Sequelize[_0x47a5('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x47a5('0x3')]},'reason':{'type':Sequelize[_0x47a5('0x2')]}}; \ No newline at end of file +var _0x9957=['exports','STRING','DATE','sequelize'];(function(_0xc79be9,_0x580e0c){var _0xec4447=function(_0x16df79){while(--_0x16df79){_0xc79be9['push'](_0xc79be9['shift']());}};_0xec4447(++_0x580e0c);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x7995('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x7995('0x3')]},'acceptAt':{'type':Sequelize[_0x7995('0x3')]},'exitAt':{'type':Sequelize[_0x7995('0x3')]},'reason':{'type':Sequelize[_0x7995('0x2')]}}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.controller.js b/server/api/whatsappQueueReport/whatsappQueueReport.controller.js index 3de4baf..5fc7bd2 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 _0xf7b4=['../../config/environment','sendStatus','end','status','json','offset','undefined','count','limit','set','apply','reject','save','update','then','stack','name','send','index','map','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','WhatsappQueueReport','rows','catch','show','params','find','create','body','destroy','describe','eml-format','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x92c450,_0x41f1e3){var _0x2a9599=function(_0x4f27df){while(--_0x4f27df){_0x92c450['push'](_0x92c450['shift']());}};_0x2a9599(++_0x41f1e3);}(_0xf7b4,0x152));var _0x4f7b=function(_0x48c4b0,_0x6dfcba){_0x48c4b0=_0x48c4b0-0x0;var _0x1bfc9e=_0xf7b4[_0x48c4b0];return _0x1bfc9e;};'use strict';var emlformat=require(_0x4f7b('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x4f7b('0x1'));var rp=require(_0x4f7b('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x4f7b('0x3'));var util=require(_0x4f7b('0x4'));var path=require(_0x4f7b('0x5'));var sox=require(_0x4f7b('0x6'));var csv=require(_0x4f7b('0x7'));var ejs=require(_0x4f7b('0x8'));var fs=require('fs');var fs_extra=require(_0x4f7b('0x9'));var _=require(_0x4f7b('0xa'));var squel=require(_0x4f7b('0xb'));var crypto=require(_0x4f7b('0xc'));var jsforce=require(_0x4f7b('0xd'));var deskjs=require(_0x4f7b('0xe'));var toCsv=require(_0x4f7b('0x7'));var querystring=require('querystring');var Papa=require(_0x4f7b('0xf'));var Redis=require(_0x4f7b('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x4f7b('0x11'));var as=require(_0x4f7b('0x12'));var hardwareService=require(_0x4f7b('0x13'));var logger=require(_0x4f7b('0x14'))(_0x4f7b('0x15'));var utils=require('../../config/utils');var config=require(_0x4f7b('0x16'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xd9b349,_0x2e8dd9){_0x2e8dd9=_0x2e8dd9||0xcc;return function(_0x3c55e1){if(_0x3c55e1){return _0xd9b349[_0x4f7b('0x17')](_0x2e8dd9);}return _0xd9b349['status'](_0x2e8dd9)[_0x4f7b('0x18')]();};}function respondWithResult(_0x368091,_0x407cee){_0x407cee=_0x407cee||0xc8;return function(_0x43a51a){if(_0x43a51a){return _0x368091[_0x4f7b('0x19')](_0x407cee)[_0x4f7b('0x1a')](_0x43a51a);}};}function respondWithFilteredResult(_0x40ecb0,_0x2437cc){return function(_0x260667){if(_0x260667){var _0x29fdd5=typeof _0x2437cc[_0x4f7b('0x1b')]===_0x4f7b('0x1c')&&typeof _0x2437cc['limit']===_0x4f7b('0x1c');var _0x496322=_0x260667['count'];var _0x24e5cf=_0x29fdd5?0x0:_0x2437cc[_0x4f7b('0x1b')];var _0x519d90=_0x29fdd5?_0x260667[_0x4f7b('0x1d')]:_0x2437cc[_0x4f7b('0x1b')]+_0x2437cc[_0x4f7b('0x1e')];var _0xf2311f;if(_0x519d90>=_0x496322){_0x519d90=_0x496322;_0xf2311f=0xc8;}else{_0xf2311f=0xce;}_0x40ecb0['status'](_0xf2311f);return _0x40ecb0[_0x4f7b('0x1f')]('Content-Range',_0x24e5cf+'-'+_0x519d90+'/'+_0x496322)[_0x4f7b('0x1a')](_0x260667);}return null;};}function patchUpdates(_0x12374b){return function(_0xa2f54e){try{jsonpatch[_0x4f7b('0x20')](_0xa2f54e,_0x12374b,!![]);}catch(_0x27127b){return BPromise[_0x4f7b('0x21')](_0x27127b);}return _0xa2f54e[_0x4f7b('0x22')]();};}function saveUpdates(_0x1f545e,_0x2a8b50){return function(_0x5508bd){if(_0x5508bd){return _0x5508bd[_0x4f7b('0x23')](_0x1f545e)[_0x4f7b('0x24')](function(_0x2c9ea6){return _0x2c9ea6;});}return null;};}function removeEntity(_0x5bd43f,_0x150f57){return function(_0x4610a4){if(_0x4610a4){return _0x4610a4['destroy']()[_0x4f7b('0x24')](function(){_0x5bd43f['status'](0xcc)[_0x4f7b('0x18')]();});}};}function handleEntityNotFound(_0x2429be,_0x23c820){return function(_0x278c41){if(!_0x278c41){_0x2429be[_0x4f7b('0x17')](0x194);}return _0x278c41;};}function handleError(_0x94478b,_0x181e13){_0x181e13=_0x181e13||0x1f4;return function(_0x3ad769){logger['error'](_0x3ad769[_0x4f7b('0x25')]);if(_0x3ad769[_0x4f7b('0x26')]){delete _0x3ad769[_0x4f7b('0x26')];}_0x94478b['status'](_0x181e13)[_0x4f7b('0x27')](_0x3ad769);};}exports[_0x4f7b('0x28')]=function(_0x1db684,_0x3a56ff){var _0x1ccce0={},_0x4ebffa={},_0xac1f93={'count':0x0,'rows':[]};var _0x3331b2=_[_0x4f7b('0x29')](db['WhatsappQueueReport'][_0x4f7b('0x2a')],function(_0x5d13a1){return{'name':_0x5d13a1['fieldName'],'type':_0x5d13a1[_0x4f7b('0x2b')]['key']};});_0x4ebffa[_0x4f7b('0x2c')]=_[_0x4f7b('0x29')](_0x3331b2,_0x4f7b('0x26'));_0x4ebffa[_0x4f7b('0x2d')]=_[_0x4f7b('0x2e')](_0x1db684[_0x4f7b('0x2d')]);_0x4ebffa[_0x4f7b('0x2f')]=_[_0x4f7b('0x30')](_0x4ebffa[_0x4f7b('0x2c')],_0x4ebffa[_0x4f7b('0x2d')]);_0x1ccce0[_0x4f7b('0x31')]=_[_0x4f7b('0x30')](_0x4ebffa[_0x4f7b('0x2c')],qs[_0x4f7b('0x32')](_0x1db684[_0x4f7b('0x2d')][_0x4f7b('0x32')]));_0x1ccce0[_0x4f7b('0x31')]=_0x1ccce0[_0x4f7b('0x31')][_0x4f7b('0x33')]?_0x1ccce0[_0x4f7b('0x31')]:_0x4ebffa[_0x4f7b('0x2c')];if(!_0x1db684[_0x4f7b('0x2d')]['hasOwnProperty'](_0x4f7b('0x34'))){_0x1ccce0['limit']=qs[_0x4f7b('0x1e')](_0x1db684[_0x4f7b('0x2d')]['limit']);_0x1ccce0[_0x4f7b('0x1b')]=qs[_0x4f7b('0x1b')](_0x1db684[_0x4f7b('0x2d')]['offset']);}_0x1ccce0[_0x4f7b('0x35')]=qs[_0x4f7b('0x36')](_0x1db684[_0x4f7b('0x2d')][_0x4f7b('0x36')]);_0x1ccce0[_0x4f7b('0x37')]=qs[_0x4f7b('0x2f')](_[_0x4f7b('0x38')](_0x1db684['query'],_0x4ebffa[_0x4f7b('0x2f')]),_0x3331b2);if(_0x1db684['query'][_0x4f7b('0x39')]){_0x1ccce0[_0x4f7b('0x37')]=_[_0x4f7b('0x3a')](_0x1ccce0['where'],{'$or':_[_0x4f7b('0x29')](_0x3331b2,function(_0x53da14){if(_0x53da14[_0x4f7b('0x2b')]!==_0x4f7b('0x3b')){var _0x49644e={};_0x49644e[_0x53da14['name']]={'$like':'%'+_0x1db684[_0x4f7b('0x2d')]['filter']+'%'};return _0x49644e;}})});}_0x1ccce0=_[_0x4f7b('0x3a')]({},_0x1ccce0,_0x1db684[_0x4f7b('0x3c')]);var _0x54f9e8={'where':_0x1ccce0[_0x4f7b('0x37')]};return db['WhatsappQueueReport']['count'](_0x54f9e8)['then'](function(_0x1e4421){_0xac1f93[_0x4f7b('0x1d')]=_0x1e4421;if(_0x1db684[_0x4f7b('0x2d')][_0x4f7b('0x3d')]){_0x1ccce0['include']=[{'all':!![]}];}return db[_0x4f7b('0x3e')]['findAll'](_0x1ccce0);})[_0x4f7b('0x24')](function(_0x586406){_0xac1f93[_0x4f7b('0x3f')]=_0x586406;return _0xac1f93;})['then'](respondWithFilteredResult(_0x3a56ff,_0x1ccce0))[_0x4f7b('0x40')](handleError(_0x3a56ff,null));};exports[_0x4f7b('0x41')]=function(_0x302163,_0x3ab08f){var _0x2986cd={'raw':!![],'where':{'id':_0x302163[_0x4f7b('0x42')]['id']}},_0x325cd6={};_0x325cd6[_0x4f7b('0x2c')]=_[_0x4f7b('0x2e')](db[_0x4f7b('0x3e')][_0x4f7b('0x2a')]);_0x325cd6[_0x4f7b('0x2d')]=_[_0x4f7b('0x2e')](_0x302163[_0x4f7b('0x2d')]);_0x325cd6[_0x4f7b('0x2f')]=_[_0x4f7b('0x30')](_0x325cd6[_0x4f7b('0x2c')],_0x325cd6[_0x4f7b('0x2d')]);_0x2986cd['attributes']=_['intersection'](_0x325cd6[_0x4f7b('0x2c')],qs[_0x4f7b('0x32')](_0x302163[_0x4f7b('0x2d')][_0x4f7b('0x32')]));_0x2986cd['attributes']=_0x2986cd['attributes'][_0x4f7b('0x33')]?_0x2986cd[_0x4f7b('0x31')]:_0x325cd6[_0x4f7b('0x2c')];if(_0x302163[_0x4f7b('0x2d')]['includeAll']){_0x2986cd['include']=[{'all':!![]}];}_0x2986cd=_[_0x4f7b('0x3a')]({},_0x2986cd,_0x302163[_0x4f7b('0x3c')]);return db[_0x4f7b('0x3e')][_0x4f7b('0x43')](_0x2986cd)[_0x4f7b('0x24')](handleEntityNotFound(_0x3ab08f,null))['then'](respondWithResult(_0x3ab08f,null))[_0x4f7b('0x40')](handleError(_0x3ab08f,null));};exports[_0x4f7b('0x44')]=function(_0x35c0ea,_0x5df68e){return db[_0x4f7b('0x3e')][_0x4f7b('0x44')](_0x35c0ea[_0x4f7b('0x45')],{})[_0x4f7b('0x24')](respondWithResult(_0x5df68e,0xc9))[_0x4f7b('0x40')](handleError(_0x5df68e,null));};exports[_0x4f7b('0x23')]=function(_0xee485,_0x2e563f){if(_0xee485[_0x4f7b('0x45')]['id']){delete _0xee485[_0x4f7b('0x45')]['id'];}return db['WhatsappQueueReport'][_0x4f7b('0x43')]({'where':{'id':_0xee485[_0x4f7b('0x42')]['id']}})[_0x4f7b('0x24')](handleEntityNotFound(_0x2e563f,null))['then'](saveUpdates(_0xee485[_0x4f7b('0x45')],null))[_0x4f7b('0x24')](respondWithResult(_0x2e563f,null))[_0x4f7b('0x40')](handleError(_0x2e563f,null));};exports[_0x4f7b('0x46')]=function(_0x145dd7,_0x7e624){return db[_0x4f7b('0x3e')][_0x4f7b('0x43')]({'where':{'id':_0x145dd7[_0x4f7b('0x42')]['id']}})[_0x4f7b('0x24')](handleEntityNotFound(_0x7e624,null))['then'](removeEntity(_0x7e624,null))[_0x4f7b('0x40')](handleError(_0x7e624,null));};exports[_0x4f7b('0x47')]=function(_0x12b6a6,_0x4d1ac9){return db[_0x4f7b('0x3e')][_0x4f7b('0x47')]()[_0x4f7b('0x24')](respondWithResult(_0x4d1ac9,null))[_0x4f7b('0x40')](handleError(_0x4d1ac9,null));}; \ No newline at end of file +var _0x57f8=['filters','pick','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','destroy','then','error','stack','name','send','index','map','WhatsappQueueReport','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','hasOwnProperty','sort'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0x57f8,0x198));var _0x857f=function(_0x589274,_0xa3f1bd){_0x589274=_0x589274-0x0;var _0x21814b=_0x57f8[_0x589274];return _0x21814b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x857f('0x0'));var zipdir=require(_0x857f('0x1'));var jsonpatch=require(_0x857f('0x2'));var rp=require(_0x857f('0x3'));var moment=require(_0x857f('0x4'));var BPromise=require(_0x857f('0x5'));var Mustache=require(_0x857f('0x6'));var util=require(_0x857f('0x7'));var path=require(_0x857f('0x8'));var sox=require(_0x857f('0x9'));var csv=require(_0x857f('0xa'));var ejs=require(_0x857f('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x857f('0xc'));var squel=require(_0x857f('0xd'));var crypto=require(_0x857f('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x857f('0xf'));var toCsv=require(_0x857f('0xa'));var querystring=require(_0x857f('0x10'));var Papa=require('papaparse');var Redis=require(_0x857f('0x11'));var authService=require(_0x857f('0x12'));var qs=require(_0x857f('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x857f('0x14'));var logger=require(_0x857f('0x15'))(_0x857f('0x16'));var utils=require(_0x857f('0x17'));var config=require(_0x857f('0x18'));var licenseUtil=require(_0x857f('0x19'));var db=require(_0x857f('0x1a'))['db'];function respondWithStatusCode(_0x533631,_0x2e1eda){_0x2e1eda=_0x2e1eda||0xcc;return function(_0x2d5e26){if(_0x2d5e26){return _0x533631[_0x857f('0x1b')](_0x2e1eda);}return _0x533631[_0x857f('0x1c')](_0x2e1eda)[_0x857f('0x1d')]();};}function respondWithResult(_0x4a25ec,_0x4bc590){_0x4bc590=_0x4bc590||0xc8;return function(_0x3b09d9){if(_0x3b09d9){return _0x4a25ec['status'](_0x4bc590)[_0x857f('0x1e')](_0x3b09d9);}};}function respondWithFilteredResult(_0x4ac81f,_0x1d47bf){return function(_0x134a4f){if(_0x134a4f){var _0x5c3a69=typeof _0x1d47bf[_0x857f('0x1f')]===_0x857f('0x20')&&typeof _0x1d47bf[_0x857f('0x21')]===_0x857f('0x20');var _0x279e74=_0x134a4f[_0x857f('0x22')];var _0x1a9ef8=_0x5c3a69?0x0:_0x1d47bf[_0x857f('0x1f')];var _0x1014ca=_0x5c3a69?_0x134a4f[_0x857f('0x22')]:_0x1d47bf[_0x857f('0x1f')]+_0x1d47bf['limit'];var _0x1729d8;if(_0x1014ca>=_0x279e74){_0x1014ca=_0x279e74;_0x1729d8=0xc8;}else{_0x1729d8=0xce;}_0x4ac81f[_0x857f('0x1c')](_0x1729d8);return _0x4ac81f['set'](_0x857f('0x23'),_0x1a9ef8+'-'+_0x1014ca+'/'+_0x279e74)[_0x857f('0x1e')](_0x134a4f);}return null;};}function patchUpdates(_0x377587){return function(_0x484035){try{jsonpatch['apply'](_0x484035,_0x377587,!![]);}catch(_0x12ee77){return BPromise[_0x857f('0x24')](_0x12ee77);}return _0x484035[_0x857f('0x25')]();};}function saveUpdates(_0x4fa031,_0x118237){return function(_0x17a98e){if(_0x17a98e){return _0x17a98e[_0x857f('0x26')](_0x4fa031)['then'](function(_0x1961ea){return _0x1961ea;});}return null;};}function removeEntity(_0x14a8ce,_0x50bfb7){return function(_0x3bc543){if(_0x3bc543){return _0x3bc543[_0x857f('0x27')]()[_0x857f('0x28')](function(){_0x14a8ce[_0x857f('0x1c')](0xcc)[_0x857f('0x1d')]();});}};}function handleEntityNotFound(_0x3b23a7,_0x233a68){return function(_0x2a89ba){if(!_0x2a89ba){_0x3b23a7[_0x857f('0x1b')](0x194);}return _0x2a89ba;};}function handleError(_0xcd1ee9,_0x72f0aa){_0x72f0aa=_0x72f0aa||0x1f4;return function(_0x4782ab){logger[_0x857f('0x29')](_0x4782ab[_0x857f('0x2a')]);if(_0x4782ab['name']){delete _0x4782ab[_0x857f('0x2b')];}_0xcd1ee9[_0x857f('0x1c')](_0x72f0aa)[_0x857f('0x2c')](_0x4782ab);};}exports[_0x857f('0x2d')]=function(_0x58c2de,_0x40c306){var _0x57ceaa={},_0x1b405a={},_0x234048={'count':0x0,'rows':[]};var _0x45a37f=_[_0x857f('0x2e')](db[_0x857f('0x2f')][_0x857f('0x30')],function(_0x1c4fff){return{'name':_0x1c4fff[_0x857f('0x31')],'type':_0x1c4fff[_0x857f('0x32')][_0x857f('0x33')]};});_0x1b405a[_0x857f('0x34')]=_[_0x857f('0x2e')](_0x45a37f,_0x857f('0x2b'));_0x1b405a['query']=_[_0x857f('0x35')](_0x58c2de[_0x857f('0x36')]);_0x1b405a['filters']=_[_0x857f('0x37')](_0x1b405a[_0x857f('0x34')],_0x1b405a['query']);_0x57ceaa[_0x857f('0x38')]=_[_0x857f('0x37')](_0x1b405a['model'],qs[_0x857f('0x39')](_0x58c2de[_0x857f('0x36')][_0x857f('0x39')]));_0x57ceaa[_0x857f('0x38')]=_0x57ceaa['attributes']['length']?_0x57ceaa[_0x857f('0x38')]:_0x1b405a[_0x857f('0x34')];if(!_0x58c2de['query'][_0x857f('0x3a')]('nolimit')){_0x57ceaa[_0x857f('0x21')]=qs[_0x857f('0x21')](_0x58c2de[_0x857f('0x36')][_0x857f('0x21')]);_0x57ceaa[_0x857f('0x1f')]=qs['offset'](_0x58c2de['query'][_0x857f('0x1f')]);}_0x57ceaa['order']=qs[_0x857f('0x3b')](_0x58c2de[_0x857f('0x36')][_0x857f('0x3b')]);_0x57ceaa['where']=qs[_0x857f('0x3c')](_[_0x857f('0x3d')](_0x58c2de[_0x857f('0x36')],_0x1b405a[_0x857f('0x3c')]),_0x45a37f);if(_0x58c2de[_0x857f('0x36')][_0x857f('0x3e')]){_0x57ceaa[_0x857f('0x3f')]=_['merge'](_0x57ceaa[_0x857f('0x3f')],{'$or':_[_0x857f('0x2e')](_0x45a37f,function(_0x1f285c){if(_0x1f285c[_0x857f('0x32')]!==_0x857f('0x40')){var _0x2356fb={};_0x2356fb[_0x1f285c[_0x857f('0x2b')]]={'$like':'%'+_0x58c2de['query'][_0x857f('0x3e')]+'%'};return _0x2356fb;}})});}_0x57ceaa=_[_0x857f('0x41')]({},_0x57ceaa,_0x58c2de[_0x857f('0x42')]);var _0xc2ac41={'where':_0x57ceaa[_0x857f('0x3f')]};return db[_0x857f('0x2f')]['count'](_0xc2ac41)[_0x857f('0x28')](function(_0x354678){_0x234048[_0x857f('0x22')]=_0x354678;if(_0x58c2de[_0x857f('0x36')][_0x857f('0x43')]){_0x57ceaa[_0x857f('0x44')]=[{'all':!![]}];}return db[_0x857f('0x2f')][_0x857f('0x45')](_0x57ceaa);})['then'](function(_0x40fb37){_0x234048[_0x857f('0x46')]=_0x40fb37;return _0x234048;})[_0x857f('0x28')](respondWithFilteredResult(_0x40c306,_0x57ceaa))[_0x857f('0x47')](handleError(_0x40c306,null));};exports[_0x857f('0x48')]=function(_0x1bbf9f,_0x374b9f){var _0x42d922={'raw':!![],'where':{'id':_0x1bbf9f[_0x857f('0x49')]['id']}},_0xb4d7c2={};_0xb4d7c2[_0x857f('0x34')]=_[_0x857f('0x35')](db[_0x857f('0x2f')][_0x857f('0x30')]);_0xb4d7c2['query']=_[_0x857f('0x35')](_0x1bbf9f['query']);_0xb4d7c2[_0x857f('0x3c')]=_[_0x857f('0x37')](_0xb4d7c2[_0x857f('0x34')],_0xb4d7c2[_0x857f('0x36')]);_0x42d922[_0x857f('0x38')]=_[_0x857f('0x37')](_0xb4d7c2[_0x857f('0x34')],qs[_0x857f('0x39')](_0x1bbf9f[_0x857f('0x36')][_0x857f('0x39')]));_0x42d922[_0x857f('0x38')]=_0x42d922['attributes']['length']?_0x42d922[_0x857f('0x38')]:_0xb4d7c2['model'];if(_0x1bbf9f[_0x857f('0x36')]['includeAll']){_0x42d922[_0x857f('0x44')]=[{'all':!![]}];}_0x42d922=_[_0x857f('0x41')]({},_0x42d922,_0x1bbf9f[_0x857f('0x42')]);return db[_0x857f('0x2f')][_0x857f('0x4a')](_0x42d922)[_0x857f('0x28')](handleEntityNotFound(_0x374b9f,null))[_0x857f('0x28')](respondWithResult(_0x374b9f,null))[_0x857f('0x47')](handleError(_0x374b9f,null));};exports['create']=function(_0x42cf05,_0x3b431d){return db[_0x857f('0x2f')][_0x857f('0x4b')](_0x42cf05['body'],{})[_0x857f('0x28')](respondWithResult(_0x3b431d,0xc9))[_0x857f('0x47')](handleError(_0x3b431d,null));};exports[_0x857f('0x26')]=function(_0x736ef6,_0x67563){if(_0x736ef6['body']['id']){delete _0x736ef6[_0x857f('0x4c')]['id'];}return db[_0x857f('0x2f')]['find']({'where':{'id':_0x736ef6[_0x857f('0x49')]['id']}})[_0x857f('0x28')](handleEntityNotFound(_0x67563,null))['then'](saveUpdates(_0x736ef6[_0x857f('0x4c')],null))['then'](respondWithResult(_0x67563,null))[_0x857f('0x47')](handleError(_0x67563,null));};exports[_0x857f('0x27')]=function(_0x446fe9,_0x2008d5){return db[_0x857f('0x2f')][_0x857f('0x4a')]({'where':{'id':_0x446fe9[_0x857f('0x49')]['id']}})[_0x857f('0x28')](handleEntityNotFound(_0x2008d5,null))[_0x857f('0x28')](removeEntity(_0x2008d5,null))[_0x857f('0x47')](handleError(_0x2008d5,null));};exports['describe']=function(_0x5464f4,_0x13ef75){return db[_0x857f('0x2f')][_0x857f('0x4d')]()[_0x857f('0x28')](respondWithResult(_0x13ef75,null))[_0x857f('0x47')](handleError(_0x13ef75,null));}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.model.js b/server/api/whatsappQueueReport/whatsappQueueReport.model.js index f5a4f74..a0bcd70 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 _0x368d=['request-promise','path','rimraf','../../config/environment','exports','define','WhatsappQueueReport','report_whatsapp_queue','uniqueid','lodash','util','../../config/logger','api','bluebird'];(function(_0xfcd380,_0x14b3b2){var _0x3971f0=function(_0x181bc9){while(--_0x181bc9){_0xfcd380['push'](_0xfcd380['shift']());}};_0x3971f0(++_0x14b3b2);}(_0x368d,0xbf));var _0xd368=function(_0x2085e8,_0x17d6e1){_0x2085e8=_0x2085e8-0x0;var _0x524253=_0x368d[_0x2085e8];return _0x524253;};'use strict';var _=require(_0xd368('0x0'));var util=require(_0xd368('0x1'));var logger=require(_0xd368('0x2'))(_0xd368('0x3'));var moment=require('moment');var BPromise=require(_0xd368('0x4'));var rp=require(_0xd368('0x5'));var fs=require('fs');var path=require(_0xd368('0x6'));var rimraf=require(_0xd368('0x7'));var config=require(_0xd368('0x8'));var attributes=require('./whatsappQueueReport.attributes');module[_0xd368('0x9')]=function(_0x1a7026,_0x687399){return _0x1a7026[_0xd368('0xa')](_0xd368('0xb'),attributes,{'tableName':_0xd368('0xc'),'paranoid':![],'indexes':[{'name':_0xd368('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x924c=['lodash','api','moment','bluebird','path','../../config/environment','./whatsappQueueReport.attributes','exports','define','WhatsappQueueReport','uniqueid'];(function(_0x1341e3,_0x5b1a94){var _0x3f5f18=function(_0x5091c8){while(--_0x5091c8){_0x1341e3['push'](_0x1341e3['shift']());}};_0x3f5f18(++_0x5b1a94);}(_0x924c,0x1e4));var _0xc924=function(_0x15f2ac,_0xd6ae79){_0x15f2ac=_0x15f2ac-0x0;var _0x343256=_0x924c[_0x15f2ac];return _0x343256;};'use strict';var _=require(_0xc924('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xc924('0x1'));var moment=require(_0xc924('0x2'));var BPromise=require(_0xc924('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc924('0x4'));var rimraf=require('rimraf');var config=require(_0xc924('0x5'));var attributes=require(_0xc924('0x6'));module[_0xc924('0x7')]=function(_0x553000,_0x432ee2){return _0x553000[_0xc924('0x8')](_0xc924('0x9'),attributes,{'tableName':'report_whatsapp_queue','paranoid':![],'indexes':[{'name':_0xc924('0xa'),'fields':[_0xc924('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js b/server/api/whatsappQueueReport/whatsappQueueReport.rpc.js index 36fa7ad..06ab9bc 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 _0x7a7b=['create','body','options','UpdateWhatsappQueueReport','WhatsappQueueReport','update','raw','where','limit','lodash','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','http','request','then','info','WhatsappQueueReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','CreateWhatsappQueueReport'];(function(_0xe27393,_0x1bed7f){var _0x42636e=function(_0x24ea2a){while(--_0x24ea2a){_0xe27393['push'](_0xe27393['shift']());}};_0x42636e(++_0x1bed7f);}(_0x7a7b,0x101));var _0xb7a7=function(_0xee6752,_0x667b44){_0xee6752=_0xee6752-0x0;var _0xb4dcea=_0x7a7b[_0xee6752];return _0xb4dcea;};'use strict';var _=require(_0xb7a7('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xb7a7('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb7a7('0x2'));var db=require(_0xb7a7('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xb7a7('0x4'))(_0xb7a7('0x5'));var config=require('../../config/environment');var jayson=require(_0xb7a7('0x6'));var client=jayson['client'][_0xb7a7('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x42a4f2,_0x4abea3,_0x2c0a61){return new BPromise(function(_0x50b3c0,_0x393cc9){return client[_0xb7a7('0x8')](_0x42a4f2,_0x2c0a61)[_0xb7a7('0x9')](function(_0x340118){logger[_0xb7a7('0xa')](_0xb7a7('0xb'),_0x4abea3,_0xb7a7('0xc'));logger[_0xb7a7('0xd')](_0xb7a7('0xe'),_0x4abea3,_0xb7a7('0xc'),JSON[_0xb7a7('0xf')](_0x340118));if(_0x340118['error']){if(_0x340118['error'][_0xb7a7('0x10')]===0x1f4){logger['error'](_0xb7a7('0xb'),_0x4abea3,_0x340118['error']['message']);return _0x393cc9(_0x340118[_0xb7a7('0x11')][_0xb7a7('0x12')]);}logger[_0xb7a7('0x11')](_0xb7a7('0xb'),_0x4abea3,_0x340118['error'][_0xb7a7('0x12')]);return _0x50b3c0(_0x340118['error'][_0xb7a7('0x12')]);}else{logger[_0xb7a7('0xa')](_0xb7a7('0xb'),_0x4abea3,_0xb7a7('0xc'));_0x50b3c0(_0x340118[_0xb7a7('0x13')]['message']);}})[_0xb7a7('0x14')](function(_0x5c77e8){logger['error'](_0xb7a7('0xb'),_0x4abea3,_0x5c77e8);_0x393cc9(_0x5c77e8);});});}exports[_0xb7a7('0x15')]=function(_0x5eb7ba){var _0x155ed5=this;return new Promise(function(_0x569e5f,_0x49d811){return db['WhatsappQueueReport'][_0xb7a7('0x16')](_0x5eb7ba[_0xb7a7('0x17')],{'raw':_0x5eb7ba[_0xb7a7('0x18')]?_0x5eb7ba[_0xb7a7('0x18')]['raw']===undefined?!![]:![]:!![]})[_0xb7a7('0x9')](function(_0x1198ca){logger[_0xb7a7('0xa')](_0xb7a7('0x15'),_0x5eb7ba);logger[_0xb7a7('0xd')](_0xb7a7('0x15'),_0x5eb7ba,JSON[_0xb7a7('0xf')](_0x1198ca));_0x569e5f(_0x1198ca);})[_0xb7a7('0x14')](function(_0x5907db){logger[_0xb7a7('0x11')](_0xb7a7('0x15'),_0x5907db[_0xb7a7('0x12')],_0x5eb7ba);_0x49d811(_0x155ed5['error'](0x1f4,_0x5907db[_0xb7a7('0x12')]));});});};exports[_0xb7a7('0x19')]=function(_0x18cc12){var _0x3508c7=this;return new Promise(function(_0x5d4caa,_0x2b776f){return db[_0xb7a7('0x1a')][_0xb7a7('0x1b')](_0x18cc12[_0xb7a7('0x17')],{'raw':_0x18cc12[_0xb7a7('0x18')]?_0x18cc12[_0xb7a7('0x18')][_0xb7a7('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x18cc12[_0xb7a7('0x18')]?_0x18cc12[_0xb7a7('0x18')][_0xb7a7('0x1d')]||null:null,'attributes':_0x18cc12[_0xb7a7('0x18')]?_0x18cc12['options']['attributes']||null:null,'limit':_0x18cc12[_0xb7a7('0x18')]?_0x18cc12[_0xb7a7('0x18')][_0xb7a7('0x1e')]||null:null})['then'](function(_0x4ba1de){logger['info'](_0xb7a7('0x19'),_0x18cc12);logger[_0xb7a7('0xd')]('UpdateWhatsappQueueReport',_0x18cc12,JSON[_0xb7a7('0xf')](_0x4ba1de));_0x5d4caa(_0x4ba1de);})[_0xb7a7('0x14')](function(_0x372f3d){logger[_0xb7a7('0x11')]('UpdateWhatsappQueueReport',_0x372f3d[_0xb7a7('0x12')],_0x18cc12);_0x2b776f(_0x3508c7[_0xb7a7('0x11')](0x1f4,_0x372f3d[_0xb7a7('0x12')]));});});}; \ No newline at end of file +var _0xd1d2=['../../config/environment','jayson/promise','client','then','info','request\x20sent','debug','WhatsappQueueReport,\x20%s,\x20%s,\x20%s','error','message','WhatsappQueueReport,\x20%s,\x20%s','result','catch','CreateWhatsappQueueReport','WhatsappQueueReport','body','options','raw','stringify','UpdateWhatsappQueueReport','limit','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x318f76,_0x2e7558){var _0x45eef6=function(_0x3c594e){while(--_0x3c594e){_0x318f76['push'](_0x318f76['shift']());}};_0x45eef6(++_0x2e7558);}(_0xd1d2,0xa1));var _0x2d1d=function(_0x1e4d7e,_0x45e3ba){_0x1e4d7e=_0x1e4d7e-0x0;var _0x275eb3=_0xd1d2[_0x1e4d7e];return _0x275eb3;};'use strict';var _=require('lodash');var util=require(_0x2d1d('0x0'));var moment=require('moment');var BPromise=require(_0x2d1d('0x1'));var rs=require(_0x2d1d('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2d1d('0x3'))['db'];var utils=require(_0x2d1d('0x4'));var logger=require(_0x2d1d('0x5'))(_0x2d1d('0x6'));var config=require(_0x2d1d('0x7'));var jayson=require(_0x2d1d('0x8'));var client=jayson[_0x2d1d('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x146c13,_0x53478d,_0x2cb8fd){return new BPromise(function(_0xef8827,_0x298210){return client['request'](_0x146c13,_0x2cb8fd)[_0x2d1d('0xa')](function(_0x22864a){logger[_0x2d1d('0xb')]('WhatsappQueueReport,\x20%s,\x20%s',_0x53478d,_0x2d1d('0xc'));logger[_0x2d1d('0xd')](_0x2d1d('0xe'),_0x53478d,'request\x20sent',JSON['stringify'](_0x22864a));if(_0x22864a[_0x2d1d('0xf')]){if(_0x22864a[_0x2d1d('0xf')]['code']===0x1f4){logger[_0x2d1d('0xf')]('WhatsappQueueReport,\x20%s,\x20%s',_0x53478d,_0x22864a[_0x2d1d('0xf')][_0x2d1d('0x10')]);return _0x298210(_0x22864a[_0x2d1d('0xf')]['message']);}logger[_0x2d1d('0xf')](_0x2d1d('0x11'),_0x53478d,_0x22864a[_0x2d1d('0xf')][_0x2d1d('0x10')]);return _0xef8827(_0x22864a[_0x2d1d('0xf')]['message']);}else{logger[_0x2d1d('0xb')](_0x2d1d('0x11'),_0x53478d,_0x2d1d('0xc'));_0xef8827(_0x22864a[_0x2d1d('0x12')]['message']);}})[_0x2d1d('0x13')](function(_0x52ca5f){logger[_0x2d1d('0xf')](_0x2d1d('0x11'),_0x53478d,_0x52ca5f);_0x298210(_0x52ca5f);});});}exports[_0x2d1d('0x14')]=function(_0x4394ca){var _0x47c05e=this;return new Promise(function(_0x19fb75,_0x4fd0c8){return db[_0x2d1d('0x15')]['create'](_0x4394ca[_0x2d1d('0x16')],{'raw':_0x4394ca[_0x2d1d('0x17')]?_0x4394ca['options'][_0x2d1d('0x18')]===undefined?!![]:![]:!![]})[_0x2d1d('0xa')](function(_0x338d19){logger[_0x2d1d('0xb')](_0x2d1d('0x14'),_0x4394ca);logger[_0x2d1d('0xd')]('CreateWhatsappQueueReport',_0x4394ca,JSON[_0x2d1d('0x19')](_0x338d19));_0x19fb75(_0x338d19);})['catch'](function(_0x45f3ce){logger[_0x2d1d('0xf')](_0x2d1d('0x14'),_0x45f3ce[_0x2d1d('0x10')],_0x4394ca);_0x4fd0c8(_0x47c05e[_0x2d1d('0xf')](0x1f4,_0x45f3ce[_0x2d1d('0x10')]));});});};exports[_0x2d1d('0x1a')]=function(_0x22f01a){var _0x45bbcb=this;return new Promise(function(_0x400b9b,_0x1bb0e1){return db[_0x2d1d('0x15')]['update'](_0x22f01a[_0x2d1d('0x16')],{'raw':_0x22f01a[_0x2d1d('0x17')]?_0x22f01a[_0x2d1d('0x17')][_0x2d1d('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x22f01a[_0x2d1d('0x17')]?_0x22f01a[_0x2d1d('0x17')]['where']||null:null,'attributes':_0x22f01a[_0x2d1d('0x17')]?_0x22f01a['options']['attributes']||null:null,'limit':_0x22f01a[_0x2d1d('0x17')]?_0x22f01a[_0x2d1d('0x17')][_0x2d1d('0x1b')]||null:null})['then'](function(_0x4e974b){logger[_0x2d1d('0xb')]('UpdateWhatsappQueueReport',_0x22f01a);logger[_0x2d1d('0xd')](_0x2d1d('0x1a'),_0x22f01a,JSON[_0x2d1d('0x19')](_0x4e974b));_0x400b9b(_0x4e974b);})[_0x2d1d('0x13')](function(_0x3ab92d){logger[_0x2d1d('0xf')](_0x2d1d('0x1a'),_0x3ab92d[_0x2d1d('0x10')],_0x22f01a);_0x1bb0e1(_0x45bbcb[_0x2d1d('0xf')](0x1f4,_0x3ab92d[_0x2d1d('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/index.js b/server/api/whatsappTransferReport/index.js index 500fc54..cce479c 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 _0xb289=['index','/describe','isAuthenticated','describe','/:id','show','post','create','put','delete','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappTransferReport.controller','get'];(function(_0x725b8e,_0xc22b48){var _0x43ac45=function(_0x46bb4a){while(--_0x46bb4a){_0x725b8e['push'](_0x725b8e['shift']());}};_0x43ac45(++_0xc22b48);}(_0xb289,0x170));var _0x9b28=function(_0x53c1d9,_0x3fbdd5){_0x53c1d9=_0x53c1d9-0x0;var _0x3487e0=_0xb289[_0x53c1d9];return _0x3487e0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9b28('0x0'));var timeout=require(_0x9b28('0x1'));var express=require(_0x9b28('0x2'));var router=express[_0x9b28('0x3')]();var fs_extra=require(_0x9b28('0x4'));var auth=require(_0x9b28('0x5'));var interaction=require(_0x9b28('0x6'));var config=require(_0x9b28('0x7'));var controller=require(_0x9b28('0x8'));router[_0x9b28('0x9')]('/',auth['isAuthenticated'](),controller[_0x9b28('0xa')]);router[_0x9b28('0x9')](_0x9b28('0xb'),auth[_0x9b28('0xc')](),controller[_0x9b28('0xd')]);router[_0x9b28('0x9')](_0x9b28('0xe'),auth['isAuthenticated'](),controller[_0x9b28('0xf')]);router[_0x9b28('0x10')]('/',auth[_0x9b28('0xc')](),controller[_0x9b28('0x11')]);router[_0x9b28('0x12')]('/:id',auth[_0x9b28('0xc')](),controller['update']);router[_0x9b28('0x13')]('/:id',auth[_0x9b28('0xc')](),controller['destroy']);module[_0x9b28('0x14')]=router; \ No newline at end of file +var _0xe165=['post','isAuthenticated','put','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./whatsappTransferReport.controller','get','index','describe','/:id','show'];(function(_0x3dae7f,_0x166145){var _0x1cb5c3=function(_0xc43269){while(--_0xc43269){_0x3dae7f['push'](_0x3dae7f['shift']());}};_0x1cb5c3(++_0x166145);}(_0xe165,0x196));var _0x5e16=function(_0x9868ee,_0x5945ae){_0x9868ee=_0x9868ee-0x0;var _0x950eea=_0xe165[_0x9868ee];return _0x950eea;};'use strict';var multer=require(_0x5e16('0x0'));var util=require(_0x5e16('0x1'));var path=require(_0x5e16('0x2'));var timeout=require('connect-timeout');var express=require(_0x5e16('0x3'));var router=express[_0x5e16('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x5e16('0x5'));var interaction=require(_0x5e16('0x6'));var config=require(_0x5e16('0x7'));var controller=require(_0x5e16('0x8'));router[_0x5e16('0x9')]('/',auth['isAuthenticated'](),controller[_0x5e16('0xa')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x5e16('0xb')]);router[_0x5e16('0x9')](_0x5e16('0xc'),auth['isAuthenticated'](),controller[_0x5e16('0xd')]);router[_0x5e16('0xe')]('/',auth[_0x5e16('0xf')](),controller['create']);router[_0x5e16('0x10')](_0x5e16('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x5e16('0x11')](_0x5e16('0xc'),auth['isAuthenticated'](),controller[_0x5e16('0x12')]);module[_0x5e16('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 d005cce..873335e 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 _0xc04a=['agent','queue','sequelize','STRING','account'];(function(_0x40c258,_0x5bc9af){var _0x6ce65a=function(_0x53a0bf){while(--_0x53a0bf){_0x40c258['push'](_0x40c258['shift']());}};_0x6ce65a(++_0x5bc9af);}(_0xc04a,0x12e));var _0xac04=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc04a[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xac04('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xac04('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xac04('0x2'),_0xac04('0x3'),_0xac04('0x4')),'allowNull':![]},'transferredAt':{'type':Sequelize['DATE']}}; \ No newline at end of file +var _0x2cae=['account','agent','DATE','sequelize','exports'];(function(_0x4d40dd,_0x39592b){var _0x1c51f2=function(_0x53e502){while(--_0x53e502){_0x4d40dd['push'](_0x4d40dd['shift']());}};_0x1c51f2(++_0x39592b);}(_0x2cae,0x16b));var _0xe2ca=function(_0x1db831,_0x42b7b5){_0x1db831=_0x1db831-0x0;var _0x39ba56=_0x2cae[_0x1db831];return _0x39ba56;};'use strict';var Sequelize=require(_0xe2ca('0x0'));module[_0xe2ca('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xe2ca('0x2'),_0xe2ca('0x3'),'queue'),'allowNull':![]},'transferredAt':{'type':Sequelize[_0xe2ca('0x4')]}}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.controller.js b/server/api/whatsappTransferReport/whatsappTransferReport.controller.js index 98f580d..970bd84 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 _0x4e63=['create','body','find','rimraf','request-promise','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','set','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','filters','intersection','fields','attributes','length','order','pick','filter','where','merge','VIRTUAL','options','count','includeAll','include','WhatsappTransferReport','findAll','catch','params','keys'];(function(_0x4a14f6,_0x14a0c9){var _0xa3e047=function(_0x104b9f){while(--_0x104b9f){_0x4a14f6['push'](_0x4a14f6['shift']());}};_0xa3e047(++_0x14a0c9);}(_0x4e63,0x1ad));var _0x34e6=function(_0x1414fb,_0xde9db9){_0x1414fb=_0x1414fb-0x0;var _0xa98ed=_0x4e63[_0x1414fb];return _0xa98ed;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x34e6('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x34e6('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x34e6('0x2'));var util=require(_0x34e6('0x3'));var path=require('path');var sox=require(_0x34e6('0x4'));var csv=require(_0x34e6('0x5'));var ejs=require(_0x34e6('0x6'));var fs=require('fs');var fs_extra=require(_0x34e6('0x7'));var _=require(_0x34e6('0x8'));var squel=require('squel');var crypto=require(_0x34e6('0x9'));var jsforce=require(_0x34e6('0xa'));var deskjs=require(_0x34e6('0xb'));var toCsv=require('to-csv');var querystring=require(_0x34e6('0xc'));var Papa=require(_0x34e6('0xd'));var Redis=require('ioredis');var authService=require(_0x34e6('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x34e6('0xf'));var hardwareService=require(_0x34e6('0x10'));var logger=require(_0x34e6('0x11'))(_0x34e6('0x12'));var utils=require(_0x34e6('0x13'));var config=require(_0x34e6('0x14'));var licenseUtil=require(_0x34e6('0x15'));var db=require(_0x34e6('0x16'))['db'];function respondWithStatusCode(_0x1f862b,_0x24650b){_0x24650b=_0x24650b||0xcc;return function(_0x26a73e){if(_0x26a73e){return _0x1f862b['sendStatus'](_0x24650b);}return _0x1f862b[_0x34e6('0x17')](_0x24650b)[_0x34e6('0x18')]();};}function respondWithResult(_0x32212f,_0x390135){_0x390135=_0x390135||0xc8;return function(_0x262757){if(_0x262757){return _0x32212f[_0x34e6('0x17')](_0x390135)[_0x34e6('0x19')](_0x262757);}};}function respondWithFilteredResult(_0x23d99f,_0x4fe881){return function(_0x51413a){if(_0x51413a){var _0x1a5204=typeof _0x4fe881[_0x34e6('0x1a')]==='undefined'&&typeof _0x4fe881[_0x34e6('0x1b')]===_0x34e6('0x1c');var _0xf8528e=_0x51413a['count'];var _0x19e888=_0x1a5204?0x0:_0x4fe881[_0x34e6('0x1a')];var _0x1f2dfe=_0x1a5204?_0x51413a['count']:_0x4fe881['offset']+_0x4fe881['limit'];var _0x17a136;if(_0x1f2dfe>=_0xf8528e){_0x1f2dfe=_0xf8528e;_0x17a136=0xc8;}else{_0x17a136=0xce;}_0x23d99f['status'](_0x17a136);return _0x23d99f[_0x34e6('0x1d')]('Content-Range',_0x19e888+'-'+_0x1f2dfe+'/'+_0xf8528e)[_0x34e6('0x19')](_0x51413a);}return null;};}function patchUpdates(_0x451468){return function(_0xc5734a){try{jsonpatch[_0x34e6('0x1e')](_0xc5734a,_0x451468,!![]);}catch(_0x209b0e){return BPromise[_0x34e6('0x1f')](_0x209b0e);}return _0xc5734a[_0x34e6('0x20')]();};}function saveUpdates(_0x397a3c,_0x3131b7){return function(_0x6d82ed){if(_0x6d82ed){return _0x6d82ed[_0x34e6('0x21')](_0x397a3c)[_0x34e6('0x22')](function(_0x1738dc){return _0x1738dc;});}return null;};}function removeEntity(_0x433e9d,_0x353e15){return function(_0x2bbd27){if(_0x2bbd27){return _0x2bbd27[_0x34e6('0x23')]()['then'](function(){_0x433e9d[_0x34e6('0x17')](0xcc)[_0x34e6('0x18')]();});}};}function handleEntityNotFound(_0xf992b5,_0x58c836){return function(_0x1ff986){if(!_0x1ff986){_0xf992b5[_0x34e6('0x24')](0x194);}return _0x1ff986;};}function handleError(_0x391fee,_0x45691a){_0x45691a=_0x45691a||0x1f4;return function(_0x4b5b21){logger[_0x34e6('0x25')](_0x4b5b21[_0x34e6('0x26')]);if(_0x4b5b21['name']){delete _0x4b5b21[_0x34e6('0x27')];}_0x391fee[_0x34e6('0x17')](_0x45691a)[_0x34e6('0x28')](_0x4b5b21);};}exports[_0x34e6('0x29')]=function(_0x465814,_0x2c5642){var _0x3bfe18={},_0x2e071f={},_0x468327={'count':0x0,'rows':[]};var _0x1f0e9e=_[_0x34e6('0x2a')](db['WhatsappTransferReport'][_0x34e6('0x2b')],function(_0x38da71){return{'name':_0x38da71[_0x34e6('0x2c')],'type':_0x38da71[_0x34e6('0x2d')]['key']};});_0x2e071f[_0x34e6('0x2e')]=_[_0x34e6('0x2a')](_0x1f0e9e,_0x34e6('0x27'));_0x2e071f['query']=_['keys'](_0x465814[_0x34e6('0x2f')]);_0x2e071f[_0x34e6('0x30')]=_[_0x34e6('0x31')](_0x2e071f[_0x34e6('0x2e')],_0x2e071f[_0x34e6('0x2f')]);_0x3bfe18['attributes']=_[_0x34e6('0x31')](_0x2e071f[_0x34e6('0x2e')],qs['fields'](_0x465814['query'][_0x34e6('0x32')]));_0x3bfe18['attributes']=_0x3bfe18[_0x34e6('0x33')][_0x34e6('0x34')]?_0x3bfe18[_0x34e6('0x33')]:_0x2e071f[_0x34e6('0x2e')];if(!_0x465814[_0x34e6('0x2f')]['hasOwnProperty']('nolimit')){_0x3bfe18[_0x34e6('0x1b')]=qs['limit'](_0x465814['query'][_0x34e6('0x1b')]);_0x3bfe18[_0x34e6('0x1a')]=qs[_0x34e6('0x1a')](_0x465814[_0x34e6('0x2f')][_0x34e6('0x1a')]);}_0x3bfe18[_0x34e6('0x35')]=qs['sort'](_0x465814[_0x34e6('0x2f')]['sort']);_0x3bfe18['where']=qs[_0x34e6('0x30')](_[_0x34e6('0x36')](_0x465814[_0x34e6('0x2f')],_0x2e071f[_0x34e6('0x30')]),_0x1f0e9e);if(_0x465814[_0x34e6('0x2f')][_0x34e6('0x37')]){_0x3bfe18[_0x34e6('0x38')]=_[_0x34e6('0x39')](_0x3bfe18['where'],{'$or':_[_0x34e6('0x2a')](_0x1f0e9e,function(_0x1c5a6f){if(_0x1c5a6f['type']!==_0x34e6('0x3a')){var _0x304adb={};_0x304adb[_0x1c5a6f[_0x34e6('0x27')]]={'$like':'%'+_0x465814[_0x34e6('0x2f')][_0x34e6('0x37')]+'%'};return _0x304adb;}})});}_0x3bfe18=_[_0x34e6('0x39')]({},_0x3bfe18,_0x465814[_0x34e6('0x3b')]);var _0x1dae90={'where':_0x3bfe18['where']};return db['WhatsappTransferReport'][_0x34e6('0x3c')](_0x1dae90)[_0x34e6('0x22')](function(_0x58e455){_0x468327[_0x34e6('0x3c')]=_0x58e455;if(_0x465814[_0x34e6('0x2f')][_0x34e6('0x3d')]){_0x3bfe18[_0x34e6('0x3e')]=[{'all':!![]}];}return db[_0x34e6('0x3f')][_0x34e6('0x40')](_0x3bfe18);})[_0x34e6('0x22')](function(_0xbe096d){_0x468327['rows']=_0xbe096d;return _0x468327;})[_0x34e6('0x22')](respondWithFilteredResult(_0x2c5642,_0x3bfe18))[_0x34e6('0x41')](handleError(_0x2c5642,null));};exports['show']=function(_0xa9cd66,_0x37d070){var _0x9c23e5={'raw':!![],'where':{'id':_0xa9cd66[_0x34e6('0x42')]['id']}},_0x12359e={};_0x12359e[_0x34e6('0x2e')]=_[_0x34e6('0x43')](db['WhatsappTransferReport'][_0x34e6('0x2b')]);_0x12359e[_0x34e6('0x2f')]=_['keys'](_0xa9cd66[_0x34e6('0x2f')]);_0x12359e[_0x34e6('0x30')]=_[_0x34e6('0x31')](_0x12359e['model'],_0x12359e[_0x34e6('0x2f')]);_0x9c23e5['attributes']=_[_0x34e6('0x31')](_0x12359e['model'],qs['fields'](_0xa9cd66[_0x34e6('0x2f')][_0x34e6('0x32')]));_0x9c23e5[_0x34e6('0x33')]=_0x9c23e5[_0x34e6('0x33')][_0x34e6('0x34')]?_0x9c23e5[_0x34e6('0x33')]:_0x12359e[_0x34e6('0x2e')];if(_0xa9cd66[_0x34e6('0x2f')]['includeAll']){_0x9c23e5['include']=[{'all':!![]}];}_0x9c23e5=_['merge']({},_0x9c23e5,_0xa9cd66[_0x34e6('0x3b')]);return db[_0x34e6('0x3f')]['find'](_0x9c23e5)[_0x34e6('0x22')](handleEntityNotFound(_0x37d070,null))[_0x34e6('0x22')](respondWithResult(_0x37d070,null))[_0x34e6('0x41')](handleError(_0x37d070,null));};exports[_0x34e6('0x44')]=function(_0x48be34,_0x1f2b4e){return db[_0x34e6('0x3f')][_0x34e6('0x44')](_0x48be34[_0x34e6('0x45')],{})[_0x34e6('0x22')](respondWithResult(_0x1f2b4e,0xc9))[_0x34e6('0x41')](handleError(_0x1f2b4e,null));};exports[_0x34e6('0x21')]=function(_0x2d212e,_0x4f9079){if(_0x2d212e[_0x34e6('0x45')]['id']){delete _0x2d212e[_0x34e6('0x45')]['id'];}return db[_0x34e6('0x3f')][_0x34e6('0x46')]({'where':{'id':_0x2d212e[_0x34e6('0x42')]['id']}})['then'](handleEntityNotFound(_0x4f9079,null))['then'](saveUpdates(_0x2d212e['body'],null))[_0x34e6('0x22')](respondWithResult(_0x4f9079,null))[_0x34e6('0x41')](handleError(_0x4f9079,null));};exports[_0x34e6('0x23')]=function(_0x1443aa,_0x5e43cd){return db[_0x34e6('0x3f')][_0x34e6('0x46')]({'where':{'id':_0x1443aa[_0x34e6('0x42')]['id']}})[_0x34e6('0x22')](handleEntityNotFound(_0x5e43cd,null))[_0x34e6('0x22')](removeEntity(_0x5e43cd,null))[_0x34e6('0x41')](handleError(_0x5e43cd,null));};exports['describe']=function(_0xf17d3,_0x1068ab){return db['WhatsappTransferReport']['describe']()[_0x34e6('0x22')](respondWithResult(_0x1068ab,null))['catch'](handleError(_0x1068ab,null));}; \ No newline at end of file +var _0x002b=['VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','update','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','Content-Range','apply','reject','save','then','destroy','end','stack','name','send','WhatsappTransferReport','rawAttributes','fieldName','key','model','map','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','type'];(function(_0x50cd41,_0x4874a7){var _0x399475=function(_0x1946da){while(--_0x1946da){_0x50cd41['push'](_0x50cd41['shift']());}};_0x399475(++_0x4874a7);}(_0x002b,0x138));var _0xb002=function(_0x2e819c,_0x3f99a5){_0x2e819c=_0x2e819c-0x0;var _0x24e271=_0x002b[_0x2e819c];return _0x24e271;};'use strict';var emlformat=require(_0xb002('0x0'));var rimraf=require(_0xb002('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb002('0x2'));var rp=require(_0xb002('0x3'));var moment=require(_0xb002('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xb002('0x5'));var util=require(_0xb002('0x6'));var path=require('path');var sox=require(_0xb002('0x7'));var csv=require(_0xb002('0x8'));var ejs=require(_0xb002('0x9'));var fs=require('fs');var fs_extra=require(_0xb002('0xa'));var _=require(_0xb002('0xb'));var squel=require(_0xb002('0xc'));var crypto=require(_0xb002('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xb002('0x8'));var querystring=require(_0xb002('0xe'));var Papa=require('papaparse');var Redis=require(_0xb002('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xb002('0x10'));var as=require(_0xb002('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xb002('0x12'));var utils=require(_0xb002('0x13'));var config=require(_0xb002('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0xb002('0x15'))['db'];function respondWithStatusCode(_0x556385,_0x3f826b){_0x3f826b=_0x3f826b||0xcc;return function(_0x34f5d1){if(_0x34f5d1){return _0x556385[_0xb002('0x16')](_0x3f826b);}return _0x556385[_0xb002('0x17')](_0x3f826b)['end']();};}function respondWithResult(_0x3ce259,_0x1e1aae){_0x1e1aae=_0x1e1aae||0xc8;return function(_0x5a7375){if(_0x5a7375){return _0x3ce259[_0xb002('0x17')](_0x1e1aae)[_0xb002('0x18')](_0x5a7375);}};}function respondWithFilteredResult(_0x5b8078,_0x4650d0){return function(_0x44fca6){if(_0x44fca6){var _0x291885=typeof _0x4650d0['offset']==='undefined'&&typeof _0x4650d0['limit']===_0xb002('0x19');var _0x3b9a14=_0x44fca6[_0xb002('0x1a')];var _0x4e43f4=_0x291885?0x0:_0x4650d0[_0xb002('0x1b')];var _0x13f5b2=_0x291885?_0x44fca6[_0xb002('0x1a')]:_0x4650d0[_0xb002('0x1b')]+_0x4650d0[_0xb002('0x1c')];var _0x17293a;if(_0x13f5b2>=_0x3b9a14){_0x13f5b2=_0x3b9a14;_0x17293a=0xc8;}else{_0x17293a=0xce;}_0x5b8078['status'](_0x17293a);return _0x5b8078['set'](_0xb002('0x1d'),_0x4e43f4+'-'+_0x13f5b2+'/'+_0x3b9a14)['json'](_0x44fca6);}return null;};}function patchUpdates(_0x46a363){return function(_0x2f624d){try{jsonpatch[_0xb002('0x1e')](_0x2f624d,_0x46a363,!![]);}catch(_0x3ed2d0){return BPromise[_0xb002('0x1f')](_0x3ed2d0);}return _0x2f624d[_0xb002('0x20')]();};}function saveUpdates(_0x20b37a,_0x562b19){return function(_0x4a0134){if(_0x4a0134){return _0x4a0134['update'](_0x20b37a)[_0xb002('0x21')](function(_0x48ed2c){return _0x48ed2c;});}return null;};}function removeEntity(_0x4dcf8e,_0xc966b4){return function(_0x568301){if(_0x568301){return _0x568301[_0xb002('0x22')]()[_0xb002('0x21')](function(){_0x4dcf8e['status'](0xcc)[_0xb002('0x23')]();});}};}function handleEntityNotFound(_0x3c0ac9,_0x273d82){return function(_0x55c539){if(!_0x55c539){_0x3c0ac9[_0xb002('0x16')](0x194);}return _0x55c539;};}function handleError(_0x5b16eb,_0x5de69b){_0x5de69b=_0x5de69b||0x1f4;return function(_0x257656){logger['error'](_0x257656[_0xb002('0x24')]);if(_0x257656['name']){delete _0x257656[_0xb002('0x25')];}_0x5b16eb[_0xb002('0x17')](_0x5de69b)[_0xb002('0x26')](_0x257656);};}exports['index']=function(_0x4bfd85,_0x5bb744){var _0x2a7d08={},_0x4fbc9a={},_0x34efd2={'count':0x0,'rows':[]};var _0x4062c8=_['map'](db[_0xb002('0x27')][_0xb002('0x28')],function(_0x49821c){return{'name':_0x49821c[_0xb002('0x29')],'type':_0x49821c['type'][_0xb002('0x2a')]};});_0x4fbc9a[_0xb002('0x2b')]=_[_0xb002('0x2c')](_0x4062c8,_0xb002('0x25'));_0x4fbc9a[_0xb002('0x2d')]=_['keys'](_0x4bfd85[_0xb002('0x2d')]);_0x4fbc9a['filters']=_[_0xb002('0x2e')](_0x4fbc9a[_0xb002('0x2b')],_0x4fbc9a[_0xb002('0x2d')]);_0x2a7d08[_0xb002('0x2f')]=_[_0xb002('0x2e')](_0x4fbc9a[_0xb002('0x2b')],qs['fields'](_0x4bfd85[_0xb002('0x2d')][_0xb002('0x30')]));_0x2a7d08[_0xb002('0x2f')]=_0x2a7d08[_0xb002('0x2f')][_0xb002('0x31')]?_0x2a7d08[_0xb002('0x2f')]:_0x4fbc9a[_0xb002('0x2b')];if(!_0x4bfd85['query'][_0xb002('0x32')](_0xb002('0x33'))){_0x2a7d08[_0xb002('0x1c')]=qs[_0xb002('0x1c')](_0x4bfd85[_0xb002('0x2d')][_0xb002('0x1c')]);_0x2a7d08[_0xb002('0x1b')]=qs[_0xb002('0x1b')](_0x4bfd85['query'][_0xb002('0x1b')]);}_0x2a7d08[_0xb002('0x34')]=qs['sort'](_0x4bfd85[_0xb002('0x2d')][_0xb002('0x35')]);_0x2a7d08[_0xb002('0x36')]=qs[_0xb002('0x37')](_[_0xb002('0x38')](_0x4bfd85[_0xb002('0x2d')],_0x4fbc9a[_0xb002('0x37')]),_0x4062c8);if(_0x4bfd85[_0xb002('0x2d')]['filter']){_0x2a7d08[_0xb002('0x36')]=_['merge'](_0x2a7d08[_0xb002('0x36')],{'$or':_[_0xb002('0x2c')](_0x4062c8,function(_0x3e4067){if(_0x3e4067[_0xb002('0x39')]!==_0xb002('0x3a')){var _0x3d1bae={};_0x3d1bae[_0x3e4067[_0xb002('0x25')]]={'$like':'%'+_0x4bfd85[_0xb002('0x2d')][_0xb002('0x3b')]+'%'};return _0x3d1bae;}})});}_0x2a7d08=_[_0xb002('0x3c')]({},_0x2a7d08,_0x4bfd85[_0xb002('0x3d')]);var _0x2afca5={'where':_0x2a7d08[_0xb002('0x36')]};return db[_0xb002('0x27')][_0xb002('0x1a')](_0x2afca5)[_0xb002('0x21')](function(_0x3ff7ca){_0x34efd2[_0xb002('0x1a')]=_0x3ff7ca;if(_0x4bfd85[_0xb002('0x2d')][_0xb002('0x3e')]){_0x2a7d08[_0xb002('0x3f')]=[{'all':!![]}];}return db[_0xb002('0x27')][_0xb002('0x40')](_0x2a7d08);})[_0xb002('0x21')](function(_0x55c709){_0x34efd2[_0xb002('0x41')]=_0x55c709;return _0x34efd2;})[_0xb002('0x21')](respondWithFilteredResult(_0x5bb744,_0x2a7d08))[_0xb002('0x42')](handleError(_0x5bb744,null));};exports[_0xb002('0x43')]=function(_0x2af8b1,_0x345b2f){var _0x3398fe={'raw':!![],'where':{'id':_0x2af8b1[_0xb002('0x44')]['id']}},_0x2d833e={};_0x2d833e[_0xb002('0x2b')]=_[_0xb002('0x45')](db[_0xb002('0x27')]['rawAttributes']);_0x2d833e[_0xb002('0x2d')]=_[_0xb002('0x45')](_0x2af8b1[_0xb002('0x2d')]);_0x2d833e[_0xb002('0x37')]=_[_0xb002('0x2e')](_0x2d833e['model'],_0x2d833e[_0xb002('0x2d')]);_0x3398fe['attributes']=_[_0xb002('0x2e')](_0x2d833e[_0xb002('0x2b')],qs[_0xb002('0x30')](_0x2af8b1[_0xb002('0x2d')][_0xb002('0x30')]));_0x3398fe[_0xb002('0x2f')]=_0x3398fe[_0xb002('0x2f')][_0xb002('0x31')]?_0x3398fe['attributes']:_0x2d833e[_0xb002('0x2b')];if(_0x2af8b1['query']['includeAll']){_0x3398fe[_0xb002('0x3f')]=[{'all':!![]}];}_0x3398fe=_[_0xb002('0x3c')]({},_0x3398fe,_0x2af8b1['options']);return db[_0xb002('0x27')][_0xb002('0x46')](_0x3398fe)['then'](handleEntityNotFound(_0x345b2f,null))[_0xb002('0x21')](respondWithResult(_0x345b2f,null))[_0xb002('0x42')](handleError(_0x345b2f,null));};exports[_0xb002('0x47')]=function(_0x37779b,_0x1dcb47){return db[_0xb002('0x27')][_0xb002('0x47')](_0x37779b[_0xb002('0x48')],{})[_0xb002('0x21')](respondWithResult(_0x1dcb47,0xc9))[_0xb002('0x42')](handleError(_0x1dcb47,null));};exports[_0xb002('0x49')]=function(_0x128b57,_0x5706e1){if(_0x128b57[_0xb002('0x48')]['id']){delete _0x128b57[_0xb002('0x48')]['id'];}return db[_0xb002('0x27')][_0xb002('0x46')]({'where':{'id':_0x128b57[_0xb002('0x44')]['id']}})[_0xb002('0x21')](handleEntityNotFound(_0x5706e1,null))[_0xb002('0x21')](saveUpdates(_0x128b57[_0xb002('0x48')],null))['then'](respondWithResult(_0x5706e1,null))[_0xb002('0x42')](handleError(_0x5706e1,null));};exports[_0xb002('0x22')]=function(_0x2b13ac,_0x99e33d){return db[_0xb002('0x27')][_0xb002('0x46')]({'where':{'id':_0x2b13ac[_0xb002('0x44')]['id']}})[_0xb002('0x21')](handleEntityNotFound(_0x99e33d,null))[_0xb002('0x21')](removeEntity(_0x99e33d,null))['catch'](handleError(_0x99e33d,null));};exports['describe']=function(_0x4c4364,_0x1b20c9){return db[_0xb002('0x27')]['describe']()['then'](respondWithResult(_0x1b20c9,null))[_0xb002('0x42')](handleError(_0x1b20c9,null));}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.model.js b/server/api/whatsappTransferReport/whatsappTransferReport.model.js index 40d58ab..c6e5dba 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 _0x3660=['rimraf','../../config/environment','exports','define','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x5db30e,_0x5ec82e){var _0x1e7d52=function(_0x442663){while(--_0x442663){_0x5db30e['push'](_0x5db30e['shift']());}};_0x1e7d52(++_0x5ec82e);}(_0x3660,0x151));var _0x0366=function(_0x30fee7,_0x57d732){_0x30fee7=_0x30fee7-0x0;var _0x628d03=_0x3660[_0x30fee7];return _0x628d03;};'use strict';var _=require(_0x0366('0x0'));var util=require(_0x0366('0x1'));var logger=require(_0x0366('0x2'))(_0x0366('0x3'));var moment=require(_0x0366('0x4'));var BPromise=require(_0x0366('0x5'));var rp=require(_0x0366('0x6'));var fs=require('fs');var path=require(_0x0366('0x7'));var rimraf=require(_0x0366('0x8'));var config=require(_0x0366('0x9'));var attributes=require('./whatsappTransferReport.attributes');module[_0x0366('0xa')]=function(_0x3eec32,_0xcb22f9){return _0x3eec32[_0x0366('0xb')](_0x0366('0xc'),attributes,{'tableName':_0x0366('0xd'),'paranoid':![],'indexes':[{'name':_0x0366('0xe'),'fields':[_0x0366('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x373a=['rimraf','./whatsappTransferReport.attributes','exports','define','WhatsappTransferReport','report_whatsapp_transfer','uniqueid','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x53b0f8,_0x459130){var _0x133415=function(_0x37a4a5){while(--_0x37a4a5){_0x53b0f8['push'](_0x53b0f8['shift']());}};_0x133415(++_0x459130);}(_0x373a,0x181));var _0xa373=function(_0xe28949,_0x4045af){_0xe28949=_0xe28949-0x0;var _0x401fe8=_0x373a[_0xe28949];return _0x401fe8;};'use strict';var _=require(_0xa373('0x0'));var util=require(_0xa373('0x1'));var logger=require(_0xa373('0x2'))(_0xa373('0x3'));var moment=require(_0xa373('0x4'));var BPromise=require('bluebird');var rp=require(_0xa373('0x5'));var fs=require('fs');var path=require(_0xa373('0x6'));var rimraf=require(_0xa373('0x7'));var config=require('../../config/environment');var attributes=require(_0xa373('0x8'));module[_0xa373('0x9')]=function(_0x5cdc15,_0x32e4b8){return _0x5cdc15[_0xa373('0xa')](_0xa373('0xb'),attributes,{'tableName':_0xa373('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xa373('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js b/server/api/whatsappTransferReport/whatsappTransferReport.rpc.js index b994ab4..9239019 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 _0xccd5=['lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','info','WhatsappTransferReport,\x20%s,\x20%s','request\x20sent','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch'];(function(_0x302793,_0x2f9ef4){var _0x55cad0=function(_0x492ff2){while(--_0x492ff2){_0x302793['push'](_0x302793['shift']());}};_0x55cad0(++_0x2f9ef4);}(_0xccd5,0xbe));var _0x5ccd=function(_0xea3649,_0x557e6a){_0xea3649=_0xea3649-0x0;var _0x5e7d67=_0xccd5[_0xea3649];return _0x5e7d67;};'use strict';var _=require(_0x5ccd('0x0'));var util=require('util');var moment=require(_0x5ccd('0x1'));var BPromise=require(_0x5ccd('0x2'));var rs=require(_0x5ccd('0x3'));var fs=require('fs');var Redis=require(_0x5ccd('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x5ccd('0x5'));var logger=require(_0x5ccd('0x6'))('rpc');var config=require(_0x5ccd('0x7'));var jayson=require(_0x5ccd('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3c4431,_0x355ee0,_0x41e183){return new BPromise(function(_0x3b2c9a,_0x3f8a66){return client['request'](_0x3c4431,_0x41e183)['then'](function(_0x2325b1){logger[_0x5ccd('0x9')](_0x5ccd('0xa'),_0x355ee0,_0x5ccd('0xb'));logger[_0x5ccd('0xc')](_0x5ccd('0xd'),_0x355ee0,_0x5ccd('0xb'),JSON[_0x5ccd('0xe')](_0x2325b1));if(_0x2325b1[_0x5ccd('0xf')]){if(_0x2325b1['error'][_0x5ccd('0x10')]===0x1f4){logger[_0x5ccd('0xf')](_0x5ccd('0xa'),_0x355ee0,_0x2325b1[_0x5ccd('0xf')][_0x5ccd('0x11')]);return _0x3f8a66(_0x2325b1[_0x5ccd('0xf')][_0x5ccd('0x11')]);}logger[_0x5ccd('0xf')](_0x5ccd('0xa'),_0x355ee0,_0x2325b1[_0x5ccd('0xf')][_0x5ccd('0x11')]);return _0x3b2c9a(_0x2325b1['error'][_0x5ccd('0x11')]);}else{logger[_0x5ccd('0x9')](_0x5ccd('0xa'),_0x355ee0,'request\x20sent');_0x3b2c9a(_0x2325b1['result'][_0x5ccd('0x11')]);}})[_0x5ccd('0x12')](function(_0x261d60){logger[_0x5ccd('0xf')](_0x5ccd('0xa'),_0x355ee0,_0x261d60);_0x3f8a66(_0x261d60);});});} \ No newline at end of file +var _0xa458=['randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','WhatsappTransferReport,\x20%s,\x20%s','debug','WhatsappTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash','util','moment','bluebird'];(function(_0x1758e9,_0xa44a1c){var _0x1c2df8=function(_0x131615){while(--_0x131615){_0x1758e9['push'](_0x1758e9['shift']());}};_0x1c2df8(++_0xa44a1c);}(_0xa458,0x16c));var _0x8a45=function(_0x40848b,_0x523336){_0x40848b=_0x40848b-0x0;var _0x56eb60=_0xa458[_0x40848b];return _0x56eb60;};'use strict';var _=require(_0x8a45('0x0'));var util=require(_0x8a45('0x1'));var moment=require(_0x8a45('0x2'));var BPromise=require(_0x8a45('0x3'));var rs=require(_0x8a45('0x4'));var fs=require('fs');var Redis=require(_0x8a45('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x8a45('0x6'))(_0x8a45('0x7'));var config=require(_0x8a45('0x8'));var jayson=require(_0x8a45('0x9'));var client=jayson[_0x8a45('0xa')][_0x8a45('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3dede3,_0x277e75,_0x2bc1c3){return new BPromise(function(_0x1233ff,_0x233740){return client[_0x8a45('0xc')](_0x3dede3,_0x2bc1c3)[_0x8a45('0xd')](function(_0x24dca6){logger['info'](_0x8a45('0xe'),_0x277e75,'request\x20sent');logger[_0x8a45('0xf')](_0x8a45('0x10'),_0x277e75,'request\x20sent',JSON['stringify'](_0x24dca6));if(_0x24dca6[_0x8a45('0x11')]){if(_0x24dca6['error'][_0x8a45('0x12')]===0x1f4){logger['error'](_0x8a45('0xe'),_0x277e75,_0x24dca6[_0x8a45('0x11')][_0x8a45('0x13')]);return _0x233740(_0x24dca6[_0x8a45('0x11')][_0x8a45('0x13')]);}logger['error'](_0x8a45('0xe'),_0x277e75,_0x24dca6[_0x8a45('0x11')][_0x8a45('0x13')]);return _0x1233ff(_0x24dca6[_0x8a45('0x11')][_0x8a45('0x13')]);}else{logger[_0x8a45('0x14')](_0x8a45('0xe'),_0x277e75,'request\x20sent');_0x1233ff(_0x24dca6[_0x8a45('0x15')]['message']);}})[_0x8a45('0x16')](function(_0x2aed2a){logger[_0x8a45('0x11')](_0x8a45('0xe'),_0x277e75,_0x2aed2a);_0x233740(_0x2aed2a);});});} \ No newline at end of file diff --git a/server/app.js b/server/app.js index 2859ef2..4af66d6 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xff94=['Online\x20apps:','map','filter','online','join','Offline\x20apps:','status','None','seedDB','./config/seedDB','./config/license','default','catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./mysqldb','./rpc','./config/environment','./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/transcribe','then','listen','info','start'];(function(_0x137bb0,_0x28d3f2){var _0x19a27e=function(_0x337961){while(--_0x337961){_0x137bb0['push'](_0x137bb0['shift']());}};_0x19a27e(++_0x28d3f2);}(_0xff94,0x1ef));var _0x4ff9=function(_0x24d771,_0x4e07bf){_0x24d771=_0x24d771-0x0;var _0x4ed567=_0xff94[_0x24d771];return _0x4ed567;};'use strict';var _=require(_0x4ff9('0x0'));var mysqldb=require(_0x4ff9('0x1'));var rpc=require(_0x4ff9('0x2'));var config=require(_0x4ff9('0x3'));var logger=require(_0x4ff9('0x4'))(_0x4ff9('0x5'));var pm2=require(_0x4ff9('0x6'));var pm2Config=require(_0x4ff9('0x7'));var schedule=require(_0x4ff9('0x8'));var chat=require(_0x4ff9('0x9'));var whatsapp=require('./config/schedule/whatsapp');var transcribe=require(_0x4ff9('0xa'));function main(){return mysqldb['db']['sequelize']['sync']()[_0x4ff9('0xb')](function(){return rpc[_0x4ff9('0xc')]();})['then'](function(_0x302c73){logger[_0x4ff9('0xd')](_0x302c73);return chat['start']();})[_0x4ff9('0xb')](function(){return whatsapp[_0x4ff9('0xe')]();})[_0x4ff9('0xb')](function(){return schedule[_0x4ff9('0xe')]();})[_0x4ff9('0xb')](function(){return transcribe['start']();})['then'](function(_0x16c99d){logger[_0x4ff9('0xd')](_0x16c99d);return pm2['start'](pm2Config);})[_0x4ff9('0xb')](function(_0x42ac74){logger['info'](_0x4ff9('0xf'),_[_0x4ff9('0x10')](_[_0x4ff9('0x11')](_0x42ac74,{'status':_0x4ff9('0x12')}),'name')[_0x4ff9('0x13')]());logger[_0x4ff9('0xd')](_0x4ff9('0x14'),_['map'](_[_0x4ff9('0x11')](_0x42ac74,function(_0x45c6c9){return _0x45c6c9[_0x4ff9('0x15')]!==_0x4ff9('0x12');}),'name')[_0x4ff9('0x13')]()||_0x4ff9('0x16'));config[_0x4ff9('0x17')]&&require(_0x4ff9('0x18'))['default']();require(_0x4ff9('0x19'))[_0x4ff9('0x1a')]();})[_0x4ff9('0x1b')](function(_0x5a4efc){logger['error'](_0x4ff9('0x1c'),_0x5a4efc);process[_0x4ff9('0x1d')](0x1);});}main(); \ No newline at end of file +var _0x19ed=['name','seedDB','./config/seedDB','./config/license','default','catch','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','./mysqldb','./rpc','./config/environment','app','./config/pm2','./config/pm2/config','./config/schedule/chat','./config/schedule/transcribe','sequelize','sync','then','info','start','map','filter','online','join','Offline\x20apps:','status'];(function(_0x2890af,_0xf87541){var _0x4e8077=function(_0x479cae){while(--_0x479cae){_0x2890af['push'](_0x2890af['shift']());}};_0x4e8077(++_0xf87541);}(_0x19ed,0x175));var _0xd19e=function(_0xaa7ea3,_0x149995){_0xaa7ea3=_0xaa7ea3-0x0;var _0x3956db=_0x19ed[_0xaa7ea3];return _0x3956db;};'use strict';var _=require('lodash');var mysqldb=require(_0xd19e('0x0'));var rpc=require(_0xd19e('0x1'));var config=require(_0xd19e('0x2'));var logger=require('./config/logger')(_0xd19e('0x3'));var pm2=require(_0xd19e('0x4'));var pm2Config=require(_0xd19e('0x5'));var schedule=require('./config/schedule');var chat=require(_0xd19e('0x6'));var whatsapp=require('./config/schedule/whatsapp');var transcribe=require(_0xd19e('0x7'));function main(){return mysqldb['db'][_0xd19e('0x8')][_0xd19e('0x9')]()[_0xd19e('0xa')](function(){return rpc['listen']();})[_0xd19e('0xa')](function(_0x35ed69){logger[_0xd19e('0xb')](_0x35ed69);return chat['start']();})[_0xd19e('0xa')](function(){return whatsapp[_0xd19e('0xc')]();})[_0xd19e('0xa')](function(){return schedule['start']();})['then'](function(){return transcribe[_0xd19e('0xc')]();})[_0xd19e('0xa')](function(_0x4fa23c){logger[_0xd19e('0xb')](_0x4fa23c);return pm2[_0xd19e('0xc')](pm2Config);})[_0xd19e('0xa')](function(_0x57b137){logger['info']('Online\x20apps:',_[_0xd19e('0xd')](_[_0xd19e('0xe')](_0x57b137,{'status':_0xd19e('0xf')}),'name')[_0xd19e('0x10')]());logger[_0xd19e('0xb')](_0xd19e('0x11'),_[_0xd19e('0xd')](_[_0xd19e('0xe')](_0x57b137,function(_0x28e9e3){return _0x28e9e3[_0xd19e('0x12')]!==_0xd19e('0xf');}),_0xd19e('0x13'))['join']()||'None');config[_0xd19e('0x14')]&&require(_0xd19e('0x15'))['default']();require(_0xd19e('0x16'))[_0xd19e('0x17')]();})[_0xd19e('0x18')](function(_0x48789e){logger[_0xd19e('0x19')](_0xd19e('0x1a'),_0x48789e);process[_0xd19e('0x1b')](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index 6486bad..9be063a 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 _0x6cdb=['User\x20not\x20found.','canUpdate','getLicense','Forbidden','signToken','setTokenCookie','/dashboards/general','send','retrieveApiKey','isNil','apiKeyNonce','apiKeyIat','generateApiKey','regenerateApiKey','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','decryptString','split','toLowerCase','format','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','updatePasswordsHistory','length','encryptString','join','promisify','sign','secret','payload','options','verify','randomBytes','toString','hex','floor','now','../../mysqldb','../../config/environment','../../config/license/hardware','lodash','jsonwebtoken','composable-middleware','basic-auth','crypto','util','secrets','session','role','internal','email','permissions','voicePause','mailPause','faxPause','smsPause','openchannelPause','lastPauseAt','crudPermissions','alias','phoneBarDnd','phoneBarEnableDtmfTone','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk','interface','userProfileId','privacyEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','isChatInteractionAuthorized','isAuthenticated','use','ChatInteraction','closed','then','disposition','unmanaged','Forbidden.','catch','headers','authorization','Basic','User','find','name','authenticate','pass','status','json','user','startsWith','Bearer','Unknown\x20authorization\x20format','apikey','getUuid','query','Setting','findOne','blockDuration','isEqual','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','blocked','blockedAt','add','minutes'];(function(_0x57a6d4,_0x9f970){var _0x3a1373=function(_0x757a4f){while(--_0x757a4f){_0x57a6d4['push'](_0x57a6d4['shift']());}};_0x3a1373(++_0x9f970);}(_0x6cdb,0x176));var _0xb6cd=function(_0x3f9bc8,_0x2a8872){_0x3f9bc8=_0x3f9bc8-0x0;var _0x2e843b=_0x6cdb[_0x3f9bc8];return _0x2e843b;};'use strict';var db=require(_0xb6cd('0x0'))['db'];var config=require(_0xb6cd('0x1'));var hardwareConf=require(_0xb6cd('0x2'));var licenseUtil=require('../../config/license/util');var encryptor=require('../encryptor');var _=require(_0xb6cd('0x3'));var jwt=require(_0xb6cd('0x4'));var expressJwt=require('express-jwt');var compose=require(_0xb6cd('0x5'));var basicAuth=require(_0xb6cd('0x6'));var crypto=require(_0xb6cd('0x7'));var BPromise=require('bluebird');var util=require(_0xb6cd('0x8'));var moment=require('moment');var validateJwt=expressJwt({'secret':config[_0xb6cd('0x9')][_0xb6cd('0xa')]});var userAttributes=['id',_0xb6cd('0xb'),'fullname','name',_0xb6cd('0xc'),_0xb6cd('0xd'),'userpic',_0xb6cd('0xe'),'md5secret',_0xb6cd('0xf'),'chatPause',_0xb6cd('0x10'),_0xb6cd('0x11'),_0xb6cd('0x12'),_0xb6cd('0x13'),'pauseType','showWebBar','lastLoginAt',_0xb6cd('0x14'),_0xb6cd('0x15'),'allowmessenger','passwordResetAt',_0xb6cd('0x16'),'phoneBarAutoAnswer','phoneBarAutoAnswerDelay',_0xb6cd('0x17'),'phoneBarEnableRecording',_0xb6cd('0x18'),'phoneBarEnableSettings',_0xb6cd('0x19'),_0xb6cd('0x1a'),_0xb6cd('0x1b'),_0xb6cd('0x1c'),_0xb6cd('0x1d'),_0xb6cd('0x1e'),_0xb6cd('0x1f'),_0xb6cd('0x20'),'settingsEnabled',_0xb6cd('0x21'),_0xb6cd('0x22'),_0xb6cd('0x23'),'downloadAttachments'];exports[_0xb6cd('0x24')]=function(){return this[_0xb6cd('0x25')](!![])[_0xb6cd('0x26')](function(_0x4b9ed3,_0x19c278,_0x188952){if(_0x4b9ed3['user']){_0x188952();}else{return db[_0xb6cd('0x27')]['findOne']({'where':{'id':_0x4b9ed3['params']['id']},'attributes':['id',_0xb6cd('0x28'),'disposition'],'raw':!![]})[_0xb6cd('0x29')](function(_0x4e212b){if(_0x4e212b&&_0x4e212b['closed']){return _0x19c278['status'](_0x4e212b[_0xb6cd('0x2a')]==='unmanaged'?0x195:0x193)['json']({'message':_0x4e212b[_0xb6cd('0x2a')]===_0xb6cd('0x2b')?'Unmanaged.':_0xb6cd('0x2c')});}else{_0x188952();}})[_0xb6cd('0x2d')](function(_0x1ae609){_0x188952(_0x1ae609);});}});};exports['isAuthenticated']=function isAuthenticated(_0x3bdb32){return compose()[_0xb6cd('0x26')](function(_0xa959bf,_0x41e7b3,_0x53a501){var _0xf984bb;if(_0xa959bf[_0xb6cd('0x2e')][_0xb6cd('0x2f')]){if(_['startsWith'](_0xa959bf['headers'][_0xb6cd('0x2f')],_0xb6cd('0x30'))){var _0x97b8df=basicAuth(_0xa959bf);db[_0xb6cd('0x31')][_0xb6cd('0x32')]({'where':{'name':_0x97b8df[_0xb6cd('0x33')]}})['then'](function(_0x61b525){if(!_0x61b525||!_0x61b525[_0xb6cd('0x34')](_0x97b8df[_0xb6cd('0x35')])){return _0x41e7b3[_0xb6cd('0x36')](0x191)[_0xb6cd('0x37')]({'message':'Wrong\x20credentials.'});}_0xa959bf[_0xb6cd('0x38')]={'id':_0x61b525['id']};_0x53a501();})[_0xb6cd('0x2d')](function(_0x17d4c5){_0x53a501(_0x17d4c5);});}else if(_[_0xb6cd('0x39')](_0xa959bf[_0xb6cd('0x2e')][_0xb6cd('0x2f')],_0xb6cd('0x3a'))){validateJwt(_0xa959bf,_0x41e7b3,_0x53a501);}else{if(_0x3bdb32){_0x53a501();}else{return _0x41e7b3[_0xb6cd('0x36')](0x193)[_0xb6cd('0x37')]({'message':_0xb6cd('0x3b')});}}}else if(_0xa959bf['query'][_0xb6cd('0x3c')]){try{var _0x4bc15b={'audience':hardwareConf[_0xb6cd('0x3d')](),'issuer':hardwareConf['getUuid']()};verifyJwt(_0xa959bf[_0xb6cd('0x3e')][_0xb6cd('0x3c')],_0x4bc15b)[_0xb6cd('0x29')](function(_0x4da2fd){return db[_0xb6cd('0x31')][_0xb6cd('0x32')]({'where':{'id':_0x4da2fd['sub']}})[_0xb6cd('0x29')](function(_0x501f74){_0xf984bb=_0x501f74;return db[_0xb6cd('0x3f')][_0xb6cd('0x40')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xb6cd('0x41')],'raw':!![]});})[_0xb6cd('0x29')](function(_0x2a8110){if(!_0xf984bb||!_[_0xb6cd('0x42')](_0xf984bb['apiKeyNonce'],_0x4da2fd['nonce'])){return _0x41e7b3[_0xb6cd('0x36')](0x191)[_0xb6cd('0x37')]({'message':_0xb6cd('0x43')});}if(_0xf984bb[_0xb6cd('0x44')]){return _0x41e7b3['status'](0x191)[_0xb6cd('0x37')]({'message':_0xb6cd('0x45')});}if(_0xf984bb[_0xb6cd('0x46')]){if(_0x2a8110[_0xb6cd('0x41')]>0x0){if(moment(_0xf984bb[_0xb6cd('0x47')])[_0xb6cd('0x48')](_0x2a8110[_0xb6cd('0x41')],_0xb6cd('0x49'))>moment()){return _0x41e7b3[_0xb6cd('0x36')](0x191)['json']({'message':_0xb6cd('0x45')});}}else{return _0x41e7b3['status'](0x191)[_0xb6cd('0x37')]({'message':'Invalid\x20API\x20access\x20key'});}}_0xa959bf[_0xb6cd('0x38')]={'id':_0xf984bb['id']};_0x53a501();});})[_0xb6cd('0x2d')](function(){return _0x41e7b3[_0xb6cd('0x36')](0x191)[_0xb6cd('0x37')]({'message':'Invalid\x20API\x20access\x20key'});});}catch(_0x29a19a){_0x53a501(_0x29a19a);}}else if(_0x3bdb32){_0x53a501();}else{return _0x41e7b3[_0xb6cd('0x36')](0x193)[_0xb6cd('0x37')]({'message':'Unknown\x20authorization\x20format'});}})[_0xb6cd('0x26')](function(_0x446411,_0x5b968d,_0x166776){if(_0x446411[_0xb6cd('0x38')]){db['User'][_0xb6cd('0x32')]({'where':{'id':_0x446411['user']['id']},'attributes':userAttributes})['then'](function(_0x4c846a){if(!_0x4c846a){return _0x5b968d[_0xb6cd('0x36')](0x194)[_0xb6cd('0x37')]({'message':_0xb6cd('0x4a')});}_0x446411[_0xb6cd('0x38')]=_0x4c846a;_0x166776();})[_0xb6cd('0x2d')](function(_0x1ea1df){_0x166776(_0x1ea1df);});}else if(_0x3bdb32){_0x166776();}else{return _0x5b968d[_0xb6cd('0x36')](0x194)[_0xb6cd('0x37')]({'message':'User\x20object\x20not\x20found.'});}});};exports[_0xb6cd('0x4b')]=function canUpdate(){return compose()[_0xb6cd('0x26')](function(_0xd6c59d,_0x267060,_0x1166a1){return licenseUtil[_0xb6cd('0x4c')]()[_0xb6cd('0x29')](function(_0x9aa015){if(_0x9aa015['update']){_0x1166a1();}else{return _0x267060[_0xb6cd('0x36')](0x193)[_0xb6cd('0x37')]({'message':_0xb6cd('0x4d')});}})['catch'](function(_0x1cd6e3){_0x1166a1(_0x1cd6e3);});});};exports['isMiddleware']=function(_0x3c7da4,_0x48e61a,_0x4c9e15){_0x3c7da4['isMiddleware']=!![];return _0x4c9e15();};exports[_0xb6cd('0x4e')]=function signToken(_0x4e5489){return signJwt(_0x4e5489);};exports[_0xb6cd('0x4f')]=function(_0x447830,_0x3225f8){if(!_0x447830[_0xb6cd('0x38')]){return _0x3225f8[_0xb6cd('0x36')](0x194)['json']({'message':'It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.'});}var _0x4f6031={'payload':{'id':_0x447830[_0xb6cd('0x38')]['id'],'role':_0x447830[_0xb6cd('0x38')][_0xb6cd('0xb')]},'options':{'expiresIn':0x15180}};return signJwt(_0x4f6031)[_0xb6cd('0x29')](function(_0x29a751){_0x3225f8['cookie']('motion.token',_0x29a751);_0x3225f8['redirect'](_0xb6cd('0x50'));})['catch'](function(_0x5cdc97){return _0x3225f8[_0xb6cd('0x36')](0x1f4)[_0xb6cd('0x51')](_0x5cdc97);});};exports[_0xb6cd('0x52')]=function(_0x102a22){if(_[_0xb6cd('0x53')](_0x102a22[_0xb6cd('0x54')])||_['isNil'](_0x102a22[_0xb6cd('0x55')])){return null;}else{return createJwt(_0x102a22);}};exports[_0xb6cd('0x56')]=function(_0x32da4c){_0x32da4c[_0xb6cd('0x54')]=generateNonce();_0x32da4c['apiKeyIat']=generateIssuedAt();return createJwt(_0x32da4c);};exports[_0xb6cd('0x57')]=function(_0x132982,_0x1e3e57){var _0x3bae86=_0x132982[_0xb6cd('0x3e')]['apikey'];if(_0x3bae86){var _0x5a4765={'nonce':_0x1e3e57[_0xb6cd('0x54')],'iat':_0x1e3e57[_0xb6cd('0x55')],'audience':hardwareConf[_0xb6cd('0x3d')](),'issuer':hardwareConf[_0xb6cd('0x3d')]()};return verifyJwt(_0x3bae86,_0x5a4765)[_0xb6cd('0x29')](function(){return generateApiKey(_0x1e3e57);});}else{throw{'message':'Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one'};}};exports['validatePasswordPattern']=function(_0x3adad8){var _0x2b1bb6=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x2b1bb6[_0xb6cd('0x58')](_0x3adad8))throw new db[(_0xb6cd('0x59'))][(_0xb6cd('0x5a'))](_0xb6cd('0x5b'));return;};exports['validatePasswordHistory']=function(_0x19a1ee,_0x2ebab9,_0x1ddb86){var _0x3676da=encryptor[_0xb6cd('0x5c')](_0x2ebab9)[_0xb6cd('0x5d')](',');for(var _0x50aa71=0x0;_0x50aa71<_0x1ddb86;_0x50aa71++){if(!_0x3676da[_0x50aa71])break;if(_0x19a1ee['toLowerCase']()===_0x3676da[_0x50aa71][_0xb6cd('0x5e')]()){var _0x5f2b50=util[_0xb6cd('0x5f')]('The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.',_0x1ddb86);if(_0x1ddb86===0x1){_0x5f2b50=_0xb6cd('0x60');}throw new db[(_0xb6cd('0x59'))][(_0xb6cd('0x5a'))](_0x5f2b50);}}return;};exports[_0xb6cd('0x61')]=function(_0x44ed4a,_0x30c8d2){var _0x46de0a=_0x30c8d2?encryptor[_0xb6cd('0x5c')](_0x30c8d2)[_0xb6cd('0x5d')](','):[];if(_0x46de0a[_0xb6cd('0x62')]===0x5){_0x46de0a['splice'](-0x1,0x1);}_0x46de0a['unshift'](_0x44ed4a);return encryptor[_0xb6cd('0x63')](_0x46de0a[_0xb6cd('0x64')](','));};function signJwt(_0x31023a){var _0x43cf4b=BPromise[_0xb6cd('0x65')](jwt[_0xb6cd('0x66')],{'context':jwt});var _0x1a970c=_0x31023a[_0xb6cd('0x67')]||config[_0xb6cd('0x9')][_0xb6cd('0xa')];return new BPromise(function(_0x1e6f6a,_0x1e747d){_0x43cf4b(_0x31023a[_0xb6cd('0x68')],_0x1a970c,_0x31023a[_0xb6cd('0x69')])[_0xb6cd('0x29')](function(_0x3b7b86){_0x1e6f6a(_0x3b7b86);})['catch'](function(_0x1e093e){_0x1e747d(_0x1e093e);});});}function verifyJwt(_0x176dc4,_0x1d8e21,_0x357290){var _0x522b16=BPromise['promisify'](jwt[_0xb6cd('0x6a')],{'context':jwt});var _0x8a37e7=_0x357290||config[_0xb6cd('0x9')][_0xb6cd('0xa')];return new BPromise(function(_0x273b69,_0x1b49b1){_0x522b16(_0x176dc4,_0x8a37e7,_0x1d8e21)[_0xb6cd('0x29')](function(_0x10d266){_0x273b69(_0x10d266);})['catch'](function(_0x23681a){_0x1b49b1(_0x23681a);});});}function generateNonce(){return crypto[_0xb6cd('0x6b')](0x10)[_0xb6cd('0x6c')](_0xb6cd('0x6d'));}function generateIssuedAt(){return Math[_0xb6cd('0x6e')](Date[_0xb6cd('0x6f')]()/0x3e8)['toString']();}function createJwt(_0x3db74b){var _0x218738={'payload':{'iat':_0x3db74b['apiKeyIat'],'nonce':_0x3db74b[_0xb6cd('0x54')]},'options':{'algorithm':'HS512','subject':_0x3db74b['id'][_0xb6cd('0x6c')](),'issuer':hardwareConf[_0xb6cd('0x3d')](),'audience':hardwareConf['getUuid']()}};return signJwt(_0x218738)[_0xb6cd('0x29')](function(_0x43a434){return{'iat':_0x3db74b[_0xb6cd('0x55')],'nonce':_0x3db74b[_0xb6cd('0x54')],'token':_0x43a434};});} \ No newline at end of file +var _0x4154=['apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','disabled','Invalid\x20API\x20access\x20key','blocked','blockedAt','minutes','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','getLicense','Forbidden','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','motion.token','send','retrieveApiKey','isNil','apiKeyIat','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','validatePasswordPattern','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','decryptString','split','toLowerCase','The\x20password\x20must\x20be\x20different\x20from\x20the\x20previous\x20%d\x20passwords.\x20Please\x20choose\x20another\x20one.','The\x20password\x20must\x20be\x20different\x20from\x20the\x20last\x20one.\x20Please\x20choose\x20another\x20one.','Sequelize','updatePasswordsHistory','length','unshift','encryptString','promisify','sign','session','payload','options','verify','secrets','randomBytes','hex','now','HS512','toString','../../mysqldb','../../config/environment','../../config/license/hardware','../../config/license/util','../encryptor','lodash','jsonwebtoken','composable-middleware','basic-auth','crypto','bluebird','moment','role','fullname','name','internal','email','userpic','permissions','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','pauseType','showWebBar','lastLoginAt','allowmessenger','passwordResetAt','alias','phoneBarAutoAnswerDelay','phoneBarDnd','phoneBarEnableRecording','phoneBarEnableSettings','hotdesk','userProfileId','privacyEnabled','wssPort','downloadVoiceRecordings','downloadOmnichannelInteractions','downloadAttachments','isChatInteractionAuthorized','use','user','closed','disposition','then','status','unmanaged','Unmanaged.','Forbidden.','catch','isAuthenticated','headers','authorization','startsWith','User','find','pass','json','Wrong\x20credentials.','Unknown\x20authorization\x20format','query','apikey','getUuid','sub','Setting','findOne','allowedLoginAttempts','blockDuration','isEqual'];(function(_0x24e3f6,_0x2aaf77){var _0x5ccc20=function(_0xd1bda8){while(--_0xd1bda8){_0x24e3f6['push'](_0x24e3f6['shift']());}};_0x5ccc20(++_0x2aaf77);}(_0x4154,0xac));var _0x4415=function(_0xf168d3,_0x43dcfc){_0xf168d3=_0xf168d3-0x0;var _0x17fb54=_0x4154[_0xf168d3];return _0x17fb54;};'use strict';var db=require(_0x4415('0x0'))['db'];var config=require(_0x4415('0x1'));var hardwareConf=require(_0x4415('0x2'));var licenseUtil=require(_0x4415('0x3'));var encryptor=require(_0x4415('0x4'));var _=require(_0x4415('0x5'));var jwt=require(_0x4415('0x6'));var expressJwt=require('express-jwt');var compose=require(_0x4415('0x7'));var basicAuth=require(_0x4415('0x8'));var crypto=require(_0x4415('0x9'));var BPromise=require(_0x4415('0xa'));var util=require('util');var moment=require(_0x4415('0xb'));var validateJwt=expressJwt({'secret':config['secrets']['session']});var userAttributes=['id',_0x4415('0xc'),_0x4415('0xd'),_0x4415('0xe'),_0x4415('0xf'),_0x4415('0x10'),_0x4415('0x11'),_0x4415('0x12'),'md5secret',_0x4415('0x13'),_0x4415('0x14'),_0x4415('0x15'),_0x4415('0x16'),_0x4415('0x17'),_0x4415('0x18'),_0x4415('0x19'),_0x4415('0x1a'),_0x4415('0x1b'),'lastPauseAt','crudPermissions',_0x4415('0x1c'),_0x4415('0x1d'),_0x4415('0x1e'),'phoneBarAutoAnswer',_0x4415('0x1f'),_0x4415('0x20'),_0x4415('0x21'),'phoneBarEnableDtmfTone',_0x4415('0x22'),'phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort',_0x4415('0x23'),'interface',_0x4415('0x24'),_0x4415('0x25'),'settingsEnabled',_0x4415('0x26'),_0x4415('0x27'),_0x4415('0x28'),_0x4415('0x29')];exports[_0x4415('0x2a')]=function(){return this['isAuthenticated'](!![])[_0x4415('0x2b')](function(_0x2b3c76,_0x555e61,_0x1986aa){if(_0x2b3c76[_0x4415('0x2c')]){_0x1986aa();}else{return db['ChatInteraction']['findOne']({'where':{'id':_0x2b3c76['params']['id']},'attributes':['id',_0x4415('0x2d'),_0x4415('0x2e')],'raw':!![]})[_0x4415('0x2f')](function(_0x4e4f42){if(_0x4e4f42&&_0x4e4f42[_0x4415('0x2d')]){return _0x555e61[_0x4415('0x30')](_0x4e4f42[_0x4415('0x2e')]===_0x4415('0x31')?0x195:0x193)['json']({'message':_0x4e4f42[_0x4415('0x2e')]===_0x4415('0x31')?_0x4415('0x32'):_0x4415('0x33')});}else{_0x1986aa();}})[_0x4415('0x34')](function(_0x3a68ab){_0x1986aa(_0x3a68ab);});}});};exports[_0x4415('0x35')]=function isAuthenticated(_0x2f9f9e){return compose()[_0x4415('0x2b')](function(_0x1e2eb5,_0x98e28,_0x25de9){var _0x481fab;if(_0x1e2eb5[_0x4415('0x36')][_0x4415('0x37')]){if(_[_0x4415('0x38')](_0x1e2eb5[_0x4415('0x36')][_0x4415('0x37')],'Basic')){var _0x16c8cb=basicAuth(_0x1e2eb5);db[_0x4415('0x39')][_0x4415('0x3a')]({'where':{'name':_0x16c8cb['name']}})[_0x4415('0x2f')](function(_0x34414f){if(!_0x34414f||!_0x34414f['authenticate'](_0x16c8cb[_0x4415('0x3b')])){return _0x98e28[_0x4415('0x30')](0x191)[_0x4415('0x3c')]({'message':_0x4415('0x3d')});}_0x1e2eb5[_0x4415('0x2c')]={'id':_0x34414f['id']};_0x25de9();})[_0x4415('0x34')](function(_0x3c9832){_0x25de9(_0x3c9832);});}else if(_[_0x4415('0x38')](_0x1e2eb5[_0x4415('0x36')][_0x4415('0x37')],'Bearer')){validateJwt(_0x1e2eb5,_0x98e28,_0x25de9);}else{if(_0x2f9f9e){_0x25de9();}else{return _0x98e28[_0x4415('0x30')](0x193)['json']({'message':_0x4415('0x3e')});}}}else if(_0x1e2eb5[_0x4415('0x3f')][_0x4415('0x40')]){try{var _0x4ecc04={'audience':hardwareConf[_0x4415('0x41')](),'issuer':hardwareConf[_0x4415('0x41')]()};verifyJwt(_0x1e2eb5[_0x4415('0x3f')][_0x4415('0x40')],_0x4ecc04)[_0x4415('0x2f')](function(_0x42fb05){return db[_0x4415('0x39')][_0x4415('0x3a')]({'where':{'id':_0x42fb05[_0x4415('0x42')]}})[_0x4415('0x2f')](function(_0x13e92f){_0x481fab=_0x13e92f;return db[_0x4415('0x43')][_0x4415('0x44')]({'where':{'id':0x1},'attributes':[_0x4415('0x45'),_0x4415('0x46')],'raw':!![]});})[_0x4415('0x2f')](function(_0x555ff1){if(!_0x481fab||!_[_0x4415('0x47')](_0x481fab[_0x4415('0x48')],_0x42fb05[_0x4415('0x49')])){return _0x98e28[_0x4415('0x30')](0x191)[_0x4415('0x3c')]({'message':_0x4415('0x4a')});}if(_0x481fab[_0x4415('0x4b')]){return _0x98e28['status'](0x191)[_0x4415('0x3c')]({'message':_0x4415('0x4c')});}if(_0x481fab[_0x4415('0x4d')]){if(_0x555ff1[_0x4415('0x46')]>0x0){if(moment(_0x481fab[_0x4415('0x4e')])['add'](_0x555ff1['blockDuration'],_0x4415('0x4f'))>moment()){return _0x98e28[_0x4415('0x30')](0x191)['json']({'message':_0x4415('0x4c')});}}else{return _0x98e28['status'](0x191)[_0x4415('0x3c')]({'message':_0x4415('0x4c')});}}_0x1e2eb5['user']={'id':_0x481fab['id']};_0x25de9();});})[_0x4415('0x34')](function(){return _0x98e28[_0x4415('0x30')](0x191)[_0x4415('0x3c')]({'message':_0x4415('0x4c')});});}catch(_0x36aaef){_0x25de9(_0x36aaef);}}else if(_0x2f9f9e){_0x25de9();}else{return _0x98e28['status'](0x193)[_0x4415('0x3c')]({'message':_0x4415('0x3e')});}})['use'](function(_0x4cb72b,_0x47f79a,_0x4c29c3){if(_0x4cb72b[_0x4415('0x2c')]){db[_0x4415('0x39')][_0x4415('0x3a')]({'where':{'id':_0x4cb72b[_0x4415('0x2c')]['id']},'attributes':userAttributes})['then'](function(_0x3b0fcc){if(!_0x3b0fcc){return _0x47f79a[_0x4415('0x30')](0x194)[_0x4415('0x3c')]({'message':_0x4415('0x50')});}_0x4cb72b[_0x4415('0x2c')]=_0x3b0fcc;_0x4c29c3();})[_0x4415('0x34')](function(_0x51596e){_0x4c29c3(_0x51596e);});}else if(_0x2f9f9e){_0x4c29c3();}else{return _0x47f79a[_0x4415('0x30')](0x194)[_0x4415('0x3c')]({'message':_0x4415('0x51')});}});};exports[_0x4415('0x52')]=function canUpdate(){return compose()[_0x4415('0x2b')](function(_0x5d4a0b,_0x3534bc,_0x2b546a){return licenseUtil[_0x4415('0x53')]()[_0x4415('0x2f')](function(_0x229dca){if(_0x229dca['update']){_0x2b546a();}else{return _0x3534bc['status'](0x193)[_0x4415('0x3c')]({'message':_0x4415('0x54')});}})[_0x4415('0x34')](function(_0x631d5c){_0x2b546a(_0x631d5c);});});};exports[_0x4415('0x55')]=function(_0x523353,_0x229e64,_0xa12580){_0x523353[_0x4415('0x55')]=!![];return _0xa12580();};exports[_0x4415('0x56')]=function signToken(_0x3a2771){return signJwt(_0x3a2771);};exports[_0x4415('0x57')]=function(_0xc28f4b,_0x2d4a6c){if(!_0xc28f4b[_0x4415('0x2c')]){return _0x2d4a6c[_0x4415('0x30')](0x194)['json']({'message':_0x4415('0x58')});}var _0x244a02={'payload':{'id':_0xc28f4b['user']['id'],'role':_0xc28f4b[_0x4415('0x2c')][_0x4415('0xc')]},'options':{'expiresIn':0x15180}};return signJwt(_0x244a02)[_0x4415('0x2f')](function(_0x3be97e){_0x2d4a6c[_0x4415('0x59')](_0x4415('0x5a'),_0x3be97e);_0x2d4a6c['redirect']('/dashboards/general');})['catch'](function(_0x4380e5){return _0x2d4a6c['status'](0x1f4)[_0x4415('0x5b')](_0x4380e5);});};exports[_0x4415('0x5c')]=function(_0x4970c6){if(_[_0x4415('0x5d')](_0x4970c6['apiKeyNonce'])||_[_0x4415('0x5d')](_0x4970c6['apiKeyIat'])){return null;}else{return createJwt(_0x4970c6);}};exports['generateApiKey']=function(_0x172c15){_0x172c15[_0x4415('0x48')]=generateNonce();_0x172c15[_0x4415('0x5e')]=generateIssuedAt();return createJwt(_0x172c15);};exports[_0x4415('0x5f')]=function(_0x318b49,_0x2538ea){var _0x1b7985=_0x318b49['query'][_0x4415('0x40')];if(_0x1b7985){var _0x4370ea={'nonce':_0x2538ea[_0x4415('0x48')],'iat':_0x2538ea[_0x4415('0x5e')],'audience':hardwareConf[_0x4415('0x41')](),'issuer':hardwareConf[_0x4415('0x41')]()};return verifyJwt(_0x1b7985,_0x4370ea)['then'](function(){return generateApiKey(_0x2538ea);});}else{throw{'message':_0x4415('0x60')};}};exports[_0x4415('0x61')]=function(_0x64fe40){var _0x40d4b0=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(!_0x40d4b0['test'](_0x64fe40))throw new db['Sequelize'][(_0x4415('0x62'))](_0x4415('0x63'));return;};exports['validatePasswordHistory']=function(_0x43ebd8,_0x2d6d44,_0x98ab8f){var _0x2bdf57=encryptor[_0x4415('0x64')](_0x2d6d44)[_0x4415('0x65')](',');for(var _0x14c1cc=0x0;_0x14c1cc<_0x98ab8f;_0x14c1cc++){if(!_0x2bdf57[_0x14c1cc])break;if(_0x43ebd8['toLowerCase']()===_0x2bdf57[_0x14c1cc][_0x4415('0x66')]()){var _0x19a8da=util['format'](_0x4415('0x67'),_0x98ab8f);if(_0x98ab8f===0x1){_0x19a8da=_0x4415('0x68');}throw new db[(_0x4415('0x69'))]['ValidationError'](_0x19a8da);}}return;};exports[_0x4415('0x6a')]=function(_0x1d93ff,_0x1b61c8){var _0xa70216=_0x1b61c8?encryptor['decryptString'](_0x1b61c8)[_0x4415('0x65')](','):[];if(_0xa70216[_0x4415('0x6b')]===0x5){_0xa70216['splice'](-0x1,0x1);}_0xa70216[_0x4415('0x6c')](_0x1d93ff);return encryptor[_0x4415('0x6d')](_0xa70216['join'](','));};function signJwt(_0x239fb0){var _0x3a8233=BPromise[_0x4415('0x6e')](jwt[_0x4415('0x6f')],{'context':jwt});var _0x143c82=_0x239fb0['secret']||config['secrets'][_0x4415('0x70')];return new BPromise(function(_0xda2e90,_0x1fca2e){_0x3a8233(_0x239fb0[_0x4415('0x71')],_0x143c82,_0x239fb0[_0x4415('0x72')])['then'](function(_0xf694bc){_0xda2e90(_0xf694bc);})['catch'](function(_0x285a2b){_0x1fca2e(_0x285a2b);});});}function verifyJwt(_0x19714c,_0x545700,_0x2e3853){var _0x1c304a=BPromise[_0x4415('0x6e')](jwt[_0x4415('0x73')],{'context':jwt});var _0xed79f0=_0x2e3853||config[_0x4415('0x74')][_0x4415('0x70')];return new BPromise(function(_0x385b21,_0x2a8a2a){_0x1c304a(_0x19714c,_0xed79f0,_0x545700)[_0x4415('0x2f')](function(_0x83e92b){_0x385b21(_0x83e92b);})[_0x4415('0x34')](function(_0x5a3b8d){_0x2a8a2a(_0x5a3b8d);});});}function generateNonce(){return crypto[_0x4415('0x75')](0x10)['toString'](_0x4415('0x76'));}function generateIssuedAt(){return Math['floor'](Date[_0x4415('0x77')]()/0x3e8)['toString']();}function createJwt(_0x3ffc76){var _0x531d4f={'payload':{'iat':_0x3ffc76['apiKeyIat'],'nonce':_0x3ffc76[_0x4415('0x48')]},'options':{'algorithm':_0x4415('0x78'),'subject':_0x3ffc76['id'][_0x4415('0x79')](),'issuer':hardwareConf['getUuid'](),'audience':hardwareConf[_0x4415('0x41')]()}};return signJwt(_0x531d4f)[_0x4415('0x2f')](function(_0x478f0f){return{'iat':_0x3ffc76[_0x4415('0x5e')],'nonce':_0x3ffc76['apiKeyNonce'],'token':_0x478f0f};});} \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index aac40b9..6f98309 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 _0xc35a=['final','unlink','encryptString','secret','base64','decryptString','utf8','crypto','lodash','app','secrets','session','aes-256-ctr','aes192','encrypt','algorithm','error','test','getCiphers','filter','indexOf','hasOwnProperty','createWriteStream','createCipher','data','binary','write','end','close','decryptFile','createReadStream','createDecipher','update'];(function(_0x2b7764,_0x2606f1){var _0x848dcb=function(_0x1ae85b){while(--_0x1ae85b){_0x2b7764['push'](_0x2b7764['shift']());}};_0x848dcb(++_0x2606f1);}(_0xc35a,0x151));var _0xac35=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xc35a[_0x3b380d];return _0x54502b;};'use strict';var crypto=require(_0xac35('0x0'));var fs=require('fs');var BPromise=require('bluebird');var _=require(_0xac35('0x1'));var config=require('../../config/environment');var logger=require('../../config/logger')(_0xac35('0x2'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0xac35('0x3')][_0xac35('0x4')],'algorithm':_0xac35('0x5')};const fileOptions={'algorithm':_0xac35('0x6')};if(config[_0xac35('0x7')]&&config[_0xac35('0x7')][_0xac35('0x8')]){var isSupported=isAlgorithmSupported(config[_0xac35('0x7')][_0xac35('0x8')]);if(isSupported){fileOptions['algorithm']=config[_0xac35('0x7')][_0xac35('0x8')];}else{var supportedAlgorithms=getSupportedCiphers()['join'](',\x20');logger[_0xac35('0x9')](config[_0xac35('0x7')][_0xac35('0x8')],'is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:',supportedAlgorithms);}}function isASupportedCipher(_0x25ec43){return AES_SUPPORTED_RX[_0xac35('0xa')](_0x25ec43);}function getSupportedCiphers(){return crypto[_0xac35('0xb')]()[_0xac35('0xc')](isASupportedCipher);}function isAlgorithmSupported(_0x4619b1){return getSupportedCiphers()[_0xac35('0xd')](_0x4619b1)>-0x1;}function combineOptions(_0x37c879){var _0x138105={};for(var _0x4444ab in fileOptions){if(fileOptions[_0xac35('0xe')](_0x4444ab)){_0x138105[_0x4444ab]=fileOptions[_0x4444ab];}}if(_0x37c879){for(var _0x154943 in _0x37c879){if(_0x37c879[_0xac35('0xe')](_0x154943)){_0x138105[_0x154943]=_0x37c879[_0x154943];}}}return _0x138105;}exports['encryptFile']=function(_0x21abe3,_0x8df1bf,_0x132f62,_0x454fbc){return new BPromise(function(_0x257bf9,_0x87d63e){_0x454fbc=combineOptions(_0x454fbc);var _0x2cad23=new Buffer(_0x132f62);var _0x5c4a93=fs['createReadStream'](_0x21abe3);var _0x133b80=fs[_0xac35('0xf')](_0x8df1bf);var _0x14de41=crypto[_0xac35('0x10')](_0x454fbc[_0xac35('0x8')],_0x2cad23);_0x5c4a93['on'](_0xac35('0x11'),function(_0x2a0e95){var _0x5484f5=new Buffer(_0x14de41['update'](_0x2a0e95),_0xac35('0x12'));_0x133b80[_0xac35('0x13')](_0x5484f5);});_0x5c4a93['on'](_0xac35('0x14'),function(){try{var _0x4c4a14=new Buffer(_0x14de41['final'](_0xac35('0x12')),_0xac35('0x12'));_0x133b80['write'](_0x4c4a14);_0x133b80[_0xac35('0x14')]();_0x133b80['on'](_0xac35('0x15'),function(){return _0x257bf9(_0x8df1bf);});}catch(_0x44731e){fs['unlink'](_0x8df1bf);return _0x87d63e(_0x44731e);}});});};exports[_0xac35('0x16')]=function(_0x156b53,_0x553a9e,_0x47092c,_0x76b77d){return new BPromise(function(_0x198f31,_0x4cb290){_0x76b77d=combineOptions(_0x76b77d);var _0x301f2d=new Buffer(_0x47092c);var _0x3cfdbb=fs[_0xac35('0x17')](_0x156b53);var _0x1cbae3=fs[_0xac35('0xf')](_0x553a9e);var _0x5f3d6d=crypto[_0xac35('0x18')](_0x76b77d[_0xac35('0x8')],_0x301f2d);_0x3cfdbb['on'](_0xac35('0x11'),function(_0x3d6474){var _0x2869c8=new Buffer(_0x5f3d6d[_0xac35('0x19')](_0x3d6474),_0xac35('0x12'));_0x1cbae3[_0xac35('0x13')](_0x2869c8);});_0x3cfdbb['on'](_0xac35('0x14'),function(){try{var _0x373f01=new Buffer(_0x5f3d6d[_0xac35('0x1a')](_0xac35('0x12')),_0xac35('0x12'));_0x1cbae3[_0xac35('0x13')](_0x373f01);_0x1cbae3[_0xac35('0x14')]();_0x1cbae3['on']('close',function(){return _0x198f31(_0x553a9e);});}catch(_0x3b82d1){fs[_0xac35('0x1b')](_0x553a9e);return _0x4cb290(_0x3b82d1);}});});};exports[_0xac35('0x1c')]=function(_0xba9491,_0x491076,_0x4f5a4a){var _0x1e14c2=_0x4f5a4a||stringOptions[_0xac35('0x8')];var _0x550fad=_0x491076||stringOptions[_0xac35('0x1d')];var _0x43dec6=crypto[_0xac35('0x10')](_0x1e14c2,_0x550fad);var _0x1325ed=_0x43dec6[_0xac35('0x19')](_0xba9491,'utf8',_0xac35('0x1e'));_0x1325ed+=_0x43dec6[_0xac35('0x1a')](_0xac35('0x1e'));return _0x1325ed;};exports[_0xac35('0x1f')]=function(_0x79e854,_0x2da52a,_0x46129c){var _0x7df208=_0x46129c||stringOptions['algorithm'];var _0x25ba7f=_0x2da52a||stringOptions[_0xac35('0x1d')];var _0x28ebaf=crypto['createDecipher'](_0x7df208,_0x25ba7f);var _0x3bec5d=_0x28ebaf[_0xac35('0x19')](_0x79e854,_0xac35('0x1e'),_0xac35('0x20'));_0x3bec5d+=_0x28ebaf[_0xac35('0x1a')]('utf8');return _0x3bec5d;}; \ No newline at end of file +var _0x6b84=['indexOf','hasOwnProperty','encryptFile','createReadStream','createWriteStream','createCipher','update','binary','write','end','close','unlink','decryptFile','createDecipher','data','encryptString','utf8','final','base64','secret','crypto','../../config/environment','app','secrets','session','aes-256-ctr','aes192','encrypt','algorithm','join','is\x20not\x20a\x20supported\x20algorithm.\x20Your\x20system\x20supports\x20the\x20following\x20algorithms:','test','filter'];(function(_0x34c8e5,_0x5b8ab0){var _0x2ae912=function(_0x4893c7){while(--_0x4893c7){_0x34c8e5['push'](_0x34c8e5['shift']());}};_0x2ae912(++_0x5b8ab0);}(_0x6b84,0xb9));var _0x46b8=function(_0x28ce64,_0x5b4c95){_0x28ce64=_0x28ce64-0x0;var _0x3d26db=_0x6b84[_0x28ce64];return _0x3d26db;};'use strict';var crypto=require(_0x46b8('0x0'));var fs=require('fs');var BPromise=require('bluebird');var _=require('lodash');var config=require(_0x46b8('0x1'));var logger=require('../../config/logger')(_0x46b8('0x2'));const AES_SUPPORTED_RX=/^aes(-)?\d{3}(-(cbc|cfb|ctr)(1|8)?){0,1}$/;const stringOptions={'secret':config[_0x46b8('0x3')][_0x46b8('0x4')],'algorithm':_0x46b8('0x5')};const fileOptions={'algorithm':_0x46b8('0x6')};if(config[_0x46b8('0x7')]&&config[_0x46b8('0x7')]['algorithm']){var isSupported=isAlgorithmSupported(config[_0x46b8('0x7')][_0x46b8('0x8')]);if(isSupported){fileOptions[_0x46b8('0x8')]=config[_0x46b8('0x7')][_0x46b8('0x8')];}else{var supportedAlgorithms=getSupportedCiphers()[_0x46b8('0x9')](',\x20');logger['error'](config[_0x46b8('0x7')][_0x46b8('0x8')],_0x46b8('0xa'),supportedAlgorithms);}}function isASupportedCipher(_0xd52345){return AES_SUPPORTED_RX[_0x46b8('0xb')](_0xd52345);}function getSupportedCiphers(){return crypto['getCiphers']()[_0x46b8('0xc')](isASupportedCipher);}function isAlgorithmSupported(_0x56b4ef){return getSupportedCiphers()[_0x46b8('0xd')](_0x56b4ef)>-0x1;}function combineOptions(_0x146f5b){var _0x26587b={};for(var _0xc5037b in fileOptions){if(fileOptions[_0x46b8('0xe')](_0xc5037b)){_0x26587b[_0xc5037b]=fileOptions[_0xc5037b];}}if(_0x146f5b){for(var _0x4cca8c in _0x146f5b){if(_0x146f5b[_0x46b8('0xe')](_0x4cca8c)){_0x26587b[_0x4cca8c]=_0x146f5b[_0x4cca8c];}}}return _0x26587b;}exports[_0x46b8('0xf')]=function(_0x3cbc48,_0x39377a,_0x34427b,_0x3b8f02){return new BPromise(function(_0x397305,_0x5e9249){_0x3b8f02=combineOptions(_0x3b8f02);var _0x3209ef=new Buffer(_0x34427b);var _0xe03039=fs[_0x46b8('0x10')](_0x3cbc48);var _0x5335bc=fs[_0x46b8('0x11')](_0x39377a);var _0x2aa8db=crypto[_0x46b8('0x12')](_0x3b8f02[_0x46b8('0x8')],_0x3209ef);_0xe03039['on']('data',function(_0x40801f){var _0x415384=new Buffer(_0x2aa8db[_0x46b8('0x13')](_0x40801f),_0x46b8('0x14'));_0x5335bc[_0x46b8('0x15')](_0x415384);});_0xe03039['on'](_0x46b8('0x16'),function(){try{var _0x33579d=new Buffer(_0x2aa8db['final']('binary'),_0x46b8('0x14'));_0x5335bc['write'](_0x33579d);_0x5335bc[_0x46b8('0x16')]();_0x5335bc['on'](_0x46b8('0x17'),function(){return _0x397305(_0x39377a);});}catch(_0x35d5ee){fs[_0x46b8('0x18')](_0x39377a);return _0x5e9249(_0x35d5ee);}});});};exports[_0x46b8('0x19')]=function(_0x2f3fa6,_0x45a316,_0x34d2cd,_0x30795e){return new BPromise(function(_0x1eac11,_0x5d0721){_0x30795e=combineOptions(_0x30795e);var _0x1a8cce=new Buffer(_0x34d2cd);var _0xab4431=fs[_0x46b8('0x10')](_0x2f3fa6);var _0x20fda6=fs['createWriteStream'](_0x45a316);var _0x5e5b30=crypto[_0x46b8('0x1a')](_0x30795e[_0x46b8('0x8')],_0x1a8cce);_0xab4431['on'](_0x46b8('0x1b'),function(_0x199a7f){var _0x222ba7=new Buffer(_0x5e5b30[_0x46b8('0x13')](_0x199a7f),_0x46b8('0x14'));_0x20fda6[_0x46b8('0x15')](_0x222ba7);});_0xab4431['on'](_0x46b8('0x16'),function(){try{var _0x477975=new Buffer(_0x5e5b30['final'](_0x46b8('0x14')),_0x46b8('0x14'));_0x20fda6['write'](_0x477975);_0x20fda6['end']();_0x20fda6['on'](_0x46b8('0x17'),function(){return _0x1eac11(_0x45a316);});}catch(_0x5f5093){fs['unlink'](_0x45a316);return _0x5d0721(_0x5f5093);}});});};exports[_0x46b8('0x1c')]=function(_0x440b3d,_0x9851c9,_0x49b326){var _0x1dacc1=_0x49b326||stringOptions[_0x46b8('0x8')];var _0x252d67=_0x9851c9||stringOptions['secret'];var _0x48b573=crypto[_0x46b8('0x12')](_0x1dacc1,_0x252d67);var _0x4d647d=_0x48b573['update'](_0x440b3d,_0x46b8('0x1d'),'base64');_0x4d647d+=_0x48b573[_0x46b8('0x1e')](_0x46b8('0x1f'));return _0x4d647d;};exports['decryptString']=function(_0x389c67,_0x484e74,_0x4a65fd){var _0x1def35=_0x4a65fd||stringOptions[_0x46b8('0x8')];var _0x213a46=_0x484e74||stringOptions[_0x46b8('0x20')];var _0xc94c58=crypto['createDecipher'](_0x1def35,_0x213a46);var _0x264a43=_0xc94c58[_0x46b8('0x13')](_0x389c67,_0x46b8('0x1f'),_0x46b8('0x1d'));_0x264a43+=_0xc94c58['final'](_0x46b8('0x1d'));return _0x264a43;}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index 71699a9..6f482f9 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 _0xdcbd=['QueryTypes','SELECT','num','Empty','length','range','isInteger','forEach','push','query','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.csv','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','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','exit','util','path','lodash','to-csv','bluebird','zip-dir','rimraf','../../mysqldb','../../config/logger','argv','savename','AnalyticExtractedReport','update','info','format','CSV','Setting','find','split','then','splitSizeCsv','sequelize','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t'];(function(_0x46d21b,_0x21c486){var _0x2756c6=function(_0x5a9654){while(--_0x5a9654){_0x46d21b['push'](_0x46d21b['shift']());}};_0x2756c6(++_0x21c486);}(_0xdcbd,0xc5));var _0xddcb=function(_0x17ab73,_0x49bf68){_0x17ab73=_0x17ab73-0x0;var _0x1cbf0a=_0xdcbd[_0x17ab73];return _0x1cbf0a;};'use strict';var util=require(_0xddcb('0x0'));var path=require(_0xddcb('0x1'));var _=require(_0xddcb('0x2'));var csv=require(_0xddcb('0x3'));var fs=require('fs');var BPromise=require(_0xddcb('0x4'));var zipdir=require(_0xddcb('0x5'));var rimraf=require(_0xddcb('0x6'));var db=require(_0xddcb('0x7'))['db'];var dbH=require('../../mysqldb')['dbH'];var logger=require(_0xddcb('0x8'))('analytics');var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0xddcb('0x9')][0x3];var PATH=process[_0xddcb('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x5d4de4,_0x21ca50){var _0x9b367a={'status':_0x5d4de4};var _0xb1505a={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x21ca50){_0x9b367a[_0xddcb('0xa')]=_0x21ca50;}return db[_0xddcb('0xb')][_0xddcb('0xc')](_0x9b367a,_0xb1505a);}function main(){var _0x555b27=0x1388;var _0x23bb56;logger[_0xddcb('0xd')](util[_0xddcb('0xe')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xddcb('0xf')));return db[_0xddcb('0x10')][_0xddcb('0x11')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xddcb('0x12'),'splitSizeCsv']})[_0xddcb('0x13')](function(_0x112aa3){if(_0x112aa3){_0x23bb56=_0x112aa3;_0x555b27=_0x23bb56[_0xddcb('0x14')]||0x1388;}})[_0xddcb('0x13')](function(){return dbH[_0xddcb('0x15')]['query'](util['format'](_0xddcb('0x16'),QUERY),{'type':dbH['sequelize'][_0xddcb('0x17')][_0xddcb('0x18')]});})['then'](function(_0x4bf20d){if(!_0x4bf20d[0x0][_0xddcb('0x19')]){return analyticExtractedReport(_0xddcb('0x1a'));}var _0x37b737=[];var _0x17c287=0x0;if(_0x23bb56['split']){if(_0x4bf20d&&_0x4bf20d[_0xddcb('0x1b')]){var _0xf8634f=_[_0xddcb('0x1c')](_0x4bf20d[0x0][_0xddcb('0x19')]/_0x555b27);var _0x190c13=Number[_0xddcb('0x1d')](_0x4bf20d[0x0][_0xddcb('0x19')]/_0x555b27)?_0x4bf20d[0x0]['num']%_0x555b27:0x0;_0xf8634f[_0xddcb('0x1e')](function(_0x240ce5){if(_0x240ce5>0x0){_0x17c287+=_0x555b27;}_0x37b737[_0xddcb('0x1f')](dbH[_0xddcb('0x15')][_0xddcb('0x20')](util[_0xddcb('0xe')](_0xddcb('0x21'),QUERY,_0x555b27,_0x17c287),{'type':dbH[_0xddcb('0x15')]['QueryTypes'][_0xddcb('0x18')]}));});if(_0x190c13>0x0){_0x17c287+=_0x555b27;_0x37b737[_0xddcb('0x1f')](dbH['sequelize']['query'](util[_0xddcb('0xe')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x190c13,_0x17c287),{'type':dbH['sequelize']['QueryTypes'][_0xddcb('0x18')]}));}}}else{_0x37b737['push'](dbH[_0xddcb('0x15')][_0xddcb('0x20')](QUERY,{'type':dbH[_0xddcb('0x15')][_0xddcb('0x17')]['SELECT']}));}var _0x23d80b=path[_0xddcb('0x22')](PATH);var _0x242de2=path[_0xddcb('0x23')](PATH,_0xddcb('0x24'));var _0x56c654=_0x23bb56[_0xddcb('0x12')]&&_0x37b737[_0xddcb('0x1b')]>0x1;var _0x136ef7=[];if(!fs[_0xddcb('0x25')](path[_0xddcb('0x26')](_0x23d80b,_0x242de2))&&_0x56c654){fs[_0xddcb('0x27')](path[_0xddcb('0x26')](_0x23d80b,_0x242de2));}return BPromise[_0xddcb('0x28')](_0x37b737,function(_0x4d38a0){_0x136ef7[_0xddcb('0x1f')](_0x4d38a0);})[_0xddcb('0x13')](function(){for(var _0x63b718=0x0;_0x63b718<_0x136ef7['length'];_0x63b718+=0x1){var _0x415b3d;var _0x283ab1=_0x136ef7[_0x63b718];if(_0x56c654){_0x415b3d=path[_0xddcb('0x26')](_0x23d80b,_0x242de2,util[_0xddcb('0xe')](_0xddcb('0x29'),_0x242de2,_0x63b718,'csv'));}else{_0x415b3d=path[_0xddcb('0x26')](_0x23d80b,util['format'](_0xddcb('0x2a'),_0x242de2,_0xddcb('0x2b')));}fs[_0xddcb('0x2c')](_0x415b3d,csv(_0x283ab1));}})['then'](function(){if(_0x56c654){return new Promise(function(_0x58dfb7){zipdir(path[_0xddcb('0x26')](_0x23d80b,_0x242de2),{'saveTo':path[_0xddcb('0x26')](_0x23d80b,util['format']('%s.%s',_0x242de2,_0xddcb('0x2d')))},function(_0x248c73,_0x2cad90){rimraf(path[_0xddcb('0x26')](_0x23d80b,_0x242de2),function(){});_0x58dfb7(_0xddcb('0x2e'));});});}})[_0xddcb('0x13')](function(){logger[_0xddcb('0xd')](util['format'](_0xddcb('0x2f'),EXTRACTED_REPORT_ID,_0xddcb('0xf')));return analyticExtractedReport(_0xddcb('0x30'),_0x56c654?util[_0xddcb('0xe')]('%s.%s',_0x242de2,_0x56c654?_0xddcb('0x2d'):_0xddcb('0x2b')):null);});})[_0xddcb('0x31')](function(_0xeebb5f){logger[_0xddcb('0xd')](util[_0xddcb('0xe')](_0xddcb('0x32'),EXTRACTED_REPORT_ID,'CSV'),util[_0xddcb('0x33')](_0xeebb5f,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xddcb('0x34'));})[_0xddcb('0x35')](function(){process[_0xddcb('0x36')](EXIT_CODE);});}main(); \ No newline at end of file +var _0x8172=['zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','argv','savename','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','find','split','then','splitSizeCsv','sequelize','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','Empty','range','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','query','.csv','length','existsSync','join','mkdirSync','%s%d.%s','%s.%s','csv','writeFileSync','zip','zip\x20finished','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','inspect','Failed','exit','util','lodash','to-csv','bluebird'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x8172,0x122));var _0x2817=function(_0x412357,_0x28c75b){_0x412357=_0x412357-0x0;var _0x3da1bd=_0x8172[_0x412357];return _0x3da1bd;};'use strict';var util=require(_0x2817('0x0'));var path=require('path');var _=require(_0x2817('0x1'));var csv=require(_0x2817('0x2'));var fs=require('fs');var BPromise=require(_0x2817('0x3'));var zipdir=require(_0x2817('0x4'));var rimraf=require(_0x2817('0x5'));var db=require(_0x2817('0x6'))['db'];var dbH=require(_0x2817('0x6'))[_0x2817('0x7')];var logger=require(_0x2817('0x8'))('analytics');var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x2817('0x9')][0x3];var PATH=process[_0x2817('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x4e3171,_0x7333d2){var _0x5cdaab={'status':_0x4e3171};var _0x1cc759={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x7333d2){_0x5cdaab[_0x2817('0xa')]=_0x7333d2;}return db['AnalyticExtractedReport']['update'](_0x5cdaab,_0x1cc759);}function main(){var _0x53d424=0x1388;var _0x410a38;logger[_0x2817('0xb')](util[_0x2817('0xc')](_0x2817('0xd'),EXTRACTED_REPORT_ID,_0x2817('0xe')));return db[_0x2817('0xf')][_0x2817('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x2817('0x11'),'splitSizeCsv']})[_0x2817('0x12')](function(_0x7de207){if(_0x7de207){_0x410a38=_0x7de207;_0x53d424=_0x410a38[_0x2817('0x13')]||0x1388;}})[_0x2817('0x12')](function(){return dbH[_0x2817('0x14')]['query'](util['format'](_0x2817('0x15'),QUERY),{'type':dbH[_0x2817('0x14')][_0x2817('0x16')][_0x2817('0x17')]});})['then'](function(_0x32057c){if(!_0x32057c[0x0][_0x2817('0x18')]){return analyticExtractedReport(_0x2817('0x19'));}var _0x3aa0fb=[];var _0x3d14df=0x0;if(_0x410a38[_0x2817('0x11')]){if(_0x32057c&&_0x32057c['length']){var _0x1a0f28=_[_0x2817('0x1a')](_0x32057c[0x0]['num']/_0x53d424);var _0x52df01=Number[_0x2817('0x1b')](_0x32057c[0x0][_0x2817('0x18')]/_0x53d424)?_0x32057c[0x0]['num']%_0x53d424:0x0;_0x1a0f28[_0x2817('0x1c')](function(_0x39e0ef){if(_0x39e0ef>0x0){_0x3d14df+=_0x53d424;}_0x3aa0fb[_0x2817('0x1d')](dbH['sequelize']['query'](util[_0x2817('0xc')](_0x2817('0x1e'),QUERY,_0x53d424,_0x3d14df),{'type':dbH[_0x2817('0x14')][_0x2817('0x16')][_0x2817('0x17')]}));});if(_0x52df01>0x0){_0x3d14df+=_0x53d424;_0x3aa0fb[_0x2817('0x1d')](dbH[_0x2817('0x14')][_0x2817('0x1f')](util['format']('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x52df01,_0x3d14df),{'type':dbH[_0x2817('0x14')]['QueryTypes'][_0x2817('0x17')]}));}}}else{_0x3aa0fb['push'](dbH['sequelize'][_0x2817('0x1f')](QUERY,{'type':dbH[_0x2817('0x14')][_0x2817('0x16')][_0x2817('0x17')]}));}var _0x1ea8e3=path['dirname'](PATH);var _0x87eb66=path['basename'](PATH,_0x2817('0x20'));var _0x205475=_0x410a38[_0x2817('0x11')]&&_0x3aa0fb[_0x2817('0x21')]>0x1;var _0x5f11ae=[];if(!fs[_0x2817('0x22')](path[_0x2817('0x23')](_0x1ea8e3,_0x87eb66))&&_0x205475){fs[_0x2817('0x24')](path[_0x2817('0x23')](_0x1ea8e3,_0x87eb66));}return BPromise['each'](_0x3aa0fb,function(_0x4d72d0){_0x5f11ae['push'](_0x4d72d0);})[_0x2817('0x12')](function(){for(var _0x20dcd6=0x0;_0x20dcd6<_0x5f11ae['length'];_0x20dcd6+=0x1){var _0x33d88b;var _0x3c2042=_0x5f11ae[_0x20dcd6];if(_0x205475){_0x33d88b=path[_0x2817('0x23')](_0x1ea8e3,_0x87eb66,util['format'](_0x2817('0x25'),_0x87eb66,_0x20dcd6,'csv'));}else{_0x33d88b=path[_0x2817('0x23')](_0x1ea8e3,util[_0x2817('0xc')](_0x2817('0x26'),_0x87eb66,_0x2817('0x27')));}fs[_0x2817('0x28')](_0x33d88b,csv(_0x3c2042));}})[_0x2817('0x12')](function(){if(_0x205475){return new Promise(function(_0x195eae){zipdir(path[_0x2817('0x23')](_0x1ea8e3,_0x87eb66),{'saveTo':path['join'](_0x1ea8e3,util[_0x2817('0xc')]('%s.%s',_0x87eb66,_0x2817('0x29')))},function(_0x18188,_0x481446){rimraf(path['join'](_0x1ea8e3,_0x87eb66),function(){});_0x195eae(_0x2817('0x2a'));});});}})[_0x2817('0x12')](function(){logger[_0x2817('0xb')](util[_0x2817('0xc')](_0x2817('0x2b'),EXTRACTED_REPORT_ID,_0x2817('0xe')));return analyticExtractedReport(_0x2817('0x2c'),_0x205475?util['format'](_0x2817('0x26'),_0x87eb66,_0x205475?_0x2817('0x29'):_0x2817('0x27')):null);});})[_0x2817('0x2d')](function(_0x3b09cb){logger['info'](util['format']('Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x2817('0xe')),util[_0x2817('0x2e')](_0x3b09cb,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x2817('0x2f'));})['finally'](function(){process[_0x2817('0x30')](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index b570506..75f1c5c 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 _0x8cb2=['zip','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','finally','exit','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','%s\x20#%d','channel','interactionId','YYYY-MM-DD','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','createWriteStream','finish','error','end','createPdfKitDocument','path','lodash','pdfmake/src/printer','zip-dir','rimraf','jsdom','JSDOM','window','../../mysqldb','dbH','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','map','tableHeader','toString','value','length','auto','body','keys','forEach','push','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','endDate','header','pageBreak','margin','landscape','Arial','black','right','num','Empty','Setting','find','split','splitSizePdf','then','range','isInteger','sequelize','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','query','dirname','basename','.pdf','existsSync','join','mkdirSync','%s%d.%s','pdf','%s.%s','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','PDF','Completed'];(function(_0x389b61,_0x295144){var _0x2a0da8=function(_0x5f3f39){while(--_0x5f3f39){_0x389b61['push'](_0x389b61['shift']());}};_0x2a0da8(++_0x295144);}(_0x8cb2,0x16b));var _0x28cb=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x8cb2[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require(_0x28cb('0x0'));var fs=require('fs');var util=require('util');var path=require('path');var moment=require('moment');var htmlToPdfmake=require('html-to-pdfmake');var PdfPrinter=require(_0x28cb('0x1'));var zipdir=require(_0x28cb('0x2'));var rimraf=require(_0x28cb('0x3'));var JSDOM=require(_0x28cb('0x4'))[_0x28cb('0x5')];var window=new JSDOM('')[_0x28cb('0x6')];var BPromise=require('bluebird');var db=require(_0x28cb('0x7'))['db'];var dbH=require(_0x28cb('0x7'))[_0x28cb('0x8')];var logger=require('../../config/logger')(_0x28cb('0x9'));var EXTRACTED_REPORT_ID=Number(process[_0x28cb('0xa')][0x2]);var QUERY=process[_0x28cb('0xa')][0x3];var PATH=process[_0x28cb('0xa')][0x4];var NAME=process['argv'][0x5];var FORMAT=_0x28cb('0xb');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x569631,_0x2c7816){var _0x3c68c9={'status':_0x569631};var _0x4b3490={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x2c7816){_0x3c68c9[_0x28cb('0xc')]=_0x2c7816;}return db[_0x28cb('0xd')]['update'](_0x3c68c9,_0x4b3490);}function getHeaders(_0x3a5321){return _[_0x28cb('0xe')](_0x3a5321,function(_0x442d97){return{'text':_0x442d97,'style':_0x28cb('0xf')};});}function getRows(_0x321a7a,_0x369133){return _['map'](_0x369133,function(_0x835c04){return _(_0x835c04)['pick'](_0x321a7a)[_0x28cb('0xe')](function(_0x593b67){return _0x593b67?_[_0x28cb('0x10')](_0x593b67):'';})[_0x28cb('0x11')]();});}function createTable(_0x1fb2f6,_0xb12e46){var _0x4e2341={'widths':_['fill'](Array(_0x1fb2f6[_0x28cb('0x12')]),0x91),'heights':function(_0x5b6c10){return _0x5b6c10===0x0?_0x28cb('0x13'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x164f24=getHeaders(_0x1fb2f6);_0x4e2341[_0x28cb('0x14')]['push'](_0x164f24);var _0xd6cbc3=getRows(_0x1fb2f6,_0xb12e46);_0x4e2341['body']=_0x4e2341['body']['concat'](_0xd6cbc3);return _0x4e2341;}function createTables(_0x27c570){var _0x234574=[];var _0x366dab=_['chunk'](Object[_0x28cb('0x15')](_0x27c570[0x0]),0x5);_0x366dab[_0x28cb('0x16')](function(_0x28ec39){_0x234574[_0x28cb('0x17')](createTable(_0x28ec39,_0x27c570));});return _0x234574;}function getPDFDocDefinition(_0x352e8a){var _0x59b802=util[_0x28cb('0x18')](_0x28cb('0x19'),NAME,EXTRACTED_REPORT[_0x28cb('0x1a')],moment(EXTRACTED_REPORT['startDate'])[_0x28cb('0x18')](FORMAT),moment(EXTRACTED_REPORT[_0x28cb('0x1b')])['format'](FORMAT));var _0x58508b=[];for(var _0x2be2bf=0x0;_0x2be2bf<_0x352e8a[_0x28cb('0x12')];_0x2be2bf++){var _0x50dd01=[];if(_0x2be2bf===0x0){_0x50dd01[_0x28cb('0x17')]({'text':_0x59b802,'style':_0x28cb('0x1c')});}var _0x2d5a9a={'table':_0x352e8a[_0x2be2bf]};if(_0x2be2bf>0x0){_0x2d5a9a[_0x28cb('0x1d')]='before';_0x2d5a9a[_0x28cb('0x1e')]=[0x0,0x46,0x0,0x0];}_0x50dd01[_0x28cb('0x17')](_0x2d5a9a);_0x58508b[_0x28cb('0x17')](_0x50dd01);}return{'pageSize':'A4','pageOrientation':_0x28cb('0x1f'),'content':_0x58508b,'footer':function(_0x446b6d,_0x44a849){return{'text':_0x446b6d['toString']()+'\x20/\x20'+_0x44a849,'style':'footer'};},'defaultStyle':{'font':_0x28cb('0x20')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x28cb('0x21')},'footer':{'alignment':_0x28cb('0x22'),'margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x2694ae){var _0xd18d22=0x1388;var _0x59866d;if(!_0x2694ae[0x0][_0x28cb('0x23')]){return analyticExtractedReport(_0x28cb('0x24'));}return db[_0x28cb('0x25')][_0x28cb('0x26')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x28cb('0x27'),_0x28cb('0x28')]})[_0x28cb('0x29')](function(_0xa299d7){if(_0xa299d7){_0x59866d=_0xa299d7;_0xd18d22=_0x59866d[_0x28cb('0x28')]||0x3e8;}})[_0x28cb('0x29')](function(){var _0x4b5f25=[];var _0xd9c352=0x0;if(_0x59866d['split']){if(_0x2694ae&&_0x2694ae[_0x28cb('0x12')]){var _0x3598b8=_[_0x28cb('0x2a')](_0x2694ae[0x0][_0x28cb('0x23')]/_0xd18d22);var _0x2130f6=Number[_0x28cb('0x2b')](_0x2694ae[0x0][_0x28cb('0x23')]/_0xd18d22)?_0x2694ae[0x0][_0x28cb('0x23')]%_0xd18d22:0x0;_0x3598b8[_0x28cb('0x16')](function(_0x41d34c){if(_0x41d34c>0x0){_0xd9c352+=_0xd18d22;}_0x4b5f25[_0x28cb('0x17')](dbH[_0x28cb('0x2c')]['query'](util[_0x28cb('0x18')](_0x28cb('0x2d'),QUERY,_0xd18d22,_0xd9c352),{'type':dbH[_0x28cb('0x2c')][_0x28cb('0x2e')][_0x28cb('0x2f')]}));});if(_0x2130f6>0x0){_0xd9c352+=_0xd18d22;_0x4b5f25[_0x28cb('0x17')](dbH[_0x28cb('0x2c')]['query'](util[_0x28cb('0x18')](_0x28cb('0x2d'),QUERY,_0x2130f6,_0xd9c352),{'type':dbH[_0x28cb('0x2c')][_0x28cb('0x2e')][_0x28cb('0x2f')]}));}}}else{_0x4b5f25[_0x28cb('0x17')](dbH[_0x28cb('0x2c')][_0x28cb('0x30')](QUERY,{'type':dbH[_0x28cb('0x2c')]['QueryTypes'][_0x28cb('0x2f')]}));}var _0x43eb1d=path[_0x28cb('0x31')](PATH);var _0x4e347f=path[_0x28cb('0x32')](PATH,_0x28cb('0x33'));var _0x33826a=_0x59866d[_0x28cb('0x27')]&&_0x4b5f25[_0x28cb('0x12')]>0x1;var _0xca1aad=[];if(!fs[_0x28cb('0x34')](path[_0x28cb('0x35')](_0x43eb1d,_0x4e347f))&&_0x33826a){fs[_0x28cb('0x36')](path[_0x28cb('0x35')](_0x43eb1d,_0x4e347f));}return BPromise['each'](_0x4b5f25,function(_0x546855){_0xca1aad[_0x28cb('0x17')](_0x546855);})[_0x28cb('0x29')](function(){var _0x47e386=[];for(var _0x456953=0x0;_0x456953<_0xca1aad[_0x28cb('0x12')];_0x456953+=0x1){var _0x2bdf46=_0xca1aad[_0x456953];var _0x42d4fe=createTables(_['flatten'](_0x2bdf46));var _0x577bf2;var _0x18849d=getPDFDocDefinition(_0x42d4fe);var _0x5e15dd=getPDFPrinter();var _0x5c2b66=_0x5e15dd['createPdfKitDocument'](_0x18849d);if(_0x33826a){_0x577bf2=path[_0x28cb('0x35')](_0x43eb1d,_0x4e347f,util[_0x28cb('0x18')](_0x28cb('0x37'),_0x4e347f,_0x456953,_0x28cb('0x38')));}else{_0x577bf2=path[_0x28cb('0x35')](_0x43eb1d,util['format'](_0x28cb('0x39'),_0x4e347f,_0x28cb('0x38')));}_0x47e386[_0x28cb('0x17')](writePDFDocument(_0x5c2b66,_0x577bf2));}return Promise['all'](_0x47e386);})[_0x28cb('0x29')](function(){if(_0x33826a){return new Promise(function(_0x2af1e2){zipdir(path[_0x28cb('0x35')](_0x43eb1d,_0x4e347f),{'saveTo':path[_0x28cb('0x35')](_0x43eb1d,util[_0x28cb('0x18')]('%s.%s',_0x4e347f,'zip'))},function(){rimraf(path['join'](_0x43eb1d,_0x4e347f),function(){});_0x2af1e2('zip\x20finished');});});}})['then'](function(){if(!_0x33826a)return;rimraf(path['join'](_0x43eb1d,_0x4e347f),function(){});})[_0x28cb('0x29')](function(){logger[_0x28cb('0x3a')](util[_0x28cb('0x18')](_0x28cb('0x3b'),EXTRACTED_REPORT_ID,_0x28cb('0x3c')));return analyticExtractedReport(_0x28cb('0x3d'),_0x33826a?util[_0x28cb('0x18')]('%s.%s',_0x4e347f,_0x33826a?_0x28cb('0x3e'):'pdf'):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0x28cb('0x3a')](util[_0x28cb('0x18')](_0x28cb('0x3f'),EXTRACTED_REPORT_ID,'PDF'));return db['AnalyticExtractedReport']['findOne']({'where':{'id':EXTRACTED_REPORT_ID}})[_0x28cb('0x29')](function(_0x219b7c){EXTRACTED_REPORT=_0x219b7c;return dbH[_0x28cb('0x2c')][_0x28cb('0x30')](util[_0x28cb('0x18')](_0x28cb('0x40'),QUERY),{'type':dbH[_0x28cb('0x2c')]['QueryTypes'][_0x28cb('0x2f')]});})[_0x28cb('0x29')](extractReport)[_0x28cb('0x41')](function(_0x22873e){logger[_0x28cb('0x3a')](util['format'](_0x28cb('0x42'),EXTRACTED_REPORT_ID,'PDF'),util[_0x28cb('0x43')](_0x22873e,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport('Failed');})[_0x28cb('0x44')](function(){process[_0x28cb('0x45')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x61efb=new PdfPrinter({'Arial':{'normal':__dirname+'/fonts/arial-regular.ttf','bold':__dirname+_0x28cb('0x46'),'italics':__dirname+_0x28cb('0x47'),'bolditalics':__dirname+'/fonts/arial-bold-italic.ttf'}});return _0x61efb;}function getPDFDocDefinitionFromHTML(_0x5593e7,_0x73c2fe){var _0x3c4cd6=util[_0x28cb('0x18')](_0x28cb('0x48'),_0x73c2fe[_0x28cb('0x49')],_0x73c2fe[_0x28cb('0x4a')]);var _0x11dcf5=moment()[_0x28cb('0x18')](_0x28cb('0x4b'))[_0x28cb('0x10')]();var _0x3609b2=htmlToPdfmake(_0x5593e7,{'window':window,'tableAutoSize':!![]});return{'content':[_0x3609b2],'defaultStyle':{'font':_0x28cb('0x20')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':_0x28cb('0x4c'),'margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0x28cb('0x4c'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0x28cb('0x4c')}},'header':function(){return[{'text':_0x28cb('0x4d'),'style':_0x28cb('0x1c')}];},'footer':function(_0x1c8353,_0x506800){return[{'text':util[_0x28cb('0x18')](_0x28cb('0x4e'),_0x3c4cd6,_0x1c8353,_0x506800,_0x11dcf5),'style':'footer'}];}};}function writePDFDocument(_0x16bbe9,_0x4f4fb5){return new Promise(function(_0x16d57e,_0x3f92a1){var _0x3cb8bb=_0x16bbe9['pipe'](fs[_0x28cb('0x4f')](_0x4f4fb5));_0x3cb8bb['on'](_0x28cb('0x50'),function(){_0x16d57e(_0x28cb('0x50'));});_0x3cb8bb['on'](_0x28cb('0x51'),function(_0x116893){_0x3f92a1(_0x116893);});_0x16bbe9[_0x28cb('0x52')]();});}exports['createPdfFromHTML']=function(_0x5c11f1,_0x3630be){var _0xbeb908=getPDFPrinter();var _0x88216c=getPDFDocDefinitionFromHTML(_0x5c11f1,_0x3630be);var _0xed6656=_0xbeb908[_0x28cb('0x53')](_0x88216c);return writePDFDocument(_0xed6656,_0x3630be[_0x28cb('0x54')])[_0x28cb('0x41')](function(_0x3b8f8e){throw _0x3b8f8e;});}; \ No newline at end of file +var _0xa2bb=['AnalyticExtractedReport','update','map','tableHeader','pick','value','fill','length','auto','body','concat','keys','forEach','format','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','startDate','endDate','push','header','pageBreak','before','margin','landscape','\x20/\x20','footer','Arial','black','Empty','Setting','find','splitSizePdf','then','split','range','num','isInteger','sequelize','query','%s\x20limit\x20%d\x20OFFSET\x20%d','SELECT','QueryTypes','dirname','basename','.pdf','existsSync','join','flatten','%s%d.%s','%s.%s','all','zip','zip\x20finished','info','Completed','pdf','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','PDF','inspect','Failed','exit','/fonts/arial-regular.ttf','/fonts/arial-bold.ttf','/fonts/arial-italic.ttf','%s\x20#%d','channel','YYYY-MM-DD','toString','center','Interaction\x20Transcript','\x09\x09XCALLY\x20Motion\x20-\x20%s\x09\x09\x09\x09%d/%d\x09\x09\x09\x09%s','createWriteStream','finish','error','createPdfFromHTML','createPdfKitDocument','catch','lodash','util','path','moment','html-to-pdfmake','pdfmake/src/printer','zip-dir','rimraf','jsdom','JSDOM','../../mysqldb','dbH','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename'];(function(_0x2fdea1,_0x395c4e){var _0x533867=function(_0x55290e){while(--_0x55290e){_0x2fdea1['push'](_0x2fdea1['shift']());}};_0x533867(++_0x395c4e);}(_0xa2bb,0x10f));var _0xba2b=function(_0x4b0c5e,_0x12b433){_0x4b0c5e=_0x4b0c5e-0x0;var _0x2053a6=_0xa2bb[_0x4b0c5e];return _0x2053a6;};'use strict';var _=require(_0xba2b('0x0'));var fs=require('fs');var util=require(_0xba2b('0x1'));var path=require(_0xba2b('0x2'));var moment=require(_0xba2b('0x3'));var htmlToPdfmake=require(_0xba2b('0x4'));var PdfPrinter=require(_0xba2b('0x5'));var zipdir=require(_0xba2b('0x6'));var rimraf=require(_0xba2b('0x7'));var JSDOM=require(_0xba2b('0x8'))[_0xba2b('0x9')];var window=new JSDOM('')['window'];var BPromise=require('bluebird');var db=require(_0xba2b('0xa'))['db'];var dbH=require(_0xba2b('0xa'))[_0xba2b('0xb')];var logger=require(_0xba2b('0xc'))(_0xba2b('0xd'));var EXTRACTED_REPORT_ID=Number(process[_0xba2b('0xe')][0x2]);var QUERY=process[_0xba2b('0xe')][0x3];var PATH=process[_0xba2b('0xe')][0x4];var NAME=process['argv'][0x5];var FORMAT=_0xba2b('0xf');var EXTRACTED_REPORT;var EXIT_CODE=0x0;function analyticExtractedReport(_0x33b5a4,_0x48cd56){var _0xaaf17b={'status':_0x33b5a4};var _0x45f83e={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x48cd56){_0xaaf17b[_0xba2b('0x10')]=_0x48cd56;}return db[_0xba2b('0x11')][_0xba2b('0x12')](_0xaaf17b,_0x45f83e);}function getHeaders(_0x4b524d){return _[_0xba2b('0x13')](_0x4b524d,function(_0x1a26b5){return{'text':_0x1a26b5,'style':_0xba2b('0x14')};});}function getRows(_0x35c86c,_0x43290c){return _[_0xba2b('0x13')](_0x43290c,function(_0x153732){return _(_0x153732)[_0xba2b('0x15')](_0x35c86c)['map'](function(_0x116687){return _0x116687?_['toString'](_0x116687):'';})[_0xba2b('0x16')]();});}function createTable(_0x39cce3,_0x178e1a){var _0x8d0331={'widths':_[_0xba2b('0x17')](Array(_0x39cce3[_0xba2b('0x18')]),0x91),'heights':function(_0x5b29ce){return _0x5b29ce===0x0?_0xba2b('0x19'):0x32;},'dontBreakRows':!![],'headerRows':0x1,'body':[]};var _0x3c14e0=getHeaders(_0x39cce3);_0x8d0331['body']['push'](_0x3c14e0);var _0x1429ce=getRows(_0x39cce3,_0x178e1a);_0x8d0331['body']=_0x8d0331[_0xba2b('0x1a')][_0xba2b('0x1b')](_0x1429ce);return _0x8d0331;}function createTables(_0x1fbbcf){var _0x131ea9=[];var _0xf4cf56=_['chunk'](Object[_0xba2b('0x1c')](_0x1fbbcf[0x0]),0x5);_0xf4cf56[_0xba2b('0x1d')](function(_0x112c9d){_0x131ea9['push'](createTable(_0x112c9d,_0x1fbbcf));});return _0x131ea9;}function getPDFDocDefinition(_0x4852fc){var _0x395a52=util[_0xba2b('0x1e')](_0xba2b('0x1f'),NAME,EXTRACTED_REPORT['name'],moment(EXTRACTED_REPORT[_0xba2b('0x20')])[_0xba2b('0x1e')](FORMAT),moment(EXTRACTED_REPORT[_0xba2b('0x21')])['format'](FORMAT));var _0x264856=[];for(var _0x56ff6c=0x0;_0x56ff6c<_0x4852fc[_0xba2b('0x18')];_0x56ff6c++){var _0x533fd4=[];if(_0x56ff6c===0x0){_0x533fd4[_0xba2b('0x22')]({'text':_0x395a52,'style':_0xba2b('0x23')});}var _0x18fca6={'table':_0x4852fc[_0x56ff6c]};if(_0x56ff6c>0x0){_0x18fca6[_0xba2b('0x24')]=_0xba2b('0x25');_0x18fca6[_0xba2b('0x26')]=[0x0,0x46,0x0,0x0];}_0x533fd4['push'](_0x18fca6);_0x264856[_0xba2b('0x22')](_0x533fd4);}return{'pageSize':'A4','pageOrientation':_0xba2b('0x27'),'content':_0x264856,'footer':function(_0x4bf377,_0x203772){return{'text':_0x4bf377['toString']()+_0xba2b('0x28')+_0x203772,'style':_0xba2b('0x29')};},'defaultStyle':{'font':_0xba2b('0x2a')},'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0xba2b('0x2b')},'footer':{'alignment':'right','margin':[0x0,0x0,0x28,0x0]}}};}function extractReport(_0x3909d9){var _0x5f4569=0x1388;var _0x285491;if(!_0x3909d9[0x0]['num']){return analyticExtractedReport(_0xba2b('0x2c'));}return db[_0xba2b('0x2d')][_0xba2b('0x2e')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0xba2b('0x2f')]})[_0xba2b('0x30')](function(_0x1c60c4){if(_0x1c60c4){_0x285491=_0x1c60c4;_0x5f4569=_0x285491[_0xba2b('0x2f')]||0x3e8;}})[_0xba2b('0x30')](function(){var _0x3c4f7e=[];var _0x34e048=0x0;if(_0x285491[_0xba2b('0x31')]){if(_0x3909d9&&_0x3909d9[_0xba2b('0x18')]){var _0x18d624=_[_0xba2b('0x32')](_0x3909d9[0x0][_0xba2b('0x33')]/_0x5f4569);var _0x3f2867=Number[_0xba2b('0x34')](_0x3909d9[0x0][_0xba2b('0x33')]/_0x5f4569)?_0x3909d9[0x0][_0xba2b('0x33')]%_0x5f4569:0x0;_0x18d624[_0xba2b('0x1d')](function(_0x27a809){if(_0x27a809>0x0){_0x34e048+=_0x5f4569;}_0x3c4f7e[_0xba2b('0x22')](dbH[_0xba2b('0x35')][_0xba2b('0x36')](util[_0xba2b('0x1e')](_0xba2b('0x37'),QUERY,_0x5f4569,_0x34e048),{'type':dbH[_0xba2b('0x35')]['QueryTypes'][_0xba2b('0x38')]}));});if(_0x3f2867>0x0){_0x34e048+=_0x5f4569;_0x3c4f7e['push'](dbH[_0xba2b('0x35')][_0xba2b('0x36')](util['format'](_0xba2b('0x37'),QUERY,_0x3f2867,_0x34e048),{'type':dbH[_0xba2b('0x35')][_0xba2b('0x39')][_0xba2b('0x38')]}));}}}else{_0x3c4f7e[_0xba2b('0x22')](dbH['sequelize'][_0xba2b('0x36')](QUERY,{'type':dbH[_0xba2b('0x35')]['QueryTypes'][_0xba2b('0x38')]}));}var _0x3bcb6e=path[_0xba2b('0x3a')](PATH);var _0x4fa3c6=path[_0xba2b('0x3b')](PATH,_0xba2b('0x3c'));var _0x426797=_0x285491[_0xba2b('0x31')]&&_0x3c4f7e['length']>0x1;var _0x4d4b2c=[];if(!fs[_0xba2b('0x3d')](path[_0xba2b('0x3e')](_0x3bcb6e,_0x4fa3c6))&&_0x426797){fs['mkdirSync'](path[_0xba2b('0x3e')](_0x3bcb6e,_0x4fa3c6));}return BPromise['each'](_0x3c4f7e,function(_0xd3480a){_0x4d4b2c[_0xba2b('0x22')](_0xd3480a);})[_0xba2b('0x30')](function(){var _0xf53cde=[];for(var _0x5aa012=0x0;_0x5aa012<_0x4d4b2c[_0xba2b('0x18')];_0x5aa012+=0x1){var _0x32f8c5=_0x4d4b2c[_0x5aa012];var _0x138913=createTables(_[_0xba2b('0x3f')](_0x32f8c5));var _0x762b86;var _0x2120fc=getPDFDocDefinition(_0x138913);var _0x4c639d=getPDFPrinter();var _0x4e86c1=_0x4c639d['createPdfKitDocument'](_0x2120fc);if(_0x426797){_0x762b86=path[_0xba2b('0x3e')](_0x3bcb6e,_0x4fa3c6,util[_0xba2b('0x1e')](_0xba2b('0x40'),_0x4fa3c6,_0x5aa012,'pdf'));}else{_0x762b86=path['join'](_0x3bcb6e,util[_0xba2b('0x1e')](_0xba2b('0x41'),_0x4fa3c6,'pdf'));}_0xf53cde[_0xba2b('0x22')](writePDFDocument(_0x4e86c1,_0x762b86));}return Promise[_0xba2b('0x42')](_0xf53cde);})[_0xba2b('0x30')](function(){if(_0x426797){return new Promise(function(_0xca32b7){zipdir(path[_0xba2b('0x3e')](_0x3bcb6e,_0x4fa3c6),{'saveTo':path[_0xba2b('0x3e')](_0x3bcb6e,util[_0xba2b('0x1e')](_0xba2b('0x41'),_0x4fa3c6,_0xba2b('0x43')))},function(){rimraf(path[_0xba2b('0x3e')](_0x3bcb6e,_0x4fa3c6),function(){});_0xca32b7(_0xba2b('0x44'));});});}})[_0xba2b('0x30')](function(){if(!_0x426797)return;rimraf(path[_0xba2b('0x3e')](_0x3bcb6e,_0x4fa3c6),function(){});})['then'](function(){logger[_0xba2b('0x45')](util[_0xba2b('0x1e')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,'PDF'));return analyticExtractedReport(_0xba2b('0x46'),_0x426797?util[_0xba2b('0x1e')]('%s.%s',_0x4fa3c6,_0x426797?_0xba2b('0x43'):_0xba2b('0x47')):null);});});}function main(){if(!EXTRACTED_REPORT_ID)return;logger[_0xba2b('0x45')](util['format'](_0xba2b('0x48'),EXTRACTED_REPORT_ID,'PDF'));return db[_0xba2b('0x11')][_0xba2b('0x49')]({'where':{'id':EXTRACTED_REPORT_ID}})['then'](function(_0x4f9442){EXTRACTED_REPORT=_0x4f9442;return dbH[_0xba2b('0x35')][_0xba2b('0x36')](util[_0xba2b('0x1e')](_0xba2b('0x4a'),QUERY),{'type':dbH[_0xba2b('0x35')]['QueryTypes'][_0xba2b('0x38')]});})[_0xba2b('0x30')](extractReport)['catch'](function(_0x14b55e){logger['info'](util[_0xba2b('0x1e')](_0xba2b('0x4b'),EXTRACTED_REPORT_ID,_0xba2b('0x4c')),util[_0xba2b('0x4d')](_0x14b55e,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xba2b('0x4e'));})['finally'](function(){process[_0xba2b('0x4f')](EXIT_CODE);});}main();function getPDFPrinter(){var _0x32aae4=new PdfPrinter({'Arial':{'normal':__dirname+_0xba2b('0x50'),'bold':__dirname+_0xba2b('0x51'),'italics':__dirname+_0xba2b('0x52'),'bolditalics':__dirname+'/fonts/arial-bold-italic.ttf'}});return _0x32aae4;}function getPDFDocDefinitionFromHTML(_0x25e84a,_0x2fafad){var _0x54943b=util[_0xba2b('0x1e')](_0xba2b('0x53'),_0x2fafad[_0xba2b('0x54')],_0x2fafad['interactionId']);var _0x517907=moment()[_0xba2b('0x1e')](_0xba2b('0x55'))[_0xba2b('0x56')]();var _0x338f0c=htmlToPdfmake(_0x25e84a,{'window':window,'tableAutoSize':!![]});return{'content':[_0x338f0c],'defaultStyle':{'font':_0xba2b('0x2a')},'styles':{'header':{'fontSize':0x12,'bold':!![],'alignment':'center','margin':[0xa,0xa,0xa,0xa]},'footer':{'fontSize':0x9,'alignment':_0xba2b('0x57'),'margin':[0xa,0x14,0xa,0xa]},'textblock':{'fontSize':0xb},'textfield':{'bold':!![]},'messageContainer':{'fontSize':0xa},'messageInfo':{'bold':!![]},'interactionData':{'alignment':_0xba2b('0x57')}},'header':function(){return[{'text':_0xba2b('0x58'),'style':_0xba2b('0x23')}];},'footer':function(_0xd1e8f5,_0x27ca28){return[{'text':util[_0xba2b('0x1e')](_0xba2b('0x59'),_0x54943b,_0xd1e8f5,_0x27ca28,_0x517907),'style':_0xba2b('0x29')}];}};}function writePDFDocument(_0x28431a,_0x5f4f2b){return new Promise(function(_0x3d360c,_0x4052e2){var _0x385573=_0x28431a['pipe'](fs[_0xba2b('0x5a')](_0x5f4f2b));_0x385573['on'](_0xba2b('0x5b'),function(){_0x3d360c(_0xba2b('0x5b'));});_0x385573['on'](_0xba2b('0x5c'),function(_0x4f83ed){_0x4052e2(_0x4f83ed);});_0x28431a['end']();});}exports[_0xba2b('0x5d')]=function(_0x5dad22,_0x259324){var _0x5117df=getPDFPrinter();var _0x49e436=getPDFDocDefinitionFromHTML(_0x5dad22,_0x259324);var _0x1f7a7a=_0x5117df[_0xba2b('0x5e')](_0x49e436);return writePDFDocument(_0x1f7a7a,_0x259324[_0xba2b('0x2')])[_0xba2b('0x5f')](function(_0x2da40e){throw _0x2da40e;});}; \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index 594e4fd..0cdc4a1 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 _0xff6e=['lodash','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','update','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','split','splitSizeXlsx','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','Empty','length','range','isInteger','forEach','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.xlsx','existsSync','join','mkdirSync','each','%s%d.%s','xlsx','%s.%s','writeFileSync','binary','zip','zip\x20finished','info','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','finally','path'];(function(_0x58ae9e,_0x39ba10){var _0x2a9eee=function(_0x174314){while(--_0x174314){_0x58ae9e['push'](_0x58ae9e['shift']());}};_0x2a9eee(++_0x39ba10);}(_0xff6e,0x131));var _0xeff6=function(_0xfedc72,_0x292f02){_0xfedc72=_0xfedc72-0x0;var _0x2c7c78=_0xff6e[_0xfedc72];return _0x2c7c78;};'use strict';var util=require('util');var path=require(_0xeff6('0x0'));var _=require(_0xeff6('0x1'));var fs=require('fs');var json2xls=require('json2xls');var BPromise=require(_0xeff6('0x2'));var zipdir=require(_0xeff6('0x3'));var rimraf=require(_0xeff6('0x4'));var db=require(_0xeff6('0x5'))['db'];var dbH=require(_0xeff6('0x5'))[_0xeff6('0x6')];var logger=require(_0xeff6('0x7'))(_0xeff6('0x8'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process['argv'][0x3];var PATH=process[_0xeff6('0x9')][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x240d36,_0x3e2a78){var _0x652051={'status':_0x240d36};var _0x1152b0={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x3e2a78){_0x652051[_0xeff6('0xa')]=_0x3e2a78;}return db['AnalyticExtractedReport'][_0xeff6('0xb')](_0x652051,_0x1152b0);}function main(){var _0x1b7ac3=0x1388;var _0x3e6a50;logger['info'](util[_0xeff6('0xc')](_0xeff6('0xd'),EXTRACTED_REPORT_ID,_0xeff6('0xe')));return db['Setting']['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xeff6('0xf'),_0xeff6('0x10')]})['then'](function(_0x56b710){if(_0x56b710){_0x3e6a50=_0x56b710;_0x1b7ac3=_0x3e6a50[_0xeff6('0x10')]||0x1388;}})[_0xeff6('0x11')](function(){return dbH[_0xeff6('0x12')][_0xeff6('0x13')](util[_0xeff6('0xc')](_0xeff6('0x14'),QUERY),{'type':dbH[_0xeff6('0x12')][_0xeff6('0x15')][_0xeff6('0x16')]});})[_0xeff6('0x11')](function(_0x17e4b7){if(!_0x17e4b7[0x0][_0xeff6('0x17')]){return analyticExtractedReport(_0xeff6('0x18'));}var _0x7848c2=[];var _0x4fdd00=0x0;if(_0x3e6a50['split']){if(_0x17e4b7&&_0x17e4b7[_0xeff6('0x19')]){var _0x86c59=_[_0xeff6('0x1a')](_0x17e4b7[0x0][_0xeff6('0x17')]/_0x1b7ac3);var _0x48c548=Number[_0xeff6('0x1b')](_0x17e4b7[0x0][_0xeff6('0x17')]/_0x1b7ac3)?_0x17e4b7[0x0][_0xeff6('0x17')]%_0x1b7ac3:0x0;_0x86c59[_0xeff6('0x1c')](function(_0x492b81){if(_0x492b81>0x0){_0x4fdd00+=_0x1b7ac3;}_0x7848c2[_0xeff6('0x1d')](dbH[_0xeff6('0x12')][_0xeff6('0x13')](util[_0xeff6('0xc')](_0xeff6('0x1e'),QUERY,_0x1b7ac3,_0x4fdd00),{'type':dbH[_0xeff6('0x12')][_0xeff6('0x15')][_0xeff6('0x16')]}));});if(_0x48c548>0x0){_0x4fdd00+=_0x1b7ac3;_0x7848c2[_0xeff6('0x1d')](dbH[_0xeff6('0x12')][_0xeff6('0x13')](util[_0xeff6('0xc')](_0xeff6('0x1e'),QUERY,_0x48c548,_0x4fdd00),{'type':dbH[_0xeff6('0x12')][_0xeff6('0x15')][_0xeff6('0x16')]}));}}}else{_0x7848c2[_0xeff6('0x1d')](dbH[_0xeff6('0x12')][_0xeff6('0x13')](QUERY,{'type':dbH[_0xeff6('0x12')][_0xeff6('0x15')][_0xeff6('0x16')]}));}var _0xb0d40c=path[_0xeff6('0x1f')](PATH);var _0x246a6a=path[_0xeff6('0x20')](PATH,_0xeff6('0x21'));var _0x2caa96=_0x3e6a50['split']&&_0x7848c2[_0xeff6('0x19')]>0x1;var _0xdc49a5=[];if(!fs[_0xeff6('0x22')](path[_0xeff6('0x23')](_0xb0d40c,_0x246a6a))&&_0x2caa96){fs[_0xeff6('0x24')](path[_0xeff6('0x23')](_0xb0d40c,_0x246a6a));}return BPromise[_0xeff6('0x25')](_0x7848c2,function(_0x4a76ac){_0xdc49a5[_0xeff6('0x1d')](_0x4a76ac);})[_0xeff6('0x11')](function(){for(var _0x7ca055=0x0;_0x7ca055<_0xdc49a5[_0xeff6('0x19')];_0x7ca055+=0x1){var _0x46788a;var _0x507451=_0xdc49a5[_0x7ca055];if(_0x2caa96){_0x46788a=path['join'](_0xb0d40c,_0x246a6a,util['format'](_0xeff6('0x26'),_0x246a6a,_0x7ca055,_0xeff6('0x27')));}else{_0x46788a=path[_0xeff6('0x23')](_0xb0d40c,util[_0xeff6('0xc')](_0xeff6('0x28'),_0x246a6a,_0xeff6('0x27')));}fs[_0xeff6('0x29')](_0x46788a,json2xls(_0x507451),_0xeff6('0x2a'));}})['then'](function(){if(_0x2caa96){return new Promise(function(_0x4d8660){zipdir(path[_0xeff6('0x23')](_0xb0d40c,_0x246a6a),{'saveTo':path[_0xeff6('0x23')](_0xb0d40c,util[_0xeff6('0xc')](_0xeff6('0x28'),_0x246a6a,_0xeff6('0x2b')))},function(_0x181c3c,_0x195367){rimraf(path[_0xeff6('0x23')](_0xb0d40c,_0x246a6a),function(){});_0x4d8660(_0xeff6('0x2c'));});});}})[_0xeff6('0x11')](function(){logger[_0xeff6('0x2d')](util[_0xeff6('0xc')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,'XLSX'));return analyticExtractedReport(_0xeff6('0x2e'),_0x2caa96?util[_0xeff6('0xc')](_0xeff6('0x28'),_0x246a6a,_0x2caa96?_0xeff6('0x2b'):_0xeff6('0x27')):null);});})[_0xeff6('0x2f')](function(_0x177ed2){logger[_0xeff6('0x2d')](util[_0xeff6('0xc')](_0xeff6('0x30'),EXTRACTED_REPORT_ID,_0xeff6('0xe')),util['inspect'](_0x177ed2,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0xeff6('0x31'));})[_0xeff6('0x32')](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file +var _0x6777=['analytics','argv','AnalyticExtractedReport','update','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','then','splitSizeXlsx','sequelize','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','SELECT','num','split','range','isInteger','forEach','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','push','query','basename','length','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','info','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','finally','util','path','lodash','bluebird','zip-dir','rimraf','../../mysqldb'];(function(_0x30ee21,_0x49ca1b){var _0x5cc3fd=function(_0x212499){while(--_0x212499){_0x30ee21['push'](_0x30ee21['shift']());}};_0x5cc3fd(++_0x49ca1b);}(_0x6777,0xb9));var _0x7677=function(_0x1b5aea,_0x1afe6f){_0x1b5aea=_0x1b5aea-0x0;var _0x51cae9=_0x6777[_0x1b5aea];return _0x51cae9;};'use strict';var util=require(_0x7677('0x0'));var path=require(_0x7677('0x1'));var _=require(_0x7677('0x2'));var fs=require('fs');var json2xls=require('json2xls');var BPromise=require(_0x7677('0x3'));var zipdir=require(_0x7677('0x4'));var rimraf=require(_0x7677('0x5'));var db=require(_0x7677('0x6'))['db'];var dbH=require(_0x7677('0x6'))['dbH'];var logger=require('../../config/logger')(_0x7677('0x7'));var EXTRACTED_REPORT_ID=Number(process[_0x7677('0x8')][0x2]);var QUERY=process[_0x7677('0x8')][0x3];var PATH=process['argv'][0x4];var EXIT_CODE=0x0;function analyticExtractedReport(_0x4c5f3c,_0x329839){var _0x2dd39f={'status':_0x4c5f3c};var _0x1e45d6={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x329839){_0x2dd39f['savename']=_0x329839;}return db[_0x7677('0x9')][_0x7677('0xa')](_0x2dd39f,_0x1e45d6);}function main(){var _0xe5e745=0x1388;var _0x22d440;logger['info'](util[_0x7677('0xb')](_0x7677('0xc'),EXTRACTED_REPORT_ID,_0x7677('0xd')));return db['Setting']['find']({'where':{'id':0x1},'raw':!![],'attributes':['id','split','splitSizeXlsx']})[_0x7677('0xe')](function(_0x34fc9d){if(_0x34fc9d){_0x22d440=_0x34fc9d;_0xe5e745=_0x22d440[_0x7677('0xf')]||0x1388;}})[_0x7677('0xe')](function(){return dbH[_0x7677('0x10')]['query'](util[_0x7677('0xb')](_0x7677('0x11'),QUERY),{'type':dbH[_0x7677('0x10')]['QueryTypes'][_0x7677('0x12')]});})['then'](function(_0x4355a0){if(!_0x4355a0[0x0][_0x7677('0x13')]){return analyticExtractedReport('Empty');}var _0x234544=[];var _0x293604=0x0;if(_0x22d440[_0x7677('0x14')]){if(_0x4355a0&&_0x4355a0['length']){var _0x45bfdb=_[_0x7677('0x15')](_0x4355a0[0x0][_0x7677('0x13')]/_0xe5e745);var _0x525926=Number[_0x7677('0x16')](_0x4355a0[0x0][_0x7677('0x13')]/_0xe5e745)?_0x4355a0[0x0][_0x7677('0x13')]%_0xe5e745:0x0;_0x45bfdb[_0x7677('0x17')](function(_0x46884e){if(_0x46884e>0x0){_0x293604+=_0xe5e745;}_0x234544['push'](dbH['sequelize']['query'](util[_0x7677('0xb')](_0x7677('0x18'),QUERY,_0xe5e745,_0x293604),{'type':dbH['sequelize'][_0x7677('0x19')][_0x7677('0x12')]}));});if(_0x525926>0x0){_0x293604+=_0xe5e745;_0x234544[_0x7677('0x1a')](dbH[_0x7677('0x10')][_0x7677('0x1b')](util['format'](_0x7677('0x18'),QUERY,_0x525926,_0x293604),{'type':dbH[_0x7677('0x10')]['QueryTypes']['SELECT']}));}}}else{_0x234544[_0x7677('0x1a')](dbH[_0x7677('0x10')][_0x7677('0x1b')](QUERY,{'type':dbH['sequelize'][_0x7677('0x19')]['SELECT']}));}var _0x3884bc=path['dirname'](PATH);var _0x179708=path[_0x7677('0x1c')](PATH,'.xlsx');var _0x5411bc=_0x22d440[_0x7677('0x14')]&&_0x234544[_0x7677('0x1d')]>0x1;var _0x50461f=[];if(!fs[_0x7677('0x1e')](path[_0x7677('0x1f')](_0x3884bc,_0x179708))&&_0x5411bc){fs[_0x7677('0x20')](path[_0x7677('0x1f')](_0x3884bc,_0x179708));}return BPromise[_0x7677('0x21')](_0x234544,function(_0xc8e6eb){_0x50461f['push'](_0xc8e6eb);})[_0x7677('0xe')](function(){for(var _0x37524d=0x0;_0x37524d<_0x50461f['length'];_0x37524d+=0x1){var _0x1eb614;var _0x3330a8=_0x50461f[_0x37524d];if(_0x5411bc){_0x1eb614=path['join'](_0x3884bc,_0x179708,util[_0x7677('0xb')](_0x7677('0x22'),_0x179708,_0x37524d,_0x7677('0x23')));}else{_0x1eb614=path['join'](_0x3884bc,util[_0x7677('0xb')](_0x7677('0x24'),_0x179708,'xlsx'));}fs[_0x7677('0x25')](_0x1eb614,json2xls(_0x3330a8),_0x7677('0x26'));}})[_0x7677('0xe')](function(){if(_0x5411bc){return new Promise(function(_0x112140){zipdir(path[_0x7677('0x1f')](_0x3884bc,_0x179708),{'saveTo':path['join'](_0x3884bc,util['format']('%s.%s',_0x179708,_0x7677('0x27')))},function(_0x22fdb4,_0x2da4d8){rimraf(path['join'](_0x3884bc,_0x179708),function(){});_0x112140('zip\x20finished');});});}})[_0x7677('0xe')](function(){logger['info'](util['format'](_0x7677('0x28'),EXTRACTED_REPORT_ID,_0x7677('0xd')));return analyticExtractedReport(_0x7677('0x29'),_0x5411bc?util[_0x7677('0xb')](_0x7677('0x24'),_0x179708,_0x5411bc?_0x7677('0x27'):_0x7677('0x23')):null);});})[_0x7677('0x2a')](function(_0x1f9c7f){logger[_0x7677('0x2b')](util[_0x7677('0xb')](_0x7677('0x2c'),EXTRACTED_REPORT_ID,_0x7677('0xd')),util[_0x7677('0x2d')](_0x1f9c7f,{'showHidden':![],'depth':null}));EXIT_CODE=0x1;return analyticExtractedReport(_0x7677('0x2e'));})[_0x7677('0x2f')](function(){process['exit'](EXIT_CODE);});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index 6e395a2..11d8950 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 _0xdd7a=['outbound','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','hasOwnProperty','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','toLowerCase','createdAt','updatedAt','interval','map','tag','length','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','answer','indexOf','app','appType','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','concat','transaction','destroy','bulkCreate','sortBy','catch','error','lodash','util','models','findAll','then','intervals','IntervalId','VoiceExtension','uniq','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','playback','extensions','extension','find','push','type','Set','format','CDR(type)=%s','context','priority','VoiceExtensionId','inbound','CDR(routeid)='];(function(_0x2c18a8,_0x24eaa5){var _0x1e009a=function(_0x5dea3a){while(--_0x5dea3a){_0x2c18a8['push'](_0x2c18a8['shift']());}};_0x1e009a(++_0x24eaa5);}(_0xdd7a,0xbd));var _0xadd7=function(_0x418800,_0x24503e){_0x418800=_0x418800-0x0;var _0x568bd9=_0xdd7a[_0x418800];return _0x568bd9;};'use strict';var _=require(_0xadd7('0x0'));var util=require(_0xadd7('0x1'));function rewrite(_0x59f072,_0x135679){var _0x29c526=this;return _0x59f072[_0xadd7('0x2')]['Interval'][_0xadd7('0x3')]({'raw':!![]})[_0xadd7('0x4')](function(_0x336662){_0x29c526[_0xadd7('0x5')]=_0x336662;return _0x59f072[_0xadd7('0x2')]['VoiceExtension'][_0xadd7('0x3')]({'where':{'IntervalId':_0x135679[_0xadd7('0x6')]},'raw':!![]});})['then'](function(_0x17aba0){return _0x59f072[_0xadd7('0x2')][_0xadd7('0x7')][_0xadd7('0x3')]({'where':{'exten':{'$in':_[_0xadd7('0x8')](_['map'](_0x17aba0,_0xadd7('0x9')))}},'order':[{'raw':_0xadd7('0xa')}],'raw':!![]});})[_0xadd7('0x4')](function(_0x155fe3){var _0x3d5acc=_['filter'](_0x155fe3,{'priority':'1'});var _0x593923=_[_0xadd7('0xb')](_0x155fe3,{'isApp':0x1});var _0x4936d2=_[_0xadd7('0xc')](_0x593923,_0xadd7('0x9'));var _0x428eda=['queue',_0xadd7('0xd')];var _0x411ad3=[];var _0x46f2c6=[];for(var _0x305062 in _0x4936d2){if(_0x4936d2['hasOwnProperty'](_0x305062)){_0x29c526['priority']=0x2;_0x29c526[_0xadd7('0xe')]=[];_0x29c526[_0xadd7('0xf')]=_[_0xadd7('0x10')](_0x3d5acc,{'exten':_0x4936d2[_0x305062][0x0][_0xadd7('0x9')]});_0x29c526[_0xadd7('0xe')][_0xadd7('0x11')]({'type':_0x4936d2[_0x305062][0x0][_0xadd7('0x12')],'app':_0xadd7('0x13'),'appdata':util[_0xadd7('0x14')](_0xadd7('0x15'),_0x4936d2[_0x305062][0x0]['type']),'context':_0x4936d2[_0x305062][0x0][_0xadd7('0x16')],'exten':_0x4936d2[_0x305062][0x0]['exten'],'priority':_0x29c526[_0xadd7('0x17')]++,'VoiceExtensionId':_0x4936d2[_0x305062][0x0][_0xadd7('0x18')]});if(_0x4936d2[_0x305062][0x0][_0xadd7('0x12')]===_0xadd7('0x19')){_0x29c526[_0xadd7('0xe')][_0xadd7('0x11')]({'type':_0x4936d2[_0x305062][0x0][_0xadd7('0x12')],'app':_0xadd7('0x13'),'appdata':_0xadd7('0x1a')+_0x4936d2[_0x305062][0x0][_0xadd7('0x18')],'context':_0x4936d2[_0x305062][0x0][_0xadd7('0x16')],'exten':_0x4936d2[_0x305062][0x0][_0xadd7('0x9')],'priority':_0x29c526[_0xadd7('0x17')]++,'VoiceExtensionId':_0x4936d2[_0x305062][0x0][_0xadd7('0x18')]});}else if(_0x4936d2[_0x305062][0x0]['type']===_0xadd7('0x1b')){if(_0x29c526['extension']){_0x29c526[_0xadd7('0xe')][_0xadd7('0x11')]({'type':_0x4936d2[_0x305062][0x0]['type'],'app':_0xadd7('0x13'),'appdata':_0xadd7('0x1c')+(_0x29c526[_0xadd7('0xf')][_0xadd7('0x1d')]?_0xadd7('0x1e')+_0x29c526[_0xadd7('0xf')][_0xadd7('0x1d')]+'}':_0xadd7('0x1f')),'context':_0x4936d2[_0x305062][0x0][_0xadd7('0x16')],'exten':_0x4936d2[_0x305062][0x0][_0xadd7('0x9')],'priority':_0x29c526[_0xadd7('0x17')]++,'VoiceExtensionId':_0x4936d2[_0x305062][0x0][_0xadd7('0x18')]});}_0x29c526[_0xadd7('0xe')][_0xadd7('0x11')]({'type':_0x4936d2[_0x305062][0x0][_0xadd7('0x12')],'app':'Set','appdata':_0xadd7('0x1a')+_0x4936d2[_0x305062][0x0][_0xadd7('0x18')],'context':_0x4936d2[_0x305062][0x0][_0xadd7('0x16')],'exten':_0x4936d2[_0x305062][0x0][_0xadd7('0x9')],'priority':_0x29c526['priority']++,'VoiceExtensionId':_0x4936d2[_0x305062][0x0][_0xadd7('0x18')]});var _0x4a5ee1=_0x29c526[_0xadd7('0x17')]++;_0x29c526[_0xadd7('0xe')][_0xadd7('0x11')]({'type':_0x4936d2[_0x305062][0x0]['type'],'app':_0xadd7('0x20'),'appdata':_0xadd7('0x21')+(_0x4a5ee1+0x2)+_0xadd7('0x22')+(_0x4a5ee1+0x1)+')','context':_0x4936d2[_0x305062][0x0]['context'],'exten':_0x4936d2[_0x305062][0x0][_0xadd7('0x9')],'priority':_0x4a5ee1,'VoiceExtensionId':_0x4936d2[_0x305062][0x0][_0xadd7('0x18')]});if(_0x29c526[_0xadd7('0xf')]){_0x29c526['extensions'][_0xadd7('0x11')]({'type':_0x4936d2[_0x305062][0x0]['type'],'app':_0xadd7('0x13'),'appdata':_0x29c526[_0xadd7('0xf')][_0xadd7('0x1d')]?_0xadd7('0x23')+_0x29c526['extension'][_0xadd7('0x1d')]+'}':_0xadd7('0x24'),'context':_0x4936d2[_0x305062][0x0]['context'],'exten':_0x4936d2[_0x305062][0x0][_0xadd7('0x9')],'priority':_0x29c526[_0xadd7('0x17')]++,'VoiceExtensionId':_0x4936d2[_0x305062][0x0]['VoiceExtensionId']});}_0x29c526['extensions']['push']({'type':_0x4936d2[_0x305062][0x0][_0xadd7('0x12')],'app':_0xadd7('0x13'),'appdata':'outboundrouteid='+_0x4936d2[_0x305062][0x0][_0xadd7('0x18')],'context':_0x4936d2[_0x305062][0x0][_0xadd7('0x16')],'exten':_0x4936d2[_0x305062][0x0][_0xadd7('0x9')],'priority':_0x29c526[_0xadd7('0x17')]++,'VoiceExtensionId':_0x4936d2[_0x305062][0x0]['VoiceExtensionId']});if(_0x29c526[_0xadd7('0xf')]&&_0x29c526['extension'][_0xadd7('0x25')]('recordingFormat')&&_0x29c526[_0xadd7('0xf')][_0xadd7('0x26')]!==_0xadd7('0x27')){_0x29c526[_0xadd7('0xe')]['push']({'type':_0x4936d2[_0x305062][0x0][_0xadd7('0x12')],'app':_0xadd7('0x13'),'appdata':_0xadd7('0x28'),'context':_0x4936d2[_0x305062][0x0][_0xadd7('0x16')],'exten':_0x4936d2[_0x305062][0x0][_0xadd7('0x9')],'priority':_0x29c526['priority']++,'VoiceExtensionId':_0x4936d2[_0x305062][0x0][_0xadd7('0x18')]});_0x29c526[_0xadd7('0xe')][_0xadd7('0x11')]({'type':_0x4936d2[_0x305062][0x0]['type'],'app':_0xadd7('0x13'),'appdata':_0xadd7('0x29')+_0x29c526[_0xadd7('0xf')][_0xadd7('0x26')]||_0xadd7('0x2a'),'context':_0x4936d2[_0x305062][0x0][_0xadd7('0x16')],'exten':_0x4936d2[_0x305062][0x0][_0xadd7('0x9')],'priority':_0x29c526[_0xadd7('0x17')]++,'VoiceExtensionId':_0x4936d2[_0x305062][0x0]['VoiceExtensionId']});}}_0x29c526[_0xadd7('0xe')][_0xadd7('0x11')]({'type':_0x4936d2[_0x305062][0x0][_0xadd7('0x12')],'app':_0xadd7('0x13'),'appdata':_0xadd7('0x2b'),'context':_0x4936d2[_0x305062][0x0][_0xadd7('0x16')],'exten':_0x4936d2[_0x305062][0x0][_0xadd7('0x9')],'priority':_0x29c526[_0xadd7('0x17')]++,'VoiceExtensionId':_0x4936d2[_0x305062][0x0][_0xadd7('0x18')]});_0x29c526[_0xadd7('0xe')]['push']({'type':_0x4936d2[_0x305062][0x0][_0xadd7('0x12')],'app':'Set','appdata':_0xadd7('0x2c'),'context':_0x4936d2[_0x305062][0x0][_0xadd7('0x16')],'exten':_0x4936d2[_0x305062][0x0][_0xadd7('0x9')],'priority':_0x29c526[_0xadd7('0x17')]++,'VoiceExtensionId':_0x4936d2[_0x305062][0x0][_0xadd7('0x18')]});_0x29c526[_0xadd7('0xe')][_0xadd7('0x11')]({'type':_0x4936d2[_0x305062][0x0][_0xadd7('0x12')],'app':_0xadd7('0x13'),'appdata':_0xadd7('0x2d'),'context':_0x4936d2[_0x305062][0x0]['context'],'exten':_0x4936d2[_0x305062][0x0][_0xadd7('0x9')],'priority':_0x29c526[_0xadd7('0x17')]++,'VoiceExtensionId':_0x4936d2[_0x305062][0x0][_0xadd7('0x18')]});for(var _0x55f49b=0x0,_0x2606e0=0x0;_0x55f49b<_0x4936d2[_0x305062]['length'];_0x55f49b+=0x1,_0x2606e0=0x0){var _0x5e5942=_0x4936d2[_0x305062][_0x55f49b];if(_0x5e5942[_0xadd7('0x12')]){_0x5e5942['type']=_0x5e5942[_0xadd7('0x12')][_0xadd7('0x2e')]();}var _0x26ffe1=[];var _0x56abf8=[];delete _0x5e5942['id'];delete _0x5e5942[_0xadd7('0x2f')];delete _0x5e5942[_0xadd7('0x30')];var _0x517284=_0x5e5942[_0xadd7('0x31')]!=='*,*,*,*'?[_0x5e5942[_0xadd7('0x31')]]:_0x5e5942[_0xadd7('0x6')]?_[_0xadd7('0x32')](_[_0xadd7('0xb')](_0x29c526[_0xadd7('0x5')],{'IntervalId':_0x5e5942[_0xadd7('0x6')]}),_0xadd7('0x31')):[];if(_0x5e5942[_0xadd7('0x25')]('tag')){if(_0x5e5942[_0xadd7('0x33')]&&_0x5e5942[_0xadd7('0x33')]!=='--'){_0x26ffe1['push']({'type':_0x5e5942[_0xadd7('0x12')],'app':_0xadd7('0x13'),'appdata':'CDR(tag)='+_0x5e5942[_0xadd7('0x33')],'context':_0x5e5942[_0xadd7('0x16')],'exten':_0x5e5942[_0xadd7('0x9')],'priority':_0x517284[_0xadd7('0x34')]+_0x29c526[_0xadd7('0x17')]+_0x2606e0++,'VoiceExtensionId':_0x5e5942[_0xadd7('0x18')]});}}if(_0x5e5942[_0xadd7('0x12')]===_0xadd7('0x1b')&&_0x5e5942[_0xadd7('0x25')](_0xadd7('0x35'))){if(_0x5e5942['callerID']){_0x26ffe1['push']({'type':_0x5e5942[_0xadd7('0x12')],'app':_0xadd7('0x20'),'appdata':_0xadd7('0x36')+_0x5e5942[_0xadd7('0x35')]+')','context':_0x5e5942[_0xadd7('0x16')],'exten':_0x5e5942[_0xadd7('0x9')],'priority':_0x517284[_0xadd7('0x34')]+_0x29c526[_0xadd7('0x17')]+_0x2606e0++,'VoiceExtensionId':_0x5e5942['VoiceExtensionId']});}else{_0x26ffe1[_0xadd7('0x11')]({'type':_0x5e5942[_0xadd7('0x12')],'app':_0xadd7('0x20'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','context':_0x5e5942['context'],'exten':_0x5e5942[_0xadd7('0x9')],'priority':_0x517284[_0xadd7('0x34')]+_0x29c526[_0xadd7('0x17')]+_0x2606e0++,'VoiceExtensionId':_0x5e5942[_0xadd7('0x18')]});}}if(_0x5e5942[_0xadd7('0x25')](_0xadd7('0x37'))){if(_0x428eda[_0xadd7('0x38')](_0x5e5942[_0xadd7('0x39')][_0xadd7('0x2e')]())>=0x0&&_0x5e5942[_0xadd7('0x3a')]!=='custom'){if(_0x5e5942[_0xadd7('0x37')]){_0x26ffe1['push']({'type':_0x5e5942['type'],'app':_0xadd7('0x20'),'appdata':_0xadd7('0x3b'),'context':_0x5e5942[_0xadd7('0x16')],'exten':_0x5e5942[_0xadd7('0x9')],'priority':_0x517284[_0xadd7('0x34')]+_0x29c526['priority']+_0x2606e0++,'VoiceExtensionId':_0x5e5942[_0xadd7('0x18')]});_0x26ffe1['push']({'type':_0x5e5942[_0xadd7('0x12')],'app':_0xadd7('0x13'),'appdata':'XCALLY-MOTION-ANSWER=1','context':_0x5e5942[_0xadd7('0x16')],'exten':_0x5e5942[_0xadd7('0x9')],'priority':_0x517284['length']+_0x29c526[_0xadd7('0x17')]+_0x2606e0++,'VoiceExtensionId':_0x5e5942['VoiceExtensionId']});}else{_0x26ffe1[_0xadd7('0x11')]({'type':_0x5e5942[_0xadd7('0x12')],'app':_0xadd7('0x20'),'appdata':'$[${XCALLY-MOTION-PROGRESS}=0]?Progress','context':_0x5e5942[_0xadd7('0x16')],'exten':_0x5e5942[_0xadd7('0x9')],'priority':_0x517284['length']+_0x29c526['priority']+_0x2606e0++,'VoiceExtensionId':_0x5e5942[_0xadd7('0x18')]});_0x26ffe1['push']({'type':_0x5e5942[_0xadd7('0x12')],'app':_0xadd7('0x13'),'appdata':_0xadd7('0x3c'),'context':_0x5e5942['context'],'exten':_0x5e5942[_0xadd7('0x9')],'priority':_0x517284[_0xadd7('0x34')]+_0x29c526[_0xadd7('0x17')]+_0x2606e0++,'VoiceExtensionId':_0x5e5942[_0xadd7('0x18')]});}}}for(var _0x1a7d64=0x0;_0x1a7d64<_0x517284[_0xadd7('0x34')];_0x1a7d64+=0x1){var _0x11df37=_0x29c526[_0xadd7('0x17')]+_0x517284[_0xadd7('0x34')];var _0x4e51c3=_0x1a7d64===_0x517284[_0xadd7('0x34')]-0x1?_0x29c526[_0xadd7('0x17')]+_0x26ffe1[_0xadd7('0x34')]+_0x56abf8[_0xadd7('0x34')]+0x2:_0x29c526[_0xadd7('0x17')]+_0x1a7d64+0x1;_0x26ffe1[_0xadd7('0x3d')](_0x1a7d64,0x0,{'type':_0x5e5942['type'],'app':_0xadd7('0x3e'),'appdata':_0x517284[_0x1a7d64]+'?'+_0x5e5942[_0xadd7('0x16')]+_0xadd7('0x3f')+_0x11df37+':'+_0x5e5942[_0xadd7('0x16')]+_0xadd7('0x3f')+_0x4e51c3,'exten':_0x5e5942[_0xadd7('0x9')],'context':_0x5e5942[_0xadd7('0x16')],'priority':_0x29c526[_0xadd7('0x17')]+_0x1a7d64,'VoiceExtensionId':_0x4936d2[_0x305062][0x0][_0xadd7('0x18')]});}_0x5e5942[_0xadd7('0x17')]=_0x26ffe1['length']?_[_0xadd7('0x40')](_0x26ffe1)['priority']+0x1:_0x29c526[_0xadd7('0x17')];_0x29c526['priority']=(_0x56abf8[_0xadd7('0x34')]?_['last'](_0x56abf8)[_0xadd7('0x17')]:_0x5e5942['priority'])+0x1;_0x29c526[_0xadd7('0xe')]=_[_0xadd7('0x41')](_0x29c526[_0xadd7('0xe')],_0x26ffe1,[_0x5e5942],_0x56abf8);}_0x29c526[_0xadd7('0xe')][_0xadd7('0x11')]({'type':_0x4936d2[_0x305062][0x0][_0xadd7('0x12')],'app':'Hangup','exten':_0x4936d2[_0x305062][0x0][_0xadd7('0x9')],'context':_0x4936d2[_0x305062][0x0][_0xadd7('0x16')],'priority':_0x29c526['priority'],'VoiceExtensionId':_0x4936d2[_0x305062][0x0][_0xadd7('0x18')]});_0x411ad3[_0xadd7('0x11')](_0x4936d2[_0x305062][0x0][_0xadd7('0x18')]);_0x46f2c6=_[_0xadd7('0x41')](_0x46f2c6,_0x29c526[_0xadd7('0xe')]);}}return _0x59f072[_0xadd7('0x42')](function(_0x15a246){return _0x59f072['models'][_0xadd7('0x7')][_0xadd7('0x43')]({'where':{'VoiceExtensionId':{'$in':_0x411ad3}},'transaction':_0x15a246})['then'](function(_0xfb345){return _0x59f072[_0xadd7('0x2')][_0xadd7('0x7')][_0xadd7('0x44')](_[_0xadd7('0x45')](_0x46f2c6,_0xadd7('0x17')),{'transaction':_0x15a246});});});})[_0xadd7('0x46')](function(_0x2ccab9){console[_0xadd7('0x47')](_0x2ccab9);});}exports['rewrite']=rewrite; \ No newline at end of file +var _0xe591=['$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','app','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','concat','Hangup','transaction','destroy','bulkCreate','sortBy','catch','error','rewrite','util','models','Interval','findAll','intervals','VoiceExtension','IntervalId','then','uniq','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','queue','playback','hasOwnProperty','extensions','extension','find','type','Set','format','CDR(type)=%s','context','priority','VoiceExtensionId','inbound','CDR(routeid)=','push','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','wav','XCALLY-MOTION-ANSWER=0','MONITOR_OPTIONS=ab','toLowerCase','createdAt','updatedAt','interval','*,*,*,*','tag','CDR(tag)=','length','callerID'];(function(_0x18980f,_0x2d9d9b){var _0x592e5d=function(_0x2a4b42){while(--_0x2a4b42){_0x18980f['push'](_0x18980f['shift']());}};_0x592e5d(++_0x2d9d9b);}(_0xe591,0xfa));var _0x1e59=function(_0xd78abc,_0x3d43a9){_0xd78abc=_0xd78abc-0x0;var _0x104c0b=_0xe591[_0xd78abc];return _0x104c0b;};'use strict';var _=require('lodash');var util=require(_0x1e59('0x0'));function rewrite(_0x29d37c,_0x3e13e1){var _0x3e9ddc=this;return _0x29d37c[_0x1e59('0x1')][_0x1e59('0x2')][_0x1e59('0x3')]({'raw':!![]})['then'](function(_0x54b91f){_0x3e9ddc[_0x1e59('0x4')]=_0x54b91f;return _0x29d37c[_0x1e59('0x1')][_0x1e59('0x5')][_0x1e59('0x3')]({'where':{'IntervalId':_0x3e13e1[_0x1e59('0x6')]},'raw':!![]});})[_0x1e59('0x7')](function(_0x4e628b){return _0x29d37c[_0x1e59('0x1')][_0x1e59('0x5')]['findAll']({'where':{'exten':{'$in':_[_0x1e59('0x8')](_[_0x1e59('0x9')](_0x4e628b,_0x1e59('0xa')))}},'order':[{'raw':_0x1e59('0xb')}],'raw':!![]});})['then'](function(_0x41b4af){var _0x544d79=_[_0x1e59('0xc')](_0x41b4af,{'priority':'1'});var _0x119833=_[_0x1e59('0xc')](_0x41b4af,{'isApp':0x1});var _0x1ee731=_[_0x1e59('0xd')](_0x119833,_0x1e59('0xa'));var _0x8a0d9=[_0x1e59('0xe'),_0x1e59('0xf')];var _0x5ee662=[];var _0x20ddc3=[];for(var _0x2dc43f in _0x1ee731){if(_0x1ee731[_0x1e59('0x10')](_0x2dc43f)){_0x3e9ddc['priority']=0x2;_0x3e9ddc[_0x1e59('0x11')]=[];_0x3e9ddc[_0x1e59('0x12')]=_[_0x1e59('0x13')](_0x544d79,{'exten':_0x1ee731[_0x2dc43f][0x0][_0x1e59('0xa')]});_0x3e9ddc[_0x1e59('0x11')]['push']({'type':_0x1ee731[_0x2dc43f][0x0][_0x1e59('0x14')],'app':_0x1e59('0x15'),'appdata':util[_0x1e59('0x16')](_0x1e59('0x17'),_0x1ee731[_0x2dc43f][0x0][_0x1e59('0x14')]),'context':_0x1ee731[_0x2dc43f][0x0][_0x1e59('0x18')],'exten':_0x1ee731[_0x2dc43f][0x0][_0x1e59('0xa')],'priority':_0x3e9ddc[_0x1e59('0x19')]++,'VoiceExtensionId':_0x1ee731[_0x2dc43f][0x0][_0x1e59('0x1a')]});if(_0x1ee731[_0x2dc43f][0x0][_0x1e59('0x14')]===_0x1e59('0x1b')){_0x3e9ddc[_0x1e59('0x11')]['push']({'type':_0x1ee731[_0x2dc43f][0x0][_0x1e59('0x14')],'app':'Set','appdata':_0x1e59('0x1c')+_0x1ee731[_0x2dc43f][0x0][_0x1e59('0x1a')],'context':_0x1ee731[_0x2dc43f][0x0][_0x1e59('0x18')],'exten':_0x1ee731[_0x2dc43f][0x0][_0x1e59('0xa')],'priority':_0x3e9ddc[_0x1e59('0x19')]++,'VoiceExtensionId':_0x1ee731[_0x2dc43f][0x0][_0x1e59('0x1a')]});}else if(_0x1ee731[_0x2dc43f][0x0][_0x1e59('0x14')]==='outbound'){if(_0x3e9ddc[_0x1e59('0x12')]){_0x3e9ddc['extensions'][_0x1e59('0x1d')]({'type':_0x1ee731[_0x2dc43f][0x0]['type'],'app':'Set','appdata':_0x1e59('0x1e')+(_0x3e9ddc[_0x1e59('0x12')][_0x1e59('0x1f')]?_0x1e59('0x20')+_0x3e9ddc[_0x1e59('0x12')][_0x1e59('0x1f')]+'}':_0x1e59('0x21')),'context':_0x1ee731[_0x2dc43f][0x0][_0x1e59('0x18')],'exten':_0x1ee731[_0x2dc43f][0x0][_0x1e59('0xa')],'priority':_0x3e9ddc['priority']++,'VoiceExtensionId':_0x1ee731[_0x2dc43f][0x0]['VoiceExtensionId']});}_0x3e9ddc[_0x1e59('0x11')][_0x1e59('0x1d')]({'type':_0x1ee731[_0x2dc43f][0x0][_0x1e59('0x14')],'app':'Set','appdata':'CDR(routeid)='+_0x1ee731[_0x2dc43f][0x0][_0x1e59('0x1a')],'context':_0x1ee731[_0x2dc43f][0x0]['context'],'exten':_0x1ee731[_0x2dc43f][0x0][_0x1e59('0xa')],'priority':_0x3e9ddc[_0x1e59('0x19')]++,'VoiceExtensionId':_0x1ee731[_0x2dc43f][0x0]['VoiceExtensionId']});var _0x5066dc=_0x3e9ddc[_0x1e59('0x19')]++;_0x3e9ddc[_0x1e59('0x11')][_0x1e59('0x1d')]({'type':_0x1ee731[_0x2dc43f][0x0][_0x1e59('0x14')],'app':_0x1e59('0x22'),'appdata':_0x1e59('0x23')+(_0x5066dc+0x2)+_0x1e59('0x24')+(_0x5066dc+0x1)+')','context':_0x1ee731[_0x2dc43f][0x0][_0x1e59('0x18')],'exten':_0x1ee731[_0x2dc43f][0x0][_0x1e59('0xa')],'priority':_0x5066dc,'VoiceExtensionId':_0x1ee731[_0x2dc43f][0x0]['VoiceExtensionId']});if(_0x3e9ddc[_0x1e59('0x12')]){_0x3e9ddc[_0x1e59('0x11')]['push']({'type':_0x1ee731[_0x2dc43f][0x0]['type'],'app':_0x1e59('0x15'),'appdata':_0x3e9ddc['extension'][_0x1e59('0x1f')]?_0x1e59('0x25')+_0x3e9ddc[_0x1e59('0x12')][_0x1e59('0x1f')]+'}':'CDR(prefix)=noprefix','context':_0x1ee731[_0x2dc43f][0x0][_0x1e59('0x18')],'exten':_0x1ee731[_0x2dc43f][0x0][_0x1e59('0xa')],'priority':_0x3e9ddc['priority']++,'VoiceExtensionId':_0x1ee731[_0x2dc43f][0x0][_0x1e59('0x1a')]});}_0x3e9ddc[_0x1e59('0x11')]['push']({'type':_0x1ee731[_0x2dc43f][0x0][_0x1e59('0x14')],'app':_0x1e59('0x15'),'appdata':_0x1e59('0x26')+_0x1ee731[_0x2dc43f][0x0][_0x1e59('0x1a')],'context':_0x1ee731[_0x2dc43f][0x0][_0x1e59('0x18')],'exten':_0x1ee731[_0x2dc43f][0x0][_0x1e59('0xa')],'priority':_0x3e9ddc[_0x1e59('0x19')]++,'VoiceExtensionId':_0x1ee731[_0x2dc43f][0x0][_0x1e59('0x1a')]});if(_0x3e9ddc['extension']&&_0x3e9ddc['extension'][_0x1e59('0x10')](_0x1e59('0x27'))&&_0x3e9ddc[_0x1e59('0x12')][_0x1e59('0x27')]!==_0x1e59('0x28')){_0x3e9ddc[_0x1e59('0x11')][_0x1e59('0x1d')]({'type':_0x1ee731[_0x2dc43f][0x0][_0x1e59('0x14')],'app':_0x1e59('0x15'),'appdata':_0x1e59('0x29'),'context':_0x1ee731[_0x2dc43f][0x0][_0x1e59('0x18')],'exten':_0x1ee731[_0x2dc43f][0x0][_0x1e59('0xa')],'priority':_0x3e9ddc[_0x1e59('0x19')]++,'VoiceExtensionId':_0x1ee731[_0x2dc43f][0x0][_0x1e59('0x1a')]});_0x3e9ddc[_0x1e59('0x11')][_0x1e59('0x1d')]({'type':_0x1ee731[_0x2dc43f][0x0][_0x1e59('0x14')],'app':'Set','appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x3e9ddc['extension'][_0x1e59('0x27')]||_0x1e59('0x2a'),'context':_0x1ee731[_0x2dc43f][0x0][_0x1e59('0x18')],'exten':_0x1ee731[_0x2dc43f][0x0]['exten'],'priority':_0x3e9ddc[_0x1e59('0x19')]++,'VoiceExtensionId':_0x1ee731[_0x2dc43f][0x0][_0x1e59('0x1a')]});}}_0x3e9ddc['extensions'][_0x1e59('0x1d')]({'type':_0x1ee731[_0x2dc43f][0x0]['type'],'app':'Set','appdata':_0x1e59('0x2b'),'context':_0x1ee731[_0x2dc43f][0x0][_0x1e59('0x18')],'exten':_0x1ee731[_0x2dc43f][0x0][_0x1e59('0xa')],'priority':_0x3e9ddc[_0x1e59('0x19')]++,'VoiceExtensionId':_0x1ee731[_0x2dc43f][0x0][_0x1e59('0x1a')]});_0x3e9ddc['extensions']['push']({'type':_0x1ee731[_0x2dc43f][0x0][_0x1e59('0x14')],'app':_0x1e59('0x15'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x1ee731[_0x2dc43f][0x0][_0x1e59('0x18')],'exten':_0x1ee731[_0x2dc43f][0x0][_0x1e59('0xa')],'priority':_0x3e9ddc[_0x1e59('0x19')]++,'VoiceExtensionId':_0x1ee731[_0x2dc43f][0x0][_0x1e59('0x1a')]});_0x3e9ddc[_0x1e59('0x11')][_0x1e59('0x1d')]({'type':_0x1ee731[_0x2dc43f][0x0][_0x1e59('0x14')],'app':_0x1e59('0x15'),'appdata':_0x1e59('0x2c'),'context':_0x1ee731[_0x2dc43f][0x0][_0x1e59('0x18')],'exten':_0x1ee731[_0x2dc43f][0x0][_0x1e59('0xa')],'priority':_0x3e9ddc['priority']++,'VoiceExtensionId':_0x1ee731[_0x2dc43f][0x0][_0x1e59('0x1a')]});for(var _0x8c3d89=0x0,_0x2c102c=0x0;_0x8c3d89<_0x1ee731[_0x2dc43f]['length'];_0x8c3d89+=0x1,_0x2c102c=0x0){var _0x29e784=_0x1ee731[_0x2dc43f][_0x8c3d89];if(_0x29e784[_0x1e59('0x14')]){_0x29e784[_0x1e59('0x14')]=_0x29e784[_0x1e59('0x14')][_0x1e59('0x2d')]();}var _0x1c056f=[];var _0x170748=[];delete _0x29e784['id'];delete _0x29e784[_0x1e59('0x2e')];delete _0x29e784[_0x1e59('0x2f')];var _0x38717f=_0x29e784[_0x1e59('0x30')]!==_0x1e59('0x31')?[_0x29e784[_0x1e59('0x30')]]:_0x29e784[_0x1e59('0x6')]?_[_0x1e59('0x9')](_[_0x1e59('0xc')](_0x3e9ddc[_0x1e59('0x4')],{'IntervalId':_0x29e784[_0x1e59('0x6')]}),'interval'):[];if(_0x29e784[_0x1e59('0x10')](_0x1e59('0x32'))){if(_0x29e784[_0x1e59('0x32')]&&_0x29e784['tag']!=='--'){_0x1c056f[_0x1e59('0x1d')]({'type':_0x29e784[_0x1e59('0x14')],'app':'Set','appdata':_0x1e59('0x33')+_0x29e784[_0x1e59('0x32')],'context':_0x29e784[_0x1e59('0x18')],'exten':_0x29e784[_0x1e59('0xa')],'priority':_0x38717f[_0x1e59('0x34')]+_0x3e9ddc[_0x1e59('0x19')]+_0x2c102c++,'VoiceExtensionId':_0x29e784[_0x1e59('0x1a')]});}}if(_0x29e784[_0x1e59('0x14')]==='outbound'&&_0x29e784['hasOwnProperty'](_0x1e59('0x35'))){if(_0x29e784['callerID']){_0x1c056f[_0x1e59('0x1d')]({'type':_0x29e784[_0x1e59('0x14')],'app':_0x1e59('0x22'),'appdata':_0x1e59('0x36')+_0x29e784['callerID']+')','context':_0x29e784[_0x1e59('0x18')],'exten':_0x29e784['exten'],'priority':_0x38717f[_0x1e59('0x34')]+_0x3e9ddc[_0x1e59('0x19')]+_0x2c102c++,'VoiceExtensionId':_0x29e784[_0x1e59('0x1a')]});}else{_0x1c056f[_0x1e59('0x1d')]({'type':_0x29e784[_0x1e59('0x14')],'app':_0x1e59('0x22'),'appdata':_0x1e59('0x37'),'context':_0x29e784[_0x1e59('0x18')],'exten':_0x29e784[_0x1e59('0xa')],'priority':_0x38717f[_0x1e59('0x34')]+_0x3e9ddc[_0x1e59('0x19')]+_0x2c102c++,'VoiceExtensionId':_0x29e784[_0x1e59('0x1a')]});}}if(_0x29e784[_0x1e59('0x10')](_0x1e59('0x38'))){if(_0x8a0d9['indexOf'](_0x29e784[_0x1e59('0x39')][_0x1e59('0x2d')]())>=0x0&&_0x29e784[_0x1e59('0x3a')]!==_0x1e59('0x3b')){if(_0x29e784[_0x1e59('0x38')]){_0x1c056f[_0x1e59('0x1d')]({'type':_0x29e784['type'],'app':_0x1e59('0x22'),'appdata':_0x1e59('0x3c'),'context':_0x29e784['context'],'exten':_0x29e784[_0x1e59('0xa')],'priority':_0x38717f[_0x1e59('0x34')]+_0x3e9ddc['priority']+_0x2c102c++,'VoiceExtensionId':_0x29e784['VoiceExtensionId']});_0x1c056f[_0x1e59('0x1d')]({'type':_0x29e784['type'],'app':'Set','appdata':'XCALLY-MOTION-ANSWER=1','context':_0x29e784['context'],'exten':_0x29e784['exten'],'priority':_0x38717f[_0x1e59('0x34')]+_0x3e9ddc[_0x1e59('0x19')]+_0x2c102c++,'VoiceExtensionId':_0x29e784[_0x1e59('0x1a')]});}else{_0x1c056f['push']({'type':_0x29e784[_0x1e59('0x14')],'app':'ExecIf','appdata':_0x1e59('0x3d'),'context':_0x29e784[_0x1e59('0x18')],'exten':_0x29e784[_0x1e59('0xa')],'priority':_0x38717f[_0x1e59('0x34')]+_0x3e9ddc[_0x1e59('0x19')]+_0x2c102c++,'VoiceExtensionId':_0x29e784[_0x1e59('0x1a')]});_0x1c056f['push']({'type':_0x29e784[_0x1e59('0x14')],'app':_0x1e59('0x15'),'appdata':_0x1e59('0x3e'),'context':_0x29e784[_0x1e59('0x18')],'exten':_0x29e784[_0x1e59('0xa')],'priority':_0x38717f[_0x1e59('0x34')]+_0x3e9ddc[_0x1e59('0x19')]+_0x2c102c++,'VoiceExtensionId':_0x29e784[_0x1e59('0x1a')]});}}}for(var _0x26b9db=0x0;_0x26b9db<_0x38717f[_0x1e59('0x34')];_0x26b9db+=0x1){var _0x15818e=_0x3e9ddc[_0x1e59('0x19')]+_0x38717f[_0x1e59('0x34')];var _0x37fe84=_0x26b9db===_0x38717f['length']-0x1?_0x3e9ddc[_0x1e59('0x19')]+_0x1c056f[_0x1e59('0x34')]+_0x170748[_0x1e59('0x34')]+0x2:_0x3e9ddc['priority']+_0x26b9db+0x1;_0x1c056f[_0x1e59('0x3f')](_0x26b9db,0x0,{'type':_0x29e784['type'],'app':_0x1e59('0x40'),'appdata':_0x38717f[_0x26b9db]+'?'+_0x29e784[_0x1e59('0x18')]+_0x1e59('0x41')+_0x15818e+':'+_0x29e784['context']+_0x1e59('0x41')+_0x37fe84,'exten':_0x29e784[_0x1e59('0xa')],'context':_0x29e784[_0x1e59('0x18')],'priority':_0x3e9ddc['priority']+_0x26b9db,'VoiceExtensionId':_0x1ee731[_0x2dc43f][0x0][_0x1e59('0x1a')]});}_0x29e784[_0x1e59('0x19')]=_0x1c056f[_0x1e59('0x34')]?_[_0x1e59('0x42')](_0x1c056f)[_0x1e59('0x19')]+0x1:_0x3e9ddc['priority'];_0x3e9ddc[_0x1e59('0x19')]=(_0x170748[_0x1e59('0x34')]?_[_0x1e59('0x42')](_0x170748)[_0x1e59('0x19')]:_0x29e784[_0x1e59('0x19')])+0x1;_0x3e9ddc[_0x1e59('0x11')]=_[_0x1e59('0x43')](_0x3e9ddc['extensions'],_0x1c056f,[_0x29e784],_0x170748);}_0x3e9ddc['extensions'][_0x1e59('0x1d')]({'type':_0x1ee731[_0x2dc43f][0x0][_0x1e59('0x14')],'app':_0x1e59('0x44'),'exten':_0x1ee731[_0x2dc43f][0x0][_0x1e59('0xa')],'context':_0x1ee731[_0x2dc43f][0x0][_0x1e59('0x18')],'priority':_0x3e9ddc[_0x1e59('0x19')],'VoiceExtensionId':_0x1ee731[_0x2dc43f][0x0][_0x1e59('0x1a')]});_0x5ee662[_0x1e59('0x1d')](_0x1ee731[_0x2dc43f][0x0][_0x1e59('0x1a')]);_0x20ddc3=_['concat'](_0x20ddc3,_0x3e9ddc[_0x1e59('0x11')]);}}return _0x29d37c[_0x1e59('0x45')](function(_0x2d2258){return _0x29d37c[_0x1e59('0x1')]['VoiceExtension'][_0x1e59('0x46')]({'where':{'VoiceExtensionId':{'$in':_0x5ee662}},'transaction':_0x2d2258})[_0x1e59('0x7')](function(_0x155861){return _0x29d37c[_0x1e59('0x1')][_0x1e59('0x5')][_0x1e59('0x47')](_[_0x1e59('0x48')](_0x20ddc3,_0x1e59('0x19')),{'transaction':_0x2d2258});});});})[_0x1e59('0x49')](function(_0x277710){console[_0x1e59('0x4a')](_0x277710);});}exports[_0x1e59('0x4b')]=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index c052904..283fb03 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 _0xf964=['findAll','BlackLists','Lists','get','onlyIfOpen','CampaignId','Campaign','cmContact,\x20%s,\x20%s','Error\x20processing\x20rows\x20block:','stringify','finally','contact:csv_','resume','emit','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','info','resolve','parse','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','lodash','squel','papaparse','../../../mysqldb','../../../config/environment','../../../config/logger','redis','defaults','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','error','contact','index','test','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','message','join','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','ListId','CompanyId','find','duplicate','Duplicate\x20Contact','CmContact','create','keys','then','pick','catch','cmContact','checkHopper','inspect','insert','into','cm_hopper','scheduledAt','ContactId','updatedAt','field','phone','toString','createdAt','NOW()','cm_contacts','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','select','from','\x20=\x20?','fromQuery','calleridnum','cm_hopper_final','id\x20IN\x20?','phone\x20IS\x20NOT\x20NULL','cm_hopper_black','str','outbound','dialCheckDuplicateType','CmList','always','push','sequelize','query','VoiceQueueId','all','VoiceQueue'];(function(_0x5c5d3b,_0x582f0c){var _0x54218b=function(_0xb2bf65){while(--_0xb2bf65){_0x5c5d3b['push'](_0x5c5d3b['shift']());}};_0x54218b(++_0x582f0c);}(_0xf964,0x1ec));var _0x4f96=function(_0x4a28b4,_0x5059d2){_0x4a28b4=_0x4a28b4-0x0;var _0x379aa5=_0xf964[_0x4a28b4];return _0x379aa5;};'use strict';var BPromise=require(_0x4f96('0x0'));var util=require(_0x4f96('0x1'));var _=require(_0x4f96('0x2'));var fs=require('fs');var squel=require(_0x4f96('0x3'));var Papa=require(_0x4f96('0x4'));var Redis=require('ioredis');var db=require(_0x4f96('0x5'))['db'];var config=require(_0x4f96('0x6'));var logger=require(_0x4f96('0x7'))('api');config[_0x4f96('0x8')]=_[_0x4f96('0x9')](config[_0x4f96('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x4f96('0xa'))(new Redis(config['redis']));require(_0x4f96('0xb'))[_0x4f96('0xc')](socket);try{if(!process['argv'][0x2]||process[_0x4f96('0xd')][0x2]===_0x4f96('0xe')||process[_0x4f96('0xd')][0x2]===_0x4f96('0xf')){throw new Error(_0x4f96('0x10'));}var FILEPATH=process['argv'][0x2];if(!process[_0x4f96('0xd')][0x3]||process[_0x4f96('0xd')][0x3]===_0x4f96('0xe')||process['argv'][0x3]===_0x4f96('0xf')||!process[_0x4f96('0xd')][0x4]||process[_0x4f96('0xd')][0x4]===_0x4f96('0xe')||process[_0x4f96('0xd')][0x4]===_0x4f96('0xf')){throw new Error(_0x4f96('0x11'));}var FIELDS=_[_0x4f96('0x12')](process['argv'][0x3]['split'](','),process[_0x4f96('0xd')][0x4][_0x4f96('0x13')](','));if(!process[_0x4f96('0xd')][0x5]||process[_0x4f96('0xd')][0x5]===_0x4f96('0xe')||process[_0x4f96('0xd')][0x5]===_0x4f96('0xf')){throw new Error(_0x4f96('0x14'));}var LISTID=process[_0x4f96('0xd')][0x5];var COMPANYID=process[_0x4f96('0xd')][0x6]&&process[_0x4f96('0xd')][0x6]!=='undefined'&&process[_0x4f96('0xd')][0x6]!=='null'?process[_0x4f96('0xd')][0x6]:null;var DUPLICATES=process['argv'][0x7]&&process['argv'][0x7]!==_0x4f96('0xe')&&process[_0x4f96('0xd')][0x7]!==_0x4f96('0xf')?process[_0x4f96('0xd')][0x7]:null;if(!process['argv'][0x8]||process[_0x4f96('0xd')][0x8]===_0x4f96('0xe')||process[_0x4f96('0xd')][0x8]===_0x4f96('0xf')){throw new Error('Missing\x20socket_timestamp\x20parameter!');}var SOCKET_TIMESTAMP=process['argv'][0x8];}catch(_0x47a8fe){logger[_0x4f96('0x15')](_0x47a8fe);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(_0xce9b62,_0x2b1f17,_0x1238bd,_0x512711){var _0x4ab745={'message':_0x2b1f17};_0x4ab745[_0xce9b62]=!![];if(_0x1238bd){_0x4ab745[_0x4f96('0x16')]=_0x1238bd;}if(_0x512711){_0x4ab745[_0x4f96('0x17')]=_0x512711;}return _0x4ab745;}function isEmail(_0x3da103){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))*$/[_0x4f96('0x18')](_0x3da103);}function checkRow(_0x218931,_0x298413,_0x7c04dd){return new BPromise(function(_0x38433b,_0xd6d95f){if(_[_0x4f96('0x19')](_0x218931)){return _0xd6d95f(handleCheckRowError('error',_0x4f96('0x1a'),null,_0x7c04dd));}if(_0x218931[_0x4f96('0x1b')]&&_0x218931['errors'][_0x4f96('0x1c')]){var _0x214c01=_[_0x4f96('0x1d')](_0x218931['errors'],_0x4f96('0x1e'))[_0x4f96('0x1f')](';');return _0xd6d95f(handleCheckRowError('error',_0x214c01,null,_0x7c04dd));}var _0x4fc57e={};for(var _0x2b6a62 in FIELDS){if(FIELDS[_0x4f96('0x20')](_0x2b6a62)&&FIELDS[_0x2b6a62]){_0x4fc57e[_0x2b6a62]=_0x218931[_0x4f96('0x21')][0x0][FIELDS[_0x2b6a62]]||_0x218931[_0x4f96('0x21')][0x0]['\ufeff'+FIELDS[_0x2b6a62]];}}if(!_0x4fc57e[_0x4f96('0x22')]){return _0xd6d95f(handleCheckRowError(_0x4f96('0x15'),_0x4f96('0x23'),null,_0x7c04dd));}if(!_0x4fc57e['phone']){return _0xd6d95f(handleCheckRowError(_0x4f96('0x15'),_0x4f96('0x24'),null,_0x7c04dd));}if(_0x4fc57e[_0x4f96('0x25')]){var _0x4a4d76=moment(_0x4fc57e[_0x4f96('0x25')],_0x4f96('0x26'));if(!_0x4a4d76[_0x4f96('0x27')]()){return _0xd6d95f(handleCheckRowError('error',_0x4f96('0x28'),null,_0x7c04dd));}}if(_0x4fc57e[_0x4f96('0x29')]){if(!isEmail(_0x4fc57e[_0x4f96('0x29')])){return _0xd6d95f(handleCheckRowError('error',_0x4f96('0x2a'),null,_0x7c04dd));}}_0x4fc57e[_0x4f96('0x2b')]=LISTID;_0x4fc57e[_0x4f96('0x2c')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x4f96('0x1c')]&&_0x298413){var _0x4c71ea={};for(var _0x33d408=0x0,_0xce38aa=DUPLICATES[_0x4f96('0x1c')];_0x33d408<_0xce38aa;_0x33d408+=0x1){_0x4c71ea[DUPLICATES[_0x33d408]]=_0x4fc57e[DUPLICATES[_0x33d408]];}var _0x3b26b0=_[_0x4f96('0x2d')](_0x298413,_0x4c71ea);if(_0x3b26b0){return _0xd6d95f(handleCheckRowError(_0x4f96('0x2e'),_0x4f96('0x2f'),_0x3b26b0,_0x7c04dd));}}return db[_0x4f96('0x30')][_0x4f96('0x31')](_0x4fc57e,{'raw':!![],'hooks':![],'fields':_[_0x4f96('0x32')](_0x4fc57e)})[_0x4f96('0x33')](function(_0x47e0eb){if(DUPLICATES&&DUPLICATES['length']&&_0x298413){_0x298413['push'](_[_0x4f96('0x34')](_0x4fc57e,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x47e0eb['id'];return _0x38433b();})[_0x4f96('0x35')](function(_0xfadcb0){return _0xd6d95f(handleCheckRowError(_0x4f96('0x15'),'Error\x20while\x20creating\x20contact:\x20'+(_0xfadcb0['message']||JSON['stringify'](_0xfadcb0)),null,_0x7c04dd));});});}function checkHopper(){function _0x226bed(){return function(_0x4f8267){logger[_0x4f96('0x15')](_0x4f96('0x36'),_0x4f96('0x37'),util[_0x4f96('0x38')](_0x4f8267,{'showHidden':![],'depth':null}));};}var _0x30f7ce=function(_0x45e41c,_0x49fdec){var _0x19651d=squel[_0x4f96('0x39')]()[_0x4f96('0x3a')](_0x4f96('0x3b'))['fromQuery'](['phone',_0x4f96('0x3c'),_0x4f96('0x3d'),'ListId',_0x49fdec,'createdAt',_0x4f96('0x3e')],squel['select']()[_0x4f96('0x3f')](_0x4f96('0x40'),_0x4f96('0x40'))[_0x4f96('0x3f')]('NOW()',_0x4f96('0x3c'))[_0x4f96('0x3f')]('id',_0x4f96('0x3d'))[_0x4f96('0x3f')](LISTID['toString'](),_0x4f96('0x2b'))[_0x4f96('0x3f')](_0x45e41c['id'][_0x4f96('0x41')](),_0x49fdec)[_0x4f96('0x3f')]('NOW()',_0x4f96('0x42'))[_0x4f96('0x3f')](_0x4f96('0x43'),_0x4f96('0x3e'))['from'](_0x4f96('0x44'))[_0x4f96('0x45')](_0x4f96('0x46'))[_0x4f96('0x45')](_0x4f96('0x47'),LISTID['toString']())[_0x4f96('0x45')]('phone\x20IS\x20NOT\x20NULL')[_0x4f96('0x45')](_0x4f96('0x48'),squel[_0x4f96('0x49')]()[_0x4f96('0x3f')](_0x4f96('0x40'))[_0x4f96('0x4a')](_0x4f96('0x3b'))['where'](_0x49fdec+_0x4f96('0x4b'),_0x45e41c['id'][_0x4f96('0x41')]())))[_0x4f96('0x41')]();return _0x19651d;};var _0x44d1da=function(_0x38b9e3,_0x56aba7){var _0x459b15=squel[_0x4f96('0x39')]()[_0x4f96('0x3a')]('cm_hopper')[_0x4f96('0x4c')]([_0x4f96('0x40'),_0x4f96('0x3c'),'ContactId',_0x4f96('0x2b'),_0x56aba7,_0x4f96('0x42'),_0x4f96('0x3e')],squel[_0x4f96('0x49')]()[_0x4f96('0x3f')](_0x4f96('0x40'),_0x4f96('0x40'))[_0x4f96('0x3f')](_0x4f96('0x43'),_0x4f96('0x3c'))[_0x4f96('0x3f')]('id','ContactId')[_0x4f96('0x3f')](LISTID[_0x4f96('0x41')](),'ListId')[_0x4f96('0x3f')](_0x38b9e3['id'][_0x4f96('0x41')](),_0x56aba7)['field'](_0x4f96('0x43'),'createdAt')[_0x4f96('0x3f')](_0x4f96('0x43'),_0x4f96('0x3e'))['from'](_0x4f96('0x44'))['where'](_0x4f96('0x46'))[_0x4f96('0x45')]('ListId\x20=\x20?',LISTID[_0x4f96('0x41')]())[_0x4f96('0x45')]('id\x20IN\x20?',squel['str'](hopperContacts))[_0x4f96('0x45')]('phone\x20IS\x20NOT\x20NULL')[_0x4f96('0x45')](_0x4f96('0x48'),squel[_0x4f96('0x49')]()[_0x4f96('0x3f')](_0x4f96('0x4d'))[_0x4f96('0x4a')](_0x4f96('0x4e'))[_0x4f96('0x45')](_0x56aba7+'\x20=\x20?',_0x38b9e3['id'][_0x4f96('0x41')]()))[_0x4f96('0x45')](_0x4f96('0x48'),squel[_0x4f96('0x49')]()['field'](_0x4f96('0x40'))[_0x4f96('0x4a')](_0x4f96('0x3b'))['where'](_0x56aba7+'\x20=\x20?',_0x38b9e3['id']['toString']())))[_0x4f96('0x41')]();return _0x459b15;};function _0x3cb5a6(_0x118467,_0x5f0300){var _0x27feee=squel[_0x4f96('0x39')]()['into'](_0x4f96('0x3b'))['fromQuery'](['phone',_0x4f96('0x3c'),_0x4f96('0x3d'),_0x4f96('0x2b'),_0x5f0300,_0x4f96('0x42'),_0x4f96('0x3e')],squel[_0x4f96('0x49')]()[_0x4f96('0x3f')]('phone',_0x4f96('0x40'))[_0x4f96('0x3f')](_0x4f96('0x43'),_0x4f96('0x3c'))[_0x4f96('0x3f')]('id',_0x4f96('0x3d'))[_0x4f96('0x3f')](LISTID[_0x4f96('0x41')](),_0x4f96('0x2b'))[_0x4f96('0x3f')](_0x118467['id'][_0x4f96('0x41')](),_0x5f0300)[_0x4f96('0x3f')](_0x4f96('0x43'),_0x4f96('0x42'))[_0x4f96('0x3f')](_0x4f96('0x43'),_0x4f96('0x3e'))[_0x4f96('0x4a')](_0x4f96('0x44'))[_0x4f96('0x45')](_0x4f96('0x46'))[_0x4f96('0x45')](_0x4f96('0x47'),LISTID[_0x4f96('0x41')]())[_0x4f96('0x45')](_0x4f96('0x4f'),squel['str'](hopperContacts))['where'](_0x4f96('0x50')))[_0x4f96('0x41')]();return _0x27feee;}function _0x6a3017(_0x28e424,_0x24ba3e){var _0x51334f=squel[_0x4f96('0x39')]()[_0x4f96('0x3a')](_0x4f96('0x51'))['fromQuery'](['phone',_0x4f96('0x3d'),_0x4f96('0x2b'),_0x24ba3e,_0x4f96('0x42'),'updatedAt'],squel[_0x4f96('0x49')]()[_0x4f96('0x3f')]('phone',_0x4f96('0x40'))['field']('id',_0x4f96('0x3d'))['field'](LISTID[_0x4f96('0x41')](),_0x4f96('0x2b'))['field'](_0x28e424['id']['toString'](),_0x24ba3e)['field'](_0x4f96('0x43'),_0x4f96('0x42'))[_0x4f96('0x3f')](_0x4f96('0x43'),_0x4f96('0x3e'))[_0x4f96('0x4a')](_0x4f96('0x44'))[_0x4f96('0x45')](_0x4f96('0x46'))[_0x4f96('0x45')]('ListId\x20=\x20?',LISTID[_0x4f96('0x41')]())[_0x4f96('0x45')](_0x4f96('0x4f'),squel[_0x4f96('0x52')](hopperContacts))['where'](_0x4f96('0x50')))[_0x4f96('0x41')]();return _0x51334f;}return db['VoiceQueue']['findAll']({'where':{'type':_0x4f96('0x53')},'attributes':['id',_0x4f96('0x54')],'include':[{'model':db[_0x4f96('0x55')],'as':'Lists','where':{'id':LISTID}}]})[_0x4f96('0x33')](function(_0x22f6e1){var _0x1b8051=[];if(_0x22f6e1){var _0x4c0096;for(var _0x568577=0x0,_0x2a0491;_0x568577<_0x22f6e1[_0x4f96('0x1c')];_0x568577+=0x1){_0x2a0491=_0x22f6e1[_0x568577]['get']({'plain':!![]});switch(_0x2a0491[_0x4f96('0x54')]){case _0x4f96('0x56'):_0x1b8051[_0x4f96('0x57')](db[_0x4f96('0x58')][_0x4f96('0x59')](_0x44d1da(_0x2a0491,_0x4f96('0x5a')))[_0x4f96('0x33')](function(){})[_0x4f96('0x35')](_0x226bed()));break;case'onlyIfOpen':_0x1b8051['push'](db['sequelize'][_0x4f96('0x59')](_0x30f7ce(_0x2a0491,'VoiceQueueId'))[_0x4f96('0x33')](function(){})[_0x4f96('0x35')](_0x226bed()));break;default:_0x1b8051['push'](db['sequelize'][_0x4f96('0x59')](_0x3cb5a6(_0x2a0491,_0x4f96('0x5a')))['then'](function(){})[_0x4f96('0x35')](_0x226bed()));}}}return _0x1b8051;})[_0x4f96('0x5b')]()[_0x4f96('0x33')](function(){return db[_0x4f96('0x5c')][_0x4f96('0x5d')]({'where':{'type':_0x4f96('0x53')},'attributes':['id'],'include':[{'model':db[_0x4f96('0x55')],'as':_0x4f96('0x5e'),'where':{'id':LISTID}}]})[_0x4f96('0x33')](function(_0x4a44df){var _0x48b0b0=[];if(_0x4a44df){var _0x5ac6be;for(var _0x14d60b=0x0,_0x9290f;_0x14d60b<_0x4a44df[_0x4f96('0x1c')];_0x14d60b+=0x1){_0x9290f=_0x4a44df[_0x14d60b]['get']({'plain':!![]});_0x48b0b0[_0x4f96('0x57')](db[_0x4f96('0x58')][_0x4f96('0x59')](_0x6a3017(_0x9290f,_0x4f96('0x5a')))[_0x4f96('0x33')](function(){})[_0x4f96('0x35')](_0x226bed()));}}return _0x48b0b0;})['all']();})['then'](function(){return db['Campaign']['findAll']({'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0x4f96('0x55')],'as':_0x4f96('0x5f'),'where':{'id':LISTID}}]})[_0x4f96('0x33')](function(_0x6ba83c){var _0x175e33=[];if(_0x6ba83c){for(var _0x33aabf=0x0,_0x153352;_0x33aabf<_0x6ba83c['length'];_0x33aabf+=0x1){_0x153352=_0x6ba83c[_0x33aabf][_0x4f96('0x60')]({'plain':!![]});switch(_0x153352['dialCheckDuplicateType']){case _0x4f96('0x56'):_0x175e33[_0x4f96('0x57')](db[_0x4f96('0x58')]['query'](_0x44d1da(_0x153352,'CampaignId'))[_0x4f96('0x33')](function(){})[_0x4f96('0x35')](_0x226bed()));break;case _0x4f96('0x61'):_0x175e33['push'](db[_0x4f96('0x58')][_0x4f96('0x59')](_0x30f7ce(_0x153352,_0x4f96('0x62')))['then'](function(){})[_0x4f96('0x35')](_0x226bed()));break;default:_0x175e33['push'](db['sequelize'][_0x4f96('0x59')](_0x3cb5a6(_0x153352,_0x4f96('0x62')))['then'](function(){})[_0x4f96('0x35')](_0x226bed()));}}}return _0x175e33;})[_0x4f96('0x5b')]();})[_0x4f96('0x33')](function(){return db[_0x4f96('0x63')]['findAll']({'attributes':['id'],'include':[{'model':db['CmList'],'as':_0x4f96('0x5e'),'where':{'id':LISTID}}]})[_0x4f96('0x33')](function(_0x1437f8){var _0x3a08a6=[];if(_0x1437f8){for(var _0x2972c4=0x0,_0x3339f9;_0x2972c4<_0x1437f8[_0x4f96('0x1c')];_0x2972c4+=0x1){_0x3339f9=_0x1437f8[_0x2972c4]['get']({'plain':!![]});_0x3a08a6['push'](db[_0x4f96('0x58')][_0x4f96('0x59')](_0x6a3017(_0x3339f9,_0x4f96('0x62')))['then'](function(){})[_0x4f96('0x35')](_0x226bed()));}}return _0x3a08a6;})[_0x4f96('0x5b')]();})[_0x4f96('0x35')](function(_0x308f4b){logger['error'](_0x4f96('0x64'),'generalCheckHopper',_0x308f4b[_0x4f96('0x1e')]);});}var processPromises=function(_0x5350d0){return BPromise['all'](promises)[_0x4f96('0x33')](function(_0x3728b4){})['catch'](function(_0x3d1fe6){logger['error'](_0x4f96('0x65'),JSON[_0x4f96('0x66')](_0x3d1fe6));})[_0x4f96('0x67')](function(){socket['emit'](_0x4f96('0x68')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x5350d0){return _0x5350d0[_0x4f96('0x69')]();}});};var endCsv=function(){return BPromise['resolve']()['then'](function(){if(hopperContacts){return checkHopper();}})['then'](function(){socket[_0x4f96('0x6a')]('contact:csv_'+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x4f96('0x6b')](FILEPATH);}catch(_0x388563){logger[_0x4f96('0x15')](_0x4f96('0x6c'),JSON['stringify'](_0x388563));}finally{process[_0x4f96('0x6d')](0x0);}});};process['on'](_0x4f96('0x6e'),function(){logger[_0x4f96('0x6f')]('CSV\x20import\x20process\x20stopped!');endCsv();});function main(){return BPromise[_0x4f96('0x70')]()['then'](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x4f96('0x13')](',');return db[_0x4f96('0x30')][_0x4f96('0x5d')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x4f96('0x33')](function(_0x41090b){var _0x3a9471=fs['createReadStream'](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x4f96('0x71')](_0x3a9471,{'header':!![],'skipEmptyLines':!![],'step':function(_0x41b57b,_0x3a3424){total+=0x1;var _0x4dac33=total;promises[_0x4f96('0x57')](checkRow(_0x41b57b,_0x41090b,_0x4dac33)[_0x4f96('0x33')](function(){success+=0x1;})[_0x4f96('0x35')](function(_0x4805b3){if(_0x4805b3[_0x4f96('0x15')]){errors+=0x1;delete _0x4805b3[_0x4f96('0x15')];}else if(_0x4805b3['duplicate']){duplicates+=0x1;delete _0x4805b3[_0x4f96('0x2e')];}rows['push'](_0x4805b3);}));if(total%0xc8===0x0){_0x3a3424['pause']();return processPromises(_0x3a3424);}},'complete':function(){return processPromises()[_0x4f96('0x33')](function(){logger['info'](_0x4f96('0x72'));endCsv();});},'error':function(_0x83c0da,_0x1d723f){logger[_0x4f96('0x6f')](_0x4f96('0x73'),JSON[_0x4f96('0x66')](_0x83c0da));endCsv();}});})[_0x4f96('0x35')](function(_0x207679){logger[_0x4f96('0x15')](_0x4f96('0x74'),JSON[_0x4f96('0x66')](_0x207679));});}main(); \ No newline at end of file +var _0x0225=['CSV\x20parse\x20error','papaparse','ioredis','../../../mysqldb','redis','defaults','localhost','register','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','zipObject','split','Missing\x20ListId\x20parameter!','Missing\x20socket_timestamp\x20parameter!','error','contact','test','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','message','join','data','birthDate','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','ListId','CompanyId','find','duplicate','Duplicate\x20Contact','CmContact','create','keys','then','push','pick','Error\x20while\x20creating\x20contact:\x20','stringify','cmContact','checkHopper','inspect','fromQuery','phone','scheduledAt','ContactId','updatedAt','select','field','NOW()','toString','createdAt','from','cm_contacts','where','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','\x20=\x20?','insert','into','cm_hopper','id\x20IN\x20?','str','calleridnum','cm_hopper_final','cm_hopper_black','phone\x20IS\x20NOT\x20NULL','VoiceQueue','findAll','outbound','dialCheckDuplicateType','Lists','get','always','sequelize','VoiceQueueId','catch','onlyIfOpen','query','all','CmList','BlackLists','CampaignId','Campaign','cmContact,\x20%s,\x20%s','generalCheckHopper','finally','contact:csv_','resolve','emit','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','info','CSV\x20import\x20process\x20stopped!','createReadStream','parse','pause','CSV\x20parsed\x20correctly!'];(function(_0x54a687,_0x4ce189){var _0x4b5083=function(_0x4e9dc7){while(--_0x4e9dc7){_0x54a687['push'](_0x54a687['shift']());}};_0x4b5083(++_0x4ce189);}(_0x0225,0x1ad));var _0x5022=function(_0xaa20b8,_0x1ad9c0){_0xaa20b8=_0xaa20b8-0x0;var _0x28f4b6=_0x0225[_0xaa20b8];return _0x28f4b6;};'use strict';var BPromise=require('bluebird');var util=require('util');var _=require('lodash');var fs=require('fs');var squel=require('squel');var Papa=require(_0x5022('0x0'));var Redis=require(_0x5022('0x1'));var db=require(_0x5022('0x2'))['db'];var config=require('../../../config/environment');var logger=require('../../../config/logger')('api');config[_0x5022('0x3')]=_[_0x5022('0x4')](config[_0x5022('0x3')],{'host':_0x5022('0x5'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('../../../api/cmContact/cmContact.socket')[_0x5022('0x6')](socket);try{if(!process[_0x5022('0x7')][0x2]||process[_0x5022('0x7')][0x2]===_0x5022('0x8')||process[_0x5022('0x7')][0x2]===_0x5022('0x9')){throw new Error(_0x5022('0xa'));}var FILEPATH=process[_0x5022('0x7')][0x2];if(!process[_0x5022('0x7')][0x3]||process[_0x5022('0x7')][0x3]==='undefined'||process[_0x5022('0x7')][0x3]===_0x5022('0x9')||!process[_0x5022('0x7')][0x4]||process[_0x5022('0x7')][0x4]===_0x5022('0x8')||process[_0x5022('0x7')][0x4]===_0x5022('0x9')){throw new Error(_0x5022('0xb'));}var FIELDS=_[_0x5022('0xc')](process[_0x5022('0x7')][0x3]['split'](','),process['argv'][0x4][_0x5022('0xd')](','));if(!process['argv'][0x5]||process['argv'][0x5]===_0x5022('0x8')||process[_0x5022('0x7')][0x5]==='null'){throw new Error(_0x5022('0xe'));}var LISTID=process[_0x5022('0x7')][0x5];var COMPANYID=process[_0x5022('0x7')][0x6]&&process['argv'][0x6]!==_0x5022('0x8')&&process['argv'][0x6]!==_0x5022('0x9')?process[_0x5022('0x7')][0x6]:null;var DUPLICATES=process['argv'][0x7]&&process[_0x5022('0x7')][0x7]!=='undefined'&&process['argv'][0x7]!=='null'?process[_0x5022('0x7')][0x7]:null;if(!process[_0x5022('0x7')][0x8]||process[_0x5022('0x7')][0x8]===_0x5022('0x8')||process[_0x5022('0x7')][0x8]===_0x5022('0x9')){throw new Error(_0x5022('0xf'));}var SOCKET_TIMESTAMP=process['argv'][0x8];}catch(_0x2f61bc){logger[_0x5022('0x10')](_0x2f61bc);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(_0x3c18f4,_0x534c39,_0x2c7e3b,_0x450314){var _0x24abc9={'message':_0x534c39};_0x24abc9[_0x3c18f4]=!![];if(_0x2c7e3b){_0x24abc9[_0x5022('0x11')]=_0x2c7e3b;}if(_0x450314){_0x24abc9['index']=_0x450314;}return _0x24abc9;}function isEmail(_0x5336e0){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))*$/[_0x5022('0x12')](_0x5336e0);}function checkRow(_0x2bcb89,_0x10a81a,_0x1d57fa){return new BPromise(function(_0x1ca1d8,_0x3914d8){if(_[_0x5022('0x13')](_0x2bcb89)){return _0x3914d8(handleCheckRowError(_0x5022('0x10'),_0x5022('0x14'),null,_0x1d57fa));}if(_0x2bcb89[_0x5022('0x15')]&&_0x2bcb89[_0x5022('0x15')][_0x5022('0x16')]){var _0x3acfa0=_[_0x5022('0x17')](_0x2bcb89[_0x5022('0x15')],_0x5022('0x18'))[_0x5022('0x19')](';');return _0x3914d8(handleCheckRowError('error',_0x3acfa0,null,_0x1d57fa));}var _0x13b60e={};for(var _0x2fdeee in FIELDS){if(FIELDS['hasOwnProperty'](_0x2fdeee)&&FIELDS[_0x2fdeee]){_0x13b60e[_0x2fdeee]=_0x2bcb89[_0x5022('0x1a')][0x0][FIELDS[_0x2fdeee]]||_0x2bcb89[_0x5022('0x1a')][0x0]['\ufeff'+FIELDS[_0x2fdeee]];}}if(!_0x13b60e['firstName']){return _0x3914d8(handleCheckRowError(_0x5022('0x10'),'firstName\x20not\x20specified!',null,_0x1d57fa));}if(!_0x13b60e['phone']){return _0x3914d8(handleCheckRowError(_0x5022('0x10'),'phone\x20not\x20specified!',null,_0x1d57fa));}if(_0x13b60e[_0x5022('0x1b')]){var _0x3242cc=moment(_0x13b60e[_0x5022('0x1b')],'YYYY-MM-DD');if(!_0x3242cc[_0x5022('0x1c')]()){return _0x3914d8(handleCheckRowError(_0x5022('0x10'),_0x5022('0x1d'),null,_0x1d57fa));}}if(_0x13b60e[_0x5022('0x1e')]){if(!isEmail(_0x13b60e['email'])){return _0x3914d8(handleCheckRowError(_0x5022('0x10'),'email\x20format\x20is\x20not\x20valid!',null,_0x1d57fa));}}_0x13b60e[_0x5022('0x1f')]=LISTID;_0x13b60e[_0x5022('0x20')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES['length']&&_0x10a81a){var _0x381580={};for(var _0x48daa9=0x0,_0x56c335=DUPLICATES[_0x5022('0x16')];_0x48daa9<_0x56c335;_0x48daa9+=0x1){_0x381580[DUPLICATES[_0x48daa9]]=_0x13b60e[DUPLICATES[_0x48daa9]];}var _0x5c4294=_[_0x5022('0x21')](_0x10a81a,_0x381580);if(_0x5c4294){return _0x3914d8(handleCheckRowError(_0x5022('0x22'),_0x5022('0x23'),_0x5c4294,_0x1d57fa));}}return db[_0x5022('0x24')][_0x5022('0x25')](_0x13b60e,{'raw':!![],'hooks':![],'fields':_[_0x5022('0x26')](_0x13b60e)})[_0x5022('0x27')](function(_0x1007bb){if(DUPLICATES&&DUPLICATES[_0x5022('0x16')]&&_0x10a81a){_0x10a81a[_0x5022('0x28')](_[_0x5022('0x29')](_0x13b60e,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x1007bb['id'];return _0x1ca1d8();})['catch'](function(_0x212059){return _0x3914d8(handleCheckRowError(_0x5022('0x10'),_0x5022('0x2a')+(_0x212059[_0x5022('0x18')]||JSON[_0x5022('0x2b')](_0x212059)),null,_0x1d57fa));});});}function checkHopper(){function _0x54fbb7(){return function(_0x512ef7){logger[_0x5022('0x10')](_0x5022('0x2c'),_0x5022('0x2d'),util[_0x5022('0x2e')](_0x512ef7,{'showHidden':![],'depth':null}));};}var _0x2d1b59=function(_0x3a9db3,_0x226635){var _0x13eccb=squel['insert']()['into']('cm_hopper')[_0x5022('0x2f')]([_0x5022('0x30'),_0x5022('0x31'),_0x5022('0x32'),_0x5022('0x1f'),_0x226635,'createdAt',_0x5022('0x33')],squel[_0x5022('0x34')]()[_0x5022('0x35')](_0x5022('0x30'),'phone')[_0x5022('0x35')](_0x5022('0x36'),_0x5022('0x31'))[_0x5022('0x35')]('id',_0x5022('0x32'))['field'](LISTID[_0x5022('0x37')](),_0x5022('0x1f'))['field'](_0x3a9db3['id'][_0x5022('0x37')](),_0x226635)[_0x5022('0x35')](_0x5022('0x36'),_0x5022('0x38'))[_0x5022('0x35')](_0x5022('0x36'),_0x5022('0x33'))[_0x5022('0x39')](_0x5022('0x3a'))[_0x5022('0x3b')](_0x5022('0x3c'))[_0x5022('0x3b')](_0x5022('0x3d'),LISTID['toString']())[_0x5022('0x3b')]('phone\x20IS\x20NOT\x20NULL')[_0x5022('0x3b')](_0x5022('0x3e'),squel[_0x5022('0x34')]()[_0x5022('0x35')]('phone')[_0x5022('0x39')]('cm_hopper')[_0x5022('0x3b')](_0x226635+_0x5022('0x3f'),_0x3a9db3['id'][_0x5022('0x37')]())))[_0x5022('0x37')]();return _0x13eccb;};var _0x648833=function(_0x43bb74,_0x508d67){var _0x21cce0=squel[_0x5022('0x40')]()[_0x5022('0x41')](_0x5022('0x42'))[_0x5022('0x2f')]([_0x5022('0x30'),_0x5022('0x31'),'ContactId','ListId',_0x508d67,_0x5022('0x38'),'updatedAt'],squel[_0x5022('0x34')]()[_0x5022('0x35')](_0x5022('0x30'),_0x5022('0x30'))['field'](_0x5022('0x36'),_0x5022('0x31'))[_0x5022('0x35')]('id',_0x5022('0x32'))[_0x5022('0x35')](LISTID[_0x5022('0x37')](),_0x5022('0x1f'))['field'](_0x43bb74['id'][_0x5022('0x37')](),_0x508d67)[_0x5022('0x35')](_0x5022('0x36'),_0x5022('0x38'))[_0x5022('0x35')](_0x5022('0x36'),_0x5022('0x33'))[_0x5022('0x39')]('cm_contacts')['where']('deletedAt\x20IS\x20NULL')[_0x5022('0x3b')](_0x5022('0x3d'),LISTID[_0x5022('0x37')]())['where'](_0x5022('0x43'),squel[_0x5022('0x44')](hopperContacts))[_0x5022('0x3b')]('phone\x20IS\x20NOT\x20NULL')[_0x5022('0x3b')](_0x5022('0x3e'),squel[_0x5022('0x34')]()[_0x5022('0x35')](_0x5022('0x45'))['from'](_0x5022('0x46'))[_0x5022('0x3b')](_0x508d67+_0x5022('0x3f'),_0x43bb74['id'][_0x5022('0x37')]()))[_0x5022('0x3b')](_0x5022('0x3e'),squel[_0x5022('0x34')]()['field'](_0x5022('0x30'))[_0x5022('0x39')](_0x5022('0x42'))[_0x5022('0x3b')](_0x508d67+'\x20=\x20?',_0x43bb74['id'][_0x5022('0x37')]())))[_0x5022('0x37')]();return _0x21cce0;};function _0xe5e431(_0xe7f16,_0x5c2cc3){var _0x4869ca=squel['insert']()['into']('cm_hopper')['fromQuery'](['phone',_0x5022('0x31'),'ContactId',_0x5022('0x1f'),_0x5c2cc3,'createdAt',_0x5022('0x33')],squel[_0x5022('0x34')]()[_0x5022('0x35')](_0x5022('0x30'),_0x5022('0x30'))['field']('NOW()',_0x5022('0x31'))[_0x5022('0x35')]('id',_0x5022('0x32'))[_0x5022('0x35')](LISTID['toString'](),_0x5022('0x1f'))[_0x5022('0x35')](_0xe7f16['id'][_0x5022('0x37')](),_0x5c2cc3)[_0x5022('0x35')](_0x5022('0x36'),_0x5022('0x38'))[_0x5022('0x35')](_0x5022('0x36'),'updatedAt')[_0x5022('0x39')](_0x5022('0x3a'))['where'](_0x5022('0x3c'))['where'](_0x5022('0x3d'),LISTID[_0x5022('0x37')]())[_0x5022('0x3b')](_0x5022('0x43'),squel['str'](hopperContacts))['where']('phone\x20IS\x20NOT\x20NULL'))['toString']();return _0x4869ca;}function _0xa63aff(_0x2118bd,_0x11d725){var _0xdfc3ea=squel[_0x5022('0x40')]()[_0x5022('0x41')](_0x5022('0x47'))[_0x5022('0x2f')]([_0x5022('0x30'),_0x5022('0x32'),'ListId',_0x11d725,_0x5022('0x38'),_0x5022('0x33')],squel[_0x5022('0x34')]()[_0x5022('0x35')](_0x5022('0x30'),_0x5022('0x30'))[_0x5022('0x35')]('id',_0x5022('0x32'))[_0x5022('0x35')](LISTID['toString'](),_0x5022('0x1f'))['field'](_0x2118bd['id'][_0x5022('0x37')](),_0x11d725)['field'](_0x5022('0x36'),_0x5022('0x38'))['field']('NOW()',_0x5022('0x33'))[_0x5022('0x39')]('cm_contacts')[_0x5022('0x3b')](_0x5022('0x3c'))['where'](_0x5022('0x3d'),LISTID[_0x5022('0x37')]())[_0x5022('0x3b')](_0x5022('0x43'),squel[_0x5022('0x44')](hopperContacts))[_0x5022('0x3b')](_0x5022('0x48')))[_0x5022('0x37')]();return _0xdfc3ea;}return db[_0x5022('0x49')][_0x5022('0x4a')]({'where':{'type':_0x5022('0x4b')},'attributes':['id',_0x5022('0x4c')],'include':[{'model':db['CmList'],'as':_0x5022('0x4d'),'where':{'id':LISTID}}]})['then'](function(_0xae35dd){var _0xc741a7=[];if(_0xae35dd){var _0x5d06bb;for(var _0x36f8c8=0x0,_0x520367;_0x36f8c8<_0xae35dd[_0x5022('0x16')];_0x36f8c8+=0x1){_0x520367=_0xae35dd[_0x36f8c8][_0x5022('0x4e')]({'plain':!![]});switch(_0x520367[_0x5022('0x4c')]){case _0x5022('0x4f'):_0xc741a7[_0x5022('0x28')](db[_0x5022('0x50')]['query'](_0x648833(_0x520367,_0x5022('0x51')))['then'](function(){})[_0x5022('0x52')](_0x54fbb7()));break;case _0x5022('0x53'):_0xc741a7['push'](db[_0x5022('0x50')]['query'](_0x2d1b59(_0x520367,_0x5022('0x51')))['then'](function(){})[_0x5022('0x52')](_0x54fbb7()));break;default:_0xc741a7[_0x5022('0x28')](db['sequelize'][_0x5022('0x54')](_0xe5e431(_0x520367,_0x5022('0x51')))['then'](function(){})[_0x5022('0x52')](_0x54fbb7()));}}}return _0xc741a7;})[_0x5022('0x55')]()[_0x5022('0x27')](function(){return db['VoiceQueue'][_0x5022('0x4a')]({'where':{'type':'outbound'},'attributes':['id'],'include':[{'model':db[_0x5022('0x56')],'as':_0x5022('0x57'),'where':{'id':LISTID}}]})[_0x5022('0x27')](function(_0x2ac87c){var _0x80f75e=[];if(_0x2ac87c){var _0x3d2259;for(var _0x20ed61=0x0,_0x1b6cd0;_0x20ed61<_0x2ac87c[_0x5022('0x16')];_0x20ed61+=0x1){_0x1b6cd0=_0x2ac87c[_0x20ed61][_0x5022('0x4e')]({'plain':!![]});_0x80f75e['push'](db['sequelize'][_0x5022('0x54')](_0xa63aff(_0x1b6cd0,_0x5022('0x51')))[_0x5022('0x27')](function(){})[_0x5022('0x52')](_0x54fbb7()));}}return _0x80f75e;})[_0x5022('0x55')]();})[_0x5022('0x27')](function(){return db['Campaign']['findAll']({'attributes':['id',_0x5022('0x4c')],'include':[{'model':db[_0x5022('0x56')],'as':_0x5022('0x4d'),'where':{'id':LISTID}}]})[_0x5022('0x27')](function(_0x48dafa){var _0x2cfe48=[];if(_0x48dafa){for(var _0x57b2f8=0x0,_0x1cfe78;_0x57b2f8<_0x48dafa['length'];_0x57b2f8+=0x1){_0x1cfe78=_0x48dafa[_0x57b2f8]['get']({'plain':!![]});switch(_0x1cfe78['dialCheckDuplicateType']){case _0x5022('0x4f'):_0x2cfe48[_0x5022('0x28')](db[_0x5022('0x50')][_0x5022('0x54')](_0x648833(_0x1cfe78,_0x5022('0x58')))['then'](function(){})[_0x5022('0x52')](_0x54fbb7()));break;case _0x5022('0x53'):_0x2cfe48[_0x5022('0x28')](db[_0x5022('0x50')][_0x5022('0x54')](_0x2d1b59(_0x1cfe78,_0x5022('0x58')))[_0x5022('0x27')](function(){})[_0x5022('0x52')](_0x54fbb7()));break;default:_0x2cfe48['push'](db['sequelize'][_0x5022('0x54')](_0xe5e431(_0x1cfe78,'CampaignId'))[_0x5022('0x27')](function(){})['catch'](_0x54fbb7()));}}}return _0x2cfe48;})[_0x5022('0x55')]();})[_0x5022('0x27')](function(){return db[_0x5022('0x59')]['findAll']({'attributes':['id'],'include':[{'model':db['CmList'],'as':'BlackLists','where':{'id':LISTID}}]})[_0x5022('0x27')](function(_0x1b9798){var _0x3d6569=[];if(_0x1b9798){for(var _0x2d35e3=0x0,_0x2abc2e;_0x2d35e3<_0x1b9798['length'];_0x2d35e3+=0x1){_0x2abc2e=_0x1b9798[_0x2d35e3][_0x5022('0x4e')]({'plain':!![]});_0x3d6569[_0x5022('0x28')](db[_0x5022('0x50')][_0x5022('0x54')](_0xa63aff(_0x2abc2e,_0x5022('0x58')))['then'](function(){})[_0x5022('0x52')](_0x54fbb7()));}}return _0x3d6569;})[_0x5022('0x55')]();})['catch'](function(_0x5d26a7){logger['error'](_0x5022('0x5a'),_0x5022('0x5b'),_0x5d26a7[_0x5022('0x18')]);});}var processPromises=function(_0x416f52){return BPromise[_0x5022('0x55')](promises)[_0x5022('0x27')](function(_0x42da2e){})[_0x5022('0x52')](function(_0x53700a){logger['error']('Error\x20processing\x20rows\x20block:',JSON['stringify'](_0x53700a));})[_0x5022('0x5c')](function(){socket['emit'](_0x5022('0x5d')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x416f52){return _0x416f52['resume']();}});};var endCsv=function(){return BPromise[_0x5022('0x5e')]()['then'](function(){if(hopperContacts){return checkHopper();}})['then'](function(){socket[_0x5022('0x5f')](_0x5022('0x5d')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x5022('0x60')](FILEPATH);}catch(_0x265042){logger['error'](_0x5022('0x61'),JSON['stringify'](_0x265042));}finally{process[_0x5022('0x62')](0x0);}});};process['on'](_0x5022('0x63'),function(){logger[_0x5022('0x64')](_0x5022('0x65'));endCsv();});function main(){return BPromise['resolve']()[_0x5022('0x27')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x5022('0xd')](',');return db[_0x5022('0x24')]['findAll']({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x5022('0x27')](function(_0x554903){var _0x31fe13=fs[_0x5022('0x66')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x5022('0x67')](_0x31fe13,{'header':!![],'skipEmptyLines':!![],'step':function(_0x568b10,_0x374379){total+=0x1;var _0x234deb=total;promises[_0x5022('0x28')](checkRow(_0x568b10,_0x554903,_0x234deb)[_0x5022('0x27')](function(){success+=0x1;})[_0x5022('0x52')](function(_0x4536be){if(_0x4536be['error']){errors+=0x1;delete _0x4536be[_0x5022('0x10')];}else if(_0x4536be[_0x5022('0x22')]){duplicates+=0x1;delete _0x4536be[_0x5022('0x22')];}rows[_0x5022('0x28')](_0x4536be);}));if(total%0xc8===0x0){_0x374379[_0x5022('0x68')]();return processPromises(_0x374379);}},'complete':function(){return processPromises()['then'](function(){logger[_0x5022('0x64')](_0x5022('0x69'));endCsv();});},'error':function(_0x29ae9a,_0x3c2639){logger['info'](_0x5022('0x6a'),JSON[_0x5022('0x2b')](_0x29ae9a));endCsv();}});})[_0x5022('0x52')](function(_0x2255a3){logger[_0x5022('0x10')]('Error\x20executing\x20contact\x20csv\x20import:',JSON[_0x5022('0x2b')](_0x2255a3));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index 9a1d451..1f7d7d5 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 _0x00f5=['contact:import:','abort','SystemError','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','format','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','isNil','DROP\x20TABLE\x20','voice_queues_has_cm_lists','voice_queues','VoiceQueueId','voice_queues_has_cm_blacklists','campaigns_has_cm_lists','campaigns','CampaignId','then','affectedRows','unlink','argv','arguments\x20\x20\x20','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','lodash','papaparse','util','bluebird','moment','squel','ioredis','../../../mysqldb','../../../config/environment','import','redis','defaults','localhost','YYYY-MM-DD\x20HH:mm:ss','test','field','phone','.id\x20=\x20','where','.dialCheckDuplicateType\x20IN\x20(','join','cm_contacts.phone','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','insert','into','cm_hopper','scheduledat','ContactId','ListId','createdAt','priority','recallme','select','from','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','toString','cm_contacts.id','cm_contacts.ListId','cm_hopper_black','fromQuery','updatedAt','fields','concat','keys','CompanyId',')\x20NOT\x20IN\x20?','ListId\x20=\x20?','id\x20IN\x20?','group','error','message','exit','errors','push','code','info','query','spread','catch','main','stringify','send','binding','socket_timestamp','root','server/files/tmp','.csv','header','writeFileSync','parse','createReadStream','length','rows','data','hasOwnProperty','trim','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','UserId','includes','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','firstName','\x20not\x20specified','SystemRow','appendFileSync','emit'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x00f5,0x1a8));var _0x500f=function(_0x25fcfe,_0x5280f9){_0x25fcfe=_0x25fcfe-0x0;var _0x51a103=_0x00f5[_0x25fcfe];return _0x51a103;};'use strict';var fs=require('fs');var path=require('path');var _=require(_0x500f('0x0'));var Papa=require(_0x500f('0x1'));var util=require(_0x500f('0x2'));var BPromise=require(_0x500f('0x3'));var moment=require(_0x500f('0x4'));var squel=require(_0x500f('0x5'));var Redis=require(_0x500f('0x6'));var db=require(_0x500f('0x7'))['db'];var config=require(_0x500f('0x8'));var logger=require('../../../config/logger')(_0x500f('0x9'));config[_0x500f('0xa')]=_[_0x500f('0xb')](config[_0x500f('0xa')],{'host':_0x500f('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x500f('0xa')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()['format'](_0x500f('0xd'));function isEmail(_0x25f566){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))*$/[_0x500f('0xe')](_0x25f566);}function selectNotIn(_0x5afe20,_0x4a95cc,_0x3ba0a7,_0x1500a5,_0x38281d){return squel['select']()[_0x500f('0xf')](_0x500f('0x10'))['from'](_0x1500a5)['join'](_0x4a95cc,null,_0x4a95cc+_0x500f('0x11')+_0x1500a5+'.'+_0x3ba0a7)[_0x500f('0x12')](_0x1500a5+'.'+_0x3ba0a7+'\x20=\x20'+_0x5afe20+'.'+_0x3ba0a7)[_0x500f('0x12')](_0x4a95cc+_0x500f('0x13')+_0x38281d[_0x500f('0x14')]()+')');}function insertCmHopper(_0x136b52,_0x939f3b,_0x52afca,_0x132842,_0x1bb6b5){var _0xd9100e=[_0x500f('0x15'),'cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId',_0x939f3b+'.'+_0x132842,_0x500f('0x16'),_0x500f('0x17'),_0x500f('0x18'),'cm_contacts.UserId','\x22'+_0x1bb6b5+'\x22'];return squel[_0x500f('0x19')]()[_0x500f('0x1a')](_0x500f('0x1b'))['fromQuery']([_0x500f('0x10'),_0x500f('0x1c'),_0x500f('0x1d'),_0x500f('0x1e'),_0x132842,_0x500f('0x1f'),'updatedAt',_0x500f('0x20'),'UserId',_0x500f('0x21')],squel[_0x500f('0x22')]()['fields'](_0xd9100e)[_0x500f('0x23')](_0x939f3b)[_0x500f('0x14')](_0x500f('0x24'),null,_0x500f('0x25')+_0x939f3b+_0x500f('0x26'))[_0x500f('0x14')](_0x52afca,null,_0x52afca+_0x500f('0x11')+_0x939f3b+'.'+_0x132842)[_0x500f('0x12')](_0x939f3b+'.CmListId\x20=\x20?',_0x136b52)['where'](_0x500f('0x27'),NOW)[_0x500f('0x12')](_0x500f('0x28'),selectNotIn(_0x939f3b,_0x52afca,_0x132842,_0x500f('0x1b'),[_0x500f('0x29'),'\x22onlyIfOpen\x22']))[_0x500f('0x12')](_0x500f('0x28'),selectNotIn(_0x939f3b,_0x52afca,_0x132842,_0x500f('0x1b'),[_0x500f('0x29')])))[_0x500f('0x2a')]();}function insertCmHopperBlack(_0x1ff78d,_0x2608ee,_0x624b33,_0x223000){var _0x4e694a=[_0x500f('0x15'),_0x500f('0x2b'),_0x500f('0x2c'),_0x2608ee+'.'+_0x223000,_0x500f('0x16'),_0x500f('0x17')];return squel[_0x500f('0x19')]()['into'](_0x500f('0x2d'))[_0x500f('0x2e')]([_0x500f('0x10'),_0x500f('0x1d'),_0x500f('0x1e'),_0x223000,_0x500f('0x1f'),_0x500f('0x2f')],squel['select']()[_0x500f('0x30')](_0x4e694a)[_0x500f('0x23')](_0x2608ee)[_0x500f('0x14')](_0x500f('0x24'),null,_0x500f('0x25')+_0x2608ee+'.CmListId')[_0x500f('0x14')](_0x624b33,null,_0x624b33+_0x500f('0x11')+_0x2608ee+'.'+_0x223000)[_0x500f('0x12')](_0x2608ee+'.CmListId\x20=\x20?',_0x1ff78d)[_0x500f('0x12')](_0x500f('0x27'),NOW)[_0x500f('0x12')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0x500f('0x22')]()[_0x500f('0xf')](_0x500f('0x10'))[_0x500f('0x23')](_0x500f('0x2d'))[_0x500f('0x12')]('ListId\x20=\x20?',_0x1ff78d)['where'](_0x223000+'\x20=\x20?',_0x2608ee+'.'+_0x223000)))[_0x500f('0x2a')]();}function insertCmContact(_0x38c9b4,_0xb84c7f,_0x108722,_0x15049f){var _0x443cf5=_[_0x500f('0x31')](_[_0x500f('0x32')](_0x15049f),[_0x500f('0x1e'),_0x500f('0x33'),_0x500f('0x1f'),_0x500f('0x2f')]);return squel['insert']()[_0x500f('0x1a')](_0x500f('0x24'))[_0x500f('0x2e')](_0x443cf5,squel[_0x500f('0x22')]()[_0x500f('0x30')](_0x443cf5)['from'](_0xb84c7f)[_0x500f('0x12')]('('+_0x108722['join'](',')+_0x500f('0x34'),squel['select']()[_0x500f('0x30')](_0x108722)['from'](_0x500f('0x24'))[_0x500f('0x12')](_0x500f('0x35'),_0x38c9b4)['where']('deletedAt\x20IS\x20NULL'))['where'](_0x500f('0x36'),squel[_0x500f('0x22')]()[_0x500f('0xf')]('MIN(id)','min_id')[_0x500f('0x23')](_0xb84c7f)[_0x500f('0x37')](_0x108722[_0x500f('0x14')](','))))['toString']();}function handleStop(){logger['info']('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0x2ddc1d){logger[_0x500f('0x38')](_0x2ddc1d[_0x500f('0x39')]);process[_0x500f('0x3a')](0x1);}function handleError(_0x3e4c2c,_0x6aab09){stats[_0x500f('0x3b')][_0x500f('0x3c')]({'name':_0x6aab09[_0x500f('0x3d')],'message':_0x6aab09[_0x500f('0x39')],'row':_0x3e4c2c});}function handleQuery(_0x1a8cef){logger[_0x500f('0x3e')](_0x1a8cef);return db['sequelize'][_0x500f('0x3f')](_0x1a8cef)[_0x500f('0x40')](function(_0x64df5e){results[_0x500f('0x3c')](_0x64df5e);})[_0x500f('0x41')](function(_0x57b404){logger[_0x500f('0x38')](_0x57b404[_0x500f('0x39')]);});}function main(_0x5c7025,_0xa449da,_0xfa7e97,_0x3ccf85){logger[_0x500f('0x3e')](_0x500f('0x42'),_0x5c7025,JSON[_0x500f('0x43')](_0xa449da));process[_0x500f('0x44')]('start');var _0x537c81=_0xa449da[_0x500f('0x45')];var _0x5b62e8=_0xa449da[_0x500f('0x46')];var _0x112831=path[_0x500f('0x14')](config[_0x500f('0x47')],_0x500f('0x48'),_0x5b62e8+_0x500f('0x49'));var _0x5cc6c3=_['keys'](_0x537c81)[_0x500f('0x14')]();logger[_0x500f('0x3e')](_0x500f('0x4a'),_0x5cc6c3);fs[_0x500f('0x4b')](_0x112831,_0x5cc6c3+'\x0a');Papa[_0x500f('0x4c')](fs[_0x500f('0x4d')](_0x5c7025),{'header':!![],'skipEmptyLines':!![],'step':function(_0x5394dd,_0x53b564){try{for(var _0x5f48e7=0x0,_0x4ea5fe=[];_0x5f48e7<_0x5394dd['data'][_0x500f('0x4e')];_0x5f48e7++){stats[_0x500f('0x4f')]+=0x1;if(_0x5394dd[_0x500f('0x3b')][_0x5f48e7]){handleError(_0x5394dd[_0x500f('0x50')][_0x5f48e7],_0x5394dd['errors'][_0x5f48e7]);}else{var _0x187d90=[];for(var _0x590f04 in _0x537c81){if(_0x537c81[_0x500f('0x51')](_0x590f04)){if(_0x5394dd[_0x500f('0x50')][_0x5f48e7][_0x537c81[_0x590f04]]){var _0xeb7c66=_[_0x500f('0x52')](_0x5394dd[_0x500f('0x50')][_0x5f48e7][_0x537c81[_0x590f04]]['replace'](/"/g,'\x27'));switch(_0x590f04){case _0x500f('0x1c'):var _0xa0ccbd=moment(_0xeb7c66,_0x500f('0xd'),!![]);if(_0xa0ccbd[_0x500f('0x53')]()){_0x4ea5fe[_0x500f('0x3c')]('\x22'+_0xeb7c66+'\x22');}else{_0x187d90[_0x500f('0x3c')](_0x500f('0x54'));}break;case _0x500f('0x20'):var _0x1ad776=parseInt(_0xeb7c66);_0xeb7c66=_[_0x500f('0x55')](_0x1ad776)||_0x1ad776<0x0||_0x1ad776>0x4?_0x3ccf85?0x3:0x2:_0x1ad776;_0x4ea5fe[_0x500f('0x3c')]('\x22'+_0xeb7c66+'\x22');break;case _0x500f('0x56'):var _0x4c5117=parseInt(_0xeb7c66);if(_['isNumber'](_0x4c5117)&&_[_0x500f('0x57')](_0xfa7e97,_0x4c5117)){_0x4ea5fe[_0x500f('0x3c')]('\x22'+_0x4c5117+'\x22');}else{_0x187d90[_0x500f('0x3c')]('agent\x20not\x20exists');}break;case'email':if(isEmail(_0xeb7c66)){_0x4ea5fe[_0x500f('0x3c')]('\x22'+_0xeb7c66+'\x22');}else{_0x187d90[_0x500f('0x3c')](_0x500f('0x58'));}break;case _0x500f('0x59'):var _0x2c8fc0=moment(_0xeb7c66,_0x500f('0x5a'),!![]);if(_0x2c8fc0[_0x500f('0x53')]()){_0x4ea5fe[_0x500f('0x3c')]('\x22'+_0xeb7c66+'\x22');}else{_0x187d90['push']('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;default:_0x4ea5fe[_0x500f('0x3c')]('\x22'+_0xeb7c66+'\x22');}}else{switch(_0x590f04){case _0x500f('0x5b'):case _0x500f('0x10'):_0x187d90['push'](_0x590f04+_0x500f('0x5c'));break;default:_0x4ea5fe[_0x500f('0x3c')]('\x22\x22');}}}}if(_0x187d90[_0x500f('0x4e')]){handleError(_0x5394dd['data'][_0x5f48e7],{'code':_0x500f('0x5d'),'message':_0x187d90[_0x500f('0x14')]()});}else{fs[_0x500f('0x5e')](_0x112831,_0x4ea5fe[_0x500f('0x14')]()+'\x0a');}_0x4ea5fe=[];}if(!(stats[_0x500f('0x4f')]%0xc8)){socket[_0x500f('0x5f')](_0x500f('0x60')+_0x5b62e8,stats);stats['errors']=[];}}if(stopped){logger['info']('Abort\x20parser');_0x53b564[_0x500f('0x61')]();}}catch(_0x3feec8){handleError(_0x5394dd[_0x500f('0x50')][_0x5f48e7],{'code':_0x500f('0x62'),'message':_0x3feec8[_0x500f('0x39')]});logger[_0x500f('0x38')](_0x500f('0x63'),_0x3feec8[_0x500f('0x39')]);}},'complete':function(){try{var _0x1fc552=[];var _0x1605ee=_0x500f('0x24');if(_0xa449da[_0x500f('0x64')]&&_0xa449da['duplicates'][_0x500f('0x4e')]){_0x1605ee=_0x500f('0x65')+_0x5b62e8;_0x1fc552['push'](_0x500f('0x66')+_0x1605ee+_0x500f('0x67'));}var _0x4c4d15=util[_0x500f('0x68')](_0x500f('0x69'),_0x112831,_0x1605ee,_0x5cc6c3,_0xa449da[_0x500f('0x1e')],_0xa449da[_0x500f('0x33')]||null,NOW,NOW);if(_[_0x500f('0x6a')](_0x537c81['scheduledat'])){_0x4c4d15+=',\x20scheduledAt\x20=\x20NOW()';}_0x1fc552['push'](_0x4c4d15);if(_0xa449da[_0x500f('0x64')]&&_0xa449da[_0x500f('0x64')]['length']){_0x1fc552[_0x500f('0x3c')](insertCmContact(_0xa449da['ListId'],_0x1605ee,_0xa449da[_0x500f('0x64')],_0x537c81));_0x1fc552['push'](_0x500f('0x6b')+_0x1605ee+';');}_0x1fc552[_0x500f('0x3c')](insertCmHopper(_0xa449da['ListId'],_0x500f('0x6c'),_0x500f('0x6d'),_0x500f('0x6e'),_0x3ccf85));_0x1fc552[_0x500f('0x3c')](insertCmHopperBlack(_0xa449da[_0x500f('0x1e')],_0x500f('0x6f'),_0x500f('0x6d'),_0x500f('0x6e')));_0x1fc552['push'](insertCmHopper(_0xa449da[_0x500f('0x1e')],_0x500f('0x70'),'campaigns','CampaignId',_0x3ccf85));_0x1fc552[_0x500f('0x3c')](insertCmHopperBlack(_0xa449da['ListId'],'campaigns_has_cm_blacklists',_0x500f('0x71'),_0x500f('0x72')));BPromise['each'](_0x1fc552,handleQuery)[_0x500f('0x73')](function(_0x50edc8){stats['finish']=!![];stats['affectedRows']=_0xa449da[_0x500f('0x64')]&&_0xa449da[_0x500f('0x64')]['length']?results[0x2]['affectedRows']:results[0x0][_0x500f('0x74')];socket[_0x500f('0x5f')](_0x500f('0x60')+_0x5b62e8,stats);fs[_0x500f('0x75')](_0x5c7025);fs['unlink'](_0x112831);process[_0x500f('0x3a')](0x0);})[_0x500f('0x41')](function(_0x655eba){logger[_0x500f('0x38')](_0x655eba[_0x500f('0x39')]);process[_0x500f('0x3a')](0x1);});}catch(_0x2bcd1c){logger[_0x500f('0x38')]('complete',_0x2bcd1c[_0x500f('0x39')]);process[_0x500f('0x3a')](0x1);}},'error':function(_0x53aaf2,_0x59ade8,_0x318eb0,_0x28ec79){throw new Error(_0x28ec79);}});}function validate(){if(process[_0x500f('0x76')]&&process[_0x500f('0x76')][_0x500f('0x4e')]<0x4){throw new Error(_0x500f('0x77'));}var _0x13936f=path[_0x500f('0x14')](config['root'],_0x500f('0x48'),process[_0x500f('0x76')][0x2]);if(!fs['existsSync'](_0x13936f)){throw new Error(_0x500f('0x78'));}var _0x352402={};try{_0x352402=JSON[_0x500f('0x4c')](process[_0x500f('0x76')][0x3]);if(!_0x352402[_0x500f('0x45')]){throw new Error(_0x500f('0x79'));}if(!_0x352402[_0x500f('0x45')]['phone']){throw new Error(_0x500f('0x7a'));}if(!_0x352402[_0x500f('0x45')][_0x500f('0x5b')]){throw new Error(_0x500f('0x7b'));}var _0x1f5a6f=0x0;if(_0x352402[_0x500f('0x45')][_0x500f('0x56')]){_0x1f5a6f=0x1;}if(!_0x352402['ListId']){throw new Error(_0x500f('0x7c'));}}catch(_0x1998a3){throw new Error(_0x500f('0x7d'));}var _0x17912e=[];try{_0x17912e=_[_0x500f('0x7e')](JSON[_0x500f('0x4c')](process[_0x500f('0x76')][0x4]),'id');}catch(_0x2fa928){logger[_0x500f('0x3e')](_0x500f('0x7f'));}main(_0x13936f,_0x352402,_0x17912e,_0x1f5a6f);}validate();process['on'](_0x500f('0x80'),handleStop);process['on'](_0x500f('0x81'),handleUncaughtException); \ No newline at end of file +var _0x9a22=['complete','argv','arguments\x20\x20\x20','existsSync','file\x20doesn\x27t\x20exists','parse','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','path','util','bluebird','moment','ioredis','../../../mysqldb','../../../config/environment','redis','format','YYYY-MM-DD\x20HH:mm:ss','test','select','field','phone','from','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.priority','fromQuery','scheduledat','ContactId','ListId','createdAt','updatedAt','UserId','recallme','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','cm_hopper','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_contacts.updatedAt','insert','into','cm_hopper_black','.CmListId\x20=\x20?','ListId\x20=\x20?','\x20=\x20?','concat','CompanyId','deletedAt\x20IS\x20NULL','id\x20IN\x20?','MIN(id)','group','info','error','message','exit','errors','push','code','sequelize','spread','catch','stringify','send','binding','server/files/tmp','keys','header','writeFileSync','createReadStream','data','rows','hasOwnProperty','trim','replace','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','priority','isNaN','isNumber','agent\x20not\x20exists','email','email\x20wrong\x20format','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','length','appendFileSync','emit','contact:import:','Abort\x20parser','SystemError','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','isNil','DROP\x20TABLE\x20','voice_queues_has_cm_lists','voice_queues','VoiceQueueId','campaigns','CampaignId','campaigns_has_cm_blacklists','each','then','finish','affectedRows','unlink'];(function(_0xe219e7,_0x31bd0e){var _0x19ea41=function(_0x41ae95){while(--_0x41ae95){_0xe219e7['push'](_0xe219e7['shift']());}};_0x19ea41(++_0x31bd0e);}(_0x9a22,0x18d));var _0x29a2=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0x9a22[_0x5b561d];return _0x431060;};'use strict';var fs=require('fs');var path=require(_0x29a2('0x0'));var _=require('lodash');var Papa=require('papaparse');var util=require(_0x29a2('0x1'));var BPromise=require(_0x29a2('0x2'));var moment=require(_0x29a2('0x3'));var squel=require('squel');var Redis=require(_0x29a2('0x4'));var db=require(_0x29a2('0x5'))['db'];var config=require(_0x29a2('0x6'));var logger=require('../../../config/logger')('import');config[_0x29a2('0x7')]=_['defaults'](config[_0x29a2('0x7')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x29a2('0x7')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0x29a2('0x8')](_0x29a2('0x9'));function isEmail(_0x5f5542){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))*$/[_0x29a2('0xa')](_0x5f5542);}function selectNotIn(_0x3da52d,_0x2aeaef,_0x2556f5,_0x189790,_0x33560b){return squel[_0x29a2('0xb')]()[_0x29a2('0xc')](_0x29a2('0xd'))[_0x29a2('0xe')](_0x189790)[_0x29a2('0xf')](_0x2aeaef,null,_0x2aeaef+_0x29a2('0x10')+_0x189790+'.'+_0x2556f5)[_0x29a2('0x11')](_0x189790+'.'+_0x2556f5+_0x29a2('0x12')+_0x3da52d+'.'+_0x2556f5)['where'](_0x2aeaef+_0x29a2('0x13')+_0x33560b[_0x29a2('0xf')]()+')');}function insertCmHopper(_0xb2d3b3,_0x4d9222,_0x83135,_0x301cff,_0x4a52c2){var _0xdc9d08=[_0x29a2('0x14'),_0x29a2('0x15'),_0x29a2('0x16'),_0x29a2('0x17'),_0x4d9222+'.'+_0x301cff,_0x29a2('0x18'),'cm_contacts.updatedAt',_0x29a2('0x19'),'cm_contacts.UserId','\x22'+_0x4a52c2+'\x22'];return squel['insert']()['into']('cm_hopper')[_0x29a2('0x1a')]([_0x29a2('0xd'),_0x29a2('0x1b'),_0x29a2('0x1c'),_0x29a2('0x1d'),_0x301cff,_0x29a2('0x1e'),_0x29a2('0x1f'),'priority',_0x29a2('0x20'),_0x29a2('0x21')],squel['select']()[_0x29a2('0x22')](_0xdc9d08)[_0x29a2('0xe')](_0x4d9222)[_0x29a2('0xf')](_0x29a2('0x23'),null,_0x29a2('0x24')+_0x4d9222+_0x29a2('0x25'))[_0x29a2('0xf')](_0x83135,null,_0x83135+_0x29a2('0x10')+_0x4d9222+'.'+_0x301cff)[_0x29a2('0x11')](_0x4d9222+'.CmListId\x20=\x20?',_0xb2d3b3)[_0x29a2('0x11')](_0x29a2('0x26'),NOW)[_0x29a2('0x11')](_0x29a2('0x27'),selectNotIn(_0x4d9222,_0x83135,_0x301cff,_0x29a2('0x28'),[_0x29a2('0x29'),_0x29a2('0x2a')]))[_0x29a2('0x11')](_0x29a2('0x27'),selectNotIn(_0x4d9222,_0x83135,_0x301cff,_0x29a2('0x28'),[_0x29a2('0x29')])))[_0x29a2('0x2b')]();}function insertCmHopperBlack(_0x2620eb,_0x2d7480,_0x561f64,_0x4dfcf0){var _0x28f4ce=['cm_contacts.phone',_0x29a2('0x16'),_0x29a2('0x17'),_0x2d7480+'.'+_0x4dfcf0,_0x29a2('0x18'),_0x29a2('0x2c')];return squel[_0x29a2('0x2d')]()[_0x29a2('0x2e')](_0x29a2('0x2f'))[_0x29a2('0x1a')]([_0x29a2('0xd'),_0x29a2('0x1c'),_0x29a2('0x1d'),_0x4dfcf0,_0x29a2('0x1e'),'updatedAt'],squel[_0x29a2('0xb')]()[_0x29a2('0x22')](_0x28f4ce)[_0x29a2('0xe')](_0x2d7480)[_0x29a2('0xf')](_0x29a2('0x23'),null,_0x29a2('0x24')+_0x2d7480+_0x29a2('0x25'))[_0x29a2('0xf')](_0x561f64,null,_0x561f64+_0x29a2('0x10')+_0x2d7480+'.'+_0x4dfcf0)['where'](_0x2d7480+_0x29a2('0x30'),_0x2620eb)[_0x29a2('0x11')](_0x29a2('0x26'),NOW)[_0x29a2('0x11')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel['select']()['field'](_0x29a2('0xd'))[_0x29a2('0xe')](_0x29a2('0x2f'))[_0x29a2('0x11')](_0x29a2('0x31'),_0x2620eb)[_0x29a2('0x11')](_0x4dfcf0+_0x29a2('0x32'),_0x2d7480+'.'+_0x4dfcf0)))[_0x29a2('0x2b')]();}function insertCmContact(_0x165435,_0x49d65c,_0x2bb02f,_0x2afe64){var _0x16fdbb=_[_0x29a2('0x33')](_['keys'](_0x2afe64),['ListId',_0x29a2('0x34'),_0x29a2('0x1e'),_0x29a2('0x1f')]);return squel[_0x29a2('0x2d')]()[_0x29a2('0x2e')](_0x29a2('0x23'))[_0x29a2('0x1a')](_0x16fdbb,squel[_0x29a2('0xb')]()[_0x29a2('0x22')](_0x16fdbb)[_0x29a2('0xe')](_0x49d65c)[_0x29a2('0x11')]('('+_0x2bb02f['join'](',')+')\x20NOT\x20IN\x20?',squel[_0x29a2('0xb')]()[_0x29a2('0x22')](_0x2bb02f)['from']('cm_contacts')[_0x29a2('0x11')]('ListId\x20=\x20?',_0x165435)[_0x29a2('0x11')](_0x29a2('0x35')))['where'](_0x29a2('0x36'),squel[_0x29a2('0xb')]()[_0x29a2('0xc')](_0x29a2('0x37'),'min_id')[_0x29a2('0xe')](_0x49d65c)[_0x29a2('0x38')](_0x2bb02f['join'](','))))[_0x29a2('0x2b')]();}function handleStop(){logger[_0x29a2('0x39')]('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0x52ff00){logger[_0x29a2('0x3a')](_0x52ff00[_0x29a2('0x3b')]);process[_0x29a2('0x3c')](0x1);}function handleError(_0x206e1c,_0xe37094){stats[_0x29a2('0x3d')][_0x29a2('0x3e')]({'name':_0xe37094[_0x29a2('0x3f')],'message':_0xe37094[_0x29a2('0x3b')],'row':_0x206e1c});}function handleQuery(_0x52c44c){logger[_0x29a2('0x39')](_0x52c44c);return db[_0x29a2('0x40')]['query'](_0x52c44c)[_0x29a2('0x41')](function(_0x2332fe){results[_0x29a2('0x3e')](_0x2332fe);})[_0x29a2('0x42')](function(_0x120592){logger[_0x29a2('0x3a')](_0x120592[_0x29a2('0x3b')]);});}function main(_0x3d0c62,_0x2cf7bc,_0x55aac3,_0x585279){logger[_0x29a2('0x39')]('main',_0x3d0c62,JSON[_0x29a2('0x43')](_0x2cf7bc));process[_0x29a2('0x44')]('start');var _0x31701a=_0x2cf7bc[_0x29a2('0x45')];var _0x30e347=_0x2cf7bc['socket_timestamp'];var _0x43c77a=path[_0x29a2('0xf')](config['root'],_0x29a2('0x46'),_0x30e347+'.csv');var _0x44a622=_[_0x29a2('0x47')](_0x31701a)[_0x29a2('0xf')]();logger[_0x29a2('0x39')](_0x29a2('0x48'),_0x44a622);fs[_0x29a2('0x49')](_0x43c77a,_0x44a622+'\x0a');Papa['parse'](fs[_0x29a2('0x4a')](_0x3d0c62),{'header':!![],'skipEmptyLines':!![],'step':function(_0x2db06e,_0x200c54){try{for(var _0x5e4613=0x0,_0x2564b5=[];_0x5e4613<_0x2db06e[_0x29a2('0x4b')]['length'];_0x5e4613++){stats[_0x29a2('0x4c')]+=0x1;if(_0x2db06e[_0x29a2('0x3d')][_0x5e4613]){handleError(_0x2db06e[_0x29a2('0x4b')][_0x5e4613],_0x2db06e[_0x29a2('0x3d')][_0x5e4613]);}else{var _0x3dd91e=[];for(var _0x9248c1 in _0x31701a){if(_0x31701a[_0x29a2('0x4d')](_0x9248c1)){if(_0x2db06e[_0x29a2('0x4b')][_0x5e4613][_0x31701a[_0x9248c1]]){var _0x1750d5=_[_0x29a2('0x4e')](_0x2db06e['data'][_0x5e4613][_0x31701a[_0x9248c1]][_0x29a2('0x4f')](/"/g,'\x27'));switch(_0x9248c1){case _0x29a2('0x1b'):var _0x40f932=moment(_0x1750d5,'YYYY-MM-DD\x20HH:mm:ss',!![]);if(_0x40f932[_0x29a2('0x50')]()){_0x2564b5[_0x29a2('0x3e')]('\x22'+_0x1750d5+'\x22');}else{_0x3dd91e[_0x29a2('0x3e')](_0x29a2('0x51'));}break;case _0x29a2('0x52'):var _0x28f171=parseInt(_0x1750d5);_0x1750d5=_[_0x29a2('0x53')](_0x28f171)||_0x28f171<0x0||_0x28f171>0x4?_0x585279?0x3:0x2:_0x28f171;_0x2564b5[_0x29a2('0x3e')]('\x22'+_0x1750d5+'\x22');break;case'UserId':var _0x31811d=parseInt(_0x1750d5);if(_[_0x29a2('0x54')](_0x31811d)&&_['includes'](_0x55aac3,_0x31811d)){_0x2564b5['push']('\x22'+_0x31811d+'\x22');}else{_0x3dd91e['push'](_0x29a2('0x55'));}break;case _0x29a2('0x56'):if(isEmail(_0x1750d5)){_0x2564b5[_0x29a2('0x3e')]('\x22'+_0x1750d5+'\x22');}else{_0x3dd91e[_0x29a2('0x3e')](_0x29a2('0x57'));}break;case'dateOfBirth':var _0xfadea8=moment(_0x1750d5,_0x29a2('0x58'),!![]);if(_0xfadea8[_0x29a2('0x50')]()){_0x2564b5['push']('\x22'+_0x1750d5+'\x22');}else{_0x3dd91e[_0x29a2('0x3e')](_0x29a2('0x59'));}break;default:_0x2564b5['push']('\x22'+_0x1750d5+'\x22');}}else{switch(_0x9248c1){case _0x29a2('0x5a'):case _0x29a2('0xd'):_0x3dd91e[_0x29a2('0x3e')](_0x9248c1+'\x20not\x20specified');break;default:_0x2564b5['push']('\x22\x22');}}}}if(_0x3dd91e[_0x29a2('0x5b')]){handleError(_0x2db06e[_0x29a2('0x4b')][_0x5e4613],{'code':'SystemRow','message':_0x3dd91e[_0x29a2('0xf')]()});}else{fs[_0x29a2('0x5c')](_0x43c77a,_0x2564b5['join']()+'\x0a');}_0x2564b5=[];}if(!(stats['rows']%0xc8)){socket[_0x29a2('0x5d')](_0x29a2('0x5e')+_0x30e347,stats);stats[_0x29a2('0x3d')]=[];}}if(stopped){logger[_0x29a2('0x39')](_0x29a2('0x5f'));_0x200c54['abort']();}}catch(_0x4f8954){handleError(_0x2db06e[_0x29a2('0x4b')][_0x5e4613],{'code':_0x29a2('0x60'),'message':_0x4f8954[_0x29a2('0x3b')]});logger[_0x29a2('0x3a')](_0x29a2('0x61'),_0x4f8954[_0x29a2('0x3b')]);}},'complete':function(){try{var _0x1a3e92=[];var _0x19ea63=_0x29a2('0x23');if(_0x2cf7bc[_0x29a2('0x62')]&&_0x2cf7bc[_0x29a2('0x62')][_0x29a2('0x5b')]){_0x19ea63=_0x29a2('0x63')+_0x30e347;_0x1a3e92['push'](_0x29a2('0x64')+_0x19ea63+'\x20LIKE\x20cm_contacts;');}var _0xbe05b0=util[_0x29a2('0x8')](_0x29a2('0x65'),_0x43c77a,_0x19ea63,_0x44a622,_0x2cf7bc[_0x29a2('0x1d')],_0x2cf7bc[_0x29a2('0x34')]||null,NOW,NOW);if(_[_0x29a2('0x66')](_0x31701a[_0x29a2('0x1b')])){_0xbe05b0+=',\x20scheduledAt\x20=\x20NOW()';}_0x1a3e92[_0x29a2('0x3e')](_0xbe05b0);if(_0x2cf7bc[_0x29a2('0x62')]&&_0x2cf7bc[_0x29a2('0x62')][_0x29a2('0x5b')]){_0x1a3e92['push'](insertCmContact(_0x2cf7bc[_0x29a2('0x1d')],_0x19ea63,_0x2cf7bc[_0x29a2('0x62')],_0x31701a));_0x1a3e92[_0x29a2('0x3e')](_0x29a2('0x67')+_0x19ea63+';');}_0x1a3e92[_0x29a2('0x3e')](insertCmHopper(_0x2cf7bc[_0x29a2('0x1d')],_0x29a2('0x68'),_0x29a2('0x69'),_0x29a2('0x6a'),_0x585279));_0x1a3e92[_0x29a2('0x3e')](insertCmHopperBlack(_0x2cf7bc[_0x29a2('0x1d')],'voice_queues_has_cm_blacklists',_0x29a2('0x69'),_0x29a2('0x6a')));_0x1a3e92[_0x29a2('0x3e')](insertCmHopper(_0x2cf7bc['ListId'],'campaigns_has_cm_lists',_0x29a2('0x6b'),_0x29a2('0x6c'),_0x585279));_0x1a3e92[_0x29a2('0x3e')](insertCmHopperBlack(_0x2cf7bc[_0x29a2('0x1d')],_0x29a2('0x6d'),_0x29a2('0x6b'),_0x29a2('0x6c')));BPromise[_0x29a2('0x6e')](_0x1a3e92,handleQuery)[_0x29a2('0x6f')](function(_0x48a06d){stats[_0x29a2('0x70')]=!![];stats[_0x29a2('0x71')]=_0x2cf7bc[_0x29a2('0x62')]&&_0x2cf7bc[_0x29a2('0x62')][_0x29a2('0x5b')]?results[0x2][_0x29a2('0x71')]:results[0x0]['affectedRows'];socket[_0x29a2('0x5d')](_0x29a2('0x5e')+_0x30e347,stats);fs[_0x29a2('0x72')](_0x3d0c62);fs[_0x29a2('0x72')](_0x43c77a);process[_0x29a2('0x3c')](0x0);})[_0x29a2('0x42')](function(_0x1aaea6){logger[_0x29a2('0x3a')](_0x1aaea6[_0x29a2('0x3b')]);process['exit'](0x1);});}catch(_0x570561){logger[_0x29a2('0x3a')](_0x29a2('0x73'),_0x570561[_0x29a2('0x3b')]);process[_0x29a2('0x3c')](0x1);}},'error':function(_0x14b288,_0x3e4013,_0x2f279e,_0xffd6ad){throw new Error(_0xffd6ad);}});}function validate(){if(process[_0x29a2('0x74')]&&process[_0x29a2('0x74')][_0x29a2('0x5b')]<0x4){throw new Error(_0x29a2('0x75'));}var _0x7b472d=path[_0x29a2('0xf')](config['root'],_0x29a2('0x46'),process[_0x29a2('0x74')][0x2]);if(!fs[_0x29a2('0x76')](_0x7b472d)){throw new Error(_0x29a2('0x77'));}var _0x3f94f1={};try{_0x3f94f1=JSON[_0x29a2('0x78')](process['argv'][0x3]);if(!_0x3f94f1['binding']){throw new Error('binding\x20doesn\x27t\x20exists');}if(!_0x3f94f1[_0x29a2('0x45')][_0x29a2('0xd')]){throw new Error(_0x29a2('0x79'));}if(!_0x3f94f1[_0x29a2('0x45')][_0x29a2('0x5a')]){throw new Error(_0x29a2('0x7a'));}var _0x285012=0x0;if(_0x3f94f1[_0x29a2('0x45')]['UserId']){_0x285012=0x1;}if(!_0x3f94f1[_0x29a2('0x1d')]){throw new Error(_0x29a2('0x7b'));}}catch(_0x2c618a){throw new Error(_0x29a2('0x7c'));}var _0x5278c0=[];try{_0x5278c0=_[_0x29a2('0x7d')](JSON[_0x29a2('0x78')](process[_0x29a2('0x74')][0x4]),'id');}catch(_0xee34f6){logger[_0x29a2('0x39')](_0x29a2('0x7e'));}main(_0x7b472d,_0x3f94f1,_0x5278c0,_0x285012);}validate();process['on'](_0x29a2('0x7f'),handleStop);process['on']('uncaughtException',handleUncaughtException); \ No newline at end of file diff --git a/server/components/integrations/configuration.js b/server/components/integrations/configuration.js index 1a298dd..7bc25c1 100644 --- a/server/components/integrations/configuration.js +++ b/server/components/integrations/configuration.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfacb=['Call\x20To','destexten','Queue','UniqueId','Date','agentcalledAt','Agent\x20Name','destcalleridname','Agent\x20Number','destcalleridnum','Agent\x20Ring','agentconnectAt','Agent\x20Complete','agentcompleteAt','Hold\x20Time','holdtime','Talk\x20Time','talktime','***\x20Call\x20Info\x20***','Member\x20Name','membername','starttime','Answer\x20Time','Complete\x20Time','endtime','Billable\x20Time','billableseconds','getSubjects','string','[xCALLY\x20Ticket]','toLowerCase','voice','push','variable','queue','calleridnum','Outbound\x20Call','inbound','Caller\x20Number','Caller\x20Name','calleridname','keyValue'];(function(_0x438685,_0x4ec0c0){var _0x41cca2=function(_0x532003){while(--_0x532003){_0x438685['push'](_0x438685['shift']());}};_0x41cca2(++_0x4ec0c0);}(_0xfacb,0x6f));var _0xbfac=function(_0xbf271,_0x304f2f){_0xbf271=_0xbf271-0x0;var _0x4a27f8=_0xfacb[_0xbf271];return _0x4a27f8;};'use strict';exports[_0xbfac('0x0')]=function(_0x4b0e5f,_0x54f449){var _0x52de30=[{'type':_0xbfac('0x1'),'content':_0xbfac('0x2'),'variableName':null}];switch(_0x4b0e5f[_0xbfac('0x3')]()){case _0xbfac('0x4'):switch(_0x54f449[_0xbfac('0x3')]()){case'inbound':_0x52de30[_0xbfac('0x5')]({'type':_0xbfac('0x6'),'content':'','variableName':_0xbfac('0x7')});_0x52de30['push']({'type':_0xbfac('0x6'),'content':'','variableName':_0xbfac('0x8')});break;case'outbound':_0x52de30[_0xbfac('0x5')]({'type':'string','content':_0xbfac('0x9'),'variableName':null});_0x52de30['push']({'type':_0xbfac('0x6'),'content':'','variableName':'destcalleridnum'});break;}}return _0x52de30;};exports['getDescriptions']=function(_0x54033c,_0x4f6a9a){var _0x1e2955=[];switch(_0x54033c[_0xbfac('0x3')]()){case _0xbfac('0x4'):switch(_0x4f6a9a[_0xbfac('0x3')]()){case _0xbfac('0xa'):_0x1e2955=[{'type':_0xbfac('0x1'),'content':'***\x20Call\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0xbfac('0xb'),'keyType':_0xbfac('0x6'),'variableName':'calleridnum'},{'type':'keyValue','content':'','key':_0xbfac('0xc'),'keyType':_0xbfac('0x6'),'variableName':_0xbfac('0xd')},{'type':_0xbfac('0xe'),'content':'','key':_0xbfac('0xf'),'keyType':_0xbfac('0x6'),'variableName':_0xbfac('0x10')},{'type':_0xbfac('0xe'),'content':'','key':_0xbfac('0x11'),'keyType':_0xbfac('0x6'),'variableName':_0xbfac('0x7')},{'type':_0xbfac('0xe'),'content':'','key':_0xbfac('0x12'),'keyType':'variable','variableName':'uniqueid'},{'type':_0xbfac('0xe'),'content':'','key':_0xbfac('0x13'),'keyType':_0xbfac('0x6'),'variableName':_0xbfac('0x14')},{'type':_0xbfac('0x1'),'content':'***\x20Agent\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0xbfac('0xe'),'content':'','key':_0xbfac('0x15'),'keyType':_0xbfac('0x6'),'variableName':_0xbfac('0x16')},{'type':_0xbfac('0xe'),'content':'','key':_0xbfac('0x17'),'keyType':_0xbfac('0x6'),'variableName':_0xbfac('0x18')},{'type':_0xbfac('0x1'),'content':'***\x20Time\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0xbfac('0xe'),'content':'','key':_0xbfac('0x19'),'keyType':_0xbfac('0x6'),'variableName':'agentcalledAt'},{'type':_0xbfac('0xe'),'content':'','key':'Agent\x20Connect','keyType':_0xbfac('0x6'),'variableName':_0xbfac('0x1a')},{'type':_0xbfac('0xe'),'content':'','key':_0xbfac('0x1b'),'keyType':_0xbfac('0x6'),'variableName':_0xbfac('0x1c')},{'type':_0xbfac('0xe'),'content':'','key':_0xbfac('0x1d'),'keyType':_0xbfac('0x6'),'variableName':_0xbfac('0x1e')},{'type':_0xbfac('0xe'),'content':'','key':_0xbfac('0x1f'),'keyType':'variable','variableName':_0xbfac('0x20')}];break;case'outbound':_0x1e2955=[{'type':_0xbfac('0x1'),'content':_0xbfac('0x21'),'variableName':null},{'type':_0xbfac('0xe'),'content':'','key':'Called\x20Number','keyType':_0xbfac('0x6'),'keyContent':'','variableName':_0xbfac('0x18')},{'type':_0xbfac('0xe'),'content':'','key':_0xbfac('0x22'),'keyType':_0xbfac('0x6'),'keyContent':'','variableName':_0xbfac('0x23')},{'type':_0xbfac('0xe'),'content':'','key':_0xbfac('0x12'),'keyType':_0xbfac('0x6'),'keyContent':'','variableName':'uniqueid'},{'type':_0xbfac('0xe'),'content':'','key':_0xbfac('0x13'),'keyType':_0xbfac('0x6'),'keyContent':'','variableName':_0xbfac('0x24')},{'type':_0xbfac('0x1'),'content':'***\x20Time\x20Info\x20***'},{'type':_0xbfac('0xe'),'content':'','key':_0xbfac('0x25'),'keyType':_0xbfac('0x6'),'keyContent':'','variableName':'answertime'},{'type':_0xbfac('0xe'),'content':'','key':_0xbfac('0x26'),'keyType':_0xbfac('0x6'),'keyContent':'','variableName':_0xbfac('0x27')},{'type':_0xbfac('0xe'),'content':'','key':'Duration','keyType':_0xbfac('0x6'),'keyContent':'','variableName':'duration'},{'type':'keyValue','content':'','key':_0xbfac('0x28'),'keyType':_0xbfac('0x6'),'keyContent':'','variableName':_0xbfac('0x29')}];break;}}return _0x1e2955;}; \ No newline at end of file +var _0xf153=['string','[xCALLY\x20Ticket]','voice','push','variable','queue','calleridnum','toLowerCase','***\x20Call\x20Info\x20***','keyValue','Caller\x20Number','Caller\x20Name','destexten','Queue','UniqueId','Date','agentcalledAt','***\x20Agent\x20Info\x20***','destcalleridname','Agent\x20Number','destcalleridnum','***\x20Time\x20Info\x20***','Agent\x20Ring','Agent\x20Connect','agentconnectAt','Agent\x20Complete','agentcompleteAt','Hold\x20Time','holdtime','Talk\x20Time','talktime','outbound','Called\x20Number','Member\x20Name','membername','uniqueid','starttime','Answer\x20Time','Complete\x20Time','endtime','Duration','duration','Billable\x20Time','billableseconds','getSubjects'];(function(_0x580ff8,_0x1f9bf5){var _0x51f24f=function(_0x20e7f8){while(--_0x20e7f8){_0x580ff8['push'](_0x580ff8['shift']());}};_0x51f24f(++_0x1f9bf5);}(_0xf153,0x194));var _0x3f15=function(_0x5238b8,_0x1a7492){_0x5238b8=_0x5238b8-0x0;var _0x2a7f68=_0xf153[_0x5238b8];return _0x2a7f68;};'use strict';exports[_0x3f15('0x0')]=function(_0x3e192b,_0x148c17){var _0x55ebb0=[{'type':_0x3f15('0x1'),'content':_0x3f15('0x2'),'variableName':null}];switch(_0x3e192b['toLowerCase']()){case _0x3f15('0x3'):switch(_0x148c17['toLowerCase']()){case'inbound':_0x55ebb0[_0x3f15('0x4')]({'type':_0x3f15('0x5'),'content':'','variableName':_0x3f15('0x6')});_0x55ebb0[_0x3f15('0x4')]({'type':_0x3f15('0x5'),'content':'','variableName':_0x3f15('0x7')});break;case'outbound':_0x55ebb0['push']({'type':_0x3f15('0x1'),'content':'Outbound\x20Call','variableName':null});_0x55ebb0[_0x3f15('0x4')]({'type':_0x3f15('0x5'),'content':'','variableName':'destcalleridnum'});break;}}return _0x55ebb0;};exports['getDescriptions']=function(_0x5e4c2b,_0x1e54d6){var _0x4ccfc6=[];switch(_0x5e4c2b[_0x3f15('0x8')]()){case'voice':switch(_0x1e54d6['toLowerCase']()){case'inbound':_0x4ccfc6=[{'type':_0x3f15('0x1'),'content':_0x3f15('0x9'),'key':null,'keyType':null,'variableName':null},{'type':_0x3f15('0xa'),'content':'','key':_0x3f15('0xb'),'keyType':_0x3f15('0x5'),'variableName':_0x3f15('0x7')},{'type':_0x3f15('0xa'),'content':'','key':_0x3f15('0xc'),'keyType':'variable','variableName':'calleridname'},{'type':_0x3f15('0xa'),'content':'','key':'Call\x20To','keyType':_0x3f15('0x5'),'variableName':_0x3f15('0xd')},{'type':_0x3f15('0xa'),'content':'','key':_0x3f15('0xe'),'keyType':_0x3f15('0x5'),'variableName':_0x3f15('0x6')},{'type':_0x3f15('0xa'),'content':'','key':_0x3f15('0xf'),'keyType':_0x3f15('0x5'),'variableName':'uniqueid'},{'type':_0x3f15('0xa'),'content':'','key':_0x3f15('0x10'),'keyType':_0x3f15('0x5'),'variableName':_0x3f15('0x11')},{'type':_0x3f15('0x1'),'content':_0x3f15('0x12'),'key':null,'keyType':null,'variableName':null},{'type':_0x3f15('0xa'),'content':'','key':'Agent\x20Name','keyType':_0x3f15('0x5'),'variableName':_0x3f15('0x13')},{'type':'keyValue','content':'','key':_0x3f15('0x14'),'keyType':_0x3f15('0x5'),'variableName':_0x3f15('0x15')},{'type':_0x3f15('0x1'),'content':_0x3f15('0x16'),'key':null,'keyType':null,'variableName':null},{'type':_0x3f15('0xa'),'content':'','key':_0x3f15('0x17'),'keyType':_0x3f15('0x5'),'variableName':_0x3f15('0x11')},{'type':'keyValue','content':'','key':_0x3f15('0x18'),'keyType':_0x3f15('0x5'),'variableName':_0x3f15('0x19')},{'type':_0x3f15('0xa'),'content':'','key':_0x3f15('0x1a'),'keyType':_0x3f15('0x5'),'variableName':_0x3f15('0x1b')},{'type':'keyValue','content':'','key':_0x3f15('0x1c'),'keyType':_0x3f15('0x5'),'variableName':_0x3f15('0x1d')},{'type':'keyValue','content':'','key':_0x3f15('0x1e'),'keyType':_0x3f15('0x5'),'variableName':_0x3f15('0x1f')}];break;case _0x3f15('0x20'):_0x4ccfc6=[{'type':'string','content':'***\x20Call\x20Info\x20***','variableName':null},{'type':_0x3f15('0xa'),'content':'','key':_0x3f15('0x21'),'keyType':_0x3f15('0x5'),'keyContent':'','variableName':_0x3f15('0x15')},{'type':_0x3f15('0xa'),'content':'','key':_0x3f15('0x22'),'keyType':_0x3f15('0x5'),'keyContent':'','variableName':_0x3f15('0x23')},{'type':_0x3f15('0xa'),'content':'','key':_0x3f15('0xf'),'keyType':_0x3f15('0x5'),'keyContent':'','variableName':_0x3f15('0x24')},{'type':'keyValue','content':'','key':_0x3f15('0x10'),'keyType':_0x3f15('0x5'),'keyContent':'','variableName':_0x3f15('0x25')},{'type':_0x3f15('0x1'),'content':'***\x20Time\x20Info\x20***'},{'type':_0x3f15('0xa'),'content':'','key':_0x3f15('0x26'),'keyType':'variable','keyContent':'','variableName':'answertime'},{'type':_0x3f15('0xa'),'content':'','key':_0x3f15('0x27'),'keyType':_0x3f15('0x5'),'keyContent':'','variableName':_0x3f15('0x28')},{'type':_0x3f15('0xa'),'content':'','key':_0x3f15('0x29'),'keyType':_0x3f15('0x5'),'keyContent':'','variableName':_0x3f15('0x2a')},{'type':_0x3f15('0xa'),'content':'','key':_0x3f15('0x2b'),'keyType':_0x3f15('0x5'),'keyContent':'','variableName':_0x3f15('0x2c')}];break;}}return _0x4ccfc6;}; \ No newline at end of file diff --git a/server/components/interaction/service.js b/server/components/interaction/service.js index 466eef2..76ffae9 100644 --- a/server/components/interaction/service.js +++ b/server/components/interaction/service.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5a01=['sms-interactions','whatsapp-interactions','upperFirst','InteractionId','unknown','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','role','stringify','null','Interaction','findOne','then','update','info','tracked','user','clone','body','omit','html','phone','fax','lodash','../../mysqldb','../../config/logger','mail-interactions'];(function(_0x3cc762,_0x2babfc){var _0x4dd5a1=function(_0x1fd50b){while(--_0x1fd50b){_0x3cc762['push'](_0x3cc762['shift']());}};_0x4dd5a1(++_0x2babfc);}(_0x5a01,0x1af));var _0x15a0=function(_0x40b2ed,_0x2b1765){_0x40b2ed=_0x40b2ed-0x0;var _0x18397d=_0x5a01[_0x40b2ed];return _0x18397d;};'use strict';var _=require(_0x15a0('0x0'));var db=require(_0x15a0('0x1'))['db'];var loggers={'openchannel':require(_0x15a0('0x2'))('openchannel-interactions'),'mail':require('../../config/logger')(_0x15a0('0x3')),'fax':require(_0x15a0('0x2'))('fax-interactions'),'sms':require(_0x15a0('0x2'))(_0x15a0('0x4')),'chat':require(_0x15a0('0x2'))('chat-interactions'),'whatsapp':require('../../config/logger')(_0x15a0('0x5'))};function getInteractionId(_0x52ab0,_0x40fd51,_0x502248){if(_0x52ab0&&_0x52ab0[_[_0x15a0('0x6')](_0x502248)+_0x15a0('0x7')]){return _0x52ab0[_[_0x15a0('0x6')](_0x502248)+_0x15a0('0x7')];}else if(_0x52ab0&&_0x52ab0['id']){return _0x52ab0['id'];}else if(_0x40fd51&&_0x40fd51['id']){return _0x40fd51['id'];}else{return _0x15a0('0x8');}}function log(_0x5d6fb5,_0x4be840,_0x339f74,_0x4541a0,_0x104f09,_0x24497a){loggers[_0x104f09[_0x15a0('0x9')]()][_0x5d6fb5](_0x15a0('0xa'),_0x24497a[_0x15a0('0xb')](),_0x4be840?_0x4be840['id']:null,_0x4be840?_0x4be840[_0x15a0('0xc')]:null,_0x4be840?_0x4be840[_0x15a0('0xd')]:null,getInteractionId(_0x339f74,_0x4541a0,_0x104f09),_0x339f74?JSON[_0x15a0('0xe')](_0x339f74):_0x15a0('0xf'));}function updateUser(_0x418907,_0x58c549,_0x520a82,_0x3d80e9,_0x1bacb4){db[_[_0x15a0('0x6')](_0x3d80e9)+_0x15a0('0x10')][_0x15a0('0x11')]({'where':{'id':getInteractionId(_0x58c549,_0x520a82,_0x3d80e9)}})[_0x15a0('0x12')](function(_0x2595c1){if(_0x2595c1){return _0x2595c1[_0x15a0('0x13')]({'UserId':_0x418907?_0x418907['id']:null});}})[_0x15a0('0x12')](function(_0x547d10){if(_0x547d10){log(_0x15a0('0x14'),_0x418907,_0x58c549,_0x520a82,_0x3d80e9,_0x1bacb4);}})['catch'](function(){log('error',_0x418907,_0x58c549,_0x520a82,_0x3d80e9,_0x1bacb4);});}exports[_0x15a0('0x15')]=function(_0x2896bb,_0x45cf59){return function(_0x29383c,_0x5d4373,_0x5e7b01){var _0x5044c0=_0x29383c[_0x15a0('0x16')];var _0x56a2be={};var _0x1a71b6=_0x29383c['query'];if(_0x56a2be){_0x56a2be=_[_0x15a0('0x17')](_0x29383c[_0x15a0('0x18')]);_0x56a2be=_[_0x15a0('0x19')](_0x56a2be,[_0x15a0('0x18'),_0x15a0('0x1a'),_0x15a0('0x1b'),_0x15a0('0x1c'),'mobile']);}updateUser(_0x5044c0,_0x56a2be,_0x1a71b6,_0x2896bb,_0x45cf59);_0x5e7b01(null);};}; \ No newline at end of file +var _0xc9db=['openchannel-interactions','fax-interactions','chat-interactions','whatsapp-interactions','upperFirst','InteractionId','toUpperCase','name','role','stringify','findOne','then','update','info','catch','tracked','user','query','clone','body','omit','html','phone','fax','mobile','lodash','../../mysqldb','../../config/logger'];(function(_0x38193d,_0x4662df){var _0x1548db=function(_0x136416){while(--_0x136416){_0x38193d['push'](_0x38193d['shift']());}};_0x1548db(++_0x4662df);}(_0xc9db,0x89));var _0xbc9d=function(_0x3c2e04,_0x24bd4f){_0x3c2e04=_0x3c2e04-0x0;var _0x1b28be=_0xc9db[_0x3c2e04];return _0x1b28be;};'use strict';var _=require(_0xbc9d('0x0'));var db=require(_0xbc9d('0x1'))['db'];var loggers={'openchannel':require(_0xbc9d('0x2'))(_0xbc9d('0x3')),'mail':require(_0xbc9d('0x2'))('mail-interactions'),'fax':require('../../config/logger')(_0xbc9d('0x4')),'sms':require(_0xbc9d('0x2'))('sms-interactions'),'chat':require(_0xbc9d('0x2'))(_0xbc9d('0x5')),'whatsapp':require(_0xbc9d('0x2'))(_0xbc9d('0x6'))};function getInteractionId(_0x26a2fd,_0x194694,_0xe56e02){if(_0x26a2fd&&_0x26a2fd[_[_0xbc9d('0x7')](_0xe56e02)+_0xbc9d('0x8')]){return _0x26a2fd[_[_0xbc9d('0x7')](_0xe56e02)+'InteractionId'];}else if(_0x26a2fd&&_0x26a2fd['id']){return _0x26a2fd['id'];}else if(_0x194694&&_0x194694['id']){return _0x194694['id'];}else{return'unknown';}}function log(_0x32eaf8,_0x2ba492,_0x25bf52,_0x29af82,_0x211efc,_0x3e49d6){loggers[_0x211efc['toLowerCase']()][_0x32eaf8]('[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x3e49d6[_0xbc9d('0x9')](),_0x2ba492?_0x2ba492['id']:null,_0x2ba492?_0x2ba492[_0xbc9d('0xa')]:null,_0x2ba492?_0x2ba492[_0xbc9d('0xb')]:null,getInteractionId(_0x25bf52,_0x29af82,_0x211efc),_0x25bf52?JSON[_0xbc9d('0xc')](_0x25bf52):'null');}function updateUser(_0x23eb2d,_0x5e76d5,_0x1cf238,_0x23188b,_0x387125){db[_[_0xbc9d('0x7')](_0x23188b)+'Interaction'][_0xbc9d('0xd')]({'where':{'id':getInteractionId(_0x5e76d5,_0x1cf238,_0x23188b)}})[_0xbc9d('0xe')](function(_0x58699f){if(_0x58699f){return _0x58699f[_0xbc9d('0xf')]({'UserId':_0x23eb2d?_0x23eb2d['id']:null});}})[_0xbc9d('0xe')](function(_0xe65f0f){if(_0xe65f0f){log(_0xbc9d('0x10'),_0x23eb2d,_0x5e76d5,_0x1cf238,_0x23188b,_0x387125);}})[_0xbc9d('0x11')](function(){log('error',_0x23eb2d,_0x5e76d5,_0x1cf238,_0x23188b,_0x387125);});}exports[_0xbc9d('0x12')]=function(_0x44dbad,_0x53472b){return function(_0x450f5a,_0x3c6f60,_0x212e63){var _0x43209d=_0x450f5a[_0xbc9d('0x13')];var _0x116681={};var _0x5afe13=_0x450f5a[_0xbc9d('0x14')];if(_0x116681){_0x116681=_[_0xbc9d('0x15')](_0x450f5a[_0xbc9d('0x16')]);_0x116681=_[_0xbc9d('0x17')](_0x116681,[_0xbc9d('0x16'),_0xbc9d('0x18'),_0xbc9d('0x19'),_0xbc9d('0x1a'),_0xbc9d('0x1b')]);}updateUser(_0x43209d,_0x116681,_0x5afe13,_0x44dbad,_0x53472b);_0x212e63(null);};}; \ No newline at end of file diff --git a/server/components/license/service.js b/server/components/license/service.js index 1f312cb..1897419 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 _0xc9bf=['json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','User','admin','user','crypto','util','../../mysqldb','../../config/environment','data1','license','aes-256-ctr','format','%s:%s:%s','base64','utf8','final','parse','hasOwnProperty','use','License','findOne','then','count','status'];(function(_0xc61ea8,_0x56e451){var _0x22c845=function(_0x143785){while(--_0x143785){_0xc61ea8['push'](_0xc61ea8['shift']());}};_0x22c845(++_0x56e451);}(_0xc9bf,0x130));var _0xfc9b=function(_0x8a969d,_0x339d9f){_0x8a969d=_0x8a969d-0x0;var _0x1d8dc7=_0xc9bf[_0x8a969d];return _0x1d8dc7;};'use strict';var crypto=require(_0xfc9b('0x0'));var util=require(_0xfc9b('0x1'));var compose=require('composable-middleware');var db=require(_0xfc9b('0x2'))['db'];var config=require(_0xfc9b('0x3'));function getValueFromLicense(_0x5c1d90,_0x525179){if(_0x5c1d90&&_0x525179){if(_0x525179[_0xfc9b('0x4')]&&_0x525179['license']){var _0x3f2632=_0x525179[_0xfc9b('0x4')];var _0x32c3aa=_0x525179[_0xfc9b('0x5')];var _0x5ac23b=_0x3f2632['split']('-')[0x4];var _0x4b9787=_0x3f2632['split']('-')[0x0];var _0x4835de=crypto['createDecipher'](_0xfc9b('0x6'),util[_0xfc9b('0x7')](_0xfc9b('0x8'),_0x5ac23b,_0x3f2632,_0x4b9787));var _0x2674c1=_0x4835de['update'](_0x32c3aa,_0xfc9b('0x9'),_0xfc9b('0xa'));_0x2674c1+=_0x4835de[_0xfc9b('0xb')](_0xfc9b('0xa'));var _0x1d3c1d=JSON[_0xfc9b('0xc')](_0x2674c1);return _0x1d3c1d[_0xfc9b('0xd')](_0x5c1d90)?_0x1d3c1d[_0x5c1d90]:null;}}return null;}function isLimit(_0x30b076,_0x5b4222,_0x3b96dd,_0x430d5e){var _0xe6765b=_0x5b4222;return compose()[_0xfc9b('0xe')](function(_0x383303,_0x620661,_0x31b1fe){return db[_0xfc9b('0xf')][_0xfc9b('0x10')]({'where':{'id':0x1},'raw':!![]})[_0xfc9b('0x11')](function(_0x7a4448){var _0x3e4f3a=getValueFromLicense(_0x30b076,_0x7a4448);return _0x3e4f3a?_0x3e4f3a:_0xe6765b;})['then'](function(_0x5e6181){_0xe6765b=_0x5e6181;return _0x3b96dd[_0xfc9b('0x12')](_0x430d5e);})['then'](function(_0x463c44){if(_0x463c44>=_0xe6765b){return _0x620661[_0xfc9b('0x13')](0x193)[_0xfc9b('0x14')]({'message':util['format'](_0xfc9b('0x15'),_0x30b076)});}_0x31b1fe();})[_0xfc9b('0x16')](function(_0x3fd362){_0x31b1fe(_0x3fd362);});});}function isUserLimit(){return isLimit(_0xfc9b('0x17'),0x1,db[_0xfc9b('0x18')],{'where':{'$or':[{'role':_0xfc9b('0x19')},{'role':_0xfc9b('0x1a')}]}});}exports['isUserLimit']=isUserLimit; \ No newline at end of file +var _0xd898=['Maximum\x20%s\x20limit\x20have\x20been\x20reached','users','User','admin','user','isUserLimit','crypto','composable-middleware','../../mysqldb','../../config/environment','license','split','createDecipher','aes-256-ctr','format','%s:%s:%s','utf8','final','hasOwnProperty','use','License','then','status','json'];(function(_0x43daa3,_0x26ed67){var _0x270aab=function(_0x5883c0){while(--_0x5883c0){_0x43daa3['push'](_0x43daa3['shift']());}};_0x270aab(++_0x26ed67);}(_0xd898,0x156));var _0x8d89=function(_0x50beae,_0x2cbe74){_0x50beae=_0x50beae-0x0;var _0x4be40c=_0xd898[_0x50beae];return _0x4be40c;};'use strict';var crypto=require(_0x8d89('0x0'));var util=require('util');var compose=require(_0x8d89('0x1'));var db=require(_0x8d89('0x2'))['db'];var config=require(_0x8d89('0x3'));function getValueFromLicense(_0x26153b,_0x290b7c){if(_0x26153b&&_0x290b7c){if(_0x290b7c['data1']&&_0x290b7c[_0x8d89('0x4')]){var _0x53017e=_0x290b7c['data1'];var _0x5144b9=_0x290b7c[_0x8d89('0x4')];var _0x1980d3=_0x53017e[_0x8d89('0x5')]('-')[0x4];var _0x4c4b78=_0x53017e['split']('-')[0x0];var _0xc1821f=crypto[_0x8d89('0x6')](_0x8d89('0x7'),util[_0x8d89('0x8')](_0x8d89('0x9'),_0x1980d3,_0x53017e,_0x4c4b78));var _0x3e6fbf=_0xc1821f['update'](_0x5144b9,'base64',_0x8d89('0xa'));_0x3e6fbf+=_0xc1821f[_0x8d89('0xb')]('utf8');var _0x5d0fe0=JSON['parse'](_0x3e6fbf);return _0x5d0fe0[_0x8d89('0xc')](_0x26153b)?_0x5d0fe0[_0x26153b]:null;}}return null;}function isLimit(_0x217781,_0x1de27a,_0x373199,_0x1c45e2){var _0x4deec1=_0x1de27a;return compose()[_0x8d89('0xd')](function(_0x3c7831,_0x9e8f8b,_0x15f5e0){return db[_0x8d89('0xe')]['findOne']({'where':{'id':0x1},'raw':!![]})[_0x8d89('0xf')](function(_0x2c5f7a){var _0x2fdadd=getValueFromLicense(_0x217781,_0x2c5f7a);return _0x2fdadd?_0x2fdadd:_0x4deec1;})['then'](function(_0x3fb9a9){_0x4deec1=_0x3fb9a9;return _0x373199['count'](_0x1c45e2);})[_0x8d89('0xf')](function(_0x59bfba){if(_0x59bfba>=_0x4deec1){return _0x9e8f8b[_0x8d89('0x10')](0x193)[_0x8d89('0x11')]({'message':util['format'](_0x8d89('0x12'),_0x217781)});}_0x15f5e0();})['catch'](function(_0x28efec){_0x15f5e0(_0x28efec);});});}function isUserLimit(){return isLimit(_0x8d89('0x13'),0x1,db[_0x8d89('0x14')],{'where':{'$or':[{'role':_0x8d89('0x15')},{'role':_0x8d89('0x16')}]}});}exports[_0x8d89('0x17')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index f2d6e3b..bb18679 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 _0xd548=['format','YYYY-MM-DD','castTo','text','CAST(','field','\x20AS\x20','$ne','\x20OR\x20','\x20IS\x20NULL)','$in','IN\x20?','$eq','=\x20?','<>\x20?','$substring','$endsWith','$lt','<\x20?','>\x20?','$lte','<=\x20?','>=\x20?','BETWEEN\x20?\x20AND\x20?','$notIn','start','$startsWith','pop','DATE','utcOffset','hours','seconds','moment','sqlOperator','[$or]','and','[$and]','replace','split','slice','forEach','shift','match','filter','indexOf','map','conditions','push','buildExpression','operator','$between','value','includes','$gt','add'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xd548,0x133));var _0x8d54=function(_0x57e1fb,_0x80bc3d){_0x57e1fb=_0x57e1fb-0x0;var _0x320c25=_0xd548[_0x57e1fb];return _0x320c25;};'use strict';var _=require('lodash');var moment=require(_0x8d54('0x0'));exports['parseSearch']=function(_0x4b6417){var _0x135b43={'conditions':[]};_0x135b43[_0x8d54('0x1')]=_['startsWith'](_0x4b6417,_0x8d54('0x2'))?'or':_0x8d54('0x3');var _0x153044=_0x4b6417['replace'](_0x8d54('0x4'),'')[_0x8d54('0x5')]('[$or]','')[_0x8d54('0x6')]('||');for(var _0x115e12=0x0;_0x115e12<_0x153044['length'];_0x115e12++){var _0xdbb12c=_0x153044[_0x115e12]['split'](':=');var _0x4f9395=_0xdbb12c[0x0];var _0x48a5dc=_0xdbb12c[_0x8d54('0x7')](0x1);_0x48a5dc[_0x8d54('0x8')](function(_0x3dbb69){var _0x522eb0=_0x3dbb69[_0x8d54('0x6')]('[')[_0x8d54('0x9')]();var _0x69a94=_0x3dbb69[_0x8d54('0xa')](/\[(.*?)\]/g);_0x69a94[_0x8d54('0x8')](function(_0x488dc7){var _0x5a0f64=_0x488dc7[_0x8d54('0x6')]('[')[_0x8d54('0xb')](function(_0x593fbc){return _0x593fbc[_0x8d54('0xc')](']')>-0x1;})[_0x8d54('0xd')](function(_0x4fe042){return _0x4fe042[_0x8d54('0x6')](']')[0x0];})[0x0];_0x135b43[_0x8d54('0xe')][_0x8d54('0xf')]({'field':_0x4f9395,'operator':_0x522eb0,'value':_0x5a0f64});});});}return _0x135b43;};exports[_0x8d54('0x10')]=function(_0x2a92c5,_0x43caba,_0x1d9408){var _0x3c35c4={};if(_0x43caba==='DATE'){if(_0x1d9408[_0x8d54('0x11')]==='$eq'){_0x1d9408[_0x8d54('0x11')]=_0x8d54('0x12');_0x1d9408['value']+=','+_0x1d9408[_0x8d54('0x13')];}else if(_[_0x8d54('0x14')]([_0x8d54('0x15'),'$lte'],_0x1d9408[_0x8d54('0x11')])){_0x1d9408[_0x8d54('0x13')]=moment(_0x1d9408[_0x8d54('0x13')])[_0x8d54('0x16')](0x1,'days')[_0x8d54('0x17')](_0x8d54('0x18'));}}if(_0x1d9408[_0x8d54('0x19')]){_0x43caba=_0x1d9408[_0x8d54('0x19')];_0x3c35c4[_0x8d54('0x1a')]=_0x8d54('0x1b')+_0x2a92c5+'.'+_0x1d9408[_0x8d54('0x1c')]+_0x8d54('0x1d')+_0x1d9408[_0x8d54('0x19')]+')\x20'+parseOperator(_0x1d9408[_0x8d54('0x11')]);}else{_0x3c35c4[_0x8d54('0x1a')]=_0x2a92c5+'.'+_0x1d9408[_0x8d54('0x1c')]+'\x20'+parseOperator(_0x1d9408['operator']);}if(_[_0x8d54('0x14')]([_0x8d54('0x1e'),'$notIn'],_0x1d9408[_0x8d54('0x11')]))_0x3c35c4[_0x8d54('0x1a')]='('+_0x3c35c4['text']+_0x8d54('0x1f')+_0x2a92c5+'.'+_0x1d9408['field']+_0x8d54('0x20');_0x3c35c4['value']=parseValue(_0x43caba,_0x1d9408[_0x8d54('0x11')],_0x1d9408[_0x8d54('0x13')]);return _0x3c35c4;};function parseOperator(_0x13a4f9){var _0x44864b;switch(_0x13a4f9){case _0x8d54('0x21'):_0x44864b=_0x8d54('0x22');break;case'$notIn':_0x44864b='NOT\x20IN\x20?';break;case _0x8d54('0x23'):_0x44864b=_0x8d54('0x24');break;case _0x8d54('0x1e'):_0x44864b=_0x8d54('0x25');break;case _0x8d54('0x26'):case'$startsWith':case _0x8d54('0x27'):_0x44864b='LIKE\x20?';break;case _0x8d54('0x28'):_0x44864b=_0x8d54('0x29');break;case'$gt':_0x44864b=_0x8d54('0x2a');break;case _0x8d54('0x2b'):_0x44864b=_0x8d54('0x2c');break;case'$gte':_0x44864b=_0x8d54('0x2d');break;case'$between':_0x44864b=_0x8d54('0x2e');break;}return _0x44864b;}function parseValue(_0x20ff11,_0x35e7aa,_0x20f7a4){var _0xffc1c4={'start':undefined,'end':undefined};switch(_0x35e7aa){case _0x8d54('0x21'):case _0x8d54('0x2f'):_0xffc1c4[_0x8d54('0x30')]=_0x20f7a4[_0x8d54('0x6')](',');break;case _0x8d54('0x26'):_0xffc1c4[_0x8d54('0x30')]='%'+_0x20f7a4+'%';break;case _0x8d54('0x31'):_0xffc1c4[_0x8d54('0x30')]=_0x20f7a4+'%';break;case _0x8d54('0x27'):_0xffc1c4[_0x8d54('0x30')]='%'+_0x20f7a4;break;case _0x8d54('0x12'):var _0x5278b9=_0x20f7a4[_0x8d54('0x6')](',');var _0x20f7a4=_0x5278b9[_0x8d54('0x9')]();var _0x3283f9=_0x5278b9[_0x8d54('0x32')]();if(_0x20ff11===_0x8d54('0x33')){_0x20f7a4=moment(_0x20f7a4)[_0x8d54('0x34')](0x0,!![])[_0x8d54('0x17')]();_0x3283f9=moment(_0x3283f9)[_0x8d54('0x34')](0x0,!![])[_0x8d54('0x16')](0x17,_0x8d54('0x35'))[_0x8d54('0x16')](0x3b,'minutes')[_0x8d54('0x16')](0x3b,_0x8d54('0x36'))[_0x8d54('0x17')]();}_0xffc1c4={'start':_0x20f7a4,'end':_0x3283f9};break;default:_0xffc1c4['start']=_0x20f7a4;break;}return _0xffc1c4;} \ No newline at end of file +var _0x0784=['<\x20?','>\x20?','<=\x20?','$gte','BETWEEN\x20?\x20AND\x20?','start','$substring','$startsWith','pop','utcOffset','format','minutes','moment','sqlOperator','replace','[$and]','[$or]','split','length','forEach','shift','match','map','push','buildExpression','$eq','includes','$lte','operator','value','add','days','YYYY-MM-DD','castTo','text','CAST(','\x20AS\x20','field','$ne','\x20OR\x20','\x20IS\x20NULL)','$in','IN\x20?','$notIn','NOT\x20IN\x20?','=\x20?','<>\x20?','$endsWith','LIKE\x20?','$lt'];(function(_0x26da2a,_0x231bea){var _0x25c662=function(_0x5bccbe){while(--_0x5bccbe){_0x26da2a['push'](_0x26da2a['shift']());}};_0x25c662(++_0x231bea);}(_0x0784,0xa2));var _0x4078=function(_0x4bf104,_0x459389){_0x4bf104=_0x4bf104-0x0;var _0x4c971c=_0x0784[_0x4bf104];return _0x4c971c;};'use strict';var _=require('lodash');var moment=require(_0x4078('0x0'));exports['parseSearch']=function(_0x12e57c){var _0xa9d671={'conditions':[]};_0xa9d671[_0x4078('0x1')]=_['startsWith'](_0x12e57c,'[$or]')?'or':'and';var _0x182cfc=_0x12e57c[_0x4078('0x2')](_0x4078('0x3'),'')[_0x4078('0x2')](_0x4078('0x4'),'')[_0x4078('0x5')]('||');for(var _0x1010bc=0x0;_0x1010bc<_0x182cfc[_0x4078('0x6')];_0x1010bc++){var _0x4ca4d4=_0x182cfc[_0x1010bc][_0x4078('0x5')](':=');var _0x4bb4bb=_0x4ca4d4[0x0];var _0x33c1b1=_0x4ca4d4['slice'](0x1);_0x33c1b1[_0x4078('0x7')](function(_0x1a161a){var _0x2a402c=_0x1a161a[_0x4078('0x5')]('[')[_0x4078('0x8')]();var _0x2f27c8=_0x1a161a[_0x4078('0x9')](/\[(.*?)\]/g);_0x2f27c8[_0x4078('0x7')](function(_0x463e5e){var _0x478711=_0x463e5e['split']('[')['filter'](function(_0x5e6c68){return _0x5e6c68['indexOf'](']')>-0x1;})[_0x4078('0xa')](function(_0x35185b){return _0x35185b[_0x4078('0x5')](']')[0x0];})[0x0];_0xa9d671['conditions'][_0x4078('0xb')]({'field':_0x4bb4bb,'operator':_0x2a402c,'value':_0x478711});});});}return _0xa9d671;};exports[_0x4078('0xc')]=function(_0x2ff75e,_0x5bf1f5,_0x4e07a3){var _0x182596={};if(_0x5bf1f5==='DATE'){if(_0x4e07a3['operator']===_0x4078('0xd')){_0x4e07a3['operator']='$between';_0x4e07a3['value']+=','+_0x4e07a3['value'];}else if(_[_0x4078('0xe')](['$gt',_0x4078('0xf')],_0x4e07a3[_0x4078('0x10')])){_0x4e07a3['value']=moment(_0x4e07a3[_0x4078('0x11')])[_0x4078('0x12')](0x1,_0x4078('0x13'))['format'](_0x4078('0x14'));}}if(_0x4e07a3[_0x4078('0x15')]){_0x5bf1f5=_0x4e07a3[_0x4078('0x15')];_0x182596[_0x4078('0x16')]=_0x4078('0x17')+_0x2ff75e+'.'+_0x4e07a3['field']+_0x4078('0x18')+_0x4e07a3[_0x4078('0x15')]+')\x20'+parseOperator(_0x4e07a3[_0x4078('0x10')]);}else{_0x182596[_0x4078('0x16')]=_0x2ff75e+'.'+_0x4e07a3[_0x4078('0x19')]+'\x20'+parseOperator(_0x4e07a3[_0x4078('0x10')]);}if(_[_0x4078('0xe')]([_0x4078('0x1a'),'$notIn'],_0x4e07a3[_0x4078('0x10')]))_0x182596[_0x4078('0x16')]='('+_0x182596[_0x4078('0x16')]+_0x4078('0x1b')+_0x2ff75e+'.'+_0x4e07a3[_0x4078('0x19')]+_0x4078('0x1c');_0x182596[_0x4078('0x11')]=parseValue(_0x5bf1f5,_0x4e07a3['operator'],_0x4e07a3[_0x4078('0x11')]);return _0x182596;};function parseOperator(_0x210664){var _0x1fb3e9;switch(_0x210664){case _0x4078('0x1d'):_0x1fb3e9=_0x4078('0x1e');break;case _0x4078('0x1f'):_0x1fb3e9=_0x4078('0x20');break;case _0x4078('0xd'):_0x1fb3e9=_0x4078('0x21');break;case _0x4078('0x1a'):_0x1fb3e9=_0x4078('0x22');break;case'$substring':case'$startsWith':case _0x4078('0x23'):_0x1fb3e9=_0x4078('0x24');break;case _0x4078('0x25'):_0x1fb3e9=_0x4078('0x26');break;case'$gt':_0x1fb3e9=_0x4078('0x27');break;case _0x4078('0xf'):_0x1fb3e9=_0x4078('0x28');break;case _0x4078('0x29'):_0x1fb3e9='>=\x20?';break;case'$between':_0x1fb3e9=_0x4078('0x2a');break;}return _0x1fb3e9;}function parseValue(_0x11ace8,_0x436edf,_0x125fdf){var _0x42e718={'start':undefined,'end':undefined};switch(_0x436edf){case'$in':case _0x4078('0x1f'):_0x42e718[_0x4078('0x2b')]=_0x125fdf['split'](',');break;case _0x4078('0x2c'):_0x42e718[_0x4078('0x2b')]='%'+_0x125fdf+'%';break;case _0x4078('0x2d'):_0x42e718[_0x4078('0x2b')]=_0x125fdf+'%';break;case _0x4078('0x23'):_0x42e718[_0x4078('0x2b')]='%'+_0x125fdf;break;case'$between':var _0x3f5dc7=_0x125fdf['split'](',');var _0x125fdf=_0x3f5dc7['shift']();var _0x3f20fb=_0x3f5dc7[_0x4078('0x2e')]();if(_0x11ace8==='DATE'){_0x125fdf=moment(_0x125fdf)[_0x4078('0x2f')](0x0,!![])[_0x4078('0x30')]();_0x3f20fb=moment(_0x3f20fb)['utcOffset'](0x0,!![])['add'](0x17,'hours')['add'](0x3b,_0x4078('0x31'))[_0x4078('0x12')](0x3b,'seconds')[_0x4078('0x30')]();}_0x42e718={'start':_0x125fdf,'end':_0x3f20fb};break;default:_0x42e718['start']=_0x125fdf;break;}return _0x42e718;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index 3d05543..01cab89 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 _0x9f1a=['match','^[+]?[0-9]*$','isEmail','getFullTextValue','forEach','replace','push','getOptions','query','$id','model','attributes','intersection','nolimit','limit','pick','filter','merge','where','VIRTUAL','lower','options','lodash','sequelize','parse','includes','keys','fields','split','filters','isEmpty','find','type','DATE','isPlainObject','format','YYYY-MM-DD','$lte','utc','subtract','name','uniqueid','isArray','offset','sort','map','indexOf','priority','col','substr','cast','unsigned','ASC','omit','length','isObject','unset','hasOwnProperty','isNumeric'];(function(_0x444050,_0x273b8b){var _0x20a7d0=function(_0x292db3){while(--_0x292db3){_0x444050['push'](_0x444050['shift']());}};_0x20a7d0(++_0x273b8b);}(_0x9f1a,0x178));var _0xa9f1=function(_0x55ce91,_0x17698b){_0x55ce91=_0x55ce91-0x0;var _0x1fbc39=_0x9f1a[_0x55ce91];return _0x1fbc39;};'use strict';var _=require(_0xa9f1('0x0'));var sequelize=require(_0xa9f1('0x1'));var moment=require('moment');var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x1d91ee){var _0x362ae7=['ne'];try{var _0x325f29=JSON[_0xa9f1('0x2')](_0x1d91ee);var _0x2c50b6=Object['keys'](_0x325f29)[0x0];return _0x362ae7[_0xa9f1('0x3')](_0x2c50b6);}catch(_0x4568b4){return![];}}function getOperatorValue(_0x44ff6d){var _0x5c2400=JSON[_0xa9f1('0x2')](_0x44ff6d);var _0x171d39=Object[_0xa9f1('0x4')](_0x5c2400)[0x0];var _0x5949d8=_0x5c2400[_0x171d39];return{['$'+_0x171d39]:_0x5949d8};}exports[_0xa9f1('0x5')]=function(_0x8212ee){var _0x22e57d=null;if(_0x8212ee){_0x22e57d=_0x8212ee[_0xa9f1('0x6')](',');}return _0x22e57d;};exports[_0xa9f1('0x7')]=function(_0x833036,_0x1b9577){var _0x5db618={};if(!_[_0xa9f1('0x8')](_0x833036)){_['forOwn'](_0x833036,function(_0x35a06b,_0x2b9236){try{if(_0x1b9577){var _0x285df6=_[_0xa9f1('0x9')](_0x1b9577,{'name':_0x2b9236})||{};if(hasSequelizeOperator(_0x35a06b)){_0x5db618[_0x2b9236]=getOperatorValue(_0x35a06b);}else if(_0x285df6[_0xa9f1('0xa')]===_0xa9f1('0xb')&&_[_0xa9f1('0xc')](_0x35a06b)){var _0x565979=JSON[_0xa9f1('0x2')](_0x35a06b);var _0x1c4bc3={'$gte':moment(moment(_0x565979['$gte'])[_0xa9f1('0xd')](_0xa9f1('0xe')))['utc']()[_0xa9f1('0xd')](),'$lte':moment(moment(_0x565979[_0xa9f1('0xf')])[_0xa9f1('0xd')](_0xa9f1('0xe')))[_0xa9f1('0x10')]()[_0xa9f1('0x11')](0x1,'s')[_0xa9f1('0xd')]()};_0x5db618[_0x2b9236]=_0x1c4bc3;}else if(_0x285df6[_0xa9f1('0x12')]===_0xa9f1('0x13')){_0x5db618[_0x2b9236]=_0x35a06b;}else{_0x5db618[_0x2b9236]=_[_0xa9f1('0x14')](_0x35a06b)?_0x35a06b:JSON[_0xa9f1('0x2')](_0x35a06b);}}else{_0x5db618[_0x2b9236]=_[_0xa9f1('0x14')](_0x35a06b)?_0x35a06b:JSON['parse'](_0x35a06b);}}catch(_0x1fa5ea){_0x5db618[_0x2b9236]=_0x35a06b['split'](',');}});}return _0x5db618;};exports['limit']=function(_0x584c36){_0x584c36=parseInt(_0x584c36,0xa);if(!_0x584c36||_0x584c36<0x0){_0x584c36=LIMIT_VALUE;}return _0x584c36;};exports[_0xa9f1('0x15')]=function(_0x2d63d1){_0x2d63d1=parseInt(_0x2d63d1,0xa);if(!_0x2d63d1||_0x2d63d1<0x0){_0x2d63d1=0x0;}return _0x2d63d1;};exports[_0xa9f1('0x16')]=function(_0x64436a){var _0x551fb8,_0xfcadd=null;if(_0x64436a){_0x551fb8=_0x64436a[_0xa9f1('0x6')](',');_0xfcadd=_[_0xa9f1('0x17')](_0x551fb8,function(_0x4732d5){if(_0x4732d5[_0xa9f1('0x18')]('-')===0x0){return[_0x4732d5===_0xa9f1('0x19')?sequelize['cast'](sequelize[_0xa9f1('0x1a')]('priority'),'unsigned'):_0x4732d5[_0xa9f1('0x1b')](0x1),'DESC'];}else{return[_0x4732d5==='priority'?sequelize[_0xa9f1('0x1c')](sequelize[_0xa9f1('0x1a')](_0xa9f1('0x19')),_0xa9f1('0x1d')):_0x4732d5,_0xa9f1('0x1e')];}});}return _0xfcadd;};exports[_0xa9f1('0x1f')]=function(_0x1b39a0,_0x576354){if(_['isEmpty'](_0x1b39a0)){return _0x1b39a0;}if(_[_0xa9f1('0x14')](_0x1b39a0)){for(var _0x554d70=0x0;_0x554d70<_0x1b39a0[_0xa9f1('0x20')];_0x554d70+=0x1){_0x1b39a0[_0x554d70]=this[_0xa9f1('0x1f')](_0x1b39a0[_0x554d70],_0x576354);}return _0x1b39a0;}if(!_[_0xa9f1('0x21')](_0x1b39a0)){return _0x1b39a0;}if(_['isString'](_0x576354)){_0x576354=[_0x576354];}if(!_[_0xa9f1('0x14')](_0x576354)){return _0x1b39a0;}for(var _0x5c0493=0x0;_0x5c0493<_0x576354[_0xa9f1('0x20')];_0x5c0493+=0x1){_[_0xa9f1('0x22')](_0x1b39a0,_0x576354[_0x5c0493]);}for(var _0x55f867 in _0x1b39a0){if(_0x1b39a0[_0xa9f1('0x23')](_0x55f867)){_0x1b39a0[_0x55f867]=this[_0xa9f1('0x1f')](_0x1b39a0[_0x55f867],_0x576354);}}return _0x1b39a0;};exports[_0xa9f1('0x24')]=function(_0x554fe8){return _0x554fe8[_0xa9f1('0x25')](RegExp(_0xa9f1('0x26')))?!![]:![];};exports[_0xa9f1('0x27')]=function(_0x24a519){return _0x24a519['match'](/^\S+@\S+$/)?!![]:![];};exports[_0xa9f1('0x28')]=function(_0x4a31d3){var _0x5bb000=[];_0x4a31d3[_0xa9f1('0x6')](/[ ,]+/)[_0xa9f1('0x29')](function(_0x29b974){_0x29b974=_0x29b974[_0xa9f1('0x2a')](/([^:]")"+/g,'$1');_0x29b974='+'+_0x29b974+'*';if(_0x29b974['includes']('@'))_0x29b974='\x22'+_0x29b974+'\x22';_0x5bb000[_0xa9f1('0x2b')](_0x29b974);});return _0x5bb000['join']('\x20');};exports[_0xa9f1('0x2c')]=function(_0x2d6610,_0x48d33f,_0x35323f){var _0x25aa18={},_0x145287={};if(_0x48d33f[_0xa9f1('0x2d')][_0xa9f1('0x2e')]){_0x48d33f[_0xa9f1('0x2d')]['id']=_0x48d33f['query'][_0xa9f1('0x2e')];delete _0x48d33f[_0xa9f1('0x2d')][_0xa9f1('0x2e')];}_0x25aa18[_0xa9f1('0x2f')]=_[_0xa9f1('0x17')](_0x2d6610,_0xa9f1('0x12'));_0x25aa18[_0xa9f1('0x2d')]=_[_0xa9f1('0x4')](_0x48d33f[_0xa9f1('0x2d')]);_0x25aa18[_0xa9f1('0x7')]=_['intersection'](_0x25aa18[_0xa9f1('0x2f')],_0x25aa18[_0xa9f1('0x2d')]);_0x145287[_0xa9f1('0x30')]=_[_0xa9f1('0x31')](_0x25aa18[_0xa9f1('0x2f')],this[_0xa9f1('0x5')](_0x48d33f[_0xa9f1('0x2d')][_0xa9f1('0x5')]));_0x145287[_0xa9f1('0x30')]=_0x145287[_0xa9f1('0x30')][_0xa9f1('0x20')]?_0x145287['attributes']:_0x25aa18[_0xa9f1('0x2f')];if(!_0x48d33f[_0xa9f1('0x2d')][_0xa9f1('0x23')](_0xa9f1('0x32'))){_0x145287[_0xa9f1('0x33')]=this[_0xa9f1('0x33')](_0x48d33f[_0xa9f1('0x2d')][_0xa9f1('0x33')]);_0x145287['offset']=this['offset'](_0x48d33f['query']['offset']);}_0x145287['order']=this[_0xa9f1('0x16')](_0x48d33f['query'][_0xa9f1('0x16')]);_0x145287['where']=this['filters'](_[_0xa9f1('0x34')](_0x48d33f[_0xa9f1('0x2d')],_0x25aa18[_0xa9f1('0x7')]),_0x2d6610);if(_0x48d33f['query'][_0xa9f1('0x35')]){_0x145287['where']=_[_0xa9f1('0x36')](_0x145287[_0xa9f1('0x37')],{'$or':_['map'](_0x2d6610,function(_0x3878fa){if(_0x3878fa[_0xa9f1('0xa')]!==_0xa9f1('0x38')){if(_0x35323f){return sequelize['where'](sequelize['fn'](_0xa9f1('0x39'),sequelize[_0xa9f1('0x1a')](_0x3878fa[_0xa9f1('0x12')])),{'$like':sequelize['fn']('lower','%'+_0x48d33f[_0xa9f1('0x2d')]['filter']+'%')});}else{var _0x31c531={};_0x31c531[_0x3878fa[_0xa9f1('0x12')]]={'$like':'%'+_0x48d33f['query'][_0xa9f1('0x35')]+'%'};return _0x31c531;}}})});}_0x145287=_[_0xa9f1('0x36')]({},_0x145287,_0x48d33f[_0xa9f1('0x3a')]);return _0x145287;}; \ No newline at end of file +var _0x851c=['sort','where','pick','filter','merge','VIRTUAL','sequelize','moment','parse','keys','includes','fields','split','filters','isEmpty','forOwn','DATE','isPlainObject','YYYY-MM-DD','utc','format','$lte','subtract','name','uniqueid','isArray','limit','map','indexOf','cast','col','priority','unsigned','DESC','ASC','omit','unset','hasOwnProperty','isNumeric','match','^[+]?[0-9]*$','isEmail','forEach','replace','query','$id','model','intersection','attributes','length','nolimit','offset','order'];(function(_0x4cef94,_0x3db7e2){var _0x5ecb8a=function(_0x2e255d){while(--_0x2e255d){_0x4cef94['push'](_0x4cef94['shift']());}};_0x5ecb8a(++_0x3db7e2);}(_0x851c,0xa5));var _0xc851=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x851c[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var sequelize=require(_0xc851('0x0'));var moment=require(_0xc851('0x1'));var LIMIT_VALUE=0xfa;function hasSequelizeOperator(_0x16365d){var _0x39f4d4=['ne'];try{var _0x393b44=JSON[_0xc851('0x2')](_0x16365d);var _0x4fb5ab=Object[_0xc851('0x3')](_0x393b44)[0x0];return _0x39f4d4[_0xc851('0x4')](_0x4fb5ab);}catch(_0xac8e1d){return![];}}function getOperatorValue(_0x290234){var _0x8800a9=JSON[_0xc851('0x2')](_0x290234);var _0x4251bb=Object['keys'](_0x8800a9)[0x0];var _0x2720ac=_0x8800a9[_0x4251bb];return{['$'+_0x4251bb]:_0x2720ac};}exports[_0xc851('0x5')]=function(_0x1b43b4){var _0x4c3a52=null;if(_0x1b43b4){_0x4c3a52=_0x1b43b4[_0xc851('0x6')](',');}return _0x4c3a52;};exports[_0xc851('0x7')]=function(_0x3e671c,_0x472ab0){var _0x43a6e5={};if(!_[_0xc851('0x8')](_0x3e671c)){_[_0xc851('0x9')](_0x3e671c,function(_0x4f1f8b,_0x3260a7){try{if(_0x472ab0){var _0x172b0e=_['find'](_0x472ab0,{'name':_0x3260a7})||{};if(hasSequelizeOperator(_0x4f1f8b)){_0x43a6e5[_0x3260a7]=getOperatorValue(_0x4f1f8b);}else if(_0x172b0e['type']===_0xc851('0xa')&&_[_0xc851('0xb')](_0x4f1f8b)){var _0x24b3e3=JSON[_0xc851('0x2')](_0x4f1f8b);var _0x30655d={'$gte':moment(moment(_0x24b3e3['$gte'])['format'](_0xc851('0xc')))[_0xc851('0xd')]()[_0xc851('0xe')](),'$lte':moment(moment(_0x24b3e3[_0xc851('0xf')])[_0xc851('0xe')](_0xc851('0xc')))[_0xc851('0xd')]()[_0xc851('0x10')](0x1,'s')['format']()};_0x43a6e5[_0x3260a7]=_0x30655d;}else if(_0x172b0e[_0xc851('0x11')]===_0xc851('0x12')){_0x43a6e5[_0x3260a7]=_0x4f1f8b;}else{_0x43a6e5[_0x3260a7]=_[_0xc851('0x13')](_0x4f1f8b)?_0x4f1f8b:JSON[_0xc851('0x2')](_0x4f1f8b);}}else{_0x43a6e5[_0x3260a7]=_[_0xc851('0x13')](_0x4f1f8b)?_0x4f1f8b:JSON[_0xc851('0x2')](_0x4f1f8b);}}catch(_0x3c89e5){_0x43a6e5[_0x3260a7]=_0x4f1f8b[_0xc851('0x6')](',');}});}return _0x43a6e5;};exports[_0xc851('0x14')]=function(_0x34e3ee){_0x34e3ee=parseInt(_0x34e3ee,0xa);if(!_0x34e3ee||_0x34e3ee<0x0){_0x34e3ee=LIMIT_VALUE;}return _0x34e3ee;};exports['offset']=function(_0x54c65a){_0x54c65a=parseInt(_0x54c65a,0xa);if(!_0x54c65a||_0x54c65a<0x0){_0x54c65a=0x0;}return _0x54c65a;};exports['sort']=function(_0x43ab3a){var _0x210bb1,_0x11d8aa=null;if(_0x43ab3a){_0x210bb1=_0x43ab3a[_0xc851('0x6')](',');_0x11d8aa=_[_0xc851('0x15')](_0x210bb1,function(_0x31af9a){if(_0x31af9a[_0xc851('0x16')]('-')===0x0){return[_0x31af9a==='priority'?sequelize[_0xc851('0x17')](sequelize[_0xc851('0x18')](_0xc851('0x19')),_0xc851('0x1a')):_0x31af9a['substr'](0x1),_0xc851('0x1b')];}else{return[_0x31af9a===_0xc851('0x19')?sequelize['cast'](sequelize[_0xc851('0x18')](_0xc851('0x19')),_0xc851('0x1a')):_0x31af9a,_0xc851('0x1c')];}});}return _0x11d8aa;};exports['omit']=function(_0x476265,_0x3f2f9f){if(_['isEmpty'](_0x476265)){return _0x476265;}if(_[_0xc851('0x13')](_0x476265)){for(var _0x2ea1d2=0x0;_0x2ea1d2<_0x476265['length'];_0x2ea1d2+=0x1){_0x476265[_0x2ea1d2]=this[_0xc851('0x1d')](_0x476265[_0x2ea1d2],_0x3f2f9f);}return _0x476265;}if(!_['isObject'](_0x476265)){return _0x476265;}if(_['isString'](_0x3f2f9f)){_0x3f2f9f=[_0x3f2f9f];}if(!_['isArray'](_0x3f2f9f)){return _0x476265;}for(var _0x8e8fcc=0x0;_0x8e8fcc<_0x3f2f9f['length'];_0x8e8fcc+=0x1){_[_0xc851('0x1e')](_0x476265,_0x3f2f9f[_0x8e8fcc]);}for(var _0x1328c3 in _0x476265){if(_0x476265[_0xc851('0x1f')](_0x1328c3)){_0x476265[_0x1328c3]=this[_0xc851('0x1d')](_0x476265[_0x1328c3],_0x3f2f9f);}}return _0x476265;};exports[_0xc851('0x20')]=function(_0x26a566){return _0x26a566[_0xc851('0x21')](RegExp(_0xc851('0x22')))?!![]:![];};exports[_0xc851('0x23')]=function(_0xbb4c7d){return _0xbb4c7d[_0xc851('0x21')](/^\S+@\S+$/)?!![]:![];};exports['getFullTextValue']=function(_0x51ae51){var _0x5d7741=[];_0x51ae51[_0xc851('0x6')](/[ ,]+/)[_0xc851('0x24')](function(_0x3054ae){_0x3054ae=_0x3054ae[_0xc851('0x25')](/([^:]")"+/g,'$1');_0x3054ae='+'+_0x3054ae+'*';if(_0x3054ae[_0xc851('0x4')]('@'))_0x3054ae='\x22'+_0x3054ae+'\x22';_0x5d7741['push'](_0x3054ae);});return _0x5d7741['join']('\x20');};exports['getOptions']=function(_0x472b67,_0x49327d,_0xe4442e){var _0x488d0d={},_0x269109={};if(_0x49327d[_0xc851('0x26')][_0xc851('0x27')]){_0x49327d[_0xc851('0x26')]['id']=_0x49327d[_0xc851('0x26')]['$id'];delete _0x49327d[_0xc851('0x26')]['$id'];}_0x488d0d['model']=_[_0xc851('0x15')](_0x472b67,_0xc851('0x11'));_0x488d0d[_0xc851('0x26')]=_[_0xc851('0x3')](_0x49327d[_0xc851('0x26')]);_0x488d0d['filters']=_['intersection'](_0x488d0d[_0xc851('0x28')],_0x488d0d[_0xc851('0x26')]);_0x269109['attributes']=_[_0xc851('0x29')](_0x488d0d[_0xc851('0x28')],this['fields'](_0x49327d[_0xc851('0x26')][_0xc851('0x5')]));_0x269109[_0xc851('0x2a')]=_0x269109['attributes'][_0xc851('0x2b')]?_0x269109[_0xc851('0x2a')]:_0x488d0d['model'];if(!_0x49327d[_0xc851('0x26')]['hasOwnProperty'](_0xc851('0x2c'))){_0x269109['limit']=this[_0xc851('0x14')](_0x49327d[_0xc851('0x26')][_0xc851('0x14')]);_0x269109[_0xc851('0x2d')]=this['offset'](_0x49327d[_0xc851('0x26')][_0xc851('0x2d')]);}_0x269109[_0xc851('0x2e')]=this[_0xc851('0x2f')](_0x49327d['query']['sort']);_0x269109[_0xc851('0x30')]=this[_0xc851('0x7')](_[_0xc851('0x31')](_0x49327d['query'],_0x488d0d['filters']),_0x472b67);if(_0x49327d[_0xc851('0x26')][_0xc851('0x32')]){_0x269109[_0xc851('0x30')]=_[_0xc851('0x33')](_0x269109['where'],{'$or':_[_0xc851('0x15')](_0x472b67,function(_0x544810){if(_0x544810['type']!==_0xc851('0x34')){if(_0xe4442e){return sequelize['where'](sequelize['fn']('lower',sequelize['col'](_0x544810[_0xc851('0x11')])),{'$like':sequelize['fn']('lower','%'+_0x49327d['query'][_0xc851('0x32')]+'%')});}else{var _0xfb1baf={};_0xfb1baf[_0x544810[_0xc851('0x11')]]={'$like':'%'+_0x49327d['query'][_0xc851('0x32')]+'%'};return _0xfb1baf;}}})});}_0x269109=_[_0xc851('0x33')]({},_0x269109,_0x49327d['options']);return _0x269109;}; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index 8553803..74c578b 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xba4d=['use','set','toISOString','split','static','views','/server/views','engine','html','ejs','renderFile','urlencoded','json','50mb','initialize','express','serve-favicon','body-parser','method-override','errorhandler','path','passport','cors','moment','./environment','../mysqldb','default','get','env','production','join','root','public','development','appPath','client'];(function(_0x2673d7,_0x2761d3){var _0x10d4ea=function(_0x3777a7){while(--_0x3777a7){_0x2673d7['push'](_0x2673d7['shift']());}};_0x10d4ea(++_0x2761d3);}(_0xba4d,0xc3));var _0xdba4=function(_0x38c699,_0x56fea7){_0x38c699=_0x38c699-0x0;var _0x3b1ded=_0xba4d[_0x38c699];return _0x3b1ded;};'use strict';var express=require(_0xdba4('0x0'));var favicon=require(_0xdba4('0x1'));var bodyParser=require(_0xdba4('0x2'));var methodOverride=require(_0xdba4('0x3'));var cookieParser=require('cookie-parser');var errorHandler=require(_0xdba4('0x4'));var path=require(_0xdba4('0x5'));var passport=require(_0xdba4('0x6'));var cors=require(_0xdba4('0x7'));var moment=require(_0xdba4('0x8'));var config=require(_0xdba4('0x9'));var db=require(_0xdba4('0xa'))['db'];exports[_0xdba4('0xb')]=function(_0x3dc1d1){var _0x54532d=_0x3dc1d1[_0xdba4('0xc')](_0xdba4('0xd'));if(_0x54532d===_0xdba4('0xe')){_0x3dc1d1['set']('appPath',path[_0xdba4('0xf')](config[_0xdba4('0x10')],_0xdba4('0x11')));}if(_0x54532d===_0xdba4('0x12')||_0x54532d==='test'){_0x3dc1d1['set'](_0xdba4('0x13'),path[_0xdba4('0xf')](config['root'],_0xdba4('0x14')));_0x3dc1d1[_0xdba4('0x15')](errorHandler());}_0x3dc1d1[_0xdba4('0x16')]('json\x20replacer',function(_0x591db4,_0x402d99){if(this[_0x591db4]instanceof Date){_0x402d99=this[_0x591db4][_0xdba4('0x17')]()[_0xdba4('0x18')]('.')[0x0]+'Z';}return _0x402d99;});_0x3dc1d1[_0xdba4('0x15')](express[_0xdba4('0x19')](_0x3dc1d1[_0xdba4('0xc')]('appPath')));_0x3dc1d1['set'](_0xdba4('0x1a'),config[_0xdba4('0x10')]+_0xdba4('0x1b'));_0x3dc1d1[_0xdba4('0x1c')](_0xdba4('0x1d'),require(_0xdba4('0x1e'))[_0xdba4('0x1f')]);_0x3dc1d1['set']('view\x20engine','html');_0x3dc1d1['use'](bodyParser[_0xdba4('0x20')]({'limit':'50mb','extended':!![]}));_0x3dc1d1['use'](bodyParser[_0xdba4('0x21')]({'limit':_0xdba4('0x22')}));_0x3dc1d1[_0xdba4('0x15')](cors());_0x3dc1d1[_0xdba4('0x15')](methodOverride());_0x3dc1d1[_0xdba4('0x15')](cookieParser());_0x3dc1d1['use'](passport[_0xdba4('0x23')]());}; \ No newline at end of file +var _0xe7c5=['split','use','static','/server/views','engine','html','renderFile','view\x20engine','urlencoded','json','50mb','express','body-parser','method-override','cookie-parser','path','passport','cors','../mysqldb','default','get','env','production','set','appPath','join','root','public','client','json\x20replacer','toISOString'];(function(_0x428076,_0x1034b2){var _0x2390ff=function(_0x28e0a0){while(--_0x28e0a0){_0x428076['push'](_0x428076['shift']());}};_0x2390ff(++_0x1034b2);}(_0xe7c5,0xc5));var _0x5e7c=function(_0xa7026d,_0x1574f0){_0xa7026d=_0xa7026d-0x0;var _0x47e61e=_0xe7c5[_0xa7026d];return _0x47e61e;};'use strict';var express=require(_0x5e7c('0x0'));var favicon=require('serve-favicon');var bodyParser=require(_0x5e7c('0x1'));var methodOverride=require(_0x5e7c('0x2'));var cookieParser=require(_0x5e7c('0x3'));var errorHandler=require('errorhandler');var path=require(_0x5e7c('0x4'));var passport=require(_0x5e7c('0x5'));var cors=require(_0x5e7c('0x6'));var moment=require('moment');var config=require('./environment');var db=require(_0x5e7c('0x7'))['db'];exports[_0x5e7c('0x8')]=function(_0x5529ff){var _0x50a897=_0x5529ff[_0x5e7c('0x9')](_0x5e7c('0xa'));if(_0x50a897===_0x5e7c('0xb')){_0x5529ff[_0x5e7c('0xc')](_0x5e7c('0xd'),path[_0x5e7c('0xe')](config[_0x5e7c('0xf')],_0x5e7c('0x10')));}if(_0x50a897==='development'||_0x50a897==='test'){_0x5529ff[_0x5e7c('0xc')]('appPath',path[_0x5e7c('0xe')](config[_0x5e7c('0xf')],_0x5e7c('0x11')));_0x5529ff['use'](errorHandler());}_0x5529ff['set'](_0x5e7c('0x12'),function(_0x6dbae4,_0x190d71){if(this[_0x6dbae4]instanceof Date){_0x190d71=this[_0x6dbae4][_0x5e7c('0x13')]()[_0x5e7c('0x14')]('.')[0x0]+'Z';}return _0x190d71;});_0x5529ff[_0x5e7c('0x15')](express[_0x5e7c('0x16')](_0x5529ff['get'](_0x5e7c('0xd'))));_0x5529ff[_0x5e7c('0xc')]('views',config[_0x5e7c('0xf')]+_0x5e7c('0x17'));_0x5529ff[_0x5e7c('0x18')](_0x5e7c('0x19'),require('ejs')[_0x5e7c('0x1a')]);_0x5529ff[_0x5e7c('0xc')](_0x5e7c('0x1b'),_0x5e7c('0x19'));_0x5529ff[_0x5e7c('0x15')](bodyParser[_0x5e7c('0x1c')]({'limit':'50mb','extended':!![]}));_0x5529ff[_0x5e7c('0x15')](bodyParser[_0x5e7c('0x1d')]({'limit':_0x5e7c('0x1e')}));_0x5529ff[_0x5e7c('0x15')](cors());_0x5529ff['use'](methodOverride());_0x5529ff[_0x5e7c('0x15')](cookieParser());_0x5529ff['use'](passport['initialize']());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index 6a49b77..2ed7ef2 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 _0xf4ce=['address','127.0.0.1','getFirstInterface','cpus','map','join','createHash','update','digest','hex','licenseToken','test','win32','replace','hostname','macAddress','ipAddress','md5','substring','lodash','crypto','child_process','execSync','../environment','orderBy','keys','length','filter','family','IPv4','internal','head','mac','00:00:00:00:00:00'];(function(_0x5902f9,_0x5a92f5){var _0x54a315=function(_0x3dc614){while(--_0x3dc614){_0x5902f9['push'](_0x5902f9['shift']());}};_0x54a315(++_0x5a92f5);}(_0xf4ce,0x189));var _0xef4c=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xf4ce[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0xef4c('0x0'));var os=require('os');var crypto=require(_0xef4c('0x1'));var machine=require('bimedia-machine-uuid');var exec=require(_0xef4c('0x2'))[_0xef4c('0x3')];var config=require(_0xef4c('0x4'));function getInterfaces(){var _0x430fcd=[];var _0x280858=os['networkInterfaces']();var _0x2840ac=_[_0xef4c('0x5')](_[_0xef4c('0x6')](_0x280858));for(var _0x26780d=0x0;_0x26780d<_0x2840ac[_0xef4c('0x7')];_0x26780d++){var _0x312f16=_0x280858[_0x2840ac[_0x26780d]][_0xef4c('0x8')](function(_0x85eef7){return _0x85eef7[_0xef4c('0x9')]===_0xef4c('0xa')&&_0x85eef7[_0xef4c('0xb')]===![];});_0x430fcd=_0x430fcd['concat'](_0x312f16);}return _0x430fcd;}function getFirstInterface(){var _0x157c11=_[_0xef4c('0xc')](getInterfaces());return{'macAddress':_0x157c11&&_0x157c11[_0xef4c('0xd')]?_0x157c11['mac']:_0xef4c('0xe'),'ipAddress':_0x157c11&&_0x157c11[_0xef4c('0xf')]?_0x157c11['address']:_0xef4c('0x10')};}exports[_0xef4c('0x11')]=getFirstInterface;function getCPUhash(){var _0x51e220=_[_0xef4c('0x5')](os[_0xef4c('0x12')]()[_0xef4c('0x13')](function(_0x9cb111){return _0x9cb111['model'];}))[_0xef4c('0x14')](':');return crypto[_0xef4c('0x15')]('md5')[_0xef4c('0x16')](_0x51e220)[_0xef4c('0x17')](_0xef4c('0x18'));}exports['getUuid']=function(){var _0x47ff15=os['platform']();var _0x426a1d=/[0-9a-f-]{36}/;if(config[_0xef4c('0x19')]&&_0x426a1d[_0xef4c('0x1a')](config[_0xef4c('0x19')])){return config[_0xef4c('0x19')];}else if(_0x47ff15===_0xef4c('0x1b')){return exec('dmidecode\x20--string\x20system-uuid',{'encoding':'utf8'})[_0xef4c('0x1c')]('\x0d\x0a','');}else{var _0x1899c3=getFirstInterface();var _0x446904=getCPUhash();var _0x1a23ce=_0x446904+'|'+os[_0xef4c('0x1d')]()+'|'+_0x1899c3[_0xef4c('0x1e')]+'|'+_0x1899c3[_0xef4c('0x1f')];var _0x3b95c9=crypto[_0xef4c('0x15')](_0xef4c('0x20'))[_0xef4c('0x16')](_0x1a23ce)['digest']('hex');return _0x3b95c9['substring'](0x0,0x8)+'-'+_0x3b95c9[_0xef4c('0x21')](0x8,0xc)+'-'+_0x3b95c9[_0xef4c('0x21')](0xc,0x10)+'-'+_0x3b95c9['substring'](0x10,0x14)+'-'+_0x3b95c9[_0xef4c('0x21')](0x14);}}; \ No newline at end of file +var _0x40f0=['test','win32','dmidecode\x20--string\x20system-uuid','utf8','hostname','macAddress','ipAddress','substring','lodash','crypto','child_process','execSync','../environment','networkInterfaces','orderBy','keys','filter','family','internal','concat','head','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','cpus','map','model','join','createHash','md5','update','digest','hex','getUuid','platform','licenseToken'];(function(_0x6728be,_0x5e7e97){var _0x58f9c8=function(_0x2962b5){while(--_0x2962b5){_0x6728be['push'](_0x6728be['shift']());}};_0x58f9c8(++_0x5e7e97);}(_0x40f0,0x1aa));var _0x040f=function(_0x3b0bcc,_0x593bd9){_0x3b0bcc=_0x3b0bcc-0x0;var _0x3280a9=_0x40f0[_0x3b0bcc];return _0x3280a9;};'use strict';var _=require(_0x040f('0x0'));var os=require('os');var crypto=require(_0x040f('0x1'));var machine=require('bimedia-machine-uuid');var exec=require(_0x040f('0x2'))[_0x040f('0x3')];var config=require(_0x040f('0x4'));function getInterfaces(){var _0x1e5a70=[];var _0xbf2d6d=os[_0x040f('0x5')]();var _0x479068=_[_0x040f('0x6')](_[_0x040f('0x7')](_0xbf2d6d));for(var _0x2cd8e0=0x0;_0x2cd8e0<_0x479068['length'];_0x2cd8e0++){var _0xf4b0e8=_0xbf2d6d[_0x479068[_0x2cd8e0]][_0x040f('0x8')](function(_0x203375){return _0x203375[_0x040f('0x9')]==='IPv4'&&_0x203375[_0x040f('0xa')]===![];});_0x1e5a70=_0x1e5a70[_0x040f('0xb')](_0xf4b0e8);}return _0x1e5a70;}function getFirstInterface(){var _0x4a310f=_[_0x040f('0xc')](getInterfaces());return{'macAddress':_0x4a310f&&_0x4a310f['mac']?_0x4a310f[_0x040f('0xd')]:_0x040f('0xe'),'ipAddress':_0x4a310f&&_0x4a310f[_0x040f('0xf')]?_0x4a310f[_0x040f('0xf')]:_0x040f('0x10')};}exports[_0x040f('0x11')]=getFirstInterface;function getCPUhash(){var _0x410336=_[_0x040f('0x6')](os[_0x040f('0x12')]()[_0x040f('0x13')](function(_0x37fa40){return _0x37fa40[_0x040f('0x14')];}))[_0x040f('0x15')](':');return crypto[_0x040f('0x16')](_0x040f('0x17'))[_0x040f('0x18')](_0x410336)[_0x040f('0x19')](_0x040f('0x1a'));}exports[_0x040f('0x1b')]=function(){var _0x3a4a49=os[_0x040f('0x1c')]();var _0x4003a8=/[0-9a-f-]{36}/;if(config[_0x040f('0x1d')]&&_0x4003a8[_0x040f('0x1e')](config['licenseToken'])){return config[_0x040f('0x1d')];}else if(_0x3a4a49===_0x040f('0x1f')){return exec(_0x040f('0x20'),{'encoding':_0x040f('0x21')})['replace']('\x0d\x0a','');}else{var _0x20ec72=getFirstInterface();var _0x33ad4a=getCPUhash();var _0x2933d2=_0x33ad4a+'|'+os[_0x040f('0x22')]()+'|'+_0x20ec72[_0x040f('0x23')]+'|'+_0x20ec72[_0x040f('0x24')];var _0x4dd043=crypto['createHash'](_0x040f('0x17'))[_0x040f('0x18')](_0x2933d2)['digest'](_0x040f('0x1a'));return _0x4dd043[_0x040f('0x25')](0x0,0x8)+'-'+_0x4dd043[_0x040f('0x25')](0x8,0xc)+'-'+_0x4dd043[_0x040f('0x25')](0xc,0x10)+'-'+_0x4dd043[_0x040f('0x25')](0x10,0x14)+'-'+_0x4dd043[_0x040f('0x25')](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index 1eedc48..f332c7e 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 _0xe988=['GET','then','catch','get','data2','data1','license','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','update','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','diff','decryptString','days','DEMO\x20START\x20AT\x20%s','message','finally','getUuid','License','findOrCreate','SERVICE\x20LICENSE\x20STARTED\x20%s','error','default','util','request-promise','pkginfo','version','../../mysqldb','../../components/encryptor','./hardware','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','exports'];(function(_0x4478eb,_0x4267e6){var _0x376270=function(_0x3450d8){while(--_0x3450d8){_0x4478eb['push'](_0x4478eb['shift']());}};_0x376270(++_0x4267e6);}(_0xe988,0xe5));var _0x8e98=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0xe988[_0x5447fd];return _0x15b28a;};'use strict';var util=require(_0x8e98('0x0'));var moment=require('moment');var rp=require(_0x8e98('0x1'));var BPromise=require('bluebird');var pkginfo=require(_0x8e98('0x2'))(module,_0x8e98('0x3'));var db=require(_0x8e98('0x4'))['db'];var encryptor=require(_0x8e98('0x5'));var hardware=require(_0x8e98('0x6'));var logger=require('../logger')('license');var HOST=_0x8e98('0x7');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x1cb707){return new BPromise(function(_0x3c4d39,_0x51efb4){var _0x576ddf=util[_0x8e98('0x8')](_0x8e98('0x9'),HOST,_0x1cb707,module['exports'][_0x8e98('0x3')]);if(oldToken){_0x576ddf=util['format']('%s/api/servers/%s/check?version=%s&oldtoken=%s',HOST,_0x1cb707,module[_0x8e98('0xa')]['version'],oldToken);}var _0x155b7d={'uri':_0x576ddf,'method':_0x8e98('0xb'),'timeout':0xea60,'json':!![]};return rp(_0x155b7d)[_0x8e98('0xc')](function(_0x1d9629){_0x3c4d39(_0x1d9629);})[_0x8e98('0xd')](function(_0x8ef98d){_0x51efb4(_0x8ef98d);});});}function manageLicense(_0x4b9aa3,_0x33db79){var _0x5b8459=_0x33db79[_0x8e98('0xe')]({'plain':!![]});if(!isOldTokenSent&&_0x5b8459['data1']!==_0x4b9aa3&&!_0x5b8459[_0x8e98('0xf')]){oldToken=_0x5b8459[_0x8e98('0x10')];}httpRequest(_0x4b9aa3)[_0x8e98('0xc')](function(_0x45d196){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x45d196['active']){isOldTokenSent=![];if(!_0x5b8459['license']&&_0x5b8459[_0x8e98('0x11')]!=_0x45d196['license']||_0x5b8459['license']&&_0x5b8459[_0x8e98('0xf')]){logger[_0x8e98('0x12')](_0x8e98('0x13'));}if(_0x5b8459[_0x8e98('0x11')]&&!_0x5b8459[_0x8e98('0xf')]&&_0x5b8459['license']!=_0x45d196[_0x8e98('0x11')]){logger['info']('THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED');}if(_0x5b8459[_0x8e98('0x11')]&&!_0x5b8459[_0x8e98('0xf')]&&_0x5b8459[_0x8e98('0x11')]==_0x45d196[_0x8e98('0x11')]){return _0x33db79;}return _0x33db79[_0x8e98('0x14')]({'data1':_0x4b9aa3,'data2':null,'license':_0x45d196['license']});}else{if(_0x45d196[_0x8e98('0x11')]||_0x5b8459[_0x8e98('0x11')]){if(!_0x5b8459[_0x8e98('0xf')]){if(_0x5b8459['data1']==_0x4b9aa3){GRAY_PERIOD_REASON=_0x8e98('0x15');logger[_0x8e98('0x12')](_0x8e98('0x16'));}else{GRAY_PERIOD_REASON=_0x8e98('0x17');logger[_0x8e98('0x12')](_0x8e98('0x18'),_0x5b8459[_0x8e98('0x10')],_0x4b9aa3);}logger[_0x8e98('0x12')](_0x8e98('0x19'),GRAY_PERIOD_REASON[_0x8e98('0x1a')](),moment()[_0x8e98('0x8')](_0x8e98('0x1b')));return _0x33db79[_0x8e98('0x14')]({'data2':encryptor['encryptString'](moment()[_0x8e98('0x8')](_0x8e98('0x1b')))});}else{if(moment()[_0x8e98('0x1c')](encryptor[_0x8e98('0x1d')](_0x5b8459[_0x8e98('0xf')]),_0x8e98('0x1e'))>DAYS){logger['info'](_0x8e98('0x1f'),moment()['format'](_0x8e98('0x1b')));isOldTokenSent=![];return _0x33db79[_0x8e98('0x14')]({'data1':_0x4b9aa3,'data2':null,'license':null});}}}else{if(_0x5b8459[_0x8e98('0x10')]!=_0x4b9aa3){logger[_0x8e98('0x12')](_0x8e98('0x18'),_0x5b8459['data1'],_0x4b9aa3);return _0x33db79[_0x8e98('0x14')]({'data1':_0x4b9aa3,'data2':null,'license':null});}}}return _0x33db79;})['then'](function(_0x21aba9){_0x33db79=_0x21aba9;})['catch'](function(_0x599df0){logger['error'](_0x599df0[_0x8e98('0x20')]);})[_0x8e98('0x21')](function(){setTimeout(function(){manageLicense(hardware[_0x8e98('0x22')](),_0x33db79);},TIME);});}function defaultLicense(){var _0x179f87=hardware[_0x8e98('0x22')]();if(_0x179f87){return db[_0x8e98('0x23')][_0x8e98('0x24')]({'where':{'id':0x1},'defaults':{'data1':_0x179f87}})['spread'](function(_0x3fd406,_0x59cdc3){logger['info'](_0x8e98('0x25'),_0x179f87);manageLicense(_0x179f87,_0x3fd406);})[_0x8e98('0xd')](function(_0x1050ad){logger[_0x8e98('0x26')](_0x1050ad['message']);});}}exports[_0x8e98('0x27')]=defaultLicense; \ No newline at end of file +var _0xe8bb=['message','finally','getUuid','License','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','default','util','request-promise','pkginfo','version','../../mysqldb','../../components/encryptor','./hardware','../logger','license','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','then','catch','get','data1','data2','active','info','update','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','encryptString','decryptString','days','DEMO\x20START\x20AT\x20%s','error'];(function(_0x306533,_0xad39a6){var _0x417e6f=function(_0x3caab2){while(--_0x3caab2){_0x306533['push'](_0x306533['shift']());}};_0x417e6f(++_0xad39a6);}(_0xe8bb,0x82));var _0xbe8b=function(_0x59bff3,_0xf837d7){_0x59bff3=_0x59bff3-0x0;var _0x1109fe=_0xe8bb[_0x59bff3];return _0x1109fe;};'use strict';var util=require(_0xbe8b('0x0'));var moment=require('moment');var rp=require(_0xbe8b('0x1'));var BPromise=require('bluebird');var pkginfo=require(_0xbe8b('0x2'))(module,_0xbe8b('0x3'));var db=require(_0xbe8b('0x4'))['db'];var encryptor=require(_0xbe8b('0x5'));var hardware=require(_0xbe8b('0x6'));var logger=require(_0xbe8b('0x7'))(_0xbe8b('0x8'));var HOST=_0xbe8b('0x9');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var oldToken;var isOldTokenSent=![];function httpRequest(_0x3b6662){return new BPromise(function(_0x1dacf6,_0x19c5c9){var _0x54a438=util[_0xbe8b('0xa')](_0xbe8b('0xb'),HOST,_0x3b6662,module[_0xbe8b('0xc')][_0xbe8b('0x3')]);if(oldToken){_0x54a438=util[_0xbe8b('0xa')](_0xbe8b('0xd'),HOST,_0x3b6662,module[_0xbe8b('0xc')][_0xbe8b('0x3')],oldToken);}var _0x3f6fa2={'uri':_0x54a438,'method':_0xbe8b('0xe'),'timeout':0xea60,'json':!![]};return rp(_0x3f6fa2)[_0xbe8b('0xf')](function(_0x423444){_0x1dacf6(_0x423444);})[_0xbe8b('0x10')](function(_0x273698){_0x19c5c9(_0x273698);});});}function manageLicense(_0x3758a5,_0xc5ae75){var _0x3e4eff=_0xc5ae75[_0xbe8b('0x11')]({'plain':!![]});if(!isOldTokenSent&&_0x3e4eff[_0xbe8b('0x12')]!==_0x3758a5&&!_0x3e4eff[_0xbe8b('0x13')]){oldToken=_0x3e4eff['data1'];}httpRequest(_0x3758a5)['then'](function(_0x1c9666){if(oldToken){oldToken=undefined;isOldTokenSent=!![];}if(_0x1c9666[_0xbe8b('0x14')]){isOldTokenSent=![];if(!_0x3e4eff[_0xbe8b('0x8')]&&_0x3e4eff[_0xbe8b('0x8')]!=_0x1c9666[_0xbe8b('0x8')]||_0x3e4eff[_0xbe8b('0x8')]&&_0x3e4eff[_0xbe8b('0x13')]){logger[_0xbe8b('0x15')]('THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED');}if(_0x3e4eff[_0xbe8b('0x8')]&&!_0x3e4eff[_0xbe8b('0x13')]&&_0x3e4eff[_0xbe8b('0x8')]!=_0x1c9666['license']){logger[_0xbe8b('0x15')]('THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED');}if(_0x3e4eff['license']&&!_0x3e4eff[_0xbe8b('0x13')]&&_0x3e4eff[_0xbe8b('0x8')]==_0x1c9666[_0xbe8b('0x8')]){return _0xc5ae75;}return _0xc5ae75[_0xbe8b('0x16')]({'data1':_0x3758a5,'data2':null,'license':_0x1c9666[_0xbe8b('0x8')]});}else{if(_0x1c9666['license']||_0x3e4eff[_0xbe8b('0x8')]){if(!_0x3e4eff[_0xbe8b('0x13')]){if(_0x3e4eff[_0xbe8b('0x12')]==_0x3758a5){GRAY_PERIOD_REASON=_0xbe8b('0x17');logger[_0xbe8b('0x15')](_0xbe8b('0x18'));}else{GRAY_PERIOD_REASON=_0xbe8b('0x19');logger[_0xbe8b('0x15')](_0xbe8b('0x1a'),_0x3e4eff[_0xbe8b('0x12')],_0x3758a5);}logger[_0xbe8b('0x15')]('%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s',GRAY_PERIOD_REASON[_0xbe8b('0x1b')](),moment()['format'](_0xbe8b('0x1c')));return _0xc5ae75[_0xbe8b('0x16')]({'data2':encryptor[_0xbe8b('0x1d')](moment()['format'](_0xbe8b('0x1c')))});}else{if(moment()['diff'](encryptor[_0xbe8b('0x1e')](_0x3e4eff[_0xbe8b('0x13')]),_0xbe8b('0x1f'))>DAYS){logger[_0xbe8b('0x15')](_0xbe8b('0x20'),moment()['format'](_0xbe8b('0x1c')));isOldTokenSent=![];return _0xc5ae75['update']({'data1':_0x3758a5,'data2':null,'license':null});}}}else{if(_0x3e4eff[_0xbe8b('0x12')]!=_0x3758a5){logger[_0xbe8b('0x15')](_0xbe8b('0x1a'),_0x3e4eff[_0xbe8b('0x12')],_0x3758a5);return _0xc5ae75['update']({'data1':_0x3758a5,'data2':null,'license':null});}}}return _0xc5ae75;})['then'](function(_0x3750ef){_0xc5ae75=_0x3750ef;})[_0xbe8b('0x10')](function(_0x31e323){logger[_0xbe8b('0x21')](_0x31e323[_0xbe8b('0x22')]);})[_0xbe8b('0x23')](function(){setTimeout(function(){manageLicense(hardware[_0xbe8b('0x24')](),_0xc5ae75);},TIME);});}function defaultLicense(){var _0x42074a=hardware[_0xbe8b('0x24')]();if(_0x42074a){return db[_0xbe8b('0x25')]['findOrCreate']({'where':{'id':0x1},'defaults':{'data1':_0x42074a}})[_0xbe8b('0x26')](function(_0x1a8444,_0x50b2d4){logger[_0xbe8b('0x15')](_0xbe8b('0x27'),_0x42074a);manageLicense(_0x42074a,_0x1a8444);})[_0xbe8b('0x10')](function(_0x91b97b){logger[_0xbe8b('0x21')](_0x91b97b[_0xbe8b('0x22')]);});}}exports[_0xbe8b('0x28')]=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index 3d6941c..3627675 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 _0xaad3=['Breaking\x20license','License','find','defaults','then','catch','uuid','data1','isEmpty','split','decryptString','format','demo','machineUuid','gray','deadline','add','days','grayReason','changed','disabled','message','User','findAll','sequelize','COUNT','role','count','admin','user','telephone','users','telephones','forEach','countBy','License\x20limit\x20reached\x20for\x20users','License\x20limit\x20reached\x20for\x20telephones','exports','util','lodash','moment','bluebird','./hardware','../../components/encryptor','../../mysqldb','2027-01-01T00:00:00.000Z','Demo\x20license','getUuid'];(function(_0x31f8dc,_0x11ff65){var _0x2f31e7=function(_0x6db1db){while(--_0x6db1db){_0x31f8dc['push'](_0x31f8dc['shift']());}};_0x2f31e7(++_0x11ff65);}(_0xaad3,0x1a6));var _0x3aad=function(_0x52e67b,_0x2c74e6){_0x52e67b=_0x52e67b-0x0;var _0x3be730=_0xaad3[_0x52e67b];return _0x3be730;};'use strict';var util=require(_0x3aad('0x0'));var _=require(_0x3aad('0x1'));var moment=require(_0x3aad('0x2'));var BPromise=require(_0x3aad('0x3'));var hardware=require(_0x3aad('0x4'));var encryptor=require(_0x3aad('0x5'));var db=require(_0x3aad('0x6'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x3aad('0x7'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x3aad('0x8'),'machineUuid':hardware[_0x3aad('0x9')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x3aad('0xa'),'machineUuid':hardware[_0x3aad('0x9')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x317ee9){return new BPromise(function(_0x373d66,_0x213b1f){return db[_0x3aad('0xb')][_0x3aad('0xc')](_[_0x3aad('0xd')](_0x317ee9,{'raw':!![],'where':{'id':0x1}}))[_0x3aad('0xe')](function(_0x919f14){return checkLicense(_0x919f14,null);})['then'](function(_0x9ad65a){_0x373d66(_0x9ad65a);return;})[_0x3aad('0xf')](function(_0x43e692){_0x213b1f(_0x43e692);});});}function checkLicense(_0x51530e,_0x2a433b){if(!_0x51530e){demoLicense[_0x3aad('0x10')]=_0x51530e[_0x3aad('0x11')];return demoLicense;}try{var _0x14fe29=_0x2a433b||_0x51530e['license'];if(_[_0x3aad('0x12')](_0x14fe29)){throw new Error('License\x20key\x20value\x20not\x20found');}var _0xdb7c41=_0x51530e['data1'];var _0x1fa708=_0x51530e['data2'];var _0x413d5e=_0xdb7c41[_0x3aad('0x13')]('-')[0x4];var _0x3a37be=_0xdb7c41[_0x3aad('0x13')]('-')[0x0];var _0x4e1830=encryptor[_0x3aad('0x14')](_0x14fe29,util[_0x3aad('0x15')]('%s:%s:%s',_0x413d5e,_0xdb7c41,_0x3a37be));var _0x436905=JSON['parse'](_0x4e1830);_0x436905[_0x3aad('0x16')]=![];_0x436905['uuid']=_0xdb7c41;_0x436905[_0x3aad('0x17')]=hardware['getUuid']();if(_0x1fa708){var _0x2bb341=encryptor[_0x3aad('0x14')](_0x1fa708);_0x436905[_0x3aad('0x18')]=_0x2bb341;_0x436905[_0x3aad('0x19')]=moment(_0x2bb341)[_0x3aad('0x1a')](0x7,_0x3aad('0x1b'))['format']();_0x436905[_0x3aad('0x1c')]=_0x436905[_0x3aad('0x10')]!=_0x436905['machineUuid']?_0x3aad('0x1d'):_0x3aad('0x1e');}return _0x436905;}catch(_0x26b7ec){breakingLicense[_0x3aad('0x10')]=_0x51530e[_0x3aad('0x11')];breakingLicense[_0x3aad('0x1f')]=_0x26b7ec[_0x3aad('0x1f')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x10c905,_0xf9685b){getLicense()['then'](function(_0x3d0bbd){return db[_0x3aad('0x20')][_0x3aad('0x21')]({'attributes':['role',[db[_0x3aad('0x22')]['fn'](_0x3aad('0x23'),db[_0x3aad('0x22')]['col'](_0x3aad('0x24'))),_0x3aad('0x25')]],'group':_0x3aad('0x24'),'where':{'role':{'$or':[_0x3aad('0x26'),_0x3aad('0x27'),_0x3aad('0x28')]}},'raw':!![]})[_0x3aad('0xe')](function(_0xd95e70){var _0x4b3323={'user':_0x3d0bbd[_0x3aad('0x29')]||0x0,'telephone':_0x3d0bbd[_0x3aad('0x2a')]||0x0};_0xd95e70[_0x3aad('0x2b')](function(_0x150e50){var _0x3e4177=_0x150e50[_0x3aad('0x24')]==='admin'?_0x3aad('0x27'):_0x150e50[_0x3aad('0x24')];_0x4b3323[_0x3e4177]-=_0x150e50[_0x3aad('0x25')];if(_0x4b3323[_0x3e4177]<0x0)_0x4b3323[_0x3e4177]=0x0;});_0x10c905(_0x4b3323);return;});})['catch'](function(_0xe4abeb){_0xf9685b(_0xe4abeb);});});}function checkUserLimits(_0x2fd6bc){return new BPromise(function(_0x539161,_0xd1fca5){getLimits()['then'](function(_0x152b0d){var _0x352e50=_['pick'](_[_0x3aad('0x2c')](_0x2fd6bc,'role'),['admin','user',_0x3aad('0x28')]);var _0x500df9=(_0x352e50[_0x3aad('0x26')]||0x0)+(_0x352e50[_0x3aad('0x27')]||0x0);var _0x35ec3e=_0x352e50['telephone']||0x0;if(_0x500df9>_0x152b0d['user'])return _0xd1fca5(_0x3aad('0x2d'));if(_0x35ec3e>_0x152b0d[_0x3aad('0x28')])return _0xd1fca5(_0x3aad('0x2e'));return _0x539161();})[_0x3aad('0xf')](function(_0x3ba6b8){_0xd1fca5(_0x3ba6b8);});});}module[_0x3aad('0x2f')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file +var _0x132d=['License\x20key\x20value\x20not\x20found','data2','split','decryptString','format','parse','demo','gray','add','days','grayReason','machineUuid','changed','message','User','findAll','sequelize','col','role','count','admin','telephone','users','telephones','forEach','pick','countBy','user','License\x20limit\x20reached\x20for\x20users','exports','lodash','moment','bluebird','./hardware','../../components/encryptor','../../mysqldb','2027-01-01T00:00:00.000Z','Demo\x20license','getUuid','License','find','then','catch','uuid','data1','license','isEmpty'];(function(_0x9bf0b5,_0x5d5c51){var _0x2e359b=function(_0x5cd2ea){while(--_0x5cd2ea){_0x9bf0b5['push'](_0x9bf0b5['shift']());}};_0x2e359b(++_0x5d5c51);}(_0x132d,0x167));var _0xd132=function(_0x10ffaf,_0x2e5c01){_0x10ffaf=_0x10ffaf-0x0;var _0x26803e=_0x132d[_0x10ffaf];return _0x26803e;};'use strict';var util=require('util');var _=require(_0xd132('0x0'));var moment=require(_0xd132('0x1'));var BPromise=require(_0xd132('0x2'));var hardware=require(_0xd132('0x3'));var encryptor=require(_0xd132('0x4'));var db=require(_0xd132('0x5'))['db'];const demoLicense={'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xd132('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0xd132('0x7'),'machineUuid':hardware[_0xd132('0x8')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};const breakingLicense={'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xd132('0x6'),'chat':![],'mail':![],'fax':![],'messaging':![],'whatsapp':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':'Breaking\x20license','machineUuid':hardware[_0xd132('0x8')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![],'ai':![]};function getLicense(_0x572135){return new BPromise(function(_0x577663,_0x1d1c79){return db[_0xd132('0x9')][_0xd132('0xa')](_['defaults'](_0x572135,{'raw':!![],'where':{'id':0x1}}))['then'](function(_0x4a802e){return checkLicense(_0x4a802e,null);})[_0xd132('0xb')](function(_0x1b7914){_0x577663(_0x1b7914);return;})[_0xd132('0xc')](function(_0x18dcc1){_0x1d1c79(_0x18dcc1);});});}function checkLicense(_0x2608bd,_0x11854f){if(!_0x2608bd){demoLicense[_0xd132('0xd')]=_0x2608bd[_0xd132('0xe')];return demoLicense;}try{var _0xb86d98=_0x11854f||_0x2608bd[_0xd132('0xf')];if(_[_0xd132('0x10')](_0xb86d98)){throw new Error(_0xd132('0x11'));}var _0x275d12=_0x2608bd['data1'];var _0x2f86a2=_0x2608bd[_0xd132('0x12')];var _0x2ad8ae=_0x275d12['split']('-')[0x4];var _0x8a419b=_0x275d12[_0xd132('0x13')]('-')[0x0];var _0x51c4eb=encryptor[_0xd132('0x14')](_0xb86d98,util[_0xd132('0x15')]('%s:%s:%s',_0x2ad8ae,_0x275d12,_0x8a419b));var _0x406341=JSON[_0xd132('0x16')](_0x51c4eb);_0x406341[_0xd132('0x17')]=![];_0x406341['uuid']=_0x275d12;_0x406341['machineUuid']=hardware[_0xd132('0x8')]();if(_0x2f86a2){var _0x3d35e1=encryptor['decryptString'](_0x2f86a2);_0x406341[_0xd132('0x18')]=_0x3d35e1;_0x406341['deadline']=moment(_0x3d35e1)[_0xd132('0x19')](0x7,_0xd132('0x1a'))[_0xd132('0x15')]();_0x406341[_0xd132('0x1b')]=_0x406341[_0xd132('0xd')]!=_0x406341[_0xd132('0x1c')]?_0xd132('0x1d'):'disabled';}return _0x406341;}catch(_0x11ad9f){breakingLicense[_0xd132('0xd')]=_0x2608bd[_0xd132('0xe')];breakingLicense['message']=_0x11ad9f[_0xd132('0x1e')];return breakingLicense;}}function getLimits(){return new BPromise(function(_0x3ab132,_0x2b42cd){getLicense()[_0xd132('0xb')](function(_0x498820){return db[_0xd132('0x1f')][_0xd132('0x20')]({'attributes':['role',[db[_0xd132('0x21')]['fn']('COUNT',db[_0xd132('0x21')][_0xd132('0x22')](_0xd132('0x23'))),_0xd132('0x24')]],'group':_0xd132('0x23'),'where':{'role':{'$or':[_0xd132('0x25'),'user',_0xd132('0x26')]}},'raw':!![]})['then'](function(_0x49d874){var _0x2bedd7={'user':_0x498820[_0xd132('0x27')]||0x0,'telephone':_0x498820[_0xd132('0x28')]||0x0};_0x49d874[_0xd132('0x29')](function(_0x378e59){var _0x46bb74=_0x378e59[_0xd132('0x23')]===_0xd132('0x25')?'user':_0x378e59[_0xd132('0x23')];_0x2bedd7[_0x46bb74]-=_0x378e59[_0xd132('0x24')];if(_0x2bedd7[_0x46bb74]<0x0)_0x2bedd7[_0x46bb74]=0x0;});_0x3ab132(_0x2bedd7);return;});})[_0xd132('0xc')](function(_0x46fbda){_0x2b42cd(_0x46fbda);});});}function checkUserLimits(_0x4c3d30){return new BPromise(function(_0x594629,_0x394c64){getLimits()[_0xd132('0xb')](function(_0xc10f45){var _0x46a50d=_[_0xd132('0x2a')](_[_0xd132('0x2b')](_0x4c3d30,_0xd132('0x23')),[_0xd132('0x25'),_0xd132('0x2c'),'telephone']);var _0x1e89ae=(_0x46a50d['admin']||0x0)+(_0x46a50d['user']||0x0);var _0x1d740b=_0x46a50d[_0xd132('0x26')]||0x0;if(_0x1e89ae>_0xc10f45[_0xd132('0x2c')])return _0x394c64(_0xd132('0x2d'));if(_0x1d740b>_0xc10f45[_0xd132('0x26')])return _0x394c64('License\x20limit\x20reached\x20for\x20telephones');return _0x594629();})[_0xd132('0xc')](function(_0xe43897){_0x394c64(_0xe43897);});});}module[_0xd132('0x2e')]={'checkLicense':checkLicense,'checkUserLimits':checkUserLimits,'getLicense':getLicense}; \ No newline at end of file diff --git a/server/config/local.env.js b/server/config/local.env.js index a0818a3..72c964b 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 _0x4024=['secret','exports','http://localhost:9000','app-id'];(function(_0x22372c,_0x204b6c){var _0x535d27=function(_0x2ecef9){while(--_0x2ecef9){_0x22372c['push'](_0x22372c['shift']());}};_0x535d27(++_0x204b6c);}(_0x4024,0x89));var _0x4402=function(_0x1a2f11,_0x325f17){_0x1a2f11=_0x1a2f11-0x0;var _0x22dd87=_0x4024[_0x1a2f11];return _0x22dd87;};'use strict';module[_0x4402('0x0')]={'DOMAIN':_0x4402('0x1'),'SESSION_SECRET':'myappanuglar-secret','GOOGLE_ID':_0x4402('0x2'),'GOOGLE_SECRET':_0x4402('0x3'),'DEBUG':''}; \ No newline at end of file +var _0x2272=['secret','exports','http://localhost:9000','myappanuglar-secret','app-id'];(function(_0x49dd7e,_0x48b1e5){var _0x4c4f6e=function(_0x5189f3){while(--_0x5189f3){_0x49dd7e['push'](_0x49dd7e['shift']());}};_0x4c4f6e(++_0x48b1e5);}(_0x2272,0xd8));var _0x2227=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x2272[_0xa464c9];return _0x3d73c4;};'use strict';module[_0x2227('0x0')]={'DOMAIN':_0x2227('0x1'),'SESSION_SECRET':_0x2227('0x2'),'GOOGLE_ID':_0x2227('0x3'),'GOOGLE_SECRET':_0x2227('0x4'),'DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index 57c2303..b098ed7 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0fd1=['moment','winston','util','INFO','join','/var','log','xcally','format','message','replace','}}}','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','File','%s-%s','error','transports','info','Console','debugLevel'];(function(_0x345c86,_0x2b12e0){var _0x41e895=function(_0x2af8c3){while(--_0x2af8c3){_0x345c86['push'](_0x345c86['shift']());}};_0x41e895(++_0x2b12e0);}(_0x0fd1,0x12b));var _0x10fd=function(_0x9cd4c3,_0x1c9b2c){_0x9cd4c3=_0x9cd4c3-0x0;var _0x4c9025=_0x0fd1[_0x9cd4c3];return _0x4c9025;};'use strict';var moment=require(_0x10fd('0x0'));var winston=require(_0x10fd('0x1'));var util=require(_0x10fd('0x2'));var path=require('path');var debugLevel=_0x10fd('0x3');function filename(_0x462192,_0x463e65){return path[_0x10fd('0x4')](_0x10fd('0x5'),_0x10fd('0x6'),_0x10fd('0x7'),util[_0x10fd('0x8')]('%s-%s.log',_0x462192,_0x463e65));}function formatter(_0x35a74b,_0x1d8be4){_0x1d8be4[_0x10fd('0x9')]=_0x1d8be4[_0x10fd('0x9')][_0x10fd('0xa')](/@@{/g,'{{{')['replace'](/}@@/g,_0x10fd('0xb'))[_0x10fd('0xa')](/@{/g,'{{')[_0x10fd('0xa')](/}@/g,'}}');return util[_0x10fd('0x8')](_0x10fd('0xc'),moment()['format'](_0x10fd('0xd')),_0x1d8be4[_0x10fd('0xe')][_0x10fd('0xf')](),_0x35a74b,_0x1d8be4[_0x10fd('0x9')]);}module['exports']=function(_0x541a5a){return new winston['Logger']({'transports':[new winston['transports'][(_0x10fd('0x10'))]({'name':util[_0x10fd('0x8')](_0x10fd('0x11'),_0x541a5a,_0x10fd('0x12')),'filename':filename(_0x541a5a,_0x10fd('0x12')),'level':_0x10fd('0x12'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x903fb9){return formatter(_0x541a5a,_0x903fb9);}}),new winston[(_0x10fd('0x13'))][(_0x10fd('0x10'))]({'name':util['format'](_0x10fd('0x11'),_0x541a5a,'info'),'filename':filename(_0x541a5a,_0x10fd('0x14')),'level':_0x10fd('0x14'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x133bac){return formatter(_0x541a5a,_0x133bac);}}),new winston[(_0x10fd('0x13'))][(_0x10fd('0x15'))]({'level':process['env'][_0x10fd('0x16')]||debugLevel,'json':![],'formatter':function(_0x1232e7){return formatter(_0x541a5a,_0x1232e7);}})]});}; \ No newline at end of file +var _0xd4ab=['debugLevel','moment','winston','path','log','format','%s-%s.log','message','{{{','replace','}}}','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','transports','File','%s-%s','error','info','env'];(function(_0x417a93,_0x9ce30d){var _0xde865b=function(_0x467640){while(--_0x467640){_0x417a93['push'](_0x417a93['shift']());}};_0xde865b(++_0x9ce30d);}(_0xd4ab,0x1cf));var _0xbd4a=function(_0x8bb916,_0x24b0ed){_0x8bb916=_0x8bb916-0x0;var _0x587038=_0xd4ab[_0x8bb916];return _0x587038;};'use strict';var moment=require(_0xbd4a('0x0'));var winston=require(_0xbd4a('0x1'));var util=require('util');var path=require(_0xbd4a('0x2'));var debugLevel='INFO';function filename(_0x3a2a51,_0x51ffc3){return path['join']('/var',_0xbd4a('0x3'),'xcally',util[_0xbd4a('0x4')](_0xbd4a('0x5'),_0x3a2a51,_0x51ffc3));}function formatter(_0x1b6b34,_0x140180){_0x140180[_0xbd4a('0x6')]=_0x140180['message']['replace'](/@@{/g,_0xbd4a('0x7'))[_0xbd4a('0x8')](/}@@/g,_0xbd4a('0x9'))[_0xbd4a('0x8')](/@{/g,'{{')[_0xbd4a('0x8')](/}@/g,'}}');return util[_0xbd4a('0x4')](_0xbd4a('0xa'),moment()[_0xbd4a('0x4')](_0xbd4a('0xb')),_0x140180[_0xbd4a('0xc')][_0xbd4a('0xd')](),_0x1b6b34,_0x140180[_0xbd4a('0x6')]);}module['exports']=function(_0x10022b){return new winston['Logger']({'transports':[new winston[(_0xbd4a('0xe'))][(_0xbd4a('0xf'))]({'name':util['format'](_0xbd4a('0x10'),_0x10022b,_0xbd4a('0x11')),'filename':filename(_0x10022b,_0xbd4a('0x11')),'level':'error','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x4cdaae){return formatter(_0x10022b,_0x4cdaae);}}),new winston[(_0xbd4a('0xe'))][(_0xbd4a('0xf'))]({'name':util[_0xbd4a('0x4')](_0xbd4a('0x10'),_0x10022b,_0xbd4a('0x12')),'filename':filename(_0x10022b,'info'),'level':'info','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x2ab76f){return formatter(_0x10022b,_0x2ab76f);}}),new winston[(_0xbd4a('0xe'))]['Console']({'level':process[_0xbd4a('0x13')][_0xbd4a('0x14')]||debugLevel,'json':![],'formatter':function(_0x9c55c9){return formatter(_0x10022b,_0x9c55c9);}})]});}; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index 9412ce9..0981d3f 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 _0xadb8=['agi','../../services/agi/index.js','routing','xdr','../../services/xdr/index.js','exports','path','join','../../services/express/index.js','ami','../../services/ami/index.js'];(function(_0x3fdcee,_0x17dbfe){var _0x4a5788=function(_0x2030aa){while(--_0x2030aa){_0x3fdcee['push'](_0x3fdcee['shift']());}};_0x4a5788(++_0x17dbfe);}(_0xadb8,0x119));var _0x8adb=function(_0x14b767,_0x577e84){_0x14b767=_0x14b767-0x0;var _0x22267a=_0xadb8[_0x14b767];return _0x22267a;};'use strict';var path=require(_0x8adb('0x0'));var os=require('os');var config={'apps':[{'name':'express','script':path[_0x8adb('0x1')](__dirname,_0x8adb('0x2'))},{'name':_0x8adb('0x3'),'script':path[_0x8adb('0x1')](__dirname,_0x8adb('0x4'))},{'name':_0x8adb('0x5'),'script':path['join'](__dirname,_0x8adb('0x6'))},{'name':'email','script':path[_0x8adb('0x1')](__dirname,'../../services/email/index.js')},{'name':_0x8adb('0x7'),'script':path['join'](__dirname,'../../services/routing/index.js')},{'name':_0x8adb('0x8'),'script':path[_0x8adb('0x1')](__dirname,_0x8adb('0x9'))}]};module[_0x8adb('0xa')]=config; \ No newline at end of file +var _0x1607=['email','../../services/email/index.js','xdr','../../services/xdr/index.js','exports','path','express','join','../../services/express/index.js','agi','../../services/agi/index.js'];(function(_0x28c50d,_0x556973){var _0x18c5f0=function(_0x104f19){while(--_0x104f19){_0x28c50d['push'](_0x28c50d['shift']());}};_0x18c5f0(++_0x556973);}(_0x1607,0x186));var _0x7160=function(_0x216ed2,_0x2dbfd7){_0x216ed2=_0x216ed2-0x0;var _0x41e522=_0x1607[_0x216ed2];return _0x41e522;};'use strict';var path=require(_0x7160('0x0'));var os=require('os');var config={'apps':[{'name':_0x7160('0x1'),'script':path[_0x7160('0x2')](__dirname,_0x7160('0x3'))},{'name':'ami','script':path['join'](__dirname,'../../services/ami/index.js')},{'name':_0x7160('0x4'),'script':path[_0x7160('0x2')](__dirname,_0x7160('0x5'))},{'name':_0x7160('0x6'),'script':path[_0x7160('0x2')](__dirname,_0x7160('0x7'))},{'name':'routing','script':path[_0x7160('0x2')](__dirname,'../../services/routing/index.js')},{'name':_0x7160('0x8'),'script':path[_0x7160('0x2')](__dirname,_0x7160('0x9'))}]};module[_0x7160('0xa')]=config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index 50d8367..831a70d 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 _0xf3db=['stop','restart','list','describe','delete','dump','pm2','bluebird','./config','connect','connected','start','then','disconnect'];(function(_0x23a79e,_0x235f89){var _0x3dab57=function(_0x346cf4){while(--_0x346cf4){_0x23a79e['push'](_0x23a79e['shift']());}};_0x3dab57(++_0x235f89);}(_0xf3db,0x1c6));var _0xbf3d=function(_0x276053,_0x1d8c41){_0x276053=_0x276053-0x0;var _0x3f15e5=_0xf3db[_0x276053];return _0x3f15e5;};'use strict';var pm2=require(_0xbf3d('0x0'));var BPromise=require(_0xbf3d('0x1'));var config=require(_0xbf3d('0x2'));function connect(){return new BPromise(function(_0xc381b0,_0x2ef5bc){return pm2[_0xbf3d('0x3')](function(_0x56a925){if(_0x56a925){return _0x2ef5bc(_0x56a925);}return _0xc381b0(_0xbf3d('0x4'));});});};exports[_0xbf3d('0x5')]=function(_0x1609d8){return connect()[_0xbf3d('0x6')](function(){return new BPromise(function(_0x4b1e43,_0x900c06){return pm2[_0xbf3d('0x5')](_0x1609d8,function(_0x254c27,_0x507e74){if(_0x254c27){return _0x900c06(_0x254c27);}pm2[_0xbf3d('0x7')]();return _0x4b1e43(_0x507e74);});});});};exports[_0xbf3d('0x8')]=function(_0x508625){return connect()[_0xbf3d('0x6')](function(){return new BPromise(function(_0x8f2be8,_0x49ae10){return pm2[_0xbf3d('0x8')](_0x508625,function(_0x24f861,_0x3faa34){if(_0x24f861){return _0x49ae10(_0x24f861);}pm2['disconnect']();return _0x8f2be8(_0x3faa34);});});});};exports[_0xbf3d('0x9')]=function(_0xbb2d66){return connect()[_0xbf3d('0x6')](function(){return new BPromise(function(_0x1b16cd,_0x3227b6){return pm2[_0xbf3d('0x9')](_0xbb2d66,function(_0x39d71b,_0x3f8bb8){if(_0x39d71b){return _0x3227b6(_0x39d71b);}pm2[_0xbf3d('0x7')]();return _0x1b16cd(_0x3f8bb8);});});});};exports[_0xbf3d('0xa')]=function(){return connect()['then'](function(){return new BPromise(function(_0x1e8a97,_0x389b13){return pm2[_0xbf3d('0xa')](function(_0x2ee70a,_0x238a23){if(_0x2ee70a){return _0x389b13(_0x2ee70a);}pm2['disconnect']();return _0x1e8a97(_0x238a23);});});});};exports[_0xbf3d('0xb')]=function(_0x172098){return connect()['then'](function(){return new BPromise(function(_0xafbdc8,_0x19ee45){return pm2[_0xbf3d('0xb')](_0x172098,function(_0x207e8a,_0x2b1b6c){if(_0x207e8a){return _0x19ee45(_0x207e8a);}pm2['disconnect']();return _0xafbdc8(_0x2b1b6c);});});});};exports['delete']=function(_0x463844){return connect()[_0xbf3d('0x6')](function(){return new BPromise(function(_0x76b4b3,_0xe48b7a){return pm2[_0xbf3d('0xc')](_0x463844,function(_0x403d1a,_0x202bbe){if(_0x403d1a){return _0xe48b7a(_0x403d1a);}pm2[_0xbf3d('0x7')]();return _0x76b4b3(_0x202bbe);});});});};exports['dump']=function(){return connect()[_0xbf3d('0x6')](function(){return new BPromise(function(_0x108c8c,_0x45bcc9){return pm2[_0xbf3d('0xd')](function(_0x4e8d2a){if(_0x4e8d2a){return _0x45bcc9(_0x4e8d2a);}return _0x108c8c('saved');});});});}; \ No newline at end of file +var _0x78f8=['stop','restart','list','describe','delete','dump','pm2','bluebird','./config','disconnect','then'];(function(_0x157313,_0x386968){var _0x4c9730=function(_0x32bb3b){while(--_0x32bb3b){_0x157313['push'](_0x157313['shift']());}};_0x4c9730(++_0x386968);}(_0x78f8,0x1b3));var _0x878f=function(_0x15d717,_0x1383d6){_0x15d717=_0x15d717-0x0;var _0x66ba4d=_0x78f8[_0x15d717];return _0x66ba4d;};'use strict';var pm2=require(_0x878f('0x0'));var BPromise=require(_0x878f('0x1'));var config=require(_0x878f('0x2'));function connect(){return new BPromise(function(_0x5d5a39,_0x212c81){return pm2['connect'](function(_0x110000){if(_0x110000){return _0x212c81(_0x110000);}return _0x5d5a39('connected');});});};exports['start']=function(_0x2634c7){return connect()['then'](function(){return new BPromise(function(_0x33d212,_0x1adfca){return pm2['start'](_0x2634c7,function(_0x2c22b6,_0x401b7d){if(_0x2c22b6){return _0x1adfca(_0x2c22b6);}pm2[_0x878f('0x3')]();return _0x33d212(_0x401b7d);});});});};exports['stop']=function(_0xe9dd89){return connect()[_0x878f('0x4')](function(){return new BPromise(function(_0x169a7d,_0x491736){return pm2[_0x878f('0x5')](_0xe9dd89,function(_0xe4910b,_0x58f86a){if(_0xe4910b){return _0x491736(_0xe4910b);}pm2[_0x878f('0x3')]();return _0x169a7d(_0x58f86a);});});});};exports[_0x878f('0x6')]=function(_0x45f919){return connect()[_0x878f('0x4')](function(){return new BPromise(function(_0x4cd56e,_0x2f9592){return pm2[_0x878f('0x6')](_0x45f919,function(_0x1d4dd2,_0x59bc04){if(_0x1d4dd2){return _0x2f9592(_0x1d4dd2);}pm2[_0x878f('0x3')]();return _0x4cd56e(_0x59bc04);});});});};exports[_0x878f('0x7')]=function(){return connect()[_0x878f('0x4')](function(){return new BPromise(function(_0x56b28c,_0x2204b6){return pm2[_0x878f('0x7')](function(_0x271136,_0x38fa72){if(_0x271136){return _0x2204b6(_0x271136);}pm2[_0x878f('0x3')]();return _0x56b28c(_0x38fa72);});});});};exports['describe']=function(_0x120724){return connect()['then'](function(){return new BPromise(function(_0x1b0821,_0x4b921f){return pm2[_0x878f('0x8')](_0x120724,function(_0x2bbd01,_0x4a530a){if(_0x2bbd01){return _0x4b921f(_0x2bbd01);}pm2[_0x878f('0x3')]();return _0x1b0821(_0x4a530a);});});});};exports[_0x878f('0x9')]=function(_0xbf1490){return connect()['then'](function(){return new BPromise(function(_0x20419a,_0x1c5f42){return pm2[_0x878f('0x9')](_0xbf1490,function(_0x42c2a1,_0x1486b3){if(_0x42c2a1){return _0x1c5f42(_0x42c2a1);}pm2['disconnect']();return _0x20419a(_0x1486b3);});});});};exports[_0x878f('0xa')]=function(){return connect()[_0x878f('0x4')](function(){return new BPromise(function(_0xcac531,_0x3bb769){return pm2[_0x878f('0xa')](function(_0x5c5ca0){if(_0x5c5ca0){return _0x3bb769(_0x5c5ca0);}return _0xcac531('saved');});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index a3ea30b..05876b6 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 _0x5024=['util','../../config/environment','../../mysqldb','schedule','redis','defaults','socket.io-emitter','Setting','find','chatTimeout','lastMsgAt','subtract','minutes','then','length','map','info','[CHAT]\x20Interactions\x20to\x20close:','join','ChatInteraction','update','system','format','YYYY-MM-DD\x20HH:mm:ss','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','catch','error','[CHAT]\x20Error\x20closing\x20interactions','inspect','lodash','ioredis'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x5024,0x115));var _0x4502=function(_0x32e238,_0xf171e8){_0x32e238=_0x32e238-0x0;var _0x1d6a4f=_0x5024[_0x32e238];return _0x1d6a4f;};'use strict';var _=require(_0x4502('0x0'));var moment=require('moment');var Redis=require(_0x4502('0x1'));var util=require(_0x4502('0x2'));var config=require(_0x4502('0x3'));var db=require(_0x4502('0x4'))['db'];var logger=require('../logger')(_0x4502('0x5'));config[_0x4502('0x6')]=_[_0x4502('0x7')](config[_0x4502('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x4502('0x8'))(new Redis(config[_0x4502('0x6')]));function closeInteractions(){var _0x5e3785=0x0;var _0x5dd749=[];return db[_0x4502('0x9')][_0x4502('0xa')]({'raw':!![],'attributes':['id',_0x4502('0xb')],'where':{'id':0x1}})['then'](function(_0x54c839){_0x5e3785=_0x54c839[_0x4502('0xb')];if(_0x5e3785){return db['ChatInteraction']['findAll']({'raw':!![],'attributes':['id',_0x4502('0xc')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x4502('0xd')](_0x54c839[_0x4502('0xb')],_0x4502('0xe'))}}});}else{return[];}})[_0x4502('0xf')](function(_0x32075a){if(_0x32075a&&_0x32075a[_0x4502('0x10')]){_0x5dd749=_[_0x4502('0x11')](_0x32075a||[],'id');logger[_0x4502('0x12')](_0x4502('0x13'),_0x5dd749[_0x4502('0x14')]());return db[_0x4502('0x15')][_0x4502('0x16')]({'closeReason':_0x4502('0x17'),'disposition':'timeout','closed':!![],'closedAt':moment()[_0x4502('0x18')](_0x4502('0x19'))},{'where':{'id':_0x5dd749}});}})['then'](function(){if(_0x5dd749&&_0x5dd749[_0x4502('0x10')]){logger[_0x4502('0x12')](_0x4502('0x1a'),_0x5dd749[_0x4502('0x14')]());for(var _0x100a93=0x0;_0x100a93<_0x5dd749[_0x4502('0x10')];_0x100a93++){io['emit']('chatInteraction:update',{'id':_0x5dd749[_0x100a93],'closed':!![]});}}})[_0x4502('0x1b')](function(_0x15494a){logger[_0x4502('0x1c')](_0x4502('0x1d'),_0x15494a?util[_0x4502('0x1e')](_0x15494a,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x82d2=['[CHAT]\x20Error\x20closing\x20interactions','inspect','lodash','moment','ioredis','util','../../config/environment','../logger','schedule','redis','defaults','socket.io-emitter','Setting','find','chatTimeout','ChatInteraction','findAll','lastMsgAt','subtract','minutes','then','length','map','join','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','info','[CHAT]\x20Sending\x20updates\x20for\x20interactions:','emit','catch','error'];(function(_0x14c5b5,_0x32905e){var _0x370cf2=function(_0x351dfa){while(--_0x351dfa){_0x14c5b5['push'](_0x14c5b5['shift']());}};_0x370cf2(++_0x32905e);}(_0x82d2,0xf0));var _0x282d=function(_0x55cc23,_0x583688){_0x55cc23=_0x55cc23-0x0;var _0x48aa29=_0x82d2[_0x55cc23];return _0x48aa29;};'use strict';var _=require(_0x282d('0x0'));var moment=require(_0x282d('0x1'));var Redis=require(_0x282d('0x2'));var util=require(_0x282d('0x3'));var config=require(_0x282d('0x4'));var db=require('../../mysqldb')['db'];var logger=require(_0x282d('0x5'))(_0x282d('0x6'));config[_0x282d('0x7')]=_[_0x282d('0x8')](config[_0x282d('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x282d('0x9'))(new Redis(config[_0x282d('0x7')]));function closeInteractions(){var _0x37c746=0x0;var _0x132d4d=[];return db[_0x282d('0xa')][_0x282d('0xb')]({'raw':!![],'attributes':['id',_0x282d('0xc')],'where':{'id':0x1}})['then'](function(_0x54250a){_0x37c746=_0x54250a[_0x282d('0xc')];if(_0x37c746){return db[_0x282d('0xd')][_0x282d('0xe')]({'raw':!![],'attributes':['id',_0x282d('0xf')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x282d('0x10')](_0x54250a['chatTimeout'],_0x282d('0x11'))}}});}else{return[];}})[_0x282d('0x12')](function(_0x3a24f7){if(_0x3a24f7&&_0x3a24f7[_0x282d('0x13')]){_0x132d4d=_[_0x282d('0x14')](_0x3a24f7||[],'id');logger['info']('[CHAT]\x20Interactions\x20to\x20close:',_0x132d4d[_0x282d('0x15')]());return db[_0x282d('0xd')][_0x282d('0x16')]({'closeReason':_0x282d('0x17'),'disposition':_0x282d('0x18'),'closed':!![],'closedAt':moment()[_0x282d('0x19')](_0x282d('0x1a'))},{'where':{'id':_0x132d4d}});}})[_0x282d('0x12')](function(){if(_0x132d4d&&_0x132d4d[_0x282d('0x13')]){logger[_0x282d('0x1b')](_0x282d('0x1c'),_0x132d4d[_0x282d('0x15')]());for(var _0x38a876=0x0;_0x38a876<_0x132d4d[_0x282d('0x13')];_0x38a876++){io[_0x282d('0x1d')]('chatInteraction:update',{'id':_0x132d4d[_0x38a876],'closed':!![]});}}})[_0x282d('0x1e')](function(_0x437fbc){logger[_0x282d('0x1f')](_0x282d('0x20'),_0x437fbc?util[_0x282d('0x21')](_0x437fbc,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/schedule/index.js b/server/config/schedule/index.js index 53712f2..29a9c38 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 _0x8d2a=['Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','info','empty\x20file,\x20email\x20not\x20sent','SendMail','then','error','catch','error\x20mail','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','CustomReportId','no\x20report\x20id','Schedule','findAll','MailServerOut','keys','jobs','keyBy','toString','difference','length','stop','deleteJob','delete\x20cron','toRun','resolve','run\x20job','cron','active','isBetween','startAt','endAt','add','add\x20cron','exists','update','update\x20cron','stop\x20cron','start','util','path','lodash','moment','jayson/promise','bluebird','../logger','schedule','../../mysqldb','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','Smtp','service','host','port','secure','authentication','auth','pass','\x22%s\x22\x20<%s>','name','user','bcc','format','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','join','../../files/reports','basename','savename','extname','zip','existsSync','status','Sent','message','attachments','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0x8d2a,0x8a));var _0xa8d2=function(_0x52eea8,_0x3e6e1c){_0x52eea8=_0x52eea8-0x0;var _0xcd712e=_0x8d2a[_0x52eea8];return _0xcd712e;};'use strict';var fs=require('fs');var util=require(_0xa8d2('0x0'));var path=require(_0xa8d2('0x1'));var _=require(_0xa8d2('0x2'));var moment=require(_0xa8d2('0x3'));var CronJobManager=require('cron-job-manager');var jayson=require(_0xa8d2('0x4'));var BPromise=require(_0xa8d2('0x5'));var logger=require(_0xa8d2('0x6'))(_0xa8d2('0x7'));var db=require(_0xa8d2('0x8'))['db'];var analyticCustomReportController=require('../../api/analyticCustomReport/analyticCustomReport.controller');var analyticDefaultReportController=require(_0xa8d2('0x9'));var client=jayson[_0xa8d2('0xa')]['http']({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x3b199b,_0x38cbd0){return function(){logger['info'](_0xa8d2('0xb'),_0x3b199b[_0xa8d2('0xc')]);var _0x50f614=!![];var _0x35f433={'tls':{'rejectUnauthorized':![]}};if(_0x3b199b[_0xa8d2('0xd')][_0xa8d2('0xe')][_0xa8d2('0xf')]){_0x35f433['service']=_0x3b199b['MailAccount'][_0xa8d2('0xe')][_0xa8d2('0xf')];}else{_0x35f433[_0xa8d2('0x10')]=_0x3b199b[_0xa8d2('0xd')]['Smtp'][_0xa8d2('0x10')];_0x35f433[_0xa8d2('0x11')]=_0x3b199b[_0xa8d2('0xd')][_0xa8d2('0xe')][_0xa8d2('0x11')];_0x35f433[_0xa8d2('0x12')]=_0x3b199b[_0xa8d2('0xd')][_0xa8d2('0xe')]['secure'];}if(_0x3b199b[_0xa8d2('0xd')][_0xa8d2('0xe')][_0xa8d2('0x13')]){_0x35f433[_0xa8d2('0x14')]={'user':_0x3b199b['MailAccount'][_0xa8d2('0xe')]['user'],'pass':_0x3b199b[_0xa8d2('0xd')]['Smtp'][_0xa8d2('0x15')]};}var _0x4c6cba={'account':_0x35f433,'message':{'from':util['format'](_0xa8d2('0x16'),_0x3b199b[_0xa8d2('0xd')][_0xa8d2('0x17')],_0x3b199b[_0xa8d2('0xd')]['email']||_0x3b199b[_0xa8d2('0xd')]['Smtp'][_0xa8d2('0x18')]),'to':_0x3b199b['email'],'cc':_0x3b199b['cc'],'bcc':_0x3b199b[_0xa8d2('0x19')],'subject':util[_0xa8d2('0x1a')](_0xa8d2('0x1b'),_0x38cbd0[_0xa8d2('0x17')],_0x3b199b[_0xa8d2('0x1c')],_0x3b199b[_0xa8d2('0x1d')])}};var _0x434122=path[_0xa8d2('0x1e')](__dirname,_0xa8d2('0x1f'));var _0x41673f=_0x38cbd0['savename'];var _0x5cbdf9=util[_0xa8d2('0x1a')]('%s.%s',path[_0xa8d2('0x20')](_0x38cbd0[_0xa8d2('0x21')],path[_0xa8d2('0x22')](_0x38cbd0[_0xa8d2('0x21')])),_0xa8d2('0x23'));var _0x78e727=path[_0xa8d2('0x1e')](_0x434122,_0x41673f);var _0x5ef378=path[_0xa8d2('0x1e')](_0x434122,_0x5cbdf9);if(fs[_0xa8d2('0x24')](_0x78e727)){_0x38cbd0[_0xa8d2('0x25')]=_0xa8d2('0x26');_0x4c6cba[_0xa8d2('0x27')][_0xa8d2('0x28')]=[{'filename':_0x41673f,'path':_0x78e727}];_0x4c6cba[_0xa8d2('0x27')][_0xa8d2('0x29')]=util[_0xa8d2('0x1a')](_0xa8d2('0x2a'),JSON[_0xa8d2('0x2b')](_0x38cbd0,null,0x2));}else if(fs[_0xa8d2('0x24')](_0x5ef378)){_0x38cbd0[_0xa8d2('0x25')]='Sent';_0x4c6cba['message'][_0xa8d2('0x28')]=[{'filename':_0x5cbdf9,'path':_0x5ef378}];}else{_0x4c6cba[_0xa8d2('0x27')]['text']=_0xa8d2('0x2c');if(!_0x3b199b['sendIfEmpty']){_0x50f614=![];logger[_0xa8d2('0x2d')](_0xa8d2('0x2e'));}}if(_0x50f614){return client['request'](_0xa8d2('0x2f'),_0x4c6cba)[_0xa8d2('0x30')](function(_0x575737){if(_0x575737[_0xa8d2('0x31')]){return logger[_0xa8d2('0x31')]('error\x20mail',JSON['stringify'](_0x575737));}return logger[_0xa8d2('0x2d')]('email\x20sent');})[_0xa8d2('0x32')](function(_0x501a46){return logger['error'](_0xa8d2('0x33'),JSON[_0xa8d2('0x2b')](_0x501a46));});}};}function handleError(){return function(_0x508c51){return logger[_0xa8d2('0x31')](JSON[_0xa8d2('0x2b')](_0x508c51));};}function handleResult(_0x405012){return function(_0xb52f46){logger[_0xa8d2('0x2d')](_0xa8d2('0x34'),JSON[_0xa8d2('0x2b')](_0xb52f46));if(_0x405012[_0xa8d2('0xd')]&&_0x405012['MailAccount'][_0xa8d2('0xe')]&&!_[_0xa8d2('0x35')](_0x405012[_0xa8d2('0xc')])){setTimeout(handleSendEmail(_0x405012,_0xb52f46),0x3c*0x3e8);}};}function handleJob(_0x56e2f6){return function(){try{if(_[_0xa8d2('0x35')](_0x56e2f6[_0xa8d2('0x1c')])){return logger[_0xa8d2('0x2d')](_0xa8d2('0x36'));}if(_[_0xa8d2('0x35')](_0x56e2f6[_0xa8d2('0x1d')])){return logger['info']('subtractUnit\x20null\x20or\x20undefined');}var _0x3e1758={'startDate':moment()[_0xa8d2('0x37')](_0x56e2f6[_0xa8d2('0x1c')],_0x56e2f6[_0xa8d2('0x1d')])[_0xa8d2('0x1a')](_0xa8d2('0x38')),'endDate':moment()[_0xa8d2('0x1a')](_0xa8d2('0x38')),'type':_0xa8d2('0x39'),'output':_0x56e2f6[_0xa8d2('0x3a')],'name':_0x56e2f6[_0xa8d2('0x17')]};if(!_[_0xa8d2('0x35')](_0x56e2f6[_0xa8d2('0x3b')])){logger['info'](_0xa8d2('0x3c'),_0x56e2f6[_0xa8d2('0x3b')]);return analyticDefaultReportController[_0xa8d2('0x3d')]({'id':_0x56e2f6[_0xa8d2('0x3b')]},_0x3e1758)[_0xa8d2('0x30')](handleResult(_0x56e2f6))[_0xa8d2('0x32')](handleError());}if(!_[_0xa8d2('0x35')](_0x56e2f6[_0xa8d2('0x3e')])){logger['info']('exec\x20custom\x20report\x20id:%s',_0x56e2f6[_0xa8d2('0x3e')]);return analyticCustomReportController['runReport']({'id':_0x56e2f6[_0xa8d2('0x3e')]},_0x3e1758)['then'](handleResult(_0x56e2f6))['catch'](handleError());}}catch(_0x3aba82){logger[_0xa8d2('0x31')](JSON['stringify'](_0x3aba82));}return logger[_0xa8d2('0x2d')](_0xa8d2('0x3f'));};}function getJobs(_0x2b973e){var _0x2b793e={};if(_0x2b973e){_0x2b793e['id']=_0x2b973e;}return db[_0xa8d2('0x40')][_0xa8d2('0x41')]({'where':_0x2b793e,'include':[{'model':db[_0xa8d2('0xd')],'attributes':['id','name',_0xa8d2('0xc')],'include':[{'model':db[_0xa8d2('0x42')],'as':'Smtp'}]}]})[_0xa8d2('0x30')](function(_0x325935){var _0x4d1c34=_[_0xa8d2('0x43')](manager[_0xa8d2('0x44')]);var _0x2019eb=_['map'](_0x325935,function(_0x3eb9cd){return _0x3eb9cd['id']['toString']();});var _0x28453c=_[_0xa8d2('0x45')](_0x325935,function(_0x5b1966){return _0x5b1966['id'][_0xa8d2('0x46')]();});var _0x29c8dd=_0x2b973e?_0x2019eb:_[_0xa8d2('0x47')](_0x2019eb,_0x4d1c34);var _0x505d55=_['intersection'](_0x2019eb,_0x4d1c34);var _0x487629=_[_0xa8d2('0x47')](_0x4d1c34,_0x2019eb);var _0x4e55b5;var _0x3db09c;for(_0x4e55b5=0x0;_0x4e55b5<_0x487629[_0xa8d2('0x48')]&&!_0x2b973e;_0x4e55b5+=0x1){_0x3db09c=_0x487629[_0x4e55b5][_0xa8d2('0x46')]();if(manager['exists'](_0x3db09c)){manager[_0xa8d2('0x49')](_0x3db09c);manager[_0xa8d2('0x4a')](_0x3db09c);logger[_0xa8d2('0x2d')](_0xa8d2('0x4b'),_0x3db09c);}}logger[_0xa8d2('0x2d')](_0xa8d2('0x4c'),JSON[_0xa8d2('0x2b')](_0x29c8dd));for(_0x4e55b5=0x0;_0x4e55b5<_0x29c8dd['length'];_0x4e55b5+=0x1){_0x3db09c=_0x29c8dd[_0x4e55b5]['toString']();logger[_0xa8d2('0x2d')]('index',_0x3db09c);if(_0x2b973e){logger[_0xa8d2('0x2d')]('my\x20id',_0x2b973e);logger[_0xa8d2('0x2d')](JSON[_0xa8d2('0x2b')](_0x28453c[_0x3db09c]));BPromise[_0xa8d2('0x4d')]()[_0xa8d2('0x30')](handleJob(_0x28453c[_0x3db09c]));logger[_0xa8d2('0x2d')](_0xa8d2('0x4e'),_0x28453c[_0x3db09c]['name'],_0x28453c[_0x3db09c][_0xa8d2('0x4f')]);}else if(_0x28453c[_0x3db09c]['cron']&&_0x28453c[_0x3db09c][_0xa8d2('0x50')]&&moment()[_0xa8d2('0x51')](_0x28453c[_0x3db09c][_0xa8d2('0x52')],_0x28453c[_0x3db09c][_0xa8d2('0x53')])){manager[_0xa8d2('0x54')](_0x3db09c,_0x28453c[_0x3db09c][_0xa8d2('0x4f')],handleJob(_0x28453c[_0x3db09c]));manager['start'](_0x3db09c);logger['info'](_0xa8d2('0x55'),_0x28453c[_0x3db09c][_0xa8d2('0x17')],_0x28453c[_0x3db09c]['cron']);}else if(manager[_0xa8d2('0x56')](_0x3db09c)){manager[_0xa8d2('0x49')](_0x3db09c);manager['deleteJob'](_0x3db09c);logger[_0xa8d2('0x2d')]('stop\x20cron',_0x28453c[_0x3db09c][_0xa8d2('0x17')],_0x28453c[_0x3db09c][_0xa8d2('0x4f')]);}}for(_0x4e55b5=0x0,_0x3db09c;_0x4e55b5<_0x505d55[_0xa8d2('0x48')]&&!_0x2b973e;_0x4e55b5+=0x1){_0x3db09c=_0x505d55[_0x4e55b5]['toString']();if(manager[_0xa8d2('0x56')](_0x3db09c)){if(_0x28453c[_0x3db09c][_0xa8d2('0x4f')]&&_0x28453c[_0x3db09c][_0xa8d2('0x50')]&&moment()['isBetween'](_0x28453c[_0x3db09c][_0xa8d2('0x52')],_0x28453c[_0x3db09c][_0xa8d2('0x53')])){manager[_0xa8d2('0x57')](_0x3db09c,_0x28453c[_0x3db09c]['cron'],handleJob(_0x28453c[_0x3db09c]));logger[_0xa8d2('0x2d')](_0xa8d2('0x58'),_0x28453c[_0x3db09c][_0xa8d2('0x17')],_0x28453c[_0x3db09c]['cron']);}else{manager['stop'](_0x3db09c);manager[_0xa8d2('0x4a')](_0x3db09c);logger[_0xa8d2('0x2d')](_0xa8d2('0x59'),_0x28453c[_0x3db09c]['name'],_0x28453c[_0x3db09c][_0xa8d2('0x4f')]);}}}})[_0xa8d2('0x32')](function(_0x57d876){logger[_0xa8d2('0x31')](JSON[_0xa8d2('0x2b')](_0x57d876));});}exports['run']=function(_0x29cfb2){return getJobs(_0x29cfb2);};exports[_0xa8d2('0x5a')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0x3ccb=['keys','jobs','map','toString','keyBy','difference','intersection','exists','stop','toRun','length','my\x20id','resolve','cron','active','isBetween','endAt','add','start','add\x20cron','deleteJob','stop\x20cron','startAt','update\x20cron','util','path','lodash','moment','jayson/promise','bluebird','../logger','schedule','../../api/analyticCustomReport/analyticCustomReport.controller','client','http','info','email','MailAccount','Smtp','service','host','port','secure','authentication','auth','user','pass','name','bcc','format','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','../../files/reports','savename','%s.%s','basename','extname','zip','join','status','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','attachments','text','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','request','then','error','error\x20mail','stringify','email\x20sent','catch','data','isNil','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','runReport','CustomReportId','exec\x20custom\x20report\x20id:%s','no\x20report\x20id','Schedule'];(function(_0x190559,_0x5d0546){var _0x1ec482=function(_0x5ef0a9){while(--_0x5ef0a9){_0x190559['push'](_0x190559['shift']());}};_0x1ec482(++_0x5d0546);}(_0x3ccb,0x71));var _0xb3cc=function(_0x4642ab,_0x289453){_0x4642ab=_0x4642ab-0x0;var _0x28c63b=_0x3ccb[_0x4642ab];return _0x28c63b;};'use strict';var fs=require('fs');var util=require(_0xb3cc('0x0'));var path=require(_0xb3cc('0x1'));var _=require(_0xb3cc('0x2'));var moment=require(_0xb3cc('0x3'));var CronJobManager=require('cron-job-manager');var jayson=require(_0xb3cc('0x4'));var BPromise=require(_0xb3cc('0x5'));var logger=require(_0xb3cc('0x6'))(_0xb3cc('0x7'));var db=require('../../mysqldb')['db'];var analyticCustomReportController=require(_0xb3cc('0x8'));var analyticDefaultReportController=require('../../api/analyticDefaultReport/analyticDefaultReport.controller');var client=jayson[_0xb3cc('0x9')][_0xb3cc('0xa')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x38f42d,_0x47ea8e){return function(){logger[_0xb3cc('0xb')]('Try\x20to\x20send\x20a\x20mail\x20to',_0x38f42d[_0xb3cc('0xc')]);var _0xedc6f1=!![];var _0x142ff2={'tls':{'rejectUnauthorized':![]}};if(_0x38f42d[_0xb3cc('0xd')][_0xb3cc('0xe')][_0xb3cc('0xf')]){_0x142ff2[_0xb3cc('0xf')]=_0x38f42d[_0xb3cc('0xd')][_0xb3cc('0xe')][_0xb3cc('0xf')];}else{_0x142ff2['host']=_0x38f42d[_0xb3cc('0xd')][_0xb3cc('0xe')][_0xb3cc('0x10')];_0x142ff2[_0xb3cc('0x11')]=_0x38f42d[_0xb3cc('0xd')]['Smtp'][_0xb3cc('0x11')];_0x142ff2['secure']=_0x38f42d[_0xb3cc('0xd')]['Smtp'][_0xb3cc('0x12')];}if(_0x38f42d['MailAccount'][_0xb3cc('0xe')][_0xb3cc('0x13')]){_0x142ff2[_0xb3cc('0x14')]={'user':_0x38f42d[_0xb3cc('0xd')][_0xb3cc('0xe')][_0xb3cc('0x15')],'pass':_0x38f42d[_0xb3cc('0xd')][_0xb3cc('0xe')][_0xb3cc('0x16')]};}var _0x20baa8={'account':_0x142ff2,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0x38f42d['MailAccount'][_0xb3cc('0x17')],_0x38f42d[_0xb3cc('0xd')][_0xb3cc('0xc')]||_0x38f42d['MailAccount']['Smtp'][_0xb3cc('0x15')]),'to':_0x38f42d[_0xb3cc('0xc')],'cc':_0x38f42d['cc'],'bcc':_0x38f42d[_0xb3cc('0x18')],'subject':util[_0xb3cc('0x19')](_0xb3cc('0x1a'),_0x47ea8e[_0xb3cc('0x17')],_0x38f42d[_0xb3cc('0x1b')],_0x38f42d[_0xb3cc('0x1c')])}};var _0x25a977=path['join'](__dirname,_0xb3cc('0x1d'));var _0x1416c1=_0x47ea8e[_0xb3cc('0x1e')];var _0x23c459=util[_0xb3cc('0x19')](_0xb3cc('0x1f'),path[_0xb3cc('0x20')](_0x47ea8e['savename'],path[_0xb3cc('0x21')](_0x47ea8e['savename'])),_0xb3cc('0x22'));var _0x1eb5cd=path[_0xb3cc('0x23')](_0x25a977,_0x1416c1);var _0xda4686=path['join'](_0x25a977,_0x23c459);if(fs['existsSync'](_0x1eb5cd)){_0x47ea8e[_0xb3cc('0x24')]='Sent';_0x20baa8['message']['attachments']=[{'filename':_0x1416c1,'path':_0x1eb5cd}];_0x20baa8[_0xb3cc('0x25')]['text']=util[_0xb3cc('0x19')](_0xb3cc('0x26'),JSON['stringify'](_0x47ea8e,null,0x2));}else if(fs['existsSync'](_0xda4686)){_0x47ea8e[_0xb3cc('0x24')]=_0xb3cc('0x27');_0x20baa8[_0xb3cc('0x25')][_0xb3cc('0x28')]=[{'filename':_0x23c459,'path':_0xda4686}];}else{_0x20baa8['message'][_0xb3cc('0x29')]=_0xb3cc('0x2a');if(!_0x38f42d[_0xb3cc('0x2b')]){_0xedc6f1=![];logger[_0xb3cc('0xb')]('empty\x20file,\x20email\x20not\x20sent');}}if(_0xedc6f1){return client[_0xb3cc('0x2c')]('SendMail',_0x20baa8)[_0xb3cc('0x2d')](function(_0x497219){if(_0x497219[_0xb3cc('0x2e')]){return logger[_0xb3cc('0x2e')](_0xb3cc('0x2f'),JSON[_0xb3cc('0x30')](_0x497219));}return logger[_0xb3cc('0xb')](_0xb3cc('0x31'));})[_0xb3cc('0x32')](function(_0x283891){return logger['error']('error\x20mail',JSON[_0xb3cc('0x30')](_0x283891));});}};}function handleError(){return function(_0x32e608){return logger[_0xb3cc('0x2e')](JSON['stringify'](_0x32e608));};}function handleResult(_0x2d6c27){return function(_0x96d07e){logger[_0xb3cc('0xb')](_0xb3cc('0x33'),JSON[_0xb3cc('0x30')](_0x96d07e));if(_0x2d6c27[_0xb3cc('0xd')]&&_0x2d6c27[_0xb3cc('0xd')][_0xb3cc('0xe')]&&!_[_0xb3cc('0x34')](_0x2d6c27[_0xb3cc('0xc')])){setTimeout(handleSendEmail(_0x2d6c27,_0x96d07e),0x3c*0x3e8);}};}function handleJob(_0x30bbb4){return function(){try{if(_[_0xb3cc('0x34')](_0x30bbb4['subtractNumber'])){return logger[_0xb3cc('0xb')](_0xb3cc('0x35'));}if(_['isNil'](_0x30bbb4[_0xb3cc('0x1c')])){return logger['info'](_0xb3cc('0x36'));}var _0x3a97ba={'startDate':moment()[_0xb3cc('0x37')](_0x30bbb4[_0xb3cc('0x1b')],_0x30bbb4[_0xb3cc('0x1c')])[_0xb3cc('0x19')]('YYYY-MM-DD\x20HH:mm:ss'),'endDate':moment()[_0xb3cc('0x19')](_0xb3cc('0x38')),'type':_0xb3cc('0x39'),'output':_0x30bbb4[_0xb3cc('0x3a')],'name':_0x30bbb4['name']};if(!_['isNil'](_0x30bbb4[_0xb3cc('0x3b')])){logger[_0xb3cc('0xb')]('exec\x20defaul\x20report\x20id:%s',_0x30bbb4[_0xb3cc('0x3b')]);return analyticDefaultReportController[_0xb3cc('0x3c')]({'id':_0x30bbb4[_0xb3cc('0x3b')]},_0x3a97ba)[_0xb3cc('0x2d')](handleResult(_0x30bbb4))[_0xb3cc('0x32')](handleError());}if(!_[_0xb3cc('0x34')](_0x30bbb4[_0xb3cc('0x3d')])){logger[_0xb3cc('0xb')](_0xb3cc('0x3e'),_0x30bbb4[_0xb3cc('0x3d')]);return analyticCustomReportController[_0xb3cc('0x3c')]({'id':_0x30bbb4[_0xb3cc('0x3d')]},_0x3a97ba)['then'](handleResult(_0x30bbb4))['catch'](handleError());}}catch(_0x3bb867){logger[_0xb3cc('0x2e')](JSON[_0xb3cc('0x30')](_0x3bb867));}return logger[_0xb3cc('0xb')](_0xb3cc('0x3f'));};}function getJobs(_0x617acb){var _0x423bef={};if(_0x617acb){_0x423bef['id']=_0x617acb;}return db[_0xb3cc('0x40')]['findAll']({'where':_0x423bef,'include':[{'model':db[_0xb3cc('0xd')],'attributes':['id','name',_0xb3cc('0xc')],'include':[{'model':db['MailServerOut'],'as':_0xb3cc('0xe')}]}]})['then'](function(_0x11fcf8){var _0x151b7f=_[_0xb3cc('0x41')](manager[_0xb3cc('0x42')]);var _0x2b4a70=_[_0xb3cc('0x43')](_0x11fcf8,function(_0x24dea3){return _0x24dea3['id'][_0xb3cc('0x44')]();});var _0x30aa0a=_[_0xb3cc('0x45')](_0x11fcf8,function(_0x3f62d7){return _0x3f62d7['id'][_0xb3cc('0x44')]();});var _0x5956d2=_0x617acb?_0x2b4a70:_[_0xb3cc('0x46')](_0x2b4a70,_0x151b7f);var _0x28d06b=_[_0xb3cc('0x47')](_0x2b4a70,_0x151b7f);var _0x40e179=_[_0xb3cc('0x46')](_0x151b7f,_0x2b4a70);var _0x1f9395;var _0x51b98a;for(_0x1f9395=0x0;_0x1f9395<_0x40e179['length']&&!_0x617acb;_0x1f9395+=0x1){_0x51b98a=_0x40e179[_0x1f9395][_0xb3cc('0x44')]();if(manager[_0xb3cc('0x48')](_0x51b98a)){manager[_0xb3cc('0x49')](_0x51b98a);manager['deleteJob'](_0x51b98a);logger[_0xb3cc('0xb')]('delete\x20cron',_0x51b98a);}}logger[_0xb3cc('0xb')](_0xb3cc('0x4a'),JSON[_0xb3cc('0x30')](_0x5956d2));for(_0x1f9395=0x0;_0x1f9395<_0x5956d2[_0xb3cc('0x4b')];_0x1f9395+=0x1){_0x51b98a=_0x5956d2[_0x1f9395][_0xb3cc('0x44')]();logger[_0xb3cc('0xb')]('index',_0x51b98a);if(_0x617acb){logger[_0xb3cc('0xb')](_0xb3cc('0x4c'),_0x617acb);logger[_0xb3cc('0xb')](JSON[_0xb3cc('0x30')](_0x30aa0a[_0x51b98a]));BPromise[_0xb3cc('0x4d')]()['then'](handleJob(_0x30aa0a[_0x51b98a]));logger[_0xb3cc('0xb')]('run\x20job',_0x30aa0a[_0x51b98a][_0xb3cc('0x17')],_0x30aa0a[_0x51b98a][_0xb3cc('0x4e')]);}else if(_0x30aa0a[_0x51b98a]['cron']&&_0x30aa0a[_0x51b98a][_0xb3cc('0x4f')]&&moment()[_0xb3cc('0x50')](_0x30aa0a[_0x51b98a]['startAt'],_0x30aa0a[_0x51b98a][_0xb3cc('0x51')])){manager[_0xb3cc('0x52')](_0x51b98a,_0x30aa0a[_0x51b98a]['cron'],handleJob(_0x30aa0a[_0x51b98a]));manager[_0xb3cc('0x53')](_0x51b98a);logger[_0xb3cc('0xb')](_0xb3cc('0x54'),_0x30aa0a[_0x51b98a][_0xb3cc('0x17')],_0x30aa0a[_0x51b98a][_0xb3cc('0x4e')]);}else if(manager[_0xb3cc('0x48')](_0x51b98a)){manager[_0xb3cc('0x49')](_0x51b98a);manager[_0xb3cc('0x55')](_0x51b98a);logger[_0xb3cc('0xb')](_0xb3cc('0x56'),_0x30aa0a[_0x51b98a][_0xb3cc('0x17')],_0x30aa0a[_0x51b98a][_0xb3cc('0x4e')]);}}for(_0x1f9395=0x0,_0x51b98a;_0x1f9395<_0x28d06b[_0xb3cc('0x4b')]&&!_0x617acb;_0x1f9395+=0x1){_0x51b98a=_0x28d06b[_0x1f9395][_0xb3cc('0x44')]();if(manager[_0xb3cc('0x48')](_0x51b98a)){if(_0x30aa0a[_0x51b98a]['cron']&&_0x30aa0a[_0x51b98a]['active']&&moment()['isBetween'](_0x30aa0a[_0x51b98a][_0xb3cc('0x57')],_0x30aa0a[_0x51b98a]['endAt'])){manager['update'](_0x51b98a,_0x30aa0a[_0x51b98a][_0xb3cc('0x4e')],handleJob(_0x30aa0a[_0x51b98a]));logger['info'](_0xb3cc('0x58'),_0x30aa0a[_0x51b98a][_0xb3cc('0x17')],_0x30aa0a[_0x51b98a][_0xb3cc('0x4e')]);}else{manager[_0xb3cc('0x49')](_0x51b98a);manager[_0xb3cc('0x55')](_0x51b98a);logger[_0xb3cc('0xb')](_0xb3cc('0x56'),_0x30aa0a[_0x51b98a]['name'],_0x30aa0a[_0x51b98a]['cron']);}}}})['catch'](function(_0x36e628){logger['error'](JSON[_0xb3cc('0x30')](_0x36e628));});}exports['run']=function(_0x2075aa){return getJobs(_0x2075aa);};exports[_0xb3cc('0x53')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file diff --git a/server/config/schedule/transcribe.js b/server/config/schedule/transcribe.js index ee96f05..a057a51 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 _0x81fa=['Settings\x20not\x20available','transcribeAccountId','Transcribe\x20not\x20configured','forEach','push','lodash','aws-sdk','util','bluebird','../../mysqldb','../../config/logger','TranscribeService','getTranscriptionJob','Comprehend','substring','info','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','data2','transcribeRegion','then','[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s','TranscriptionJob','TranscriptionJobStatus','Transcript','TranscriptFileUri','format','[RECORDING:%d]\x20Get\x20transcript','results','transcripts','length','fileText','transcript','update','Sequelize','ValidationError','sentimentAccountId','sentimentRegion','language','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','CloudProvider','findOne','Cloud\x20Provider\x20not\x20available','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','SentimentScore','Positive','Negative','Mixed','Neutral','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','FAILED','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','tempSentiment','Sentiment\x20Analysis\x20not\x20requested','sentiment','bucket','Sentiment','COMPLETED','catch','name','SequelizeValidationError','error','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','findAll','IN_PROGRESS','No\x20transcribe\x20job\x20to\x20check','Setting'];(function(_0x3a6eee,_0xb6077c){var _0x268e2c=function(_0x5d1ec0){while(--_0x5d1ec0){_0x3a6eee['push'](_0x3a6eee['shift']());}};_0x268e2c(++_0xb6077c);}(_0x81fa,0xdd));var _0xa81f=function(_0x17d0ee,_0x410179){_0x17d0ee=_0x17d0ee-0x0;var _0x429bc4=_0x81fa[_0x17d0ee];return _0x429bc4;};var _=require(_0xa81f('0x0'));var AWS=require(_0xa81f('0x1'));var rp=require('request-promise');var util=require(_0xa81f('0x2'));var BPromise=require(_0xa81f('0x3'));var db=require(_0xa81f('0x4'))['db'];var logger=require(_0xa81f('0x5'))('transcribe');function getTranscriptionJob(_0x1c7d2f,_0x202dbf,_0x466875,_0x3a5438){return new Promise(function(_0x1dc233,_0x158719){var _0x3ceca1=new AWS[(_0xa81f('0x6'))]({'accessKeyId':_0x202dbf,'secretAccessKey':_0x1c7d2f,'region':_0x466875});_0x3ceca1[_0xa81f('0x7')]({'TranscriptionJobName':_0x3a5438},function(_0x3447bb,_0x38e313){if(_0x3447bb){return _0x158719(_0x3447bb);}else{return _0x1dc233(_0x38e313);}});});}function sentiment(_0x442db2,_0x49ea5c,_0x4cbd21,_0x28b82f,_0x182ae7){return new Promise(function(_0x57db85,_0x47e978){var _0x5b8b3c=new AWS[(_0xa81f('0x8'))]({'accessKeyId':_0x49ea5c,'secretAccessKey':_0x442db2,'region':_0x4cbd21});_0x5b8b3c['detectSentiment']({'Text':_0x28b82f,'LanguageCode':_0x182ae7[_0xa81f('0x9')](0x0,0x2)},function(_0x5b71ae,_0x3e178b){if(_0x5b71ae){return _0x47e978(_0x5b71ae);}else{return _0x57db85(_0x3e178b);}});});}function checkTranscribeJob(_0x4e7eb8,_0x1aeead,_0x47df65){var _0x3487df;return new BPromise(function(_0x47419e,_0x315558){logger[_0xa81f('0xa')](util['format'](_0xa81f('0xb'),_0x4e7eb8['id'],_0x4e7eb8[_0xa81f('0xc')]));return getTranscriptionJob(_0x47df65[_0xa81f('0xd')],_0x47df65[_0xa81f('0xe')],_0x1aeead[_0xa81f('0xf')],_0x4e7eb8[_0xa81f('0xc')])[_0xa81f('0x10')](function(_0x4e41ba){logger[_0xa81f('0xa')](util['format'](_0xa81f('0x11'),_0x4e7eb8['id'],_0x4e7eb8[_0xa81f('0xc')],_0x4e41ba[_0xa81f('0x12')][_0xa81f('0x13')]));if(!_0x4e7eb8['fileText']){switch(_0x4e41ba[_0xa81f('0x12')][_0xa81f('0x13')]){case'COMPLETED':var _0x588d80={'transcribeStatus':_0x4e41ba['TranscriptionJob'][_0xa81f('0x13')],'fileUri':_0x4e41ba['TranscriptionJob'][_0xa81f('0x14')][_0xa81f('0x15')]};logger[_0xa81f('0xa')](util[_0xa81f('0x16')](_0xa81f('0x17'),_0x4e7eb8['id']));return rp({'uri':_0x4e41ba[_0xa81f('0x12')][_0xa81f('0x14')]['TranscriptFileUri'],'json':!![]})['then'](function(_0x4fa8ad){logger[_0xa81f('0xa')](util[_0xa81f('0x16')]('[RECORDING:%d]\x20Transcript\x20downloaded',_0x4e7eb8['id']));if(_0x4fa8ad&&_0x4fa8ad[_0xa81f('0x18')]&&_0x4fa8ad[_0xa81f('0x18')]['transcripts']&&_0x4fa8ad['results'][_0xa81f('0x19')][_0xa81f('0x1a')]){_0x588d80[_0xa81f('0x1b')]='';for(var _0x45ccd6=0x0;_0x45ccd6<_0x4fa8ad[_0xa81f('0x18')]['transcripts'][_0xa81f('0x1a')];_0x45ccd6++){_0x588d80[_0xa81f('0x1b')]+=_0x4fa8ad[_0xa81f('0x18')][_0xa81f('0x19')][_0x45ccd6][_0xa81f('0x1c')]+'';}}return _0x4e7eb8[_0xa81f('0x1d')](_0x588d80);})[_0xa81f('0x10')](function(){logger[_0xa81f('0xa')](util[_0xa81f('0x16')]('[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated',_0x4e7eb8['id']));if(!_0x4e7eb8['tempSentiment']){throw new db[(_0xa81f('0x1e'))][(_0xa81f('0x1f'))]('Sentiment\x20Analysis\x20not\x20requested');}if(!_0x1aeead['sentiment']||!_0x1aeead[_0xa81f('0x20')]||!_0x1aeead[_0xa81f('0x21')]||!_0x1aeead[_0xa81f('0x22')]||!_0x1aeead['bucket']){throw new db['Sequelize']['ValidationError'](_0xa81f('0x23'));}if(!_0x588d80['fileText']){throw new Error(_0xa81f('0x24'));}if(_0x1aeead[_0xa81f('0x20')]===_0x47df65['id']){return _0x47df65;}else{return db[_0xa81f('0x25')][_0xa81f('0x26')]({'where':{'id':_settings[_0xa81f('0x20')]}});}})[_0xa81f('0x10')](function(_0x514450){if(!_0x514450){throw new db['Sequelize'][(_0xa81f('0x1f'))](_0xa81f('0x27'));}if(!_0x514450['data1']||!_0x514450[_0xa81f('0xe')]){throw new db['Sequelize'][(_0xa81f('0x1f'))](_0xa81f('0x28'));}_0x3487df=_0x514450;logger[_0xa81f('0xa')](util[_0xa81f('0x16')](_0xa81f('0x29'),_0x4e7eb8['id']));return sentiment(_0x3487df[_0xa81f('0xd')],_0x3487df[_0xa81f('0xe')],_0x1aeead[_0xa81f('0x21')],_0x588d80[_0xa81f('0x1b')],_0x1aeead[_0xa81f('0x22')]);})['then'](function(_0x432bff){logger[_0xa81f('0xa')](util[_0xa81f('0x16')](_0xa81f('0x2a'),_0x4e7eb8['id']));return _0x4e7eb8[_0xa81f('0x1d')]({'sentiment':_0x432bff['Sentiment'],'sPositive':_0x432bff[_0xa81f('0x2b')][_0xa81f('0x2c')],'sNegative':_0x432bff[_0xa81f('0x2b')][_0xa81f('0x2d')],'sMixed':_0x432bff['SentimentScore'][_0xa81f('0x2e')],'sNeutral':_0x432bff[_0xa81f('0x2b')][_0xa81f('0x2f')]});})[_0xa81f('0x10')](function(){logger['info'](util[_0xa81f('0x16')](_0xa81f('0x30'),_0x4e7eb8['id']));_0x47419e();});case _0xa81f('0x31'):return _0x4e7eb8[_0xa81f('0x1d')]({'transcribeStatus':'FAILED','failureReason':_0x4e41ba[_0xa81f('0x12')]['FailureReason']})[_0xa81f('0x10')](function(){logger['info'](util[_0xa81f('0x16')](_0xa81f('0x30'),_0x4e7eb8['id']));_0x47419e();});default:logger[_0xa81f('0xa')](util['format'](_0xa81f('0x32'),_0x4e7eb8['id']));break;}}else{return BPromise['resolve']()[_0xa81f('0x10')](function(){if(!_0x4e7eb8[_0xa81f('0x33')]){throw new db['Sequelize'][(_0xa81f('0x1f'))](_0xa81f('0x34'));}if(!_0x1aeead[_0xa81f('0x35')]||!_0x1aeead[_0xa81f('0x20')]||!_0x1aeead[_0xa81f('0x21')]||!_0x1aeead[_0xa81f('0x22')]||!_0x1aeead[_0xa81f('0x36')]){throw new db[(_0xa81f('0x1e'))][(_0xa81f('0x1f'))](_0xa81f('0x23'));}if(!_0x4e7eb8[_0xa81f('0x1b')]){throw new Error(_0xa81f('0x24'));}if(_0x1aeead[_0xa81f('0x20')]===_0x47df65['id']){return _0x47df65;}else{return db['CloudProvider'][_0xa81f('0x26')]({'where':{'id':_settings[_0xa81f('0x20')]}});}})[_0xa81f('0x10')](function(_0x2450d9){if(!_0x2450d9){throw new db['Sequelize'][(_0xa81f('0x1f'))](_0xa81f('0x27'));}if(!_0x2450d9[_0xa81f('0xd')]||!_0x2450d9[_0xa81f('0xe')]){throw new db[(_0xa81f('0x1e'))]['ValidationError'](_0xa81f('0x28'));}_0x3487df=_0x2450d9;logger['info'](util[_0xa81f('0x16')]('[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis',_0x4e7eb8['id']));return sentiment(_0x3487df['data1'],_0x3487df[_0xa81f('0xe')],_0x1aeead['sentimentRegion'],_0x4e7eb8[_0xa81f('0x1b')],_0x1aeead[_0xa81f('0x22')]);})[_0xa81f('0x10')](function(_0x430364){logger[_0xa81f('0xa')](util[_0xa81f('0x16')](_0xa81f('0x2a'),_0x4e7eb8['id']));return _0x4e7eb8[_0xa81f('0x1d')]({'sentiment':_0x430364[_0xa81f('0x37')],'sPositive':_0x430364['SentimentScore'][_0xa81f('0x2c')],'sNegative':_0x430364[_0xa81f('0x2b')][_0xa81f('0x2d')],'sMixed':_0x430364['SentimentScore'][_0xa81f('0x2e')],'sNeutral':_0x430364[_0xa81f('0x2b')][_0xa81f('0x2f')],'transcribeStatus':_0xa81f('0x38')});})[_0xa81f('0x10')](function(){logger[_0xa81f('0xa')](util[_0xa81f('0x16')](_0xa81f('0x30'),_0x4e7eb8['id']));_0x47419e();});}})[_0xa81f('0x39')](function(_0x3aae75){if(_0x3aae75){if(!_0x3aae75[_0xa81f('0x3a')]||_0x3aae75[_0xa81f('0x3a')]!==_0xa81f('0x3b')){logger[_0xa81f('0x3c')](util[_0xa81f('0x16')](_0xa81f('0x3d'),_0x4e7eb8['id']),util[_0xa81f('0x3e')](_0x3aae75,{'showHidden':![],'depth':null}));}}_0x47419e();});});}function checkTranscribe(){var _0x28dda4;var _0x2143d7;var _0x3f9182;return db['VoiceRecording'][_0xa81f('0x3f')]({'where':{'transcribeStatus':_0xa81f('0x40')}})['then'](function(_0x4f88ad){if(!_0x4f88ad||!_0x4f88ad[_0xa81f('0x1a')]){throw new db[(_0xa81f('0x1e'))][(_0xa81f('0x1f'))](_0xa81f('0x41'));}_0x28dda4=_0x4f88ad;return db[_0xa81f('0x42')][_0xa81f('0x26')]({'where':{'id':0x1}});})[_0xa81f('0x10')](function(_0x32ee66){if(!_0x32ee66){throw new db['Sequelize'][(_0xa81f('0x1f'))](_0xa81f('0x43'));}_0x2143d7=_0x32ee66;if(!_0x2143d7['transcribe']||!_0x2143d7[_0xa81f('0x44')]||!_0x2143d7['transcribeRegion']||!_0x2143d7[_0xa81f('0x22')]||!_0x2143d7[_0xa81f('0x36')]){throw new db[(_0xa81f('0x1e'))]['ValidationError'](_0xa81f('0x45'));}return db[_0xa81f('0x25')]['findOne']({'where':{'id':_0x2143d7[_0xa81f('0x44')]}});})[_0xa81f('0x10')](function(_0x111272){if(!_0x111272){throw new db[(_0xa81f('0x1e'))]['ValidationError'](_0xa81f('0x27'));}if(!_0x111272[_0xa81f('0xd')]||!_0x111272[_0xa81f('0xe')]){throw new db[(_0xa81f('0x1e'))][(_0xa81f('0x1f'))](_0xa81f('0x28'));}_0x3f9182=_0x111272;var _0x325be2=[];_0x28dda4[_0xa81f('0x46')](function(_0x21716b){_0x325be2[_0xa81f('0x47')](checkTranscribeJob(_0x21716b,_0x2143d7,_0x3f9182));});return BPromise['all'](_0x325be2);})[_0xa81f('0x39')](function(_0x234a35){if(_0x234a35){if(!_0x234a35[_0xa81f('0x3a')]||_0x234a35[_0xa81f('0x3a')]!=='SequelizeValidationError'){logger[_0xa81f('0x3c')](util[_0xa81f('0x3e')](_0x234a35,{'showHidden':![],'depth':null}));}}});}exports['start']=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file +var _0x21f8=['TranscriptFileUri','Transcript','results','transcripts','transcript','update','[RECORDING:%d]\x20Voice\x20Recording\x20entry\x20updated','tempSentiment','ValidationError','Sentiment\x20Analysis\x20not\x20requested','sentiment','sentimentAccountId','language','Sentiment\x20Analysis\x20not\x20configured','Transcript\x20not\x20available','findOne','then','Cloud\x20Provider\x20not\x20available','Sequelize','[RECORDING:%d]\x20Requesting\x20sentiment\x20analysis','Sentiment','SentimentScore','Negative','Mixed','Neutral','FAILED','[RECORDING:%d]\x20Transcript\x20Job\x20status\x20not\x20managed','resolve','CloudProvider','Cloud\x20Provider\x20not\x20configured','[RECORDING:%d]\x20Sentiment\x20Analysis\x20available','name','SequelizeValidationError','[RECORDING:%d]\x20Error\x20running\x20Transcribe\x20&\x20Sentiment\x20Analysis','inspect','VoiceRecording','findAll','IN_PROGRESS','Setting','Settings\x20not\x20available','transcribeAccountId','bucket','push','all','catch','lodash','aws-sdk','request-promise','util','bluebird','../../mysqldb','../../config/logger','TranscribeService','getTranscriptionJob','Comprehend','detectSentiment','substring','info','format','[RECORDING:%d]\x20Get\x20status\x20for\x20transcript\x20job\x20(%s)','transcribeName','data1','data2','transcribeRegion','TranscriptionJob','TranscriptionJobStatus','fileText','COMPLETED'];(function(_0x347d95,_0x2d161b){var _0x1a5e53=function(_0x1e55f8){while(--_0x1e55f8){_0x347d95['push'](_0x347d95['shift']());}};_0x1a5e53(++_0x2d161b);}(_0x21f8,0x71));var _0x821f=function(_0x30c649,_0x2ebbac){_0x30c649=_0x30c649-0x0;var _0x3edfb9=_0x21f8[_0x30c649];return _0x3edfb9;};var _=require(_0x821f('0x0'));var AWS=require(_0x821f('0x1'));var rp=require(_0x821f('0x2'));var util=require(_0x821f('0x3'));var BPromise=require(_0x821f('0x4'));var db=require(_0x821f('0x5'))['db'];var logger=require(_0x821f('0x6'))('transcribe');function getTranscriptionJob(_0x4d5a2d,_0x5ca60a,_0x9d3273,_0xf5dd93){return new Promise(function(_0x3052d6,_0x2a1421){var _0x3cd13a=new AWS[(_0x821f('0x7'))]({'accessKeyId':_0x5ca60a,'secretAccessKey':_0x4d5a2d,'region':_0x9d3273});_0x3cd13a[_0x821f('0x8')]({'TranscriptionJobName':_0xf5dd93},function(_0xfcb0a,_0x4e260d){if(_0xfcb0a){return _0x2a1421(_0xfcb0a);}else{return _0x3052d6(_0x4e260d);}});});}function sentiment(_0x4dcd67,_0x284c6a,_0x15b547,_0x81e2f4,_0x53ce42){return new Promise(function(_0x387056,_0x44e3f3){var _0x101ae7=new AWS[(_0x821f('0x9'))]({'accessKeyId':_0x284c6a,'secretAccessKey':_0x4dcd67,'region':_0x15b547});_0x101ae7[_0x821f('0xa')]({'Text':_0x81e2f4,'LanguageCode':_0x53ce42[_0x821f('0xb')](0x0,0x2)},function(_0x6bea4c,_0xec9f7e){if(_0x6bea4c){return _0x44e3f3(_0x6bea4c);}else{return _0x387056(_0xec9f7e);}});});}function checkTranscribeJob(_0x3eedc4,_0x2aeb4e,_0x4ba2e2){var _0x4f9752;return new BPromise(function(_0x22e1d5,_0x225854){logger[_0x821f('0xc')](util[_0x821f('0xd')](_0x821f('0xe'),_0x3eedc4['id'],_0x3eedc4[_0x821f('0xf')]));return getTranscriptionJob(_0x4ba2e2[_0x821f('0x10')],_0x4ba2e2[_0x821f('0x11')],_0x2aeb4e[_0x821f('0x12')],_0x3eedc4[_0x821f('0xf')])['then'](function(_0x3419ab){logger['info'](util[_0x821f('0xd')]('[RECORDING:%d]\x20Status\x20of\x20transcript\x20job\x20(%s):\x20%s',_0x3eedc4['id'],_0x3eedc4[_0x821f('0xf')],_0x3419ab[_0x821f('0x13')][_0x821f('0x14')]));if(!_0x3eedc4[_0x821f('0x15')]){switch(_0x3419ab['TranscriptionJob'][_0x821f('0x14')]){case _0x821f('0x16'):var _0x499483={'transcribeStatus':_0x3419ab[_0x821f('0x13')]['TranscriptionJobStatus'],'fileUri':_0x3419ab[_0x821f('0x13')]['Transcript'][_0x821f('0x17')]};logger[_0x821f('0xc')](util['format']('[RECORDING:%d]\x20Get\x20transcript',_0x3eedc4['id']));return rp({'uri':_0x3419ab[_0x821f('0x13')][_0x821f('0x18')][_0x821f('0x17')],'json':!![]})['then'](function(_0x3092d8){logger[_0x821f('0xc')](util[_0x821f('0xd')]('[RECORDING:%d]\x20Transcript\x20downloaded',_0x3eedc4['id']));if(_0x3092d8&&_0x3092d8[_0x821f('0x19')]&&_0x3092d8[_0x821f('0x19')]['transcripts']&&_0x3092d8['results']['transcripts']['length']){_0x499483[_0x821f('0x15')]='';for(var _0x4af347=0x0;_0x4af347<_0x3092d8['results'][_0x821f('0x1a')]['length'];_0x4af347++){_0x499483['fileText']+=_0x3092d8[_0x821f('0x19')][_0x821f('0x1a')][_0x4af347][_0x821f('0x1b')]+'';}}return _0x3eedc4[_0x821f('0x1c')](_0x499483);})['then'](function(){logger[_0x821f('0xc')](util[_0x821f('0xd')](_0x821f('0x1d'),_0x3eedc4['id']));if(!_0x3eedc4[_0x821f('0x1e')]){throw new db['Sequelize'][(_0x821f('0x1f'))](_0x821f('0x20'));}if(!_0x2aeb4e[_0x821f('0x21')]||!_0x2aeb4e[_0x821f('0x22')]||!_0x2aeb4e['sentimentRegion']||!_0x2aeb4e[_0x821f('0x23')]||!_0x2aeb4e['bucket']){throw new db['Sequelize'][(_0x821f('0x1f'))](_0x821f('0x24'));}if(!_0x499483[_0x821f('0x15')]){throw new Error(_0x821f('0x25'));}if(_0x2aeb4e[_0x821f('0x22')]===_0x4ba2e2['id']){return _0x4ba2e2;}else{return db['CloudProvider'][_0x821f('0x26')]({'where':{'id':_settings[_0x821f('0x22')]}});}})[_0x821f('0x27')](function(_0x12a47a){if(!_0x12a47a){throw new db['Sequelize'][(_0x821f('0x1f'))](_0x821f('0x28'));}if(!_0x12a47a[_0x821f('0x10')]||!_0x12a47a[_0x821f('0x11')]){throw new db[(_0x821f('0x29'))][(_0x821f('0x1f'))]('Cloud\x20Provider\x20not\x20configured');}_0x4f9752=_0x12a47a;logger[_0x821f('0xc')](util['format'](_0x821f('0x2a'),_0x3eedc4['id']));return sentiment(_0x4f9752[_0x821f('0x10')],_0x4f9752['data2'],_0x2aeb4e['sentimentRegion'],_0x499483[_0x821f('0x15')],_0x2aeb4e[_0x821f('0x23')]);})[_0x821f('0x27')](function(_0x302611){logger[_0x821f('0xc')](util['format']('[RECORDING:%d]\x20Sentiment\x20Analysis\x20available',_0x3eedc4['id']));return _0x3eedc4[_0x821f('0x1c')]({'sentiment':_0x302611[_0x821f('0x2b')],'sPositive':_0x302611[_0x821f('0x2c')]['Positive'],'sNegative':_0x302611[_0x821f('0x2c')][_0x821f('0x2d')],'sMixed':_0x302611[_0x821f('0x2c')][_0x821f('0x2e')],'sNeutral':_0x302611[_0x821f('0x2c')][_0x821f('0x2f')]});})[_0x821f('0x27')](function(){logger['info'](util['format'](_0x821f('0x1d'),_0x3eedc4['id']));_0x22e1d5();});case _0x821f('0x30'):return _0x3eedc4[_0x821f('0x1c')]({'transcribeStatus':_0x821f('0x30'),'failureReason':_0x3419ab[_0x821f('0x13')]['FailureReason']})['then'](function(){logger[_0x821f('0xc')](util[_0x821f('0xd')](_0x821f('0x1d'),_0x3eedc4['id']));_0x22e1d5();});default:logger['info'](util[_0x821f('0xd')](_0x821f('0x31'),_0x3eedc4['id']));break;}}else{return BPromise[_0x821f('0x32')]()['then'](function(){if(!_0x3eedc4[_0x821f('0x1e')]){throw new db[(_0x821f('0x29'))][(_0x821f('0x1f'))](_0x821f('0x20'));}if(!_0x2aeb4e[_0x821f('0x21')]||!_0x2aeb4e[_0x821f('0x22')]||!_0x2aeb4e['sentimentRegion']||!_0x2aeb4e[_0x821f('0x23')]||!_0x2aeb4e['bucket']){throw new db[(_0x821f('0x29'))][(_0x821f('0x1f'))](_0x821f('0x24'));}if(!_0x3eedc4[_0x821f('0x15')]){throw new Error(_0x821f('0x25'));}if(_0x2aeb4e[_0x821f('0x22')]===_0x4ba2e2['id']){return _0x4ba2e2;}else{return db[_0x821f('0x33')][_0x821f('0x26')]({'where':{'id':_settings['sentimentAccountId']}});}})[_0x821f('0x27')](function(_0x603245){if(!_0x603245){throw new db[(_0x821f('0x29'))][(_0x821f('0x1f'))](_0x821f('0x28'));}if(!_0x603245['data1']||!_0x603245[_0x821f('0x11')]){throw new db[(_0x821f('0x29'))][(_0x821f('0x1f'))](_0x821f('0x34'));}_0x4f9752=_0x603245;logger[_0x821f('0xc')](util[_0x821f('0xd')](_0x821f('0x2a'),_0x3eedc4['id']));return sentiment(_0x4f9752[_0x821f('0x10')],_0x4f9752[_0x821f('0x11')],_0x2aeb4e['sentimentRegion'],_0x3eedc4[_0x821f('0x15')],_0x2aeb4e['language']);})[_0x821f('0x27')](function(_0x495fe6){logger[_0x821f('0xc')](util['format'](_0x821f('0x35'),_0x3eedc4['id']));return _0x3eedc4[_0x821f('0x1c')]({'sentiment':_0x495fe6['Sentiment'],'sPositive':_0x495fe6[_0x821f('0x2c')]['Positive'],'sNegative':_0x495fe6[_0x821f('0x2c')][_0x821f('0x2d')],'sMixed':_0x495fe6['SentimentScore'][_0x821f('0x2e')],'sNeutral':_0x495fe6[_0x821f('0x2c')]['Neutral'],'transcribeStatus':_0x821f('0x16')});})['then'](function(){logger[_0x821f('0xc')](util[_0x821f('0xd')](_0x821f('0x1d'),_0x3eedc4['id']));_0x22e1d5();});}})['catch'](function(_0x21f55c){if(_0x21f55c){if(!_0x21f55c[_0x821f('0x36')]||_0x21f55c['name']!==_0x821f('0x37')){logger['error'](util[_0x821f('0xd')](_0x821f('0x38'),_0x3eedc4['id']),util[_0x821f('0x39')](_0x21f55c,{'showHidden':![],'depth':null}));}}_0x22e1d5();});});}function checkTranscribe(){var _0x1fbec4;var _0x1b7eaf;var _0x541a2e;return db[_0x821f('0x3a')][_0x821f('0x3b')]({'where':{'transcribeStatus':_0x821f('0x3c')}})[_0x821f('0x27')](function(_0x58cb21){if(!_0x58cb21||!_0x58cb21['length']){throw new db[(_0x821f('0x29'))]['ValidationError']('No\x20transcribe\x20job\x20to\x20check');}_0x1fbec4=_0x58cb21;return db[_0x821f('0x3d')][_0x821f('0x26')]({'where':{'id':0x1}});})[_0x821f('0x27')](function(_0x37715d){if(!_0x37715d){throw new db[(_0x821f('0x29'))]['ValidationError'](_0x821f('0x3e'));}_0x1b7eaf=_0x37715d;if(!_0x1b7eaf['transcribe']||!_0x1b7eaf[_0x821f('0x3f')]||!_0x1b7eaf['transcribeRegion']||!_0x1b7eaf[_0x821f('0x23')]||!_0x1b7eaf[_0x821f('0x40')]){throw new db[(_0x821f('0x29'))]['ValidationError']('Transcribe\x20not\x20configured');}return db[_0x821f('0x33')][_0x821f('0x26')]({'where':{'id':_0x1b7eaf[_0x821f('0x3f')]}});})['then'](function(_0x386093){if(!_0x386093){throw new db[(_0x821f('0x29'))][(_0x821f('0x1f'))](_0x821f('0x28'));}if(!_0x386093[_0x821f('0x10')]||!_0x386093['data2']){throw new db[(_0x821f('0x29'))][(_0x821f('0x1f'))](_0x821f('0x34'));}_0x541a2e=_0x386093;var _0x35dbb5=[];_0x1fbec4['forEach'](function(_0x149919){_0x35dbb5[_0x821f('0x41')](checkTranscribeJob(_0x149919,_0x1b7eaf,_0x541a2e));});return BPromise[_0x821f('0x42')](_0x35dbb5);})[_0x821f('0x43')](function(_0x10e9ef){if(_0x10e9ef){if(!_0x10e9ef['name']||_0x10e9ef[_0x821f('0x36')]!=='SequelizeValidationError'){logger['error'](util['inspect'](_0x10e9ef,{'showHidden':![],'depth':null}));}}});}exports['start']=function(){setInterval(function(){return checkTranscribe();},0x3c*0x3e8);return checkTranscribe();}; \ No newline at end of file diff --git a/server/config/schedule/whatsapp.js b/server/config/schedule/whatsapp.js index 1dab8c1..a350685 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 _0xb838=['[WHATSAPP]\x20Interactions\x20to\x20close:','join','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','then','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','catch','[WHATSAPP]\x20Error\x20closing\x20interactions','lodash','moment','ioredis','util','../../config/environment','../../mysqldb','../logger','schedule','redis','defaults','localhost','socket.io-emitter','findAll','subtract','length','map','info'];(function(_0x2bf04b,_0x54cda4){var _0x55ca59=function(_0x323dff){while(--_0x323dff){_0x2bf04b['push'](_0x2bf04b['shift']());}};_0x55ca59(++_0x54cda4);}(_0xb838,0x14b));var _0x8b83=function(_0x19825b,_0x15a4f3){_0x19825b=_0x19825b-0x0;var _0xd79ee=_0xb838[_0x19825b];return _0xd79ee;};'use strict';var _=require(_0x8b83('0x0'));var moment=require(_0x8b83('0x1'));var Redis=require(_0x8b83('0x2'));var util=require(_0x8b83('0x3'));var config=require(_0x8b83('0x4'));var db=require(_0x8b83('0x5'))['db'];var logger=require(_0x8b83('0x6'))(_0x8b83('0x7'));config[_0x8b83('0x8')]=_[_0x8b83('0x9')](config[_0x8b83('0x8')],{'host':_0x8b83('0xa'),'port':0x18eb});var io=require(_0x8b83('0xb'))(new Redis(config['redis']));function closeInteractions(){var _0x72764b=[];return db['WhatsappInteraction'][_0x8b83('0xc')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x8b83('0xd')](0x18,'hours')}}})['then'](function(_0x191d3f){if(_0x191d3f&&_0x191d3f[_0x8b83('0xe')]){_0x72764b=_[_0x8b83('0xf')](_0x191d3f||[],'id');logger[_0x8b83('0x10')](_0x8b83('0x11'),_0x72764b[_0x8b83('0x12')]());return db['WhatsappInteraction'][_0x8b83('0x13')]({'closeReason':_0x8b83('0x14'),'disposition':_0x8b83('0x15'),'closed':!![],'closedAt':moment()[_0x8b83('0x16')](_0x8b83('0x17'))},{'where':{'id':_0x72764b}});}})[_0x8b83('0x18')](function(){if(_0x72764b&&_0x72764b[_0x8b83('0xe')]){logger[_0x8b83('0x10')](_0x8b83('0x19'),_0x72764b[_0x8b83('0x12')]());for(var _0x4502d0=0x0;_0x4502d0<_0x72764b[_0x8b83('0xe')];_0x4502d0++){io[_0x8b83('0x1a')]('whatsappInteraction:update',{'id':_0x72764b[_0x4502d0],'closed':!![]});}}})[_0x8b83('0x1b')](function(_0x406517){logger['error'](_0x8b83('0x1c'),_0x406517?util['inspect'](_0x406517,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x4d18=['defaults','redis','localhost','WhatsappInteraction','findAll','lastMsgAt','subtract','then','length','map','info','[WHATSAPP]\x20Interactions\x20to\x20close:','join','update','format','YYYY-MM-DD\x20HH:mm:ss','[WHATSAPP]\x20Sending\x20updates\x20for\x20interactions:','emit','whatsappInteraction:update','catch','error','[WHATSAPP]\x20Error\x20closing\x20interactions','lodash','moment','ioredis','util','../../config/environment','../../mysqldb','../logger','schedule'];(function(_0x2c0dc0,_0x19900d){var _0x4c0990=function(_0x530791){while(--_0x530791){_0x2c0dc0['push'](_0x2c0dc0['shift']());}};_0x4c0990(++_0x19900d);}(_0x4d18,0x19c));var _0x84d1=function(_0x28fd34,_0x2cf980){_0x28fd34=_0x28fd34-0x0;var _0xb5591b=_0x4d18[_0x28fd34];return _0xb5591b;};'use strict';var _=require(_0x84d1('0x0'));var moment=require(_0x84d1('0x1'));var Redis=require(_0x84d1('0x2'));var util=require(_0x84d1('0x3'));var config=require(_0x84d1('0x4'));var db=require(_0x84d1('0x5'))['db'];var logger=require(_0x84d1('0x6'))(_0x84d1('0x7'));config['redis']=_[_0x84d1('0x8')](config[_0x84d1('0x9')],{'host':_0x84d1('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x84d1('0x9')]));function closeInteractions(){var _0x50e12c=[];return db[_0x84d1('0xb')][_0x84d1('0xc')]({'raw':!![],'attributes':['id',_0x84d1('0xd')],'where':{'closed':![],'lastMsgDirection':'in','lastMsgAt':{'$lt':moment()[_0x84d1('0xe')](0x18,'hours')}}})[_0x84d1('0xf')](function(_0x29ce93){if(_0x29ce93&&_0x29ce93[_0x84d1('0x10')]){_0x50e12c=_[_0x84d1('0x11')](_0x29ce93||[],'id');logger[_0x84d1('0x12')](_0x84d1('0x13'),_0x50e12c[_0x84d1('0x14')]());return db[_0x84d1('0xb')][_0x84d1('0x15')]({'closeReason':'system','disposition':'timeout','closed':!![],'closedAt':moment()[_0x84d1('0x16')](_0x84d1('0x17'))},{'where':{'id':_0x50e12c}});}})['then'](function(){if(_0x50e12c&&_0x50e12c['length']){logger[_0x84d1('0x12')](_0x84d1('0x18'),_0x50e12c[_0x84d1('0x14')]());for(var _0x102c45=0x0;_0x102c45<_0x50e12c[_0x84d1('0x10')];_0x102c45++){io[_0x84d1('0x19')](_0x84d1('0x1a'),{'id':_0x50e12c[_0x102c45],'closed':!![]});}}})[_0x84d1('0x1b')](function(_0x287bbc){logger[_0x84d1('0x1c')](_0x84d1('0x1d'),_0x287bbc?util['inspect'](_0x287bbc,{'showHidden':![],'depth':null}):'');});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/seedContact.js b/server/config/seedContact.js index 59853c4..f296bb6 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3c48=['CmContact','destroy','bulkCreate','log','finished\x20populating','contacts1','CmHopper','then','hopper1','contacts2','hopper2','util','../mysqldb','push','Innocenzo','Biondo','@xcally.com','now','innocenzo.biondo'];(function(_0x5ee367,_0x5aff0b){var _0x145dde=function(_0x1a23d0){while(--_0x1a23d0){_0x5ee367['push'](_0x5ee367['shift']());}};_0x145dde(++_0x5aff0b);}(_0x3c48,0xb6));var _0x83c4=function(_0xd9856,_0x197cdc){_0xd9856=_0xd9856-0x0;var _0x21f785=_0x3c48[_0xd9856];return _0x21f785;};'use strict';var util=require(_0x83c4('0x0'));var db=require(_0x83c4('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x83c4('0x2')]({'id':i,'firstName':_0x83c4('0x3')+i,'lastName':_0x83c4('0x4')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0x83c4('0x5')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper['push']({'id':i,'active':![],'scheduledat':Date[_0x83c4('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x83c4('0x6')](),'updatedAt':Date[_0x83c4('0x6')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2['push']({'id':i,'firstName':_0x83c4('0x3')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0x83c4('0x7')+i+'@xcally.com'});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2['push']({'id':i,'active':![],'scheduledat':Date[_0x83c4('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0x83c4('0x6')]()});}db[_0x83c4('0x8')][_0x83c4('0x9')]({'where':{}})['then'](function(){return db[_0x83c4('0x8')][_0x83c4('0xa')](contacts);})['then'](function(){console[_0x83c4('0xb')](_0x83c4('0xc'),_0x83c4('0xd'));return db[_0x83c4('0xe')][_0x83c4('0x9')]({'where':{}});})[_0x83c4('0xf')](function(){return db['CmHopper'][_0x83c4('0xa')](hopper);})['then'](function(){console['log'](_0x83c4('0xc'),_0x83c4('0x10'));return db['CmContact'][_0x83c4('0xa')](contacts2);})[_0x83c4('0xf')](function(){console[_0x83c4('0xb')]('finished\x20populating',_0x83c4('0x11'));return db['CmHopper'][_0x83c4('0xa')](hopper2);})[_0x83c4('0xf')](function(){console[_0x83c4('0xb')](_0x83c4('0xc'),_0x83c4('0x12'));})['catch'](function(_0x2dcd41){console['log'](_0x2dcd41);}); \ No newline at end of file +var _0x0130=['catch','util','../mysqldb','push','Innocenzo','Biondo','innocenzo.biondo','now','@xcally.com','CmContact','destroy','bulkCreate','then','log','finished\x20populating','contacts1','CmHopper','hopper1','contacts2','hopper2'];(function(_0x31e29a,_0x349c9b){var _0x32d892=function(_0x41cc86){while(--_0x41cc86){_0x31e29a['push'](_0x31e29a['shift']());}};_0x32d892(++_0x349c9b);}(_0x0130,0xf1));var _0x0013=function(_0x307d86,_0x9264f2){_0x307d86=_0x307d86-0x0;var _0x361745=_0x0130[_0x307d86];return _0x361745;};'use strict';var util=require(_0x0013('0x0'));var db=require(_0x0013('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x0013('0x2')]({'id':i,'firstName':_0x0013('0x3')+i,'lastName':_0x0013('0x4')+i,'phone':0xf879fb460+i,'email':_0x0013('0x5')+i+'@xcally.com'});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x0013('0x2')]({'id':i,'active':![],'scheduledat':Date[_0x0013('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x0013('0x6')](),'updatedAt':Date[_0x0013('0x6')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2['push']({'id':i,'firstName':_0x0013('0x3')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0x0013('0x5')+i+_0x0013('0x7')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x0013('0x2')]({'id':i,'active':![],'scheduledat':Date[_0x0013('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x0013('0x6')](),'updatedAt':Date[_0x0013('0x6')]()});}db[_0x0013('0x8')][_0x0013('0x9')]({'where':{}})['then'](function(){return db[_0x0013('0x8')][_0x0013('0xa')](contacts);})[_0x0013('0xb')](function(){console[_0x0013('0xc')](_0x0013('0xd'),_0x0013('0xe'));return db[_0x0013('0xf')][_0x0013('0x9')]({'where':{}});})[_0x0013('0xb')](function(){return db[_0x0013('0xf')][_0x0013('0xa')](hopper);})[_0x0013('0xb')](function(){console['log'](_0x0013('0xd'),_0x0013('0x10'));return db['CmContact'][_0x0013('0xa')](contacts2);})[_0x0013('0xb')](function(){console['log'](_0x0013('0xd'),_0x0013('0x11'));return db[_0x0013('0xf')][_0x0013('0xa')](hopper2);})[_0x0013('0xb')](function(){console[_0x0013('0xc')](_0x0013('0xd'),_0x0013('0x12'));})[_0x0013('0x13')](function(_0x4bbb9c){console['log'](_0x4bbb9c);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index 2e50054..2578cd2 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8a9c=['udp','wss','ulaw','yes','/etc/pki/tls/certs/motion.crt','actpass','\x22%s\x22\x20<%s>','User','bulkCreate','then','log','add\x20user','push','format','%s%s','agent','password','friend'];(function(_0x15748f,_0x269098){var _0x223188=function(_0x5b388f){while(--_0x5b388f){_0x15748f['push'](_0x15748f['shift']());}};_0x223188(++_0x269098);}(_0x8a9c,0x66));var _0xc8a9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8a9c[_0x3dd15e];return _0x231fd0;};'use strict';var util=require('util');var db=require('../mysqldb')['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0xc8a9('0x0')]({'name':util[_0xc8a9('0x1')](_0xc8a9('0x2'),_0xc8a9('0x3'),i),'fullname':util[_0xc8a9('0x1')](_0xc8a9('0x2'),'agent',i),'email':util['format']('%s%s@xcally.com',_0xc8a9('0x3'),i),'role':'agent','password':_0xc8a9('0x4'),'internal':0xfa0+i,'type':_0xc8a9('0x5'),'transport':[_0xc8a9('0x6'),'ws',_0xc8a9('0x7')],'disallow':['all'],'allow':[_0xc8a9('0x8')],'defaultuser':util[_0xc8a9('0x1')](_0xc8a9('0x2'),_0xc8a9('0x3'),i),'encryption':_0xc8a9('0x9'),'avpf':_0xc8a9('0x9'),'force_avp':_0xc8a9('0x9'),'icesupport':_0xc8a9('0x9'),'dtlsenable':_0xc8a9('0x9'),'dtlsverify':'no','dtlscertfile':_0xc8a9('0xa'),'dtlsprivatekey':'/etc/pki/tls/private/motion.key','dtlssetup':_0xc8a9('0xb'),'callerid':util['format'](_0xc8a9('0xc'),util[_0xc8a9('0x1')]('%s%s','agent',i),0xfa0+i)});}db[_0xc8a9('0xd')][_0xc8a9('0xe')](users)[_0xc8a9('0xf')](function(){console[_0xc8a9('0x10')](_0xc8a9('0x11'));})['catch'](function(_0x1b27cb){console['log'](_0x1b27cb);}); \ No newline at end of file +var _0x442c=['agent','format','%s%s@xcally.com','password','friend','wss','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','\x22%s\x22\x20<%s>','User','log','add\x20user','catch','util','../mysqldb','push','%s%s'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x442c,0x1d0));var _0xc442=function(_0x4dcfa0,_0x43be4d){_0x4dcfa0=_0x4dcfa0-0x0;var _0x1c1d9b=_0x442c[_0x4dcfa0];return _0x1c1d9b;};'use strict';var util=require(_0xc442('0x0'));var db=require(_0xc442('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0xc442('0x2')]({'name':util['format'](_0xc442('0x3'),_0xc442('0x4'),i),'fullname':util[_0xc442('0x5')](_0xc442('0x3'),_0xc442('0x4'),i),'email':util[_0xc442('0x5')](_0xc442('0x6'),'agent',i),'role':_0xc442('0x4'),'password':_0xc442('0x7'),'internal':0xfa0+i,'type':_0xc442('0x8'),'transport':['udp','ws',_0xc442('0x9')],'disallow':['all'],'allow':['ulaw'],'defaultuser':util[_0xc442('0x5')]('%s%s',_0xc442('0x4'),i),'encryption':'yes','avpf':_0xc442('0xa'),'force_avp':_0xc442('0xa'),'icesupport':_0xc442('0xa'),'dtlsenable':_0xc442('0xa'),'dtlsverify':'no','dtlscertfile':_0xc442('0xb'),'dtlsprivatekey':_0xc442('0xc'),'dtlssetup':'actpass','callerid':util[_0xc442('0x5')](_0xc442('0xd'),util[_0xc442('0x5')](_0xc442('0x3'),_0xc442('0x4'),i),0xfa0+i)});}db[_0xc442('0xe')]['bulkCreate'](users)['then'](function(){console[_0xc442('0xf')](_0xc442('0x10'));})[_0xc442('0x11')](function(_0x1754dd){console['log'](_0x1754dd);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index 3427983..d97f777 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6dc0=['User','role','agent','telephone','type','ivr','UserProfileSection','findOne','autoAssociation','VoiceQueues','ChatQueues','SmsQueues','MailQueues','findAll','UserProfileResource','then','map','where','Campaign','%s:queue:%s','length','format','user:%s','handshake','ChatInteractions','MailInteraction','FaxInteractions','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','admin','hasOwnProperty','include','push','VoiceQueue','ChatQueue','SmsQueue','OpenchannelQueue','WhatsappQueue','Trunk','user','userProfileId','FaxQueues','FaxQueue','MailQueue','OpenchannelQueues','WhatsappQueues','Telephones','Trunks','IvrCampaigns','voice:inbound','voice:outbound','getChatQueues','getFaxQueues','getSmsQueues','getOpenchannelQueues','getWhatsappQueues','all','voice','chat','fax','mail','openchannel','leave','removeChatInteractions','emit','user_has_chat_interactions:remove','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','connection','address','request','remoteAddress','remotePort','nsp','disconnect','DISCONNECTED','lodash','util','bluebird','./environment','name','Agents'];(function(_0x5012a0,_0x25c11b){var _0x37839d=function(_0x3a9f65){while(--_0x3a9f65){_0x5012a0['push'](_0x5012a0['shift']());}};_0x37839d(++_0x25c11b);}(_0x6dc0,0xb6));var _0x06dc=function(_0x1e6f85,_0x535624){_0x1e6f85=_0x1e6f85-0x0;var _0x54bb18=_0x6dc0[_0x1e6f85];return _0x54bb18;};'use strict';var _=require(_0x06dc('0x0'));var util=require(_0x06dc('0x1'));var BPromise=require(_0x06dc('0x2'));var db=require('../mysqldb')['db'];var config=require(_0x06dc('0x3'));var queryQueues={'attributes':['id',_0x06dc('0x4')],'include':[{'as':_0x06dc('0x5'),'model':db[_0x06dc('0x6')],'attributes':['id','name',_0x06dc('0x7')],'raw':!![],'where':{'role':_0x06dc('0x8')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id','name'],'where':{'role':_0x06dc('0x9')}};var queryTrunks={'raw':!![],'attributes':['id','name']};var queryAgents={'raw':!![],'attributes':['id',_0x06dc('0x4')],'where':{'role':_0x06dc('0x8')}};var queryCampaigns={'raw':!![],'attributes':['id',_0x06dc('0x4'),_0x06dc('0xa')],'where':{'type':_0x06dc('0xb')}};function getAssociatedResources(_0x4dcdce,_0x57cde3,_0x480f30){return db[_0x06dc('0xc')][_0x06dc('0xd')]({'where':{'name':_0x4dcdce,'userProfileId':_0x57cde3},'raw':!![]})['then'](function(_0x45693d){if(_0x45693d){if(_0x45693d[_0x06dc('0xe')]){switch(_0x4dcdce){case _0x06dc('0xf'):case _0x06dc('0x10'):case'FaxQueues':case _0x06dc('0x11'):case _0x06dc('0x12'):case'OpenchannelQueues':case'WhatsappQueues':return db[_0x480f30]['findAll'](queryQueues);case'Telephones':return db[_0x480f30][_0x06dc('0x13')](queryTelephones);case'Trunks':return db[_0x480f30]['findAll'](queryTrunks);case'IvrCampaigns':return db[_0x480f30][_0x06dc('0x13')](queryCampaigns);}}else{return db[_0x06dc('0x14')][_0x06dc('0x13')]({'attributes':['resourceId'],'where':{'sectionId':_0x45693d['id']},'raw':!![]})[_0x06dc('0x15')](function(_0x1d92c2){if(_0x1d92c2){var _0x145a07={'where':{'id':_[_0x06dc('0x16')](_0x1d92c2,'resourceId')},'raw':!![]};switch(_0x480f30){case _0x06dc('0x6'):_0x145a07[_0x06dc('0x17')][_0x06dc('0x7')]=_0x06dc('0x9');break;case _0x06dc('0x18'):_0x145a07['where'][_0x06dc('0xa')]=_0x06dc('0xb');break;}return db[_0x480f30][_0x06dc('0x13')](_0x145a07);}else{return[];}});}}else{return[];}})[_0x06dc('0x15')](function(_0x29dcd9){return _0x29dcd9;});}function joinOrLeaveQueues(_0x152ed2,_0x598b72,_0x55c932,_0x227623){_0x152ed2[_0x598b72](util['format'](_0x06dc('0x19'),_0x55c932,_0x227623['name']));if(_0x227623[_0x06dc('0x5')]){for(var _0x369c60=0x0;_0x369c60<_0x227623[_0x06dc('0x5')][_0x06dc('0x1a')];_0x369c60+=0x1){_0x152ed2[_0x598b72](util[_0x06dc('0x1b')](_0x06dc('0x1c'),_0x227623['Agents'][_0x369c60]['name']));}}}function joinOrLeave(_0x755ae2,_0x426260,_0x56c345){var _0x95dab2;if(_0x755ae2['handshake']['query']['id']){db['User']['find']({'attributes':['id','name',_0x06dc('0x7'),'userProfileId'],'where':{'id':_0x755ae2[_0x06dc('0x1d')]['query']['id']},'include':[{'model':db['ChatInteraction'],'as':_0x06dc('0x1e'),'attributes':['id'],'raw':!![]},{'model':db[_0x06dc('0x1f')],'as':'MailInteractions','attributes':['id'],'raw':!![]},{'model':db['FaxInteraction'],'as':_0x06dc('0x20'),'attributes':['id'],'raw':!![]},{'model':db['SmsInteraction'],'as':_0x06dc('0x21'),'attributes':['id'],'raw':!![]},{'model':db[_0x06dc('0x22')],'as':_0x06dc('0x23'),'attributes':['id'],'raw':!![]},{'model':db[_0x06dc('0x24')],'as':_0x06dc('0x25'),'attributes':['id'],'raw':!![]}]})[_0x06dc('0x15')](function(_0x164554){if(_0x164554){_0x95dab2=_0x164554;_0x755ae2[_0x426260](util[_0x06dc('0x1b')](_0x06dc('0x1c'),_0x164554[_0x06dc('0x4')]));var _0xad5ae9=[];switch(_0x164554[_0x06dc('0x7')]){case _0x06dc('0x26'):_0x755ae2[_0x426260]('voice:inbound');_0x755ae2[_0x426260]('voice:outbound');if(queryQueues[_0x06dc('0x27')](_0x06dc('0x28'))){delete queryQueues[_0x06dc('0x28')];}_0xad5ae9[_0x06dc('0x29')](db[_0x06dc('0x2a')][_0x06dc('0x13')](queryQueues));_0xad5ae9[_0x06dc('0x29')](db[_0x06dc('0x2b')][_0x06dc('0x13')](queryQueues));_0xad5ae9[_0x06dc('0x29')](db['FaxQueue'][_0x06dc('0x13')](queryQueues));_0xad5ae9[_0x06dc('0x29')](db[_0x06dc('0x2c')][_0x06dc('0x13')](queryQueues));_0xad5ae9[_0x06dc('0x29')](db['MailQueue'][_0x06dc('0x13')](queryQueues));_0xad5ae9[_0x06dc('0x29')](db[_0x06dc('0x2d')]['findAll'](queryQueues));_0xad5ae9[_0x06dc('0x29')](db[_0x06dc('0x2e')]['findAll'](queryQueues));_0xad5ae9[_0x06dc('0x29')](db[_0x06dc('0x6')]['findAll'](queryTelephones));_0xad5ae9[_0x06dc('0x29')](db[_0x06dc('0x2f')][_0x06dc('0x13')](queryTrunks));_0xad5ae9[_0x06dc('0x29')](db[_0x06dc('0x18')][_0x06dc('0x13')](queryCampaigns));_0xad5ae9[_0x06dc('0x29')](db[_0x06dc('0x6')][_0x06dc('0x13')](queryAgents));break;case _0x06dc('0x30'):_0x755ae2[_0x426260]('voice:inbound');_0x755ae2[_0x426260]('voice:outbound');_0xad5ae9['push'](getAssociatedResources(_0x06dc('0xf'),_0x164554[_0x06dc('0x31')],_0x06dc('0x2a')));_0xad5ae9[_0x06dc('0x29')](getAssociatedResources('ChatQueues',_0x164554['userProfileId'],_0x06dc('0x2b')));_0xad5ae9[_0x06dc('0x29')](getAssociatedResources(_0x06dc('0x32'),_0x164554[_0x06dc('0x31')],_0x06dc('0x33')));_0xad5ae9[_0x06dc('0x29')](getAssociatedResources(_0x06dc('0x11'),_0x164554[_0x06dc('0x31')],_0x06dc('0x2c')));_0xad5ae9[_0x06dc('0x29')](getAssociatedResources(_0x06dc('0x12'),_0x164554[_0x06dc('0x31')],_0x06dc('0x34')));_0xad5ae9[_0x06dc('0x29')](getAssociatedResources(_0x06dc('0x35'),_0x164554[_0x06dc('0x31')],_0x06dc('0x2d')));_0xad5ae9[_0x06dc('0x29')](getAssociatedResources(_0x06dc('0x36'),_0x164554[_0x06dc('0x31')],'WhatsappQueue'));_0xad5ae9['push'](getAssociatedResources(_0x06dc('0x37'),_0x164554[_0x06dc('0x31')],_0x06dc('0x6')));_0xad5ae9[_0x06dc('0x29')](getAssociatedResources(_0x06dc('0x38'),_0x164554['userProfileId'],_0x06dc('0x2f')));_0xad5ae9[_0x06dc('0x29')](getAssociatedResources(_0x06dc('0x39'),_0x164554['userProfileId'],_0x06dc('0x18')));_0xad5ae9[_0x06dc('0x29')](db['User'][_0x06dc('0x13')](queryAgents));break;case _0x06dc('0x8'):_0x755ae2[_0x426260](_0x06dc('0x3a'));_0x755ae2[_0x426260](_0x06dc('0x3b'));_0xad5ae9['push'](_0x164554['getVoiceQueues']({'attributes':['id',_0x06dc('0x4')]}));_0xad5ae9[_0x06dc('0x29')](_0x164554[_0x06dc('0x3c')]({'attributes':['id','name']}));_0xad5ae9[_0x06dc('0x29')](_0x164554[_0x06dc('0x3d')]({'attributes':['id',_0x06dc('0x4')]}));_0xad5ae9[_0x06dc('0x29')](_0x164554[_0x06dc('0x3e')]({'attributes':['id','name']}));_0xad5ae9[_0x06dc('0x29')](_0x164554['getMailQueues']({'attributes':['id','name']}));_0xad5ae9[_0x06dc('0x29')](_0x164554[_0x06dc('0x3f')]({'attributes':['id',_0x06dc('0x4')]}));_0xad5ae9[_0x06dc('0x29')](_0x164554[_0x06dc('0x40')]({'attributes':['id','name']}));break;}return BPromise[_0x06dc('0x41')](_0xad5ae9);}})[_0x06dc('0x15')](function(_0x247199){if(_0x247199&&_0x247199[_0x06dc('0x1a')]){for(var _0x19d512=0x0;_0x19d512<_0x247199[_0x06dc('0x1a')];_0x19d512+=0x1){for(var _0x10fad6=0x0;_0x10fad6<_0x247199[_0x19d512][_0x06dc('0x1a')];_0x10fad6+=0x1){switch(_0x19d512){case 0x0:joinOrLeaveQueues(_0x755ae2,_0x426260,_0x06dc('0x42'),_0x247199[_0x19d512][_0x10fad6]);break;case 0x1:joinOrLeaveQueues(_0x755ae2,_0x426260,_0x06dc('0x43'),_0x247199[_0x19d512][_0x10fad6]);break;case 0x2:joinOrLeaveQueues(_0x755ae2,_0x426260,_0x06dc('0x44'),_0x247199[_0x19d512][_0x10fad6]);break;case 0x3:joinOrLeaveQueues(_0x755ae2,_0x426260,'sms',_0x247199[_0x19d512][_0x10fad6]);break;case 0x4:joinOrLeaveQueues(_0x755ae2,_0x426260,_0x06dc('0x45'),_0x247199[_0x19d512][_0x10fad6]);break;case 0x5:joinOrLeaveQueues(_0x755ae2,_0x426260,_0x06dc('0x46'),_0x247199[_0x19d512][_0x10fad6]);break;case 0x6:joinOrLeaveQueues(_0x755ae2,_0x426260,'whatsapp',_0x247199[_0x19d512][_0x10fad6]);break;case 0x7:if(_0x95dab2[_0x06dc('0x7')]!==_0x06dc('0x8'))_0x755ae2[_0x426260](util[_0x06dc('0x1b')]('telephone:%s',_0x247199[_0x19d512][_0x10fad6][_0x06dc('0x4')]));break;case 0x8:if(_0x95dab2[_0x06dc('0x7')]!=='agent')_0x755ae2[_0x426260](util['format']('trunk:%s',_0x247199[_0x19d512][_0x10fad6][_0x06dc('0x4')]));break;case 0x9:if(_0x95dab2[_0x06dc('0x7')]!==_0x06dc('0x8'))_0x755ae2[_0x426260](util['format']('campaign:%s:%s',_0x247199[_0x19d512][_0x10fad6][_0x06dc('0xa')],_0x247199[_0x19d512][_0x10fad6][_0x06dc('0x4')]));break;case 0xa:_0x755ae2[_0x426260](util[_0x06dc('0x1b')](_0x06dc('0x1c'),_0x247199[_0x19d512][_0x10fad6][_0x06dc('0x4')]));break;}}}}})['then'](function(){if(_0x426260===_0x06dc('0x47')){var _0x1a2048=_[_0x06dc('0x16')](_0x95dab2['ChatInteractions'],'id');return _0x95dab2[_0x06dc('0x48')](_0x1a2048)[_0x06dc('0x15')](function(){for(var _0x3ab522=0x0;_0x3ab522<_0x1a2048[_0x06dc('0x1a')];_0x3ab522+=0x1){_0x56c345[_0x06dc('0x49')](_0x06dc('0x4a'),{'ChatInteractionId':Number(_0x1a2048[_0x3ab522]),'UserId':Number(_0x95dab2['id'])});}});}})[_0x06dc('0x15')](function(){if(_0x426260===_0x06dc('0x47')){var _0x53fee6=_[_0x06dc('0x16')](_0x95dab2['MailInteractions'],'id');return _0x95dab2[_0x06dc('0x4b')](_0x53fee6)['then'](function(){for(var _0x2f0bd4=0x0;_0x2f0bd4<_0x53fee6['length'];_0x2f0bd4+=0x1){_0x56c345[_0x06dc('0x49')](_0x06dc('0x4c'),{'MailInteractionId':Number(_0x53fee6[_0x2f0bd4]),'UserId':Number(_0x95dab2['id'])});}});}})[_0x06dc('0x15')](function(){if(_0x426260===_0x06dc('0x47')){var _0x1b1e33=_[_0x06dc('0x16')](_0x95dab2[_0x06dc('0x20')],'id');return _0x95dab2['removeFaxInteractions'](_0x1b1e33)[_0x06dc('0x15')](function(){for(var _0x21ae2f=0x0;_0x21ae2f<_0x1b1e33[_0x06dc('0x1a')];_0x21ae2f+=0x1){_0x56c345['emit']('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0x1b1e33[_0x21ae2f]),'UserId':Number(_0x95dab2['id'])});}});}})[_0x06dc('0x15')](function(){if(_0x426260===_0x06dc('0x47')){var _0x42fcbf=_['map'](_0x95dab2[_0x06dc('0x21')],'id');return _0x95dab2[_0x06dc('0x4d')](_0x42fcbf)[_0x06dc('0x15')](function(){for(var _0x227758=0x0;_0x227758<_0x42fcbf['length'];_0x227758+=0x1){_0x56c345[_0x06dc('0x49')](_0x06dc('0x4e'),{'SmsInteractionId':Number(_0x42fcbf[_0x227758]),'UserId':Number(_0x95dab2['id'])});}});}})[_0x06dc('0x15')](function(){if(_0x426260===_0x06dc('0x47')){var _0x304042=_[_0x06dc('0x16')](_0x95dab2[_0x06dc('0x23')],'id');return _0x95dab2[_0x06dc('0x4f')](_0x304042)[_0x06dc('0x15')](function(){for(var _0x416e3d=0x0;_0x416e3d<_0x304042['length'];_0x416e3d+=0x1){_0x56c345[_0x06dc('0x49')](_0x06dc('0x50'),{'OpenchannelInteractionId':Number(_0x304042[_0x416e3d]),'UserId':Number(_0x95dab2['id'])});}});}})[_0x06dc('0x15')](function(){if(_0x426260==='leave'){var _0x5336d2=_[_0x06dc('0x16')](_0x95dab2[_0x06dc('0x25')],'id');return _0x95dab2[_0x06dc('0x51')](_0x5336d2)[_0x06dc('0x15')](function(){for(var _0x122aa3=0x0;_0x122aa3<_0x5336d2[_0x06dc('0x1a')];_0x122aa3+=0x1){_0x56c345[_0x06dc('0x49')](_0x06dc('0x52'),{'WhatsappInteractionId':Number(_0x5336d2[_0x122aa3]),'UserId':Number(_0x95dab2['id'])});}});}})[_0x06dc('0x53')](function(_0x45cf22){_0x755ae2[_0x06dc('0x54')](_0x45cf22);});}}function onDisconnect(_0x2fddb8,_0x43a71d){joinOrLeave(_0x2fddb8,'leave',_0x43a71d);}function onConnect(_0x4c1aff){joinOrLeave(_0x4c1aff,_0x06dc('0x55'));}exports['default']=function(_0x282751){_0x282751['on'](_0x06dc('0x56'),function(_0x44fe6d){_0x44fe6d['setMaxListeners'](0x0);_0x44fe6d[_0x06dc('0x57')]=_0x44fe6d[_0x06dc('0x58')][_0x06dc('0x56')][_0x06dc('0x59')]+':'+_0x44fe6d[_0x06dc('0x58')][_0x06dc('0x56')][_0x06dc('0x5a')];_0x44fe6d['connectedAt']=new Date();_0x44fe6d[_0x06dc('0x54')]=function(_0x5bf0e6){console[_0x06dc('0x54')]('SocketIO\x20'+_0x44fe6d[_0x06dc('0x5b')][_0x06dc('0x4')]+'['+_0x44fe6d['address']+']',_0x5bf0e6);};_0x44fe6d['on'](_0x06dc('0x5c'),function(){onDisconnect(_0x44fe6d,_0x282751);_0x44fe6d['log'](_0x06dc('0x5d'));});onConnect(_0x44fe6d);_0x44fe6d['log']('CONNECTED');});}; \ No newline at end of file +var _0x9264=['role','name','type','findOne','then','VoiceQueues','SmsQueues','MailQueues','OpenchannelQueues','findAll','Telephones','Trunks','IvrCampaigns','UserProfileResource','resourceId','map','User','where','ivr','format','length','handshake','query','userProfileId','MailInteractions','FaxInteraction','FaxInteractions','OpenchannelInteractions','WhatsappInteraction','WhatsappInteractions','user:%s','voice:inbound','voice:outbound','hasOwnProperty','include','push','VoiceQueue','ChatQueue','FaxQueue','SmsQueue','MailQueue','OpenchannelQueue','WhatsappQueue','Campaign','user','ChatQueues','FaxQueues','Trunk','agent','getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','getWhatsappQueues','all','chat','fax','sms','mail','openchannel','whatsapp','telephone:%s','campaign:%s:%s','leave','ChatInteractions','removeChatInteractions','user_has_chat_interactions:remove','removeMailInteractions','emit','user_has_mail_interactions:remove','user_has_fax_interactions:remove','removeOpenchannelInteractions','user_has_whatsapp_interactions:remove','default','setMaxListeners','address','request','remoteAddress','remotePort','connectedAt','log','SocketIO\x20','nsp','DISCONNECTED','lodash','util','bluebird','../mysqldb','Agents'];(function(_0x45b81c,_0x58c048){var _0x284efb=function(_0x5a22f6){while(--_0x5a22f6){_0x45b81c['push'](_0x45b81c['shift']());}};_0x284efb(++_0x58c048);}(_0x9264,0xb1));var _0x4926=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x9264[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x4926('0x0'));var util=require(_0x4926('0x1'));var BPromise=require(_0x4926('0x2'));var db=require(_0x4926('0x3'))['db'];var config=require('./environment');var queryQueues={'attributes':['id','name'],'include':[{'as':_0x4926('0x4'),'model':db['User'],'attributes':['id','name',_0x4926('0x5')],'raw':!![],'where':{'role':'agent'},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id','name'],'where':{'role':'telephone'}};var queryTrunks={'raw':!![],'attributes':['id',_0x4926('0x6')]};var queryAgents={'raw':!![],'attributes':['id',_0x4926('0x6')],'where':{'role':'agent'}};var queryCampaigns={'raw':!![],'attributes':['id',_0x4926('0x6'),_0x4926('0x7')],'where':{'type':'ivr'}};function getAssociatedResources(_0x18e43d,_0x425893,_0x2a5ce3){return db['UserProfileSection'][_0x4926('0x8')]({'where':{'name':_0x18e43d,'userProfileId':_0x425893},'raw':!![]})[_0x4926('0x9')](function(_0x2affdd){if(_0x2affdd){if(_0x2affdd['autoAssociation']){switch(_0x18e43d){case _0x4926('0xa'):case'ChatQueues':case'FaxQueues':case _0x4926('0xb'):case _0x4926('0xc'):case _0x4926('0xd'):case'WhatsappQueues':return db[_0x2a5ce3][_0x4926('0xe')](queryQueues);case _0x4926('0xf'):return db[_0x2a5ce3][_0x4926('0xe')](queryTelephones);case _0x4926('0x10'):return db[_0x2a5ce3][_0x4926('0xe')](queryTrunks);case _0x4926('0x11'):return db[_0x2a5ce3][_0x4926('0xe')](queryCampaigns);}}else{return db[_0x4926('0x12')][_0x4926('0xe')]({'attributes':[_0x4926('0x13')],'where':{'sectionId':_0x2affdd['id']},'raw':!![]})[_0x4926('0x9')](function(_0x1fbb5d){if(_0x1fbb5d){var _0x3018cb={'where':{'id':_[_0x4926('0x14')](_0x1fbb5d,'resourceId')},'raw':!![]};switch(_0x2a5ce3){case _0x4926('0x15'):_0x3018cb[_0x4926('0x16')][_0x4926('0x5')]='telephone';break;case'Campaign':_0x3018cb[_0x4926('0x16')]['type']=_0x4926('0x17');break;}return db[_0x2a5ce3][_0x4926('0xe')](_0x3018cb);}else{return[];}});}}else{return[];}})['then'](function(_0xc6d161){return _0xc6d161;});}function joinOrLeaveQueues(_0x49461e,_0x37a5c5,_0x3d3fbc,_0x20bb28){_0x49461e[_0x37a5c5](util[_0x4926('0x18')]('%s:queue:%s',_0x3d3fbc,_0x20bb28['name']));if(_0x20bb28[_0x4926('0x4')]){for(var _0x588c7a=0x0;_0x588c7a<_0x20bb28['Agents'][_0x4926('0x19')];_0x588c7a+=0x1){_0x49461e[_0x37a5c5](util[_0x4926('0x18')]('user:%s',_0x20bb28[_0x4926('0x4')][_0x588c7a]['name']));}}}function joinOrLeave(_0x361476,_0x55e459,_0x10d0b2){var _0x34d600;if(_0x361476[_0x4926('0x1a')][_0x4926('0x1b')]['id']){db['User']['find']({'attributes':['id','name',_0x4926('0x5'),_0x4926('0x1c')],'where':{'id':_0x361476[_0x4926('0x1a')][_0x4926('0x1b')]['id']},'include':[{'model':db['ChatInteraction'],'as':'ChatInteractions','attributes':['id'],'raw':!![]},{'model':db['MailInteraction'],'as':_0x4926('0x1d'),'attributes':['id'],'raw':!![]},{'model':db[_0x4926('0x1e')],'as':_0x4926('0x1f'),'attributes':['id'],'raw':!![]},{'model':db['SmsInteraction'],'as':'SmsInteractions','attributes':['id'],'raw':!![]},{'model':db['OpenchannelInteraction'],'as':_0x4926('0x20'),'attributes':['id'],'raw':!![]},{'model':db[_0x4926('0x21')],'as':_0x4926('0x22'),'attributes':['id'],'raw':!![]}]})['then'](function(_0x180421){if(_0x180421){_0x34d600=_0x180421;_0x361476[_0x55e459](util[_0x4926('0x18')](_0x4926('0x23'),_0x180421[_0x4926('0x6')]));var _0x29ba12=[];switch(_0x180421[_0x4926('0x5')]){case'admin':_0x361476[_0x55e459](_0x4926('0x24'));_0x361476[_0x55e459](_0x4926('0x25'));if(queryQueues[_0x4926('0x26')](_0x4926('0x27'))){delete queryQueues[_0x4926('0x27')];}_0x29ba12[_0x4926('0x28')](db[_0x4926('0x29')]['findAll'](queryQueues));_0x29ba12[_0x4926('0x28')](db[_0x4926('0x2a')]['findAll'](queryQueues));_0x29ba12[_0x4926('0x28')](db[_0x4926('0x2b')][_0x4926('0xe')](queryQueues));_0x29ba12[_0x4926('0x28')](db[_0x4926('0x2c')][_0x4926('0xe')](queryQueues));_0x29ba12[_0x4926('0x28')](db[_0x4926('0x2d')][_0x4926('0xe')](queryQueues));_0x29ba12[_0x4926('0x28')](db[_0x4926('0x2e')][_0x4926('0xe')](queryQueues));_0x29ba12[_0x4926('0x28')](db[_0x4926('0x2f')]['findAll'](queryQueues));_0x29ba12[_0x4926('0x28')](db[_0x4926('0x15')][_0x4926('0xe')](queryTelephones));_0x29ba12[_0x4926('0x28')](db['Trunk'][_0x4926('0xe')](queryTrunks));_0x29ba12[_0x4926('0x28')](db[_0x4926('0x30')][_0x4926('0xe')](queryCampaigns));_0x29ba12[_0x4926('0x28')](db['User'][_0x4926('0xe')](queryAgents));break;case _0x4926('0x31'):_0x361476[_0x55e459](_0x4926('0x24'));_0x361476[_0x55e459]('voice:outbound');_0x29ba12[_0x4926('0x28')](getAssociatedResources(_0x4926('0xa'),_0x180421[_0x4926('0x1c')],_0x4926('0x29')));_0x29ba12[_0x4926('0x28')](getAssociatedResources(_0x4926('0x32'),_0x180421['userProfileId'],_0x4926('0x2a')));_0x29ba12[_0x4926('0x28')](getAssociatedResources(_0x4926('0x33'),_0x180421[_0x4926('0x1c')],_0x4926('0x2b')));_0x29ba12['push'](getAssociatedResources(_0x4926('0xb'),_0x180421[_0x4926('0x1c')],_0x4926('0x2c')));_0x29ba12[_0x4926('0x28')](getAssociatedResources('MailQueues',_0x180421['userProfileId'],'MailQueue'));_0x29ba12[_0x4926('0x28')](getAssociatedResources(_0x4926('0xd'),_0x180421[_0x4926('0x1c')],_0x4926('0x2e')));_0x29ba12[_0x4926('0x28')](getAssociatedResources('WhatsappQueues',_0x180421['userProfileId'],'WhatsappQueue'));_0x29ba12['push'](getAssociatedResources(_0x4926('0xf'),_0x180421[_0x4926('0x1c')],_0x4926('0x15')));_0x29ba12[_0x4926('0x28')](getAssociatedResources(_0x4926('0x10'),_0x180421['userProfileId'],_0x4926('0x34')));_0x29ba12[_0x4926('0x28')](getAssociatedResources(_0x4926('0x11'),_0x180421[_0x4926('0x1c')],_0x4926('0x30')));_0x29ba12[_0x4926('0x28')](db[_0x4926('0x15')][_0x4926('0xe')](queryAgents));break;case _0x4926('0x35'):_0x361476[_0x55e459](_0x4926('0x24'));_0x361476[_0x55e459]('voice:outbound');_0x29ba12['push'](_0x180421[_0x4926('0x36')]({'attributes':['id','name']}));_0x29ba12[_0x4926('0x28')](_0x180421[_0x4926('0x37')]({'attributes':['id',_0x4926('0x6')]}));_0x29ba12['push'](_0x180421[_0x4926('0x38')]({'attributes':['id',_0x4926('0x6')]}));_0x29ba12[_0x4926('0x28')](_0x180421[_0x4926('0x39')]({'attributes':['id',_0x4926('0x6')]}));_0x29ba12[_0x4926('0x28')](_0x180421[_0x4926('0x3a')]({'attributes':['id',_0x4926('0x6')]}));_0x29ba12[_0x4926('0x28')](_0x180421[_0x4926('0x3b')]({'attributes':['id',_0x4926('0x6')]}));_0x29ba12[_0x4926('0x28')](_0x180421[_0x4926('0x3c')]({'attributes':['id',_0x4926('0x6')]}));break;}return BPromise[_0x4926('0x3d')](_0x29ba12);}})['then'](function(_0x1ee46d){if(_0x1ee46d&&_0x1ee46d[_0x4926('0x19')]){for(var _0x596c58=0x0;_0x596c58<_0x1ee46d[_0x4926('0x19')];_0x596c58+=0x1){for(var _0x275cf8=0x0;_0x275cf8<_0x1ee46d[_0x596c58][_0x4926('0x19')];_0x275cf8+=0x1){switch(_0x596c58){case 0x0:joinOrLeaveQueues(_0x361476,_0x55e459,'voice',_0x1ee46d[_0x596c58][_0x275cf8]);break;case 0x1:joinOrLeaveQueues(_0x361476,_0x55e459,_0x4926('0x3e'),_0x1ee46d[_0x596c58][_0x275cf8]);break;case 0x2:joinOrLeaveQueues(_0x361476,_0x55e459,_0x4926('0x3f'),_0x1ee46d[_0x596c58][_0x275cf8]);break;case 0x3:joinOrLeaveQueues(_0x361476,_0x55e459,_0x4926('0x40'),_0x1ee46d[_0x596c58][_0x275cf8]);break;case 0x4:joinOrLeaveQueues(_0x361476,_0x55e459,_0x4926('0x41'),_0x1ee46d[_0x596c58][_0x275cf8]);break;case 0x5:joinOrLeaveQueues(_0x361476,_0x55e459,_0x4926('0x42'),_0x1ee46d[_0x596c58][_0x275cf8]);break;case 0x6:joinOrLeaveQueues(_0x361476,_0x55e459,_0x4926('0x43'),_0x1ee46d[_0x596c58][_0x275cf8]);break;case 0x7:if(_0x34d600[_0x4926('0x5')]!==_0x4926('0x35'))_0x361476[_0x55e459](util['format'](_0x4926('0x44'),_0x1ee46d[_0x596c58][_0x275cf8]['name']));break;case 0x8:if(_0x34d600['role']!==_0x4926('0x35'))_0x361476[_0x55e459](util[_0x4926('0x18')]('trunk:%s',_0x1ee46d[_0x596c58][_0x275cf8][_0x4926('0x6')]));break;case 0x9:if(_0x34d600[_0x4926('0x5')]!==_0x4926('0x35'))_0x361476[_0x55e459](util[_0x4926('0x18')](_0x4926('0x45'),_0x1ee46d[_0x596c58][_0x275cf8][_0x4926('0x7')],_0x1ee46d[_0x596c58][_0x275cf8]['name']));break;case 0xa:_0x361476[_0x55e459](util['format']('user:%s',_0x1ee46d[_0x596c58][_0x275cf8]['name']));break;}}}}})[_0x4926('0x9')](function(){if(_0x55e459===_0x4926('0x46')){var _0x8b0177=_[_0x4926('0x14')](_0x34d600[_0x4926('0x47')],'id');return _0x34d600[_0x4926('0x48')](_0x8b0177)['then'](function(){for(var _0xbfafec=0x0;_0xbfafec<_0x8b0177[_0x4926('0x19')];_0xbfafec+=0x1){_0x10d0b2['emit'](_0x4926('0x49'),{'ChatInteractionId':Number(_0x8b0177[_0xbfafec]),'UserId':Number(_0x34d600['id'])});}});}})[_0x4926('0x9')](function(){if(_0x55e459==='leave'){var _0x2e5163=_[_0x4926('0x14')](_0x34d600['MailInteractions'],'id');return _0x34d600[_0x4926('0x4a')](_0x2e5163)['then'](function(){for(var _0x1b0b43=0x0;_0x1b0b43<_0x2e5163[_0x4926('0x19')];_0x1b0b43+=0x1){_0x10d0b2[_0x4926('0x4b')](_0x4926('0x4c'),{'MailInteractionId':Number(_0x2e5163[_0x1b0b43]),'UserId':Number(_0x34d600['id'])});}});}})[_0x4926('0x9')](function(){if(_0x55e459==='leave'){var _0x4d1738=_[_0x4926('0x14')](_0x34d600[_0x4926('0x1f')],'id');return _0x34d600['removeFaxInteractions'](_0x4d1738)[_0x4926('0x9')](function(){for(var _0x172521=0x0;_0x172521<_0x4d1738[_0x4926('0x19')];_0x172521+=0x1){_0x10d0b2['emit'](_0x4926('0x4d'),{'FaxInteractionId':Number(_0x4d1738[_0x172521]),'UserId':Number(_0x34d600['id'])});}});}})[_0x4926('0x9')](function(){if(_0x55e459===_0x4926('0x46')){var _0x2d9b41=_['map'](_0x34d600['SmsInteractions'],'id');return _0x34d600['removeSmsInteractions'](_0x2d9b41)[_0x4926('0x9')](function(){for(var _0x391087=0x0;_0x391087<_0x2d9b41[_0x4926('0x19')];_0x391087+=0x1){_0x10d0b2[_0x4926('0x4b')]('user_has_sms_interactions:remove',{'SmsInteractionId':Number(_0x2d9b41[_0x391087]),'UserId':Number(_0x34d600['id'])});}});}})['then'](function(){if(_0x55e459==='leave'){var _0x213f26=_[_0x4926('0x14')](_0x34d600[_0x4926('0x20')],'id');return _0x34d600[_0x4926('0x4e')](_0x213f26)[_0x4926('0x9')](function(){for(var _0x5ad039=0x0;_0x5ad039<_0x213f26[_0x4926('0x19')];_0x5ad039+=0x1){_0x10d0b2[_0x4926('0x4b')]('user_has_openchannel_interactions:remove',{'OpenchannelInteractionId':Number(_0x213f26[_0x5ad039]),'UserId':Number(_0x34d600['id'])});}});}})['then'](function(){if(_0x55e459===_0x4926('0x46')){var _0x27ef63=_[_0x4926('0x14')](_0x34d600[_0x4926('0x22')],'id');return _0x34d600['removeWhatsappInteractions'](_0x27ef63)['then'](function(){for(var _0x53ada4=0x0;_0x53ada4<_0x27ef63[_0x4926('0x19')];_0x53ada4+=0x1){_0x10d0b2[_0x4926('0x4b')](_0x4926('0x4f'),{'WhatsappInteractionId':Number(_0x27ef63[_0x53ada4]),'UserId':Number(_0x34d600['id'])});}});}})['catch'](function(_0x2630e1){_0x361476['log'](_0x2630e1);});}}function onDisconnect(_0x1696c9,_0x1fb6f5){joinOrLeave(_0x1696c9,'leave',_0x1fb6f5);}function onConnect(_0x9c6909){joinOrLeave(_0x9c6909,'join');}exports[_0x4926('0x50')]=function(_0xb4fc17){_0xb4fc17['on']('connection',function(_0x11276d){_0x11276d[_0x4926('0x51')](0x0);_0x11276d[_0x4926('0x52')]=_0x11276d[_0x4926('0x53')]['connection'][_0x4926('0x54')]+':'+_0x11276d[_0x4926('0x53')]['connection'][_0x4926('0x55')];_0x11276d[_0x4926('0x56')]=new Date();_0x11276d[_0x4926('0x57')]=function(_0x3a88a2){console['log'](_0x4926('0x58')+_0x11276d[_0x4926('0x59')][_0x4926('0x6')]+'['+_0x11276d[_0x4926('0x52')]+']',_0x3a88a2);};_0x11276d['on']('disconnect',function(){onDisconnect(_0x11276d,_0xb4fc17);_0x11276d[_0x4926('0x57')](_0x4926('0x5a'));});onConnect(_0x11276d);_0x11276d[_0x4926('0x57')]('CONNECTED');});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index da5f13a..a5f3b42 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 _0x3eb3=['Openchannel','OpenchannelInteraction','OpenchannelMessage','request','EventManager','error','code','catch','Trigger,\x20%s','get','channel','motionChannel','event','direction','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','query','QueryTypes','SELECT','then','UserId','User','fullname','email','interface','format','SIP/%s','name','agent','outgoingmessage','opened','Sequelize','changed','closed','contact','find','internal','default','length','hasOwnProperty','model','hook','callback','toLowerCase','lodash','http','Chat','ChatInteraction','afterCreate','newinteraction','afterUpdate','ChatMessage','newmessage','SmsInteraction','closedinteraction','Sms','SmsMessage','WhatsappInteraction','Whatsapp','WhatsappMessage','Fax','FaxInteraction','FaxMessage','Mail','MailInteraction','substatus','MailMessage'];(function(_0x208129,_0x10cd78){var _0x5a4ea1=function(_0x2fc14e){while(--_0x2fc14e){_0x208129['push'](_0x208129['shift']());}};_0x5a4ea1(++_0x10cd78);}(_0x3eb3,0xf9));var _0x33eb=function(_0x3815ae,_0x19111a){_0x3815ae=_0x3815ae-0x0;var _0x4c1090=_0x3eb3[_0x3815ae];return _0x4c1090;};'use strict';var util=require('util');var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var logger=require('../logger')('triggers');var _=require(_0x33eb('0x0'));var client=jayson['client'][_0x33eb('0x1')]({'port':0x232a});var triggers=[{'channel':_0x33eb('0x2'),'model':_0x33eb('0x3'),'event':_0x33eb('0x4'),'condition':_0x33eb('0x5'),'callback':afterCreate},{'channel':'Chat','model':_0x33eb('0x3'),'event':_0x33eb('0x6'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0x33eb('0x2'),'model':_0x33eb('0x7'),'event':_0x33eb('0x4'),'condition':_0x33eb('0x8'),'callback':afterCreateMessage},{'channel':'Sms','model':_0x33eb('0x9'),'event':_0x33eb('0x4'),'condition':_0x33eb('0x5'),'callback':afterCreate},{'channel':'Sms','model':_0x33eb('0x9'),'event':_0x33eb('0x6'),'condition':_0x33eb('0xa'),'callback':afterUpdate},{'channel':_0x33eb('0xb'),'model':_0x33eb('0xc'),'event':'afterCreate','condition':_0x33eb('0x8'),'callback':afterCreateMessage},{'channel':'Whatsapp','model':_0x33eb('0xd'),'event':_0x33eb('0x4'),'condition':_0x33eb('0x5'),'callback':afterCreate},{'channel':_0x33eb('0xe'),'model':_0x33eb('0xd'),'event':_0x33eb('0x6'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0x33eb('0xe'),'model':_0x33eb('0xf'),'event':'afterCreate','condition':'newmessage','callback':afterCreateMessage},{'channel':_0x33eb('0x10'),'model':_0x33eb('0x11'),'event':_0x33eb('0x4'),'condition':'newinteraction','callback':afterCreate},{'channel':_0x33eb('0x10'),'model':_0x33eb('0x11'),'event':_0x33eb('0x6'),'condition':_0x33eb('0xa'),'callback':afterUpdate},{'channel':_0x33eb('0x10'),'model':_0x33eb('0x12'),'event':_0x33eb('0x4'),'condition':_0x33eb('0x8'),'callback':afterCreateMessage},{'channel':_0x33eb('0x13'),'model':_0x33eb('0x14'),'event':_0x33eb('0x4'),'condition':_0x33eb('0x5'),'callback':afterCreate},{'channel':_0x33eb('0x13'),'model':_0x33eb('0x14'),'event':_0x33eb('0x6'),'condition':_0x33eb('0xa'),'callback':afterUpdate},{'channel':_0x33eb('0x13'),'model':_0x33eb('0x14'),'event':'substatus','condition':_0x33eb('0x15'),'callback':afterUpdate},{'channel':_0x33eb('0x13'),'model':_0x33eb('0x16'),'event':_0x33eb('0x4'),'condition':_0x33eb('0x8'),'callback':afterCreateMessage},{'channel':_0x33eb('0x17'),'model':_0x33eb('0x18'),'event':_0x33eb('0x4'),'condition':_0x33eb('0x5'),'callback':afterCreate},{'channel':'Openchannel','model':_0x33eb('0x18'),'event':_0x33eb('0x6'),'condition':_0x33eb('0xa'),'callback':afterUpdate},{'channel':'Openchannel','model':_0x33eb('0x19'),'event':_0x33eb('0x4'),'condition':_0x33eb('0x8'),'callback':afterCreateMessage}];function request(_0xe05371){return client[_0x33eb('0x1a')]('EventManager',_0xe05371)['then'](function(_0x3ea0ec){logger['info']('Trigger,\x20%s',_0x33eb('0x1b'),_0x3ea0ec);if(_0x3ea0ec[_0x33eb('0x1c')]){if(_0x3ea0ec[_0x33eb('0x1c')][_0x33eb('0x1d')]===0x1f4){logger[_0x33eb('0x1c')]('Trigger,\x20%s','EventManager',_0x3ea0ec[_0x33eb('0x1c')]);}}})[_0x33eb('0x1e')](function(_0x12c233){logger[_0x33eb('0x1c')](_0x33eb('0x1f'),'EventManager',_0x12c233);});}function afterCreateMessage(_0x997235,_0xf75551){return function(_0x4c4e7f,_0x37b0c8){_0x4c4e7f=_0x4c4e7f[_0x33eb('0x20')]({'plain':!![]});_0x4c4e7f[_0x33eb('0x21')]=_0x997235;_0x4c4e7f[_0x33eb('0x22')]=_0x997235;_0x4c4e7f[_0x33eb('0x23')]=_0x4c4e7f[_0x33eb('0x24')];var _0x3b9e3b=_0x33eb('0x25')+_0x4c4e7f[_0x33eb('0x26')];return db[_0x33eb('0x27')][_0x33eb('0x28')](_0x3b9e3b,{'type':db['Sequelize'][_0x33eb('0x29')][_0x33eb('0x2a')],'raw':!![]})[_0x33eb('0x2b')](function(_0x3e5022){return _0x3e5022;})[_0x33eb('0x2b')](function(_0x3ab035){if(_0x3ab035){_0x4c4e7f['contact']=_0x3ab035[0x0];}if(_0x4c4e7f[_0x33eb('0x2c')]){return db[_0x33eb('0x2d')]['find']({'where':{'id':_0x4c4e7f[_0x33eb('0x2c')]},'attributes':['id','name',_0x33eb('0x2e'),_0x33eb('0x2f'),'internal'],'raw':!![]})['then'](function(_0x2344dd){_0x4c4e7f[_0x33eb('0x30')]=util[_0x33eb('0x31')](_0x33eb('0x32'),_0x2344dd[_0x33eb('0x33')]);_0x4c4e7f['channel']=_0x997235;_0x4c4e7f[_0x33eb('0x34')]=_0x2344dd;return request({'event':'incomingmessage','message':_0x4c4e7f});})['catch'](function(_0x167669){console[_0x33eb('0x1c')](_0x167669);});}else{return request({'event':_0x33eb('0x35'),'message':_0x4c4e7f});}});};}function afterCreate(_0x4028a1,_0x4e368e){return function(_0x39477a,_0x50d315){_0x39477a=_0x39477a[_0x33eb('0x20')]({'plain':!![]});_0x39477a[_0x33eb('0x21')]=_0x4028a1;_0x39477a[_0x33eb('0x22')]=_0x4028a1;_0x39477a[_0x33eb('0x23')]=_0x33eb('0x36');var _0x1b7774=_0x33eb('0x25')+_0x39477a['ContactId'];return db[_0x33eb('0x27')][_0x33eb('0x28')](_0x1b7774,{'type':db[_0x33eb('0x37')][_0x33eb('0x29')][_0x33eb('0x2a')],'raw':!![]})[_0x33eb('0x2b')](function(_0x22640c){return _0x22640c;})[_0x33eb('0x2b')](function(_0x12c8a5){if(_0x12c8a5){_0x39477a['contact']=_0x12c8a5[0x0];}return request({'event':_0x4e368e,'message':_0x39477a});});};}function afterUpdate(_0x562f27,_0x153fe9){return function(_0x5b2585,_0x5f1e1e){if(_0x5b2585[_0x33eb('0x38')](_0x33eb('0x39'))&&_0x5b2585[_0x33eb('0x39')]){_0x5b2585=_0x5b2585[_0x33eb('0x20')]({'plain':!![]});_0x5b2585[_0x33eb('0x21')]=_0x562f27;_0x5b2585[_0x33eb('0x22')]=_0x562f27;_0x5b2585['event']=_0x33eb('0x39');var _0x3a06e1=_0x33eb('0x25')+_0x5b2585['ContactId'];return db[_0x33eb('0x27')][_0x33eb('0x28')](_0x3a06e1,{'type':db[_0x33eb('0x37')]['QueryTypes'][_0x33eb('0x2a')],'raw':!![]})[_0x33eb('0x2b')](function(_0x52c1f1){return _0x52c1f1;})[_0x33eb('0x2b')](function(_0x5277aa){if(_0x5277aa){_0x5b2585[_0x33eb('0x3a')]=_0x5277aa[0x0];}if(_0x5b2585['UserId']){return db[_0x33eb('0x2d')][_0x33eb('0x3b')]({'where':{'id':_0x5b2585[_0x33eb('0x2c')]},'attributes':['id',_0x33eb('0x33'),_0x33eb('0x2e'),_0x33eb('0x2f'),'internal'],'raw':!![]})['then'](function(_0xeacc35){_0x5b2585[_0x33eb('0x30')]=util[_0x33eb('0x31')](_0x33eb('0x32'),_0xeacc35[_0x33eb('0x33')]);_0x5b2585[_0x33eb('0x34')]=_0xeacc35;return request({'event':_0x153fe9,'message':_0x5b2585});})['catch'](function(_0x4496f6){console[_0x33eb('0x1c')](_0x4496f6);});}else{return request({'event':_0x153fe9,'message':_0x5b2585});}});}else if(_0x5b2585[_0x33eb('0x38')]('substatus')){_0x5b2585=_0x5b2585[_0x33eb('0x20')]({'plain':!![]});_0x5b2585['channel']=_0x562f27;_0x5b2585[_0x33eb('0x23')]=_0x33eb('0x15');var _0x3a06e1='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x5b2585[_0x33eb('0x26')];return db[_0x33eb('0x27')][_0x33eb('0x28')](_0x3a06e1,{'type':db[_0x33eb('0x37')][_0x33eb('0x29')][_0x33eb('0x2a')],'raw':!![]})[_0x33eb('0x2b')](function(_0x36a0d0){return _0x36a0d0;})[_0x33eb('0x2b')](function(_0x5ed580){if(_0x5ed580){_0x5b2585[_0x33eb('0x3a')]=_0x5ed580[0x0];}if(_0x5b2585[_0x33eb('0x2c')]){return db[_0x33eb('0x2d')][_0x33eb('0x3b')]({'where':{'id':_0x5b2585[_0x33eb('0x2c')]},'attributes':['id','name',_0x33eb('0x2e'),_0x33eb('0x2f'),_0x33eb('0x3c')],'raw':!![]})[_0x33eb('0x2b')](function(_0x33e785){_0x5b2585['interface']=util[_0x33eb('0x31')](_0x33eb('0x32'),_0x33e785[_0x33eb('0x33')]);_0x5b2585[_0x33eb('0x34')]=_0x33e785;return request({'event':_0x153fe9,'message':_0x5b2585});})[_0x33eb('0x1e')](function(_0x5eebc9){console[_0x33eb('0x1c')](_0x5eebc9);});}else{return request({'event':_0x153fe9,'message':_0x5b2585});}});}};}exports[_0x33eb('0x3d')]=function(){for(var _0x1dac11=0x0;_0x1dac11=_0x10589b[_0xb502('0x10')]){throw Error('Maximum\x20login\x20has\x20been\x20reached');}_0x2c7134(_0x2225d1);})['catch'](function(_0x2cc4f9){_0x2356d1(_0x2cc4f9);});});}; \ No newline at end of file +var _0x774f=['blockedAt','updateAttributes','agent','count','then','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','catch','lodash','./license/util','voice','mail','whatsapp','openchannel','getChannels','isValidChannel','clearBlockUser','isUndefined'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x774f,0x172));var _0xf774=function(_0x4e39ae,_0x1cc345){_0x4e39ae=_0x4e39ae-0x0;var _0x1699b2=_0x774f[_0x4e39ae];return _0x1699b2;};'use strict';var _=require(_0xf774('0x0'));var BPromise=require('bluebird');var db=require('../mysqldb')['db'];var util=require(_0xf774('0x1'));var channels=[_0xf774('0x2'),_0xf774('0x3'),'chat','fax','sms',_0xf774('0x4'),_0xf774('0x5')];exports[_0xf774('0x6')]=function(){return channels;};exports[_0xf774('0x7')]=function(_0x1f7ba6){_0x1f7ba6=_0x1f7ba6['toLowerCase']();return _['includes'](channels,_0x1f7ba6);};exports[_0xf774('0x8')]=function(_0x330646,_0x4f17ef,_0x20c461,_0x25a1c5){var _0x2aa12f={'loginAttempts':_0x4f17ef,'blocked':_0x20c461};if(!_[_0xf774('0x9')](_0x25a1c5)){_0x2aa12f[_0xf774('0xa')]=_0x25a1c5;}return _0x330646[_0xf774('0xb')](_0x2aa12f);};exports['getLicense']=function(_0x414f3e){return new BPromise(function(_0x5dc35d,_0x3e4607){var _0x223ca2=0x0;if(_0x414f3e['role']!==_0xf774('0xc')){_0x5dc35d(_0x414f3e);}db['User'][_0xf774('0xd')]({'where':{'role':'agent','online':!![],'id':{'$ne':_0x414f3e['id']}}})[_0xf774('0xe')](function(_0x21ef90){_0x223ca2=_0x21ef90;return util[_0xf774('0xf')]();})['then'](function(_0x1cbbe9){if(_0x1cbbe9&&_0x1cbbe9[_0xf774('0x10')]&&_0x223ca2>=_0x1cbbe9[_0xf774('0x10')]){throw Error(_0xf774('0x11'));}_0x5dc35d(_0x414f3e);})[_0xf774('0x12')](function(_0x2d2315){_0x3e4607(_0x2d2315);});});}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index fd68cdf..143f4b1 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x57ff=['exports','404','status','render','send'];(function(_0x903984,_0x30357f){var _0x3238ee=function(_0x427fc9){while(--_0x427fc9){_0x903984['push'](_0x903984['shift']());}};_0x3238ee(++_0x30357f);}(_0x57ff,0x127));var _0xf57f=function(_0x4bca5f,_0x558bb3){_0x4bca5f=_0x4bca5f-0x0;var _0xfae0b8=_0x57ff[_0x4bca5f];return _0xfae0b8;};'use strict';module[_0xf57f('0x0')][0x194]=function pageNotFound(_0x39e3b6,_0x5b9c76){var _0x45ee0f=_0xf57f('0x1');var _0x3f6b1f=0x194;var _0x4c5923={'status':_0x3f6b1f};_0x5b9c76[_0xf57f('0x2')](_0x4c5923['status']);_0x5b9c76[_0xf57f('0x3')](_0x45ee0f,{},function(_0x541dde,_0x33d8ac){if(_0x541dde){return _0x5b9c76[_0xf57f('0x2')](_0x4c5923[_0xf57f('0x2')])['json'](_0x4c5923);}_0x5b9c76[_0xf57f('0x4')](_0x33d8ac);});}; \ No newline at end of file +var _0x1a83=['status','render','json','send','exports','404'];(function(_0x468001,_0x2e7aec){var _0x3d5261=function(_0x255e18){while(--_0x255e18){_0x468001['push'](_0x468001['shift']());}};_0x3d5261(++_0x2e7aec);}(_0x1a83,0x1c0));var _0x31a8=function(_0x474791,_0x26035d){_0x474791=_0x474791-0x0;var _0x59a92e=_0x1a83[_0x474791];return _0x59a92e;};'use strict';module[_0x31a8('0x0')][0x194]=function pageNotFound(_0x196663,_0x226cbc){var _0x4bf5f7=_0x31a8('0x1');var _0x5f4978=0x194;var _0x354f2f={'status':_0x5f4978};_0x226cbc[_0x31a8('0x2')](_0x354f2f[_0x31a8('0x2')]);_0x226cbc[_0x31a8('0x3')](_0x4bf5f7,{},function(_0x4f18c3,_0x5e07ea){if(_0x4f18c3){return _0x226cbc[_0x31a8('0x2')](_0x354f2f[_0x31a8('0x2')])[_0x31a8('0x4')](_0x354f2f);}_0x226cbc[_0x31a8('0x5')](_0x5e07ea);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index 8a18ef2..32ee816 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb8d8=['Members','VoiceQueueId','CmHopper','Hoppers','HopperHistories','HopperBlacks','JscriptySessionReport','JscriptySessions','Trunk','belongsTo','TrunkBackup','IntervalId','mandatoryDispositionPause','voice_queues_has_cm_lists','Agents','UserVoiceQueue','Teams','BlackLists','voice_queues_has_cm_blacklists','VoiceMailMessage','mailboxuser','mailbox','QueueCalls','uniqueid','VoiceCallReport','AgentReports','Contact','ContactId','MailAccountId','hasOne','Smtp','Dispositions','Messages','Interactions','List','ListId','mandatoryDispositionPauseId','user_has_mail_accounts','team_has_mail_queues','MailInteractionId','Account','Owner','mail_interaction_has_tags','Tags','ThroughTags','Attachments','ChatWebsiteId','ChatOfflineMessageId','restrict','MailQueueReport','Items','FaxAccountId','Answers','Exntensions','fax_interaction_has_tags','Users','user_has_fax_interactions','FaxInteractionId','Interaction','AttachmentId','SmsAccountId','SmsMessage','TagId','SmsInteractionId','sms_interaction_has_tags','user_has_sms_interactions','SmsQueueId','OpenchannelAccountId','OpenchannelMessage','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','team_has_openchannel_queues','ChatProactiveAction','ChatMessage','ChatQueue','ChatQueueId','Website','ChatInteractionId','user_has_chat_interactions','team_has_chat_queues','ChatGroupId','CompanyId','SmsInteractions','Company','cm_contact_has_tags','Agent','Queue','CampaignId','All','OneAll','AutomationAllId','Any','OneAny','AutomationAnyId','Action','ParentId','Intervals','MailApplications','ChatApplications','FaxApplications','SmsApplications','Schedule','AnalyticDefaultReport','DefaultReportId','Mohs','chat_interaction_has_tags','whatsapp_interaction_has_tags','AllConditions','AllCondition','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','Actions','TriggerId','AnalyticFieldReport','Fields','MetricId','SalesforceConfiguration','Configurations','AccountId','SalesforceField','Subjects','SubjectId','Descriptions','DescriptionId','FieldId','Subject','Description','Field','VariableId','SugarcrmField','DeskAccount','int_desk_configuration_has_tags','ZohoConfiguration','ZendeskAccount','FreshdeskAccount','int_freshdesk_configuration_has_tags','ServicenowAccount','ServicenowField','FreshsalesField','FromId','ToId','SessionId','ProjectId','team_has_sms_queues','TrunkId','TrunkBackupId','SquareProjectId','Lists','campaigns_has_cm_blacklists','FromMailAccountId','FromAccount','FromUserId','FromAgent','ToAgent','ToMailQueueId','ToQueue','ToMailAccountId','ToAccount','FromChatWebsiteId','ToUserId','ToChatQueueId','ToChatWebsiteId','FromFaxAccountId','ToFaxQueueId','ToFaxAccountId','FromOpenchannelAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','SmsTransferReport','FromSmsAccountId','ToSmsQueueId','ToSmsAccountId','CustomFields','Queues','UserProfileSections','UserProfileResource','sectionId','WhatsappAccountId','WhatsappApplication','WhatsappInteractionId','user_has_whatsapp_interactions','FromWhatsappAccountId','ToQueueId','WhatsappQueueId','team_has_whatsapp_queues','exports','../config/environment','lodash','determine','sequelize','motion2','xcall','xC@LL1234','utf8mb4','name','utf8','sequelizeHistory','defaultsDeep','mysql','utf8_general_ci','username','password','options','database','User','../api/user/user.model','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','import','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','../api/trunk/trunk.model','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','UserMailQueue','../api/userMailQueue/userMailQueue.model','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','UserWhatsappQueue','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailServerOut/mailServerOut.model','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','../api/mailQueueReport/mailQueueReport.model','Dashboard','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsQueue','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','CmContact','../api/cmContact/cmContact.model','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','CmCustomField','Automation','../api/automation/automation.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','Condition','../api/condition/condition.model','Interval','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','VoiceQueuesLog','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','Template','../api/template/template.model','Trigger','../api/trigger/trigger.model','Variable','../api/variable/variable.model','Integration','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','../api/analyticFieldReport/analyticFieldReport.model','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','../api/intZohoField/intZohoField.model','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.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','SquareMessage','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','License','Campaign','../api/campaign/campaign.model','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','Plugin','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','../api/userProfileResource/userProfileResource.model','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.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','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','UserVoicePrefix','../api/userVoicePrefix/userVoicePrefix.model','cascade','UserId','hasMany','Recordings','Extensions','HopperFinals','HopperHistory','ReportAgentPreview','OpenchannelInteractions','MailInteractions','UserNotifications','SenderId','userProfileId','belongsToMany','Contacts','cm_user_has_contacts','user_has_teams','user_has_mail_interactions','ChatInteractions','FaxInteractions','WhatsappInteractions','VoiceQueues','VoicePrefix','VoicePrefixes','MailQueues','ChatQueues','FaxQueue','FaxQueues','UserFaxQueue','SmsQueues','OpenchannelQueues','WhatsappQueues','cm_user_has_lists','ChatWebsites','user_has_chat_websites','FaxAccounts','user_has_fax_accounts','MailAccount','MailAccounts','OpenchannelAccount','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','WhatsappAccounts','user_has_whatsapp_accounts','user_has_square_projects','ChanSpyId','Applications','Sounds','moh_has_sounds'];(function(_0x144f41,_0x4a57b7){var _0x25dae4=function(_0x18c458){while(--_0x18c458){_0x144f41['push'](_0x144f41['shift']());}};_0x25dae4(++_0x4a57b7);}(_0xb8d8,0xbd));var _0x8b8d=function(_0x37a79c,_0x2b19f0){_0x37a79c=_0x37a79c-0x0;var _0x561d89=_0xb8d8[_0x37a79c];return _0x561d89;};'use strict';var config=require(_0x8b8d('0x0'));var Sequelize=require('sequelize');var _=require(_0x8b8d('0x1'));var jstz=require('jstz');var timezone=jstz[_0x8b8d('0x2')]();config[_0x8b8d('0x3')]=_['defaultsDeep'](config[_0x8b8d('0x3')],{'database':_0x8b8d('0x4'),'username':_0x8b8d('0x5'),'password':_0x8b8d('0x6'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0x8b8d('0x7')},'logging':![],'timezone':timezone[_0x8b8d('0x8')](),'define':{'charset':_0x8b8d('0x9'),'collate':'utf8_general_ci'}}});config[_0x8b8d('0xa')]=_[_0x8b8d('0xb')](config[_0x8b8d('0xa')],{'database':_0x8b8d('0x4'),'username':_0x8b8d('0x5'),'password':'xC@LL1234','options':{'host':'127.0.0.1','port':0xcea,'dialect':_0x8b8d('0xc'),'dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0x8b8d('0x9'),'collate':_0x8b8d('0xd')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x8b8d('0x3')]['database'],config[_0x8b8d('0x3')][_0x8b8d('0xe')],config[_0x8b8d('0x3')][_0x8b8d('0xf')],config[_0x8b8d('0x3')][_0x8b8d('0x10')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelizeHistory'][_0x8b8d('0x11')],config[_0x8b8d('0xa')][_0x8b8d('0xe')],config[_0x8b8d('0xa')][_0x8b8d('0xf')],config[_0x8b8d('0xa')][_0x8b8d('0x10')])};db[_0x8b8d('0x12')]=db[_0x8b8d('0x3')]['import'](_0x8b8d('0x13'));db[_0x8b8d('0x14')]=db[_0x8b8d('0x3')]['import'](_0x8b8d('0x15'));db[_0x8b8d('0x16')]=db[_0x8b8d('0x3')][_0x8b8d('0x17')]('../api/voiceContext/voiceContext.model');db[_0x8b8d('0x18')]=db['sequelize']['import'](_0x8b8d('0x19'));db[_0x8b8d('0x1a')]=db[_0x8b8d('0x3')][_0x8b8d('0x17')](_0x8b8d('0x1b'));db[_0x8b8d('0x1c')]=db[_0x8b8d('0x3')][_0x8b8d('0x17')](_0x8b8d('0x1d'));db[_0x8b8d('0x1e')]=db['sequelize'][_0x8b8d('0x17')](_0x8b8d('0x1f'));db[_0x8b8d('0x20')]=db['sequelize']['import'](_0x8b8d('0x21'));db[_0x8b8d('0x22')]=db[_0x8b8d('0x3')]['import'](_0x8b8d('0x23'));db['VoiceMailMessage']=db[_0x8b8d('0x3')][_0x8b8d('0x17')]('../api/voiceMailMessage/voiceMailMessage.model');db['VoiceCallReport']=db[_0x8b8d('0x3')][_0x8b8d('0x17')](_0x8b8d('0x24'));db[_0x8b8d('0x25')]=db[_0x8b8d('0x3')][_0x8b8d('0x17')](_0x8b8d('0x26'));db['VoiceAgentReport']=db[_0x8b8d('0x3')][_0x8b8d('0x17')](_0x8b8d('0x27'));db[_0x8b8d('0x28')]=db[_0x8b8d('0x3')][_0x8b8d('0x17')](_0x8b8d('0x29'));db[_0x8b8d('0x2a')]=db[_0x8b8d('0x3')][_0x8b8d('0x17')](_0x8b8d('0x2b'));db['Trunk']=db[_0x8b8d('0x3')]['import'](_0x8b8d('0x2c'));db['VoiceTransferReport']=db[_0x8b8d('0x3')][_0x8b8d('0x17')](_0x8b8d('0x2d'));db[_0x8b8d('0x2e')]=db[_0x8b8d('0x3')][_0x8b8d('0x17')](_0x8b8d('0x2f'));db['UserVoiceQueue']=db[_0x8b8d('0x3')][_0x8b8d('0x17')](_0x8b8d('0x30'));db[_0x8b8d('0x31')]=db['sequelize'][_0x8b8d('0x17')]('../api/userChatQueue/userChatQueue.model');db[_0x8b8d('0x32')]=db[_0x8b8d('0x3')][_0x8b8d('0x17')](_0x8b8d('0x33'));db['UserFaxQueue']=db[_0x8b8d('0x3')][_0x8b8d('0x17')](_0x8b8d('0x34'));db[_0x8b8d('0x35')]=db['sequelize'][_0x8b8d('0x17')](_0x8b8d('0x36'));db[_0x8b8d('0x37')]=db[_0x8b8d('0x3')][_0x8b8d('0x17')]('../api/userOpenchannelQueue/userOpenchannelQueue.model');db[_0x8b8d('0x38')]=db['sequelize'][_0x8b8d('0x17')]('../api/userWhatsappQueue/userWhatsappQueue.model');db[_0x8b8d('0x39')]=db[_0x8b8d('0x3')][_0x8b8d('0x17')](_0x8b8d('0x3a'));db[_0x8b8d('0x3b')]=db[_0x8b8d('0x3')]['import'](_0x8b8d('0x3c'));db['MailAccount']=db[_0x8b8d('0x3')]['import'](_0x8b8d('0x3d'));db[_0x8b8d('0x3e')]=db[_0x8b8d('0x3')][_0x8b8d('0x17')](_0x8b8d('0x3f'));db['MailSubstatus']=db['sequelize'][_0x8b8d('0x17')](_0x8b8d('0x40'));db[_0x8b8d('0x41')]=db[_0x8b8d('0x3')][_0x8b8d('0x17')](_0x8b8d('0x42'));db[_0x8b8d('0x43')]=db[_0x8b8d('0x3')]['import'](_0x8b8d('0x44'));db[_0x8b8d('0x45')]=db[_0x8b8d('0x3')][_0x8b8d('0x17')](_0x8b8d('0x46'));db['MailQueueReport']=db['sequelize'][_0x8b8d('0x17')](_0x8b8d('0x47'));db[_0x8b8d('0x48')]=db['sequelize'][_0x8b8d('0x17')](_0x8b8d('0x49'));db[_0x8b8d('0x4a')]=db[_0x8b8d('0x3')][_0x8b8d('0x17')](_0x8b8d('0x4b'));db[_0x8b8d('0x4c')]=db[_0x8b8d('0x3')]['import']('../api/faxAccount/faxAccount.model');db[_0x8b8d('0x4d')]=db['sequelize'][_0x8b8d('0x17')](_0x8b8d('0x4e'));db[_0x8b8d('0x4f')]=db['sequelize']['import'](_0x8b8d('0x50'));db[_0x8b8d('0x51')]=db['sequelize'][_0x8b8d('0x17')](_0x8b8d('0x52'));db['FaxQueue']=db[_0x8b8d('0x3')][_0x8b8d('0x17')](_0x8b8d('0x53'));db[_0x8b8d('0x54')]=db[_0x8b8d('0x3')][_0x8b8d('0x17')](_0x8b8d('0x55'));db[_0x8b8d('0x56')]=db[_0x8b8d('0x3')][_0x8b8d('0x17')](_0x8b8d('0x57'));db[_0x8b8d('0x58')]=db[_0x8b8d('0x3')][_0x8b8d('0x17')](_0x8b8d('0x59'));db[_0x8b8d('0x5a')]=db[_0x8b8d('0x3')]['import'](_0x8b8d('0x5b'));db['SmsMessage']=db[_0x8b8d('0x3')][_0x8b8d('0x17')]('../api/smsMessage/smsMessage.model');db[_0x8b8d('0x5c')]=db['sequelize'][_0x8b8d('0x17')]('../api/smsQueue/smsQueue.model');db['OpenchannelAccount']=db[_0x8b8d('0x3')]['import'](_0x8b8d('0x5d'));db[_0x8b8d('0x5e')]=db[_0x8b8d('0x3')][_0x8b8d('0x17')](_0x8b8d('0x5f'));db[_0x8b8d('0x60')]=db[_0x8b8d('0x3')]['import'](_0x8b8d('0x61'));db['OpenchannelMessage']=db[_0x8b8d('0x3')][_0x8b8d('0x17')](_0x8b8d('0x62'));db[_0x8b8d('0x63')]=db[_0x8b8d('0x3')][_0x8b8d('0x17')]('../api/openchannelQueue/openchannelQueue.model');db[_0x8b8d('0x64')]=db[_0x8b8d('0x3')]['import'](_0x8b8d('0x65'));db[_0x8b8d('0x66')]=db[_0x8b8d('0x3')]['import'](_0x8b8d('0x67'));db[_0x8b8d('0x68')]=db[_0x8b8d('0x3')][_0x8b8d('0x17')]('../api/chatApplication/chatApplication.model');db[_0x8b8d('0x69')]=db[_0x8b8d('0x3')][_0x8b8d('0x17')](_0x8b8d('0x6a'));db['ChatMessage']=db[_0x8b8d('0x3')][_0x8b8d('0x17')]('../api/chatMessage/chatMessage.model');db[_0x8b8d('0x6b')]=db[_0x8b8d('0x3')][_0x8b8d('0x17')](_0x8b8d('0x6c'));db['ChatQueue']=db[_0x8b8d('0x3')][_0x8b8d('0x17')](_0x8b8d('0x6d'));db[_0x8b8d('0x6e')]=db['sequelize']['import']('../api/chatGroup/chatGroup.model');db['ChatProactiveAction']=db[_0x8b8d('0x3')]['import'](_0x8b8d('0x6f'));db[_0x8b8d('0x70')]=db[_0x8b8d('0x3')][_0x8b8d('0x17')](_0x8b8d('0x71'));db[_0x8b8d('0x72')]=db['sequelize'][_0x8b8d('0x17')](_0x8b8d('0x73'));db['CmHopper']=db[_0x8b8d('0x3')]['import'](_0x8b8d('0x74'));db[_0x8b8d('0x75')]=db[_0x8b8d('0x3')][_0x8b8d('0x17')](_0x8b8d('0x76'));db[_0x8b8d('0x77')]=db[_0x8b8d('0x3')][_0x8b8d('0x17')](_0x8b8d('0x78'));db[_0x8b8d('0x79')]=db[_0x8b8d('0x3')]['import'](_0x8b8d('0x7a'));db['ReportAgentPreview']=db['sequelize'][_0x8b8d('0x17')]('../api/reportAgentPreview/reportAgentPreview.model');db[_0x8b8d('0x7b')]=db[_0x8b8d('0x3')]['import']('../api/cmCustomField/cmCustomField.model');db['Action']=db[_0x8b8d('0x3')][_0x8b8d('0x17')]('../api/action/action.model');db[_0x8b8d('0x7c')]=db[_0x8b8d('0x3')][_0x8b8d('0x17')](_0x8b8d('0x7d'));db[_0x8b8d('0x7e')]=db['sequelize'][_0x8b8d('0x17')](_0x8b8d('0x7f'));db[_0x8b8d('0x80')]=db[_0x8b8d('0x3')][_0x8b8d('0x17')](_0x8b8d('0x81'));db[_0x8b8d('0x82')]=db[_0x8b8d('0x3')]['import'](_0x8b8d('0x83'));db[_0x8b8d('0x84')]=db['sequelize'][_0x8b8d('0x17')](_0x8b8d('0x85'));db[_0x8b8d('0x86')]=db[_0x8b8d('0x3')][_0x8b8d('0x17')](_0x8b8d('0x87'));db[_0x8b8d('0x88')]=db[_0x8b8d('0x3')]['import']('../api/cdr/cdr.model');db[_0x8b8d('0x89')]=db['sequelize'][_0x8b8d('0x17')]('../api/voiceQueuesLog/voiceQueuesLog.model');db['Schedule']=db[_0x8b8d('0x3')][_0x8b8d('0x17')]('../api/schedule/schedule.model');db[_0x8b8d('0x8a')]=db[_0x8b8d('0x3')]['import'](_0x8b8d('0x8b'));db[_0x8b8d('0x8c')]=db[_0x8b8d('0x3')]['import'](_0x8b8d('0x8d'));db[_0x8b8d('0x8e')]=db[_0x8b8d('0x3')][_0x8b8d('0x17')](_0x8b8d('0x8f'));db[_0x8b8d('0x90')]=db[_0x8b8d('0x3')]['import'](_0x8b8d('0x91'));db[_0x8b8d('0x92')]=db[_0x8b8d('0x3')][_0x8b8d('0x17')](_0x8b8d('0x93'));db[_0x8b8d('0x94')]=db['sequelize'][_0x8b8d('0x17')]('../api/integration/integration.model');db[_0x8b8d('0x95')]=db[_0x8b8d('0x3')][_0x8b8d('0x17')](_0x8b8d('0x96'));db[_0x8b8d('0x97')]=db['sequelize'][_0x8b8d('0x17')](_0x8b8d('0x98'));db['AnalyticDefaultReport']=db['sequelize'][_0x8b8d('0x17')](_0x8b8d('0x99'));db[_0x8b8d('0x9a')]=db[_0x8b8d('0x3')][_0x8b8d('0x17')](_0x8b8d('0x9b'));db[_0x8b8d('0x9c')]=db['sequelize'][_0x8b8d('0x17')](_0x8b8d('0x9d'));db['AnalyticFieldReport']=db[_0x8b8d('0x3')][_0x8b8d('0x17')](_0x8b8d('0x9e'));db['AnalyticTreeReport']=db['sequelize'][_0x8b8d('0x17')](_0x8b8d('0x9f'));db[_0x8b8d('0xa0')]=db[_0x8b8d('0x3')]['import']('../api/intSalesforceAccount/intSalesforceAccount.model');db['SalesforceConfiguration']=db[_0x8b8d('0x3')]['import']('../api/intSalesforceConfiguration/intSalesforceConfiguration.model');db['SalesforceField']=db['sequelize'][_0x8b8d('0x17')](_0x8b8d('0xa1'));db[_0x8b8d('0xa2')]=db[_0x8b8d('0x3')][_0x8b8d('0x17')]('../api/intSugarcrmAccount/intSugarcrmAccount.model');db[_0x8b8d('0xa3')]=db[_0x8b8d('0x3')]['import'](_0x8b8d('0xa4'));db['SugarcrmField']=db['sequelize']['import']('../api/intSugarcrmField/intSugarcrmField.model');db['DeskAccount']=db[_0x8b8d('0x3')][_0x8b8d('0x17')](_0x8b8d('0xa5'));db[_0x8b8d('0xa6')]=db[_0x8b8d('0x3')][_0x8b8d('0x17')](_0x8b8d('0xa7'));db[_0x8b8d('0xa8')]=db[_0x8b8d('0x3')][_0x8b8d('0x17')](_0x8b8d('0xa9'));db[_0x8b8d('0xaa')]=db[_0x8b8d('0x3')][_0x8b8d('0x17')](_0x8b8d('0xab'));db['ZohoConfiguration']=db[_0x8b8d('0x3')][_0x8b8d('0x17')](_0x8b8d('0xac'));db[_0x8b8d('0xad')]=db['sequelize']['import'](_0x8b8d('0xae'));db['ZendeskAccount']=db[_0x8b8d('0x3')][_0x8b8d('0x17')](_0x8b8d('0xaf'));db[_0x8b8d('0xb0')]=db[_0x8b8d('0x3')]['import'](_0x8b8d('0xb1'));db[_0x8b8d('0xb2')]=db[_0x8b8d('0x3')][_0x8b8d('0x17')]('../api/intZendeskField/intZendeskField.model');db['FreshdeskAccount']=db[_0x8b8d('0x3')]['import'](_0x8b8d('0xb3'));db[_0x8b8d('0xb4')]=db[_0x8b8d('0x3')][_0x8b8d('0x17')](_0x8b8d('0xb5'));db[_0x8b8d('0xb6')]=db[_0x8b8d('0x3')][_0x8b8d('0x17')](_0x8b8d('0xb7'));db[_0x8b8d('0xb8')]=db['sequelize'][_0x8b8d('0x17')]('../api/intVtigerAccount/intVtigerAccount.model');db[_0x8b8d('0xb9')]=db['sequelize'][_0x8b8d('0x17')](_0x8b8d('0xba'));db[_0x8b8d('0xbb')]=db[_0x8b8d('0x3')][_0x8b8d('0x17')](_0x8b8d('0xbc'));db['ServicenowAccount']=db['sequelize'][_0x8b8d('0x17')]('../api/intServicenowAccount/intServicenowAccount.model');db[_0x8b8d('0xbd')]=db[_0x8b8d('0x3')][_0x8b8d('0x17')](_0x8b8d('0xbe'));db['ServicenowField']=db[_0x8b8d('0x3')][_0x8b8d('0x17')]('../api/intServicenowField/intServicenowField.model');db[_0x8b8d('0xbf')]=db[_0x8b8d('0x3')]['import'](_0x8b8d('0xc0'));db[_0x8b8d('0xc1')]=db[_0x8b8d('0x3')][_0x8b8d('0x17')](_0x8b8d('0xc2'));db[_0x8b8d('0xc3')]=db[_0x8b8d('0x3')][_0x8b8d('0x17')](_0x8b8d('0xc4'));db[_0x8b8d('0xc5')]=db['sequelize'][_0x8b8d('0x17')](_0x8b8d('0xc6'));db[_0x8b8d('0xc7')]=db[_0x8b8d('0x3')]['import'](_0x8b8d('0xc8'));db['FreshsalesField']=db[_0x8b8d('0x3')][_0x8b8d('0x17')]('../api/intFreshsalesField/intFreshsalesField.model');db[_0x8b8d('0x94')]=db[_0x8b8d('0x3')]['import']('../api/integration/integration.model');db['Network']=db[_0x8b8d('0x3')][_0x8b8d('0x17')](_0x8b8d('0xc9'));db[_0x8b8d('0xca')]=db[_0x8b8d('0x3')][_0x8b8d('0x17')](_0x8b8d('0xcb'));db[_0x8b8d('0xcc')]=db[_0x8b8d('0x3')][_0x8b8d('0x17')](_0x8b8d('0xcd'));db[_0x8b8d('0xce')]=db[_0x8b8d('0x3')][_0x8b8d('0x17')]('../api/jscriptyAnswerReport/jscriptyAnswerReport.model');db[_0x8b8d('0xcf')]=db[_0x8b8d('0x3')][_0x8b8d('0x17')](_0x8b8d('0xd0'));db['JscriptySessionReport']=db[_0x8b8d('0x3')][_0x8b8d('0x17')](_0x8b8d('0xd1'));db[_0x8b8d('0xd2')]=db['sequelize'][_0x8b8d('0x17')](_0x8b8d('0xd3'));db['SquareReport']=db[_0x8b8d('0x3')]['import']('../api/squareReport/squareReport.model');db[_0x8b8d('0xd4')]=db[_0x8b8d('0x3')][_0x8b8d('0x17')](_0x8b8d('0xd5'));db[_0x8b8d('0xd6')]=db[_0x8b8d('0x3')][_0x8b8d('0x17')](_0x8b8d('0xd7'));db[_0x8b8d('0xd8')]=db[_0x8b8d('0x3')][_0x8b8d('0x17')](_0x8b8d('0xd9'));db[_0x8b8d('0xda')]=db[_0x8b8d('0x3')][_0x8b8d('0x17')](_0x8b8d('0xdb'));db[_0x8b8d('0xdc')]=db['sequelize']['import'](_0x8b8d('0xdd'));db['SquareRecording']=db[_0x8b8d('0x3')][_0x8b8d('0x17')]('../api/squareRecording/squareRecording.model');db[_0x8b8d('0xde')]=db[_0x8b8d('0x3')][_0x8b8d('0x17')](_0x8b8d('0xdf'));db[_0x8b8d('0xe0')]=db['sequelize']['import'](_0x8b8d('0xe1'));db[_0x8b8d('0xe2')]=db[_0x8b8d('0x3')][_0x8b8d('0x17')]('../api/license/license.model');db[_0x8b8d('0xe3')]=db['sequelize']['import'](_0x8b8d('0xe4'));db[_0x8b8d('0xe5')]=db['sequelize'][_0x8b8d('0x17')](_0x8b8d('0xe6'));db[_0x8b8d('0xe7')]=db['sequelize']['import'](_0x8b8d('0xe8'));db[_0x8b8d('0xe9')]=db[_0x8b8d('0x3')]['import']('../api/plugin/plugin.model');db[_0x8b8d('0xea')]=db[_0x8b8d('0x3')]['import'](_0x8b8d('0xeb'));db[_0x8b8d('0xec')]=db[_0x8b8d('0x3')][_0x8b8d('0x17')](_0x8b8d('0xed'));db[_0x8b8d('0xee')]=db[_0x8b8d('0x3')][_0x8b8d('0x17')](_0x8b8d('0xef'));db[_0x8b8d('0xf0')]=db[_0x8b8d('0x3')][_0x8b8d('0x17')]('../api/openchannelTransferReport/openchannelTransferReport.model');db['SmsTransferReport']=db[_0x8b8d('0x3')][_0x8b8d('0x17')](_0x8b8d('0xf1'));db[_0x8b8d('0xf2')]=db[_0x8b8d('0x3')][_0x8b8d('0x17')]('../api/cmList/cmList.model');db['VoicePrefix']=db['sequelize'][_0x8b8d('0x17')](_0x8b8d('0xf3'));db[_0x8b8d('0xf4')]=db['sequelize'][_0x8b8d('0x17')](_0x8b8d('0xf5'));db[_0x8b8d('0xf6')]=db['sequelize']['import'](_0x8b8d('0xf7'));db['UserProfileResource']=db['sequelize'][_0x8b8d('0x17')](_0x8b8d('0xf8'));db[_0x8b8d('0xf9')]=db[_0x8b8d('0x3')][_0x8b8d('0x17')](_0x8b8d('0xfa'));db[_0x8b8d('0xfb')]=db['sequelize'][_0x8b8d('0x17')](_0x8b8d('0xfc'));db['WhatsappApplication']=db[_0x8b8d('0x3')][_0x8b8d('0x17')]('../api/whatsappApplication/whatsappApplication.model');db[_0x8b8d('0xfd')]=db[_0x8b8d('0x3')]['import']('../api/whatsappInteraction/whatsappInteraction.model');db[_0x8b8d('0xfe')]=db[_0x8b8d('0x3')][_0x8b8d('0x17')](_0x8b8d('0xff'));db[_0x8b8d('0x100')]=db['sequelize'][_0x8b8d('0x17')](_0x8b8d('0x101'));db[_0x8b8d('0x102')]=db['sequelize'][_0x8b8d('0x17')](_0x8b8d('0x103'));db[_0x8b8d('0x104')]=db['sequelize'][_0x8b8d('0x17')](_0x8b8d('0x105'));db[_0x8b8d('0x106')]=db['sequelize'][_0x8b8d('0x17')](_0x8b8d('0x107'));db[_0x8b8d('0x108')]=db['sequelize'][_0x8b8d('0x17')](_0x8b8d('0x109'));db[_0x8b8d('0x10a')]=db['sequelize']['import'](_0x8b8d('0x10b'));db[_0x8b8d('0x10c')]=db[_0x8b8d('0x3')][_0x8b8d('0x17')](_0x8b8d('0x10d'));db[_0x8b8d('0x12')]['hasOne'](db[_0x8b8d('0x22')],{'as':_0x8b8d('0x22'),'onDelete':_0x8b8d('0x10e'),'foreignKey':_0x8b8d('0x10f')});db[_0x8b8d('0x12')][_0x8b8d('0x110')](db['VoiceRecording'],{'as':_0x8b8d('0x111'),'foreignKey':_0x8b8d('0x10f')});db[_0x8b8d('0x12')]['hasMany'](db[_0x8b8d('0x2e')],{'as':'VoiceQueuesRt','foreignKey':_0x8b8d('0x10f')});db[_0x8b8d('0x12')][_0x8b8d('0x110')](db[_0x8b8d('0x18')],{'as':_0x8b8d('0x112'),'onDelete':_0x8b8d('0x10e'),'hooks':!![]});db[_0x8b8d('0x12')][_0x8b8d('0x110')](db['CmHopperFinal'],{'as':_0x8b8d('0x113'),'foreignKey':_0x8b8d('0x10f')});db[_0x8b8d('0x12')]['hasMany'](db[_0x8b8d('0x79')],{'as':_0x8b8d('0x114'),'foreignKey':_0x8b8d('0x10f')});db[_0x8b8d('0x12')][_0x8b8d('0x110')](db['ReportAgentPreview'],{'as':_0x8b8d('0x115'),'foreignKey':_0x8b8d('0x10f')});db[_0x8b8d('0x12')]['hasMany'](db[_0x8b8d('0x60')],{'as':_0x8b8d('0x116'),'foreignKey':_0x8b8d('0x10f')});db[_0x8b8d('0x12')]['hasMany'](db['ChatInteraction'],{'as':'ChatInteractions','foreignKey':_0x8b8d('0x10f')});db[_0x8b8d('0x12')][_0x8b8d('0x110')](db[_0x8b8d('0x5a')],{'as':'SmsInteractions','foreignKey':_0x8b8d('0x10f')});db[_0x8b8d('0x12')][_0x8b8d('0x110')](db['FaxInteraction'],{'as':'FaxInteractions','foreignKey':_0x8b8d('0x10f')});db['User'][_0x8b8d('0x110')](db[_0x8b8d('0x41')],{'as':_0x8b8d('0x117'),'foreignKey':_0x8b8d('0x10f')});db[_0x8b8d('0x12')][_0x8b8d('0x110')](db[_0x8b8d('0xfd')],{'as':'WhatsappInteractions','foreignKey':_0x8b8d('0x10f')});db[_0x8b8d('0x12')][_0x8b8d('0x110')](db['UserNotification'],{'as':_0x8b8d('0x118'),'foreignKey':_0x8b8d('0x119')});db[_0x8b8d('0x12')]['belongsTo'](db[_0x8b8d('0xf4')],{'as':_0x8b8d('0xf4'),'foreignKey':_0x8b8d('0x11a')});db[_0x8b8d('0x12')][_0x8b8d('0x11b')](db['ChatGroup'],{'as':'Groups','through':'chat_group_has_users'});db[_0x8b8d('0x12')][_0x8b8d('0x11b')](db[_0x8b8d('0x72')],{'as':_0x8b8d('0x11c'),'through':_0x8b8d('0x11d')});db[_0x8b8d('0x12')]['belongsToMany'](db['CmList'],{'as':'Lists','through':'cm_user_has_lists'});db[_0x8b8d('0x12')][_0x8b8d('0x11b')](db[_0x8b8d('0xe0')],{'through':_0x8b8d('0x11e')});db['User'][_0x8b8d('0x11b')](db['MailInteraction'],{'as':_0x8b8d('0x117'),'through':_0x8b8d('0x11f')});db[_0x8b8d('0x12')][_0x8b8d('0x11b')](db[_0x8b8d('0x69')],{'as':_0x8b8d('0x120'),'through':'user_has_chat_interactions'});db[_0x8b8d('0x12')][_0x8b8d('0x11b')](db[_0x8b8d('0x4f')],{'as':_0x8b8d('0x121'),'through':'user_has_fax_interactions'});db[_0x8b8d('0x12')][_0x8b8d('0x11b')](db[_0x8b8d('0x5a')],{'as':'SmsInteractions','through':'user_has_sms_interactions'});db[_0x8b8d('0x12')][_0x8b8d('0x11b')](db['OpenchannelInteraction'],{'as':_0x8b8d('0x116'),'through':'user_has_openchannel_interactions'});db[_0x8b8d('0x12')]['belongsToMany'](db['WhatsappInteraction'],{'as':_0x8b8d('0x122'),'through':'user_has_whatsapp_interactions'});db[_0x8b8d('0x12')][_0x8b8d('0x11b')](db[_0x8b8d('0x1c')],{'as':_0x8b8d('0x123'),'through':'UserVoiceQueue','required':![]});db[_0x8b8d('0x12')]['belongsToMany'](db[_0x8b8d('0x124')],{'as':_0x8b8d('0x125'),'through':_0x8b8d('0x10c'),'required':![]});db[_0x8b8d('0x12')]['belongsToMany'](db[_0x8b8d('0x3e')],{'as':_0x8b8d('0x126'),'through':'UserMailQueue','required':![]});db[_0x8b8d('0x12')]['belongsToMany'](db['ChatQueue'],{'as':_0x8b8d('0x127'),'through':_0x8b8d('0x31'),'required':![],'hooks':!![]});db[_0x8b8d('0x12')]['belongsToMany'](db[_0x8b8d('0x128')],{'as':_0x8b8d('0x129'),'through':_0x8b8d('0x12a'),'required':![]});db[_0x8b8d('0x12')][_0x8b8d('0x11b')](db[_0x8b8d('0x5c')],{'as':_0x8b8d('0x12b'),'through':_0x8b8d('0x35'),'required':![]});db[_0x8b8d('0x12')][_0x8b8d('0x11b')](db[_0x8b8d('0x63')],{'as':_0x8b8d('0x12c'),'through':_0x8b8d('0x37'),'required':![]});db['User'][_0x8b8d('0x11b')](db[_0x8b8d('0x104')],{'as':_0x8b8d('0x12d'),'through':_0x8b8d('0x38'),'required':![]});db[_0x8b8d('0x12')][_0x8b8d('0x11b')](db['CmList'],{'through':_0x8b8d('0x12e')});db['User']['belongsToMany'](db['ChatWebsite'],{'as':_0x8b8d('0x12f'),'through':_0x8b8d('0x130')});db['User'][_0x8b8d('0x11b')](db[_0x8b8d('0x4c')],{'as':_0x8b8d('0x131'),'through':_0x8b8d('0x132')});db['User'][_0x8b8d('0x11b')](db[_0x8b8d('0x133')],{'as':_0x8b8d('0x134'),'through':'user_has_mail_accounts'});db[_0x8b8d('0x12')][_0x8b8d('0x11b')](db[_0x8b8d('0x135')],{'as':'OpenchannelAccounts','through':_0x8b8d('0x136')});db[_0x8b8d('0x12')][_0x8b8d('0x11b')](db['SmsAccount'],{'as':_0x8b8d('0x137'),'through':_0x8b8d('0x138')});db[_0x8b8d('0x12')][_0x8b8d('0x11b')](db['WhatsappAccount'],{'as':_0x8b8d('0x139'),'through':_0x8b8d('0x13a')});db[_0x8b8d('0x12')]['belongsToMany'](db[_0x8b8d('0xdc')],{'as':'SquareProjects','through':_0x8b8d('0x13b')});db[_0x8b8d('0x14')]['hasMany'](db['VoiceExtension'],{'as':'SpiedAgents','onDelete':_0x8b8d('0x10e'),'foreignKey':_0x8b8d('0x13c')});db[_0x8b8d('0x16')][_0x8b8d('0x110')](db[_0x8b8d('0x18')],{'onDelete':'cascade'});db[_0x8b8d('0x18')][_0x8b8d('0x110')](db[_0x8b8d('0x18')],{'as':_0x8b8d('0x13d'),'onDelete':_0x8b8d('0x10e')});db['VoiceMusicOnHold'][_0x8b8d('0x11b')](db[_0x8b8d('0x8a')],{'as':_0x8b8d('0x13e'),'through':_0x8b8d('0x13f')});db[_0x8b8d('0x1c')][_0x8b8d('0x110')](db['UserVoiceQueueRt'],{'as':_0x8b8d('0x140'),'foreignKey':_0x8b8d('0x141')});db[_0x8b8d('0x1c')]['hasMany'](db[_0x8b8d('0x142')],{'as':_0x8b8d('0x143'),'foreignKey':_0x8b8d('0x141')});db[_0x8b8d('0x1c')][_0x8b8d('0x110')](db[_0x8b8d('0x77')],{'as':_0x8b8d('0x113'),'foreignKey':'VoiceQueueId'});db[_0x8b8d('0x1c')]['hasMany'](db[_0x8b8d('0x79')],{'as':_0x8b8d('0x144'),'foreignKey':_0x8b8d('0x141')});db[_0x8b8d('0x1c')]['hasMany'](db[_0x8b8d('0x115')],{'as':_0x8b8d('0x115'),'foreignKey':'VoiceQueueId'});db[_0x8b8d('0x1c')][_0x8b8d('0x110')](db['CmHopperBlack'],{'as':_0x8b8d('0x145'),'foreignKey':_0x8b8d('0x141')});db[_0x8b8d('0x1c')][_0x8b8d('0x110')](db[_0x8b8d('0x146')],{'as':_0x8b8d('0x147'),'foreignKey':_0x8b8d('0x141')});db['VoiceQueue']['belongsTo'](db[_0x8b8d('0x148')],{'as':'Trunk','foreignKey':'TrunkId'});db[_0x8b8d('0x1c')][_0x8b8d('0x149')](db['Trunk'],{'as':_0x8b8d('0x14a'),'foreignKey':'TrunkBackupId'});db[_0x8b8d('0x1c')][_0x8b8d('0x149')](db[_0x8b8d('0x84')],{'as':'Interval','foreignKey':_0x8b8d('0x14b')});db[_0x8b8d('0x1c')][_0x8b8d('0x149')](db['Pause'],{'as':_0x8b8d('0x14c'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x8b8d('0x1c')]['belongsToMany'](db['CmList'],{'as':'Lists','through':_0x8b8d('0x14d')});db[_0x8b8d('0x1c')][_0x8b8d('0x11b')](db[_0x8b8d('0x12')],{'as':_0x8b8d('0x14e'),'through':_0x8b8d('0x14f')});db[_0x8b8d('0x1c')][_0x8b8d('0x11b')](db[_0x8b8d('0xe0')],{'as':_0x8b8d('0x150'),'through':'TeamVoiceQueue'});db[_0x8b8d('0x1c')][_0x8b8d('0x11b')](db[_0x8b8d('0xf2')],{'as':_0x8b8d('0x151'),'through':_0x8b8d('0x152')});db[_0x8b8d('0x1e')][_0x8b8d('0x149')](db[_0x8b8d('0x12')],{'as':_0x8b8d('0x12'),'foreignKey':_0x8b8d('0x10f')});db[_0x8b8d('0x20')][_0x8b8d('0x149')](db['User'],{'as':'User','foreignKey':_0x8b8d('0x10f')});db[_0x8b8d('0x22')][_0x8b8d('0x110')](db[_0x8b8d('0x153')],{'as':'Messages','onDelete':'cascade','foreignKey':_0x8b8d('0x154'),'sourceKey':_0x8b8d('0x155')});db[_0x8b8d('0x153')][_0x8b8d('0x149')](db['VoiceMail'],{'foreignKey':'mailboxuser','targetKey':_0x8b8d('0x155')});db['VoiceCallReport'][_0x8b8d('0x110')](db[_0x8b8d('0x28')],{'as':_0x8b8d('0x156'),'foreignKey':_0x8b8d('0x157'),'constraints':![]});db[_0x8b8d('0x158')][_0x8b8d('0x110')](db['VoiceAgentReport'],{'as':_0x8b8d('0x159'),'foreignKey':_0x8b8d('0x157'),'constraints':![]});db['VoiceCallReport']['belongsTo'](db[_0x8b8d('0x12')],{'as':_0x8b8d('0x12'),'foreignKey':_0x8b8d('0x10f')});db['VoiceCallReport'][_0x8b8d('0x149')](db['CmContact'],{'as':_0x8b8d('0x15a'),'foreignKey':_0x8b8d('0x15b')});db['MailServerIn'][_0x8b8d('0x149')](db[_0x8b8d('0x133')],{'as':_0x8b8d('0x133'),'foreignKey':_0x8b8d('0x15c')});db['MailServerOut']['belongsTo'](db[_0x8b8d('0x133')],{'as':_0x8b8d('0x133'),'foreignKey':'MailAccountId'});db['MailAccount'][_0x8b8d('0x15d')](db[_0x8b8d('0x39')],{'as':'Imap','onDelete':_0x8b8d('0x10e')});db[_0x8b8d('0x133')][_0x8b8d('0x15d')](db[_0x8b8d('0x3b')],{'as':_0x8b8d('0x15e'),'onDelete':_0x8b8d('0x10e')});db['MailAccount'][_0x8b8d('0x110')](db[_0x8b8d('0x80')],{'as':_0x8b8d('0x15f'),'foreignKey':'MailAccountId','onDelete':_0x8b8d('0x10e')});db[_0x8b8d('0x133')][_0x8b8d('0x110')](db['CannedAnswer'],{'as':'Answers','foreignKey':_0x8b8d('0x15c')});db['MailAccount'][_0x8b8d('0x110')](db[_0x8b8d('0x43')],{'as':_0x8b8d('0x160'),'foreignKey':_0x8b8d('0x15c')});db['MailAccount'][_0x8b8d('0x110')](db[_0x8b8d('0x41')],{'as':_0x8b8d('0x161')});db[_0x8b8d('0x133')][_0x8b8d('0x110')](db[_0x8b8d('0x45')],{'as':_0x8b8d('0x13d')});db[_0x8b8d('0x133')]['belongsTo'](db[_0x8b8d('0xf2')],{'as':_0x8b8d('0x162'),'foreignKey':_0x8b8d('0x163')});db[_0x8b8d('0x133')][_0x8b8d('0x149')](db['Template'],{'as':_0x8b8d('0x8e'),'foreignKey':'TemplateId'});db[_0x8b8d('0x133')][_0x8b8d('0x149')](db['Pause'],{'as':_0x8b8d('0x14c'),'foreignKey':_0x8b8d('0x164')});db[_0x8b8d('0x133')][_0x8b8d('0x11b')](db[_0x8b8d('0x12')],{'as':'Agents','through':_0x8b8d('0x165')});db[_0x8b8d('0x3e')][_0x8b8d('0x11b')](db[_0x8b8d('0x12')],{'as':_0x8b8d('0x14e'),'through':_0x8b8d('0x32')});db[_0x8b8d('0x3e')][_0x8b8d('0x11b')](db[_0x8b8d('0xe0')],{'through':_0x8b8d('0x166'),'as':_0x8b8d('0x150')});db[_0x8b8d('0x41')][_0x8b8d('0x110')](db['MailMessage'],{'as':'Messages','onDelete':_0x8b8d('0x10e'),'foreignKey':_0x8b8d('0x167')});db['MailInteraction'][_0x8b8d('0x149')](db[_0x8b8d('0x133')],{'as':_0x8b8d('0x168'),'foreignKey':_0x8b8d('0x15c')});db[_0x8b8d('0x41')][_0x8b8d('0x149')](db[_0x8b8d('0x72')],{'as':_0x8b8d('0x15a'),'foreignKey':_0x8b8d('0x15b')});db[_0x8b8d('0x41')]['belongsTo'](db[_0x8b8d('0x12')],{'as':_0x8b8d('0x169'),'foreignKey':_0x8b8d('0x10f')});db['MailInteraction']['belongsToMany'](db[_0x8b8d('0x8c')],{'through':_0x8b8d('0x16a'),'as':_0x8b8d('0x16b')});db[_0x8b8d('0x41')][_0x8b8d('0x11b')](db[_0x8b8d('0x8c')],{'through':_0x8b8d('0x16a'),'as':_0x8b8d('0x16c')});db[_0x8b8d('0x41')][_0x8b8d('0x11b')](db[_0x8b8d('0x12')],{'as':'Users','through':'user_has_mail_interactions','foreignKey':_0x8b8d('0x167')});db[_0x8b8d('0x43')]['hasMany'](db['Attachment'],{'as':_0x8b8d('0x16d'),'onDelete':_0x8b8d('0x10e')});db['MailMessage']['belongsTo'](db['User'],{'as':_0x8b8d('0x12')});db[_0x8b8d('0x43')][_0x8b8d('0x149')](db[_0x8b8d('0x72')],{'onDelete':_0x8b8d('0x10e'),'as':_0x8b8d('0x15a')});db['MailMessage']['belongsTo'](db[_0x8b8d('0x41')],{'as':'Interaction','foreignKey':_0x8b8d('0x167')});db[_0x8b8d('0x43')][_0x8b8d('0x149')](db[_0x8b8d('0x133')],{'as':_0x8b8d('0x168'),'foreignKey':_0x8b8d('0x15c')});db[_0x8b8d('0x43')][_0x8b8d('0x149')](db[_0x8b8d('0x64')],{'as':'ChatWebsite','foreignKey':_0x8b8d('0x16e')});db['MailMessage'][_0x8b8d('0x149')](db[_0x8b8d('0x6b')],{'as':_0x8b8d('0x6b'),'foreignKey':_0x8b8d('0x16f')});db[_0x8b8d('0x45')]['belongsTo'](db[_0x8b8d('0x12')],{'onDelete':_0x8b8d('0x170')});db['MailApplication'][_0x8b8d('0x149')](db['MailQueue'],{'onDelete':_0x8b8d('0x170')});db['MailApplication'][_0x8b8d('0x149')](db[_0x8b8d('0x133')],{'onDelete':_0x8b8d('0x170')});db[_0x8b8d('0x45')][_0x8b8d('0x149')](db[_0x8b8d('0x84')],{'onDelete':_0x8b8d('0x170'),'foreignKey':_0x8b8d('0x14b')});db['MailApplication'][_0x8b8d('0x149')](db[_0x8b8d('0x8c')],{'onDelete':_0x8b8d('0x170'),'foreignKey':'TagId'});db[_0x8b8d('0x171')][_0x8b8d('0x149')](db['MailAccount'],{});db[_0x8b8d('0x171')][_0x8b8d('0x149')](db[_0x8b8d('0xf2')],{'as':_0x8b8d('0x162'),'foreignKey':_0x8b8d('0x163')});db['MailQueueReport'][_0x8b8d('0x149')](db['CmContact'],{'as':_0x8b8d('0x15a'),'foreignKey':_0x8b8d('0x15b')});db[_0x8b8d('0x171')][_0x8b8d('0x149')](db[_0x8b8d('0x41')],{});db[_0x8b8d('0x171')]['belongsTo'](db[_0x8b8d('0x43')],{});db[_0x8b8d('0x171')][_0x8b8d('0x149')](db[_0x8b8d('0x12')],{});db['MailQueueReport'][_0x8b8d('0x149')](db[_0x8b8d('0x3e')],{});db[_0x8b8d('0x48')][_0x8b8d('0x110')](db[_0x8b8d('0x4a')],{'as':_0x8b8d('0x172'),'onDelete':_0x8b8d('0x10e')});db[_0x8b8d('0x4c')][_0x8b8d('0x110')](db['Disposition'],{'as':_0x8b8d('0x15f'),'foreignKey':_0x8b8d('0x173'),'onDelete':_0x8b8d('0x10e')});db[_0x8b8d('0x4c')][_0x8b8d('0x110')](db['CannedAnswer'],{'as':_0x8b8d('0x174'),'foreignKey':'FaxAccountId'});db[_0x8b8d('0x4c')][_0x8b8d('0x110')](db[_0x8b8d('0x4f')],{'as':_0x8b8d('0x161')});db[_0x8b8d('0x4c')][_0x8b8d('0x110')](db[_0x8b8d('0x4d')],{'as':'Applications'});db[_0x8b8d('0x4c')][_0x8b8d('0x110')](db[_0x8b8d('0x18')],{'as':_0x8b8d('0x175'),'onDelete':_0x8b8d('0x10e')});db[_0x8b8d('0x4c')][_0x8b8d('0x110')](db[_0x8b8d('0x51')],{'as':'Messages'});db[_0x8b8d('0x4c')][_0x8b8d('0x149')](db[_0x8b8d('0x148')],{'as':_0x8b8d('0x148')});db[_0x8b8d('0x4c')]['belongsTo'](db['CmList'],{'as':_0x8b8d('0x162'),'foreignKey':_0x8b8d('0x163')});db[_0x8b8d('0x4c')]['belongsTo'](db[_0x8b8d('0x86')],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db[_0x8b8d('0x4c')][_0x8b8d('0x11b')](db['User'],{'as':_0x8b8d('0x14e'),'through':_0x8b8d('0x132')});db[_0x8b8d('0x4d')][_0x8b8d('0x149')](db[_0x8b8d('0x12')],{'onDelete':_0x8b8d('0x170')});db[_0x8b8d('0x4d')][_0x8b8d('0x149')](db[_0x8b8d('0x128')],{'onDelete':'restrict'});db[_0x8b8d('0x4d')][_0x8b8d('0x149')](db['FaxAccount'],{'onDelete':_0x8b8d('0x170')});db[_0x8b8d('0x4d')]['belongsTo'](db['Tag'],{'onDelete':'restrict','foreignKey':'TagId'});db[_0x8b8d('0x4f')][_0x8b8d('0x110')](db[_0x8b8d('0x51')],{'as':_0x8b8d('0x160'),'onDelete':_0x8b8d('0x10e'),'foreignKey':'FaxInteractionId'});db[_0x8b8d('0x4f')][_0x8b8d('0x149')](db[_0x8b8d('0x4c')],{'as':'Account','foreignKey':_0x8b8d('0x173')});db[_0x8b8d('0x4f')][_0x8b8d('0x149')](db['CmContact'],{'as':'Contact','foreignKey':_0x8b8d('0x15b')});db['FaxInteraction']['belongsTo'](db['User'],{'as':_0x8b8d('0x169'),'foreignKey':_0x8b8d('0x10f')});db['FaxInteraction'][_0x8b8d('0x11b')](db[_0x8b8d('0x8c')],{'through':_0x8b8d('0x176'),'as':_0x8b8d('0x16b')});db[_0x8b8d('0x4f')][_0x8b8d('0x11b')](db[_0x8b8d('0x8c')],{'through':'fax_interaction_has_tags','as':_0x8b8d('0x16c')});db[_0x8b8d('0x4f')][_0x8b8d('0x11b')](db[_0x8b8d('0x12')],{'as':_0x8b8d('0x177'),'through':_0x8b8d('0x178'),'foreignKey':_0x8b8d('0x179')});db[_0x8b8d('0x51')][_0x8b8d('0x149')](db[_0x8b8d('0x12')],{'onDelete':'cascade','as':_0x8b8d('0x12')});db[_0x8b8d('0x51')][_0x8b8d('0x149')](db[_0x8b8d('0x4f')],{'as':_0x8b8d('0x17a'),'foreignKey':_0x8b8d('0x179')});db[_0x8b8d('0x51')][_0x8b8d('0x149')](db['CmContact'],{'onDelete':'cascade','as':'Contact'});db[_0x8b8d('0x51')][_0x8b8d('0x149')](db[_0x8b8d('0xe7')],{'as':_0x8b8d('0xe7'),'foreignKey':_0x8b8d('0x17b')});db['FaxMessage'][_0x8b8d('0x149')](db[_0x8b8d('0x4c')],{'as':_0x8b8d('0x168'),'foreignKey':_0x8b8d('0x173')});db[_0x8b8d('0x128')][_0x8b8d('0x11b')](db[_0x8b8d('0x12')],{'as':'Agents','through':'UserFaxQueue'});db[_0x8b8d('0x128')][_0x8b8d('0x11b')](db[_0x8b8d('0xe0')],{'through':'team_has_fax_queues','as':_0x8b8d('0x150')});db[_0x8b8d('0x54')][_0x8b8d('0x149')](db[_0x8b8d('0x4c')],{});db[_0x8b8d('0x54')][_0x8b8d('0x149')](db[_0x8b8d('0xf2')],{'as':_0x8b8d('0x162'),'foreignKey':_0x8b8d('0x163')});db['FaxQueueReport']['belongsTo'](db[_0x8b8d('0x72')],{'as':_0x8b8d('0x15a'),'foreignKey':_0x8b8d('0x15b')});db['FaxQueueReport'][_0x8b8d('0x149')](db['FaxInteraction'],{});db[_0x8b8d('0x54')][_0x8b8d('0x149')](db[_0x8b8d('0x51')],{});db['FaxQueueReport'][_0x8b8d('0x149')](db[_0x8b8d('0x12')],{});db[_0x8b8d('0x54')]['belongsTo'](db[_0x8b8d('0x128')],{});db[_0x8b8d('0x56')][_0x8b8d('0x110')](db['Disposition'],{'as':_0x8b8d('0x15f'),'foreignKey':_0x8b8d('0x17c'),'onDelete':'cascade'});db[_0x8b8d('0x56')]['hasMany'](db['CannedAnswer'],{'as':'Answers','foreignKey':_0x8b8d('0x17c')});db[_0x8b8d('0x56')]['hasMany'](db[_0x8b8d('0x17d')],{'as':_0x8b8d('0x160'),'foreignKey':_0x8b8d('0x17c')});db['SmsAccount']['hasMany'](db['SmsInteraction'],{'as':_0x8b8d('0x161')});db['SmsAccount']['hasMany'](db[_0x8b8d('0x58')],{'as':_0x8b8d('0x13d')});db[_0x8b8d('0x56')]['belongsTo'](db[_0x8b8d('0xf2')],{'as':_0x8b8d('0x162'),'foreignKey':_0x8b8d('0x163')});db[_0x8b8d('0x56')][_0x8b8d('0x149')](db[_0x8b8d('0x86')],{'as':_0x8b8d('0x14c'),'foreignKey':_0x8b8d('0x164')});db[_0x8b8d('0x56')][_0x8b8d('0x11b')](db[_0x8b8d('0x12')],{'as':_0x8b8d('0x14e'),'through':_0x8b8d('0x138')});db[_0x8b8d('0x58')][_0x8b8d('0x149')](db[_0x8b8d('0x12')],{'onDelete':_0x8b8d('0x170')});db['SmsApplication']['belongsTo'](db[_0x8b8d('0x5c')],{'onDelete':_0x8b8d('0x170')});db[_0x8b8d('0x58')][_0x8b8d('0x149')](db[_0x8b8d('0x56')],{'onDelete':_0x8b8d('0x170')});db[_0x8b8d('0x58')]['belongsTo'](db[_0x8b8d('0x84')],{'onDelete':'restrict','foreignKey':'IntervalId'});db[_0x8b8d('0x58')]['belongsTo'](db[_0x8b8d('0x8c')],{'onDelete':_0x8b8d('0x170'),'foreignKey':_0x8b8d('0x17e')});db[_0x8b8d('0x5a')]['hasMany'](db[_0x8b8d('0x17d')],{'as':_0x8b8d('0x160'),'onDelete':_0x8b8d('0x10e'),'foreignKey':_0x8b8d('0x17f')});db['SmsInteraction'][_0x8b8d('0x149')](db[_0x8b8d('0x56')],{'as':'Account','foreignKey':'SmsAccountId'});db[_0x8b8d('0x5a')]['belongsTo'](db['CmContact'],{'as':_0x8b8d('0x15a'),'foreignKey':'ContactId'});db['SmsInteraction']['belongsTo'](db['User'],{'as':'Owner','foreignKey':_0x8b8d('0x10f')});db['SmsInteraction'][_0x8b8d('0x11b')](db[_0x8b8d('0x8c')],{'through':_0x8b8d('0x180'),'as':_0x8b8d('0x16b')});db[_0x8b8d('0x5a')][_0x8b8d('0x11b')](db[_0x8b8d('0x8c')],{'through':_0x8b8d('0x180'),'as':_0x8b8d('0x16c')});db[_0x8b8d('0x5a')][_0x8b8d('0x11b')](db[_0x8b8d('0x12')],{'as':_0x8b8d('0x177'),'through':_0x8b8d('0x181'),'foreignKey':_0x8b8d('0x17f')});db[_0x8b8d('0x17d')][_0x8b8d('0x149')](db[_0x8b8d('0x12')],{'as':'User'});db[_0x8b8d('0x17d')][_0x8b8d('0x149')](db['CmContact'],{'onDelete':_0x8b8d('0x10e'),'as':_0x8b8d('0x15a')});db[_0x8b8d('0x17d')][_0x8b8d('0x149')](db['SmsInteraction'],{'onDelete':'cascade','as':_0x8b8d('0x17a'),'foreignKey':_0x8b8d('0x17f')});db[_0x8b8d('0x17d')][_0x8b8d('0x149')](db[_0x8b8d('0x56')],{'as':'Account','foreignKey':_0x8b8d('0x17c')});db[_0x8b8d('0x5c')][_0x8b8d('0x11b')](db[_0x8b8d('0x12')],{'as':_0x8b8d('0x14e'),'through':'UserSmsQueue','foreignKey':_0x8b8d('0x182')});db['SmsQueue'][_0x8b8d('0x11b')](db[_0x8b8d('0xe0')],{'through':'team_has_sms_queues','as':'Teams'});db[_0x8b8d('0x135')][_0x8b8d('0x110')](db[_0x8b8d('0x80')],{'as':_0x8b8d('0x15f'),'foreignKey':_0x8b8d('0x183'),'onDelete':_0x8b8d('0x10e')});db['OpenchannelAccount'][_0x8b8d('0x110')](db['CannedAnswer'],{'as':_0x8b8d('0x174'),'foreignKey':'OpenchannelAccountId'});db[_0x8b8d('0x135')][_0x8b8d('0x110')](db[_0x8b8d('0x60')],{'as':_0x8b8d('0x161'),'foreignKey':_0x8b8d('0x183')});db[_0x8b8d('0x135')][_0x8b8d('0x110')](db[_0x8b8d('0x184')],{'as':'Messages','foreignKey':'OpenchannelAccountId'});db[_0x8b8d('0x135')][_0x8b8d('0x110')](db[_0x8b8d('0x5e')],{'as':_0x8b8d('0x13d'),'foreignKey':'OpenchannelAccountId'});db[_0x8b8d('0x135')][_0x8b8d('0x149')](db[_0x8b8d('0xf2')],{'as':_0x8b8d('0x162'),'foreignKey':_0x8b8d('0x163')});db[_0x8b8d('0x135')]['belongsTo'](db[_0x8b8d('0x86')],{'as':_0x8b8d('0x14c'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x8b8d('0x135')]['belongsToMany'](db[_0x8b8d('0x12')],{'as':_0x8b8d('0x14e'),'through':'user_has_openchannel_accounts'});db['OpenchannelApplication'][_0x8b8d('0x149')](db['User'],{'onDelete':_0x8b8d('0x170')});db['OpenchannelApplication'][_0x8b8d('0x149')](db[_0x8b8d('0x63')],{'onDelete':_0x8b8d('0x170'),'foreignKey':_0x8b8d('0x185')});db[_0x8b8d('0x5e')][_0x8b8d('0x149')](db['OpenchannelAccount'],{'onDelete':_0x8b8d('0x170'),'foreignKey':_0x8b8d('0x183')});db[_0x8b8d('0x5e')][_0x8b8d('0x149')](db[_0x8b8d('0x84')],{'onDelete':_0x8b8d('0x170'),'foreignKey':_0x8b8d('0x14b')});db[_0x8b8d('0x5e')]['belongsTo'](db[_0x8b8d('0x8c')],{'onDelete':_0x8b8d('0x170'),'foreignKey':_0x8b8d('0x17e')});db['OpenchannelInteraction'][_0x8b8d('0x110')](db[_0x8b8d('0x184')],{'as':'Messages','onDelete':_0x8b8d('0x10e'),'foreignKey':_0x8b8d('0x186')});db[_0x8b8d('0x60')][_0x8b8d('0x149')](db[_0x8b8d('0x135')],{'as':_0x8b8d('0x168'),'foreignKey':_0x8b8d('0x183')});db[_0x8b8d('0x60')][_0x8b8d('0x149')](db[_0x8b8d('0x72')],{'as':_0x8b8d('0x15a'),'foreignKey':_0x8b8d('0x15b')});db[_0x8b8d('0x60')][_0x8b8d('0x149')](db[_0x8b8d('0x12')],{'as':_0x8b8d('0x169'),'foreignKey':_0x8b8d('0x10f')});db['OpenchannelInteraction'][_0x8b8d('0x11b')](db[_0x8b8d('0x8c')],{'through':'openchannel_interaction_has_tags','as':_0x8b8d('0x16b')});db[_0x8b8d('0x60')][_0x8b8d('0x11b')](db[_0x8b8d('0x8c')],{'through':_0x8b8d('0x187'),'as':_0x8b8d('0x16c')});db[_0x8b8d('0x60')][_0x8b8d('0x11b')](db['User'],{'as':_0x8b8d('0x177'),'through':'user_has_openchannel_interactions','foreignKey':_0x8b8d('0x186')});db['OpenchannelMessage'][_0x8b8d('0x149')](db['User'],{'onDelete':_0x8b8d('0x10e'),'as':_0x8b8d('0x12')});db[_0x8b8d('0x184')][_0x8b8d('0x149')](db['CmContact'],{'onDelete':'cascade','as':_0x8b8d('0x15a')});db[_0x8b8d('0x184')][_0x8b8d('0x149')](db[_0x8b8d('0x60')],{'onDelete':_0x8b8d('0x10e'),'as':_0x8b8d('0x17a'),'foreignKey':_0x8b8d('0x186')});db[_0x8b8d('0x184')][_0x8b8d('0x149')](db[_0x8b8d('0xe7')],{'as':_0x8b8d('0xe7'),'foreignKey':_0x8b8d('0x17b')});db[_0x8b8d('0x184')]['belongsTo'](db[_0x8b8d('0x135')],{'as':_0x8b8d('0x168'),'foreignKey':_0x8b8d('0x183')});db['OpenchannelQueue']['belongsToMany'](db[_0x8b8d('0x12')],{'as':_0x8b8d('0x14e'),'through':_0x8b8d('0x37'),'foreignKey':'OpenchannelQueueId'});db['OpenchannelQueue'][_0x8b8d('0x11b')](db[_0x8b8d('0xe0')],{'through':_0x8b8d('0x188'),'as':'Teams'});db[_0x8b8d('0x64')][_0x8b8d('0x110')](db[_0x8b8d('0x80')],{'as':_0x8b8d('0x15f'),'foreignKey':_0x8b8d('0x16e'),'onDelete':_0x8b8d('0x10e')});db['ChatWebsite'][_0x8b8d('0x110')](db[_0x8b8d('0x7e')],{'as':_0x8b8d('0x174'),'foreignKey':_0x8b8d('0x16e')});db[_0x8b8d('0x64')][_0x8b8d('0x110')](db[_0x8b8d('0x189')],{'as':'ProactiveActions'});db[_0x8b8d('0x64')][_0x8b8d('0x110')](db['ChatInteraction'],{'as':_0x8b8d('0x161')});db[_0x8b8d('0x64')]['hasMany'](db[_0x8b8d('0x68')],{'as':_0x8b8d('0x13d')});db[_0x8b8d('0x64')]['hasMany'](db[_0x8b8d('0x18a')],{'as':_0x8b8d('0x160')});db[_0x8b8d('0x64')][_0x8b8d('0x149')](db[_0x8b8d('0xf2')],{'as':_0x8b8d('0x162'),'foreignKey':_0x8b8d('0x163')});db['ChatWebsite'][_0x8b8d('0x149')](db['Interval'],{'as':_0x8b8d('0x84'),'foreignKey':'IntervalId'});db[_0x8b8d('0x64')][_0x8b8d('0x149')](db['MailAccount'],{'as':_0x8b8d('0x133'),'foreignKey':_0x8b8d('0x15c')});db['ChatWebsite']['belongsTo'](db[_0x8b8d('0x86')],{'as':'mandatoryDispositionPause','foreignKey':_0x8b8d('0x164')});db[_0x8b8d('0x64')][_0x8b8d('0x11b')](db[_0x8b8d('0x12')],{'as':_0x8b8d('0x14e'),'through':'user_has_chat_websites'});db[_0x8b8d('0x66')]['belongsTo'](db[_0x8b8d('0x135')],{});db[_0x8b8d('0x66')][_0x8b8d('0x149')](db[_0x8b8d('0xf2')],{'as':_0x8b8d('0x162'),'foreignKey':_0x8b8d('0x163')});db[_0x8b8d('0x66')]['belongsTo'](db[_0x8b8d('0x72')],{'as':'Contact','foreignKey':_0x8b8d('0x15b')});db[_0x8b8d('0x66')][_0x8b8d('0x149')](db[_0x8b8d('0x60')],{});db[_0x8b8d('0x66')][_0x8b8d('0x149')](db[_0x8b8d('0x184')],{});db[_0x8b8d('0x66')][_0x8b8d('0x149')](db[_0x8b8d('0x12')],{});db[_0x8b8d('0x66')][_0x8b8d('0x149')](db[_0x8b8d('0x63')],{});db[_0x8b8d('0x68')][_0x8b8d('0x149')](db[_0x8b8d('0x12')],{'as':'Agent','foreignKey':_0x8b8d('0x10f'),'onDelete':_0x8b8d('0x170')});db[_0x8b8d('0x68')]['belongsTo'](db[_0x8b8d('0x18b')],{'as':'Queue','foreignKey':_0x8b8d('0x18c'),'onDelete':'restrict'});db[_0x8b8d('0x68')][_0x8b8d('0x149')](db[_0x8b8d('0x64')],{'as':_0x8b8d('0x18d'),'foreignKey':_0x8b8d('0x16e'),'onDelete':_0x8b8d('0x170')});db[_0x8b8d('0x68')][_0x8b8d('0x149')](db[_0x8b8d('0x8c')],{'onDelete':_0x8b8d('0x170'),'foreignKey':_0x8b8d('0x17e')});db[_0x8b8d('0x69')]['hasMany'](db[_0x8b8d('0x18a')],{'as':_0x8b8d('0x160'),'onDelete':_0x8b8d('0x10e'),'foreignKey':_0x8b8d('0x18e')});db[_0x8b8d('0x69')][_0x8b8d('0x149')](db[_0x8b8d('0x64')],{'as':'Account','foreignKey':_0x8b8d('0x16e')});db[_0x8b8d('0x69')]['belongsTo'](db[_0x8b8d('0x72')],{'as':_0x8b8d('0x15a'),'foreignKey':_0x8b8d('0x15b')});db[_0x8b8d('0x69')][_0x8b8d('0x149')](db[_0x8b8d('0x12')],{'as':'Owner','foreignKey':_0x8b8d('0x10f')});db[_0x8b8d('0x69')][_0x8b8d('0x11b')](db[_0x8b8d('0x8c')],{'through':'chat_interaction_has_tags','as':'Tags'});db[_0x8b8d('0x69')][_0x8b8d('0x11b')](db[_0x8b8d('0x8c')],{'through':'chat_interaction_has_tags','as':_0x8b8d('0x16c')});db[_0x8b8d('0x69')][_0x8b8d('0x11b')](db['User'],{'as':_0x8b8d('0x177'),'through':_0x8b8d('0x18f'),'foreignKey':_0x8b8d('0x18e')});db['ChatMessage'][_0x8b8d('0x149')](db['User'],{'onDelete':_0x8b8d('0x10e'),'as':_0x8b8d('0x12')});db['ChatMessage']['belongsTo'](db[_0x8b8d('0x72')],{'onDelete':_0x8b8d('0x10e'),'as':_0x8b8d('0x15a'),'foreignKey':'ContactId'});db[_0x8b8d('0x18a')][_0x8b8d('0x149')](db['ChatInteraction'],{'onDelete':'cascade','as':'Interaction','foreignKey':_0x8b8d('0x18e')});db[_0x8b8d('0x18a')][_0x8b8d('0x149')](db[_0x8b8d('0xe7')],{'as':_0x8b8d('0xe7'),'foreignKey':'AttachmentId'});db[_0x8b8d('0x18a')][_0x8b8d('0x149')](db[_0x8b8d('0x64')],{'as':'Account','foreignKey':_0x8b8d('0x16e')});db['ChatOfflineMessage']['hasMany'](db['Attachment'],{'as':'Attachments','foreignKey':'ChatOfflineMessageId','onDelete':_0x8b8d('0x10e'),'hooks':!![]});db['ChatOfflineMessage'][_0x8b8d('0x149')](db[_0x8b8d('0x72')],{'onDelete':'cascade','as':_0x8b8d('0x15a'),'foreignKey':_0x8b8d('0x15b')});db[_0x8b8d('0x6b')][_0x8b8d('0x149')](db[_0x8b8d('0x64')],{'as':_0x8b8d('0x168'),'foreignKey':_0x8b8d('0x16e')});db[_0x8b8d('0x18b')][_0x8b8d('0x11b')](db[_0x8b8d('0x12')],{'as':'Agents','through':_0x8b8d('0x31'),'hooks':!![]});db[_0x8b8d('0x18b')][_0x8b8d('0x11b')](db[_0x8b8d('0xe0')],{'through':_0x8b8d('0x190'),'as':_0x8b8d('0x150')});db[_0x8b8d('0x6e')][_0x8b8d('0x110')](db[_0x8b8d('0xcc')],{'as':_0x8b8d('0x160'),'foreignKey':_0x8b8d('0x191'),'onDelete':_0x8b8d('0x10e')});db[_0x8b8d('0x6e')]['belongsToMany'](db[_0x8b8d('0x12')],{'as':_0x8b8d('0x140'),'through':'chat_group_has_users'});db[_0x8b8d('0x189')]['belongsTo'](db['ChatWebsite'],{'as':'Website','foreignKey':_0x8b8d('0x16e')});db[_0x8b8d('0x70')][_0x8b8d('0x110')](db[_0x8b8d('0x72')],{'as':'Contacts','foreignKey':_0x8b8d('0x192')});db['CmContact'][_0x8b8d('0x110')](db[_0x8b8d('0x142')],{'as':_0x8b8d('0x143'),'foreignKey':_0x8b8d('0x15b')});db[_0x8b8d('0x72')][_0x8b8d('0x110')](db[_0x8b8d('0x77')],{'as':_0x8b8d('0x113'),'foreignKey':'ContactId'});db[_0x8b8d('0x72')]['hasMany'](db['CmHopperHistory'],{'as':_0x8b8d('0x144'),'foreignKey':_0x8b8d('0x15b')});db[_0x8b8d('0x72')]['hasMany'](db[_0x8b8d('0x115')],{'as':_0x8b8d('0x115'),'foreignKey':'ContactId'});db[_0x8b8d('0x72')][_0x8b8d('0x110')](db['JscriptySessionReport'],{'as':'JscriptySessions','foreignKey':_0x8b8d('0x15b')});db['CmContact'][_0x8b8d('0x110')](db[_0x8b8d('0x60')],{'as':'OpenchannelInteractions','foreignKey':_0x8b8d('0x15b'),'onDelete':_0x8b8d('0x170')});db[_0x8b8d('0x72')][_0x8b8d('0x110')](db[_0x8b8d('0x69')],{'as':_0x8b8d('0x120'),'foreignKey':_0x8b8d('0x15b'),'onDelete':_0x8b8d('0x170')});db[_0x8b8d('0x72')][_0x8b8d('0x110')](db[_0x8b8d('0x5a')],{'as':_0x8b8d('0x193'),'foreignKey':_0x8b8d('0x15b'),'onDelete':'restrict'});db[_0x8b8d('0x72')][_0x8b8d('0x110')](db[_0x8b8d('0x4f')],{'as':_0x8b8d('0x121'),'foreignKey':_0x8b8d('0x15b'),'onDelete':_0x8b8d('0x170')});db[_0x8b8d('0x72')][_0x8b8d('0x110')](db[_0x8b8d('0x41')],{'as':_0x8b8d('0x117'),'foreignKey':'ContactId','onDelete':_0x8b8d('0x170')});db['CmContact'][_0x8b8d('0x149')](db['CmCompany'],{'as':_0x8b8d('0x194'),'foreignKey':'CompanyId'});db[_0x8b8d('0x72')][_0x8b8d('0x149')](db[_0x8b8d('0xf2')],{'as':_0x8b8d('0x162'),'foreignKey':_0x8b8d('0x163'),'onDelete':'cascade'});db['CmContact']['belongsToMany'](db[_0x8b8d('0x12')],{'as':_0x8b8d('0x177'),'through':_0x8b8d('0x11d')});db[_0x8b8d('0x72')][_0x8b8d('0x11b')](db[_0x8b8d('0x8c')],{'as':_0x8b8d('0x16b'),'through':'cm_contact_has_tags'});db[_0x8b8d('0x72')]['belongsToMany'](db['Tag'],{'through':_0x8b8d('0x195'),'as':'ThroughTags'});db[_0x8b8d('0x142')][_0x8b8d('0x149')](db[_0x8b8d('0x72')],{'as':'Contact','foreignKey':'ContactId','onDelete':'cascade'});db['CmHopper']['belongsTo'](db['CmList'],{'as':_0x8b8d('0x162'),'foreignKey':_0x8b8d('0x163'),'onDelete':'cascade'});db['CmHopper']['belongsTo'](db[_0x8b8d('0x12')],{'as':_0x8b8d('0x196'),'foreignKey':'UserId'});db['CmHopper']['belongsTo'](db['VoiceQueue'],{'as':_0x8b8d('0x197'),'foreignKey':_0x8b8d('0x141'),'onDelete':_0x8b8d('0x10e')});db[_0x8b8d('0x142')]['belongsTo'](db[_0x8b8d('0xe3')],{'as':_0x8b8d('0xe3'),'foreignKey':_0x8b8d('0x198'),'onDelete':_0x8b8d('0x10e')});db['CmHopper'][_0x8b8d('0x149')](db[_0x8b8d('0x12')],{'as':'Owner','foreignKey':'OwnerId'});db[_0x8b8d('0x75')][_0x8b8d('0x149')](db[_0x8b8d('0x72')],{'as':_0x8b8d('0x15a'),'foreignKey':_0x8b8d('0x15b'),'onDelete':'cascade'});db['CmHopperBlack'][_0x8b8d('0x149')](db[_0x8b8d('0xf2')],{'as':_0x8b8d('0x162'),'foreignKey':_0x8b8d('0x163'),'onDelete':'cascade'});db[_0x8b8d('0x75')]['belongsTo'](db[_0x8b8d('0x1c')],{'as':_0x8b8d('0x197'),'foreignKey':_0x8b8d('0x141'),'onDelete':_0x8b8d('0x10e')});db[_0x8b8d('0x75')][_0x8b8d('0x149')](db[_0x8b8d('0xe3')],{'as':_0x8b8d('0xe3'),'foreignKey':_0x8b8d('0x198'),'onDelete':_0x8b8d('0x10e')});db[_0x8b8d('0x7c')][_0x8b8d('0x110')](db['Condition'],{'as':{'plural':_0x8b8d('0x199'),'singular':_0x8b8d('0x19a')},'foreignKey':_0x8b8d('0x19b'),'onDelete':_0x8b8d('0x10e'),'hooks':!![]});db[_0x8b8d('0x7c')][_0x8b8d('0x110')](db[_0x8b8d('0x82')],{'as':{'plural':_0x8b8d('0x19c'),'singular':_0x8b8d('0x19d')},'foreignKey':_0x8b8d('0x19e'),'onDelete':'cascade','hooks':!![]});db[_0x8b8d('0x7c')]['hasMany'](db[_0x8b8d('0x19f')],{'as':'Actions','foreignKey':'AutomationId','onDelete':_0x8b8d('0x10e'),'hooks':!![]});db[_0x8b8d('0x80')][_0x8b8d('0x110')](db['Disposition'],{'as':_0x8b8d('0x15f'),'foreignKey':_0x8b8d('0x1a0'),'onDelete':'cascade'});db[_0x8b8d('0x84')]['hasMany'](db[_0x8b8d('0x84')],{'as':_0x8b8d('0x1a1'),'foreignKey':_0x8b8d('0x14b'),'onDelete':'cascade','hooks':!![],'required':![]});db[_0x8b8d('0x84')][_0x8b8d('0x110')](db['VoiceExtension'],{'as':_0x8b8d('0x112'),'foreignKey':_0x8b8d('0x14b'),'onDelete':'restrict'});db['Interval'][_0x8b8d('0x110')](db[_0x8b8d('0x45')],{'as':_0x8b8d('0x1a2'),'foreignKey':_0x8b8d('0x14b')});db[_0x8b8d('0x84')]['hasMany'](db[_0x8b8d('0x68')],{'as':_0x8b8d('0x1a3'),'foreignKey':_0x8b8d('0x14b')});db[_0x8b8d('0x84')]['hasMany'](db[_0x8b8d('0x4d')],{'as':_0x8b8d('0x1a4'),'foreignKey':_0x8b8d('0x14b')});db[_0x8b8d('0x84')][_0x8b8d('0x110')](db[_0x8b8d('0x58')],{'as':_0x8b8d('0x1a5'),'foreignKey':_0x8b8d('0x14b')});db[_0x8b8d('0x1a6')][_0x8b8d('0x149')](db[_0x8b8d('0x133')],{});db[_0x8b8d('0x1a6')][_0x8b8d('0x149')](db[_0x8b8d('0x1a7')],{'foreignKey':_0x8b8d('0x1a8')});db['Schedule'][_0x8b8d('0x149')](db['AnalyticCustomReport'],{'foreignKey':'CustomReportId'});db[_0x8b8d('0x8a')][_0x8b8d('0x11b')](db['VoiceMusicOnHold'],{'as':_0x8b8d('0x1a9'),'through':_0x8b8d('0x13f'),'onDelete':_0x8b8d('0x170')});db[_0x8b8d('0x8c')][_0x8b8d('0x11b')](db[_0x8b8d('0x72')],{'through':'cm_contact_has_tags'});db[_0x8b8d('0x8c')][_0x8b8d('0x11b')](db['ChatInteraction'],{'through':_0x8b8d('0x1aa')});db[_0x8b8d('0x8c')][_0x8b8d('0x11b')](db['MailInteraction'],{'through':_0x8b8d('0x16a')});db[_0x8b8d('0x8c')][_0x8b8d('0x11b')](db[_0x8b8d('0x5a')],{'through':_0x8b8d('0x180')});db[_0x8b8d('0x8c')][_0x8b8d('0x11b')](db[_0x8b8d('0x4f')],{'through':_0x8b8d('0x176')});db[_0x8b8d('0x8c')][_0x8b8d('0x11b')](db[_0x8b8d('0x60')],{'through':_0x8b8d('0x187')});db[_0x8b8d('0x8c')][_0x8b8d('0x11b')](db[_0x8b8d('0xfd')],{'through':_0x8b8d('0x1ab')});db[_0x8b8d('0x90')]['hasMany'](db[_0x8b8d('0x82')],{'as':{'plural':_0x8b8d('0x1ac'),'singular':_0x8b8d('0x1ad')},'foreignKey':_0x8b8d('0x1ae'),'onDelete':_0x8b8d('0x10e'),'hooks':!![]});db[_0x8b8d('0x90')][_0x8b8d('0x110')](db[_0x8b8d('0x82')],{'as':{'plural':_0x8b8d('0x1af'),'singular':_0x8b8d('0x1b0')},'foreignKey':_0x8b8d('0x1b1'),'onDelete':_0x8b8d('0x10e'),'hooks':!![]});db[_0x8b8d('0x90')][_0x8b8d('0x110')](db['Action'],{'as':_0x8b8d('0x1b2'),'foreignKey':_0x8b8d('0x1b3'),'onDelete':_0x8b8d('0x10e'),'hooks':!![]});db[_0x8b8d('0x97')][_0x8b8d('0x110')](db[_0x8b8d('0x1b4')],{'as':_0x8b8d('0x1b5'),'onDelete':'cascade','foreignKey':'CustomReportId','hooks':!![]});db[_0x8b8d('0x1a7')][_0x8b8d('0x110')](db['AnalyticFieldReport'],{'as':_0x8b8d('0x1b5'),'onDelete':_0x8b8d('0x10e'),'foreignKey':_0x8b8d('0x1a8')});db[_0x8b8d('0x9c')][_0x8b8d('0x110')](db['AnalyticFieldReport'],{'as':_0x8b8d('0x1b5'),'onDelete':'cascade','foreignKey':'MetricId'});db[_0x8b8d('0x1b4')][_0x8b8d('0x149')](db[_0x8b8d('0x9c')],{'foreignKey':_0x8b8d('0x1b6')});db[_0x8b8d('0xa0')][_0x8b8d('0x110')](db[_0x8b8d('0x1b7')],{'as':_0x8b8d('0x1b8'),'onDelete':'cascade','foreignKey':_0x8b8d('0x1b9')});db['SalesforceConfiguration']['hasMany'](db[_0x8b8d('0x1ba')],{'as':_0x8b8d('0x1bb'),'onDelete':'cascade','foreignKey':_0x8b8d('0x1bc')});db['SalesforceConfiguration'][_0x8b8d('0x110')](db[_0x8b8d('0x1ba')],{'as':_0x8b8d('0x1bd'),'onDelete':_0x8b8d('0x10e'),'foreignKey':_0x8b8d('0x1be')});db[_0x8b8d('0x1b7')][_0x8b8d('0x110')](db[_0x8b8d('0x1ba')],{'as':_0x8b8d('0x1b5'),'onDelete':_0x8b8d('0x10e'),'foreignKey':_0x8b8d('0x1bf')});db[_0x8b8d('0x1b7')][_0x8b8d('0x149')](db[_0x8b8d('0xa0')],{'as':'Account','foreignKey':'AccountId'});db['SalesforceField'][_0x8b8d('0x110')](db[_0x8b8d('0x1ba')],{'as':_0x8b8d('0x1c0'),'foreignKey':'SubjectId'});db[_0x8b8d('0x1ba')]['hasMany'](db['SalesforceField'],{'as':_0x8b8d('0x1c1'),'foreignKey':'DescriptionId'});db['SalesforceField']['hasMany'](db[_0x8b8d('0x1ba')],{'as':_0x8b8d('0x1c2'),'foreignKey':_0x8b8d('0x1bf')});db[_0x8b8d('0x1ba')][_0x8b8d('0x149')](db[_0x8b8d('0x92')],{'as':_0x8b8d('0x92'),'foreignKey':_0x8b8d('0x1c3')});db[_0x8b8d('0xa2')][_0x8b8d('0x110')](db[_0x8b8d('0xa3')],{'as':_0x8b8d('0x1b8'),'onDelete':'cascade','foreignKey':_0x8b8d('0x1b9')});db['SugarcrmConfiguration'][_0x8b8d('0x110')](db[_0x8b8d('0x1c4')],{'as':_0x8b8d('0x1bb'),'onDelete':_0x8b8d('0x10e'),'foreignKey':_0x8b8d('0x1bc')});db[_0x8b8d('0xa3')]['hasMany'](db[_0x8b8d('0x1c4')],{'as':'Descriptions','onDelete':_0x8b8d('0x10e'),'foreignKey':_0x8b8d('0x1be')});db[_0x8b8d('0xa3')][_0x8b8d('0x110')](db['SugarcrmField'],{'as':_0x8b8d('0x1b5'),'onDelete':_0x8b8d('0x10e'),'foreignKey':_0x8b8d('0x1bf')});db[_0x8b8d('0xa3')][_0x8b8d('0x149')](db[_0x8b8d('0xa2')],{'as':_0x8b8d('0x168'),'foreignKey':_0x8b8d('0x1b9')});db[_0x8b8d('0x1c4')][_0x8b8d('0x110')](db['SugarcrmField'],{'as':_0x8b8d('0x1c0'),'foreignKey':_0x8b8d('0x1bc')});db['SugarcrmField']['hasMany'](db[_0x8b8d('0x1c4')],{'as':_0x8b8d('0x1c1'),'foreignKey':_0x8b8d('0x1be')});db[_0x8b8d('0x1c4')][_0x8b8d('0x110')](db['SugarcrmField'],{'as':_0x8b8d('0x1c2'),'foreignKey':_0x8b8d('0x1bf')});db['SugarcrmField'][_0x8b8d('0x149')](db['Variable'],{'as':_0x8b8d('0x92'),'foreignKey':_0x8b8d('0x1c3')});db[_0x8b8d('0x1c5')]['hasMany'](db['DeskConfiguration'],{'as':'Configurations','onDelete':_0x8b8d('0x10e'),'foreignKey':_0x8b8d('0x1b9')});db[_0x8b8d('0xa6')][_0x8b8d('0x110')](db[_0x8b8d('0xa8')],{'as':_0x8b8d('0x1bb'),'onDelete':_0x8b8d('0x10e'),'foreignKey':'SubjectId'});db[_0x8b8d('0xa6')]['hasMany'](db['DeskField'],{'as':_0x8b8d('0x1bd'),'onDelete':_0x8b8d('0x10e'),'foreignKey':_0x8b8d('0x1be')});db[_0x8b8d('0xa6')][_0x8b8d('0x110')](db['DeskField'],{'as':_0x8b8d('0x1b5'),'onDelete':_0x8b8d('0x10e'),'foreignKey':_0x8b8d('0x1bf')});db[_0x8b8d('0xa6')][_0x8b8d('0x149')](db[_0x8b8d('0x1c5')],{'as':_0x8b8d('0x168'),'foreignKey':_0x8b8d('0x1b9')});db[_0x8b8d('0xa6')][_0x8b8d('0x11b')](db[_0x8b8d('0x8c')],{'through':_0x8b8d('0x1c6')});db[_0x8b8d('0xa8')][_0x8b8d('0x110')](db[_0x8b8d('0xa8')],{'as':_0x8b8d('0x1c0'),'foreignKey':'SubjectId'});db[_0x8b8d('0xa8')][_0x8b8d('0x110')](db[_0x8b8d('0xa8')],{'as':_0x8b8d('0x1c1'),'foreignKey':_0x8b8d('0x1be')});db[_0x8b8d('0xa8')]['hasMany'](db['DeskField'],{'as':'Field','foreignKey':_0x8b8d('0x1bf')});db['DeskField'][_0x8b8d('0x149')](db[_0x8b8d('0x92')],{'as':_0x8b8d('0x92'),'foreignKey':'VariableId'});db[_0x8b8d('0xaa')][_0x8b8d('0x110')](db['ZohoConfiguration'],{'as':'Configurations','onDelete':_0x8b8d('0x10e'),'foreignKey':_0x8b8d('0x1b9')});db[_0x8b8d('0x1c7')]['hasMany'](db[_0x8b8d('0xad')],{'as':_0x8b8d('0x1bb'),'onDelete':'cascade','foreignKey':_0x8b8d('0x1bc')});db['ZohoConfiguration']['hasMany'](db[_0x8b8d('0xad')],{'as':_0x8b8d('0x1bd'),'onDelete':'cascade','foreignKey':'DescriptionId'});db[_0x8b8d('0x1c7')][_0x8b8d('0x110')](db[_0x8b8d('0xad')],{'as':_0x8b8d('0x1b5'),'onDelete':_0x8b8d('0x10e'),'foreignKey':_0x8b8d('0x1bf')});db[_0x8b8d('0x1c7')][_0x8b8d('0x149')](db[_0x8b8d('0xaa')],{'as':'Account','foreignKey':_0x8b8d('0x1b9')});db[_0x8b8d('0xad')]['hasMany'](db[_0x8b8d('0xad')],{'as':_0x8b8d('0x1c0'),'foreignKey':_0x8b8d('0x1bc')});db[_0x8b8d('0xad')]['hasMany'](db[_0x8b8d('0xad')],{'as':_0x8b8d('0x1c1'),'foreignKey':_0x8b8d('0x1be')});db[_0x8b8d('0xad')][_0x8b8d('0x110')](db['ZohoField'],{'as':_0x8b8d('0x1c2'),'foreignKey':_0x8b8d('0x1bf')});db[_0x8b8d('0xad')]['belongsTo'](db['Variable'],{'as':_0x8b8d('0x92'),'foreignKey':_0x8b8d('0x1c3')});db['ZendeskAccount']['hasMany'](db['ZendeskConfiguration'],{'as':'Configurations','onDelete':_0x8b8d('0x10e'),'foreignKey':_0x8b8d('0x1b9')});db[_0x8b8d('0xb0')][_0x8b8d('0x110')](db[_0x8b8d('0xb2')],{'as':'Subjects','foreignKey':_0x8b8d('0x1bc')});db['ZendeskConfiguration']['hasMany'](db['ZendeskField'],{'as':'Descriptions','foreignKey':_0x8b8d('0x1be')});db[_0x8b8d('0xb0')][_0x8b8d('0x110')](db[_0x8b8d('0xb2')],{'as':_0x8b8d('0x1b5'),'foreignKey':'FieldId'});db['ZendeskConfiguration'][_0x8b8d('0x149')](db[_0x8b8d('0x1c8')],{'as':'Account','foreignKey':'AccountId'});db[_0x8b8d('0xb0')]['belongsToMany'](db[_0x8b8d('0x8c')],{'through':'int_zendesk_configuration_has_tags'});db[_0x8b8d('0xb2')][_0x8b8d('0x110')](db[_0x8b8d('0xb2')],{'as':_0x8b8d('0x1c0'),'foreignKey':'SubjectId'});db['ZendeskField'][_0x8b8d('0x110')](db['ZendeskField'],{'as':_0x8b8d('0x1c1'),'foreignKey':_0x8b8d('0x1be')});db[_0x8b8d('0xb2')][_0x8b8d('0x110')](db['ZendeskField'],{'as':_0x8b8d('0x1c2'),'foreignKey':_0x8b8d('0x1bf')});db[_0x8b8d('0xb2')][_0x8b8d('0x149')](db['Variable'],{'as':'Variable','foreignKey':'VariableId'});db[_0x8b8d('0x1c9')][_0x8b8d('0x110')](db[_0x8b8d('0xb4')],{'as':_0x8b8d('0x1b8'),'onDelete':'cascade','foreignKey':_0x8b8d('0x1b9')});db['FreshdeskConfiguration'][_0x8b8d('0x110')](db[_0x8b8d('0xb6')],{'as':_0x8b8d('0x1bb'),'onDelete':_0x8b8d('0x10e'),'foreignKey':_0x8b8d('0x1bc')});db[_0x8b8d('0xb4')][_0x8b8d('0x110')](db['FreshdeskField'],{'as':_0x8b8d('0x1bd'),'onDelete':_0x8b8d('0x10e'),'foreignKey':_0x8b8d('0x1be')});db[_0x8b8d('0xb4')][_0x8b8d('0x110')](db['FreshdeskField'],{'as':_0x8b8d('0x1b5'),'onDelete':_0x8b8d('0x10e'),'foreignKey':'FieldId'});db['FreshdeskConfiguration'][_0x8b8d('0x149')](db[_0x8b8d('0x1c9')],{'as':_0x8b8d('0x168'),'foreignKey':'AccountId'});db[_0x8b8d('0xb4')][_0x8b8d('0x11b')](db[_0x8b8d('0x8c')],{'through':_0x8b8d('0x1ca')});db['FreshdeskField'][_0x8b8d('0x110')](db[_0x8b8d('0xb6')],{'as':'Subject','foreignKey':_0x8b8d('0x1bc')});db[_0x8b8d('0xb6')]['hasMany'](db[_0x8b8d('0xb6')],{'as':'Description','foreignKey':_0x8b8d('0x1be')});db[_0x8b8d('0xb6')][_0x8b8d('0x110')](db['FreshdeskField'],{'as':_0x8b8d('0x1c2'),'foreignKey':_0x8b8d('0x1bf')});db[_0x8b8d('0xb6')][_0x8b8d('0x149')](db[_0x8b8d('0x92')],{'as':'Variable','foreignKey':'VariableId'});db[_0x8b8d('0xb8')]['hasMany'](db[_0x8b8d('0xb9')],{'as':'Configurations','onDelete':_0x8b8d('0x10e'),'foreignKey':'AccountId'});db[_0x8b8d('0xb9')][_0x8b8d('0x110')](db[_0x8b8d('0xbb')],{'as':_0x8b8d('0x1bb'),'foreignKey':_0x8b8d('0x1bc')});db[_0x8b8d('0xb9')][_0x8b8d('0x110')](db[_0x8b8d('0xbb')],{'as':_0x8b8d('0x1bd'),'foreignKey':'DescriptionId'});db[_0x8b8d('0xb9')]['hasMany'](db[_0x8b8d('0xbb')],{'as':_0x8b8d('0x1b5'),'foreignKey':_0x8b8d('0x1bf')});db[_0x8b8d('0xb9')][_0x8b8d('0x149')](db[_0x8b8d('0xb8')],{'as':_0x8b8d('0x168'),'foreignKey':'AccountId'});db[_0x8b8d('0xbb')]['hasMany'](db['VtigerField'],{'as':_0x8b8d('0x1c0'),'foreignKey':_0x8b8d('0x1bc')});db[_0x8b8d('0xbb')][_0x8b8d('0x110')](db[_0x8b8d('0xbb')],{'as':'Description','foreignKey':_0x8b8d('0x1be')});db[_0x8b8d('0xbb')][_0x8b8d('0x110')](db[_0x8b8d('0xbb')],{'as':'Field','foreignKey':_0x8b8d('0x1bf')});db[_0x8b8d('0xbb')][_0x8b8d('0x149')](db[_0x8b8d('0x92')],{'as':_0x8b8d('0x92'),'foreignKey':'VariableId'});db[_0x8b8d('0x1cb')][_0x8b8d('0x110')](db[_0x8b8d('0xbd')],{'as':'Configurations','onDelete':_0x8b8d('0x10e'),'foreignKey':_0x8b8d('0x1b9')});db['ServicenowConfiguration'][_0x8b8d('0x110')](db[_0x8b8d('0x1cc')],{'as':_0x8b8d('0x1bb'),'foreignKey':_0x8b8d('0x1bc')});db[_0x8b8d('0xbd')][_0x8b8d('0x110')](db[_0x8b8d('0x1cc')],{'as':_0x8b8d('0x1bd'),'foreignKey':_0x8b8d('0x1be')});db[_0x8b8d('0xbd')]['hasMany'](db[_0x8b8d('0x1cc')],{'as':_0x8b8d('0x1b5'),'foreignKey':_0x8b8d('0x1bf')});db['ServicenowConfiguration'][_0x8b8d('0x149')](db[_0x8b8d('0x1cb')],{'as':'Account','foreignKey':_0x8b8d('0x1b9')});db['ServicenowField'][_0x8b8d('0x110')](db[_0x8b8d('0x1cc')],{'as':'Subject','foreignKey':'SubjectId'});db[_0x8b8d('0x1cc')][_0x8b8d('0x110')](db[_0x8b8d('0x1cc')],{'as':_0x8b8d('0x1c1'),'foreignKey':'DescriptionId'});db[_0x8b8d('0x1cc')][_0x8b8d('0x110')](db[_0x8b8d('0x1cc')],{'as':_0x8b8d('0x1c2'),'foreignKey':_0x8b8d('0x1bf')});db[_0x8b8d('0x1cc')][_0x8b8d('0x149')](db[_0x8b8d('0x92')],{'as':_0x8b8d('0x92'),'foreignKey':_0x8b8d('0x1c3')});db[_0x8b8d('0xbf')][_0x8b8d('0x110')](db[_0x8b8d('0xc1')],{'as':_0x8b8d('0x1b8'),'onDelete':_0x8b8d('0x10e'),'foreignKey':_0x8b8d('0x1b9')});db['Dynamics365Configuration']['hasMany'](db[_0x8b8d('0xc3')],{'as':_0x8b8d('0x1bb'),'onDelete':_0x8b8d('0x10e'),'foreignKey':_0x8b8d('0x1bc')});db[_0x8b8d('0xc1')][_0x8b8d('0x110')](db['Dynamics365Field'],{'as':_0x8b8d('0x1bd'),'onDelete':_0x8b8d('0x10e'),'foreignKey':'DescriptionId'});db[_0x8b8d('0xc1')]['hasMany'](db[_0x8b8d('0xc3')],{'as':_0x8b8d('0x1b5'),'onDelete':_0x8b8d('0x10e'),'foreignKey':_0x8b8d('0x1bf')});db['Dynamics365Configuration'][_0x8b8d('0x149')](db['Dynamics365Account'],{'as':_0x8b8d('0x168'),'foreignKey':_0x8b8d('0x1b9')});db[_0x8b8d('0xc3')][_0x8b8d('0x110')](db['Dynamics365Field'],{'as':_0x8b8d('0x1c0'),'foreignKey':_0x8b8d('0x1bc')});db[_0x8b8d('0xc3')][_0x8b8d('0x110')](db['Dynamics365Field'],{'as':_0x8b8d('0x1c1'),'foreignKey':_0x8b8d('0x1be')});db['Dynamics365Field'][_0x8b8d('0x110')](db[_0x8b8d('0xc3')],{'as':_0x8b8d('0x1c2'),'foreignKey':_0x8b8d('0x1bf')});db['Dynamics365Field'][_0x8b8d('0x149')](db[_0x8b8d('0x92')],{'as':'Variable','foreignKey':_0x8b8d('0x1c3')});db[_0x8b8d('0xc5')][_0x8b8d('0x110')](db[_0x8b8d('0xc7')],{'as':_0x8b8d('0x1b8'),'onDelete':_0x8b8d('0x10e'),'foreignKey':_0x8b8d('0x1b9')});db[_0x8b8d('0xc7')][_0x8b8d('0x110')](db['FreshsalesField'],{'as':'Subjects','foreignKey':'SubjectId'});db[_0x8b8d('0xc7')][_0x8b8d('0x110')](db[_0x8b8d('0x1cd')],{'as':_0x8b8d('0x1bd'),'foreignKey':_0x8b8d('0x1be')});db[_0x8b8d('0xc7')][_0x8b8d('0x110')](db[_0x8b8d('0x1cd')],{'as':_0x8b8d('0x1b5'),'foreignKey':'FieldId'});db[_0x8b8d('0xc7')][_0x8b8d('0x149')](db[_0x8b8d('0xc5')],{'as':'Account','foreignKey':_0x8b8d('0x1b9')});db[_0x8b8d('0x1cd')][_0x8b8d('0x110')](db[_0x8b8d('0x1cd')],{'as':'Subject','foreignKey':_0x8b8d('0x1bc')});db[_0x8b8d('0x1cd')]['hasMany'](db[_0x8b8d('0x1cd')],{'as':_0x8b8d('0x1c1'),'foreignKey':_0x8b8d('0x1be')});db[_0x8b8d('0x1cd')][_0x8b8d('0x110')](db[_0x8b8d('0x1cd')],{'as':'Field','foreignKey':_0x8b8d('0x1bf')});db[_0x8b8d('0x1cd')][_0x8b8d('0x149')](db['Variable'],{'as':_0x8b8d('0x92'),'foreignKey':'VariableId'});db[_0x8b8d('0xca')][_0x8b8d('0x149')](db[_0x8b8d('0x64')],{});db['ChatQueueReport'][_0x8b8d('0x149')](db['CmList'],{'as':_0x8b8d('0x162'),'foreignKey':_0x8b8d('0x163')});db[_0x8b8d('0xca')][_0x8b8d('0x149')](db[_0x8b8d('0x72')],{'as':_0x8b8d('0x15a'),'foreignKey':_0x8b8d('0x15b')});db['ChatQueueReport']['belongsTo'](db[_0x8b8d('0x69')],{});db[_0x8b8d('0xca')][_0x8b8d('0x149')](db[_0x8b8d('0x18a')],{});db[_0x8b8d('0xca')][_0x8b8d('0x149')](db[_0x8b8d('0x12')],{});db[_0x8b8d('0xca')][_0x8b8d('0x149')](db['ChatQueue'],{});db[_0x8b8d('0xcc')][_0x8b8d('0x149')](db[_0x8b8d('0x12')],{'onDelete':_0x8b8d('0x10e'),'foreignKey':_0x8b8d('0x1ce')});db['ChatInternalMessage']['belongsTo'](db[_0x8b8d('0x12')],{'onDelete':_0x8b8d('0x10e'),'foreignKey':_0x8b8d('0x1cf')});db['JscriptySessionReport']['hasMany'](db[_0x8b8d('0xcf')],{'foreignKey':_0x8b8d('0x1d0'),'onDelete':'cascade'});db['JscriptySessionReport'][_0x8b8d('0x110')](db['JscriptyAnswerReport'],{'foreignKey':'SessionId','onDelete':_0x8b8d('0x10e')});db[_0x8b8d('0xd2')][_0x8b8d('0x149')](db[_0x8b8d('0x56')],{});db[_0x8b8d('0xd2')][_0x8b8d('0x149')](db[_0x8b8d('0xf2')],{'as':_0x8b8d('0x162'),'foreignKey':_0x8b8d('0x163')});db[_0x8b8d('0xd2')][_0x8b8d('0x149')](db['CmContact'],{'as':'Contact','foreignKey':_0x8b8d('0x15b')});db[_0x8b8d('0xd2')]['belongsTo'](db[_0x8b8d('0x5a')],{});db[_0x8b8d('0xd2')][_0x8b8d('0x149')](db[_0x8b8d('0x17d')],{});db[_0x8b8d('0xd2')][_0x8b8d('0x149')](db[_0x8b8d('0x12')],{});db[_0x8b8d('0xd2')]['belongsTo'](db[_0x8b8d('0x5c')],{});db[_0x8b8d('0xd6')][_0x8b8d('0x110')](db[_0x8b8d('0x146')],{'foreignKey':_0x8b8d('0x1d1')});db[_0x8b8d('0xd6')][_0x8b8d('0x110')](db[_0x8b8d('0xcf')],{'foreignKey':_0x8b8d('0x1d1')});db['JscriptyProject'][_0x8b8d('0x110')](db[_0x8b8d('0xce')],{'foreignKey':_0x8b8d('0x1d1')});db[_0x8b8d('0xdc')][_0x8b8d('0x11b')](db[_0x8b8d('0x12')],{'as':_0x8b8d('0x177'),'through':_0x8b8d('0x13b')});db['Team'][_0x8b8d('0x11b')](db[_0x8b8d('0x12')],{'as':'Agents','through':_0x8b8d('0x11e')});db[_0x8b8d('0xe0')][_0x8b8d('0x11b')](db[_0x8b8d('0x1c')],{'through':'TeamVoiceQueue','as':_0x8b8d('0x123')});db['Team']['belongsToMany'](db['MailQueue'],{'through':_0x8b8d('0x166'),'as':_0x8b8d('0x126')});db[_0x8b8d('0xe0')]['belongsToMany'](db['ChatQueue'],{'through':'team_has_chat_queues','as':_0x8b8d('0x127')});db['Team'][_0x8b8d('0x11b')](db[_0x8b8d('0x128')],{'through':'team_has_fax_queues','as':_0x8b8d('0x129')});db['Team']['belongsToMany'](db['SmsQueue'],{'through':_0x8b8d('0x1d2'),'as':_0x8b8d('0x12b')});db[_0x8b8d('0xe0')]['belongsToMany'](db['OpenchannelQueue'],{'through':_0x8b8d('0x188'),'as':_0x8b8d('0x12c')});db['Team'][_0x8b8d('0x11b')](db[_0x8b8d('0x104')],{'through':'team_has_whatsapp_queues','as':_0x8b8d('0x12d')});db['Team']['belongsToMany'](db[_0x8b8d('0x124')],{'through':_0x8b8d('0x10a'),'as':_0x8b8d('0x125')});db[_0x8b8d('0xe3')]['hasMany'](db[_0x8b8d('0x142')],{'as':_0x8b8d('0x143'),'foreignKey':'CampaignId'});db['Campaign'][_0x8b8d('0x110')](db[_0x8b8d('0x77')],{'as':_0x8b8d('0x113'),'foreignKey':_0x8b8d('0x198')});db[_0x8b8d('0xe3')]['hasMany'](db[_0x8b8d('0x79')],{'as':'HopperHistories','foreignKey':_0x8b8d('0x198')});db[_0x8b8d('0xe3')][_0x8b8d('0x110')](db[_0x8b8d('0x75')],{'as':'HopperBlacks','foreignKey':_0x8b8d('0x198')});db[_0x8b8d('0xe3')][_0x8b8d('0x149')](db[_0x8b8d('0x148')],{'as':_0x8b8d('0x148'),'foreignKey':_0x8b8d('0x1d3')});db[_0x8b8d('0xe3')][_0x8b8d('0x149')](db[_0x8b8d('0x148')],{'as':'TrunkBackup','foreignKey':_0x8b8d('0x1d4')});db['Campaign']['belongsTo'](db[_0x8b8d('0x84')],{'as':'Interval','foreignKey':_0x8b8d('0x14b')});db[_0x8b8d('0xe3')][_0x8b8d('0x149')](db[_0x8b8d('0xdc')],{'as':_0x8b8d('0xdc'),'foreignKey':_0x8b8d('0x1d5')});db[_0x8b8d('0xe3')][_0x8b8d('0x11b')](db['CmList'],{'as':_0x8b8d('0x1d6'),'through':'campaigns_has_cm_lists'});db[_0x8b8d('0xe3')][_0x8b8d('0x11b')](db[_0x8b8d('0xf2')],{'as':'BlackLists','through':_0x8b8d('0x1d7')});db['Attachment'][_0x8b8d('0x149')](db[_0x8b8d('0x6b')],{'as':_0x8b8d('0x6b'),'foreignKey':'ChatOfflineMessageId'});db['MailTransferReport'][_0x8b8d('0x149')](db['MailMessage'],{});db['MailTransferReport'][_0x8b8d('0x149')](db[_0x8b8d('0x41')],{});db[_0x8b8d('0xea')][_0x8b8d('0x149')](db['MailAccount'],{'foreignKey':_0x8b8d('0x1d8'),'as':_0x8b8d('0x1d9')});db[_0x8b8d('0xea')][_0x8b8d('0x149')](db[_0x8b8d('0x12')],{'foreignKey':_0x8b8d('0x1da'),'as':_0x8b8d('0x1db')});db[_0x8b8d('0xea')][_0x8b8d('0x149')](db[_0x8b8d('0x12')],{'foreignKey':'ToUserId','as':_0x8b8d('0x1dc')});db['MailTransferReport'][_0x8b8d('0x149')](db[_0x8b8d('0x3e')],{'foreignKey':_0x8b8d('0x1dd'),'as':_0x8b8d('0x1de')});db[_0x8b8d('0xea')][_0x8b8d('0x149')](db[_0x8b8d('0x133')],{'foreignKey':_0x8b8d('0x1df'),'as':_0x8b8d('0x1e0')});db['ChatTransferReport']['belongsTo'](db['ChatMessage'],{});db[_0x8b8d('0xec')]['belongsTo'](db[_0x8b8d('0x69')],{});db['ChatTransferReport'][_0x8b8d('0x149')](db[_0x8b8d('0x64')],{'foreignKey':_0x8b8d('0x1e1'),'as':'FromAccount'});db[_0x8b8d('0xec')][_0x8b8d('0x149')](db[_0x8b8d('0x12')],{'foreignKey':_0x8b8d('0x1da'),'as':'FromAgent'});db['ChatTransferReport']['belongsTo'](db[_0x8b8d('0x12')],{'foreignKey':_0x8b8d('0x1e2'),'as':_0x8b8d('0x1dc')});db[_0x8b8d('0xec')][_0x8b8d('0x149')](db['ChatQueue'],{'foreignKey':_0x8b8d('0x1e3'),'as':'ToQueue'});db[_0x8b8d('0xec')][_0x8b8d('0x149')](db[_0x8b8d('0x64')],{'foreignKey':_0x8b8d('0x1e4'),'as':_0x8b8d('0x1e0')});db[_0x8b8d('0xee')][_0x8b8d('0x149')](db['FaxMessage'],{});db[_0x8b8d('0xee')][_0x8b8d('0x149')](db[_0x8b8d('0x4f')],{});db[_0x8b8d('0xee')][_0x8b8d('0x149')](db['FaxAccount'],{'foreignKey':_0x8b8d('0x1e5'),'as':'FromAccount'});db[_0x8b8d('0xee')][_0x8b8d('0x149')](db[_0x8b8d('0x12')],{'foreignKey':_0x8b8d('0x1da'),'as':_0x8b8d('0x1db')});db[_0x8b8d('0xee')][_0x8b8d('0x149')](db['User'],{'foreignKey':_0x8b8d('0x1e2'),'as':_0x8b8d('0x1dc')});db[_0x8b8d('0xee')][_0x8b8d('0x149')](db['FaxQueue'],{'foreignKey':_0x8b8d('0x1e6'),'as':'ToQueue'});db[_0x8b8d('0xee')][_0x8b8d('0x149')](db[_0x8b8d('0x4c')],{'foreignKey':_0x8b8d('0x1e7'),'as':_0x8b8d('0x1e0')});db[_0x8b8d('0xf0')]['belongsTo'](db[_0x8b8d('0x184')],{});db[_0x8b8d('0xf0')]['belongsTo'](db[_0x8b8d('0x60')],{});db[_0x8b8d('0xf0')][_0x8b8d('0x149')](db[_0x8b8d('0x135')],{'foreignKey':_0x8b8d('0x1e8'),'as':_0x8b8d('0x1d9')});db[_0x8b8d('0xf0')][_0x8b8d('0x149')](db['User'],{'foreignKey':_0x8b8d('0x1da'),'as':_0x8b8d('0x1db')});db[_0x8b8d('0xf0')]['belongsTo'](db[_0x8b8d('0x12')],{'foreignKey':_0x8b8d('0x1e2'),'as':_0x8b8d('0x1dc')});db['OpenchannelTransferReport'][_0x8b8d('0x149')](db[_0x8b8d('0x63')],{'foreignKey':_0x8b8d('0x1e9'),'as':_0x8b8d('0x1de')});db[_0x8b8d('0xf0')][_0x8b8d('0x149')](db['OpenchannelAccount'],{'foreignKey':_0x8b8d('0x1ea'),'as':_0x8b8d('0x1e0')});db[_0x8b8d('0x1eb')]['belongsTo'](db[_0x8b8d('0x17d')],{});db[_0x8b8d('0x1eb')]['belongsTo'](db[_0x8b8d('0x5a')],{});db[_0x8b8d('0x1eb')]['belongsTo'](db[_0x8b8d('0x56')],{'foreignKey':_0x8b8d('0x1ec'),'as':_0x8b8d('0x1d9')});db[_0x8b8d('0x1eb')][_0x8b8d('0x149')](db[_0x8b8d('0x12')],{'foreignKey':'FromUserId','as':_0x8b8d('0x1db')});db[_0x8b8d('0x1eb')]['belongsTo'](db['User'],{'foreignKey':_0x8b8d('0x1e2'),'as':_0x8b8d('0x1dc')});db[_0x8b8d('0x1eb')][_0x8b8d('0x149')](db[_0x8b8d('0x5c')],{'foreignKey':_0x8b8d('0x1ed'),'as':'ToQueue'});db[_0x8b8d('0x1eb')][_0x8b8d('0x149')](db[_0x8b8d('0x56')],{'foreignKey':_0x8b8d('0x1ee'),'as':_0x8b8d('0x1e0')});db[_0x8b8d('0xf2')][_0x8b8d('0x110')](db['Disposition'],{'as':_0x8b8d('0x15f'),'foreignKey':_0x8b8d('0x163'),'onDelete':_0x8b8d('0x10e')});db[_0x8b8d('0xf2')]['hasMany'](db['CmCustomField'],{'as':_0x8b8d('0x1ef'),'foreignKey':'ListId'});db[_0x8b8d('0xf2')][_0x8b8d('0x110')](db[_0x8b8d('0x72')],{'as':'Contacts','onDelete':_0x8b8d('0x10e'),'foreignKey':_0x8b8d('0x163')});db[_0x8b8d('0xf2')][_0x8b8d('0x110')](db[_0x8b8d('0x77')],{'as':_0x8b8d('0x113'),'foreignKey':'ListId'});db[_0x8b8d('0xf2')]['hasMany'](db[_0x8b8d('0x79')],{'as':_0x8b8d('0x114'),'foreignKey':_0x8b8d('0x163')});db['CmList'][_0x8b8d('0x110')](db[_0x8b8d('0x115')],{'as':_0x8b8d('0x115'),'foreignKey':'ListId'});db[_0x8b8d('0xf2')]['belongsToMany'](db['VoiceQueue'],{'as':_0x8b8d('0x1f0'),'through':_0x8b8d('0x14d')});db[_0x8b8d('0xf2')][_0x8b8d('0x11b')](db[_0x8b8d('0x12')],{'as':_0x8b8d('0x14e'),'through':_0x8b8d('0x12e')});db[_0x8b8d('0x124')][_0x8b8d('0x110')](db['VoiceExtension'],{'as':'Extensions','onDelete':_0x8b8d('0x10e')});db[_0x8b8d('0x124')]['belongsToMany'](db['User'],{'as':_0x8b8d('0x14e'),'through':_0x8b8d('0x10c')});db[_0x8b8d('0x124')]['belongsToMany'](db[_0x8b8d('0xe0')],{'through':'TeamVoicePrefix','as':_0x8b8d('0x150')});db['UserProfile'][_0x8b8d('0x110')](db[_0x8b8d('0x12')],{'as':_0x8b8d('0x177'),'foreignKey':_0x8b8d('0x11a')});db[_0x8b8d('0xf4')][_0x8b8d('0x110')](db[_0x8b8d('0xf6')],{'as':_0x8b8d('0x1f1'),'foreignKey':_0x8b8d('0x11a'),'onDelete':_0x8b8d('0x10e')});db[_0x8b8d('0xf6')]['hasMany'](db[_0x8b8d('0x1f2')],{'as':'Resources','foreignKey':_0x8b8d('0x1f3'),'onDelete':_0x8b8d('0x10e')});db[_0x8b8d('0xfb')][_0x8b8d('0x110')](db[_0x8b8d('0x80')],{'as':_0x8b8d('0x15f'),'foreignKey':'WhatsappAccountId','onDelete':'cascade'});db[_0x8b8d('0xfb')][_0x8b8d('0x110')](db['CannedAnswer'],{'as':_0x8b8d('0x174'),'foreignKey':'WhatsappAccountId'});db[_0x8b8d('0xfb')][_0x8b8d('0x110')](db['WhatsappMessage'],{'as':_0x8b8d('0x160'),'foreignKey':_0x8b8d('0x1f4')});db[_0x8b8d('0xfb')]['hasMany'](db['WhatsappInteraction'],{'as':'Interactions'});db['WhatsappAccount'][_0x8b8d('0x110')](db['WhatsappApplication'],{'as':_0x8b8d('0x13d')});db[_0x8b8d('0xfb')][_0x8b8d('0x149')](db[_0x8b8d('0xf2')],{'as':_0x8b8d('0x162'),'foreignKey':_0x8b8d('0x163')});db['WhatsappAccount'][_0x8b8d('0x149')](db[_0x8b8d('0x86')],{'as':_0x8b8d('0x14c'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x8b8d('0xfb')][_0x8b8d('0x11b')](db[_0x8b8d('0x12')],{'as':'Agents','through':_0x8b8d('0x13a')});db[_0x8b8d('0x1f5')][_0x8b8d('0x149')](db[_0x8b8d('0x12')],{'onDelete':_0x8b8d('0x170')});db[_0x8b8d('0x1f5')][_0x8b8d('0x149')](db['WhatsappQueue'],{'onDelete':_0x8b8d('0x170')});db[_0x8b8d('0x1f5')][_0x8b8d('0x149')](db[_0x8b8d('0xfb')],{'onDelete':_0x8b8d('0x170')});db[_0x8b8d('0x1f5')]['belongsTo'](db[_0x8b8d('0x84')],{'onDelete':_0x8b8d('0x170'),'foreignKey':_0x8b8d('0x14b')});db[_0x8b8d('0x1f5')][_0x8b8d('0x149')](db[_0x8b8d('0x8c')],{'onDelete':_0x8b8d('0x170'),'foreignKey':_0x8b8d('0x17e')});db[_0x8b8d('0xfd')][_0x8b8d('0x110')](db[_0x8b8d('0xfe')],{'as':_0x8b8d('0x160'),'onDelete':_0x8b8d('0x10e'),'foreignKey':_0x8b8d('0x1f6')});db[_0x8b8d('0xfd')]['belongsTo'](db[_0x8b8d('0xfb')],{'as':'Account','foreignKey':'WhatsappAccountId'});db[_0x8b8d('0xfd')]['belongsTo'](db[_0x8b8d('0x72')],{'as':_0x8b8d('0x15a'),'foreignKey':_0x8b8d('0x15b')});db[_0x8b8d('0xfd')][_0x8b8d('0x149')](db[_0x8b8d('0x12')],{'as':'Owner','foreignKey':_0x8b8d('0x10f')});db['WhatsappInteraction'][_0x8b8d('0x11b')](db[_0x8b8d('0x8c')],{'through':_0x8b8d('0x1ab'),'as':_0x8b8d('0x16b')});db[_0x8b8d('0xfd')][_0x8b8d('0x11b')](db[_0x8b8d('0x8c')],{'through':_0x8b8d('0x1ab'),'as':_0x8b8d('0x16c')});db['WhatsappInteraction'][_0x8b8d('0x11b')](db[_0x8b8d('0x12')],{'as':_0x8b8d('0x177'),'through':_0x8b8d('0x1f7'),'foreignKey':'WhatsappInteractionId'});db[_0x8b8d('0xfe')][_0x8b8d('0x149')](db['User'],{'as':'User'});db[_0x8b8d('0xfe')][_0x8b8d('0x149')](db[_0x8b8d('0x72')],{'onDelete':_0x8b8d('0x10e'),'as':'Contact'});db['WhatsappMessage'][_0x8b8d('0x149')](db[_0x8b8d('0xfd')],{'onDelete':_0x8b8d('0x10e'),'as':_0x8b8d('0x17a'),'foreignKey':_0x8b8d('0x1f6')});db[_0x8b8d('0xfe')][_0x8b8d('0x149')](db['WhatsappAccount'],{'as':_0x8b8d('0x168'),'foreignKey':'WhatsappAccountId'});db[_0x8b8d('0x100')][_0x8b8d('0x149')](db[_0x8b8d('0xfb')],{});db[_0x8b8d('0x100')]['belongsTo'](db[_0x8b8d('0xf2')],{'as':'List','foreignKey':_0x8b8d('0x163')});db[_0x8b8d('0x100')][_0x8b8d('0x149')](db[_0x8b8d('0x72')],{'as':_0x8b8d('0x15a'),'foreignKey':_0x8b8d('0x15b')});db[_0x8b8d('0x100')]['belongsTo'](db[_0x8b8d('0xfd')],{});db['WhatsappQueueReport'][_0x8b8d('0x149')](db['WhatsappQueue'],{});db['WhatsappQueueReport'][_0x8b8d('0x149')](db[_0x8b8d('0xfe')],{});db[_0x8b8d('0x100')][_0x8b8d('0x149')](db[_0x8b8d('0x12')],{});db[_0x8b8d('0x102')][_0x8b8d('0x149')](db[_0x8b8d('0xfe')],{});db[_0x8b8d('0x102')]['belongsTo'](db[_0x8b8d('0xfd')],{});db[_0x8b8d('0x102')][_0x8b8d('0x149')](db[_0x8b8d('0xfb')],{'foreignKey':_0x8b8d('0x1f8'),'as':_0x8b8d('0x1d9')});db[_0x8b8d('0x102')][_0x8b8d('0x149')](db[_0x8b8d('0xfb')],{'foreignKey':'ToWhatsappAccountId','as':'ToAccount'});db[_0x8b8d('0x102')][_0x8b8d('0x149')](db[_0x8b8d('0x104')],{'foreignKey':_0x8b8d('0x1f9'),'as':'ToQueue'});db[_0x8b8d('0x102')][_0x8b8d('0x149')](db[_0x8b8d('0x12')],{'foreignKey':_0x8b8d('0x1da'),'as':'FromAgent'});db['WhatsappTransferReport'][_0x8b8d('0x149')](db[_0x8b8d('0x12')],{'foreignKey':_0x8b8d('0x1e2'),'as':'ToAgent'});db[_0x8b8d('0x104')][_0x8b8d('0x11b')](db[_0x8b8d('0x12')],{'as':_0x8b8d('0x14e'),'through':'UserWhatsappQueue','foreignKey':_0x8b8d('0x1fa')});db[_0x8b8d('0x104')]['belongsToMany'](db[_0x8b8d('0xe0')],{'through':_0x8b8d('0x1fb'),'as':_0x8b8d('0x150')});module[_0x8b8d('0x1fc')]={'db':db,'dbH':dbH}; \ No newline at end of file +var _0xdeaf=['../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','../api/intZohoField/intZohoField.model','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesConfiguration','Network','../api/network/network.model','ChatQueueReport','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','JscriptyProject','Setting','../api/setting/setting.model','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','../api/squareMessage/squareMessage.model','Team','../api/license/license.model','Campaign','../api/campaign/campaign.model','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','MailTransferReport','ChatTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','VoicePrefix','UserProfile','../api/userProfile/userProfile.model','UserProfileSection','UserProfileResource','../api/userProfileResource/userProfileResource.model','UserNotification','../api/userNotification/userNotification.model','WhatsappAccount','../api/whatsappAccount/whatsappAccount.model','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','WhatsappTransferReport','../api/whatsappTransferReport/whatsappTransferReport.model','WhatsappQueue','../api/whatsappQueue/whatsappQueue.model','CloudProvider','../api/cloudProvider/cloudProvider.model','TeamVoicePrefix','../api/teamVoicePrefix/teamVoicePrefix.model','../api/userVoicePrefix/userVoicePrefix.model','cascade','UserId','User','hasMany','Recordings','OpenchannelInteractions','ChatInteractions','SmsInteractions','FaxInteractions','WhatsappInteractions','UserNotifications','belongsTo','belongsToMany','ChatGroup','cm_user_has_contacts','CmList','cm_user_has_lists','user_has_teams','MailInteractions','user_has_sms_interactions','VoicePrefixes','UserVoicePrefix','MailQueues','FaxQueues','SmsQueues','UserOpenchannelQueue','ChatWebsites','user_has_chat_websites','FaxAccounts','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccount','user_has_sms_accounts','WhatsappAccounts','user_has_whatsapp_accounts','SquareProjects','user_has_square_projects','SpiedAgents','Applications','moh_has_sounds','Hoppers','VoiceQueueId','HopperFinals','HopperBlacks','JscriptySessions','TrunkBackup','IntervalId','Pause','mandatoryDispositionPause','mandatoryDispositionPauseId','voice_queues_has_cm_lists','Agents','UserVoiceQueue','TeamVoiceQueue','BlackLists','voice_queues_has_cm_blacklists','Messages','mailboxuser','mailbox','QueueCalls','uniqueid','ContactId','MailServerOut','MailAccountId','hasOne','Smtp','Answers','List','ListId','TemplateId','MailInteractionId','Account','Contact','Owner','mail_interaction_has_tags','ThroughTags','Users','user_has_mail_interactions','Attachments','Interaction','ChatWebsiteId','ChatOfflineMessage','ChatOfflineMessageId','restrict','TagId','Items','Dispositions','FaxAccountId','Interactions','fax_interaction_has_tags','Tags','user_has_fax_interactions','FaxInteractionId','AttachmentId','Teams','SmsAccountId','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelQueueId','openchannel_interaction_has_tags','user_has_openchannel_interactions','OpenchannelInteractionId','OpenchannelQueue','team_has_openchannel_queues','ProactiveActions','OpenchannelQueueReport','Agent','Queue','Website','ChatInteractionId','chat_interaction_has_tags','user_has_chat_interactions','team_has_chat_queues','ChatGroupId','Members','chat_group_has_users','Contacts','CompanyId','HopperHistories','cm_contact_has_tags','CampaignId','OwnerId','OneAll','AutomationAllId','Any','OneAny','AutomationAnyId','Actions','ParentId','Intervals','Extensions','MailApplications','ChatApplications','FaxApplications','SmsApplications','AnalyticDefaultReport','DefaultReportId','CustomReportId','whatsapp_interaction_has_tags','AllConditions','AnyConditions','AnyCondition','TriggerAnyId','Fields','MetricId','Configurations','AccountId','Subjects','Descriptions','FieldId','SubjectId','Description','DescriptionId','Field','Variable','VariableId','Subject','DeskConfiguration','ZohoConfiguration','ZendeskAccount','VtigerAccount','ServicenowAccount','ServicenowField','Dynamics365Field','FreshsalesAccount','FreshsalesField','FromId','ToId','SessionId','JscriptyAnswerReport','ProjectId','VoiceQueues','team_has_mail_queues','ChatQueues','team_has_fax_queues','team_has_whatsapp_queues','TrunkId','TrunkBackupId','Lists','campaigns_has_cm_lists','campaigns_has_cm_blacklists','FromMailAccountId','FromAccount','FromUserId','FromAgent','ToUserId','ToAgent','ToMailQueueId','ToQueue','ToMailAccountId','ToAccount','FromChatWebsiteId','ToChatQueueId','ToChatWebsiteId','FaxTransferReport','FromFaxAccountId','FromOpenchannelAccountId','ToOpenchannelQueueId','FromSmsAccountId','ToSmsQueueId','ToSmsAccountId','CustomFields','HopperHistory','Queues','userProfileId','UserProfileSections','Resources','sectionId','WhatsappAccountId','WhatsappApplication','WhatsappInteractionId','user_has_whatsapp_interactions','FromWhatsappAccountId','exports','../config/environment','sequelize','lodash','jstz','determine','defaultsDeep','motion2','xcall','127.0.0.1','mysql','utf8mb4','name','utf8','utf8_general_ci','sequelizeHistory','database','username','password','options','../api/user/user.model','VoiceChanSpy','import','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','VoiceExtension','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','VoiceTransferReport','UserVoiceQueueRt','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','../api/userOpenchannelQueue/userOpenchannelQueue.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','../api/mailInteraction/mailInteraction.model','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','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxMessage','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','../api/smsAccount/smsAccount.model','SmsApplication','SmsInteraction','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','ChatInteraction','ChatMessage','../api/chatMessage/chatMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','CmContact','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','Action','../api/action/action.model','Automation','../api/automation/automation.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','Condition','../api/condition/condition.model','Interval','../api/interval/interval.model','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','Sound','Tag','../api/tag/tag.model','Template','Trigger','../api/trigger/trigger.model','../api/variable/variable.model','Integration','../api/integration/integration.model','IntegrationReport','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','SugarcrmAccount','SugarcrmConfiguration'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xdeaf,0x13f));var _0xfdea=function(_0x3286f2,_0x3f3cad){_0x3286f2=_0x3286f2-0x0;var _0x5980eb=_0xdeaf[_0x3286f2];return _0x5980eb;};'use strict';var config=require(_0xfdea('0x0'));var Sequelize=require(_0xfdea('0x1'));var _=require(_0xfdea('0x2'));var jstz=require(_0xfdea('0x3'));var timezone=jstz[_0xfdea('0x4')]();config['sequelize']=_[_0xfdea('0x5')](config['sequelize'],{'database':_0xfdea('0x6'),'username':_0xfdea('0x7'),'password':'xC@LL1234','options':{'host':_0xfdea('0x8'),'port':0xcea,'dialect':_0xfdea('0x9'),'dialectOptions':{'charset':_0xfdea('0xa')},'logging':![],'timezone':timezone[_0xfdea('0xb')](),'define':{'charset':_0xfdea('0xc'),'collate':_0xfdea('0xd')}}});config[_0xfdea('0xe')]=_[_0xfdea('0x5')](config[_0xfdea('0xe')],{'database':'motion2','username':_0xfdea('0x7'),'password':'xC@LL1234','options':{'host':_0xfdea('0x8'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0xfdea('0xa')},'logging':![],'timezone':timezone[_0xfdea('0xb')](),'define':{'charset':_0xfdea('0xc'),'collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xfdea('0x1')][_0xfdea('0xf')],config[_0xfdea('0x1')][_0xfdea('0x10')],config[_0xfdea('0x1')][_0xfdea('0x11')],config[_0xfdea('0x1')]['options'])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xfdea('0xe')][_0xfdea('0xf')],config[_0xfdea('0xe')][_0xfdea('0x10')],config[_0xfdea('0xe')][_0xfdea('0x11')],config[_0xfdea('0xe')][_0xfdea('0x12')])};db['User']=db[_0xfdea('0x1')]['import'](_0xfdea('0x13'));db[_0xfdea('0x14')]=db[_0xfdea('0x1')][_0xfdea('0x15')](_0xfdea('0x16'));db[_0xfdea('0x17')]=db[_0xfdea('0x1')][_0xfdea('0x15')](_0xfdea('0x18'));db[_0xfdea('0x19')]=db[_0xfdea('0x1')][_0xfdea('0x15')]('../api/voiceExtension/voiceExtension.model');db[_0xfdea('0x1a')]=db[_0xfdea('0x1')]['import'](_0xfdea('0x1b'));db[_0xfdea('0x1c')]=db[_0xfdea('0x1')][_0xfdea('0x15')](_0xfdea('0x1d'));db[_0xfdea('0x1e')]=db['sequelize'][_0xfdea('0x15')]('../api/voiceRecording/voiceRecording.model');db[_0xfdea('0x1f')]=db[_0xfdea('0x1')][_0xfdea('0x15')](_0xfdea('0x20'));db[_0xfdea('0x21')]=db[_0xfdea('0x1')]['import'](_0xfdea('0x22'));db[_0xfdea('0x23')]=db['sequelize'][_0xfdea('0x15')](_0xfdea('0x24'));db[_0xfdea('0x25')]=db['sequelize'][_0xfdea('0x15')](_0xfdea('0x26'));db['VoiceDialReport']=db[_0xfdea('0x1')][_0xfdea('0x15')](_0xfdea('0x27'));db[_0xfdea('0x28')]=db[_0xfdea('0x1')][_0xfdea('0x15')](_0xfdea('0x29'));db[_0xfdea('0x2a')]=db[_0xfdea('0x1')][_0xfdea('0x15')](_0xfdea('0x2b'));db['MemberReport']=db[_0xfdea('0x1')][_0xfdea('0x15')](_0xfdea('0x2c'));db[_0xfdea('0x2d')]=db[_0xfdea('0x1')]['import'](_0xfdea('0x2e'));db[_0xfdea('0x2f')]=db[_0xfdea('0x1')]['import']('../api/voiceTransferReport/voiceTransferReport.model');db[_0xfdea('0x30')]=db['sequelize']['import']('../api/userVoiceQueueRt/userVoiceQueueRt.model');db['UserVoiceQueue']=db[_0xfdea('0x1')][_0xfdea('0x15')]('../api/userVoiceQueue/userVoiceQueue.model');db[_0xfdea('0x31')]=db[_0xfdea('0x1')][_0xfdea('0x15')](_0xfdea('0x32'));db[_0xfdea('0x33')]=db['sequelize']['import']('../api/userMailQueue/userMailQueue.model');db[_0xfdea('0x34')]=db[_0xfdea('0x1')]['import'](_0xfdea('0x35'));db[_0xfdea('0x36')]=db['sequelize'][_0xfdea('0x15')](_0xfdea('0x37'));db['UserOpenchannelQueue']=db[_0xfdea('0x1')][_0xfdea('0x15')](_0xfdea('0x38'));db[_0xfdea('0x39')]=db[_0xfdea('0x1')][_0xfdea('0x15')](_0xfdea('0x3a'));db[_0xfdea('0x3b')]=db[_0xfdea('0x1')][_0xfdea('0x15')]('../api/mailServerIn/mailServerIn.model');db['MailServerOut']=db[_0xfdea('0x1')][_0xfdea('0x15')](_0xfdea('0x3c'));db[_0xfdea('0x3d')]=db[_0xfdea('0x1')]['import'](_0xfdea('0x3e'));db[_0xfdea('0x3f')]=db[_0xfdea('0x1')]['import'](_0xfdea('0x40'));db[_0xfdea('0x41')]=db[_0xfdea('0x1')][_0xfdea('0x15')](_0xfdea('0x42'));db[_0xfdea('0x43')]=db[_0xfdea('0x1')][_0xfdea('0x15')](_0xfdea('0x44'));db[_0xfdea('0x45')]=db[_0xfdea('0x1')][_0xfdea('0x15')](_0xfdea('0x46'));db[_0xfdea('0x47')]=db[_0xfdea('0x1')][_0xfdea('0x15')](_0xfdea('0x48'));db[_0xfdea('0x49')]=db[_0xfdea('0x1')][_0xfdea('0x15')](_0xfdea('0x4a'));db[_0xfdea('0x4b')]=db[_0xfdea('0x1')][_0xfdea('0x15')](_0xfdea('0x4c'));db['DashboardItem']=db[_0xfdea('0x1')][_0xfdea('0x15')](_0xfdea('0x4d'));db[_0xfdea('0x4e')]=db[_0xfdea('0x1')][_0xfdea('0x15')](_0xfdea('0x4f'));db[_0xfdea('0x50')]=db['sequelize'][_0xfdea('0x15')](_0xfdea('0x51'));db[_0xfdea('0x52')]=db['sequelize'][_0xfdea('0x15')](_0xfdea('0x53'));db[_0xfdea('0x54')]=db[_0xfdea('0x1')][_0xfdea('0x15')]('../api/faxMessage/faxMessage.model');db[_0xfdea('0x55')]=db[_0xfdea('0x1')]['import'](_0xfdea('0x56'));db[_0xfdea('0x57')]=db[_0xfdea('0x1')][_0xfdea('0x15')](_0xfdea('0x58'));db['SmsAccount']=db[_0xfdea('0x1')][_0xfdea('0x15')](_0xfdea('0x59'));db[_0xfdea('0x5a')]=db[_0xfdea('0x1')][_0xfdea('0x15')]('../api/smsApplication/smsApplication.model');db[_0xfdea('0x5b')]=db['sequelize'][_0xfdea('0x15')]('../api/smsInteraction/smsInteraction.model');db[_0xfdea('0x5c')]=db[_0xfdea('0x1')][_0xfdea('0x15')](_0xfdea('0x5d'));db[_0xfdea('0x5e')]=db['sequelize'][_0xfdea('0x15')](_0xfdea('0x5f'));db[_0xfdea('0x60')]=db[_0xfdea('0x1')][_0xfdea('0x15')](_0xfdea('0x61'));db[_0xfdea('0x62')]=db['sequelize']['import']('../api/openchannelApplication/openchannelApplication.model');db[_0xfdea('0x63')]=db[_0xfdea('0x1')]['import'](_0xfdea('0x64'));db[_0xfdea('0x65')]=db[_0xfdea('0x1')]['import'](_0xfdea('0x66'));db['OpenchannelQueue']=db[_0xfdea('0x1')]['import'](_0xfdea('0x67'));db[_0xfdea('0x68')]=db[_0xfdea('0x1')][_0xfdea('0x15')](_0xfdea('0x69'));db['OpenchannelQueueReport']=db[_0xfdea('0x1')][_0xfdea('0x15')](_0xfdea('0x6a'));db[_0xfdea('0x6b')]=db[_0xfdea('0x1')][_0xfdea('0x15')]('../api/chatApplication/chatApplication.model');db[_0xfdea('0x6c')]=db[_0xfdea('0x1')]['import']('../api/chatInteraction/chatInteraction.model');db[_0xfdea('0x6d')]=db['sequelize'][_0xfdea('0x15')](_0xfdea('0x6e'));db['ChatOfflineMessage']=db[_0xfdea('0x1')]['import']('../api/chatOfflineMessage/chatOfflineMessage.model');db[_0xfdea('0x6f')]=db[_0xfdea('0x1')]['import'](_0xfdea('0x70'));db['ChatGroup']=db[_0xfdea('0x1')]['import']('../api/chatGroup/chatGroup.model');db[_0xfdea('0x71')]=db['sequelize']['import'](_0xfdea('0x72'));db[_0xfdea('0x73')]=db[_0xfdea('0x1')][_0xfdea('0x15')](_0xfdea('0x74'));db[_0xfdea('0x75')]=db['sequelize']['import']('../api/cmContact/cmContact.model');db[_0xfdea('0x76')]=db[_0xfdea('0x1')]['import'](_0xfdea('0x77'));db[_0xfdea('0x78')]=db[_0xfdea('0x1')]['import'](_0xfdea('0x79'));db[_0xfdea('0x7a')]=db[_0xfdea('0x1')][_0xfdea('0x15')](_0xfdea('0x7b'));db[_0xfdea('0x7c')]=db[_0xfdea('0x1')]['import'](_0xfdea('0x7d'));db[_0xfdea('0x7e')]=db[_0xfdea('0x1')][_0xfdea('0x15')](_0xfdea('0x7f'));db[_0xfdea('0x80')]=db[_0xfdea('0x1')]['import']('../api/cmCustomField/cmCustomField.model');db[_0xfdea('0x81')]=db[_0xfdea('0x1')][_0xfdea('0x15')](_0xfdea('0x82'));db[_0xfdea('0x83')]=db[_0xfdea('0x1')][_0xfdea('0x15')](_0xfdea('0x84'));db[_0xfdea('0x85')]=db[_0xfdea('0x1')]['import'](_0xfdea('0x86'));db[_0xfdea('0x87')]=db['sequelize'][_0xfdea('0x15')](_0xfdea('0x88'));db[_0xfdea('0x89')]=db['sequelize']['import'](_0xfdea('0x8a'));db[_0xfdea('0x8b')]=db['sequelize'][_0xfdea('0x15')](_0xfdea('0x8c'));db['Pause']=db['sequelize'][_0xfdea('0x15')](_0xfdea('0x8d'));db[_0xfdea('0x8e')]=db[_0xfdea('0x1')]['import'](_0xfdea('0x8f'));db[_0xfdea('0x90')]=db[_0xfdea('0x1')][_0xfdea('0x15')](_0xfdea('0x91'));db[_0xfdea('0x92')]=db[_0xfdea('0x1')][_0xfdea('0x15')](_0xfdea('0x93'));db[_0xfdea('0x94')]=db['sequelize'][_0xfdea('0x15')]('../api/sound/sound.model');db[_0xfdea('0x95')]=db['sequelize'][_0xfdea('0x15')](_0xfdea('0x96'));db[_0xfdea('0x97')]=db[_0xfdea('0x1')][_0xfdea('0x15')]('../api/template/template.model');db[_0xfdea('0x98')]=db[_0xfdea('0x1')][_0xfdea('0x15')](_0xfdea('0x99'));db['Variable']=db[_0xfdea('0x1')][_0xfdea('0x15')](_0xfdea('0x9a'));db[_0xfdea('0x9b')]=db[_0xfdea('0x1')][_0xfdea('0x15')](_0xfdea('0x9c'));db[_0xfdea('0x9d')]=db[_0xfdea('0x1')][_0xfdea('0x15')]('../api/integrationReport/integrationReport.model');db[_0xfdea('0x9e')]=db[_0xfdea('0x1')][_0xfdea('0x15')](_0xfdea('0x9f'));db['AnalyticDefaultReport']=db[_0xfdea('0x1')]['import'](_0xfdea('0xa0'));db[_0xfdea('0xa1')]=db[_0xfdea('0x1')][_0xfdea('0x15')](_0xfdea('0xa2'));db[_0xfdea('0xa3')]=db[_0xfdea('0x1')][_0xfdea('0x15')](_0xfdea('0xa4'));db[_0xfdea('0xa5')]=db[_0xfdea('0x1')]['import']('../api/analyticFieldReport/analyticFieldReport.model');db[_0xfdea('0xa6')]=db['sequelize'][_0xfdea('0x15')](_0xfdea('0xa7'));db[_0xfdea('0xa8')]=db[_0xfdea('0x1')]['import']('../api/intSalesforceAccount/intSalesforceAccount.model');db[_0xfdea('0xa9')]=db['sequelize']['import'](_0xfdea('0xaa'));db[_0xfdea('0xab')]=db[_0xfdea('0x1')][_0xfdea('0x15')]('../api/intSalesforceField/intSalesforceField.model');db[_0xfdea('0xac')]=db[_0xfdea('0x1')][_0xfdea('0x15')]('../api/intSugarcrmAccount/intSugarcrmAccount.model');db[_0xfdea('0xad')]=db[_0xfdea('0x1')][_0xfdea('0x15')](_0xfdea('0xae'));db[_0xfdea('0xaf')]=db['sequelize'][_0xfdea('0x15')](_0xfdea('0xb0'));db[_0xfdea('0xb1')]=db[_0xfdea('0x1')][_0xfdea('0x15')](_0xfdea('0xb2'));db['DeskConfiguration']=db[_0xfdea('0x1')]['import'](_0xfdea('0xb3'));db[_0xfdea('0xb4')]=db[_0xfdea('0x1')][_0xfdea('0x15')](_0xfdea('0xb5'));db[_0xfdea('0xb6')]=db[_0xfdea('0x1')][_0xfdea('0x15')](_0xfdea('0xb7'));db['ZohoConfiguration']=db[_0xfdea('0x1')][_0xfdea('0x15')](_0xfdea('0xb8'));db[_0xfdea('0xb9')]=db['sequelize'][_0xfdea('0x15')](_0xfdea('0xba'));db['ZendeskAccount']=db[_0xfdea('0x1')][_0xfdea('0x15')](_0xfdea('0xbb'));db[_0xfdea('0xbc')]=db[_0xfdea('0x1')][_0xfdea('0x15')](_0xfdea('0xbd'));db[_0xfdea('0xbe')]=db[_0xfdea('0x1')][_0xfdea('0x15')](_0xfdea('0xbf'));db[_0xfdea('0xc0')]=db['sequelize'][_0xfdea('0x15')](_0xfdea('0xc1'));db[_0xfdea('0xc2')]=db['sequelize']['import'](_0xfdea('0xc3'));db[_0xfdea('0xc4')]=db[_0xfdea('0x1')][_0xfdea('0x15')](_0xfdea('0xc5'));db['VtigerAccount']=db[_0xfdea('0x1')][_0xfdea('0x15')](_0xfdea('0xc6'));db[_0xfdea('0xc7')]=db[_0xfdea('0x1')][_0xfdea('0x15')](_0xfdea('0xc8'));db[_0xfdea('0xc9')]=db[_0xfdea('0x1')]['import']('../api/intVtigerField/intVtigerField.model');db['ServicenowAccount']=db[_0xfdea('0x1')][_0xfdea('0x15')](_0xfdea('0xca'));db[_0xfdea('0xcb')]=db[_0xfdea('0x1')][_0xfdea('0x15')](_0xfdea('0xcc'));db['ServicenowField']=db[_0xfdea('0x1')][_0xfdea('0x15')](_0xfdea('0xcd'));db[_0xfdea('0xce')]=db[_0xfdea('0x1')][_0xfdea('0x15')](_0xfdea('0xcf'));db[_0xfdea('0xd0')]=db[_0xfdea('0x1')]['import'](_0xfdea('0xd1'));db['Dynamics365Field']=db[_0xfdea('0x1')][_0xfdea('0x15')](_0xfdea('0xd2'));db['FreshsalesAccount']=db[_0xfdea('0x1')]['import']('../api/intFreshsalesAccount/intFreshsalesAccount.model');db[_0xfdea('0xd3')]=db[_0xfdea('0x1')][_0xfdea('0x15')]('../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model');db['FreshsalesField']=db['sequelize']['import']('../api/intFreshsalesField/intFreshsalesField.model');db[_0xfdea('0x9b')]=db[_0xfdea('0x1')][_0xfdea('0x15')](_0xfdea('0x9c'));db[_0xfdea('0xd4')]=db[_0xfdea('0x1')][_0xfdea('0x15')](_0xfdea('0xd5'));db[_0xfdea('0xd6')]=db[_0xfdea('0x1')][_0xfdea('0x15')]('../api/chatQueueReport/chatQueueReport.model');db[_0xfdea('0xd7')]=db[_0xfdea('0x1')][_0xfdea('0x15')](_0xfdea('0xd8'));db['JscriptyAnswerReport']=db[_0xfdea('0x1')][_0xfdea('0x15')](_0xfdea('0xd9'));db[_0xfdea('0xda')]=db[_0xfdea('0x1')][_0xfdea('0x15')](_0xfdea('0xdb'));db[_0xfdea('0xdc')]=db[_0xfdea('0x1')][_0xfdea('0x15')]('../api/jscriptySessionReport/jscriptySessionReport.model');db[_0xfdea('0xdd')]=db['sequelize'][_0xfdea('0x15')](_0xfdea('0xde'));db[_0xfdea('0xdf')]=db[_0xfdea('0x1')]['import'](_0xfdea('0xe0'));db[_0xfdea('0xe1')]=db[_0xfdea('0x1')][_0xfdea('0x15')]('../api/squareReportDetail/squareReportDetail.model');db[_0xfdea('0xe2')]=db[_0xfdea('0x1')][_0xfdea('0x15')]('../api/jscriptyProject/jscriptyProject.model');db[_0xfdea('0xe3')]=db[_0xfdea('0x1')][_0xfdea('0x15')](_0xfdea('0xe4'));db[_0xfdea('0xe5')]=db[_0xfdea('0x1')][_0xfdea('0x15')](_0xfdea('0xe6'));db[_0xfdea('0xe7')]=db['sequelize']['import'](_0xfdea('0xe8'));db[_0xfdea('0xe9')]=db['sequelize'][_0xfdea('0x15')](_0xfdea('0xea'));db['SquareMessage']=db[_0xfdea('0x1')][_0xfdea('0x15')](_0xfdea('0xeb'));db[_0xfdea('0xec')]=db[_0xfdea('0x1')]['import']('../api/team/team.model');db['License']=db[_0xfdea('0x1')][_0xfdea('0x15')](_0xfdea('0xed'));db[_0xfdea('0xee')]=db[_0xfdea('0x1')][_0xfdea('0x15')](_0xfdea('0xef'));db['Migration']=db[_0xfdea('0x1')][_0xfdea('0x15')](_0xfdea('0xf0'));db[_0xfdea('0xf1')]=db[_0xfdea('0x1')][_0xfdea('0x15')](_0xfdea('0xf2'));db[_0xfdea('0xf3')]=db[_0xfdea('0x1')][_0xfdea('0x15')](_0xfdea('0xf4'));db[_0xfdea('0xf5')]=db['sequelize'][_0xfdea('0x15')]('../api/mailTransferReport/mailTransferReport.model');db[_0xfdea('0xf6')]=db['sequelize'][_0xfdea('0x15')]('../api/chatTransferReport/chatTransferReport.model');db['FaxTransferReport']=db['sequelize'][_0xfdea('0x15')](_0xfdea('0xf7'));db[_0xfdea('0xf8')]=db[_0xfdea('0x1')][_0xfdea('0x15')](_0xfdea('0xf9'));db[_0xfdea('0xfa')]=db[_0xfdea('0x1')]['import']('../api/smsTransferReport/smsTransferReport.model');db['CmList']=db[_0xfdea('0x1')]['import']('../api/cmList/cmList.model');db[_0xfdea('0xfb')]=db[_0xfdea('0x1')][_0xfdea('0x15')]('../api/voicePrefix/voicePrefix.model');db[_0xfdea('0xfc')]=db[_0xfdea('0x1')][_0xfdea('0x15')](_0xfdea('0xfd'));db[_0xfdea('0xfe')]=db[_0xfdea('0x1')]['import']('../api/userProfileSection/userProfileSection.model');db[_0xfdea('0xff')]=db[_0xfdea('0x1')][_0xfdea('0x15')](_0xfdea('0x100'));db[_0xfdea('0x101')]=db[_0xfdea('0x1')]['import'](_0xfdea('0x102'));db[_0xfdea('0x103')]=db[_0xfdea('0x1')][_0xfdea('0x15')](_0xfdea('0x104'));db['WhatsappApplication']=db['sequelize'][_0xfdea('0x15')]('../api/whatsappApplication/whatsappApplication.model');db[_0xfdea('0x105')]=db[_0xfdea('0x1')][_0xfdea('0x15')]('../api/whatsappInteraction/whatsappInteraction.model');db[_0xfdea('0x106')]=db['sequelize'][_0xfdea('0x15')]('../api/whatsappMessage/whatsappMessage.model');db[_0xfdea('0x107')]=db[_0xfdea('0x1')][_0xfdea('0x15')]('../api/whatsappQueueReport/whatsappQueueReport.model');db[_0xfdea('0x108')]=db[_0xfdea('0x1')]['import'](_0xfdea('0x109'));db[_0xfdea('0x10a')]=db[_0xfdea('0x1')]['import'](_0xfdea('0x10b'));db[_0xfdea('0x10c')]=db[_0xfdea('0x1')][_0xfdea('0x15')](_0xfdea('0x10d'));db['TeamVoiceQueue']=db['sequelize']['import']('../api/teamVoiceQueue/teamVoiceQueue.model');db[_0xfdea('0x10e')]=db['sequelize'][_0xfdea('0x15')](_0xfdea('0x10f'));db['UserVoicePrefix']=db[_0xfdea('0x1')][_0xfdea('0x15')](_0xfdea('0x110'));db['User']['hasOne'](db[_0xfdea('0x21')],{'as':_0xfdea('0x21'),'onDelete':_0xfdea('0x111'),'foreignKey':_0xfdea('0x112')});db[_0xfdea('0x113')][_0xfdea('0x114')](db['VoiceRecording'],{'as':_0xfdea('0x115'),'foreignKey':'UserId'});db[_0xfdea('0x113')]['hasMany'](db[_0xfdea('0x30')],{'as':'VoiceQueuesRt','foreignKey':_0xfdea('0x112')});db[_0xfdea('0x113')]['hasMany'](db[_0xfdea('0x19')],{'as':'Extensions','onDelete':_0xfdea('0x111'),'hooks':!![]});db[_0xfdea('0x113')][_0xfdea('0x114')](db['CmHopperFinal'],{'as':'HopperFinals','foreignKey':_0xfdea('0x112')});db['User']['hasMany'](db['CmHopperHistory'],{'as':'HopperHistory','foreignKey':_0xfdea('0x112')});db[_0xfdea('0x113')][_0xfdea('0x114')](db[_0xfdea('0x7e')],{'as':'ReportAgentPreview','foreignKey':_0xfdea('0x112')});db['User'][_0xfdea('0x114')](db[_0xfdea('0x63')],{'as':_0xfdea('0x116'),'foreignKey':'UserId'});db[_0xfdea('0x113')]['hasMany'](db['ChatInteraction'],{'as':_0xfdea('0x117'),'foreignKey':_0xfdea('0x112')});db['User']['hasMany'](db['SmsInteraction'],{'as':_0xfdea('0x118'),'foreignKey':_0xfdea('0x112')});db[_0xfdea('0x113')][_0xfdea('0x114')](db[_0xfdea('0x52')],{'as':_0xfdea('0x119'),'foreignKey':_0xfdea('0x112')});db[_0xfdea('0x113')][_0xfdea('0x114')](db[_0xfdea('0x43')],{'as':'MailInteractions','foreignKey':_0xfdea('0x112')});db[_0xfdea('0x113')][_0xfdea('0x114')](db[_0xfdea('0x105')],{'as':_0xfdea('0x11a'),'foreignKey':_0xfdea('0x112')});db[_0xfdea('0x113')]['hasMany'](db[_0xfdea('0x101')],{'as':_0xfdea('0x11b'),'foreignKey':'SenderId'});db[_0xfdea('0x113')][_0xfdea('0x11c')](db[_0xfdea('0xfc')],{'as':_0xfdea('0xfc'),'foreignKey':'userProfileId'});db['User'][_0xfdea('0x11d')](db[_0xfdea('0x11e')],{'as':'Groups','through':'chat_group_has_users'});db[_0xfdea('0x113')][_0xfdea('0x11d')](db[_0xfdea('0x75')],{'as':'Contacts','through':_0xfdea('0x11f')});db['User'][_0xfdea('0x11d')](db[_0xfdea('0x120')],{'as':'Lists','through':_0xfdea('0x121')});db['User'][_0xfdea('0x11d')](db[_0xfdea('0xec')],{'through':_0xfdea('0x122')});db[_0xfdea('0x113')][_0xfdea('0x11d')](db['MailInteraction'],{'as':_0xfdea('0x123'),'through':'user_has_mail_interactions'});db[_0xfdea('0x113')]['belongsToMany'](db[_0xfdea('0x6c')],{'as':_0xfdea('0x117'),'through':'user_has_chat_interactions'});db[_0xfdea('0x113')][_0xfdea('0x11d')](db[_0xfdea('0x52')],{'as':_0xfdea('0x119'),'through':'user_has_fax_interactions'});db[_0xfdea('0x113')][_0xfdea('0x11d')](db[_0xfdea('0x5b')],{'as':_0xfdea('0x118'),'through':_0xfdea('0x124')});db[_0xfdea('0x113')][_0xfdea('0x11d')](db[_0xfdea('0x63')],{'as':_0xfdea('0x116'),'through':'user_has_openchannel_interactions'});db[_0xfdea('0x113')][_0xfdea('0x11d')](db[_0xfdea('0x105')],{'as':_0xfdea('0x11a'),'through':'user_has_whatsapp_interactions'});db[_0xfdea('0x113')][_0xfdea('0x11d')](db[_0xfdea('0x1c')],{'as':'VoiceQueues','through':'UserVoiceQueue','required':![]});db[_0xfdea('0x113')][_0xfdea('0x11d')](db['VoicePrefix'],{'as':_0xfdea('0x125'),'through':_0xfdea('0x126'),'required':![]});db[_0xfdea('0x113')][_0xfdea('0x11d')](db[_0xfdea('0x3f')],{'as':_0xfdea('0x127'),'through':_0xfdea('0x33'),'required':![]});db[_0xfdea('0x113')][_0xfdea('0x11d')](db['ChatQueue'],{'as':'ChatQueues','through':_0xfdea('0x31'),'required':![],'hooks':!![]});db[_0xfdea('0x113')][_0xfdea('0x11d')](db[_0xfdea('0x55')],{'as':_0xfdea('0x128'),'through':_0xfdea('0x34'),'required':![]});db['User'][_0xfdea('0x11d')](db[_0xfdea('0x5e')],{'as':_0xfdea('0x129'),'through':_0xfdea('0x36'),'required':![]});db[_0xfdea('0x113')]['belongsToMany'](db['OpenchannelQueue'],{'as':'OpenchannelQueues','through':_0xfdea('0x12a'),'required':![]});db[_0xfdea('0x113')]['belongsToMany'](db[_0xfdea('0x10a')],{'as':'WhatsappQueues','through':_0xfdea('0x39'),'required':![]});db['User'][_0xfdea('0x11d')](db[_0xfdea('0x120')],{'through':'cm_user_has_lists'});db[_0xfdea('0x113')][_0xfdea('0x11d')](db[_0xfdea('0x68')],{'as':_0xfdea('0x12b'),'through':_0xfdea('0x12c')});db[_0xfdea('0x113')][_0xfdea('0x11d')](db[_0xfdea('0x4e')],{'as':_0xfdea('0x12d'),'through':_0xfdea('0x12e')});db[_0xfdea('0x113')]['belongsToMany'](db['MailAccount'],{'as':_0xfdea('0x12f'),'through':_0xfdea('0x130')});db[_0xfdea('0x113')][_0xfdea('0x11d')](db['OpenchannelAccount'],{'as':_0xfdea('0x131'),'through':_0xfdea('0x132')});db[_0xfdea('0x113')][_0xfdea('0x11d')](db[_0xfdea('0x133')],{'as':'SmsAccounts','through':_0xfdea('0x134')});db['User'][_0xfdea('0x11d')](db['WhatsappAccount'],{'as':_0xfdea('0x135'),'through':_0xfdea('0x136')});db[_0xfdea('0x113')]['belongsToMany'](db[_0xfdea('0xe7')],{'as':_0xfdea('0x137'),'through':_0xfdea('0x138')});db[_0xfdea('0x14')][_0xfdea('0x114')](db[_0xfdea('0x19')],{'as':_0xfdea('0x139'),'onDelete':'cascade','foreignKey':'ChanSpyId'});db[_0xfdea('0x17')][_0xfdea('0x114')](db[_0xfdea('0x19')],{'onDelete':'cascade'});db[_0xfdea('0x19')][_0xfdea('0x114')](db['VoiceExtension'],{'as':_0xfdea('0x13a'),'onDelete':'cascade'});db['VoiceMusicOnHold'][_0xfdea('0x11d')](db['Sound'],{'as':'Sounds','through':_0xfdea('0x13b')});db[_0xfdea('0x1c')][_0xfdea('0x114')](db[_0xfdea('0x30')],{'as':'Members','foreignKey':'VoiceQueueId'});db[_0xfdea('0x1c')]['hasMany'](db[_0xfdea('0x76')],{'as':_0xfdea('0x13c'),'foreignKey':_0xfdea('0x13d')});db[_0xfdea('0x1c')][_0xfdea('0x114')](db[_0xfdea('0x7a')],{'as':_0xfdea('0x13e'),'foreignKey':_0xfdea('0x13d')});db['VoiceQueue'][_0xfdea('0x114')](db['CmHopperHistory'],{'as':'HopperHistories','foreignKey':_0xfdea('0x13d')});db['VoiceQueue']['hasMany'](db['ReportAgentPreview'],{'as':_0xfdea('0x7e'),'foreignKey':_0xfdea('0x13d')});db[_0xfdea('0x1c')]['hasMany'](db[_0xfdea('0x78')],{'as':_0xfdea('0x13f'),'foreignKey':_0xfdea('0x13d')});db['VoiceQueue'][_0xfdea('0x114')](db[_0xfdea('0xdc')],{'as':_0xfdea('0x140'),'foreignKey':'VoiceQueueId'});db[_0xfdea('0x1c')][_0xfdea('0x11c')](db['Trunk'],{'as':_0xfdea('0x2d'),'foreignKey':'TrunkId'});db[_0xfdea('0x1c')]['belongsTo'](db[_0xfdea('0x2d')],{'as':_0xfdea('0x141'),'foreignKey':'TrunkBackupId'});db['VoiceQueue'][_0xfdea('0x11c')](db[_0xfdea('0x8b')],{'as':_0xfdea('0x8b'),'foreignKey':_0xfdea('0x142')});db['VoiceQueue'][_0xfdea('0x11c')](db[_0xfdea('0x143')],{'as':_0xfdea('0x144'),'foreignKey':_0xfdea('0x145')});db[_0xfdea('0x1c')]['belongsToMany'](db[_0xfdea('0x120')],{'as':'Lists','through':_0xfdea('0x146')});db['VoiceQueue'][_0xfdea('0x11d')](db['User'],{'as':_0xfdea('0x147'),'through':_0xfdea('0x148')});db['VoiceQueue'][_0xfdea('0x11d')](db[_0xfdea('0xec')],{'as':'Teams','through':_0xfdea('0x149')});db[_0xfdea('0x1c')][_0xfdea('0x11d')](db[_0xfdea('0x120')],{'as':_0xfdea('0x14a'),'through':_0xfdea('0x14b')});db[_0xfdea('0x1e')][_0xfdea('0x11c')](db[_0xfdea('0x113')],{'as':_0xfdea('0x113'),'foreignKey':'UserId'});db[_0xfdea('0x1f')][_0xfdea('0x11c')](db[_0xfdea('0x113')],{'as':_0xfdea('0x113'),'foreignKey':_0xfdea('0x112')});db['VoiceMail'][_0xfdea('0x114')](db[_0xfdea('0x23')],{'as':_0xfdea('0x14c'),'onDelete':_0xfdea('0x111'),'foreignKey':'mailboxuser','sourceKey':'mailbox'});db[_0xfdea('0x23')][_0xfdea('0x11c')](db['VoiceMail'],{'foreignKey':_0xfdea('0x14d'),'targetKey':_0xfdea('0x14e')});db[_0xfdea('0x25')][_0xfdea('0x114')](db[_0xfdea('0x2a')],{'as':_0xfdea('0x14f'),'foreignKey':_0xfdea('0x150'),'constraints':![]});db[_0xfdea('0x25')][_0xfdea('0x114')](db[_0xfdea('0x28')],{'as':'AgentReports','foreignKey':'uniqueid','constraints':![]});db[_0xfdea('0x25')]['belongsTo'](db['User'],{'as':_0xfdea('0x113'),'foreignKey':_0xfdea('0x112')});db[_0xfdea('0x25')][_0xfdea('0x11c')](db[_0xfdea('0x75')],{'as':'Contact','foreignKey':_0xfdea('0x151')});db[_0xfdea('0x3b')][_0xfdea('0x11c')](db[_0xfdea('0x3d')],{'as':_0xfdea('0x3d'),'foreignKey':'MailAccountId'});db[_0xfdea('0x152')]['belongsTo'](db['MailAccount'],{'as':_0xfdea('0x3d'),'foreignKey':_0xfdea('0x153')});db[_0xfdea('0x3d')][_0xfdea('0x154')](db[_0xfdea('0x3b')],{'as':'Imap','onDelete':'cascade'});db[_0xfdea('0x3d')][_0xfdea('0x154')](db[_0xfdea('0x152')],{'as':_0xfdea('0x155'),'onDelete':'cascade'});db['MailAccount'][_0xfdea('0x114')](db[_0xfdea('0x87')],{'as':'Dispositions','foreignKey':_0xfdea('0x153'),'onDelete':'cascade'});db[_0xfdea('0x3d')][_0xfdea('0x114')](db[_0xfdea('0x85')],{'as':_0xfdea('0x156'),'foreignKey':_0xfdea('0x153')});db[_0xfdea('0x3d')][_0xfdea('0x114')](db[_0xfdea('0x45')],{'as':_0xfdea('0x14c'),'foreignKey':_0xfdea('0x153')});db['MailAccount'][_0xfdea('0x114')](db[_0xfdea('0x43')],{'as':'Interactions'});db['MailAccount']['hasMany'](db[_0xfdea('0x47')],{'as':_0xfdea('0x13a')});db[_0xfdea('0x3d')]['belongsTo'](db[_0xfdea('0x120')],{'as':_0xfdea('0x157'),'foreignKey':_0xfdea('0x158')});db['MailAccount'][_0xfdea('0x11c')](db[_0xfdea('0x97')],{'as':_0xfdea('0x97'),'foreignKey':_0xfdea('0x159')});db[_0xfdea('0x3d')][_0xfdea('0x11c')](db[_0xfdea('0x143')],{'as':_0xfdea('0x144'),'foreignKey':_0xfdea('0x145')});db[_0xfdea('0x3d')][_0xfdea('0x11d')](db[_0xfdea('0x113')],{'as':_0xfdea('0x147'),'through':'user_has_mail_accounts'});db[_0xfdea('0x3f')][_0xfdea('0x11d')](db[_0xfdea('0x113')],{'as':'Agents','through':_0xfdea('0x33')});db['MailQueue'][_0xfdea('0x11d')](db[_0xfdea('0xec')],{'through':'team_has_mail_queues','as':'Teams'});db[_0xfdea('0x43')][_0xfdea('0x114')](db[_0xfdea('0x45')],{'as':'Messages','onDelete':_0xfdea('0x111'),'foreignKey':_0xfdea('0x15a')});db[_0xfdea('0x43')][_0xfdea('0x11c')](db['MailAccount'],{'as':_0xfdea('0x15b'),'foreignKey':_0xfdea('0x153')});db[_0xfdea('0x43')][_0xfdea('0x11c')](db['CmContact'],{'as':_0xfdea('0x15c'),'foreignKey':_0xfdea('0x151')});db[_0xfdea('0x43')]['belongsTo'](db[_0xfdea('0x113')],{'as':_0xfdea('0x15d'),'foreignKey':'UserId'});db['MailInteraction']['belongsToMany'](db['Tag'],{'through':_0xfdea('0x15e'),'as':'Tags'});db[_0xfdea('0x43')][_0xfdea('0x11d')](db[_0xfdea('0x95')],{'through':_0xfdea('0x15e'),'as':_0xfdea('0x15f')});db[_0xfdea('0x43')][_0xfdea('0x11d')](db['User'],{'as':_0xfdea('0x160'),'through':_0xfdea('0x161'),'foreignKey':_0xfdea('0x15a')});db['MailMessage'][_0xfdea('0x114')](db['Attachment'],{'as':_0xfdea('0x162'),'onDelete':'cascade'});db[_0xfdea('0x45')][_0xfdea('0x11c')](db[_0xfdea('0x113')],{'as':_0xfdea('0x113')});db[_0xfdea('0x45')][_0xfdea('0x11c')](db[_0xfdea('0x75')],{'onDelete':'cascade','as':'Contact'});db[_0xfdea('0x45')][_0xfdea('0x11c')](db[_0xfdea('0x43')],{'as':_0xfdea('0x163'),'foreignKey':'MailInteractionId'});db['MailMessage'][_0xfdea('0x11c')](db['MailAccount'],{'as':_0xfdea('0x15b'),'foreignKey':_0xfdea('0x153')});db[_0xfdea('0x45')][_0xfdea('0x11c')](db[_0xfdea('0x68')],{'as':_0xfdea('0x68'),'foreignKey':_0xfdea('0x164')});db['MailMessage'][_0xfdea('0x11c')](db[_0xfdea('0x165')],{'as':_0xfdea('0x165'),'foreignKey':_0xfdea('0x166')});db[_0xfdea('0x47')][_0xfdea('0x11c')](db['User'],{'onDelete':'restrict'});db[_0xfdea('0x47')]['belongsTo'](db['MailQueue'],{'onDelete':'restrict'});db['MailApplication'][_0xfdea('0x11c')](db[_0xfdea('0x3d')],{'onDelete':_0xfdea('0x167')});db[_0xfdea('0x47')][_0xfdea('0x11c')](db[_0xfdea('0x8b')],{'onDelete':'restrict','foreignKey':_0xfdea('0x142')});db['MailApplication'][_0xfdea('0x11c')](db[_0xfdea('0x95')],{'onDelete':_0xfdea('0x167'),'foreignKey':_0xfdea('0x168')});db[_0xfdea('0x49')][_0xfdea('0x11c')](db['MailAccount'],{});db[_0xfdea('0x49')][_0xfdea('0x11c')](db[_0xfdea('0x120')],{'as':_0xfdea('0x157'),'foreignKey':_0xfdea('0x158')});db[_0xfdea('0x49')]['belongsTo'](db[_0xfdea('0x75')],{'as':_0xfdea('0x15c'),'foreignKey':_0xfdea('0x151')});db['MailQueueReport']['belongsTo'](db['MailInteraction'],{});db[_0xfdea('0x49')][_0xfdea('0x11c')](db[_0xfdea('0x45')],{});db[_0xfdea('0x49')][_0xfdea('0x11c')](db[_0xfdea('0x113')],{});db['MailQueueReport'][_0xfdea('0x11c')](db['MailQueue'],{});db['Dashboard'][_0xfdea('0x114')](db['DashboardItem'],{'as':_0xfdea('0x169'),'onDelete':'cascade'});db['FaxAccount']['hasMany'](db[_0xfdea('0x87')],{'as':_0xfdea('0x16a'),'foreignKey':_0xfdea('0x16b'),'onDelete':'cascade'});db[_0xfdea('0x4e')]['hasMany'](db[_0xfdea('0x85')],{'as':_0xfdea('0x156'),'foreignKey':_0xfdea('0x16b')});db['FaxAccount'][_0xfdea('0x114')](db[_0xfdea('0x52')],{'as':_0xfdea('0x16c')});db[_0xfdea('0x4e')][_0xfdea('0x114')](db[_0xfdea('0x50')],{'as':'Applications'});db['FaxAccount'][_0xfdea('0x114')](db['VoiceExtension'],{'as':'Exntensions','onDelete':_0xfdea('0x111')});db[_0xfdea('0x4e')][_0xfdea('0x114')](db[_0xfdea('0x54')],{'as':_0xfdea('0x14c')});db['FaxAccount'][_0xfdea('0x11c')](db[_0xfdea('0x2d')],{'as':_0xfdea('0x2d')});db[_0xfdea('0x4e')][_0xfdea('0x11c')](db[_0xfdea('0x120')],{'as':_0xfdea('0x157'),'foreignKey':_0xfdea('0x158')});db[_0xfdea('0x4e')][_0xfdea('0x11c')](db['Pause'],{'as':_0xfdea('0x144'),'foreignKey':'mandatoryDispositionPauseId'});db[_0xfdea('0x4e')]['belongsToMany'](db[_0xfdea('0x113')],{'as':_0xfdea('0x147'),'through':_0xfdea('0x12e')});db[_0xfdea('0x50')][_0xfdea('0x11c')](db['User'],{'onDelete':_0xfdea('0x167')});db[_0xfdea('0x50')]['belongsTo'](db[_0xfdea('0x55')],{'onDelete':'restrict'});db[_0xfdea('0x50')][_0xfdea('0x11c')](db[_0xfdea('0x4e')],{'onDelete':_0xfdea('0x167')});db[_0xfdea('0x50')][_0xfdea('0x11c')](db[_0xfdea('0x95')],{'onDelete':'restrict','foreignKey':_0xfdea('0x168')});db['FaxInteraction']['hasMany'](db[_0xfdea('0x54')],{'as':_0xfdea('0x14c'),'onDelete':_0xfdea('0x111'),'foreignKey':'FaxInteractionId'});db[_0xfdea('0x52')]['belongsTo'](db['FaxAccount'],{'as':'Account','foreignKey':'FaxAccountId'});db[_0xfdea('0x52')][_0xfdea('0x11c')](db[_0xfdea('0x75')],{'as':_0xfdea('0x15c'),'foreignKey':_0xfdea('0x151')});db[_0xfdea('0x52')][_0xfdea('0x11c')](db[_0xfdea('0x113')],{'as':_0xfdea('0x15d'),'foreignKey':_0xfdea('0x112')});db[_0xfdea('0x52')][_0xfdea('0x11d')](db['Tag'],{'through':_0xfdea('0x16d'),'as':_0xfdea('0x16e')});db['FaxInteraction'][_0xfdea('0x11d')](db[_0xfdea('0x95')],{'through':_0xfdea('0x16d'),'as':_0xfdea('0x15f')});db[_0xfdea('0x52')][_0xfdea('0x11d')](db['User'],{'as':_0xfdea('0x160'),'through':_0xfdea('0x16f'),'foreignKey':_0xfdea('0x170')});db[_0xfdea('0x54')][_0xfdea('0x11c')](db[_0xfdea('0x113')],{'onDelete':_0xfdea('0x111'),'as':_0xfdea('0x113')});db[_0xfdea('0x54')][_0xfdea('0x11c')](db[_0xfdea('0x52')],{'as':_0xfdea('0x163'),'foreignKey':_0xfdea('0x170')});db[_0xfdea('0x54')][_0xfdea('0x11c')](db[_0xfdea('0x75')],{'onDelete':_0xfdea('0x111'),'as':'Contact'});db['FaxMessage'][_0xfdea('0x11c')](db[_0xfdea('0xf1')],{'as':_0xfdea('0xf1'),'foreignKey':_0xfdea('0x171')});db['FaxMessage'][_0xfdea('0x11c')](db[_0xfdea('0x4e')],{'as':'Account','foreignKey':_0xfdea('0x16b')});db[_0xfdea('0x55')][_0xfdea('0x11d')](db[_0xfdea('0x113')],{'as':_0xfdea('0x147'),'through':_0xfdea('0x34')});db['FaxQueue'][_0xfdea('0x11d')](db[_0xfdea('0xec')],{'through':'team_has_fax_queues','as':_0xfdea('0x172')});db[_0xfdea('0x57')][_0xfdea('0x11c')](db[_0xfdea('0x4e')],{});db[_0xfdea('0x57')]['belongsTo'](db['CmList'],{'as':_0xfdea('0x157'),'foreignKey':_0xfdea('0x158')});db[_0xfdea('0x57')][_0xfdea('0x11c')](db[_0xfdea('0x75')],{'as':_0xfdea('0x15c'),'foreignKey':'ContactId'});db[_0xfdea('0x57')][_0xfdea('0x11c')](db[_0xfdea('0x52')],{});db[_0xfdea('0x57')][_0xfdea('0x11c')](db['FaxMessage'],{});db[_0xfdea('0x57')][_0xfdea('0x11c')](db[_0xfdea('0x113')],{});db[_0xfdea('0x57')][_0xfdea('0x11c')](db[_0xfdea('0x55')],{});db[_0xfdea('0x133')][_0xfdea('0x114')](db[_0xfdea('0x87')],{'as':_0xfdea('0x16a'),'foreignKey':'SmsAccountId','onDelete':'cascade'});db['SmsAccount'][_0xfdea('0x114')](db['CannedAnswer'],{'as':_0xfdea('0x156'),'foreignKey':_0xfdea('0x173')});db[_0xfdea('0x133')][_0xfdea('0x114')](db['SmsMessage'],{'as':'Messages','foreignKey':'SmsAccountId'});db[_0xfdea('0x133')][_0xfdea('0x114')](db[_0xfdea('0x5b')],{'as':_0xfdea('0x16c')});db['SmsAccount'][_0xfdea('0x114')](db[_0xfdea('0x5a')],{'as':_0xfdea('0x13a')});db[_0xfdea('0x133')]['belongsTo'](db[_0xfdea('0x120')],{'as':_0xfdea('0x157'),'foreignKey':_0xfdea('0x158')});db['SmsAccount'][_0xfdea('0x11c')](db[_0xfdea('0x143')],{'as':_0xfdea('0x144'),'foreignKey':_0xfdea('0x145')});db[_0xfdea('0x133')][_0xfdea('0x11d')](db[_0xfdea('0x113')],{'as':'Agents','through':'user_has_sms_accounts'});db[_0xfdea('0x5a')][_0xfdea('0x11c')](db[_0xfdea('0x113')],{'onDelete':_0xfdea('0x167')});db[_0xfdea('0x5a')]['belongsTo'](db[_0xfdea('0x5e')],{'onDelete':_0xfdea('0x167')});db[_0xfdea('0x5a')]['belongsTo'](db[_0xfdea('0x133')],{'onDelete':_0xfdea('0x167')});db['SmsApplication'][_0xfdea('0x11c')](db[_0xfdea('0x8b')],{'onDelete':_0xfdea('0x167'),'foreignKey':_0xfdea('0x142')});db[_0xfdea('0x5a')][_0xfdea('0x11c')](db['Tag'],{'onDelete':'restrict','foreignKey':_0xfdea('0x168')});db['SmsInteraction'][_0xfdea('0x114')](db[_0xfdea('0x5c')],{'as':_0xfdea('0x14c'),'onDelete':_0xfdea('0x111'),'foreignKey':_0xfdea('0x174')});db[_0xfdea('0x5b')][_0xfdea('0x11c')](db['SmsAccount'],{'as':_0xfdea('0x15b'),'foreignKey':_0xfdea('0x173')});db[_0xfdea('0x5b')][_0xfdea('0x11c')](db[_0xfdea('0x75')],{'as':_0xfdea('0x15c'),'foreignKey':'ContactId'});db[_0xfdea('0x5b')][_0xfdea('0x11c')](db[_0xfdea('0x113')],{'as':'Owner','foreignKey':'UserId'});db[_0xfdea('0x5b')]['belongsToMany'](db[_0xfdea('0x95')],{'through':_0xfdea('0x175'),'as':_0xfdea('0x16e')});db[_0xfdea('0x5b')][_0xfdea('0x11d')](db[_0xfdea('0x95')],{'through':_0xfdea('0x175'),'as':'ThroughTags'});db[_0xfdea('0x5b')]['belongsToMany'](db[_0xfdea('0x113')],{'as':_0xfdea('0x160'),'through':'user_has_sms_interactions','foreignKey':_0xfdea('0x174')});db[_0xfdea('0x5c')][_0xfdea('0x11c')](db['User'],{'as':_0xfdea('0x113')});db[_0xfdea('0x5c')][_0xfdea('0x11c')](db[_0xfdea('0x75')],{'onDelete':'cascade','as':'Contact'});db[_0xfdea('0x5c')][_0xfdea('0x11c')](db[_0xfdea('0x5b')],{'onDelete':_0xfdea('0x111'),'as':_0xfdea('0x163'),'foreignKey':_0xfdea('0x174')});db['SmsMessage'][_0xfdea('0x11c')](db['SmsAccount'],{'as':_0xfdea('0x15b'),'foreignKey':'SmsAccountId'});db[_0xfdea('0x5e')][_0xfdea('0x11d')](db['User'],{'as':_0xfdea('0x147'),'through':'UserSmsQueue','foreignKey':_0xfdea('0x176')});db['SmsQueue'][_0xfdea('0x11d')](db['Team'],{'through':_0xfdea('0x177'),'as':_0xfdea('0x172')});db[_0xfdea('0x60')]['hasMany'](db[_0xfdea('0x87')],{'as':_0xfdea('0x16a'),'foreignKey':'OpenchannelAccountId','onDelete':'cascade'});db['OpenchannelAccount'][_0xfdea('0x114')](db[_0xfdea('0x85')],{'as':_0xfdea('0x156'),'foreignKey':_0xfdea('0x178')});db[_0xfdea('0x60')][_0xfdea('0x114')](db[_0xfdea('0x63')],{'as':'Interactions','foreignKey':_0xfdea('0x178')});db[_0xfdea('0x60')][_0xfdea('0x114')](db['OpenchannelMessage'],{'as':_0xfdea('0x14c'),'foreignKey':_0xfdea('0x178')});db['OpenchannelAccount'][_0xfdea('0x114')](db[_0xfdea('0x62')],{'as':'Applications','foreignKey':_0xfdea('0x178')});db['OpenchannelAccount'][_0xfdea('0x11c')](db[_0xfdea('0x120')],{'as':_0xfdea('0x157'),'foreignKey':_0xfdea('0x158')});db['OpenchannelAccount']['belongsTo'](db[_0xfdea('0x143')],{'as':_0xfdea('0x144'),'foreignKey':_0xfdea('0x145')});db[_0xfdea('0x60')][_0xfdea('0x11d')](db[_0xfdea('0x113')],{'as':_0xfdea('0x147'),'through':_0xfdea('0x132')});db[_0xfdea('0x62')][_0xfdea('0x11c')](db['User'],{'onDelete':_0xfdea('0x167')});db[_0xfdea('0x62')]['belongsTo'](db['OpenchannelQueue'],{'onDelete':_0xfdea('0x167'),'foreignKey':_0xfdea('0x179')});db[_0xfdea('0x62')][_0xfdea('0x11c')](db[_0xfdea('0x60')],{'onDelete':_0xfdea('0x167'),'foreignKey':_0xfdea('0x178')});db[_0xfdea('0x62')][_0xfdea('0x11c')](db[_0xfdea('0x8b')],{'onDelete':_0xfdea('0x167'),'foreignKey':_0xfdea('0x142')});db[_0xfdea('0x62')][_0xfdea('0x11c')](db[_0xfdea('0x95')],{'onDelete':'restrict','foreignKey':'TagId'});db['OpenchannelInteraction'][_0xfdea('0x114')](db[_0xfdea('0x65')],{'as':'Messages','onDelete':_0xfdea('0x111'),'foreignKey':'OpenchannelInteractionId'});db[_0xfdea('0x63')][_0xfdea('0x11c')](db[_0xfdea('0x60')],{'as':_0xfdea('0x15b'),'foreignKey':_0xfdea('0x178')});db[_0xfdea('0x63')][_0xfdea('0x11c')](db[_0xfdea('0x75')],{'as':_0xfdea('0x15c'),'foreignKey':_0xfdea('0x151')});db['OpenchannelInteraction'][_0xfdea('0x11c')](db['User'],{'as':_0xfdea('0x15d'),'foreignKey':_0xfdea('0x112')});db[_0xfdea('0x63')][_0xfdea('0x11d')](db[_0xfdea('0x95')],{'through':'openchannel_interaction_has_tags','as':'Tags'});db[_0xfdea('0x63')][_0xfdea('0x11d')](db[_0xfdea('0x95')],{'through':_0xfdea('0x17a'),'as':_0xfdea('0x15f')});db[_0xfdea('0x63')][_0xfdea('0x11d')](db['User'],{'as':'Users','through':_0xfdea('0x17b'),'foreignKey':'OpenchannelInteractionId'});db[_0xfdea('0x65')][_0xfdea('0x11c')](db[_0xfdea('0x113')],{'onDelete':_0xfdea('0x111'),'as':_0xfdea('0x113')});db[_0xfdea('0x65')][_0xfdea('0x11c')](db[_0xfdea('0x75')],{'onDelete':_0xfdea('0x111'),'as':_0xfdea('0x15c')});db[_0xfdea('0x65')][_0xfdea('0x11c')](db[_0xfdea('0x63')],{'onDelete':'cascade','as':_0xfdea('0x163'),'foreignKey':_0xfdea('0x17c')});db[_0xfdea('0x65')][_0xfdea('0x11c')](db[_0xfdea('0xf1')],{'as':_0xfdea('0xf1'),'foreignKey':'AttachmentId'});db[_0xfdea('0x65')][_0xfdea('0x11c')](db[_0xfdea('0x60')],{'as':_0xfdea('0x15b'),'foreignKey':'OpenchannelAccountId'});db[_0xfdea('0x17d')][_0xfdea('0x11d')](db[_0xfdea('0x113')],{'as':_0xfdea('0x147'),'through':_0xfdea('0x12a'),'foreignKey':_0xfdea('0x179')});db[_0xfdea('0x17d')]['belongsToMany'](db['Team'],{'through':_0xfdea('0x17e'),'as':_0xfdea('0x172')});db[_0xfdea('0x68')][_0xfdea('0x114')](db['Disposition'],{'as':_0xfdea('0x16a'),'foreignKey':'ChatWebsiteId','onDelete':_0xfdea('0x111')});db[_0xfdea('0x68')][_0xfdea('0x114')](db['CannedAnswer'],{'as':_0xfdea('0x156'),'foreignKey':'ChatWebsiteId'});db[_0xfdea('0x68')]['hasMany'](db[_0xfdea('0x71')],{'as':_0xfdea('0x17f')});db[_0xfdea('0x68')][_0xfdea('0x114')](db[_0xfdea('0x6c')],{'as':_0xfdea('0x16c')});db[_0xfdea('0x68')][_0xfdea('0x114')](db['ChatApplication'],{'as':'Applications'});db[_0xfdea('0x68')]['hasMany'](db[_0xfdea('0x6d')],{'as':_0xfdea('0x14c')});db['ChatWebsite'][_0xfdea('0x11c')](db[_0xfdea('0x120')],{'as':_0xfdea('0x157'),'foreignKey':_0xfdea('0x158')});db[_0xfdea('0x68')][_0xfdea('0x11c')](db[_0xfdea('0x8b')],{'as':_0xfdea('0x8b'),'foreignKey':_0xfdea('0x142')});db[_0xfdea('0x68')][_0xfdea('0x11c')](db['MailAccount'],{'as':_0xfdea('0x3d'),'foreignKey':_0xfdea('0x153')});db['ChatWebsite'][_0xfdea('0x11c')](db[_0xfdea('0x143')],{'as':_0xfdea('0x144'),'foreignKey':_0xfdea('0x145')});db[_0xfdea('0x68')][_0xfdea('0x11d')](db[_0xfdea('0x113')],{'as':_0xfdea('0x147'),'through':'user_has_chat_websites'});db['OpenchannelQueueReport']['belongsTo'](db[_0xfdea('0x60')],{});db[_0xfdea('0x180')][_0xfdea('0x11c')](db[_0xfdea('0x120')],{'as':'List','foreignKey':'ListId'});db[_0xfdea('0x180')]['belongsTo'](db[_0xfdea('0x75')],{'as':_0xfdea('0x15c'),'foreignKey':'ContactId'});db[_0xfdea('0x180')][_0xfdea('0x11c')](db[_0xfdea('0x63')],{});db[_0xfdea('0x180')]['belongsTo'](db[_0xfdea('0x65')],{});db[_0xfdea('0x180')][_0xfdea('0x11c')](db[_0xfdea('0x113')],{});db['OpenchannelQueueReport'][_0xfdea('0x11c')](db['OpenchannelQueue'],{});db[_0xfdea('0x6b')][_0xfdea('0x11c')](db[_0xfdea('0x113')],{'as':_0xfdea('0x181'),'foreignKey':'UserId','onDelete':_0xfdea('0x167')});db[_0xfdea('0x6b')]['belongsTo'](db['ChatQueue'],{'as':_0xfdea('0x182'),'foreignKey':'ChatQueueId','onDelete':_0xfdea('0x167')});db[_0xfdea('0x6b')]['belongsTo'](db[_0xfdea('0x68')],{'as':_0xfdea('0x183'),'foreignKey':_0xfdea('0x164'),'onDelete':_0xfdea('0x167')});db[_0xfdea('0x6b')][_0xfdea('0x11c')](db[_0xfdea('0x95')],{'onDelete':_0xfdea('0x167'),'foreignKey':_0xfdea('0x168')});db[_0xfdea('0x6c')][_0xfdea('0x114')](db[_0xfdea('0x6d')],{'as':_0xfdea('0x14c'),'onDelete':'cascade','foreignKey':_0xfdea('0x184')});db['ChatInteraction'][_0xfdea('0x11c')](db[_0xfdea('0x68')],{'as':_0xfdea('0x15b'),'foreignKey':'ChatWebsiteId'});db[_0xfdea('0x6c')][_0xfdea('0x11c')](db[_0xfdea('0x75')],{'as':_0xfdea('0x15c'),'foreignKey':_0xfdea('0x151')});db[_0xfdea('0x6c')][_0xfdea('0x11c')](db['User'],{'as':_0xfdea('0x15d'),'foreignKey':_0xfdea('0x112')});db[_0xfdea('0x6c')][_0xfdea('0x11d')](db[_0xfdea('0x95')],{'through':_0xfdea('0x185'),'as':_0xfdea('0x16e')});db['ChatInteraction'][_0xfdea('0x11d')](db['Tag'],{'through':_0xfdea('0x185'),'as':_0xfdea('0x15f')});db[_0xfdea('0x6c')][_0xfdea('0x11d')](db[_0xfdea('0x113')],{'as':'Users','through':_0xfdea('0x186'),'foreignKey':_0xfdea('0x184')});db[_0xfdea('0x6d')][_0xfdea('0x11c')](db[_0xfdea('0x113')],{'onDelete':_0xfdea('0x111'),'as':'User'});db[_0xfdea('0x6d')][_0xfdea('0x11c')](db['CmContact'],{'onDelete':'cascade','as':_0xfdea('0x15c'),'foreignKey':_0xfdea('0x151')});db[_0xfdea('0x6d')][_0xfdea('0x11c')](db[_0xfdea('0x6c')],{'onDelete':_0xfdea('0x111'),'as':_0xfdea('0x163'),'foreignKey':_0xfdea('0x184')});db[_0xfdea('0x6d')][_0xfdea('0x11c')](db[_0xfdea('0xf1')],{'as':_0xfdea('0xf1'),'foreignKey':_0xfdea('0x171')});db[_0xfdea('0x6d')][_0xfdea('0x11c')](db[_0xfdea('0x68')],{'as':_0xfdea('0x15b'),'foreignKey':_0xfdea('0x164')});db[_0xfdea('0x165')]['hasMany'](db[_0xfdea('0xf1')],{'as':_0xfdea('0x162'),'foreignKey':_0xfdea('0x166'),'onDelete':_0xfdea('0x111'),'hooks':!![]});db[_0xfdea('0x165')]['belongsTo'](db[_0xfdea('0x75')],{'onDelete':_0xfdea('0x111'),'as':'Contact','foreignKey':_0xfdea('0x151')});db[_0xfdea('0x165')][_0xfdea('0x11c')](db[_0xfdea('0x68')],{'as':_0xfdea('0x15b'),'foreignKey':_0xfdea('0x164')});db[_0xfdea('0x6f')][_0xfdea('0x11d')](db[_0xfdea('0x113')],{'as':_0xfdea('0x147'),'through':_0xfdea('0x31'),'hooks':!![]});db[_0xfdea('0x6f')][_0xfdea('0x11d')](db[_0xfdea('0xec')],{'through':_0xfdea('0x187'),'as':_0xfdea('0x172')});db[_0xfdea('0x11e')]['hasMany'](db[_0xfdea('0xd7')],{'as':_0xfdea('0x14c'),'foreignKey':_0xfdea('0x188'),'onDelete':_0xfdea('0x111')});db[_0xfdea('0x11e')][_0xfdea('0x11d')](db['User'],{'as':_0xfdea('0x189'),'through':_0xfdea('0x18a')});db[_0xfdea('0x71')][_0xfdea('0x11c')](db['ChatWebsite'],{'as':'Website','foreignKey':'ChatWebsiteId'});db['CmCompany'][_0xfdea('0x114')](db[_0xfdea('0x75')],{'as':_0xfdea('0x18b'),'foreignKey':_0xfdea('0x18c')});db[_0xfdea('0x75')][_0xfdea('0x114')](db['CmHopper'],{'as':_0xfdea('0x13c'),'foreignKey':'ContactId'});db[_0xfdea('0x75')]['hasMany'](db[_0xfdea('0x7a')],{'as':_0xfdea('0x13e'),'foreignKey':_0xfdea('0x151')});db[_0xfdea('0x75')][_0xfdea('0x114')](db[_0xfdea('0x7c')],{'as':_0xfdea('0x18d'),'foreignKey':'ContactId'});db[_0xfdea('0x75')][_0xfdea('0x114')](db[_0xfdea('0x7e')],{'as':_0xfdea('0x7e'),'foreignKey':_0xfdea('0x151')});db['CmContact'][_0xfdea('0x114')](db['JscriptySessionReport'],{'as':'JscriptySessions','foreignKey':'ContactId'});db[_0xfdea('0x75')]['hasMany'](db['OpenchannelInteraction'],{'as':_0xfdea('0x116'),'foreignKey':_0xfdea('0x151'),'onDelete':_0xfdea('0x167')});db[_0xfdea('0x75')][_0xfdea('0x114')](db['ChatInteraction'],{'as':_0xfdea('0x117'),'foreignKey':_0xfdea('0x151'),'onDelete':_0xfdea('0x167')});db['CmContact'][_0xfdea('0x114')](db[_0xfdea('0x5b')],{'as':_0xfdea('0x118'),'foreignKey':_0xfdea('0x151'),'onDelete':'restrict'});db[_0xfdea('0x75')][_0xfdea('0x114')](db[_0xfdea('0x52')],{'as':'FaxInteractions','foreignKey':_0xfdea('0x151'),'onDelete':_0xfdea('0x167')});db[_0xfdea('0x75')][_0xfdea('0x114')](db['MailInteraction'],{'as':_0xfdea('0x123'),'foreignKey':_0xfdea('0x151'),'onDelete':_0xfdea('0x167')});db[_0xfdea('0x75')][_0xfdea('0x11c')](db['CmCompany'],{'as':'Company','foreignKey':'CompanyId'});db[_0xfdea('0x75')][_0xfdea('0x11c')](db[_0xfdea('0x120')],{'as':_0xfdea('0x157'),'foreignKey':'ListId','onDelete':_0xfdea('0x111')});db[_0xfdea('0x75')][_0xfdea('0x11d')](db[_0xfdea('0x113')],{'as':_0xfdea('0x160'),'through':_0xfdea('0x11f')});db[_0xfdea('0x75')][_0xfdea('0x11d')](db[_0xfdea('0x95')],{'as':_0xfdea('0x16e'),'through':_0xfdea('0x18e')});db[_0xfdea('0x75')][_0xfdea('0x11d')](db[_0xfdea('0x95')],{'through':'cm_contact_has_tags','as':_0xfdea('0x15f')});db['CmHopper'][_0xfdea('0x11c')](db['CmContact'],{'as':_0xfdea('0x15c'),'foreignKey':_0xfdea('0x151'),'onDelete':_0xfdea('0x111')});db[_0xfdea('0x76')]['belongsTo'](db[_0xfdea('0x120')],{'as':'List','foreignKey':'ListId','onDelete':_0xfdea('0x111')});db[_0xfdea('0x76')]['belongsTo'](db[_0xfdea('0x113')],{'as':'Agent','foreignKey':_0xfdea('0x112')});db[_0xfdea('0x76')][_0xfdea('0x11c')](db['VoiceQueue'],{'as':_0xfdea('0x182'),'foreignKey':_0xfdea('0x13d'),'onDelete':'cascade'});db[_0xfdea('0x76')]['belongsTo'](db[_0xfdea('0xee')],{'as':_0xfdea('0xee'),'foreignKey':_0xfdea('0x18f'),'onDelete':'cascade'});db[_0xfdea('0x76')][_0xfdea('0x11c')](db['User'],{'as':'Owner','foreignKey':_0xfdea('0x190')});db[_0xfdea('0x78')][_0xfdea('0x11c')](db[_0xfdea('0x75')],{'as':_0xfdea('0x15c'),'foreignKey':'ContactId','onDelete':_0xfdea('0x111')});db[_0xfdea('0x78')][_0xfdea('0x11c')](db[_0xfdea('0x120')],{'as':_0xfdea('0x157'),'foreignKey':_0xfdea('0x158'),'onDelete':'cascade'});db[_0xfdea('0x78')][_0xfdea('0x11c')](db[_0xfdea('0x1c')],{'as':'Queue','foreignKey':_0xfdea('0x13d'),'onDelete':_0xfdea('0x111')});db[_0xfdea('0x78')][_0xfdea('0x11c')](db[_0xfdea('0xee')],{'as':_0xfdea('0xee'),'foreignKey':_0xfdea('0x18f'),'onDelete':_0xfdea('0x111')});db[_0xfdea('0x83')][_0xfdea('0x114')](db[_0xfdea('0x89')],{'as':{'plural':'All','singular':_0xfdea('0x191')},'foreignKey':_0xfdea('0x192'),'onDelete':_0xfdea('0x111'),'hooks':!![]});db[_0xfdea('0x83')]['hasMany'](db['Condition'],{'as':{'plural':_0xfdea('0x193'),'singular':_0xfdea('0x194')},'foreignKey':_0xfdea('0x195'),'onDelete':'cascade','hooks':!![]});db[_0xfdea('0x83')]['hasMany'](db['Action'],{'as':_0xfdea('0x196'),'foreignKey':'AutomationId','onDelete':_0xfdea('0x111'),'hooks':!![]});db['Disposition'][_0xfdea('0x114')](db[_0xfdea('0x87')],{'as':_0xfdea('0x16a'),'foreignKey':_0xfdea('0x197'),'onDelete':_0xfdea('0x111')});db[_0xfdea('0x8b')][_0xfdea('0x114')](db['Interval'],{'as':_0xfdea('0x198'),'foreignKey':_0xfdea('0x142'),'onDelete':'cascade','hooks':!![],'required':![]});db[_0xfdea('0x8b')][_0xfdea('0x114')](db[_0xfdea('0x19')],{'as':_0xfdea('0x199'),'foreignKey':_0xfdea('0x142'),'onDelete':_0xfdea('0x167')});db[_0xfdea('0x8b')][_0xfdea('0x114')](db[_0xfdea('0x47')],{'as':_0xfdea('0x19a'),'foreignKey':_0xfdea('0x142')});db[_0xfdea('0x8b')]['hasMany'](db[_0xfdea('0x6b')],{'as':_0xfdea('0x19b'),'foreignKey':'IntervalId'});db[_0xfdea('0x8b')]['hasMany'](db[_0xfdea('0x50')],{'as':_0xfdea('0x19c'),'foreignKey':'IntervalId'});db[_0xfdea('0x8b')][_0xfdea('0x114')](db[_0xfdea('0x5a')],{'as':_0xfdea('0x19d'),'foreignKey':'IntervalId'});db[_0xfdea('0x92')][_0xfdea('0x11c')](db[_0xfdea('0x3d')],{});db['Schedule']['belongsTo'](db[_0xfdea('0x19e')],{'foreignKey':_0xfdea('0x19f')});db[_0xfdea('0x92')]['belongsTo'](db[_0xfdea('0x9e')],{'foreignKey':_0xfdea('0x1a0')});db['Sound'][_0xfdea('0x11d')](db['VoiceMusicOnHold'],{'as':'Mohs','through':'moh_has_sounds','onDelete':'restrict'});db['Tag']['belongsToMany'](db[_0xfdea('0x75')],{'through':_0xfdea('0x18e')});db[_0xfdea('0x95')]['belongsToMany'](db['ChatInteraction'],{'through':_0xfdea('0x185')});db[_0xfdea('0x95')][_0xfdea('0x11d')](db['MailInteraction'],{'through':_0xfdea('0x15e')});db[_0xfdea('0x95')][_0xfdea('0x11d')](db['SmsInteraction'],{'through':_0xfdea('0x175')});db['Tag'][_0xfdea('0x11d')](db['FaxInteraction'],{'through':_0xfdea('0x16d')});db[_0xfdea('0x95')][_0xfdea('0x11d')](db['OpenchannelInteraction'],{'through':'openchannel_interaction_has_tags'});db[_0xfdea('0x95')][_0xfdea('0x11d')](db[_0xfdea('0x105')],{'through':_0xfdea('0x1a1')});db[_0xfdea('0x98')][_0xfdea('0x114')](db['Condition'],{'as':{'plural':_0xfdea('0x1a2'),'singular':'AllCondition'},'foreignKey':'TriggerAllId','onDelete':'cascade','hooks':!![]});db['Trigger'][_0xfdea('0x114')](db['Condition'],{'as':{'plural':_0xfdea('0x1a3'),'singular':_0xfdea('0x1a4')},'foreignKey':_0xfdea('0x1a5'),'onDelete':_0xfdea('0x111'),'hooks':!![]});db[_0xfdea('0x98')][_0xfdea('0x114')](db[_0xfdea('0x81')],{'as':_0xfdea('0x196'),'foreignKey':'TriggerId','onDelete':_0xfdea('0x111'),'hooks':!![]});db[_0xfdea('0x9e')][_0xfdea('0x114')](db[_0xfdea('0xa5')],{'as':_0xfdea('0x1a6'),'onDelete':_0xfdea('0x111'),'foreignKey':_0xfdea('0x1a0'),'hooks':!![]});db[_0xfdea('0x19e')][_0xfdea('0x114')](db[_0xfdea('0xa5')],{'as':_0xfdea('0x1a6'),'onDelete':_0xfdea('0x111'),'foreignKey':'DefaultReportId'});db[_0xfdea('0xa3')][_0xfdea('0x114')](db[_0xfdea('0xa5')],{'as':_0xfdea('0x1a6'),'onDelete':_0xfdea('0x111'),'foreignKey':_0xfdea('0x1a7')});db[_0xfdea('0xa5')][_0xfdea('0x11c')](db['AnalyticMetric'],{'foreignKey':_0xfdea('0x1a7')});db['SalesforceAccount']['hasMany'](db['SalesforceConfiguration'],{'as':_0xfdea('0x1a8'),'onDelete':_0xfdea('0x111'),'foreignKey':_0xfdea('0x1a9')});db[_0xfdea('0xa9')][_0xfdea('0x114')](db[_0xfdea('0xab')],{'as':_0xfdea('0x1aa'),'onDelete':'cascade','foreignKey':'SubjectId'});db['SalesforceConfiguration'][_0xfdea('0x114')](db[_0xfdea('0xab')],{'as':_0xfdea('0x1ab'),'onDelete':'cascade','foreignKey':'DescriptionId'});db[_0xfdea('0xa9')][_0xfdea('0x114')](db[_0xfdea('0xab')],{'as':'Fields','onDelete':_0xfdea('0x111'),'foreignKey':_0xfdea('0x1ac')});db[_0xfdea('0xa9')][_0xfdea('0x11c')](db[_0xfdea('0xa8')],{'as':'Account','foreignKey':_0xfdea('0x1a9')});db[_0xfdea('0xab')][_0xfdea('0x114')](db[_0xfdea('0xab')],{'as':'Subject','foreignKey':_0xfdea('0x1ad')});db['SalesforceField']['hasMany'](db[_0xfdea('0xab')],{'as':_0xfdea('0x1ae'),'foreignKey':_0xfdea('0x1af')});db[_0xfdea('0xab')][_0xfdea('0x114')](db[_0xfdea('0xab')],{'as':_0xfdea('0x1b0'),'foreignKey':_0xfdea('0x1ac')});db[_0xfdea('0xab')][_0xfdea('0x11c')](db[_0xfdea('0x1b1')],{'as':'Variable','foreignKey':_0xfdea('0x1b2')});db[_0xfdea('0xac')][_0xfdea('0x114')](db['SugarcrmConfiguration'],{'as':'Configurations','onDelete':_0xfdea('0x111'),'foreignKey':'AccountId'});db[_0xfdea('0xad')]['hasMany'](db[_0xfdea('0xaf')],{'as':_0xfdea('0x1aa'),'onDelete':_0xfdea('0x111'),'foreignKey':_0xfdea('0x1ad')});db[_0xfdea('0xad')][_0xfdea('0x114')](db[_0xfdea('0xaf')],{'as':'Descriptions','onDelete':'cascade','foreignKey':_0xfdea('0x1af')});db[_0xfdea('0xad')][_0xfdea('0x114')](db['SugarcrmField'],{'as':'Fields','onDelete':'cascade','foreignKey':_0xfdea('0x1ac')});db['SugarcrmConfiguration'][_0xfdea('0x11c')](db[_0xfdea('0xac')],{'as':_0xfdea('0x15b'),'foreignKey':_0xfdea('0x1a9')});db['SugarcrmField'][_0xfdea('0x114')](db[_0xfdea('0xaf')],{'as':_0xfdea('0x1b3'),'foreignKey':_0xfdea('0x1ad')});db[_0xfdea('0xaf')][_0xfdea('0x114')](db[_0xfdea('0xaf')],{'as':_0xfdea('0x1ae'),'foreignKey':_0xfdea('0x1af')});db['SugarcrmField'][_0xfdea('0x114')](db[_0xfdea('0xaf')],{'as':_0xfdea('0x1b0'),'foreignKey':_0xfdea('0x1ac')});db[_0xfdea('0xaf')]['belongsTo'](db[_0xfdea('0x1b1')],{'as':'Variable','foreignKey':_0xfdea('0x1b2')});db[_0xfdea('0xb1')][_0xfdea('0x114')](db[_0xfdea('0x1b4')],{'as':'Configurations','onDelete':_0xfdea('0x111'),'foreignKey':_0xfdea('0x1a9')});db[_0xfdea('0x1b4')][_0xfdea('0x114')](db[_0xfdea('0xb4')],{'as':_0xfdea('0x1aa'),'onDelete':_0xfdea('0x111'),'foreignKey':_0xfdea('0x1ad')});db[_0xfdea('0x1b4')][_0xfdea('0x114')](db[_0xfdea('0xb4')],{'as':'Descriptions','onDelete':'cascade','foreignKey':'DescriptionId'});db[_0xfdea('0x1b4')][_0xfdea('0x114')](db[_0xfdea('0xb4')],{'as':_0xfdea('0x1a6'),'onDelete':'cascade','foreignKey':_0xfdea('0x1ac')});db[_0xfdea('0x1b4')]['belongsTo'](db[_0xfdea('0xb1')],{'as':_0xfdea('0x15b'),'foreignKey':_0xfdea('0x1a9')});db[_0xfdea('0x1b4')][_0xfdea('0x11d')](db['Tag'],{'through':'int_desk_configuration_has_tags'});db['DeskField'][_0xfdea('0x114')](db[_0xfdea('0xb4')],{'as':_0xfdea('0x1b3'),'foreignKey':_0xfdea('0x1ad')});db[_0xfdea('0xb4')][_0xfdea('0x114')](db[_0xfdea('0xb4')],{'as':_0xfdea('0x1ae'),'foreignKey':'DescriptionId'});db[_0xfdea('0xb4')]['hasMany'](db[_0xfdea('0xb4')],{'as':'Field','foreignKey':_0xfdea('0x1ac')});db[_0xfdea('0xb4')][_0xfdea('0x11c')](db['Variable'],{'as':_0xfdea('0x1b1'),'foreignKey':_0xfdea('0x1b2')});db[_0xfdea('0xb6')][_0xfdea('0x114')](db[_0xfdea('0x1b5')],{'as':'Configurations','onDelete':_0xfdea('0x111'),'foreignKey':_0xfdea('0x1a9')});db[_0xfdea('0x1b5')][_0xfdea('0x114')](db[_0xfdea('0xb9')],{'as':_0xfdea('0x1aa'),'onDelete':_0xfdea('0x111'),'foreignKey':'SubjectId'});db['ZohoConfiguration'][_0xfdea('0x114')](db[_0xfdea('0xb9')],{'as':'Descriptions','onDelete':_0xfdea('0x111'),'foreignKey':_0xfdea('0x1af')});db['ZohoConfiguration'][_0xfdea('0x114')](db[_0xfdea('0xb9')],{'as':_0xfdea('0x1a6'),'onDelete':_0xfdea('0x111'),'foreignKey':_0xfdea('0x1ac')});db[_0xfdea('0x1b5')][_0xfdea('0x11c')](db[_0xfdea('0xb6')],{'as':'Account','foreignKey':_0xfdea('0x1a9')});db[_0xfdea('0xb9')][_0xfdea('0x114')](db[_0xfdea('0xb9')],{'as':_0xfdea('0x1b3'),'foreignKey':'SubjectId'});db[_0xfdea('0xb9')][_0xfdea('0x114')](db['ZohoField'],{'as':_0xfdea('0x1ae'),'foreignKey':_0xfdea('0x1af')});db[_0xfdea('0xb9')][_0xfdea('0x114')](db[_0xfdea('0xb9')],{'as':_0xfdea('0x1b0'),'foreignKey':_0xfdea('0x1ac')});db[_0xfdea('0xb9')][_0xfdea('0x11c')](db['Variable'],{'as':_0xfdea('0x1b1'),'foreignKey':_0xfdea('0x1b2')});db[_0xfdea('0x1b6')][_0xfdea('0x114')](db[_0xfdea('0xbc')],{'as':'Configurations','onDelete':_0xfdea('0x111'),'foreignKey':_0xfdea('0x1a9')});db[_0xfdea('0xbc')][_0xfdea('0x114')](db['ZendeskField'],{'as':'Subjects','foreignKey':_0xfdea('0x1ad')});db[_0xfdea('0xbc')]['hasMany'](db[_0xfdea('0xbe')],{'as':_0xfdea('0x1ab'),'foreignKey':_0xfdea('0x1af')});db[_0xfdea('0xbc')]['hasMany'](db['ZendeskField'],{'as':_0xfdea('0x1a6'),'foreignKey':_0xfdea('0x1ac')});db['ZendeskConfiguration'][_0xfdea('0x11c')](db['ZendeskAccount'],{'as':_0xfdea('0x15b'),'foreignKey':_0xfdea('0x1a9')});db[_0xfdea('0xbc')][_0xfdea('0x11d')](db['Tag'],{'through':'int_zendesk_configuration_has_tags'});db[_0xfdea('0xbe')][_0xfdea('0x114')](db['ZendeskField'],{'as':_0xfdea('0x1b3'),'foreignKey':_0xfdea('0x1ad')});db['ZendeskField']['hasMany'](db[_0xfdea('0xbe')],{'as':_0xfdea('0x1ae'),'foreignKey':_0xfdea('0x1af')});db['ZendeskField']['hasMany'](db[_0xfdea('0xbe')],{'as':'Field','foreignKey':_0xfdea('0x1ac')});db[_0xfdea('0xbe')][_0xfdea('0x11c')](db[_0xfdea('0x1b1')],{'as':_0xfdea('0x1b1'),'foreignKey':_0xfdea('0x1b2')});db[_0xfdea('0xc0')][_0xfdea('0x114')](db[_0xfdea('0xc2')],{'as':_0xfdea('0x1a8'),'onDelete':'cascade','foreignKey':'AccountId'});db['FreshdeskConfiguration']['hasMany'](db[_0xfdea('0xc4')],{'as':_0xfdea('0x1aa'),'onDelete':_0xfdea('0x111'),'foreignKey':_0xfdea('0x1ad')});db['FreshdeskConfiguration']['hasMany'](db[_0xfdea('0xc4')],{'as':'Descriptions','onDelete':_0xfdea('0x111'),'foreignKey':_0xfdea('0x1af')});db['FreshdeskConfiguration'][_0xfdea('0x114')](db['FreshdeskField'],{'as':_0xfdea('0x1a6'),'onDelete':'cascade','foreignKey':_0xfdea('0x1ac')});db[_0xfdea('0xc2')]['belongsTo'](db[_0xfdea('0xc0')],{'as':_0xfdea('0x15b'),'foreignKey':'AccountId'});db[_0xfdea('0xc2')]['belongsToMany'](db['Tag'],{'through':'int_freshdesk_configuration_has_tags'});db[_0xfdea('0xc4')]['hasMany'](db[_0xfdea('0xc4')],{'as':_0xfdea('0x1b3'),'foreignKey':_0xfdea('0x1ad')});db['FreshdeskField'][_0xfdea('0x114')](db['FreshdeskField'],{'as':_0xfdea('0x1ae'),'foreignKey':_0xfdea('0x1af')});db[_0xfdea('0xc4')][_0xfdea('0x114')](db[_0xfdea('0xc4')],{'as':'Field','foreignKey':_0xfdea('0x1ac')});db[_0xfdea('0xc4')][_0xfdea('0x11c')](db[_0xfdea('0x1b1')],{'as':_0xfdea('0x1b1'),'foreignKey':_0xfdea('0x1b2')});db[_0xfdea('0x1b7')][_0xfdea('0x114')](db['VtigerConfiguration'],{'as':_0xfdea('0x1a8'),'onDelete':_0xfdea('0x111'),'foreignKey':_0xfdea('0x1a9')});db[_0xfdea('0xc7')][_0xfdea('0x114')](db[_0xfdea('0xc9')],{'as':'Subjects','foreignKey':_0xfdea('0x1ad')});db['VtigerConfiguration'][_0xfdea('0x114')](db[_0xfdea('0xc9')],{'as':_0xfdea('0x1ab'),'foreignKey':'DescriptionId'});db[_0xfdea('0xc7')][_0xfdea('0x114')](db[_0xfdea('0xc9')],{'as':'Fields','foreignKey':_0xfdea('0x1ac')});db[_0xfdea('0xc7')][_0xfdea('0x11c')](db[_0xfdea('0x1b7')],{'as':_0xfdea('0x15b'),'foreignKey':'AccountId'});db[_0xfdea('0xc9')][_0xfdea('0x114')](db[_0xfdea('0xc9')],{'as':_0xfdea('0x1b3'),'foreignKey':'SubjectId'});db[_0xfdea('0xc9')][_0xfdea('0x114')](db[_0xfdea('0xc9')],{'as':'Description','foreignKey':'DescriptionId'});db['VtigerField'][_0xfdea('0x114')](db[_0xfdea('0xc9')],{'as':_0xfdea('0x1b0'),'foreignKey':_0xfdea('0x1ac')});db[_0xfdea('0xc9')]['belongsTo'](db[_0xfdea('0x1b1')],{'as':'Variable','foreignKey':_0xfdea('0x1b2')});db[_0xfdea('0x1b8')]['hasMany'](db[_0xfdea('0xcb')],{'as':_0xfdea('0x1a8'),'onDelete':'cascade','foreignKey':_0xfdea('0x1a9')});db[_0xfdea('0xcb')]['hasMany'](db[_0xfdea('0x1b9')],{'as':_0xfdea('0x1aa'),'foreignKey':_0xfdea('0x1ad')});db[_0xfdea('0xcb')][_0xfdea('0x114')](db[_0xfdea('0x1b9')],{'as':'Descriptions','foreignKey':_0xfdea('0x1af')});db[_0xfdea('0xcb')][_0xfdea('0x114')](db[_0xfdea('0x1b9')],{'as':'Fields','foreignKey':'FieldId'});db[_0xfdea('0xcb')][_0xfdea('0x11c')](db[_0xfdea('0x1b8')],{'as':'Account','foreignKey':_0xfdea('0x1a9')});db[_0xfdea('0x1b9')]['hasMany'](db[_0xfdea('0x1b9')],{'as':'Subject','foreignKey':_0xfdea('0x1ad')});db[_0xfdea('0x1b9')][_0xfdea('0x114')](db[_0xfdea('0x1b9')],{'as':_0xfdea('0x1ae'),'foreignKey':'DescriptionId'});db['ServicenowField'][_0xfdea('0x114')](db['ServicenowField'],{'as':_0xfdea('0x1b0'),'foreignKey':_0xfdea('0x1ac')});db['ServicenowField'][_0xfdea('0x11c')](db[_0xfdea('0x1b1')],{'as':'Variable','foreignKey':_0xfdea('0x1b2')});db[_0xfdea('0xce')][_0xfdea('0x114')](db[_0xfdea('0xd0')],{'as':_0xfdea('0x1a8'),'onDelete':_0xfdea('0x111'),'foreignKey':_0xfdea('0x1a9')});db[_0xfdea('0xd0')]['hasMany'](db[_0xfdea('0x1ba')],{'as':_0xfdea('0x1aa'),'onDelete':_0xfdea('0x111'),'foreignKey':_0xfdea('0x1ad')});db['Dynamics365Configuration']['hasMany'](db[_0xfdea('0x1ba')],{'as':'Descriptions','onDelete':_0xfdea('0x111'),'foreignKey':'DescriptionId'});db[_0xfdea('0xd0')][_0xfdea('0x114')](db[_0xfdea('0x1ba')],{'as':_0xfdea('0x1a6'),'onDelete':_0xfdea('0x111'),'foreignKey':'FieldId'});db[_0xfdea('0xd0')][_0xfdea('0x11c')](db[_0xfdea('0xce')],{'as':_0xfdea('0x15b'),'foreignKey':_0xfdea('0x1a9')});db[_0xfdea('0x1ba')][_0xfdea('0x114')](db['Dynamics365Field'],{'as':_0xfdea('0x1b3'),'foreignKey':_0xfdea('0x1ad')});db[_0xfdea('0x1ba')][_0xfdea('0x114')](db[_0xfdea('0x1ba')],{'as':'Description','foreignKey':_0xfdea('0x1af')});db[_0xfdea('0x1ba')][_0xfdea('0x114')](db['Dynamics365Field'],{'as':_0xfdea('0x1b0'),'foreignKey':_0xfdea('0x1ac')});db['Dynamics365Field'][_0xfdea('0x11c')](db[_0xfdea('0x1b1')],{'as':'Variable','foreignKey':_0xfdea('0x1b2')});db[_0xfdea('0x1bb')]['hasMany'](db[_0xfdea('0xd3')],{'as':'Configurations','onDelete':_0xfdea('0x111'),'foreignKey':_0xfdea('0x1a9')});db[_0xfdea('0xd3')][_0xfdea('0x114')](db[_0xfdea('0x1bc')],{'as':_0xfdea('0x1aa'),'foreignKey':'SubjectId'});db[_0xfdea('0xd3')][_0xfdea('0x114')](db['FreshsalesField'],{'as':'Descriptions','foreignKey':_0xfdea('0x1af')});db['FreshsalesConfiguration'][_0xfdea('0x114')](db[_0xfdea('0x1bc')],{'as':'Fields','foreignKey':_0xfdea('0x1ac')});db[_0xfdea('0xd3')][_0xfdea('0x11c')](db[_0xfdea('0x1bb')],{'as':_0xfdea('0x15b'),'foreignKey':_0xfdea('0x1a9')});db[_0xfdea('0x1bc')][_0xfdea('0x114')](db[_0xfdea('0x1bc')],{'as':_0xfdea('0x1b3'),'foreignKey':'SubjectId'});db[_0xfdea('0x1bc')][_0xfdea('0x114')](db[_0xfdea('0x1bc')],{'as':_0xfdea('0x1ae'),'foreignKey':_0xfdea('0x1af')});db[_0xfdea('0x1bc')][_0xfdea('0x114')](db[_0xfdea('0x1bc')],{'as':_0xfdea('0x1b0'),'foreignKey':_0xfdea('0x1ac')});db[_0xfdea('0x1bc')][_0xfdea('0x11c')](db[_0xfdea('0x1b1')],{'as':_0xfdea('0x1b1'),'foreignKey':'VariableId'});db[_0xfdea('0xd6')][_0xfdea('0x11c')](db['ChatWebsite'],{});db[_0xfdea('0xd6')][_0xfdea('0x11c')](db[_0xfdea('0x120')],{'as':_0xfdea('0x157'),'foreignKey':_0xfdea('0x158')});db['ChatQueueReport'][_0xfdea('0x11c')](db[_0xfdea('0x75')],{'as':_0xfdea('0x15c'),'foreignKey':'ContactId'});db[_0xfdea('0xd6')][_0xfdea('0x11c')](db['ChatInteraction'],{});db['ChatQueueReport']['belongsTo'](db['ChatMessage'],{});db[_0xfdea('0xd6')][_0xfdea('0x11c')](db['User'],{});db[_0xfdea('0xd6')][_0xfdea('0x11c')](db[_0xfdea('0x6f')],{});db[_0xfdea('0xd7')][_0xfdea('0x11c')](db['User'],{'onDelete':_0xfdea('0x111'),'foreignKey':_0xfdea('0x1bd')});db[_0xfdea('0xd7')][_0xfdea('0x11c')](db['User'],{'onDelete':_0xfdea('0x111'),'foreignKey':_0xfdea('0x1be')});db[_0xfdea('0xdc')]['hasMany'](db[_0xfdea('0xda')],{'foreignKey':_0xfdea('0x1bf'),'onDelete':_0xfdea('0x111')});db['JscriptySessionReport'][_0xfdea('0x114')](db[_0xfdea('0x1c0')],{'foreignKey':_0xfdea('0x1bf'),'onDelete':_0xfdea('0x111')});db['SmsQueueReport'][_0xfdea('0x11c')](db[_0xfdea('0x133')],{});db['SmsQueueReport']['belongsTo'](db[_0xfdea('0x120')],{'as':_0xfdea('0x157'),'foreignKey':'ListId'});db[_0xfdea('0xdd')][_0xfdea('0x11c')](db['CmContact'],{'as':_0xfdea('0x15c'),'foreignKey':_0xfdea('0x151')});db[_0xfdea('0xdd')]['belongsTo'](db['SmsInteraction'],{});db['SmsQueueReport']['belongsTo'](db['SmsMessage'],{});db[_0xfdea('0xdd')][_0xfdea('0x11c')](db[_0xfdea('0x113')],{});db['SmsQueueReport'][_0xfdea('0x11c')](db[_0xfdea('0x5e')],{});db[_0xfdea('0xe2')]['hasMany'](db[_0xfdea('0xdc')],{'foreignKey':_0xfdea('0x1c1')});db['JscriptyProject'][_0xfdea('0x114')](db[_0xfdea('0xda')],{'foreignKey':_0xfdea('0x1c1')});db[_0xfdea('0xe2')][_0xfdea('0x114')](db[_0xfdea('0x1c0')],{'foreignKey':_0xfdea('0x1c1')});db[_0xfdea('0xe7')][_0xfdea('0x11d')](db['User'],{'as':_0xfdea('0x160'),'through':_0xfdea('0x138')});db[_0xfdea('0xec')][_0xfdea('0x11d')](db[_0xfdea('0x113')],{'as':'Agents','through':_0xfdea('0x122')});db[_0xfdea('0xec')][_0xfdea('0x11d')](db[_0xfdea('0x1c')],{'through':'TeamVoiceQueue','as':_0xfdea('0x1c2')});db[_0xfdea('0xec')][_0xfdea('0x11d')](db[_0xfdea('0x3f')],{'through':_0xfdea('0x1c3'),'as':_0xfdea('0x127')});db[_0xfdea('0xec')][_0xfdea('0x11d')](db[_0xfdea('0x6f')],{'through':_0xfdea('0x187'),'as':_0xfdea('0x1c4')});db[_0xfdea('0xec')]['belongsToMany'](db[_0xfdea('0x55')],{'through':_0xfdea('0x1c5'),'as':_0xfdea('0x128')});db[_0xfdea('0xec')]['belongsToMany'](db[_0xfdea('0x5e')],{'through':_0xfdea('0x177'),'as':_0xfdea('0x129')});db[_0xfdea('0xec')][_0xfdea('0x11d')](db[_0xfdea('0x17d')],{'through':'team_has_openchannel_queues','as':'OpenchannelQueues'});db['Team']['belongsToMany'](db[_0xfdea('0x10a')],{'through':_0xfdea('0x1c6'),'as':'WhatsappQueues'});db[_0xfdea('0xec')]['belongsToMany'](db[_0xfdea('0xfb')],{'through':_0xfdea('0x10e'),'as':_0xfdea('0x125')});db['Campaign']['hasMany'](db[_0xfdea('0x76')],{'as':_0xfdea('0x13c'),'foreignKey':_0xfdea('0x18f')});db[_0xfdea('0xee')]['hasMany'](db[_0xfdea('0x7a')],{'as':_0xfdea('0x13e'),'foreignKey':_0xfdea('0x18f')});db['Campaign'][_0xfdea('0x114')](db['CmHopperHistory'],{'as':'HopperHistories','foreignKey':_0xfdea('0x18f')});db[_0xfdea('0xee')][_0xfdea('0x114')](db[_0xfdea('0x78')],{'as':_0xfdea('0x13f'),'foreignKey':'CampaignId'});db[_0xfdea('0xee')][_0xfdea('0x11c')](db[_0xfdea('0x2d')],{'as':_0xfdea('0x2d'),'foreignKey':_0xfdea('0x1c7')});db['Campaign'][_0xfdea('0x11c')](db['Trunk'],{'as':_0xfdea('0x141'),'foreignKey':_0xfdea('0x1c8')});db[_0xfdea('0xee')][_0xfdea('0x11c')](db[_0xfdea('0x8b')],{'as':'Interval','foreignKey':_0xfdea('0x142')});db[_0xfdea('0xee')][_0xfdea('0x11c')](db[_0xfdea('0xe7')],{'as':_0xfdea('0xe7'),'foreignKey':'SquareProjectId'});db[_0xfdea('0xee')]['belongsToMany'](db[_0xfdea('0x120')],{'as':_0xfdea('0x1c9'),'through':_0xfdea('0x1ca')});db[_0xfdea('0xee')][_0xfdea('0x11d')](db[_0xfdea('0x120')],{'as':_0xfdea('0x14a'),'through':_0xfdea('0x1cb')});db['Attachment']['belongsTo'](db['ChatOfflineMessage'],{'as':_0xfdea('0x165'),'foreignKey':_0xfdea('0x166')});db[_0xfdea('0xf5')][_0xfdea('0x11c')](db[_0xfdea('0x45')],{});db[_0xfdea('0xf5')]['belongsTo'](db[_0xfdea('0x43')],{});db['MailTransferReport'][_0xfdea('0x11c')](db[_0xfdea('0x3d')],{'foreignKey':_0xfdea('0x1cc'),'as':_0xfdea('0x1cd')});db[_0xfdea('0xf5')]['belongsTo'](db['User'],{'foreignKey':_0xfdea('0x1ce'),'as':_0xfdea('0x1cf')});db[_0xfdea('0xf5')][_0xfdea('0x11c')](db[_0xfdea('0x113')],{'foreignKey':_0xfdea('0x1d0'),'as':_0xfdea('0x1d1')});db['MailTransferReport'][_0xfdea('0x11c')](db[_0xfdea('0x3f')],{'foreignKey':_0xfdea('0x1d2'),'as':_0xfdea('0x1d3')});db[_0xfdea('0xf5')]['belongsTo'](db['MailAccount'],{'foreignKey':_0xfdea('0x1d4'),'as':_0xfdea('0x1d5')});db['ChatTransferReport']['belongsTo'](db[_0xfdea('0x6d')],{});db[_0xfdea('0xf6')]['belongsTo'](db['ChatInteraction'],{});db[_0xfdea('0xf6')]['belongsTo'](db[_0xfdea('0x68')],{'foreignKey':_0xfdea('0x1d6'),'as':_0xfdea('0x1cd')});db[_0xfdea('0xf6')]['belongsTo'](db[_0xfdea('0x113')],{'foreignKey':_0xfdea('0x1ce'),'as':_0xfdea('0x1cf')});db['ChatTransferReport'][_0xfdea('0x11c')](db[_0xfdea('0x113')],{'foreignKey':_0xfdea('0x1d0'),'as':_0xfdea('0x1d1')});db[_0xfdea('0xf6')][_0xfdea('0x11c')](db['ChatQueue'],{'foreignKey':_0xfdea('0x1d7'),'as':_0xfdea('0x1d3')});db[_0xfdea('0xf6')]['belongsTo'](db[_0xfdea('0x68')],{'foreignKey':_0xfdea('0x1d8'),'as':'ToAccount'});db['FaxTransferReport'][_0xfdea('0x11c')](db['FaxMessage'],{});db[_0xfdea('0x1d9')][_0xfdea('0x11c')](db['FaxInteraction'],{});db[_0xfdea('0x1d9')]['belongsTo'](db[_0xfdea('0x4e')],{'foreignKey':_0xfdea('0x1da'),'as':_0xfdea('0x1cd')});db[_0xfdea('0x1d9')][_0xfdea('0x11c')](db['User'],{'foreignKey':_0xfdea('0x1ce'),'as':_0xfdea('0x1cf')});db[_0xfdea('0x1d9')][_0xfdea('0x11c')](db[_0xfdea('0x113')],{'foreignKey':'ToUserId','as':_0xfdea('0x1d1')});db[_0xfdea('0x1d9')][_0xfdea('0x11c')](db['FaxQueue'],{'foreignKey':'ToFaxQueueId','as':'ToQueue'});db[_0xfdea('0x1d9')][_0xfdea('0x11c')](db[_0xfdea('0x4e')],{'foreignKey':'ToFaxAccountId','as':_0xfdea('0x1d5')});db[_0xfdea('0xf8')][_0xfdea('0x11c')](db[_0xfdea('0x65')],{});db[_0xfdea('0xf8')]['belongsTo'](db[_0xfdea('0x63')],{});db[_0xfdea('0xf8')][_0xfdea('0x11c')](db[_0xfdea('0x60')],{'foreignKey':_0xfdea('0x1db'),'as':_0xfdea('0x1cd')});db[_0xfdea('0xf8')][_0xfdea('0x11c')](db[_0xfdea('0x113')],{'foreignKey':_0xfdea('0x1ce'),'as':_0xfdea('0x1cf')});db[_0xfdea('0xf8')][_0xfdea('0x11c')](db[_0xfdea('0x113')],{'foreignKey':_0xfdea('0x1d0'),'as':'ToAgent'});db[_0xfdea('0xf8')][_0xfdea('0x11c')](db[_0xfdea('0x17d')],{'foreignKey':_0xfdea('0x1dc'),'as':_0xfdea('0x1d3')});db[_0xfdea('0xf8')]['belongsTo'](db['OpenchannelAccount'],{'foreignKey':'ToOpenchannelAccountId','as':_0xfdea('0x1d5')});db['SmsTransferReport']['belongsTo'](db['SmsMessage'],{});db[_0xfdea('0xfa')]['belongsTo'](db[_0xfdea('0x5b')],{});db[_0xfdea('0xfa')][_0xfdea('0x11c')](db[_0xfdea('0x133')],{'foreignKey':_0xfdea('0x1dd'),'as':_0xfdea('0x1cd')});db[_0xfdea('0xfa')]['belongsTo'](db[_0xfdea('0x113')],{'foreignKey':'FromUserId','as':'FromAgent'});db[_0xfdea('0xfa')][_0xfdea('0x11c')](db['User'],{'foreignKey':'ToUserId','as':_0xfdea('0x1d1')});db['SmsTransferReport'][_0xfdea('0x11c')](db['SmsQueue'],{'foreignKey':_0xfdea('0x1de'),'as':_0xfdea('0x1d3')});db[_0xfdea('0xfa')][_0xfdea('0x11c')](db['SmsAccount'],{'foreignKey':_0xfdea('0x1df'),'as':_0xfdea('0x1d5')});db['CmList'][_0xfdea('0x114')](db[_0xfdea('0x87')],{'as':'Dispositions','foreignKey':_0xfdea('0x158'),'onDelete':_0xfdea('0x111')});db['CmList']['hasMany'](db[_0xfdea('0x80')],{'as':_0xfdea('0x1e0'),'foreignKey':_0xfdea('0x158')});db['CmList'][_0xfdea('0x114')](db[_0xfdea('0x75')],{'as':'Contacts','onDelete':_0xfdea('0x111'),'foreignKey':_0xfdea('0x158')});db[_0xfdea('0x120')]['hasMany'](db[_0xfdea('0x7a')],{'as':_0xfdea('0x13e'),'foreignKey':_0xfdea('0x158')});db[_0xfdea('0x120')][_0xfdea('0x114')](db['CmHopperHistory'],{'as':_0xfdea('0x1e1'),'foreignKey':_0xfdea('0x158')});db[_0xfdea('0x120')][_0xfdea('0x114')](db[_0xfdea('0x7e')],{'as':'ReportAgentPreview','foreignKey':'ListId'});db[_0xfdea('0x120')][_0xfdea('0x11d')](db['VoiceQueue'],{'as':_0xfdea('0x1e2'),'through':'voice_queues_has_cm_lists'});db[_0xfdea('0x120')][_0xfdea('0x11d')](db[_0xfdea('0x113')],{'as':_0xfdea('0x147'),'through':_0xfdea('0x121')});db[_0xfdea('0xfb')]['hasMany'](db[_0xfdea('0x19')],{'as':_0xfdea('0x199'),'onDelete':'cascade'});db[_0xfdea('0xfb')][_0xfdea('0x11d')](db[_0xfdea('0x113')],{'as':'Agents','through':'UserVoicePrefix'});db[_0xfdea('0xfb')][_0xfdea('0x11d')](db[_0xfdea('0xec')],{'through':_0xfdea('0x10e'),'as':_0xfdea('0x172')});db[_0xfdea('0xfc')][_0xfdea('0x114')](db[_0xfdea('0x113')],{'as':_0xfdea('0x160'),'foreignKey':_0xfdea('0x1e3')});db[_0xfdea('0xfc')]['hasMany'](db[_0xfdea('0xfe')],{'as':_0xfdea('0x1e4'),'foreignKey':_0xfdea('0x1e3'),'onDelete':_0xfdea('0x111')});db[_0xfdea('0xfe')][_0xfdea('0x114')](db[_0xfdea('0xff')],{'as':_0xfdea('0x1e5'),'foreignKey':_0xfdea('0x1e6'),'onDelete':_0xfdea('0x111')});db[_0xfdea('0x103')][_0xfdea('0x114')](db[_0xfdea('0x87')],{'as':_0xfdea('0x16a'),'foreignKey':_0xfdea('0x1e7'),'onDelete':_0xfdea('0x111')});db[_0xfdea('0x103')][_0xfdea('0x114')](db[_0xfdea('0x85')],{'as':_0xfdea('0x156'),'foreignKey':_0xfdea('0x1e7')});db[_0xfdea('0x103')][_0xfdea('0x114')](db[_0xfdea('0x106')],{'as':_0xfdea('0x14c'),'foreignKey':_0xfdea('0x1e7')});db[_0xfdea('0x103')][_0xfdea('0x114')](db[_0xfdea('0x105')],{'as':_0xfdea('0x16c')});db[_0xfdea('0x103')][_0xfdea('0x114')](db['WhatsappApplication'],{'as':_0xfdea('0x13a')});db['WhatsappAccount'][_0xfdea('0x11c')](db[_0xfdea('0x120')],{'as':_0xfdea('0x157'),'foreignKey':'ListId'});db[_0xfdea('0x103')][_0xfdea('0x11c')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0xfdea('0x145')});db[_0xfdea('0x103')][_0xfdea('0x11d')](db[_0xfdea('0x113')],{'as':_0xfdea('0x147'),'through':_0xfdea('0x136')});db[_0xfdea('0x1e8')][_0xfdea('0x11c')](db[_0xfdea('0x113')],{'onDelete':_0xfdea('0x167')});db[_0xfdea('0x1e8')][_0xfdea('0x11c')](db[_0xfdea('0x10a')],{'onDelete':_0xfdea('0x167')});db['WhatsappApplication'][_0xfdea('0x11c')](db['WhatsappAccount'],{'onDelete':_0xfdea('0x167')});db['WhatsappApplication']['belongsTo'](db[_0xfdea('0x8b')],{'onDelete':_0xfdea('0x167'),'foreignKey':'IntervalId'});db[_0xfdea('0x1e8')][_0xfdea('0x11c')](db[_0xfdea('0x95')],{'onDelete':'restrict','foreignKey':_0xfdea('0x168')});db[_0xfdea('0x105')][_0xfdea('0x114')](db[_0xfdea('0x106')],{'as':'Messages','onDelete':_0xfdea('0x111'),'foreignKey':_0xfdea('0x1e9')});db[_0xfdea('0x105')][_0xfdea('0x11c')](db[_0xfdea('0x103')],{'as':_0xfdea('0x15b'),'foreignKey':_0xfdea('0x1e7')});db[_0xfdea('0x105')][_0xfdea('0x11c')](db['CmContact'],{'as':_0xfdea('0x15c'),'foreignKey':_0xfdea('0x151')});db[_0xfdea('0x105')][_0xfdea('0x11c')](db[_0xfdea('0x113')],{'as':_0xfdea('0x15d'),'foreignKey':'UserId'});db[_0xfdea('0x105')][_0xfdea('0x11d')](db[_0xfdea('0x95')],{'through':_0xfdea('0x1a1'),'as':_0xfdea('0x16e')});db['WhatsappInteraction'][_0xfdea('0x11d')](db[_0xfdea('0x95')],{'through':'whatsapp_interaction_has_tags','as':'ThroughTags'});db['WhatsappInteraction'][_0xfdea('0x11d')](db[_0xfdea('0x113')],{'as':'Users','through':_0xfdea('0x1ea'),'foreignKey':'WhatsappInteractionId'});db[_0xfdea('0x106')][_0xfdea('0x11c')](db[_0xfdea('0x113')],{'as':'User'});db[_0xfdea('0x106')][_0xfdea('0x11c')](db[_0xfdea('0x75')],{'onDelete':_0xfdea('0x111'),'as':_0xfdea('0x15c')});db[_0xfdea('0x106')][_0xfdea('0x11c')](db[_0xfdea('0x105')],{'onDelete':_0xfdea('0x111'),'as':_0xfdea('0x163'),'foreignKey':_0xfdea('0x1e9')});db[_0xfdea('0x106')][_0xfdea('0x11c')](db['WhatsappAccount'],{'as':_0xfdea('0x15b'),'foreignKey':_0xfdea('0x1e7')});db['WhatsappQueueReport'][_0xfdea('0x11c')](db['WhatsappAccount'],{});db[_0xfdea('0x107')]['belongsTo'](db[_0xfdea('0x120')],{'as':'List','foreignKey':_0xfdea('0x158')});db['WhatsappQueueReport'][_0xfdea('0x11c')](db[_0xfdea('0x75')],{'as':_0xfdea('0x15c'),'foreignKey':'ContactId'});db[_0xfdea('0x107')][_0xfdea('0x11c')](db[_0xfdea('0x105')],{});db['WhatsappQueueReport'][_0xfdea('0x11c')](db[_0xfdea('0x10a')],{});db[_0xfdea('0x107')][_0xfdea('0x11c')](db[_0xfdea('0x106')],{});db[_0xfdea('0x107')][_0xfdea('0x11c')](db['User'],{});db[_0xfdea('0x108')][_0xfdea('0x11c')](db['WhatsappMessage'],{});db[_0xfdea('0x108')][_0xfdea('0x11c')](db[_0xfdea('0x105')],{});db[_0xfdea('0x108')][_0xfdea('0x11c')](db[_0xfdea('0x103')],{'foreignKey':_0xfdea('0x1eb'),'as':_0xfdea('0x1cd')});db[_0xfdea('0x108')][_0xfdea('0x11c')](db[_0xfdea('0x103')],{'foreignKey':'ToWhatsappAccountId','as':_0xfdea('0x1d5')});db[_0xfdea('0x108')][_0xfdea('0x11c')](db['WhatsappQueue'],{'foreignKey':'ToQueueId','as':_0xfdea('0x1d3')});db[_0xfdea('0x108')]['belongsTo'](db[_0xfdea('0x113')],{'foreignKey':_0xfdea('0x1ce'),'as':_0xfdea('0x1cf')});db[_0xfdea('0x108')][_0xfdea('0x11c')](db[_0xfdea('0x113')],{'foreignKey':_0xfdea('0x1d0'),'as':'ToAgent'});db[_0xfdea('0x10a')][_0xfdea('0x11d')](db[_0xfdea('0x113')],{'as':_0xfdea('0x147'),'through':'UserWhatsappQueue','foreignKey':'WhatsappQueueId'});db['WhatsappQueue'][_0xfdea('0x11d')](db['Team'],{'through':_0xfdea('0x1c6'),'as':'Teams'});module[_0xfdea('0x1ec')]={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index 6fc830b..f669224 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x64f2=['./api/mailQueue','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','./api/mailMessage','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','./api/dashboard','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','./api/faxApplication','/api/fax/interactions','/api/fax/messages','./api/faxMessage','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','./api/smsMessage','./api/smsQueue','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','/api/chat/groups','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/contacts','/api/cm/hopper','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','./api/cmCustomField','/api/actions','./api/action','/api/automations','./api/automation','/api/canned_answers','./api/cannedAnswer','./api/disposition','/api/conditions','./api/condition','/api/pauses','/api/cdr','./api/cdr','/api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','./api/sound','./api/tag','/api/templates','./api/template','/api/triggers','./api/trigger','/api/variables','/api/integrations','./api/integration','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','./api/intSalesforceField','/api/integrations/sugarcrm/configurations','./api/intSugarcrmField','/api/integrations/desk/accounts','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/fields','./api/intZohoField','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskField','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/accounts','/api/integrations/servicenow/configurations','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','/api/integrations/freshsales/accounts','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','./api/intFreshsalesField','./api/network','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','./api/smsQueueReport','/api/square/reports','./api/squareReport','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','/api/settings','./api/setting','/api/square/odbc','./api/squareOdbc','/api/square/projects','./api/squareProject','./api/squareRecording','/api/square/messages','/api/teams','./api/team','/api/license','/api/campaigns','/api/migrations','./api/migration','/api/plugins','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','./api/cmList','./api/voicePrefix','/api/userProfiles','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','./api/userNotification','./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappInteraction','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','./api/whatsappTransferReport','/api/whatsapp/queues','./api/whatsappQueue','./api/cloudProvider','/api/realtime','./api/realtime','/api/auth/local','./api/authLocal','/api/auth/google','./api/authGoogle','/api/rpc','./api/rpc','/api/version','/api/system','./api/pm2','/api/webbar','./api/webbar','/apidoc','static','join','root','/www','/demo','/snippet','3.0.0','/server/files/plugins','/:url(api|auth|components|app|bower_components|assets)/*','get','route','sendFile','resolve','/index.html','password','newPassword','apiKey','firstName','street','phone','mobile','fax','email','clientId','clientSecret','securityToken','code','accessKey','tenantId','authToken','consumerKey','calleridname','calleridnum','exten','vidaooApiKey','clientEmail','privateKey','accesskeyid','key','accountSid','localstationid','dsn','registry','oldPassword','isPlainObject','isArray','length','replace','includes','lodash','express','util','./config/logger','api','auth','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','isEmpty','body','\x20body=%s','format','method','x-forwarded-for','headers','connection','remoteAddress','url','statusCode','responseTime','user','role','inspect','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','device','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','agent_name','test','/api/users','./api/user','./api/voiceChanSpy','/api/voice/contexts','/api/voice/extensions','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/trunks','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','./api/mailAccount'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x64f2,0x105));var _0x264f=function(_0x360fc0,_0x131d38){_0x360fc0=_0x360fc0-0x0;var _0x23e8a1=_0x64f2[_0x360fc0];return _0x23e8a1;};'use strict';var _=require(_0x264f('0x0'));var path=require('path');var express=require(_0x264f('0x1'));var ewinston=require('express-winston');var util=require(_0x264f('0x2'));var errors=require('./errors');var config=require('./config/environment');var logger=require(_0x264f('0x3'))(_0x264f('0x4'));var authLogger=require(_0x264f('0x3'))(_0x264f('0x5'));exports['default']=function(_0x26ad9b){_0x26ad9b[_0x264f('0x6')](ewinston[_0x264f('0x7')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x510f9d,_0x323d6e){var _0x399e9b=_0x264f('0x8');if(!_[_0x264f('0x9')](_0x510f9d[_0x264f('0xa')])){_0x399e9b+=_0x264f('0xb');var _0x363fef=_0x510f9d['body'];maskSensitiveData(_0x363fef);}return util[_0x264f('0xc')](_0x399e9b,_0x510f9d[_0x264f('0xd')],_0x510f9d['headers'][_0x264f('0xe')]?_0x510f9d[_0x264f('0xf')][_0x264f('0xe')]:_0x510f9d[_0x264f('0x10')][_0x264f('0x11')]||_0x510f9d['ip'],_0x510f9d[_0x264f('0x12')],_0x323d6e[_0x264f('0x13')],_0x323d6e[_0x264f('0x14')],_0x510f9d[_0x264f('0x15')]?_0x510f9d[_0x264f('0x15')]['id']:null,_0x510f9d[_0x264f('0x15')]?_0x510f9d[_0x264f('0x15')]['name']:null,_0x510f9d[_0x264f('0x15')]?_0x510f9d[_0x264f('0x15')][_0x264f('0x16')]:null,_0x363fef?util[_0x264f('0x17')](_0x363fef,![],null):'');}}));_0x26ad9b[_0x264f('0x6')](ewinston[_0x264f('0x7')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x285c6c,_0x3a7adb){var _0x4234a5=_0x264f('0x18');if(_0x285c6c[_0x264f('0xa')]&&_0x285c6c[_0x264f('0xa')][_0x264f('0x19')]&&_0x285c6c[_0x264f('0xa')][_0x264f('0x1a')]){_0x4234a5=_0x264f('0x1b');}return util[_0x264f('0xc')](_0x4234a5,_0x285c6c[_0x264f('0xd')],_0x285c6c[_0x264f('0xf')][_0x264f('0xe')]?_0x285c6c[_0x264f('0xf')]['x-forwarded-for']:_0x285c6c[_0x264f('0x10')]['remoteAddress']||_0x285c6c['ip'],_0x285c6c[_0x264f('0x12')],_0x3a7adb[_0x264f('0x13')],_0x3a7adb[_0x264f('0x14')],_0x285c6c[_0x264f('0x15')]?_0x285c6c['user']['id']:null,_0x285c6c[_0x264f('0x15')]?_0x285c6c['user']['name']:null,_0x285c6c[_0x264f('0x15')]?_0x285c6c['user'][_0x264f('0x16')]:null,_0x285c6c[_0x264f('0xa')]&&_0x285c6c[_0x264f('0xa')][_0x264f('0x19')]?_0x285c6c[_0x264f('0xa')]['device']:'other',_0x285c6c[_0x264f('0xa')]&&_0x285c6c['body']['agent_id']?_0x285c6c[_0x264f('0xa')]['agent_id']:'',_0x285c6c[_0x264f('0xa')]&&_0x285c6c[_0x264f('0xa')][_0x264f('0x1c')]?_0x285c6c[_0x264f('0xa')][_0x264f('0x1c')]:'');},'ignoreRoute':function(_0x1d5d23){var _0x14e20a=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x14e20a[_0x264f('0x1d')](_0x1d5d23[_0x264f('0x12')]);}}));_0x26ad9b[_0x264f('0x6')](_0x264f('0x1e'),require(_0x264f('0x1f')));_0x26ad9b[_0x264f('0x6')]('/api/voice/chanspy',require(_0x264f('0x20')));_0x26ad9b['use'](_0x264f('0x21'),require('./api/voiceContext'));_0x26ad9b[_0x264f('0x6')](_0x264f('0x22'),require('./api/voiceExtension'));_0x26ad9b[_0x264f('0x6')](_0x264f('0x23'),require(_0x264f('0x24')));_0x26ad9b[_0x264f('0x6')](_0x264f('0x25'),require(_0x264f('0x26')));_0x26ad9b['use'](_0x264f('0x27'),require(_0x264f('0x28')));_0x26ad9b[_0x264f('0x6')](_0x264f('0x29'),require(_0x264f('0x2a')));_0x26ad9b['use'](_0x264f('0x2b'),require(_0x264f('0x2c')));_0x26ad9b[_0x264f('0x6')](_0x264f('0x2d'),require(_0x264f('0x2e')));_0x26ad9b[_0x264f('0x6')](_0x264f('0x2f'),require('./api/voiceCallReport'));_0x26ad9b[_0x264f('0x6')](_0x264f('0x30'),require(_0x264f('0x31')));_0x26ad9b[_0x264f('0x6')](_0x264f('0x32'),require(_0x264f('0x33')));_0x26ad9b[_0x264f('0x6')]('/api/voice/queues/reports',require(_0x264f('0x34')));_0x26ad9b['use'](_0x264f('0x35'),require(_0x264f('0x36')));_0x26ad9b[_0x264f('0x6')](_0x264f('0x37'),require(_0x264f('0x38')));_0x26ad9b[_0x264f('0x6')](_0x264f('0x39'),require(_0x264f('0x3a')));_0x26ad9b[_0x264f('0x6')](_0x264f('0x3b'),require(_0x264f('0x3c')));_0x26ad9b[_0x264f('0x6')]('/api/mail/accounts',require(_0x264f('0x3d')));_0x26ad9b[_0x264f('0x6')]('/api/mail/queues',require(_0x264f('0x3e')));_0x26ad9b[_0x264f('0x6')]('/api/mail/substatuses',require(_0x264f('0x3f')));_0x26ad9b[_0x264f('0x6')](_0x264f('0x40'),require(_0x264f('0x41')));_0x26ad9b[_0x264f('0x6')](_0x264f('0x42'),require(_0x264f('0x43')));_0x26ad9b[_0x264f('0x6')](_0x264f('0x44'),require(_0x264f('0x45')));_0x26ad9b[_0x264f('0x6')](_0x264f('0x46'),require(_0x264f('0x47')));_0x26ad9b[_0x264f('0x6')](_0x264f('0x48'),require(_0x264f('0x49')));_0x26ad9b[_0x264f('0x6')](_0x264f('0x4a'),require(_0x264f('0x4b')));_0x26ad9b[_0x264f('0x6')](_0x264f('0x4c'),require('./api/faxAccount'));_0x26ad9b[_0x264f('0x6')]('/api/fax/applications',require(_0x264f('0x4d')));_0x26ad9b['use'](_0x264f('0x4e'),require('./api/faxInteraction'));_0x26ad9b[_0x264f('0x6')](_0x264f('0x4f'),require(_0x264f('0x50')));_0x26ad9b[_0x264f('0x6')](_0x264f('0x51'),require(_0x264f('0x52')));_0x26ad9b[_0x264f('0x6')](_0x264f('0x53'),require(_0x264f('0x54')));_0x26ad9b[_0x264f('0x6')](_0x264f('0x55'),require(_0x264f('0x56')));_0x26ad9b[_0x264f('0x6')](_0x264f('0x57'),require(_0x264f('0x58')));_0x26ad9b[_0x264f('0x6')](_0x264f('0x59'),require(_0x264f('0x5a')));_0x26ad9b['use']('/api/sms/messages',require(_0x264f('0x5b')));_0x26ad9b[_0x264f('0x6')]('/api/sms/queues',require(_0x264f('0x5c')));_0x26ad9b['use']('/api/openchannel/accounts',require(_0x264f('0x5d')));_0x26ad9b[_0x264f('0x6')](_0x264f('0x5e'),require(_0x264f('0x5f')));_0x26ad9b[_0x264f('0x6')](_0x264f('0x60'),require(_0x264f('0x61')));_0x26ad9b[_0x264f('0x6')](_0x264f('0x62'),require(_0x264f('0x63')));_0x26ad9b[_0x264f('0x6')](_0x264f('0x64'),require(_0x264f('0x65')));_0x26ad9b[_0x264f('0x6')](_0x264f('0x66'),require(_0x264f('0x67')));_0x26ad9b[_0x264f('0x6')](_0x264f('0x68'),require(_0x264f('0x69')));_0x26ad9b['use'](_0x264f('0x6a'),require('./api/chatApplication'));_0x26ad9b[_0x264f('0x6')](_0x264f('0x6b'),require(_0x264f('0x6c')));_0x26ad9b[_0x264f('0x6')](_0x264f('0x6d'),require(_0x264f('0x6e')));_0x26ad9b['use'](_0x264f('0x6f'),require(_0x264f('0x70')));_0x26ad9b[_0x264f('0x6')](_0x264f('0x71'),require('./api/chatQueue'));_0x26ad9b['use'](_0x264f('0x72'),require('./api/chatGroup'));_0x26ad9b[_0x264f('0x6')](_0x264f('0x73'),require(_0x264f('0x74')));_0x26ad9b[_0x264f('0x6')]('/api/cm/companies',require('./api/cmCompany'));_0x26ad9b[_0x264f('0x6')](_0x264f('0x75'),require('./api/cmContact'));_0x26ad9b['use'](_0x264f('0x76'),require('./api/cmHopper'));_0x26ad9b[_0x264f('0x6')]('/api/cm/hopper_black',require(_0x264f('0x77')));_0x26ad9b[_0x264f('0x6')](_0x264f('0x78'),require(_0x264f('0x79')));_0x26ad9b['use'](_0x264f('0x7a'),require(_0x264f('0x7b')));_0x26ad9b[_0x264f('0x6')]('/api/cm/custom_fields',require(_0x264f('0x7c')));_0x26ad9b[_0x264f('0x6')](_0x264f('0x7d'),require(_0x264f('0x7e')));_0x26ad9b[_0x264f('0x6')](_0x264f('0x7f'),require(_0x264f('0x80')));_0x26ad9b[_0x264f('0x6')](_0x264f('0x81'),require(_0x264f('0x82')));_0x26ad9b[_0x264f('0x6')]('/api/dispositions',require(_0x264f('0x83')));_0x26ad9b[_0x264f('0x6')](_0x264f('0x84'),require(_0x264f('0x85')));_0x26ad9b[_0x264f('0x6')]('/api/intervals',require('./api/interval'));_0x26ad9b[_0x264f('0x6')](_0x264f('0x86'),require('./api/pause'));_0x26ad9b[_0x264f('0x6')](_0x264f('0x87'),require(_0x264f('0x88')));_0x26ad9b[_0x264f('0x6')](_0x264f('0x89'),require('./api/voiceQueuesLog'));_0x26ad9b[_0x264f('0x6')](_0x264f('0x8a'),require(_0x264f('0x8b')));_0x26ad9b['use'](_0x264f('0x8c'),require(_0x264f('0x8d')));_0x26ad9b['use']('/api/tags',require(_0x264f('0x8e')));_0x26ad9b['use'](_0x264f('0x8f'),require(_0x264f('0x90')));_0x26ad9b[_0x264f('0x6')](_0x264f('0x91'),require(_0x264f('0x92')));_0x26ad9b['use'](_0x264f('0x93'),require('./api/variable'));_0x26ad9b[_0x264f('0x6')](_0x264f('0x94'),require(_0x264f('0x95')));_0x26ad9b['use']('/api/integrations/reports',require(_0x264f('0x96')));_0x26ad9b[_0x264f('0x6')](_0x264f('0x97'),require(_0x264f('0x98')));_0x26ad9b[_0x264f('0x6')](_0x264f('0x99'),require('./api/analyticDefaultReport'));_0x26ad9b[_0x264f('0x6')](_0x264f('0x9a'),require(_0x264f('0x9b')));_0x26ad9b[_0x264f('0x6')](_0x264f('0x9c'),require('./api/analyticMetric'));_0x26ad9b[_0x264f('0x6')](_0x264f('0x9d'),require(_0x264f('0x9e')));_0x26ad9b[_0x264f('0x6')](_0x264f('0x9f'),require(_0x264f('0xa0')));_0x26ad9b[_0x264f('0x6')](_0x264f('0xa1'),require(_0x264f('0xa2')));_0x26ad9b[_0x264f('0x6')](_0x264f('0xa3'),require(_0x264f('0xa4')));_0x26ad9b['use']('/api/integrations/salesforce/fields',require(_0x264f('0xa5')));_0x26ad9b[_0x264f('0x6')]('/api/integrations/sugarcrm/accounts',require('./api/intSugarcrmAccount'));_0x26ad9b['use'](_0x264f('0xa6'),require('./api/intSugarcrmConfiguration'));_0x26ad9b[_0x264f('0x6')]('/api/integrations/sugarcrm/fields',require(_0x264f('0xa7')));_0x26ad9b[_0x264f('0x6')](_0x264f('0xa8'),require('./api/intDeskAccount'));_0x26ad9b['use'](_0x264f('0xa9'),require(_0x264f('0xaa')));_0x26ad9b['use'](_0x264f('0xab'),require('./api/intDeskField'));_0x26ad9b['use'](_0x264f('0xac'),require(_0x264f('0xad')));_0x26ad9b[_0x264f('0x6')]('/api/integrations/zoho/configurations',require('./api/intZohoConfiguration'));_0x26ad9b[_0x264f('0x6')](_0x264f('0xae'),require(_0x264f('0xaf')));_0x26ad9b[_0x264f('0x6')]('/api/integrations/zendesk/accounts',require(_0x264f('0xb0')));_0x26ad9b[_0x264f('0x6')](_0x264f('0xb1'),require(_0x264f('0xb2')));_0x26ad9b['use'](_0x264f('0xb3'),require(_0x264f('0xb4')));_0x26ad9b[_0x264f('0x6')]('/api/integrations/freshdesk/accounts',require(_0x264f('0xb5')));_0x26ad9b[_0x264f('0x6')](_0x264f('0xb6'),require('./api/intFreshdeskConfiguration'));_0x26ad9b['use']('/api/integrations/freshdesk/fields',require(_0x264f('0xb7')));_0x26ad9b[_0x264f('0x6')]('/api/integrations/vtiger/accounts',require(_0x264f('0xb8')));_0x26ad9b[_0x264f('0x6')](_0x264f('0xb9'),require(_0x264f('0xba')));_0x26ad9b['use'](_0x264f('0xbb'),require(_0x264f('0xbc')));_0x26ad9b['use'](_0x264f('0xbd'),require('./api/intServicenowAccount'));_0x26ad9b['use'](_0x264f('0xbe'),require('./api/intServicenowConfiguration'));_0x26ad9b[_0x264f('0x6')]('/api/integrations/servicenow/fields',require(_0x264f('0xbf')));_0x26ad9b[_0x264f('0x6')](_0x264f('0xc0'),require(_0x264f('0xc1')));_0x26ad9b[_0x264f('0x6')]('/api/integrations/dynamics365/configurations',require(_0x264f('0xc2')));_0x26ad9b[_0x264f('0x6')](_0x264f('0xc3'),require('./api/intDynamics365Field'));_0x26ad9b[_0x264f('0x6')](_0x264f('0xc4'),require('./api/intFreshsalesAccount'));_0x26ad9b['use']('/api/integrations/freshsales/configurations',require(_0x264f('0xc5')));_0x26ad9b[_0x264f('0x6')](_0x264f('0xc6'),require(_0x264f('0xc7')));_0x26ad9b[_0x264f('0x6')]('/api/networks',require(_0x264f('0xc8')));_0x26ad9b[_0x264f('0x6')](_0x264f('0xc9'),require(_0x264f('0xca')));_0x26ad9b[_0x264f('0x6')](_0x264f('0xcb'),require(_0x264f('0xcc')));_0x26ad9b[_0x264f('0x6')](_0x264f('0xcd'),require(_0x264f('0xce')));_0x26ad9b['use']('/api/jscripty/questions/reports',require(_0x264f('0xcf')));_0x26ad9b[_0x264f('0x6')](_0x264f('0xd0'),require(_0x264f('0xd1')));_0x26ad9b[_0x264f('0x6')]('/api/sms/reports/queue',require(_0x264f('0xd2')));_0x26ad9b[_0x264f('0x6')](_0x264f('0xd3'),require(_0x264f('0xd4')));_0x26ad9b[_0x264f('0x6')]('/api/square/details/reports',require(_0x264f('0xd5')));_0x26ad9b[_0x264f('0x6')](_0x264f('0xd6'),require(_0x264f('0xd7')));_0x26ad9b['use'](_0x264f('0xd8'),require(_0x264f('0xd9')));_0x26ad9b['use'](_0x264f('0xda'),require(_0x264f('0xdb')));_0x26ad9b[_0x264f('0x6')](_0x264f('0xdc'),require(_0x264f('0xdd')));_0x26ad9b['use']('/api/square/recordings',require(_0x264f('0xde')));_0x26ad9b[_0x264f('0x6')](_0x264f('0xdf'),require('./api/squareMessage'));_0x26ad9b[_0x264f('0x6')](_0x264f('0xe0'),require(_0x264f('0xe1')));_0x26ad9b[_0x264f('0x6')](_0x264f('0xe2'),require('./api/license'));_0x26ad9b[_0x264f('0x6')](_0x264f('0xe3'),require('./api/campaign'));_0x26ad9b['use'](_0x264f('0xe4'),require(_0x264f('0xe5')));_0x26ad9b[_0x264f('0x6')]('/api/attachments',require('./api/attachment'));_0x26ad9b[_0x264f('0x6')](_0x264f('0xe6'),require(_0x264f('0xe7')));_0x26ad9b[_0x264f('0x6')](_0x264f('0xe8'),require(_0x264f('0xe9')));_0x26ad9b[_0x264f('0x6')]('/api/chat/reports/transfer',require('./api/chatTransferReport'));_0x26ad9b[_0x264f('0x6')]('/api/fax/reports/transfer',require(_0x264f('0xea')));_0x26ad9b[_0x264f('0x6')](_0x264f('0xeb'),require(_0x264f('0xec')));_0x26ad9b[_0x264f('0x6')](_0x264f('0xed'),require(_0x264f('0xee')));_0x26ad9b['use'](_0x264f('0xef'),require(_0x264f('0xf0')));_0x26ad9b[_0x264f('0x6')]('/api/voice/prefixes',require(_0x264f('0xf1')));_0x26ad9b['use'](_0x264f('0xf2'),require('./api/userProfile'));_0x26ad9b[_0x264f('0x6')](_0x264f('0xf3'),require(_0x264f('0xf4')));_0x26ad9b[_0x264f('0x6')](_0x264f('0xf5'),require(_0x264f('0xf6')));_0x26ad9b[_0x264f('0x6')](_0x264f('0xf7'),require(_0x264f('0xf8')));_0x26ad9b[_0x264f('0x6')]('/api/whatsapp/accounts',require(_0x264f('0xf9')));_0x26ad9b['use'](_0x264f('0xfa'),require(_0x264f('0xfb')));_0x26ad9b[_0x264f('0x6')](_0x264f('0xfc'),require(_0x264f('0xfd')));_0x26ad9b[_0x264f('0x6')]('/api/whatsapp/messages',require('./api/whatsappMessage'));_0x26ad9b[_0x264f('0x6')]('/api/whatsapp/reports/queue',require(_0x264f('0xfe')));_0x26ad9b[_0x264f('0x6')](_0x264f('0xff'),require(_0x264f('0x100')));_0x26ad9b['use'](_0x264f('0x101'),require(_0x264f('0x102')));_0x26ad9b[_0x264f('0x6')]('/api/cloudProviders',require(_0x264f('0x103')));_0x26ad9b[_0x264f('0x6')](_0x264f('0x104'),require(_0x264f('0x105')));_0x26ad9b[_0x264f('0x6')](_0x264f('0x106'),require(_0x264f('0x107')));_0x26ad9b[_0x264f('0x6')](_0x264f('0x108'),require(_0x264f('0x109')));_0x26ad9b[_0x264f('0x6')]('/api/jira',require('./api/jira'));_0x26ad9b[_0x264f('0x6')](_0x264f('0x10a'),require(_0x264f('0x10b')));_0x26ad9b[_0x264f('0x6')](_0x264f('0x10c'),require('./api/version'));_0x26ad9b[_0x264f('0x6')](_0x264f('0x10d'),require('./api/system'));_0x26ad9b[_0x264f('0x6')]('/api/pm2',require(_0x264f('0x10e')));_0x26ad9b['use'](_0x264f('0x10f'),require(_0x264f('0x110')));_0x26ad9b['use'](_0x264f('0x111'),express[_0x264f('0x112')](path[_0x264f('0x113')](config[_0x264f('0x114')],_0x264f('0x111'))));_0x26ad9b[_0x264f('0x6')]('/www',express[_0x264f('0x112')](path[_0x264f('0x113')](config['root'],_0x264f('0x115'))));_0x26ad9b['use'](_0x264f('0x116'),express[_0x264f('0x112')](path[_0x264f('0x113')](config[_0x264f('0x114')],_0x264f('0x116'))));_0x26ad9b[_0x264f('0x6')](_0x264f('0x117'),express['static'](path[_0x264f('0x113')](config[_0x264f('0x114')],'snippet',_0x264f('0x118'))));_0x26ad9b[_0x264f('0x6')]('/plugins',express[_0x264f('0x112')](path[_0x264f('0x113')](config[_0x264f('0x114')],_0x264f('0x119'))));_0x26ad9b['route'](_0x264f('0x11a'))[_0x264f('0x11b')](errors[0x194]);_0x26ad9b[_0x264f('0x11c')]('/*')[_0x264f('0x11b')](function(_0x44a8b2,_0x405ed7){_0x405ed7[_0x264f('0x11d')](path[_0x264f('0x11e')](_0x26ad9b['get']('appPath')+_0x264f('0x11f')));});};var sensitiveFields=['username',_0x264f('0x120'),_0x264f('0x121'),_0x264f('0x122'),_0x264f('0x123'),'lastName',_0x264f('0x124'),_0x264f('0x125'),_0x264f('0x126'),_0x264f('0x127'),_0x264f('0x128'),_0x264f('0x129'),_0x264f('0x12a'),_0x264f('0x12b'),_0x264f('0x12c'),_0x264f('0x12d'),_0x264f('0x12e'),'token','channelSecret','accessToken','accessTokenSecret',_0x264f('0x12f'),_0x264f('0x130'),'consumerSecret','membername',_0x264f('0x131'),_0x264f('0x132'),_0x264f('0x133'),_0x264f('0x134'),_0x264f('0x135'),_0x264f('0x136'),_0x264f('0x137'),'secretaccesskey',_0x264f('0x138'),'user','pass',_0x264f('0x139'),_0x264f('0x13a'),_0x264f('0x13b'),'secret',_0x264f('0x13c'),_0x264f('0x13d')];function maskSensitiveData(_0x49089a){var _0x18e34c=/(?!^)[\s\S](?!$)/g;if(!_[_0x264f('0x13e')](_0x49089a))return;for(var _0x5884f1 in _0x49089a){if(_[_0x264f('0x13f')](_0x49089a[_0x5884f1])){for(var _0x3d46fb=0x0;_0x3d46fb<_0x49089a[_0x5884f1][_0x264f('0x140')];_0x3d46fb++){maskSensitiveData(_0x49089a[_0x5884f1][_0x3d46fb]);}}else if(_[_0x264f('0x13e')](_0x49089a[_0x5884f1])){maskSensitiveData(_0x49089a[_0x5884f1]);}else if(_['isString'](_0x49089a[_0x5884f1])){_0x49089a[_0x5884f1]=_0x49089a[_0x5884f1][_0x264f('0x141')](/{{{/g,'@@{')[_0x264f('0x141')](/}}}/g,'}@@')[_0x264f('0x141')](/{{/g,'@{')[_0x264f('0x141')](/}}/g,'}@');if(_[_0x264f('0x142')](sensitiveFields,_0x5884f1)){_0x49089a[_0x5884f1]=_0x49089a[_0x5884f1][_0x264f('0x141')](_0x18e34c,'*');}}}} \ No newline at end of file +var _0xda6a=['/api/integrations/zoho/fields','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','./api/intVtigerField','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowField','/api/integrations/dynamics365/accounts','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','./api/intFreshsalesField','/api/networks','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','/api/square/details/reports','/api/jscripty/projects','./api/jscriptyProject','/api/square/odbc','./api/squareOdbc','/api/square/projects','./api/squareProject','/api/square/recordings','./api/squareRecording','/api/square/messages','./api/squareMessage','/api/teams','./api/team','/api/license','./api/license','/api/campaigns','/api/migrations','/api/plugins','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/smsTransferReport','/api/cm/lists','/api/voice/prefixes','/api/userProfiles','./api/userProfile','/api/userProfile/sections','/api/userProfile/resources','./api/userProfileResource','/api/userNotifications','./api/userNotification','/api/whatsapp/accounts','./api/whatsappAccount','/api/whatsapp/applications','./api/whatsappApplication','/api/whatsapp/interactions','./api/whatsappInteraction','/api/whatsapp/messages','./api/whatsappMessage','/api/whatsapp/reports/queue','./api/whatsappQueueReport','/api/whatsapp/reports/transfer','/api/whatsapp/queues','./api/whatsappQueue','/api/cloudProviders','./api/cloudProvider','/api/realtime','./api/realtime','/api/auth/local','./api/authLocal','/api/auth/google','./api/authGoogle','/api/jira','./api/jira','/api/rpc','/api/version','./api/version','/api/system','/api/pm2','./api/pm2','/api/webbar','./api/webbar','/apidoc','static','join','root','/www','/demo','/snippet','snippet','/plugins','/:url(api|auth|components|app|bower_components|assets)/*','sendFile','resolve','get','appPath','/index.html','password','newPassword','firstName','lastName','street','phone','clientSecret','code','accessKey','tenantId','token','accessToken','accessTokenSecret','authToken','consumerKey','consumerSecret','calleridnum','exten','clientEmail','privateKey','accesskeyid','pass','localstationid','dsn','oldPassword','isPlainObject','isArray','replace','@@{','}@@','lodash','path','express','express-winston','./errors','./config/environment','./config/logger','api','auth','default','use','logger','isEmpty','\x20body=%s','format','method','x-forwarded-for','headers','responseTime','user','name','role','inspect','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','body','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','remoteAddress','url','statusCode','device','other','agent_name','test','./api/user','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceExtension','/api/voice/mohs','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/queues/reports','./api/voiceQueueReport','./api/memberReport','/api/trunks','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','./api/dashboard','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','./api/faxMessage','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','/api/sms/applications','./api/smsApplication','./api/smsInteraction','/api/sms/messages','./api/smsMessage','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','/api/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/messages','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/contacts','./api/cmContact','/api/cm/hopper','/api/cm/hopper_black','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','/api/cm/custom_fields','./api/cmCustomField','/api/actions','/api/automations','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/dispositions','./api/disposition','/api/conditions','./api/condition','/api/intervals','./api/interval','./api/pause','/api/cdr','/api/voiceQueuesLog','/api/schedules','./api/sound','./api/tag','/api/templates','./api/template','/api/triggers','./api/trigger','/api/variables','./api/variable','./api/integration','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration'];(function(_0x4e9a1f,_0x43dc94){var _0x54fd5b=function(_0x1231b2){while(--_0x1231b2){_0x4e9a1f['push'](_0x4e9a1f['shift']());}};_0x54fd5b(++_0x43dc94);}(_0xda6a,0x1e4));var _0xada6=function(_0xf6f18e,_0x39ed7b){_0xf6f18e=_0xf6f18e-0x0;var _0x2ff27d=_0xda6a[_0xf6f18e];return _0x2ff27d;};'use strict';var _=require(_0xada6('0x0'));var path=require(_0xada6('0x1'));var express=require(_0xada6('0x2'));var ewinston=require(_0xada6('0x3'));var util=require('util');var errors=require(_0xada6('0x4'));var config=require(_0xada6('0x5'));var logger=require(_0xada6('0x6'))(_0xada6('0x7'));var authLogger=require(_0xada6('0x6'))(_0xada6('0x8'));exports[_0xada6('0x9')]=function(_0x247efd){_0x247efd[_0xada6('0xa')](ewinston[_0xada6('0xb')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x2794c4,_0x16d424){var _0x221bbe='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s';if(!_[_0xada6('0xc')](_0x2794c4['body'])){_0x221bbe+=_0xada6('0xd');var _0x4ed623=_0x2794c4['body'];maskSensitiveData(_0x4ed623);}return util[_0xada6('0xe')](_0x221bbe,_0x2794c4[_0xada6('0xf')],_0x2794c4['headers'][_0xada6('0x10')]?_0x2794c4[_0xada6('0x11')][_0xada6('0x10')]:_0x2794c4['connection']['remoteAddress']||_0x2794c4['ip'],_0x2794c4['url'],_0x16d424['statusCode'],_0x16d424[_0xada6('0x12')],_0x2794c4[_0xada6('0x13')]?_0x2794c4[_0xada6('0x13')]['id']:null,_0x2794c4[_0xada6('0x13')]?_0x2794c4[_0xada6('0x13')][_0xada6('0x14')]:null,_0x2794c4[_0xada6('0x13')]?_0x2794c4[_0xada6('0x13')][_0xada6('0x15')]:null,_0x4ed623?util[_0xada6('0x16')](_0x4ed623,![],null):'');}}));_0x247efd[_0xada6('0xa')](ewinston['logger']({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x47b7ac,_0x399ad6){var _0x3b34cc=_0xada6('0x17');if(_0x47b7ac[_0xada6('0x18')]&&_0x47b7ac['body']['device']&&_0x47b7ac[_0xada6('0x18')][_0xada6('0x19')]){_0x3b34cc=_0xada6('0x1a');}return util[_0xada6('0xe')](_0x3b34cc,_0x47b7ac[_0xada6('0xf')],_0x47b7ac[_0xada6('0x11')]['x-forwarded-for']?_0x47b7ac[_0xada6('0x11')]['x-forwarded-for']:_0x47b7ac['connection'][_0xada6('0x1b')]||_0x47b7ac['ip'],_0x47b7ac[_0xada6('0x1c')],_0x399ad6[_0xada6('0x1d')],_0x399ad6[_0xada6('0x12')],_0x47b7ac[_0xada6('0x13')]?_0x47b7ac['user']['id']:null,_0x47b7ac['user']?_0x47b7ac[_0xada6('0x13')][_0xada6('0x14')]:null,_0x47b7ac[_0xada6('0x13')]?_0x47b7ac[_0xada6('0x13')][_0xada6('0x15')]:null,_0x47b7ac['body']&&_0x47b7ac[_0xada6('0x18')][_0xada6('0x1e')]?_0x47b7ac[_0xada6('0x18')][_0xada6('0x1e')]:_0xada6('0x1f'),_0x47b7ac['body']&&_0x47b7ac[_0xada6('0x18')][_0xada6('0x19')]?_0x47b7ac[_0xada6('0x18')][_0xada6('0x19')]:'',_0x47b7ac['body']&&_0x47b7ac[_0xada6('0x18')][_0xada6('0x20')]?_0x47b7ac[_0xada6('0x18')][_0xada6('0x20')]:'');},'ignoreRoute':function(_0x57d585){var _0x7c529e=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x7c529e[_0xada6('0x21')](_0x57d585['url']);}}));_0x247efd['use']('/api/users',require(_0xada6('0x22')));_0x247efd[_0xada6('0xa')](_0xada6('0x23'),require(_0xada6('0x24')));_0x247efd[_0xada6('0xa')](_0xada6('0x25'),require('./api/voiceContext'));_0x247efd[_0xada6('0xa')]('/api/voice/extensions',require(_0xada6('0x26')));_0x247efd[_0xada6('0xa')](_0xada6('0x27'),require('./api/voiceMusicOnHold'));_0x247efd['use'](_0xada6('0x28'),require(_0xada6('0x29')));_0x247efd[_0xada6('0xa')](_0xada6('0x2a'),require(_0xada6('0x2b')));_0x247efd['use'](_0xada6('0x2c'),require(_0xada6('0x2d')));_0x247efd[_0xada6('0xa')](_0xada6('0x2e'),require(_0xada6('0x2f')));_0x247efd['use'](_0xada6('0x30'),require(_0xada6('0x31')));_0x247efd[_0xada6('0xa')](_0xada6('0x32'),require('./api/voiceCallReport'));_0x247efd[_0xada6('0xa')](_0xada6('0x33'),require(_0xada6('0x34')));_0x247efd[_0xada6('0xa')]('/api/voice/agents/reports',require('./api/voiceAgentReport'));_0x247efd['use'](_0xada6('0x35'),require(_0xada6('0x36')));_0x247efd[_0xada6('0xa')]('/api/members/reports',require(_0xada6('0x37')));_0x247efd[_0xada6('0xa')](_0xada6('0x38'),require(_0xada6('0x39')));_0x247efd[_0xada6('0xa')](_0xada6('0x3a'),require(_0xada6('0x3b')));_0x247efd[_0xada6('0xa')](_0xada6('0x3c'),require(_0xada6('0x3d')));_0x247efd[_0xada6('0xa')]('/api/mail/accounts',require('./api/mailAccount'));_0x247efd[_0xada6('0xa')]('/api/mail/queues',require(_0xada6('0x3e')));_0x247efd[_0xada6('0xa')](_0xada6('0x3f'),require(_0xada6('0x40')));_0x247efd[_0xada6('0xa')](_0xada6('0x41'),require(_0xada6('0x42')));_0x247efd[_0xada6('0xa')](_0xada6('0x43'),require('./api/mailMessage'));_0x247efd[_0xada6('0xa')](_0xada6('0x44'),require(_0xada6('0x45')));_0x247efd['use'](_0xada6('0x46'),require(_0xada6('0x47')));_0x247efd['use']('/api/dashboards',require(_0xada6('0x48')));_0x247efd[_0xada6('0xa')]('/api/dashboards/items',require(_0xada6('0x49')));_0x247efd[_0xada6('0xa')](_0xada6('0x4a'),require(_0xada6('0x4b')));_0x247efd[_0xada6('0xa')](_0xada6('0x4c'),require(_0xada6('0x4d')));_0x247efd['use'](_0xada6('0x4e'),require(_0xada6('0x4f')));_0x247efd[_0xada6('0xa')](_0xada6('0x50'),require(_0xada6('0x51')));_0x247efd[_0xada6('0xa')](_0xada6('0x52'),require(_0xada6('0x53')));_0x247efd['use'](_0xada6('0x54'),require(_0xada6('0x55')));_0x247efd[_0xada6('0xa')](_0xada6('0x56'),require(_0xada6('0x57')));_0x247efd['use'](_0xada6('0x58'),require(_0xada6('0x59')));_0x247efd['use']('/api/sms/interactions',require(_0xada6('0x5a')));_0x247efd['use'](_0xada6('0x5b'),require(_0xada6('0x5c')));_0x247efd[_0xada6('0xa')](_0xada6('0x5d'),require(_0xada6('0x5e')));_0x247efd['use'](_0xada6('0x5f'),require(_0xada6('0x60')));_0x247efd['use'](_0xada6('0x61'),require(_0xada6('0x62')));_0x247efd[_0xada6('0xa')]('/api/openchannel/interactions',require(_0xada6('0x63')));_0x247efd['use'](_0xada6('0x64'),require(_0xada6('0x65')));_0x247efd[_0xada6('0xa')](_0xada6('0x66'),require(_0xada6('0x67')));_0x247efd[_0xada6('0xa')](_0xada6('0x68'),require(_0xada6('0x69')));_0x247efd[_0xada6('0xa')](_0xada6('0x6a'),require(_0xada6('0x6b')));_0x247efd['use'](_0xada6('0x6c'),require(_0xada6('0x6d')));_0x247efd['use'](_0xada6('0x6e'),require(_0xada6('0x6f')));_0x247efd['use'](_0xada6('0x70'),require(_0xada6('0x71')));_0x247efd[_0xada6('0xa')](_0xada6('0x72'),require(_0xada6('0x73')));_0x247efd[_0xada6('0xa')](_0xada6('0x74'),require(_0xada6('0x75')));_0x247efd[_0xada6('0xa')]('/api/chat/groups',require('./api/chatGroup'));_0x247efd[_0xada6('0xa')](_0xada6('0x76'),require(_0xada6('0x77')));_0x247efd['use'](_0xada6('0x78'),require(_0xada6('0x79')));_0x247efd[_0xada6('0xa')](_0xada6('0x7a'),require(_0xada6('0x7b')));_0x247efd[_0xada6('0xa')](_0xada6('0x7c'),require('./api/cmHopper'));_0x247efd[_0xada6('0xa')](_0xada6('0x7d'),require('./api/cmHopperBlack'));_0x247efd[_0xada6('0xa')](_0xada6('0x7e'),require(_0xada6('0x7f')));_0x247efd[_0xada6('0xa')](_0xada6('0x80'),require('./api/cmHopperHistory'));_0x247efd[_0xada6('0xa')](_0xada6('0x81'),require(_0xada6('0x82')));_0x247efd[_0xada6('0xa')](_0xada6('0x83'),require('./api/action'));_0x247efd[_0xada6('0xa')](_0xada6('0x84'),require(_0xada6('0x85')));_0x247efd[_0xada6('0xa')](_0xada6('0x86'),require(_0xada6('0x87')));_0x247efd['use'](_0xada6('0x88'),require(_0xada6('0x89')));_0x247efd[_0xada6('0xa')](_0xada6('0x8a'),require(_0xada6('0x8b')));_0x247efd[_0xada6('0xa')](_0xada6('0x8c'),require(_0xada6('0x8d')));_0x247efd['use']('/api/pauses',require(_0xada6('0x8e')));_0x247efd['use'](_0xada6('0x8f'),require('./api/cdr'));_0x247efd['use'](_0xada6('0x90'),require('./api/voiceQueuesLog'));_0x247efd[_0xada6('0xa')](_0xada6('0x91'),require('./api/schedule'));_0x247efd[_0xada6('0xa')]('/api/sounds',require(_0xada6('0x92')));_0x247efd['use']('/api/tags',require(_0xada6('0x93')));_0x247efd[_0xada6('0xa')](_0xada6('0x94'),require(_0xada6('0x95')));_0x247efd[_0xada6('0xa')](_0xada6('0x96'),require(_0xada6('0x97')));_0x247efd[_0xada6('0xa')](_0xada6('0x98'),require(_0xada6('0x99')));_0x247efd['use']('/api/integrations',require(_0xada6('0x9a')));_0x247efd[_0xada6('0xa')](_0xada6('0x9b'),require(_0xada6('0x9c')));_0x247efd['use'](_0xada6('0x9d'),require(_0xada6('0x9e')));_0x247efd[_0xada6('0xa')](_0xada6('0x9f'),require(_0xada6('0xa0')));_0x247efd[_0xada6('0xa')]('/api/analytics/extracted_reports',require('./api/analyticExtractedReport'));_0x247efd[_0xada6('0xa')](_0xada6('0xa1'),require(_0xada6('0xa2')));_0x247efd[_0xada6('0xa')](_0xada6('0xa3'),require('./api/analyticFieldReport'));_0x247efd[_0xada6('0xa')](_0xada6('0xa4'),require(_0xada6('0xa5')));_0x247efd['use'](_0xada6('0xa6'),require('./api/intSalesforceAccount'));_0x247efd[_0xada6('0xa')]('/api/integrations/salesforce/configurations',require(_0xada6('0xa7')));_0x247efd[_0xada6('0xa')](_0xada6('0xa8'),require('./api/intSalesforceField'));_0x247efd['use'](_0xada6('0xa9'),require(_0xada6('0xaa')));_0x247efd[_0xada6('0xa')](_0xada6('0xab'),require(_0xada6('0xac')));_0x247efd[_0xada6('0xa')](_0xada6('0xad'),require(_0xada6('0xae')));_0x247efd['use'](_0xada6('0xaf'),require(_0xada6('0xb0')));_0x247efd[_0xada6('0xa')](_0xada6('0xb1'),require('./api/intDeskConfiguration'));_0x247efd['use'](_0xada6('0xb2'),require(_0xada6('0xb3')));_0x247efd[_0xada6('0xa')](_0xada6('0xb4'),require(_0xada6('0xb5')));_0x247efd[_0xada6('0xa')](_0xada6('0xb6'),require(_0xada6('0xb7')));_0x247efd[_0xada6('0xa')](_0xada6('0xb8'),require('./api/intZohoField'));_0x247efd[_0xada6('0xa')](_0xada6('0xb9'),require(_0xada6('0xba')));_0x247efd['use'](_0xada6('0xbb'),require('./api/intZendeskConfiguration'));_0x247efd['use'](_0xada6('0xbc'),require(_0xada6('0xbd')));_0x247efd['use']('/api/integrations/freshdesk/accounts',require('./api/intFreshdeskAccount'));_0x247efd[_0xada6('0xa')](_0xada6('0xbe'),require(_0xada6('0xbf')));_0x247efd[_0xada6('0xa')](_0xada6('0xc0'),require(_0xada6('0xc1')));_0x247efd[_0xada6('0xa')](_0xada6('0xc2'),require(_0xada6('0xc3')));_0x247efd[_0xada6('0xa')](_0xada6('0xc4'),require('./api/intVtigerConfiguration'));_0x247efd['use']('/api/integrations/vtiger/fields',require(_0xada6('0xc5')));_0x247efd[_0xada6('0xa')]('/api/integrations/servicenow/accounts',require(_0xada6('0xc6')));_0x247efd[_0xada6('0xa')](_0xada6('0xc7'),require('./api/intServicenowConfiguration'));_0x247efd['use']('/api/integrations/servicenow/fields',require(_0xada6('0xc8')));_0x247efd['use'](_0xada6('0xc9'),require('./api/intDynamics365Account'));_0x247efd[_0xada6('0xa')](_0xada6('0xca'),require(_0xada6('0xcb')));_0x247efd[_0xada6('0xa')](_0xada6('0xcc'),require(_0xada6('0xcd')));_0x247efd[_0xada6('0xa')](_0xada6('0xce'),require(_0xada6('0xcf')));_0x247efd[_0xada6('0xa')](_0xada6('0xd0'),require(_0xada6('0xd1')));_0x247efd['use']('/api/integrations/freshsales/fields',require(_0xada6('0xd2')));_0x247efd[_0xada6('0xa')](_0xada6('0xd3'),require('./api/network'));_0x247efd['use']('/api/chat/reports/queue',require(_0xada6('0xd4')));_0x247efd[_0xada6('0xa')](_0xada6('0xd5'),require(_0xada6('0xd6')));_0x247efd[_0xada6('0xa')](_0xada6('0xd7'),require(_0xada6('0xd8')));_0x247efd[_0xada6('0xa')]('/api/jscripty/questions/reports',require(_0xada6('0xd9')));_0x247efd[_0xada6('0xa')](_0xada6('0xda'),require(_0xada6('0xdb')));_0x247efd['use'](_0xada6('0xdc'),require(_0xada6('0xdd')));_0x247efd[_0xada6('0xa')](_0xada6('0xde'),require('./api/squareReport'));_0x247efd[_0xada6('0xa')](_0xada6('0xdf'),require('./api/squareReportDetail'));_0x247efd['use'](_0xada6('0xe0'),require(_0xada6('0xe1')));_0x247efd[_0xada6('0xa')]('/api/settings',require('./api/setting'));_0x247efd[_0xada6('0xa')](_0xada6('0xe2'),require(_0xada6('0xe3')));_0x247efd['use'](_0xada6('0xe4'),require(_0xada6('0xe5')));_0x247efd[_0xada6('0xa')](_0xada6('0xe6'),require(_0xada6('0xe7')));_0x247efd[_0xada6('0xa')](_0xada6('0xe8'),require(_0xada6('0xe9')));_0x247efd[_0xada6('0xa')](_0xada6('0xea'),require(_0xada6('0xeb')));_0x247efd[_0xada6('0xa')](_0xada6('0xec'),require(_0xada6('0xed')));_0x247efd[_0xada6('0xa')](_0xada6('0xee'),require('./api/campaign'));_0x247efd['use'](_0xada6('0xef'),require('./api/migration'));_0x247efd[_0xada6('0xa')]('/api/attachments',require('./api/attachment'));_0x247efd[_0xada6('0xa')](_0xada6('0xf0'),require(_0xada6('0xf1')));_0x247efd[_0xada6('0xa')](_0xada6('0xf2'),require(_0xada6('0xf3')));_0x247efd['use']('/api/chat/reports/transfer',require(_0xada6('0xf4')));_0x247efd[_0xada6('0xa')](_0xada6('0xf5'),require(_0xada6('0xf6')));_0x247efd[_0xada6('0xa')](_0xada6('0xf7'),require('./api/openchannelTransferReport'));_0x247efd[_0xada6('0xa')]('/api/sms/reports/transfer',require(_0xada6('0xf8')));_0x247efd[_0xada6('0xa')](_0xada6('0xf9'),require('./api/cmList'));_0x247efd['use'](_0xada6('0xfa'),require('./api/voicePrefix'));_0x247efd['use'](_0xada6('0xfb'),require(_0xada6('0xfc')));_0x247efd['use'](_0xada6('0xfd'),require('./api/userProfileSection'));_0x247efd[_0xada6('0xa')](_0xada6('0xfe'),require(_0xada6('0xff')));_0x247efd[_0xada6('0xa')](_0xada6('0x100'),require(_0xada6('0x101')));_0x247efd[_0xada6('0xa')](_0xada6('0x102'),require(_0xada6('0x103')));_0x247efd[_0xada6('0xa')](_0xada6('0x104'),require(_0xada6('0x105')));_0x247efd[_0xada6('0xa')](_0xada6('0x106'),require(_0xada6('0x107')));_0x247efd[_0xada6('0xa')](_0xada6('0x108'),require(_0xada6('0x109')));_0x247efd['use'](_0xada6('0x10a'),require(_0xada6('0x10b')));_0x247efd['use'](_0xada6('0x10c'),require('./api/whatsappTransferReport'));_0x247efd['use'](_0xada6('0x10d'),require(_0xada6('0x10e')));_0x247efd[_0xada6('0xa')](_0xada6('0x10f'),require(_0xada6('0x110')));_0x247efd[_0xada6('0xa')](_0xada6('0x111'),require(_0xada6('0x112')));_0x247efd[_0xada6('0xa')](_0xada6('0x113'),require(_0xada6('0x114')));_0x247efd[_0xada6('0xa')](_0xada6('0x115'),require(_0xada6('0x116')));_0x247efd[_0xada6('0xa')](_0xada6('0x117'),require(_0xada6('0x118')));_0x247efd[_0xada6('0xa')](_0xada6('0x119'),require('./api/rpc'));_0x247efd['use'](_0xada6('0x11a'),require(_0xada6('0x11b')));_0x247efd[_0xada6('0xa')](_0xada6('0x11c'),require('./api/system'));_0x247efd[_0xada6('0xa')](_0xada6('0x11d'),require(_0xada6('0x11e')));_0x247efd['use'](_0xada6('0x11f'),require(_0xada6('0x120')));_0x247efd['use'](_0xada6('0x121'),express[_0xada6('0x122')](path[_0xada6('0x123')](config[_0xada6('0x124')],'/apidoc')));_0x247efd['use'](_0xada6('0x125'),express[_0xada6('0x122')](path['join'](config[_0xada6('0x124')],'/www')));_0x247efd['use'](_0xada6('0x126'),express[_0xada6('0x122')](path[_0xada6('0x123')](config[_0xada6('0x124')],_0xada6('0x126'))));_0x247efd[_0xada6('0xa')](_0xada6('0x127'),express[_0xada6('0x122')](path['join'](config[_0xada6('0x124')],_0xada6('0x128'),'3.0.0')));_0x247efd[_0xada6('0xa')](_0xada6('0x129'),express[_0xada6('0x122')](path[_0xada6('0x123')](config[_0xada6('0x124')],'/server/files/plugins')));_0x247efd['route'](_0xada6('0x12a'))['get'](errors[0x194]);_0x247efd['route']('/*')['get'](function(_0x5ab650,_0x202d73){_0x202d73[_0xada6('0x12b')](path[_0xada6('0x12c')](_0x247efd[_0xada6('0x12d')](_0xada6('0x12e'))+_0xada6('0x12f')));});};var sensitiveFields=['username',_0xada6('0x130'),_0xada6('0x131'),'apiKey',_0xada6('0x132'),_0xada6('0x133'),_0xada6('0x134'),_0xada6('0x135'),'mobile','fax','email','clientId',_0xada6('0x136'),'securityToken',_0xada6('0x137'),_0xada6('0x138'),_0xada6('0x139'),_0xada6('0x13a'),'channelSecret',_0xada6('0x13b'),_0xada6('0x13c'),_0xada6('0x13d'),_0xada6('0x13e'),_0xada6('0x13f'),'membername','calleridname',_0xada6('0x140'),_0xada6('0x141'),'vidaooApiKey',_0xada6('0x142'),_0xada6('0x143'),_0xada6('0x144'),'secretaccesskey','key',_0xada6('0x13'),_0xada6('0x145'),'accountSid',_0xada6('0x146'),_0xada6('0x147'),'secret','registry',_0xada6('0x148')];function maskSensitiveData(_0x101d4c){var _0x2a0e81=/(?!^)[\s\S](?!$)/g;if(!_[_0xada6('0x149')](_0x101d4c))return;for(var _0x83b895 in _0x101d4c){if(_[_0xada6('0x14a')](_0x101d4c[_0x83b895])){for(var _0x4278dc=0x0;_0x4278dc<_0x101d4c[_0x83b895]['length'];_0x4278dc++){maskSensitiveData(_0x101d4c[_0x83b895][_0x4278dc]);}}else if(_[_0xada6('0x149')](_0x101d4c[_0x83b895])){maskSensitiveData(_0x101d4c[_0x83b895]);}else if(_['isString'](_0x101d4c[_0x83b895])){_0x101d4c[_0x83b895]=_0x101d4c[_0x83b895][_0xada6('0x14b')](/{{{/g,_0xada6('0x14c'))[_0xada6('0x14b')](/}}}/g,_0xada6('0x14d'))['replace'](/{{/g,'@{')[_0xada6('0x14b')](/}}/g,'}@');if(_['includes'](sensitiveFields,_0x83b895)){_0x101d4c[_0x83b895]=_0x101d4c[_0x83b895][_0xada6('0x14b')](_0x2a0e81,'*');}}}} \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index c0d2d98..0134797 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6223=['RPC\x20listening\x20on\x20','jayson/promise','bluebird','lodash','../config/environment','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','merge','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/trunk/trunk.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailMessage/mailMessage.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/setting/setting.rpc','../api/squareProject/squareProject.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappInteraction/whatsappInteraction.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','rpc','port','listen','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','default'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x6223,0x193));var _0x3622=function(_0x28407a,_0x2a7269){_0x28407a=_0x28407a-0x0;var _0x8bd6ef=_0x6223[_0x28407a];return _0x8bd6ef;};'use strict';var jayson=require(_0x3622('0x0'));var BPromise=require(_0x3622('0x1'));var _=require(_0x3622('0x2'));var config=require(_0x3622('0x3'));exports['listen']=function(){return new BPromise(function(_0x4644ee,_0x1e6bf7){var _0x4ded58={};_0x4ded58=_['merge'](_0x4ded58,require(_0x3622('0x4')));_0x4ded58=_['merge'](_0x4ded58,require(_0x3622('0x5')));_0x4ded58=_[_0x3622('0x6')](_0x4ded58,require('../api/voiceQueue/voiceQueue.rpc'));_0x4ded58=_[_0x3622('0x6')](_0x4ded58,require(_0x3622('0x7')));_0x4ded58=_['merge'](_0x4ded58,require(_0x3622('0x8')));_0x4ded58=_[_0x3622('0x6')](_0x4ded58,require('../api/voiceDialReport/voiceDialReport.rpc'));_0x4ded58=_[_0x3622('0x6')](_0x4ded58,require('../api/voiceAgentReport/voiceAgentReport.rpc'));_0x4ded58=_[_0x3622('0x6')](_0x4ded58,require(_0x3622('0x9')));_0x4ded58=_[_0x3622('0x6')](_0x4ded58,require('../api/memberReport/memberReport.rpc'));_0x4ded58=_[_0x3622('0x6')](_0x4ded58,require(_0x3622('0xa')));_0x4ded58=_['merge'](_0x4ded58,require('../api/voiceTransferReport/voiceTransferReport.rpc'));_0x4ded58=_['merge'](_0x4ded58,require('../api/userVoiceQueueRt/userVoiceQueueRt.rpc'));_0x4ded58=_[_0x3622('0x6')](_0x4ded58,require(_0x3622('0xb')));_0x4ded58=_[_0x3622('0x6')](_0x4ded58,require(_0x3622('0xc')));_0x4ded58=_[_0x3622('0x6')](_0x4ded58,require(_0x3622('0xd')));_0x4ded58=_[_0x3622('0x6')](_0x4ded58,require('../api/mailInteraction/mailInteraction.rpc'));_0x4ded58=_[_0x3622('0x6')](_0x4ded58,require(_0x3622('0xe')));_0x4ded58=_['merge'](_0x4ded58,require('../api/mailApplication/mailApplication.rpc'));_0x4ded58=_[_0x3622('0x6')](_0x4ded58,require(_0x3622('0xf')));_0x4ded58=_[_0x3622('0x6')](_0x4ded58,require(_0x3622('0x10')));_0x4ded58=_[_0x3622('0x6')](_0x4ded58,require(_0x3622('0x11')));_0x4ded58=_['merge'](_0x4ded58,require(_0x3622('0x12')));_0x4ded58=_[_0x3622('0x6')](_0x4ded58,require(_0x3622('0x13')));_0x4ded58=_[_0x3622('0x6')](_0x4ded58,require(_0x3622('0x14')));_0x4ded58=_[_0x3622('0x6')](_0x4ded58,require(_0x3622('0x15')));_0x4ded58=_['merge'](_0x4ded58,require('../api/smsAccount/smsAccount.rpc'));_0x4ded58=_[_0x3622('0x6')](_0x4ded58,require(_0x3622('0x16')));_0x4ded58=_[_0x3622('0x6')](_0x4ded58,require('../api/smsMessage/smsMessage.rpc'));_0x4ded58=_[_0x3622('0x6')](_0x4ded58,require(_0x3622('0x17')));_0x4ded58=_[_0x3622('0x6')](_0x4ded58,require('../api/openchannelApplication/openchannelApplication.rpc'));_0x4ded58=_[_0x3622('0x6')](_0x4ded58,require(_0x3622('0x18')));_0x4ded58=_['merge'](_0x4ded58,require(_0x3622('0x19')));_0x4ded58=_['merge'](_0x4ded58,require(_0x3622('0x1a')));_0x4ded58=_['merge'](_0x4ded58,require('../api/openchannelQueueReport/openchannelQueueReport.rpc'));_0x4ded58=_[_0x3622('0x6')](_0x4ded58,require(_0x3622('0x1b')));_0x4ded58=_[_0x3622('0x6')](_0x4ded58,require(_0x3622('0x1c')));_0x4ded58=_[_0x3622('0x6')](_0x4ded58,require(_0x3622('0x1d')));_0x4ded58=_['merge'](_0x4ded58,require('../api/cmContact/cmContact.rpc'));_0x4ded58=_[_0x3622('0x6')](_0x4ded58,require(_0x3622('0x1e')));_0x4ded58=_[_0x3622('0x6')](_0x4ded58,require('../api/cmHopperBlack/cmHopperBlack.rpc'));_0x4ded58=_[_0x3622('0x6')](_0x4ded58,require(_0x3622('0x1f')));_0x4ded58=_[_0x3622('0x6')](_0x4ded58,require(_0x3622('0x20')));_0x4ded58=_[_0x3622('0x6')](_0x4ded58,require(_0x3622('0x21')));_0x4ded58=_[_0x3622('0x6')](_0x4ded58,require(_0x3622('0x22')));_0x4ded58=_[_0x3622('0x6')](_0x4ded58,require(_0x3622('0x23')));_0x4ded58=_[_0x3622('0x6')](_0x4ded58,require(_0x3622('0x24')));_0x4ded58=_['merge'](_0x4ded58,require(_0x3622('0x25')));_0x4ded58=_[_0x3622('0x6')](_0x4ded58,require('../api/trigger/trigger.rpc'));_0x4ded58=_[_0x3622('0x6')](_0x4ded58,require(_0x3622('0x26')));_0x4ded58=_[_0x3622('0x6')](_0x4ded58,require(_0x3622('0x27')));_0x4ded58=_['merge'](_0x4ded58,require('../api/intSugarcrmAccount/intSugarcrmAccount.rpc'));_0x4ded58=_[_0x3622('0x6')](_0x4ded58,require(_0x3622('0x28')));_0x4ded58=_[_0x3622('0x6')](_0x4ded58,require('../api/intZohoAccount/intZohoAccount.rpc'));_0x4ded58=_[_0x3622('0x6')](_0x4ded58,require(_0x3622('0x29')));_0x4ded58=_[_0x3622('0x6')](_0x4ded58,require(_0x3622('0x2a')));_0x4ded58=_[_0x3622('0x6')](_0x4ded58,require('../api/intVtigerAccount/intVtigerAccount.rpc'));_0x4ded58=_[_0x3622('0x6')](_0x4ded58,require(_0x3622('0x2b')));_0x4ded58=_[_0x3622('0x6')](_0x4ded58,require(_0x3622('0x2c')));_0x4ded58=_[_0x3622('0x6')](_0x4ded58,require('../api/intFreshsalesAccount/intFreshsalesAccount.rpc'));_0x4ded58=_[_0x3622('0x6')](_0x4ded58,require(_0x3622('0x2d')));_0x4ded58=_['merge'](_0x4ded58,require(_0x3622('0x2e')));_0x4ded58=_['merge'](_0x4ded58,require(_0x3622('0x2f')));_0x4ded58=_[_0x3622('0x6')](_0x4ded58,require('../api/squareReportDetail/squareReportDetail.rpc'));_0x4ded58=_['merge'](_0x4ded58,require(_0x3622('0x30')));_0x4ded58=_[_0x3622('0x6')](_0x4ded58,require('../api/squareOdbc/squareOdbc.rpc'));_0x4ded58=_[_0x3622('0x6')](_0x4ded58,require(_0x3622('0x31')));_0x4ded58=_[_0x3622('0x6')](_0x4ded58,require('../api/squareRecording/squareRecording.rpc'));_0x4ded58=_[_0x3622('0x6')](_0x4ded58,require(_0x3622('0x32')));_0x4ded58=_[_0x3622('0x6')](_0x4ded58,require(_0x3622('0x33')));_0x4ded58=_[_0x3622('0x6')](_0x4ded58,require(_0x3622('0x34')));_0x4ded58=_[_0x3622('0x6')](_0x4ded58,require(_0x3622('0x35')));_0x4ded58=_['merge'](_0x4ded58,require(_0x3622('0x36')));_0x4ded58=_['merge'](_0x4ded58,require(_0x3622('0x37')));_0x4ded58=_[_0x3622('0x6')](_0x4ded58,require(_0x3622('0x38')));_0x4ded58=_[_0x3622('0x6')](_0x4ded58,require(_0x3622('0x39')));_0x4ded58=_['merge'](_0x4ded58,require(_0x3622('0x3a')));var _0x1eb4fa=jayson[_0x3622('0x3b')](_0x4ded58)['http']();var _0xe18f8f=config[_0x3622('0x3c')]['port']||config[_0x3622('0x3d')]+0x1;var _0x5deab3=config['rpc']['ip']||'localhost';_0x1eb4fa['on']('error',function(_0x549c00){return _0x1e6bf7(_0x549c00);});_0x1eb4fa[_0x3622('0x3e')](_0xe18f8f,_0x5deab3,function(){console[_0x3622('0x3f')](_0x3622('0x40'),_0x5deab3,_0xe18f8f);require('../config/triggers')[_0x3622('0x41')]();return _0x4644ee(_0x3622('0x42')+_0x5deab3+':'+_0xe18f8f);});});}; \ No newline at end of file +var _0x911b=['../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/setting/setting.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','../api/whatsappAccount/whatsappAccount.rpc','../api/whatsappMessage/whatsappMessage.rpc','../api/whatsappQueueReport/whatsappQueueReport.rpc','../api/whatsappQueue/whatsappQueue.rpc','server','http','rpc','port','localhost','error','log','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/voiceRecording/voiceRecording.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.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/faxQueue/faxQueue.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc'];(function(_0x22a4f3,_0x3c05fc){var _0x22e151=function(_0x5c5e21){while(--_0x5c5e21){_0x22a4f3['push'](_0x22a4f3['shift']());}};_0x22e151(++_0x3c05fc);}(_0x911b,0x159));var _0xb911=function(_0x46e66e,_0x1f97ce){_0x46e66e=_0x46e66e-0x0;var _0xd845c1=_0x911b[_0x46e66e];return _0xd845c1;};'use strict';var jayson=require(_0xb911('0x0'));var BPromise=require('bluebird');var _=require(_0xb911('0x1'));var config=require(_0xb911('0x2'));exports[_0xb911('0x3')]=function(){return new BPromise(function(_0x4736cc,_0x1d4e15){var _0x25a3aa={};_0x25a3aa=_[_0xb911('0x4')](_0x25a3aa,require(_0xb911('0x5')));_0x25a3aa=_[_0xb911('0x4')](_0x25a3aa,require(_0xb911('0x6')));_0x25a3aa=_[_0xb911('0x4')](_0x25a3aa,require(_0xb911('0x7')));_0x25a3aa=_[_0xb911('0x4')](_0x25a3aa,require(_0xb911('0x8')));_0x25a3aa=_['merge'](_0x25a3aa,require('../api/voiceCallReport/voiceCallReport.rpc'));_0x25a3aa=_[_0xb911('0x4')](_0x25a3aa,require(_0xb911('0x9')));_0x25a3aa=_[_0xb911('0x4')](_0x25a3aa,require(_0xb911('0xa')));_0x25a3aa=_['merge'](_0x25a3aa,require(_0xb911('0xb')));_0x25a3aa=_[_0xb911('0x4')](_0x25a3aa,require(_0xb911('0xc')));_0x25a3aa=_['merge'](_0x25a3aa,require(_0xb911('0xd')));_0x25a3aa=_['merge'](_0x25a3aa,require(_0xb911('0xe')));_0x25a3aa=_[_0xb911('0x4')](_0x25a3aa,require(_0xb911('0xf')));_0x25a3aa=_[_0xb911('0x4')](_0x25a3aa,require(_0xb911('0x10')));_0x25a3aa=_[_0xb911('0x4')](_0x25a3aa,require(_0xb911('0x11')));_0x25a3aa=_[_0xb911('0x4')](_0x25a3aa,require('../api/mailQueue/mailQueue.rpc'));_0x25a3aa=_['merge'](_0x25a3aa,require(_0xb911('0x12')));_0x25a3aa=_[_0xb911('0x4')](_0x25a3aa,require(_0xb911('0x13')));_0x25a3aa=_['merge'](_0x25a3aa,require(_0xb911('0x14')));_0x25a3aa=_[_0xb911('0x4')](_0x25a3aa,require(_0xb911('0x15')));_0x25a3aa=_[_0xb911('0x4')](_0x25a3aa,require(_0xb911('0x16')));_0x25a3aa=_['merge'](_0x25a3aa,require(_0xb911('0x17')));_0x25a3aa=_['merge'](_0x25a3aa,require(_0xb911('0x18')));_0x25a3aa=_[_0xb911('0x4')](_0x25a3aa,require('../api/faxMessage/faxMessage.rpc'));_0x25a3aa=_[_0xb911('0x4')](_0x25a3aa,require(_0xb911('0x19')));_0x25a3aa=_['merge'](_0x25a3aa,require('../api/faxQueueReport/faxQueueReport.rpc'));_0x25a3aa=_[_0xb911('0x4')](_0x25a3aa,require('../api/smsAccount/smsAccount.rpc'));_0x25a3aa=_[_0xb911('0x4')](_0x25a3aa,require(_0xb911('0x1a')));_0x25a3aa=_['merge'](_0x25a3aa,require(_0xb911('0x1b')));_0x25a3aa=_['merge'](_0x25a3aa,require('../api/smsQueue/smsQueue.rpc'));_0x25a3aa=_[_0xb911('0x4')](_0x25a3aa,require(_0xb911('0x1c')));_0x25a3aa=_[_0xb911('0x4')](_0x25a3aa,require(_0xb911('0x1d')));_0x25a3aa=_[_0xb911('0x4')](_0x25a3aa,require(_0xb911('0x1e')));_0x25a3aa=_[_0xb911('0x4')](_0x25a3aa,require(_0xb911('0x1f')));_0x25a3aa=_[_0xb911('0x4')](_0x25a3aa,require(_0xb911('0x20')));_0x25a3aa=_['merge'](_0x25a3aa,require('../api/chatInteraction/chatInteraction.rpc'));_0x25a3aa=_[_0xb911('0x4')](_0x25a3aa,require(_0xb911('0x21')));_0x25a3aa=_['merge'](_0x25a3aa,require(_0xb911('0x22')));_0x25a3aa=_['merge'](_0x25a3aa,require('../api/cmContact/cmContact.rpc'));_0x25a3aa=_[_0xb911('0x4')](_0x25a3aa,require(_0xb911('0x23')));_0x25a3aa=_[_0xb911('0x4')](_0x25a3aa,require(_0xb911('0x24')));_0x25a3aa=_[_0xb911('0x4')](_0x25a3aa,require(_0xb911('0x25')));_0x25a3aa=_[_0xb911('0x4')](_0x25a3aa,require(_0xb911('0x26')));_0x25a3aa=_[_0xb911('0x4')](_0x25a3aa,require(_0xb911('0x27')));_0x25a3aa=_['merge'](_0x25a3aa,require(_0xb911('0x28')));_0x25a3aa=_[_0xb911('0x4')](_0x25a3aa,require(_0xb911('0x29')));_0x25a3aa=_[_0xb911('0x4')](_0x25a3aa,require(_0xb911('0x2a')));_0x25a3aa=_[_0xb911('0x4')](_0x25a3aa,require(_0xb911('0x2b')));_0x25a3aa=_[_0xb911('0x4')](_0x25a3aa,require(_0xb911('0x2c')));_0x25a3aa=_[_0xb911('0x4')](_0x25a3aa,require('../api/variable/variable.rpc'));_0x25a3aa=_[_0xb911('0x4')](_0x25a3aa,require(_0xb911('0x2d')));_0x25a3aa=_[_0xb911('0x4')](_0x25a3aa,require(_0xb911('0x2e')));_0x25a3aa=_['merge'](_0x25a3aa,require(_0xb911('0x2f')));_0x25a3aa=_[_0xb911('0x4')](_0x25a3aa,require(_0xb911('0x30')));_0x25a3aa=_['merge'](_0x25a3aa,require(_0xb911('0x31')));_0x25a3aa=_['merge'](_0x25a3aa,require(_0xb911('0x32')));_0x25a3aa=_[_0xb911('0x4')](_0x25a3aa,require(_0xb911('0x33')));_0x25a3aa=_[_0xb911('0x4')](_0x25a3aa,require('../api/intServicenowAccount/intServicenowAccount.rpc'));_0x25a3aa=_[_0xb911('0x4')](_0x25a3aa,require(_0xb911('0x34')));_0x25a3aa=_['merge'](_0x25a3aa,require(_0xb911('0x35')));_0x25a3aa=_['merge'](_0x25a3aa,require('../api/chatQueueReport/chatQueueReport.rpc'));_0x25a3aa=_[_0xb911('0x4')](_0x25a3aa,require(_0xb911('0x36')));_0x25a3aa=_[_0xb911('0x4')](_0x25a3aa,require(_0xb911('0x37')));_0x25a3aa=_[_0xb911('0x4')](_0x25a3aa,require('../api/squareReportDetail/squareReportDetail.rpc'));_0x25a3aa=_[_0xb911('0x4')](_0x25a3aa,require(_0xb911('0x38')));_0x25a3aa=_[_0xb911('0x4')](_0x25a3aa,require(_0xb911('0x39')));_0x25a3aa=_[_0xb911('0x4')](_0x25a3aa,require(_0xb911('0x3a')));_0x25a3aa=_[_0xb911('0x4')](_0x25a3aa,require(_0xb911('0x3b')));_0x25a3aa=_[_0xb911('0x4')](_0x25a3aa,require(_0xb911('0x3c')));_0x25a3aa=_[_0xb911('0x4')](_0x25a3aa,require(_0xb911('0x3d')));_0x25a3aa=_[_0xb911('0x4')](_0x25a3aa,require(_0xb911('0x3e')));_0x25a3aa=_[_0xb911('0x4')](_0x25a3aa,require(_0xb911('0x3f')));_0x25a3aa=_[_0xb911('0x4')](_0x25a3aa,require(_0xb911('0x40')));_0x25a3aa=_['merge'](_0x25a3aa,require('../api/whatsappInteraction/whatsappInteraction.rpc'));_0x25a3aa=_[_0xb911('0x4')](_0x25a3aa,require(_0xb911('0x41')));_0x25a3aa=_[_0xb911('0x4')](_0x25a3aa,require(_0xb911('0x42')));_0x25a3aa=_['merge'](_0x25a3aa,require(_0xb911('0x43')));var _0x199270=jayson[_0xb911('0x44')](_0x25a3aa)[_0xb911('0x45')]();var _0x2b0606=config[_0xb911('0x46')][_0xb911('0x47')]||config[_0xb911('0x47')]+0x1;var _0x4e634c=config['rpc']['ip']||_0xb911('0x48');_0x199270['on'](_0xb911('0x49'),function(_0x259665){return _0x1d4e15(_0x259665);});_0x199270[_0xb911('0x3')](_0x2b0606,_0x4e634c,function(){console[_0xb911('0x4a')]('Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!',_0x4e634c,_0x2b0606);require('../config/triggers')[_0xb911('0x4b')]();return _0x4736cc(_0xb911('0x4c')+_0x4e634c+':'+_0x2b0606);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index 0508660..10028c8 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 _0x9cb4=['hangup','setVariable','isNumber','SET\x20VARIABLE\x20%s\x20\x22%s\x22','toString','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','sayPhonetic','continueAt','extension','setExtension','noop','recordFile','wav','BEEP','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','exports','util','lodash','events','call','setEncoding','utf8','setTimeout','headers','emit','ready','line','toLowerCase','substring','520\x20End\x20of\x20proper','no\x20code','replace','indexOf','substr','split','length','match','error','close','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','command','function','write','inherits','prototype','sendRequest','sync','ANSWER','getData','beep','NO\x20MESSAGE','format','VERBOSE\x20\x22%s\x22','exec','isArray','EXEC\x20%s\x20%s','join','setContext','SET\x20CONTEXT\x20%s','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s'];(function(_0xb66df,_0x4fb5ce){var _0x42a702=function(_0x252d1d){while(--_0x252d1d){_0xb66df['push'](_0xb66df['shift']());}};_0x42a702(++_0x4fb5ce);}(_0x9cb4,0x12d));var _0x49cb=function(_0x1ffeae,_0x1fb5fb){_0x1ffeae=_0x1ffeae-0x0;var _0x103b9f=_0x9cb4[_0x1ffeae];return _0x103b9f;};'use strict';var util=require(_0x49cb('0x0'));var _=require(_0x49cb('0x1'));var EventEmitter=require(_0x49cb('0x2'))['EventEmitter'];var AGIReply=require('./reply');var AGIError=require('./error');function AGIChannel(_0x4c5975){var _0x206f9c=this,_0x16a194=new AGIReply(),_0x7bb002=![],_0x55f663={};EventEmitter[_0x49cb('0x3')](_0x206f9c);_0x4c5975[_0x49cb('0x4')](_0x49cb('0x5'));_0x4c5975[_0x49cb('0x6')](0x8*0x3c*0x3c*0x3e8);_0x16a194['setEncoding']('utf8');_0x16a194['on'](_0x49cb('0x7'),function(_0x4770c6){for(var _0x11017a in _0x4770c6){_0x206f9c[_0x11017a]=_0x4770c6[_0x11017a];}_0x206f9c[_0x49cb('0x8')](_0x49cb('0x9'));});_0x16a194['on'](_0x49cb('0xa'),function(_0x1c3c76){if(_0x1c3c76[_0x49cb('0xb')]()=='hangup'){_0x206f9c[_0x49cb('0x8')]('hangup');return;}if(_0x1c3c76[_0x49cb('0xc')](0x0,0xb)=='520-Invalid'){_0x7bb002=!![];}if(_0x7bb002){_0x55f663['rx']+=_0x1c3c76+'\x0a';if(_0x1c3c76['search'](_0x49cb('0xd'))!=-0x1){_0x7bb002=![];}}else{_0x55f663['rx']=_0x1c3c76;}if(_0x7bb002){return;}if(typeof _0x55f663['cb']=='function'){var _0x29058d=_0x55f663['rx']['substring'](0x0,0x3),_0x5288b4=null,_0xded295=null;_0x29058d=parseInt(_0x29058d);if(isNaN(_0x29058d)){_0x55f663['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x49cb('0xe')});return;}if(_0x29058d!=0xc8){_0x55f663['cb'](null,{'code':_0x29058d,'result':-0x1,'extra':'KO'});return;}_0x5288b4=_0x55f663['rx'][_0x49cb('0xc')](0x4)[_0x49cb('0xf')]('result=','');if(_0x5288b4[_0x49cb('0x10')]('\x20')!=-0x1){_0x5288b4=_0x5288b4[_0x49cb('0x11')](0x0,_0x5288b4['indexOf']('\x20'));}if(_['startsWith'](_0x5288b4,'-1')){_0x5288b4=parseInt(_0x5288b4);}_0xded295=_0x55f663['rx'][_0x49cb('0x12')]('\x20');if(_0xded295[_0x49cb('0x13')]==0x3){_0xded295=_0xded295[0x2][_0x49cb('0xc')](0x1,_0xded295[0x2][_0x49cb('0x13')]-0x1);}else if(_0xded295[_0x49cb('0x13')]>0x3){var _0x3d058e=/\((.+)\)/;var _0x1038ef=_0x55f663['rx'][_0x49cb('0x14')](_0x3d058e);if(_0x1038ef){_0xded295=_0x1038ef[0x1];}else{_0xded295=null;}}else{_0xded295=null;}_0x55f663['cb'](null,{'code':_0x29058d,'result':_0x5288b4,'extra':_0xded295});}});_0x4c5975['on']('error',function(_0x5eec57){_0x206f9c[_0x49cb('0x8')](_0x49cb('0x15'),new AGIError('E_AGI_SOCKET_ERROR',_0x5eec57['code']));});_0x4c5975['on']('close',function(){_0x206f9c[_0x49cb('0x8')](_0x49cb('0x16'),new AGIError('E_AGI_SOCKET_CLOSE'));});_0x4c5975['on']('timeout',function(){_0x206f9c[_0x49cb('0x8')](_0x49cb('0x17'),new AGIError(_0x49cb('0x18')));_0x4c5975[_0x49cb('0x19')]();});_0x4c5975[_0x49cb('0x1a')](_0x16a194);this[_0x49cb('0x1b')]=function(_0x41e862,_0x505674){var _0x41e862=_0x41e862||'',_0x505674=typeof _0x505674==_0x49cb('0x1c')?_0x505674:new Function();_0x55f663={'tx':_0x41e862,'rx':'','cb':_0x505674};_0x4c5975[_0x49cb('0x1d')](_0x41e862+'\x0a');},this['close']=function(){_0x4c5975[_0x49cb('0x19')]();};}util[_0x49cb('0x1e')](AGIChannel,EventEmitter);AGIChannel[_0x49cb('0x1f')][_0x49cb('0x20')]=function(_0x2ae9d9){return this[_0x49cb('0x1b')][_0x49cb('0x21')](this,_0x2ae9d9);};AGIChannel['prototype']['answer']=function(){return this['sendRequest'](_0x49cb('0x22'));};AGIChannel['prototype'][_0x49cb('0x23')]=function(_0x2d4d16,_0x3b68e6,_0x29ce33){_0x2d4d16=_0x2d4d16===undefined?_0x49cb('0x24'):_0x2d4d16;_0x3b68e6=_0x3b68e6===undefined?'5':_0x3b68e6;_0x29ce33=_0x29ce33===undefined?'1':_0x29ce33;return this['sendRequest'](util['format']('GET\x20DATA\x20\x22%s\x22\x20%s\x20%s',_0x2d4d16,_0x3b68e6*0x3e8,_0x29ce33));};AGIChannel[_0x49cb('0x1f')]['noop']=function(_0x3c4fee){_0x3c4fee=_0x3c4fee||_0x49cb('0x25');return this[_0x49cb('0x20')](util[_0x49cb('0x26')](_0x49cb('0x27'),_0x3c4fee));};AGIChannel[_0x49cb('0x1f')][_0x49cb('0x28')]=function(_0x1ca58c,_0x5ec899){if(_[_0x49cb('0x29')](_0x5ec899)){return this[_0x49cb('0x20')](util['format'](_0x49cb('0x2a'),_0x1ca58c,_0x5ec899[_0x49cb('0x2b')](',')));}return this[_0x49cb('0x20')](util[_0x49cb('0x26')]('EXEC\x20%s\x20%s',_0x1ca58c,_0x5ec899));};AGIChannel['prototype'][_0x49cb('0x2c')]=function(_0x383e7b){return this[_0x49cb('0x20')](util[_0x49cb('0x26')](_0x49cb('0x2d'),_0x383e7b));};AGIChannel[_0x49cb('0x1f')]['setExtension']=function(_0x33bf63){return this[_0x49cb('0x20')](util[_0x49cb('0x26')](_0x49cb('0x2e'),_0x33bf63));};AGIChannel[_0x49cb('0x1f')][_0x49cb('0x2f')]=function(_0x3f2bee){return this['sendRequest'](util[_0x49cb('0x26')](_0x49cb('0x30'),_0x3f2bee));};AGIChannel['prototype'][_0x49cb('0x31')]=function(){return this['sendRequest']('HANGUP');};AGIChannel[_0x49cb('0x1f')][_0x49cb('0x32')]=function(_0x409c46,_0xc1c4d5){var _0x41bdce=_['isBoolean'](_0xc1c4d5)||_[_0x49cb('0x33')](_0xc1c4d5)?_0xc1c4d5['toString']():_0xc1c4d5;return this[_0x49cb('0x20')](util[_0x49cb('0x26')](_0x49cb('0x34'),_0x409c46,_0x41bdce?_0x41bdce[_0x49cb('0x35')]()[_0x49cb('0xf')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel['prototype'][_0x49cb('0x36')]=function(_0x448dd0,_0x498381){return this['sendRequest'](util['format'](_0x49cb('0x37'),_0x448dd0,_0x498381));};AGIChannel['prototype'][_0x49cb('0x38')]=function(_0x355419,_0x5aac90){return this[_0x49cb('0x20')](util[_0x49cb('0x26')]('SAY\x20DIGITS\x20%s\x20%s',_0x355419,_0x5aac90));};AGIChannel[_0x49cb('0x1f')][_0x49cb('0x39')]=function(_0x247705,_0xe3dfd4){return this[_0x49cb('0x20')](util[_0x49cb('0x26')]('SAY\x20PHONETIC\x20\x22%s\x22\x20%s',_0x247705,_0xe3dfd4));};AGIChannel[_0x49cb('0x1f')][_0x49cb('0x3a')]=function(_0x9ea72d,_0x37567a,_0x31f28f){_0x37567a=_0x37567a||this[_0x49cb('0x3b')];_0x31f28f=_0x31f28f||0x1;this[_0x49cb('0x2c')](_0x9ea72d);this[_0x49cb('0x3c')](_0x37567a);this[_0x49cb('0x2f')](_0x31f28f);return this[_0x49cb('0x3d')](util[_0x49cb('0x26')]('GOTO\x20%s\x20%s\x20%s',_0x9ea72d,_0x37567a,_0x31f28f));};AGIChannel[_0x49cb('0x1f')]['getVariable']=function(_0x44854c){return this[_0x49cb('0x20')](util[_0x49cb('0x26')]('GET\x20VARIABLE\x20\x22%s\x22',_0x44854c));};AGIChannel['prototype'][_0x49cb('0x3e')]=function(_0x3da09b,_0x54d525,_0x251fd0,_0x2cd8e3,_0x2e1b61,_0x42e0a5){_0x54d525=_0x54d525||_0x49cb('0x3f');_0x251fd0=_0x251fd0||'';_0x2cd8e3=_0x2cd8e3===undefined?-0x1:_0x2cd8e3==='-1'?-0x1:_0x2cd8e3*0x3e8;_0x2e1b61=_0x2e1b61===undefined?'':'s='+_0x2e1b61;_0x42e0a5=_0x42e0a5?_0x49cb('0x40'):'';return this[_0x49cb('0x20')](util['format']('RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s',_0x3da09b,_0x54d525,_0x251fd0,_0x2cd8e3,_0x42e0a5,_0x2e1b61));};AGIChannel['prototype'][_0x49cb('0x41')]=function(_0x59c7fa,_0x4a49eb){_0x4a49eb=_0x4a49eb||'';return this['sendRequest'](util[_0x49cb('0x26')](_0x49cb('0x42'),_0x59c7fa,_0x4a49eb));};AGIChannel[_0x49cb('0x1f')][_0x49cb('0x43')]=function(_0x24f750){return this['exec']('AGI',_0x24f750);};AGIChannel[_0x49cb('0x1f')]['wait']=function(_0x4b5d35){return this[_0x49cb('0x28')]('WAIT',_0x4b5d35);};AGIChannel['prototype'][_0x49cb('0x15')]=function(_0x51f70f,_0x380756){this[_0x49cb('0x3d')](util[_0x49cb('0x26')](_0x49cb('0x44'),_0x51f70f['id'],_0x51f70f['label'],_0x380756));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x49cb('0x45')]=AGIChannel; \ No newline at end of file +var _0xe091=['noop','NO\x20MESSAGE','format','VERBOSE\x20\x22%s\x22','exec','isArray','EXEC\x20%s\x20%s','join','SET\x20CONTEXT\x20%s','SET\x20PRIORITY\x20%s','setVariable','isBoolean','SET\x20VARIABLE\x20%s\x20\x22%s\x22','toString','sayNumber','SAY\x20NUMBER\x20%s\x20%s','SAY\x20DIGITS\x20%s\x20%s','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','extension','setContext','setExtension','setPriority','GOTO\x20%s\x20%s\x20%s','getVariable','GET\x20VARIABLE\x20\x22%s\x22','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','AGI','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','exports','util','lodash','events','./reply','./error','call','setEncoding','utf8','setTimeout','headers','emit','ready','line','toLowerCase','hangup','substring','520-Invalid','520\x20End\x20of\x20proper','no\x20code','replace','indexOf','substr','split','length','match','error','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','function','write','inherits','sendRequest','command','prototype','answer','ANSWER','getData','beep','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s'];(function(_0x16725c,_0x530fb9){var _0x385d95=function(_0x3106d7){while(--_0x3106d7){_0x16725c['push'](_0x16725c['shift']());}};_0x385d95(++_0x530fb9);}(_0xe091,0x1ad));var _0x1e09=function(_0x51a07c,_0x57abf7){_0x51a07c=_0x51a07c-0x0;var _0x5e78cb=_0xe091[_0x51a07c];return _0x5e78cb;};'use strict';var util=require(_0x1e09('0x0'));var _=require(_0x1e09('0x1'));var EventEmitter=require(_0x1e09('0x2'))['EventEmitter'];var AGIReply=require(_0x1e09('0x3'));var AGIError=require(_0x1e09('0x4'));function AGIChannel(_0x242280){var _0x4e0879=this,_0x1a43af=new AGIReply(),_0x110900=![],_0x1d9cc4={};EventEmitter[_0x1e09('0x5')](_0x4e0879);_0x242280[_0x1e09('0x6')](_0x1e09('0x7'));_0x242280[_0x1e09('0x8')](0x8*0x3c*0x3c*0x3e8);_0x1a43af[_0x1e09('0x6')]('utf8');_0x1a43af['on'](_0x1e09('0x9'),function(_0x97eefb){for(var _0x18375b in _0x97eefb){_0x4e0879[_0x18375b]=_0x97eefb[_0x18375b];}_0x4e0879[_0x1e09('0xa')](_0x1e09('0xb'));});_0x1a43af['on'](_0x1e09('0xc'),function(_0x4cb92c){if(_0x4cb92c[_0x1e09('0xd')]()==_0x1e09('0xe')){_0x4e0879['emit'](_0x1e09('0xe'));return;}if(_0x4cb92c[_0x1e09('0xf')](0x0,0xb)==_0x1e09('0x10')){_0x110900=!![];}if(_0x110900){_0x1d9cc4['rx']+=_0x4cb92c+'\x0a';if(_0x4cb92c['search'](_0x1e09('0x11'))!=-0x1){_0x110900=![];}}else{_0x1d9cc4['rx']=_0x4cb92c;}if(_0x110900){return;}if(typeof _0x1d9cc4['cb']=='function'){var _0x35f768=_0x1d9cc4['rx'][_0x1e09('0xf')](0x0,0x3),_0x25c61b=null,_0x41ffa5=null;_0x35f768=parseInt(_0x35f768);if(isNaN(_0x35f768)){_0x1d9cc4['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x1e09('0x12')});return;}if(_0x35f768!=0xc8){_0x1d9cc4['cb'](null,{'code':_0x35f768,'result':-0x1,'extra':'KO'});return;}_0x25c61b=_0x1d9cc4['rx'][_0x1e09('0xf')](0x4)[_0x1e09('0x13')]('result=','');if(_0x25c61b[_0x1e09('0x14')]('\x20')!=-0x1){_0x25c61b=_0x25c61b[_0x1e09('0x15')](0x0,_0x25c61b['indexOf']('\x20'));}if(_['startsWith'](_0x25c61b,'-1')){_0x25c61b=parseInt(_0x25c61b);}_0x41ffa5=_0x1d9cc4['rx'][_0x1e09('0x16')]('\x20');if(_0x41ffa5[_0x1e09('0x17')]==0x3){_0x41ffa5=_0x41ffa5[0x2]['substring'](0x1,_0x41ffa5[0x2][_0x1e09('0x17')]-0x1);}else if(_0x41ffa5['length']>0x3){var _0x42455e=/\((.+)\)/;var _0x3fda78=_0x1d9cc4['rx'][_0x1e09('0x18')](_0x42455e);if(_0x3fda78){_0x41ffa5=_0x3fda78[0x1];}else{_0x41ffa5=null;}}else{_0x41ffa5=null;}_0x1d9cc4['cb'](null,{'code':_0x35f768,'result':_0x25c61b,'extra':_0x41ffa5});}});_0x242280['on'](_0x1e09('0x19'),function(_0x3408a3){_0x4e0879[_0x1e09('0xa')](_0x1e09('0x19'),new AGIError(_0x1e09('0x1a'),_0x3408a3[_0x1e09('0x1b')]));});_0x242280['on']('close',function(){_0x4e0879[_0x1e09('0xa')](_0x1e09('0x1c'),new AGIError(_0x1e09('0x1d')));});_0x242280['on'](_0x1e09('0x1e'),function(){_0x4e0879[_0x1e09('0xa')]('timeout',new AGIError(_0x1e09('0x1f')));_0x242280[_0x1e09('0x20')]();});_0x242280[_0x1e09('0x21')](_0x1a43af);this['command']=function(_0x239ea1,_0x17f81d){var _0x239ea1=_0x239ea1||'',_0x17f81d=typeof _0x17f81d==_0x1e09('0x22')?_0x17f81d:new Function();_0x1d9cc4={'tx':_0x239ea1,'rx':'','cb':_0x17f81d};_0x242280[_0x1e09('0x23')](_0x239ea1+'\x0a');},this[_0x1e09('0x1c')]=function(){_0x242280[_0x1e09('0x20')]();};}util[_0x1e09('0x24')](AGIChannel,EventEmitter);AGIChannel['prototype'][_0x1e09('0x25')]=function(_0x449554){return this[_0x1e09('0x26')]['sync'](this,_0x449554);};AGIChannel[_0x1e09('0x27')][_0x1e09('0x28')]=function(){return this['sendRequest'](_0x1e09('0x29'));};AGIChannel['prototype'][_0x1e09('0x2a')]=function(_0x39b7b9,_0x183c66,_0x255616){_0x39b7b9=_0x39b7b9===undefined?_0x1e09('0x2b'):_0x39b7b9;_0x183c66=_0x183c66===undefined?'5':_0x183c66;_0x255616=_0x255616===undefined?'1':_0x255616;return this[_0x1e09('0x25')](util['format'](_0x1e09('0x2c'),_0x39b7b9,_0x183c66*0x3e8,_0x255616));};AGIChannel[_0x1e09('0x27')][_0x1e09('0x2d')]=function(_0x25475a){_0x25475a=_0x25475a||_0x1e09('0x2e');return this[_0x1e09('0x25')](util[_0x1e09('0x2f')](_0x1e09('0x30'),_0x25475a));};AGIChannel[_0x1e09('0x27')][_0x1e09('0x31')]=function(_0x6e0b41,_0x13e3db){if(_[_0x1e09('0x32')](_0x13e3db)){return this[_0x1e09('0x25')](util['format'](_0x1e09('0x33'),_0x6e0b41,_0x13e3db[_0x1e09('0x34')](',')));}return this['sendRequest'](util[_0x1e09('0x2f')]('EXEC\x20%s\x20%s',_0x6e0b41,_0x13e3db));};AGIChannel[_0x1e09('0x27')]['setContext']=function(_0x37cd5d){return this[_0x1e09('0x25')](util[_0x1e09('0x2f')](_0x1e09('0x35'),_0x37cd5d));};AGIChannel['prototype']['setExtension']=function(_0x565f3d){return this[_0x1e09('0x25')](util[_0x1e09('0x2f')]('SET\x20EXTENSION\x20%s',_0x565f3d));};AGIChannel[_0x1e09('0x27')]['setPriority']=function(_0x47bf8){return this[_0x1e09('0x25')](util[_0x1e09('0x2f')](_0x1e09('0x36'),_0x47bf8));};AGIChannel[_0x1e09('0x27')][_0x1e09('0xe')]=function(){return this[_0x1e09('0x25')]('HANGUP');};AGIChannel['prototype'][_0x1e09('0x37')]=function(_0x1c61ab,_0x52d6f9){var _0x9b278c=_[_0x1e09('0x38')](_0x52d6f9)||_['isNumber'](_0x52d6f9)?_0x52d6f9['toString']():_0x52d6f9;return this[_0x1e09('0x25')](util['format'](_0x1e09('0x39'),_0x1c61ab,_0x9b278c?_0x9b278c[_0x1e09('0x3a')]()['replace'](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x1e09('0x27')][_0x1e09('0x3b')]=function(_0xfcbd71,_0x3db96e){return this[_0x1e09('0x25')](util[_0x1e09('0x2f')](_0x1e09('0x3c'),_0xfcbd71,_0x3db96e));};AGIChannel['prototype']['sayDigits']=function(_0x4bb7fd,_0x26bce1){return this[_0x1e09('0x25')](util[_0x1e09('0x2f')](_0x1e09('0x3d'),_0x4bb7fd,_0x26bce1));};AGIChannel[_0x1e09('0x27')][_0x1e09('0x3e')]=function(_0x1d8892,_0x1c4a9c){return this['sendRequest'](util['format'](_0x1e09('0x3f'),_0x1d8892,_0x1c4a9c));};AGIChannel[_0x1e09('0x27')]['continueAt']=function(_0x344357,_0x312cc2,_0x466ec6){_0x312cc2=_0x312cc2||this[_0x1e09('0x40')];_0x466ec6=_0x466ec6||0x1;this[_0x1e09('0x41')](_0x344357);this[_0x1e09('0x42')](_0x312cc2);this[_0x1e09('0x43')](_0x466ec6);return this[_0x1e09('0x2d')](util[_0x1e09('0x2f')](_0x1e09('0x44'),_0x344357,_0x312cc2,_0x466ec6));};AGIChannel['prototype'][_0x1e09('0x45')]=function(_0x2c33a5){return this[_0x1e09('0x25')](util[_0x1e09('0x2f')](_0x1e09('0x46'),_0x2c33a5));};AGIChannel[_0x1e09('0x27')]['recordFile']=function(_0x38264c,_0x4d8782,_0x3c09b7,_0x3c042c,_0xe257ca,_0xcbecf){_0x4d8782=_0x4d8782||'wav';_0x3c09b7=_0x3c09b7||'';_0x3c042c=_0x3c042c===undefined?-0x1:_0x3c042c==='-1'?-0x1:_0x3c042c*0x3e8;_0xe257ca=_0xe257ca===undefined?'':'s='+_0xe257ca;_0xcbecf=_0xcbecf?'BEEP':'';return this[_0x1e09('0x25')](util[_0x1e09('0x2f')](_0x1e09('0x47'),_0x38264c,_0x4d8782,_0x3c09b7,_0x3c042c,_0xcbecf,_0xe257ca));};AGIChannel['prototype']['streamFile']=function(_0x19dc95,_0x321f9a){_0x321f9a=_0x321f9a||'';return this[_0x1e09('0x25')](util['format'](_0x1e09('0x48'),_0x19dc95,_0x321f9a));};AGIChannel[_0x1e09('0x27')][_0x1e09('0x49')]=function(_0x3dbc99){return this[_0x1e09('0x31')](_0x1e09('0x4a'),_0x3dbc99);};AGIChannel['prototype'][_0x1e09('0x4b')]=function(_0x1823ba){return this[_0x1e09('0x31')](_0x1e09('0x4c'),_0x1823ba);};AGIChannel[_0x1e09('0x27')][_0x1e09('0x19')]=function(_0x4c3d2d,_0x2b7e5c){this[_0x1e09('0x2d')](util[_0x1e09('0x2f')](_0x1e09('0x4d'),_0x4c3d2d['id'],_0x4c3d2d['label'],_0x2b7e5c));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x1e09('0x4e')]=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index 6f84b6b..54cfc68 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 _0x7db8=['push','format','apply','name','util','Undefined\x20error.','Server\x20error.\x20Code:\x20%s.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_UNDEFINED'];(function(_0x5b6d0c,_0x4467cb){var _0x292fa1=function(_0x3abdc3){while(--_0x3abdc3){_0x5b6d0c['push'](_0x5b6d0c['shift']());}};_0x292fa1(++_0x4467cb);}(_0x7db8,0xac));var _0x87db=function(_0x37f28a,_0x384771){_0x37f28a=_0x37f28a-0x0;var _0x13c8da=_0x7db8[_0x37f28a];return _0x13c8da;};'use strict';var util=require(_0x87db('0x0'));var error={'E_AGI_UNDEFINED':_0x87db('0x1'),'E_AGI_ARGUMENT_PORT':'Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','E_AGI_SERVER_ERROR':_0x87db('0x2'),'E_AGI_SERVER_CLOSE':'Server\x20closed.','E_AGI_SERVER_MAXCONNECTION':_0x87db('0x3'),'E_AGI_SERVER_VOICE_DISABLED':'[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','E_AGI_SOCKET_ERROR':'Socket\x20error.\x20Code:\x20%s.','E_AGI_SOCKET_CLOSE':_0x87db('0x4'),'E_AGI_SOCKET_TIMEOUT':_0x87db('0x5'),'E_AGI_COMMAND_EMPTY':'Empty\x20command.','E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x87db('0x6'),'E_AGI_IVR_ENTRY':'Missing\x20\x27ivr.entry\x27\x20menu.'};function AGIError(_0x4c2395){var _0x4c2395=_0x4c2395||null,_0x52618c=_0x52618c||[],_0x3c8515=0x1,_0x386338='';if(!error[_0x4c2395]){_0x4c2395=_0x87db('0x7');}_0x52618c[_0x87db('0x8')](error[_0x4c2395]);while(arguments[_0x3c8515]){_0x52618c['push'](arguments[_0x3c8515]);_0x3c8515++;}_0x386338=util[_0x87db('0x9')][_0x87db('0xa')](util,_0x52618c);this['message']=_0x386338;this[_0x87db('0xb')]=_0x4c2395;}module['exports']=AGIError; \ No newline at end of file +var _0x6047=['Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','E_AGI_UNDEFINED','push','format','exports','util'];(function(_0x3a8dc1,_0x2f03b8){var _0x4b3595=function(_0x1c19e7){while(--_0x1c19e7){_0x3a8dc1['push'](_0x3a8dc1['shift']());}};_0x4b3595(++_0x2f03b8);}(_0x6047,0xa8));var _0x7604=function(_0x1e4339,_0x354818){_0x1e4339=_0x1e4339-0x0;var _0x5bc910=_0x6047[_0x1e4339];return _0x5bc910;};'use strict';var util=require(_0x7604('0x0'));var error={'E_AGI_UNDEFINED':'Undefined\x20error.','E_AGI_ARGUMENT_PORT':_0x7604('0x1'),'E_AGI_SERVER_ERROR':'Server\x20error.\x20Code:\x20%s.','E_AGI_SERVER_CLOSE':_0x7604('0x2'),'E_AGI_SERVER_MAXCONNECTION':_0x7604('0x3'),'E_AGI_SERVER_VOICE_DISABLED':_0x7604('0x4'),'E_AGI_SOCKET_ERROR':_0x7604('0x5'),'E_AGI_SOCKET_CLOSE':_0x7604('0x6'),'E_AGI_SOCKET_TIMEOUT':_0x7604('0x7'),'E_AGI_COMMAND_EMPTY':_0x7604('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(_0x266bd6){var _0x266bd6=_0x266bd6||null,_0x37b843=_0x37b843||[],_0x4b32e8=0x1,_0x529553='';if(!error[_0x266bd6]){_0x266bd6=_0x7604('0x9');}_0x37b843['push'](error[_0x266bd6]);while(arguments[_0x4b32e8]){_0x37b843[_0x7604('0xa')](arguments[_0x4b32e8]);_0x4b32e8++;}_0x529553=util[_0x7604('0xb')]['apply'](util,_0x37b843);this['message']=_0x529553;this['name']=_0x266bd6;}module[_0x7604('0xc')]=AGIError; \ No newline at end of file diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js index ce5455c..262f151 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 _0x7204=['condition','split','vswitch','target','default','agicommand','default\x20on\x20switch\x20not\x20found','max\x20retry\x20reach','condition\x20not\x20found','exports','lodash','../../../config/logger','agi','menu','getdigits','getsecretdigits','edges','prototype','addVertex','vertices','addEdge','push','size','relations','traverseBFS','no\x20vertex\x20found','info','stop\x20traverse','length','no\x20edge/s\x20available'];(function(_0x288ef0,_0x134cfc){var _0x26ab9f=function(_0x511c09){while(--_0x511c09){_0x288ef0['push'](_0x288ef0['shift']());}};_0x26ab9f(++_0x134cfc);}(_0x7204,0x136));var _0x4720=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x7204[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x4720('0x0'));var logger=require(_0x4720('0x1'))(_0x4720('0x2'));var verticesWithRetry=[_0x4720('0x3'),_0x4720('0x4'),_0x4720('0x5')];var Graph=function(){this['vertices']={};this[_0x4720('0x6')]={};this['numberOfEdges']=0x0;};Graph[_0x4720('0x7')][_0x4720('0x8')]=function(_0x44c27b){this[_0x4720('0x9')][_0x44c27b['id']]=_0x44c27b;this['edges'][_0x44c27b['id']]=[];};Graph[_0x4720('0x7')][_0x4720('0xa')]=function(_0x3e063e,_0x5bc17e,_0x319b8c){this[_0x4720('0x6')][_0x3e063e][_0x4720('0xb')]({'target':_0x5bc17e,'condition':_0x319b8c});this['numberOfEdges']+=0x1;};Graph[_0x4720('0x7')][_0x4720('0xc')]=function(){return _[_0x4720('0xc')](this[_0x4720('0x9')]);};Graph[_0x4720('0x7')][_0x4720('0xd')]=function(){return this['numberOfEdges'];};Graph[_0x4720('0x7')]['getVertex']=function(_0x38c956){return this[_0x4720('0x9')][_0x38c956];};Graph[_0x4720('0x7')][_0x4720('0xe')]=function(_0x3b98f5,_0x750b85){if(!this['vertices'][_0x3b98f5]){return logger['info'](_0x4720('0xf'));}var _0x2a98e5=_0x750b85(this[_0x4720('0x9')][_0x3b98f5]);if(!_0x2a98e5){return logger[_0x4720('0x10')](_0x4720('0x11'));}if(this[_0x4720('0x6')][_0x3b98f5][_0x4720('0x12')]===0x0){return logger['info'](_0x4720('0x13'));}for(var _0xac95a1=0x0,_0x1df0a0=[],_0x7d132c=![];_0xac95a1\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','dnid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','callerid','evtHangup','toJson','mxGraphModel','hasOwnProperty','retry','maxRetry','addVertex','omit','length','source','target','addEdge','value','then','catch','createSquareReport','indexOf','agi_','inspect','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','timeout','production','start','joinAt','YYYY-MM-DD\x20HH:mm:ss','mxCell','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','clear','debug','vertex','agicommand','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','code','result','agicommand\x20not\x20found','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','isUndefined','toString','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','close','Project\x20%s\x20not\x20found','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]'];(function(_0x5bc7b9,_0xb0772f){var _0x5e52fe=function(_0x343e0a){while(--_0x343e0a){_0x5bc7b9['push'](_0x5bc7b9['shift']());}};_0x5e52fe(++_0xb0772f);}(_0x6940,0x1c0));var _0x0694=function(_0x53daaa,_0x4e55f0){_0x53daaa=_0x53daaa-0x0;var _0x39f6a2=_0x6940[_0x53daaa];return _0x39f6a2;};'use strict';var parser=require('xml2json');var _=require('lodash');var syncho=require('syncho');var util=require(_0x0694('0x0'));var moment=require(_0x0694('0x1'));var config=require('../../config/environment');var logger=require('../../config/logger')(_0x0694('0x2'));var utilLicense=require(_0x0694('0x3'));var rpc=require(_0x0694('0x4'));var mailRpc=require('./mailRpc');var Graph=require(_0x0694('0x5'));var Vertices=require(_0x0694('0x6'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0x0694('0x2')]=_[_0x0694('0x7')](config['agi'],{'ip':_0x0694('0x8'),'port':0x11dd});function connectionHandler(_0x4ddddd){process['nextTick'](function(){syncho(function(){try{setChannelVariables(_0x4ddddd);agiHandler(_0x4ddddd);}catch(_0x3cee22){logger['error'](_0x3cee22[_0x0694('0x9')]);}});});}function listeningHandler(){console[_0x0694('0xa')](_0x0694('0xb'),config[_0x0694('0x2')]['port']);logger[_0x0694('0xc')](util[_0x0694('0xd')](_0x0694('0xe'),config[_0x0694('0x2')]['ip'],config[_0x0694('0x2')][_0x0694('0xf')]));}function errorHandler(_0xc938ef){if(_0xc938ef&&_0xc938ef[_0x0694('0x10')]&&_0xc938ef['message']){logger[_0x0694('0x11')](util[_0x0694('0xd')](_0x0694('0x12'),_0xc938ef['name'],_0xc938ef['message']));}else{logger[_0x0694('0x11')](util[_0x0694('0xd')](_0x0694('0x13'),_0xc938ef[_0x0694('0x9')]));}}function closeHandler(){logger[_0x0694('0xc')](util[_0x0694('0xd')](_0x0694('0x14'),this[_0x0694('0x15')],this[_0x0694('0x16')],this['callerid'],this['dnid'],this[_0x0694('0x17')]));try{createSquareReport(this);}catch(_0x5ecc8f){logger['error'](_0x5ecc8f[_0x0694('0x9')]);}}function timeoutHandler(){logger[_0x0694('0xc')](util[_0x0694('0xd')](_0x0694('0x18'),this[_0x0694('0x15')],this['calleridname'],this['callerid'],this[_0x0694('0x19')],this['uniqueid']));}function hangupHandler(){logger['info'](util[_0x0694('0xd')](_0x0694('0x1a'),this[_0x0694('0x15')],this[_0x0694('0x16')],this[_0x0694('0x1b')],this[_0x0694('0x19')],this[_0x0694('0x17')]));this[_0x0694('0x1c')]=!![];}function getRoot(_0x2a5caf){return parser[_0x0694('0x1d')](_0x2a5caf,{'object':!![]})[_0x0694('0x1e')]['root'];}function addVertex(_0x146627,_0x483142,_0x3b3321){_0x483142['agicommand']=_0x3b3321;if(_0x483142[_0x0694('0x1f')](_0x0694('0x20'))){_0x483142[_0x0694('0x21')]=parseInt(_0x483142['retry'],0xa);}_0x146627[_0x0694('0x22')](_[_0x0694('0x23')](_0x483142,'mxCell'));}function initGraph(_0x1f7df1,_0x297b55){var _0x46ae4a=new Graph();for(var _0x4a0648 in _0x1f7df1){if(_0x1f7df1[_0x0694('0x1f')](_0x4a0648)){if(_['isArray'](_0x1f7df1[_0x4a0648])){for(var _0x166efc=0x0;_0x166efc<_0x1f7df1[_0x4a0648][_0x0694('0x24')];_0x166efc+=0x1){addVertex(_0x46ae4a,_0x1f7df1[_0x4a0648][_0x166efc],_0x4a0648);}}else{addVertex(_0x46ae4a,_0x1f7df1[_0x4a0648],_0x4a0648);}}}for(var _0x9f732e=0x0;_0x9f732e<_0x297b55['length'];_0x9f732e+=0x1){if(_0x297b55[_0x9f732e][_0x0694('0x25')]&&_0x297b55[_0x9f732e][_0x0694('0x26')]){_0x46ae4a[_0x0694('0x27')](_0x297b55[_0x9f732e][_0x0694('0x25')],_0x297b55[_0x9f732e]['target'],_0x297b55[_0x9f732e][_0x0694('0x28')]);}}return _0x46ae4a;}function getSquareProject(_0x2bdb21,_0x1541d9){rpc['getSquareProject'](_0x2bdb21)[_0x0694('0x29')](function(_0x1f89a8){_0x1541d9(null,_0x1f89a8);})[_0x0694('0x2a')](function(_0x5df18c){_0x1541d9(null,_0x5df18c);});}function createSquareReport(_0x33d950,_0x198e46){rpc[_0x0694('0x2b')](_0x33d950)[_0x0694('0x29')](function(_0x389ae3){if(_0x198e46){_0x198e46(null,_0x389ae3);}})[_0x0694('0x2a')](function(_0xdcf0ae){if(_0x198e46){_0x198e46(null,_0xdcf0ae);}});}function setChannelVariables(_0x4721fc){for(var _0xe86b3a in _0x4721fc){if(_0x4721fc[_0x0694('0x1f')](_0xe86b3a)){if(_0xe86b3a[_0x0694('0x2c')](_0x0694('0x2d'))===0x0){_0x4721fc[_0xe86b3a['substring'](0x4)]=_0x4721fc[_0xe86b3a];delete _0x4721fc[_0xe86b3a];}}}}function getLogFromObject(_0x453e2d){return util[_0x0694('0x2e')](_0x453e2d,{'showHidden':![],'depth':null});}function agiHandler(_0x22cabf){var _0x73eada,_0x5ed4a8,_0x5ddbbb,_0x3e6173,_0x260402;logger['debug'](_0x0694('0x2f'),JSON[_0x0694('0x30')](_0x22cabf,null,0x2));logger[_0x0694('0xc')](util['format'](_0x0694('0x31'),_0x22cabf['arg_1'],_0x22cabf[_0x0694('0x16')],_0x22cabf[_0x0694('0x1b')],_0x22cabf[_0x0694('0x19')],_0x22cabf['uniqueid']));_0x22cabf['on'](_0x0694('0x11'),errorHandler);_0x22cabf['on']('close',closeHandler);_0x22cabf['on'](_0x0694('0x32'),timeoutHandler);_0x22cabf['evtHangup']=![];_0x22cabf['on']('hangup',hangupHandler);var _0x153baf=getSquareProject['sync'](null,_0x22cabf[_0x0694('0x15')]);if(_0x153baf){if(_0x153baf[_0x0694('0x33')]){_0x73eada=getRoot(_0x153baf[_0x0694('0x33')]);if(_0x73eada&&_0x73eada[_0x0694('0x34')]){logger['debug']('root',JSON[_0x0694('0x30')](_0x73eada,null,0x2));_0x22cabf[_0x0694('0x35')]=moment()['format'](_0x0694('0x36'));_0x5ed4a8=initGraph(_[_0x0694('0x23')](_0x73eada,'mxCell'),_0x73eada[_0x0694('0x37')]);_0x5ddbbb=new Vertices(_0x22cabf,rpc,mailRpc);logger['info'](util[_0x0694('0xd')](_0x0694('0x38'),_0x22cabf['arg_1'],_0x22cabf[_0x0694('0x16')],_0x22cabf['callerid'],_0x22cabf[_0x0694('0x19')],_0x22cabf[_0x0694('0x17')]));_0x5ed4a8[_0x0694('0x39')](_0x73eada[_0x0694('0x34')]['id'],function(_0x34ec3c){try{_0x34ec3c=_0x5ddbbb[_0x0694('0x3a')](_0x34ec3c);logger[_0x0694('0x3b')](_0x0694('0x3c'),JSON['stringify'](_0x34ec3c,null,0x2));if(_0x34ec3c[_0x0694('0x3d')]===_0x0694('0x3e')){logger[_0x0694('0xc')](_0x0694('0x3f'));_0x22cabf[_0x0694('0x40')]=_0x34ec3c[_0x0694('0x40')]||_0x22cabf['context'];_0x22cabf[_0x0694('0x41')]=_0x34ec3c['extension'];_0x22cabf['priority']=_0x34ec3c[_0x0694('0x42')]?_0x34ec3c[_0x0694('0x42')]-0x1:0x1;return null;}else if(_0x34ec3c&&_0x5ddbbb[_0x34ec3c[_0x0694('0x3d')]]){_0x260402=_0x5ddbbb[_0x34ec3c[_0x0694('0x3d')]](_0x34ec3c);logger[_0x0694('0xc')](_0x0694('0x43'),JSON[_0x0694('0x30')](_0x260402,null,0x2));if(_0x260402&&_0x260402[_0x0694('0x44')]===AGI_CODE_SUCCESS&&_0x260402['result']!==AGI_RESULT_ERROR&&!_0x22cabf[_0x0694('0x1c')]){logger[_0x0694('0x3b')](_0x0694('0x43'),getLogFromObject(_0x260402));return _['isUndefined'](_0x260402['result'])?null:_0x260402[_0x0694('0x45')]['toString']();}else{logger[_0x0694('0x11')](_0x0694('0x43'),getLogFromObject(_0x260402));return null;}}else{logger['error'](_0x0694('0x46'));return null;}}catch(_0x4281bd){logger['error'](_0x4281bd[_0x0694('0x9')]);return null;}});if(_0x73eada[_0x0694('0x47')]){logger[_0x0694('0xc')](util[_0x0694('0xd')](_0x0694('0x48'),_0x22cabf['arg_1'],_0x22cabf[_0x0694('0x16')],_0x22cabf[_0x0694('0x1b')],_0x22cabf[_0x0694('0x19')],_0x22cabf[_0x0694('0x17')]));_0x5ed4a8[_0x0694('0x39')](_0x73eada[_0x0694('0x47')]['id'],function(_0x3ba77c){try{_0x3ba77c=_0x5ddbbb[_0x0694('0x3a')](_0x3ba77c);logger['debug'](_0x0694('0x3c'),JSON[_0x0694('0x30')](_0x3ba77c,null,0x2));if(_0x3ba77c&&_0x5ddbbb[_0x3ba77c[_0x0694('0x3d')]]){_0x260402=_0x5ddbbb[_0x3ba77c['agicommand']](_0x3ba77c);if(_0x260402){logger[_0x0694('0x3b')](_0x0694('0x43'),getLogFromObject(_0x260402));return _[_0x0694('0x49')](_0x260402[_0x0694('0x45')])?null:_0x260402[_0x0694('0x45')][_0x0694('0x4a')]();}else{logger[_0x0694('0x11')](_0x0694('0x43'),getLogFromObject(_0x260402));return null;}}else{logger[_0x0694('0x11')](_0x0694('0x46'));return null;}}catch(_0x48961c){logger[_0x0694('0x11')](_0x48961c['stack']);return null;}});}logger['info'](util['format'](_0x0694('0x4b'),_0x22cabf['arg_1'],_0x22cabf[_0x0694('0x16')],_0x22cabf[_0x0694('0x1b')],_0x22cabf[_0x0694('0x19')],_0x22cabf[_0x0694('0x17')]));logger[_0x0694('0xc')](util[_0x0694('0xd')](_0x0694('0x4c'),_0x22cabf['context'],_0x22cabf[_0x0694('0x41')],parseInt(_0x22cabf['priority'],0xa)+0x1));_0x22cabf[_0x0694('0x4d')](_0x22cabf[_0x0694('0x40')],_0x22cabf['extension'],parseInt(_0x22cabf['priority'],0xa)+0x1);_0x22cabf['close']();}}else{logger[_0x0694('0x11')](util['format']('Project\x20%s\x20not\x20published',_0x22cabf[_0x0694('0x15')]));_0x22cabf[_0x0694('0x4d')](_0x22cabf[_0x0694('0x40')],_0x22cabf[_0x0694('0x41')],parseInt(_0x22cabf[_0x0694('0x42')],0xa)+0x1);_0x22cabf[_0x0694('0x4e')]();}}else{logger['error'](util[_0x0694('0xd')](_0x0694('0x4f'),_0x22cabf['arg_1']));_0x22cabf[_0x0694('0x4d')](_0x22cabf['context'],_0x22cabf['extension'],parseInt(_0x22cabf['priority'],0xa)+0x1);_0x22cabf[_0x0694('0x4e')]();}}function main(){var _0x28f442;return utilLicense[_0x0694('0x50')]()[_0x0694('0x29')](function(_0x34b594){if(_0x34b594){if(_0x34b594[_0x0694('0x51')]){if(_0x34b594['callysquare']&&_0x34b594[_0x0694('0x52')]>0x0){logger[_0x0694('0xc')](util[_0x0694('0xd')](_0x0694('0x53'),_0x34b594['callysquare']));_0x28f442=_0x34b594[_0x0694('0x52')];}else{logger['info'](_0x0694('0x54'));}}else{logger['info']('[LICENSE]\x20VOICE\x20IS\x20DISABLED');_0x28f442=-0x1;}}})[_0x0694('0x2a')](function(_0x431a6f){logger['error'](_0x0694('0x55'),_0x431a6f[_0x0694('0x9')]);})[_0x0694('0x47')](function(){var _0x5c7e91=require(_0x0694('0x56'))(config[_0x0694('0x2')]['port'],config['agi']['ip'],_0x28f442);_0x5c7e91['on'](_0x0694('0x11'),errorHandler);_0x5c7e91['on'](_0x0694('0x57'),listeningHandler);_0x5c7e91['on'](_0x0694('0x58'),connectionHandler);_0x5c7e91['on']('close',closeHandler);});}main(); \ No newline at end of file +var _0x5e18=['source','target','value','getSquareProject','then','catch','createSquareReport','indexOf','agi_','inspect','debug','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','sync','production','start','joinAt','YYYY-MM-DD\x20HH:mm:ss','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','clear','vertex','gotoc\x20block\x20stop\x20traverse\x20BFS','context','priority','response','code','result','toString','agicommand\x20not\x20found','finally','isUndefined','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','extension','Project\x20%s\x20not\x20published','continueAt','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','./server','connection','lodash','syncho','util','moment','../../config/environment','../../config/logger','../../config/license/util','./rpc','./graph','./vertices','agi','defaults','127.0.0.1','stack','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','message','error','[ERROR]\x20%s','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','dnid','[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','uniqueid','evtHangup','toJson','mxGraphModel','root','agicommand','hasOwnProperty','retry','maxRetry','mxCell','isArray','length'];(function(_0x3bcb3a,_0x476e68){var _0x2f5608=function(_0xf5222e){while(--_0xf5222e){_0x3bcb3a['push'](_0x3bcb3a['shift']());}};_0x2f5608(++_0x476e68);}(_0x5e18,0x1ec));var _0x85e1=function(_0x545fb9,_0x17f19a){_0x545fb9=_0x545fb9-0x0;var _0x445c5f=_0x5e18[_0x545fb9];return _0x445c5f;};'use strict';var parser=require('xml2json');var _=require(_0x85e1('0x0'));var syncho=require(_0x85e1('0x1'));var util=require(_0x85e1('0x2'));var moment=require(_0x85e1('0x3'));var config=require(_0x85e1('0x4'));var logger=require(_0x85e1('0x5'))('agi');var utilLicense=require(_0x85e1('0x6'));var rpc=require(_0x85e1('0x7'));var mailRpc=require('./mailRpc');var Graph=require(_0x85e1('0x8'));var Vertices=require(_0x85e1('0x9'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0x85e1('0xa')]=_[_0x85e1('0xb')](config[_0x85e1('0xa')],{'ip':_0x85e1('0xc'),'port':0x11dd});function connectionHandler(_0x2932e5){process['nextTick'](function(){syncho(function(){try{setChannelVariables(_0x2932e5);agiHandler(_0x2932e5);}catch(_0x5c17c2){logger['error'](_0x5c17c2[_0x85e1('0xd')]);}});});}function listeningHandler(){console['log'](_0x85e1('0xe'),config[_0x85e1('0xa')][_0x85e1('0xf')]);logger[_0x85e1('0x10')](util[_0x85e1('0x11')](_0x85e1('0x12'),config[_0x85e1('0xa')]['ip'],config[_0x85e1('0xa')][_0x85e1('0xf')]));}function errorHandler(_0x29fa5a){if(_0x29fa5a&&_0x29fa5a[_0x85e1('0x13')]&&_0x29fa5a[_0x85e1('0x14')]){logger[_0x85e1('0x15')](util['format']('[%s]\x20%s',_0x29fa5a[_0x85e1('0x13')],_0x29fa5a['message']));}else{logger[_0x85e1('0x15')](util[_0x85e1('0x11')](_0x85e1('0x16'),_0x29fa5a['stack']));}}function closeHandler(){logger[_0x85e1('0x10')](util[_0x85e1('0x11')](_0x85e1('0x17'),this[_0x85e1('0x18')],this[_0x85e1('0x19')],this[_0x85e1('0x1a')],this[_0x85e1('0x1b')],this['uniqueid']));try{createSquareReport(this);}catch(_0xe84149){logger['error'](_0xe84149['stack']);}}function timeoutHandler(){logger['info'](util[_0x85e1('0x11')](_0x85e1('0x1c'),this[_0x85e1('0x18')],this[_0x85e1('0x19')],this[_0x85e1('0x1a')],this[_0x85e1('0x1b')],this['uniqueid']));}function hangupHandler(){logger[_0x85e1('0x10')](util[_0x85e1('0x11')](_0x85e1('0x1d'),this[_0x85e1('0x18')],this['calleridname'],this['callerid'],this[_0x85e1('0x1b')],this[_0x85e1('0x1e')]));this[_0x85e1('0x1f')]=!![];}function getRoot(_0xeef108){return parser[_0x85e1('0x20')](_0xeef108,{'object':!![]})[_0x85e1('0x21')][_0x85e1('0x22')];}function addVertex(_0x1311f3,_0x2ff980,_0x5e9d98){_0x2ff980[_0x85e1('0x23')]=_0x5e9d98;if(_0x2ff980[_0x85e1('0x24')](_0x85e1('0x25'))){_0x2ff980[_0x85e1('0x26')]=parseInt(_0x2ff980[_0x85e1('0x25')],0xa);}_0x1311f3['addVertex'](_['omit'](_0x2ff980,_0x85e1('0x27')));}function initGraph(_0x483acb,_0x1bdd86){var _0x3e2a7f=new Graph();for(var _0x21421e in _0x483acb){if(_0x483acb[_0x85e1('0x24')](_0x21421e)){if(_[_0x85e1('0x28')](_0x483acb[_0x21421e])){for(var _0xc52474=0x0;_0xc52474<_0x483acb[_0x21421e][_0x85e1('0x29')];_0xc52474+=0x1){addVertex(_0x3e2a7f,_0x483acb[_0x21421e][_0xc52474],_0x21421e);}}else{addVertex(_0x3e2a7f,_0x483acb[_0x21421e],_0x21421e);}}}for(var _0x38f473=0x0;_0x38f473<_0x1bdd86[_0x85e1('0x29')];_0x38f473+=0x1){if(_0x1bdd86[_0x38f473][_0x85e1('0x2a')]&&_0x1bdd86[_0x38f473][_0x85e1('0x2b')]){_0x3e2a7f['addEdge'](_0x1bdd86[_0x38f473][_0x85e1('0x2a')],_0x1bdd86[_0x38f473][_0x85e1('0x2b')],_0x1bdd86[_0x38f473][_0x85e1('0x2c')]);}}return _0x3e2a7f;}function getSquareProject(_0xc06e2e,_0x2af3fe){rpc[_0x85e1('0x2d')](_0xc06e2e)[_0x85e1('0x2e')](function(_0x5b251e){_0x2af3fe(null,_0x5b251e);})[_0x85e1('0x2f')](function(_0x20eeda){_0x2af3fe(null,_0x20eeda);});}function createSquareReport(_0x3717cb,_0x4a0769){rpc[_0x85e1('0x30')](_0x3717cb)[_0x85e1('0x2e')](function(_0x181ffd){if(_0x4a0769){_0x4a0769(null,_0x181ffd);}})[_0x85e1('0x2f')](function(_0x27bfd9){if(_0x4a0769){_0x4a0769(null,_0x27bfd9);}});}function setChannelVariables(_0x556045){for(var _0x5e210b in _0x556045){if(_0x556045[_0x85e1('0x24')](_0x5e210b)){if(_0x5e210b[_0x85e1('0x31')](_0x85e1('0x32'))===0x0){_0x556045[_0x5e210b['substring'](0x4)]=_0x556045[_0x5e210b];delete _0x556045[_0x5e210b];}}}}function getLogFromObject(_0x24af94){return util[_0x85e1('0x33')](_0x24af94,{'showHidden':![],'depth':null});}function agiHandler(_0x137c2d){var _0x3c0687,_0x599932,_0x320b3a,_0x2e56c2,_0x1d88d0;logger[_0x85e1('0x34')](_0x85e1('0x35'),JSON[_0x85e1('0x36')](_0x137c2d,null,0x2));logger[_0x85e1('0x10')](util['format'](_0x85e1('0x37'),_0x137c2d[_0x85e1('0x18')],_0x137c2d[_0x85e1('0x19')],_0x137c2d[_0x85e1('0x1a')],_0x137c2d['dnid'],_0x137c2d[_0x85e1('0x1e')]));_0x137c2d['on'](_0x85e1('0x15'),errorHandler);_0x137c2d['on'](_0x85e1('0x38'),closeHandler);_0x137c2d['on']('timeout',timeoutHandler);_0x137c2d[_0x85e1('0x1f')]=![];_0x137c2d['on']('hangup',hangupHandler);var _0x34b82f=getSquareProject[_0x85e1('0x39')](null,_0x137c2d['arg_1']);if(_0x34b82f){if(_0x34b82f['production']){_0x3c0687=getRoot(_0x34b82f[_0x85e1('0x3a')]);if(_0x3c0687&&_0x3c0687[_0x85e1('0x3b')]){logger['debug'](_0x85e1('0x22'),JSON['stringify'](_0x3c0687,null,0x2));_0x137c2d[_0x85e1('0x3c')]=moment()[_0x85e1('0x11')](_0x85e1('0x3d'));_0x599932=initGraph(_['omit'](_0x3c0687,_0x85e1('0x27')),_0x3c0687[_0x85e1('0x27')]);_0x320b3a=new Vertices(_0x137c2d,rpc,mailRpc);logger[_0x85e1('0x10')](util[_0x85e1('0x11')](_0x85e1('0x3e'),_0x137c2d[_0x85e1('0x18')],_0x137c2d['calleridname'],_0x137c2d[_0x85e1('0x1a')],_0x137c2d['dnid'],_0x137c2d[_0x85e1('0x1e')]));_0x599932[_0x85e1('0x3f')](_0x3c0687[_0x85e1('0x3b')]['id'],function(_0x56207f){try{_0x56207f=_0x320b3a[_0x85e1('0x40')](_0x56207f);logger[_0x85e1('0x34')](_0x85e1('0x41'),JSON['stringify'](_0x56207f,null,0x2));if(_0x56207f[_0x85e1('0x23')]==='gotoc'){logger['info'](_0x85e1('0x42'));_0x137c2d[_0x85e1('0x43')]=_0x56207f[_0x85e1('0x43')]||_0x137c2d['context'];_0x137c2d['extension']=_0x56207f['extension'];_0x137c2d[_0x85e1('0x44')]=_0x56207f[_0x85e1('0x44')]?_0x56207f[_0x85e1('0x44')]-0x1:0x1;return null;}else if(_0x56207f&&_0x320b3a[_0x56207f[_0x85e1('0x23')]]){_0x1d88d0=_0x320b3a[_0x56207f['agicommand']](_0x56207f);logger['info'](_0x85e1('0x45'),JSON[_0x85e1('0x36')](_0x1d88d0,null,0x2));if(_0x1d88d0&&_0x1d88d0[_0x85e1('0x46')]===AGI_CODE_SUCCESS&&_0x1d88d0[_0x85e1('0x47')]!==AGI_RESULT_ERROR&&!_0x137c2d[_0x85e1('0x1f')]){logger[_0x85e1('0x34')]('response',getLogFromObject(_0x1d88d0));return _['isUndefined'](_0x1d88d0[_0x85e1('0x47')])?null:_0x1d88d0[_0x85e1('0x47')][_0x85e1('0x48')]();}else{logger['error'](_0x85e1('0x45'),getLogFromObject(_0x1d88d0));return null;}}else{logger['error'](_0x85e1('0x49'));return null;}}catch(_0x12617e){logger[_0x85e1('0x15')](_0x12617e[_0x85e1('0xd')]);return null;}});if(_0x3c0687[_0x85e1('0x4a')]){logger[_0x85e1('0x10')](util[_0x85e1('0x11')]('[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x137c2d[_0x85e1('0x18')],_0x137c2d[_0x85e1('0x19')],_0x137c2d['callerid'],_0x137c2d['dnid'],_0x137c2d['uniqueid']));_0x599932[_0x85e1('0x3f')](_0x3c0687['finally']['id'],function(_0x447328){try{_0x447328=_0x320b3a[_0x85e1('0x40')](_0x447328);logger[_0x85e1('0x34')]('vertex',JSON[_0x85e1('0x36')](_0x447328,null,0x2));if(_0x447328&&_0x320b3a[_0x447328[_0x85e1('0x23')]]){_0x1d88d0=_0x320b3a[_0x447328[_0x85e1('0x23')]](_0x447328);if(_0x1d88d0){logger[_0x85e1('0x34')](_0x85e1('0x45'),getLogFromObject(_0x1d88d0));return _[_0x85e1('0x4b')](_0x1d88d0[_0x85e1('0x47')])?null:_0x1d88d0[_0x85e1('0x47')]['toString']();}else{logger[_0x85e1('0x15')](_0x85e1('0x45'),getLogFromObject(_0x1d88d0));return null;}}else{logger[_0x85e1('0x15')](_0x85e1('0x49'));return null;}}catch(_0x25779e){logger[_0x85e1('0x15')](_0x25779e['stack']);return null;}});}logger[_0x85e1('0x10')](util[_0x85e1('0x11')](_0x85e1('0x4c'),_0x137c2d[_0x85e1('0x18')],_0x137c2d[_0x85e1('0x19')],_0x137c2d[_0x85e1('0x1a')],_0x137c2d[_0x85e1('0x1b')],_0x137c2d['uniqueid']));logger[_0x85e1('0x10')](util[_0x85e1('0x11')](_0x85e1('0x4d'),_0x137c2d[_0x85e1('0x43')],_0x137c2d['extension'],parseInt(_0x137c2d[_0x85e1('0x44')],0xa)+0x1));_0x137c2d['continueAt'](_0x137c2d[_0x85e1('0x43')],_0x137c2d[_0x85e1('0x4e')],parseInt(_0x137c2d['priority'],0xa)+0x1);_0x137c2d[_0x85e1('0x38')]();}}else{logger[_0x85e1('0x15')](util[_0x85e1('0x11')](_0x85e1('0x4f'),_0x137c2d[_0x85e1('0x18')]));_0x137c2d['continueAt'](_0x137c2d[_0x85e1('0x43')],_0x137c2d['extension'],parseInt(_0x137c2d[_0x85e1('0x44')],0xa)+0x1);_0x137c2d[_0x85e1('0x38')]();}}else{logger['error'](util[_0x85e1('0x11')]('Project\x20%s\x20not\x20found',_0x137c2d[_0x85e1('0x18')]));_0x137c2d[_0x85e1('0x50')](_0x137c2d[_0x85e1('0x43')],_0x137c2d[_0x85e1('0x4e')],parseInt(_0x137c2d['priority'],0xa)+0x1);_0x137c2d['close']();}}function main(){var _0x35f6ee;return utilLicense['getLicense']()[_0x85e1('0x2e')](function(_0x3575b0){if(_0x3575b0){if(_0x3575b0[_0x85e1('0x51')]){if(_0x3575b0['callysquare']&&_0x3575b0[_0x85e1('0x52')]>0x0){logger[_0x85e1('0x10')](util[_0x85e1('0x11')](_0x85e1('0x53'),_0x3575b0[_0x85e1('0x52')]));_0x35f6ee=_0x3575b0[_0x85e1('0x52')];}else{logger[_0x85e1('0x10')](_0x85e1('0x54'));}}else{logger['info'](_0x85e1('0x55'));_0x35f6ee=-0x1;}}})['catch'](function(_0x5210fa){logger[_0x85e1('0x15')](_0x85e1('0x56'),_0x5210fa[_0x85e1('0xd')]);})['finally'](function(){var _0x3b8d8a=require(_0x85e1('0x57'))(config[_0x85e1('0xa')][_0x85e1('0xf')],config[_0x85e1('0xa')]['ip'],_0x35f6ee);_0x3b8d8a['on'](_0x85e1('0x15'),errorHandler);_0x3b8d8a['on']('listening',listeningHandler);_0x3b8d8a['on'](_0x85e1('0x58'),connectionHandler);_0x3b8d8a['on']('close',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 8f24e65..aa7f8ae 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 _0xe2af=['error','message','catch','SendMail','bluebird','client','http','request','then'];(function(_0x2ff8ae,_0x459670){var _0x52d112=function(_0x1388eb){while(--_0x1388eb){_0x2ff8ae['push'](_0x2ff8ae['shift']());}};_0x52d112(++_0x459670);}(_0xe2af,0x124));var _0xfe2a=function(_0x335bf8,_0x483d57){_0x335bf8=_0x335bf8-0x0;var _0x3c2c4a=_0xe2af[_0x335bf8];return _0x3c2c4a;};'use strict';var BPromise=require(_0xfe2a('0x0'));var jayson=require('jayson/promise');var client=jayson[_0xfe2a('0x1')][_0xfe2a('0x2')]({'port':0x232b});function request(_0x3a875d,_0x4a7197){return new BPromise(function(_0x274d01,_0x192ee3){return client[_0xfe2a('0x3')](_0x3a875d,_0x4a7197)[_0xfe2a('0x4')](function(_0x3a5d14){if(_0x3a5d14[_0xfe2a('0x5')]){return _0x192ee3(_0x3a5d14[_0xfe2a('0x5')][_0xfe2a('0x6')]);}else{return _0x274d01(_0x3a5d14['result']);}})[_0xfe2a('0x7')](function(_0x222f23){return _0x192ee3(_0x222f23);});});}exports['sendMailMessage']=function(_0x36386a,_0x1994b6){return request(_0xfe2a('0x8'),{'account':_0x36386a,'message':_0x1994b6});}; \ No newline at end of file +var _0xc94f=['catch','sendMailMessage','SendMail','jayson/promise','client','http','request','then','error','message','result'];(function(_0x3826ad,_0x49a30d){var _0x17b900=function(_0x38474f){while(--_0x38474f){_0x3826ad['push'](_0x3826ad['shift']());}};_0x17b900(++_0x49a30d);}(_0xc94f,0x71));var _0xfc94=function(_0x2e2ba7,_0xcd2742){_0x2e2ba7=_0x2e2ba7-0x0;var _0x2823d9=_0xc94f[_0x2e2ba7];return _0x2823d9;};'use strict';var BPromise=require('bluebird');var jayson=require(_0xfc94('0x0'));var client=jayson[_0xfc94('0x1')][_0xfc94('0x2')]({'port':0x232b});function request(_0x1d2375,_0x53eb6b){return new BPromise(function(_0x39fdf9,_0x482a01){return client[_0xfc94('0x3')](_0x1d2375,_0x53eb6b)[_0xfc94('0x4')](function(_0x230fee){if(_0x230fee[_0xfc94('0x5')]){return _0x482a01(_0x230fee['error'][_0xfc94('0x6')]);}else{return _0x39fdf9(_0x230fee[_0xfc94('0x7')]);}})[_0xfc94('0x8')](function(_0x5052c6){return _0x482a01(_0x5052c6);});});}exports[_0xfc94('0x9')]=function(_0x2f8f56,_0x341431){return request(_0xfc94('0xa'),{'account':_0x2f8f56,'message':_0x341431});}; \ No newline at end of file diff --git a/server/services/agi/reply.js b/server/services/agi/reply.js index b873965..31d7a5e 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 _0x9b8c=['length','split','slice','trim','emit','headers','line','util','stream','Transform','call','_localBuffer','_inBody','inherits','prototype','toString','indexOf','substring'];(function(_0x20b4fd,_0x30c883){var _0x411180=function(_0x38fd5b){while(--_0x38fd5b){_0x20b4fd['push'](_0x20b4fd['shift']());}};_0x411180(++_0x30c883);}(_0x9b8c,0x1ed));var _0xc9b8=function(_0x555b2f,_0x43b622){_0x555b2f=_0x555b2f-0x0;var _0x81c0a6=_0x9b8c[_0x555b2f];return _0x81c0a6;};'use strict';var util=require(_0xc9b8('0x0'));var Transform=require(_0xc9b8('0x1'))[_0xc9b8('0x2')];function AGIReply(_0x282332){Transform[_0xc9b8('0x3')](this,_0x282332);this[_0xc9b8('0x4')]='';this[_0xc9b8('0x5')]=![];}util[_0xc9b8('0x6')](AGIReply,Transform);AGIReply[_0xc9b8('0x7')]['_transform']=function(_0x39c320,_0x56d7cd,_0x14d0e0){var _0x50ec93='\x0a',_0x396b52=['\x0a\x0a','\x0d\x0a\x0d\x0a'],_0x3425f1=-0x1,_0x2450ea=-0x1,_0x5d0afa='',_0xe696cd=0x0,_0xd26828='',_0x3c6517='';this[_0xc9b8('0x4')]+=_0x39c320[_0xc9b8('0x8')]();_0xd26828=this[_0xc9b8('0x4')];if(!this['_inBody']){_0xe696cd=0x0;while(_0x396b52[_0xe696cd]){while((_0x2450ea=_0xd26828[_0xc9b8('0x9')](_0x396b52[_0xe696cd]))!=-0x1){_0x5d0afa=_0x396b52[_0xe696cd];_0x3c6517=_0xd26828['substring'](0x0,_0x2450ea);_0xd26828=_0xd26828[_0xc9b8('0xa')](_0x2450ea+_0x5d0afa[_0xc9b8('0xb')]);var _0x1df582=_0x3c6517[_0xc9b8('0xc')](_0x50ec93),_0x1b278b=0x0,_0x46a668={},_0x101545='',_0x3114bd='',_0x202e17=-0x1;while(_0x1df582[_0x1b278b]){_0x202e17=_0x1df582[_0x1b278b][_0xc9b8('0x9')](':');if(_0x202e17!=-0x1){_0x101545=_0x1df582[_0x1b278b][_0xc9b8('0xd')](0x0,_0x202e17)['trim']();_0x3114bd=_0x1df582[_0x1b278b][_0xc9b8('0xd')](_0x202e17+0x1)[_0xc9b8('0xe')]();if(_0x101545[_0xc9b8('0xb')]>0x0){_0x46a668[_0x101545]=_0x3114bd;}}else{}_0x1b278b++;}this[_0xc9b8('0xf')](_0xc9b8('0x10'),_0x46a668);this[_0xc9b8('0x5')]=!![];}_0xe696cd++;}this[_0xc9b8('0x4')]=_0xd26828;}else{while((_0x3425f1=_0xd26828[_0xc9b8('0x9')](_0x50ec93))!=-0x1){_0x3c6517=_0xd26828[_0xc9b8('0xa')](0x0,_0x3425f1);this[_0xc9b8('0xf')](_0xc9b8('0x11'),_0x3c6517);_0xd26828=_0xd26828[_0xc9b8('0xa')](_0x3425f1+_0x50ec93['length']);}this['_localBuffer']=_0xd26828;}_0x14d0e0();};module['exports']=AGIReply; \ No newline at end of file +var _0x4787=['substring','slice','trim','headers','emit','line','length','exports','stream','Transform','_localBuffer','_inBody','prototype','_transform','\x0d\x0a\x0d\x0a','indexOf'];(function(_0x45313f,_0x46caf4){var _0x402910=function(_0x4883d8){while(--_0x4883d8){_0x45313f['push'](_0x45313f['shift']());}};_0x402910(++_0x46caf4);}(_0x4787,0x148));var _0x7478=function(_0x403c20,_0x4a7b99){_0x403c20=_0x403c20-0x0;var _0x2b271a=_0x4787[_0x403c20];return _0x2b271a;};'use strict';var util=require('util');var Transform=require(_0x7478('0x0'))[_0x7478('0x1')];function AGIReply(_0x35eeb3){Transform['call'](this,_0x35eeb3);this[_0x7478('0x2')]='';this[_0x7478('0x3')]=![];}util['inherits'](AGIReply,Transform);AGIReply[_0x7478('0x4')][_0x7478('0x5')]=function(_0x23281c,_0x14a1f9,_0x499f45){var _0x4e03f4='\x0a',_0x4042a3=['\x0a\x0a',_0x7478('0x6')],_0x5df7ad=-0x1,_0xc88906=-0x1,_0xd7efb1='',_0x135ae9=0x0,_0x13cbb2='',_0xb6b163='';this['_localBuffer']+=_0x23281c['toString']();_0x13cbb2=this[_0x7478('0x2')];if(!this['_inBody']){_0x135ae9=0x0;while(_0x4042a3[_0x135ae9]){while((_0xc88906=_0x13cbb2[_0x7478('0x7')](_0x4042a3[_0x135ae9]))!=-0x1){_0xd7efb1=_0x4042a3[_0x135ae9];_0xb6b163=_0x13cbb2['substring'](0x0,_0xc88906);_0x13cbb2=_0x13cbb2[_0x7478('0x8')](_0xc88906+_0xd7efb1['length']);var _0x2783db=_0xb6b163['split'](_0x4e03f4),_0x5c89d0=0x0,_0xd30c80={},_0x10229d='',_0x5d8c4b='',_0x4842cc=-0x1;while(_0x2783db[_0x5c89d0]){_0x4842cc=_0x2783db[_0x5c89d0]['indexOf'](':');if(_0x4842cc!=-0x1){_0x10229d=_0x2783db[_0x5c89d0][_0x7478('0x9')](0x0,_0x4842cc)[_0x7478('0xa')]();_0x5d8c4b=_0x2783db[_0x5c89d0][_0x7478('0x9')](_0x4842cc+0x1)[_0x7478('0xa')]();if(_0x10229d['length']>0x0){_0xd30c80[_0x10229d]=_0x5d8c4b;}}else{}_0x5c89d0++;}this['emit'](_0x7478('0xb'),_0xd30c80);this['_inBody']=!![];}_0x135ae9++;}this[_0x7478('0x2')]=_0x13cbb2;}else{while((_0x5df7ad=_0x13cbb2[_0x7478('0x7')](_0x4e03f4))!=-0x1){_0xb6b163=_0x13cbb2['substring'](0x0,_0x5df7ad);this[_0x7478('0xc')](_0x7478('0xd'),_0xb6b163);_0x13cbb2=_0x13cbb2[_0x7478('0x8')](_0x5df7ad+_0x4e03f4[_0x7478('0xe')]);}this[_0x7478('0x2')]=_0x13cbb2;}_0x499f45();};module[_0x7478('0xf')]=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index 01e7a20..a786889 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 _0x9d62=['getMailAccountById','ShowMailAccount','MailServerOut','Smtp','name','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowVariable','getSquareOdbcById','getUserById','getTrunkById','ShowTrunk','getSoundById','ShowSound','save_name','getSmsAccountById','ShowSmsAccount','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','CreateSquareReport','merge','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','createSquareMessage','createCmContact','ShowCmHopper','ListId','CreateCmContact','getPauseById','ShowPause','agentLogin','LoginUser','agentPause','PauseUser','agentUnpause','UnpauseUser','agentLogout','LogoutUser','bluebird','jayson/promise','client','request','then','error','message','result','catch','getSquareProject','production'];(function(_0x454b0f,_0x4826a4){var _0x12513e=function(_0x32bcdd){while(--_0x32bcdd){_0x454b0f['push'](_0x454b0f['shift']());}};_0x12513e(++_0x4826a4);}(_0x9d62,0x176));var _0x29d6=function(_0x126a4c,_0x1904a6){_0x126a4c=_0x126a4c-0x0;var _0x39f8ec=_0x9d62[_0x126a4c];return _0x39f8ec;};'use strict';var BPromise=require(_0x29d6('0x0'));var moment=require('moment');var _=require('lodash');var util=require('util');var jayson=require(_0x29d6('0x1'));var client=jayson[_0x29d6('0x2')]['http']({'port':0x2329});function request(_0x3c73a4,_0x2f075c){return new BPromise(function(_0x10b150,_0x119e81){return client[_0x29d6('0x3')](_0x3c73a4,_0x2f075c)[_0x29d6('0x4')](function(_0x230e44){if(_0x230e44[_0x29d6('0x5')]){return _0x119e81(_0x230e44['error'][_0x29d6('0x6')]);}else{return _0x10b150(_0x230e44[_0x29d6('0x7')]);}})[_0x29d6('0x8')](function(_0x3f683b){return _0x119e81(_0x3f683b);});});}exports[_0x29d6('0x9')]=function(_0x29a1f2){return request('ShowSquareProject',{'options':{'raw':![],'where':{'name':_0x29a1f2},'attributes':[_0x29d6('0xa')]}});};exports[_0x29d6('0xb')]=function(_0x373d22){return request(_0x29d6('0xc'),{'options':{'raw':![],'where':{'id':_0x373d22},'include':[{'model':_0x29d6('0xd'),'as':_0x29d6('0xe')}],'attributes':['id',_0x29d6('0xf'),'email']}});};exports['getSquareProjectById']=function(_0x116409){return request('ShowSquareProject',{'options':{'where':{'id':_0x116409},'attributes':['name']}});};exports[_0x29d6('0x10')]=function(_0x1d5ab8){return request(_0x29d6('0x11'),{'options':{'where':{'id':_0x1d5ab8},'attributes':[_0x29d6('0xf')]}});};exports[_0x29d6('0x12')]=function(_0x2db422){return request(_0x29d6('0x13'),{'options':{'where':{'id':_0x2db422},'attributes':[_0x29d6('0xf')]}});};exports[_0x29d6('0x14')]=function(_0x2c8b21){return request('ShowSquareOdbc',{'options':{'where':{'id':_0x2c8b21},'attributes':['dsn']}});};exports[_0x29d6('0x15')]=function(_0x88db4){return request('ShowUser',{'options':{'where':{'id':_0x88db4},'attributes':[_0x29d6('0xf')]}});};exports[_0x29d6('0x16')]=function(_0x48820c){return request(_0x29d6('0x17'),{'options':{'where':{'id':_0x48820c},'attributes':[_0x29d6('0xf')]}});};exports[_0x29d6('0x18')]=function(_0x1b1cff){return request(_0x29d6('0x19'),{'options':{'where':{'id':_0x1b1cff},'attributes':[_0x29d6('0x1a')]}});};exports['getIntervalById']=function(_0x469051){return request('ShowInterval',{'options':{'raw':![],'where':{'id':_0x469051},'include':[{'model':'Interval','as':'Intervals'}]}});};exports[_0x29d6('0x1b')]=function(_0x340056){return request(_0x29d6('0x1c'),{'options':{'where':{'id':_0x340056},'attributes':['id',_0x29d6('0xf')]}});};exports[_0x29d6('0x1d')]=function(_0x16a3f0){return request(_0x29d6('0x1e'),{'body':_0x16a3f0});};exports[_0x29d6('0x1f')]=function(_0x58d017){return request(_0x29d6('0x20'),{'body':_0x58d017});};exports['createSquareReport']=function(_0x5861e0){return request(_0x29d6('0x21'),{'body':_[_0x29d6('0x22')](_0x5861e0,{'project_name':_0x5861e0[_0x29d6('0x23')],'prev_project_name':_0x5861e0['arg_2']||'','is_subproject':_0x5861e0[_0x29d6('0x24')]?!![]:![],'leaveAt':moment()[_0x29d6('0x25')](_0x29d6('0x26'))})});};exports[_0x29d6('0x27')]=function(_0x2a7934){return request('CreateSquareRecording',{'body':_0x2a7934});};exports[_0x29d6('0x28')]=function(_0x2ffa7a){return request('CreateSquareMessage',{'body':_0x2ffa7a});};exports[_0x29d6('0x29')]=function(_0x57df16){return request(_0x29d6('0x2a'),{'options':{'raw':![],'where':{'phone':_0x57df16['phone'],'ListId':_0x57df16[_0x29d6('0x2b')]}}})['then'](function(_0x37a6d1){if(_0x37a6d1){return _0x37a6d1;}return request(_0x29d6('0x2c'),{'body':_0x57df16});});};exports[_0x29d6('0x2d')]=function(_0x264e26){return request(_0x29d6('0x2e'),{'options':{'where':{'id':_0x264e26},'attributes':[_0x29d6('0xf')]}});};exports[_0x29d6('0x2f')]=function(_0x52657b,_0x534933){return request(_0x29d6('0x30'),{'body':{'interface':_0x534933},'options':{'where':_0x52657b}});};exports[_0x29d6('0x31')]=function(_0xbf2903,_0x28c8f2,_0x10d945){return request(_0x29d6('0x32'),{'body':{'type':_0x28c8f2,'uniqueid':_0x10d945},'options':{'where':_0xbf2903}});};exports[_0x29d6('0x33')]=function(_0x59dfd0){return request(_0x29d6('0x34'),{'body':{},'options':{'where':_0x59dfd0}});};exports[_0x29d6('0x35')]=function(_0xde3fd9){return request(_0x29d6('0x36'),{'body':{},'options':{'where':_0xde3fd9}});}; \ No newline at end of file +var _0x340f=['ShowSmsAccount','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_1','arg_2','CreateSquareMessage','createCmContact','ShowCmHopper','phone','getPauseById','agentLogin','LoginUser','agentPause','PauseUser','agentUnpause','UnpauseUser','agentLogout','LogoutUser','bluebird','moment','lodash','jayson/promise','client','error','message','catch','ShowSquareProject','production','getMailAccountById','ShowMailAccount','Smtp','name','email','getSquareProjectById','getVoiceQueueById','ShowVariable','dsn','getUserById','ShowUser','getTrunkById','ShowTrunk','ShowSound','save_name','getIntervalById','ShowInterval','getSmsAccountById'];(function(_0x2d14b0,_0x362cb4){var _0x4395ac=function(_0x1c1859){while(--_0x1c1859){_0x2d14b0['push'](_0x2d14b0['shift']());}};_0x4395ac(++_0x362cb4);}(_0x340f,0x19d));var _0xf340=function(_0x57b316,_0x63ba83){_0x57b316=_0x57b316-0x0;var _0x355132=_0x340f[_0x57b316];return _0x355132;};'use strict';var BPromise=require(_0xf340('0x0'));var moment=require(_0xf340('0x1'));var _=require(_0xf340('0x2'));var util=require('util');var jayson=require(_0xf340('0x3'));var client=jayson[_0xf340('0x4')]['http']({'port':0x2329});function request(_0x3bb61c,_0x4b6d69){return new BPromise(function(_0x533fdb,_0x9cc814){return client['request'](_0x3bb61c,_0x4b6d69)['then'](function(_0x31131e){if(_0x31131e[_0xf340('0x5')]){return _0x9cc814(_0x31131e[_0xf340('0x5')][_0xf340('0x6')]);}else{return _0x533fdb(_0x31131e['result']);}})[_0xf340('0x7')](function(_0x5b5b21){return _0x9cc814(_0x5b5b21);});});}exports['getSquareProject']=function(_0x1a0b77){return request(_0xf340('0x8'),{'options':{'raw':![],'where':{'name':_0x1a0b77},'attributes':[_0xf340('0x9')]}});};exports[_0xf340('0xa')]=function(_0x910130){return request(_0xf340('0xb'),{'options':{'raw':![],'where':{'id':_0x910130},'include':[{'model':'MailServerOut','as':_0xf340('0xc')}],'attributes':['id',_0xf340('0xd'),_0xf340('0xe')]}});};exports[_0xf340('0xf')]=function(_0x4ca326){return request(_0xf340('0x8'),{'options':{'where':{'id':_0x4ca326},'attributes':[_0xf340('0xd')]}});};exports[_0xf340('0x10')]=function(_0x1037e9){return request('ShowVoiceQueue',{'options':{'where':{'id':_0x1037e9},'attributes':[_0xf340('0xd')]}});};exports['getVariableById']=function(_0x25f08a){return request(_0xf340('0x11'),{'options':{'where':{'id':_0x25f08a},'attributes':[_0xf340('0xd')]}});};exports['getSquareOdbcById']=function(_0x14939d){return request('ShowSquareOdbc',{'options':{'where':{'id':_0x14939d},'attributes':[_0xf340('0x12')]}});};exports[_0xf340('0x13')]=function(_0x384025){return request(_0xf340('0x14'),{'options':{'where':{'id':_0x384025},'attributes':[_0xf340('0xd')]}});};exports[_0xf340('0x15')]=function(_0x5d8eb2){return request(_0xf340('0x16'),{'options':{'where':{'id':_0x5d8eb2},'attributes':[_0xf340('0xd')]}});};exports['getSoundById']=function(_0x4422bc){return request(_0xf340('0x17'),{'options':{'where':{'id':_0x4422bc},'attributes':[_0xf340('0x18')]}});};exports[_0xf340('0x19')]=function(_0x4c460a){return request(_0xf340('0x1a'),{'options':{'raw':![],'where':{'id':_0x4c460a},'include':[{'model':'Interval','as':'Intervals'}]}});};exports[_0xf340('0x1b')]=function(_0x517605){return request(_0xf340('0x1c'),{'options':{'where':{'id':_0x517605},'attributes':['id',_0xf340('0xd')]}});};exports['createSmsMessage']=function(_0x555aaa){return request('CreateSmsMessage',{'body':_0x555aaa});};exports[_0xf340('0x1d')]=function(_0xfe7c09){return request(_0xf340('0x1e'),{'body':_0xfe7c09});};exports[_0xf340('0x1f')]=function(_0x2a00ba){return request(_0xf340('0x20'),{'body':_[_0xf340('0x21')](_0x2a00ba,{'project_name':_0x2a00ba[_0xf340('0x22')],'prev_project_name':_0x2a00ba[_0xf340('0x23')]||'','is_subproject':_0x2a00ba[_0xf340('0x23')]?!![]:![],'leaveAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')})});};exports['createSquareRecording']=function(_0x21dff6){return request('CreateSquareRecording',{'body':_0x21dff6});};exports['createSquareMessage']=function(_0x16d2ac){return request(_0xf340('0x24'),{'body':_0x16d2ac});};exports[_0xf340('0x25')]=function(_0x4ce632){return request(_0xf340('0x26'),{'options':{'raw':![],'where':{'phone':_0x4ce632[_0xf340('0x27')],'ListId':_0x4ce632['ListId']}}})['then'](function(_0x59539a){if(_0x59539a){return _0x59539a;}return request('CreateCmContact',{'body':_0x4ce632});});};exports[_0xf340('0x28')]=function(_0x307fed){return request('ShowPause',{'options':{'where':{'id':_0x307fed},'attributes':[_0xf340('0xd')]}});};exports[_0xf340('0x29')]=function(_0x2b0c99,_0x552dc4){return request(_0xf340('0x2a'),{'body':{'interface':_0x552dc4},'options':{'where':_0x2b0c99}});};exports[_0xf340('0x2b')]=function(_0x10088e,_0x369d9c,_0x3174d5){return request(_0xf340('0x2c'),{'body':{'type':_0x369d9c,'uniqueid':_0x3174d5},'options':{'where':_0x10088e}});};exports[_0xf340('0x2d')]=function(_0x6e31e1){return request(_0xf340('0x2e'),{'body':{},'options':{'where':_0x6e31e1}});};exports[_0xf340('0x2f')]=function(_0x2ed5c9){return request(_0xf340('0x30'),{'body':{},'options':{'where':_0x2ed5c9}});}; \ 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 7c6e338..28cfe96 100644 --- a/server/services/agi/scripts/aws/index.js +++ b/server/services/agi/scripts/aws/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8be8=['./polly','./lex','exports'];(function(_0x27c71c,_0x1b27cf){var _0x34c8f9=function(_0x3955e2){while(--_0x3955e2){_0x27c71c['push'](_0x27c71c['shift']());}};_0x34c8f9(++_0x1b27cf);}(_0x8be8,0xf6));var _0x88be=function(_0x313916,_0x2b721b){_0x313916=_0x313916-0x0;var _0x2c2d44=_0x8be8[_0x313916];return _0x2c2d44;};var polly=require(_0x88be('0x0'));var lex=require(_0x88be('0x1'));module[_0x88be('0x2')]={'polly':polly,'lex':lex}; \ No newline at end of file +var polly=require('./polly');var lex=require('./lex');module['exports']={'polly':polly,'lex':lex}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/lex/index.js b/server/services/agi/scripts/aws/lex/index.js index c011d46..647f1d4 100644 --- a/server/services/agi/scripts/aws/lex/index.js +++ b/server/services/agi/scripts/aws/lex/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5b02=['exports','./lib/api'];(function(_0x3089f6,_0x4af0ad){var _0x453f5a=function(_0x5ecddc){while(--_0x5ecddc){_0x3089f6['push'](_0x3089f6['shift']());}};_0x453f5a(++_0x4af0ad);}(_0x5b02,0xe9));var _0x25b0=function(_0x14b003,_0xe10564){_0x14b003=_0x14b003-0x0;var _0x4ac540=_0x5b02[_0x14b003];return _0x4ac540;};'use strict';var lex=require(_0x25b0('0x0'));module[_0x25b0('0x1')]=function(_0x428458,_0x1c3295,_0x4ef71c,_0x4cb227,_0x2b5f2d,_0x53493e){return lex(_0x428458,_0x1c3295,_0x4ef71c,_0x4cb227,_0x2b5f2d,_0x53493e);}; \ No newline at end of file +var _0x13f6=['./lib/api','exports'];(function(_0x2985bb,_0x36572a){var _0x2c1577=function(_0x1c687f){while(--_0x1c687f){_0x2985bb['push'](_0x2985bb['shift']());}};_0x2c1577(++_0x36572a);}(_0x13f6,0x124));var _0x613f=function(_0x5145ed,_0x2bd449){_0x5145ed=_0x5145ed-0x0;var _0x570d21=_0x13f6[_0x5145ed];return _0x570d21;};'use strict';var lex=require(_0x613f('0x0'));module[_0x613f('0x1')]=function(_0x5f1b3e,_0x563492,_0xd04cfd,_0x13b50a,_0x12dc5a,_0x5414ff){return lex(_0x5f1b3e,_0x563492,_0xd04cfd,_0x13b50a,_0x12dc5a,_0x5414ff);}; \ 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 15c5491..76ccf3a 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(_0xcde77c,_0x367818){var _0x3e939b=function(_0x203dbc){while(--_0x203dbc){_0xcde77c['push'](_0xcde77c['shift']());}};_0x3e939b(++_0x367818);}(_0xa9e0,0x123));var _0x0a9e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xa9e0[_0x501510];return _0x1e6ee5;};'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(_0x2d8266,_0xaade86){var _0x4a049e=function(_0x13bf15){while(--_0x13bf15){_0x2d8266['push'](_0x2d8266['shift']());}};_0x4a049e(++_0xaade86);}(_0xa9e0,0x123));var _0x0a9e=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0xa9e0[_0x46aff0];return _0x9d78cf;};'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 3ed7701..a21e7f5 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 _0x126f=['exports','./lib/api'];(function(_0x5ad07b,_0x3c4d15){var _0x466b81=function(_0x72448a){while(--_0x72448a){_0x5ad07b['push'](_0x5ad07b['shift']());}};_0x466b81(++_0x3c4d15);}(_0x126f,0x125));var _0xf126=function(_0x26da89,_0x264785){_0x26da89=_0x26da89-0x0;var _0xc95b7b=_0x126f[_0x26da89];return _0xc95b7b;};'use strict';var polly=require(_0xf126('0x0'));module[_0xf126('0x1')]=function(_0x5e3ce8,_0xf736dc,_0x1be4b0,_0xd937cf,_0x55005c,_0x24c30e,_0x16e0cb){return polly(_0x5e3ce8,_0xf736dc,_0x1be4b0,_0xd937cf,_0x55005c,_0x24c30e,_0x16e0cb);}; \ No newline at end of file +var _0x8be8=['./lib/api'];(function(_0x1c0c7c,_0x2ede87){var _0x1eeae0=function(_0x6d671b){while(--_0x6d671b){_0x1c0c7c['push'](_0x1c0c7c['shift']());}};_0x1eeae0(++_0x2ede87);}(_0x8be8,0x147));var _0x88be=function(_0x4fbb47,_0x323687){_0x4fbb47=_0x4fbb47-0x0;var _0x1349e4=_0x8be8[_0x4fbb47];return _0x1349e4;};'use strict';var polly=require(_0x88be('0x0'));module['exports']=function(_0x595749,_0x3c40e3,_0x55c18a,_0x26bc75,_0x459b2e,_0xb08247,_0x1447fe){return polly(_0x595749,_0x3c40e3,_0x55c18a,_0x26bc75,_0x459b2e,_0xb08247,_0x1447fe);}; \ 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 a16abb0..a199968 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 _0xa523=['aws-sdk','writeFile','AudioStream','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','text','mp3','path','bluebird','randomstring'];(function(_0x574641,_0x11f894){var _0x53b350=function(_0x334fbb){while(--_0x334fbb){_0x574641['push'](_0x574641['shift']());}};_0x53b350(++_0x11f894);}(_0xa523,0x10b));var _0x3a52=function(_0x5eaf12,_0x8a62e2){_0x5eaf12=_0x5eaf12-0x0;var _0x54dbb3=_0xa523[_0x5eaf12];return _0x54dbb3;};'use strict';var fs=require('fs');var path=require(_0x3a52('0x0'));var BPromise=require(_0x3a52('0x1'));var rs=require(_0x3a52('0x2'));var AWS=require(_0x3a52('0x3'));function pollyResult(_0x28f577,_0x2e7b88,_0x281095){return new BPromise(function(_0x2ab0a0,_0x54dc82){_0x28f577['synthesizeSpeech'](_0x2e7b88,function(_0x46a202,_0x98be95){if(_0x46a202){_0x54dc82(_0x46a202);}else if(_0x98be95){if(_0x98be95['AudioStream']instanceof Buffer){fs[_0x3a52('0x4')](_0x281095,_0x98be95[_0x3a52('0x5')],function(_0x3dde73){if(_0x3dde73){_0x54dc82(_0x3dde73);}else{_0x2ab0a0();}});}else{_0x54dc82(new Error(_0x3a52('0x6')));}}else{_0x54dc82(new Error(_0x3a52('0x7')));}});});}module['exports']=function(_0x1b3e3c,_0x183411,_0x53854c,_0x5e5554,_0x209510,_0x118c08,_0x244bfb){var _0x195a92=new AWS['Polly']({'accessKeyId':_0x1b3e3c,'secretAccessKey':_0x183411,'region':_0x53854c});var _0x376761={'Text':_0x209510,'TextType':_0x118c08||_0x3a52('0x8'),'OutputFormat':_0x3a52('0x9'),'VoiceId':_0x5e5554};return pollyResult(_0x195a92,_0x376761,_0x244bfb);}; \ No newline at end of file +var _0xd774=['writeFile','AudioStream','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text','mp3','path','bluebird','randomstring','aws-sdk'];(function(_0x3b19ea,_0x518b6b){var _0x40ece9=function(_0x3a3386){while(--_0x3a3386){_0x3b19ea['push'](_0x3b19ea['shift']());}};_0x40ece9(++_0x518b6b);}(_0xd774,0x130));var _0x4d77=function(_0x31a709,_0x3c08ed){_0x31a709=_0x31a709-0x0;var _0x4ed765=_0xd774[_0x31a709];return _0x4ed765;};'use strict';var fs=require('fs');var path=require(_0x4d77('0x0'));var BPromise=require(_0x4d77('0x1'));var rs=require(_0x4d77('0x2'));var AWS=require(_0x4d77('0x3'));function pollyResult(_0x5e901c,_0x506f41,_0x130cf4){return new BPromise(function(_0x5d3b42,_0x599e31){_0x5e901c['synthesizeSpeech'](_0x506f41,function(_0x4f0e98,_0x22cc1e){if(_0x4f0e98){_0x599e31(_0x4f0e98);}else if(_0x22cc1e){if(_0x22cc1e['AudioStream']instanceof Buffer){fs[_0x4d77('0x4')](_0x130cf4,_0x22cc1e[_0x4d77('0x5')],function(_0x3a761d){if(_0x3a761d){_0x599e31(_0x3a761d);}else{_0x5d3b42();}});}else{_0x599e31(new Error(_0x4d77('0x6')));}}else{_0x599e31(new Error('No\x20data\x20response\x20from\x20aws\x20Polly!'));}});});}module[_0x4d77('0x7')]=function(_0x5f4ccb,_0x974f70,_0x1c686e,_0x486e53,_0xc6f027,_0x437cab,_0xf62c5){var _0x369e3d=new AWS[(_0x4d77('0x8'))]({'accessKeyId':_0x5f4ccb,'secretAccessKey':_0x974f70,'region':_0x1c686e});var _0x577e30={'Text':_0xc6f027,'TextType':_0x437cab||_0x4d77('0x9'),'OutputFormat':_0x4d77('0xa'),'VoiceId':_0x486e53};return pollyResult(_0x369e3d,_0x577e30,_0xf62c5);}; \ 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 0454793..c5416e7 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. * // * * // ************************************************************************* -'use strict';var asr=require('./lib/api');module['exports']=function(_0x41b5b8,_0x31d51f,_0x42141d,_0x19db89){return asr(_0x41b5b8,_0x31d51f,_0x42141d);}; \ No newline at end of file +var _0x0bd9=['exports','./lib/api'];(function(_0x2ce1dd,_0xd5bef){var _0x10ea33=function(_0x14e652){while(--_0x14e652){_0x2ce1dd['push'](_0x2ce1dd['shift']());}};_0x10ea33(++_0xd5bef);}(_0x0bd9,0xdb));var _0x90bd=function(_0x3f1fdc,_0x55bc73){_0x3f1fdc=_0x3f1fdc-0x0;var _0xc79a19=_0x0bd9[_0x3f1fdc];return _0xc79a19;};'use strict';var asr=require(_0x90bd('0x0'));module[_0x90bd('0x1')]=function(_0x2acad9,_0x9c4f3a,_0x20b21a,_0x57986b){return asr(_0x2acad9,_0x9c4f3a,_0x20b21a);}; \ 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 3b1f8d7..bffcb4f 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 _0x303a=['url','https://speech.googleapis.com','exports','string','length','filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','lang\x20should\x20be\x20a\x20string','readFileSync','base64','POST','LINEAR16','8000'];(function(_0x2fcc06,_0x5390d3){var _0x54dfb2=function(_0x472c30){while(--_0x472c30){_0x2fcc06['push'](_0x2fcc06['shift']());}};_0x54dfb2(++_0x5390d3);}(_0x303a,0x1a0));var _0xa303=function(_0x2f1089,_0x42d03d){_0x2f1089=_0x2f1089-0x0;var _0x1af573=_0x303a[_0x2f1089];return _0x1af573;};'use strict';var url=require(_0xa303('0x0'));var BPromise=require('bluebird');var fs=require('fs');var host=_0xa303('0x1');module[_0xa303('0x2')]=function(_0x36e548,_0x19d27a,_0x594b49){return new BPromise(function(_0x46c56b,_0x26b47c){var _0x38a354;if(typeof _0x36e548!==_0xa303('0x3')||_0x36e548[_0xa303('0x4')]===0x0){return _0x26b47c(_0xa303('0x5'));}if(typeof _0x19d27a!==_0xa303('0x3')||_0x19d27a[_0xa303('0x4')]===0x0){return _0x26b47c(_0xa303('0x6'));}if(typeof _0x594b49!=='undefined'&&(typeof _0x594b49!=='string'||_0x594b49['length']===0x0)){return _0x26b47c(_0xa303('0x7'));}try{_0x38a354=fs[_0xa303('0x8')](_0x36e548)['toString'](_0xa303('0x9'));}catch(_0x51acca){return _0x26b47c(_0x51acca);}return _0x46c56b({'method':_0xa303('0xa'),'uri':host+'/v1/speech:recognize?key='+_0x19d27a,'body':{'config':{'encoding':_0xa303('0xb'),'sampleRateHertz':_0xa303('0xc'),'languageCode':_0x594b49},'audio':{'content':_0x38a354}},'json':!![]});});}; \ No newline at end of file +var _0x4ea3=['url','bluebird','https://speech.googleapis.com','exports','string','length','filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','readFileSync','base64','LINEAR16','8000'];(function(_0x2186d2,_0x2aaafb){var _0x5284a3=function(_0x2fe226){while(--_0x2fe226){_0x2186d2['push'](_0x2186d2['shift']());}};_0x5284a3(++_0x2aaafb);}(_0x4ea3,0x70));var _0x34ea=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x4ea3[_0x2dafbe];return _0x58a45a;};'use strict';var url=require(_0x34ea('0x0'));var BPromise=require(_0x34ea('0x1'));var fs=require('fs');var host=_0x34ea('0x2');module[_0x34ea('0x3')]=function(_0x588172,_0x374ec1,_0x494b56){return new BPromise(function(_0x269d4c,_0x571f1b){var _0x5e5a84;if(typeof _0x588172!==_0x34ea('0x4')||_0x588172[_0x34ea('0x5')]===0x0){return _0x571f1b(_0x34ea('0x6'));}if(typeof _0x374ec1!==_0x34ea('0x4')||_0x374ec1[_0x34ea('0x5')]===0x0){return _0x571f1b(_0x34ea('0x7'));}if(typeof _0x494b56!==_0x34ea('0x8')&&(typeof _0x494b56!=='string'||_0x494b56[_0x34ea('0x5')]===0x0)){return _0x571f1b(_0x34ea('0x9'));}try{_0x5e5a84=fs[_0x34ea('0xa')](_0x588172)['toString'](_0x34ea('0xb'));}catch(_0xea1be2){return _0x571f1b(_0xea1be2);}return _0x269d4c({'method':'POST','uri':host+'/v1/speech:recognize?key='+_0x374ec1,'body':{'config':{'encoding':_0x34ea('0xc'),'sampleRateHertz':_0x34ea('0xd'),'languageCode':_0x494b56},'audio':{'content':_0x5e5a84}},'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 3baf76a..3da5c64 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 _0x4ac0=['./asr','exports'];(function(_0x520762,_0x32edd0){var _0xf916d4=function(_0x3ac125){while(--_0x3ac125){_0x520762['push'](_0x520762['shift']());}};_0xf916d4(++_0x32edd0);}(_0x4ac0,0x9c));var _0x04ac=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x4ac0[_0x14add3];return _0x4a174f;};var asr=require(_0x04ac('0x0'));module[_0x04ac('0x1')]={'asr':asr}; \ No newline at end of file +var _0x9152=['./asr','exports'];(function(_0x4f2cf4,_0x2b864f){var _0x2ceabe=function(_0x4af81d){while(--_0x4af81d){_0x4f2cf4['push'](_0x4f2cf4['shift']());}};_0x2ceabe(++_0x2b864f);}(_0x9152,0x120));var _0x2915=function(_0x36d0b7,_0x1cb03f){_0x36d0b7=_0x36d0b7-0x0;var _0x6be3a7=_0x9152[_0x36d0b7];return _0x6be3a7;};var asr=require(_0x2915('0x0'));module[_0x2915('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 5598869..66fba79 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 _0xd780=['\x22\x20might\x20not\x20exist','.mp3','goggleTTS\x20path','googleASR','asr','uri','results','alternatives','transcript','join','map','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','message','googleDialogflow','textRequest','source','result','resolvedQuery','action','actionIncomplete','fulfillment','speech','code','endConversation','metadata','isFallbackIntent','googleDialogflowV2','replace','SessionsClient','sessionPath','detectIntent','Dialogflow\x20V2\x20response:','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','boolValue','fulfillmentText','intent','displayName','languageCode','queryText','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','polly','awsLex','lex','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','sestekNDA','nda','channelData','CustomAction','CustomActionData','AudioFromTts','Data','audiofile','apiai-promise','bluebird','dialogflow','http','md5','path','querystring','randomstring','sox','url','parse','./sestek','agi','https://api.ispeech.org/api/rest','host','get','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusCode','statusMessage','createWriteStream','finish','info','finish\x20download\x20file','close','unlink','download\x20error','pipe','end','https:','WHAT_EVER','data','transcode','wav','error\x20convert','start','resolve','tmp','generate','writeFileSync','base64','then','chmodSync','777','split','readFileSync','toString','googleCloudTTS','?key=','input','voice','MP3','from','audioContent','writeFile','.wav','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','application/x-www-form-urlencoded','f.req=','stringify','generic','slice','parse\x20response\x20failed:\x0a','length','text\x20length\x20limit\x20reached','lang\x20\x22'];(function(_0x24e364,_0x22c22c){var _0x3921b0=function(_0x4f15d9){while(--_0x4f15d9){_0x24e364['push'](_0x24e364['shift']());}};_0x3921b0(++_0x22c22c);}(_0xd780,0x1db));var _0x0d78=function(_0x5e60fe,_0x4eca65){_0x5e60fe=_0x5e60fe-0x0;var _0x5b1f7f=_0xd780[_0x5e60fe];return _0x5b1f7f;};'use strict';var apiai=require(_0x0d78('0x0'));var BPromise=require(_0x0d78('0x1'));var dialogflow=require(_0x0d78('0x2'));var fs=require('fs');var http=require(_0x0d78('0x3'));var https=require('https');var md5=require(_0x0d78('0x4'));var path=require(_0x0d78('0x5'));var querystring=require(_0x0d78('0x6'));var rp=require('request-promise');var rs=require(_0x0d78('0x7'));var sox=require(_0x0d78('0x8'));var tts=require('google-tts-api');var urlParse=require(_0x0d78('0x9'))[_0x0d78('0xa')];var util=require('util');var aws=require('./aws');var google=require('./google');var sestek=require(_0x0d78('0xb'));var tilde=require('./tilde');var logger=require('../../../config/logger')(_0x0d78('0xc'));var ISPEECH_API=_0x0d78('0xd');function downloadFile(_0x1e2fde,_0x5db526){return new BPromise(function(_0x11e67b,_0x107996){var _0x1d5920=urlParse(_0x1e2fde);var _0x4c36a6=_0x1d5920['protocol']==='https:'?https:http;var _0x3c5c6e={'host':_0x1d5920[_0x0d78('0xe')],'path':_0x1d5920['path'],'headers':{'user-agent':'WHAT_EVER'}};_0x4c36a6[_0x0d78('0xf')](_0x3c5c6e,function(_0x6d2414){if(_0x6d2414['statusCode']!==0xc8){logger[_0x0d78('0x10')](_0x0d78('0x11')+_0x1e2fde+_0x0d78('0x12')+_0x6d2414[_0x0d78('0x13')]+'\x20('+_0x6d2414[_0x0d78('0x14')]+')');_0x107996(new Error(_0x0d78('0x11')+_0x1e2fde+'\x20failed,\x20status\x20code\x20=\x20'+_0x6d2414[_0x0d78('0x13')]+'\x20('+_0x6d2414[_0x0d78('0x14')]+')'));return;}var _0x1617ca=fs[_0x0d78('0x15')](_0x5db526);_0x1617ca['on'](_0x0d78('0x16'),function(){logger[_0x0d78('0x17')](_0x0d78('0x18'));_0x1617ca[_0x0d78('0x19')](_0x11e67b);});_0x1617ca['on'](_0x0d78('0x10'),function(_0x1ae7f9){fs[_0x0d78('0x1a')](_0x5db526);logger[_0x0d78('0x10')](_0x0d78('0x1b'),_0x1ae7f9);_0x107996(_0x1ae7f9);});_0x6d2414[_0x0d78('0x1c')](_0x1617ca);})['on'](_0x0d78('0x10'),function(_0x36ab5f){logger['error'](_0x36ab5f);_0x107996(_0x36ab5f);})[_0x0d78('0x1d')]();});}function uploadFile(_0x1b98b2){return new BPromise(function(_0x3d0465,_0x9e7b6c){var _0x2c3b4a=urlParse(_0x1b98b2);var _0x16ea9e=_0x2c3b4a['protocol']===_0x0d78('0x1e')?https:http;var _0x1f6adf={'host':_0x2c3b4a[_0x0d78('0xe')],'path':_0x2c3b4a[_0x0d78('0x5')],'headers':{'user-agent':_0x0d78('0x1f')}};_0x16ea9e[_0x0d78('0xf')](_0x1f6adf,function(_0x58d010){if(_0x58d010[_0x0d78('0x13')]!==0xc8){_0x9e7b6c(new Error(_0x0d78('0x11')+_0x1b98b2+_0x0d78('0x12')+_0x58d010[_0x0d78('0x13')]+'\x20('+_0x58d010[_0x0d78('0x14')]+')'));return;}var _0x16854e='';_0x58d010['on'](_0x0d78('0x20'),function(_0x2b70bf){_0x16854e+=_0x2b70bf;});_0x58d010['on']('end',function(){_0x3d0465(_0x16854e);});})['on'](_0x0d78('0x10'),function(_0x4d50f0){_0x9e7b6c(_0x4d50f0);})[_0x0d78('0x1d')]();});}function convertFile(_0x41f96e,_0xc23e65){return new BPromise(function(_0x5c438a,_0xd08531){var _0x585418=sox[_0x0d78('0x21')](_0x41f96e,_0xc23e65,{'sampleRate':0x1f40,'format':_0x0d78('0x22'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x585418['on'](_0x0d78('0x10'),function(_0x119190){logger[_0x0d78('0x10')](_0x0d78('0x23'),_0x119190);_0xd08531(_0x119190);});_0x585418['on'](_0x0d78('0x1d'),function(){logger[_0x0d78('0x17')]('finish\x20to\x20convert');_0x5c438a();});_0x585418[_0x0d78('0x24')]();});}function base64Decode(_0x21e650,_0x2bb6ac){var _0x1375a5=path[_0x0d78('0x25')](__dirname,_0x0d78('0x26'),rs[_0x0d78('0x27')](0x4)+'.wav');fs[_0x0d78('0x28')](_0x1375a5,_0x21e650,_0x0d78('0x29'));return convertFile(_0x1375a5,_0x2bb6ac)[_0x0d78('0x2a')](function(){try{fs[_0x0d78('0x1a')](_0x1375a5);fs[_0x0d78('0x2b')](_0x2bb6ac,_0x0d78('0x2c'));}catch(_0x583afc){logger[_0x0d78('0x10')](_0x583afc);}return _0x2bb6ac[_0x0d78('0x2d')]('.')[0x0];});}function base64Encode(_0x72b83d){var _0x1dcde9=fs[_0x0d78('0x2e')](_0x72b83d);return new Buffer(_0x1dcde9)[_0x0d78('0x2f')](_0x0d78('0x29'));}exports[_0x0d78('0x30')]=function(_0x468cc3,_0x3d9938,_0x2dbed8,_0xe70129,_0x44c630,_0x3b0199){var _0x41d6ed,_0x355469;var _0x2786ff='https://texttospeech.googleapis.com/v1/';var _0x1d0b40=_0x0d78('0x31')+_0x468cc3;var _0x4e708c={};if(_0x3d9938==='ssml'){_0x4e708c[_0x0d78('0x32')]={'ssml':_0x2dbed8};}else{_0x4e708c[_0x0d78('0x32')]={'text':_0x2dbed8};};_0x4e708c[_0x0d78('0x33')]={'languageCode':_0xe70129,'ssmlGender':_0x44c630};_0x4e708c['audioConfig']={'audioEncoding':_0x0d78('0x34'),'sampleRateHertz':0x1f40};var _0x6e50bf={'url':_0x2786ff+'text:synthesize'+_0x1d0b40,'method':'POST','json':!![],'body':_0x4e708c};return rp(_0x6e50bf)[_0x0d78('0x2a')](function(_0x345558){return new BPromise(function(_0xb65d2,_0x3a8765){_0x41d6ed=path[_0x0d78('0x25')](__dirname,_0x0d78('0x26'),rs['generate'](0x4)+'.mp3');var _0x430671=Buffer[_0x0d78('0x35')](_0x345558[_0x0d78('0x36')],'base64');return fs[_0x0d78('0x37')](_0x41d6ed,_0x430671,function(_0x5ee5f7){_0x3a8765(_0x5ee5f7);},function(_0x104fab){fs[_0x0d78('0x2b')](_0x41d6ed,'777');_0xb65d2(_0x104fab);});});})[_0x0d78('0x2a')](function(_0x2ccb54){_0x355469=path['resolve'](__dirname,'tmp',rs[_0x0d78('0x27')](0x4)+_0x0d78('0x38'));return convertFile(_0x41d6ed,_0x355469);})[_0x0d78('0x2a')](function(){try{fs[_0x0d78('0x1a')](_0x41d6ed);fs[_0x0d78('0x2b')](_0x355469,_0x0d78('0x2c'));}catch(_0x2177d3){logger[_0x0d78('0x10')](_0x2177d3);}logger[_0x0d78('0x17')]('googleCloudTTS\x20path',_0x355469[_0x0d78('0x2d')]('.')[0x0]);return _0x355469[_0x0d78('0x2d')]('.')[0x0];});};exports[_0x0d78('0x39')]=function(_0x3bbeea,_0x470469){var _0x595013=_0x0d78('0x3a');var _0x39aa9b,_0x3a1cf2;var _0x5b0c50;var _0x3c56e2={'encoding':_0x0d78('0x3b'),'method':'POST','timeout':0x2710,'url':_0x595013,'headers':{'Content-Type':_0x0d78('0x3c')},'body':_0x0d78('0x3d')+encodeURIComponent(JSON[_0x0d78('0x3e')]([[['jQ1olc',JSON['stringify']([_0x3bbeea,_0x470469||'en',![],'null']),null,_0x0d78('0x3f')]]]))};return rp(_0x3c56e2)[_0x0d78('0x2a')](function(_0x326975){try{_0x5b0c50=eval(_0x326975[_0x0d78('0x40')](0x5))[0x0][0x2];}catch(_0x329bc3){throw new Error(_0x0d78('0x41')+_0x326975[_0x0d78('0x20')]);}if(!_0x5b0c50){if(_0x3bbeea[_0x0d78('0x42')]>0xc8){throw new Error(_0x0d78('0x43'));}else{throw new Error(_0x0d78('0x44')+_0x470469+_0x0d78('0x45'));}}try{_0x5b0c50=eval(_0x5b0c50)[0x0];}catch(_0x5d5959){throw new Error('parse\x20response\x20failed:\x0a'+res[_0x0d78('0x20')]);}const _0xa9a9a5=_0x5b0c50;_0x39aa9b=path[_0x0d78('0x25')](__dirname,_0x0d78('0x26'),rs[_0x0d78('0x27')](0x4)+_0x0d78('0x46'));fs[_0x0d78('0x28')](_0x39aa9b,_0x5b0c50,{'encoding':_0x0d78('0x29')});_0x3a1cf2=path['resolve'](__dirname,_0x0d78('0x26'),rs[_0x0d78('0x27')](0x4)+_0x0d78('0x38'));return convertFile(_0x39aa9b,_0x3a1cf2);})['then'](function(){try{fs[_0x0d78('0x1a')](_0x39aa9b);fs[_0x0d78('0x2b')](_0x3a1cf2,_0x0d78('0x2c'));}catch(_0x55a889){logger[_0x0d78('0x10')](_0x55a889);}logger[_0x0d78('0x17')](_0x0d78('0x47'),_0x3a1cf2['split']('.')[0x0]);return _0x3a1cf2[_0x0d78('0x2d')]('.')[0x0];});};exports[_0x0d78('0x48')]=function(_0x2f1fc7,_0x42e4ea,_0x4225cf){return google[_0x0d78('0x49')](_0x2f1fc7,_0x42e4ea,_0x4225cf)[_0x0d78('0x2a')](function(_0xf968c0){logger['info'](_0xf968c0[_0x0d78('0x4a')]);return rp(_0xf968c0);})[_0x0d78('0x2a')](function(_0xfedb8f){var _0xf09d40='';var _0x453f9d=0x0;try{fs[_0x0d78('0x1a')](_0x2f1fc7);}catch(_0xbf1e91){logger[_0x0d78('0x10')](_0xbf1e91);}if(_0xfedb8f&&_0xfedb8f[_0x0d78('0x4b')]){_0xf09d40=_0xfedb8f[_0x0d78('0x4b')]['map'](function(_0x278c7){return _0x278c7&&_0x278c7['alternatives'][0x0]&&_0x278c7[_0x0d78('0x4c')][0x0][_0x0d78('0x4d')]?_0x278c7[_0x0d78('0x4c')][0x0][_0x0d78('0x4d')]:'';})[_0x0d78('0x4e')]('\x0a');_0x453f9d=_0xfedb8f['results'][_0x0d78('0x4f')](function(_0x22d7fc){return _0x22d7fc&&_0x22d7fc['alternatives'][0x0]&&_0x22d7fc[_0x0d78('0x4c')][0x0][_0x0d78('0x50')]?_0x22d7fc[_0x0d78('0x4c')][0x0][_0x0d78('0x50')]:0x0;})['join']('\x0a');}logger[_0x0d78('0x17')](_0x0d78('0x51'),_0xf09d40);logger[_0x0d78('0x17')](_0x0d78('0x52'),_0x453f9d);return{'transcript':_0xf09d40,'confidence':_0x453f9d};})[_0x0d78('0x53')](function(_0x4714b2){logger[_0x0d78('0x10')](_0x0d78('0x54'),_0x4714b2[_0x0d78('0x13')],_0x4714b2[_0x0d78('0x55')],_0x4714b2[_0x0d78('0x56')]);});};exports[_0x0d78('0x57')]=function(_0x1ddf47,_0x116d10,_0x1b3584,_0x566f27){var _0x1f3e29=apiai(_0x116d10,{'language':_0x566f27||'en'});return _0x1f3e29[_0x0d78('0x58')](_0x1b3584,{'sessionId':md5(_0x1ddf47)})[_0x0d78('0x2a')](function(_0x20cc6c){logger['info'](JSON['stringify'](_0x20cc6c));return{'source':_0x20cc6c['result'][_0x0d78('0x59')],'resolvedQuery':_0x20cc6c[_0x0d78('0x5a')][_0x0d78('0x5b')],'action':_0x20cc6c['result'][_0x0d78('0x5c')],'actionIncomplete':_0x20cc6c['result'][_0x0d78('0x5d')],'speech':_0x20cc6c[_0x0d78('0x5a')][_0x0d78('0x5e')][_0x0d78('0x5f')],'score':_0x20cc6c[_0x0d78('0x5a')]['score'],'statusCode':_0x20cc6c['status'][_0x0d78('0x60')],'endConversation':_0x20cc6c[_0x0d78('0x5a')]['metadata'][_0x0d78('0x61')]||![],'isFallbackIntent':_0x20cc6c[_0x0d78('0x5a')][_0x0d78('0x62')][_0x0d78('0x63')]};});};exports[_0x0d78('0x64')]=function(_0x11a688,_0x115793,_0x58742f,_0x529cf3,_0x4ad378,_0xacd12f){var _0x47ed75=_0x529cf3[_0x0d78('0x65')](/\\n/g,'\x0a');var _0x242988={'credentials':{'private_key':_0x47ed75,'client_email':_0x58742f}};var _0x25af05=new dialogflow[(_0x0d78('0x66'))](_0x242988);var _0x1469d0=_0x25af05[_0x0d78('0x67')](_0x115793,md5(_0x11a688));var _0x2ee2cd={'session':_0x1469d0,'queryInput':{'text':{'text':_0x4ad378,'languageCode':_0xacd12f}}};return _0x25af05[_0x0d78('0x68')](_0x2ee2cd)[_0x0d78('0x2a')](function(_0x212c87){if(_0x212c87&&_0x212c87['length']){logger[_0x0d78('0x17')](_0x0d78('0x69'),JSON[_0x0d78('0x3e')](_0x212c87));var _0x3fd5d1=_0x212c87[0x0];if(_0x3fd5d1){var _0x2b1e14={'action':_0x3fd5d1[_0x0d78('0x6a')][_0x0d78('0x5c')],'allRequiredParamsPresent':_0x3fd5d1[_0x0d78('0x6a')][_0x0d78('0x6b')],'endConversation':_0x3fd5d1[_0x0d78('0x6a')][_0x0d78('0x6c')]&&_0x3fd5d1[_0x0d78('0x6a')][_0x0d78('0x6c')][_0x0d78('0x6d')]?_0x3fd5d1['queryResult']['diagnosticInfo'][_0x0d78('0x6d')][_0x0d78('0x6e')][_0x0d78('0x6f')]:![],'fulfillmentText':_0x3fd5d1['queryResult'][_0x0d78('0x70')],'intentName':_0x3fd5d1['queryResult']['intent'][_0x0d78('0x55')],'intentDisplayName':_0x3fd5d1['queryResult'][_0x0d78('0x71')][_0x0d78('0x72')],'isFallbackIntent':_0x3fd5d1['queryResult']['intent']['isFallback'],'languageCode':_0x3fd5d1['queryResult'][_0x0d78('0x73')],'queryText':_0x3fd5d1[_0x0d78('0x6a')][_0x0d78('0x74')],'responseId':_0x3fd5d1['responseId'],'score':_0x3fd5d1['queryResult']['intentDetectionConfidence'],'speech':_0x3fd5d1[_0x0d78('0x6a')][_0x0d78('0x70')],'providerResponse':JSON['stringify'](_0x212c87)};return _0x2b1e14;}}});};exports[_0x0d78('0x75')]=function(_0x454aae,_0x13446e,_0x2e09e5,_0x549543){return tilde[_0x0d78('0x49')](_0x454aae,_0x13446e,_0x2e09e5,_0x549543)[_0x0d78('0x2a')](function(_0x43ac84){try{fs[_0x0d78('0x1a')](_0x454aae);}catch(_0x10cf67){logger['error'](_0x10cf67);}logger[_0x0d78('0x17')](_0x0d78('0x76'),_0x43ac84[_0x0d78('0x4d')]);logger['info'](_0x0d78('0x77'),_0x43ac84[_0x0d78('0x50')]);return _0x43ac84;});};exports['awsPolly']=function(_0x3aba92,_0x5ca55c,_0x584ed5,_0xfd89b1,_0x4a597f,_0x38c0d0){var _0x702a57=path['resolve'](__dirname,_0x0d78('0x26'),rs[_0x0d78('0x27')](0x4)+_0x0d78('0x46'));var _0x2f2a2b;return aws[_0x0d78('0x78')](_0x3aba92,_0x5ca55c,_0x584ed5,_0xfd89b1,_0x4a597f,_0x38c0d0,_0x702a57)['then'](function(){_0x2f2a2b=path[_0x0d78('0x25')](__dirname,'tmp',rs[_0x0d78('0x27')](0x4)+'.wav');return convertFile(_0x702a57,_0x2f2a2b);})['then'](function(){try{fs[_0x0d78('0x1a')](_0x702a57);fs[_0x0d78('0x2b')](_0x2f2a2b,_0x0d78('0x2c'));}catch(_0x29558f){logger[_0x0d78('0x10')](_0x29558f);}return _0x2f2a2b['split']('.')[0x0];});};exports[_0x0d78('0x79')]=function(_0x3474e2,_0x44d516,_0xdb38e6,_0x2e017a,_0x5141d9,_0x4eb9ba){return aws[_0x0d78('0x7a')](_0x3474e2,_0x44d516,_0xdb38e6,_0x2e017a,_0x5141d9,_0x4eb9ba)[_0x0d78('0x2a')](function(_0x339930){logger[_0x0d78('0x17')](JSON['stringify'](_0x339930));return _0x339930;});};exports['ispeechTTS']=function(_0x11724d,_0x568049,_0x4cbd76,_0x285569){var _0x47ca2d=util[_0x0d78('0x7b')](_0x0d78('0x7c'),ISPEECH_API,_0x11724d,encodeURIComponent(_0x568049),_0x4cbd76,_0x285569);var _0x3ccc6e=path[_0x0d78('0x25')](__dirname,_0x0d78('0x26'),rs['generate'](0x4)+_0x0d78('0x46'));var _0x12e5d;return downloadFile(_0x47ca2d,_0x3ccc6e)['then'](function(){_0x12e5d=path[_0x0d78('0x25')](__dirname,_0x0d78('0x26'),rs[_0x0d78('0x27')](0x4)+_0x0d78('0x38'));return convertFile(_0x3ccc6e,_0x12e5d);})[_0x0d78('0x2a')](function(){try{fs[_0x0d78('0x1a')](_0x3ccc6e);fs['chmodSync'](_0x12e5d,'777');}catch(_0x16b066){logger[_0x0d78('0x10')](_0x16b066);}return _0x12e5d[_0x0d78('0x2d')]('.')[0x0];});};exports['ispeechASR']=function(_0x42cd07,_0x3e6e9e,_0x4e5f24,_0x24336f){var _0x4390fa=util[_0x0d78('0x7b')](_0x0d78('0x7d'),ISPEECH_API,_0x3e6e9e,_0x4e5f24,base64Encode(_0x42cd07),_0x24336f?util[_0x0d78('0x7b')](_0x0d78('0x7e'),encodeURIComponent(_0x24336f)):_0x0d78('0x7f'));return uploadFile(_0x4390fa)['then'](function(_0x1db960){return querystring[_0x0d78('0xa')](_0x1db960);});};exports[_0x0d78('0x80')]=function(_0x1ef6c2,_0x205447){return sestek[_0x0d78('0x81')](_0x1ef6c2,_0x205447)[_0x0d78('0x2a')](function(_0x5208c6){logger['info'](JSON[_0x0d78('0x3e')](_0x5208c6));var _0x3b39c3={'speech':_0x5208c6['text'],'action':_0x5208c6[_0x0d78('0x82')]?_0x5208c6[_0x0d78('0x82')][_0x0d78('0x83')]:undefined,'actiondata':_0x5208c6[_0x0d78('0x82')]?_0x5208c6[_0x0d78('0x82')][_0x0d78('0x84')]:undefined};if(_0x5208c6[_0x0d78('0x82')]&&_0x5208c6[_0x0d78('0x82')][_0x0d78('0x85')]){return base64Decode(_0x5208c6[_0x0d78('0x82')][_0x0d78('0x85')][_0x0d78('0x86')],path[_0x0d78('0x25')](__dirname,_0x0d78('0x26'),rs[_0x0d78('0x27')](0x4)+_0x0d78('0x38')))['then'](function(_0x562b09){_0x3b39c3[_0x0d78('0x87')]=_0x562b09;return _0x3b39c3;});}return _0x3b39c3;});};exports['dirName']=function(){return __dirname;}; \ No newline at end of file +var _0x84be=['start','resolve','tmp','generate','.wav','writeFileSync','then','chmodSync','split','readFileSync','toString','googleCloudTTS','https://texttospeech.googleapis.com/v1/','ssml','input','voice','MP3','text:synthesize','POST','from','audioContent','777','googleCloudTTS\x20path','googleTTS','https://translate.google.com/_/TranslateWebserverUi/data/batchexecute','utf8','f.req=','jQ1olc','stringify','generic','slice','parse\x20response\x20failed:\x0a','length','text\x20length\x20limit\x20reached','lang\x20\x22','\x22\x20might\x20not\x20exist','.mp3','base64','goggleTTS\x20path','googleASR','results','alternatives','transcript','map','confidence','join','googleASR\x20transcription','catch','[%s]\x20%s:%s','name','message','textRequest','source','result','resolvedQuery','action','actionIncomplete','fulfillment','score','status','code','metadata','endConversation','googleDialogflowV2','replace','sessionPath','detectIntent','queryResult','allRequiredParamsPresent','diagnosticInfo','fields','end_conversation','boolValue','fulfillmentText','intent','displayName','isFallback','languageCode','queryText','responseId','tildeASR','asr','Tilde\x20ASR\x20transcription','awsPolly','polly','awsLex','lex','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','sestekNDA','nda','text','channelData','CustomAction','CustomActionData','AudioFromTts','Data','dirName','bluebird','dialogflow','http','md5','path','querystring','request-promise','sox','google-tts-api','url','parse','util','./aws','./google','./sestek','./tilde','agi','https://api.ispeech.org/api/rest','protocol','host','WHAT_EVER','get','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusCode','statusMessage','finish','info','finish\x20download\x20file','close','unlink','download\x20error','end','data','transcode','wav','error\x20convert'];(function(_0x5cb97e,_0x132a39){var _0x1714b4=function(_0x384210){while(--_0x384210){_0x5cb97e['push'](_0x5cb97e['shift']());}};_0x1714b4(++_0x132a39);}(_0x84be,0x66));var _0xe84b=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x84be[_0x1035c1];return _0x308d67;};'use strict';var apiai=require('apiai-promise');var BPromise=require(_0xe84b('0x0'));var dialogflow=require(_0xe84b('0x1'));var fs=require('fs');var http=require(_0xe84b('0x2'));var https=require('https');var md5=require(_0xe84b('0x3'));var path=require(_0xe84b('0x4'));var querystring=require(_0xe84b('0x5'));var rp=require(_0xe84b('0x6'));var rs=require('randomstring');var sox=require(_0xe84b('0x7'));var tts=require(_0xe84b('0x8'));var urlParse=require(_0xe84b('0x9'))[_0xe84b('0xa')];var util=require(_0xe84b('0xb'));var aws=require(_0xe84b('0xc'));var google=require(_0xe84b('0xd'));var sestek=require(_0xe84b('0xe'));var tilde=require(_0xe84b('0xf'));var logger=require('../../../config/logger')(_0xe84b('0x10'));var ISPEECH_API=_0xe84b('0x11');function downloadFile(_0x279e87,_0x34998b){return new BPromise(function(_0x3d76e9,_0x3fd392){var _0x124315=urlParse(_0x279e87);var _0x3c836e=_0x124315[_0xe84b('0x12')]==='https:'?https:http;var _0xa9b6c4={'host':_0x124315[_0xe84b('0x13')],'path':_0x124315['path'],'headers':{'user-agent':_0xe84b('0x14')}};_0x3c836e[_0xe84b('0x15')](_0xa9b6c4,function(_0x37ce15){if(_0x37ce15['statusCode']!==0xc8){logger[_0xe84b('0x16')](_0xe84b('0x17')+_0x279e87+_0xe84b('0x18')+_0x37ce15[_0xe84b('0x19')]+'\x20('+_0x37ce15[_0xe84b('0x1a')]+')');_0x3fd392(new Error(_0xe84b('0x17')+_0x279e87+_0xe84b('0x18')+_0x37ce15[_0xe84b('0x19')]+'\x20('+_0x37ce15[_0xe84b('0x1a')]+')'));return;}var _0x48dfa4=fs['createWriteStream'](_0x34998b);_0x48dfa4['on'](_0xe84b('0x1b'),function(){logger[_0xe84b('0x1c')](_0xe84b('0x1d'));_0x48dfa4[_0xe84b('0x1e')](_0x3d76e9);});_0x48dfa4['on'](_0xe84b('0x16'),function(_0x192869){fs[_0xe84b('0x1f')](_0x34998b);logger['error'](_0xe84b('0x20'),_0x192869);_0x3fd392(_0x192869);});_0x37ce15['pipe'](_0x48dfa4);})['on'](_0xe84b('0x16'),function(_0x180c30){logger['error'](_0x180c30);_0x3fd392(_0x180c30);})[_0xe84b('0x21')]();});}function uploadFile(_0x1b5117){return new BPromise(function(_0x3cba2a,_0x37b7b4){var _0x15c245=urlParse(_0x1b5117);var _0x167aae=_0x15c245[_0xe84b('0x12')]==='https:'?https:http;var _0x5c4fe3={'host':_0x15c245[_0xe84b('0x13')],'path':_0x15c245['path'],'headers':{'user-agent':_0xe84b('0x14')}};_0x167aae['get'](_0x5c4fe3,function(_0x21a542){if(_0x21a542[_0xe84b('0x19')]!==0xc8){_0x37b7b4(new Error('request\x20to\x20'+_0x1b5117+_0xe84b('0x18')+_0x21a542['statusCode']+'\x20('+_0x21a542['statusMessage']+')'));return;}var _0x4bd23d='';_0x21a542['on'](_0xe84b('0x22'),function(_0x5b41dd){_0x4bd23d+=_0x5b41dd;});_0x21a542['on'](_0xe84b('0x21'),function(){_0x3cba2a(_0x4bd23d);});})['on'](_0xe84b('0x16'),function(_0x4f1830){_0x37b7b4(_0x4f1830);})[_0xe84b('0x21')]();});}function convertFile(_0x18770d,_0x5278a2){return new BPromise(function(_0x3e5eac,_0x51cabb){var _0x51c89e=sox[_0xe84b('0x23')](_0x18770d,_0x5278a2,{'sampleRate':0x1f40,'format':_0xe84b('0x24'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x51c89e['on']('error',function(_0x827681){logger[_0xe84b('0x16')](_0xe84b('0x25'),_0x827681);_0x51cabb(_0x827681);});_0x51c89e['on'](_0xe84b('0x21'),function(){logger[_0xe84b('0x1c')]('finish\x20to\x20convert');_0x3e5eac();});_0x51c89e[_0xe84b('0x26')]();});}function base64Decode(_0x1a958d,_0x2fa41b){var _0x5317f5=path[_0xe84b('0x27')](__dirname,_0xe84b('0x28'),rs[_0xe84b('0x29')](0x4)+_0xe84b('0x2a'));fs[_0xe84b('0x2b')](_0x5317f5,_0x1a958d,'base64');return convertFile(_0x5317f5,_0x2fa41b)[_0xe84b('0x2c')](function(){try{fs[_0xe84b('0x1f')](_0x5317f5);fs[_0xe84b('0x2d')](_0x2fa41b,'777');}catch(_0x29293e){logger[_0xe84b('0x16')](_0x29293e);}return _0x2fa41b[_0xe84b('0x2e')]('.')[0x0];});}function base64Encode(_0x458391){var _0x242e95=fs[_0xe84b('0x2f')](_0x458391);return new Buffer(_0x242e95)[_0xe84b('0x30')]('base64');}exports[_0xe84b('0x31')]=function(_0x57cc0e,_0x496c80,_0x55106e,_0x4b4438,_0x3708de,_0x3fdd53){var _0xcae38,_0x35338b;var _0x362189=_0xe84b('0x32');var _0x1fd25c='?key='+_0x57cc0e;var _0x548746={};if(_0x496c80===_0xe84b('0x33')){_0x548746[_0xe84b('0x34')]={'ssml':_0x55106e};}else{_0x548746[_0xe84b('0x34')]={'text':_0x55106e};};_0x548746[_0xe84b('0x35')]={'languageCode':_0x4b4438,'ssmlGender':_0x3708de};_0x548746['audioConfig']={'audioEncoding':_0xe84b('0x36'),'sampleRateHertz':0x1f40};var _0x5cd497={'url':_0x362189+_0xe84b('0x37')+_0x1fd25c,'method':_0xe84b('0x38'),'json':!![],'body':_0x548746};return rp(_0x5cd497)[_0xe84b('0x2c')](function(_0x590d5e){return new BPromise(function(_0x45cefb,_0x12979a){_0xcae38=path[_0xe84b('0x27')](__dirname,_0xe84b('0x28'),rs[_0xe84b('0x29')](0x4)+'.mp3');var _0x3e9a20=Buffer[_0xe84b('0x39')](_0x590d5e[_0xe84b('0x3a')],'base64');return fs['writeFile'](_0xcae38,_0x3e9a20,function(_0x4d7f1c){_0x12979a(_0x4d7f1c);},function(_0x3c98e2){fs[_0xe84b('0x2d')](_0xcae38,_0xe84b('0x3b'));_0x45cefb(_0x3c98e2);});});})[_0xe84b('0x2c')](function(_0x41f6b5){_0x35338b=path['resolve'](__dirname,_0xe84b('0x28'),rs[_0xe84b('0x29')](0x4)+_0xe84b('0x2a'));return convertFile(_0xcae38,_0x35338b);})[_0xe84b('0x2c')](function(){try{fs[_0xe84b('0x1f')](_0xcae38);fs[_0xe84b('0x2d')](_0x35338b,_0xe84b('0x3b'));}catch(_0xb8375e){logger[_0xe84b('0x16')](_0xb8375e);}logger[_0xe84b('0x1c')](_0xe84b('0x3c'),_0x35338b['split']('.')[0x0]);return _0x35338b[_0xe84b('0x2e')]('.')[0x0];});};exports[_0xe84b('0x3d')]=function(_0x1589a3,_0x5b5dac){var _0x1a4da3=_0xe84b('0x3e');var _0x4eba85,_0x5a6e05;var _0xb03593;var _0x34b9a2={'encoding':_0xe84b('0x3f'),'method':_0xe84b('0x38'),'timeout':0x2710,'url':_0x1a4da3,'headers':{'Content-Type':'application/x-www-form-urlencoded'},'body':_0xe84b('0x40')+encodeURIComponent(JSON['stringify']([[[_0xe84b('0x41'),JSON[_0xe84b('0x42')]([_0x1589a3,_0x5b5dac||'en',![],'null']),null,_0xe84b('0x43')]]]))};return rp(_0x34b9a2)[_0xe84b('0x2c')](function(_0x4fef5a){try{_0xb03593=eval(_0x4fef5a[_0xe84b('0x44')](0x5))[0x0][0x2];}catch(_0x112ba5){throw new Error(_0xe84b('0x45')+_0x4fef5a['data']);}if(!_0xb03593){if(_0x1589a3[_0xe84b('0x46')]>0xc8){throw new Error(_0xe84b('0x47'));}else{throw new Error(_0xe84b('0x48')+_0x5b5dac+_0xe84b('0x49'));}}try{_0xb03593=eval(_0xb03593)[0x0];}catch(_0x1ea857){throw new Error(_0xe84b('0x45')+res['data']);}const _0x2ff8e6=_0xb03593;_0x4eba85=path[_0xe84b('0x27')](__dirname,_0xe84b('0x28'),rs[_0xe84b('0x29')](0x4)+_0xe84b('0x4a'));fs['writeFileSync'](_0x4eba85,_0xb03593,{'encoding':_0xe84b('0x4b')});_0x5a6e05=path[_0xe84b('0x27')](__dirname,_0xe84b('0x28'),rs[_0xe84b('0x29')](0x4)+_0xe84b('0x2a'));return convertFile(_0x4eba85,_0x5a6e05);})[_0xe84b('0x2c')](function(){try{fs['unlink'](_0x4eba85);fs[_0xe84b('0x2d')](_0x5a6e05,_0xe84b('0x3b'));}catch(_0x154fbb){logger[_0xe84b('0x16')](_0x154fbb);}logger[_0xe84b('0x1c')](_0xe84b('0x4c'),_0x5a6e05[_0xe84b('0x2e')]('.')[0x0]);return _0x5a6e05[_0xe84b('0x2e')]('.')[0x0];});};exports[_0xe84b('0x4d')]=function(_0x4fd04a,_0x4ccf4d,_0x31cb77){return google['asr'](_0x4fd04a,_0x4ccf4d,_0x31cb77)[_0xe84b('0x2c')](function(_0x298cf1){logger[_0xe84b('0x1c')](_0x298cf1['uri']);return rp(_0x298cf1);})['then'](function(_0x5aad71){var _0x4d32b6='';var _0xfeb087=0x0;try{fs[_0xe84b('0x1f')](_0x4fd04a);}catch(_0x5750d8){logger[_0xe84b('0x16')](_0x5750d8);}if(_0x5aad71&&_0x5aad71[_0xe84b('0x4e')]){_0x4d32b6=_0x5aad71['results']['map'](function(_0x43a970){return _0x43a970&&_0x43a970[_0xe84b('0x4f')][0x0]&&_0x43a970[_0xe84b('0x4f')][0x0][_0xe84b('0x50')]?_0x43a970[_0xe84b('0x4f')][0x0][_0xe84b('0x50')]:'';})['join']('\x0a');_0xfeb087=_0x5aad71[_0xe84b('0x4e')][_0xe84b('0x51')](function(_0x404a1b){return _0x404a1b&&_0x404a1b[_0xe84b('0x4f')][0x0]&&_0x404a1b['alternatives'][0x0][_0xe84b('0x52')]?_0x404a1b[_0xe84b('0x4f')][0x0][_0xe84b('0x52')]:0x0;})[_0xe84b('0x53')]('\x0a');}logger[_0xe84b('0x1c')](_0xe84b('0x54'),_0x4d32b6);logger[_0xe84b('0x1c')]('googleASR\x20confidence',_0xfeb087);return{'transcript':_0x4d32b6,'confidence':_0xfeb087};})[_0xe84b('0x55')](function(_0x2761c2){logger[_0xe84b('0x16')](_0xe84b('0x56'),_0x2761c2[_0xe84b('0x19')],_0x2761c2[_0xe84b('0x57')],_0x2761c2[_0xe84b('0x58')]);});};exports['googleDialogflow']=function(_0x81d6e,_0x3ce23f,_0x38066e,_0x2d6b4d){var _0x3e7e2d=apiai(_0x3ce23f,{'language':_0x2d6b4d||'en'});return _0x3e7e2d[_0xe84b('0x59')](_0x38066e,{'sessionId':md5(_0x81d6e)})[_0xe84b('0x2c')](function(_0x2fd7f5){logger['info'](JSON[_0xe84b('0x42')](_0x2fd7f5));return{'source':_0x2fd7f5['result'][_0xe84b('0x5a')],'resolvedQuery':_0x2fd7f5[_0xe84b('0x5b')][_0xe84b('0x5c')],'action':_0x2fd7f5['result'][_0xe84b('0x5d')],'actionIncomplete':_0x2fd7f5[_0xe84b('0x5b')][_0xe84b('0x5e')],'speech':_0x2fd7f5[_0xe84b('0x5b')][_0xe84b('0x5f')]['speech'],'score':_0x2fd7f5['result'][_0xe84b('0x60')],'statusCode':_0x2fd7f5[_0xe84b('0x61')][_0xe84b('0x62')],'endConversation':_0x2fd7f5[_0xe84b('0x5b')][_0xe84b('0x63')][_0xe84b('0x64')]||![],'isFallbackIntent':_0x2fd7f5['result'][_0xe84b('0x63')]['isFallbackIntent']};});};exports[_0xe84b('0x65')]=function(_0x27f8ea,_0xa36bbe,_0x581472,_0x46b596,_0x404da9,_0x5470f6){var _0x1510f8=_0x46b596[_0xe84b('0x66')](/\\n/g,'\x0a');var _0x2e3bae={'credentials':{'private_key':_0x1510f8,'client_email':_0x581472}};var _0x1de780=new dialogflow['SessionsClient'](_0x2e3bae);var _0x34eca7=_0x1de780[_0xe84b('0x67')](_0xa36bbe,md5(_0x27f8ea));var _0x259299={'session':_0x34eca7,'queryInput':{'text':{'text':_0x404da9,'languageCode':_0x5470f6}}};return _0x1de780[_0xe84b('0x68')](_0x259299)['then'](function(_0x2b24d5){if(_0x2b24d5&&_0x2b24d5['length']){logger[_0xe84b('0x1c')]('Dialogflow\x20V2\x20response:',JSON[_0xe84b('0x42')](_0x2b24d5));var _0x3994c2=_0x2b24d5[0x0];if(_0x3994c2){var _0xf41c7d={'action':_0x3994c2[_0xe84b('0x69')][_0xe84b('0x5d')],'allRequiredParamsPresent':_0x3994c2['queryResult'][_0xe84b('0x6a')],'endConversation':_0x3994c2[_0xe84b('0x69')]['diagnosticInfo']&&_0x3994c2[_0xe84b('0x69')][_0xe84b('0x6b')][_0xe84b('0x6c')]?_0x3994c2[_0xe84b('0x69')][_0xe84b('0x6b')][_0xe84b('0x6c')][_0xe84b('0x6d')][_0xe84b('0x6e')]:![],'fulfillmentText':_0x3994c2[_0xe84b('0x69')][_0xe84b('0x6f')],'intentName':_0x3994c2[_0xe84b('0x69')][_0xe84b('0x70')][_0xe84b('0x57')],'intentDisplayName':_0x3994c2[_0xe84b('0x69')]['intent'][_0xe84b('0x71')],'isFallbackIntent':_0x3994c2[_0xe84b('0x69')]['intent'][_0xe84b('0x72')],'languageCode':_0x3994c2[_0xe84b('0x69')][_0xe84b('0x73')],'queryText':_0x3994c2[_0xe84b('0x69')][_0xe84b('0x74')],'responseId':_0x3994c2[_0xe84b('0x75')],'score':_0x3994c2['queryResult']['intentDetectionConfidence'],'speech':_0x3994c2[_0xe84b('0x69')][_0xe84b('0x6f')],'providerResponse':JSON[_0xe84b('0x42')](_0x2b24d5)};return _0xf41c7d;}}});};exports[_0xe84b('0x76')]=function(_0x47d3ef,_0x67b98f,_0x570b36,_0x7d1d73){return tilde[_0xe84b('0x77')](_0x47d3ef,_0x67b98f,_0x570b36,_0x7d1d73)[_0xe84b('0x2c')](function(_0x14f064){try{fs['unlink'](_0x47d3ef);}catch(_0xb4cc7c){logger[_0xe84b('0x16')](_0xb4cc7c);}logger['info'](_0xe84b('0x78'),_0x14f064[_0xe84b('0x50')]);logger[_0xe84b('0x1c')]('Tilde\x20ASR\x20confidence',_0x14f064[_0xe84b('0x52')]);return _0x14f064;});};exports[_0xe84b('0x79')]=function(_0xeb896,_0x31c921,_0x4a8715,_0x3dceb8,_0xc504a5,_0x375e85){var _0x2a7757=path['resolve'](__dirname,'tmp',rs[_0xe84b('0x29')](0x4)+_0xe84b('0x4a'));var _0x1bf103;return aws[_0xe84b('0x7a')](_0xeb896,_0x31c921,_0x4a8715,_0x3dceb8,_0xc504a5,_0x375e85,_0x2a7757)[_0xe84b('0x2c')](function(){_0x1bf103=path[_0xe84b('0x27')](__dirname,_0xe84b('0x28'),rs[_0xe84b('0x29')](0x4)+'.wav');return convertFile(_0x2a7757,_0x1bf103);})[_0xe84b('0x2c')](function(){try{fs[_0xe84b('0x1f')](_0x2a7757);fs[_0xe84b('0x2d')](_0x1bf103,_0xe84b('0x3b'));}catch(_0x2fbe38){logger['error'](_0x2fbe38);}return _0x1bf103[_0xe84b('0x2e')]('.')[0x0];});};exports[_0xe84b('0x7b')]=function(_0x3fc543,_0x391474,_0x3ac342,_0x5bdbb4,_0xc68ba8,_0x4605cb){return aws[_0xe84b('0x7c')](_0x3fc543,_0x391474,_0x3ac342,_0x5bdbb4,_0xc68ba8,_0x4605cb)['then'](function(_0x11c38e){logger[_0xe84b('0x1c')](JSON[_0xe84b('0x42')](_0x11c38e));return _0x11c38e;});};exports[_0xe84b('0x7d')]=function(_0x3bb4e6,_0x1fe3d8,_0x1de2b6,_0x3182ae){var _0x5a1eee=util[_0xe84b('0x7e')](_0xe84b('0x7f'),ISPEECH_API,_0x3bb4e6,encodeURIComponent(_0x1fe3d8),_0x1de2b6,_0x3182ae);var _0x11eb38=path[_0xe84b('0x27')](__dirname,_0xe84b('0x28'),rs[_0xe84b('0x29')](0x4)+_0xe84b('0x4a'));var _0x313229;return downloadFile(_0x5a1eee,_0x11eb38)['then'](function(){_0x313229=path['resolve'](__dirname,'tmp',rs[_0xe84b('0x29')](0x4)+_0xe84b('0x2a'));return convertFile(_0x11eb38,_0x313229);})[_0xe84b('0x2c')](function(){try{fs[_0xe84b('0x1f')](_0x11eb38);fs[_0xe84b('0x2d')](_0x313229,_0xe84b('0x3b'));}catch(_0x30aeec){logger[_0xe84b('0x16')](_0x30aeec);}return _0x313229[_0xe84b('0x2e')]('.')[0x0];});};exports[_0xe84b('0x80')]=function(_0x372b47,_0x4c9b86,_0x52bf1c,_0x54e5fd){var _0x24ad22=util[_0xe84b('0x7e')](_0xe84b('0x81'),ISPEECH_API,_0x4c9b86,_0x52bf1c,base64Encode(_0x372b47),_0x54e5fd?util['format'](_0xe84b('0x82'),encodeURIComponent(_0x54e5fd)):'freeform=3');return uploadFile(_0x24ad22)[_0xe84b('0x2c')](function(_0x287b98){return querystring[_0xe84b('0xa')](_0x287b98);});};exports[_0xe84b('0x83')]=function(_0x59d09f,_0x3c28d3){return sestek[_0xe84b('0x84')](_0x59d09f,_0x3c28d3)[_0xe84b('0x2c')](function(_0x32b21f){logger[_0xe84b('0x1c')](JSON['stringify'](_0x32b21f));var _0x323980={'speech':_0x32b21f[_0xe84b('0x85')],'action':_0x32b21f[_0xe84b('0x86')]?_0x32b21f[_0xe84b('0x86')][_0xe84b('0x87')]:undefined,'actiondata':_0x32b21f[_0xe84b('0x86')]?_0x32b21f[_0xe84b('0x86')][_0xe84b('0x88')]:undefined};if(_0x32b21f[_0xe84b('0x86')]&&_0x32b21f[_0xe84b('0x86')][_0xe84b('0x89')]){return base64Decode(_0x32b21f[_0xe84b('0x86')][_0xe84b('0x89')][_0xe84b('0x8a')],path['resolve'](__dirname,_0xe84b('0x28'),rs['generate'](0x4)+_0xe84b('0x2a')))[_0xe84b('0x2c')](function(_0x4d2c58){_0x323980['audiofile']=_0x4d2c58;return _0x323980;});}return _0x323980;});};exports[_0xe84b('0x8b')]=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 fc1e71b..1d8063e 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 _0x061e=['./nda','exports'];(function(_0x540102,_0x455509){var _0x310d5b=function(_0x39491b){while(--_0x39491b){_0x540102['push'](_0x540102['shift']());}};_0x310d5b(++_0x455509);}(_0x061e,0xbe));var _0xe061=function(_0x3832fa,_0x49d83e){_0x3832fa=_0x3832fa-0x0;var _0x5c94ab=_0x061e[_0x3832fa];return _0x5c94ab;};var nda=require(_0xe061('0x0'));module[_0xe061('0x1')]={'nda':nda}; \ No newline at end of file +var _0xcdf2=['exports','./nda'];(function(_0x4ba811,_0x4428f2){var _0x3b616f=function(_0x5cc7e1){while(--_0x5cc7e1){_0x4ba811['push'](_0x4ba811['shift']());}};_0x3b616f(++_0x4428f2);}(_0xcdf2,0x155));var _0x2cdf=function(_0x382e89,_0x4768c0){_0x382e89=_0x382e89-0x0;var _0x3a1318=_0xcdf2[_0x382e89];return _0x3a1318;};var nda=require(_0x2cdf('0x0'));module[_0x2cdf('0x1')]={'nda':nda}; \ No newline at end of file diff --git a/server/services/agi/scripts/sestek/nda/index.js b/server/services/agi/scripts/sestek/nda/index.js index 132384b..1560641 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 _0x122a=['/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','callerid','dnid','extension','Bearer\x20','body','channelData','project','ndagenerate_audio','AudioOutputSettings','audio/wav','custom_action','CustomAction','custom_action_data','CustomActionData','info','stringify','request-promise','url','../../../../../config/logger','agi','exports','resolve','ndauth_url','/token','password','ndassistant_url'];(function(_0x5c3526,_0x2a1e90){var _0xec27a2=function(_0x5ac4e1){while(--_0x5ac4e1){_0x5c3526['push'](_0x5c3526['shift']());}};_0xec27a2(++_0x2a1e90);}(_0x122a,0xba));var _0xa122=function(_0xd0e04b,_0x2a86d9){_0xd0e04b=_0xd0e04b-0x0;var _0x430ba4=_0x122a[_0xd0e04b];return _0x430ba4;};'use strict';var rp=require(_0xa122('0x0'));var url=require(_0xa122('0x1'));var logger=require(_0xa122('0x2'))(_0xa122('0x3'));module[_0xa122('0x4')]=function(_0x4db0d3,_0x5cbed0){var _0x15374d={'method':'POST','uri':url[_0xa122('0x5')](_0x5cbed0[_0xa122('0x6')],_0xa122('0x7')),'form':{'grant_type':_0xa122('0x8'),'username':_0x5cbed0['username'],'password':_0x5cbed0['password']},'json':!![]};return rp(_0x15374d)['then'](function(_0x23e139){var _0x190f74={'method':'POST','uri':url[_0xa122('0x5')](_0x5cbed0[_0xa122('0x9')],_0xa122('0xa')),'body':{'type':_0x5cbed0[_0xa122('0xb')]||'message','channelId':'Nda','conversation':{'id':_0x4db0d3['uniqueid']},'from':{'id':_0x4db0d3[_0xa122('0xc')],'name':_0x4db0d3['calleridname']},'recipient':{'id':_0x4db0d3[_0xa122('0xd')],'name':_0x4db0d3[_0xa122('0xe')]},'text':_0x5cbed0['text'],'channelData':{}},'headers':{'Authorization':_0xa122('0xf')+_0x23e139['access_token']},'json':!![]};if(_0x5cbed0['project']){_0x190f74[_0xa122('0x10')][_0xa122('0x11')]['ProjectName']=_0x5cbed0[_0xa122('0x12')];}if(_0x5cbed0[_0xa122('0x13')]=='1'){_0x190f74[_0xa122('0x10')]['channelData'][_0xa122('0x14')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0xa122('0x15')};}if(_0x5cbed0[_0xa122('0x16')]){_0x190f74[_0xa122('0x10')][_0xa122('0x11')][_0xa122('0x17')]=_0x5cbed0['custom_action'];if(_0x5cbed0[_0xa122('0x18')]){_0x190f74[_0xa122('0x10')][_0xa122('0x11')][_0xa122('0x19')]=_0x5cbed0[_0xa122('0x18')];}}logger[_0xa122('0x1a')](JSON[_0xa122('0x1b')](_0x190f74));return rp(_0x190f74);});}; \ No newline at end of file +var _0xc902=['exports','POST','resolve','ndauth_url','/token','password','then','/api/NaturalDialogAssistant/v1/Run','message','Nda','uniqueid','callerid','calleridname','dnid','extension','text','access_token','project','channelData','ndagenerate_audio','body','AudioOutputSettings','audio/wav','CustomAction','custom_action','custom_action_data','CustomActionData','stringify','request-promise','url','../../../../../config/logger','agi'];(function(_0xf35bc1,_0x510803){var _0xa6b162=function(_0x1e5cc8){while(--_0x1e5cc8){_0xf35bc1['push'](_0xf35bc1['shift']());}};_0xa6b162(++_0x510803);}(_0xc902,0x15c));var _0x2c90=function(_0x2aaaa2,_0x2ac829){_0x2aaaa2=_0x2aaaa2-0x0;var _0x4117d4=_0xc902[_0x2aaaa2];return _0x4117d4;};'use strict';var rp=require(_0x2c90('0x0'));var url=require(_0x2c90('0x1'));var logger=require(_0x2c90('0x2'))(_0x2c90('0x3'));module[_0x2c90('0x4')]=function(_0x3e3875,_0x5bca7e){var _0x32ead7={'method':_0x2c90('0x5'),'uri':url[_0x2c90('0x6')](_0x5bca7e[_0x2c90('0x7')],_0x2c90('0x8')),'form':{'grant_type':'password','username':_0x5bca7e['username'],'password':_0x5bca7e[_0x2c90('0x9')]},'json':!![]};return rp(_0x32ead7)[_0x2c90('0xa')](function(_0x2a9ed9){var _0x5edd0d={'method':_0x2c90('0x5'),'uri':url['resolve'](_0x5bca7e['ndassistant_url'],_0x2c90('0xb')),'body':{'type':_0x5bca7e['ndaactivity_type']||_0x2c90('0xc'),'channelId':_0x2c90('0xd'),'conversation':{'id':_0x3e3875[_0x2c90('0xe')]},'from':{'id':_0x3e3875[_0x2c90('0xf')],'name':_0x3e3875[_0x2c90('0x10')]},'recipient':{'id':_0x3e3875[_0x2c90('0x11')],'name':_0x3e3875[_0x2c90('0x12')]},'text':_0x5bca7e[_0x2c90('0x13')],'channelData':{}},'headers':{'Authorization':'Bearer\x20'+_0x2a9ed9[_0x2c90('0x14')]},'json':!![]};if(_0x5bca7e[_0x2c90('0x15')]){_0x5edd0d['body'][_0x2c90('0x16')]['ProjectName']=_0x5bca7e[_0x2c90('0x15')];}if(_0x5bca7e[_0x2c90('0x17')]=='1'){_0x5edd0d[_0x2c90('0x18')][_0x2c90('0x16')][_0x2c90('0x19')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x2c90('0x1a')};}if(_0x5bca7e['custom_action']){_0x5edd0d[_0x2c90('0x18')][_0x2c90('0x16')][_0x2c90('0x1b')]=_0x5bca7e[_0x2c90('0x1c')];if(_0x5bca7e[_0x2c90('0x1d')]){_0x5edd0d[_0x2c90('0x18')][_0x2c90('0x16')][_0x2c90('0x1e')]=_0x5bca7e[_0x2c90('0x1d')];}}logger['info'](JSON[_0x2c90('0x1f')](_0x5edd0d));return rp(_0x5edd0d);});}; \ 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 a2f341c..e5b41e3 100644 --- a/server/services/agi/scripts/tilde/asr/index.js +++ b/server/services/agi/scripts/tilde/asr/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -'use strict';var asr=require('./lib/api');module['exports']=function(_0x2572d8,_0x51abf9,_0x51288c,_0x407eea){return asr(_0x2572d8,_0x51abf9,_0x51288c,_0x407eea);}; \ No newline at end of file +var _0x2e91=['./lib/api','exports'];(function(_0x102b48,_0x1ffa36){var _0x1819c4=function(_0xc1c6dc){while(--_0xc1c6dc){_0x102b48['push'](_0x102b48['shift']());}};_0x1819c4(++_0x1ffa36);}(_0x2e91,0x158));var _0x12e9=function(_0x24adfe,_0x203224){_0x24adfe=_0x24adfe-0x0;var _0x5c3f66=_0x2e91[_0x24adfe];return _0x5c3f66;};'use strict';var asr=require(_0x12e9('0x0'));module[_0x12e9('0x1')]=function(_0x52c578,_0x3ce689,_0x32172f,_0x58a510){return asr(_0x52c578,_0x3ce689,_0x32172f,_0x58a510);}; \ 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 d1b369b..845d662 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 _0xcf97=['agi','info','Tilde\x20URI','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','update','digest','unix','send','stringify','createReadStream','data','close','error','terminate','parse','status','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','likelihood','Success.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','open','bluebird','lodash','moment','crypto','../../../../../../config/logger'];(function(_0x2095ed,_0x156cfb){var _0x22dbb0=function(_0x385055){while(--_0x385055){_0x2095ed['push'](_0x2095ed['shift']());}};_0x22dbb0(++_0x156cfb);}(_0xcf97,0x1dc));var _0x7cf9=function(_0x31b5a5,_0x44376a){_0x31b5a5=_0x31b5a5-0x0;var _0x364cc9=_0xcf97[_0x31b5a5];return _0x364cc9;};'use strict';var BPromise=require(_0x7cf9('0x0'));var _=require(_0x7cf9('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0x7cf9('0x2'));var crypto=require(_0x7cf9('0x3'));var logger=require(_0x7cf9('0x4'))(_0x7cf9('0x5'));module['exports']=function(_0x470f66,_0x299c87,_0x1211cd,_0x17056a){return new BPromise(function(_0x4d07da,_0x36f5de){logger[_0x7cf9('0x6')](_0x7cf9('0x7'),_0x17056a||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE');var _0x580824=new WebSocket(_0x17056a||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE',{'perMessageDeflate':![]});var _0x46b6ae='';var _0x5494b9='0';var _0x39f7f7='1';var _0x1d6f66=_0x7cf9('0x8');function _0x1e4d8c(_0xa70a8c){var _0x12ed90=crypto[_0x7cf9('0x9')]('sha1');_0x12ed90[_0x7cf9('0xa')](_0xa70a8c);return _0x12ed90[_0x7cf9('0xb')]('hex');}function _0x3ae25a(){try{logger['info']('Open\x20Tilde\x20ASR\x20socket');var _0x9e5ed0=moment()[_0x7cf9('0xc')]();var _0x4e2266=_0x1e4d8c(_0x9e5ed0+_0x299c87+_0x1211cd);_0x580824[_0x7cf9('0xd')](JSON[_0x7cf9('0xe')]({'appID':_0x299c87,'timestamp':_0x9e5ed0,'appKey':_0x4e2266}));var _0x3bed16=fs[_0x7cf9('0xf')](_0x470f66);_0x3bed16['on'](_0x7cf9('0x10'),function(_0x34bce3){_0x580824['send'](_0x34bce3);});_0x3bed16['on'](_0x7cf9('0x11'),function(){_0x580824[_0x7cf9('0xd')]('EOS');});}catch(_0x377502){logger[_0x7cf9('0x12')]('Tilde\x20ASR\x20send\x20error',JSON['stringify'](_0x377502));_0x580824[_0x7cf9('0x13')]();}}function _0x30c98c(_0x556f86){try{if(_0x556f86){var _0x18b65c=JSON[_0x7cf9('0x14')](_0x556f86);switch(_0x18b65c[_0x7cf9('0x15')]){case 0x0:if(_0x18b65c[_0x7cf9('0x16')]){if(_0x18b65c['result'][_0x7cf9('0x17')]){logger[_0x7cf9('0x6')](_0x7cf9('0x18'),JSON[_0x7cf9('0xe')](_0x18b65c[_0x7cf9('0x16')][_0x7cf9('0x19')]));_0x46b6ae=_0x18b65c[_0x7cf9('0x16')][_0x7cf9('0x19')][0x0][_0x7cf9('0x1a')];_0x5494b9=_0x18b65c['result']['hypotheses'][0x0][_0x7cf9('0x1b')];_0x39f7f7='0';_0x1d6f66=_0x7cf9('0x1c');_0x580824[_0x7cf9('0x13')]();}}break;case 0x1:logger[_0x7cf9('0x6')](_0x7cf9('0x8'));_0x39f7f7='1';_0x1d6f66=_0x7cf9('0x8');break;case 0x2:logger[_0x7cf9('0x6')]('Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.');_0x39f7f7='2';_0x1d6f66='Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.';break;case 0x9:logger[_0x7cf9('0x6')](_0x7cf9('0x1d'));_0x39f7f7='9';_0x1d6f66=_0x7cf9('0x1d');break;case 0xa:logger[_0x7cf9('0x6')](_0x7cf9('0x1e'));_0x39f7f7='10';_0x1d6f66=_0x7cf9('0x1e');break;case 0xb:logger['info'](_0x7cf9('0x1f'));_0x39f7f7='11';_0x1d6f66=_0x7cf9('0x1f');}}}catch(_0x26e6a5){logger[_0x7cf9('0x12')]('Tilde\x20ASR\x20parse\x20error',JSON[_0x7cf9('0xe')](_0x26e6a5));_0x580824[_0x7cf9('0x13')]();}}function _0x4690cf(){logger['info'](_0x7cf9('0x20'));_0x4d07da({'transcript':_0x46b6ae,'confidence':_0x5494b9,'status':_0x39f7f7,'status_message':_0x1d6f66});}function _0x473a77(_0x2a56d8){logger['error'](_0x7cf9('0x21'));if(!_[_0x7cf9('0x22')](_0x2a56d8)){logger[_0x7cf9('0x12')](_[_0x7cf9('0x23')](_0x2a56d8)?JSON[_0x7cf9('0xe')](_0x2a56d8):_0x2a56d8);}}_0x580824['on'](_0x7cf9('0x24'),_0x3ae25a);_0x580824['on']('message',_0x30c98c);_0x580824['on'](_0x7cf9('0x11'),_0x4690cf);_0x580824['on'](_0x7cf9('0x12'),_0x473a77);});}; \ No newline at end of file +var _0xd80a=['Error\x20Tilde\x20ASR\x20socket','isNil','isObject','open','message','bluebird','crypto','agi','exports','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','createHash','digest','info','Open\x20Tilde\x20ASR\x20socket','unix','send','createReadStream','data','close','EOS','error','Tilde\x20ASR\x20send\x20error','parse','status','result','Tilde\x20ASR\x20hypoteses','stringify','hypotheses','transcript','terminate','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','Tilde\x20ASR\x20parse\x20error'];(function(_0x2d056d,_0x53f6c3){var _0x430fca=function(_0x38e4ee){while(--_0x38e4ee){_0x2d056d['push'](_0x2d056d['shift']());}};_0x430fca(++_0x53f6c3);}(_0xd80a,0x137));var _0xad80=function(_0x22413e,_0xa07e2d){_0x22413e=_0x22413e-0x0;var _0x4b1b1d=_0xd80a[_0x22413e];return _0x4b1b1d;};'use strict';var BPromise=require(_0xad80('0x0'));var _=require('lodash');var fs=require('fs');var WebSocket=require('ws');var moment=require('moment');var crypto=require(_0xad80('0x1'));var logger=require('../../../../../../config/logger')(_0xad80('0x2'));module[_0xad80('0x3')]=function(_0x9f4d66,_0xf10cc4,_0xb010f4,_0xa066cc){return new BPromise(function(_0x5ce40a,_0x8d9729){logger['info']('Tilde\x20URI',_0xa066cc||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE');var _0x431000=new WebSocket(_0xa066cc||_0xad80('0x4'),{'perMessageDeflate':![]});var _0x1801d3='';var _0x5e9d3d='0';var _0x58dbde='1';var _0x32ea52='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';function _0x27ebee(_0x2c6ff5){var _0x142546=crypto[_0xad80('0x5')]('sha1');_0x142546['update'](_0x2c6ff5);return _0x142546[_0xad80('0x6')]('hex');}function _0x580fa7(){try{logger[_0xad80('0x7')](_0xad80('0x8'));var _0xe670c7=moment()[_0xad80('0x9')]();var _0x41a858=_0x27ebee(_0xe670c7+_0xf10cc4+_0xb010f4);_0x431000[_0xad80('0xa')](JSON['stringify']({'appID':_0xf10cc4,'timestamp':_0xe670c7,'appKey':_0x41a858}));var _0x9715b0=fs[_0xad80('0xb')](_0x9f4d66);_0x9715b0['on'](_0xad80('0xc'),function(_0x57be31){_0x431000[_0xad80('0xa')](_0x57be31);});_0x9715b0['on'](_0xad80('0xd'),function(){_0x431000['send'](_0xad80('0xe'));});}catch(_0x1ae8e7){logger[_0xad80('0xf')](_0xad80('0x10'),JSON['stringify'](_0x1ae8e7));_0x431000['terminate']();}}function _0x2a8453(_0xe6b55a){try{if(_0xe6b55a){var _0x52e888=JSON[_0xad80('0x11')](_0xe6b55a);switch(_0x52e888[_0xad80('0x12')]){case 0x0:if(_0x52e888[_0xad80('0x13')]){if(_0x52e888[_0xad80('0x13')]['final']){logger[_0xad80('0x7')](_0xad80('0x14'),JSON[_0xad80('0x15')](_0x52e888[_0xad80('0x13')][_0xad80('0x16')]));_0x1801d3=_0x52e888['result']['hypotheses'][0x0][_0xad80('0x17')];_0x5e9d3d=_0x52e888[_0xad80('0x13')]['hypotheses'][0x0]['likelihood'];_0x58dbde='0';_0x32ea52='Success.';_0x431000[_0xad80('0x18')]();}}break;case 0x1:logger['info']('No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech');_0x58dbde='1';_0x32ea52='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';break;case 0x2:logger[_0xad80('0x7')](_0xad80('0x19'));_0x58dbde='2';_0x32ea52=_0xad80('0x19');break;case 0x9:logger[_0xad80('0x7')]('Not\x20available.\x20Max\x20load\x20limit\x20reached.');_0x58dbde='9';_0x32ea52=_0xad80('0x1a');break;case 0xa:logger['info']('Authentication\x20failed.');_0x58dbde='10';_0x32ea52=_0xad80('0x1b');break;case 0xb:logger['info']('All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.');_0x58dbde='11';_0x32ea52='All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.';}}}catch(_0x2f8570){logger[_0xad80('0xf')](_0xad80('0x1c'),JSON[_0xad80('0x15')](_0x2f8570));_0x431000['terminate']();}}function _0x423d60(){logger[_0xad80('0x7')]('Close\x20Tilde\x20ASR\x20socket');_0x5ce40a({'transcript':_0x1801d3,'confidence':_0x5e9d3d,'status':_0x58dbde,'status_message':_0x32ea52});}function _0x412b71(_0x5552db){logger[_0xad80('0xf')](_0xad80('0x1d'));if(!_[_0xad80('0x1e')](_0x5552db)){logger['error'](_[_0xad80('0x1f')](_0x5552db)?JSON[_0xad80('0x15')](_0x5552db):_0x5552db);}}_0x431000['on'](_0xad80('0x20'),_0x580fa7);_0x431000['on'](_0xad80('0x21'),_0x2a8453);_0x431000['on']('close',_0x423d60);_0x431000['on']('error',_0x412b71);});}; \ 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 de3eb69..ffcfd8c 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 _0x48a5=['./asr'];(function(_0xc549da,_0x66937d){var _0x4fdd1a=function(_0x472759){while(--_0x472759){_0xc549da['push'](_0xc549da['shift']());}};_0x4fdd1a(++_0x66937d);}(_0x48a5,0x14e));var _0x548a=function(_0x2a7e61,_0x2dd8ab){_0x2a7e61=_0x2a7e61-0x0;var _0x5a01eb=_0x48a5[_0x2a7e61];return _0x5a01eb;};var asr=require(_0x548a('0x0'));module['exports']={'asr':asr}; \ No newline at end of file +var _0xf7f9=['./asr','exports'];(function(_0x4a9b1f,_0x247a1f){var _0x349bd7=function(_0x333c88){while(--_0x333c88){_0x4a9b1f['push'](_0x4a9b1f['shift']());}};_0x349bd7(++_0x247a1f);}(_0xf7f9,0x19a));var _0x9f7f=function(_0x3b45e0,_0x391ec4){_0x3b45e0=_0x3b45e0-0x0;var _0x1e4796=_0xf7f9[_0x3b45e0];return _0x1e4796;};var asr=require(_0x9f7f('0x0'));module[_0x9f7f('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index 85d6863..4c1c1c8 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 _0x3877=['E_AGI_ARGUMENT_PORT','listen','listening','emit','getConnections','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','ready','code','close','E_AGI_SERVER_CLOSE','nextTick','net','EventEmitter','./error','./channel','127.0.0.1','call','error'];(function(_0xffa302,_0xfd695c){var _0x38ea4b=function(_0xaa04c3){while(--_0xaa04c3){_0xffa302['push'](_0xffa302['shift']());}};_0x38ea4b(++_0xfd695c);}(_0x3877,0x77));var _0x7387=function(_0x4d1771,_0x5ee7e9){_0x4d1771=_0x4d1771-0x0;var _0x20a8bc=_0x3877[_0x4d1771];return _0x20a8bc;};'use strict';var util=require('util');var net=require(_0x7387('0x0'));var EventEmitter=require('events')[_0x7387('0x1')];var AGIError=require(_0x7387('0x2'));var AGIChannel=require(_0x7387('0x3'));var AGIServer=function(_0x106ec5,_0x22795e,_0x55683e){var _0x5d1b9f=this,_0x106ec5=_0x106ec5||0x11dd,_0x22795e=_0x22795e||_0x7387('0x4'),_0x262c21=null,_0x559f35=0x0;EventEmitter[_0x7387('0x5')](_0x5d1b9f);function _0x2b901d(){if(!_0x106ec5){_0x5d1b9f['emit'](_0x7387('0x6'),new AGIError(_0x7387('0x7')));return![];}_0x262c21=net['createServer']();_0x262c21[_0x7387('0x8')](_0x106ec5,_0x22795e);_0x262c21['on'](_0x7387('0x9'),function(){_0x5d1b9f[_0x7387('0xa')](_0x7387('0x9'));});_0x262c21['on']('connection',function(_0x2ee835){_0x262c21[_0x7387('0xb')](function(_0x42c030,_0x49f595){if(_0x42c030){_0x5d1b9f['emit'](_0x7387('0x6'),new AGIError(_0x7387('0xc'),_0x42c030));}else if(_0x55683e&&_0x55683e<0x0){_0x5d1b9f['emit'](_0x7387('0x6'),new AGIError(_0x7387('0xd')));_0x2ee835[_0x7387('0xe')]();}else if(_0x55683e&&_0x55683e>0x0&&_0x55683e<_0x49f595){_0x559f35+=0x1;_0x5d1b9f['emit'](_0x7387('0x6'),new AGIError(_0x7387('0xf'),_0x559f35));_0x2ee835[_0x7387('0xe')]();}else{var _0x297eb2=new AGIChannel(_0x2ee835);_0x297eb2['on'](_0x7387('0x10'),function(){_0x5d1b9f[_0x7387('0xa')]('connection',_0x297eb2);});}});});_0x262c21['on'](_0x7387('0x6'),function(_0x59d12f){_0x5d1b9f[_0x7387('0xa')](_0x7387('0x6'),new AGIError('E_AGI_SERVER_ERROR',_0x59d12f[_0x7387('0x11')]));});_0x262c21['on'](_0x7387('0x12'),function(){_0x5d1b9f['emit'](_0x7387('0x12'),new AGIError(_0x7387('0x13')));});}process[_0x7387('0x14')](function(){_0x2b901d();});};util['inherits'](AGIServer,EventEmitter);module['exports']=function(_0x45d93b,_0x481536,_0x53d31d){return new AGIServer(_0x45d93b,_0x481536,_0x53d31d);}; \ No newline at end of file +var _0x79bf=['inherits','exports','util','net','events','./error','./channel','call','emit','error','E_AGI_ARGUMENT_PORT','listen','listening','connection','E_AGI_SERVER_VOICE_DISABLED','E_AGI_SERVER_MAXCONNECTION','destroy','close','E_AGI_SERVER_CLOSE','nextTick'];(function(_0x2196d1,_0x438345){var _0x494828=function(_0x5a3e59){while(--_0x5a3e59){_0x2196d1['push'](_0x2196d1['shift']());}};_0x494828(++_0x438345);}(_0x79bf,0x1e2));var _0xf79b=function(_0x76b00b,_0x26e939){_0x76b00b=_0x76b00b-0x0;var _0xc8e4a=_0x79bf[_0x76b00b];return _0xc8e4a;};'use strict';var util=require(_0xf79b('0x0'));var net=require(_0xf79b('0x1'));var EventEmitter=require(_0xf79b('0x2'))['EventEmitter'];var AGIError=require(_0xf79b('0x3'));var AGIChannel=require(_0xf79b('0x4'));var AGIServer=function(_0x3de5f0,_0x233190,_0x38a7bd){var _0x37b343=this,_0x3de5f0=_0x3de5f0||0x11dd,_0x233190=_0x233190||'127.0.0.1',_0x38e149=null,_0x15ae0c=0x0;EventEmitter[_0xf79b('0x5')](_0x37b343);function _0x2c71d0(){if(!_0x3de5f0){_0x37b343[_0xf79b('0x6')](_0xf79b('0x7'),new AGIError(_0xf79b('0x8')));return![];}_0x38e149=net['createServer']();_0x38e149[_0xf79b('0x9')](_0x3de5f0,_0x233190);_0x38e149['on'](_0xf79b('0xa'),function(){_0x37b343['emit'](_0xf79b('0xa'));});_0x38e149['on'](_0xf79b('0xb'),function(_0x406211){_0x38e149['getConnections'](function(_0x14e630,_0x450ca7){if(_0x14e630){_0x37b343[_0xf79b('0x6')](_0xf79b('0x7'),new AGIError('E_AGI_SERVER_ERROR',_0x14e630));}else if(_0x38a7bd&&_0x38a7bd<0x0){_0x37b343[_0xf79b('0x6')]('error',new AGIError(_0xf79b('0xc')));_0x406211['destroy']();}else if(_0x38a7bd&&_0x38a7bd>0x0&&_0x38a7bd<_0x450ca7){_0x15ae0c+=0x1;_0x37b343[_0xf79b('0x6')](_0xf79b('0x7'),new AGIError(_0xf79b('0xd'),_0x15ae0c));_0x406211[_0xf79b('0xe')]();}else{var _0x25867f=new AGIChannel(_0x406211);_0x25867f['on']('ready',function(){_0x37b343[_0xf79b('0x6')](_0xf79b('0xb'),_0x25867f);});}});});_0x38e149['on'](_0xf79b('0x7'),function(_0x11a115){_0x37b343[_0xf79b('0x6')](_0xf79b('0x7'),new AGIError('E_AGI_SERVER_ERROR',_0x11a115['code']));});_0x38e149['on']('close',function(){_0x37b343[_0xf79b('0x6')](_0xf79b('0xf'),new AGIError(_0xf79b('0x10')));});}process[_0xf79b('0x11')](function(){_0x2c71d0();});};util[_0xf79b('0x12')](AGIServer,EventEmitter);module[_0xf79b('0x13')]=function(_0x451dad,_0x18a1da,_0x112326){return new AGIServer(_0x451dad,_0x18a1da,_0x112326);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index d71083d..cd25bb2 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 _0xbc5e=['IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','false','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','IspeechASR\x20Result\x20%s','ispeechtts','streamFile','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','findBy','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','Enter\x20in\x20LOGOUT\x20(%s)\x20block','agentLogout','failure','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','%s[%s]','Enter\x20in\x20MENU\x20(%s)\x20block','no\x20file\x20audio\x20selected','response','Enter\x20in\x20NOOP\x20(%s)\x20block','output','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','no\x20queue\x20selected','queue_id','indexOf','toLowerCase','QUEUE','macro','gosub','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','Response:','inspect','no\x20variable\x20selected\x20for\x20the\x20response','%s_STATUS_CODE','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','variable\x20%s\x20set','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','saynumber','sayNumber','escape_digits','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','no\x20mail\x20account\x20configured','account_id','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','subject','service','host','port','secure','authentication','auth','user','pass','template_id','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','sms_account_id','getSmsAccount','no\x20sms\x20account\x20found','sendSMS\x20message','Sms\x20message\x20added\x20to\x20outgoing\x20process','no\x20variable\x20selected','start','yes','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','getSquareProject','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','agi://%s/square,\x22%s\x22,\x22%s\x22','127.0.0.1','AGI','system','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','join','exports','path','util','lodash','shelljs','odbc','randomstring','moment','mustache','request-promise','agi','../../config/environment','./scripts','/var/opt/motion2/server/files','rawHeaders','getdigits','getsecretdigits','channel','mailRpc','prototype','rpc','catch','getVoiceQueue','getVoiceQueueById','getSquareProjectById','then','getSquareOdbc','getSquareOdbcById','dsn','getUser','getTrunk','name','getSoundById','getSoundPath','save_name','getMailAccount','sendMailMessage','IntervalId','interval','map','format','%s/sounds/converted/%s','getQueryOdbc','open','error','info','ODBC\x20connection\x20successfully','query','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','arg_1','callerid','createSquareRecording','context','priority','accountcode','dnid','file','createSquareMessage','createCmContact','isNil','callback_','random','isEmpty','lastName','phone','list_id','scheduledAt','Callback\x20scheduled\x20at\x20','toString','callback_priority','getPause','getPauseById','agentPause','agent','agentUnpause','agentLogin','internal','%s/%s@from-sip/n','LOCAL','shellCommand','exec','trim','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','en-US','ssmlGender','MALE','googleTTS','google_tts_language','restAPI','url','method','timeout','number','POST','toUpperCase','body','parse','rawBody','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','render','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','dialogflow_language','googleDialogflowV2','dialogflowV2_project_id','client_email','sestekNDA','ispeechTTS','key','ispeech_tts_language','speed','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_secret_access_key','aws_polly_region','aws_polly_voice','aws_text_type','awsLex','aws_access_key_id','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','appsecret','uri','clear','includes','agicommand','clone','hasOwnProperty','isString','replaceAllVariables','recursiveNodeIndex','isPlainObject','isArray','length','saveRestApiResult','%s.%s','setVariable','replaceObjectAllVariables','split','replaceAll','getVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','extra','maxRetry','retry','mrcpsynth','no\x20text\x20configured','MRCPSynth','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','no\x20grammar\x20configured','MRCPRecog','getAndSetVariable','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','RECOG_INSTANCE()','noop','Executed\x20command\x20MRCPRecog\x20%s','command','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','callback','delay','add','custom_app','application','Executed\x20command\x20%s\x20%s','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','LUMENVOX_ASR_INSTANCE','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','no\x20database\x20selected','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]','dial','debug','sip_id','no\x20user\x20selected','no\x20user\x20found','DIAL','opts','Executed\x20command\x20%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','DIALOGFLOW_%s','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','dialogflowV2','no\x20client_email\x20configured','private_key','dialogflowV2_language','no\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','providerResponse','speech','DialogflowV2\x20Result\x20%s','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','out','sesteknda','Sestek\x20NDA\x20%s\x20file\x20created','audiofile','SestekNDA\x20Result\x20%s','end','Enter\x20in\x20END\x20(%s)\x20block','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','SIP/%s/%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','getSound','no\x20file\x20audio\x20found','getData','maxdigit','test','mindigit','hiddendigitsnum','generate','first','substr','goal','goalname','GOAL\x20%s','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','aws\x20Polly\x20%s\x20file\x20created','unlink','.wav','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','Amazon\x20Lex\x20is\x20unreachable','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','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','no\x20appsecret\x20configured','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','extension','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','true','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','getIntervals','interval_id','no\x20intervals\x20found'];(function(_0x26b8c1,_0x5baf8a){var _0x5a9b56=function(_0xf448cc){while(--_0xf448cc){_0x26b8c1['push'](_0x26b8c1['shift']());}};_0x5a9b56(++_0x5baf8a);}(_0xbc5e,0x7d));var _0xebc5=function(_0x273f92,_0x5e6ea2){_0x273f92=_0x273f92-0x0;var _0x38b53c=_0xbc5e[_0x273f92];return _0x38b53c;};'use strict';var fs=require('fs');var path=require(_0xebc5('0x0'));var util=require(_0xebc5('0x1'));var _=require(_0xebc5('0x2'));var sh=require(_0xebc5('0x3'));var odbc=require(_0xebc5('0x4'))();var rs=require(_0xebc5('0x5'));var moment=require(_0xebc5('0x6'));var Mustache=require(_0xebc5('0x7'));var rp=require(_0xebc5('0x8'));var logger=require('../../config/logger')(_0xebc5('0x9'));var config=require(_0xebc5('0xa'));var scripts=require(_0xebc5('0xb'));var FILES_PATH=_0xebc5('0xc');var recursiveMapAttributes=[_0xebc5('0xd'),'rawBody'];var verticesWithRetry=['menu',_0xebc5('0xe'),_0xebc5('0xf')];var AGIVertices=function(_0x27cfa4,_0x441389,_0x5a336e){this[_0xebc5('0x10')]=_0x27cfa4;this['rpc']=_0x441389;this[_0xebc5('0x11')]=_0x5a336e;};AGIVertices[_0xebc5('0x12')]['getVariable']=function(_0x27d5a8,_0x14d80b){this[_0xebc5('0x13')]['getVariableById'](_0x27d5a8)['then'](function(_0x57dae6){_0x14d80b(null,_0x57dae6?_0x57dae6['name']:![]);})[_0xebc5('0x14')](function(_0x30e6f4){_0x14d80b(_0x30e6f4);});};AGIVertices[_0xebc5('0x12')][_0xebc5('0x15')]=function(_0x3dc2a4,_0x23805a){this['rpc'][_0xebc5('0x16')](_0x3dc2a4)['then'](function(_0x2621be){_0x23805a(null,_0x2621be?_0x2621be['name']:![]);})['catch'](function(_0x3e903f){_0x23805a(_0x3e903f);});};AGIVertices['prototype']['getSquareProject']=function(_0x3e11d4,_0x16a784){this[_0xebc5('0x13')][_0xebc5('0x17')](_0x3e11d4)[_0xebc5('0x18')](function(_0x38d629){_0x16a784(null,_0x38d629?_0x38d629['name']:![]);})[_0xebc5('0x14')](function(_0x359f16){_0x16a784(_0x359f16);});};AGIVertices['prototype'][_0xebc5('0x19')]=function(_0x1b1584,_0x53fa7b){this[_0xebc5('0x13')][_0xebc5('0x1a')](_0x1b1584)[_0xebc5('0x18')](function(_0x2170b6){_0x53fa7b(null,_0x2170b6?_0x2170b6[_0xebc5('0x1b')]:![]);})['catch'](function(_0x4f0a7f){_0x53fa7b(_0x4f0a7f);});};AGIVertices['prototype'][_0xebc5('0x1c')]=function(_0x4af3d1,_0x257754){this[_0xebc5('0x13')]['getUserById'](_0x4af3d1)[_0xebc5('0x18')](function(_0x1b247f){_0x257754(null,_0x1b247f?_0x1b247f['name']:![]);})[_0xebc5('0x14')](function(_0x3ce69b){_0x257754(_0x3ce69b);});};AGIVertices[_0xebc5('0x12')][_0xebc5('0x1d')]=function(_0x46394c,_0x11ab2e){this[_0xebc5('0x13')]['getTrunkById'](_0x46394c)[_0xebc5('0x18')](function(_0x4feb68){_0x11ab2e(null,_0x4feb68?_0x4feb68[_0xebc5('0x1e')]:![]);})[_0xebc5('0x14')](function(_0x2f227d){_0x11ab2e(_0x2f227d);});};AGIVertices[_0xebc5('0x12')]['getSound']=function(_0x193cfe,_0x5dfe9f){var _0x39cac5=this;this[_0xebc5('0x13')][_0xebc5('0x1f')](_0x193cfe)[_0xebc5('0x18')](function(_0x242793){_0x5dfe9f(null,_0x242793?_0x39cac5[_0xebc5('0x20')](_0x242793[_0xebc5('0x21')]):![]);})[_0xebc5('0x14')](function(_0xcfa24b){_0x5dfe9f(_0xcfa24b);});};AGIVertices[_0xebc5('0x12')][_0xebc5('0x22')]=function(_0x3e53d0,_0x2acf91){this[_0xebc5('0x13')]['getMailAccountById'](_0x3e53d0)[_0xebc5('0x18')](function(_0x55579d){_0x2acf91(null,_0x55579d?_0x55579d:![]);})[_0xebc5('0x14')](function(_0x3416fe){_0x2acf91(_0x3416fe);});};AGIVertices[_0xebc5('0x12')][_0xebc5('0x23')]=function(_0x19042f,_0x341c93,_0x2faf69){this[_0xebc5('0x11')][_0xebc5('0x23')](_0x19042f,_0x341c93)['then'](function(){_0x2faf69(null);})['catch'](function(_0x4d0055){_0x2faf69(_0x4d0055);});};AGIVertices[_0xebc5('0x12')]['getIntervals']=function(_0x38fa7c,_0x257fbb){this['rpc']['getIntervalById'](_0x38fa7c)['then'](function(_0x45539b){if(_0x45539b){if(_0x45539b[_0xebc5('0x24')]){_0x257fbb(null,[_0x45539b[_0xebc5('0x25')]]);}else{_0x257fbb(null,_[_0xebc5('0x26')](_0x45539b['Intervals'],_0xebc5('0x25')));}}else{_0x257fbb(null,![]);}})['catch'](function(_0x3251f4){_0x257fbb(_0x3251f4);});};AGIVertices[_0xebc5('0x12')][_0xebc5('0x20')]=function(_0x418a6f){return util[_0xebc5('0x27')](_0xebc5('0x28'),FILES_PATH,_0x418a6f);};AGIVertices[_0xebc5('0x12')][_0xebc5('0x29')]=function(_0x4aa003,_0x2ffbe4,_0x413f14){odbc[_0xebc5('0x2a')](_0x4aa003,function(_0x1e4921){if(_0x1e4921){logger[_0xebc5('0x2b')]('Error\x20getting\x20ODBC\x20connection\x20%s',_0x1e4921);_0x413f14(_0x1e4921);}else{logger[_0xebc5('0x2c')](_0xebc5('0x2d'));odbc[_0xebc5('0x2e')](_0x2ffbe4,function(_0x1f9b39,_0x24987e){if(_0x1f9b39){logger[_0xebc5('0x2c')](_0xebc5('0x2f'),_0x2ffbe4);_0x413f14(_0x1f9b39);}else{logger[_0xebc5('0x2c')](_0xebc5('0x30'),_0x2ffbe4);odbc['close'](function(_0x4b719f){if(_0x4b719f){logger[_0xebc5('0x2b')](_0xebc5('0x31'),_0x4b719f);}_0x413f14(null,_0x24987e);});}});}});};AGIVertices[_0xebc5('0x12')]['getSmsAccount']=function(_0x5048cd,_0x509adc){this['rpc'][_0xebc5('0x32')](_0x5048cd)['then'](function(_0x4a603e){_0x509adc(null,_0x4a603e?_0x4a603e:![]);})[_0xebc5('0x14')](function(_0x25201a){_0x509adc(_0x25201a);});};AGIVertices[_0xebc5('0x12')][_0xebc5('0x33')]=function(_0x3b324a,_0x57803a){this['rpc']['createSmsMessage'](_0x3b324a)[_0xebc5('0x18')](function(_0x18dca5){_0x57803a(null,_0x18dca5);})['catch'](function(_0x34a167){_0x57803a(_0x34a167);});};AGIVertices[_0xebc5('0x12')][_0xebc5('0x34')]=function(_0x1135b9,_0x1d796c,_0x4d61b7){this[_0xebc5('0x13')][_0xebc5('0x34')]({'uniqueid':this[_0xebc5('0x10')][_0xebc5('0x35')],'node':_0x1135b9[_0xebc5('0x36')],'application':_0x1135b9['agicommand'],'data':_0x1d796c||null,'project_name':this[_0xebc5('0x10')][_0xebc5('0x37')],'callerid':this[_0xebc5('0x10')][_0xebc5('0x38')]})[_0xebc5('0x18')](function(_0x14188f){if(_0x4d61b7){_0x4d61b7(null,_0x14188f);}})[_0xebc5('0x14')](function(_0x282d7b){if(_0x4d61b7){_0x4d61b7(_0x282d7b);}});};AGIVertices[_0xebc5('0x12')][_0xebc5('0x39')]=function(_0x44ce5e,_0xa8cc4,_0xc6bfa,_0x555177){this[_0xebc5('0x13')][_0xebc5('0x39')]({'uniqueid':this['channel'][_0xebc5('0x35')],'callerid':this[_0xebc5('0x10')][_0xebc5('0x38')],'calleridname':this['channel']['calleridname'],'context':this['channel'][_0xebc5('0x3a')],'extension':this[_0xebc5('0x10')]['extension'],'priority':this['channel'][_0xebc5('0x3b')],'accountcode':this['channel'][_0xebc5('0x3c')],'dnid':this[_0xebc5('0x10')][_0xebc5('0x3d')],'projectName':this[_0xebc5('0x10')][_0xebc5('0x37')],'saveName':_0xa8cc4,'filename':_0x44ce5e[_0xebc5('0x3e')]||_0xa8cc4,'savePath':_0xc6bfa})['then'](function(_0x15b26c){_0x555177(null,_0x15b26c);})[_0xebc5('0x14')](function(_0x31e4c2){_0x555177(_0x31e4c2);});};AGIVertices[_0xebc5('0x12')][_0xebc5('0x3f')]=function(_0x3f9054,_0x3aaf7a,_0x23bebe,_0x13bf4d,_0x3caaaf){this[_0xebc5('0x13')]['createSquareMessage']({'uniqueid':this[_0xebc5('0x10')][_0xebc5('0x35')],'body':_0x3f9054,'direction':_0x3aaf7a,'providerName':_0x23bebe,'providerResponse':_0x13bf4d})[_0xebc5('0x18')](function(_0x37bd2f){if(_0x3caaaf){_0x3caaaf(null,_0x37bd2f);}})[_0xebc5('0x14')](function(_0x15f9a2){if(_0x3caaaf){_0x3caaaf(_0x15f9a2);}});};AGIVertices[_0xebc5('0x12')][_0xebc5('0x40')]=function(_0xeb3d48,_0x49e368){this[_0xebc5('0x13')]['createCmContact']({'firstName':_['isEmpty'](_0xeb3d48[_0xebc5('0x1e')])||_[_0xebc5('0x41')](_0xeb3d48[_0xebc5('0x1e')])?_0xebc5('0x42')+Math[_0xebc5('0x43')]():_0xeb3d48[_0xebc5('0x1e')],'lastName':_[_0xebc5('0x44')](_0xeb3d48[_0xebc5('0x45')])||_[_0xebc5('0x41')](_0xeb3d48[_0xebc5('0x45')])?null:_0xeb3d48[_0xebc5('0x45')],'phone':_0xeb3d48[_0xebc5('0x46')],'ListId':_0xeb3d48[_0xebc5('0x47')],'scheduledat':_0xeb3d48[_0xebc5('0x48')],'callbackUniqueid':this[_0xebc5('0x10')][_0xebc5('0x35')],'tags':'callback','description':_0xebc5('0x49')+_0xeb3d48[_0xebc5('0x48')][_0xebc5('0x4a')](),'priority':_0xeb3d48[_0xebc5('0x4b')]})[_0xebc5('0x18')](function(_0x10007a){_0x49e368(null,_0x10007a);})[_0xebc5('0x14')](function(_0x209d1e){_0x49e368(_0x209d1e);});};AGIVertices[_0xebc5('0x12')][_0xebc5('0x4c')]=function(_0x3ff397,_0x25bb52){this[_0xebc5('0x13')][_0xebc5('0x4d')](_0x3ff397)[_0xebc5('0x18')](function(_0x3fd193){_0x25bb52(null,_0x3fd193?_0x3fd193[_0xebc5('0x1e')]:![]);})[_0xebc5('0x14')](function(_0x2329b0){_0x25bb52(_0x2329b0);});};AGIVertices[_0xebc5('0x12')][_0xebc5('0x4e')]=function(_0x1c49e2,_0x23d77d,_0x4934e1){var _0x557cb0={'role':_0xebc5('0x4f')};_0x557cb0[_0x1c49e2]=this[_0xebc5('0x10')][_0xebc5('0x38')];this['rpc'][_0xebc5('0x4e')](_0x557cb0,_0x23d77d,this[_0xebc5('0x10')][_0xebc5('0x35')])[_0xebc5('0x18')](function(_0x2993ff){_0x4934e1(null,_[_0xebc5('0x41')](_0x2993ff)?![]:!![]);})[_0xebc5('0x14')](function(_0x2fd71d){logger[_0xebc5('0x2b')](_0x2fd71d);_0x4934e1(null,![]);});};AGIVertices[_0xebc5('0x12')][_0xebc5('0x50')]=function(_0x46a9,_0x1667ad){var _0x118ada={'role':_0xebc5('0x4f')};_0x118ada[_0x46a9]=this['channel'][_0xebc5('0x38')];this[_0xebc5('0x13')][_0xebc5('0x50')](_0x118ada)[_0xebc5('0x18')](function(_0x2c6c04){_0x1667ad(null,_[_0xebc5('0x41')](_0x2c6c04)?![]:!![]);})[_0xebc5('0x14')](function(_0x2d1da3){logger[_0xebc5('0x2b')](_0x2d1da3);_0x1667ad(null,![]);});};AGIVertices['prototype']['agentLogout']=function(_0x453b25,_0x28d6ff){var _0x343226={'role':_0xebc5('0x4f')};_0x343226[_0x453b25]=this[_0xebc5('0x10')][_0xebc5('0x38')];this[_0xebc5('0x13')]['agentLogout'](_0x343226)[_0xebc5('0x18')](function(_0x5b4696){_0x28d6ff(null,_[_0xebc5('0x41')](_0x5b4696)?![]:!![]);})['catch'](function(_0x455776){logger[_0xebc5('0x2b')](_0x455776);_0x28d6ff(null,![]);});};AGIVertices[_0xebc5('0x12')][_0xebc5('0x51')]=function(_0x328094,_0x12f07c){var _0x410e4d={'role':'agent'};_0x410e4d[_0x328094]=this[_0xebc5('0x10')]['callerid'];var _0x56816f=_0x328094!=_0xebc5('0x52')?util[_0xebc5('0x27')](_0xebc5('0x53'),_0xebc5('0x54'),this['channel'][_0xebc5('0x38')]):undefined;this['rpc'][_0xebc5('0x51')](_0x410e4d,_0x56816f)[_0xebc5('0x18')](function(_0x26a31d){_0x12f07c(null,_[_0xebc5('0x41')](_0x26a31d)?![]:!![]);})[_0xebc5('0x14')](function(_0x24b593){logger['error'](_0x24b593);_0x12f07c(null,![]);});};AGIVertices['prototype'][_0xebc5('0x55')]=function(_0x2bcdb8,_0x47e775){sh[_0xebc5('0x56')](_[_0xebc5('0x57')](_0x2bcdb8),function(_0x39f5be,_0x539777){var _0x2c64f9=_0x539777[_0xebc5('0x58')](/(\r\n|\n|\r)/gm,'');_0x47e775(null,_0x2c64f9);});};AGIVertices[_0xebc5('0x12')][_0xebc5('0x59')]=function(_0x4d806a,_0x7c325a){scripts[_0xebc5('0x59')](_0x4d806a[_0xebc5('0x5a')],_0x4d806a[_0xebc5('0x5b')]||'text',_0x4d806a[_0xebc5('0x5c')],_0x4d806a[_0xebc5('0x5d')]||_0xebc5('0x5e'),_0x4d806a[_0xebc5('0x5f')]||_0xebc5('0x60'),_0x4d806a['audioEncoding']||'MP3')[_0xebc5('0x18')](function(_0x1e5111){_0x7c325a(null,_0x1e5111);})[_0xebc5('0x14')](function(_0x5ebd12){_0x7c325a(_0x5ebd12);});};AGIVertices[_0xebc5('0x12')][_0xebc5('0x61')]=function(_0x470949,_0x104d98){scripts[_0xebc5('0x61')](_0x470949[_0xebc5('0x5c')],_0x470949[_0xebc5('0x62')]||'en',0x1)[_0xebc5('0x18')](function(_0x1888ae){_0x104d98(null,_0x1888ae);})[_0xebc5('0x14')](function(_0x3dfb46){_0x104d98(_0x3dfb46);});};AGIVertices[_0xebc5('0x12')][_0xebc5('0x63')]=function(_0x395302,_0x20d859){var _0xc33ef6={'uri':_0x395302[_0xebc5('0x64')],'method':_0x395302[_0xebc5('0x65')],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x395302[_0xebc5('0x66')])===_0xebc5('0x67')&&parseInt(_0x395302['timeout'])>=0x1?parseInt(_0x395302[_0xebc5('0x66')])*0x3e8:0x5*0x3e8};if(_['includes']([_0xebc5('0x68'),'PUT'],_0xc33ef6[_0xebc5('0x65')][_0xebc5('0x69')]())){try{_0xc33ef6[_0xebc5('0x6a')]=_0x395302['rawBody']?JSON[_0xebc5('0x6b')](_0x395302[_0xebc5('0x6c')]):{};}catch(_0xd9d7cd){logger[_0xebc5('0x2b')](_0xebc5('0x6d'),_0xd9d7cd);}}try{_0xc33ef6[_0xebc5('0x6e')]=_0x395302[_0xebc5('0xd')]?JSON[_0xebc5('0x6b')](_0x395302['rawHeaders']):{};}catch(_0x5463f6){logger[_0xebc5('0x2b')](_0xebc5('0x6f'),_0x5463f6);}if(_0x395302[_0xebc5('0x70')]){try{var _0x97e153=require(_0x395302[_0xebc5('0x70')])[_0xebc5('0x71')](this,_0xc33ef6);_0xc33ef6['uri']=Mustache[_0xebc5('0x72')](_0x395302['url'],_0x97e153,{},['$$','$$']);if(_0xc33ef6[_0xebc5('0x6e')]){_0xc33ef6['headers']=JSON[_0xebc5('0x6b')](Mustache[_0xebc5('0x72')](JSON[_0xebc5('0x73')](_0xc33ef6['headers']),_0x97e153,{},['$$','$$']));}if(_0xc33ef6[_0xebc5('0x6a')]){_0xc33ef6[_0xebc5('0x6a')]=JSON[_0xebc5('0x6b')](Mustache[_0xebc5('0x72')](JSON[_0xebc5('0x73')](_0xc33ef6[_0xebc5('0x6a')]),_0x97e153,{},['$$','$$']));}}catch(_0x17e48f){logger[_0xebc5('0x2b')](_0xebc5('0x74'),_0x17e48f);}}rp(_0xc33ef6)['then'](function(_0x340692){var _0x15ca03={'statusCode':_0x340692[_0xebc5('0x75')]||0xc8,'statusMessage':_0x340692[_0xebc5('0x76')]||'OK','headers':_0x340692[_0xebc5('0x6e')]||{},'body':_0x340692['body']||{}};_0x20d859(null,_0x15ca03);})[_0xebc5('0x14')](function(_0x43e060){var _0x122122={'statusCode':_0x43e060[_0xebc5('0x75')]||0x1f4,'statusMessage':_0x43e060[_0xebc5('0x77')]||_0xebc5('0x78'),'headers':_0x43e060[_0xebc5('0x79')][_0xebc5('0x6e')]||{},'body':_0x43e060[_0xebc5('0x79')][_0xebc5('0x6a')]||{}};_0x20d859(null,_0x122122);});};AGIVertices[_0xebc5('0x12')][_0xebc5('0x7a')]=function(_0x21ce04,_0x5031e9){scripts['googleDialogflow'](this[_0xebc5('0x10')]['uniqueid'],_0x21ce04['key'],_0x21ce04[_0xebc5('0x5c')],_0x21ce04[_0xebc5('0x7b')]||'en')[_0xebc5('0x18')](function(_0x4ee173){_0x5031e9(null,_0x4ee173);})[_0xebc5('0x14')](function(_0x4300e2){_0x5031e9(_0x4300e2);});};AGIVertices[_0xebc5('0x12')][_0xebc5('0x7c')]=function(_0x234d59,_0x46bde6){scripts[_0xebc5('0x7c')](this[_0xebc5('0x10')]['uniqueid'],_0x234d59[_0xebc5('0x7d')],_0x234d59[_0xebc5('0x7e')],_0x234d59['private_key'],_0x234d59[_0xebc5('0x5c')],_0x234d59['dialogflowV2_language']||'en')[_0xebc5('0x18')](function(_0x39d76b){_0x46bde6(null,_0x39d76b);})[_0xebc5('0x14')](function(_0x5f2c14){_0x46bde6(_0x5f2c14);});};AGIVertices[_0xebc5('0x12')][_0xebc5('0x7f')]=function(_0x212756,_0x2a39dc){scripts[_0xebc5('0x7f')](this[_0xebc5('0x10')],_0x212756)[_0xebc5('0x18')](function(_0x125536){_0x2a39dc(null,_0x125536);})[_0xebc5('0x14')](function(_0xe28cda){_0x2a39dc(_0xe28cda);});};AGIVertices[_0xebc5('0x12')]['ispeechTTS']=function(_0x557a64,_0x35ad3f){scripts[_0xebc5('0x80')](_0x557a64[_0xebc5('0x81')],_0x557a64[_0xebc5('0x5c')],_0x557a64[_0xebc5('0x82')]||'en-US',_0x557a64[_0xebc5('0x83')])['then'](function(_0x1980a6){_0x35ad3f(null,_0x1980a6);})['catch'](function(_0x5069e2){_0x35ad3f(_0x5069e2);});};AGIVertices[_0xebc5('0x12')][_0xebc5('0x84')]=function(_0x2dc4eb,_0x8f07ee,_0x6d153b){scripts['ispeechASR'](_0x8f07ee,_0x2dc4eb['key'],_0x2dc4eb[_0xebc5('0x85')]||_0xebc5('0x5e'),this[_0xebc5('0x86')](_0x2dc4eb[_0xebc5('0x87')])?_0x2dc4eb['model']:undefined)['then'](function(_0xd84a7f){_0x6d153b(null,_0xd84a7f);})[_0xebc5('0x14')](function(_0x3a1942){_0x6d153b(_0x3a1942);});};AGIVertices[_0xebc5('0x12')][_0xebc5('0x88')]=function(_0x3d34eb,_0x1bac41){scripts[_0xebc5('0x88')](_0x3d34eb['aws_access_key_id'],_0x3d34eb[_0xebc5('0x89')],_0x3d34eb[_0xebc5('0x8a')],_0x3d34eb[_0xebc5('0x8b')]||'Amy',_0x3d34eb[_0xebc5('0x5c')],_0x3d34eb[_0xebc5('0x8c')]||_0xebc5('0x5c'))['then'](function(_0x3ffbe3){_0x1bac41(null,_0x3ffbe3);})[_0xebc5('0x14')](function(_0x3f7d97){_0x1bac41(_0x3f7d97);});};AGIVertices['prototype'][_0xebc5('0x8d')]=function(_0x1bf603,_0x1dcc6d){scripts[_0xebc5('0x8d')](this['channel'][_0xebc5('0x35')],_0x1bf603[_0xebc5('0x8e')],_0x1bf603[_0xebc5('0x89')],_0x1bf603[_0xebc5('0x8f')],_0x1bf603[_0xebc5('0x5c')],_0x1bf603[_0xebc5('0x90')])[_0xebc5('0x18')](function(_0x412d08){_0x1dcc6d(null,_0x412d08);})['catch'](function(_0x131a2f){_0x1dcc6d(_0x131a2f);});};AGIVertices['prototype']['googleASR']=function(_0x16200e,_0x152314,_0x52280d){scripts[_0xebc5('0x91')](_0x152314,_0x16200e[_0xebc5('0x81')],_0x16200e[_0xebc5('0x92')]||_0xebc5('0x5e'))[_0xebc5('0x18')](function(_0x3e8d85){_0x52280d(null,_0x3e8d85);})[_0xebc5('0x14')](function(_0x5c0a46){_0x52280d(_0x5c0a46);});};AGIVertices[_0xebc5('0x12')][_0xebc5('0x93')]=function(_0x54770d,_0xa70303,_0x579cf4){scripts[_0xebc5('0x93')](_0xa70303,_0x54770d[_0xebc5('0x94')],_0x54770d[_0xebc5('0x95')],_0x54770d[_0xebc5('0x96')])[_0xebc5('0x18')](function(_0x48699f){_0x579cf4(null,_0x48699f);})[_0xebc5('0x14')](function(_0x5c095e){_0x579cf4(_0x5c095e);});};AGIVertices[_0xebc5('0x12')][_0xebc5('0x97')]=function(_0x2f1eb7){var _0x124749=_[_0xebc5('0x98')](verticesWithRetry,_0x2f1eb7[_0xebc5('0x99')])?_0x2f1eb7:_[_0xebc5('0x9a')](_0x2f1eb7);for(var _0x38c407 in _0x124749){if(_0x124749[_0xebc5('0x9b')](_0x38c407)){if(_0x124749[_0x38c407]&&_[_0xebc5('0x9c')](_0x124749[_0x38c407])){if(_[_0xebc5('0x98')](recursiveMapAttributes,_0x38c407)){_0x124749[_0x38c407]=this['replaceObjectAllVariables'](_0x124749[_0x38c407]);}else{_0x124749[_0x38c407]=this[_0xebc5('0x9d')](_0x124749[_0x38c407]);}}}}return _0x124749;};AGIVertices[_0xebc5('0x12')][_0xebc5('0x9e')]=function(_0x18d9cf){for(var _0xb158c5 in _0x18d9cf){if(_0x18d9cf[_0xebc5('0x9b')](_0xb158c5)){if(_[_0xebc5('0x9f')](_0x18d9cf[_0xb158c5])){this['recursiveNodeIndex'](_0x18d9cf[_0xb158c5]);}else if(_[_0xebc5('0xa0')](_0x18d9cf[_0xb158c5])){for(var _0x404401=0x0;_0x404401<_0x18d9cf[_0xb158c5][_0xebc5('0xa1')];_0x404401++){this[_0xebc5('0x9e')](_0x18d9cf[_0xb158c5][_0x404401]);}}else if(_[_0xebc5('0x9c')](_0x18d9cf[_0xb158c5])){_0x18d9cf[_0xb158c5]=this[_0xebc5('0x9d')](_0x18d9cf[_0xb158c5]);}}}};AGIVertices['prototype'][_0xebc5('0xa2')]=function(_0x1470e9,_0x319b9e){for(var _0x915a79 in _0x1470e9){if(_0x1470e9[_0xebc5('0x9b')](_0x915a79)){if(_['isPlainObject'](_0x1470e9[_0x915a79])){if(!_[_0xebc5('0x44')](_0x1470e9[_0x915a79])){this['saveRestApiResult'](_0x1470e9[_0x915a79],util[_0xebc5('0x27')]('%s.%s',_0x319b9e,_0x915a79));}}else if(_[_0xebc5('0xa0')](_0x1470e9[_0x915a79])){for(var _0xa887ec=0x0;_0xa887ec<_0x1470e9[_0x915a79][_0xebc5('0xa1')];_0xa887ec++){this[_0xebc5('0xa2')](_0x1470e9[_0x915a79][_0xa887ec],util[_0xebc5('0x27')](_0xebc5('0xa3'),_0x319b9e,_0x915a79+'['+_0xa887ec+']'));}}else{if(!_['isNil'](_0x1470e9[_0x915a79])){this[_0xebc5('0x10')][_0xebc5('0xa4')](util[_0xebc5('0x27')](_0xebc5('0xa3'),_0x319b9e,_0x915a79),_0x1470e9[_0x915a79]);}}}}};AGIVertices['prototype'][_0xebc5('0xa5')]=function(_0x45766d){try{var _0x2c19e3=JSON[_0xebc5('0x6b')](_0x45766d);this[_0xebc5('0x9e')](_0x2c19e3);return JSON[_0xebc5('0x73')](_0x2c19e3);}catch(_0x5cb951){return this[_0xebc5('0x9d')](_0x45766d);}};AGIVertices[_0xebc5('0x12')][_0xebc5('0x9d')]=function(_0x8ba507){var _0x448cc4=_0x8ba507['split']('{');for(var _0x390baf=0x1;_0x390baf<_0x448cc4[_0xebc5('0xa1')];_0x390baf+=0x1){var _0x22cd8b=_0x448cc4[_0x390baf][_0xebc5('0xa6')]('}');if(_0x22cd8b[_0xebc5('0xa1')]>0x1){_0x8ba507=_0x8ba507[_0xebc5('0xa7')]('{'+_0x22cd8b[0x0]+'}',this[_0xebc5('0x10')][_0xebc5('0xa8')](_0x22cd8b[0x0])['extra']||_0x22cd8b[0x0]);}}if(_0x448cc4[_0xebc5('0xa1')]===0x1){return _0x8ba507[_0xebc5('0x4a')]();}return this[_0xebc5('0x9d')](_0x8ba507);};AGIVertices[_0xebc5('0x12')]['getAndSetVariable']=function(_0xea8ddf,_0x4bdfc1){var _0x248e43=this[_0xebc5('0x10')][_0xebc5('0xa8')](_0xea8ddf);if(_0x248e43[_0xebc5('0xa9')]===-0x1){return _0x248e43;}logger[_0xebc5('0x2c')](util[_0xebc5('0x27')](_0xebc5('0xaa'),_0x4bdfc1,_0x248e43[_0xebc5('0xab')]));return this[_0xebc5('0x10')][_0xebc5('0xa4')](_0x4bdfc1,_0x248e43[_0xebc5('0xab')]);};AGIVertices[_0xebc5('0x12')][_0xebc5('0x86')]=function(_0x4e5115){return _0x4e5115&&_0x4e5115!=='0'&&_0x4e5115!=='-1'&&_0x4e5115!=='';};AGIVertices[_0xebc5('0x12')][_0xebc5('0xac')]=function(_0x3ba6c4){this[_0xebc5('0x34')][_0xebc5('0x71')](this,_0x3ba6c4,'-');_0x3ba6c4[_0xebc5('0xad')]=_0x3ba6c4[_0xebc5('0xac')];return{'code':0xc8,'result':'-'};};AGIVertices[_0xebc5('0x12')][_0xebc5('0xae')]=function(_0x756f29){logger['info'](util[_0xebc5('0x27')]('Enter\x20in\x20MRCPSynth\x20(%s)\x20block',_0x756f29[_0xebc5('0x36')]));if(!this[_0xebc5('0x86')](_0x756f29[_0xebc5('0x5c')])){return this[_0xebc5('0x10')]['noop'](_0xebc5('0xaf'));}var _0x3b15b1='\x22'+_0x756f29[_0xebc5('0x5c')]+'\x22';if(this[_0xebc5('0x86')](_0x756f29[_0xebc5('0x79')])){_0x3b15b1+=','+_0x756f29[_0xebc5('0x79')];}var _0x10061b=this['channel'][_0xebc5('0x56')](_0xebc5('0xb0'),_0x3b15b1);if(_0x10061b['result']===-0x1){return _0x10061b;}return this[_0xebc5('0x10')]['noop'](util[_0xebc5('0x27')]('Executed\x20command\x20MRCPSynth\x20%s',_0x3b15b1));};AGIVertices[_0xebc5('0x12')]['mrcprecog']=function(_0x16a89a){logger[_0xebc5('0x2c')](util['format'](_0xebc5('0xb1'),_0x16a89a[_0xebc5('0x36')]));if(!this[_0xebc5('0x86')](_0x16a89a[_0xebc5('0xb2')])){return this['channel']['noop'](_0xebc5('0xb3'));}var _0x2cb8b2=_0x16a89a[_0xebc5('0xb2')];if(this['isConfigured'](_0x16a89a[_0xebc5('0x79')])){_0x2cb8b2+=','+_0x16a89a[_0xebc5('0x79')];}var _0x4f56fe=this[_0xebc5('0x10')]['exec'](_0xebc5('0xb4'),_0x2cb8b2);if(_0x4f56fe[_0xebc5('0xa9')]===-0x1){return _0x4f56fe;}var _0x189131=this[_0xebc5('0xb5')](_0xebc5('0xb6'),_0xebc5('0xb7'));if(_0x189131[_0xebc5('0xa9')]===-0x1){return _0x189131;}var _0x1200e8=this[_0xebc5('0xb5')](_0xebc5('0xb8'),_0xebc5('0xb9'));if(_0x1200e8['result']===-0x1){return _0x1200e8;}var _0x3fcedc=this['getAndSetVariable'](_0xebc5('0xba'),'MRCP_RECOG_INSTANCE');if(_0x3fcedc['result']===-0x1){return _0x3fcedc;}return this['channel'][_0xebc5('0xbb')](util['format'](_0xebc5('0xbc'),_0x2cb8b2));};AGIVertices[_0xebc5('0x12')][_0xebc5('0x9')]=function(_0x35b14a){logger[_0xebc5('0x2c')](util['format']('Enter\x20in\x20AGI\x20(%s)\x20block',_0x35b14a[_0xebc5('0x36')]));return this['channel']['agi']([_0x35b14a[_0xebc5('0xbd')],_0x35b14a[_0xebc5('0xbe')]]);};AGIVertices[_0xebc5('0x12')][_0xebc5('0xbf')]=function(_0x3353e0){logger[_0xebc5('0x2c')](util[_0xebc5('0x27')](_0xebc5('0xc0'),_0x3353e0[_0xebc5('0x36')]));if(this[_0xebc5('0x86')](_0x3353e0[_0xebc5('0x66')])){logger[_0xebc5('0x2c')](util['format']('Wait\x20%s\x20seconds\x20before\x20answer',_0x3353e0[_0xebc5('0x66')]));var _0x3347f1=this[_0xebc5('0x10')]['wait'](_0x3353e0['timeout']);if(_0x3347f1['result']===-0x1){return _0x3347f1;}}return this[_0xebc5('0x10')][_0xebc5('0xbf')]();};AGIVertices[_0xebc5('0x12')][_0xebc5('0xc1')]=function(_0x57e5a2){logger[_0xebc5('0x2c')](util['format']('Enter\x20in\x20CALLBACK\x20(%s)\x20block',_0x57e5a2['label']));if(!this[_0xebc5('0x86')](_0x57e5a2[_0xebc5('0x47')])){return this[_0xebc5('0x10')][_0xebc5('0x2b')](_0x57e5a2,'no\x20list\x20selected');}_0x57e5a2['scheduledAt']=moment();if(this[_0xebc5('0x86')](_0x57e5a2[_0xebc5('0xc2')])){_0x57e5a2[_0xebc5('0x48')]=moment()[_0xebc5('0xc3')](_0x57e5a2['delay'],'minutes');}if(!this[_0xebc5('0x86')](_0x57e5a2['callback_priority'])){_0x57e5a2['callback_priority']=0x2;}this[_0xebc5('0x40')][_0xebc5('0x71')](this,_0x57e5a2);return this[_0xebc5('0x10')][_0xebc5('0xbb')](util[_0xebc5('0x27')]('CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s',_0x57e5a2[_0xebc5('0x46')],_0x57e5a2['list_id'],_0x57e5a2[_0xebc5('0x48')]));};AGIVertices[_0xebc5('0x12')][_0xebc5('0xc4')]=function(_0x559ff5){logger[_0xebc5('0x2c')](util['format']('Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block',_0x559ff5['label']));var _0x3ca6fb=this[_0xebc5('0x10')][_0xebc5('0x56')](_0x559ff5[_0xebc5('0xc5')],_0x559ff5[_0xebc5('0x79')]);if(_0x3ca6fb[_0xebc5('0xa9')]===-0x1){return _0x3ca6fb;}return this[_0xebc5('0x10')][_0xebc5('0xbb')](util[_0xebc5('0x27')](_0xebc5('0xc6'),_0x559ff5[_0xebc5('0xc5')],_0x559ff5[_0xebc5('0x79')]));};AGIVertices[_0xebc5('0x12')][_0xebc5('0xc7')]=function(_0x10e69c){logger['info'](util[_0xebc5('0x27')](_0xebc5('0xc8'),_0x10e69c[_0xebc5('0x36')]));if(!this['isConfigured'](_0x10e69c[_0xebc5('0x5c')])){return this['channel']['noop'](_0xebc5('0xaf'));}var _0xc3f23c='\x22'+_0x10e69c[_0xebc5('0x5c')]+'\x22';if(this['isConfigured'](_0x10e69c[_0xebc5('0x79')])){_0xc3f23c+=','+_0x10e69c['options'];}var _0x41a550=this[_0xebc5('0x10')][_0xebc5('0x56')](_0xebc5('0xb0'),_0xc3f23c);if(_0x41a550[_0xebc5('0xa9')]===-0x1){return _0x41a550;}return this[_0xebc5('0x10')]['noop'](util[_0xebc5('0x27')]('Executed\x20command\x20MRCPSynth\x20%s',_0xc3f23c));};AGIVertices[_0xebc5('0x12')][_0xebc5('0xc9')]=function(_0x3a8bdc){logger['info'](util['format'](_0xebc5('0xca'),_0x3a8bdc['label']));if(!this[_0xebc5('0x86')](_0x3a8bdc[_0xebc5('0x5c')])){return this[_0xebc5('0x10')][_0xebc5('0xbb')](_0xebc5('0xaf'));}var _0xaa6baa='\x22'+_0x3a8bdc['text']+'\x22';if(this[_0xebc5('0x86')](_0x3a8bdc[_0xebc5('0x79')])){_0xaa6baa+=','+_0x3a8bdc[_0xebc5('0x79')];}var _0x4c8982=this[_0xebc5('0x10')][_0xebc5('0x56')]('MRCPSynth',_0xaa6baa);if(_0x4c8982[_0xebc5('0xa9')]===-0x1){return _0x4c8982;}return this['channel'][_0xebc5('0xbb')](util[_0xebc5('0x27')]('Executed\x20command\x20MRCPSynth\x20%s',_0xaa6baa));};AGIVertices[_0xebc5('0x12')][_0xebc5('0xcb')]=function(_0x2ec31e){logger[_0xebc5('0x2c')](util[_0xebc5('0x27')](_0xebc5('0xcc'),_0x2ec31e[_0xebc5('0x36')]));if(!this['isConfigured'](_0x2ec31e[_0xebc5('0xb2')])){return this[_0xebc5('0x10')][_0xebc5('0xbb')](_0xebc5('0xb3'));}var _0x24e9eb=_0x2ec31e[_0xebc5('0xb2')];if(this[_0xebc5('0x86')](_0x2ec31e[_0xebc5('0x79')])){_0x24e9eb+=','+_0x2ec31e[_0xebc5('0x79')];}var _0x1dff2c=this['channel'][_0xebc5('0x56')](_0xebc5('0xb4'),_0x24e9eb);if(_0x1dff2c[_0xebc5('0xa9')]===-0x1){return _0x1dff2c;}var _0xe302d5=this['getAndSetVariable'](_0xebc5('0xb6'),_0xebc5('0xcd'));if(_0xe302d5[_0xebc5('0xa9')]===-0x1){return _0xe302d5;}var _0x3e1521=this[_0xebc5('0xb5')](_0xebc5('0xb8'),_0xebc5('0xce'));if(_0x3e1521['result']===-0x1){return _0x3e1521;}var _0xae49c=this[_0xebc5('0xb5')]('RECOG_INSTANCE()',_0xebc5('0xcf'));if(_0xae49c['result']===-0x1){return _0xae49c;}return this[_0xebc5('0x10')][_0xebc5('0xbb')](util[_0xebc5('0x27')](_0xebc5('0xbc'),_0x24e9eb));};AGIVertices[_0xebc5('0x12')][_0xebc5('0xd0')]=function(_0x1367eb){logger[_0xebc5('0x2c')](util[_0xebc5('0x27')](_0xebc5('0xd1'),_0x1367eb[_0xebc5('0x36')]));if(!this[_0xebc5('0x86')](_0x1367eb[_0xebc5('0xb2')])){return this[_0xebc5('0x10')][_0xebc5('0xbb')](_0xebc5('0xb3'));}var _0x36b00d=_0x1367eb[_0xebc5('0xb2')];if(this['isConfigured'](_0x1367eb[_0xebc5('0x79')])){_0x36b00d+=','+_0x1367eb['options'];}var _0x4df859=this[_0xebc5('0x10')]['exec']('MRCPRecog',_0x36b00d);if(_0x4df859['result']===-0x1){return _0x4df859;}var _0x3be268=this[_0xebc5('0xb5')](_0xebc5('0xb6'),'SESTEK_ASR_CONFIDENCE');if(_0x3be268[_0xebc5('0xa9')]===-0x1){return _0x3be268;}var _0x597af6=this['getAndSetVariable'](_0xebc5('0xb8'),'SESTEK_ASR_TRANSCRIPT');if(_0x597af6[_0xebc5('0xa9')]===-0x1){return _0x597af6;}var _0x499081=this[_0xebc5('0xb5')](_0xebc5('0xba'),_0xebc5('0xd2'));if(_0x499081[_0xebc5('0xa9')]===-0x1){return _0x499081;}return this[_0xebc5('0x10')][_0xebc5('0xbb')](util[_0xebc5('0x27')]('Executed\x20command\x20MRCPRecog\x20%s',_0x36b00d));};AGIVertices['prototype'][_0xebc5('0xd3')]=function(_0x38ad43){logger[_0xebc5('0x2c')](util['format'](_0xebc5('0xd4'),_0x38ad43[_0xebc5('0x36')]));if(!this[_0xebc5('0x86')](_0x38ad43['odbc_id'])){return this[_0xebc5('0x10')][_0xebc5('0x2b')](_0x38ad43,_0xebc5('0xd5'));}var _0x390c4d=this['getSquareOdbc'][_0xebc5('0x71')](this,_0x38ad43[_0xebc5('0xd6')]);if(!_0x390c4d){return this['channel'][_0xebc5('0x2b')](_0x38ad43,_0xebc5('0xd7'));}if(!this[_0xebc5('0x86')](_0x38ad43['query'])){return this[_0xebc5('0x10')]['error'](_0x38ad43,_0xebc5('0xd8'));}var _0x3fd880=_0x38ad43['query'][_0xebc5('0x58')](/(\r\n|\n|\r)/gm,'\x20');this['channel'][_0xebc5('0xbb')](util[_0xebc5('0x27')](_0xebc5('0xd9'),_0x3fd880));var _0x29010c=this[_0xebc5('0x29')][_0xebc5('0x71')](this,_0x390c4d,_0x3fd880);this['createSquareDetailsReport'][_0xebc5('0x71')](this,_0x38ad43,_0x3fd880);if(!this[_0xebc5('0x86')](_0x38ad43[_0xebc5('0xda')])){return this[_0xebc5('0x10')]['noop'](_0xebc5('0xdb'));}var _0x2cf480=this[_0xebc5('0xa8')][_0xebc5('0x71')](this,_0x38ad43[_0xebc5('0xda')]);if(!_0x2cf480){return this[_0xebc5('0x10')]['error'](_0x38ad43,_0xebc5('0xdc'));}var _0x2dae0b=this;_0x29010c[_0xebc5('0xdd')](function(_0x571e7e,_0x1402cc){Object[_0xebc5('0xde')](_0x571e7e)[_0xebc5('0xdd')](function(_0x1f3f4e){_0x2dae0b[_0xebc5('0x10')]['setVariable'](util[_0xebc5('0x27')](_0xebc5('0xdf'),_0x2cf480,_0x1402cc,_0x1f3f4e),_0x571e7e[_0x1f3f4e]);});});this[_0xebc5('0x10')]['setVariable'](util[_0xebc5('0x27')]('%s_ROWS_COUNT',_0x2cf480),_0x29010c['length']);return this[_0xebc5('0x10')][_0xebc5('0xbb')](util[_0xebc5('0x27')]('variable\x20%s\x20set',_0x2cf480));};AGIVertices['prototype'][_0xebc5('0xe0')]=function(_0x89e045){logger[_0xebc5('0xe1')](util[_0xebc5('0x27')]('Enter\x20in\x20DIAL\x20(%s)\x20block',_0x89e045['label']));if(!this['isConfigured'](_0x89e045[_0xebc5('0xe2')])){return this[_0xebc5('0x10')][_0xebc5('0x2b')](_0x89e045,_0xebc5('0xe3'));}var _0x10d8a4=this[_0xebc5('0x1c')][_0xebc5('0x71')](this,_0x89e045[_0xebc5('0xe2')]);if(!_0x10d8a4){return this['channel'][_0xebc5('0x2b')](_0x89e045,_0xebc5('0xe4'));}var _0xa4c9d4=this[_0xebc5('0x10')][_0xebc5('0x56')](_0xebc5('0xe5'),[util[_0xebc5('0x27')]('SIP/%s',_0x10d8a4),_0x89e045['timeout'],_0x89e045[_0xebc5('0xe6')],_0x89e045[_0xebc5('0x64')]]);if(_0xa4c9d4['result']===-0x1){return _0xa4c9d4;}return this[_0xebc5('0x10')][_0xebc5('0xbb')](util[_0xebc5('0x27')](_0xebc5('0xe7'),_0xebc5('0xe5')));};AGIVertices[_0xebc5('0x12')][_0xebc5('0xe8')]=function(_0x3f4133){logger[_0xebc5('0x2c')](util[_0xebc5('0x27')](_0xebc5('0xe9'),_0x3f4133[_0xebc5('0x36')]));if(!this[_0xebc5('0x86')](_0x3f4133[_0xebc5('0x81')])){return this[_0xebc5('0x10')][_0xebc5('0xbb')](_0xebc5('0xea'));}if(!this[_0xebc5('0x86')](_0x3f4133[_0xebc5('0x5c')])){return this['channel']['noop'](_0xebc5('0xaf'));}this['channel'][_0xebc5('0xeb')]=!![];this[_0xebc5('0x34')](_0x3f4133);this[_0xebc5('0x3f')](_0x3f4133[_0xebc5('0x5c')],'in','','');this[_0xebc5('0x10')][_0xebc5('0xbb')](util[_0xebc5('0x27')]('Trying\x20Dialogflow:\x20%s',_0x3f4133[_0xebc5('0x5c')]));var _0x279afe=this[_0xebc5('0x7a')][_0xebc5('0x71')](this,_0x3f4133);if(_0x279afe){for(var _0x48e024 in _0x279afe){if(_0x279afe[_0xebc5('0x9b')](_0x48e024)){this['channel'][_0xebc5('0xa4')](util[_0xebc5('0x27')](_0xebc5('0xec'),_0x48e024[_0xebc5('0x69')]()),_0x279afe[_0x48e024]);}}this[_0xebc5('0x3f')](_0x279afe['speech'],'out',_0xebc5('0xe8'),'');return this[_0xebc5('0x10')][_0xebc5('0xbb')](util['format'](_0xebc5('0xed'),_0x279afe['speech']));}return this[_0xebc5('0x10')][_0xebc5('0x2b')](_0x3f4133,_0xebc5('0xee'));};AGIVertices[_0xebc5('0x12')][_0xebc5('0xef')]=function(_0x25c593){logger[_0xebc5('0x2c')](util[_0xebc5('0x27')]('Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block',_0x25c593[_0xebc5('0x36')]));if(!this[_0xebc5('0x86')](_0x25c593[_0xebc5('0x7d')])){return this[_0xebc5('0x10')][_0xebc5('0xbb')]('no\x20project_id\x20configured');}if(!this[_0xebc5('0x86')](_0x25c593[_0xebc5('0x7e')])){return this[_0xebc5('0x10')]['noop'](_0xebc5('0xf0'));}if(!this[_0xebc5('0x86')](_0x25c593[_0xebc5('0xf1')])){return this[_0xebc5('0x10')]['noop']('no\x20private_key\x20configured');}if(!this['isConfigured'](_0x25c593[_0xebc5('0xf2')])){return this['channel'][_0xebc5('0xbb')](_0xebc5('0xf3'));}if(!this[_0xebc5('0x86')](_0x25c593[_0xebc5('0x5c')])){return this['channel'][_0xebc5('0xbb')](_0xebc5('0xaf'));}this[_0xebc5('0x10')]['bot']=!![];this[_0xebc5('0x34')](_0x25c593);this['createSquareMessage'](_0x25c593[_0xebc5('0x5c')],'in','','');this[_0xebc5('0x10')]['noop'](util[_0xebc5('0x27')](_0xebc5('0xf4'),_0x25c593[_0xebc5('0x5c')]));var _0x55bd2d=this[_0xebc5('0x7c')][_0xebc5('0x71')](this,_0x25c593);if(_0x55bd2d){for(var _0x9c5f25 in _0x55bd2d){if(_0x55bd2d[_0xebc5('0x9b')](_0x9c5f25)){if(_0x9c5f25!==_0xebc5('0xf5')){this['channel'][_0xebc5('0xa4')](util[_0xebc5('0x27')](_0xebc5('0xec'),_0x9c5f25[_0xebc5('0x69')]()),_0x55bd2d[_0x9c5f25]);}}}this[_0xebc5('0x3f')](_0x55bd2d[_0xebc5('0xf6')],'out',_0xebc5('0xef'),_0x55bd2d[_0xebc5('0xf5')]);return this['channel'][_0xebc5('0xbb')](util['format'](_0xebc5('0xf7'),_0x55bd2d['speech']));}return this['channel'][_0xebc5('0x2b')](_0x25c593,'DialogflowV2\x20is\x20unreachable');};AGIVertices['prototype']['sesteknda']=function(_0x46dced){logger[_0xebc5('0x2c')](util[_0xebc5('0x27')](_0xebc5('0xf8'),_0x46dced['label']));if(!this[_0xebc5('0x86')](_0x46dced[_0xebc5('0xf9')])){return this[_0xebc5('0x10')]['noop'](_0xebc5('0xfa'));}if(!this[_0xebc5('0x86')](_0x46dced[_0xebc5('0xfb')])){return this[_0xebc5('0x10')]['noop'](_0xebc5('0xfc'));}if(!this['isConfigured'](_0x46dced['password'])){return this[_0xebc5('0x10')][_0xebc5('0xbb')](_0xebc5('0xfd'));}if(!this[_0xebc5('0x86')](_0x46dced[_0xebc5('0xfe')])){return this[_0xebc5('0x10')][_0xebc5('0xbb')](_0xebc5('0xaf'));}this[_0xebc5('0x10')][_0xebc5('0xeb')]=!![];this[_0xebc5('0x34')](_0x46dced);this[_0xebc5('0x3f')](_0x46dced[_0xebc5('0x5c')],'in','','');this['channel'][_0xebc5('0xbb')](util[_0xebc5('0x27')](_0xebc5('0xff'),_0x46dced[_0xebc5('0x5c')]));var _0x2978a4=this[_0xebc5('0x7f')][_0xebc5('0x71')](this,_0x46dced);if(_0x2978a4){for(var _0x47d522 in _0x2978a4){if(_0x2978a4['hasOwnProperty'](_0x47d522)){this[_0xebc5('0x10')]['setVariable'](util['format'](_0xebc5('0x100'),_0x47d522[_0xebc5('0x69')]()),_0x2978a4[_0x47d522]);}}this[_0xebc5('0x3f')](_0x2978a4[_0xebc5('0xf6')],_0xebc5('0x101'),_0xebc5('0x102'),'');if(_0x2978a4['audiofile']){this[_0xebc5('0x10')][_0xebc5('0xbb')](util['format'](_0xebc5('0x103'),_0x2978a4[_0xebc5('0x104')]));var _0x30139e=this[_0xebc5('0x10')]['streamFile'](_0x2978a4[_0xebc5('0x104')]);try{fs['unlink'](_0x2978a4[_0xebc5('0x104')]+'.wav');}catch(_0x515975){logger[_0xebc5('0x2b')](_0x515975);}return _0x30139e;}else{return this['channel'][_0xebc5('0xbb')](util[_0xebc5('0x27')](_0xebc5('0x105'),_0x2978a4[_0xebc5('0xf6')]));}}return this['channel']['error'](_0x46dced,'SestekNDA\x20is\x20unreachable');};AGIVertices['prototype'][_0xebc5('0x106')]=function(_0x3e1990){logger['info'](util[_0xebc5('0x27')](_0xebc5('0x107'),_0x3e1990[_0xebc5('0x36')]));return this[_0xebc5('0x10')]['noop'](_0xebc5('0x106'));};AGIVertices[_0xebc5('0x12')]['ext_dial']=function(_0x4b8562){logger[_0xebc5('0x2c')](util['format'](_0xebc5('0x108'),_0x4b8562['label']));var _0x45137a='';if(_0x4b8562[_0xebc5('0x109')]){if(!this['isConfigured'](_0x4b8562[_0xebc5('0x109')])){return this[_0xebc5('0x10')][_0xebc5('0x2b')](_0x4b8562,_0xebc5('0x10a'));}else{var _0x2b103d=parseInt(_0x4b8562[_0xebc5('0x109')],0xa);if(isNaN(_0x2b103d)){_0x45137a=_0x4b8562[_0xebc5('0x109')];}else{_0x45137a=this['getTrunk'][_0xebc5('0x71')](this,_0x4b8562['trunk_id']);if(!_0x45137a){return this['channel']['error'](_0x4b8562,_0xebc5('0x10b'));}}}}else if(_0x4b8562[_0xebc5('0x10c')]){_0x45137a=_0x4b8562[_0xebc5('0x10c')];}else{return this['channel'][_0xebc5('0x2b')](_0x4b8562,_0xebc5('0x10a'));}var _0x284a05=this['channel']['exec'](_0xebc5('0xe5'),[util[_0xebc5('0x27')](_0xebc5('0x10d'),_0x45137a,_0x4b8562[_0xebc5('0x46')]),_0x4b8562['timeout'],_0x4b8562[_0xebc5('0xe6')],_0x4b8562[_0xebc5('0x64')]]);if(_0x284a05['result']===-0x1){return _0x284a05;}return this[_0xebc5('0x10')][_0xebc5('0xbb')](util[_0xebc5('0x27')](_0xebc5('0xe7'),_0xebc5('0xe5')));};AGIVertices['prototype'][_0xebc5('0x10e')]=function(_0x301797){logger[_0xebc5('0x2c')](util[_0xebc5('0x27')](_0xebc5('0x10f'),_0x301797[_0xebc5('0x36')]));return this[_0xebc5('0x10')][_0xebc5('0xbb')](_0xebc5('0x10e'));};AGIVertices[_0xebc5('0x12')]['getdigits']=function(_0xd08c81){logger[_0xebc5('0x2c')](util['format'](_0xebc5('0x110'),_0xd08c81[_0xebc5('0x36')]));if(_0xd08c81[_0xebc5('0xad')]===0x0){return this[_0xebc5('0xac')](_0xd08c81);}_0xd08c81[_0xebc5('0xad')]-=0x1;if(!this[_0xebc5('0x86')](_0xd08c81[_0xebc5('0x111')])){return this[_0xebc5('0x10')][_0xebc5('0x2b')](_0xd08c81,'no\x20file\x20audio\x20selected');}var _0x3b70cb=this[_0xebc5('0x112')][_0xebc5('0x71')](this,_0xd08c81[_0xebc5('0x111')]);if(!_0x3b70cb){return this[_0xebc5('0x10')][_0xebc5('0x2b')](_0xd08c81,_0xebc5('0x113'));}if(!this[_0xebc5('0x86')](_0xd08c81[_0xebc5('0xda')])){return this[_0xebc5('0x10')][_0xebc5('0x2b')](_0xebc5('0xdb'));}var _0x50d802=this[_0xebc5('0x10')][_0xebc5('0x114')](_0x3b70cb,_0xd08c81['response'],_0xd08c81[_0xebc5('0x115')]);var _0x38593d=_0x50d802[_0xebc5('0xa9')]?_0x50d802[_0xebc5('0xa9')][_0xebc5('0x4a')]():'';logger[_0xebc5('0x2c')](_0xebc5('0x116'),JSON[_0xebc5('0x73')](_0x50d802));if(_0x50d802[_0xebc5('0xa9')]===-0x1){this[_0xebc5('0x34')][_0xebc5('0x71')](this,_0xd08c81,_0x38593d);return _0x50d802;}else if(_0x50d802[_0xebc5('0xab')]==='timeout'){_0x50d802['result']=_0x38593d[_0xebc5('0xa1')]>=parseInt(_0xd08c81['mindigit'])?'x':'i';}else{_0x50d802[_0xebc5('0xa9')]=_0x38593d['length']>=parseInt(_0xd08c81[_0xebc5('0x117')])&&_0x38593d['length']<=parseInt(_0xd08c81[_0xebc5('0x115')])?'x':'i';}var _0x163811=this['getVariable'][_0xebc5('0x71')](this,_0xd08c81[_0xebc5('0xda')]);if(!_0x163811){return this[_0xebc5('0x10')][_0xebc5('0x2b')](_0xd08c81,_0xebc5('0xdc'));}this[_0xebc5('0x10')][_0xebc5('0xa4')](_0x163811,_0x38593d);if(this['isConfigured'](_0xd08c81['hiddendigitsnum'])){var _0x846fd6=parseInt(_0xd08c81[_0xebc5('0x118')],0xa);var _0x504508=rs[_0xebc5('0x119')]({'charset':'*','length':_0x846fd6});var _0x513a45=_0x38593d[_0xebc5('0xa1')];if(_0x513a45>0x0){if(_0x513a45>_0x846fd6){this[_0xebc5('0x34')]['sync'](this,_0xd08c81,_0xd08c81['hiddendigitspos']===_0xebc5('0x11a')?_0x504508+_0x38593d[_0xebc5('0x11b')](_0x846fd6):_0x38593d[_0xebc5('0x11b')](0x0,_0x513a45-_0x846fd6)+_0x504508);}else{this[_0xebc5('0x34')][_0xebc5('0x71')](this,_0xd08c81,rs['generate']({'charset':'*','length':_0x513a45}));}}else{this[_0xebc5('0x34')][_0xebc5('0x71')](this,_0xd08c81,'');}}else{this[_0xebc5('0x34')][_0xebc5('0x71')](this,_0xd08c81,_0x38593d);}return _0x50d802;};AGIVertices[_0xebc5('0x12')][_0xebc5('0xf')]=function(_0x5e0b66){logger['info'](util[_0xebc5('0x27')]('Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block',_0x5e0b66[_0xebc5('0x36')]));return this[_0xebc5('0xe')](_0x5e0b66);};AGIVertices[_0xebc5('0x12')][_0xebc5('0x11c')]=function(_0xa01e31){logger[_0xebc5('0x2c')](util[_0xebc5('0x27')]('Enter\x20in\x20GOAL\x20(%s)\x20block',_0xa01e31[_0xebc5('0x36')]));this[_0xebc5('0x34')][_0xebc5('0x71')](this,_0xa01e31,_0xa01e31[_0xebc5('0x11d')]);return this[_0xebc5('0x10')][_0xebc5('0xbb')](util[_0xebc5('0x27')](_0xebc5('0x11e'),_0xa01e31['goalname']));};AGIVertices['prototype'][_0xebc5('0x11f')]=function(_0x187833){logger[_0xebc5('0x2c')](util[_0xebc5('0x27')](_0xebc5('0x120'),_0x187833[_0xebc5('0x36')]));if(!this[_0xebc5('0x86')](_0x187833[_0xebc5('0x8e')])||!this[_0xebc5('0x86')](_0x187833[_0xebc5('0x89')])){return this[_0xebc5('0x10')][_0xebc5('0xbb')](_0xebc5('0x121'));}if(!this[_0xebc5('0x86')](_0x187833[_0xebc5('0x5c')])){return this[_0xebc5('0x10')][_0xebc5('0xbb')](_0xebc5('0xaf'));}this[_0xebc5('0x10')]['noop'](util[_0xebc5('0x27')]('Trying\x20aws\x20Polly\x20%s',_0x187833[_0xebc5('0x5c')]));var _0x18a81d=this['awsPolly'][_0xebc5('0x71')](this,_0x187833);if(_0x18a81d){this['channel']['noop'](util['format'](_0xebc5('0x122'),_0x18a81d));var _0x577d9f=this[_0xebc5('0x10')]['streamFile'](_0x18a81d);try{fs[_0xebc5('0x123')](_0x18a81d+_0xebc5('0x124'));}catch(_0x265882){logger[_0xebc5('0x2b')](_0x265882);}return _0x577d9f;}return this['channel'][_0xebc5('0x2b')](_0x187833,'aws\x20Polly\x20is\x20unreachable');};AGIVertices['prototype']['awslex']=function(_0x459235){logger[_0xebc5('0x2c')](util[_0xebc5('0x27')](_0xebc5('0x125'),_0x459235[_0xebc5('0x36')]));if(!this['isConfigured'](_0x459235[_0xebc5('0x8e')])||!this[_0xebc5('0x86')](_0x459235[_0xebc5('0x89')])){return this['channel']['noop'](_0xebc5('0x121'));}if(!this[_0xebc5('0x86')](_0x459235[_0xebc5('0x90')])){return this[_0xebc5('0x10')][_0xebc5('0xbb')]('no\x20bot\x20name\x20configured');}if(!this[_0xebc5('0x86')](_0x459235['text'])){return this[_0xebc5('0x10')][_0xebc5('0xbb')]('no\x20text\x20configured');}this[_0xebc5('0x10')][_0xebc5('0xeb')]=!![];this[_0xebc5('0x34')](_0x459235);this['createSquareMessage'](_0x459235['text'],'in','','');this[_0xebc5('0x10')][_0xebc5('0xbb')](util[_0xebc5('0x27')](_0xebc5('0x126'),_0x459235[_0xebc5('0x5c')]));var _0x5ae490=this[_0xebc5('0x8d')][_0xebc5('0x71')](this,_0x459235);if(_0x5ae490){for(var _0x563f63 in _0x5ae490){if(_0x5ae490[_0xebc5('0x9b')](_0x563f63)&&_[_0xebc5('0x9c')](_0x5ae490[_0x563f63])){this[_0xebc5('0x10')][_0xebc5('0xa4')](util[_0xebc5('0x27')](_0xebc5('0x127'),_0x563f63[_0xebc5('0x69')]()),_0x5ae490[_0x563f63]);}}if(_['isNil'](_0x5ae490[_0xebc5('0x77')])){return this['channel'][_0xebc5('0xbb')](_0xebc5('0x128'));}else{this[_0xebc5('0x3f')](_0x5ae490[_0xebc5('0x77')],_0xebc5('0x101'),'amazonlex','');return this['channel'][_0xebc5('0xbb')](util[_0xebc5('0x27')]('Amazon\x20Lex\x20Result\x20%s',_0x5ae490[_0xebc5('0x77')]));}}return this[_0xebc5('0x10')][_0xebc5('0x2b')](_0x459235,_0xebc5('0x129'));};AGIVertices['prototype'][_0xebc5('0x12a')]=function(_0x2555c7){logger[_0xebc5('0x2c')](util[_0xebc5('0x27')](_0xebc5('0x12b'),_0x2555c7[_0xebc5('0x36')],_0x2555c7[_0xebc5('0x66')]));if(!this[_0xebc5('0x86')](_0x2555c7[_0xebc5('0x81')])){return this[_0xebc5('0x10')][_0xebc5('0xbb')](_0xebc5('0xea'));}var _0x1e173e=_0xebc5('0x12c');var _0x8310fe=util[_0xebc5('0x27')](_0xebc5('0x12d'),FILES_PATH,rs['generate'](0x4));var _0x37cc50=util[_0xebc5('0x27')](_0xebc5('0xa3'),_0x8310fe,_0x1e173e);var _0x12ccef=!![];if(_0x2555c7[_0xebc5('0x12e')]===_0xebc5('0x12f')){_0x12ccef=![];}var _0xa0e770=this[_0xebc5('0x10')][_0xebc5('0x130')](_0x8310fe,_0x1e173e,_0x2555c7[_0xebc5('0x131')],_0x2555c7['timeout'],undefined,_0x12ccef);if(_0xa0e770[_0xebc5('0xa9')]!==-0x1){this[_0xebc5('0x10')][_0xebc5('0xbb')](util[_0xebc5('0x27')](_0xebc5('0x132'),_0x37cc50));var _0x5f1c27=this[_0xebc5('0x91')][_0xebc5('0x71')](this,_0x2555c7,_0x37cc50);if(_0x5f1c27){for(var _0x51c150 in _0x5f1c27){if(_0x5f1c27['hasOwnProperty'](_0x51c150)){this[_0xebc5('0x10')][_0xebc5('0xa4')](util['format'](_0xebc5('0x133'),_0x51c150[_0xebc5('0x69')]()),_0x5f1c27[_0x51c150]);}}return this[_0xebc5('0x10')][_0xebc5('0xbb')](util['format'](_0xebc5('0x134'),JSON['stringify'](_0x5f1c27)));}}return _0xa0e770;};AGIVertices[_0xebc5('0x12')]['tildeasr']=function(_0x19b57a){logger[_0xebc5('0x2c')](util[_0xebc5('0x27')](_0xebc5('0x135'),_0x19b57a[_0xebc5('0x36')]));if(!this['isConfigured'](_0x19b57a[_0xebc5('0x94')])){return this['channel']['noop'](_0xebc5('0x136'));}if(!this[_0xebc5('0x86')](_0x19b57a[_0xebc5('0x95')])){return this[_0xebc5('0x10')][_0xebc5('0xbb')](_0xebc5('0x137'));}var _0x10ac66=_0xebc5('0x12c');var _0x2d7c39=util[_0xebc5('0x27')]('%s/recordings/%s',FILES_PATH,rs[_0xebc5('0x119')](0x4));var _0x2c41e0=util[_0xebc5('0x27')](_0xebc5('0xa3'),_0x2d7c39,_0x10ac66);var _0x5cde7c=!![];if(_0x19b57a['beep']==='NOBEEP'){_0x5cde7c=![];}var _0x33a095=this[_0xebc5('0x10')][_0xebc5('0x130')](_0x2d7c39,_0x10ac66,_0x19b57a[_0xebc5('0x131')],_0x19b57a[_0xebc5('0x66')],undefined,_0x5cde7c);if(_0x33a095[_0xebc5('0xa9')]!==-0x1){this[_0xebc5('0x10')][_0xebc5('0xbb')](util[_0xebc5('0x27')](_0xebc5('0x138'),_0x2c41e0));var _0x53822b=this[_0xebc5('0x93')][_0xebc5('0x71')](this,_0x19b57a,_0x2c41e0);if(_0x53822b){for(var _0x1f6217 in _0x53822b){if(_0x53822b[_0xebc5('0x9b')](_0x1f6217)){this[_0xebc5('0x10')][_0xebc5('0xa4')](util[_0xebc5('0x27')](_0xebc5('0x139'),_0x1f6217['toUpperCase']()),_0x53822b[_0x1f6217]);}}return this[_0xebc5('0x10')]['noop'](util[_0xebc5('0x27')]('TildeASR\x20Result\x20%s',JSON[_0xebc5('0x73')](_0x53822b)));}}return _0x33a095;};AGIVertices[_0xebc5('0x12')][_0xebc5('0x13a')]=function(_0x24136d){logger[_0xebc5('0x2c')](util[_0xebc5('0x27')](_0xebc5('0x13b'),_0x24136d['label']));return this[_0xebc5('0x10')][_0xebc5('0x13c')](_0x24136d[_0xebc5('0x3a')],_0x24136d[_0xebc5('0x13d')],_0x24136d[_0xebc5('0x3b')]);};AGIVertices['prototype']['gotoif']=function(_0xa5cd0a){logger[_0xebc5('0x2c')](util['format'](_0xebc5('0x13e'),_0xa5cd0a[_0xebc5('0x36')]));if(!this['isConfigured'](_0xa5cd0a[_0xebc5('0x13f')])){return this['channel']['error'](_0xa5cd0a,_0xebc5('0x140'));}try{var _0x51a02c=eval(_0xa5cd0a[_0xebc5('0x13f')])?_0xebc5('0x141'):'false';this[_0xebc5('0x10')][_0xebc5('0xbb')](util[_0xebc5('0x27')](_0xebc5('0x142'),_0xa5cd0a['condition'],_0x51a02c));return{'code':0xc8,'result':_0x51a02c};}catch(_0x2ef7b5){return{'code':0xc8,'result':'false'};}};AGIVertices[_0xebc5('0x12')][_0xebc5('0x143')]=function(_0x25eaa5){logger[_0xebc5('0x2c')](util['format'](_0xebc5('0x144'),_0x25eaa5[_0xebc5('0x36')]));if(!this['isConfigured'](_0x25eaa5['interval_id'])){return this[_0xebc5('0x10')][_0xebc5('0x2b')](_0x25eaa5,'no\x20interval\x20configured');}var _0x2dd054=this[_0xebc5('0x145')][_0xebc5('0x71')](this,_0x25eaa5[_0xebc5('0x146')]);if(!_0x2dd054){return this[_0xebc5('0x10')][_0xebc5('0x2b')](_0x25eaa5,_0xebc5('0x147'));}for(var _0x543da0=0x0;_0x543da0<_0x2dd054[_0xebc5('0xa1')];_0x543da0+=0x1){var _0x4efa66=this[_0xebc5('0x10')]['getVariable'](util[_0xebc5('0x27')](_0xebc5('0x148'),_0x2dd054[_0x543da0]));if(_0x4efa66[_0xebc5('0xa9')]===-0x1){return _0x4efa66;}logger[_0xebc5('0x2c')](util[_0xebc5('0x27')]('IFTIME\x20%s\x20%s',_0x2dd054[_0x543da0],_0x4efa66['extra']));if(_0x4efa66['extra']===_0xebc5('0x141')){logger[_0xebc5('0x2c')](util['format'](_0xebc5('0x149'),_0x2dd054[_0x543da0],'true'));this[_0xebc5('0x10')][_0xebc5('0xbb')](util[_0xebc5('0x27')](_0xebc5('0x149'),_0x2dd054[_0x543da0],'true'));return{'code':0xc8,'result':_0xebc5('0x141')};}else{logger[_0xebc5('0x2c')](util[_0xebc5('0x27')](_0xebc5('0x149'),_0x2dd054[_0x543da0],'false'));this['channel'][_0xebc5('0xbb')](util[_0xebc5('0x27')]('IFTIME\x20%s\x20%s',_0x2dd054[_0x543da0],_0xebc5('0x14a')));}}return{'code':0xc8,'result':_0xebc5('0x14a')};};AGIVertices[_0xebc5('0x12')][_0xebc5('0x14b')]=function(_0x212a08){logger['info'](util[_0xebc5('0x27')](_0xebc5('0x14c'),_0x212a08[_0xebc5('0x36')]));return this[_0xebc5('0x10')][_0xebc5('0x14b')]();};AGIVertices[_0xebc5('0x12')][_0xebc5('0x14d')]=function(_0x19c546){logger[_0xebc5('0x2c')](util['format'](_0xebc5('0x14e'),_0x19c546[_0xebc5('0x36')]));if(!this[_0xebc5('0x86')](_0x19c546['key'])){return this['channel'][_0xebc5('0xbb')]('no\x20key\x20configured');}var _0x4820f7='wav';var _0x4c0f54=util[_0xebc5('0x27')](_0xebc5('0x12d'),FILES_PATH,rs[_0xebc5('0x119')](0x4));var _0x7526f8=util[_0xebc5('0x27')](_0xebc5('0xa3'),_0x4c0f54,_0x4820f7);var _0x532788=!![];if(_0x19c546[_0xebc5('0x12e')]==='NOBEEP'){_0x532788=![];}var _0x444ebd=this['channel']['recordFile'](_0x4c0f54,_0x4820f7,_0x19c546[_0xebc5('0x131')],_0x19c546['timeout'],undefined,_0x532788);if(_0x444ebd[_0xebc5('0xa9')]!==-0x1){this['channel'][_0xebc5('0xbb')](util[_0xebc5('0x27')](_0xebc5('0x14f'),_0x7526f8));var _0xd310d9=this[_0xebc5('0x84')]['sync'](this,_0x19c546,_0x7526f8);if(_0xd310d9){for(var _0x299b2a in _0xd310d9){if(_0xd310d9['hasOwnProperty'](_0x299b2a)){this[_0xebc5('0x10')][_0xebc5('0xa4')](util['format']('ISPEECH_ASR_%s',_0x299b2a[_0xebc5('0x69')]()),_0xd310d9[_0x299b2a]);}}return this[_0xebc5('0x10')]['noop'](util[_0xebc5('0x27')](_0xebc5('0x150'),JSON['stringify'](_0xd310d9)));}}return _0x444ebd;};AGIVertices[_0xebc5('0x12')][_0xebc5('0x151')]=function(_0x27a7dd){logger[_0xebc5('0x2c')](util['format']('Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block',_0x27a7dd['label']));if(!this[_0xebc5('0x86')](_0x27a7dd[_0xebc5('0x81')])){return this[_0xebc5('0x10')]['noop'](_0xebc5('0xea'));}if(!this['isConfigured'](_0x27a7dd[_0xebc5('0x5c')])){return this['channel'][_0xebc5('0xbb')](_0xebc5('0xaf'));}this[_0xebc5('0x10')][_0xebc5('0xbb')](util[_0xebc5('0x27')]('Trying\x20ispeech\x20TTS\x20%s',_0x27a7dd['text']));var _0x552286=this[_0xebc5('0x80')][_0xebc5('0x71')](this,_0x27a7dd);if(_0x552286){this[_0xebc5('0x10')][_0xebc5('0xbb')](util[_0xebc5('0x27')](_0xebc5('0x14f'),_0x552286));var _0x2bc68a=this['channel'][_0xebc5('0x152')](_0x552286,_0x27a7dd[_0xebc5('0x131')]);try{fs['unlink'](_0x552286+_0xebc5('0x124'));}catch(_0x5e197c){logger[_0xebc5('0x2b')](_0x5e197c);}return _0x2bc68a;}return this[_0xebc5('0x10')][_0xebc5('0x2b')](_0x27a7dd,_0xebc5('0x153'));};AGIVertices[_0xebc5('0x12')][_0xebc5('0x154')]=function(_0xcdcd73){logger[_0xebc5('0x2c')](util[_0xebc5('0x27')](_0xebc5('0x155'),_0xcdcd73['label']));if(!this[_0xebc5('0x86')](_0xcdcd73['findBy'])){return this['channel'][_0xebc5('0x2b')](_0xcdcd73,_0xebc5('0x156'));}logger['info'](util[_0xebc5('0x27')](_0xebc5('0x157'),this[_0xebc5('0x10')][_0xebc5('0x38')],_0xcdcd73[_0xebc5('0x158')]));var _0xc645cf=this[_0xebc5('0x51')]['sync'](this,_0xcdcd73[_0xebc5('0x158')]);if(_0xc645cf){logger[_0xebc5('0x2c')](util[_0xebc5('0x27')](_0xebc5('0x159'),this[_0xebc5('0x10')][_0xebc5('0x38')],_0xcdcd73[_0xebc5('0x158')]));this[_0xebc5('0x10')]['noop'](util['format'](_0xebc5('0x159'),this['channel']['callerid'],_0xcdcd73['findBy']));return{'code':0xc8,'result':_0xebc5('0x15a')};}else{logger[_0xebc5('0x2c')](util[_0xebc5('0x27')](_0xebc5('0x15b'),this[_0xebc5('0x10')][_0xebc5('0x38')],_0xcdcd73['findBy']));this['channel'][_0xebc5('0xbb')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xebc5('0x10')][_0xebc5('0x38')],_0xcdcd73[_0xebc5('0x158')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0xebc5('0x12')]['logout']=function(_0xaee84c){logger['info'](util[_0xebc5('0x27')](_0xebc5('0x15c'),_0xaee84c[_0xebc5('0x36')]));if(!this[_0xebc5('0x86')](_0xaee84c['findBy'])){return this[_0xebc5('0x10')]['error'](_0xaee84c,_0xebc5('0x156'));}logger[_0xebc5('0x2c')](util[_0xebc5('0x27')](_0xebc5('0x157'),this[_0xebc5('0x10')][_0xebc5('0x38')],_0xaee84c[_0xebc5('0x158')]));var _0x2e8aba=this[_0xebc5('0x15d')][_0xebc5('0x71')](this,_0xaee84c['findBy']);if(_0x2e8aba){logger[_0xebc5('0x2c')](util[_0xebc5('0x27')](_0xebc5('0x159'),this[_0xebc5('0x10')]['callerid'],_0xaee84c[_0xebc5('0x158')]));this[_0xebc5('0x10')][_0xebc5('0xbb')](util['format'](_0xebc5('0x159'),this[_0xebc5('0x10')][_0xebc5('0x38')],_0xaee84c['findBy']));return{'code':0xc8,'result':'success'};}else{logger[_0xebc5('0x2c')](util[_0xebc5('0x27')](_0xebc5('0x15b'),this['channel'][_0xebc5('0x38')],_0xaee84c[_0xebc5('0x158')]));this[_0xebc5('0x10')][_0xebc5('0xbb')](util[_0xebc5('0x27')](_0xebc5('0x15b'),this[_0xebc5('0x10')]['callerid'],_0xaee84c[_0xebc5('0x158')]));return{'code':0xc8,'result':_0xebc5('0x15e')};}};AGIVertices['prototype']['math']=function(_0x4e5800){logger[_0xebc5('0x2c')](util[_0xebc5('0x27')](_0xebc5('0x15f'),_0x4e5800[_0xebc5('0x36')]));if(!this[_0xebc5('0x86')](_0x4e5800[_0xebc5('0x160')])){return this[_0xebc5('0x10')]['error'](_0x4e5800,_0xebc5('0x161'));}this[_0xebc5('0x10')][_0xebc5('0xbb')](util['format']('math\x20%s',_0x4e5800[_0xebc5('0x160')]));var _0x4931eb=eval(_0x4e5800[_0xebc5('0x160')]);if(!this[_0xebc5('0x86')](_0x4e5800[_0xebc5('0xda')])){return this[_0xebc5('0x10')]['noop'](_0xebc5('0xdb'));}var _0x29b9a9=this[_0xebc5('0xa8')][_0xebc5('0x71')](this,_0x4e5800['variable_id']);if(!_0x29b9a9){return this['channel'][_0xebc5('0x2b')](_0x4e5800,'no\x20variable\x20found');}if(_[_0xebc5('0xa0')](_0x4931eb)){var _0x433b6f=this;_0x4931eb[_0xebc5('0xdd')](function(_0x5b6cec,_0x54d6bf){_0x433b6f[_0xebc5('0x10')][_0xebc5('0xa4')](util[_0xebc5('0x27')](_0xebc5('0x162'),_0x29b9a9,_0x54d6bf),_0x5b6cec);});return this[_0xebc5('0x10')][_0xebc5('0xbb')](util[_0xebc5('0x27')]('variable\x20%s[key]\x20set',_0x29b9a9));}else{return this[_0xebc5('0x10')]['setVariable'](_0x29b9a9,_0x4931eb);}};AGIVertices[_0xebc5('0x12')]['menu']=function(_0x547e8f){logger['info'](util[_0xebc5('0x27')](_0xebc5('0x163'),_0x547e8f[_0xebc5('0x36')]));if(_0x547e8f['retry']===0x0){return this[_0xebc5('0xac')](_0x547e8f);}_0x547e8f[_0xebc5('0xad')]-=0x1;if(!this[_0xebc5('0x86')](_0x547e8f['file_id'])){return this[_0xebc5('0x10')]['error'](_0x547e8f,_0xebc5('0x164'));}var _0x2bfd0e=this[_0xebc5('0x112')][_0xebc5('0x71')](this,_0x547e8f[_0xebc5('0x111')]);if(!_0x2bfd0e){return this['channel']['error'](_0x547e8f,_0xebc5('0x113'));}var _0x5c3442=this[_0xebc5('0x10')][_0xebc5('0x114')](_0x2bfd0e,_0x547e8f[_0xebc5('0x165')],_0x547e8f['digit']);var _0x521018=_0x5c3442[_0xebc5('0xa9')];if(_0x5c3442[_0xebc5('0xa9')]===-0x1){this[_0xebc5('0x34')]['sync'](this,_0x547e8f,'-1');return _0x5c3442;}else if(_0x5c3442[_0xebc5('0xab')]===_0xebc5('0x66')){_0x5c3442[_0xebc5('0xa9')]=_0x5c3442[_0xebc5('0xa9')][_0xebc5('0xa1')]>0x0?_0x5c3442[_0xebc5('0xa9')]:'t';}else if(_[_0xebc5('0x44')](_0x5c3442[_0xebc5('0xa9')])){_0x5c3442[_0xebc5('0xa9')]='#';_0x521018='#';}if(!this[_0xebc5('0x86')](_0x547e8f[_0xebc5('0xda')])){this['channel'][_0xebc5('0xbb')](_0xebc5('0xdb'));}else{var _0x4f1f4f=this[_0xebc5('0xa8')][_0xebc5('0x71')](this,_0x547e8f[_0xebc5('0xda')]);if(!_0x4f1f4f){return this['channel'][_0xebc5('0x2b')](_0x547e8f,_0xebc5('0xdc'));}this[_0xebc5('0x10')]['setVariable'](_0x4f1f4f,_0x521018);}this[_0xebc5('0x34')]['sync'](this,_0x547e8f,_0x521018);return _0x5c3442;};AGIVertices[_0xebc5('0x12')][_0xebc5('0xbb')]=function(_0x5d9a43){logger['info'](util[_0xebc5('0x27')](_0xebc5('0x166'),_0x5d9a43['label']));return this['channel'][_0xebc5('0xbb')](_0x5d9a43[_0xebc5('0x167')]||_0x5d9a43['label']);};AGIVertices[_0xebc5('0x12')]['pause']=function(_0x439c6a){logger[_0xebc5('0x2c')](util['format'](_0xebc5('0x168'),_0x439c6a[_0xebc5('0x36')]));if(!this['isConfigured'](_0x439c6a[_0xebc5('0x158')])){return this['channel'][_0xebc5('0x2b')](_0x439c6a,_0xebc5('0x156'));}logger[_0xebc5('0x2c')](util[_0xebc5('0x27')](_0xebc5('0x157'),this['channel']['callerid'],_0x439c6a[_0xebc5('0x158')]));var _0x415298=this[_0xebc5('0x4c')][_0xebc5('0x71')](this,_0x439c6a[_0xebc5('0x169')]);var _0x2423fa=this[_0xebc5('0x4e')][_0xebc5('0x71')](this,_0x439c6a['findBy'],_0x415298);if(_0x2423fa){logger[_0xebc5('0x2c')](util[_0xebc5('0x27')](_0xebc5('0x159'),this[_0xebc5('0x10')][_0xebc5('0x38')],_0x439c6a[_0xebc5('0x158')]));this[_0xebc5('0x10')][_0xebc5('0xbb')](util['format'](_0xebc5('0x159'),this['channel'][_0xebc5('0x38')],_0x439c6a[_0xebc5('0x158')]));return{'code':0xc8,'result':_0xebc5('0x15a')};}else{logger[_0xebc5('0x2c')](util[_0xebc5('0x27')](_0xebc5('0x15b'),this[_0xebc5('0x10')][_0xebc5('0x38')],_0x439c6a['findBy']));this[_0xebc5('0x10')][_0xebc5('0xbb')](util[_0xebc5('0x27')](_0xebc5('0x159'),this[_0xebc5('0x10')][_0xebc5('0x38')],_0x439c6a[_0xebc5('0x158')]));return{'code':0xc8,'result':_0xebc5('0x15e')};}};AGIVertices[_0xebc5('0x12')]['playback']=function(_0x58b49e){logger[_0xebc5('0x2c')](util[_0xebc5('0x27')](_0xebc5('0x16a'),_0x58b49e[_0xebc5('0x36')]));if(!this[_0xebc5('0x86')](_0x58b49e[_0xebc5('0x111')])){return this['channel'][_0xebc5('0x2b')](_0x58b49e,'no\x20file\x20audio\x20selected');}var _0x286e0d=this[_0xebc5('0x112')][_0xebc5('0x71')](this,_0x58b49e[_0xebc5('0x111')]);if(!_0x286e0d){return this[_0xebc5('0x10')]['error'](_0x58b49e,'no\x20file\x20audio\x20found');}var _0x35a5d9=this[_0xebc5('0x10')][_0xebc5('0x56')](_0xebc5('0x16b'),[_0x286e0d,_0x58b49e[_0xebc5('0xe6')]]);if(_0x35a5d9[_0xebc5('0xa9')]===-0x1){return _0x35a5d9;}return this[_0xebc5('0x10')]['noop'](util['format']('Executed\x20command\x20%s\x20%s',_0xebc5('0x16b'),_0x286e0d));};AGIVertices['prototype'][_0xebc5('0x16c')]=function(_0x51e164){logger[_0xebc5('0x2c')](util['format'](_0xebc5('0x16d'),_0x51e164['label']));if(!this[_0xebc5('0x86')](_0x51e164['queue_id'])){return this[_0xebc5('0x10')]['error'](_0x51e164,_0xebc5('0x16e'));}var _0x1e9bdc='';var _0x51be39=parseInt(_0x51e164[_0xebc5('0x16f')],0xa);if(isNaN(_0x51be39)){_0x1e9bdc=_0x51e164['queue_id'];}else{_0x1e9bdc=this[_0xebc5('0x15')][_0xebc5('0x71')](this,_0x51e164[_0xebc5('0x16f')]);if(!_0x1e9bdc){return this['channel'][_0xebc5('0x2b')](_0x51e164,'no\x20queue\x20found');}}var _0x116ff8='';if(this[_0xebc5('0x86')](_0x51e164[_0xebc5('0x111')])){var _0xa7800e=this['getSound'][_0xebc5('0x71')](this,_0x51e164['file_id']);if(_0xa7800e){_0x116ff8=_0xa7800e;}}this['createSquareDetailsReport']['sync'](this,_0x51e164,_0x1e9bdc);if(_0x51e164['opts'][_0xebc5('0x170')]('x')<0x0){_0x51e164['opts']+='x';}if(_0x51e164[_0xebc5('0xe6')][_0xebc5('0x170')]('X')<0x0){_0x51e164['opts']+='X';}this[_0xebc5('0x10')][_0xebc5('0xa4')]('XMCS-QUEUE',_0x1e9bdc?_0x1e9bdc[_0xebc5('0x171')]():'');var _0x58fdb6=this['channel'][_0xebc5('0x56')](_0xebc5('0x172'),[_0x1e9bdc,_0x51e164[_0xebc5('0xe6')],_0x51e164[_0xebc5('0x64')],_0x116ff8,_0x51e164[_0xebc5('0x66')],_0x51e164['agi'],_0x51e164[_0xebc5('0x173')],_0x51e164[_0xebc5('0x174')],'',_0x51e164[_0xebc5('0x175')]]);if(_0x58fdb6[_0xebc5('0xa9')]===-0x1){return _0x58fdb6;}return this[_0xebc5('0x10')][_0xebc5('0xbb')](util[_0xebc5('0x27')](_0xebc5('0xc6'),_0xebc5('0x172'),_0x1e9bdc));};AGIVertices[_0xebc5('0x12')][_0xebc5('0x176')]=function(_0x537795){logger[_0xebc5('0x2c')](util['format'](_0xebc5('0x177'),_0x537795[_0xebc5('0x36')]));var _0x581bed=_0x537795['recordingFormat']||_0xebc5('0x12c');var _0x5935e4=util['format']('%s_%s',this['channel'][_0xebc5('0x35')],rs['generate'](0x5));var _0x54301f=util[_0xebc5('0x27')]('%s/recordings/%s.%s',FILES_PATH,_0x5935e4,_0x581bed);var _0x1e10f4=util[_0xebc5('0x27')](_0xebc5('0x12d'),FILES_PATH,_0x5935e4);this[_0xebc5('0x39')][_0xebc5('0x71')](this,_0x537795,_0x5935e4,_0x54301f);this[_0xebc5('0x10')][_0xebc5('0xa4')](_0xebc5('0x178'),_0x5935e4);logger[_0xebc5('0x2c')](_0xebc5('0x179'),_0x1e10f4,_0x581bed,_0x537795['escape_digits'],_0x537795[_0xebc5('0x66')]);return this[_0xebc5('0x10')][_0xebc5('0x130')](_0x1e10f4,_0x581bed,_0x537795['escape_digits'],_0x537795[_0xebc5('0x66')],undefined,!![]);};AGIVertices[_0xebc5('0x12')]['restapi']=function(_0xdac664){logger[_0xebc5('0x2c')](util[_0xebc5('0x27')]('Enter\x20in\x20RESTAPI\x20(%s)\x20block',_0xdac664['label']));if(!this['isConfigured'](_0xdac664['url'])){return this[_0xebc5('0x10')]['noop']('no\x20url\x20configured');}var _0x18cfea=this['restAPI'][_0xebc5('0x71')](this,_0xdac664);logger[_0xebc5('0x2c')](util[_0xebc5('0x27')](_0xebc5('0x17a'),util[_0xebc5('0x17b')](_0x18cfea,{'showHidden':![],'depth':null})));if(!this[_0xebc5('0x86')](_0xdac664['variable_id'])){return this[_0xebc5('0x10')][_0xebc5('0xbb')](_0xebc5('0x17c'));}var _0x307dee=this[_0xebc5('0xa8')][_0xebc5('0x71')](this,_0xdac664[_0xebc5('0xda')]);if(!_0x307dee){return this[_0xebc5('0x10')][_0xebc5('0x2b')](_0xdac664,'no\x20variable\x20found');}this[_0xebc5('0x10')][_0xebc5('0xa4')](util['format'](_0xebc5('0x17d'),_0x307dee),_0x18cfea[_0xebc5('0x75')]?_0x18cfea[_0xebc5('0x75')]:'200');this[_0xebc5('0x10')]['setVariable'](util[_0xebc5('0x27')](_0xebc5('0x17e'),_0x307dee),_0x18cfea['statusMessage']?_0x18cfea[_0xebc5('0x76')]:'OK');if(_0x18cfea[_0xebc5('0x6a')]){try{this['saveRestApiResult'](_0x18cfea[_0xebc5('0x6a')],_0x307dee);}catch(_0x3f9e28){logger[_0xebc5('0x2b')](util[_0xebc5('0x27')](_0xebc5('0x17f'),_0x307dee));}}return this[_0xebc5('0x10')]['noop'](util[_0xebc5('0x27')](_0xebc5('0x180'),_0x307dee));};AGIVertices[_0xebc5('0x12')]['saydigits']=function(_0x1cef87){logger[_0xebc5('0x2c')](util['format'](_0xebc5('0x181'),_0x1cef87[_0xebc5('0x36')]));return this[_0xebc5('0x10')][_0xebc5('0x182')](_0x1cef87[_0xebc5('0x183')][_0xebc5('0x58')](/\s+/g,''),_0x1cef87['escape_digits']);};AGIVertices[_0xebc5('0x12')][_0xebc5('0x184')]=function(_0x2826c9){logger[_0xebc5('0x2c')](util[_0xebc5('0x27')]('Enter\x20in\x20SAYNUMBER\x20(%s)\x20block',_0x2826c9[_0xebc5('0x36')]));return this[_0xebc5('0x10')][_0xebc5('0x185')](_0x2826c9['number'][_0xebc5('0x58')](/\s+/g,''),_0x2826c9[_0xebc5('0x186')]);};AGIVertices['prototype']['sayphonetic']=function(_0x23c9ab){logger[_0xebc5('0x2c')](util[_0xebc5('0x27')](_0xebc5('0x187'),_0x23c9ab['label']));return this[_0xebc5('0x10')][_0xebc5('0x188')](_0x23c9ab[_0xebc5('0x5c')],_0x23c9ab[_0xebc5('0x186')]);};AGIVertices['prototype']['sendMail']=function(_0x538757){logger[_0xebc5('0x2c')](util['format'](_0xebc5('0x189'),_0x538757[_0xebc5('0x36')]));if(!this[_0xebc5('0x86')](_0x538757['account_id'])){return this[_0xebc5('0x10')]['noop'](_0xebc5('0x18a'));}var _0x4e147c=this[_0xebc5('0x22')]['sync'](this,_0x538757[_0xebc5('0x18b')]);if(!_0x4e147c||!_0x4e147c[_0xebc5('0x18c')]){return this[_0xebc5('0x10')][_0xebc5('0x2b')](_0x538757,_0xebc5('0x18d'));}var _0x52d69a={'from':util[_0xebc5('0x27')](_0xebc5('0x18e'),_0x4e147c['name'],_0x4e147c[_0xebc5('0x18f')]||_0x4e147c['Smtp']['user']),'to':_0x538757['to']||'','cc':_0x538757['cc']||'','bcc':_0x538757['bcc']||'','subject':_0x538757[_0xebc5('0x190')],'html':_0x538757[_0xebc5('0x5c')],'text':_0x538757[_0xebc5('0x5c')]};var _0x546e9b={'tls':{'rejectUnauthorized':![]}};if(_0x4e147c[_0xebc5('0x18c')][_0xebc5('0x191')]){_0x546e9b[_0xebc5('0x191')]=_0x4e147c['Smtp'][_0xebc5('0x191')];}else{_0x546e9b[_0xebc5('0x192')]=_0x4e147c['Smtp']['host'];_0x546e9b[_0xebc5('0x193')]=_0x4e147c[_0xebc5('0x18c')][_0xebc5('0x193')];_0x546e9b[_0xebc5('0x194')]=_0x4e147c[_0xebc5('0x18c')][_0xebc5('0x194')];}if(_0x4e147c[_0xebc5('0x18c')][_0xebc5('0x195')]){_0x546e9b[_0xebc5('0x196')]={'user':_0x4e147c[_0xebc5('0x18c')][_0xebc5('0x197')],'pass':_0x4e147c[_0xebc5('0x18c')][_0xebc5('0x198')]};}if(this[_0xebc5('0x86')](_0x538757[_0xebc5('0x199')])){}logger['debug'](_0xebc5('0x19a'),JSON[_0xebc5('0x73')](_0x52d69a));this['createSquareDetailsReport']['sync'](this,_0x538757,_0x538757['account_id']);this[_0xebc5('0x10')][_0xebc5('0xbb')](util['format'](_0xebc5('0x19b'),_0x4e147c[_0xebc5('0x1e')]));this['sendMailMessage']['sync'](this,_0x546e9b,_0x52d69a);return this[_0xebc5('0x10')]['noop']('Mail\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices['prototype'][_0xebc5('0x19c')]=function(_0x21c71d){logger['info'](util[_0xebc5('0x27')](_0xebc5('0x19d'),_0x21c71d[_0xebc5('0x36')]));return this[_0xebc5('0x10')][_0xebc5('0xbb')](_0xebc5('0x19e'));};AGIVertices[_0xebc5('0x12')][_0xebc5('0x19f')]=function(_0x196dbd){logger[_0xebc5('0x2c')](util[_0xebc5('0x27')]('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0x196dbd['label']));if(!this[_0xebc5('0x86')](_0x196dbd[_0xebc5('0x1a0')])){return this['channel'][_0xebc5('0xbb')]('no\x20sms\x20account\x20configured');}var _0x18fac6=this[_0xebc5('0x1a1')]['sync'](this,_0x196dbd[_0xebc5('0x1a0')]);if(!_0x18fac6){return this[_0xebc5('0x10')][_0xebc5('0x2b')](_0x196dbd,_0xebc5('0x1a2'));}var _0x3f1305={'body':_0x196dbd['sms_text'],'phone':_0x196dbd['to']||'','SmsAccountId':_0x18fac6['id']};logger['debug'](_0xebc5('0x1a3'),JSON[_0xebc5('0x73')](_0x3f1305));this[_0xebc5('0x34')]['sync'](this,_0x196dbd,_0x196dbd[_0xebc5('0x1a0')]);this['channel'][_0xebc5('0xbb')](util[_0xebc5('0x27')]('Trying\x20SendSMS\x20with\x20account\x20%s',_0x18fac6[_0xebc5('0x1e')]));this[_0xebc5('0x33')]['sync'](this,_0x3f1305);return this[_0xebc5('0x10')][_0xebc5('0xbb')](_0xebc5('0x1a4'));};AGIVertices[_0xebc5('0x12')]['set']=function(_0x37c0cf){logger['info'](util[_0xebc5('0x27')]('Enter\x20in\x20SET\x20(%s)\x20block',_0x37c0cf[_0xebc5('0x36')]));if(!this[_0xebc5('0x86')](_0x37c0cf[_0xebc5('0xda')])){return this['channel'][_0xebc5('0x2b')](_0x37c0cf,_0xebc5('0x1a5'));}var _0x4c0c45=this[_0xebc5('0xa8')][_0xebc5('0x71')](this,_0x37c0cf['variable_id']);if(!_0x4c0c45){return this['channel'][_0xebc5('0x2b')](_0x37c0cf,_0xebc5('0xdc'));}return this[_0xebc5('0x10')][_0xebc5('0xa4')](_0x4c0c45,_0x37c0cf['variable_value']);};AGIVertices[_0xebc5('0x12')][_0xebc5('0x1a6')]=function(_0x3534c5){logger[_0xebc5('0x2c')](util[_0xebc5('0x27')]('Enter\x20in\x20START\x20(%s)\x20block',_0x3534c5['label']));this[_0xebc5('0x10')][_0xebc5('0xbb')]('START\x20CALLY\x20SQUARE');if(_0x3534c5['answer']===_0xebc5('0x1a7')){this[_0xebc5('0x10')][_0xebc5('0xbb')]('Answer');return this['channel']['answer']();}return this['channel'][_0xebc5('0xbb')](_0xebc5('0x1a8'));};AGIVertices[_0xebc5('0x12')][_0xebc5('0x1a9')]=function(_0x2feeb5){logger[_0xebc5('0x2c')](util[_0xebc5('0x27')](_0xebc5('0x1aa'),_0x2feeb5['label']));if(!this[_0xebc5('0x86')](_0x2feeb5[_0xebc5('0x1ab')])){return this[_0xebc5('0x10')][_0xebc5('0x2b')](_0x2feeb5,_0xebc5('0x1ac'));}var _0x26268f=this[_0xebc5('0x1ad')][_0xebc5('0x71')](this,_0x2feeb5[_0xebc5('0x1ab')]);if(!this[_0xebc5('0x86')](_0x26268f)){return this[_0xebc5('0x10')][_0xebc5('0x2b')](_0x2feeb5,util[_0xebc5('0x27')](_0xebc5('0x1ae'),_0x2feeb5[_0xebc5('0x1ab')]));}if(_0x26268f===this['channel']['arg_1']){return this['channel']['error'](_0x2feeb5,_0xebc5('0x1af'));}this['createSquareDetailsReport'][_0xebc5('0x71')](this,_0x2feeb5,_0x26268f);var _0x36ad65=this[_0xebc5('0x10')]['exec']('AGI',util[_0xebc5('0x27')](_0xebc5('0x1b0'),config[_0xebc5('0x9')][_0xebc5('0x192')]||_0xebc5('0x1b1'),_0x26268f,this[_0xebc5('0x10')][_0xebc5('0x37')]));if(_0x36ad65['result']===-0x1){return _0x36ad65;}return this['channel'][_0xebc5('0xbb')](util[_0xebc5('0x27')](_0xebc5('0xc6'),_0xebc5('0x1b2'),_0x26268f));};AGIVertices['prototype'][_0xebc5('0x1b3')]=function(_0x55d0be){logger[_0xebc5('0x2c')](util[_0xebc5('0x27')]('Enter\x20in\x20SYSTEM\x20(%s)\x20block',_0x55d0be['label']));var _0x51da07=this[_0xebc5('0x55')]['sync'](this,_0x55d0be['command']);this['createSquareDetailsReport'][_0xebc5('0x71')](this,_0x55d0be,_0x55d0be[_0xebc5('0xbd')]);if(this[_0xebc5('0x86')](_0x55d0be[_0xebc5('0xda')])){var _0x4a5501=this[_0xebc5('0xa8')]['sync'](this,_0x55d0be['variable_id']);if(_0x4a5501){this[_0xebc5('0x10')][_0xebc5('0xa4')](_0x4a5501,_0x51da07);return this[_0xebc5('0x10')][_0xebc5('0xbb')](util[_0xebc5('0x27')]('sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s',_0x55d0be[_0xebc5('0xbd')],_0x4a5501));}}return this[_0xebc5('0x10')][_0xebc5('0xbb')](util[_0xebc5('0x27')](_0xebc5('0x1b4'),_0x55d0be[_0xebc5('0xbd')]));};AGIVertices[_0xebc5('0x12')][_0xebc5('0x1b5')]=function(_0x380667){logger[_0xebc5('0x2c')](util['format'](_0xebc5('0x1b6'),_0x380667['label']));_0x380667[_0xebc5('0x5c')]=_0x380667['text'][_0xebc5('0x58')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xebc5('0x86')](_0x380667[_0xebc5('0x5a')])){return this[_0xebc5('0x10')][_0xebc5('0xbb')](_0xebc5('0x1b7'));}if(!this[_0xebc5('0x86')](_0x380667[_0xebc5('0x5c')])){return this[_0xebc5('0x10')][_0xebc5('0xbb')](_0xebc5('0xaf'));}this[_0xebc5('0x10')]['noop'](util[_0xebc5('0x27')]('Trying\x20Google\x20Cloud\x20TTS\x20%s',_0x380667['text']));var _0x2d1929=this['googleCloudTTS'][_0xebc5('0x71')](this,_0x380667);if(_0x2d1929){this['channel'][_0xebc5('0xbb')](util[_0xebc5('0x27')]('Google\x20Cloud\x20TTS\x20%s\x20file\x20created',_0x2d1929));var _0x17578d=this[_0xebc5('0x10')]['streamFile'](_0x2d1929);try{fs[_0xebc5('0x123')](_0x2d1929+'.wav');}catch(_0xfd39b1){logger[_0xebc5('0x2b')](_0xfd39b1);}return _0x17578d;}return this[_0xebc5('0x10')][_0xebc5('0x2b')](_0x380667,'Google\x20Cloud\x20TTS\x20is\x20unreachable');};AGIVertices[_0xebc5('0x12')][_0xebc5('0x1b8')]=function(_0x2fd3db){logger[_0xebc5('0x2c')](util[_0xebc5('0x27')](_0xebc5('0x1b9'),_0x2fd3db[_0xebc5('0x36')]));_0x2fd3db[_0xebc5('0x5c')]=_0x2fd3db['text'][_0xebc5('0x58')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0xebc5('0x86')](_0x2fd3db[_0xebc5('0x5c')])){return this[_0xebc5('0x10')]['noop']('no\x20text\x20configured');}this[_0xebc5('0x10')][_0xebc5('0xbb')](util[_0xebc5('0x27')](_0xebc5('0x1ba'),_0x2fd3db[_0xebc5('0x5c')]));var _0x103ee5=this[_0xebc5('0x61')][_0xebc5('0x71')](this,_0x2fd3db);if(_0x103ee5){this['channel'][_0xebc5('0xbb')](util[_0xebc5('0x27')](_0xebc5('0x1bb'),_0x103ee5));var _0x28a871=this['channel'][_0xebc5('0x152')](_0x103ee5);try{fs['unlink'](_0x103ee5+_0xebc5('0x124'));}catch(_0x37aacb){logger[_0xebc5('0x2b')](_0x37aacb);}return _0x28a871;}return this[_0xebc5('0x10')]['error'](_0x2fd3db,_0xebc5('0x1bc'));};AGIVertices[_0xebc5('0x12')][_0xebc5('0x1bd')]=function(_0x365324){logger[_0xebc5('0x2c')](util[_0xebc5('0x27')](_0xebc5('0x1be'),_0x365324[_0xebc5('0x36')]));if(!this[_0xebc5('0x86')](_0x365324[_0xebc5('0x158')])){return this[_0xebc5('0x10')][_0xebc5('0x2b')](_0x365324,_0xebc5('0x156'));}logger[_0xebc5('0x2c')](util['format']('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0xebc5('0x10')][_0xebc5('0x38')],_0x365324[_0xebc5('0x158')]));var _0x1b6531=this[_0xebc5('0x50')][_0xebc5('0x71')](this,_0x365324[_0xebc5('0x158')]);if(_0x1b6531){logger['info'](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0xebc5('0x10')][_0xebc5('0x38')],_0x365324[_0xebc5('0x158')]));this[_0xebc5('0x10')][_0xebc5('0xbb')](util[_0xebc5('0x27')](_0xebc5('0x159'),this[_0xebc5('0x10')][_0xebc5('0x38')],_0x365324['findBy']));return{'code':0xc8,'result':'success'};}else{logger[_0xebc5('0x2c')](util[_0xebc5('0x27')](_0xebc5('0x15b'),this['channel']['callerid'],_0x365324[_0xebc5('0x158')]));this[_0xebc5('0x10')][_0xebc5('0xbb')](util['format'](_0xebc5('0x15b'),this['channel']['callerid'],_0x365324[_0xebc5('0x158')]));return{'code':0xc8,'result':_0xebc5('0x15e')};}};AGIVertices['prototype'][_0xebc5('0x1bf')]=function(_0x59bb6d){logger[_0xebc5('0x2c')](util[_0xebc5('0x27')](_0xebc5('0x1c0'),_0x59bb6d[_0xebc5('0x36')]));var _0x208d17=this[_0xebc5('0x10')][_0xebc5('0x56')](_0xebc5('0x1c1'),[_0x59bb6d[_0xebc5('0x1c2')],_0x59bb6d[_0xebc5('0x79')]]);if(_0x208d17['result']===-0x1){return _0x208d17;}return this[_0xebc5('0x10')][_0xebc5('0xbb')](util[_0xebc5('0x27')](_0xebc5('0xc6'),_0xebc5('0x1c1'),_0x59bb6d[_0xebc5('0x1c2')]));};AGIVertices['prototype']['vswitch']=function(_0x5b384d){logger['info'](util[_0xebc5('0x27')]('Enter\x20in\x20SWITCH\x20(%s)\x20block',_0x5b384d[_0xebc5('0x36')]));if(!this[_0xebc5('0x86')](_0x5b384d[_0xebc5('0xda')])){return this[_0xebc5('0x10')][_0xebc5('0x2b')](_0x5b384d,'no\x20variable\x20selected');}var _0x229249=this[_0xebc5('0xa8')]['sync'](this,_0x5b384d[_0xebc5('0xda')]);if(!_0x229249){return this[_0xebc5('0x10')][_0xebc5('0x2b')](_0x5b384d,'no\x20variable\x20found');}var _0x4b3df8=this['channel'][_0xebc5('0xa8')](_0x229249);return{'code':0xc8,'result':_0x4b3df8[_0xebc5('0xab')]?_0x4b3df8[_0xebc5('0xab')]:'-'};};String[_0xebc5('0x12')][_0xebc5('0xa7')]=function(_0x44b329,_0x4ecd7d){return this[_0xebc5('0xa6')](_0x44b329)[_0xebc5('0x1c3')](_0x4ecd7d);};module[_0xebc5('0x1c4')]=AGIVertices; \ No newline at end of file +var _0xe7a0=['delay','add','minutes','custom_app','application','lumenvoxtts','Executed\x20command\x20MRCPSynth\x20%s','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','lumenvoxasr','LUMENVOX_ASR_CONFIDENCE','LUMENVOX_ASR_TRANSCRIPT','RECOG_INSTANCE()','LUMENVOX_ASR_INSTANCE','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','no\x20database\x20selected','odbc_id','no\x20odbc\x20database\x20found','query','query:\x20%s','variable_id','no\x20variable\x20found','forEach','keys','%s[%s][%s]','%s_ROWS_COUNT','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','no\x20user\x20found','DIAL','SIP/%s','opts','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','speech','out','dialogflow','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','dialogflowV2','dialogflowV2_project_id','no\x20project_id\x20configured','no\x20client_email\x20configured','no\x20private_key\x20configured','dialogflowV2_language','no\x20anguage\x20configured','Trying\x20DialogflowV2:\x20%s','providerResponse','DialogflowV2\x20Result\x20%s','DialogflowV2\x20is\x20unreachable','sesteknda','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','username','password','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','audiofile','unlink','.wav','SestekNDA\x20is\x20unreachable','end','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','trunk_name','SIP/%s/%s','Executed\x20command\x20%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','file_id','no\x20file\x20audio\x20selected','no\x20variable\x20selected\x20for\x20the\x20result','getData','response','maxdigit','test','mindigit','hiddendigitsnum','hiddendigitspos','substr','generate','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','awspolly','aws_access_key_id','no\x20valid\x20credentials\x20configured','streamFile','aws\x20Polly\x20is\x20unreachable','awslex','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','message','amazonlex','Amazon\x20Lex\x20Result\x20%s','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','%s/recordings/%s','beep','recordFile','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','Enter\x20in\x20TILDEASR\x20(%s)\x20block','appid','no\x20appid\x20configured','tilde\x20%s\x20file\x20created','TildeASR\x20Result\x20%s','gotoc','continueAt','extension','priority','condition','no\x20condition\x20configured','true','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','NOBEEP','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20%s\x20file\x20created','ispeech\x20TTS\x20is\x20unreachable','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','agentLogin','AGENT\x20%s\x20FOUND\x20BY','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','success','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','no\x20operation\x20configured','math\x20%s','no\x20file\x20audio\x20found','digit','output','Enter\x20in\x20PAUSE\x20(%s)\x20block','FIND\x20AGENT\x20%s\x20BY\x20%s','pause_id','playback','Executed\x20command\x20%s\x20%s','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','gosub','QUEUE','record','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20variable\x20selected\x20for\x20the\x20response','200','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','variable\x20%s\x20set','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','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>','email','user','service','host','port','secure','authentication','sendMail\x20message','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','no\x20sms\x20account\x20configured','getSmsAccount','sms_account_id','no\x20sms\x20account\x20found','Enter\x20in\x20SET\x20(%s)\x20block','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','127.0.0.1','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','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','no\x20variable\x20selected','exports','path','util','lodash','shelljs','odbc','randomstring','moment','mustache','../../config/logger','agi','../../config/environment','./scripts','rawHeaders','rawBody','menu','getdigits','getsecretdigits','rpc','mailRpc','getVariable','getVariableById','then','catch','getVoiceQueue','getVoiceQueueById','name','prototype','getSquareProject','getSquareOdbc','dsn','getUser','getUserById','getTrunk','getTrunkById','getSound','getSoundPath','save_name','getMailAccount','getMailAccountById','sendMailMessage','getIntervals','getIntervalById','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','getSmsAccountById','createSmsMessage','createSquareDetailsReport','channel','arg_1','callerid','createSquareRecording','uniqueid','calleridname','context','accountcode','dnid','file','createSquareMessage','createCmContact','isNil','random','lastName','phone','list_id','scheduledAt','callback','Callback\x20scheduled\x20at\x20','toString','callback_priority','getPause','getPauseById','agentPause','agent','agentUnpause','agentLogout','internal','%s/%s@from-sip/n','LOCAL','shellCommand','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','en-US','ssmlGender','audioEncoding','googleTTS','google_tts_language','restAPI','timeout','includes','POST','toUpperCase','body','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','render','url','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','googleDialogflowV2','client_email','private_key','sestekNDA','ispeechTTS','ispeech_tts_language','speed','ispeechASR','isConfigured','model','awsPolly','aws_secret_access_key','aws_text_type','awsLex','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appsecret','clear','clone','hasOwnProperty','isString','replaceObjectAllVariables','recursiveNodeIndex','isPlainObject','isArray','length','replaceAllVariables','saveRestApiResult','%s.%s','setVariable','split','replaceAll','extra','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','maxRetry','retry','Enter\x20in\x20MRCPSynth\x20(%s)\x20block','no\x20text\x20configured','exec','MRCPSynth','mrcprecog','Enter\x20in\x20MRCPRecog\x20(%s)\x20block','grammar','noop','no\x20grammar\x20configured','MRCPRecog','RECOG_CONFIDENCE()','MRCP_RECOG_CONFIDENCE','RECOG_INPUT()','MRCP_RECOG_TRANSCRIPT','MRCP_RECOG_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20AGI\x20(%s)\x20block','label','command','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','no\x20list\x20selected'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0xe7a0,0x10d));var _0x0e7a=function(_0x413d86,_0x47f6d0){_0x413d86=_0x413d86-0x0;var _0x3013fd=_0xe7a0[_0x413d86];return _0x3013fd;};'use strict';var fs=require('fs');var path=require(_0x0e7a('0x0'));var util=require(_0x0e7a('0x1'));var _=require(_0x0e7a('0x2'));var sh=require(_0x0e7a('0x3'));var odbc=require(_0x0e7a('0x4'))();var rs=require(_0x0e7a('0x5'));var moment=require(_0x0e7a('0x6'));var Mustache=require(_0x0e7a('0x7'));var rp=require('request-promise');var logger=require(_0x0e7a('0x8'))(_0x0e7a('0x9'));var config=require(_0x0e7a('0xa'));var scripts=require(_0x0e7a('0xb'));var FILES_PATH='/var/opt/motion2/server/files';var recursiveMapAttributes=[_0x0e7a('0xc'),_0x0e7a('0xd')];var verticesWithRetry=[_0x0e7a('0xe'),_0x0e7a('0xf'),_0x0e7a('0x10')];var AGIVertices=function(_0x453fa9,_0x422a1c,_0x311dc3){this['channel']=_0x453fa9;this[_0x0e7a('0x11')]=_0x422a1c;this[_0x0e7a('0x12')]=_0x311dc3;};AGIVertices['prototype'][_0x0e7a('0x13')]=function(_0x1390c8,_0x212e9a){this[_0x0e7a('0x11')][_0x0e7a('0x14')](_0x1390c8)[_0x0e7a('0x15')](function(_0x3d0c7f){_0x212e9a(null,_0x3d0c7f?_0x3d0c7f['name']:![]);})[_0x0e7a('0x16')](function(_0x8c932f){_0x212e9a(_0x8c932f);});};AGIVertices['prototype'][_0x0e7a('0x17')]=function(_0x4194bd,_0x3d5811){this[_0x0e7a('0x11')][_0x0e7a('0x18')](_0x4194bd)[_0x0e7a('0x15')](function(_0x4e7ff7){_0x3d5811(null,_0x4e7ff7?_0x4e7ff7[_0x0e7a('0x19')]:![]);})[_0x0e7a('0x16')](function(_0xcab847){_0x3d5811(_0xcab847);});};AGIVertices[_0x0e7a('0x1a')][_0x0e7a('0x1b')]=function(_0xd7fe58,_0x1bd4c0){this['rpc']['getSquareProjectById'](_0xd7fe58)['then'](function(_0x3e637c){_0x1bd4c0(null,_0x3e637c?_0x3e637c['name']:![]);})[_0x0e7a('0x16')](function(_0x3a2615){_0x1bd4c0(_0x3a2615);});};AGIVertices[_0x0e7a('0x1a')][_0x0e7a('0x1c')]=function(_0x387c88,_0x4852be){this[_0x0e7a('0x11')]['getSquareOdbcById'](_0x387c88)[_0x0e7a('0x15')](function(_0x31fb1e){_0x4852be(null,_0x31fb1e?_0x31fb1e[_0x0e7a('0x1d')]:![]);})[_0x0e7a('0x16')](function(_0xf09810){_0x4852be(_0xf09810);});};AGIVertices[_0x0e7a('0x1a')][_0x0e7a('0x1e')]=function(_0x5d2266,_0x39e68d){this[_0x0e7a('0x11')][_0x0e7a('0x1f')](_0x5d2266)[_0x0e7a('0x15')](function(_0x19d5eb){_0x39e68d(null,_0x19d5eb?_0x19d5eb['name']:![]);})[_0x0e7a('0x16')](function(_0x37d7e9){_0x39e68d(_0x37d7e9);});};AGIVertices['prototype'][_0x0e7a('0x20')]=function(_0x36265a,_0x32dfb6){this[_0x0e7a('0x11')][_0x0e7a('0x21')](_0x36265a)['then'](function(_0x59bc3c){_0x32dfb6(null,_0x59bc3c?_0x59bc3c[_0x0e7a('0x19')]:![]);})[_0x0e7a('0x16')](function(_0x1ca380){_0x32dfb6(_0x1ca380);});};AGIVertices['prototype'][_0x0e7a('0x22')]=function(_0x2e8cb,_0x256318){var _0x190cf0=this;this[_0x0e7a('0x11')]['getSoundById'](_0x2e8cb)[_0x0e7a('0x15')](function(_0x126ddf){_0x256318(null,_0x126ddf?_0x190cf0[_0x0e7a('0x23')](_0x126ddf[_0x0e7a('0x24')]):![]);})[_0x0e7a('0x16')](function(_0x4485e8){_0x256318(_0x4485e8);});};AGIVertices[_0x0e7a('0x1a')][_0x0e7a('0x25')]=function(_0x488a33,_0x1a6331){this['rpc'][_0x0e7a('0x26')](_0x488a33)[_0x0e7a('0x15')](function(_0x3d3a2a){_0x1a6331(null,_0x3d3a2a?_0x3d3a2a:![]);})['catch'](function(_0x128287){_0x1a6331(_0x128287);});};AGIVertices[_0x0e7a('0x1a')][_0x0e7a('0x27')]=function(_0xe4e32c,_0x2b2272,_0x49a36a){this['mailRpc'][_0x0e7a('0x27')](_0xe4e32c,_0x2b2272)['then'](function(){_0x49a36a(null);})[_0x0e7a('0x16')](function(_0x25ab16){_0x49a36a(_0x25ab16);});};AGIVertices[_0x0e7a('0x1a')][_0x0e7a('0x28')]=function(_0x24ca2c,_0x35e4a4){this[_0x0e7a('0x11')][_0x0e7a('0x29')](_0x24ca2c)[_0x0e7a('0x15')](function(_0x5eb992){if(_0x5eb992){if(_0x5eb992['IntervalId']){_0x35e4a4(null,[_0x5eb992[_0x0e7a('0x2a')]]);}else{_0x35e4a4(null,_[_0x0e7a('0x2b')](_0x5eb992[_0x0e7a('0x2c')],_0x0e7a('0x2a')));}}else{_0x35e4a4(null,![]);}})[_0x0e7a('0x16')](function(_0x20f93d){_0x35e4a4(_0x20f93d);});};AGIVertices[_0x0e7a('0x1a')][_0x0e7a('0x23')]=function(_0x53026e){return util[_0x0e7a('0x2d')](_0x0e7a('0x2e'),FILES_PATH,_0x53026e);};AGIVertices[_0x0e7a('0x1a')][_0x0e7a('0x2f')]=function(_0x4fbad9,_0x17a372,_0x1c954f){odbc[_0x0e7a('0x30')](_0x4fbad9,function(_0x4de1dc){if(_0x4de1dc){logger[_0x0e7a('0x31')](_0x0e7a('0x32'),_0x4de1dc);_0x1c954f(_0x4de1dc);}else{logger[_0x0e7a('0x33')](_0x0e7a('0x34'));odbc['query'](_0x17a372,function(_0x39c8b8,_0x4a3780){if(_0x39c8b8){logger['info'](_0x0e7a('0x35'),_0x17a372);_0x1c954f(_0x39c8b8);}else{logger[_0x0e7a('0x33')](_0x0e7a('0x36'),_0x17a372);odbc[_0x0e7a('0x37')](function(_0x4cddf1){if(_0x4cddf1){logger[_0x0e7a('0x31')](_0x0e7a('0x38'),_0x4cddf1);}_0x1c954f(null,_0x4a3780);});}});}});};AGIVertices[_0x0e7a('0x1a')]['getSmsAccount']=function(_0x467726,_0x49077a){this[_0x0e7a('0x11')][_0x0e7a('0x39')](_0x467726)[_0x0e7a('0x15')](function(_0x181b7e){_0x49077a(null,_0x181b7e?_0x181b7e:![]);})[_0x0e7a('0x16')](function(_0x2ebd07){_0x49077a(_0x2ebd07);});};AGIVertices['prototype'][_0x0e7a('0x3a')]=function(_0x32aa76,_0x410069){this[_0x0e7a('0x11')]['createSmsMessage'](_0x32aa76)['then'](function(_0x1f983a){_0x410069(null,_0x1f983a);})['catch'](function(_0x30be8d){_0x410069(_0x30be8d);});};AGIVertices[_0x0e7a('0x1a')][_0x0e7a('0x3b')]=function(_0x21ee37,_0x5b6ac5,_0x5d1fc6){this['rpc']['createSquareDetailsReport']({'uniqueid':this[_0x0e7a('0x3c')]['uniqueid'],'node':_0x21ee37['label'],'application':_0x21ee37['agicommand'],'data':_0x5b6ac5||null,'project_name':this[_0x0e7a('0x3c')][_0x0e7a('0x3d')],'callerid':this[_0x0e7a('0x3c')][_0x0e7a('0x3e')]})['then'](function(_0x5dd6ef){if(_0x5d1fc6){_0x5d1fc6(null,_0x5dd6ef);}})['catch'](function(_0x141b6d){if(_0x5d1fc6){_0x5d1fc6(_0x141b6d);}});};AGIVertices[_0x0e7a('0x1a')][_0x0e7a('0x3f')]=function(_0x522c07,_0x34d00b,_0x58f428,_0x5d17f9){this[_0x0e7a('0x11')][_0x0e7a('0x3f')]({'uniqueid':this[_0x0e7a('0x3c')][_0x0e7a('0x40')],'callerid':this[_0x0e7a('0x3c')][_0x0e7a('0x3e')],'calleridname':this[_0x0e7a('0x3c')][_0x0e7a('0x41')],'context':this[_0x0e7a('0x3c')][_0x0e7a('0x42')],'extension':this['channel']['extension'],'priority':this['channel']['priority'],'accountcode':this[_0x0e7a('0x3c')][_0x0e7a('0x43')],'dnid':this[_0x0e7a('0x3c')][_0x0e7a('0x44')],'projectName':this[_0x0e7a('0x3c')][_0x0e7a('0x3d')],'saveName':_0x34d00b,'filename':_0x522c07[_0x0e7a('0x45')]||_0x34d00b,'savePath':_0x58f428})[_0x0e7a('0x15')](function(_0x293a3b){_0x5d17f9(null,_0x293a3b);})[_0x0e7a('0x16')](function(_0x4a06b9){_0x5d17f9(_0x4a06b9);});};AGIVertices[_0x0e7a('0x1a')][_0x0e7a('0x46')]=function(_0x233521,_0x585726,_0x5b859a,_0x387d15,_0x118dbd){this['rpc']['createSquareMessage']({'uniqueid':this['channel'][_0x0e7a('0x40')],'body':_0x233521,'direction':_0x585726,'providerName':_0x5b859a,'providerResponse':_0x387d15})['then'](function(_0xc79496){if(_0x118dbd){_0x118dbd(null,_0xc79496);}})[_0x0e7a('0x16')](function(_0x446b92){if(_0x118dbd){_0x118dbd(_0x446b92);}});};AGIVertices['prototype']['createCmContact']=function(_0x54d24c,_0x469056){this[_0x0e7a('0x11')][_0x0e7a('0x47')]({'firstName':_['isEmpty'](_0x54d24c[_0x0e7a('0x19')])||_[_0x0e7a('0x48')](_0x54d24c['name'])?'callback_'+Math[_0x0e7a('0x49')]():_0x54d24c[_0x0e7a('0x19')],'lastName':_['isEmpty'](_0x54d24c[_0x0e7a('0x4a')])||_['isNil'](_0x54d24c['lastName'])?null:_0x54d24c[_0x0e7a('0x4a')],'phone':_0x54d24c[_0x0e7a('0x4b')],'ListId':_0x54d24c[_0x0e7a('0x4c')],'scheduledat':_0x54d24c[_0x0e7a('0x4d')],'callbackUniqueid':this[_0x0e7a('0x3c')][_0x0e7a('0x40')],'tags':_0x0e7a('0x4e'),'description':_0x0e7a('0x4f')+_0x54d24c['scheduledAt'][_0x0e7a('0x50')](),'priority':_0x54d24c[_0x0e7a('0x51')]})[_0x0e7a('0x15')](function(_0x1320ca){_0x469056(null,_0x1320ca);})['catch'](function(_0x44f64f){_0x469056(_0x44f64f);});};AGIVertices[_0x0e7a('0x1a')][_0x0e7a('0x52')]=function(_0x31d58d,_0x30d0d7){this['rpc'][_0x0e7a('0x53')](_0x31d58d)[_0x0e7a('0x15')](function(_0x489cf1){_0x30d0d7(null,_0x489cf1?_0x489cf1[_0x0e7a('0x19')]:![]);})[_0x0e7a('0x16')](function(_0x210d78){_0x30d0d7(_0x210d78);});};AGIVertices[_0x0e7a('0x1a')][_0x0e7a('0x54')]=function(_0x481d0a,_0x18d9a0,_0x5344e7){var _0x5f1bec={'role':_0x0e7a('0x55')};_0x5f1bec[_0x481d0a]=this[_0x0e7a('0x3c')][_0x0e7a('0x3e')];this[_0x0e7a('0x11')]['agentPause'](_0x5f1bec,_0x18d9a0,this['channel'][_0x0e7a('0x40')])['then'](function(_0x4805bc){_0x5344e7(null,_[_0x0e7a('0x48')](_0x4805bc)?![]:!![]);})[_0x0e7a('0x16')](function(_0x5458b4){logger[_0x0e7a('0x31')](_0x5458b4);_0x5344e7(null,![]);});};AGIVertices[_0x0e7a('0x1a')][_0x0e7a('0x56')]=function(_0x19e790,_0x161ac7){var _0x594781={'role':_0x0e7a('0x55')};_0x594781[_0x19e790]=this['channel'][_0x0e7a('0x3e')];this[_0x0e7a('0x11')][_0x0e7a('0x56')](_0x594781)[_0x0e7a('0x15')](function(_0x419e1f){_0x161ac7(null,_[_0x0e7a('0x48')](_0x419e1f)?![]:!![]);})['catch'](function(_0x50c763){logger['error'](_0x50c763);_0x161ac7(null,![]);});};AGIVertices[_0x0e7a('0x1a')][_0x0e7a('0x57')]=function(_0x5edfb3,_0x455f26){var _0x181d3a={'role':_0x0e7a('0x55')};_0x181d3a[_0x5edfb3]=this['channel'][_0x0e7a('0x3e')];this[_0x0e7a('0x11')][_0x0e7a('0x57')](_0x181d3a)[_0x0e7a('0x15')](function(_0x74bc0a){_0x455f26(null,_[_0x0e7a('0x48')](_0x74bc0a)?![]:!![]);})[_0x0e7a('0x16')](function(_0x393037){logger[_0x0e7a('0x31')](_0x393037);_0x455f26(null,![]);});};AGIVertices[_0x0e7a('0x1a')]['agentLogin']=function(_0x3e6d3b,_0x10f06b){var _0x76e3ef={'role':'agent'};_0x76e3ef[_0x3e6d3b]=this[_0x0e7a('0x3c')][_0x0e7a('0x3e')];var _0x3f7761=_0x3e6d3b!=_0x0e7a('0x58')?util['format'](_0x0e7a('0x59'),_0x0e7a('0x5a'),this[_0x0e7a('0x3c')][_0x0e7a('0x3e')]):undefined;this[_0x0e7a('0x11')]['agentLogin'](_0x76e3ef,_0x3f7761)['then'](function(_0x4f4a9){_0x10f06b(null,_[_0x0e7a('0x48')](_0x4f4a9)?![]:!![]);})[_0x0e7a('0x16')](function(_0x1cc5db){logger[_0x0e7a('0x31')](_0x1cc5db);_0x10f06b(null,![]);});};AGIVertices[_0x0e7a('0x1a')][_0x0e7a('0x5b')]=function(_0x2ab971,_0x250f4c){sh['exec'](_['trim'](_0x2ab971),function(_0x192d66,_0x2c48e4){var _0x41b292=_0x2c48e4[_0x0e7a('0x5c')](/(\r\n|\n|\r)/gm,'');_0x250f4c(null,_0x41b292);});};AGIVertices[_0x0e7a('0x1a')][_0x0e7a('0x5d')]=function(_0x4276aa,_0x5d1ce9){scripts[_0x0e7a('0x5d')](_0x4276aa[_0x0e7a('0x5e')],_0x4276aa[_0x0e7a('0x5f')]||_0x0e7a('0x60'),_0x4276aa['text'],_0x4276aa[_0x0e7a('0x61')]||_0x0e7a('0x62'),_0x4276aa[_0x0e7a('0x63')]||'MALE',_0x4276aa[_0x0e7a('0x64')]||'MP3')[_0x0e7a('0x15')](function(_0xcaccb7){_0x5d1ce9(null,_0xcaccb7);})[_0x0e7a('0x16')](function(_0x3e67b0){_0x5d1ce9(_0x3e67b0);});};AGIVertices[_0x0e7a('0x1a')][_0x0e7a('0x65')]=function(_0x1193e2,_0xe886aa){scripts[_0x0e7a('0x65')](_0x1193e2[_0x0e7a('0x60')],_0x1193e2[_0x0e7a('0x66')]||'en',0x1)[_0x0e7a('0x15')](function(_0x10f168){_0xe886aa(null,_0x10f168);})['catch'](function(_0x4537c0){_0xe886aa(_0x4537c0);});};AGIVertices[_0x0e7a('0x1a')][_0x0e7a('0x67')]=function(_0x48f271,_0x48ba2c){var _0x233dca={'uri':_0x48f271['url'],'method':_0x48f271['method'],'json':!![],'resolveWithFullResponse':!![],'strictSSL':![],'timeout':typeof parseInt(_0x48f271[_0x0e7a('0x68')])==='number'&&parseInt(_0x48f271[_0x0e7a('0x68')])>=0x1?parseInt(_0x48f271['timeout'])*0x3e8:0x5*0x3e8};if(_[_0x0e7a('0x69')]([_0x0e7a('0x6a'),'PUT'],_0x233dca['method'][_0x0e7a('0x6b')]())){try{_0x233dca[_0x0e7a('0x6c')]=_0x48f271[_0x0e7a('0xd')]?JSON[_0x0e7a('0x6d')](_0x48f271[_0x0e7a('0xd')]):{};}catch(_0x5b1260){logger['error'](_0x0e7a('0x6e'),_0x5b1260);}}try{_0x233dca[_0x0e7a('0x6f')]=_0x48f271[_0x0e7a('0xc')]?JSON['parse'](_0x48f271[_0x0e7a('0xc')]):{};}catch(_0x1c3420){logger[_0x0e7a('0x31')](_0x0e7a('0x70'),_0x1c3420);}if(_0x48f271[_0x0e7a('0x71')]){try{var _0x290881=require(_0x48f271[_0x0e7a('0x71')])[_0x0e7a('0x72')](this,_0x233dca);_0x233dca[_0x0e7a('0x73')]=Mustache[_0x0e7a('0x74')](_0x48f271[_0x0e7a('0x75')],_0x290881,{},['$$','$$']);if(_0x233dca[_0x0e7a('0x6f')]){_0x233dca['headers']=JSON[_0x0e7a('0x6d')](Mustache[_0x0e7a('0x74')](JSON[_0x0e7a('0x76')](_0x233dca['headers']),_0x290881,{},['$$','$$']));}if(_0x233dca[_0x0e7a('0x6c')]){_0x233dca[_0x0e7a('0x6c')]=JSON[_0x0e7a('0x6d')](Mustache[_0x0e7a('0x74')](JSON['stringify'](_0x233dca['body']),_0x290881,{},['$$','$$']));}}catch(_0x462575){logger[_0x0e7a('0x31')](_0x0e7a('0x77'),_0x462575);}}rp(_0x233dca)['then'](function(_0x54bc20){var _0x442785={'statusCode':_0x54bc20[_0x0e7a('0x78')]||0xc8,'statusMessage':_0x54bc20[_0x0e7a('0x79')]||'OK','headers':_0x54bc20[_0x0e7a('0x6f')]||{},'body':_0x54bc20['body']||{}};_0x48ba2c(null,_0x442785);})[_0x0e7a('0x16')](function(_0x4f6ced){var _0x243bfb={'statusCode':_0x4f6ced['statusCode']||0x1f4,'statusMessage':_0x4f6ced['message']||_0x0e7a('0x7a'),'headers':_0x4f6ced[_0x0e7a('0x7b')][_0x0e7a('0x6f')]||{},'body':_0x4f6ced[_0x0e7a('0x7b')][_0x0e7a('0x6c')]||{}};_0x48ba2c(null,_0x243bfb);});};AGIVertices[_0x0e7a('0x1a')][_0x0e7a('0x7c')]=function(_0x5baeab,_0x4b43ba){scripts[_0x0e7a('0x7c')](this[_0x0e7a('0x3c')][_0x0e7a('0x40')],_0x5baeab[_0x0e7a('0x7d')],_0x5baeab['text'],_0x5baeab[_0x0e7a('0x7e')]||'en')[_0x0e7a('0x15')](function(_0x4b7949){_0x4b43ba(null,_0x4b7949);})[_0x0e7a('0x16')](function(_0x11b2f3){_0x4b43ba(_0x11b2f3);});};AGIVertices[_0x0e7a('0x1a')][_0x0e7a('0x7f')]=function(_0x281494,_0x44c091){scripts['googleDialogflowV2'](this[_0x0e7a('0x3c')]['uniqueid'],_0x281494['dialogflowV2_project_id'],_0x281494[_0x0e7a('0x80')],_0x281494[_0x0e7a('0x81')],_0x281494['text'],_0x281494['dialogflowV2_language']||'en')[_0x0e7a('0x15')](function(_0x2bd19a){_0x44c091(null,_0x2bd19a);})[_0x0e7a('0x16')](function(_0x1ef31f){_0x44c091(_0x1ef31f);});};AGIVertices[_0x0e7a('0x1a')][_0x0e7a('0x82')]=function(_0x5ac8ec,_0x504dde){scripts[_0x0e7a('0x82')](this[_0x0e7a('0x3c')],_0x5ac8ec)[_0x0e7a('0x15')](function(_0x2f755e){_0x504dde(null,_0x2f755e);})['catch'](function(_0x4b9322){_0x504dde(_0x4b9322);});};AGIVertices['prototype'][_0x0e7a('0x83')]=function(_0x56f664,_0x3f8339){scripts['ispeechTTS'](_0x56f664[_0x0e7a('0x7d')],_0x56f664['text'],_0x56f664[_0x0e7a('0x84')]||_0x0e7a('0x62'),_0x56f664[_0x0e7a('0x85')])[_0x0e7a('0x15')](function(_0x1e76c2){_0x3f8339(null,_0x1e76c2);})[_0x0e7a('0x16')](function(_0x5067e4){_0x3f8339(_0x5067e4);});};AGIVertices[_0x0e7a('0x1a')]['ispeechASR']=function(_0x45007e,_0x4b7451,_0x31759f){scripts[_0x0e7a('0x86')](_0x4b7451,_0x45007e[_0x0e7a('0x7d')],_0x45007e['ispeech_asr_language']||_0x0e7a('0x62'),this[_0x0e7a('0x87')](_0x45007e[_0x0e7a('0x88')])?_0x45007e[_0x0e7a('0x88')]:undefined)[_0x0e7a('0x15')](function(_0x51b2b9){_0x31759f(null,_0x51b2b9);})[_0x0e7a('0x16')](function(_0x2bcbd3){_0x31759f(_0x2bcbd3);});};AGIVertices[_0x0e7a('0x1a')][_0x0e7a('0x89')]=function(_0x44945b,_0x3c2e36){scripts['awsPolly'](_0x44945b['aws_access_key_id'],_0x44945b[_0x0e7a('0x8a')],_0x44945b['aws_polly_region'],_0x44945b['aws_polly_voice']||'Amy',_0x44945b[_0x0e7a('0x60')],_0x44945b[_0x0e7a('0x8b')]||_0x0e7a('0x60'))[_0x0e7a('0x15')](function(_0x14b777){_0x3c2e36(null,_0x14b777);})[_0x0e7a('0x16')](function(_0x3f280a){_0x3c2e36(_0x3f280a);});};AGIVertices[_0x0e7a('0x1a')][_0x0e7a('0x8c')]=function(_0x3d0e0b,_0x4a782b){scripts[_0x0e7a('0x8c')](this[_0x0e7a('0x3c')]['uniqueid'],_0x3d0e0b['aws_access_key_id'],_0x3d0e0b[_0x0e7a('0x8a')],_0x3d0e0b[_0x0e7a('0x8d')],_0x3d0e0b[_0x0e7a('0x60')],_0x3d0e0b[_0x0e7a('0x8e')])[_0x0e7a('0x15')](function(_0x450fff){_0x4a782b(null,_0x450fff);})['catch'](function(_0x186cc3){_0x4a782b(_0x186cc3);});};AGIVertices[_0x0e7a('0x1a')][_0x0e7a('0x8f')]=function(_0x421573,_0x4d718a,_0x481129){scripts[_0x0e7a('0x8f')](_0x4d718a,_0x421573[_0x0e7a('0x7d')],_0x421573[_0x0e7a('0x90')]||'en-US')[_0x0e7a('0x15')](function(_0x32cc49){_0x481129(null,_0x32cc49);})[_0x0e7a('0x16')](function(_0x1459ac){_0x481129(_0x1459ac);});};AGIVertices['prototype'][_0x0e7a('0x91')]=function(_0x37477d,_0x426da7,_0x1cb5e1){scripts[_0x0e7a('0x91')](_0x426da7,_0x37477d['appid'],_0x37477d[_0x0e7a('0x92')],_0x37477d[_0x0e7a('0x73')])[_0x0e7a('0x15')](function(_0x23b09c){_0x1cb5e1(null,_0x23b09c);})[_0x0e7a('0x16')](function(_0x260901){_0x1cb5e1(_0x260901);});};AGIVertices[_0x0e7a('0x1a')][_0x0e7a('0x93')]=function(_0x47b982){var _0x119fde=_[_0x0e7a('0x69')](verticesWithRetry,_0x47b982['agicommand'])?_0x47b982:_[_0x0e7a('0x94')](_0x47b982);for(var _0x386cf2 in _0x119fde){if(_0x119fde[_0x0e7a('0x95')](_0x386cf2)){if(_0x119fde[_0x386cf2]&&_[_0x0e7a('0x96')](_0x119fde[_0x386cf2])){if(_[_0x0e7a('0x69')](recursiveMapAttributes,_0x386cf2)){_0x119fde[_0x386cf2]=this[_0x0e7a('0x97')](_0x119fde[_0x386cf2]);}else{_0x119fde[_0x386cf2]=this['replaceAllVariables'](_0x119fde[_0x386cf2]);}}}}return _0x119fde;};AGIVertices[_0x0e7a('0x1a')][_0x0e7a('0x98')]=function(_0x564133){for(var _0x22857d in _0x564133){if(_0x564133[_0x0e7a('0x95')](_0x22857d)){if(_[_0x0e7a('0x99')](_0x564133[_0x22857d])){this[_0x0e7a('0x98')](_0x564133[_0x22857d]);}else if(_[_0x0e7a('0x9a')](_0x564133[_0x22857d])){for(var _0x342eef=0x0;_0x342eef<_0x564133[_0x22857d][_0x0e7a('0x9b')];_0x342eef++){this[_0x0e7a('0x98')](_0x564133[_0x22857d][_0x342eef]);}}else if(_[_0x0e7a('0x96')](_0x564133[_0x22857d])){_0x564133[_0x22857d]=this[_0x0e7a('0x9c')](_0x564133[_0x22857d]);}}}};AGIVertices[_0x0e7a('0x1a')][_0x0e7a('0x9d')]=function(_0x4aad5c,_0xe60251){for(var _0x261a7d in _0x4aad5c){if(_0x4aad5c[_0x0e7a('0x95')](_0x261a7d)){if(_[_0x0e7a('0x99')](_0x4aad5c[_0x261a7d])){if(!_['isEmpty'](_0x4aad5c[_0x261a7d])){this[_0x0e7a('0x9d')](_0x4aad5c[_0x261a7d],util[_0x0e7a('0x2d')](_0x0e7a('0x9e'),_0xe60251,_0x261a7d));}}else if(_[_0x0e7a('0x9a')](_0x4aad5c[_0x261a7d])){for(var _0x42d91f=0x0;_0x42d91f<_0x4aad5c[_0x261a7d][_0x0e7a('0x9b')];_0x42d91f++){this[_0x0e7a('0x9d')](_0x4aad5c[_0x261a7d][_0x42d91f],util[_0x0e7a('0x2d')](_0x0e7a('0x9e'),_0xe60251,_0x261a7d+'['+_0x42d91f+']'));}}else{if(!_[_0x0e7a('0x48')](_0x4aad5c[_0x261a7d])){this[_0x0e7a('0x3c')][_0x0e7a('0x9f')](util[_0x0e7a('0x2d')](_0x0e7a('0x9e'),_0xe60251,_0x261a7d),_0x4aad5c[_0x261a7d]);}}}}};AGIVertices['prototype'][_0x0e7a('0x97')]=function(_0x97eade){try{var _0x2da42e=JSON[_0x0e7a('0x6d')](_0x97eade);this[_0x0e7a('0x98')](_0x2da42e);return JSON['stringify'](_0x2da42e);}catch(_0x193c68){return this[_0x0e7a('0x9c')](_0x97eade);}};AGIVertices[_0x0e7a('0x1a')]['replaceAllVariables']=function(_0x33d402){var _0x3e2e44=_0x33d402[_0x0e7a('0xa0')]('{');for(var _0x1e2d86=0x1;_0x1e2d86<_0x3e2e44[_0x0e7a('0x9b')];_0x1e2d86+=0x1){var _0x1b0ccd=_0x3e2e44[_0x1e2d86][_0x0e7a('0xa0')]('}');if(_0x1b0ccd[_0x0e7a('0x9b')]>0x1){_0x33d402=_0x33d402[_0x0e7a('0xa1')]('{'+_0x1b0ccd[0x0]+'}',this[_0x0e7a('0x3c')]['getVariable'](_0x1b0ccd[0x0])[_0x0e7a('0xa2')]||_0x1b0ccd[0x0]);}}if(_0x3e2e44[_0x0e7a('0x9b')]===0x1){return _0x33d402['toString']();}return this['replaceAllVariables'](_0x33d402);};AGIVertices[_0x0e7a('0x1a')][_0x0e7a('0xa3')]=function(_0x46a302,_0x581964){var _0x5f3a69=this[_0x0e7a('0x3c')][_0x0e7a('0x13')](_0x46a302);if(_0x5f3a69[_0x0e7a('0xa4')]===-0x1){return _0x5f3a69;}logger[_0x0e7a('0x33')](util[_0x0e7a('0x2d')](_0x0e7a('0xa5'),_0x581964,_0x5f3a69['extra']));return this[_0x0e7a('0x3c')][_0x0e7a('0x9f')](_0x581964,_0x5f3a69[_0x0e7a('0xa2')]);};AGIVertices[_0x0e7a('0x1a')][_0x0e7a('0x87')]=function(_0x133b76){return _0x133b76&&_0x133b76!=='0'&&_0x133b76!=='-1'&&_0x133b76!=='';};AGIVertices[_0x0e7a('0x1a')][_0x0e7a('0xa6')]=function(_0x48b8b1){this[_0x0e7a('0x3b')]['sync'](this,_0x48b8b1,'-');_0x48b8b1[_0x0e7a('0xa7')]=_0x48b8b1['maxRetry'];return{'code':0xc8,'result':'-'};};AGIVertices[_0x0e7a('0x1a')]['mrcpsynth']=function(_0x5e5e39){logger[_0x0e7a('0x33')](util[_0x0e7a('0x2d')](_0x0e7a('0xa8'),_0x5e5e39['label']));if(!this[_0x0e7a('0x87')](_0x5e5e39[_0x0e7a('0x60')])){return this[_0x0e7a('0x3c')]['noop'](_0x0e7a('0xa9'));}var _0x21c4d0='\x22'+_0x5e5e39[_0x0e7a('0x60')]+'\x22';if(this[_0x0e7a('0x87')](_0x5e5e39[_0x0e7a('0x7b')])){_0x21c4d0+=','+_0x5e5e39['options'];}var _0x5f1b53=this[_0x0e7a('0x3c')][_0x0e7a('0xaa')](_0x0e7a('0xab'),_0x21c4d0);if(_0x5f1b53[_0x0e7a('0xa4')]===-0x1){return _0x5f1b53;}return this[_0x0e7a('0x3c')]['noop'](util[_0x0e7a('0x2d')]('Executed\x20command\x20MRCPSynth\x20%s',_0x21c4d0));};AGIVertices['prototype'][_0x0e7a('0xac')]=function(_0xc7367f){logger[_0x0e7a('0x33')](util[_0x0e7a('0x2d')](_0x0e7a('0xad'),_0xc7367f['label']));if(!this[_0x0e7a('0x87')](_0xc7367f[_0x0e7a('0xae')])){return this[_0x0e7a('0x3c')][_0x0e7a('0xaf')](_0x0e7a('0xb0'));}var _0x29371d=_0xc7367f[_0x0e7a('0xae')];if(this['isConfigured'](_0xc7367f[_0x0e7a('0x7b')])){_0x29371d+=','+_0xc7367f[_0x0e7a('0x7b')];}var _0x423c7e=this[_0x0e7a('0x3c')]['exec'](_0x0e7a('0xb1'),_0x29371d);if(_0x423c7e[_0x0e7a('0xa4')]===-0x1){return _0x423c7e;}var _0x39543b=this['getAndSetVariable'](_0x0e7a('0xb2'),_0x0e7a('0xb3'));if(_0x39543b[_0x0e7a('0xa4')]===-0x1){return _0x39543b;}var _0x5cb873=this[_0x0e7a('0xa3')](_0x0e7a('0xb4'),_0x0e7a('0xb5'));if(_0x5cb873['result']===-0x1){return _0x5cb873;}var _0x355507=this[_0x0e7a('0xa3')]('RECOG_INSTANCE()',_0x0e7a('0xb6'));if(_0x355507[_0x0e7a('0xa4')]===-0x1){return _0x355507;}return this[_0x0e7a('0x3c')][_0x0e7a('0xaf')](util[_0x0e7a('0x2d')](_0x0e7a('0xb7'),_0x29371d));};AGIVertices[_0x0e7a('0x1a')][_0x0e7a('0x9')]=function(_0x27aa09){logger[_0x0e7a('0x33')](util[_0x0e7a('0x2d')](_0x0e7a('0xb8'),_0x27aa09[_0x0e7a('0xb9')]));return this[_0x0e7a('0x3c')][_0x0e7a('0x9')]([_0x27aa09[_0x0e7a('0xba')],_0x27aa09['args']]);};AGIVertices[_0x0e7a('0x1a')][_0x0e7a('0xbb')]=function(_0x5e8048){logger[_0x0e7a('0x33')](util[_0x0e7a('0x2d')](_0x0e7a('0xbc'),_0x5e8048['label']));if(this['isConfigured'](_0x5e8048[_0x0e7a('0x68')])){logger[_0x0e7a('0x33')](util[_0x0e7a('0x2d')](_0x0e7a('0xbd'),_0x5e8048[_0x0e7a('0x68')]));var _0x3f1ecc=this[_0x0e7a('0x3c')][_0x0e7a('0xbe')](_0x5e8048[_0x0e7a('0x68')]);if(_0x3f1ecc[_0x0e7a('0xa4')]===-0x1){return _0x3f1ecc;}}return this[_0x0e7a('0x3c')]['answer']();};AGIVertices['prototype']['callback']=function(_0xa2c867){logger['info'](util['format']('Enter\x20in\x20CALLBACK\x20(%s)\x20block',_0xa2c867[_0x0e7a('0xb9')]));if(!this[_0x0e7a('0x87')](_0xa2c867[_0x0e7a('0x4c')])){return this[_0x0e7a('0x3c')]['error'](_0xa2c867,_0x0e7a('0xbf'));}_0xa2c867['scheduledAt']=moment();if(this['isConfigured'](_0xa2c867[_0x0e7a('0xc0')])){_0xa2c867[_0x0e7a('0x4d')]=moment()[_0x0e7a('0xc1')](_0xa2c867[_0x0e7a('0xc0')],_0x0e7a('0xc2'));}if(!this[_0x0e7a('0x87')](_0xa2c867[_0x0e7a('0x51')])){_0xa2c867['callback_priority']=0x2;}this[_0x0e7a('0x47')][_0x0e7a('0x72')](this,_0xa2c867);return this[_0x0e7a('0x3c')][_0x0e7a('0xaf')](util[_0x0e7a('0x2d')]('CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s',_0xa2c867[_0x0e7a('0x4b')],_0xa2c867[_0x0e7a('0x4c')],_0xa2c867[_0x0e7a('0x4d')]));};AGIVertices[_0x0e7a('0x1a')][_0x0e7a('0xc3')]=function(_0x2500f9){logger[_0x0e7a('0x33')](util['format']('Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block',_0x2500f9[_0x0e7a('0xb9')]));var _0x48b76a=this[_0x0e7a('0x3c')][_0x0e7a('0xaa')](_0x2500f9[_0x0e7a('0xc4')],_0x2500f9[_0x0e7a('0x7b')]);if(_0x48b76a[_0x0e7a('0xa4')]===-0x1){return _0x48b76a;}return this['channel'][_0x0e7a('0xaf')](util[_0x0e7a('0x2d')]('Executed\x20command\x20%s\x20%s',_0x2500f9[_0x0e7a('0xc4')],_0x2500f9[_0x0e7a('0x7b')]));};AGIVertices[_0x0e7a('0x1a')][_0x0e7a('0xc5')]=function(_0x144860){logger[_0x0e7a('0x33')](util[_0x0e7a('0x2d')]('Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block',_0x144860['label']));if(!this[_0x0e7a('0x87')](_0x144860[_0x0e7a('0x60')])){return this[_0x0e7a('0x3c')][_0x0e7a('0xaf')](_0x0e7a('0xa9'));}var _0x5cbb7d='\x22'+_0x144860['text']+'\x22';if(this['isConfigured'](_0x144860['options'])){_0x5cbb7d+=','+_0x144860[_0x0e7a('0x7b')];}var _0x173bd7=this[_0x0e7a('0x3c')][_0x0e7a('0xaa')](_0x0e7a('0xab'),_0x5cbb7d);if(_0x173bd7[_0x0e7a('0xa4')]===-0x1){return _0x173bd7;}return this['channel'][_0x0e7a('0xaf')](util[_0x0e7a('0x2d')](_0x0e7a('0xc6'),_0x5cbb7d));};AGIVertices[_0x0e7a('0x1a')]['sestektts']=function(_0x317099){logger[_0x0e7a('0x33')](util[_0x0e7a('0x2d')](_0x0e7a('0xc7'),_0x317099[_0x0e7a('0xb9')]));if(!this[_0x0e7a('0x87')](_0x317099[_0x0e7a('0x60')])){return this[_0x0e7a('0x3c')]['noop'](_0x0e7a('0xa9'));}var _0xed9cbe='\x22'+_0x317099['text']+'\x22';if(this['isConfigured'](_0x317099[_0x0e7a('0x7b')])){_0xed9cbe+=','+_0x317099[_0x0e7a('0x7b')];}var _0x4d19d2=this[_0x0e7a('0x3c')][_0x0e7a('0xaa')](_0x0e7a('0xab'),_0xed9cbe);if(_0x4d19d2[_0x0e7a('0xa4')]===-0x1){return _0x4d19d2;}return this[_0x0e7a('0x3c')][_0x0e7a('0xaf')](util['format'](_0x0e7a('0xc6'),_0xed9cbe));};AGIVertices[_0x0e7a('0x1a')][_0x0e7a('0xc8')]=function(_0x406017){logger[_0x0e7a('0x33')](util['format']('Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block',_0x406017['label']));if(!this['isConfigured'](_0x406017['grammar'])){return this[_0x0e7a('0x3c')][_0x0e7a('0xaf')](_0x0e7a('0xb0'));}var _0x3ed28a=_0x406017[_0x0e7a('0xae')];if(this[_0x0e7a('0x87')](_0x406017[_0x0e7a('0x7b')])){_0x3ed28a+=','+_0x406017[_0x0e7a('0x7b')];}var _0x3ca786=this['channel'][_0x0e7a('0xaa')](_0x0e7a('0xb1'),_0x3ed28a);if(_0x3ca786['result']===-0x1){return _0x3ca786;}var _0x2076fe=this['getAndSetVariable'](_0x0e7a('0xb2'),_0x0e7a('0xc9'));if(_0x2076fe[_0x0e7a('0xa4')]===-0x1){return _0x2076fe;}var _0x52ef31=this['getAndSetVariable'](_0x0e7a('0xb4'),_0x0e7a('0xca'));if(_0x52ef31['result']===-0x1){return _0x52ef31;}var _0xf590fe=this[_0x0e7a('0xa3')](_0x0e7a('0xcb'),_0x0e7a('0xcc'));if(_0xf590fe[_0x0e7a('0xa4')]===-0x1){return _0xf590fe;}return this[_0x0e7a('0x3c')]['noop'](util[_0x0e7a('0x2d')]('Executed\x20command\x20MRCPRecog\x20%s',_0x3ed28a));};AGIVertices[_0x0e7a('0x1a')][_0x0e7a('0xcd')]=function(_0x5d482e){logger[_0x0e7a('0x33')](util['format'](_0x0e7a('0xce'),_0x5d482e['label']));if(!this[_0x0e7a('0x87')](_0x5d482e[_0x0e7a('0xae')])){return this[_0x0e7a('0x3c')][_0x0e7a('0xaf')]('no\x20grammar\x20configured');}var _0x5bccd3=_0x5d482e['grammar'];if(this[_0x0e7a('0x87')](_0x5d482e[_0x0e7a('0x7b')])){_0x5bccd3+=','+_0x5d482e[_0x0e7a('0x7b')];}var _0x55116a=this['channel'][_0x0e7a('0xaa')]('MRCPRecog',_0x5bccd3);if(_0x55116a['result']===-0x1){return _0x55116a;}var _0x344d59=this['getAndSetVariable'](_0x0e7a('0xb2'),'SESTEK_ASR_CONFIDENCE');if(_0x344d59[_0x0e7a('0xa4')]===-0x1){return _0x344d59;}var _0x256d3e=this[_0x0e7a('0xa3')](_0x0e7a('0xb4'),_0x0e7a('0xcf'));if(_0x256d3e[_0x0e7a('0xa4')]===-0x1){return _0x256d3e;}var _0x2ccf0a=this[_0x0e7a('0xa3')]('RECOG_INSTANCE()',_0x0e7a('0xd0'));if(_0x2ccf0a[_0x0e7a('0xa4')]===-0x1){return _0x2ccf0a;}return this[_0x0e7a('0x3c')]['noop'](util['format'](_0x0e7a('0xb7'),_0x5bccd3));};AGIVertices[_0x0e7a('0x1a')][_0x0e7a('0xd1')]=function(_0x2e6e6c){logger[_0x0e7a('0x33')](util[_0x0e7a('0x2d')](_0x0e7a('0xd2'),_0x2e6e6c['label']));if(!this[_0x0e7a('0x87')](_0x2e6e6c['odbc_id'])){return this[_0x0e7a('0x3c')]['error'](_0x2e6e6c,_0x0e7a('0xd3'));}var _0x2cc2b5=this[_0x0e7a('0x1c')][_0x0e7a('0x72')](this,_0x2e6e6c[_0x0e7a('0xd4')]);if(!_0x2cc2b5){return this['channel'][_0x0e7a('0x31')](_0x2e6e6c,_0x0e7a('0xd5'));}if(!this['isConfigured'](_0x2e6e6c[_0x0e7a('0xd6')])){return this['channel'][_0x0e7a('0x31')](_0x2e6e6c,'no\x20query\x20configured');}var _0x1d0c5f=_0x2e6e6c[_0x0e7a('0xd6')][_0x0e7a('0x5c')](/(\r\n|\n|\r)/gm,'\x20');this[_0x0e7a('0x3c')][_0x0e7a('0xaf')](util[_0x0e7a('0x2d')](_0x0e7a('0xd7'),_0x1d0c5f));var _0x2ccc88=this[_0x0e7a('0x2f')][_0x0e7a('0x72')](this,_0x2cc2b5,_0x1d0c5f);this[_0x0e7a('0x3b')][_0x0e7a('0x72')](this,_0x2e6e6c,_0x1d0c5f);if(!this['isConfigured'](_0x2e6e6c[_0x0e7a('0xd8')])){return this[_0x0e7a('0x3c')]['noop']('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x432bbe=this[_0x0e7a('0x13')][_0x0e7a('0x72')](this,_0x2e6e6c['variable_id']);if(!_0x432bbe){return this[_0x0e7a('0x3c')]['error'](_0x2e6e6c,_0x0e7a('0xd9'));}var _0x3b901d=this;_0x2ccc88[_0x0e7a('0xda')](function(_0x4ebde7,_0x569916){Object[_0x0e7a('0xdb')](_0x4ebde7)[_0x0e7a('0xda')](function(_0x376e0e){_0x3b901d[_0x0e7a('0x3c')][_0x0e7a('0x9f')](util['format'](_0x0e7a('0xdc'),_0x432bbe,_0x569916,_0x376e0e),_0x4ebde7[_0x376e0e]);});});this['channel'][_0x0e7a('0x9f')](util[_0x0e7a('0x2d')](_0x0e7a('0xdd'),_0x432bbe),_0x2ccc88[_0x0e7a('0x9b')]);return this[_0x0e7a('0x3c')][_0x0e7a('0xaf')](util[_0x0e7a('0x2d')]('variable\x20%s\x20set',_0x432bbe));};AGIVertices[_0x0e7a('0x1a')][_0x0e7a('0xde')]=function(_0x1d21d2){logger[_0x0e7a('0xdf')](util['format'](_0x0e7a('0xe0'),_0x1d21d2[_0x0e7a('0xb9')]));if(!this['isConfigured'](_0x1d21d2[_0x0e7a('0xe1')])){return this[_0x0e7a('0x3c')][_0x0e7a('0x31')](_0x1d21d2,_0x0e7a('0xe2'));}var _0x1a3709=this[_0x0e7a('0x1e')][_0x0e7a('0x72')](this,_0x1d21d2['sip_id']);if(!_0x1a3709){return this[_0x0e7a('0x3c')][_0x0e7a('0x31')](_0x1d21d2,_0x0e7a('0xe3'));}var _0x1dbaa1=this[_0x0e7a('0x3c')][_0x0e7a('0xaa')](_0x0e7a('0xe4'),[util[_0x0e7a('0x2d')](_0x0e7a('0xe5'),_0x1a3709),_0x1d21d2[_0x0e7a('0x68')],_0x1d21d2[_0x0e7a('0xe6')],_0x1d21d2[_0x0e7a('0x75')]]);if(_0x1dbaa1['result']===-0x1){return _0x1dbaa1;}return this[_0x0e7a('0x3c')]['noop'](util[_0x0e7a('0x2d')]('Executed\x20command\x20%s',_0x0e7a('0xe4')));};AGIVertices[_0x0e7a('0x1a')]['dialogflow']=function(_0x39556d){logger[_0x0e7a('0x33')](util[_0x0e7a('0x2d')](_0x0e7a('0xe7'),_0x39556d[_0x0e7a('0xb9')]));if(!this[_0x0e7a('0x87')](_0x39556d['key'])){return this[_0x0e7a('0x3c')][_0x0e7a('0xaf')](_0x0e7a('0xe8'));}if(!this[_0x0e7a('0x87')](_0x39556d[_0x0e7a('0x60')])){return this[_0x0e7a('0x3c')]['noop'](_0x0e7a('0xa9'));}this[_0x0e7a('0x3c')][_0x0e7a('0xe9')]=!![];this[_0x0e7a('0x3b')](_0x39556d);this[_0x0e7a('0x46')](_0x39556d['text'],'in','','');this[_0x0e7a('0x3c')][_0x0e7a('0xaf')](util[_0x0e7a('0x2d')](_0x0e7a('0xea'),_0x39556d['text']));var _0x594c32=this['googleDialogflow'][_0x0e7a('0x72')](this,_0x39556d);if(_0x594c32){for(var _0x444499 in _0x594c32){if(_0x594c32['hasOwnProperty'](_0x444499)){this[_0x0e7a('0x3c')][_0x0e7a('0x9f')](util[_0x0e7a('0x2d')](_0x0e7a('0xeb'),_0x444499[_0x0e7a('0x6b')]()),_0x594c32[_0x444499]);}}this[_0x0e7a('0x46')](_0x594c32[_0x0e7a('0xec')],_0x0e7a('0xed'),_0x0e7a('0xee'),'');return this[_0x0e7a('0x3c')][_0x0e7a('0xaf')](util[_0x0e7a('0x2d')](_0x0e7a('0xef'),_0x594c32[_0x0e7a('0xec')]));}return this[_0x0e7a('0x3c')][_0x0e7a('0x31')](_0x39556d,_0x0e7a('0xf0'));};AGIVertices[_0x0e7a('0x1a')][_0x0e7a('0xf1')]=function(_0x13d824){logger[_0x0e7a('0x33')](util[_0x0e7a('0x2d')]('Enter\x20in\x20DIALOGFLOW\x20V2\x20(%s)\x20block',_0x13d824[_0x0e7a('0xb9')]));if(!this['isConfigured'](_0x13d824[_0x0e7a('0xf2')])){return this[_0x0e7a('0x3c')][_0x0e7a('0xaf')](_0x0e7a('0xf3'));}if(!this['isConfigured'](_0x13d824[_0x0e7a('0x80')])){return this[_0x0e7a('0x3c')][_0x0e7a('0xaf')](_0x0e7a('0xf4'));}if(!this[_0x0e7a('0x87')](_0x13d824[_0x0e7a('0x81')])){return this[_0x0e7a('0x3c')][_0x0e7a('0xaf')](_0x0e7a('0xf5'));}if(!this['isConfigured'](_0x13d824[_0x0e7a('0xf6')])){return this[_0x0e7a('0x3c')][_0x0e7a('0xaf')](_0x0e7a('0xf7'));}if(!this[_0x0e7a('0x87')](_0x13d824[_0x0e7a('0x60')])){return this[_0x0e7a('0x3c')][_0x0e7a('0xaf')](_0x0e7a('0xa9'));}this[_0x0e7a('0x3c')][_0x0e7a('0xe9')]=!![];this[_0x0e7a('0x3b')](_0x13d824);this[_0x0e7a('0x46')](_0x13d824['text'],'in','','');this[_0x0e7a('0x3c')]['noop'](util['format'](_0x0e7a('0xf8'),_0x13d824[_0x0e7a('0x60')]));var _0x46dc49=this['googleDialogflowV2'][_0x0e7a('0x72')](this,_0x13d824);if(_0x46dc49){for(var _0x3cb51c in _0x46dc49){if(_0x46dc49['hasOwnProperty'](_0x3cb51c)){if(_0x3cb51c!==_0x0e7a('0xf9')){this[_0x0e7a('0x3c')][_0x0e7a('0x9f')](util[_0x0e7a('0x2d')](_0x0e7a('0xeb'),_0x3cb51c[_0x0e7a('0x6b')]()),_0x46dc49[_0x3cb51c]);}}}this[_0x0e7a('0x46')](_0x46dc49['speech'],_0x0e7a('0xed'),_0x0e7a('0xf1'),_0x46dc49[_0x0e7a('0xf9')]);return this['channel'][_0x0e7a('0xaf')](util[_0x0e7a('0x2d')](_0x0e7a('0xfa'),_0x46dc49[_0x0e7a('0xec')]));}return this[_0x0e7a('0x3c')][_0x0e7a('0x31')](_0x13d824,_0x0e7a('0xfb'));};AGIVertices[_0x0e7a('0x1a')][_0x0e7a('0xfc')]=function(_0x272c38){logger[_0x0e7a('0x33')](util[_0x0e7a('0x2d')](_0x0e7a('0xfd'),_0x272c38[_0x0e7a('0xb9')]));if(!this[_0x0e7a('0x87')](_0x272c38[_0x0e7a('0xfe')])){return this['channel'][_0x0e7a('0xaf')](_0x0e7a('0xff'));}if(!this[_0x0e7a('0x87')](_0x272c38[_0x0e7a('0x100')])){return this[_0x0e7a('0x3c')][_0x0e7a('0xaf')]('no\x20username\x20configured');}if(!this[_0x0e7a('0x87')](_0x272c38[_0x0e7a('0x101')])){return this[_0x0e7a('0x3c')][_0x0e7a('0xaf')]('no\x20password\x20configured');}if(!this[_0x0e7a('0x87')](_0x272c38[_0x0e7a('0x102')])){return this['channel'][_0x0e7a('0xaf')]('no\x20text\x20configured');}this[_0x0e7a('0x3c')][_0x0e7a('0xe9')]=!![];this[_0x0e7a('0x3b')](_0x272c38);this['createSquareMessage'](_0x272c38[_0x0e7a('0x60')],'in','','');this[_0x0e7a('0x3c')]['noop'](util['format'](_0x0e7a('0x103'),_0x272c38[_0x0e7a('0x60')]));var _0x5128ff=this[_0x0e7a('0x82')]['sync'](this,_0x272c38);if(_0x5128ff){for(var _0x1ee0de in _0x5128ff){if(_0x5128ff['hasOwnProperty'](_0x1ee0de)){this[_0x0e7a('0x3c')][_0x0e7a('0x9f')](util['format'](_0x0e7a('0x104'),_0x1ee0de[_0x0e7a('0x6b')]()),_0x5128ff[_0x1ee0de]);}}this[_0x0e7a('0x46')](_0x5128ff[_0x0e7a('0xec')],_0x0e7a('0xed'),_0x0e7a('0xfc'),'');if(_0x5128ff['audiofile']){this[_0x0e7a('0x3c')][_0x0e7a('0xaf')](util[_0x0e7a('0x2d')]('Sestek\x20NDA\x20%s\x20file\x20created',_0x5128ff[_0x0e7a('0x105')]));var _0x40fdc4=this[_0x0e7a('0x3c')]['streamFile'](_0x5128ff[_0x0e7a('0x105')]);try{fs[_0x0e7a('0x106')](_0x5128ff[_0x0e7a('0x105')]+_0x0e7a('0x107'));}catch(_0x2491e1){logger[_0x0e7a('0x31')](_0x2491e1);}return _0x40fdc4;}else{return this[_0x0e7a('0x3c')]['noop'](util['format']('SestekNDA\x20Result\x20%s',_0x5128ff[_0x0e7a('0xec')]));}}return this[_0x0e7a('0x3c')][_0x0e7a('0x31')](_0x272c38,_0x0e7a('0x108'));};AGIVertices[_0x0e7a('0x1a')][_0x0e7a('0x109')]=function(_0x18e6c3){logger[_0x0e7a('0x33')](util[_0x0e7a('0x2d')]('Enter\x20in\x20END\x20(%s)\x20block',_0x18e6c3[_0x0e7a('0xb9')]));return this[_0x0e7a('0x3c')]['noop']('end');};AGIVertices['prototype'][_0x0e7a('0x10a')]=function(_0x1936c8){logger[_0x0e7a('0x33')](util[_0x0e7a('0x2d')](_0x0e7a('0x10b'),_0x1936c8[_0x0e7a('0xb9')]));var _0x21b77a='';if(_0x1936c8[_0x0e7a('0x10c')]){if(!this[_0x0e7a('0x87')](_0x1936c8[_0x0e7a('0x10c')])){return this[_0x0e7a('0x3c')][_0x0e7a('0x31')](_0x1936c8,_0x0e7a('0x10d'));}else{var _0x23d640=parseInt(_0x1936c8['trunk_id'],0xa);if(isNaN(_0x23d640)){_0x21b77a=_0x1936c8[_0x0e7a('0x10c')];}else{_0x21b77a=this[_0x0e7a('0x20')]['sync'](this,_0x1936c8['trunk_id']);if(!_0x21b77a){return this['channel'][_0x0e7a('0x31')](_0x1936c8,'no\x20trunk\x20found');}}}}else if(_0x1936c8[_0x0e7a('0x10e')]){_0x21b77a=_0x1936c8[_0x0e7a('0x10e')];}else{return this[_0x0e7a('0x3c')][_0x0e7a('0x31')](_0x1936c8,_0x0e7a('0x10d'));}var _0x30b911=this[_0x0e7a('0x3c')]['exec']('DIAL',[util[_0x0e7a('0x2d')](_0x0e7a('0x10f'),_0x21b77a,_0x1936c8[_0x0e7a('0x4b')]),_0x1936c8[_0x0e7a('0x68')],_0x1936c8['opts'],_0x1936c8['url']]);if(_0x30b911['result']===-0x1){return _0x30b911;}return this[_0x0e7a('0x3c')][_0x0e7a('0xaf')](util[_0x0e7a('0x2d')](_0x0e7a('0x110'),'DIAL'));};AGIVertices[_0x0e7a('0x1a')][_0x0e7a('0x111')]=function(_0x5ac054){logger[_0x0e7a('0x33')](util[_0x0e7a('0x2d')](_0x0e7a('0x112'),_0x5ac054[_0x0e7a('0xb9')]));return this['channel'][_0x0e7a('0xaf')](_0x0e7a('0x111'));};AGIVertices[_0x0e7a('0x1a')][_0x0e7a('0xf')]=function(_0x513325){logger[_0x0e7a('0x33')](util[_0x0e7a('0x2d')](_0x0e7a('0x113'),_0x513325[_0x0e7a('0xb9')]));if(_0x513325[_0x0e7a('0xa7')]===0x0){return this[_0x0e7a('0xa6')](_0x513325);}_0x513325[_0x0e7a('0xa7')]-=0x1;if(!this['isConfigured'](_0x513325[_0x0e7a('0x114')])){return this['channel'][_0x0e7a('0x31')](_0x513325,_0x0e7a('0x115'));}var _0x1f852e=this[_0x0e7a('0x22')][_0x0e7a('0x72')](this,_0x513325['file_id']);if(!_0x1f852e){return this['channel'][_0x0e7a('0x31')](_0x513325,'no\x20file\x20audio\x20found');}if(!this[_0x0e7a('0x87')](_0x513325[_0x0e7a('0xd8')])){return this[_0x0e7a('0x3c')]['error'](_0x0e7a('0x116'));}var _0x23061a=this[_0x0e7a('0x3c')][_0x0e7a('0x117')](_0x1f852e,_0x513325[_0x0e7a('0x118')],_0x513325[_0x0e7a('0x119')]);var _0x38d89c=_0x23061a[_0x0e7a('0xa4')]?_0x23061a[_0x0e7a('0xa4')][_0x0e7a('0x50')]():'';logger[_0x0e7a('0x33')](_0x0e7a('0x11a'),JSON[_0x0e7a('0x76')](_0x23061a));if(_0x23061a[_0x0e7a('0xa4')]===-0x1){this[_0x0e7a('0x3b')]['sync'](this,_0x513325,_0x38d89c);return _0x23061a;}else if(_0x23061a[_0x0e7a('0xa2')]===_0x0e7a('0x68')){_0x23061a['result']=_0x38d89c[_0x0e7a('0x9b')]>=parseInt(_0x513325[_0x0e7a('0x11b')])?'x':'i';}else{_0x23061a[_0x0e7a('0xa4')]=_0x38d89c[_0x0e7a('0x9b')]>=parseInt(_0x513325['mindigit'])&&_0x38d89c[_0x0e7a('0x9b')]<=parseInt(_0x513325[_0x0e7a('0x119')])?'x':'i';}var _0x3c552d=this[_0x0e7a('0x13')][_0x0e7a('0x72')](this,_0x513325[_0x0e7a('0xd8')]);if(!_0x3c552d){return this[_0x0e7a('0x3c')][_0x0e7a('0x31')](_0x513325,_0x0e7a('0xd9'));}this['channel']['setVariable'](_0x3c552d,_0x38d89c);if(this[_0x0e7a('0x87')](_0x513325[_0x0e7a('0x11c')])){var _0x42ee3c=parseInt(_0x513325[_0x0e7a('0x11c')],0xa);var _0x429d78=rs['generate']({'charset':'*','length':_0x42ee3c});var _0x58930f=_0x38d89c[_0x0e7a('0x9b')];if(_0x58930f>0x0){if(_0x58930f>_0x42ee3c){this[_0x0e7a('0x3b')][_0x0e7a('0x72')](this,_0x513325,_0x513325[_0x0e7a('0x11d')]==='first'?_0x429d78+_0x38d89c[_0x0e7a('0x11e')](_0x42ee3c):_0x38d89c[_0x0e7a('0x11e')](0x0,_0x58930f-_0x42ee3c)+_0x429d78);}else{this[_0x0e7a('0x3b')]['sync'](this,_0x513325,rs[_0x0e7a('0x11f')]({'charset':'*','length':_0x58930f}));}}else{this[_0x0e7a('0x3b')][_0x0e7a('0x72')](this,_0x513325,'');}}else{this[_0x0e7a('0x3b')][_0x0e7a('0x72')](this,_0x513325,_0x38d89c);}return _0x23061a;};AGIVertices[_0x0e7a('0x1a')]['getsecretdigits']=function(_0x1bb83e){logger[_0x0e7a('0x33')](util[_0x0e7a('0x2d')](_0x0e7a('0x120'),_0x1bb83e[_0x0e7a('0xb9')]));return this[_0x0e7a('0xf')](_0x1bb83e);};AGIVertices[_0x0e7a('0x1a')][_0x0e7a('0x121')]=function(_0x268c31){logger['info'](util[_0x0e7a('0x2d')](_0x0e7a('0x122'),_0x268c31[_0x0e7a('0xb9')]));this[_0x0e7a('0x3b')][_0x0e7a('0x72')](this,_0x268c31,_0x268c31[_0x0e7a('0x123')]);return this[_0x0e7a('0x3c')][_0x0e7a('0xaf')](util[_0x0e7a('0x2d')](_0x0e7a('0x124'),_0x268c31['goalname']));};AGIVertices['prototype'][_0x0e7a('0x125')]=function(_0x11c05a){logger[_0x0e7a('0x33')](util[_0x0e7a('0x2d')]('[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block',_0x11c05a[_0x0e7a('0xb9')]));if(!this['isConfigured'](_0x11c05a[_0x0e7a('0x126')])||!this[_0x0e7a('0x87')](_0x11c05a[_0x0e7a('0x8a')])){return this[_0x0e7a('0x3c')][_0x0e7a('0xaf')](_0x0e7a('0x127'));}if(!this[_0x0e7a('0x87')](_0x11c05a[_0x0e7a('0x60')])){return this[_0x0e7a('0x3c')][_0x0e7a('0xaf')](_0x0e7a('0xa9'));}this[_0x0e7a('0x3c')]['noop'](util['format']('Trying\x20aws\x20Polly\x20%s',_0x11c05a['text']));var _0x54cd65=this[_0x0e7a('0x89')][_0x0e7a('0x72')](this,_0x11c05a);if(_0x54cd65){this['channel'][_0x0e7a('0xaf')](util[_0x0e7a('0x2d')]('aws\x20Polly\x20%s\x20file\x20created',_0x54cd65));var _0x2a211f=this[_0x0e7a('0x3c')][_0x0e7a('0x128')](_0x54cd65);try{fs['unlink'](_0x54cd65+_0x0e7a('0x107'));}catch(_0x542f95){logger[_0x0e7a('0x31')](_0x542f95);}return _0x2a211f;}return this[_0x0e7a('0x3c')][_0x0e7a('0x31')](_0x11c05a,_0x0e7a('0x129'));};AGIVertices[_0x0e7a('0x1a')][_0x0e7a('0x12a')]=function(_0x277ceb){logger[_0x0e7a('0x33')](util[_0x0e7a('0x2d')]('Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block',_0x277ceb[_0x0e7a('0xb9')]));if(!this[_0x0e7a('0x87')](_0x277ceb[_0x0e7a('0x126')])||!this[_0x0e7a('0x87')](_0x277ceb[_0x0e7a('0x8a')])){return this[_0x0e7a('0x3c')][_0x0e7a('0xaf')](_0x0e7a('0x127'));}if(!this[_0x0e7a('0x87')](_0x277ceb[_0x0e7a('0x8e')])){return this[_0x0e7a('0x3c')][_0x0e7a('0xaf')]('no\x20bot\x20name\x20configured');}if(!this[_0x0e7a('0x87')](_0x277ceb[_0x0e7a('0x60')])){return this[_0x0e7a('0x3c')][_0x0e7a('0xaf')](_0x0e7a('0xa9'));}this[_0x0e7a('0x3c')][_0x0e7a('0xe9')]=!![];this[_0x0e7a('0x3b')](_0x277ceb);this[_0x0e7a('0x46')](_0x277ceb[_0x0e7a('0x60')],'in','','');this[_0x0e7a('0x3c')][_0x0e7a('0xaf')](util[_0x0e7a('0x2d')](_0x0e7a('0x12b'),_0x277ceb[_0x0e7a('0x60')]));var _0x4c9fdf=this['awsLex'][_0x0e7a('0x72')](this,_0x277ceb);if(_0x4c9fdf){for(var _0x43175b in _0x4c9fdf){if(_0x4c9fdf[_0x0e7a('0x95')](_0x43175b)&&_['isString'](_0x4c9fdf[_0x43175b])){this[_0x0e7a('0x3c')][_0x0e7a('0x9f')](util[_0x0e7a('0x2d')](_0x0e7a('0x12c'),_0x43175b['toUpperCase']()),_0x4c9fdf[_0x43175b]);}}if(_[_0x0e7a('0x48')](_0x4c9fdf[_0x0e7a('0x12d')])){return this[_0x0e7a('0x3c')]['noop']('Amazon\x20Lex\x20ready\x20for\x20fulfillment');}else{this[_0x0e7a('0x46')](_0x4c9fdf[_0x0e7a('0x12d')],_0x0e7a('0xed'),_0x0e7a('0x12e'),'');return this[_0x0e7a('0x3c')][_0x0e7a('0xaf')](util[_0x0e7a('0x2d')](_0x0e7a('0x12f'),_0x4c9fdf[_0x0e7a('0x12d')]));}}return this[_0x0e7a('0x3c')][_0x0e7a('0x31')](_0x277ceb,'Amazon\x20Lex\x20is\x20unreachable');};AGIVertices[_0x0e7a('0x1a')][_0x0e7a('0x130')]=function(_0x162c4e){logger[_0x0e7a('0x33')](util[_0x0e7a('0x2d')](_0x0e7a('0x131'),_0x162c4e[_0x0e7a('0xb9')],_0x162c4e[_0x0e7a('0x68')]));if(!this[_0x0e7a('0x87')](_0x162c4e[_0x0e7a('0x7d')])){return this[_0x0e7a('0x3c')][_0x0e7a('0xaf')]('no\x20key\x20configured');}var _0x2a3915=_0x0e7a('0x132');var _0x28fbee=util[_0x0e7a('0x2d')](_0x0e7a('0x133'),FILES_PATH,rs[_0x0e7a('0x11f')](0x4));var _0x547c32=util[_0x0e7a('0x2d')](_0x0e7a('0x9e'),_0x28fbee,_0x2a3915);var _0x3cf81a=!![];if(_0x162c4e[_0x0e7a('0x134')]==='NOBEEP'){_0x3cf81a=![];}var _0x2da644=this[_0x0e7a('0x3c')][_0x0e7a('0x135')](_0x28fbee,_0x2a3915,_0x162c4e[_0x0e7a('0x136')],_0x162c4e[_0x0e7a('0x68')],undefined,_0x3cf81a);if(_0x2da644[_0x0e7a('0xa4')]!==-0x1){this[_0x0e7a('0x3c')][_0x0e7a('0xaf')](util[_0x0e7a('0x2d')](_0x0e7a('0x137'),_0x547c32));var _0x4db7d0=this[_0x0e7a('0x8f')][_0x0e7a('0x72')](this,_0x162c4e,_0x547c32);if(_0x4db7d0){for(var _0x1e5afb in _0x4db7d0){if(_0x4db7d0[_0x0e7a('0x95')](_0x1e5afb)){this[_0x0e7a('0x3c')][_0x0e7a('0x9f')](util['format'](_0x0e7a('0x138'),_0x1e5afb[_0x0e7a('0x6b')]()),_0x4db7d0[_0x1e5afb]);}}return this[_0x0e7a('0x3c')][_0x0e7a('0xaf')](util[_0x0e7a('0x2d')](_0x0e7a('0x139'),JSON[_0x0e7a('0x76')](_0x4db7d0)));}}return _0x2da644;};AGIVertices['prototype']['tildeasr']=function(_0x40f42f){logger[_0x0e7a('0x33')](util[_0x0e7a('0x2d')](_0x0e7a('0x13a'),_0x40f42f[_0x0e7a('0xb9')]));if(!this[_0x0e7a('0x87')](_0x40f42f[_0x0e7a('0x13b')])){return this['channel'][_0x0e7a('0xaf')](_0x0e7a('0x13c'));}if(!this[_0x0e7a('0x87')](_0x40f42f[_0x0e7a('0x92')])){return this[_0x0e7a('0x3c')][_0x0e7a('0xaf')]('no\x20appsecret\x20configured');}var _0x450d17=_0x0e7a('0x132');var _0x172fa4=util[_0x0e7a('0x2d')](_0x0e7a('0x133'),FILES_PATH,rs[_0x0e7a('0x11f')](0x4));var _0x1b8c75=util[_0x0e7a('0x2d')](_0x0e7a('0x9e'),_0x172fa4,_0x450d17);var _0x58caa1=!![];if(_0x40f42f[_0x0e7a('0x134')]==='NOBEEP'){_0x58caa1=![];}var _0x328f20=this[_0x0e7a('0x3c')][_0x0e7a('0x135')](_0x172fa4,_0x450d17,_0x40f42f[_0x0e7a('0x136')],_0x40f42f['timeout'],undefined,_0x58caa1);if(_0x328f20['result']!==-0x1){this['channel']['noop'](util[_0x0e7a('0x2d')](_0x0e7a('0x13d'),_0x1b8c75));var _0x39b968=this[_0x0e7a('0x91')]['sync'](this,_0x40f42f,_0x1b8c75);if(_0x39b968){for(var _0x58b777 in _0x39b968){if(_0x39b968['hasOwnProperty'](_0x58b777)){this['channel'][_0x0e7a('0x9f')](util[_0x0e7a('0x2d')]('TILDE_ASR_%s',_0x58b777[_0x0e7a('0x6b')]()),_0x39b968[_0x58b777]);}}return this['channel'][_0x0e7a('0xaf')](util[_0x0e7a('0x2d')](_0x0e7a('0x13e'),JSON[_0x0e7a('0x76')](_0x39b968)));}}return _0x328f20;};AGIVertices[_0x0e7a('0x1a')][_0x0e7a('0x13f')]=function(_0x1ae694){logger[_0x0e7a('0x33')](util[_0x0e7a('0x2d')]('Enter\x20in\x20GOTO\x20(%s)\x20block',_0x1ae694['label']));return this[_0x0e7a('0x3c')][_0x0e7a('0x140')](_0x1ae694[_0x0e7a('0x42')],_0x1ae694[_0x0e7a('0x141')],_0x1ae694[_0x0e7a('0x142')]);};AGIVertices[_0x0e7a('0x1a')]['gotoif']=function(_0x372e3e){logger[_0x0e7a('0x33')](util[_0x0e7a('0x2d')]('Enter\x20in\x20GOTOIF\x20(%s)\x20block',_0x372e3e[_0x0e7a('0xb9')]));if(!this[_0x0e7a('0x87')](_0x372e3e[_0x0e7a('0x143')])){return this[_0x0e7a('0x3c')][_0x0e7a('0x31')](_0x372e3e,_0x0e7a('0x144'));}try{var _0x4c7ab2=eval(_0x372e3e[_0x0e7a('0x143')])?_0x0e7a('0x145'):_0x0e7a('0x146');this['channel'][_0x0e7a('0xaf')](util[_0x0e7a('0x2d')](_0x0e7a('0x147'),_0x372e3e[_0x0e7a('0x143')],_0x4c7ab2));return{'code':0xc8,'result':_0x4c7ab2};}catch(_0x57035f){return{'code':0xc8,'result':_0x0e7a('0x146')};}};AGIVertices[_0x0e7a('0x1a')][_0x0e7a('0x148')]=function(_0x451e8c){logger[_0x0e7a('0x33')](util[_0x0e7a('0x2d')](_0x0e7a('0x149'),_0x451e8c['label']));if(!this[_0x0e7a('0x87')](_0x451e8c[_0x0e7a('0x14a')])){return this[_0x0e7a('0x3c')]['error'](_0x451e8c,'no\x20interval\x20configured');}var _0x452cbb=this[_0x0e7a('0x28')][_0x0e7a('0x72')](this,_0x451e8c[_0x0e7a('0x14a')]);if(!_0x452cbb){return this[_0x0e7a('0x3c')]['error'](_0x451e8c,_0x0e7a('0x14b'));}for(var _0x5116d9=0x0;_0x5116d9<_0x452cbb[_0x0e7a('0x9b')];_0x5116d9+=0x1){var _0x5d955e=this[_0x0e7a('0x3c')][_0x0e7a('0x13')](util[_0x0e7a('0x2d')](_0x0e7a('0x14c'),_0x452cbb[_0x5116d9]));if(_0x5d955e[_0x0e7a('0xa4')]===-0x1){return _0x5d955e;}logger[_0x0e7a('0x33')](util[_0x0e7a('0x2d')](_0x0e7a('0x14d'),_0x452cbb[_0x5116d9],_0x5d955e['extra']));if(_0x5d955e[_0x0e7a('0xa2')]===_0x0e7a('0x145')){logger[_0x0e7a('0x33')](util[_0x0e7a('0x2d')](_0x0e7a('0x14d'),_0x452cbb[_0x5116d9],_0x0e7a('0x145')));this[_0x0e7a('0x3c')][_0x0e7a('0xaf')](util[_0x0e7a('0x2d')](_0x0e7a('0x14d'),_0x452cbb[_0x5116d9],'true'));return{'code':0xc8,'result':_0x0e7a('0x145')};}else{logger[_0x0e7a('0x33')](util[_0x0e7a('0x2d')](_0x0e7a('0x14d'),_0x452cbb[_0x5116d9],'false'));this['channel']['noop'](util[_0x0e7a('0x2d')](_0x0e7a('0x14d'),_0x452cbb[_0x5116d9],_0x0e7a('0x146')));}}return{'code':0xc8,'result':_0x0e7a('0x146')};};AGIVertices['prototype'][_0x0e7a('0x14e')]=function(_0x11c20d){logger[_0x0e7a('0x33')](util[_0x0e7a('0x2d')]('Enter\x20in\x20HANGUP\x20(%s)\x20block',_0x11c20d[_0x0e7a('0xb9')]));return this['channel'][_0x0e7a('0x14e')]();};AGIVertices[_0x0e7a('0x1a')][_0x0e7a('0x14f')]=function(_0x41eca8){logger[_0x0e7a('0x33')](util[_0x0e7a('0x2d')](_0x0e7a('0x150'),_0x41eca8[_0x0e7a('0xb9')]));if(!this[_0x0e7a('0x87')](_0x41eca8[_0x0e7a('0x7d')])){return this[_0x0e7a('0x3c')][_0x0e7a('0xaf')](_0x0e7a('0xe8'));}var _0x8ee1ae=_0x0e7a('0x132');var _0x42032e=util[_0x0e7a('0x2d')](_0x0e7a('0x133'),FILES_PATH,rs[_0x0e7a('0x11f')](0x4));var _0x4c3a8b=util[_0x0e7a('0x2d')](_0x0e7a('0x9e'),_0x42032e,_0x8ee1ae);var _0x5724d9=!![];if(_0x41eca8[_0x0e7a('0x134')]===_0x0e7a('0x151')){_0x5724d9=![];}var _0x5a1dd1=this[_0x0e7a('0x3c')][_0x0e7a('0x135')](_0x42032e,_0x8ee1ae,_0x41eca8[_0x0e7a('0x136')],_0x41eca8[_0x0e7a('0x68')],undefined,_0x5724d9);if(_0x5a1dd1[_0x0e7a('0xa4')]!==-0x1){this[_0x0e7a('0x3c')][_0x0e7a('0xaf')](util[_0x0e7a('0x2d')]('ispeech\x20%s\x20file\x20created',_0x4c3a8b));var _0x3c801c=this[_0x0e7a('0x86')][_0x0e7a('0x72')](this,_0x41eca8,_0x4c3a8b);if(_0x3c801c){for(var _0x463e1d in _0x3c801c){if(_0x3c801c[_0x0e7a('0x95')](_0x463e1d)){this[_0x0e7a('0x3c')]['setVariable'](util['format'](_0x0e7a('0x152'),_0x463e1d[_0x0e7a('0x6b')]()),_0x3c801c[_0x463e1d]);}}return this[_0x0e7a('0x3c')]['noop'](util[_0x0e7a('0x2d')](_0x0e7a('0x153'),JSON[_0x0e7a('0x76')](_0x3c801c)));}}return _0x5a1dd1;};AGIVertices['prototype'][_0x0e7a('0x154')]=function(_0x394c1c){logger[_0x0e7a('0x33')](util[_0x0e7a('0x2d')](_0x0e7a('0x155'),_0x394c1c[_0x0e7a('0xb9')]));if(!this[_0x0e7a('0x87')](_0x394c1c[_0x0e7a('0x7d')])){return this[_0x0e7a('0x3c')][_0x0e7a('0xaf')](_0x0e7a('0xe8'));}if(!this[_0x0e7a('0x87')](_0x394c1c['text'])){return this[_0x0e7a('0x3c')]['noop'](_0x0e7a('0xa9'));}this[_0x0e7a('0x3c')][_0x0e7a('0xaf')](util['format'](_0x0e7a('0x156'),_0x394c1c['text']));var _0x4c45a5=this[_0x0e7a('0x83')][_0x0e7a('0x72')](this,_0x394c1c);if(_0x4c45a5){this['channel'][_0x0e7a('0xaf')](util[_0x0e7a('0x2d')](_0x0e7a('0x157'),_0x4c45a5));var _0x70a4a7=this[_0x0e7a('0x3c')][_0x0e7a('0x128')](_0x4c45a5,_0x394c1c[_0x0e7a('0x136')]);try{fs['unlink'](_0x4c45a5+_0x0e7a('0x107'));}catch(_0x557f5f){logger['error'](_0x557f5f);}return _0x70a4a7;}return this[_0x0e7a('0x3c')][_0x0e7a('0x31')](_0x394c1c,_0x0e7a('0x158'));};AGIVertices[_0x0e7a('0x1a')]['login']=function(_0x11313d){logger['info'](util[_0x0e7a('0x2d')](_0x0e7a('0x159'),_0x11313d['label']));if(!this['isConfigured'](_0x11313d[_0x0e7a('0x15a')])){return this[_0x0e7a('0x3c')][_0x0e7a('0x31')](_0x11313d,_0x0e7a('0x15b'));}logger[_0x0e7a('0x33')](util[_0x0e7a('0x2d')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x0e7a('0x3c')][_0x0e7a('0x3e')],_0x11313d['findBy']));var _0x445c36=this[_0x0e7a('0x15c')]['sync'](this,_0x11313d[_0x0e7a('0x15a')]);if(_0x445c36){logger[_0x0e7a('0x33')](util[_0x0e7a('0x2d')](_0x0e7a('0x15d'),this[_0x0e7a('0x3c')][_0x0e7a('0x3e')],_0x11313d[_0x0e7a('0x15a')]));this[_0x0e7a('0x3c')]['noop'](util[_0x0e7a('0x2d')](_0x0e7a('0x15d'),this['channel'][_0x0e7a('0x3e')],_0x11313d['findBy']));return{'code':0xc8,'result':'success'};}else{logger['info'](util[_0x0e7a('0x2d')](_0x0e7a('0x15e'),this[_0x0e7a('0x3c')][_0x0e7a('0x3e')],_0x11313d[_0x0e7a('0x15a')]));this[_0x0e7a('0x3c')][_0x0e7a('0xaf')](util[_0x0e7a('0x2d')](_0x0e7a('0x15e'),this[_0x0e7a('0x3c')][_0x0e7a('0x3e')],_0x11313d[_0x0e7a('0x15a')]));return{'code':0xc8,'result':_0x0e7a('0x15f')};}};AGIVertices['prototype'][_0x0e7a('0x160')]=function(_0x5ad812){logger[_0x0e7a('0x33')](util[_0x0e7a('0x2d')](_0x0e7a('0x161'),_0x5ad812[_0x0e7a('0xb9')]));if(!this['isConfigured'](_0x5ad812[_0x0e7a('0x15a')])){return this[_0x0e7a('0x3c')][_0x0e7a('0x31')](_0x5ad812,_0x0e7a('0x15b'));}logger[_0x0e7a('0x33')](util[_0x0e7a('0x2d')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x0e7a('0x3c')][_0x0e7a('0x3e')],_0x5ad812[_0x0e7a('0x15a')]));var _0x4a8d0c=this[_0x0e7a('0x57')][_0x0e7a('0x72')](this,_0x5ad812['findBy']);if(_0x4a8d0c){logger[_0x0e7a('0x33')](util['format'](_0x0e7a('0x15d'),this[_0x0e7a('0x3c')]['callerid'],_0x5ad812[_0x0e7a('0x15a')]));this[_0x0e7a('0x3c')][_0x0e7a('0xaf')](util[_0x0e7a('0x2d')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x0e7a('0x3c')]['callerid'],_0x5ad812['findBy']));return{'code':0xc8,'result':_0x0e7a('0x162')};}else{logger[_0x0e7a('0x33')](util[_0x0e7a('0x2d')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x0e7a('0x3c')][_0x0e7a('0x3e')],_0x5ad812[_0x0e7a('0x15a')]));this['channel'][_0x0e7a('0xaf')](util[_0x0e7a('0x2d')](_0x0e7a('0x15e'),this[_0x0e7a('0x3c')][_0x0e7a('0x3e')],_0x5ad812[_0x0e7a('0x15a')]));return{'code':0xc8,'result':_0x0e7a('0x15f')};}};AGIVertices[_0x0e7a('0x1a')][_0x0e7a('0x163')]=function(_0x4656d4){logger[_0x0e7a('0x33')](util[_0x0e7a('0x2d')](_0x0e7a('0x164'),_0x4656d4[_0x0e7a('0xb9')]));if(!this[_0x0e7a('0x87')](_0x4656d4[_0x0e7a('0x165')])){return this[_0x0e7a('0x3c')][_0x0e7a('0x31')](_0x4656d4,_0x0e7a('0x166'));}this['channel'][_0x0e7a('0xaf')](util['format'](_0x0e7a('0x167'),_0x4656d4[_0x0e7a('0x165')]));var _0x30341e=eval(_0x4656d4[_0x0e7a('0x165')]);if(!this['isConfigured'](_0x4656d4[_0x0e7a('0xd8')])){return this[_0x0e7a('0x3c')][_0x0e7a('0xaf')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x2d4621=this['getVariable'][_0x0e7a('0x72')](this,_0x4656d4[_0x0e7a('0xd8')]);if(!_0x2d4621){return this['channel']['error'](_0x4656d4,'no\x20variable\x20found');}if(_[_0x0e7a('0x9a')](_0x30341e)){var _0x185b98=this;_0x30341e[_0x0e7a('0xda')](function(_0x4d5b08,_0x31b007){_0x185b98[_0x0e7a('0x3c')][_0x0e7a('0x9f')](util[_0x0e7a('0x2d')]('%s[%s]',_0x2d4621,_0x31b007),_0x4d5b08);});return this[_0x0e7a('0x3c')][_0x0e7a('0xaf')](util[_0x0e7a('0x2d')]('variable\x20%s[key]\x20set',_0x2d4621));}else{return this['channel'][_0x0e7a('0x9f')](_0x2d4621,_0x30341e);}};AGIVertices[_0x0e7a('0x1a')][_0x0e7a('0xe')]=function(_0x1f28fa){logger[_0x0e7a('0x33')](util['format']('Enter\x20in\x20MENU\x20(%s)\x20block',_0x1f28fa[_0x0e7a('0xb9')]));if(_0x1f28fa[_0x0e7a('0xa7')]===0x0){return this[_0x0e7a('0xa6')](_0x1f28fa);}_0x1f28fa['retry']-=0x1;if(!this[_0x0e7a('0x87')](_0x1f28fa[_0x0e7a('0x114')])){return this['channel'][_0x0e7a('0x31')](_0x1f28fa,_0x0e7a('0x115'));}var _0x4edbbc=this[_0x0e7a('0x22')][_0x0e7a('0x72')](this,_0x1f28fa[_0x0e7a('0x114')]);if(!_0x4edbbc){return this[_0x0e7a('0x3c')]['error'](_0x1f28fa,_0x0e7a('0x168'));}var _0x3c443d=this[_0x0e7a('0x3c')][_0x0e7a('0x117')](_0x4edbbc,_0x1f28fa['response'],_0x1f28fa[_0x0e7a('0x169')]);var _0x70cb4=_0x3c443d[_0x0e7a('0xa4')];if(_0x3c443d[_0x0e7a('0xa4')]===-0x1){this[_0x0e7a('0x3b')]['sync'](this,_0x1f28fa,'-1');return _0x3c443d;}else if(_0x3c443d['extra']===_0x0e7a('0x68')){_0x3c443d[_0x0e7a('0xa4')]=_0x3c443d['result'][_0x0e7a('0x9b')]>0x0?_0x3c443d[_0x0e7a('0xa4')]:'t';}else if(_['isEmpty'](_0x3c443d[_0x0e7a('0xa4')])){_0x3c443d[_0x0e7a('0xa4')]='#';_0x70cb4='#';}if(!this[_0x0e7a('0x87')](_0x1f28fa['variable_id'])){this[_0x0e7a('0x3c')][_0x0e7a('0xaf')](_0x0e7a('0x116'));}else{var _0x276138=this[_0x0e7a('0x13')][_0x0e7a('0x72')](this,_0x1f28fa[_0x0e7a('0xd8')]);if(!_0x276138){return this[_0x0e7a('0x3c')][_0x0e7a('0x31')](_0x1f28fa,_0x0e7a('0xd9'));}this[_0x0e7a('0x3c')]['setVariable'](_0x276138,_0x70cb4);}this[_0x0e7a('0x3b')][_0x0e7a('0x72')](this,_0x1f28fa,_0x70cb4);return _0x3c443d;};AGIVertices[_0x0e7a('0x1a')][_0x0e7a('0xaf')]=function(_0x1f59a8){logger['info'](util['format']('Enter\x20in\x20NOOP\x20(%s)\x20block',_0x1f59a8[_0x0e7a('0xb9')]));return this['channel'][_0x0e7a('0xaf')](_0x1f59a8[_0x0e7a('0x16a')]||_0x1f59a8[_0x0e7a('0xb9')]);};AGIVertices['prototype']['pause']=function(_0x24270f){logger[_0x0e7a('0x33')](util[_0x0e7a('0x2d')](_0x0e7a('0x16b'),_0x24270f[_0x0e7a('0xb9')]));if(!this[_0x0e7a('0x87')](_0x24270f[_0x0e7a('0x15a')])){return this[_0x0e7a('0x3c')][_0x0e7a('0x31')](_0x24270f,_0x0e7a('0x15b'));}logger['info'](util[_0x0e7a('0x2d')](_0x0e7a('0x16c'),this[_0x0e7a('0x3c')]['callerid'],_0x24270f['findBy']));var _0x2607e5=this['getPause']['sync'](this,_0x24270f[_0x0e7a('0x16d')]);var _0x26c156=this[_0x0e7a('0x54')][_0x0e7a('0x72')](this,_0x24270f[_0x0e7a('0x15a')],_0x2607e5);if(_0x26c156){logger[_0x0e7a('0x33')](util[_0x0e7a('0x2d')](_0x0e7a('0x15d'),this[_0x0e7a('0x3c')][_0x0e7a('0x3e')],_0x24270f['findBy']));this['channel']['noop'](util[_0x0e7a('0x2d')](_0x0e7a('0x15d'),this['channel'][_0x0e7a('0x3e')],_0x24270f[_0x0e7a('0x15a')]));return{'code':0xc8,'result':'success'};}else{logger[_0x0e7a('0x33')](util['format'](_0x0e7a('0x15e'),this[_0x0e7a('0x3c')]['callerid'],_0x24270f[_0x0e7a('0x15a')]));this[_0x0e7a('0x3c')]['noop'](util[_0x0e7a('0x2d')]('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x0e7a('0x3e')],_0x24270f[_0x0e7a('0x15a')]));return{'code':0xc8,'result':_0x0e7a('0x15f')};}};AGIVertices['prototype'][_0x0e7a('0x16e')]=function(_0x161f17){logger[_0x0e7a('0x33')](util[_0x0e7a('0x2d')]('Enter\x20in\x20PLAYBACK\x20(%s)\x20block',_0x161f17[_0x0e7a('0xb9')]));if(!this[_0x0e7a('0x87')](_0x161f17[_0x0e7a('0x114')])){return this[_0x0e7a('0x3c')][_0x0e7a('0x31')](_0x161f17,_0x0e7a('0x115'));}var _0x965b96=this[_0x0e7a('0x22')][_0x0e7a('0x72')](this,_0x161f17['file_id']);if(!_0x965b96){return this['channel'][_0x0e7a('0x31')](_0x161f17,_0x0e7a('0x168'));}var _0x5036a4=this[_0x0e7a('0x3c')][_0x0e7a('0xaa')]('PLAYBACK',[_0x965b96,_0x161f17['opts']]);if(_0x5036a4[_0x0e7a('0xa4')]===-0x1){return _0x5036a4;}return this[_0x0e7a('0x3c')][_0x0e7a('0xaf')](util[_0x0e7a('0x2d')](_0x0e7a('0x16f'),_0x0e7a('0x170'),_0x965b96));};AGIVertices[_0x0e7a('0x1a')][_0x0e7a('0x171')]=function(_0xfe0396){logger['info'](util[_0x0e7a('0x2d')](_0x0e7a('0x172'),_0xfe0396[_0x0e7a('0xb9')]));if(!this['isConfigured'](_0xfe0396[_0x0e7a('0x173')])){return this[_0x0e7a('0x3c')][_0x0e7a('0x31')](_0xfe0396,_0x0e7a('0x174'));}var _0x2bd2fb='';var _0x336cbb=parseInt(_0xfe0396['queue_id'],0xa);if(isNaN(_0x336cbb)){_0x2bd2fb=_0xfe0396[_0x0e7a('0x173')];}else{_0x2bd2fb=this[_0x0e7a('0x17')][_0x0e7a('0x72')](this,_0xfe0396[_0x0e7a('0x173')]);if(!_0x2bd2fb){return this[_0x0e7a('0x3c')]['error'](_0xfe0396,_0x0e7a('0x175'));}}var _0x1a0440='';if(this[_0x0e7a('0x87')](_0xfe0396[_0x0e7a('0x114')])){var _0x29ab52=this[_0x0e7a('0x22')]['sync'](this,_0xfe0396[_0x0e7a('0x114')]);if(_0x29ab52){_0x1a0440=_0x29ab52;}}this[_0x0e7a('0x3b')][_0x0e7a('0x72')](this,_0xfe0396,_0x2bd2fb);if(_0xfe0396[_0x0e7a('0xe6')][_0x0e7a('0x176')]('x')<0x0){_0xfe0396['opts']+='x';}if(_0xfe0396[_0x0e7a('0xe6')][_0x0e7a('0x176')]('X')<0x0){_0xfe0396['opts']+='X';}this[_0x0e7a('0x3c')][_0x0e7a('0x9f')](_0x0e7a('0x177'),_0x2bd2fb?_0x2bd2fb[_0x0e7a('0x178')]():'');var _0x178414=this[_0x0e7a('0x3c')][_0x0e7a('0xaa')]('QUEUE',[_0x2bd2fb,_0xfe0396['opts'],_0xfe0396['url'],_0x1a0440,_0xfe0396[_0x0e7a('0x68')],_0xfe0396[_0x0e7a('0x9')],_0xfe0396['macro'],_0xfe0396[_0x0e7a('0x179')],'',_0xfe0396['position']]);if(_0x178414['result']===-0x1){return _0x178414;}return this[_0x0e7a('0x3c')][_0x0e7a('0xaf')](util[_0x0e7a('0x2d')](_0x0e7a('0x16f'),_0x0e7a('0x17a'),_0x2bd2fb));};AGIVertices[_0x0e7a('0x1a')][_0x0e7a('0x17b')]=function(_0x331cce){logger['info'](util['format']('Enter\x20in\x20RECORD\x20(%s)\x20block',_0x331cce[_0x0e7a('0xb9')]));var _0x576a1b=_0x331cce['recordingFormat']||_0x0e7a('0x132');var _0x11dbb6=util[_0x0e7a('0x2d')](_0x0e7a('0x17c'),this[_0x0e7a('0x3c')][_0x0e7a('0x40')],rs[_0x0e7a('0x11f')](0x5));var _0x4ea9cb=util[_0x0e7a('0x2d')](_0x0e7a('0x17d'),FILES_PATH,_0x11dbb6,_0x576a1b);var _0x49fa9f=util[_0x0e7a('0x2d')](_0x0e7a('0x133'),FILES_PATH,_0x11dbb6);this['createSquareRecording'][_0x0e7a('0x72')](this,_0x331cce,_0x11dbb6,_0x4ea9cb);this[_0x0e7a('0x3c')][_0x0e7a('0x9f')](_0x0e7a('0x17e'),_0x11dbb6);logger[_0x0e7a('0x33')](_0x0e7a('0x17f'),_0x49fa9f,_0x576a1b,_0x331cce[_0x0e7a('0x180')],_0x331cce[_0x0e7a('0x68')]);return this[_0x0e7a('0x3c')]['recordFile'](_0x49fa9f,_0x576a1b,_0x331cce[_0x0e7a('0x180')],_0x331cce[_0x0e7a('0x68')],undefined,!![]);};AGIVertices[_0x0e7a('0x1a')][_0x0e7a('0x181')]=function(_0x296221){logger[_0x0e7a('0x33')](util[_0x0e7a('0x2d')](_0x0e7a('0x182'),_0x296221[_0x0e7a('0xb9')]));if(!this['isConfigured'](_0x296221[_0x0e7a('0x75')])){return this[_0x0e7a('0x3c')][_0x0e7a('0xaf')]('no\x20url\x20configured');}var _0x3fa2bd=this[_0x0e7a('0x67')][_0x0e7a('0x72')](this,_0x296221);logger[_0x0e7a('0x33')](util['format']('Response:',util['inspect'](_0x3fa2bd,{'showHidden':![],'depth':null})));if(!this[_0x0e7a('0x87')](_0x296221['variable_id'])){return this[_0x0e7a('0x3c')][_0x0e7a('0xaf')](_0x0e7a('0x183'));}var _0x138273=this['getVariable'][_0x0e7a('0x72')](this,_0x296221[_0x0e7a('0xd8')]);if(!_0x138273){return this[_0x0e7a('0x3c')][_0x0e7a('0x31')](_0x296221,_0x0e7a('0xd9'));}this[_0x0e7a('0x3c')][_0x0e7a('0x9f')](util[_0x0e7a('0x2d')]('%s_STATUS_CODE',_0x138273),_0x3fa2bd[_0x0e7a('0x78')]?_0x3fa2bd[_0x0e7a('0x78')]:_0x0e7a('0x184'));this[_0x0e7a('0x3c')]['setVariable'](util[_0x0e7a('0x2d')](_0x0e7a('0x185'),_0x138273),_0x3fa2bd[_0x0e7a('0x79')]?_0x3fa2bd[_0x0e7a('0x79')]:'OK');if(_0x3fa2bd[_0x0e7a('0x6c')]){try{this[_0x0e7a('0x9d')](_0x3fa2bd[_0x0e7a('0x6c')],_0x138273);}catch(_0x1cd7da){logger['error'](util[_0x0e7a('0x2d')](_0x0e7a('0x186'),_0x138273));}}return this[_0x0e7a('0x3c')][_0x0e7a('0xaf')](util['format'](_0x0e7a('0x187'),_0x138273));};AGIVertices[_0x0e7a('0x1a')][_0x0e7a('0x188')]=function(_0x4365a6){logger[_0x0e7a('0x33')](util['format'](_0x0e7a('0x189'),_0x4365a6[_0x0e7a('0xb9')]));return this[_0x0e7a('0x3c')][_0x0e7a('0x18a')](_0x4365a6[_0x0e7a('0x18b')][_0x0e7a('0x5c')](/\s+/g,''),_0x4365a6[_0x0e7a('0x180')]);};AGIVertices[_0x0e7a('0x1a')][_0x0e7a('0x18c')]=function(_0x2869ea){logger[_0x0e7a('0x33')](util[_0x0e7a('0x2d')](_0x0e7a('0x18d'),_0x2869ea[_0x0e7a('0xb9')]));return this[_0x0e7a('0x3c')]['sayNumber'](_0x2869ea['number'][_0x0e7a('0x5c')](/\s+/g,''),_0x2869ea['escape_digits']);};AGIVertices[_0x0e7a('0x1a')]['sayphonetic']=function(_0xddb403){logger[_0x0e7a('0x33')](util[_0x0e7a('0x2d')](_0x0e7a('0x18e'),_0xddb403[_0x0e7a('0xb9')]));return this[_0x0e7a('0x3c')][_0x0e7a('0x18f')](_0xddb403[_0x0e7a('0x60')],_0xddb403['escape_digits']);};AGIVertices[_0x0e7a('0x1a')][_0x0e7a('0x190')]=function(_0x3a6bc8){logger[_0x0e7a('0x33')](util[_0x0e7a('0x2d')](_0x0e7a('0x191'),_0x3a6bc8[_0x0e7a('0xb9')]));if(!this[_0x0e7a('0x87')](_0x3a6bc8[_0x0e7a('0x192')])){return this[_0x0e7a('0x3c')]['noop'](_0x0e7a('0x193'));}var _0x3c46e8=this['getMailAccount'][_0x0e7a('0x72')](this,_0x3a6bc8[_0x0e7a('0x192')]);if(!_0x3c46e8||!_0x3c46e8[_0x0e7a('0x194')]){return this['channel'][_0x0e7a('0x31')](_0x3a6bc8,_0x0e7a('0x195'));}var _0x16f856={'from':util[_0x0e7a('0x2d')](_0x0e7a('0x196'),_0x3c46e8['name'],_0x3c46e8[_0x0e7a('0x197')]||_0x3c46e8[_0x0e7a('0x194')][_0x0e7a('0x198')]),'to':_0x3a6bc8['to']||'','cc':_0x3a6bc8['cc']||'','bcc':_0x3a6bc8['bcc']||'','subject':_0x3a6bc8['subject'],'html':_0x3a6bc8[_0x0e7a('0x60')],'text':_0x3a6bc8['text']};var _0x563cca={'tls':{'rejectUnauthorized':![]}};if(_0x3c46e8[_0x0e7a('0x194')][_0x0e7a('0x199')]){_0x563cca[_0x0e7a('0x199')]=_0x3c46e8[_0x0e7a('0x194')][_0x0e7a('0x199')];}else{_0x563cca[_0x0e7a('0x19a')]=_0x3c46e8[_0x0e7a('0x194')][_0x0e7a('0x19a')];_0x563cca[_0x0e7a('0x19b')]=_0x3c46e8['Smtp']['port'];_0x563cca[_0x0e7a('0x19c')]=_0x3c46e8[_0x0e7a('0x194')][_0x0e7a('0x19c')];}if(_0x3c46e8[_0x0e7a('0x194')][_0x0e7a('0x19d')]){_0x563cca['auth']={'user':_0x3c46e8[_0x0e7a('0x194')][_0x0e7a('0x198')],'pass':_0x3c46e8['Smtp']['pass']};}if(this[_0x0e7a('0x87')](_0x3a6bc8['template_id'])){}logger[_0x0e7a('0xdf')](_0x0e7a('0x19e'),JSON[_0x0e7a('0x76')](_0x16f856));this[_0x0e7a('0x3b')]['sync'](this,_0x3a6bc8,_0x3a6bc8[_0x0e7a('0x192')]);this['channel'][_0x0e7a('0xaf')](util['format']('Trying\x20SendMail\x20with\x20account\x20%s',_0x3c46e8[_0x0e7a('0x19')]));this[_0x0e7a('0x27')][_0x0e7a('0x72')](this,_0x563cca,_0x16f856);return this[_0x0e7a('0x3c')][_0x0e7a('0xaf')](_0x0e7a('0x19f'));};AGIVertices[_0x0e7a('0x1a')][_0x0e7a('0x1a0')]=function(_0x32e446){logger['info'](util[_0x0e7a('0x2d')](_0x0e7a('0x1a1'),_0x32e446['label']));return this[_0x0e7a('0x3c')][_0x0e7a('0xaf')](_0x0e7a('0x1a2'));};AGIVertices[_0x0e7a('0x1a')][_0x0e7a('0x1a3')]=function(_0xf679d4){logger[_0x0e7a('0x33')](util[_0x0e7a('0x2d')](_0x0e7a('0x1a4'),_0xf679d4[_0x0e7a('0xb9')]));if(!this[_0x0e7a('0x87')](_0xf679d4['sms_account_id'])){return this[_0x0e7a('0x3c')][_0x0e7a('0xaf')](_0x0e7a('0x1a5'));}var _0x44461c=this[_0x0e7a('0x1a6')][_0x0e7a('0x72')](this,_0xf679d4[_0x0e7a('0x1a7')]);if(!_0x44461c){return this[_0x0e7a('0x3c')][_0x0e7a('0x31')](_0xf679d4,_0x0e7a('0x1a8'));}var _0xb152e={'body':_0xf679d4['sms_text'],'phone':_0xf679d4['to']||'','SmsAccountId':_0x44461c['id']};logger[_0x0e7a('0xdf')]('sendSMS\x20message',JSON['stringify'](_0xb152e));this['createSquareDetailsReport'][_0x0e7a('0x72')](this,_0xf679d4,_0xf679d4[_0x0e7a('0x1a7')]);this[_0x0e7a('0x3c')][_0x0e7a('0xaf')](util[_0x0e7a('0x2d')]('Trying\x20SendSMS\x20with\x20account\x20%s',_0x44461c[_0x0e7a('0x19')]));this['createSmsMessage'][_0x0e7a('0x72')](this,_0xb152e);return this[_0x0e7a('0x3c')][_0x0e7a('0xaf')]('Sms\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices[_0x0e7a('0x1a')]['set']=function(_0x4cf4a0){logger[_0x0e7a('0x33')](util[_0x0e7a('0x2d')](_0x0e7a('0x1a9'),_0x4cf4a0['label']));if(!this[_0x0e7a('0x87')](_0x4cf4a0['variable_id'])){return this[_0x0e7a('0x3c')][_0x0e7a('0x31')](_0x4cf4a0,'no\x20variable\x20selected');}var _0x1b7445=this[_0x0e7a('0x13')][_0x0e7a('0x72')](this,_0x4cf4a0['variable_id']);if(!_0x1b7445){return this[_0x0e7a('0x3c')][_0x0e7a('0x31')](_0x4cf4a0,_0x0e7a('0xd9'));}return this[_0x0e7a('0x3c')][_0x0e7a('0x9f')](_0x1b7445,_0x4cf4a0[_0x0e7a('0x1aa')]);};AGIVertices['prototype'][_0x0e7a('0x1ab')]=function(_0x3e51eb){logger[_0x0e7a('0x33')](util['format'](_0x0e7a('0x1ac'),_0x3e51eb[_0x0e7a('0xb9')]));this[_0x0e7a('0x3c')][_0x0e7a('0xaf')]('START\x20CALLY\x20SQUARE');if(_0x3e51eb['answer']==='yes'){this[_0x0e7a('0x3c')][_0x0e7a('0xaf')](_0x0e7a('0x1ad'));return this['channel'][_0x0e7a('0xbb')]();}return this[_0x0e7a('0x3c')]['noop']('Skipped\x20Answer');};AGIVertices['prototype'][_0x0e7a('0x1ae')]=function(_0x1e17ec){logger['info'](util[_0x0e7a('0x2d')](_0x0e7a('0x1af'),_0x1e17ec[_0x0e7a('0xb9')]));if(!this[_0x0e7a('0x87')](_0x1e17ec[_0x0e7a('0x1b0')])){return this['channel'][_0x0e7a('0x31')](_0x1e17ec,'no\x20subproject\x20selected');}var _0x55445d=this['getSquareProject'][_0x0e7a('0x72')](this,_0x1e17ec[_0x0e7a('0x1b0')]);if(!this[_0x0e7a('0x87')](_0x55445d)){return this[_0x0e7a('0x3c')][_0x0e7a('0x31')](_0x1e17ec,util['format'](_0x0e7a('0x1b1'),_0x1e17ec[_0x0e7a('0x1b0')]));}if(_0x55445d===this[_0x0e7a('0x3c')][_0x0e7a('0x3d')]){return this[_0x0e7a('0x3c')][_0x0e7a('0x31')](_0x1e17ec,_0x0e7a('0x1b2'));}this[_0x0e7a('0x3b')][_0x0e7a('0x72')](this,_0x1e17ec,_0x55445d);var _0x11bcd5=this[_0x0e7a('0x3c')][_0x0e7a('0xaa')](_0x0e7a('0x1b3'),util[_0x0e7a('0x2d')](_0x0e7a('0x1b4'),config[_0x0e7a('0x9')][_0x0e7a('0x19a')]||_0x0e7a('0x1b5'),_0x55445d,this[_0x0e7a('0x3c')]['arg_1']));if(_0x11bcd5[_0x0e7a('0xa4')]===-0x1){return _0x11bcd5;}return this[_0x0e7a('0x3c')][_0x0e7a('0xaf')](util[_0x0e7a('0x2d')](_0x0e7a('0x16f'),'AGI',_0x55445d));};AGIVertices[_0x0e7a('0x1a')][_0x0e7a('0x1b6')]=function(_0x175d64){logger[_0x0e7a('0x33')](util[_0x0e7a('0x2d')](_0x0e7a('0x1b7'),_0x175d64[_0x0e7a('0xb9')]));var _0x1620a6=this[_0x0e7a('0x5b')][_0x0e7a('0x72')](this,_0x175d64[_0x0e7a('0xba')]);this[_0x0e7a('0x3b')]['sync'](this,_0x175d64,_0x175d64[_0x0e7a('0xba')]);if(this['isConfigured'](_0x175d64[_0x0e7a('0xd8')])){var _0x392c77=this[_0x0e7a('0x13')][_0x0e7a('0x72')](this,_0x175d64[_0x0e7a('0xd8')]);if(_0x392c77){this[_0x0e7a('0x3c')][_0x0e7a('0x9f')](_0x392c77,_0x1620a6);return this[_0x0e7a('0x3c')]['noop'](util['format'](_0x0e7a('0x1b8'),_0x175d64[_0x0e7a('0xba')],_0x392c77));}}return this[_0x0e7a('0x3c')][_0x0e7a('0xaf')](util[_0x0e7a('0x2d')](_0x0e7a('0x1b9'),_0x175d64['command']));};AGIVertices[_0x0e7a('0x1a')][_0x0e7a('0x1ba')]=function(_0x36bfb6){logger[_0x0e7a('0x33')](util[_0x0e7a('0x2d')](_0x0e7a('0x1bb'),_0x36bfb6['label']));_0x36bfb6['text']=_0x36bfb6[_0x0e7a('0x60')]['replace'](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x0e7a('0x87')](_0x36bfb6[_0x0e7a('0x5e')])){return this[_0x0e7a('0x3c')]['noop'](_0x0e7a('0x1bc'));}if(!this['isConfigured'](_0x36bfb6[_0x0e7a('0x60')])){return this['channel'][_0x0e7a('0xaf')](_0x0e7a('0xa9'));}this['channel'][_0x0e7a('0xaf')](util['format'](_0x0e7a('0x1bd'),_0x36bfb6[_0x0e7a('0x60')]));var _0xac3545=this[_0x0e7a('0x5d')]['sync'](this,_0x36bfb6);if(_0xac3545){this[_0x0e7a('0x3c')][_0x0e7a('0xaf')](util[_0x0e7a('0x2d')](_0x0e7a('0x1be'),_0xac3545));var _0x29492d=this[_0x0e7a('0x3c')]['streamFile'](_0xac3545);try{fs[_0x0e7a('0x106')](_0xac3545+_0x0e7a('0x107'));}catch(_0x91c463){logger[_0x0e7a('0x31')](_0x91c463);}return _0x29492d;}return this[_0x0e7a('0x3c')][_0x0e7a('0x31')](_0x36bfb6,_0x0e7a('0x1bf'));};AGIVertices[_0x0e7a('0x1a')][_0x0e7a('0x1c0')]=function(_0x4d6b97){logger[_0x0e7a('0x33')](util['format'](_0x0e7a('0x1c1'),_0x4d6b97[_0x0e7a('0xb9')]));_0x4d6b97[_0x0e7a('0x60')]=_0x4d6b97[_0x0e7a('0x60')][_0x0e7a('0x5c')](/(\r\n|\n|\r)/gm,'\x20');if(!this[_0x0e7a('0x87')](_0x4d6b97[_0x0e7a('0x60')])){return this[_0x0e7a('0x3c')][_0x0e7a('0xaf')]('no\x20text\x20configured');}this['channel']['noop'](util[_0x0e7a('0x2d')](_0x0e7a('0x1c2'),_0x4d6b97[_0x0e7a('0x60')]));var _0x4aa129=this[_0x0e7a('0x65')][_0x0e7a('0x72')](this,_0x4d6b97);if(_0x4aa129){this['channel'][_0x0e7a('0xaf')](util[_0x0e7a('0x2d')](_0x0e7a('0x1c3'),_0x4aa129));var _0x310a05=this[_0x0e7a('0x3c')][_0x0e7a('0x128')](_0x4aa129);try{fs[_0x0e7a('0x106')](_0x4aa129+'.wav');}catch(_0x5b63bf){logger['error'](_0x5b63bf);}return _0x310a05;}return this['channel'][_0x0e7a('0x31')](_0x4d6b97,_0x0e7a('0x1c4'));};AGIVertices['prototype']['unpause']=function(_0x54c63c){logger[_0x0e7a('0x33')](util[_0x0e7a('0x2d')](_0x0e7a('0x1c5'),_0x54c63c[_0x0e7a('0xb9')]));if(!this[_0x0e7a('0x87')](_0x54c63c[_0x0e7a('0x15a')])){return this[_0x0e7a('0x3c')][_0x0e7a('0x31')](_0x54c63c,'no\x20find\x20by\x20configured');}logger[_0x0e7a('0x33')](util[_0x0e7a('0x2d')](_0x0e7a('0x16c'),this[_0x0e7a('0x3c')][_0x0e7a('0x3e')],_0x54c63c[_0x0e7a('0x15a')]));var _0x11804a=this[_0x0e7a('0x56')][_0x0e7a('0x72')](this,_0x54c63c['findBy']);if(_0x11804a){logger[_0x0e7a('0x33')](util[_0x0e7a('0x2d')](_0x0e7a('0x15d'),this[_0x0e7a('0x3c')][_0x0e7a('0x3e')],_0x54c63c[_0x0e7a('0x15a')]));this[_0x0e7a('0x3c')][_0x0e7a('0xaf')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0x0e7a('0x3c')][_0x0e7a('0x3e')],_0x54c63c[_0x0e7a('0x15a')]));return{'code':0xc8,'result':'success'};}else{logger[_0x0e7a('0x33')](util['format'](_0x0e7a('0x15e'),this['channel'][_0x0e7a('0x3e')],_0x54c63c[_0x0e7a('0x15a')]));this[_0x0e7a('0x3c')]['noop'](util[_0x0e7a('0x2d')](_0x0e7a('0x15e'),this[_0x0e7a('0x3c')]['callerid'],_0x54c63c['findBy']));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x0e7a('0x1a')]['voicemail']=function(_0x2a6979){logger[_0x0e7a('0x33')](util[_0x0e7a('0x2d')](_0x0e7a('0x1c6'),_0x2a6979[_0x0e7a('0xb9')]));var _0xfb14c4=this['channel'][_0x0e7a('0xaa')](_0x0e7a('0x1c7'),[_0x2a6979['mailbox'],_0x2a6979[_0x0e7a('0x7b')]]);if(_0xfb14c4[_0x0e7a('0xa4')]===-0x1){return _0xfb14c4;}return this[_0x0e7a('0x3c')][_0x0e7a('0xaf')](util['format'](_0x0e7a('0x16f'),_0x0e7a('0x1c7'),_0x2a6979[_0x0e7a('0x1c8')]));};AGIVertices[_0x0e7a('0x1a')][_0x0e7a('0x1c9')]=function(_0xbcd136){logger[_0x0e7a('0x33')](util[_0x0e7a('0x2d')](_0x0e7a('0x1ca'),_0xbcd136['label']));if(!this[_0x0e7a('0x87')](_0xbcd136['variable_id'])){return this['channel'][_0x0e7a('0x31')](_0xbcd136,_0x0e7a('0x1cb'));}var _0x3511ad=this[_0x0e7a('0x13')][_0x0e7a('0x72')](this,_0xbcd136[_0x0e7a('0xd8')]);if(!_0x3511ad){return this['channel'][_0x0e7a('0x31')](_0xbcd136,_0x0e7a('0xd9'));}var _0x13f5f1=this[_0x0e7a('0x3c')][_0x0e7a('0x13')](_0x3511ad);return{'code':0xc8,'result':_0x13f5f1[_0x0e7a('0xa2')]?_0x13f5f1[_0x0e7a('0xa2')]:'-'};};String[_0x0e7a('0x1a')][_0x0e7a('0xa1')]=function(_0x4a88a5,_0x27bed5){return this[_0x0e7a('0xa0')](_0x4a88a5)['join'](_0x27bed5);};module[_0x0e7a('0x1cc')]=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index 0cc3ed4..bfb21ee 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 _0x8d77=['name','QueuePause','then','getAgent','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','stopAcw','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','updateAcw','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','[ACW][START]\x20%s','message','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','syncAgentConnect','acw','[ACW][syncAgentConnect]\x20%s','attended','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','startAcw','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','isNil','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','util','lodash','moment','../ami','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','bind','hanguprequest','syncHangupRequest','hangup','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','milliseconds','diff','prototype','interface','queue','ACW','mandatoryDisposition','mandatoryDispositionPause'];(function(_0x7c5a9f,_0x364139){var _0x237862=function(_0x574cd8){while(--_0x574cd8){_0x7c5a9f['push'](_0x7c5a9f['shift']());}};_0x237862(++_0x364139);}(_0x8d77,0x12e));var _0x78d7=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0x8d77[_0x5783f4];return _0x28e380;};'use strict';var util=require(_0x78d7('0x0'));var _=require(_0x78d7('0x1'));var moment=require(_0x78d7('0x2'));var ami=require(_0x78d7('0x3'));var logger=require('../../../config/logger')('acw');var RpcUser=require(_0x78d7('0x4'));var RpcVoiceAgentReport=require(_0x78d7('0x5'));function Acw(_0x163edc){this[_0x78d7('0x6')]=_0x163edc[_0x78d7('0x6')];this[_0x78d7('0x7')]=_0x163edc['agents'];this[_0x78d7('0x8')]=_0x163edc[_0x78d7('0x8')];this[_0x78d7('0x9')]={};ami['on'](_0x78d7('0xa'),this['syncAgentConnect'][_0x78d7('0xb')](this));ami['on'](_0x78d7('0xc'),this[_0x78d7('0xd')][_0x78d7('0xb')](this));ami['on'](_0x78d7('0xe'),this[_0x78d7('0xf')][_0x78d7('0xb')](this));ami['on'](_0x78d7('0x10'),this[_0x78d7('0x11')][_0x78d7('0xb')](this));ami['on'](_0x78d7('0x12'),this['syncAttendedTransfer']['bind'](this));ami['on'](_0x78d7('0x13'),this[_0x78d7('0x14')][_0x78d7('0xb')](this));ami['on'](_0x78d7('0x15'),this['syncAgentConnectPreview'][_0x78d7('0xb')](this));}function getDiff(_0x12785e){var _0x22a79a=moment()['milliseconds'](0x0);var _0x31df3b=moment(_0x12785e)[_0x78d7('0x16')](0x0);return _0x22a79a[_0x78d7('0x17')](_0x31df3b,'seconds');}Acw[_0x78d7('0x18')]['startAcw']=function(_0x479ca1){try{var _0x169c0b=this;var _0x14e7de=this[_0x78d7('0x9')][_0x479ca1][_0x78d7('0x19')];var _0x56bcb3=this['channels'][_0x479ca1][_0x78d7('0x1a')];var _0x51576a=this['voiceQueues'][_0x56bcb3];var _0x1b4742=![];var _0x3bf66e=_0x78d7('0x1b');if(_0x51576a[_0x78d7('0x1c')]){if(_0x51576a[_0x78d7('0x1d')][_0x78d7('0x1e')]){_0x1b4742=!![];_0x3bf66e=_0x51576a[_0x78d7('0x1d')][_0x78d7('0x1e')];}}ami['Action']({'action':_0x78d7('0x1f'),'interface':_0x14e7de,'paused':!![],'reason':_0x3bf66e})[_0x78d7('0x20')](function(_0x2c9852){if(_0x169c0b[_0x78d7('0x7')][_0x14e7de]){return RpcUser[_0x78d7('0x21')](_0x169c0b['agents'][_0x14e7de]['id'])[_0x78d7('0x20')](function(_0x15c0c9){if(_0x15c0c9&&!_0x15c0c9[_0x78d7('0x22')]){logger[_0x78d7('0x23')](_0x78d7('0x24'),_0x479ca1,_0x14e7de,_0x56bcb3);var _0x508397=_0x169c0b[_0x78d7('0x9')][_0x479ca1]['attended']&&_0x169c0b['channels'][_0x479ca1][_0x78d7('0x25')]?_0x169c0b[_0x78d7('0x9')][_0x479ca1]['destlinkedid']:_0x479ca1;return RpcUser[_0x78d7('0x26')](_0x169c0b[_0x78d7('0x7')][_0x14e7de],_0x3bf66e,_0x508397)[_0x78d7('0x20')](function(_0xf3bdd1){if(!_0x1b4742){_0x169c0b[_0x78d7('0x8')][_0x14e7de]={};logger['info'](_0x78d7('0x27'),_0x479ca1,_0x169c0b['voiceQueues'][_0x56bcb3][_0x78d7('0x28')],_0x14e7de,_0x56bcb3);_0x169c0b[_0x78d7('0x8')][_0x14e7de][_0x78d7('0x29')]=setTimeout(_0x169c0b[_0x78d7('0x2a')][_0x78d7('0xb')](_0x169c0b,_0x14e7de),_0x169c0b['voiceQueues'][_0x56bcb3][_0x78d7('0x28')]*0x3e8);_0x169c0b[_0x78d7('0x8')][_0x14e7de][_0x78d7('0x2b')]=moment()[_0x78d7('0x2c')](_0x78d7('0x2d'));_0x169c0b[_0x78d7('0x8')][_0x14e7de][_0x78d7('0x2e')]=_0x479ca1;_0x169c0b[_0x78d7('0x8')][_0x14e7de][_0x78d7('0x1a')]=_0x56bcb3;_0x169c0b[_0x78d7('0x8')][_0x14e7de][_0x78d7('0x2f')]=function(){var _0x5948c6=getDiff(_0x169c0b[_0x78d7('0x8')][_0x14e7de][_0x78d7('0x2b')]);clearTimeout(_0x169c0b[_0x78d7('0x8')][_0x14e7de][_0x78d7('0x29')]);_0x169c0b[_0x78d7('0x8')][_0x14e7de][_0x78d7('0x29')]=![];RpcVoiceAgentReport['update']({'acwtime':_0x5948c6},_0x169c0b[_0x78d7('0x8')][_0x14e7de][_0x78d7('0x2e')],_0x14e7de)['then'](function(_0x51a1be){logger[_0x78d7('0x23')](_0x78d7('0x30'),_0x479ca1,_0x5948c6,_0x51a1be);})[_0x78d7('0x31')](function(_0x11e9ef){logger[_0x78d7('0x32')](_0x78d7('0x33'),_0x479ca1,_0x11e9ef);});delete _0x169c0b[_0x78d7('0x8')][_0x14e7de];};}});}else{logger[_0x78d7('0x23')](_0x78d7('0x34'),_0x479ca1,_0x14e7de,_0x56bcb3);}});}})[_0x78d7('0x31')](function(_0x3fbaae){logger['error'](_0x78d7('0x27'),_0x479ca1,_0x169c0b['voiceQueues'][_0x56bcb3][_0x78d7('0x28')],_0x14e7de,_0x56bcb3);})['finally'](function(){delete _0x169c0b[_0x78d7('0x9')][_0x479ca1];});}catch(_0x172223){logger[_0x78d7('0x32')](_0x78d7('0x35'),_0x172223[_0x78d7('0x36')]);}};Acw[_0x78d7('0x18')]['stopAcw']=function(_0xcf29c){try{var _0x511281=this;if(_0x511281[_0x78d7('0x8')][_0xcf29c]){_0x511281[_0x78d7('0x8')][_0xcf29c][_0x78d7('0x29')]=![];var _0x570fc5=_0x511281[_0x78d7('0x8')][_0xcf29c][_0x78d7('0x2e')];var _0x1992b9=_0x511281['timers'][_0xcf29c][_0x78d7('0x1a')];var _0x16ab1d=_0x511281[_0x78d7('0x6')][_0x1992b9][_0x78d7('0x28')];logger[_0x78d7('0x23')](_0x78d7('0x37'),_0x570fc5,_0xcf29c);RpcUser[_0x78d7('0x38')](this['agents'][_0xcf29c]);RpcVoiceAgentReport['update']({'acwtime':_0x16ab1d,'agentacw':!![]},_0x570fc5,_0xcf29c)[_0x78d7('0x20')](function(_0x454c16){logger[_0x78d7('0x23')](_0x78d7('0x30'),_0x570fc5,_0x16ab1d,_0x454c16);})[_0x78d7('0x31')](function(_0x30e27a){logger['error'](_0x78d7('0x33'),_0x570fc5,_0x30e27a);});}else{logger[_0x78d7('0x32')]('[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer',_0xcf29c);if(_0x511281['timers']){logger[_0x78d7('0x23')](_0x78d7('0x39'),JSON[_0x78d7('0x3a')](_0x511281[_0x78d7('0x8')]));}}}catch(_0x54ca54){logger[_0x78d7('0x32')](_0x78d7('0x3b'),_0x54ca54[_0x78d7('0x36')]);}};Acw['prototype'][_0x78d7('0x3c')]=function(_0x17c961){try{if(this[_0x78d7('0x6')][_0x17c961[_0x78d7('0x1a')]]&&(this[_0x78d7('0x6')][_0x17c961[_0x78d7('0x1a')]][_0x78d7('0x3d')]||this[_0x78d7('0x6')][_0x17c961['queue']][_0x78d7('0x1c')])){if(this[_0x78d7('0x7')][_0x17c961['interface']]){this[_0x78d7('0x9')][_0x17c961['uniqueid']]={'queue':_0x17c961[_0x78d7('0x1a')],'interface':_0x17c961[_0x78d7('0x19')],'destlinkedid':_0x17c961[_0x78d7('0x25')]};}}}catch(_0x572c7f){logger[_0x78d7('0x32')](_0x78d7('0x3e'),_0x572c7f['message']);}};Acw[_0x78d7('0x18')]['syncAgentConnectPreview']=function(_0x21514f){try{if(this[_0x78d7('0x6')][_0x21514f[_0x78d7('0x1a')]]&&(this['voiceQueues'][_0x21514f['queue']]['acw']||this[_0x78d7('0x6')][_0x21514f[_0x78d7('0x1a')]][_0x78d7('0x1c')])){if(this['agents'][_0x21514f[_0x78d7('0x19')]]){this['channels'][_0x21514f[_0x78d7('0x2e')]]={'queue':_0x21514f[_0x78d7('0x1a')],'interface':_0x21514f['interface']};}}}catch(_0x199819){logger[_0x78d7('0x32')]('[ACW][syncAgentConnectPreview]\x20%s',_0x199819[_0x78d7('0x36')]);}};Acw[_0x78d7('0x18')][_0x78d7('0xd')]=function(_0x1e1b3e){try{if(this[_0x78d7('0x9')][_0x1e1b3e[_0x78d7('0x2e')]]&&_['isUndefined'](this[_0x78d7('0x9')][_0x1e1b3e[_0x78d7('0x2e')]][_0x78d7('0x3f')])){logger['info'](_0x78d7('0x40'),_0x1e1b3e['uniqueid']);this['startAcw'](_0x1e1b3e[_0x78d7('0x2e')]);}else if(this['channels'][_0x1e1b3e['linkedid']]&&_['isUndefined'](this[_0x78d7('0x9')][_0x1e1b3e[_0x78d7('0x41')]][_0x78d7('0x3f')])){logger[_0x78d7('0x23')]('[%s][HANGUP:LINKEDID]',_0x1e1b3e[_0x78d7('0x41')]);this['startAcw'](_0x1e1b3e[_0x78d7('0x41')]);}}catch(_0x4c1523){logger[_0x78d7('0x32')]('[ACW][syncHangupRequest]\x20%s',_0x4c1523[_0x78d7('0x36')]);}};Acw['prototype'][_0x78d7('0xf')]=function(_0x2bea54){try{if(this[_0x78d7('0x9')][_0x2bea54['uniqueid']]&&this[_0x78d7('0x9')][_0x2bea54[_0x78d7('0x2e')]][_0x78d7('0x3f')]){logger['info'](_0x78d7('0x42'),_0x2bea54[_0x78d7('0x2e')]);this[_0x78d7('0x43')](_0x2bea54[_0x78d7('0x2e')]);}else if(this[_0x78d7('0x9')][_0x2bea54[_0x78d7('0x41')]]&&this[_0x78d7('0x9')][_0x2bea54[_0x78d7('0x41')]][_0x78d7('0x3f')]){logger['info'](_0x78d7('0x44'),_0x2bea54[_0x78d7('0x41')]);this[_0x78d7('0x43')](_0x2bea54['linkedid']);}}catch(_0x57ac3d){logger['error'](_0x78d7('0x45'),_0x57ac3d['message']);}};Acw['prototype']['syncAttendedTransfer']=function(_0xea7fc7){try{if(!_['isNil'](this['channels'][_0xea7fc7[_0x78d7('0x46')]])){this[_0x78d7('0x43')](_0xea7fc7[_0x78d7('0x46')]);if(this[_0x78d7('0x9')][_0xea7fc7['secondtransfereruniqueid']]){this['channels'][_0xea7fc7[_0x78d7('0x47')]][_0x78d7('0x3f')]=!![];this[_0x78d7('0x9')][_0xea7fc7[_0x78d7('0x48')]]=this[_0x78d7('0x9')][_0xea7fc7[_0x78d7('0x47')]];delete this[_0x78d7('0x9')][_0xea7fc7[_0x78d7('0x47')]];}}else if(!_[_0x78d7('0x49')](this['channels'][_0xea7fc7[_0x78d7('0x48')]])){this[_0x78d7('0x43')](_0xea7fc7[_0x78d7('0x48')]);if(this[_0x78d7('0x9')][_0xea7fc7[_0x78d7('0x4a')]]){this[_0x78d7('0x9')][_0xea7fc7[_0x78d7('0x4a')]][_0x78d7('0x3f')]=!![];this[_0x78d7('0x9')][_0xea7fc7['transfereeuniqueid']]=this[_0x78d7('0x9')][_0xea7fc7[_0x78d7('0x4a')]];delete this[_0x78d7('0x9')][_0xea7fc7[_0x78d7('0x4a')]];}}}catch(_0x47d467){logger[_0x78d7('0x32')](_0x78d7('0x4b'),_0x47d467[_0x78d7('0x36')]);}};Acw['prototype'][_0x78d7('0x14')]=function(_0x15748d){try{if(this[_0x78d7('0x9')][_0x15748d[_0x78d7('0x4c')]]){logger['info'](_0x78d7('0x4d'),JSON['stringify'](_0x15748d['transfereruniqueid']));this['startAcw'](_0x15748d['transfereruniqueid']);}else if(this[_0x78d7('0x9')][_0x15748d[_0x78d7('0x4e')]]){logger[_0x78d7('0x23')](_0x78d7('0x4f'),JSON['stringify'](_0x15748d[_0x78d7('0x4e')]));this['startAcw'](_0x15748d[_0x78d7('0x4e')]);}}catch(_0x3aab7c){logger[_0x78d7('0x32')](_0x78d7('0x50'),_0x3aab7c[_0x78d7('0x36')]);}};Acw[_0x78d7('0x18')][_0x78d7('0x11')]=function(_0x4f2571){try{if(this[_0x78d7('0x6')][_0x4f2571[_0x78d7('0x1a')]]&&this[_0x78d7('0x6')][_0x4f2571[_0x78d7('0x1a')]]['autopause']===_0x78d7('0x51')){if(this[_0x78d7('0x7')][_0x4f2571[_0x78d7('0x19')]]){logger[_0x78d7('0x23')](_0x78d7('0x52'),_0x4f2571[_0x78d7('0x2e')],_0x4f2571[_0x78d7('0x19')],_0x4f2571[_0x78d7('0x1a')]);return RpcUser[_0x78d7('0x26')](this['agents'][_0x4f2571[_0x78d7('0x19')]],'Auto-Pause',_0x4f2571[_0x78d7('0x2e')]);}}}catch(_0x26360c){logger['error']('[ACW][syncAgentRingNoAnswer]\x20%s',_0x26360c[_0x78d7('0x36')]);}};module['exports']=Acw; \ No newline at end of file +var _0x2fee=['acw','[ACW][syncAgentConnect]\x20%s','syncAgentConnectPreview','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','linkedid','[ACW][syncHangupRequest]\x20%s','syncHangup','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','isNil','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','syncAgentRingNoAnswer','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','savePause','Auto-Pause','exports','util','lodash','moment','../ami','../../../config/logger','../rpc/user','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','bind','hanguprequest','syncHangupRequest','agentringnoanswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','milliseconds','diff','prototype','startAcw','interface','ACW','mandatoryDisposition','name','mandatoryDispositionPause','QueuePause','then','info','attended','destlinkedid','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','stopAcw','lastPauseAt','YYYY-MM-DD\x20HH:mm:ss','uniqueid','queue','update','[%s][UPDATE][ACWTIME:%s]','catch','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','error','finally','[ACW][START]\x20%s','[%s][TIMER][STOP][AGENT:%s]','saveUnpause','[%s][UPDATE][ERRORS:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','message'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x2fee,0x116));var _0xe2fe=function(_0x575a31,_0x56336f){_0x575a31=_0x575a31-0x0;var _0x5d7dad=_0x2fee[_0x575a31];return _0x5d7dad;};'use strict';var util=require(_0xe2fe('0x0'));var _=require(_0xe2fe('0x1'));var moment=require(_0xe2fe('0x2'));var ami=require(_0xe2fe('0x3'));var logger=require(_0xe2fe('0x4'))('acw');var RpcUser=require(_0xe2fe('0x5'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');function Acw(_0x5dfb6a){this[_0xe2fe('0x6')]=_0x5dfb6a[_0xe2fe('0x6')];this[_0xe2fe('0x7')]=_0x5dfb6a[_0xe2fe('0x7')];this[_0xe2fe('0x8')]=_0x5dfb6a[_0xe2fe('0x8')];this[_0xe2fe('0x9')]={};ami['on'](_0xe2fe('0xa'),this[_0xe2fe('0xb')][_0xe2fe('0xc')](this));ami['on'](_0xe2fe('0xd'),this[_0xe2fe('0xe')]['bind'](this));ami['on']('hangup',this['syncHangup']['bind'](this));ami['on'](_0xe2fe('0xf'),this['syncAgentRingNoAnswer']['bind'](this));ami['on'](_0xe2fe('0x10'),this[_0xe2fe('0x11')][_0xe2fe('0xc')](this));ami['on'](_0xe2fe('0x12'),this[_0xe2fe('0x13')]['bind'](this));ami['on'](_0xe2fe('0x14'),this['syncAgentConnectPreview'][_0xe2fe('0xc')](this));}function getDiff(_0x43e4fe){var _0x2f225e=moment()[_0xe2fe('0x15')](0x0);var _0x4629ed=moment(_0x43e4fe)[_0xe2fe('0x15')](0x0);return _0x2f225e[_0xe2fe('0x16')](_0x4629ed,'seconds');}Acw[_0xe2fe('0x17')][_0xe2fe('0x18')]=function(_0x32dd79){try{var _0x3895d6=this;var _0x3df1b9=this[_0xe2fe('0x9')][_0x32dd79][_0xe2fe('0x19')];var _0x46ffb6=this[_0xe2fe('0x9')][_0x32dd79]['queue'];var _0x9af687=this[_0xe2fe('0x6')][_0x46ffb6];var _0x319d48=![];var _0x16e3d7=_0xe2fe('0x1a');if(_0x9af687[_0xe2fe('0x1b')]){if(_0x9af687['mandatoryDispositionPause'][_0xe2fe('0x1c')]){_0x319d48=!![];_0x16e3d7=_0x9af687[_0xe2fe('0x1d')][_0xe2fe('0x1c')];}}ami['Action']({'action':_0xe2fe('0x1e'),'interface':_0x3df1b9,'paused':!![],'reason':_0x16e3d7})[_0xe2fe('0x1f')](function(_0x4534c8){if(_0x3895d6[_0xe2fe('0x7')][_0x3df1b9]){return RpcUser['getAgent'](_0x3895d6[_0xe2fe('0x7')][_0x3df1b9]['id'])[_0xe2fe('0x1f')](function(_0x141543){if(_0x141543&&!_0x141543['voicePause']){logger[_0xe2fe('0x20')]('[%s][START][AGENT:%s][QUEUE:%s]',_0x32dd79,_0x3df1b9,_0x46ffb6);var _0x2c90eb=_0x3895d6[_0xe2fe('0x9')][_0x32dd79][_0xe2fe('0x21')]&&_0x3895d6['channels'][_0x32dd79]['destlinkedid']?_0x3895d6[_0xe2fe('0x9')][_0x32dd79][_0xe2fe('0x22')]:_0x32dd79;return RpcUser['savePause'](_0x3895d6['agents'][_0x3df1b9],_0x16e3d7,_0x2c90eb)[_0xe2fe('0x1f')](function(_0x9ba4c6){if(!_0x319d48){_0x3895d6[_0xe2fe('0x8')][_0x3df1b9]={};logger['info'](_0xe2fe('0x23'),_0x32dd79,_0x3895d6[_0xe2fe('0x6')][_0x46ffb6][_0xe2fe('0x24')],_0x3df1b9,_0x46ffb6);_0x3895d6[_0xe2fe('0x8')][_0x3df1b9][_0xe2fe('0x25')]=setTimeout(_0x3895d6[_0xe2fe('0x26')][_0xe2fe('0xc')](_0x3895d6,_0x3df1b9),_0x3895d6[_0xe2fe('0x6')][_0x46ffb6][_0xe2fe('0x24')]*0x3e8);_0x3895d6[_0xe2fe('0x8')][_0x3df1b9][_0xe2fe('0x27')]=moment()['format'](_0xe2fe('0x28'));_0x3895d6[_0xe2fe('0x8')][_0x3df1b9][_0xe2fe('0x29')]=_0x32dd79;_0x3895d6[_0xe2fe('0x8')][_0x3df1b9][_0xe2fe('0x2a')]=_0x46ffb6;_0x3895d6['timers'][_0x3df1b9]['updateAcw']=function(){var _0xf37fb9=getDiff(_0x3895d6['timers'][_0x3df1b9][_0xe2fe('0x27')]);clearTimeout(_0x3895d6[_0xe2fe('0x8')][_0x3df1b9][_0xe2fe('0x25')]);_0x3895d6[_0xe2fe('0x8')][_0x3df1b9][_0xe2fe('0x25')]=![];RpcVoiceAgentReport[_0xe2fe('0x2b')]({'acwtime':_0xf37fb9},_0x3895d6['timers'][_0x3df1b9]['uniqueid'],_0x3df1b9)[_0xe2fe('0x1f')](function(_0x132156){logger[_0xe2fe('0x20')](_0xe2fe('0x2c'),_0x32dd79,_0xf37fb9,_0x132156);})[_0xe2fe('0x2d')](function(_0x13d393){logger['error']('[%s][UPDATE][ERRORS:%s]',_0x32dd79,_0x13d393);});delete _0x3895d6['timers'][_0x3df1b9];};}});}else{logger[_0xe2fe('0x20')](_0xe2fe('0x2e'),_0x32dd79,_0x3df1b9,_0x46ffb6);}});}})[_0xe2fe('0x2d')](function(_0x5613ed){logger[_0xe2fe('0x2f')](_0xe2fe('0x23'),_0x32dd79,_0x3895d6[_0xe2fe('0x6')][_0x46ffb6][_0xe2fe('0x24')],_0x3df1b9,_0x46ffb6);})[_0xe2fe('0x30')](function(){delete _0x3895d6[_0xe2fe('0x9')][_0x32dd79];});}catch(_0x1e48d6){logger[_0xe2fe('0x2f')](_0xe2fe('0x31'),_0x1e48d6['message']);}};Acw[_0xe2fe('0x17')]['stopAcw']=function(_0xa5638d){try{var _0x4f04d6=this;if(_0x4f04d6[_0xe2fe('0x8')][_0xa5638d]){_0x4f04d6[_0xe2fe('0x8')][_0xa5638d][_0xe2fe('0x25')]=![];var _0x4bda75=_0x4f04d6['timers'][_0xa5638d][_0xe2fe('0x29')];var _0x35a729=_0x4f04d6[_0xe2fe('0x8')][_0xa5638d][_0xe2fe('0x2a')];var _0x232ee7=_0x4f04d6['voiceQueues'][_0x35a729][_0xe2fe('0x24')];logger['info'](_0xe2fe('0x32'),_0x4bda75,_0xa5638d);RpcUser[_0xe2fe('0x33')](this['agents'][_0xa5638d]);RpcVoiceAgentReport['update']({'acwtime':_0x232ee7,'agentacw':!![]},_0x4bda75,_0xa5638d)[_0xe2fe('0x1f')](function(_0x5a2e7e){logger[_0xe2fe('0x20')](_0xe2fe('0x2c'),_0x4bda75,_0x232ee7,_0x5a2e7e);})['catch'](function(_0x11cc6d){logger['error'](_0xe2fe('0x34'),_0x4bda75,_0x11cc6d);});}else{logger['error'](_0xe2fe('0x35'),_0xa5638d);if(_0x4f04d6[_0xe2fe('0x8')]){logger[_0xe2fe('0x20')](_0xe2fe('0x36'),JSON[_0xe2fe('0x37')](_0x4f04d6[_0xe2fe('0x8')]));}}}catch(_0x93cdb3){logger[_0xe2fe('0x2f')](_0xe2fe('0x38'),_0x93cdb3[_0xe2fe('0x39')]);}};Acw[_0xe2fe('0x17')][_0xe2fe('0xb')]=function(_0x3414eb){try{if(this[_0xe2fe('0x6')][_0x3414eb[_0xe2fe('0x2a')]]&&(this[_0xe2fe('0x6')][_0x3414eb[_0xe2fe('0x2a')]][_0xe2fe('0x3a')]||this['voiceQueues'][_0x3414eb[_0xe2fe('0x2a')]][_0xe2fe('0x1b')])){if(this[_0xe2fe('0x7')][_0x3414eb[_0xe2fe('0x19')]]){this[_0xe2fe('0x9')][_0x3414eb[_0xe2fe('0x29')]]={'queue':_0x3414eb['queue'],'interface':_0x3414eb['interface'],'destlinkedid':_0x3414eb[_0xe2fe('0x22')]};}}}catch(_0x2a23c8){logger[_0xe2fe('0x2f')](_0xe2fe('0x3b'),_0x2a23c8['message']);}};Acw[_0xe2fe('0x17')][_0xe2fe('0x3c')]=function(_0x28b276){try{if(this[_0xe2fe('0x6')][_0x28b276[_0xe2fe('0x2a')]]&&(this['voiceQueues'][_0x28b276[_0xe2fe('0x2a')]][_0xe2fe('0x3a')]||this[_0xe2fe('0x6')][_0x28b276[_0xe2fe('0x2a')]][_0xe2fe('0x1b')])){if(this[_0xe2fe('0x7')][_0x28b276[_0xe2fe('0x19')]]){this['channels'][_0x28b276[_0xe2fe('0x29')]]={'queue':_0x28b276[_0xe2fe('0x2a')],'interface':_0x28b276[_0xe2fe('0x19')]};}}}catch(_0x44ac08){logger[_0xe2fe('0x2f')](_0xe2fe('0x3d'),_0x44ac08[_0xe2fe('0x39')]);}};Acw[_0xe2fe('0x17')][_0xe2fe('0xe')]=function(_0x54c40f){try{if(this[_0xe2fe('0x9')][_0x54c40f['uniqueid']]&&_[_0xe2fe('0x3e')](this[_0xe2fe('0x9')][_0x54c40f[_0xe2fe('0x29')]][_0xe2fe('0x21')])){logger[_0xe2fe('0x20')]('[%s][HANGUP:UNIQUEID]',_0x54c40f[_0xe2fe('0x29')]);this[_0xe2fe('0x18')](_0x54c40f[_0xe2fe('0x29')]);}else if(this['channels'][_0x54c40f[_0xe2fe('0x3f')]]&&_[_0xe2fe('0x3e')](this['channels'][_0x54c40f[_0xe2fe('0x3f')]][_0xe2fe('0x21')])){logger[_0xe2fe('0x20')]('[%s][HANGUP:LINKEDID]',_0x54c40f[_0xe2fe('0x3f')]);this[_0xe2fe('0x18')](_0x54c40f['linkedid']);}}catch(_0x4d1476){logger[_0xe2fe('0x2f')](_0xe2fe('0x40'),_0x4d1476[_0xe2fe('0x39')]);}};Acw[_0xe2fe('0x17')][_0xe2fe('0x41')]=function(_0x430c10){try{if(this[_0xe2fe('0x9')][_0x430c10[_0xe2fe('0x29')]]&&this[_0xe2fe('0x9')][_0x430c10[_0xe2fe('0x29')]]['attended']){logger[_0xe2fe('0x20')]('[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]',_0x430c10[_0xe2fe('0x29')]);this[_0xe2fe('0x18')](_0x430c10[_0xe2fe('0x29')]);}else if(this[_0xe2fe('0x9')][_0x430c10['linkedid']]&&this[_0xe2fe('0x9')][_0x430c10[_0xe2fe('0x3f')]][_0xe2fe('0x21')]){logger[_0xe2fe('0x20')]('[%s][HANGUPATTENDEDTRANSFER:LINKEDID]',_0x430c10[_0xe2fe('0x3f')]);this[_0xe2fe('0x18')](_0x430c10[_0xe2fe('0x3f')]);}}catch(_0x267647){logger[_0xe2fe('0x2f')]('[ACW][syncHangup]\x20%s',_0x267647['message']);}};Acw[_0xe2fe('0x17')][_0xe2fe('0x11')]=function(_0x3d2ab9){try{if(!_['isNil'](this[_0xe2fe('0x9')][_0x3d2ab9['transfereeuniqueid']])){this['startAcw'](_0x3d2ab9[_0xe2fe('0x42')]);if(this[_0xe2fe('0x9')][_0x3d2ab9[_0xe2fe('0x43')]]){this['channels'][_0x3d2ab9[_0xe2fe('0x43')]]['attended']=!![];this[_0xe2fe('0x9')][_0x3d2ab9[_0xe2fe('0x44')]]=this[_0xe2fe('0x9')][_0x3d2ab9[_0xe2fe('0x43')]];delete this[_0xe2fe('0x9')][_0x3d2ab9[_0xe2fe('0x43')]];}}else if(!_[_0xe2fe('0x45')](this[_0xe2fe('0x9')][_0x3d2ab9[_0xe2fe('0x44')]])){this[_0xe2fe('0x18')](_0x3d2ab9['transfertargetuniqueid']);if(this['channels'][_0x3d2ab9[_0xe2fe('0x46')]]){this[_0xe2fe('0x9')][_0x3d2ab9[_0xe2fe('0x46')]][_0xe2fe('0x21')]=!![];this[_0xe2fe('0x9')][_0x3d2ab9['transfereeuniqueid']]=this[_0xe2fe('0x9')][_0x3d2ab9[_0xe2fe('0x46')]];delete this[_0xe2fe('0x9')][_0x3d2ab9[_0xe2fe('0x46')]];}}}catch(_0x1fcf4a){logger['error'](_0xe2fe('0x47'),_0x1fcf4a[_0xe2fe('0x39')]);}};Acw['prototype'][_0xe2fe('0x13')]=function(_0x2b6fa0){try{if(this[_0xe2fe('0x9')][_0x2b6fa0[_0xe2fe('0x48')]]){logger['info'](_0xe2fe('0x49'),JSON['stringify'](_0x2b6fa0['transfereruniqueid']));this[_0xe2fe('0x18')](_0x2b6fa0[_0xe2fe('0x48')]);}else if(this[_0xe2fe('0x9')][_0x2b6fa0[_0xe2fe('0x4a')]]){logger[_0xe2fe('0x20')](_0xe2fe('0x4b'),JSON[_0xe2fe('0x37')](_0x2b6fa0[_0xe2fe('0x4a')]));this[_0xe2fe('0x18')](_0x2b6fa0[_0xe2fe('0x4a')]);}}catch(_0x34ca62){logger[_0xe2fe('0x2f')](_0xe2fe('0x4c'),_0x34ca62[_0xe2fe('0x39')]);}};Acw[_0xe2fe('0x17')][_0xe2fe('0x4d')]=function(_0x748aa4){try{if(this[_0xe2fe('0x6')][_0x748aa4[_0xe2fe('0x2a')]]&&this[_0xe2fe('0x6')][_0x748aa4[_0xe2fe('0x2a')]][_0xe2fe('0x4e')]===_0xe2fe('0x4f')){if(this[_0xe2fe('0x7')][_0x748aa4[_0xe2fe('0x19')]]){logger['info'](_0xe2fe('0x50'),_0x748aa4['uniqueid'],_0x748aa4[_0xe2fe('0x19')],_0x748aa4[_0xe2fe('0x2a')]);return RpcUser[_0xe2fe('0x51')](this[_0xe2fe('0x7')][_0x748aa4[_0xe2fe('0x19')]],_0xe2fe('0x52'),_0x748aa4[_0xe2fe('0x29')]);}}}catch(_0x11e07c){logger[_0xe2fe('0x2f')]('[ACW][syncAgentRingNoAnswer]\x20%s',_0x11e07c[_0xe2fe('0x39')]);}};module[_0xe2fe('0x53')]=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index 80edce7..7153000 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 _0x3679=['username','password','Action','promisify','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','actionSipShowRegistry','actionDeviceStateList','devicestatelist','actionSipPeerStatus','actionQueueSummary','queuesummary','actionCoreShowChannels','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','shutdown','info','fullybooted','resolve','then','catch','log','exports','asterisk-manager','moment','util','lodash','../../config/logger','ami','../../config/environment','asterisk'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0x3679,0x174));var _0x9367=function(_0x22cb94,_0x150f16){_0x22cb94=_0x22cb94-0x0;var _0x231ed5=_0x3679[_0x22cb94];return _0x231ed5;};'use strict';var Manager=require(_0x9367('0x0'));var BPromise=require('bluebird');var moment=require(_0x9367('0x1'));var util=require(_0x9367('0x2'));var _=require(_0x9367('0x3'));var logger=require(_0x9367('0x4'))(_0x9367('0x5'));var config=require(_0x9367('0x6'));var ami=new Manager(config[_0x9367('0x7')]['port'],config['asterisk']['ip'],config['asterisk'][_0x9367('0x8')],config[_0x9367('0x7')][_0x9367('0x9')],!![]);ami['keepConnected']();ami[_0x9367('0xa')]=BPromise[_0x9367('0xb')](ami[_0x9367('0xc')]);function error(_0x269ecd){logger[_0x9367('0xd')](util[_0x9367('0xe')](_0x9367('0xf'),config[_0x9367('0x7')][_0x9367('0x8')],config['asterisk']['ip'],config[_0x9367('0x7')][_0x9367('0x10')],util[_0x9367('0x11')](_0x269ecd,![],null)));}function close(){logger[_0x9367('0xd')](util['format'](_0x9367('0x12'),config[_0x9367('0x7')][_0x9367('0x8')],config[_0x9367('0x7')]['ip'],config['asterisk']['port']));}ami[_0x9367('0x13')]=function(){return function(){return ami[_0x9367('0xa')]({'action':'sipshowregistry'});};};ami[_0x9367('0x14')]=function(){return function(){return ami[_0x9367('0xa')]({'action':_0x9367('0x15')});};};ami[_0x9367('0x16')]=function(){return function(){return ami[_0x9367('0xa')]({'action':'sippeerstatus'});};};ami[_0x9367('0x17')]=function(){return function(){return ami[_0x9367('0xa')]({'action':_0x9367('0x18')});};};ami[_0x9367('0x19')]=function(){return function(){return ami[_0x9367('0xa')]({'action':'coreshowchannels'});};};function connect(_0x19abac){logger['info'](util[_0x9367('0xe')](_0x9367('0x1a'),config['asterisk']['username'],config[_0x9367('0x7')]['ip'],config[_0x9367('0x7')]['port']));ami[_0x9367('0x1b')](_0x9367('0xd'),error);ami['once'](_0x9367('0x1c'),close);}ami['on'](_0x9367('0x1d'),connect);ami['on'](_0x9367('0x1e'),function(_0xc20d0a){logger[_0x9367('0x1f')](util[_0x9367('0xe')]('Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s',config[_0x9367('0x7')]['username'],config['asterisk']['ip'],config[_0x9367('0x7')][_0x9367('0x10')],util['inspect'](_0xc20d0a,![],null)));});ami['on'](_0x9367('0x20'),function(_0x2c7296){logger['info'](util[_0x9367('0xe')]('Fullybooted\x20\x22%s\x22\x20to\x20%s:%s',config[_0x9367('0x7')][_0x9367('0x8')],config[_0x9367('0x7')]['ip'],config[_0x9367('0x7')]['port']));return BPromise[_0x9367('0x21')]()['then'](ami[_0x9367('0x13')]())[_0x9367('0x22')](ami[_0x9367('0x14')]())[_0x9367('0x22')](ami[_0x9367('0x16')]())['then'](ami[_0x9367('0x17')]())[_0x9367('0x22')](ami[_0x9367('0x19')]())[_0x9367('0x23')](function(_0x2115dc){console[_0x9367('0x24')](_0x2115dc);});});ami[_0x9367('0x1b')](_0x9367('0xd'),error);ami[_0x9367('0x1b')](_0x9367('0x1c'),close);module[_0x9367('0x25')]=ami; \ No newline at end of file +var _0xdeb6=['lodash','ami','asterisk','port','username','password','keepConnected','Action','promisify','action','error','inspect','format','actionSipShowRegistry','sipshowregistry','actionDeviceStateList','devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','queuesummary','actionCoreShowChannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','connect','fullybooted','then','catch','log','asterisk-manager','bluebird','util'];(function(_0x3c9c45,_0x3134fe){var _0x3e5959=function(_0x2b4767){while(--_0x2b4767){_0x3c9c45['push'](_0x3c9c45['shift']());}};_0x3e5959(++_0x3134fe);}(_0xdeb6,0x81));var _0x6deb=function(_0x27a45d,_0x14499a){_0x27a45d=_0x27a45d-0x0;var _0x5aee32=_0xdeb6[_0x27a45d];return _0x5aee32;};'use strict';var Manager=require(_0x6deb('0x0'));var BPromise=require(_0x6deb('0x1'));var moment=require('moment');var util=require(_0x6deb('0x2'));var _=require(_0x6deb('0x3'));var logger=require('../../config/logger')(_0x6deb('0x4'));var config=require('../../config/environment');var ami=new Manager(config[_0x6deb('0x5')][_0x6deb('0x6')],config['asterisk']['ip'],config[_0x6deb('0x5')][_0x6deb('0x7')],config['asterisk'][_0x6deb('0x8')],!![]);ami[_0x6deb('0x9')]();ami[_0x6deb('0xa')]=BPromise[_0x6deb('0xb')](ami[_0x6deb('0xc')]);function error(_0x1fc3ae){logger[_0x6deb('0xd')](util['format']('Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s',config[_0x6deb('0x5')]['username'],config[_0x6deb('0x5')]['ip'],config[_0x6deb('0x5')][_0x6deb('0x6')],util[_0x6deb('0xe')](_0x1fc3ae,![],null)));}function close(){logger[_0x6deb('0xd')](util[_0x6deb('0xf')]('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config[_0x6deb('0x5')]['username'],config[_0x6deb('0x5')]['ip'],config['asterisk']['port']));}ami[_0x6deb('0x10')]=function(){return function(){return ami[_0x6deb('0xa')]({'action':_0x6deb('0x11')});};};ami[_0x6deb('0x12')]=function(){return function(){return ami[_0x6deb('0xa')]({'action':_0x6deb('0x13')});};};ami[_0x6deb('0x14')]=function(){return function(){return ami[_0x6deb('0xa')]({'action':_0x6deb('0x15')});};};ami[_0x6deb('0x16')]=function(){return function(){return ami['Action']({'action':_0x6deb('0x17')});};};ami[_0x6deb('0x18')]=function(){return function(){return ami[_0x6deb('0xa')]({'action':'coreshowchannels'});};};function connect(_0x36a3d5){logger[_0x6deb('0x19')](util[_0x6deb('0xf')](_0x6deb('0x1a'),config[_0x6deb('0x5')][_0x6deb('0x7')],config[_0x6deb('0x5')]['ip'],config[_0x6deb('0x5')][_0x6deb('0x6')]));ami[_0x6deb('0x1b')](_0x6deb('0xd'),error);ami[_0x6deb('0x1b')]('close',close);}ami['on'](_0x6deb('0x1c'),connect);ami['on']('shutdown',function(_0x43a2ae){logger[_0x6deb('0x19')](util[_0x6deb('0xf')]('Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s',config['asterisk'][_0x6deb('0x7')],config[_0x6deb('0x5')]['ip'],config[_0x6deb('0x5')][_0x6deb('0x6')],util[_0x6deb('0xe')](_0x43a2ae,![],null)));});ami['on'](_0x6deb('0x1d'),function(_0xe99393){logger[_0x6deb('0x19')](util[_0x6deb('0xf')]('Fullybooted\x20\x22%s\x22\x20to\x20%s:%s',config['asterisk'][_0x6deb('0x7')],config[_0x6deb('0x5')]['ip'],config[_0x6deb('0x5')][_0x6deb('0x6')]));return BPromise['resolve']()[_0x6deb('0x1e')](ami['actionSipShowRegistry']())['then'](ami[_0x6deb('0x12')]())[_0x6deb('0x1e')](ami['actionSipPeerStatus']())['then'](ami['actionQueueSummary']())[_0x6deb('0x1e')](ami['actionCoreShowChannels']())[_0x6deb('0x1f')](function(_0x79af7a){console[_0x6deb('0x20')](_0x79af7a);});});ami[_0x6deb('0x1b')](_0x6deb('0xd'),error);ami['once']('close',close);module['exports']=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index 1bac4e6..7ca6bb7 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(_0x1f2975,_0x4b7320){var _0x150c9b=function(_0x4dbcdf){while(--_0x4dbcdf){_0x1f2975['push'](_0x1f2975['shift']());}};_0x150c9b(++_0x4b7320);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x539709,_0x2c9edd){_0x539709=_0x539709-0x0;var _0x73cc7e=_0xbdb7[_0x539709];return _0x73cc7e;};'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 _0x0713=['rpc','memberReport','error','message','result','catch','exports','../../config/logger','ami','client','http','Request','request','then','debug'];(function(_0xaff72f,_0x4817e7){var _0x304a05=function(_0x154cc7){while(--_0x154cc7){_0xaff72f['push'](_0xaff72f['shift']());}};_0x304a05(++_0x4817e7);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var jayson=require('jayson/promise');var BPromise=require('bluebird');var logger=require(_0x3071('0x0'))(_0x3071('0x1'));var client=jayson[_0x3071('0x2')][_0x3071('0x3')]({'port':0x2329});client[_0x3071('0x4')]=function(_0x52b5fb,_0x2c547f){return new BPromise(function(_0x7b18a4,_0x33a70c){return client[_0x3071('0x5')](_0x52b5fb,_0x2c547f)[_0x3071('0x6')](function(_0x41cf76){logger[_0x3071('0x7')](_0x3071('0x8'),_0x3071('0x9'),_0x52b5fb,_0x2c547f,_0x41cf76);if(_0x41cf76[_0x3071('0xa')]){logger[_0x3071('0xa')](_0x3071('0x8'),_0x3071('0x9'),_0x52b5fb,_0x41cf76['error'][_0x3071('0xb')],_0x2c547f);return _0x33a70c(_0x41cf76[_0x3071('0xa')][_0x3071('0xb')]);}else{return _0x7b18a4(_0x41cf76[_0x3071('0xc')]);}})[_0x3071('0xd')](function(_0x4a470a){logger[_0x3071('0xa')](_0x3071('0x8'),_0x3071('0x9'),_0x52b5fb,_0x4a470a,_0x2c547f);return _0x33a70c(_0x4a470a);});});};module[_0x3071('0xe')]=client; \ No newline at end of file diff --git a/server/services/ami/dialer/action.js b/server/services/ami/dialer/action.js index 74b2174..4513fac 100644 --- a/server/services/ami/dialer/action.js +++ b/server/services/ami/dialer/action.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a06=['countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','prototype','getCaller','\x22%s\x22\x20<%s>','voiceQueue','dialCutDigit','substring','number','getQueue','queue','exports','util','lodash','moment','isNil','string','name','Contact','phone','firstName','lastName','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry'];(function(_0x762a11,_0x2867b3){var _0x4f6ca1=function(_0x5241f8){while(--_0x5241f8){_0x762a11['push'](_0x762a11['shift']());}};_0x4f6ca1(++_0x2867b3);}(_0x7a06,0x1df));var _0x67a0=function(_0x1e8b65,_0xc0f46e){_0x1e8b65=_0x1e8b65-0x0;var _0x496e5b=_0x7a06[_0x1e8b65];return _0x496e5b;};'use strict';var util=require(_0x67a0('0x0'));var _=require(_0x67a0('0x1'));var moment=require(_0x67a0('0x2'));function checkNameSurname(_0x1a0986,_0x53d5ca,_0x4c87e2){var _0x49e5bb='';if(!_[_0x67a0('0x3')](_0x53d5ca)&&_0x67a0('0x4')===typeof _0x53d5ca){_0x49e5bb+=_0x53d5ca;}if(!_[_0x67a0('0x3')](_0x4c87e2)&&_0x67a0('0x4')===typeof _0x4c87e2){_0x49e5bb+='\x20'+_0x4c87e2;}if(_0x49e5bb!==''){return _0x49e5bb;}return _0x1a0986;}function Action(_0x17f840,_0x17f8e7,_0xaac035){this['voiceQueue']=_0x17f840;this['uniqueid']=_0xaac035||undefined;this[_0x67a0('0x5')]=checkNameSurname(_0x17f8e7[_0x67a0('0x6')][_0x67a0('0x7')],_0x17f8e7[_0x67a0('0x6')][_0x67a0('0x8')],_0x17f8e7[_0x67a0('0x6')][_0x67a0('0x9')]);this['number']=_0x17f8e7[_0x67a0('0x6')][_0x67a0('0x7')];this['queue']=_0x17f840['name'];this['active']=_0x17f8e7[_0x67a0('0xa')]||![];this[_0x67a0('0xb')]=_0x17f840[_0x67a0('0xb')];this[_0x67a0('0xc')]=_0x17f840[_0x67a0('0xc')]||0x3;this[_0x67a0('0xd')]=_0x17f8e7[_0x67a0('0xd')];this[_0x67a0('0xe')]=_0x17f8e7[_0x67a0('0xe')];this[_0x67a0('0xf')]=_0x17f8e7[_0x67a0('0xf')];this[_0x67a0('0x10')]=_0x17f8e7['countnoanswerretry'];this[_0x67a0('0x11')]=_0x17f8e7[_0x67a0('0x11')];this[_0x67a0('0x12')]=_0x17f8e7['countdropretry'];this[_0x67a0('0x13')]=_0x17f8e7[_0x67a0('0x13')];this[_0x67a0('0x14')]=_0x17f8e7[_0x67a0('0x14')];this['countagentrejectretry']=_0x17f8e7[_0x67a0('0x15')];this[_0x67a0('0x16')]=_0x17f8e7[_0x67a0('0x16')];this['ListId']=_0x17f8e7['ListId'];this[_0x67a0('0x17')]=_0x17f8e7[_0x67a0('0x17')];this[_0x67a0('0x18')]=_0x17f8e7[_0x67a0('0x18')];this[_0x67a0('0x19')]=_0x17f8e7[_0x67a0('0x19')];this[_0x67a0('0x1a')]=_0x17f8e7['id'];this[_0x67a0('0x1b')]=_0x17f8e7['Contact'][_0x67a0('0x8')]||'';this[_0x67a0('0x1c')]=moment()[_0x67a0('0x1d')](_0x67a0('0x1e'));this[_0x67a0('0x1f')]=_0x17f8e7['callback'];this[_0x67a0('0x20')]=_0x17f8e7['callbackuniqueid'];this[_0x67a0('0x21')]=_0x17f8e7['callbackat'];this['recallme']=_0x17f8e7[_0x67a0('0x22')];this['originatecalleridnum']='';this['originatecalleridname']='';}Action[_0x67a0('0x23')][_0x67a0('0x24')]=function(){return util[_0x67a0('0x1d')](_0x67a0('0x25'),this[_0x67a0('0x5')],this[_0x67a0('0x26')][_0x67a0('0x27')]>0x0?this['number'][_0x67a0('0x28')](this[_0x67a0('0x26')][_0x67a0('0x27')]):this[_0x67a0('0x29')]);};Action[_0x67a0('0x23')][_0x67a0('0x2a')]=function(){return this[_0x67a0('0x2b')];};module[_0x67a0('0x2c')]=Action; \ No newline at end of file +var _0xc10d=['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','moment','isNil','string','voiceQueue','uniqueid','name','Contact','phone','firstName','lastName','number','queue','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry'];(function(_0x380e75,_0x486360){var _0x444d96=function(_0x32c8f8){while(--_0x32c8f8){_0x380e75['push'](_0x380e75['shift']());}};_0x444d96(++_0x486360);}(_0xc10d,0xd1));var _0xdc10=function(_0x223c0d,_0x3ec04d){_0x223c0d=_0x223c0d-0x0;var _0x207827=_0xc10d[_0x223c0d];return _0x207827;};'use strict';var util=require(_0xdc10('0x0'));var _=require('lodash');var moment=require(_0xdc10('0x1'));function checkNameSurname(_0x2dc288,_0x3e2386,_0x2e93b1){var _0x135a46='';if(!_[_0xdc10('0x2')](_0x3e2386)&&_0xdc10('0x3')===typeof _0x3e2386){_0x135a46+=_0x3e2386;}if(!_['isNil'](_0x2e93b1)&&_0xdc10('0x3')===typeof _0x2e93b1){_0x135a46+='\x20'+_0x2e93b1;}if(_0x135a46!==''){return _0x135a46;}return _0x2dc288;}function Action(_0x2a5104,_0x3a5ff6,_0x4fe9d){this[_0xdc10('0x4')]=_0x2a5104;this[_0xdc10('0x5')]=_0x4fe9d||undefined;this[_0xdc10('0x6')]=checkNameSurname(_0x3a5ff6[_0xdc10('0x7')][_0xdc10('0x8')],_0x3a5ff6[_0xdc10('0x7')][_0xdc10('0x9')],_0x3a5ff6['Contact'][_0xdc10('0xa')]);this[_0xdc10('0xb')]=_0x3a5ff6[_0xdc10('0x7')][_0xdc10('0x8')];this[_0xdc10('0xc')]=_0x2a5104['name'];this['active']=_0x3a5ff6['active']||![];this[_0xdc10('0xd')]=_0x2a5104['type'];this[_0xdc10('0xe')]=_0x2a5104[_0xdc10('0xe')]||0x3;this[_0xdc10('0xf')]=_0x3a5ff6[_0xdc10('0xf')];this[_0xdc10('0x10')]=_0x3a5ff6['countbusyretry'];this[_0xdc10('0x11')]=_0x3a5ff6['countcongestionretry'];this[_0xdc10('0x12')]=_0x3a5ff6[_0xdc10('0x12')];this[_0xdc10('0x13')]=_0x3a5ff6[_0xdc10('0x13')];this[_0xdc10('0x14')]=_0x3a5ff6['countdropretry'];this['countabandonedretry']=_0x3a5ff6[_0xdc10('0x15')];this[_0xdc10('0x16')]=_0x3a5ff6[_0xdc10('0x16')];this[_0xdc10('0x17')]=_0x3a5ff6[_0xdc10('0x17')];this[_0xdc10('0x18')]=_0x3a5ff6[_0xdc10('0x18')];this['ListId']=_0x3a5ff6[_0xdc10('0x19')];this[_0xdc10('0x1a')]=_0x3a5ff6[_0xdc10('0x1a')];this[_0xdc10('0x1b')]=_0x3a5ff6[_0xdc10('0x1b')];this[_0xdc10('0x1c')]=_0x3a5ff6[_0xdc10('0x1c')];this[_0xdc10('0x1d')]=_0x3a5ff6['id'];this[_0xdc10('0x1e')]=_0x3a5ff6[_0xdc10('0x7')][_0xdc10('0x9')]||'';this[_0xdc10('0x1f')]=moment()[_0xdc10('0x20')](_0xdc10('0x21'));this['callback']=_0x3a5ff6[_0xdc10('0x22')];this[_0xdc10('0x23')]=_0x3a5ff6[_0xdc10('0x23')];this[_0xdc10('0x24')]=_0x3a5ff6[_0xdc10('0x24')];this[_0xdc10('0x25')]=_0x3a5ff6['recallme'];this[_0xdc10('0x26')]='';this[_0xdc10('0x27')]='';}Action[_0xdc10('0x28')][_0xdc10('0x29')]=function(){return util[_0xdc10('0x20')](_0xdc10('0x2a'),this[_0xdc10('0x6')],this[_0xdc10('0x4')][_0xdc10('0x2b')]>0x0?this[_0xdc10('0xb')]['substring'](this[_0xdc10('0x4')][_0xdc10('0x2b')]):this[_0xdc10('0xb')]);};Action[_0xdc10('0x28')][_0xdc10('0x2c')]=function(){return this[_0xdc10('0xc')];};module[_0xdc10('0x2d')]=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/agentComplete.js b/server/services/ami/dialer/agentComplete.js index e648347..91caa78 100644 --- a/server/services/ami/dialer/agentComplete.js +++ b/server/services/ami/dialer/agentComplete.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf500=['answertime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','endtime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','moment','milliseconds','diff','seconds','state','Answer','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','countmachineretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime'];(function(_0x10bcc4,_0x4400e2){var _0x2da988=function(_0x2ee849){while(--_0x2ee849){_0x10bcc4['push'](_0x10bcc4['shift']());}};_0x2da988(++_0x4400e2);}(_0xf500,0x9a));var _0x0f50=function(_0x50e593,_0x3ae998){_0x50e593=_0x50e593-0x0;var _0x3821d0=_0xf500[_0x50e593];return _0x3821d0;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x0f50('0x0'));function getSeconds(_0xcb7afc,_0x3ef919){var _0x27ce55=moment(_0xcb7afc)[_0x0f50('0x1')](0x0);var _0x335478=moment(_0x3ef919)['milliseconds'](0x0);return _0x27ce55[_0x0f50('0x2')](_0x335478,_0x0f50('0x3'));}function AgentComplete(_0x397c0b,_0x3ce2f2){this[_0x0f50('0x4')]=0x4;this['statedesc']=_0x0f50('0x5');this['scheduledat']=_0x397c0b['scheduledat'];this[_0x0f50('0x6')]=_0x397c0b[_0x0f50('0x6')];this[_0x0f50('0x7')]=_0x397c0b['type']===_0x0f50('0x8')?_0x0f50('0x9'):_0x397c0b[_0x0f50('0x6')];this[_0x0f50('0xa')]=_0x397c0b[_0x0f50('0xa')];this['countcongestionretry']=_0x397c0b[_0x0f50('0xb')];this[_0x0f50('0xc')]=_0x397c0b[_0x0f50('0xc')];this[_0x0f50('0xd')]=_0x397c0b[_0x0f50('0xa')]+_0x397c0b[_0x0f50('0xb')]+_0x397c0b[_0x0f50('0xc')]+_0x397c0b[_0x0f50('0xe')]+_0x397c0b[_0x0f50('0xf')]+_0x397c0b[_0x0f50('0x10')]+_0x397c0b['countmachineretry']+_0x397c0b[_0x0f50('0x11')];this['countnosuchnumberretry']=_0x397c0b['countnosuchnumberretry'];this[_0x0f50('0xf')]=_0x397c0b[_0x0f50('0xf')];this[_0x0f50('0x10')]=_0x397c0b[_0x0f50('0x10')];this['countmachineretry']=_0x397c0b[_0x0f50('0x12')];this['countagentrejectretry']=_0x397c0b['countagentrejectretry'];this[_0x0f50('0x13')]=_0x3ce2f2[_0x0f50('0x13')];this[_0x0f50('0x14')]=_0x397c0b[_0x0f50('0x15')];this[_0x0f50('0x16')]=_0x397c0b[_0x0f50('0x17')];this[_0x0f50('0x18')]=_0x397c0b[_0x0f50('0x18')];this[_0x0f50('0x19')]=_0x397c0b[_0x0f50('0x19')];this[_0x0f50('0x1a')]=_0x397c0b[_0x0f50('0x1a')];this['endtime']=moment()[_0x0f50('0x1b')](_0x0f50('0x1c'));this[_0x0f50('0x1d')]=getSeconds(_0x397c0b[_0x0f50('0x19')],_0x397c0b[_0x0f50('0x18')]);this[_0x0f50('0x1e')]=getSeconds(_0x397c0b['answertime'],_0x397c0b[_0x0f50('0x19')]);this[_0x0f50('0x1f')]=getSeconds(this[_0x0f50('0x20')],_0x397c0b[_0x0f50('0x1a')]);this['queue']=_0x3ce2f2['queue'];this['membername']=_0x3ce2f2[_0x0f50('0x21')];this[_0x0f50('0x22')]=_0x3ce2f2['reason'];this[_0x0f50('0x23')]=_0x397c0b['callback'];this[_0x0f50('0x24')]=_0x397c0b['callbackuniqueid'];this[_0x0f50('0x25')]=_0x397c0b['callbackat'];this[_0x0f50('0x26')]=_0x397c0b['recallme'];this[_0x0f50('0x27')]=_0x397c0b[_0x0f50('0x27')];this['ListId']=_0x397c0b['ListId'];this['UserId']=_0x397c0b[_0x0f50('0x28')];this['VoiceQueueId']=_0x397c0b[_0x0f50('0x29')];this[_0x0f50('0x2a')]=_0x397c0b[_0x0f50('0x2a')];this[_0x0f50('0x2b')]=_0x397c0b[_0x0f50('0x2b')]||'';this[_0x0f50('0x2c')]=_0x397c0b[_0x0f50('0x2c')]||'';}module['exports']=AgentComplete; \ No newline at end of file +var _0x30b9=['format','YYYY-MM-DD\x20HH:mm:ss','ringtime','talktime','endtime','queue','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','state','statedesc','Answer','type','campaigntype','outbound','countbusyretry','countnoanswerretry','countglobal','countcongestionretry','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','answertime'];(function(_0x1bf8cc,_0x118778){var _0x322d20=function(_0x36953d){while(--_0x36953d){_0x1bf8cc['push'](_0x1bf8cc['shift']());}};_0x322d20(++_0x118778);}(_0x30b9,0xd4));var _0x930b=function(_0xf58cf1,_0x3de748){_0xf58cf1=_0xf58cf1-0x0;var _0x107e99=_0x30b9[_0xf58cf1];return _0x107e99;};'use strict';var util=require(_0x930b('0x0'));var _=require(_0x930b('0x1'));var moment=require(_0x930b('0x2'));function getSeconds(_0x3d303b,_0x348f09){var _0x300927=moment(_0x3d303b)[_0x930b('0x3')](0x0);var _0x5ec2f0=moment(_0x348f09)[_0x930b('0x3')](0x0);return _0x300927[_0x930b('0x4')](_0x5ec2f0,_0x930b('0x5'));}function AgentComplete(_0x1be127,_0x290a8d){this[_0x930b('0x6')]=0x4;this[_0x930b('0x7')]=_0x930b('0x8');this['scheduledat']=_0x1be127['scheduledat'];this[_0x930b('0x9')]=_0x1be127[_0x930b('0x9')];this[_0x930b('0xa')]=_0x1be127[_0x930b('0x9')]===_0x930b('0xb')?'queue':_0x1be127[_0x930b('0x9')];this['countbusyretry']=_0x1be127[_0x930b('0xc')];this['countcongestionretry']=_0x1be127['countcongestionretry'];this[_0x930b('0xd')]=_0x1be127[_0x930b('0xd')];this[_0x930b('0xe')]=_0x1be127['countbusyretry']+_0x1be127[_0x930b('0xf')]+_0x1be127[_0x930b('0xd')]+_0x1be127[_0x930b('0x10')]+_0x1be127[_0x930b('0x11')]+_0x1be127['countabandonedretry']+_0x1be127[_0x930b('0x12')]+_0x1be127[_0x930b('0x13')];this[_0x930b('0x10')]=_0x1be127[_0x930b('0x10')];this[_0x930b('0x11')]=_0x1be127[_0x930b('0x11')];this['countabandonedretry']=_0x1be127['countabandonedretry'];this[_0x930b('0x12')]=_0x1be127[_0x930b('0x12')];this['countagentrejectretry']=_0x1be127[_0x930b('0x13')];this[_0x930b('0x14')]=_0x290a8d['uniqueid'];this[_0x930b('0x15')]=_0x1be127[_0x930b('0x16')];this[_0x930b('0x17')]=_0x1be127[_0x930b('0x18')];this[_0x930b('0x19')]=_0x1be127['starttime'];this[_0x930b('0x1a')]=_0x1be127[_0x930b('0x1a')];this[_0x930b('0x1b')]=_0x1be127[_0x930b('0x1b')];this['endtime']=moment()[_0x930b('0x1c')](_0x930b('0x1d'));this[_0x930b('0x1e')]=getSeconds(_0x1be127[_0x930b('0x1a')],_0x1be127[_0x930b('0x19')]);this['holdtime']=getSeconds(_0x1be127[_0x930b('0x1b')],_0x1be127[_0x930b('0x1a')]);this[_0x930b('0x1f')]=getSeconds(this[_0x930b('0x20')],_0x1be127[_0x930b('0x1b')]);this[_0x930b('0x21')]=_0x290a8d[_0x930b('0x21')];this['membername']=_0x290a8d[_0x930b('0x22')];this[_0x930b('0x23')]=_0x290a8d[_0x930b('0x23')];this[_0x930b('0x24')]=_0x1be127[_0x930b('0x24')];this[_0x930b('0x25')]=_0x1be127[_0x930b('0x25')];this[_0x930b('0x26')]=_0x1be127['callbackat'];this[_0x930b('0x27')]=_0x1be127[_0x930b('0x27')];this[_0x930b('0x28')]=_0x1be127['ContactId'];this['ListId']=_0x1be127[_0x930b('0x29')];this[_0x930b('0x2a')]=_0x1be127[_0x930b('0x2a')];this[_0x930b('0x2b')]=_0x1be127[_0x930b('0x2b')];this[_0x930b('0x2c')]=_0x1be127[_0x930b('0x2c')];this[_0x930b('0x2d')]=_0x1be127[_0x930b('0x2d')]||'';this[_0x930b('0x2e')]=_0x1be127[_0x930b('0x2e')]||'';}module[_0x930b('0x2f')]=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/final.js b/server/services/ami/dialer/final.js index c861006..09dd411 100644 --- a/server/services/ami/dialer/final.js +++ b/server/services/ami/dialer/final.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbd50=['countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','uniqueid','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry'];(function(_0x5f309e,_0x66e31){var _0x487b5e=function(_0x44f203){while(--_0x44f203){_0x5f309e['push'](_0x5f309e['shift']());}};_0x487b5e(++_0x66e31);}(_0xbd50,0x196));var _0x0bd5=function(_0x2a64cd,_0x351e77){_0x2a64cd=_0x2a64cd-0x0;var _0x1ff227=_0xbd50[_0x2a64cd];return _0x1ff227;};'use strict';var util=require(_0x0bd5('0x0'));var _=require(_0x0bd5('0x1'));var moment=require(_0x0bd5('0x2'));function getSeconds(_0x4acbd6,_0x44fcb9){var _0x167372=moment(_0x4acbd6)[_0x0bd5('0x3')](0x0);var _0x1e9877=moment(_0x44fcb9)[_0x0bd5('0x3')](0x0);return _0x167372['diff'](_0x1e9877,'seconds');}function Final(_0x560cf1){this[_0x0bd5('0x4')]=_0x560cf1[_0x0bd5('0x4')];this[_0x0bd5('0x5')]=_0x560cf1[_0x0bd5('0x5')];this[_0x0bd5('0x6')]=_0x560cf1['type'];this['campaigntype']=_0x560cf1[_0x0bd5('0x6')]===_0x0bd5('0x7')?_0x0bd5('0x8'):_0x560cf1['type'];this[_0x0bd5('0x9')]=_0x560cf1[_0x0bd5('0x9')];this['countcongestionretry']=_0x560cf1[_0x0bd5('0xa')];this[_0x0bd5('0xb')]=_0x560cf1['countnoanswerretry'];this[_0x0bd5('0xc')]=_0x560cf1[_0x0bd5('0x9')]+_0x560cf1[_0x0bd5('0xa')]+_0x560cf1['countnoanswerretry']+_0x560cf1[_0x0bd5('0xd')]+_0x560cf1[_0x0bd5('0xe')]+_0x560cf1[_0x0bd5('0xf')]+_0x560cf1[_0x0bd5('0x10')]+_0x560cf1[_0x0bd5('0x11')];this[_0x0bd5('0xd')]=_0x560cf1[_0x0bd5('0xd')];this[_0x0bd5('0xe')]=_0x560cf1['countdropretry'];this[_0x0bd5('0xf')]=_0x560cf1[_0x0bd5('0xf')];this['countmachineretry']=_0x560cf1[_0x0bd5('0x10')];this[_0x0bd5('0x11')]=_0x560cf1[_0x0bd5('0x11')];this[_0x0bd5('0x8')]=_0x560cf1['queue'];this[_0x0bd5('0x12')]=_0x560cf1[_0x0bd5('0x12')];this[_0x0bd5('0x13')]=_0x560cf1[_0x0bd5('0x13')];this[_0x0bd5('0x14')]=_0x560cf1[_0x0bd5('0x14')];this[_0x0bd5('0x15')]=_0x560cf1[_0x0bd5('0x15')];this[_0x0bd5('0x16')]=_0x560cf1[_0x0bd5('0x15')];this[_0x0bd5('0x17')]=_0x560cf1[_0x0bd5('0x17')]||0x0;this[_0x0bd5('0x18')]=_0x560cf1[_0x0bd5('0x18')]||0x0;this['talktime']=_0x560cf1['talktime']||0x0;this['callback']=_0x560cf1['callback'];this['callbackuniqueid']=_0x560cf1[_0x0bd5('0x19')];this[_0x0bd5('0x1a')]=_0x560cf1[_0x0bd5('0x1a')];this[_0x0bd5('0x1b')]=_0x560cf1[_0x0bd5('0x1b')];this['ContactId']=_0x560cf1[_0x0bd5('0x1c')];this[_0x0bd5('0x1d')]=_0x560cf1[_0x0bd5('0x1d')];this['UserId']=_0x560cf1[_0x0bd5('0x1e')];this['VoiceQueueId']=_0x560cf1['VoiceQueueId'];this[_0x0bd5('0x1f')]=_0x560cf1[_0x0bd5('0x1f')];this[_0x0bd5('0x20')]=_0x560cf1['originatecalleridnum']||'';this[_0x0bd5('0x21')]=_0x560cf1['originatecalleridname']||'';}module[_0x0bd5('0x22')]=Final; \ No newline at end of file +var _0xf3be=['util','lodash','moment','seconds','uniqueid','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname'];(function(_0x254fc9,_0x180ec9){var _0x2b0e1f=function(_0x3154fe){while(--_0x3154fe){_0x254fc9['push'](_0x254fc9['shift']());}};_0x2b0e1f(++_0x180ec9);}(_0xf3be,0x1e1));var _0xef3b=function(_0x3ba01d,_0x2d9545){_0x3ba01d=_0x3ba01d-0x0;var _0x585a30=_0xf3be[_0x3ba01d];return _0x585a30;};'use strict';var util=require(_0xef3b('0x0'));var _=require(_0xef3b('0x1'));var moment=require(_0xef3b('0x2'));function getSeconds(_0x17b458,_0x4d8b04){var _0x373397=moment(_0x17b458)['milliseconds'](0x0);var _0x56b691=moment(_0x4d8b04)['milliseconds'](0x0);return _0x373397['diff'](_0x56b691,_0xef3b('0x3'));}function Final(_0x40dd26){this['uniqueid']=_0x40dd26[_0xef3b('0x4')];this[_0xef3b('0x5')]=_0x40dd26[_0xef3b('0x5')];this[_0xef3b('0x6')]=_0x40dd26[_0xef3b('0x6')];this[_0xef3b('0x7')]=_0x40dd26['type']==='outbound'?_0xef3b('0x8'):_0x40dd26['type'];this[_0xef3b('0x9')]=_0x40dd26[_0xef3b('0x9')];this[_0xef3b('0xa')]=_0x40dd26['countcongestionretry'];this[_0xef3b('0xb')]=_0x40dd26['countnoanswerretry'];this[_0xef3b('0xc')]=_0x40dd26[_0xef3b('0x9')]+_0x40dd26[_0xef3b('0xa')]+_0x40dd26[_0xef3b('0xb')]+_0x40dd26[_0xef3b('0xd')]+_0x40dd26[_0xef3b('0xe')]+_0x40dd26[_0xef3b('0xf')]+_0x40dd26[_0xef3b('0x10')]+_0x40dd26[_0xef3b('0x11')];this[_0xef3b('0xd')]=_0x40dd26['countnosuchnumberretry'];this['countdropretry']=_0x40dd26[_0xef3b('0xe')];this[_0xef3b('0xf')]=_0x40dd26[_0xef3b('0xf')];this[_0xef3b('0x10')]=_0x40dd26[_0xef3b('0x10')];this['countagentrejectretry']=_0x40dd26[_0xef3b('0x11')];this[_0xef3b('0x8')]=_0x40dd26[_0xef3b('0x8')];this[_0xef3b('0x12')]=_0x40dd26[_0xef3b('0x12')];this['calleridnum']=_0x40dd26[_0xef3b('0x13')];this[_0xef3b('0x14')]=_0x40dd26['starttime'];this[_0xef3b('0x15')]=_0x40dd26['responsetime'];this[_0xef3b('0x16')]=_0x40dd26['responsetime'];this[_0xef3b('0x17')]=_0x40dd26[_0xef3b('0x17')]||0x0;this[_0xef3b('0x18')]=_0x40dd26[_0xef3b('0x18')]||0x0;this[_0xef3b('0x19')]=_0x40dd26[_0xef3b('0x19')]||0x0;this[_0xef3b('0x1a')]=_0x40dd26[_0xef3b('0x1a')];this['callbackuniqueid']=_0x40dd26[_0xef3b('0x1b')];this[_0xef3b('0x1c')]=_0x40dd26[_0xef3b('0x1c')];this[_0xef3b('0x1d')]=_0x40dd26[_0xef3b('0x1d')];this[_0xef3b('0x1e')]=_0x40dd26['ContactId'];this[_0xef3b('0x1f')]=_0x40dd26['ListId'];this['UserId']=_0x40dd26[_0xef3b('0x20')];this[_0xef3b('0x21')]=_0x40dd26[_0xef3b('0x21')];this[_0xef3b('0x22')]=_0x40dd26[_0xef3b('0x22')];this[_0xef3b('0x23')]=_0x40dd26['originatecalleridnum']||'';this['originatecalleridname']=_0x40dd26[_0xef3b('0x24')]||'';}module['exports']=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/hangup.js b/server/services/ami/dialer/hangup.js index 63bdc1f..dd924a9 100644 --- a/server/services/ami/dialer/hangup.js +++ b/server/services/ami/dialer/hangup.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf34d=['state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','countdropretry','uniqueid','calleridnum','number','starttime','responsetime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','endtime','membername','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','util','moment','milliseconds','seconds'];(function(_0x1d5e59,_0x25e29){var _0x2a0113=function(_0x1ddf2f){while(--_0x1ddf2f){_0x1d5e59['push'](_0x1d5e59['shift']());}};_0x2a0113(++_0x25e29);}(_0xf34d,0x7d));var _0xdf34=function(_0x3ad1eb,_0x10183d){_0x3ad1eb=_0x3ad1eb-0x0;var _0xd99147=_0xf34d[_0x3ad1eb];return _0xd99147;};'use strict';var util=require(_0xdf34('0x0'));var _=require('lodash');var moment=require(_0xdf34('0x1'));function getSeconds(_0x43d02c,_0x555156){var _0x3cb15b=moment(_0x43d02c)[_0xdf34('0x2')](0x0);var _0x513193=moment(_0x555156)[_0xdf34('0x2')](0x0);return _0x3cb15b['diff'](_0x513193,_0xdf34('0x3'));}function Hangup(_0x1c42c8,_0x5d627c){this[_0xdf34('0x4')]=0x4;this[_0xdf34('0x5')]=_0xdf34('0x6');this[_0xdf34('0x7')]=_0x1c42c8[_0xdf34('0x7')];this['type']=_0x1c42c8[_0xdf34('0x8')];this[_0xdf34('0x9')]=_0x1c42c8[_0xdf34('0x8')]===_0xdf34('0xa')?_0xdf34('0xb'):_0x1c42c8['type'];this[_0xdf34('0xc')]=_0x1c42c8[_0xdf34('0xc')];this[_0xdf34('0xd')]=_0x1c42c8[_0xdf34('0xd')];this[_0xdf34('0xe')]=_0x1c42c8[_0xdf34('0xe')];this[_0xdf34('0xf')]=_0x1c42c8[_0xdf34('0xc')]+_0x1c42c8[_0xdf34('0xd')]+_0x1c42c8[_0xdf34('0xe')]+_0x1c42c8[_0xdf34('0x10')]+_0x1c42c8['countdropretry']+_0x1c42c8[_0xdf34('0x11')]+_0x1c42c8[_0xdf34('0x12')]+_0x1c42c8[_0xdf34('0x13')];this[_0xdf34('0x10')]=_0x1c42c8['countnosuchnumberretry'];this[_0xdf34('0x14')]=_0x1c42c8['countdropretry'];this[_0xdf34('0x11')]=_0x1c42c8[_0xdf34('0x11')];this[_0xdf34('0x12')]=_0x1c42c8[_0xdf34('0x12')];this[_0xdf34('0x13')]=_0x1c42c8[_0xdf34('0x13')];this[_0xdf34('0x15')]=_0x5d627c[_0xdf34('0x15')];this['calleridname']=_0x1c42c8['name'];this[_0xdf34('0x16')]=_0x1c42c8[_0xdf34('0x17')];this[_0xdf34('0x18')]=_0x1c42c8[_0xdf34('0x18')];this[_0xdf34('0x19')]=_0x1c42c8['responsetime'];this['endtime']=moment()[_0xdf34('0x1a')](_0xdf34('0x1b'));this[_0xdf34('0x1c')]=getSeconds(_0x1c42c8[_0xdf34('0x19')],_0x1c42c8[_0xdf34('0x18')]);this[_0xdf34('0x1d')]=0x0;this[_0xdf34('0x1e')]=getSeconds(this[_0xdf34('0x1f')],_0x1c42c8[_0xdf34('0x19')]);this[_0xdf34('0xb')]=_0x1c42c8[_0xdf34('0xb')];this[_0xdf34('0x20')]='IVR';this['reason']=_0x5d627c[_0xdf34('0x21')];this[_0xdf34('0x22')]=_0x1c42c8[_0xdf34('0x22')];this[_0xdf34('0x23')]=_0x1c42c8[_0xdf34('0x23')];this[_0xdf34('0x24')]=_0x1c42c8['callbackat'];this[_0xdf34('0x25')]=_0x1c42c8[_0xdf34('0x25')];this[_0xdf34('0x26')]=_0x1c42c8[_0xdf34('0x26')];this[_0xdf34('0x27')]=_0x1c42c8['ListId'];this[_0xdf34('0x28')]=_0x1c42c8['UserId'];this[_0xdf34('0x29')]=_0x1c42c8['VoiceQueueId'];this[_0xdf34('0x2a')]=_0x1c42c8[_0xdf34('0x2a')];}module['exports']=Hangup; \ No newline at end of file +var _0x65d2=['format','YYYY-MM-DD\x20HH:mm:ss','talktime','membername','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','util','lodash','moment','milliseconds','diff','seconds','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','name','calleridnum','number','starttime','responsetime','endtime'];(function(_0x382353,_0x1ece1e){var _0xf42fa9=function(_0x399b28){while(--_0x399b28){_0x382353['push'](_0x382353['shift']());}};_0xf42fa9(++_0x1ece1e);}(_0x65d2,0xc0));var _0x265d=function(_0xfa9f0a,_0x4c3d00){_0xfa9f0a=_0xfa9f0a-0x0;var _0x2c1437=_0x65d2[_0xfa9f0a];return _0x2c1437;};'use strict';var util=require(_0x265d('0x0'));var _=require(_0x265d('0x1'));var moment=require(_0x265d('0x2'));function getSeconds(_0x249d45,_0x483ef9){var _0x57111f=moment(_0x249d45)[_0x265d('0x3')](0x0);var _0x187559=moment(_0x483ef9)[_0x265d('0x3')](0x0);return _0x57111f[_0x265d('0x4')](_0x187559,_0x265d('0x5'));}function Hangup(_0x48de36,_0x4e595b){this['state']=0x4;this[_0x265d('0x6')]=_0x265d('0x7');this[_0x265d('0x8')]=_0x48de36[_0x265d('0x8')];this[_0x265d('0x9')]=_0x48de36['type'];this[_0x265d('0xa')]=_0x48de36['type']===_0x265d('0xb')?_0x265d('0xc'):_0x48de36[_0x265d('0x9')];this[_0x265d('0xd')]=_0x48de36[_0x265d('0xd')];this['countcongestionretry']=_0x48de36[_0x265d('0xe')];this['countnoanswerretry']=_0x48de36['countnoanswerretry'];this['countglobal']=_0x48de36[_0x265d('0xd')]+_0x48de36[_0x265d('0xe')]+_0x48de36[_0x265d('0xf')]+_0x48de36[_0x265d('0x10')]+_0x48de36[_0x265d('0x11')]+_0x48de36[_0x265d('0x12')]+_0x48de36[_0x265d('0x13')]+_0x48de36[_0x265d('0x14')];this[_0x265d('0x10')]=_0x48de36['countnosuchnumberretry'];this[_0x265d('0x11')]=_0x48de36[_0x265d('0x11')];this[_0x265d('0x12')]=_0x48de36['countabandonedretry'];this[_0x265d('0x13')]=_0x48de36[_0x265d('0x13')];this['countagentrejectretry']=_0x48de36['countagentrejectretry'];this['uniqueid']=_0x4e595b[_0x265d('0x15')];this['calleridname']=_0x48de36[_0x265d('0x16')];this[_0x265d('0x17')]=_0x48de36[_0x265d('0x18')];this[_0x265d('0x19')]=_0x48de36[_0x265d('0x19')];this[_0x265d('0x1a')]=_0x48de36[_0x265d('0x1a')];this[_0x265d('0x1b')]=moment()[_0x265d('0x1c')](_0x265d('0x1d'));this['ringtime']=getSeconds(_0x48de36[_0x265d('0x1a')],_0x48de36[_0x265d('0x19')]);this['holdtime']=0x0;this[_0x265d('0x1e')]=getSeconds(this['endtime'],_0x48de36[_0x265d('0x1a')]);this[_0x265d('0xc')]=_0x48de36[_0x265d('0xc')];this[_0x265d('0x1f')]='IVR';this[_0x265d('0x20')]=_0x4e595b[_0x265d('0x21')];this[_0x265d('0x22')]=_0x48de36[_0x265d('0x22')];this[_0x265d('0x23')]=_0x48de36[_0x265d('0x23')];this[_0x265d('0x24')]=_0x48de36[_0x265d('0x24')];this['recallme']=_0x48de36[_0x265d('0x25')];this[_0x265d('0x26')]=_0x48de36[_0x265d('0x26')];this['ListId']=_0x48de36[_0x265d('0x27')];this[_0x265d('0x28')]=_0x48de36[_0x265d('0x28')];this[_0x265d('0x29')]=_0x48de36[_0x265d('0x29')];this['CampaignId']=_0x48de36[_0x265d('0x2a')];}module[_0x265d('0x2b')]=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/history.js b/server/services/ami/dialer/history.js index 895bafd..11cfa1f 100644 --- a/server/services/ami/dialer/history.js +++ b/server/services/ami/dialer/history.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x6e91=['countagentrejectretry','calleridname','name','number','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','uniqueid','scheduledat','type','campaigntype','outbound','queue','countcongestionretry','countnoanswerretry','countglobal','countbusyretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry'];(function(_0x499cc3,_0x3ba407){var _0xb05cdc=function(_0x384244){while(--_0x384244){_0x499cc3['push'](_0x499cc3['shift']());}};_0xb05cdc(++_0x3ba407);}(_0x6e91,0x15e));var _0x16e9=function(_0x2635dd,_0x30fe09){_0x2635dd=_0x2635dd-0x0;var _0x42da48=_0x6e91[_0x2635dd];return _0x42da48;};'use strict';var util=require(_0x16e9('0x0'));var _=require(_0x16e9('0x1'));var moment=require(_0x16e9('0x2'));function getSeconds(_0xce3671,_0x593a18){var _0x5b9172=moment(_0xce3671)[_0x16e9('0x3')](0x0);var _0x429ff8=moment(_0x593a18)[_0x16e9('0x3')](0x0);return _0x5b9172[_0x16e9('0x4')](_0x429ff8,'seconds');}function History(_0x6cff2a){this['uniqueid']=_0x6cff2a[_0x16e9('0x5')];this[_0x16e9('0x6')]=_0x6cff2a[_0x16e9('0x6')]||undefined;this[_0x16e9('0x7')]=_0x6cff2a[_0x16e9('0x7')];this[_0x16e9('0x8')]=_0x6cff2a['type']===_0x16e9('0x9')?_0x16e9('0xa'):_0x6cff2a[_0x16e9('0x7')];this['countbusyretry']=_0x6cff2a['countbusyretry'];this[_0x16e9('0xb')]=_0x6cff2a[_0x16e9('0xb')];this[_0x16e9('0xc')]=_0x6cff2a[_0x16e9('0xc')];this[_0x16e9('0xd')]=_0x6cff2a[_0x16e9('0xe')]+_0x6cff2a['countcongestionretry']+_0x6cff2a['countnoanswerretry']+_0x6cff2a[_0x16e9('0xf')]+_0x6cff2a[_0x16e9('0x10')]+_0x6cff2a[_0x16e9('0x11')]+_0x6cff2a[_0x16e9('0x12')]+_0x6cff2a[_0x16e9('0x13')];this[_0x16e9('0xf')]=_0x6cff2a['countnosuchnumberretry'];this[_0x16e9('0x10')]=_0x6cff2a[_0x16e9('0x10')];this[_0x16e9('0x11')]=_0x6cff2a[_0x16e9('0x11')];this['countmachineretry']=_0x6cff2a[_0x16e9('0x12')];this['countagentrejectretry']=_0x6cff2a[_0x16e9('0x13')];this[_0x16e9('0xa')]=_0x6cff2a[_0x16e9('0xa')];this[_0x16e9('0x14')]=_0x6cff2a[_0x16e9('0x15')];this['calleridnum']=_0x6cff2a[_0x16e9('0x16')];this[_0x16e9('0x17')]=_0x6cff2a['starttime'];this[_0x16e9('0x18')]=_0x6cff2a['responsetime'];this[_0x16e9('0x19')]=_0x6cff2a[_0x16e9('0x18')];this[_0x16e9('0x1a')]=getSeconds(_0x6cff2a[_0x16e9('0x18')],_0x6cff2a[_0x16e9('0x17')]);this[_0x16e9('0x1b')]=0x0;this[_0x16e9('0x1c')]=0x0;this[_0x16e9('0x1d')]=_0x6cff2a[_0x16e9('0x1d')];this[_0x16e9('0x1e')]=_0x6cff2a[_0x16e9('0x1e')];this[_0x16e9('0x1f')]=_0x6cff2a[_0x16e9('0x1f')];this[_0x16e9('0x20')]=_0x6cff2a[_0x16e9('0x20')];this[_0x16e9('0x21')]=_0x6cff2a[_0x16e9('0x21')];this[_0x16e9('0x22')]=_0x6cff2a['ListId'];this[_0x16e9('0x23')]=_0x6cff2a[_0x16e9('0x23')];this[_0x16e9('0x24')]=_0x6cff2a[_0x16e9('0x24')];this[_0x16e9('0x25')]=_0x6cff2a[_0x16e9('0x25')];this[_0x16e9('0x26')]=_0x6cff2a[_0x16e9('0x26')]||'';this[_0x16e9('0x27')]=_0x6cff2a[_0x16e9('0x27')]||'';}module[_0x16e9('0x28')]=History; \ No newline at end of file +var _0x2fef=['ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countabandonedretry','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','calleridname','number','starttime','endtime','responsetime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme'];(function(_0x18be08,_0x1329bc){var _0x5cdf81=function(_0x5ced79){while(--_0x5ced79){_0x18be08['push'](_0x18be08['shift']());}};_0x5cdf81(++_0x1329bc);}(_0x2fef,0x1dc));var _0xf2fe=function(_0x30861a,_0x337deb){_0x30861a=_0x30861a-0x0;var _0xa37ad6=_0x2fef[_0x30861a];return _0xa37ad6;};'use strict';var util=require(_0xf2fe('0x0'));var _=require('lodash');var moment=require(_0xf2fe('0x1'));function getSeconds(_0x154c74,_0x5c8376){var _0x932bb7=moment(_0x154c74)[_0xf2fe('0x2')](0x0);var _0x32f9eb=moment(_0x5c8376)[_0xf2fe('0x2')](0x0);return _0x932bb7[_0xf2fe('0x3')](_0x32f9eb,_0xf2fe('0x4'));}function History(_0x2f54f2){this[_0xf2fe('0x5')]=_0x2f54f2[_0xf2fe('0x5')];this['scheduledat']=_0x2f54f2[_0xf2fe('0x6')]||undefined;this[_0xf2fe('0x7')]=_0x2f54f2['type'];this[_0xf2fe('0x8')]=_0x2f54f2['type']===_0xf2fe('0x9')?'queue':_0x2f54f2[_0xf2fe('0x7')];this['countbusyretry']=_0x2f54f2[_0xf2fe('0xa')];this['countcongestionretry']=_0x2f54f2[_0xf2fe('0xb')];this[_0xf2fe('0xc')]=_0x2f54f2[_0xf2fe('0xc')];this[_0xf2fe('0xd')]=_0x2f54f2[_0xf2fe('0xa')]+_0x2f54f2[_0xf2fe('0xb')]+_0x2f54f2[_0xf2fe('0xc')]+_0x2f54f2['countnosuchnumberretry']+_0x2f54f2['countdropretry']+_0x2f54f2[_0xf2fe('0xe')]+_0x2f54f2['countmachineretry']+_0x2f54f2['countagentrejectretry'];this['countnosuchnumberretry']=_0x2f54f2[_0xf2fe('0xf')];this['countdropretry']=_0x2f54f2[_0xf2fe('0x10')];this[_0xf2fe('0xe')]=_0x2f54f2['countabandonedretry'];this[_0xf2fe('0x11')]=_0x2f54f2[_0xf2fe('0x11')];this[_0xf2fe('0x12')]=_0x2f54f2['countagentrejectretry'];this['queue']=_0x2f54f2['queue'];this[_0xf2fe('0x13')]=_0x2f54f2['name'];this['calleridnum']=_0x2f54f2[_0xf2fe('0x14')];this[_0xf2fe('0x15')]=_0x2f54f2[_0xf2fe('0x15')];this['responsetime']=_0x2f54f2['responsetime'];this[_0xf2fe('0x16')]=_0x2f54f2[_0xf2fe('0x17')];this[_0xf2fe('0x18')]=getSeconds(_0x2f54f2[_0xf2fe('0x17')],_0x2f54f2[_0xf2fe('0x15')]);this[_0xf2fe('0x19')]=0x0;this[_0xf2fe('0x1a')]=0x0;this['callback']=_0x2f54f2[_0xf2fe('0x1b')];this[_0xf2fe('0x1c')]=_0x2f54f2[_0xf2fe('0x1c')];this['callbackat']=_0x2f54f2[_0xf2fe('0x1d')];this[_0xf2fe('0x1e')]=_0x2f54f2[_0xf2fe('0x1e')];this[_0xf2fe('0x1f')]=_0x2f54f2[_0xf2fe('0x1f')];this[_0xf2fe('0x20')]=_0x2f54f2[_0xf2fe('0x20')];this['UserId']=_0x2f54f2[_0xf2fe('0x21')];this[_0xf2fe('0x22')]=_0x2f54f2[_0xf2fe('0x22')];this[_0xf2fe('0x23')]=_0x2f54f2[_0xf2fe('0x23')];this[_0xf2fe('0x24')]=_0x2f54f2['originatecalleridnum']||'';this[_0xf2fe('0x25')]=_0x2f54f2[_0xf2fe('0x25')]||'';}module[_0xf2fe('0x26')]=History; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index e56d2e4..7028cfd 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 _0x3ce4=['command','iftime\x20%s,%s','interval','timezones','content','indexOf','true','Action','all','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','\x20Interval\x20is\x20overtime:\x20','checkDialMethod','progressive','handlePower','dialPowerLevel','predictive','Queue','method\x20not\x20recognized','launchHandleIvr','handleIvr','checkIsTrunkReachable','dialGlobalInterval','dialTimezone','[syncQueueSummary]','[syncCampaigns]','\x5cw{0,','pow','replace','random','match','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','Contact','phone','contact\x20is\x20undefine','\x22agi://%s/square,%s\x22','NONE','dialQueueOptions','dialQueueTimeout','getCaller','xcally-motion-dialer','XMD-AMDINITIALSILENCE','XMD-AMDGREETING','dialAMDGreeting','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDMaximumNumberOfWords','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','createdAt','updatedAt','XMD-','toUpper','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','callerid','originatecalleridname','originatecalleridnum','dialPrefix','SIP/%s/%s%s','substring','dialCutDigit','from-sip','dialOriginateTimeout','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','responsetime','getQueue','response','callProgressDetecting','checkRetriveMax','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','[rescheduleContact][NoSuchNumber]','dialAbandonedMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','[callProgressDetecting]','evt\x20is\x20undefine','custom:agentnosuchnumber','nosuchnumber','reason\x200\x20no\x20such\x20number....','NoAnswer','custom:agentnoanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','Busy','custom:agentbusy','busy','dialBusyMaxRetry','reason\x205\x20busy','Congestion','custom:agentcongestion','congestion','reason\x208\x20congestion','reason\x2011\x20abandoned','outboundRejectCallsDay','AgentReject','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','dialAgentRejectMaxRetry','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','floor','predictiveIntervalMultiplicativeFactor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','started\x20in\x20predictive\x20at','getDataPredictive','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20more\x20than\x20threshold\x20(','abandonmentRate','agentBusyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','loggedIn','outboundQueuePauses','[CatchErlangB]','busyFactor','startMethodPredictive','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','booked','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','[booked][checkContactBlack][else]','[unlockOriginate][syncQueueStatusComplete]','Agent','dialRecallInQueue','RECALLINQUEUE','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','outboundBlacklistCallsDay','Blacklist','[Originate][MoveBlacklist]','inBlackList','limitCalls','dialOrderByScheduledAt','[getContactCampaign2][Empty]','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','Contact.phone','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','[getContactDialer2]','tryOriginatePredictive','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','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','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','util','bluebird','moment','md5','ioredis','../preview/util/util','../../../config/environment/','dialer','../../../config/logger','predictiveCalls','syncQueueSummary','redis','defaults','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/voiceQueueRt','./history','./final','./agentComplete','./queueCallerAbandon','./hangup','env','XCALLY_IP_AGI','rrmemory','prototype','enqueue','tail','finally','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','contactsId','uniqueId','optionPredictive','ivrOriginated','queueBooked','queueBookedRR','agentconnect','queuecallerabandon','bind','originateresponse','syncOriginateResponse','agentcomplete','custom:queuesummary','hangup','newexten','queuemember','syncQueueMember','queuestatuscomplete','loopCampaigns','loopClearZombieChannels','message','AGENTS_NOT_LOGGED','name','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','\x20NOT\x20Active','Interval','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Intervals','isEmpty','[ifTime][Action]','Error','stringify','milliseconds','diff','emit','type','outbound','strategy','answered','available','sumBillable','sumDuration','sumHoldTime','talking','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','startPredictive','Trunk','format','voice_queue:save','ivr','campaign:ivr:%s','campaign:save','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgHoldtime','---------------------------','isUndefined','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCallToSecond','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','startProgressive','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','inspect','stack','error','length','originated','undefined','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','RESCHEDULED_CONTACTS','contacts','AVAILABLE_CONTACTS_FINISHED','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Queue:\x20','IS_DISACTIVED','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','statedesc','endtime','[uniqueid]','clearZombieChannels','actions','[actions]','isNil','status','channel','catch','No\x20such\x20channel','updateOriginated','[Dialer][checkChannel]','queue','[Dialer][checkChannel][ivr]','countReScheduled','resolve','[countReScheduled]\x20','then','checkIsBlackList','[checkIsBlackList]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','unlockContact','[unlockContact]\x20','getContactDialer','temp','[getContactDialer]\x20','getVoiceQueueRtPauses','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','merge','pick','ContactId','ListId','UserId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','[emptyContact]','isSuccess','Success','isTrunkReachable','active','SIP/%s','reachable','syncVarSet','uniqueid','variable','amdstatus','exten','value','HANGUP','state','HangupInAMD','custom:amd','buildObj','amd','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','dialAMDActive','Machine','membername','AMD','countmachineretry','countglobal','[syncAgentComplete][createHistory][0]','countbusyretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','dialGlobalMaxRetry','stateGlobal','reason19\x20machine....','dialMachineMaxRetry','createStateFinal','reason\x2019\x20machine....','add','minutes','YYYY-MM-DD\x20HH:mm:ss','[rescheduleContact][Machine]','saveInDb','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','MACHINE','countcongestionretry','dialMachineRetryFrequency','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AnswerAGI','AGI','outboundUnknownCallsDay','syncAgentComplete','reason','agent','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','[syncAgentComplete]','syncAgentConnect','answertime','[syncQueueCallerAbandon]\x20[Drop]','droptime','Drop','dropreason','TIMEOUT','dialQueueProject2','dialDropMaxRetry','queueCallerAbandonCreateState','dialDropRetryFrequency','[rescheduleContact][Drop]','starttime','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','Abandoned','CALLEREXIT','dialAbandonedRetryFrequency','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','syncNewExten','actionid','locked','paused','stateinterface','push','idHopper','queueStatusComplete','[unlockQueueStatus][undefined]','syncQueueStatusComplete','roundrobin','run','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','[booked][RR][finaly]','[booked][unlock]','[booked][unlock2]','[unlock3][syncQueueStatusComplete]','syncCampaigns','TrunkBackup','TRUNK_IS_NOT_REACHABLE','checkIfTime','ifTime','checkIfTimeIntervals','Failure','\x20Intervals\x20is\x20null\x20','\x20Intervals\x20is\x20empty\x20','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','isArray'];(function(_0xdc90aa,_0xff8075){var _0x3bae4d=function(_0x3547b7){while(--_0x3547b7){_0xdc90aa['push'](_0xdc90aa['shift']());}};_0x3bae4d(++_0xff8075);}(_0x3ce4,0xcb));var _0x43ce=function(_0x1da527,_0x2dc953){_0x1da527=_0x1da527-0x0;var _0x40fc7c=_0x3ce4[_0x1da527];return _0x40fc7c;};'use strict';var util=require(_0x43ce('0x0'));var _=require('lodash');var BPromise=require(_0x43ce('0x1'));var uuid=require('uuid');var moment=require(_0x43ce('0x2'));var rr=require('rr');var md5=require(_0x43ce('0x3'));var Redis=require(_0x43ce('0x4'));var ut=require(_0x43ce('0x5'));var config=require(_0x43ce('0x6'));var logger=require('../../../config/logger')(_0x43ce('0x7'));var loggerBooked=require(_0x43ce('0x8'))('booked');var loggerPredictive=require(_0x43ce('0x8'))('predictive');var loggerPredictiveCalls=require(_0x43ce('0x8'))(_0x43ce('0x9'));var loggerSyncQueueSummary=require(_0x43ce('0x8'))(_0x43ce('0xa'));var ami=require('../ami');config[_0x43ce('0xb')]=_[_0x43ce('0xc')](config[_0x43ce('0xb')],{'host':_0x43ce('0xd'),'port':0x18eb});var io=require(_0x43ce('0xe'))(new Redis(config[_0x43ce('0xb')]));var cmHopper=require(_0x43ce('0xf'));var cmHopperHistory=require(_0x43ce('0x10'));var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require(_0x43ce('0x11'));var Action=require('./action');var History=require(_0x43ce('0x12'));var Final=require(_0x43ce('0x13'));var AgentComplete=require(_0x43ce('0x14'));var QueueCallerAbandon=require(_0x43ce('0x15'));var Hangup=require(_0x43ce('0x16'));var ipAgi=process[_0x43ce('0x17')][_0x43ce('0x18')]||'127.0.0.1';var strategy={'rrmemory':_0x43ce('0x19'),'roundrobin':'roundrobin'};var Sequence=function(){};Sequence[_0x43ce('0x1a')][_0x43ce('0x1b')]=function(_0x179886){this['tail']=this[_0x43ce('0x1c')]?this[_0x43ce('0x1c')][_0x43ce('0x1d')](_0x179886):_0x179886();};function Dialer(_0x437d0a,_0x3812a6){this[_0x43ce('0x1e')]=new Sequence();this[_0x43ce('0x1f')]=_0x3812a6;this[_0x43ce('0x20')]=_0x437d0a[_0x43ce('0x20')];this[_0x43ce('0x21')]=_0x437d0a[_0x43ce('0x21')];this[_0x43ce('0x22')]=_0x437d0a[_0x43ce('0x22')];this[_0x43ce('0x23')]=_0x437d0a[_0x43ce('0x23')];this[_0x43ce('0x24')]=config[_0x43ce('0x24')]||0x2;this['channels']={};this['actions']={};this[_0x43ce('0x25')]={};this[_0x43ce('0x26')]={};this[_0x43ce('0x27')]={};this['startPredictive']={};this['startProgressive']={};this[_0x43ce('0x28')]={};this[_0x43ce('0x29')]={};this[_0x43ce('0x2a')]={};ami['on'](_0x43ce('0x2b'),this['syncAgentConnect']['bind'](this));ami['on'](_0x43ce('0x2c'),this['syncQueueCallerAbandon'][_0x43ce('0x2d')](this));ami['on'](_0x43ce('0x2e'),this[_0x43ce('0x2f')][_0x43ce('0x2d')](this));ami['on'](_0x43ce('0x30'),this['syncAgentComplete']['bind'](this));ami['on'](_0x43ce('0x31'),this[_0x43ce('0xa')][_0x43ce('0x2d')](this));ami['on'](_0x43ce('0x32'),this['syncHangup'][_0x43ce('0x2d')](this));ami['on'](_0x43ce('0x33'),this['syncNewExten'][_0x43ce('0x2d')](this));ami['on']('varset',this['syncVarSet'][_0x43ce('0x2d')](this));ami['on'](_0x43ce('0x34'),this[_0x43ce('0x35')][_0x43ce('0x2d')](this));ami['on'](_0x43ce('0x36'),this['syncQueueStatusComplete'][_0x43ce('0x2d')](this));this[_0x43ce('0x37')]();this[_0x43ce('0x38')]();}function isNotNull(_0x2fdfd9){return _0x2fdfd9!==null&&!_['isUndefined'](_0x2fdfd9);}function checkIsLoggedIn(_0x382c71,_0x102fbe){return function(){if(_0x102fbe<=0x0){_0x382c71[_0x43ce('0x39')]=_0x43ce('0x3a');throw _0x382c71[_0x43ce('0x3b')]+_0x43ce('0x3c');}};}function isActive(_0x3f0b60){return _0x3f0b60;}function checkIsActive(_0x4c44cb,_0x1b86cf){return function(){if(!isActive(_0x1b86cf)){_0x4c44cb['message']=_0x43ce('0x3d');throw _0x4c44cb[_0x43ce('0x3b')]+_0x43ce('0x3e');}};}function checkInterval(_0x42e262){return function(){if(!isNotNull(_0x42e262[_0x43ce('0x3f')])){_0x42e262[_0x43ce('0x39')]=_0x43ce('0x40');throw _0x42e262['name']+_0x43ce('0x41');}if(!isNotNull(_0x42e262[_0x43ce('0x3f')][_0x43ce('0x42')])){_0x42e262[_0x43ce('0x39')]=_0x43ce('0x40');throw _0x42e262[_0x43ce('0x3b')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_[_0x43ce('0x43')](_0x42e262['Interval'][_0x43ce('0x42')]))){_0x42e262[_0x43ce('0x39')]='INTERVAL_IS_NULL';throw _0x42e262[_0x43ce('0x3b')]+'\x20INTERVAL_IS_NULL';}};}function msgResponse(_0x5317e8,_0x2c5185,_0x41ff8e){return{'action':_0x5317e8,'response':_0x2c5185,'message':_0x41ff8e,'stack':_0x41ff8e};}function myreject(_0x9bf462){return function(_0x377c1d){return _0x9bf462(msgResponse(_0x43ce('0x44'),_0x43ce('0x45'),JSON[_0x43ce('0x46')](_0x377c1d)));};}function getSeconds(_0x4269a5,_0x5b2275){var _0x5065fe=moment(_0x4269a5)[_0x43ce('0x47')](0x0);var _0x1f8f9d=moment(_0x5b2275)[_0x43ce('0x47')](0x0);return _0x5065fe[_0x43ce('0x48')](_0x1f8f9d,'seconds');}function emit(_0x2b8d06,_0x1ea683,_0x50556c){io['to'](_0x2b8d06)[_0x43ce('0x49')](_0x1ea683,_0x50556c);}function emitVoiceQueueSummary(_0x4fc856){if(_0x4fc856[_0x43ce('0x4a')]===_0x43ce('0x4b')){var _0x256f9a={'id':_0x4fc856['id'],'name':_0x4fc856[_0x43ce('0x3b')],'strategy':_0x4fc856[_0x43ce('0x4c')],'answered':_0x4fc856[_0x43ce('0x4d')],'available':_0x4fc856[_0x43ce('0x4e')],'loggedIn':_0x4fc856['loggedIn'],'pTalking':_0x4fc856['pTalking'],'sumBillable':_0x4fc856[_0x43ce('0x4f')],'sumDuration':_0x4fc856[_0x43ce('0x50')],'sumHoldTime':_0x4fc856[_0x43ce('0x51')]||0x0,'talking':_0x4fc856[_0x43ce('0x52')],'total':_0x4fc856['total'],'type':_0x4fc856[_0x43ce('0x4a')],'unmanaged':_0x4fc856[_0x43ce('0x53')],'abandoned':_0x4fc856[_0x43ce('0x54')],'waiting':_0x4fc856[_0x43ce('0x55')],'loggedInDb':_0x4fc856[_0x43ce('0x56')],'dialActive':_0x4fc856[_0x43ce('0x57')],'dialMethod':_0x4fc856[_0x43ce('0x58')],'dialOriginateCallerIdName':_0x4fc856[_0x43ce('0x59')],'dialOriginateCallerIdNumber':_0x4fc856['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x4fc856['dialOriginateTimeout'],'dialPrefix':_0x4fc856['dialPrefix'],'outboundAnswerAgiCallsDay':_0x4fc856[_0x43ce('0x5a')],'outboundAnswerCallsDay':_0x4fc856[_0x43ce('0x5b')],'outboundBlacklistCallsDay':_0x4fc856['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x4fc856[_0x43ce('0x5c')],'outboundCongestionCallsDay':_0x4fc856[_0x43ce('0x5d')],'outboundDropCallsDayACS':_0x4fc856[_0x43ce('0x5e')],'outboundDropCallsDayCallersExit':_0x4fc856[_0x43ce('0x5f')],'outboundDropCallsDayTimeout':_0x4fc856[_0x43ce('0x60')],'outboundNoAnswerCallsDay':_0x4fc856[_0x43ce('0x61')],'outboundNoSuchCallsDay':_0x4fc856[_0x43ce('0x62')],'outboundOriginateFailureCallsDay':_0x4fc856[_0x43ce('0x63')],'outboundReCallsDay':_0x4fc856[_0x43ce('0x64')],'outboundRejectCallsDay':_0x4fc856['outboundRejectCallsDay'],'outboundUnknownCallsDay':_0x4fc856['outboundUnknownCallsDay'],'predictiveIntervalAnsweredCalls':_0x4fc856[_0x43ce('0x65')],'predictiveIntervalAvgHoldtime':_0x4fc856['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x4fc856[_0x43ce('0x66')],'predictiveIntervalDroppedCallsCallersExit':_0x4fc856[_0x43ce('0x67')],'predictiveIntervalDroppedCallsTimeout':_0x4fc856[_0x43ce('0x68')],'predictiveIntervalErlangCalls':_0x4fc856['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x4fc856[_0x43ce('0x69')],'predictiveIntervalHitRate':_0x4fc856[_0x43ce('0x6a')],'predictiveIntervalMultiplicativeFactor':_0x4fc856['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x4fc856[_0x43ce('0x6b')],'predictiveIntervalAvailable':_0x4fc856[_0x43ce('0x6c')],'predictiveIntervalTotalCalls':_0x4fc856[_0x43ce('0x6d')],'message':_0x4fc856['message'],'originated':_0x4fc856['originated'],'erlangCalls':_0x4fc856[_0x43ce('0x6e')],'erlangCallToSecond':_0x4fc856['erlangCallToSecond'],'erlangAbandonmentRate':_0x4fc856[_0x43ce('0x6f')],'erlangBusyFactor':_0x4fc856[_0x43ce('0x70')],'startPredictive':_0x4fc856[_0x43ce('0x71')],'startProgressive':_0x4fc856['startProgressive']};if(_0x4fc856['Trunk']){_0x256f9a[_0x43ce('0x72')]={'id':_0x4fc856[_0x43ce('0x72')]['id'],'name':_0x4fc856[_0x43ce('0x72')][_0x43ce('0x3b')],'active':_0x4fc856[_0x43ce('0x72')]['active'],'callerid':_0x4fc856[_0x43ce('0x72')]['callerid']};}if(_0x4fc856[_0x43ce('0x3f')]){_0x256f9a[_0x43ce('0x3f')]={'id':_0x4fc856[_0x43ce('0x3f')]['id'],'name':_0x4fc856[_0x43ce('0x3f')][_0x43ce('0x3b')]};}var _0x282040=md5(JSON[_0x43ce('0x46')](_0x256f9a));if(_0x4fc856[_0x43ce('0x3')]!==_0x282040){_0x4fc856[_0x43ce('0x3')]=_0x282040;emit(util[_0x43ce('0x73')]('voice:queue:%s',_0x256f9a[_0x43ce('0x3b')]),_0x43ce('0x74'),_0x256f9a);}}}function emitCampaignSummary(_0x654e7c){if(_0x654e7c[_0x43ce('0x4a')]===_0x43ce('0x75')){emit(util[_0x43ce('0x73')](_0x43ce('0x76'),_0x654e7c[_0x43ce('0x3b')]),_0x43ce('0x77'),_0x654e7c);}}function checkGetDataPredictive(_0x3656fc){if(isNotNull(_0x3656fc)&&!_[_0x43ce('0x43')](_0x3656fc)){loggerPredictive[_0x43ce('0x78')](_0x43ce('0x79'));loggerPredictive[_0x43ce('0x78')](_0x43ce('0x7a'),_0x3656fc[_0x43ce('0x6d')]);loggerPredictive[_0x43ce('0x78')]('Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3656fc['predictiveIntervalAnsweredCalls']);loggerPredictive['info'](_0x43ce('0x7b'),_0x3656fc[_0x43ce('0x68')]);loggerPredictive[_0x43ce('0x78')](_0x43ce('0x7c'),_0x3656fc['predictiveIntervalDroppedCallsCallersExit']);loggerPredictive[_0x43ce('0x78')]('AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3656fc[_0x43ce('0x7d')]);loggerPredictive[_0x43ce('0x78')]('AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3656fc[_0x43ce('0x66')]);loggerPredictive[_0x43ce('0x78')](_0x43ce('0x7e'));if(_0x3656fc[_0x43ce('0x6d')]>0x0){if(!_[_0x43ce('0x7f')](_0x3656fc[_0x43ce('0x66')])&&_0x3656fc[_0x43ce('0x66')]>0x0){return!![];}loggerPredictive[_0x43ce('0x78')]('Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive');if(!_[_0x43ce('0x7f')](_0x3656fc[_0x43ce('0x7d')])&&_0x3656fc[_0x43ce('0x7d')]>0x0){return!![];}loggerPredictive['info']('Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}else{loggerPredictive[_0x43ce('0x78')](_0x43ce('0x80'));}}else{loggerPredictive['info'](_0x43ce('0x81'));}return![];}function mergeDataErlangB(_0x46065c){return function(_0x11a19a){loggerPredictive['info'](_0x43ce('0x82'));loggerPredictive[_0x43ce('0x78')](_0x43ce('0x83'),_0x11a19a[_0x43ce('0x6e')]);loggerPredictive[_0x43ce('0x78')]('One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x11a19a[_0x43ce('0x84')]);loggerPredictive['info']('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x11a19a[_0x43ce('0x6f')]);loggerPredictive[_0x43ce('0x78')]('Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x11a19a[_0x43ce('0x70')]);loggerPredictive[_0x43ce('0x78')](_0x43ce('0x85'),_0x11a19a[_0x43ce('0x6f')]);loggerPredictive[_0x43ce('0x78')](_0x43ce('0x7e'));_['merge'](_0x46065c,_0x11a19a);};}function getDiff(_0x3f9e89){var _0xe3c982=moment()[_0x43ce('0x47')](0x0);var _0xf3c4fa=moment(_0x3f9e89)[_0x43ce('0x47')](0x0);return _0xe3c982[_0x43ce('0x48')](_0xf3c4fa,'seconds');}function ifInterval(_0x468c19,_0x52350d){if(_[_0x43ce('0x7f')](_0x52350d)){return![];}return getDiff(_0x52350d)<_0x468c19*0x3c;}function freeVariablesPredictive(_0x39edbf){if(isNotNull(_0x39edbf)){if(!_['isUndefined'](_0x39edbf[_0x43ce('0x86')])){_0x39edbf['startProgressive']=undefined;loggerPredictive[_0x43ce('0x78')](_0x39edbf[_0x43ce('0x3b')],_0x43ce('0x87'));}if(!_[_0x43ce('0x7f')](_0x39edbf[_0x43ce('0x71')])){_0x39edbf[_0x43ce('0x71')]=undefined;loggerPredictive[_0x43ce('0x78')](_0x39edbf[_0x43ce('0x3b')],_0x43ce('0x88'));}if(!_[_0x43ce('0x7f')](_0x39edbf['handlePredictive'])){clearInterval(_0x39edbf[_0x43ce('0x89')]);_0x39edbf[_0x43ce('0x89')]=undefined;loggerPredictive[_0x43ce('0x78')](_0x39edbf[_0x43ce('0x3b')],_0x43ce('0x8a'));}}}function erlangb(_0x51c25a,_0x5de69e){if(_0x5de69e===0x0){return 0x0;}var _0x56d32f=0x1;for(var _0x100fd9=0x1;_0x100fd9<=_0x5de69e;_0x100fd9+=0x1){_0x56d32f=0x1+_0x56d32f*_0x100fd9/_0x51c25a;}return 0x1/_0x56d32f;}function isVoiceQueueOutbound(_0x1fb449){return _0x1fb449===_0x43ce('0x4b');}function isNotPreview(_0x27d25a){return _0x27d25a!==_0x43ce('0x1f');}function isCampaignIvr(_0x157d76){return _0x157d76===_0x43ce('0x75');}function getCallerId(_0x1d5da6,_0x3fd082,_0x25f477){if(!_['isUndefined'](_0x25f477)&&typeof _0x25f477===_0x43ce('0x8b')&&!_[_0x43ce('0x43')](_0x25f477)){if(!_[_0x43ce('0x7f')](_0x3fd082)&&typeof _0x3fd082===_0x43ce('0x8b')&&!_[_0x43ce('0x43')](_0x3fd082)){return util['format'](_0x43ce('0x8c'),_0x3fd082,_0x25f477);}return util[_0x43ce('0x73')](_0x43ce('0x8c'),_0x25f477,_0x25f477);}if(!_[_0x43ce('0x7f')](_0x1d5da6)&&typeof _0x1d5da6===_0x43ce('0x8b')&&!_[_0x43ce('0x43')](_0x1d5da6)){return _0x1d5da6;}return _0x43ce('0x8d');}function loggerCatchQueueSummary(_0x44e750,_0x835ee1){return function(_0xbb0df5){freeVariablesPredictive(_0x835ee1);emitVoiceQueueSummary(_0x835ee1);emitCampaignSummary(_0x835ee1);loggerSyncQueueSummary['error'](_0x44e750,util[_0x43ce('0x8e')](_0xbb0df5,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x2a6a2e,_0x1883dd){return function(_0x4c11cc){loggerPredictive['error'](_0x1883dd['name'],_0x2a6a2e);loggerPredictive['error'](_0x4c11cc[_0x43ce('0x8f')]);freeVariablesPredictive(_0x1883dd);};}function loggerCatch(_0x533fc7){return function(_0xf456aa){logger[_0x43ce('0x90')](_0x533fc7,util[_0x43ce('0x8e')](_0xf456aa,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x5c1fd2){return _0x5c1fd2&&!_[_0x43ce('0x7f')](_0x5c1fd2)&&_0x5c1fd2[_0x43ce('0x91')]>0x0;}function decremetOriginate(_0x47c622){if(!_['isUndefined'](_0x47c622)&&_0x47c622!==null){if(typeof _0x47c622[_0x43ce('0x92')]!==_0x43ce('0x93')){if(_0x47c622[_0x43ce('0x92')]>0x0){_0x47c622[_0x43ce('0x92')]-=0x1;}else{logger[_0x43ce('0x90')]('[decremetOriginate]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0x43ce('0x90')](_0x43ce('0x94'));}}function checkContactLowerLimitOriginate(_0x2433a7,_0x3e8c56,_0x35befa){if(_0x3e8c56>_0x35befa){for(var _0x229cc4=0x0;_0x229cc4<_0x3e8c56-_0x35befa;_0x229cc4+=0x1){decremetOriginate(_0x2433a7);}}}function loggerGetContactDialer(_0x278a5a,_0x49410c,_0x347026){return function(_0x586280){checkContactLowerLimitOriginate(_0x49410c,_0x347026,0x0);logger[_0x43ce('0x90')](_0x278a5a,util[_0x43ce('0x8e')](_0x586280,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x4662c4){return function(_0x7450a1){if(isNotNull(_0x7450a1)&&isNotNull(_0x7450a1[0x0])){if(_0x7450a1[0x0][_0x43ce('0x95')]>0x0){_0x4662c4['message']=_0x43ce('0x96');logger[_0x43ce('0x78')]('[getContactDialer2][ReScheduled]'+_0x4662c4['name'],_0x7450a1[0x0][_0x43ce('0x95')],_0x43ce('0x97'));}else{_0x4662c4[_0x43ce('0x39')]=_0x43ce('0x98');logger[_0x43ce('0x78')]('[getContactDialer2][Empty]'+_0x4662c4[_0x43ce('0x3b')]);}}};}function notSendMessagesQueue(_0x2330b6){if(_0x2330b6[_0x43ce('0x99')]){freeVariablesPredictive(_0x2330b6);if(_0x2330b6[_0x43ce('0x92')]===0x0&&_0x2330b6[_0x43ce('0x52')]===0x0&&_0x2330b6[_0x43ce('0x55')]===0x0&&(_0x2330b6['pTalking']||0x0)===0x0){_0x2330b6[_0x43ce('0x99')]=![];_0x2330b6['available']=0x0;_0x2330b6['message']=_0x43ce('0x3d');loggerSyncQueueSummary['error'](_0x43ce('0x9a'),_0x2330b6[_0x43ce('0x3b')],'is\x20not\x20active');}else{_0x2330b6[_0x43ce('0x39')]=_0x43ce('0x9b');loggerSyncQueueSummary[_0x43ce('0x90')]('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x2330b6[_0x43ce('0x3b')],_0x43ce('0x9c'));}emitVoiceQueueSummary(_0x2330b6);}}function notSendMessagesCampaign(_0x35d017){if(_0x35d017[_0x43ce('0x99')]){if(_0x35d017[_0x43ce('0x92')]===0x0){_0x35d017['sendMessageOneNotActive']=![];_0x35d017[_0x43ce('0x39')]=_0x43ce('0x3d');loggerSyncQueueSummary[_0x43ce('0x90')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x35d017[_0x43ce('0x3b')],'is\x20not\x20active');}else{_0x35d017[_0x43ce('0x39')]=_0x43ce('0x9b');loggerSyncQueueSummary[_0x43ce('0x90')](_0x43ce('0x9d'),_0x35d017[_0x43ce('0x3b')],_0x43ce('0x9c'));}emitCampaignSummary(_0x35d017);}}function createObjHistory(_0x715b50,_0x262003,_0x153c8c,_0xac028f,_0x5d4bd0){_0x715b50[_0x43ce('0x39')]=_0x153c8c;var _0x7ae8d0=new Action(_0x715b50,_0x262003);var _0x287810=new History(_0x7ae8d0);_0x287810['state']=_0xac028f;_0x287810[_0x43ce('0x9e')]=_0x5d4bd0;_0x287810[_0x43ce('0x9f')]=_0x7ae8d0['starttime'];return _0x287810;}Dialer[_0x43ce('0x1a')][_0x43ce('0x38')]=function(){var _0x107443=this;setInterval(function(){_0x107443['clearZombieChannels'](_0x107443[_0x43ce('0x26')],_0x43ce('0xa0'));_0x107443[_0x43ce('0xa1')](_0x107443[_0x43ce('0xa2')],_0x43ce('0xa3'));},0x32c8);};Dialer['prototype'][_0x43ce('0xa1')]=function(_0x423765,_0x3e4253){var _0x3c0acf=this;for(var _0x4e46ab in _0x423765){if(typeof _0x423765[_0x4e46ab]!==_0x43ce('0x93')){this[_0x43ce('0x1e')][_0x43ce('0x1b')](function(){if(!_[_0x43ce('0xa4')](_0x423765[_0x4e46ab])){return ami['Action']({'action':_0x43ce('0xa5'),'channel':_0x423765[_0x4e46ab][_0x43ce('0xa6')]})[_0x43ce('0xa7')](function(_0x1a0706){if(_0x1a0706['message']===_0x43ce('0xa8')){setTimeout(function(){if(_0x423765[_0x4e46ab]&&_0x423765[_0x4e46ab][_0x43ce('0x4a')]!==_0x43ce('0x75')){_0x3c0acf[_0x43ce('0xa9')](_0x3c0acf[_0x43ce('0x20')][_0x423765[_0x4e46ab]['queue']]);logger[_0x43ce('0x90')](_0x43ce('0xaa'),_0x3e4253,_0x4e46ab,_0x423765[_0x4e46ab][_0x43ce('0xab')]);delete _0x423765[_0x4e46ab];}if(_0x423765[_0x4e46ab]&&_0x423765[_0x4e46ab]['type']==='ivr'){_0x3c0acf[_0x43ce('0xa9')](_0x3c0acf[_0x43ce('0x21')][_0x423765[_0x4e46ab][_0x43ce('0xab')]]);logger[_0x43ce('0x90')](_0x43ce('0xac'),_0x3e4253,_0x4e46ab,_0x423765[_0x4e46ab][_0x43ce('0xab')]);delete _0x423765[_0x4e46ab];}},0x2328);}});}});}}};Dialer[_0x43ce('0x1a')][_0x43ce('0xad')]=function(_0x561eb9){return BPromise[_0x43ce('0xae')]()['then'](cmHopper[_0x43ce('0xad')](_0x561eb9))[_0x43ce('0xa7')](loggerCatch(_0x43ce('0xaf')));};Dialer['prototype']['checkIsBlackList']=function(_0x193cef){return BPromise[_0x43ce('0xae')]()[_0x43ce('0xb0')](cmHopperBlack[_0x43ce('0xb1')](_0x193cef))['catch'](loggerCatch(_0x43ce('0xb2')));};Dialer['prototype'][_0x43ce('0xb3')]=function(_0x6d146d){return BPromise[_0x43ce('0xae')]()[_0x43ce('0xb0')](cmHopperBlack['checkIsBlackListIvr'](_0x6d146d))['catch'](loggerCatch(_0x43ce('0xb4')));};Dialer['prototype'][_0x43ce('0xb5')]=function(_0x19c8dc){return BPromise['resolve']()[_0x43ce('0xb0')](cmHopperHistory[_0x43ce('0xb6')](_0x19c8dc))[_0x43ce('0xa7')](loggerCatch(_0x43ce('0xb7')));};Dialer[_0x43ce('0x1a')][_0x43ce('0xb8')]=function(_0x42abab){return BPromise[_0x43ce('0xae')]()[_0x43ce('0xb0')](cmHopper[_0x43ce('0xb8')](_0x42abab))[_0x43ce('0xa7')](loggerCatch('[rescheduleContact]\x20'));};Dialer[_0x43ce('0x1a')]['unlockContact']=function(_0x37bf08,_0x40023b,_0x5addef){return BPromise[_0x43ce('0xae')]()[_0x43ce('0xb0')](cmHopper[_0x43ce('0xb9')](_0x37bf08,_0x40023b,_0x5addef))[_0x43ce('0xa7')](loggerCatch(_0x43ce('0xba')));};Dialer[_0x43ce('0x1a')][_0x43ce('0xbb')]=function(_0x6d2cca,_0x39ef31,_0x312ff0,_0x5aa484,_0x5abe05){return BPromise[_0x43ce('0xae')]()[_0x43ce('0xb0')](cmHopper[_0x43ce('0xbb')](_0x6d2cca,_0x39ef31,_0x312ff0,_0x5aa484))['catch'](function(_0x3f5443){_0x5abe05['temp']-=_0x312ff0;_0x5abe05[_0x43ce('0xbc')]=_0x5abe05[_0x43ce('0xbc')]>0x0?_0x5abe05[_0x43ce('0xbc')]:0x0;loggerCatch(_0x43ce('0xbd'))(_0x3f5443);});};Dialer[_0x43ce('0x1a')]['getContactDialerIvr']=function(_0x23114e,_0x1f66ee,_0x56ccf8,_0x1f3898){return BPromise[_0x43ce('0xae')]()[_0x43ce('0xb0')](cmHopper['getContactDialerIvr'](_0x23114e,_0x1f66ee,_0x56ccf8))[_0x43ce('0xa7')](function(_0x51f569){_0x1f3898['temp']-=_0x1f66ee;_0x1f3898[_0x43ce('0xbc')]=_0x1f3898[_0x43ce('0xbc')]>0x0?_0x1f3898['temp']:0x0;loggerCatch('[getContactDialerIvr]\x20')(_0x51f569);});};Dialer['prototype'][_0x43ce('0xbe')]=function(_0x164556){return BPromise[_0x43ce('0xae')]()[_0x43ce('0xb0')](voiceQueueRt[_0x43ce('0xbe')](_0x164556))['catch'](loggerCatch('[getVoiceQueueRtPauses]\x20'));};Dialer[_0x43ce('0x1a')]['moveContactManagedDialer']=function(_0x231b7b){return BPromise[_0x43ce('0xae')]()['then'](cmHopper[_0x43ce('0xbf')](_0x231b7b))['catch'](loggerCatch(_0x43ce('0xc0')));};Dialer[_0x43ce('0x1a')][_0x43ce('0xc1')]=function(_0x266b42){return BPromise[_0x43ce('0xae')]()[_0x43ce('0xb0')](cmHopperHistory[_0x43ce('0xc1')](_0x266b42))[_0x43ce('0xa7')](loggerCatch(_0x43ce('0xc2')));};Dialer[_0x43ce('0x1a')][_0x43ce('0xa9')]=function(_0x4fd118){if(!_[_0x43ce('0x7f')](_0x4fd118)&&_0x4fd118!==null){if(typeof _0x4fd118[_0x43ce('0x92')]!=='undefined'){if(_0x4fd118[_0x43ce('0x92')]>0x0){_0x4fd118[_0x43ce('0x92')]-=0x1;}else{logger[_0x43ce('0x90')](_0x43ce('0xc3'));}}}else{logger[_0x43ce('0x90')](_0x43ce('0xc4'));}};Dialer[_0x43ce('0x1a')][_0x43ce('0xc5')]=function(_0x4e71a2,_0x424fe6){var _0x414f4f=this;return function(_0x37d3ad){_0x414f4f[_0x43ce('0xa9')](_0x424fe6);logger[_0x43ce('0x90')](_0x4e71a2,util['inspect'](_0x37d3ad,{'showHidden':![],'depth':null}));};};Dialer[_0x43ce('0x1a')][_0x43ce('0xc6')]=function(_0x40c224,_0x59e181,_0x26834a){var _0x4d8ca0={'state':0x19,'statedesc':_0x43ce('0xc7')};this[_0x43ce('0xa9')](_0x59e181);this['saveInDb'](_[_0x43ce('0xc8')](_0x4d8ca0,_[_0x43ce('0xc9')](_0x26834a,[_0x43ce('0xca'),_0x43ce('0xcb'),_0x43ce('0xcc'),_0x43ce('0xcd'),_0x43ce('0xce')])),_0x43ce('0xcf'),_0x43ce('0xd0'));logger[_0x43ce('0x90')](_0x40c224);};Dialer[_0x43ce('0x1a')][_0x43ce('0xd1')]=function(_0x9d65d8){return _0x9d65d8===_0x43ce('0xd2');};Dialer[_0x43ce('0x1a')][_0x43ce('0xd3')]=function(_0x5cdb65){return!_[_0x43ce('0x7f')](_0x5cdb65)&&_0x5cdb65&&!_['isUndefined'](_0x5cdb65['name'])&&!_['isUndefined'](_0x5cdb65[_0x43ce('0xd4')])&&_0x5cdb65[_0x43ce('0xd4')]&&(this[_0x43ce('0x23')][util['format'](_0x43ce('0xd5'),_0x5cdb65[_0x43ce('0x3b')])][_0x43ce('0xa5')]===_0x43ce('0xd6')||this[_0x43ce('0x23')][util[_0x43ce('0x73')](_0x43ce('0xd5'),_0x5cdb65[_0x43ce('0x3b')])][_0x43ce('0xa5')]==='unmonitored');};Dialer[_0x43ce('0x1a')]['saveInDb']=function(_0x4f7d7f,_0x194a09,_0xd6a503){this[_0x43ce('0xc1')](_0x4f7d7f)[_0x43ce('0xa7')](loggerCatch(_0x194a09));this[_0x43ce('0xbf')](_0x4f7d7f)[_0x43ce('0xa7')](loggerCatch(_0xd6a503));};Dialer['prototype'][_0x43ce('0xd7')]=function(_0x106af3){var _0xcd7f01=this[_0x43ce('0x26')][_0x106af3[_0x43ce('0xd8')]];var _0x56ab64;if(!_[_0x43ce('0xa4')](_0x106af3)&&!_[_0x43ce('0xa4')](_0x106af3[_0x43ce('0xd9')])&&!_[_0x43ce('0xa4')](_0x106af3[_0x43ce('0xd9')][_0x43ce('0xda')])&&_0x106af3[_0x43ce('0xdb')]==='xcally-motion-dialer'&&_0xcd7f01){if(_0xcd7f01['type']!==_0x43ce('0x75')&&this[_0x43ce('0x20')][_0xcd7f01['queue']]['dialAMDActive']&&_0x106af3[_0x43ce('0xdc')]===_0x43ce('0xdd')){delete this[_0x43ce('0x26')][_0x106af3['uniqueid']];this[_0x43ce('0xa9')](this[_0x43ce('0x20')][_0xcd7f01[_0x43ce('0xab')]]);this[_0x43ce('0x20')][_0xcd7f01[_0x43ce('0xab')]][_0x43ce('0x5b')]+=0x1;this[_0x43ce('0x20')][_0xcd7f01[_0x43ce('0xab')]][_0x43ce('0x5a')]+=0x1;_0x56ab64=new Hangup(_0xcd7f01,_0x106af3);_0x56ab64[_0x43ce('0xde')]=0x12;_0x56ab64['statedesc']=_0x43ce('0xdf');_0x56ab64['membername']='AMD';ami[_0x43ce('0x49')](_0x43ce('0xe0'),ut[_0x43ce('0xe1')](_0x56ab64,_0x43ce('0xe2')));this['saveInDb'](_0x56ab64,_0x43ce('0xe3'),_0x43ce('0xe4'));}if(_0xcd7f01[_0x43ce('0x4a')]!==_0x43ce('0x75')&&this['voiceQueues'][_0xcd7f01[_0x43ce('0xab')]][_0x43ce('0xe5')]&&_0x106af3[_0x43ce('0xdc')]==='MACHINE'){var _0x318176=this;return new BPromise(function(_0x13aa5a,_0x44658e){delete _0x318176[_0x43ce('0x26')][_0x106af3[_0x43ce('0xd8')]];_0x318176['updateOriginated'](_0x318176[_0x43ce('0x20')][_0xcd7f01[_0x43ce('0xab')]]);_0x318176['voiceQueues'][_0xcd7f01[_0x43ce('0xab')]][_0x43ce('0x5b')]+=0x1;_0x318176[_0x43ce('0x20')][_0xcd7f01[_0x43ce('0xab')]][_0x43ce('0x5a')]+=0x1;var _0x3fc947=_0x318176[_0x43ce('0x20')][_0xcd7f01[_0x43ce('0xab')]];var _0x2428bb=new Hangup(_0xcd7f01,_0x106af3);_0x2428bb['state']=0x13;_0x2428bb[_0x43ce('0x9e')]=_0x43ce('0xe6');_0x2428bb[_0x43ce('0xe7')]=_0x43ce('0xe8');_0x2428bb[_0x43ce('0xe9')]+=0x1;_0x2428bb[_0x43ce('0xea')]+=0x1;_0x2428bb[_0x43ce('0xe2')]=!![];ami[_0x43ce('0x49')](_0x43ce('0xe0'),ut[_0x43ce('0xe1')](_0x2428bb,_0x43ce('0xe2')));_0x318176['createHistory'](_0x2428bb)[_0x43ce('0xa7')](loggerCatch(_0x43ce('0xeb')));if(_0x2428bb[_0x43ce('0xec')]+_0x2428bb['countcongestionretry']+_0x2428bb[_0x43ce('0xed')]+_0x2428bb[_0x43ce('0xee')]+_0x2428bb[_0x43ce('0xef')]+_0x2428bb[_0x43ce('0xf0')]+_0x2428bb[_0x43ce('0xe9')]+_0x2428bb[_0x43ce('0xf1')]>=_0x3fc947[_0x43ce('0xf2')]){_0x318176[_0x43ce('0xf3')](_0x2428bb,_0x13aa5a,_0x44658e,_0x43ce('0xf4'));}else{if(_0x2428bb[_0x43ce('0xe9')]>=_0x3fc947[_0x43ce('0xf5')]){_0x318176[_0x43ce('0xf6')](_0x2428bb,_0x13aa5a,_0x44658e,_0x43ce('0xf7'));}else{_0x318176[_0x43ce('0xb8')]({'active':![],'countmachineretry':_0x2428bb['countmachineretry'],'scheduledat':moment()[_0x43ce('0xf8')](_0x3fc947['dialMachineRetryFrequency'],_0x43ce('0xf9'))[_0x43ce('0x73')](_0x43ce('0xfa')),'ContactId':_0x2428bb[_0x43ce('0xca')],'ListId':_0x2428bb[_0x43ce('0xcb')],'VoiceQueueId':_0x2428bb['VoiceQueueId']||undefined,'CampaignId':_0x2428bb[_0x43ce('0xce')]||undefined})[_0x43ce('0xa7')](loggerCatch(_0x43ce('0xfb')));_0x13aa5a({'reschedule':0x1});}}});}if(_0xcd7f01[_0x43ce('0x4a')]==='ivr'&&this[_0x43ce('0x21')][_0xcd7f01[_0x43ce('0xab')]]['dialAMDActive']&&_0x106af3[_0x43ce('0xdc')]==='HANGUP'){delete this['uniqueId'][_0x106af3['uniqueid']];this[_0x43ce('0xa9')](this['campaigns'][_0xcd7f01[_0x43ce('0xab')]]);_0x56ab64=new Hangup(_0xcd7f01,_0x106af3);_0x56ab64['state']=0x12;_0x56ab64[_0x43ce('0x9e')]='HangupInAMD';_0x56ab64['membername']=_0x43ce('0xe8');ami['emit'](_0x43ce('0xe0'),ut[_0x43ce('0xe1')](_0x56ab64,'amd'));this[_0x43ce('0xfc')](_0x56ab64,_0x43ce('0xfd'),_0x43ce('0xfe'));}if(_0xcd7f01[_0x43ce('0x4a')]===_0x43ce('0x75')&&this['campaigns'][_0xcd7f01[_0x43ce('0xab')]][_0x43ce('0xe5')]&&_0x106af3[_0x43ce('0xdc')]===_0x43ce('0xff')){var _0x318176=this;return new BPromise(function(_0x3d662d,_0x55a32a){delete _0x318176[_0x43ce('0x26')][_0x106af3['uniqueid']];_0x318176[_0x43ce('0xa9')](_0x318176[_0x43ce('0x21')][_0xcd7f01['queue']]);_0x318176['campaigns'][_0xcd7f01['queue']][_0x43ce('0x5b')]+=0x1;_0x318176['campaigns'][_0xcd7f01[_0x43ce('0xab')]][_0x43ce('0x5a')]+=0x1;var _0x150a59=_0x318176[_0x43ce('0x21')][_0xcd7f01[_0x43ce('0xab')]];var _0x282e1f=new Hangup(_0xcd7f01,_0x106af3);_0x282e1f[_0x43ce('0xde')]=0x13;_0x282e1f['statedesc']=_0x43ce('0xe6');_0x282e1f[_0x43ce('0xe7')]=_0x43ce('0xe8');_0x282e1f[_0x43ce('0xe9')]+=0x1;_0x282e1f[_0x43ce('0xea')]+=0x1;_0x282e1f[_0x43ce('0xe2')]=!![];ami[_0x43ce('0x49')](_0x43ce('0xe0'),ut[_0x43ce('0xe1')](_0x282e1f,_0x43ce('0xe2')));_0x318176[_0x43ce('0xc1')](_0x282e1f)[_0x43ce('0xa7')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x282e1f[_0x43ce('0xec')]+_0x282e1f[_0x43ce('0x100')]+_0x282e1f[_0x43ce('0xed')]+_0x282e1f['countnosuchnumberretry']+_0x282e1f[_0x43ce('0xef')]+_0x282e1f['countabandonedretry']+_0x282e1f[_0x43ce('0xe9')]+_0x282e1f['countagentrejectretry']>=_0x150a59['dialGlobalMaxRetry']){_0x318176['stateGlobal'](_0x282e1f,_0x3d662d,_0x55a32a,_0x43ce('0xf4'));}else{if(_0x282e1f['countmachineretry']>=_0x150a59[_0x43ce('0xf5')]){_0x318176['createStateFinal'](_0x282e1f,_0x3d662d,_0x55a32a,_0x43ce('0xf7'));}else{_0x318176[_0x43ce('0xb8')]({'active':![],'countmachineretry':_0x282e1f[_0x43ce('0xe9')],'scheduledat':moment()[_0x43ce('0xf8')](_0x150a59[_0x43ce('0x101')],_0x43ce('0xf9'))[_0x43ce('0x73')](_0x43ce('0xfa')),'ContactId':_0x282e1f['ContactId'],'ListId':_0x282e1f[_0x43ce('0xcb')],'VoiceQueueId':_0x282e1f[_0x43ce('0xcd')]||undefined,'CampaignId':_0x282e1f[_0x43ce('0xce')]||undefined})[_0x43ce('0xa7')](loggerCatch(_0x43ce('0xfb')));_0x3d662d({'reschedule':0x1});}}});}}};Dialer[_0x43ce('0x1a')]['syncHangup']=function(_0x49d4c4){var _0x5cb9a4=this[_0x43ce('0x26')][_0x49d4c4[_0x43ce('0xd8')]];var _0xc1f22e=this;var _0x3ed975;if(_0x5cb9a4&&_0x5cb9a4[_0x43ce('0x4a')]===_0x43ce('0x75')){delete this[_0x43ce('0x26')][_0x49d4c4[_0x43ce('0xd8')]];this[_0x43ce('0xa9')](this[_0x43ce('0x21')][_0x5cb9a4[_0x43ce('0xab')]]);this[_0x43ce('0x21')][_0x5cb9a4[_0x43ce('0xab')]][_0x43ce('0x102')]+=0x1;_0x3ed975=new Hangup(_0x5cb9a4,_0x49d4c4);this[_0x43ce('0xc1')](_0x3ed975)[_0x43ce('0xa7')](loggerCatch(_0x43ce('0x103')));this[_0x43ce('0xbf')](_0x3ed975)[_0x43ce('0xa7')](loggerCatch(_0x43ce('0x104')));}if(_0x5cb9a4&&_0x5cb9a4[_0x43ce('0x4a')]!==_0x43ce('0x75')&&isNotNull(this['voiceQueues'][_0x5cb9a4[_0x43ce('0xab')]][_0x43ce('0x105')])){delete this[_0x43ce('0x26')][_0x49d4c4[_0x43ce('0xd8')]];this[_0x43ce('0xa9')](this[_0x43ce('0x20')][_0x5cb9a4['queue']]);this['voiceQueues'][_0x5cb9a4[_0x43ce('0xab')]]['outboundAnswerCallsDay']+=0x1;this['voiceQueues'][_0x5cb9a4[_0x43ce('0xab')]][_0x43ce('0x5a')]+=0x1;_0x3ed975=new Hangup(_0x5cb9a4,_0x49d4c4);_0x3ed975['state']=0x10;_0x3ed975[_0x43ce('0x9e')]=_0x43ce('0x106');_0x3ed975[_0x43ce('0xe7')]=_0x43ce('0x107');this[_0x43ce('0xc1')](_0x3ed975)['catch'](loggerCatch(_0x43ce('0x103')));this['moveContactManagedDialer'](_0x3ed975)[_0x43ce('0xa7')](loggerCatch(_0x43ce('0x104')));}if(_0x5cb9a4&&_0x5cb9a4[_0x43ce('0x4a')]!==_0x43ce('0x75')&&!isNotNull(this[_0x43ce('0x20')][_0x5cb9a4[_0x43ce('0xab')]][_0x43ce('0x105')])){delete this[_0x43ce('0x26')][_0x49d4c4[_0x43ce('0xd8')]];this[_0x43ce('0xa9')](this[_0x43ce('0x20')][_0x5cb9a4[_0x43ce('0xab')]]);this[_0x43ce('0x20')][_0x5cb9a4[_0x43ce('0xab')]][_0x43ce('0x108')]+=0x1;_0x3ed975=new Hangup(_0x5cb9a4,_0x49d4c4);_0x3ed975[_0x43ce('0xde')]=0xc;_0x3ed975[_0x43ce('0x9e')]=_0x49d4c4['cause-txt'];_0x3ed975[_0x43ce('0xe7')]='Unknow';this['createHistory'](_0x3ed975)[_0x43ce('0xa7')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0x43ce('0xbf')](_0x3ed975)[_0x43ce('0xa7')](loggerCatch('[syncHangupIvr]'));}};Dialer[_0x43ce('0x1a')][_0x43ce('0x109')]=function(_0x26a0ef){var _0x1b7827=this[_0x43ce('0x26')][_0x26a0ef[_0x43ce('0xd8')]];var _0x182ade=this;if(this['voiceQueues'][_0x26a0ef[_0x43ce('0xab')]]){if(_0x1b7827&&_0x1b7827[_0x43ce('0x4a')]!==_0x43ce('0x75')){delete this[_0x43ce('0x26')][_0x26a0ef[_0x43ce('0xd8')]];this[_0x43ce('0x20')][_0x26a0ef[_0x43ce('0xab')]][_0x43ce('0x5b')]+=0x1;var _0x44542b=new AgentComplete(_0x1b7827,_0x26a0ef);if(_0x26a0ef[_0x43ce('0x10a')]===_0x43ce('0x10b')){_0x44542b['agiafterat']=this[_0x43ce('0x20')][_0x26a0ef[_0x43ce('0xab')]]['dialQueueProject2']&&this[_0x43ce('0x20')][_0x26a0ef[_0x43ce('0xab')]][_0x43ce('0x10c')]?moment()[_0x43ce('0x73')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;}this[_0x43ce('0xc1')](_0x44542b)[_0x43ce('0xa7')](loggerCatch(_0x43ce('0x10d')));this[_0x43ce('0xbf')](_0x44542b)[_0x43ce('0xa7')](loggerCatch(_0x43ce('0x10e')));}}};Dialer[_0x43ce('0x1a')][_0x43ce('0x10f')]=function(_0x45f91f){if(this[_0x43ce('0x20')][_0x45f91f[_0x43ce('0xab')]]){if(this['uniqueId'][_0x45f91f[_0x43ce('0xd8')]]&&this['uniqueId'][_0x45f91f[_0x43ce('0xd8')]][_0x43ce('0x4a')]!==_0x43ce('0x75')){this[_0x43ce('0xa9')](this[_0x43ce('0x20')][_0x45f91f['queue']]);this[_0x43ce('0x26')][_0x45f91f[_0x43ce('0xd8')]][_0x43ce('0x110')]=moment()[_0x43ce('0x73')](_0x43ce('0xfa'));}}};Dialer['prototype']['queueCallerAbandonCreateState']=function(_0x5eea45){this['createHistory'](_0x5eea45)['catch'](loggerCatch(_0x43ce('0x10d')));this[_0x43ce('0xbf')](_0x5eea45)[_0x43ce('0xa7')](loggerCatch(_0x43ce('0x111')));};Dialer[_0x43ce('0x1a')]['syncQueueCallerAbandon']=function(_0x21cec9){var _0x50564a=this[_0x43ce('0x26')][_0x21cec9['uniqueid']];var _0xe08d6d=this;if(this[_0x43ce('0x20')][_0x21cec9[_0x43ce('0xab')]]){if(_0x50564a&&_0x50564a[_0x43ce('0x4a')]!==_0x43ce('0x75')){delete this[_0x43ce('0x26')][_0x21cec9[_0x43ce('0xd8')]];this[_0x43ce('0xa9')](this['voiceQueues'][_0x21cec9[_0x43ce('0xab')]]);_0x50564a['droptime']=moment()[_0x43ce('0x73')]('YYYY-MM-DD\x20HH:mm:ss');var _0x32c987=new QueueCallerAbandon(_0x50564a,_0x21cec9);if(getSeconds(_0x50564a[_0x43ce('0x112')],_0x50564a['responsetime'])>=_0x50564a['dialQueueTimeout']){this['voiceQueues'][_0x21cec9[_0x43ce('0xab')]][_0x43ce('0x68')]+=0x1;this[_0x43ce('0x20')][_0x21cec9[_0x43ce('0xab')]]['outboundDropCallsDayTimeout']+=0x1;this[_0x43ce('0x20')][_0x21cec9['queue']]['predictiveIntervalErlangCallsDroppedCalls']+=0x1;_0x32c987['state']=0xa;_0x32c987['statedesc']=_0x43ce('0x113');_0x32c987[_0x43ce('0x114')]=_0x43ce('0x115');_0x32c987['agiafterat']=this[_0x43ce('0x20')][_0x21cec9[_0x43ce('0xab')]][_0x43ce('0x116')]?moment()[_0x43ce('0x73')](_0x43ce('0xfa')):undefined;_0x32c987[_0x43ce('0xef')]+=0x1;_0x32c987[_0x43ce('0xea')]+=0x1;if(_0x32c987[_0x43ce('0xef')]>=this[_0x43ce('0x20')][_0x21cec9[_0x43ce('0xab')]][_0x43ce('0x117')]){this[_0x43ce('0x118')](_0x32c987);}else{this[_0x43ce('0xb8')]({'active':![],'countdropretry':_0x32c987[_0x43ce('0xef')],'scheduledat':moment()['add'](this[_0x43ce('0x20')][_0x21cec9['queue']][_0x43ce('0x119')],_0x43ce('0xf9'))[_0x43ce('0x73')](_0x43ce('0xfa')),'ContactId':_0x50564a[_0x43ce('0xca')],'ListId':_0x50564a[_0x43ce('0xcb')],'VoiceQueueId':_0x50564a['VoiceQueueId']||undefined,'CampaignId':_0x50564a[_0x43ce('0xce')]||undefined})['catch'](loggerCatch(_0x43ce('0x11a')));var _0x4419b3=new History(_0x32c987);_0x4419b3[_0x43ce('0xde')]=0xa;_0x4419b3[_0x43ce('0x9e')]='Drop';_0x4419b3['starttime']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x4419b3[_0x43ce('0x9f')]=_0x4419b3[_0x43ce('0x11b')];_0x4419b3[_0x43ce('0x11c')]=_0x32c987['calleridname'];_0x4419b3['calleridnum']=_0x32c987[_0x43ce('0x11d')];this[_0x43ce('0xc1')](_0x4419b3)['catch'](loggerCatch(_0x43ce('0x11e')));}}else{this[_0x43ce('0x20')][_0x21cec9['queue']][_0x43ce('0x67')]+=0x1;this[_0x43ce('0x20')][_0x21cec9[_0x43ce('0xab')]][_0x43ce('0x5f')]+=0x1;_0x32c987[_0x43ce('0xde')]=0xb;_0x32c987[_0x43ce('0x9e')]=_0x43ce('0x11f');_0x32c987['dropreason']=_0x43ce('0x120');_0x32c987[_0x43ce('0xf0')]+=0x1;_0x32c987[_0x43ce('0xea')]+=0x1;if(_0x32c987[_0x43ce('0xf0')]>=this[_0x43ce('0x20')][_0x21cec9[_0x43ce('0xab')]]['dialAbandonedMaxRetry']){this[_0x43ce('0x118')](_0x32c987);}else{this[_0x43ce('0xb8')]({'active':![],'countabandonedretry':_0x32c987[_0x43ce('0xf0')],'scheduledat':moment()[_0x43ce('0xf8')](this[_0x43ce('0x20')][_0x21cec9[_0x43ce('0xab')]][_0x43ce('0x121')],_0x43ce('0xf9'))[_0x43ce('0x73')](_0x43ce('0xfa')),'ContactId':_0x50564a[_0x43ce('0xca')],'ListId':_0x50564a['ListId'],'VoiceQueueId':_0x50564a['VoiceQueueId']||undefined,'CampaignId':_0x50564a[_0x43ce('0xce')]||undefined})[_0x43ce('0xa7')](loggerCatch(_0x43ce('0x122')));var _0x4419b3=new History(_0x32c987);_0x4419b3['state']=0xb;_0x4419b3[_0x43ce('0x9e')]=_0x43ce('0x11f');_0x4419b3['starttime']=moment()[_0x43ce('0x73')]('YYYY-MM-DD\x20HH:mm:ss');_0x4419b3[_0x43ce('0x9f')]=_0x4419b3[_0x43ce('0x11b')];_0x4419b3['calleridname']=_0x32c987[_0x43ce('0x11c')];_0x4419b3[_0x43ce('0x11d')]=_0x32c987[_0x43ce('0x11d')];this[_0x43ce('0xc1')](_0x4419b3)[_0x43ce('0xa7')](loggerCatch(_0x43ce('0x123')));}}}}};Dialer[_0x43ce('0x1a')][_0x43ce('0x124')]=function(_0x5db190){if(this['actions'][_0x5db190[_0x43ce('0xd8')]]){this[_0x43ce('0xa2')][_0x5db190[_0x43ce('0xd8')]]['channel']=_0x5db190[_0x43ce('0xa6')];}if(this[_0x43ce('0x26')][_0x5db190[_0x43ce('0xd8')]]){this[_0x43ce('0x26')][_0x5db190[_0x43ce('0xd8')]][_0x43ce('0xa6')]=_0x5db190[_0x43ce('0xa6')];}};Dialer[_0x43ce('0x1a')][_0x43ce('0x35')]=function(_0x262b57){if(strategy[this[_0x43ce('0x20')][this[_0x43ce('0xa2')][_0x262b57[_0x43ce('0x125')]]['queue']]['strategy']]==='roundrobin'){if(this['actions'][_0x262b57[_0x43ce('0x125')]]&&_[_0x43ce('0xa4')](this[_0x43ce('0xa2')][_0x262b57[_0x43ce('0x125')]][_0x43ce('0x126')])&&_0x262b57[_0x43ce('0xa5')]==='1'&&_0x262b57[_0x43ce('0x127')]==='0'){if(this[_0x43ce('0x22')][_0x262b57[_0x43ce('0x128')]]){if(!this[_0x43ce('0x22')][_0x262b57[_0x43ce('0x128')]][_0x43ce('0x126')]){this[_0x43ce('0x22')][_0x262b57[_0x43ce('0x128')]][_0x43ce('0x126')]=!![];this[_0x43ce('0xa2')][_0x262b57[_0x43ce('0x125')]][_0x43ce('0x126')]=!![];this['actions'][_0x262b57[_0x43ce('0x125')]][_0x43ce('0x128')]=_0x262b57[_0x43ce('0x128')];}}}}else if((strategy[this[_0x43ce('0x20')][this[_0x43ce('0xa2')][_0x262b57[_0x43ce('0x125')]][_0x43ce('0xab')]][_0x43ce('0x4c')]]||_0x43ce('0x19'))===_0x43ce('0x19')){if(this['actions'][_0x262b57['actionid']]){if(this[_0x43ce('0x22')][_0x262b57[_0x43ce('0x128')]]){this[_0x43ce('0xa2')][_0x262b57['actionid']]['stateinterface']=_0x262b57[_0x43ce('0x128')];if(_['isNil'](this[_0x43ce('0x29')][this['actions'][_0x262b57['actionid']][_0x43ce('0xab')]])){this['queueBooked'][this[_0x43ce('0xa2')][_0x262b57[_0x43ce('0x125')]]['queue']]=[];}this[_0x43ce('0x29')][this[_0x43ce('0xa2')][_0x262b57['actionid']]['queue']][_0x43ce('0x129')](_[_0x43ce('0xc8')](_[_0x43ce('0xc9')](this[_0x43ce('0xa2')][_0x262b57['actionid']],[_0x43ce('0x12a'),_0x43ce('0x128')]),{'status':_0x262b57[_0x43ce('0xa5')],'paused':_0x262b57['paused']}));}}}};function unlockQueueStatus(_0x41f821,_0x22aadc){setTimeout(function(){if(_[_0x43ce('0x7f')](_0x41f821[_0x43ce('0x12b')])){loggerBooked[_0x43ce('0x90')](_0x43ce('0x12c'),_0x22aadc);}_0x41f821['queueStatusComplete']=!![];loggerBooked[_0x43ce('0x78')]('[booked][unlockQueueStatus]',_0x22aadc,JSON[_0x43ce('0x46')](_['pick'](_0x41f821,[_0x43ce('0x3b'),_0x43ce('0x12b')])));},0x1f3);}Dialer[_0x43ce('0x1a')][_0x43ce('0x12d')]=function(_0x437e68){var _0x8d2e80=this;var _0x26814c=_0x8d2e80[_0x43ce('0x20')][_0x8d2e80['actions'][_0x437e68['actionid']][_0x43ce('0xab')]];if(strategy[this[_0x43ce('0x20')][this[_0x43ce('0xa2')][_0x437e68['actionid']][_0x43ce('0xab')]][_0x43ce('0x4c')]]===_0x43ce('0x12e')){if(this[_0x43ce('0xa2')][_0x437e68[_0x43ce('0x125')]]&&this[_0x43ce('0xa2')][_0x437e68[_0x43ce('0x125')]][_0x43ce('0x128')]){this['preview'][_0x43ce('0x12f')](this[_0x43ce('0xa2')][_0x437e68[_0x43ce('0x125')]][_0x43ce('0x12a')],this[_0x43ce('0xa2')][_0x437e68[_0x43ce('0x125')]][_0x43ce('0x128')])[_0x43ce('0xa7')](function(_0x5aa218){logger[_0x43ce('0x90')](_0x43ce('0x130'),util[_0x43ce('0x8e')](_0x5aa218,{'showHidden':![],'depth':null}));})[_0x43ce('0x1d')](function(){_0x8d2e80[_0x43ce('0xa9')](_0x8d2e80['voiceQueues'][_0x8d2e80['actions'][_0x437e68['actionid']]['queue']]);_0x8d2e80['agents'][_0x8d2e80[_0x43ce('0xa2')][_0x437e68[_0x43ce('0x125')]][_0x43ce('0x128')]][_0x43ce('0x126')]=![];delete _0x8d2e80[_0x43ce('0xa2')][_0x437e68[_0x43ce('0x125')]];unlockQueueStatus(_0x26814c);});}else{this['updateOriginated'](this['voiceQueues'][this['actions'][_0x437e68['actionid']]['queue']]);this[_0x43ce('0xb8')]({'active':![],'ContactId':this[_0x43ce('0xa2')][_0x437e68['actionid']]['ContactId'],'ListId':this[_0x43ce('0xa2')][_0x437e68[_0x43ce('0x125')]][_0x43ce('0xcb')],'VoiceQueueId':this[_0x43ce('0xa2')][_0x437e68[_0x43ce('0x125')]][_0x43ce('0xcd')]||undefined,'CampaignId':this['actions'][_0x437e68[_0x43ce('0x125')]][_0x43ce('0xce')]||undefined})['catch'](loggerCatch(_0x43ce('0x131')));delete this['actions'][_0x437e68[_0x43ce('0x125')]];unlockQueueStatus(_0x26814c);}}else if((strategy[this[_0x43ce('0x20')][this[_0x43ce('0xa2')][_0x437e68[_0x43ce('0x125')]][_0x43ce('0xab')]][_0x43ce('0x4c')]]||_0x43ce('0x19'))===_0x43ce('0x19')){var _0x35ea12;if(this[_0x43ce('0xa2')][_0x437e68[_0x43ce('0x125')]]&&!_[_0x43ce('0x43')](this[_0x43ce('0x29')][this[_0x43ce('0xa2')][_0x437e68[_0x43ce('0x125')]][_0x43ce('0xab')]])){if(this[_0x43ce('0x2a')][_0x8d2e80[_0x43ce('0xa2')][_0x437e68['actionid']]['queue']]){this[_0x43ce('0x2a')][_0x8d2e80[_0x43ce('0xa2')][_0x437e68[_0x43ce('0x125')]][_0x43ce('0xab')]]=this[_0x43ce('0x2a')][this[_0x43ce('0xa2')][_0x437e68['actionid']]['queue']]?this[_0x43ce('0x2a')][this[_0x43ce('0xa2')][_0x437e68[_0x43ce('0x125')]][_0x43ce('0xab')]]:this[_0x43ce('0x29')][this[_0x43ce('0xa2')][_0x437e68[_0x43ce('0x125')]][_0x43ce('0xab')]]?this['queueBooked'][this[_0x43ce('0xa2')][_0x437e68[_0x43ce('0x125')]][_0x43ce('0xab')]][_0x43ce('0x132')]||0x0:0x0;}this[_0x43ce('0x29')][this['actions'][_0x437e68[_0x43ce('0x125')]][_0x43ce('0xab')]][_0x43ce('0x132')]=this[_0x43ce('0x2a')][this[_0x43ce('0xa2')][_0x437e68[_0x43ce('0x125')]][_0x43ce('0xab')]];for(var _0x29b74b=0x0;_0x29b74b=0x0;})[_0x43ce('0xa7')](myreject(_0x553a60)));}}else{_0x33fc86[_0x43ce('0x129')](ami[_0x43ce('0x14e')]({'action':_0x43ce('0x147'),'command':util[_0x43ce('0x73')](_0x43ce('0x148'),_0x4ffd61,!_[_0x43ce('0x7f')](config[_0x43ce('0x14a')][_0x24d66d])?_0x24d66d:'')})[_0x43ce('0xb0')](function(_0x16a67e){return _0x16a67e[_0x43ce('0x14b')]['indexOf'](_0x43ce('0x14d'))>=0x0;})[_0x43ce('0xa7')](myreject(_0x553a60)));}BPromise[_0x43ce('0x14f')](_0x33fc86)['then'](function(_0x52b81f){var _0x4b10f4=_['some'](_0x52b81f);if(_0x4b10f4){return _0x2a519b(_0x4b10f4);}else{_0x47f747['message']=_0x57de35?_0x43ce('0x150'):_0x43ce('0x151');return _0x553a60(msgResponse(_0x43ce('0x152'),'Failure','Global:\x20'+_0x57de35+'\x20'+_0x4ebf9f+_0x43ce('0x153')+util['inspect'](_0x4ffd61,{'showHidden':![],'depth':null})+'Timezone:\x20'+_0x24d66d));}})[_0x43ce('0xa7')](function(_0xb3498a){return _0x553a60(msgResponse('ifTime',_0x43ce('0x141'),JSON[_0x43ce('0x46')](_0xb3498a)));});});};Dialer[_0x43ce('0x1a')][_0x43ce('0x154')]=function(_0x31a49c){var _0xfba88e=this;return function(){switch(_0x31a49c['dialMethod']){case _0x43ce('0x155'):freeVariablesPredictive(_0x31a49c);_0xfba88e[_0x43ce('0x156')](_0x31a49c,0x1);break;case'power':freeVariablesPredictive(_0x31a49c);_0xfba88e['handlePower'](_0x31a49c,_0x31a49c[_0x43ce('0x157')]);break;case'predictive':_0xfba88e[_0x43ce('0x158')](_0x31a49c);break;case'booked':freeVariablesPredictive(_0x31a49c);_0xfba88e[_0x43ce('0x156')](_0x31a49c,0x1);break;default:freeVariablesPredictive(_0x31a49c);logger['error'](_0x43ce('0x159'),_0x31a49c['name'],_0x43ce('0x15a'));}};};Dialer[_0x43ce('0x1a')][_0x43ce('0x15b')]=function(_0x2c8648){var _0x1e1dad=this;return function(){_0x1e1dad[_0x43ce('0x15c')](_0x2c8648);};};Dialer[_0x43ce('0x1a')][_0x43ce('0xa')]=function(_0x12282f){var _0x514a2b=this;if(isNotPreview(_0x12282f[_0x43ce('0x58')])){if(isVoiceQueueOutbound(_0x12282f[_0x43ce('0x4a')])&&isActive(_0x12282f[_0x43ce('0x57')])){_0x12282f['sendMessageOneNotActive']=!![];BPromise[_0x43ce('0xae')]()['then'](checkIsLoggedIn(_0x12282f,_0x12282f['loggedIn']))[_0x43ce('0xb0')](checkIsActive(_0x12282f,_0x12282f[_0x43ce('0x57')]))[_0x43ce('0xb0')](checkInterval(_0x12282f))[_0x43ce('0xb0')](_0x514a2b[_0x43ce('0x15d')](_0x12282f))[_0x43ce('0xb0')](_0x514a2b[_0x43ce('0x13e')](_0x12282f[_0x43ce('0x15e')],_0x12282f[_0x43ce('0x15f')],_0x12282f['name'],_0x12282f))['then'](_0x514a2b[_0x43ce('0x140')](_0x12282f[_0x43ce('0x3f')],_0x12282f['dialTimezone'],_0x12282f[_0x43ce('0x3b')],_0x12282f))[_0x43ce('0xb0')](_0x514a2b[_0x43ce('0x154')](_0x12282f))[_0x43ce('0xa7')](loggerCatchQueueSummary(_0x43ce('0x160'),_0x12282f));}else{notSendMessagesQueue(_0x12282f);}}else{freeVariablesPredictive(_0x12282f);}};Dialer['prototype']['syncCampaigns']=function(){var _0x2df413=this;var _0x1a95d4;for(var _0x53cbd1 in this[_0x43ce('0x21')]){if(typeof this[_0x43ce('0x21')][_0x53cbd1]!==_0x43ce('0x93')){_0x1a95d4=this[_0x43ce('0x21')][_0x53cbd1];if(isCampaignIvr(_0x1a95d4['type'])&&isActive(_0x1a95d4[_0x43ce('0xd4')])){_0x1a95d4[_0x43ce('0x99')]=!![];BPromise[_0x43ce('0xae')]()[_0x43ce('0xb0')](checkIsActive(_0x1a95d4,_0x1a95d4['active']))[_0x43ce('0xb0')](checkInterval(_0x1a95d4))[_0x43ce('0xb0')](_0x2df413[_0x43ce('0x15d')](_0x1a95d4))['then'](_0x2df413[_0x43ce('0x13e')](_0x1a95d4['dialGlobalInterval'],_0x1a95d4['dialTimezone'],_0x1a95d4[_0x43ce('0x3b')],_0x1a95d4))['then'](_0x2df413[_0x43ce('0x140')](_0x1a95d4[_0x43ce('0x3f')],_0x1a95d4['dialTimezone'],_0x1a95d4[_0x43ce('0x3b')],_0x1a95d4))[_0x43ce('0xb0')](_0x2df413[_0x43ce('0x15b')](_0x1a95d4))[_0x43ce('0xa7')](loggerCatchQueueSummary(_0x43ce('0x161'),_0x1a95d4));}else{notSendMessagesCampaign(_0x1a95d4);}}}};function getCallerIdRandom(_0x49f91f,_0x18bcb7){var _0x441fc3;var _0x973e10;var _0x303d32;if(_0x18bcb7<=0x0){_0x18bcb7=0x1;}_0x441fc3=new RegExp(_0x43ce('0x162')+_0x18bcb7+'}$');_0x973e10=Math[_0x43ce('0x163')](0xa,_0x18bcb7-0x1);_0x303d32=Math[_0x43ce('0x163')](0xa,_0x18bcb7)-0x1;return util[_0x43ce('0x73')]('%s',_[_0x43ce('0x164')](_0x49f91f,_0x441fc3,_[_0x43ce('0x165')](_0x973e10,_0x303d32)));}function extractCalleridName(_0x16b2df){var _0x29be0d=_0x16b2df['match'](/"(.*?)"/);return _0x29be0d?_0x29be0d[0x1]:_0x16b2df;}function extractCalleridNumber(_0x1f8e46){var _0x37cd6a=_0x1f8e46[_0x43ce('0x166')](/<(.*?)>/);return _0x37cd6a?_0x37cd6a[0x1]:_0x1f8e46;}Dialer['prototype'][_0x43ce('0x167')]=function(_0x43864c,_0x1b77c5){var _0x125d6c=this;var _0x217e49=uuid['v4']();this[_0x43ce('0xa2')][_0x217e49]=new Action(_0x43864c,_0x1b77c5,_0x217e49);return new BPromise(function(_0x5d5b30,_0xa51358){if(_[_0x43ce('0x7f')](_0x43864c)&&typeof _0x43864c!==_0x43ce('0x168')){return _0xa51358(msgResponse(_0x43ce('0x169'),_0x43ce('0x141'),_0x43ce('0x16a')));}if(_[_0x43ce('0x7f')](_0x1b77c5['Contact']['phone'])||_0x1b77c5[_0x43ce('0x16b')][_0x43ce('0x16c')]===null){return _0xa51358(msgResponse('originate',_0x43ce('0x141'),_0x43ce('0x16d')));}var _0x2436a6={'XMD-CALLERID':_0x125d6c[_0x43ce('0xa2')][_0x217e49]['getCaller'](),'XMD-AGI':_0x43864c[_0x43ce('0x105')]?util[_0x43ce('0x73')](_0x43ce('0x16e'),ipAgi,_0x43864c[_0x43ce('0x105')]):_0x43ce('0x16f'),'XMD-AGIAFTER':_0x43864c['dialQueueProject2']?util[_0x43ce('0x73')](_0x43ce('0x16e'),ipAgi,_0x43864c['dialQueueProject2']):_0x43ce('0x16f'),'XMD-QUEUE':_0x43864c[_0x43ce('0x4a')]===_0x43ce('0x4b')?util[_0x43ce('0x73')]('\x22%s,%s%s,,,%s\x22',_0x43864c[_0x43ce('0x3b')],_0x43864c[_0x43ce('0x170')]||'',_0x43864c[_0x43ce('0x10c')]?'c':'',_0x43864c[_0x43ce('0x171')]||0x3):_0x43ce('0x16f'),'XMD-CONTACTID':_0x1b77c5[_0x43ce('0xca')],'XMD-CDRTYPE':_0x43ce('0x7'),'CALLERID(all)':_0x125d6c[_0x43ce('0xa2')][_0x217e49][_0x43ce('0x172')](),'XMD-AMD':_0x43864c[_0x43ce('0xe5')]?'ACTIVE':_0x43ce('0x16f'),'XMD-DESTINATION':_0x43ce('0x173')};if(_0x43864c[_0x43ce('0xe5')]){_0x2436a6[_0x43ce('0x174')]=_0x43864c['dialAMDInitialSilence']||0x9c4;_0x2436a6[_0x43ce('0x175')]=_0x43864c[_0x43ce('0x176')]||0x5dc;_0x2436a6['XMD-AMDAFTERGREETINGSILENCE']=_0x43864c[_0x43ce('0x177')]||0x320;_0x2436a6[_0x43ce('0x178')]=_0x43864c[_0x43ce('0x179')]||0x1388;_0x2436a6[_0x43ce('0x17a')]=_0x43864c[_0x43ce('0x17b')]||0x64;_0x2436a6[_0x43ce('0x17c')]=_0x43864c['dialAMDBetweenWordsSilence']||0x32;_0x2436a6['XMD-AMDMAXIMUMNUMBEROFWORDS']=_0x43864c[_0x43ce('0x17d')]||0x3;_0x2436a6['XMD-AMDSILENCETHRESHOLD']=_0x43864c['dialAMDSilenceThreshold']||0x100;_0x2436a6[_0x43ce('0x17e')]=_0x43864c[_0x43ce('0x17f')]||0x1388;}if(_0x43864c['type']===_0x43ce('0x4b')){_0x2436a6['XMD-VOICEQUEUEID']=_0x1b77c5['VoiceQueueId'];}else{_0x2436a6['XMD-CAMPAIGNID']=_0x1b77c5[_0x43ce('0xce')];}for(var _0x3ff999 in _0x1b77c5[_0x43ce('0x16b')]){if(typeof _0x1b77c5[_0x43ce('0x16b')][_0x3ff999]!==_0x43ce('0x93')){if(isNotNull(_0x1b77c5[_0x43ce('0x16b')][_0x3ff999])&&_0x3ff999!=='id'&&_0x3ff999!=='tags'&&_0x3ff999!==_0x43ce('0x180')&&_0x3ff999!==_0x43ce('0x181')){_0x2436a6[util[_0x43ce('0x73')]('%s%s',_0x43ce('0x182'),_[_0x43ce('0x183')](_0x3ff999))]=_0x1b77c5[_0x43ce('0x16b')][_0x3ff999];}}}var _0x1e601d=_0x125d6c[_0x43ce('0xd3')](_0x43864c[_0x43ce('0x72')])?getCallerId(_0x43864c[_0x43ce('0x72')]['callerid'],_0x43864c[_0x43ce('0x59')],_0x43864c['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0x43864c['dialOriginateCallerIdNumber'],_0x43864c[_0x43ce('0x184')]):_0x43864c[_0x43ce('0x185')]):getCallerId(_['isNil'](_0x43864c[_0x43ce('0x13c')])?_0x43864c[_0x43ce('0x72')]['callerid']:_0x43864c['TrunkBackup'][_0x43ce('0x186')],_0x43864c[_0x43ce('0x59')],_0x43864c[_0x43ce('0x184')]>0x0?getCallerIdRandom(_0x43864c[_0x43ce('0x185')],_0x43864c[_0x43ce('0x184')]):_0x43864c['dialOriginateCallerIdNumber']);if(_0x1e601d){_0x2436a6['XMD-ORIGINATECALLERIDNAME']=_0x125d6c[_0x43ce('0xa2')][_0x217e49][_0x43ce('0x187')]=extractCalleridName(_0x1e601d);_0x2436a6['XMD-ORIGINATECALLERIDNUM']=_0x125d6c[_0x43ce('0xa2')][_0x217e49][_0x43ce('0x188')]=extractCalleridNumber(_0x1e601d);}return ami[_0x43ce('0x14e')]({'actionid':_0x217e49,'action':_0x43ce('0x169'),'channel':_0x125d6c[_0x43ce('0xd3')](_0x43864c[_0x43ce('0x72')])?util[_0x43ce('0x73')]('SIP/%s/%s%s',_0x43864c[_0x43ce('0x72')][_0x43ce('0x3b')],isNotNull(_0x43864c[_0x43ce('0x189')])?_0x43864c['dialPrefix']['trim']()||'':'',_0x43864c['dialCutDigit']>0x0?_0x1b77c5[_0x43ce('0x16b')][_0x43ce('0x16c')]['substring'](_0x43864c['dialCutDigit']):_0x1b77c5[_0x43ce('0x16b')][_0x43ce('0x16c')]):util[_0x43ce('0x73')](_0x43ce('0x18a'),_['isNil'](_0x43864c[_0x43ce('0x13c')])?_0x43864c['Trunk'][_0x43ce('0x3b')]:_0x43864c[_0x43ce('0x13c')][_0x43ce('0x3b')],isNotNull(_0x43864c[_0x43ce('0x189')])?_0x43864c[_0x43ce('0x189')]['trim']()||'':'',_0x43864c['dialCutDigit']>0x0?_0x1b77c5[_0x43ce('0x16b')]['phone'][_0x43ce('0x18b')](_0x43864c[_0x43ce('0x18c')]):_0x1b77c5[_0x43ce('0x16b')][_0x43ce('0x16c')]),'callerid':_0x1e601d,'Exten':_0x43ce('0x173'),'Context':_0x43ce('0x18d'),'Priority':'1','variable':_0x2436a6,'timeout':(_0x43864c[_0x43ce('0x18e')]||0x1e)*0x3e8,'async':!![],'channelid':_0x217e49})[_0x43ce('0xb0')](function(_0x3c4235){return _0x5d5b30(_0x3c4235);})[_0x43ce('0xa7')](function(_0x5a6949){_0x43864c[_0x43ce('0x63')]+=0x1;var _0x2218ed=new History(_0x125d6c[_0x43ce('0xa2')][_0x217e49]);logger[_0x43ce('0x90')](util[_0x43ce('0x73')](_0x43ce('0x18f'),JSON[_0x43ce('0x46')](_0x5a6949)));_0x2218ed[_0x43ce('0xde')]=0xe;_0x2218ed[_0x43ce('0x9e')]=_0x43ce('0x190');_0x2218ed['starttime']=moment()[_0x43ce('0x73')]('YYYY-MM-DD\x20HH:mm:ss');_0x2218ed[_0x43ce('0x9f')]=_0x2218ed[_0x43ce('0x11b')];_0x125d6c[_0x43ce('0xc1')](_0x2218ed)[_0x43ce('0xa7')](loggerCatch('[originate][error]'));_0x125d6c[_0x43ce('0xbf')](_0x2218ed)[_0x43ce('0xa7')](loggerCatch(_0x43ce('0x191')))['finally'](function(){delete _0x125d6c[_0x43ce('0xa2')][_0x217e49];return _0xa51358(msgResponse(_0x43ce('0x169'),_0x43ce('0x45'),_0x43ce('0x192')));});});});};Dialer['prototype']['syncOriginateResponse']=function(_0x23b1f5){var _0x13a76d=this[_0x43ce('0xa2')][_0x23b1f5['actionid']];if(_0x13a76d){delete this['actions'][_0x23b1f5[_0x43ce('0x125')]];_0x13a76d[_0x43ce('0x193')]=moment()['format'](_0x43ce('0xfa'));var _0x16a66b=_0x13a76d[_0x43ce('0x4a')]==='ivr'?this[_0x43ce('0x21')][_0x13a76d[_0x43ce('0xab')]]:this[_0x43ce('0x20')][_0x13a76d[_0x43ce('0x194')]()];if(!this[_0x43ce('0xd1')](_0x23b1f5[_0x43ce('0x195')])){this['updateOriginated'](_0x16a66b);return this[_0x43ce('0x196')](_0x13a76d,_0x16a66b,_0x23b1f5)['catch'](loggerCatch('[callProgressDetecting]\x20'));}this[_0x43ce('0x26')][_0x23b1f5[_0x43ce('0xd8')]]=_0x13a76d;}};Dialer[_0x43ce('0x1a')][_0x43ce('0x197')]=function(_0xbf6db1,_0x544ce7,_0x2d9d25){var _0x3a1c7f=new History(_0x544ce7);if(_0x3a1c7f[_0x43ce('0xec')]+_0x3a1c7f[_0x43ce('0x100')]+_0x3a1c7f['countnoanswerretry']+_0x3a1c7f['countnosuchnumberretry']+_0x3a1c7f['countdropretry']+_0x3a1c7f[_0x43ce('0xf0')]+_0x3a1c7f['countmachineretry']+_0x3a1c7f[_0x43ce('0xf1')]>=_0x2d9d25[_0x43ce('0xf2')]-0x1){return!![];}switch(_0xbf6db1){case 0x3:if(_0x3a1c7f[_0x43ce('0xed')]>=_0x2d9d25[_0x43ce('0x198')]-0x1){return!![];}this[_0x43ce('0xb8')]({'active':![],'countnoanswerretry':_0x3a1c7f[_0x43ce('0xed')]+=0x1,'scheduledat':moment()['add'](_0x2d9d25[_0x43ce('0x199')],_0x43ce('0xf9'))['format'](_0x43ce('0xfa')),'ContactId':_0x3a1c7f[_0x43ce('0xca')],'ListId':_0x3a1c7f[_0x43ce('0xcb')],'VoiceQueueId':_0x3a1c7f[_0x43ce('0xcd')]||undefined,'CampaignId':_0x3a1c7f['CampaignId']||undefined})[_0x43ce('0xa7')](loggerCatch(_0x43ce('0x19a')));break;case 0x5:if(_0x3a1c7f[_0x43ce('0xec')]>=_0x2d9d25['dialBusyMaxRetry']-0x1){return!![];}this[_0x43ce('0xb8')]({'active':![],'countbusyretry':_0x3a1c7f[_0x43ce('0xec')]+=0x1,'scheduledat':moment()[_0x43ce('0xf8')](_0x2d9d25[_0x43ce('0x19b')],_0x43ce('0xf9'))[_0x43ce('0x73')](_0x43ce('0xfa')),'ContactId':_0x3a1c7f[_0x43ce('0xca')],'ListId':_0x3a1c7f[_0x43ce('0xcb')],'VoiceQueueId':_0x3a1c7f[_0x43ce('0xcd')]||undefined,'CampaignId':_0x3a1c7f[_0x43ce('0xce')]||undefined})['catch'](loggerCatch(_0x43ce('0x19c')));break;case 0x8:if(_0x3a1c7f[_0x43ce('0x100')]>=_0x2d9d25[_0x43ce('0x19d')]-0x1){return!![];}this[_0x43ce('0xb8')]({'active':![],'countcongestionretry':_0x3a1c7f[_0x43ce('0x100')]+=0x1,'scheduledat':moment()[_0x43ce('0xf8')](_0x2d9d25[_0x43ce('0x19e')],_0x43ce('0xf9'))['format'](_0x43ce('0xfa')),'ContactId':_0x3a1c7f['ContactId'],'ListId':_0x3a1c7f[_0x43ce('0xcb')],'VoiceQueueId':_0x3a1c7f['VoiceQueueId']||undefined,'CampaignId':_0x3a1c7f[_0x43ce('0xce')]||undefined})[_0x43ce('0xa7')](loggerCatch(_0x43ce('0x19f')));break;case 0x0:if(_0x3a1c7f[_0x43ce('0xee')]>=_0x2d9d25[_0x43ce('0x1a0')]-0x1){return!![];}else{this[_0x43ce('0xb8')]({'active':![],'countnosuchnumberretry':_0x3a1c7f[_0x43ce('0xee')]+=0x1,'scheduledat':moment()[_0x43ce('0xf8')](_0x2d9d25['dialNoSuchNumberRetryFrequency'],_0x43ce('0xf9'))[_0x43ce('0x73')](_0x43ce('0xfa')),'ContactId':_0x3a1c7f[_0x43ce('0xca')],'ListId':_0x3a1c7f['ListId'],'VoiceQueueId':_0x3a1c7f['VoiceQueueId']||undefined,'CampaignId':_0x3a1c7f[_0x43ce('0xce')]||undefined})[_0x43ce('0xa7')](loggerCatch(_0x43ce('0x1a1')));}break;case 0xa:if(_0x3a1c7f[_0x43ce('0xef')]>=_0x2d9d25['dialDropMaxRetry']-0x1){return!![];}this[_0x43ce('0xb8')]({'active':![],'countdropretry':_0x3a1c7f[_0x43ce('0xef')]+=0x1,'scheduledat':moment()['add'](_0x2d9d25['dialDropRetryFrequency'],_0x43ce('0xf9'))[_0x43ce('0x73')](_0x43ce('0xfa')),'ContactId':_0x3a1c7f[_0x43ce('0xca')],'ListId':_0x3a1c7f['ListId'],'VoiceQueueId':_0x3a1c7f[_0x43ce('0xcd')]||undefined,'CampaignId':_0x3a1c7f[_0x43ce('0xce')]||undefined})[_0x43ce('0xa7')](loggerCatch(_0x43ce('0x11a')));break;case 0xb:if(_0x3a1c7f['countabandonedretry']>=_0x2d9d25[_0x43ce('0x1a2')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countabandonedretry':_0x3a1c7f[_0x43ce('0xf0')]+=0x1,'scheduledat':moment()['add'](_0x2d9d25[_0x43ce('0x121')],_0x43ce('0xf9'))[_0x43ce('0x73')](_0x43ce('0xfa')),'ContactId':_0x3a1c7f['ContactId'],'ListId':_0x3a1c7f[_0x43ce('0xcb')],'VoiceQueueId':_0x3a1c7f[_0x43ce('0xcd')]||undefined,'CampaignId':_0x3a1c7f['CampaignId']||undefined})[_0x43ce('0xa7')](loggerCatch(_0x43ce('0x122')));break;case 0x13:if(_0x3a1c7f[_0x43ce('0xe9')]>=_0x2d9d25['dialMachineMaxRetry']-0x1){return!![];}this[_0x43ce('0xb8')]({'active':![],'countmachineretry':_0x3a1c7f[_0x43ce('0xe9')]+=0x1,'scheduledat':moment()[_0x43ce('0xf8')](_0x2d9d25[_0x43ce('0x101')],_0x43ce('0xf9'))[_0x43ce('0x73')](_0x43ce('0xfa')),'ContactId':_0x3a1c7f[_0x43ce('0xca')],'ListId':_0x3a1c7f[_0x43ce('0xcb')],'VoiceQueueId':_0x3a1c7f[_0x43ce('0xcd')]||undefined,'CampaignId':_0x3a1c7f[_0x43ce('0xce')]||undefined})[_0x43ce('0xa7')](loggerCatch(_0x43ce('0xfb')));break;case 0x14:if(_0x3a1c7f[_0x43ce('0xf1')]>=_0x2d9d25['dialAgentRejectMaxRetry']-0x1){return!![];}this[_0x43ce('0xb8')]({'active':![],'countagentrejectretry':_0x3a1c7f['countagentrejectretry']+=0x1,'scheduledat':moment()[_0x43ce('0xf8')](_0x2d9d25[_0x43ce('0x1a3')],_0x43ce('0xf9'))['format'](_0x43ce('0xfa')),'ContactId':_0x3a1c7f[_0x43ce('0xca')],'ListId':_0x3a1c7f[_0x43ce('0xcb')],'VoiceQueueId':_0x3a1c7f['VoiceQueueId']||undefined,'CampaignId':_0x3a1c7f[_0x43ce('0xce')]||undefined})[_0x43ce('0xa7')](loggerCatch(_0x43ce('0x1a4')));break;default:return!![];}};Dialer[_0x43ce('0x1a')][_0x43ce('0x196')]=function(_0x3f2101,_0x15735f,_0x489653){var _0x402dad=this;var _0x5c9611=new History(_0x3f2101);return new BPromise(function(_0x5bae34,_0x1c89c9){if(_[_0x43ce('0x7f')](_0x15735f)&&typeof _0x15735f!==_0x43ce('0x168')){return _0x1c89c9(msgResponse(_0x43ce('0x1a5'),_0x43ce('0x141'),'entity\x20is\x20undefine'));}if(_[_0x43ce('0x7f')](_0x489653)&&typeof _0x489653!==_0x43ce('0x168')){return _0x1c89c9(msgResponse('[callProgressDetecting]',_0x43ce('0x141'),_0x43ce('0x1a6')));}switch(_0x489653[_0x43ce('0x10a')]){case'0':_0x15735f['outboundNoSuchCallsDay']+=0x1;_0x5c9611[_0x43ce('0xde')]=0x0;_0x5c9611[_0x43ce('0x9e')]='NoSuchNumber';_0x5c9611[_0x43ce('0xee')]+=0x1;_0x5c9611[_0x43ce('0xea')]+=0x1;ami[_0x43ce('0x49')](_0x43ce('0x1a7'),ut[_0x43ce('0xe1')](_0x3f2101,_0x43ce('0x1a8')));_0x402dad[_0x43ce('0xc1')](_0x5c9611)[_0x43ce('0xa7')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x402dad[_0x43ce('0x197')](0x0,_0x3f2101,_0x15735f)){if(_0x5c9611[_0x43ce('0xee')]>=_0x15735f[_0x43ce('0x1a0')]){_0x402dad['createStateFinal'](_0x5c9611,_0x5bae34,_0x1c89c9,_0x43ce('0x1a9'));}else{_0x402dad['stateGlobal'](_0x5c9611,_0x5bae34,_0x1c89c9,_0x43ce('0x1a9'));}}break;case'3':_0x15735f[_0x43ce('0x61')]+=0x1;_0x5c9611[_0x43ce('0xde')]=0x3;_0x5c9611['statedesc']=_0x43ce('0x1aa');_0x5c9611[_0x43ce('0xed')]+=0x1;_0x5c9611[_0x43ce('0xea')]+=0x1;ami['emit'](_0x43ce('0x1ab'),ut[_0x43ce('0xe1')](_0x3f2101,'noanswer'));_0x402dad[_0x43ce('0xc1')](_0x5c9611)[_0x43ce('0xa7')](loggerCatch(_0x43ce('0x1ac')));if(_0x402dad['checkRetriveMax'](0x3,_0x3f2101,_0x15735f)){if(_0x5c9611[_0x43ce('0xed')]>=_0x15735f[_0x43ce('0x198')]){_0x402dad[_0x43ce('0xf6')](_0x5c9611,_0x5bae34,_0x1c89c9,_0x43ce('0x1ad'));}else{_0x402dad[_0x43ce('0xf3')](_0x5c9611,_0x5bae34,_0x1c89c9,'reason\x203\x20ringing\x20no\x20answer');}}break;case'5':_0x15735f[_0x43ce('0x5c')]+=0x1;_0x5c9611['state']=0x5;_0x5c9611[_0x43ce('0x9e')]=_0x43ce('0x1ae');_0x5c9611[_0x43ce('0xec')]+=0x1;_0x5c9611['countglobal']+=0x1;ami[_0x43ce('0x49')](_0x43ce('0x1af'),ut[_0x43ce('0xe1')](_0x3f2101,_0x43ce('0x1b0')));_0x402dad[_0x43ce('0xc1')](_0x5c9611)['catch'](loggerCatch('[syncAgentComplete][createHistory][5]'));if(_0x402dad[_0x43ce('0x197')](0x5,_0x3f2101,_0x15735f)){if(_0x5c9611[_0x43ce('0xec')]>=_0x15735f[_0x43ce('0x1b1')]){_0x402dad['createStateFinal'](_0x5c9611,_0x5bae34,_0x1c89c9,_0x43ce('0x1b2'));}else{_0x402dad[_0x43ce('0xf3')](_0x5c9611,_0x5bae34,_0x1c89c9,_0x43ce('0x1b2'));}}break;case'8':_0x15735f[_0x43ce('0x5d')]+=0x1;_0x5c9611[_0x43ce('0xde')]=0x8;_0x5c9611[_0x43ce('0x9e')]=_0x43ce('0x1b3');_0x5c9611[_0x43ce('0x100')]+=0x1;_0x5c9611[_0x43ce('0xea')]+=0x1;ami[_0x43ce('0x49')](_0x43ce('0x1b4'),ut[_0x43ce('0xe1')](_0x3f2101,_0x43ce('0x1b5')));_0x402dad[_0x43ce('0xc1')](_0x5c9611)['catch'](loggerCatch('[syncAgentComplete][createHistory][8]'));if(_0x402dad[_0x43ce('0x197')](0x8,_0x3f2101,_0x15735f)){if(_0x5c9611[_0x43ce('0x100')]>=_0x15735f[_0x43ce('0x19d')]){_0x402dad[_0x43ce('0xf6')](_0x5c9611,_0x5bae34,_0x1c89c9,_0x43ce('0x1b6'));}else{_0x402dad['stateGlobal'](_0x5c9611,_0x5bae34,_0x1c89c9,_0x43ce('0x1b6'));}}break;case'11':_0x15735f['outboundAbandonedCallsDay']+=0x1;_0x5c9611['state']=0xb;_0x5c9611[_0x43ce('0x9e')]=_0x43ce('0x11f');_0x5c9611[_0x43ce('0xf0')]+=0x1;_0x5c9611[_0x43ce('0xea')]+=0x1;_0x402dad[_0x43ce('0xc1')](_0x5c9611)['catch'](loggerCatch(_0x43ce('0x123')));if(_0x402dad[_0x43ce('0x197')](0xb,_0x3f2101,_0x15735f)){if(_0x5c9611[_0x43ce('0xf0')]>=_0x15735f[_0x43ce('0x1a2')]){_0x402dad['createStateFinal'](_0x5c9611,_0x5bae34,_0x1c89c9,_0x43ce('0x1b7'));}else{_0x402dad[_0x43ce('0xf3')](_0x5c9611,_0x5bae34,_0x1c89c9,_0x43ce('0x1b7'));}}break;case'20':_0x15735f[_0x43ce('0x1b8')]+=0x1;_0x5c9611[_0x43ce('0xde')]=0x14;_0x5c9611['statedesc']=_0x43ce('0x1b9');_0x5c9611[_0x43ce('0xf1')]+=0x1;_0x5c9611[_0x43ce('0xea')]+=0x1;ami[_0x43ce('0x49')](_0x43ce('0x1ba'),ut[_0x43ce('0xe1')](_0x3f2101,_0x43ce('0x1bb')));_0x402dad['createHistory'](_0x5c9611)[_0x43ce('0xa7')](loggerCatch(_0x43ce('0x1bc')));if(_0x402dad[_0x43ce('0x197')](0x14,_0x3f2101,_0x15735f)){if(_0x5c9611[_0x43ce('0xf1')]>=_0x15735f[_0x43ce('0x1bd')]){_0x402dad['createStateFinal'](_0x5c9611,_0x5bae34,_0x1c89c9,_0x43ce('0x1be'));}else{_0x402dad[_0x43ce('0xf3')](_0x5c9611,_0x5bae34,_0x1c89c9,'reason\x2020\x20agentreject');}}break;default:_0x15735f[_0x43ce('0x108')]+=0x1;_0x5c9611[_0x43ce('0xde')]=0xc;_0x5c9611[_0x43ce('0x9e')]=_0x489653[_0x43ce('0x10a')];_0x402dad[_0x43ce('0xc1')](_0x5c9611)[_0x43ce('0xa7')](loggerCatch(_0x43ce('0x1bf')));if(_0x402dad['checkRetriveMax'](_0x489653[_0x43ce('0x10a')],_0x3f2101,_0x15735f)){if(_0x5c9611['countbusyretry']+_0x5c9611[_0x43ce('0x100')]+_0x5c9611[_0x43ce('0xed')]+_0x5c9611[_0x43ce('0xee')]+_0x5c9611[_0x43ce('0xef')]+_0x5c9611[_0x43ce('0xf0')]+_0x5c9611['countmachineretry']+_0x5c9611[_0x43ce('0xf1')]>=_0x15735f[_0x43ce('0xf2')]){_0x402dad[_0x43ce('0xf3')](_0x5c9611,_0x5bae34,_0x1c89c9,_0x489653[_0x43ce('0x10a')]);}else{_0x402dad[_0x43ce('0xf6')](_0x5c9611,_0x5bae34,_0x1c89c9,_0x489653[_0x43ce('0x10a')]);}}}});};Dialer[_0x43ce('0x1a')][_0x43ce('0xf3')]=function(_0x270580,_0x195313,_0x1917b2,_0x565ce9){var _0x4711db=new Final(_0x270580);_0x4711db[_0x43ce('0xde')]=0xf;_0x4711db[_0x43ce('0x9e')]='Global';this[_0x43ce('0xf6')](_0x4711db,_0x195313,_0x1917b2,_0x565ce9);};Dialer[_0x43ce('0x1a')]['createStateFinal']=function(_0x37b911,_0x196d1a,_0x58b1b9,_0x172822){this[_0x43ce('0xbf')](_0x37b911)[_0x43ce('0xb0')](function(){return _0x196d1a(msgResponse(_0x43ce('0x1a5'),_0x43ce('0xd2'),_0x172822));})[_0x43ce('0xa7')](function(){return _0x58b1b9(msgResponse(_0x43ce('0x1c0'),'Failure',_0x43ce('0x1c1')));});};Dialer[_0x43ce('0x1a')][_0x43ce('0x158')]=function(_0x548077){var _0x2f2e35=_0x548077[_0x43ce('0x1c2')]/0x64;var _0x3b7128=_0x548077['outboundDropCallsDayTimeout']/(_0x548077['outboundDropCallsDayTimeout']+_0x548077[_0x43ce('0x5b')]);var _0x1c74ee=Math[_0x43ce('0x1c3')](_0x548077['predictiveIntervalAvailable']*(_0x548077['predictiveIntervalMaxThreshold']/0x64));var _0x1d1dd2=Math[_0x43ce('0x1c3')](_0x548077['predictiveIntervalAvailable']*(_0x548077['predictiveIntervalMinThreshold']/0x64));var _0x2527d1=_0x548077['available']+_0x548077[_0x43ce('0x52')];var _0x14dd4a=Math[_0x43ce('0x1c4')](_0x548077[_0x43ce('0x6e')]*_0x548077[_0x43ce('0x6f')]*_0x548077[_0x43ce('0x6a')]*_0x548077[_0x43ce('0x1c5')]);if(_[_0x43ce('0x7f')](_0x548077['startProgressive'])){if(!_[_0x43ce('0x7f')](_0x548077[_0x43ce('0x71')])){_0x548077['startPredictive']=undefined;loggerPredictive['error'](_0x43ce('0x1c6'),_0x43ce('0x1c7'));}if(!_[_0x43ce('0x7f')](_0x548077[_0x43ce('0x89')])){loggerPredictive[_0x43ce('0x90')](_0x43ce('0x1c6'),_0x43ce('0x1c8'));clearInterval(_0x548077[_0x43ce('0x89')]);_0x548077[_0x43ce('0x89')]=undefined;}_0x548077[_0x43ce('0x86')]=moment()[_0x43ce('0x73')](_0x43ce('0xfa'));loggerPredictive[_0x43ce('0x78')](_0x548077[_0x43ce('0x3b')],_0x43ce('0x1c9'),_0x548077[_0x43ce('0x86')]);this[_0x43ce('0x156')](_0x548077,0x1);}else if(ifInterval(_0x548077[_0x43ce('0x1ca')],_0x548077[_0x43ce('0x86')])){this[_0x43ce('0x156')](_0x548077,0x1);loggerPredictiveCalls['info'](_0x43ce('0x1cb'),_0x548077[_0x43ce('0x86')],_0x548077[_0x43ce('0x3b')]);_0x548077['erlangCalls']=0x0;_0x548077[_0x43ce('0x69')]=0x0;}else if(_0x2f2e35<_0x3b7128&&_0x548077[_0x43ce('0x1cc')]===_0x43ce('0x1cd')){freeVariablesPredictive(_0x548077);loggerPredictive[_0x43ce('0x78')](_0x43ce('0x1ce'),_0x43ce('0x1cf'),_0x3b7128,'startProgressive',_0x548077[_0x43ce('0x3b')]);}else if(_0x14dd4a<_0x548077[_0x43ce('0x69')]&&_0x548077[_0x43ce('0x1cc')]===_0x43ce('0x1cd')){freeVariablesPredictive(_0x548077);loggerPredictive[_0x43ce('0x78')](_0x43ce('0x1d0'),'Max\x20Drop\x20',_0x14dd4a,'Drop\x20in\x20this\x20interval',_0x548077[_0x43ce('0x69')],_0x43ce('0x86'),_0x548077[_0x43ce('0x3b')]);}else if(!ifInterval(_0x548077[_0x43ce('0x1ca')],_0x548077['startProgressive'])&&_[_0x43ce('0x7f')](_0x548077['startPredictive'])&&!_[_0x43ce('0x7f')](_0x548077[_0x43ce('0x86')])){_0x548077[_0x43ce('0x71')]=moment()[_0x43ce('0x73')](_0x43ce('0xfa'));loggerPredictive[_0x43ce('0x78')](_0x548077[_0x43ce('0x3b')],_0x43ce('0x1d1'),_0x548077[_0x43ce('0x71')]);this[_0x43ce('0xb5')](_0x548077[_0x43ce('0x1ca')])[_0x43ce('0xb0')](this[_0x43ce('0x1d2')](_0x548077))[_0x43ce('0xb0')](mergeDataErlangB(_0x548077))['then'](this['startMethodPredictive'](_0x548077))[_0x43ce('0xa7')](loggerCatchPredictive('Predictive\x20after\x20first\x20interval',_0x548077));}else if(!ifInterval(_0x548077['dialPredictiveInterval'],_0x548077[_0x43ce('0x71')])){_0x548077[_0x43ce('0x69')]=0x0;_0x548077[_0x43ce('0x71')]=moment()[_0x43ce('0x73')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x43ce('0x78')](_0x548077[_0x43ce('0x3b')],'recalculate\x20predictive\x20at',_0x548077[_0x43ce('0x71')]);clearInterval(_0x548077[_0x43ce('0x89')]);_0x548077['handlePredictive']=undefined;this[_0x43ce('0xb5')](_0x548077['dialPredictiveInterval'])[_0x43ce('0xb0')](this[_0x43ce('0x1d2')](_0x548077))[_0x43ce('0xb0')](mergeDataErlangB(_0x548077))[_0x43ce('0xb0')](this['startMethodPredictive'](_0x548077))['catch'](loggerCatchPredictive(_0x43ce('0x1d3'),_0x548077));}else if(_0x548077[_0x43ce('0x6c')]&&_0x2527d1<_0x548077[_0x43ce('0x6c')]-_0x1d1dd2){freeVariablesPredictive(_0x548077);loggerPredictive['info'](_0x548077['name'],_0x43ce('0x1d4'),_0x2527d1,')\x20are\x20less\x20than\x20threshold\x20(',_0x548077[_0x43ce('0x6c')],'-',_0x1d1dd2,'=',_0x548077[_0x43ce('0x6c')]-_0x1d1dd2,')');}else if(_0x548077[_0x43ce('0x6c')]&&_0x2527d1>_0x548077[_0x43ce('0x6c')]+_0x1c74ee){freeVariablesPredictive(_0x548077);loggerPredictive[_0x43ce('0x78')](_0x548077['name'],_0x43ce('0x1d4'),_0x2527d1,_0x43ce('0x1d5'),_0x548077[_0x43ce('0x6c')],'+',_0x1c74ee,'=',_0x548077[_0x43ce('0x6c')]+_0x1c74ee,')');}};Dialer['prototype']['getDataPredictive']=function(_0x415444){var _0x3558d1=this;return function(_0x400cca){return new BPromise(function(_0x5c5c72,_0x8b7942){_[_0x43ce('0xc8')](_0x415444,_0x400cca[0x0]);if(checkGetDataPredictive(_0x400cca[0x0])){var _0x4cdba2=_0x415444[_0x43ce('0x6c')]=_0x415444[_0x43ce('0x52')]+_0x415444['available'];var _0x3bc3ba=_0x415444[_0x43ce('0x1ca')]*0x3c;var _0x1343d5=_0x400cca[0x0][_0x43ce('0x66')]+_0x400cca[0x0][_0x43ce('0x7d')];var _0x23d73c=(_0x400cca[0x0][_0x43ce('0x65')]+_0x400cca[0x0][_0x43ce('0x68')]+_0x400cca[0x0][_0x43ce('0x67')])/_0x400cca[0x0][_0x43ce('0x6d')];_0x415444[_0x43ce('0x6a')]=_0x23d73c>0x0?_0x23d73c:0x1;switch(_0x415444[_0x43ce('0x1cc')]){case _0x43ce('0x1cd'):var _0x3e2c5a=_0x415444[_0x43ce('0x1c2')]/0x64;return _0x3558d1[_0x43ce('0x1d6')](_0x4cdba2,_0x3bc3ba,_0x1343d5,_0x23d73c,_0x3e2c5a)['then'](function(_0x5e4b05){return _0x5c5c72(_0x5e4b05);});case _0x43ce('0x1d7'):var _0x2961a2=_0x415444[_0x43ce('0x1c2')]/0x64;return _0x3558d1['busyFactor'](_0x4cdba2,_0x3bc3ba,_0x1343d5,_0x23d73c,_0x2961a2)[_0x43ce('0xb0')](function(_0x155279){return _0x5c5c72(_0x155279);});default:return _0x8b7942(msgResponse(_0x43ce('0x1d8'),_0x43ce('0x141'),_0x43ce('0x1d9')));}}else{return _0x8b7942(msgResponse(_0x43ce('0x1d8'),'Failure',_0x43ce('0x1da')));}});};};Dialer[_0x43ce('0x1a')][_0x43ce('0x1db')]=function(_0x551734){var _0xf2ac01=this;return function(_0x2fdad7){return new BPromise(function(_0x1b8501,_0x12efe0){_[_0x43ce('0xc8')](_0x551734,_0x2fdad7[0x0]);if(checkGetDataPredictive(_0x2fdad7[0x0])){loggerPredictive[_0x43ce('0x78')](JSON[_0x43ce('0x46')](_0x2fdad7[0x0]));if(_0x551734[_0x43ce('0x1cc')]==='dropRate'){return _0xf2ac01[_0x43ce('0xbe')](_0x551734['id'])['then'](function(_0xb01d24){var _0x284b96=_0x551734[_0x43ce('0x1dc')]-_0xb01d24[0x0][_0x43ce('0x1dd')];var _0x543acb=_0x551734[_0x43ce('0x1ca')]*0x3c;var _0x12a917=_0x2fdad7[0x0]['predictiveIntervalAvgTalktime']+_0x2fdad7[0x0][_0x43ce('0x7d')];var _0x106982=(_0x2fdad7[0x0][_0x43ce('0x65')]+_0x2fdad7[0x0][_0x43ce('0x68')]+_0x2fdad7[0x0][_0x43ce('0x67')])/_0x2fdad7[0x0][_0x43ce('0x6d')];var _0x221961=_0x551734['dialPredictiveOptimizationPercentage']/0x64;_0x551734['predictiveIntervalPauses']=_0xb01d24[0x0][_0x43ce('0x1dd')]||0x0;_0x551734[_0x43ce('0x6a')]=_0x106982>0x0?_0x106982:0x1;return _0xf2ac01[_0x43ce('0x1d6')](_0x284b96,_0x543acb,_0x12a917,_0x106982,_0x221961);})[_0x43ce('0xb0')](function(_0x2da1c8){return _0x1b8501(_0x2da1c8);})[_0x43ce('0xa7')](function(_0x5c3902){return _0x12efe0(msgResponse(_0x43ce('0x1de'),_0x43ce('0x141'),JSON[_0x43ce('0x46')](_0x5c3902)));});}if(_0x551734[_0x43ce('0x1cc')]===_0x43ce('0x1d7')){return _0xf2ac01[_0x43ce('0xbe')](_0x551734['id'])[_0x43ce('0xb0')](function(_0x44c443){var _0x1b40eb=_0x551734[_0x43ce('0x1dc')]-_0x44c443[0x0][_0x43ce('0x1dd')];var _0x15a165=_0x551734[_0x43ce('0x1ca')]*0x3c;var _0xb00f94=_0x2fdad7[0x0]['predictiveIntervalAvgTalktime']+_0x2fdad7[0x0][_0x43ce('0x7d')];var _0x3a2751=(_0x2fdad7[0x0][_0x43ce('0x65')]+_0x2fdad7[0x0][_0x43ce('0x68')]+_0x2fdad7[0x0][_0x43ce('0x67')])/_0x2fdad7[0x0][_0x43ce('0x6d')];var _0x2255ea=_0x551734[_0x43ce('0x1c2')]/0x64;_0x551734['predictiveIntervalPauses']=_0x44c443[0x0][_0x43ce('0x1dd')]||0x0;_0x551734['predictiveIntervalHitRate']=_0x3a2751>0x0?_0x3a2751:0x1;return _0xf2ac01[_0x43ce('0x1df')](_0x1b40eb,_0x15a165,_0xb00f94,_0x3a2751,_0x2255ea);})['then'](function(_0x51b1f3){return _0x1b8501(_0x51b1f3);})[_0x43ce('0xa7')](function(_0x3a98f5){return _0x12efe0(msgResponse(_0x43ce('0x1de'),_0x43ce('0x141'),JSON[_0x43ce('0x46')](_0x3a98f5)));});}}else{return _0x12efe0(msgResponse('[getDataPredictive]',_0x43ce('0x141'),_0x43ce('0x1da')));}});};};Dialer[_0x43ce('0x1a')][_0x43ce('0x1e0')]=function(_0x34934f){var _0x1e6e5f=this;return function(){var _0x3af826=0x0;var _0x559e87=Math['floor'](_0x34934f[_0x43ce('0x84')]*0x3e8);if(_0x559e87>0x0){_0x559e87=_0x559e87<0x64?0x64:_0x559e87;loggerPredictive[_0x43ce('0x78')](_0x34934f[_0x43ce('0x3b')],'one\x20call\x20every:',_0x559e87,_0x43ce('0x47'));_0x34934f[_0x43ce('0x89')]=setInterval(function(){_0x1e6e5f[_0x43ce('0x89')](_0x34934f);loggerPredictiveCalls[_0x43ce('0x78')](_0x43ce('0x1e1'),_0x3af826+=0x1);},_0x559e87);}else{loggerPredictive[_0x43ce('0x78')](_0x34934f[_0x43ce('0x3b')],_0x43ce('0x1e2'));}};};Dialer[_0x43ce('0x1a')][_0x43ce('0x1e3')]=function(_0x5c59f0,_0x3bfd8e){var _0x3da741=this;return function(_0x46b0ab){if(_[_0x43ce('0x43')](_0x46b0ab)){if(_['isNil'](_0x3bfd8e[_0x43ce('0xcc')])||!_0x3bfd8e[_0x43ce('0x1e4')]){if(_0x5c59f0[_0x43ce('0x58')]===_0x43ce('0x1e5')){_0x5c59f0[_0x43ce('0x12b')]=_[_0x43ce('0x7f')](_0x5c59f0['queueStatusComplete'])?!![]:_0x5c59f0[_0x43ce('0x12b')];var _0x2fc66e=uuid['v4']();_0x3da741[_0x43ce('0xa2')][_0x2fc66e]=new Action(_0x5c59f0,_0x3bfd8e,_0x2fc66e);loggerBooked[_0x43ce('0x78')](_0x43ce('0x1e6'),_0x2fc66e,_0x43ce('0x1e7'),JSON[_0x43ce('0x46')](_0x5c59f0[_0x43ce('0x12b')]),_0x43ce('0x1e8'),_0x5c59f0[_0x43ce('0x3b')]);if(_0x5c59f0[_0x43ce('0x12b')]){_0x5c59f0[_0x43ce('0x12b')]=![];_0x3da741[_0x43ce('0x29')][_0x3da741[_0x43ce('0xa2')][_0x2fc66e][_0x43ce('0xab')]]=[];ami[_0x43ce('0x14e')]({'actionid':_0x2fc66e,'action':'queuestatus','queue':_0x5c59f0['name']})[_0x43ce('0xa7')](function(){_0x3da741[_0x43ce('0xa9')](_0x5c59f0);_0x3da741['rescheduleContact']({'active':![],'ContactId':_0x3da741[_0x43ce('0xa2')][_0x2fc66e][_0x43ce('0xca')],'ListId':_0x3da741[_0x43ce('0xa2')][_0x2fc66e][_0x43ce('0xcb')],'VoiceQueueId':_0x3da741['actions'][_0x2fc66e][_0x43ce('0xcd')]||undefined,'CampaignId':_0x3da741[_0x43ce('0xa2')][_0x2fc66e]['CampaignId']||undefined})[_0x43ce('0xa7')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x3da741[_0x43ce('0xa2')][_0x2fc66e];});}else{loggerBooked[_0x43ce('0x78')](_0x43ce('0x1e9'),JSON[_0x43ce('0x46')](_0x5c59f0[_0x43ce('0x12b')]),_0x43ce('0x1e8'),_0x5c59f0[_0x43ce('0x3b')]);_0x3da741[_0x43ce('0xa9')](_0x5c59f0);_0x3da741[_0x43ce('0xb8')]({'active':![],'ContactId':_0x3da741[_0x43ce('0xa2')][_0x2fc66e][_0x43ce('0xca')],'ListId':_0x3da741[_0x43ce('0xa2')][_0x2fc66e]['ListId'],'VoiceQueueId':_0x3da741['actions'][_0x2fc66e][_0x43ce('0xcd')]||undefined,'CampaignId':_0x3da741[_0x43ce('0xa2')][_0x2fc66e]['CampaignId']||undefined})[_0x43ce('0xa7')](loggerCatch(_0x43ce('0x1ea')));delete _0x3da741[_0x43ce('0xa2')][_0x2fc66e];}}else{return _0x3da741[_0x43ce('0x167')](_0x5c59f0,_0x3bfd8e);}}else{if(getDiff(_0x3bfd8e['scheduledat'])<_0x5c59f0['dialRecallMeTimeout']*0x3c){if(_0x3bfd8e[_0x43ce('0x1eb')]&&!_0x3bfd8e[_0x43ce('0x1eb')]['voicePause']){_0x3da741['preview'][_0x43ce('0x12f')](_0x3bfd8e['id'])['finally'](function(){_0x3da741[_0x43ce('0xa9')](_0x5c59f0);});}else{_0x3da741['unlockContact']({'active':![]},_0x3bfd8e['id'],0x1)[_0x43ce('0x1d')](function(){_0x3da741['updateOriginated'](_0x5c59f0);});}}else{_0x5c59f0[_0x43ce('0x64')]+=0x1;_0x3da741[_0x43ce('0xa9')](_0x5c59f0);if(_0x5c59f0[_0x43ce('0x1ec')]){_0x3da741['rescheduleContact']({'active':![],'recallme':![],'UserId':null,'ContactId':_0x3bfd8e[_0x43ce('0xca')],'ListId':_0x3bfd8e[_0x43ce('0xcb')],'VoiceQueueId':_0x3bfd8e[_0x43ce('0xcd')]||undefined,'CampaignId':_0x3bfd8e[_0x43ce('0xce')]||undefined})['catch'](loggerCatch('[rescheduleContact][dialRecallInQueue]'));_0x3da741['createHistory'](createObjHistory(_0x5c59f0,_0x3bfd8e,_0x43ce('0x1ed'),0x17,'RecallInQueue'))[_0x43ce('0xa7')](loggerCatch(_0x43ce('0x1ee')));}else{_0x3da741[_0x43ce('0xfc')](createObjHistory(_0x5c59f0,_0x3bfd8e,_0x43ce('0x1ef'),0x16,_0x43ce('0x1f0')),_0x43ce('0x1f1'),'[Originate][HistoryRecallClose]');}}}}else{_0x5c59f0[_0x43ce('0x1f2')]+=0x1;_0x3da741[_0x43ce('0xfc')](createObjHistory(_0x5c59f0,_0x3bfd8e,'BLACKLIST',0xd,_0x43ce('0x1f3')),'[Originate][historyBlacklist]',_0x43ce('0x1f4'));throw _0x43ce('0x1f5');}};};Dialer[_0x43ce('0x1a')][_0x43ce('0x15c')]=function(_0x44b9a5){var _0x562589=this;var _0x4e52fc=_0x44b9a5[_0x43ce('0x1f6')]-_0x44b9a5['originated']-_0x44b9a5[_0x43ce('0xbc')];emitCampaignSummary(_0x44b9a5);if(_0x4e52fc>0x0){if(_0x4e52fc>this[_0x43ce('0x24')]){_0x4e52fc=this['maxNumberOriginate'];}_0x44b9a5[_0x43ce('0xbc')]+=_0x4e52fc;this['getContactDialerIvr'](_0x44b9a5['id'],_0x4e52fc,_0x44b9a5[_0x43ce('0x1f7')],_0x44b9a5)['then'](function(_0x48d7cd){_0x44b9a5[_0x43ce('0xbc')]-=_0x4e52fc;_0x44b9a5[_0x43ce('0xbc')]=_0x44b9a5['temp']>0x0?_0x44b9a5['temp']:0x0;if(!checkContactEmpty(_0x48d7cd)){_0x44b9a5[_0x43ce('0x39')]=_0x43ce('0x98');logger['info'](_0x43ce('0x1f8')+_0x44b9a5[_0x43ce('0x3b')]);}else{_0x44b9a5['originated']+=_0x48d7cd[_0x43ce('0x91')];_0x44b9a5[_0x43ce('0x39')]=_0x43ce('0x1f9');for(var _0x1ee712=0x0;_0x1ee712<_0x48d7cd[_0x43ce('0x91')];_0x1ee712+=0x1){_0x44b9a5[_0x43ce('0x1fa')]+=0x1;if(_[_0x43ce('0xa4')](_0x48d7cd[_0x1ee712])||_[_0x43ce('0xa4')](_0x48d7cd[_0x1ee712][_0x43ce('0x16b')])||_[_0x43ce('0xa4')](_0x48d7cd[_0x1ee712][_0x43ce('0x16b')]['phone'])){_0x562589[_0x43ce('0xc6')](_0x43ce('0x1fb'),_0x44b9a5,_0x48d7cd[_0x1ee712]);}else{_0x562589['checkIsBlackListIvr'](_['pick'](_0x48d7cd[_0x1ee712],[_0x43ce('0xce'),_0x43ce('0x1fc')]))[_0x43ce('0xb0')](_0x562589[_0x43ce('0x1e3')](_0x44b9a5,_0x48d7cd[_0x1ee712]))[_0x43ce('0xa7')](_0x562589[_0x43ce('0xc5')](_0x43ce('0x1fd'),_0x44b9a5));}}}})[_0x43ce('0xa7')](loggerGetContactDialer(_0x43ce('0x1fe'),_0x44b9a5,_0x4e52fc));}};Dialer['prototype'][_0x43ce('0x156')]=function(_0x413fbb,_0x447f8e){var _0x176150=this;var _0x309d45=[];var _0x4e087a=_0x447f8e>=0x1?_0x447f8e:0x1;if(_0x413fbb['dialMethod']==='booked'){_0x4e087a=0x1;}var _0x23b21f=Math[_0x43ce('0x1c4')](_0x413fbb['available']*_0x4e087a)-_0x413fbb[_0x43ce('0x92')]-_0x413fbb['temp'];emitVoiceQueueSummary(_0x413fbb);if(_0x413fbb[_0x43ce('0x1ff')]>0x0){var _0x58e167=_0x413fbb[_0x43ce('0x1ff')]-_0x413fbb[_0x43ce('0x92')]-_0x413fbb[_0x43ce('0x52')]-_0x413fbb[_0x43ce('0xbc')]-_0x413fbb['pTalking'];if(_0x23b21f>_0x58e167){_0x23b21f=_0x58e167;}}if(_0x23b21f>0x0){if(_0x413fbb[_0x43ce('0x58')]===_0x43ce('0x1e5')){_0x23b21f=0x1;}if(_0x23b21f>this['maxNumberOriginate']){_0x23b21f=this['maxNumberOriginate'];}_0x413fbb[_0x43ce('0xbc')]+=_0x23b21f;for(var _0x4be0f0 in this[_0x43ce('0x22')]){if(typeof this[_0x43ce('0x22')][_0x4be0f0]!==_0x43ce('0x93')){if(this[_0x43ce('0x22')][_0x4be0f0][_0x43ce('0xde')]===_0x43ce('0x200')&&this[_0x43ce('0x22')][_0x4be0f0]['status']===_0x43ce('0xd6')){_0x309d45[_0x43ce('0x129')](this[_0x43ce('0x22')][_0x4be0f0]['id']);}}}this[_0x43ce('0xbb')](_0x413fbb['id'],_0x309d45,_0x23b21f,_0x413fbb['dialOrderByScheduledAt'],_0x413fbb)[_0x43ce('0xb0')](function(_0x505fbb){_0x413fbb[_0x43ce('0xbc')]-=_0x23b21f;_0x413fbb['temp']=_0x413fbb['temp']>0x0?_0x413fbb[_0x43ce('0xbc')]:0x0;if(!checkContactEmpty(_0x505fbb)){_0x176150['countReScheduled'](_0x413fbb)[_0x43ce('0xb0')](sendMessageReschedule(_0x413fbb))[_0x43ce('0xa7')](loggerCatch(_0x43ce('0xaf')));}else{_0x413fbb['originated']+=_0x505fbb[_0x43ce('0x91')];_0x413fbb[_0x43ce('0x39')]=_0x413fbb[_0x43ce('0x58')]===_0x43ce('0x1e5')?'ACTIVE':'RUNNING';for(var _0x2970e7=0x0;_0x2970e7<_0x505fbb[_0x43ce('0x91')];_0x2970e7+=0x1){if(_[_0x43ce('0xa4')](_0x505fbb[_0x2970e7])||_[_0x43ce('0xa4')](_0x505fbb[_0x2970e7][_0x43ce('0x16b')])||_['isNil'](_0x505fbb[_0x2970e7][_0x43ce('0x16b')][_0x43ce('0x16c')])){_0x176150['emptyContact'](_0x43ce('0x1fb'),_0x413fbb,_0x505fbb[_0x2970e7]);}else{_0x176150[_0x43ce('0xb1')](_['pick'](_0x505fbb[_0x2970e7],[_0x43ce('0xcd'),_0x43ce('0x1fc')]))[_0x43ce('0xb0')](_0x176150[_0x43ce('0x1e3')](_0x413fbb,_0x505fbb[_0x2970e7]))['catch'](_0x176150['loggerHandler'](_0x43ce('0x1fb'),_0x413fbb));}}}})[_0x43ce('0xa7')](loggerGetContactDialer(_0x43ce('0x201'),_0x413fbb,_0x23b21f));}};Dialer['prototype'][_0x43ce('0x89')]=function(_0x187b25){if(_0x187b25['dialLimitQueue']>0x0){var _0x3fe95e=_0x187b25[_0x43ce('0x1ff')]-_0x187b25['originated']-_0x187b25[_0x43ce('0x52')];if(_0x3fe95e>0x0){this[_0x43ce('0x202')](_0x187b25);}else{loggerPredictiveCalls[_0x43ce('0x78')]('[handlePredictive][limitChannel]');}}else{this['tryOriginatePredictive'](_0x187b25);}};Dialer[_0x43ce('0x1a')][_0x43ce('0x202')]=function(_0x14cda8){var _0x3810dc=this;var _0x473644=[];_0x14cda8['originated']+=0x1;for(var _0x1dbc73 in this[_0x43ce('0x22')]){if(typeof this[_0x43ce('0x22')][_0x1dbc73]!==_0x43ce('0x93')){if(this['agents'][_0x1dbc73]['state']===_0x43ce('0x200')&&this['agents'][_0x1dbc73][_0x43ce('0xa5')]===_0x43ce('0xd6')){_0x473644['push'](this[_0x43ce('0x22')][_0x1dbc73]['id']);}}}this[_0x43ce('0xbb')](_0x14cda8['id'],_0x473644,0x1,_0x14cda8[_0x43ce('0x1f7')],_0x14cda8)[_0x43ce('0xb0')](function(_0x499070){if(!checkContactEmpty(_0x499070)){checkContactLowerLimitOriginate(_0x14cda8,0x1,0x0);_0x3810dc['countReScheduled'](_0x14cda8)[_0x43ce('0xb0')](sendMessageReschedule(_0x14cda8))['catch'](loggerCatch(_0x43ce('0xaf')));}else{_0x14cda8['message']='RUNNING';if(_[_0x43ce('0xa4')](_0x499070[0x0])||_[_0x43ce('0xa4')](_0x499070[0x0]['Contact'])||_[_0x43ce('0xa4')](_0x499070[0x0][_0x43ce('0x16b')][_0x43ce('0x16c')])){_0x3810dc[_0x43ce('0xc6')]('[actionOriginate]\x20',_0x14cda8,_0x499070[0x0]);}else{_0x3810dc[_0x43ce('0xb1')](_[_0x43ce('0xc9')](_0x499070[0x0],[_0x43ce('0xcd'),'Contact.phone']))['then'](_0x3810dc[_0x43ce('0x1e3')](_0x14cda8,_0x499070[0x0]))[_0x43ce('0xa7')](_0x3810dc['loggerHandler'](_0x43ce('0x203'),_0x14cda8));}}})[_0x43ce('0xa7')](loggerGetContactDialer(_0x43ce('0x204'),_0x14cda8,0x1));emitVoiceQueueSummary(_0x14cda8);};Dialer[_0x43ce('0x1a')][_0x43ce('0x1d6')]=function(_0x5edefd,_0x2f9e83,_0x168e43,_0x3957f4,_0x424c4b,_0x127a6e){loggerPredictive[_0x43ce('0x78')]('--------\x20Drop\x20Rate\x20--------');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',_0x5edefd);loggerPredictive[_0x43ce('0x78')](_0x43ce('0x205'),_0x2f9e83);loggerPredictive[_0x43ce('0x78')](_0x43ce('0x206'),_0x168e43);loggerPredictive[_0x43ce('0x78')](_0x43ce('0x207'),_0x3957f4);loggerPredictive[_0x43ce('0x78')](_0x43ce('0x208'),_0x424c4b);loggerPredictive['info']('---------------------------');return new BPromise(function(_0x3fad9b,_0x275fdd){if(_0x5edefd<=0x0||isNaN(_0x5edefd)){return _0x275fdd(msgResponse(_0x43ce('0x209'),_0x43ce('0x45'),_0x43ce('0x20a')+_0x5edefd));}if(_0x168e43<=0x0||isNaN(_0x168e43)){return _0x275fdd(msgResponse(_0x43ce('0x209'),_0x43ce('0x45'),_0x43ce('0x20b')+_0x168e43));}if(_0x3957f4<=0x0||isNaN(_0x3957f4)){return _0x275fdd(msgResponse(_0x43ce('0x209'),'Error',_0x43ce('0x20c')+_0x3957f4));}if(_0x2f9e83<=0x0||isNaN(_0x2f9e83)){return _0x275fdd(msgResponse(_0x43ce('0x209'),'Error',_0x43ce('0x20d')+_0x2f9e83));}if(_0x424c4b<=0x0||isNaN(_0x424c4b)){return _0x275fdd(msgResponse(_0x43ce('0x209'),_0x43ce('0x45'),_0x43ce('0x20e')+_0x424c4b));}_0x127a6e=_0x127a6e||0x0;var _0x4ab373=0x1/_0x168e43;var _0x4d84a2=0x0;var _0x121b5b=0x0;var _0x17c876=0x0;var _0x127580=0x0;for(var _0x4d4667=0x0;_0x17c876<_0x424c4b;_0x4d4667+=0x1){_0x121b5b=_0x4d4667/_0x2f9e83;_0x4d84a2=(_0x3957f4*_0x121b5b+_0x127a6e)/_0x4ab373;_0x17c876=erlangb(_0x4d84a2,_0x5edefd);_0x127580=_0x4d84a2/_0x5edefd*(0x1-erlangb(_0x4d84a2,_0x5edefd));}return _0x3fad9b({'erlangCalls':_0x4d4667,'erlangCallToSecond':_0x2f9e83/_0x4d4667,'erlangAbandonmentRate':_0x17c876,'erlangBusyFactor':_0x127580});});};Dialer[_0x43ce('0x1a')]['busyFactor']=function(_0xae6ff7,_0x3eead3,_0x4c4a40,_0x2bbfdd,_0x524d9d,_0x2460e4){loggerPredictive[_0x43ce('0x78')]('----\x20Agent\x20Busy\x20Factor\x20----');loggerPredictive[_0x43ce('0x78')](_0x43ce('0x20f'),_0xae6ff7);loggerPredictive['info']('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3eead3);loggerPredictive['info'](_0x43ce('0x206'),_0x4c4a40);loggerPredictive['info'](_0x43ce('0x207'),_0x2bbfdd);loggerPredictive[_0x43ce('0x78')](_0x43ce('0x210'),_0x524d9d);loggerPredictive[_0x43ce('0x78')](_0x43ce('0x7e'));return new BPromise(function(_0x1e85f4,_0x3381bb){if(_0xae6ff7<=0x0||isNaN(_0xae6ff7)){return _0x3381bb(msgResponse(_0x43ce('0x211'),'Error','m\x20=\x20'+_0xae6ff7));}if(_0x4c4a40<=0x0||isNaN(_0x4c4a40)){return _0x3381bb(msgResponse('[busyFactor]',_0x43ce('0x45'),_0x43ce('0x20b')+_0x4c4a40));}if(_0x2bbfdd<=0x0||isNaN(_0x2bbfdd)){return _0x3381bb(msgResponse(_0x43ce('0x211'),_0x43ce('0x45'),_0x43ce('0x20c')+_0x2bbfdd));}if(_0x3eead3<=0x0||isNaN(_0x3eead3)){return _0x3381bb(msgResponse(_0x43ce('0x211'),_0x43ce('0x45'),_0x43ce('0x20d')+_0x3eead3));}if(_0x524d9d<=0x0||isNaN(_0x524d9d)){return _0x3381bb(msgResponse(_0x43ce('0x211'),'Error','Umin\x20=\x20'+_0x524d9d));}_0x2460e4=_0x2460e4||0x0;var _0xc3346b=0x1/_0x4c4a40;var _0x1c7ef6=0x0;var _0x3968b3=0x0;var _0x2826db=0x0;var _0x531eb5=0x0;for(var _0x44f93e=0x0;_0x531eb5<_0x524d9d;_0x44f93e+=0x1){_0x3968b3=_0x44f93e/_0x3eead3;_0x1c7ef6=(_0x2bbfdd*_0x3968b3+_0x2460e4)/_0xc3346b;_0x2826db=erlangb(_0x1c7ef6,_0xae6ff7);_0x531eb5=_0x1c7ef6/_0xae6ff7*(0x1-erlangb(_0x1c7ef6,_0xae6ff7));}return _0x1e85f4({'erlangCalls':_0x44f93e,'erlangCallToSecond':_0x3eead3/_0x44f93e,'erlangAbandonmentRate':_0x2826db,'erlangBusyFactor':_0x531eb5});});};module['exports']=Dialer; \ No newline at end of file +var _0x9c44=['sendMessageOneNotActive','state','statedesc','endtime','clearZombieChannels','isNil','Action','catch','updateOriginated','queue','[Dialer][checkChannel]','campaigns','[Dialer][checkChannel][ivr]','resolve','then','countReScheduled','[countReScheduled]\x20','checkIsBlackList','[checkIsBlackList]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','avgHandleTime','[averageHandleTime]\x20','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','temp','[getContactDialer]\x20','getContactDialerIvr','[getContactDialerIvr]\x20','getVoiceQueueRtPauses','moveContactManagedDialer','[moveContactManagedDialer]\x20','[createHistory]\x20','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','saveInDb','ListId','UserId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','isSuccess','isTrunkReachable','SIP/%s','reachable','unmonitored','createHistory','uniqueid','variable','amdstatus','exten','xcally-motion-dialer','value','HANGUP','outboundAnswerAgiCallsDay','HangupInAMD','membername','AMD','custom:amd','amd','[syncHangupInAMD][createHistory]','dialAMDActive','countglobal','buildObj','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countabandonedretry','countmachineretry','stateGlobal','reason19\x20machine....','createStateFinal','reason\x2019\x20machine....','rescheduleContact','dialMachineRetryFrequency','YYYY-MM-DD\x20HH:mm:ss','ContactId','[rescheduleContact][Machine]','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','MACHINE','Machine','[syncAgentComplete][createHistory][0]','countbusyretry','countdropretry','dialGlobalMaxRetry','dialMachineMaxRetry','add','minutes','ivrAnswerCallsDay','[syncHangupIvr]','dialQueueProject','AnswerAGI','AGI','[syncHangupIvr][createHistory]','outboundUnknownCallsDay','Unknow','syncAgentComplete','reason','agent','agiafterat','dialAgiAfterHangupAgent','[syncAgentComplete][createHistory]','[syncAgentComplete]','syncAgentConnect','answertime','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','syncQueueCallerAbandon','droptime','responsetime','dialQueueTimeout','outboundDropCallsDayTimeout','Drop','dropreason','TIMEOUT','dialDropRetryFrequency','starttime','calleridname','calleridnum','[syncAgentComplete][createHistory][10]','Abandoned','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','[rescheduleContact][Abandoned]','[syncAgentComplete][createHistory][11]','syncNewExten','channel','actionid','status','paused','stateinterface','locked','push','pick','idHopper','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','stringify','run','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','queueBookedRR','_rr','unlockRR','Agent:\x20','contactAgent-idHopper:\x20','[booked][unlock]','[booked][unlock2]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','syncCampaigns','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','checkIfTimeIntervals','\x20Intervals\x20is\x20null\x20','Failure','timezones','TIMEZONE_UNKNOW','isArray','command','iftime\x20%s,%s','content','indexOf','true','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','checkDialMethod','handlePower','power','Queue','method\x20not\x20recognized','launchHandleIvr','handleIvr','checkIsTrunkReachable','dialGlobalInterval','dialTimezone','\x5cw{0,','pow','match','actionOriginate','object','voiceQueue\x20is\x20undefine','Contact','phone','originate','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','dialQueueProject2','\x22%s,%s%s,,,%s\x22','dialQueueOptions','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDTOTALANALYSISTIME','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','XMD-AMDMAXIMUMWORDLENGTH','XMD-VOICEQUEUEID','updatedAt','%s%s','XMD-','dialRandomLastDigitCallerIdNumber','TrunkBackup','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','SIP/%s/%s%s','trim','dialCutDigit','substring','from-sip','dialOriginateTimeout','[originateError]:\x20%s','[originate][error]','originate\x20action\x20Error','getQueue','response','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','countagentrejectretry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','[rescheduleContact][Drop]','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','entity\x20is\x20undefine','[callProgressDetecting]','evt\x20is\x20undefine','NoSuchNumber','custom:agentnosuchnumber','nosuchnumber','reason\x200\x20no\x20such\x20number....','outboundNoAnswerCallsDay','NoAnswer','custom:agentnoanswer','noanswer','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','Busy','custom:agentbusy','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','Congestion','reason\x208\x20congestion','outboundAbandonedCallsDay','reason\x2011\x20abandoned','AgentReject','custom:agentreject','agentreject','[syncAgentComplete][createHistory][20]','[syncAgentComplete][createHistory][?]','Success','[moveContactManagedDialer][0]','dialPredictiveOptimizationPercentage','round','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','floor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','getDataPredictive','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20more\x20than\x20threshold\x20(','agentBusyFactor','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','outboundQueuePauses','predictiveIntervalPauses','abandonmentRate','[CatchErlangB]','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','scheduledat','dialRecallMeTimeout','Agent','voicePause','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','limitCalls','ivrTotalCallsDays','[actionOriginate]\x20','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','getContactDialer','Contact.phone','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','not_inuse','dialOrderByScheduledAt','RUNNING','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','m\x20=\x20','Umin\x20=\x20','exports','bluebird','uuid','moment','md5','ioredis','../preview/util/util','dialer','booked','../../../config/logger','predictive','predictiveCalls','syncQueueSummary','../ami','redis','defaults','socket.io-emitter','../rpc/cmHopperHistory','../rpc/cmHopperBlack','./history','./final','./queueCallerAbandon','./hangup','XCALLY_IP_AGI','127.0.0.1','rrmemory','roundrobin','prototype','enqueue','tail','finally','sequence','voiceQueues','agents','trunks','maxNumberOriginate','channels','actions','contactsId','uniqueId','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBooked','bind','originateresponse','syncOriginateResponse','custom:queuesummary','hangup','syncHangup','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','isUndefined','message','AGENTS_NOT_LOGGED','NOT_ACTIVE','name','Interval','INTERVAL_IS_NULL','Intervals','isEmpty','\x20INTERVAL_IS_NULL','[ifTime][Action]','Error','milliseconds','seconds','emit','type','outbound','strategy','answered','available','loggedIn','pTalking','sumDuration','sumHoldTime','talking','total','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialPrefix','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalAvailable','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','Trunk','active','callerid','voice:queue:%s','voice_queue:save','format','campaign:save','info','-----\x20Stats\x20Predictive\x20---','predictiveIntervalTotalCalls','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangBusyFactor','---------------------------','merge','diff','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','preview','ivr','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','inspect','stack','length','undefined','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','contacts','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','is\x20not\x20active','IS_DISACTIVED','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20disactive'];(function(_0x5dab68,_0x5288ff){var _0x243b5c=function(_0xc27ac1){while(--_0xc27ac1){_0x5dab68['push'](_0x5dab68['shift']());}};_0x243b5c(++_0x5288ff);}(_0x9c44,0x178));var _0x49c4=function(_0x2b7764,_0x2606f1){_0x2b7764=_0x2b7764-0x0;var _0x848dcb=_0x9c44[_0x2b7764];return _0x848dcb;};'use strict';var util=require('util');var _=require('lodash');var BPromise=require(_0x49c4('0x0'));var uuid=require(_0x49c4('0x1'));var moment=require(_0x49c4('0x2'));var rr=require('rr');var md5=require(_0x49c4('0x3'));var Redis=require(_0x49c4('0x4'));var ut=require(_0x49c4('0x5'));var config=require('../../../config/environment/');var logger=require('../../../config/logger')(_0x49c4('0x6'));var loggerBooked=require('../../../config/logger')(_0x49c4('0x7'));var loggerPredictive=require(_0x49c4('0x8'))(_0x49c4('0x9'));var loggerPredictiveCalls=require(_0x49c4('0x8'))(_0x49c4('0xa'));var loggerSyncQueueSummary=require('../../../config/logger')(_0x49c4('0xb'));var ami=require(_0x49c4('0xc'));config[_0x49c4('0xd')]=_[_0x49c4('0xe')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x49c4('0xf'))(new Redis(config[_0x49c4('0xd')]));var cmHopper=require('../rpc/cmHopper');var cmHopperHistory=require(_0x49c4('0x10'));var cmHopperBlack=require(_0x49c4('0x11'));var voiceQueueRt=require('../rpc/voiceQueueRt');var Action=require('./action');var History=require(_0x49c4('0x12'));var Final=require(_0x49c4('0x13'));var AgentComplete=require('./agentComplete');var QueueCallerAbandon=require(_0x49c4('0x14'));var Hangup=require(_0x49c4('0x15'));var ipAgi=process['env'][_0x49c4('0x16')]||_0x49c4('0x17');var strategy={'rrmemory':_0x49c4('0x18'),'roundrobin':_0x49c4('0x19')};var Sequence=function(){};Sequence[_0x49c4('0x1a')][_0x49c4('0x1b')]=function(_0x75ea8){this[_0x49c4('0x1c')]=this['tail']?this[_0x49c4('0x1c')][_0x49c4('0x1d')](_0x75ea8):_0x75ea8();};function Dialer(_0x13a2db,_0x81e831){this[_0x49c4('0x1e')]=new Sequence();this['preview']=_0x81e831;this[_0x49c4('0x1f')]=_0x13a2db[_0x49c4('0x1f')];this['campaigns']=_0x13a2db['campaigns'];this[_0x49c4('0x20')]=_0x13a2db[_0x49c4('0x20')];this[_0x49c4('0x21')]=_0x13a2db['trunks'];this[_0x49c4('0x22')]=config['maxNumberOriginate']||0x2;this[_0x49c4('0x23')]={};this[_0x49c4('0x24')]={};this[_0x49c4('0x25')]={};this[_0x49c4('0x26')]={};this[_0x49c4('0x27')]={};this[_0x49c4('0x28')]={};this[_0x49c4('0x29')]={};this[_0x49c4('0x2a')]={};this[_0x49c4('0x2b')]={};this['queueBookedRR']={};ami['on']('agentconnect',this['syncAgentConnect'][_0x49c4('0x2c')](this));ami['on']('queuecallerabandon',this['syncQueueCallerAbandon'][_0x49c4('0x2c')](this));ami['on'](_0x49c4('0x2d'),this[_0x49c4('0x2e')][_0x49c4('0x2c')](this));ami['on']('agentcomplete',this['syncAgentComplete'][_0x49c4('0x2c')](this));ami['on'](_0x49c4('0x2f'),this['syncQueueSummary'][_0x49c4('0x2c')](this));ami['on'](_0x49c4('0x30'),this[_0x49c4('0x31')][_0x49c4('0x2c')](this));ami['on']('newexten',this['syncNewExten'][_0x49c4('0x2c')](this));ami['on']('varset',this[_0x49c4('0x32')][_0x49c4('0x2c')](this));ami['on'](_0x49c4('0x33'),this[_0x49c4('0x34')]['bind'](this));ami['on'](_0x49c4('0x35'),this[_0x49c4('0x36')][_0x49c4('0x2c')](this));this[_0x49c4('0x37')]();this[_0x49c4('0x38')]();}function isNotNull(_0x29f835){return _0x29f835!==null&&!_[_0x49c4('0x39')](_0x29f835);}function checkIsLoggedIn(_0x427b26,_0x17b50f){return function(){if(_0x17b50f<=0x0){_0x427b26[_0x49c4('0x3a')]=_0x49c4('0x3b');throw _0x427b26['name']+'\x20AGENTS\x20NOT\x20LOGGED';}};}function isActive(_0x59eb84){return _0x59eb84;}function checkIsActive(_0x134928,_0x7ee704){return function(){if(!isActive(_0x7ee704)){_0x134928[_0x49c4('0x3a')]=_0x49c4('0x3c');throw _0x134928[_0x49c4('0x3d')]+'\x20NOT\x20Active';}};}function checkInterval(_0x38ad77){return function(){if(!isNotNull(_0x38ad77[_0x49c4('0x3e')])){_0x38ad77[_0x49c4('0x3a')]=_0x49c4('0x3f');throw _0x38ad77['name']+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_0x38ad77[_0x49c4('0x3e')][_0x49c4('0x40')])){_0x38ad77[_0x49c4('0x3a')]=_0x49c4('0x3f');throw _0x38ad77[_0x49c4('0x3d')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_[_0x49c4('0x41')](_0x38ad77[_0x49c4('0x3e')][_0x49c4('0x40')]))){_0x38ad77['message']='INTERVAL_IS_NULL';throw _0x38ad77[_0x49c4('0x3d')]+_0x49c4('0x42');}};}function msgResponse(_0x3bec0a,_0x1238c0,_0x2b45a1){return{'action':_0x3bec0a,'response':_0x1238c0,'message':_0x2b45a1,'stack':_0x2b45a1};}function myreject(_0x2cf897){return function(_0x1d1557){return _0x2cf897(msgResponse(_0x49c4('0x43'),_0x49c4('0x44'),JSON['stringify'](_0x1d1557)));};}function getSeconds(_0x2d34ca,_0x5b96df){var _0xdda586=moment(_0x2d34ca)[_0x49c4('0x45')](0x0);var _0x2625a6=moment(_0x5b96df)[_0x49c4('0x45')](0x0);return _0xdda586['diff'](_0x2625a6,_0x49c4('0x46'));}function emit(_0x31f3ff,_0x1c910a,_0x4e913a){io['to'](_0x31f3ff)[_0x49c4('0x47')](_0x1c910a,_0x4e913a);}function emitVoiceQueueSummary(_0x21d8c7){if(_0x21d8c7[_0x49c4('0x48')]===_0x49c4('0x49')){var _0x1ba7a0={'id':_0x21d8c7['id'],'name':_0x21d8c7[_0x49c4('0x3d')],'strategy':_0x21d8c7[_0x49c4('0x4a')],'answered':_0x21d8c7[_0x49c4('0x4b')],'available':_0x21d8c7[_0x49c4('0x4c')],'loggedIn':_0x21d8c7[_0x49c4('0x4d')],'pTalking':_0x21d8c7[_0x49c4('0x4e')],'sumBillable':_0x21d8c7['sumBillable'],'sumDuration':_0x21d8c7[_0x49c4('0x4f')],'sumHoldTime':_0x21d8c7[_0x49c4('0x50')]||0x0,'talking':_0x21d8c7[_0x49c4('0x51')],'total':_0x21d8c7[_0x49c4('0x52')],'type':_0x21d8c7[_0x49c4('0x48')],'unmanaged':_0x21d8c7[_0x49c4('0x53')],'abandoned':_0x21d8c7[_0x49c4('0x54')],'waiting':_0x21d8c7[_0x49c4('0x55')],'loggedInDb':_0x21d8c7[_0x49c4('0x56')],'dialActive':_0x21d8c7[_0x49c4('0x57')],'dialMethod':_0x21d8c7[_0x49c4('0x58')],'dialOriginateCallerIdName':_0x21d8c7[_0x49c4('0x59')],'dialOriginateCallerIdNumber':_0x21d8c7[_0x49c4('0x5a')],'dialOriginateTimeout':_0x21d8c7['dialOriginateTimeout'],'dialPrefix':_0x21d8c7[_0x49c4('0x5b')],'outboundAnswerAgiCallsDay':_0x21d8c7['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x21d8c7[_0x49c4('0x5c')],'outboundBlacklistCallsDay':_0x21d8c7[_0x49c4('0x5d')],'outboundBusyCallsDay':_0x21d8c7[_0x49c4('0x5e')],'outboundCongestionCallsDay':_0x21d8c7[_0x49c4('0x5f')],'outboundDropCallsDayACS':_0x21d8c7[_0x49c4('0x60')],'outboundDropCallsDayCallersExit':_0x21d8c7[_0x49c4('0x61')],'outboundDropCallsDayTimeout':_0x21d8c7['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x21d8c7['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x21d8c7[_0x49c4('0x62')],'outboundOriginateFailureCallsDay':_0x21d8c7[_0x49c4('0x63')],'outboundReCallsDay':_0x21d8c7[_0x49c4('0x64')],'outboundRejectCallsDay':_0x21d8c7[_0x49c4('0x65')],'outboundUnknownCallsDay':_0x21d8c7['outboundUnknownCallsDay'],'predictiveIntervalAnsweredCalls':_0x21d8c7[_0x49c4('0x66')],'predictiveIntervalAvgHoldtime':_0x21d8c7[_0x49c4('0x67')],'predictiveIntervalAvgTalktime':_0x21d8c7[_0x49c4('0x68')],'predictiveIntervalDroppedCallsCallersExit':_0x21d8c7[_0x49c4('0x69')],'predictiveIntervalDroppedCallsTimeout':_0x21d8c7[_0x49c4('0x6a')],'predictiveIntervalErlangCalls':_0x21d8c7[_0x49c4('0x6b')],'predictiveIntervalErlangCallsDroppedCalls':_0x21d8c7[_0x49c4('0x6c')],'predictiveIntervalHitRate':_0x21d8c7[_0x49c4('0x6d')],'predictiveIntervalMultiplicativeFactor':_0x21d8c7[_0x49c4('0x6e')],'predictiveIntervalPauses':_0x21d8c7['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x21d8c7[_0x49c4('0x6f')],'predictiveIntervalTotalCalls':_0x21d8c7['predictiveIntervalTotalCalls'],'message':_0x21d8c7[_0x49c4('0x3a')],'originated':_0x21d8c7[_0x49c4('0x70')],'erlangCalls':_0x21d8c7[_0x49c4('0x71')],'erlangCallToSecond':_0x21d8c7[_0x49c4('0x72')],'erlangAbandonmentRate':_0x21d8c7[_0x49c4('0x73')],'erlangBusyFactor':_0x21d8c7['erlangBusyFactor'],'startPredictive':_0x21d8c7[_0x49c4('0x28')],'startProgressive':_0x21d8c7[_0x49c4('0x29')]};if(_0x21d8c7[_0x49c4('0x74')]){_0x1ba7a0[_0x49c4('0x74')]={'id':_0x21d8c7[_0x49c4('0x74')]['id'],'name':_0x21d8c7[_0x49c4('0x74')][_0x49c4('0x3d')],'active':_0x21d8c7['Trunk'][_0x49c4('0x75')],'callerid':_0x21d8c7['Trunk'][_0x49c4('0x76')]};}if(_0x21d8c7[_0x49c4('0x3e')]){_0x1ba7a0[_0x49c4('0x3e')]={'id':_0x21d8c7[_0x49c4('0x3e')]['id'],'name':_0x21d8c7[_0x49c4('0x3e')][_0x49c4('0x3d')]};}var _0x2c6be1=md5(JSON['stringify'](_0x1ba7a0));if(_0x21d8c7[_0x49c4('0x3')]!==_0x2c6be1){_0x21d8c7[_0x49c4('0x3')]=_0x2c6be1;emit(util['format'](_0x49c4('0x77'),_0x1ba7a0[_0x49c4('0x3d')]),_0x49c4('0x78'),_0x1ba7a0);}}}function emitCampaignSummary(_0x242afc){if(_0x242afc['type']==='ivr'){emit(util[_0x49c4('0x79')]('campaign:ivr:%s',_0x242afc[_0x49c4('0x3d')]),_0x49c4('0x7a'),_0x242afc);}}function checkGetDataPredictive(_0x3811b2){if(isNotNull(_0x3811b2)&&!_[_0x49c4('0x41')](_0x3811b2)){loggerPredictive[_0x49c4('0x7b')](_0x49c4('0x7c'));loggerPredictive[_0x49c4('0x7b')]('Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3811b2[_0x49c4('0x7d')]);loggerPredictive[_0x49c4('0x7b')](_0x49c4('0x7e'),_0x3811b2[_0x49c4('0x66')]);loggerPredictive[_0x49c4('0x7b')](_0x49c4('0x7f'),_0x3811b2[_0x49c4('0x6a')]);loggerPredictive[_0x49c4('0x7b')](_0x49c4('0x80'),_0x3811b2[_0x49c4('0x69')]);loggerPredictive['info']('AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3811b2[_0x49c4('0x67')]);loggerPredictive[_0x49c4('0x7b')]('AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3811b2['predictiveIntervalAvgTalktime']);loggerPredictive[_0x49c4('0x7b')]('---------------------------');if(_0x3811b2['predictiveIntervalTotalCalls']>0x0){if(!_[_0x49c4('0x39')](_0x3811b2[_0x49c4('0x68')])&&_0x3811b2[_0x49c4('0x68')]>0x0){return!![];}loggerPredictive[_0x49c4('0x7b')](_0x49c4('0x81'));if(!_[_0x49c4('0x39')](_0x3811b2[_0x49c4('0x67')])&&_0x3811b2['predictiveIntervalAvgHoldtime']>0x0){return!![];}loggerPredictive[_0x49c4('0x7b')](_0x49c4('0x82'));}else{loggerPredictive[_0x49c4('0x7b')](_0x49c4('0x83'));}}else{loggerPredictive[_0x49c4('0x7b')](_0x49c4('0x84'));}return![];}function mergeDataErlangB(_0x5d24f3){return function(_0x5c7ddd){loggerPredictive[_0x49c4('0x7b')](_0x49c4('0x85'));loggerPredictive[_0x49c4('0x7b')](_0x49c4('0x86'),_0x5c7ddd[_0x49c4('0x71')]);loggerPredictive[_0x49c4('0x7b')](_0x49c4('0x87'),_0x5c7ddd['erlangCallToSecond']);loggerPredictive[_0x49c4('0x7b')](_0x49c4('0x88'),_0x5c7ddd['erlangAbandonmentRate']);loggerPredictive[_0x49c4('0x7b')]('Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5c7ddd[_0x49c4('0x89')]);loggerPredictive[_0x49c4('0x7b')](_0x49c4('0x88'),_0x5c7ddd[_0x49c4('0x73')]);loggerPredictive[_0x49c4('0x7b')](_0x49c4('0x8a'));_[_0x49c4('0x8b')](_0x5d24f3,_0x5c7ddd);};}function getDiff(_0x2f520f){var _0x483770=moment()[_0x49c4('0x45')](0x0);var _0x27b9c2=moment(_0x2f520f)['milliseconds'](0x0);return _0x483770[_0x49c4('0x8c')](_0x27b9c2,_0x49c4('0x46'));}function ifInterval(_0x4fefbd,_0x39c455){if(_[_0x49c4('0x39')](_0x39c455)){return![];}return getDiff(_0x39c455)<_0x4fefbd*0x3c;}function freeVariablesPredictive(_0x4f50bf){if(isNotNull(_0x4f50bf)){if(!_['isUndefined'](_0x4f50bf['startProgressive'])){_0x4f50bf['startProgressive']=undefined;loggerPredictive[_0x49c4('0x7b')](_0x4f50bf['name'],_0x49c4('0x8d'));}if(!_[_0x49c4('0x39')](_0x4f50bf['startPredictive'])){_0x4f50bf[_0x49c4('0x28')]=undefined;loggerPredictive[_0x49c4('0x7b')](_0x4f50bf['name'],_0x49c4('0x8e'));}if(!_[_0x49c4('0x39')](_0x4f50bf[_0x49c4('0x8f')])){clearInterval(_0x4f50bf[_0x49c4('0x8f')]);_0x4f50bf['handlePredictive']=undefined;loggerPredictive[_0x49c4('0x7b')](_0x4f50bf[_0x49c4('0x3d')],_0x49c4('0x90'));}}}function erlangb(_0x20e97d,_0x5d3375){if(_0x5d3375===0x0){return 0x0;}var _0x617e2f=0x1;for(var _0x4a93bc=0x1;_0x4a93bc<=_0x5d3375;_0x4a93bc+=0x1){_0x617e2f=0x1+_0x617e2f*_0x4a93bc/_0x20e97d;}return 0x1/_0x617e2f;}function isVoiceQueueOutbound(_0x568457){return _0x568457==='outbound';}function isNotPreview(_0x5d6de0){return _0x5d6de0!==_0x49c4('0x91');}function isCampaignIvr(_0x32eaef){return _0x32eaef===_0x49c4('0x92');}function getCallerId(_0x28bbf3,_0x5b056e,_0x4daa6d){if(!_[_0x49c4('0x39')](_0x4daa6d)&&typeof _0x4daa6d===_0x49c4('0x93')&&!_[_0x49c4('0x41')](_0x4daa6d)){if(!_[_0x49c4('0x39')](_0x5b056e)&&typeof _0x5b056e===_0x49c4('0x93')&&!_[_0x49c4('0x41')](_0x5b056e)){return util[_0x49c4('0x79')](_0x49c4('0x94'),_0x5b056e,_0x4daa6d);}return util['format'](_0x49c4('0x94'),_0x4daa6d,_0x4daa6d);}if(!_['isUndefined'](_0x28bbf3)&&typeof _0x28bbf3===_0x49c4('0x93')&&!_[_0x49c4('0x41')](_0x28bbf3)){return _0x28bbf3;}return _0x49c4('0x95');}function loggerCatchQueueSummary(_0x1ea1b4,_0x3a1c81){return function(_0x2e062f){freeVariablesPredictive(_0x3a1c81);emitVoiceQueueSummary(_0x3a1c81);emitCampaignSummary(_0x3a1c81);loggerSyncQueueSummary[_0x49c4('0x96')](_0x1ea1b4,util[_0x49c4('0x97')](_0x2e062f,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x13d951,_0x1743d0){return function(_0x1e3911){loggerPredictive[_0x49c4('0x96')](_0x1743d0[_0x49c4('0x3d')],_0x13d951);loggerPredictive[_0x49c4('0x96')](_0x1e3911[_0x49c4('0x98')]);freeVariablesPredictive(_0x1743d0);};}function loggerCatch(_0x453cf2){return function(_0x371e49){logger[_0x49c4('0x96')](_0x453cf2,util['inspect'](_0x371e49,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x5ec201){return _0x5ec201&&!_[_0x49c4('0x39')](_0x5ec201)&&_0x5ec201[_0x49c4('0x99')]>0x0;}function decremetOriginate(_0x4af680){if(!_[_0x49c4('0x39')](_0x4af680)&&_0x4af680!==null){if(typeof _0x4af680[_0x49c4('0x70')]!==_0x49c4('0x9a')){if(_0x4af680[_0x49c4('0x70')]>0x0){_0x4af680['originated']-=0x1;}else{logger['error']('[decremetOriginate]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0x49c4('0x96')](_0x49c4('0x9b'));}}function checkContactLowerLimitOriginate(_0x1b912a,_0x2f4289,_0x118fc4){if(_0x2f4289>_0x118fc4){for(var _0x146706=0x0;_0x146706<_0x2f4289-_0x118fc4;_0x146706+=0x1){decremetOriginate(_0x1b912a);}}}function loggerGetContactDialer(_0x191afb,_0x3692a4,_0x2cac74){return function(_0x54dea5){checkContactLowerLimitOriginate(_0x3692a4,_0x2cac74,0x0);logger[_0x49c4('0x96')](_0x191afb,util[_0x49c4('0x97')](_0x54dea5,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x342f8f){return function(_0x4b759b){if(isNotNull(_0x4b759b)&&isNotNull(_0x4b759b[0x0])){if(_0x4b759b[0x0][_0x49c4('0x9c')]>0x0){_0x342f8f[_0x49c4('0x3a')]=_0x49c4('0x9d');logger[_0x49c4('0x7b')](_0x49c4('0x9e')+_0x342f8f[_0x49c4('0x3d')],_0x4b759b[0x0][_0x49c4('0x9c')],_0x49c4('0x9f'));}else{_0x342f8f['message']=_0x49c4('0xa0');logger[_0x49c4('0x7b')](_0x49c4('0xa1')+_0x342f8f[_0x49c4('0x3d')]);}}};}function notSendMessagesQueue(_0x1e948a){if(_0x1e948a['sendMessageOneNotActive']){freeVariablesPredictive(_0x1e948a);if(_0x1e948a['originated']===0x0&&_0x1e948a[_0x49c4('0x51')]===0x0&&_0x1e948a['waiting']===0x0&&(_0x1e948a[_0x49c4('0x4e')]||0x0)===0x0){_0x1e948a['sendMessageOneNotActive']=![];_0x1e948a[_0x49c4('0x4c')]=0x0;_0x1e948a[_0x49c4('0x3a')]=_0x49c4('0x3c');loggerSyncQueueSummary[_0x49c4('0x96')]('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x1e948a[_0x49c4('0x3d')],_0x49c4('0xa2'));}else{_0x1e948a[_0x49c4('0x3a')]=_0x49c4('0xa3');loggerSyncQueueSummary[_0x49c4('0x96')](_0x49c4('0xa4'),_0x1e948a[_0x49c4('0x3d')],_0x49c4('0xa5'));}emitVoiceQueueSummary(_0x1e948a);}}function notSendMessagesCampaign(_0x46477f){if(_0x46477f[_0x49c4('0xa6')]){if(_0x46477f['originated']===0x0){_0x46477f[_0x49c4('0xa6')]=![];_0x46477f[_0x49c4('0x3a')]='NOT_ACTIVE';loggerSyncQueueSummary[_0x49c4('0x96')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x46477f[_0x49c4('0x3d')],_0x49c4('0xa2'));}else{_0x46477f[_0x49c4('0x3a')]=_0x49c4('0xa3');loggerSyncQueueSummary[_0x49c4('0x96')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x46477f[_0x49c4('0x3d')],_0x49c4('0xa5'));}emitCampaignSummary(_0x46477f);}}function createObjHistory(_0x596a9e,_0x2b5136,_0x167e41,_0x4eb72a,_0xbd12b9){_0x596a9e[_0x49c4('0x3a')]=_0x167e41;var _0x57b137=new Action(_0x596a9e,_0x2b5136);var _0x37fef1=new History(_0x57b137);_0x37fef1[_0x49c4('0xa7')]=_0x4eb72a;_0x37fef1[_0x49c4('0xa8')]=_0xbd12b9;_0x37fef1[_0x49c4('0xa9')]=_0x57b137['starttime'];return _0x37fef1;}Dialer[_0x49c4('0x1a')][_0x49c4('0x38')]=function(){var _0x4c2fed=this;setInterval(function(){_0x4c2fed[_0x49c4('0xaa')](_0x4c2fed['uniqueId'],'[uniqueid]');_0x4c2fed[_0x49c4('0xaa')](_0x4c2fed['actions'],'[actions]');},0x32c8);};Dialer[_0x49c4('0x1a')][_0x49c4('0xaa')]=function(_0x5daa58,_0x23e684){var _0x5c3509=this;for(var _0x578f4b in _0x5daa58){if(typeof _0x5daa58[_0x578f4b]!=='undefined'){this[_0x49c4('0x1e')][_0x49c4('0x1b')](function(){if(!_[_0x49c4('0xab')](_0x5daa58[_0x578f4b])){return ami[_0x49c4('0xac')]({'action':'status','channel':_0x5daa58[_0x578f4b]['channel']})[_0x49c4('0xad')](function(_0x48705c){if(_0x48705c[_0x49c4('0x3a')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x5daa58[_0x578f4b]&&_0x5daa58[_0x578f4b][_0x49c4('0x48')]!==_0x49c4('0x92')){_0x5c3509[_0x49c4('0xae')](_0x5c3509[_0x49c4('0x1f')][_0x5daa58[_0x578f4b][_0x49c4('0xaf')]]);logger[_0x49c4('0x96')](_0x49c4('0xb0'),_0x23e684,_0x578f4b,_0x5daa58[_0x578f4b]['queue']);delete _0x5daa58[_0x578f4b];}if(_0x5daa58[_0x578f4b]&&_0x5daa58[_0x578f4b][_0x49c4('0x48')]===_0x49c4('0x92')){_0x5c3509[_0x49c4('0xae')](_0x5c3509[_0x49c4('0xb1')][_0x5daa58[_0x578f4b][_0x49c4('0xaf')]]);logger['error'](_0x49c4('0xb2'),_0x23e684,_0x578f4b,_0x5daa58[_0x578f4b][_0x49c4('0xaf')]);delete _0x5daa58[_0x578f4b];}},0x2328);}});}});}}};Dialer[_0x49c4('0x1a')]['countReScheduled']=function(_0x530ff2){return BPromise[_0x49c4('0xb3')]()[_0x49c4('0xb4')](cmHopper[_0x49c4('0xb5')](_0x530ff2))[_0x49c4('0xad')](loggerCatch(_0x49c4('0xb6')));};Dialer['prototype'][_0x49c4('0xb7')]=function(_0x1a20f4){return BPromise[_0x49c4('0xb3')]()[_0x49c4('0xb4')](cmHopperBlack['checkIsBlackList'](_0x1a20f4))['catch'](loggerCatch(_0x49c4('0xb8')));};Dialer[_0x49c4('0x1a')][_0x49c4('0xb9')]=function(_0x294ba0){return BPromise[_0x49c4('0xb3')]()['then'](cmHopperBlack[_0x49c4('0xb9')](_0x294ba0))[_0x49c4('0xad')](loggerCatch(_0x49c4('0xba')));};Dialer[_0x49c4('0x1a')][_0x49c4('0xbb')]=function(_0x8f37e5){return BPromise['resolve']()[_0x49c4('0xb4')](cmHopperHistory[_0x49c4('0xbc')](_0x8f37e5))[_0x49c4('0xad')](loggerCatch(_0x49c4('0xbd')));};Dialer['prototype']['rescheduleContact']=function(_0xa96f53){return BPromise['resolve']()[_0x49c4('0xb4')](cmHopper['rescheduleContact'](_0xa96f53))[_0x49c4('0xad')](loggerCatch(_0x49c4('0xbe')));};Dialer[_0x49c4('0x1a')][_0x49c4('0xbf')]=function(_0x4eebc9,_0x4ad966,_0x2e352e){return BPromise[_0x49c4('0xb3')]()[_0x49c4('0xb4')](cmHopper['unlockContact'](_0x4eebc9,_0x4ad966,_0x2e352e))['catch'](loggerCatch(_0x49c4('0xc0')));};Dialer['prototype']['getContactDialer']=function(_0x1b9473,_0x5a2858,_0x22668b,_0x3cfa95,_0x4fc419){return BPromise[_0x49c4('0xb3')]()[_0x49c4('0xb4')](cmHopper['getContactDialer'](_0x1b9473,_0x5a2858,_0x22668b,_0x3cfa95))['catch'](function(_0xdb9820){_0x4fc419['temp']-=_0x22668b;_0x4fc419[_0x49c4('0xc1')]=_0x4fc419[_0x49c4('0xc1')]>0x0?_0x4fc419[_0x49c4('0xc1')]:0x0;loggerCatch(_0x49c4('0xc2'))(_0xdb9820);});};Dialer[_0x49c4('0x1a')][_0x49c4('0xc3')]=function(_0x2ecc6d,_0x5f07fa,_0x30878d,_0x12afa1){return BPromise[_0x49c4('0xb3')]()[_0x49c4('0xb4')](cmHopper[_0x49c4('0xc3')](_0x2ecc6d,_0x5f07fa,_0x30878d))['catch'](function(_0x39ea40){_0x12afa1['temp']-=_0x5f07fa;_0x12afa1[_0x49c4('0xc1')]=_0x12afa1[_0x49c4('0xc1')]>0x0?_0x12afa1[_0x49c4('0xc1')]:0x0;loggerCatch(_0x49c4('0xc4'))(_0x39ea40);});};Dialer['prototype'][_0x49c4('0xc5')]=function(_0x139696){return BPromise[_0x49c4('0xb3')]()[_0x49c4('0xb4')](voiceQueueRt[_0x49c4('0xc5')](_0x139696))[_0x49c4('0xad')](loggerCatch('[getVoiceQueueRtPauses]\x20'));};Dialer[_0x49c4('0x1a')]['moveContactManagedDialer']=function(_0xac53ad){return BPromise[_0x49c4('0xb3')]()[_0x49c4('0xb4')](cmHopper[_0x49c4('0xc6')](_0xac53ad))['catch'](loggerCatch(_0x49c4('0xc7')));};Dialer[_0x49c4('0x1a')]['createHistory']=function(_0x1e0b7d){return BPromise[_0x49c4('0xb3')]()['then'](cmHopperHistory['createHistory'](_0x1e0b7d))[_0x49c4('0xad')](loggerCatch(_0x49c4('0xc8')));};Dialer[_0x49c4('0x1a')][_0x49c4('0xae')]=function(_0x32afd4){if(!_[_0x49c4('0x39')](_0x32afd4)&&_0x32afd4!==null){if(typeof _0x32afd4[_0x49c4('0x70')]!==_0x49c4('0x9a')){if(_0x32afd4[_0x49c4('0x70')]>0x0){_0x32afd4[_0x49c4('0x70')]-=0x1;}else{logger[_0x49c4('0x96')]('[updateOriginated]\x20object\x20originated\x20is\x20negative');}}}else{logger['error'](_0x49c4('0xc9'));}};Dialer[_0x49c4('0x1a')][_0x49c4('0xca')]=function(_0x5be042,_0x1276bf){var _0x326ca8=this;return function(_0x5ca87e){_0x326ca8[_0x49c4('0xae')](_0x1276bf);logger['error'](_0x5be042,util[_0x49c4('0x97')](_0x5ca87e,{'showHidden':![],'depth':null}));};};Dialer[_0x49c4('0x1a')][_0x49c4('0xcb')]=function(_0x941b9d,_0x572433,_0x2456a0){var _0x44a9e2={'state':0x19,'statedesc':_0x49c4('0xcc')};this[_0x49c4('0xae')](_0x572433);this[_0x49c4('0xcd')](_['merge'](_0x44a9e2,_['pick'](_0x2456a0,['ContactId',_0x49c4('0xce'),_0x49c4('0xcf'),_0x49c4('0xd0'),_0x49c4('0xd1')])),_0x49c4('0xd2'),'[emptyContact]');logger[_0x49c4('0x96')](_0x941b9d);};Dialer[_0x49c4('0x1a')][_0x49c4('0xd3')]=function(_0x39a085){return _0x39a085==='Success';};Dialer[_0x49c4('0x1a')][_0x49c4('0xd4')]=function(_0x10fa42){return!_[_0x49c4('0x39')](_0x10fa42)&&_0x10fa42&&!_[_0x49c4('0x39')](_0x10fa42['name'])&&!_[_0x49c4('0x39')](_0x10fa42[_0x49c4('0x75')])&&_0x10fa42[_0x49c4('0x75')]&&(this['trunks'][util[_0x49c4('0x79')](_0x49c4('0xd5'),_0x10fa42[_0x49c4('0x3d')])]['status']===_0x49c4('0xd6')||this['trunks'][util['format'](_0x49c4('0xd5'),_0x10fa42[_0x49c4('0x3d')])]['status']===_0x49c4('0xd7'));};Dialer[_0x49c4('0x1a')][_0x49c4('0xcd')]=function(_0x1ffc9a,_0x10f5fc,_0x3a7559){this[_0x49c4('0xd8')](_0x1ffc9a)[_0x49c4('0xad')](loggerCatch(_0x10f5fc));this['moveContactManagedDialer'](_0x1ffc9a)['catch'](loggerCatch(_0x3a7559));};Dialer[_0x49c4('0x1a')][_0x49c4('0x32')]=function(_0x42f2db){var _0x5f04f2=this['uniqueId'][_0x42f2db[_0x49c4('0xd9')]];var _0x3222ec;if(!_[_0x49c4('0xab')](_0x42f2db)&&!_[_0x49c4('0xab')](_0x42f2db[_0x49c4('0xda')])&&!_[_0x49c4('0xab')](_0x42f2db[_0x49c4('0xda')][_0x49c4('0xdb')])&&_0x42f2db[_0x49c4('0xdc')]===_0x49c4('0xdd')&&_0x5f04f2){if(_0x5f04f2[_0x49c4('0x48')]!==_0x49c4('0x92')&&this[_0x49c4('0x1f')][_0x5f04f2[_0x49c4('0xaf')]]['dialAMDActive']&&_0x42f2db[_0x49c4('0xde')]===_0x49c4('0xdf')){delete this[_0x49c4('0x26')][_0x42f2db[_0x49c4('0xd9')]];this['updateOriginated'](this['voiceQueues'][_0x5f04f2[_0x49c4('0xaf')]]);this['voiceQueues'][_0x5f04f2[_0x49c4('0xaf')]][_0x49c4('0x5c')]+=0x1;this[_0x49c4('0x1f')][_0x5f04f2[_0x49c4('0xaf')]][_0x49c4('0xe0')]+=0x1;_0x3222ec=new Hangup(_0x5f04f2,_0x42f2db);_0x3222ec[_0x49c4('0xa7')]=0x12;_0x3222ec[_0x49c4('0xa8')]=_0x49c4('0xe1');_0x3222ec[_0x49c4('0xe2')]=_0x49c4('0xe3');ami[_0x49c4('0x47')](_0x49c4('0xe4'),ut['buildObj'](_0x3222ec,_0x49c4('0xe5')));this[_0x49c4('0xcd')](_0x3222ec,_0x49c4('0xe6'),'[syncHangupInAMD]');}if(_0x5f04f2[_0x49c4('0x48')]!=='ivr'&&this[_0x49c4('0x1f')][_0x5f04f2[_0x49c4('0xaf')]][_0x49c4('0xe7')]&&_0x42f2db[_0x49c4('0xde')]==='MACHINE'){var _0x777777=this;return new BPromise(function(_0x479747,_0x4a8720){delete _0x777777[_0x49c4('0x26')][_0x42f2db[_0x49c4('0xd9')]];_0x777777[_0x49c4('0xae')](_0x777777['voiceQueues'][_0x5f04f2['queue']]);_0x777777[_0x49c4('0x1f')][_0x5f04f2[_0x49c4('0xaf')]][_0x49c4('0x5c')]+=0x1;_0x777777[_0x49c4('0x1f')][_0x5f04f2[_0x49c4('0xaf')]][_0x49c4('0xe0')]+=0x1;var _0x2dafd9=_0x777777[_0x49c4('0x1f')][_0x5f04f2[_0x49c4('0xaf')]];var _0x54421b=new Hangup(_0x5f04f2,_0x42f2db);_0x54421b[_0x49c4('0xa7')]=0x13;_0x54421b[_0x49c4('0xa8')]='Machine';_0x54421b['membername']=_0x49c4('0xe3');_0x54421b['countmachineretry']+=0x1;_0x54421b[_0x49c4('0xe8')]+=0x1;_0x54421b['amd']=!![];ami[_0x49c4('0x47')]('custom:amd',ut[_0x49c4('0xe9')](_0x54421b,_0x49c4('0xe5')));_0x777777[_0x49c4('0xd8')](_0x54421b)[_0x49c4('0xad')](loggerCatch('[syncAgentComplete][createHistory][0]'));if(_0x54421b['countbusyretry']+_0x54421b[_0x49c4('0xea')]+_0x54421b[_0x49c4('0xeb')]+_0x54421b[_0x49c4('0xec')]+_0x54421b['countdropretry']+_0x54421b[_0x49c4('0xed')]+_0x54421b[_0x49c4('0xee')]+_0x54421b['countagentrejectretry']>=_0x2dafd9['dialGlobalMaxRetry']){_0x777777[_0x49c4('0xef')](_0x54421b,_0x479747,_0x4a8720,_0x49c4('0xf0'));}else{if(_0x54421b[_0x49c4('0xee')]>=_0x2dafd9['dialMachineMaxRetry']){_0x777777[_0x49c4('0xf1')](_0x54421b,_0x479747,_0x4a8720,_0x49c4('0xf2'));}else{_0x777777[_0x49c4('0xf3')]({'active':![],'countmachineretry':_0x54421b[_0x49c4('0xee')],'scheduledat':moment()['add'](_0x2dafd9[_0x49c4('0xf4')],'minutes')['format'](_0x49c4('0xf5')),'ContactId':_0x54421b[_0x49c4('0xf6')],'ListId':_0x54421b[_0x49c4('0xce')],'VoiceQueueId':_0x54421b[_0x49c4('0xd0')]||undefined,'CampaignId':_0x54421b['CampaignId']||undefined})[_0x49c4('0xad')](loggerCatch(_0x49c4('0xf7')));_0x479747({'reschedule':0x1});}}});}if(_0x5f04f2[_0x49c4('0x48')]===_0x49c4('0x92')&&this['campaigns'][_0x5f04f2[_0x49c4('0xaf')]]['dialAMDActive']&&_0x42f2db['value']===_0x49c4('0xdf')){delete this[_0x49c4('0x26')][_0x42f2db[_0x49c4('0xd9')]];this['updateOriginated'](this[_0x49c4('0xb1')][_0x5f04f2['queue']]);_0x3222ec=new Hangup(_0x5f04f2,_0x42f2db);_0x3222ec[_0x49c4('0xa7')]=0x12;_0x3222ec[_0x49c4('0xa8')]=_0x49c4('0xe1');_0x3222ec[_0x49c4('0xe2')]=_0x49c4('0xe3');ami[_0x49c4('0x47')](_0x49c4('0xe4'),ut['buildObj'](_0x3222ec,_0x49c4('0xe5')));this[_0x49c4('0xcd')](_0x3222ec,_0x49c4('0xf8'),_0x49c4('0xf9'));}if(_0x5f04f2['type']==='ivr'&&this['campaigns'][_0x5f04f2[_0x49c4('0xaf')]][_0x49c4('0xe7')]&&_0x42f2db[_0x49c4('0xde')]===_0x49c4('0xfa')){var _0x777777=this;return new BPromise(function(_0x40c7ab,_0x372038){delete _0x777777['uniqueId'][_0x42f2db[_0x49c4('0xd9')]];_0x777777[_0x49c4('0xae')](_0x777777['campaigns'][_0x5f04f2['queue']]);_0x777777['campaigns'][_0x5f04f2[_0x49c4('0xaf')]][_0x49c4('0x5c')]+=0x1;_0x777777[_0x49c4('0xb1')][_0x5f04f2[_0x49c4('0xaf')]][_0x49c4('0xe0')]+=0x1;var _0x1480d3=_0x777777[_0x49c4('0xb1')][_0x5f04f2['queue']];var _0x83440b=new Hangup(_0x5f04f2,_0x42f2db);_0x83440b[_0x49c4('0xa7')]=0x13;_0x83440b[_0x49c4('0xa8')]=_0x49c4('0xfb');_0x83440b['membername']=_0x49c4('0xe3');_0x83440b[_0x49c4('0xee')]+=0x1;_0x83440b[_0x49c4('0xe8')]+=0x1;_0x83440b[_0x49c4('0xe5')]=!![];ami[_0x49c4('0x47')]('custom:amd',ut[_0x49c4('0xe9')](_0x83440b,'amd'));_0x777777['createHistory'](_0x83440b)[_0x49c4('0xad')](loggerCatch(_0x49c4('0xfc')));if(_0x83440b[_0x49c4('0xfd')]+_0x83440b[_0x49c4('0xea')]+_0x83440b[_0x49c4('0xeb')]+_0x83440b['countnosuchnumberretry']+_0x83440b[_0x49c4('0xfe')]+_0x83440b[_0x49c4('0xed')]+_0x83440b[_0x49c4('0xee')]+_0x83440b['countagentrejectretry']>=_0x1480d3[_0x49c4('0xff')]){_0x777777[_0x49c4('0xef')](_0x83440b,_0x40c7ab,_0x372038,'reason19\x20machine....');}else{if(_0x83440b[_0x49c4('0xee')]>=_0x1480d3[_0x49c4('0x100')]){_0x777777[_0x49c4('0xf1')](_0x83440b,_0x40c7ab,_0x372038,_0x49c4('0xf2'));}else{_0x777777[_0x49c4('0xf3')]({'active':![],'countmachineretry':_0x83440b[_0x49c4('0xee')],'scheduledat':moment()[_0x49c4('0x101')](_0x1480d3['dialMachineRetryFrequency'],_0x49c4('0x102'))[_0x49c4('0x79')](_0x49c4('0xf5')),'ContactId':_0x83440b[_0x49c4('0xf6')],'ListId':_0x83440b[_0x49c4('0xce')],'VoiceQueueId':_0x83440b['VoiceQueueId']||undefined,'CampaignId':_0x83440b[_0x49c4('0xd1')]||undefined})[_0x49c4('0xad')](loggerCatch(_0x49c4('0xf7')));_0x40c7ab({'reschedule':0x1});}}});}}};Dialer[_0x49c4('0x1a')][_0x49c4('0x31')]=function(_0x50423b){var _0x2582e3=this[_0x49c4('0x26')][_0x50423b[_0x49c4('0xd9')]];var _0x254402=this;var _0x44e286;if(_0x2582e3&&_0x2582e3[_0x49c4('0x48')]===_0x49c4('0x92')){delete this[_0x49c4('0x26')][_0x50423b[_0x49c4('0xd9')]];this[_0x49c4('0xae')](this['campaigns'][_0x2582e3[_0x49c4('0xaf')]]);this[_0x49c4('0xb1')][_0x2582e3[_0x49c4('0xaf')]][_0x49c4('0x103')]+=0x1;_0x44e286=new Hangup(_0x2582e3,_0x50423b);this[_0x49c4('0xd8')](_0x44e286)['catch'](loggerCatch('[syncHangupIvr][createHistory]'));this[_0x49c4('0xc6')](_0x44e286)[_0x49c4('0xad')](loggerCatch(_0x49c4('0x104')));}if(_0x2582e3&&_0x2582e3[_0x49c4('0x48')]!==_0x49c4('0x92')&&isNotNull(this[_0x49c4('0x1f')][_0x2582e3['queue']][_0x49c4('0x105')])){delete this[_0x49c4('0x26')][_0x50423b['uniqueid']];this[_0x49c4('0xae')](this['voiceQueues'][_0x2582e3[_0x49c4('0xaf')]]);this[_0x49c4('0x1f')][_0x2582e3[_0x49c4('0xaf')]]['outboundAnswerCallsDay']+=0x1;this[_0x49c4('0x1f')][_0x2582e3['queue']][_0x49c4('0xe0')]+=0x1;_0x44e286=new Hangup(_0x2582e3,_0x50423b);_0x44e286['state']=0x10;_0x44e286['statedesc']=_0x49c4('0x106');_0x44e286[_0x49c4('0xe2')]=_0x49c4('0x107');this[_0x49c4('0xd8')](_0x44e286)[_0x49c4('0xad')](loggerCatch(_0x49c4('0x108')));this['moveContactManagedDialer'](_0x44e286)['catch'](loggerCatch(_0x49c4('0x104')));}if(_0x2582e3&&_0x2582e3[_0x49c4('0x48')]!==_0x49c4('0x92')&&!isNotNull(this[_0x49c4('0x1f')][_0x2582e3[_0x49c4('0xaf')]][_0x49c4('0x105')])){delete this[_0x49c4('0x26')][_0x50423b['uniqueid']];this['updateOriginated'](this['voiceQueues'][_0x2582e3['queue']]);this[_0x49c4('0x1f')][_0x2582e3['queue']][_0x49c4('0x109')]+=0x1;_0x44e286=new Hangup(_0x2582e3,_0x50423b);_0x44e286[_0x49c4('0xa7')]=0xc;_0x44e286[_0x49c4('0xa8')]=_0x50423b['cause-txt'];_0x44e286['membername']=_0x49c4('0x10a');this[_0x49c4('0xd8')](_0x44e286)['catch'](loggerCatch(_0x49c4('0x108')));this[_0x49c4('0xc6')](_0x44e286)[_0x49c4('0xad')](loggerCatch(_0x49c4('0x104')));}};Dialer[_0x49c4('0x1a')][_0x49c4('0x10b')]=function(_0x582222){var _0x1bded3=this[_0x49c4('0x26')][_0x582222[_0x49c4('0xd9')]];var _0x5730aa=this;if(this[_0x49c4('0x1f')][_0x582222[_0x49c4('0xaf')]]){if(_0x1bded3&&_0x1bded3[_0x49c4('0x48')]!==_0x49c4('0x92')){delete this[_0x49c4('0x26')][_0x582222[_0x49c4('0xd9')]];this[_0x49c4('0x1f')][_0x582222[_0x49c4('0xaf')]]['outboundAnswerCallsDay']+=0x1;var _0x2fc500=new AgentComplete(_0x1bded3,_0x582222);if(_0x582222[_0x49c4('0x10c')]===_0x49c4('0x10d')){_0x2fc500[_0x49c4('0x10e')]=this[_0x49c4('0x1f')][_0x582222[_0x49c4('0xaf')]]['dialQueueProject2']&&this[_0x49c4('0x1f')][_0x582222[_0x49c4('0xaf')]][_0x49c4('0x10f')]?moment()[_0x49c4('0x79')](_0x49c4('0xf5')):undefined;}this[_0x49c4('0xd8')](_0x2fc500)[_0x49c4('0xad')](loggerCatch(_0x49c4('0x110')));this[_0x49c4('0xc6')](_0x2fc500)[_0x49c4('0xad')](loggerCatch(_0x49c4('0x111')));}}};Dialer[_0x49c4('0x1a')][_0x49c4('0x112')]=function(_0x43bd6e){if(this['voiceQueues'][_0x43bd6e['queue']]){if(this[_0x49c4('0x26')][_0x43bd6e[_0x49c4('0xd9')]]&&this['uniqueId'][_0x43bd6e['uniqueid']][_0x49c4('0x48')]!=='ivr'){this[_0x49c4('0xae')](this[_0x49c4('0x1f')][_0x43bd6e[_0x49c4('0xaf')]]);this[_0x49c4('0x26')][_0x43bd6e[_0x49c4('0xd9')]][_0x49c4('0x113')]=moment()[_0x49c4('0x79')](_0x49c4('0xf5'));}}};Dialer['prototype'][_0x49c4('0x114')]=function(_0x2542ed){this[_0x49c4('0xd8')](_0x2542ed)[_0x49c4('0xad')](loggerCatch(_0x49c4('0x110')));this['moveContactManagedDialer'](_0x2542ed)[_0x49c4('0xad')](loggerCatch(_0x49c4('0x115')));};Dialer['prototype'][_0x49c4('0x116')]=function(_0x40c42f){var _0x54eacb=this[_0x49c4('0x26')][_0x40c42f[_0x49c4('0xd9')]];var _0x107f65=this;if(this['voiceQueues'][_0x40c42f[_0x49c4('0xaf')]]){if(_0x54eacb&&_0x54eacb[_0x49c4('0x48')]!==_0x49c4('0x92')){delete this[_0x49c4('0x26')][_0x40c42f['uniqueid']];this[_0x49c4('0xae')](this['voiceQueues'][_0x40c42f[_0x49c4('0xaf')]]);_0x54eacb[_0x49c4('0x117')]=moment()[_0x49c4('0x79')](_0x49c4('0xf5'));var _0x5a28cc=new QueueCallerAbandon(_0x54eacb,_0x40c42f);if(getSeconds(_0x54eacb[_0x49c4('0x117')],_0x54eacb[_0x49c4('0x118')])>=_0x54eacb[_0x49c4('0x119')]){this[_0x49c4('0x1f')][_0x40c42f[_0x49c4('0xaf')]][_0x49c4('0x6a')]+=0x1;this['voiceQueues'][_0x40c42f['queue']][_0x49c4('0x11a')]+=0x1;this[_0x49c4('0x1f')][_0x40c42f[_0x49c4('0xaf')]][_0x49c4('0x6c')]+=0x1;_0x5a28cc[_0x49c4('0xa7')]=0xa;_0x5a28cc[_0x49c4('0xa8')]=_0x49c4('0x11b');_0x5a28cc[_0x49c4('0x11c')]=_0x49c4('0x11d');_0x5a28cc[_0x49c4('0x10e')]=this[_0x49c4('0x1f')][_0x40c42f[_0x49c4('0xaf')]]['dialQueueProject2']?moment()[_0x49c4('0x79')](_0x49c4('0xf5')):undefined;_0x5a28cc['countdropretry']+=0x1;_0x5a28cc[_0x49c4('0xe8')]+=0x1;if(_0x5a28cc['countdropretry']>=this[_0x49c4('0x1f')][_0x40c42f[_0x49c4('0xaf')]]['dialDropMaxRetry']){this[_0x49c4('0x114')](_0x5a28cc);}else{this[_0x49c4('0xf3')]({'active':![],'countdropretry':_0x5a28cc[_0x49c4('0xfe')],'scheduledat':moment()[_0x49c4('0x101')](this[_0x49c4('0x1f')][_0x40c42f['queue']][_0x49c4('0x11e')],'minutes')[_0x49c4('0x79')](_0x49c4('0xf5')),'ContactId':_0x54eacb[_0x49c4('0xf6')],'ListId':_0x54eacb['ListId'],'VoiceQueueId':_0x54eacb[_0x49c4('0xd0')]||undefined,'CampaignId':_0x54eacb[_0x49c4('0xd1')]||undefined})[_0x49c4('0xad')](loggerCatch('[rescheduleContact][Drop]'));var _0x4427ba=new History(_0x5a28cc);_0x4427ba[_0x49c4('0xa7')]=0xa;_0x4427ba[_0x49c4('0xa8')]=_0x49c4('0x11b');_0x4427ba[_0x49c4('0x11f')]=moment()[_0x49c4('0x79')](_0x49c4('0xf5'));_0x4427ba['endtime']=_0x4427ba['starttime'];_0x4427ba['calleridname']=_0x5a28cc[_0x49c4('0x120')];_0x4427ba[_0x49c4('0x121')]=_0x5a28cc[_0x49c4('0x121')];this[_0x49c4('0xd8')](_0x4427ba)['catch'](loggerCatch(_0x49c4('0x122')));}}else{this[_0x49c4('0x1f')][_0x40c42f[_0x49c4('0xaf')]][_0x49c4('0x69')]+=0x1;this[_0x49c4('0x1f')][_0x40c42f[_0x49c4('0xaf')]][_0x49c4('0x61')]+=0x1;_0x5a28cc[_0x49c4('0xa7')]=0xb;_0x5a28cc[_0x49c4('0xa8')]=_0x49c4('0x123');_0x5a28cc[_0x49c4('0x11c')]='CALLEREXIT';_0x5a28cc[_0x49c4('0xed')]+=0x1;_0x5a28cc['countglobal']+=0x1;if(_0x5a28cc[_0x49c4('0xed')]>=this[_0x49c4('0x1f')][_0x40c42f[_0x49c4('0xaf')]][_0x49c4('0x124')]){this['queueCallerAbandonCreateState'](_0x5a28cc);}else{this[_0x49c4('0xf3')]({'active':![],'countabandonedretry':_0x5a28cc['countabandonedretry'],'scheduledat':moment()['add'](this['voiceQueues'][_0x40c42f[_0x49c4('0xaf')]][_0x49c4('0x125')],_0x49c4('0x102'))['format'](_0x49c4('0xf5')),'ContactId':_0x54eacb['ContactId'],'ListId':_0x54eacb[_0x49c4('0xce')],'VoiceQueueId':_0x54eacb[_0x49c4('0xd0')]||undefined,'CampaignId':_0x54eacb[_0x49c4('0xd1')]||undefined})['catch'](loggerCatch(_0x49c4('0x126')));var _0x4427ba=new History(_0x5a28cc);_0x4427ba[_0x49c4('0xa7')]=0xb;_0x4427ba[_0x49c4('0xa8')]=_0x49c4('0x123');_0x4427ba['starttime']=moment()[_0x49c4('0x79')](_0x49c4('0xf5'));_0x4427ba[_0x49c4('0xa9')]=_0x4427ba[_0x49c4('0x11f')];_0x4427ba['calleridname']=_0x5a28cc['calleridname'];_0x4427ba[_0x49c4('0x121')]=_0x5a28cc[_0x49c4('0x121')];this['createHistory'](_0x4427ba)[_0x49c4('0xad')](loggerCatch(_0x49c4('0x127')));}}}}};Dialer[_0x49c4('0x1a')][_0x49c4('0x128')]=function(_0x512d87){if(this[_0x49c4('0x24')][_0x512d87[_0x49c4('0xd9')]]){this['actions'][_0x512d87['uniqueid']][_0x49c4('0x129')]=_0x512d87[_0x49c4('0x129')];}if(this[_0x49c4('0x26')][_0x512d87[_0x49c4('0xd9')]]){this[_0x49c4('0x26')][_0x512d87['uniqueid']][_0x49c4('0x129')]=_0x512d87['channel'];}};Dialer[_0x49c4('0x1a')][_0x49c4('0x34')]=function(_0x3c6044){if(strategy[this[_0x49c4('0x1f')][this['actions'][_0x3c6044['actionid']]['queue']][_0x49c4('0x4a')]]===_0x49c4('0x19')){if(this[_0x49c4('0x24')][_0x3c6044[_0x49c4('0x12a')]]&&_['isNil'](this['actions'][_0x3c6044[_0x49c4('0x12a')]]['locked'])&&_0x3c6044[_0x49c4('0x12b')]==='1'&&_0x3c6044[_0x49c4('0x12c')]==='0'){if(this['agents'][_0x3c6044[_0x49c4('0x12d')]]){if(!this[_0x49c4('0x20')][_0x3c6044[_0x49c4('0x12d')]]['locked']){this[_0x49c4('0x20')][_0x3c6044[_0x49c4('0x12d')]][_0x49c4('0x12e')]=!![];this['actions'][_0x3c6044[_0x49c4('0x12a')]][_0x49c4('0x12e')]=!![];this['actions'][_0x3c6044[_0x49c4('0x12a')]][_0x49c4('0x12d')]=_0x3c6044['stateinterface'];}}}}else if((strategy[this[_0x49c4('0x1f')][this[_0x49c4('0x24')][_0x3c6044[_0x49c4('0x12a')]][_0x49c4('0xaf')]][_0x49c4('0x4a')]]||'rrmemory')===_0x49c4('0x18')){if(this[_0x49c4('0x24')][_0x3c6044['actionid']]){if(this[_0x49c4('0x20')][_0x3c6044[_0x49c4('0x12d')]]){this[_0x49c4('0x24')][_0x3c6044['actionid']][_0x49c4('0x12d')]=_0x3c6044['stateinterface'];if(_[_0x49c4('0xab')](this[_0x49c4('0x2b')][this['actions'][_0x3c6044[_0x49c4('0x12a')]]['queue']])){this[_0x49c4('0x2b')][this[_0x49c4('0x24')][_0x3c6044['actionid']][_0x49c4('0xaf')]]=[];}this[_0x49c4('0x2b')][this['actions'][_0x3c6044['actionid']][_0x49c4('0xaf')]][_0x49c4('0x12f')](_[_0x49c4('0x8b')](_[_0x49c4('0x130')](this[_0x49c4('0x24')][_0x3c6044['actionid']],[_0x49c4('0x131'),_0x49c4('0x12d')]),{'status':_0x3c6044[_0x49c4('0x12b')],'paused':_0x3c6044[_0x49c4('0x12c')]}));}}}};function unlockQueueStatus(_0x28899f,_0x4ff046){setTimeout(function(){if(_[_0x49c4('0x39')](_0x28899f[_0x49c4('0x132')])){loggerBooked[_0x49c4('0x96')](_0x49c4('0x133'),_0x4ff046);}_0x28899f[_0x49c4('0x132')]=!![];loggerBooked[_0x49c4('0x7b')](_0x49c4('0x134'),_0x4ff046,JSON[_0x49c4('0x135')](_['pick'](_0x28899f,[_0x49c4('0x3d'),_0x49c4('0x132')])));},0x1f3);}Dialer[_0x49c4('0x1a')]['syncQueueStatusComplete']=function(_0x5db4e4){var _0xe90f3c=this;var _0x4f93e0=_0xe90f3c[_0x49c4('0x1f')][_0xe90f3c[_0x49c4('0x24')][_0x5db4e4[_0x49c4('0x12a')]][_0x49c4('0xaf')]];if(strategy[this['voiceQueues'][this[_0x49c4('0x24')][_0x5db4e4[_0x49c4('0x12a')]][_0x49c4('0xaf')]][_0x49c4('0x4a')]]==='roundrobin'){if(this[_0x49c4('0x24')][_0x5db4e4[_0x49c4('0x12a')]]&&this['actions'][_0x5db4e4[_0x49c4('0x12a')]][_0x49c4('0x12d')]){this[_0x49c4('0x91')][_0x49c4('0x136')](this[_0x49c4('0x24')][_0x5db4e4[_0x49c4('0x12a')]][_0x49c4('0x131')],this[_0x49c4('0x24')][_0x5db4e4['actionid']]['stateinterface'])['catch'](function(_0x128027){logger[_0x49c4('0x96')](_0x49c4('0x137'),util[_0x49c4('0x97')](_0x128027,{'showHidden':![],'depth':null}));})[_0x49c4('0x1d')](function(){_0xe90f3c['updateOriginated'](_0xe90f3c[_0x49c4('0x1f')][_0xe90f3c[_0x49c4('0x24')][_0x5db4e4[_0x49c4('0x12a')]][_0x49c4('0xaf')]]);_0xe90f3c['agents'][_0xe90f3c['actions'][_0x5db4e4[_0x49c4('0x12a')]][_0x49c4('0x12d')]][_0x49c4('0x12e')]=![];delete _0xe90f3c[_0x49c4('0x24')][_0x5db4e4[_0x49c4('0x12a')]];unlockQueueStatus(_0x4f93e0);});}else{this[_0x49c4('0xae')](this['voiceQueues'][this['actions'][_0x5db4e4[_0x49c4('0x12a')]][_0x49c4('0xaf')]]);this[_0x49c4('0xf3')]({'active':![],'ContactId':this[_0x49c4('0x24')][_0x5db4e4[_0x49c4('0x12a')]]['ContactId'],'ListId':this[_0x49c4('0x24')][_0x5db4e4[_0x49c4('0x12a')]][_0x49c4('0xce')],'VoiceQueueId':this[_0x49c4('0x24')][_0x5db4e4[_0x49c4('0x12a')]][_0x49c4('0xd0')]||undefined,'CampaignId':this[_0x49c4('0x24')][_0x5db4e4[_0x49c4('0x12a')]][_0x49c4('0xd1')]||undefined})['catch'](loggerCatch(_0x49c4('0x138')));delete this[_0x49c4('0x24')][_0x5db4e4[_0x49c4('0x12a')]];unlockQueueStatus(_0x4f93e0);}}else if((strategy[this[_0x49c4('0x1f')][this[_0x49c4('0x24')][_0x5db4e4['actionid']][_0x49c4('0xaf')]][_0x49c4('0x4a')]]||'rrmemory')===_0x49c4('0x18')){var _0x586857;if(this[_0x49c4('0x24')][_0x5db4e4['actionid']]&&!_[_0x49c4('0x41')](this[_0x49c4('0x2b')][this['actions'][_0x5db4e4[_0x49c4('0x12a')]]['queue']])){if(this[_0x49c4('0x139')][_0xe90f3c[_0x49c4('0x24')][_0x5db4e4[_0x49c4('0x12a')]][_0x49c4('0xaf')]]){this[_0x49c4('0x139')][_0xe90f3c['actions'][_0x5db4e4[_0x49c4('0x12a')]][_0x49c4('0xaf')]]=this[_0x49c4('0x139')][this[_0x49c4('0x24')][_0x5db4e4[_0x49c4('0x12a')]][_0x49c4('0xaf')]]?this[_0x49c4('0x139')][this[_0x49c4('0x24')][_0x5db4e4['actionid']][_0x49c4('0xaf')]]:this[_0x49c4('0x2b')][this[_0x49c4('0x24')][_0x5db4e4[_0x49c4('0x12a')]][_0x49c4('0xaf')]]?this[_0x49c4('0x2b')][this[_0x49c4('0x24')][_0x5db4e4[_0x49c4('0x12a')]][_0x49c4('0xaf')]][_0x49c4('0x13a')]||0x0:0x0;}this[_0x49c4('0x2b')][this[_0x49c4('0x24')][_0x5db4e4['actionid']][_0x49c4('0xaf')]]['_rr']=this[_0x49c4('0x139')][this[_0x49c4('0x24')][_0x5db4e4[_0x49c4('0x12a')]][_0x49c4('0xaf')]];for(var _0x14ba43=0x0;_0x14ba43=0x0;})['catch'](myreject(_0x780a93)));}}else{_0x3483c9[_0x49c4('0x12f')](ami[_0x49c4('0xac')]({'action':_0x49c4('0x14d'),'command':util[_0x49c4('0x79')]('iftime\x20%s,%s',_0x2f5ad1,!_[_0x49c4('0x39')](config[_0x49c4('0x14a')][_0x44d293])?_0x44d293:'')})['then'](function(_0x5af4e6){return _0x5af4e6[_0x49c4('0x14f')]['indexOf'](_0x49c4('0x151'))>=0x0;})[_0x49c4('0xad')](myreject(_0x780a93)));}BPromise['all'](_0x3483c9)['then'](function(_0x458d07){var _0x49f732=_['some'](_0x458d07);if(_0x49f732){return _0x4726e3(_0x49f732);}else{_0x2705d3[_0x49c4('0x3a')]=_0x44e7ca?'GLOBAL_INTERVAL_IS_OVERTIME':_0x49c4('0x152');return _0x780a93(msgResponse(_0x49c4('0x153'),_0x49c4('0x149'),_0x49c4('0x154')+_0x44e7ca+'\x20'+_0x474488+_0x49c4('0x155')+util[_0x49c4('0x97')](_0x2f5ad1,{'showHidden':![],'depth':null})+_0x49c4('0x156')+_0x44d293));}})[_0x49c4('0xad')](function(_0x57a85f){return _0x780a93(msgResponse(_0x49c4('0x146'),'Failure',JSON['stringify'](_0x57a85f)));});});};Dialer[_0x49c4('0x1a')][_0x49c4('0x157')]=function(_0x456307){var _0xfcf36d=this;return function(){switch(_0x456307[_0x49c4('0x58')]){case'progressive':freeVariablesPredictive(_0x456307);_0xfcf36d[_0x49c4('0x158')](_0x456307,0x1);break;case _0x49c4('0x159'):freeVariablesPredictive(_0x456307);_0xfcf36d[_0x49c4('0x158')](_0x456307,_0x456307['dialPowerLevel']);break;case _0x49c4('0x9'):_0xfcf36d[_0x49c4('0x9')](_0x456307);break;case _0x49c4('0x7'):freeVariablesPredictive(_0x456307);_0xfcf36d[_0x49c4('0x158')](_0x456307,0x1);break;default:freeVariablesPredictive(_0x456307);logger['error'](_0x49c4('0x15a'),_0x456307[_0x49c4('0x3d')],_0x49c4('0x15b'));}};};Dialer[_0x49c4('0x1a')][_0x49c4('0x15c')]=function(_0x26e2c2){var _0x1f76e6=this;return function(){_0x1f76e6[_0x49c4('0x15d')](_0x26e2c2);};};Dialer[_0x49c4('0x1a')]['syncQueueSummary']=function(_0x44a7e1){var _0x2c4ae5=this;if(isNotPreview(_0x44a7e1[_0x49c4('0x58')])){if(isVoiceQueueOutbound(_0x44a7e1[_0x49c4('0x48')])&&isActive(_0x44a7e1[_0x49c4('0x57')])){_0x44a7e1[_0x49c4('0xa6')]=!![];BPromise[_0x49c4('0xb3')]()[_0x49c4('0xb4')](checkIsLoggedIn(_0x44a7e1,_0x44a7e1['loggedIn']))[_0x49c4('0xb4')](checkIsActive(_0x44a7e1,_0x44a7e1[_0x49c4('0x57')]))[_0x49c4('0xb4')](checkInterval(_0x44a7e1))[_0x49c4('0xb4')](_0x2c4ae5[_0x49c4('0x15e')](_0x44a7e1))[_0x49c4('0xb4')](_0x2c4ae5[_0x49c4('0x145')](_0x44a7e1[_0x49c4('0x15f')],_0x44a7e1['dialTimezone'],_0x44a7e1[_0x49c4('0x3d')],_0x44a7e1))[_0x49c4('0xb4')](_0x2c4ae5['checkIfTimeIntervals'](_0x44a7e1[_0x49c4('0x3e')],_0x44a7e1[_0x49c4('0x160')],_0x44a7e1[_0x49c4('0x3d')],_0x44a7e1))[_0x49c4('0xb4')](_0x2c4ae5['checkDialMethod'](_0x44a7e1))[_0x49c4('0xad')](loggerCatchQueueSummary('[syncQueueSummary]',_0x44a7e1));}else{notSendMessagesQueue(_0x44a7e1);}}else{freeVariablesPredictive(_0x44a7e1);}};Dialer[_0x49c4('0x1a')]['syncCampaigns']=function(){var _0xc1f0eb=this;var _0x12f947;for(var _0x467370 in this[_0x49c4('0xb1')]){if(typeof this[_0x49c4('0xb1')][_0x467370]!==_0x49c4('0x9a')){_0x12f947=this[_0x49c4('0xb1')][_0x467370];if(isCampaignIvr(_0x12f947[_0x49c4('0x48')])&&isActive(_0x12f947[_0x49c4('0x75')])){_0x12f947[_0x49c4('0xa6')]=!![];BPromise[_0x49c4('0xb3')]()['then'](checkIsActive(_0x12f947,_0x12f947[_0x49c4('0x75')]))['then'](checkInterval(_0x12f947))[_0x49c4('0xb4')](_0xc1f0eb[_0x49c4('0x15e')](_0x12f947))[_0x49c4('0xb4')](_0xc1f0eb[_0x49c4('0x145')](_0x12f947[_0x49c4('0x15f')],_0x12f947[_0x49c4('0x160')],_0x12f947[_0x49c4('0x3d')],_0x12f947))[_0x49c4('0xb4')](_0xc1f0eb[_0x49c4('0x147')](_0x12f947[_0x49c4('0x3e')],_0x12f947[_0x49c4('0x160')],_0x12f947[_0x49c4('0x3d')],_0x12f947))[_0x49c4('0xb4')](_0xc1f0eb[_0x49c4('0x15c')](_0x12f947))[_0x49c4('0xad')](loggerCatchQueueSummary('[syncCampaigns]',_0x12f947));}else{notSendMessagesCampaign(_0x12f947);}}}};function getCallerIdRandom(_0xa5a9a1,_0x5c0f35){var _0x59583d;var _0x56004c;var _0x2764ea;if(_0x5c0f35<=0x0){_0x5c0f35=0x1;}_0x59583d=new RegExp(_0x49c4('0x161')+_0x5c0f35+'}$');_0x56004c=Math[_0x49c4('0x162')](0xa,_0x5c0f35-0x1);_0x2764ea=Math[_0x49c4('0x162')](0xa,_0x5c0f35)-0x1;return util[_0x49c4('0x79')]('%s',_['replace'](_0xa5a9a1,_0x59583d,_['random'](_0x56004c,_0x2764ea)));}function extractCalleridName(_0x1455ef){var _0xd0faf2=_0x1455ef['match'](/"(.*?)"/);return _0xd0faf2?_0xd0faf2[0x1]:_0x1455ef;}function extractCalleridNumber(_0x17e278){var _0xf0c5c4=_0x17e278[_0x49c4('0x163')](/<(.*?)>/);return _0xf0c5c4?_0xf0c5c4[0x1]:_0x17e278;}Dialer[_0x49c4('0x1a')][_0x49c4('0x164')]=function(_0x29ed3c,_0x41070f){var _0x341ec1=this;var _0x3247e4=uuid['v4']();this[_0x49c4('0x24')][_0x3247e4]=new Action(_0x29ed3c,_0x41070f,_0x3247e4);return new BPromise(function(_0x35e162,_0x4ef607){if(_[_0x49c4('0x39')](_0x29ed3c)&&typeof _0x29ed3c!==_0x49c4('0x165')){return _0x4ef607(msgResponse('originate',_0x49c4('0x149'),_0x49c4('0x166')));}if(_[_0x49c4('0x39')](_0x41070f[_0x49c4('0x167')][_0x49c4('0x168')])||_0x41070f[_0x49c4('0x167')][_0x49c4('0x168')]===null){return _0x4ef607(msgResponse(_0x49c4('0x169'),_0x49c4('0x149'),_0x49c4('0x16a')));}var _0x3fd525={'XMD-CALLERID':_0x341ec1[_0x49c4('0x24')][_0x3247e4][_0x49c4('0x16b')](),'XMD-AGI':_0x29ed3c[_0x49c4('0x105')]?util[_0x49c4('0x79')](_0x49c4('0x16c'),ipAgi,_0x29ed3c['dialQueueProject']):_0x49c4('0x16d'),'XMD-AGIAFTER':_0x29ed3c['dialQueueProject2']?util[_0x49c4('0x79')]('\x22agi://%s/square,%s\x22',ipAgi,_0x29ed3c[_0x49c4('0x16e')]):_0x49c4('0x16d'),'XMD-QUEUE':_0x29ed3c['type']==='outbound'?util[_0x49c4('0x79')](_0x49c4('0x16f'),_0x29ed3c['name'],_0x29ed3c[_0x49c4('0x170')]||'',_0x29ed3c[_0x49c4('0x10f')]?'c':'',_0x29ed3c[_0x49c4('0x119')]||0x3):'NONE','XMD-CONTACTID':_0x41070f[_0x49c4('0xf6')],'XMD-CDRTYPE':_0x49c4('0x6'),'CALLERID(all)':_0x341ec1[_0x49c4('0x24')][_0x3247e4]['getCaller'](),'XMD-AMD':_0x29ed3c[_0x49c4('0xe7')]?'ACTIVE':_0x49c4('0x16d'),'XMD-DESTINATION':_0x49c4('0xdd')};if(_0x29ed3c[_0x49c4('0xe7')]){_0x3fd525[_0x49c4('0x171')]=_0x29ed3c[_0x49c4('0x172')]||0x9c4;_0x3fd525[_0x49c4('0x173')]=_0x29ed3c[_0x49c4('0x174')]||0x5dc;_0x3fd525[_0x49c4('0x175')]=_0x29ed3c[_0x49c4('0x176')]||0x320;_0x3fd525[_0x49c4('0x177')]=_0x29ed3c['dialAMDTotalAnalysisTime']||0x1388;_0x3fd525['XMD-AMDMINWORDLENGTH']=_0x29ed3c[_0x49c4('0x178')]||0x64;_0x3fd525[_0x49c4('0x179')]=_0x29ed3c[_0x49c4('0x17a')]||0x32;_0x3fd525[_0x49c4('0x17b')]=_0x29ed3c[_0x49c4('0x17c')]||0x3;_0x3fd525[_0x49c4('0x17d')]=_0x29ed3c['dialAMDSilenceThreshold']||0x100;_0x3fd525[_0x49c4('0x17e')]=_0x29ed3c['dialAMDMaximumWordLength']||0x1388;}if(_0x29ed3c[_0x49c4('0x48')]===_0x49c4('0x49')){_0x3fd525[_0x49c4('0x17f')]=_0x41070f[_0x49c4('0xd0')];}else{_0x3fd525['XMD-CAMPAIGNID']=_0x41070f[_0x49c4('0xd1')];}for(var _0x3d1237 in _0x41070f['Contact']){if(typeof _0x41070f[_0x49c4('0x167')][_0x3d1237]!==_0x49c4('0x9a')){if(isNotNull(_0x41070f['Contact'][_0x3d1237])&&_0x3d1237!=='id'&&_0x3d1237!=='tags'&&_0x3d1237!=='createdAt'&&_0x3d1237!==_0x49c4('0x180')){_0x3fd525[util[_0x49c4('0x79')](_0x49c4('0x181'),_0x49c4('0x182'),_['toUpper'](_0x3d1237))]=_0x41070f[_0x49c4('0x167')][_0x3d1237];}}}var _0x5e7232=_0x341ec1[_0x49c4('0xd4')](_0x29ed3c[_0x49c4('0x74')])?getCallerId(_0x29ed3c[_0x49c4('0x74')][_0x49c4('0x76')],_0x29ed3c[_0x49c4('0x59')],_0x29ed3c[_0x49c4('0x183')]>0x0?getCallerIdRandom(_0x29ed3c['dialOriginateCallerIdNumber'],_0x29ed3c['dialRandomLastDigitCallerIdNumber']):_0x29ed3c[_0x49c4('0x5a')]):getCallerId(_[_0x49c4('0xab')](_0x29ed3c['TrunkBackup'])?_0x29ed3c['Trunk'][_0x49c4('0x76')]:_0x29ed3c[_0x49c4('0x184')][_0x49c4('0x76')],_0x29ed3c[_0x49c4('0x59')],_0x29ed3c[_0x49c4('0x183')]>0x0?getCallerIdRandom(_0x29ed3c[_0x49c4('0x5a')],_0x29ed3c['dialRandomLastDigitCallerIdNumber']):_0x29ed3c[_0x49c4('0x5a')]);if(_0x5e7232){_0x3fd525[_0x49c4('0x185')]=_0x341ec1['actions'][_0x3247e4][_0x49c4('0x186')]=extractCalleridName(_0x5e7232);_0x3fd525[_0x49c4('0x187')]=_0x341ec1['actions'][_0x3247e4][_0x49c4('0x188')]=extractCalleridNumber(_0x5e7232);}return ami[_0x49c4('0xac')]({'actionid':_0x3247e4,'action':'originate','channel':_0x341ec1[_0x49c4('0xd4')](_0x29ed3c[_0x49c4('0x74')])?util['format'](_0x49c4('0x189'),_0x29ed3c[_0x49c4('0x74')]['name'],isNotNull(_0x29ed3c[_0x49c4('0x5b')])?_0x29ed3c[_0x49c4('0x5b')][_0x49c4('0x18a')]()||'':'',_0x29ed3c[_0x49c4('0x18b')]>0x0?_0x41070f['Contact'][_0x49c4('0x168')][_0x49c4('0x18c')](_0x29ed3c[_0x49c4('0x18b')]):_0x41070f[_0x49c4('0x167')][_0x49c4('0x168')]):util['format']('SIP/%s/%s%s',_['isNil'](_0x29ed3c[_0x49c4('0x184')])?_0x29ed3c[_0x49c4('0x74')][_0x49c4('0x3d')]:_0x29ed3c[_0x49c4('0x184')][_0x49c4('0x3d')],isNotNull(_0x29ed3c[_0x49c4('0x5b')])?_0x29ed3c[_0x49c4('0x5b')][_0x49c4('0x18a')]()||'':'',_0x29ed3c[_0x49c4('0x18b')]>0x0?_0x41070f[_0x49c4('0x167')]['phone'][_0x49c4('0x18c')](_0x29ed3c[_0x49c4('0x18b')]):_0x41070f[_0x49c4('0x167')][_0x49c4('0x168')]),'callerid':_0x5e7232,'Exten':_0x49c4('0xdd'),'Context':_0x49c4('0x18d'),'Priority':'1','variable':_0x3fd525,'timeout':(_0x29ed3c[_0x49c4('0x18e')]||0x1e)*0x3e8,'async':!![],'channelid':_0x3247e4})[_0x49c4('0xb4')](function(_0x232304){return _0x35e162(_0x232304);})[_0x49c4('0xad')](function(_0x345381){_0x29ed3c['outboundOriginateFailureCallsDay']+=0x1;var _0x42aff6=new History(_0x341ec1[_0x49c4('0x24')][_0x3247e4]);logger['error'](util['format'](_0x49c4('0x18f'),JSON[_0x49c4('0x135')](_0x345381)));_0x42aff6[_0x49c4('0xa7')]=0xe;_0x42aff6[_0x49c4('0xa8')]='OriginateError';_0x42aff6[_0x49c4('0x11f')]=moment()['format'](_0x49c4('0xf5'));_0x42aff6[_0x49c4('0xa9')]=_0x42aff6[_0x49c4('0x11f')];_0x341ec1[_0x49c4('0xd8')](_0x42aff6)[_0x49c4('0xad')](loggerCatch('[originate][error]'));_0x341ec1['moveContactManagedDialer'](_0x42aff6)[_0x49c4('0xad')](loggerCatch(_0x49c4('0x190')))['finally'](function(){delete _0x341ec1['actions'][_0x3247e4];return _0x4ef607(msgResponse('originate',_0x49c4('0x44'),_0x49c4('0x191')));});});});};Dialer[_0x49c4('0x1a')]['syncOriginateResponse']=function(_0xb273b4){var _0x2ee4ff=this[_0x49c4('0x24')][_0xb273b4[_0x49c4('0x12a')]];if(_0x2ee4ff){delete this[_0x49c4('0x24')][_0xb273b4['actionid']];_0x2ee4ff[_0x49c4('0x118')]=moment()[_0x49c4('0x79')](_0x49c4('0xf5'));var _0x4b0742=_0x2ee4ff[_0x49c4('0x48')]===_0x49c4('0x92')?this[_0x49c4('0xb1')][_0x2ee4ff[_0x49c4('0xaf')]]:this['voiceQueues'][_0x2ee4ff[_0x49c4('0x192')]()];if(!this[_0x49c4('0xd3')](_0xb273b4[_0x49c4('0x193')])){this['updateOriginated'](_0x4b0742);return this[_0x49c4('0x194')](_0x2ee4ff,_0x4b0742,_0xb273b4)['catch'](loggerCatch(_0x49c4('0x195')));}this['uniqueId'][_0xb273b4[_0x49c4('0xd9')]]=_0x2ee4ff;}};Dialer[_0x49c4('0x1a')][_0x49c4('0x196')]=function(_0x5a7eed,_0x21d59c,_0x5cd015){var _0x50ac60=new History(_0x21d59c);if(_0x50ac60['countbusyretry']+_0x50ac60[_0x49c4('0xea')]+_0x50ac60[_0x49c4('0xeb')]+_0x50ac60['countnosuchnumberretry']+_0x50ac60[_0x49c4('0xfe')]+_0x50ac60[_0x49c4('0xed')]+_0x50ac60['countmachineretry']+_0x50ac60[_0x49c4('0x197')]>=_0x5cd015[_0x49c4('0xff')]-0x1){return!![];}switch(_0x5a7eed){case 0x3:if(_0x50ac60[_0x49c4('0xeb')]>=_0x5cd015[_0x49c4('0x198')]-0x1){return!![];}this[_0x49c4('0xf3')]({'active':![],'countnoanswerretry':_0x50ac60[_0x49c4('0xeb')]+=0x1,'scheduledat':moment()[_0x49c4('0x101')](_0x5cd015[_0x49c4('0x199')],_0x49c4('0x102'))[_0x49c4('0x79')](_0x49c4('0xf5')),'ContactId':_0x50ac60[_0x49c4('0xf6')],'ListId':_0x50ac60[_0x49c4('0xce')],'VoiceQueueId':_0x50ac60['VoiceQueueId']||undefined,'CampaignId':_0x50ac60[_0x49c4('0xd1')]||undefined})['catch'](loggerCatch('[rescheduleContact][NoAnswer]'));break;case 0x5:if(_0x50ac60[_0x49c4('0xfd')]>=_0x5cd015[_0x49c4('0x19a')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countbusyretry':_0x50ac60[_0x49c4('0xfd')]+=0x1,'scheduledat':moment()[_0x49c4('0x101')](_0x5cd015[_0x49c4('0x19b')],_0x49c4('0x102'))[_0x49c4('0x79')](_0x49c4('0xf5')),'ContactId':_0x50ac60[_0x49c4('0xf6')],'ListId':_0x50ac60['ListId'],'VoiceQueueId':_0x50ac60[_0x49c4('0xd0')]||undefined,'CampaignId':_0x50ac60[_0x49c4('0xd1')]||undefined})[_0x49c4('0xad')](loggerCatch(_0x49c4('0x19c')));break;case 0x8:if(_0x50ac60[_0x49c4('0xea')]>=_0x5cd015[_0x49c4('0x19d')]-0x1){return!![];}this[_0x49c4('0xf3')]({'active':![],'countcongestionretry':_0x50ac60[_0x49c4('0xea')]+=0x1,'scheduledat':moment()[_0x49c4('0x101')](_0x5cd015['dialCongestionRetryFrequency'],_0x49c4('0x102'))[_0x49c4('0x79')](_0x49c4('0xf5')),'ContactId':_0x50ac60[_0x49c4('0xf6')],'ListId':_0x50ac60[_0x49c4('0xce')],'VoiceQueueId':_0x50ac60[_0x49c4('0xd0')]||undefined,'CampaignId':_0x50ac60[_0x49c4('0xd1')]||undefined})['catch'](loggerCatch(_0x49c4('0x19e')));break;case 0x0:if(_0x50ac60['countnosuchnumberretry']>=_0x5cd015[_0x49c4('0x19f')]-0x1){return!![];}else{this[_0x49c4('0xf3')]({'active':![],'countnosuchnumberretry':_0x50ac60[_0x49c4('0xec')]+=0x1,'scheduledat':moment()[_0x49c4('0x101')](_0x5cd015[_0x49c4('0x1a0')],_0x49c4('0x102'))['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x50ac60['ContactId'],'ListId':_0x50ac60[_0x49c4('0xce')],'VoiceQueueId':_0x50ac60[_0x49c4('0xd0')]||undefined,'CampaignId':_0x50ac60[_0x49c4('0xd1')]||undefined})[_0x49c4('0xad')](loggerCatch('[rescheduleContact][NoSuchNumber]'));}break;case 0xa:if(_0x50ac60['countdropretry']>=_0x5cd015[_0x49c4('0x1a1')]-0x1){return!![];}this['rescheduleContact']({'active':![],'countdropretry':_0x50ac60[_0x49c4('0xfe')]+=0x1,'scheduledat':moment()[_0x49c4('0x101')](_0x5cd015['dialDropRetryFrequency'],_0x49c4('0x102'))[_0x49c4('0x79')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x50ac60['ContactId'],'ListId':_0x50ac60[_0x49c4('0xce')],'VoiceQueueId':_0x50ac60['VoiceQueueId']||undefined,'CampaignId':_0x50ac60[_0x49c4('0xd1')]||undefined})['catch'](loggerCatch(_0x49c4('0x1a2')));break;case 0xb:if(_0x50ac60[_0x49c4('0xed')]>=_0x5cd015[_0x49c4('0x124')]-0x1){return!![];}this[_0x49c4('0xf3')]({'active':![],'countabandonedretry':_0x50ac60[_0x49c4('0xed')]+=0x1,'scheduledat':moment()['add'](_0x5cd015[_0x49c4('0x125')],_0x49c4('0x102'))[_0x49c4('0x79')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x50ac60[_0x49c4('0xf6')],'ListId':_0x50ac60[_0x49c4('0xce')],'VoiceQueueId':_0x50ac60['VoiceQueueId']||undefined,'CampaignId':_0x50ac60[_0x49c4('0xd1')]||undefined})[_0x49c4('0xad')](loggerCatch(_0x49c4('0x126')));break;case 0x13:if(_0x50ac60['countmachineretry']>=_0x5cd015[_0x49c4('0x100')]-0x1){return!![];}this[_0x49c4('0xf3')]({'active':![],'countmachineretry':_0x50ac60[_0x49c4('0xee')]+=0x1,'scheduledat':moment()[_0x49c4('0x101')](_0x5cd015['dialMachineRetryFrequency'],_0x49c4('0x102'))[_0x49c4('0x79')](_0x49c4('0xf5')),'ContactId':_0x50ac60['ContactId'],'ListId':_0x50ac60[_0x49c4('0xce')],'VoiceQueueId':_0x50ac60['VoiceQueueId']||undefined,'CampaignId':_0x50ac60[_0x49c4('0xd1')]||undefined})[_0x49c4('0xad')](loggerCatch('[rescheduleContact][Machine]'));break;case 0x14:if(_0x50ac60[_0x49c4('0x197')]>=_0x5cd015[_0x49c4('0x1a3')]-0x1){return!![];}this[_0x49c4('0xf3')]({'active':![],'countagentrejectretry':_0x50ac60['countagentrejectretry']+=0x1,'scheduledat':moment()[_0x49c4('0x101')](_0x5cd015[_0x49c4('0x1a4')],'minutes')[_0x49c4('0x79')](_0x49c4('0xf5')),'ContactId':_0x50ac60['ContactId'],'ListId':_0x50ac60[_0x49c4('0xce')],'VoiceQueueId':_0x50ac60[_0x49c4('0xd0')]||undefined,'CampaignId':_0x50ac60[_0x49c4('0xd1')]||undefined})[_0x49c4('0xad')](loggerCatch(_0x49c4('0x1a5')));break;default:return!![];}};Dialer[_0x49c4('0x1a')][_0x49c4('0x194')]=function(_0x198a69,_0x556d0a,_0x491626){var _0x34c7ab=this;var _0x54d6e5=new History(_0x198a69);return new BPromise(function(_0x2343a8,_0x16c6f5){if(_[_0x49c4('0x39')](_0x556d0a)&&typeof _0x556d0a!==_0x49c4('0x165')){return _0x16c6f5(msgResponse('[callProgressDetecting]',_0x49c4('0x149'),_0x49c4('0x1a6')));}if(_[_0x49c4('0x39')](_0x491626)&&typeof _0x491626!==_0x49c4('0x165')){return _0x16c6f5(msgResponse(_0x49c4('0x1a7'),_0x49c4('0x149'),_0x49c4('0x1a8')));}switch(_0x491626['reason']){case'0':_0x556d0a['outboundNoSuchCallsDay']+=0x1;_0x54d6e5[_0x49c4('0xa7')]=0x0;_0x54d6e5[_0x49c4('0xa8')]=_0x49c4('0x1a9');_0x54d6e5[_0x49c4('0xec')]+=0x1;_0x54d6e5[_0x49c4('0xe8')]+=0x1;ami[_0x49c4('0x47')](_0x49c4('0x1aa'),ut[_0x49c4('0xe9')](_0x198a69,_0x49c4('0x1ab')));_0x34c7ab[_0x49c4('0xd8')](_0x54d6e5)[_0x49c4('0xad')](loggerCatch(_0x49c4('0xfc')));if(_0x34c7ab[_0x49c4('0x196')](0x0,_0x198a69,_0x556d0a)){if(_0x54d6e5['countnosuchnumberretry']>=_0x556d0a[_0x49c4('0x19f')]){_0x34c7ab[_0x49c4('0xf1')](_0x54d6e5,_0x2343a8,_0x16c6f5,_0x49c4('0x1ac'));}else{_0x34c7ab[_0x49c4('0xef')](_0x54d6e5,_0x2343a8,_0x16c6f5,_0x49c4('0x1ac'));}}break;case'3':_0x556d0a[_0x49c4('0x1ad')]+=0x1;_0x54d6e5[_0x49c4('0xa7')]=0x3;_0x54d6e5[_0x49c4('0xa8')]=_0x49c4('0x1ae');_0x54d6e5[_0x49c4('0xeb')]+=0x1;_0x54d6e5[_0x49c4('0xe8')]+=0x1;ami[_0x49c4('0x47')](_0x49c4('0x1af'),ut[_0x49c4('0xe9')](_0x198a69,_0x49c4('0x1b0')));_0x34c7ab[_0x49c4('0xd8')](_0x54d6e5)['catch'](loggerCatch(_0x49c4('0x1b1')));if(_0x34c7ab[_0x49c4('0x196')](0x3,_0x198a69,_0x556d0a)){if(_0x54d6e5[_0x49c4('0xeb')]>=_0x556d0a[_0x49c4('0x198')]){_0x34c7ab[_0x49c4('0xf1')](_0x54d6e5,_0x2343a8,_0x16c6f5,_0x49c4('0x1b2'));}else{_0x34c7ab['stateGlobal'](_0x54d6e5,_0x2343a8,_0x16c6f5,'reason\x203\x20ringing\x20no\x20answer');}}break;case'5':_0x556d0a[_0x49c4('0x5e')]+=0x1;_0x54d6e5[_0x49c4('0xa7')]=0x5;_0x54d6e5[_0x49c4('0xa8')]=_0x49c4('0x1b3');_0x54d6e5[_0x49c4('0xfd')]+=0x1;_0x54d6e5[_0x49c4('0xe8')]+=0x1;ami[_0x49c4('0x47')](_0x49c4('0x1b4'),ut['buildObj'](_0x198a69,'busy'));_0x34c7ab[_0x49c4('0xd8')](_0x54d6e5)['catch'](loggerCatch(_0x49c4('0x1b5')));if(_0x34c7ab[_0x49c4('0x196')](0x5,_0x198a69,_0x556d0a)){if(_0x54d6e5[_0x49c4('0xfd')]>=_0x556d0a[_0x49c4('0x19a')]){_0x34c7ab['createStateFinal'](_0x54d6e5,_0x2343a8,_0x16c6f5,_0x49c4('0x1b6'));}else{_0x34c7ab[_0x49c4('0xef')](_0x54d6e5,_0x2343a8,_0x16c6f5,_0x49c4('0x1b6'));}}break;case'8':_0x556d0a['outboundCongestionCallsDay']+=0x1;_0x54d6e5[_0x49c4('0xa7')]=0x8;_0x54d6e5[_0x49c4('0xa8')]=_0x49c4('0x1b7');_0x54d6e5[_0x49c4('0xea')]+=0x1;_0x54d6e5[_0x49c4('0xe8')]+=0x1;ami[_0x49c4('0x47')]('custom:agentcongestion',ut[_0x49c4('0xe9')](_0x198a69,'congestion'));_0x34c7ab[_0x49c4('0xd8')](_0x54d6e5)[_0x49c4('0xad')](loggerCatch('[syncAgentComplete][createHistory][8]'));if(_0x34c7ab['checkRetriveMax'](0x8,_0x198a69,_0x556d0a)){if(_0x54d6e5[_0x49c4('0xea')]>=_0x556d0a['dialCongestionMaxRetry']){_0x34c7ab[_0x49c4('0xf1')](_0x54d6e5,_0x2343a8,_0x16c6f5,_0x49c4('0x1b8'));}else{_0x34c7ab[_0x49c4('0xef')](_0x54d6e5,_0x2343a8,_0x16c6f5,_0x49c4('0x1b8'));}}break;case'11':_0x556d0a[_0x49c4('0x1b9')]+=0x1;_0x54d6e5[_0x49c4('0xa7')]=0xb;_0x54d6e5[_0x49c4('0xa8')]=_0x49c4('0x123');_0x54d6e5[_0x49c4('0xed')]+=0x1;_0x54d6e5[_0x49c4('0xe8')]+=0x1;_0x34c7ab[_0x49c4('0xd8')](_0x54d6e5)['catch'](loggerCatch(_0x49c4('0x127')));if(_0x34c7ab[_0x49c4('0x196')](0xb,_0x198a69,_0x556d0a)){if(_0x54d6e5[_0x49c4('0xed')]>=_0x556d0a['dialAbandonedMaxRetry']){_0x34c7ab[_0x49c4('0xf1')](_0x54d6e5,_0x2343a8,_0x16c6f5,_0x49c4('0x1ba'));}else{_0x34c7ab[_0x49c4('0xef')](_0x54d6e5,_0x2343a8,_0x16c6f5,'reason\x2011\x20abandoned');}}break;case'20':_0x556d0a['outboundRejectCallsDay']+=0x1;_0x54d6e5['state']=0x14;_0x54d6e5[_0x49c4('0xa8')]=_0x49c4('0x1bb');_0x54d6e5[_0x49c4('0x197')]+=0x1;_0x54d6e5[_0x49c4('0xe8')]+=0x1;ami['emit'](_0x49c4('0x1bc'),ut[_0x49c4('0xe9')](_0x198a69,_0x49c4('0x1bd')));_0x34c7ab[_0x49c4('0xd8')](_0x54d6e5)[_0x49c4('0xad')](loggerCatch(_0x49c4('0x1be')));if(_0x34c7ab[_0x49c4('0x196')](0x14,_0x198a69,_0x556d0a)){if(_0x54d6e5['countagentrejectretry']>=_0x556d0a[_0x49c4('0x1a3')]){_0x34c7ab[_0x49c4('0xf1')](_0x54d6e5,_0x2343a8,_0x16c6f5,'reason\x2020\x20agentreject');}else{_0x34c7ab[_0x49c4('0xef')](_0x54d6e5,_0x2343a8,_0x16c6f5,'reason\x2020\x20agentreject');}}break;default:_0x556d0a[_0x49c4('0x109')]+=0x1;_0x54d6e5[_0x49c4('0xa7')]=0xc;_0x54d6e5[_0x49c4('0xa8')]=_0x491626[_0x49c4('0x10c')];_0x34c7ab['createHistory'](_0x54d6e5)['catch'](loggerCatch(_0x49c4('0x1bf')));if(_0x34c7ab['checkRetriveMax'](_0x491626['reason'],_0x198a69,_0x556d0a)){if(_0x54d6e5[_0x49c4('0xfd')]+_0x54d6e5[_0x49c4('0xea')]+_0x54d6e5[_0x49c4('0xeb')]+_0x54d6e5[_0x49c4('0xec')]+_0x54d6e5[_0x49c4('0xfe')]+_0x54d6e5['countabandonedretry']+_0x54d6e5['countmachineretry']+_0x54d6e5[_0x49c4('0x197')]>=_0x556d0a[_0x49c4('0xff')]){_0x34c7ab[_0x49c4('0xef')](_0x54d6e5,_0x2343a8,_0x16c6f5,_0x491626['reason']);}else{_0x34c7ab[_0x49c4('0xf1')](_0x54d6e5,_0x2343a8,_0x16c6f5,_0x491626[_0x49c4('0x10c')]);}}}});};Dialer['prototype'][_0x49c4('0xef')]=function(_0x10e94b,_0x49ab6a,_0x29c532,_0x39a125){var _0x2a059f=new Final(_0x10e94b);_0x2a059f['state']=0xf;_0x2a059f[_0x49c4('0xa8')]='Global';this[_0x49c4('0xf1')](_0x2a059f,_0x49ab6a,_0x29c532,_0x39a125);};Dialer[_0x49c4('0x1a')]['createStateFinal']=function(_0x26581d,_0xba82e4,_0x38a1d2,_0x3bf117){this['moveContactManagedDialer'](_0x26581d)[_0x49c4('0xb4')](function(){return _0xba82e4(msgResponse('[callProgressDetecting]',_0x49c4('0x1c0'),_0x3bf117));})[_0x49c4('0xad')](function(){return _0x38a1d2(msgResponse(_0x49c4('0x1c1'),'Failure','contact\x20not\x20moved'));});};Dialer[_0x49c4('0x1a')][_0x49c4('0x9')]=function(_0x4788b1){var _0x2fa4fb=_0x4788b1[_0x49c4('0x1c2')]/0x64;var _0x1043d2=_0x4788b1[_0x49c4('0x11a')]/(_0x4788b1['outboundDropCallsDayTimeout']+_0x4788b1['outboundAnswerCallsDay']);var _0x58274f=Math[_0x49c4('0x1c3')](_0x4788b1[_0x49c4('0x6f')]*(_0x4788b1[_0x49c4('0x1c4')]/0x64));var _0x23623d=Math[_0x49c4('0x1c3')](_0x4788b1[_0x49c4('0x6f')]*(_0x4788b1[_0x49c4('0x1c5')]/0x64));var _0x107bcb=_0x4788b1[_0x49c4('0x4c')]+_0x4788b1[_0x49c4('0x51')];var _0x44ee3f=Math[_0x49c4('0x1c6')](_0x4788b1[_0x49c4('0x71')]*_0x4788b1[_0x49c4('0x73')]*_0x4788b1[_0x49c4('0x6d')]*_0x4788b1[_0x49c4('0x6e')]);if(_[_0x49c4('0x39')](_0x4788b1['startProgressive'])){if(!_['isUndefined'](_0x4788b1[_0x49c4('0x28')])){_0x4788b1[_0x49c4('0x28')]=undefined;loggerPredictive['error'](_0x49c4('0x1c7'),_0x49c4('0x1c8'));}if(!_[_0x49c4('0x39')](_0x4788b1[_0x49c4('0x8f')])){loggerPredictive[_0x49c4('0x96')](_0x49c4('0x1c7'),_0x49c4('0x1c9'));clearInterval(_0x4788b1[_0x49c4('0x8f')]);_0x4788b1['handlePredictive']=undefined;}_0x4788b1[_0x49c4('0x29')]=moment()[_0x49c4('0x79')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x49c4('0x7b')](_0x4788b1['name'],_0x49c4('0x1ca'),_0x4788b1[_0x49c4('0x29')]);this[_0x49c4('0x158')](_0x4788b1,0x1);}else if(ifInterval(_0x4788b1[_0x49c4('0x1cb')],_0x4788b1[_0x49c4('0x29')])){this[_0x49c4('0x158')](_0x4788b1,0x1);loggerPredictiveCalls['info'](_0x49c4('0x1cc'),_0x4788b1[_0x49c4('0x29')],_0x4788b1['name']);_0x4788b1['erlangCalls']=0x0;_0x4788b1[_0x49c4('0x6c')]=0x0;}else if(_0x2fa4fb<_0x1043d2&&_0x4788b1[_0x49c4('0x1cd')]===_0x49c4('0x1ce')){freeVariablesPredictive(_0x4788b1);loggerPredictive[_0x49c4('0x7b')](_0x49c4('0x1cf'),_0x49c4('0x1d0'),_0x1043d2,'startProgressive',_0x4788b1[_0x49c4('0x3d')]);}else if(_0x44ee3f<_0x4788b1[_0x49c4('0x6c')]&&_0x4788b1['dialPredictiveOptimization']===_0x49c4('0x1ce')){freeVariablesPredictive(_0x4788b1);loggerPredictive['info'](_0x49c4('0x1d1'),_0x49c4('0x1d2'),_0x44ee3f,_0x49c4('0x1d3'),_0x4788b1['predictiveIntervalErlangCallsDroppedCalls'],_0x49c4('0x29'),_0x4788b1[_0x49c4('0x3d')]);}else if(!ifInterval(_0x4788b1[_0x49c4('0x1cb')],_0x4788b1[_0x49c4('0x29')])&&_[_0x49c4('0x39')](_0x4788b1[_0x49c4('0x28')])&&!_[_0x49c4('0x39')](_0x4788b1['startProgressive'])){_0x4788b1[_0x49c4('0x28')]=moment()['format'](_0x49c4('0xf5'));loggerPredictive[_0x49c4('0x7b')](_0x4788b1[_0x49c4('0x3d')],_0x49c4('0x1d4'),_0x4788b1[_0x49c4('0x28')]);this[_0x49c4('0xbb')](_0x4788b1['dialPredictiveInterval'])[_0x49c4('0xb4')](this['getDataPredictive'](_0x4788b1))[_0x49c4('0xb4')](mergeDataErlangB(_0x4788b1))[_0x49c4('0xb4')](this[_0x49c4('0x1d5')](_0x4788b1))['catch'](loggerCatchPredictive(_0x49c4('0x1d6'),_0x4788b1));}else if(!ifInterval(_0x4788b1['dialPredictiveInterval'],_0x4788b1[_0x49c4('0x28')])){_0x4788b1[_0x49c4('0x6c')]=0x0;_0x4788b1['startPredictive']=moment()[_0x49c4('0x79')](_0x49c4('0xf5'));loggerPredictive['info'](_0x4788b1[_0x49c4('0x3d')],_0x49c4('0x1d7'),_0x4788b1[_0x49c4('0x28')]);clearInterval(_0x4788b1[_0x49c4('0x8f')]);_0x4788b1[_0x49c4('0x8f')]=undefined;this[_0x49c4('0xbb')](_0x4788b1[_0x49c4('0x1cb')])['then'](this[_0x49c4('0x1d8')](_0x4788b1))[_0x49c4('0xb4')](mergeDataErlangB(_0x4788b1))['then'](this['startMethodPredictive'](_0x4788b1))['catch'](loggerCatchPredictive('Predictive\x20for\x20every\x20interval',_0x4788b1));}else if(_0x4788b1[_0x49c4('0x6f')]&&_0x107bcb<_0x4788b1[_0x49c4('0x6f')]-_0x23623d){freeVariablesPredictive(_0x4788b1);loggerPredictive[_0x49c4('0x7b')](_0x4788b1[_0x49c4('0x3d')],_0x49c4('0x1d9'),_0x107bcb,')\x20are\x20less\x20than\x20threshold\x20(',_0x4788b1[_0x49c4('0x6f')],'-',_0x23623d,'=',_0x4788b1['predictiveIntervalAvailable']-_0x23623d,')');}else if(_0x4788b1[_0x49c4('0x6f')]&&_0x107bcb>_0x4788b1[_0x49c4('0x6f')]+_0x58274f){freeVariablesPredictive(_0x4788b1);loggerPredictive[_0x49c4('0x7b')](_0x4788b1['name'],_0x49c4('0x1d9'),_0x107bcb,_0x49c4('0x1da'),_0x4788b1[_0x49c4('0x6f')],'+',_0x58274f,'=',_0x4788b1[_0x49c4('0x6f')]+_0x58274f,')');}};Dialer[_0x49c4('0x1a')][_0x49c4('0x1d8')]=function(_0x213fe8){var _0x2272b1=this;return function(_0x5a84dc){return new BPromise(function(_0x215003,_0x37e415){_['merge'](_0x213fe8,_0x5a84dc[0x0]);if(checkGetDataPredictive(_0x5a84dc[0x0])){var _0x1dc0dc=_0x213fe8['predictiveIntervalAvailable']=_0x213fe8['talking']+_0x213fe8[_0x49c4('0x4c')];var _0x1b669a=_0x213fe8['dialPredictiveInterval']*0x3c;var _0xaab952=_0x5a84dc[0x0][_0x49c4('0x68')]+_0x5a84dc[0x0][_0x49c4('0x67')];var _0x3e6dad=(_0x5a84dc[0x0][_0x49c4('0x66')]+_0x5a84dc[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x5a84dc[0x0][_0x49c4('0x69')])/_0x5a84dc[0x0][_0x49c4('0x7d')];_0x213fe8[_0x49c4('0x6d')]=_0x3e6dad>0x0?_0x3e6dad:0x1;switch(_0x213fe8['dialPredictiveOptimization']){case'dropRate':var _0x507d23=_0x213fe8[_0x49c4('0x1c2')]/0x64;return _0x2272b1['abandonmentRate'](_0x1dc0dc,_0x1b669a,_0xaab952,_0x3e6dad,_0x507d23)['then'](function(_0x5d96df){return _0x215003(_0x5d96df);});case _0x49c4('0x1db'):var _0x3f9b8d=_0x213fe8[_0x49c4('0x1c2')]/0x64;return _0x2272b1[_0x49c4('0x1dc')](_0x1dc0dc,_0x1b669a,_0xaab952,_0x3e6dad,_0x3f9b8d)[_0x49c4('0xb4')](function(_0x5623cc){return _0x215003(_0x5623cc);});default:return _0x37e415(msgResponse(_0x49c4('0x1dd'),_0x49c4('0x149'),_0x49c4('0x1de')));}}else{return _0x37e415(msgResponse(_0x49c4('0x1dd'),_0x49c4('0x149'),_0x49c4('0x1df')));}});};};Dialer[_0x49c4('0x1a')][_0x49c4('0x1e0')]=function(_0x5b6a88){var _0x343912=this;return function(_0x31ac1c){return new BPromise(function(_0x16a69b,_0x3dc262){_[_0x49c4('0x8b')](_0x5b6a88,_0x31ac1c[0x0]);if(checkGetDataPredictive(_0x31ac1c[0x0])){loggerPredictive['info'](JSON[_0x49c4('0x135')](_0x31ac1c[0x0]));if(_0x5b6a88[_0x49c4('0x1cd')]===_0x49c4('0x1ce')){return _0x343912['getVoiceQueueRtPauses'](_0x5b6a88['id'])[_0x49c4('0xb4')](function(_0x3da361){var _0x3e2b95=_0x5b6a88[_0x49c4('0x4d')]-_0x3da361[0x0][_0x49c4('0x1e1')];var _0x38a8d0=_0x5b6a88[_0x49c4('0x1cb')]*0x3c;var _0x28e828=_0x31ac1c[0x0][_0x49c4('0x68')]+_0x31ac1c[0x0][_0x49c4('0x67')];var _0x59305a=(_0x31ac1c[0x0][_0x49c4('0x66')]+_0x31ac1c[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x31ac1c[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x31ac1c[0x0][_0x49c4('0x7d')];var _0x1eb68f=_0x5b6a88[_0x49c4('0x1c2')]/0x64;_0x5b6a88[_0x49c4('0x1e2')]=_0x3da361[0x0][_0x49c4('0x1e1')]||0x0;_0x5b6a88['predictiveIntervalHitRate']=_0x59305a>0x0?_0x59305a:0x1;return _0x343912[_0x49c4('0x1e3')](_0x3e2b95,_0x38a8d0,_0x28e828,_0x59305a,_0x1eb68f);})['then'](function(_0x159452){return _0x16a69b(_0x159452);})['catch'](function(_0x451c1c){return _0x3dc262(msgResponse('[CatchErlangB]',_0x49c4('0x149'),JSON['stringify'](_0x451c1c)));});}if(_0x5b6a88[_0x49c4('0x1cd')]===_0x49c4('0x1db')){return _0x343912[_0x49c4('0xc5')](_0x5b6a88['id'])[_0x49c4('0xb4')](function(_0x3e9f3c){var _0x12ecf5=_0x5b6a88['loggedIn']-_0x3e9f3c[0x0][_0x49c4('0x1e1')];var _0x1c8cff=_0x5b6a88[_0x49c4('0x1cb')]*0x3c;var _0x5ae56c=_0x31ac1c[0x0][_0x49c4('0x68')]+_0x31ac1c[0x0][_0x49c4('0x67')];var _0x53a657=(_0x31ac1c[0x0][_0x49c4('0x66')]+_0x31ac1c[0x0][_0x49c4('0x6a')]+_0x31ac1c[0x0][_0x49c4('0x69')])/_0x31ac1c[0x0][_0x49c4('0x7d')];var _0x1efebc=_0x5b6a88[_0x49c4('0x1c2')]/0x64;_0x5b6a88[_0x49c4('0x1e2')]=_0x3e9f3c[0x0][_0x49c4('0x1e1')]||0x0;_0x5b6a88['predictiveIntervalHitRate']=_0x53a657>0x0?_0x53a657:0x1;return _0x343912['busyFactor'](_0x12ecf5,_0x1c8cff,_0x5ae56c,_0x53a657,_0x1efebc);})['then'](function(_0x1c3bdd){return _0x16a69b(_0x1c3bdd);})[_0x49c4('0xad')](function(_0x1f04ba){return _0x3dc262(msgResponse(_0x49c4('0x1e4'),_0x49c4('0x149'),JSON[_0x49c4('0x135')](_0x1f04ba)));});}}else{return _0x3dc262(msgResponse('[getDataPredictive]',_0x49c4('0x149'),'check\x20failure'));}});};};Dialer['prototype'][_0x49c4('0x1d5')]=function(_0x3d8ec3){var _0xf12c51=this;return function(){var _0x24407f=0x0;var _0x22712d=Math['floor'](_0x3d8ec3[_0x49c4('0x72')]*0x3e8);if(_0x22712d>0x0){_0x22712d=_0x22712d<0x64?0x64:_0x22712d;loggerPredictive['info'](_0x3d8ec3[_0x49c4('0x3d')],_0x49c4('0x1e5'),_0x22712d,_0x49c4('0x45'));_0x3d8ec3[_0x49c4('0x8f')]=setInterval(function(){_0xf12c51[_0x49c4('0x8f')](_0x3d8ec3);loggerPredictiveCalls[_0x49c4('0x7b')](_0x49c4('0x1e6'),_0x24407f+=0x1);},_0x22712d);}else{loggerPredictive[_0x49c4('0x7b')](_0x3d8ec3[_0x49c4('0x3d')],_0x49c4('0x1e7'));}};};Dialer[_0x49c4('0x1a')][_0x49c4('0x1e8')]=function(_0x5004b3,_0x4f7ec5){var _0x4734c2=this;return function(_0x5541b8){if(_['isEmpty'](_0x5541b8)){if(_[_0x49c4('0xab')](_0x4f7ec5[_0x49c4('0xcf')])||!_0x4f7ec5[_0x49c4('0x1e9')]){if(_0x5004b3[_0x49c4('0x58')]===_0x49c4('0x7')){_0x5004b3[_0x49c4('0x132')]=_[_0x49c4('0x39')](_0x5004b3[_0x49c4('0x132')])?!![]:_0x5004b3[_0x49c4('0x132')];var _0x5ef232=uuid['v4']();_0x4734c2['actions'][_0x5ef232]=new Action(_0x5004b3,_0x4f7ec5,_0x5ef232);loggerBooked[_0x49c4('0x7b')](_0x49c4('0x1ea'),_0x5ef232,_0x49c4('0x1eb'),JSON[_0x49c4('0x135')](_0x5004b3[_0x49c4('0x132')]),_0x49c4('0x1ec'),_0x5004b3[_0x49c4('0x3d')]);if(_0x5004b3[_0x49c4('0x132')]){_0x5004b3['queueStatusComplete']=![];_0x4734c2[_0x49c4('0x2b')][_0x4734c2[_0x49c4('0x24')][_0x5ef232][_0x49c4('0xaf')]]=[];ami['Action']({'actionid':_0x5ef232,'action':_0x49c4('0x1ed'),'queue':_0x5004b3['name']})[_0x49c4('0xad')](function(){_0x4734c2[_0x49c4('0xae')](_0x5004b3);_0x4734c2[_0x49c4('0xf3')]({'active':![],'ContactId':_0x4734c2[_0x49c4('0x24')][_0x5ef232][_0x49c4('0xf6')],'ListId':_0x4734c2[_0x49c4('0x24')][_0x5ef232][_0x49c4('0xce')],'VoiceQueueId':_0x4734c2[_0x49c4('0x24')][_0x5ef232][_0x49c4('0xd0')]||undefined,'CampaignId':_0x4734c2[_0x49c4('0x24')][_0x5ef232][_0x49c4('0xd1')]||undefined})[_0x49c4('0xad')](loggerCatch(_0x49c4('0x1ee')));delete _0x4734c2['actions'][_0x5ef232];});}else{loggerBooked[_0x49c4('0x7b')](_0x49c4('0x1ef'),JSON[_0x49c4('0x135')](_0x5004b3['queueStatusComplete']),'Queue:\x20',_0x5004b3[_0x49c4('0x3d')]);_0x4734c2[_0x49c4('0xae')](_0x5004b3);_0x4734c2[_0x49c4('0xf3')]({'active':![],'ContactId':_0x4734c2[_0x49c4('0x24')][_0x5ef232]['ContactId'],'ListId':_0x4734c2[_0x49c4('0x24')][_0x5ef232]['ListId'],'VoiceQueueId':_0x4734c2[_0x49c4('0x24')][_0x5ef232][_0x49c4('0xd0')]||undefined,'CampaignId':_0x4734c2[_0x49c4('0x24')][_0x5ef232][_0x49c4('0xd1')]||undefined})[_0x49c4('0xad')](loggerCatch(_0x49c4('0x1ee')));delete _0x4734c2[_0x49c4('0x24')][_0x5ef232];}}else{return _0x4734c2[_0x49c4('0x164')](_0x5004b3,_0x4f7ec5);}}else{if(getDiff(_0x4f7ec5[_0x49c4('0x1f0')])<_0x5004b3[_0x49c4('0x1f1')]*0x3c){if(_0x4f7ec5[_0x49c4('0x1f2')]&&!_0x4f7ec5[_0x49c4('0x1f2')][_0x49c4('0x1f3')]){_0x4734c2[_0x49c4('0x91')][_0x49c4('0x136')](_0x4f7ec5['id'])[_0x49c4('0x1d')](function(){_0x4734c2[_0x49c4('0xae')](_0x5004b3);});}else{_0x4734c2[_0x49c4('0xbf')]({'active':![]},_0x4f7ec5['id'],0x1)[_0x49c4('0x1d')](function(){_0x4734c2[_0x49c4('0xae')](_0x5004b3);});}}else{_0x5004b3['outboundReCallsDay']+=0x1;_0x4734c2[_0x49c4('0xae')](_0x5004b3);if(_0x5004b3[_0x49c4('0x1f4')]){_0x4734c2[_0x49c4('0xf3')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x4f7ec5[_0x49c4('0xf6')],'ListId':_0x4f7ec5[_0x49c4('0xce')],'VoiceQueueId':_0x4f7ec5[_0x49c4('0xd0')]||undefined,'CampaignId':_0x4f7ec5[_0x49c4('0xd1')]||undefined})[_0x49c4('0xad')](loggerCatch(_0x49c4('0x1f5')));_0x4734c2[_0x49c4('0xd8')](createObjHistory(_0x5004b3,_0x4f7ec5,_0x49c4('0x1f6'),0x17,'RecallInQueue'))[_0x49c4('0xad')](loggerCatch(_0x49c4('0x1f7')));}else{_0x4734c2['saveInDb'](createObjHistory(_0x5004b3,_0x4f7ec5,_0x49c4('0x1f8'),0x16,_0x49c4('0x1f9')),_0x49c4('0x1fa'),_0x49c4('0x1fb'));}}}}else{_0x5004b3[_0x49c4('0x5d')]+=0x1;_0x4734c2[_0x49c4('0xcd')](createObjHistory(_0x5004b3,_0x4f7ec5,'BLACKLIST',0xd,'Blacklist'),_0x49c4('0x1fc'),_0x49c4('0x1fd'));throw _0x49c4('0x1fe');}};};Dialer['prototype'][_0x49c4('0x15d')]=function(_0x208dc6){var _0x4e5137=this;var _0x496b39=_0x208dc6[_0x49c4('0x1ff')]-_0x208dc6[_0x49c4('0x70')]-_0x208dc6[_0x49c4('0xc1')];emitCampaignSummary(_0x208dc6);if(_0x496b39>0x0){if(_0x496b39>this['maxNumberOriginate']){_0x496b39=this[_0x49c4('0x22')];}_0x208dc6[_0x49c4('0xc1')]+=_0x496b39;this[_0x49c4('0xc3')](_0x208dc6['id'],_0x496b39,_0x208dc6['dialOrderByScheduledAt'],_0x208dc6)[_0x49c4('0xb4')](function(_0x3409c1){_0x208dc6[_0x49c4('0xc1')]-=_0x496b39;_0x208dc6[_0x49c4('0xc1')]=_0x208dc6[_0x49c4('0xc1')]>0x0?_0x208dc6[_0x49c4('0xc1')]:0x0;if(!checkContactEmpty(_0x3409c1)){_0x208dc6[_0x49c4('0x3a')]='AVAILABLE_CONTACTS_FINISHED';logger[_0x49c4('0x7b')]('[getContactCampaign2][Empty]'+_0x208dc6[_0x49c4('0x3d')]);}else{_0x208dc6[_0x49c4('0x70')]+=_0x3409c1[_0x49c4('0x99')];_0x208dc6[_0x49c4('0x3a')]='RUNNING';for(var _0x22afcd=0x0;_0x22afcd<_0x3409c1['length'];_0x22afcd+=0x1){_0x208dc6[_0x49c4('0x200')]+=0x1;if(_[_0x49c4('0xab')](_0x3409c1[_0x22afcd])||_[_0x49c4('0xab')](_0x3409c1[_0x22afcd][_0x49c4('0x167')])||_[_0x49c4('0xab')](_0x3409c1[_0x22afcd][_0x49c4('0x167')]['phone'])){_0x4e5137[_0x49c4('0xcb')](_0x49c4('0x201'),_0x208dc6,_0x3409c1[_0x22afcd]);}else{_0x4e5137[_0x49c4('0xb9')](_[_0x49c4('0x130')](_0x3409c1[_0x22afcd],[_0x49c4('0xd1'),'Contact.phone']))[_0x49c4('0xb4')](_0x4e5137[_0x49c4('0x1e8')](_0x208dc6,_0x3409c1[_0x22afcd]))[_0x49c4('0xad')](_0x4e5137[_0x49c4('0xca')](_0x49c4('0x202'),_0x208dc6));}}}})[_0x49c4('0xad')](loggerGetContactDialer(_0x49c4('0x203'),_0x208dc6,_0x496b39));}};Dialer[_0x49c4('0x1a')]['handlePower']=function(_0x300805,_0x43f1f0){var _0x22cfa6=this;var _0x440cf1=[];var _0x366a49=_0x43f1f0>=0x1?_0x43f1f0:0x1;if(_0x300805[_0x49c4('0x58')]===_0x49c4('0x7')){_0x366a49=0x1;}var _0x386c9e=Math[_0x49c4('0x1c6')](_0x300805[_0x49c4('0x4c')]*_0x366a49)-_0x300805[_0x49c4('0x70')]-_0x300805[_0x49c4('0xc1')];emitVoiceQueueSummary(_0x300805);if(_0x300805[_0x49c4('0x204')]>0x0){var _0x4db680=_0x300805[_0x49c4('0x204')]-_0x300805['originated']-_0x300805[_0x49c4('0x51')]-_0x300805[_0x49c4('0xc1')]-_0x300805[_0x49c4('0x4e')];if(_0x386c9e>_0x4db680){_0x386c9e=_0x4db680;}}if(_0x386c9e>0x0){if(_0x300805[_0x49c4('0x58')]===_0x49c4('0x7')){_0x386c9e=0x1;}if(_0x386c9e>this['maxNumberOriginate']){_0x386c9e=this[_0x49c4('0x22')];}_0x300805[_0x49c4('0xc1')]+=_0x386c9e;for(var _0x1c2d60 in this['agents']){if(typeof this[_0x49c4('0x20')][_0x1c2d60]!=='undefined'){if(this[_0x49c4('0x20')][_0x1c2d60][_0x49c4('0xa7')]==='not_inuse'&&this[_0x49c4('0x20')][_0x1c2d60][_0x49c4('0x12b')]===_0x49c4('0xd6')){_0x440cf1[_0x49c4('0x12f')](this[_0x49c4('0x20')][_0x1c2d60]['id']);}}}this[_0x49c4('0x205')](_0x300805['id'],_0x440cf1,_0x386c9e,_0x300805['dialOrderByScheduledAt'],_0x300805)[_0x49c4('0xb4')](function(_0x1dad6e){_0x300805['temp']-=_0x386c9e;_0x300805[_0x49c4('0xc1')]=_0x300805[_0x49c4('0xc1')]>0x0?_0x300805[_0x49c4('0xc1')]:0x0;if(!checkContactEmpty(_0x1dad6e)){_0x22cfa6[_0x49c4('0xb5')](_0x300805)[_0x49c4('0xb4')](sendMessageReschedule(_0x300805))[_0x49c4('0xad')](loggerCatch('[countReScheduled]\x20'));}else{_0x300805[_0x49c4('0x70')]+=_0x1dad6e[_0x49c4('0x99')];_0x300805[_0x49c4('0x3a')]=_0x300805[_0x49c4('0x58')]===_0x49c4('0x7')?'ACTIVE':'RUNNING';for(var _0x32b89a=0x0;_0x32b89a<_0x1dad6e['length'];_0x32b89a+=0x1){if(_[_0x49c4('0xab')](_0x1dad6e[_0x32b89a])||_[_0x49c4('0xab')](_0x1dad6e[_0x32b89a][_0x49c4('0x167')])||_[_0x49c4('0xab')](_0x1dad6e[_0x32b89a][_0x49c4('0x167')][_0x49c4('0x168')])){_0x22cfa6[_0x49c4('0xcb')]('[actionOriginate]\x20',_0x300805,_0x1dad6e[_0x32b89a]);}else{_0x22cfa6['checkIsBlackList'](_[_0x49c4('0x130')](_0x1dad6e[_0x32b89a],[_0x49c4('0xd0'),_0x49c4('0x206')]))[_0x49c4('0xb4')](_0x22cfa6['checkContactBlack'](_0x300805,_0x1dad6e[_0x32b89a]))[_0x49c4('0xad')](_0x22cfa6[_0x49c4('0xca')](_0x49c4('0x201'),_0x300805));}}}})[_0x49c4('0xad')](loggerGetContactDialer(_0x49c4('0x207'),_0x300805,_0x386c9e));}};Dialer[_0x49c4('0x1a')]['handlePredictive']=function(_0x33a829){if(_0x33a829[_0x49c4('0x204')]>0x0){var _0x73e425=_0x33a829[_0x49c4('0x204')]-_0x33a829[_0x49c4('0x70')]-_0x33a829[_0x49c4('0x51')];if(_0x73e425>0x0){this[_0x49c4('0x208')](_0x33a829);}else{loggerPredictiveCalls['info'](_0x49c4('0x209'));}}else{this[_0x49c4('0x208')](_0x33a829);}};Dialer[_0x49c4('0x1a')][_0x49c4('0x208')]=function(_0x1d513e){var _0x2d2315=this;var _0x5f26a2=[];_0x1d513e[_0x49c4('0x70')]+=0x1;for(var _0x37b6b6 in this[_0x49c4('0x20')]){if(typeof this[_0x49c4('0x20')][_0x37b6b6]!=='undefined'){if(this[_0x49c4('0x20')][_0x37b6b6][_0x49c4('0xa7')]===_0x49c4('0x20a')&&this[_0x49c4('0x20')][_0x37b6b6]['status']==='reachable'){_0x5f26a2[_0x49c4('0x12f')](this[_0x49c4('0x20')][_0x37b6b6]['id']);}}}this['getContactDialer'](_0x1d513e['id'],_0x5f26a2,0x1,_0x1d513e[_0x49c4('0x20b')],_0x1d513e)[_0x49c4('0xb4')](function(_0x185927){if(!checkContactEmpty(_0x185927)){checkContactLowerLimitOriginate(_0x1d513e,0x1,0x0);_0x2d2315[_0x49c4('0xb5')](_0x1d513e)[_0x49c4('0xb4')](sendMessageReschedule(_0x1d513e))[_0x49c4('0xad')](loggerCatch(_0x49c4('0xb6')));}else{_0x1d513e['message']=_0x49c4('0x20c');if(_[_0x49c4('0xab')](_0x185927[0x0])||_[_0x49c4('0xab')](_0x185927[0x0][_0x49c4('0x167')])||_[_0x49c4('0xab')](_0x185927[0x0][_0x49c4('0x167')]['phone'])){_0x2d2315[_0x49c4('0xcb')](_0x49c4('0x201'),_0x1d513e,_0x185927[0x0]);}else{_0x2d2315[_0x49c4('0xb7')](_['pick'](_0x185927[0x0],[_0x49c4('0xd0'),'Contact.phone']))[_0x49c4('0xb4')](_0x2d2315[_0x49c4('0x1e8')](_0x1d513e,_0x185927[0x0]))[_0x49c4('0xad')](_0x2d2315['loggerHandler'](_0x49c4('0x20d'),_0x1d513e));}}})['catch'](loggerGetContactDialer(_0x49c4('0x20e'),_0x1d513e,0x1));emitVoiceQueueSummary(_0x1d513e);};Dialer[_0x49c4('0x1a')]['abandonmentRate']=function(_0x1e9465,_0x3a4e83,_0x3b3b95,_0x3e5cd9,_0x482eea,_0x8cc12c){loggerPredictive[_0x49c4('0x7b')](_0x49c4('0x20f'));loggerPredictive['info'](_0x49c4('0x210'),_0x1e9465);loggerPredictive[_0x49c4('0x7b')](_0x49c4('0x211'),_0x3a4e83);loggerPredictive['info'](_0x49c4('0x212'),_0x3b3b95);loggerPredictive['info']('P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x3e5cd9);loggerPredictive[_0x49c4('0x7b')](_0x49c4('0x213'),_0x482eea);loggerPredictive[_0x49c4('0x7b')](_0x49c4('0x8a'));return new BPromise(function(_0xba7a3a,_0x5b7ac5){if(_0x1e9465<=0x0||isNaN(_0x1e9465)){return _0x5b7ac5(msgResponse(_0x49c4('0x214'),_0x49c4('0x44'),'m\x20=\x20'+_0x1e9465));}if(_0x3b3b95<=0x0||isNaN(_0x3b3b95)){return _0x5b7ac5(msgResponse(_0x49c4('0x214'),_0x49c4('0x44'),_0x49c4('0x215')+_0x3b3b95));}if(_0x3e5cd9<=0x0||isNaN(_0x3e5cd9)){return _0x5b7ac5(msgResponse('[abandonmentRate]',_0x49c4('0x44'),_0x49c4('0x216')+_0x3e5cd9));}if(_0x3a4e83<=0x0||isNaN(_0x3a4e83)){return _0x5b7ac5(msgResponse(_0x49c4('0x214'),_0x49c4('0x44'),_0x49c4('0x217')+_0x3a4e83));}if(_0x482eea<=0x0||isNaN(_0x482eea)){return _0x5b7ac5(msgResponse(_0x49c4('0x214'),_0x49c4('0x44'),_0x49c4('0x218')+_0x482eea));}_0x8cc12c=_0x8cc12c||0x0;var _0x55a301=0x1/_0x3b3b95;var _0x5576e4=0x0;var _0x594d02=0x0;var _0x31fd27=0x0;var _0x35111b=0x0;for(var _0x181b2d=0x0;_0x31fd27<_0x482eea;_0x181b2d+=0x1){_0x594d02=_0x181b2d/_0x3a4e83;_0x5576e4=(_0x3e5cd9*_0x594d02+_0x8cc12c)/_0x55a301;_0x31fd27=erlangb(_0x5576e4,_0x1e9465);_0x35111b=_0x5576e4/_0x1e9465*(0x1-erlangb(_0x5576e4,_0x1e9465));}return _0xba7a3a({'erlangCalls':_0x181b2d,'erlangCallToSecond':_0x3a4e83/_0x181b2d,'erlangAbandonmentRate':_0x31fd27,'erlangBusyFactor':_0x35111b});});};Dialer[_0x49c4('0x1a')][_0x49c4('0x1dc')]=function(_0x1b267b,_0x8f1a39,_0x35ed46,_0x48ea23,_0x32ae5d,_0x1cca54){loggerPredictive['info']('----\x20Agent\x20Busy\x20Factor\x20----');loggerPredictive[_0x49c4('0x7b')]('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',_0x1b267b);loggerPredictive[_0x49c4('0x7b')](_0x49c4('0x211'),_0x8f1a39);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',_0x35ed46);loggerPredictive[_0x49c4('0x7b')]('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',_0x48ea23);loggerPredictive[_0x49c4('0x7b')](_0x49c4('0x219'),_0x32ae5d);loggerPredictive[_0x49c4('0x7b')](_0x49c4('0x8a'));return new BPromise(function(_0x5c4fca,_0x486e44){if(_0x1b267b<=0x0||isNaN(_0x1b267b)){return _0x486e44(msgResponse(_0x49c4('0x21a'),_0x49c4('0x44'),_0x49c4('0x21b')+_0x1b267b));}if(_0x35ed46<=0x0||isNaN(_0x35ed46)){return _0x486e44(msgResponse(_0x49c4('0x21a'),'Error',_0x49c4('0x215')+_0x35ed46));}if(_0x48ea23<=0x0||isNaN(_0x48ea23)){return _0x486e44(msgResponse(_0x49c4('0x21a'),_0x49c4('0x44'),_0x49c4('0x216')+_0x48ea23));}if(_0x8f1a39<=0x0||isNaN(_0x8f1a39)){return _0x486e44(msgResponse(_0x49c4('0x21a'),_0x49c4('0x44'),_0x49c4('0x217')+_0x8f1a39));}if(_0x32ae5d<=0x0||isNaN(_0x32ae5d)){return _0x486e44(msgResponse(_0x49c4('0x21a'),'Error',_0x49c4('0x21c')+_0x32ae5d));}_0x1cca54=_0x1cca54||0x0;var _0x331875=0x1/_0x35ed46;var _0x45d437=0x0;var _0x4a08e7=0x0;var _0x1237f1=0x0;var _0x34a3c7=0x0;for(var _0x3eb36f=0x0;_0x34a3c7<_0x32ae5d;_0x3eb36f+=0x1){_0x4a08e7=_0x3eb36f/_0x8f1a39;_0x45d437=(_0x48ea23*_0x4a08e7+_0x1cca54)/_0x331875;_0x1237f1=erlangb(_0x45d437,_0x1b267b);_0x34a3c7=_0x45d437/_0x1b267b*(0x1-erlangb(_0x45d437,_0x1b267b));}return _0x5c4fca({'erlangCalls':_0x3eb36f,'erlangCallToSecond':_0x8f1a39/_0x3eb36f,'erlangAbandonmentRate':_0x1237f1,'erlangBusyFactor':_0x34a3c7});});};module[_0x49c4('0x21d')]=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/queueCallerAbandon.js b/server/services/ami/dialer/queueCallerAbandon.js index 538231a..a79fe74 100644 --- a/server/services/ami/dialer/queueCallerAbandon.js +++ b/server/services/ami/dialer/queueCallerAbandon.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe137=['name','calleridnum','number','starttime','responsetime','droptime','endtime','ringtime','queue','membername','connectedlinename','reason','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','moment','milliseconds','diff','scheduledat','type','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countmachineretry','countagentrejectretry','countdropretry','countabandonedretry','uniqueid','calleridname'];(function(_0x1419c9,_0x1a2bcf){var _0x45d558=function(_0x560a15){while(--_0x560a15){_0x1419c9['push'](_0x1419c9['shift']());}};_0x45d558(++_0x1a2bcf);}(_0xe137,0x176));var _0x7e13=function(_0x35d8af,_0x14fd75){_0x35d8af=_0x35d8af-0x0;var _0x1d08b0=_0xe137[_0x35d8af];return _0x1d08b0;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0x7e13('0x0'));function getSeconds(_0x3dcb6b,_0xf2fda0){var _0x46cf5d=moment(_0x3dcb6b)[_0x7e13('0x1')](0x0);var _0x5b9504=moment(_0xf2fda0)['milliseconds'](0x0);return _0x46cf5d[_0x7e13('0x2')](_0x5b9504,'seconds');}function QueueCallerAbandon(_0x3fd0e5,_0x54f6e7){this[_0x7e13('0x3')]=_0x3fd0e5['scheduledat'];this[_0x7e13('0x4')]=_0x3fd0e5[_0x7e13('0x4')];this['campaigntype']=_0x3fd0e5['type']==='outbound'?'queue':_0x3fd0e5[_0x7e13('0x4')];this['countbusyretry']=_0x3fd0e5[_0x7e13('0x5')];this[_0x7e13('0x6')]=_0x3fd0e5[_0x7e13('0x6')];this[_0x7e13('0x7')]=_0x3fd0e5[_0x7e13('0x7')];this[_0x7e13('0x8')]=_0x3fd0e5[_0x7e13('0x5')]+_0x3fd0e5['countcongestionretry']+_0x3fd0e5[_0x7e13('0x7')]+_0x3fd0e5[_0x7e13('0x9')]+_0x3fd0e5['countdropretry']+_0x3fd0e5['countabandonedretry']+_0x3fd0e5[_0x7e13('0xa')]+_0x3fd0e5[_0x7e13('0xb')];this[_0x7e13('0x9')]=_0x3fd0e5[_0x7e13('0x9')];this[_0x7e13('0xc')]=_0x3fd0e5['countdropretry'];this[_0x7e13('0xd')]=_0x3fd0e5[_0x7e13('0xd')];this['countmachineretry']=_0x3fd0e5['countmachineretry'];this[_0x7e13('0xb')]=_0x3fd0e5[_0x7e13('0xb')];this[_0x7e13('0xe')]=_0x54f6e7[_0x7e13('0xe')];this[_0x7e13('0xf')]=_0x3fd0e5[_0x7e13('0x10')];this[_0x7e13('0x11')]=_0x3fd0e5[_0x7e13('0x12')];this[_0x7e13('0x13')]=_0x3fd0e5[_0x7e13('0x13')];this[_0x7e13('0x14')]=_0x3fd0e5[_0x7e13('0x14')];this[_0x7e13('0x15')]=_0x3fd0e5[_0x7e13('0x15')];this[_0x7e13('0x16')]=this['droptime'];this[_0x7e13('0x17')]=getSeconds(_0x3fd0e5[_0x7e13('0x14')],_0x3fd0e5['starttime']);this['holdtime']=getSeconds(this[_0x7e13('0x15')],_0x3fd0e5[_0x7e13('0x14')]);this['talktime']=0x0;this[_0x7e13('0x18')]=_0x54f6e7[_0x7e13('0x18')];this[_0x7e13('0x19')]=_0x54f6e7[_0x7e13('0x1a')];this[_0x7e13('0x1b')]=_0x54f6e7[_0x7e13('0x1b')];this['callback']=_0x3fd0e5['callback'];this[_0x7e13('0x1c')]=_0x3fd0e5['callbackuniqueid'];this[_0x7e13('0x1d')]=_0x3fd0e5[_0x7e13('0x1d')];this[_0x7e13('0x1e')]=_0x3fd0e5[_0x7e13('0x1e')];this[_0x7e13('0x1f')]=_0x3fd0e5['ContactId'];this[_0x7e13('0x20')]=_0x3fd0e5['ListId'];this[_0x7e13('0x21')]=_0x3fd0e5[_0x7e13('0x21')];this[_0x7e13('0x22')]=_0x3fd0e5['VoiceQueueId'];this[_0x7e13('0x23')]=_0x3fd0e5[_0x7e13('0x23')];this['originatecalleridnum']=_0x3fd0e5[_0x7e13('0x24')]||'';this[_0x7e13('0x25')]=_0x3fd0e5[_0x7e13('0x25')]||'';}module[_0x7e13('0x26')]=QueueCallerAbandon; \ No newline at end of file +var _0xd3f7=['countagentrejectretry','countnosuchnumberretry','uniqueid','calleridname','calleridnum','number','starttime','droptime','responsetime','holdtime','talktime','queue','membername','connectedlinename','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','scheduledat','type','campaigntype','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countabandonedretry','countmachineretry'];(function(_0x42aff1,_0x279acb){var _0x102349=function(_0x36eeb){while(--_0x36eeb){_0x42aff1['push'](_0x42aff1['shift']());}};_0x102349(++_0x279acb);}(_0xd3f7,0xe2));var _0x7d3f=function(_0x19159d,_0x3d05c8){_0x19159d=_0x19159d-0x0;var _0x35884a=_0xd3f7[_0x19159d];return _0x35884a;};'use strict';var util=require(_0x7d3f('0x0'));var _=require(_0x7d3f('0x1'));var moment=require(_0x7d3f('0x2'));function getSeconds(_0x30aa87,_0x5d0a26){var _0x5b85ed=moment(_0x30aa87)[_0x7d3f('0x3')](0x0);var _0x43b16f=moment(_0x5d0a26)[_0x7d3f('0x3')](0x0);return _0x5b85ed['diff'](_0x43b16f,'seconds');}function QueueCallerAbandon(_0x45e248,_0x34502c){this[_0x7d3f('0x4')]=_0x45e248[_0x7d3f('0x4')];this[_0x7d3f('0x5')]=_0x45e248[_0x7d3f('0x5')];this[_0x7d3f('0x6')]=_0x45e248['type']==='outbound'?'queue':_0x45e248[_0x7d3f('0x5')];this[_0x7d3f('0x7')]=_0x45e248[_0x7d3f('0x7')];this[_0x7d3f('0x8')]=_0x45e248['countcongestionretry'];this[_0x7d3f('0x9')]=_0x45e248[_0x7d3f('0x9')];this[_0x7d3f('0xa')]=_0x45e248[_0x7d3f('0x7')]+_0x45e248[_0x7d3f('0x8')]+_0x45e248['countnoanswerretry']+_0x45e248['countnosuchnumberretry']+_0x45e248[_0x7d3f('0xb')]+_0x45e248[_0x7d3f('0xc')]+_0x45e248[_0x7d3f('0xd')]+_0x45e248[_0x7d3f('0xe')];this[_0x7d3f('0xf')]=_0x45e248[_0x7d3f('0xf')];this[_0x7d3f('0xb')]=_0x45e248[_0x7d3f('0xb')];this[_0x7d3f('0xc')]=_0x45e248[_0x7d3f('0xc')];this[_0x7d3f('0xd')]=_0x45e248[_0x7d3f('0xd')];this[_0x7d3f('0xe')]=_0x45e248[_0x7d3f('0xe')];this['uniqueid']=_0x34502c[_0x7d3f('0x10')];this[_0x7d3f('0x11')]=_0x45e248['name'];this[_0x7d3f('0x12')]=_0x45e248[_0x7d3f('0x13')];this[_0x7d3f('0x14')]=_0x45e248[_0x7d3f('0x14')];this['responsetime']=_0x45e248['responsetime'];this['droptime']=_0x45e248[_0x7d3f('0x15')];this['endtime']=this[_0x7d3f('0x15')];this['ringtime']=getSeconds(_0x45e248[_0x7d3f('0x16')],_0x45e248[_0x7d3f('0x14')]);this[_0x7d3f('0x17')]=getSeconds(this['droptime'],_0x45e248['responsetime']);this[_0x7d3f('0x18')]=0x0;this[_0x7d3f('0x19')]=_0x34502c[_0x7d3f('0x19')];this[_0x7d3f('0x1a')]=_0x34502c[_0x7d3f('0x1b')];this['reason']=_0x34502c['reason'];this[_0x7d3f('0x1c')]=_0x45e248[_0x7d3f('0x1c')];this[_0x7d3f('0x1d')]=_0x45e248[_0x7d3f('0x1d')];this[_0x7d3f('0x1e')]=_0x45e248[_0x7d3f('0x1e')];this['recallme']=_0x45e248[_0x7d3f('0x1f')];this[_0x7d3f('0x20')]=_0x45e248['ContactId'];this[_0x7d3f('0x21')]=_0x45e248['ListId'];this['UserId']=_0x45e248[_0x7d3f('0x22')];this[_0x7d3f('0x23')]=_0x45e248[_0x7d3f('0x23')];this[_0x7d3f('0x24')]=_0x45e248[_0x7d3f('0x24')];this['originatecalleridnum']=_0x45e248[_0x7d3f('0x25')]||'';this[_0x7d3f('0x26')]=_0x45e248['originatecalleridname']||'';}module[_0x7d3f('0x27')]=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index 1d01f08..7b8d658 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(_0x520ddf,_0x17b1d3){var _0x1e3103=function(_0x2dd284){while(--_0x2dd284){_0x520ddf['push'](_0x520ddf['shift']());}};_0x1e3103(++_0x17b1d3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xa9e0[_0x24237f];return _0x48298e;};'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(_0x459124,_0x35058b){var _0x8f00c9=function(_0x489569){while(--_0x489569){_0x459124['push'](_0x459124['shift']());}};_0x8f00c9(++_0x35058b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xa9e0[_0x3947c9];return _0x2e7871;};'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 b295fe2..910b7ce 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 _0xff54=['response','reason','update','AttachmentId','SENDING\x20FAILED\x20','then','logger','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','faxpages','SUCCESS','faxstatusstring','SENDING\x20FAILED:\x20','send','execOriginate','FaxAccountId','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','checkTrunk','isValid','Trunk\x20Reachable','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','%s/%s.tif','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','isTrunkReachable','isNil','active','SIP/%s','reachable','[Fax][checkTrunk][Trunk\x20not\x20work]','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','exports','util','lodash','moment','path','tiff2pdf','./util/gs','../../../config/logger','fax','../ami','./rpcDb','./channel','./action','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','actions','newchannel','syncNewchannel','bind','varset','newstate','syncNewState','newexten','syncNewExten','faxstatus','syncFaxStatus','syncReceiveFax','syncHangup','originateresponse','syncOriginateResponse','prototype','context','from-voip-provider','hasOwnProperty','exten','localstationid','uniqueid','channel','name','info','\x20syncNewchannel\x20','syncVarSet','variable','value','channelstate','channelstatedesc','operation','status','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','parse','.pdf','notify','catch','\x20notify\x20','stringify','\x20receiveFax\x20','pick'];(function(_0x2f2226,_0x1e83af){var _0x48ea75=function(_0x4b0d54){while(--_0x4b0d54){_0x2f2226['push'](_0x2f2226['shift']());}};_0x48ea75(++_0x1e83af);}(_0xff54,0x188));var _0x4ff5=function(_0x114b6d,_0x18865f){_0x114b6d=_0x114b6d-0x0;var _0x3fc999=_0xff54[_0x114b6d];return _0x3fc999;};'use strict';var util=require(_0x4ff5('0x0'));var _=require(_0x4ff5('0x1'));var BPromise=require('bluebird');var uuid=require('uuid');var moment=require(_0x4ff5('0x2'));var path=require(_0x4ff5('0x3'));var tiff2pdf=require(_0x4ff5('0x4'));var gs=require(_0x4ff5('0x5'));var logger=require(_0x4ff5('0x6'))(_0x4ff5('0x7'));var ami=require(_0x4ff5('0x8'));var rpcDb=require(_0x4ff5('0x9'));var Channel=require(_0x4ff5('0xa'));var ut=require('./util/util');var Action=require(_0x4ff5('0xb'));var faxAccount=require('../rpc/faxAccount');var attachment=require(_0x4ff5('0xc'));var faxMessage=require(_0x4ff5('0xd'));function Fax(_0x21664a){this[_0x4ff5('0xe')]={};this[_0x4ff5('0xf')]=_0x21664a[_0x4ff5('0xf')];this[_0x4ff5('0x10')]=_0x21664a[_0x4ff5('0x10')];this[_0x4ff5('0x11')]={};ami['on'](_0x4ff5('0x12'),this[_0x4ff5('0x13')][_0x4ff5('0x14')](this));ami['on'](_0x4ff5('0x15'),this['syncVarSet'][_0x4ff5('0x14')](this));ami['on'](_0x4ff5('0x16'),this[_0x4ff5('0x17')][_0x4ff5('0x14')](this));ami['on'](_0x4ff5('0x18'),this[_0x4ff5('0x19')][_0x4ff5('0x14')](this));ami['on'](_0x4ff5('0x1a'),this[_0x4ff5('0x1b')][_0x4ff5('0x14')](this));ami['on']('receivefax',this[_0x4ff5('0x1c')]['bind'](this));ami['on']('hangup',this[_0x4ff5('0x1d')][_0x4ff5('0x14')](this));ami['on'](_0x4ff5('0x1e'),this[_0x4ff5('0x1f')]['bind'](this));}Fax[_0x4ff5('0x20')][_0x4ff5('0x13')]=function(_0x17b5e4){if(_0x17b5e4[_0x4ff5('0x21')]===_0x4ff5('0x22')){for(var _0x1e60b8 in this[_0x4ff5('0xf')]){if(this[_0x4ff5('0xf')][_0x4ff5('0x23')](_0x1e60b8)){if(_0x17b5e4[_0x4ff5('0x24')]===this[_0x4ff5('0xf')][_0x1e60b8][_0x4ff5('0x25')]){this[_0x4ff5('0xe')][_0x17b5e4[_0x4ff5('0x26')]]={};this['channels'][_0x17b5e4[_0x4ff5('0x26')]][_0x4ff5('0x27')]=_0x17b5e4[_0x4ff5('0x27')];this['channels'][_0x17b5e4[_0x4ff5('0x26')]]['id']=this['faxAccounts'][_0x1e60b8]['id'];this[_0x4ff5('0xe')][_0x17b5e4['uniqueid']][_0x4ff5('0x28')]=this[_0x4ff5('0xf')][_0x1e60b8][_0x4ff5('0x28')];logger[_0x4ff5('0x29')](_0x17b5e4[_0x4ff5('0x26')],_0x4ff5('0x2a'));}}}}if(this[_0x4ff5('0x11')][_0x17b5e4[_0x4ff5('0x26')]]){this['channels'][_0x17b5e4['uniqueid']]={};this[_0x4ff5('0xe')][_0x17b5e4['uniqueid']]['channel']=_0x17b5e4['channel'];logger[_0x4ff5('0x29')](_0x17b5e4[_0x4ff5('0x26')],_0x4ff5('0x2a'));}};Fax[_0x4ff5('0x20')][_0x4ff5('0x2b')]=function(_0x48e300){if(this[_0x4ff5('0xe')][_0x48e300[_0x4ff5('0x26')]]){for(var _0x527f90 in _0x48e300[_0x4ff5('0x2c')]){if(_0x48e300[_0x4ff5('0x2c')]['hasOwnProperty'](_0x527f90)){this[_0x4ff5('0xe')][_0x48e300[_0x4ff5('0x26')]][_0x527f90]=_0x48e300[_0x4ff5('0x2d')];}}}};Fax[_0x4ff5('0x20')][_0x4ff5('0x17')]=function(_0x134b5c){if(this['channels'][_0x134b5c[_0x4ff5('0x26')]]){this['channels'][_0x134b5c[_0x4ff5('0x26')]]['channelstate']=_0x134b5c[_0x4ff5('0x2e')];this[_0x4ff5('0xe')][_0x134b5c[_0x4ff5('0x26')]][_0x4ff5('0x2f')]=_0x134b5c[_0x4ff5('0x2f')];}};Fax['prototype'][_0x4ff5('0x19')]=function(_0x1d22cb){if(this[_0x4ff5('0xe')][_0x1d22cb[_0x4ff5('0x26')]]){for(var _0x5dd9d2 in _0x1d22cb['variable']){if(_0x1d22cb['variable'][_0x4ff5('0x23')](_0x5dd9d2)){this['channels'][_0x1d22cb['uniqueid']][_0x5dd9d2]=_0x1d22cb[_0x4ff5('0x2d')];}}}};Fax[_0x4ff5('0x20')][_0x4ff5('0x1b')]=function(_0x4ed7ad){if(this['channels'][_0x4ed7ad[_0x4ff5('0x26')]]){this[_0x4ff5('0xe')][_0x4ed7ad[_0x4ff5('0x26')]][_0x4ff5('0x30')]=_0x4ed7ad[_0x4ff5('0x30')];this[_0x4ff5('0xe')][_0x4ed7ad['uniqueid']]['status']=_0x4ed7ad[_0x4ff5('0x31')];this[_0x4ff5('0xe')][_0x4ed7ad['uniqueid']][_0x4ff5('0x25')]=_0x4ed7ad[_0x4ff5('0x25')];this[_0x4ff5('0xe')][_0x4ed7ad[_0x4ff5('0x26')]][_0x4ff5('0x32')]=_0x4ed7ad[_0x4ff5('0x32')];logger['info'](_0x4ed7ad[_0x4ff5('0x26')],_0x4ff5('0x33'));}};Fax['prototype'][_0x4ff5('0x1c')]=function(_0x322fce){var _0x282908=this;if(this['channels'][_0x322fce[_0x4ff5('0x26')]]){var _0x437221=this[_0x4ff5('0xe')][_0x322fce['uniqueid']]['id'];this[_0x4ff5('0xe')][_0x322fce[_0x4ff5('0x26')]][_0x4ff5('0x34')]=_0x322fce['remotestationid'];this['channels'][_0x322fce['uniqueid']][_0x4ff5('0x35')]=_0x322fce['pagestransferred'];this['channels'][_0x322fce[_0x4ff5('0x26')]]['localstationid']=_0x322fce[_0x4ff5('0x25')];this['channels'][_0x322fce[_0x4ff5('0x26')]]['resolution']=_0x322fce[_0x4ff5('0x36')];this[_0x4ff5('0xe')][_0x322fce[_0x4ff5('0x26')]][_0x4ff5('0x37')]=_0x322fce['transferrate'];this['channels'][_0x322fce[_0x4ff5('0x26')]]['filename']=_0x322fce[_0x4ff5('0x32')];this[_0x4ff5('0xe')][_0x322fce[_0x4ff5('0x26')]][_0x4ff5('0x38')]=_0x322fce[_0x4ff5('0x38')];if(this[_0x4ff5('0xe')][_0x322fce[_0x4ff5('0x26')]]['pagestransferred']>0x0){tiff2pdf(_0x322fce['filename'],_0x4ff5('0x39'),function(_0x2c6dff){logger['info'](_0x322fce[_0x4ff5('0x26')],_0x4ff5('0x3a'),_0x2c6dff[_0x4ff5('0x3b')]);attachment['create']({'name':path[_0x4ff5('0x3c')](_0x322fce['filename'])[_0x4ff5('0x28')],'basename':path[_0x4ff5('0x3c')](_0x322fce[_0x4ff5('0x32')])['name']+_0x4ff5('0x3d'),'type':'application/pdf'})['then'](function(_0xde2ea1){faxAccount[_0x4ff5('0x3e')](_0x437221,{'from':_0x322fce[_0x4ff5('0x38')],'mapKey':_0x4ff5('0x7'),'body':path['parse'](_0x322fce['filename'])[_0x4ff5('0x28')]+'.pdf','AttachmentId':_0xde2ea1['id']})[_0x4ff5('0x3f')](function(_0x55c04d){logger['error'](_0x322fce[_0x4ff5('0x26')],_0x4ff5('0x40'),JSON[_0x4ff5('0x41')](_0x55c04d));});})['catch'](function(_0x42c287){logger['error'](_0x322fce['uniqueid'],_0x4ff5('0x42'),JSON[_0x4ff5('0x41')](_0x42c287));});});}logger[_0x4ff5('0x29')](_0x322fce['uniqueid'],_0x4ff5('0x42'));}};Fax['prototype'][_0x4ff5('0x1f')]=function(_0x2f6fa7){if(this[_0x4ff5('0x11')][_0x2f6fa7[_0x4ff5('0x26')]]){_['merge'](this['channels'][_0x2f6fa7[_0x4ff5('0x26')]],_[_0x4ff5('0x43')](_0x2f6fa7,[_0x4ff5('0x44'),_0x4ff5('0x45')]));}};function updateStatus(_0x3b0556){if(_0x3b0556['AttachmentId']){faxMessage[_0x4ff5('0x46')](_0x3b0556[_0x4ff5('0x47')],{'failMessage':_0x4ff5('0x48')})[_0x4ff5('0x49')](function(_0x1d9bf4){ut[_0x4ff5('0x4a')]('[Fax][Message][Error][Updated]',_0x1d9bf4);})[_0x4ff5('0x3f')](function(_0x641862){ut[_0x4ff5('0x4a')](_0x4ff5('0x4b'),_0x641862);});}else{ut['logger'](_0x4ff5('0x4c'));}}Fax[_0x4ff5('0x20')][_0x4ff5('0x4d')]=function(_0x4371ee,_0x55c6f6,_0x15ed93){var _0x3df608=this;var _0x481869={};if(_0x55c6f6){_0x481869={'read':_0x55c6f6};}else{_0x481869={'failMessage':_0x15ed93};}if(this[_0x4ff5('0x11')][_0x4371ee][_0x4ff5('0x47')]){faxMessage['update'](this[_0x4ff5('0x11')][_0x4371ee]['AttachmentId'],_0x481869)['then'](function(_0x17a6b6){ut[_0x4ff5('0x4a')]('[Fax][Message][Updated]',_0x17a6b6);})[_0x4ff5('0x3f')](function(_0x9de47e){ut[_0x4ff5('0x4a')](_0x4ff5('0x4e'),_0x9de47e);})[_0x4ff5('0x4f')](function(){delete _0x3df608[_0x4ff5('0xe')][_0x4371ee];delete _0x3df608['actions'][_0x4371ee];});}else{ut[_0x4ff5('0x4a')](_0x4ff5('0x50'));delete this[_0x4ff5('0xe')][_0x4371ee];delete this[_0x4ff5('0x11')][_0x4371ee];}};Fax['prototype']['syncHangup']=function(_0x292738){var _0x1fb9d8=this;if(this[_0x4ff5('0xe')][_0x292738['uniqueid']]){if(this[_0x4ff5('0x11')][_0x292738['uniqueid']]){this['channels'][_0x292738[_0x4ff5('0x26')]]['id']=this[_0x4ff5('0x11')][_0x292738[_0x4ff5('0x26')]]['id'];this[_0x4ff5('0xe')][_0x292738['uniqueid']][_0x4ff5('0x28')]=this[_0x4ff5('0x11')][_0x292738[_0x4ff5('0x26')]][_0x4ff5('0x28')];}logger[_0x4ff5('0x29')](_0x292738[_0x4ff5('0x26')],this[_0x4ff5('0x11')][_0x292738['uniqueid']]?'\x20hangup\x20sendFile\x20':'\x20hangup\x20faxRiceive\x20',JSON[_0x4ff5('0x41')](this['channels'][_0x292738[_0x4ff5('0x26')]]));if(this['actions'][_0x292738['uniqueid']]){if(this[_0x4ff5('0xe')][_0x292738[_0x4ff5('0x26')]][_0x4ff5('0x51')]>0x0&&this['channels'][_0x292738[_0x4ff5('0x26')]]['faxstatus']===_0x4ff5('0x52')){this['updateStatus'](_0x292738['uniqueid'],!![]);}else{this[_0x4ff5('0x4d')](_0x292738[_0x4ff5('0x26')],![],this[_0x4ff5('0xe')][_0x292738[_0x4ff5('0x26')]][_0x4ff5('0x53')]?_0x4ff5('0x54')+this[_0x4ff5('0xe')][_0x292738[_0x4ff5('0x26')]][_0x4ff5('0x53')]:'SENDING\x20FAILED');}}}};Fax[_0x4ff5('0x20')][_0x4ff5('0x55')]=function(_0x58e394){var _0x28c5cf=this;return new BPromise(function(_0x400791,_0x18a8bf){_0x28c5cf[_0x4ff5('0x56')](_0x58e394,_0x28c5cf['faxAccounts'][_0x58e394[_0x4ff5('0x57')]])['then'](function(_0x4f9a86){ut[_0x4ff5('0x4a')]('[Fax][execOriginate][success]',_0x4f9a86);_0x400791(ut[_0x4ff5('0x3b')](_0x4ff5('0x58')));})[_0x4ff5('0x3f')](function(_0x514732){ut['logger'](_0x4ff5('0x59'),_0x514732);updateStatus(_0x58e394);_0x18a8bf(ut['message'](_0x4ff5('0x5a')));});});};Fax[_0x4ff5('0x20')][_0x4ff5('0x5b')]=function(_0x135036){var _0x499247=this;return new BPromise(function(_0x12fb12,_0xf8716c){var _0x41eb23=_0x499247[_0x4ff5('0x5c')](_0x499247['faxAccounts'][_0x135036[_0x4ff5('0x57')]]['Trunk'],_0x135036);if(_0x41eb23[_0x4ff5('0x5d')]){_0x12fb12(ut[_0x4ff5('0x3b')](_0x4ff5('0x5e')));}else{_0xf8716c(ut[_0x4ff5('0x3b')](_0x41eb23[_0x4ff5('0x3b')]));}});};function originate(_0x1762dc,_0x5c9195,_0x1ad50e){return new BPromise(function(_0x249ab8,_0x30649e){if(_0x1ad50e){var _0x27e0be=util[_0x4ff5('0x5f')](_0x4ff5('0x60'),path[_0x4ff5('0x3c')](_0x1762dc[_0x4ff5('0x3')])[_0x4ff5('0x28')],_0x1762dc[_0x4ff5('0x3')]);gs['execute'](_0x27e0be)[_0x4ff5('0x49')](function(){_0x1762dc['path']=util[_0x4ff5('0x5f')](_0x4ff5('0x61'),path[_0x4ff5('0x3c')](_0x1762dc[_0x4ff5('0x3')])[_0x4ff5('0x62')],path['parse'](_0x1762dc['path'])[_0x4ff5('0x28')]);_0x5c9195[_0x4ff5('0x63')]=_0x1762dc[_0x4ff5('0x3')];ut['logger'](_0x4ff5('0x64'),'');ami[_0x4ff5('0x65')](ut[_0x4ff5('0x66')](_0x1762dc,_0x5c9195))[_0x4ff5('0x49')](function(_0x5ed231){_0x249ab8(_0x5ed231);})[_0x4ff5('0x3f')](function(_0x1d2c49){_0x30649e(_0x1d2c49);});})[_0x4ff5('0x3f')](function(_0x2292a2){_0x30649e(_0x2292a2);});}else{ami[_0x4ff5('0x65')](ut[_0x4ff5('0x66')](_0x1762dc,_0x5c9195))[_0x4ff5('0x49')](function(_0x578a1d){_0x249ab8(_0x578a1d);})[_0x4ff5('0x3f')](function(_0x3bac26){_0x30649e(_0x3bac26);});}});}Fax[_0x4ff5('0x20')][_0x4ff5('0x56')]=function(_0x1acb8b,_0x512761){var _0x4538c3=this;return new BPromise(function(_0x3b3717,_0x233089){var _0x295205=uuid['v4']();var _0x546415=ut['addVariables'](_0x1acb8b,_0x512761);_0x4538c3[_0x4ff5('0x11')][_0x295205]=new Action(_0x295205,_0x512761,_0x1acb8b);var _0x1e5af6=_0x4538c3[_0x4ff5('0x11')][_0x295205];if(path[_0x4ff5('0x3c')](_0x1acb8b['path'])['ext']===_0x4ff5('0x3d')){originate(_0x1e5af6,_0x546415,!![])['then'](function(_0x94f53d){_0x3b3717(_0x94f53d);})[_0x4ff5('0x3f')](function(_0x8227ee){_0x233089(_0x8227ee);});}else{originate(_0x1e5af6,_0x546415,![])[_0x4ff5('0x49')](function(_0x1f88f8){_0x3b3717(_0x1f88f8);})[_0x4ff5('0x3f')](function(_0x499746){_0x233089(_0x499746);});}});};Fax[_0x4ff5('0x20')][_0x4ff5('0x67')]=function(_0x5797ea){return!_['isNil'](_0x5797ea)&&!_[_0x4ff5('0x68')](_0x5797ea[_0x4ff5('0x28')])&&!_['isNil'](_0x5797ea[_0x4ff5('0x69')])&&_0x5797ea[_0x4ff5('0x69')]&&!_[_0x4ff5('0x68')](this[_0x4ff5('0x10')][util[_0x4ff5('0x5f')](_0x4ff5('0x6a'),_0x5797ea[_0x4ff5('0x28')])])&&!_[_0x4ff5('0x68')](this[_0x4ff5('0x10')][util[_0x4ff5('0x5f')](_0x4ff5('0x6a'),_0x5797ea[_0x4ff5('0x28')])][_0x4ff5('0x31')])&&(this[_0x4ff5('0x10')][util[_0x4ff5('0x5f')](_0x4ff5('0x6a'),_0x5797ea['name'])][_0x4ff5('0x31')]===_0x4ff5('0x6b')||this[_0x4ff5('0x10')][util[_0x4ff5('0x5f')](_0x4ff5('0x6a'),_0x5797ea[_0x4ff5('0x28')])][_0x4ff5('0x31')]==='unmonitored');};Fax[_0x4ff5('0x20')]['checkTrunk']=function(_0x3e94c3,_0x27c989){if(!this[_0x4ff5('0x67')](_0x3e94c3)){ut[_0x4ff5('0x4a')](_0x4ff5('0x6c'),_[_0x4ff5('0x68')](_0x3e94c3)?'':_0x3e94c3[_0x4ff5('0x28')]+'\x20Trunk\x20is\x20not\x20active');return{'isValid':![],'message':_0x4ff5('0x6d')};}if(_['isNil'](_0x27c989['fax'])){ut[_0x4ff5('0x4a')](_0x4ff5('0x6e'),JSON[_0x4ff5('0x41')](_0x27c989));return{'isValid':![],'message':'Empty\x20Fax'};}if(_['isNil'](_0x27c989['path'])){ut['logger'](_0x4ff5('0x6f'),JSON[_0x4ff5('0x41')](_0x27c989));return{'isValid':![],'message':_0x4ff5('0x70')};}return{'isValid':!![],'message':_0x4ff5('0x71')};};module[_0x4ff5('0x72')]=Fax; \ No newline at end of file +var _0x61b9=['XMF-PATH','variablesAction','Action','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','reachable','[Fax][checkTrunk][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','Empty\x20path','Is\x20Valid','exports','bluebird','moment','path','./util/gs','../../../config/logger','fax','../ami','./rpcDb','./channel','./util/util','./action','../rpc/faxAccount','../rpc/faxMessage','faxAccounts','trunks','syncNewchannel','varset','syncVarSet','bind','newstate','syncNewExten','syncFaxStatus','receivefax','hangup','syncHangup','originateresponse','prototype','context','hasOwnProperty','exten','uniqueid','channels','channel','name','info','\x20syncNewchannel\x20','variable','syncNewState','channelstate','channelstatedesc','value','operation','status','localstationid','filename','\x20syncFaxStatus\x20','syncReceiveFax','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','create','parse','then','notify','.pdf','catch','error','stringify','\x20receiveFax\x20','merge','response','AttachmentId','update','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][Updated]','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','actions','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20faxRiceive\x20','faxstatus','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','[Fax][execOriginate][success]','Fax\x20failed','checkAfterSend','checkTrunk','FaxAccountId','Trunk','isValid','Trunk\x20Reachable','format','execute','%s/%s.tif','dir'];(function(_0x4c4ca5,_0x40318b){var _0x210119=function(_0x425a74){while(--_0x425a74){_0x4c4ca5['push'](_0x4c4ca5['shift']());}};_0x210119(++_0x40318b);}(_0x61b9,0x164));var _0x961b=function(_0x5c2c7c,_0xa7d3b1){_0x5c2c7c=_0x5c2c7c-0x0;var _0xea7ffe=_0x61b9[_0x5c2c7c];return _0xea7ffe;};'use strict';var util=require('util');var _=require('lodash');var BPromise=require(_0x961b('0x0'));var uuid=require('uuid');var moment=require(_0x961b('0x1'));var path=require(_0x961b('0x2'));var tiff2pdf=require('tiff2pdf');var gs=require(_0x961b('0x3'));var logger=require(_0x961b('0x4'))(_0x961b('0x5'));var ami=require(_0x961b('0x6'));var rpcDb=require(_0x961b('0x7'));var Channel=require(_0x961b('0x8'));var ut=require(_0x961b('0x9'));var Action=require(_0x961b('0xa'));var faxAccount=require(_0x961b('0xb'));var attachment=require('../rpc/attachment');var faxMessage=require(_0x961b('0xc'));function Fax(_0x112855){this['channels']={};this[_0x961b('0xd')]=_0x112855[_0x961b('0xd')];this['trunks']=_0x112855[_0x961b('0xe')];this['actions']={};ami['on']('newchannel',this[_0x961b('0xf')]['bind'](this));ami['on'](_0x961b('0x10'),this[_0x961b('0x11')][_0x961b('0x12')](this));ami['on'](_0x961b('0x13'),this['syncNewState']['bind'](this));ami['on']('newexten',this[_0x961b('0x14')][_0x961b('0x12')](this));ami['on']('faxstatus',this[_0x961b('0x15')][_0x961b('0x12')](this));ami['on'](_0x961b('0x16'),this['syncReceiveFax'][_0x961b('0x12')](this));ami['on'](_0x961b('0x17'),this[_0x961b('0x18')][_0x961b('0x12')](this));ami['on'](_0x961b('0x19'),this['syncOriginateResponse'][_0x961b('0x12')](this));}Fax[_0x961b('0x1a')][_0x961b('0xf')]=function(_0x210dfc){if(_0x210dfc[_0x961b('0x1b')]==='from-voip-provider'){for(var _0x2a5fba in this['faxAccounts']){if(this['faxAccounts'][_0x961b('0x1c')](_0x2a5fba)){if(_0x210dfc[_0x961b('0x1d')]===this[_0x961b('0xd')][_0x2a5fba]['localstationid']){this['channels'][_0x210dfc[_0x961b('0x1e')]]={};this[_0x961b('0x1f')][_0x210dfc[_0x961b('0x1e')]][_0x961b('0x20')]=_0x210dfc['channel'];this[_0x961b('0x1f')][_0x210dfc[_0x961b('0x1e')]]['id']=this[_0x961b('0xd')][_0x2a5fba]['id'];this[_0x961b('0x1f')][_0x210dfc[_0x961b('0x1e')]]['name']=this[_0x961b('0xd')][_0x2a5fba][_0x961b('0x21')];logger[_0x961b('0x22')](_0x210dfc[_0x961b('0x1e')],_0x961b('0x23'));}}}}if(this['actions'][_0x210dfc[_0x961b('0x1e')]]){this[_0x961b('0x1f')][_0x210dfc[_0x961b('0x1e')]]={};this[_0x961b('0x1f')][_0x210dfc[_0x961b('0x1e')]][_0x961b('0x20')]=_0x210dfc[_0x961b('0x20')];logger[_0x961b('0x22')](_0x210dfc[_0x961b('0x1e')],_0x961b('0x23'));}};Fax['prototype']['syncVarSet']=function(_0x3184ba){if(this[_0x961b('0x1f')][_0x3184ba[_0x961b('0x1e')]]){for(var _0x412db8 in _0x3184ba[_0x961b('0x24')]){if(_0x3184ba['variable'][_0x961b('0x1c')](_0x412db8)){this[_0x961b('0x1f')][_0x3184ba['uniqueid']][_0x412db8]=_0x3184ba['value'];}}}};Fax[_0x961b('0x1a')][_0x961b('0x25')]=function(_0x1f2611){if(this[_0x961b('0x1f')][_0x1f2611['uniqueid']]){this[_0x961b('0x1f')][_0x1f2611[_0x961b('0x1e')]][_0x961b('0x26')]=_0x1f2611[_0x961b('0x26')];this[_0x961b('0x1f')][_0x1f2611[_0x961b('0x1e')]]['channelstatedesc']=_0x1f2611[_0x961b('0x27')];}};Fax['prototype'][_0x961b('0x14')]=function(_0x595316){if(this[_0x961b('0x1f')][_0x595316[_0x961b('0x1e')]]){for(var _0x13f7fc in _0x595316[_0x961b('0x24')]){if(_0x595316[_0x961b('0x24')][_0x961b('0x1c')](_0x13f7fc)){this[_0x961b('0x1f')][_0x595316['uniqueid']][_0x13f7fc]=_0x595316[_0x961b('0x28')];}}}};Fax[_0x961b('0x1a')][_0x961b('0x15')]=function(_0x242564){if(this[_0x961b('0x1f')][_0x242564[_0x961b('0x1e')]]){this[_0x961b('0x1f')][_0x242564[_0x961b('0x1e')]][_0x961b('0x29')]=_0x242564[_0x961b('0x29')];this[_0x961b('0x1f')][_0x242564[_0x961b('0x1e')]][_0x961b('0x2a')]=_0x242564[_0x961b('0x2a')];this[_0x961b('0x1f')][_0x242564[_0x961b('0x1e')]][_0x961b('0x2b')]=_0x242564[_0x961b('0x2b')];this[_0x961b('0x1f')][_0x242564['uniqueid']][_0x961b('0x2c')]=_0x242564[_0x961b('0x2c')];logger['info'](_0x242564[_0x961b('0x1e')],_0x961b('0x2d'));}};Fax[_0x961b('0x1a')][_0x961b('0x2e')]=function(_0x4c9f21){var _0x37e0da=this;if(this['channels'][_0x4c9f21[_0x961b('0x1e')]]){var _0x3543c9=this['channels'][_0x4c9f21[_0x961b('0x1e')]]['id'];this[_0x961b('0x1f')][_0x4c9f21[_0x961b('0x1e')]][_0x961b('0x2f')]=_0x4c9f21['remotestationid'];this[_0x961b('0x1f')][_0x4c9f21['uniqueid']][_0x961b('0x30')]=_0x4c9f21[_0x961b('0x30')];this[_0x961b('0x1f')][_0x4c9f21[_0x961b('0x1e')]][_0x961b('0x2b')]=_0x4c9f21[_0x961b('0x2b')];this[_0x961b('0x1f')][_0x4c9f21[_0x961b('0x1e')]][_0x961b('0x31')]=_0x4c9f21[_0x961b('0x31')];this[_0x961b('0x1f')][_0x4c9f21[_0x961b('0x1e')]][_0x961b('0x32')]=_0x4c9f21['transferrate'];this[_0x961b('0x1f')][_0x4c9f21[_0x961b('0x1e')]][_0x961b('0x2c')]=_0x4c9f21['filename'];this[_0x961b('0x1f')][_0x4c9f21[_0x961b('0x1e')]][_0x961b('0x33')]=_0x4c9f21[_0x961b('0x33')];if(this['channels'][_0x4c9f21[_0x961b('0x1e')]][_0x961b('0x30')]>0x0){tiff2pdf(_0x4c9f21['filename'],_0x961b('0x34'),function(_0x10bfd1){logger['info'](_0x4c9f21[_0x961b('0x1e')],_0x961b('0x35'),_0x10bfd1[_0x961b('0x36')]);attachment[_0x961b('0x37')]({'name':path[_0x961b('0x38')](_0x4c9f21[_0x961b('0x2c')])[_0x961b('0x21')],'basename':path['parse'](_0x4c9f21[_0x961b('0x2c')])[_0x961b('0x21')]+'.pdf','type':'application/pdf'})[_0x961b('0x39')](function(_0x37add8){faxAccount[_0x961b('0x3a')](_0x3543c9,{'from':_0x4c9f21[_0x961b('0x33')],'mapKey':'fax','body':path[_0x961b('0x38')](_0x4c9f21['filename'])['name']+_0x961b('0x3b'),'AttachmentId':_0x37add8['id']})[_0x961b('0x3c')](function(_0x4445fc){logger[_0x961b('0x3d')](_0x4c9f21[_0x961b('0x1e')],'\x20notify\x20',JSON[_0x961b('0x3e')](_0x4445fc));});})[_0x961b('0x3c')](function(_0x56780b){logger['error'](_0x4c9f21[_0x961b('0x1e')],_0x961b('0x3f'),JSON['stringify'](_0x56780b));});});}logger[_0x961b('0x22')](_0x4c9f21[_0x961b('0x1e')],_0x961b('0x3f'));}};Fax['prototype']['syncOriginateResponse']=function(_0x502e53){if(this['actions'][_0x502e53['uniqueid']]){_[_0x961b('0x40')](this[_0x961b('0x1f')][_0x502e53[_0x961b('0x1e')]],_['pick'](_0x502e53,[_0x961b('0x41'),'reason']));}};function updateStatus(_0x252bc2){if(_0x252bc2[_0x961b('0x42')]){faxMessage[_0x961b('0x43')](_0x252bc2[_0x961b('0x42')],{'failMessage':_0x961b('0x44')})['then'](function(_0x1b3cea){ut[_0x961b('0x45')](_0x961b('0x46'),_0x1b3cea);})[_0x961b('0x3c')](function(_0xb720ef){ut['logger'](_0x961b('0x47'),_0xb720ef);});}else{ut[_0x961b('0x45')](_0x961b('0x48'));}}Fax['prototype'][_0x961b('0x49')]=function(_0x1379b9,_0x1da887,_0x480e4d){var _0x310181=this;var _0x1d90c9={};if(_0x1da887){_0x1d90c9={'read':_0x1da887};}else{_0x1d90c9={'failMessage':_0x480e4d};}if(this[_0x961b('0x4a')][_0x1379b9][_0x961b('0x42')]){faxMessage[_0x961b('0x43')](this[_0x961b('0x4a')][_0x1379b9][_0x961b('0x42')],_0x1d90c9)[_0x961b('0x39')](function(_0x34d2c8){ut[_0x961b('0x45')](_0x961b('0x4b'),_0x34d2c8);})[_0x961b('0x3c')](function(_0x174fe9){ut['logger'](_0x961b('0x4c'),_0x174fe9);})[_0x961b('0x4d')](function(){delete _0x310181[_0x961b('0x1f')][_0x1379b9];delete _0x310181[_0x961b('0x4a')][_0x1379b9];});}else{ut[_0x961b('0x45')](_0x961b('0x4e'));delete this['channels'][_0x1379b9];delete this[_0x961b('0x4a')][_0x1379b9];}};Fax[_0x961b('0x1a')]['syncHangup']=function(_0x3d9ff9){var _0x361dfd=this;if(this['channels'][_0x3d9ff9[_0x961b('0x1e')]]){if(this[_0x961b('0x4a')][_0x3d9ff9['uniqueid']]){this[_0x961b('0x1f')][_0x3d9ff9['uniqueid']]['id']=this[_0x961b('0x4a')][_0x3d9ff9[_0x961b('0x1e')]]['id'];this[_0x961b('0x1f')][_0x3d9ff9[_0x961b('0x1e')]][_0x961b('0x21')]=this['actions'][_0x3d9ff9[_0x961b('0x1e')]][_0x961b('0x21')];}logger[_0x961b('0x22')](_0x3d9ff9['uniqueid'],this[_0x961b('0x4a')][_0x3d9ff9[_0x961b('0x1e')]]?'\x20hangup\x20sendFile\x20':_0x961b('0x4f'),JSON[_0x961b('0x3e')](this[_0x961b('0x1f')][_0x3d9ff9['uniqueid']]));if(this[_0x961b('0x4a')][_0x3d9ff9[_0x961b('0x1e')]]){if(this[_0x961b('0x1f')][_0x3d9ff9['uniqueid']]['faxpages']>0x0&&this[_0x961b('0x1f')][_0x3d9ff9[_0x961b('0x1e')]][_0x961b('0x50')]==='SUCCESS'){this[_0x961b('0x49')](_0x3d9ff9[_0x961b('0x1e')],!![]);}else{this['updateStatus'](_0x3d9ff9[_0x961b('0x1e')],![],this[_0x961b('0x1f')][_0x3d9ff9[_0x961b('0x1e')]][_0x961b('0x51')]?_0x961b('0x52')+this[_0x961b('0x1f')][_0x3d9ff9[_0x961b('0x1e')]][_0x961b('0x51')]:_0x961b('0x53'));}}}};Fax['prototype']['send']=function(_0x585c5d){var _0x30357a=this;return new BPromise(function(_0x288e9a,_0x254f06){_0x30357a['execOriginate'](_0x585c5d,_0x30357a[_0x961b('0xd')][_0x585c5d['FaxAccountId']])[_0x961b('0x39')](function(_0x1f31c5){ut[_0x961b('0x45')](_0x961b('0x54'),_0x1f31c5);_0x288e9a(ut[_0x961b('0x36')]('Fax\x20received'));})[_0x961b('0x3c')](function(_0x453b89){ut['logger']('[Fax][execOriginate][failure]',_0x453b89);updateStatus(_0x585c5d);_0x254f06(ut[_0x961b('0x36')](_0x961b('0x55')));});});};Fax[_0x961b('0x1a')][_0x961b('0x56')]=function(_0x5afd18){var _0x597923=this;return new BPromise(function(_0x32b776,_0x4f0811){var _0xf54be0=_0x597923[_0x961b('0x57')](_0x597923[_0x961b('0xd')][_0x5afd18[_0x961b('0x58')]][_0x961b('0x59')],_0x5afd18);if(_0xf54be0[_0x961b('0x5a')]){_0x32b776(ut[_0x961b('0x36')](_0x961b('0x5b')));}else{_0x4f0811(ut[_0x961b('0x36')](_0xf54be0[_0x961b('0x36')]));}});};function originate(_0x3e003f,_0x5956df,_0x2b33ec){return new BPromise(function(_0x5f2daf,_0x5180f6){if(_0x2b33ec){var _0x5e1e09=util[_0x961b('0x5c')]('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[_0x961b('0x38')](_0x3e003f[_0x961b('0x2')])[_0x961b('0x21')],_0x3e003f[_0x961b('0x2')]);gs[_0x961b('0x5d')](_0x5e1e09)['then'](function(){_0x3e003f[_0x961b('0x2')]=util[_0x961b('0x5c')](_0x961b('0x5e'),path[_0x961b('0x38')](_0x3e003f[_0x961b('0x2')])[_0x961b('0x5f')],path[_0x961b('0x38')](_0x3e003f['path'])['name']);_0x5956df[_0x961b('0x60')]=_0x3e003f[_0x961b('0x2')];ut[_0x961b('0x45')]('Convert\x20pdf\x20to\x20tif','');ami['Action'](ut[_0x961b('0x61')](_0x3e003f,_0x5956df))[_0x961b('0x39')](function(_0x200c75){_0x5f2daf(_0x200c75);})[_0x961b('0x3c')](function(_0x5c6bfd){_0x5180f6(_0x5c6bfd);});})['catch'](function(_0x57e87e){_0x5180f6(_0x57e87e);});}else{ami[_0x961b('0x62')](ut[_0x961b('0x61')](_0x3e003f,_0x5956df))[_0x961b('0x39')](function(_0x432487){_0x5f2daf(_0x432487);})[_0x961b('0x3c')](function(_0x919880){_0x5180f6(_0x919880);});}});}Fax['prototype']['execOriginate']=function(_0x5ce5e4,_0x4f971c){var _0xc3522c=this;return new BPromise(function(_0x6db08f,_0x184d14){var _0x43fcec=uuid['v4']();var _0x19eb5c=ut[_0x961b('0x63')](_0x5ce5e4,_0x4f971c);_0xc3522c[_0x961b('0x4a')][_0x43fcec]=new Action(_0x43fcec,_0x4f971c,_0x5ce5e4);var _0x5bbe3b=_0xc3522c[_0x961b('0x4a')][_0x43fcec];if(path[_0x961b('0x38')](_0x5ce5e4[_0x961b('0x2')])[_0x961b('0x64')]==='.pdf'){originate(_0x5bbe3b,_0x19eb5c,!![])[_0x961b('0x39')](function(_0x48fd0a){_0x6db08f(_0x48fd0a);})['catch'](function(_0x182a91){_0x184d14(_0x182a91);});}else{originate(_0x5bbe3b,_0x19eb5c,![])[_0x961b('0x39')](function(_0x26160c){_0x6db08f(_0x26160c);})[_0x961b('0x3c')](function(_0x11480f){_0x184d14(_0x11480f);});}});};Fax[_0x961b('0x1a')][_0x961b('0x65')]=function(_0x2f7fe9){return!_[_0x961b('0x66')](_0x2f7fe9)&&!_[_0x961b('0x66')](_0x2f7fe9[_0x961b('0x21')])&&!_['isNil'](_0x2f7fe9[_0x961b('0x67')])&&_0x2f7fe9[_0x961b('0x67')]&&!_[_0x961b('0x66')](this[_0x961b('0xe')][util['format'](_0x961b('0x68'),_0x2f7fe9[_0x961b('0x21')])])&&!_['isNil'](this[_0x961b('0xe')][util[_0x961b('0x5c')](_0x961b('0x68'),_0x2f7fe9[_0x961b('0x21')])][_0x961b('0x2a')])&&(this[_0x961b('0xe')][util['format'](_0x961b('0x68'),_0x2f7fe9[_0x961b('0x21')])][_0x961b('0x2a')]===_0x961b('0x69')||this[_0x961b('0xe')][util[_0x961b('0x5c')](_0x961b('0x68'),_0x2f7fe9['name'])][_0x961b('0x2a')]==='unmonitored');};Fax[_0x961b('0x1a')][_0x961b('0x57')]=function(_0x5a9430,_0x14115b){if(!this[_0x961b('0x65')](_0x5a9430)){ut['logger'](_0x961b('0x6a'),_[_0x961b('0x66')](_0x5a9430)?'':_0x5a9430[_0x961b('0x21')]+_0x961b('0x6b'));return{'isValid':![],'message':'Trunk\x20not\x20working'};}if(_[_0x961b('0x66')](_0x14115b['fax'])){ut[_0x961b('0x45')](_0x961b('0x6c'),JSON[_0x961b('0x3e')](_0x14115b));return{'isValid':![],'message':_0x961b('0x6d')};}if(_[_0x961b('0x66')](_0x14115b[_0x961b('0x2')])){ut['logger']('[Fax][checkTrunk][Empty\x20path]',JSON[_0x961b('0x3e')](_0x14115b));return{'isValid':![],'message':_0x961b('0x6e')};}return{'isValid':!![],'message':_0x961b('0x6f')};};module[_0x961b('0x70')]=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index bf688d2..eb7c918 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 _0xaf37=['then','catch','[Notify]\x20','util','bluebird','lodash','../rpc/faxAccount','error','notify','resolve'];(function(_0x5d8b86,_0x4cbd5f){var _0x1e3c6e=function(_0x226181){while(--_0x226181){_0x5d8b86['push'](_0x5d8b86['shift']());}};_0x1e3c6e(++_0x4cbd5f);}(_0xaf37,0x11b));var _0x7af3=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0xaf37[_0x138adb];return _0x1b27f2;};'use strict';var util=require(_0x7af3('0x0'));var BPromise=require(_0x7af3('0x1'));var logger=require('../../../config/logger')('preview');var _=require(_0x7af3('0x2'));var faxAccount=require(_0x7af3('0x3'));function loggerCatch(_0x191e30){return function(_0x351f6b){logger[_0x7af3('0x4')](_0x191e30,util['inspect'](_0x351f6b,{'showHidden':![],'depth':null}));};}exports[_0x7af3('0x5')]=function(_0xa99f5,_0x139385){return BPromise[_0x7af3('0x6')]()[_0x7af3('0x7')](faxAccount[_0x7af3('0x5')](_0xa99f5,_0x139385))[_0x7af3('0x8')](loggerCatch(_0x7af3('0x9')));}; \ No newline at end of file +var _0x9645=['notify','resolve','then','catch','[Notify]\x20','util','bluebird','../../../config/logger','lodash','../rpc/faxAccount','error','inspect'];(function(_0x2e31bd,_0x450e30){var _0xfe45bb=function(_0x174b26){while(--_0x174b26){_0x2e31bd['push'](_0x2e31bd['shift']());}};_0xfe45bb(++_0x450e30);}(_0x9645,0x179));var _0x5964=function(_0x47e7dd,_0x51b041){_0x47e7dd=_0x47e7dd-0x0;var _0x38501f=_0x9645[_0x47e7dd];return _0x38501f;};'use strict';var util=require(_0x5964('0x0'));var BPromise=require(_0x5964('0x1'));var logger=require(_0x5964('0x2'))('preview');var _=require(_0x5964('0x3'));var faxAccount=require(_0x5964('0x4'));function loggerCatch(_0x44c047){return function(_0x50da2a){logger[_0x5964('0x5')](_0x44c047,util[_0x5964('0x6')](_0x50da2a,{'showHidden':![],'depth':null}));};}exports[_0x5964('0x7')]=function(_0x1693eb,_0x14c0a9){return BPromise[_0x5964('0x8')]()[_0x5964('0x9')](faxAccount[_0x5964('0x7')](_0x1693eb,_0x14c0a9))[_0x5964('0xa')](loggerCatch(_0x5964('0xb')));}; \ 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 4ec4d7c..aa59588 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 _0x8e2d=['bluebird','child_process','exec','execute','info','Exec\x20gs','\x20Error\x20:','inspect','fax'];(function(_0x51dae5,_0x360b39){var _0x303ec2=function(_0x5a2bd0){while(--_0x5a2bd0){_0x51dae5['push'](_0x51dae5['shift']());}};_0x303ec2(++_0x360b39);}(_0x8e2d,0x14c));var _0xd8e2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8e2d[_0x3dd15e];return _0x231fd0;};'use strict';var util=require('util');var logger=require('../../../../config/logger')(_0xd8e2('0x0'));var BPromise=require(_0xd8e2('0x1'));var exec=require(_0xd8e2('0x2'))[_0xd8e2('0x3')];exports[_0xd8e2('0x4')]=function(_0x34563b){return new BPromise(function(_0x12a461,_0x315396){exec(_0x34563b,function(_0x1afe69,_0x23212b,_0x4c4bd0){logger[_0xd8e2('0x5')](_0xd8e2('0x6'),_0x23212b);if(_0x1afe69){logger[_0xd8e2('0x5')](_0xd8e2('0x6'),_0xd8e2('0x7'),util[_0xd8e2('0x8')](_0x1afe69,{'showHidden':![],'depth':null}),_0x23212b,_0x4c4bd0);_0x315396(_0x1afe69);}_0x12a461(_0x23212b);});});}; \ No newline at end of file +var _0x0579=['child_process','exec','execute','info','Exec\x20gs','util','../../../../config/logger','fax','bluebird'];(function(_0x28aea5,_0x3bb12e){var _0x6a55f9=function(_0xf6ece8){while(--_0xf6ece8){_0x28aea5['push'](_0x28aea5['shift']());}};_0x6a55f9(++_0x3bb12e);}(_0x0579,0x11c));var _0x9057=function(_0x29a47b,_0x32d756){_0x29a47b=_0x29a47b-0x0;var _0x2a68bf=_0x0579[_0x29a47b];return _0x2a68bf;};'use strict';var util=require(_0x9057('0x0'));var logger=require(_0x9057('0x1'))(_0x9057('0x2'));var BPromise=require(_0x9057('0x3'));var exec=require(_0x9057('0x4'))[_0x9057('0x5')];exports[_0x9057('0x6')]=function(_0x3d7c27){return new BPromise(function(_0x398061,_0x1d6a72){exec(_0x3d7c27,function(_0x5ea961,_0x2d1504,_0x5a168e){logger[_0x9057('0x7')]('Exec\x20gs',_0x2d1504);if(_0x5ea961){logger[_0x9057('0x7')](_0x9057('0x8'),'\x20Error\x20:',util['inspect'](_0x5ea961,{'showHidden':![],'depth':null}),_0x2d1504,_0x5a168e);_0x1d6a72(_0x5ea961);}_0x398061(_0x2d1504);});});}; \ 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 28ee288..032da68 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 _0x3b4b=['channel','xcally-motion-fax','from-sip','\x22%s\x22\x20<%s>','localstationid','util','moment','fax','message','logger','info','addVariables','ecm','headerinfo','minrate','maxrate','format','\x22%s\x22','gateway','faxdetect','t38timeout','path','variablesAction','uniqueid','originate'];(function(_0x2fff8e,_0x43b892){var _0x45bfa3=function(_0x3b8184){while(--_0x3b8184){_0x2fff8e['push'](_0x2fff8e['shift']());}};_0x45bfa3(++_0x43b892);}(_0x3b4b,0xff));var _0xb3b4=function(_0x43b3fc,_0x4fb2ec){_0x43b3fc=_0x43b3fc-0x0;var _0x41ad9d=_0x3b4b[_0x43b3fc];return _0x41ad9d;};'use strict';var util=require(_0xb3b4('0x0'));var _=require('lodash');var moment=require(_0xb3b4('0x1'));var logger=require('../../../../config/logger')(_0xb3b4('0x2'));exports[_0xb3b4('0x3')]=function(_0x1d667e){return{'message':_0x1d667e};};exports[_0xb3b4('0x4')]=function(_0x233c71,_0x1db301){logger[_0xb3b4('0x5')](_0x233c71,util['inspect'](_0x1db301,{'showHidden':![],'depth':null}));};exports[_0xb3b4('0x6')]=function(_0x4750ed,_0x5aade3){var _0x32d578={'XMF-ECM':_0x5aade3[_0xb3b4('0x7')],'XMF-HEADERINFO':_0x5aade3[_0xb3b4('0x8')],'XMF-MINRATE':_0x5aade3[_0xb3b4('0x9')],'XMF-MAXRATE':_0x5aade3[_0xb3b4('0xa')],'XMF-MODEM':util[_0xb3b4('0xb')](_0xb3b4('0xc'),_0x5aade3['modem']),'XMF-GATEWAY':_0x5aade3[_0xb3b4('0xd')],'XMF-FAXDETECT':_0x5aade3[_0xb3b4('0xe')],'XMF-T38TIMEOUT':_0x5aade3[_0xb3b4('0xf')],'XMF-LOCALSTATIONID':_0x5aade3['localstationid'],'XMF-PATH':_0x4750ed[_0xb3b4('0x10')]};return _0x32d578;};exports[_0xb3b4('0x11')]=function(_0x271647,_0x239a6a){return{'actionid':_0x271647[_0xb3b4('0x12')],'action':_0xb3b4('0x13'),'channel':_0x271647[_0xb3b4('0x14')],'Exten':_0xb3b4('0x15'),'Context':_0xb3b4('0x16'),'Priority':'1','callerid':util[_0xb3b4('0xb')](_0xb3b4('0x17'),_0x271647[_0xb3b4('0x8')]?_0x271647['headerinfo']:'',_0x271647[_0xb3b4('0x18')]),'variable':_0x239a6a,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x271647[_0xb3b4('0x12')]};}; \ No newline at end of file +var _0xdec2=['inspect','addVariables','ecm','headerinfo','maxrate','format','modem','gateway','faxdetect','path','variablesAction','uniqueid','originate','channel','xcally-motion-fax','localstationid','util','lodash','moment','../../../../config/logger','fax','message','logger','info'];(function(_0xfe3a76,_0x5b58d4){var _0x1a07fb=function(_0x497788){while(--_0x497788){_0xfe3a76['push'](_0xfe3a76['shift']());}};_0x1a07fb(++_0x5b58d4);}(_0xdec2,0x178));var _0x2dec=function(_0x5492d1,_0x5b52b3){_0x5492d1=_0x5492d1-0x0;var _0x1c19ec=_0xdec2[_0x5492d1];return _0x1c19ec;};'use strict';var util=require(_0x2dec('0x0'));var _=require(_0x2dec('0x1'));var moment=require(_0x2dec('0x2'));var logger=require(_0x2dec('0x3'))(_0x2dec('0x4'));exports[_0x2dec('0x5')]=function(_0x157ff3){return{'message':_0x157ff3};};exports[_0x2dec('0x6')]=function(_0x1816bf,_0x1d3715){logger[_0x2dec('0x7')](_0x1816bf,util[_0x2dec('0x8')](_0x1d3715,{'showHidden':![],'depth':null}));};exports[_0x2dec('0x9')]=function(_0x3f8235,_0x3fb235){var _0x4f5e9d={'XMF-ECM':_0x3fb235[_0x2dec('0xa')],'XMF-HEADERINFO':_0x3fb235[_0x2dec('0xb')],'XMF-MINRATE':_0x3fb235['minrate'],'XMF-MAXRATE':_0x3fb235[_0x2dec('0xc')],'XMF-MODEM':util[_0x2dec('0xd')]('\x22%s\x22',_0x3fb235[_0x2dec('0xe')]),'XMF-GATEWAY':_0x3fb235[_0x2dec('0xf')],'XMF-FAXDETECT':_0x3fb235[_0x2dec('0x10')],'XMF-T38TIMEOUT':_0x3fb235['t38timeout'],'XMF-LOCALSTATIONID':_0x3fb235['localstationid'],'XMF-PATH':_0x3f8235[_0x2dec('0x11')]};return _0x4f5e9d;};exports[_0x2dec('0x12')]=function(_0x45fe07,_0x952d1a){return{'actionid':_0x45fe07[_0x2dec('0x13')],'action':_0x2dec('0x14'),'channel':_0x45fe07[_0x2dec('0x15')],'Exten':_0x2dec('0x16'),'Context':'from-sip','Priority':'1','callerid':util['format']('\x22%s\x22\x20<%s>',_0x45fe07[_0x2dec('0xb')]?_0x45fe07[_0x2dec('0xb')]:'',_0x45fe07[_0x2dec('0x17')]),'variable':_0x952d1a,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x45fe07[_0x2dec('0x13')]};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index b7827ed..7a7aa50 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 _0xfd14=['./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','get','hour','resolve','then','getAgents','initAgents','getTelephones','initTelephones','getTrunks','initTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTriggers','initTemplates','getZendeskAccounts','getSalesforceAccounts','getSugarcrmAccounts','getFreshdeskAccounts','getVtigerAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','initDynamics365Accounts','getCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','listen','sync','catch','log','util','moment','./realtime','./report','./acw','./trigger','./dialer','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/template','./rpc/cmHopperHistory'];(function(_0x4a53d,_0x58a95e){var _0x27410e=function(_0x38fc90){while(--_0x38fc90){_0x4a53d['push'](_0x4a53d['shift']());}};_0x27410e(++_0x58a95e);}(_0xfd14,0x73));var _0x4fd1=function(_0x3b1448,_0x3071fa){_0x3b1448=_0x3b1448-0x0;var _0x543f82=_0xfd14[_0x3b1448];return _0x543f82;};'use strict';var BPromise=require('bluebird');var util=require(_0x4fd1('0x0'));var moment=require(_0x4fd1('0x1'));var server=require('./server');var Realtime=require(_0x4fd1('0x2'));var Report=require(_0x4fd1('0x3'));var Acw=require(_0x4fd1('0x4'));var Trigger=require(_0x4fd1('0x5'));var Dialer=require(_0x4fd1('0x6'));var Preview=require('./preview');var Fax=require('./fax');var user=require(_0x4fd1('0x7'));var voiceQueue=require(_0x4fd1('0x8'));var voiceQueueReport=require(_0x4fd1('0x9'));var voiceCallReport=require(_0x4fd1('0xa'));var trunk=require(_0x4fd1('0xb'));var trigger=require(_0x4fd1('0xc'));var template=require(_0x4fd1('0xd'));var cmHopperHistory=require(_0x4fd1('0xe'));var campaign=require('./rpc/campaign');var voiceExtension=require(_0x4fd1('0xf'));var faxAccount=require(_0x4fd1('0x10'));var zendesk=require(_0x4fd1('0x11'));var salesforce=require(_0x4fd1('0x12'));var sugarcrm=require(_0x4fd1('0x13'));var freshdesk=require('./rpc/integrations/freshdesk');var desk=require(_0x4fd1('0x14'));var zoho=require(_0x4fd1('0x15'));var vtiger=require(_0x4fd1('0x16'));var freshsales=require(_0x4fd1('0x17'));var servicenow=require(_0x4fd1('0x18'));var dynamics365=require('./rpc/integrations/dynamics365');var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x4fd1('0x19')](_0x4fd1('0x1a'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()['get'](_0x4fd1('0x1a'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x4fd1('0x1b')]()[_0x4fd1('0x1c')](user[_0x4fd1('0x1d')]())[_0x4fd1('0x1c')](realtime[_0x4fd1('0x1e')]())[_0x4fd1('0x1c')](user[_0x4fd1('0x1f')]())[_0x4fd1('0x1c')](realtime[_0x4fd1('0x20')]())[_0x4fd1('0x1c')](trunk[_0x4fd1('0x21')]())[_0x4fd1('0x1c')](realtime[_0x4fd1('0x22')]())[_0x4fd1('0x1c')](voiceQueue[_0x4fd1('0x23')]())[_0x4fd1('0x1c')](realtime[_0x4fd1('0x24')]())[_0x4fd1('0x1c')](trigger[_0x4fd1('0x25')]())[_0x4fd1('0x1c')](realtime[_0x4fd1('0x26')]())[_0x4fd1('0x1c')](template['getTemplates']())[_0x4fd1('0x1c')](realtime[_0x4fd1('0x27')]())[_0x4fd1('0x1c')](zendesk[_0x4fd1('0x28')]())[_0x4fd1('0x1c')](realtime['initZendeskAccounts']())[_0x4fd1('0x1c')](salesforce[_0x4fd1('0x29')]())['then'](realtime['initSalesforceAccounts']())[_0x4fd1('0x1c')](sugarcrm[_0x4fd1('0x2a')]())[_0x4fd1('0x1c')](realtime['initSugarcrmAccounts']())[_0x4fd1('0x1c')](freshdesk[_0x4fd1('0x2b')]())[_0x4fd1('0x1c')](realtime['initFreshdeskAccounts']())[_0x4fd1('0x1c')](desk['getDeskAccounts']())['then'](realtime['initDeskAccounts']())[_0x4fd1('0x1c')](zoho['getZohoAccounts']())[_0x4fd1('0x1c')](realtime['initZohoAccounts']())[_0x4fd1('0x1c')](vtiger[_0x4fd1('0x2c')]())['then'](realtime['initVtigerAccounts']())[_0x4fd1('0x1c')](freshsales[_0x4fd1('0x2d')]())[_0x4fd1('0x1c')](realtime[_0x4fd1('0x2e')]())[_0x4fd1('0x1c')](servicenow[_0x4fd1('0x2f')]())[_0x4fd1('0x1c')](realtime[_0x4fd1('0x30')]())['then'](dynamics365['getDynamics365Accounts']())[_0x4fd1('0x1c')](realtime[_0x4fd1('0x31')]())[_0x4fd1('0x1c')](campaign[_0x4fd1('0x32')]())[_0x4fd1('0x1c')](realtime['initCampaigns']())[_0x4fd1('0x1c')](voiceExtension[_0x4fd1('0x33')]())[_0x4fd1('0x1c')](realtime[_0x4fd1('0x34')]())[_0x4fd1('0x1c')](faxAccount[_0x4fd1('0x35')]())[_0x4fd1('0x1c')](realtime[_0x4fd1('0x36')]())[_0x4fd1('0x1c')](function(){return realtime;});}function initParams(){return BPromise[_0x4fd1('0x1b')]()[_0x4fd1('0x1c')](voiceQueueReport[_0x4fd1('0x37')]())[_0x4fd1('0x1c')](realtime[_0x4fd1('0x38')]())['then'](cmHopperHistory[_0x4fd1('0x39')]())['then'](realtime[_0x4fd1('0x3a')]())[_0x4fd1('0x1c')](cmHopperHistory[_0x4fd1('0x3b')]())[_0x4fd1('0x1c')](realtime[_0x4fd1('0x3c')]())[_0x4fd1('0x1c')](voiceCallReport['getVoiceCallReports']())[_0x4fd1('0x1c')](realtime['initVoiceCallReports']())[_0x4fd1('0x1c')](function(_0x2c8fd3){})['catch'](function(_0x389367){console['log'](_0x389367);});}function main(){return server[_0x4fd1('0x3d')](realtime,preview,fax)[_0x4fd1('0x1c')](function(_0x78cf69){return initRealtime();})['then'](function(){return initParams();})[_0x4fd1('0x1c')](function(){report[_0x4fd1('0x3e')]();setInterval(initRealtime,0x1388);})[_0x4fd1('0x3f')](function(_0x282978){console[_0x4fd1('0x40')](_0x282978);});}main(); \ No newline at end of file +var _0xf452=['./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','get','hour','resolve','then','getAgents','initAgents','getTelephones','initTelephones','getTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTriggers','getTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','initVoiceCallReports','log','sync','catch','bluebird','util','moment','./server','./realtime','./report','./acw','./trigger','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/trunk','./rpc/trigger','./rpc/cmHopperHistory','./rpc/campaign'];(function(_0x55bcaa,_0x24d194){var _0x293032=function(_0x15f39e){while(--_0x15f39e){_0x55bcaa['push'](_0x55bcaa['shift']());}};_0x293032(++_0x24d194);}(_0xf452,0x104));var _0x2f45=function(_0x87270f,_0x5091cd){_0x87270f=_0x87270f-0x0;var _0xcf5d41=_0xf452[_0x87270f];return _0xcf5d41;};'use strict';var BPromise=require(_0x2f45('0x0'));var util=require(_0x2f45('0x1'));var moment=require(_0x2f45('0x2'));var server=require(_0x2f45('0x3'));var Realtime=require(_0x2f45('0x4'));var Report=require(_0x2f45('0x5'));var Acw=require(_0x2f45('0x6'));var Trigger=require(_0x2f45('0x7'));var Dialer=require('./dialer');var Preview=require('./preview');var Fax=require(_0x2f45('0x8'));var user=require(_0x2f45('0x9'));var voiceQueue=require(_0x2f45('0xa'));var voiceQueueReport=require(_0x2f45('0xb'));var voiceCallReport=require('./rpc/voiceCallReport');var trunk=require(_0x2f45('0xc'));var trigger=require(_0x2f45('0xd'));var template=require('./rpc/template');var cmHopperHistory=require(_0x2f45('0xe'));var campaign=require(_0x2f45('0xf'));var voiceExtension=require('./rpc/voiceExtension');var faxAccount=require('./rpc/faxAccount');var zendesk=require(_0x2f45('0x10'));var salesforce=require(_0x2f45('0x11'));var sugarcrm=require(_0x2f45('0x12'));var freshdesk=require('./rpc/integrations/freshdesk');var desk=require(_0x2f45('0x13'));var zoho=require(_0x2f45('0x14'));var vtiger=require(_0x2f45('0x15'));var freshsales=require(_0x2f45('0x16'));var servicenow=require(_0x2f45('0x17'));var dynamics365=require(_0x2f45('0x18'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x2f45('0x19')](_0x2f45('0x1a'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x2f45('0x19')](_0x2f45('0x1a'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x2f45('0x1b')]()[_0x2f45('0x1c')](user[_0x2f45('0x1d')]())['then'](realtime[_0x2f45('0x1e')]())['then'](user[_0x2f45('0x1f')]())[_0x2f45('0x1c')](realtime[_0x2f45('0x20')]())[_0x2f45('0x1c')](trunk[_0x2f45('0x21')]())[_0x2f45('0x1c')](realtime['initTrunks']())[_0x2f45('0x1c')](voiceQueue[_0x2f45('0x22')]())[_0x2f45('0x1c')](realtime[_0x2f45('0x23')]())[_0x2f45('0x1c')](trigger[_0x2f45('0x24')]())[_0x2f45('0x1c')](realtime[_0x2f45('0x25')]())[_0x2f45('0x1c')](template[_0x2f45('0x26')]())[_0x2f45('0x1c')](realtime['initTemplates']())[_0x2f45('0x1c')](zendesk[_0x2f45('0x27')]())['then'](realtime[_0x2f45('0x28')]())['then'](salesforce[_0x2f45('0x29')]())[_0x2f45('0x1c')](realtime[_0x2f45('0x2a')]())[_0x2f45('0x1c')](sugarcrm[_0x2f45('0x2b')]())['then'](realtime[_0x2f45('0x2c')]())['then'](freshdesk[_0x2f45('0x2d')]())[_0x2f45('0x1c')](realtime[_0x2f45('0x2e')]())[_0x2f45('0x1c')](desk['getDeskAccounts']())[_0x2f45('0x1c')](realtime[_0x2f45('0x2f')]())[_0x2f45('0x1c')](zoho[_0x2f45('0x30')]())[_0x2f45('0x1c')](realtime[_0x2f45('0x31')]())['then'](vtiger['getVtigerAccounts']())[_0x2f45('0x1c')](realtime['initVtigerAccounts']())[_0x2f45('0x1c')](freshsales[_0x2f45('0x32')]())[_0x2f45('0x1c')](realtime[_0x2f45('0x33')]())[_0x2f45('0x1c')](servicenow[_0x2f45('0x34')]())[_0x2f45('0x1c')](realtime['initServicenowAccounts']())[_0x2f45('0x1c')](dynamics365[_0x2f45('0x35')]())[_0x2f45('0x1c')](realtime[_0x2f45('0x36')]())['then'](campaign[_0x2f45('0x37')]())[_0x2f45('0x1c')](realtime[_0x2f45('0x38')]())[_0x2f45('0x1c')](voiceExtension[_0x2f45('0x39')]())[_0x2f45('0x1c')](realtime[_0x2f45('0x3a')]())[_0x2f45('0x1c')](faxAccount['getFaxAccounts']())[_0x2f45('0x1c')](realtime[_0x2f45('0x3b')]())[_0x2f45('0x1c')](function(){return realtime;});}function initParams(){return BPromise[_0x2f45('0x1b')]()['then'](voiceQueueReport[_0x2f45('0x3c')]())[_0x2f45('0x1c')](realtime[_0x2f45('0x3d')]())[_0x2f45('0x1c')](cmHopperHistory[_0x2f45('0x3e')]())[_0x2f45('0x1c')](realtime['initVoiceQueueHopperHistory']())[_0x2f45('0x1c')](cmHopperHistory[_0x2f45('0x3f')]())[_0x2f45('0x1c')](realtime[_0x2f45('0x40')]())['then'](voiceCallReport['getVoiceCallReports']())[_0x2f45('0x1c')](realtime[_0x2f45('0x41')]())['then'](function(_0x29466b){})['catch'](function(_0x1632e3){console[_0x2f45('0x42')](_0x1632e3);});}function main(){return server['listen'](realtime,preview,fax)[_0x2f45('0x1c')](function(_0x41269a){return initRealtime();})[_0x2f45('0x1c')](function(){return initParams();})[_0x2f45('0x1c')](function(){report[_0x2f45('0x43')]();setInterval(initRealtime,0x1388);})[_0x2f45('0x44')](function(_0x14690b){console[_0x2f45('0x42')](_0x14690b);});}main(); \ No newline at end of file diff --git a/server/services/ami/model/agent.js b/server/services/ami/model/agent.js index 757bb78..32bd096 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 _0x0713=['idle','inuse','talking','voiceStatusTime','toNumber','format','voiceStatusQueue','stringify','user:%s','emit','user:save','user:presence','exports','moment','md5','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','email','accountcode','fullname','unknown','stateTime','status','address','mobile','interface','online','voiceStatus','voiceStatusCallerIdNumber','onhold','local','prototype','state','toLowerCase','not_inuse'];(function(_0x56149c,_0x36c8d2){var _0x155d78=function(_0x31041e){while(--_0x31041e){_0x56149c['push'](_0x56149c['shift']());}};_0x155d78(++_0x36c8d2);}(_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 md5=require(_0x3071('0x1'));var Redis=require(_0x3071('0x2'));var config=require(_0x3071('0x3'));config[_0x3071('0x4')]=_['defaults'](config[_0x3071('0x4')],{'host':_0x3071('0x5'),'port':0x18eb});var io=require(_0x3071('0x6'))(new Redis(config[_0x3071('0x4')]));function Agent(_0xabd7b6){this['id']=_0xabd7b6['id']||0x0;this[_0x3071('0x7')]=_0xabd7b6[_0x3071('0x7')]||'';this[_0x3071('0x8')]=_0xabd7b6[_0x3071('0x8')]||'';this[_0x3071('0x9')]=_0xabd7b6[_0x3071('0x9')]||'';this[_0x3071('0xa')]=_0xabd7b6[_0x3071('0xa')]||'';this['state']=_0x3071('0xb');this[_0x3071('0xc')]=0x0;this[_0x3071('0xd')]=_0x3071('0xb');this[_0x3071('0xe')]='';this['phone']='';this[_0x3071('0xf')]='';this[_0x3071('0x10')]='';this[_0x3071('0x11')]=_0xabd7b6[_0x3071('0x11')]||![];this[_0x3071('0x12')]='unknown';this['voiceStatusTime']=0x0;this[_0x3071('0x13')]='';this['voiceStatusQueue']='';this[_0x3071('0x14')]=![];this[_0x3071('0x15')]=![];this['md5']='';}Agent[_0x3071('0x16')]['updateStatusRealtime']=function(_0x2fc15d){var _0x45c93b;if(_0x2fc15d&&_0x2fc15d[_0x3071('0x17')]){_0x45c93b=_0x2fc15d[_0x3071('0x17')][_0x3071('0x18')]();switch(_0x45c93b){case _0x3071('0x19'):_0x45c93b=_0x3071('0x1a');break;case _0x3071('0x1b'):_0x45c93b=_0x3071('0x1c');break;}}if(_0x45c93b&&this[_0x3071('0x12')]!==_0x45c93b||_0x2fc15d['statePause']){this[_0x3071('0x1d')]=_[_0x3071('0x1e')](moment()[_0x3071('0x1f')]('x'));}if(_0x45c93b){this[_0x3071('0x12')]=_0x45c93b;}var _0x3acf0e={'id':this['id'],'name':this[_0x3071('0x7')],'email':this[_0x3071('0x8')],'accountcode':this[_0x3071('0x9')],'fullname':this['fullname'],'state':this[_0x3071('0x17')],'stateTime':this[_0x3071('0xc')],'status':this[_0x3071('0xd')],'address':this['address'],'online':this[_0x3071('0x11')],'voiceStatus':this['voiceStatus'],'voiceStatusTime':this[_0x3071('0x1d')],'voiceStatusCallerIdNumber':this[_0x3071('0x13')],'voiceStatusQueue':this[_0x3071('0x20')],'interface':this[_0x3071('0x10')],'onhold':this[_0x3071('0x14')]};var _0x34c50e=md5(JSON[_0x3071('0x21')](_0x3acf0e));if(this[_0x3071('0x1')]!==_0x34c50e){this['md5']=_0x34c50e;io['to'](util['format'](_0x3071('0x22'),_0x3acf0e[_0x3071('0x7')]))[_0x3071('0x23')](_0x3071('0x24'),_0x3acf0e);io[_0x3071('0x23')](_0x3071('0x25'),_0x3acf0e);}};module[_0x3071('0x26')]=Agent; \ No newline at end of file +var _0xe706=['address','phone','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','onhold','updateStatusRealtime','not_inuse','inuse','talking','format','interface','stringify','md5','user:%s','emit','user:presence','lodash','util','moment','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','email','accountcode','fullname','state','unknown','stateTime','status'];(function(_0x2bb880,_0x106176){var _0x4afd25=function(_0x3927c1){while(--_0x3927c1){_0x2bb880['push'](_0x2bb880['shift']());}};_0x4afd25(++_0x106176);}(_0xe706,0xa3));var _0x6e70=function(_0x423e4b,_0x1bb75b){_0x423e4b=_0x423e4b-0x0;var _0x626fd4=_0xe706[_0x423e4b];return _0x626fd4;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var moment=require(_0x6e70('0x2'));var md5=require('md5');var Redis=require(_0x6e70('0x3'));var config=require(_0x6e70('0x4'));config[_0x6e70('0x5')]=_[_0x6e70('0x6')](config[_0x6e70('0x5')],{'host':_0x6e70('0x7'),'port':0x18eb});var io=require(_0x6e70('0x8'))(new Redis(config[_0x6e70('0x5')]));function Agent(_0x1b0389){this['id']=_0x1b0389['id']||0x0;this[_0x6e70('0x9')]=_0x1b0389[_0x6e70('0x9')]||'';this[_0x6e70('0xa')]=_0x1b0389[_0x6e70('0xa')]||'';this[_0x6e70('0xb')]=_0x1b0389[_0x6e70('0xb')]||'';this[_0x6e70('0xc')]=_0x1b0389[_0x6e70('0xc')]||'';this[_0x6e70('0xd')]=_0x6e70('0xe');this[_0x6e70('0xf')]=0x0;this[_0x6e70('0x10')]=_0x6e70('0xe');this[_0x6e70('0x11')]='';this[_0x6e70('0x12')]='';this['mobile']='';this['interface']='';this[_0x6e70('0x13')]=_0x1b0389[_0x6e70('0x13')]||![];this[_0x6e70('0x14')]=_0x6e70('0xe');this[_0x6e70('0x15')]=0x0;this[_0x6e70('0x16')]='';this[_0x6e70('0x17')]='';this[_0x6e70('0x18')]=![];this['local']=![];this['md5']='';}Agent['prototype'][_0x6e70('0x19')]=function(_0x5a37a6){var _0x53aed0;if(_0x5a37a6&&_0x5a37a6[_0x6e70('0xd')]){_0x53aed0=_0x5a37a6[_0x6e70('0xd')]['toLowerCase']();switch(_0x53aed0){case _0x6e70('0x1a'):_0x53aed0='idle';break;case _0x6e70('0x1b'):_0x53aed0=_0x6e70('0x1c');break;}}if(_0x53aed0&&this['voiceStatus']!==_0x53aed0||_0x5a37a6['statePause']){this[_0x6e70('0x15')]=_['toNumber'](moment()[_0x6e70('0x1d')]('x'));}if(_0x53aed0){this[_0x6e70('0x14')]=_0x53aed0;}var _0x53acdc={'id':this['id'],'name':this['name'],'email':this[_0x6e70('0xa')],'accountcode':this[_0x6e70('0xb')],'fullname':this[_0x6e70('0xc')],'state':this[_0x6e70('0xd')],'stateTime':this[_0x6e70('0xf')],'status':this[_0x6e70('0x10')],'address':this[_0x6e70('0x11')],'online':this[_0x6e70('0x13')],'voiceStatus':this[_0x6e70('0x14')],'voiceStatusTime':this[_0x6e70('0x15')],'voiceStatusCallerIdNumber':this['voiceStatusCallerIdNumber'],'voiceStatusQueue':this[_0x6e70('0x17')],'interface':this[_0x6e70('0x1e')],'onhold':this[_0x6e70('0x18')]};var _0x502b2d=md5(JSON[_0x6e70('0x1f')](_0x53acdc));if(this[_0x6e70('0x20')]!==_0x502b2d){this[_0x6e70('0x20')]=_0x502b2d;io['to'](util['format'](_0x6e70('0x21'),_0x53acdc['name']))['emit']('user:save',_0x53acdc);io[_0x6e70('0x22')](_0x6e70('0x23'),_0x53acdc);}};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 e434862..014f88f 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 _0x3080=['limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','temp','ivrAnswerCallsDay','active'];(function(_0x54227d,_0xd56054){var _0x385e0a=function(_0x12b00a){while(--_0x12b00a){_0x54227d['push'](_0x54227d['shift']());}};_0x385e0a(++_0xd56054);}(_0x3080,0x8a));var _0x0308=function(_0x215ffc,_0x16c081){_0x215ffc=_0x215ffc-0x0;var _0x3dea83=_0x3080[_0x215ffc];return _0x3dea83;};'use strict';function Campaign(_0x48ea67){this['id']=_0x48ea67['id']||0x0;this[_0x0308('0x0')]=_0x48ea67['name']||'';this[_0x0308('0x1')]=_0x48ea67['type']||_0x0308('0x2');this['originated']=0x0;this[_0x0308('0x3')]=0x0;this[_0x0308('0x4')]=0x0;this['ivrTotalCallsDays']=0x0;this['message']='';this['sendMessageOneNotActive']=!![];this['active']=_0x48ea67[_0x0308('0x5')];this['limitCalls']=_0x48ea67[_0x0308('0x6')];this[_0x0308('0x7')]=_0x48ea67[_0x0308('0x7')]||null;this[_0x0308('0x8')]=_0x48ea67[_0x0308('0x8')]?_0x48ea67[_0x0308('0x8')]:null;this[_0x0308('0x9')]=_0x48ea67['dialOriginateCallerIdName'];this[_0x0308('0xa')]=_0x48ea67[_0x0308('0xa')];this[_0x0308('0xb')]=_0x48ea67[_0x0308('0xb')]||0x1e;this[_0x0308('0xc')]=_0x48ea67['dialCongestionMaxRetry'];this[_0x0308('0xd')]=_0x48ea67[_0x0308('0xd')];this[_0x0308('0xe')]=_0x48ea67['dialBusyMaxRetry'];this[_0x0308('0xf')]=_0x48ea67[_0x0308('0xf')];this[_0x0308('0x10')]=_0x48ea67[_0x0308('0x10')];this['dialNoAnswerRetryFrequency']=_0x48ea67[_0x0308('0x11')];this[_0x0308('0x12')]=_0x48ea67['dialGlobalMaxRetry'];this[_0x0308('0x13')]=_0x48ea67[_0x0308('0x13')]||0x3;this[_0x0308('0x14')]=_0x48ea67[_0x0308('0x14')]||0x96;this[_0x0308('0x15')]=_0x48ea67[_0x0308('0x15')]||0x3;this[_0x0308('0x16')]=_0x48ea67[_0x0308('0x16')]||0x96;this[_0x0308('0x17')]=_0x48ea67[_0x0308('0x17')]||0x3;this[_0x0308('0x18')]=_0x48ea67[_0x0308('0x18')]||0x96;this[_0x0308('0x19')]=_0x48ea67[_0x0308('0x19')]||0x3;this[_0x0308('0x1a')]=_0x48ea67[_0x0308('0x1a')]||0x96;this[_0x0308('0x1b')]=_0x48ea67[_0x0308('0x1b')]||0x3;this[_0x0308('0x1c')]=_0x48ea67[_0x0308('0x1c')]||0x96;this['dialOrderByScheduledAt']=_0x48ea67['dialOrderByScheduledAt']||_0x0308('0x1d');this[_0x0308('0x1e')]=_0x48ea67['dialPrefix']||undefined;this['dialRandomLastDigitCallerIdNumber']=_0x48ea67[_0x0308('0x1f')]||undefined;this[_0x0308('0x20')]=_0x48ea67['dialCutDigit']||undefined;this[_0x0308('0x21')]=_0x48ea67['TrunkBackup']?_0x48ea67[_0x0308('0x21')]:undefined;this['Trunk']=_0x48ea67[_0x0308('0x22')]?_0x48ea67[_0x0308('0x22')]:undefined;this[_0x0308('0x23')]=_0x48ea67[_0x0308('0x23')]?_0x48ea67[_0x0308('0x23')]:undefined;this[_0x0308('0x24')]=_0x48ea67[_0x0308('0x24')]?_0x48ea67[_0x0308('0x24')]:undefined;this[_0x0308('0x25')]=_0x48ea67['SquareProject']?_0x48ea67[_0x0308('0x24')]['name']:undefined;this['dialAMDActive']=_0x48ea67['dialAMDActive']||![];this[_0x0308('0x26')]=_0x48ea67[_0x0308('0x26')];this[_0x0308('0x27')]=_0x48ea67[_0x0308('0x27')];this['dialAMDAfterGreetingSilence']=_0x48ea67[_0x0308('0x28')];this['dialAMDTotalAnalysisTime']=_0x48ea67[_0x0308('0x29')];this['dialAMDMinWordLength']=_0x48ea67[_0x0308('0x2a')];this[_0x0308('0x2b')]=_0x48ea67[_0x0308('0x2b')];this['dialAMDMaximumNumberOfWords']=_0x48ea67[_0x0308('0x2c')];this['dialAMDSilenceThreshold']=_0x48ea67[_0x0308('0x2d')];this['dialAMDMaximumWordLength']=_0x48ea67[_0x0308('0x2e')];}module[_0x0308('0x2f')]=Campaign; \ No newline at end of file +var _0xfb22=['dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','name','type','campaign','temp','ivrAnswerCallsDay','ivrTotalCallsDays','message','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialOrderByScheduledAt','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence'];(function(_0x5816e6,_0x2d2f4a){var _0x5b7f91=function(_0x1d7519){while(--_0x1d7519){_0x5816e6['push'](_0x5816e6['shift']());}};_0x5b7f91(++_0x2d2f4a);}(_0xfb22,0x17e));var _0x2fb2=function(_0x567f0e,_0x2be7a0){_0x567f0e=_0x567f0e-0x0;var _0x15aca8=_0xfb22[_0x567f0e];return _0x15aca8;};'use strict';function Campaign(_0x2160f2){this['id']=_0x2160f2['id']||0x0;this['name']=_0x2160f2[_0x2fb2('0x0')]||'';this['type']=_0x2160f2[_0x2fb2('0x1')]||_0x2fb2('0x2');this['originated']=0x0;this[_0x2fb2('0x3')]=0x0;this[_0x2fb2('0x4')]=0x0;this[_0x2fb2('0x5')]=0x0;this[_0x2fb2('0x6')]='';this['sendMessageOneNotActive']=!![];this[_0x2fb2('0x7')]=_0x2160f2['active'];this[_0x2fb2('0x8')]=_0x2160f2[_0x2fb2('0x8')];this[_0x2fb2('0x9')]=_0x2160f2['dialTimezone']||null;this[_0x2fb2('0xa')]=_0x2160f2[_0x2fb2('0xa')]?_0x2160f2[_0x2fb2('0xa')]:null;this[_0x2fb2('0xb')]=_0x2160f2['dialOriginateCallerIdName'];this['dialOriginateCallerIdNumber']=_0x2160f2[_0x2fb2('0xc')];this[_0x2fb2('0xd')]=_0x2160f2[_0x2fb2('0xd')]||0x1e;this[_0x2fb2('0xe')]=_0x2160f2[_0x2fb2('0xe')];this[_0x2fb2('0xf')]=_0x2160f2[_0x2fb2('0xf')];this[_0x2fb2('0x10')]=_0x2160f2[_0x2fb2('0x10')];this['dialBusyRetryFrequency']=_0x2160f2[_0x2fb2('0x11')];this['dialNoAnswerMaxRetry']=_0x2160f2['dialNoAnswerMaxRetry'];this[_0x2fb2('0x12')]=_0x2160f2[_0x2fb2('0x12')];this[_0x2fb2('0x13')]=_0x2160f2[_0x2fb2('0x13')];this[_0x2fb2('0x14')]=_0x2160f2[_0x2fb2('0x14')]||0x3;this[_0x2fb2('0x15')]=_0x2160f2[_0x2fb2('0x15')]||0x96;this[_0x2fb2('0x16')]=_0x2160f2[_0x2fb2('0x16')]||0x3;this[_0x2fb2('0x17')]=_0x2160f2['dialDropRetryFrequency']||0x96;this[_0x2fb2('0x18')]=_0x2160f2[_0x2fb2('0x18')]||0x3;this[_0x2fb2('0x19')]=_0x2160f2['dialAbandonedRetryFrequency']||0x96;this[_0x2fb2('0x1a')]=_0x2160f2['dialMachineMaxRetry']||0x3;this[_0x2fb2('0x1b')]=_0x2160f2[_0x2fb2('0x1b')]||0x96;this[_0x2fb2('0x1c')]=_0x2160f2[_0x2fb2('0x1c')]||0x3;this['dialAgentRejectRetryFrequency']=_0x2160f2['dialAgentRejectRetryFrequency']||0x96;this[_0x2fb2('0x1d')]=_0x2160f2[_0x2fb2('0x1d')]||'DESC';this[_0x2fb2('0x1e')]=_0x2160f2[_0x2fb2('0x1e')]||undefined;this[_0x2fb2('0x1f')]=_0x2160f2['dialRandomLastDigitCallerIdNumber']||undefined;this[_0x2fb2('0x20')]=_0x2160f2[_0x2fb2('0x20')]||undefined;this[_0x2fb2('0x21')]=_0x2160f2[_0x2fb2('0x21')]?_0x2160f2[_0x2fb2('0x21')]:undefined;this['Trunk']=_0x2160f2['Trunk']?_0x2160f2[_0x2fb2('0x22')]:undefined;this[_0x2fb2('0x23')]=_0x2160f2[_0x2fb2('0x23')]?_0x2160f2['Interval']:undefined;this[_0x2fb2('0x24')]=_0x2160f2[_0x2fb2('0x24')]?_0x2160f2[_0x2fb2('0x24')]:undefined;this['dialQueueProject']=_0x2160f2['SquareProject']?_0x2160f2[_0x2fb2('0x24')][_0x2fb2('0x0')]:undefined;this['dialAMDActive']=_0x2160f2[_0x2fb2('0x25')]||![];this['dialAMDInitialSilence']=_0x2160f2[_0x2fb2('0x26')];this[_0x2fb2('0x27')]=_0x2160f2[_0x2fb2('0x27')];this[_0x2fb2('0x28')]=_0x2160f2[_0x2fb2('0x28')];this['dialAMDTotalAnalysisTime']=_0x2160f2[_0x2fb2('0x29')];this[_0x2fb2('0x2a')]=_0x2160f2['dialAMDMinWordLength'];this['dialAMDBetweenWordsSilence']=_0x2160f2[_0x2fb2('0x2b')];this[_0x2fb2('0x2c')]=_0x2160f2[_0x2fb2('0x2c')];this[_0x2fb2('0x2d')]=_0x2160f2[_0x2fb2('0x2d')];this[_0x2fb2('0x2e')]=_0x2160f2['dialAMDMaximumWordLength'];}module['exports']=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index 7f35d46..380aee0 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 _0x3166=['calleridnum','connectedlinenum','connectedlinename','context','uniqueid','exten','answered','answertime','endtime','abandoned','lastapplication','duration','billableseconds','holdtime','type','tag','disposition','monitor','monitorFilename','queue','monitors','transfercalleridnum','transferType','mohtime','exports','channel','destinationchannel'];(function(_0x263825,_0x35839f){var _0x248be7=function(_0x2de741){while(--_0x2de741){_0x263825['push'](_0x263825['shift']());}};_0x248be7(++_0x35839f);}(_0x3166,0xbb));var _0x6316=function(_0x8967aa,_0x121b24){_0x8967aa=_0x8967aa-0x0;var _0x294056=_0x3166[_0x8967aa];return _0x294056;};'use strict';function Channel(){this['starttime']=null;this[_0x6316('0x0')]='';this[_0x6316('0x1')]='';this[_0x6316('0x2')]=0x0;this['calleridname']='';this[_0x6316('0x3')]=undefined;this[_0x6316('0x4')]=undefined;this['accountcode']=0x0;this[_0x6316('0x5')]='';this[_0x6316('0x6')]=0x0;this['linkedid']=0x0;this[_0x6316('0x7')]=0x0;this[_0x6316('0x8')]=![];this[_0x6316('0x9')]=null;this[_0x6316('0xa')]=null;this['unmanaged']=![];this[_0x6316('0xb')]=![];this[_0x6316('0xc')]='';this['lastdata']='';this[_0x6316('0xd')]=0x0;this[_0x6316('0xe')]=0x0;this[_0x6316('0xf')]=0x0;this[_0x6316('0x10')]=null;this[_0x6316('0x11')]=null;this[_0x6316('0x12')]=null;this[_0x6316('0x13')]=![];this[_0x6316('0x14')]=null;this[_0x6316('0x15')]=null;this[_0x6316('0x16')]=[];this[_0x6316('0x17')]=undefined;this['transferconnectedlinenum']=undefined;this[_0x6316('0x18')]=undefined;this[_0x6316('0x19')]=0x0;}module[_0x6316('0x1a')]=Channel; \ No newline at end of file +var _0xb366=['billableseconds','type','tag','monitor','queue','monitors','transfercalleridnum','transferconnectedlinenum','transferType','mohtime','starttime','destinationchannel','calleridnum','connectedlinenum','connectedlinename','accountcode','exten','answered','endtime','lastapplication','lastdata','duration'];(function(_0x3d6173,_0x477089){var _0x3150de=function(_0x37ddd6){while(--_0x37ddd6){_0x3d6173['push'](_0x3d6173['shift']());}};_0x3150de(++_0x477089);}(_0xb366,0xa4));var _0x6b36=function(_0x2f2e3f,_0x902203){_0x2f2e3f=_0x2f2e3f-0x0;var _0x2bb971=_0xb366[_0x2f2e3f];return _0x2bb971;};'use strict';function Channel(){this[_0x6b36('0x0')]=null;this['channel']='';this[_0x6b36('0x1')]='';this[_0x6b36('0x2')]=0x0;this['calleridname']='';this[_0x6b36('0x3')]=undefined;this[_0x6b36('0x4')]=undefined;this[_0x6b36('0x5')]=0x0;this['context']='';this['uniqueid']=0x0;this['linkedid']=0x0;this[_0x6b36('0x6')]=0x0;this[_0x6b36('0x7')]=![];this['answertime']=null;this[_0x6b36('0x8')]=null;this['unmanaged']=![];this['abandoned']=![];this[_0x6b36('0x9')]='';this[_0x6b36('0xa')]='';this[_0x6b36('0xb')]=0x0;this[_0x6b36('0xc')]=0x0;this['holdtime']=0x0;this[_0x6b36('0xd')]=null;this[_0x6b36('0xe')]=null;this['disposition']=null;this[_0x6b36('0xf')]=![];this['monitorFilename']=null;this[_0x6b36('0x10')]=null;this[_0x6b36('0x11')]=[];this[_0x6b36('0x12')]=undefined;this[_0x6b36('0x13')]=undefined;this[_0x6b36('0x14')]=undefined;this[_0x6b36('0x15')]=0x0;}module['exports']=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index bc59e9b..a5d274a 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 _0xd43a=['username','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','exports','name'];(function(_0x3349ac,_0x889beb){var _0x18d071=function(_0x2993d3){while(--_0x2993d3){_0x3349ac['push'](_0x3349ac['shift']());}};_0x18d071(++_0x889beb);}(_0xd43a,0x1d3));var _0xad43=function(_0x520778,_0x3e0b30){_0x520778=_0x520778-0x0;var _0x4edf1c=_0xd43a[_0x520778];return _0x4edf1c;};'use strict';function DeskAccount(_0x59fc59){this['id']=_0x59fc59['id']||0x0;this['name']=_0x59fc59[_0xad43('0x0')]||'';this[_0xad43('0x1')]=_0x59fc59[_0xad43('0x1')]||'';this[_0xad43('0x2')]=_0x59fc59[_0xad43('0x2')]||'';this[_0xad43('0x3')]=_0x59fc59[_0xad43('0x3')]||'';this[_0xad43('0x4')]=_0x59fc59['password']||'';this[_0xad43('0x5')]=_0x59fc59[_0xad43('0x5')]||'';this[_0xad43('0x6')]=_0x59fc59[_0xad43('0x6')]||'';this[_0xad43('0x7')]=_0x59fc59[_0xad43('0x7')]||'';this[_0xad43('0x8')]=_0x59fc59[_0xad43('0x8')]||'';this[_0xad43('0x9')]=_0x59fc59[_0xad43('0x9')]||'';this['serverUrl']=_0x59fc59[_0xad43('0xa')]||'';this[_0xad43('0xb')]=_0x59fc59[_0xad43('0xb')]||{};}module[_0xad43('0xc')]=DeskAccount; \ No newline at end of file +var _0xecaa=['remoteUri','authType','password','consumerKey','consumerSecret','token','type','serverUrl','Configurations','exports','name','username'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xecaa,0x12a));var _0xaeca=function(_0x454745,_0x4660b0){_0x454745=_0x454745-0x0;var _0x3d1c66=_0xecaa[_0x454745];return _0x3d1c66;};'use strict';function DeskAccount(_0x2be3cf){this['id']=_0x2be3cf['id']||0x0;this[_0xaeca('0x0')]=_0x2be3cf[_0xaeca('0x0')]||'';this[_0xaeca('0x1')]=_0x2be3cf[_0xaeca('0x1')]||'';this['remoteUri']=_0x2be3cf[_0xaeca('0x2')]||'';this['authType']=_0x2be3cf[_0xaeca('0x3')]||'';this[_0xaeca('0x4')]=_0x2be3cf[_0xaeca('0x4')]||'';this[_0xaeca('0x5')]=_0x2be3cf[_0xaeca('0x5')]||'';this[_0xaeca('0x6')]=_0x2be3cf[_0xaeca('0x6')]||'';this['token']=_0x2be3cf[_0xaeca('0x7')]||'';this['tokenSecret']=_0x2be3cf['tokenSecret']||'';this[_0xaeca('0x8')]=_0x2be3cf['type']||'';this[_0xaeca('0x9')]=_0x2be3cf['serverUrl']||'';this[_0xaeca('0xa')]=_0x2be3cf[_0xaeca('0xa')]||{};}module[_0xaeca('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 0548ae5..be3e434 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 _0x4483=['tenantId','clientId','clientSecret','serverUrl','Configurations','name','username','password','remoteUri'];(function(_0x222b40,_0x2732f3){var _0x552e4d=function(_0x4d3357){while(--_0x4d3357){_0x222b40['push'](_0x222b40['shift']());}};_0x552e4d(++_0x2732f3);}(_0x4483,0x1a3));var _0x3448=function(_0x321034,_0xe74f81){_0x321034=_0x321034-0x0;var _0x5dd632=_0x4483[_0x321034];return _0x5dd632;};'use strict';function Dynamics365Account(_0x43f30d){this['id']=_0x43f30d['id']||0x0;this[_0x3448('0x0')]=_0x43f30d[_0x3448('0x0')]||'';this['username']=_0x43f30d[_0x3448('0x1')]||'';this[_0x3448('0x2')]=_0x43f30d[_0x3448('0x2')]||'';this[_0x3448('0x3')]=_0x43f30d[_0x3448('0x3')]||'';this['tenantId']=_0x43f30d[_0x3448('0x4')]||'';this[_0x3448('0x5')]=_0x43f30d[_0x3448('0x5')]||'';this[_0x3448('0x6')]=_0x43f30d[_0x3448('0x6')]||{};this[_0x3448('0x7')]=_0x43f30d[_0x3448('0x7')]||'';this[_0x3448('0x8')]=_0x43f30d['Configurations']||{};}module['exports']=Dynamics365Account; \ No newline at end of file +var _0x0bb5=['clientId','clientSecret','serverUrl','Configurations','name','username','password','remoteUri','tenantId'];(function(_0x307d80,_0x2b74e7){var _0x47b263=function(_0x3a0986){while(--_0x3a0986){_0x307d80['push'](_0x307d80['shift']());}};_0x47b263(++_0x2b74e7);}(_0x0bb5,0x148));var _0x50bb=function(_0x85493d,_0x20b077){_0x85493d=_0x85493d-0x0;var _0x43a1ac=_0x0bb5[_0x85493d];return _0x43a1ac;};'use strict';function Dynamics365Account(_0x4878e5){this['id']=_0x4878e5['id']||0x0;this[_0x50bb('0x0')]=_0x4878e5['name']||'';this['username']=_0x4878e5[_0x50bb('0x1')]||'';this[_0x50bb('0x2')]=_0x4878e5[_0x50bb('0x2')]||'';this[_0x50bb('0x3')]=_0x4878e5[_0x50bb('0x3')]||'';this[_0x50bb('0x4')]=_0x4878e5[_0x50bb('0x4')]||'';this[_0x50bb('0x5')]=_0x4878e5['clientId']||'';this['clientSecret']=_0x4878e5[_0x50bb('0x6')]||{};this[_0x50bb('0x7')]=_0x4878e5[_0x50bb('0x7')]||'';this[_0x50bb('0x8')]=_0x4878e5['Configurations']||{};}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 5a9a619..76222ab 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 _0x3f02=['tech','SIP','Trunk','ListId','key','exports','name','description','ecm','headerinfo','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout'];(function(_0x199b64,_0x5d1120){var _0x42b220=function(_0x26d4e6){while(--_0x26d4e6){_0x199b64['push'](_0x199b64['shift']());}};_0x42b220(++_0x5d1120);}(_0x3f02,0x116));var _0x23f0=function(_0x3d00db,_0x3692b3){_0x3d00db=_0x3d00db-0x0;var _0x41f115=_0x3f02[_0x3d00db];return _0x41f115;};'use strict';function FaxAccount(_0x4f8f1b){this['id']=_0x4f8f1b['id']||0x0;this[_0x23f0('0x0')]=_0x4f8f1b[_0x23f0('0x0')]||'';this[_0x23f0('0x1')]=_0x4f8f1b['description'];this[_0x23f0('0x2')]=_0x4f8f1b[_0x23f0('0x2')];this[_0x23f0('0x3')]=_0x4f8f1b[_0x23f0('0x3')];this['localstationid']=_0x4f8f1b['localstationid'];this[_0x23f0('0x4')]=_0x4f8f1b[_0x23f0('0x4')]||0x960;this['maxrate']=_0x4f8f1b[_0x23f0('0x5')]||0x3840;this[_0x23f0('0x6')]=_0x4f8f1b[_0x23f0('0x6')]||_0x23f0('0x7');this[_0x23f0('0x8')]=_0x4f8f1b[_0x23f0('0x8')]||'no';this[_0x23f0('0x9')]=_0x4f8f1b[_0x23f0('0x9')]||'no';this[_0x23f0('0xa')]=_0x4f8f1b[_0x23f0('0xa')]||0x1388;this[_0x23f0('0xb')]=_0x4f8f1b['tech']||_0x23f0('0xc');this[_0x23f0('0xd')]=_0x4f8f1b[_0x23f0('0xd')]?_0x4f8f1b[_0x23f0('0xd')]:undefined;this[_0x23f0('0xe')]=_0x4f8f1b[_0x23f0('0xe')];this[_0x23f0('0xf')]=_0x4f8f1b[_0x23f0('0xf')];}module[_0x23f0('0x10')]=FaxAccount; \ No newline at end of file +var _0x5fa5=['t38timeout','tech','SIP','Trunk','ListId','key','exports','name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect'];(function(_0xa98302,_0x844f27){var _0x1ad8e3=function(_0x57e51d){while(--_0x57e51d){_0xa98302['push'](_0xa98302['shift']());}};_0x1ad8e3(++_0x844f27);}(_0x5fa5,0x139));var _0x55fa=function(_0x342baa,_0x4a110f){_0x342baa=_0x342baa-0x0;var _0x1208f3=_0x5fa5[_0x342baa];return _0x1208f3;};'use strict';function FaxAccount(_0x225eeb){this['id']=_0x225eeb['id']||0x0;this['name']=_0x225eeb[_0x55fa('0x0')]||'';this[_0x55fa('0x1')]=_0x225eeb[_0x55fa('0x1')];this[_0x55fa('0x2')]=_0x225eeb['ecm'];this[_0x55fa('0x3')]=_0x225eeb[_0x55fa('0x3')];this['localstationid']=_0x225eeb[_0x55fa('0x4')];this[_0x55fa('0x5')]=_0x225eeb['minrate']||0x960;this[_0x55fa('0x6')]=_0x225eeb[_0x55fa('0x6')]||0x3840;this[_0x55fa('0x7')]=_0x225eeb[_0x55fa('0x7')]||_0x55fa('0x8');this[_0x55fa('0x9')]=_0x225eeb[_0x55fa('0x9')]||'no';this[_0x55fa('0xa')]=_0x225eeb[_0x55fa('0xa')]||'no';this[_0x55fa('0xb')]=_0x225eeb[_0x55fa('0xb')]||0x1388;this[_0x55fa('0xc')]=_0x225eeb[_0x55fa('0xc')]||_0x55fa('0xd');this[_0x55fa('0xe')]=_0x225eeb[_0x55fa('0xe')]?_0x225eeb[_0x55fa('0xe')]:undefined;this[_0x55fa('0xf')]=_0x225eeb[_0x55fa('0xf')];this[_0x55fa('0x10')]=_0x225eeb[_0x55fa('0x10')];}module[_0x55fa('0x11')]=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index b8c6037..203ad19 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 _0x203c=['Configurations','username','apiKey','token','remoteUri'];(function(_0x1aedc1,_0x5817b4){var _0x3284fa=function(_0x2ee98c){while(--_0x2ee98c){_0x1aedc1['push'](_0x1aedc1['shift']());}};_0x3284fa(++_0x5817b4);}(_0x203c,0x187));var _0xc203=function(_0x41ac41,_0x25bc79){_0x41ac41=_0x41ac41-0x0;var _0x16eccf=_0x203c[_0x41ac41];return _0x16eccf;};'use strict';function FreshdeskAccount(_0x1f5382){this['id']=_0x1f5382['id']||0x0;this['name']=_0x1f5382['name']||'';this[_0xc203('0x0')]=_0x1f5382[_0xc203('0x0')]||'';this[_0xc203('0x1')]=_0x1f5382[_0xc203('0x2')]||'';this['remoteUri']=_0x1f5382[_0xc203('0x3')]||'';this['serverUrl']=_0x1f5382['serverUrl']||'';this[_0xc203('0x4')]=_0x1f5382[_0xc203('0x4')]||{};}module['exports']=FreshdeskAccount; \ No newline at end of file +var _0xf7b9=['token','remoteUri','serverUrl','Configurations','exports','name','apiKey'];(function(_0x15e3ba,_0x64a7b){var _0x48040b=function(_0x4681ae){while(--_0x4681ae){_0x15e3ba['push'](_0x15e3ba['shift']());}};_0x48040b(++_0x64a7b);}(_0xf7b9,0x14e));var _0x9f7b=function(_0x4a3798,_0xe5575d){_0x4a3798=_0x4a3798-0x0;var _0x13e166=_0xf7b9[_0x4a3798];return _0x13e166;};'use strict';function FreshdeskAccount(_0x29dab9){this['id']=_0x29dab9['id']||0x0;this[_0x9f7b('0x0')]=_0x29dab9[_0x9f7b('0x0')]||'';this['username']=_0x29dab9['username']||'';this[_0x9f7b('0x1')]=_0x29dab9[_0x9f7b('0x2')]||'';this[_0x9f7b('0x3')]=_0x29dab9[_0x9f7b('0x3')]||'';this[_0x9f7b('0x4')]=_0x29dab9[_0x9f7b('0x4')]||'';this[_0x9f7b('0x5')]=_0x29dab9['Configurations']||{};}module[_0x9f7b('0x6')]=FreshdeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshsalesAccount.js b/server/services/ami/model/freshsalesAccount.js index a793eee..13f1e4c 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 _0xcf12=['apiKey','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x4ddd1e,_0x2987de){var _0x492392=function(_0x30400c){while(--_0x30400c){_0x4ddd1e['push'](_0x4ddd1e['shift']());}};_0x492392(++_0x2987de);}(_0xcf12,0x140));var _0x2cf1=function(_0x59b2f4,_0x2a3145){_0x59b2f4=_0x59b2f4-0x0;var _0x18a176=_0xcf12[_0x59b2f4];return _0x18a176;};'use strict';function FreshsalesAccount(_0x17b07d){this['id']=_0x17b07d['id']||0x0;this[_0x2cf1('0x0')]=_0x17b07d['name']||'';this[_0x2cf1('0x1')]=_0x17b07d[_0x2cf1('0x1')]||'';this[_0x2cf1('0x2')]=_0x17b07d['token']||'';this[_0x2cf1('0x3')]=_0x17b07d[_0x2cf1('0x3')]||'';this[_0x2cf1('0x4')]=_0x17b07d[_0x2cf1('0x4')]||'';this[_0x2cf1('0x5')]=_0x17b07d[_0x2cf1('0x5')]||{};}module[_0x2cf1('0x6')]=FreshsalesAccount; \ No newline at end of file +var _0x50d0=['exports','name','username','apiKey','token','remoteUri','serverUrl','Configurations'];(function(_0x2abaae,_0x29fd8b){var _0x5b5745=function(_0x2f6218){while(--_0x2f6218){_0x2abaae['push'](_0x2abaae['shift']());}};_0x5b5745(++_0x29fd8b);}(_0x50d0,0x101));var _0x050d=function(_0xb015af,_0x3f524e){_0xb015af=_0xb015af-0x0;var _0x145112=_0x50d0[_0xb015af];return _0x145112;};'use strict';function FreshsalesAccount(_0x2fa8bc){this['id']=_0x2fa8bc['id']||0x0;this['name']=_0x2fa8bc[_0x050d('0x0')]||'';this[_0x050d('0x1')]=_0x2fa8bc[_0x050d('0x1')]||'';this[_0x050d('0x2')]=_0x2fa8bc[_0x050d('0x3')]||'';this['remoteUri']=_0x2fa8bc[_0x050d('0x4')]||'';this[_0x050d('0x5')]=_0x2fa8bc[_0x050d('0x5')]||'';this[_0x050d('0x6')]=_0x2fa8bc[_0x050d('0x6')]||{};}module[_0x050d('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 de32fb1..0f363df 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 _0x2f2b=['type','inbound','uniqueid','calleridname','queuecallerjoinAt','queuecallerleaveAt','position','queuecallerabandon','queuecallerabandonAt','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','originalposition','channel','connectedlinenum','connectedlinename','exten','priority','holdtime','assigned','motionChannel','voice','mohtime'];(function(_0x201098,_0x146ef6){var _0x543233=function(_0x578f8f){while(--_0x578f8f){_0x201098['push'](_0x201098['shift']());}};_0x543233(++_0x146ef6);}(_0x2f2b,0xe6));var _0xb2f2=function(_0x4677e8,_0x189a39){_0x4677e8=_0x4677e8-0x0;var _0x489280=_0x2f2b[_0x4677e8];return _0x489280;};'use strict';function QueueReport(){this[_0xb2f2('0x0')]=_0xb2f2('0x1');this[_0xb2f2('0x2')]='';this['calleridnum']='';this[_0xb2f2('0x3')]='';this['queue']='';this[_0xb2f2('0x4')]=null;this[_0xb2f2('0x5')]=null;this[_0xb2f2('0x6')]=0x1;this['count']=0x1;this[_0xb2f2('0x7')]=![];this[_0xb2f2('0x8')]=null;this['queuecallercomplete']=![];this[_0xb2f2('0x9')]=null;this[_0xb2f2('0xa')]=![];this[_0xb2f2('0xb')]=null;this[_0xb2f2('0xc')]=0x1;this[_0xb2f2('0xd')]='';this[_0xb2f2('0xe')]='';this[_0xb2f2('0xf')]='';this['accountcode']='';this['context']='';this[_0xb2f2('0x10')]='';this[_0xb2f2('0x11')]='';this[_0xb2f2('0x12')]=0x0;this[_0xb2f2('0x13')]=![];this['lastAssignedTo']='';this[_0xb2f2('0x14')]=_0xb2f2('0x15');this[_0xb2f2('0x16')]=0x0;this['variables']={};}module['exports']=QueueReport; \ No newline at end of file +var _0xc4d9=['exports','type','inbound','calleridnum','calleridname','queue','queuecallerleaveAt','count','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallerexit','queuecallerexitAt','originalposition','channel','connectedlinenum','connectedlinename','accountcode','context','exten','priority','holdtime','lastAssignedTo','voice','mohtime'];(function(_0x44ae0b,_0x3e9865){var _0x69232a=function(_0x5ae588){while(--_0x5ae588){_0x44ae0b['push'](_0x44ae0b['shift']());}};_0x69232a(++_0x3e9865);}(_0xc4d9,0xb0));var _0x9c4d=function(_0x3acdab,_0x3c8b0e){_0x3acdab=_0x3acdab-0x0;var _0x2085e3=_0xc4d9[_0x3acdab];return _0x2085e3;};'use strict';function QueueReport(){this[_0x9c4d('0x0')]=_0x9c4d('0x1');this['uniqueid']='';this[_0x9c4d('0x2')]='';this[_0x9c4d('0x3')]='';this[_0x9c4d('0x4')]='';this['queuecallerjoinAt']=null;this[_0x9c4d('0x5')]=null;this['position']=0x1;this[_0x9c4d('0x6')]=0x1;this[_0x9c4d('0x7')]=![];this[_0x9c4d('0x8')]=null;this[_0x9c4d('0x9')]=![];this['queuecallercompleteAt']=null;this[_0x9c4d('0xa')]=![];this[_0x9c4d('0xb')]=null;this[_0x9c4d('0xc')]=0x1;this[_0x9c4d('0xd')]='';this[_0x9c4d('0xe')]='';this[_0x9c4d('0xf')]='';this[_0x9c4d('0x10')]='';this[_0x9c4d('0x11')]='';this[_0x9c4d('0x12')]='';this[_0x9c4d('0x13')]='';this[_0x9c4d('0x14')]=0x0;this['assigned']=![];this[_0x9c4d('0x15')]='';this['motionChannel']=_0x9c4d('0x16');this[_0x9c4d('0x17')]=0x0;this['variables']={};}module[_0x9c4d('0x18')]=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index 2f47985..93f3d0c 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 _0x5e6c=['serverUrl','Configurations','exports','name','username','password','clientId','clientSecret','securityToken','type','integrationTab'];(function(_0x53a26e,_0x1bfaf6){var _0x10cc83=function(_0x1d1f3c){while(--_0x1d1f3c){_0x53a26e['push'](_0x53a26e['shift']());}};_0x10cc83(++_0x1bfaf6);}(_0x5e6c,0x1dc));var _0xc5e6=function(_0x45b2a2,_0x25331f){_0x45b2a2=_0x45b2a2-0x0;var _0x157350=_0x5e6c[_0x45b2a2];return _0x157350;};'use strict';function SalesforceAccount(_0x41cc0c){this['id']=_0x41cc0c['id']||0x0;this[_0xc5e6('0x0')]=_0x41cc0c[_0xc5e6('0x0')]||'';this['username']=_0x41cc0c[_0xc5e6('0x1')]||'';this['remoteUri']=_0x41cc0c['remoteUri']||'';this['password']=_0x41cc0c[_0xc5e6('0x2')]||'';this[_0xc5e6('0x3')]=_0x41cc0c['clientId']||'';this[_0xc5e6('0x4')]=_0x41cc0c['clientSecret']||'';this[_0xc5e6('0x5')]=_0x41cc0c[_0xc5e6('0x5')]||'';this['type']=_0x41cc0c[_0xc5e6('0x6')]||_0xc5e6('0x7');this[_0xc5e6('0x8')]=_0x41cc0c[_0xc5e6('0x8')]||'';this[_0xc5e6('0x9')]=_0x41cc0c[_0xc5e6('0x9')]||{};}module[_0xc5e6('0xa')]=SalesforceAccount; \ No newline at end of file +var _0xaeb3=['clientId','clientSecret','type','integrationTab','serverUrl','Configurations','name','username','remoteUri','password'];(function(_0x2e7a91,_0x29206a){var _0x228a36=function(_0x4c1a4d){while(--_0x4c1a4d){_0x2e7a91['push'](_0x2e7a91['shift']());}};_0x228a36(++_0x29206a);}(_0xaeb3,0x128));var _0x3aeb=function(_0x3d2ac7,_0x370d0d){_0x3d2ac7=_0x3d2ac7-0x0;var _0x5e1d92=_0xaeb3[_0x3d2ac7];return _0x5e1d92;};'use strict';function SalesforceAccount(_0x283017){this['id']=_0x283017['id']||0x0;this[_0x3aeb('0x0')]=_0x283017[_0x3aeb('0x0')]||'';this['username']=_0x283017[_0x3aeb('0x1')]||'';this[_0x3aeb('0x2')]=_0x283017[_0x3aeb('0x2')]||'';this[_0x3aeb('0x3')]=_0x283017[_0x3aeb('0x3')]||'';this[_0x3aeb('0x4')]=_0x283017[_0x3aeb('0x4')]||'';this[_0x3aeb('0x5')]=_0x283017[_0x3aeb('0x5')]||'';this['securityToken']=_0x283017['securityToken']||'';this[_0x3aeb('0x6')]=_0x283017['type']||_0x3aeb('0x7');this[_0x3aeb('0x8')]=_0x283017[_0x3aeb('0x8')]||'';this[_0x3aeb('0x9')]=_0x283017[_0x3aeb('0x9')]||{};}module['exports']=SalesforceAccount; \ No newline at end of file diff --git a/server/services/ami/model/servicenowAccount.js b/server/services/ami/model/servicenowAccount.js index bc92bba..9fd808a 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 _0xdecb=['name','username','password','remoteUri','serverUrl','Configurations'];(function(_0xd2b0b1,_0x13acf0){var _0x1a8303=function(_0x35cb82){while(--_0x35cb82){_0xd2b0b1['push'](_0xd2b0b1['shift']());}};_0x1a8303(++_0x13acf0);}(_0xdecb,0x1d4));var _0xbdec=function(_0x34cde5,_0x1e4e45){_0x34cde5=_0x34cde5-0x0;var _0x1451e1=_0xdecb[_0x34cde5];return _0x1451e1;};'use strict';function ServicenowAccount(_0x185f89){this['id']=_0x185f89['id']||0x0;this[_0xbdec('0x0')]=_0x185f89['name']||'';this[_0xbdec('0x1')]=_0x185f89[_0xbdec('0x1')]||'';this['password']=_0x185f89[_0xbdec('0x2')]||'';this['remoteUri']=_0x185f89[_0xbdec('0x3')]||'';this[_0xbdec('0x4')]=_0x185f89[_0xbdec('0x4')]||'';this[_0xbdec('0x5')]=_0x185f89[_0xbdec('0x5')]||{};}module['exports']=ServicenowAccount; \ No newline at end of file +var _0x6a88=['name','username','password','serverUrl','Configurations','exports'];(function(_0x388b47,_0x5cdac5){var _0x4859df=function(_0x466a16){while(--_0x466a16){_0x388b47['push'](_0x388b47['shift']());}};_0x4859df(++_0x5cdac5);}(_0x6a88,0xc6));var _0x86a8=function(_0x2416b9,_0x313d5d){_0x2416b9=_0x2416b9-0x0;var _0x9eefeb=_0x6a88[_0x2416b9];return _0x9eefeb;};'use strict';function ServicenowAccount(_0x75f6e){this['id']=_0x75f6e['id']||0x0;this[_0x86a8('0x0')]=_0x75f6e[_0x86a8('0x0')]||'';this[_0x86a8('0x1')]=_0x75f6e['username']||'';this[_0x86a8('0x2')]=_0x75f6e[_0x86a8('0x2')]||'';this['remoteUri']=_0x75f6e['remoteUri']||'';this[_0x86a8('0x3')]=_0x75f6e[_0x86a8('0x3')]||'';this[_0x86a8('0x4')]=_0x75f6e[_0x86a8('0x4')]||{};}module[_0x86a8('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 01f3749..d27cb44 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 _0x50ac=['Configurations','exports','name','username','password','remoteUri','serverUrl'];(function(_0x47623f,_0x148f3a){var _0x282ce8=function(_0x35bca1){while(--_0x35bca1){_0x47623f['push'](_0x47623f['shift']());}};_0x282ce8(++_0x148f3a);}(_0x50ac,0x1c2));var _0xc50a=function(_0x75e866,_0x30b4de){_0x75e866=_0x75e866-0x0;var _0x5e4b64=_0x50ac[_0x75e866];return _0x5e4b64;};'use strict';function SugarcrmAccount(_0x4a9f3c){this['id']=_0x4a9f3c['id']||0x0;this[_0xc50a('0x0')]=_0x4a9f3c[_0xc50a('0x0')]||'';this[_0xc50a('0x1')]=_0x4a9f3c[_0xc50a('0x1')]||'';this[_0xc50a('0x2')]=_0x4a9f3c[_0xc50a('0x2')]||'';this['remoteUri']=_0x4a9f3c[_0xc50a('0x3')]||'';this[_0xc50a('0x4')]=_0x4a9f3c[_0xc50a('0x4')]||'';this[_0xc50a('0x5')]=_0x4a9f3c[_0xc50a('0x5')]||{};}module[_0xc50a('0x6')]=SugarcrmAccount; \ No newline at end of file +var _0xc236=['serverUrl','Configurations','exports','name','username','password','remoteUri'];(function(_0x3b3cc6,_0x1a6e24){var _0x1161e4=function(_0x19cc52){while(--_0x19cc52){_0x3b3cc6['push'](_0x3b3cc6['shift']());}};_0x1161e4(++_0x1a6e24);}(_0xc236,0x1bc));var _0x6c23=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc236[_0x3dd15e];return _0x231fd0;};'use strict';function SugarcrmAccount(_0x2126e6){this['id']=_0x2126e6['id']||0x0;this[_0x6c23('0x0')]=_0x2126e6[_0x6c23('0x0')]||'';this[_0x6c23('0x1')]=_0x2126e6[_0x6c23('0x1')]||'';this[_0x6c23('0x2')]=_0x2126e6[_0x6c23('0x2')]||'';this[_0x6c23('0x3')]=_0x2126e6[_0x6c23('0x3')]||'';this[_0x6c23('0x4')]=_0x2126e6[_0x6c23('0x4')]||'';this[_0x6c23('0x5')]=_0x2126e6[_0x6c23('0x5')]||{};}module[_0x6c23('0x6')]=SugarcrmAccount; \ No newline at end of file diff --git a/server/services/ami/model/telephone.js b/server/services/ami/model/telephone.js index 620356b..07e07b6 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 _0xf660=['status','unknown','address','name','accountcode','stateTime'];(function(_0x106cfc,_0x14222a){var _0x35df80=function(_0x23ca51){while(--_0x23ca51){_0x106cfc['push'](_0x106cfc['shift']());}};_0x35df80(++_0x14222a);}(_0xf660,0x195));var _0x0f66=function(_0xa9eaa0,_0x4ba2b4){_0xa9eaa0=_0xa9eaa0-0x0;var _0x30897a=_0xf660[_0xa9eaa0];return _0x30897a;};'use strict';function Telephone(_0x4798ee){this['id']=_0x4798ee['id']||0x0;this[_0x0f66('0x0')]=_0x4798ee['name']||'';this[_0x0f66('0x1')]=_0x4798ee[_0x0f66('0x1')]||'';this['state']='unknown';this[_0x0f66('0x2')]=0x0;this[_0x0f66('0x3')]=_0x0f66('0x4');this[_0x0f66('0x5')]='';}module['exports']=Telephone; \ No newline at end of file +var _0x878f=['status','address','exports','name','accountcode','state','unknown','stateTime'];(function(_0x204d2e,_0xd433d6){var _0x2526e1=function(_0x104f53){while(--_0x104f53){_0x204d2e['push'](_0x204d2e['shift']());}};_0x2526e1(++_0xd433d6);}(_0x878f,0x173));var _0xf878=function(_0x470261,_0x339f4d){_0x470261=_0x470261-0x0;var _0xb09d0a=_0x878f[_0x470261];return _0xb09d0a;};'use strict';function Telephone(_0x51758f){this['id']=_0x51758f['id']||0x0;this[_0xf878('0x0')]=_0x51758f[_0xf878('0x0')]||'';this[_0xf878('0x1')]=_0x51758f[_0xf878('0x1')]||'';this[_0xf878('0x2')]=_0xf878('0x3');this[_0xf878('0x4')]=0x0;this[_0xf878('0x5')]=_0xf878('0x3');this[_0xf878('0x6')]='';}module[_0xf878('0x7')]=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index 1e65f78..246d4f2 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(_0x52a96c,_0x385325){var _0x67179=function(_0x47ba46){while(--_0x47ba46){_0x52a96c['push'](_0x52a96c['shift']());}};_0x67179(++_0x385325);}(_0xb10b,0x12a));var _0xbb10=function(_0x5d7686,_0x5d11b1){_0x5d7686=_0x5d7686-0x0;var _0x408ab4=_0xb10b[_0x5d7686];return _0x408ab4;};'use strict';function template(_0x13ce8d){this['id']=_0x13ce8d['id']||0x0;this['name']=_0x13ce8d[_0xbb10('0x0')]||'';this[_0xbb10('0x1')]=_0x13ce8d[_0xbb10('0x1')]||'';}module['exports']=template; \ No newline at end of file +var _0xb10b=['name','html'];(function(_0x24e053,_0x4e69c6){var _0x296942=function(_0x4d3fff){while(--_0x4d3fff){_0x24e053['push'](_0x24e053['shift']());}};_0x296942(++_0x4e69c6);}(_0xb10b,0x12a));var _0xbb10=function(_0x10cbda,_0x331fd9){_0x10cbda=_0x10cbda-0x0;var _0x10e5d8=_0xb10b[_0x10cbda];return _0x10e5d8;};'use strict';function template(_0x13ce8d){this['id']=_0x13ce8d['id']||0x0;this['name']=_0x13ce8d[_0xbb10('0x0')]||'';this[_0xbb10('0x1')]=_0x13ce8d[_0xbb10('0x1')]||'';}module['exports']=template; \ No newline at end of file diff --git a/server/services/ami/model/trigger.js b/server/services/ami/model/trigger.js index be0edf1..72e0a9a 100644 --- a/server/services/ami/model/trigger.js +++ b/server/services/ami/model/trigger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xda2d=['channel','voice','AllConditions','AnyConditions','Actions','exports','name'];(function(_0x661c2d,_0x1e597a){var _0x11d4ae=function(_0xf49680){while(--_0xf49680){_0x661c2d['push'](_0x661c2d['shift']());}};_0x11d4ae(++_0x1e597a);}(_0xda2d,0x102));var _0xdda2=function(_0x400ce7,_0x8088fa){_0x400ce7=_0x400ce7-0x0;var _0x59a996=_0xda2d[_0x400ce7];return _0x59a996;};'use strict';function Trigger(_0x2625ed){this['id']=_0x2625ed['id']||0x0;this[_0xdda2('0x0')]=_0x2625ed[_0xdda2('0x0')]||'';this[_0xdda2('0x1')]=_0x2625ed[_0xdda2('0x1')]||_0xdda2('0x2');this['status']=_0x2625ed['status']||![];this['AllConditions']=_0x2625ed[_0xdda2('0x3')]||[];this[_0xdda2('0x4')]=_0x2625ed[_0xdda2('0x4')]||[];this[_0xdda2('0x5')]=_0x2625ed[_0xdda2('0x5')]||[];}module[_0xdda2('0x6')]=Trigger; \ No newline at end of file +var _0x9ffd=['Actions','exports','name','channel','voice','status','AllConditions','AnyConditions'];(function(_0x5e6e8b,_0x40b8b9){var _0x8fd76e=function(_0x5ae90d){while(--_0x5ae90d){_0x5e6e8b['push'](_0x5e6e8b['shift']());}};_0x8fd76e(++_0x40b8b9);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x56be00,_0x2023d8){_0x56be00=_0x56be00-0x0;var _0x16653a=_0x9ffd[_0x56be00];return _0x16653a;};'use strict';function Trigger(_0x4c26a1){this['id']=_0x4c26a1['id']||0x0;this[_0xd9ff('0x0')]=_0x4c26a1[_0xd9ff('0x0')]||'';this['channel']=_0x4c26a1[_0xd9ff('0x1')]||_0xd9ff('0x2');this[_0xd9ff('0x3')]=_0x4c26a1[_0xd9ff('0x3')]||![];this['AllConditions']=_0x4c26a1[_0xd9ff('0x4')]||[];this[_0xd9ff('0x5')]=_0x4c26a1['AnyConditions']||[];this[_0xd9ff('0x6')]=_0x4c26a1[_0xd9ff('0x6')]||[];}module[_0xd9ff('0x7')]=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index 6b869fa..aa23e3d 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 _0xcf61=['domain','domainport','refresh','stateRegistry','registrationtime','defaultuser','exports','active','name','state','unknown','stateTime','status','registry','split','host','port'];(function(_0x49c5cd,_0x35259b){var _0x70e7fe=function(_0x43081c){while(--_0x43081c){_0x49c5cd['push'](_0x49c5cd['shift']());}};_0x70e7fe(++_0x35259b);}(_0xcf61,0x106));var _0x1cf6=function(_0x5776cb,_0x579eb7){_0x5776cb=_0x5776cb-0x0;var _0x46349f=_0xcf61[_0x5776cb];return _0x46349f;};'use strict';function Trunk(_0x275ea6){this['id']=_0x275ea6['id']||0x0;this[_0x1cf6('0x0')]=_0x275ea6[_0x1cf6('0x0')]||![];this['name']=_0x275ea6[_0x1cf6('0x1')]||'';this[_0x1cf6('0x2')]=_0x1cf6('0x3');this[_0x1cf6('0x4')]=0x0;this[_0x1cf6('0x5')]=_0x1cf6('0x3');this[_0x1cf6('0x6')]=_0x275ea6['registry']&&_0x275ea6['registry']['indexOf'](':')?_0x275ea6[_0x1cf6('0x6')][_0x1cf6('0x7')](':')[0x0]:'';this[_0x1cf6('0x8')]='';this[_0x1cf6('0x9')]='';this[_0x1cf6('0xa')]='';this[_0x1cf6('0xb')]='';this[_0x1cf6('0xc')]='';this[_0x1cf6('0xd')]=_0x1cf6('0x3');this[_0x1cf6('0xe')]='';this['address']='';this[_0x1cf6('0xf')]=_0x275ea6['defaultuser']||'';}module[_0x1cf6('0x10')]=Trunk; \ No newline at end of file +var _0x5b41=['domainport','refresh','stateRegistry','registrationtime','defaultuser','exports','active','name','state','stateTime','unknown','registry','split','host','domain'];(function(_0x1bbfda,_0x3f62e4){var _0x55d4b8=function(_0x5b1166){while(--_0x5b1166){_0x1bbfda['push'](_0x1bbfda['shift']());}};_0x55d4b8(++_0x3f62e4);}(_0x5b41,0x1d7));var _0x15b4=function(_0x52410d,_0x1991b4){_0x52410d=_0x52410d-0x0;var _0x1ee97b=_0x5b41[_0x52410d];return _0x1ee97b;};'use strict';function Trunk(_0x2f47d1){this['id']=_0x2f47d1['id']||0x0;this[_0x15b4('0x0')]=_0x2f47d1[_0x15b4('0x0')]||![];this[_0x15b4('0x1')]=_0x2f47d1[_0x15b4('0x1')]||'';this[_0x15b4('0x2')]='unknown';this[_0x15b4('0x3')]=0x0;this['status']=_0x15b4('0x4');this['registry']=_0x2f47d1['registry']&&_0x2f47d1[_0x15b4('0x5')]['indexOf'](':')?_0x2f47d1[_0x15b4('0x5')][_0x15b4('0x6')](':')[0x0]:'';this[_0x15b4('0x7')]='';this['port']='';this[_0x15b4('0x8')]='';this[_0x15b4('0x9')]='';this[_0x15b4('0xa')]='';this[_0x15b4('0xb')]=_0x15b4('0x4');this[_0x15b4('0xc')]='';this['address']='';this[_0x15b4('0xd')]=_0x2f47d1['defaultuser']||'';}module[_0x15b4('0xe')]=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index bcd48ec..8d5d502 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 _0x8ade=['recordingFormat','none','mandatoryDisposition','exports','exten'];(function(_0x23e776,_0x453cf4){var _0x52285a=function(_0x3cf38d){while(--_0x3cf38d){_0x23e776['push'](_0x23e776['shift']());}};_0x52285a(++_0x453cf4);}(_0x8ade,0xf9));var _0xe8ad=function(_0x56bd24,_0x2b69ca){_0x56bd24=_0x56bd24-0x0;var _0xc17683=_0x8ade[_0x56bd24];return _0xc17683;};'use strict';function voiceExtension(_0x5ab272){this['id']=_0x5ab272['id']||0x0;this[_0xe8ad('0x0')]=_0x5ab272['exten']||'';this[_0xe8ad('0x1')]=_0x5ab272[_0xe8ad('0x1')]||_0xe8ad('0x2');this[_0xe8ad('0x3')]=_0x5ab272[_0xe8ad('0x3')]||![];}module[_0xe8ad('0x4')]=voiceExtension; \ No newline at end of file +var _0x045f=['mandatoryDisposition','exten','recordingFormat'];(function(_0x20e3af,_0xe538ad){var _0x58fd76=function(_0x26e65a){while(--_0x26e65a){_0x20e3af['push'](_0x20e3af['shift']());}};_0x58fd76(++_0xe538ad);}(_0x045f,0x1e7));var _0xf045=function(_0x2d3711,_0x43d60d){_0x2d3711=_0x2d3711-0x0;var _0x477858=_0x045f[_0x2d3711];return _0x477858;};'use strict';function voiceExtension(_0x2db7fd){this['id']=_0x2db7fd['id']||0x0;this[_0xf045('0x0')]=_0x2db7fd['exten']||'';this['recordingFormat']=_0x2db7fd[_0xf045('0x1')]||'none';this[_0xf045('0x2')]=_0x2db7fd['mandatoryDisposition']||![];}module['exports']=voiceExtension; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueue.js b/server/services/ami/model/voiceQueue.js index 8daa197..e42886d 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 _0x596b=['roundrobin','name','monitor_format','type','inbound','talking','answered','sumDuration','sumBillable','unmanaged','abandoned','loggedIn','available','acwTimeout','autopause','sendMessageOneNotActive','temp','dialTimezone','dialGlobalInterval','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialCutDigit','strategy','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','pTalking','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayACS','startProgressive','startPredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','not_inuse','inuse','busy','invalid','unavailable','ringinuse','onhold','wav','wav49'];(function(_0x167c44,_0x5d7e2f){var _0x2be52b=function(_0x216d39){while(--_0x216d39){_0x167c44['push'](_0x167c44['shift']());}};_0x2be52b(++_0x5d7e2f);}(_0x596b,0xde));var _0xb596=function(_0x11c30d,_0x566175){_0x11c30d=_0x11c30d-0x0;var _0x43c1b3=_0x596b[_0x11c30d];return _0x43c1b3;};'use strict';var statusDesc=[_0xb596('0x0'),_0xb596('0x1'),_0xb596('0x2'),_0xb596('0x3'),_0xb596('0x4'),_0xb596('0x5'),'ringing',_0xb596('0x6'),_0xb596('0x7')];var monitorFormat={'wav':_0xb596('0x8'),'wav49':_0xb596('0x9'),'gsm':'gsm'};var strategy={'rrmemory':'rrmemory','roundrobin':_0xb596('0xa')};function VoiceQueue(_0x3f3213){this['id']=_0x3f3213['id']||0x0;this[_0xb596('0xb')]=_0x3f3213[_0xb596('0xb')]||'';this[_0xb596('0xc')]=_0x3f3213[_0xb596('0xc')]||'';this['type']=_0x3f3213[_0xb596('0xd')]||_0xb596('0xe');this['waiting']=0x0;this[_0xb596('0xf')]=0x0;this['total']=0x0;this[_0xb596('0x10')]=0x0;this[_0xb596('0x11')]=0x0;this['sumHoldTime']=0x0;this[_0xb596('0x12')]=0x0;this[_0xb596('0x13')]=0x0;this[_0xb596('0x14')]=0x0;this[_0xb596('0x15')]=0x0;this[_0xb596('0x16')]=0x0;this['acw']=_0x3f3213['acw']||![];this[_0xb596('0x17')]=_0x3f3213[_0xb596('0x17')]||0xa;this['autopause']=_0x3f3213[_0xb596('0x18')]||'no';this[_0xb596('0x19')]=!![];this['message']='';this['originated']=0x0;this[_0xb596('0x1a')]=0x0;this[_0xb596('0x1b')]=_0x3f3213[_0xb596('0x1b')]||null;this['dialGlobalInterval']=_0x3f3213[_0xb596('0x1c')]?_0x3f3213[_0xb596('0x1c')]:null;this['dialActive']=_0x3f3213['dialActive'];this[_0xb596('0x1d')]=_0x3f3213['dialMethod']||_0xb596('0x1e');this[_0xb596('0x1f')]=_0x3f3213[_0xb596('0x1f')]||0x0;this['dialLimitQueue']=_0x3f3213[_0xb596('0x20')]||0x0;this[_0xb596('0x21')]=_0x3f3213[_0xb596('0x21')]||0x1;this[_0xb596('0x22')]=_0x3f3213[_0xb596('0x22')]||_0xb596('0x23');this[_0xb596('0x24')]=_0x3f3213[_0xb596('0x24')]||0.03;this[_0xb596('0x25')]=_0x3f3213['dialPredictiveInterval']||0x258;this[_0xb596('0x26')]=_0x3f3213['dialOriginateCallerIdName']||_0xb596('0x27');this['dialOriginateCallerIdNumber']=_0x3f3213[_0xb596('0x28')]||_0xb596('0x27');this[_0xb596('0x29')]=_0x3f3213[_0xb596('0x29')]||0x1e;this[_0xb596('0x2a')]=_0x3f3213[_0xb596('0x2a')]||'tTxX';this[_0xb596('0x2b')]=_0x3f3213[_0xb596('0x2b')]||0x3;this[_0xb596('0x2c')]=_0x3f3213[_0xb596('0x2c')]||undefined;this[_0xb596('0x2d')]=_0x3f3213[_0xb596('0x2d')]||0x3;this['dialCongestionRetryFrequency']=_0x3f3213[_0xb596('0x2e')]||0x96;this[_0xb596('0x2f')]=_0x3f3213[_0xb596('0x2f')]||0x3;this[_0xb596('0x30')]=_0x3f3213[_0xb596('0x30')]||0x96;this[_0xb596('0x31')]=_0x3f3213['dialNoAnswerMaxRetry']||0x3;this['dialNoAnswerRetryFrequency']=_0x3f3213[_0xb596('0x32')]||0x96;this['dialNoSuchNumberMaxRetry']=_0x3f3213[_0xb596('0x33')]||0x3;this[_0xb596('0x34')]=_0x3f3213[_0xb596('0x34')]||0x96;this[_0xb596('0x35')]=_0x3f3213[_0xb596('0x35')]||0x3;this['dialDropRetryFrequency']=_0x3f3213[_0xb596('0x36')]||0x96;this[_0xb596('0x37')]=_0x3f3213[_0xb596('0x37')]||0x3;this['dialAbandonedRetryFrequency']=_0x3f3213[_0xb596('0x38')]||0x96;this[_0xb596('0x39')]=_0x3f3213['dialMachineMaxRetry']||0x3;this[_0xb596('0x3a')]=_0x3f3213[_0xb596('0x3a')]||0x96;this[_0xb596('0x3b')]=_0x3f3213[_0xb596('0x3b')]||0x3;this[_0xb596('0x3c')]=_0x3f3213[_0xb596('0x3c')]||0x96;this[_0xb596('0x3d')]=_0x3f3213[_0xb596('0x3d')]||0x4;this[_0xb596('0x3e')]=_0x3f3213['Trunk']?_0x3f3213[_0xb596('0x3e')]:undefined;this[_0xb596('0x3f')]=_0x3f3213[_0xb596('0x3f')]?_0x3f3213['TrunkBackup']:undefined;this['dialPrefix']=_0x3f3213[_0xb596('0x40')]||undefined;this[_0xb596('0x41')]=_0x3f3213[_0xb596('0x41')]?_0x3f3213[_0xb596('0x41')]:undefined;this[_0xb596('0x42')]=_0x3f3213[_0xb596('0x42')]||_0xb596('0x43');this['dialRandomLastDigitCallerIdNumber']=_0x3f3213['dialRandomLastDigitCallerIdNumber']||undefined;this[_0xb596('0x44')]=_0x3f3213['dialCutDigit']||undefined;this[_0xb596('0x45')]=strategy[_0x3f3213[_0xb596('0x45')]]||'rrmemory';this['queueStatusComplete']=!![];this[_0xb596('0x46')]=_0x3f3213[_0xb596('0x46')]||![];this[_0xb596('0x47')]=_0x3f3213['dialAMDInitialSilence'];this[_0xb596('0x48')]=_0x3f3213['dialAMDGreeting'];this['dialAMDAfterGreetingSilence']=_0x3f3213[_0xb596('0x49')];this['dialAMDTotalAnalysisTime']=_0x3f3213['dialAMDTotalAnalysisTime'];this[_0xb596('0x4a')]=_0x3f3213[_0xb596('0x4a')];this[_0xb596('0x4b')]=_0x3f3213[_0xb596('0x4b')];this[_0xb596('0x4c')]=_0x3f3213[_0xb596('0x4c')];this[_0xb596('0x4d')]=_0x3f3213[_0xb596('0x4d')];this[_0xb596('0x4e')]=_0x3f3213[_0xb596('0x4e')];this['outboundRejectCallsDay']=0x0;this[_0xb596('0x4f')]=0x0;this['timeout']=_0x3f3213['timeout'];this[_0xb596('0x50')]=0x0;this[_0xb596('0x51')]=0x0;this['outboundNoAnswerCallsDay']=0x0;this[_0xb596('0x52')]=0x0;this[_0xb596('0x53')]=0x0;this[_0xb596('0x54')]=0x0;this[_0xb596('0x55')]=0x0;this['outboundBlacklistCallsDay']=0x0;this[_0xb596('0x56')]=0x0;this['outboundDropCallsDayCallersExit']=0x0;this[_0xb596('0x57')]=0x0;this[_0xb596('0x58')]=0x0;this['outboundReCallsDay']=0x0;this['outboundAbandonedDay']=0x0;this[_0xb596('0x59')]=undefined;this[_0xb596('0x5a')]=undefined;this['handlePredictive']=undefined;this[_0xb596('0x5b')]=1.05;this[_0xb596('0x5c')]=0x0;this[_0xb596('0x5d')]=0x0;this[_0xb596('0x5e')]=0x0;this[_0xb596('0x5f')]=0x0;this[_0xb596('0x60')]=0x0;this[_0xb596('0x61')]=0x0;this[_0xb596('0x62')]=0x0;this['predictiveIntervalAvailable']=0x0;this[_0xb596('0x63')]=_0x3f3213[_0xb596('0x64')]||0x14;this[_0xb596('0x65')]=_0x3f3213['dialPredictiveIntervalMaxThreshold']||0xa;this[_0xb596('0x66')]=0x0;this[_0xb596('0x67')]=0x0;this[_0xb596('0x68')]=0x1;this[_0xb596('0x69')]=0x0;this[_0xb596('0x6a')]=0x0;this['erlangAbandonmentRate']=0x0;this[_0xb596('0x6b')]=0x0;this[_0xb596('0x6c')]=_0x3f3213[_0xb596('0x6c')]||0x1e;this[_0xb596('0x6d')]=_0x3f3213[_0xb596('0x6d')]||![];this[_0xb596('0x6e')]=_0x3f3213[_0xb596('0x6e')]||undefined;this[_0xb596('0x6f')]=_0x3f3213[_0xb596('0x6f')]||![];this[_0xb596('0x70')]=_0x3f3213['dialAgiAfterHangupAgent']||![];this['monitor_format']=monitorFormat[_0x3f3213[_0xb596('0xc')]]?monitorFormat[_0x3f3213[_0xb596('0xc')]]:undefined;this['mandatoryDisposition']=_0x3f3213[_0xb596('0x71')]||![];this[_0xb596('0x72')]=_0x3f3213['mandatoryDispositionPause']?_0x3f3213[_0xb596('0x72')]:undefined;}module[_0xb596('0x73')]=VoiceQueue; \ No newline at end of file +var _0xe5de=['dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialCutDigit','strategy','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundAbandonedDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','invalid','unavailable','ringing','wav','gsm','rrmemory','name','monitor_format','type','inbound','waiting','talking','total','answered','sumDuration','sumBillable','unmanaged','abandoned','loggedIn','available','acw','acwTimeout','autopause','message','originated','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xe5de,0x1aa));var _0xee5d=function(_0x5b0102,_0x564511){_0x5b0102=_0x5b0102-0x0;var _0x82b8e5=_0xe5de[_0x5b0102];return _0x82b8e5;};'use strict';var statusDesc=['unknown','not_inuse','inuse','busy',_0xee5d('0x0'),_0xee5d('0x1'),_0xee5d('0x2'),'ringinuse','onhold'];var monitorFormat={'wav':_0xee5d('0x3'),'wav49':'wav49','gsm':_0xee5d('0x4')};var strategy={'rrmemory':_0xee5d('0x5'),'roundrobin':'roundrobin'};function VoiceQueue(_0x3cc634){this['id']=_0x3cc634['id']||0x0;this[_0xee5d('0x6')]=_0x3cc634[_0xee5d('0x6')]||'';this[_0xee5d('0x7')]=_0x3cc634[_0xee5d('0x7')]||'';this[_0xee5d('0x8')]=_0x3cc634[_0xee5d('0x8')]||_0xee5d('0x9');this[_0xee5d('0xa')]=0x0;this[_0xee5d('0xb')]=0x0;this[_0xee5d('0xc')]=0x0;this[_0xee5d('0xd')]=0x0;this[_0xee5d('0xe')]=0x0;this['sumHoldTime']=0x0;this[_0xee5d('0xf')]=0x0;this[_0xee5d('0x10')]=0x0;this[_0xee5d('0x11')]=0x0;this[_0xee5d('0x12')]=0x0;this[_0xee5d('0x13')]=0x0;this[_0xee5d('0x14')]=_0x3cc634['acw']||![];this[_0xee5d('0x15')]=_0x3cc634[_0xee5d('0x15')]||0xa;this[_0xee5d('0x16')]=_0x3cc634['autopause']||'no';this['sendMessageOneNotActive']=!![];this[_0xee5d('0x17')]='';this[_0xee5d('0x18')]=0x0;this['temp']=0x0;this[_0xee5d('0x19')]=_0x3cc634[_0xee5d('0x19')]||null;this['dialGlobalInterval']=_0x3cc634[_0xee5d('0x1a')]?_0x3cc634[_0xee5d('0x1a')]:null;this[_0xee5d('0x1b')]=_0x3cc634[_0xee5d('0x1b')];this[_0xee5d('0x1c')]=_0x3cc634[_0xee5d('0x1c')]||_0xee5d('0x1d');this[_0xee5d('0x1e')]=_0x3cc634[_0xee5d('0x1e')]||0x0;this[_0xee5d('0x1f')]=_0x3cc634[_0xee5d('0x1f')]||0x0;this['dialPowerLevel']=_0x3cc634[_0xee5d('0x20')]||0x1;this[_0xee5d('0x21')]=_0x3cc634['dialPredictiveOptimization']||_0xee5d('0x22');this[_0xee5d('0x23')]=_0x3cc634['dialPredictiveOptimizationPercentage']||0.03;this['dialPredictiveInterval']=_0x3cc634['dialPredictiveInterval']||0x258;this['dialOriginateCallerIdName']=_0x3cc634[_0xee5d('0x24')]||_0xee5d('0x25');this['dialOriginateCallerIdNumber']=_0x3cc634[_0xee5d('0x26')]||_0xee5d('0x25');this[_0xee5d('0x27')]=_0x3cc634[_0xee5d('0x27')]||0x1e;this[_0xee5d('0x28')]=_0x3cc634[_0xee5d('0x28')]||_0xee5d('0x29');this[_0xee5d('0x2a')]=_0x3cc634['dialQueueTimeout']||0x3;this[_0xee5d('0x2b')]=_0x3cc634[_0xee5d('0x2b')]||undefined;this[_0xee5d('0x2c')]=_0x3cc634['dialCongestionMaxRetry']||0x3;this[_0xee5d('0x2d')]=_0x3cc634['dialCongestionRetryFrequency']||0x96;this[_0xee5d('0x2e')]=_0x3cc634[_0xee5d('0x2e')]||0x3;this[_0xee5d('0x2f')]=_0x3cc634['dialBusyRetryFrequency']||0x96;this[_0xee5d('0x30')]=_0x3cc634[_0xee5d('0x30')]||0x3;this[_0xee5d('0x31')]=_0x3cc634['dialNoAnswerRetryFrequency']||0x96;this[_0xee5d('0x32')]=_0x3cc634[_0xee5d('0x32')]||0x3;this['dialNoSuchNumberRetryFrequency']=_0x3cc634[_0xee5d('0x33')]||0x96;this[_0xee5d('0x34')]=_0x3cc634['dialDropMaxRetry']||0x3;this[_0xee5d('0x35')]=_0x3cc634['dialDropRetryFrequency']||0x96;this['dialAbandonedMaxRetry']=_0x3cc634['dialAbandonedMaxRetry']||0x3;this[_0xee5d('0x36')]=_0x3cc634['dialAbandonedRetryFrequency']||0x96;this[_0xee5d('0x37')]=_0x3cc634[_0xee5d('0x37')]||0x3;this[_0xee5d('0x38')]=_0x3cc634[_0xee5d('0x38')]||0x96;this['dialAgentRejectMaxRetry']=_0x3cc634[_0xee5d('0x39')]||0x3;this[_0xee5d('0x3a')]=_0x3cc634[_0xee5d('0x3a')]||0x96;this[_0xee5d('0x3b')]=_0x3cc634[_0xee5d('0x3b')]||0x4;this[_0xee5d('0x3c')]=_0x3cc634[_0xee5d('0x3c')]?_0x3cc634[_0xee5d('0x3c')]:undefined;this['TrunkBackup']=_0x3cc634[_0xee5d('0x3d')]?_0x3cc634[_0xee5d('0x3d')]:undefined;this[_0xee5d('0x3e')]=_0x3cc634[_0xee5d('0x3e')]||undefined;this['Interval']=_0x3cc634[_0xee5d('0x3f')]?_0x3cc634['Interval']:undefined;this[_0xee5d('0x40')]=_0x3cc634[_0xee5d('0x40')]||_0xee5d('0x41');this['dialRandomLastDigitCallerIdNumber']=_0x3cc634['dialRandomLastDigitCallerIdNumber']||undefined;this['dialCutDigit']=_0x3cc634[_0xee5d('0x42')]||undefined;this['strategy']=strategy[_0x3cc634[_0xee5d('0x43')]]||_0xee5d('0x5');this['queueStatusComplete']=!![];this[_0xee5d('0x44')]=_0x3cc634[_0xee5d('0x44')]||![];this[_0xee5d('0x45')]=_0x3cc634[_0xee5d('0x45')];this[_0xee5d('0x46')]=_0x3cc634['dialAMDGreeting'];this[_0xee5d('0x47')]=_0x3cc634[_0xee5d('0x47')];this[_0xee5d('0x48')]=_0x3cc634[_0xee5d('0x48')];this[_0xee5d('0x49')]=_0x3cc634[_0xee5d('0x49')];this[_0xee5d('0x4a')]=_0x3cc634['dialAMDBetweenWordsSilence'];this[_0xee5d('0x4b')]=_0x3cc634[_0xee5d('0x4b')];this[_0xee5d('0x4c')]=_0x3cc634['dialAMDSilenceThreshold'];this[_0xee5d('0x4d')]=_0x3cc634[_0xee5d('0x4d')];this[_0xee5d('0x4e')]=0x0;this[_0xee5d('0x4f')]=0x0;this['timeout']=_0x3cc634[_0xee5d('0x50')];this[_0xee5d('0x51')]=0x0;this[_0xee5d('0x52')]=0x0;this[_0xee5d('0x53')]=0x0;this[_0xee5d('0x54')]=0x0;this['outboundCongestionCallsDay']=0x0;this[_0xee5d('0x55')]=0x0;this[_0xee5d('0x56')]=0x0;this[_0xee5d('0x57')]=0x0;this['outboundOriginateFailureCallsDay']=0x0;this[_0xee5d('0x58')]=0x0;this[_0xee5d('0x59')]=0x0;this['outboundDropCallsDayACS']=0x0;this['outboundReCallsDay']=0x0;this[_0xee5d('0x5a')]=0x0;this[_0xee5d('0x5b')]=undefined;this[_0xee5d('0x5c')]=undefined;this[_0xee5d('0x5d')]=undefined;this[_0xee5d('0x5e')]=1.05;this[_0xee5d('0x5f')]=0x0;this[_0xee5d('0x60')]=0x0;this[_0xee5d('0x61')]=0x0;this[_0xee5d('0x62')]=0x0;this[_0xee5d('0x63')]=0x0;this[_0xee5d('0x64')]=0x0;this['predictiveIntervalPauses']=0x0;this[_0xee5d('0x65')]=0x0;this[_0xee5d('0x66')]=_0x3cc634[_0xee5d('0x67')]||0x14;this[_0xee5d('0x68')]=_0x3cc634[_0xee5d('0x67')]||0xa;this[_0xee5d('0x69')]=0x0;this[_0xee5d('0x6a')]=0x0;this[_0xee5d('0x6b')]=0x1;this[_0xee5d('0x6c')]=0x0;this[_0xee5d('0x6d')]=0x0;this[_0xee5d('0x6e')]=0x0;this['erlangBusyFactor']=0x0;this[_0xee5d('0x6f')]=_0x3cc634['dialRecallMeTimeout']||0x1e;this[_0xee5d('0x70')]=_0x3cc634[_0xee5d('0x70')]||![];this[_0xee5d('0x71')]=_0x3cc634[_0xee5d('0x71')]||undefined;this[_0xee5d('0x72')]=_0x3cc634['dialAgiAfterHangupClient']||![];this['dialAgiAfterHangupAgent']=_0x3cc634[_0xee5d('0x73')]||![];this[_0xee5d('0x7')]=monitorFormat[_0x3cc634[_0xee5d('0x7')]]?monitorFormat[_0x3cc634[_0xee5d('0x7')]]:undefined;this[_0xee5d('0x74')]=_0x3cc634['mandatoryDisposition']||![];this[_0xee5d('0x75')]=_0x3cc634[_0xee5d('0x75')]?_0x3cc634[_0xee5d('0x75')]:undefined;}module['exports']=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index 30bb661..c73d005 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 _0x04f1=['name','username','accessKey','remoteUri','serverUrl','Configurations','exports'];(function(_0x4a7f4b,_0x4fe40f){var _0x312223=function(_0x3ccddd){while(--_0x3ccddd){_0x4a7f4b['push'](_0x4a7f4b['shift']());}};_0x312223(++_0x4fe40f);}(_0x04f1,0xc4));var _0x104f=function(_0x29dd3c,_0x488a2f){_0x29dd3c=_0x29dd3c-0x0;var _0x12b297=_0x04f1[_0x29dd3c];return _0x12b297;};'use strict';function VtigerAccount(_0x243df2){this['id']=_0x243df2['id']||0x0;this[_0x104f('0x0')]=_0x243df2[_0x104f('0x0')]||'';this[_0x104f('0x1')]=_0x243df2[_0x104f('0x1')]||'';this[_0x104f('0x2')]=_0x243df2[_0x104f('0x2')]||'';this[_0x104f('0x3')]=_0x243df2[_0x104f('0x3')]||'';this[_0x104f('0x4')]=_0x243df2[_0x104f('0x4')]||'';this[_0x104f('0x5')]=_0x243df2[_0x104f('0x5')]||{};}module[_0x104f('0x6')]=VtigerAccount; \ No newline at end of file +var _0x663b=['exports','name','username','accessKey','remoteUri','serverUrl','Configurations'];(function(_0x2a1883,_0x187d6e){var _0x53e421=function(_0x3664f4){while(--_0x3664f4){_0x2a1883['push'](_0x2a1883['shift']());}};_0x53e421(++_0x187d6e);}(_0x663b,0x119));var _0xb663=function(_0x1ae5ab,_0xc5d441){_0x1ae5ab=_0x1ae5ab-0x0;var _0x1ce001=_0x663b[_0x1ae5ab];return _0x1ce001;};'use strict';function VtigerAccount(_0x4b1a25){this['id']=_0x4b1a25['id']||0x0;this[_0xb663('0x0')]=_0x4b1a25[_0xb663('0x0')]||'';this['username']=_0x4b1a25[_0xb663('0x1')]||'';this[_0xb663('0x2')]=_0x4b1a25[_0xb663('0x2')]||'';this[_0xb663('0x3')]=_0x4b1a25[_0xb663('0x3')]||'';this[_0xb663('0x4')]=_0x4b1a25[_0xb663('0x4')]||'';this[_0xb663('0x5')]=_0x4b1a25[_0xb663('0x5')]||{};}module[_0xb663('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 5932883..6b17c8c 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 _0x2c6c=['name','username','password','token','remoteUri','authType','type','integrationTab','serverUrl','exports'];(function(_0x2f9340,_0x597888){var _0x347406=function(_0x419579){while(--_0x419579){_0x2f9340['push'](_0x2f9340['shift']());}};_0x347406(++_0x597888);}(_0x2c6c,0x14a));var _0xc2c6=function(_0x1e7253,_0x59e55b){_0x1e7253=_0x1e7253-0x0;var _0x9e721e=_0x2c6c[_0x1e7253];return _0x9e721e;};'use strict';function ZendeskAccount(_0x3f9cc0){this['id']=_0x3f9cc0['id']||0x0;this[_0xc2c6('0x0')]=_0x3f9cc0[_0xc2c6('0x0')]||'';this[_0xc2c6('0x1')]=_0x3f9cc0[_0xc2c6('0x1')]||'';this[_0xc2c6('0x2')]=_0x3f9cc0[_0xc2c6('0x2')]||'';this[_0xc2c6('0x3')]=_0x3f9cc0[_0xc2c6('0x3')]||'';this[_0xc2c6('0x4')]=_0x3f9cc0['remoteUri']||'';this[_0xc2c6('0x5')]=_0x3f9cc0[_0xc2c6('0x5')]||'';this[_0xc2c6('0x6')]=_0x3f9cc0['type']||_0xc2c6('0x7');this[_0xc2c6('0x8')]=_0x3f9cc0[_0xc2c6('0x8')]||'';this['Configurations']=_0x3f9cc0['Configurations']||{};}module[_0xc2c6('0x9')]=ZendeskAccount; \ No newline at end of file +var _0x6edb=['name','username','password','token','remoteUri','type','serverUrl','Configurations','exports'];(function(_0x32b650,_0x234214){var _0xb456ea=function(_0x8a844){while(--_0x8a844){_0x32b650['push'](_0x32b650['shift']());}};_0xb456ea(++_0x234214);}(_0x6edb,0x90));var _0xb6ed=function(_0x183e8a,_0x1e7a2c){_0x183e8a=_0x183e8a-0x0;var _0xc5ef3f=_0x6edb[_0x183e8a];return _0xc5ef3f;};'use strict';function ZendeskAccount(_0x4263db){this['id']=_0x4263db['id']||0x0;this['name']=_0x4263db[_0xb6ed('0x0')]||'';this['username']=_0x4263db[_0xb6ed('0x1')]||'';this[_0xb6ed('0x2')]=_0x4263db[_0xb6ed('0x2')]||'';this[_0xb6ed('0x3')]=_0x4263db['token']||'';this[_0xb6ed('0x4')]=_0x4263db[_0xb6ed('0x4')]||'';this['authType']=_0x4263db['authType']||'';this[_0xb6ed('0x5')]=_0x4263db['type']||'integrationTab';this[_0xb6ed('0x6')]=_0x4263db[_0xb6ed('0x6')]||'';this[_0xb6ed('0x7')]=_0x4263db['Configurations']||{};}module[_0xb6ed('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 b140654..296ed0b 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 _0xbc48=['serverUrl','code','refreshToken','Configurations','exports','description','host','zone','clientId','clientSecret'];(function(_0x29ad0e,_0x4d7e03){var _0x3199fd=function(_0x4e995b){while(--_0x4e995b){_0x29ad0e['push'](_0x29ad0e['shift']());}};_0x3199fd(++_0x4d7e03);}(_0xbc48,0x16d));var _0x8bc4=function(_0x5612fa,_0x4082e7){_0x5612fa=_0x5612fa-0x0;var _0x54a641=_0xbc48[_0x5612fa];return _0x54a641;};'use strict';function ZohoAccount(_0x840636){this['id']=_0x840636['id']||0x0;this['name']=_0x840636['name']||'';this[_0x8bc4('0x0')]=_0x840636[_0x8bc4('0x0')]||'';this['host']=_0x840636[_0x8bc4('0x1')]||'';this[_0x8bc4('0x2')]=_0x840636[_0x8bc4('0x2')]||'';this[_0x8bc4('0x3')]=_0x840636[_0x8bc4('0x3')]||'';this[_0x8bc4('0x4')]=_0x840636[_0x8bc4('0x4')]||'';this[_0x8bc4('0x5')]=_0x840636[_0x8bc4('0x5')]||'';this[_0x8bc4('0x6')]=_0x840636['code']||'';this[_0x8bc4('0x7')]=_0x840636['refreshToken']||'';this[_0x8bc4('0x8')]=_0x840636[_0x8bc4('0x8')]||{};}module[_0x8bc4('0x9')]=ZohoAccount; \ No newline at end of file +var _0x1592=['Configurations','name','description','host','zone','clientId','clientSecret','serverUrl','code','refreshToken'];(function(_0x38ced4,_0x24263f){var _0x547c07=function(_0x279fc4){while(--_0x279fc4){_0x38ced4['push'](_0x38ced4['shift']());}};_0x547c07(++_0x24263f);}(_0x1592,0xc9));var _0x2159=function(_0x1fa09b,_0x3cb93c){_0x1fa09b=_0x1fa09b-0x0;var _0x2805b0=_0x1592[_0x1fa09b];return _0x2805b0;};'use strict';function ZohoAccount(_0x17e64e){this['id']=_0x17e64e['id']||0x0;this[_0x2159('0x0')]=_0x17e64e[_0x2159('0x0')]||'';this[_0x2159('0x1')]=_0x17e64e[_0x2159('0x1')]||'';this[_0x2159('0x2')]=_0x17e64e['host']||'';this[_0x2159('0x3')]=_0x17e64e[_0x2159('0x3')]||'';this['clientId']=_0x17e64e[_0x2159('0x4')]||'';this[_0x2159('0x5')]=_0x17e64e[_0x2159('0x5')]||'';this[_0x2159('0x6')]=_0x17e64e[_0x2159('0x6')]||'';this[_0x2159('0x7')]=_0x17e64e[_0x2159('0x7')]||'';this['refreshToken']=_0x17e64e[_0x2159('0x8')]||'';this['Configurations']=_0x17e64e[_0x2159('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 e26d839..cc92019 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 _0xa4a7=['callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','prototype','\x22%s\x22\x20<%s>','exports','util','lodash','moment','isNil','string','uniqueid','idContact','name','type','campaigntype','queue','dialAnswer','membername','Agent','channelAgent','calleridname','Contact','phone','lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','countdropretry','callback','callbackuniqueid'];(function(_0x5fa520,_0xaf0e7d){var _0x1bf6c4=function(_0x2a7440){while(--_0x2a7440){_0x5fa520['push'](_0x5fa520['shift']());}};_0x1bf6c4(++_0xaf0e7d);}(_0xa4a7,0x12f));var _0x7a4a=function(_0x29e085,_0xa997f7){_0x29e085=_0x29e085-0x0;var _0x50c646=_0xa4a7[_0x29e085];return _0x50c646;};'use strict';var util=require(_0x7a4a('0x0'));var _=require(_0x7a4a('0x1'));var moment=require(_0x7a4a('0x2'));function checkNameSurname(_0x3cf7ee,_0x83daff,_0x12dd6f){var _0x5ea24d='';if(!_[_0x7a4a('0x3')](_0x83daff)&&_0x7a4a('0x4')===typeof _0x83daff){_0x5ea24d+=_0x83daff;}if(!_[_0x7a4a('0x3')](_0x12dd6f)&&_0x7a4a('0x4')===typeof _0x12dd6f){_0x5ea24d+='\x20'+_0x12dd6f;}if(_0x5ea24d!==''){return _0x5ea24d;}return _0x3cf7ee;}function Action(_0x183cf2,_0x1bd284,_0x2f13df,_0x5b654a,_0x2b09eb){this[_0x7a4a('0x5')]=_0x2f13df||undefined;this[_0x7a4a('0x6')]=_0x183cf2['id'];this['queue']=_0x1bd284[_0x7a4a('0x7')];this[_0x7a4a('0x8')]=_0x1bd284[_0x7a4a('0x8')];this[_0x7a4a('0x9')]=_0x7a4a('0xa');this[_0x7a4a('0xb')]=![];this[_0x7a4a('0xc')]=_['isNil'](_0x183cf2[_0x7a4a('0xd')])?undefined:_0x183cf2[_0x7a4a('0xd')][_0x7a4a('0x7')];this[_0x7a4a('0xe')]=this['membername']?util['format']('SIP/%s',this[_0x7a4a('0xc')]):_0x5b654a||undefined;this[_0x7a4a('0xf')]=checkNameSurname(_0x183cf2[_0x7a4a('0x10')][_0x7a4a('0x11')],_0x183cf2[_0x7a4a('0x10')]['firstName'],_0x183cf2[_0x7a4a('0x10')][_0x7a4a('0x12')]);this[_0x7a4a('0x13')]=_0x183cf2[_0x7a4a('0x13')]||![];this[_0x7a4a('0x14')]=_0x183cf2[_0x7a4a('0x10')][_0x7a4a('0x11')];this[_0x7a4a('0x15')]=_0x183cf2[_0x7a4a('0x15')];this[_0x7a4a('0x16')]=_0x183cf2[_0x7a4a('0x16')]||0x0;this[_0x7a4a('0x17')]=_0x183cf2[_0x7a4a('0x17')]||0x0;this[_0x7a4a('0x18')]=_0x183cf2[_0x7a4a('0x18')]||0x0;this[_0x7a4a('0x19')]=(_0x183cf2['countbusyretry']||0x0)+(_0x183cf2[_0x7a4a('0x17')]||0x0)+(_0x183cf2[_0x7a4a('0x18')]||0x0)+(_0x183cf2['countnosuchnumberretry']||0x0)+(_0x183cf2['countdropretry']||0x0)+(_0x183cf2[_0x7a4a('0x1a')]||0x0)+(_0x183cf2[_0x7a4a('0x1b')]||0x0)+(_0x183cf2[_0x7a4a('0x1c')]||0x0);this['countnosuchnumberretry']=_0x183cf2[_0x7a4a('0x1d')]||0x0;this['countdropretry']=_0x183cf2[_0x7a4a('0x1e')]||0x0;this[_0x7a4a('0x1a')]=_0x183cf2[_0x7a4a('0x1a')]||0x0;this[_0x7a4a('0x1b')]=_0x183cf2[_0x7a4a('0x1b')]||0x0;this[_0x7a4a('0x1c')]=_0x183cf2['countagentrejectretry']||0x0;this[_0x7a4a('0x1f')]=_0x183cf2['callback'];this['callbackuniqueid']=_0x183cf2[_0x7a4a('0x20')];this[_0x7a4a('0x21')]=_0x183cf2[_0x7a4a('0x21')];this['recallme']=_0x183cf2[_0x7a4a('0x22')];this[_0x7a4a('0x23')]=_0x183cf2[_0x7a4a('0x23')];this[_0x7a4a('0x24')]=_0x183cf2['ListId'];this['UserId']=_[_0x7a4a('0x3')](_0x183cf2[_0x7a4a('0xd')])?_0x183cf2[_0x7a4a('0x25')]:_0x183cf2[_0x7a4a('0xd')]['id'];this[_0x7a4a('0x26')]=_0x183cf2[_0x7a4a('0x26')];this['originatecalleridnum']='';this['originatecalleridname']='';}Action[_0x7a4a('0x27')]['getCaller']=function(){return util['format'](_0x7a4a('0x28'),this[_0x7a4a('0xf')],this['number']);};module[_0x7a4a('0x29')]=Action; \ No newline at end of file +var _0xa106=['number','exports','util','lodash','moment','isNil','string','idContact','queue','name','type','campaigntype','dialAnswer','membername','Agent','format','calleridname','Contact','phone','firstName','lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countdropretry','countabandonedretry','countagentrejectretry','countnosuchnumberretry','countmachineretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>'];(function(_0x27e811,_0x1fad22){var _0x1bfe61=function(_0x2d8d02){while(--_0x2d8d02){_0x27e811['push'](_0x27e811['shift']());}};_0x1bfe61(++_0x1fad22);}(_0xa106,0x86));var _0x6a10=function(_0x141e03,_0x18340e){_0x141e03=_0x141e03-0x0;var _0x2074e3=_0xa106[_0x141e03];return _0x2074e3;};'use strict';var util=require(_0x6a10('0x0'));var _=require(_0x6a10('0x1'));var moment=require(_0x6a10('0x2'));function checkNameSurname(_0x654e6b,_0x53bcc8,_0x432e4c){var _0xfeb774='';if(!_['isNil'](_0x53bcc8)&&'string'===typeof _0x53bcc8){_0xfeb774+=_0x53bcc8;}if(!_[_0x6a10('0x3')](_0x432e4c)&&_0x6a10('0x4')===typeof _0x432e4c){_0xfeb774+='\x20'+_0x432e4c;}if(_0xfeb774!==''){return _0xfeb774;}return _0x654e6b;}function Action(_0x2f6b9f,_0x6b1586,_0x43a059,_0x53e00b,_0x34247d){this['uniqueid']=_0x43a059||undefined;this[_0x6a10('0x5')]=_0x2f6b9f['id'];this[_0x6a10('0x6')]=_0x6b1586[_0x6a10('0x7')];this[_0x6a10('0x8')]=_0x6b1586[_0x6a10('0x8')];this[_0x6a10('0x9')]='queue';this[_0x6a10('0xa')]=![];this[_0x6a10('0xb')]=_[_0x6a10('0x3')](_0x2f6b9f[_0x6a10('0xc')])?undefined:_0x2f6b9f[_0x6a10('0xc')]['name'];this['channelAgent']=this[_0x6a10('0xb')]?util[_0x6a10('0xd')]('SIP/%s',this[_0x6a10('0xb')]):_0x53e00b||undefined;this[_0x6a10('0xe')]=checkNameSurname(_0x2f6b9f[_0x6a10('0xf')][_0x6a10('0x10')],_0x2f6b9f[_0x6a10('0xf')][_0x6a10('0x11')],_0x2f6b9f['Contact'][_0x6a10('0x12')]);this['active']=_0x2f6b9f[_0x6a10('0x13')]||![];this[_0x6a10('0x14')]=_0x2f6b9f[_0x6a10('0xf')][_0x6a10('0x10')];this[_0x6a10('0x15')]=_0x2f6b9f[_0x6a10('0x15')];this[_0x6a10('0x16')]=_0x2f6b9f[_0x6a10('0x16')]||0x0;this[_0x6a10('0x17')]=_0x2f6b9f[_0x6a10('0x17')]||0x0;this[_0x6a10('0x18')]=_0x2f6b9f[_0x6a10('0x18')]||0x0;this['countglobal']=(_0x2f6b9f['countbusyretry']||0x0)+(_0x2f6b9f['countcongestionretry']||0x0)+(_0x2f6b9f[_0x6a10('0x18')]||0x0)+(_0x2f6b9f['countnosuchnumberretry']||0x0)+(_0x2f6b9f[_0x6a10('0x19')]||0x0)+(_0x2f6b9f[_0x6a10('0x1a')]||0x0)+(_0x2f6b9f['countmachineretry']||0x0)+(_0x2f6b9f[_0x6a10('0x1b')]||0x0);this[_0x6a10('0x1c')]=_0x2f6b9f[_0x6a10('0x1c')]||0x0;this[_0x6a10('0x19')]=_0x2f6b9f[_0x6a10('0x19')]||0x0;this['countabandonedretry']=_0x2f6b9f[_0x6a10('0x1a')]||0x0;this[_0x6a10('0x1d')]=_0x2f6b9f[_0x6a10('0x1d')]||0x0;this[_0x6a10('0x1b')]=_0x2f6b9f[_0x6a10('0x1b')]||0x0;this['callback']=_0x2f6b9f[_0x6a10('0x1e')];this[_0x6a10('0x1f')]=_0x2f6b9f[_0x6a10('0x1f')];this[_0x6a10('0x20')]=_0x2f6b9f[_0x6a10('0x20')];this[_0x6a10('0x21')]=_0x2f6b9f[_0x6a10('0x21')];this[_0x6a10('0x22')]=_0x2f6b9f[_0x6a10('0x22')];this[_0x6a10('0x23')]=_0x2f6b9f[_0x6a10('0x23')];this[_0x6a10('0x24')]=_['isNil'](_0x2f6b9f[_0x6a10('0xc')])?_0x2f6b9f['UserId']:_0x2f6b9f[_0x6a10('0xc')]['id'];this[_0x6a10('0x25')]=_0x2f6b9f[_0x6a10('0x25')];this['originatecalleridnum']='';this[_0x6a10('0x26')]='';}Action[_0x6a10('0x27')][_0x6a10('0x28')]=function(){return util[_0x6a10('0xd')](_0x6a10('0x29'),this[_0x6a10('0xe')],this[_0x6a10('0x2a')]);};module[_0x6a10('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 d472337..23b56a8 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 _0xc021=['outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','Trunk','active','Interval','format','voice:queue:%s','voice_queue:save','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','stringify','voice_queue_channel:remove','emit','voice_queue_presence:remove','originated','sendMessageOneNotActive','paused','message','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','IS_DISACTIVED','\x20is\x20disactive','prototype','syncCampaigns','hasOwnProperty','booked','clearZombieChannels','recallMe','clearZombieChannel','isNil','[clearZombieChannels][talking]','Queue','queue','originated:\x20','dialAnswer','pick','UserId','VoiceQueueId','ListId','Action','status','channel','catch','No\x20such\x20channel','updateOriginated','decrementTalkink','[clearZombieChannel]','loggerError','[Dialer][checkChannel][Preview]','info','size','agentReadyId','then','length','getDiff','scheduledat','dialRecallMeTimeout','voicePause','[RecallMe]','logger2','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','logCustomer','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[HistoryRecallClose]','[getContactRecallMe]','setMessage','IsNotLoggedIn','isActive','isTrunkReachable','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','countnosuchnumberretry','countglobal','totalGlobal','buildObj','nosuchnumber','[callProgressDetectingCustomer][logNoSuch]','dialGlobalMaxRetry','[callProgressDetectingCustomer][logNoSuchGlobal]','createCustomerFinal','rescheduleContact','scheduledAt','dialNoSuchNumberRetryFrequency','unlockAgent','activeContact','linkedid','ANSWER','uniqueid','pTalking:\x20','custom:agentconnect','connect','acw','buildAcw','custom:agentcomplete','complete','[16]','Answer','[callProgressDetectingCustomer][logAnswer]','crateCustomerReportQueue','sumDuration','sumBillable','talktime','[syncHangup][talking][decrement]','\x20Queue','BUSY','countbusyretry','custom:agentbusy','busy','[callProgressDetectingCustomer][logBusy]','cloneAction','Global','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','dialBusyRetryFrequency','NOANSWER','outboundNoAnswerCallsDay','countnoanswerretry','custom:agentnoanswer','noanswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','CONGESTION','outboundCongestionCallsDay','Congestion','custom:agentcongestion','congestion','[callProgressDetectingCustomer][logCongestionGlobal]','countcongestionretry','dialCongestionMaxRetry','[callProgressDetectingCustomer][logCongestion]','CANCEL','AgentReject','custom:agentreject','agentreject','countagentrejectretry','[callProgressDetectingCustomer][logAgentReject]','countabandonedretry','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedRetryFrequency','countmachineretry','cause-txt','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','dialstatus','[callProgressDetectingCustomer][machine]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','object','reason','logAgent','NoSuchNumber','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','NoAnswer','[callProgressDetectingAgent][logNoAnswer]','Busy','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','Contact','phone','lookAgent','isEmpty','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','idContact','custom:agentcalled','Calling','[Preview][execCall][failure]','Call\x20failed','logBlacklist','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','SIP/%s','unmonitored','execRun','unlock','getContactPreview','recallme','validateContact','isValid','checkIsBlackList','Contact.phone','checkInBlack','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][getContactPreview]','Agent','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','\x20Trunk\x20Backup\x20is\x20not\x20active','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','campaign\x20Name:\x20','execCall','SIP/%s/%s%s','trim','dialCutDigit','substring','TrunkBackup','callerid','getCallerIdRandom','dialOriginateCallerIdNumber','dialRandomLastDigitCallerIdNumber','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','merge','toLowerVariables','variablesAction','channelAgent','destconnectedlinenum','calleridnum','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','syncOriginateResponse','actionid','logLookAgent','clone','responsetime','isFailure','unlockContact','custom:agentringnoanswer','rejected','syncHangup','cause','[syncHangup][talking][cause]','statedesc','dialQueueProject','isUndefined','transfer','[syncHangup][talking][transfer]','destuniqueid','addVariable','variables','filterKey','keys','variable','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','bluebird','moment','md5','../../../config/environment','../../../config/logger','preview','actionPreview','../ami','./rpcDb','./util/util','defaults','redis','localhost','socket.io-emitter','enqueue','tail','finally','sequence','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','bind','hangup','hanguprequest','syncHangupRequest','syncDialEnd','syncNewExten','varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','campaignsPreview','type','outbound','name','strategy','available','loggedIn','pTalking','talking','total','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundDropCallsDayCallersExit','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay'];(function(_0x5c466f,_0x5eaeca){var _0x215950=function(_0x276be4){while(--_0x276be4){_0x5c466f['push'](_0x5c466f['shift']());}};_0x215950(++_0x5eaeca);}(_0xc021,0x11c));var _0x1c02=function(_0x494739,_0x4fe52f){_0x494739=_0x494739-0x0;var _0x299203=_0xc021[_0x494739];return _0x299203;};'use strict';var util=require(_0x1c02('0x0'));var _=require(_0x1c02('0x1'));var BPromise=require(_0x1c02('0x2'));var uuid=require('uuid');var moment=require(_0x1c02('0x3'));var md5=require(_0x1c02('0x4'));var Redis=require('ioredis');var config=require(_0x1c02('0x5'));var logger=require(_0x1c02('0x6'))(_0x1c02('0x7'));var loggerAction=require(_0x1c02('0x6'))(_0x1c02('0x8'));var ami=require(_0x1c02('0x9'));var rpcDb=require(_0x1c02('0xa'));var Action=require('./action');var ut=require(_0x1c02('0xb'));config['redis']=_[_0x1c02('0xc')](config[_0x1c02('0xd')],{'host':_0x1c02('0xe'),'port':0x18eb});var io=require(_0x1c02('0xf'))(new Redis(config[_0x1c02('0xd')]));var Sequence=function(){};Sequence['prototype'][_0x1c02('0x10')]=function(_0x21d57a){this['tail']=this[_0x1c02('0x11')]?this['tail'][_0x1c02('0x12')](_0x21d57a):_0x21d57a();};function Preview(_0x21153d){this[_0x1c02('0x13')]=new Sequence();this['campaignsPreview']=_0x21153d[_0x1c02('0x14')];this[_0x1c02('0x15')]=_0x21153d[_0x1c02('0x15')];this[_0x1c02('0x16')]={};this[_0x1c02('0x17')]=_0x21153d['agents'];this[_0x1c02('0x18')]=0x0;ami['on'](_0x1c02('0x19'),this['syncOriginateResponse'][_0x1c02('0x1a')](this));ami['on'](_0x1c02('0x1b'),this['syncHangup'][_0x1c02('0x1a')](this));ami['on'](_0x1c02('0x1c'),this[_0x1c02('0x1d')][_0x1c02('0x1a')](this));ami['on']('dialend',this[_0x1c02('0x1e')][_0x1c02('0x1a')](this));ami['on']('newexten',this[_0x1c02('0x1f')][_0x1c02('0x1a')](this));ami['on'](_0x1c02('0x20'),this[_0x1c02('0x21')][_0x1c02('0x1a')](this));ami['on'](_0x1c02('0x22'),this[_0x1c02('0x23')][_0x1c02('0x1a')](this));ami['on'](_0x1c02('0x24'),this[_0x1c02('0x25')][_0x1c02('0x1a')](this));this[_0x1c02('0x26')](this[_0x1c02('0x27')]);}function emit(_0x19867e,_0x224aa3,_0x5270ac){io['to'](_0x19867e)['emit'](_0x224aa3,_0x5270ac);}function emitCampaignPreview(_0x411e12){if(_0x411e12[_0x1c02('0x28')]===_0x1c02('0x29')){var _0x109676={'id':_0x411e12['id'],'name':_0x411e12[_0x1c02('0x2a')],'strategy':_0x411e12[_0x1c02('0x2b')],'answered':_0x411e12['answered'],'available':_0x411e12[_0x1c02('0x2c')],'loggedIn':_0x411e12[_0x1c02('0x2d')],'pTalking':_0x411e12[_0x1c02('0x2e')],'sumBillable':_0x411e12['sumBillable'],'sumDuration':_0x411e12['sumDuration'],'sumHoldTime':_0x411e12['sumHoldTime']||0x0,'talking':_0x411e12[_0x1c02('0x2f')],'total':_0x411e12[_0x1c02('0x30')],'type':_0x411e12['type'],'unmanaged':_0x411e12[_0x1c02('0x31')],'abandoned':_0x411e12[_0x1c02('0x32')],'waiting':_0x411e12[_0x1c02('0x33')],'loggedInDb':_0x411e12[_0x1c02('0x34')],'dialActive':_0x411e12[_0x1c02('0x35')],'dialMethod':_0x411e12[_0x1c02('0x36')],'dialOriginateCallerIdName':_0x411e12[_0x1c02('0x37')],'dialOriginateCallerIdNumber':_0x411e12['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x411e12[_0x1c02('0x38')],'dialPrefix':_0x411e12[_0x1c02('0x39')],'outboundAnswerAgiCallsDay':_0x411e12[_0x1c02('0x3a')],'outboundAnswerCallsDay':_0x411e12[_0x1c02('0x3b')],'outboundBlacklistCallsDay':_0x411e12[_0x1c02('0x3c')],'outboundBusyCallsDay':_0x411e12[_0x1c02('0x3d')],'outboundCongestionCallsDay':_0x411e12['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x411e12['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x411e12[_0x1c02('0x3e')],'outboundDropCallsDayTimeout':_0x411e12['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x411e12['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x411e12[_0x1c02('0x3f')],'outboundOriginateFailureCallsDay':_0x411e12[_0x1c02('0x40')],'outboundReCallsDay':_0x411e12[_0x1c02('0x41')],'outboundRejectCallsDay':_0x411e12[_0x1c02('0x42')],'outboundUnknownCallsDay':_0x411e12[_0x1c02('0x43')],'outboundAbandonedCallsDay':_0x411e12[_0x1c02('0x44')],'predictiveIntervalAnsweredCalls':_0x411e12[_0x1c02('0x45')],'predictiveIntervalAvgHoldtime':_0x411e12[_0x1c02('0x46')],'predictiveIntervalAvgTalktime':_0x411e12[_0x1c02('0x47')],'predictiveIntervalDroppedCallsCallersExit':_0x411e12[_0x1c02('0x48')],'predictiveIntervalDroppedCallsTimeout':_0x411e12[_0x1c02('0x49')],'predictiveIntervalErlangCalls':_0x411e12[_0x1c02('0x4a')],'predictiveIntervalErlangCallsDroppedCalls':_0x411e12[_0x1c02('0x4b')],'predictiveIntervalHitRate':_0x411e12[_0x1c02('0x4c')],'predictiveIntervalMultiplicativeFactor':_0x411e12[_0x1c02('0x4d')],'predictiveIntervalPauses':_0x411e12['predictiveIntervalPauses'],'predictiveIntervalAvailable':_0x411e12['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x411e12[_0x1c02('0x4e')],'message':_0x411e12['message'],'originated':_0x411e12['originated'],'erlangCalls':_0x411e12['erlangCalls'],'erlangCallToSecond':_0x411e12[_0x1c02('0x4f')],'erlangAbandonmentRate':_0x411e12[_0x1c02('0x50')],'erlangBusyFactor':_0x411e12[_0x1c02('0x51')],'startPredictive':_0x411e12[_0x1c02('0x52')],'startProgressive':_0x411e12['startProgressive']};if(_0x411e12[_0x1c02('0x53')]){_0x109676[_0x1c02('0x53')]={'id':_0x411e12['Trunk']['id'],'name':_0x411e12['Trunk']['name'],'active':_0x411e12[_0x1c02('0x53')][_0x1c02('0x54')],'callerid':_0x411e12[_0x1c02('0x53')]['callerid']};}if(_0x411e12[_0x1c02('0x55')]){_0x109676[_0x1c02('0x55')]={'id':_0x411e12[_0x1c02('0x55')]['id'],'name':_0x411e12['Interval'][_0x1c02('0x2a')]};}var _0x1cd1d3=md5(JSON['stringify'](_0x109676));if(_0x411e12['md5']!==_0x1cd1d3){_0x411e12[_0x1c02('0x4')]=_0x1cd1d3;emit(util[_0x1c02('0x56')](_0x1c02('0x57'),_0x109676['name']),_0x1c02('0x58'),_0x109676);}}}function emitVoiceQueueChannelRemove(_0x508f99){logger['info'](_0x1c02('0x59'),JSON[_0x1c02('0x5a')](_0x508f99));emit(util[_0x1c02('0x56')]('voice:queue:%s',_0x508f99[_0x1c02('0x2a')]),_0x1c02('0x5b'),_0x508f99);io[_0x1c02('0x5c')](_0x1c02('0x5d'),_0x508f99);}function notSendMessagesQueue(_0x59b192){if(_0x59b192['sendMessageOneNotActive']){if(_0x59b192[_0x1c02('0x5e')]===0x0&&_0x59b192['pTalking']===0x0){_0x59b192[_0x1c02('0x5f')]=![];_0x59b192[_0x1c02('0x2c')]=0x0;_0x59b192[_0x1c02('0x60')]=0x0;_0x59b192[_0x1c02('0x61')]=_0x1c02('0x62');ut[_0x1c02('0x63')](_0x1c02('0x64'),_0x59b192[_0x1c02('0x2a')]+_0x1c02('0x65'));}else{_0x59b192[_0x1c02('0x61')]=_0x1c02('0x66');ut[_0x1c02('0x63')](_0x1c02('0x64'),_0x59b192['name']+_0x1c02('0x67'));}emitCampaignPreview(_0x59b192);}}Preview[_0x1c02('0x68')][_0x1c02('0x26')]=function(){var _0xbcff5e=this;setInterval(function(){_0xbcff5e[_0x1c02('0x69')]();},0x7cf);};Preview['prototype'][_0x1c02('0x69')]=function(){var _0x51e1e3=this[_0x1c02('0x27')];this[_0x1c02('0x18')]+=0x1;for(var _0x199f0b in _0x51e1e3){if(_0x51e1e3[_0x1c02('0x6a')](_0x199f0b)&&(_0x51e1e3[_0x199f0b][_0x1c02('0x36')]===_0x1c02('0x7')||_0x51e1e3[_0x199f0b][_0x1c02('0x36')]===_0x1c02('0x6b'))&&_0x51e1e3[_0x199f0b]['type']===_0x1c02('0x29')){if(this[_0x1c02('0x18')]>0x7){this['clockClearZombieChannels']=0x0;this[_0x1c02('0x6c')]();}}if(_0x51e1e3[_0x1c02('0x6a')](_0x199f0b)&&_0x51e1e3[_0x199f0b][_0x1c02('0x36')]===_0x1c02('0x7')&&_0x51e1e3[_0x199f0b][_0x1c02('0x28')]===_0x1c02('0x29')){if(_0x51e1e3[_0x199f0b][_0x1c02('0x35')]){this['setMessage'](_0x51e1e3[_0x199f0b]);this[_0x1c02('0x6d')](_0x51e1e3[_0x199f0b]);}else{notSendMessagesQueue(_0x51e1e3[_0x199f0b]);}}}};Preview[_0x1c02('0x68')][_0x1c02('0x6e')]=function(_0x4694d1){var _0xa06234=this;this[_0x1c02('0x13')][_0x1c02('0x10')](function(){if(!_[_0x1c02('0x6f')](_0xa06234[_0x1c02('0x16')][_0x4694d1])){loggerAction['info'](_0x1c02('0x70'),_0x4694d1,_0x1c02('0x71'),_0xa06234[_0x1c02('0x16')][_0x4694d1][_0x1c02('0x72')],_0x1c02('0x73'),JSON[_0x1c02('0x5a')](_0xa06234[_0x1c02('0x27')][_0xa06234[_0x1c02('0x16')][_0x4694d1][_0x1c02('0x72')]][_0x1c02('0x5e')]),'pTalking:\x20',JSON[_0x1c02('0x5a')](_0xa06234[_0x1c02('0x27')][_0xa06234['actions'][_0x4694d1][_0x1c02('0x72')]][_0x1c02('0x2e')]),JSON['stringify'](_0xa06234[_0x1c02('0x16')][_0x4694d1][_0x1c02('0x74')]),JSON[_0x1c02('0x5a')](_[_0x1c02('0x75')](_0xa06234['actions'][_0x4694d1],['contactId',_0x1c02('0x76'),_0x1c02('0x77'),_0x1c02('0x78')])));return ami[_0x1c02('0x79')]({'action':_0x1c02('0x7a'),'channel':_0xa06234[_0x1c02('0x16')][_0x4694d1][_0x1c02('0x7b')]})[_0x1c02('0x7c')](function(_0x43badd){if(_0x43badd[_0x1c02('0x61')]===_0x1c02('0x7d')){setTimeout(function(){if(_0xa06234[_0x1c02('0x16')][_0x4694d1]){ut[_0x1c02('0x7e')](_0xa06234[_0x1c02('0x27')][_0xa06234[_0x1c02('0x16')][_0x4694d1][_0x1c02('0x72')]],'[clearZombieChannel]');if(_0xa06234[_0x1c02('0x16')][_0x4694d1]['dialAnswer']===!![]){ut[_0x1c02('0x7f')](_0xa06234[_0x1c02('0x27')][_0xa06234[_0x1c02('0x16')][_0x4694d1][_0x1c02('0x72')]],_0x1c02('0x80'));ut[_0x1c02('0x81')]('[Dialer][checkChannel][pTalking][Preview]'+_0x4694d1,_0xa06234[_0x1c02('0x16')][_0x4694d1][_0x1c02('0x72')]);}ut['loggerError'](_0x1c02('0x82')+_0x4694d1,_0xa06234[_0x1c02('0x16')][_0x4694d1][_0x1c02('0x72')]);delete _0xa06234[_0x1c02('0x16')][_0x4694d1];}},0x2328);}});}});};Preview[_0x1c02('0x68')]['clearZombieChannels']=function(){var _0x446dbf=this;loggerAction[_0x1c02('0x83')]('[action]',_[_0x1c02('0x84')](this[_0x1c02('0x16')]));for(var _0x1ddc10 in this[_0x1c02('0x16')]){if(_0x446dbf[_0x1c02('0x16')]['hasOwnProperty'](_0x1ddc10)){_0x446dbf[_0x1c02('0x6e')](_0x1ddc10);}}};Preview[_0x1c02('0x68')]['recallMe']=function(_0xd5d8af){var _0x967f45=this;rpcDb['getContactRecallMe'](_0xd5d8af['id'],ut[_0x1c02('0x85')](this[_0x1c02('0x17')]))[_0x1c02('0x86')](function(_0x8e7348){if(!_[_0x1c02('0x6f')](_0x8e7348)){for(var _0x26577f=0x0;_0x26577f<_0x8e7348[_0x1c02('0x87')];_0x26577f+=0x1){if(ut[_0x1c02('0x88')](_0x8e7348[_0x26577f][_0x1c02('0x89')])<_0xd5d8af[_0x1c02('0x8a')]*0x3c){if(_0x8e7348[_0x26577f]['Agent']&&!_0x8e7348[_0x26577f]['Agent'][_0x1c02('0x8b')]){_0x967f45['run'](_0x8e7348[_0x26577f]['id'])[_0x1c02('0x86')](ut['logger2'](_0x1c02('0x8c')))[_0x1c02('0x7c')](ut[_0x1c02('0x8d')]('[RecallMe]'));}else{rpcDb[_0x1c02('0x8e')](_0x8e7348[_0x26577f]['id']);}}else{var _0x4f1b1f=new Action(_0x8e7348[_0x26577f],_0xd5d8af);_0x4f1b1f[_0x1c02('0x8f')]=moment()['format'](_0x1c02('0x90'));_0xd5d8af[_0x1c02('0x41')]+=0x1;ut[_0x1c02('0x91')](_0x4f1b1f,0x17,'RecallInQueue');if(_0xd5d8af[_0x1c02('0x92')]){rpcDb[_0x1c02('0x93')](ut[_0x1c02('0x94')](_0x8e7348[_0x26577f]));rpcDb[_0x1c02('0x95')](_0x4f1b1f,_0x1c02('0x96'));}else{ut['logCustomer'](_0x4f1b1f,0x16,_0x1c02('0x97'));rpcDb[_0x1c02('0x95')](_0x4f1b1f,_0x1c02('0x98'));rpcDb['createCustomerFinal'](_0x4f1b1f,_0x1c02('0x98'));}}}}})[_0x1c02('0x7c')](ut[_0x1c02('0x8d')](_0x1c02('0x99')));};Preview[_0x1c02('0x68')][_0x1c02('0x9a')]=function(_0x15aecb){_0x15aecb[_0x1c02('0x5f')]=!![];if(ut[_0x1c02('0x9b')](_0x15aecb[_0x1c02('0x2d')])){_0x15aecb[_0x1c02('0x61')]='AGENTS_NOT_LOGGED';}else if(!ut[_0x1c02('0x9c')](_0x15aecb[_0x1c02('0x35')])){_0x15aecb[_0x1c02('0x61')]=_0x1c02('0x62');}else if(!this[_0x1c02('0x9d')](_0x15aecb[_0x1c02('0x53')])){if(!this[_0x1c02('0x9d')](_0x15aecb['TrunkBackup'])){_0x15aecb[_0x1c02('0x61')]=_0x1c02('0x9e');}else{_0x15aecb['message']=_0x1c02('0x9f');}}else{_0x15aecb[_0x1c02('0x61')]=_0x1c02('0x9f');}emitCampaignPreview(_0x15aecb);};Preview['prototype'][_0x1c02('0xa0')]=function(_0x2de598,_0x148099,_0xde6d91){var _0xf544e0=this;var _0x744df9=this[_0x1c02('0x16')][_0x148099];var _0x205464=this['campaignsPreview'][_0x744df9[_0x1c02('0x72')]];var _0x2331cb;if(_0x205464){switch(_0xde6d91){case'1':_0x205464[_0x1c02('0x3f')]+=0x1;_0x744df9[_0x1c02('0xa1')]+=0x1;_0x744df9[_0x1c02('0xa2')]=ut[_0x1c02('0xa3')](_0x744df9);ut[_0x1c02('0x91')](_0x744df9,0x0,'NoSuchNumber');ami[_0x1c02('0x5c')]('custom:agentnosuchnumber',ut[_0x1c02('0xa4')](_0x744df9,_0x1c02('0xa5')));rpcDb[_0x1c02('0x95')](_0x744df9,_0x1c02('0xa6'));if(ut['totalGlobal'](_0x744df9)>=_0x205464[_0x1c02('0xa7')]){_0x2331cb=ut['cloneAction'](_0x744df9,0xf,'Global');rpcDb['createCustomerFinal'](_0x2331cb,_0x1c02('0xa8'));}else{if(_0x744df9['countnosuchnumberretry']>=_0x205464['dialNoSuchNumberMaxRetry']){rpcDb[_0x1c02('0xa9')](_0x744df9,_0x1c02('0xa8'));}else{rpcDb[_0x1c02('0xaa')](ut[_0x1c02('0xab')](_0x744df9,_0x1c02('0xa1'),_0x205464[_0x1c02('0xac')]),_0x744df9[_0x1c02('0xad')],_0x744df9[_0x1c02('0xae')]);}}delete this[_0x1c02('0x16')][_0x2de598[_0x1c02('0xaf')]];break;case _0x1c02('0xb0'):var _0x235ea6=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x744df9['responsetime']=_0x235ea6;_0x744df9['answertime']=_0x235ea6;_0x744df9[_0x1c02('0x74')]=!![];_0x205464[_0x1c02('0x2e')]+=0x1;logger[_0x1c02('0x83')]('[syncHangup][talking][increment]',_0x744df9[_0x1c02('0xb1')],'\x20Queue',_0x205464[_0x1c02('0x2a')],_0x1c02('0xb2'),_0x205464['pTalking']);ami[_0x1c02('0x5c')](_0x1c02('0xb3'),ut[_0x1c02('0xa4')](_0x744df9,_0x1c02('0xb4'),this[_0x1c02('0x27')][_0x744df9['queue']]));if(_0x205464[_0x1c02('0xb5')]){ami[_0x1c02('0x5c')]('custom:agentConnectPreview',ut[_0x1c02('0xb6')](_0x744df9));}break;case'16':ami[_0x1c02('0x5c')](_0x1c02('0xb7'),ut['buildObj'](_0x744df9,_0x1c02('0xb8'),this['campaignsPreview'][_0x744df9['queue']]));emitVoiceQueueChannelRemove(ut[_0x1c02('0xa4')](_0x744df9,_0x1c02('0xb8')));_0x205464[_0x1c02('0x3b')]+=0x1;_0x205464[_0x1c02('0x30')]+=0x1;_0x205464['answered']+=0x1;ut['decrementTalkink'](_0x205464,_0x1c02('0xb9'));_0x744df9[_0x1c02('0xa2')]=ut[_0x1c02('0xa3')](_0x744df9);ut[_0x1c02('0x91')](_0x744df9,0x4,_0x1c02('0xba'));rpcDb[_0x1c02('0x95')](_0x744df9,_0x1c02('0xbb'));rpcDb[_0x1c02('0xa9')](_0x744df9,'[callProgressDetectingCustomer][logAnswerGlobal]');rpcDb[_0x1c02('0xbc')](_0x744df9);_0x205464[_0x1c02('0xbd')]+=_0x744df9['talktime'];_0x205464[_0x1c02('0xbe')]+=_0x744df9[_0x1c02('0xbf')];logger[_0x1c02('0x83')](_0x1c02('0xc0'),_0x744df9[_0x1c02('0xb1')],_0x1c02('0xc1'),_0x205464[_0x1c02('0x2a')],_0x1c02('0xb2'),_0x205464[_0x1c02('0x2e')]);delete this['actions'][_0x2de598[_0x1c02('0xaf')]];break;case _0x1c02('0xc2'):_0x205464[_0x1c02('0x3d')]+=0x1;_0x744df9[_0x1c02('0xc3')]+=0x1;_0x744df9['countglobal']=ut[_0x1c02('0xa3')](_0x744df9);ut['logCustomer'](_0x744df9,0x5,'Busy');ami[_0x1c02('0x5c')](_0x1c02('0xc4'),ut[_0x1c02('0xa4')](_0x744df9,_0x1c02('0xc5')));rpcDb[_0x1c02('0x95')](_0x744df9,_0x1c02('0xc6'));if(ut[_0x1c02('0xa3')](_0x744df9)>=_0x205464[_0x1c02('0xa7')]){_0x2331cb=ut[_0x1c02('0xc7')](_0x744df9,0xf,_0x1c02('0xc8'));rpcDb['createCustomerFinal'](_0x2331cb,_0x1c02('0xc9'));}else{if(_0x744df9[_0x1c02('0xc3')]>=_0x205464[_0x1c02('0xca')]){rpcDb['createCustomerFinal'](_0x744df9,_0x1c02('0xc6'));}else{rpcDb[_0x1c02('0xaa')](ut[_0x1c02('0xab')](_0x744df9,_0x1c02('0xc3'),_0x205464[_0x1c02('0xcb')]),_0x744df9[_0x1c02('0xad')],_0x744df9[_0x1c02('0xae')]);}}break;case _0x1c02('0xcc'):_0x205464[_0x1c02('0xcd')]+=0x1;_0x744df9[_0x1c02('0xce')]+=0x1;_0x744df9[_0x1c02('0xa2')]=ut[_0x1c02('0xa3')](_0x744df9);ut['logCustomer'](_0x744df9,0x3,'NoAnswer');ami['emit'](_0x1c02('0xcf'),ut[_0x1c02('0xa4')](_0x744df9,_0x1c02('0xd0')));rpcDb[_0x1c02('0x95')](_0x744df9,_0x1c02('0xd1'));if(ut[_0x1c02('0xa3')](_0x744df9)>=_0x205464['dialGlobalMaxRetry']){_0x2331cb=ut[_0x1c02('0xc7')](_0x744df9,0xf,_0x1c02('0xc8'));rpcDb['createCustomerFinal'](_0x2331cb,_0x1c02('0xd2'));}else{if(_0x744df9[_0x1c02('0xce')]>=_0x205464[_0x1c02('0xd3')]){rpcDb['createCustomerFinal'](_0x744df9,_0x1c02('0xd1'));}else{rpcDb['rescheduleContact'](ut[_0x1c02('0xab')](_0x744df9,'countnoanswerretry',_0x205464[_0x1c02('0xd4')]),_0x744df9[_0x1c02('0xad')],_0x744df9[_0x1c02('0xae')]);}}break;case _0x1c02('0xd5'):_0x205464[_0x1c02('0xd6')]+=0x1;_0x744df9['countcongestionretry']+=0x1;_0x744df9['countglobal']=ut[_0x1c02('0xa3')](_0x744df9);ut[_0x1c02('0x91')](_0x744df9,0x8,_0x1c02('0xd7'));ami['emit'](_0x1c02('0xd8'),ut[_0x1c02('0xa4')](_0x744df9,_0x1c02('0xd9')));rpcDb[_0x1c02('0x95')](_0x744df9,'[callProgressDetectingCustomer][logCongestion]');if(ut[_0x1c02('0xa3')](_0x744df9)>=_0x205464[_0x1c02('0xa7')]){_0x2331cb=ut['cloneAction'](_0x744df9,0xf,_0x1c02('0xc8'));rpcDb[_0x1c02('0xa9')](_0x2331cb,_0x1c02('0xda'));}else{if(_0x744df9[_0x1c02('0xdb')]>=_0x205464[_0x1c02('0xdc')]){rpcDb[_0x1c02('0xa9')](_0x744df9,_0x1c02('0xdd'));}else{rpcDb[_0x1c02('0xaa')](ut[_0x1c02('0xab')](_0x744df9,_0x1c02('0xdb'),_0x205464['dialBusyRetryFrequency']),_0x744df9[_0x1c02('0xad')],_0x744df9[_0x1c02('0xae')]);}}break;case _0x1c02('0xde'):_0x205464[_0x1c02('0x42')]+=0x1;_0x744df9['countagentrejectretry']+=0x1;_0x744df9[_0x1c02('0xa2')]=ut[_0x1c02('0xa3')](_0x744df9);ut[_0x1c02('0x91')](_0x744df9,0x14,_0x1c02('0xdf'));ami[_0x1c02('0x5c')](_0x1c02('0xe0'),ut['buildObj'](_0x744df9,_0x1c02('0xe1')));rpcDb[_0x1c02('0x95')](_0x744df9,'[syncHangupRequest][logAgentReject]');if(ut[_0x1c02('0xa3')](_0x744df9)>=_0x205464[_0x1c02('0xa7')]){_0x2331cb=ut[_0x1c02('0xc7')](_0x744df9,0x14,'AgentReject');rpcDb[_0x1c02('0xa9')](_0x2331cb,'[callProgressDetectingCustomer][logAgentReject]');}else{if(_0x744df9[_0x1c02('0xe2')]>=_0x205464['dialAgentRejectMaxRetry']){rpcDb[_0x1c02('0xa9')](_0x744df9,_0x1c02('0xe3'));}else{rpcDb[_0x1c02('0xaa')](ut[_0x1c02('0xab')](_0x744df9,'countagentrejectretry',_0x205464['dialAgentRejectRetryFrequency']),_0x744df9[_0x1c02('0xad')],_0x744df9['activeContact']);}}break;case'ABANDONED':_0x205464[_0x1c02('0x44')]+=0x1;_0x744df9[_0x1c02('0xe4')]+=0x1;_0x744df9[_0x1c02('0xa2')]=ut[_0x1c02('0xa3')](_0x744df9);ut[_0x1c02('0x91')](_0x744df9,0xb,'Abandoned');rpcDb['createCustomerHistory'](_0x744df9,_0x1c02('0xe5'));if(ut[_0x1c02('0xa3')](_0x744df9)>=_0x205464['dialGlobalMaxRetry']){_0x2331cb=ut[_0x1c02('0xc7')](_0x744df9,0xf,'Global');rpcDb[_0x1c02('0xa9')](_0x2331cb,_0x1c02('0xe5'));}else{if(_0x744df9[_0x1c02('0xe6')]>=_0x205464['dialAbandonedMaxRety']){rpcDb['createCustomerFinal'](_0x744df9,'[callProgressDetectingCustomer][logAbandoned]');}else{rpcDb['rescheduleContact'](ut[_0x1c02('0xab')](_0x744df9,'countabandonedretry',_0x205464[_0x1c02('0xe7')]),_0x744df9['unlockAgent'],_0x744df9[_0x1c02('0xae')]);}}break;case'18':_0x205464[_0x1c02('0x43')]+=0x1;_0x744df9[_0x1c02('0xe8')]+=0x1;_0x744df9[_0x1c02('0xa2')]=ut[_0x1c02('0xa3')](_0x744df9);ut[_0x1c02('0x91')](_0x744df9,0x12,_0x2de598[_0x1c02('0xe9')]||_0x2de598['dialstatus']);ami[_0x1c02('0x5c')](_0x1c02('0xea'),ut[_0x1c02('0xa4')](_0x744df9,_0x1c02('0xeb')));rpcDb['createCustomerHistory'](_0x744df9,_0x1c02('0xec'));if(ut['totalGlobal'](_0x744df9)>=_0x205464[_0x1c02('0xa7')]){_0x2331cb=ut[_0x1c02('0xc7')](_0x744df9,0xf,_0x1c02('0xc8'));rpcDb[_0x1c02('0xa9')](_0x2331cb,'[callProgressDetectingCustomer][hangupInAMD]');}else{rpcDb[_0x1c02('0xa9')](_0x744df9,_0x1c02('0xec'));}delete this[_0x1c02('0x16')][_0x2de598[_0x1c02('0xaf')]];break;case'19':_0x205464['outboundUnknownCallsDay']+=0x1;_0x744df9[_0x1c02('0xa2')]=ut[_0x1c02('0xa3')](_0x744df9);ut[_0x1c02('0x91')](_0x744df9,0x13,_0x2de598[_0x1c02('0xe9')]||_0x2de598[_0x1c02('0xed')]);ami['emit'](_0x1c02('0xea'),ut['buildObj'](_0x744df9,_0x1c02('0xeb')));rpcDb['createCustomerHistory'](_0x744df9,'[callProgressDetectingCustomer][machine]');if(ut[_0x1c02('0xa3')](_0x744df9)>=_0x205464[_0x1c02('0xa7')]){_0x2331cb=ut[_0x1c02('0xc7')](_0x744df9,0xf,_0x1c02('0xc8'));rpcDb[_0x1c02('0xa9')](_0x2331cb,_0x1c02('0xee'));}else{rpcDb[_0x1c02('0xa9')](_0x744df9,_0x1c02('0xee'));}delete this[_0x1c02('0x16')][_0x2de598['linkedid']];break;default:if(_0x744df9['dialAnswer']){ut[_0x1c02('0x7f')](_0x205464,'[default]');ut[_0x1c02('0x81')](_0x1c02('0xef')+_0x205464[_0x1c02('0x2a')],_0x2de598);}_0x205464[_0x1c02('0x43')]+=0x1;_0x744df9['countglobal']=ut['totalGlobal'](_0x744df9);ut['logCustomer'](_0x744df9,0xc,_0x2de598[_0x1c02('0xe9')]||_0x2de598[_0x1c02('0xed')]);rpcDb[_0x1c02('0x95')](_0x744df9,_0x1c02('0xf0'));if(ut[_0x1c02('0xa3')](_0x744df9)>=_0x205464[_0x1c02('0xa7')]){_0x2331cb=ut['cloneAction'](_0x744df9,0xf,_0x1c02('0xc8'));rpcDb[_0x1c02('0xa9')](_0x2331cb,_0x1c02('0xf1'));}else{rpcDb[_0x1c02('0xa9')](_0x744df9,_0x1c02('0xf1'));}delete this[_0x1c02('0x16')][_0x2de598[_0x1c02('0xaf')]];}if(!(_0x744df9[_0x1c02('0x74')]&&_0xde6d91==='16')){ut[_0x1c02('0x7e')](_0x205464,_0x1c02('0xf2'));logger['info']('[originated][decrement][callProgressDetectingCustomer]',_0x744df9[_0x1c02('0xb1')],_0x1c02('0xc1'),_0x205464[_0x1c02('0x2a')],_0x1c02('0x73'),_0x205464['originated']);}if(_0xde6d91!==_0x1c02('0xb0')){delete this[_0x1c02('0x16')][_0x2de598[_0x1c02('0xaf')]];delete this['actions'][_0x2de598[_0x1c02('0xf3')]];}}};Preview[_0x1c02('0x68')][_0x1c02('0xf4')]=function(_0x2d8474,_0x575311,_0x1d7020){if(_['isUndefined'](_0x575311)&&_0x1c02('0xf5')!==typeof _0x575311){return;}if(_['isUndefined'](_0x1d7020)&&_0x1c02('0xf5')!==typeof _0x1d7020){return;}switch(_0x1d7020[_0x1c02('0xf6')]){case'0':ut[_0x1c02('0xf7')](_0x2d8474,0x0,_0x1c02('0xf8'));rpcDb[_0x1c02('0xf9')](_0x2d8474,_0x1c02('0xfa'));break;case'3':ut[_0x1c02('0xf7')](_0x2d8474,0x3,_0x1c02('0xfb'));rpcDb[_0x1c02('0xf9')](_0x2d8474,_0x1c02('0xfc'));break;case'5':ut['logAgent'](_0x2d8474,0x5,_0x1c02('0xfd'));rpcDb[_0x1c02('0xf9')](_0x2d8474,_0x1c02('0xfe'));break;case'8':ut['logAgent'](_0x2d8474,0x8,_0x1c02('0xd7'));rpcDb[_0x1c02('0xf9')](_0x2d8474,_0x1c02('0xff'));break;case'22':ut['logAgent'](_0x2d8474,0x16,_0x1c02('0x100'));rpcDb['createAgentHistory'](_0x2d8474,'[callProgressDetectingAgent][logAnswerAGI]');break;default:ut[_0x1c02('0xf7')](_0x2d8474,0xc,_0x1d7020[_0x1c02('0xf6')]);rpcDb[_0x1c02('0xf9')](_0x2d8474,_0x1c02('0xff'));}ut[_0x1c02('0x7e')](_0x575311,_0x1c02('0x101'));logger[_0x1c02('0x83')](_0x1c02('0x102'),_0x2d8474[_0x1c02('0xb1')],'\x20Queue',_0x575311[_0x1c02('0x2a')],'originated:\x20',_0x575311[_0x1c02('0x5e')]);delete this[_0x1c02('0x16')][_0x2d8474[_0x1c02('0xb1')]];};Preview[_0x1c02('0x68')]['checkInBlack']=function(_0x49c7f,_0x2cce44,_0x50fb2e,_0x29d869,_0x548603){var _0x5bbdc6=this;return new BPromise(function(_0x76816,_0x31e8fe){if(_[_0x1c02('0x6f')](_0x2cce44)||_[_0x1c02('0x6f')](_0x2cce44[_0x1c02('0x103')])||_[_0x1c02('0x6f')](_0x2cce44[_0x1c02('0x103')][_0x1c02('0x104')])||_[_0x1c02('0x6f')](_0x2cce44['VoiceQueueId'])){_0x31e8fe(ut[_0x1c02('0x61')]('Contact\x20is\x20undefined',_0x29d869,_0x548603));return;}var _0x34e103=uuid['v4']();var _0x22e233=_0x5bbdc6[_0x1c02('0x27')][_0x2cce44[_0x1c02('0x71')][_0x1c02('0x2a')]];var _0x36c508=_0x50fb2e?_0x5bbdc6[_0x1c02('0x17')][_0x50fb2e]['id']:undefined;_0x5bbdc6[_0x1c02('0x16')][_0x34e103]=new Action(_0x2cce44,_0x22e233,_0x34e103,_0x50fb2e,_0x36c508);var _0x144bb4=_0x5bbdc6[_0x1c02('0x16')][_0x34e103];_0x144bb4[_0x1c02('0xad')]=_0x29d869;_0x144bb4['activeContact']=_0x548603;_0x144bb4[_0x1c02('0x105')]=_0x50fb2e;if(_[_0x1c02('0x106')](_0x49c7f)){_0x5bbdc6['execCall'](_0x144bb4,_0x22e233,_0x2cce44,_0x50fb2e)[_0x1c02('0x86')](function(_0x46b68f){logger[_0x1c02('0x83')](_0x1c02('0x107'),_0x1c02('0x108')+_0x144bb4[_0x1c02('0x72')]+_0x1c02('0x109')+_0x144bb4[_0x1c02('0x10a')],JSON[_0x1c02('0x5a')](_0x46b68f));ami[_0x1c02('0x5c')](_0x1c02('0x10b'),ut[_0x1c02('0xa4')](_0x144bb4,'called',_0x5bbdc6[_0x1c02('0x27')][_0x144bb4[_0x1c02('0x72')]]));_0x76816(ut[_0x1c02('0x61')](_0x1c02('0x10c')));})[_0x1c02('0x7c')](function(_0xaa6898){ut[_0x1c02('0x63')](_0x1c02('0x10d'),_0xaa6898);_0x31e8fe(ut[_0x1c02('0x61')](_0x1c02('0x10e'),_0x29d869,_0x548603));});}else{_0x22e233[_0x1c02('0x3c')]+=0x1;ut[_0x1c02('0x10f')](_0x144bb4);rpcDb[_0x1c02('0x110')](_0x144bb4,_0x1c02('0x111'));delete _0x5bbdc6[_0x1c02('0x16')][_0x34e103];_0x31e8fe(ut[_0x1c02('0x61')](_0x1c02('0x112'),_0x29d869,_0x548603));}});};Preview[_0x1c02('0x68')][_0x1c02('0x9d')]=function(_0x414c80){return!_[_0x1c02('0x6f')](_0x414c80)&&!_[_0x1c02('0x6f')](_0x414c80[_0x1c02('0x2a')])&&!_[_0x1c02('0x6f')](_0x414c80['active'])&&_0x414c80['active']&&!_[_0x1c02('0x6f')](this['trunks'][util[_0x1c02('0x56')](_0x1c02('0x113'),_0x414c80[_0x1c02('0x2a')])])&&!_[_0x1c02('0x6f')](this['trunks'][util[_0x1c02('0x56')](_0x1c02('0x113'),_0x414c80[_0x1c02('0x2a')])][_0x1c02('0x7a')])&&(this['trunks'][util[_0x1c02('0x56')](_0x1c02('0x113'),_0x414c80['name'])]['status']==='reachable'||this[_0x1c02('0x15')][util['format'](_0x1c02('0x113'),_0x414c80[_0x1c02('0x2a')])][_0x1c02('0x7a')]===_0x1c02('0x114'));};Preview[_0x1c02('0x68')]['run']=function(_0x3dd2d0,_0x4f0af3){var _0x506791=this;return new BPromise(function(_0x2281f3,_0x577bbc){_0x506791[_0x1c02('0x115')](_0x3dd2d0,_0x4f0af3)[_0x1c02('0x86')](function(_0x143b06){_0x2281f3(_[_0x1c02('0x75')](_0x143b06,[_0x1c02('0x61')]));})[_0x1c02('0x7c')](function(_0x54b343){if(_0x54b343[_0x1c02('0x116')]){rpcDb['unlockContact'](_0x3dd2d0);}if(_0x54b343['active']){rpcDb[_0x1c02('0x8e')](_0x3dd2d0);}_0x577bbc(_['pick'](_0x54b343,['message']));});});};Preview[_0x1c02('0x68')][_0x1c02('0x115')]=function(_0x150efb,_0x4bd4b3){var _0x28236c=this;return new BPromise(function(_0x1aa5cd,_0x9710ab){var _0x2d3769,_0x40cbdf;rpcDb[_0x1c02('0x117')](_0x150efb)[_0x1c02('0x86')](function(_0x16854f){if(!_[_0x1c02('0x6f')](_0x16854f[0x0])){_0x40cbdf=_0x16854f[0x0][_0x1c02('0x118')]?![]:!![];_0x2d3769=_0x16854f[0x0][_0x1c02('0x118')]?!![]:![];_0x2d3769=_0x4bd4b3?!![]:_0x2d3769;}var _0x566114=_0x28236c[_0x1c02('0x119')](_0x16854f);if(_0x566114[_0x1c02('0x11a')]){rpcDb[_0x1c02('0x11b')](_['pick'](_0x16854f[0x0],[_0x1c02('0x77'),_0x1c02('0x11c')]))[_0x1c02('0x86')](function(_0x5af33d){_0x28236c[_0x1c02('0x11d')](_0x5af33d,_0x16854f[0x0],_0x4bd4b3,_0x40cbdf,_0x2d3769)[_0x1c02('0x86')](function(_0x46a47d){_0x1aa5cd(_0x46a47d);})[_0x1c02('0x7c')](function(_0x3c0275){_0x9710ab(_0x3c0275);});})[_0x1c02('0x7c')](function(_0x25502e){ut[_0x1c02('0x63')](_0x1c02('0x11e'),_0x25502e);_0x9710ab(ut[_0x1c02('0x61')](_0x1c02('0x11f'),_0x40cbdf,_0x2d3769));});}else{_0x9710ab(ut[_0x1c02('0x61')](_0x566114['message'],_0x40cbdf,_0x2d3769));}})['catch'](function(_0x5afd8d){ut['logger'](_0x1c02('0x120'),_0x5afd8d);_0x9710ab(ut[_0x1c02('0x61')](_0x1c02('0x11f'),![],!![]));});});};Preview[_0x1c02('0x68')][_0x1c02('0x119')]=function(_0x13c1a6){if(_[_0x1c02('0x6f')](_0x13c1a6)||_[_0x1c02('0x106')](_0x13c1a6)||!_[_0x1c02('0x6f')](_0x13c1a6[0x0][_0x1c02('0x121')])&&_['isNil'](_0x13c1a6[0x0]['Agent'][_0x1c02('0x2a')])){ut['logger']('[Preview][validateContact][Empty\x20Contact]',_0x13c1a6);return{'isValid':![],'message':_0x1c02('0x122')};}var _0x16e933=this[_0x1c02('0x27')][_0x13c1a6[0x0][_0x1c02('0x71')][_0x1c02('0x2a')]];_0x16e933[_0x1c02('0x61')]='ACTIVE';if(_['isNil'](_0x16e933)){ut['logger'](_0x1c02('0x123'),_0x16e933);return{'isValid':![],'message':_0x1c02('0x124')};}if(!this[_0x1c02('0x9d')](_0x16e933[_0x1c02('0x53')])){ut[_0x1c02('0x63')](_0x1c02('0x125'),'campaign\x20Name:\x20'+_0x16e933[_0x1c02('0x2a')]+_0x1c02('0x126'));if(!this[_0x1c02('0x9d')](_0x16e933['TrunkBackup'])){ut[_0x1c02('0x63')]('[Preview][validateContact][Trunk\x20not\x20work]',_0x16e933[_0x1c02('0x2a')]+_0x1c02('0x127'));return{'isValid':![],'message':'Trunk\x20not\x20work'};}}if(!ut[_0x1c02('0x9c')](_0x16e933[_0x1c02('0x35')])){ut[_0x1c02('0x63')](_0x1c02('0x128'),_0x16e933[_0x1c02('0x2a')]+_0x1c02('0x129'));return{'isValid':![],'message':_0x1c02('0x12a')+_0x16e933[_0x1c02('0x2a')]+_0x1c02('0x129')};}return{'isValid':!![],'message':'Is\x20Valid'};};Preview['prototype'][_0x1c02('0x12b')]=function(_0x316d3a,_0x7b47ea,_0x2aee76,_0xd7f18b){var _0x309254=this;return new BPromise(function(_0x303273,_0x16a795){var _0x5477be=_0x316d3a[_0x1c02('0xb1')];var _0x45b7ff=_0x309254[_0x1c02('0x9d')](_0x7b47ea[_0x1c02('0x53')])?util[_0x1c02('0x56')](_0x1c02('0x12c'),_0x7b47ea[_0x1c02('0x53')][_0x1c02('0x2a')],_['isNil'](_0x7b47ea[_0x1c02('0x39')])?'':_0x7b47ea[_0x1c02('0x39')][_0x1c02('0x12d')]()||'',_0x7b47ea[_0x1c02('0x12e')]>0x0?_0x2aee76[_0x1c02('0x103')][_0x1c02('0x104')][_0x1c02('0x12f')](_0x7b47ea[_0x1c02('0x12e')]):_0x2aee76['Contact'][_0x1c02('0x104')]):util[_0x1c02('0x56')]('SIP/%s/%s%s',_['isNil'](_0x7b47ea[_0x1c02('0x130')])?_0x7b47ea[_0x1c02('0x53')][_0x1c02('0x2a')]:_0x7b47ea['TrunkBackup']['name'],_[_0x1c02('0x6f')](_0x7b47ea['dialPrefix'])?'':_0x7b47ea[_0x1c02('0x39')][_0x1c02('0x12d')]()||'',_0x7b47ea['dialCutDigit']>0x0?_0x2aee76['Contact'][_0x1c02('0x104')][_0x1c02('0x12f')](_0x7b47ea[_0x1c02('0x12e')]):_0x2aee76[_0x1c02('0x103')]['phone']);var _0x3ff488=_0x309254[_0x1c02('0x9d')](_0x7b47ea[_0x1c02('0x53')])?ut['getCallerId'](_0x7b47ea[_0x1c02('0x53')][_0x1c02('0x131')],_0x7b47ea[_0x1c02('0x37')],_0x7b47ea['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0x1c02('0x132')](_0x7b47ea[_0x1c02('0x133')],_0x7b47ea[_0x1c02('0x134')]):_0x7b47ea[_0x1c02('0x133')]):ut['getCallerId'](_['isNil'](_0x7b47ea['TrunkBackup'])?_0x7b47ea[_0x1c02('0x53')][_0x1c02('0x131')]:_0x7b47ea['TrunkBackup'][_0x1c02('0x131')],_0x7b47ea['dialOriginateCallerIdName'],_0x7b47ea[_0x1c02('0x134')]>0x0?ut[_0x1c02('0x132')](_0x7b47ea['dialOriginateCallerIdNumber'],_0x7b47ea['dialRandomLastDigitCallerIdNumber']):_0x7b47ea[_0x1c02('0x133')]);if(_0x3ff488){_0x316d3a['originatecalleridname']=ut[_0x1c02('0x135')](_0x3ff488);_0x316d3a[_0x1c02('0x136')]=ut[_0x1c02('0x137')](_0x3ff488);}var _0x262920=ut[_0x1c02('0x138')](_0x7b47ea,_0x2aee76,_0x45b7ff,_0x3ff488,_0x5477be,_0x316d3a);_[_0x1c02('0x139')](_0x316d3a,ut[_0x1c02('0x13a')](_0x262920));_0x316d3a[_0x1c02('0x8f')]=moment()[_0x1c02('0x56')](_0x1c02('0x90'));ami[_0x1c02('0x79')](ut[_0x1c02('0x13b')](_0x316d3a,_0x7b47ea,_0x262920,_0x316d3a['activeContact'],_0xd7f18b))[_0x1c02('0x86')](function(_0x2e39e1){var _0x1d2965=_0x316d3a[_0x1c02('0x13c')];if(!_[_0x1c02('0x6f')](_0x1d2965)){if(!_[_0x1c02('0x6f')](_0x309254[_0x1c02('0x17')][_0x1d2965])){_0x309254[_0x1c02('0x17')][_0x1d2965][_0x1c02('0x13d')]=_0x316d3a[_0x1c02('0x13e')];emit(util[_0x1c02('0x56')]('user:%s',_0x309254[_0x1c02('0x17')][_0x1d2965][_0x1c02('0x2a')]),'user:agentconnect',{'destaccountcode':_0x309254[_0x1c02('0x17')][_0x1d2965]['accountcode'],'destconnectedlinenum':_0x316d3a[_0x1c02('0x13e')]});}}_0x7b47ea[_0x1c02('0x5e')]+=0x1;logger['info'](_0x1c02('0x13f'),_0x5477be,_0x1c02('0xc1'),_0x7b47ea[_0x1c02('0x2a')],_0x1c02('0x73'),_0x7b47ea[_0x1c02('0x5e')]);_0x303273(_0x2e39e1);})[_0x1c02('0x7c')](function(_0x1109b8){ut[_0x1c02('0xf7')](_0x316d3a,0xe,_0x1c02('0x140'));rpcDb[_0x1c02('0xf9')](_0x316d3a,_0x1c02('0x141'));_0x16a795(_0x1109b8);});});};Preview['prototype']['syncNewExten']=function(_0x1b23ba){if(this['actions'][_0x1b23ba[_0x1c02('0xaf')]]){this[_0x1c02('0x16')][_0x1b23ba[_0x1c02('0xaf')]][_0x1c02('0x7b')]=_0x1b23ba[_0x1c02('0x7b')];}};Preview[_0x1c02('0x68')][_0x1c02('0x142')]=function(_0x4296fd){var _0x10f29e=this;var _0x26f5b4=this[_0x1c02('0x16')][_0x4296fd[_0x1c02('0x143')]];if(_0x26f5b4){if(_0x26f5b4[_0x1c02('0x105')]&&this[_0x1c02('0x17')][_0x26f5b4[_0x1c02('0x105')]]){ut[_0x1c02('0x144')](_0x26f5b4,this[_0x1c02('0x17')][_0x26f5b4[_0x1c02('0x105')]]['name'],this['agents'][_0x26f5b4[_0x1c02('0x105')]]['id']);}var _0x1ca8a0=_[_0x1c02('0x145')](_0x26f5b4);_0x1ca8a0[_0x1c02('0x146')]=moment()[_0x1c02('0x56')]('YYYY-MM-DD\x20HH:mm:ss');var _0x253882=_0x10f29e[_0x1c02('0x27')][_0x26f5b4[_0x1c02('0x72')]];if(ut[_0x1c02('0x147')](_0x4296fd['response'])){if(_0x26f5b4[_0x1c02('0xad')]){rpcDb[_0x1c02('0x148')](_0x26f5b4[_0x1c02('0x10a')]);}if(_0x26f5b4['activeContact']){rpcDb[_0x1c02('0x8e')](_0x26f5b4[_0x1c02('0x10a')]);}ami[_0x1c02('0x5c')](_0x1c02('0x149'),ut[_0x1c02('0xa4')](_0x26f5b4,_0x1c02('0x14a'),this[_0x1c02('0x27')][_0x26f5b4[_0x1c02('0x72')]]));this[_0x1c02('0xf4')](_0x1ca8a0,_0x253882,_0x4296fd);}else{_0x26f5b4[_0x1c02('0x8f')]=moment()[_0x1c02('0x56')]('YYYY-MM-DD\x20HH:mm:ss');ut[_0x1c02('0xf7')](_0x1ca8a0,0x4,_0x1c02('0xba'));rpcDb['createAgentHistory'](_0x1ca8a0,'[callProgressDetectingAgent][logAnswer]');}}};Preview[_0x1c02('0x68')][_0x1c02('0x14b')]=function(_0x45abd7){var _0x398a0c=this;var _0x46ca24=this[_0x1c02('0x16')][_0x45abd7[_0x1c02('0xaf')]];var _0x3977f1;if(_0x46ca24){_0x3977f1=this[_0x1c02('0x27')][_0x46ca24[_0x1c02('0x72')]];logger[_0x1c02('0x83')]('[syncHangup][talking]',_0x45abd7[_0x1c02('0xaf')],_0x1c02('0xc1'),_0x3977f1[_0x1c02('0x2a')],_0x1c02('0xb2'),_0x3977f1[_0x1c02('0x2e')]);}if(this['actions'][_0x45abd7['linkedid']]&&_0x45abd7[_0x1c02('0xaf')]!==_0x45abd7[_0x1c02('0xb1')]){if(_0x45abd7[_0x1c02('0x14c')]==='16'&&this[_0x1c02('0x16')][_0x45abd7[_0x1c02('0xaf')]][_0x1c02('0x74')]){this[_0x1c02('0xa0')](_0x45abd7,_0x45abd7[_0x1c02('0xaf')],_0x45abd7[_0x1c02('0x14c')]);}else if(this[_0x1c02('0x16')][_0x45abd7[_0x1c02('0xaf')]][_0x1c02('0x74')]){logger[_0x1c02('0x83')](_0x1c02('0x14d'),_0x45abd7['linkedid'],_0x45abd7['cause'],_0x1c02('0xc1'),_0x3977f1['name'],_0x1c02('0xb2'),_0x3977f1[_0x1c02('0x2e')]);this[_0x1c02('0xa0')](_0x45abd7,_0x45abd7[_0x1c02('0xaf')],_0x45abd7[_0x1c02('0x14c')]);}}else if(_0x46ca24&&_[_0x1c02('0x6f')](_0x46ca24[_0x1c02('0x14e')])&&_0x3977f1[_0x1c02('0x14f')]&&_0x45abd7['linkedid']===_0x45abd7[_0x1c02('0xb1')]&&_[_0x1c02('0x6f')](_0x45abd7[_0x1c02('0xf6')])&&_0x45abd7['cause']==='16'&&_0x45abd7['channelstate']==='6'&&_[_0x1c02('0x150')](_0x46ca24['transfer'])){if(_0x46ca24[_0x1c02('0xad')]){rpcDb[_0x1c02('0x148')](_0x46ca24['idContact']);}if(_0x46ca24[_0x1c02('0xae')]){rpcDb['disableContact'](_0x46ca24[_0x1c02('0x10a')]);}_0x45abd7['reason']='22';this['callProgressDetectingAgent'](_0x46ca24,_0x3977f1,_0x45abd7);}else if(_0x46ca24&&_0x46ca24[_0x1c02('0x151')]){if(_0x45abd7['cause']==='16'&&this[_0x1c02('0x16')][_0x45abd7[_0x1c02('0xaf')]][_0x1c02('0x74')]){logger[_0x1c02('0x83')](_0x1c02('0x152'),_0x45abd7[_0x1c02('0xaf')],_0x45abd7[_0x1c02('0x14c')],_0x1c02('0xc1'),_0x3977f1[_0x1c02('0x2a')],_0x1c02('0xb2'),_0x3977f1[_0x1c02('0x2e')]);this[_0x1c02('0xa0')](_0x45abd7,_0x45abd7[_0x1c02('0xaf')],_0x45abd7[_0x1c02('0x14c')]);}else if(this[_0x1c02('0x16')][_0x45abd7['linkedid']][_0x1c02('0x74')]){logger[_0x1c02('0x83')]('[syncHangup][talking][cause]',_0x45abd7[_0x1c02('0xaf')],_0x45abd7[_0x1c02('0x14c')],_0x1c02('0xc1'),_0x3977f1[_0x1c02('0x2a')],_0x1c02('0xb2'),_0x3977f1[_0x1c02('0x2e')]);this['callProgressDetectingCustomer'](_0x45abd7,_0x45abd7[_0x1c02('0xaf')],_0x45abd7[_0x1c02('0x14c')]);}}};Preview[_0x1c02('0x68')][_0x1c02('0x1e')]=function(_0x171cdb){if(this[_0x1c02('0x16')][_0x171cdb[_0x1c02('0xf3')]]&&_0x171cdb[_0x1c02('0xf3')]!==_0x171cdb[_0x1c02('0x153')]){this['callProgressDetectingCustomer'](_0x171cdb,_0x171cdb[_0x1c02('0xf3')],_0x171cdb[_0x1c02('0xed')]);}};Preview[_0x1c02('0x68')][_0x1c02('0x1d')]=function(_0x273e88){if(this[_0x1c02('0x16')][_0x273e88[_0x1c02('0xaf')]]&&_0x273e88[_0x1c02('0xaf')]!==_0x273e88[_0x1c02('0xb1')]&&!this[_0x1c02('0x16')][_0x273e88['linkedid']][_0x1c02('0x74')]){if(_0x273e88['cause']==='1'){this[_0x1c02('0xa0')](_0x273e88,_0x273e88[_0x1c02('0xaf')],_0x273e88['cause']);}}};Preview[_0x1c02('0x68')][_0x1c02('0x154')]=function(_0x4b7ac9,_0xc722c,_0x15dd71){if(this['actions'][_0x4b7ac9]){if(_['isNil'](this[_0x1c02('0x16')][_0x4b7ac9][_0x1c02('0x155')])){this[_0x1c02('0x16')][_0x4b7ac9][_0x1c02('0x155')]={};}this[_0x1c02('0x16')][_0x4b7ac9]['variables'][_0xc722c]=_0x15dd71;}};Preview[_0x1c02('0x68')][_0x1c02('0x21')]=function(_0x2fb8b7){try{if(!_['isNil'](_0x2fb8b7)){if(ut[_0x1c02('0x156')](_[_0x1c02('0x157')](_0x2fb8b7[_0x1c02('0x158')])[0x0])){this[_0x1c02('0x154')](_0x2fb8b7[_0x1c02('0xb1')],_[_0x1c02('0x157')](_0x2fb8b7[_0x1c02('0x158')])[0x0],_0x2fb8b7[_0x1c02('0x159')]);}}}catch(_0x3de4e7){logger[_0x1c02('0x15a')](_0x1c02('0x15b'),util[_0x1c02('0x15c')](_0x3de4e7,{'showHidden':![],'depth':null}));}};Preview['prototype']['syncAttendedTransfer']=function(_0x19dc80){if(_0x19dc80){if(this[_0x1c02('0x16')][_0x19dc80[_0x1c02('0x15d')]]){this[_0x1c02('0x16')][_0x19dc80[_0x1c02('0x15d')]][_0x1c02('0x151')]=!![];}}};Preview[_0x1c02('0x68')][_0x1c02('0x25')]=function(_0xb9a706){if(_0xb9a706){if(this[_0x1c02('0x16')][_0xb9a706['transfererlinkedid']]){this[_0x1c02('0x16')][_0xb9a706[_0x1c02('0x15e')]][_0x1c02('0x151')]=!![];}}};module[_0x1c02('0x15f')]=Preview; \ No newline at end of file +var _0x545d=['run','[RecallMe]','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','logCustomer','dialRecallInQueue','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[HistoryRecallClose]','setMessage','AGENTS_NOT_LOGGED','isActive','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','countnosuchnumberretry','countglobal','NoSuchNumber','buildObj','Global','createCustomerFinal','[callProgressDetectingCustomer][logNoSuchGlobal]','dialNoSuchNumberMaxRetry','rescheduleContact','scheduledAt','unlockAgent','activeContact','linkedid','ANSWER','[syncHangup][talking][increment]','uniqueid','custom:agentconnect','connect','acw','custom:agentcomplete','complete','[16]','totalGlobal','Answer','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','sumDuration','talktime','\x20Queue','outboundBusyCallsDay','countbusyretry','Busy','custom:agentbusy','dialGlobalMaxRetry','cloneAction','[callProgressDetectingCustomer][logBusyGlobal]','dialBusyMaxRetry','[callProgressDetectingCustomer][logBusy]','dialBusyRetryFrequency','NOANSWER','outboundNoAnswerCallsDay','custom:agentnoanswer','noanswer','[callProgressDetectingCustomer][logNoAnswerGlobal]','countnoanswerretry','[callProgressDetectingCustomer][logNoAnswer]','dialNoAnswerRetryFrequency','CONGESTION','outboundCongestionCallsDay','Congestion','custom:agentcongestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','countcongestionretry','dialCongestionMaxRetry','CANCEL','countagentrejectretry','AgentReject','custom:agentreject','[syncHangupRequest][logAgentReject]','[callProgressDetectingCustomer][logAgentReject]','dialAgentRejectMaxRetry','ABANDONED','countabandonedretry','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','countmachineretry','cause-txt','dialstatus','custom:amd','amd','[callProgressDetectingCustomer][hangupInAMD]','[callProgressDetectingCustomer][machine]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','object','isUndefined','reason','logAgent','[callProgressDetectingAgent][logNoSuch]','NoAnswer','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','checkInBlack','Contact','VoiceQueueId','Contact\x20is\x20undefined','lookAgent','execCall','then','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','idContact','custom:agentcalled','called','[Preview][execCall][failure]','logBlacklist','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','SIP/%s','reachable','unmonitored','execRun','unlock','getContactPreview','recallme','validateContact','isValid','checkIsBlackList','Contact.phone','[Preview][checkIsBlackList]','[Preview][getContactPreview]','Call\x20unsuccessful','isEmpty','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','[Preview][validateContact][Trunk\x20not\x20work]','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20work','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','campaign\x20Name:\x20','Is\x20Valid','SIP/%s/%s%s','phone','dialCutDigit','trim','substring','getCallerId','callerid','dialOriginateCallerIdNumber','dialRandomLastDigitCallerIdNumber','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','toLowerVariables','channelAgent','destconnectedlinenum','calleridnum','user:%s','accountcode','[originated][increment]','originated:\x20','OriginateError','syncNewExten','actionid','logLookAgent','clone','responsetime','isFailure','unlockContact','custom:agentringnoanswer','rejected','[callProgressDetectingAgent][logAnswer]','cause','[syncHangup][talking][cause]','statedesc','dialQueueProject','channelstate','transfer','destuniqueid','addVariable','variables','filterKey','keys','variable','value','error','inspect','syncAttendedTransfer','transfertargetlinkedid','syncBlindTransfer','exports','util','lodash','bluebird','uuid','moment','ioredis','../../../config/environment','../../../config/logger','preview','actionPreview','../ami','./rpcDb','./util/util','redis','localhost','prototype','tail','finally','sequence','campaignsPreview','voiceQueues','trunks','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','hangup','syncHangup','hanguprequest','syncHangupRequest','dialend','syncDialEnd','newexten','syncVarSet','attendedtransfer','blindtransfer','loopCampaigns','emit','type','outbound','name','strategy','answered','available','loggedIn','sumBillable','sumHoldTime','talking','total','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateTimeout','dialPrefix','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundDropCallsDayACS','outboundDropCallsDayTimeout','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','originated','erlangCallToSecond','erlangBusyFactor','startProgressive','Trunk','active','Interval','stringify','md5','format','voice:queue:%s','voice_queue:save','info','voice_queue_channel:remove','pTalking','sendMessageOneNotActive','paused','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','message','IS_DISACTIVED','\x20is\x20disactive','syncCampaigns','hasOwnProperty','clearZombieChannels','recallMe','clearZombieChannel','isNil','actions','[clearZombieChannels][talking]','Queue','pTalking:\x20','queue','dialAnswer','pick','contactId','UserId','Action','status','channel','catch','updateOriginated','[clearZombieChannel]','decrementTalkink','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','[action]','size','getContactRecallMe','agentReadyId','length','scheduledat','dialRecallMeTimeout','Agent'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x545d,0xce));var _0xd545=function(_0x1b674b,_0x850ab8){_0x1b674b=_0x1b674b-0x0;var _0x2f62cf=_0x545d[_0x1b674b];return _0x2f62cf;};'use strict';var util=require(_0xd545('0x0'));var _=require(_0xd545('0x1'));var BPromise=require(_0xd545('0x2'));var uuid=require(_0xd545('0x3'));var moment=require(_0xd545('0x4'));var md5=require('md5');var Redis=require(_0xd545('0x5'));var config=require(_0xd545('0x6'));var logger=require(_0xd545('0x7'))(_0xd545('0x8'));var loggerAction=require('../../../config/logger')(_0xd545('0x9'));var ami=require(_0xd545('0xa'));var rpcDb=require(_0xd545('0xb'));var Action=require('./action');var ut=require(_0xd545('0xc'));config[_0xd545('0xd')]=_['defaults'](config[_0xd545('0xd')],{'host':_0xd545('0xe'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xd545('0xd')]));var Sequence=function(){};Sequence[_0xd545('0xf')]['enqueue']=function(_0x380dcd){this[_0xd545('0x10')]=this['tail']?this[_0xd545('0x10')][_0xd545('0x11')](_0x380dcd):_0x380dcd();};function Preview(_0x1c7dae){this[_0xd545('0x12')]=new Sequence();this[_0xd545('0x13')]=_0x1c7dae[_0xd545('0x14')];this[_0xd545('0x15')]=_0x1c7dae[_0xd545('0x15')];this['actions']={};this[_0xd545('0x16')]=_0x1c7dae[_0xd545('0x16')];this[_0xd545('0x17')]=0x0;ami['on'](_0xd545('0x18'),this[_0xd545('0x19')][_0xd545('0x1a')](this));ami['on'](_0xd545('0x1b'),this[_0xd545('0x1c')][_0xd545('0x1a')](this));ami['on'](_0xd545('0x1d'),this[_0xd545('0x1e')][_0xd545('0x1a')](this));ami['on'](_0xd545('0x1f'),this[_0xd545('0x20')][_0xd545('0x1a')](this));ami['on'](_0xd545('0x21'),this['syncNewExten'][_0xd545('0x1a')](this));ami['on']('varset',this[_0xd545('0x22')][_0xd545('0x1a')](this));ami['on'](_0xd545('0x23'),this['syncAttendedTransfer'][_0xd545('0x1a')](this));ami['on'](_0xd545('0x24'),this['syncBlindTransfer'][_0xd545('0x1a')](this));this[_0xd545('0x25')](this['campaignsPreview']);}function emit(_0x2f029e,_0x5caa1a,_0x4e086){io['to'](_0x2f029e)[_0xd545('0x26')](_0x5caa1a,_0x4e086);}function emitCampaignPreview(_0x2bb7f1){if(_0x2bb7f1[_0xd545('0x27')]===_0xd545('0x28')){var _0x41dac7={'id':_0x2bb7f1['id'],'name':_0x2bb7f1[_0xd545('0x29')],'strategy':_0x2bb7f1[_0xd545('0x2a')],'answered':_0x2bb7f1[_0xd545('0x2b')],'available':_0x2bb7f1[_0xd545('0x2c')],'loggedIn':_0x2bb7f1[_0xd545('0x2d')],'pTalking':_0x2bb7f1['pTalking'],'sumBillable':_0x2bb7f1[_0xd545('0x2e')],'sumDuration':_0x2bb7f1['sumDuration'],'sumHoldTime':_0x2bb7f1[_0xd545('0x2f')]||0x0,'talking':_0x2bb7f1[_0xd545('0x30')],'total':_0x2bb7f1[_0xd545('0x31')],'type':_0x2bb7f1['type'],'unmanaged':_0x2bb7f1[_0xd545('0x32')],'abandoned':_0x2bb7f1[_0xd545('0x33')],'waiting':_0x2bb7f1[_0xd545('0x34')],'loggedInDb':_0x2bb7f1[_0xd545('0x35')],'dialActive':_0x2bb7f1[_0xd545('0x36')],'dialMethod':_0x2bb7f1[_0xd545('0x37')],'dialOriginateCallerIdName':_0x2bb7f1['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x2bb7f1['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x2bb7f1[_0xd545('0x38')],'dialPrefix':_0x2bb7f1[_0xd545('0x39')],'outboundAnswerAgiCallsDay':_0x2bb7f1['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x2bb7f1[_0xd545('0x3a')],'outboundBlacklistCallsDay':_0x2bb7f1[_0xd545('0x3b')],'outboundBusyCallsDay':_0x2bb7f1['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x2bb7f1['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x2bb7f1[_0xd545('0x3c')],'outboundDropCallsDayCallersExit':_0x2bb7f1['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x2bb7f1[_0xd545('0x3d')],'outboundNoAnswerCallsDay':_0x2bb7f1['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x2bb7f1[_0xd545('0x3e')],'outboundOriginateFailureCallsDay':_0x2bb7f1[_0xd545('0x3f')],'outboundReCallsDay':_0x2bb7f1[_0xd545('0x40')],'outboundRejectCallsDay':_0x2bb7f1[_0xd545('0x41')],'outboundUnknownCallsDay':_0x2bb7f1[_0xd545('0x42')],'outboundAbandonedCallsDay':_0x2bb7f1[_0xd545('0x43')],'predictiveIntervalAnsweredCalls':_0x2bb7f1[_0xd545('0x44')],'predictiveIntervalAvgHoldtime':_0x2bb7f1[_0xd545('0x45')],'predictiveIntervalAvgTalktime':_0x2bb7f1[_0xd545('0x46')],'predictiveIntervalDroppedCallsCallersExit':_0x2bb7f1[_0xd545('0x47')],'predictiveIntervalDroppedCallsTimeout':_0x2bb7f1[_0xd545('0x48')],'predictiveIntervalErlangCalls':_0x2bb7f1[_0xd545('0x49')],'predictiveIntervalErlangCallsDroppedCalls':_0x2bb7f1[_0xd545('0x4a')],'predictiveIntervalHitRate':_0x2bb7f1[_0xd545('0x4b')],'predictiveIntervalMultiplicativeFactor':_0x2bb7f1[_0xd545('0x4c')],'predictiveIntervalPauses':_0x2bb7f1[_0xd545('0x4d')],'predictiveIntervalAvailable':_0x2bb7f1[_0xd545('0x4e')],'predictiveIntervalTotalCalls':_0x2bb7f1['predictiveIntervalTotalCalls'],'message':_0x2bb7f1['message'],'originated':_0x2bb7f1[_0xd545('0x4f')],'erlangCalls':_0x2bb7f1['erlangCalls'],'erlangCallToSecond':_0x2bb7f1[_0xd545('0x50')],'erlangAbandonmentRate':_0x2bb7f1['erlangAbandonmentRate'],'erlangBusyFactor':_0x2bb7f1[_0xd545('0x51')],'startPredictive':_0x2bb7f1['startPredictive'],'startProgressive':_0x2bb7f1[_0xd545('0x52')]};if(_0x2bb7f1['Trunk']){_0x41dac7[_0xd545('0x53')]={'id':_0x2bb7f1[_0xd545('0x53')]['id'],'name':_0x2bb7f1['Trunk'][_0xd545('0x29')],'active':_0x2bb7f1['Trunk'][_0xd545('0x54')],'callerid':_0x2bb7f1[_0xd545('0x53')]['callerid']};}if(_0x2bb7f1[_0xd545('0x55')]){_0x41dac7['Interval']={'id':_0x2bb7f1[_0xd545('0x55')]['id'],'name':_0x2bb7f1[_0xd545('0x55')][_0xd545('0x29')]};}var _0xdd6e3b=md5(JSON[_0xd545('0x56')](_0x41dac7));if(_0x2bb7f1[_0xd545('0x57')]!==_0xdd6e3b){_0x2bb7f1[_0xd545('0x57')]=_0xdd6e3b;emit(util[_0xd545('0x58')](_0xd545('0x59'),_0x41dac7[_0xd545('0x29')]),_0xd545('0x5a'),_0x41dac7);}}}function emitVoiceQueueChannelRemove(_0x89c5a4){logger[_0xd545('0x5b')]('[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event',JSON[_0xd545('0x56')](_0x89c5a4));emit(util[_0xd545('0x58')]('voice:queue:%s',_0x89c5a4[_0xd545('0x29')]),_0xd545('0x5c'),_0x89c5a4);io[_0xd545('0x26')]('voice_queue_presence:remove',_0x89c5a4);}function notSendMessagesQueue(_0x30d587){if(_0x30d587['sendMessageOneNotActive']){if(_0x30d587['originated']===0x0&&_0x30d587[_0xd545('0x5d')]===0x0){_0x30d587[_0xd545('0x5e')]=![];_0x30d587['available']=0x0;_0x30d587[_0xd545('0x5f')]=0x0;_0x30d587['message']=_0xd545('0x60');ut[_0xd545('0x61')](_0xd545('0x62'),_0x30d587['name']+_0xd545('0x63'));}else{_0x30d587[_0xd545('0x64')]=_0xd545('0x65');ut['logger'](_0xd545('0x62'),_0x30d587[_0xd545('0x29')]+_0xd545('0x66'));}emitCampaignPreview(_0x30d587);}}Preview[_0xd545('0xf')][_0xd545('0x25')]=function(){var _0x2e038e=this;setInterval(function(){_0x2e038e[_0xd545('0x67')]();},0x7cf);};Preview['prototype'][_0xd545('0x67')]=function(){var _0x2fd271=this[_0xd545('0x13')];this[_0xd545('0x17')]+=0x1;for(var _0x4de13a in _0x2fd271){if(_0x2fd271[_0xd545('0x68')](_0x4de13a)&&(_0x2fd271[_0x4de13a][_0xd545('0x37')]===_0xd545('0x8')||_0x2fd271[_0x4de13a]['dialMethod']==='booked')&&_0x2fd271[_0x4de13a]['type']===_0xd545('0x28')){if(this['clockClearZombieChannels']>0x7){this[_0xd545('0x17')]=0x0;this[_0xd545('0x69')]();}}if(_0x2fd271[_0xd545('0x68')](_0x4de13a)&&_0x2fd271[_0x4de13a][_0xd545('0x37')]===_0xd545('0x8')&&_0x2fd271[_0x4de13a][_0xd545('0x27')]==='outbound'){if(_0x2fd271[_0x4de13a][_0xd545('0x36')]){this['setMessage'](_0x2fd271[_0x4de13a]);this[_0xd545('0x6a')](_0x2fd271[_0x4de13a]);}else{notSendMessagesQueue(_0x2fd271[_0x4de13a]);}}}};Preview[_0xd545('0xf')][_0xd545('0x6b')]=function(_0xe6d49b){var _0x1e7984=this;this[_0xd545('0x12')]['enqueue'](function(){if(!_[_0xd545('0x6c')](_0x1e7984[_0xd545('0x6d')][_0xe6d49b])){loggerAction[_0xd545('0x5b')](_0xd545('0x6e'),_0xe6d49b,_0xd545('0x6f'),_0x1e7984['actions'][_0xe6d49b]['queue'],'originated:\x20',JSON[_0xd545('0x56')](_0x1e7984[_0xd545('0x13')][_0x1e7984['actions'][_0xe6d49b]['queue']][_0xd545('0x4f')]),_0xd545('0x70'),JSON[_0xd545('0x56')](_0x1e7984[_0xd545('0x13')][_0x1e7984[_0xd545('0x6d')][_0xe6d49b][_0xd545('0x71')]][_0xd545('0x5d')]),JSON[_0xd545('0x56')](_0x1e7984[_0xd545('0x6d')][_0xe6d49b][_0xd545('0x72')]),JSON[_0xd545('0x56')](_[_0xd545('0x73')](_0x1e7984[_0xd545('0x6d')][_0xe6d49b],[_0xd545('0x74'),_0xd545('0x75'),'VoiceQueueId','ListId'])));return ami[_0xd545('0x76')]({'action':_0xd545('0x77'),'channel':_0x1e7984[_0xd545('0x6d')][_0xe6d49b][_0xd545('0x78')]})[_0xd545('0x79')](function(_0xcddbc6){if(_0xcddbc6['message']==='No\x20such\x20channel'){setTimeout(function(){if(_0x1e7984[_0xd545('0x6d')][_0xe6d49b]){ut[_0xd545('0x7a')](_0x1e7984[_0xd545('0x13')][_0x1e7984['actions'][_0xe6d49b][_0xd545('0x71')]],_0xd545('0x7b'));if(_0x1e7984[_0xd545('0x6d')][_0xe6d49b][_0xd545('0x72')]===!![]){ut[_0xd545('0x7c')](_0x1e7984['campaignsPreview'][_0x1e7984[_0xd545('0x6d')][_0xe6d49b]['queue']],_0xd545('0x7b'));ut[_0xd545('0x7d')](_0xd545('0x7e')+_0xe6d49b,_0x1e7984[_0xd545('0x6d')][_0xe6d49b][_0xd545('0x71')]);}ut[_0xd545('0x7d')](_0xd545('0x7f')+_0xe6d49b,_0x1e7984[_0xd545('0x6d')][_0xe6d49b]['queue']);delete _0x1e7984['actions'][_0xe6d49b];}},0x2328);}});}});};Preview[_0xd545('0xf')][_0xd545('0x69')]=function(){var _0x5b481d=this;loggerAction[_0xd545('0x5b')](_0xd545('0x80'),_[_0xd545('0x81')](this[_0xd545('0x6d')]));for(var _0x3cf66f in this[_0xd545('0x6d')]){if(_0x5b481d[_0xd545('0x6d')][_0xd545('0x68')](_0x3cf66f)){_0x5b481d[_0xd545('0x6b')](_0x3cf66f);}}};Preview['prototype'][_0xd545('0x6a')]=function(_0x5f4312){var _0xe6bc3b=this;rpcDb[_0xd545('0x82')](_0x5f4312['id'],ut[_0xd545('0x83')](this['agents']))['then'](function(_0x38c3be){if(!_[_0xd545('0x6c')](_0x38c3be)){for(var _0x4e6992=0x0;_0x4e6992<_0x38c3be[_0xd545('0x84')];_0x4e6992+=0x1){if(ut['getDiff'](_0x38c3be[_0x4e6992][_0xd545('0x85')])<_0x5f4312[_0xd545('0x86')]*0x3c){if(_0x38c3be[_0x4e6992][_0xd545('0x87')]&&!_0x38c3be[_0x4e6992][_0xd545('0x87')]['voicePause']){_0xe6bc3b[_0xd545('0x88')](_0x38c3be[_0x4e6992]['id'])['then'](ut['logger2']('[RecallMe]'))['catch'](ut['logger2'](_0xd545('0x89')));}else{rpcDb[_0xd545('0x8a')](_0x38c3be[_0x4e6992]['id']);}}else{var _0x4a917a=new Action(_0x38c3be[_0x4e6992],_0x5f4312);_0x4a917a[_0xd545('0x8b')]=moment()[_0xd545('0x58')](_0xd545('0x8c'));_0x5f4312[_0xd545('0x40')]+=0x1;ut[_0xd545('0x8d')](_0x4a917a,0x17,'RecallInQueue');if(_0x5f4312[_0xd545('0x8e')]){rpcDb['rescheduleContactInQueue'](ut['createBody'](_0x38c3be[_0x4e6992]));rpcDb[_0xd545('0x8f')](_0x4a917a,_0xd545('0x90'));}else{ut[_0xd545('0x8d')](_0x4a917a,0x16,_0xd545('0x91'));rpcDb['createCustomerHistory'](_0x4a917a,_0xd545('0x92'));rpcDb['createCustomerFinal'](_0x4a917a,_0xd545('0x92'));}}}}})[_0xd545('0x79')](ut['logger2']('[getContactRecallMe]'));};Preview[_0xd545('0xf')][_0xd545('0x93')]=function(_0x436aeb){_0x436aeb[_0xd545('0x5e')]=!![];if(ut['IsNotLoggedIn'](_0x436aeb[_0xd545('0x2d')])){_0x436aeb[_0xd545('0x64')]=_0xd545('0x94');}else if(!ut[_0xd545('0x95')](_0x436aeb[_0xd545('0x36')])){_0x436aeb['message']=_0xd545('0x60');}else if(!this['isTrunkReachable'](_0x436aeb[_0xd545('0x53')])){if(!this[_0xd545('0x96')](_0x436aeb[_0xd545('0x97')])){_0x436aeb[_0xd545('0x64')]=_0xd545('0x98');}else{_0x436aeb[_0xd545('0x64')]=_0xd545('0x99');}}else{_0x436aeb[_0xd545('0x64')]='ACTIVE';}emitCampaignPreview(_0x436aeb);};Preview[_0xd545('0xf')][_0xd545('0x9a')]=function(_0x14d062,_0x188846,_0x15b499){var _0x51fa69=this;var _0x3c72fa=this[_0xd545('0x6d')][_0x188846];var _0x180821=this[_0xd545('0x13')][_0x3c72fa[_0xd545('0x71')]];var _0xe97508;if(_0x180821){switch(_0x15b499){case'1':_0x180821['outboundNoSuchCallsDay']+=0x1;_0x3c72fa[_0xd545('0x9b')]+=0x1;_0x3c72fa[_0xd545('0x9c')]=ut['totalGlobal'](_0x3c72fa);ut[_0xd545('0x8d')](_0x3c72fa,0x0,_0xd545('0x9d'));ami[_0xd545('0x26')]('custom:agentnosuchnumber',ut[_0xd545('0x9e')](_0x3c72fa,'nosuchnumber'));rpcDb[_0xd545('0x8f')](_0x3c72fa,'[callProgressDetectingCustomer][logNoSuch]');if(ut['totalGlobal'](_0x3c72fa)>=_0x180821['dialGlobalMaxRetry']){_0xe97508=ut['cloneAction'](_0x3c72fa,0xf,_0xd545('0x9f'));rpcDb[_0xd545('0xa0')](_0xe97508,_0xd545('0xa1'));}else{if(_0x3c72fa[_0xd545('0x9b')]>=_0x180821[_0xd545('0xa2')]){rpcDb[_0xd545('0xa0')](_0x3c72fa,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{rpcDb[_0xd545('0xa3')](ut[_0xd545('0xa4')](_0x3c72fa,_0xd545('0x9b'),_0x180821['dialNoSuchNumberRetryFrequency']),_0x3c72fa[_0xd545('0xa5')],_0x3c72fa[_0xd545('0xa6')]);}}delete this[_0xd545('0x6d')][_0x14d062[_0xd545('0xa7')]];break;case _0xd545('0xa8'):var _0x439df2=moment()[_0xd545('0x58')]('YYYY-MM-DD\x20HH:mm:ss');_0x3c72fa['responsetime']=_0x439df2;_0x3c72fa['answertime']=_0x439df2;_0x3c72fa[_0xd545('0x72')]=!![];_0x180821[_0xd545('0x5d')]+=0x1;logger[_0xd545('0x5b')](_0xd545('0xa9'),_0x3c72fa[_0xd545('0xaa')],'\x20Queue',_0x180821[_0xd545('0x29')],'pTalking:\x20',_0x180821[_0xd545('0x5d')]);ami['emit'](_0xd545('0xab'),ut['buildObj'](_0x3c72fa,_0xd545('0xac'),this[_0xd545('0x13')][_0x3c72fa[_0xd545('0x71')]]));if(_0x180821[_0xd545('0xad')]){ami[_0xd545('0x26')]('custom:agentConnectPreview',ut['buildAcw'](_0x3c72fa));}break;case'16':ami[_0xd545('0x26')](_0xd545('0xae'),ut[_0xd545('0x9e')](_0x3c72fa,_0xd545('0xaf'),this['campaignsPreview'][_0x3c72fa[_0xd545('0x71')]]));emitVoiceQueueChannelRemove(ut['buildObj'](_0x3c72fa,_0xd545('0xaf')));_0x180821[_0xd545('0x3a')]+=0x1;_0x180821[_0xd545('0x31')]+=0x1;_0x180821['answered']+=0x1;ut[_0xd545('0x7c')](_0x180821,_0xd545('0xb0'));_0x3c72fa[_0xd545('0x9c')]=ut[_0xd545('0xb1')](_0x3c72fa);ut[_0xd545('0x8d')](_0x3c72fa,0x4,_0xd545('0xb2'));rpcDb['createCustomerHistory'](_0x3c72fa,'[callProgressDetectingCustomer][logAnswer]');rpcDb[_0xd545('0xa0')](_0x3c72fa,_0xd545('0xb3'));rpcDb[_0xd545('0xb4')](_0x3c72fa);_0x180821[_0xd545('0xb5')]+=_0x3c72fa[_0xd545('0xb6')];_0x180821['sumBillable']+=_0x3c72fa[_0xd545('0xb6')];logger['info']('[syncHangup][talking][decrement]',_0x3c72fa[_0xd545('0xaa')],_0xd545('0xb7'),_0x180821[_0xd545('0x29')],_0xd545('0x70'),_0x180821[_0xd545('0x5d')]);delete this[_0xd545('0x6d')][_0x14d062[_0xd545('0xa7')]];break;case'BUSY':_0x180821[_0xd545('0xb8')]+=0x1;_0x3c72fa[_0xd545('0xb9')]+=0x1;_0x3c72fa[_0xd545('0x9c')]=ut[_0xd545('0xb1')](_0x3c72fa);ut[_0xd545('0x8d')](_0x3c72fa,0x5,_0xd545('0xba'));ami[_0xd545('0x26')](_0xd545('0xbb'),ut['buildObj'](_0x3c72fa,'busy'));rpcDb[_0xd545('0x8f')](_0x3c72fa,'[callProgressDetectingCustomer][logBusy]');if(ut['totalGlobal'](_0x3c72fa)>=_0x180821[_0xd545('0xbc')]){_0xe97508=ut[_0xd545('0xbd')](_0x3c72fa,0xf,_0xd545('0x9f'));rpcDb[_0xd545('0xa0')](_0xe97508,_0xd545('0xbe'));}else{if(_0x3c72fa[_0xd545('0xb9')]>=_0x180821[_0xd545('0xbf')]){rpcDb[_0xd545('0xa0')](_0x3c72fa,_0xd545('0xc0'));}else{rpcDb[_0xd545('0xa3')](ut[_0xd545('0xa4')](_0x3c72fa,_0xd545('0xb9'),_0x180821[_0xd545('0xc1')]),_0x3c72fa['unlockAgent'],_0x3c72fa[_0xd545('0xa6')]);}}break;case _0xd545('0xc2'):_0x180821[_0xd545('0xc3')]+=0x1;_0x3c72fa['countnoanswerretry']+=0x1;_0x3c72fa['countglobal']=ut[_0xd545('0xb1')](_0x3c72fa);ut[_0xd545('0x8d')](_0x3c72fa,0x3,'NoAnswer');ami[_0xd545('0x26')](_0xd545('0xc4'),ut[_0xd545('0x9e')](_0x3c72fa,_0xd545('0xc5')));rpcDb['createCustomerHistory'](_0x3c72fa,'[callProgressDetectingCustomer][logNoAnswer]');if(ut['totalGlobal'](_0x3c72fa)>=_0x180821[_0xd545('0xbc')]){_0xe97508=ut[_0xd545('0xbd')](_0x3c72fa,0xf,'Global');rpcDb[_0xd545('0xa0')](_0xe97508,_0xd545('0xc6'));}else{if(_0x3c72fa[_0xd545('0xc7')]>=_0x180821['dialNoAnswerMaxRetry']){rpcDb[_0xd545('0xa0')](_0x3c72fa,_0xd545('0xc8'));}else{rpcDb['rescheduleContact'](ut[_0xd545('0xa4')](_0x3c72fa,_0xd545('0xc7'),_0x180821[_0xd545('0xc9')]),_0x3c72fa[_0xd545('0xa5')],_0x3c72fa['activeContact']);}}break;case _0xd545('0xca'):_0x180821[_0xd545('0xcb')]+=0x1;_0x3c72fa['countcongestionretry']+=0x1;_0x3c72fa[_0xd545('0x9c')]=ut['totalGlobal'](_0x3c72fa);ut[_0xd545('0x8d')](_0x3c72fa,0x8,_0xd545('0xcc'));ami['emit'](_0xd545('0xcd'),ut[_0xd545('0x9e')](_0x3c72fa,'congestion'));rpcDb['createCustomerHistory'](_0x3c72fa,_0xd545('0xce'));if(ut[_0xd545('0xb1')](_0x3c72fa)>=_0x180821[_0xd545('0xbc')]){_0xe97508=ut[_0xd545('0xbd')](_0x3c72fa,0xf,_0xd545('0x9f'));rpcDb[_0xd545('0xa0')](_0xe97508,_0xd545('0xcf'));}else{if(_0x3c72fa[_0xd545('0xd0')]>=_0x180821[_0xd545('0xd1')]){rpcDb[_0xd545('0xa0')](_0x3c72fa,_0xd545('0xce'));}else{rpcDb[_0xd545('0xa3')](ut[_0xd545('0xa4')](_0x3c72fa,_0xd545('0xd0'),_0x180821['dialBusyRetryFrequency']),_0x3c72fa[_0xd545('0xa5')],_0x3c72fa[_0xd545('0xa6')]);}}break;case _0xd545('0xd2'):_0x180821[_0xd545('0x41')]+=0x1;_0x3c72fa[_0xd545('0xd3')]+=0x1;_0x3c72fa[_0xd545('0x9c')]=ut[_0xd545('0xb1')](_0x3c72fa);ut[_0xd545('0x8d')](_0x3c72fa,0x14,_0xd545('0xd4'));ami[_0xd545('0x26')](_0xd545('0xd5'),ut['buildObj'](_0x3c72fa,'agentreject'));rpcDb['createCustomerHistory'](_0x3c72fa,_0xd545('0xd6'));if(ut[_0xd545('0xb1')](_0x3c72fa)>=_0x180821[_0xd545('0xbc')]){_0xe97508=ut[_0xd545('0xbd')](_0x3c72fa,0x14,_0xd545('0xd4'));rpcDb['createCustomerFinal'](_0xe97508,_0xd545('0xd7'));}else{if(_0x3c72fa[_0xd545('0xd3')]>=_0x180821[_0xd545('0xd8')]){rpcDb[_0xd545('0xa0')](_0x3c72fa,_0xd545('0xd7'));}else{rpcDb[_0xd545('0xa3')](ut[_0xd545('0xa4')](_0x3c72fa,_0xd545('0xd3'),_0x180821['dialAgentRejectRetryFrequency']),_0x3c72fa[_0xd545('0xa5')],_0x3c72fa[_0xd545('0xa6')]);}}break;case _0xd545('0xd9'):_0x180821[_0xd545('0x43')]+=0x1;_0x3c72fa[_0xd545('0xda')]+=0x1;_0x3c72fa[_0xd545('0x9c')]=ut[_0xd545('0xb1')](_0x3c72fa);ut[_0xd545('0x8d')](_0x3c72fa,0xb,'Abandoned');rpcDb[_0xd545('0x8f')](_0x3c72fa,_0xd545('0xdb'));if(ut[_0xd545('0xb1')](_0x3c72fa)>=_0x180821['dialGlobalMaxRetry']){_0xe97508=ut[_0xd545('0xbd')](_0x3c72fa,0xf,_0xd545('0x9f'));rpcDb[_0xd545('0xa0')](_0xe97508,'[callProgressDetectingCustomer][logAbandoned]');}else{if(_0x3c72fa[_0xd545('0xdc')]>=_0x180821[_0xd545('0xdd')]){rpcDb['createCustomerFinal'](_0x3c72fa,_0xd545('0xdb'));}else{rpcDb[_0xd545('0xa3')](ut['scheduledAt'](_0x3c72fa,_0xd545('0xda'),_0x180821['dialAbandonedRetryFrequency']),_0x3c72fa['unlockAgent'],_0x3c72fa['activeContact']);}}break;case'18':_0x180821[_0xd545('0x42')]+=0x1;_0x3c72fa[_0xd545('0xde')]+=0x1;_0x3c72fa[_0xd545('0x9c')]=ut[_0xd545('0xb1')](_0x3c72fa);ut['logCustomer'](_0x3c72fa,0x12,_0x14d062[_0xd545('0xdf')]||_0x14d062[_0xd545('0xe0')]);ami['emit'](_0xd545('0xe1'),ut[_0xd545('0x9e')](_0x3c72fa,_0xd545('0xe2')));rpcDb['createCustomerHistory'](_0x3c72fa,_0xd545('0xe3'));if(ut[_0xd545('0xb1')](_0x3c72fa)>=_0x180821[_0xd545('0xbc')]){_0xe97508=ut['cloneAction'](_0x3c72fa,0xf,_0xd545('0x9f'));rpcDb[_0xd545('0xa0')](_0xe97508,_0xd545('0xe3'));}else{rpcDb[_0xd545('0xa0')](_0x3c72fa,_0xd545('0xe3'));}delete this[_0xd545('0x6d')][_0x14d062[_0xd545('0xa7')]];break;case'19':_0x180821[_0xd545('0x42')]+=0x1;_0x3c72fa[_0xd545('0x9c')]=ut[_0xd545('0xb1')](_0x3c72fa);ut[_0xd545('0x8d')](_0x3c72fa,0x13,_0x14d062[_0xd545('0xdf')]||_0x14d062[_0xd545('0xe0')]);ami[_0xd545('0x26')]('custom:amd',ut[_0xd545('0x9e')](_0x3c72fa,_0xd545('0xe2')));rpcDb[_0xd545('0x8f')](_0x3c72fa,'[callProgressDetectingCustomer][machine]');if(ut[_0xd545('0xb1')](_0x3c72fa)>=_0x180821[_0xd545('0xbc')]){_0xe97508=ut['cloneAction'](_0x3c72fa,0xf,_0xd545('0x9f'));rpcDb[_0xd545('0xa0')](_0xe97508,'[callProgressDetectingCustomer][machine]');}else{rpcDb[_0xd545('0xa0')](_0x3c72fa,_0xd545('0xe4'));}delete this[_0xd545('0x6d')][_0x14d062[_0xd545('0xa7')]];break;default:if(_0x3c72fa['dialAnswer']){ut[_0xd545('0x7c')](_0x180821,'[default]');ut[_0xd545('0x7d')](_0xd545('0xe5')+_0x180821[_0xd545('0x29')],_0x14d062);}_0x180821[_0xd545('0x42')]+=0x1;_0x3c72fa['countglobal']=ut[_0xd545('0xb1')](_0x3c72fa);ut[_0xd545('0x8d')](_0x3c72fa,0xc,_0x14d062[_0xd545('0xdf')]||_0x14d062[_0xd545('0xe0')]);rpcDb[_0xd545('0x8f')](_0x3c72fa,_0xd545('0xe6'));if(ut[_0xd545('0xb1')](_0x3c72fa)>=_0x180821['dialGlobalMaxRetry']){_0xe97508=ut[_0xd545('0xbd')](_0x3c72fa,0xf,_0xd545('0x9f'));rpcDb['createCustomerFinal'](_0xe97508,'[callProgressDetectingCustomer][logUnknownGlobal]');}else{rpcDb['createCustomerFinal'](_0x3c72fa,'[callProgressDetectingCustomer][logUnknownGlobal]');}delete this[_0xd545('0x6d')][_0x14d062['linkedid']];}if(!(_0x3c72fa[_0xd545('0x72')]&&_0x15b499==='16')){ut[_0xd545('0x7a')](_0x180821,_0xd545('0xe7'));logger[_0xd545('0x5b')](_0xd545('0xe8'),_0x3c72fa['uniqueid'],_0xd545('0xb7'),_0x180821['name'],'originated:\x20',_0x180821[_0xd545('0x4f')]);}if(_0x15b499!==_0xd545('0xa8')){delete this[_0xd545('0x6d')][_0x14d062[_0xd545('0xa7')]];delete this[_0xd545('0x6d')][_0x14d062[_0xd545('0xe9')]];}}};Preview['prototype'][_0xd545('0xea')]=function(_0x21dc06,_0x44a6bf,_0x2f3e87){if(_['isUndefined'](_0x44a6bf)&&_0xd545('0xeb')!==typeof _0x44a6bf){return;}if(_[_0xd545('0xec')](_0x2f3e87)&&_0xd545('0xeb')!==typeof _0x2f3e87){return;}switch(_0x2f3e87[_0xd545('0xed')]){case'0':ut[_0xd545('0xee')](_0x21dc06,0x0,'NoSuchNumber');rpcDb['createAgentHistory'](_0x21dc06,_0xd545('0xef'));break;case'3':ut[_0xd545('0xee')](_0x21dc06,0x3,_0xd545('0xf0'));rpcDb[_0xd545('0xf1')](_0x21dc06,_0xd545('0xf2'));break;case'5':ut[_0xd545('0xee')](_0x21dc06,0x5,_0xd545('0xba'));rpcDb[_0xd545('0xf1')](_0x21dc06,_0xd545('0xf3'));break;case'8':ut[_0xd545('0xee')](_0x21dc06,0x8,_0xd545('0xcc'));rpcDb[_0xd545('0xf1')](_0x21dc06,_0xd545('0xf4'));break;case'22':ut['logAgent'](_0x21dc06,0x16,'AnswerAGI');rpcDb[_0xd545('0xf1')](_0x21dc06,_0xd545('0xf5'));break;default:ut[_0xd545('0xee')](_0x21dc06,0xc,_0x2f3e87['reason']);rpcDb[_0xd545('0xf1')](_0x21dc06,_0xd545('0xf4'));}ut['updateOriginated'](_0x44a6bf,_0xd545('0xf6'));logger[_0xd545('0x5b')](_0xd545('0xf7'),_0x21dc06[_0xd545('0xaa')],_0xd545('0xb7'),_0x44a6bf['name'],'originated:\x20',_0x44a6bf['originated']);delete this['actions'][_0x21dc06[_0xd545('0xaa')]];};Preview[_0xd545('0xf')][_0xd545('0xf8')]=function(_0x343b5e,_0xc8d3a3,_0x543347,_0x2b7fb6,_0x2b5ae0){var _0x27c1c9=this;return new BPromise(function(_0x20d4bb,_0x365660){if(_[_0xd545('0x6c')](_0xc8d3a3)||_['isNil'](_0xc8d3a3['Contact'])||_['isNil'](_0xc8d3a3[_0xd545('0xf9')]['phone'])||_['isNil'](_0xc8d3a3[_0xd545('0xfa')])){_0x365660(ut[_0xd545('0x64')](_0xd545('0xfb'),_0x2b7fb6,_0x2b5ae0));return;}var _0x2048c3=uuid['v4']();var _0x2384f0=_0x27c1c9['campaignsPreview'][_0xc8d3a3[_0xd545('0x6f')][_0xd545('0x29')]];var _0x11d38a=_0x543347?_0x27c1c9[_0xd545('0x16')][_0x543347]['id']:undefined;_0x27c1c9[_0xd545('0x6d')][_0x2048c3]=new Action(_0xc8d3a3,_0x2384f0,_0x2048c3,_0x543347,_0x11d38a);var _0x3325d0=_0x27c1c9[_0xd545('0x6d')][_0x2048c3];_0x3325d0[_0xd545('0xa5')]=_0x2b7fb6;_0x3325d0[_0xd545('0xa6')]=_0x2b5ae0;_0x3325d0[_0xd545('0xfc')]=_0x543347;if(_['isEmpty'](_0x343b5e)){_0x27c1c9[_0xd545('0xfd')](_0x3325d0,_0x2384f0,_0xc8d3a3,_0x543347)[_0xd545('0xfe')](function(_0x5352e7){logger[_0xd545('0x5b')](_0xd545('0xff'),_0xd545('0x100')+_0x3325d0['queue']+_0xd545('0x101')+_0x3325d0[_0xd545('0x102')],JSON[_0xd545('0x56')](_0x5352e7));ami[_0xd545('0x26')](_0xd545('0x103'),ut[_0xd545('0x9e')](_0x3325d0,_0xd545('0x104'),_0x27c1c9[_0xd545('0x13')][_0x3325d0[_0xd545('0x71')]]));_0x20d4bb(ut[_0xd545('0x64')]('Calling'));})[_0xd545('0x79')](function(_0x5ee9ce){ut[_0xd545('0x61')](_0xd545('0x105'),_0x5ee9ce);_0x365660(ut[_0xd545('0x64')]('Call\x20failed',_0x2b7fb6,_0x2b5ae0));});}else{_0x2384f0[_0xd545('0x3b')]+=0x1;ut[_0xd545('0x106')](_0x3325d0);rpcDb[_0xd545('0x107')](_0x3325d0,_0xd545('0x108'));delete _0x27c1c9[_0xd545('0x6d')][_0x2048c3];_0x365660(ut[_0xd545('0x64')](_0xd545('0x109'),_0x2b7fb6,_0x2b5ae0));}});};Preview[_0xd545('0xf')][_0xd545('0x96')]=function(_0x28773f){return!_[_0xd545('0x6c')](_0x28773f)&&!_[_0xd545('0x6c')](_0x28773f[_0xd545('0x29')])&&!_[_0xd545('0x6c')](_0x28773f['active'])&&_0x28773f['active']&&!_[_0xd545('0x6c')](this[_0xd545('0x15')][util[_0xd545('0x58')]('SIP/%s',_0x28773f[_0xd545('0x29')])])&&!_[_0xd545('0x6c')](this[_0xd545('0x15')][util[_0xd545('0x58')](_0xd545('0x10a'),_0x28773f['name'])]['status'])&&(this[_0xd545('0x15')][util[_0xd545('0x58')](_0xd545('0x10a'),_0x28773f[_0xd545('0x29')])][_0xd545('0x77')]===_0xd545('0x10b')||this['trunks'][util['format'](_0xd545('0x10a'),_0x28773f[_0xd545('0x29')])][_0xd545('0x77')]===_0xd545('0x10c'));};Preview[_0xd545('0xf')]['run']=function(_0xb4aee,_0xa32eaa){var _0x50bf5d=this;return new BPromise(function(_0x4d5c19,_0x58e592){_0x50bf5d[_0xd545('0x10d')](_0xb4aee,_0xa32eaa)[_0xd545('0xfe')](function(_0x3bb7df){_0x4d5c19(_['pick'](_0x3bb7df,['message']));})[_0xd545('0x79')](function(_0x5eb410){if(_0x5eb410[_0xd545('0x10e')]){rpcDb['unlockContact'](_0xb4aee);}if(_0x5eb410[_0xd545('0x54')]){rpcDb[_0xd545('0x8a')](_0xb4aee);}_0x58e592(_['pick'](_0x5eb410,[_0xd545('0x64')]));});});};Preview[_0xd545('0xf')][_0xd545('0x10d')]=function(_0x2f8366,_0x41d74e){var _0xfb9f7b=this;return new BPromise(function(_0x2a9dec,_0x2ee1d1){var _0x19ea65,_0x4137e8;rpcDb[_0xd545('0x10f')](_0x2f8366)['then'](function(_0x40d576){if(!_[_0xd545('0x6c')](_0x40d576[0x0])){_0x4137e8=_0x40d576[0x0]['recallme']?![]:!![];_0x19ea65=_0x40d576[0x0][_0xd545('0x110')]?!![]:![];_0x19ea65=_0x41d74e?!![]:_0x19ea65;}var _0x4e7ca3=_0xfb9f7b[_0xd545('0x111')](_0x40d576);if(_0x4e7ca3[_0xd545('0x112')]){rpcDb[_0xd545('0x113')](_[_0xd545('0x73')](_0x40d576[0x0],[_0xd545('0xfa'),_0xd545('0x114')]))[_0xd545('0xfe')](function(_0xb12e48){_0xfb9f7b['checkInBlack'](_0xb12e48,_0x40d576[0x0],_0x41d74e,_0x4137e8,_0x19ea65)['then'](function(_0x2449ff){_0x2a9dec(_0x2449ff);})[_0xd545('0x79')](function(_0x435e21){_0x2ee1d1(_0x435e21);});})['catch'](function(_0xf927c4){ut['logger'](_0xd545('0x115'),_0xf927c4);_0x2ee1d1(ut[_0xd545('0x64')]('Call\x20unsuccessful',_0x4137e8,_0x19ea65));});}else{_0x2ee1d1(ut[_0xd545('0x64')](_0x4e7ca3[_0xd545('0x64')],_0x4137e8,_0x19ea65));}})[_0xd545('0x79')](function(_0x23e11c){ut[_0xd545('0x61')](_0xd545('0x116'),_0x23e11c);_0x2ee1d1(ut[_0xd545('0x64')](_0xd545('0x117'),![],!![]));});});};Preview[_0xd545('0xf')]['validateContact']=function(_0x4ab6a4){if(_[_0xd545('0x6c')](_0x4ab6a4)||_[_0xd545('0x118')](_0x4ab6a4)||!_['isNil'](_0x4ab6a4[0x0][_0xd545('0x87')])&&_[_0xd545('0x6c')](_0x4ab6a4[0x0]['Agent'][_0xd545('0x29')])){ut[_0xd545('0x61')]('[Preview][validateContact][Empty\x20Contact]',_0x4ab6a4);return{'isValid':![],'message':_0xd545('0x119')};}var _0x848ab1=this[_0xd545('0x13')][_0x4ab6a4[0x0][_0xd545('0x6f')][_0xd545('0x29')]];_0x848ab1[_0xd545('0x64')]=_0xd545('0x99');if(_[_0xd545('0x6c')](_0x848ab1)){ut['logger'](_0xd545('0x11a'),_0x848ab1);return{'isValid':![],'message':'Empty\x20Campaign'};}if(!this[_0xd545('0x96')](_0x848ab1['Trunk'])){ut[_0xd545('0x61')](_0xd545('0x11b'),'campaign\x20Name:\x20'+_0x848ab1[_0xd545('0x29')]+'\x20Trunk\x20is\x20not\x20active');if(!this[_0xd545('0x96')](_0x848ab1[_0xd545('0x97')])){ut['logger'](_0xd545('0x11b'),_0x848ab1[_0xd545('0x29')]+_0xd545('0x11c'));return{'isValid':![],'message':_0xd545('0x11d')};}}if(!ut[_0xd545('0x95')](_0x848ab1[_0xd545('0x36')])){ut[_0xd545('0x61')](_0xd545('0x11e'),_0x848ab1[_0xd545('0x29')]+_0xd545('0x11f'));return{'isValid':![],'message':_0xd545('0x120')+_0x848ab1['name']+_0xd545('0x11f')};}return{'isValid':!![],'message':_0xd545('0x121')};};Preview[_0xd545('0xf')][_0xd545('0xfd')]=function(_0x42bc01,_0x4031a6,_0x1a2cf8,_0x4952b5){var _0x4c5045=this;return new BPromise(function(_0x595389,_0x1ce4bb){var _0x3f8219=_0x42bc01[_0xd545('0xaa')];var _0x1cf842=_0x4c5045[_0xd545('0x96')](_0x4031a6[_0xd545('0x53')])?util[_0xd545('0x58')](_0xd545('0x122'),_0x4031a6[_0xd545('0x53')][_0xd545('0x29')],_[_0xd545('0x6c')](_0x4031a6[_0xd545('0x39')])?'':_0x4031a6[_0xd545('0x39')]['trim']()||'',_0x4031a6['dialCutDigit']>0x0?_0x1a2cf8[_0xd545('0xf9')][_0xd545('0x123')]['substring'](_0x4031a6[_0xd545('0x124')]):_0x1a2cf8[_0xd545('0xf9')]['phone']):util[_0xd545('0x58')](_0xd545('0x122'),_[_0xd545('0x6c')](_0x4031a6['TrunkBackup'])?_0x4031a6[_0xd545('0x53')]['name']:_0x4031a6[_0xd545('0x97')][_0xd545('0x29')],_[_0xd545('0x6c')](_0x4031a6[_0xd545('0x39')])?'':_0x4031a6[_0xd545('0x39')][_0xd545('0x125')]()||'',_0x4031a6[_0xd545('0x124')]>0x0?_0x1a2cf8[_0xd545('0xf9')][_0xd545('0x123')][_0xd545('0x126')](_0x4031a6[_0xd545('0x124')]):_0x1a2cf8[_0xd545('0xf9')][_0xd545('0x123')]);var _0x185a7e=_0x4c5045['isTrunkReachable'](_0x4031a6[_0xd545('0x53')])?ut[_0xd545('0x127')](_0x4031a6['Trunk'][_0xd545('0x128')],_0x4031a6['dialOriginateCallerIdName'],_0x4031a6['dialRandomLastDigitCallerIdNumber']>0x0?ut['getCallerIdRandom'](_0x4031a6[_0xd545('0x129')],_0x4031a6[_0xd545('0x12a')]):_0x4031a6['dialOriginateCallerIdNumber']):ut[_0xd545('0x127')](_['isNil'](_0x4031a6[_0xd545('0x97')])?_0x4031a6[_0xd545('0x53')][_0xd545('0x128')]:_0x4031a6[_0xd545('0x97')][_0xd545('0x128')],_0x4031a6['dialOriginateCallerIdName'],_0x4031a6['dialRandomLastDigitCallerIdNumber']>0x0?ut['getCallerIdRandom'](_0x4031a6[_0xd545('0x129')],_0x4031a6['dialRandomLastDigitCallerIdNumber']):_0x4031a6[_0xd545('0x129')]);if(_0x185a7e){_0x42bc01[_0xd545('0x12b')]=ut[_0xd545('0x12c')](_0x185a7e);_0x42bc01[_0xd545('0x12d')]=ut[_0xd545('0x12e')](_0x185a7e);}var _0x13d1fb=ut[_0xd545('0x12f')](_0x4031a6,_0x1a2cf8,_0x1cf842,_0x185a7e,_0x3f8219,_0x42bc01);_['merge'](_0x42bc01,ut[_0xd545('0x130')](_0x13d1fb));_0x42bc01[_0xd545('0x8b')]=moment()[_0xd545('0x58')](_0xd545('0x8c'));ami[_0xd545('0x76')](ut['variablesAction'](_0x42bc01,_0x4031a6,_0x13d1fb,_0x42bc01[_0xd545('0xa6')],_0x4952b5))[_0xd545('0xfe')](function(_0x45c330){var _0xc37427=_0x42bc01[_0xd545('0x131')];if(!_[_0xd545('0x6c')](_0xc37427)){if(!_[_0xd545('0x6c')](_0x4c5045['agents'][_0xc37427])){_0x4c5045['agents'][_0xc37427][_0xd545('0x132')]=_0x42bc01[_0xd545('0x133')];emit(util['format'](_0xd545('0x134'),_0x4c5045[_0xd545('0x16')][_0xc37427][_0xd545('0x29')]),'user:agentconnect',{'destaccountcode':_0x4c5045['agents'][_0xc37427][_0xd545('0x135')],'destconnectedlinenum':_0x42bc01[_0xd545('0x133')]});}}_0x4031a6['originated']+=0x1;logger[_0xd545('0x5b')](_0xd545('0x136'),_0x3f8219,_0xd545('0xb7'),_0x4031a6[_0xd545('0x29')],_0xd545('0x137'),_0x4031a6[_0xd545('0x4f')]);_0x595389(_0x45c330);})['catch'](function(_0x56ce8f){ut[_0xd545('0xee')](_0x42bc01,0xe,_0xd545('0x138'));rpcDb[_0xd545('0xf1')](_0x42bc01,'[originateFailure][logOriginateFailure]');_0x1ce4bb(_0x56ce8f);});});};Preview['prototype'][_0xd545('0x139')]=function(_0x3f178d){if(this[_0xd545('0x6d')][_0x3f178d[_0xd545('0xa7')]]){this['actions'][_0x3f178d[_0xd545('0xa7')]]['channel']=_0x3f178d[_0xd545('0x78')];}};Preview['prototype'][_0xd545('0x19')]=function(_0x1c8b6b){var _0x1db630=this;var _0x1b733d=this[_0xd545('0x6d')][_0x1c8b6b[_0xd545('0x13a')]];if(_0x1b733d){if(_0x1b733d[_0xd545('0xfc')]&&this['agents'][_0x1b733d['lookAgent']]){ut[_0xd545('0x13b')](_0x1b733d,this[_0xd545('0x16')][_0x1b733d[_0xd545('0xfc')]][_0xd545('0x29')],this[_0xd545('0x16')][_0x1b733d['lookAgent']]['id']);}var _0x50534c=_[_0xd545('0x13c')](_0x1b733d);_0x50534c[_0xd545('0x13d')]=moment()[_0xd545('0x58')](_0xd545('0x8c'));var _0x21668f=_0x1db630[_0xd545('0x13')][_0x1b733d[_0xd545('0x71')]];if(ut[_0xd545('0x13e')](_0x1c8b6b['response'])){if(_0x1b733d[_0xd545('0xa5')]){rpcDb[_0xd545('0x13f')](_0x1b733d['idContact']);}if(_0x1b733d[_0xd545('0xa6')]){rpcDb[_0xd545('0x8a')](_0x1b733d[_0xd545('0x102')]);}ami[_0xd545('0x26')](_0xd545('0x140'),ut[_0xd545('0x9e')](_0x1b733d,_0xd545('0x141'),this['campaignsPreview'][_0x1b733d[_0xd545('0x71')]]));this[_0xd545('0xea')](_0x50534c,_0x21668f,_0x1c8b6b);}else{_0x1b733d['starttime']=moment()[_0xd545('0x58')](_0xd545('0x8c'));ut[_0xd545('0xee')](_0x50534c,0x4,_0xd545('0xb2'));rpcDb[_0xd545('0xf1')](_0x50534c,_0xd545('0x142'));}}};Preview[_0xd545('0xf')]['syncHangup']=function(_0x103adb){var _0x48bd7b=this;var _0x39bc50=this[_0xd545('0x6d')][_0x103adb[_0xd545('0xa7')]];var _0x540b27;if(_0x39bc50){_0x540b27=this['campaignsPreview'][_0x39bc50['queue']];logger[_0xd545('0x5b')]('[syncHangup][talking]',_0x103adb['linkedid'],_0xd545('0xb7'),_0x540b27[_0xd545('0x29')],'pTalking:\x20',_0x540b27[_0xd545('0x5d')]);}if(this[_0xd545('0x6d')][_0x103adb[_0xd545('0xa7')]]&&_0x103adb['linkedid']!==_0x103adb[_0xd545('0xaa')]){if(_0x103adb['cause']==='16'&&this[_0xd545('0x6d')][_0x103adb[_0xd545('0xa7')]][_0xd545('0x72')]){this[_0xd545('0x9a')](_0x103adb,_0x103adb['linkedid'],_0x103adb[_0xd545('0x143')]);}else if(this['actions'][_0x103adb[_0xd545('0xa7')]][_0xd545('0x72')]){logger[_0xd545('0x5b')](_0xd545('0x144'),_0x103adb[_0xd545('0xa7')],_0x103adb['cause'],_0xd545('0xb7'),_0x540b27['name'],_0xd545('0x70'),_0x540b27[_0xd545('0x5d')]);this[_0xd545('0x9a')](_0x103adb,_0x103adb[_0xd545('0xa7')],_0x103adb[_0xd545('0x143')]);}}else if(_0x39bc50&&_['isNil'](_0x39bc50[_0xd545('0x145')])&&_0x540b27[_0xd545('0x146')]&&_0x103adb[_0xd545('0xa7')]===_0x103adb['uniqueid']&&_[_0xd545('0x6c')](_0x103adb[_0xd545('0xed')])&&_0x103adb['cause']==='16'&&_0x103adb[_0xd545('0x147')]==='6'&&_[_0xd545('0xec')](_0x39bc50[_0xd545('0x148')])){if(_0x39bc50['unlockAgent']){rpcDb[_0xd545('0x13f')](_0x39bc50[_0xd545('0x102')]);}if(_0x39bc50[_0xd545('0xa6')]){rpcDb[_0xd545('0x8a')](_0x39bc50['idContact']);}_0x103adb[_0xd545('0xed')]='22';this['callProgressDetectingAgent'](_0x39bc50,_0x540b27,_0x103adb);}else if(_0x39bc50&&_0x39bc50['transfer']){if(_0x103adb[_0xd545('0x143')]==='16'&&this[_0xd545('0x6d')][_0x103adb[_0xd545('0xa7')]]['dialAnswer']){logger['info']('[syncHangup][talking][transfer]',_0x103adb['linkedid'],_0x103adb[_0xd545('0x143')],_0xd545('0xb7'),_0x540b27[_0xd545('0x29')],_0xd545('0x70'),_0x540b27[_0xd545('0x5d')]);this[_0xd545('0x9a')](_0x103adb,_0x103adb['linkedid'],_0x103adb['cause']);}else if(this[_0xd545('0x6d')][_0x103adb[_0xd545('0xa7')]][_0xd545('0x72')]){logger[_0xd545('0x5b')]('[syncHangup][talking][cause]',_0x103adb[_0xd545('0xa7')],_0x103adb[_0xd545('0x143')],_0xd545('0xb7'),_0x540b27[_0xd545('0x29')],_0xd545('0x70'),_0x540b27[_0xd545('0x5d')]);this[_0xd545('0x9a')](_0x103adb,_0x103adb['linkedid'],_0x103adb['cause']);}}};Preview[_0xd545('0xf')][_0xd545('0x20')]=function(_0x32649c){if(this[_0xd545('0x6d')][_0x32649c[_0xd545('0xe9')]]&&_0x32649c[_0xd545('0xe9')]!==_0x32649c[_0xd545('0x149')]){this['callProgressDetectingCustomer'](_0x32649c,_0x32649c[_0xd545('0xe9')],_0x32649c['dialstatus']);}};Preview[_0xd545('0xf')][_0xd545('0x1e')]=function(_0x2dbfcc){if(this[_0xd545('0x6d')][_0x2dbfcc[_0xd545('0xa7')]]&&_0x2dbfcc[_0xd545('0xa7')]!==_0x2dbfcc['uniqueid']&&!this[_0xd545('0x6d')][_0x2dbfcc[_0xd545('0xa7')]][_0xd545('0x72')]){if(_0x2dbfcc[_0xd545('0x143')]==='1'){this[_0xd545('0x9a')](_0x2dbfcc,_0x2dbfcc['linkedid'],_0x2dbfcc[_0xd545('0x143')]);}}};Preview[_0xd545('0xf')][_0xd545('0x14a')]=function(_0x34ca08,_0xc94137,_0x2b16b1){if(this[_0xd545('0x6d')][_0x34ca08]){if(_[_0xd545('0x6c')](this['actions'][_0x34ca08][_0xd545('0x14b')])){this['actions'][_0x34ca08][_0xd545('0x14b')]={};}this[_0xd545('0x6d')][_0x34ca08][_0xd545('0x14b')][_0xc94137]=_0x2b16b1;}};Preview[_0xd545('0xf')]['syncVarSet']=function(_0x2c1d1f){try{if(!_[_0xd545('0x6c')](_0x2c1d1f)){if(ut[_0xd545('0x14c')](_[_0xd545('0x14d')](_0x2c1d1f[_0xd545('0x14e')])[0x0])){this[_0xd545('0x14a')](_0x2c1d1f[_0xd545('0xaa')],_['keys'](_0x2c1d1f[_0xd545('0x14e')])[0x0],_0x2c1d1f[_0xd545('0x14f')]);}}}catch(_0x824f9f){logger[_0xd545('0x150')]('[syncVarSet][Preview]',util[_0xd545('0x151')](_0x824f9f,{'showHidden':![],'depth':null}));}};Preview[_0xd545('0xf')][_0xd545('0x152')]=function(_0x11e88c){if(_0x11e88c){if(this[_0xd545('0x6d')][_0x11e88c[_0xd545('0x153')]]){this[_0xd545('0x6d')][_0x11e88c[_0xd545('0x153')]][_0xd545('0x148')]=!![];}}};Preview[_0xd545('0xf')][_0xd545('0x154')]=function(_0x4be03e){if(_0x4be03e){if(this[_0xd545('0x6d')][_0x4be03e['transfererlinkedid']]){this[_0xd545('0x6d')][_0x4be03e['transfererlinkedid']][_0xd545('0x148')]=!![];}}};module[_0xd545('0x155')]=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index 8fe03bc..ea44a21 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 _0xc12c=['[createHistory]\x20','then','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createCustomerFinal','UserId','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallercomplete','endtime','connectedlinename','membername','from-sip','exten','holdtime','lastAssignedTo','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','rescheduleContact','[rescheduleContactInQueue]\x20','bluebird','preview','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/agentReportPreview','error','inspect','resolve','createHistory','catch'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xc12c,0x10b));var _0xcc12=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0xc12c[_0x4ea69d];return _0x5318e0;};'use strict';var util=require('util');var BPromise=require(_0xcc12('0x0'));var logger=require('../../../config/logger')(_0xcc12('0x1'));var _=require('lodash');var cmHopper=require(_0xcc12('0x2'));var cmHopperFinal=require(_0xcc12('0x3'));var cmHopperHistory=require(_0xcc12('0x4'));var cmHopperBlack=require(_0xcc12('0x5'));var voiceQueueRt=require(_0xcc12('0x6'));var agentReportPreview=require(_0xcc12('0x7'));var voiceQueueReport=require('../rpc/voiceQueueReport');function loggerCatch(_0x31f7e5){return function(_0x392260){logger[_0xcc12('0x8')](_0x31f7e5,util[_0xcc12('0x9')](_0x392260,{'showHidden':![],'depth':null}));};}function create(_0xe93c4b){return BPromise[_0xcc12('0xa')]()['then'](cmHopperHistory[_0xcc12('0xb')](_0xe93c4b))[_0xcc12('0xc')](loggerCatch(_0xcc12('0xd')));}function createAgent(_0x5a60d8){return BPromise[_0xcc12('0xa')]()['then'](agentReportPreview[_0xcc12('0xb')](_0x5a60d8))[_0xcc12('0xc')](loggerCatch(_0xcc12('0xd')));}function moveContact(_0x22a770){return BPromise['resolve']()[_0xcc12('0xe')](cmHopper[_0xcc12('0xf')](_0x22a770,!![]))['catch'](loggerCatch(_0xcc12('0x10')));}exports[_0xcc12('0x11')]=function(_0x317bc5){return BPromise[_0xcc12('0xa')]()['then'](cmHopperBlack[_0xcc12('0x11')](_0x317bc5))[_0xcc12('0xc')](loggerCatch(_0xcc12('0x12')));};exports[_0xcc12('0x13')]=function(_0x1cc3b6){return BPromise[_0xcc12('0xa')]()[_0xcc12('0xe')](cmHopper['getContactPreview'](_0x1cc3b6))['catch'](loggerCatch(_0xcc12('0x14')));};exports['createHistory']=function(_0x40bf5e,_0x245c4c){create(_0x40bf5e)[_0xcc12('0xc')](loggerCatch(_0x245c4c));moveContact(_0x40bf5e)[_0xcc12('0xc')](loggerCatch(_0x245c4c));};exports['createAgentHistory']=function(_0x3a4100,_0x17aa96){createAgent(_0x3a4100)[_0xcc12('0xc')](loggerCatch(_0x17aa96));};exports['createCustomerHistory']=function(_0x38b9be,_0x1555ff){create(_0x38b9be)[_0xcc12('0xc')](loggerCatch(_0x1555ff));};exports[_0xcc12('0x15')]=function(_0x466ac4,_0x10e687){moveContact(_0x466ac4)['catch'](loggerCatch(_0x10e687));};exports['rescheduleContact']=function(_0x1abd0f,_0x427362,_0x3806ce){if(_0x427362){_0x1abd0f[_0xcc12('0x16')]=null;}if(_0x3806ce){_0x1abd0f[_0xcc12('0x17')]=![];}return BPromise['resolve']()[_0xcc12('0xe')](cmHopper['rescheduleContact'](_0x1abd0f))[_0xcc12('0xc')](loggerCatch(_0xcc12('0x18')));};exports['countReScheduled']=function(_0x10d2dc){return BPromise['resolve']()[_0xcc12('0xe')](cmHopper[_0xcc12('0x19')](_0x10d2dc))[_0xcc12('0xc')](loggerCatch(_0xcc12('0x1a')));};exports[_0xcc12('0x1b')]=function(_0x23b909){return BPromise['resolve']()[_0xcc12('0xe')](cmHopper[_0xcc12('0x1b')]({'UserId':null},_0x23b909,0x1))['catch'](loggerCatch(_0xcc12('0x1c')));};exports[_0xcc12('0x1d')]=function(_0x149624){return BPromise['resolve']()[_0xcc12('0xe')](cmHopper[_0xcc12('0x1b')]({'active':![]},_0x149624,0x1))[_0xcc12('0xc')](loggerCatch(_0xcc12('0x1e')));};exports[_0xcc12('0x1f')]=function(_0x328d3c){var _0x491448={};_0x491448[_0xcc12('0x20')]=_0x328d3c[_0xcc12('0x20')];_0x491448[_0xcc12('0x21')]=_0x328d3c[_0xcc12('0x21')];_0x491448[_0xcc12('0x22')]=_0x328d3c[_0xcc12('0x22')];_0x491448[_0xcc12('0x23')]=_0x328d3c[_0xcc12('0x23')];_0x491448[_0xcc12('0x24')]=_0x328d3c[_0xcc12('0x24')];_0x491448[_0xcc12('0x25')]=_0x328d3c[_0xcc12('0x26')];_0x491448['queuecallerleaveAt']=_0x328d3c[_0xcc12('0x26')];_0x491448[_0xcc12('0x27')]=0x1;_0x491448['queuecallercompleteAt']=_0x328d3c[_0xcc12('0x28')];_0x491448[_0xcc12('0x29')]=_0x328d3c[_0xcc12('0x2a')];_0x491448['context']=_0xcc12('0x2b');_0x491448[_0xcc12('0x2c')]='xcally-motion-preview';_0x491448[_0xcc12('0x2d')]=0x0;_0x491448['assigned']=0x1;_0x491448[_0xcc12('0x2e')]=_0x328d3c[_0xcc12('0x2a')];_0x491448[_0xcc12('0x2f')]=_0xcc12('0x30');return BPromise[_0xcc12('0xa')]()[_0xcc12('0xe')](voiceQueueReport[_0xcc12('0x31')](_0x491448))[_0xcc12('0xc')](loggerCatch(_0xcc12('0x32')));};exports[_0xcc12('0x33')]=function(_0x2f35c7,_0x547020){return BPromise[_0xcc12('0xa')]()['then'](cmHopper['getContactRecallMe'](_0x2f35c7,_0x547020))[_0xcc12('0xc')](loggerCatch(_0xcc12('0x34')));};exports[_0xcc12('0x35')]=function(_0x1e70c8){return BPromise[_0xcc12('0xa')]()[_0xcc12('0xe')](cmHopper[_0xcc12('0x36')](_0x1e70c8,!![],!![]))[_0xcc12('0xc')](loggerCatch(_0xcc12('0x37')));}; \ No newline at end of file +var _0x25f1=['createAgentHistory','createCustomerHistory','rescheduleContact','UserId','active','[rescheduleContact]\x20','countReScheduled','[countReScheduled]\x20','[unlockContact]\x20','unlockContact','[activeContact]\x20','type','uniqueid','calleridnum','calleridname','queuecallerjoinAt','answertime','queuecallercomplete','queuecallercompleteAt','endtime','context','from-sip','exten','xcally-motion-preview','holdtime','assigned','membername','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','bluebird','../../../config/logger','preview','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/voiceQueueReport','error','inspect','catch','createHistory','[createHistory]\x20','moveContactManagedDialer','checkIsBlackList','resolve','then'];(function(_0x427352,_0x1bce61){var _0x23e0e6=function(_0x2a42a9){while(--_0x2a42a9){_0x427352['push'](_0x427352['shift']());}};_0x23e0e6(++_0x1bce61);}(_0x25f1,0x11d));var _0x125f=function(_0x6173fc,_0x32aadf){_0x6173fc=_0x6173fc-0x0;var _0x965fbe=_0x25f1[_0x6173fc];return _0x965fbe;};'use strict';var util=require('util');var BPromise=require(_0x125f('0x0'));var logger=require(_0x125f('0x1'))(_0x125f('0x2'));var _=require('lodash');var cmHopper=require('../rpc/cmHopper');var cmHopperFinal=require('../rpc/cmHopperFinal');var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require(_0x125f('0x3'));var voiceQueueRt=require(_0x125f('0x4'));var agentReportPreview=require('../rpc/agentReportPreview');var voiceQueueReport=require(_0x125f('0x5'));function loggerCatch(_0x1af056){return function(_0x578b14){logger[_0x125f('0x6')](_0x1af056,util[_0x125f('0x7')](_0x578b14,{'showHidden':![],'depth':null}));};}function create(_0x320702){return BPromise['resolve']()['then'](cmHopperHistory['createHistory'](_0x320702))[_0x125f('0x8')](loggerCatch('[createHistory]\x20'));}function createAgent(_0x275c3c){return BPromise['resolve']()['then'](agentReportPreview[_0x125f('0x9')](_0x275c3c))[_0x125f('0x8')](loggerCatch(_0x125f('0xa')));}function moveContact(_0x43ac79){return BPromise['resolve']()['then'](cmHopper[_0x125f('0xb')](_0x43ac79,!![]))[_0x125f('0x8')](loggerCatch('[moveContactManagedDialer]\x20'));}exports[_0x125f('0xc')]=function(_0x200f21){return BPromise[_0x125f('0xd')]()[_0x125f('0xe')](cmHopperBlack['checkIsBlackList'](_0x200f21))[_0x125f('0x8')](loggerCatch('[checkIsBlackList]\x20'));};exports['getContactPreview']=function(_0x3a5083){return BPromise[_0x125f('0xd')]()[_0x125f('0xe')](cmHopper['getContactPreview'](_0x3a5083))[_0x125f('0x8')](loggerCatch('[getContactPreview]\x20'));};exports[_0x125f('0x9')]=function(_0x5de6fa,_0x2448c2){create(_0x5de6fa)['catch'](loggerCatch(_0x2448c2));moveContact(_0x5de6fa)['catch'](loggerCatch(_0x2448c2));};exports[_0x125f('0xf')]=function(_0x142b97,_0x3492db){createAgent(_0x142b97)[_0x125f('0x8')](loggerCatch(_0x3492db));};exports[_0x125f('0x10')]=function(_0x389dda,_0xc36008){create(_0x389dda)[_0x125f('0x8')](loggerCatch(_0xc36008));};exports['createCustomerFinal']=function(_0x3b35cc,_0x1dd355){moveContact(_0x3b35cc)[_0x125f('0x8')](loggerCatch(_0x1dd355));};exports[_0x125f('0x11')]=function(_0x575f44,_0x550039,_0x2e24fa){if(_0x550039){_0x575f44[_0x125f('0x12')]=null;}if(_0x2e24fa){_0x575f44[_0x125f('0x13')]=![];}return BPromise[_0x125f('0xd')]()[_0x125f('0xe')](cmHopper[_0x125f('0x11')](_0x575f44))[_0x125f('0x8')](loggerCatch(_0x125f('0x14')));};exports[_0x125f('0x15')]=function(_0x561c80){return BPromise['resolve']()[_0x125f('0xe')](cmHopper[_0x125f('0x15')](_0x561c80))[_0x125f('0x8')](loggerCatch(_0x125f('0x16')));};exports['unlockContact']=function(_0x9e2550){return BPromise[_0x125f('0xd')]()[_0x125f('0xe')](cmHopper['unlockContact']({'UserId':null},_0x9e2550,0x1))[_0x125f('0x8')](loggerCatch(_0x125f('0x17')));};exports['disableContact']=function(_0x27e697){return BPromise[_0x125f('0xd')]()[_0x125f('0xe')](cmHopper[_0x125f('0x18')]({'active':![]},_0x27e697,0x1))[_0x125f('0x8')](loggerCatch(_0x125f('0x19')));};exports['crateCustomerReportQueue']=function(_0x53b67b){var _0x2c3f45={};_0x2c3f45[_0x125f('0x1a')]=_0x53b67b[_0x125f('0x1a')];_0x2c3f45[_0x125f('0x1b')]=_0x53b67b['uniqueid'];_0x2c3f45[_0x125f('0x1c')]=_0x53b67b['calleridnum'];_0x2c3f45[_0x125f('0x1d')]=_0x53b67b[_0x125f('0x1d')];_0x2c3f45['queue']=_0x53b67b['queue'];_0x2c3f45[_0x125f('0x1e')]=_0x53b67b[_0x125f('0x1f')];_0x2c3f45['queuecallerleaveAt']=_0x53b67b[_0x125f('0x1f')];_0x2c3f45[_0x125f('0x20')]=0x1;_0x2c3f45[_0x125f('0x21')]=_0x53b67b[_0x125f('0x22')];_0x2c3f45['connectedlinename']=_0x53b67b['membername'];_0x2c3f45[_0x125f('0x23')]=_0x125f('0x24');_0x2c3f45[_0x125f('0x25')]=_0x125f('0x26');_0x2c3f45[_0x125f('0x27')]=0x0;_0x2c3f45[_0x125f('0x28')]=0x1;_0x2c3f45['lastAssignedTo']=_0x53b67b[_0x125f('0x29')];_0x2c3f45[_0x125f('0x2a')]=_0x125f('0x2b');return BPromise[_0x125f('0xd')]()['then'](voiceQueueReport[_0x125f('0x2c')](_0x2c3f45))[_0x125f('0x8')](loggerCatch(_0x125f('0x2d')));};exports[_0x125f('0x2e')]=function(_0x599636,_0x401ea3){return BPromise[_0x125f('0xd')]()[_0x125f('0xe')](cmHopper[_0x125f('0x2e')](_0x599636,_0x401ea3))['catch'](loggerCatch(_0x125f('0x2f')));};exports[_0x125f('0x30')]=function(_0x516060){return BPromise[_0x125f('0xd')]()[_0x125f('0xe')](cmHopper['rescheduleContact'](_0x516060,!![],!![]))['catch'](loggerCatch(_0x125f('0x31')));}; \ 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 b370b62..003548e 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 _0x6a9d=['extractCalleridNumber','lodash','moment','preview','XCALLY_IP_AGI','127.0.0.1','milliseconds','diff','seconds','error','inspect','logger','info','loggerError','message','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','isActive','isNil','addVariables','Queue','name','calleridname','calleridnum','ContactId','dialer','\x22rtTxX%s%s\x22','dialQueueProject2','U(xcally-mixmonitor-context)','dialPreviewUrl','\x22agi://%s/square,%s\x22','dialQueueProject','NONE','originatecalleridnum','originatecalleridname','xcally-motion-preview','monitor_format','Contact','hasOwnProperty','tags','createdAt','updatedAt','%s%s','XMD-','toUpper','toLowerVariables','toLower','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','state','starttime','responsetime','endtime','logAgent','YYYY-MM-DD\x20HH:mm:ss','ringtime','logLookAgent','membername','UserId','statedesc','talktime','answertime','isFailure','Failure','variablesAction','RECALL','BOOKED','uniqueid','originate','from-sip','totalGlobal','countcongestionretry','countagentrejectretry','countnosuchnumberretry','cloneAction','clone','scheduledAt','add','minutes','ListId','VoiceQueueId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','buildObj','lastevent','motionChannel','voice','mandatoryDisposition','buildAcw','queue','interface','channelAgent','agentReadyId','not_inuse','status','reachable','push','createBody','CampaignId','filterKey','idContact','active','scheduledat','countbusyretry','countnoanswerretry','countglobal','callback','callbackat','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqos','rtpaudioqoslossbridged','bridgepvtcallid','\x5cw{0,','pow','replace','extractCalleridName','match'];(function(_0x36741d,_0x427fed){var _0x260fff=function(_0x27d61b){while(--_0x27d61b){_0x36741d['push'](_0x36741d['shift']());}};_0x260fff(++_0x427fed);}(_0x6a9d,0x91));var _0xd6a9=function(_0x88582e,_0x34aa5f){_0x88582e=_0x88582e-0x0;var _0x29057e=_0x6a9d[_0x88582e];return _0x29057e;};'use strict';var util=require('util');var _=require(_0xd6a9('0x0'));var moment=require(_0xd6a9('0x1'));var logger=require('../../../../config/logger')(_0xd6a9('0x2'));var ipAgi=process['env'][_0xd6a9('0x3')]||_0xd6a9('0x4');function getSeconds(_0x14f441,_0x222a5a){var _0x44a08b=moment(_0x14f441)[_0xd6a9('0x5')](0x0);var _0x4940b2=moment(_0x222a5a)['milliseconds'](0x0);return _0x44a08b[_0xd6a9('0x6')](_0x4940b2,_0xd6a9('0x7'));}exports['loggerCatch']=function(_0x16078b){return function(_0x56cfc7){logger[_0xd6a9('0x8')](_0x16078b,util[_0xd6a9('0x9')](_0x56cfc7,{'showHidden':![],'depth':null}));};};exports[_0xd6a9('0xa')]=function(_0x37a568,_0x372b7c){logger[_0xd6a9('0xb')](_0x37a568,util[_0xd6a9('0x9')](_0x372b7c,{'showHidden':![],'depth':null}));};exports[_0xd6a9('0xc')]=function(_0xb52cc3,_0x278628){logger[_0xd6a9('0x8')](_0xb52cc3,util[_0xd6a9('0x9')](_0x278628,{'showHidden':![],'depth':null}));};exports['logger2']=function(_0xa693e3){return function(_0x53da0b){logger[_0xd6a9('0xb')](_0xa693e3,util[_0xd6a9('0x9')](_0x53da0b,{'showHidden':![],'depth':null}));};};exports[_0xd6a9('0xd')]=function(_0x47cfd7,_0x594886,_0x205656){return{'message':_0x47cfd7,'unlock':_0x594886,'active':_0x205656};};exports['getCallerId']=function(_0x24724b,_0x20a3bc,_0x478996){if(!_[_0xd6a9('0xe')](_0x478996)&&_0xd6a9('0xf')===typeof _0x478996&&!_['isEmpty'](_0x478996)){if(!_[_0xd6a9('0xe')](_0x20a3bc)&&_0xd6a9('0xf')===typeof _0x20a3bc&&!_[_0xd6a9('0x10')](_0x20a3bc)){return util[_0xd6a9('0x11')](_0xd6a9('0x12'),_0x20a3bc,_0x478996);}return util[_0xd6a9('0x11')](_0xd6a9('0x12'),_0x478996,_0x478996);}if(!_[_0xd6a9('0xe')](_0x24724b)&&_0xd6a9('0xf')===typeof _0x24724b&&!_[_0xd6a9('0x10')](_0x24724b)){return _0x24724b;}return'\x22\x22\x20<>';};exports[_0xd6a9('0x13')]=function(_0x28fc29){if(_[_0xd6a9('0x14')](_0x28fc29)){return![];}return _0x28fc29;};exports[_0xd6a9('0x15')]=function(_0x4794b2,_0x495aec,_0x3f1b9a,_0xfdf9d0,_0x685667,_0x245060){var _0x54d41d={'XMD-QUEUE':_0x495aec[_0xd6a9('0x16')]?_0x495aec['Queue'][_0xd6a9('0x17')]:'','XMD-CALLERID':_0xfdf9d0,'XMD-CALLERID-PREVIEW':_0x245060?util[_0xd6a9('0x11')]('\x22%s\x22\x20<%s>',_0x245060[_0xd6a9('0x18')],_0x245060[_0xd6a9('0x19')]):_0xfdf9d0,'XMD-DIALID':_0x685667,'XMD-CONTACTID':_0x495aec[_0xd6a9('0x1a')],'XMD-CDRTYPE':_0xd6a9('0x1b'),'CALLERID(all)':_0xfdf9d0,'XMD-VOICEQUEUEID':_0x495aec['VoiceQueueId'],'XMD-DIALCHANNEL':_0x3f1b9a,'XMD-DIALTIMEOUT':_0x4794b2['dialOriginateTimeout']||0x1e,'XMD-DIALOPTIONS':util['format'](_0xd6a9('0x1c'),_0x4794b2[_0xd6a9('0x1d')]?'g':'',_['isEmpty'](_0x4794b2['monitor_format'])?'':_0xd6a9('0x1e')),'XMD-DIALURL':_0x4794b2[_0xd6a9('0x1f')]||'','XMD-AGI':_0x4794b2['dialQueueProject']?util[_0xd6a9('0x11')](_0xd6a9('0x20'),ipAgi,_0x4794b2[_0xd6a9('0x21')]):'NONE','XMD-AGIAFTER':_0x4794b2[_0xd6a9('0x1d')]?util[_0xd6a9('0x11')](_0xd6a9('0x20'),ipAgi,_0x4794b2[_0xd6a9('0x1d')]):_0xd6a9('0x22'),'XMD-ORIGINATECALLERIDNUM':_0x245060?_0x245060[_0xd6a9('0x23')]:'','XMD-ORIGINATECALLERIDNAME':_0x245060?_0x245060[_0xd6a9('0x24')]:'','XMD-DESTINATION':_0xd6a9('0x25')};if(!_[_0xd6a9('0x10')](_0x4794b2[_0xd6a9('0x26')])){_0x54d41d[util['format']('%s','_XCALLY_MIXMONITOR_FORMAT')]=_0x4794b2[_0xd6a9('0x26')];_0x54d41d[util[_0xd6a9('0x11')]('%s','_XCALLY_MIXMONITOR_UNIQUEID')]=_0x685667;}if(_0x495aec&&_0x495aec[_0xd6a9('0x27')]){for(var _0x174105 in _0x495aec['Contact']){if(_0x495aec[_0xd6a9('0x27')][_0xd6a9('0x28')](_0x174105)){if(!_[_0xd6a9('0x14')](_0x495aec['Contact'][_0x174105])&&_0x174105!=='id'&&_0x174105!==_0xd6a9('0x29')&&_0x174105!==_0xd6a9('0x2a')&&_0x174105!==_0xd6a9('0x2b')){_0x54d41d[util[_0xd6a9('0x11')](_0xd6a9('0x2c'),_0xd6a9('0x2d'),_[_0xd6a9('0x2e')](_0x174105))]=_0x495aec['Contact'][_0x174105];}}}}return _0x54d41d;};exports[_0xd6a9('0x2f')]=function(_0x26e5e2){var _0x288c88={};for(var _0x14c5c5 in _0x26e5e2){if(_0x26e5e2[_0xd6a9('0x28')](_0x14c5c5)){_0x288c88[util[_0xd6a9('0x11')]('%s',_[_0xd6a9('0x30')](_0x14c5c5))]=_0x26e5e2[_0x14c5c5];}}return{'variables':_0x288c88};};exports['updateOriginated']=function(_0x212b34,_0x418e78){if(!_[_0xd6a9('0x14')](_0x212b34)){if(_0x212b34['hasOwnProperty'](_0xd6a9('0x31'))){if(_0x212b34['originated']>0x0){_0x212b34[_0xd6a9('0x31')]-=0x1;}else{logger[_0xd6a9('0x8')](_0xd6a9('0x32'),_0x418e78);}}}else{logger[_0xd6a9('0x8')](_0xd6a9('0x33'),_0x418e78);}};exports['logBlacklist']=function(_0x186213){var _0x18ecb6=moment()[_0xd6a9('0x11')]('YYYY-MM-DD\x20HH:mm:ss');_0x186213[_0xd6a9('0x34')]=0xd;_0x186213['statedesc']='Blacklist';_0x186213[_0xd6a9('0x35')]=_0x18ecb6;_0x186213[_0xd6a9('0x36')]=_0x18ecb6;_0x186213[_0xd6a9('0x37')]=_0x18ecb6;};exports[_0xd6a9('0x38')]=function(_0x528608,_0x300353,_0x2da3a3){var _0x26d9b4=moment()['format'](_0xd6a9('0x39'));_0x528608[_0xd6a9('0x34')]=_0x300353;_0x528608['statedesc']=_0x2da3a3;_0x528608[_0xd6a9('0x36')]=_0x26d9b4;_0x528608[_0xd6a9('0x3a')]=getSeconds(_0x528608[_0xd6a9('0x36')],_0x528608[_0xd6a9('0x35')]);};exports[_0xd6a9('0x3b')]=function(_0x56a0ec,_0x3ac6d9,_0x69f2b5){_0x56a0ec[_0xd6a9('0x3c')]=_0x3ac6d9;_0x56a0ec[_0xd6a9('0x3d')]=_0x69f2b5;};exports['logCustomer']=function(_0x725f22,_0x4b55d3,_0x4f96a4){var _0xda763a=moment()[_0xd6a9('0x11')]('YYYY-MM-DD\x20HH:mm:ss');_0x725f22[_0xd6a9('0x34')]=_0x4b55d3;_0x725f22[_0xd6a9('0x3e')]=_0x4f96a4;_0x725f22[_0xd6a9('0x36')]=_0x725f22[_0xd6a9('0x36')]?_0x725f22['responsetime']:_0xda763a;_0x725f22[_0xd6a9('0x37')]=_0x725f22[_0xd6a9('0x37')]?_0x725f22['endtime']:_0xda763a;_0x725f22['ringtime']=getSeconds(_0x725f22['responsetime']||0x0,_0x725f22[_0xd6a9('0x35')]||0x0);_0x725f22[_0xd6a9('0x3f')]=_0x725f22[_0xd6a9('0x40')]?getSeconds(_0x725f22[_0xd6a9('0x37')],_0x725f22[_0xd6a9('0x40')]):0x0;};exports[_0xd6a9('0x41')]=function(_0x409291){return _0x409291===_0xd6a9('0x42');};exports[_0xd6a9('0x43')]=function(_0x4efcfe,_0x411744,_0x4f03a3,_0xe42f99,_0x3619e4){var _0xb38c11=_0xe42f99?_0xd6a9('0x44'):_0x4efcfe['calleridname'];_0xb38c11=_0x3619e4?_0xd6a9('0x45'):_0xb38c11;return{'actionid':_0x4efcfe[_0xd6a9('0x46')],'action':_0xd6a9('0x47'),'channel':_0x4efcfe['channelAgent'],'callerid':util[_0xd6a9('0x11')]('\x22%s\x22\x20<%s>',_0xb38c11,_0x4efcfe[_0xd6a9('0x19')]),'Exten':_0xd6a9('0x25'),'Context':_0xd6a9('0x48'),'Priority':'1','variable':_0x4f03a3,'timeout':(_0x411744['timeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x4efcfe[_0xd6a9('0x46')]};};exports[_0xd6a9('0x49')]=function(_0x5bb125){return _0x5bb125['countbusyretry']+_0x5bb125[_0xd6a9('0x4a')]+_0x5bb125['countnoanswerretry']+_0x5bb125[_0xd6a9('0x4b')]+_0x5bb125[_0xd6a9('0x4c')];};exports[_0xd6a9('0x4d')]=function(_0x2543d6){var _0x596a36=_[_0xd6a9('0x4e')](_0x2543d6);_0x596a36[_0xd6a9('0x34')]=0xf;_0x596a36[_0xd6a9('0x3e')]='Global';return _0x596a36;};exports[_0xd6a9('0x4f')]=function(_0x4b63b2,_0x1a937a,_0x364e0f){var _0x592a3c={};_0x592a3c[_0x1a937a]=_0x4b63b2[_0x1a937a];_0x592a3c['active']=![];_0x592a3c['scheduledat']=moment()[_0xd6a9('0x50')](_0x364e0f,_0xd6a9('0x51'))[_0xd6a9('0x11')](_0xd6a9('0x39'));_0x592a3c['ContactId']=_0x4b63b2[_0xd6a9('0x1a')];_0x592a3c[_0xd6a9('0x52')]=_0x4b63b2[_0xd6a9('0x52')];_0x592a3c[_0xd6a9('0x53')]=_0x4b63b2[_0xd6a9('0x53')]||undefined;return _0x592a3c;};exports[_0xd6a9('0x54')]=function(_0x29da47,_0x32bdae){if(!_[_0xd6a9('0x14')](_0x29da47)){if(_0x29da47[_0xd6a9('0x55')]>0x0){_0x29da47[_0xd6a9('0x55')]-=0x1;}else{logger['error'](_0x32bdae,_0xd6a9('0x56'));}}else{logger[_0xd6a9('0x8')](_0x32bdae,_0xd6a9('0x57'));}};exports[_0xd6a9('0x58')]=function(_0x594ca8){if(_0x594ca8<=0x0){return!![];}return![];};exports[_0xd6a9('0x59')]=function(_0x1945ef,_0x172bfb,_0x1649f2){_0x1945ef[_0xd6a9('0x5a')]=_0x172bfb;_0x1945ef[_0xd6a9('0x17')]=_0x1945ef['queue'];_0x1945ef['interface']=_0x1945ef['channelAgent'];_0x1945ef[_0xd6a9('0x5b')]=_0xd6a9('0x5c');if(_0x1649f2){_0x1945ef['mandatoryDisposition']=_0x1649f2[_0xd6a9('0x5d')];}return _0x1945ef;};exports[_0xd6a9('0x5e')]=function(_0x5efe3a){var _0x1a690a={};_0x1a690a[_0xd6a9('0x5f')]=_0x5efe3a[_0xd6a9('0x5f')];_0x1a690a[_0xd6a9('0x60')]=_0x5efe3a[_0xd6a9('0x61')];_0x1a690a[_0xd6a9('0x46')]=_0x5efe3a[_0xd6a9('0x46')];return _0x1a690a;};exports[_0xd6a9('0x62')]=function(_0x48b6bb){var _0x23fc11=[];for(var _0x3ed76b in _0x48b6bb){if(_0x48b6bb[_0xd6a9('0x28')](_0x3ed76b)){if(!_[_0xd6a9('0x14')](_0x48b6bb[_0x3ed76b])&&_0x48b6bb[_0x3ed76b][_0xd6a9('0x34')]===_0xd6a9('0x63')&&_0x48b6bb[_0x3ed76b][_0xd6a9('0x64')]===_0xd6a9('0x65')){_0x23fc11[_0xd6a9('0x66')](_0x48b6bb[_0x3ed76b]['id']);}}}return _0x23fc11;};exports['getDiff']=function(_0x5c7366){var _0x3c8127=moment()[_0xd6a9('0x5')](0x0);var _0x1f7fc9=moment(_0x5c7366)[_0xd6a9('0x5')](0x0);return _0x3c8127[_0xd6a9('0x6')](_0x1f7fc9,_0xd6a9('0x7'));};exports[_0xd6a9('0x67')]=function(_0x241b14){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x241b14[_0xd6a9('0x1a')],'ListId':_0x241b14['ListId'],'VoiceQueueId':_0x241b14[_0xd6a9('0x53')]||undefined,'CampaignId':_0x241b14[_0xd6a9('0x68')]||undefined};};exports[_0xd6a9('0x69')]=function(_0x3a520d){if(_0x3a520d===_0xd6a9('0x46')||_0x3a520d===_0xd6a9('0x6a')||_0x3a520d===_0xd6a9('0x5f')||_0x3a520d==='type'||_0x3a520d==='campaigntype'||_0x3a520d==='dialAnswer'||_0x3a520d===_0xd6a9('0x3c')||_0x3a520d===_0xd6a9('0x61')||_0x3a520d===_0xd6a9('0x18')||_0x3a520d===_0xd6a9('0x6b')||_0x3a520d===_0xd6a9('0x19')||_0x3a520d===_0xd6a9('0x6c')||_0x3a520d===_0xd6a9('0x6d')||_0x3a520d===_0xd6a9('0x4a')||_0x3a520d===_0xd6a9('0x6e')||_0x3a520d===_0xd6a9('0x6f')||_0x3a520d===_0xd6a9('0x70')||_0x3a520d==='callbackuniqueid'||_0x3a520d===_0xd6a9('0x71')||_0x3a520d==='recallme'||_0x3a520d===_0xd6a9('0x1a')||_0x3a520d===_0xd6a9('0x52')||_0x3a520d===_0xd6a9('0x3d')||_0x3a520d===_0xd6a9('0x53')||_0x3a520d===_0xd6a9('0x72')||_0x3a520d===_0xd6a9('0x73')||_0x3a520d===_0xd6a9('0x74')||_0x3a520d===_0xd6a9('0x75')||_0x3a520d===_0xd6a9('0x76')||_0x3a520d===_0xd6a9('0x77')||_0x3a520d===_0xd6a9('0x78')||_0x3a520d===_0xd6a9('0x79')||_0x3a520d===_0xd6a9('0x7a')||_0x3a520d===_0xd6a9('0x7b')||_0x3a520d===_0xd6a9('0x7c')||_0x3a520d===_0xd6a9('0x7d')||_0x3a520d===_0xd6a9('0x7e')||_0x3a520d===_0xd6a9('0x7f')||_0x3a520d===_0xd6a9('0x80')||_0x3a520d==='rtpaudioqos'||_0x3a520d===_0xd6a9('0x81')||_0x3a520d===_0xd6a9('0x82')||_0x3a520d===_0xd6a9('0x83')||_0x3a520d===_0xd6a9('0x84')||_0x3a520d==='rtpaudioqoslossbridged'||_0x3a520d===_0xd6a9('0x85')||_0x3a520d===_0xd6a9('0x86')||_0x3a520d===_0xd6a9('0x87')||_0x3a520d===_0xd6a9('0x81')||_0x3a520d===_0xd6a9('0x82')||_0x3a520d==='rtpaudioqosjitterbridged'||_0x3a520d===_0xd6a9('0x84')||_0x3a520d===_0xd6a9('0x88')||_0x3a520d===_0xd6a9('0x85')||_0x3a520d===_0xd6a9('0x86')||_0x3a520d==='bridgepeer'||_0x3a520d===_0xd6a9('0x89')||_0x3a520d==='state'||_0x3a520d===_0xd6a9('0x3e')){return![];}return!![];};exports['getCallerIdRandom']=function(_0xfe3bff,_0x55006f){var _0x1d4ddd,_0x2d3b40,_0x2ae00b;if(_0x55006f<=0x0){_0x55006f=0x1;}_0x1d4ddd=new RegExp(_0xd6a9('0x8a')+_0x55006f+'}$');_0x2d3b40=Math[_0xd6a9('0x8b')](0xa,_0x55006f-0x1);_0x2ae00b=Math[_0xd6a9('0x8b')](0xa,_0x55006f)-0x1;return util[_0xd6a9('0x11')]('%s',_[_0xd6a9('0x8c')](_0xfe3bff,_0x1d4ddd,_['random'](_0x2d3b40,_0x2ae00b)));};exports[_0xd6a9('0x8d')]=function(_0xb9d500){var _0x21b8e8=_0xb9d500[_0xd6a9('0x8e')](/"(.*?)"/);return _0x21b8e8?_0x21b8e8[0x1]:_0xb9d500;};exports[_0xd6a9('0x8f')]=function(_0x30ec77){var _0xa2fb4f=_0x30ec77['match'](/<(.*?)>/);return _0xa2fb4f?_0xa2fb4f[0x1]:_0x30ec77;}; \ No newline at end of file +var _0xccb9=['[updateOriginated]\x20object\x20originated\x20is\x20negative','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','Blacklist','starttime','responsetime','endtime','logAgent','ringtime','membername','UserId','talktime','isFailure','Failure','BOOKED','uniqueid','originate','channelAgent','xcally-motion-preview','timeout','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','countagentrejectretry','countnosuchnumberretry','cloneAction','clone','Global','scheduledAt','active','scheduledat','minutes','ContactId','ListId','VoiceQueueId','decrementTalkink','pTalking','IsNotLoggedIn','buildObj','queue','interface','voice','buildAcw','agentReadyId','not_inuse','status','reachable','getDiff','createBody','CampaignId','filterKey','idContact','countglobal','callback','callbackuniqueid','callbackat','recallme','sipcallid','xmd-queue','xmd-dialurl','xmd-dialtimeout','xmd-dialid','xmd-contactid','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','bridgepeer','getCallerIdRandom','\x5cw{0,','pow','random','match','util','lodash','../../../../config/logger','preview','XCALLY_IP_AGI','127.0.0.1','milliseconds','seconds','error','inspect','logger','info','loggerError','logger2','getCallerId','isUndefined','string','\x22%s\x22\x20<%s>','isEmpty','\x22\x22\x20<>','isActive','isNil','name','format','calleridname','calleridnum','dialer','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','U(xcally-mixmonitor-context)','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','monitor_format','_XCALLY_MIXMONITOR_FORMAT','Contact','hasOwnProperty','tags','updatedAt','%s%s','XMD-','toUpper','toLowerVariables','toLower','updateOriginated','originated'];(function(_0x32ce61,_0x2ba733){var _0x28eded=function(_0x34db11){while(--_0x34db11){_0x32ce61['push'](_0x32ce61['shift']());}};_0x28eded(++_0x2ba733);}(_0xccb9,0x150));var _0x9ccb=function(_0x44268d,_0xad8443){_0x44268d=_0x44268d-0x0;var _0x4be92d=_0xccb9[_0x44268d];return _0x4be92d;};'use strict';var util=require(_0x9ccb('0x0'));var _=require(_0x9ccb('0x1'));var moment=require('moment');var logger=require(_0x9ccb('0x2'))(_0x9ccb('0x3'));var ipAgi=process['env'][_0x9ccb('0x4')]||_0x9ccb('0x5');function getSeconds(_0x310e4d,_0x3c78a7){var _0x1a26a7=moment(_0x310e4d)['milliseconds'](0x0);var _0x40b636=moment(_0x3c78a7)[_0x9ccb('0x6')](0x0);return _0x1a26a7['diff'](_0x40b636,_0x9ccb('0x7'));}exports['loggerCatch']=function(_0x16559e){return function(_0x1aad87){logger[_0x9ccb('0x8')](_0x16559e,util[_0x9ccb('0x9')](_0x1aad87,{'showHidden':![],'depth':null}));};};exports[_0x9ccb('0xa')]=function(_0x55c4b3,_0x27b0a2){logger[_0x9ccb('0xb')](_0x55c4b3,util[_0x9ccb('0x9')](_0x27b0a2,{'showHidden':![],'depth':null}));};exports[_0x9ccb('0xc')]=function(_0x27492a,_0x1475ef){logger[_0x9ccb('0x8')](_0x27492a,util[_0x9ccb('0x9')](_0x1475ef,{'showHidden':![],'depth':null}));};exports[_0x9ccb('0xd')]=function(_0x336549){return function(_0x2c97c0){logger['info'](_0x336549,util[_0x9ccb('0x9')](_0x2c97c0,{'showHidden':![],'depth':null}));};};exports['message']=function(_0x1f6019,_0x5d8638,_0x15532d){return{'message':_0x1f6019,'unlock':_0x5d8638,'active':_0x15532d};};exports[_0x9ccb('0xe')]=function(_0x7bb9f9,_0x236572,_0x5c94ec){if(!_[_0x9ccb('0xf')](_0x5c94ec)&&'string'===typeof _0x5c94ec&&!_['isEmpty'](_0x5c94ec)){if(!_[_0x9ccb('0xf')](_0x236572)&&_0x9ccb('0x10')===typeof _0x236572&&!_['isEmpty'](_0x236572)){return util['format'](_0x9ccb('0x11'),_0x236572,_0x5c94ec);}return util['format']('\x22%s\x22\x20<%s>',_0x5c94ec,_0x5c94ec);}if(!_[_0x9ccb('0xf')](_0x7bb9f9)&&'string'===typeof _0x7bb9f9&&!_[_0x9ccb('0x12')](_0x7bb9f9)){return _0x7bb9f9;}return _0x9ccb('0x13');};exports[_0x9ccb('0x14')]=function(_0x5b19c7){if(_[_0x9ccb('0x15')](_0x5b19c7)){return![];}return _0x5b19c7;};exports['addVariables']=function(_0x269d7c,_0x2af26b,_0x308b1c,_0x657f4e,_0x1a7765,_0x55d37b){var _0x2d6adf={'XMD-QUEUE':_0x2af26b['Queue']?_0x2af26b['Queue'][_0x9ccb('0x16')]:'','XMD-CALLERID':_0x657f4e,'XMD-CALLERID-PREVIEW':_0x55d37b?util[_0x9ccb('0x17')](_0x9ccb('0x11'),_0x55d37b[_0x9ccb('0x18')],_0x55d37b[_0x9ccb('0x19')]):_0x657f4e,'XMD-DIALID':_0x1a7765,'XMD-CONTACTID':_0x2af26b['ContactId'],'XMD-CDRTYPE':_0x9ccb('0x1a'),'CALLERID(all)':_0x657f4e,'XMD-VOICEQUEUEID':_0x2af26b['VoiceQueueId'],'XMD-DIALCHANNEL':_0x308b1c,'XMD-DIALTIMEOUT':_0x269d7c[_0x9ccb('0x1b')]||0x1e,'XMD-DIALOPTIONS':util[_0x9ccb('0x17')](_0x9ccb('0x1c'),_0x269d7c[_0x9ccb('0x1d')]?'g':'',_[_0x9ccb('0x12')](_0x269d7c['monitor_format'])?'':_0x9ccb('0x1e')),'XMD-DIALURL':_0x269d7c['dialPreviewUrl']||'','XMD-AGI':_0x269d7c[_0x9ccb('0x1f')]?util[_0x9ccb('0x17')](_0x9ccb('0x20'),ipAgi,_0x269d7c[_0x9ccb('0x1f')]):_0x9ccb('0x21'),'XMD-AGIAFTER':_0x269d7c[_0x9ccb('0x1d')]?util['format']('\x22agi://%s/square,%s\x22',ipAgi,_0x269d7c[_0x9ccb('0x1d')]):_0x9ccb('0x21'),'XMD-ORIGINATECALLERIDNUM':_0x55d37b?_0x55d37b[_0x9ccb('0x22')]:'','XMD-ORIGINATECALLERIDNAME':_0x55d37b?_0x55d37b['originatecalleridname']:'','XMD-DESTINATION':'xcally-motion-preview'};if(!_['isEmpty'](_0x269d7c[_0x9ccb('0x23')])){_0x2d6adf[util[_0x9ccb('0x17')]('%s',_0x9ccb('0x24'))]=_0x269d7c['monitor_format'];_0x2d6adf[util[_0x9ccb('0x17')]('%s','_XCALLY_MIXMONITOR_UNIQUEID')]=_0x1a7765;}if(_0x2af26b&&_0x2af26b[_0x9ccb('0x25')]){for(var _0x59bbc6 in _0x2af26b[_0x9ccb('0x25')]){if(_0x2af26b['Contact'][_0x9ccb('0x26')](_0x59bbc6)){if(!_['isNil'](_0x2af26b[_0x9ccb('0x25')][_0x59bbc6])&&_0x59bbc6!=='id'&&_0x59bbc6!==_0x9ccb('0x27')&&_0x59bbc6!=='createdAt'&&_0x59bbc6!==_0x9ccb('0x28')){_0x2d6adf[util[_0x9ccb('0x17')](_0x9ccb('0x29'),_0x9ccb('0x2a'),_[_0x9ccb('0x2b')](_0x59bbc6))]=_0x2af26b['Contact'][_0x59bbc6];}}}}return _0x2d6adf;};exports[_0x9ccb('0x2c')]=function(_0x381e4){var _0x158ecb={};for(var _0x22573d in _0x381e4){if(_0x381e4[_0x9ccb('0x26')](_0x22573d)){_0x158ecb[util[_0x9ccb('0x17')]('%s',_[_0x9ccb('0x2d')](_0x22573d))]=_0x381e4[_0x22573d];}}return{'variables':_0x158ecb};};exports[_0x9ccb('0x2e')]=function(_0x1862d5,_0xf47d22){if(!_[_0x9ccb('0x15')](_0x1862d5)){if(_0x1862d5[_0x9ccb('0x26')](_0x9ccb('0x2f'))){if(_0x1862d5[_0x9ccb('0x2f')]>0x0){_0x1862d5[_0x9ccb('0x2f')]-=0x1;}else{logger[_0x9ccb('0x8')](_0x9ccb('0x30'),_0xf47d22);}}}else{logger['error']('[updateOriginated]\x20is\x20null\x20or\x20undefined',_0xf47d22);}};exports[_0x9ccb('0x31')]=function(_0x47dbca){var _0x4fe972=moment()['format'](_0x9ccb('0x32'));_0x47dbca[_0x9ccb('0x33')]=0xd;_0x47dbca[_0x9ccb('0x34')]=_0x9ccb('0x35');_0x47dbca[_0x9ccb('0x36')]=_0x4fe972;_0x47dbca[_0x9ccb('0x37')]=_0x4fe972;_0x47dbca[_0x9ccb('0x38')]=_0x4fe972;};exports[_0x9ccb('0x39')]=function(_0x1b727d,_0x4cc30f,_0x1c22e7){var _0x30d14c=moment()[_0x9ccb('0x17')](_0x9ccb('0x32'));_0x1b727d[_0x9ccb('0x33')]=_0x4cc30f;_0x1b727d[_0x9ccb('0x34')]=_0x1c22e7;_0x1b727d[_0x9ccb('0x37')]=_0x30d14c;_0x1b727d[_0x9ccb('0x3a')]=getSeconds(_0x1b727d[_0x9ccb('0x37')],_0x1b727d[_0x9ccb('0x36')]);};exports['logLookAgent']=function(_0x10837c,_0x65d6b0,_0x2a40b7){_0x10837c[_0x9ccb('0x3b')]=_0x65d6b0;_0x10837c[_0x9ccb('0x3c')]=_0x2a40b7;};exports['logCustomer']=function(_0x5c98bd,_0x55106b,_0x451606){var _0xb43e0=moment()[_0x9ccb('0x17')](_0x9ccb('0x32'));_0x5c98bd[_0x9ccb('0x33')]=_0x55106b;_0x5c98bd[_0x9ccb('0x34')]=_0x451606;_0x5c98bd[_0x9ccb('0x37')]=_0x5c98bd['responsetime']?_0x5c98bd['responsetime']:_0xb43e0;_0x5c98bd[_0x9ccb('0x38')]=_0x5c98bd[_0x9ccb('0x38')]?_0x5c98bd[_0x9ccb('0x38')]:_0xb43e0;_0x5c98bd[_0x9ccb('0x3a')]=getSeconds(_0x5c98bd[_0x9ccb('0x37')]||0x0,_0x5c98bd['starttime']||0x0);_0x5c98bd[_0x9ccb('0x3d')]=_0x5c98bd['answertime']?getSeconds(_0x5c98bd['endtime'],_0x5c98bd['answertime']):0x0;};exports[_0x9ccb('0x3e')]=function(_0x49a7c5){return _0x49a7c5===_0x9ccb('0x3f');};exports['variablesAction']=function(_0x29c8d7,_0x1d06e2,_0x2902d0,_0x16b7c5,_0x183b54){var _0x326e0d=_0x16b7c5?'RECALL':_0x29c8d7[_0x9ccb('0x18')];_0x326e0d=_0x183b54?_0x9ccb('0x40'):_0x326e0d;return{'actionid':_0x29c8d7[_0x9ccb('0x41')],'action':_0x9ccb('0x42'),'channel':_0x29c8d7[_0x9ccb('0x43')],'callerid':util['format'](_0x9ccb('0x11'),_0x326e0d,_0x29c8d7['calleridnum']),'Exten':_0x9ccb('0x44'),'Context':'from-sip','Priority':'1','variable':_0x2902d0,'timeout':(_0x1d06e2[_0x9ccb('0x45')]||0x1e)*0x3e8,'async':!![],'channelid':_0x29c8d7[_0x9ccb('0x41')]};};exports[_0x9ccb('0x46')]=function(_0x5d540c){return _0x5d540c[_0x9ccb('0x47')]+_0x5d540c[_0x9ccb('0x48')]+_0x5d540c[_0x9ccb('0x49')]+_0x5d540c[_0x9ccb('0x4a')]+_0x5d540c[_0x9ccb('0x4b')];};exports[_0x9ccb('0x4c')]=function(_0x19edc6){var _0x514c78=_[_0x9ccb('0x4d')](_0x19edc6);_0x514c78['state']=0xf;_0x514c78[_0x9ccb('0x34')]=_0x9ccb('0x4e');return _0x514c78;};exports[_0x9ccb('0x4f')]=function(_0x44a1c,_0x4fb428,_0x4dbfc1){var _0x5c8243={};_0x5c8243[_0x4fb428]=_0x44a1c[_0x4fb428];_0x5c8243[_0x9ccb('0x50')]=![];_0x5c8243[_0x9ccb('0x51')]=moment()['add'](_0x4dbfc1,_0x9ccb('0x52'))[_0x9ccb('0x17')](_0x9ccb('0x32'));_0x5c8243[_0x9ccb('0x53')]=_0x44a1c[_0x9ccb('0x53')];_0x5c8243[_0x9ccb('0x54')]=_0x44a1c[_0x9ccb('0x54')];_0x5c8243['VoiceQueueId']=_0x44a1c[_0x9ccb('0x55')]||undefined;return _0x5c8243;};exports[_0x9ccb('0x56')]=function(_0x49313e,_0x2cc6e4){if(!_[_0x9ccb('0x15')](_0x49313e)){if(_0x49313e[_0x9ccb('0x57')]>0x0){_0x49313e['pTalking']-=0x1;}else{logger[_0x9ccb('0x8')](_0x2cc6e4,'[decrementTalkink]\x20object\x20talking\x20is\x20negative');}}else{logger[_0x9ccb('0x8')](_0x2cc6e4,'[decrementTalkink]\x20is\x20null\x20or\x20undefined');}};exports[_0x9ccb('0x58')]=function(_0x1512d2){if(_0x1512d2<=0x0){return!![];}return![];};exports[_0x9ccb('0x59')]=function(_0x279505,_0x35418d,_0x4bfd0e){_0x279505['lastevent']=_0x35418d;_0x279505[_0x9ccb('0x16')]=_0x279505[_0x9ccb('0x5a')];_0x279505[_0x9ccb('0x5b')]=_0x279505[_0x9ccb('0x43')];_0x279505['motionChannel']=_0x9ccb('0x5c');if(_0x4bfd0e){_0x279505['mandatoryDisposition']=_0x4bfd0e['mandatoryDisposition'];}return _0x279505;};exports[_0x9ccb('0x5d')]=function(_0x15104c){var _0xbec212={};_0xbec212['queue']=_0x15104c[_0x9ccb('0x5a')];_0xbec212[_0x9ccb('0x5b')]=_0x15104c[_0x9ccb('0x43')];_0xbec212[_0x9ccb('0x41')]=_0x15104c['uniqueid'];return _0xbec212;};exports[_0x9ccb('0x5e')]=function(_0x276bdd){var _0xb4eb12=[];for(var _0x408d08 in _0x276bdd){if(_0x276bdd[_0x9ccb('0x26')](_0x408d08)){if(!_[_0x9ccb('0x15')](_0x276bdd[_0x408d08])&&_0x276bdd[_0x408d08][_0x9ccb('0x33')]===_0x9ccb('0x5f')&&_0x276bdd[_0x408d08][_0x9ccb('0x60')]===_0x9ccb('0x61')){_0xb4eb12['push'](_0x276bdd[_0x408d08]['id']);}}}return _0xb4eb12;};exports[_0x9ccb('0x62')]=function(_0x88abf8){var _0x5ebac9=moment()[_0x9ccb('0x6')](0x0);var _0x24f46e=moment(_0x88abf8)['milliseconds'](0x0);return _0x5ebac9['diff'](_0x24f46e,'seconds');};exports[_0x9ccb('0x63')]=function(_0x273705){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x273705[_0x9ccb('0x53')],'ListId':_0x273705[_0x9ccb('0x54')],'VoiceQueueId':_0x273705['VoiceQueueId']||undefined,'CampaignId':_0x273705[_0x9ccb('0x64')]||undefined};};exports[_0x9ccb('0x65')]=function(_0x254f99){if(_0x254f99==='uniqueid'||_0x254f99===_0x9ccb('0x66')||_0x254f99===_0x9ccb('0x5a')||_0x254f99==='type'||_0x254f99==='campaigntype'||_0x254f99==='dialAnswer'||_0x254f99===_0x9ccb('0x3b')||_0x254f99===_0x9ccb('0x43')||_0x254f99===_0x9ccb('0x18')||_0x254f99===_0x9ccb('0x50')||_0x254f99===_0x9ccb('0x19')||_0x254f99===_0x9ccb('0x51')||_0x254f99===_0x9ccb('0x47')||_0x254f99===_0x9ccb('0x48')||_0x254f99==='countnoanswerretry'||_0x254f99===_0x9ccb('0x67')||_0x254f99===_0x9ccb('0x68')||_0x254f99===_0x9ccb('0x69')||_0x254f99===_0x9ccb('0x6a')||_0x254f99===_0x9ccb('0x6b')||_0x254f99===_0x9ccb('0x53')||_0x254f99===_0x9ccb('0x54')||_0x254f99==='UserId'||_0x254f99==='VoiceQueueId'||_0x254f99===_0x9ccb('0x6c')||_0x254f99==='xmd-voicequeueid'||_0x254f99===_0x9ccb('0x6d')||_0x254f99==='xmd-phone'||_0x254f99==='xmd-listid'||_0x254f99===_0x9ccb('0x6e')||_0x254f99===_0x9ccb('0x6f')||_0x254f99==='xmd-dialoptions'||_0x254f99===_0x9ccb('0x70')||_0x254f99==='xmd-dialchannel'||_0x254f99===_0x9ccb('0x71')||_0x254f99==='xmd-cdrtype'||_0x254f99===_0x9ccb('0x72')||_0x254f99===_0x9ccb('0x73')||_0x254f99===_0x9ccb('0x74')||_0x254f99==='rtpaudioqos'||_0x254f99===_0x9ccb('0x75')||_0x254f99===_0x9ccb('0x76')||_0x254f99==='rtpaudioqosjitterbridged'||_0x254f99==='rtpaudioqosloss'||_0x254f99===_0x9ccb('0x77')||_0x254f99===_0x9ccb('0x78')||_0x254f99===_0x9ccb('0x79')||_0x254f99==='rtpaudioqos'||_0x254f99===_0x9ccb('0x75')||_0x254f99==='rtpaudioqosjitter'||_0x254f99==='rtpaudioqosjitterbridged'||_0x254f99==='rtpaudioqosloss'||_0x254f99===_0x9ccb('0x77')||_0x254f99===_0x9ccb('0x78')||_0x254f99==='rtpaudioqosrttbridged'||_0x254f99===_0x9ccb('0x7a')||_0x254f99==='bridgepvtcallid'||_0x254f99===_0x9ccb('0x33')||_0x254f99===_0x9ccb('0x34')){return![];}return!![];};exports[_0x9ccb('0x7b')]=function(_0x4e928e,_0x550c66){var _0x188854,_0x443949,_0x14356e;if(_0x550c66<=0x0){_0x550c66=0x1;}_0x188854=new RegExp(_0x9ccb('0x7c')+_0x550c66+'}$');_0x443949=Math[_0x9ccb('0x7d')](0xa,_0x550c66-0x1);_0x14356e=Math[_0x9ccb('0x7d')](0xa,_0x550c66)-0x1;return util['format']('%s',_['replace'](_0x4e928e,_0x188854,_[_0x9ccb('0x7e')](_0x443949,_0x14356e)));};exports['extractCalleridName']=function(_0x2751ca){var _0x38bd38=_0x2751ca['match'](/"(.*?)"/);return _0x38bd38?_0x38bd38[0x1]:_0x2751ca;};exports['extractCalleridNumber']=function(_0x6ba233){var _0x48e276=_0x6ba233[_0x9ccb('0x7f')](/<(.*?)>/);return _0x48e276?_0x48e276[0x1]:_0x6ba233;}; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index 518cac9..a08d329 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 _0x4a47=['number','queueremove','queuepause','reload','voicechannel','voicequeuechannelredirect','queueadd','string'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0x4a47,0x146));var _0x74a4=function(_0x2af276,_0xb15ec5){_0x2af276=_0x2af276-0x0;var _0x4c586e=_0x4a47[_0x2af276];return _0x4c586e;};'use strict';exports[_0x74a4('0x0')]={'queue':{'type':_0x74a4('0x1'),'required':!![]},'interface':{'type':_0x74a4('0x1'),'required':!![]},'membername':{'type':'string','required':!![]},'penalty':{'type':_0x74a4('0x2'),'required':![]},'paused':{'type':'boolean','required':![]}};exports[_0x74a4('0x3')]={'queue':{'type':_0x74a4('0x1'),'required':!![]},'interface':{'type':_0x74a4('0x1'),'required':!![]}};exports[_0x74a4('0x4')]={'interface':{'type':'string','required':!![]},'paused':{'type':'boolean'},'reason':{'type':_0x74a4('0x1'),'required':![]}};exports[_0x74a4('0x5')]={'module':{'type':'string','required':![]}};exports['voicequeuechannel']={'uniqueid':{'type':_0x74a4('0x1'),'required':!![]}};exports[_0x74a4('0x6')]={'uniqueid':{'type':_0x74a4('0x1'),'required':!![]},'filename':{'type':'string'},'format':{'type':_0x74a4('0x1')},'mixmonitorid':{'type':_0x74a4('0x1')}};exports['voicequeuechannelhangup']={'uniqueid':{'type':_0x74a4('0x1'),'required':!![]}};exports[_0x74a4('0x7')]={'uniqueid':{'type':_0x74a4('0x1'),'required':!![]},'exten':{'type':_0x74a4('0x1'),'required':!![]},'context':{'type':_0x74a4('0x1')}}; \ No newline at end of file +var _0xc1f8=['voicechannel','voicequeuechannelhangup','voicequeuechannelredirect','string','number','queueremove','queuepause','boolean','reload'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0xc1f8,0x1bc));var _0x8c1f=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xc1f8[_0x20a584];return _0x4b41a8;};'use strict';exports['queueadd']={'queue':{'type':_0x8c1f('0x0'),'required':!![]},'interface':{'type':_0x8c1f('0x0'),'required':!![]},'membername':{'type':_0x8c1f('0x0'),'required':!![]},'penalty':{'type':_0x8c1f('0x1'),'required':![]},'paused':{'type':'boolean','required':![]}};exports[_0x8c1f('0x2')]={'queue':{'type':'string','required':!![]},'interface':{'type':_0x8c1f('0x0'),'required':!![]}};exports[_0x8c1f('0x3')]={'interface':{'type':'string','required':!![]},'paused':{'type':_0x8c1f('0x4')},'reason':{'type':_0x8c1f('0x0'),'required':![]}};exports[_0x8c1f('0x5')]={'module':{'type':_0x8c1f('0x0'),'required':![]}};exports['voicequeuechannel']={'uniqueid':{'type':'string','required':!![]}};exports[_0x8c1f('0x6')]={'uniqueid':{'type':_0x8c1f('0x0'),'required':!![]},'filename':{'type':_0x8c1f('0x0')},'format':{'type':_0x8c1f('0x0')},'mixmonitorid':{'type':'string'}};exports[_0x8c1f('0x7')]={'uniqueid':{'type':'string','required':!![]}};exports[_0x8c1f('0x8')]={'uniqueid':{'type':_0x8c1f('0x0'),'required':!![]},'exten':{'type':_0x8c1f('0x0'),'required':!![]},'context':{'type':_0x8c1f('0x0')}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index 933fdc8..8f8bee0 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 _0x0611=['outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','mergeFromDatabase','isUndefined','agents','initTelephones','length','initTrunks','initVoiceQueues','initTriggers','initTemplates','initZendeskAccounts','initSalesforceAccounts','freshdeskAccounts','initZohoAccounts','initDeskAccounts','initSugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','dynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','merge','groupBy','uniqueid','queuecallerabandon','seconds','queuecallercompleteAt','queuecallerabandonAt','diff','sumBillable','queuecallerleaveAt','initVoiceCallReports','duration','disposition','ANSWERED','billableseconds','dialQueueProject','SquareProject','initVoiceExtensions','initCampaignHopperHistory','initFaxAccounts','exports','bluebird','util','lodash','../model/agent','../model/trunk','../model/voiceQueue','../model/template','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/deskAccount','../model/vtigerAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','telephones','trunks','voiceQueues','triggers','campaigns','templates','outbound','voiceExtensions','channels','queueChannels','settings','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','freshsalesAccounts','faxAccounts','mapKeys','hasOwnProperty','format','SIP/%s','isNil','name','interface','total','answered','sumDuration','ivrTotalCallsDays','ivrAnswerCallsDay','isEmpty','unmanaged','sumHoldTime','outboundNoAnswerCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundDropCallsDayTimeout'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x0611,0x9a));var _0x1061=function(_0x3dcf2f,_0x42fe3d){_0x3dcf2f=_0x3dcf2f-0x0;var _0x53abaf=_0x0611[_0x3dcf2f];return _0x53abaf;};'use strict';var BPromise=require(_0x1061('0x0'));var util=require(_0x1061('0x1'));var _=require(_0x1061('0x2'));var moment=require('moment');var Agent=require(_0x1061('0x3'));var Telephone=require('../model/telephone');var Trunk=require(_0x1061('0x4'));var VoiceQueue=require(_0x1061('0x5'));var Trigger=require('../model/trigger');var Template=require(_0x1061('0x6'));var Campaign=require(_0x1061('0x7'));var VoiceExtension=require(_0x1061('0x8'));var ZendeskAccount=require(_0x1061('0x9'));var SalesforceAccount=require('../model/salesforceAccount');var FreshdeskAccount=require('../model/freshdeskAccount');var SugarcrmAccount=require('../model/sugarcrmAccount');var ZohoAccount=require('../model/zohoAccount');var DeskAccount=require(_0x1061('0xa'));var VtigerAccount=require(_0x1061('0xb'));var ServicenowAccount=require('../model/servicenowAccount');var Dynamics365Account=require(_0x1061('0xc'));var FreshsalesAccount=require(_0x1061('0xd'));var FaxAccount=require(_0x1061('0xe'));var Realtime=function(){this['agents']={};this[_0x1061('0xf')]={};this[_0x1061('0x10')]={};this[_0x1061('0x11')]={};this[_0x1061('0x12')]={};this[_0x1061('0x13')]={};this[_0x1061('0x14')]={};this[_0x1061('0x15')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x1061('0x16')]={};this[_0x1061('0x17')]={};this[_0x1061('0x18')]={};this['outboundChannels']={};this['timers']={};this[_0x1061('0x19')]={};this[_0x1061('0x1a')]={};this[_0x1061('0x1b')]={};this[_0x1061('0x1c')]={};this['freshdeskAccounts']={};this[_0x1061('0x1d')]={};this[_0x1061('0x1e')]={};this[_0x1061('0x1f')]={};this[_0x1061('0x20')]={};this['dynamics365Accounts']={};this[_0x1061('0x21')]={};this[_0x1061('0x22')]={};};function freeIsNotKey(_0x2b54de,_0x478b57,_0x1387e3){var _0x55798b=_[_0x1061('0x23')](_0x2b54de,function(_0x19409e,_0x265927){return _0x19409e[_0x1387e3];});for(var _0x45dd79 in _0x478b57){if(_0x478b57[_0x1061('0x24')](_0x45dd79)){if(!_0x55798b[_0x45dd79]){delete _0x478b57[_0x45dd79];}}}}function freeIsNotKeySip(_0x34534c,_0x5ed29e){var _0x5255e3=_[_0x1061('0x23')](_0x34534c,function(_0x319383,_0x20721b){return util[_0x1061('0x25')](_0x1061('0x26'),_0x319383['name']);});for(var _0x53baf3 in _0x5ed29e){if(_0x5ed29e[_0x1061('0x24')](_0x53baf3)){if(!_0x5255e3[_0x53baf3]){delete _0x5ed29e[_0x53baf3];}}}}function freeIsNotKeyAgent(_0x4b76c4,_0x51e945){var _0x3b9e8f=_['mapKeys'](_0x4b76c4,function(_0x37d3db,_0x5ebe38){var _0x3f3f9a=_[_0x1061('0x27')](_0x37d3db['interface'])?util[_0x1061('0x25')](_0x1061('0x26'),_0x37d3db[_0x1061('0x28')]):_0x37d3db[_0x1061('0x29')];return _0x3f3f9a;});for(var _0xbfcd0d in _0x51e945){if(_0x51e945[_0x1061('0x24')](_0xbfcd0d)){if(!_0x3b9e8f[_0xbfcd0d]){delete _0x51e945[_0xbfcd0d];}}}}function clearVoiceCallReports(_0x30ed03){_0x30ed03[_0x1061('0x2a')]=0x0;_0x30ed03[_0x1061('0x2b')]=0x0;_0x30ed03['sumHoldTime']=0x0;_0x30ed03[_0x1061('0x2c')]=0x0;_0x30ed03['sumBillable']=0x0;}function clearCampaigns(_0x2e3556){if(!_['isEmpty'](_0x2e3556)){for(var _0x5788e7 in _0x2e3556){if(_0x2e3556[_0x1061('0x24')](_0x5788e7)){_0x2e3556[_0x5788e7][_0x1061('0x2d')]=0x0;_0x2e3556[_0x5788e7][_0x1061('0x2e')]=0x0;}}}}function clearVoiceQueues(_0x32c2aa){if(!_[_0x1061('0x2f')](_0x32c2aa)){for(var _0x2422f0 in _0x32c2aa){if(_0x32c2aa[_0x1061('0x24')](_0x2422f0)){_0x32c2aa[_0x2422f0][_0x1061('0x2a')]=0x0;_0x32c2aa[_0x2422f0]['answered']=0x0;_0x32c2aa[_0x2422f0][_0x1061('0x30')]=0x0;_0x32c2aa[_0x2422f0]['abandoned']=0x0;_0x32c2aa[_0x2422f0][_0x1061('0x31')]=0x0;_0x32c2aa[_0x2422f0][_0x1061('0x2c')]=0x0;_0x32c2aa[_0x2422f0]['sumBillable']=0x0;_0x32c2aa[_0x2422f0]['outboundAnswerAgiCallsDay']=0x0;_0x32c2aa[_0x2422f0][_0x1061('0x32')]=0x0;_0x32c2aa[_0x2422f0]['outboundBusyCallsDay']=0x0;_0x32c2aa[_0x2422f0][_0x1061('0x33')]=0x0;_0x32c2aa[_0x2422f0][_0x1061('0x34')]=0x0;_0x32c2aa[_0x2422f0]['outboundUnknownCallsDay']=0x0;_0x32c2aa[_0x2422f0][_0x1061('0x35')]=0x0;_0x32c2aa[_0x2422f0][_0x1061('0x36')]=0x0;_0x32c2aa[_0x2422f0][_0x1061('0x37')]=0x0;_0x32c2aa[_0x2422f0][_0x1061('0x38')]=0x0;_0x32c2aa[_0x2422f0][_0x1061('0x39')]=0x0;_0x32c2aa[_0x2422f0][_0x1061('0x3a')]=0x0;_0x32c2aa[_0x2422f0][_0x1061('0x3b')]=0x0;_0x32c2aa[_0x2422f0][_0x1061('0x3c')]=0x0;_0x32c2aa[_0x2422f0][_0x1061('0x3d')]=!![];}}}}Realtime[_0x1061('0x3e')][_0x1061('0x3f')]=function(_0x2f2182,_0x5f4e5d){for(var _0x5433eb in _0x5f4e5d){if(_0x2f2182['hasOwnProperty'](_0x5433eb)){_0x2f2182[_0x5433eb]=_0x5f4e5d[_0x5433eb];}}};Realtime[_0x1061('0x3e')]['initAgents']=function(){var _0x10b64b=this;return function(_0x34f1f6){if(_0x34f1f6){freeIsNotKeyAgent(_0x34f1f6,_0x10b64b['agents']);for(var _0x39e6de=0x0,_0x2e45ac={},_0x798c51={};_0x39e6de<_0x34f1f6['length'];_0x39e6de+=0x1){_0x2e45ac=_0x34f1f6[_0x39e6de];var _0x31d339=_[_0x1061('0x27')](_0x2e45ac['interface'])?util[_0x1061('0x25')](_0x1061('0x26'),_0x2e45ac[_0x1061('0x28')]):_0x2e45ac[_0x1061('0x29')];if(_[_0x1061('0x40')](_0x10b64b[_0x1061('0x41')][_0x31d339])){_0x10b64b[_0x1061('0x41')][_0x31d339]=new Agent(_0x2e45ac);}else{_0x10b64b[_0x1061('0x3f')](_0x10b64b[_0x1061('0x41')][_0x31d339],_0x2e45ac);}}}return _0x10b64b[_0x1061('0x41')];};};Realtime[_0x1061('0x3e')][_0x1061('0x42')]=function(){var _0x498ecd=this;return function(_0x40359e){if(_0x40359e){freeIsNotKeySip(_0x40359e,_0x498ecd['telephones']);for(var _0x23c9c3=0x0,_0xff3b18={},_0x22f472={};_0x23c9c3<_0x40359e[_0x1061('0x43')];_0x23c9c3+=0x1){_0xff3b18=_0x40359e[_0x23c9c3];if(_[_0x1061('0x40')](_0x498ecd[_0x1061('0xf')][util[_0x1061('0x25')](_0x1061('0x26'),_0xff3b18['name'])])){_0x498ecd['telephones'][util[_0x1061('0x25')](_0x1061('0x26'),_0xff3b18[_0x1061('0x28')])]=new Telephone(_0xff3b18);}else{_0x498ecd[_0x1061('0x3f')](_0x498ecd[_0x1061('0xf')][util[_0x1061('0x25')](_0x1061('0x26'),_0xff3b18[_0x1061('0x28')])],_0xff3b18);}}}return _0x498ecd[_0x1061('0xf')];};};Realtime['prototype'][_0x1061('0x44')]=function(){var _0x43d7e4=this;return function(_0x3d971e){if(_0x3d971e){freeIsNotKeySip(_0x3d971e,_0x43d7e4[_0x1061('0x10')]);for(var _0xb467b=0x0,_0x2e9f4b={},_0x49468b={};_0xb467b<_0x3d971e['length'];_0xb467b+=0x1){_0x2e9f4b=_0x3d971e[_0xb467b];if(_[_0x1061('0x40')](_0x43d7e4[_0x1061('0x10')][util[_0x1061('0x25')](_0x1061('0x26'),_0x2e9f4b['name'])])){_0x43d7e4[_0x1061('0x10')][util[_0x1061('0x25')](_0x1061('0x26'),_0x2e9f4b[_0x1061('0x28')])]=new Trunk(_0x2e9f4b);}else{_0x43d7e4['mergeFromDatabase'](_0x43d7e4[_0x1061('0x10')][util[_0x1061('0x25')](_0x1061('0x26'),_0x2e9f4b[_0x1061('0x28')])],_0x2e9f4b);}}}return _0x43d7e4['trunks'];};};Realtime[_0x1061('0x3e')][_0x1061('0x45')]=function(){var _0x39d3c4=this;return function(_0xb856d4){if(_0xb856d4){freeIsNotKey(_0xb856d4,_0x39d3c4[_0x1061('0x11')],_0x1061('0x28'));for(var _0x50aac7=0x0,_0x2df83c={},_0x1fcb48={};_0x50aac7<_0xb856d4[_0x1061('0x43')];_0x50aac7+=0x1){_0x2df83c=_0xb856d4[_0x50aac7];if(_[_0x1061('0x40')](_0x39d3c4[_0x1061('0x11')][_0x2df83c['name']])){_0x39d3c4[_0x1061('0x11')][_0x2df83c[_0x1061('0x28')]]=new VoiceQueue(_0x2df83c);}else{_0x39d3c4['mergeFromDatabase'](_0x39d3c4[_0x1061('0x11')][_0x2df83c['name']],_0x2df83c);}}}return _0x39d3c4[_0x1061('0x11')];};};Realtime[_0x1061('0x3e')][_0x1061('0x46')]=function(){var _0x4f176e=this;return function(_0x476b80){if(_0x476b80){freeIsNotKey(_0x476b80,_0x4f176e[_0x1061('0x12')],'id');for(var _0x3d7eec=0x0,_0xa5db3b={},_0x4c21ff={};_0x3d7eec<_0x476b80[_0x1061('0x43')];_0x3d7eec+=0x1){_0xa5db3b=_0x476b80[_0x3d7eec];if(_[_0x1061('0x40')](_0x4f176e[_0x1061('0x12')][_0xa5db3b['id']])){_0x4f176e[_0x1061('0x12')][_0xa5db3b['id']]=new Trigger(_0xa5db3b);}else{_0x4f176e['mergeFromDatabase'](_0x4f176e[_0x1061('0x12')][_0xa5db3b['id']],_0xa5db3b);}}}return _0x4f176e[_0x1061('0x12')];};};Realtime[_0x1061('0x3e')][_0x1061('0x47')]=function(){var _0x2fb67b=this;return function(_0x493644){if(_0x493644){freeIsNotKey(_0x493644,_0x2fb67b[_0x1061('0x14')],'id');for(var _0x50d737=0x0,_0xdaffab={},_0x5e7475={};_0x50d737<_0x493644[_0x1061('0x43')];_0x50d737+=0x1){_0xdaffab=_0x493644[_0x50d737];if(_['isUndefined'](_0x2fb67b['templates'][_0xdaffab['id']])){_0x2fb67b['templates'][_0xdaffab['id']]=new Template(_0xdaffab);}else{_0x2fb67b[_0x1061('0x3f')](_0x2fb67b[_0x1061('0x14')][_0xdaffab['id']],_0xdaffab);}}}return _0x2fb67b['templates'];};};Realtime['prototype'][_0x1061('0x48')]=function(){var _0x20e888=this;return function(_0x487f2a){if(_0x487f2a){freeIsNotKey(_0x487f2a,_0x20e888['zendeskAccounts'],'id');for(var _0x1c3401=0x0,_0xe1f3cd={},_0x196ab2={};_0x1c3401<_0x487f2a[_0x1061('0x43')];_0x1c3401+=0x1){_0xe1f3cd=_0x487f2a[_0x1c3401];if(_['isUndefined'](_0x20e888['zendeskAccounts'][_0xe1f3cd['id']])){_0x20e888['zendeskAccounts'][_0xe1f3cd['id']]=new ZendeskAccount(_0xe1f3cd);}else{_0x20e888[_0x1061('0x3f')](_0x20e888['zendeskAccounts'][_0xe1f3cd['id']],_0xe1f3cd);}}}return _0x20e888['zendeskAccounts'];};};Realtime[_0x1061('0x3e')][_0x1061('0x49')]=function(){var _0x290f7f=this;return function(_0x6f71e2){if(_0x6f71e2){freeIsNotKey(_0x6f71e2,_0x290f7f['salesforceAccounts'],'id');for(var _0x169abe=0x0,_0x5c96ff={},_0x5a4590={};_0x169abe<_0x6f71e2[_0x1061('0x43')];_0x169abe+=0x1){_0x5c96ff=_0x6f71e2[_0x169abe];if(_[_0x1061('0x40')](_0x290f7f[_0x1061('0x1b')][_0x5c96ff['id']])){_0x290f7f['salesforceAccounts'][_0x5c96ff['id']]=new SalesforceAccount(_0x5c96ff);}else{_0x290f7f[_0x1061('0x3f')](_0x290f7f[_0x1061('0x1b')][_0x5c96ff['id']],_0x5c96ff);}}}return _0x290f7f[_0x1061('0x1b')];};};Realtime['prototype']['initFreshdeskAccounts']=function(){var _0x477d56=this;return function(_0x1ba045){if(_0x1ba045){freeIsNotKey(_0x1ba045,_0x477d56[_0x1061('0x4a')],'id');for(var _0x46b308=0x0,_0x4be630={},_0x59578a={};_0x46b308<_0x1ba045[_0x1061('0x43')];_0x46b308+=0x1){_0x4be630=_0x1ba045[_0x46b308];if(_[_0x1061('0x40')](_0x477d56[_0x1061('0x4a')][_0x4be630['id']])){_0x477d56[_0x1061('0x4a')][_0x4be630['id']]=new FreshdeskAccount(_0x4be630);}else{_0x477d56[_0x1061('0x3f')](_0x477d56[_0x1061('0x4a')][_0x4be630['id']],_0x4be630);}}}return _0x477d56[_0x1061('0x4a')];};};Realtime[_0x1061('0x3e')][_0x1061('0x4b')]=function(){var _0x16c9dd=this;return function(_0x235183){if(_0x235183){freeIsNotKey(_0x235183,_0x16c9dd[_0x1061('0x1d')],'id');for(var _0x32f636=0x0,_0xa77904={},_0x5a28d7={};_0x32f636<_0x235183[_0x1061('0x43')];_0x32f636+=0x1){_0xa77904=_0x235183[_0x32f636];if(_['isUndefined'](_0x16c9dd['zohoAccounts'][_0xa77904['id']])){_0x16c9dd['zohoAccounts'][_0xa77904['id']]=new ZohoAccount(_0xa77904);}else{_0x16c9dd['mergeFromDatabase'](_0x16c9dd['zohoAccounts'][_0xa77904['id']],_0xa77904);}}}return _0x16c9dd[_0x1061('0x1d')];};};Realtime[_0x1061('0x3e')][_0x1061('0x4c')]=function(){var _0x320b2a=this;return function(_0x42c565){if(_0x42c565){freeIsNotKey(_0x42c565,_0x320b2a[_0x1061('0x1e')],'id');for(var _0xb5cbcc=0x0,_0x31324a={},_0x238a5f={};_0xb5cbcc<_0x42c565['length'];_0xb5cbcc+=0x1){_0x31324a=_0x42c565[_0xb5cbcc];if(_[_0x1061('0x40')](_0x320b2a['deskAccounts'][_0x31324a['id']])){_0x320b2a[_0x1061('0x1e')][_0x31324a['id']]=new DeskAccount(_0x31324a);}else{_0x320b2a[_0x1061('0x3f')](_0x320b2a[_0x1061('0x1e')][_0x31324a['id']],_0x31324a);}}}return _0x320b2a[_0x1061('0x1e')];};};Realtime[_0x1061('0x3e')][_0x1061('0x4d')]=function(){var _0x56dbbf=this;return function(_0x49092f){if(_0x49092f){freeIsNotKey(_0x49092f,_0x56dbbf[_0x1061('0x1c')],'id');for(var _0x1245dc=0x0,_0x6629b={},_0x4c170b={};_0x1245dc<_0x49092f[_0x1061('0x43')];_0x1245dc+=0x1){_0x6629b=_0x49092f[_0x1245dc];if(_[_0x1061('0x40')](_0x56dbbf['sugarcrmAccounts'][_0x6629b['id']])){_0x56dbbf['sugarcrmAccounts'][_0x6629b['id']]=new SugarcrmAccount(_0x6629b);}else{_0x56dbbf[_0x1061('0x3f')](_0x56dbbf[_0x1061('0x1c')][_0x6629b['id']],_0x6629b);}}}return _0x56dbbf[_0x1061('0x1c')];};};Realtime[_0x1061('0x3e')][_0x1061('0x4e')]=function(){var _0x2fe0d3=this;return function(_0x136117){if(_0x136117){freeIsNotKey(_0x136117,_0x2fe0d3['vtigerAccounts'],'id');for(var _0x37a834=0x0,_0x4158be={},_0x2be2a2={};_0x37a834<_0x136117['length'];_0x37a834+=0x1){_0x4158be=_0x136117[_0x37a834];if(_[_0x1061('0x40')](_0x2fe0d3[_0x1061('0x1f')][_0x4158be['id']])){_0x2fe0d3[_0x1061('0x1f')][_0x4158be['id']]=new VtigerAccount(_0x4158be);}else{_0x2fe0d3[_0x1061('0x3f')](_0x2fe0d3['vtigerAccounts'][_0x4158be['id']],_0x4158be);}}}return _0x2fe0d3[_0x1061('0x1f')];};};Realtime[_0x1061('0x3e')][_0x1061('0x4f')]=function(){var _0x5d892a=this;return function(_0x3d59d5){if(_0x3d59d5){freeIsNotKey(_0x3d59d5,_0x5d892a['servicenowAccounts'],'id');for(var _0x35632b=0x0,_0x2f0c6c={},_0x1cf934={};_0x35632b<_0x3d59d5[_0x1061('0x43')];_0x35632b+=0x1){_0x2f0c6c=_0x3d59d5[_0x35632b];if(_[_0x1061('0x40')](_0x5d892a['servicenowAccounts'][_0x2f0c6c['id']])){_0x5d892a[_0x1061('0x20')][_0x2f0c6c['id']]=new ServicenowAccount(_0x2f0c6c);}else{_0x5d892a['mergeFromDatabase'](_0x5d892a[_0x1061('0x20')][_0x2f0c6c['id']],_0x2f0c6c);}}}return _0x5d892a[_0x1061('0x20')];};};Realtime['prototype']['initDynamics365Accounts']=function(){var _0x5cccd4=this;return function(_0x1fe0f5){if(_0x1fe0f5){freeIsNotKey(_0x1fe0f5,_0x5cccd4[_0x1061('0x50')],'id');for(var _0xb2f3fd=0x0,_0x2e13a5={},_0x8d8fa8={};_0xb2f3fd<_0x1fe0f5[_0x1061('0x43')];_0xb2f3fd+=0x1){_0x2e13a5=_0x1fe0f5[_0xb2f3fd];if(_[_0x1061('0x40')](_0x5cccd4[_0x1061('0x50')][_0x2e13a5['id']])){_0x5cccd4[_0x1061('0x50')][_0x2e13a5['id']]=new Dynamics365Account(_0x2e13a5);}else{_0x5cccd4[_0x1061('0x3f')](_0x5cccd4[_0x1061('0x50')][_0x2e13a5['id']],_0x2e13a5);}}}return _0x5cccd4[_0x1061('0x50')];};};Realtime[_0x1061('0x3e')][_0x1061('0x51')]=function(){var _0x3d4f8d=this;return function(_0x53ae51){if(_0x53ae51){freeIsNotKey(_0x53ae51,_0x3d4f8d[_0x1061('0x21')],'id');for(var _0x41eac8=0x0,_0x125677={},_0xdf3db3={};_0x41eac8<_0x53ae51[_0x1061('0x43')];_0x41eac8+=0x1){_0x125677=_0x53ae51[_0x41eac8];if(_[_0x1061('0x40')](_0x3d4f8d[_0x1061('0x21')][_0x125677['id']])){_0x3d4f8d[_0x1061('0x21')][_0x125677['id']]=new FreshsalesAccount(_0x125677);}else{_0x3d4f8d['mergeFromDatabase'](_0x3d4f8d[_0x1061('0x21')][_0x125677['id']],_0x125677);}}}return _0x3d4f8d[_0x1061('0x21')];};};Realtime[_0x1061('0x3e')][_0x1061('0x52')]=function(){var _0x34cfdb=this;return function(_0x36e80f){for(var _0x154e5a=0x0;_0x154e5a<_0x36e80f[_0x1061('0x43')];_0x154e5a+=0x1){_[_0x1061('0x53')](_0x34cfdb[_0x1061('0x11')][_0x36e80f[_0x154e5a][_0x1061('0x28')]],_0x36e80f[_0x154e5a]);}return _0x34cfdb[_0x1061('0x11')];};};Realtime['prototype']['initVoiceQueueReports']=function(){var _0xbec01b=this;return function(_0x4a5b0f){clearVoiceQueues(_0xbec01b['voiceQueues']);if(_0x4a5b0f){_0x4a5b0f=_[_0x1061('0x54')](_0x4a5b0f,_0x1061('0x55'));for(var _0x266691 in _0x4a5b0f){if(_0x4a5b0f[_0x1061('0x24')](_0x266691)){var _0x16707e={};for(var _0x1f0c7a=0x0;_0x1f0c7a<_0x4a5b0f[_0x266691]['length'];_0x1f0c7a+=0x1){var _0x273644=_0x4a5b0f[_0x266691][_0x1f0c7a]['queue'];if(_0xbec01b['voiceQueues'][_0x273644]){if(_0x4a5b0f[_0x266691][_0x1f0c7a]['queuecallerexit']){_0xbec01b[_0x1061('0x11')][_0x273644][_0x1061('0x30')]+=0x1;}if(_0x4a5b0f[_0x266691][_0x1f0c7a][_0x1061('0x56')]){_0xbec01b[_0x1061('0x11')][_0x273644]['abandoned']+=0x1;}_0xbec01b['voiceQueues'][_0x273644][_0x1061('0x31')]+=moment(_0x4a5b0f[_0x266691][_0x1f0c7a]['queuecallerleaveAt'])['diff'](moment(_0x4a5b0f[_0x266691][_0x1f0c7a]['queuecallerjoinAt']),_0x1061('0x57'))||0x0;if(_0x1f0c7a===_0x4a5b0f[_0x266691]['length']-0x1){_0xbec01b['voiceQueues'][_0x273644][_0x1061('0x2c')]+=moment(_0x4a5b0f[_0x266691][_0x1f0c7a][_0x1061('0x58')]||_0x4a5b0f[_0x266691][_0x1f0c7a][_0x1061('0x59')]||_0x4a5b0f[_0x266691][_0x1f0c7a]['queuecallerexitAt'])[_0x1061('0x5a')](moment(_0x4a5b0f[_0x266691][_0x1f0c7a]['queuecallerjoinAt']),_0x1061('0x57'))||0x0;_0xbec01b[_0x1061('0x11')][_0x273644]['total']+=0x1;if(_0x4a5b0f[_0x266691][_0x1f0c7a]['queuecallercomplete']){_0xbec01b[_0x1061('0x11')][_0x273644][_0x1061('0x2b')]+=0x1;_0xbec01b[_0x1061('0x11')][_0x273644][_0x1061('0x5b')]+=moment(_0x4a5b0f[_0x266691][_0x1f0c7a][_0x1061('0x58')])[_0x1061('0x5a')](moment(_0x4a5b0f[_0x266691][_0x1f0c7a][_0x1061('0x5c')]),_0x1061('0x57'))||0x0;}}else{_0xbec01b[_0x1061('0x11')][_0x273644]['sumDuration']+=_0xbec01b['voiceQueues'][_0x273644][_0x1061('0x31')]||0x0;}}}}}}return _0xbec01b[_0x1061('0x11')];};};Realtime[_0x1061('0x3e')][_0x1061('0x5d')]=function(){var _0x4c10b0=this;return function(_0x341f75){clearVoiceCallReports(_0x4c10b0[_0x1061('0x15')]);if(_0x341f75){for(var _0x247812=0x0;_0x247812<_0x341f75[_0x1061('0x43')];_0x247812+=0x1){_0x4c10b0[_0x1061('0x15')][_0x1061('0x2a')]+=0x1;_0x4c10b0[_0x1061('0x15')][_0x1061('0x2c')]+=_0x341f75[_0x247812][_0x1061('0x5e')];if(_0x341f75[_0x247812][_0x1061('0x5f')]===_0x1061('0x60')){_0x4c10b0[_0x1061('0x15')]['answered']+=0x1;_0x4c10b0['outbound'][_0x1061('0x31')]+=_0x341f75[_0x247812][_0x1061('0x5e')]-_0x341f75[_0x247812][_0x1061('0x61')]||0x0;_0x4c10b0[_0x1061('0x15')][_0x1061('0x5b')]+=_0x341f75[_0x247812][_0x1061('0x61')];}}}return _0x4c10b0[_0x1061('0x15')];};};Realtime[_0x1061('0x3e')]['initCampaigns']=function(){var _0x15ccb8=this;return function(_0x4dcbe8){if(_0x4dcbe8){freeIsNotKey(_0x4dcbe8,_0x15ccb8[_0x1061('0x13')],_0x1061('0x28'));for(var _0x34c4c2=0x0,_0x42d4ad={};_0x34c4c2<_0x4dcbe8[_0x1061('0x43')];_0x34c4c2+=0x1){_0x42d4ad=_0x4dcbe8[_0x34c4c2];if(_[_0x1061('0x40')](_0x15ccb8[_0x1061('0x13')][_0x42d4ad[_0x1061('0x28')]])){_0x15ccb8[_0x1061('0x13')][_0x42d4ad[_0x1061('0x28')]]=new Campaign(_0x42d4ad);}else{_0x15ccb8[_0x1061('0x3f')](_0x15ccb8['campaigns'][_0x42d4ad[_0x1061('0x28')]],_0x42d4ad);_0x15ccb8[_0x1061('0x13')][_0x42d4ad[_0x1061('0x28')]][_0x1061('0x62')]=_0x42d4ad[_0x1061('0x63')]?_0x42d4ad['SquareProject']['name']:undefined;}}}return _0x15ccb8['campaigns'];};};Realtime[_0x1061('0x3e')][_0x1061('0x64')]=function(){var _0x357abe=this;return function(_0x1988da){if(_0x1988da){freeIsNotKey(_0x1988da,_0x357abe['voiceExtensions'],'id');for(var _0x16d7c8=0x0,_0x30e62b={};_0x16d7c8<_0x1988da['length'];_0x16d7c8+=0x1){_0x30e62b=_0x1988da[_0x16d7c8];if(_[_0x1061('0x40')](_0x357abe[_0x1061('0x16')][_0x30e62b['id']])){_0x357abe[_0x1061('0x16')][_0x30e62b['id']]=new VoiceExtension(_0x30e62b);}else{_0x357abe[_0x1061('0x3f')](_0x357abe['voiceExtensions'][_0x30e62b['id']],_0x30e62b);}}}return _0x357abe['voiceExtensions'];};};Realtime[_0x1061('0x3e')][_0x1061('0x65')]=function(){var _0x3115a8=this;return function(_0x141b77){clearCampaigns(_0x3115a8[_0x1061('0x13')]);for(var _0x5a3ba2=0x0;_0x5a3ba2<_0x141b77[_0x1061('0x43')];_0x5a3ba2+=0x1){_['merge'](_0x3115a8[_0x1061('0x13')][_0x141b77[_0x5a3ba2][_0x1061('0x28')]],_0x141b77[_0x5a3ba2]);}return _0x3115a8['campaigns'];};};Realtime['prototype'][_0x1061('0x66')]=function(){var _0x45a6fe=this;return function(_0x4df6de){if(_0x4df6de){freeIsNotKey(_0x4df6de,_0x45a6fe[_0x1061('0x22')],'id');for(var _0xcb9780=0x0,_0x6fb47a={},_0x201f01={};_0xcb9780<_0x4df6de[_0x1061('0x43')];_0xcb9780+=0x1){_0x6fb47a=_0x4df6de[_0xcb9780];if(_['isUndefined'](_0x45a6fe[_0x1061('0x22')][_0x6fb47a['id']])){_0x45a6fe[_0x1061('0x22')][_0x6fb47a['id']]=new FaxAccount(_0x6fb47a);}else{_0x45a6fe[_0x1061('0x3f')](_0x45a6fe[_0x1061('0x22')][_0x6fb47a['id']],_0x6fb47a);}}}return _0x45a6fe[_0x1061('0x22')];};};module[_0x1061('0x67')]=Realtime; \ No newline at end of file +var _0x6923=['../model/agent','../model/trigger','../model/template','../model/campaign','../model/voiceExtension','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','agents','telephones','trunks','campaigns','outbound','voiceExtensions','channels','queueChannels','outboundChannels','timers','settings','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','mapKeys','hasOwnProperty','format','SIP/%s','name','interface','answered','sumHoldTime','sumDuration','ivrTotalCallsDays','total','unmanaged','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','mergeFromDatabase','initAgents','length','isNil','isUndefined','initTelephones','initTrunks','initVoiceQueues','voiceQueues','triggers','templates','initZendeskAccounts','initSalesforceAccounts','initDeskAccounts','initSugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','freshsalesAccounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','groupBy','uniqueid','queue','queuecallerexit','queuecallerabandon','abandoned','queuecallerleaveAt','diff','queuecallerjoinAt','seconds','queuecallerabandonAt','queuecallerexitAt','queuecallercompleteAt','initVoiceCallReports','ANSWERED','sumBillable','billableseconds','initCampaigns','dialQueueProject','SquareProject','initCampaignHopperHistory','initFaxAccounts','faxAccounts','exports','bluebird','util','lodash','moment'];(function(_0x625a73,_0x50ae08){var _0x3eceb5=function(_0x9e9500){while(--_0x9e9500){_0x625a73['push'](_0x625a73['shift']());}};_0x3eceb5(++_0x50ae08);}(_0x6923,0x1b8));var _0x3692=function(_0x547c51,_0x27ef2d){_0x547c51=_0x547c51-0x0;var _0x555eb7=_0x6923[_0x547c51];return _0x555eb7;};'use strict';var BPromise=require(_0x3692('0x0'));var util=require(_0x3692('0x1'));var _=require(_0x3692('0x2'));var moment=require(_0x3692('0x3'));var Agent=require(_0x3692('0x4'));var Telephone=require('../model/telephone');var Trunk=require('../model/trunk');var VoiceQueue=require('../model/voiceQueue');var Trigger=require(_0x3692('0x5'));var Template=require(_0x3692('0x6'));var Campaign=require(_0x3692('0x7'));var VoiceExtension=require(_0x3692('0x8'));var ZendeskAccount=require('../model/zendeskAccount');var SalesforceAccount=require(_0x3692('0x9'));var FreshdeskAccount=require(_0x3692('0xa'));var SugarcrmAccount=require(_0x3692('0xb'));var ZohoAccount=require(_0x3692('0xc'));var DeskAccount=require(_0x3692('0xd'));var VtigerAccount=require(_0x3692('0xe'));var ServicenowAccount=require(_0x3692('0xf'));var Dynamics365Account=require(_0x3692('0x10'));var FreshsalesAccount=require(_0x3692('0x11'));var FaxAccount=require(_0x3692('0x12'));var Realtime=function(){this[_0x3692('0x13')]={};this[_0x3692('0x14')]={};this[_0x3692('0x15')]={};this['voiceQueues']={};this['triggers']={};this[_0x3692('0x16')]={};this['templates']={};this[_0x3692('0x17')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x3692('0x18')]={};this[_0x3692('0x19')]={};this[_0x3692('0x1a')]={};this[_0x3692('0x1b')]={};this[_0x3692('0x1c')]={};this[_0x3692('0x1d')]={};this[_0x3692('0x1e')]={};this[_0x3692('0x1f')]={};this[_0x3692('0x20')]={};this[_0x3692('0x21')]={};this[_0x3692('0x22')]={};this[_0x3692('0x23')]={};this[_0x3692('0x24')]={};this[_0x3692('0x25')]={};this[_0x3692('0x26')]={};this['freshsalesAccounts']={};this['faxAccounts']={};};function freeIsNotKey(_0x31c722,_0x369df6,_0x93be04){var _0x5890e8=_[_0x3692('0x27')](_0x31c722,function(_0x280ece,_0x45809f){return _0x280ece[_0x93be04];});for(var _0x344f08 in _0x369df6){if(_0x369df6[_0x3692('0x28')](_0x344f08)){if(!_0x5890e8[_0x344f08]){delete _0x369df6[_0x344f08];}}}}function freeIsNotKeySip(_0x11a361,_0x56e550){var _0x102547=_[_0x3692('0x27')](_0x11a361,function(_0x219495,_0x363c56){return util[_0x3692('0x29')](_0x3692('0x2a'),_0x219495[_0x3692('0x2b')]);});for(var _0x9c970b in _0x56e550){if(_0x56e550['hasOwnProperty'](_0x9c970b)){if(!_0x102547[_0x9c970b]){delete _0x56e550[_0x9c970b];}}}}function freeIsNotKeyAgent(_0x28f8eb,_0x214591){var _0x273418=_[_0x3692('0x27')](_0x28f8eb,function(_0x4c3ced,_0x68d4d9){var _0x461329=_['isNil'](_0x4c3ced[_0x3692('0x2c')])?util[_0x3692('0x29')](_0x3692('0x2a'),_0x4c3ced[_0x3692('0x2b')]):_0x4c3ced[_0x3692('0x2c')];return _0x461329;});for(var _0x30c3cc in _0x214591){if(_0x214591[_0x3692('0x28')](_0x30c3cc)){if(!_0x273418[_0x30c3cc]){delete _0x214591[_0x30c3cc];}}}}function clearVoiceCallReports(_0x4d404f){_0x4d404f['total']=0x0;_0x4d404f[_0x3692('0x2d')]=0x0;_0x4d404f[_0x3692('0x2e')]=0x0;_0x4d404f[_0x3692('0x2f')]=0x0;_0x4d404f['sumBillable']=0x0;}function clearCampaigns(_0x22ee34){if(!_['isEmpty'](_0x22ee34)){for(var _0x4b841a in _0x22ee34){if(_0x22ee34['hasOwnProperty'](_0x4b841a)){_0x22ee34[_0x4b841a][_0x3692('0x30')]=0x0;_0x22ee34[_0x4b841a]['ivrAnswerCallsDay']=0x0;}}}}function clearVoiceQueues(_0x268da6){if(!_['isEmpty'](_0x268da6)){for(var _0xe97244 in _0x268da6){if(_0x268da6['hasOwnProperty'](_0xe97244)){_0x268da6[_0xe97244][_0x3692('0x31')]=0x0;_0x268da6[_0xe97244]['answered']=0x0;_0x268da6[_0xe97244][_0x3692('0x32')]=0x0;_0x268da6[_0xe97244]['abandoned']=0x0;_0x268da6[_0xe97244][_0x3692('0x2e')]=0x0;_0x268da6[_0xe97244][_0x3692('0x2f')]=0x0;_0x268da6[_0xe97244]['sumBillable']=0x0;_0x268da6[_0xe97244][_0x3692('0x33')]=0x0;_0x268da6[_0xe97244][_0x3692('0x34')]=0x0;_0x268da6[_0xe97244][_0x3692('0x35')]=0x0;_0x268da6[_0xe97244]['outboundCongestionCallsDay']=0x0;_0x268da6[_0xe97244][_0x3692('0x36')]=0x0;_0x268da6[_0xe97244][_0x3692('0x37')]=0x0;_0x268da6[_0xe97244][_0x3692('0x38')]=0x0;_0x268da6[_0xe97244][_0x3692('0x39')]=0x0;_0x268da6[_0xe97244][_0x3692('0x3a')]=0x0;_0x268da6[_0xe97244][_0x3692('0x3b')]=0x0;_0x268da6[_0xe97244][_0x3692('0x3c')]=0x0;_0x268da6[_0xe97244]['outboundReCallsDay']=0x0;_0x268da6[_0xe97244][_0x3692('0x33')]=0x0;_0x268da6[_0xe97244][_0x3692('0x3d')]=0x0;_0x268da6[_0xe97244][_0x3692('0x3e')]=!![];}}}}Realtime[_0x3692('0x3f')][_0x3692('0x40')]=function(_0x52fe17,_0x31412a){for(var _0x5178e9 in _0x31412a){if(_0x52fe17[_0x3692('0x28')](_0x5178e9)){_0x52fe17[_0x5178e9]=_0x31412a[_0x5178e9];}}};Realtime['prototype'][_0x3692('0x41')]=function(){var _0x11e00f=this;return function(_0x50b0e7){if(_0x50b0e7){freeIsNotKeyAgent(_0x50b0e7,_0x11e00f['agents']);for(var _0x339cdf=0x0,_0x6cc90={},_0x3cb66a={};_0x339cdf<_0x50b0e7[_0x3692('0x42')];_0x339cdf+=0x1){_0x6cc90=_0x50b0e7[_0x339cdf];var _0x3d02a5=_[_0x3692('0x43')](_0x6cc90['interface'])?util[_0x3692('0x29')](_0x3692('0x2a'),_0x6cc90['name']):_0x6cc90[_0x3692('0x2c')];if(_[_0x3692('0x44')](_0x11e00f[_0x3692('0x13')][_0x3d02a5])){_0x11e00f[_0x3692('0x13')][_0x3d02a5]=new Agent(_0x6cc90);}else{_0x11e00f[_0x3692('0x40')](_0x11e00f[_0x3692('0x13')][_0x3d02a5],_0x6cc90);}}}return _0x11e00f[_0x3692('0x13')];};};Realtime['prototype'][_0x3692('0x45')]=function(){var _0x424101=this;return function(_0x496f1c){if(_0x496f1c){freeIsNotKeySip(_0x496f1c,_0x424101[_0x3692('0x14')]);for(var _0x419f55=0x0,_0x41ca35={},_0x26a37e={};_0x419f55<_0x496f1c[_0x3692('0x42')];_0x419f55+=0x1){_0x41ca35=_0x496f1c[_0x419f55];if(_[_0x3692('0x44')](_0x424101[_0x3692('0x14')][util[_0x3692('0x29')](_0x3692('0x2a'),_0x41ca35['name'])])){_0x424101[_0x3692('0x14')][util[_0x3692('0x29')](_0x3692('0x2a'),_0x41ca35[_0x3692('0x2b')])]=new Telephone(_0x41ca35);}else{_0x424101[_0x3692('0x40')](_0x424101[_0x3692('0x14')][util[_0x3692('0x29')](_0x3692('0x2a'),_0x41ca35[_0x3692('0x2b')])],_0x41ca35);}}}return _0x424101[_0x3692('0x14')];};};Realtime['prototype'][_0x3692('0x46')]=function(){var _0x1fd4d2=this;return function(_0x3d56d9){if(_0x3d56d9){freeIsNotKeySip(_0x3d56d9,_0x1fd4d2['trunks']);for(var _0x7254a5=0x0,_0x4d0d46={},_0x1fc0b7={};_0x7254a5<_0x3d56d9[_0x3692('0x42')];_0x7254a5+=0x1){_0x4d0d46=_0x3d56d9[_0x7254a5];if(_[_0x3692('0x44')](_0x1fd4d2[_0x3692('0x15')][util[_0x3692('0x29')](_0x3692('0x2a'),_0x4d0d46[_0x3692('0x2b')])])){_0x1fd4d2[_0x3692('0x15')][util[_0x3692('0x29')](_0x3692('0x2a'),_0x4d0d46[_0x3692('0x2b')])]=new Trunk(_0x4d0d46);}else{_0x1fd4d2['mergeFromDatabase'](_0x1fd4d2[_0x3692('0x15')][util[_0x3692('0x29')]('SIP/%s',_0x4d0d46[_0x3692('0x2b')])],_0x4d0d46);}}}return _0x1fd4d2[_0x3692('0x15')];};};Realtime[_0x3692('0x3f')][_0x3692('0x47')]=function(){var _0x2132ab=this;return function(_0x4e6185){if(_0x4e6185){freeIsNotKey(_0x4e6185,_0x2132ab[_0x3692('0x48')],_0x3692('0x2b'));for(var _0x47dd46=0x0,_0x442bf1={},_0x446c26={};_0x47dd46<_0x4e6185['length'];_0x47dd46+=0x1){_0x442bf1=_0x4e6185[_0x47dd46];if(_['isUndefined'](_0x2132ab[_0x3692('0x48')][_0x442bf1[_0x3692('0x2b')]])){_0x2132ab[_0x3692('0x48')][_0x442bf1['name']]=new VoiceQueue(_0x442bf1);}else{_0x2132ab[_0x3692('0x40')](_0x2132ab['voiceQueues'][_0x442bf1[_0x3692('0x2b')]],_0x442bf1);}}}return _0x2132ab[_0x3692('0x48')];};};Realtime['prototype']['initTriggers']=function(){var _0x1b303f=this;return function(_0xbdef74){if(_0xbdef74){freeIsNotKey(_0xbdef74,_0x1b303f[_0x3692('0x49')],'id');for(var _0xcf6cf1=0x0,_0x46c44c={},_0x1aa8c1={};_0xcf6cf1<_0xbdef74[_0x3692('0x42')];_0xcf6cf1+=0x1){_0x46c44c=_0xbdef74[_0xcf6cf1];if(_[_0x3692('0x44')](_0x1b303f[_0x3692('0x49')][_0x46c44c['id']])){_0x1b303f[_0x3692('0x49')][_0x46c44c['id']]=new Trigger(_0x46c44c);}else{_0x1b303f[_0x3692('0x40')](_0x1b303f[_0x3692('0x49')][_0x46c44c['id']],_0x46c44c);}}}return _0x1b303f['triggers'];};};Realtime[_0x3692('0x3f')]['initTemplates']=function(){var _0x2c74f8=this;return function(_0x3eb32d){if(_0x3eb32d){freeIsNotKey(_0x3eb32d,_0x2c74f8[_0x3692('0x4a')],'id');for(var _0x5bbfd4=0x0,_0x4965cb={},_0x513432={};_0x5bbfd4<_0x3eb32d[_0x3692('0x42')];_0x5bbfd4+=0x1){_0x4965cb=_0x3eb32d[_0x5bbfd4];if(_[_0x3692('0x44')](_0x2c74f8[_0x3692('0x4a')][_0x4965cb['id']])){_0x2c74f8['templates'][_0x4965cb['id']]=new Template(_0x4965cb);}else{_0x2c74f8['mergeFromDatabase'](_0x2c74f8[_0x3692('0x4a')][_0x4965cb['id']],_0x4965cb);}}}return _0x2c74f8['templates'];};};Realtime['prototype'][_0x3692('0x4b')]=function(){var _0x4289b9=this;return function(_0x543fe1){if(_0x543fe1){freeIsNotKey(_0x543fe1,_0x4289b9[_0x3692('0x1e')],'id');for(var _0x3e9e1a=0x0,_0x102744={},_0x532a77={};_0x3e9e1a<_0x543fe1['length'];_0x3e9e1a+=0x1){_0x102744=_0x543fe1[_0x3e9e1a];if(_['isUndefined'](_0x4289b9['zendeskAccounts'][_0x102744['id']])){_0x4289b9[_0x3692('0x1e')][_0x102744['id']]=new ZendeskAccount(_0x102744);}else{_0x4289b9[_0x3692('0x40')](_0x4289b9[_0x3692('0x1e')][_0x102744['id']],_0x102744);}}}return _0x4289b9[_0x3692('0x1e')];};};Realtime[_0x3692('0x3f')][_0x3692('0x4c')]=function(){var _0x572dda=this;return function(_0x1f9b97){if(_0x1f9b97){freeIsNotKey(_0x1f9b97,_0x572dda['salesforceAccounts'],'id');for(var _0xa9d888=0x0,_0x420447={},_0x5d9a55={};_0xa9d888<_0x1f9b97[_0x3692('0x42')];_0xa9d888+=0x1){_0x420447=_0x1f9b97[_0xa9d888];if(_[_0x3692('0x44')](_0x572dda[_0x3692('0x1f')][_0x420447['id']])){_0x572dda[_0x3692('0x1f')][_0x420447['id']]=new SalesforceAccount(_0x420447);}else{_0x572dda['mergeFromDatabase'](_0x572dda[_0x3692('0x1f')][_0x420447['id']],_0x420447);}}}return _0x572dda['salesforceAccounts'];};};Realtime[_0x3692('0x3f')]['initFreshdeskAccounts']=function(){var _0xc52cdc=this;return function(_0x248ae6){if(_0x248ae6){freeIsNotKey(_0x248ae6,_0xc52cdc[_0x3692('0x21')],'id');for(var _0x597b9d=0x0,_0x36f764={},_0x441fe0={};_0x597b9d<_0x248ae6['length'];_0x597b9d+=0x1){_0x36f764=_0x248ae6[_0x597b9d];if(_[_0x3692('0x44')](_0xc52cdc[_0x3692('0x21')][_0x36f764['id']])){_0xc52cdc[_0x3692('0x21')][_0x36f764['id']]=new FreshdeskAccount(_0x36f764);}else{_0xc52cdc['mergeFromDatabase'](_0xc52cdc[_0x3692('0x21')][_0x36f764['id']],_0x36f764);}}}return _0xc52cdc[_0x3692('0x21')];};};Realtime[_0x3692('0x3f')]['initZohoAccounts']=function(){var _0xe09a4d=this;return function(_0x489342){if(_0x489342){freeIsNotKey(_0x489342,_0xe09a4d[_0x3692('0x22')],'id');for(var _0x3b2a3b=0x0,_0x4f888d={},_0x33cae4={};_0x3b2a3b<_0x489342[_0x3692('0x42')];_0x3b2a3b+=0x1){_0x4f888d=_0x489342[_0x3b2a3b];if(_[_0x3692('0x44')](_0xe09a4d[_0x3692('0x22')][_0x4f888d['id']])){_0xe09a4d['zohoAccounts'][_0x4f888d['id']]=new ZohoAccount(_0x4f888d);}else{_0xe09a4d[_0x3692('0x40')](_0xe09a4d['zohoAccounts'][_0x4f888d['id']],_0x4f888d);}}}return _0xe09a4d[_0x3692('0x22')];};};Realtime['prototype'][_0x3692('0x4d')]=function(){var _0x31a619=this;return function(_0x4b5007){if(_0x4b5007){freeIsNotKey(_0x4b5007,_0x31a619[_0x3692('0x23')],'id');for(var _0x9589cc=0x0,_0x41eca1={},_0x371b8a={};_0x9589cc<_0x4b5007[_0x3692('0x42')];_0x9589cc+=0x1){_0x41eca1=_0x4b5007[_0x9589cc];if(_[_0x3692('0x44')](_0x31a619[_0x3692('0x23')][_0x41eca1['id']])){_0x31a619['deskAccounts'][_0x41eca1['id']]=new DeskAccount(_0x41eca1);}else{_0x31a619[_0x3692('0x40')](_0x31a619[_0x3692('0x23')][_0x41eca1['id']],_0x41eca1);}}}return _0x31a619[_0x3692('0x23')];};};Realtime[_0x3692('0x3f')][_0x3692('0x4e')]=function(){var _0x583986=this;return function(_0x41b92d){if(_0x41b92d){freeIsNotKey(_0x41b92d,_0x583986[_0x3692('0x20')],'id');for(var _0x51447c=0x0,_0x51171a={},_0x389960={};_0x51447c<_0x41b92d[_0x3692('0x42')];_0x51447c+=0x1){_0x51171a=_0x41b92d[_0x51447c];if(_[_0x3692('0x44')](_0x583986[_0x3692('0x20')][_0x51171a['id']])){_0x583986[_0x3692('0x20')][_0x51171a['id']]=new SugarcrmAccount(_0x51171a);}else{_0x583986[_0x3692('0x40')](_0x583986['sugarcrmAccounts'][_0x51171a['id']],_0x51171a);}}}return _0x583986[_0x3692('0x20')];};};Realtime[_0x3692('0x3f')][_0x3692('0x4f')]=function(){var _0x488b1a=this;return function(_0x5bfb3f){if(_0x5bfb3f){freeIsNotKey(_0x5bfb3f,_0x488b1a['vtigerAccounts'],'id');for(var _0x3845c6=0x0,_0x510fdd={},_0xe17188={};_0x3845c6<_0x5bfb3f['length'];_0x3845c6+=0x1){_0x510fdd=_0x5bfb3f[_0x3845c6];if(_[_0x3692('0x44')](_0x488b1a[_0x3692('0x24')][_0x510fdd['id']])){_0x488b1a[_0x3692('0x24')][_0x510fdd['id']]=new VtigerAccount(_0x510fdd);}else{_0x488b1a['mergeFromDatabase'](_0x488b1a[_0x3692('0x24')][_0x510fdd['id']],_0x510fdd);}}}return _0x488b1a[_0x3692('0x24')];};};Realtime[_0x3692('0x3f')][_0x3692('0x50')]=function(){var _0x4fe967=this;return function(_0x1b702b){if(_0x1b702b){freeIsNotKey(_0x1b702b,_0x4fe967[_0x3692('0x25')],'id');for(var _0xf48030=0x0,_0x5577cd={},_0x3a91be={};_0xf48030<_0x1b702b[_0x3692('0x42')];_0xf48030+=0x1){_0x5577cd=_0x1b702b[_0xf48030];if(_['isUndefined'](_0x4fe967[_0x3692('0x25')][_0x5577cd['id']])){_0x4fe967['servicenowAccounts'][_0x5577cd['id']]=new ServicenowAccount(_0x5577cd);}else{_0x4fe967[_0x3692('0x40')](_0x4fe967[_0x3692('0x25')][_0x5577cd['id']],_0x5577cd);}}}return _0x4fe967[_0x3692('0x25')];};};Realtime[_0x3692('0x3f')][_0x3692('0x51')]=function(){var _0x27637e=this;return function(_0x56b499){if(_0x56b499){freeIsNotKey(_0x56b499,_0x27637e[_0x3692('0x26')],'id');for(var _0x58f4a1=0x0,_0x54652f={},_0x289005={};_0x58f4a1<_0x56b499[_0x3692('0x42')];_0x58f4a1+=0x1){_0x54652f=_0x56b499[_0x58f4a1];if(_[_0x3692('0x44')](_0x27637e[_0x3692('0x26')][_0x54652f['id']])){_0x27637e[_0x3692('0x26')][_0x54652f['id']]=new Dynamics365Account(_0x54652f);}else{_0x27637e[_0x3692('0x40')](_0x27637e['dynamics365Accounts'][_0x54652f['id']],_0x54652f);}}}return _0x27637e['dynamics365Accounts'];};};Realtime[_0x3692('0x3f')][_0x3692('0x52')]=function(){var _0x9265f=this;return function(_0x13fb2d){if(_0x13fb2d){freeIsNotKey(_0x13fb2d,_0x9265f[_0x3692('0x53')],'id');for(var _0x1c8d92=0x0,_0x58e9f5={},_0x1bacd4={};_0x1c8d92<_0x13fb2d[_0x3692('0x42')];_0x1c8d92+=0x1){_0x58e9f5=_0x13fb2d[_0x1c8d92];if(_[_0x3692('0x44')](_0x9265f['freshsalesAccounts'][_0x58e9f5['id']])){_0x9265f[_0x3692('0x53')][_0x58e9f5['id']]=new FreshsalesAccount(_0x58e9f5);}else{_0x9265f[_0x3692('0x40')](_0x9265f[_0x3692('0x53')][_0x58e9f5['id']],_0x58e9f5);}}}return _0x9265f[_0x3692('0x53')];};};Realtime[_0x3692('0x3f')][_0x3692('0x54')]=function(){var _0xadc921=this;return function(_0x3fd2eb){for(var _0xaf30e9=0x0;_0xaf30e9<_0x3fd2eb[_0x3692('0x42')];_0xaf30e9+=0x1){_[_0x3692('0x55')](_0xadc921[_0x3692('0x48')][_0x3fd2eb[_0xaf30e9][_0x3692('0x2b')]],_0x3fd2eb[_0xaf30e9]);}return _0xadc921['voiceQueues'];};};Realtime[_0x3692('0x3f')][_0x3692('0x56')]=function(){var _0x12808d=this;return function(_0x242932){clearVoiceQueues(_0x12808d[_0x3692('0x48')]);if(_0x242932){_0x242932=_[_0x3692('0x57')](_0x242932,_0x3692('0x58'));for(var _0x4cafa0 in _0x242932){if(_0x242932[_0x3692('0x28')](_0x4cafa0)){var _0x1f23ec={};for(var _0x2932ed=0x0;_0x2932ed<_0x242932[_0x4cafa0][_0x3692('0x42')];_0x2932ed+=0x1){var _0xb56e96=_0x242932[_0x4cafa0][_0x2932ed][_0x3692('0x59')];if(_0x12808d['voiceQueues'][_0xb56e96]){if(_0x242932[_0x4cafa0][_0x2932ed][_0x3692('0x5a')]){_0x12808d[_0x3692('0x48')][_0xb56e96][_0x3692('0x32')]+=0x1;}if(_0x242932[_0x4cafa0][_0x2932ed][_0x3692('0x5b')]){_0x12808d[_0x3692('0x48')][_0xb56e96][_0x3692('0x5c')]+=0x1;}_0x12808d[_0x3692('0x48')][_0xb56e96][_0x3692('0x2e')]+=moment(_0x242932[_0x4cafa0][_0x2932ed][_0x3692('0x5d')])[_0x3692('0x5e')](moment(_0x242932[_0x4cafa0][_0x2932ed][_0x3692('0x5f')]),_0x3692('0x60'))||0x0;if(_0x2932ed===_0x242932[_0x4cafa0]['length']-0x1){_0x12808d[_0x3692('0x48')][_0xb56e96][_0x3692('0x2f')]+=moment(_0x242932[_0x4cafa0][_0x2932ed]['queuecallercompleteAt']||_0x242932[_0x4cafa0][_0x2932ed][_0x3692('0x61')]||_0x242932[_0x4cafa0][_0x2932ed][_0x3692('0x62')])[_0x3692('0x5e')](moment(_0x242932[_0x4cafa0][_0x2932ed][_0x3692('0x5f')]),'seconds')||0x0;_0x12808d[_0x3692('0x48')][_0xb56e96]['total']+=0x1;if(_0x242932[_0x4cafa0][_0x2932ed]['queuecallercomplete']){_0x12808d['voiceQueues'][_0xb56e96][_0x3692('0x2d')]+=0x1;_0x12808d[_0x3692('0x48')][_0xb56e96]['sumBillable']+=moment(_0x242932[_0x4cafa0][_0x2932ed][_0x3692('0x63')])[_0x3692('0x5e')](moment(_0x242932[_0x4cafa0][_0x2932ed]['queuecallerleaveAt']),_0x3692('0x60'))||0x0;}}else{_0x12808d['voiceQueues'][_0xb56e96][_0x3692('0x2f')]+=_0x12808d[_0x3692('0x48')][_0xb56e96]['sumHoldTime']||0x0;}}}}}}return _0x12808d[_0x3692('0x48')];};};Realtime[_0x3692('0x3f')][_0x3692('0x64')]=function(){var _0x4e542e=this;return function(_0x29d983){clearVoiceCallReports(_0x4e542e[_0x3692('0x17')]);if(_0x29d983){for(var _0x377f78=0x0;_0x377f78<_0x29d983['length'];_0x377f78+=0x1){_0x4e542e[_0x3692('0x17')][_0x3692('0x31')]+=0x1;_0x4e542e['outbound']['sumDuration']+=_0x29d983[_0x377f78]['duration'];if(_0x29d983[_0x377f78]['disposition']===_0x3692('0x65')){_0x4e542e['outbound'][_0x3692('0x2d')]+=0x1;_0x4e542e[_0x3692('0x17')]['sumHoldTime']+=_0x29d983[_0x377f78]['duration']-_0x29d983[_0x377f78]['billableseconds']||0x0;_0x4e542e['outbound'][_0x3692('0x66')]+=_0x29d983[_0x377f78][_0x3692('0x67')];}}}return _0x4e542e[_0x3692('0x17')];};};Realtime[_0x3692('0x3f')][_0x3692('0x68')]=function(){var _0x3c7555=this;return function(_0x485c2d){if(_0x485c2d){freeIsNotKey(_0x485c2d,_0x3c7555[_0x3692('0x16')],'name');for(var _0x3b8048=0x0,_0x21d7b4={};_0x3b8048<_0x485c2d['length'];_0x3b8048+=0x1){_0x21d7b4=_0x485c2d[_0x3b8048];if(_['isUndefined'](_0x3c7555[_0x3692('0x16')][_0x21d7b4['name']])){_0x3c7555[_0x3692('0x16')][_0x21d7b4[_0x3692('0x2b')]]=new Campaign(_0x21d7b4);}else{_0x3c7555[_0x3692('0x40')](_0x3c7555[_0x3692('0x16')][_0x21d7b4[_0x3692('0x2b')]],_0x21d7b4);_0x3c7555[_0x3692('0x16')][_0x21d7b4[_0x3692('0x2b')]][_0x3692('0x69')]=_0x21d7b4[_0x3692('0x6a')]?_0x21d7b4['SquareProject'][_0x3692('0x2b')]:undefined;}}}return _0x3c7555[_0x3692('0x16')];};};Realtime[_0x3692('0x3f')]['initVoiceExtensions']=function(){var _0x1c8879=this;return function(_0x246382){if(_0x246382){freeIsNotKey(_0x246382,_0x1c8879['voiceExtensions'],'id');for(var _0x12c4ff=0x0,_0x48549c={};_0x12c4ff<_0x246382[_0x3692('0x42')];_0x12c4ff+=0x1){_0x48549c=_0x246382[_0x12c4ff];if(_[_0x3692('0x44')](_0x1c8879[_0x3692('0x18')][_0x48549c['id']])){_0x1c8879[_0x3692('0x18')][_0x48549c['id']]=new VoiceExtension(_0x48549c);}else{_0x1c8879[_0x3692('0x40')](_0x1c8879['voiceExtensions'][_0x48549c['id']],_0x48549c);}}}return _0x1c8879['voiceExtensions'];};};Realtime[_0x3692('0x3f')][_0x3692('0x6b')]=function(){var _0x3d5908=this;return function(_0x185d9f){clearCampaigns(_0x3d5908['campaigns']);for(var _0x118460=0x0;_0x118460<_0x185d9f['length'];_0x118460+=0x1){_[_0x3692('0x55')](_0x3d5908[_0x3692('0x16')][_0x185d9f[_0x118460][_0x3692('0x2b')]],_0x185d9f[_0x118460]);}return _0x3d5908[_0x3692('0x16')];};};Realtime[_0x3692('0x3f')][_0x3692('0x6c')]=function(){var _0x51c5a5=this;return function(_0xb8de7f){if(_0xb8de7f){freeIsNotKey(_0xb8de7f,_0x51c5a5[_0x3692('0x6d')],'id');for(var _0x270999=0x0,_0x16a64f={},_0x357775={};_0x270999<_0xb8de7f['length'];_0x270999+=0x1){_0x16a64f=_0xb8de7f[_0x270999];if(_[_0x3692('0x44')](_0x51c5a5[_0x3692('0x6d')][_0x16a64f['id']])){_0x51c5a5[_0x3692('0x6d')][_0x16a64f['id']]=new FaxAccount(_0x16a64f);}else{_0x51c5a5[_0x3692('0x40')](_0x51c5a5[_0x3692('0x6d')][_0x16a64f['id']],_0x16a64f);}}}return _0x51c5a5[_0x3692('0x6d')];};};module[_0x3692('0x6e')]=Realtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index 8718930..591a102 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 _0x2e41=['lastapplication','queue','lastdata','context','callerid','from-sip','xcally-motion-preview','calleridpreview','calleridnum','originatecalleridnum','destinationchannel','channel','disposition','ANSWERED','\x22%s\x22\x20<%s>','calleridname','transfers','linkedid','transfereelinkedid','uniqueid','blindTransfer','monitors','length','monitorFilename','filename','createdAt','exten','connectedlinename','xcally-motion-dialer','voiceAgentReport','isArray','forEach','startsWith','Local','indexOf','mobile','phone','substring','lastIndexOf','membername','transfererlinkedid','exports','lodash','../../../config/environment','../ami','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceTransferReport','./voiceQueueReport','./voiceAgentReport','./userReport','agents','telephones','prototype','sync','realtime','xdr','disabled','custom:voiceQueueReport','voiceQueueReport','bind','custom:voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','attendedtransfer','attendedTransfer','findAgent','find','accountcode','isNil','interface','format','SIP/%s','name','connectedlinenum','assigned','lastAssignedTo','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','create','match','voiceCallReport','destination','dialer'];(function(_0x507403,_0x3f954d){var _0x1327c=function(_0x2aea1b){while(--_0x2aea1b){_0x507403['push'](_0x507403['shift']());}};_0x1327c(++_0x3f954d);}(_0x2e41,0xd8));var _0x12e4=function(_0x4741e4,_0x457e2e){_0x4741e4=_0x4741e4-0x0;var _0x459f97=_0x2e41[_0x4741e4];return _0x459f97;};'use strict';var _=require(_0x12e4('0x0'));var moment=require('moment');var util=require('util');var config=require(_0x12e4('0x1'));var ami=require(_0x12e4('0x2'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');var RpcVoiceCallReport=require('../rpc/voiceCallReport');var RpcVoiceDialReport=require(_0x12e4('0x3'));var RpcMemberReport=require(_0x12e4('0x4'));var RpcVoiceQueueReport=require(_0x12e4('0x5'));var RpcVoiceRecording=require('../rpc/voiceRecording');var RpcVoiceTransferReport=require(_0x12e4('0x6'));var VoiceQueueReport=require(_0x12e4('0x7'));var VoiceCallReport=require('./voiceCallReport');var VoiceAgentReport=require(_0x12e4('0x8'));var VoiceDialReport=require('./voiceDialReport');var UserReport=require(_0x12e4('0x9'));function Report(_0x83eaf5){this['realtime']=_0x83eaf5;this['agents']=_0x83eaf5[_0x12e4('0xa')];this[_0x12e4('0xb')]=_0x83eaf5['telephones'];}Report[_0x12e4('0xc')][_0x12e4('0xd')]=function(_0x4fc108){var _0x14458b=new VoiceQueueReport(this['realtime']);var _0x34d032=new VoiceAgentReport(this[_0x12e4('0xe')]);var _0x585972=new VoiceDialReport(this[_0x12e4('0xe')]);var _0x2b1a5a=new VoiceCallReport(this[_0x12e4('0xe')]);var _0xb04846=new UserReport(this[_0x12e4('0xe')]);if(config[_0x12e4('0xf')]&&config[_0x12e4('0xf')][_0x12e4('0x10')]){ami['on'](_0x12e4('0x11'),this[_0x12e4('0x12')][_0x12e4('0x13')](this));ami['on']('custom:voiceCallReport',this['voiceCallReport'][_0x12e4('0x13')](this));ami['on'](_0x12e4('0x14'),this['voiceAgentReport'][_0x12e4('0x13')](this));ami['on'](_0x12e4('0x15'),this[_0x12e4('0x16')]['bind'](this));ami['on'](_0x12e4('0x17'),this['blindTransfer']['bind'](this));ami['on'](_0x12e4('0x18'),this[_0x12e4('0x19')][_0x12e4('0x13')](this));}};Report[_0x12e4('0xc')][_0x12e4('0x1a')]=function(_0x22543c){var _0x43df93;_0x43df93=_[_0x12e4('0x1b')](this[_0x12e4('0xa')],function(_0x383506){return _0x383506[_0x12e4('0x1c')]==_0x22543c||_0x383506['name']==_0x22543c;});if(_[_0x12e4('0x1d')](_0x43df93)){var _0x451df2=_['find'](this[_0x12e4('0xb')],function(_0x5d8f33){return _0x5d8f33[_0x12e4('0x1c')]==_0x22543c||_0x5d8f33['name']==_0x22543c;});if(_0x451df2){_0x43df93=_[_0x12e4('0x1b')](this[_0x12e4('0xa')],function(_0x397b6f){return _0x397b6f[_0x12e4('0x1e')]==util[_0x12e4('0x1f')](_0x12e4('0x20'),_0x451df2[_0x12e4('0x21')]);});}}return _0x43df93;};Report['prototype'][_0x12e4('0x12')]=function(_0x15425f){for(var _0x3801d3=0x0;_0x3801d3<_0x15425f['length'];_0x3801d3+=0x1){var _0xa7c5=this[_0x12e4('0x1a')](_0x15425f[_0x3801d3][_0x12e4('0x22')]);if(_0xa7c5){_0x15425f[_0x3801d3][_0x12e4('0x1c')]=_0xa7c5['accountcode'];_0x15425f[_0x3801d3][_0x12e4('0x23')]=!![];_0x15425f[_0x3801d3][_0x12e4('0x24')]=_0xa7c5[_0x12e4('0x21')];_0x15425f[_0x3801d3]['interface']=_[_0x12e4('0x1d')](_0xa7c5[_0x12e4('0x1e')])?util[_0x12e4('0x1f')]('SIP/%s',_0xa7c5[_0x12e4('0x21')]):_0xa7c5[_0x12e4('0x1e')];if(_0x15425f[_0x3801d3]['queuecallercomplete']){_0x15425f[_0x3801d3]['queuecallercompleteAt']=moment()[_0x12e4('0x1f')](_0x12e4('0x25'));}if(_0x15425f[_0x3801d3][_0x12e4('0x26')]){_0x15425f[_0x3801d3][_0x12e4('0x27')]=moment()[_0x12e4('0x1f')]('YYYY-MM-DD\x20HH:mm:ss');}RpcMemberReport[_0x12e4('0x12')](_0x15425f[_0x3801d3]);}RpcVoiceQueueReport[_0x12e4('0x28')](_0x15425f[_0x3801d3]);}};function extractCalleridNumber(_0x399ebc){var _0x1b84ee=_0x399ebc[_0x12e4('0x29')](/<(.*?)>/);return _0x1b84ee?_0x1b84ee[0x1]:_0x399ebc;}Report[_0x12e4('0xc')][_0x12e4('0x2a')]=function(_0x25e70f){_0x25e70f[_0x12e4('0x2b')]=_0x25e70f[_0x12e4('0x2b')]||_0x25e70f['exten'];if(_0x25e70f['type']==_0x12e4('0x2c')){_0x25e70f[_0x12e4('0x2d')]=_0x12e4('0x2e');_0x25e70f[_0x12e4('0x2f')]=_0x25e70f[_0x12e4('0x2e')];if(_0x25e70f[_0x12e4('0x30')]=='from-voip-provider'){_0x25e70f[_0x12e4('0x1c')]='';_0x25e70f[_0x12e4('0x2b')]=extractCalleridNumber(_0x25e70f[_0x12e4('0x31')]);}else if(_0x25e70f[_0x12e4('0x30')]==_0x12e4('0x32')){if(_0x25e70f[_0x12e4('0x2b')]==_0x12e4('0x33')){_0x25e70f[_0x12e4('0x2b')]=extractCalleridNumber(_0x25e70f[_0x12e4('0x34')]);_0x25e70f[_0x12e4('0x35')]=_0x25e70f[_0x12e4('0x36')];_0x25e70f[_0x12e4('0x37')]=[_0x25e70f['channel'],_0x25e70f[_0x12e4('0x38')]=_0x25e70f[_0x12e4('0x37')]][0x0];_0x25e70f[_0x12e4('0x31')]=_0x25e70f[_0x12e4('0x34')];}else{_0x25e70f[_0x12e4('0x2b')]=_0x25e70f[_0x12e4('0x35')];_0x25e70f[_0x12e4('0x35')]=_0x25e70f[_0x12e4('0x36')];if(_0x25e70f[_0x12e4('0x39')]==_0x12e4('0x3a')){_0x25e70f[_0x12e4('0x1c')]=_0x25e70f[_0x12e4('0x22')];}else{_0x25e70f[_0x12e4('0x1c')]='';}}}}else{_0x25e70f[_0x12e4('0x31')]=util['format'](_0x12e4('0x3b'),_0x25e70f[_0x12e4('0x3c')],_0x25e70f[_0x12e4('0x35')]);}if(RpcVoiceTransferReport[_0x12e4('0x3d')][_0x25e70f['linkedid']]){var _0x32333c=RpcVoiceTransferReport[_0x12e4('0x3d')][_0x25e70f[_0x12e4('0x3e')]];_0x32333c[_0x12e4('0x3f')]=_0x25e70f[_0x12e4('0x40')];RpcVoiceTransferReport[_0x12e4('0x41')](_0x32333c);delete RpcVoiceTransferReport['transfers'][_0x25e70f[_0x12e4('0x3e')]];}RpcVoiceCallReport[_0x12e4('0x28')](_0x25e70f);if(_0x25e70f['monitor']){for(var _0x2af22e=0x0;_0x2af22e<_0x25e70f[_0x12e4('0x42')][_0x12e4('0x43')];_0x2af22e+=0x1){_0x25e70f[_0x12e4('0x44')]=_0x25e70f[_0x12e4('0x42')][_0x2af22e][_0x12e4('0x45')];_0x25e70f[_0x12e4('0x46')]=_0x25e70f['monitors'][_0x2af22e][_0x12e4('0x46')];if(_0x25e70f[_0x12e4('0x47')]==_0x12e4('0x33')){_0x25e70f[_0x12e4('0x35')]=_0x25e70f[_0x12e4('0x22')];_0x25e70f[_0x12e4('0x3c')]=_0x25e70f[_0x12e4('0x48')];_0x25e70f[_0x12e4('0x22')]=_0x25e70f[_0x12e4('0x1c')];_0x25e70f[_0x12e4('0x48')]=_0x25e70f['membername'];_0x25e70f['exten']=_0x25e70f[_0x12e4('0x36')];}else if(_0x25e70f[_0x12e4('0x47')]==_0x12e4('0x49')){_0x25e70f['calleridnum']=_0x25e70f[_0x12e4('0x2b')];_0x25e70f[_0x12e4('0x47')]=_0x25e70f['originatecalleridnum'];}RpcVoiceRecording[_0x12e4('0x28')](_0x25e70f);}}};Report['prototype'][_0x12e4('0x4a')]=function(_0x136797){if(_[_0x12e4('0x4b')](_0x136797)){_0x136797[_0x12e4('0x4c')](function(_0x523ec0){RpcVoiceAgentReport[_0x12e4('0x28')](_0x523ec0);});}else{RpcVoiceAgentReport['create'](_0x136797);}};Report[_0x12e4('0xc')][_0x12e4('0x16')]=function(_0x359f14){RpcVoiceDialReport[_0x12e4('0x28')](_0x359f14);var _0x1dd292;var _0x575d72;var _0x5bcab5=_0x359f14[_0x12e4('0x38')];if(_[_0x12e4('0x4d')](_0x5bcab5,_0x12e4('0x4e'))){_0x575d72=_0x5bcab5['substring'](_0x5bcab5['indexOf']('/')+0x1,_0x5bcab5[_0x12e4('0x4f')]('@'));_0x1dd292=_[_0x12e4('0x1b')](this[_0x12e4('0xa')],function(_0x26a808){return _0x26a808[_0x12e4('0x50')]==_0x575d72||_0x26a808[_0x12e4('0x51')]==_0x575d72||_0x26a808[_0x12e4('0x1c')]==_0x575d72;});}else{_0x575d72=_0x5bcab5[_0x12e4('0x52')](_0x5bcab5['indexOf']('/')+0x1,_0x5bcab5[_0x12e4('0x53')]('-'));_0x1dd292=this[_0x12e4('0x1a')](_0x575d72);}if(_0x1dd292){_0x359f14[_0x12e4('0x1e')]=_[_0x12e4('0x1d')](_0x1dd292[_0x12e4('0x1e')])?util['format'](_0x12e4('0x20'),_0x1dd292[_0x12e4('0x21')]):_0x1dd292[_0x12e4('0x1e')];_0x359f14[_0x12e4('0x54')]=_0x1dd292[_0x12e4('0x21')];_0x359f14['accountcode']=_0x1dd292['accountcode'];RpcMemberReport[_0x12e4('0x16')](_0x359f14);}};Report[_0x12e4('0xc')][_0x12e4('0x41')]=function(_0x1d0e84){RpcVoiceTransferReport[_0x12e4('0x3d')][_0x1d0e84[_0x12e4('0x55')]]=_0x1d0e84;};Report[_0x12e4('0xc')][_0x12e4('0x19')]=function(_0x206777){RpcVoiceTransferReport[_0x12e4('0x19')](_0x206777);};module[_0x12e4('0x56')]=Report; \ No newline at end of file +var _0xc0e0=['channel','disposition','callerid','\x22%s\x22\x20<%s>','transfers','linkedid','uniqueid','monitor','monitors','filename','createdAt','calleridname','connectedlinename','connectedlinenum','membername','xcally-motion-dialer','forEach','Local','substring','indexOf','mobile','phone','lastIndexOf','voiceDialReport','transfererlinkedid','exports','util','../../../config/environment','../ami','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','./userReport','agents','telephones','prototype','sync','realtime','xdr','disabled','custom:voiceQueueReport','voiceQueueReport','bind','custom:voiceCallReport','voiceCallReport','voiceAgentReport','custom:voiceDialReport','blindtransfer','blindTransfer','attendedtransfer','findAgent','find','name','accountcode','format','SIP/%s','length','assigned','interface','isNil','queuecallerexit','queuecallerexitAt','create','match','destination','exten','type','dialer','lastapplication','from-voip-provider','context','from-sip','xcally-motion-preview','calleridpreview','calleridnum','originatecalleridnum','destinationchannel'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xc0e0,0x110));var _0x0c0e=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0xc0e0[_0x273c39];return _0x46d6b5;};'use strict';var _=require('lodash');var moment=require('moment');var util=require(_0x0c0e('0x0'));var config=require(_0x0c0e('0x1'));var ami=require(_0x0c0e('0x2'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');var RpcVoiceCallReport=require('../rpc/voiceCallReport');var RpcVoiceDialReport=require(_0x0c0e('0x3'));var RpcMemberReport=require(_0x0c0e('0x4'));var RpcVoiceQueueReport=require(_0x0c0e('0x5'));var RpcVoiceRecording=require(_0x0c0e('0x6'));var RpcVoiceTransferReport=require(_0x0c0e('0x7'));var VoiceQueueReport=require('./voiceQueueReport');var VoiceCallReport=require(_0x0c0e('0x8'));var VoiceAgentReport=require(_0x0c0e('0x9'));var VoiceDialReport=require(_0x0c0e('0xa'));var UserReport=require(_0x0c0e('0xb'));function Report(_0x2ec6db){this['realtime']=_0x2ec6db;this[_0x0c0e('0xc')]=_0x2ec6db['agents'];this[_0x0c0e('0xd')]=_0x2ec6db['telephones'];}Report[_0x0c0e('0xe')][_0x0c0e('0xf')]=function(_0x2ec4e1){var _0x227bca=new VoiceQueueReport(this[_0x0c0e('0x10')]);var _0x59a685=new VoiceAgentReport(this[_0x0c0e('0x10')]);var _0x5c6674=new VoiceDialReport(this[_0x0c0e('0x10')]);var _0x4b2dfd=new VoiceCallReport(this[_0x0c0e('0x10')]);var _0x21f1a5=new UserReport(this[_0x0c0e('0x10')]);if(config[_0x0c0e('0x11')]&&config[_0x0c0e('0x11')][_0x0c0e('0x12')]){ami['on'](_0x0c0e('0x13'),this[_0x0c0e('0x14')][_0x0c0e('0x15')](this));ami['on'](_0x0c0e('0x16'),this[_0x0c0e('0x17')]['bind'](this));ami['on']('custom:voiceAgentReport',this[_0x0c0e('0x18')]['bind'](this));ami['on'](_0x0c0e('0x19'),this['voiceDialReport'][_0x0c0e('0x15')](this));ami['on'](_0x0c0e('0x1a'),this[_0x0c0e('0x1b')][_0x0c0e('0x15')](this));ami['on'](_0x0c0e('0x1c'),this['attendedTransfer'][_0x0c0e('0x15')](this));}};Report['prototype'][_0x0c0e('0x1d')]=function(_0x558905){var _0x594c1a;_0x594c1a=_[_0x0c0e('0x1e')](this[_0x0c0e('0xc')],function(_0x46b686){return _0x46b686['accountcode']==_0x558905||_0x46b686[_0x0c0e('0x1f')]==_0x558905;});if(_['isNil'](_0x594c1a)){var _0x201946=_['find'](this['telephones'],function(_0x1ef639){return _0x1ef639[_0x0c0e('0x20')]==_0x558905||_0x1ef639[_0x0c0e('0x1f')]==_0x558905;});if(_0x201946){_0x594c1a=_[_0x0c0e('0x1e')](this[_0x0c0e('0xc')],function(_0x2c0bb7){return _0x2c0bb7['interface']==util[_0x0c0e('0x21')](_0x0c0e('0x22'),_0x201946['name']);});}}return _0x594c1a;};Report[_0x0c0e('0xe')][_0x0c0e('0x14')]=function(_0x1d7fc3){for(var _0x364115=0x0;_0x364115<_0x1d7fc3[_0x0c0e('0x23')];_0x364115+=0x1){var _0x1a3ba5=this[_0x0c0e('0x1d')](_0x1d7fc3[_0x364115]['connectedlinenum']);if(_0x1a3ba5){_0x1d7fc3[_0x364115][_0x0c0e('0x20')]=_0x1a3ba5[_0x0c0e('0x20')];_0x1d7fc3[_0x364115][_0x0c0e('0x24')]=!![];_0x1d7fc3[_0x364115]['lastAssignedTo']=_0x1a3ba5[_0x0c0e('0x1f')];_0x1d7fc3[_0x364115][_0x0c0e('0x25')]=_[_0x0c0e('0x26')](_0x1a3ba5[_0x0c0e('0x25')])?util[_0x0c0e('0x21')](_0x0c0e('0x22'),_0x1a3ba5['name']):_0x1a3ba5[_0x0c0e('0x25')];if(_0x1d7fc3[_0x364115]['queuecallercomplete']){_0x1d7fc3[_0x364115]['queuecallercompleteAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}if(_0x1d7fc3[_0x364115][_0x0c0e('0x27')]){_0x1d7fc3[_0x364115][_0x0c0e('0x28')]=moment()[_0x0c0e('0x21')]('YYYY-MM-DD\x20HH:mm:ss');}RpcMemberReport[_0x0c0e('0x14')](_0x1d7fc3[_0x364115]);}RpcVoiceQueueReport[_0x0c0e('0x29')](_0x1d7fc3[_0x364115]);}};function extractCalleridNumber(_0x366ce9){var _0x200266=_0x366ce9[_0x0c0e('0x2a')](/<(.*?)>/);return _0x200266?_0x200266[0x1]:_0x366ce9;}Report[_0x0c0e('0xe')][_0x0c0e('0x17')]=function(_0x1e65e3){_0x1e65e3[_0x0c0e('0x2b')]=_0x1e65e3[_0x0c0e('0x2b')]||_0x1e65e3[_0x0c0e('0x2c')];if(_0x1e65e3[_0x0c0e('0x2d')]==_0x0c0e('0x2e')){_0x1e65e3[_0x0c0e('0x2f')]='queue';_0x1e65e3['lastdata']=_0x1e65e3['queue'];if(_0x1e65e3['context']==_0x0c0e('0x30')){_0x1e65e3[_0x0c0e('0x20')]='';_0x1e65e3[_0x0c0e('0x2b')]=extractCalleridNumber(_0x1e65e3['callerid']);}else if(_0x1e65e3[_0x0c0e('0x31')]==_0x0c0e('0x32')){if(_0x1e65e3[_0x0c0e('0x2b')]==_0x0c0e('0x33')){_0x1e65e3['destination']=extractCalleridNumber(_0x1e65e3[_0x0c0e('0x34')]);_0x1e65e3[_0x0c0e('0x35')]=_0x1e65e3[_0x0c0e('0x36')];_0x1e65e3[_0x0c0e('0x37')]=[_0x1e65e3[_0x0c0e('0x38')],_0x1e65e3[_0x0c0e('0x38')]=_0x1e65e3['destinationchannel']][0x0];_0x1e65e3['callerid']=_0x1e65e3[_0x0c0e('0x34')];}else{_0x1e65e3['destination']=_0x1e65e3[_0x0c0e('0x35')];_0x1e65e3[_0x0c0e('0x35')]=_0x1e65e3[_0x0c0e('0x36')];if(_0x1e65e3[_0x0c0e('0x39')]=='ANSWERED'){_0x1e65e3[_0x0c0e('0x20')]=_0x1e65e3['connectedlinenum'];}else{_0x1e65e3[_0x0c0e('0x20')]='';}}}}else{_0x1e65e3[_0x0c0e('0x3a')]=util[_0x0c0e('0x21')](_0x0c0e('0x3b'),_0x1e65e3['calleridname'],_0x1e65e3[_0x0c0e('0x35')]);}if(RpcVoiceTransferReport[_0x0c0e('0x3c')][_0x1e65e3[_0x0c0e('0x3d')]]){var _0x2096f8=RpcVoiceTransferReport[_0x0c0e('0x3c')][_0x1e65e3[_0x0c0e('0x3d')]];_0x2096f8['transfereelinkedid']=_0x1e65e3[_0x0c0e('0x3e')];RpcVoiceTransferReport[_0x0c0e('0x1b')](_0x2096f8);delete RpcVoiceTransferReport[_0x0c0e('0x3c')][_0x1e65e3['linkedid']];}RpcVoiceCallReport['create'](_0x1e65e3);if(_0x1e65e3[_0x0c0e('0x3f')]){for(var _0x69439=0x0;_0x69439<_0x1e65e3[_0x0c0e('0x40')][_0x0c0e('0x23')];_0x69439+=0x1){_0x1e65e3['monitorFilename']=_0x1e65e3[_0x0c0e('0x40')][_0x69439][_0x0c0e('0x41')];_0x1e65e3[_0x0c0e('0x42')]=_0x1e65e3['monitors'][_0x69439][_0x0c0e('0x42')];if(_0x1e65e3[_0x0c0e('0x2c')]=='xcally-motion-preview'){_0x1e65e3[_0x0c0e('0x35')]=_0x1e65e3['connectedlinenum'];_0x1e65e3[_0x0c0e('0x43')]=_0x1e65e3[_0x0c0e('0x44')];_0x1e65e3[_0x0c0e('0x45')]=_0x1e65e3[_0x0c0e('0x20')];_0x1e65e3['connectedlinename']=_0x1e65e3[_0x0c0e('0x46')];_0x1e65e3['exten']=_0x1e65e3['originatecalleridnum'];}else if(_0x1e65e3[_0x0c0e('0x2c')]==_0x0c0e('0x47')){_0x1e65e3[_0x0c0e('0x35')]=_0x1e65e3['destination'];_0x1e65e3[_0x0c0e('0x2c')]=_0x1e65e3[_0x0c0e('0x36')];}RpcVoiceRecording[_0x0c0e('0x29')](_0x1e65e3);}}};Report[_0x0c0e('0xe')][_0x0c0e('0x18')]=function(_0x407adc){if(_['isArray'](_0x407adc)){_0x407adc[_0x0c0e('0x48')](function(_0x10c042){RpcVoiceAgentReport[_0x0c0e('0x29')](_0x10c042);});}else{RpcVoiceAgentReport[_0x0c0e('0x29')](_0x407adc);}};Report[_0x0c0e('0xe')]['voiceDialReport']=function(_0x2cdb8a){RpcVoiceDialReport[_0x0c0e('0x29')](_0x2cdb8a);var _0x3a66dc;var _0x2cce77;var _0x309dcf=_0x2cdb8a[_0x0c0e('0x38')];if(_['startsWith'](_0x309dcf,_0x0c0e('0x49'))){_0x2cce77=_0x309dcf[_0x0c0e('0x4a')](_0x309dcf[_0x0c0e('0x4b')]('/')+0x1,_0x309dcf[_0x0c0e('0x4b')]('@'));_0x3a66dc=_[_0x0c0e('0x1e')](this[_0x0c0e('0xc')],function(_0x15a5d7){return _0x15a5d7[_0x0c0e('0x4c')]==_0x2cce77||_0x15a5d7[_0x0c0e('0x4d')]==_0x2cce77||_0x15a5d7[_0x0c0e('0x20')]==_0x2cce77;});}else{_0x2cce77=_0x309dcf[_0x0c0e('0x4a')](_0x309dcf[_0x0c0e('0x4b')]('/')+0x1,_0x309dcf[_0x0c0e('0x4e')]('-'));_0x3a66dc=this[_0x0c0e('0x1d')](_0x2cce77);}if(_0x3a66dc){_0x2cdb8a[_0x0c0e('0x25')]=_[_0x0c0e('0x26')](_0x3a66dc[_0x0c0e('0x25')])?util[_0x0c0e('0x21')]('SIP/%s',_0x3a66dc[_0x0c0e('0x1f')]):_0x3a66dc[_0x0c0e('0x25')];_0x2cdb8a[_0x0c0e('0x46')]=_0x3a66dc['name'];_0x2cdb8a['accountcode']=_0x3a66dc['accountcode'];RpcMemberReport[_0x0c0e('0x4f')](_0x2cdb8a);}};Report[_0x0c0e('0xe')][_0x0c0e('0x1b')]=function(_0x8d44cb){RpcVoiceTransferReport[_0x0c0e('0x3c')][_0x8d44cb[_0x0c0e('0x50')]]=_0x8d44cb;};Report[_0x0c0e('0xe')]['attendedTransfer']=function(_0x5d0862){RpcVoiceTransferReport['attendedTransfer'](_0x5d0862);};module[_0x0c0e('0x51')]=Report; \ No newline at end of file diff --git a/server/services/ami/report/userReport.js b/server/services/ami/report/userReport.js index 347400f..97d4fa2 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 _0x839d=['agents','telephones','registryentry','syncRegistry','bind','registry','devicestatechange','syncDeviceState','peerstatus','syncPeerStatus','syncRealtimeShow','resolve','actionSipShowRegistry','catch','error','[userReport][sipshowregistry]','inspect','then','actionDeviceStateList','actionSipPeerStatus','[userReport][sippeerstatus]','prototype','isNotNull','[userReport][registry]\x20registry:%s\x20state:%s','username','state','debug','[userReport][registry]','merge','event','[userReport][registry]\x20sending\x20trunk:save\x20event:','emit','trunk:%s','name','trunk:save','info','[userReport][devicestatechange]\x20device:%s\x20state:%s','device','[userReport][devicestatechange]','toLowerCase','inuse','local','format','updateStatusRealtime','stateTime','toNumber','[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:','telephone:%s','telephone:save','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:','Local','substring','indexOf','find','mobile','phone','accountcode','[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s','peer','address','[userReport][peerstatus]','status','[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','[userReport][peerstatus]\x20sending\x20trunk:save\x20event:','exports','lodash','moment','util','ioredis','bluebird','../../../config/environment','../../../config/logger','ami','redis','defaults','localhost','socket.io-emitter','trunks'];(function(_0x52dbc4,_0x28514c){var _0x34e2a8=function(_0x2e9570){while(--_0x2e9570){_0x52dbc4['push'](_0x52dbc4['shift']());}};_0x34e2a8(++_0x28514c);}(_0x839d,0x12b));var _0xd839=function(_0x523e6c,_0x2dfbb7){_0x523e6c=_0x523e6c-0x0;var _0x16a8ea=_0x839d[_0x523e6c];return _0x16a8ea;};'use strict';var _=require(_0xd839('0x0'));var moment=require(_0xd839('0x1'));var util=require(_0xd839('0x2'));var Redis=require(_0xd839('0x3'));var BPromise=require(_0xd839('0x4'));var config=require(_0xd839('0x5'));var logger=require(_0xd839('0x6'))(_0xd839('0x7'));var ami=require('../ami');config[_0xd839('0x8')]=_[_0xd839('0x9')](config[_0xd839('0x8')],{'host':_0xd839('0xa'),'port':0x18eb});var io=require(_0xd839('0xb'))(new Redis(config[_0xd839('0x8')]));function UserReport(_0x211925){this[_0xd839('0xc')]=_0x211925['trunks'];this[_0xd839('0xd')]=_0x211925[_0xd839('0xd')];this[_0xd839('0xe')]=_0x211925['telephones'];ami['on'](_0xd839('0xf'),this[_0xd839('0x10')][_0xd839('0x11')](this));ami['on'](_0xd839('0x12'),this[_0xd839('0x10')][_0xd839('0x11')](this));ami['on'](_0xd839('0x13'),this[_0xd839('0x14')][_0xd839('0x11')](this));ami['on'](_0xd839('0x15'),this[_0xd839('0x16')][_0xd839('0x11')](this));return this[_0xd839('0x17')]();}function showSipRegistrations(){Promise[_0xd839('0x18')]()['then'](ami[_0xd839('0x19')]())[_0xd839('0x1a')](function(_0x2b6a7b){logger[_0xd839('0x1b')](_0xd839('0x1c'),util[_0xd839('0x1d')](_0x2b6a7b,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise['resolve']()[_0xd839('0x1e')](ami[_0xd839('0x1f')]())[_0xd839('0x1a')](function(_0xfcd759){logger[_0xd839('0x1b')]('[userReport][devicestatelist]',util['inspect'](_0xfcd759,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0xd839('0x18')]()['then'](ami[_0xd839('0x20')]())[_0xd839('0x1a')](function(_0x1e8c1d){logger[_0xd839('0x1b')](_0xd839('0x21'),util[_0xd839('0x1d')](_0x1e8c1d,{'showHidden':![],'depth':null}));});}UserReport[_0xd839('0x22')]['syncRealtimeShow']=function(){setInterval(function(){BPromise['resolve']()['then'](showSipRegistrations())[_0xd839('0x1e')](listDeviceStates())['then'](showPeersStatus());},0x32c8);};UserReport['prototype'][_0xd839('0x23')]=function(_0x315220){return _0x315220!==null&&!_['isUndefined'](_0x315220);};UserReport[_0xd839('0x22')]['emit']=function(_0x1032a6,_0x2cdf3d,_0x391b4d){io['to'](_0x1032a6)['emit'](_0x2cdf3d,_0x391b4d);};UserReport[_0xd839('0x22')][_0xd839('0x10')]=function(_0x40b649){try{if(this[_0xd839('0x23')](_0x40b649)){logger['info'](_0xd839('0x24'),_0x40b649[_0xd839('0x25')],_0x40b649[_0xd839('0x26')]);logger[_0xd839('0x27')](_0xd839('0x28'),util[_0xd839('0x1d')](_0x40b649,{'showHidden':![],'depth':null}));var _0x21486d=_['find'](this[_0xd839('0xc')],{'defaultuser':_0x40b649[_0xd839('0x25')]});if(_0x21486d){_0x40b649['stateRegistry']=_0x40b649[_0xd839('0x26')];_[_0xd839('0x29')](_0x21486d,_['omit'](_0x40b649,[_0xd839('0x2a'),'actionid',_0xd839('0x25'),_0xd839('0x26')]));logger[_0xd839('0x27')](_0xd839('0x2b'),util['inspect'](_0x21486d,{'showHidden':![],'depth':null}));this[_0xd839('0x2c')](util['format'](_0xd839('0x2d'),_0x21486d[_0xd839('0x2e')]),_0xd839('0x2f'),_0x21486d);}}}catch(_0xbef26b){logger[_0xd839('0x1b')](_0xd839('0x28'),util[_0xd839('0x1d')](_0xbef26b,{'showHidden':![],'depth':null}));}};UserReport[_0xd839('0x22')][_0xd839('0x14')]=function(_0x1a45c6){try{if(this[_0xd839('0x23')](_0x1a45c6)){logger[_0xd839('0x30')](_0xd839('0x31'),_0x1a45c6[_0xd839('0x32')],_0x1a45c6[_0xd839('0x26')]);logger['debug'](_0xd839('0x33'),util[_0xd839('0x1d')](_0x1a45c6,{'showHidden':![],'depth':null}));if(this['agents'][_0x1a45c6[_0xd839('0x32')]]){if(!this['agents'][_0x1a45c6['device']]['local']||_0x1a45c6[_0xd839('0x26')][_0xd839('0x34')]()==_0xd839('0x35')){this[_0xd839('0xd')][_0x1a45c6[_0xd839('0x32')]][_0xd839('0x36')]=![];if(this[_0xd839('0xd')][_0x1a45c6[_0xd839('0x32')]][_0xd839('0x26')]!==_0x1a45c6[_0xd839('0x26')][_0xd839('0x34')]()){this[_0xd839('0xd')][_0x1a45c6['device']]['stateTime']=_['toNumber'](moment()[_0xd839('0x37')]('x'));}this[_0xd839('0xd')][_0x1a45c6[_0xd839('0x32')]][_0xd839('0x26')]=_0x1a45c6[_0xd839('0x26')][_0xd839('0x34')]();this[_0xd839('0xd')][_0x1a45c6[_0xd839('0x32')]][_0xd839('0x38')](_0x1a45c6);}}else if(this[_0xd839('0xe')][_0x1a45c6[_0xd839('0x32')]]){if(this[_0xd839('0xe')][_0x1a45c6[_0xd839('0x32')]]['state']!==_0x1a45c6[_0xd839('0x26')]['toLowerCase']()){this['telephones'][_0x1a45c6[_0xd839('0x32')]][_0xd839('0x39')]=_[_0xd839('0x3a')](moment()['format']('x'));}this[_0xd839('0xe')][_0x1a45c6[_0xd839('0x32')]][_0xd839('0x26')]=_0x1a45c6[_0xd839('0x26')][_0xd839('0x34')]();logger[_0xd839('0x27')](_0xd839('0x3b'),util[_0xd839('0x1d')](this[_0xd839('0xe')][_0x1a45c6[_0xd839('0x32')]],{'showHidden':![],'depth':null}));this['emit'](util[_0xd839('0x37')](_0xd839('0x3c'),this[_0xd839('0xe')][_0x1a45c6[_0xd839('0x32')]][_0xd839('0x2e')]),_0xd839('0x3d'),this[_0xd839('0xe')][_0x1a45c6['device']]);}else if(this[_0xd839('0xc')][_0x1a45c6[_0xd839('0x32')]]){if(this['trunks'][_0x1a45c6[_0xd839('0x32')]][_0xd839('0x26')]!==_0x1a45c6[_0xd839('0x26')]['toLowerCase']()){this[_0xd839('0xc')][_0x1a45c6[_0xd839('0x32')]][_0xd839('0x39')]=_[_0xd839('0x3a')](moment()['format']('x'));}this[_0xd839('0xc')][_0x1a45c6[_0xd839('0x32')]][_0xd839('0x26')]=_0x1a45c6['state'][_0xd839('0x34')]();logger[_0xd839('0x27')](_0xd839('0x3e'),util['inspect'](this[_0xd839('0xc')][_0x1a45c6[_0xd839('0x32')]],{'showHidden':![],'depth':null}));this[_0xd839('0x2c')](util[_0xd839('0x37')](_0xd839('0x2d'),this[_0xd839('0xc')][_0x1a45c6[_0xd839('0x32')]][_0xd839('0x2e')]),'trunk:save',this[_0xd839('0xc')][_0x1a45c6[_0xd839('0x32')]]);}else if(_['startsWith'](_0x1a45c6[_0xd839('0x32')],_0xd839('0x3f'))){var _0x175444=_0x1a45c6[_0xd839('0x32')];var _0x1e4e97=_0x175444[_0xd839('0x40')](_0x175444[_0xd839('0x41')]('/')+0x1,_0x175444[_0xd839('0x41')]('@'));var _0x37ff0f=_[_0xd839('0x42')](this[_0xd839('0xd')],function(_0x4caeba){return _0x4caeba[_0xd839('0x43')]==_0x1e4e97||_0x4caeba[_0xd839('0x44')]==_0x1e4e97||_0x4caeba[_0xd839('0x45')]==_0x1e4e97;});if(_0x37ff0f){if(_0x37ff0f['state']!==_0x1a45c6[_0xd839('0x26')][_0xd839('0x34')]()){_0x37ff0f[_0xd839('0x39')]=_[_0xd839('0x3a')](moment()[_0xd839('0x37')]('x'));}_0x37ff0f[_0xd839('0x26')]=_0x1a45c6[_0xd839('0x26')]['toLowerCase']();_0x37ff0f[_0xd839('0x36')]=!![];_0x37ff0f['updateStatusRealtime'](_0x1a45c6);}}}}catch(_0x4ff338){logger['error'](_0xd839('0x33'),util[_0xd839('0x1d')](_0x4ff338,{'showHidden':![],'depth':null}));}};UserReport[_0xd839('0x22')]['syncPeerStatus']=function(_0x254d74){try{if(this[_0xd839('0x23')](_0x254d74)&&this['isNotNull'](_0x254d74['peerstatus'])){logger['info'](_0xd839('0x46'),_0x254d74[_0xd839('0x47')],_0x254d74[_0xd839('0x48')],_0x254d74[_0xd839('0x15')]);logger[_0xd839('0x27')](_0xd839('0x49'),util[_0xd839('0x1d')](_0x254d74,{'showHidden':![],'depth':null}));if(this[_0xd839('0xd')][_0x254d74[_0xd839('0x47')]]){if(!this[_0xd839('0xd')][_0x254d74['peer']][_0xd839('0x36')]||_0x254d74['peerstatus'][_0xd839('0x34')]()=='registered'){this[_0xd839('0xd')][_0x254d74[_0xd839('0x47')]][_0xd839('0x36')]=![];this['agents'][_0x254d74[_0xd839('0x47')]][_0xd839('0x4a')]=_0x254d74[_0xd839('0x15')]['toLowerCase']();this['agents'][_0x254d74['peer']][_0xd839('0x48')]=_0x254d74['address'];this[_0xd839('0xd')][_0x254d74[_0xd839('0x47')]][_0xd839('0x38')](_0x254d74);}}else if(this[_0xd839('0xe')][_0x254d74[_0xd839('0x47')]]){this[_0xd839('0xe')][_0x254d74[_0xd839('0x47')]][_0xd839('0x4a')]=_0x254d74[_0xd839('0x15')]['toLowerCase']();this[_0xd839('0xe')][_0x254d74[_0xd839('0x47')]]['address']=_0x254d74['address'];logger[_0xd839('0x27')](_0xd839('0x4b'),util[_0xd839('0x1d')](this['telephones'][_0x254d74[_0xd839('0x47')]],{'showHidden':![],'depth':null}));this[_0xd839('0x2c')](util[_0xd839('0x37')](_0xd839('0x3c'),this[_0xd839('0xe')][_0x254d74[_0xd839('0x47')]][_0xd839('0x2e')]),_0xd839('0x3d'),this[_0xd839('0xe')][_0x254d74[_0xd839('0x47')]]);}else if(this[_0xd839('0xc')][_0x254d74[_0xd839('0x47')]]){this[_0xd839('0xc')][_0x254d74[_0xd839('0x47')]][_0xd839('0x4a')]=_0x254d74[_0xd839('0x15')]['toLowerCase']();this[_0xd839('0xc')][_0x254d74[_0xd839('0x47')]]['address']=_0x254d74[_0xd839('0x48')];logger[_0xd839('0x27')](_0xd839('0x4c'),util[_0xd839('0x1d')](this[_0xd839('0xc')][_0x254d74['peer']],{'showHidden':![],'depth':null}));this[_0xd839('0x2c')](util['format'](_0xd839('0x2d'),this[_0xd839('0xc')][_0x254d74[_0xd839('0x47')]][_0xd839('0x2e')]),_0xd839('0x2f'),this[_0xd839('0xc')][_0x254d74['peer']]);}}}catch(_0x3e791a){logger[_0xd839('0x1b')](_0xd839('0x49'),util[_0xd839('0x1d')](_0x3e791a,{'showHidden':![],'depth':null}));}};module[_0xd839('0x4d')]=UserReport; \ No newline at end of file +var _0x5498=['status','address','[userReport][peerstatus]\x20sending\x20telephone:save\x20event:','[userReport][peerstatus]\x20sending\x20trunk:save\x20event:','exports','lodash','moment','bluebird','../../../config/environment','ami','../ami','redis','defaults','localhost','socket.io-emitter','trunks','agents','telephones','syncRegistry','registry','devicestatechange','syncDeviceState','bind','syncPeerStatus','syncRealtimeShow','then','actionSipShowRegistry','catch','error','[userReport][sipshowregistry]','inspect','resolve','actionSipPeerStatus','[userReport][sippeerstatus]','isNotNull','isUndefined','prototype','emit','info','[userReport][registry]\x20registry:%s\x20state:%s','username','state','debug','find','stateRegistry','merge','event','actionid','format','trunk:%s','name','trunk:save','[userReport][registry]','[userReport][devicestatechange]\x20device:%s\x20state:%s','device','toLowerCase','inuse','stateTime','toNumber','updateStatusRealtime','[userReport][devicestatechange]\x20sending\x20telephone:save\x20event:','telephone:save','[userReport][devicestatechange]\x20sending\x20trunk:save\x20event:','startsWith','Local','indexOf','mobile','phone','accountcode','local','[userReport][devicestatechange]','peerstatus','[userReport][peerstatus]\x20peer:%s\x20address:%s\x20status:%s','[userReport][peerstatus]','peer','registered'];(function(_0x24061a,_0x1c9f4d){var _0x82054e=function(_0x2ec346){while(--_0x2ec346){_0x24061a['push'](_0x24061a['shift']());}};_0x82054e(++_0x1c9f4d);}(_0x5498,0x181));var _0x8549=function(_0xd20f60,_0x9f2cf6){_0xd20f60=_0xd20f60-0x0;var _0x56dc8f=_0x5498[_0xd20f60];return _0x56dc8f;};'use strict';var _=require(_0x8549('0x0'));var moment=require(_0x8549('0x1'));var util=require('util');var Redis=require('ioredis');var BPromise=require(_0x8549('0x2'));var config=require(_0x8549('0x3'));var logger=require('../../../config/logger')(_0x8549('0x4'));var ami=require(_0x8549('0x5'));config[_0x8549('0x6')]=_[_0x8549('0x7')](config['redis'],{'host':_0x8549('0x8'),'port':0x18eb});var io=require(_0x8549('0x9'))(new Redis(config[_0x8549('0x6')]));function UserReport(_0x436285){this[_0x8549('0xa')]=_0x436285[_0x8549('0xa')];this[_0x8549('0xb')]=_0x436285[_0x8549('0xb')];this[_0x8549('0xc')]=_0x436285[_0x8549('0xc')];ami['on']('registryentry',this[_0x8549('0xd')]['bind'](this));ami['on'](_0x8549('0xe'),this[_0x8549('0xd')]['bind'](this));ami['on'](_0x8549('0xf'),this[_0x8549('0x10')][_0x8549('0x11')](this));ami['on']('peerstatus',this[_0x8549('0x12')]['bind'](this));return this[_0x8549('0x13')]();}function showSipRegistrations(){Promise['resolve']()[_0x8549('0x14')](ami[_0x8549('0x15')]())[_0x8549('0x16')](function(_0x491c97){logger[_0x8549('0x17')](_0x8549('0x18'),util[_0x8549('0x19')](_0x491c97,{'showHidden':![],'depth':null}));});}function listDeviceStates(){Promise[_0x8549('0x1a')]()[_0x8549('0x14')](ami['actionDeviceStateList']())[_0x8549('0x16')](function(_0x39fe80){logger[_0x8549('0x17')]('[userReport][devicestatelist]',util['inspect'](_0x39fe80,{'showHidden':![],'depth':null}));});}function showPeersStatus(){Promise[_0x8549('0x1a')]()[_0x8549('0x14')](ami[_0x8549('0x1b')]())[_0x8549('0x16')](function(_0x31ee0a){logger[_0x8549('0x17')](_0x8549('0x1c'),util[_0x8549('0x19')](_0x31ee0a,{'showHidden':![],'depth':null}));});}UserReport['prototype'][_0x8549('0x13')]=function(){setInterval(function(){BPromise[_0x8549('0x1a')]()[_0x8549('0x14')](showSipRegistrations())[_0x8549('0x14')](listDeviceStates())['then'](showPeersStatus());},0x32c8);};UserReport['prototype'][_0x8549('0x1d')]=function(_0x2893c4){return _0x2893c4!==null&&!_[_0x8549('0x1e')](_0x2893c4);};UserReport[_0x8549('0x1f')][_0x8549('0x20')]=function(_0x3349e6,_0x42c5b7,_0x222e2e){io['to'](_0x3349e6)['emit'](_0x42c5b7,_0x222e2e);};UserReport[_0x8549('0x1f')][_0x8549('0xd')]=function(_0x1bc9f0){try{if(this[_0x8549('0x1d')](_0x1bc9f0)){logger[_0x8549('0x21')](_0x8549('0x22'),_0x1bc9f0[_0x8549('0x23')],_0x1bc9f0[_0x8549('0x24')]);logger[_0x8549('0x25')]('[userReport][registry]',util[_0x8549('0x19')](_0x1bc9f0,{'showHidden':![],'depth':null}));var _0x4691cb=_[_0x8549('0x26')](this[_0x8549('0xa')],{'defaultuser':_0x1bc9f0[_0x8549('0x23')]});if(_0x4691cb){_0x1bc9f0[_0x8549('0x27')]=_0x1bc9f0[_0x8549('0x24')];_[_0x8549('0x28')](_0x4691cb,_['omit'](_0x1bc9f0,[_0x8549('0x29'),_0x8549('0x2a'),_0x8549('0x23'),_0x8549('0x24')]));logger[_0x8549('0x25')]('[userReport][registry]\x20sending\x20trunk:save\x20event:',util[_0x8549('0x19')](_0x4691cb,{'showHidden':![],'depth':null}));this[_0x8549('0x20')](util[_0x8549('0x2b')](_0x8549('0x2c'),_0x4691cb[_0x8549('0x2d')]),_0x8549('0x2e'),_0x4691cb);}}}catch(_0x137949){logger[_0x8549('0x17')](_0x8549('0x2f'),util[_0x8549('0x19')](_0x137949,{'showHidden':![],'depth':null}));}};UserReport[_0x8549('0x1f')][_0x8549('0x10')]=function(_0x5d6725){try{if(this[_0x8549('0x1d')](_0x5d6725)){logger['info'](_0x8549('0x30'),_0x5d6725[_0x8549('0x31')],_0x5d6725['state']);logger[_0x8549('0x25')]('[userReport][devicestatechange]',util[_0x8549('0x19')](_0x5d6725,{'showHidden':![],'depth':null}));if(this[_0x8549('0xb')][_0x5d6725['device']]){if(!this[_0x8549('0xb')][_0x5d6725[_0x8549('0x31')]]['local']||_0x5d6725[_0x8549('0x24')][_0x8549('0x32')]()==_0x8549('0x33')){this[_0x8549('0xb')][_0x5d6725[_0x8549('0x31')]]['local']=![];if(this['agents'][_0x5d6725[_0x8549('0x31')]][_0x8549('0x24')]!==_0x5d6725[_0x8549('0x24')][_0x8549('0x32')]()){this[_0x8549('0xb')][_0x5d6725['device']][_0x8549('0x34')]=_[_0x8549('0x35')](moment()[_0x8549('0x2b')]('x'));}this['agents'][_0x5d6725['device']][_0x8549('0x24')]=_0x5d6725[_0x8549('0x24')][_0x8549('0x32')]();this[_0x8549('0xb')][_0x5d6725[_0x8549('0x31')]][_0x8549('0x36')](_0x5d6725);}}else if(this[_0x8549('0xc')][_0x5d6725['device']]){if(this['telephones'][_0x5d6725[_0x8549('0x31')]][_0x8549('0x24')]!==_0x5d6725[_0x8549('0x24')][_0x8549('0x32')]()){this[_0x8549('0xc')][_0x5d6725['device']][_0x8549('0x34')]=_[_0x8549('0x35')](moment()[_0x8549('0x2b')]('x'));}this['telephones'][_0x5d6725[_0x8549('0x31')]]['state']=_0x5d6725['state'][_0x8549('0x32')]();logger[_0x8549('0x25')](_0x8549('0x37'),util[_0x8549('0x19')](this[_0x8549('0xc')][_0x5d6725[_0x8549('0x31')]],{'showHidden':![],'depth':null}));this[_0x8549('0x20')](util[_0x8549('0x2b')]('telephone:%s',this[_0x8549('0xc')][_0x5d6725[_0x8549('0x31')]][_0x8549('0x2d')]),_0x8549('0x38'),this[_0x8549('0xc')][_0x5d6725[_0x8549('0x31')]]);}else if(this['trunks'][_0x5d6725[_0x8549('0x31')]]){if(this[_0x8549('0xa')][_0x5d6725[_0x8549('0x31')]][_0x8549('0x24')]!==_0x5d6725['state']['toLowerCase']()){this[_0x8549('0xa')][_0x5d6725[_0x8549('0x31')]][_0x8549('0x34')]=_['toNumber'](moment()[_0x8549('0x2b')]('x'));}this[_0x8549('0xa')][_0x5d6725[_0x8549('0x31')]]['state']=_0x5d6725['state'][_0x8549('0x32')]();logger[_0x8549('0x25')](_0x8549('0x39'),util['inspect'](this[_0x8549('0xa')][_0x5d6725[_0x8549('0x31')]],{'showHidden':![],'depth':null}));this[_0x8549('0x20')](util[_0x8549('0x2b')](_0x8549('0x2c'),this[_0x8549('0xa')][_0x5d6725[_0x8549('0x31')]]['name']),'trunk:save',this[_0x8549('0xa')][_0x5d6725[_0x8549('0x31')]]);}else if(_[_0x8549('0x3a')](_0x5d6725[_0x8549('0x31')],_0x8549('0x3b'))){var _0x30900a=_0x5d6725['device'];var _0x4fde4f=_0x30900a['substring'](_0x30900a['indexOf']('/')+0x1,_0x30900a[_0x8549('0x3c')]('@'));var _0x476822=_[_0x8549('0x26')](this[_0x8549('0xb')],function(_0x16be8f){return _0x16be8f[_0x8549('0x3d')]==_0x4fde4f||_0x16be8f[_0x8549('0x3e')]==_0x4fde4f||_0x16be8f[_0x8549('0x3f')]==_0x4fde4f;});if(_0x476822){if(_0x476822['state']!==_0x5d6725[_0x8549('0x24')]['toLowerCase']()){_0x476822[_0x8549('0x34')]=_[_0x8549('0x35')](moment()['format']('x'));}_0x476822[_0x8549('0x24')]=_0x5d6725[_0x8549('0x24')][_0x8549('0x32')]();_0x476822[_0x8549('0x40')]=!![];_0x476822[_0x8549('0x36')](_0x5d6725);}}}}catch(_0x3c2f18){logger[_0x8549('0x17')](_0x8549('0x41'),util[_0x8549('0x19')](_0x3c2f18,{'showHidden':![],'depth':null}));}};UserReport[_0x8549('0x1f')]['syncPeerStatus']=function(_0x154a94){try{if(this[_0x8549('0x1d')](_0x154a94)&&this[_0x8549('0x1d')](_0x154a94[_0x8549('0x42')])){logger[_0x8549('0x21')](_0x8549('0x43'),_0x154a94['peer'],_0x154a94['address'],_0x154a94[_0x8549('0x42')]);logger[_0x8549('0x25')](_0x8549('0x44'),util[_0x8549('0x19')](_0x154a94,{'showHidden':![],'depth':null}));if(this[_0x8549('0xb')][_0x154a94['peer']]){if(!this[_0x8549('0xb')][_0x154a94[_0x8549('0x45')]][_0x8549('0x40')]||_0x154a94['peerstatus'][_0x8549('0x32')]()==_0x8549('0x46')){this[_0x8549('0xb')][_0x154a94[_0x8549('0x45')]]['local']=![];this[_0x8549('0xb')][_0x154a94[_0x8549('0x45')]][_0x8549('0x47')]=_0x154a94[_0x8549('0x42')][_0x8549('0x32')]();this['agents'][_0x154a94[_0x8549('0x45')]][_0x8549('0x48')]=_0x154a94[_0x8549('0x48')];this[_0x8549('0xb')][_0x154a94[_0x8549('0x45')]]['updateStatusRealtime'](_0x154a94);}}else if(this['telephones'][_0x154a94['peer']]){this[_0x8549('0xc')][_0x154a94[_0x8549('0x45')]][_0x8549('0x47')]=_0x154a94[_0x8549('0x42')][_0x8549('0x32')]();this[_0x8549('0xc')][_0x154a94[_0x8549('0x45')]][_0x8549('0x48')]=_0x154a94[_0x8549('0x48')];logger[_0x8549('0x25')](_0x8549('0x49'),util[_0x8549('0x19')](this[_0x8549('0xc')][_0x154a94[_0x8549('0x45')]],{'showHidden':![],'depth':null}));this[_0x8549('0x20')](util['format']('telephone:%s',this[_0x8549('0xc')][_0x154a94[_0x8549('0x45')]][_0x8549('0x2d')]),_0x8549('0x38'),this[_0x8549('0xc')][_0x154a94[_0x8549('0x45')]]);}else if(this[_0x8549('0xa')][_0x154a94[_0x8549('0x45')]]){this[_0x8549('0xa')][_0x154a94[_0x8549('0x45')]]['status']=_0x154a94['peerstatus'][_0x8549('0x32')]();this[_0x8549('0xa')][_0x154a94[_0x8549('0x45')]][_0x8549('0x48')]=_0x154a94[_0x8549('0x48')];logger[_0x8549('0x25')](_0x8549('0x4a'),util[_0x8549('0x19')](this[_0x8549('0xa')][_0x154a94[_0x8549('0x45')]],{'showHidden':![],'depth':null}));this[_0x8549('0x20')](util[_0x8549('0x2b')]('trunk:%s',this[_0x8549('0xa')][_0x154a94[_0x8549('0x45')]]['name']),'trunk:save',this['trunks'][_0x154a94[_0x8549('0x45')]]);}}}catch(_0x31d998){logger[_0x8549('0x17')](_0x8549('0x44'),util[_0x8549('0x19')](_0x31d998,{'showHidden':![],'depth':null}));}};module[_0x8549('0x4b')]=UserReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceAgentReport.js b/server/services/ami/report/voiceAgentReport.js index aeebcb4..090a0ec 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 _0x8ba0=['channels','voiceChannels','voiceQueues','agents','variables','syncAgentCalled','bind','agentconnect','syncAgentConnect','agentringnoanswer','syncAgentRingNoAnswer','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','varset','syncVarSet','hangup','syncHangup','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','blindtransfer','prototype','emit','isUndefined','info','[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','uniqueid','membername','destuniqueid','debug','[%s][voiceAgentReport][agentcalled]\x20event:','inspect','format','YYYY-MM-DD\x20HH:mm:ss','called','queue','mandatoryDisposition','type','inbound','omit','privilege','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','custom:agentcalled','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:','user:%s','user:called','[%s][voiceAgentReport][agentcalled]','isNotNull','[%s][voiceAgentReport][agentconnect]\x20event:','hasOwnProperty','agentconnectAt','connectedlinename','connectedlinenum','destchannelstate','destchannelstatedesc','lastevent','connect','routealias','merge','interface','pick','destconnectedlinenum','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:','custom:agentconnect','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:','user:agentconnect','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere','agentringnoanswerAt','answeredelsewheredestinationuniqueid','answeredelsewheremembername','answered_elsewhere','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:','custom:agentansweredelsewhere','error','[%s][voiceAgentReport][agentringnoanswer]\x20event:','[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected','rejected','reason','custom:agentringnoanswer','[%s][voiceAgentReport][agentringnoanswer]','[%s][voiceAgentReport][queuecallerabandon]\x20event:','[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','custom:agentqueuecallerabandon','[%s][voiceAgentReport][queuecallerabandon]','syncAgentComplete','[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','complete','transfer','agent','talktime','acwtime','acwTimeout','[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:','custom:agentcomplete','[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:','user:agentcomplete','[%s][voiceAgentReport][varset]\x20event:','addVariable','keys','variable','value','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','[%s][voiceAgentReport][varset]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqosrtt','sipcallid','bridgepvtcallid','memberinterface','memberrealtime','isNil','includes','[%s][voiceAgentReport][hangup]\x20event:','[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:','custom:voiceAgentReport','values','transfereeuniqueid','origtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diff','seconds','secondtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]','syncBlindTransfer','[%s][voiceAgentReport][blindtransfer]\x20event:','transfereruniqueid','[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','[%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]','lodash','moment','util','ioredis','../../../config/environment','../ami','redis','defaults','localhost','socket.io-emitter'];(function(_0x134c2e,_0x3573c4){var _0x2825db=function(_0x2a574d){while(--_0x2a574d){_0x134c2e['push'](_0x134c2e['shift']());}};_0x2825db(++_0x3573c4);}(_0x8ba0,0x1c7));var _0x08ba=function(_0x2a1be6,_0x318725){_0x2a1be6=_0x2a1be6-0x0;var _0x41088a=_0x8ba0[_0x2a1be6];return _0x41088a;};'use strict';var _=require(_0x08ba('0x0'));var moment=require(_0x08ba('0x1'));var util=require(_0x08ba('0x2'));var Redis=require(_0x08ba('0x3'));var config=require(_0x08ba('0x4'));var logger=require('../../../config/logger')('ami');var ami=require(_0x08ba('0x5'));config[_0x08ba('0x6')]=_[_0x08ba('0x7')](config[_0x08ba('0x6')],{'host':_0x08ba('0x8'),'port':0x18eb});var io=require(_0x08ba('0x9'))(new Redis(config['redis']));function VoiceAgentReport(_0x235354){this[_0x08ba('0xa')]={};this[_0x08ba('0xb')]=_0x235354[_0x08ba('0xa')];this[_0x08ba('0xc')]=_0x235354['voiceQueues'];this[_0x08ba('0xd')]=_0x235354['agents'];this[_0x08ba('0xe')]={};ami['on']('agentcalled',this[_0x08ba('0xf')][_0x08ba('0x10')](this));ami['on'](_0x08ba('0x11'),this[_0x08ba('0x12')][_0x08ba('0x10')](this));ami['on'](_0x08ba('0x13'),this[_0x08ba('0x14')][_0x08ba('0x10')](this));ami['on'](_0x08ba('0x15'),this[_0x08ba('0x16')][_0x08ba('0x10')](this));ami['on'](_0x08ba('0x17'),this['syncAgentComplete'][_0x08ba('0x10')](this));ami['on'](_0x08ba('0x18'),this[_0x08ba('0x19')][_0x08ba('0x10')](this));ami['on'](_0x08ba('0x1a'),this[_0x08ba('0x1b')]['bind'](this));ami['on'](_0x08ba('0x1c'),this[_0x08ba('0x1d')][_0x08ba('0x10')](this));ami['on'](_0x08ba('0x1e'),this[_0x08ba('0x1f')]['bind'](this));ami['on'](_0x08ba('0x20'),this[_0x08ba('0x21')]['bind'](this));ami['on'](_0x08ba('0x22'),this['syncBlindTransfer']['bind'](this));}VoiceAgentReport[_0x08ba('0x23')][_0x08ba('0x24')]=function(_0xa66aeb,_0x6388ba,_0x6a9cc6){io['to'](_0xa66aeb)[_0x08ba('0x24')](_0x6388ba,_0x6a9cc6);};VoiceAgentReport[_0x08ba('0x23')]['isNotNull']=function(_0x506fbe){return _0x506fbe!==null&&!_[_0x08ba('0x25')](_0x506fbe);};VoiceAgentReport['prototype'][_0x08ba('0xf')]=function(_0x39fb5e){try{if(this['isNotNull'](_0x39fb5e)){logger[_0x08ba('0x26')](_0x08ba('0x27'),_0x39fb5e[_0x08ba('0x28')],_0x39fb5e[_0x08ba('0x29')],_0x39fb5e[_0x08ba('0x2a')]);logger[_0x08ba('0x2b')](_0x08ba('0x2c'),_0x39fb5e[_0x08ba('0x28')],util[_0x08ba('0x2d')](_0x39fb5e,{'showHidden':![],'depth':null}));if(_[_0x08ba('0x25')](this[_0x08ba('0xa')][_0x39fb5e[_0x08ba('0x28')]])){this['channels'][_0x39fb5e[_0x08ba('0x28')]]={};}if(_[_0x08ba('0x25')](this[_0x08ba('0xa')][_0x39fb5e[_0x08ba('0x28')]][_0x39fb5e[_0x08ba('0x2a')]])){this[_0x08ba('0xa')][_0x39fb5e[_0x08ba('0x28')]][_0x39fb5e['destuniqueid']]={'agentcalledAt':moment()[_0x08ba('0x2e')](_0x08ba('0x2f')),'lastevent':_0x08ba('0x30'),'mandatoryDisposition':this['voiceQueues'][_0x39fb5e['queue']]?this['voiceQueues'][_0x39fb5e[_0x08ba('0x31')]][_0x08ba('0x32')]||![]:![],'type':this[_0x08ba('0xc')][_0x39fb5e[_0x08ba('0x31')]]?this[_0x08ba('0xc')][_0x39fb5e['queue']][_0x08ba('0x33')]||'inbound':_0x08ba('0x34'),'variables':this[_0x08ba('0xe')][_0x39fb5e['uniqueid']],'motionChannel':'voice'};}_['merge'](this[_0x08ba('0xa')][_0x39fb5e[_0x08ba('0x28')]][_0x39fb5e[_0x08ba('0x2a')]],_[_0x08ba('0x35')](_0x39fb5e,['event',_0x08ba('0x36')]));logger[_0x08ba('0x2b')](_0x08ba('0x37'),_0x39fb5e[_0x08ba('0x28')],util['inspect'](this[_0x08ba('0xa')][_0x39fb5e[_0x08ba('0x28')]][_0x39fb5e[_0x08ba('0x2a')]],{'showHidden':![],'depth':null}));ami[_0x08ba('0x24')](_0x08ba('0x38'),this[_0x08ba('0xa')][_0x39fb5e[_0x08ba('0x28')]][_0x39fb5e[_0x08ba('0x2a')]]);logger['debug'](_0x08ba('0x39'),_0x39fb5e[_0x08ba('0x28')],util[_0x08ba('0x2d')](this[_0x08ba('0xa')][_0x39fb5e[_0x08ba('0x28')]][_0x39fb5e['destuniqueid']],{'showHidden':![],'depth':null}));this[_0x08ba('0x24')](util[_0x08ba('0x2e')](_0x08ba('0x3a'),_0x39fb5e[_0x08ba('0x29')]),_0x08ba('0x3b'),this['channels'][_0x39fb5e[_0x08ba('0x28')]][_0x39fb5e['destuniqueid']]);}}catch(_0x12dc0e){logger['error'](_0x08ba('0x3c'),_0x39fb5e[_0x08ba('0x28')],util[_0x08ba('0x2d')](_0x12dc0e,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x08ba('0x23')][_0x08ba('0x12')]=function(_0x257d25){try{if(this[_0x08ba('0x3d')](_0x257d25)){if(this[_0x08ba('0xa')][_0x257d25[_0x08ba('0x28')]]){logger[_0x08ba('0x2b')](_0x08ba('0x3e'),_0x257d25[_0x08ba('0x28')],util[_0x08ba('0x2d')](_0x257d25,{'showHidden':![],'depth':null}));for(var _0x268d30 in this['channels'][_0x257d25[_0x08ba('0x28')]]){if(this[_0x08ba('0xa')][_0x257d25[_0x08ba('0x28')]][_0x08ba('0x3f')](_0x268d30)){if(_0x257d25[_0x08ba('0x2a')]===_0x268d30){logger[_0x08ba('0x26')]('[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect',_0x257d25['uniqueid'],_0x257d25[_0x08ba('0x29')],_0x257d25['destuniqueid']);this[_0x08ba('0xa')][_0x257d25[_0x08ba('0x28')]][_0x268d30][_0x08ba('0x40')]=moment()['format'](_0x08ba('0x2f'));this[_0x08ba('0xa')][_0x257d25['uniqueid']][_0x268d30]['connectedlinename']=_0x257d25[_0x08ba('0x41')];this[_0x08ba('0xa')][_0x257d25['uniqueid']][_0x268d30][_0x08ba('0x42')]=_0x257d25[_0x08ba('0x42')];this['channels'][_0x257d25[_0x08ba('0x28')]][_0x268d30][_0x08ba('0x43')]=_0x257d25[_0x08ba('0x43')];this[_0x08ba('0xa')][_0x257d25['uniqueid']][_0x268d30]['destchannelstatedesc']=_0x257d25[_0x08ba('0x44')];this['channels'][_0x257d25[_0x08ba('0x28')]][_0x268d30]['holdtime']=_0x257d25['holdtime'];this[_0x08ba('0xa')][_0x257d25['uniqueid']][_0x268d30][_0x08ba('0x45')]=_0x08ba('0x46');if(this[_0x08ba('0xb')][this[_0x08ba('0xa')][_0x257d25[_0x08ba('0x28')]][_0x268d30]['uniqueid']]){var _0x4e1caa=this[_0x08ba('0xb')][this[_0x08ba('0xa')][_0x257d25[_0x08ba('0x28')]][_0x268d30]['uniqueid']][_0x08ba('0x47')];this[_0x08ba('0xa')][_0x257d25['uniqueid']][_0x268d30][_0x08ba('0x47')]=_0x4e1caa;_0x257d25[_0x08ba('0x47')]=_0x4e1caa;}_[_0x08ba('0x48')](this[_0x08ba('0xd')][_0x257d25[_0x08ba('0x49')]],_[_0x08ba('0x4a')](_0x257d25,['queue',_0x08ba('0x4b'),_0x08ba('0x47')]));logger['debug'](_0x08ba('0x4c'),_0x257d25[_0x08ba('0x28')],util[_0x08ba('0x2d')](this[_0x08ba('0xa')][_0x257d25[_0x08ba('0x28')]][_0x257d25['destuniqueid']],{'showHidden':![],'depth':null}));ami[_0x08ba('0x24')](_0x08ba('0x4d'),this[_0x08ba('0xa')][_0x257d25[_0x08ba('0x28')]][_0x257d25[_0x08ba('0x2a')]]);logger[_0x08ba('0x2b')](_0x08ba('0x4e'),_0x257d25['uniqueid'],util[_0x08ba('0x2d')](this[_0x08ba('0xa')][_0x257d25[_0x08ba('0x28')]][_0x257d25['destuniqueid']],{'showHidden':![],'depth':null}));this[_0x08ba('0x24')](util[_0x08ba('0x2e')](_0x08ba('0x3a'),_0x257d25['membername']),_0x08ba('0x4f'),this[_0x08ba('0xa')][_0x257d25[_0x08ba('0x28')]][_0x257d25[_0x08ba('0x2a')]]);}else if(!this[_0x08ba('0xa')][_0x257d25[_0x08ba('0x28')]][_0x268d30][_0x08ba('0x13')]&&!this[_0x08ba('0xa')][_0x257d25[_0x08ba('0x28')]][_0x268d30][_0x08ba('0x17')]){logger[_0x08ba('0x26')](_0x08ba('0x50'),_0x257d25[_0x08ba('0x28')],this[_0x08ba('0xa')][_0x257d25[_0x08ba('0x28')]][_0x268d30][_0x08ba('0x29')],_0x268d30);this[_0x08ba('0xa')][_0x257d25['uniqueid']][_0x268d30][_0x08ba('0x13')]=!![];this[_0x08ba('0xa')][_0x257d25[_0x08ba('0x28')]][_0x268d30][_0x08ba('0x51')]=moment()[_0x08ba('0x2e')](_0x08ba('0x2f'));this[_0x08ba('0xa')][_0x257d25['uniqueid']][_0x268d30][_0x08ba('0x52')]=_0x257d25[_0x08ba('0x2a')];this[_0x08ba('0xa')][_0x257d25[_0x08ba('0x28')]][_0x268d30][_0x08ba('0x53')]=_0x257d25[_0x08ba('0x29')];this['channels'][_0x257d25['uniqueid']][_0x268d30]['lastevent']=_0x08ba('0x54');this['channels'][_0x257d25[_0x08ba('0x28')]][_0x268d30]['reason']=_0x08ba('0x54');logger[_0x08ba('0x2b')](_0x08ba('0x55'),_0x257d25['uniqueid'],util[_0x08ba('0x2d')](this[_0x08ba('0xa')][_0x257d25[_0x08ba('0x28')]][_0x268d30],{'showHidden':![],'depth':null}));ami[_0x08ba('0x24')](_0x08ba('0x56'),this[_0x08ba('0xa')][_0x257d25[_0x08ba('0x28')]][_0x268d30]);}}}}}}catch(_0x4d5ce6){logger[_0x08ba('0x57')]('[%s][voiceAgentReport][agentconnect]',_0x257d25[_0x08ba('0x28')],util[_0x08ba('0x2d')](_0x4d5ce6,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x08ba('0x14')]=function(_0x4aac7f){try{if(this[_0x08ba('0x3d')](_0x4aac7f)){logger['debug'](_0x08ba('0x58'),_0x4aac7f['uniqueid'],util[_0x08ba('0x2d')](_0x4aac7f,{'showHidden':![],'depth':null}));if(this[_0x08ba('0xa')][_0x4aac7f['uniqueid']]&&this[_0x08ba('0xa')][_0x4aac7f['uniqueid']][_0x4aac7f[_0x08ba('0x2a')]]){logger['info'](_0x08ba('0x59'),_0x4aac7f['uniqueid'],_0x4aac7f[_0x08ba('0x29')],_0x4aac7f['destuniqueid']);this[_0x08ba('0xa')][_0x4aac7f['uniqueid']][_0x4aac7f[_0x08ba('0x2a')]][_0x08ba('0x13')]=!![];this[_0x08ba('0xa')][_0x4aac7f['uniqueid']][_0x4aac7f['destuniqueid']]['agentringnoanswerAt']=moment()['format'](_0x08ba('0x2f'));this[_0x08ba('0xa')][_0x4aac7f[_0x08ba('0x28')]][_0x4aac7f[_0x08ba('0x2a')]]['lastevent']=_0x08ba('0x5a');this[_0x08ba('0xa')][_0x4aac7f[_0x08ba('0x28')]][_0x4aac7f['destuniqueid']][_0x08ba('0x5b')]=_0x08ba('0x5a');logger[_0x08ba('0x2b')]('[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:',_0x4aac7f[_0x08ba('0x28')],util[_0x08ba('0x2d')](this['channels'][_0x4aac7f['uniqueid']][_0x4aac7f[_0x08ba('0x2a')]],{'showHidden':![],'depth':null}));ami[_0x08ba('0x24')](_0x08ba('0x5c'),this[_0x08ba('0xa')][_0x4aac7f[_0x08ba('0x28')]][_0x4aac7f[_0x08ba('0x2a')]]);}}}catch(_0x40c3cc){logger['error'](_0x08ba('0x5d'),_0x4aac7f[_0x08ba('0x28')],util[_0x08ba('0x2d')](_0x40c3cc,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x08ba('0x23')][_0x08ba('0x16')]=function(_0x1e6f80){try{if(this[_0x08ba('0x3d')](_0x1e6f80)){logger[_0x08ba('0x2b')](_0x08ba('0x5e'),_0x1e6f80[_0x08ba('0x28')],util[_0x08ba('0x2d')](_0x1e6f80,{'showHidden':![],'depth':null}));if(this[_0x08ba('0xa')][_0x1e6f80[_0x08ba('0x28')]]){for(var _0x2ec04f in this[_0x08ba('0xa')][_0x1e6f80['uniqueid']]){if(this['channels'][_0x1e6f80['uniqueid']][_0x08ba('0x3f')](_0x2ec04f)&&!this['channels'][_0x1e6f80[_0x08ba('0x28')]][_0x2ec04f][_0x08ba('0x13')]&&!this[_0x08ba('0xa')][_0x1e6f80['uniqueid']][_0x2ec04f]['agentcomplete']){logger[_0x08ba('0x26')](_0x08ba('0x5f'),_0x1e6f80['uniqueid'],this[_0x08ba('0xa')][_0x1e6f80[_0x08ba('0x28')]][_0x2ec04f][_0x08ba('0x29')],_0x2ec04f);this[_0x08ba('0xa')][_0x1e6f80[_0x08ba('0x28')]][_0x2ec04f][_0x08ba('0x13')]=!![];this['channels'][_0x1e6f80['uniqueid']][_0x2ec04f][_0x08ba('0x51')]=moment()[_0x08ba('0x2e')](_0x08ba('0x2f'));this[_0x08ba('0xa')][_0x1e6f80[_0x08ba('0x28')]][_0x2ec04f][_0x08ba('0x45')]='abandoned';this['channels'][_0x1e6f80[_0x08ba('0x28')]][_0x2ec04f]['reason']=_0x08ba('0x60');logger[_0x08ba('0x2b')]('[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:',_0x1e6f80[_0x08ba('0x28')],util['inspect'](this[_0x08ba('0xa')][_0x1e6f80[_0x08ba('0x28')]][_0x2ec04f],{'showHidden':![],'depth':null}));ami[_0x08ba('0x24')](_0x08ba('0x61'),this[_0x08ba('0xa')][_0x1e6f80[_0x08ba('0x28')]][_0x2ec04f]);}}}}}catch(_0x3892c9){logger[_0x08ba('0x57')](_0x08ba('0x62'),_0x1e6f80['uniqueid'],util[_0x08ba('0x2d')](_0x3892c9,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x08ba('0x23')][_0x08ba('0x63')]=function(_0x3a405d){try{if(this[_0x08ba('0x3d')](_0x3a405d)){logger[_0x08ba('0x2b')]('[%s][voiceAgentReport][agentcomplete]\x20event:',_0x3a405d[_0x08ba('0x28')],util['inspect'](_0x3a405d,{'showHidden':![],'depth':null}));if(this[_0x08ba('0xa')][_0x3a405d[_0x08ba('0x28')]]){for(var _0x48ba10 in this[_0x08ba('0xa')][_0x3a405d[_0x08ba('0x28')]]){if(this['channels'][_0x3a405d[_0x08ba('0x28')]]['hasOwnProperty'](_0x48ba10)){if(this['channels'][_0x3a405d['uniqueid']][_0x48ba10][_0x08ba('0x40')]&&!this[_0x08ba('0xa')][_0x3a405d['uniqueid']][_0x48ba10][_0x08ba('0x17')]){logger[_0x08ba('0x26')](_0x08ba('0x64'),_0x3a405d['uniqueid'],this[_0x08ba('0xa')][_0x3a405d['uniqueid']][_0x48ba10][_0x08ba('0x29')],_0x48ba10);this[_0x08ba('0xa')][_0x3a405d[_0x08ba('0x28')]][_0x48ba10][_0x08ba('0x17')]=!![];this[_0x08ba('0xa')][_0x3a405d[_0x08ba('0x28')]][_0x48ba10][_0x08ba('0x65')]=moment()[_0x08ba('0x2e')](_0x08ba('0x2f'));this[_0x08ba('0xa')][_0x3a405d['uniqueid']][_0x48ba10]['lastevent']=_0x08ba('0x66');this[_0x08ba('0xa')][_0x3a405d[_0x08ba('0x28')]][_0x48ba10][_0x08ba('0x5b')]=_0x3a405d[_0x08ba('0x5b')]==_0x08ba('0x67')?_0x08ba('0x68'):_0x3a405d['reason'];this[_0x08ba('0xa')][_0x3a405d['uniqueid']][_0x48ba10]['talktime']=_0x3a405d[_0x08ba('0x69')];if(this[_0x08ba('0xc')][_0x3a405d[_0x08ba('0x31')]]&&this[_0x08ba('0xc')][_0x3a405d['queue']]['acw']){this[_0x08ba('0xa')][_0x3a405d['uniqueid']][_0x48ba10][_0x08ba('0x6a')]=this[_0x08ba('0xc')][_0x3a405d[_0x08ba('0x31')]][_0x08ba('0x6b')];this['channels'][_0x3a405d[_0x08ba('0x28')]][_0x48ba10]['agentacw']=!![];}this['agents'][_0x3a405d['interface']]=_[_0x08ba('0x35')](this[_0x08ba('0xd')][_0x3a405d['interface']],[_0x08ba('0x31'),'destconnectedlinenum']);logger[_0x08ba('0x2b')](_0x08ba('0x6c'),_0x3a405d[_0x08ba('0x28')],util[_0x08ba('0x2d')](this['channels'][_0x3a405d[_0x08ba('0x28')]][_0x48ba10],{'showHidden':![],'depth':null}));ami['emit'](_0x08ba('0x6d'),this[_0x08ba('0xa')][_0x3a405d[_0x08ba('0x28')]][_0x48ba10]);logger[_0x08ba('0x2b')](_0x08ba('0x6e'),_0x3a405d[_0x08ba('0x28')],util[_0x08ba('0x2d')](this['channels'][_0x3a405d[_0x08ba('0x28')]][_0x48ba10],{'showHidden':![],'depth':null}));this[_0x08ba('0x24')](util[_0x08ba('0x2e')](_0x08ba('0x3a'),_0x3a405d[_0x08ba('0x29')]),_0x08ba('0x6f'),this['channels'][_0x3a405d['uniqueid']][_0x48ba10]);}}}}}}catch(_0xbb897b){logger[_0x08ba('0x57')]('[%s][voiceAgentReport][agentcomplete]',_0x3a405d['uniqueid'],util[_0x08ba('0x2d')](_0xbb897b,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x08ba('0x23')][_0x08ba('0x19')]=function(_0x2c19d9){try{if(this[_0x08ba('0x3d')](_0x2c19d9)){logger[_0x08ba('0x2b')](_0x08ba('0x70'),_0x2c19d9[_0x08ba('0x28')],util[_0x08ba('0x2d')](_0x2c19d9,{'showHidden':![],'depth':null}));this[_0x08ba('0x71')](_0x2c19d9[_0x08ba('0x28')],_[_0x08ba('0x72')](_0x2c19d9[_0x08ba('0x73')])[0x0],_0x2c19d9[_0x08ba('0x74')]);if(this[_0x08ba('0xa')][_0x2c19d9['uniqueid']]){for(var _0x34e7a7 in this[_0x08ba('0xa')][_0x2c19d9[_0x08ba('0x28')]]){if(this[_0x08ba('0xa')][_0x2c19d9[_0x08ba('0x28')]]['hasOwnProperty'](_0x34e7a7)){logger[_0x08ba('0x26')](_0x08ba('0x75'),_0x2c19d9['uniqueid'],_0x34e7a7,_[_0x08ba('0x72')](_0x2c19d9['variable'])[0x0],_0x2c19d9[_0x08ba('0x74')]);if(_[_0x08ba('0x25')](this[_0x08ba('0xa')][_0x2c19d9[_0x08ba('0x28')]][_0x34e7a7][_0x08ba('0xe')])){this['channels'][_0x2c19d9[_0x08ba('0x28')]][_0x34e7a7][_0x08ba('0xe')]={};}this['channels'][_0x2c19d9[_0x08ba('0x28')]][_0x34e7a7][_0x08ba('0xe')]=this['variables'][_0x2c19d9[_0x08ba('0x28')]];}}}}}catch(_0x376807){logger['error'](_0x08ba('0x76'),_0x2c19d9['uniqueid'],util[_0x08ba('0x2d')](_0x376807,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x08ba('0x23')]['addVariable']=function(_0x524a42,_0x39cc8c,_0x25e5db){var _0x15ae05=[_0x08ba('0x77'),_0x08ba('0x78'),_0x08ba('0x79'),'rtpaudioqosjitterbridged',_0x08ba('0x7a'),'rtpaudioqoslossbridged',_0x08ba('0x7b'),'rtpaudioqosrttbridged',_0x08ba('0x7c'),'sipuri','bridgepeer',_0x08ba('0x7d'),'membercalls','memberdynamic',_0x08ba('0x7e'),'memberlastcall',_0x08ba('0x29'),'memberpenalty',_0x08ba('0x7f')];if(!_[_0x08ba('0x80')](_0x39cc8c)&&!_[_0x08ba('0x81')](_0x15ae05,_0x39cc8c)){if(_[_0x08ba('0x25')](this['variables'][_0x524a42])){this['variables'][_0x524a42]={};}this[_0x08ba('0xe')][_0x524a42][_0x39cc8c]=_0x25e5db;}};VoiceAgentReport[_0x08ba('0x23')]['syncHangup']=function(_0x9861f2){try{if(this[_0x08ba('0x3d')](_0x9861f2)){logger[_0x08ba('0x2b')](_0x08ba('0x82'),_0x9861f2[_0x08ba('0x28')],util['inspect'](_0x9861f2,{'showHidden':![],'depth':null}));if(this[_0x08ba('0xa')][_0x9861f2[_0x08ba('0x28')]]){for(var _0x5626c1 in this[_0x08ba('0xa')][_0x9861f2[_0x08ba('0x28')]]){if(this[_0x08ba('0xa')][_0x9861f2[_0x08ba('0x28')]][_0x08ba('0x3f')](_0x5626c1)){if(this[_0x08ba('0xa')][_0x9861f2['uniqueid']][_0x5626c1]['reason']==_0x08ba('0x67')&&this[_0x08ba('0xa')][_0x9861f2[_0x08ba('0x28')]][_0x5626c1][_0x08ba('0x17')]){logger[_0x08ba('0x26')]('[%s][voiceAgentReport][hangup]\x20destuniqueid:%s',_0x9861f2[_0x08ba('0x28')],_0x5626c1);this[_0x08ba('0xa')][_0x9861f2['uniqueid']][_0x5626c1][_0x08ba('0x65')]=moment()[_0x08ba('0x2e')](_0x08ba('0x2f'));}}}logger[_0x08ba('0x2b')](_0x08ba('0x83'),_0x9861f2['uniqueid'],util[_0x08ba('0x2d')](_['values'](this[_0x08ba('0xa')][_0x9861f2[_0x08ba('0x28')]]),{'showHidden':![],'depth':null}));ami[_0x08ba('0x24')](_0x08ba('0x84'),_[_0x08ba('0x85')](this['channels'][_0x9861f2['uniqueid']]));delete this[_0x08ba('0xa')][_0x9861f2[_0x08ba('0x28')]];}if(this[_0x08ba('0xe')][_0x9861f2['uniqueid']]){delete this[_0x08ba('0xe')][_0x9861f2[_0x08ba('0x28')]];}}}catch(_0x427b2b){logger['error']('[%s][voiceAgentReport][hangup]',_0x9861f2[_0x08ba('0x28')],util[_0x08ba('0x2d')](_0x427b2b,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x08ba('0x21')]=function(_0x51ebf0){try{if(this[_0x08ba('0x3d')](_0x51ebf0)){logger[_0x08ba('0x2b')]('[%s][voiceAgentReport][attendedtransfer]\x20event:',_0x51ebf0[_0x08ba('0x28')],util[_0x08ba('0x2d')](_0x51ebf0,{'showHidden':![],'depth':null}));if(this[_0x08ba('0xa')][_0x51ebf0[_0x08ba('0x86')]]){for(var _0x5540bf in this[_0x08ba('0xa')][_0x51ebf0[_0x08ba('0x86')]]){if(this['channels'][_0x51ebf0[_0x08ba('0x86')]][_0x08ba('0x3f')](_0x5540bf)){if(_0x51ebf0[_0x08ba('0x87')]===_0x5540bf){logger[_0x08ba('0x26')](_0x08ba('0x88'),_0x51ebf0[_0x08ba('0x28')],this[_0x08ba('0xa')][_0x51ebf0[_0x08ba('0x86')]][_0x5540bf][_0x08ba('0x29')],_0x5540bf);var _0x45b560=moment();this[_0x08ba('0xa')][_0x51ebf0['transfereeuniqueid']][_0x5540bf]['agentcomplete']=!![];this[_0x08ba('0xa')][_0x51ebf0[_0x08ba('0x86')]][_0x5540bf][_0x08ba('0x65')]=moment()[_0x08ba('0x2e')](_0x08ba('0x2f'));this[_0x08ba('0xa')][_0x51ebf0[_0x08ba('0x86')]][_0x5540bf][_0x08ba('0x45')]=_0x08ba('0x66');this['channels'][_0x51ebf0['transfereeuniqueid']][_0x5540bf][_0x08ba('0x5b')]=_0x08ba('0x67');this[_0x08ba('0xa')][_0x51ebf0['transfereeuniqueid']][_0x5540bf]['talktime']=_0x45b560[_0x08ba('0x89')](this[_0x08ba('0xa')][_0x51ebf0[_0x08ba('0x86')]][_0x5540bf]['agentconnectAt'],_0x08ba('0x8a'));}}}}if(this[_0x08ba('0xa')][_0x51ebf0[_0x08ba('0x8b')]]){var _0x790c62=this[_0x08ba('0xa')][_0x51ebf0[_0x08ba('0x8b')]];this['channels'][_0x51ebf0[_0x08ba('0x8b')]]=this[_0x08ba('0xa')][_0x51ebf0[_0x08ba('0x86')]];this[_0x08ba('0xa')][_0x51ebf0[_0x08ba('0x86')]]=_0x790c62;}}}catch(_0x48d477){logger['error'](_0x08ba('0x8c'),_0x51ebf0[_0x08ba('0x28')],util[_0x08ba('0x2d')](_0x48d477,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x08ba('0x8d')]=function(_0x25de87){try{if(this[_0x08ba('0x3d')](_0x25de87)){logger[_0x08ba('0x2b')](_0x08ba('0x8e'),_0x25de87[_0x08ba('0x28')],util['inspect'](_0x25de87,{'showHidden':![],'depth':null}));if(this[_0x08ba('0xa')][_0x25de87[_0x08ba('0x86')]]){for(var _0x4f4b54 in this[_0x08ba('0xa')][_0x25de87[_0x08ba('0x86')]]){if(this[_0x08ba('0xa')][_0x25de87[_0x08ba('0x86')]][_0x08ba('0x3f')](_0x4f4b54)){if(_0x25de87[_0x08ba('0x8f')]===_0x4f4b54){logger[_0x08ba('0x26')](_0x08ba('0x90'),_0x25de87[_0x08ba('0x28')],this[_0x08ba('0xa')][_0x25de87[_0x08ba('0x86')]][_0x4f4b54][_0x08ba('0x29')],_0x4f4b54);var _0x104583=moment();this[_0x08ba('0xa')][_0x25de87[_0x08ba('0x86')]][_0x4f4b54]['agentcomplete']=!![];this[_0x08ba('0xa')][_0x25de87['transfereeuniqueid']][_0x4f4b54]['agentcompleteAt']=_0x104583;this[_0x08ba('0xa')][_0x25de87[_0x08ba('0x86')]][_0x4f4b54]['lastevent']=_0x08ba('0x66');this[_0x08ba('0xa')][_0x25de87['transfereeuniqueid']][_0x4f4b54][_0x08ba('0x5b')]=_0x08ba('0x67');this[_0x08ba('0xa')][_0x25de87['transfereeuniqueid']][_0x4f4b54][_0x08ba('0x69')]=_0x104583[_0x08ba('0x89')](this[_0x08ba('0xa')][_0x25de87['transfereeuniqueid']][_0x4f4b54]['agentconnectAt'],_0x08ba('0x8a'));}}}}}}catch(_0x11c57f){logger[_0x08ba('0x57')](_0x08ba('0x91'),_0x25de87[_0x08ba('0x28')],util[_0x08ba('0x2d')](_0x11c57f,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x08ba('0x23')]['syncMusicOnHoldStart']=function(_0x5d4c80){var _0x1b0489='';try{if(this[_0x08ba('0x3d')](_0x5d4c80)){logger['debug'](_0x08ba('0x92'),_0x5d4c80[_0x08ba('0x28')],util['inspect'](_0x5d4c80,{'showHidden':![],'depth':null}));if(_0x5d4c80[_0x08ba('0x93')]){_0x1b0489=_0x5d4c80[_0x08ba('0x93')][_0x08ba('0x94')](0x0,_0x5d4c80[_0x08ba('0x93')][_0x08ba('0x95')]('-'));if(this[_0x08ba('0xd')][_0x1b0489]){logger[_0x08ba('0x26')](_0x08ba('0x96'),_0x5d4c80['uniqueid'],_0x1b0489);this[_0x08ba('0xd')][_0x1b0489][_0x08ba('0x97')]=!![];}}}}catch(_0x1ba7df){logger['error'](_0x08ba('0x98'),_0x5d4c80[_0x08ba('0x28')],util['inspect'](_0x1ba7df,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x08ba('0x23')][_0x08ba('0x1f')]=function(_0x98fa71){var _0x3dd6a4='';try{if(this['isNotNull'](_0x98fa71)){logger[_0x08ba('0x2b')](_0x08ba('0x99'),_0x98fa71[_0x08ba('0x28')],util['inspect'](_0x98fa71,{'showHidden':![],'depth':null}));if(_0x98fa71['channel']){_0x3dd6a4=_0x98fa71[_0x08ba('0x93')][_0x08ba('0x94')](0x0,_0x98fa71[_0x08ba('0x93')][_0x08ba('0x95')]('-'));if(this[_0x08ba('0xd')][_0x3dd6a4]){logger[_0x08ba('0x26')]('[%s][voiceAgentReport][musiconholdstop]\x20interface:%s',_0x98fa71[_0x08ba('0x28')],_0x3dd6a4);this[_0x08ba('0xd')][_0x3dd6a4][_0x08ba('0x97')]=![];}}}}catch(_0x2e0a1e){logger[_0x08ba('0x57')](_0x08ba('0x9a'),_0x98fa71['uniqueid'],util[_0x08ba('0x2d')](_0x2e0a1e,{'showHidden':![],'depth':null}));}};module['exports']=VoiceAgentReport; \ No newline at end of file +var _0x3b40=['[%s][voiceAgentReport][musiconholdstop]\x20event:','[%s][voiceAgentReport][musiconholdstop]\x20interface:%s','[%s][voiceAgentReport][musiconholdstop]','exports','moment','util','ioredis','../../../config/environment','../../../config/logger','ami','../ami','redis','defaults','localhost','channels','voiceQueues','agents','variables','syncAgentCalled','bind','agentconnect','syncAgentConnect','agentringnoanswer','syncAgentRingNoAnswer','queuecallerabandon','agentcomplete','varset','hangup','syncHangup','musiconholdstart','syncMusicOnHoldStart','syncMusicOnHoldStop','syncAttendedTransfer','blindtransfer','prototype','emit','isNotNull','isUndefined','info','[%s][voiceAgentReport][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','uniqueid','membername','destuniqueid','debug','[%s][voiceAgentReport][agentcalled]\x20event:','inspect','YYYY-MM-DD\x20HH:mm:ss','called','queue','inbound','voice','omit','event','[%s][voiceAgentReport][agentcalled]\x20sending\x20agentcalled\x20event:','custom:agentcalled','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:called\x20event:','format','user:%s','user:called','error','[%s][voiceAgentReport][agentcalled]','hasOwnProperty','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','connectedlinename','connectedlinenum','destchannelstate','destchannelstatedesc','holdtime','connect','voiceChannels','routealias','merge','interface','pick','custom:agentconnect','[%s][voiceAgentReport][agentcalled]\x20sending\x20user:agentconnect\x20event:','user:agentconnect','[%s][voiceAgentReport][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:answered_elsewhere','agentringnoanswerAt','answeredelsewheredestinationuniqueid','answeredelsewheremembername','lastevent','reason','answered_elsewhere','[%s][voiceAgentReport][agentconnect]\x20sending\x20agentansweredelsewhere\x20event:','[%s][voiceAgentReport][agentringnoanswer]\x20event:','[%s][voiceAgentReport][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:rejected','rejected','[%s][voiceAgentReport][agentringnoanswer]\x20sending\x20agentringnoanswer\x20event:','custom:agentringnoanswer','syncQueueCallerAbandon','[%s][voiceAgentReport][queuecallerabandon]\x20event:','[%s][voiceAgentReport][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','abandoned','custom:agentqueuecallerabandon','[%s][voiceAgentReport][queuecallerabandon]','syncAgentComplete','[%s][voiceAgentReport][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','complete','agent','talktime','acw','acwTimeout','agentacw','custom:agentcomplete','[%s][voiceAgentReport][agentcomplete]\x20sending\x20user:agentcomplete\x20event:','user:agentcomplete','[%s][voiceAgentReport][agentcomplete]','syncVarSet','keys','value','[%s][voiceAgentReport][varset]\x20destuniqueid:%s\x20variable:%s\x20value:%s','addVariable','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberlastcall','memberrealtime','isNil','includes','[%s][voiceAgentReport][hangup]\x20event:','transfer','[%s][voiceAgentReport][hangup]\x20destuniqueid:%s','[%s][voiceAgentReport][hangup]\x20sending\x20voiceAgentReport\x20event:','values','custom:voiceAgentReport','[%s][voiceAgentReport][hangup]','[%s][voiceAgentReport][attendedtransfer]\x20event:','transfereeuniqueid','origtransfereruniqueid','[%s][voiceAgentReport][attendedtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','seconds','secondtransfereruniqueid','transfereruniqueid','[%s][voiceAgentReport][blindtransfer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','diff','[%s][voiceAgentReport][musiconholdstart]\x20event:','substring','channel','lastIndexOf','[%s][voiceAgentReport][musiconholdstart]\x20interface:%s','onhold','[%s][voiceAgentReport][musiconholdstart]'];(function(_0x56e386,_0x4b9b4b){var _0x1f9cee=function(_0x4795da){while(--_0x4795da){_0x56e386['push'](_0x56e386['shift']());}};_0x1f9cee(++_0x4b9b4b);}(_0x3b40,0x13a));var _0x03b4=function(_0x4a5c98,_0x1422e3){_0x4a5c98=_0x4a5c98-0x0;var _0x13b325=_0x3b40[_0x4a5c98];return _0x13b325;};'use strict';var _=require('lodash');var moment=require(_0x03b4('0x0'));var util=require(_0x03b4('0x1'));var Redis=require(_0x03b4('0x2'));var config=require(_0x03b4('0x3'));var logger=require(_0x03b4('0x4'))(_0x03b4('0x5'));var ami=require(_0x03b4('0x6'));config[_0x03b4('0x7')]=_[_0x03b4('0x8')](config['redis'],{'host':_0x03b4('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x03b4('0x7')]));function VoiceAgentReport(_0x580bb9){this[_0x03b4('0xa')]={};this['voiceChannels']=_0x580bb9[_0x03b4('0xa')];this['voiceQueues']=_0x580bb9[_0x03b4('0xb')];this[_0x03b4('0xc')]=_0x580bb9['agents'];this[_0x03b4('0xd')]={};ami['on']('agentcalled',this[_0x03b4('0xe')][_0x03b4('0xf')](this));ami['on'](_0x03b4('0x10'),this[_0x03b4('0x11')][_0x03b4('0xf')](this));ami['on'](_0x03b4('0x12'),this[_0x03b4('0x13')][_0x03b4('0xf')](this));ami['on'](_0x03b4('0x14'),this['syncQueueCallerAbandon'][_0x03b4('0xf')](this));ami['on'](_0x03b4('0x15'),this['syncAgentComplete'][_0x03b4('0xf')](this));ami['on'](_0x03b4('0x16'),this['syncVarSet']['bind'](this));ami['on'](_0x03b4('0x17'),this[_0x03b4('0x18')][_0x03b4('0xf')](this));ami['on'](_0x03b4('0x19'),this[_0x03b4('0x1a')][_0x03b4('0xf')](this));ami['on']('musiconholdstop',this[_0x03b4('0x1b')]['bind'](this));ami['on']('attendedtransfer',this[_0x03b4('0x1c')][_0x03b4('0xf')](this));ami['on'](_0x03b4('0x1d'),this['syncBlindTransfer'][_0x03b4('0xf')](this));}VoiceAgentReport[_0x03b4('0x1e')]['emit']=function(_0xc10a0f,_0x3dccd1,_0x2d0f4b){io['to'](_0xc10a0f)[_0x03b4('0x1f')](_0x3dccd1,_0x2d0f4b);};VoiceAgentReport[_0x03b4('0x1e')][_0x03b4('0x20')]=function(_0x3bc69f){return _0x3bc69f!==null&&!_[_0x03b4('0x21')](_0x3bc69f);};VoiceAgentReport[_0x03b4('0x1e')][_0x03b4('0xe')]=function(_0x2a9888){try{if(this[_0x03b4('0x20')](_0x2a9888)){logger[_0x03b4('0x22')](_0x03b4('0x23'),_0x2a9888[_0x03b4('0x24')],_0x2a9888[_0x03b4('0x25')],_0x2a9888[_0x03b4('0x26')]);logger[_0x03b4('0x27')](_0x03b4('0x28'),_0x2a9888['uniqueid'],util[_0x03b4('0x29')](_0x2a9888,{'showHidden':![],'depth':null}));if(_[_0x03b4('0x21')](this['channels'][_0x2a9888[_0x03b4('0x24')]])){this[_0x03b4('0xa')][_0x2a9888[_0x03b4('0x24')]]={};}if(_[_0x03b4('0x21')](this[_0x03b4('0xa')][_0x2a9888[_0x03b4('0x24')]][_0x2a9888['destuniqueid']])){this[_0x03b4('0xa')][_0x2a9888['uniqueid']][_0x2a9888['destuniqueid']]={'agentcalledAt':moment()['format'](_0x03b4('0x2a')),'lastevent':_0x03b4('0x2b'),'mandatoryDisposition':this[_0x03b4('0xb')][_0x2a9888['queue']]?this['voiceQueues'][_0x2a9888[_0x03b4('0x2c')]]['mandatoryDisposition']||![]:![],'type':this[_0x03b4('0xb')][_0x2a9888[_0x03b4('0x2c')]]?this[_0x03b4('0xb')][_0x2a9888['queue']]['type']||_0x03b4('0x2d'):_0x03b4('0x2d'),'variables':this['variables'][_0x2a9888[_0x03b4('0x24')]],'motionChannel':_0x03b4('0x2e')};}_['merge'](this[_0x03b4('0xa')][_0x2a9888['uniqueid']][_0x2a9888[_0x03b4('0x26')]],_[_0x03b4('0x2f')](_0x2a9888,[_0x03b4('0x30'),'privilege']));logger[_0x03b4('0x27')](_0x03b4('0x31'),_0x2a9888[_0x03b4('0x24')],util[_0x03b4('0x29')](this[_0x03b4('0xa')][_0x2a9888['uniqueid']][_0x2a9888['destuniqueid']],{'showHidden':![],'depth':null}));ami[_0x03b4('0x1f')](_0x03b4('0x32'),this['channels'][_0x2a9888['uniqueid']][_0x2a9888[_0x03b4('0x26')]]);logger[_0x03b4('0x27')](_0x03b4('0x33'),_0x2a9888[_0x03b4('0x24')],util[_0x03b4('0x29')](this[_0x03b4('0xa')][_0x2a9888['uniqueid']][_0x2a9888[_0x03b4('0x26')]],{'showHidden':![],'depth':null}));this[_0x03b4('0x1f')](util[_0x03b4('0x34')](_0x03b4('0x35'),_0x2a9888[_0x03b4('0x25')]),_0x03b4('0x36'),this[_0x03b4('0xa')][_0x2a9888['uniqueid']][_0x2a9888[_0x03b4('0x26')]]);}}catch(_0x5cb6e9){logger[_0x03b4('0x37')](_0x03b4('0x38'),_0x2a9888['uniqueid'],util[_0x03b4('0x29')](_0x5cb6e9,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x03b4('0x1e')]['syncAgentConnect']=function(_0x1d5056){try{if(this['isNotNull'](_0x1d5056)){if(this['channels'][_0x1d5056[_0x03b4('0x24')]]){logger[_0x03b4('0x27')]('[%s][voiceAgentReport][agentconnect]\x20event:',_0x1d5056[_0x03b4('0x24')],util['inspect'](_0x1d5056,{'showHidden':![],'depth':null}));for(var _0xcbe575 in this[_0x03b4('0xa')][_0x1d5056['uniqueid']]){if(this['channels'][_0x1d5056[_0x03b4('0x24')]][_0x03b4('0x39')](_0xcbe575)){if(_0x1d5056[_0x03b4('0x26')]===_0xcbe575){logger[_0x03b4('0x22')](_0x03b4('0x3a'),_0x1d5056[_0x03b4('0x24')],_0x1d5056['membername'],_0x1d5056[_0x03b4('0x26')]);this[_0x03b4('0xa')][_0x1d5056[_0x03b4('0x24')]][_0xcbe575][_0x03b4('0x3b')]=moment()[_0x03b4('0x34')](_0x03b4('0x2a'));this[_0x03b4('0xa')][_0x1d5056[_0x03b4('0x24')]][_0xcbe575][_0x03b4('0x3c')]=_0x1d5056['connectedlinename'];this[_0x03b4('0xa')][_0x1d5056[_0x03b4('0x24')]][_0xcbe575]['connectedlinenum']=_0x1d5056[_0x03b4('0x3d')];this[_0x03b4('0xa')][_0x1d5056['uniqueid']][_0xcbe575][_0x03b4('0x3e')]=_0x1d5056[_0x03b4('0x3e')];this[_0x03b4('0xa')][_0x1d5056[_0x03b4('0x24')]][_0xcbe575][_0x03b4('0x3f')]=_0x1d5056[_0x03b4('0x3f')];this['channels'][_0x1d5056[_0x03b4('0x24')]][_0xcbe575][_0x03b4('0x40')]=_0x1d5056[_0x03b4('0x40')];this[_0x03b4('0xa')][_0x1d5056[_0x03b4('0x24')]][_0xcbe575]['lastevent']=_0x03b4('0x41');if(this[_0x03b4('0x42')][this[_0x03b4('0xa')][_0x1d5056[_0x03b4('0x24')]][_0xcbe575][_0x03b4('0x24')]]){var _0x475987=this[_0x03b4('0x42')][this['channels'][_0x1d5056[_0x03b4('0x24')]][_0xcbe575][_0x03b4('0x24')]]['routealias'];this[_0x03b4('0xa')][_0x1d5056['uniqueid']][_0xcbe575][_0x03b4('0x43')]=_0x475987;_0x1d5056[_0x03b4('0x43')]=_0x475987;}_[_0x03b4('0x44')](this['agents'][_0x1d5056[_0x03b4('0x45')]],_[_0x03b4('0x46')](_0x1d5056,[_0x03b4('0x2c'),'destconnectedlinenum',_0x03b4('0x43')]));logger[_0x03b4('0x27')]('[%s][voiceAgentReport][agentconnect]\x20sending\x20agentconnect\x20event:',_0x1d5056[_0x03b4('0x24')],util['inspect'](this['channels'][_0x1d5056[_0x03b4('0x24')]][_0x1d5056[_0x03b4('0x26')]],{'showHidden':![],'depth':null}));ami['emit'](_0x03b4('0x47'),this[_0x03b4('0xa')][_0x1d5056['uniqueid']][_0x1d5056['destuniqueid']]);logger[_0x03b4('0x27')](_0x03b4('0x48'),_0x1d5056[_0x03b4('0x24')],util[_0x03b4('0x29')](this[_0x03b4('0xa')][_0x1d5056[_0x03b4('0x24')]][_0x1d5056[_0x03b4('0x26')]],{'showHidden':![],'depth':null}));this['emit'](util['format'](_0x03b4('0x35'),_0x1d5056['membername']),_0x03b4('0x49'),this[_0x03b4('0xa')][_0x1d5056['uniqueid']][_0x1d5056[_0x03b4('0x26')]]);}else if(!this[_0x03b4('0xa')][_0x1d5056['uniqueid']][_0xcbe575]['agentringnoanswer']&&!this['channels'][_0x1d5056[_0x03b4('0x24')]][_0xcbe575][_0x03b4('0x15')]){logger[_0x03b4('0x22')](_0x03b4('0x4a'),_0x1d5056['uniqueid'],this[_0x03b4('0xa')][_0x1d5056['uniqueid']][_0xcbe575][_0x03b4('0x25')],_0xcbe575);this[_0x03b4('0xa')][_0x1d5056['uniqueid']][_0xcbe575][_0x03b4('0x12')]=!![];this[_0x03b4('0xa')][_0x1d5056[_0x03b4('0x24')]][_0xcbe575][_0x03b4('0x4b')]=moment()[_0x03b4('0x34')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x03b4('0xa')][_0x1d5056[_0x03b4('0x24')]][_0xcbe575][_0x03b4('0x4c')]=_0x1d5056['destuniqueid'];this[_0x03b4('0xa')][_0x1d5056[_0x03b4('0x24')]][_0xcbe575][_0x03b4('0x4d')]=_0x1d5056['membername'];this[_0x03b4('0xa')][_0x1d5056[_0x03b4('0x24')]][_0xcbe575][_0x03b4('0x4e')]='answered_elsewhere';this['channels'][_0x1d5056[_0x03b4('0x24')]][_0xcbe575][_0x03b4('0x4f')]=_0x03b4('0x50');logger[_0x03b4('0x27')](_0x03b4('0x51'),_0x1d5056['uniqueid'],util[_0x03b4('0x29')](this[_0x03b4('0xa')][_0x1d5056[_0x03b4('0x24')]][_0xcbe575],{'showHidden':![],'depth':null}));ami['emit']('custom:agentansweredelsewhere',this[_0x03b4('0xa')][_0x1d5056[_0x03b4('0x24')]][_0xcbe575]);}}}}}}catch(_0xd81ac9){logger[_0x03b4('0x37')]('[%s][voiceAgentReport][agentconnect]',_0x1d5056[_0x03b4('0x24')],util['inspect'](_0xd81ac9,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x03b4('0x1e')]['syncAgentRingNoAnswer']=function(_0x4eca66){try{if(this['isNotNull'](_0x4eca66)){logger[_0x03b4('0x27')](_0x03b4('0x52'),_0x4eca66[_0x03b4('0x24')],util['inspect'](_0x4eca66,{'showHidden':![],'depth':null}));if(this[_0x03b4('0xa')][_0x4eca66['uniqueid']]&&this[_0x03b4('0xa')][_0x4eca66[_0x03b4('0x24')]][_0x4eca66[_0x03b4('0x26')]]){logger['info'](_0x03b4('0x53'),_0x4eca66[_0x03b4('0x24')],_0x4eca66['membername'],_0x4eca66[_0x03b4('0x26')]);this[_0x03b4('0xa')][_0x4eca66[_0x03b4('0x24')]][_0x4eca66[_0x03b4('0x26')]][_0x03b4('0x12')]=!![];this[_0x03b4('0xa')][_0x4eca66[_0x03b4('0x24')]][_0x4eca66['destuniqueid']][_0x03b4('0x4b')]=moment()[_0x03b4('0x34')](_0x03b4('0x2a'));this[_0x03b4('0xa')][_0x4eca66[_0x03b4('0x24')]][_0x4eca66[_0x03b4('0x26')]]['lastevent']=_0x03b4('0x54');this[_0x03b4('0xa')][_0x4eca66['uniqueid']][_0x4eca66[_0x03b4('0x26')]][_0x03b4('0x4f')]=_0x03b4('0x54');logger[_0x03b4('0x27')](_0x03b4('0x55'),_0x4eca66[_0x03b4('0x24')],util[_0x03b4('0x29')](this[_0x03b4('0xa')][_0x4eca66[_0x03b4('0x24')]][_0x4eca66[_0x03b4('0x26')]],{'showHidden':![],'depth':null}));ami[_0x03b4('0x1f')](_0x03b4('0x56'),this['channels'][_0x4eca66[_0x03b4('0x24')]][_0x4eca66[_0x03b4('0x26')]]);}}}catch(_0x328aa3){logger[_0x03b4('0x37')]('[%s][voiceAgentReport][agentringnoanswer]',_0x4eca66['uniqueid'],util[_0x03b4('0x29')](_0x328aa3,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x03b4('0x1e')][_0x03b4('0x57')]=function(_0x52a1dd){try{if(this[_0x03b4('0x20')](_0x52a1dd)){logger['debug'](_0x03b4('0x58'),_0x52a1dd[_0x03b4('0x24')],util[_0x03b4('0x29')](_0x52a1dd,{'showHidden':![],'depth':null}));if(this['channels'][_0x52a1dd[_0x03b4('0x24')]]){for(var _0x54a791 in this[_0x03b4('0xa')][_0x52a1dd[_0x03b4('0x24')]]){if(this[_0x03b4('0xa')][_0x52a1dd[_0x03b4('0x24')]]['hasOwnProperty'](_0x54a791)&&!this[_0x03b4('0xa')][_0x52a1dd[_0x03b4('0x24')]][_0x54a791][_0x03b4('0x12')]&&!this['channels'][_0x52a1dd[_0x03b4('0x24')]][_0x54a791]['agentcomplete']){logger[_0x03b4('0x22')](_0x03b4('0x59'),_0x52a1dd[_0x03b4('0x24')],this[_0x03b4('0xa')][_0x52a1dd[_0x03b4('0x24')]][_0x54a791][_0x03b4('0x25')],_0x54a791);this[_0x03b4('0xa')][_0x52a1dd['uniqueid']][_0x54a791][_0x03b4('0x12')]=!![];this[_0x03b4('0xa')][_0x52a1dd[_0x03b4('0x24')]][_0x54a791]['agentringnoanswerAt']=moment()[_0x03b4('0x34')](_0x03b4('0x2a'));this[_0x03b4('0xa')][_0x52a1dd[_0x03b4('0x24')]][_0x54a791][_0x03b4('0x4e')]=_0x03b4('0x5a');this[_0x03b4('0xa')][_0x52a1dd[_0x03b4('0x24')]][_0x54a791][_0x03b4('0x4f')]=_0x03b4('0x5a');logger[_0x03b4('0x27')]('[%s][voiceAgentReport][queuecallerabandon]\x20sending\x20agentqueuecallerabandon\x20event:',_0x52a1dd[_0x03b4('0x24')],util[_0x03b4('0x29')](this['channels'][_0x52a1dd[_0x03b4('0x24')]][_0x54a791],{'showHidden':![],'depth':null}));ami['emit'](_0x03b4('0x5b'),this[_0x03b4('0xa')][_0x52a1dd[_0x03b4('0x24')]][_0x54a791]);}}}}}catch(_0x20b857){logger[_0x03b4('0x37')](_0x03b4('0x5c'),_0x52a1dd[_0x03b4('0x24')],util[_0x03b4('0x29')](_0x20b857,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x03b4('0x1e')][_0x03b4('0x5d')]=function(_0x457e8c){try{if(this['isNotNull'](_0x457e8c)){logger[_0x03b4('0x27')]('[%s][voiceAgentReport][agentcomplete]\x20event:',_0x457e8c[_0x03b4('0x24')],util['inspect'](_0x457e8c,{'showHidden':![],'depth':null}));if(this['channels'][_0x457e8c[_0x03b4('0x24')]]){for(var _0x548bd8 in this['channels'][_0x457e8c['uniqueid']]){if(this[_0x03b4('0xa')][_0x457e8c[_0x03b4('0x24')]][_0x03b4('0x39')](_0x548bd8)){if(this[_0x03b4('0xa')][_0x457e8c[_0x03b4('0x24')]][_0x548bd8][_0x03b4('0x3b')]&&!this[_0x03b4('0xa')][_0x457e8c[_0x03b4('0x24')]][_0x548bd8][_0x03b4('0x15')]){logger['info'](_0x03b4('0x5e'),_0x457e8c[_0x03b4('0x24')],this[_0x03b4('0xa')][_0x457e8c['uniqueid']][_0x548bd8][_0x03b4('0x25')],_0x548bd8);this[_0x03b4('0xa')][_0x457e8c['uniqueid']][_0x548bd8]['agentcomplete']=!![];this[_0x03b4('0xa')][_0x457e8c[_0x03b4('0x24')]][_0x548bd8][_0x03b4('0x5f')]=moment()[_0x03b4('0x34')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x03b4('0xa')][_0x457e8c[_0x03b4('0x24')]][_0x548bd8][_0x03b4('0x4e')]=_0x03b4('0x60');this[_0x03b4('0xa')][_0x457e8c[_0x03b4('0x24')]][_0x548bd8][_0x03b4('0x4f')]=_0x457e8c[_0x03b4('0x4f')]=='transfer'?_0x03b4('0x61'):_0x457e8c['reason'];this[_0x03b4('0xa')][_0x457e8c[_0x03b4('0x24')]][_0x548bd8][_0x03b4('0x62')]=_0x457e8c[_0x03b4('0x62')];if(this[_0x03b4('0xb')][_0x457e8c['queue']]&&this['voiceQueues'][_0x457e8c[_0x03b4('0x2c')]][_0x03b4('0x63')]){this[_0x03b4('0xa')][_0x457e8c[_0x03b4('0x24')]][_0x548bd8]['acwtime']=this[_0x03b4('0xb')][_0x457e8c[_0x03b4('0x2c')]][_0x03b4('0x64')];this[_0x03b4('0xa')][_0x457e8c[_0x03b4('0x24')]][_0x548bd8][_0x03b4('0x65')]=!![];}this[_0x03b4('0xc')][_0x457e8c[_0x03b4('0x45')]]=_[_0x03b4('0x2f')](this[_0x03b4('0xc')][_0x457e8c[_0x03b4('0x45')]],[_0x03b4('0x2c'),'destconnectedlinenum']);logger[_0x03b4('0x27')]('[%s][voiceAgentReport][agentcomplete]\x20sending\x20agentcomplete\x20event:',_0x457e8c[_0x03b4('0x24')],util[_0x03b4('0x29')](this[_0x03b4('0xa')][_0x457e8c[_0x03b4('0x24')]][_0x548bd8],{'showHidden':![],'depth':null}));ami[_0x03b4('0x1f')](_0x03b4('0x66'),this[_0x03b4('0xa')][_0x457e8c[_0x03b4('0x24')]][_0x548bd8]);logger[_0x03b4('0x27')](_0x03b4('0x67'),_0x457e8c[_0x03b4('0x24')],util[_0x03b4('0x29')](this[_0x03b4('0xa')][_0x457e8c[_0x03b4('0x24')]][_0x548bd8],{'showHidden':![],'depth':null}));this[_0x03b4('0x1f')](util[_0x03b4('0x34')]('user:%s',_0x457e8c[_0x03b4('0x25')]),_0x03b4('0x68'),this[_0x03b4('0xa')][_0x457e8c['uniqueid']][_0x548bd8]);}}}}}}catch(_0x6ea9cf){logger[_0x03b4('0x37')](_0x03b4('0x69'),_0x457e8c[_0x03b4('0x24')],util[_0x03b4('0x29')](_0x6ea9cf,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x03b4('0x1e')][_0x03b4('0x6a')]=function(_0x119dfd){try{if(this['isNotNull'](_0x119dfd)){logger[_0x03b4('0x27')]('[%s][voiceAgentReport][varset]\x20event:',_0x119dfd[_0x03b4('0x24')],util[_0x03b4('0x29')](_0x119dfd,{'showHidden':![],'depth':null}));this['addVariable'](_0x119dfd[_0x03b4('0x24')],_[_0x03b4('0x6b')](_0x119dfd['variable'])[0x0],_0x119dfd[_0x03b4('0x6c')]);if(this[_0x03b4('0xa')][_0x119dfd[_0x03b4('0x24')]]){for(var _0x16c4c7 in this[_0x03b4('0xa')][_0x119dfd[_0x03b4('0x24')]]){if(this[_0x03b4('0xa')][_0x119dfd[_0x03b4('0x24')]][_0x03b4('0x39')](_0x16c4c7)){logger[_0x03b4('0x22')](_0x03b4('0x6d'),_0x119dfd[_0x03b4('0x24')],_0x16c4c7,_[_0x03b4('0x6b')](_0x119dfd['variable'])[0x0],_0x119dfd['value']);if(_[_0x03b4('0x21')](this[_0x03b4('0xa')][_0x119dfd['uniqueid']][_0x16c4c7][_0x03b4('0xd')])){this[_0x03b4('0xa')][_0x119dfd[_0x03b4('0x24')]][_0x16c4c7]['variables']={};}this[_0x03b4('0xa')][_0x119dfd[_0x03b4('0x24')]][_0x16c4c7]['variables']=this['variables'][_0x119dfd[_0x03b4('0x24')]];}}}}}catch(_0x41a7e6){logger['error']('[%s][voiceAgentReport][varset]',_0x119dfd[_0x03b4('0x24')],util[_0x03b4('0x29')](_0x41a7e6,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x03b4('0x1e')][_0x03b4('0x6e')]=function(_0x22cc59,_0x539c9e,_0x1c81e7){var _0x47eae3=['rtpaudioqos',_0x03b4('0x6f'),_0x03b4('0x70'),_0x03b4('0x71'),_0x03b4('0x72'),_0x03b4('0x73'),_0x03b4('0x74'),_0x03b4('0x75'),_0x03b4('0x76'),'sipuri',_0x03b4('0x77'),_0x03b4('0x78'),_0x03b4('0x79'),_0x03b4('0x7a'),_0x03b4('0x7b'),_0x03b4('0x7c'),'membername','memberpenalty',_0x03b4('0x7d')];if(!_[_0x03b4('0x7e')](_0x539c9e)&&!_[_0x03b4('0x7f')](_0x47eae3,_0x539c9e)){if(_[_0x03b4('0x21')](this[_0x03b4('0xd')][_0x22cc59])){this[_0x03b4('0xd')][_0x22cc59]={};}this[_0x03b4('0xd')][_0x22cc59][_0x539c9e]=_0x1c81e7;}};VoiceAgentReport[_0x03b4('0x1e')]['syncHangup']=function(_0x1c5943){try{if(this[_0x03b4('0x20')](_0x1c5943)){logger[_0x03b4('0x27')](_0x03b4('0x80'),_0x1c5943[_0x03b4('0x24')],util[_0x03b4('0x29')](_0x1c5943,{'showHidden':![],'depth':null}));if(this[_0x03b4('0xa')][_0x1c5943[_0x03b4('0x24')]]){for(var _0x3e2ea8 in this[_0x03b4('0xa')][_0x1c5943[_0x03b4('0x24')]]){if(this[_0x03b4('0xa')][_0x1c5943['uniqueid']]['hasOwnProperty'](_0x3e2ea8)){if(this[_0x03b4('0xa')][_0x1c5943[_0x03b4('0x24')]][_0x3e2ea8][_0x03b4('0x4f')]==_0x03b4('0x81')&&this[_0x03b4('0xa')][_0x1c5943[_0x03b4('0x24')]][_0x3e2ea8][_0x03b4('0x15')]){logger['info'](_0x03b4('0x82'),_0x1c5943[_0x03b4('0x24')],_0x3e2ea8);this[_0x03b4('0xa')][_0x1c5943[_0x03b4('0x24')]][_0x3e2ea8][_0x03b4('0x5f')]=moment()['format'](_0x03b4('0x2a'));}}}logger[_0x03b4('0x27')](_0x03b4('0x83'),_0x1c5943[_0x03b4('0x24')],util[_0x03b4('0x29')](_[_0x03b4('0x84')](this[_0x03b4('0xa')][_0x1c5943['uniqueid']]),{'showHidden':![],'depth':null}));ami[_0x03b4('0x1f')](_0x03b4('0x85'),_['values'](this[_0x03b4('0xa')][_0x1c5943[_0x03b4('0x24')]]));delete this[_0x03b4('0xa')][_0x1c5943[_0x03b4('0x24')]];}if(this[_0x03b4('0xd')][_0x1c5943[_0x03b4('0x24')]]){delete this[_0x03b4('0xd')][_0x1c5943[_0x03b4('0x24')]];}}}catch(_0x4f0ff9){logger[_0x03b4('0x37')](_0x03b4('0x86'),_0x1c5943['uniqueid'],util[_0x03b4('0x29')](_0x4f0ff9,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x03b4('0x1c')]=function(_0x2cf9f6){try{if(this[_0x03b4('0x20')](_0x2cf9f6)){logger[_0x03b4('0x27')](_0x03b4('0x87'),_0x2cf9f6[_0x03b4('0x24')],util[_0x03b4('0x29')](_0x2cf9f6,{'showHidden':![],'depth':null}));if(this['channels'][_0x2cf9f6['transfereeuniqueid']]){for(var _0x4fd1f5 in this[_0x03b4('0xa')][_0x2cf9f6[_0x03b4('0x88')]]){if(this[_0x03b4('0xa')][_0x2cf9f6['transfereeuniqueid']][_0x03b4('0x39')](_0x4fd1f5)){if(_0x2cf9f6[_0x03b4('0x89')]===_0x4fd1f5){logger[_0x03b4('0x22')](_0x03b4('0x8a'),_0x2cf9f6[_0x03b4('0x24')],this['channels'][_0x2cf9f6[_0x03b4('0x88')]][_0x4fd1f5][_0x03b4('0x25')],_0x4fd1f5);var _0x9b6ec3=moment();this['channels'][_0x2cf9f6[_0x03b4('0x88')]][_0x4fd1f5]['agentcomplete']=!![];this[_0x03b4('0xa')][_0x2cf9f6[_0x03b4('0x88')]][_0x4fd1f5][_0x03b4('0x5f')]=moment()['format'](_0x03b4('0x2a'));this[_0x03b4('0xa')][_0x2cf9f6[_0x03b4('0x88')]][_0x4fd1f5]['lastevent']=_0x03b4('0x60');this[_0x03b4('0xa')][_0x2cf9f6['transfereeuniqueid']][_0x4fd1f5][_0x03b4('0x4f')]=_0x03b4('0x81');this[_0x03b4('0xa')][_0x2cf9f6[_0x03b4('0x88')]][_0x4fd1f5][_0x03b4('0x62')]=_0x9b6ec3['diff'](this[_0x03b4('0xa')][_0x2cf9f6[_0x03b4('0x88')]][_0x4fd1f5][_0x03b4('0x3b')],_0x03b4('0x8b'));}}}}if(this[_0x03b4('0xa')][_0x2cf9f6[_0x03b4('0x8c')]]){var _0x1ee61e=this[_0x03b4('0xa')][_0x2cf9f6[_0x03b4('0x8c')]];this[_0x03b4('0xa')][_0x2cf9f6[_0x03b4('0x8c')]]=this['channels'][_0x2cf9f6[_0x03b4('0x88')]];this['channels'][_0x2cf9f6[_0x03b4('0x88')]]=_0x1ee61e;}}}catch(_0x2c5011){logger[_0x03b4('0x37')]('[%s][voiceAgentReport][attendedtransfer]',_0x2cf9f6['uniqueid'],util['inspect'](_0x2c5011,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype']['syncBlindTransfer']=function(_0x58491b){try{if(this[_0x03b4('0x20')](_0x58491b)){logger['debug']('[%s][voiceAgentReport][blindtransfer]\x20event:',_0x58491b[_0x03b4('0x24')],util['inspect'](_0x58491b,{'showHidden':![],'depth':null}));if(this[_0x03b4('0xa')][_0x58491b['transfereeuniqueid']]){for(var _0x41e824 in this[_0x03b4('0xa')][_0x58491b[_0x03b4('0x88')]]){if(this[_0x03b4('0xa')][_0x58491b[_0x03b4('0x88')]][_0x03b4('0x39')](_0x41e824)){if(_0x58491b[_0x03b4('0x8d')]===_0x41e824){logger[_0x03b4('0x22')](_0x03b4('0x8e'),_0x58491b[_0x03b4('0x24')],this[_0x03b4('0xa')][_0x58491b['transfereeuniqueid']][_0x41e824][_0x03b4('0x25')],_0x41e824);var _0x257119=moment();this['channels'][_0x58491b[_0x03b4('0x88')]][_0x41e824][_0x03b4('0x15')]=!![];this[_0x03b4('0xa')][_0x58491b[_0x03b4('0x88')]][_0x41e824][_0x03b4('0x5f')]=_0x257119;this[_0x03b4('0xa')][_0x58491b[_0x03b4('0x88')]][_0x41e824][_0x03b4('0x4e')]=_0x03b4('0x60');this[_0x03b4('0xa')][_0x58491b['transfereeuniqueid']][_0x41e824][_0x03b4('0x4f')]=_0x03b4('0x81');this[_0x03b4('0xa')][_0x58491b[_0x03b4('0x88')]][_0x41e824][_0x03b4('0x62')]=_0x257119[_0x03b4('0x8f')](this['channels'][_0x58491b[_0x03b4('0x88')]][_0x41e824][_0x03b4('0x3b')],_0x03b4('0x8b'));}}}}}}catch(_0x3a1726){logger[_0x03b4('0x37')]('[%s][voiceAgentReport][blindtransfer]',_0x58491b[_0x03b4('0x24')],util['inspect'](_0x3a1726,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x03b4('0x1a')]=function(_0x8e59d6){var _0x53cca1='';try{if(this[_0x03b4('0x20')](_0x8e59d6)){logger[_0x03b4('0x27')](_0x03b4('0x90'),_0x8e59d6[_0x03b4('0x24')],util[_0x03b4('0x29')](_0x8e59d6,{'showHidden':![],'depth':null}));if(_0x8e59d6['channel']){_0x53cca1=_0x8e59d6['channel'][_0x03b4('0x91')](0x0,_0x8e59d6[_0x03b4('0x92')][_0x03b4('0x93')]('-'));if(this[_0x03b4('0xc')][_0x53cca1]){logger[_0x03b4('0x22')](_0x03b4('0x94'),_0x8e59d6[_0x03b4('0x24')],_0x53cca1);this[_0x03b4('0xc')][_0x53cca1][_0x03b4('0x95')]=!![];}}}}catch(_0xd612b1){logger[_0x03b4('0x37')](_0x03b4('0x96'),_0x8e59d6[_0x03b4('0x24')],util[_0x03b4('0x29')](_0xd612b1,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x03b4('0x1e')][_0x03b4('0x1b')]=function(_0x589abd){var _0x30ff90='';try{if(this[_0x03b4('0x20')](_0x589abd)){logger[_0x03b4('0x27')](_0x03b4('0x97'),_0x589abd[_0x03b4('0x24')],util[_0x03b4('0x29')](_0x589abd,{'showHidden':![],'depth':null}));if(_0x589abd['channel']){_0x30ff90=_0x589abd[_0x03b4('0x92')][_0x03b4('0x91')](0x0,_0x589abd[_0x03b4('0x92')][_0x03b4('0x93')]('-'));if(this[_0x03b4('0xc')][_0x30ff90]){logger[_0x03b4('0x22')](_0x03b4('0x98'),_0x589abd[_0x03b4('0x24')],_0x30ff90);this['agents'][_0x30ff90][_0x03b4('0x95')]=![];}}}}catch(_0x3e0a04){logger[_0x03b4('0x37')](_0x03b4('0x99'),_0x589abd[_0x03b4('0x24')],util[_0x03b4('0x29')](_0x3e0a04,{'showHidden':![],'depth':null}));}};module[_0x03b4('0x9a')]=VoiceAgentReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceCallReport.js b/server/services/ami/report/voiceCallReport.js index 8a61ec3..e8699a1 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 _0xaa6f=['StopMixMonitor','catch','type','[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:','custom:voiceCallReport','[%s][voiceCallReport][hangup]','syncAttendedTransfer','[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','origtransferercalleridnum','transfertargetcalleridnum','[%s][voiceCallReport][attendedtransfer]\x20event:','transfereeuniqueid','transfercalleridnum','transferconnectedlinenum','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','origtransfererlinkedid','outbound','routeid','transferType','ATTENDED','[%s][voiceCallReport][attendedtransfer]','[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','transfereecalleridnum','extension','BLIND','BlindTransfer','transfererchannel','mohstarttime','[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceCallReport][musiconholdstart]','[%s][voiceCallReport][musiconholdstop]\x20event:','mohtime','milliseconds','[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s','[%s][voiceCallReport][musiconholdstop]','exports','moment','util','path','ioredis','ami','../ami','../rpc/setting','unknown','busy','invalid','unavailable','ringing','ringinuse','onhold','set','queue','agi','dial','playback','voicemail','NO\x20ANSWER','FAILED','ANSWERED','BUSY','redis','socket.io-emitter','channels','agents','blindTransfers','coreshowchannel','syncNewExten','bind','newchannel','newstate','syncNewState','varset','hangup','syncHangup','syncNewCallerId','attendedtransfer','blindtransfer','musiconholdstart','musiconholdstop','syncMusicOnHoldStop','info','[voiceCallReport][coreshowchannels]\x20started','actionCoreShowChannels','[voiceCallReport][coreshowchannels]','inspect','prototype','isNotNull','isUndefined','emit','[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s','uniqueid','calleridname','calleridnum','debug','[%s][voiceCallReport][newcallerid]\x20event:','linkedid','pick','keys','context','from-sip','channel','split','exten','xcally-motion-preview','destconnectedlinenum','format','user:%s','user:agentconnect','accountcode','connectedlinenum','OutgoingSpoolFailed','[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s','starttime','YYYY-MM-DD\x20HH:mm:ss','disposition','channelstate','merge','[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:','name','error','[%s][voiceCallReport][newchannel]','[%s][voiceCallReport][newexten]\x20event:','application','appdata','CDR(routeAlias)','applicationdata','[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s','duration','subtract','seconds','includes','lastapplication','lastdata','toLowerCase','cdr(','match','[%s][voiceCallReport][newexten]','[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s','answered','answertime','holdtime','diff','connectedlinename','destinationchannel','toNumber','UserId','membername','routealias','[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:','syncMixMonitorFilename','[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s','monitor','endsWith','.wav49','.WAV','find','monitors','isNil','rec','[%s][voiceCallReport][mixMonitorFilename]','syncVarSet','[%s][voiceCallReport][varset]\x20event:','variable','mixmonitor_filename','[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s','value','xmd-phone','[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s','xmd-callerid','[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s','xmd-cdrtype','[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s','xmd-queue','[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','originatecalleridnum','xmd-destination','[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s','destination','[%s][voiceCallReport][varset]\x20variable:xmd-callerid-preview\x20value:%s','calleridpreview','[%s][voiceCallReport][varset]\x20variable:xmcs-queue\x20value:%s','sipcallid','sipcalluniqueid','sipcalllinkedid','[%s][voiceCallReport][varset]','[%s][voiceCallReport][hangup]\x20event:','[%s][voiceCallReport][hangup]\x20reason:%s','billableseconds','omit','[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:','undefined','isEmpty','getSettings','then','stopRecordingOnTransfer','Action'];(function(_0x1a358c,_0x41c66a){var _0x3a42f3=function(_0x2715e3){while(--_0x2715e3){_0x1a358c['push'](_0x1a358c['shift']());}};_0x3a42f3(++_0x41c66a);}(_0xaa6f,0x1b2));var _0xfaa6=function(_0x1248e1,_0x12239f){_0x1248e1=_0x1248e1-0x0;var _0x121d4=_0xaa6f[_0x1248e1];return _0x121d4;};'use strict';var BPromise=require('bluebird');var _=require('lodash');var moment=require(_0xfaa6('0x0'));var util=require(_0xfaa6('0x1'));var path=require(_0xfaa6('0x2'));var Redis=require(_0xfaa6('0x3'));var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0xfaa6('0x4'));var ami=require(_0xfaa6('0x5'));var Channel=require('../model/channel');var RpcSetting=require(_0xfaa6('0x6'));var statusDesc=[_0xfaa6('0x7'),'not_inuse','inuse',_0xfaa6('0x8'),_0xfaa6('0x9'),_0xfaa6('0xa'),_0xfaa6('0xb'),_0xfaa6('0xc'),_0xfaa6('0xd')];var applications=[_0xfaa6('0xe'),_0xfaa6('0xf'),_0xfaa6('0x10'),_0xfaa6('0x11'),_0xfaa6('0x12'),_0xfaa6('0x13')];var dispositions=[_0xfaa6('0x14'),_0xfaa6('0x15'),_0xfaa6('0x15'),_0xfaa6('0x14'),_0xfaa6('0x14'),'NO\x20ANSWER',_0xfaa6('0x16'),_0xfaa6('0x17'),_0xfaa6('0x15'),_0xfaa6('0x15'),'FAILED'];var actions={};config['redis']=_['defaults'](config[_0xfaa6('0x18')],{'host':'localhost','port':0x18eb});var io=require(_0xfaa6('0x19'))(new Redis(config[_0xfaa6('0x18')]));function VoiceCallReport(_0x77fa9e){this[_0xfaa6('0x1a')]=_0x77fa9e[_0xfaa6('0x1a')];this[_0xfaa6('0x1b')]=_0x77fa9e['agents'];this[_0xfaa6('0x1c')]={};ami['on'](_0xfaa6('0x1d'),this[_0xfaa6('0x1e')][_0xfaa6('0x1f')](this));ami['on']('newexten',this[_0xfaa6('0x1e')]['bind'](this));ami['on'](_0xfaa6('0x20'),this['syncNewChannel'][_0xfaa6('0x1f')](this));ami['on'](_0xfaa6('0x21'),this[_0xfaa6('0x22')][_0xfaa6('0x1f')](this));ami['on'](_0xfaa6('0x23'),this['syncVarSet']['bind'](this));ami['on'](_0xfaa6('0x24'),this[_0xfaa6('0x25')][_0xfaa6('0x1f')](this));ami['on']('newcallerid',this[_0xfaa6('0x26')]['bind'](this));ami['on'](_0xfaa6('0x27'),this['syncAttendedTransfer'][_0xfaa6('0x1f')](this));ami['on'](_0xfaa6('0x28'),this['syncBlindTransfer']['bind'](this));ami['on'](_0xfaa6('0x29'),this['syncMusicOnHoldStart']['bind'](this));ami['on'](_0xfaa6('0x2a'),this[_0xfaa6('0x2b')][_0xfaa6('0x1f')](this));try{logger[_0xfaa6('0x2c')](_0xfaa6('0x2d'));ami[_0xfaa6('0x2e')]();}catch(_0x2943c9){logger['error'](_0xfaa6('0x2f'),util[_0xfaa6('0x30')](_0x2943c9,{'showHidden':![],'depth':null}));}}VoiceCallReport[_0xfaa6('0x31')][_0xfaa6('0x32')]=function(_0x106aa3){return _0x106aa3!==null&&!_[_0xfaa6('0x33')](_0x106aa3);};VoiceCallReport['prototype'][_0xfaa6('0x34')]=function(_0x2c89de,_0x910591,_0x278268){io['to'](_0x2c89de)[_0xfaa6('0x34')](_0x910591,_0x278268);};VoiceCallReport[_0xfaa6('0x31')][_0xfaa6('0x26')]=function(_0x2bab18){try{if(this['isNotNull'](_0x2bab18)){logger['info'](_0xfaa6('0x35'),_0x2bab18[_0xfaa6('0x36')],_0x2bab18[_0xfaa6('0x37')],_0x2bab18[_0xfaa6('0x38')]);logger[_0xfaa6('0x39')](_0xfaa6('0x3a'),_0x2bab18[_0xfaa6('0x36')],util[_0xfaa6('0x30')](_0x2bab18,{'showHidden':![],'depth':null}));if(_0x2bab18['uniqueid']===_0x2bab18[_0xfaa6('0x3b')]){if(!_[_0xfaa6('0x33')](this[_0xfaa6('0x1a')][_0x2bab18['uniqueid']])){_['merge'](this['channels'][_0x2bab18[_0xfaa6('0x36')]],_[_0xfaa6('0x3c')](_0x2bab18,_[_0xfaa6('0x3d')](this[_0xfaa6('0x1a')][_0x2bab18[_0xfaa6('0x36')]])));}}if(_0x2bab18[_0xfaa6('0x3e')]===_0xfaa6('0x3f')){if(this[_0xfaa6('0x1b')][_0x2bab18[_0xfaa6('0x40')][_0xfaa6('0x41')]('-')[0x0]]){if(_0x2bab18[_0xfaa6('0x42')]==_0xfaa6('0x43')){this[_0xfaa6('0x1b')][_0x2bab18[_0xfaa6('0x40')][_0xfaa6('0x41')]('-')[0x0]][_0xfaa6('0x44')]=_0x2bab18['connectedlinenum'];this[_0xfaa6('0x34')](util[_0xfaa6('0x45')](_0xfaa6('0x46'),this[_0xfaa6('0x1b')][_0x2bab18[_0xfaa6('0x40')]['split']('-')[0x0]]['name']),_0xfaa6('0x47'),{'destaccountcode':this['agents'][_0x2bab18[_0xfaa6('0x40')]['split']('-')[0x0]][_0xfaa6('0x48')],'destconnectedlinenum':_0x2bab18[_0xfaa6('0x49')]});}}}}}catch(_0x50b8e8){logger['error']('[%s][voiceCallReport][newcallerid]',_0x2bab18['uniqueid'],util[_0xfaa6('0x30')](_0x50b8e8,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype']['syncNewChannel']=function(_0xa2c53a){try{if(this[_0xfaa6('0x32')](_0xa2c53a)){logger[_0xfaa6('0x39')]('[%s][voiceCallReport][newchannel]\x20event:',_0xa2c53a[_0xfaa6('0x36')],util[_0xfaa6('0x30')](_0xa2c53a,{'showHidden':![],'depth':null}));if(_0xa2c53a['uniqueid']===_0xa2c53a[_0xfaa6('0x3b')]&&_0xa2c53a[_0xfaa6('0x40')]!=_0xfaa6('0x4a')){if(_[_0xfaa6('0x33')](this[_0xfaa6('0x1a')][_0xa2c53a['uniqueid']])){logger[_0xfaa6('0x2c')](_0xfaa6('0x4b'),_0xa2c53a[_0xfaa6('0x36')],_0xa2c53a['context'],_0xa2c53a[_0xfaa6('0x42')]);this[_0xfaa6('0x1a')][_0xa2c53a[_0xfaa6('0x36')]]=new Channel();this['channels'][_0xa2c53a['uniqueid']][_0xfaa6('0x4c')]=moment()[_0xfaa6('0x45')](_0xfaa6('0x4d'));this['channels'][_0xa2c53a['uniqueid']][_0xfaa6('0x4e')]=dispositions[_['toNumber'](_0xa2c53a[_0xfaa6('0x4f')])];_[_0xfaa6('0x50')](this[_0xfaa6('0x1a')][_0xa2c53a[_0xfaa6('0x36')]],_[_0xfaa6('0x3c')](_0xa2c53a,_['keys'](this[_0xfaa6('0x1a')][_0xa2c53a[_0xfaa6('0x36')]])));if(_0xa2c53a[_0xfaa6('0x3e')]==='from-sip'){if(this['agents'][_0xa2c53a[_0xfaa6('0x40')][_0xfaa6('0x41')]('-')[0x0]]){if(_[_0xfaa6('0x33')](this[_0xfaa6('0x1b')][_0xa2c53a['channel']['split']('-')[0x0]]['destconnectedlinenum'])){this[_0xfaa6('0x1b')][_0xa2c53a[_0xfaa6('0x40')][_0xfaa6('0x41')]('-')[0x0]][_0xfaa6('0x44')]=_0xa2c53a[_0xfaa6('0x42')];logger[_0xfaa6('0x39')](_0xfaa6('0x51'),_0xa2c53a['uniqueid'],util[_0xfaa6('0x30')]({'destaccountcode':this[_0xfaa6('0x1b')][_0xa2c53a['channel']['split']('-')[0x0]][_0xfaa6('0x48')],'destconnectedlinenum':_0xa2c53a[_0xfaa6('0x42')]},{'showHidden':![],'depth':null}));this[_0xfaa6('0x34')](util[_0xfaa6('0x45')]('user:%s',this[_0xfaa6('0x1b')][_0xa2c53a[_0xfaa6('0x40')]['split']('-')[0x0]][_0xfaa6('0x52')]),'user:agentconnect',{'destaccountcode':this[_0xfaa6('0x1b')][_0xa2c53a['channel'][_0xfaa6('0x41')]('-')[0x0]][_0xfaa6('0x48')],'destconnectedlinenum':_0xa2c53a[_0xfaa6('0x42')]});}}}}}}}catch(_0x4656e1){logger[_0xfaa6('0x53')](_0xfaa6('0x54'),_0xa2c53a[_0xfaa6('0x36')],util['inspect'](_0x4656e1,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xfaa6('0x31')][_0xfaa6('0x1e')]=function(_0x34e5de){try{if(this[_0xfaa6('0x32')](_0x34e5de)){logger[_0xfaa6('0x39')](_0xfaa6('0x55'),_0x34e5de['uniqueid'],util['inspect'](_0x34e5de,{'showHidden':![],'depth':null}));if(_0x34e5de[_0xfaa6('0x36')]===_0x34e5de[_0xfaa6('0x3b')]&&_0x34e5de[_0xfaa6('0x42')]!='h'&&_0x34e5de['channel']!=_0xfaa6('0x4a')){_0x34e5de[_0xfaa6('0x56')]=_0x34e5de['application']['toLowerCase']();_0x34e5de['applicationdata']=_0x34e5de[_0xfaa6('0x57')]&&_0x34e5de[_0xfaa6('0x57')]['startsWith'](_0xfaa6('0x58'))?_0x34e5de['appdata']:(_0x34e5de['appdata']||_0x34e5de[_0xfaa6('0x59')])['toLowerCase']();logger['info'](_0xfaa6('0x5a'),_0x34e5de['uniqueid'],_0x34e5de[_0xfaa6('0x56')],_0x34e5de[_0xfaa6('0x59')]);if(_[_0xfaa6('0x33')](this[_0xfaa6('0x1a')][_0x34e5de[_0xfaa6('0x36')]])){this[_0xfaa6('0x1a')][_0x34e5de[_0xfaa6('0x36')]]=new Channel();this['channels'][_0x34e5de[_0xfaa6('0x36')]][_0xfaa6('0x4c')]=_0x34e5de[_0xfaa6('0x5b')]?moment()[_0xfaa6('0x5c')](moment[_0xfaa6('0x5b')](_0x34e5de[_0xfaa6('0x5b')])[_0xfaa6('0x5d')](),_0xfaa6('0x5d'))[_0xfaa6('0x45')](_0xfaa6('0x4d')):moment()[_0xfaa6('0x45')](_0xfaa6('0x4d'));this[_0xfaa6('0x1a')][_0x34e5de[_0xfaa6('0x36')]][_0xfaa6('0x4e')]='NO\x20ANSWER';}_[_0xfaa6('0x50')](this[_0xfaa6('0x1a')][_0x34e5de[_0xfaa6('0x36')]],_[_0xfaa6('0x3c')](_0x34e5de,_['keys'](this[_0xfaa6('0x1a')][_0x34e5de[_0xfaa6('0x36')]])));if(_[_0xfaa6('0x5e')](applications,_0x34e5de[_0xfaa6('0x56')])){this[_0xfaa6('0x1a')][_0x34e5de[_0xfaa6('0x36')]][_0xfaa6('0x5f')]=_0x34e5de[_0xfaa6('0x56')];this[_0xfaa6('0x1a')][_0x34e5de[_0xfaa6('0x36')]][_0xfaa6('0x60')]=_0x34e5de[_0xfaa6('0x59')];if(_0x34e5de[_0xfaa6('0x56')]==='set'&&_['startsWith'](_0x34e5de['applicationdata'][_0xfaa6('0x61')](),_0xfaa6('0x62'))){var _0x252301=_0x34e5de[_0xfaa6('0x59')]['split']('=');var _0x44674b=_0x252301[0x0][_0xfaa6('0x61')]()[_0xfaa6('0x63')](/cdr\((.*)\)/);if(_0x44674b){this[_0xfaa6('0x1a')][_0x34e5de[_0xfaa6('0x36')]][_0x44674b[0x1]]=_0x252301[0x1];}}else if(_0x34e5de[_0xfaa6('0x56')]==='queue'){this[_0xfaa6('0x1a')][_0x34e5de[_0xfaa6('0x36')]][_0xfaa6('0xf')]=_0x34e5de[_0xfaa6('0x59')][_0xfaa6('0x41')](',')[0x0];}}}}}catch(_0x433a23){logger[_0xfaa6('0x53')](_0xfaa6('0x64'),_0x34e5de[_0xfaa6('0x36')],util[_0xfaa6('0x30')](_0x433a23,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xfaa6('0x31')][_0xfaa6('0x22')]=function(_0x33ec86){try{if(this[_0xfaa6('0x32')](_0x33ec86)){logger['info'](_0xfaa6('0x65'),_0x33ec86['uniqueid'],_0x33ec86[_0xfaa6('0x3b')],_0x33ec86[_0xfaa6('0x37')],_0x33ec86['calleridnum']);logger[_0xfaa6('0x39')]('[%s][voiceCallReport][newstate]\x20event:',_0x33ec86['uniqueid'],util[_0xfaa6('0x30')](_0x33ec86,{'showHidden':![],'depth':null}));if(_0x33ec86[_0xfaa6('0x36')]!==_0x33ec86[_0xfaa6('0x3b')]){if(this[_0xfaa6('0x1a')][_0x33ec86['linkedid']]){if(_0x33ec86[_0xfaa6('0x4f')]==='6'){if(!this[_0xfaa6('0x1a')][_0x33ec86[_0xfaa6('0x3b')]][_0xfaa6('0x66')]){var _0x3cd07c=moment();this[_0xfaa6('0x1a')][_0x33ec86[_0xfaa6('0x3b')]][_0xfaa6('0x66')]=!![];this[_0xfaa6('0x1a')][_0x33ec86[_0xfaa6('0x3b')]][_0xfaa6('0x67')]=_0x3cd07c[_0xfaa6('0x45')](_0xfaa6('0x4d'));if(this[_0xfaa6('0x1a')][_0x33ec86['linkedid']]['starttime']){this[_0xfaa6('0x1a')][_0x33ec86[_0xfaa6('0x3b')]][_0xfaa6('0x68')]=_0x3cd07c[_0xfaa6('0x69')](this[_0xfaa6('0x1a')][_0x33ec86['linkedid']][_0xfaa6('0x4c')],_0xfaa6('0x5d'));}}this[_0xfaa6('0x1a')][_0x33ec86['linkedid']][_0xfaa6('0x3b')]=_0x33ec86['uniqueid'];if(_0x33ec86[_0xfaa6('0x38')]!==_0xfaa6('0x43')){this[_0xfaa6('0x1a')][_0x33ec86['linkedid']][_0xfaa6('0x49')]=_0x33ec86['calleridnum'];}this['channels'][_0x33ec86[_0xfaa6('0x3b')]][_0xfaa6('0x6a')]=_0x33ec86[_0xfaa6('0x37')];this['channels'][_0x33ec86[_0xfaa6('0x3b')]][_0xfaa6('0x6b')]=_0x33ec86[_0xfaa6('0x40')];this[_0xfaa6('0x1a')][_0x33ec86['linkedid']][_0xfaa6('0x4e')]=dispositions[_[_0xfaa6('0x6c')](_0x33ec86[_0xfaa6('0x4f')])];if(this[_0xfaa6('0x1b')][_0x33ec86[_0xfaa6('0x40')]['split']('-')[0x0]]){this['channels'][_0x33ec86['linkedid']][_0xfaa6('0x6d')]=this['agents'][_0x33ec86[_0xfaa6('0x40')][_0xfaa6('0x41')]('-')[0x0]]['id'];this[_0xfaa6('0x1a')][_0x33ec86[_0xfaa6('0x3b')]][_0xfaa6('0x6e')]=this[_0xfaa6('0x1b')][_0x33ec86['channel'][_0xfaa6('0x41')]('-')[0x0]][_0xfaa6('0x52')];}}}}else{if(this[_0xfaa6('0x1a')][_0x33ec86[_0xfaa6('0x36')]]){if(_0x33ec86[_0xfaa6('0x4f')]==='6'){if(this[_0xfaa6('0x1b')][_0x33ec86[_0xfaa6('0x40')]['split']('-')[0x0]]){this['channels'][_0x33ec86[_0xfaa6('0x36')]][_0xfaa6('0x6d')]=this[_0xfaa6('0x1b')][_0x33ec86[_0xfaa6('0x40')][_0xfaa6('0x41')]('-')[0x0]]['id'];this[_0xfaa6('0x1a')][_0x33ec86[_0xfaa6('0x36')]][_0xfaa6('0x6e')]=this[_0xfaa6('0x1b')][_0x33ec86[_0xfaa6('0x40')]['split']('-')[0x0]]['name'];}}}}if(_0x33ec86[_0xfaa6('0x4f')]==='6'&&_0x33ec86[_0xfaa6('0x3e')]===_0xfaa6('0x3f')){if(this[_0xfaa6('0x1b')][_0x33ec86['channel']['split']('-')[0x0]]){this[_0xfaa6('0x1b')][_0x33ec86['channel']['split']('-')[0x0]][_0xfaa6('0x44')]=_0x33ec86[_0xfaa6('0x42')];var _0x1f1744;if(this[_0xfaa6('0x1a')][_0x33ec86[_0xfaa6('0x36')]])_0x1f1744=this[_0xfaa6('0x1a')][_0x33ec86[_0xfaa6('0x36')]]['routealias'];else if(this['channels'][_0x33ec86[_0xfaa6('0x3b')]])_0x1f1744=this[_0xfaa6('0x1a')][_0x33ec86['linkedid']][_0xfaa6('0x6f')];logger['debug'](_0xfaa6('0x70'),_0x33ec86[_0xfaa6('0x36')],util[_0xfaa6('0x30')]({'destaccountcode':this['agents'][_0x33ec86[_0xfaa6('0x40')][_0xfaa6('0x41')]('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x33ec86[_0xfaa6('0x42')],'routealias':_0x1f1744},{'showHidden':![],'depth':null}));this[_0xfaa6('0x34')](util['format'](_0xfaa6('0x46'),this['agents'][_0x33ec86[_0xfaa6('0x40')][_0xfaa6('0x41')]('-')[0x0]][_0xfaa6('0x52')]),'user:agentconnect',{'destaccountcode':this['agents'][_0x33ec86[_0xfaa6('0x40')][_0xfaa6('0x41')]('-')[0x0]][_0xfaa6('0x48')],'destconnectedlinenum':_0x33ec86['exten'],'routealias':_0x1f1744});}}}}catch(_0x3ea14e){logger[_0xfaa6('0x53')]('[%s][voiceCallReport][newstate]',_0x33ec86[_0xfaa6('0x36')],util['inspect'](_0x3ea14e,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xfaa6('0x71')]=function(_0x26f7ae,_0x6b6282){try{if(this[_0xfaa6('0x1a')][_0x26f7ae]){logger['info'](_0xfaa6('0x72'),_0x26f7ae,_0x6b6282);this[_0xfaa6('0x1a')][_0x26f7ae][_0xfaa6('0x73')]=!![];if(_[_0xfaa6('0x74')](_0x6b6282,_0xfaa6('0x75'))){_0x6b6282=_0x6b6282['replace'](_0xfaa6('0x75'),_0xfaa6('0x76'));}this[_0xfaa6('0x1a')][_0x26f7ae]['monitorFilename']=_0x6b6282;var _0x57f7ad=_[_0xfaa6('0x77')](this[_0xfaa6('0x1a')][_0x26f7ae][_0xfaa6('0x78')],{'filename':_0x6b6282});if(_[_0xfaa6('0x79')](_0x57f7ad)){this[_0xfaa6('0x1a')][_0x26f7ae][_0xfaa6('0x78')]['push']({'filename':_0x6b6282,'createdAt':moment()[_0xfaa6('0x45')](_0xfaa6('0x4d')),'mixmonitorid':'','status':_0xfaa6('0x7a')});}}}catch(_0x300f3b){logger[_0xfaa6('0x53')](_0xfaa6('0x7b'),_0x26f7ae,util['inspect'](_0x300f3b,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xfaa6('0x31')][_0xfaa6('0x7c')]=function(_0x2fbb44){try{if(this[_0xfaa6('0x32')](_0x2fbb44)){logger['debug'](_0xfaa6('0x7d'),_0x2fbb44['uniqueid'],util[_0xfaa6('0x30')](_0x2fbb44,{'showHidden':![],'depth':null}));if(this['channels'][_0x2fbb44[_0xfaa6('0x36')]]&&_0x2fbb44['channel']!=_0xfaa6('0x4a')){if(this[_0xfaa6('0x32')](_0x2fbb44[_0xfaa6('0x7e')])){if(this[_0xfaa6('0x32')](_0x2fbb44[_0xfaa6('0x7e')][_0xfaa6('0x7f')])){logger['info'](_0xfaa6('0x80'),_0x2fbb44[_0xfaa6('0x36')],_0x2fbb44[_0xfaa6('0x81')]);this['syncMixMonitorFilename'](_0x2fbb44[_0xfaa6('0x36')],_0x2fbb44[_0xfaa6('0x81')]);}else if(this[_0xfaa6('0x32')](_0x2fbb44[_0xfaa6('0x7e')][_0xfaa6('0x82')])){logger[_0xfaa6('0x2c')](_0xfaa6('0x83'),_0x2fbb44[_0xfaa6('0x36')],_0x2fbb44[_0xfaa6('0x81')]);this[_0xfaa6('0x1a')][_0x2fbb44['uniqueid']][_0xfaa6('0x38')]=_0x2fbb44['value'];}else if(this[_0xfaa6('0x32')](_0x2fbb44[_0xfaa6('0x7e')][_0xfaa6('0x84')])){logger[_0xfaa6('0x2c')](_0xfaa6('0x85'),_0x2fbb44[_0xfaa6('0x36')],_0x2fbb44[_0xfaa6('0x81')]);this[_0xfaa6('0x1a')][_0x2fbb44[_0xfaa6('0x36')]]['callerid']=_0x2fbb44[_0xfaa6('0x81')];}else if(this[_0xfaa6('0x32')](_0x2fbb44['variable'][_0xfaa6('0x86')])){logger[_0xfaa6('0x2c')](_0xfaa6('0x87'),_0x2fbb44[_0xfaa6('0x36')],_0x2fbb44[_0xfaa6('0x81')]);this[_0xfaa6('0x1a')][_0x2fbb44[_0xfaa6('0x36')]]['type']=_0x2fbb44[_0xfaa6('0x81')];}else if(this[_0xfaa6('0x32')](_0x2fbb44[_0xfaa6('0x7e')][_0xfaa6('0x88')])){logger[_0xfaa6('0x2c')]('[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s',_0x2fbb44[_0xfaa6('0x36')],_0x2fbb44[_0xfaa6('0x81')]['split'](',')[0x0]);this[_0xfaa6('0x1a')][_0x2fbb44[_0xfaa6('0x36')]][_0xfaa6('0xf')]=_0x2fbb44[_0xfaa6('0x81')]['split'](',')[0x0];}else if(this['isNotNull'](_0x2fbb44[_0xfaa6('0x7e')]['xmd-originatecalleridnum'])){logger[_0xfaa6('0x2c')](_0xfaa6('0x89'),_0x2fbb44['uniqueid'],_0x2fbb44[_0xfaa6('0x81')]);this[_0xfaa6('0x1a')][_0x2fbb44[_0xfaa6('0x36')]][_0xfaa6('0x8a')]=_0x2fbb44[_0xfaa6('0x81')];}else if(this[_0xfaa6('0x32')](_0x2fbb44[_0xfaa6('0x7e')][_0xfaa6('0x8b')])){logger[_0xfaa6('0x2c')](_0xfaa6('0x8c'),_0x2fbb44['uniqueid'],_0x2fbb44[_0xfaa6('0x81')]);this[_0xfaa6('0x1a')][_0x2fbb44[_0xfaa6('0x36')]][_0xfaa6('0x8d')]=_0x2fbb44['value'];}else if(this[_0xfaa6('0x32')](_0x2fbb44[_0xfaa6('0x7e')]['xmd-callerid-preview'])){logger[_0xfaa6('0x2c')](_0xfaa6('0x8e'),_0x2fbb44[_0xfaa6('0x36')],_0x2fbb44[_0xfaa6('0x81')]);this[_0xfaa6('0x1a')][_0x2fbb44[_0xfaa6('0x36')]][_0xfaa6('0x8f')]=_0x2fbb44[_0xfaa6('0x81')];}else if(this[_0xfaa6('0x32')](_0x2fbb44[_0xfaa6('0x7e')]['xmcs-queue'])){logger[_0xfaa6('0x2c')](_0xfaa6('0x90'),_0x2fbb44['uniqueid'],_0x2fbb44[_0xfaa6('0x81')]);this[_0xfaa6('0x1a')][_0x2fbb44[_0xfaa6('0x36')]][_0xfaa6('0xf')]=_0x2fbb44[_0xfaa6('0x81')];}else if(this[_0xfaa6('0x32')](_0x2fbb44[_0xfaa6('0x7e')][_0xfaa6('0x91')])){logger[_0xfaa6('0x2c')]('[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s',_0x2fbb44['uniqueid'],_0x2fbb44[_0xfaa6('0x81')]);this['channels'][_0x2fbb44[_0xfaa6('0x36')]][_0xfaa6('0x92')]=_0x2fbb44[_0xfaa6('0x81')];}}}else if(this[_0xfaa6('0x32')](_0x2fbb44[_0xfaa6('0x7e')][_0xfaa6('0x7f')])){if(_0x2fbb44[_0xfaa6('0x81')]){var _0x3d1cc3=path['parse'](_0x2fbb44[_0xfaa6('0x81')])[_0xfaa6('0x52')];logger[_0xfaa6('0x2c')](_0xfaa6('0x80'),_0x3d1cc3,_0x2fbb44[_0xfaa6('0x81')]);this[_0xfaa6('0x71')](_0x3d1cc3,_0x2fbb44['value']);}}else if(this['channels'][_0x2fbb44[_0xfaa6('0x3b')]]){if(this[_0xfaa6('0x32')](_0x2fbb44[_0xfaa6('0x7e')])){if(this[_0xfaa6('0x32')](_0x2fbb44['variable']['sipcallid'])){logger[_0xfaa6('0x2c')]('[%s][voiceCallReport][varset]\x20variable:sipcallid\x20value:%s',_0x2fbb44[_0xfaa6('0x3b')],_0x2fbb44[_0xfaa6('0x81')]);this[_0xfaa6('0x1a')][_0x2fbb44['linkedid']][_0xfaa6('0x93')]=_0x2fbb44[_0xfaa6('0x81')];}}}}}catch(_0x48e53e){logger['error'](_0xfaa6('0x94'),_0x2fbb44[_0xfaa6('0x36')],util[_0xfaa6('0x30')](_0x48e53e,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xfaa6('0x31')][_0xfaa6('0x25')]=function(_0x1c401f){try{if(this['isNotNull'](_0x1c401f)){logger[_0xfaa6('0x39')](_0xfaa6('0x95'),_0x1c401f[_0xfaa6('0x36')],util[_0xfaa6('0x30')](_0x1c401f,{'showHidden':![],'depth':null}));if(this[_0xfaa6('0x1a')][_0x1c401f[_0xfaa6('0x36')]]){logger[_0xfaa6('0x2c')](_0xfaa6('0x96'),_0x1c401f[_0xfaa6('0x36')],_0x1c401f['cause-txt']);var _0x2000fb=moment();this['channels'][_0x1c401f[_0xfaa6('0x36')]]['endtime']=_0x2000fb[_0xfaa6('0x45')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x1c401f[_0xfaa6('0x36')]]['duration']=_0x2000fb[_0xfaa6('0x69')](this['channels'][_0x1c401f['uniqueid']]['starttime'],_0xfaa6('0x5d'));if(this[_0xfaa6('0x1a')][_0x1c401f[_0xfaa6('0x36')]]['answered']){this[_0xfaa6('0x1a')][_0x1c401f[_0xfaa6('0x36')]][_0xfaa6('0x97')]=_0x2000fb['diff'](this[_0xfaa6('0x1a')][_0x1c401f[_0xfaa6('0x36')]][_0xfaa6('0x67')],_0xfaa6('0x5d'));this[_0xfaa6('0x1a')][_0x1c401f[_0xfaa6('0x36')]]['holdtime']=this[_0xfaa6('0x1a')][_0x1c401f[_0xfaa6('0x36')]][_0xfaa6('0x5b')]-this[_0xfaa6('0x1a')][_0x1c401f[_0xfaa6('0x36')]]['billableseconds'];}if(_0x1c401f[_0xfaa6('0x3e')]===_0xfaa6('0x3f')){if(this['agents'][_0x1c401f['channel'][_0xfaa6('0x41')]('-')[0x0]]){this[_0xfaa6('0x1b')][_0x1c401f[_0xfaa6('0x40')]['split']('-')[0x0]]=_[_0xfaa6('0x98')](this[_0xfaa6('0x1b')][_0x1c401f[_0xfaa6('0x40')][_0xfaa6('0x41')]('-')[0x0]],['destconnectedlinenum']);logger['debug'](_0xfaa6('0x99'),_0x1c401f[_0xfaa6('0x36')],util['inspect']({'id':this[_0xfaa6('0x1b')][_0x1c401f[_0xfaa6('0x40')][_0xfaa6('0x41')]('-')[0x0]]['id'],'destaccountcode':this[_0xfaa6('0x1b')][_0x1c401f[_0xfaa6('0x40')]['split']('-')[0x0]][_0xfaa6('0x48')]},{'showHidden':![],'depth':null}));this[_0xfaa6('0x34')](util['format'](_0xfaa6('0x46'),this['agents'][_0x1c401f[_0xfaa6('0x40')][_0xfaa6('0x41')]('-')[0x0]][_0xfaa6('0x52')]),'user:agentcomplete',{'id':this['agents'][_0x1c401f[_0xfaa6('0x40')][_0xfaa6('0x41')]('-')[0x0]]['id'],'destaccountcode':this[_0xfaa6('0x1b')][_0x1c401f['channel'][_0xfaa6('0x41')]('-')[0x0]][_0xfaa6('0x48')]});}}var _0x2d6ea8=this;Promise['resolve']()['then'](function(){var _0x41ac0a=_0x2d6ea8[_0xfaa6('0x1a')][_0x1c401f['uniqueid']];if(typeof _0x41ac0a['transferType']===_0xfaa6('0x9a'))return;if(_[_0xfaa6('0x9b')](_0x41ac0a[_0xfaa6('0x78')]))return;return RpcSetting[_0xfaa6('0x9c')]()[_0xfaa6('0x9d')](function(_0x203e24){if(!_0x203e24[_0xfaa6('0x9e')])return;return Promise['resolve']()[_0xfaa6('0x9d')](function(){return ami[_0xfaa6('0x9f')]({'action':_0xfaa6('0xa0'),'channel':_0x41ac0a[_0xfaa6('0x40')]})[_0xfaa6('0xa1')](function(){});})[_0xfaa6('0x9d')](function(){return ami['Action']({'action':_0xfaa6('0xa0'),'channel':_0x41ac0a[_0xfaa6('0x6b')]})[_0xfaa6('0xa1')](function(){})['finally'](function(){var _0x1b1f2b=_0x2d6ea8[_0xfaa6('0x1b')][_0x41ac0a[_0xfaa6('0x6b')][_0xfaa6('0x41')]('-')[0x0]];if(!_0x1b1f2b)return;io['emit']('webbar:stopmonitors',{'agentId':_0x1b1f2b['id'],'uniqueid':_0x41ac0a[_0xfaa6('0x36')]});});});});})[_0xfaa6('0x9d')](function(){if(_0x1c401f['event']==='BlindTransfer'){_0x2d6ea8[_0xfaa6('0x1c')][_0x1c401f[_0xfaa6('0x36')]]=_0x2d6ea8[_0xfaa6('0x1a')][_0x1c401f['uniqueid']];}else{if(_0x2d6ea8[_0xfaa6('0x1a')][_0x1c401f[_0xfaa6('0x36')]][_0xfaa6('0xa2')]==='outbound'&&_0x2d6ea8['blindTransfers'][_0x1c401f[_0xfaa6('0x36')]]){_0x2d6ea8['channels'][_0x1c401f[_0xfaa6('0x36')]][_0xfaa6('0x36')]=[_0x2d6ea8[_0xfaa6('0x1a')][_0x1c401f[_0xfaa6('0x36')]][_0xfaa6('0x3b')],_0x2d6ea8[_0xfaa6('0x1a')][_0x1c401f[_0xfaa6('0x36')]]['linkedid']=_0x2d6ea8['channels'][_0x1c401f[_0xfaa6('0x36')]]['uniqueid']][0x0];delete _0x2d6ea8[_0xfaa6('0x1c')][_0x1c401f[_0xfaa6('0x36')]];}}logger['debug'](_0xfaa6('0xa3'),_0x1c401f[_0xfaa6('0x36')],util[_0xfaa6('0x30')](_0x2d6ea8[_0xfaa6('0x1a')][_0x1c401f[_0xfaa6('0x36')]],{'showHidden':![],'depth':null}));ami[_0xfaa6('0x34')](_0xfaa6('0xa4'),_0x2d6ea8['channels'][_0x1c401f[_0xfaa6('0x36')]]);delete _0x2d6ea8['channels'][_0x1c401f[_0xfaa6('0x36')]];});}}}catch(_0x535eae){logger['error'](_0xfaa6('0xa5'),_0x1c401f[_0xfaa6('0x36')],util[_0xfaa6('0x30')](_0x535eae,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xfaa6('0xa6')]=function(_0x5cf5b0){try{if(this[_0xfaa6('0x32')](_0x5cf5b0)){logger[_0xfaa6('0x2c')](_0xfaa6('0xa7'),_0x5cf5b0['uniqueid'],_0x5cf5b0[_0xfaa6('0xa8')],_0x5cf5b0[_0xfaa6('0xa9')]);logger['debug'](_0xfaa6('0xaa'),_0x5cf5b0[_0xfaa6('0x36')],util[_0xfaa6('0x30')](_0x5cf5b0,{'showHidden':![],'depth':null}));if(this[_0xfaa6('0x1a')][_0x5cf5b0[_0xfaa6('0xab')]]){this[_0xfaa6('0x1a')][_0x5cf5b0['transfereeuniqueid']][_0xfaa6('0xac')]=_0x5cf5b0[_0xfaa6('0xa8')];this[_0xfaa6('0x1a')][_0x5cf5b0[_0xfaa6('0xab')]][_0xfaa6('0xad')]=_0x5cf5b0[_0xfaa6('0xa9')];if(this[_0xfaa6('0x1a')][_0x5cf5b0[_0xfaa6('0xae')]]){var _0x532687=this[_0xfaa6('0x1a')][_0x5cf5b0[_0xfaa6('0xae')]];this[_0xfaa6('0x1a')][_0x5cf5b0[_0xfaa6('0xae')]]=this[_0xfaa6('0x1a')][_0x5cf5b0['transfereeuniqueid']];this[_0xfaa6('0x1a')][_0x5cf5b0[_0xfaa6('0xab')]]=_0x532687;}}else if(this[_0xfaa6('0x1a')][_0x5cf5b0[_0xfaa6('0xaf')]]){this['channels'][_0x5cf5b0[_0xfaa6('0xaf')]][_0xfaa6('0xac')]=_0x5cf5b0[_0xfaa6('0xa8')];this[_0xfaa6('0x1a')][_0x5cf5b0[_0xfaa6('0xaf')]][_0xfaa6('0xad')]=_0x5cf5b0['transfertargetcalleridnum'];if(this[_0xfaa6('0x1a')][_0x5cf5b0[_0xfaa6('0xb0')]]){var _0x532687=this[_0xfaa6('0x1a')][_0x5cf5b0[_0xfaa6('0xb0')]];this['channels'][_0x5cf5b0[_0xfaa6('0xb0')]]=this['channels'][_0x5cf5b0['transfertargetuniqueid']];this[_0xfaa6('0x1a')][_0x5cf5b0[_0xfaa6('0xaf')]]=_0x532687;}}if((this['channels'][_0x5cf5b0[_0xfaa6('0xb0')]]||this['channels'][_0x5cf5b0[_0xfaa6('0xb1')]])&&this[_0xfaa6('0x1a')][_0x5cf5b0[_0xfaa6('0xae')]]){var _0x5bb092=_['some']([this['channels'][_0x5cf5b0[_0xfaa6('0xb0')]],this[_0xfaa6('0x1a')][_0x5cf5b0['origtransfererlinkedid']],this[_0xfaa6('0x1a')][_0x5cf5b0[_0xfaa6('0xae')]]],function(_0x3197e3){return _0x3197e3&&_0x3197e3[_0xfaa6('0xa2')]===_0xfaa6('0xb2')&&_0x3197e3[_0xfaa6('0xb3')];});if(_0x5bb092){if(this[_0xfaa6('0x1a')][_0x5cf5b0['origtransfereruniqueid']])this[_0xfaa6('0x1a')][_0x5cf5b0[_0xfaa6('0xb0')]][_0xfaa6('0xb4')]=_0xfaa6('0xb5');if(this['channels'][_0x5cf5b0[_0xfaa6('0xb1')]])this['channels'][_0x5cf5b0['origtransfererlinkedid']][_0xfaa6('0xb4')]=_0xfaa6('0xb5');this[_0xfaa6('0x1a')][_0x5cf5b0[_0xfaa6('0xae')]][_0xfaa6('0xb4')]='ATTENDED';}}}}catch(_0x52bd8f){logger[_0xfaa6('0x53')](_0xfaa6('0xb6'),_0x5cf5b0[_0xfaa6('0x36')],util[_0xfaa6('0x30')](_0x52bd8f,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xfaa6('0x31')]['syncBlindTransfer']=function(_0x429ef1){try{if(this[_0xfaa6('0x32')](_0x429ef1)){logger[_0xfaa6('0x2c')](_0xfaa6('0xb7'),_0x429ef1[_0xfaa6('0x36')],_0x429ef1[_0xfaa6('0xb8')],_0x429ef1[_0xfaa6('0xb9')]);logger[_0xfaa6('0x39')]('[%s][voiceCallReport][blindtransfer]\x20event:',_0x429ef1[_0xfaa6('0x36')],util[_0xfaa6('0x30')](_0x429ef1,{'showHidden':![],'depth':null}));if(this[_0xfaa6('0x1a')][_0x429ef1['transfereeuniqueid']]){this[_0xfaa6('0x1a')][_0x429ef1['transfereeuniqueid']]['transfercalleridnum']=_0x429ef1[_0xfaa6('0xb8')];this['channels'][_0x429ef1[_0xfaa6('0xab')]]['transferconnectedlinenum']=_0x429ef1['extension'];this[_0xfaa6('0x1a')][_0x429ef1[_0xfaa6('0xab')]][_0xfaa6('0xb4')]=_0xfaa6('0xba');this[_0xfaa6('0x25')]({'event':_0xfaa6('0xbb'),'uniqueid':_0x429ef1[_0xfaa6('0xab')],'context':_0x429ef1[_0xfaa6('0x3e')],'channel':_0x429ef1[_0xfaa6('0xbc')]});}else{this['channels'][_0x429ef1['transfereruniqueid']][_0xfaa6('0xb4')]='BLIND';}}}catch(_0x101f0b){logger[_0xfaa6('0x53')]('[%s][voiceCallReport][blindtransfer]',_0x429ef1['uniqueid'],util[_0xfaa6('0x30')](_0x101f0b,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xfaa6('0x31')]['syncMusicOnHoldStart']=function(_0x342207){try{if(this[_0xfaa6('0x32')](_0x342207)){logger[_0xfaa6('0x39')]('[%s][voiceCallReport][musiconholdstart]\x20event:',_0x342207[_0xfaa6('0x36')],util[_0xfaa6('0x30')](_0x342207,{'showHidden':![],'depth':null}));if(this[_0xfaa6('0x1a')][_0x342207[_0xfaa6('0x36')]]){if(!_[_0xfaa6('0x79')](this[_0xfaa6('0x1a')][_0x342207[_0xfaa6('0x36')]]['answertime'])){this[_0xfaa6('0x1a')][_0x342207[_0xfaa6('0x36')]][_0xfaa6('0xbd')]=moment()[_0xfaa6('0x45')]('YYYY-MM-DD\x20HH:mm:ss');logger[_0xfaa6('0x2c')](_0xfaa6('0xbe'),_0x342207['uniqueid'],this[_0xfaa6('0x1a')][_0x342207['uniqueid']]['mohstarttime']);}}}}catch(_0x28b57c){logger[_0xfaa6('0x53')](_0xfaa6('0xbf'),_0x342207['uniqueid'],util['inspect'](_0x28b57c,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xfaa6('0x2b')]=function(_0x3b2254){try{if(this[_0xfaa6('0x32')](_0x3b2254)){logger['debug'](_0xfaa6('0xc0'),_0x3b2254[_0xfaa6('0x36')],util[_0xfaa6('0x30')](_0x3b2254,{'showHidden':![],'depth':null}));if(this['channels'][_0x3b2254[_0xfaa6('0x36')]]){if(!_[_0xfaa6('0x79')](this[_0xfaa6('0x1a')][_0x3b2254['uniqueid']][_0xfaa6('0xbd')])){this[_0xfaa6('0x1a')][_0x3b2254['uniqueid']][_0xfaa6('0xc1')]+=moment()[_0xfaa6('0xc2')](0x0)['diff'](this[_0xfaa6('0x1a')][_0x3b2254[_0xfaa6('0x36')]][_0xfaa6('0xbd')],_0xfaa6('0x5d'));logger['info'](_0xfaa6('0xc3'),_0x3b2254[_0xfaa6('0x36')],this[_0xfaa6('0x1a')][_0x3b2254[_0xfaa6('0x36')]]['mohtime']);delete this[_0xfaa6('0x1a')][_0x3b2254[_0xfaa6('0x36')]][_0xfaa6('0xbd')];}}}}catch(_0x5a3e83){logger[_0xfaa6('0x53')](_0xfaa6('0xc4'),_0x3b2254[_0xfaa6('0x36')],util['inspect'](_0x5a3e83,{'showHidden':![],'depth':null}));}};module[_0xfaa6('0xc5')]=VoiceCallReport; \ No newline at end of file +var _0xa111=['xcally-motion-preview','destinationchannel','UserId','membername','routealias','[%s][voiceCallReport][newstate]\x20sending\x20user:agentconnect\x20event:','[%s][voiceCallReport][newstate]','syncMixMonitorFilename','[%s][voiceCallReport][mixMonitorFilename]\x20monitorFilename:%s','monitor','endsWith','.wav49','replace','.WAV','find','monitors','isNil','push','rec','[%s][voiceCallReport][mixMonitorFilename]','syncVarSet','variable','mixmonitor_filename','[%s][voiceCallReport][varset]\x20variable:mixmonitor_filename\x20value:%s','value','[%s][voiceCallReport][varset]\x20variable:xmd-phone\x20value:%s','xmd-callerid','xmd-cdrtype','[%s][voiceCallReport][varset]\x20variable:xmd-cdrtype\x20value:%s','type','xmd-queue','[%s][voiceCallReport][varset]\x20variable:xmd-queue\x20value:%s','xmd-originatecalleridnum','[%s][voiceCallReport][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','xmd-destination','[%s][voiceCallReport][varset]\x20variable:xmd-destination\x20value:%s','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','sipcalllinkedid','[%s][voiceCallReport][hangup]\x20reason:%s','endtime','billableseconds','answertime','holdtime','[%s][voiceCallReport][hangup]\x20sending\x20user:agentcomplete\x20event:','user:agentcomplete','resolve','then','transferType','undefined','isEmpty','getSettings','stopRecordingOnTransfer','Action','catch','StopMixMonitor','webbar:stopmonitors','event','BlindTransfer','outbound','custom:voiceCallReport','[%s][voiceCallReport][attendedtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','origtransferercalleridnum','transfertargetcalleridnum','[%s][voiceCallReport][attendedtransfer]\x20event:','transfereeuniqueid','transfercalleridnum','transferconnectedlinenum','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','origtransfererlinkedid','some','ATTENDED','syncBlindTransfer','[%s][voiceCallReport][blindtransfer]\x20transfercalleridnum:%s\x20transferconnectedlinenum:%s','transfereecalleridnum','[%s][voiceCallReport][blindtransfer]\x20event:','BLIND','transfererchannel','transfereruniqueid','[%s][voiceCallReport][blindtransfer]','[%s][voiceCallReport][musiconholdstart]\x20event:','mohstarttime','[%s][voiceCallReport][musiconholdstart]\x20mohstarttime:%s','mohtime','milliseconds','[%s][voiceCallReport][musiconholdstop]\x20mohtime:%s','[%s][voiceCallReport][musiconholdstop]','util','path','ioredis','../../../config/environment','../../../config/logger','ami','../ami','unknown','inuse','invalid','unavailable','set','agi','dial','playback','voicemail','NO\x20ANSWER','FAILED','ANSWERED','BUSY','redis','defaults','localhost','socket.io-emitter','channels','agents','blindTransfers','coreshowchannel','syncNewExten','bind','newchannel','syncNewChannel','newstate','syncNewState','varset','syncHangup','attendedtransfer','syncAttendedTransfer','blindtransfer','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','[voiceCallReport][coreshowchannels]\x20started','actionCoreShowChannels','error','[voiceCallReport][coreshowchannels]','inspect','isNotNull','prototype','emit','syncNewCallerId','info','uniqueid','calleridname','debug','[%s][voiceCallReport][newcallerid]\x20event:','linkedid','isUndefined','merge','pick','keys','context','channel','split','exten','destconnectedlinenum','connectedlinenum','format','user:%s','name','user:agentconnect','accountcode','[%s][voiceCallReport][newcallerid]','OutgoingSpoolFailed','[%s][voiceCallReport][newchannel]\x20context:%s\x20exten:%s','starttime','disposition','toNumber','channelstate','from-sip','[%s][voiceCallReport][newchannel]\x20sending\x20user:agentconnect\x20event:','[%s][voiceCallReport][newchannel]','[%s][voiceCallReport][newexten]\x20event:','application','applicationdata','appdata','startsWith','CDR(routeAlias)','toLowerCase','duration','seconds','YYYY-MM-DD\x20HH:mm:ss','includes','lastapplication','lastdata','cdr(','match','queue','[%s][voiceCallReport][newexten]','[%s][voiceCallReport][newstate]\x20linkedid:%s\x20calleridname:%s\x20calleridnum:%s','answered','diff','calleridnum'];(function(_0x10d34b,_0x4fef76){var _0x92b0bf=function(_0x16e291){while(--_0x16e291){_0x10d34b['push'](_0x10d34b['shift']());}};_0x92b0bf(++_0x4fef76);}(_0xa111,0x126));var _0x1a11=function(_0x2a241d,_0x2f9248){_0x2a241d=_0x2a241d-0x0;var _0x4bb0f1=_0xa111[_0x2a241d];return _0x4bb0f1;};'use strict';var BPromise=require('bluebird');var _=require('lodash');var moment=require('moment');var util=require(_0x1a11('0x0'));var path=require(_0x1a11('0x1'));var Redis=require(_0x1a11('0x2'));var config=require(_0x1a11('0x3'));var logger=require(_0x1a11('0x4'))(_0x1a11('0x5'));var ami=require(_0x1a11('0x6'));var Channel=require('../model/channel');var RpcSetting=require('../rpc/setting');var statusDesc=[_0x1a11('0x7'),'not_inuse',_0x1a11('0x8'),'busy',_0x1a11('0x9'),_0x1a11('0xa'),'ringing','ringinuse','onhold'];var applications=[_0x1a11('0xb'),'queue',_0x1a11('0xc'),_0x1a11('0xd'),_0x1a11('0xe'),_0x1a11('0xf')];var dispositions=[_0x1a11('0x10'),'FAILED',_0x1a11('0x11'),_0x1a11('0x10'),_0x1a11('0x10'),'NO\x20ANSWER',_0x1a11('0x12'),_0x1a11('0x13'),_0x1a11('0x11'),'FAILED',_0x1a11('0x11')];var actions={};config[_0x1a11('0x14')]=_[_0x1a11('0x15')](config['redis'],{'host':_0x1a11('0x16'),'port':0x18eb});var io=require(_0x1a11('0x17'))(new Redis(config['redis']));function VoiceCallReport(_0x401891){this[_0x1a11('0x18')]=_0x401891['channels'];this[_0x1a11('0x19')]=_0x401891[_0x1a11('0x19')];this[_0x1a11('0x1a')]={};ami['on'](_0x1a11('0x1b'),this[_0x1a11('0x1c')][_0x1a11('0x1d')](this));ami['on']('newexten',this[_0x1a11('0x1c')]['bind'](this));ami['on'](_0x1a11('0x1e'),this[_0x1a11('0x1f')][_0x1a11('0x1d')](this));ami['on'](_0x1a11('0x20'),this[_0x1a11('0x21')]['bind'](this));ami['on'](_0x1a11('0x22'),this['syncVarSet'][_0x1a11('0x1d')](this));ami['on']('hangup',this[_0x1a11('0x23')][_0x1a11('0x1d')](this));ami['on']('newcallerid',this['syncNewCallerId'][_0x1a11('0x1d')](this));ami['on'](_0x1a11('0x24'),this[_0x1a11('0x25')]['bind'](this));ami['on'](_0x1a11('0x26'),this['syncBlindTransfer'][_0x1a11('0x1d')](this));ami['on'](_0x1a11('0x27'),this[_0x1a11('0x28')][_0x1a11('0x1d')](this));ami['on'](_0x1a11('0x29'),this[_0x1a11('0x2a')][_0x1a11('0x1d')](this));try{logger['info'](_0x1a11('0x2b'));ami[_0x1a11('0x2c')]();}catch(_0x2ee15e){logger[_0x1a11('0x2d')](_0x1a11('0x2e'),util[_0x1a11('0x2f')](_0x2ee15e,{'showHidden':![],'depth':null}));}}VoiceCallReport['prototype'][_0x1a11('0x30')]=function(_0xb459ef){return _0xb459ef!==null&&!_['isUndefined'](_0xb459ef);};VoiceCallReport[_0x1a11('0x31')]['emit']=function(_0xfd3b69,_0x5c20e1,_0x473fe5){io['to'](_0xfd3b69)[_0x1a11('0x32')](_0x5c20e1,_0x473fe5);};VoiceCallReport[_0x1a11('0x31')][_0x1a11('0x33')]=function(_0x4c3d71){try{if(this['isNotNull'](_0x4c3d71)){logger[_0x1a11('0x34')]('[%s][voiceCallReport][newcallerid]\x20calleridname:%s\x20calleridnum:%s',_0x4c3d71[_0x1a11('0x35')],_0x4c3d71[_0x1a11('0x36')],_0x4c3d71['calleridnum']);logger[_0x1a11('0x37')](_0x1a11('0x38'),_0x4c3d71[_0x1a11('0x35')],util['inspect'](_0x4c3d71,{'showHidden':![],'depth':null}));if(_0x4c3d71[_0x1a11('0x35')]===_0x4c3d71[_0x1a11('0x39')]){if(!_[_0x1a11('0x3a')](this[_0x1a11('0x18')][_0x4c3d71['uniqueid']])){_[_0x1a11('0x3b')](this[_0x1a11('0x18')][_0x4c3d71[_0x1a11('0x35')]],_[_0x1a11('0x3c')](_0x4c3d71,_[_0x1a11('0x3d')](this[_0x1a11('0x18')][_0x4c3d71[_0x1a11('0x35')]])));}}if(_0x4c3d71[_0x1a11('0x3e')]==='from-sip'){if(this['agents'][_0x4c3d71[_0x1a11('0x3f')][_0x1a11('0x40')]('-')[0x0]]){if(_0x4c3d71[_0x1a11('0x41')]=='xcally-motion-preview'){this[_0x1a11('0x19')][_0x4c3d71['channel'][_0x1a11('0x40')]('-')[0x0]][_0x1a11('0x42')]=_0x4c3d71[_0x1a11('0x43')];this[_0x1a11('0x32')](util[_0x1a11('0x44')](_0x1a11('0x45'),this[_0x1a11('0x19')][_0x4c3d71[_0x1a11('0x3f')][_0x1a11('0x40')]('-')[0x0]][_0x1a11('0x46')]),_0x1a11('0x47'),{'destaccountcode':this[_0x1a11('0x19')][_0x4c3d71[_0x1a11('0x3f')][_0x1a11('0x40')]('-')[0x0]][_0x1a11('0x48')],'destconnectedlinenum':_0x4c3d71['connectedlinenum']});}}}}}catch(_0x952b95){logger[_0x1a11('0x2d')](_0x1a11('0x49'),_0x4c3d71[_0x1a11('0x35')],util[_0x1a11('0x2f')](_0x952b95,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x1a11('0x31')][_0x1a11('0x1f')]=function(_0x3defdf){try{if(this[_0x1a11('0x30')](_0x3defdf)){logger[_0x1a11('0x37')]('[%s][voiceCallReport][newchannel]\x20event:',_0x3defdf[_0x1a11('0x35')],util[_0x1a11('0x2f')](_0x3defdf,{'showHidden':![],'depth':null}));if(_0x3defdf[_0x1a11('0x35')]===_0x3defdf['linkedid']&&_0x3defdf[_0x1a11('0x3f')]!=_0x1a11('0x4a')){if(_[_0x1a11('0x3a')](this[_0x1a11('0x18')][_0x3defdf['uniqueid']])){logger[_0x1a11('0x34')](_0x1a11('0x4b'),_0x3defdf[_0x1a11('0x35')],_0x3defdf[_0x1a11('0x3e')],_0x3defdf['exten']);this[_0x1a11('0x18')][_0x3defdf[_0x1a11('0x35')]]=new Channel();this[_0x1a11('0x18')][_0x3defdf[_0x1a11('0x35')]][_0x1a11('0x4c')]=moment()[_0x1a11('0x44')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x1a11('0x18')][_0x3defdf[_0x1a11('0x35')]][_0x1a11('0x4d')]=dispositions[_[_0x1a11('0x4e')](_0x3defdf[_0x1a11('0x4f')])];_[_0x1a11('0x3b')](this['channels'][_0x3defdf[_0x1a11('0x35')]],_['pick'](_0x3defdf,_[_0x1a11('0x3d')](this[_0x1a11('0x18')][_0x3defdf[_0x1a11('0x35')]])));if(_0x3defdf[_0x1a11('0x3e')]===_0x1a11('0x50')){if(this[_0x1a11('0x19')][_0x3defdf[_0x1a11('0x3f')][_0x1a11('0x40')]('-')[0x0]]){if(_[_0x1a11('0x3a')](this[_0x1a11('0x19')][_0x3defdf['channel'][_0x1a11('0x40')]('-')[0x0]][_0x1a11('0x42')])){this[_0x1a11('0x19')][_0x3defdf['channel'][_0x1a11('0x40')]('-')[0x0]][_0x1a11('0x42')]=_0x3defdf[_0x1a11('0x41')];logger[_0x1a11('0x37')](_0x1a11('0x51'),_0x3defdf[_0x1a11('0x35')],util[_0x1a11('0x2f')]({'destaccountcode':this[_0x1a11('0x19')][_0x3defdf[_0x1a11('0x3f')][_0x1a11('0x40')]('-')[0x0]][_0x1a11('0x48')],'destconnectedlinenum':_0x3defdf[_0x1a11('0x41')]},{'showHidden':![],'depth':null}));this[_0x1a11('0x32')](util[_0x1a11('0x44')](_0x1a11('0x45'),this[_0x1a11('0x19')][_0x3defdf[_0x1a11('0x3f')][_0x1a11('0x40')]('-')[0x0]]['name']),'user:agentconnect',{'destaccountcode':this[_0x1a11('0x19')][_0x3defdf['channel']['split']('-')[0x0]][_0x1a11('0x48')],'destconnectedlinenum':_0x3defdf[_0x1a11('0x41')]});}}}}}}}catch(_0x4b9e94){logger['error'](_0x1a11('0x52'),_0x3defdf[_0x1a11('0x35')],util[_0x1a11('0x2f')](_0x4b9e94,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype']['syncNewExten']=function(_0x44f5d5){try{if(this[_0x1a11('0x30')](_0x44f5d5)){logger[_0x1a11('0x37')](_0x1a11('0x53'),_0x44f5d5[_0x1a11('0x35')],util[_0x1a11('0x2f')](_0x44f5d5,{'showHidden':![],'depth':null}));if(_0x44f5d5[_0x1a11('0x35')]===_0x44f5d5[_0x1a11('0x39')]&&_0x44f5d5[_0x1a11('0x41')]!='h'&&_0x44f5d5[_0x1a11('0x3f')]!=_0x1a11('0x4a')){_0x44f5d5[_0x1a11('0x54')]=_0x44f5d5[_0x1a11('0x54')]['toLowerCase']();_0x44f5d5[_0x1a11('0x55')]=_0x44f5d5['appdata']&&_0x44f5d5[_0x1a11('0x56')][_0x1a11('0x57')](_0x1a11('0x58'))?_0x44f5d5[_0x1a11('0x56')]:(_0x44f5d5['appdata']||_0x44f5d5['applicationdata'])[_0x1a11('0x59')]();logger[_0x1a11('0x34')]('[%s][voiceCallReport][newexten]\x20application:%s\x20appdata:%s',_0x44f5d5[_0x1a11('0x35')],_0x44f5d5['application'],_0x44f5d5[_0x1a11('0x55')]);if(_['isUndefined'](this[_0x1a11('0x18')][_0x44f5d5[_0x1a11('0x35')]])){this[_0x1a11('0x18')][_0x44f5d5[_0x1a11('0x35')]]=new Channel();this[_0x1a11('0x18')][_0x44f5d5[_0x1a11('0x35')]]['starttime']=_0x44f5d5['duration']?moment()['subtract'](moment[_0x1a11('0x5a')](_0x44f5d5[_0x1a11('0x5a')])[_0x1a11('0x5b')](),_0x1a11('0x5b'))[_0x1a11('0x44')]('YYYY-MM-DD\x20HH:mm:ss'):moment()[_0x1a11('0x44')](_0x1a11('0x5c'));this['channels'][_0x44f5d5[_0x1a11('0x35')]][_0x1a11('0x4d')]=_0x1a11('0x10');}_[_0x1a11('0x3b')](this[_0x1a11('0x18')][_0x44f5d5[_0x1a11('0x35')]],_['pick'](_0x44f5d5,_[_0x1a11('0x3d')](this['channels'][_0x44f5d5[_0x1a11('0x35')]])));if(_[_0x1a11('0x5d')](applications,_0x44f5d5[_0x1a11('0x54')])){this['channels'][_0x44f5d5[_0x1a11('0x35')]][_0x1a11('0x5e')]=_0x44f5d5[_0x1a11('0x54')];this['channels'][_0x44f5d5[_0x1a11('0x35')]][_0x1a11('0x5f')]=_0x44f5d5['applicationdata'];if(_0x44f5d5[_0x1a11('0x54')]===_0x1a11('0xb')&&_[_0x1a11('0x57')](_0x44f5d5['applicationdata']['toLowerCase'](),_0x1a11('0x60'))){var _0x44dd3c=_0x44f5d5[_0x1a11('0x55')][_0x1a11('0x40')]('=');var _0x52c5a5=_0x44dd3c[0x0][_0x1a11('0x59')]()[_0x1a11('0x61')](/cdr\((.*)\)/);if(_0x52c5a5){this[_0x1a11('0x18')][_0x44f5d5[_0x1a11('0x35')]][_0x52c5a5[0x1]]=_0x44dd3c[0x1];}}else if(_0x44f5d5[_0x1a11('0x54')]==='queue'){this['channels'][_0x44f5d5[_0x1a11('0x35')]][_0x1a11('0x62')]=_0x44f5d5[_0x1a11('0x55')][_0x1a11('0x40')](',')[0x0];}}}}}catch(_0x4fa478){logger[_0x1a11('0x2d')](_0x1a11('0x63'),_0x44f5d5[_0x1a11('0x35')],util[_0x1a11('0x2f')](_0x4fa478,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x1a11('0x31')][_0x1a11('0x21')]=function(_0x1cd5c1){try{if(this[_0x1a11('0x30')](_0x1cd5c1)){logger[_0x1a11('0x34')](_0x1a11('0x64'),_0x1cd5c1[_0x1a11('0x35')],_0x1cd5c1['linkedid'],_0x1cd5c1[_0x1a11('0x36')],_0x1cd5c1['calleridnum']);logger[_0x1a11('0x37')]('[%s][voiceCallReport][newstate]\x20event:',_0x1cd5c1[_0x1a11('0x35')],util[_0x1a11('0x2f')](_0x1cd5c1,{'showHidden':![],'depth':null}));if(_0x1cd5c1['uniqueid']!==_0x1cd5c1[_0x1a11('0x39')]){if(this[_0x1a11('0x18')][_0x1cd5c1[_0x1a11('0x39')]]){if(_0x1cd5c1['channelstate']==='6'){if(!this[_0x1a11('0x18')][_0x1cd5c1['linkedid']][_0x1a11('0x65')]){var _0x31792c=moment();this['channels'][_0x1cd5c1[_0x1a11('0x39')]][_0x1a11('0x65')]=!![];this[_0x1a11('0x18')][_0x1cd5c1[_0x1a11('0x39')]]['answertime']=_0x31792c[_0x1a11('0x44')](_0x1a11('0x5c'));if(this[_0x1a11('0x18')][_0x1cd5c1[_0x1a11('0x39')]]['starttime']){this[_0x1a11('0x18')][_0x1cd5c1['linkedid']]['holdtime']=_0x31792c[_0x1a11('0x66')](this[_0x1a11('0x18')][_0x1cd5c1[_0x1a11('0x39')]][_0x1a11('0x4c')],'seconds');}}this[_0x1a11('0x18')][_0x1cd5c1[_0x1a11('0x39')]][_0x1a11('0x39')]=_0x1cd5c1['uniqueid'];if(_0x1cd5c1[_0x1a11('0x67')]!==_0x1a11('0x68')){this[_0x1a11('0x18')][_0x1cd5c1[_0x1a11('0x39')]][_0x1a11('0x43')]=_0x1cd5c1['calleridnum'];}this['channels'][_0x1cd5c1['linkedid']]['connectedlinename']=_0x1cd5c1[_0x1a11('0x36')];this['channels'][_0x1cd5c1[_0x1a11('0x39')]][_0x1a11('0x69')]=_0x1cd5c1[_0x1a11('0x3f')];this[_0x1a11('0x18')][_0x1cd5c1['linkedid']][_0x1a11('0x4d')]=dispositions[_[_0x1a11('0x4e')](_0x1cd5c1[_0x1a11('0x4f')])];if(this[_0x1a11('0x19')][_0x1cd5c1[_0x1a11('0x3f')]['split']('-')[0x0]]){this['channels'][_0x1cd5c1[_0x1a11('0x39')]][_0x1a11('0x6a')]=this['agents'][_0x1cd5c1[_0x1a11('0x3f')]['split']('-')[0x0]]['id'];this[_0x1a11('0x18')][_0x1cd5c1[_0x1a11('0x39')]]['membername']=this[_0x1a11('0x19')][_0x1cd5c1['channel'][_0x1a11('0x40')]('-')[0x0]][_0x1a11('0x46')];}}}}else{if(this['channels'][_0x1cd5c1[_0x1a11('0x35')]]){if(_0x1cd5c1['channelstate']==='6'){if(this[_0x1a11('0x19')][_0x1cd5c1[_0x1a11('0x3f')][_0x1a11('0x40')]('-')[0x0]]){this[_0x1a11('0x18')][_0x1cd5c1[_0x1a11('0x35')]]['UserId']=this['agents'][_0x1cd5c1[_0x1a11('0x3f')][_0x1a11('0x40')]('-')[0x0]]['id'];this['channels'][_0x1cd5c1[_0x1a11('0x35')]][_0x1a11('0x6b')]=this[_0x1a11('0x19')][_0x1cd5c1[_0x1a11('0x3f')][_0x1a11('0x40')]('-')[0x0]][_0x1a11('0x46')];}}}}if(_0x1cd5c1[_0x1a11('0x4f')]==='6'&&_0x1cd5c1[_0x1a11('0x3e')]===_0x1a11('0x50')){if(this[_0x1a11('0x19')][_0x1cd5c1[_0x1a11('0x3f')][_0x1a11('0x40')]('-')[0x0]]){this['agents'][_0x1cd5c1[_0x1a11('0x3f')][_0x1a11('0x40')]('-')[0x0]][_0x1a11('0x42')]=_0x1cd5c1[_0x1a11('0x41')];var _0x439b09;if(this[_0x1a11('0x18')][_0x1cd5c1[_0x1a11('0x35')]])_0x439b09=this[_0x1a11('0x18')][_0x1cd5c1[_0x1a11('0x35')]][_0x1a11('0x6c')];else if(this['channels'][_0x1cd5c1[_0x1a11('0x39')]])_0x439b09=this[_0x1a11('0x18')][_0x1cd5c1['linkedid']][_0x1a11('0x6c')];logger[_0x1a11('0x37')](_0x1a11('0x6d'),_0x1cd5c1[_0x1a11('0x35')],util[_0x1a11('0x2f')]({'destaccountcode':this[_0x1a11('0x19')][_0x1cd5c1[_0x1a11('0x3f')][_0x1a11('0x40')]('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x1cd5c1[_0x1a11('0x41')],'routealias':_0x439b09},{'showHidden':![],'depth':null}));this[_0x1a11('0x32')](util[_0x1a11('0x44')](_0x1a11('0x45'),this['agents'][_0x1cd5c1[_0x1a11('0x3f')][_0x1a11('0x40')]('-')[0x0]][_0x1a11('0x46')]),_0x1a11('0x47'),{'destaccountcode':this['agents'][_0x1cd5c1[_0x1a11('0x3f')][_0x1a11('0x40')]('-')[0x0]][_0x1a11('0x48')],'destconnectedlinenum':_0x1cd5c1[_0x1a11('0x41')],'routealias':_0x439b09});}}}}catch(_0x518b6a){logger[_0x1a11('0x2d')](_0x1a11('0x6e'),_0x1cd5c1[_0x1a11('0x35')],util[_0x1a11('0x2f')](_0x518b6a,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x1a11('0x31')][_0x1a11('0x6f')]=function(_0x2743b1,_0x6de15e){try{if(this['channels'][_0x2743b1]){logger[_0x1a11('0x34')](_0x1a11('0x70'),_0x2743b1,_0x6de15e);this[_0x1a11('0x18')][_0x2743b1][_0x1a11('0x71')]=!![];if(_[_0x1a11('0x72')](_0x6de15e,_0x1a11('0x73'))){_0x6de15e=_0x6de15e[_0x1a11('0x74')](_0x1a11('0x73'),_0x1a11('0x75'));}this[_0x1a11('0x18')][_0x2743b1]['monitorFilename']=_0x6de15e;var _0x51a854=_[_0x1a11('0x76')](this[_0x1a11('0x18')][_0x2743b1][_0x1a11('0x77')],{'filename':_0x6de15e});if(_[_0x1a11('0x78')](_0x51a854)){this[_0x1a11('0x18')][_0x2743b1][_0x1a11('0x77')][_0x1a11('0x79')]({'filename':_0x6de15e,'createdAt':moment()[_0x1a11('0x44')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':'','status':_0x1a11('0x7a')});}}}catch(_0x34b290){logger[_0x1a11('0x2d')](_0x1a11('0x7b'),_0x2743b1,util[_0x1a11('0x2f')](_0x34b290,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x1a11('0x7c')]=function(_0x5c82d1){try{if(this[_0x1a11('0x30')](_0x5c82d1)){logger[_0x1a11('0x37')]('[%s][voiceCallReport][varset]\x20event:',_0x5c82d1[_0x1a11('0x35')],util[_0x1a11('0x2f')](_0x5c82d1,{'showHidden':![],'depth':null}));if(this[_0x1a11('0x18')][_0x5c82d1['uniqueid']]&&_0x5c82d1[_0x1a11('0x3f')]!=_0x1a11('0x4a')){if(this[_0x1a11('0x30')](_0x5c82d1[_0x1a11('0x7d')])){if(this[_0x1a11('0x30')](_0x5c82d1[_0x1a11('0x7d')][_0x1a11('0x7e')])){logger['info'](_0x1a11('0x7f'),_0x5c82d1['uniqueid'],_0x5c82d1[_0x1a11('0x80')]);this[_0x1a11('0x6f')](_0x5c82d1[_0x1a11('0x35')],_0x5c82d1[_0x1a11('0x80')]);}else if(this['isNotNull'](_0x5c82d1[_0x1a11('0x7d')]['xmd-phone'])){logger[_0x1a11('0x34')](_0x1a11('0x81'),_0x5c82d1[_0x1a11('0x35')],_0x5c82d1[_0x1a11('0x80')]);this[_0x1a11('0x18')][_0x5c82d1['uniqueid']][_0x1a11('0x67')]=_0x5c82d1['value'];}else if(this[_0x1a11('0x30')](_0x5c82d1[_0x1a11('0x7d')][_0x1a11('0x82')])){logger[_0x1a11('0x34')]('[%s][voiceCallReport][varset]\x20variable:xmd-callerid\x20value:%s',_0x5c82d1[_0x1a11('0x35')],_0x5c82d1['value']);this[_0x1a11('0x18')][_0x5c82d1[_0x1a11('0x35')]]['callerid']=_0x5c82d1[_0x1a11('0x80')];}else if(this[_0x1a11('0x30')](_0x5c82d1['variable'][_0x1a11('0x83')])){logger[_0x1a11('0x34')](_0x1a11('0x84'),_0x5c82d1[_0x1a11('0x35')],_0x5c82d1['value']);this[_0x1a11('0x18')][_0x5c82d1['uniqueid']][_0x1a11('0x85')]=_0x5c82d1[_0x1a11('0x80')];}else if(this[_0x1a11('0x30')](_0x5c82d1['variable'][_0x1a11('0x86')])){logger['info'](_0x1a11('0x87'),_0x5c82d1[_0x1a11('0x35')],_0x5c82d1['value'][_0x1a11('0x40')](',')[0x0]);this[_0x1a11('0x18')][_0x5c82d1['uniqueid']][_0x1a11('0x62')]=_0x5c82d1[_0x1a11('0x80')][_0x1a11('0x40')](',')[0x0];}else if(this[_0x1a11('0x30')](_0x5c82d1[_0x1a11('0x7d')][_0x1a11('0x88')])){logger[_0x1a11('0x34')](_0x1a11('0x89'),_0x5c82d1['uniqueid'],_0x5c82d1['value']);this[_0x1a11('0x18')][_0x5c82d1[_0x1a11('0x35')]]['originatecalleridnum']=_0x5c82d1['value'];}else if(this[_0x1a11('0x30')](_0x5c82d1[_0x1a11('0x7d')][_0x1a11('0x8a')])){logger[_0x1a11('0x34')](_0x1a11('0x8b'),_0x5c82d1[_0x1a11('0x35')],_0x5c82d1[_0x1a11('0x80')]);this[_0x1a11('0x18')][_0x5c82d1[_0x1a11('0x35')]]['destination']=_0x5c82d1[_0x1a11('0x80')];}else if(this[_0x1a11('0x30')](_0x5c82d1[_0x1a11('0x7d')][_0x1a11('0x8c')])){logger[_0x1a11('0x34')](_0x1a11('0x8d'),_0x5c82d1[_0x1a11('0x35')],_0x5c82d1[_0x1a11('0x80')]);this[_0x1a11('0x18')][_0x5c82d1[_0x1a11('0x35')]][_0x1a11('0x8e')]=_0x5c82d1[_0x1a11('0x80')];}else if(this[_0x1a11('0x30')](_0x5c82d1[_0x1a11('0x7d')][_0x1a11('0x8f')])){logger['info'](_0x1a11('0x90'),_0x5c82d1[_0x1a11('0x35')],_0x5c82d1['value']);this[_0x1a11('0x18')][_0x5c82d1[_0x1a11('0x35')]][_0x1a11('0x62')]=_0x5c82d1[_0x1a11('0x80')];}else if(this[_0x1a11('0x30')](_0x5c82d1['variable'][_0x1a11('0x91')])){logger[_0x1a11('0x34')](_0x1a11('0x92'),_0x5c82d1['uniqueid'],_0x5c82d1[_0x1a11('0x80')]);this[_0x1a11('0x18')][_0x5c82d1[_0x1a11('0x35')]][_0x1a11('0x93')]=_0x5c82d1[_0x1a11('0x80')];}}}else if(this['isNotNull'](_0x5c82d1['variable'][_0x1a11('0x7e')])){if(_0x5c82d1['value']){var _0x36279c=path['parse'](_0x5c82d1[_0x1a11('0x80')])['name'];logger[_0x1a11('0x34')](_0x1a11('0x7f'),_0x36279c,_0x5c82d1[_0x1a11('0x80')]);this['syncMixMonitorFilename'](_0x36279c,_0x5c82d1[_0x1a11('0x80')]);}}else if(this[_0x1a11('0x18')][_0x5c82d1[_0x1a11('0x39')]]){if(this[_0x1a11('0x30')](_0x5c82d1[_0x1a11('0x7d')])){if(this[_0x1a11('0x30')](_0x5c82d1[_0x1a11('0x7d')][_0x1a11('0x91')])){logger['info'](_0x1a11('0x92'),_0x5c82d1[_0x1a11('0x39')],_0x5c82d1[_0x1a11('0x80')]);this['channels'][_0x5c82d1['linkedid']][_0x1a11('0x94')]=_0x5c82d1[_0x1a11('0x80')];}}}}}catch(_0x42ed34){logger[_0x1a11('0x2d')]('[%s][voiceCallReport][varset]',_0x5c82d1[_0x1a11('0x35')],util[_0x1a11('0x2f')](_0x42ed34,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x1a11('0x31')][_0x1a11('0x23')]=function(_0x598f4c){try{if(this[_0x1a11('0x30')](_0x598f4c)){logger['debug']('[%s][voiceCallReport][hangup]\x20event:',_0x598f4c[_0x1a11('0x35')],util['inspect'](_0x598f4c,{'showHidden':![],'depth':null}));if(this['channels'][_0x598f4c['uniqueid']]){logger['info'](_0x1a11('0x95'),_0x598f4c[_0x1a11('0x35')],_0x598f4c['cause-txt']);var _0x2ccf69=moment();this['channels'][_0x598f4c[_0x1a11('0x35')]][_0x1a11('0x96')]=_0x2ccf69[_0x1a11('0x44')](_0x1a11('0x5c'));this[_0x1a11('0x18')][_0x598f4c['uniqueid']][_0x1a11('0x5a')]=_0x2ccf69[_0x1a11('0x66')](this[_0x1a11('0x18')][_0x598f4c[_0x1a11('0x35')]][_0x1a11('0x4c')],_0x1a11('0x5b'));if(this[_0x1a11('0x18')][_0x598f4c[_0x1a11('0x35')]][_0x1a11('0x65')]){this[_0x1a11('0x18')][_0x598f4c[_0x1a11('0x35')]][_0x1a11('0x97')]=_0x2ccf69['diff'](this[_0x1a11('0x18')][_0x598f4c[_0x1a11('0x35')]][_0x1a11('0x98')],_0x1a11('0x5b'));this[_0x1a11('0x18')][_0x598f4c['uniqueid']][_0x1a11('0x99')]=this[_0x1a11('0x18')][_0x598f4c[_0x1a11('0x35')]][_0x1a11('0x5a')]-this['channels'][_0x598f4c[_0x1a11('0x35')]][_0x1a11('0x97')];}if(_0x598f4c[_0x1a11('0x3e')]===_0x1a11('0x50')){if(this[_0x1a11('0x19')][_0x598f4c['channel']['split']('-')[0x0]]){this['agents'][_0x598f4c[_0x1a11('0x3f')][_0x1a11('0x40')]('-')[0x0]]=_['omit'](this[_0x1a11('0x19')][_0x598f4c['channel'][_0x1a11('0x40')]('-')[0x0]],[_0x1a11('0x42')]);logger['debug'](_0x1a11('0x9a'),_0x598f4c[_0x1a11('0x35')],util[_0x1a11('0x2f')]({'id':this[_0x1a11('0x19')][_0x598f4c[_0x1a11('0x3f')]['split']('-')[0x0]]['id'],'destaccountcode':this[_0x1a11('0x19')][_0x598f4c['channel'][_0x1a11('0x40')]('-')[0x0]][_0x1a11('0x48')]},{'showHidden':![],'depth':null}));this['emit'](util[_0x1a11('0x44')](_0x1a11('0x45'),this[_0x1a11('0x19')][_0x598f4c['channel']['split']('-')[0x0]][_0x1a11('0x46')]),_0x1a11('0x9b'),{'id':this[_0x1a11('0x19')][_0x598f4c[_0x1a11('0x3f')][_0x1a11('0x40')]('-')[0x0]]['id'],'destaccountcode':this[_0x1a11('0x19')][_0x598f4c['channel']['split']('-')[0x0]][_0x1a11('0x48')]});}}var _0x13e5df=this;Promise[_0x1a11('0x9c')]()[_0x1a11('0x9d')](function(){var _0x8d18d7=_0x13e5df[_0x1a11('0x18')][_0x598f4c[_0x1a11('0x35')]];if(typeof _0x8d18d7[_0x1a11('0x9e')]===_0x1a11('0x9f'))return;if(_[_0x1a11('0xa0')](_0x8d18d7['monitors']))return;return RpcSetting[_0x1a11('0xa1')]()['then'](function(_0x103358){if(!_0x103358[_0x1a11('0xa2')])return;return Promise['resolve']()[_0x1a11('0x9d')](function(){return ami[_0x1a11('0xa3')]({'action':'StopMixMonitor','channel':_0x8d18d7['channel']})[_0x1a11('0xa4')](function(){});})['then'](function(){return ami[_0x1a11('0xa3')]({'action':_0x1a11('0xa5'),'channel':_0x8d18d7[_0x1a11('0x69')]})['catch'](function(){})['finally'](function(){var _0x36de10=_0x13e5df[_0x1a11('0x19')][_0x8d18d7[_0x1a11('0x69')][_0x1a11('0x40')]('-')[0x0]];if(!_0x36de10)return;io[_0x1a11('0x32')](_0x1a11('0xa6'),{'agentId':_0x36de10['id'],'uniqueid':_0x8d18d7[_0x1a11('0x35')]});});});});})[_0x1a11('0x9d')](function(){if(_0x598f4c[_0x1a11('0xa7')]===_0x1a11('0xa8')){_0x13e5df[_0x1a11('0x1a')][_0x598f4c['uniqueid']]=_0x13e5df[_0x1a11('0x18')][_0x598f4c[_0x1a11('0x35')]];}else{if(_0x13e5df[_0x1a11('0x18')][_0x598f4c[_0x1a11('0x35')]][_0x1a11('0x85')]===_0x1a11('0xa9')&&_0x13e5df[_0x1a11('0x1a')][_0x598f4c[_0x1a11('0x35')]]){_0x13e5df[_0x1a11('0x18')][_0x598f4c[_0x1a11('0x35')]]['uniqueid']=[_0x13e5df['channels'][_0x598f4c[_0x1a11('0x35')]][_0x1a11('0x39')],_0x13e5df[_0x1a11('0x18')][_0x598f4c[_0x1a11('0x35')]][_0x1a11('0x39')]=_0x13e5df[_0x1a11('0x18')][_0x598f4c['uniqueid']]['uniqueid']][0x0];delete _0x13e5df[_0x1a11('0x1a')][_0x598f4c[_0x1a11('0x35')]];}}logger[_0x1a11('0x37')]('[%s][voiceCallReport][hangup]\x20sending\x20hangup\x20event:',_0x598f4c['uniqueid'],util[_0x1a11('0x2f')](_0x13e5df[_0x1a11('0x18')][_0x598f4c['uniqueid']],{'showHidden':![],'depth':null}));ami[_0x1a11('0x32')](_0x1a11('0xaa'),_0x13e5df[_0x1a11('0x18')][_0x598f4c[_0x1a11('0x35')]]);delete _0x13e5df[_0x1a11('0x18')][_0x598f4c['uniqueid']];});}}}catch(_0x2e7038){logger['error']('[%s][voiceCallReport][hangup]',_0x598f4c[_0x1a11('0x35')],util[_0x1a11('0x2f')](_0x2e7038,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x1a11('0x31')]['syncAttendedTransfer']=function(_0x42da74){try{if(this[_0x1a11('0x30')](_0x42da74)){logger['info'](_0x1a11('0xab'),_0x42da74[_0x1a11('0x35')],_0x42da74[_0x1a11('0xac')],_0x42da74[_0x1a11('0xad')]);logger[_0x1a11('0x37')](_0x1a11('0xae'),_0x42da74[_0x1a11('0x35')],util[_0x1a11('0x2f')](_0x42da74,{'showHidden':![],'depth':null}));if(this['channels'][_0x42da74['transfereeuniqueid']]){this[_0x1a11('0x18')][_0x42da74[_0x1a11('0xaf')]][_0x1a11('0xb0')]=_0x42da74['origtransferercalleridnum'];this[_0x1a11('0x18')][_0x42da74[_0x1a11('0xaf')]][_0x1a11('0xb1')]=_0x42da74['transfertargetcalleridnum'];if(this[_0x1a11('0x18')][_0x42da74[_0x1a11('0xb2')]]){var _0x1b3f55=this[_0x1a11('0x18')][_0x42da74[_0x1a11('0xb2')]];this[_0x1a11('0x18')][_0x42da74['secondtransfereruniqueid']]=this['channels'][_0x42da74[_0x1a11('0xaf')]];this[_0x1a11('0x18')][_0x42da74[_0x1a11('0xaf')]]=_0x1b3f55;}}else if(this[_0x1a11('0x18')][_0x42da74[_0x1a11('0xb3')]]){this['channels'][_0x42da74['transfertargetuniqueid']][_0x1a11('0xb0')]=_0x42da74[_0x1a11('0xac')];this[_0x1a11('0x18')][_0x42da74[_0x1a11('0xb3')]][_0x1a11('0xb1')]=_0x42da74['transfertargetcalleridnum'];if(this[_0x1a11('0x18')][_0x42da74[_0x1a11('0xb4')]]){var _0x1b3f55=this['channels'][_0x42da74[_0x1a11('0xb4')]];this[_0x1a11('0x18')][_0x42da74[_0x1a11('0xb4')]]=this['channels'][_0x42da74['transfertargetuniqueid']];this[_0x1a11('0x18')][_0x42da74[_0x1a11('0xb3')]]=_0x1b3f55;}}if((this['channels'][_0x42da74[_0x1a11('0xb4')]]||this[_0x1a11('0x18')][_0x42da74[_0x1a11('0xb5')]])&&this[_0x1a11('0x18')][_0x42da74[_0x1a11('0xb2')]]){var _0x173403=_[_0x1a11('0xb6')]([this[_0x1a11('0x18')][_0x42da74[_0x1a11('0xb4')]],this[_0x1a11('0x18')][_0x42da74[_0x1a11('0xb5')]],this[_0x1a11('0x18')][_0x42da74[_0x1a11('0xb2')]]],function(_0x4ac364){return _0x4ac364&&_0x4ac364[_0x1a11('0x85')]==='outbound'&&_0x4ac364['routeid'];});if(_0x173403){if(this['channels'][_0x42da74['origtransfereruniqueid']])this[_0x1a11('0x18')][_0x42da74['origtransfereruniqueid']][_0x1a11('0x9e')]=_0x1a11('0xb7');if(this[_0x1a11('0x18')][_0x42da74['origtransfererlinkedid']])this['channels'][_0x42da74[_0x1a11('0xb5')]][_0x1a11('0x9e')]=_0x1a11('0xb7');this['channels'][_0x42da74[_0x1a11('0xb2')]][_0x1a11('0x9e')]=_0x1a11('0xb7');}}}}catch(_0x33918f){logger[_0x1a11('0x2d')]('[%s][voiceCallReport][attendedtransfer]',_0x42da74[_0x1a11('0x35')],util['inspect'](_0x33918f,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x1a11('0x31')][_0x1a11('0xb8')]=function(_0xd02ea2){try{if(this[_0x1a11('0x30')](_0xd02ea2)){logger['info'](_0x1a11('0xb9'),_0xd02ea2[_0x1a11('0x35')],_0xd02ea2[_0x1a11('0xba')],_0xd02ea2['extension']);logger['debug'](_0x1a11('0xbb'),_0xd02ea2[_0x1a11('0x35')],util[_0x1a11('0x2f')](_0xd02ea2,{'showHidden':![],'depth':null}));if(this[_0x1a11('0x18')][_0xd02ea2['transfereeuniqueid']]){this['channels'][_0xd02ea2[_0x1a11('0xaf')]][_0x1a11('0xb0')]=_0xd02ea2['transfereecalleridnum'];this[_0x1a11('0x18')][_0xd02ea2[_0x1a11('0xaf')]]['transferconnectedlinenum']=_0xd02ea2['extension'];this[_0x1a11('0x18')][_0xd02ea2['transfereeuniqueid']]['transferType']=_0x1a11('0xbc');this[_0x1a11('0x23')]({'event':_0x1a11('0xa8'),'uniqueid':_0xd02ea2['transfereeuniqueid'],'context':_0xd02ea2[_0x1a11('0x3e')],'channel':_0xd02ea2[_0x1a11('0xbd')]});}else{this[_0x1a11('0x18')][_0xd02ea2[_0x1a11('0xbe')]][_0x1a11('0x9e')]=_0x1a11('0xbc');}}}catch(_0x30a381){logger[_0x1a11('0x2d')](_0x1a11('0xbf'),_0xd02ea2[_0x1a11('0x35')],util[_0x1a11('0x2f')](_0x30a381,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x1a11('0x31')][_0x1a11('0x28')]=function(_0x3fc20a){try{if(this['isNotNull'](_0x3fc20a)){logger['debug'](_0x1a11('0xc0'),_0x3fc20a['uniqueid'],util[_0x1a11('0x2f')](_0x3fc20a,{'showHidden':![],'depth':null}));if(this['channels'][_0x3fc20a[_0x1a11('0x35')]]){if(!_['isNil'](this[_0x1a11('0x18')][_0x3fc20a['uniqueid']][_0x1a11('0x98')])){this[_0x1a11('0x18')][_0x3fc20a[_0x1a11('0x35')]][_0x1a11('0xc1')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');logger[_0x1a11('0x34')](_0x1a11('0xc2'),_0x3fc20a['uniqueid'],this['channels'][_0x3fc20a[_0x1a11('0x35')]][_0x1a11('0xc1')]);}}}}catch(_0x49986e){logger[_0x1a11('0x2d')]('[%s][voiceCallReport][musiconholdstart]',_0x3fc20a[_0x1a11('0x35')],util[_0x1a11('0x2f')](_0x49986e,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x1a11('0x2a')]=function(_0x420670){try{if(this[_0x1a11('0x30')](_0x420670)){logger['debug']('[%s][voiceCallReport][musiconholdstop]\x20event:',_0x420670[_0x1a11('0x35')],util[_0x1a11('0x2f')](_0x420670,{'showHidden':![],'depth':null}));if(this[_0x1a11('0x18')][_0x420670[_0x1a11('0x35')]]){if(!_[_0x1a11('0x78')](this['channels'][_0x420670[_0x1a11('0x35')]][_0x1a11('0xc1')])){this[_0x1a11('0x18')][_0x420670[_0x1a11('0x35')]][_0x1a11('0xc3')]+=moment()[_0x1a11('0xc4')](0x0)[_0x1a11('0x66')](this[_0x1a11('0x18')][_0x420670[_0x1a11('0x35')]][_0x1a11('0xc1')],_0x1a11('0x5b'));logger[_0x1a11('0x34')](_0x1a11('0xc5'),_0x420670[_0x1a11('0x35')],this[_0x1a11('0x18')][_0x420670[_0x1a11('0x35')]][_0x1a11('0xc3')]);delete this[_0x1a11('0x18')][_0x420670[_0x1a11('0x35')]][_0x1a11('0xc1')];}}}}catch(_0x4cf659){logger[_0x1a11('0x2d')](_0x1a11('0xc6'),_0x420670[_0x1a11('0x35')],util[_0x1a11('0x2f')](_0x4cf659,{'showHidden':![],'depth':null}));}};module['exports']=VoiceCallReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceDialReport.js b/server/services/ami/report/voiceDialReport.js index ffa50f9..02548a8 100644 --- a/server/services/ami/report/voiceDialReport.js +++ b/server/services/ami/report/voiceDialReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x41a5=['debug','uniqueid','inspect','merge','format','YYYY-MM-DD\x20HH:mm:ss','channel','substring','lastIndexOf','omit','event','privilege','info','interface','[%s][voiceDialReport][dialbegin]\x20sending\x20voice_outbound_channel:save\x20event:','voice_outbound_channel:save','[%s][voiceDialReport][dialbegin]\x20sending\x20dialbegin\x20event:','custom:dialbegin','error','[%s][voiceDialReport][dialend]\x20event:','dialstatus','ANSWER','connectedlinenum','connectedlinename','answertime','connect','[%s][voiceDialReport][dialend]\x20sending\x20dialconnect\x20event:','[%s][voiceDialReport][dialend]\x20sending\x20voice_outbound_channel:save\x20event:','addVariable','keys','variable','value','outboundrouteid','voice','[%s][voiceDialReport][varset]\x20outboundrouteid:%s\x20variable:%s\x20value:%s','[%s][voiceDialReport][varset]\x20sending\x20voice_outbound_channel:save\x20event:','voice:outbound','[%s][voiceDialReport][varset]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','membercalls','memberdynamic','memberinterface','memberlastcall','membername','memberpenalty','isNil','includes','syncHangup','[%s][voiceDialReport][hangup]\x20event:','[%s][voiceDialReport][hangup]\x20reason:%s\x20lasteevent:complete','cause-txt','endtime','diff','starttime','seconds','complete','answered','holdtime','billableseconds','sumHoldTime','sumDuration','duration','[%s][voiceDialReport][hangup]\x20sending\x20voiceDialReport\x20event:','custom:voiceDialReport','[%s][voiceDialReport][hangup]\x20sending\x20dialend\x20event:','custom:dialend','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound:save\x20event:','[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event','voice_outbound_channel:remove','linkedid','destuniqueid','syncNewExten','[%s][voiceDialReport][newexten]\x20event:','application','toLowerCase','set','applicationdata','startsWith','split','match','[%s][voiceDialReport][newexten]','exports','lodash','moment','util','ioredis','../../../config/logger','../ami','defaults','redis','localhost','socket.io-emitter','channels','outboundChannels','outbound','applications','variables','syncDialBegin','bind','dialend','syncDialEnd','syncVarSet','newexten','hangup','prototype','isNotNull','isUndefined','emit'];(function(_0x199bc4,_0x338105){var _0x136ffb=function(_0x3e7ced){while(--_0x3e7ced){_0x199bc4['push'](_0x199bc4['shift']());}};_0x136ffb(++_0x338105);}(_0x41a5,0x1b6));var _0x541a=function(_0x3797cf,_0x1234b5){_0x3797cf=_0x3797cf-0x0;var _0x56a87b=_0x41a5[_0x3797cf];return _0x56a87b;};'use strict';var _=require(_0x541a('0x0'));var moment=require(_0x541a('0x1'));var util=require(_0x541a('0x2'));var Redis=require(_0x541a('0x3'));var config=require('../../../config/environment');var logger=require(_0x541a('0x4'))('ami');var ami=require(_0x541a('0x5'));config['redis']=_[_0x541a('0x6')](config[_0x541a('0x7')],{'host':_0x541a('0x8'),'port':0x18eb});var io=require(_0x541a('0x9'))(new Redis(config[_0x541a('0x7')]));function VoiceDialReport(_0x11cae7){this[_0x541a('0xa')]=_0x11cae7[_0x541a('0xb')];this[_0x541a('0xc')]=_0x11cae7[_0x541a('0xc')];this[_0x541a('0xd')]={};this[_0x541a('0xe')]={};ami['on']('dialbegin',this[_0x541a('0xf')][_0x541a('0x10')](this));ami['on'](_0x541a('0x11'),this[_0x541a('0x12')][_0x541a('0x10')](this));ami['on']('varset',this[_0x541a('0x13')][_0x541a('0x10')](this));ami['on'](_0x541a('0x14'),this['syncNewExten']['bind'](this));ami['on'](_0x541a('0x15'),this['syncHangup'][_0x541a('0x10')](this));}VoiceDialReport[_0x541a('0x16')][_0x541a('0x17')]=function(_0x1669a5){return _0x1669a5!==null&&!_[_0x541a('0x18')](_0x1669a5);};VoiceDialReport[_0x541a('0x16')][_0x541a('0x19')]=function(_0x4820ff,_0x45fc33,_0x1a23b0){io['to'](_0x4820ff)[_0x541a('0x19')](_0x45fc33,_0x1a23b0);};VoiceDialReport[_0x541a('0x16')][_0x541a('0xf')]=function(_0x1977c7){try{if(this[_0x541a('0x17')](_0x1977c7)){logger[_0x541a('0x1a')]('[%s][voiceDialReport][dialbegin]\x20event:',_0x1977c7[_0x541a('0x1b')],util[_0x541a('0x1c')](_0x1977c7,{'showHidden':![],'depth':null}));if(this[_0x541a('0xa')][_0x1977c7[_0x541a('0x1b')]]){_[_0x541a('0x1d')](this[_0x541a('0xa')][_0x1977c7[_0x541a('0x1b')]],{'starttime':moment()[_0x541a('0x1e')](_0x541a('0x1f')),'lastevent':'called','interface':_0x1977c7[_0x541a('0x20')][_0x541a('0x21')](0x0,_0x1977c7[_0x541a('0x20')]['lastIndexOf']('-')),'membername':_0x1977c7[_0x541a('0x20')]['substring'](_0x1977c7[_0x541a('0x20')]['lastIndexOf']('/')+0x1,_0x1977c7['channel'][_0x541a('0x22')]('-'))},_[_0x541a('0x23')](_0x1977c7,[_0x541a('0x24'),_0x541a('0x25')]));logger[_0x541a('0x26')]('[%s][voiceDialReport][dialbegin]\x20agent:%s\x20interface:%s\x20lastevent:called',_0x1977c7[_0x541a('0x1b')],this[_0x541a('0xa')][_0x1977c7[_0x541a('0x1b')]]['membername'],this[_0x541a('0xa')][_0x1977c7[_0x541a('0x1b')]][_0x541a('0x27')]);logger[_0x541a('0x1a')](_0x541a('0x28'),_0x1977c7[_0x541a('0x1b')],util[_0x541a('0x1c')](this[_0x541a('0xa')][_0x1977c7[_0x541a('0x1b')]],{'showHidden':![],'depth':null}));if(this[_0x541a('0xd')][_0x1977c7[_0x541a('0x1b')]])_[_0x541a('0x1d')](this['channels'][_0x1977c7[_0x541a('0x1b')]],this[_0x541a('0xd')][_0x1977c7['uniqueid']]);this[_0x541a('0x19')]('voice:outbound',_0x541a('0x29'),this[_0x541a('0xa')][_0x1977c7[_0x541a('0x1b')]]);logger[_0x541a('0x1a')](_0x541a('0x2a'),_0x1977c7[_0x541a('0x1b')],util[_0x541a('0x1c')](this[_0x541a('0xa')][_0x1977c7[_0x541a('0x1b')]],{'showHidden':![],'depth':null}));ami[_0x541a('0x19')](_0x541a('0x2b'),this[_0x541a('0xa')][_0x1977c7[_0x541a('0x1b')]]);}}}catch(_0x3dfbda){logger[_0x541a('0x2c')]('[%s][voiceDialReport][dialbegin]',_0x1977c7[_0x541a('0x1b')],util[_0x541a('0x1c')](_0x3dfbda,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x541a('0x16')][_0x541a('0x12')]=function(_0x226898){try{if(this[_0x541a('0x17')](_0x226898)){logger['debug'](_0x541a('0x2d'),_0x226898[_0x541a('0x1b')],util[_0x541a('0x1c')](_0x226898,{'showHidden':![],'depth':null}));if(this[_0x541a('0xa')][_0x226898[_0x541a('0x1b')]]){this[_0x541a('0xa')][_0x226898[_0x541a('0x1b')]]['dialstatus']=_0x226898[_0x541a('0x2e')];if(_0x226898['dialstatus']===_0x541a('0x2f')){this[_0x541a('0xa')][_0x226898[_0x541a('0x1b')]][_0x541a('0x30')]=_0x226898['connectedlinenum'];this[_0x541a('0xa')][_0x226898[_0x541a('0x1b')]][_0x541a('0x31')]=_0x226898[_0x541a('0x31')];this[_0x541a('0xa')][_0x226898[_0x541a('0x1b')]][_0x541a('0x32')]=moment()[_0x541a('0x1e')](_0x541a('0x1f'));this[_0x541a('0xa')][_0x226898[_0x541a('0x1b')]]['lastevent']=_0x541a('0x33');logger[_0x541a('0x26')]('[%s][voiceDialReport][dialend]\x20agent:%s\x20lastevent:connect',_0x226898[_0x541a('0x1b')],_0x226898[_0x541a('0x20')]['substring'](_0x226898[_0x541a('0x20')][_0x541a('0x22')]('/')+0x1,_0x226898[_0x541a('0x20')][_0x541a('0x22')]('-')));logger['debug'](_0x541a('0x34'),_0x226898[_0x541a('0x1b')],util[_0x541a('0x1c')](this[_0x541a('0xa')][_0x226898['uniqueid']],{'showHidden':![],'depth':null}));ami['emit']('custom:dialconnect',this[_0x541a('0xa')][_0x226898[_0x541a('0x1b')]]);}logger[_0x541a('0x1a')](_0x541a('0x35'),_0x226898['uniqueid'],util['inspect'](this[_0x541a('0xa')][_0x226898[_0x541a('0x1b')]],{'showHidden':![],'depth':null}));this[_0x541a('0x19')]('voice:outbound',_0x541a('0x29'),this[_0x541a('0xa')][_0x226898[_0x541a('0x1b')]]);}}}catch(_0x9b0724){logger[_0x541a('0x2c')]('[%s][voiceDialReport][dialend]',_0x226898[_0x541a('0x1b')],util[_0x541a('0x1c')](_0x9b0724,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x541a('0x16')][_0x541a('0x13')]=function(_0x261c90){try{if(this[_0x541a('0x17')](_0x261c90)){logger[_0x541a('0x1a')]('[%s][voiceDialReport][varset]\x20event:',_0x261c90[_0x541a('0x1b')],util[_0x541a('0x1c')](_0x261c90,{'showHidden':![],'depth':null}));this[_0x541a('0x36')](_0x261c90['uniqueid'],_[_0x541a('0x37')](_0x261c90[_0x541a('0x38')])[0x0],_0x261c90[_0x541a('0x39')]);if(this[_0x541a('0x17')](_0x261c90['variable'])&&this[_0x541a('0x17')](_0x261c90['variable'][_0x541a('0x3a')])){if(_[_0x541a('0x18')](this[_0x541a('0xa')][_0x261c90[_0x541a('0x1b')]])){this[_0x541a('0xa')][_0x261c90[_0x541a('0x1b')]]={'routeId':_0x261c90['value'],'variables':this['variables'][_0x261c90[_0x541a('0x1b')]],'motionChannel':_0x541a('0x3b')};logger['info'](_0x541a('0x3c'),_0x261c90[_0x541a('0x1b')],_0x261c90[_0x541a('0x38')][_0x541a('0x3a')],_[_0x541a('0x37')](_0x261c90[_0x541a('0x38')])[0x0],_0x261c90[_0x541a('0x39')]);logger[_0x541a('0x1a')](_0x541a('0x3d'),_0x261c90['uniqueid'],util[_0x541a('0x1c')](this[_0x541a('0xa')][_0x261c90[_0x541a('0x1b')]],{'showHidden':![],'depth':null}));this[_0x541a('0x19')](_0x541a('0x3e'),_0x541a('0x29'),this['channels'][_0x261c90[_0x541a('0x1b')]]);}}}}catch(_0x5e99d7){logger[_0x541a('0x2c')](_0x541a('0x3f'),_0x261c90[_0x541a('0x1b')],util['inspect'](_0x5e99d7,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x541a('0x16')][_0x541a('0x36')]=function(_0x93bbdb,_0x24f765,_0xd70f37){var _0x320ad0=[_0x541a('0x40'),_0x541a('0x41'),'rtpaudioqosjitter','rtpaudioqosjitterbridged',_0x541a('0x42'),_0x541a('0x43'),_0x541a('0x44'),_0x541a('0x45'),_0x541a('0x46'),_0x541a('0x47'),_0x541a('0x48'),'bridgepvtcallid',_0x541a('0x49'),_0x541a('0x4a'),_0x541a('0x4b'),_0x541a('0x4c'),_0x541a('0x4d'),_0x541a('0x4e'),'memberrealtime'];if(!_[_0x541a('0x4f')](_0x24f765)&&!_[_0x541a('0x50')](_0x320ad0,_0x24f765)){if(_['isUndefined'](this[_0x541a('0xe')][_0x93bbdb])){this[_0x541a('0xe')][_0x93bbdb]={};}this['variables'][_0x93bbdb][_0x24f765]=_0xd70f37;}};VoiceDialReport['prototype'][_0x541a('0x51')]=function(_0x1b1e82){try{if(this['isNotNull'](_0x1b1e82)){logger[_0x541a('0x1a')](_0x541a('0x52'),_0x1b1e82['uniqueid'],util[_0x541a('0x1c')](_0x1b1e82,{'showHidden':![],'depth':null}));if(this[_0x541a('0xa')][_0x1b1e82['uniqueid']]){logger['info'](_0x541a('0x53'),_0x1b1e82[_0x541a('0x1b')],_0x1b1e82[_0x541a('0x54')]);this[_0x541a('0xa')][_0x1b1e82['uniqueid']][_0x541a('0x55')]=moment()[_0x541a('0x1e')](_0x541a('0x1f'));this['channels'][_0x1b1e82[_0x541a('0x1b')]]['duration']=moment(this['channels'][_0x1b1e82[_0x541a('0x1b')]][_0x541a('0x55')])[_0x541a('0x56')](this[_0x541a('0xa')][_0x1b1e82['uniqueid']][_0x541a('0x57')],_0x541a('0x58'));this[_0x541a('0xa')][_0x1b1e82['uniqueid']]['lastevent']=_0x541a('0x59');this['outbound']['total']+=0x1;if(this[_0x541a('0xa')][_0x1b1e82['uniqueid']][_0x541a('0x32')]){this[_0x541a('0xc')][_0x541a('0x5a')]+=0x1;this['channels'][_0x1b1e82[_0x541a('0x1b')]][_0x541a('0x5b')]=moment(this['channels'][_0x1b1e82[_0x541a('0x1b')]][_0x541a('0x32')])[_0x541a('0x56')](this['channels'][_0x1b1e82['uniqueid']]['starttime'],'seconds');this[_0x541a('0xa')][_0x1b1e82[_0x541a('0x1b')]][_0x541a('0x5c')]=moment(this['channels'][_0x1b1e82[_0x541a('0x1b')]][_0x541a('0x55')])[_0x541a('0x56')](this[_0x541a('0xa')][_0x1b1e82[_0x541a('0x1b')]]['answertime'],_0x541a('0x58'));this[_0x541a('0xc')][_0x541a('0x5d')]+=this[_0x541a('0xa')][_0x1b1e82[_0x541a('0x1b')]][_0x541a('0x5b')]||0x0;this[_0x541a('0xc')]['sumBillable']+=this[_0x541a('0xa')][_0x1b1e82[_0x541a('0x1b')]][_0x541a('0x5c')];}this[_0x541a('0xc')][_0x541a('0x5e')]+=this[_0x541a('0xa')][_0x1b1e82['uniqueid']][_0x541a('0x5f')];logger[_0x541a('0x1a')](_0x541a('0x60'),_0x1b1e82[_0x541a('0x1b')],util[_0x541a('0x1c')](this[_0x541a('0xa')][_0x1b1e82[_0x541a('0x1b')]],{'showHidden':![],'depth':null}));ami[_0x541a('0x19')](_0x541a('0x61'),this[_0x541a('0xa')][_0x1b1e82[_0x541a('0x1b')]]);logger[_0x541a('0x1a')](_0x541a('0x62'),_0x1b1e82[_0x541a('0x1b')],util['inspect'](this['channels'][_0x1b1e82[_0x541a('0x1b')]],{'showHidden':![],'depth':null}));ami[_0x541a('0x19')](_0x541a('0x63'),this[_0x541a('0xa')][_0x1b1e82[_0x541a('0x1b')]]);logger['debug'](_0x541a('0x64'),_0x1b1e82[_0x541a('0x1b')],util[_0x541a('0x1c')](this[_0x541a('0xa')][_0x1b1e82[_0x541a('0x1b')]],{'showHidden':![],'depth':null}));this['emit']('voice:outbound','voice_outbound:save',this[_0x541a('0xc')]);logger[_0x541a('0x26')](_0x541a('0x65'),JSON['stringify'](this[_0x541a('0xa')][_0x1b1e82[_0x541a('0x1b')]]));logger['debug']('[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound_channel:remove\x20event:',_0x1b1e82['uniqueid'],util[_0x541a('0x1c')](this[_0x541a('0xa')][_0x1b1e82[_0x541a('0x1b')]],{'showHidden':![],'depth':null}));this[_0x541a('0x19')](_0x541a('0x3e'),_0x541a('0x66'),this[_0x541a('0xa')][_0x1b1e82['uniqueid']]);delete this['channels'][_0x1b1e82[_0x541a('0x1b')]];}else if(this[_0x541a('0xa')][_0x1b1e82[_0x541a('0x67')]]){this['channels'][_0x1b1e82['linkedid']][_0x541a('0x1b')]=this[_0x541a('0xa')][_0x1b1e82[_0x541a('0x67')]][_0x541a('0x68')];}if(this[_0x541a('0xe')][_0x1b1e82['uniqueid']]){delete this[_0x541a('0xe')][_0x1b1e82[_0x541a('0x1b')]];}}}catch(_0xa8517){logger[_0x541a('0x2c')]('[%s][voiceDialReport][hangup]',_0x1b1e82[_0x541a('0x1b')],util['inspect'](_0xa8517,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x541a('0x16')][_0x541a('0x69')]=function(_0x203bb4){try{if(this[_0x541a('0x17')](_0x203bb4)){logger[_0x541a('0x1a')](_0x541a('0x6a'),_0x203bb4[_0x541a('0x1b')],util[_0x541a('0x1c')](_0x203bb4,{'showHidden':![],'depth':null}));if(_0x203bb4[_0x541a('0x6b')][_0x541a('0x6c')]()===_0x541a('0x6d')){_0x203bb4[_0x541a('0x6e')]=(_0x203bb4['appdata']||_0x203bb4[_0x541a('0x6e')])[_0x541a('0x6c')]();if(_[_0x541a('0x6f')](_0x203bb4[_0x541a('0x6e')],'cdr(')){if(_[_0x541a('0x18')](this[_0x541a('0xd')][_0x203bb4[_0x541a('0x1b')]]))this[_0x541a('0xd')][_0x203bb4[_0x541a('0x1b')]]={};logger[_0x541a('0x26')]('[%s][voiceDialReport][newexten]\x20application:%s\x20appdata:%s',_0x203bb4['uniqueid'],_0x203bb4[_0x541a('0x6b')],_0x203bb4['applicationdata']);var _0x2f30d=_0x203bb4['applicationdata'][_0x541a('0x70')]('=');var _0x145553=_0x2f30d[0x0][_0x541a('0x71')](/cdr\((.*)\)/);if(_0x145553)this[_0x541a('0xd')][_0x203bb4['uniqueid']][_0x145553[0x1]]=_0x2f30d[0x1];}}}}catch(_0x4d5ffb){logger[_0x541a('0x2c')](_0x541a('0x72'),_0x203bb4[_0x541a('0x1b')],util['inspect'](_0x4d5ffb,{'showHidden':![],'depth':null}));}};module[_0x541a('0x73')]=VoiceDialReport; \ No newline at end of file +var _0x2ff3=['linkedid','destuniqueid','[%s][voiceDialReport][hangup]','set','applicationdata','toLowerCase','startsWith','cdr(','[%s][voiceDialReport][newexten]\x20application:%s\x20appdata:%s','split','match','exports','lodash','moment','../../../config/logger','ami','../ami','redis','defaults','socket.io-emitter','channels','outbound','applications','variables','syncDialBegin','dialend','syncDialEnd','bind','varset','newexten','syncNewExten','hangup','syncHangup','isNotNull','isUndefined','prototype','emit','debug','uniqueid','inspect','merge','format','channel','substring','lastIndexOf','omit','event','privilege','info','[%s][voiceDialReport][dialbegin]\x20agent:%s\x20interface:%s\x20lastevent:called','membername','interface','voice:outbound','voice_outbound_channel:save','[%s][voiceDialReport][dialbegin]\x20sending\x20dialbegin\x20event:','custom:dialbegin','[%s][voiceDialReport][dialbegin]','[%s][voiceDialReport][dialend]\x20event:','dialstatus','connectedlinenum','connectedlinename','answertime','YYYY-MM-DD\x20HH:mm:ss','lastevent','connect','[%s][voiceDialReport][dialend]\x20agent:%s\x20lastevent:connect','[%s][voiceDialReport][dialend]\x20sending\x20dialconnect\x20event:','custom:dialconnect','[%s][voiceDialReport][dialend]\x20sending\x20voice_outbound_channel:save\x20event:','error','keys','value','variable','voice','[%s][voiceDialReport][varset]\x20outboundrouteid:%s\x20variable:%s\x20value:%s','outboundrouteid','[%s][voiceDialReport][varset]\x20sending\x20voice_outbound_channel:save\x20event:','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepvtcallid','membercalls','memberdynamic','memberlastcall','memberpenalty','memberrealtime','isNil','includes','[%s][voiceDialReport][hangup]\x20event:','[%s][voiceDialReport][hangup]\x20reason:%s\x20lasteevent:complete','cause-txt','endtime','duration','diff','starttime','seconds','complete','answered','holdtime','billableseconds','sumHoldTime','sumBillable','sumDuration','[%s][voiceDialReport][hangup]\x20sending\x20voiceDialReport\x20event:','[%s][voiceDialReport][hangup]\x20sending\x20dialend\x20event:','custom:dialend','[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound:save\x20event:','[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event','stringify','voice_outbound_channel:remove'];(function(_0x492b21,_0x4581c0){var _0x984eb0=function(_0x41c802){while(--_0x41c802){_0x492b21['push'](_0x492b21['shift']());}};_0x984eb0(++_0x4581c0);}(_0x2ff3,0xf4));var _0x32ff=function(_0x1e6df8,_0x49163f){_0x1e6df8=_0x1e6df8-0x0;var _0x206730=_0x2ff3[_0x1e6df8];return _0x206730;};'use strict';var _=require(_0x32ff('0x0'));var moment=require(_0x32ff('0x1'));var util=require('util');var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require(_0x32ff('0x2'))(_0x32ff('0x3'));var ami=require(_0x32ff('0x4'));config[_0x32ff('0x5')]=_[_0x32ff('0x6')](config[_0x32ff('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x32ff('0x7'))(new Redis(config['redis']));function VoiceDialReport(_0x4b2664){this[_0x32ff('0x8')]=_0x4b2664['outboundChannels'];this[_0x32ff('0x9')]=_0x4b2664[_0x32ff('0x9')];this[_0x32ff('0xa')]={};this[_0x32ff('0xb')]={};ami['on']('dialbegin',this[_0x32ff('0xc')]['bind'](this));ami['on'](_0x32ff('0xd'),this[_0x32ff('0xe')][_0x32ff('0xf')](this));ami['on'](_0x32ff('0x10'),this['syncVarSet'][_0x32ff('0xf')](this));ami['on'](_0x32ff('0x11'),this[_0x32ff('0x12')][_0x32ff('0xf')](this));ami['on'](_0x32ff('0x13'),this[_0x32ff('0x14')][_0x32ff('0xf')](this));}VoiceDialReport['prototype'][_0x32ff('0x15')]=function(_0x139cf2){return _0x139cf2!==null&&!_[_0x32ff('0x16')](_0x139cf2);};VoiceDialReport[_0x32ff('0x17')]['emit']=function(_0x176a6c,_0x1b36f2,_0x138c26){io['to'](_0x176a6c)[_0x32ff('0x18')](_0x1b36f2,_0x138c26);};VoiceDialReport[_0x32ff('0x17')]['syncDialBegin']=function(_0x5f0047){try{if(this[_0x32ff('0x15')](_0x5f0047)){logger[_0x32ff('0x19')]('[%s][voiceDialReport][dialbegin]\x20event:',_0x5f0047[_0x32ff('0x1a')],util[_0x32ff('0x1b')](_0x5f0047,{'showHidden':![],'depth':null}));if(this[_0x32ff('0x8')][_0x5f0047[_0x32ff('0x1a')]]){_[_0x32ff('0x1c')](this[_0x32ff('0x8')][_0x5f0047[_0x32ff('0x1a')]],{'starttime':moment()[_0x32ff('0x1d')]('YYYY-MM-DD\x20HH:mm:ss'),'lastevent':'called','interface':_0x5f0047[_0x32ff('0x1e')][_0x32ff('0x1f')](0x0,_0x5f0047['channel'][_0x32ff('0x20')]('-')),'membername':_0x5f0047['channel'][_0x32ff('0x1f')](_0x5f0047[_0x32ff('0x1e')][_0x32ff('0x20')]('/')+0x1,_0x5f0047[_0x32ff('0x1e')][_0x32ff('0x20')]('-'))},_[_0x32ff('0x21')](_0x5f0047,[_0x32ff('0x22'),_0x32ff('0x23')]));logger[_0x32ff('0x24')](_0x32ff('0x25'),_0x5f0047[_0x32ff('0x1a')],this['channels'][_0x5f0047['uniqueid']][_0x32ff('0x26')],this[_0x32ff('0x8')][_0x5f0047[_0x32ff('0x1a')]][_0x32ff('0x27')]);logger[_0x32ff('0x19')]('[%s][voiceDialReport][dialbegin]\x20sending\x20voice_outbound_channel:save\x20event:',_0x5f0047['uniqueid'],util[_0x32ff('0x1b')](this['channels'][_0x5f0047[_0x32ff('0x1a')]],{'showHidden':![],'depth':null}));if(this[_0x32ff('0xa')][_0x5f0047[_0x32ff('0x1a')]])_['merge'](this[_0x32ff('0x8')][_0x5f0047['uniqueid']],this[_0x32ff('0xa')][_0x5f0047[_0x32ff('0x1a')]]);this[_0x32ff('0x18')](_0x32ff('0x28'),_0x32ff('0x29'),this[_0x32ff('0x8')][_0x5f0047['uniqueid']]);logger[_0x32ff('0x19')](_0x32ff('0x2a'),_0x5f0047[_0x32ff('0x1a')],util['inspect'](this['channels'][_0x5f0047[_0x32ff('0x1a')]],{'showHidden':![],'depth':null}));ami['emit'](_0x32ff('0x2b'),this[_0x32ff('0x8')][_0x5f0047[_0x32ff('0x1a')]]);}}}catch(_0x409307){logger['error'](_0x32ff('0x2c'),_0x5f0047['uniqueid'],util[_0x32ff('0x1b')](_0x409307,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype'][_0x32ff('0xe')]=function(_0x1269db){try{if(this[_0x32ff('0x15')](_0x1269db)){logger[_0x32ff('0x19')](_0x32ff('0x2d'),_0x1269db[_0x32ff('0x1a')],util[_0x32ff('0x1b')](_0x1269db,{'showHidden':![],'depth':null}));if(this['channels'][_0x1269db[_0x32ff('0x1a')]]){this['channels'][_0x1269db[_0x32ff('0x1a')]]['dialstatus']=_0x1269db[_0x32ff('0x2e')];if(_0x1269db['dialstatus']==='ANSWER'){this[_0x32ff('0x8')][_0x1269db[_0x32ff('0x1a')]][_0x32ff('0x2f')]=_0x1269db[_0x32ff('0x2f')];this[_0x32ff('0x8')][_0x1269db[_0x32ff('0x1a')]][_0x32ff('0x30')]=_0x1269db[_0x32ff('0x30')];this[_0x32ff('0x8')][_0x1269db[_0x32ff('0x1a')]][_0x32ff('0x31')]=moment()[_0x32ff('0x1d')](_0x32ff('0x32'));this[_0x32ff('0x8')][_0x1269db[_0x32ff('0x1a')]][_0x32ff('0x33')]=_0x32ff('0x34');logger[_0x32ff('0x24')](_0x32ff('0x35'),_0x1269db[_0x32ff('0x1a')],_0x1269db[_0x32ff('0x1e')][_0x32ff('0x1f')](_0x1269db[_0x32ff('0x1e')][_0x32ff('0x20')]('/')+0x1,_0x1269db[_0x32ff('0x1e')][_0x32ff('0x20')]('-')));logger[_0x32ff('0x19')](_0x32ff('0x36'),_0x1269db[_0x32ff('0x1a')],util[_0x32ff('0x1b')](this[_0x32ff('0x8')][_0x1269db[_0x32ff('0x1a')]],{'showHidden':![],'depth':null}));ami['emit'](_0x32ff('0x37'),this[_0x32ff('0x8')][_0x1269db['uniqueid']]);}logger['debug'](_0x32ff('0x38'),_0x1269db[_0x32ff('0x1a')],util[_0x32ff('0x1b')](this[_0x32ff('0x8')][_0x1269db[_0x32ff('0x1a')]],{'showHidden':![],'depth':null}));this['emit'](_0x32ff('0x28'),_0x32ff('0x29'),this[_0x32ff('0x8')][_0x1269db['uniqueid']]);}}}catch(_0xf1347e){logger[_0x32ff('0x39')]('[%s][voiceDialReport][dialend]',_0x1269db[_0x32ff('0x1a')],util[_0x32ff('0x1b')](_0xf1347e,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x32ff('0x17')]['syncVarSet']=function(_0x5e8b06){try{if(this[_0x32ff('0x15')](_0x5e8b06)){logger[_0x32ff('0x19')]('[%s][voiceDialReport][varset]\x20event:',_0x5e8b06[_0x32ff('0x1a')],util[_0x32ff('0x1b')](_0x5e8b06,{'showHidden':![],'depth':null}));this['addVariable'](_0x5e8b06[_0x32ff('0x1a')],_[_0x32ff('0x3a')](_0x5e8b06['variable'])[0x0],_0x5e8b06[_0x32ff('0x3b')]);if(this[_0x32ff('0x15')](_0x5e8b06[_0x32ff('0x3c')])&&this['isNotNull'](_0x5e8b06[_0x32ff('0x3c')]['outboundrouteid'])){if(_[_0x32ff('0x16')](this[_0x32ff('0x8')][_0x5e8b06[_0x32ff('0x1a')]])){this[_0x32ff('0x8')][_0x5e8b06[_0x32ff('0x1a')]]={'routeId':_0x5e8b06[_0x32ff('0x3b')],'variables':this[_0x32ff('0xb')][_0x5e8b06[_0x32ff('0x1a')]],'motionChannel':_0x32ff('0x3d')};logger[_0x32ff('0x24')](_0x32ff('0x3e'),_0x5e8b06[_0x32ff('0x1a')],_0x5e8b06[_0x32ff('0x3c')][_0x32ff('0x3f')],_['keys'](_0x5e8b06[_0x32ff('0x3c')])[0x0],_0x5e8b06[_0x32ff('0x3b')]);logger['debug'](_0x32ff('0x40'),_0x5e8b06['uniqueid'],util[_0x32ff('0x1b')](this['channels'][_0x5e8b06['uniqueid']],{'showHidden':![],'depth':null}));this[_0x32ff('0x18')]('voice:outbound','voice_outbound_channel:save',this['channels'][_0x5e8b06[_0x32ff('0x1a')]]);}}}}catch(_0x4754e6){logger[_0x32ff('0x39')]('[%s][voiceDialReport][varset]',_0x5e8b06[_0x32ff('0x1a')],util[_0x32ff('0x1b')](_0x4754e6,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x32ff('0x17')]['addVariable']=function(_0x416838,_0xb12496,_0x4c7b3b){var _0x3855c7=[_0x32ff('0x41'),_0x32ff('0x42'),_0x32ff('0x43'),_0x32ff('0x44'),_0x32ff('0x45'),_0x32ff('0x46'),'rtpaudioqosrtt',_0x32ff('0x47'),_0x32ff('0x48'),_0x32ff('0x49'),'bridgepeer',_0x32ff('0x4a'),_0x32ff('0x4b'),_0x32ff('0x4c'),'memberinterface',_0x32ff('0x4d'),_0x32ff('0x26'),_0x32ff('0x4e'),_0x32ff('0x4f')];if(!_[_0x32ff('0x50')](_0xb12496)&&!_[_0x32ff('0x51')](_0x3855c7,_0xb12496)){if(_[_0x32ff('0x16')](this[_0x32ff('0xb')][_0x416838])){this['variables'][_0x416838]={};}this[_0x32ff('0xb')][_0x416838][_0xb12496]=_0x4c7b3b;}};VoiceDialReport[_0x32ff('0x17')][_0x32ff('0x14')]=function(_0x14fe15){try{if(this[_0x32ff('0x15')](_0x14fe15)){logger[_0x32ff('0x19')](_0x32ff('0x52'),_0x14fe15[_0x32ff('0x1a')],util['inspect'](_0x14fe15,{'showHidden':![],'depth':null}));if(this[_0x32ff('0x8')][_0x14fe15[_0x32ff('0x1a')]]){logger['info'](_0x32ff('0x53'),_0x14fe15['uniqueid'],_0x14fe15[_0x32ff('0x54')]);this[_0x32ff('0x8')][_0x14fe15['uniqueid']][_0x32ff('0x55')]=moment()[_0x32ff('0x1d')](_0x32ff('0x32'));this['channels'][_0x14fe15[_0x32ff('0x1a')]][_0x32ff('0x56')]=moment(this['channels'][_0x14fe15[_0x32ff('0x1a')]][_0x32ff('0x55')])[_0x32ff('0x57')](this[_0x32ff('0x8')][_0x14fe15[_0x32ff('0x1a')]][_0x32ff('0x58')],_0x32ff('0x59'));this[_0x32ff('0x8')][_0x14fe15[_0x32ff('0x1a')]]['lastevent']=_0x32ff('0x5a');this[_0x32ff('0x9')]['total']+=0x1;if(this[_0x32ff('0x8')][_0x14fe15[_0x32ff('0x1a')]]['answertime']){this['outbound'][_0x32ff('0x5b')]+=0x1;this[_0x32ff('0x8')][_0x14fe15['uniqueid']][_0x32ff('0x5c')]=moment(this[_0x32ff('0x8')][_0x14fe15[_0x32ff('0x1a')]][_0x32ff('0x31')])['diff'](this['channels'][_0x14fe15[_0x32ff('0x1a')]][_0x32ff('0x58')],_0x32ff('0x59'));this['channels'][_0x14fe15['uniqueid']][_0x32ff('0x5d')]=moment(this[_0x32ff('0x8')][_0x14fe15['uniqueid']][_0x32ff('0x55')])['diff'](this[_0x32ff('0x8')][_0x14fe15[_0x32ff('0x1a')]]['answertime'],_0x32ff('0x59'));this[_0x32ff('0x9')][_0x32ff('0x5e')]+=this[_0x32ff('0x8')][_0x14fe15[_0x32ff('0x1a')]][_0x32ff('0x5c')]||0x0;this[_0x32ff('0x9')][_0x32ff('0x5f')]+=this[_0x32ff('0x8')][_0x14fe15['uniqueid']][_0x32ff('0x5d')];}this['outbound'][_0x32ff('0x60')]+=this[_0x32ff('0x8')][_0x14fe15[_0x32ff('0x1a')]][_0x32ff('0x56')];logger[_0x32ff('0x19')](_0x32ff('0x61'),_0x14fe15[_0x32ff('0x1a')],util['inspect'](this['channels'][_0x14fe15[_0x32ff('0x1a')]],{'showHidden':![],'depth':null}));ami[_0x32ff('0x18')]('custom:voiceDialReport',this[_0x32ff('0x8')][_0x14fe15[_0x32ff('0x1a')]]);logger[_0x32ff('0x19')](_0x32ff('0x62'),_0x14fe15[_0x32ff('0x1a')],util[_0x32ff('0x1b')](this[_0x32ff('0x8')][_0x14fe15[_0x32ff('0x1a')]],{'showHidden':![],'depth':null}));ami[_0x32ff('0x18')](_0x32ff('0x63'),this[_0x32ff('0x8')][_0x14fe15[_0x32ff('0x1a')]]);logger['debug'](_0x32ff('0x64'),_0x14fe15[_0x32ff('0x1a')],util[_0x32ff('0x1b')](this[_0x32ff('0x8')][_0x14fe15[_0x32ff('0x1a')]],{'showHidden':![],'depth':null}));this['emit'](_0x32ff('0x28'),'voice_outbound:save',this[_0x32ff('0x9')]);logger['info'](_0x32ff('0x65'),JSON[_0x32ff('0x66')](this[_0x32ff('0x8')][_0x14fe15[_0x32ff('0x1a')]]));logger[_0x32ff('0x19')]('[%s][voiceDialReport][hangup]\x20sending\x20voice_outbound_channel:remove\x20event:',_0x14fe15['uniqueid'],util[_0x32ff('0x1b')](this[_0x32ff('0x8')][_0x14fe15[_0x32ff('0x1a')]],{'showHidden':![],'depth':null}));this[_0x32ff('0x18')](_0x32ff('0x28'),_0x32ff('0x67'),this[_0x32ff('0x8')][_0x14fe15[_0x32ff('0x1a')]]);delete this['channels'][_0x14fe15[_0x32ff('0x1a')]];}else if(this['channels'][_0x14fe15[_0x32ff('0x68')]]){this[_0x32ff('0x8')][_0x14fe15['linkedid']]['uniqueid']=this[_0x32ff('0x8')][_0x14fe15['linkedid']][_0x32ff('0x69')];}if(this[_0x32ff('0xb')][_0x14fe15[_0x32ff('0x1a')]]){delete this['variables'][_0x14fe15[_0x32ff('0x1a')]];}}}catch(_0x432c3b){logger['error'](_0x32ff('0x6a'),_0x14fe15[_0x32ff('0x1a')],util[_0x32ff('0x1b')](_0x432c3b,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x32ff('0x17')]['syncNewExten']=function(_0x44bdd7){try{if(this['isNotNull'](_0x44bdd7)){logger[_0x32ff('0x19')]('[%s][voiceDialReport][newexten]\x20event:',_0x44bdd7[_0x32ff('0x1a')],util[_0x32ff('0x1b')](_0x44bdd7,{'showHidden':![],'depth':null}));if(_0x44bdd7['application']['toLowerCase']()===_0x32ff('0x6b')){_0x44bdd7[_0x32ff('0x6c')]=(_0x44bdd7['appdata']||_0x44bdd7[_0x32ff('0x6c')])[_0x32ff('0x6d')]();if(_[_0x32ff('0x6e')](_0x44bdd7['applicationdata'],_0x32ff('0x6f'))){if(_[_0x32ff('0x16')](this[_0x32ff('0xa')][_0x44bdd7[_0x32ff('0x1a')]]))this[_0x32ff('0xa')][_0x44bdd7[_0x32ff('0x1a')]]={};logger[_0x32ff('0x24')](_0x32ff('0x70'),_0x44bdd7[_0x32ff('0x1a')],_0x44bdd7['application'],_0x44bdd7['applicationdata']);var _0x31aa93=_0x44bdd7[_0x32ff('0x6c')][_0x32ff('0x71')]('=');var _0x123b13=_0x31aa93[0x0][_0x32ff('0x72')](/cdr\((.*)\)/);if(_0x123b13)this['applications'][_0x44bdd7[_0x32ff('0x1a')]][_0x123b13[0x1]]=_0x31aa93[0x1];}}}}catch(_0x1a0de1){logger[_0x32ff('0x39')]('[%s][voiceDialReport][newexten]',_0x44bdd7[_0x32ff('0x1a')],util[_0x32ff('0x1b')](_0x1a0de1,{'showHidden':![],'depth':null}));}};module[_0x32ff('0x73')]=VoiceDialReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceQueueReport.js b/server/services/ami/report/voiceQueueReport.js index bee8cd8..4d09396 100644 --- a/server/services/ami/report/voiceQueueReport.js +++ b/server/services/ami/report/voiceQueueReport.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdeb3=['ioredis','../../../config/environment','../../../config/logger','ami','../ami','redis','localhost','socket.io-emitter','prototype','tail','finally','sequence','queueReports','agents','voiceQueues','flagQueueSummary','campaigns','variables','syncQueueSummary','bind','queuesummarycomplete','syncQueueSummaryComplete','queuecallerjoin','syncQueueCallerJoin','syncQueueCallerAbandon','syncQueueCallerLeave','agentconnect','syncAgentConnect','syncVarSet','hangup','syncHangup','fullybooted','syncFullyBooted','syncNewExten','musiconholdstart','syncMusicOnHoldStart','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopQueueShow','isEmpty','hasOwnProperty','originated','talking','waiting','queueStatusComplete','clearZombieChannels','channels','enqueue','isNil','status','channel','catch','message','No\x20such\x20channel','error','[%s][voiceQueueReport][checkChannel]','inspect','[%s][voiceQueueReport][checkQueueReport]','[%s][voiceQueueReport][checkVariables]','[FullyBooted]\x20clear\x20realtime','clearQueueReport','emitVoiceQueueChannelRemove','emit','emitVoiceQueueChannelSave','debug','[%s][voiceQueueReport][',']\x20sending\x20voice_queue_channel:save\x20event:','uniqueid','format','voice_queue_presence:save','voice:queue:%s','voice_queue_channel:remove','voice_queue_presence:remove','emitVoiceQueueSummary','type','inbound','name','strategy','answered','pTalking','sumBillable','sumDuration','sumHoldTime','unmanaged','abandoned','Trunk','active','callerid','Interval','voice_queue:save','isNotNull','isUndefined','queues','[voiceQueueReport][queues]','loopQueueSummary','Action','queuesummary','then','queue','[voiceQueueReport][queuesummary]\x20event:','info','[voiceQueueReport][queuesummary]\x20name:%s','countBy','toNumber','callers','loggedin','available','loggedIn','[voiceQueueReport][queuesummary]\x20sending\x20queuesummary\x20event:','custom:queuesummary','[voiceQueueReport][queuesummary]','[voiceQueueReport][queuesummarycomplete]\x20event:','[%s][voiceQueueReport][queuecallerjoin]','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','position','count','routealias','[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s','merge','keys','push','[%s][voiceQueueReport][queuecallerabandon]','last','queuecallercomplete','holdtime','originalposition','queuecallerabandon','queuecallerabandonAt','queuecallerexitreason','ABANDONED','lastAssignedTo','[voiceQueueReport][queuecallerabandon]\x20name:%s\x20type:%s','[%s][voiceQueueReport][queuecallerleave]','connectedlinename','[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','queuecallerleave','[%s][voiceQueueReport][agentconnect]','COMPLETEDBYAGENT','[voiceQueueReport][agentconnect]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETEDBYAGENT','syncAgentComplete','[%s][voiceQueueReport][agentcomplete]','assigned','queuecallerexit','queuecallerexitAt','transfer','reason','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:COMPLETED','startsWith','toLowerCase','local/','linkedid','add','FORWARDTRANSFER','transfertype','transferexten','transferuniqueid','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER','COMPLETEDBY','toUpperCase','[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s','[%s][voiceQueueReport][varset]','addVariable','value','variable','queuestatus','CONTINUE','lastevent','timeout','varset','queueposition','EXITWITHKEY','queuecallerleaveAt','[%s][voiceQueueReport][varset]\x20name:%s\x20type:%s\x20variable:%s\x20value:%s','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','sipcallid','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberlastcall','membername','memberpenalty','memberrealtime','includes','[%s][voiceQueueReport][hangup]','seconds','milliseconds','diff','total','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerunmanaged\x20event:','custom:queuecallerunmanaged','[%s][voiceQueueReport][hangup]\x20sending\x20queuecallerabandon\x20event:','custom:queuecallerabandon','[%s][voiceQueueReport][hangup]\x20name:%s\x20type:%s\x20reason:%s','cause-txt','[%s][voiceQueueReport][hangup]\x20sending\x20voiceQueueReport\x20event:','custom:voiceQueueReport','transfereeuniqueid','secondtransfereruniqueid','ATTENDEDTRANSFER','ATTENDED','switch','[%s][voiceQueueReport][attendedTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','transfertargetuniqueid','origtransfererexten','origtransfereruniqueid','[%s][voiceQueueReport][blindtransfer]','BLIND','[%s][voiceQueueReport][blindTransfer]\x20name:%s\x20type:%s\x20transferexten:%s\x20transferuniqueid:%s','BlindTransfer','transfererchannel','[%s][voiceQueueReport][musiconholdstart]','mohstarttime','[%s][voiceQueueReport][musiconholdstart]\x20mohstarttime:%s','[%s][voiceQueueReport][musiconholdstop]\x20mohtime:%s','mohtime','[%s][voiceQueueReport][musiconholdstop]','[%s][voiceQueueReport][newexten]\x20event:','application','set','appdata','applicationdata','split','match','lodash','moment','util','md5'];(function(_0x533937,_0x19ac98){var _0x5ded47=function(_0x34332b){while(--_0x34332b){_0x533937['push'](_0x533937['shift']());}};_0x5ded47(++_0x19ac98);}(_0xdeb3,0xeb));var _0x3deb=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xdeb3[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x3deb('0x0'));var moment=require(_0x3deb('0x1'));var util=require(_0x3deb('0x2'));var md5=require(_0x3deb('0x3'));var Redis=require(_0x3deb('0x4'));var config=require(_0x3deb('0x5'));var logger=require(_0x3deb('0x6'))(_0x3deb('0x7'));var ami=require(_0x3deb('0x8'));var QueueReport=require('../model/queueReport');config['redis']=_['defaults'](config[_0x3deb('0x9')],{'host':_0x3deb('0xa'),'port':0x18eb});var io=require(_0x3deb('0xb'))(new Redis(config[_0x3deb('0x9')]));var Sequence=function(){};Sequence[_0x3deb('0xc')]['enqueue']=function(_0x571adc){this[_0x3deb('0xd')]=this[_0x3deb('0xd')]?this[_0x3deb('0xd')][_0x3deb('0xe')](_0x571adc):_0x571adc();};function VoiceQueueReport(_0x2363cc){this[_0x3deb('0xf')]=new Sequence();this[_0x3deb('0x10')]={};this[_0x3deb('0x11')]=_0x2363cc['agents'];this['channels']=_0x2363cc['queueChannels'];this[_0x3deb('0x12')]=_0x2363cc['voiceQueues'];this[_0x3deb('0x13')]=!![];this[_0x3deb('0x14')]=_0x2363cc[_0x3deb('0x14')];this[_0x3deb('0x15')]={};ami['on']('queuesummary',this[_0x3deb('0x16')][_0x3deb('0x17')](this));ami['on'](_0x3deb('0x18'),this[_0x3deb('0x19')][_0x3deb('0x17')](this));ami['on'](_0x3deb('0x1a'),this[_0x3deb('0x1b')][_0x3deb('0x17')](this));ami['on']('queuecallerabandon',this[_0x3deb('0x1c')][_0x3deb('0x17')](this));ami['on']('queuecallerleave',this[_0x3deb('0x1d')][_0x3deb('0x17')](this));ami['on']('agentcomplete',this['syncAgentComplete']['bind'](this));ami['on'](_0x3deb('0x1e'),this[_0x3deb('0x1f')]['bind'](this));ami['on']('varset',this[_0x3deb('0x20')][_0x3deb('0x17')](this));ami['on'](_0x3deb('0x21'),this[_0x3deb('0x22')]['bind'](this));ami['on'](_0x3deb('0x23'),this[_0x3deb('0x24')][_0x3deb('0x17')](this));ami['on']('newexten',this[_0x3deb('0x25')][_0x3deb('0x17')](this));ami['on'](_0x3deb('0x26'),this[_0x3deb('0x27')][_0x3deb('0x17')](this));ami['on']('musiconholdstop',this[_0x3deb('0x28')][_0x3deb('0x17')](this));ami['on'](_0x3deb('0x29'),this[_0x3deb('0x2a')][_0x3deb('0x17')](this));ami['on'](_0x3deb('0x2b'),this[_0x3deb('0x2c')][_0x3deb('0x17')](this));this['loopQueueSummary']();this[_0x3deb('0x2d')]();}function clearChannels(_0x27c31e){if(!_[_0x3deb('0x2e')](_0x27c31e)){for(var _0x427f9f in _0x27c31e){if(_0x27c31e[_0x3deb('0x2f')](_0x427f9f)){delete _0x27c31e[_0x427f9f];}}}}function clearCampaigns(_0x4a5b3e){if(!_[_0x3deb('0x2e')](_0x4a5b3e)){for(var _0x225ea9 in _0x4a5b3e){if(_0x4a5b3e[_0x3deb('0x2f')](_0x225ea9)){_0x4a5b3e[_0x225ea9][_0x3deb('0x30')]=0x0;}}}}function clearVoiceQueues(_0xec30ee){if(!_[_0x3deb('0x2e')](_0xec30ee)){for(var _0xff692b in _0xec30ee){if(_0xec30ee['hasOwnProperty'](_0xff692b)){_0xec30ee[_0xff692b]['originated']=0x0;_0xec30ee[_0xff692b][_0x3deb('0x31')]=0x0;_0xec30ee[_0xff692b]['pTalking']=0x0;_0xec30ee[_0xff692b][_0x3deb('0x32')]=0x0;_0xec30ee[_0xff692b][_0x3deb('0x33')]=!![];}}}}function clearAgentBooked(_0x2bd20f){if(!_['isEmpty'](_0x2bd20f)){for(var _0x460512 in _0x2bd20f){if(_0x2bd20f['hasOwnProperty'](_0x460512)){_0x2bd20f[_0x460512]['unlockRR']=!![];}}}}VoiceQueueReport[_0x3deb('0xc')][_0x3deb('0x34')]=function(){var _0x29a190=this;for(var _0x7ecaa2 in this['channels']){if(this['channels'][_0x3deb('0x2f')](_0x7ecaa2)&&!this[_0x3deb('0x35')][_0x7ecaa2]['switch']){this['sequence'][_0x3deb('0x36')](function(){if(!_[_0x3deb('0x37')](_0x29a190[_0x3deb('0x35')][_0x7ecaa2])){return ami['Action']({'action':_0x3deb('0x38'),'channel':_0x29a190['channels'][_0x7ecaa2][_0x3deb('0x39')]})[_0x3deb('0x3a')](function(_0x7b3eb5){if(_0x7b3eb5[_0x3deb('0x3b')]===_0x3deb('0x3c')){setTimeout(function(){if(_0x29a190[_0x3deb('0x35')][_0x7ecaa2]){delete _0x29a190[_0x3deb('0x35')][_0x7ecaa2];logger[_0x3deb('0x3d')](_0x3deb('0x3e'),_0x7ecaa2,util[_0x3deb('0x3f')](_0x7b3eb5,{'showHidden':![],'depth':null}));}if(_0x29a190['queueReports'][_0x7ecaa2]){delete _0x29a190[_0x3deb('0x10')][_0x7ecaa2];logger[_0x3deb('0x3d')](_0x3deb('0x40'),_0x7ecaa2,util[_0x3deb('0x3f')](_0x7b3eb5,{'showHidden':![],'depth':null}));}if(_0x29a190[_0x3deb('0x15')][_0x7ecaa2]){delete _0x29a190[_0x3deb('0x15')][_0x7ecaa2];logger[_0x3deb('0x3d')](_0x3deb('0x41'),_0x7ecaa2,util[_0x3deb('0x3f')](_0x7b3eb5,{'showHidden':![],'depth':null}));}},0x1f40);}});}});}}};VoiceQueueReport[_0x3deb('0xc')][_0x3deb('0x24')]=function(){logger[_0x3deb('0x3d')](_0x3deb('0x42'));clearChannels(this[_0x3deb('0x35')]);this[_0x3deb('0x43')](this[_0x3deb('0x10')]);clearAgentBooked(this['agents']);clearVoiceQueues(this['voiceQueues']);clearCampaigns(this[_0x3deb('0x14')]);};VoiceQueueReport[_0x3deb('0xc')][_0x3deb('0x43')]=function(_0x4d48aa){var _0x3cd80f=this;if(!_['isEmpty'](_0x4d48aa)){for(var _0x3f03d9 in _0x4d48aa){if(_0x4d48aa['hasOwnProperty'](_0x3f03d9)){_0x3cd80f[_0x3deb('0x44')](_0x4d48aa[_0x3f03d9],'clearqueuereport');delete _0x4d48aa[_0x3f03d9];}}}};VoiceQueueReport[_0x3deb('0xc')][_0x3deb('0x45')]=function(_0x2635d2,_0x13bf3e,_0x553069){io['to'](_0x2635d2)[_0x3deb('0x45')](_0x13bf3e,_0x553069);};VoiceQueueReport['prototype'][_0x3deb('0x46')]=function(_0x30ed7c,_0x14b62f){logger[_0x3deb('0x47')](_0x3deb('0x48')+_0x14b62f+_0x3deb('0x49'),_0x30ed7c[_0x3deb('0x4a')],util[_0x3deb('0x3f')](_0x30ed7c,{'showHidden':![],'depth':null}));this['emit'](util[_0x3deb('0x4b')]('voice:queue:%s',_0x30ed7c['name']),'voice_queue_channel:save',_0x30ed7c);io[_0x3deb('0x45')](_0x3deb('0x4c'),_0x30ed7c);};VoiceQueueReport[_0x3deb('0xc')][_0x3deb('0x44')]=function(_0x27a64e,_0x7e7374){logger[_0x3deb('0x47')]('[%s][voiceQueueReport]['+_0x7e7374+']\x20sending\x20voice_queue_channel:remove\x20event:',_0x27a64e[_0x3deb('0x4a')],util[_0x3deb('0x3f')](_0x27a64e,{'showHidden':![],'depth':null}));this[_0x3deb('0x45')](util[_0x3deb('0x4b')](_0x3deb('0x4d'),_0x27a64e['name']),_0x3deb('0x4e'),_0x27a64e);io[_0x3deb('0x45')](_0x3deb('0x4f'),_0x27a64e);};VoiceQueueReport['prototype'][_0x3deb('0x50')]=function(_0x3e51a4,_0x2255b6){if(_0x3e51a4[_0x3deb('0x51')]===_0x3deb('0x52')){var _0x5c8041={'id':_0x3e51a4['id'],'name':_0x3e51a4[_0x3deb('0x53')],'strategy':_0x3e51a4[_0x3deb('0x54')],'answered':_0x3e51a4[_0x3deb('0x55')],'available':_0x3e51a4['available'],'loggedIn':_0x3e51a4['loggedIn'],'pTalking':_0x3e51a4[_0x3deb('0x56')],'sumBillable':_0x3e51a4[_0x3deb('0x57')],'sumDuration':_0x3e51a4[_0x3deb('0x58')],'sumHoldTime':_0x3e51a4[_0x3deb('0x59')]||0x0,'talking':_0x3e51a4[_0x3deb('0x31')],'total':_0x3e51a4['total'],'type':_0x3e51a4[_0x3deb('0x51')],'unmanaged':_0x3e51a4[_0x3deb('0x5a')],'abandoned':_0x3e51a4[_0x3deb('0x5b')],'waiting':_0x3e51a4[_0x3deb('0x32')]};if(_0x3e51a4[_0x3deb('0x5c')]){_0x5c8041[_0x3deb('0x5c')]={'id':_0x3e51a4[_0x3deb('0x5c')]['id'],'name':_0x3e51a4[_0x3deb('0x5c')][_0x3deb('0x53')],'active':_0x3e51a4['Trunk'][_0x3deb('0x5d')],'callerid':_0x3e51a4[_0x3deb('0x5c')][_0x3deb('0x5e')]};}if(_0x3e51a4[_0x3deb('0x5f')]){_0x5c8041[_0x3deb('0x5f')]={'id':_0x3e51a4['Interval']['id'],'name':_0x3e51a4[_0x3deb('0x5f')][_0x3deb('0x53')]};}var _0x52da66=md5(JSON['stringify'](_0x5c8041));if(_0x3e51a4['md5']!==_0x52da66){_0x3e51a4[_0x3deb('0x3')]=_0x52da66;logger[_0x3deb('0x47')]('[voiceQueueReport]['+_0x2255b6+']\x20sending\x20voice_queue:save\x20event:',util[_0x3deb('0x3f')](_0x5c8041,{'showHidden':![],'depth':null}));this[_0x3deb('0x45')](util[_0x3deb('0x4b')](_0x3deb('0x4d'),_0x5c8041['name']),_0x3deb('0x60'),_0x5c8041);}}};VoiceQueueReport[_0x3deb('0xc')][_0x3deb('0x61')]=function(_0x69178e){return _0x69178e!==null&&!_[_0x3deb('0x62')](_0x69178e);};VoiceQueueReport[_0x3deb('0xc')][_0x3deb('0x2d')]=function(){var _0x662ee6=this;setInterval(function(){_0x662ee6['clearZombieChannels']();ami['Action']({'action':_0x3deb('0x63')})[_0x3deb('0x3a')](function(_0x190a74){logger[_0x3deb('0x3d')](_0x3deb('0x64'),util[_0x3deb('0x3f')](_0x190a74,{'showHidden':![],'depth':null}));});},0x2710);};VoiceQueueReport[_0x3deb('0xc')][_0x3deb('0x65')]=function(){var _0x2bc3ae=this;setInterval(function(){if(_0x2bc3ae[_0x3deb('0x13')]){return ami[_0x3deb('0x66')]({'action':_0x3deb('0x67')})[_0x3deb('0x68')](function(_0xffad66){_0x2bc3ae['flagQueueSummary']=![];})['catch'](function(_0x17ff83){logger['error']('[voiceQueueReport][queuesummary]',util[_0x3deb('0x3f')](_0x17ff83,{'showHidden':![],'depth':null}));});}},0x3e8);};VoiceQueueReport[_0x3deb('0xc')][_0x3deb('0x16')]=function(_0x4195b5){try{if(this['isNotNull'](_0x4195b5)&&this[_0x3deb('0x61')](_0x4195b5[_0x3deb('0x69')])){logger[_0x3deb('0x47')](_0x3deb('0x6a'),util[_0x3deb('0x3f')](_0x4195b5,{'showHidden':![],'depth':null}));if(this[_0x3deb('0x12')][_0x4195b5[_0x3deb('0x69')]]){logger[_0x3deb('0x6b')](_0x3deb('0x6c'),_0x4195b5[_0x3deb('0x69')]);var _0x12ac44=_[_0x3deb('0x6d')](this[_0x3deb('0x35')],_0x3deb('0x69'))[_0x4195b5[_0x3deb('0x69')]]||0x0;var _0x44a950=_0x12ac44-_0x4195b5['callers'];if(this[_0x3deb('0x12')][_0x4195b5[_0x3deb('0x69')]][_0x3deb('0x32')]!==_[_0x3deb('0x6e')](_0x4195b5[_0x3deb('0x6f')])||this['voiceQueues'][_0x4195b5[_0x3deb('0x69')]]['loggedIn']!==_[_0x3deb('0x6e')](_0x4195b5[_0x3deb('0x70')])||this[_0x3deb('0x12')][_0x4195b5[_0x3deb('0x69')]][_0x3deb('0x71')]!==_[_0x3deb('0x6e')](_0x4195b5['available'])||this[_0x3deb('0x12')][_0x4195b5[_0x3deb('0x69')]][_0x3deb('0x31')]!==_0x44a950){this[_0x3deb('0x12')][_0x4195b5[_0x3deb('0x69')]][_0x3deb('0x32')]=_[_0x3deb('0x6e')](_0x4195b5[_0x3deb('0x6f')]);this[_0x3deb('0x12')][_0x4195b5[_0x3deb('0x69')]][_0x3deb('0x72')]=_[_0x3deb('0x6e')](_0x4195b5['loggedin']);this['voiceQueues'][_0x4195b5[_0x3deb('0x69')]][_0x3deb('0x71')]=_[_0x3deb('0x6e')](_0x4195b5[_0x3deb('0x71')]);this[_0x3deb('0x12')][_0x4195b5[_0x3deb('0x69')]]['talking']=_0x44a950>0x0?_0x44a950:0x0;this[_0x3deb('0x12')][_0x4195b5['queue']][_0x3deb('0x31')]=this[_0x3deb('0x12')][_0x4195b5[_0x3deb('0x69')]][_0x3deb('0x31')]>_[_0x3deb('0x6e')](_0x4195b5[_0x3deb('0x70')])?_['toNumber'](_0x4195b5[_0x3deb('0x70')]):this[_0x3deb('0x12')][_0x4195b5[_0x3deb('0x69')]][_0x3deb('0x31')];this[_0x3deb('0x50')](this[_0x3deb('0x12')][_0x4195b5[_0x3deb('0x69')]],'queuesummary');}logger[_0x3deb('0x47')](_0x3deb('0x73'),util[_0x3deb('0x3f')](this[_0x3deb('0x12')][_0x4195b5[_0x3deb('0x69')]],{'showHidden':![],'depth':null}));ami['emit'](_0x3deb('0x74'),this[_0x3deb('0x12')][_0x4195b5[_0x3deb('0x69')]]);}}}catch(_0x2b7063){logger[_0x3deb('0x3d')](_0x3deb('0x75'),util[_0x3deb('0x3f')](_0x2b7063,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3deb('0xc')][_0x3deb('0x19')]=function(_0xb05ab4){logger[_0x3deb('0x47')](_0x3deb('0x76'),util[_0x3deb('0x3f')](_0xb05ab4,{'showHidden':![],'depth':null}));this['flagQueueSummary']=!![];};VoiceQueueReport[_0x3deb('0xc')][_0x3deb('0x1b')]=function(_0x17f3fe){try{if(this[_0x3deb('0x61')](_0x17f3fe)){logger[_0x3deb('0x47')](_0x3deb('0x77'),_0x17f3fe[_0x3deb('0x4a')],util['inspect'](_0x17f3fe,{'showHidden':![],'depth':null}));if(_[_0x3deb('0x62')](this[_0x3deb('0x10')][_0x17f3fe[_0x3deb('0x4a')]]))this[_0x3deb('0x10')][_0x17f3fe[_0x3deb('0x4a')]]=[];if(_[_0x3deb('0x62')](this[_0x3deb('0x35')][_0x17f3fe[_0x3deb('0x4a')]]))this[_0x3deb('0x35')][_0x17f3fe[_0x3deb('0x4a')]]={};var _0x1897f9=new QueueReport();_0x1897f9['name']=_0x17f3fe[_0x3deb('0x69')];_0x1897f9[_0x3deb('0x51')]=this['voiceQueues'][_0x1897f9[_0x3deb('0x53')]]&&this[_0x3deb('0x12')][_0x1897f9[_0x3deb('0x53')]]['type']?this[_0x3deb('0x12')][_0x1897f9['name']]['type']||_0x3deb('0x52'):'inbound';_0x1897f9[_0x3deb('0x69')]=_0x17f3fe[_0x3deb('0x69')];_0x1897f9[_0x3deb('0x78')]=moment()['format'](_0x3deb('0x79'));_0x1897f9['position']=_0x17f3fe[_0x3deb('0x7a')];_0x1897f9[_0x3deb('0x7b')]=_0x17f3fe[_0x3deb('0x7b')];_0x1897f9[_0x3deb('0x4a')]=_0x17f3fe['uniqueid'];_0x1897f9[_0x3deb('0x7c')]=this[_0x3deb('0x35')][_0x17f3fe[_0x3deb('0x4a')]][_0x3deb('0x7c')];logger[_0x3deb('0x6b')](_0x3deb('0x7d'),_0x1897f9[_0x3deb('0x53')],_0x1897f9['type']);_[_0x3deb('0x7e')](_0x1897f9,_['pick'](_0x17f3fe,_[_0x3deb('0x7f')](_0x1897f9)));this[_0x3deb('0x10')][_0x17f3fe[_0x3deb('0x4a')]][_0x3deb('0x80')](_0x1897f9);this[_0x3deb('0x35')][_0x17f3fe[_0x3deb('0x4a')]]=_0x1897f9;this['emitVoiceQueueChannelSave'](_0x1897f9,_0x3deb('0x1a'));}}catch(_0xd8b047){logger[_0x3deb('0x3d')](_0x3deb('0x77'),_0x17f3fe['uniqueid'],util['inspect'](_0xd8b047,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncQueueCallerAbandon']=function(_0x48cfda){try{if(this[_0x3deb('0x61')](_0x48cfda)){logger[_0x3deb('0x47')](_0x3deb('0x81'),_0x48cfda[_0x3deb('0x4a')],util['inspect'](_0x48cfda,{'showHidden':![],'depth':null}));if(this[_0x3deb('0x10')][_0x48cfda[_0x3deb('0x4a')]]){var _0x300151=_[_0x3deb('0x82')](this[_0x3deb('0x10')][_0x48cfda['uniqueid']]);_0x300151[_0x3deb('0x83')]=![];_0x300151['queuecallercompleteAt']=null;_0x300151[_0x3deb('0x84')]=_0x48cfda[_0x3deb('0x84')];_0x300151[_0x3deb('0x85')]=_0x48cfda[_0x3deb('0x85')];_0x300151[_0x3deb('0x86')]=!![];_0x300151[_0x3deb('0x87')]=moment()[_0x3deb('0x4b')](_0x3deb('0x79'));_0x300151[_0x3deb('0x88')]=_0x3deb('0x89');_0x300151[_0x3deb('0x8a')]=null;logger[_0x3deb('0x6b')](_0x3deb('0x8b'),_0x300151[_0x3deb('0x53')],_0x300151['type']);this[_0x3deb('0x35')][_0x48cfda[_0x3deb('0x4a')]]=_0x300151;this[_0x3deb('0x44')](_0x300151,'queuecallerabandon');}}}catch(_0x316b5e){logger[_0x3deb('0x3d')](_0x3deb('0x81'),_0x48cfda['uniqueid'],util['inspect'](_0x316b5e,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3deb('0xc')][_0x3deb('0x1d')]=function(_0x2eb8cf){try{if(this[_0x3deb('0x61')](_0x2eb8cf)){logger[_0x3deb('0x47')](_0x3deb('0x8c'),_0x2eb8cf['uniqueid'],util[_0x3deb('0x3f')](_0x2eb8cf,{'showHidden':![],'depth':null}));if(this[_0x3deb('0x10')][_0x2eb8cf[_0x3deb('0x4a')]]){var _0x42c042=_[_0x3deb('0x82')](this[_0x3deb('0x10')][_0x2eb8cf[_0x3deb('0x4a')]]);_0x42c042['queuecallerleaveAt']=moment()[_0x3deb('0x4b')](_0x3deb('0x79'));_0x42c042['connectedlinenum']=_0x2eb8cf['connectedlinenum'];_0x42c042[_0x3deb('0x8d')]=_0x2eb8cf[_0x3deb('0x8d')];logger[_0x3deb('0x6b')](_0x3deb('0x8e'),_0x42c042[_0x3deb('0x53')],_0x42c042[_0x3deb('0x51')],_0x2eb8cf[_0x3deb('0x8f')],_0x2eb8cf[_0x3deb('0x8d')]);this[_0x3deb('0x35')][_0x2eb8cf[_0x3deb('0x4a')]]=_0x42c042;this['emitVoiceQueueChannelSave'](_0x42c042,_0x3deb('0x90'));}}}catch(_0x4eaf94){logger['error']('[%s][voiceQueueReport][queuecallerleave]',_0x2eb8cf[_0x3deb('0x4a')],util[_0x3deb('0x3f')](_0x4eaf94,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncAgentConnect']=function(_0x4ca06d){try{if(this[_0x3deb('0x61')](_0x4ca06d)){logger[_0x3deb('0x47')](_0x3deb('0x91'),_0x4ca06d[_0x3deb('0x4a')],util['inspect'](_0x4ca06d,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x4ca06d[_0x3deb('0x4a')]]){var _0x465559=_[_0x3deb('0x82')](this[_0x3deb('0x10')][_0x4ca06d['uniqueid']]);_0x465559[_0x3deb('0x83')]=!![];_0x465559[_0x3deb('0x88')]=_0x3deb('0x92');logger[_0x3deb('0x6b')](_0x3deb('0x93'),_0x465559[_0x3deb('0x53')],_0x465559[_0x3deb('0x51')]);}}}catch(_0x1b29f5){logger[_0x3deb('0x3d')]('[%s][voiceQueueReport][agentconnect]',_0x4ca06d[_0x3deb('0x4a')],util[_0x3deb('0x3f')](_0x1b29f5,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3deb('0xc')][_0x3deb('0x94')]=function(_0x1a8714){try{if(this[_0x3deb('0x61')](_0x1a8714)){logger['debug'](_0x3deb('0x95'),_0x1a8714['uniqueid'],util['inspect'](_0x1a8714,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x1a8714[_0x3deb('0x4a')]]){var _0x57023f=_[_0x3deb('0x82')](this[_0x3deb('0x10')][_0x1a8714[_0x3deb('0x4a')]]);_0x57023f[_0x3deb('0x86')]=![];_0x57023f[_0x3deb('0x87')]=null;_0x57023f[_0x3deb('0x96')]=!![];_0x57023f[_0x3deb('0x8a')]=_0x1a8714['membername'];_0x57023f[_0x3deb('0x84')]=_0x1a8714['holdtime'];_0x57023f[_0x3deb('0x83')]=!![];_0x57023f[_0x3deb('0x97')]=![];_0x57023f[_0x3deb('0x98')]=null;if(!_0x57023f[_0x3deb('0x99')]){if(_0x1a8714[_0x3deb('0x9a')]==_0x3deb('0x99')){_0x57023f[_0x3deb('0x88')]='COMPLETED';logger['info'](_0x3deb('0x9b'),_0x57023f['name'],_0x57023f[_0x3deb('0x51')]);}else{if(_[_0x3deb('0x9c')](_0x1a8714[_0x3deb('0x39')][_0x3deb('0x9d')](),_0x3deb('0x9e'))){if(this[_0x3deb('0x10')][_0x1a8714[_0x3deb('0x9f')]]){var _0x2cbdd5=_['last'](this[_0x3deb('0x10')][_0x1a8714['linkedid']]);_0x2cbdd5[_0x3deb('0x83')]=![];_0x2cbdd5[_0x3deb('0x97')]=!![];_0x2cbdd5[_0x3deb('0x98')]=moment(_0x57023f[_0x3deb('0x78')])[_0x3deb('0xa0')](_0x1a8714[_0x3deb('0x84')],'seconds')[_0x3deb('0x4b')]('YYYY-MM-DD\x20HH:mm:ss');_0x2cbdd5['queuecallerexitreason']=_0x3deb('0xa1');_0x2cbdd5[_0x3deb('0x99')]=!![];_0x2cbdd5[_0x3deb('0xa2')]='FORWARD';_0x2cbdd5[_0x3deb('0xa3')]=_0x1a8714['destexten'];_0x2cbdd5[_0x3deb('0xa4')]=_0x1a8714[_0x3deb('0x4a')];logger['info'](_0x3deb('0xa5'),_0x2cbdd5[_0x3deb('0x53')],_0x2cbdd5['type']);var _0x49647f=this['queueReports'][_0x1a8714[_0x3deb('0x9f')]];this[_0x3deb('0x10')][_0x1a8714[_0x3deb('0x9f')]]=this[_0x3deb('0x10')][_0x1a8714[_0x3deb('0x4a')]];this[_0x3deb('0x10')][_0x1a8714[_0x3deb('0x4a')]]=_0x49647f;}}else{_0x57023f['queuecallerexitreason']=_0x3deb('0xa6')+_0x1a8714[_0x3deb('0x9a')][_0x3deb('0xa7')]();logger[_0x3deb('0x6b')](_0x3deb('0xa8'),_0x57023f[_0x3deb('0x53')],_0x57023f[_0x3deb('0x51')],_0x57023f['queuecallerexitreason']);}}}this[_0x3deb('0x35')][_0x1a8714['uniqueid']]=_0x57023f;this[_0x3deb('0x44')](_0x57023f,'agentcomplete');}}}catch(_0x16ecc8){logger['error']('[%s][voiceQueueReport][agentcomplete]',_0x1a8714[_0x3deb('0x4a')],util[_0x3deb('0x3f')](_0x16ecc8,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3deb('0xc')][_0x3deb('0x20')]=function(_0x3ef3a6){try{if(this[_0x3deb('0x61')](_0x3ef3a6)){logger[_0x3deb('0x47')](_0x3deb('0xa9'),_0x3ef3a6[_0x3deb('0x4a')],util[_0x3deb('0x3f')](_0x3ef3a6,{'showHidden':![],'depth':null}));this[_0x3deb('0xaa')](_0x3ef3a6['uniqueid'],_[_0x3deb('0x7f')](_0x3ef3a6['variable'])[0x0],_0x3ef3a6[_0x3deb('0xab')]);if(this['queueReports'][_0x3ef3a6[_0x3deb('0x4a')]]){var _0x2f5739=_[_0x3deb('0x82')](this[_0x3deb('0x10')][_0x3ef3a6[_0x3deb('0x4a')]]);if(_0x2f5739){if(this[_0x3deb('0x61')](_0x3ef3a6[_0x3deb('0xac')])&&this['isNotNull'](_0x3ef3a6[_0x3deb('0xac')][_0x3deb('0xad')])){switch(_0x3ef3a6[_0x3deb('0xab')]){case _0x3deb('0xae'):_0x2f5739[_0x3deb('0x97')]=![];_0x2f5739[_0x3deb('0x98')]=null;break;case'TIMEOUT':_0x2f5739[_0x3deb('0xaf')]=_0x3deb('0xb0');_0x2f5739[_0x3deb('0x97')]=!![];_0x2f5739[_0x3deb('0x98')]=moment()['format'](_0x3deb('0x79'));_0x2f5739['queuecallerleaveAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');logger['debug']('[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:',_0x3ef3a6[_0x3deb('0x4a')],util[_0x3deb('0x3f')](_0x2f5739,{'showHidden':![],'depth':null}));ami[_0x3deb('0x45')]('custom:timeout',_0x2f5739);break;default:_0x2f5739['queuecallerexit']=!![];_0x2f5739[_0x3deb('0x98')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x2f5739['queuecallerleaveAt']=moment()[_0x3deb('0x4b')](_0x3deb('0x79'));}_0x2f5739[_0x3deb('0x86')]=![];_0x2f5739[_0x3deb('0x87')]=null;_0x2f5739[_0x3deb('0x88')]=_0x3ef3a6[_0x3deb('0xab')];this[_0x3deb('0x35')][_0x3ef3a6['uniqueid']]=_0x2f5739;this[_0x3deb('0x44')](_0x2f5739,_0x3deb('0xb1'));}else if(this[_0x3deb('0x61')](_0x3ef3a6['variable'])&&this[_0x3deb('0x61')](_0x3ef3a6['variable'][_0x3deb('0xb2')])){if(!_0x2f5739[_0x3deb('0x86')]){_0x2f5739[_0x3deb('0x97')]=!![];_0x2f5739['queuecallerexitAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x2f5739['queuecallerexitreason']=_0x3deb('0xb3');_0x2f5739[_0x3deb('0xb4')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x3ef3a6[_0x3deb('0x4a')]]=_0x2f5739;}}logger[_0x3deb('0x6b')](_0x3deb('0xb5'),_0x3ef3a6[_0x3deb('0x4a')],_0x2f5739[_0x3deb('0x53')],_0x2f5739[_0x3deb('0x51')],_[_0x3deb('0x7f')](_0x3ef3a6[_0x3deb('0xac')])[0x0],_0x3ef3a6['value']);_0x2f5739[_0x3deb('0x15')]=this[_0x3deb('0x15')][_0x3ef3a6['uniqueid']];}}}}catch(_0x562f9b){logger['error'](_0x3deb('0xa9'),_0x3ef3a6['uniqueid'],util[_0x3deb('0x3f')](_0x562f9b,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x3deb('0xc')][_0x3deb('0xaa')]=function(_0xb65abb,_0x508f6b,_0x5a18c0){var _0x423278=[_0x3deb('0xb6'),_0x3deb('0xb7'),'rtpaudioqosjitter','rtpaudioqosjitterbridged',_0x3deb('0xb8'),_0x3deb('0xb9'),_0x3deb('0xba'),'rtpaudioqosrttbridged',_0x3deb('0xbb'),_0x3deb('0xbc'),_0x3deb('0xbd'),_0x3deb('0xbe'),_0x3deb('0xbf'),_0x3deb('0xc0'),_0x3deb('0xc1'),_0x3deb('0xc2'),_0x3deb('0xc3'),_0x3deb('0xc4'),_0x3deb('0xc5')];if(!_[_0x3deb('0x37')](_0x508f6b)&&!_[_0x3deb('0xc6')](_0x423278,_0x508f6b)){if(_[_0x3deb('0x62')](this[_0x3deb('0x15')][_0xb65abb])){this['variables'][_0xb65abb]={};}this[_0x3deb('0x15')][_0xb65abb][_0x508f6b]=_0x5a18c0;}};VoiceQueueReport[_0x3deb('0xc')][_0x3deb('0x22')]=function(_0x5639bc){try{if(this[_0x3deb('0x61')](_0x5639bc)){logger[_0x3deb('0x47')](_0x3deb('0xc7'),_0x5639bc[_0x3deb('0x4a')],util[_0x3deb('0x3f')](_0x5639bc,{'showHidden':![],'depth':null}));if(this[_0x3deb('0x10')][_0x5639bc['uniqueid']]){for(var _0x2a909c=0x0,_0x1760c6={};_0x2a909c0x0?_0x4595ea:0x0;this['voiceQueues'][_0x5d5ca5[_0xc3ee('0x6e')]][_0xc3ee('0x35')]=this['voiceQueues'][_0x5d5ca5[_0xc3ee('0x6e')]][_0xc3ee('0x35')]>_[_0xc3ee('0x74')](_0x5d5ca5[_0xc3ee('0x75')])?_[_0xc3ee('0x74')](_0x5d5ca5[_0xc3ee('0x75')]):this['voiceQueues'][_0x5d5ca5[_0xc3ee('0x6e')]][_0xc3ee('0x35')];this[_0xc3ee('0x77')](this[_0xc3ee('0x13')][_0x5d5ca5[_0xc3ee('0x6e')]],_0xc3ee('0x6c'));}logger['debug'](_0xc3ee('0x78'),util['inspect'](this[_0xc3ee('0x13')][_0x5d5ca5['queue']],{'showHidden':![],'depth':null}));ami[_0xc3ee('0x4c')](_0xc3ee('0x79'),this['voiceQueues'][_0x5d5ca5['queue']]);}}}catch(_0x12a537){logger[_0xc3ee('0x43')]('[voiceQueueReport][queuesummary]',util[_0xc3ee('0x44')](_0x12a537,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xc3ee('0xc')][_0xc3ee('0x7a')]=function(_0x14b309){logger[_0xc3ee('0x4e')](_0xc3ee('0x7b'),util[_0xc3ee('0x44')](_0x14b309,{'showHidden':![],'depth':null}));this[_0xc3ee('0x14')]=!![];};VoiceQueueReport[_0xc3ee('0xc')][_0xc3ee('0x1a')]=function(_0x467bac){try{if(this[_0xc3ee('0x67')](_0x467bac)){logger[_0xc3ee('0x4e')](_0xc3ee('0x7c'),_0x467bac[_0xc3ee('0x51')],util[_0xc3ee('0x44')](_0x467bac,{'showHidden':![],'depth':null}));if(_[_0xc3ee('0x68')](this[_0xc3ee('0x10')][_0x467bac[_0xc3ee('0x51')]]))this['queueReports'][_0x467bac[_0xc3ee('0x51')]]=[];if(_[_0xc3ee('0x68')](this[_0xc3ee('0x3b')][_0x467bac['uniqueid']]))this[_0xc3ee('0x3b')][_0x467bac['uniqueid']]={};var _0x408aad=new QueueReport();_0x408aad['name']=_0x467bac[_0xc3ee('0x6e')];_0x408aad[_0xc3ee('0x7d')]=this[_0xc3ee('0x13')][_0x408aad[_0xc3ee('0x53')]]&&this[_0xc3ee('0x13')][_0x408aad['name']][_0xc3ee('0x7d')]?this['voiceQueues'][_0x408aad['name']][_0xc3ee('0x7d')]||_0xc3ee('0x59'):_0xc3ee('0x59');_0x408aad[_0xc3ee('0x6e')]=_0x467bac[_0xc3ee('0x6e')];_0x408aad[_0xc3ee('0x7e')]=moment()[_0xc3ee('0x56')]('YYYY-MM-DD\x20HH:mm:ss');_0x408aad[_0xc3ee('0x7f')]=_0x467bac[_0xc3ee('0x7f')];_0x408aad[_0xc3ee('0x80')]=_0x467bac[_0xc3ee('0x80')];_0x408aad[_0xc3ee('0x51')]=_0x467bac[_0xc3ee('0x51')];_0x408aad[_0xc3ee('0x81')]=this[_0xc3ee('0x3b')][_0x467bac['uniqueid']]['routealias'];logger[_0xc3ee('0x70')]('[voiceQueueReport][queuecallerjoin]\x20name:%s\x20type:%s',_0x408aad[_0xc3ee('0x53')],_0x408aad[_0xc3ee('0x7d')]);_['merge'](_0x408aad,_['pick'](_0x467bac,_[_0xc3ee('0x82')](_0x408aad)));this['queueReports'][_0x467bac['uniqueid']][_0xc3ee('0x83')](_0x408aad);this[_0xc3ee('0x3b')][_0x467bac[_0xc3ee('0x51')]]=_0x408aad;this['emitVoiceQueueChannelSave'](_0x408aad,'queuecallerjoin');}}catch(_0x3d401f){logger['error']('[%s][voiceQueueReport][queuecallerjoin]',_0x467bac['uniqueid'],util[_0xc3ee('0x44')](_0x3d401f,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xc3ee('0xc')][_0xc3ee('0x1c')]=function(_0x33f9c0){try{if(this[_0xc3ee('0x67')](_0x33f9c0)){logger[_0xc3ee('0x4e')](_0xc3ee('0x84'),_0x33f9c0[_0xc3ee('0x51')],util[_0xc3ee('0x44')](_0x33f9c0,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x33f9c0[_0xc3ee('0x51')]]){var _0x98349e=_[_0xc3ee('0x85')](this['queueReports'][_0x33f9c0['uniqueid']]);_0x98349e[_0xc3ee('0x86')]=![];_0x98349e['queuecallercompleteAt']=null;_0x98349e[_0xc3ee('0x87')]=_0x33f9c0[_0xc3ee('0x87')];_0x98349e[_0xc3ee('0x88')]=_0x33f9c0[_0xc3ee('0x88')];_0x98349e[_0xc3ee('0x1b')]=!![];_0x98349e['queuecallerabandonAt']=moment()[_0xc3ee('0x56')]('YYYY-MM-DD\x20HH:mm:ss');_0x98349e[_0xc3ee('0x89')]=_0xc3ee('0x8a');_0x98349e[_0xc3ee('0x8b')]=null;logger[_0xc3ee('0x70')](_0xc3ee('0x8c'),_0x98349e[_0xc3ee('0x53')],_0x98349e[_0xc3ee('0x7d')]);this[_0xc3ee('0x3b')][_0x33f9c0[_0xc3ee('0x51')]]=_0x98349e;this[_0xc3ee('0x4a')](_0x98349e,_0xc3ee('0x1b'));}}}catch(_0x3a33e7){logger[_0xc3ee('0x43')](_0xc3ee('0x84'),_0x33f9c0[_0xc3ee('0x51')],util['inspect'](_0x3a33e7,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xc3ee('0xc')][_0xc3ee('0x1d')]=function(_0x1c87ee){try{if(this['isNotNull'](_0x1c87ee)){logger[_0xc3ee('0x4e')]('[%s][voiceQueueReport][queuecallerleave]',_0x1c87ee[_0xc3ee('0x51')],util[_0xc3ee('0x44')](_0x1c87ee,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x1c87ee[_0xc3ee('0x51')]]){var _0x3483d9=_[_0xc3ee('0x85')](this[_0xc3ee('0x10')][_0x1c87ee[_0xc3ee('0x51')]]);_0x3483d9[_0xc3ee('0x8d')]=moment()[_0xc3ee('0x56')](_0xc3ee('0x8e'));_0x3483d9['connectedlinenum']=_0x1c87ee['connectedlinenum'];_0x3483d9['connectedlinename']=_0x1c87ee[_0xc3ee('0x8f')];logger['info']('[voiceQueueReport][queuecallerleave]\x20name:%s\x20type:%s\x20connectedlinenum:%s\x20connectedlinename:%s',_0x3483d9[_0xc3ee('0x53')],_0x3483d9['type'],_0x1c87ee[_0xc3ee('0x90')],_0x1c87ee[_0xc3ee('0x8f')]);this[_0xc3ee('0x3b')][_0x1c87ee[_0xc3ee('0x51')]]=_0x3483d9;this[_0xc3ee('0x4d')](_0x3483d9,_0xc3ee('0x91'));}}}catch(_0x24b349){logger[_0xc3ee('0x43')](_0xc3ee('0x92'),_0x1c87ee[_0xc3ee('0x51')],util[_0xc3ee('0x44')](_0x24b349,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xc3ee('0xc')][_0xc3ee('0x21')]=function(_0x52969a){try{if(this['isNotNull'](_0x52969a)){logger[_0xc3ee('0x4e')](_0xc3ee('0x93'),_0x52969a[_0xc3ee('0x51')],util[_0xc3ee('0x44')](_0x52969a,{'showHidden':![],'depth':null}));if(this[_0xc3ee('0x10')][_0x52969a[_0xc3ee('0x51')]]){var _0x2b9d81=_['last'](this['queueReports'][_0x52969a[_0xc3ee('0x51')]]);_0x2b9d81[_0xc3ee('0x86')]=!![];_0x2b9d81[_0xc3ee('0x89')]=_0xc3ee('0x94');logger['info'](_0xc3ee('0x95'),_0x2b9d81[_0xc3ee('0x53')],_0x2b9d81[_0xc3ee('0x7d')]);}}}catch(_0x2b1c06){logger[_0xc3ee('0x43')](_0xc3ee('0x93'),_0x52969a['uniqueid'],util[_0xc3ee('0x44')](_0x2b1c06,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xc3ee('0xc')][_0xc3ee('0x1f')]=function(_0x25c832){try{if(this[_0xc3ee('0x67')](_0x25c832)){logger['debug'](_0xc3ee('0x96'),_0x25c832['uniqueid'],util[_0xc3ee('0x44')](_0x25c832,{'showHidden':![],'depth':null}));if(this[_0xc3ee('0x10')][_0x25c832['uniqueid']]){var _0x4f92aa=_[_0xc3ee('0x85')](this[_0xc3ee('0x10')][_0x25c832[_0xc3ee('0x51')]]);_0x4f92aa[_0xc3ee('0x1b')]=![];_0x4f92aa[_0xc3ee('0x97')]=null;_0x4f92aa[_0xc3ee('0x98')]=!![];_0x4f92aa[_0xc3ee('0x8b')]=_0x25c832[_0xc3ee('0x99')];_0x4f92aa['holdtime']=_0x25c832[_0xc3ee('0x87')];_0x4f92aa['queuecallercomplete']=!![];_0x4f92aa['queuecallerexit']=![];_0x4f92aa['queuecallerexitAt']=null;if(!_0x4f92aa['transfer']){if(_0x25c832[_0xc3ee('0x9a')]==_0xc3ee('0x9b')){_0x4f92aa['queuecallerexitreason']=_0xc3ee('0x9c');logger[_0xc3ee('0x70')](_0xc3ee('0x9d'),_0x4f92aa[_0xc3ee('0x53')],_0x4f92aa[_0xc3ee('0x7d')]);}else{if(_[_0xc3ee('0x9e')](_0x25c832[_0xc3ee('0x40')]['toLowerCase'](),'local/')){if(this[_0xc3ee('0x10')][_0x25c832[_0xc3ee('0x9f')]]){var _0x1190ff=_[_0xc3ee('0x85')](this[_0xc3ee('0x10')][_0x25c832[_0xc3ee('0x9f')]]);_0x1190ff[_0xc3ee('0x86')]=![];_0x1190ff[_0xc3ee('0xa0')]=!![];_0x1190ff[_0xc3ee('0xa1')]=moment(_0x4f92aa[_0xc3ee('0x7e')])[_0xc3ee('0xa2')](_0x25c832['holdtime'],_0xc3ee('0xa3'))[_0xc3ee('0x56')](_0xc3ee('0x8e'));_0x1190ff[_0xc3ee('0x89')]=_0xc3ee('0xa4');_0x1190ff[_0xc3ee('0x9b')]=!![];_0x1190ff['transfertype']='FORWARD';_0x1190ff[_0xc3ee('0xa5')]=_0x25c832[_0xc3ee('0xa6')];_0x1190ff[_0xc3ee('0xa7')]=_0x25c832[_0xc3ee('0x51')];logger[_0xc3ee('0x70')]('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:FORWARDTRANSFER',_0x1190ff[_0xc3ee('0x53')],_0x1190ff[_0xc3ee('0x7d')]);var _0x2dfffb=this[_0xc3ee('0x10')][_0x25c832[_0xc3ee('0x9f')]];this[_0xc3ee('0x10')][_0x25c832[_0xc3ee('0x9f')]]=this[_0xc3ee('0x10')][_0x25c832[_0xc3ee('0x51')]];this[_0xc3ee('0x10')][_0x25c832[_0xc3ee('0x51')]]=_0x2dfffb;}}else{_0x4f92aa[_0xc3ee('0x89')]='COMPLETEDBY'+_0x25c832[_0xc3ee('0x9a')]['toUpperCase']();logger['info']('[voiceQueueReport][agentcomplete]\x20name:%s\x20type:%s\x20queuecallerexitreason:%s',_0x4f92aa[_0xc3ee('0x53')],_0x4f92aa[_0xc3ee('0x7d')],_0x4f92aa['queuecallerexitreason']);}}}this[_0xc3ee('0x3b')][_0x25c832[_0xc3ee('0x51')]]=_0x4f92aa;this['emitVoiceQueueChannelRemove'](_0x4f92aa,_0xc3ee('0x1e'));}}}catch(_0xc0cfdc){logger[_0xc3ee('0x43')](_0xc3ee('0x96'),_0x25c832[_0xc3ee('0x51')],util[_0xc3ee('0x44')](_0xc0cfdc,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xc3ee('0xc')]['syncVarSet']=function(_0x2b7cbf){try{if(this[_0xc3ee('0x67')](_0x2b7cbf)){logger[_0xc3ee('0x4e')](_0xc3ee('0xa8'),_0x2b7cbf[_0xc3ee('0x51')],util[_0xc3ee('0x44')](_0x2b7cbf,{'showHidden':![],'depth':null}));this[_0xc3ee('0xa9')](_0x2b7cbf[_0xc3ee('0x51')],_[_0xc3ee('0x82')](_0x2b7cbf[_0xc3ee('0xaa')])[0x0],_0x2b7cbf[_0xc3ee('0xab')]);if(this[_0xc3ee('0x10')][_0x2b7cbf[_0xc3ee('0x51')]]){var _0x5e2faa=_[_0xc3ee('0x85')](this[_0xc3ee('0x10')][_0x2b7cbf['uniqueid']]);if(_0x5e2faa){if(this['isNotNull'](_0x2b7cbf[_0xc3ee('0xaa')])&&this[_0xc3ee('0x67')](_0x2b7cbf['variable'][_0xc3ee('0xac')])){switch(_0x2b7cbf[_0xc3ee('0xab')]){case'CONTINUE':_0x5e2faa[_0xc3ee('0xa0')]=![];_0x5e2faa[_0xc3ee('0xa1')]=null;break;case _0xc3ee('0xad'):_0x5e2faa[_0xc3ee('0xae')]=_0xc3ee('0xaf');_0x5e2faa['queuecallerexit']=!![];_0x5e2faa[_0xc3ee('0xa1')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x5e2faa[_0xc3ee('0x8d')]=moment()[_0xc3ee('0x56')](_0xc3ee('0x8e'));logger['debug']('[%s][voiceQueueReport][varset]\x20sending\x20timeout\x20event:',_0x2b7cbf[_0xc3ee('0x51')],util[_0xc3ee('0x44')](_0x5e2faa,{'showHidden':![],'depth':null}));ami[_0xc3ee('0x4c')](_0xc3ee('0xb0'),_0x5e2faa);break;default:_0x5e2faa[_0xc3ee('0xa0')]=!![];_0x5e2faa[_0xc3ee('0xa1')]=moment()[_0xc3ee('0x56')]('YYYY-MM-DD\x20HH:mm:ss');_0x5e2faa[_0xc3ee('0x8d')]=moment()['format'](_0xc3ee('0x8e'));}_0x5e2faa['queuecallerabandon']=![];_0x5e2faa[_0xc3ee('0x97')]=null;_0x5e2faa[_0xc3ee('0x89')]=_0x2b7cbf['value'];this['channels'][_0x2b7cbf[_0xc3ee('0x51')]]=_0x5e2faa;this['emitVoiceQueueChannelRemove'](_0x5e2faa,'varset');}else if(this['isNotNull'](_0x2b7cbf[_0xc3ee('0xaa')])&&this[_0xc3ee('0x67')](_0x2b7cbf[_0xc3ee('0xaa')][_0xc3ee('0xb1')])){if(!_0x5e2faa['queuecallerabandon']){_0x5e2faa[_0xc3ee('0xa0')]=!![];_0x5e2faa[_0xc3ee('0xa1')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x5e2faa[_0xc3ee('0x89')]=_0xc3ee('0xb2');_0x5e2faa[_0xc3ee('0x8d')]=moment()[_0xc3ee('0x56')](_0xc3ee('0x8e'));this['channels'][_0x2b7cbf['uniqueid']]=_0x5e2faa;}}logger[_0xc3ee('0x70')](_0xc3ee('0xb3'),_0x2b7cbf[_0xc3ee('0x51')],_0x5e2faa[_0xc3ee('0x53')],_0x5e2faa[_0xc3ee('0x7d')],_[_0xc3ee('0x82')](_0x2b7cbf['variable'])[0x0],_0x2b7cbf[_0xc3ee('0xab')]);_0x5e2faa[_0xc3ee('0x15')]=this[_0xc3ee('0x15')][_0x2b7cbf[_0xc3ee('0x51')]];}}}}catch(_0xa4bbd9){logger[_0xc3ee('0x43')](_0xc3ee('0xa8'),_0x2b7cbf[_0xc3ee('0x51')],util[_0xc3ee('0x44')](_0xa4bbd9,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xc3ee('0xc')][_0xc3ee('0xa9')]=function(_0x57e316,_0x3693a9,_0x9874b7){var _0x5d4280=[_0xc3ee('0xb4'),_0xc3ee('0xb5'),_0xc3ee('0xb6'),_0xc3ee('0xb7'),_0xc3ee('0xb8'),_0xc3ee('0xb9'),_0xc3ee('0xba'),_0xc3ee('0xbb'),'sipcallid',_0xc3ee('0xbc'),_0xc3ee('0xbd'),_0xc3ee('0xbe'),_0xc3ee('0xbf'),_0xc3ee('0xc0'),_0xc3ee('0xc1'),_0xc3ee('0xc2'),_0xc3ee('0x99'),_0xc3ee('0xc3'),_0xc3ee('0xc4')];if(!_['isNil'](_0x3693a9)&&!_[_0xc3ee('0xc5')](_0x5d4280,_0x3693a9)){if(_[_0xc3ee('0x68')](this[_0xc3ee('0x15')][_0x57e316])){this[_0xc3ee('0x15')][_0x57e316]={};}this[_0xc3ee('0x15')][_0x57e316][_0x3693a9]=_0x9874b7;}};VoiceQueueReport[_0xc3ee('0xc')][_0xc3ee('0x25')]=function(_0x22d9b6){try{if(this[_0xc3ee('0x67')](_0x22d9b6)){logger['debug']('[%s][voiceQueueReport][hangup]',_0x22d9b6[_0xc3ee('0x51')],util['inspect'](_0x22d9b6,{'showHidden':![],'depth':null}));if(this['queueReports'][_0x22d9b6[_0xc3ee('0x51')]]){for(var _0x358519=0x0,_0x4060e5={};_0x358519=0x0?moment(_0x526d30[_0x4d8d('0x19')])[_0x4d8d('0xf')](_0x526d30[_0x4d8d('0x18')],_0x4d8d('0x10')):null,'data1':_0x4d8d('0x1a'),'data2':_0x526d30[_0x4d8d('0x14')],'data3':_0x526d30[_0x4d8d('0x11')],'data4':_0x526d30[_0x4d8d('0x1b')]||null,'role':'agent','internal':_0x526d30['accountcode']?_[_0x4d8d('0x1c')](_0x526d30[_0x4d8d('0x14')]):undefined,'uniqueid':_0x526d30[_0x4d8d('0x15')]},'log':'CreateMemberReport'});}; \ No newline at end of file +var _0xbceb=['interface','format','TALKING','queuecallerleaveAt','seconds','inbound','calleridnum','exten','agent','toNumber','accountcode','voiceDialReport','Request','CreateMemberReport','membername','endtime','starttime','diff','outbound','dialstring','lodash','util','../client','queuecallercompleteAt','voice','lastAssignedTo','isNil'];(function(_0x9c3248,_0x4d5ca6){var _0x1361f9=function(_0x33be79){while(--_0x33be79){_0x9c3248['push'](_0x9c3248['shift']());}};_0x1361f9(++_0x4d5ca6);}(_0xbceb,0xb6));var _0xbbce=function(_0x1f7de7,_0x4e2fae){_0x1f7de7=_0x1f7de7-0x0;var _0x2a8253=_0xbceb[_0x1f7de7];return _0x2a8253;};'use strict';var moment=require('moment');var _=require(_0xbbce('0x0'));var util=require(_0xbbce('0x1'));var client=require(_0xbbce('0x2'));exports['voiceQueueReport']=function(_0x4dc5c3){var _0x4f2968=_0x4dc5c3[_0xbbce('0x3')]||_0x4dc5c3['queuecallerexitAt'];return client['Request']('CreateMemberReport',{'body':{'channel':_0xbbce('0x4'),'membername':_0x4dc5c3[_0xbbce('0x5')],'interface':_[_0xbbce('0x6')](_0x4dc5c3[_0xbbce('0x7')])?util[_0xbbce('0x8')]('SIP/%s',_0x4dc5c3[_0xbbce('0x5')]):_0x4dc5c3[_0xbbce('0x7')],'type':_0xbbce('0x9'),'enterAt':_0x4dc5c3[_0xbbce('0xa')],'exitAt':_0x4f2968,'duration':moment(_0x4f2968)['diff'](_0x4dc5c3['queuecallerleaveAt'],_0xbbce('0xb')),'data1':_0xbbce('0xc'),'data2':_0x4dc5c3[_0xbbce('0xd')],'data3':_0x4dc5c3[_0xbbce('0xe')],'data4':null,'data5':_0x4dc5c3['queue'],'role':_0xbbce('0xf'),'internal':_0x4dc5c3['accountcode']?_[_0xbbce('0x10')](_0x4dc5c3[_0xbbce('0x11')]):undefined,'uniqueid':_0x4dc5c3['uniqueid']},'log':'CreateMemberReport'});};exports[_0xbbce('0x12')]=function(_0x470bcc){return client[_0xbbce('0x13')](_0xbbce('0x14'),{'body':{'channel':_0xbbce('0x4'),'membername':_0x470bcc[_0xbbce('0x15')],'interface':_0x470bcc[_0xbbce('0x7')],'type':_0xbbce('0x9'),'enterAt':_0x470bcc['starttime'],'exitAt':_0x470bcc[_0xbbce('0x16')],'duration':moment(_0x470bcc[_0xbbce('0x16')])['diff'](_0x470bcc[_0xbbce('0x17')],'seconds')>=0x0?moment(_0x470bcc['endtime'])[_0xbbce('0x18')](_0x470bcc[_0xbbce('0x17')],_0xbbce('0xb')):null,'data1':_0xbbce('0x19'),'data2':_0x470bcc[_0xbbce('0x11')],'data3':_0x470bcc[_0xbbce('0xe')],'data4':_0x470bcc[_0xbbce('0x1a')]||null,'role':_0xbbce('0xf'),'internal':_0x470bcc[_0xbbce('0x11')]?_['toNumber'](_0x470bcc[_0xbbce('0x11')]):undefined,'uniqueid':_0x470bcc['uniqueid']},'log':_0xbbce('0x14')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/setting.js b/server/services/ami/rpc/setting.js index 17f898f..1469df0 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 _0xd73a=['getSettings','Request','ShowSetting','stopRecordingOnTransfer','../client'];(function(_0x13c651,_0x29b9a3){var _0x4639cc=function(_0x51b8a8){while(--_0x51b8a8){_0x13c651['push'](_0x13c651['shift']());}};_0x4639cc(++_0x29b9a3);}(_0xd73a,0x171));var _0xad73=function(_0x13ab72,_0x197b95){_0x13ab72=_0x13ab72-0x0;var _0x1a46db=_0xd73a[_0x13ab72];return _0x1a46db;};'use strict';var client=require(_0xad73('0x0'));exports[_0xad73('0x1')]=function(){return client[_0xad73('0x2')](_0xad73('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xad73('0x4')]},'log':'GetSettings'});}; \ No newline at end of file +var _0x639a=['GetSettings','getSettings','Request','ShowSetting','stopRecordingOnTransfer'];(function(_0x2d8f07,_0x4ec193){var _0x4971c3=function(_0x1d5e70){while(--_0x1d5e70){_0x2d8f07['push'](_0x2d8f07['shift']());}};_0x4971c3(++_0x4ec193);}(_0x639a,0xec));var _0xa639=function(_0x422a37,_0x4e2740){_0x422a37=_0x422a37-0x0;var _0x173a0b=_0x639a[_0x422a37];return _0x173a0b;};'use strict';var client=require('../client');exports[_0xa639('0x0')]=function(){return client[_0xa639('0x1')](_0xa639('0x2'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0xa639('0x3')]},'log':_0xa639('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index fe3cb0e..3a7b4b6 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 _0xf739=['html','../client','GetTemplate','name'];(function(_0x3d79e9,_0xcd400a){var _0x2c3e24=function(_0x4dc8a4){while(--_0x4dc8a4){_0x3d79e9['push'](_0x3d79e9['shift']());}};_0x2c3e24(++_0xcd400a);}(_0xf739,0x81));var _0x9f73=function(_0x588981,_0x5706bd){_0x588981=_0x588981-0x0;var _0x3eb575=_0xf739[_0x588981];return _0x3eb575;};'use strict';var client=require(_0x9f73('0x0'));exports['getTemplates']=function(_0x3834a9){return function(_0x126d59){return client['Request'](_0x9f73('0x1'),{'options':{'raw':!![],'attributes':['id',_0x9f73('0x2'),_0x9f73('0x3')]},'log':'GetTemplate'});};}; \ No newline at end of file +var _0x40ca=['getTemplates','Request','GetTemplate','name','../client'];(function(_0x332061,_0x4d749e){var _0xef6462=function(_0x58c002){while(--_0x58c002){_0x332061['push'](_0x332061['shift']());}};_0xef6462(++_0x4d749e);}(_0x40ca,0x149));var _0xa40c=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x40ca[_0x6c993a];return _0x27f547;};'use strict';var client=require(_0xa40c('0x0'));exports[_0xa40c('0x1')]=function(_0x58d713){return function(_0x1ba997){return client[_0xa40c('0x2')](_0xa40c('0x3'),{'options':{'raw':!![],'attributes':['id',_0xa40c('0x4'),'html']},'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 e186587..796a35a 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 _0xe7bf=['Request','GetTrigger','name','channel','status','Condition','AllConditions','operator','AnyConditions','value','Action','Actions','action','data1','data2','data3','data6','data7','../client','getTriggers'];(function(_0x3162d3,_0x29889a){var _0x255ddd=function(_0x1e3b88){while(--_0x1e3b88){_0x3162d3['push'](_0x3162d3['shift']());}};_0x255ddd(++_0x29889a);}(_0xe7bf,0x166));var _0xfe7b=function(_0x414fd7,_0x3f423e){_0x414fd7=_0x414fd7-0x0;var _0x5074ad=_0xe7bf[_0x414fd7];return _0x5074ad;};'use strict';var client=require(_0xfe7b('0x0'));exports[_0xfe7b('0x1')]=function(_0x174303){return function(_0x381943){return client[_0xfe7b('0x2')](_0xfe7b('0x3'),{'options':{'raw':![],'attributes':['id',_0xfe7b('0x4'),_0xfe7b('0x5'),_0xfe7b('0x6')],'include':[{'model':_0xfe7b('0x7'),'as':_0xfe7b('0x8'),'attributes':['id','field',_0xfe7b('0x9'),'value']},{'model':'Condition','as':_0xfe7b('0xa'),'attributes':['id','field','operator',_0xfe7b('0xb')]},{'model':_0xfe7b('0xc'),'as':_0xfe7b('0xd'),'attributes':['id',_0xfe7b('0xe'),_0xfe7b('0xf'),_0xfe7b('0x10'),_0xfe7b('0x11'),'data4','data5',_0xfe7b('0x12'),_0xfe7b('0x13')]}]},'log':'GetTrigger'});};}; \ No newline at end of file +var _0x4484=['data2','data3','data5','data6','data7','../client','Request','GetTrigger','name','status','Condition','field','AnyConditions','operator','value','action','data1'];(function(_0x413b4d,_0xa3459c){var _0x8b810a=function(_0x22d441){while(--_0x22d441){_0x413b4d['push'](_0x413b4d['shift']());}};_0x8b810a(++_0xa3459c);}(_0x4484,0x104));var _0x4448=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4484[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x4448('0x0'));exports['getTriggers']=function(_0x72ff76){return function(_0x4986ef){return client[_0x4448('0x1')](_0x4448('0x2'),{'options':{'raw':![],'attributes':['id',_0x4448('0x3'),'channel',_0x4448('0x4')],'include':[{'model':_0x4448('0x5'),'as':'AllConditions','attributes':['id',_0x4448('0x6'),'operator','value']},{'model':_0x4448('0x5'),'as':_0x4448('0x7'),'attributes':['id',_0x4448('0x6'),_0x4448('0x8'),_0x4448('0x9')]},{'model':'Action','as':'Actions','attributes':['id',_0x4448('0xa'),_0x4448('0xb'),_0x4448('0xc'),_0x4448('0xd'),'data4',_0x4448('0xe'),_0x4448('0xf'),_0x4448('0x10')]}]},'log':_0x4448('0x2')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index 9990c14..81a4319 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 _0x7bb8=['registry','GetTrunk','getTrunks','Request','name'];(function(_0x26b8b5,_0xf5c2c1){var _0x2150a9=function(_0x1ca1be){while(--_0x1ca1be){_0x26b8b5['push'](_0x26b8b5['shift']());}};_0x2150a9(++_0xf5c2c1);}(_0x7bb8,0xe8));var _0x87bb=function(_0x365579,_0x31d251){_0x365579=_0x365579-0x0;var _0x4d3c6d=_0x7bb8[_0x365579];return _0x4d3c6d;};'use strict';var client=require('../client');exports[_0x87bb('0x0')]=function(_0x2548cc){return function(_0x33c051){return client[_0x87bb('0x1')]('GetTrunk',{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x87bb('0x2'),_0x87bb('0x3'),'defaultuser']},'log':_0x87bb('0x4')});};}; \ No newline at end of file +var _0xdcab=['registry','defaultuser','GetTrunk','../client','getTrunks','Request'];(function(_0x5d7c12,_0x1c428c){var _0x1abdf4=function(_0x2ea655){while(--_0x2ea655){_0x5d7c12['push'](_0x5d7c12['shift']());}};_0x1abdf4(++_0x1c428c);}(_0xdcab,0x1e9));var _0xbdca=function(_0x1ba520,_0x568f9e){_0x1ba520=_0x1ba520-0x0;var _0x512b7b=_0xdcab[_0x1ba520];return _0x512b7b;};'use strict';var client=require(_0xbdca('0x0'));exports[_0xbdca('0x1')]=function(_0x4674f5){return function(_0x1a6c03){return client[_0xbdca('0x2')]('GetTrunk',{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id','name',_0xbdca('0x3'),_0xbdca('0x4')]},'log':_0xbdca('0x5')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index e4be8d2..277a073 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 _0xedd9=['mobile','getTelephones','internal','PauseUser','savePause','saveUnpause','UnpauseUser','ShowUser','interface','getAgent','getAgents','Request','GetUser','agent','name','email','accountcode','fullname','lastLoginAt','pauseType','lastPauseAt','voicePause'];(function(_0xfb1b78,_0x1d1684){var _0x39c772=function(_0x23c291){while(--_0x23c291){_0xfb1b78['push'](_0xfb1b78['shift']());}};_0x39c772(++_0x1d1684);}(_0xedd9,0xfc));var _0x9edd=function(_0x279c27,_0x23ac03){_0x279c27=_0x279c27-0x0;var _0x11048a=_0xedd9[_0x279c27];return _0x11048a;};'use strict';var client=require('../client');exports[_0x9edd('0x0')]=function(){return function(){return client[_0x9edd('0x1')](_0x9edd('0x2'),{'options':{'raw':![],'where':{'role':_0x9edd('0x3')},'attributes':['id',_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6'),_0x9edd('0x7'),'online',_0x9edd('0x8'),_0x9edd('0x9'),_0x9edd('0xa'),_0x9edd('0xb'),'phone',_0x9edd('0xc'),'interface']},'log':_0x9edd('0x0')});};};exports[_0x9edd('0xd')]=function(){return function(){return client[_0x9edd('0x1')](_0x9edd('0x2'),{'options':{'raw':!![],'where':{'role':'telephone'},'attributes':['id',_0x9edd('0x4'),'accountcode',_0x9edd('0xe')]},'log':_0x9edd('0xd')});};};exports['savePause']=function(_0xbf9da6,_0x13dc4f,_0x5b6c00){return client[_0x9edd('0x1')](_0x9edd('0xf'),{'body':{'type':_0x13dc4f,'uniqueid':_0x5b6c00},'options':{'where':{'id':_0xbf9da6['id']}},'log':_0x9edd('0x10')});};exports[_0x9edd('0x11')]=function(_0x287ddd){return client[_0x9edd('0x1')](_0x9edd('0x12'),{'body':{},'options':{'where':{'id':_0x287ddd['id']}},'log':_0x9edd('0x10')});};exports['getAgent']=function(_0x176bfa){return client[_0x9edd('0x1')](_0x9edd('0x13'),{'options':{'raw':![],'where':{'role':_0x9edd('0x3'),'id':_0x176bfa},'attributes':['id',_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6'),_0x9edd('0x7'),'online',_0x9edd('0x8'),_0x9edd('0x9'),_0x9edd('0xa'),'voicePause',_0x9edd('0x14')]},'log':_0x9edd('0x15')});}; \ No newline at end of file +var _0xedd9=['mobile','getTelephones','internal','PauseUser','savePause','saveUnpause','UnpauseUser','ShowUser','interface','getAgent','getAgents','Request','GetUser','agent','name','email','accountcode','fullname','lastLoginAt','pauseType','lastPauseAt','voicePause'];(function(_0x273577,_0xba2fbb){var _0x50ab9d=function(_0x21f064){while(--_0x21f064){_0x273577['push'](_0x273577['shift']());}};_0x50ab9d(++_0xba2fbb);}(_0xedd9,0xfc));var _0x9edd=function(_0x3e3f25,_0x5383a2){_0x3e3f25=_0x3e3f25-0x0;var _0x5ec1dc=_0xedd9[_0x3e3f25];return _0x5ec1dc;};'use strict';var client=require('../client');exports[_0x9edd('0x0')]=function(){return function(){return client[_0x9edd('0x1')](_0x9edd('0x2'),{'options':{'raw':![],'where':{'role':_0x9edd('0x3')},'attributes':['id',_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6'),_0x9edd('0x7'),'online',_0x9edd('0x8'),_0x9edd('0x9'),_0x9edd('0xa'),_0x9edd('0xb'),'phone',_0x9edd('0xc'),'interface']},'log':_0x9edd('0x0')});};};exports[_0x9edd('0xd')]=function(){return function(){return client[_0x9edd('0x1')](_0x9edd('0x2'),{'options':{'raw':!![],'where':{'role':'telephone'},'attributes':['id',_0x9edd('0x4'),'accountcode',_0x9edd('0xe')]},'log':_0x9edd('0xd')});};};exports['savePause']=function(_0xbf9da6,_0x13dc4f,_0x5b6c00){return client[_0x9edd('0x1')](_0x9edd('0xf'),{'body':{'type':_0x13dc4f,'uniqueid':_0x5b6c00},'options':{'where':{'id':_0xbf9da6['id']}},'log':_0x9edd('0x10')});};exports[_0x9edd('0x11')]=function(_0x287ddd){return client[_0x9edd('0x1')](_0x9edd('0x12'),{'body':{},'options':{'where':{'id':_0x287ddd['id']}},'log':_0x9edd('0x10')});};exports['getAgent']=function(_0x176bfa){return client[_0x9edd('0x1')](_0x9edd('0x13'),{'options':{'raw':![],'where':{'role':_0x9edd('0x3'),'id':_0x176bfa},'attributes':['id',_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6'),_0x9edd('0x7'),'online',_0x9edd('0x8'),_0x9edd('0x9'),_0x9edd('0xa'),'voicePause',_0x9edd('0x14')]},'log':_0x9edd('0x15')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index 520fc38..3e76b7b 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 _0xb390=['UpdateVoiceAgentReport','create','Request','CreateVoiceAgentReport','update'];(function(_0x462999,_0x24d200){var _0x4b1366=function(_0x1fa353){while(--_0x1fa353){_0x462999['push'](_0x462999['shift']());}};_0x4b1366(++_0x24d200);}(_0xb390,0x128));var _0x0b39=function(_0x270b85,_0x3b9b3b){_0x270b85=_0x270b85-0x0;var _0x5aeea4=_0xb390[_0x270b85];return _0x5aeea4;};'use strict';var client=require('../client');exports[_0x0b39('0x0')]=function(_0x28dc8b){return client[_0x0b39('0x1')](_0x0b39('0x2'),{'body':_0x28dc8b,'log':_0x0b39('0x2')});};exports[_0x0b39('0x3')]=function(_0x40e77f,_0x1d9ccf,_0x3e6635){return client[_0x0b39('0x1')](_0x0b39('0x4'),{'body':_0x40e77f,'options':{'where':{'uniqueid':_0x1d9ccf,'interface':_0x3e6635,'agentcomplete':!![]}},'log':_0x0b39('0x4')});}; \ No newline at end of file +var _0x3a8d=['update','UpdateVoiceAgentReport','../client','create','Request','CreateVoiceAgentReport'];(function(_0x549278,_0x450754){var _0x1ea9a1=function(_0x2e559d){while(--_0x2e559d){_0x549278['push'](_0x549278['shift']());}};_0x1ea9a1(++_0x450754);}(_0x3a8d,0x140));var _0xd3a8=function(_0x20fdc1,_0xde1296){_0x20fdc1=_0x20fdc1-0x0;var _0x25397c=_0x3a8d[_0x20fdc1];return _0x25397c;};'use strict';var client=require(_0xd3a8('0x0'));exports[_0xd3a8('0x1')]=function(_0x42a963){return client[_0xd3a8('0x2')](_0xd3a8('0x3'),{'body':_0x42a963,'log':_0xd3a8('0x3')});};exports[_0xd3a8('0x4')]=function(_0x237079,_0x5edd11,_0x4cdd01){return client['Request'](_0xd3a8('0x5'),{'body':_0x237079,'options':{'where':{'uniqueid':_0x5edd11,'interface':_0x4cdd01,'agentcomplete':!![]}},'log':'UpdateVoiceAgentReport'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index 976d295..a729b3b 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 _0xacea=['create','Request','CreateVoiceCallReport','merge','context','callerid','DOCUMENTATION','getVoiceCallReports','GetVoiceCallReport','day','format','YYYY-MM-DD\x20HH:mm:ss','type','duration','billableseconds','GetVoiceCallReports','moment','util','../client'];(function(_0x401e3a,_0x2bc155){var _0x2d4eac=function(_0x53eac7){while(--_0x53eac7){_0x401e3a['push'](_0x401e3a['shift']());}};_0x2d4eac(++_0x2bc155);}(_0xacea,0x12d));var _0xaace=function(_0x485634,_0x51fbde){_0x485634=_0x485634-0x0;var _0x7450cc=_0xacea[_0x485634];return _0x7450cc;};'use strict';var moment=require(_0xaace('0x0'));var util=require(_0xaace('0x1'));var _=require('lodash');var client=require(_0xaace('0x2'));exports[_0xaace('0x3')]=function(_0x5818bc){return client[_0xaace('0x4')](_0xaace('0x5'),{'body':_[_0xaace('0x6')](_0x5818bc,{'source':_0x5818bc['calleridnum'],'destinationcontext':_0x5818bc[_0xaace('0x7')],'callerid':_0x5818bc[_0xaace('0x8')],'amaflags':_0xaace('0x9')}),'log':'CreateVoiceCallReport'});};exports[_0xaace('0xa')]=function(){return function(){return client[_0xaace('0x4')](_0xaace('0xb'),{'options':{'where':{'type':['outbound'],'createdAt':{'$between':[moment()['startOf'](_0xaace('0xc'))[_0xaace('0xd')](_0xaace('0xe')),moment()['endOf']('day')['format'](_0xaace('0xe'))]}},'attributes':[_0xaace('0xf'),'disposition',_0xaace('0x10'),_0xaace('0x11')]},'log':_0xaace('0x12')});};}; \ No newline at end of file +var _0xaa16=['format','endOf','YYYY-MM-DD\x20HH:mm:ss','disposition','duration','billableseconds','GetVoiceCallReports','moment','util','../client','create','Request','CreateVoiceCallReport','context','callerid','GetVoiceCallReport','outbound','startOf','day'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xaa16,0x8c));var _0x6aa1=function(_0x3566ed,_0x44a527){_0x3566ed=_0x3566ed-0x0;var _0x28e7ad=_0xaa16[_0x3566ed];return _0x28e7ad;};'use strict';var moment=require(_0x6aa1('0x0'));var util=require(_0x6aa1('0x1'));var _=require('lodash');var client=require(_0x6aa1('0x2'));exports[_0x6aa1('0x3')]=function(_0x384455){return client[_0x6aa1('0x4')](_0x6aa1('0x5'),{'body':_['merge'](_0x384455,{'source':_0x384455['calleridnum'],'destinationcontext':_0x384455[_0x6aa1('0x6')],'callerid':_0x384455[_0x6aa1('0x7')],'amaflags':'DOCUMENTATION'}),'log':'CreateVoiceCallReport'});};exports['getVoiceCallReports']=function(){return function(){return client[_0x6aa1('0x4')](_0x6aa1('0x8'),{'options':{'where':{'type':[_0x6aa1('0x9')],'createdAt':{'$between':[moment()[_0x6aa1('0xa')](_0x6aa1('0xb'))[_0x6aa1('0xc')]('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0x6aa1('0xd')](_0x6aa1('0xb'))['format'](_0x6aa1('0xe'))]}},'attributes':['type',_0x6aa1('0xf'),_0x6aa1('0x10'),_0x6aa1('0x11')]},'log':_0x6aa1('0x12')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index fc2c553..71c71ec 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 _0x0309=['create','Request','CreateVoiceDialReport','../client'];(function(_0x55dd68,_0x2dc9d8){var _0x213ac7=function(_0x32699d){while(--_0x32699d){_0x55dd68['push'](_0x55dd68['shift']());}};_0x213ac7(++_0x2dc9d8);}(_0x0309,0x1e3));var _0x9030=function(_0x47cf7f,_0x32f11e){_0x47cf7f=_0x47cf7f-0x0;var _0x145135=_0x0309[_0x47cf7f];return _0x145135;};'use strict';var client=require(_0x9030('0x0'));exports[_0x9030('0x1')]=function(_0x4517c5){return client[_0x9030('0x2')](_0x9030('0x3'),{'body':_0x4517c5,'log':_0x9030('0x3')});}; \ No newline at end of file +var _0xbbe1=['CreateVoiceDialReport','../client','create','Request'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbbe1,0x1e9));var _0x1bbe=function(_0x2abe9a,_0x426745){_0x2abe9a=_0x2abe9a-0x0;var _0xdd91ac=_0xbbe1[_0x2abe9a];return _0xdd91ac;};'use strict';var client=require(_0x1bbe('0x0'));exports[_0x1bbe('0x1')]=function(_0x2dbbbd){return client[_0x1bbe('0x2')](_0x1bbe('0x3'),{'body':_0x2dbbbd,'log':_0x1bbe('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index a599f7c..6a4efcd 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 _0x222f=['../client','getVoiceExtensions','Request','GetVoiceExtension'];(function(_0x52b1e8,_0xb7cfaf){var _0x3cdb24=function(_0x40c789){while(--_0x40c789){_0x52b1e8['push'](_0x52b1e8['shift']());}};_0x3cdb24(++_0xb7cfaf);}(_0x222f,0x1a4));var _0xf222=function(_0x46ae5a,_0x2a38d0){_0x46ae5a=_0x46ae5a-0x0;var _0x434986=_0x222f[_0x46ae5a];return _0x434986;};'use strict';var client=require(_0xf222('0x0'));exports[_0xf222('0x1')]=function(){return function(){return client[_0xf222('0x2')](_0xf222('0x3'),{'options':{'raw':!![],'attributes':['id','exten','recordingFormat'],'where':{'VoiceExtensionId':null}},'log':_0xf222('0x1')});};}; \ No newline at end of file +var _0x453b=['exten','recordingFormat','../client','getVoiceExtensions','Request','GetVoiceExtension'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x453b,0x164));var _0xb453=function(_0x59ee91,_0x5ca1ef){_0x59ee91=_0x59ee91-0x0;var _0x51b0b7=_0x453b[_0x59ee91];return _0x51b0b7;};'use strict';var client=require(_0xb453('0x0'));exports[_0xb453('0x1')]=function(){return function(){return client[_0xb453('0x2')](_0xb453('0x3'),{'options':{'raw':!![],'attributes':['id',_0xb453('0x4'),_0xb453('0x5')],'where':{'VoiceExtensionId':null}},'log':_0xb453('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index 47fba77..36cde70 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 _0x91f5=['dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDTotalAnalysisTime','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialQueueProject2','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMinThreshold','Trunk','name','callerid','active','mandatoryDispositionPause','Interval','Intervals','interval','../client','getVoiceQueues','GetVoiceQueue','acw','autopause','monitor_format','type','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialPrefix'];(function(_0x26a461,_0x3d0bea){var _0x2fb2c8=function(_0x1cfd7d){while(--_0x1cfd7d){_0x26a461['push'](_0x26a461['shift']());}};_0x2fb2c8(++_0x3d0bea);}(_0x91f5,0x9c));var _0x591f=function(_0x56cb27,_0x262f51){_0x56cb27=_0x56cb27-0x0;var _0x62e322=_0x91f5[_0x56cb27];return _0x62e322;};'use strict';var client=require(_0x591f('0x0'));exports[_0x591f('0x1')]=function(){return function(){return client['Request'](_0x591f('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x591f('0x3'),'acwTimeout',_0x591f('0x4'),_0x591f('0x5'),_0x591f('0x6'),_0x591f('0x7'),_0x591f('0x8'),_0x591f('0x9'),_0x591f('0xa'),_0x591f('0xb'),_0x591f('0xc'),_0x591f('0xd'),_0x591f('0xe'),_0x591f('0xf'),_0x591f('0x10'),_0x591f('0x11'),_0x591f('0x12'),'dialQueueTimeout',_0x591f('0x13'),_0x591f('0x14'),_0x591f('0x15'),_0x591f('0x16'),_0x591f('0x17'),_0x591f('0x18'),_0x591f('0x19'),_0x591f('0x1a'),_0x591f('0x1b'),_0x591f('0x1c'),_0x591f('0x1d'),_0x591f('0x1e'),_0x591f('0x1f'),_0x591f('0x20'),_0x591f('0x21'),'dialAMDAfterGreetingSilence',_0x591f('0x22'),'dialAMDMinWordLength',_0x591f('0x23'),_0x591f('0x24'),_0x591f('0x25'),_0x591f('0x26'),_0x591f('0x27'),_0x591f('0x28'),_0x591f('0x29'),_0x591f('0x2a'),_0x591f('0x2b'),'dialAgiAfterHangupClient',_0x591f('0x2c'),_0x591f('0x5'),'strategy',_0x591f('0x2d'),_0x591f('0x2e'),'dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency',_0x591f('0x2f'),_0x591f('0x30'),_0x591f('0x31'),'dialMachineRetryFrequency',_0x591f('0x32'),_0x591f('0x33'),_0x591f('0x34'),'dialPredictiveIntervalMaxThreshold',_0x591f('0x35')],'include':[{'model':'Trunk','as':_0x591f('0x36'),'attributes':['id',_0x591f('0x37'),_0x591f('0x38'),_0x591f('0x39')]},{'model':'Pause','as':_0x591f('0x3a'),'attributes':['id',_0x591f('0x37')]},{'model':_0x591f('0x36'),'as':'TrunkBackup','attributes':['id',_0x591f('0x37'),'callerid',_0x591f('0x39')]},{'model':'Interval','as':_0x591f('0x3b'),'attributes':['id',_0x591f('0x37')],'include':[{'model':_0x591f('0x3b'),'as':_0x591f('0x3c'),'attributes':['id',_0x591f('0x37'),_0x591f('0x3d')]}]}]},'log':'getVoiceQueues'});};}; \ No newline at end of file +var _0xfc15=['acwTimeout','autopause','monitor_format','dialActive','dialMethod','dialLimitQueue','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueTimeout','dialQueueProject','dialCongestionRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialTimezone','dialGlobalInterval','dialCheckDuplicateType','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','dialRecallMeTimeout','dialRecallInQueue','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','strategy','dialRandomLastDigitCallerIdNumber','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','Trunk','callerid','active','Pause','mandatoryDispositionPause','TrunkBackup','Interval','Intervals','interval','../client','getVoiceQueues','Request','name','acw'];(function(_0x26f1b2,_0x33d843){var _0x1624a4=function(_0x58dfb7){while(--_0x58dfb7){_0x26f1b2['push'](_0x26f1b2['shift']());}};_0x1624a4(++_0x33d843);}(_0xfc15,0x14b));var _0x5fc1=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xfc15[_0x502c7d];return _0x30b7ed;};'use strict';var client=require(_0x5fc1('0x0'));exports[_0x5fc1('0x1')]=function(){return function(){return client[_0x5fc1('0x2')]('GetVoiceQueue',{'options':{'raw':![],'attributes':['id',_0x5fc1('0x3'),_0x5fc1('0x4'),_0x5fc1('0x5'),_0x5fc1('0x6'),_0x5fc1('0x7'),'type',_0x5fc1('0x8'),_0x5fc1('0x9'),'dialLimitChannel',_0x5fc1('0xa'),'dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval',_0x5fc1('0xb'),_0x5fc1('0xc'),_0x5fc1('0xd'),'dialQueueOptions',_0x5fc1('0xe'),_0x5fc1('0xf'),'dialCongestionMaxRetry',_0x5fc1('0x10'),'dialBusyMaxRetry','dialBusyRetryFrequency',_0x5fc1('0x11'),_0x5fc1('0x12'),'dialGlobalMaxRetry',_0x5fc1('0x13'),_0x5fc1('0x14'),'dialPrefix',_0x5fc1('0x15'),'dialAMDActive','dialAMDInitialSilence',_0x5fc1('0x16'),_0x5fc1('0x17'),_0x5fc1('0x18'),_0x5fc1('0x19'),_0x5fc1('0x1a'),_0x5fc1('0x1b'),_0x5fc1('0x1c'),_0x5fc1('0x1d'),'timeout',_0x5fc1('0x1e'),_0x5fc1('0x1f'),'dialOrderByScheduledAt',_0x5fc1('0x20'),_0x5fc1('0x21'),'dialQueueProject2','monitor_format',_0x5fc1('0x22'),_0x5fc1('0x23'),'dialCutDigit',_0x5fc1('0x24'),_0x5fc1('0x25'),_0x5fc1('0x26'),_0x5fc1('0x27'),_0x5fc1('0x28'),_0x5fc1('0x29'),_0x5fc1('0x2a'),_0x5fc1('0x2b'),'dialAgentRejectMaxRetry',_0x5fc1('0x2c'),_0x5fc1('0x2d'),_0x5fc1('0x2e'),'dialPredictiveIntervalMinThreshold'],'include':[{'model':_0x5fc1('0x2f'),'as':'Trunk','attributes':['id',_0x5fc1('0x3'),_0x5fc1('0x30'),_0x5fc1('0x31')]},{'model':_0x5fc1('0x32'),'as':_0x5fc1('0x33'),'attributes':['id',_0x5fc1('0x3')]},{'model':_0x5fc1('0x2f'),'as':_0x5fc1('0x34'),'attributes':['id',_0x5fc1('0x3'),_0x5fc1('0x30'),_0x5fc1('0x31')]},{'model':_0x5fc1('0x35'),'as':'Interval','attributes':['id','name'],'include':[{'model':_0x5fc1('0x35'),'as':_0x5fc1('0x36'),'attributes':['id','name',_0x5fc1('0x37')]}]}]},'log':_0x5fc1('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index bf1bfb5..116e0d9 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(_0x2284bf,_0x297fcd){var _0x2239ca=function(_0x2459b6){while(--_0x2459b6){_0x2284bf['push'](_0x2284bf['shift']());}};_0x2239ca(++_0x297fcd);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0xa9e0[_0x4154a6];return _0x3b2786;};'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(_0x179865,_0x225f87){var _0x2821b1=function(_0x1496ba){while(--_0x1496ba){_0x179865['push'](_0x179865['shift']());}};_0x2821b1(++_0x225f87);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5e3b04,_0xbb6795){_0x5e3b04=_0x5e3b04-0x0;var _0x1fc44d=_0xa9e0[_0x5e3b04];return _0x1fc44d;};'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 472163a..b06670c 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 _0x9f8a=['getVoiceQueueRtPauses','GetVoiceQueueRtPauses','../client'];(function(_0x145824,_0x5e892c){var _0x1d155c=function(_0xb8a650){while(--_0xb8a650){_0x145824['push'](_0x145824['shift']());}};_0x1d155c(++_0x5e892c);}(_0x9f8a,0xda));var _0xa9f8=function(_0x19ad63,_0x4df85e){_0x19ad63=_0x19ad63-0x0;var _0x26a275=_0x9f8a[_0x19ad63];return _0x26a275;};'use strict';var client=require(_0xa9f8('0x0'));exports[_0xa9f8('0x1')]=function(_0x3d01d6){return function(){return client['Request'](_0xa9f8('0x2'),{'options':{'where':{'VoiceQueueId':_0x3d01d6,'paused':!![]},'raw':!![]},'log':_0xa9f8('0x1')});};}; \ No newline at end of file +var _0xab00=['GetVoiceQueueRtPauses','../client','getVoiceQueueRtPauses','Request'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0xab00,0x121));var _0x0ab0=function(_0xb5b059,_0xe02f2){_0xb5b059=_0xb5b059-0x0;var _0x539fca=_0xab00[_0xb5b059];return _0x539fca;};'use strict';var client=require(_0x0ab0('0x0'));exports[_0x0ab0('0x1')]=function(_0x3666f6){return function(){return client[_0x0ab0('0x2')](_0x0ab0('0x3'),{'options':{'where':{'VoiceQueueId':_0x3666f6,'paused':!![]},'raw':!![]},'log':_0x0ab0('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index 23050be..8a00d78 100644 --- a/server/services/ami/rpc/voiceRecording.js +++ b/server/services/ami/rpc/voiceRecording.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['create','Request','CreateVoiceRecording','monitorFilename','lodash','../client'];(function(_0x4ff01d,_0x4c5ae8){var _0x2584d5=function(_0x8f1502){while(--_0x8f1502){_0x4ff01d['push'](_0x4ff01d['shift']());}};_0x2584d5(++_0x4c5ae8);}(_0x7a54,0x106));var _0x47a5=function(_0x225672,_0x636224){_0x225672=_0x225672-0x0;var _0x7088ee=_0x7a54[_0x225672];return _0x7088ee;};'use strict';var _=require(_0x47a5('0x0'));var client=require(_0x47a5('0x1'));exports[_0x47a5('0x2')]=function(_0x58157c){return client[_0x47a5('0x3')](_0x47a5('0x4'),{'body':_['merge'](_0x58157c,{'value':_0x58157c[_0x47a5('0x5')]}),'log':_0x47a5('0x4')});}; \ No newline at end of file +var _0x9957=['CreateVoiceRecording','merge','monitorFilename','lodash','../client','create'];(function(_0x57ef89,_0xc07c28){var _0x122ac0=function(_0x425f38){while(--_0x425f38){_0x57ef89['push'](_0x57ef89['shift']());}};_0x122ac0(++_0xc07c28);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x7995('0x0'));var client=require(_0x7995('0x1'));exports[_0x7995('0x2')]=function(_0x10a05d){return client['Request'](_0x7995('0x3'),{'body':_[_0x7995('0x4')](_0x10a05d,{'value':_0x10a05d[_0x7995('0x5')]}),'log':_0x7995('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceTransferReport.js b/server/services/ami/rpc/voiceTransferReport.js index d903951..847ba66 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 _0xf374=['transfererexten','transfereechannel','transfereecalleridnum','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereeexten','transfereelinkedid','isexternal','extension','attendedTransfer','Request','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','origtransferercontext','origtransfererexten','attended','../client','blindTransfer','CreateVoiceTransferReport','result','transfererchannel','transferercalleridname','transfererconnectedlinename','transfereraccountcode','transferercontext'];(function(_0x51ebcf,_0x64a11a){var _0x3af5ec=function(_0x4bd0bd){while(--_0x4bd0bd){_0x51ebcf['push'](_0x51ebcf['shift']());}};_0x3af5ec(++_0x64a11a);}(_0xf374,0x75));var _0x4f37=function(_0x23ee6b,_0x2c44a3){_0x23ee6b=_0x23ee6b-0x0;var _0xa8924e=_0xf374[_0x23ee6b];return _0xa8924e;};'use strict';var client=require(_0x4f37('0x0'));exports['transfers']={};exports[_0x4f37('0x1')]=function(_0x471f0e){return client['Request'](_0x4f37('0x2'),{'body':{'result':_0x471f0e[_0x4f37('0x3')],'transfererchannel':_0x471f0e[_0x4f37('0x4')],'transferercalleridnum':_0x471f0e['transferercalleridnum'],'transferercalleridname':_0x471f0e[_0x4f37('0x5')],'transfererconnectedlinenum':_0x471f0e['transfererconnectedlinenum'],'transfererconnectedlinename':_0x471f0e[_0x4f37('0x6')],'transfereraccountcode':_0x471f0e[_0x4f37('0x7')],'transferercontext':_0x471f0e[_0x4f37('0x8')],'transfererexten':_0x471f0e[_0x4f37('0x9')],'transfererlinkedid':_0x471f0e['transfererlinkedid'],'transfereechannel':_0x471f0e[_0x4f37('0xa')],'transfereecalleridnum':_0x471f0e[_0x4f37('0xb')],'transfereecalleridname':_0x471f0e['transfereecalleridname'],'transfereeconnectedlinenum':_0x471f0e[_0x4f37('0xc')],'transfereeconnectedlinename':_0x471f0e[_0x4f37('0xd')],'transfereeaccountcode':_0x471f0e[_0x4f37('0xe')],'transfereecontext':_0x471f0e['transfereecontext'],'transfereeexten':_0x471f0e[_0x4f37('0xf')],'transfereelinkedid':_0x471f0e[_0x4f37('0x10')],'isexternal':_0x471f0e[_0x4f37('0x11')],'context':_0x471f0e['context'],'extension':_0x471f0e[_0x4f37('0x12')],'type':'blind'},'log':_0x4f37('0x2')});};exports[_0x4f37('0x13')]=function(_0x23ad87){return client[_0x4f37('0x14')]('CreateVoiceTransferReport',{'body':{'result':_0x23ad87[_0x4f37('0x3')],'transfererchannel':_0x23ad87[_0x4f37('0x15')],'transferercalleridnum':_0x23ad87[_0x4f37('0x16')],'transferercalleridname':_0x23ad87[_0x4f37('0x17')],'transfererconnectedlinenum':_0x23ad87[_0x4f37('0x18')],'transfererconnectedlinename':_0x23ad87[_0x4f37('0x19')],'transfereraccountcode':_0x23ad87[_0x4f37('0x1a')],'transferercontext':_0x23ad87[_0x4f37('0x1b')],'transfererexten':_0x23ad87[_0x4f37('0x1c')],'transfererlinkedid':_0x23ad87[_0x4f37('0x1d')],'transfereechannel':_0x23ad87[_0x4f37('0x1e')],'transfereecalleridnum':_0x23ad87[_0x4f37('0x1f')],'transfereecalleridname':_0x23ad87[_0x4f37('0x20')],'transfereeconnectedlinenum':_0x23ad87[_0x4f37('0x21')],'transfereeconnectedlinename':_0x23ad87[_0x4f37('0x22')],'transfereeaccountcode':_0x23ad87[_0x4f37('0x23')],'transfereecontext':_0x23ad87[_0x4f37('0x24')],'transfereeexten':_0x23ad87[_0x4f37('0x25')],'transfereelinkedid':_0x23ad87[_0x4f37('0x26')],'isexternal':_0x23ad87[_0x4f37('0x11')],'context':_0x23ad87[_0x4f37('0x27')],'extension':_0x23ad87[_0x4f37('0x28')],'type':_0x4f37('0x29')},'log':'CreateVoiceTransferReport'});}; \ No newline at end of file +var _0x9db9=['blind','attendedTransfer','origtransfererchannel','origtransferercalleridnum','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetexten','transfertargetlinkedid','isexternal','origtransfererexten','attended','transfers','blindTransfer','Request','CreateVoiceTransferReport','result','transferercalleridnum','transfererconnectedlinenum','transfererconnectedlinename','transferercontext','transfererexten','transfereechannel','transfereecalleridnum','transfereeconnectedlinenum','transfereeconnectedlinename','transfereecontext','transfereeexten','extension'];(function(_0x37b851,_0x469969){var _0x574599=function(_0x4e6ab8){while(--_0x4e6ab8){_0x37b851['push'](_0x37b851['shift']());}};_0x574599(++_0x469969);}(_0x9db9,0xe4));var _0x99db=function(_0x5dde02,_0x4cf24d){_0x5dde02=_0x5dde02-0x0;var _0x3c8517=_0x9db9[_0x5dde02];return _0x3c8517;};'use strict';var client=require('../client');exports[_0x99db('0x0')]={};exports[_0x99db('0x1')]=function(_0xd46896){return client[_0x99db('0x2')](_0x99db('0x3'),{'body':{'result':_0xd46896[_0x99db('0x4')],'transfererchannel':_0xd46896['transfererchannel'],'transferercalleridnum':_0xd46896[_0x99db('0x5')],'transferercalleridname':_0xd46896['transferercalleridname'],'transfererconnectedlinenum':_0xd46896[_0x99db('0x6')],'transfererconnectedlinename':_0xd46896[_0x99db('0x7')],'transfereraccountcode':_0xd46896['transfereraccountcode'],'transferercontext':_0xd46896[_0x99db('0x8')],'transfererexten':_0xd46896[_0x99db('0x9')],'transfererlinkedid':_0xd46896['transfererlinkedid'],'transfereechannel':_0xd46896[_0x99db('0xa')],'transfereecalleridnum':_0xd46896[_0x99db('0xb')],'transfereecalleridname':_0xd46896['transfereecalleridname'],'transfereeconnectedlinenum':_0xd46896[_0x99db('0xc')],'transfereeconnectedlinename':_0xd46896[_0x99db('0xd')],'transfereeaccountcode':_0xd46896['transfereeaccountcode'],'transfereecontext':_0xd46896[_0x99db('0xe')],'transfereeexten':_0xd46896[_0x99db('0xf')],'transfereelinkedid':_0xd46896['transfereelinkedid'],'isexternal':_0xd46896['isexternal'],'context':_0xd46896['context'],'extension':_0xd46896[_0x99db('0x10')],'type':_0x99db('0x11')},'log':_0x99db('0x3')});};exports[_0x99db('0x12')]=function(_0x280d3e){return client['Request'](_0x99db('0x3'),{'body':{'result':_0x280d3e[_0x99db('0x4')],'transfererchannel':_0x280d3e[_0x99db('0x13')],'transferercalleridnum':_0x280d3e[_0x99db('0x14')],'transferercalleridname':_0x280d3e['origtransferercalleridname'],'transfererconnectedlinenum':_0x280d3e[_0x99db('0x15')],'transfererconnectedlinename':_0x280d3e[_0x99db('0x16')],'transfereraccountcode':_0x280d3e['origtransfereraccountcode'],'transferercontext':_0x280d3e['secondtransferercontext'],'transfererexten':_0x280d3e[_0x99db('0x17')],'transfererlinkedid':_0x280d3e[_0x99db('0x18')],'transfereechannel':_0x280d3e[_0x99db('0x19')],'transfereecalleridnum':_0x280d3e[_0x99db('0x1a')],'transfereecalleridname':_0x280d3e['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x280d3e[_0x99db('0x1b')],'transfereeconnectedlinename':_0x280d3e[_0x99db('0x1c')],'transfereeaccountcode':_0x280d3e[_0x99db('0x1d')],'transfereecontext':_0x280d3e['transfertargetcontext'],'transfereeexten':_0x280d3e[_0x99db('0x1e')],'transfereelinkedid':_0x280d3e[_0x99db('0x1f')],'isexternal':_0x280d3e[_0x99db('0x20')],'context':_0x280d3e['origtransferercontext'],'extension':_0x280d3e[_0x99db('0x21')],'type':_0x99db('0x22')},'log':_0x99db('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index 4df1abb..b649f3a 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 _0xafb9=['then','catch','error','message','isConnected','command','Command','voiceQueues','answered','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','type','unmanaged','waiting','loggedInDb','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangBusyFactor','startPredictive','startProgressive','Trunk','callerid','Interval','push','find','undefined','values','channels','length','voicechannel','map','uniqueid','channel','%s.%s','filename','wav','ai(mixmonitorid)','isNil','toLowerCase','YYYY-MM-DD\x20HH:mm:ss','rec','mixmonitorid','status','resolve','StopMixMonitor','destinationchannel','stop','monitors','StopMixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','queueChannels','voicequeuechannel','Hangup','voicequeuechannelredirect','exten','context','telephones','trunks','outboundChannels','campaigns','event','Event\x20name\x20mandatory','custom:','send','checkAfterSend','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','lodash','util','jayson/promise','validate','bluebird','moment','../../../config/environment','../properties','../ami','format','%s/%s','SIP','name','timers','timer','updateAcw','agents','updateStatusRealtime','pause','QueuePause','asterisk','username','ami\x20disconnected','join','pick','keys','action','Reload','Action'];(function(_0x72337f,_0xebeab7){var _0x48545b=function(_0x9918c9){while(--_0x9918c9){_0x72337f['push'](_0x72337f['shift']());}};_0x48545b(++_0xebeab7);}(_0xafb9,0x68));var _0x9afb=function(_0x23d7c3,_0x581b2f){_0x23d7c3=_0x23d7c3-0x0;var _0x56fef4=_0xafb9[_0x23d7c3];return _0x56fef4;};'use strict';var _=require(_0x9afb('0x0'));var util=require(_0x9afb('0x1'));var jayson=require(_0x9afb('0x2'));var schema=require(_0x9afb('0x3'));var BPromise=require(_0x9afb('0x4'));var moment=require(_0x9afb('0x5'));var config=require(_0x9afb('0x6'));var properties=require(_0x9afb('0x7'));var ami=require(_0x9afb('0x8'));exports['listen']=function(_0x498463,_0x91ffa0,_0x56a139){return new BPromise(function(_0x1ccf93,_0x548b24){var _0x556880={'QueuePause':function(_0x4c0e9d){return new Promise(function(_0x1edf77,_0x20b8c1){var _0x51dc88=util[_0x9afb('0x9')](_0x9afb('0xa'),_0x9afb('0xb'),_0x4c0e9d[_0x9afb('0xc')]);if(_0x498463[_0x9afb('0xd')]&&_0x498463['timers'][_0x51dc88]&&_0x498463['timers'][_0x51dc88][_0x9afb('0xe')]){_0x498463[_0x9afb('0xd')][_0x51dc88][_0x9afb('0xf')]();}if(_0x498463[_0x9afb('0x10')][_0x51dc88]){_0x498463[_0x9afb('0x10')][_0x51dc88][_0x9afb('0x11')]({'statePause':_0x4c0e9d[_0x9afb('0x12')]?!![]:![]});}_0x1edf77({'code':0xc8,'message':_0x9afb('0x13')});});},'Reload':function(_0x464462){var _0x10602b=this;return new Promise(function(_0x47a804,_0x27137c){if(ami['isConnected']()==![]){return _0x27137c(_0x10602b['error'](0x1f4,[config[_0x9afb('0x14')]['ip'],config[_0x9afb('0x14')][_0x9afb('0x15')],_0x9afb('0x16')][_0x9afb('0x17')]('\x20')));}_0x464462=_[_0x9afb('0x18')](_0x464462,_[_0x9afb('0x19')](properties['module']));_0x464462[_0x9afb('0x1a')]=_0x9afb('0x1b');return ami[_0x9afb('0x1c')](_0x464462)[_0x9afb('0x1d')](function(_0x223aef){_0x47a804({'code':0xc8,'message':_0x223aef['message']});})[_0x9afb('0x1e')](function(_0x50a7e4){_0x27137c(_0x10602b[_0x9afb('0x1f')](0x1f5,_0x50a7e4[_0x9afb('0x20')]));});});},'Command':function(_0x4a856b){var _0x4a1c74=this;return new Promise(function(_0x3ac42f,_0x1217d9){if(ami[_0x9afb('0x21')]()==![]){return _0x1217d9(_0x4a1c74[_0x9afb('0x1f')](0x1f4,[config[_0x9afb('0x14')]['ip'],config['asterisk'][_0x9afb('0x15')],'ami\x20disconnected']['join']('\x20')));}_0x4a856b=_[_0x9afb('0x18')](_0x4a856b,_0x9afb('0x22'));_0x4a856b[_0x9afb('0x1a')]=_0x9afb('0x23');return ami['Action'](_0x4a856b)[_0x9afb('0x1d')](function(_0x725a04){_0x3ac42f({'code':0xc8,'message':_0x725a04['content']});})['catch'](function(_0x5b5dab){_0x1217d9(_0x4a1c74[_0x9afb('0x1f')](0x1f5,_0x5b5dab['message']));});});},'VoiceQueues':function(_0x387379){return new Promise(function(_0x123510,_0x50a919){var _0x324293=[];for(var _0x28beba in _0x498463[_0x9afb('0x24')]){if(_0x498463[_0x9afb('0x24')]['hasOwnProperty'](_0x28beba)){var _0x348255=_0x498463['voiceQueues'][_0x28beba];var _0x29e092={'id':_0x348255['id'],'name':_0x348255['name'],'strategy':_0x348255['strategy'],'answered':_0x348255[_0x9afb('0x25')],'available':_0x348255[_0x9afb('0x26')],'loggedIn':_0x348255[_0x9afb('0x27')],'pTalking':_0x348255[_0x9afb('0x28')],'sumBillable':_0x348255[_0x9afb('0x29')],'sumDuration':_0x348255[_0x9afb('0x2a')],'sumHoldTime':_0x348255[_0x9afb('0x2b')]||0x0,'talking':_0x348255['talking'],'total':_0x348255['total'],'type':_0x348255[_0x9afb('0x2c')],'unmanaged':_0x348255[_0x9afb('0x2d')],'abandoned':_0x348255['abandoned'],'waiting':_0x348255[_0x9afb('0x2e')],'loggedInDb':_0x348255[_0x9afb('0x2f')]};if(_0x348255['type']===_0x9afb('0x30')){_0x29e092[_0x9afb('0x31')]=_0x348255[_0x9afb('0x31')];_0x29e092[_0x9afb('0x32')]=_0x348255[_0x9afb('0x32')];_0x29e092[_0x9afb('0x33')]=_0x348255[_0x9afb('0x33')];_0x29e092[_0x9afb('0x34')]=_0x348255['dialOriginateCallerIdNumber'];_0x29e092['dialOriginateTimeout']=_0x348255[_0x9afb('0x35')];_0x29e092[_0x9afb('0x36')]=_0x348255[_0x9afb('0x36')];_0x29e092[_0x9afb('0x37')]=_0x348255[_0x9afb('0x37')];_0x29e092[_0x9afb('0x38')]=_0x348255[_0x9afb('0x38')];_0x29e092['outboundAnswerCallsDay']=_0x348255['outboundAnswerCallsDay'];_0x29e092[_0x9afb('0x39')]=_0x348255[_0x9afb('0x39')];_0x29e092['outboundBusyCallsDay']=_0x348255[_0x9afb('0x3a')];_0x29e092['outboundCongestionCallsDay']=_0x348255[_0x9afb('0x3b')];_0x29e092[_0x9afb('0x3c')]=_0x348255['outboundDropCallsDayACS'];_0x29e092[_0x9afb('0x3d')]=_0x348255['outboundDropCallsDayCallersExit'];_0x29e092[_0x9afb('0x3e')]=_0x348255[_0x9afb('0x3e')];_0x29e092[_0x9afb('0x3f')]=_0x348255[_0x9afb('0x3f')];_0x29e092[_0x9afb('0x40')]=_0x348255[_0x9afb('0x40')];_0x29e092[_0x9afb('0x41')]=_0x348255[_0x9afb('0x41')];_0x29e092['outboundReCallsDay']=_0x348255[_0x9afb('0x42')];_0x29e092['outboundRejectCallsDay']=_0x348255[_0x9afb('0x43')];_0x29e092[_0x9afb('0x44')]=_0x348255[_0x9afb('0x44')];_0x29e092[_0x9afb('0x45')]=_0x348255[_0x9afb('0x45')];_0x29e092[_0x9afb('0x46')]=_0x348255[_0x9afb('0x46')];_0x29e092[_0x9afb('0x47')]=_0x348255[_0x9afb('0x47')];_0x29e092['predictiveIntervalDroppedCallsCallersExit']=_0x348255[_0x9afb('0x48')];_0x29e092['predictiveIntervalDroppedCallsTimeout']=_0x348255[_0x9afb('0x49')];_0x29e092[_0x9afb('0x4a')]=_0x348255[_0x9afb('0x4a')];_0x29e092['predictiveIntervalErlangCallsDroppedCalls']=_0x348255[_0x9afb('0x4b')];_0x29e092[_0x9afb('0x4c')]=_0x348255[_0x9afb('0x4c')];_0x29e092[_0x9afb('0x4d')]=_0x348255[_0x9afb('0x4d')];_0x29e092[_0x9afb('0x4e')]=_0x348255[_0x9afb('0x4e')];_0x29e092['predictiveIntervalAvailable']=_0x348255[_0x9afb('0x4f')];_0x29e092[_0x9afb('0x50')]=_0x348255[_0x9afb('0x50')];_0x29e092[_0x9afb('0x20')]=_0x348255[_0x9afb('0x20')];_0x29e092[_0x9afb('0x51')]=_0x348255[_0x9afb('0x51')];_0x29e092[_0x9afb('0x52')]=_0x348255['erlangCalls'];_0x29e092[_0x9afb('0x53')]=_0x348255['erlangCallToSecond'];_0x29e092['erlangAbandonmentRate']=_0x348255['erlangAbandonmentRate'];_0x29e092[_0x9afb('0x54')]=_0x348255[_0x9afb('0x54')];_0x29e092['startPredictive']=_0x348255[_0x9afb('0x55')];_0x29e092[_0x9afb('0x56')]=_0x348255[_0x9afb('0x56')];}if(_0x348255[_0x9afb('0x57')]){_0x29e092[_0x9afb('0x57')]={'id':_0x348255[_0x9afb('0x57')]['id'],'name':_0x348255[_0x9afb('0x57')][_0x9afb('0xc')],'active':_0x348255[_0x9afb('0x57')]['active'],'callerid':_0x348255[_0x9afb('0x57')][_0x9afb('0x58')]};}if(_0x348255[_0x9afb('0x59')]){_0x29e092[_0x9afb('0x59')]={'id':_0x348255['Interval']['id'],'name':_0x348255[_0x9afb('0x59')][_0x9afb('0xc')]};}_0x324293[_0x9afb('0x5a')](_0x29e092);}}_0x123510({'count':_0x324293['length'],'rows':_0x324293});});},'UpdateVoiceQueue':function(_0x24f76c){return new Promise(function(_0x1d79b1,_0x13179d){var _0x12eddf=_[_0x9afb('0x5b')](_0x498463[_0x9afb('0x24')],{'id':parseInt(_0x24f76c['id'])});var _0x21ce09=_['omit'](_0x24f76c,['id']);if(_0x12eddf){for(var _0x5a36e4 in _0x21ce09){if(typeof _0x21ce09[_0x5a36e4]!=='undefined'&&typeof _0x12eddf[_0x5a36e4]!==_0x9afb('0x5c')){_0x12eddf[_0x5a36e4]=_0x21ce09[_0x5a36e4];}}_0x1d79b1(_0x12eddf);}else{_0x13179d();}});},'VoiceChannels':function(_0x29cde4){return new Promise(function(_0x5a1507,_0x20bd33){var _0xdcfefd=_[_0x9afb('0x5d')](_0x498463[_0x9afb('0x5e')]);_0x5a1507({'count':_0xdcfefd[_0x9afb('0x5f')],'rows':_0xdcfefd});});},'VoiceChannelMixMonitor':function(_0x122a35){var _0xdb82c3=this;return new Promise(function(_0x1de5cf,_0x20abe4){if(ami[_0x9afb('0x21')]()==![]){return _0x20abe4(_0xdb82c3[_0x9afb('0x1f')](0x1f4,[config['asterisk']['ip'],config['asterisk'][_0x9afb('0x15')],'ami\x20disconnected'][_0x9afb('0x17')]('\x20')));}var _0xd41258=schema(properties[_0x9afb('0x60')])[_0x9afb('0x3')](_0x122a35);if(_0xd41258[_0x9afb('0x5f')]>0x0){return _0x20abe4(_0xdb82c3['error'](0x1f4,_[_0x9afb('0x61')](_0xd41258,'message')[_0x9afb('0x17')](',\x20')));}var _0x222ee0=_[_0x9afb('0x5b')](_0x498463[_0x9afb('0x5e')],{'uniqueid':_0x122a35[_0x9afb('0x62')]});if(_0x222ee0&&_0x222ee0[_0x9afb('0x63')]){var _0x449a7e=util['format'](_0x9afb('0x64'),_0x122a35[_0x9afb('0x65')]||_0x122a35[_0x9afb('0x62')],_0x122a35['format']||_0x9afb('0x66'));return ami[_0x9afb('0x1c')]({'action':'MixMonitor','channel':_0x222ee0[_0x9afb('0x63')],'file':_0x449a7e,'options':_0x9afb('0x67')})[_0x9afb('0x1d')](function(_0x5bcea5){var _0x3975c0=_[_0x9afb('0x5b')](_0x222ee0['monitors'],{'filename':'/var/spool/asterisk/monitor/'+_0x449a7e['toLowerCase']()});if(_[_0x9afb('0x68')](_0x3975c0)){_0x222ee0['monitors'][_0x9afb('0x5a')]({'filename':'/var/spool/asterisk/monitor/'+_0x449a7e[_0x9afb('0x69')](),'createdAt':moment()[_0x9afb('0x9')](_0x9afb('0x6a')),'mixmonitorid':_0x5bcea5['mixmonitorid'],'status':_0x9afb('0x6b')});}else{_0x3975c0[_0x9afb('0x6c')]=_0x5bcea5[_0x9afb('0x6c')];_0x3975c0[_0x9afb('0x6d')]=_0x9afb('0x6b');}_0x1de5cf({'code':0xc8,'message':[_0x122a35[_0x9afb('0x62')],'MixMonitor\x20Success',_0x5bcea5[_0x9afb('0x6c')]][_0x9afb('0x17')]('\x20'),'mixmonitorid':_0x5bcea5[_0x9afb('0x6c')]});})[_0x9afb('0x1e')](function(_0x54aeff){_0x20abe4(_0xdb82c3[_0x9afb('0x1f')](0x1f5,[_0x122a35[_0x9afb('0x62')],_0x54aeff['message'][_0x9afb('0x69')]()][_0x9afb('0x17')]('\x20')));});}else{return _0x20abe4(_0xdb82c3[_0x9afb('0x1f')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceChannelStopMixMonitor':function(_0x347ce8){var _0x12b44e=this;return new Promise(function(_0x158dfd,_0x41bb8e){if(ami[_0x9afb('0x21')]()==![]){return _0x41bb8e(_0x12b44e[_0x9afb('0x1f')](0x1f4,[config[_0x9afb('0x14')]['ip'],config[_0x9afb('0x14')][_0x9afb('0x15')],_0x9afb('0x16')][_0x9afb('0x17')]('\x20')));}var _0x2404aa=schema(properties[_0x9afb('0x60')])['validate'](_0x347ce8);if(_0x2404aa[_0x9afb('0x5f')]>0x0){return _0x41bb8e(_0x12b44e[_0x9afb('0x1f')](0x1f4,_['map'](_0x2404aa,_0x9afb('0x20'))[_0x9afb('0x17')](',\x20')));}var _0x597bc7=_['find'](_0x498463[_0x9afb('0x5e')],{'uniqueid':_0x347ce8[_0x9afb('0x62')]});if(_0x597bc7){return BPromise[_0x9afb('0x6e')]()[_0x9afb('0x1d')](function(){if(_0x597bc7[_0x9afb('0x63')]){return ami['Action']({'action':_0x9afb('0x6f'),'channel':_0x597bc7[_0x9afb('0x63')],'mixmonitorid':_0x347ce8[_0x9afb('0x6c')]})[_0x9afb('0x1e')](function(_0xcd741f){});}})[_0x9afb('0x1d')](function(){if(_0x597bc7[_0x9afb('0x70')]){return ami[_0x9afb('0x1c')]({'action':'StopMixMonitor','channel':_0x597bc7[_0x9afb('0x70')],'mixmonitorid':_0x347ce8['mixmonitorid']})[_0x9afb('0x1e')](function(_0x1ff543){});}})[_0x9afb('0x1d')](function(_0x22ffa){var _0x20b9d4=_['find'](_0x597bc7['monitors'],{'mixmonitorid':_0x347ce8[_0x9afb('0x6c')]});if(_0x20b9d4){_0x20b9d4[_0x9afb('0x6d')]=_0x9afb('0x71');}})[_0x9afb('0x1d')](function(){var _0x1ecbd1=util['format'](_0x9afb('0x64'),_0x347ce8[_0x9afb('0x65')]||_0x347ce8['uniqueid'],_0x347ce8[_0x9afb('0x9')]||_0x9afb('0x66'));var _0x480c4a=_[_0x9afb('0x5b')](_0x597bc7[_0x9afb('0x72')],{'filename':'/var/spool/asterisk/monitor/'+_0x1ecbd1[_0x9afb('0x69')]()});if(_0x480c4a){_0x480c4a['status']=_0x9afb('0x71');}})[_0x9afb('0x1d')](function(){_0x158dfd({'code':0xc8,'message':[_0x347ce8[_0x9afb('0x62')],_0x9afb('0x73')][_0x9afb('0x17')]('\x20')});})['catch'](function(_0x4be2a5){_0x41bb8e(_0x12b44e[_0x9afb('0x1f')](0x1f5,[_0x347ce8[_0x9afb('0x62')],_0x4be2a5[_0x9afb('0x20')]['toLowerCase']()][_0x9afb('0x17')]('\x20')));});}else{return _0x41bb8e(_0x12b44e[_0x9afb('0x1f')](0x1f5,_0x9afb('0x74')));}});},'VoiceQueuesChannels':function(_0x5357b4){return new Promise(function(_0x3c16a8,_0x1ee714){var _0x134716=_[_0x9afb('0x5d')](_0x498463[_0x9afb('0x75')]);_0x3c16a8({'count':_0x134716[_0x9afb('0x5f')],'rows':_0x134716});});},'VoiceQueuesChannel':function(_0x4f3a42){var _0x3084b3=this;return new Promise(function(_0x5b8b4a,_0x463df3){var _0x1f5a39=schema(properties[_0x9afb('0x76')])['validate'](_0x4f3a42);if(_0x1f5a39[_0x9afb('0x5f')]>0x0){return _0x463df3(_0x3084b3['error'](0x1f4,_[_0x9afb('0x61')](_0x1f5a39,_0x9afb('0x20'))['join'](',\x20')));}var _0x1a43bf=_[_0x9afb('0x5b')](_0x498463[_0x9afb('0x75')],{'uniqueid':_0x4f3a42[_0x9afb('0x62')]});if(_0x1a43bf){_0x5b8b4a(_0x1a43bf);}else{return _0x463df3(_0x3084b3['error'](0x1f5,_0x9afb('0x74')));}});},'VoiceQueuesChannelHangup':function(_0x2c8f29){var _0x3af5af=this;return new Promise(function(_0x1e3500,_0x1fa9cc){if(ami['isConnected']()==![]){return _0x1fa9cc(_0x3af5af[_0x9afb('0x1f')](0x1f4,[config[_0x9afb('0x14')]['ip'],config['asterisk'][_0x9afb('0x15')],_0x9afb('0x16')][_0x9afb('0x17')]('\x20')));}var _0x203e5e=schema(properties['voicequeuechannelhangup'])[_0x9afb('0x3')](_0x2c8f29);if(_0x203e5e[_0x9afb('0x5f')]>0x0){return _0x1fa9cc(_0x3af5af[_0x9afb('0x1f')](0x1f4,_[_0x9afb('0x61')](_0x203e5e,_0x9afb('0x20'))[_0x9afb('0x17')](',\x20')));}var _0x5a4596=_[_0x9afb('0x5b')](_0x498463['queueChannels'],{'uniqueid':_0x2c8f29[_0x9afb('0x62')]});if(_0x5a4596&&_0x5a4596[_0x9afb('0x63')]){return ami[_0x9afb('0x1c')]({'action':_0x9afb('0x77'),'channel':_0x5a4596[_0x9afb('0x63')]})[_0x9afb('0x1d')](function(_0x3db3bb){_0x1e3500({'code':0xc8,'message':[_0x2c8f29[_0x9afb('0x62')],_0x3db3bb['message'][_0x9afb('0x69')]()][_0x9afb('0x17')]('\x20')});})[_0x9afb('0x1e')](function(_0x34ae00){_0x1fa9cc(_0x3af5af[_0x9afb('0x1f')](0x1f5,[_0x2c8f29[_0x9afb('0x62')],_0x34ae00[_0x9afb('0x20')][_0x9afb('0x69')]()][_0x9afb('0x17')]('\x20')));});}else{return _0x1fa9cc(_0x3af5af['error'](0x1f5,_0x9afb('0x74')));}});},'VoiceQueuesChannelRedirect':function(_0x9be6f0){var _0x378462=this;return new Promise(function(_0x14a47f,_0x207180){if(ami[_0x9afb('0x21')]()==![]){return _0x207180(_0x378462['error'](0x1f4,[config[_0x9afb('0x14')]['ip'],config[_0x9afb('0x14')][_0x9afb('0x15')],_0x9afb('0x16')]['join']('\x20')));}var _0x372aed=schema(properties[_0x9afb('0x78')])[_0x9afb('0x3')](_0x9be6f0);if(_0x372aed[_0x9afb('0x5f')]>0x0){return _0x207180(_0x378462['error'](0x1f4,_[_0x9afb('0x61')](_0x372aed,'message')[_0x9afb('0x17')](',\x20')));}var _0x5d1d8e=_[_0x9afb('0x5b')](_0x498463[_0x9afb('0x75')],{'uniqueid':_0x9be6f0[_0x9afb('0x62')]});if(_0x5d1d8e&&_0x5d1d8e['channel']){return ami[_0x9afb('0x1c')]({'action':'Redirect','channel':_0x5d1d8e['channel'],'exten':_0x9be6f0[_0x9afb('0x79')],'context':_0x9be6f0['context']||_0x5d1d8e[_0x9afb('0x7a')],'priority':0x1})[_0x9afb('0x1d')](function(_0x5ce675){_0x14a47f({'code':0xc8,'message':[_0x9be6f0['uniqueid'],_0x5ce675[_0x9afb('0x20')][_0x9afb('0x69')]()]['join']('\x20')});})[_0x9afb('0x1e')](function(_0x29f1f2){_0x207180(_0x378462[_0x9afb('0x1f')](0x1f5,[_0x9be6f0['uniqueid'],_0x29f1f2['message'][_0x9afb('0x69')]()][_0x9afb('0x17')]('\x20')));});}else{return _0x207180(_0x378462[_0x9afb('0x1f')](0x1f5,_0x9afb('0x74')));}});},'Agents':function(_0x46ff4c){return new Promise(function(_0x2991d3,_0x19667d){var _0x369bfb=_[_0x9afb('0x5d')](_0x498463[_0x9afb('0x10')]);_0x2991d3({'count':_0x369bfb['length'],'rows':_0x369bfb});});},'Telephones':function(_0x3c0107){return new Promise(function(_0x14d0f5,_0x535977){var _0x29f047=_['values'](_0x498463[_0x9afb('0x7b')]);_0x14d0f5({'count':_0x29f047[_0x9afb('0x5f')],'rows':_0x29f047});});},'Trunks':function(_0x3ccba9){return new Promise(function(_0xb4a934,_0x538303){var _0x357f57=_['values'](_0x498463[_0x9afb('0x7c')]);_0xb4a934({'count':_0x357f57[_0x9afb('0x5f')],'rows':_0x357f57});});},'OutboundChannels':function(_0x267f7b){return new Promise(function(_0x9acaba,_0x2d6cf1){var _0x4e5467=_['values'](_0x498463[_0x9afb('0x7d')]);_0x9acaba({'count':_0x4e5467['length'],'rows':_0x4e5467});});},'Outbound':function(_0x3cc289){return new Promise(function(_0x2269cc,_0xa3b371){_0x2269cc(_0x498463[_0x9afb('0x30')]);});},'Campaigns':function(_0x4866bd){return new Promise(function(_0x3e5b87,_0x1222f9){var _0x3c96a2=_['values'](_0x498463[_0x9afb('0x7e')]);_0x3e5b87({'count':_0x3c96a2[_0x9afb('0x5f')],'rows':_0x3c96a2});});},'VoiceQueuesPreview':function(_0x24d635){var _0x53d995=this;return new Promise(function(_0x3ebfea,_0x44e3f7){_0x91ffa0['run'](_0x24d635['id'])['then'](function(_0x422edb){_0x3ebfea({'code':0xc8,'message':_0x422edb[_0x9afb('0x20')]});})[_0x9afb('0x1e')](function(_0x83e860){_0x44e3f7(_0x53d995['error'](0x1f4,_0x83e860[_0x9afb('0x20')]));});});},'EventManager':function(_0x120f44){var _0x24a00b=this;return new Promise(function(_0x19a30d,_0xf484b8){if(!_0x120f44[_0x9afb('0x7f')]){return _0xf484b8(_0x24a00b[_0x9afb('0x1f')](0x1f4,_0x9afb('0x80')));}ami['emit'](_0x9afb('0x81')+_0x120f44[_0x9afb('0x7f')],_0x120f44[_0x9afb('0x20')]);_0x19a30d({'code':0xc8,'message':_0x120f44});});},'FaxAccounts':function(_0x2c7a5b){return new Promise(function(_0x194263,_0x173e75){var _0x1faa74=_[_0x9afb('0x5d')](_0x498463['faxAccounts']);_0x194263({'count':_0x1faa74[_0x9afb('0x5f')],'rows':_0x1faa74});});},'SendFax':function(_0x5e5325){var _0xabe6c=this;return new Promise(function(_0x3c6761,_0x3fb617){_0x56a139[_0x9afb('0x82')](_0x5e5325)['then'](function(_0x8cabe2){_0x3c6761({'code':0xc8,'message':_0x8cabe2['message']});})[_0x9afb('0x1e')](function(_0x349fcd){_0x3fb617(_0xabe6c['error'](0x1f4,_0x349fcd[_0x9afb('0x20')]));});});},'CheckAfterSend':function(_0x1997fa){var _0x1c0150=this;return new Promise(function(_0x1cf4ed,_0x287583){_0x56a139[_0x9afb('0x83')](_0x1997fa)[_0x9afb('0x1d')](function(_0x3ba7d7){_0x1cf4ed({'code':0xc8,'message':_0x3ba7d7[_0x9afb('0x20')]});})[_0x9afb('0x1e')](function(_0x17fc1c){_0x287583(_0x1c0150[_0x9afb('0x1f')](0x1f4,_0x17fc1c[_0x9afb('0x20')]));});});}};var _0x376f63=jayson['server'](_0x556880)['http']();_0x376f63['on']('error',function(_0x23a5ad){return _0x548b24(_0x23a5ad);});_0x376f63['listen'](0x232a,'127.0.0.1',function(){console['log'](_0x9afb('0x84'),0x232a);return _0x1ccf93('RPC\x20listening\x20on\x20port:'+0x232a);});});}; \ No newline at end of file +var _0x36c3=['checkAfterSend','server','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','lodash','util','validate','bluebird','moment','../../../config/environment','../properties','../ami','listen','format','%s/%s','SIP','name','timers','timer','updateAcw','agents','updateStatusRealtime','pause','isConnected','error','asterisk','username','ami\x20disconnected','pick','module','Reload','then','message','command','action','Command','content','voiceQueues','hasOwnProperty','strategy','available','loggedIn','sumHoldTime','talking','abandoned','waiting','loggedInDb','type','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','temp','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','push','length','find','omit','undefined','values','channels','voicechannel','join','channel','%s.%s','uniqueid','/var/spool/asterisk/monitor/','toLowerCase','isNil','monitors','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','rec','MixMonitor\x20Success','catch','Channel\x20doesn\x27t\x20exist','map','resolve','Action','StopMixMonitor','destinationchannel','status','stop','queueChannels','voicequeuechannel','Hangup','voicequeuechannelredirect','Redirect','exten','context','telephones','trunks','outboundChannels','campaigns','event','Event\x20name\x20mandatory','custom:','faxAccounts','send'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x36c3,0x1a6));var _0x336c=function(_0x38baac,_0x2772b3){_0x38baac=_0x38baac-0x0;var _0x47baf1=_0x36c3[_0x38baac];return _0x47baf1;};'use strict';var _=require(_0x336c('0x0'));var util=require(_0x336c('0x1'));var jayson=require('jayson/promise');var schema=require(_0x336c('0x2'));var BPromise=require(_0x336c('0x3'));var moment=require(_0x336c('0x4'));var config=require(_0x336c('0x5'));var properties=require(_0x336c('0x6'));var ami=require(_0x336c('0x7'));exports[_0x336c('0x8')]=function(_0x4e4c07,_0x3b27e0,_0x2e0016){return new BPromise(function(_0x2097a8,_0x29a202){var _0x295b22={'QueuePause':function(_0x4d1e4f){return new Promise(function(_0x108bb0,_0x1e6f42){var _0x3b4f93=util[_0x336c('0x9')](_0x336c('0xa'),_0x336c('0xb'),_0x4d1e4f[_0x336c('0xc')]);if(_0x4e4c07[_0x336c('0xd')]&&_0x4e4c07[_0x336c('0xd')][_0x3b4f93]&&_0x4e4c07[_0x336c('0xd')][_0x3b4f93][_0x336c('0xe')]){_0x4e4c07[_0x336c('0xd')][_0x3b4f93][_0x336c('0xf')]();}if(_0x4e4c07[_0x336c('0x10')][_0x3b4f93]){_0x4e4c07[_0x336c('0x10')][_0x3b4f93][_0x336c('0x11')]({'statePause':_0x4d1e4f[_0x336c('0x12')]?!![]:![]});}_0x108bb0({'code':0xc8,'message':'QueuePause'});});},'Reload':function(_0x592a5b){var _0x1c3961=this;return new Promise(function(_0x577bd6,_0x10dba2){if(ami[_0x336c('0x13')]()==![]){return _0x10dba2(_0x1c3961[_0x336c('0x14')](0x1f4,[config[_0x336c('0x15')]['ip'],config['asterisk'][_0x336c('0x16')],_0x336c('0x17')]['join']('\x20')));}_0x592a5b=_[_0x336c('0x18')](_0x592a5b,_['keys'](properties[_0x336c('0x19')]));_0x592a5b['action']=_0x336c('0x1a');return ami['Action'](_0x592a5b)[_0x336c('0x1b')](function(_0x2c2b16){_0x577bd6({'code':0xc8,'message':_0x2c2b16['message']});})['catch'](function(_0x13db87){_0x10dba2(_0x1c3961[_0x336c('0x14')](0x1f5,_0x13db87[_0x336c('0x1c')]));});});},'Command':function(_0x221408){var _0x366182=this;return new Promise(function(_0x4fde93,_0x327e10){if(ami['isConnected']()==![]){return _0x327e10(_0x366182['error'](0x1f4,[config['asterisk']['ip'],config[_0x336c('0x15')][_0x336c('0x16')],_0x336c('0x17')]['join']('\x20')));}_0x221408=_['pick'](_0x221408,_0x336c('0x1d'));_0x221408[_0x336c('0x1e')]=_0x336c('0x1f');return ami['Action'](_0x221408)[_0x336c('0x1b')](function(_0x421929){_0x4fde93({'code':0xc8,'message':_0x421929[_0x336c('0x20')]});})['catch'](function(_0x473164){_0x327e10(_0x366182[_0x336c('0x14')](0x1f5,_0x473164[_0x336c('0x1c')]));});});},'VoiceQueues':function(_0xc46031){return new Promise(function(_0x4bd54c,_0x401660){var _0x9dc9bc=[];for(var _0x412a00 in _0x4e4c07[_0x336c('0x21')]){if(_0x4e4c07[_0x336c('0x21')][_0x336c('0x22')](_0x412a00)){var _0x567bfa=_0x4e4c07[_0x336c('0x21')][_0x412a00];var _0x3d2442={'id':_0x567bfa['id'],'name':_0x567bfa[_0x336c('0xc')],'strategy':_0x567bfa[_0x336c('0x23')],'answered':_0x567bfa['answered'],'available':_0x567bfa[_0x336c('0x24')],'loggedIn':_0x567bfa[_0x336c('0x25')],'pTalking':_0x567bfa['pTalking'],'sumBillable':_0x567bfa['sumBillable'],'sumDuration':_0x567bfa['sumDuration'],'sumHoldTime':_0x567bfa[_0x336c('0x26')]||0x0,'talking':_0x567bfa[_0x336c('0x27')],'total':_0x567bfa['total'],'type':_0x567bfa['type'],'unmanaged':_0x567bfa['unmanaged'],'abandoned':_0x567bfa[_0x336c('0x28')],'waiting':_0x567bfa[_0x336c('0x29')],'loggedInDb':_0x567bfa[_0x336c('0x2a')]};if(_0x567bfa[_0x336c('0x2b')]===_0x336c('0x2c')){_0x3d2442[_0x336c('0x2d')]=_0x567bfa[_0x336c('0x2d')];_0x3d2442['dialMethod']=_0x567bfa[_0x336c('0x2e')];_0x3d2442[_0x336c('0x2f')]=_0x567bfa[_0x336c('0x2f')];_0x3d2442[_0x336c('0x30')]=_0x567bfa['dialOriginateCallerIdNumber'];_0x3d2442[_0x336c('0x31')]=_0x567bfa[_0x336c('0x31')];_0x3d2442['dialPrefix']=_0x567bfa[_0x336c('0x32')];_0x3d2442[_0x336c('0x33')]=_0x567bfa['temp'];_0x3d2442[_0x336c('0x34')]=_0x567bfa[_0x336c('0x34')];_0x3d2442[_0x336c('0x35')]=_0x567bfa[_0x336c('0x35')];_0x3d2442[_0x336c('0x36')]=_0x567bfa[_0x336c('0x36')];_0x3d2442[_0x336c('0x37')]=_0x567bfa[_0x336c('0x37')];_0x3d2442['outboundCongestionCallsDay']=_0x567bfa[_0x336c('0x38')];_0x3d2442[_0x336c('0x39')]=_0x567bfa[_0x336c('0x39')];_0x3d2442[_0x336c('0x3a')]=_0x567bfa[_0x336c('0x3a')];_0x3d2442[_0x336c('0x3b')]=_0x567bfa[_0x336c('0x3b')];_0x3d2442[_0x336c('0x3c')]=_0x567bfa[_0x336c('0x3c')];_0x3d2442[_0x336c('0x3d')]=_0x567bfa['outboundNoSuchCallsDay'];_0x3d2442[_0x336c('0x3e')]=_0x567bfa[_0x336c('0x3e')];_0x3d2442[_0x336c('0x3f')]=_0x567bfa[_0x336c('0x3f')];_0x3d2442[_0x336c('0x40')]=_0x567bfa[_0x336c('0x40')];_0x3d2442[_0x336c('0x41')]=_0x567bfa[_0x336c('0x41')];_0x3d2442[_0x336c('0x42')]=_0x567bfa[_0x336c('0x42')];_0x3d2442['predictiveIntervalAvgHoldtime']=_0x567bfa[_0x336c('0x43')];_0x3d2442[_0x336c('0x44')]=_0x567bfa[_0x336c('0x44')];_0x3d2442['predictiveIntervalDroppedCallsCallersExit']=_0x567bfa[_0x336c('0x45')];_0x3d2442[_0x336c('0x46')]=_0x567bfa[_0x336c('0x46')];_0x3d2442[_0x336c('0x47')]=_0x567bfa['predictiveIntervalErlangCalls'];_0x3d2442[_0x336c('0x48')]=_0x567bfa[_0x336c('0x48')];_0x3d2442['predictiveIntervalHitRate']=_0x567bfa[_0x336c('0x49')];_0x3d2442[_0x336c('0x4a')]=_0x567bfa[_0x336c('0x4a')];_0x3d2442['predictiveIntervalPauses']=_0x567bfa[_0x336c('0x4b')];_0x3d2442[_0x336c('0x4c')]=_0x567bfa[_0x336c('0x4c')];_0x3d2442[_0x336c('0x4d')]=_0x567bfa[_0x336c('0x4d')];_0x3d2442[_0x336c('0x1c')]=_0x567bfa[_0x336c('0x1c')];_0x3d2442[_0x336c('0x4e')]=_0x567bfa[_0x336c('0x4e')];_0x3d2442[_0x336c('0x4f')]=_0x567bfa['erlangCalls'];_0x3d2442[_0x336c('0x50')]=_0x567bfa[_0x336c('0x50')];_0x3d2442[_0x336c('0x51')]=_0x567bfa['erlangAbandonmentRate'];_0x3d2442[_0x336c('0x52')]=_0x567bfa[_0x336c('0x52')];_0x3d2442['startPredictive']=_0x567bfa[_0x336c('0x53')];_0x3d2442[_0x336c('0x54')]=_0x567bfa[_0x336c('0x54')];}if(_0x567bfa[_0x336c('0x55')]){_0x3d2442['Trunk']={'id':_0x567bfa[_0x336c('0x55')]['id'],'name':_0x567bfa[_0x336c('0x55')]['name'],'active':_0x567bfa[_0x336c('0x55')][_0x336c('0x56')],'callerid':_0x567bfa['Trunk'][_0x336c('0x57')]};}if(_0x567bfa[_0x336c('0x58')]){_0x3d2442[_0x336c('0x58')]={'id':_0x567bfa[_0x336c('0x58')]['id'],'name':_0x567bfa['Interval'][_0x336c('0xc')]};}_0x9dc9bc[_0x336c('0x59')](_0x3d2442);}}_0x4bd54c({'count':_0x9dc9bc[_0x336c('0x5a')],'rows':_0x9dc9bc});});},'UpdateVoiceQueue':function(_0x222804){return new Promise(function(_0x1c2359,_0x3b68c4){var _0x11ff51=_[_0x336c('0x5b')](_0x4e4c07[_0x336c('0x21')],{'id':parseInt(_0x222804['id'])});var _0x4c27c6=_[_0x336c('0x5c')](_0x222804,['id']);if(_0x11ff51){for(var _0x46b61b in _0x4c27c6){if(typeof _0x4c27c6[_0x46b61b]!==_0x336c('0x5d')&&typeof _0x11ff51[_0x46b61b]!==_0x336c('0x5d')){_0x11ff51[_0x46b61b]=_0x4c27c6[_0x46b61b];}}_0x1c2359(_0x11ff51);}else{_0x3b68c4();}});},'VoiceChannels':function(_0x107b6f){return new Promise(function(_0x1f2f8f,_0x41e794){var _0xbfac47=_[_0x336c('0x5e')](_0x4e4c07[_0x336c('0x5f')]);_0x1f2f8f({'count':_0xbfac47[_0x336c('0x5a')],'rows':_0xbfac47});});},'VoiceChannelMixMonitor':function(_0x1aee22){var _0x3b5965=this;return new Promise(function(_0x58d26c,_0x26ea9e){if(ami['isConnected']()==![]){return _0x26ea9e(_0x3b5965['error'](0x1f4,[config[_0x336c('0x15')]['ip'],config['asterisk']['username'],_0x336c('0x17')]['join']('\x20')));}var _0x31f2bd=schema(properties[_0x336c('0x60')])[_0x336c('0x2')](_0x1aee22);if(_0x31f2bd[_0x336c('0x5a')]>0x0){return _0x26ea9e(_0x3b5965['error'](0x1f4,_['map'](_0x31f2bd,_0x336c('0x1c'))[_0x336c('0x61')](',\x20')));}var _0x4b70ba=_[_0x336c('0x5b')](_0x4e4c07[_0x336c('0x5f')],{'uniqueid':_0x1aee22['uniqueid']});if(_0x4b70ba&&_0x4b70ba[_0x336c('0x62')]){var _0x337ae7=util[_0x336c('0x9')](_0x336c('0x63'),_0x1aee22['filename']||_0x1aee22[_0x336c('0x64')],_0x1aee22[_0x336c('0x9')]||'wav');return ami['Action']({'action':'MixMonitor','channel':_0x4b70ba['channel'],'file':_0x337ae7,'options':'ai(mixmonitorid)'})[_0x336c('0x1b')](function(_0x31683b){var _0x265784=_[_0x336c('0x5b')](_0x4b70ba['monitors'],{'filename':_0x336c('0x65')+_0x337ae7[_0x336c('0x66')]()});if(_[_0x336c('0x67')](_0x265784)){_0x4b70ba[_0x336c('0x68')]['push']({'filename':_0x336c('0x65')+_0x337ae7['toLowerCase'](),'createdAt':moment()[_0x336c('0x9')](_0x336c('0x69')),'mixmonitorid':_0x31683b[_0x336c('0x6a')],'status':_0x336c('0x6b')});}else{_0x265784[_0x336c('0x6a')]=_0x31683b[_0x336c('0x6a')];_0x265784['status']='rec';}_0x58d26c({'code':0xc8,'message':[_0x1aee22[_0x336c('0x64')],_0x336c('0x6c'),_0x31683b['mixmonitorid']][_0x336c('0x61')]('\x20'),'mixmonitorid':_0x31683b[_0x336c('0x6a')]});})[_0x336c('0x6d')](function(_0x534f82){_0x26ea9e(_0x3b5965['error'](0x1f5,[_0x1aee22[_0x336c('0x64')],_0x534f82[_0x336c('0x1c')][_0x336c('0x66')]()][_0x336c('0x61')]('\x20')));});}else{return _0x26ea9e(_0x3b5965[_0x336c('0x14')](0x1f5,_0x336c('0x6e')));}});},'VoiceChannelStopMixMonitor':function(_0x4dae78){var _0xd1a98b=this;return new Promise(function(_0x442bfb,_0x45d69d){if(ami['isConnected']()==![]){return _0x45d69d(_0xd1a98b['error'](0x1f4,[config[_0x336c('0x15')]['ip'],config[_0x336c('0x15')][_0x336c('0x16')],_0x336c('0x17')][_0x336c('0x61')]('\x20')));}var _0x2842c3=schema(properties[_0x336c('0x60')])[_0x336c('0x2')](_0x4dae78);if(_0x2842c3[_0x336c('0x5a')]>0x0){return _0x45d69d(_0xd1a98b[_0x336c('0x14')](0x1f4,_[_0x336c('0x6f')](_0x2842c3,_0x336c('0x1c'))[_0x336c('0x61')](',\x20')));}var _0x54643d=_['find'](_0x4e4c07['channels'],{'uniqueid':_0x4dae78['uniqueid']});if(_0x54643d){return BPromise[_0x336c('0x70')]()[_0x336c('0x1b')](function(){if(_0x54643d['channel']){return ami[_0x336c('0x71')]({'action':_0x336c('0x72'),'channel':_0x54643d[_0x336c('0x62')],'mixmonitorid':_0x4dae78[_0x336c('0x6a')]})[_0x336c('0x6d')](function(_0x16b975){});}})['then'](function(){if(_0x54643d[_0x336c('0x73')]){return ami['Action']({'action':_0x336c('0x72'),'channel':_0x54643d[_0x336c('0x73')],'mixmonitorid':_0x4dae78[_0x336c('0x6a')]})['catch'](function(_0x145b5c){});}})[_0x336c('0x1b')](function(_0x579607){var _0x22ad33=_['find'](_0x54643d[_0x336c('0x68')],{'mixmonitorid':_0x4dae78[_0x336c('0x6a')]});if(_0x22ad33){_0x22ad33[_0x336c('0x74')]=_0x336c('0x75');}})[_0x336c('0x1b')](function(){var _0x147c47=util['format'](_0x336c('0x63'),_0x4dae78['filename']||_0x4dae78['uniqueid'],_0x4dae78['format']||'wav');var _0x49ec12=_['find'](_0x54643d[_0x336c('0x68')],{'filename':_0x336c('0x65')+_0x147c47[_0x336c('0x66')]()});if(_0x49ec12){_0x49ec12[_0x336c('0x74')]=_0x336c('0x75');}})[_0x336c('0x1b')](function(){_0x442bfb({'code':0xc8,'message':[_0x4dae78[_0x336c('0x64')],'StopMixMonitor\x20Success'][_0x336c('0x61')]('\x20')});})[_0x336c('0x6d')](function(_0x45428d){_0x45d69d(_0xd1a98b[_0x336c('0x14')](0x1f5,[_0x4dae78['uniqueid'],_0x45428d[_0x336c('0x1c')][_0x336c('0x66')]()][_0x336c('0x61')]('\x20')));});}else{return _0x45d69d(_0xd1a98b['error'](0x1f5,_0x336c('0x6e')));}});},'VoiceQueuesChannels':function(_0x23ca9d){return new Promise(function(_0x134d6f,_0x13f919){var _0x2332c6=_[_0x336c('0x5e')](_0x4e4c07[_0x336c('0x76')]);_0x134d6f({'count':_0x2332c6['length'],'rows':_0x2332c6});});},'VoiceQueuesChannel':function(_0x5908b9){var _0x1d3ab9=this;return new Promise(function(_0x413412,_0x35f7f2){var _0x8e1b7=schema(properties[_0x336c('0x77')])[_0x336c('0x2')](_0x5908b9);if(_0x8e1b7[_0x336c('0x5a')]>0x0){return _0x35f7f2(_0x1d3ab9[_0x336c('0x14')](0x1f4,_['map'](_0x8e1b7,_0x336c('0x1c'))[_0x336c('0x61')](',\x20')));}var _0x58eb23=_[_0x336c('0x5b')](_0x4e4c07[_0x336c('0x76')],{'uniqueid':_0x5908b9['uniqueid']});if(_0x58eb23){_0x413412(_0x58eb23);}else{return _0x35f7f2(_0x1d3ab9['error'](0x1f5,_0x336c('0x6e')));}});},'VoiceQueuesChannelHangup':function(_0x548c39){var _0x21241d=this;return new Promise(function(_0x10436f,_0x4e2776){if(ami[_0x336c('0x13')]()==![]){return _0x4e2776(_0x21241d[_0x336c('0x14')](0x1f4,[config[_0x336c('0x15')]['ip'],config[_0x336c('0x15')]['username'],_0x336c('0x17')][_0x336c('0x61')]('\x20')));}var _0x2e4785=schema(properties['voicequeuechannelhangup'])['validate'](_0x548c39);if(_0x2e4785['length']>0x0){return _0x4e2776(_0x21241d['error'](0x1f4,_['map'](_0x2e4785,_0x336c('0x1c'))['join'](',\x20')));}var _0x67330a=_['find'](_0x4e4c07['queueChannels'],{'uniqueid':_0x548c39[_0x336c('0x64')]});if(_0x67330a&&_0x67330a[_0x336c('0x62')]){return ami['Action']({'action':_0x336c('0x78'),'channel':_0x67330a['channel']})[_0x336c('0x1b')](function(_0x3e0fdf){_0x10436f({'code':0xc8,'message':[_0x548c39[_0x336c('0x64')],_0x3e0fdf[_0x336c('0x1c')][_0x336c('0x66')]()]['join']('\x20')});})[_0x336c('0x6d')](function(_0x45ec3a){_0x4e2776(_0x21241d[_0x336c('0x14')](0x1f5,[_0x548c39['uniqueid'],_0x45ec3a[_0x336c('0x1c')][_0x336c('0x66')]()][_0x336c('0x61')]('\x20')));});}else{return _0x4e2776(_0x21241d[_0x336c('0x14')](0x1f5,_0x336c('0x6e')));}});},'VoiceQueuesChannelRedirect':function(_0x3090a9){var _0x309604=this;return new Promise(function(_0x912ff4,_0x573512){if(ami[_0x336c('0x13')]()==![]){return _0x573512(_0x309604[_0x336c('0x14')](0x1f4,[config[_0x336c('0x15')]['ip'],config[_0x336c('0x15')]['username'],_0x336c('0x17')]['join']('\x20')));}var _0x752a4d=schema(properties[_0x336c('0x79')])[_0x336c('0x2')](_0x3090a9);if(_0x752a4d[_0x336c('0x5a')]>0x0){return _0x573512(_0x309604[_0x336c('0x14')](0x1f4,_[_0x336c('0x6f')](_0x752a4d,'message')[_0x336c('0x61')](',\x20')));}var _0x5221ce=_['find'](_0x4e4c07[_0x336c('0x76')],{'uniqueid':_0x3090a9[_0x336c('0x64')]});if(_0x5221ce&&_0x5221ce[_0x336c('0x62')]){return ami[_0x336c('0x71')]({'action':_0x336c('0x7a'),'channel':_0x5221ce[_0x336c('0x62')],'exten':_0x3090a9[_0x336c('0x7b')],'context':_0x3090a9[_0x336c('0x7c')]||_0x5221ce[_0x336c('0x7c')],'priority':0x1})[_0x336c('0x1b')](function(_0x4d930d){_0x912ff4({'code':0xc8,'message':[_0x3090a9[_0x336c('0x64')],_0x4d930d[_0x336c('0x1c')][_0x336c('0x66')]()][_0x336c('0x61')]('\x20')});})[_0x336c('0x6d')](function(_0xb158ca){_0x573512(_0x309604[_0x336c('0x14')](0x1f5,[_0x3090a9[_0x336c('0x64')],_0xb158ca[_0x336c('0x1c')]['toLowerCase']()][_0x336c('0x61')]('\x20')));});}else{return _0x573512(_0x309604[_0x336c('0x14')](0x1f5,_0x336c('0x6e')));}});},'Agents':function(_0x25ba0e){return new Promise(function(_0x3a85fd,_0x5f08a9){var _0xf82a02=_['values'](_0x4e4c07[_0x336c('0x10')]);_0x3a85fd({'count':_0xf82a02[_0x336c('0x5a')],'rows':_0xf82a02});});},'Telephones':function(_0x24c878){return new Promise(function(_0x49ebc7,_0x28e708){var _0x314fa0=_[_0x336c('0x5e')](_0x4e4c07[_0x336c('0x7d')]);_0x49ebc7({'count':_0x314fa0['length'],'rows':_0x314fa0});});},'Trunks':function(_0x1a47ba){return new Promise(function(_0x5b4540,_0x533c90){var _0x50ae9c=_['values'](_0x4e4c07[_0x336c('0x7e')]);_0x5b4540({'count':_0x50ae9c['length'],'rows':_0x50ae9c});});},'OutboundChannels':function(_0x52a554){return new Promise(function(_0xf46d71,_0x518e58){var _0x1280d5=_['values'](_0x4e4c07[_0x336c('0x7f')]);_0xf46d71({'count':_0x1280d5[_0x336c('0x5a')],'rows':_0x1280d5});});},'Outbound':function(_0x27a6fd){return new Promise(function(_0x17e944,_0x51d6e2){_0x17e944(_0x4e4c07[_0x336c('0x2c')]);});},'Campaigns':function(_0x57b686){return new Promise(function(_0x446702,_0x2c6a8f){var _0x3f33f=_[_0x336c('0x5e')](_0x4e4c07[_0x336c('0x80')]);_0x446702({'count':_0x3f33f['length'],'rows':_0x3f33f});});},'VoiceQueuesPreview':function(_0x336311){var _0x3fef9c=this;return new Promise(function(_0x33ce7d,_0xfa9158){_0x3b27e0['run'](_0x336311['id'])[_0x336c('0x1b')](function(_0x3024ad){_0x33ce7d({'code':0xc8,'message':_0x3024ad[_0x336c('0x1c')]});})[_0x336c('0x6d')](function(_0x533db0){_0xfa9158(_0x3fef9c[_0x336c('0x14')](0x1f4,_0x533db0[_0x336c('0x1c')]));});});},'EventManager':function(_0x3b4484){var _0xf247c5=this;return new Promise(function(_0x1ab058,_0x7aed56){if(!_0x3b4484[_0x336c('0x81')]){return _0x7aed56(_0xf247c5[_0x336c('0x14')](0x1f4,_0x336c('0x82')));}ami['emit'](_0x336c('0x83')+_0x3b4484[_0x336c('0x81')],_0x3b4484['message']);_0x1ab058({'code':0xc8,'message':_0x3b4484});});},'FaxAccounts':function(_0x25a1aa){return new Promise(function(_0x21ac11,_0xabd53f){var _0x22eae7=_[_0x336c('0x5e')](_0x4e4c07[_0x336c('0x84')]);_0x21ac11({'count':_0x22eae7[_0x336c('0x5a')],'rows':_0x22eae7});});},'SendFax':function(_0x31f9de){var _0x25b6c1=this;return new Promise(function(_0x469fae,_0x18b96d){_0x2e0016[_0x336c('0x85')](_0x31f9de)[_0x336c('0x1b')](function(_0xb21d9e){_0x469fae({'code':0xc8,'message':_0xb21d9e['message']});})[_0x336c('0x6d')](function(_0x142c3c){_0x18b96d(_0x25b6c1['error'](0x1f4,_0x142c3c[_0x336c('0x1c')]));});});},'CheckAfterSend':function(_0x2cce98){var _0x100188=this;return new Promise(function(_0x44e759,_0x16762a){_0x2e0016[_0x336c('0x86')](_0x2cce98)['then'](function(_0x1b150e){_0x44e759({'code':0xc8,'message':_0x1b150e[_0x336c('0x1c')]});})[_0x336c('0x6d')](function(_0x4a686f){_0x16762a(_0x100188['error'](0x1f4,_0x4a686f['message']));});});}};var _0x534cd3=jayson[_0x336c('0x87')](_0x295b22)['http']();_0x534cd3['on'](_0x336c('0x14'),function(_0x1c8a04){return _0x29a202(_0x1c8a04);});_0x534cd3[_0x336c('0x8')](0x232a,_0x336c('0x88'),function(){console[_0x336c('0x89')](_0x336c('0x8a'),0x232a);return _0x2097a8('RPC\x20listening\x20on\x20port:'+0x232a);});});}; \ No newline at end of file diff --git a/server/services/ami/trigger/cmContact/index.js b/server/services/ami/trigger/cmContact/index.js index 923e12c..6fab75f 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 _0x3be8=['merge','lodash','bluebird','ioredis','util','../../../../config/logger','trigger','../../rpc/cmContact','redis','defaults','socket.io-emitter','info','emit','exec','data2','xmd-contactid','data3','split','phone','destcalleridnum','lastName','mobile','ListId','scheduledAt','updatedAt','union','then','getContacts','length','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','join','[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','isNil','routeId','calleridnum','firstName','calleridname','','Unknown','destcalleridname','resolve','createContact','push','[CM][%s][%s]\x20Autocreate\x20disabled','format','user:%s','trigger:%s','action'];(function(_0x40ee8f,_0x54f7bf){var _0x363bb6=function(_0x3316e6){while(--_0x3316e6){_0x40ee8f['push'](_0x40ee8f['shift']());}};_0x363bb6(++_0x54f7bf);}(_0x3be8,0x105));var _0x83be=function(_0x48aaca,_0x140945){_0x48aaca=_0x48aaca-0x0;var _0xac5ed9=_0x3be8[_0x48aaca];return _0xac5ed9;};'use strict';var _=require(_0x83be('0x0'));var BPromise=require(_0x83be('0x1'));var Redis=require(_0x83be('0x2'));var util=require(_0x83be('0x3'));var config=require('../../../../config/environment');var logger=require(_0x83be('0x4'))(_0x83be('0x5'));var cmContactRpc=require(_0x83be('0x6'));config[_0x83be('0x7')]=_[_0x83be('0x8')](config[_0x83be('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x83be('0x9'))(new Redis(config[_0x83be('0x7')]));function emit(_0x2a451e,_0x4ccdec,_0x169a48,_0x345cbd,_0xd47685){logger[_0x83be('0xa')]('[CM][%s][%s]',_0x2a451e,_0x4ccdec['id'],_0x169a48,_0x345cbd,JSON['stringify'](_0xd47685));io['to'](_0x169a48)[_0x83be('0xb')](_0x345cbd,_0xd47685);}exports[_0x83be('0xc')]=function(_0x16276f,_0x347c3b,_0x37b77f,_0x678d7f){var _0x59d4f9,_0x3be99c;var _0x272a12={};var _0x597cda=Number(_0x37b77f['data1']);var _0x4f134a=_0x37b77f[_0x83be('0xd')]?Boolean(Number(_0x37b77f['data2'])):![];var _0x5dd865;if(_0x678d7f[_0x83be('0xe')]){_0x272a12['id']=_0x678d7f[_0x83be('0xe')];}if(!_0x272a12['id']){_0x272a12['ListId']=_0x597cda;_0x5dd865=_0x37b77f[_0x83be('0xf')]&&_0x37b77f[_0x83be('0xf')]!=='0'?_0x37b77f['data3'][_0x83be('0x10')](','):[_0x83be('0x11')];_0x272a12['$or']=_['map'](_0x5dd865,function(_0x5d977f){var _0x3492cb={};_0x3492cb[_0x5d977f]=_0x678d7f['routeId']?_0x678d7f[_0x83be('0x12')]:_0x678d7f['calleridnum'];return _0x3492cb;});}var _0x14a0db=['id','firstName',_0x83be('0x13'),'phone',_0x83be('0x14'),'fax',_0x83be('0x15'),'createdAt',_0x83be('0x16'),_0x83be('0x17')];var _0x2b5d9f=_[_0x83be('0x18')](_0x14a0db,_0x5dd865);BPromise['resolve']()[_0x83be('0x19')](cmContactRpc[_0x83be('0x1a')]({'attributes':_0x2b5d9f,'where':_0x272a12}))['then'](function(_0x34dbd1){_0x3be99c=_0x34dbd1;if(!_['isEmpty'](_0x3be99c)){if(_0x3be99c[_0x83be('0x1b')]===0x1){_0x59d4f9=_0x3be99c[0x0];logger['info'](_0x83be('0x1c'),_0x678d7f[_0x83be('0x1d')],_0x347c3b['id'],_0x59d4f9['id']);}else{logger[_0x83be('0xa')](_0x83be('0x1e'),_0x678d7f[_0x83be('0x1d')],_0x347c3b['id'],_['map'](_0x3be99c,'id')[_0x83be('0x1f')](','));}return;}else{logger[_0x83be('0xa')](_0x83be('0x20'),_0x678d7f[_0x83be('0x1d')],_0x347c3b['id']);var _0x27c1ae={'ListId':_0x597cda};var _0x89820c=_0x37b77f[_0x83be('0x21')]&&_0x37b77f[_0x83be('0x21')]!=='0'?_0x37b77f[_0x83be('0x21')]:_0x83be('0x11');if(_0x4f134a){logger[_0x83be('0xa')](_0x83be('0x22'),_0x678d7f[_0x83be('0x1d')],_0x347c3b['id']);_0x27c1ae[_0x89820c]=_[_0x83be('0x23')](_0x678d7f[_0x83be('0x24')])?_0x678d7f[_0x83be('0x25')]:_0x678d7f[_0x83be('0x12')];if(_[_0x83be('0x23')](_0x678d7f[_0x83be('0x24')])){_0x27c1ae[_0x83be('0x26')]=_0x678d7f[_0x83be('0x27')]&&_0x678d7f[_0x83be('0x27')]!==_0x83be('0x28')?_0x678d7f[_0x83be('0x27')]:_0x83be('0x29');}else{_0x27c1ae[_0x83be('0x26')]=_0x678d7f[_0x83be('0x2a')]&&_0x678d7f[_0x83be('0x2a')]!==_0x83be('0x28')?_0x678d7f[_0x83be('0x2a')]:'Unknown';}return BPromise[_0x83be('0x2b')]()[_0x83be('0x19')](cmContactRpc[_0x83be('0x2c')](_0x27c1ae))['then'](function(_0x3002ee){_0x59d4f9=_0x3002ee;_0x3be99c[_0x83be('0x2d')](_0x3002ee);if(_0x59d4f9){logger['info']('[CM][%s][%s]\x20Contact\x20created:%s',_0x678d7f[_0x83be('0x1d')],_0x347c3b['id'],_0x59d4f9['id']);}return;});}else{logger[_0x83be('0xa')](_0x83be('0x2e'),_0x678d7f[_0x83be('0x1d')],_0x347c3b['id']);_0x27c1ae[_0x89820c]=_[_0x83be('0x23')](_0x678d7f['routeId'])?_0x678d7f[_0x83be('0x25')]:_0x678d7f['destcalleridnum'];if(_['isNil'](_0x678d7f[_0x83be('0x24')])){_0x27c1ae[_0x83be('0x26')]=_0x678d7f[_0x83be('0x27')]&&_0x678d7f['calleridname']!==_0x83be('0x28')?_0x678d7f[_0x83be('0x27')]:_0x83be('0x29');}else{_0x27c1ae['firstName']=_0x678d7f['destcalleridname']&&_0x678d7f[_0x83be('0x2a')]!==_0x83be('0x28')?_0x678d7f['destcalleridname']:_0x83be('0x29');}_0x59d4f9=_0x27c1ae;_0x3be99c[_0x83be('0x2d')](_0x27c1ae);return;}}})['then'](function(){if(_0x16276f){emit(_0x678d7f[_0x83be('0x1d')],_0x347c3b,util[_0x83be('0x2f')](_0x83be('0x30'),_0x16276f['name']),util[_0x83be('0x2f')](_0x83be('0x31'),_0x37b77f[_0x83be('0x32')]['toLowerCase']()),{'evt':_[_0x83be('0x33')](_0x678d7f,{'autoCreate':_0x4f134a}),'contact':_0x59d4f9===undefined?{}:_0x59d4f9,'contacts':_0x3be99c[_0x83be('0x1b')]===0x0?undefined:_0x3be99c});}});}; \ No newline at end of file +var _0x95fd=['[CM][%s][%s]\x20Contact\x20not\x20found','data4','[CM][%s][%s]\x20Autocreate\x20enabled','isNil','firstName','calleridname','','Unknown','destcalleridname','resolve','push','[CM][%s][%s]\x20Contact\x20created:%s','[CM][%s][%s]\x20Autocreate\x20disabled','format','user:%s','name','trigger:%s','toLowerCase','merge','length','lodash','ioredis','util','../../../../config/environment','trigger','../../rpc/cmContact','redis','defaults','localhost','socket.io-emitter','info','[CM][%s][%s]','stringify','emit','exec','data1','data2','xmd-contactid','ListId','data3','split','$or','map','routeId','destcalleridnum','calleridnum','lastName','phone','mobile','fax','scheduledAt','updatedAt','union','then','getContacts','[CM][%s][%s]\x20Contact\x20found:%s','uniqueid','[CM][%s][%s]\x20Multiple\x20contacts\x20found:[%s]','join'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x95fd,0xc5));var _0xd95f=function(_0x559d8e,_0x1245fe){_0x559d8e=_0x559d8e-0x0;var _0x5d910b=_0x95fd[_0x559d8e];return _0x5d910b;};'use strict';var _=require(_0xd95f('0x0'));var BPromise=require('bluebird');var Redis=require(_0xd95f('0x1'));var util=require(_0xd95f('0x2'));var config=require(_0xd95f('0x3'));var logger=require('../../../../config/logger')(_0xd95f('0x4'));var cmContactRpc=require(_0xd95f('0x5'));config[_0xd95f('0x6')]=_[_0xd95f('0x7')](config[_0xd95f('0x6')],{'host':_0xd95f('0x8'),'port':0x18eb});var io=require(_0xd95f('0x9'))(new Redis(config[_0xd95f('0x6')]));function emit(_0x895574,_0x20b63d,_0x4df507,_0x56da44,_0x311f19){logger[_0xd95f('0xa')](_0xd95f('0xb'),_0x895574,_0x20b63d['id'],_0x4df507,_0x56da44,JSON[_0xd95f('0xc')](_0x311f19));io['to'](_0x4df507)[_0xd95f('0xd')](_0x56da44,_0x311f19);}exports[_0xd95f('0xe')]=function(_0x4fab2d,_0x4bb2f9,_0x2dc734,_0x17322d){var _0x40c48e,_0x33708d;var _0x2f3fcf={};var _0x241faf=Number(_0x2dc734[_0xd95f('0xf')]);var _0x3ff90e=_0x2dc734[_0xd95f('0x10')]?Boolean(Number(_0x2dc734['data2'])):![];var _0x4ee0ac;if(_0x17322d[_0xd95f('0x11')]){_0x2f3fcf['id']=_0x17322d[_0xd95f('0x11')];}if(!_0x2f3fcf['id']){_0x2f3fcf[_0xd95f('0x12')]=_0x241faf;_0x4ee0ac=_0x2dc734[_0xd95f('0x13')]&&_0x2dc734[_0xd95f('0x13')]!=='0'?_0x2dc734[_0xd95f('0x13')][_0xd95f('0x14')](','):['phone'];_0x2f3fcf[_0xd95f('0x15')]=_[_0xd95f('0x16')](_0x4ee0ac,function(_0x29d4a4){var _0x526665={};_0x526665[_0x29d4a4]=_0x17322d[_0xd95f('0x17')]?_0x17322d[_0xd95f('0x18')]:_0x17322d[_0xd95f('0x19')];return _0x526665;});}var _0x290a38=['id','firstName',_0xd95f('0x1a'),_0xd95f('0x1b'),_0xd95f('0x1c'),_0xd95f('0x1d'),'ListId','createdAt',_0xd95f('0x1e'),_0xd95f('0x1f')];var _0x23f3c8=_[_0xd95f('0x20')](_0x290a38,_0x4ee0ac);BPromise['resolve']()[_0xd95f('0x21')](cmContactRpc[_0xd95f('0x22')]({'attributes':_0x23f3c8,'where':_0x2f3fcf}))['then'](function(_0x58c587){_0x33708d=_0x58c587;if(!_['isEmpty'](_0x33708d)){if(_0x33708d['length']===0x1){_0x40c48e=_0x33708d[0x0];logger[_0xd95f('0xa')](_0xd95f('0x23'),_0x17322d[_0xd95f('0x24')],_0x4bb2f9['id'],_0x40c48e['id']);}else{logger['info'](_0xd95f('0x25'),_0x17322d[_0xd95f('0x24')],_0x4bb2f9['id'],_['map'](_0x33708d,'id')[_0xd95f('0x26')](','));}return;}else{logger[_0xd95f('0xa')](_0xd95f('0x27'),_0x17322d['uniqueid'],_0x4bb2f9['id']);var _0x47a7e1={'ListId':_0x241faf};var _0x41fafb=_0x2dc734['data4']&&_0x2dc734[_0xd95f('0x28')]!=='0'?_0x2dc734[_0xd95f('0x28')]:_0xd95f('0x1b');if(_0x3ff90e){logger[_0xd95f('0xa')](_0xd95f('0x29'),_0x17322d[_0xd95f('0x24')],_0x4bb2f9['id']);_0x47a7e1[_0x41fafb]=_['isNil'](_0x17322d[_0xd95f('0x17')])?_0x17322d[_0xd95f('0x19')]:_0x17322d['destcalleridnum'];if(_[_0xd95f('0x2a')](_0x17322d['routeId'])){_0x47a7e1[_0xd95f('0x2b')]=_0x17322d['calleridname']&&_0x17322d[_0xd95f('0x2c')]!==_0xd95f('0x2d')?_0x17322d['calleridname']:_0xd95f('0x2e');}else{_0x47a7e1['firstName']=_0x17322d[_0xd95f('0x2f')]&&_0x17322d[_0xd95f('0x2f')]!==_0xd95f('0x2d')?_0x17322d[_0xd95f('0x2f')]:'Unknown';}return BPromise[_0xd95f('0x30')]()[_0xd95f('0x21')](cmContactRpc['createContact'](_0x47a7e1))[_0xd95f('0x21')](function(_0x53ecb9){_0x40c48e=_0x53ecb9;_0x33708d[_0xd95f('0x31')](_0x53ecb9);if(_0x40c48e){logger[_0xd95f('0xa')](_0xd95f('0x32'),_0x17322d[_0xd95f('0x24')],_0x4bb2f9['id'],_0x40c48e['id']);}return;});}else{logger[_0xd95f('0xa')](_0xd95f('0x33'),_0x17322d[_0xd95f('0x24')],_0x4bb2f9['id']);_0x47a7e1[_0x41fafb]=_[_0xd95f('0x2a')](_0x17322d['routeId'])?_0x17322d[_0xd95f('0x19')]:_0x17322d[_0xd95f('0x18')];if(_[_0xd95f('0x2a')](_0x17322d[_0xd95f('0x17')])){_0x47a7e1[_0xd95f('0x2b')]=_0x17322d[_0xd95f('0x2c')]&&_0x17322d['calleridname']!==_0xd95f('0x2d')?_0x17322d[_0xd95f('0x2c')]:'Unknown';}else{_0x47a7e1[_0xd95f('0x2b')]=_0x17322d[_0xd95f('0x2f')]&&_0x17322d['destcalleridname']!==_0xd95f('0x2d')?_0x17322d[_0xd95f('0x2f')]:_0xd95f('0x2e');}_0x40c48e=_0x47a7e1;_0x33708d['push'](_0x47a7e1);return;}}})[_0xd95f('0x21')](function(){if(_0x4fab2d){emit(_0x17322d[_0xd95f('0x24')],_0x4bb2f9,util[_0xd95f('0x34')](_0xd95f('0x35'),_0x4fab2d[_0xd95f('0x36')]),util['format'](_0xd95f('0x37'),_0x2dc734['action'][_0xd95f('0x38')]()),{'evt':_[_0xd95f('0x39')](_0x17322d,{'autoCreate':_0x3ff90e}),'contact':_0x40c48e===undefined?{}:_0x40c48e,'contacts':_0x33708d[_0xd95f('0x3a')]===0x0?undefined:_0x33708d});}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index 09f53ce..e866591 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 _0xc2a0=['zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','bind','custom:agentconnect','syncCustomEvent','custom:agentnoanswer','custom:agentbusy','custom:amd','custom:queuecallerabandon','custom:dialbegin','syncAgentDial','custom:dialconnect','custom:dialend','custom:newinteraction','custom:closedinteraction','custom:outgoingmessage','prototype','emit','stringify','clone','motionChannel','voice','checkTriggers','interface','hasOwnProperty','status','checkTrigger','merge','variables','Actions','action','toLowerCase','contactmanager','motionbar','browser','data1','TemplateId','data2','html','template\x20not\x20found','uri','buildUri','isNil','data3','data4','location','uriLocation','windowWidth','data5','windowHeight','data6','winArguments','render','format','user:%s','name','trigger:%s:%s','jscripty','trigger:%s','exec','integration','queue','routeId','urlforward','parse','replace','channel','AllConditions','every','checkConditions','AnyConditions','account','chat','ChatWebsiteId','operator','value','upperFirst','AccountId','interaction','message','event','agent','membername','lastevent','util','lodash','url','mustache','ioredis','./cmContact','./script','trigger','../ami','defaults','redis','socket.io-emitter','popup','triggers','agents','voiceQueues','templates','voiceExtensions'];(function(_0x37ffea,_0x25b006){var _0x2e2615=function(_0x5e6c74){while(--_0x5e6c74){_0x37ffea['push'](_0x37ffea['shift']());}};_0x2e2615(++_0x25b006);}(_0xc2a0,0x1aa));var _0x0c2a=function(_0x547d89,_0x1176ed){_0x547d89=_0x547d89-0x0;var _0x453273=_0xc2a0[_0x547d89];return _0x453273;};'use strict';var util=require(_0x0c2a('0x0'));var _=require(_0x0c2a('0x1'));var url=require(_0x0c2a('0x2'));var Mustache=require(_0x0c2a('0x3'));var Redis=require(_0x0c2a('0x4'));var urlforward=require('./urlforward');var integration=require('./integration');var cmContact=require(_0x0c2a('0x5'));var script=require(_0x0c2a('0x6'));var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0x0c2a('0x7'));var ami=require(_0x0c2a('0x8'));config['redis']=_[_0x0c2a('0x9')](config[_0x0c2a('0xa')],{'host':'localhost','port':0x18eb});var io=require(_0x0c2a('0xb'))(new Redis(config[_0x0c2a('0xa')]));var operators={'equals':function(_0x571fb8,_0x5249b7){return _0x571fb8==_0x5249b7;},'not_equals':function(_0x302298,_0x4d9afc){return _0x302298!=_0x4d9afc;}};var barAndWebActions=[_0x0c2a('0xc'),'url','winapp'];function Trigger(_0x2251ac){this[_0x0c2a('0xd')]=_0x2251ac[_0x0c2a('0xd')];this[_0x0c2a('0xe')]=_0x2251ac['agents'];this[_0x0c2a('0xf')]=_0x2251ac[_0x0c2a('0xf')];this[_0x0c2a('0x10')]=_0x2251ac['templates'];this[_0x0c2a('0x11')]=_0x2251ac[_0x0c2a('0x11')];this['zendeskAccounts']=_0x2251ac[_0x0c2a('0x12')];this[_0x0c2a('0x13')]=_0x2251ac[_0x0c2a('0x13')];this[_0x0c2a('0x14')]=_0x2251ac[_0x0c2a('0x14')];this[_0x0c2a('0x15')]=_0x2251ac[_0x0c2a('0x15')];this[_0x0c2a('0x16')]=_0x2251ac[_0x0c2a('0x16')];this[_0x0c2a('0x17')]=_0x2251ac['deskAccounts'];this[_0x0c2a('0x18')]=_0x2251ac[_0x0c2a('0x18')];this[_0x0c2a('0x19')]=_0x2251ac[_0x0c2a('0x19')];this[_0x0c2a('0x1a')]=_0x2251ac[_0x0c2a('0x1a')];this[_0x0c2a('0x1b')]=_0x2251ac[_0x0c2a('0x1b')];this[_0x0c2a('0x1c')]={'zendesk':this['zendeskAccounts'],'salesforce':this[_0x0c2a('0x14')],'freshdesk':this['freshdeskAccounts'],'sugarcrm':this['sugarcrmAccounts'],'zoho':this[_0x0c2a('0x16')],'desk':this[_0x0c2a('0x17')],'vtiger':this[_0x0c2a('0x18')],'dynamics365':this['dynamics365Accounts'],'freshsales':this['freshsalesAccounts'],'servicenow':this[_0x0c2a('0x19')]};ami['on']('custom:agentcalled',this['syncCustomEvent'][_0x0c2a('0x1d')](this));ami['on'](_0x0c2a('0x1e'),this[_0x0c2a('0x1f')]['bind'](this));ami['on']('custom:agentringnoanswer',this[_0x0c2a('0x1f')][_0x0c2a('0x1d')](this));ami['on']('custom:agentcomplete',this[_0x0c2a('0x1f')][_0x0c2a('0x1d')](this));ami['on']('custom:agentnosuchnumber',this[_0x0c2a('0x1f')][_0x0c2a('0x1d')](this));ami['on'](_0x0c2a('0x20'),this[_0x0c2a('0x1f')][_0x0c2a('0x1d')](this));ami['on'](_0x0c2a('0x21'),this['syncCustomEvent'][_0x0c2a('0x1d')](this));ami['on']('custom:agentcongestion',this[_0x0c2a('0x1f')][_0x0c2a('0x1d')](this));ami['on']('custom:agentreject',this[_0x0c2a('0x1f')][_0x0c2a('0x1d')](this));ami['on'](_0x0c2a('0x22'),this[_0x0c2a('0x1f')]['bind'](this));ami['on'](_0x0c2a('0x23'),this[_0x0c2a('0x1f')][_0x0c2a('0x1d')](this));ami['on']('custom:timeout',this[_0x0c2a('0x1f')][_0x0c2a('0x1d')](this));ami['on'](_0x0c2a('0x24'),this[_0x0c2a('0x25')][_0x0c2a('0x1d')](this));ami['on'](_0x0c2a('0x26'),this[_0x0c2a('0x25')][_0x0c2a('0x1d')](this));ami['on'](_0x0c2a('0x27'),this[_0x0c2a('0x25')][_0x0c2a('0x1d')](this));ami['on'](_0x0c2a('0x28'),this[_0x0c2a('0x1f')][_0x0c2a('0x1d')](this));ami['on'](_0x0c2a('0x29'),this[_0x0c2a('0x1f')][_0x0c2a('0x1d')](this));ami['on']('custom:incomingmessage',this[_0x0c2a('0x1f')][_0x0c2a('0x1d')](this));ami['on'](_0x0c2a('0x2a'),this['syncCustomEvent']['bind'](this));ami['on']('custom:acceptmessage',this['syncCustomEvent'][_0x0c2a('0x1d')](this));ami['on']('custom:rejectmessage',this[_0x0c2a('0x1f')]['bind'](this));}Trigger[_0x0c2a('0x2b')][_0x0c2a('0x2c')]=function(_0xf9f2f4,_0xb8ff70,_0x1c9e8e){logger['info'](_0xf9f2f4,_0xb8ff70,JSON[_0x0c2a('0x2d')](_0x1c9e8e));io['to'](_0xf9f2f4)['emit'](_0xb8ff70,_0x1c9e8e);};Trigger['prototype']['syncCustomEvent']=function(_0x542a31){var _0x89b5d2=_[_0x0c2a('0x2e')](_0x542a31);if(typeof _0x89b5d2[_0x0c2a('0x2f')]==='undefined'){_0x89b5d2[_0x0c2a('0x2f')]=_0x0c2a('0x30');}this[_0x0c2a('0x31')](_0x89b5d2);};Trigger[_0x0c2a('0x2b')][_0x0c2a('0x25')]=function(_0x5f3c15){if(this[_0x0c2a('0xe')][_0x5f3c15[_0x0c2a('0x32')]]){this['syncCustomEvent'](_0x5f3c15);}};Trigger[_0x0c2a('0x2b')][_0x0c2a('0x31')]=function(_0x1eb5e6){var _0x3bd5bd;for(var _0x436103 in this[_0x0c2a('0xd')]){if(this[_0x0c2a('0xd')][_0x0c2a('0x33')](_0x436103)){if(this[_0x0c2a('0xd')][_0x436103][_0x0c2a('0x34')]){_0x3bd5bd=this[_0x0c2a('0x35')](this['triggers'][_0x436103],_0x1eb5e6);if(_0x3bd5bd){_[_0x0c2a('0x36')](_0x1eb5e6,_0x1eb5e6[_0x0c2a('0x37')]);for(var _0x568e2c=0x0,_0x1c60d5,_0x3f8e0f,_0x17e37d;_0x568e2c0x0){_0x53c904=_[_0x7721('0x2a')](_0x315202,_0x343c19);}return _0x53c904;}function getCustomFields(_0x37b9f0,_0xd7d703){var _0x1da2d8=[];var _0x5c54f0={'custom_fields':{}};if(_0x37b9f0[_0x7721('0x29')]>0x0){_[_0x7721('0x2b')](_0x37b9f0,function(_0x497f9f){if(_['includes']([_0x7721('0x2c'),_0x7721('0x2d')],_0x497f9f['type'])&&_0x497f9f[_0x7721('0x2e')]&&!_0x497f9f[_0x7721('0x2f')]){_0x5c54f0[_0x497f9f[_0x7721('0x2e')]['toLowerCase']()]=_0x497f9f[_0x7721('0x30')][_0x7721('0x31')]();}else if(_[_0x7721('0x32')]([_0x7721('0x2c'),_0x7721('0x2d')],_0x497f9f['type'])&&_0x497f9f[_0x7721('0x33')]&&_0x497f9f[_0x7721('0x2f')]){_0x5c54f0[_0x7721('0x34')][_0x497f9f['idField']]=_0x497f9f[_0x7721('0x30')][_0x7721('0x31')]();}else if(_0x497f9f['type']===_0x7721('0x35')&&_0x497f9f['variableName']&&_0x497f9f[_0x7721('0x33')]&&_0x497f9f[_0x7721('0x2f')]){_0xd7d703[_0x497f9f[_0x7721('0x36')]]&&(_0x5c54f0[_0x7721('0x34')][_0x497f9f[_0x7721('0x33')]]=_0xd7d703[_0x497f9f[_0x7721('0x36')]][_0x7721('0x31')]());}else if(_0x497f9f[_0x7721('0x37')]===_0x7721('0x38')&&_0x497f9f[_0x7721('0x39')]&&_0x497f9f[_0x7721('0x39')]['name']&&_0x497f9f[_0x7721('0x33')]&&_0x497f9f['customField']){_0xd7d703[_0x497f9f[_0x7721('0x39')][_0x7721('0x3a')][_0x7721('0x3b')]()]&&(_0x5c54f0[_0x7721('0x34')][_0x497f9f[_0x7721('0x33')]]=_0xd7d703[_0x497f9f[_0x7721('0x39')]['name']['toLowerCase']()]['toString']());}});}if(_0x5c54f0['priority']){_0x5c54f0[_0x7721('0x3c')]=Number(_0x5c54f0[_0x7721('0x3c')]);}return _0x5c54f0;}function getTicket(_0x1acc72,_0x22ef35,_0x4a90ce,_0xa389fa,_0x4cf659){logger[_0x7721('0x15')](_0x7721('0x3d'));var _0x5a278e=_[_0x7721('0x3e')]({'subject':intUtil[_0x7721('0x3f')](_0xa389fa['Subjects'],_0x4cf659,'\x20'),'type':'phone','status':_0x7721('0x40'),'labels':[_0x7721('0x41'),_0x7721('0x42'),_0x7721('0x43')]['concat'](getTags(_0xa389fa[_0x7721('0x44')],_0x7721('0x3a'))),'description':intUtil[_0x7721('0x3f')](_0xa389fa[_0x7721('0x45')],_0x4cf659,'\x0a'),'_links':{'assigned_user':{'href':util[_0x7721('0xe')]('/api/v2/users/%d',_0x22ef35['id']),'class':_0x7721('0x46')}},'message':{'direction':'in','body':intUtil['getString'](_0xa389fa[_0x7721('0x45')],_0x4cf659,'\x0a')}},getCustomFields(_0xa389fa['Fields'],_0x4cf659));return request({'uri':util[_0x7721('0xe')](_0x7721('0x47'),_0x1acc72[_0x7721('0x10')],_0x4a90ce['id']),'method':'POST','body':_0x5a278e});}exports[_0x7721('0x48')]=function(_0x11d853,_0x1ad315,_0x481fa8,_0x9f7b1d,_0x754071,_0xdb3033){var _0x2d5f35,_0x135dbc;_0xdb3033[_0x7721('0x10')]=intUtil[_0x7721('0x49')](_0xdb3033['remoteUri']);_0xdb3033['serverUrl']=intUtil[_0x7721('0x49')](_0xdb3033[_0x7721('0x4a')]);if(_0x754071&&_0x754071[_0x7721('0x4b')]){logger[_0x7721('0x15')](_0x7721('0x4c'),_0x7721('0x4d'));_0x1ad315[_0x7721('0x4e')]=util[_0x7721('0xe')](_0x7721('0x4f'),_0xdb3033[_0x7721('0x4a')],_0x1ad315['uniqueid'],md5(_0x1ad315['uniqueid']));}else{_0x1ad315[_0x7721('0x4e')]='';}headers[_0x7721('0x50')]=getAuth(_0xdb3033);return getUser(_0xdb3033,_0x9f7b1d[_0x7721('0x51')])[_0x7721('0x11')](function(_0x589e95){_0x2d5f35=_0x589e95;logger[_0x7721('0x15')](_0x7721('0x52'),_0x2d5f35['id']);return getEndUser(_0xdb3033,_0x1ad315['calleridname'],_0x1ad315[_0x7721('0x53')]);})['then'](function(_0x2682b1){_0x135dbc=_0x2682b1;logger['info'](_0x7721('0x54'),_0x135dbc['id']);return getTicket(_0xdb3033,_0x2d5f35,_0x135dbc,_0x481fa8,_0x1ad315);})[_0x7721('0x11')](function(_0xf17c40){if(_0xf17c40){logger['info'](_0x7721('0x55'));logger[_0x7721('0x15')]('The\x20Ticket\x20ID\x20is:',_0xf17c40['id']);switch(_0xdb3033[_0x7721('0x37')]){case _0x7721('0x56'):logger[_0x7721('0x15')]('[QUEUE]',_0x7721('0x57'));emit(util['format'](_0x7721('0x58'),_0x9f7b1d[_0x7721('0x3a')]),_0x7721('0x59'),{'recordId':_0xf17c40['id']});break;case _0x7721('0x5a'):logger[_0x7721('0x15')](_0x7721('0x4c'),_0x7721('0x5b'));emit(util[_0x7721('0xe')](_0x7721('0x58'),_0x9f7b1d[_0x7721('0x3a')]),_0x7721('0x5c'),{'uri':util[_0x7721('0xe')](_0x7721('0x5d'),_0xf17c40['id'])});break;default:logger[_0x7721('0x5e')](_0x7721('0x4c'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0x7721('0x5f')](function(_0x2f6f30){console[_0x7721('0x5e')](_0x2f6f30);logger[_0x7721('0x5e')](_0x7721('0x4c'),JSON[_0x7721('0x1a')](_0x2f6f30));});};exports[_0x7721('0x60')]=function(_0x57484c,_0x234bee,_0x17036e,_0x134908,_0x3b7382,_0x1f1e84,_0x9c0d4){var _0x7fbd6c,_0x33287d;_0x1f1e84[_0x7721('0x10')]=intUtil[_0x7721('0x49')](_0x1f1e84[_0x7721('0x10')]);_0x1f1e84['serverUrl']=intUtil[_0x7721('0x49')](_0x1f1e84[_0x7721('0x4a')]);if(_0x9c0d4&&_0x9c0d4[_0x7721('0x61')]&&_0x9c0d4[_0x7721('0x61')]!==_0x7721('0x62')){logger[_0x7721('0x15')](_0x7721('0x63'),_0x7721('0x4d'));_0x234bee[_0x7721('0x4e')]=util[_0x7721('0xe')](_0x7721('0x4f'),_0x1f1e84[_0x7721('0x4a')],_0x234bee[_0x7721('0x64')],md5(_0x234bee[_0x7721('0x64')]));}headers[_0x7721('0x50')]=getAuth(_0x1f1e84);return getUser(_0x1f1e84,_0x134908['email'])['then'](function(_0x4e112e){_0x7fbd6c=_0x4e112e;logger[_0x7721('0x15')]('The\x20User\x20ID\x20is:',_0x7fbd6c['id']);return getEndUser(_0x1f1e84,_0x234bee['destcalleridname'],_0x234bee['destcalleridnum']);})['then'](function(_0x47925a){_0x33287d=_0x47925a;logger[_0x7721('0x15')](_0x7721('0x54'),_0x33287d['id']);return getTicket(_0x1f1e84,_0x7fbd6c,_0x33287d,_0x17036e,_0x234bee);})['then'](function(_0x5181d7){if(_0x5181d7){logger['info']('Ticket\x20created!');logger['info'](_0x7721('0x65'),_0x5181d7['id']);switch(_0x1f1e84['type']){case'integrationTab':logger['info'](_0x7721('0x4c'),_0x7721('0x57'));emit(util[_0x7721('0xe')]('user:%s',_0x134908[_0x7721('0x3a')]),_0x7721('0x59'),{'recordId':_0x5181d7['id']});break;case _0x7721('0x5a'):logger[_0x7721('0x15')](_0x7721('0x4c'),_0x7721('0x5b'));emit(util[_0x7721('0xe')](_0x7721('0x58'),_0x134908[_0x7721('0x3a')]),_0x7721('0x5c'),{'uri':util[_0x7721('0xe')](_0x7721('0x66'),_0x1f1e84[_0x7721('0x10')],_0x5181d7['id'])});break;default:logger[_0x7721('0x5e')](_0x7721('0x63'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0x7721('0x5f')](function(_0x2c93b0){logger[_0x7721('0x5e')](_0x7721('0x63'),JSON['stringify'](_0x2c93b0));});};exports[_0x7721('0x67')]=function(_0x104f05,_0x4c8284,_0x3e7df3,_0x5d37ad,_0x1f508d,_0x4bfb48){var _0x36a3a6,_0x3f9eaa;_0x4bfb48[_0x7721('0x10')]=intUtil[_0x7721('0x49')](_0x4bfb48[_0x7721('0x10')]);_0x4bfb48[_0x7721('0x4a')]=intUtil[_0x7721('0x49')](_0x4bfb48['serverUrl']);if(_0x1f508d&&_0x1f508d[_0x7721('0x4b')]){logger[_0x7721('0x15')]('['+_0x4c8284[_0x7721('0x68')][_0x7721('0x69')]()+']',_0x7721('0x4d'));_0x4c8284[_0x7721('0x4e')]=util[_0x7721('0xe')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4bfb48[_0x7721('0x4a')],_0x4c8284[_0x7721('0x64')],md5(_0x4c8284['uniqueid']));}else{_0x4c8284[_0x7721('0x4e')]='';}headers['Authorization']=getAuth(_0x4bfb48);return getUser(_0x4bfb48)[_0x7721('0x11')](function(_0x382800){_0x36a3a6=_0x382800;logger[_0x7721('0x15')](_0x7721('0x52'),_0x36a3a6['id']);return getEndUser(_0x4bfb48,_0x4c8284[_0x7721('0x6a')],_0x4c8284[_0x7721('0x53')]);})[_0x7721('0x11')](function(_0x5dca04){_0x3f9eaa=_0x5dca04;logger[_0x7721('0x15')](_0x7721('0x54'),_0x3f9eaa['id']);return getTicket(_0x4bfb48,_0x36a3a6,_0x3f9eaa,_0x3e7df3,_0x4c8284);})[_0x7721('0x11')](function(_0x5f08cc){if(_0x5f08cc){logger['info']('Ticket\x20created!');logger['info']('The\x20Ticket\x20ID\x20is:',_0x5f08cc['id']);}})[_0x7721('0x5f')](function(_0x2645dd){logger['error']('['+_0x4c8284[_0x7721('0x68')][_0x7721('0x69')]()+']',JSON[_0x7721('0x1a')](_0x2645dd));});}; \ No newline at end of file +var _0x7217=['format','%s/users','remoteUri','then','total_entries','find','entries','info','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me','debug','stringify','GET','authType','basic','%s:%s','username','password','token','Basic\x20%s','base64','Searching\x20enduser\x20with\x20phone','%s/customers/search','Enduser\x20found!','_embedded','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','length','map','forEach','string','picklist','nameField','customField','content','toString','includes','idField','custom_fields','variable','variableName','type','customVariable','Variable','name','toLowerCase','priority','Creating\x20new\x20ticket...','merge','getString','new','xCALLY','Motion','CTI','Tags','Descriptions','user','%s/customers/%d/cases','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','Authorization','email','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','integrationTab','Displaying\x20ticket\x20to\x20agent...','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','error','catch','outbound','recordingFormat','none','[OUTBOUND]','uniqueid','The\x20Ticket\x20ID\x20is:','%s/agent/tickets/%s','unmanaged','lastevent','toUpperCase','calleridname','lodash','md5','util','ioredis','./util','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','emit','application/json','validateEmail','Getting\x20agent\x20with\x20email'];(function(_0x5739ca,_0xb990bc){var _0x390ec9=function(_0x451577){while(--_0x451577){_0x5739ca['push'](_0x5739ca['shift']());}};_0x390ec9(++_0xb990bc);}(_0x7217,0x19e));var _0x7721=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0x7217[_0x173d7e];return _0x2220d6;};'use strict';var _=require(_0x7721('0x0'));var rp=require('request-promise');var md5=require(_0x7721('0x1'));var util=require(_0x7721('0x2'));var Redis=require(_0x7721('0x3'));var intUtil=require(_0x7721('0x4'));var config=require(_0x7721('0x5'));var logger=require('../../../../config/logger')('desk');config[_0x7721('0x6')]=_[_0x7721('0x7')](config[_0x7721('0x6')],{'host':_0x7721('0x8'),'port':0x18eb});var io=require(_0x7721('0x9'))(new Redis(config[_0x7721('0x6')]));function emit(_0x18ab6b,_0x21f680,_0x225610){io['to'](_0x18ab6b)[_0x7721('0xa')](_0x21f680,_0x225610);}var headers={'Content-Type':_0x7721('0xb'),'Accept':_0x7721('0xb')};function getUser(_0xfa8835,_0x138740){if(intUtil[_0x7721('0xc')](_0x138740)===!![]){logger['info'](_0x7721('0xd'),_0x138740);return request({'uri':util[_0x7721('0xe')](_0x7721('0xf'),_0xfa8835[_0x7721('0x10')])})[_0x7721('0x11')](function(_0x409b37){if(_0x409b37[_0x7721('0x12')]){return _[_0x7721('0x13')](_0x409b37['_embedded'][_0x7721('0x14')],{'email':_0x138740});}})[_0x7721('0x11')](function(_0x57ff6d){if(_0x57ff6d){logger[_0x7721('0x15')](_0x7721('0x16'));return _0x57ff6d;}else{logger[_0x7721('0x15')](_0x7721('0x17'));return request({'uri':util['format'](_0x7721('0x18'),_0xfa8835[_0x7721('0x10')])});}});}else{logger['info']('Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format'](_0x7721('0x18'),_0xfa8835[_0x7721('0x10')])});}}function request(_0x3cc909){logger[_0x7721('0x19')]('[HTTP]',JSON[_0x7721('0x1a')](_0x3cc909));return rp(_['defaults'](_0x3cc909,{'method':_0x7721('0x1b'),'headers':headers,'json':!![]}));}function getAuth(_0x5cb0e6){var _0xfec626;if(_0x5cb0e6[_0x7721('0x1c')]===_0x7721('0x1d')){_0xfec626=util[_0x7721('0xe')](_0x7721('0x1e'),_0x5cb0e6[_0x7721('0x1f')],_0x5cb0e6[_0x7721('0x20')]);}else if(_0x5cb0e6[_0x7721('0x1c')]===_0x7721('0x21')){_0xfec626=util[_0x7721('0xe')]('%s/token:%s',_0x5cb0e6[_0x7721('0x1f')],_0x5cb0e6[_0x7721('0x21')]);}return util[_0x7721('0xe')](_0x7721('0x22'),new Buffer(_0xfec626)['toString'](_0x7721('0x23')));}function getEndUser(_0x512f31,_0xb9e9dd,_0x288e3a){logger[_0x7721('0x15')](_0x7721('0x24'),_0x288e3a);return request({'uri':util[_0x7721('0xe')](_0x7721('0x25'),_0x512f31[_0x7721('0x10')]),'qs':{'phone':_0x288e3a}})['then'](function(_0x216f20){if(_0x216f20[_0x7721('0x12')]){logger[_0x7721('0x15')](_0x7721('0x26'));return _0x216f20[_0x7721('0x27')][_0x7721('0x14')][0x0];}else{logger[_0x7721('0x15')](_0x7721('0x28'));return request({'uri':util[_0x7721('0xe')]('%s/customers',_0x512f31[_0x7721('0x10')]),'method':'POST','body':{'first_name':_0xb9e9dd,'title':_0xb9e9dd,'phone_numbers':[{'type':'work','value':_0x288e3a}]}});}});}function getTags(_0x315202,_0x343c19){var _0x53c904=[];if(_0x315202&&_0x315202[_0x7721('0x29')]>0x0){_0x53c904=_[_0x7721('0x2a')](_0x315202,_0x343c19);}return _0x53c904;}function getCustomFields(_0x37b9f0,_0xd7d703){var _0x1da2d8=[];var _0x5c54f0={'custom_fields':{}};if(_0x37b9f0[_0x7721('0x29')]>0x0){_[_0x7721('0x2b')](_0x37b9f0,function(_0x497f9f){if(_['includes']([_0x7721('0x2c'),_0x7721('0x2d')],_0x497f9f['type'])&&_0x497f9f[_0x7721('0x2e')]&&!_0x497f9f[_0x7721('0x2f')]){_0x5c54f0[_0x497f9f[_0x7721('0x2e')]['toLowerCase']()]=_0x497f9f[_0x7721('0x30')][_0x7721('0x31')]();}else if(_[_0x7721('0x32')]([_0x7721('0x2c'),_0x7721('0x2d')],_0x497f9f['type'])&&_0x497f9f[_0x7721('0x33')]&&_0x497f9f[_0x7721('0x2f')]){_0x5c54f0[_0x7721('0x34')][_0x497f9f['idField']]=_0x497f9f[_0x7721('0x30')][_0x7721('0x31')]();}else if(_0x497f9f['type']===_0x7721('0x35')&&_0x497f9f['variableName']&&_0x497f9f[_0x7721('0x33')]&&_0x497f9f[_0x7721('0x2f')]){_0xd7d703[_0x497f9f[_0x7721('0x36')]]&&(_0x5c54f0[_0x7721('0x34')][_0x497f9f[_0x7721('0x33')]]=_0xd7d703[_0x497f9f[_0x7721('0x36')]][_0x7721('0x31')]());}else if(_0x497f9f[_0x7721('0x37')]===_0x7721('0x38')&&_0x497f9f[_0x7721('0x39')]&&_0x497f9f[_0x7721('0x39')]['name']&&_0x497f9f[_0x7721('0x33')]&&_0x497f9f['customField']){_0xd7d703[_0x497f9f[_0x7721('0x39')][_0x7721('0x3a')][_0x7721('0x3b')]()]&&(_0x5c54f0[_0x7721('0x34')][_0x497f9f[_0x7721('0x33')]]=_0xd7d703[_0x497f9f[_0x7721('0x39')]['name']['toLowerCase']()]['toString']());}});}if(_0x5c54f0['priority']){_0x5c54f0[_0x7721('0x3c')]=Number(_0x5c54f0[_0x7721('0x3c')]);}return _0x5c54f0;}function getTicket(_0x1acc72,_0x22ef35,_0x4a90ce,_0xa389fa,_0x4cf659){logger[_0x7721('0x15')](_0x7721('0x3d'));var _0x5a278e=_[_0x7721('0x3e')]({'subject':intUtil[_0x7721('0x3f')](_0xa389fa['Subjects'],_0x4cf659,'\x20'),'type':'phone','status':_0x7721('0x40'),'labels':[_0x7721('0x41'),_0x7721('0x42'),_0x7721('0x43')]['concat'](getTags(_0xa389fa[_0x7721('0x44')],_0x7721('0x3a'))),'description':intUtil[_0x7721('0x3f')](_0xa389fa[_0x7721('0x45')],_0x4cf659,'\x0a'),'_links':{'assigned_user':{'href':util[_0x7721('0xe')]('/api/v2/users/%d',_0x22ef35['id']),'class':_0x7721('0x46')}},'message':{'direction':'in','body':intUtil['getString'](_0xa389fa[_0x7721('0x45')],_0x4cf659,'\x0a')}},getCustomFields(_0xa389fa['Fields'],_0x4cf659));return request({'uri':util[_0x7721('0xe')](_0x7721('0x47'),_0x1acc72[_0x7721('0x10')],_0x4a90ce['id']),'method':'POST','body':_0x5a278e});}exports[_0x7721('0x48')]=function(_0x11d853,_0x1ad315,_0x481fa8,_0x9f7b1d,_0x754071,_0xdb3033){var _0x2d5f35,_0x135dbc;_0xdb3033[_0x7721('0x10')]=intUtil[_0x7721('0x49')](_0xdb3033['remoteUri']);_0xdb3033['serverUrl']=intUtil[_0x7721('0x49')](_0xdb3033[_0x7721('0x4a')]);if(_0x754071&&_0x754071[_0x7721('0x4b')]){logger[_0x7721('0x15')](_0x7721('0x4c'),_0x7721('0x4d'));_0x1ad315[_0x7721('0x4e')]=util[_0x7721('0xe')](_0x7721('0x4f'),_0xdb3033[_0x7721('0x4a')],_0x1ad315['uniqueid'],md5(_0x1ad315['uniqueid']));}else{_0x1ad315[_0x7721('0x4e')]='';}headers[_0x7721('0x50')]=getAuth(_0xdb3033);return getUser(_0xdb3033,_0x9f7b1d[_0x7721('0x51')])[_0x7721('0x11')](function(_0x589e95){_0x2d5f35=_0x589e95;logger[_0x7721('0x15')](_0x7721('0x52'),_0x2d5f35['id']);return getEndUser(_0xdb3033,_0x1ad315['calleridname'],_0x1ad315[_0x7721('0x53')]);})['then'](function(_0x2682b1){_0x135dbc=_0x2682b1;logger['info'](_0x7721('0x54'),_0x135dbc['id']);return getTicket(_0xdb3033,_0x2d5f35,_0x135dbc,_0x481fa8,_0x1ad315);})[_0x7721('0x11')](function(_0xf17c40){if(_0xf17c40){logger['info'](_0x7721('0x55'));logger[_0x7721('0x15')]('The\x20Ticket\x20ID\x20is:',_0xf17c40['id']);switch(_0xdb3033[_0x7721('0x37')]){case _0x7721('0x56'):logger[_0x7721('0x15')]('[QUEUE]',_0x7721('0x57'));emit(util['format'](_0x7721('0x58'),_0x9f7b1d[_0x7721('0x3a')]),_0x7721('0x59'),{'recordId':_0xf17c40['id']});break;case _0x7721('0x5a'):logger[_0x7721('0x15')](_0x7721('0x4c'),_0x7721('0x5b'));emit(util[_0x7721('0xe')](_0x7721('0x58'),_0x9f7b1d[_0x7721('0x3a')]),_0x7721('0x5c'),{'uri':util[_0x7721('0xe')](_0x7721('0x5d'),_0xf17c40['id'])});break;default:logger[_0x7721('0x5e')](_0x7721('0x4c'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0x7721('0x5f')](function(_0x2f6f30){console[_0x7721('0x5e')](_0x2f6f30);logger[_0x7721('0x5e')](_0x7721('0x4c'),JSON[_0x7721('0x1a')](_0x2f6f30));});};exports[_0x7721('0x60')]=function(_0x57484c,_0x234bee,_0x17036e,_0x134908,_0x3b7382,_0x1f1e84,_0x9c0d4){var _0x7fbd6c,_0x33287d;_0x1f1e84[_0x7721('0x10')]=intUtil[_0x7721('0x49')](_0x1f1e84[_0x7721('0x10')]);_0x1f1e84['serverUrl']=intUtil[_0x7721('0x49')](_0x1f1e84[_0x7721('0x4a')]);if(_0x9c0d4&&_0x9c0d4[_0x7721('0x61')]&&_0x9c0d4[_0x7721('0x61')]!==_0x7721('0x62')){logger[_0x7721('0x15')](_0x7721('0x63'),_0x7721('0x4d'));_0x234bee[_0x7721('0x4e')]=util[_0x7721('0xe')](_0x7721('0x4f'),_0x1f1e84[_0x7721('0x4a')],_0x234bee[_0x7721('0x64')],md5(_0x234bee[_0x7721('0x64')]));}headers[_0x7721('0x50')]=getAuth(_0x1f1e84);return getUser(_0x1f1e84,_0x134908['email'])['then'](function(_0x4e112e){_0x7fbd6c=_0x4e112e;logger[_0x7721('0x15')]('The\x20User\x20ID\x20is:',_0x7fbd6c['id']);return getEndUser(_0x1f1e84,_0x234bee['destcalleridname'],_0x234bee['destcalleridnum']);})['then'](function(_0x47925a){_0x33287d=_0x47925a;logger[_0x7721('0x15')](_0x7721('0x54'),_0x33287d['id']);return getTicket(_0x1f1e84,_0x7fbd6c,_0x33287d,_0x17036e,_0x234bee);})['then'](function(_0x5181d7){if(_0x5181d7){logger['info']('Ticket\x20created!');logger['info'](_0x7721('0x65'),_0x5181d7['id']);switch(_0x1f1e84['type']){case'integrationTab':logger['info'](_0x7721('0x4c'),_0x7721('0x57'));emit(util[_0x7721('0xe')]('user:%s',_0x134908[_0x7721('0x3a')]),_0x7721('0x59'),{'recordId':_0x5181d7['id']});break;case _0x7721('0x5a'):logger[_0x7721('0x15')](_0x7721('0x4c'),_0x7721('0x5b'));emit(util[_0x7721('0xe')](_0x7721('0x58'),_0x134908[_0x7721('0x3a')]),_0x7721('0x5c'),{'uri':util[_0x7721('0xe')](_0x7721('0x66'),_0x1f1e84[_0x7721('0x10')],_0x5181d7['id'])});break;default:logger[_0x7721('0x5e')](_0x7721('0x63'),'Desk\x20account\x20type\x20not\x20recognized');}}})[_0x7721('0x5f')](function(_0x2c93b0){logger[_0x7721('0x5e')](_0x7721('0x63'),JSON['stringify'](_0x2c93b0));});};exports[_0x7721('0x67')]=function(_0x104f05,_0x4c8284,_0x3e7df3,_0x5d37ad,_0x1f508d,_0x4bfb48){var _0x36a3a6,_0x3f9eaa;_0x4bfb48[_0x7721('0x10')]=intUtil[_0x7721('0x49')](_0x4bfb48[_0x7721('0x10')]);_0x4bfb48[_0x7721('0x4a')]=intUtil[_0x7721('0x49')](_0x4bfb48['serverUrl']);if(_0x1f508d&&_0x1f508d[_0x7721('0x4b')]){logger[_0x7721('0x15')]('['+_0x4c8284[_0x7721('0x68')][_0x7721('0x69')]()+']',_0x7721('0x4d'));_0x4c8284[_0x7721('0x4e')]=util[_0x7721('0xe')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4bfb48[_0x7721('0x4a')],_0x4c8284[_0x7721('0x64')],md5(_0x4c8284['uniqueid']));}else{_0x4c8284[_0x7721('0x4e')]='';}headers['Authorization']=getAuth(_0x4bfb48);return getUser(_0x4bfb48)[_0x7721('0x11')](function(_0x382800){_0x36a3a6=_0x382800;logger[_0x7721('0x15')](_0x7721('0x52'),_0x36a3a6['id']);return getEndUser(_0x4bfb48,_0x4c8284[_0x7721('0x6a')],_0x4c8284[_0x7721('0x53')]);})[_0x7721('0x11')](function(_0x5dca04){_0x3f9eaa=_0x5dca04;logger[_0x7721('0x15')](_0x7721('0x54'),_0x3f9eaa['id']);return getTicket(_0x4bfb48,_0x36a3a6,_0x3f9eaa,_0x3e7df3,_0x4c8284);})[_0x7721('0x11')](function(_0x5f08cc){if(_0x5f08cc){logger['info']('Ticket\x20created!');logger['info']('The\x20Ticket\x20ID\x20is:',_0x5f08cc['id']);}})[_0x7721('0x5f')](function(_0x2645dd){logger['error']('['+_0x4c8284[_0x7721('0x68')][_0x7721('0x69')]()+']',JSON[_0x7721('0x1a')](_0x2645dd));});}; \ 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 fd6b215..f9b0ee5 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 _0xc4e2=['password','clientSecret','then','error','toUpperCase','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','value','isNil','validateEmail','email','length','internalemailaddress','isdisabled',']\x20Agent\x20found\x20','systemuserid','userId','info',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','outbound','destcalleridnum','calleridnum','contacts','/systemusers(','headers','lastIndexOf','enduserId','toLowerCase','contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27','replace','telephone1','contactid',']\x20Enduser\x20Created!','string','picklist','customField','idField','substring','indexOf','content','incidents','assign','getString','Subjects','Descriptions','/contacts(','Fields','phonecall','queue','callDirection','odata-entityid','ticketId','catch','format','emit','trigger:browser:url','stripTrailingSlash','serverUrl','unmanaged','%s/api/data/v9.0/','tenantId','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]',']\x20The\x20User\x20ID\x20is:',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s','ticketType',']\x20Call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Dynamics365\x20integration','inspect','bluebird','request-promise','./util','../../../../config/logger','../../../../config/environment','defaults','localhost','socket.io-emitter','POST','clientId','remoteUri','username'];(function(_0x50f0a9,_0x2b0c57){var _0x5a33d9=function(_0x40338e){while(--_0x40338e){_0x50f0a9['push'](_0x50f0a9['shift']());}};_0x5a33d9(++_0x2b0c57);}(_0xc4e2,0x1cf));var _0x2c4e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xc4e2[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var BPromise=require(_0x2c4e('0x0'));var rp=require(_0x2c4e('0x1'));var util=require('util');var intUtil=require(_0x2c4e('0x2'));var md5=require('md5');var Redis=require('ioredis');var logger=require(_0x2c4e('0x3'))('dynamics365');var config=require(_0x2c4e('0x4'));config['redis']=_[_0x2c4e('0x5')](config['redis'],{'host':_0x2c4e('0x6'),'port':0x18eb});var io=require(_0x2c4e('0x7'))(new Redis(config['redis']));function getAuthToken(_0x1da0fb,_0x5f3466,_0xe89278){var _0x2030db={'method':_0x2c4e('0x8'),'uri':_0x5f3466,'form':{'client_id':_0x1da0fb[_0x2c4e('0x9')],'resource':_0x1da0fb[_0x2c4e('0xa')],'username':_0x1da0fb[_0x2c4e('0xb')],'password':_0x1da0fb['password'],'grant_type':_0x2c4e('0xc'),'client_secret':_0x1da0fb[_0x2c4e('0xd')]},'json':!![]};return rp(_0x2030db)[_0x2c4e('0xe')](function(_0x5a02d6){return _0x5a02d6['access_token'];})['catch'](function(_0x3739be){logger[_0x2c4e('0xf')]('['+[_0xe89278[_0x2c4e('0x10')]()]+']\x20Wrong\x20credentials!');return _0x3739be[_0x2c4e('0x11')];});}function getUser(_0xadbefa,_0x37dcf7,_0x269516,_0x27fefb,_0x46aa4f,_0xcf0dc9){return new BPromise(function(_0x2f54b1,_0x3c5cbc){return getAuthToken(_0x37dcf7,_0x27fefb,_0xcf0dc9)[_0x2c4e('0xe')](function(_0x210a3a){var _0x119ff2={'method':_0x2c4e('0x12'),'uri':_0x46aa4f+_0x2c4e('0x13'),'headers':{'Authorization':_0x2c4e('0x14')+_0x210a3a,'OData-Version':_0x2c4e('0x15')},'json':!![]};return rp(_0x119ff2);})['then'](function(_0x2c33c8){var _0x5ff220=_0x2c33c8[_0x2c4e('0x16')];var _0x46a5d1=![];var _0x4aa55f=null;if(!_[_0x2c4e('0x17')](_0x269516)){if(intUtil[_0x2c4e('0x18')](_0x269516[_0x2c4e('0x19')])){_0xadbefa['userEmail']=_0x269516[_0x2c4e('0x19')];for(_0x4aa55f=0x0;_0x4aa55f<_0x5ff220[_0x2c4e('0x1a')];_0x4aa55f++){if(_0x5ff220[_0x4aa55f][_0x2c4e('0x1b')]===_0x269516[_0x2c4e('0x19')]&&!_0x5ff220[_0x4aa55f][_0x2c4e('0x1c')]){_0x46a5d1=!![];logger['info']('['+[_0xcf0dc9['toUpperCase']()]+_0x2c4e('0x1d')+_0x5ff220[_0x4aa55f][_0x2c4e('0x1e')]+'!');_0xadbefa[_0x2c4e('0x1f')]=_0x5ff220[_0x4aa55f]['systemuserid'];}}}}if(!_0x46a5d1){logger[_0x2c4e('0x20')]('['+[_0xcf0dc9[_0x2c4e('0x10')]()]+_0x2c4e('0x21'));_0xadbefa['userEmail']=_0x37dcf7[_0x2c4e('0xb')];for(_0x4aa55f=0x0;_0x4aa55f<_0x5ff220['length'];_0x4aa55f++){if(_0x5ff220[_0x4aa55f]['internalemailaddress']===_0x37dcf7['username']){_0xadbefa[_0x2c4e('0x1f')]=_0x5ff220[_0x4aa55f][_0x2c4e('0x1e')];}}}_0x2f54b1(_0xadbefa);})['catch'](function(_0x3f7a05){_0x3c5cbc(_0x3f7a05[_0x2c4e('0x11')]);});});}function createEndUser(_0x1cab9b,_0x5db604,_0x18a662,_0xc1b0dd,_0x597ab6,_0x19bc8c){return new BPromise(function(_0x63db11,_0x18ebe8){return getAuthToken(_0x5db604,_0x18a662,_0x19bc8c)[_0x2c4e('0xe')](function(_0x3c9dc5){var _0x5a982c=_0x19bc8c['toLowerCase']()===_0x2c4e('0x22')?_0x597ab6[_0x2c4e('0x23')]:_0x597ab6[_0x2c4e('0x24')];var _0x5ce188={'method':_0x2c4e('0x8'),'uri':_0xc1b0dd+_0x2c4e('0x25'),'body':{'telephone1':_0x5a982c,'fullname':_0x5a982c,'firstname':_0x5a982c,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x2c4e('0x26')+_0x1cab9b[_0x2c4e('0x1f')]+')'},'headers':{'Authorization':_0x2c4e('0x14')+_0x3c9dc5,'OData-Version':_0x2c4e('0x15')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x5ce188);})[_0x2c4e('0xe')](function(_0x206b8d){var _0x425c8a=_0x206b8d[_0x2c4e('0x27')]['odata-entityid'];var _0x1793fa=_0x425c8a['substring'](_0x425c8a[_0x2c4e('0x28')]('(')+0x1,_0x425c8a['lastIndexOf'](')'));_0x1cab9b[_0x2c4e('0x29')]=_0x1793fa;_0x63db11(_0x1cab9b);})['catch'](function(_0x59f104){_0x18ebe8(_0x59f104[_0x2c4e('0x11')]);});});}function getEndUser(_0x385983,_0x2f1432,_0x1f2421,_0x5195d0,_0x1ff340,_0x3c4d75){return new BPromise(function(_0x396daf,_0x35e418){var _0x4ac77e=_0x3c4d75[_0x2c4e('0x2a')]()===_0x2c4e('0x22')?_0x1ff340['destcalleridnum']:_0x1ff340[_0x2c4e('0x24')];return getAuthToken(_0x2f1432,_0x1f2421,_0x3c4d75)['then'](function(_0x111847){var _0x4e9558={'method':'GET','uri':_0x5195d0+_0x2c4e('0x2b')+_0x4ac77e[_0x2c4e('0x2c')]('+','%2b')+'\x27','headers':{'Authorization':'Bearer\x20'+_0x111847,'If-None-Match':null,'OData-Version':_0x2c4e('0x15')},'json':!![]};return rp(_0x4e9558);})[_0x2c4e('0xe')](function(_0x552d82){var _0x4a0c75=null;if(_0x552d82){var _0x154823=_0x552d82['value'];var _0x8c9ac8=![];for(_0x4a0c75=0x0;_0x4a0c75<_0x154823[_0x2c4e('0x1a')];_0x4a0c75++){if(_0x154823[_0x4a0c75][_0x2c4e('0x2d')]===_0x4ac77e){_0x8c9ac8=!![];_0x385983[_0x2c4e('0x29')]=_0x154823[_0x4a0c75][_0x2c4e('0x2e')];}}if(_0x8c9ac8){_0x396daf(_0x385983);}else{return createEndUser(_0x385983,_0x2f1432,_0x1f2421,_0x5195d0,_0x1ff340,_0x3c4d75)[_0x2c4e('0xe')](function(_0x3f37d5){logger[_0x2c4e('0x20')]('['+[_0x3c4d75[_0x2c4e('0x10')]()]+']\x20Enduser\x20created!',_0x3f37d5['enduserId']);_0x396daf(_0x3f37d5);});}}else{return createEndUser(_0x385983,_0x2f1432,_0x1f2421,_0x5195d0,_0x1ff340,_0x3c4d75)[_0x2c4e('0xe')](function(_0x5e8376){logger[_0x2c4e('0x20')]('['+[_0x3c4d75[_0x2c4e('0x10')]()]+_0x2c4e('0x2f'),_0x5e8376['enduserId']);_0x396daf(_0x5e8376);});}});});}function getCustomFields(_0x207f7f,_0x521698,_0x139080){var _0xe9f3={};if(_0x207f7f[_0x2c4e('0x1a')]>0x0){_['forEach'](_0x207f7f,function(_0x505181){if(_['includes']([_0x2c4e('0x30'),_0x2c4e('0x31')],_0x505181['type'])&&_0x505181['nameField']&&!_0x505181[_0x2c4e('0x32')]){var _0x5b149b=_0x505181[_0x2c4e('0x33')][_0x2c4e('0x2a')]();var _0x1f61d6=_0x5b149b[_0x2c4e('0x34')](0x0,_0x5b149b[_0x2c4e('0x35')]('_'));var _0x3aee9f=_0x5b149b[_0x2c4e('0x34')](_0x5b149b['indexOf']('_')+0x1);if(_0x1f61d6===_0x139080){_0xe9f3[_0x3aee9f]=_0x505181[_0x2c4e('0x36')];}}});}return _0xe9f3;}function getTicket(_0x471c42,_0x4a9371,_0x46059a,_0x1d68a1,_0x4892d9,_0x723078,_0x78ac13){return new BPromise(function(_0x1c6d41,_0x2f79bd){var _0xdbba0f;return getAuthToken(_0x4a9371,_0x46059a,_0x78ac13)[_0x2c4e('0xe')](function(_0x21db9f){if(_0x723078['ticketType']==='incident'){_0xdbba0f={'method':'POST','uri':_0x1d68a1+_0x2c4e('0x37'),'body':Object[_0x2c4e('0x38')]({},{'title':intUtil[_0x2c4e('0x39')](_0x723078[_0x2c4e('0x3a')],_0x4892d9,'\x20'),'description':intUtil[_0x2c4e('0x39')](_0x723078[_0x2c4e('0x3b')],_0x4892d9,'\x0a'),'customerid_contact@odata.bind':_0x2c4e('0x3c')+_0x471c42[_0x2c4e('0x29')]+')','ownerid@odata.bind':'/systemusers('+_0x471c42['userId']+')','caseorigincode':'1'},getCustomFields(_0x723078[_0x2c4e('0x3d')],_0x4892d9,_0x723078['ticketType'])),'headers':{'Authorization':_0x2c4e('0x14')+_0x21db9f,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}if(_0x723078['ticketType']===_0x2c4e('0x3e')){_0xdbba0f={'method':'POST','uri':_0x1d68a1+'phonecalls','body':Object[_0x2c4e('0x38')]({},{'subject':intUtil['getString'](_0x723078['Subjects'],_0x4892d9,'\x20'),'phonenumber':String(_0x4892d9[_0x2c4e('0x24')]),'description':intUtil['getString'](_0x723078['Descriptions'],_0x4892d9,'\x0a'),'regardingobjectid_contact@odata.bind':_0x2c4e('0x3c')+_0x471c42[_0x2c4e('0x29')]+')','ownerid@odata.bind':_0x2c4e('0x26')+_0x471c42['userId']+')','directioncode':_0x471c42['callDirection']===_0x2c4e('0x3f')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0x2c4e('0x26')+_0x471c42['userId']+')','participationtypemask':_0x471c42[_0x2c4e('0x40')]===_0x2c4e('0x3f')?0x2:0x1},{'partyid_contact@odata.bind':_0x2c4e('0x3c')+_0x471c42[_0x2c4e('0x29')]+')','participationtypemask':_0x471c42['callDirection']===_0x2c4e('0x3f')?0x1:0x2}]},getCustomFields(_0x723078[_0x2c4e('0x3d')],_0x4892d9,_0x723078['ticketType'])),'headers':{'Authorization':'Bearer\x20'+_0x21db9f,'OData-Version':_0x2c4e('0x15')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0xdbba0f);})[_0x2c4e('0xe')](function(_0x9ee39a){var _0x4e03b6=_0x9ee39a[_0x2c4e('0x27')][_0x2c4e('0x41')];var _0x9ea13c=_0x4e03b6['substring'](_0x4e03b6[_0x2c4e('0x28')]('(')+0x1,_0x4e03b6['lastIndexOf'](')'));_0x471c42[_0x2c4e('0x42')]=_0x9ea13c;_0x1c6d41(_0x471c42);})[_0x2c4e('0x43')](function(_0x541b19){_0x2f79bd(_0x541b19[_0x2c4e('0x11')]);});});}function emit(_0xcb1760,_0x2f2073,_0x177f7b,_0x39058d){var _0x59ed6a={'uri':util[_0x2c4e('0x44')]('%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s',_0xcb1760,_0x177f7b,_0x39058d)};io['to'](util['format']('user:%s',_0x2f2073))[_0x2c4e('0x45')](_0x2c4e('0x46'),_0x59ed6a);}exports['cs']=function(_0x1a0d30,_0x5aa833,_0x45dc56,_0x389bd3,_0x2529ad,_0x48c356,_0x2daadd,_0x44f1c5){var _0x20fa9c={};_0x48c356[_0x2c4e('0xa')]=intUtil[_0x2c4e('0x47')](_0x48c356[_0x2c4e('0xa')]);_0x48c356['serverUrl']=intUtil[_0x2c4e('0x47')](_0x48c356[_0x2c4e('0x48')]);_0x20fa9c[_0x2c4e('0x40')]=_0x44f1c5===_0x2c4e('0x3f')||_0x44f1c5===_0x2c4e('0x49')?_0x2c4e('0x3f'):_0x2c4e('0x22');var _0x42aa63=util[_0x2c4e('0x44')](_0x2c4e('0x4a'),_0x48c356['remoteUri']);var _0x36eca1=util[_0x2c4e('0x44')]('https://login.microsoftonline.com/%s/oauth2/token',_0x48c356[_0x2c4e('0x4b')]);var _0x456a4c=util[_0x2c4e('0x44')](_0x2c4e('0x4c'),_0x48c356[_0x2c4e('0x48')],_0x5aa833[_0x2c4e('0x4d')],md5(_0x5aa833[_0x2c4e('0x4d')]));if(_0x2529ad&&_0x2529ad[_0x2c4e('0x4e')]){logger[_0x2c4e('0x20')](_0x2c4e('0x4f'),_0x2c4e('0x50'));_0x5aa833[_0x2c4e('0x51')]=_0x456a4c;}else if(_0x2daadd&&_0x2daadd['recordingFormat']&&_0x2daadd[_0x2c4e('0x52')]!==_0x2c4e('0x53')){logger['info'](_0x2c4e('0x54'),_0x2c4e('0x50'));_0x5aa833[_0x2c4e('0x51')]=_0x456a4c;}else{_0x5aa833[_0x2c4e('0x51')]='';}return getUser(_0x20fa9c,_0x48c356,_0x389bd3,_0x36eca1,_0x42aa63,_0x44f1c5)['then'](function(_0x4b9a53){logger[_0x2c4e('0x20')]('['+_0x44f1c5['toUpperCase']()+_0x2c4e('0x55'),_0x4b9a53['userId']);logger[_0x2c4e('0x20')]('['+_0x44f1c5['toUpperCase']()+']\x20The\x20User\x20email\x20is:',_0x4b9a53['userEmail']);return getEndUser(_0x4b9a53,_0x48c356,_0x36eca1,_0x42aa63,_0x5aa833,_0x44f1c5);})['then'](function(_0x1bfb6d){logger['info']('['+_0x44f1c5[_0x2c4e('0x10')]()+_0x2c4e('0x56'),_0x1bfb6d['enduserId']);logger['info']('['+_0x44f1c5['toUpperCase']()+_0x2c4e('0x57'),_0x5aa833[_0x2c4e('0x24')]);return getTicket(_0x1bfb6d,_0x48c356,_0x36eca1,_0x42aa63,_0x5aa833,_0x45dc56,_0x44f1c5);})['then'](function(_0x31c763){logger[_0x2c4e('0x20')](util[_0x2c4e('0x44')]('['+_0x44f1c5[_0x2c4e('0x10')]()+_0x2c4e('0x58'),_0x45dc56[_0x2c4e('0x59')],_0x31c763[_0x2c4e('0x42')]));logger['info'](util[_0x2c4e('0x44')]('['+_0x44f1c5[_0x2c4e('0x10')]()+_0x2c4e('0x5a'),_0x44f1c5));if(_0x44f1c5!=='unmanaged'){logger[_0x2c4e('0x20')]('['+_0x44f1c5['toUpperCase']()+']',_0x2c4e('0x5b'));emit(_0x48c356[_0x2c4e('0xa')],_0x389bd3[_0x2c4e('0x5c')],_0x45dc56[_0x2c4e('0x59')],_0x31c763[_0x2c4e('0x42')]);}})[_0x2c4e('0x43')](function(_0x19d4e2){logger[_0x2c4e('0xf')]('['+_0x44f1c5[_0x2c4e('0x10')]()+_0x2c4e('0x5d'),util[_0x2c4e('0x5e')](_0x19d4e2,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xc353=['[QUEUE]','recordingURL','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20Dynamics365\x20integration','request-promise','util','md5','ioredis','../../../../config/logger','dynamics365','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','POST','remoteUri','username','password','clientSecret','access_token','error',']\x20Wrong\x20credentials!','message','then','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','4.0','isNil','validateEmail','email','length','internalemailaddress','isdisabled','info','toUpperCase','systemuserid','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userEmail','catch','toLowerCase','outbound','calleridnum','contacts','/systemusers(','Bearer\x20','headers','odata-entityid','substring','lastIndexOf','enduserId','destcalleridnum','contacts?$select=telephone1&$filter=telephone1\x20eq\x20\x27','replace','value','telephone1',']\x20Enduser\x20created!',']\x20Enduser\x20Created!','forEach','string','picklist','type','nameField','customField','idField','indexOf','ticketType','incident','incidents','Subjects','Descriptions','/contacts(','Fields','phonecall','phonecalls','assign','getString','callDirection','queue','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','trigger:browser:url','stripTrailingSlash','serverUrl','unmanaged','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','tenantId','uniqueid'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xc353,0x75));var _0x3c35=function(_0x30d123,_0x35e7ea){_0x30d123=_0x30d123-0x0;var _0xdd39a9=_0xc353[_0x30d123];return _0xdd39a9;};'use strict';var _=require('lodash');var BPromise=require('bluebird');var rp=require(_0x3c35('0x0'));var util=require(_0x3c35('0x1'));var intUtil=require('./util');var md5=require(_0x3c35('0x2'));var Redis=require(_0x3c35('0x3'));var logger=require(_0x3c35('0x4'))(_0x3c35('0x5'));var config=require(_0x3c35('0x6'));config[_0x3c35('0x7')]=_[_0x3c35('0x8')](config[_0x3c35('0x7')],{'host':_0x3c35('0x9'),'port':0x18eb});var io=require(_0x3c35('0xa'))(new Redis(config[_0x3c35('0x7')]));function getAuthToken(_0x4aed03,_0x2bea95,_0x2543d5){var _0x90ba6e={'method':_0x3c35('0xb'),'uri':_0x2bea95,'form':{'client_id':_0x4aed03['clientId'],'resource':_0x4aed03[_0x3c35('0xc')],'username':_0x4aed03[_0x3c35('0xd')],'password':_0x4aed03[_0x3c35('0xe')],'grant_type':_0x3c35('0xe'),'client_secret':_0x4aed03[_0x3c35('0xf')]},'json':!![]};return rp(_0x90ba6e)['then'](function(_0x302164){return _0x302164[_0x3c35('0x10')];})['catch'](function(_0x37cb46){logger[_0x3c35('0x11')]('['+[_0x2543d5['toUpperCase']()]+_0x3c35('0x12'));return _0x37cb46[_0x3c35('0x13')];});}function getUser(_0x148aaf,_0x41dc38,_0x2df9db,_0x12f7cf,_0x1faa80,_0x549c84){return new BPromise(function(_0x27c462,_0x4c359a){return getAuthToken(_0x41dc38,_0x12f7cf,_0x549c84)[_0x3c35('0x14')](function(_0x282cea){var _0xbb1d2e={'method':_0x3c35('0x15'),'uri':_0x1faa80+_0x3c35('0x16'),'headers':{'Authorization':'Bearer\x20'+_0x282cea,'OData-Version':_0x3c35('0x17')},'json':!![]};return rp(_0xbb1d2e);})[_0x3c35('0x14')](function(_0xd4f509){var _0x2c94a5=_0xd4f509['value'];var _0x5352cc=![];var _0x11d373=null;if(!_[_0x3c35('0x18')](_0x2df9db)){if(intUtil[_0x3c35('0x19')](_0x2df9db[_0x3c35('0x1a')])){_0x148aaf['userEmail']=_0x2df9db[_0x3c35('0x1a')];for(_0x11d373=0x0;_0x11d373<_0x2c94a5[_0x3c35('0x1b')];_0x11d373++){if(_0x2c94a5[_0x11d373][_0x3c35('0x1c')]===_0x2df9db[_0x3c35('0x1a')]&&!_0x2c94a5[_0x11d373][_0x3c35('0x1d')]){_0x5352cc=!![];logger[_0x3c35('0x1e')]('['+[_0x549c84[_0x3c35('0x1f')]()]+']\x20Agent\x20found\x20'+_0x2c94a5[_0x11d373][_0x3c35('0x20')]+'!');_0x148aaf[_0x3c35('0x21')]=_0x2c94a5[_0x11d373][_0x3c35('0x20')];}}}}if(!_0x5352cc){logger[_0x3c35('0x1e')]('['+[_0x549c84[_0x3c35('0x1f')]()]+_0x3c35('0x22'));_0x148aaf[_0x3c35('0x23')]=_0x41dc38[_0x3c35('0xd')];for(_0x11d373=0x0;_0x11d373<_0x2c94a5[_0x3c35('0x1b')];_0x11d373++){if(_0x2c94a5[_0x11d373][_0x3c35('0x1c')]===_0x41dc38[_0x3c35('0xd')]){_0x148aaf[_0x3c35('0x21')]=_0x2c94a5[_0x11d373][_0x3c35('0x20')];}}}_0x27c462(_0x148aaf);})[_0x3c35('0x24')](function(_0x56d1c6){_0x4c359a(_0x56d1c6[_0x3c35('0x13')]);});});}function createEndUser(_0x31d56f,_0x1e411d,_0x5da06b,_0x434d96,_0x10a8b8,_0x5ac097){return new BPromise(function(_0x58bb0f,_0x27bea5){return getAuthToken(_0x1e411d,_0x5da06b,_0x5ac097)['then'](function(_0x7b3524){var _0x292cf2=_0x5ac097[_0x3c35('0x25')]()===_0x3c35('0x26')?_0x10a8b8['destcalleridnum']:_0x10a8b8[_0x3c35('0x27')];var _0xc57a25={'method':_0x3c35('0xb'),'uri':_0x434d96+_0x3c35('0x28'),'body':{'telephone1':_0x292cf2,'fullname':_0x292cf2,'firstname':_0x292cf2,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x3c35('0x29')+_0x31d56f[_0x3c35('0x21')]+')'},'headers':{'Authorization':_0x3c35('0x2a')+_0x7b3524,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};return rp(_0xc57a25);})[_0x3c35('0x14')](function(_0x400ae5){var _0x2718b8=_0x400ae5[_0x3c35('0x2b')][_0x3c35('0x2c')];var _0x27f101=_0x2718b8[_0x3c35('0x2d')](_0x2718b8[_0x3c35('0x2e')]('(')+0x1,_0x2718b8['lastIndexOf'](')'));_0x31d56f[_0x3c35('0x2f')]=_0x27f101;_0x58bb0f(_0x31d56f);})[_0x3c35('0x24')](function(_0x2e0722){_0x27bea5(_0x2e0722[_0x3c35('0x13')]);});});}function getEndUser(_0x298b19,_0x41775e,_0x374601,_0x5f035e,_0x3eb08d,_0x2e5b21){return new BPromise(function(_0x243eac,_0x13192c){var _0x3f0457=_0x2e5b21['toLowerCase']()==='outbound'?_0x3eb08d[_0x3c35('0x30')]:_0x3eb08d['calleridnum'];return getAuthToken(_0x41775e,_0x374601,_0x2e5b21)[_0x3c35('0x14')](function(_0x263d74){var _0x3dd3c1={'method':_0x3c35('0x15'),'uri':_0x5f035e+_0x3c35('0x31')+_0x3f0457[_0x3c35('0x32')]('+','%2b')+'\x27','headers':{'Authorization':_0x3c35('0x2a')+_0x263d74,'If-None-Match':null,'OData-Version':_0x3c35('0x17')},'json':!![]};return rp(_0x3dd3c1);})['then'](function(_0x32b261){var _0x4d93ef=null;if(_0x32b261){var _0x15baf7=_0x32b261[_0x3c35('0x33')];var _0x5094c6=![];for(_0x4d93ef=0x0;_0x4d93ef<_0x15baf7['length'];_0x4d93ef++){if(_0x15baf7[_0x4d93ef][_0x3c35('0x34')]===_0x3f0457){_0x5094c6=!![];_0x298b19[_0x3c35('0x2f')]=_0x15baf7[_0x4d93ef]['contactid'];}}if(_0x5094c6){_0x243eac(_0x298b19);}else{return createEndUser(_0x298b19,_0x41775e,_0x374601,_0x5f035e,_0x3eb08d,_0x2e5b21)[_0x3c35('0x14')](function(_0x1c03ea){logger['info']('['+[_0x2e5b21[_0x3c35('0x1f')]()]+_0x3c35('0x35'),_0x1c03ea[_0x3c35('0x2f')]);_0x243eac(_0x1c03ea);});}}else{return createEndUser(_0x298b19,_0x41775e,_0x374601,_0x5f035e,_0x3eb08d,_0x2e5b21)['then'](function(_0x46679e){logger[_0x3c35('0x1e')]('['+[_0x2e5b21[_0x3c35('0x1f')]()]+_0x3c35('0x36'),_0x46679e['enduserId']);_0x243eac(_0x46679e);});}});});}function getCustomFields(_0x224e0e,_0xce52bc,_0x293cc3){var _0x23fced={};if(_0x224e0e[_0x3c35('0x1b')]>0x0){_[_0x3c35('0x37')](_0x224e0e,function(_0x4ed616){if(_['includes']([_0x3c35('0x38'),_0x3c35('0x39')],_0x4ed616[_0x3c35('0x3a')])&&_0x4ed616[_0x3c35('0x3b')]&&!_0x4ed616[_0x3c35('0x3c')]){var _0x560c7e=_0x4ed616[_0x3c35('0x3d')][_0x3c35('0x25')]();var _0x143918=_0x560c7e[_0x3c35('0x2d')](0x0,_0x560c7e[_0x3c35('0x3e')]('_'));var _0x94c15a=_0x560c7e[_0x3c35('0x2d')](_0x560c7e[_0x3c35('0x3e')]('_')+0x1);if(_0x143918===_0x293cc3){_0x23fced[_0x94c15a]=_0x4ed616['content'];}}});}return _0x23fced;}function getTicket(_0x1e563a,_0x164fd0,_0x49c1e8,_0x4d7ad3,_0x5db29f,_0x4a619d,_0x3c92eb){return new BPromise(function(_0x4db3c1,_0x3c1c13){var _0x460f8f;return getAuthToken(_0x164fd0,_0x49c1e8,_0x3c92eb)['then'](function(_0x51a66f){if(_0x4a619d[_0x3c35('0x3f')]===_0x3c35('0x40')){_0x460f8f={'method':_0x3c35('0xb'),'uri':_0x4d7ad3+_0x3c35('0x41'),'body':Object['assign']({},{'title':intUtil['getString'](_0x4a619d[_0x3c35('0x42')],_0x5db29f,'\x20'),'description':intUtil['getString'](_0x4a619d[_0x3c35('0x43')],_0x5db29f,'\x0a'),'customerid_contact@odata.bind':_0x3c35('0x44')+_0x1e563a[_0x3c35('0x2f')]+')','ownerid@odata.bind':_0x3c35('0x29')+_0x1e563a['userId']+')','caseorigincode':'1'},getCustomFields(_0x4a619d[_0x3c35('0x45')],_0x5db29f,_0x4a619d[_0x3c35('0x3f')])),'headers':{'Authorization':_0x3c35('0x2a')+_0x51a66f,'OData-Version':_0x3c35('0x17')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x4a619d[_0x3c35('0x3f')]===_0x3c35('0x46')){_0x460f8f={'method':'POST','uri':_0x4d7ad3+_0x3c35('0x47'),'body':Object[_0x3c35('0x48')]({},{'subject':intUtil[_0x3c35('0x49')](_0x4a619d[_0x3c35('0x42')],_0x5db29f,'\x20'),'phonenumber':String(_0x5db29f['calleridnum']),'description':intUtil[_0x3c35('0x49')](_0x4a619d[_0x3c35('0x43')],_0x5db29f,'\x0a'),'regardingobjectid_contact@odata.bind':_0x3c35('0x44')+_0x1e563a[_0x3c35('0x2f')]+')','ownerid@odata.bind':_0x3c35('0x29')+_0x1e563a['userId']+')','directioncode':_0x1e563a[_0x3c35('0x4a')]==='queue'?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':'/systemusers('+_0x1e563a['userId']+')','participationtypemask':_0x1e563a[_0x3c35('0x4a')]===_0x3c35('0x4b')?0x2:0x1},{'partyid_contact@odata.bind':_0x3c35('0x44')+_0x1e563a[_0x3c35('0x2f')]+')','participationtypemask':_0x1e563a[_0x3c35('0x4a')]==='queue'?0x1:0x2}]},getCustomFields(_0x4a619d['Fields'],_0x5db29f,_0x4a619d[_0x3c35('0x3f')])),'headers':{'Authorization':_0x3c35('0x2a')+_0x51a66f,'OData-Version':_0x3c35('0x17')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x460f8f);})[_0x3c35('0x14')](function(_0x901dec){var _0x119796=_0x901dec['headers'][_0x3c35('0x2c')];var _0x4ed837=_0x119796[_0x3c35('0x2d')](_0x119796[_0x3c35('0x2e')]('(')+0x1,_0x119796['lastIndexOf'](')'));_0x1e563a[_0x3c35('0x4c')]=_0x4ed837;_0x4db3c1(_0x1e563a);})[_0x3c35('0x24')](function(_0x37265c){_0x3c1c13(_0x37265c[_0x3c35('0x13')]);});});}function emit(_0x1aa56d,_0x3928e5,_0x5e554d,_0x1a24b1){var _0x57c6ec={'uri':util[_0x3c35('0x4d')](_0x3c35('0x4e'),_0x1aa56d,_0x5e554d,_0x1a24b1)};io['to'](util['format'](_0x3c35('0x4f'),_0x3928e5))[_0x3c35('0x50')](_0x3c35('0x51'),_0x57c6ec);}exports['cs']=function(_0x165678,_0x123824,_0x49fd3c,_0x5520b4,_0x2e7843,_0x5adf44,_0x2d1850,_0x2711a3){var _0x5ba420={};_0x5adf44[_0x3c35('0xc')]=intUtil[_0x3c35('0x52')](_0x5adf44[_0x3c35('0xc')]);_0x5adf44[_0x3c35('0x53')]=intUtil['stripTrailingSlash'](_0x5adf44['serverUrl']);_0x5ba420['callDirection']=_0x2711a3===_0x3c35('0x4b')||_0x2711a3===_0x3c35('0x54')?_0x3c35('0x4b'):_0x3c35('0x26');var _0x973c87=util[_0x3c35('0x4d')](_0x3c35('0x55'),_0x5adf44[_0x3c35('0xc')]);var _0x5dde5a=util[_0x3c35('0x4d')](_0x3c35('0x56'),_0x5adf44[_0x3c35('0x57')]);var _0x49e1ce=util[_0x3c35('0x4d')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x5adf44[_0x3c35('0x53')],_0x123824[_0x3c35('0x58')],md5(_0x123824[_0x3c35('0x58')]));if(_0x2e7843&&_0x2e7843['monitor_format']){logger[_0x3c35('0x1e')](_0x3c35('0x59'),'Recording\x20is\x20enabled!');_0x123824[_0x3c35('0x5a')]=_0x49e1ce;}else if(_0x2d1850&&_0x2d1850[_0x3c35('0x5b')]&&_0x2d1850[_0x3c35('0x5b')]!==_0x3c35('0x5c')){logger['info'](_0x3c35('0x5d'),_0x3c35('0x5e'));_0x123824[_0x3c35('0x5a')]=_0x49e1ce;}else{_0x123824[_0x3c35('0x5a')]='';}return getUser(_0x5ba420,_0x5adf44,_0x5520b4,_0x5dde5a,_0x973c87,_0x2711a3)[_0x3c35('0x14')](function(_0x1e8d21){logger[_0x3c35('0x1e')]('['+_0x2711a3[_0x3c35('0x1f')]()+_0x3c35('0x5f'),_0x1e8d21['userId']);logger[_0x3c35('0x1e')]('['+_0x2711a3[_0x3c35('0x1f')]()+_0x3c35('0x60'),_0x1e8d21[_0x3c35('0x23')]);return getEndUser(_0x1e8d21,_0x5adf44,_0x5dde5a,_0x973c87,_0x123824,_0x2711a3);})['then'](function(_0x1c6d81){logger[_0x3c35('0x1e')]('['+_0x2711a3[_0x3c35('0x1f')]()+_0x3c35('0x61'),_0x1c6d81['enduserId']);logger[_0x3c35('0x1e')]('['+_0x2711a3[_0x3c35('0x1f')]()+_0x3c35('0x62'),_0x123824[_0x3c35('0x27')]);return getTicket(_0x1c6d81,_0x5adf44,_0x5dde5a,_0x973c87,_0x123824,_0x49fd3c,_0x2711a3);})[_0x3c35('0x14')](function(_0x5e71c1){logger['info'](util[_0x3c35('0x4d')]('['+_0x2711a3[_0x3c35('0x1f')]()+_0x3c35('0x63'),_0x49fd3c['ticketType'],_0x5e71c1[_0x3c35('0x4c')]));logger[_0x3c35('0x1e')](util['format']('['+_0x2711a3[_0x3c35('0x1f')]()+_0x3c35('0x64'),_0x2711a3));if(_0x2711a3!==_0x3c35('0x54')){logger['info']('['+_0x2711a3['toUpperCase']()+']',_0x3c35('0x65'));emit(_0x5adf44[_0x3c35('0xc')],_0x5520b4['name'],_0x49fd3c[_0x3c35('0x3f')],_0x5e71c1[_0x3c35('0x4c')]);}})[_0x3c35('0x24')](function(_0x3b5543){logger[_0x3c35('0x11')]('['+_0x2711a3[_0x3c35('0x1f')]()+_0x3c35('0x66'),util['inspect'](_0x3b5543,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/freshdesk.js b/server/services/ami/trigger/integration/freshdesk.js index 40f7b66..9d207a3 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 _0xe7fd=['./util','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','application/json','emit','info','merge','format','getString','Subjects','Descriptions','
','name','Fields','mapValues','keyBy','custom_fields','value','%s/api/v2/tickets','remoteUri','POST','then','Ticket\x20created!','validateEmail','Agent\x20found!','find','contact','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','length','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Basic\x20%s','apiKey','toString','base64','debug','[HTTP]','GET','map','forEach','includes','string','picklist','type','customField','nameField','content','push','idField','variable','variableName','Variable','toLowerCase','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','catch','error','recordingFormat','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','unmanaged','lastevent','calleridnum','toUpperCase','stringify','lodash','request-promise','ioredis'];(function(_0x1bf228,_0x43de68){var _0x336d6b=function(_0x1c4596){while(--_0x1c4596){_0x1bf228['push'](_0x1bf228['shift']());}};_0x336d6b(++_0x43de68);}(_0xe7fd,0xb9));var _0xde7f=function(_0x4ca094,_0x796fd1){_0x4ca094=_0x4ca094-0x0;var _0x1444df=_0xe7fd[_0x4ca094];return _0x1444df;};'use strict';var _=require(_0xde7f('0x0'));var rp=require(_0xde7f('0x1'));var md5=require('md5');var util=require('util');var Redis=require(_0xde7f('0x2'));var intUtil=require(_0xde7f('0x3'));var config=require(_0xde7f('0x4'));var logger=require('../../../../config/logger')('freshdesk');config[_0xde7f('0x5')]=_[_0xde7f('0x6')](config[_0xde7f('0x5')],{'host':_0xde7f('0x7'),'port':0x18eb});var io=require(_0xde7f('0x8'))(new Redis(config[_0xde7f('0x5')]));var headers={'Content-Type':_0xde7f('0x9'),'Accept':_0xde7f('0x9')};function emit(_0x224d79,_0x224598,_0x55551e){io['to'](_0x224d79)[_0xde7f('0xa')](_0x224598,_0x55551e);}function getTicket(_0x389b62,_0x5baf82,_0x33408e,_0x355d5a,_0x353463){logger[_0xde7f('0xb')]('Creating\x20new\x20ticket...');var _0x539aa8=_[_0xde7f('0xc')]({'responder_id':_0x5baf82['id'],'requester_id':_0x33408e['id'],'name':util[_0xde7f('0xd')]('Caller\x20-\x20%s',_0x353463['calleridname']),'phone':_0x353463['calleridnum'],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0xde7f('0xe')](_0x355d5a[_0xde7f('0xf')],_0x353463,'\x20'),'description':intUtil[_0xde7f('0xe')](_0x355d5a[_0xde7f('0x10')],_0x353463,_0xde7f('0x11')),'tags':getTags(_0x355d5a['Tags'],_0xde7f('0x12'))},getCustomFields(_0x355d5a[_0xde7f('0x13')],_0x353463));_0x539aa8['custom_fields']=_[_0xde7f('0x14')](_[_0xde7f('0x15')](_0x539aa8[_0xde7f('0x16')],'id'),_0xde7f('0x17'));return request({'uri':util['format'](_0xde7f('0x18'),_0x389b62[_0xde7f('0x19')]),'method':_0xde7f('0x1a'),'body':_0x539aa8})[_0xde7f('0x1b')](function(_0x3d7c25){logger['info'](_0xde7f('0x1c'));return _0x3d7c25;});}function getUser(_0x22451e,_0x5c19ce){if(intUtil[_0xde7f('0x1d')](_0x5c19ce)){return request({'uri':util['format']('%s/api/v2/agents',_0x22451e['remoteUri']),'qs':{'email':_0x5c19ce}})[_0xde7f('0x1b')](function(_0x5e151e){if(_0x5e151e['length']){logger[_0xde7f('0xb')](_0xde7f('0x1e'));return _[_0xde7f('0x1f')](_0x5e151e,function(_0x304a4b){return _0x304a4b[_0xde7f('0x20')]['email']===_0x5c19ce;});}else{logger[_0xde7f('0xb')](_0xde7f('0x21'));return request({'uri':util[_0xde7f('0xd')]('%s/api/v2/agents/me',_0x22451e['remoteUri'])})['then'](function(_0x1043df){logger['info'](_0xde7f('0x22'));return _0x1043df;});}});}else{logger[_0xde7f('0xb')](_0xde7f('0x23'));return request({'uri':util[_0xde7f('0xd')](_0xde7f('0x24'),_0x22451e[_0xde7f('0x19')])})['then'](function(_0x5b1c0b){logger[_0xde7f('0xb')](_0xde7f('0x22'));return _0x5b1c0b;});}}function getEndUser(_0x98a3a7,_0x154e64,_0x335e96){logger['info'](_0xde7f('0x25'),_0x335e96);return request({'uri':util[_0xde7f('0xd')](_0xde7f('0x26'),_0x98a3a7[_0xde7f('0x19')]),'qs':{'phone':_0x335e96}})[_0xde7f('0x1b')](function(_0xeac075){if(_0xeac075[_0xde7f('0x27')]){logger[_0xde7f('0xb')](_0xde7f('0x28'));return _['find'](_0xeac075,{'phone':_0x335e96});}else{logger[_0xde7f('0xb')](_0xde7f('0x29'));return request({'uri':util[_0xde7f('0xd')](_0xde7f('0x26'),_0x98a3a7[_0xde7f('0x19')]),'method':_0xde7f('0x1a'),'body':{'name':_0x154e64,'phone':_0x335e96}})[_0xde7f('0x1b')](function(_0x2524a1){logger['info']('Enduser\x20created.');return _0x2524a1;});}});}function getAuth(_0x19d26e){return util[_0xde7f('0xd')](_0xde7f('0x2a'),new Buffer(_0x19d26e[_0xde7f('0x2b')]+':X')[_0xde7f('0x2c')](_0xde7f('0x2d')));}function request(_0x22c985){logger[_0xde7f('0x2e')](_0xde7f('0x2f'),JSON['stringify'](_0x22c985));return rp(_[_0xde7f('0x6')](_0x22c985,{'method':_0xde7f('0x30'),'headers':headers,'json':!![]}));}function getTags(_0x3661cb,_0x38e55c){var _0x529f24=[];if(_0x3661cb&&_0x3661cb[_0xde7f('0x27')]>0x0){_0x529f24=_[_0xde7f('0x31')](_0x3661cb,_0x38e55c);}return _0x529f24;}function getCustomFields(_0x516b57,_0x12a88e){var _0x28854f=[];var _0x453ba3={'custom_fields':[]};if(_0x516b57[_0xde7f('0x27')]>0x0){_[_0xde7f('0x32')](_0x516b57,function(_0x4fd51b){if(_[_0xde7f('0x33')]([_0xde7f('0x34'),_0xde7f('0x35')],_0x4fd51b[_0xde7f('0x36')])&&_0x4fd51b['nameField']&&!_0x4fd51b[_0xde7f('0x37')]){_0x453ba3[_0x4fd51b[_0xde7f('0x38')]['toLowerCase']()]=_0x4fd51b[_0xde7f('0x39')]['toString']();}else if(_['includes'](['string',_0xde7f('0x35')],_0x4fd51b[_0xde7f('0x36')])&&_0x4fd51b['idField']&&_0x4fd51b['customField']){_0x453ba3[_0xde7f('0x16')][_0xde7f('0x3a')]({'id':_0x4fd51b[_0xde7f('0x3b')],'value':_0x4fd51b[_0xde7f('0x39')]['toString']()});}else if(_0x4fd51b[_0xde7f('0x36')]===_0xde7f('0x3c')&&_0x4fd51b[_0xde7f('0x3d')]&&_0x4fd51b['idField']&&_0x4fd51b[_0xde7f('0x37')]){_0x12a88e[_0x4fd51b[_0xde7f('0x3d')]]&&_0x453ba3[_0xde7f('0x16')]['push']({'id':_0x4fd51b[_0xde7f('0x3b')],'value':_0x12a88e[_0x4fd51b[_0xde7f('0x3d')]]['toString']()});}else if(_0x4fd51b['type']==='customVariable'&&_0x4fd51b[_0xde7f('0x3e')]&&_0x4fd51b[_0xde7f('0x3e')][_0xde7f('0x12')]&&_0x4fd51b[_0xde7f('0x3b')]&&_0x4fd51b[_0xde7f('0x37')]){_0x12a88e[_0x4fd51b[_0xde7f('0x3e')][_0xde7f('0x12')][_0xde7f('0x3f')]()]&&_0x453ba3['custom_fields'][_0xde7f('0x3a')]({'id':_0x4fd51b['idField'],'value':_0x12a88e[_0x4fd51b[_0xde7f('0x3e')][_0xde7f('0x12')]['toLowerCase']()][_0xde7f('0x2c')]()});}});}return _0x453ba3;}exports[_0xde7f('0x40')]=function(_0x2ee380,_0x41a64c,_0x2cd48f,_0x288b73,_0x290115,_0x115ee7){var _0xe71268,_0xebc636;_0x115ee7[_0xde7f('0x19')]=intUtil[_0xde7f('0x41')](_0x115ee7['remoteUri']);_0x115ee7[_0xde7f('0x42')]=intUtil[_0xde7f('0x41')](_0x115ee7[_0xde7f('0x42')]);if(_0x290115&&_0x290115[_0xde7f('0x43')]){logger[_0xde7f('0xb')](_0xde7f('0x44'),_0xde7f('0x45'));_0x41a64c[_0xde7f('0x46')]=util[_0xde7f('0xd')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x115ee7[_0xde7f('0x42')],_0x41a64c[_0xde7f('0x47')],md5(_0x41a64c[_0xde7f('0x47')]));}else{_0x41a64c['recordingURL']='';}headers[_0xde7f('0x48')]=getAuth(_0x115ee7);return getUser(_0x115ee7,_0x288b73[_0xde7f('0x49')])['then'](function(_0x58852f){_0xe71268=_0x58852f;logger[_0xde7f('0xb')](_0xde7f('0x4a'),_0xe71268['id']);return getEndUser(_0x115ee7,_0x41a64c[_0xde7f('0x4b')],_0x41a64c['calleridnum']);})[_0xde7f('0x1b')](function(_0x19e5ec){_0xebc636=_0x19e5ec;logger[_0xde7f('0xb')](_0xde7f('0x4c'),_0xebc636['id']);return getTicket(_0x115ee7,_0xe71268,_0xebc636,_0x2cd48f,_0x41a64c);})[_0xde7f('0x1b')](function(_0x17abff){if(_0x17abff&&_0x17abff['id']){logger[_0xde7f('0xb')](_0xde7f('0x1c'));logger[_0xde7f('0xb')]('The\x20Ticket\x20ID\x20is:',_0x17abff['id']);logger[_0xde7f('0xb')](_0xde7f('0x44'),_0xde7f('0x4d'));emit(util[_0xde7f('0xd')](_0xde7f('0x4e'),_0x288b73[_0xde7f('0x12')]),_0xde7f('0x4f'),{'uri':util[_0xde7f('0xd')](_0xde7f('0x50'),_0x115ee7['remoteUri'],_0x17abff['id'])});}})[_0xde7f('0x51')](function(_0x33a638){logger[_0xde7f('0x52')](_0xde7f('0x44'),JSON['stringify'](_0x33a638));});};exports['outbound']=function(_0x2424e4,_0x4fe2aa,_0x4f4979,_0x59193b,_0x41236f,_0x4bbd5b,_0x1f148b){var _0x1882ef,_0x113f28;_0x4bbd5b['remoteUri']=intUtil['stripTrailingSlash'](_0x4bbd5b[_0xde7f('0x19')]);_0x4bbd5b[_0xde7f('0x42')]=intUtil[_0xde7f('0x41')](_0x4bbd5b[_0xde7f('0x42')]);if(_0x1f148b&&_0x1f148b['recordingFormat']&&_0x1f148b[_0xde7f('0x53')]!=='none'){logger[_0xde7f('0xb')](_0xde7f('0x54'),_0xde7f('0x45'));_0x4fe2aa[_0xde7f('0x46')]=util[_0xde7f('0xd')](_0xde7f('0x55'),_0x4bbd5b[_0xde7f('0x42')],_0x4fe2aa['uniqueid'],md5(_0x4fe2aa[_0xde7f('0x47')]));}headers[_0xde7f('0x48')]=getAuth(_0x4bbd5b);return getUser(_0x4bbd5b,_0x59193b[_0xde7f('0x49')])[_0xde7f('0x1b')](function(_0x5b649a){_0x1882ef=_0x5b649a;logger[_0xde7f('0xb')]('The\x20User\x20ID\x20is:',_0x1882ef['id']);return getEndUser(_0x4bbd5b,_0x4fe2aa[_0xde7f('0x56')],_0x4fe2aa[_0xde7f('0x57')]);})[_0xde7f('0x1b')](function(_0x17f010){_0x113f28=_0x17f010;logger[_0xde7f('0xb')]('The\x20Enduser\x20ID\x20is:',_0x113f28['id']);return getTicket(_0x4bbd5b,_0x1882ef,_0x113f28,_0x4f4979,_0x4fe2aa);})[_0xde7f('0x1b')](function(_0x3c8e40){if(_0x3c8e40&&_0x3c8e40['id']){logger[_0xde7f('0xb')](_0xde7f('0x1c'));logger[_0xde7f('0xb')](_0xde7f('0x58'),_0x3c8e40['id']);logger[_0xde7f('0xb')](_0xde7f('0x54'),_0xde7f('0x4d'));emit(util[_0xde7f('0xd')]('user:%s',_0x59193b['name']),_0xde7f('0x4f'),{'uri':util[_0xde7f('0xd')]('%s/helpdesk/tickets/%d',_0x4bbd5b[_0xde7f('0x19')],_0x3c8e40['id'])});}})[_0xde7f('0x51')](function(_0xa89921){logger[_0xde7f('0x52')](_0xde7f('0x54'),JSON['stringify'](_0xa89921));});};exports[_0xde7f('0x59')]=function(_0x36b208,_0x6ec9f0,_0x29e42,_0x58d87c,_0x17bfde,_0x4915b8){var _0x47aa37,_0x116d20;_0x4915b8[_0xde7f('0x19')]=intUtil['stripTrailingSlash'](_0x4915b8['remoteUri']);_0x4915b8[_0xde7f('0x42')]=intUtil[_0xde7f('0x41')](_0x4915b8[_0xde7f('0x42')]);if(_0x17bfde&&_0x17bfde['monitor_format']){logger[_0xde7f('0xb')]('['+_0x6ec9f0[_0xde7f('0x5a')]['toUpperCase']()+']',_0xde7f('0x45'));_0x6ec9f0['recordingURL']=util[_0xde7f('0xd')](_0xde7f('0x55'),_0x4915b8[_0xde7f('0x42')],_0x6ec9f0[_0xde7f('0x47')],md5(_0x6ec9f0['uniqueid']));}else{_0x6ec9f0[_0xde7f('0x46')]='';}headers['Authorization']=getAuth(_0x4915b8);return getUser(_0x4915b8,'')['then'](function(_0x3e7625){_0x47aa37=_0x3e7625;logger[_0xde7f('0xb')](_0xde7f('0x4a'),_0x47aa37['id']);return getEndUser(_0x4915b8,_0x6ec9f0[_0xde7f('0x4b')],_0x6ec9f0[_0xde7f('0x5b')]);})['then'](function(_0x1159dd){_0x116d20=_0x1159dd;logger[_0xde7f('0xb')](_0xde7f('0x4c'),_0x116d20['id']);return getTicket(_0x4915b8,_0x47aa37,_0x116d20,_0x29e42,_0x6ec9f0);})[_0xde7f('0x1b')](function(_0x148a78){if(_0x148a78){logger[_0xde7f('0xb')]('Ticket\x20created!');logger[_0xde7f('0xb')](_0xde7f('0x58'),_0x148a78['id']);}})[_0xde7f('0x51')](function(_0x14dd81){logger['error']('['+_0x6ec9f0[_0xde7f('0x5a')][_0xde7f('0x5c')]()+']',JSON[_0xde7f('0x5d')](_0x14dd81));});}; \ No newline at end of file +var _0x6b3f=['find','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','remoteUri','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','apiKey','toString','base64','debug','[HTTP]','stringify','defaults','GET','length','map','forEach','includes','string','picklist','type','customField','nameField','content','idField','push','variable','variableName','Variable','name','toLowerCase','stripTrailingSlash','serverUrl','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','Authorization','The\x20User\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','error','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','The\x20Enduser\x20ID\x20is:','catch','unmanaged','toUpperCase','request-promise','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','freshdesk','localhost','socket.io-emitter','application/json','emit','info','Creating\x20new\x20ticket...','format','Caller\x20-\x20%s','calleridname','calleridnum','Subjects','Descriptions','Tags','Fields','custom_fields','mapValues','keyBy','%s/api/v2/tickets','POST','then','Ticket\x20created!','validateEmail','%s/api/v2/agents','Agent\x20found!'];(function(_0x5ec2a6,_0x2ca159){var _0x2b4602=function(_0x42f312){while(--_0x42f312){_0x5ec2a6['push'](_0x5ec2a6['shift']());}};_0x2b4602(++_0x2ca159);}(_0x6b3f,0xf4));var _0xf6b3=function(_0x5a470c,_0xb6da5e){_0x5a470c=_0x5a470c-0x0;var _0x31c294=_0x6b3f[_0x5a470c];return _0x31c294;};'use strict';var _=require('lodash');var rp=require(_0xf6b3('0x0'));var md5=require(_0xf6b3('0x1'));var util=require(_0xf6b3('0x2'));var Redis=require(_0xf6b3('0x3'));var intUtil=require(_0xf6b3('0x4'));var config=require(_0xf6b3('0x5'));var logger=require(_0xf6b3('0x6'))(_0xf6b3('0x7'));config['redis']=_['defaults'](config['redis'],{'host':_0xf6b3('0x8'),'port':0x18eb});var io=require(_0xf6b3('0x9'))(new Redis(config['redis']));var headers={'Content-Type':_0xf6b3('0xa'),'Accept':_0xf6b3('0xa')};function emit(_0x55139b,_0x4f778a,_0x350942){io['to'](_0x55139b)[_0xf6b3('0xb')](_0x4f778a,_0x350942);}function getTicket(_0x5c3877,_0x25d01,_0x12f7c0,_0x56eddd,_0x823261){logger[_0xf6b3('0xc')](_0xf6b3('0xd'));var _0x1dbbb1=_['merge']({'responder_id':_0x25d01['id'],'requester_id':_0x12f7c0['id'],'name':util[_0xf6b3('0xe')](_0xf6b3('0xf'),_0x823261[_0xf6b3('0x10')]),'phone':_0x823261[_0xf6b3('0x11')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil['getString'](_0x56eddd[_0xf6b3('0x12')],_0x823261,'\x20'),'description':intUtil['getString'](_0x56eddd[_0xf6b3('0x13')],_0x823261,'
'),'tags':getTags(_0x56eddd[_0xf6b3('0x14')],'name')},getCustomFields(_0x56eddd[_0xf6b3('0x15')],_0x823261));_0x1dbbb1[_0xf6b3('0x16')]=_[_0xf6b3('0x17')](_[_0xf6b3('0x18')](_0x1dbbb1[_0xf6b3('0x16')],'id'),'value');return request({'uri':util[_0xf6b3('0xe')](_0xf6b3('0x19'),_0x5c3877['remoteUri']),'method':_0xf6b3('0x1a'),'body':_0x1dbbb1})[_0xf6b3('0x1b')](function(_0x3eb6d4){logger['info'](_0xf6b3('0x1c'));return _0x3eb6d4;});}function getUser(_0xe6c8a8,_0x117a9a){if(intUtil[_0xf6b3('0x1d')](_0x117a9a)){return request({'uri':util[_0xf6b3('0xe')](_0xf6b3('0x1e'),_0xe6c8a8['remoteUri']),'qs':{'email':_0x117a9a}})[_0xf6b3('0x1b')](function(_0x2c6c68){if(_0x2c6c68['length']){logger[_0xf6b3('0xc')](_0xf6b3('0x1f'));return _[_0xf6b3('0x20')](_0x2c6c68,function(_0x18e54b){return _0x18e54b[_0xf6b3('0x21')][_0xf6b3('0x22')]===_0x117a9a;});}else{logger[_0xf6b3('0xc')](_0xf6b3('0x23'));return request({'uri':util['format'](_0xf6b3('0x24'),_0xe6c8a8['remoteUri'])})[_0xf6b3('0x1b')](function(_0x369216){logger['info'](_0xf6b3('0x25'));return _0x369216;});}});}else{logger[_0xf6b3('0xc')](_0xf6b3('0x26'));return request({'uri':util[_0xf6b3('0xe')](_0xf6b3('0x24'),_0xe6c8a8[_0xf6b3('0x27')])})[_0xf6b3('0x1b')](function(_0x4f520b){logger[_0xf6b3('0xc')]('Admin\x20account\x20selected.');return _0x4f520b;});}}function getEndUser(_0x378681,_0x3d67be,_0x20d515){logger[_0xf6b3('0xc')](_0xf6b3('0x28'),_0x20d515);return request({'uri':util[_0xf6b3('0xe')](_0xf6b3('0x29'),_0x378681[_0xf6b3('0x27')]),'qs':{'phone':_0x20d515}})[_0xf6b3('0x1b')](function(_0x479f40){if(_0x479f40['length']){logger['info']('Enduser\x20found!');return _[_0xf6b3('0x20')](_0x479f40,{'phone':_0x20d515});}else{logger[_0xf6b3('0xc')](_0xf6b3('0x2a'));return request({'uri':util[_0xf6b3('0xe')]('%s/api/v2/contacts',_0x378681['remoteUri']),'method':'POST','body':{'name':_0x3d67be,'phone':_0x20d515}})[_0xf6b3('0x1b')](function(_0x49b79c){logger[_0xf6b3('0xc')]('Enduser\x20created.');return _0x49b79c;});}});}function getAuth(_0x53e45d){return util[_0xf6b3('0xe')]('Basic\x20%s',new Buffer(_0x53e45d[_0xf6b3('0x2b')]+':X')[_0xf6b3('0x2c')](_0xf6b3('0x2d')));}function request(_0x132758){logger[_0xf6b3('0x2e')](_0xf6b3('0x2f'),JSON[_0xf6b3('0x30')](_0x132758));return rp(_[_0xf6b3('0x31')](_0x132758,{'method':_0xf6b3('0x32'),'headers':headers,'json':!![]}));}function getTags(_0x2f8330,_0xbadacd){var _0x593a58=[];if(_0x2f8330&&_0x2f8330[_0xf6b3('0x33')]>0x0){_0x593a58=_[_0xf6b3('0x34')](_0x2f8330,_0xbadacd);}return _0x593a58;}function getCustomFields(_0x589143,_0x4cd667){var _0x5d9996=[];var _0x569a02={'custom_fields':[]};if(_0x589143[_0xf6b3('0x33')]>0x0){_[_0xf6b3('0x35')](_0x589143,function(_0x1a091c){if(_[_0xf6b3('0x36')]([_0xf6b3('0x37'),_0xf6b3('0x38')],_0x1a091c[_0xf6b3('0x39')])&&_0x1a091c['nameField']&&!_0x1a091c[_0xf6b3('0x3a')]){_0x569a02[_0x1a091c[_0xf6b3('0x3b')]['toLowerCase']()]=_0x1a091c[_0xf6b3('0x3c')][_0xf6b3('0x2c')]();}else if(_[_0xf6b3('0x36')]([_0xf6b3('0x37'),_0xf6b3('0x38')],_0x1a091c[_0xf6b3('0x39')])&&_0x1a091c[_0xf6b3('0x3d')]&&_0x1a091c[_0xf6b3('0x3a')]){_0x569a02[_0xf6b3('0x16')][_0xf6b3('0x3e')]({'id':_0x1a091c['idField'],'value':_0x1a091c['content'][_0xf6b3('0x2c')]()});}else if(_0x1a091c[_0xf6b3('0x39')]===_0xf6b3('0x3f')&&_0x1a091c[_0xf6b3('0x40')]&&_0x1a091c[_0xf6b3('0x3d')]&&_0x1a091c['customField']){_0x4cd667[_0x1a091c['variableName']]&&_0x569a02['custom_fields'][_0xf6b3('0x3e')]({'id':_0x1a091c[_0xf6b3('0x3d')],'value':_0x4cd667[_0x1a091c['variableName']][_0xf6b3('0x2c')]()});}else if(_0x1a091c['type']==='customVariable'&&_0x1a091c[_0xf6b3('0x41')]&&_0x1a091c[_0xf6b3('0x41')]['name']&&_0x1a091c[_0xf6b3('0x3d')]&&_0x1a091c[_0xf6b3('0x3a')]){_0x4cd667[_0x1a091c[_0xf6b3('0x41')][_0xf6b3('0x42')][_0xf6b3('0x43')]()]&&_0x569a02[_0xf6b3('0x16')][_0xf6b3('0x3e')]({'id':_0x1a091c[_0xf6b3('0x3d')],'value':_0x4cd667[_0x1a091c[_0xf6b3('0x41')][_0xf6b3('0x42')][_0xf6b3('0x43')]()][_0xf6b3('0x2c')]()});}});}return _0x569a02;}exports['queue']=function(_0x49a41a,_0xa116,_0x1a3f5d,_0x45db10,_0x92756,_0x1d9722){var _0x4366bd,_0x983075;_0x1d9722[_0xf6b3('0x27')]=intUtil[_0xf6b3('0x44')](_0x1d9722['remoteUri']);_0x1d9722[_0xf6b3('0x45')]=intUtil[_0xf6b3('0x44')](_0x1d9722[_0xf6b3('0x45')]);if(_0x92756&&_0x92756['monitor_format']){logger[_0xf6b3('0xc')]('[QUEUE]',_0xf6b3('0x46'));_0xa116['recordingURL']=util[_0xf6b3('0xe')](_0xf6b3('0x47'),_0x1d9722['serverUrl'],_0xa116['uniqueid'],md5(_0xa116[_0xf6b3('0x48')]));}else{_0xa116[_0xf6b3('0x49')]='';}headers[_0xf6b3('0x4a')]=getAuth(_0x1d9722);return getUser(_0x1d9722,_0x45db10['email'])[_0xf6b3('0x1b')](function(_0x2f716c){_0x4366bd=_0x2f716c;logger[_0xf6b3('0xc')](_0xf6b3('0x4b'),_0x4366bd['id']);return getEndUser(_0x1d9722,_0xa116[_0xf6b3('0x10')],_0xa116[_0xf6b3('0x11')]);})[_0xf6b3('0x1b')](function(_0x594606){_0x983075=_0x594606;logger[_0xf6b3('0xc')]('The\x20Enduser\x20ID\x20is:',_0x983075['id']);return getTicket(_0x1d9722,_0x4366bd,_0x983075,_0x1a3f5d,_0xa116);})[_0xf6b3('0x1b')](function(_0x15e518){if(_0x15e518&&_0x15e518['id']){logger[_0xf6b3('0xc')](_0xf6b3('0x1c'));logger[_0xf6b3('0xc')](_0xf6b3('0x4c'),_0x15e518['id']);logger['info'](_0xf6b3('0x4d'),_0xf6b3('0x4e'));emit(util['format'](_0xf6b3('0x4f'),_0x45db10[_0xf6b3('0x42')]),_0xf6b3('0x50'),{'uri':util[_0xf6b3('0xe')](_0xf6b3('0x51'),_0x1d9722[_0xf6b3('0x27')],_0x15e518['id'])});}})['catch'](function(_0x1089a1){logger[_0xf6b3('0x52')](_0xf6b3('0x4d'),JSON[_0xf6b3('0x30')](_0x1089a1));});};exports[_0xf6b3('0x53')]=function(_0x3e85d5,_0x1677f,_0x3de852,_0x36696d,_0x4e2570,_0x1b974f,_0x39a1fe){var _0x49adee,_0x229ea5;_0x1b974f[_0xf6b3('0x27')]=intUtil['stripTrailingSlash'](_0x1b974f[_0xf6b3('0x27')]);_0x1b974f[_0xf6b3('0x45')]=intUtil[_0xf6b3('0x44')](_0x1b974f[_0xf6b3('0x45')]);if(_0x39a1fe&&_0x39a1fe[_0xf6b3('0x54')]&&_0x39a1fe['recordingFormat']!==_0xf6b3('0x55')){logger[_0xf6b3('0xc')](_0xf6b3('0x56'),_0xf6b3('0x46'));_0x1677f[_0xf6b3('0x49')]=util[_0xf6b3('0xe')](_0xf6b3('0x47'),_0x1b974f[_0xf6b3('0x45')],_0x1677f[_0xf6b3('0x48')],md5(_0x1677f['uniqueid']));}headers[_0xf6b3('0x4a')]=getAuth(_0x1b974f);return getUser(_0x1b974f,_0x36696d[_0xf6b3('0x22')])['then'](function(_0xb421a1){_0x49adee=_0xb421a1;logger[_0xf6b3('0xc')](_0xf6b3('0x4b'),_0x49adee['id']);return getEndUser(_0x1b974f,_0x1677f[_0xf6b3('0x57')],_0x1677f['destcalleridnum']);})['then'](function(_0x4536b9){_0x229ea5=_0x4536b9;logger[_0xf6b3('0xc')](_0xf6b3('0x58'),_0x229ea5['id']);return getTicket(_0x1b974f,_0x49adee,_0x229ea5,_0x3de852,_0x1677f);})['then'](function(_0x186507){if(_0x186507&&_0x186507['id']){logger[_0xf6b3('0xc')](_0xf6b3('0x1c'));logger[_0xf6b3('0xc')](_0xf6b3('0x4c'),_0x186507['id']);logger[_0xf6b3('0xc')](_0xf6b3('0x56'),_0xf6b3('0x4e'));emit(util[_0xf6b3('0xe')](_0xf6b3('0x4f'),_0x36696d[_0xf6b3('0x42')]),'trigger:browser:url',{'uri':util['format'](_0xf6b3('0x51'),_0x1b974f[_0xf6b3('0x27')],_0x186507['id'])});}})[_0xf6b3('0x59')](function(_0x127455){logger[_0xf6b3('0x52')](_0xf6b3('0x56'),JSON['stringify'](_0x127455));});};exports[_0xf6b3('0x5a')]=function(_0x22f2b9,_0xeed8b,_0x12901d,_0x2839a7,_0x1967b9,_0x422e8f){var _0x15b2e5,_0x2ceccc;_0x422e8f[_0xf6b3('0x27')]=intUtil[_0xf6b3('0x44')](_0x422e8f[_0xf6b3('0x27')]);_0x422e8f[_0xf6b3('0x45')]=intUtil[_0xf6b3('0x44')](_0x422e8f[_0xf6b3('0x45')]);if(_0x1967b9&&_0x1967b9['monitor_format']){logger[_0xf6b3('0xc')]('['+_0xeed8b['lastevent'][_0xf6b3('0x5b')]()+']','Recording\x20is\x20enabled!');_0xeed8b[_0xf6b3('0x49')]=util[_0xf6b3('0xe')](_0xf6b3('0x47'),_0x422e8f[_0xf6b3('0x45')],_0xeed8b[_0xf6b3('0x48')],md5(_0xeed8b['uniqueid']));}else{_0xeed8b[_0xf6b3('0x49')]='';}headers[_0xf6b3('0x4a')]=getAuth(_0x422e8f);return getUser(_0x422e8f,'')[_0xf6b3('0x1b')](function(_0x19f00f){_0x15b2e5=_0x19f00f;logger['info'](_0xf6b3('0x4b'),_0x15b2e5['id']);return getEndUser(_0x422e8f,_0xeed8b[_0xf6b3('0x10')],_0xeed8b['calleridnum']);})['then'](function(_0x4a4600){_0x2ceccc=_0x4a4600;logger['info']('The\x20Enduser\x20ID\x20is:',_0x2ceccc['id']);return getTicket(_0x422e8f,_0x15b2e5,_0x2ceccc,_0x12901d,_0xeed8b);})[_0xf6b3('0x1b')](function(_0x563cbf){if(_0x563cbf){logger[_0xf6b3('0xc')]('Ticket\x20created!');logger['info'](_0xf6b3('0x4c'),_0x563cbf['id']);}})[_0xf6b3('0x59')](function(_0x11cbf9){logger['error']('['+_0xeed8b['lastevent']['toUpperCase']()+']',JSON[_0xf6b3('0x30')](_0x11cbf9));});}; \ 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 77b3e27..2299586 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 _0xecc8=['uniqueid','monitor_format','[QUEUE]','recordingURL','recordingFormat','Recording\x20is\x20enabled!','The\x20ticket\x20ID\x20is:\x20%s','unmanaged','Displaying\x20task\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20Freshsales\x20integration','inspect','lodash','request-promise','md5','util','moment','bluebird','./util','../../../../config/logger','freshsales','redis','defaults','GET','/api/selector/owners','headers','info','then','users','length','email','adminEmail','adminId','Requested\x20Resource\x20not\x20Found','catch','toUpperCase','message','agentEmail','Getting\x20user\x20with\x20email','userEmail','userId','User\x20found:','Admin\x20selected','error','/api/lookup?q=','&f=','contacts','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','mobile_number','endUserId','Contact\x20found\x20mobile_number:','Contact\x20found\x20work_number:','Contact\x20created:','POST','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','/api/tasks','getString','Descriptions','add','ticketId','Task\x20created:','/contacts/','user:%s','emit','trigger:browser:url','Token\x20token=','apiKey','remoteUri','stripTrailingSlash','serverUrl','outbound','destcalleridnum','calleridnum','callDirection','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s'];(function(_0x49641e,_0x5d497c){var _0x422c56=function(_0x512aea){while(--_0x512aea){_0x49641e['push'](_0x49641e['shift']());}};_0x422c56(++_0x5d497c);}(_0xecc8,0x19b));var _0x8ecc=function(_0x1d6024,_0x197dff){_0x1d6024=_0x1d6024-0x0;var _0x2c5310=_0xecc8[_0x1d6024];return _0x2c5310;};'use strict';var _=require(_0x8ecc('0x0'));var rp=require(_0x8ecc('0x1'));var md5=require(_0x8ecc('0x2'));var util=require(_0x8ecc('0x3'));var moment=require(_0x8ecc('0x4'));var Promise=require(_0x8ecc('0x5'));var Redis=require('ioredis');var intUtil=require(_0x8ecc('0x6'));var config=require('../../../../config/environment');var logger=require(_0x8ecc('0x7'))(_0x8ecc('0x8'));config[_0x8ecc('0x9')]=_[_0x8ecc('0xa')](config[_0x8ecc('0x9')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x8ecc('0x9')]));function getAdminId(_0x46139c,_0x125c91,_0x113ef6,_0xef6ec8){return new Promise(function(_0x167dbf,_0x58aedd){var _0x2fce72=![];var _0x511f0d={'method':_0x8ecc('0xb'),'uri':_0xef6ec8+_0x8ecc('0xc'),'json':!![]};_0x511f0d[_0x8ecc('0xd')]=_0x113ef6;logger[_0x8ecc('0xe')]('Getting\x20admin\x20information');return rp(_0x511f0d)[_0x8ecc('0xf')](function(_0x277189){if(_0x277189){var _0x447df1=_0x277189[_0x8ecc('0x10')];var _0x41f5bb=null;for(_0x41f5bb=0x0;_0x41f5bb<_0x447df1[_0x8ecc('0x11')];_0x41f5bb++){if(_0x447df1[_0x41f5bb][_0x8ecc('0x12')]===_0x46139c[_0x8ecc('0x13')]){_0x46139c[_0x8ecc('0x14')]=_0x447df1[_0x41f5bb]['id'];_0x2fce72=!![];}}if(_0x2fce72){logger[_0x8ecc('0xe')]('Admin\x20found:',_0x46139c['adminId']);_0x167dbf(_0x46139c);}else{_0x58aedd({'statusCode':0x194,'message':_0x8ecc('0x15')});}}else{_0x58aedd({'statusCode':0x194,'message':_0x8ecc('0x15')});}})[_0x8ecc('0x16')](function(_0x219bfa){logger['error']('['+[_0x125c91[_0x8ecc('0x17')]()]+']',_0x219bfa[_0x8ecc('0x18')]);_0x58aedd(_0x219bfa);});});}function getUser(_0x54eca0,_0x40ccb6,_0x5b3822){return function(_0x91765){return new Promise(function(_0x1c3eac,_0x59790a){var _0x1bbeec={'method':_0x8ecc('0xb'),'uri':_0x5b3822+'/api/selector/owners','json':!![]};_0x1bbeec[_0x8ecc('0xd')]=_0x40ccb6;logger['info']('Getting\x20user\x20list');return rp(_0x1bbeec)[_0x8ecc('0xf')](function(_0x3f2845){if(_0x3f2845){var _0x340a4c=_0x3f2845['users'];var _0x484043=![];var _0x39d919=null;if(_0x91765[_0x8ecc('0x19')]!==null){logger[_0x8ecc('0xe')](_0x8ecc('0x1a'),_0x91765[_0x8ecc('0x19')]);_0x91765[_0x8ecc('0x1b')]=_0x91765['agentEmail'];for(_0x39d919=0x0;_0x39d919<_0x340a4c[_0x8ecc('0x11')];_0x39d919++){if(_0x340a4c[_0x39d919][_0x8ecc('0x12')]===_0x91765[_0x8ecc('0x19')]){_0x484043=!![];_0x91765[_0x8ecc('0x1c')]=_0x340a4c[_0x39d919]['id'];logger['info'](_0x8ecc('0x1d'),_0x91765[_0x8ecc('0x1c')]);}}}if(!_0x484043){logger['info'](_0x8ecc('0x1e'));_0x91765['userEmail']=_0x91765[_0x8ecc('0x13')];_0x91765[_0x8ecc('0x1c')]=_0x91765[_0x8ecc('0x14')];_0x484043=!![];}if(_0x484043){_0x1c3eac(_0x91765);}else{_0x59790a({'statusCode':0x194,'message':_0x8ecc('0x15')});}}else{_0x59790a({'statusCode':0x194,'message':_0x8ecc('0x15')});}})[_0x8ecc('0x16')](function(_0x600950){logger[_0x8ecc('0x1f')]('['+[_0x54eca0[_0x8ecc('0x17')]()]+']',_0x600950['message']);_0x59790a(_0x600950);});});};}function searchContact(_0x441d0f,_0x38613d,_0x15df20,_0x31440){return new Promise(function(_0x2a5591,_0x5a6ee7){var _0x30eee4={'method':_0x8ecc('0xb'),'headers':_0x38613d,'uri':_0x441d0f+_0x8ecc('0x20')+_0x31440+_0x8ecc('0x21')+_0x15df20+'&entities=contact','json':!![]};rp(_0x30eee4)[_0x8ecc('0xf')](function(_0x47b569){var _0x90bc7c=_['find'](_0x47b569['contacts'][_0x8ecc('0x22')],[_0x15df20,_0x31440]);_0x2a5591(_0x90bc7c);})[_0x8ecc('0x16')](function(_0x27f360){_0x5a6ee7(_0x27f360);});});}function getEndUser(_0xd86a15,_0x2a10fa,_0x56a50){return function(_0xb7ef46){return new Promise(function(_0x36a2d6,_0x256e01){logger['info'](util[_0x8ecc('0x23')](_0x8ecc('0x24'),_0xb7ef46[_0x8ecc('0x25')]));searchContact(_0x56a50,_0x2a10fa,_0x8ecc('0x26'),_0xb7ef46[_0x8ecc('0x25')])[_0x8ecc('0xf')](function(_0xdc1d71){if(_0xdc1d71){_0xb7ef46[_0x8ecc('0x27')]=_0xdc1d71['id'];logger[_0x8ecc('0xe')](_0x8ecc('0x28'),_0xb7ef46['endUserId']);return _0x36a2d6(_0xb7ef46);}searchContact(_0x56a50,_0x2a10fa,'work_number',_0xb7ef46['contactNumber'])[_0x8ecc('0xf')](function(_0xa17333){if(_0xa17333){_0xb7ef46[_0x8ecc('0x27')]=_0xa17333['id'];logger[_0x8ecc('0xe')](_0x8ecc('0x29'),_0xb7ef46[_0x8ecc('0x27')]);return _0x36a2d6(_0xb7ef46);}createEndUser(_0xb7ef46,_0xd86a15,_0x2a10fa,_0x56a50)['then'](function(_0x2563d6){logger['info'](_0x8ecc('0x2a'),_0x2563d6[_0x8ecc('0x27')]);return _0x36a2d6(_0x2563d6);});});})[_0x8ecc('0x16')](function(_0x5719c5){_0x256e01(_0x5719c5);});});};}function createEndUser(_0x13899f,_0x13c42c,_0x29f562,_0x56d2d8){return new Promise(function(_0x41affd,_0x16b6c9){var _0x5652f7=moment();var _0x3f0832={'method':_0x8ecc('0x2b'),'uri':_0x56d2d8+'/api/contacts','body':{'contact':{'last_name':_0x13899f[_0x8ecc('0x25')],'work_number':_0x13899f[_0x8ecc('0x25')],'mobile_number':_0x13899f[_0x8ecc('0x25')],'owner_id':_0x13899f['userId'],'created_at':_0x5652f7[_0x8ecc('0x23')](_0x8ecc('0x2c'))}},'json':!![]};_0x3f0832[_0x8ecc('0xd')]=_0x29f562;logger[_0x8ecc('0xe')](_0x8ecc('0x2d'));return rp(_0x3f0832)['then'](function(_0x38782e){_0x13899f[_0x8ecc('0x27')]=_0x38782e[_0x8ecc('0x2e')]['id'];_0x41affd(_0x13899f);})['catch'](function(_0x3f08b1){logger['error']('['+[_0x13c42c[_0x8ecc('0x17')]()]+']',_0x3f08b1[_0x8ecc('0x18')]);_0x16b6c9(_0x3f08b1[_0x8ecc('0x18')]);});});}function getTicket(_0x3c9e15,_0x256eb8,_0x4eb06f,_0x1e9dba,_0x517566){return function(_0x45e981){logger[_0x8ecc('0xe')](_0x8ecc('0x2f'));return new Promise(function(_0x1cc523,_0x4b3405){var _0x342245=moment();var _0x3cc80c={'method':'POST','uri':_0x4eb06f+_0x8ecc('0x30'),'body':{'title':intUtil[_0x8ecc('0x31')](_0x1e9dba['Subjects'],_0x517566,'\x20'),'description':intUtil[_0x8ecc('0x31')](_0x1e9dba[_0x8ecc('0x32')],_0x517566,'\x0a'),'owner_id':_0x45e981[_0x8ecc('0x1c')],'creater_id':_0x45e981[_0x8ecc('0x14')],'targetable_id':_0x45e981[_0x8ecc('0x27')],'targetable_type':'Contact','created_at':_0x342245['format'](_0x8ecc('0x2c')),'due_date':_0x342245[_0x8ecc('0x33')](0x1e,'m')['format'](_0x8ecc('0x2c'))},'json':!![]};_0x3cc80c['headers']=_0x256eb8;return rp(_0x3cc80c)['then'](function(_0x1c818f){_0x45e981[_0x8ecc('0x34')]=_0x1c818f['task']['id'];logger['info'](_0x8ecc('0x35'),_0x45e981['ticketId']);_0x1cc523(_0x45e981);})[_0x8ecc('0x16')](function(_0x2be7b0){logger[_0x8ecc('0x1f')]('['+[_0x3c9e15[_0x8ecc('0x17')]()]+']',_0x2be7b0[_0x8ecc('0x18')]);_0x4b3405(_0x2be7b0[_0x8ecc('0x18')]);});});};}function emit(_0x554aff,_0x332bb4,_0x107914){var _0x657e1={'uri':_0x554aff+_0x8ecc('0x36')+_0x107914};io['to'](util[_0x8ecc('0x23')](_0x8ecc('0x37'),_0x332bb4))[_0x8ecc('0x38')](_0x8ecc('0x39'),_0x657e1);}exports['cs']=function(_0x58d30e,_0x74bf97,_0x4d9525,_0x2b6cf1,_0x1780b2,_0x111c6b,_0x55bf67,_0x1a6d8a){var _0x3f12b1={};var _0x16596e={'Authorization':_0x8ecc('0x3a')+_0x111c6b[_0x8ecc('0x3b')]};_0x111c6b[_0x8ecc('0x3c')]=intUtil[_0x8ecc('0x3d')](_0x111c6b[_0x8ecc('0x3c')]);_0x111c6b[_0x8ecc('0x3e')]=intUtil['stripTrailingSlash'](_0x111c6b[_0x8ecc('0x3e')]);var _0x1d4b8b=_0x111c6b[_0x8ecc('0x3c')];_0x3f12b1[_0x8ecc('0x13')]=_0x111c6b['username'];_0x3f12b1[_0x8ecc('0x25')]=_0x1a6d8a['toLowerCase']()===_0x8ecc('0x3f')?_0x74bf97[_0x8ecc('0x40')]:_0x74bf97[_0x8ecc('0x41')];_0x3f12b1[_0x8ecc('0x42')]=_0x1a6d8a===_0x8ecc('0x43')||_0x1a6d8a==='unmanaged'?_0x8ecc('0x43'):'outbound';if(_0x2b6cf1){_0x3f12b1[_0x8ecc('0x19')]=_0x2b6cf1[_0x8ecc('0x12')];}var _0x28cdb2=util[_0x8ecc('0x23')](_0x8ecc('0x44'),_0x111c6b[_0x8ecc('0x3e')],_0x74bf97[_0x8ecc('0x45')],md5(_0x74bf97[_0x8ecc('0x45')]));if(_0x1780b2&&_0x1780b2[_0x8ecc('0x46')]){logger[_0x8ecc('0xe')](_0x8ecc('0x47'),'Recording\x20is\x20enabled!');_0x74bf97[_0x8ecc('0x48')]=_0x28cdb2;}else if(_0x55bf67&&_0x55bf67[_0x8ecc('0x49')]&&_0x55bf67[_0x8ecc('0x49')]!=='none'){logger[_0x8ecc('0xe')]('[OUTBOUND]',_0x8ecc('0x4a'));_0x74bf97[_0x8ecc('0x48')]=_0x28cdb2;}else{_0x74bf97['recordingURL']='';}return getAdminId(_0x3f12b1,_0x1a6d8a,_0x16596e,_0x1d4b8b)[_0x8ecc('0xf')](getUser(_0x1a6d8a,_0x16596e,_0x1d4b8b))[_0x8ecc('0xf')](getEndUser(_0x1a6d8a,_0x16596e,_0x1d4b8b))[_0x8ecc('0xf')](getTicket(_0x1a6d8a,_0x16596e,_0x1d4b8b,_0x4d9525,_0x74bf97))[_0x8ecc('0xf')](function(_0x11d505){logger['info'](util['format'](_0x8ecc('0x4b'),_0x11d505['ticketId']));if(_0x1a6d8a!==_0x8ecc('0x4c')){logger[_0x8ecc('0xe')]('['+[_0x1a6d8a[_0x8ecc('0x17')]()]+']',_0x8ecc('0x4d'));emit(_0x1d4b8b,_0x2b6cf1['name'],_0x11d505[_0x8ecc('0x27')]);}})[_0x8ecc('0x16')](function(_0x362af0){logger[_0x8ecc('0x1f')]('['+[_0x1a6d8a[_0x8ecc('0x17')]()]+_0x8ecc('0x4e'),util[_0x8ecc('0x4f')](_0x362af0,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x47b1=['Descriptions','ticketId','task','/contacts/','user:%s','emit','trigger:browser:url','apiKey','remoteUri','stripTrailingSlash','serverUrl','username','toLowerCase','destcalleridnum','calleridnum','callDirection','queue','outbound','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','recordingURL','none','[OUTBOUND]','Recording\x20is\x20enabled!','The\x20ticket\x20ID\x20is:\x20%s',']\x20Error\x20running\x20Freshsales\x20integration','lodash','request-promise','util','moment','bluebird','./util','../../../../config/logger','redis','localhost','GET','/api/selector/owners','headers','info','length','Admin\x20found:','adminId','Requested\x20Resource\x20not\x20Found','error','toUpperCase','Getting\x20user\x20list','users','agentEmail','Getting\x20user\x20with\x20email','userEmail','email','userId','User\x20found:','Admin\x20selected','adminEmail','message','/api/lookup?q=','&entities=contact','contacts','catch','format','Searching\x20contact\x20with\x20phone\x20%s','contactNumber','then','endUserId','Contact\x20found\x20mobile_number:','Contact\x20found\x20work_number:','Contact\x20created:','POST','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','/api/tasks','getString','Subjects'];(function(_0x411add,_0x1aed38){var _0x238242=function(_0x4a1cd5){while(--_0x4a1cd5){_0x411add['push'](_0x411add['shift']());}};_0x238242(++_0x1aed38);}(_0x47b1,0x69));var _0x147b=function(_0x13425b,_0x509118){_0x13425b=_0x13425b-0x0;var _0x3917cb=_0x47b1[_0x13425b];return _0x3917cb;};'use strict';var _=require(_0x147b('0x0'));var rp=require(_0x147b('0x1'));var md5=require('md5');var util=require(_0x147b('0x2'));var moment=require(_0x147b('0x3'));var Promise=require(_0x147b('0x4'));var Redis=require('ioredis');var intUtil=require(_0x147b('0x5'));var config=require('../../../../config/environment');var logger=require(_0x147b('0x6'))('freshsales');config[_0x147b('0x7')]=_['defaults'](config['redis'],{'host':_0x147b('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x147b('0x7')]));function getAdminId(_0x21c8fb,_0x3a740f,_0x2f2137,_0x3a8664){return new Promise(function(_0xb25c2b,_0x1e7a2b){var _0x2eddd8=![];var _0x3a4775={'method':_0x147b('0x9'),'uri':_0x3a8664+_0x147b('0xa'),'json':!![]};_0x3a4775[_0x147b('0xb')]=_0x2f2137;logger[_0x147b('0xc')]('Getting\x20admin\x20information');return rp(_0x3a4775)['then'](function(_0x151eac){if(_0x151eac){var _0x486387=_0x151eac['users'];var _0x25c7e2=null;for(_0x25c7e2=0x0;_0x25c7e2<_0x486387[_0x147b('0xd')];_0x25c7e2++){if(_0x486387[_0x25c7e2]['email']===_0x21c8fb['adminEmail']){_0x21c8fb['adminId']=_0x486387[_0x25c7e2]['id'];_0x2eddd8=!![];}}if(_0x2eddd8){logger[_0x147b('0xc')](_0x147b('0xe'),_0x21c8fb[_0x147b('0xf')]);_0xb25c2b(_0x21c8fb);}else{_0x1e7a2b({'statusCode':0x194,'message':_0x147b('0x10')});}}else{_0x1e7a2b({'statusCode':0x194,'message':_0x147b('0x10')});}})['catch'](function(_0x17e6bd){logger[_0x147b('0x11')]('['+[_0x3a740f[_0x147b('0x12')]()]+']',_0x17e6bd['message']);_0x1e7a2b(_0x17e6bd);});});}function getUser(_0x27981e,_0x5e8e0f,_0x4f42a2){return function(_0x131508){return new Promise(function(_0x33a618,_0x4f1a53){var _0x4c9589={'method':_0x147b('0x9'),'uri':_0x4f42a2+_0x147b('0xa'),'json':!![]};_0x4c9589[_0x147b('0xb')]=_0x5e8e0f;logger[_0x147b('0xc')](_0x147b('0x13'));return rp(_0x4c9589)['then'](function(_0xa6b684){if(_0xa6b684){var _0x1438f7=_0xa6b684[_0x147b('0x14')];var _0x2bc129=![];var _0x482865=null;if(_0x131508[_0x147b('0x15')]!==null){logger['info'](_0x147b('0x16'),_0x131508[_0x147b('0x15')]);_0x131508[_0x147b('0x17')]=_0x131508[_0x147b('0x15')];for(_0x482865=0x0;_0x482865<_0x1438f7[_0x147b('0xd')];_0x482865++){if(_0x1438f7[_0x482865][_0x147b('0x18')]===_0x131508[_0x147b('0x15')]){_0x2bc129=!![];_0x131508[_0x147b('0x19')]=_0x1438f7[_0x482865]['id'];logger[_0x147b('0xc')](_0x147b('0x1a'),_0x131508[_0x147b('0x19')]);}}}if(!_0x2bc129){logger[_0x147b('0xc')](_0x147b('0x1b'));_0x131508[_0x147b('0x17')]=_0x131508[_0x147b('0x1c')];_0x131508[_0x147b('0x19')]=_0x131508[_0x147b('0xf')];_0x2bc129=!![];}if(_0x2bc129){_0x33a618(_0x131508);}else{_0x4f1a53({'statusCode':0x194,'message':_0x147b('0x10')});}}else{_0x4f1a53({'statusCode':0x194,'message':_0x147b('0x10')});}})['catch'](function(_0x50eca8){logger[_0x147b('0x11')]('['+[_0x27981e[_0x147b('0x12')]()]+']',_0x50eca8[_0x147b('0x1d')]);_0x4f1a53(_0x50eca8);});});};}function searchContact(_0x4d56cc,_0x20c4a5,_0x15f9b5,_0x288eaf){return new Promise(function(_0xb07523,_0x2367af){var _0x5e2956={'method':_0x147b('0x9'),'headers':_0x20c4a5,'uri':_0x4d56cc+_0x147b('0x1e')+_0x288eaf+'&f='+_0x15f9b5+_0x147b('0x1f'),'json':!![]};rp(_0x5e2956)['then'](function(_0x29d0de){var _0x1eb494=_['find'](_0x29d0de[_0x147b('0x20')]['contacts'],[_0x15f9b5,_0x288eaf]);_0xb07523(_0x1eb494);})[_0x147b('0x21')](function(_0x3a03af){_0x2367af(_0x3a03af);});});}function getEndUser(_0x32bd1e,_0x1cb278,_0x2007db){return function(_0x30549f){return new Promise(function(_0x33f235,_0x113263){logger[_0x147b('0xc')](util[_0x147b('0x22')](_0x147b('0x23'),_0x30549f[_0x147b('0x24')]));searchContact(_0x2007db,_0x1cb278,'mobile_number',_0x30549f[_0x147b('0x24')])[_0x147b('0x25')](function(_0x5c5ed0){if(_0x5c5ed0){_0x30549f[_0x147b('0x26')]=_0x5c5ed0['id'];logger['info'](_0x147b('0x27'),_0x30549f[_0x147b('0x26')]);return _0x33f235(_0x30549f);}searchContact(_0x2007db,_0x1cb278,'work_number',_0x30549f['contactNumber'])[_0x147b('0x25')](function(_0x13ba7e){if(_0x13ba7e){_0x30549f[_0x147b('0x26')]=_0x13ba7e['id'];logger[_0x147b('0xc')](_0x147b('0x28'),_0x30549f[_0x147b('0x26')]);return _0x33f235(_0x30549f);}createEndUser(_0x30549f,_0x32bd1e,_0x1cb278,_0x2007db)['then'](function(_0x6df6f7){logger[_0x147b('0xc')](_0x147b('0x29'),_0x6df6f7['endUserId']);return _0x33f235(_0x6df6f7);});});})[_0x147b('0x21')](function(_0xe457b8){_0x113263(_0xe457b8);});});};}function createEndUser(_0x3862e3,_0x7de791,_0x567c48,_0x33f921){return new Promise(function(_0x553dc9,_0x11a207){var _0x1cd48c=moment();var _0x135d46={'method':_0x147b('0x2a'),'uri':_0x33f921+'/api/contacts','body':{'contact':{'last_name':_0x3862e3[_0x147b('0x24')],'work_number':_0x3862e3[_0x147b('0x24')],'mobile_number':_0x3862e3[_0x147b('0x24')],'owner_id':_0x3862e3[_0x147b('0x19')],'created_at':_0x1cd48c['format'](_0x147b('0x2b'))}},'json':!![]};_0x135d46['headers']=_0x567c48;logger[_0x147b('0xc')](_0x147b('0x2c'));return rp(_0x135d46)[_0x147b('0x25')](function(_0x325d74){_0x3862e3[_0x147b('0x26')]=_0x325d74[_0x147b('0x2d')]['id'];_0x553dc9(_0x3862e3);})[_0x147b('0x21')](function(_0x3a80b1){logger[_0x147b('0x11')]('['+[_0x7de791[_0x147b('0x12')]()]+']',_0x3a80b1[_0x147b('0x1d')]);_0x11a207(_0x3a80b1[_0x147b('0x1d')]);});});}function getTicket(_0x49ed83,_0x15c507,_0x4be745,_0xb2433f,_0x1a4ec0){return function(_0xae9f2b){logger[_0x147b('0xc')]('Creating\x20new\x20task');return new Promise(function(_0x3a2aee,_0x1b4798){var _0x50ad42=moment();var _0x25e1f6={'method':_0x147b('0x2a'),'uri':_0x4be745+_0x147b('0x2e'),'body':{'title':intUtil[_0x147b('0x2f')](_0xb2433f[_0x147b('0x30')],_0x1a4ec0,'\x20'),'description':intUtil[_0x147b('0x2f')](_0xb2433f[_0x147b('0x31')],_0x1a4ec0,'\x0a'),'owner_id':_0xae9f2b[_0x147b('0x19')],'creater_id':_0xae9f2b[_0x147b('0xf')],'targetable_id':_0xae9f2b['endUserId'],'targetable_type':'Contact','created_at':_0x50ad42[_0x147b('0x22')](_0x147b('0x2b')),'due_date':_0x50ad42['add'](0x1e,'m')['format']('YYYY-MM-DDTHH:mm:ss')},'json':!![]};_0x25e1f6[_0x147b('0xb')]=_0x15c507;return rp(_0x25e1f6)[_0x147b('0x25')](function(_0x5dcd47){_0xae9f2b[_0x147b('0x32')]=_0x5dcd47[_0x147b('0x33')]['id'];logger[_0x147b('0xc')]('Task\x20created:',_0xae9f2b['ticketId']);_0x3a2aee(_0xae9f2b);})[_0x147b('0x21')](function(_0x36252d){logger['error']('['+[_0x49ed83['toUpperCase']()]+']',_0x36252d[_0x147b('0x1d')]);_0x1b4798(_0x36252d['message']);});});};}function emit(_0x40940f,_0x248f8e,_0x4816dd){var _0x22609c={'uri':_0x40940f+_0x147b('0x34')+_0x4816dd};io['to'](util[_0x147b('0x22')](_0x147b('0x35'),_0x248f8e))[_0x147b('0x36')](_0x147b('0x37'),_0x22609c);}exports['cs']=function(_0x5d769d,_0x406dca,_0x35a5af,_0x278adf,_0x40e9a6,_0x47f4bd,_0x2cce8b,_0x47833f){var _0x33f073={};var _0x53311d={'Authorization':'Token\x20token='+_0x47f4bd[_0x147b('0x38')]};_0x47f4bd[_0x147b('0x39')]=intUtil[_0x147b('0x3a')](_0x47f4bd['remoteUri']);_0x47f4bd[_0x147b('0x3b')]=intUtil[_0x147b('0x3a')](_0x47f4bd[_0x147b('0x3b')]);var _0x599b88=_0x47f4bd[_0x147b('0x39')];_0x33f073['adminEmail']=_0x47f4bd[_0x147b('0x3c')];_0x33f073[_0x147b('0x24')]=_0x47833f[_0x147b('0x3d')]()==='outbound'?_0x406dca[_0x147b('0x3e')]:_0x406dca[_0x147b('0x3f')];_0x33f073[_0x147b('0x40')]=_0x47833f===_0x147b('0x41')||_0x47833f==='unmanaged'?_0x147b('0x41'):_0x147b('0x42');if(_0x278adf){_0x33f073[_0x147b('0x15')]=_0x278adf['email'];}var _0x5775a4=util[_0x147b('0x22')](_0x147b('0x43'),_0x47f4bd[_0x147b('0x3b')],_0x406dca[_0x147b('0x44')],md5(_0x406dca[_0x147b('0x44')]));if(_0x40e9a6&&_0x40e9a6[_0x147b('0x45')]){logger[_0x147b('0xc')](_0x147b('0x46'),'Recording\x20is\x20enabled!');_0x406dca[_0x147b('0x47')]=_0x5775a4;}else if(_0x2cce8b&&_0x2cce8b['recordingFormat']&&_0x2cce8b['recordingFormat']!==_0x147b('0x48')){logger[_0x147b('0xc')](_0x147b('0x49'),_0x147b('0x4a'));_0x406dca[_0x147b('0x47')]=_0x5775a4;}else{_0x406dca[_0x147b('0x47')]='';}return getAdminId(_0x33f073,_0x47833f,_0x53311d,_0x599b88)['then'](getUser(_0x47833f,_0x53311d,_0x599b88))[_0x147b('0x25')](getEndUser(_0x47833f,_0x53311d,_0x599b88))['then'](getTicket(_0x47833f,_0x53311d,_0x599b88,_0x35a5af,_0x406dca))['then'](function(_0xbac99e){logger[_0x147b('0xc')](util[_0x147b('0x22')](_0x147b('0x4b'),_0xbac99e[_0x147b('0x32')]));if(_0x47833f!=='unmanaged'){logger[_0x147b('0xc')]('['+[_0x47833f['toUpperCase']()]+']','Displaying\x20task\x20in\x20a\x20new\x20tab...');emit(_0x599b88,_0x278adf['name'],_0xbac99e[_0x147b('0x26')]);}})[_0x147b('0x21')](function(_0x1cf9fe){logger[_0x147b('0x11')]('['+[_0x47833f[_0x147b('0x12')]()]+_0x147b('0x4c'),util['inspect'](_0x1cf9fe,{'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 e6f3443..bc4d724 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 _0x4e9c=['lodash','util','./zendesk','./salesforce','./sugarcrm','./desk','./vtiger','./dynamics365','./freshsales','zendesk','salesforce','sugarcrm','freshdesk','zoho','desk','vtiger','dynamics365','freshsales','exec','includes','data1','toLowerCase','Configurations','queue','outbound','log','EVENT\x20UNKNOWN','servicenow','error','format','%s\x20configuration\x20#%s\x20not\x20found','data3','../../../../config/logger','%s\x20account\x20#%s\x20not\x20found'];(function(_0x41452a,_0x35da2c){var _0x4cc55b=function(_0x3f4445){while(--_0x3f4445){_0x41452a['push'](_0x41452a['shift']());}};_0x4cc55b(++_0x35da2c);}(_0x4e9c,0x1dc));var _0xc4e9=function(_0x353292,_0x3f1713){_0x353292=_0x353292-0x0;var _0x4b8996=_0x4e9c[_0x353292];return _0x4b8996;};'use strict';var _=require(_0xc4e9('0x0'));var util=require(_0xc4e9('0x1'));var zendesk=require(_0xc4e9('0x2'));var salesforce=require(_0xc4e9('0x3'));var sugarcrm=require(_0xc4e9('0x4'));var freshdesk=require('./freshdesk');var zoho=require('./zoho');var desk=require(_0xc4e9('0x5'));var vtiger=require(_0xc4e9('0x6'));var servicenow=require('./servicenow');var dynamics365=require(_0xc4e9('0x7'));var freshsales=require(_0xc4e9('0x8'));var integrations=[_0xc4e9('0x9'),_0xc4e9('0xa'),_0xc4e9('0xb'),_0xc4e9('0xc'),_0xc4e9('0xd'),_0xc4e9('0xe'),_0xc4e9('0xf'),_0xc4e9('0x10'),_0xc4e9('0x11'),'servicenow'];exports[_0xc4e9('0x12')]=function(_0x4a72b7,_0x359169,_0xee91d2,_0x50a498,_0x5f03c4,_0x48352f){if(_0xee91d2){if(_[_0xc4e9('0x13')](integrations,_0x4a72b7[_0xc4e9('0x14')][_0xc4e9('0x15')]())){try{var _0x335631=null;var _0x1c163e='';var _0x48677d=_0xee91d2[_0x4a72b7[_0xc4e9('0x14')]['toLowerCase']()];if(_0x48677d){var _0x128980=_0x48677d[_0x4a72b7['data2']];if(_0x128980){var _0x5ae78d=_['find'](_0x128980[_0xc4e9('0x16')],{'id':parseInt(_0x4a72b7['data3'],0xa)});if(_0x5ae78d){if(_0x50a498){if(_0x5f03c4&&_0x359169[_0xc4e9('0x17')]){_0x1c163e=_0xc4e9('0x17');}else if(_0x359169['routeId']){_0x1c163e=_0xc4e9('0x18');}else{console[_0xc4e9('0x19')](_0xc4e9('0x1a'),_0x359169);}}else{_0x1c163e='unmanaged';}switch(_0x4a72b7['data1'][_0xc4e9('0x15')]()){case _0xc4e9('0x9'):zendesk[_0x1c163e](_0x4a72b7,_0x359169,_0x5ae78d,_0x50a498,_0x5f03c4,_0x128980,_0x48352f);break;case _0xc4e9('0xa'):salesforce[_0x1c163e](_0x4a72b7,_0x359169,_0x5ae78d,_0x50a498,_0x5f03c4,_0x128980,_0x48352f);break;case _0xc4e9('0xb'):sugarcrm[_0x1c163e](_0x4a72b7,_0x359169,_0x5ae78d,_0x50a498,_0x5f03c4,_0x128980,_0x48352f);break;case'freshdesk':freshdesk[_0x1c163e](_0x4a72b7,_0x359169,_0x5ae78d,_0x50a498,_0x5f03c4,_0x128980,_0x48352f);break;case _0xc4e9('0xd'):zoho[_0x1c163e](_0x4a72b7,_0x359169,_0x5ae78d,_0x50a498,_0x5f03c4,_0x128980,_0x48352f);break;case _0xc4e9('0xe'):desk[_0x1c163e](_0x4a72b7,_0x359169,_0x5ae78d,_0x50a498,_0x5f03c4,_0x128980,_0x48352f);break;case _0xc4e9('0xf'):vtiger[_0x1c163e](_0x4a72b7,_0x359169,_0x5ae78d,_0x50a498,_0x5f03c4,_0x128980,_0x48352f);break;case _0xc4e9('0x11'):freshsales['cs'](_0x4a72b7,_0x359169,_0x5ae78d,_0x50a498,_0x5f03c4,_0x128980,_0x48352f,_0x1c163e);break;case _0xc4e9('0x1b'):servicenow['cs'](_0x4a72b7,_0x359169,_0x5ae78d,_0x50a498,_0x5f03c4,_0x128980,_0x48352f,_0x1c163e);break;case _0xc4e9('0x10'):dynamics365['cs'](_0x4a72b7,_0x359169,_0x5ae78d,_0x50a498,_0x5f03c4,_0x128980,_0x48352f,_0x1c163e);break;default:console[_0xc4e9('0x19')]('unknown\x20integration');}}else{_0x335631=require('../../../../config/logger')(_0x4a72b7[_0xc4e9('0x14')][_0xc4e9('0x15')]());_0x335631[_0xc4e9('0x1c')]('[EXEC]',util[_0xc4e9('0x1d')](_0xc4e9('0x1e'),_0x4a72b7[_0xc4e9('0x14')][_0xc4e9('0x15')](),_0x4a72b7[_0xc4e9('0x1f')]));}}else{_0x335631=require(_0xc4e9('0x20'))(_0x4a72b7[_0xc4e9('0x14')][_0xc4e9('0x15')]());_0x335631['error']('[EXEC]',util[_0xc4e9('0x1d')](_0xc4e9('0x21'),_0x4a72b7['data1'][_0xc4e9('0x15')](),_0x4a72b7['data2']));}}else{}}catch(_0xcc6e4b){console[_0xc4e9('0x1c')](_0xcc6e4b);}}}}; \ No newline at end of file +var _0x9693=['vtiger','freshsales','servicenow','exec','toLowerCase','data1','data2','find','Configurations','data3','queue','outbound','log','desk','dynamics365','../../../../config/logger','error','format','%s\x20configuration\x20#%s\x20not\x20found','%s\x20account\x20#%s\x20not\x20found','lodash','util','./zendesk','./salesforce','./sugarcrm','./freshdesk','./zoho','./desk','./vtiger','./servicenow','./dynamics365','salesforce','sugarcrm','freshdesk','zoho'];(function(_0x41c9e6,_0x235e75){var _0xc97919=function(_0x598377){while(--_0x598377){_0x41c9e6['push'](_0x41c9e6['shift']());}};_0xc97919(++_0x235e75);}(_0x9693,0xe6));var _0x3969=function(_0x3a0f2b,_0x25d51c){_0x3a0f2b=_0x3a0f2b-0x0;var _0x419396=_0x9693[_0x3a0f2b];return _0x419396;};'use strict';var _=require(_0x3969('0x0'));var util=require(_0x3969('0x1'));var zendesk=require(_0x3969('0x2'));var salesforce=require(_0x3969('0x3'));var sugarcrm=require(_0x3969('0x4'));var freshdesk=require(_0x3969('0x5'));var zoho=require(_0x3969('0x6'));var desk=require(_0x3969('0x7'));var vtiger=require(_0x3969('0x8'));var servicenow=require(_0x3969('0x9'));var dynamics365=require(_0x3969('0xa'));var freshsales=require('./freshsales');var integrations=['zendesk',_0x3969('0xb'),_0x3969('0xc'),_0x3969('0xd'),_0x3969('0xe'),'desk',_0x3969('0xf'),'dynamics365',_0x3969('0x10'),_0x3969('0x11')];exports[_0x3969('0x12')]=function(_0x50b225,_0x5d32db,_0x343aed,_0x3e2b0f,_0xbbd6ce,_0x2f9abe){if(_0x343aed){if(_['includes'](integrations,_0x50b225['data1'][_0x3969('0x13')]())){try{var _0x588bc0=null;var _0x4eba06='';var _0x43dc30=_0x343aed[_0x50b225[_0x3969('0x14')][_0x3969('0x13')]()];if(_0x43dc30){var _0x37f8ba=_0x43dc30[_0x50b225[_0x3969('0x15')]];if(_0x37f8ba){var _0x427e99=_[_0x3969('0x16')](_0x37f8ba[_0x3969('0x17')],{'id':parseInt(_0x50b225[_0x3969('0x18')],0xa)});if(_0x427e99){if(_0x3e2b0f){if(_0xbbd6ce&&_0x5d32db[_0x3969('0x19')]){_0x4eba06=_0x3969('0x19');}else if(_0x5d32db['routeId']){_0x4eba06=_0x3969('0x1a');}else{console[_0x3969('0x1b')]('EVENT\x20UNKNOWN',_0x5d32db);}}else{_0x4eba06='unmanaged';}switch(_0x50b225[_0x3969('0x14')][_0x3969('0x13')]()){case'zendesk':zendesk[_0x4eba06](_0x50b225,_0x5d32db,_0x427e99,_0x3e2b0f,_0xbbd6ce,_0x37f8ba,_0x2f9abe);break;case _0x3969('0xb'):salesforce[_0x4eba06](_0x50b225,_0x5d32db,_0x427e99,_0x3e2b0f,_0xbbd6ce,_0x37f8ba,_0x2f9abe);break;case _0x3969('0xc'):sugarcrm[_0x4eba06](_0x50b225,_0x5d32db,_0x427e99,_0x3e2b0f,_0xbbd6ce,_0x37f8ba,_0x2f9abe);break;case _0x3969('0xd'):freshdesk[_0x4eba06](_0x50b225,_0x5d32db,_0x427e99,_0x3e2b0f,_0xbbd6ce,_0x37f8ba,_0x2f9abe);break;case _0x3969('0xe'):zoho[_0x4eba06](_0x50b225,_0x5d32db,_0x427e99,_0x3e2b0f,_0xbbd6ce,_0x37f8ba,_0x2f9abe);break;case _0x3969('0x1c'):desk[_0x4eba06](_0x50b225,_0x5d32db,_0x427e99,_0x3e2b0f,_0xbbd6ce,_0x37f8ba,_0x2f9abe);break;case _0x3969('0xf'):vtiger[_0x4eba06](_0x50b225,_0x5d32db,_0x427e99,_0x3e2b0f,_0xbbd6ce,_0x37f8ba,_0x2f9abe);break;case _0x3969('0x10'):freshsales['cs'](_0x50b225,_0x5d32db,_0x427e99,_0x3e2b0f,_0xbbd6ce,_0x37f8ba,_0x2f9abe,_0x4eba06);break;case _0x3969('0x11'):servicenow['cs'](_0x50b225,_0x5d32db,_0x427e99,_0x3e2b0f,_0xbbd6ce,_0x37f8ba,_0x2f9abe,_0x4eba06);break;case _0x3969('0x1d'):dynamics365['cs'](_0x50b225,_0x5d32db,_0x427e99,_0x3e2b0f,_0xbbd6ce,_0x37f8ba,_0x2f9abe,_0x4eba06);break;default:console[_0x3969('0x1b')]('unknown\x20integration');}}else{_0x588bc0=require(_0x3969('0x1e'))(_0x50b225['data1'][_0x3969('0x13')]());_0x588bc0[_0x3969('0x1f')]('[EXEC]',util[_0x3969('0x20')](_0x3969('0x21'),_0x50b225[_0x3969('0x14')][_0x3969('0x13')](),_0x50b225[_0x3969('0x18')]));}}else{_0x588bc0=require(_0x3969('0x1e'))(_0x50b225[_0x3969('0x14')]['toLowerCase']());_0x588bc0[_0x3969('0x1f')]('[EXEC]',util[_0x3969('0x20')](_0x3969('0x22'),_0x50b225[_0x3969('0x14')][_0x3969('0x13')](),_0x50b225['data2']));}}else{}}catch(_0x3a28a2){console[_0x3969('0x1f')](_0x3a28a2);}}}}; \ 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 76013a0..2c1ae20 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 _0xf774=['moduleSearch','cloneDeep','additionalSearchContact','merge','$or','Contact','additionalSearchLead','Lead','account_contact_lead','additionalSearchAccount','Account','first','Phone','type','toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','LastName','','format','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','Caller\x20-\x20%s','Company','No\x20Company','upperFirst','string','idField','content','toString','variable','variableName','customVariable','Variable','name','password','securityToken','Connection','https://login.salesforce.com','clientId','clientSecret','login','queue','serverUrl','stripTrailingSlash','remoteUri','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','calleridname','Fields','[QUEUE]\x20Ticket\x20%s\x20created','integrationTab','user:%s','trigger:salesforce:display','newTab','trigger:browser:url','%s/%s/e','instanceUrl','error','catch','recordingFormat','none','[OUTBOUND]','email','destcalleridnum','outbound','[OUTBOUND]\x20Ticket\x20%s\x20created.','Salesforce\x20account\x20type\x20not\x20recognized','unmanaged','monitor_format','lastevent','toUpperCase','isNil','calleridnum','lodash','moment','md5','util','ioredis','./util','salesforce','redis','localhost','socket.io-emitter','assign','getString','Subjects','ticketType','Task','utc','IsReminderSet','IsRecurrence','endUserType','contact','lead','account','ContactId','AccountId','leadId','Association\x20between\x20Case\x20and\x20Lead\x20skipped','sobject','create','validateEmail','User','find','execute','then','length','info','Agent\x20%s\x20found.','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','user_id','display_name'];(function(_0x1b9702,_0xf09368){var _0x1282ac=function(_0x396019){while(--_0x396019){_0x1b9702['push'](_0x1b9702['shift']());}};_0x1282ac(++_0xf09368);}(_0xf774,0x1b2));var _0x4f77=function(_0x3176ce,_0x465c1c){_0x3176ce=_0x3176ce-0x0;var _0x4649ba=_0xf774[_0x3176ce];return _0x4649ba;};'use strict';var _=require(_0x4f77('0x0'));var rp=require('request-promise');var moment=require(_0x4f77('0x1'));var BPromise=require('bluebird');var md5=require(_0x4f77('0x2'));var jsforce=require('jsforce');var util=require(_0x4f77('0x3'));var Redis=require(_0x4f77('0x4'));var intUtil=require(_0x4f77('0x5'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0x4f77('0x6'));config[_0x4f77('0x7')]=_['defaults'](config['redis'],{'host':_0x4f77('0x8'),'port':0x18eb});var io=require(_0x4f77('0x9'))(new Redis(config[_0x4f77('0x7')]));function emit(_0x3b489c,_0x5209dd,_0x1bed87){io['to'](_0x3b489c)['emit'](_0x5209dd,_0x1bed87);}function getTicket(_0x223f5c,_0x31e1f8,_0x5f2359,_0x4d07e0,_0x5b6b63,_0x5ae88d,_0x4afde9,_0x56cbe1){var _0x45da3f=Object[_0x4f77('0xa')]({},{'OwnerId':_0x31e1f8['id'],'Subject':intUtil[_0x4f77('0xb')](_0x4d07e0[_0x4f77('0xc')],_0x5b6b63,'\x20'),'Description':intUtil['getString'](_0x4d07e0['Descriptions'],_0x5b6b63,'\x0a')},getCustomFields(_0x5ae88d,_0x5b6b63));if(_0x5f2359){if(_0x4d07e0[_0x4f77('0xd')]===_0x4f77('0xe')){_0x45da3f['ActivityDate']=moment[_0x4f77('0xf')]();_0x45da3f[_0x4f77('0x10')]=![];_0x45da3f[_0x4f77('0x11')]=![];if(_0x5f2359[_0x4f77('0x12')]===_0x4f77('0x13')||_0x5f2359[_0x4f77('0x12')]===_0x4f77('0x14')){_0x45da3f['WhoId']=_0x5f2359['id'];}else if(_0x5f2359[_0x4f77('0x12')]===_0x4f77('0x15')){_0x45da3f['WhatId']=_0x5f2359['id'];}}else if(_0x4d07e0['ticketType']==='Case'){if(_0x5f2359[_0x4f77('0x12')]===_0x4f77('0x13')){_0x45da3f[_0x4f77('0x16')]=_0x5f2359['id'];}else if(_0x5f2359['endUserType']===_0x4f77('0x15')){_0x45da3f[_0x4f77('0x17')]=_0x5f2359['id'];}else if(_0x5f2359['endUserType']===_0x4f77('0x14')&&_0x4d07e0[_0x4f77('0x18')]){_0x45da3f[_0x4d07e0[_0x4f77('0x18')]]=_0x5f2359['id'];}else{logger['info'](_0x4f77('0x19'));}}}return _0x4afde9[_0x4f77('0x1a')](_0x4d07e0[_0x4f77('0xd')])[_0x4f77('0x1b')](_0x45da3f);}function getUser(_0x344e5a,_0x15d72c,_0xd1b6d9){if(!_['isNil'](_0x15d72c)&&intUtil[_0x4f77('0x1c')](_0x15d72c)){var _0x179577={'Email':_0x15d72c};var _0x3b0bc1={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0xd1b6d9[_0x4f77('0x1a')](_0x4f77('0x1d'))[_0x4f77('0x1e')](_0x179577,_0x3b0bc1)[_0x4f77('0x1f')]()[_0x4f77('0x20')](function(_0x188215){if(_0x188215[_0x4f77('0x21')]){var _0x26600f=_[_0x4f77('0x1e')](_0x188215,function(_0x2440ff){return _0x2440ff['Email']===_0x15d72c;});if(_0x26600f){logger[_0x4f77('0x22')](_0x4f77('0x23'),_0x15d72c);return BPromise[_0x4f77('0x24')]({'id':_0x26600f['Id'],'name':_0x26600f[_0x4f77('0x25')]});}}else{logger[_0x4f77('0x22')](_0x4f77('0x26'),_0x15d72c);return _0xd1b6d9[_0x4f77('0x27')]()[_0x4f77('0x20')](function(_0x24608c){return BPromise[_0x4f77('0x24')]({'id':_0x24608c[_0x4f77('0x28')],'name':_0x24608c[_0x4f77('0x29')]});});}});}else{logger[_0x4f77('0x22')](_0x4f77('0x26'),_0x15d72c);return _0xd1b6d9[_0x4f77('0x27')]()[_0x4f77('0x20')](function(_0x22a53a){return BPromise[_0x4f77('0x24')]({'id':_0x22a53a[_0x4f77('0x28')],'name':_0x22a53a['display_name']});});}}function getEndUser(_0x3a4efc,_0x2604f7,_0x3c56eb,_0x29fcd7,_0x2df8f1){var _0x263c84={'$or':{'Phone':_0x29fcd7}};var _0x55398b={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x4f77('0x24')]()[_0x4f77('0x20')](function(){logger[_0x4f77('0x22')]('Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.',_0x29fcd7,_0x2604f7[_0x4f77('0x2a')]);switch(_0x2604f7[_0x4f77('0x2a')]){case'contact_lead':var _0x89f4cd=_[_0x4f77('0x2b')](_0x263c84);if(_0x2604f7[_0x4f77('0x2c')]){var _0x1cdf29={};_0x1cdf29[_0x2604f7[_0x4f77('0x2c')]]=_0x29fcd7;_[_0x4f77('0x2d')](_0x89f4cd[_0x4f77('0x2e')],_0x1cdf29);}return _0x2df8f1['sobject'](_0x4f77('0x2f'))['find'](_0x89f4cd,_0x55398b)[_0x4f77('0x1f')]()['then'](function(_0x39e49f){if(_0x39e49f&&_0x39e49f[_0x4f77('0x21')]){return _0x39e49f;}else{var _0x115dd7=_[_0x4f77('0x2b')](_0x263c84);if(_0x2604f7[_0x4f77('0x30')]){var _0x34c64b={};_0x34c64b[_0x2604f7[_0x4f77('0x30')]]=_0x29fcd7;_[_0x4f77('0x2d')](_0x115dd7[_0x4f77('0x2e')],_0x34c64b);}return _0x2df8f1[_0x4f77('0x1a')](_0x4f77('0x31'))['find'](_0x115dd7,_0x55398b);}});case _0x4f77('0x32'):var _0x52b282=_['cloneDeep'](_0x263c84);if(_0x2604f7[_0x4f77('0x33')]){var _0x1cdf29={};_0x1cdf29[_0x2604f7['additionalSearchAccount']]=_0x29fcd7;_[_0x4f77('0x2d')](_0x52b282[_0x4f77('0x2e')],_0x1cdf29);}return _0x2df8f1[_0x4f77('0x1a')](_0x4f77('0x34'))[_0x4f77('0x1e')](_0x52b282,_0x55398b)[_0x4f77('0x1f')]()[_0x4f77('0x20')](function(_0x18eac4){if(_0x18eac4&&_0x18eac4[_0x4f77('0x21')]){return _0x18eac4;}else{var _0x273615=_['cloneDeep'](_0x263c84);if(_0x2604f7[_0x4f77('0x2c')]){var _0x4d6e65={};_0x4d6e65[_0x2604f7[_0x4f77('0x2c')]]=_0x29fcd7;_[_0x4f77('0x2d')](_0x273615['$or'],_0x4d6e65);}return _0x2df8f1['sobject'](_0x4f77('0x2f'))[_0x4f77('0x1e')](_0x273615,_0x55398b)['then'](function(_0x3c708f){if(_0x3c708f&&_0x3c708f[_0x4f77('0x21')]){return _0x3c708f;}else{var _0x5a6c7e=_[_0x4f77('0x2b')](_0x263c84);if(_0x2604f7['additionalSearchLead']){var _0x59dd93={};_0x59dd93[_0x2604f7[_0x4f77('0x30')]]=_0x29fcd7;_[_0x4f77('0x2d')](_0x5a6c7e[_0x4f77('0x2e')],_0x59dd93);}return _0x2df8f1['sobject'](_0x4f77('0x31'))[_0x4f77('0x1e')](_0x5a6c7e,_0x55398b);}});}});case _0x4f77('0x13'):var _0x89f4cd=_[_0x4f77('0x2b')](_0x263c84);if(_0x2604f7['additionalSearchContact']){var _0x1cdf29={};_0x1cdf29[_0x2604f7['additionalSearchContact']]=_0x29fcd7;_['merge'](_0x89f4cd['$or'],_0x1cdf29);}return _0x2df8f1[_0x4f77('0x1a')](_0x4f77('0x2f'))[_0x4f77('0x1e')](_0x89f4cd,_0x55398b)[_0x4f77('0x1f')]();case _0x4f77('0x14'):var _0xb9fbb9=_['cloneDeep'](_0x263c84);if(_0x2604f7[_0x4f77('0x30')]){var _0x1cdf29={};_0x1cdf29[_0x2604f7[_0x4f77('0x30')]]=_0x29fcd7;_[_0x4f77('0x2d')](_0xb9fbb9['$or'],_0x1cdf29);}return _0x2df8f1['sobject'](_0x4f77('0x31'))[_0x4f77('0x1e')](_0xb9fbb9,_0x55398b);case _0x4f77('0x15'):var _0x52b282=_['cloneDeep'](_0x263c84);if(_0x2604f7['additionalSearchAccount']){var _0x1cdf29={};_0x1cdf29[_0x2604f7['additionalSearchAccount']]=_0x29fcd7;_['merge'](_0x52b282['$or'],_0x1cdf29);}return _0x2df8f1[_0x4f77('0x1a')]('Account')[_0x4f77('0x1e')](_0x52b282,_0x55398b);default:return null;}})[_0x4f77('0x20')](function(_0x3a927c){if(_0x3a927c&&_0x3a927c['length']){var _0x568315=_[_0x4f77('0x35')](_0x3a927c);if(_0x568315){return BPromise[_0x4f77('0x24')]({'id':_0x568315['Id'],'name':_0x568315[_0x4f77('0x25')],'phone':_0x568315[_0x4f77('0x36')],'endUserType':_0x568315['attributes'][_0x4f77('0x37')][_0x4f77('0x38')]()});}}})['then'](function(_0x2c99ac){if(_0x2c99ac){logger['info'](_0x4f77('0x39'),_0x2c99ac[_0x4f77('0x12')],_0x29fcd7);return BPromise[_0x4f77('0x24')](_0x2c99ac);}else{logger[_0x4f77('0x22')](_0x4f77('0x3a'),_0x29fcd7);var _0x26c605={'Phone':_0x29fcd7};if(_0x2604f7[_0x4f77('0x3b')]){if(_0x2604f7[_0x4f77('0x3b')]===_0x4f77('0x13')){logger[_0x4f77('0x22')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x29fcd7,_0x2604f7[_0x4f77('0x3b')]);_0x26c605[_0x4f77('0x3c')]=_0x3c56eb!==_0x4f77('0x3d')?_0x3c56eb:util[_0x4f77('0x3e')]('Caller\x20-\x20%s',_0x29fcd7);}else if(_0x2604f7[_0x4f77('0x3b')]===_0x4f77('0x14')){logger['info'](_0x4f77('0x3f'),_0x29fcd7,_0x2604f7['moduleCreate']);_0x26c605[_0x4f77('0x3c')]=_0x3c56eb!==_0x4f77('0x3d')?_0x3c56eb:util[_0x4f77('0x3e')](_0x4f77('0x40'),_0x29fcd7);_0x26c605[_0x4f77('0x41')]=_0x4f77('0x42');}else if(_0x2604f7['moduleCreate']===_0x4f77('0x15')){logger['info'](_0x4f77('0x3f'),_0x29fcd7,_0x2604f7[_0x4f77('0x3b')]);_0x26c605[_0x4f77('0x25')]=_0x3c56eb!==_0x4f77('0x3d')?_0x3c56eb:util[_0x4f77('0x3e')](_0x4f77('0x40'),_0x29fcd7);}else{return null;}}return _0x2df8f1[_0x4f77('0x1a')](_[_0x4f77('0x43')](_0x2604f7[_0x4f77('0x3b')]))[_0x4f77('0x1b')](_0x26c605)[_0x4f77('0x20')](function(_0x8034b){return BPromise['resolve']({'id':_0x8034b['id'],'endUserType':_0x2604f7[_0x4f77('0x3b')]});});}});}function getCustomFields(_0x4014ba,_0x26f374){var _0x5962ae={};if(_0x4014ba[_0x4f77('0x21')]>0x0){_['forEach'](_0x4014ba,function(_0x2b5c60){if(_['includes']([_0x4f77('0x44'),'picklist'],_0x2b5c60[_0x4f77('0x37')])&&_0x2b5c60[_0x4f77('0x45')]){_0x5962ae[_0x2b5c60[_0x4f77('0x45')]]=_0x2b5c60[_0x4f77('0x46')][_0x4f77('0x47')]();}else if(_0x2b5c60[_0x4f77('0x37')]===_0x4f77('0x48')&&_0x2b5c60[_0x4f77('0x49')]&&_0x2b5c60[_0x4f77('0x45')]){_0x26f374[_0x2b5c60['variableName']]&&(_0x5962ae[_0x2b5c60[_0x4f77('0x45')]]=_0x26f374[_0x2b5c60[_0x4f77('0x49')]][_0x4f77('0x47')]());}else if(_0x2b5c60['type']===_0x4f77('0x4a')&&_0x2b5c60[_0x4f77('0x4b')]&&_0x2b5c60[_0x4f77('0x4b')][_0x4f77('0x4c')]&&_0x2b5c60[_0x4f77('0x45')]){_0x26f374[_0x2b5c60[_0x4f77('0x4b')][_0x4f77('0x4c')]['toLowerCase']()]&&(_0x5962ae[_0x2b5c60[_0x4f77('0x45')]]=_0x26f374[_0x2b5c60['Variable'][_0x4f77('0x4c')][_0x4f77('0x38')]()][_0x4f77('0x47')]());}});}return _0x5962ae;}function getConnection(_0x5b31eb){var _0x49470a=_0x5b31eb[_0x4f77('0x4d')]['concat'](_0x5b31eb[_0x4f77('0x4e')]);var _0x1f41bd=new jsforce[(_0x4f77('0x4f'))]({'oauth2':{'loginUrl':_0x5b31eb['remoteUri']||_0x4f77('0x50'),'clientId':_0x5b31eb[_0x4f77('0x51')],'clientSecret':_0x5b31eb[_0x4f77('0x52')]}});return _0x1f41bd[_0x4f77('0x53')](_0x5b31eb['username'],_0x49470a)[_0x4f77('0x20')](function(){logger[_0x4f77('0x22')]('Connection\x20established.');return _0x1f41bd;});}exports[_0x4f77('0x54')]=function(_0xd2c89b,_0x2394a5,_0x4f385f,_0x52c000,_0x2167ce,_0x188c18){var _0x5de4f9,_0x52b664,_0x3125b2,_0x4eb9f4;_0x188c18[_0x4f77('0x55')]=intUtil[_0x4f77('0x56')](_0x188c18[_0x4f77('0x55')]);_0x188c18[_0x4f77('0x57')]=intUtil['stripTrailingSlash'](_0x188c18[_0x4f77('0x57')]);if(_0x2167ce&&_0x2167ce['monitor_format']){logger['info'](_0x4f77('0x58'),_0x4f77('0x59'));_0x2394a5[_0x4f77('0x5a')]=util[_0x4f77('0x3e')](_0x4f77('0x5b'),_0x188c18[_0x4f77('0x55')],_0x2394a5['uniqueid'],md5(_0x2394a5[_0x4f77('0x5c')]));}else{_0x2394a5[_0x4f77('0x5a')]='';}return getConnection(_0x188c18)['then'](function(_0x432a7c){_0x4eb9f4=_0x432a7c;return getUser(_0x188c18,_0x52c000['email'],_0x4eb9f4);})[_0x4f77('0x20')](function(_0x13184f){_0x5de4f9=_0x13184f;return getEndUser(_0x188c18,_0x4f385f,_0x2394a5[_0x4f77('0x5d')],_0x2394a5['calleridnum'],_0x4eb9f4);})[_0x4f77('0x20')](function(_0x54de24){_0x52b664=_0x54de24;return getTicket(_0x188c18,_0x5de4f9,_0x52b664,_0x4f385f,_0x2394a5,_0x4f385f[_0x4f77('0x5e')],_0x4eb9f4,_0x4f77('0x54'));})[_0x4f77('0x20')](function(_0x2d71e6){_0x3125b2=_0x2d71e6;logger[_0x4f77('0x22')](_0x4f77('0x5f'),_0x3125b2['id']);logger['info']('[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x3125b2['id'],_0x52c000[_0x4f77('0x4c')],_0x188c18[_0x4f77('0x37')]);switch(_0x188c18[_0x4f77('0x37')]){case _0x4f77('0x60'):emit(util[_0x4f77('0x3e')](_0x4f77('0x61'),_0x52c000[_0x4f77('0x4c')]),_0x4f77('0x62'),{'recordId':_0x3125b2['id']});break;case _0x4f77('0x63'):emit(util[_0x4f77('0x3e')](_0x4f77('0x61'),_0x52c000['name']),_0x4f77('0x64'),{'uri':util[_0x4f77('0x3e')](_0x4f77('0x65'),_0x4eb9f4[_0x4f77('0x66')],_0x3125b2['id'])});break;default:logger[_0x4f77('0x67')]('[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.');}})[_0x4f77('0x68')](function(_0x2f5270){logger[_0x4f77('0x67')](_0x4f77('0x58'),_0x2f5270);});};exports['outbound']=function(_0xadb4fc,_0x9bd366,_0x492872,_0x2ce1ff,_0x5e26d4,_0x1e5069,_0x4afbc9){var _0x503096,_0x53bf70,_0x2534cd,_0x5e0229;_0x1e5069[_0x4f77('0x55')]=intUtil[_0x4f77('0x56')](_0x1e5069[_0x4f77('0x55')]);_0x1e5069['remoteUri']=intUtil[_0x4f77('0x56')](_0x1e5069[_0x4f77('0x57')]);if(_0x4afbc9&&_0x4afbc9[_0x4f77('0x69')]&&_0x4afbc9[_0x4f77('0x69')]!==_0x4f77('0x6a')){logger[_0x4f77('0x22')](_0x4f77('0x6b'),_0x4f77('0x59'));_0x9bd366[_0x4f77('0x5a')]=util[_0x4f77('0x3e')](_0x4f77('0x5b'),_0x1e5069['serverUrl'],_0x9bd366['uniqueid'],md5(_0x9bd366[_0x4f77('0x5c')]));}return getConnection(_0x1e5069)[_0x4f77('0x20')](function(_0x583a7e){_0x5e0229=_0x583a7e;return getUser(_0x1e5069,_0x2ce1ff[_0x4f77('0x6c')],_0x5e0229);})['then'](function(_0x193e25){_0x503096=_0x193e25;return getEndUser(_0x1e5069,_0x492872,_0x9bd366['destcalleridname'],_0x9bd366[_0x4f77('0x6d')],_0x5e0229);})['then'](function(_0x401193){_0x53bf70=_0x401193;return getTicket(_0x1e5069,_0x503096,_0x53bf70,_0x492872,_0x9bd366,_0x492872['Fields'],_0x5e0229,_0x4f77('0x6e'));})[_0x4f77('0x20')](function(_0x3531e1){_0x2534cd=_0x3531e1;logger[_0x4f77('0x22')](_0x4f77('0x6f'),_0x2534cd['id']);logger[_0x4f77('0x22')]('[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x2534cd['id'],_0x2ce1ff['name'],_0x1e5069[_0x4f77('0x37')]);switch(_0x1e5069[_0x4f77('0x37')]){case _0x4f77('0x60'):emit(util[_0x4f77('0x3e')](_0x4f77('0x61'),_0x2ce1ff['name']),_0x4f77('0x62'),{'recordId':_0x2534cd['id']});break;case _0x4f77('0x63'):emit(util[_0x4f77('0x3e')](_0x4f77('0x61'),_0x2ce1ff[_0x4f77('0x4c')]),_0x4f77('0x64'),{'uri':util[_0x4f77('0x3e')](_0x4f77('0x65'),_0x5e0229[_0x4f77('0x66')],_0x2534cd['id'])});break;default:logger[_0x4f77('0x67')]('[OUTBOUND]',_0x4f77('0x70'));}})['catch'](function(_0x3bf1af){logger['error'](_0x4f77('0x6b'),_0x3bf1af);});};exports[_0x4f77('0x71')]=function(_0xd0ae3e,_0x3c801a,_0x203670,_0x2fbc41,_0x1ba9e2,_0x5dd518){var _0x2e8939,_0x52dcba,_0xb45081,_0xdd0bd6;_0x5dd518[_0x4f77('0x55')]=intUtil[_0x4f77('0x56')](_0x5dd518[_0x4f77('0x55')]);_0x5dd518[_0x4f77('0x57')]=intUtil[_0x4f77('0x56')](_0x5dd518[_0x4f77('0x57')]);if(_0x1ba9e2&&_0x1ba9e2[_0x4f77('0x72')]){logger[_0x4f77('0x22')]('['+_0x3c801a[_0x4f77('0x73')][_0x4f77('0x74')]()+']',_0x4f77('0x59'));_0x3c801a[_0x4f77('0x5a')]=util[_0x4f77('0x3e')](_0x4f77('0x5b'),_0x5dd518[_0x4f77('0x55')],_0x3c801a[_0x4f77('0x5c')],md5(_0x3c801a[_0x4f77('0x5c')]));}else{_0x3c801a['recordingURL']='';}return getConnection(_0x5dd518)[_0x4f77('0x20')](function(_0x31b6a3){_0xdd0bd6=_0x31b6a3;if(!_[_0x4f77('0x75')](_0x2fbc41)){return getUser(_0x5dd518,_0x2fbc41[_0x4f77('0x4c')],_0xdd0bd6);}else{return getUser(_0x5dd518,null,_0xdd0bd6);}})[_0x4f77('0x20')](function(_0xb97925){_0x2e8939=_0xb97925;return getEndUser(_0x5dd518,_0x203670,_0x3c801a['calleridname'],_0x3c801a[_0x4f77('0x76')],_0xdd0bd6);})['then'](function(_0x251007){_0x52dcba=_0x251007;return getTicket(_0x5dd518,_0x2e8939,_0x52dcba,_0x203670,_0x3c801a,_0x203670['Fields'],_0xdd0bd6);})['then'](function(_0x26109a){_0xb45081=_0x26109a;logger[_0x4f77('0x22')]('['+_0x3c801a['lastevent']['toUpperCase']()+']\x20Ticket\x20%s\x20created.',_0xb45081['id']);logger[_0x4f77('0x22')]('['+_0x3c801a[_0x4f77('0x73')]['toUpperCase']()+']\x20Integration\x20account\x20type\x20%s.',_0x5dd518['type']);})['catch'](function(_0x29252a){logger[_0x4f77('0x67')]('['+_0x3c801a[_0x4f77('0x73')][_0x4f77('0x74')]()+']',_0x29252a);});}; \ No newline at end of file +var _0x587b=['toLowerCase','Enduser\x20(%s)\x20with\x20phone\x20%s\x20found','Enduser\x20with\x20phone\x20%s\x20not\x20found','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','LastName','format','Caller\x20-\x20%s','Company','No\x20Company','','upperFirst','create','forEach','includes','string','picklist','idField','content','variableName','toString','customVariable','Variable','name','concat','securityToken','Connection','https://login.salesforce.com','clientId','clientSecret','login','username','Connection\x20established.','queue','serverUrl','remoteUri','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridname','calleridnum','Fields','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','trigger:salesforce:display','newTab','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','outbound','recordingFormat','none','destcalleridname','user:%s','trigger:browser:url','[OUTBOUND]','unmanaged','toUpperCase',']\x20Ticket\x20%s\x20created.','lastevent',']\x20Integration\x20account\x20type\x20%s.','lodash','bluebird','jsforce','../../../../config/environment','../../../../config/logger','defaults','localhost','emit','assign','Subjects','getString','Descriptions','ticketType','ActivityDate','utc','IsReminderSet','IsRecurrence','endUserType','contact','lead','WhoId','ContactId','leadId','Association\x20between\x20Case\x20and\x20Lead\x20skipped','isNil','validateEmail','sobject','User','find','then','length','Email','info','Agent\x20%s\x20found.','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','resolve','display_name','user_id','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','contact_lead','cloneDeep','additionalSearchContact','merge','execute','additionalSearchLead','$or','Lead','additionalSearchAccount','Account','Contact','account','first','Phone','attributes','type'];(function(_0x486f4a,_0x478dc7){var _0x135d99=function(_0x434008){while(--_0x434008){_0x486f4a['push'](_0x486f4a['shift']());}};_0x135d99(++_0x478dc7);}(_0x587b,0xc3));var _0xb587=function(_0x3a7c12,_0xd33aaf){_0x3a7c12=_0x3a7c12-0x0;var _0x532892=_0x587b[_0x3a7c12];return _0x532892;};'use strict';var _=require(_0xb587('0x0'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xb587('0x1'));var md5=require('md5');var jsforce=require(_0xb587('0x2'));var util=require('util');var Redis=require('ioredis');var intUtil=require('./util');var config=require(_0xb587('0x3'));var logger=require(_0xb587('0x4'))('salesforce');config['redis']=_[_0xb587('0x5')](config['redis'],{'host':_0xb587('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function emit(_0x7963ab,_0x42a74b,_0x288098){io['to'](_0x7963ab)[_0xb587('0x7')](_0x42a74b,_0x288098);}function getTicket(_0x282648,_0x2e4a8e,_0x32ffab,_0x37d287,_0x18b292,_0x17eea3,_0x48c680,_0x49dd3b){var _0xafba53=Object[_0xb587('0x8')]({},{'OwnerId':_0x2e4a8e['id'],'Subject':intUtil['getString'](_0x37d287[_0xb587('0x9')],_0x18b292,'\x20'),'Description':intUtil[_0xb587('0xa')](_0x37d287[_0xb587('0xb')],_0x18b292,'\x0a')},getCustomFields(_0x17eea3,_0x18b292));if(_0x32ffab){if(_0x37d287[_0xb587('0xc')]==='Task'){_0xafba53[_0xb587('0xd')]=moment[_0xb587('0xe')]();_0xafba53[_0xb587('0xf')]=![];_0xafba53[_0xb587('0x10')]=![];if(_0x32ffab[_0xb587('0x11')]===_0xb587('0x12')||_0x32ffab[_0xb587('0x11')]===_0xb587('0x13')){_0xafba53[_0xb587('0x14')]=_0x32ffab['id'];}else if(_0x32ffab[_0xb587('0x11')]==='account'){_0xafba53['WhatId']=_0x32ffab['id'];}}else if(_0x37d287['ticketType']==='Case'){if(_0x32ffab['endUserType']===_0xb587('0x12')){_0xafba53[_0xb587('0x15')]=_0x32ffab['id'];}else if(_0x32ffab[_0xb587('0x11')]==='account'){_0xafba53['AccountId']=_0x32ffab['id'];}else if(_0x32ffab['endUserType']==='lead'&&_0x37d287[_0xb587('0x16')]){_0xafba53[_0x37d287['leadId']]=_0x32ffab['id'];}else{logger['info'](_0xb587('0x17'));}}}return _0x48c680['sobject'](_0x37d287['ticketType'])['create'](_0xafba53);}function getUser(_0x279920,_0x505687,_0x545755){if(!_[_0xb587('0x18')](_0x505687)&&intUtil[_0xb587('0x19')](_0x505687)){var _0x12e2cc={'Email':_0x505687};var _0xa2ce31={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x545755[_0xb587('0x1a')](_0xb587('0x1b'))[_0xb587('0x1c')](_0x12e2cc,_0xa2ce31)['execute']()[_0xb587('0x1d')](function(_0x144094){if(_0x144094[_0xb587('0x1e')]){var _0x294a70=_['find'](_0x144094,function(_0xadd40e){return _0xadd40e[_0xb587('0x1f')]===_0x505687;});if(_0x294a70){logger[_0xb587('0x20')](_0xb587('0x21'),_0x505687);return BPromise['resolve']({'id':_0x294a70['Id'],'name':_0x294a70[_0xb587('0x22')]});}}else{logger[_0xb587('0x20')](_0xb587('0x23'),_0x505687);return _0x545755[_0xb587('0x24')]()[_0xb587('0x1d')](function(_0x49b6b8){return BPromise[_0xb587('0x25')]({'id':_0x49b6b8['user_id'],'name':_0x49b6b8[_0xb587('0x26')]});});}});}else{logger[_0xb587('0x20')](_0xb587('0x23'),_0x505687);return _0x545755[_0xb587('0x24')]()[_0xb587('0x1d')](function(_0x158481){return BPromise[_0xb587('0x25')]({'id':_0x158481[_0xb587('0x27')],'name':_0x158481[_0xb587('0x26')]});});}}function getEndUser(_0x3836ea,_0xd4e34f,_0xcb4df6,_0x389d98,_0x475ea3){var _0x37ba37={'$or':{'Phone':_0x389d98}};var _0x28ed07={'Id':!![],'Name':!![],'Phone':!![]};return BPromise['resolve']()[_0xb587('0x1d')](function(){logger[_0xb587('0x20')](_0xb587('0x28'),_0x389d98,_0xd4e34f['moduleSearch']);switch(_0xd4e34f['moduleSearch']){case _0xb587('0x29'):var _0x48133d=_[_0xb587('0x2a')](_0x37ba37);if(_0xd4e34f[_0xb587('0x2b')]){var _0x3ec528={};_0x3ec528[_0xd4e34f[_0xb587('0x2b')]]=_0x389d98;_[_0xb587('0x2c')](_0x48133d['$or'],_0x3ec528);}return _0x475ea3[_0xb587('0x1a')]('Contact')['find'](_0x48133d,_0x28ed07)[_0xb587('0x2d')]()[_0xb587('0x1d')](function(_0x377244){if(_0x377244&&_0x377244[_0xb587('0x1e')]){return _0x377244;}else{var _0x28bb13=_['cloneDeep'](_0x37ba37);if(_0xd4e34f[_0xb587('0x2e')]){var _0x235dac={};_0x235dac[_0xd4e34f[_0xb587('0x2e')]]=_0x389d98;_[_0xb587('0x2c')](_0x28bb13[_0xb587('0x2f')],_0x235dac);}return _0x475ea3['sobject'](_0xb587('0x30'))['find'](_0x28bb13,_0x28ed07);}});case'account_contact_lead':var _0x1a7d9a=_[_0xb587('0x2a')](_0x37ba37);if(_0xd4e34f[_0xb587('0x31')]){var _0x3ec528={};_0x3ec528[_0xd4e34f[_0xb587('0x31')]]=_0x389d98;_[_0xb587('0x2c')](_0x1a7d9a[_0xb587('0x2f')],_0x3ec528);}return _0x475ea3['sobject'](_0xb587('0x32'))['find'](_0x1a7d9a,_0x28ed07)[_0xb587('0x2d')]()[_0xb587('0x1d')](function(_0x199ab7){if(_0x199ab7&&_0x199ab7[_0xb587('0x1e')]){return _0x199ab7;}else{var _0xff6264=_['cloneDeep'](_0x37ba37);if(_0xd4e34f[_0xb587('0x2b')]){var _0x2e4bb4={};_0x2e4bb4[_0xd4e34f[_0xb587('0x2b')]]=_0x389d98;_[_0xb587('0x2c')](_0xff6264[_0xb587('0x2f')],_0x2e4bb4);}return _0x475ea3[_0xb587('0x1a')](_0xb587('0x33'))[_0xb587('0x1c')](_0xff6264,_0x28ed07)['then'](function(_0xf91165){if(_0xf91165&&_0xf91165[_0xb587('0x1e')]){return _0xf91165;}else{var _0x5cf08a=_['cloneDeep'](_0x37ba37);if(_0xd4e34f['additionalSearchLead']){var _0x38b07c={};_0x38b07c[_0xd4e34f[_0xb587('0x2e')]]=_0x389d98;_[_0xb587('0x2c')](_0x5cf08a[_0xb587('0x2f')],_0x38b07c);}return _0x475ea3[_0xb587('0x1a')](_0xb587('0x30'))[_0xb587('0x1c')](_0x5cf08a,_0x28ed07);}});}});case _0xb587('0x12'):var _0x48133d=_[_0xb587('0x2a')](_0x37ba37);if(_0xd4e34f[_0xb587('0x2b')]){var _0x3ec528={};_0x3ec528[_0xd4e34f['additionalSearchContact']]=_0x389d98;_[_0xb587('0x2c')](_0x48133d[_0xb587('0x2f')],_0x3ec528);}return _0x475ea3[_0xb587('0x1a')]('Contact')['find'](_0x48133d,_0x28ed07)[_0xb587('0x2d')]();case _0xb587('0x13'):var _0x4282a9=_[_0xb587('0x2a')](_0x37ba37);if(_0xd4e34f[_0xb587('0x2e')]){var _0x3ec528={};_0x3ec528[_0xd4e34f[_0xb587('0x2e')]]=_0x389d98;_['merge'](_0x4282a9['$or'],_0x3ec528);}return _0x475ea3[_0xb587('0x1a')](_0xb587('0x30'))[_0xb587('0x1c')](_0x4282a9,_0x28ed07);case _0xb587('0x34'):var _0x1a7d9a=_[_0xb587('0x2a')](_0x37ba37);if(_0xd4e34f['additionalSearchAccount']){var _0x3ec528={};_0x3ec528[_0xd4e34f[_0xb587('0x31')]]=_0x389d98;_[_0xb587('0x2c')](_0x1a7d9a[_0xb587('0x2f')],_0x3ec528);}return _0x475ea3[_0xb587('0x1a')](_0xb587('0x32'))[_0xb587('0x1c')](_0x1a7d9a,_0x28ed07);default:return null;}})[_0xb587('0x1d')](function(_0xbe815c){if(_0xbe815c&&_0xbe815c['length']){var _0x2ae4bd=_[_0xb587('0x35')](_0xbe815c);if(_0x2ae4bd){return BPromise[_0xb587('0x25')]({'id':_0x2ae4bd['Id'],'name':_0x2ae4bd[_0xb587('0x22')],'phone':_0x2ae4bd[_0xb587('0x36')],'endUserType':_0x2ae4bd[_0xb587('0x37')][_0xb587('0x38')][_0xb587('0x39')]()});}}})[_0xb587('0x1d')](function(_0x38b6d4){if(_0x38b6d4){logger[_0xb587('0x20')](_0xb587('0x3a'),_0x38b6d4[_0xb587('0x11')],_0x389d98);return BPromise[_0xb587('0x25')](_0x38b6d4);}else{logger[_0xb587('0x20')](_0xb587('0x3b'),_0x389d98);var _0x3dadac={'Phone':_0x389d98};if(_0xd4e34f[_0xb587('0x3c')]){if(_0xd4e34f[_0xb587('0x3c')]===_0xb587('0x12')){logger['info'](_0xb587('0x3d'),_0x389d98,_0xd4e34f['moduleCreate']);_0x3dadac[_0xb587('0x3e')]=_0xcb4df6!==''?_0xcb4df6:util[_0xb587('0x3f')](_0xb587('0x40'),_0x389d98);}else if(_0xd4e34f[_0xb587('0x3c')]===_0xb587('0x13')){logger[_0xb587('0x20')](_0xb587('0x3d'),_0x389d98,_0xd4e34f['moduleCreate']);_0x3dadac[_0xb587('0x3e')]=_0xcb4df6!==''?_0xcb4df6:util['format'](_0xb587('0x40'),_0x389d98);_0x3dadac[_0xb587('0x41')]=_0xb587('0x42');}else if(_0xd4e34f['moduleCreate']==='account'){logger[_0xb587('0x20')](_0xb587('0x3d'),_0x389d98,_0xd4e34f[_0xb587('0x3c')]);_0x3dadac[_0xb587('0x22')]=_0xcb4df6!==_0xb587('0x43')?_0xcb4df6:util[_0xb587('0x3f')](_0xb587('0x40'),_0x389d98);}else{return null;}}return _0x475ea3[_0xb587('0x1a')](_[_0xb587('0x44')](_0xd4e34f['moduleCreate']))[_0xb587('0x45')](_0x3dadac)[_0xb587('0x1d')](function(_0x325cbd){return BPromise['resolve']({'id':_0x325cbd['id'],'endUserType':_0xd4e34f[_0xb587('0x3c')]});});}});}function getCustomFields(_0x4015ad,_0x16a7be){var _0x5a2e62={};if(_0x4015ad['length']>0x0){_[_0xb587('0x46')](_0x4015ad,function(_0xad82aa){if(_[_0xb587('0x47')]([_0xb587('0x48'),_0xb587('0x49')],_0xad82aa[_0xb587('0x38')])&&_0xad82aa[_0xb587('0x4a')]){_0x5a2e62[_0xad82aa['idField']]=_0xad82aa[_0xb587('0x4b')]['toString']();}else if(_0xad82aa[_0xb587('0x38')]==='variable'&&_0xad82aa['variableName']&&_0xad82aa[_0xb587('0x4a')]){_0x16a7be[_0xad82aa[_0xb587('0x4c')]]&&(_0x5a2e62[_0xad82aa[_0xb587('0x4a')]]=_0x16a7be[_0xad82aa[_0xb587('0x4c')]][_0xb587('0x4d')]());}else if(_0xad82aa[_0xb587('0x38')]===_0xb587('0x4e')&&_0xad82aa[_0xb587('0x4f')]&&_0xad82aa['Variable'][_0xb587('0x50')]&&_0xad82aa[_0xb587('0x4a')]){_0x16a7be[_0xad82aa[_0xb587('0x4f')][_0xb587('0x50')][_0xb587('0x39')]()]&&(_0x5a2e62[_0xad82aa['idField']]=_0x16a7be[_0xad82aa[_0xb587('0x4f')][_0xb587('0x50')]['toLowerCase']()][_0xb587('0x4d')]());}});}return _0x5a2e62;}function getConnection(_0x3363a0){var _0x20e299=_0x3363a0['password'][_0xb587('0x51')](_0x3363a0[_0xb587('0x52')]);var _0x5ee352=new jsforce[(_0xb587('0x53'))]({'oauth2':{'loginUrl':_0x3363a0['remoteUri']||_0xb587('0x54'),'clientId':_0x3363a0[_0xb587('0x55')],'clientSecret':_0x3363a0[_0xb587('0x56')]}});return _0x5ee352[_0xb587('0x57')](_0x3363a0[_0xb587('0x58')],_0x20e299)[_0xb587('0x1d')](function(){logger[_0xb587('0x20')](_0xb587('0x59'));return _0x5ee352;});}exports[_0xb587('0x5a')]=function(_0x346198,_0x2aad11,_0x8c7e8c,_0x34f3fe,_0x87345,_0x2c596a){var _0x21c94b,_0x264a07,_0x39c43b,_0xac40fc;_0x2c596a[_0xb587('0x5b')]=intUtil['stripTrailingSlash'](_0x2c596a['serverUrl']);_0x2c596a[_0xb587('0x5c')]=intUtil[_0xb587('0x5d')](_0x2c596a[_0xb587('0x5c')]);if(_0x87345&&_0x87345[_0xb587('0x5e')]){logger[_0xb587('0x20')](_0xb587('0x5f'),_0xb587('0x60'));_0x2aad11[_0xb587('0x61')]=util[_0xb587('0x3f')](_0xb587('0x62'),_0x2c596a[_0xb587('0x5b')],_0x2aad11[_0xb587('0x63')],md5(_0x2aad11[_0xb587('0x63')]));}else{_0x2aad11[_0xb587('0x61')]='';}return getConnection(_0x2c596a)[_0xb587('0x1d')](function(_0x55d022){_0xac40fc=_0x55d022;return getUser(_0x2c596a,_0x34f3fe[_0xb587('0x64')],_0xac40fc);})[_0xb587('0x1d')](function(_0x2a7cf0){_0x21c94b=_0x2a7cf0;return getEndUser(_0x2c596a,_0x8c7e8c,_0x2aad11[_0xb587('0x65')],_0x2aad11[_0xb587('0x66')],_0xac40fc);})[_0xb587('0x1d')](function(_0x130e7c){_0x264a07=_0x130e7c;return getTicket(_0x2c596a,_0x21c94b,_0x264a07,_0x8c7e8c,_0x2aad11,_0x8c7e8c[_0xb587('0x67')],_0xac40fc,_0xb587('0x5a'));})['then'](function(_0x395db3){_0x39c43b=_0x395db3;logger[_0xb587('0x20')](_0xb587('0x68'),_0x39c43b['id']);logger[_0xb587('0x20')](_0xb587('0x69'),_0x39c43b['id'],_0x34f3fe[_0xb587('0x50')],_0x2c596a[_0xb587('0x38')]);switch(_0x2c596a[_0xb587('0x38')]){case _0xb587('0x6a'):emit(util[_0xb587('0x3f')]('user:%s',_0x34f3fe['name']),_0xb587('0x6b'),{'recordId':_0x39c43b['id']});break;case _0xb587('0x6c'):emit(util[_0xb587('0x3f')]('user:%s',_0x34f3fe[_0xb587('0x50')]),'trigger:browser:url',{'uri':util['format'](_0xb587('0x6d'),_0xac40fc[_0xb587('0x6e')],_0x39c43b['id'])});break;default:logger[_0xb587('0x6f')](_0xb587('0x70'));}})[_0xb587('0x71')](function(_0x1569d3){logger[_0xb587('0x6f')](_0xb587('0x5f'),_0x1569d3);});};exports[_0xb587('0x72')]=function(_0x25e8da,_0x54976b,_0x1de409,_0x36c66e,_0x387733,_0x552899,_0x4a592a){var _0x25a84a,_0x218b81,_0x2277f4,_0x124a79;_0x552899[_0xb587('0x5b')]=intUtil[_0xb587('0x5d')](_0x552899['serverUrl']);_0x552899['remoteUri']=intUtil[_0xb587('0x5d')](_0x552899['remoteUri']);if(_0x4a592a&&_0x4a592a[_0xb587('0x73')]&&_0x4a592a[_0xb587('0x73')]!==_0xb587('0x74')){logger[_0xb587('0x20')]('[OUTBOUND]',_0xb587('0x60'));_0x54976b[_0xb587('0x61')]=util[_0xb587('0x3f')](_0xb587('0x62'),_0x552899[_0xb587('0x5b')],_0x54976b['uniqueid'],md5(_0x54976b[_0xb587('0x63')]));}return getConnection(_0x552899)[_0xb587('0x1d')](function(_0x88a8df){_0x124a79=_0x88a8df;return getUser(_0x552899,_0x36c66e[_0xb587('0x64')],_0x124a79);})['then'](function(_0x2b9726){_0x25a84a=_0x2b9726;return getEndUser(_0x552899,_0x1de409,_0x54976b[_0xb587('0x75')],_0x54976b['destcalleridnum'],_0x124a79);})[_0xb587('0x1d')](function(_0x29da3b){_0x218b81=_0x29da3b;return getTicket(_0x552899,_0x25a84a,_0x218b81,_0x1de409,_0x54976b,_0x1de409[_0xb587('0x67')],_0x124a79,'outbound');})[_0xb587('0x1d')](function(_0x4f5009){_0x2277f4=_0x4f5009;logger['info']('[OUTBOUND]\x20Ticket\x20%s\x20created.',_0x2277f4['id']);logger[_0xb587('0x20')]('[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x2277f4['id'],_0x36c66e[_0xb587('0x50')],_0x552899[_0xb587('0x38')]);switch(_0x552899['type']){case'integrationTab':emit(util['format'](_0xb587('0x76'),_0x36c66e[_0xb587('0x50')]),_0xb587('0x6b'),{'recordId':_0x2277f4['id']});break;case _0xb587('0x6c'):emit(util[_0xb587('0x3f')](_0xb587('0x76'),_0x36c66e[_0xb587('0x50')]),_0xb587('0x77'),{'uri':util['format'](_0xb587('0x6d'),_0x124a79[_0xb587('0x6e')],_0x2277f4['id'])});break;default:logger['error'](_0xb587('0x78'),'Salesforce\x20account\x20type\x20not\x20recognized');}})['catch'](function(_0x1da5e6){logger[_0xb587('0x6f')]('[OUTBOUND]',_0x1da5e6);});};exports[_0xb587('0x79')]=function(_0x3312c4,_0x3b528c,_0xd9d662,_0x1ff68c,_0x42d2e5,_0x443e35){var _0x1c6abf,_0x4ad5a3,_0x2f7903,_0x139245;_0x443e35[_0xb587('0x5b')]=intUtil[_0xb587('0x5d')](_0x443e35['serverUrl']);_0x443e35[_0xb587('0x5c')]=intUtil[_0xb587('0x5d')](_0x443e35[_0xb587('0x5c')]);if(_0x42d2e5&&_0x42d2e5['monitor_format']){logger[_0xb587('0x20')]('['+_0x3b528c['lastevent'][_0xb587('0x7a')]()+']',_0xb587('0x60'));_0x3b528c[_0xb587('0x61')]=util[_0xb587('0x3f')](_0xb587('0x62'),_0x443e35[_0xb587('0x5b')],_0x3b528c['uniqueid'],md5(_0x3b528c[_0xb587('0x63')]));}else{_0x3b528c['recordingURL']='';}return getConnection(_0x443e35)['then'](function(_0x512e19){_0x139245=_0x512e19;if(!_['isNil'](_0x1ff68c)){return getUser(_0x443e35,_0x1ff68c[_0xb587('0x50')],_0x139245);}else{return getUser(_0x443e35,null,_0x139245);}})['then'](function(_0x597750){_0x1c6abf=_0x597750;return getEndUser(_0x443e35,_0xd9d662,_0x3b528c['calleridname'],_0x3b528c['calleridnum'],_0x139245);})[_0xb587('0x1d')](function(_0x68719){_0x4ad5a3=_0x68719;return getTicket(_0x443e35,_0x1c6abf,_0x4ad5a3,_0xd9d662,_0x3b528c,_0xd9d662[_0xb587('0x67')],_0x139245);})[_0xb587('0x1d')](function(_0x271f56){_0x2f7903=_0x271f56;logger['info']('['+_0x3b528c['lastevent'][_0xb587('0x7a')]()+_0xb587('0x7b'),_0x2f7903['id']);logger[_0xb587('0x20')]('['+_0x3b528c[_0xb587('0x7c')]['toUpperCase']()+_0xb587('0x7d'),_0x443e35[_0xb587('0x38')]);})[_0xb587('0x71')](function(_0x5c4afe){logger['error']('['+_0x3b528c['lastevent'][_0xb587('0x7a')]()+']',_0x5c4afe);});}; \ 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 a6f8e9f..2344880 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 _0x2adc=['message','],\x20getUser\x20input\x20crm','validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','info','],\x20getUser\x20entity','active','true','userId','adminEmail','catch',']\x20using\x20admin\x20profile','POST','sys_user?','endUserNumber','],\x20EndUser\x20schema','endUserId','sys_user?sysparm_query=phone%3D','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','length','includes','string','picklist','nameField','customField','toLowerCase','content','type','idField','toString','variable','variableName','Variable','name',']\x20getTicket\x20input\x20crm','outbound','incident','getString','Subjects','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema','number','label','?sysparm_query=name%3D','label_entry','Incident','ticketId','Incident\x20-\x20','ticketNumber','forEach','push',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','all','Tags','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','emit','trigger:browser:url','password','sysparm_limit=1','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]','recordingURL','recordingFormat','none','[OUTBOUND]','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20ServiceNow\x20integration','inspect','lodash','bluebird','request-promise','util','ioredis','./util','../../../../config/environment','../../../../config/logger','servicenow','redis','defaults','localhost','GET','sys_user?sysparm_query=user_name%3Dadmin','then','result','adminId','sys_id','toUpperCase','],\x20getAdminUser\x20crm','error'];(function(_0x3f3053,_0x3940c9){var _0x105221=function(_0x98d89){while(--_0x98d89){_0x3f3053['push'](_0x3f3053['shift']());}};_0x105221(++_0x3940c9);}(_0x2adc,0x141));var _0xc2ad=function(_0x14c72f,_0x785db0){_0x14c72f=_0x14c72f-0x0;var _0x4312c5=_0x2adc[_0x14c72f];return _0x4312c5;};'use strict';var _=require(_0xc2ad('0x0'));var Promise=require(_0xc2ad('0x1'));var rp=require(_0xc2ad('0x2'));var util=require(_0xc2ad('0x3'));var md5=require('md5');var Redis=require(_0xc2ad('0x4'));var intUtil=require(_0xc2ad('0x5'));var config=require(_0xc2ad('0x6'));var logger=require(_0xc2ad('0x7'))(_0xc2ad('0x8'));config[_0xc2ad('0x9')]=_[_0xc2ad('0xa')](config['redis'],{'host':_0xc2ad('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function getAdminUser(_0x16cd2c,_0x41c621,_0x5b61ff,_0x5a887a,_0x32a241,_0x387be2){return new Promise(function(_0x2d9342,_0x1d077e){var _0x4b03fa={'method':_0xc2ad('0xc'),'uri':_0x5a887a+_0xc2ad('0xd')+'&'+_0x32a241+'&'+_0x387be2,'auth':_0x41c621,'json':!![]};return rp(_0x4b03fa)[_0xc2ad('0xe')](function(_0xcc8fd5){if(_0xcc8fd5[_0xc2ad('0xf')]['length']>0x0){_0x5b61ff[_0xc2ad('0x10')]=_0xcc8fd5[_0xc2ad('0xf')][0x0][_0xc2ad('0x11')];}logger['info']('['+[_0x16cd2c[_0xc2ad('0x12')]()]+_0xc2ad('0x13'),_0x5b61ff);_0x2d9342(_0x5b61ff);})['catch'](function(_0x5f1234){logger[_0xc2ad('0x14')]('['+[_0x16cd2c['toUpperCase']()]+']',_0x5f1234['message']);_0x1d077e(_0x5f1234[_0xc2ad('0x15')]);});});}function getUser(_0x5e7689,_0xa15ca7,_0xdd5473,_0x217745,_0x57abdb){return function(_0x484ae0){logger['info']('['+[_0x5e7689['toUpperCase']()]+_0xc2ad('0x16'),_0x484ae0);return new Promise(function(_0x4bba47,_0x55dcc9){if(intUtil[_0xc2ad('0x17')](_0x484ae0[_0xc2ad('0x18')])){var _0x1fd3fe={'method':'GET','uri':_0xdd5473+_0xc2ad('0x19')+_0x484ae0[_0xc2ad('0x18')]+'&'+_0x217745+'&'+_0x57abdb,'auth':_0xa15ca7,'json':!![]};logger['info']('['+[_0x5e7689[_0xc2ad('0x12')]()]+_0xc2ad('0x1a'),_0x1fd3fe);return rp(_0x1fd3fe)[_0xc2ad('0xe')](function(_0x50ffa9){logger[_0xc2ad('0x1b')]('['+[_0x5e7689[_0xc2ad('0x12')]()]+_0xc2ad('0x1c'),_0x50ffa9);if(_0x50ffa9[_0xc2ad('0xf')]['length']>0x0&&String(_0x50ffa9[_0xc2ad('0xf')][0x0][_0xc2ad('0x1d')])===_0xc2ad('0x1e')){_0x484ae0['userId']=_0x50ffa9[_0xc2ad('0xf')][0x0][_0xc2ad('0x11')];}else{_0x484ae0[_0xc2ad('0x1f')]=_0x484ae0[_0xc2ad('0x10')];_0x484ae0['userEmail']=_0x484ae0[_0xc2ad('0x20')];}logger['info']('['+[_0x5e7689[_0xc2ad('0x12')]()]+'],\x20getUser\x20crm',_0x484ae0);_0x4bba47(_0x484ae0);})[_0xc2ad('0x21')](function(_0xe58e52){logger[_0xc2ad('0x14')]('['+[_0x5e7689[_0xc2ad('0x12')]()]+']',_0xe58e52[_0xc2ad('0x15')]);_0x55dcc9(_0xe58e52['message']);});}else{logger['info']('['+[_0x5e7689[_0xc2ad('0x12')]()]+_0xc2ad('0x22'));_0x484ae0['userId']=_0x484ae0[_0xc2ad('0x10')];_0x484ae0[_0xc2ad('0x18')]=_0x484ae0[_0xc2ad('0x20')];_0x4bba47(_0x484ae0);}});};}function createEndUser(_0x86c2c2,_0x2beb47,_0x4e1505,_0x2eca5b,_0x5d6f20){logger[_0xc2ad('0x1b')]('['+[_0x86c2c2['toUpperCase']()]+'],\x20createEndUser\x20input\x20crm',_0x4e1505);return new Promise(function(_0x22854c,_0x43e030){var _0x4c9177={'method':_0xc2ad('0x23'),'uri':_0x2eca5b+_0xc2ad('0x24')+_0x5d6f20,'body':{'user_name':_0x4e1505[_0xc2ad('0x25')],'roles':'user','first_name':_0x4e1505[_0xc2ad('0x25')],'active':_0xc2ad('0x1e'),'date_format':'System','phone':_0x4e1505[_0xc2ad('0x25')]},'auth':_0x2beb47,'json':!![]};return rp(_0x4c9177)['then'](function(_0x513500){logger[_0xc2ad('0x1b')]('['+[_0x86c2c2[_0xc2ad('0x12')]()]+_0xc2ad('0x26'),_0x513500[_0xc2ad('0xf')]);_0x4e1505[_0xc2ad('0x27')]=_0x513500[_0xc2ad('0xf')]['sys_id'];_0x22854c(_0x4e1505);})[_0xc2ad('0x21')](function(_0x1033ec){logger[_0xc2ad('0x14')]('['+[_0x86c2c2[_0xc2ad('0x12')]()]+']',_0x1033ec[_0xc2ad('0x15')]);_0x43e030(_0x1033ec['message']);});});}function getEndUser(_0x28af3c,_0x3ed2b8,_0xf40acc,_0x1f18ae,_0x395eb4){return function(_0x248b41){logger['info']('['+[_0x28af3c[_0xc2ad('0x12')]()]+'],\x20getEndUser\x20input\x20crm',_0x248b41);return new Promise(function(_0x22eda1,_0xec53dc){var _0x15300a={'method':_0xc2ad('0xc'),'uri':_0xf40acc+_0xc2ad('0x28')+_0x248b41['endUserNumber']+'&'+_0x1f18ae+'&'+_0x395eb4,'auth':_0x3ed2b8,'json':!![]};return rp(_0x15300a)[_0xc2ad('0xe')](function(_0x22ad99){if(_0x22ad99[_0xc2ad('0xf')]['length']>0x0){_0x248b41[_0xc2ad('0x27')]=_0x22ad99['result'][0x0][_0xc2ad('0x11')];logger['info']('['+[_0x28af3c['toUpperCase']()]+_0xc2ad('0x29'),_0x248b41);_0x22eda1(_0x248b41);}else{return createEndUser(_0x28af3c,_0x3ed2b8,_0x248b41,_0xf40acc,_0x1f18ae)[_0xc2ad('0xe')](function(_0x1250e3){logger['info']('['+[_0x28af3c[_0xc2ad('0x12')]()]+_0xc2ad('0x2a'),_0x1250e3);_0x22eda1(_0x1250e3);});}})['catch'](function(_0x3db575){logger[_0xc2ad('0x14')]('['+[_0x28af3c[_0xc2ad('0x12')]()]+']',_0x3db575[_0xc2ad('0x15')]);_0xec53dc(_0x3db575[_0xc2ad('0x15')]);});});};}function getCustomFields(_0x3752b0,_0x3a17a0){var _0x19b20d={};if(_0x3752b0[_0xc2ad('0x2b')]>0x0){_['forEach'](_0x3752b0,function(_0x4a43d0){if(_[_0xc2ad('0x2c')]([_0xc2ad('0x2d'),_0xc2ad('0x2e')],_0x4a43d0['type'])&&_0x4a43d0[_0xc2ad('0x2f')]&&!_0x4a43d0[_0xc2ad('0x30')]){_0x19b20d[_0x4a43d0[_0xc2ad('0x2f')][_0xc2ad('0x31')]()]=_0x4a43d0[_0xc2ad('0x32')]['toString']();}else if(_[_0xc2ad('0x2c')]([_0xc2ad('0x2d'),_0xc2ad('0x2e')],_0x4a43d0[_0xc2ad('0x33')])&&_0x4a43d0[_0xc2ad('0x34')]&&_0x4a43d0['customField']){_0x19b20d[_0x4a43d0['idField'][_0xc2ad('0x31')]()]=_0x4a43d0[_0xc2ad('0x32')][_0xc2ad('0x35')]();}else if(_0x4a43d0[_0xc2ad('0x33')]===_0xc2ad('0x36')&&_0x4a43d0[_0xc2ad('0x37')]&&_0x4a43d0[_0xc2ad('0x34')]&&_0x4a43d0['customField']){_0x19b20d[_0x4a43d0[_0xc2ad('0x34')][_0xc2ad('0x31')]()]=_0x3a17a0[_0x4a43d0['variableName']][_0xc2ad('0x35')]();}else if(_0x4a43d0[_0xc2ad('0x33')]==='customVariable'&&_0x4a43d0[_0xc2ad('0x38')]&&_0x4a43d0[_0xc2ad('0x38')][_0xc2ad('0x39')]&&_0x4a43d0[_0xc2ad('0x34')]&&_0x4a43d0[_0xc2ad('0x30')]){_0x19b20d[_0x4a43d0[_0xc2ad('0x34')]['toLowerCase']()]=_0x3a17a0[_0x4a43d0[_0xc2ad('0x38')][_0xc2ad('0x39')]['toLowerCase']()]['toString']();}});}return _0x19b20d;}function getTicket(_0x36b21a,_0x2d5636,_0x457eca,_0x7dbe98,_0x4b8a29,_0x269b32){return function(_0x24f4ea){logger[_0xc2ad('0x1b')]('['+[_0x36b21a[_0xc2ad('0x12')]()]+_0xc2ad('0x3a'),_0x24f4ea);return new Promise(function(_0x58d3db,_0x4e5b94){var _0x237f56=_0x36b21a[_0xc2ad('0x31')]()===_0xc2ad('0x3b')?_0x24f4ea[_0xc2ad('0x1f')]:_0x24f4ea['endUserId'];var _0x157c77={'method':'POST','uri':_0x457eca+_0xc2ad('0x3c')+'?'+_0x269b32,'body':Object['assign']({},{'active':_0xc2ad('0x1e'),'caller_id':_0x237f56,'assigned_to':_0x24f4ea[_0xc2ad('0x1f')],'short_description':intUtil[_0xc2ad('0x3d')](_0x7dbe98[_0xc2ad('0x3e')],_0x4b8a29,'\x20'),'description':intUtil['getString'](_0x7dbe98[_0xc2ad('0x3f')],_0x4b8a29,'\x0a')},getCustomFields(_0x7dbe98[_0xc2ad('0x40')],_0x4b8a29)),'auth':_0x2d5636,'json':!![]};return rp(_0x157c77)[_0xc2ad('0xe')](function(_0x5f4c9c){logger[_0xc2ad('0x1b')]('['+[_0x36b21a[_0xc2ad('0x12')]()]+_0xc2ad('0x41'),_0x5f4c9c[_0xc2ad('0xf')]);_0x24f4ea['ticketId']=_0x5f4c9c[_0xc2ad('0xf')][_0xc2ad('0x11')];_0x24f4ea['ticketNumber']=_0x5f4c9c['result'][_0xc2ad('0x42')];logger['info']('['+[_0x36b21a[_0xc2ad('0x12')]()]+']\x20getTicket\x20crm',_0x24f4ea);_0x58d3db(_0x24f4ea);})[_0xc2ad('0x21')](function(_0x3d2e23){logger['error']('['+[_0x36b21a[_0xc2ad('0x12')]()]+']',_0x3d2e23[_0xc2ad('0x15')]);_0x4e5b94(_0x3d2e23[_0xc2ad('0x15')]);});});};}function createRemoteTag(_0x3a70ae,_0x3def7c,_0x224a6f,_0x2a88b4){return new Promise(function(_0x40e3f3,_0x276a9c){var _0x59d832={'method':'POST','uri':_0x224a6f+_0xc2ad('0x43')+'?'+_0x2a88b4,'body':{'short_description':_0x3a70ae,'global':!![],'active':!![],'name':_0x3a70ae},'auth':_0x3def7c,'json':!![]};return rp(_0x59d832)['then'](function(_0x5614e5){var _0x579a71=_0x5614e5[_0xc2ad('0xf')][_0xc2ad('0x11')];_0x40e3f3(_0x579a71);});});}function getRemoteTag(_0x20a074,_0x126698,_0x382b8d,_0x2de43e,_0x594896){return new Promise(function(_0x199330,_0x38890f){var _0x4fad22={'method':_0xc2ad('0xc'),'uri':_0x382b8d+'label'+_0xc2ad('0x44')+_0x20a074+'&'+_0x2de43e,'auth':_0x126698,'json':!![]};return rp(_0x4fad22)[_0xc2ad('0xe')](function(_0x505043){if(_0x505043[_0xc2ad('0xf')]['length']>0x0){var _0x28f9ae=_0x505043['result'][0x0][_0xc2ad('0x11')];_0x199330(_0x28f9ae);}else{return createRemoteTag(_0x20a074,_0x126698,_0x382b8d,_0x2de43e)[_0xc2ad('0xe')](function(_0x482854){_0x199330(_0x482854);});}});});}function assignTagToIncident(_0x3c11fe,_0x36c95f,_0x1d7a96,_0x27058d,_0x41e31e){return new Promise(function(_0x5d8304,_0x6aefaf){var _0x17d8fb={'method':_0xc2ad('0x23'),'uri':_0x1d7a96+_0xc2ad('0x45')+'?'+_0x41e31e,'body':{'label':_0x3c11fe,'table':'incident','id_type':_0xc2ad('0x46'),'table_key':_0x27058d[_0xc2ad('0x47')],'title':_0xc2ad('0x48')+_0x27058d['ticketNumber'],'id_display':_0x27058d[_0xc2ad('0x49')]},'auth':_0x36c95f,'json':!![]};return rp(_0x17d8fb)['then'](function(_0x130788){_0x5d8304();})[_0xc2ad('0x21')](function(){_0x5d8304();});});}function manageTags(_0x1e2774,_0x32e059,_0x18d616,_0x5e4dc8,_0x4a93a5,_0x509847,_0x15addd){return new Promise(function(_0x4c6ba4,_0x210acc){var _0x3fbebc=[];_0x32e059[_0xc2ad('0x4a')](function(_0x4d4a2e){_0x3fbebc[_0xc2ad('0x4b')](getRemoteTag(_0x4d4a2e,_0x18d616,_0x5e4dc8,_0x509847,_0x15addd));});return Promise['all'](_0x3fbebc)[_0xc2ad('0xe')](function(_0x24919a){if(_0x24919a[_0xc2ad('0x2b')]){logger[_0xc2ad('0x1b')]('['+[_0x1e2774[_0xc2ad('0x12')]()]+_0xc2ad('0x4c'),_0x24919a);var _0x5df806=[];_0x24919a['forEach'](function(_0x10179d){_0x5df806['push'](assignTagToIncident(_0x10179d,_0x18d616,_0x5e4dc8,_0x4a93a5,_0x509847));});return Promise[_0xc2ad('0x4d')](_0x5df806)['then'](function(){_0x4c6ba4();})[_0xc2ad('0x21')](function(){_0x4c6ba4();});}else{_0x4c6ba4();}});});}function getTags(_0x3d1c9e,_0x2ede3a,_0x3783bc,_0x3eb102,_0x2611ed,_0x212e5f){return function(_0x54665a){return new Promise(function(_0x5d0502,_0x100de0){var _0x36ecea=[];var _0x37d3e2=_0x3eb102[_0xc2ad('0x4e')];if(_0x37d3e2&&_0x37d3e2[_0xc2ad('0x2b')]>0x0){_0x36ecea=_['map'](_0x37d3e2,_0xc2ad('0x39'));}if(_0x36ecea[_0xc2ad('0x2b')]>0x0){return manageTags(_0x3d1c9e,_0x36ecea,_0x2ede3a,_0x3783bc,_0x54665a,_0x2611ed,_0x212e5f)['then'](function(){_0x5d0502(_0x54665a);});}else{_0x5d0502(_0x54665a);}});};}function emit(_0x27d23d,_0x5940d2,_0x50babf){var _0x3001e4=_0xc2ad('0x4f')+_0xc2ad('0x50')+_0xc2ad('0x51')+_0xc2ad('0x52');var _0x4379fc={'uri':_0x27d23d+_0xc2ad('0x53')+_0x50babf+_0x3001e4};io['to'](util[_0xc2ad('0x54')](_0xc2ad('0x55'),_0x5940d2))[_0xc2ad('0x56')](_0xc2ad('0x57'),_0x4379fc);}exports['cs']=function(_0x26f37f,_0x399d07,_0x2b9b15,_0x2d8914,_0x2573f3,_0x1824e6,_0x3aee85,_0x4c3484){var _0xcf13f4={};var _0x205e6e={'user':_0x1824e6['username'],'pass':_0x1824e6[_0xc2ad('0x58')]};var _0x52190e=_0xc2ad('0x59');var _0x39857b=_0xc2ad('0x5a');_0x1824e6[_0xc2ad('0x5b')]=intUtil[_0xc2ad('0x5c')](_0x1824e6[_0xc2ad('0x5b')]);_0x1824e6[_0xc2ad('0x5d')]=intUtil[_0xc2ad('0x5c')](_0x1824e6['serverUrl']);var _0x40bd86=util[_0xc2ad('0x54')](_0xc2ad('0x5e'),_0x1824e6[_0xc2ad('0x5b')]);_0xcf13f4[_0xc2ad('0x18')]=!_[_0xc2ad('0x5f')](_0x2d8914)?_0x2d8914[_0xc2ad('0x60')]:null;_0xcf13f4[_0xc2ad('0x20')]=_0x1824e6[_0xc2ad('0x60')];_0xcf13f4[_0xc2ad('0x25')]=_0x4c3484[_0xc2ad('0x31')]()===_0xc2ad('0x3b')?_0x399d07[_0xc2ad('0x61')]:_0x399d07[_0xc2ad('0x62')];_0xcf13f4[_0xc2ad('0x63')]=_0x4c3484===_0xc2ad('0x64')||_0x4c3484===_0xc2ad('0x65')?_0xc2ad('0x64'):_0xc2ad('0x3b');var _0x364dcc=util['format'](_0xc2ad('0x66'),_0x1824e6[_0xc2ad('0x5d')],_0x399d07['uniqueid'],md5(_0x399d07[_0xc2ad('0x67')]));if(_0x2573f3&&_0x2573f3[_0xc2ad('0x68')]){logger[_0xc2ad('0x1b')](_0xc2ad('0x69'),'Recording\x20is\x20enabled!');_0x399d07[_0xc2ad('0x6a')]=_0x364dcc;}else if(_0x3aee85&&_0x3aee85[_0xc2ad('0x6b')]&&_0x3aee85[_0xc2ad('0x6b')]!==_0xc2ad('0x6c')){logger[_0xc2ad('0x1b')](_0xc2ad('0x6d'),'Recording\x20is\x20enabled!');_0x399d07[_0xc2ad('0x6a')]=_0x364dcc;}else{_0x399d07[_0xc2ad('0x6a')]='';}return getAdminUser(_0x4c3484,_0x205e6e,_0xcf13f4,_0x40bd86,_0x39857b,_0x52190e)[_0xc2ad('0xe')](getUser(_0x4c3484,_0x205e6e,_0x40bd86,_0x39857b,_0x52190e))[_0xc2ad('0xe')](getEndUser(_0x4c3484,_0x205e6e,_0x40bd86,_0x39857b,_0x52190e))[_0xc2ad('0xe')](getTicket(_0x4c3484,_0x205e6e,_0x40bd86,_0x2b9b15,_0x399d07,_0x39857b))['then'](function(_0x2b98d3){logger[_0xc2ad('0x1b')](util[_0xc2ad('0x54')](_0xc2ad('0x6e'),_0x2b98d3[_0xc2ad('0x47')]));logger[_0xc2ad('0x1b')](util['format']('call\x20direction:\x20%s',_0x4c3484));if(_0x4c3484!==_0xc2ad('0x65')){logger[_0xc2ad('0x1b')]('['+[_0x4c3484[_0xc2ad('0x12')]()]+']',_0xc2ad('0x6f'));emit(_0x1824e6['remoteUri'],_0x2d8914['name'],_0x2b98d3[_0xc2ad('0x47')]);}})[_0xc2ad('0x21')](function(_0x55b00e){logger[_0xc2ad('0x14')]('['+[_0x4c3484[_0xc2ad('0x12')]()]+_0xc2ad('0x70'),util[_0xc2ad('0x71')](_0x55b00e,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x8373=['],\x20createEndUser\x20crm','string','type','nameField','toString','idField','customField','content','variableName','toLowerCase','customVariable','Variable','name',']\x20getTicket\x20input\x20crm','outbound','assign','getString','Subjects','Descriptions','Fields','ticketId','ticketNumber','number',']\x20getTicket\x20crm','label','?sysparm_query=name%3D','label_entry','incident','Incident','Incident\x20-\x20','forEach','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','push','%26sysparm_record_target%3Dincident','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','emit','username','sysparm_limit=1','remoteUri','stripTrailingSlash','serverUrl','%s/api/now/table/','isNil','email','destcalleridnum','callDirection','unmanaged','queue','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','none','recordingURL','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','lodash','bluebird','request-promise','util','ioredis','./util','../../../../config/environment','../../../../config/logger','servicenow','redis','defaults','socket.io-emitter','sys_user?sysparm_query=user_name%3Dadmin','then','result','sys_id','info','error','toUpperCase','message','],\x20getUser\x20input\x20crm','validateEmail','userEmail','GET','sys_user?sysparm_query=email%3D','length','active','true','userId','adminId','adminEmail','catch',']\x20using\x20admin\x20profile','],\x20createEndUser\x20input\x20crm','POST','sys_user?','endUserNumber','user','],\x20EndUser\x20schema','endUserId','sys_user?sysparm_query=phone%3D'];(function(_0x1f1cc7,_0x26f365){var _0x5f49e9=function(_0x45c75a){while(--_0x45c75a){_0x1f1cc7['push'](_0x1f1cc7['shift']());}};_0x5f49e9(++_0x26f365);}(_0x8373,0x1da));var _0x3837=function(_0x3d4db8,_0x2adc70){_0x3d4db8=_0x3d4db8-0x0;var _0x1d56dc=_0x8373[_0x3d4db8];return _0x1d56dc;};'use strict';var _=require(_0x3837('0x0'));var Promise=require(_0x3837('0x1'));var rp=require(_0x3837('0x2'));var util=require(_0x3837('0x3'));var md5=require('md5');var Redis=require(_0x3837('0x4'));var intUtil=require(_0x3837('0x5'));var config=require(_0x3837('0x6'));var logger=require(_0x3837('0x7'))(_0x3837('0x8'));config[_0x3837('0x9')]=_[_0x3837('0xa')](config[_0x3837('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0x3837('0xb'))(new Redis(config[_0x3837('0x9')]));function getAdminUser(_0x2dc7f2,_0x8bd8a8,_0x7aa5d8,_0x5ebcae,_0x4bf2ab,_0x5bc8a8){return new Promise(function(_0x3772fe,_0xc2e708){var _0x1c2381={'method':'GET','uri':_0x5ebcae+_0x3837('0xc')+'&'+_0x4bf2ab+'&'+_0x5bc8a8,'auth':_0x8bd8a8,'json':!![]};return rp(_0x1c2381)[_0x3837('0xd')](function(_0x523da2){if(_0x523da2[_0x3837('0xe')]['length']>0x0){_0x7aa5d8['adminId']=_0x523da2[_0x3837('0xe')][0x0][_0x3837('0xf')];}logger[_0x3837('0x10')]('['+[_0x2dc7f2['toUpperCase']()]+'],\x20getAdminUser\x20crm',_0x7aa5d8);_0x3772fe(_0x7aa5d8);})['catch'](function(_0x391049){logger[_0x3837('0x11')]('['+[_0x2dc7f2[_0x3837('0x12')]()]+']',_0x391049[_0x3837('0x13')]);_0xc2e708(_0x391049[_0x3837('0x13')]);});});}function getUser(_0x4da442,_0x2cfc2b,_0x3ee66b,_0x11f653,_0x2897d6){return function(_0x111eb4){logger['info']('['+[_0x4da442[_0x3837('0x12')]()]+_0x3837('0x14'),_0x111eb4);return new Promise(function(_0x820b1d,_0x2ef821){if(intUtil[_0x3837('0x15')](_0x111eb4[_0x3837('0x16')])){var _0x42baa5={'method':_0x3837('0x17'),'uri':_0x3ee66b+_0x3837('0x18')+_0x111eb4['userEmail']+'&'+_0x11f653+'&'+_0x2897d6,'auth':_0x2cfc2b,'json':!![]};logger[_0x3837('0x10')]('['+[_0x4da442[_0x3837('0x12')]()]+'],\x20getUser\x20rp\x20obj',_0x42baa5);return rp(_0x42baa5)[_0x3837('0xd')](function(_0x1602f5){logger[_0x3837('0x10')]('['+[_0x4da442[_0x3837('0x12')]()]+'],\x20getUser\x20entity',_0x1602f5);if(_0x1602f5['result'][_0x3837('0x19')]>0x0&&String(_0x1602f5[_0x3837('0xe')][0x0][_0x3837('0x1a')])===_0x3837('0x1b')){_0x111eb4[_0x3837('0x1c')]=_0x1602f5['result'][0x0][_0x3837('0xf')];}else{_0x111eb4[_0x3837('0x1c')]=_0x111eb4[_0x3837('0x1d')];_0x111eb4[_0x3837('0x16')]=_0x111eb4[_0x3837('0x1e')];}logger['info']('['+[_0x4da442[_0x3837('0x12')]()]+'],\x20getUser\x20crm',_0x111eb4);_0x820b1d(_0x111eb4);})[_0x3837('0x1f')](function(_0x55a8e2){logger['error']('['+[_0x4da442[_0x3837('0x12')]()]+']',_0x55a8e2[_0x3837('0x13')]);_0x2ef821(_0x55a8e2[_0x3837('0x13')]);});}else{logger[_0x3837('0x10')]('['+[_0x4da442[_0x3837('0x12')]()]+_0x3837('0x20'));_0x111eb4[_0x3837('0x1c')]=_0x111eb4[_0x3837('0x1d')];_0x111eb4[_0x3837('0x16')]=_0x111eb4['adminEmail'];_0x820b1d(_0x111eb4);}});};}function createEndUser(_0x35c8db,_0x163dfe,_0x2c6b19,_0x2b60d9,_0x1d5d30){logger['info']('['+[_0x35c8db['toUpperCase']()]+_0x3837('0x21'),_0x2c6b19);return new Promise(function(_0x4969ad,_0x7f78c2){var _0x510a25={'method':_0x3837('0x22'),'uri':_0x2b60d9+_0x3837('0x23')+_0x1d5d30,'body':{'user_name':_0x2c6b19[_0x3837('0x24')],'roles':_0x3837('0x25'),'first_name':_0x2c6b19[_0x3837('0x24')],'active':'true','date_format':'System','phone':_0x2c6b19[_0x3837('0x24')]},'auth':_0x163dfe,'json':!![]};return rp(_0x510a25)['then'](function(_0x7c50ee){logger[_0x3837('0x10')]('['+[_0x35c8db['toUpperCase']()]+_0x3837('0x26'),_0x7c50ee[_0x3837('0xe')]);_0x2c6b19[_0x3837('0x27')]=_0x7c50ee[_0x3837('0xe')][_0x3837('0xf')];_0x4969ad(_0x2c6b19);})[_0x3837('0x1f')](function(_0x1a9298){logger[_0x3837('0x11')]('['+[_0x35c8db[_0x3837('0x12')]()]+']',_0x1a9298['message']);_0x7f78c2(_0x1a9298[_0x3837('0x13')]);});});}function getEndUser(_0x1188ed,_0x51365e,_0x56f270,_0x4dbe86,_0x20a659){return function(_0x996b4c){logger[_0x3837('0x10')]('['+[_0x1188ed['toUpperCase']()]+'],\x20getEndUser\x20input\x20crm',_0x996b4c);return new Promise(function(_0x76959b,_0x10e807){var _0x239ba3={'method':_0x3837('0x17'),'uri':_0x56f270+_0x3837('0x28')+_0x996b4c[_0x3837('0x24')]+'&'+_0x4dbe86+'&'+_0x20a659,'auth':_0x51365e,'json':!![]};return rp(_0x239ba3)[_0x3837('0xd')](function(_0x18c111){if(_0x18c111[_0x3837('0xe')]['length']>0x0){_0x996b4c['endUserId']=_0x18c111[_0x3837('0xe')][0x0][_0x3837('0xf')];logger[_0x3837('0x10')]('['+[_0x1188ed[_0x3837('0x12')]()]+'],\x20getEndUser\x20crm',_0x996b4c);_0x76959b(_0x996b4c);}else{return createEndUser(_0x1188ed,_0x51365e,_0x996b4c,_0x56f270,_0x4dbe86)['then'](function(_0x54c808){logger[_0x3837('0x10')]('['+[_0x1188ed['toUpperCase']()]+_0x3837('0x29'),_0x54c808);_0x76959b(_0x54c808);});}})[_0x3837('0x1f')](function(_0x18288a){logger[_0x3837('0x11')]('['+[_0x1188ed[_0x3837('0x12')]()]+']',_0x18288a[_0x3837('0x13')]);_0x10e807(_0x18288a[_0x3837('0x13')]);});});};}function getCustomFields(_0x79dbd2,_0x21ae56){var _0xd05ff7={};if(_0x79dbd2[_0x3837('0x19')]>0x0){_['forEach'](_0x79dbd2,function(_0x175749){if(_['includes']([_0x3837('0x2a'),'picklist'],_0x175749[_0x3837('0x2b')])&&_0x175749[_0x3837('0x2c')]&&!_0x175749['customField']){_0xd05ff7[_0x175749[_0x3837('0x2c')]['toLowerCase']()]=_0x175749['content'][_0x3837('0x2d')]();}else if(_['includes'](['string','picklist'],_0x175749[_0x3837('0x2b')])&&_0x175749[_0x3837('0x2e')]&&_0x175749[_0x3837('0x2f')]){_0xd05ff7[_0x175749[_0x3837('0x2e')]['toLowerCase']()]=_0x175749[_0x3837('0x30')][_0x3837('0x2d')]();}else if(_0x175749[_0x3837('0x2b')]==='variable'&&_0x175749[_0x3837('0x31')]&&_0x175749[_0x3837('0x2e')]&&_0x175749['customField']){_0xd05ff7[_0x175749['idField'][_0x3837('0x32')]()]=_0x21ae56[_0x175749[_0x3837('0x31')]]['toString']();}else if(_0x175749[_0x3837('0x2b')]===_0x3837('0x33')&&_0x175749[_0x3837('0x34')]&&_0x175749[_0x3837('0x34')][_0x3837('0x35')]&&_0x175749[_0x3837('0x2e')]&&_0x175749[_0x3837('0x2f')]){_0xd05ff7[_0x175749['idField']['toLowerCase']()]=_0x21ae56[_0x175749['Variable'][_0x3837('0x35')][_0x3837('0x32')]()]['toString']();}});}return _0xd05ff7;}function getTicket(_0x5639a2,_0x429348,_0x2a077e,_0x3659f3,_0x58c5e3,_0x20eb4e){return function(_0x240c32){logger[_0x3837('0x10')]('['+[_0x5639a2[_0x3837('0x12')]()]+_0x3837('0x36'),_0x240c32);return new Promise(function(_0x31e429,_0x4d6df0){var _0x22a982=_0x5639a2[_0x3837('0x32')]()===_0x3837('0x37')?_0x240c32['userId']:_0x240c32['endUserId'];var _0x25c391={'method':'POST','uri':_0x2a077e+'incident'+'?'+_0x20eb4e,'body':Object[_0x3837('0x38')]({},{'active':_0x3837('0x1b'),'caller_id':_0x22a982,'assigned_to':_0x240c32['userId'],'short_description':intUtil[_0x3837('0x39')](_0x3659f3[_0x3837('0x3a')],_0x58c5e3,'\x20'),'description':intUtil['getString'](_0x3659f3[_0x3837('0x3b')],_0x58c5e3,'\x0a')},getCustomFields(_0x3659f3[_0x3837('0x3c')],_0x58c5e3)),'auth':_0x429348,'json':!![]};return rp(_0x25c391)[_0x3837('0xd')](function(_0x5a4793){logger['info']('['+[_0x5639a2[_0x3837('0x12')]()]+']\x20POST\x20incident\x20entity\x20schema',_0x5a4793[_0x3837('0xe')]);_0x240c32[_0x3837('0x3d')]=_0x5a4793[_0x3837('0xe')][_0x3837('0xf')];_0x240c32[_0x3837('0x3e')]=_0x5a4793[_0x3837('0xe')][_0x3837('0x3f')];logger[_0x3837('0x10')]('['+[_0x5639a2[_0x3837('0x12')]()]+_0x3837('0x40'),_0x240c32);_0x31e429(_0x240c32);})[_0x3837('0x1f')](function(_0x5b85f8){logger[_0x3837('0x11')]('['+[_0x5639a2[_0x3837('0x12')]()]+']',_0x5b85f8['message']);_0x4d6df0(_0x5b85f8[_0x3837('0x13')]);});});};}function createRemoteTag(_0x4d9588,_0x265413,_0x5927d3,_0x63f04d){return new Promise(function(_0x3585f2,_0xcd7344){var _0x2eabee={'method':_0x3837('0x22'),'uri':_0x5927d3+_0x3837('0x41')+'?'+_0x63f04d,'body':{'short_description':_0x4d9588,'global':!![],'active':!![],'name':_0x4d9588},'auth':_0x265413,'json':!![]};return rp(_0x2eabee)['then'](function(_0x1b3b35){var _0x47afa2=_0x1b3b35[_0x3837('0xe')][_0x3837('0xf')];_0x3585f2(_0x47afa2);});});}function getRemoteTag(_0x345239,_0x20e030,_0x25db0d,_0x2974f4,_0x57cd7a){return new Promise(function(_0x5ba20f,_0x2217dd){var _0x4503ed={'method':_0x3837('0x17'),'uri':_0x25db0d+_0x3837('0x41')+_0x3837('0x42')+_0x345239+'&'+_0x2974f4,'auth':_0x20e030,'json':!![]};return rp(_0x4503ed)[_0x3837('0xd')](function(_0x398b46){if(_0x398b46['result'][_0x3837('0x19')]>0x0){var _0x4c3ae9=_0x398b46['result'][0x0][_0x3837('0xf')];_0x5ba20f(_0x4c3ae9);}else{return createRemoteTag(_0x345239,_0x20e030,_0x25db0d,_0x2974f4)['then'](function(_0x2cbaae){_0x5ba20f(_0x2cbaae);});}});});}function assignTagToIncident(_0x332a46,_0x2f0d58,_0x4d7257,_0x380771,_0x48f362){return new Promise(function(_0x5068fe,_0x47752c){var _0x50261d={'method':_0x3837('0x22'),'uri':_0x4d7257+_0x3837('0x43')+'?'+_0x48f362,'body':{'label':_0x332a46,'table':_0x3837('0x44'),'id_type':_0x3837('0x45'),'table_key':_0x380771[_0x3837('0x3d')],'title':_0x3837('0x46')+_0x380771[_0x3837('0x3e')],'id_display':_0x380771[_0x3837('0x3e')]},'auth':_0x2f0d58,'json':!![]};return rp(_0x50261d)[_0x3837('0xd')](function(_0x5aad97){_0x5068fe();})[_0x3837('0x1f')](function(){_0x5068fe();});});}function manageTags(_0x353277,_0x28867d,_0x3ebb5e,_0x4bf612,_0x3e6089,_0x34b460,_0x4493d8){return new Promise(function(_0x249f01,_0x3d9e95){var _0x133023=[];_0x28867d[_0x3837('0x47')](function(_0xe3fd75){_0x133023['push'](getRemoteTag(_0xe3fd75,_0x3ebb5e,_0x4bf612,_0x34b460,_0x4493d8));});return Promise[_0x3837('0x48')](_0x133023)[_0x3837('0xd')](function(_0x4a9baa){if(_0x4a9baa[_0x3837('0x19')]){logger[_0x3837('0x10')]('['+[_0x353277['toUpperCase']()]+_0x3837('0x49'),_0x4a9baa);var _0xbdd67e=[];_0x4a9baa['forEach'](function(_0x1b5901){_0xbdd67e[_0x3837('0x4a')](assignTagToIncident(_0x1b5901,_0x3ebb5e,_0x4bf612,_0x3e6089,_0x34b460));});return Promise[_0x3837('0x48')](_0xbdd67e)[_0x3837('0xd')](function(){_0x249f01();})[_0x3837('0x1f')](function(){_0x249f01();});}else{_0x249f01();}});});}function getTags(_0x375168,_0x183fa8,_0x32dccc,_0x5a74da,_0x4123a9,_0x1e54ee){return function(_0x3b9975){return new Promise(function(_0x3bd2f1,_0x2579a9){var _0x2e4d6d=[];var _0x5d4e17=_0x5a74da['Tags'];if(_0x5d4e17&&_0x5d4e17[_0x3837('0x19')]>0x0){_0x2e4d6d=_['map'](_0x5d4e17,_0x3837('0x35'));}if(_0x2e4d6d[_0x3837('0x19')]>0x0){return manageTags(_0x375168,_0x2e4d6d,_0x183fa8,_0x32dccc,_0x3b9975,_0x4123a9,_0x1e54ee)[_0x3837('0xd')](function(){_0x3bd2f1(_0x3b9975);});}else{_0x3bd2f1(_0x3b9975);}});};}function emit(_0x392452,_0x35dd5b,_0xa8c1c9){var _0x16acc9=_0x3837('0x4b')+'%26sysparm_record_row%3D1%26sysparm_record_rows%3D39'+_0x3837('0x4c')+_0x3837('0x4d');var _0x153c0e={'uri':_0x392452+_0x3837('0x4e')+_0xa8c1c9+_0x16acc9};io['to'](util[_0x3837('0x4f')]('user:%s',_0x35dd5b))[_0x3837('0x50')]('trigger:browser:url',_0x153c0e);}exports['cs']=function(_0x50708a,_0x4e54b0,_0x5e41fb,_0x386f57,_0x1ff031,_0x1bd257,_0x35cef3,_0x1f3531){var _0x2289de={};var _0x2baf54={'user':_0x1bd257[_0x3837('0x51')],'pass':_0x1bd257['password']};var _0x3ca492=_0x3837('0x52');var _0xaa4d3c='sysparm_display_value=true';_0x1bd257[_0x3837('0x53')]=intUtil[_0x3837('0x54')](_0x1bd257[_0x3837('0x53')]);_0x1bd257[_0x3837('0x55')]=intUtil['stripTrailingSlash'](_0x1bd257[_0x3837('0x55')]);var _0x45df59=util[_0x3837('0x4f')](_0x3837('0x56'),_0x1bd257[_0x3837('0x53')]);_0x2289de[_0x3837('0x16')]=!_[_0x3837('0x57')](_0x386f57)?_0x386f57[_0x3837('0x58')]:null;_0x2289de[_0x3837('0x1e')]=_0x1bd257['email'];_0x2289de['endUserNumber']=_0x1f3531[_0x3837('0x32')]()==='outbound'?_0x4e54b0[_0x3837('0x59')]:_0x4e54b0['calleridnum'];_0x2289de[_0x3837('0x5a')]=_0x1f3531==='queue'||_0x1f3531===_0x3837('0x5b')?_0x3837('0x5c'):_0x3837('0x37');var _0x9fad51=util['format'](_0x3837('0x5d'),_0x1bd257[_0x3837('0x55')],_0x4e54b0[_0x3837('0x5e')],md5(_0x4e54b0[_0x3837('0x5e')]));if(_0x1ff031&&_0x1ff031['monitor_format']){logger[_0x3837('0x10')](_0x3837('0x5f'),_0x3837('0x60'));_0x4e54b0['recordingURL']=_0x9fad51;}else if(_0x35cef3&&_0x35cef3[_0x3837('0x61')]&&_0x35cef3[_0x3837('0x61')]!==_0x3837('0x62')){logger[_0x3837('0x10')]('[OUTBOUND]',_0x3837('0x60'));_0x4e54b0[_0x3837('0x63')]=_0x9fad51;}else{_0x4e54b0['recordingURL']='';}return getAdminUser(_0x1f3531,_0x2baf54,_0x2289de,_0x45df59,_0xaa4d3c,_0x3ca492)[_0x3837('0xd')](getUser(_0x1f3531,_0x2baf54,_0x45df59,_0xaa4d3c,_0x3ca492))[_0x3837('0xd')](getEndUser(_0x1f3531,_0x2baf54,_0x45df59,_0xaa4d3c,_0x3ca492))[_0x3837('0xd')](getTicket(_0x1f3531,_0x2baf54,_0x45df59,_0x5e41fb,_0x4e54b0,_0xaa4d3c))[_0x3837('0xd')](function(_0x1bdd6d){logger[_0x3837('0x10')](util[_0x3837('0x4f')](_0x3837('0x64'),_0x1bdd6d['ticketId']));logger[_0x3837('0x10')](util[_0x3837('0x4f')](_0x3837('0x65'),_0x1f3531));if(_0x1f3531!=='unmanaged'){logger[_0x3837('0x10')]('['+[_0x1f3531[_0x3837('0x12')]()]+']',_0x3837('0x66'));emit(_0x1bd257['remoteUri'],_0x386f57[_0x3837('0x35')],_0x1bdd6d[_0x3837('0x3d')]);}})[_0x3837('0x1f')](function(_0x4fdbec){logger[_0x3837('0x11')]('['+[_0x1f3531[_0x3837('0x12')]()]+']\x20Error\x20running\x20ServiceNow\x20integration',util['inspect'](_0x4fdbec,{'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 a7e6a07..1ffee0c 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 _0x1ea1=['set_entry','JSON','stringify','Calls','format','Basic\x20%s','toString','isNil','Getting\x20agent\x20with\x20name','get_entry_list','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','then','entry_list','name_value_list','value','Agent\x20found!','resolve','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Searching\x20enduser\x20with\x20phone','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','find','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','','Caller\x20-\x20%s','debug','[HTTP]','merge','type','string','customField','toLowerCase','content','custom_fields','customVariable','Variable','login','username','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','remoteUri','stripTrailingSlash','serverUrl','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','contacts','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','user:%s','trigger:browser:url','catch','outbound','uri','recordingFormat','[OUTBOUND]','destcalleridname','Outbound','users','version','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','error','unmanaged','lastevent','toUpperCase','calleridname','lodash','request-promise','bluebird','md5','util','ioredis','./util','../../../../config/logger','sugarcrm','redis','defaults','localhost','socket.io-emitter','POST','emit','info','Creating\x20new\x20ticket...','Subjects','created_by','description','getString','Descriptions','date_start','toISOString','slice','replace','duration_hours','duration_minutes','parent_id','parent_type','Contacts','parent_name','name','direction','length','forEach','variableName','push','idField'];(function(_0x2c6d9d,_0x2002ac){var _0xf72ead=function(_0x5b9a14){while(--_0x5b9a14){_0x2c6d9d['push'](_0x2c6d9d['shift']());}};_0xf72ead(++_0x2002ac);}(_0x1ea1,0x1cd));var _0x11ea=function(_0x5af875,_0x54386c){_0x5af875=_0x5af875-0x0;var _0x440ada=_0x1ea1[_0x5af875];return _0x440ada;};'use strict';var _=require(_0x11ea('0x0'));var rp=require(_0x11ea('0x1'));var BPromise=require(_0x11ea('0x2'));var md5=require(_0x11ea('0x3'));var util=require(_0x11ea('0x4'));var Redis=require(_0x11ea('0x5'));var intUtil=require(_0x11ea('0x6'));var config=require('../../../../config/environment');var logger=require(_0x11ea('0x7'))(_0x11ea('0x8'));config[_0x11ea('0x9')]=_[_0x11ea('0xa')](config[_0x11ea('0x9')],{'host':_0x11ea('0xb'),'port':0x18eb});var io=require(_0x11ea('0xc'))(new Redis(config[_0x11ea('0x9')]));var def={'method':_0x11ea('0xd'),'json':!![]};function emit(_0x1529ee,_0xd56ddb,_0xdab75f){io['to'](_0x1529ee)[_0x11ea('0xe')](_0xd56ddb,_0xdab75f);}function getTicket(_0x57e25a,_0x1f0282,_0x12d06a,_0x4389ed,_0x24dcdb,_0x3b860c,_0x27e770,_0x2e875e){logger[_0x11ea('0xf')](_0x11ea('0x10'));var _0x57f1a5=new Date();var _0x333e17=[{'name':'name','value':intUtil['getString'](_0x4389ed[_0x11ea('0x11')],_0x24dcdb,'\x20')},{'name':'assigned_user_id','value':_0x1f0282['id']},{'name':_0x11ea('0x12'),'value':_0x1f0282['id']},{'name':_0x11ea('0x13'),'value':intUtil[_0x11ea('0x14')](_0x4389ed[_0x11ea('0x15')],_0x24dcdb,'\x0a')},{'name':_0x11ea('0x16'),'value':_0x57f1a5[_0x11ea('0x17')]()[_0x11ea('0x18')](0x0,0x13)[_0x11ea('0x19')]('T','\x20')},{'name':_0x11ea('0x1a'),'value':'0'},{'name':_0x11ea('0x1b'),'value':'15'},{'name':_0x11ea('0x1c'),'value':_0x12d06a['id']},{'name':_0x11ea('0x1d'),'value':_0x11ea('0x1e')},{'name':_0x11ea('0x1f'),'value':_0x12d06a[_0x11ea('0x20')]},{'name':_0x11ea('0x21'),'value':_0x2e875e}];if(_0x3b860c[_0x11ea('0x22')]){_[_0x11ea('0x23')](_0x3b860c,function(_0x8a971d){if(_0x24dcdb[_0x8a971d[_0x11ea('0x24')]]){_0x333e17[_0x11ea('0x25')]({'name':_0x8a971d[_0x11ea('0x26')],'value':_0x24dcdb[_0x8a971d['variableName']]});}});}return request({'form':{'method':_0x11ea('0x27'),'input_type':'JSON','response_type':_0x11ea('0x28'),'rest_data':JSON[_0x11ea('0x29')]({'session':_0x27e770['id'],'module_name':_0x11ea('0x2a'),'name_value_list':_0x333e17})}});}function getAuth(_0x302c27){return util[_0x11ea('0x2b')](_0x11ea('0x2c'),new Buffer(_0x302c27['apiKey']+':X')[_0x11ea('0x2d')]('base64'));}function getServerInfo(_0x56d9f6){return request({'form':{'method':'get_server_info','input_type':_0x11ea('0x28'),'response_type':'JSON','rest_data':JSON[_0x11ea('0x29')]({'session':_0x56d9f6['id']})}});}function getUser(_0x460366,_0x5a83d5,_0x1e1261){if(!_[_0x11ea('0x2e')](_0x5a83d5)){logger['info'](_0x11ea('0x2f'),_0x5a83d5);return request({'form':{'method':_0x11ea('0x30'),'input_type':'JSON','response_type':_0x11ea('0x28'),'rest_data':JSON[_0x11ea('0x29')]({'session':_0x1e1261['id'],'module_name':_0x11ea('0x31'),'query':util[_0x11ea('0x2b')](_0x11ea('0x32'),_0x5a83d5),'order_by':'','offset':'0','select_fields':['id',_0x11ea('0x20'),_0x11ea('0x33')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x11ea('0x34')](function(_0x409fb2){if(_0x409fb2[_0x11ea('0x35')][_0x11ea('0x22')]){var _0x44798d=_['find'](_0x409fb2[_0x11ea('0x35')],function(_0xdc42ff){return _0xdc42ff[_0x11ea('0x36')][_0x11ea('0x33')][_0x11ea('0x37')]===_0x5a83d5;});if(_0x44798d){logger[_0x11ea('0xf')](_0x11ea('0x38'));return BPromise[_0x11ea('0x39')]({'id':_0x44798d[_0x11ea('0x36')]['id'][_0x11ea('0x37')],'name':_0x44798d[_0x11ea('0x36')][_0x11ea('0x20')]['value']});}}logger[_0x11ea('0xf')](_0x11ea('0x3a'));return BPromise[_0x11ea('0x39')]({'id':_0x1e1261['name_value_list'][_0x11ea('0x3b')][_0x11ea('0x37')],'name':_0x1e1261[_0x11ea('0x36')]['user_name']['value']});});}else{logger[_0x11ea('0xf')]('Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!');return BPromise[_0x11ea('0x39')]({'id':_0x1e1261['name_value_list'][_0x11ea('0x3b')][_0x11ea('0x37')],'name':_0x1e1261[_0x11ea('0x36')][_0x11ea('0x33')][_0x11ea('0x37')]});}}function getEndUser(_0x246eba,_0x3afe46,_0x4f1862,_0x52d493){logger[_0x11ea('0xf')](_0x11ea('0x3c'),_0x4f1862);return request({'form':{'method':_0x11ea('0x30'),'input_type':_0x11ea('0x28'),'response_type':'JSON','rest_data':JSON[_0x11ea('0x29')]({'session':_0x52d493['id'],'module_name':_0x11ea('0x1e'),'query':util[_0x11ea('0x2b')](_0x11ea('0x3d'),_0x4f1862),'order_by':'','offset':'0','select_fields':['id','name',_0x11ea('0x3e')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x11ea('0x34')](function(_0x3f0ca4){if(_0x3f0ca4[_0x11ea('0x35')][_0x11ea('0x22')]){var _0xf8669=_[_0x11ea('0x3f')](_0x3f0ca4['entry_list'],function(_0x2051a2){return _0x2051a2[_0x11ea('0x36')][_0x11ea('0x3e')][_0x11ea('0x37')]===_0x4f1862;});if(_0xf8669){logger[_0x11ea('0xf')](_0x11ea('0x40'));return BPromise[_0x11ea('0x39')]({'id':_0xf8669[_0x11ea('0x36')]['id'][_0x11ea('0x37')],'name':_0xf8669[_0x11ea('0x36')][_0x11ea('0x20')][_0x11ea('0x37')],'phone':_0xf8669[_0x11ea('0x36')][_0x11ea('0x3e')][_0x11ea('0x37')]});}}else{logger['info'](_0x11ea('0x41'));return request({'form':{'method':_0x11ea('0x27'),'input_type':_0x11ea('0x28'),'response_type':'JSON','rest_data':JSON[_0x11ea('0x29')]({'session':_0x52d493['id'],'module_name':_0x11ea('0x1e'),'name_value_list':[{'name':_0x11ea('0x42'),'value':_0x3afe46!==_0x11ea('0x43')?_0x3afe46:util['format'](_0x11ea('0x44'),_0x4f1862)},{'name':'phone_home','value':_0x4f1862}]})}})[_0x11ea('0x34')](function(_0xa928b6){logger[_0x11ea('0xf')]('Enduser\x20created.');return BPromise['resolve']({'id':_0xa928b6['id'],'name':_0xa928b6[_0x11ea('0x35')][_0x11ea('0x42')][_0x11ea('0x37')],'phone':_0xa928b6['entry_list'][_0x11ea('0x3e')][_0x11ea('0x37')]});});}});}function request(_0x415372){logger[_0x11ea('0x45')](_0x11ea('0x46'),JSON[_0x11ea('0x29')](_0x415372));return rp(_[_0x11ea('0x47')](def,_0x415372));}function getTags(_0x5cb6c6,_0x582472){var _0x4b938a=[];if(_0x5cb6c6&&_0x5cb6c6[_0x11ea('0x22')]>0x0){_0x4b938a=_['map'](_0x5cb6c6,_0x582472);}return _0x4b938a;}function getCustomFields(_0x51c7f9,_0x218830){var _0xfedbf5=[];var _0xa75e7d={'custom_fields':[]};if(_0x51c7f9[_0x11ea('0x22')]>0x0){_[_0x11ea('0x23')](_0x51c7f9,function(_0x22425f){if(_0x22425f[_0x11ea('0x48')]===_0x11ea('0x49')&&_0x22425f['nameField']&&!_0x22425f[_0x11ea('0x4a')]){_0xa75e7d[_0x22425f['nameField'][_0x11ea('0x4b')]()]=_0x22425f[_0x11ea('0x4c')][_0x11ea('0x2d')]();}else if(_0x22425f['type']===_0x11ea('0x49')&&_0x22425f[_0x11ea('0x26')]&&_0x22425f[_0x11ea('0x4a')]){_0xa75e7d[_0x11ea('0x4d')][_0x11ea('0x25')]({'id':_0x22425f[_0x11ea('0x26')],'value':_0x22425f[_0x11ea('0x4c')][_0x11ea('0x2d')]()});}else if(_0x22425f[_0x11ea('0x48')]==='variable'&&_0x22425f['variableName']&&_0x22425f[_0x11ea('0x26')]&&_0x22425f[_0x11ea('0x4a')]){_0x218830[_0x22425f[_0x11ea('0x24')]]&&_0xa75e7d[_0x11ea('0x4d')][_0x11ea('0x25')]({'id':_0x22425f[_0x11ea('0x26')],'value':_0x218830[_0x22425f['variableName']][_0x11ea('0x2d')]()});}else if(_0x22425f[_0x11ea('0x48')]===_0x11ea('0x4e')&&_0x22425f[_0x11ea('0x4f')]&&_0x22425f['Variable'][_0x11ea('0x20')]&&_0x22425f[_0x11ea('0x26')]&&_0x22425f[_0x11ea('0x4a')]){_0x218830[_0x22425f['Variable'][_0x11ea('0x20')][_0x11ea('0x4b')]()]&&_0xa75e7d[_0x11ea('0x4d')]['push']({'id':_0x22425f['idField'],'value':_0x218830[_0x22425f['Variable'][_0x11ea('0x20')][_0x11ea('0x4b')]()][_0x11ea('0x2d')]()});}});}return _0xa75e7d;}function getConnection(_0x209504){return request({'method':'POST','form':{'method':_0x11ea('0x50'),'input_type':_0x11ea('0x28'),'response_type':'JSON','rest_data':JSON[_0x11ea('0x29')]({'user_auth':{'user_name':_0x209504[_0x11ea('0x51')],'password':_0x209504[_0x11ea('0x52')],'encryption':_0x11ea('0x53')},'application':_0x11ea('0x54')})}})[_0x11ea('0x34')](function(_0x46ea8c){var _0x1d8600=_0x46ea8c;if(_0x1d8600['id']){def[_0x11ea('0x55')]=_0x1d8600['id'];return BPromise[_0x11ea('0x39')](_0x1d8600);}else{throw new Error(util[_0x11ea('0x2b')](_0x11ea('0x56'),_0x209504['id']));}});}function setRelationship(_0x5aaffd,_0x45acb4,_0x45905c,_0x3d5cc9){return request({'form':{'method':_0x11ea('0x57'),'input_type':_0x11ea('0x28'),'response_type':'JSON','rest_data':JSON[_0x11ea('0x29')]({'session':_0x5aaffd['id'],'module_name':_0x11ea('0x2a'),'module_id':_0x45905c['id'],'link_field_name':_0x3d5cc9,'related_ids':[_0x45acb4['id']],'name_value_list':[],'delete':0x0})}});}exports['queue']=function(_0x1bc212,_0x3e671f,_0x585d82,_0x4ce2dd,_0x589ca1,_0x10d99a){var _0x5f19a1,_0xc56cd3,_0x4355b8,_0xb5c169;_0x10d99a[_0x11ea('0x58')]=intUtil[_0x11ea('0x59')](_0x10d99a[_0x11ea('0x58')]);_0x10d99a[_0x11ea('0x5a')]=intUtil[_0x11ea('0x59')](_0x10d99a[_0x11ea('0x5a')]);def['uri']=util['format'](_0x11ea('0x5b'),_0x10d99a[_0x11ea('0x58')]);if(_0x589ca1&&_0x589ca1[_0x11ea('0x5c')]){logger[_0x11ea('0xf')](_0x11ea('0x5d'),_0x11ea('0x5e'));_0x3e671f['recordingURL']=util[_0x11ea('0x2b')](_0x11ea('0x5f'),_0x10d99a[_0x11ea('0x5a')],_0x3e671f[_0x11ea('0x60')],md5(_0x3e671f[_0x11ea('0x60')]));}else{_0x3e671f[_0x11ea('0x61')]='';}return getConnection(_0x10d99a)[_0x11ea('0x34')](function(_0xa81873){_0xb5c169=_0xa81873;return getUser(_0x10d99a,_0x4ce2dd[_0x11ea('0x20')],_0xb5c169);})[_0x11ea('0x34')](function(_0x244c5a){_0x5f19a1=_0x244c5a;logger[_0x11ea('0xf')](_0x11ea('0x62'),_0x5f19a1['id']);return getEndUser(_0x10d99a,_0x3e671f['calleridname'],_0x3e671f[_0x11ea('0x63')],_0xb5c169);})[_0x11ea('0x34')](function(_0x2f0855){_0xc56cd3=_0x2f0855;logger[_0x11ea('0xf')](_0x11ea('0x64'),_0xc56cd3['id']);return getTicket(_0x10d99a,_0x5f19a1,_0xc56cd3,_0x585d82,_0x3e671f,_0x585d82[_0x11ea('0x65')],_0xb5c169,'Inbound');})[_0x11ea('0x34')](function(_0x26daa4){_0x4355b8=_0x26daa4;logger[_0x11ea('0xf')](_0x11ea('0x66'));logger[_0x11ea('0xf')](_0x11ea('0x67'),_0x4355b8['id']);return setRelationship(_0xb5c169,_0x5f19a1,_0x4355b8,'users');})['then'](function(){return setRelationship(_0xb5c169,_0xc56cd3,_0x4355b8,_0x11ea('0x68'));})['then'](function(){return getServerInfo(_0xb5c169);})[_0x11ea('0x34')](function(_0x38f46a){var _0x39767c=parseInt(_0x38f46a['version'][_0x11ea('0x69')](0x0));var _0x10926a=util[_0x11ea('0x2b')](_0x11ea('0x6a'),_0x10d99a[_0x11ea('0x58')],_0x4355b8['id']);if(_0x39767c>0x6){_0x10926a=util[_0x11ea('0x2b')](_0x11ea('0x6b'),_0x10d99a[_0x11ea('0x58')],_0x4355b8['id']);}logger[_0x11ea('0xf')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x11ea('0x2b')](_0x11ea('0x6c'),_0x4ce2dd[_0x11ea('0x20')]),_0x11ea('0x6d'),{'uri':_0x10926a});})[_0x11ea('0x6e')](function(_0x551a65){logger['error'](_0x11ea('0x5d'),JSON[_0x11ea('0x29')](_0x551a65));});};exports[_0x11ea('0x6f')]=function(_0x4f5631,_0x482d4b,_0x2e5eda,_0x5da66b,_0x461f0b,_0x589d5f,_0x8d3314){var _0x505a03,_0x3abb9b,_0x88c517,_0x515fb9;_0x589d5f['remoteUri']=intUtil['stripTrailingSlash'](_0x589d5f[_0x11ea('0x58')]);_0x589d5f[_0x11ea('0x5a')]=intUtil[_0x11ea('0x59')](_0x589d5f[_0x11ea('0x5a')]);def[_0x11ea('0x70')]=util[_0x11ea('0x2b')](_0x11ea('0x5b'),_0x589d5f[_0x11ea('0x58')]);if(_0x8d3314&&_0x8d3314[_0x11ea('0x71')]&&_0x8d3314[_0x11ea('0x71')]!=='none'){logger[_0x11ea('0xf')](_0x11ea('0x72'),_0x11ea('0x5e'));_0x482d4b[_0x11ea('0x61')]=util[_0x11ea('0x2b')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x589d5f[_0x11ea('0x5a')],_0x482d4b['uniqueid'],md5(_0x482d4b['uniqueid']));}return getConnection(_0x589d5f)['then'](function(_0x13ee47){_0x515fb9=_0x13ee47;return getUser(_0x589d5f,_0x5da66b[_0x11ea('0x20')],_0x515fb9);})['then'](function(_0x2b7ce3){_0x505a03=_0x2b7ce3;logger[_0x11ea('0xf')]('The\x20User\x20ID\x20is:',_0x505a03['id']);return getEndUser(_0x589d5f,_0x482d4b[_0x11ea('0x73')],_0x482d4b['destcalleridnum'],_0x515fb9);})[_0x11ea('0x34')](function(_0x32c8d2){_0x3abb9b=_0x32c8d2;logger['info'](_0x11ea('0x64'),_0x3abb9b['id']);return getTicket(_0x589d5f,_0x505a03,_0x3abb9b,_0x2e5eda,_0x482d4b,_0x2e5eda[_0x11ea('0x65')],_0x515fb9,_0x11ea('0x74'));})[_0x11ea('0x34')](function(_0x186cfb){_0x88c517=_0x186cfb;logger['info'](_0x11ea('0x66'));logger[_0x11ea('0xf')](_0x11ea('0x67'),_0x88c517['id']);return setRelationship(_0x515fb9,_0x505a03,_0x88c517,_0x11ea('0x75'));})['then'](function(){return setRelationship(_0x515fb9,_0x3abb9b,_0x88c517,_0x11ea('0x68'));})[_0x11ea('0x34')](function(){return getServerInfo(_0x515fb9);})[_0x11ea('0x34')](function(_0x253c9f){var _0x21a149=parseInt(_0x253c9f[_0x11ea('0x76')]['charAt'](0x0));var _0x4475ab=util[_0x11ea('0x2b')]('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x589d5f['remoteUri'],_0x88c517['id']);if(_0x21a149>0x6){_0x4475ab=util[_0x11ea('0x2b')](_0x11ea('0x6b'),_0x589d5f[_0x11ea('0x58')],_0x88c517['id']);}logger[_0x11ea('0xf')](_0x11ea('0x72'),_0x11ea('0x77'));emit(util[_0x11ea('0x2b')](_0x11ea('0x6c'),_0x5da66b[_0x11ea('0x20')]),'trigger:browser:url',{'uri':_0x4475ab});})[_0x11ea('0x6e')](function(_0x54fe50){logger[_0x11ea('0x78')]('[OUTBOUND]',JSON['stringify'](_0x54fe50));});};exports[_0x11ea('0x79')]=function(_0x1f2b0b,_0x425f1f,_0x3aab2c,_0x513bc6,_0x5a0edf,_0x2e0b91){var _0x83b2ec,_0x445f88,_0x401a10,_0x168044;_0x2e0b91[_0x11ea('0x58')]=intUtil[_0x11ea('0x59')](_0x2e0b91['remoteUri']);_0x2e0b91[_0x11ea('0x5a')]=intUtil[_0x11ea('0x59')](_0x2e0b91[_0x11ea('0x5a')]);def['uri']=util[_0x11ea('0x2b')](_0x11ea('0x5b'),_0x2e0b91[_0x11ea('0x58')]);if(_0x5a0edf&&_0x5a0edf[_0x11ea('0x5c')]){logger[_0x11ea('0xf')]('['+_0x425f1f[_0x11ea('0x7a')][_0x11ea('0x7b')]()+']','Recording\x20is\x20enabled!');_0x425f1f[_0x11ea('0x61')]=util[_0x11ea('0x2b')](_0x11ea('0x5f'),_0x2e0b91[_0x11ea('0x5a')],_0x425f1f[_0x11ea('0x60')],md5(_0x425f1f[_0x11ea('0x60')]));}else{_0x425f1f[_0x11ea('0x61')]='';}return getConnection(_0x2e0b91)['then'](function(_0xf5c261){_0x168044=_0xf5c261;if(!_[_0x11ea('0x2e')](_0x513bc6)){return getUser(_0x2e0b91,_0x513bc6[_0x11ea('0x20')],_0x168044);}else{return getUser(_0x2e0b91,null,_0x168044);}})[_0x11ea('0x34')](function(_0x3ed91d){_0x83b2ec=_0x3ed91d;logger[_0x11ea('0xf')](_0x11ea('0x62'),_0x83b2ec['id']);return getEndUser(_0x2e0b91,_0x425f1f[_0x11ea('0x7c')],_0x425f1f[_0x11ea('0x63')],_0x168044);})[_0x11ea('0x34')](function(_0x329e31){_0x445f88=_0x329e31;logger[_0x11ea('0xf')](_0x11ea('0x64'),_0x445f88['id']);return getTicket(_0x2e0b91,_0x83b2ec,_0x445f88,_0x3aab2c,_0x425f1f,_0x3aab2c[_0x11ea('0x65')],_0x168044,'Inbound');})['then'](function(_0x15208e){_0x401a10=_0x15208e;logger[_0x11ea('0xf')](_0x11ea('0x66'));logger[_0x11ea('0xf')]('The\x20Ticket\x20ID\x20is:',_0x401a10['id']);return setRelationship(_0x168044,_0x83b2ec,_0x401a10,_0x11ea('0x75'));})[_0x11ea('0x34')](function(){return setRelationship(_0x168044,_0x445f88,_0x401a10,_0x11ea('0x68'));})[_0x11ea('0x34')](function(){return getServerInfo(_0x168044);})[_0x11ea('0x6e')](function(_0x317407){logger[_0x11ea('0x78')]('['+_0x425f1f[_0x11ea('0x7a')]['toUpperCase']()+']',JSON[_0x11ea('0x29')](_0x317407));});}; \ No newline at end of file +var _0x8c08=['outbound','uri','recordingFormat','none','Recording\x20is\x20enabled!','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','[OUTBOUND]','user:%s','unmanaged','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','lastevent','lodash','request-promise','bluebird','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','sugarcrm','redis','defaults','localhost','socket.io-emitter','POST','emit','Creating\x20new\x20ticket...','name','getString','Subjects','created_by','description','Descriptions','date_start','toISOString','slice','replace','duration_hours','duration_minutes','parent_type','Contacts','push','idField','variableName','set_entry','JSON','stringify','Calls','format','Basic\x20%s','apiKey','toString','base64','get_server_info','isNil','info','get_entry_list','Employees','entry_list','find','name_value_list','value','resolve','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','user_name','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','contacts.phone_home\x20=\x20\x22%s\x22','then','length','phone_home','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','','Caller\x20-\x20%s','Enduser\x20created.','debug','[HTTP]','merge','map','forEach','type','string','nameField','toLowerCase','content','customField','custom_fields','variable','customVariable','Variable','login','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','set_relationship','queue','remoteUri','stripTrailingSlash','serverUrl','%s/service/v4_1/rest.php','monitor_format','recordingURL','uniqueid','calleridname','calleridnum','Fields','Inbound','Ticket\x20created!','users','contacts','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','catch','error'];(function(_0x4eb863,_0x4dfda9){var _0x456061=function(_0x41b406){while(--_0x41b406){_0x4eb863['push'](_0x4eb863['shift']());}};_0x456061(++_0x4dfda9);}(_0x8c08,0x184));var _0x88c0=function(_0x33fcbb,_0x291d0f){_0x33fcbb=_0x33fcbb-0x0;var _0x2efe40=_0x8c08[_0x33fcbb];return _0x2efe40;};'use strict';var _=require(_0x88c0('0x0'));var rp=require(_0x88c0('0x1'));var BPromise=require(_0x88c0('0x2'));var md5=require(_0x88c0('0x3'));var util=require(_0x88c0('0x4'));var Redis=require(_0x88c0('0x5'));var intUtil=require(_0x88c0('0x6'));var config=require(_0x88c0('0x7'));var logger=require(_0x88c0('0x8'))(_0x88c0('0x9'));config[_0x88c0('0xa')]=_[_0x88c0('0xb')](config[_0x88c0('0xa')],{'host':_0x88c0('0xc'),'port':0x18eb});var io=require(_0x88c0('0xd'))(new Redis(config[_0x88c0('0xa')]));var def={'method':_0x88c0('0xe'),'json':!![]};function emit(_0x1e7ea2,_0x202c29,_0x4dedc8){io['to'](_0x1e7ea2)[_0x88c0('0xf')](_0x202c29,_0x4dedc8);}function getTicket(_0x33f6af,_0x1abf4e,_0x1ca894,_0x885cb8,_0x4c8aab,_0x1aa151,_0x163303,_0x54fca8){logger['info'](_0x88c0('0x10'));var _0x171aaf=new Date();var _0x556cb5=[{'name':_0x88c0('0x11'),'value':intUtil[_0x88c0('0x12')](_0x885cb8[_0x88c0('0x13')],_0x4c8aab,'\x20')},{'name':'assigned_user_id','value':_0x1abf4e['id']},{'name':_0x88c0('0x14'),'value':_0x1abf4e['id']},{'name':_0x88c0('0x15'),'value':intUtil[_0x88c0('0x12')](_0x885cb8[_0x88c0('0x16')],_0x4c8aab,'\x0a')},{'name':_0x88c0('0x17'),'value':_0x171aaf[_0x88c0('0x18')]()[_0x88c0('0x19')](0x0,0x13)[_0x88c0('0x1a')]('T','\x20')},{'name':_0x88c0('0x1b'),'value':'0'},{'name':_0x88c0('0x1c'),'value':'15'},{'name':'parent_id','value':_0x1ca894['id']},{'name':_0x88c0('0x1d'),'value':_0x88c0('0x1e')},{'name':'parent_name','value':_0x1ca894[_0x88c0('0x11')]},{'name':'direction','value':_0x54fca8}];if(_0x1aa151['length']){_['forEach'](_0x1aa151,function(_0x172280){if(_0x4c8aab[_0x172280['variableName']]){_0x556cb5[_0x88c0('0x1f')]({'name':_0x172280[_0x88c0('0x20')],'value':_0x4c8aab[_0x172280[_0x88c0('0x21')]]});}});}return request({'form':{'method':_0x88c0('0x22'),'input_type':'JSON','response_type':_0x88c0('0x23'),'rest_data':JSON[_0x88c0('0x24')]({'session':_0x163303['id'],'module_name':_0x88c0('0x25'),'name_value_list':_0x556cb5})}});}function getAuth(_0x45c17c){return util[_0x88c0('0x26')](_0x88c0('0x27'),new Buffer(_0x45c17c[_0x88c0('0x28')]+':X')[_0x88c0('0x29')](_0x88c0('0x2a')));}function getServerInfo(_0x2d154f){return request({'form':{'method':_0x88c0('0x2b'),'input_type':_0x88c0('0x23'),'response_type':'JSON','rest_data':JSON[_0x88c0('0x24')]({'session':_0x2d154f['id']})}});}function getUser(_0x260779,_0x519e2a,_0xa2a3f9){if(!_[_0x88c0('0x2c')](_0x519e2a)){logger[_0x88c0('0x2d')]('Getting\x20agent\x20with\x20name',_0x519e2a);return request({'form':{'method':_0x88c0('0x2e'),'input_type':_0x88c0('0x23'),'response_type':_0x88c0('0x23'),'rest_data':JSON[_0x88c0('0x24')]({'session':_0xa2a3f9['id'],'module_name':_0x88c0('0x2f'),'query':util[_0x88c0('0x26')]('INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200',_0x519e2a),'order_by':'','offset':'0','select_fields':['id',_0x88c0('0x11'),'user_name'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x22a712){if(_0x22a712[_0x88c0('0x30')]['length']){var _0x316e96=_[_0x88c0('0x31')](_0x22a712['entry_list'],function(_0x4ec328){return _0x4ec328[_0x88c0('0x32')]['user_name'][_0x88c0('0x33')]===_0x519e2a;});if(_0x316e96){logger[_0x88c0('0x2d')]('Agent\x20found!');return BPromise[_0x88c0('0x34')]({'id':_0x316e96[_0x88c0('0x32')]['id'][_0x88c0('0x33')],'name':_0x316e96[_0x88c0('0x32')][_0x88c0('0x11')][_0x88c0('0x33')]});}}logger[_0x88c0('0x2d')](_0x88c0('0x35'));return BPromise['resolve']({'id':_0xa2a3f9[_0x88c0('0x32')][_0x88c0('0x36')][_0x88c0('0x33')],'name':_0xa2a3f9[_0x88c0('0x32')][_0x88c0('0x37')][_0x88c0('0x33')]});});}else{logger[_0x88c0('0x2d')](_0x88c0('0x38'));return BPromise['resolve']({'id':_0xa2a3f9[_0x88c0('0x32')][_0x88c0('0x36')][_0x88c0('0x33')],'name':_0xa2a3f9[_0x88c0('0x32')]['user_name'][_0x88c0('0x33')]});}}function getEndUser(_0x31c8fd,_0x3eedb4,_0x58c2f6,_0x45d168){logger[_0x88c0('0x2d')](_0x88c0('0x39'),_0x58c2f6);return request({'form':{'method':_0x88c0('0x2e'),'input_type':'JSON','response_type':_0x88c0('0x23'),'rest_data':JSON['stringify']({'session':_0x45d168['id'],'module_name':_0x88c0('0x1e'),'query':util[_0x88c0('0x26')](_0x88c0('0x3a'),_0x58c2f6),'order_by':'','offset':'0','select_fields':['id',_0x88c0('0x11'),'phone_home'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x88c0('0x3b')](function(_0x252e01){if(_0x252e01['entry_list'][_0x88c0('0x3c')]){var _0x4f2e2d=_[_0x88c0('0x31')](_0x252e01[_0x88c0('0x30')],function(_0x1b8d47){return _0x1b8d47[_0x88c0('0x32')]['phone_home']['value']===_0x58c2f6;});if(_0x4f2e2d){logger['info']('Enduser\x20found!');return BPromise[_0x88c0('0x34')]({'id':_0x4f2e2d['name_value_list']['id'][_0x88c0('0x33')],'name':_0x4f2e2d['name_value_list'][_0x88c0('0x11')][_0x88c0('0x33')],'phone':_0x4f2e2d[_0x88c0('0x32')][_0x88c0('0x3d')][_0x88c0('0x33')]});}}else{logger[_0x88c0('0x2d')](_0x88c0('0x3e'));return request({'form':{'method':_0x88c0('0x22'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0x88c0('0x24')]({'session':_0x45d168['id'],'module_name':_0x88c0('0x1e'),'name_value_list':[{'name':_0x88c0('0x3f'),'value':_0x3eedb4!==_0x88c0('0x40')?_0x3eedb4:util[_0x88c0('0x26')](_0x88c0('0x41'),_0x58c2f6)},{'name':_0x88c0('0x3d'),'value':_0x58c2f6}]})}})[_0x88c0('0x3b')](function(_0xf97167){logger[_0x88c0('0x2d')](_0x88c0('0x42'));return BPromise[_0x88c0('0x34')]({'id':_0xf97167['id'],'name':_0xf97167['entry_list']['first_name'][_0x88c0('0x33')],'phone':_0xf97167[_0x88c0('0x30')]['phone_home'][_0x88c0('0x33')]});});}});}function request(_0x8f6122){logger[_0x88c0('0x43')](_0x88c0('0x44'),JSON['stringify'](_0x8f6122));return rp(_[_0x88c0('0x45')](def,_0x8f6122));}function getTags(_0x30269e,_0x20febd){var _0x5f1b08=[];if(_0x30269e&&_0x30269e[_0x88c0('0x3c')]>0x0){_0x5f1b08=_[_0x88c0('0x46')](_0x30269e,_0x20febd);}return _0x5f1b08;}function getCustomFields(_0x4641c5,_0x3823e3){var _0x3c60cf=[];var _0x93d96c={'custom_fields':[]};if(_0x4641c5[_0x88c0('0x3c')]>0x0){_[_0x88c0('0x47')](_0x4641c5,function(_0x352d89){if(_0x352d89[_0x88c0('0x48')]===_0x88c0('0x49')&&_0x352d89[_0x88c0('0x4a')]&&!_0x352d89['customField']){_0x93d96c[_0x352d89[_0x88c0('0x4a')][_0x88c0('0x4b')]()]=_0x352d89[_0x88c0('0x4c')][_0x88c0('0x29')]();}else if(_0x352d89[_0x88c0('0x48')]===_0x88c0('0x49')&&_0x352d89['idField']&&_0x352d89[_0x88c0('0x4d')]){_0x93d96c[_0x88c0('0x4e')][_0x88c0('0x1f')]({'id':_0x352d89[_0x88c0('0x20')],'value':_0x352d89['content'][_0x88c0('0x29')]()});}else if(_0x352d89[_0x88c0('0x48')]===_0x88c0('0x4f')&&_0x352d89['variableName']&&_0x352d89[_0x88c0('0x20')]&&_0x352d89['customField']){_0x3823e3[_0x352d89[_0x88c0('0x21')]]&&_0x93d96c[_0x88c0('0x4e')][_0x88c0('0x1f')]({'id':_0x352d89[_0x88c0('0x20')],'value':_0x3823e3[_0x352d89['variableName']][_0x88c0('0x29')]()});}else if(_0x352d89[_0x88c0('0x48')]===_0x88c0('0x50')&&_0x352d89[_0x88c0('0x51')]&&_0x352d89['Variable']['name']&&_0x352d89['idField']&&_0x352d89['customField']){_0x3823e3[_0x352d89['Variable']['name']['toLowerCase']()]&&_0x93d96c[_0x88c0('0x4e')]['push']({'id':_0x352d89[_0x88c0('0x20')],'value':_0x3823e3[_0x352d89[_0x88c0('0x51')][_0x88c0('0x11')][_0x88c0('0x4b')]()][_0x88c0('0x29')]()});}});}return _0x93d96c;}function getConnection(_0x302445){return request({'method':_0x88c0('0xe'),'form':{'method':_0x88c0('0x52'),'input_type':_0x88c0('0x23'),'response_type':_0x88c0('0x23'),'rest_data':JSON[_0x88c0('0x24')]({'user_auth':{'user_name':_0x302445['username'],'password':_0x302445[_0x88c0('0x53')],'encryption':_0x88c0('0x54')},'application':_0x88c0('0x55')})}})['then'](function(_0x3431df){var _0x5dd355=_0x3431df;if(_0x5dd355['id']){def[_0x88c0('0x56')]=_0x5dd355['id'];return BPromise[_0x88c0('0x34')](_0x5dd355);}else{throw new Error(util[_0x88c0('0x26')]('Account\x20%d\x20is\x20not\x20valid',_0x302445['id']));}});}function setRelationship(_0x598d8e,_0x583b8b,_0x4f99dc,_0x595d97){return request({'form':{'method':_0x88c0('0x57'),'input_type':'JSON','response_type':_0x88c0('0x23'),'rest_data':JSON[_0x88c0('0x24')]({'session':_0x598d8e['id'],'module_name':_0x88c0('0x25'),'module_id':_0x4f99dc['id'],'link_field_name':_0x595d97,'related_ids':[_0x583b8b['id']],'name_value_list':[],'delete':0x0})}});}exports[_0x88c0('0x58')]=function(_0x351e6c,_0x141a3c,_0x29f8bf,_0x4cf5aa,_0x5a103d,_0x383fc9){var _0x1cb92b,_0x1f6f81,_0x208e64,_0x1ebccc;_0x383fc9[_0x88c0('0x59')]=intUtil[_0x88c0('0x5a')](_0x383fc9['remoteUri']);_0x383fc9[_0x88c0('0x5b')]=intUtil[_0x88c0('0x5a')](_0x383fc9[_0x88c0('0x5b')]);def['uri']=util[_0x88c0('0x26')](_0x88c0('0x5c'),_0x383fc9[_0x88c0('0x59')]);if(_0x5a103d&&_0x5a103d[_0x88c0('0x5d')]){logger['info']('[QUEUE]','Recording\x20is\x20enabled!');_0x141a3c[_0x88c0('0x5e')]=util[_0x88c0('0x26')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x383fc9[_0x88c0('0x5b')],_0x141a3c[_0x88c0('0x5f')],md5(_0x141a3c['uniqueid']));}else{_0x141a3c['recordingURL']='';}return getConnection(_0x383fc9)[_0x88c0('0x3b')](function(_0x48c32b){_0x1ebccc=_0x48c32b;return getUser(_0x383fc9,_0x4cf5aa[_0x88c0('0x11')],_0x1ebccc);})[_0x88c0('0x3b')](function(_0x220853){_0x1cb92b=_0x220853;logger[_0x88c0('0x2d')]('The\x20User\x20ID\x20is:',_0x1cb92b['id']);return getEndUser(_0x383fc9,_0x141a3c[_0x88c0('0x60')],_0x141a3c[_0x88c0('0x61')],_0x1ebccc);})[_0x88c0('0x3b')](function(_0x195a9a){_0x1f6f81=_0x195a9a;logger[_0x88c0('0x2d')]('The\x20Enduser\x20ID\x20is:',_0x1f6f81['id']);return getTicket(_0x383fc9,_0x1cb92b,_0x1f6f81,_0x29f8bf,_0x141a3c,_0x29f8bf[_0x88c0('0x62')],_0x1ebccc,_0x88c0('0x63'));})[_0x88c0('0x3b')](function(_0x341bdb){_0x208e64=_0x341bdb;logger[_0x88c0('0x2d')](_0x88c0('0x64'));logger[_0x88c0('0x2d')]('The\x20Ticket\x20ID\x20is:',_0x208e64['id']);return setRelationship(_0x1ebccc,_0x1cb92b,_0x208e64,_0x88c0('0x65'));})[_0x88c0('0x3b')](function(){return setRelationship(_0x1ebccc,_0x1f6f81,_0x208e64,_0x88c0('0x66'));})[_0x88c0('0x3b')](function(){return getServerInfo(_0x1ebccc);})[_0x88c0('0x3b')](function(_0x5a786b){var _0x2b6867=parseInt(_0x5a786b[_0x88c0('0x67')][_0x88c0('0x68')](0x0));var _0x4135f5=util[_0x88c0('0x26')](_0x88c0('0x69'),_0x383fc9[_0x88c0('0x59')],_0x208e64['id']);if(_0x2b6867>0x6){_0x4135f5=util[_0x88c0('0x26')](_0x88c0('0x6a'),_0x383fc9['remoteUri'],_0x208e64['id']);}logger[_0x88c0('0x2d')](_0x88c0('0x6b'),_0x88c0('0x6c'));emit(util[_0x88c0('0x26')]('user:%s',_0x4cf5aa['name']),_0x88c0('0x6d'),{'uri':_0x4135f5});})[_0x88c0('0x6e')](function(_0x2cae37){logger[_0x88c0('0x6f')](_0x88c0('0x6b'),JSON[_0x88c0('0x24')](_0x2cae37));});};exports[_0x88c0('0x70')]=function(_0x28eeb7,_0x5d8b58,_0x5abd6d,_0x3cef63,_0xa5a3dd,_0x45264f,_0x1595db){var _0x34b1df,_0x348381,_0x1fe273,_0xfb5ff;_0x45264f[_0x88c0('0x59')]=intUtil['stripTrailingSlash'](_0x45264f[_0x88c0('0x59')]);_0x45264f[_0x88c0('0x5b')]=intUtil[_0x88c0('0x5a')](_0x45264f[_0x88c0('0x5b')]);def[_0x88c0('0x71')]=util[_0x88c0('0x26')](_0x88c0('0x5c'),_0x45264f['remoteUri']);if(_0x1595db&&_0x1595db[_0x88c0('0x72')]&&_0x1595db[_0x88c0('0x72')]!==_0x88c0('0x73')){logger[_0x88c0('0x2d')]('[OUTBOUND]',_0x88c0('0x74'));_0x5d8b58[_0x88c0('0x5e')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x45264f[_0x88c0('0x5b')],_0x5d8b58['uniqueid'],md5(_0x5d8b58[_0x88c0('0x5f')]));}return getConnection(_0x45264f)[_0x88c0('0x3b')](function(_0x1d9034){_0xfb5ff=_0x1d9034;return getUser(_0x45264f,_0x3cef63['name'],_0xfb5ff);})[_0x88c0('0x3b')](function(_0x22a5ae){_0x34b1df=_0x22a5ae;logger[_0x88c0('0x2d')](_0x88c0('0x75'),_0x34b1df['id']);return getEndUser(_0x45264f,_0x5d8b58['destcalleridname'],_0x5d8b58['destcalleridnum'],_0xfb5ff);})[_0x88c0('0x3b')](function(_0x1683cf){_0x348381=_0x1683cf;logger[_0x88c0('0x2d')](_0x88c0('0x76'),_0x348381['id']);return getTicket(_0x45264f,_0x34b1df,_0x348381,_0x5abd6d,_0x5d8b58,_0x5abd6d[_0x88c0('0x62')],_0xfb5ff,'Outbound');})[_0x88c0('0x3b')](function(_0x2f1179){_0x1fe273=_0x2f1179;logger[_0x88c0('0x2d')](_0x88c0('0x64'));logger[_0x88c0('0x2d')](_0x88c0('0x77'),_0x1fe273['id']);return setRelationship(_0xfb5ff,_0x34b1df,_0x1fe273,_0x88c0('0x65'));})['then'](function(){return setRelationship(_0xfb5ff,_0x348381,_0x1fe273,_0x88c0('0x66'));})[_0x88c0('0x3b')](function(){return getServerInfo(_0xfb5ff);})[_0x88c0('0x3b')](function(_0x48274b){var _0x99a635=parseInt(_0x48274b[_0x88c0('0x67')][_0x88c0('0x68')](0x0));var _0x4bc420=util[_0x88c0('0x26')](_0x88c0('0x69'),_0x45264f[_0x88c0('0x59')],_0x1fe273['id']);if(_0x99a635>0x6){_0x4bc420=util[_0x88c0('0x26')](_0x88c0('0x6a'),_0x45264f[_0x88c0('0x59')],_0x1fe273['id']);}logger['info'](_0x88c0('0x78'),_0x88c0('0x6c'));emit(util['format'](_0x88c0('0x79'),_0x3cef63['name']),_0x88c0('0x6d'),{'uri':_0x4bc420});})['catch'](function(_0x5ce2af){logger[_0x88c0('0x6f')]('[OUTBOUND]',JSON[_0x88c0('0x24')](_0x5ce2af));});};exports[_0x88c0('0x7a')]=function(_0x3f70e4,_0x22b3dc,_0x160dfc,_0x4b813f,_0x42ba08,_0x252aa3){var _0x36ccf6,_0xaf2594,_0x1a5580,_0xc827ee;_0x252aa3[_0x88c0('0x59')]=intUtil[_0x88c0('0x5a')](_0x252aa3[_0x88c0('0x59')]);_0x252aa3['serverUrl']=intUtil['stripTrailingSlash'](_0x252aa3[_0x88c0('0x5b')]);def[_0x88c0('0x71')]=util['format']('%s/service/v4_1/rest.php',_0x252aa3[_0x88c0('0x59')]);if(_0x42ba08&&_0x42ba08[_0x88c0('0x5d')]){logger[_0x88c0('0x2d')]('['+_0x22b3dc['lastevent']['toUpperCase']()+']','Recording\x20is\x20enabled!');_0x22b3dc[_0x88c0('0x5e')]=util[_0x88c0('0x26')](_0x88c0('0x7b'),_0x252aa3['serverUrl'],_0x22b3dc[_0x88c0('0x5f')],md5(_0x22b3dc[_0x88c0('0x5f')]));}else{_0x22b3dc['recordingURL']='';}return getConnection(_0x252aa3)['then'](function(_0x46be93){_0xc827ee=_0x46be93;if(!_[_0x88c0('0x2c')](_0x4b813f)){return getUser(_0x252aa3,_0x4b813f[_0x88c0('0x11')],_0xc827ee);}else{return getUser(_0x252aa3,null,_0xc827ee);}})[_0x88c0('0x3b')](function(_0x15923e){_0x36ccf6=_0x15923e;logger['info'](_0x88c0('0x75'),_0x36ccf6['id']);return getEndUser(_0x252aa3,_0x22b3dc[_0x88c0('0x60')],_0x22b3dc['calleridnum'],_0xc827ee);})[_0x88c0('0x3b')](function(_0x362778){_0xaf2594=_0x362778;logger['info'](_0x88c0('0x76'),_0xaf2594['id']);return getTicket(_0x252aa3,_0x36ccf6,_0xaf2594,_0x160dfc,_0x22b3dc,_0x160dfc['Fields'],_0xc827ee,_0x88c0('0x63'));})[_0x88c0('0x3b')](function(_0x126368){_0x1a5580=_0x126368;logger[_0x88c0('0x2d')](_0x88c0('0x64'));logger['info']('The\x20Ticket\x20ID\x20is:',_0x1a5580['id']);return setRelationship(_0xc827ee,_0x36ccf6,_0x1a5580,_0x88c0('0x65'));})[_0x88c0('0x3b')](function(){return setRelationship(_0xc827ee,_0xaf2594,_0x1a5580,_0x88c0('0x66'));})[_0x88c0('0x3b')](function(){return getServerInfo(_0xc827ee);})['catch'](function(_0x19a66b){logger[_0x88c0('0x6f')]('['+_0x22b3dc[_0x88c0('0x7c')]['toUpperCase']()+']',JSON[_0x88c0('0x24')](_0x19a66b));});}; \ 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 d4dc17c..c41480d 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 _0xec58=['toLowerCase','stripTrailingSlash','slice','lastIndexOf','validateEmail','isNil','test','sortBy','length','type','string','push','content','variableName','toString','Variable','name','keyValue','key','format','%s:\x20%s','keyContent','keyType','variable'];(function(_0xa82f36,_0x4c34f3){var _0x220080=function(_0xff66d6){while(--_0xff66d6){_0xa82f36['push'](_0xa82f36['shift']());}};_0x220080(++_0x4c34f3);}(_0xec58,0x1b7));var _0x8ec5=function(_0x317497,_0x2d6cf7){_0x317497=_0x317497-0x0;var _0x3445b0=_0xec58[_0x317497];return _0x3445b0;};'use strict';var _=require('lodash');var util=require('util');exports['getString']=function(_0x3514b6,_0x24b484,_0x268623){var _0x3b23ca=[];if(_0x3514b6['length']>0x0){var _0x29ec9d=_[_0x8ec5('0x0')](_0x3514b6,['id']);for(var _0x486909=0x0;_0x486909<_0x29ec9d[_0x8ec5('0x1')];_0x486909++){var _0x2d5d83=_0x29ec9d[_0x486909];if(_0x2d5d83[_0x8ec5('0x2')]===_0x8ec5('0x3')){_0x3b23ca[_0x8ec5('0x4')](_0x2d5d83[_0x8ec5('0x5')]);}else if(_0x2d5d83[_0x8ec5('0x2')]==='variable'&&_0x2d5d83[_0x8ec5('0x6')]){_0x24b484[_0x2d5d83[_0x8ec5('0x6')]]&&_0x3b23ca[_0x8ec5('0x4')](_0x24b484[_0x2d5d83['variableName']][_0x8ec5('0x7')]());}else if(_0x2d5d83[_0x8ec5('0x2')]==='customVariable'&&_0x2d5d83[_0x8ec5('0x8')]&&_0x2d5d83[_0x8ec5('0x8')]['name']){_0x24b484[_0x2d5d83[_0x8ec5('0x8')][_0x8ec5('0x9')]['toLowerCase']()]&&_0x3b23ca[_0x8ec5('0x4')](_0x24b484[_0x2d5d83[_0x8ec5('0x8')][_0x8ec5('0x9')]['toLowerCase']()][_0x8ec5('0x7')]());}else if(_0x2d5d83['type']===_0x8ec5('0xa')){if(_0x2d5d83['keyType']==='string'&&_0x2d5d83[_0x8ec5('0xb')]){_0x3b23ca[_0x8ec5('0x4')](util[_0x8ec5('0xc')](_0x8ec5('0xd'),_0x2d5d83[_0x8ec5('0xb')],_0x2d5d83[_0x8ec5('0xe')]));}else if(_0x2d5d83[_0x8ec5('0xf')]===_0x8ec5('0x10')&&_0x2d5d83[_0x8ec5('0x6')]&&_0x2d5d83['key']){_0x24b484[_0x2d5d83['variableName']]&&_0x3b23ca[_0x8ec5('0x4')](util[_0x8ec5('0xc')]('%s:\x20%s',_0x2d5d83[_0x8ec5('0xb')],_0x24b484[_0x2d5d83[_0x8ec5('0x6')]]));}else if(_0x2d5d83[_0x8ec5('0xf')]==='customVariable'&&_0x2d5d83['Variable']&&_0x2d5d83['Variable'][_0x8ec5('0x9')]&&_0x2d5d83[_0x8ec5('0xb')]){_0x24b484[_0x2d5d83[_0x8ec5('0x8')]['name'][_0x8ec5('0x11')]()]&&_0x3b23ca[_0x8ec5('0x4')](util[_0x8ec5('0xc')]('%s:\x20%s',_0x2d5d83[_0x8ec5('0xb')],_0x24b484[_0x2d5d83['Variable'][_0x8ec5('0x9')][_0x8ec5('0x11')]()]));}}}}return _0x3b23ca['join'](_0x268623);};exports[_0x8ec5('0x12')]=function(_0x55ad61){var _0x1cf00d=_0x55ad61[_0x8ec5('0x13')](-0x1);if(_0x1cf00d==='/'){_0x55ad61=_0x55ad61['substring'](0x0,_0x55ad61[_0x8ec5('0x14')](_0x1cf00d));}return _0x55ad61;};exports[_0x8ec5('0x15')]=function(_0x54faca){if(!_[_0x8ec5('0x16')](_0x54faca)&&_0x54faca!==''){var _0x559ae1=/^(([^<>()\[\]\\.,;:\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 _0x559ae1[_0x8ec5('0x17')](String(_0x54faca)['toLowerCase']());}else{return![];}}; \ No newline at end of file +var _0xaa54=['validateEmail','test','lodash','getString','length','sortBy','type','string','push','content','variable','variableName','Variable','name','toLowerCase','toString','keyValue','keyType','key','format','%s:\x20%s','keyContent','customVariable','join','stripTrailingSlash','slice','substring'];(function(_0x263941,_0x36a4fd){var _0x504b95=function(_0x3c811b){while(--_0x3c811b){_0x263941['push'](_0x263941['shift']());}};_0x504b95(++_0x36a4fd);}(_0xaa54,0x110));var _0x4aa5=function(_0x1c8c28,_0x3ee093){_0x1c8c28=_0x1c8c28-0x0;var _0x1f59b4=_0xaa54[_0x1c8c28];return _0x1f59b4;};'use strict';var _=require(_0x4aa5('0x0'));var util=require('util');exports[_0x4aa5('0x1')]=function(_0x593504,_0x2a81c2,_0x26ae66){var _0x40a814=[];if(_0x593504[_0x4aa5('0x2')]>0x0){var _0x524bc4=_[_0x4aa5('0x3')](_0x593504,['id']);for(var _0x8386e8=0x0;_0x8386e8<_0x524bc4[_0x4aa5('0x2')];_0x8386e8++){var _0xba64f9=_0x524bc4[_0x8386e8];if(_0xba64f9[_0x4aa5('0x4')]===_0x4aa5('0x5')){_0x40a814[_0x4aa5('0x6')](_0xba64f9[_0x4aa5('0x7')]);}else if(_0xba64f9['type']===_0x4aa5('0x8')&&_0xba64f9[_0x4aa5('0x9')]){_0x2a81c2[_0xba64f9[_0x4aa5('0x9')]]&&_0x40a814[_0x4aa5('0x6')](_0x2a81c2[_0xba64f9[_0x4aa5('0x9')]]['toString']());}else if(_0xba64f9[_0x4aa5('0x4')]==='customVariable'&&_0xba64f9[_0x4aa5('0xa')]&&_0xba64f9[_0x4aa5('0xa')][_0x4aa5('0xb')]){_0x2a81c2[_0xba64f9['Variable']['name'][_0x4aa5('0xc')]()]&&_0x40a814['push'](_0x2a81c2[_0xba64f9['Variable'][_0x4aa5('0xb')][_0x4aa5('0xc')]()][_0x4aa5('0xd')]());}else if(_0xba64f9['type']===_0x4aa5('0xe')){if(_0xba64f9[_0x4aa5('0xf')]===_0x4aa5('0x5')&&_0xba64f9[_0x4aa5('0x10')]){_0x40a814[_0x4aa5('0x6')](util[_0x4aa5('0x11')](_0x4aa5('0x12'),_0xba64f9[_0x4aa5('0x10')],_0xba64f9[_0x4aa5('0x13')]));}else if(_0xba64f9['keyType']===_0x4aa5('0x8')&&_0xba64f9[_0x4aa5('0x9')]&&_0xba64f9['key']){_0x2a81c2[_0xba64f9['variableName']]&&_0x40a814[_0x4aa5('0x6')](util[_0x4aa5('0x11')](_0x4aa5('0x12'),_0xba64f9[_0x4aa5('0x10')],_0x2a81c2[_0xba64f9[_0x4aa5('0x9')]]));}else if(_0xba64f9['keyType']===_0x4aa5('0x14')&&_0xba64f9['Variable']&&_0xba64f9[_0x4aa5('0xa')][_0x4aa5('0xb')]&&_0xba64f9[_0x4aa5('0x10')]){_0x2a81c2[_0xba64f9[_0x4aa5('0xa')][_0x4aa5('0xb')]['toLowerCase']()]&&_0x40a814[_0x4aa5('0x6')](util[_0x4aa5('0x11')](_0x4aa5('0x12'),_0xba64f9[_0x4aa5('0x10')],_0x2a81c2[_0xba64f9[_0x4aa5('0xa')][_0x4aa5('0xb')][_0x4aa5('0xc')]()]));}}}}return _0x40a814[_0x4aa5('0x15')](_0x26ae66);};exports[_0x4aa5('0x16')]=function(_0x245cb6){var _0x2bf056=_0x245cb6[_0x4aa5('0x17')](-0x1);if(_0x2bf056==='/'){_0x245cb6=_0x245cb6[_0x4aa5('0x18')](0x0,_0x245cb6['lastIndexOf'](_0x2bf056));}return _0x245cb6;};exports[_0x4aa5('0x19')]=function(_0x26740b){if(!_['isNil'](_0x26740b)&&_0x26740b!==''){var _0x408468=/^(([^<>()\[\]\\.,;:\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 _0x408468[_0x4aa5('0x1a')](String(_0x26740b)[_0x4aa5('0xc')]());}else{return![];}}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/vtiger.js b/server/services/ami/trigger/integration/vtiger.js index f93d686..9432cd2 100644 --- a/server/services/ami/trigger/integration/vtiger.js +++ b/server/services/ami/trigger/integration/vtiger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['result','Agent\x20found!','email1','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','getUser','username','Searching\x20end\x20user\x20with\x20phone','remoteUri','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','phone','catch','accessKey','getchallenge','token','Account\x20%d\x20is\x20not\x20valid','getConnection','queue','stripTrailingSlash','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','serverUrl','uniqueid','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Ticket\x20created!','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','The\x20Ticket\x20ID\x20is:','user:%s','unmanaged','lastevent','toUpperCase','lodash','request-promise','bluebird','util','ioredis','./util','../../../../config/environment','../../../../config/logger','vTiger','redis','defaults','localhost','socket.io-emitter','emit','length','forEach','includes','string','idField','content','toString','type','variable','variableName','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','Open','Subjects','getString','Descriptions','POST','format','%s/webservice.php','create','stringify','then','success','resolve','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','statusCode','error','[vTiger],\x20%s,\x20%s,\x20%s','validateEmail','Getting\x20agent\x20with\x20email','GET','query','sessionName','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;'];(function(_0x560d2a,_0x4a9f54){var _0x3df62d=function(_0x1ce1ec){while(--_0x1ce1ec){_0x560d2a['push'](_0x560d2a['shift']());}};_0x3df62d(++_0x4a9f54);}(_0xe706,0xa3));var _0x6e70=function(_0x43d0dd,_0x1bd3d2){_0x43d0dd=_0x43d0dd-0x0;var _0x233879=_0xe706[_0x43d0dd];return _0x233879;};'use strict';var _=require(_0x6e70('0x0'));var rp=require(_0x6e70('0x1'));var BPromise=require(_0x6e70('0x2'));var md5=require('md5');var util=require(_0x6e70('0x3'));var Redis=require(_0x6e70('0x4'));var intUtil=require(_0x6e70('0x5'));var config=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));config[_0x6e70('0x9')]=_[_0x6e70('0xa')](config[_0x6e70('0x9')],{'host':_0x6e70('0xb'),'port':0x18eb});var io=require(_0x6e70('0xc'))(new Redis(config[_0x6e70('0x9')]));function emit(_0x45a2d4,_0x188ed3,_0x3c4843){io['to'](_0x45a2d4)[_0x6e70('0xd')](_0x188ed3,_0x3c4843);}function getCustomFields(_0x954545,_0x25e61c){var _0x100eb7={};if(_0x954545[_0x6e70('0xe')]>0x0){_[_0x6e70('0xf')](_0x954545,function(_0x3f474a){if(_[_0x6e70('0x10')]([_0x6e70('0x11'),'picklist'],_0x3f474a['type'])&&_0x3f474a[_0x6e70('0x12')]){_0x100eb7[_0x3f474a[_0x6e70('0x12')]]=_0x3f474a[_0x6e70('0x13')][_0x6e70('0x14')]();}else if(_0x3f474a[_0x6e70('0x15')]===_0x6e70('0x16')&&_0x3f474a[_0x6e70('0x17')]&&_0x3f474a[_0x6e70('0x12')]&&_0x25e61c[_0x3f474a['variableName']]){_0x100eb7[_0x3f474a['idField']]=_0x25e61c[_0x3f474a['variableName']][_0x6e70('0x14')]();}else if(_0x3f474a['type']==='customVariable'&&_0x3f474a[_0x6e70('0x18')]&&_0x3f474a[_0x6e70('0x18')]['name']&&_0x3f474a[_0x6e70('0x12')]&&_0x25e61c[_0x3f474a['Variable'][_0x6e70('0x19')][_0x6e70('0x1a')]()]){_0x100eb7[_0x3f474a['idField']]=_0x25e61c[_0x3f474a['Variable'][_0x6e70('0x19')]['toLowerCase']()][_0x6e70('0x14')]();}});}return _0x100eb7;}function createTicket(_0x173afe,_0x53acdc,_0x497d61,_0xc238ba,_0x208e21,_0x2368eb,_0x3a9978){logger[_0x6e70('0x1b')](_0x6e70('0x1c'));var _0x1b2453=_[_0x6e70('0x1d')]({'parent_id':'','assigned_user_id':_0x53acdc['id'],'ticketpriorities':_0x6e70('0x1e'),'ticketstatus':_0x6e70('0x1f'),'ticket_title':intUtil['getString'](_0xc238ba[_0x6e70('0x20')],_0x208e21,'\x20'),'description':intUtil[_0x6e70('0x21')](_0xc238ba[_0x6e70('0x22')],_0x208e21,'\x0a'),'contact_id':_0x497d61['id']},getCustomFields(_0x2368eb,_0x208e21));var _0x502b2d={'method':_0x6e70('0x23'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x173afe['remoteUri']),'form':{'operation':_0x6e70('0x26'),'username':_0x173afe['username'],'sessionName':_0x3a9978['sessionName'],'elementType':'HelpDesk','element':JSON[_0x6e70('0x27')](_0x1b2453)},'json':!![]};return request(_0x502b2d)[_0x6e70('0x28')](function(_0x51d292){if(_0x51d292[_0x6e70('0x29')]){return BPromise[_0x6e70('0x2a')]({'id':_0x51d292['result']['id']});}else{throw new Error(util[_0x6e70('0x24')](_0x6e70('0x2b'),JSON[_0x6e70('0x27')](_0x51d292['error'])));}})['catch'](function(_0x2c4d37){var _0x3af17f=_0x2c4d37[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),'createTicket',_0x3af17f,JSON[_0x6e70('0x27')](_0x2c4d37));});}function getUser(_0x406f29,_0xecf336,_0x2864a0){if(intUtil[_0x6e70('0x2f')](_0xecf336)){logger[_0x6e70('0x1b')](_0x6e70('0x30'),_0xecf336);return request({'method':_0x6e70('0x31'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x406f29['remoteUri']),'qs':{'operation':_0x6e70('0x32'),'username':_0x406f29['username'],'sessionName':_0x2864a0[_0x6e70('0x33')],'query':util['format'](_0x6e70('0x34'),_0xecf336)},'json':!![]})[_0x6e70('0x28')](function(_0x30fa0b){if(_0x30fa0b['success']&&_0x30fa0b[_0x6e70('0x35')][_0x6e70('0xe')]){logger['info'](_0x6e70('0x36'));return BPromise[_0x6e70('0x2a')]({'id':_0x30fa0b['result'][0x0]['id'],'email':_0x30fa0b[_0x6e70('0x35')][0x0][_0x6e70('0x37')],'name':_0x30fa0b[_0x6e70('0x35')][0x0][_0x6e70('0x38')]+'\x20'+_0x30fa0b[_0x6e70('0x35')][_0x6e70('0x39')]});}else{logger[_0x6e70('0x1b')](_0x6e70('0x3a'));return BPromise[_0x6e70('0x2a')]({'id':_0x2864a0[_0x6e70('0x3b')],'email':_0x406f29['username'],'name':_0x6e70('0x3c')});}})['catch'](function(_0x23cd1a){var _0x3222a2=_0x23cd1a[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),_0x6e70('0x3d'),_0x3222a2,JSON[_0x6e70('0x27')](_0x23cd1a));});}else{logger[_0x6e70('0x1b')](_0x6e70('0x3a'));return BPromise[_0x6e70('0x2a')]({'id':_0x2864a0[_0x6e70('0x3b')],'email':_0x406f29[_0x6e70('0x3e')],'name':_0x6e70('0x3c')})['catch'](function(_0x5446a2){var _0x5424eb=_0x5446a2[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),_0x6e70('0x3d'),_0x5424eb,JSON[_0x6e70('0x27')](_0x5446a2));});}}function getEndUser(_0x3bdd87,_0x572a71,_0x3b508c,_0x9e7ad2){logger[_0x6e70('0x1b')](_0x6e70('0x3f'),_0x3b508c);return request({'method':_0x6e70('0x31'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x3bdd87[_0x6e70('0x40')]),'qs':{'operation':'query','username':_0x3bdd87[_0x6e70('0x3e')],'sessionName':_0x9e7ad2[_0x6e70('0x33')],'query':util[_0x6e70('0x24')](_0x6e70('0x41'),_0x3b508c,_0x3b508c,_0x3b508c,_0x3b508c,_0x3b508c)},'json':!![]})[_0x6e70('0x28')](function(_0x1de947){if(_0x1de947[_0x6e70('0x29')]&&_0x1de947['result']['length']){logger['info'](_0x6e70('0x42'));return BPromise[_0x6e70('0x2a')]({'id':_0x1de947[_0x6e70('0x35')][0x0]['id'],'name':_0x1de947[_0x6e70('0x35')][0x0][_0x6e70('0x43')]+'\x20'+_0x1de947['result'][0x0][_0x6e70('0x44')],'phone':_0x3b508c});}else{logger[_0x6e70('0x1b')](_0x6e70('0x45'));return request({'method':'POST','uri':util['format']('%s/webservice.php',_0x3bdd87[_0x6e70('0x40')]),'form':{'operation':'create','sessionName':_0x9e7ad2[_0x6e70('0x33')],'elementType':_0x6e70('0x46'),'element':JSON[_0x6e70('0x27')]({'lastname':_0x572a71,'phone':_0x3b508c,'assigned_user_id':'\x20'})},'json':!![]})[_0x6e70('0x28')](function(_0x59c87d){logger[_0x6e70('0x1b')]('Enduser\x20created.');return BPromise[_0x6e70('0x2a')]({'id':_0x59c87d[_0x6e70('0x35')]['id'],'name':_0x59c87d[_0x6e70('0x35')][_0x6e70('0x44')],'phone':_0x59c87d['result'][_0x6e70('0x47')]});})[_0x6e70('0x48')](function(_0x3d39c3){var _0xac87d6=_0x3d39c3[_0x6e70('0x2c')]||0x1f4;logger[_0x6e70('0x2d')](_0x6e70('0x2e'),'getEndUser',_0xac87d6,JSON[_0x6e70('0x27')](_0x3d39c3));});}});}function getConnection(_0x3884a4){var _0x10de2a=_0x3884a4[_0x6e70('0x3e')];var _0x3f86cf=_0x3884a4[_0x6e70('0x49')];return request({'method':_0x6e70('0x31'),'uri':util['format'](_0x6e70('0x25'),_0x3884a4['remoteUri']),'qs':{'operation':_0x6e70('0x4a'),'username':_0x10de2a},'json':!![]})[_0x6e70('0x28')](function(_0x4b351e){if(_0x4b351e['success']){return request({'method':_0x6e70('0x23'),'uri':util[_0x6e70('0x24')](_0x6e70('0x25'),_0x3884a4['remoteUri']),'form':{'operation':'login','username':_0x10de2a,'accessKey':md5(_0x4b351e[_0x6e70('0x35')][_0x6e70('0x4b')]+_0x3f86cf)},'json':!![]});}})[_0x6e70('0x28')](function(_0x79653){if(_0x79653[_0x6e70('0x29')]){return BPromise[_0x6e70('0x2a')](_0x79653['result']);}else{throw new Error(util[_0x6e70('0x24')](_0x6e70('0x4c'),_0x3884a4['id']));}})[_0x6e70('0x48')](function(_0x6ed023){var _0x2c3a7d=_0x6ed023['statusCode']||0x1f4;logger['error'](_0x6e70('0x2e'),_0x6e70('0x4d'),_0x2c3a7d,JSON[_0x6e70('0x27')](_0x6ed023));});}function request(_0x15f994){logger[_0x6e70('0x1b')]('[HTTP]',JSON[_0x6e70('0x27')](_0x15f994));return rp(_0x15f994);}exports[_0x6e70('0x4e')]=function(_0x1fa320,_0x23ebfb,_0x3aba34,_0x4a111a,_0x1142cd,_0x1dd242){var _0x2c20d3,_0x3fb0d3,_0x8ef4f7,_0x3fd03d;_0x1dd242['remoteUri']=intUtil[_0x6e70('0x4f')](_0x1dd242[_0x6e70('0x40')]);if(_0x1142cd&&_0x1142cd['monitor_format']){logger[_0x6e70('0x1b')](_0x6e70('0x50'),'Recording\x20is\x20enabled!');_0x23ebfb[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x1dd242[_0x6e70('0x53')],_0x23ebfb[_0x6e70('0x54')],md5(_0x23ebfb['uniqueid']));}else{_0x23ebfb[_0x6e70('0x51')]='';}return getConnection(_0x1dd242)[_0x6e70('0x28')](function(_0x10d655){_0x3fd03d=_0x10d655;return getUser(_0x1dd242,_0x4a111a[_0x6e70('0x55')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x1fe13a){_0x2c20d3=_0x1fe13a;logger[_0x6e70('0x1b')](_0x6e70('0x56'),_0x2c20d3['id']);return getEndUser(_0x1dd242,_0x23ebfb[_0x6e70('0x57')],_0x23ebfb[_0x6e70('0x58')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x1b12a1){_0x3fb0d3=_0x1b12a1;logger[_0x6e70('0x1b')](_0x6e70('0x59'),_0x3fb0d3['id']);return createTicket(_0x1dd242,_0x2c20d3,_0x3fb0d3,_0x3aba34,_0x23ebfb,_0x3aba34[_0x6e70('0x5a')],_0x3fd03d);})[_0x6e70('0x28')](function(_0x324fa6){_0x8ef4f7=_0x324fa6;logger[_0x6e70('0x1b')](_0x6e70('0x5b'));logger[_0x6e70('0x1b')]('The\x20Ticket\x20ID\x20is:',_0x8ef4f7['id']);var _0x28898a=util[_0x6e70('0x24')](_0x6e70('0x5c'),_0x1dd242[_0x6e70('0x40')],_[_0x6e70('0x5d')](_0x8ef4f7['id'],'x')[0x1]);logger[_0x6e70('0x1b')]('[QUEUE]',_0x6e70('0x5e'));emit(util[_0x6e70('0x24')]('user:%s',_0x4a111a[_0x6e70('0x19')]),_0x6e70('0x5f'),{'uri':_0x28898a});})[_0x6e70('0x48')](function(_0x590f7f){logger['error'](_0x6e70('0x50'),JSON[_0x6e70('0x27')](_0x590f7f));});};exports[_0x6e70('0x60')]=function(_0x41a861,_0x10d299,_0x739946,_0x30cd88,_0x57bfe5,_0x4d47e1,_0x2c8dc6){var _0x1e23c5,_0x2bf9ec,_0x2ad395,_0x5b1e6f;_0x4d47e1['remoteUri']=intUtil[_0x6e70('0x4f')](_0x4d47e1[_0x6e70('0x40')]);_0x4d47e1['serverUrl']=intUtil['stripTrailingSlash'](_0x4d47e1[_0x6e70('0x53')]);if(_0x2c8dc6&&_0x2c8dc6['recordingFormat']&&_0x2c8dc6[_0x6e70('0x61')]!==_0x6e70('0x62')){logger[_0x6e70('0x1b')](_0x6e70('0x63'),_0x6e70('0x64'));_0x10d299[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x4d47e1['serverUrl'],_0x10d299[_0x6e70('0x54')],md5(_0x10d299[_0x6e70('0x54')]));}return getConnection(_0x4d47e1)[_0x6e70('0x28')](function(_0x346c79){_0x5b1e6f=_0x346c79;return getUser(_0x4d47e1,_0x30cd88[_0x6e70('0x55')],_0x5b1e6f);})['then'](function(_0x5f5b02){_0x1e23c5=_0x5f5b02;logger['info'](_0x6e70('0x56'),_0x1e23c5['id']);return getEndUser(_0x4d47e1,_0x10d299[_0x6e70('0x65')],_0x10d299[_0x6e70('0x66')],_0x5b1e6f);})['then'](function(_0x58cf1c){_0x2bf9ec=_0x58cf1c;logger[_0x6e70('0x1b')](_0x6e70('0x59'),_0x2bf9ec['id']);return createTicket(_0x4d47e1,_0x1e23c5,_0x2bf9ec,_0x739946,_0x10d299,_0x739946[_0x6e70('0x5a')],_0x5b1e6f);})[_0x6e70('0x28')](function(_0x2285f1){_0x2ad395=_0x2285f1;logger[_0x6e70('0x1b')]('Ticket\x20created!');logger[_0x6e70('0x1b')](_0x6e70('0x67'),_0x2ad395['id']);var _0x30d11b=util[_0x6e70('0x24')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x4d47e1[_0x6e70('0x40')],_['split'](_0x2ad395['id'],'x')[0x1]);logger['info'](_0x6e70('0x63'),_0x6e70('0x5e'));emit(util[_0x6e70('0x24')](_0x6e70('0x68'),_0x30cd88[_0x6e70('0x19')]),_0x6e70('0x5f'),{'uri':_0x30d11b});})['catch'](function(_0x370eeb){logger[_0x6e70('0x2d')](_0x6e70('0x63'),JSON[_0x6e70('0x27')](_0x370eeb));});};exports[_0x6e70('0x69')]=function(_0x13c092,_0x363722,_0xd9b4a9,_0x2f1362,_0x29621a,_0x575938){var _0x44c877,_0x303c5a,_0x577c3b,_0x5d398a;_0x575938['remoteUri']=intUtil[_0x6e70('0x4f')](_0x575938[_0x6e70('0x40')]);_0x575938[_0x6e70('0x53')]=intUtil[_0x6e70('0x4f')](_0x575938[_0x6e70('0x53')]);if(_0x29621a&&_0x29621a['monitor_format']){logger['info']('['+_0x363722[_0x6e70('0x6a')][_0x6e70('0x6b')]()+']','Recording\x20is\x20enabled!');_0x363722[_0x6e70('0x51')]=util[_0x6e70('0x24')](_0x6e70('0x52'),_0x575938[_0x6e70('0x53')],_0x363722[_0x6e70('0x54')],md5(_0x363722[_0x6e70('0x54')]));}else{_0x363722[_0x6e70('0x51')]='';}return getConnection(_0x575938)[_0x6e70('0x28')](function(_0x3650e9){_0x5d398a=_0x3650e9;return getUser(_0x575938,'',_0x5d398a);})[_0x6e70('0x28')](function(_0x347cc4){_0x44c877=_0x347cc4;logger[_0x6e70('0x1b')](_0x6e70('0x56'),_0x44c877['id']);return getEndUser(_0x575938,_0x363722[_0x6e70('0x57')],_0x363722['calleridnum'],_0x5d398a);})['then'](function(_0x39ed95){_0x303c5a=_0x39ed95;logger['info'](_0x6e70('0x59'),_0x303c5a['id']);return createTicket(_0x575938,_0x44c877,_0x303c5a,_0xd9b4a9,_0x363722,_0xd9b4a9['Fields'],_0x5d398a);})['then'](function(_0x402f6f){_0x577c3b=_0x402f6f;logger['info']('Ticket\x20created!');logger[_0x6e70('0x1b')](_0x6e70('0x67'),_0x577c3b['id']);})[_0x6e70('0x48')](function(_0x4e9fda){logger['error']('['+_0x363722['lastevent'][_0x6e70('0x6b')]()+']',JSON['stringify'](_0x4e9fda));});}; \ No newline at end of file +var _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(_0x38109e,_0x2473c6){var _0x4103b8=function(_0x21d067){while(--_0x21d067){_0x38109e['push'](_0x38109e['shift']());}};_0x4103b8(++_0x2473c6);}(_0x34e8,0x12c));var _0x834e=function(_0x425815,_0x2640f9){_0x425815=_0x425815-0x0;var _0x2ffe68=_0x34e8[_0x425815];return _0x2ffe68;};'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 b9f5196..2494c65 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 _0x9931=['Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','replace','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','recordingFormat','none','[OUTBOUND]','email','destcalleridname','destcalleridnum','%s/channels/voice/agents/%d/tickets/%d/display.json','%s/agent/tickets/%s','/api/v2','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','inspect','unmanaged','monitor_format','lastevent','toUpperCase','Authorization','\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','zendesk','redis','defaults','localhost','socket.io-emitter','application/json','%s/tickets.json','remoteUri','merge','name','getString','Descriptions','then','info','Ticket\x20created!','ticket','Getting\x20agent\x20with\x20email','%s/search.json','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','find','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','format','Admin\x20account\x20selected.','user','%s/users/me.json','Searching\x20enduser\x20with\x20phone','length','filter','end-user','first','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','POST','Caller\x20-\x20%s','Enduser\x20created.','authType','password','%s/token:%s','username','token','Basic\x20%s','base64','debug','[HTTP]','stringify','GET','forEach','picklist','nameField','toLowerCase','content','toString','includes','string','type','idField','customField','custom_fields','push','variableName','customVariable','Variable','queue','stripTrailingSlash','serverUrl','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','[QUEUE]','Displaying\x20ticket\x20to\x20agent...','newTab'];(function(_0x226ce9,_0x2b7154){var _0x5816d2=function(_0x6495c1){while(--_0x6495c1){_0x226ce9['push'](_0x226ce9['shift']());}};_0x5816d2(++_0x2b7154);}(_0x9931,0x16e));var _0x1993=function(_0x4558a7,_0x4cad23){_0x4558a7=_0x4558a7-0x0;var _0x241274=_0x9931[_0x4558a7];return _0x241274;};'use strict';var _=require(_0x1993('0x0'));var rp=require(_0x1993('0x1'));var md5=require(_0x1993('0x2'));var util=require(_0x1993('0x3'));var Redis=require(_0x1993('0x4'));var intUtil=require(_0x1993('0x5'));var config=require(_0x1993('0x6'));var logger=require(_0x1993('0x7'))(_0x1993('0x8'));config[_0x1993('0x9')]=_[_0x1993('0xa')](config[_0x1993('0x9')],{'host':_0x1993('0xb'),'port':0x18eb});var io=require(_0x1993('0xc'))(new Redis(config[_0x1993('0x9')]));function emit(_0x58b257,_0x595d51,_0x29f9c0){io['to'](_0x58b257)['emit'](_0x595d51,_0x29f9c0);}var headers={'Content-Type':'application/json','Accept':_0x1993('0xd')};function getTicket(_0x587234,_0x142d2d,_0x577aae,_0x1e44ef,_0x4a2790){logger['info']('Creating\x20new\x20ticket...');return request({'uri':util['format'](_0x1993('0xe'),_0x587234[_0x1993('0xf')]),'method':'POST','body':{'ticket':_[_0x1993('0x10')]({'requester_id':_0x577aae['id'],'submitter_id':_0x142d2d?_0x142d2d['id']:undefined,'assignee_id':_0x142d2d?_0x142d2d['id']:undefined,'tags':getTags(_0x1e44ef['Tags'],_0x1993('0x11')),'subject':intUtil['getString'](_0x1e44ef['Subjects'],_0x4a2790,'\x20'),'description':intUtil[_0x1993('0x12')](_0x1e44ef[_0x1993('0x13')],_0x4a2790,'\x0a'),'comment':{'public':![],'body':intUtil[_0x1993('0x12')](_0x1e44ef[_0x1993('0x13')],_0x4a2790,'\x0a')}},getCustomFields(_0x1e44ef['Fields'],_0x4a2790))}})[_0x1993('0x14')](function(_0x5d38d6){logger[_0x1993('0x15')](_0x1993('0x16'));return _0x5d38d6[_0x1993('0x17')];});}function getUser(_0x1f0dff,_0x3eeeef){if(intUtil['validateEmail'](_0x3eeeef)){logger[_0x1993('0x15')](_0x1993('0x18'),_0x3eeeef);return request({'uri':util['format'](_0x1993('0x19'),_0x1f0dff[_0x1993('0xf')]),'qs':{'query':util['format'](_0x1993('0x1a'),_0x3eeeef)}})['then'](function(_0x55224c){if(_0x55224c[_0x1993('0x1b')]){logger['info'](_0x1993('0x1c'));return _[_0x1993('0x1d')](_0x55224c[_0x1993('0x1e')],{'email':_0x3eeeef,'role':_0x1993('0x1f')});}else{logger[_0x1993('0x15')](_0x1993('0x20'));return request({'uri':util[_0x1993('0x21')]('%s/users/me.json',_0x1f0dff[_0x1993('0xf')])})['then'](function(_0x3cb4e4){logger[_0x1993('0x15')](_0x1993('0x22'));return _0x3cb4e4[_0x1993('0x23')];});}});}else{logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x1993('0x21')](_0x1993('0x24'),_0x1f0dff[_0x1993('0xf')])})[_0x1993('0x14')](function(_0x4d827d){logger[_0x1993('0x15')]('Admin\x20account\x20selected.');return _0x4d827d[_0x1993('0x23')];});}}function getEndUser(_0xca4ce8,_0x55b15f,_0x47bfe2){logger[_0x1993('0x15')](_0x1993('0x25'),_0x47bfe2);return request({'uri':util[_0x1993('0x21')](_0x1993('0x19'),_0xca4ce8[_0x1993('0xf')]),'qs':{'query':util[_0x1993('0x21')]('type:user\x20role:end-user\x20phone:%s',_0x47bfe2)}})[_0x1993('0x14')](function(_0x394d74){var _0x3d9d6f;if(_0x394d74['results'][_0x1993('0x26')]){_0x394d74['results']=_[_0x1993('0x27')](_0x394d74[_0x1993('0x1e')],{'suspended':![],'role':_0x1993('0x28')});if(_0x394d74[_0x1993('0x1e')][_0x1993('0x26')]){_0x3d9d6f=_[_0x1993('0x29')](_0x394d74[_0x1993('0x1e')]);}}if(_0x3d9d6f){logger['info']('Enduser\x20found!');return _0x3d9d6f;}else{logger['info'](_0x1993('0x2a'));return request({'uri':util[_0x1993('0x21')](_0x1993('0x2b'),_0xca4ce8[_0x1993('0xf')]),'method':_0x1993('0x2c'),'body':{'user':{'role':'end-user','name':util['format'](_0x1993('0x2d'),_0x55b15f||_0x47bfe2),'phone':_0x47bfe2}}})[_0x1993('0x14')](function(_0x5147c7){logger[_0x1993('0x15')](_0x1993('0x2e'));return _0x5147c7[_0x1993('0x23')];});}});}function getAuth(_0x449860){var _0x106c75;if(_0x449860[_0x1993('0x2f')]===_0x1993('0x30')){_0x106c75=util[_0x1993('0x21')]('%s:%s',_0x449860['username'],_0x449860[_0x1993('0x30')]);}else if(_0x449860['authType']==='token'){_0x106c75=util[_0x1993('0x21')](_0x1993('0x31'),_0x449860[_0x1993('0x32')],_0x449860[_0x1993('0x33')]);}return util[_0x1993('0x21')](_0x1993('0x34'),new Buffer(_0x106c75)['toString'](_0x1993('0x35')));}function request(_0x44ced1){logger[_0x1993('0x36')](_0x1993('0x37'),JSON[_0x1993('0x38')](_0x44ced1));return rp(_[_0x1993('0xa')](_0x44ced1,{'method':_0x1993('0x39'),'headers':headers,'json':!![]}));}function getTags(_0x3b3f2f,_0x3e7a3e){var _0x193341=[];if(_0x3b3f2f&&_0x3b3f2f[_0x1993('0x26')]>0x0){_0x193341=_['map'](_0x3b3f2f,_0x3e7a3e);}return _0x193341;}function getCustomFields(_0x2a2d92,_0xbbea75){var _0x34835a=[];var _0x3bb597={'custom_fields':[]};if(_0x2a2d92[_0x1993('0x26')]>0x0){_[_0x1993('0x3a')](_0x2a2d92,function(_0x138e8c){if(_['includes'](['string',_0x1993('0x3b')],_0x138e8c['type'])&&_0x138e8c[_0x1993('0x3c')]&&!_0x138e8c['customField']){_0x3bb597[_0x138e8c['nameField'][_0x1993('0x3d')]()]=_0x138e8c[_0x1993('0x3e')][_0x1993('0x3f')]();}else if(_[_0x1993('0x40')]([_0x1993('0x41'),_0x1993('0x3b')],_0x138e8c[_0x1993('0x42')])&&_0x138e8c[_0x1993('0x43')]&&_0x138e8c[_0x1993('0x44')]){_0x3bb597[_0x1993('0x45')][_0x1993('0x46')]({'id':_0x138e8c[_0x1993('0x43')],'value':_0x138e8c[_0x1993('0x3e')][_0x1993('0x3f')]()});}else if(_0x138e8c[_0x1993('0x42')]==='variable'&&_0x138e8c[_0x1993('0x47')]&&_0x138e8c['idField']&&_0x138e8c['customField']){_0xbbea75[_0x138e8c[_0x1993('0x47')]]&&_0x3bb597[_0x1993('0x45')]['push']({'id':_0x138e8c[_0x1993('0x43')],'value':_0xbbea75[_0x138e8c[_0x1993('0x47')]][_0x1993('0x3f')]()});}else if(_0x138e8c[_0x1993('0x42')]===_0x1993('0x48')&&_0x138e8c[_0x1993('0x49')]&&_0x138e8c[_0x1993('0x49')][_0x1993('0x11')]&&_0x138e8c[_0x1993('0x43')]&&_0x138e8c[_0x1993('0x44')]){_0xbbea75[_0x138e8c[_0x1993('0x49')][_0x1993('0x11')][_0x1993('0x3d')]()]&&_0x3bb597[_0x1993('0x45')]['push']({'id':_0x138e8c[_0x1993('0x43')],'value':_0xbbea75[_0x138e8c[_0x1993('0x49')][_0x1993('0x11')][_0x1993('0x3d')]()][_0x1993('0x3f')]()});}});}return _0x3bb597;}exports[_0x1993('0x4a')]=function(_0x5c73bc,_0x2d83fb,_0x2b1e31,_0x6231ef,_0x5d2c23,_0x5d3b7d){var _0x50f4d8,_0x21bd46;_0x5d3b7d['remoteUri']=intUtil[_0x1993('0x4b')](_0x5d3b7d['remoteUri']);_0x5d3b7d[_0x1993('0x4c')]=intUtil[_0x1993('0x4b')](_0x5d3b7d[_0x1993('0x4c')]);if(_0x5d2c23&&_0x5d2c23['monitor_format']){logger[_0x1993('0x15')]('[QUEUE]',_0x1993('0x4d'));_0x2d83fb[_0x1993('0x4e')]=util[_0x1993('0x21')](_0x1993('0x4f'),_0x5d3b7d[_0x1993('0x4c')],_0x2d83fb['uniqueid'],md5(_0x2d83fb[_0x1993('0x50')]));}else{_0x2d83fb[_0x1993('0x4e')]='';}headers['Authorization']=getAuth(_0x5d3b7d);return getUser(_0x5d3b7d,_0x6231ef['email'])['then'](function(_0x208059){_0x50f4d8=_0x208059;logger[_0x1993('0x15')](_0x1993('0x51'),_0x50f4d8['id']);return getEndUser(_0x5d3b7d,_0x2d83fb[_0x1993('0x52')],_0x2d83fb[_0x1993('0x53')]);})[_0x1993('0x14')](function(_0x5210c0){_0x21bd46=_0x5210c0;logger['info'](_0x1993('0x54'),_0x21bd46['id']);return getTicket(_0x5d3b7d,_0x50f4d8,_0x21bd46,_0x2b1e31,_0x2d83fb);})[_0x1993('0x14')](function(_0x5e576f){if(_0x5e576f){logger[_0x1993('0x15')](_0x1993('0x55'),_0x5e576f['id']);switch(_0x5d3b7d[_0x1993('0x42')]){case _0x1993('0x56'):logger[_0x1993('0x15')](_0x1993('0x57'),_0x1993('0x58'));return request({'uri':util['format']('%s/channels/voice/agents/%d/tickets/%d/display.json',_0x5d3b7d[_0x1993('0xf')],_0x50f4d8['id'],_0x5e576f['id']),'method':_0x1993('0x2c')});case _0x1993('0x59'):logger[_0x1993('0x15')](_0x1993('0x57'),_0x1993('0x5a'));emit(util['format'](_0x1993('0x5b'),_0x6231ef[_0x1993('0x11')]),'trigger:browser:url',{'uri':util['format']('%s/agent/tickets/%s',_0x5d3b7d[_0x1993('0xf')][_0x1993('0x5c')]('/api/v2',''),_0x5e576f['id'])});break;default:logger[_0x1993('0x5d')](_0x1993('0x57'),_0x1993('0x5e'));}}})[_0x1993('0x5f')](function(_0x2c0a61){logger[_0x1993('0x5d')](_0x1993('0x60'),util['inspect'](_0x2c0a61,{'showHidden':!![],'depth':null}));});};exports['outbound']=function(_0x39946d,_0x43fdc4,_0x35abb3,_0x37b903,_0x4be6d9,_0x254bab,_0x4059b6){var _0x4a4044,_0x23bb55;_0x254bab[_0x1993('0xf')]=intUtil[_0x1993('0x4b')](_0x254bab[_0x1993('0xf')]);_0x254bab['serverUrl']=intUtil[_0x1993('0x4b')](_0x254bab[_0x1993('0x4c')]);if(_0x4059b6&&_0x4059b6[_0x1993('0x61')]&&_0x4059b6[_0x1993('0x61')]!==_0x1993('0x62')){logger[_0x1993('0x15')](_0x1993('0x63'),_0x1993('0x4d'));_0x43fdc4['recordingURL']=util[_0x1993('0x21')](_0x1993('0x4f'),_0x254bab[_0x1993('0x4c')],_0x43fdc4['uniqueid'],md5(_0x43fdc4[_0x1993('0x50')]));}headers['Authorization']=getAuth(_0x254bab);return getUser(_0x254bab,_0x37b903[_0x1993('0x64')])[_0x1993('0x14')](function(_0x9734a7){_0x4a4044=_0x9734a7;logger['info'](_0x1993('0x51'),_0x4a4044['id']);return getEndUser(_0x254bab,_0x43fdc4[_0x1993('0x65')],_0x43fdc4[_0x1993('0x66')]);})[_0x1993('0x14')](function(_0x1fe92e){_0x23bb55=_0x1fe92e;logger[_0x1993('0x15')](_0x1993('0x54'),_0x23bb55['id']);return getTicket(_0x254bab,_0x4a4044,_0x23bb55,_0x35abb3,_0x43fdc4);})['then'](function(_0x151778){if(_0x151778){logger[_0x1993('0x15')]('The\x20Ticket\x20ID\x20is:',_0x151778['id']);switch(_0x254bab[_0x1993('0x42')]){case'integrationTab':logger['info'](_0x1993('0x63'),_0x1993('0x58'));return request({'uri':util[_0x1993('0x21')](_0x1993('0x67'),_0x254bab['remoteUri'],_0x4a4044['id'],_0x151778['id']),'method':'POST'});case _0x1993('0x59'):logger[_0x1993('0x15')]('[OUTBOUND]',_0x1993('0x5a'));emit(util['format'](_0x1993('0x5b'),_0x37b903[_0x1993('0x11')]),'trigger:browser:url',{'uri':util[_0x1993('0x21')](_0x1993('0x68'),_0x254bab[_0x1993('0xf')][_0x1993('0x5c')](_0x1993('0x69'),''),_0x151778['id'])});break;default:logger[_0x1993('0x5d')](_0x1993('0x63'),_0x1993('0x5e'));}}})['catch'](function(_0xab85d3){logger[_0x1993('0x5d')](_0x1993('0x6a'),util[_0x1993('0x6b')](_0xab85d3,{'showHidden':!![],'depth':null}));});};exports[_0x1993('0x6c')]=function(_0x5a2415,_0x410304,_0x3eb0cc,_0x24ee40,_0x39ff5e,_0x291768){var _0x299909,_0x41fc2c;_0x291768[_0x1993('0xf')]=intUtil[_0x1993('0x4b')](_0x291768[_0x1993('0xf')]);_0x291768[_0x1993('0x4c')]=intUtil[_0x1993('0x4b')](_0x291768[_0x1993('0x4c')]);if(_0x39ff5e&&_0x39ff5e[_0x1993('0x6d')]){logger['info']('['+_0x410304[_0x1993('0x6e')][_0x1993('0x6f')]()+']',_0x1993('0x4d'));_0x410304[_0x1993('0x4e')]=util[_0x1993('0x21')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x291768['serverUrl'],_0x410304[_0x1993('0x50')],md5(_0x410304['uniqueid']));}else{_0x410304[_0x1993('0x4e')]='';}headers[_0x1993('0x70')]=getAuth(_0x291768);return getUser(_0x291768)[_0x1993('0x14')](function(_0x56007d){_0x299909=_0x56007d;logger[_0x1993('0x15')](_0x1993('0x51'),_0x299909['id']);return getEndUser(_0x291768,_0x410304['calleridname'],_0x410304['calleridnum']);})[_0x1993('0x14')](function(_0x650fcb){_0x41fc2c=_0x650fcb;logger[_0x1993('0x15')]('The\x20Enduser\x20ID\x20is:',_0x41fc2c['id']);return getTicket(_0x291768,_0x299909,_0x41fc2c,_0x3eb0cc,_0x410304);})[_0x1993('0x14')](function(_0x2ec7cc){if(_0x2ec7cc){logger[_0x1993('0x15')]('The\x20Ticket\x20ID\x20is:',_0x2ec7cc['id']);}})['catch'](function(_0x36cc0d){logger[_0x1993('0x5d')]('['+_0x410304[_0x1993('0x6e')][_0x1993('0x6f')]()+']'+_0x1993('0x71'),util['inspect'](_0x36cc0d,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xd818=['type:user\x20role:end-user\x20phone:%s','filter','end-user','length','first','Enduser\x20found!','%s/users.json','authType','password','%s:%s','username','token','%s/token:%s','base64','debug','[HTTP]','map','includes','string','picklist','type','nameField','customField','content','toString','custom_fields','push','idField','variable','variableName','customVariable','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','Recording\x20is\x20enabled!','recordingURL','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','POST','newTab','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','replace','/api/v2','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','outbound','recordingFormat','none','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','%s/agent/tickets/%s','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','inspect','toUpperCase','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','lastevent','lodash','md5','util','./util','../../../../config/environment','zendesk','defaults','redis','localhost','socket.io-emitter','emit','application/json','info','Creating\x20new\x20ticket...','%s/tickets.json','remoteUri','Tags','name','getString','Descriptions','Fields','then','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','format','%s/search.json','count','Agent\x20found!','results','agent','%s/users/me.json','user','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone'];(function(_0x2d7ae3,_0x53414e){var _0x187643=function(_0x46cbaf){while(--_0x46cbaf){_0x2d7ae3['push'](_0x2d7ae3['shift']());}};_0x187643(++_0x53414e);}(_0xd818,0xb4));var _0x8d81=function(_0x284a61,_0x231686){_0x284a61=_0x284a61-0x0;var _0x220e3c=_0xd818[_0x284a61];return _0x220e3c;};'use strict';var _=require(_0x8d81('0x0'));var rp=require('request-promise');var md5=require(_0x8d81('0x1'));var util=require(_0x8d81('0x2'));var Redis=require('ioredis');var intUtil=require(_0x8d81('0x3'));var config=require(_0x8d81('0x4'));var logger=require('../../../../config/logger')(_0x8d81('0x5'));config['redis']=_[_0x8d81('0x6')](config[_0x8d81('0x7')],{'host':_0x8d81('0x8'),'port':0x18eb});var io=require(_0x8d81('0x9'))(new Redis(config[_0x8d81('0x7')]));function emit(_0x408291,_0x6cc153,_0x4cfd0d){io['to'](_0x408291)[_0x8d81('0xa')](_0x6cc153,_0x4cfd0d);}var headers={'Content-Type':_0x8d81('0xb'),'Accept':_0x8d81('0xb')};function getTicket(_0x49bdcd,_0x18366d,_0x1b0bd9,_0x23e959,_0x500aec){logger[_0x8d81('0xc')](_0x8d81('0xd'));return request({'uri':util['format'](_0x8d81('0xe'),_0x49bdcd[_0x8d81('0xf')]),'method':'POST','body':{'ticket':_['merge']({'requester_id':_0x1b0bd9['id'],'submitter_id':_0x18366d?_0x18366d['id']:undefined,'assignee_id':_0x18366d?_0x18366d['id']:undefined,'tags':getTags(_0x23e959[_0x8d81('0x10')],_0x8d81('0x11')),'subject':intUtil[_0x8d81('0x12')](_0x23e959['Subjects'],_0x500aec,'\x20'),'description':intUtil['getString'](_0x23e959[_0x8d81('0x13')],_0x500aec,'\x0a'),'comment':{'public':![],'body':intUtil[_0x8d81('0x12')](_0x23e959[_0x8d81('0x13')],_0x500aec,'\x0a')}},getCustomFields(_0x23e959[_0x8d81('0x14')],_0x500aec))}})[_0x8d81('0x15')](function(_0x2b13b9){logger[_0x8d81('0xc')](_0x8d81('0x16'));return _0x2b13b9[_0x8d81('0x17')];});}function getUser(_0x3481f6,_0x5c442a){if(intUtil[_0x8d81('0x18')](_0x5c442a)){logger[_0x8d81('0xc')](_0x8d81('0x19'),_0x5c442a);return request({'uri':util[_0x8d81('0x1a')](_0x8d81('0x1b'),_0x3481f6[_0x8d81('0xf')]),'qs':{'query':util[_0x8d81('0x1a')]('type:user\x20role:agent\x20email:%s',_0x5c442a)}})[_0x8d81('0x15')](function(_0x10a1ba){if(_0x10a1ba[_0x8d81('0x1c')]){logger[_0x8d81('0xc')](_0x8d81('0x1d'));return _['find'](_0x10a1ba[_0x8d81('0x1e')],{'email':_0x5c442a,'role':_0x8d81('0x1f')});}else{logger[_0x8d81('0xc')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x8d81('0x1a')](_0x8d81('0x20'),_0x3481f6[_0x8d81('0xf')])})[_0x8d81('0x15')](function(_0xf6d77c){logger[_0x8d81('0xc')]('Admin\x20account\x20selected.');return _0xf6d77c[_0x8d81('0x21')];});}});}else{logger['info'](_0x8d81('0x22'));return request({'uri':util[_0x8d81('0x1a')]('%s/users/me.json',_0x3481f6[_0x8d81('0xf')])})[_0x8d81('0x15')](function(_0x2a0161){logger[_0x8d81('0xc')]('Admin\x20account\x20selected.');return _0x2a0161['user'];});}}function getEndUser(_0x4a6be6,_0x2b9f23,_0x5a86c5){logger['info'](_0x8d81('0x23'),_0x5a86c5);return request({'uri':util['format'](_0x8d81('0x1b'),_0x4a6be6['remoteUri']),'qs':{'query':util[_0x8d81('0x1a')](_0x8d81('0x24'),_0x5a86c5)}})[_0x8d81('0x15')](function(_0x3704f4){var _0x30e8d4;if(_0x3704f4['results']['length']){_0x3704f4['results']=_[_0x8d81('0x25')](_0x3704f4[_0x8d81('0x1e')],{'suspended':![],'role':_0x8d81('0x26')});if(_0x3704f4[_0x8d81('0x1e')][_0x8d81('0x27')]){_0x30e8d4=_[_0x8d81('0x28')](_0x3704f4[_0x8d81('0x1e')]);}}if(_0x30e8d4){logger[_0x8d81('0xc')](_0x8d81('0x29'));return _0x30e8d4;}else{logger['info']('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util['format'](_0x8d81('0x2a'),_0x4a6be6[_0x8d81('0xf')]),'method':'POST','body':{'user':{'role':'end-user','name':util['format']('Caller\x20-\x20%s',_0x2b9f23||_0x5a86c5),'phone':_0x5a86c5}}})[_0x8d81('0x15')](function(_0x21ff5f){logger[_0x8d81('0xc')]('Enduser\x20created.');return _0x21ff5f['user'];});}});}function getAuth(_0x97288d){var _0x46e165;if(_0x97288d[_0x8d81('0x2b')]===_0x8d81('0x2c')){_0x46e165=util[_0x8d81('0x1a')](_0x8d81('0x2d'),_0x97288d[_0x8d81('0x2e')],_0x97288d[_0x8d81('0x2c')]);}else if(_0x97288d[_0x8d81('0x2b')]===_0x8d81('0x2f')){_0x46e165=util['format'](_0x8d81('0x30'),_0x97288d[_0x8d81('0x2e')],_0x97288d[_0x8d81('0x2f')]);}return util[_0x8d81('0x1a')]('Basic\x20%s',new Buffer(_0x46e165)['toString'](_0x8d81('0x31')));}function request(_0x48b763){logger[_0x8d81('0x32')](_0x8d81('0x33'),JSON['stringify'](_0x48b763));return rp(_[_0x8d81('0x6')](_0x48b763,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x18c1fb,_0x139f65){var _0x622ec9=[];if(_0x18c1fb&&_0x18c1fb[_0x8d81('0x27')]>0x0){_0x622ec9=_[_0x8d81('0x34')](_0x18c1fb,_0x139f65);}return _0x622ec9;}function getCustomFields(_0x2a3632,_0x23054f){var _0xc5e681=[];var _0x3c0be3={'custom_fields':[]};if(_0x2a3632[_0x8d81('0x27')]>0x0){_['forEach'](_0x2a3632,function(_0x193be2){if(_[_0x8d81('0x35')]([_0x8d81('0x36'),_0x8d81('0x37')],_0x193be2[_0x8d81('0x38')])&&_0x193be2[_0x8d81('0x39')]&&!_0x193be2[_0x8d81('0x3a')]){_0x3c0be3[_0x193be2[_0x8d81('0x39')]['toLowerCase']()]=_0x193be2[_0x8d81('0x3b')][_0x8d81('0x3c')]();}else if(_[_0x8d81('0x35')]([_0x8d81('0x36'),_0x8d81('0x37')],_0x193be2[_0x8d81('0x38')])&&_0x193be2['idField']&&_0x193be2['customField']){_0x3c0be3[_0x8d81('0x3d')][_0x8d81('0x3e')]({'id':_0x193be2[_0x8d81('0x3f')],'value':_0x193be2[_0x8d81('0x3b')][_0x8d81('0x3c')]()});}else if(_0x193be2[_0x8d81('0x38')]===_0x8d81('0x40')&&_0x193be2[_0x8d81('0x41')]&&_0x193be2[_0x8d81('0x3f')]&&_0x193be2[_0x8d81('0x3a')]){_0x23054f[_0x193be2[_0x8d81('0x41')]]&&_0x3c0be3['custom_fields']['push']({'id':_0x193be2[_0x8d81('0x3f')],'value':_0x23054f[_0x193be2[_0x8d81('0x41')]][_0x8d81('0x3c')]()});}else if(_0x193be2[_0x8d81('0x38')]===_0x8d81('0x42')&&_0x193be2[_0x8d81('0x43')]&&_0x193be2[_0x8d81('0x43')]['name']&&_0x193be2[_0x8d81('0x3f')]&&_0x193be2[_0x8d81('0x3a')]){_0x23054f[_0x193be2[_0x8d81('0x43')][_0x8d81('0x11')]['toLowerCase']()]&&_0x3c0be3['custom_fields']['push']({'id':_0x193be2[_0x8d81('0x3f')],'value':_0x23054f[_0x193be2[_0x8d81('0x43')][_0x8d81('0x11')]['toLowerCase']()][_0x8d81('0x3c')]()});}});}return _0x3c0be3;}exports[_0x8d81('0x44')]=function(_0x36928c,_0x3b42fd,_0x38ff40,_0x36e504,_0x449d95,_0x22bfa2){var _0x19d87b,_0x2cdb76;_0x22bfa2[_0x8d81('0xf')]=intUtil[_0x8d81('0x45')](_0x22bfa2['remoteUri']);_0x22bfa2[_0x8d81('0x46')]=intUtil[_0x8d81('0x45')](_0x22bfa2['serverUrl']);if(_0x449d95&&_0x449d95[_0x8d81('0x47')]){logger[_0x8d81('0xc')]('[QUEUE]',_0x8d81('0x48'));_0x3b42fd[_0x8d81('0x49')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x22bfa2['serverUrl'],_0x3b42fd['uniqueid'],md5(_0x3b42fd[_0x8d81('0x4a')]));}else{_0x3b42fd[_0x8d81('0x49')]='';}headers[_0x8d81('0x4b')]=getAuth(_0x22bfa2);return getUser(_0x22bfa2,_0x36e504[_0x8d81('0x4c')])[_0x8d81('0x15')](function(_0x522823){_0x19d87b=_0x522823;logger[_0x8d81('0xc')](_0x8d81('0x4d'),_0x19d87b['id']);return getEndUser(_0x22bfa2,_0x3b42fd[_0x8d81('0x4e')],_0x3b42fd[_0x8d81('0x4f')]);})['then'](function(_0x22580f){_0x2cdb76=_0x22580f;logger[_0x8d81('0xc')]('The\x20Enduser\x20ID\x20is:',_0x2cdb76['id']);return getTicket(_0x22bfa2,_0x19d87b,_0x2cdb76,_0x38ff40,_0x3b42fd);})[_0x8d81('0x15')](function(_0x4afc5d){if(_0x4afc5d){logger['info'](_0x8d81('0x50'),_0x4afc5d['id']);switch(_0x22bfa2['type']){case _0x8d81('0x51'):logger[_0x8d81('0xc')]('[QUEUE]',_0x8d81('0x52'));return request({'uri':util[_0x8d81('0x1a')](_0x8d81('0x53'),_0x22bfa2[_0x8d81('0xf')],_0x19d87b['id'],_0x4afc5d['id']),'method':_0x8d81('0x54')});case _0x8d81('0x55'):logger[_0x8d81('0xc')](_0x8d81('0x56'),_0x8d81('0x57'));emit(util[_0x8d81('0x1a')](_0x8d81('0x58'),_0x36e504[_0x8d81('0x11')]),_0x8d81('0x59'),{'uri':util['format']('%s/agent/tickets/%s',_0x22bfa2[_0x8d81('0xf')][_0x8d81('0x5a')](_0x8d81('0x5b'),''),_0x4afc5d['id'])});break;default:logger[_0x8d81('0x5c')](_0x8d81('0x56'),_0x8d81('0x5d'));}}})[_0x8d81('0x5e')](function(_0x45f2de){logger[_0x8d81('0x5c')](_0x8d81('0x5f'),util['inspect'](_0x45f2de,{'showHidden':!![],'depth':null}));});};exports[_0x8d81('0x60')]=function(_0x273102,_0x5d645e,_0x461a08,_0x1f1c20,_0x4914f6,_0x5b56b3,_0x2c5fe3){var _0xbae262,_0x13adbd;_0x5b56b3[_0x8d81('0xf')]=intUtil['stripTrailingSlash'](_0x5b56b3[_0x8d81('0xf')]);_0x5b56b3['serverUrl']=intUtil[_0x8d81('0x45')](_0x5b56b3[_0x8d81('0x46')]);if(_0x2c5fe3&&_0x2c5fe3['recordingFormat']&&_0x2c5fe3[_0x8d81('0x61')]!==_0x8d81('0x62')){logger[_0x8d81('0xc')]('[OUTBOUND]',_0x8d81('0x48'));_0x5d645e[_0x8d81('0x49')]=util[_0x8d81('0x1a')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x5b56b3['serverUrl'],_0x5d645e['uniqueid'],md5(_0x5d645e[_0x8d81('0x4a')]));}headers[_0x8d81('0x4b')]=getAuth(_0x5b56b3);return getUser(_0x5b56b3,_0x1f1c20[_0x8d81('0x4c')])[_0x8d81('0x15')](function(_0x31d8a4){_0xbae262=_0x31d8a4;logger[_0x8d81('0xc')](_0x8d81('0x4d'),_0xbae262['id']);return getEndUser(_0x5b56b3,_0x5d645e[_0x8d81('0x63')],_0x5d645e[_0x8d81('0x64')]);})[_0x8d81('0x15')](function(_0x134bae){_0x13adbd=_0x134bae;logger['info'](_0x8d81('0x65'),_0x13adbd['id']);return getTicket(_0x5b56b3,_0xbae262,_0x13adbd,_0x461a08,_0x5d645e);})[_0x8d81('0x15')](function(_0x129e71){if(_0x129e71){logger['info']('The\x20Ticket\x20ID\x20is:',_0x129e71['id']);switch(_0x5b56b3['type']){case _0x8d81('0x51'):logger[_0x8d81('0xc')]('[OUTBOUND]',_0x8d81('0x52'));return request({'uri':util['format'](_0x8d81('0x53'),_0x5b56b3[_0x8d81('0xf')],_0xbae262['id'],_0x129e71['id']),'method':_0x8d81('0x54')});case _0x8d81('0x55'):logger[_0x8d81('0xc')]('[OUTBOUND]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x8d81('0x1a')](_0x8d81('0x58'),_0x1f1c20['name']),_0x8d81('0x59'),{'uri':util[_0x8d81('0x1a')](_0x8d81('0x66'),_0x5b56b3[_0x8d81('0xf')]['replace'](_0x8d81('0x5b'),''),_0x129e71['id'])});break;default:logger[_0x8d81('0x5c')]('[OUTBOUND]',_0x8d81('0x5d'));}}})['catch'](function(_0x22d828){logger['error'](_0x8d81('0x67'),util[_0x8d81('0x68')](_0x22d828,{'showHidden':!![],'depth':null}));});};exports['unmanaged']=function(_0x367c7b,_0x295539,_0x3e6851,_0x28bdb2,_0x3b325c,_0x1c630c){var _0x4c09e7,_0x2f4e30;_0x1c630c[_0x8d81('0xf')]=intUtil['stripTrailingSlash'](_0x1c630c[_0x8d81('0xf')]);_0x1c630c[_0x8d81('0x46')]=intUtil[_0x8d81('0x45')](_0x1c630c[_0x8d81('0x46')]);if(_0x3b325c&&_0x3b325c[_0x8d81('0x47')]){logger[_0x8d81('0xc')]('['+_0x295539['lastevent'][_0x8d81('0x69')]()+']',_0x8d81('0x48'));_0x295539[_0x8d81('0x49')]=util[_0x8d81('0x1a')](_0x8d81('0x6a'),_0x1c630c[_0x8d81('0x46')],_0x295539[_0x8d81('0x4a')],md5(_0x295539[_0x8d81('0x4a')]));}else{_0x295539[_0x8d81('0x49')]='';}headers[_0x8d81('0x4b')]=getAuth(_0x1c630c);return getUser(_0x1c630c)['then'](function(_0x290e3c){_0x4c09e7=_0x290e3c;logger[_0x8d81('0xc')]('The\x20User\x20ID\x20is:',_0x4c09e7['id']);return getEndUser(_0x1c630c,_0x295539[_0x8d81('0x4e')],_0x295539[_0x8d81('0x4f')]);})['then'](function(_0xfea3f3){_0x2f4e30=_0xfea3f3;logger['info']('The\x20Enduser\x20ID\x20is:',_0x2f4e30['id']);return getTicket(_0x1c630c,_0x4c09e7,_0x2f4e30,_0x3e6851,_0x295539);})[_0x8d81('0x15')](function(_0x2716f4){if(_0x2716f4){logger['info']('The\x20Ticket\x20ID\x20is:',_0x2716f4['id']);}})[_0x8d81('0x5e')](function(_0x19d79d){logger['error']('['+_0x295539[_0x8d81('0x6b')]['toUpperCase']()+']'+'\x20Error\x20running\x20Zendesk\x20integration',util[_0x8d81('0x68')](_0x19d79d,{'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 9c2bb56..ed6ef72 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 _0x3678=['customVariable','Variable','name','toLowerCase','indexOf','split','isNil','isBefore','access_token','zone','https://accounts.zoho.com','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','then','expires_in','seconds','catch','error','Failing\x20creating\x20the\x20access_token','stack','info','GET','format','ActiveUsers','users','findIndex','Using\x20the\x20admin\x20account!','user','profile','Administrator','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','enduserType','https://www.zohoapis.','/crm/v2/','startCase','role','first_name','last_name','SUCCESS','details','Error:\x20','log','CREATE\x20ERROR','Zoho-oauthtoken\x20','moduleSearch','uri','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','moduleCreate','contact','/crm/v2/Contacts/search?criteria=((Phone:equals:','nothing','lead','Leads','Creating\x20new\x20call...','administrator','getString','Subjects','Description','Descriptions','Full_Name','First_Name','Last_Name','talktime','utc','mm:ss','answertime','endtime','Call_Duration','YYYY-MM-DDTHH:mm:ss','diff','called','Call_Result','Called','complete','connect','Answered','rejected','Rejected','Abandoned','timeout','Timeout','Call_Start_Time','outbound','agentcalledAt','Call_Type','Inbound','merge','Fields','err','queue','host','stripTrailingSlash','serverUrl','monitor_format','Recording\x20is\x20enabled!','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','recordingURL','zoho.eu','com','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Call\x20ID\x20is:','[QUEUE]','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','[OUTBOUND]','destcalleridname','destcalleridnum','trigger:browser:url','unmanaged','lastevent','toUpperCase','lodash','request-promise','md5','util','./util','moment','ioredis','bluebird','../../../../config/environment','../../../../config/logger','zoho','redis','defaults','localhost','socket.io-emitter','emit','debug','[HTTP]','stringify','length','includes','string','type','idField','toString','variableName'];(function(_0xd5d1d1,_0x32b81d){var _0x362d2e=function(_0x54f45d){while(--_0x54f45d){_0xd5d1d1['push'](_0xd5d1d1['shift']());}};_0x362d2e(++_0x32b81d);}(_0x3678,0x81));var _0x8367=function(_0x2d3a4d,_0x47561e){_0x2d3a4d=_0x2d3a4d-0x0;var _0x3a94a3=_0x3678[_0x2d3a4d];return _0x3a94a3;};'use strict';var _=require(_0x8367('0x0'));var rp=require(_0x8367('0x1'));var md5=require(_0x8367('0x2'));var util=require(_0x8367('0x3'));var intUtil=require(_0x8367('0x4'));var moment=require(_0x8367('0x5'));var Redis=require(_0x8367('0x6'));var BPromise=require(_0x8367('0x7'));var config=require(_0x8367('0x8'));var logger=require(_0x8367('0x9'))(_0x8367('0xa'));config[_0x8367('0xb')]=_[_0x8367('0xc')](config[_0x8367('0xb')],{'host':_0x8367('0xd'),'port':0x18eb});var io=require(_0x8367('0xe'))(new Redis(config['redis']));function emit(_0x32f7c5,_0x307500,_0x7dadcf){io['to'](_0x32f7c5)[_0x8367('0xf')](_0x307500,_0x7dadcf);}function request(_0x44269c){logger[_0x8367('0x10')](_0x8367('0x11'),JSON[_0x8367('0x12')](_0x44269c));return rp(_0x44269c);}function getCustomFields(_0x5b0f71,_0x2be594){var _0x35542f={};if(_0x5b0f71[_0x8367('0x13')]>0x0){_['forEach'](_0x5b0f71,function(_0xb24a65){if(_[_0x8367('0x14')]([_0x8367('0x15'),'picklist'],_0xb24a65[_0x8367('0x16')])&&_0xb24a65[_0x8367('0x17')]){_0x35542f[_0xb24a65['idField']]=_0xb24a65['content'][_0x8367('0x18')]();}else if(_0xb24a65[_0x8367('0x16')]==='variable'&&_0xb24a65[_0x8367('0x19')]&&_0xb24a65[_0x8367('0x17')]&&_0x2be594[_0xb24a65[_0x8367('0x19')]]){_0x35542f[_0xb24a65['idField']]=_0x2be594[_0xb24a65['variableName']][_0x8367('0x18')]();}else if(_0xb24a65[_0x8367('0x16')]===_0x8367('0x1a')&&_0xb24a65[_0x8367('0x1b')]&&_0xb24a65[_0x8367('0x1b')][_0x8367('0x1c')]&&_0xb24a65[_0x8367('0x17')]&&_0x2be594[_0xb24a65[_0x8367('0x1b')][_0x8367('0x1c')][_0x8367('0x1d')]()]){_0x35542f[_0xb24a65[_0x8367('0x17')]]=_0x2be594[_0xb24a65[_0x8367('0x1b')][_0x8367('0x1c')][_0x8367('0x1d')]()]['toString']();}});}return _0x35542f;}function getName(_0x2861d3){if(_0x2861d3[_0x8367('0x1e')]('\x20')>0x0){var _0x5775f7=_0x2861d3[_0x8367('0x1f')](/ (.+)/);if(_0x5775f7[0x1]){return _0x5775f7;}}return[_0x2861d3,_0x2861d3];}var accountsTokens={};function getAccessToken(_0x41e67b){return new Promise(function(_0x38d4a4,_0x31cbca){if(!_[_0x8367('0x20')](accountsTokens[_0x41e67b['id']])&&!_[_0x8367('0x20')](accountsTokens[_0x41e67b['id']]['access_token'])){if(moment()[_0x8367('0x21')](accountsTokens[_0x41e67b['id']]['expires_in'])){_0x38d4a4(accountsTokens[_0x41e67b['id']][_0x8367('0x22')]);}}var _0x2f0c6b;switch(_0x41e67b[_0x8367('0x23')]){case'US':_0x2f0c6b=_0x8367('0x24');break;case'AU':_0x2f0c6b='https://accounts.zoho.com.au';break;case'EU':_0x2f0c6b=_0x8367('0x25');break;case'IN':_0x2f0c6b=_0x8367('0x26');break;case'CN':_0x2f0c6b=_0x8367('0x27');break;default:_0x2f0c6b=_0x8367('0x25');break;}var _0x4c6691={'method':_0x8367('0x28'),'uri':_0x2f0c6b+_0x8367('0x29'),'qs':{'refresh_token':_0x41e67b[_0x8367('0x2a')],'client_id':_0x41e67b[_0x8367('0x2b')],'client_secret':_0x41e67b[_0x8367('0x2c')],'grant_type':_0x8367('0x2d')},'json':!![]};return rp(_0x4c6691)[_0x8367('0x2e')](function(_0x4b065f){accountsTokens[_0x41e67b['id']]={'access_token':_0x4b065f[_0x8367('0x22')],'expires_in':moment()['add'](_0x4b065f[_0x8367('0x2f')],_0x8367('0x30'))};_0x38d4a4(_0x4b065f[_0x8367('0x22')]);})[_0x8367('0x31')](function(_0x3fadb7){logger[_0x8367('0x32')](_0x8367('0x33'),_0x3fadb7[_0x8367('0x34')]);_0x31cbca(_0x3fadb7);});});}function getUser(_0x305c41,_0x5ec8fa,_0xfc9e2c,_0x164475){logger[_0x8367('0x35')]('Search\x20user');return request({'method':_0x8367('0x36'),'uri':util[_0x8367('0x37')]('https://www.zohoapis.%s/crm/v2/users',_0x5ec8fa),'qs':{'type':_0x8367('0x38')},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x305c41},'json':!![]})[_0x8367('0x2e')](function(_0x5de78f){if(_0x5de78f[_0x8367('0x39')]){var _0x31b40b=-0x1;if(_['isArrayLikeObject'](_0x5de78f['users'])){if(!_[_0x8367('0x20')](_0x164475)){_0x31b40b=_[_0x8367('0x3a')](_0x5de78f[_0x8367('0x39')],function(_0x285e20){return _0x285e20['email']===_0x164475;});}if(_0x31b40b>=0x0){logger['info']('Agent\x20found!');}else{logger[_0x8367('0x35')](_0x8367('0x3b'));_0x31b40b=_[_0x8367('0x3a')](_0x5de78f['users'],function(_0x4d23de){return _0x4d23de['profile'][_0x8367('0x1c')]==='Administrator';});}return _0x5de78f[_0x8367('0x39')][_0x31b40b];}else{if(_0x5de78f[_0x8367('0x3c')][_0x8367('0x3d')][_0x8367('0x1c')]===_0x8367('0x3e')){logger[_0x8367('0x35')](_0x8367('0x3b'));user=_0x5de78f['user'];return user;}else{logger[_0x8367('0x32')](_0x8367('0x3f'),JSON['stringify'](_0x5de78f));throw new Error(_0x8367('0x40')+JSON['stringify'](_0x5de78f));}}}else{logger[_0x8367('0x32')](_0x8367('0x3f'),JSON[_0x8367('0x12')](_0x5de78f));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0x8367('0x12')](_0x5de78f));}})[_0x8367('0x31')](function(_0x109020){console['error'](_0x109020);});}function getZohoUser(_0x1d1b44,_0x3553b3){return new BPromise(function(_0x2d8fcd,_0x3ea305){request(_0x1d1b44)[_0x8367('0x2e')](function(_0x1fa92c){var _0x38dd7b=null;if(_0x1fa92c){_0x38dd7b=_0x1fa92c[_0x8367('0x41')][0x0];_0x38dd7b[_0x8367('0x42')]=_0x3553b3;}_0x2d8fcd(_0x38dd7b);})['catch'](function(_0x5ef97f){_0x3ea305(_0x5ef97f);});});}function createEndUser(_0x25556d,_0x22667d,_0x594979,_0x46baee,_0x11978b,_0x3334bb){var _0x594979=getName(_0x594979);return request({'method':_0x8367('0x28'),'uri':_0x8367('0x43')+_0x22667d+_0x8367('0x44')+_[_0x8367('0x45')](_0x3334bb['moduleCreate'])+'s','body':{'data':[{'Last_Name':_0x594979[0x1],'First_Name':_0x594979[0x0],'Phone':_0x46baee,'Owner':{'name':!_[_0x8367('0x20')](_0x11978b[_0x8367('0x46')][_0x8367('0x1c')])?_0x11978b['role'][_0x8367('0x1c')]:!_[_0x8367('0x20')](_0x11978b['first_name'])?_0x11978b[_0x8367('0x47')]+'\x20'+_0x11978b[_0x8367('0x48')]:_0x11978b[_0x8367('0x48')],'id':_0x11978b['id']}}]},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x25556d},'json':!![]})[_0x8367('0x2e')](function(_0x2fcf02){if(_0x2fcf02&&_0x2fcf02[_0x8367('0x41')][0x0]['code']===_0x8367('0x49')){var _0x47b38a=_0x2fcf02[_0x8367('0x41')][0x0][_0x8367('0x4a')];_0x47b38a[_0x8367('0x42')]=_[_0x8367('0x45')](_0x3334bb['moduleCreate'])+'s';return _0x47b38a;}logger[_0x8367('0x32')](_0x8367('0x3f'),JSON[_0x8367('0x12')](data));throw new Error(_0x8367('0x4b')+JSON[_0x8367('0x12')](data));})[_0x8367('0x31')](function(_0x21d7f7){console[_0x8367('0x4c')](_0x8367('0x4d'),_0x21d7f7);});}function getEndUser(_0x8e6e1b,_0x18119d,_0x3236f1,_0x6a2985,_0x47d2ea,_0x2c38c0,_0x4e7719){var _0x416837={'method':'GET','uri':'','headers':{'Authorization':_0x8367('0x4e')+_0x8e6e1b},'json':!![]};switch(_0x4e7719[_0x8367('0x4f')]){case'contact_lead':_0x416837[_0x8367('0x50')]='https://www.zohoapis.'+_0x18119d+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x47d2ea+'))';return getZohoUser(_0x416837,_0x8367('0x51'))[_0x8367('0x2e')](function(_0x2afc69){if(_0x2afc69)return _0x2afc69;_0x416837['uri']=_0x8367('0x43')+_0x18119d+_0x8367('0x52')+_0x47d2ea+'))';return getZohoUser(_0x416837,'Leads')[_0x8367('0x2e')](function(_0x2e2c33){if(_0x2e2c33)return _0x2e2c33;if(_0x4e7719[_0x8367('0x53')]!='nothing'){return createEndUser(_0x8e6e1b,_0x18119d,_0x6a2985,_0x47d2ea,_0x2c38c0,_0x4e7719);}else{return{};}});});break;case _0x8367('0x54'):_0x416837[_0x8367('0x50')]=_0x8367('0x43')+_0x18119d+_0x8367('0x55')+_0x47d2ea+'))';return getZohoUser(_0x416837,_0x8367('0x51'))['then'](function(_0x4c2402){if(_0x4c2402)return _0x4c2402;if(_0x4e7719[_0x8367('0x53')]!=_0x8367('0x56')){return createEndUser(_0x8e6e1b,_0x18119d,_0x6a2985,_0x47d2ea,_0x2c38c0,_0x4e7719);}else{return{};}});break;case _0x8367('0x57'):_0x416837[_0x8367('0x50')]=_0x8367('0x43')+_0x18119d+_0x8367('0x52')+_0x47d2ea+'))';return getZohoUser(_0x416837,_0x8367('0x58'))[_0x8367('0x2e')](function(_0x376745){if(_0x376745)return _0x376745;if(_0x4e7719['moduleCreate']!=_0x8367('0x56')){return createEndUser(_0x8e6e1b,_0x18119d,_0x6a2985,_0x47d2ea,_0x2c38c0,_0x4e7719);}else{return{};}});break;}}function getCall(_0x180bf8,_0x3ef075,_0x10362c,_0x41efe6,_0x284eac,_0x1611df,_0x536061,_0x3b2c80){logger['info'](_0x8367('0x59'));var _0x3a04d5={};_0x3a04d5['Owner']={'name':!_['isNil'](_0x41efe6[_0x8367('0x46')][_0x8367('0x1c')])&&!_[_0x8367('0x20')](_0x41efe6['profile'][_0x8367('0x1c')])&&_0x41efe6[_0x8367('0x3d')][_0x8367('0x1c')]===_0x8367('0x5a')?_0x41efe6['role'][_0x8367('0x1c')]:!_['isNil'](_0x41efe6['first_name'])?_0x41efe6[_0x8367('0x47')]+'\x20'+_0x41efe6['last_name']:_0x41efe6[_0x8367('0x48')],'id':_0x41efe6['id']};_0x3a04d5['Subject']=intUtil[_0x8367('0x5b')](_0x1611df[_0x8367('0x5c')],_0x536061,'\x20');_0x3a04d5[_0x8367('0x5d')]=intUtil['getString'](_0x1611df[_0x8367('0x5e')],_0x536061,'\x0a');if(_0x284eac['enduserType']==='Contacts'){_0x3a04d5['Who_Id']={'name':!_[_0x8367('0x20')](_0x284eac[_0x8367('0x5f')])?_0x284eac[_0x8367('0x5f')]:!_[_0x8367('0x20')](_0x284eac[_0x8367('0x60')])?_0x284eac['First_Name']+'\x20'+_0x284eac[_0x8367('0x61')]:_0x284eac[_0x8367('0x61')],'id':_0x284eac['id']};}if(_0x284eac['enduserType']===_0x8367('0x58')){_0x3a04d5['What_Id']={'name':!_[_0x8367('0x20')](_0x284eac[_0x8367('0x5f')])?_0x284eac[_0x8367('0x5f')]:!_[_0x8367('0x20')](_0x284eac['First_Name'])?_0x284eac['First_Name']+'\x20'+_0x284eac[_0x8367('0x61')]:_0x284eac[_0x8367('0x61')],'id':_0x284eac['id']};_0x3a04d5['$se_module']=_[_0x8367('0x45')](_0x284eac[_0x8367('0x42')]);}if(_0x536061[_0x8367('0x62')]){_0x3a04d5['Call_Duration']=moment[_0x8367('0x63')](parseInt(_0x536061[_0x8367('0x62')])*0x3e8)[_0x8367('0x37')](_0x8367('0x64'));}else if(_0x536061[_0x8367('0x65')]&&_0x536061[_0x8367('0x66')]){_0x3a04d5[_0x8367('0x67')]=moment[_0x8367('0x63')](moment(_0x536061[_0x8367('0x66')],_0x8367('0x68'))[_0x8367('0x69')](moment(_0x536061['starttime'],_0x8367('0x68'))))[_0x8367('0x37')](_0x8367('0x64'));}switch(_0x536061['lastevent']){case _0x8367('0x6a'):_0x3a04d5[_0x8367('0x6b')]=_0x8367('0x6c');break;case _0x8367('0x6d'):case _0x8367('0x6e'):_0x3a04d5['Call_Result']=_0x8367('0x6f');break;case _0x8367('0x70'):_0x3a04d5['Call_Result']=_0x8367('0x71');break;case'abandoned':_0x3a04d5[_0x8367('0x6b')]=_0x8367('0x72');break;case _0x8367('0x73'):_0x3a04d5[_0x8367('0x6b')]=_0x8367('0x74');default:}_0x3a04d5[_0x8367('0x75')]=(_0x3b2c80===_0x8367('0x76')?moment(_0x536061['starttime'])[_0x8367('0x37')](_0x8367('0x68')):moment(_0x536061[_0x8367('0x77')])[_0x8367('0x37')](_0x8367('0x68')))||moment()[_0x8367('0x37')](_0x8367('0x68'));_0x3a04d5[_0x8367('0x78')]=_0x3b2c80||_0x8367('0x79');_0x3a04d5=_[_0x8367('0x7a')](_0x3a04d5,getCustomFields(_0x1611df[_0x8367('0x7b')],_0x536061));return request({'method':_0x8367('0x28'),'uri':_0x8367('0x43')+_0x3ef075+'/crm/v2/Calls','headers':{'Authorization':_0x8367('0x4e')+_0x180bf8},'body':{'data':[_0x3a04d5]},'json':!![]})[_0x8367('0x2e')](function(_0x4da3fe){if(_0x4da3fe&&_0x4da3fe['data'][0x0]['code']===_0x8367('0x49')){logger[_0x8367('0x35')]('Call\x20created!');return{'id':_0x4da3fe[_0x8367('0x41')][0x0][_0x8367('0x4a')]['id']};}})[_0x8367('0x31')](function(_0x4c1626){logger[_0x8367('0x35')](_0x8367('0x7c'),_0x4c1626['stack']);console[_0x8367('0x4c')](_0x8367('0x7c'),_0x4c1626);});}exports[_0x8367('0x7d')]=function(_0x107fdd,_0x1fe02c,_0x444b0d,_0x2e01ca,_0x14469d,_0x553901){var _0x9532e1,_0x24d0d2,_0x539474;_0x553901[_0x8367('0x7e')]=intUtil['stripTrailingSlash'](_0x553901[_0x8367('0x7e')]);_0x553901['serverUrl']=intUtil[_0x8367('0x7f')](_0x553901[_0x8367('0x80')]);if(_0x14469d&&_0x14469d[_0x8367('0x81')]){logger['info']('[QUEUE]',_0x8367('0x82'));_0x1fe02c['recordingURL']=_0x553901[_0x8367('0x80')]+_0x8367('0x83')+_0x1fe02c[_0x8367('0x84')]+_0x8367('0x85')+md5(_0x1fe02c[_0x8367('0x84')]);}else{_0x1fe02c[_0x8367('0x86')]='';}var _0x3980ac=_0x553901[_0x8367('0x7e')]===_0x8367('0x87')?'eu':_0x8367('0x88');return getAccessToken(_0x553901)[_0x8367('0x2e')](function(_0x2501cf){_0x539474=_0x2501cf;return getUser(_0x539474,_0x3980ac,_0x553901,_0x2e01ca[_0x8367('0x89')]);})['then'](function(_0x2ddfe3){_0x9532e1=_0x2ddfe3;logger[_0x8367('0x35')](_0x8367('0x8a'),_0x9532e1['id']);return getEndUser(_0x539474,_0x3980ac,_0x553901,_0x1fe02c[_0x8367('0x8b')],_0x1fe02c[_0x8367('0x8c')],_0x9532e1,_0x444b0d);})['then'](function(_0x163176){_0x24d0d2=_0x163176;return getCall(_0x539474,_0x3980ac,_0x553901,_0x9532e1,_0x24d0d2,_0x444b0d,_0x1fe02c,_0x8367('0x79'));})[_0x8367('0x2e')](function(_0x2187a2){if(_0x2187a2){logger[_0x8367('0x35')](_0x8367('0x8d'),_0x2187a2['id']);logger[_0x8367('0x35')](_0x8367('0x8e'),_0x8367('0x8f'));emit(util['format'](_0x8367('0x90'),_0x2e01ca[_0x8367('0x1c')]),'trigger:browser:url',{'uri':_0x8367('0x91')+_0x553901[_0x8367('0x7e')]+_0x8367('0x92')+_0x2187a2['id']});}})[_0x8367('0x31')](function(_0x22a1a7){logger[_0x8367('0x32')]('[QUEUE]',JSON[_0x8367('0x12')](_0x22a1a7));});};exports[_0x8367('0x76')]=function(_0x4820c4,_0x4cb198,_0x1452aa,_0x991a3b,_0xd642a4,_0x2386f7,_0x744bf3){var _0x581957,_0x32cd87,_0x50362d;_0x2386f7[_0x8367('0x7e')]=intUtil[_0x8367('0x7f')](_0x2386f7[_0x8367('0x7e')]);_0x2386f7[_0x8367('0x80')]=intUtil[_0x8367('0x7f')](_0x2386f7[_0x8367('0x80')]);if(_0x744bf3&&_0x744bf3[_0x8367('0x93')]&&_0x744bf3[_0x8367('0x93')]!=='none'){logger[_0x8367('0x35')](_0x8367('0x94'),_0x8367('0x82'));_0x4cb198[_0x8367('0x86')]=_0x2386f7['serverUrl']+_0x8367('0x83')+_0x4cb198[_0x8367('0x84')]+_0x8367('0x85')+md5(_0x4cb198['uniqueid']);}var _0x20395e=_0x2386f7[_0x8367('0x7e')]==='zoho.eu'?'eu':_0x8367('0x88');return getAccessToken(_0x2386f7)[_0x8367('0x2e')](function(_0x5b5741){_0x50362d=_0x5b5741;return getUser(_0x50362d,_0x20395e,_0x2386f7,_0x991a3b['email']);})[_0x8367('0x2e')](function(_0x756145){_0x581957=_0x756145;logger[_0x8367('0x35')](_0x8367('0x8a'),_0x581957['id']);return getEndUser(_0x50362d,_0x20395e,_0x2386f7,_0x4cb198[_0x8367('0x95')],_0x4cb198[_0x8367('0x96')],_0x581957,_0x1452aa);})[_0x8367('0x2e')](function(_0x322b3c){_0x32cd87=_0x322b3c;return getCall(_0x50362d,_0x20395e,_0x2386f7,_0x581957,_0x32cd87,_0x1452aa,_0x4cb198,'Outbound');})['then'](function(_0x21fff2){if(_0x21fff2){logger[_0x8367('0x35')](_0x8367('0x8d'),_0x21fff2['id']);logger[_0x8367('0x35')](_0x8367('0x94'),_0x8367('0x8f'));emit(util['format']('user:%s',_0x991a3b['name']),_0x8367('0x97'),{'uri':_0x8367('0x91')+_0x2386f7[_0x8367('0x7e')]+_0x8367('0x92')+_0x21fff2['id']});}})[_0x8367('0x31')](function(_0xdc64a9){logger[_0x8367('0x32')](_0x8367('0x94'),JSON[_0x8367('0x12')](_0xdc64a9));});};exports[_0x8367('0x98')]=function(_0x1f212b,_0x488dfa,_0x37b726,_0x1f7fde,_0x5d2f90,_0x17195e){var _0x15229b,_0x10276f,_0x39f196;_0x17195e[_0x8367('0x7e')]=intUtil[_0x8367('0x7f')](_0x17195e['host']);_0x17195e[_0x8367('0x80')]=intUtil[_0x8367('0x7f')](_0x17195e['serverUrl']);if(_0x5d2f90&&_0x5d2f90['monitor_format']){logger[_0x8367('0x35')]('['+_0x488dfa[_0x8367('0x99')][_0x8367('0x9a')]()+']',_0x8367('0x82'));_0x488dfa[_0x8367('0x86')]=_0x17195e[_0x8367('0x80')]+'/api/voice/recordings/'+_0x488dfa[_0x8367('0x84')]+_0x8367('0x85')+md5(_0x488dfa[_0x8367('0x84')]);}else{_0x488dfa[_0x8367('0x86')]='';}var _0x524962=_0x17195e[_0x8367('0x7e')]==='zoho.eu'?'eu':'com';return getAccessToken(_0x17195e)[_0x8367('0x2e')](function(_0x564725){_0x39f196=_0x564725;return getUser(_0x39f196,_0x524962,_0x17195e);})[_0x8367('0x2e')](function(_0x115c3f){_0x15229b=_0x115c3f;logger[_0x8367('0x35')](_0x8367('0x8a'),_0x15229b['id']);return getEndUser(_0x39f196,_0x524962,_0x17195e,_0x488dfa[_0x8367('0x8b')],_0x488dfa[_0x8367('0x8c')],_0x15229b,_0x37b726);})[_0x8367('0x2e')](function(_0x49a915){_0x10276f=_0x49a915;return getCall(_0x39f196,_0x524962,_0x17195e,_0x15229b,_0x10276f,_0x37b726,_0x488dfa,'Inbound');})[_0x8367('0x2e')](function(_0xddd36b){if(_0xddd36b){logger['info']('The\x20Call\x20ID\x20is:',_0xddd36b['id']);}})[_0x8367('0x31')](function(_0x2f7d64){logger[_0x8367('0x32')]('['+_0x488dfa[_0x8367('0x99')]['toUpperCase']()+']',JSON[_0x8367('0x12')](_0x2f7d64));});}; \ No newline at end of file +var _0xf631=['Search\x20user','GET','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','isArrayLikeObject','findIndex','users','email','Using\x20the\x20admin\x20account!','Administrator','user','profile','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','enduserType','https://www.zohoapis.','/crm/v2/','startCase','moduleCreate','role','first_name','last_name','code','SUCCESS','Error:\x20','log','CREATE\x20ERROR','moduleSearch','uri','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','nothing','/crm/v2/Contacts/search?criteria=((Phone:equals:','lead','Leads','Owner','administrator','Subject','getString','Description','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','What_Id','talktime','utc','format','mm:ss','answertime','endtime','Call_Duration','YYYY-MM-DDTHH:mm:ss','diff','starttime','lastevent','called','Call_Result','Called','complete','connect','Answered','rejected','Rejected','abandoned','Abandoned','timeout','Timeout','Call_Start_Time','outbound','agentcalledAt','Call_Type','Inbound','merge','Fields','Call\x20created!','details','err','queue','host','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','/downloads?type=uniqueid&token=','uniqueid','com','The\x20User\x20ID\x20is:','calleridname','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','[OUTBOUND]','zoho.eu','destcalleridname','destcalleridnum','unmanaged','calleridnum','lodash','request-promise','md5','./util','moment','ioredis','../../../../config/environment','../../../../config/logger','zoho','redis','defaults','localhost','socket.io-emitter','debug','[HTTP]','stringify','forEach','includes','string','type','idField','content','toString','variable','variableName','customVariable','Variable','name','toLowerCase','indexOf','split','isNil','access_token','isBefore','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','then','add','expires_in','catch','error','stack','info'];(function(_0x3324aa,_0x103ffc){var _0x126a5b=function(_0x4d44cd){while(--_0x4d44cd){_0x3324aa['push'](_0x3324aa['shift']());}};_0x126a5b(++_0x103ffc);}(_0xf631,0x1a9));var _0x1f63=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf631[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x1f63('0x0'));var rp=require(_0x1f63('0x1'));var md5=require(_0x1f63('0x2'));var util=require('util');var intUtil=require(_0x1f63('0x3'));var moment=require(_0x1f63('0x4'));var Redis=require(_0x1f63('0x5'));var BPromise=require('bluebird');var config=require(_0x1f63('0x6'));var logger=require(_0x1f63('0x7'))(_0x1f63('0x8'));config[_0x1f63('0x9')]=_[_0x1f63('0xa')](config[_0x1f63('0x9')],{'host':_0x1f63('0xb'),'port':0x18eb});var io=require(_0x1f63('0xc'))(new Redis(config['redis']));function emit(_0x22670a,_0x14011b,_0x4d8104){io['to'](_0x22670a)['emit'](_0x14011b,_0x4d8104);}function request(_0x1b9776){logger[_0x1f63('0xd')](_0x1f63('0xe'),JSON[_0x1f63('0xf')](_0x1b9776));return rp(_0x1b9776);}function getCustomFields(_0x4420ba,_0x1a583b){var _0x1e315e={};if(_0x4420ba['length']>0x0){_[_0x1f63('0x10')](_0x4420ba,function(_0x906bd8){if(_[_0x1f63('0x11')]([_0x1f63('0x12'),'picklist'],_0x906bd8[_0x1f63('0x13')])&&_0x906bd8[_0x1f63('0x14')]){_0x1e315e[_0x906bd8[_0x1f63('0x14')]]=_0x906bd8[_0x1f63('0x15')][_0x1f63('0x16')]();}else if(_0x906bd8[_0x1f63('0x13')]===_0x1f63('0x17')&&_0x906bd8['variableName']&&_0x906bd8[_0x1f63('0x14')]&&_0x1a583b[_0x906bd8[_0x1f63('0x18')]]){_0x1e315e[_0x906bd8[_0x1f63('0x14')]]=_0x1a583b[_0x906bd8[_0x1f63('0x18')]][_0x1f63('0x16')]();}else if(_0x906bd8[_0x1f63('0x13')]===_0x1f63('0x19')&&_0x906bd8[_0x1f63('0x1a')]&&_0x906bd8['Variable'][_0x1f63('0x1b')]&&_0x906bd8[_0x1f63('0x14')]&&_0x1a583b[_0x906bd8[_0x1f63('0x1a')][_0x1f63('0x1b')][_0x1f63('0x1c')]()]){_0x1e315e[_0x906bd8[_0x1f63('0x14')]]=_0x1a583b[_0x906bd8[_0x1f63('0x1a')][_0x1f63('0x1b')]['toLowerCase']()][_0x1f63('0x16')]();}});}return _0x1e315e;}function getName(_0x2e53e2){if(_0x2e53e2[_0x1f63('0x1d')]('\x20')>0x0){var _0x11a63f=_0x2e53e2[_0x1f63('0x1e')](/ (.+)/);if(_0x11a63f[0x1]){return _0x11a63f;}}return[_0x2e53e2,_0x2e53e2];}var accountsTokens={};function getAccessToken(_0x50ba47){return new Promise(function(_0x4b6d7f,_0x5b692b){if(!_['isNil'](accountsTokens[_0x50ba47['id']])&&!_[_0x1f63('0x1f')](accountsTokens[_0x50ba47['id']][_0x1f63('0x20')])){if(moment()[_0x1f63('0x21')](accountsTokens[_0x50ba47['id']]['expires_in'])){_0x4b6d7f(accountsTokens[_0x50ba47['id']]['access_token']);}}var _0xb4033c;switch(_0x50ba47[_0x1f63('0x22')]){case'US':_0xb4033c=_0x1f63('0x23');break;case'AU':_0xb4033c=_0x1f63('0x24');break;case'EU':_0xb4033c=_0x1f63('0x25');break;case'IN':_0xb4033c='https://accounts.zoho.in';break;case'CN':_0xb4033c=_0x1f63('0x26');break;default:_0xb4033c=_0x1f63('0x25');break;}var _0x4f145e={'method':_0x1f63('0x27'),'uri':_0xb4033c+_0x1f63('0x28'),'qs':{'refresh_token':_0x50ba47[_0x1f63('0x29')],'client_id':_0x50ba47[_0x1f63('0x2a')],'client_secret':_0x50ba47[_0x1f63('0x2b')],'grant_type':_0x1f63('0x2c')},'json':!![]};return rp(_0x4f145e)[_0x1f63('0x2d')](function(_0x3b812c){accountsTokens[_0x50ba47['id']]={'access_token':_0x3b812c[_0x1f63('0x20')],'expires_in':moment()[_0x1f63('0x2e')](_0x3b812c[_0x1f63('0x2f')],'seconds')};_0x4b6d7f(_0x3b812c[_0x1f63('0x20')]);})[_0x1f63('0x30')](function(_0x167fff){logger[_0x1f63('0x31')]('Failing\x20creating\x20the\x20access_token',_0x167fff[_0x1f63('0x32')]);_0x5b692b(_0x167fff);});});}function getUser(_0x9336d4,_0x2e32e8,_0x201ce9,_0x564ca8){logger[_0x1f63('0x33')](_0x1f63('0x34'));return request({'method':_0x1f63('0x35'),'uri':util['format'](_0x1f63('0x36'),_0x2e32e8),'qs':{'type':_0x1f63('0x37')},'headers':{'Authorization':_0x1f63('0x38')+_0x9336d4},'json':!![]})[_0x1f63('0x2d')](function(_0x3bb07e){if(_0x3bb07e['users']){var _0x338bd3=-0x1;if(_[_0x1f63('0x39')](_0x3bb07e['users'])){if(!_[_0x1f63('0x1f')](_0x564ca8)){_0x338bd3=_[_0x1f63('0x3a')](_0x3bb07e[_0x1f63('0x3b')],function(_0xcf21d7){return _0xcf21d7[_0x1f63('0x3c')]===_0x564ca8;});}if(_0x338bd3>=0x0){logger[_0x1f63('0x33')]('Agent\x20found!');}else{logger[_0x1f63('0x33')](_0x1f63('0x3d'));_0x338bd3=_[_0x1f63('0x3a')](_0x3bb07e[_0x1f63('0x3b')],function(_0x26add1){return _0x26add1['profile'][_0x1f63('0x1b')]===_0x1f63('0x3e');});}return _0x3bb07e[_0x1f63('0x3b')][_0x338bd3];}else{if(_0x3bb07e[_0x1f63('0x3f')][_0x1f63('0x40')]['name']===_0x1f63('0x3e')){logger[_0x1f63('0x33')](_0x1f63('0x3d'));user=_0x3bb07e[_0x1f63('0x3f')];return user;}else{logger[_0x1f63('0x31')](_0x1f63('0x41'),JSON['stringify'](_0x3bb07e));throw new Error(_0x1f63('0x42')+JSON['stringify'](_0x3bb07e));}}}else{logger[_0x1f63('0x31')](_0x1f63('0x41'),JSON[_0x1f63('0xf')](_0x3bb07e));throw new Error(_0x1f63('0x42')+JSON[_0x1f63('0xf')](_0x3bb07e));}})['catch'](function(_0x3b76cd){console[_0x1f63('0x31')](_0x3b76cd);});}function getZohoUser(_0x1c3fa9,_0x73385d){return new BPromise(function(_0x85f36d,_0x1126ee){request(_0x1c3fa9)[_0x1f63('0x2d')](function(_0x5c0718){var _0x35d7d3=null;if(_0x5c0718){_0x35d7d3=_0x5c0718[_0x1f63('0x43')][0x0];_0x35d7d3[_0x1f63('0x44')]=_0x73385d;}_0x85f36d(_0x35d7d3);})['catch'](function(_0x20365f){_0x1126ee(_0x20365f);});});}function createEndUser(_0xea390,_0x3bd727,_0x299bc6,_0x322a3e,_0x31d66e,_0x26cf36){var _0x299bc6=getName(_0x299bc6);return request({'method':_0x1f63('0x27'),'uri':_0x1f63('0x45')+_0x3bd727+_0x1f63('0x46')+_[_0x1f63('0x47')](_0x26cf36[_0x1f63('0x48')])+'s','body':{'data':[{'Last_Name':_0x299bc6[0x1],'First_Name':_0x299bc6[0x0],'Phone':_0x322a3e,'Owner':{'name':!_[_0x1f63('0x1f')](_0x31d66e[_0x1f63('0x49')][_0x1f63('0x1b')])?_0x31d66e[_0x1f63('0x49')][_0x1f63('0x1b')]:!_[_0x1f63('0x1f')](_0x31d66e[_0x1f63('0x4a')])?_0x31d66e[_0x1f63('0x4a')]+'\x20'+_0x31d66e[_0x1f63('0x4b')]:_0x31d66e[_0x1f63('0x4b')],'id':_0x31d66e['id']}}]},'headers':{'Authorization':_0x1f63('0x38')+_0xea390},'json':!![]})[_0x1f63('0x2d')](function(_0xdfbc2d){if(_0xdfbc2d&&_0xdfbc2d[_0x1f63('0x43')][0x0][_0x1f63('0x4c')]===_0x1f63('0x4d')){var _0x57cb5b=_0xdfbc2d['data'][0x0]['details'];_0x57cb5b[_0x1f63('0x44')]=_[_0x1f63('0x47')](_0x26cf36[_0x1f63('0x48')])+'s';return _0x57cb5b;}logger[_0x1f63('0x31')](_0x1f63('0x41'),JSON[_0x1f63('0xf')](data));throw new Error(_0x1f63('0x4e')+JSON[_0x1f63('0xf')](data));})[_0x1f63('0x30')](function(_0x2ecd59){console[_0x1f63('0x4f')](_0x1f63('0x50'),_0x2ecd59);});}function getEndUser(_0x2085d1,_0x16ad60,_0x19d743,_0x22b3a8,_0x96d0fa,_0x3485a5,_0x3d0174){var _0x491d2a={'method':'GET','uri':'','headers':{'Authorization':_0x1f63('0x38')+_0x2085d1},'json':!![]};switch(_0x3d0174[_0x1f63('0x51')]){case'contact_lead':_0x491d2a[_0x1f63('0x52')]='https://www.zohoapis.'+_0x16ad60+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x96d0fa+'))';return getZohoUser(_0x491d2a,_0x1f63('0x53'))['then'](function(_0x1b1ed6){if(_0x1b1ed6)return _0x1b1ed6;_0x491d2a[_0x1f63('0x52')]=_0x1f63('0x45')+_0x16ad60+_0x1f63('0x54')+_0x96d0fa+'))';return getZohoUser(_0x491d2a,'Leads')[_0x1f63('0x2d')](function(_0x365b23){if(_0x365b23)return _0x365b23;if(_0x3d0174[_0x1f63('0x48')]!=_0x1f63('0x55')){return createEndUser(_0x2085d1,_0x16ad60,_0x22b3a8,_0x96d0fa,_0x3485a5,_0x3d0174);}else{return{};}});});break;case'contact':_0x491d2a['uri']=_0x1f63('0x45')+_0x16ad60+_0x1f63('0x56')+_0x96d0fa+'))';return getZohoUser(_0x491d2a,_0x1f63('0x53'))[_0x1f63('0x2d')](function(_0x10a567){if(_0x10a567)return _0x10a567;if(_0x3d0174[_0x1f63('0x48')]!=_0x1f63('0x55')){return createEndUser(_0x2085d1,_0x16ad60,_0x22b3a8,_0x96d0fa,_0x3485a5,_0x3d0174);}else{return{};}});break;case _0x1f63('0x57'):_0x491d2a['uri']=_0x1f63('0x45')+_0x16ad60+_0x1f63('0x54')+_0x96d0fa+'))';return getZohoUser(_0x491d2a,_0x1f63('0x58'))[_0x1f63('0x2d')](function(_0x587b5b){if(_0x587b5b)return _0x587b5b;if(_0x3d0174[_0x1f63('0x48')]!='nothing'){return createEndUser(_0x2085d1,_0x16ad60,_0x22b3a8,_0x96d0fa,_0x3485a5,_0x3d0174);}else{return{};}});break;}}function getCall(_0x2a86b0,_0x28a414,_0x293606,_0x36460d,_0x5c1c20,_0x473a6b,_0x8a4834,_0x4fe1f4){logger[_0x1f63('0x33')]('Creating\x20new\x20call...');var _0x3f1929={};_0x3f1929[_0x1f63('0x59')]={'name':!_[_0x1f63('0x1f')](_0x36460d[_0x1f63('0x49')]['name'])&&!_['isNil'](_0x36460d['profile'][_0x1f63('0x1b')])&&_0x36460d[_0x1f63('0x40')]['name']===_0x1f63('0x5a')?_0x36460d['role'][_0x1f63('0x1b')]:!_[_0x1f63('0x1f')](_0x36460d['first_name'])?_0x36460d[_0x1f63('0x4a')]+'\x20'+_0x36460d[_0x1f63('0x4b')]:_0x36460d[_0x1f63('0x4b')],'id':_0x36460d['id']};_0x3f1929[_0x1f63('0x5b')]=intUtil[_0x1f63('0x5c')](_0x473a6b['Subjects'],_0x8a4834,'\x20');_0x3f1929[_0x1f63('0x5d')]=intUtil[_0x1f63('0x5c')](_0x473a6b[_0x1f63('0x5e')],_0x8a4834,'\x0a');if(_0x5c1c20[_0x1f63('0x44')]===_0x1f63('0x53')){_0x3f1929[_0x1f63('0x5f')]={'name':!_[_0x1f63('0x1f')](_0x5c1c20[_0x1f63('0x60')])?_0x5c1c20['Full_Name']:!_[_0x1f63('0x1f')](_0x5c1c20[_0x1f63('0x61')])?_0x5c1c20[_0x1f63('0x61')]+'\x20'+_0x5c1c20[_0x1f63('0x62')]:_0x5c1c20[_0x1f63('0x62')],'id':_0x5c1c20['id']};}if(_0x5c1c20[_0x1f63('0x44')]==='Leads'){_0x3f1929[_0x1f63('0x63')]={'name':!_[_0x1f63('0x1f')](_0x5c1c20['Full_Name'])?_0x5c1c20['Full_Name']:!_[_0x1f63('0x1f')](_0x5c1c20[_0x1f63('0x61')])?_0x5c1c20[_0x1f63('0x61')]+'\x20'+_0x5c1c20[_0x1f63('0x62')]:_0x5c1c20[_0x1f63('0x62')],'id':_0x5c1c20['id']};_0x3f1929['$se_module']=_[_0x1f63('0x47')](_0x5c1c20[_0x1f63('0x44')]);}if(_0x8a4834[_0x1f63('0x64')]){_0x3f1929['Call_Duration']=moment[_0x1f63('0x65')](parseInt(_0x8a4834[_0x1f63('0x64')])*0x3e8)[_0x1f63('0x66')](_0x1f63('0x67'));}else if(_0x8a4834[_0x1f63('0x68')]&&_0x8a4834[_0x1f63('0x69')]){_0x3f1929[_0x1f63('0x6a')]=moment[_0x1f63('0x65')](moment(_0x8a4834[_0x1f63('0x69')],_0x1f63('0x6b'))[_0x1f63('0x6c')](moment(_0x8a4834[_0x1f63('0x6d')],_0x1f63('0x6b'))))[_0x1f63('0x66')](_0x1f63('0x67'));}switch(_0x8a4834[_0x1f63('0x6e')]){case _0x1f63('0x6f'):_0x3f1929[_0x1f63('0x70')]=_0x1f63('0x71');break;case _0x1f63('0x72'):case _0x1f63('0x73'):_0x3f1929[_0x1f63('0x70')]=_0x1f63('0x74');break;case _0x1f63('0x75'):_0x3f1929[_0x1f63('0x70')]=_0x1f63('0x76');break;case _0x1f63('0x77'):_0x3f1929[_0x1f63('0x70')]=_0x1f63('0x78');break;case _0x1f63('0x79'):_0x3f1929[_0x1f63('0x70')]=_0x1f63('0x7a');default:}_0x3f1929[_0x1f63('0x7b')]=(_0x4fe1f4===_0x1f63('0x7c')?moment(_0x8a4834[_0x1f63('0x6d')])['format']('YYYY-MM-DDTHH:mm:ss'):moment(_0x8a4834[_0x1f63('0x7d')])[_0x1f63('0x66')](_0x1f63('0x6b')))||moment()[_0x1f63('0x66')](_0x1f63('0x6b'));_0x3f1929[_0x1f63('0x7e')]=_0x4fe1f4||_0x1f63('0x7f');_0x3f1929=_[_0x1f63('0x80')](_0x3f1929,getCustomFields(_0x473a6b[_0x1f63('0x81')],_0x8a4834));return request({'method':_0x1f63('0x27'),'uri':'https://www.zohoapis.'+_0x28a414+'/crm/v2/Calls','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x2a86b0},'body':{'data':[_0x3f1929]},'json':!![]})[_0x1f63('0x2d')](function(_0x3cede6){if(_0x3cede6&&_0x3cede6[_0x1f63('0x43')][0x0]['code']===_0x1f63('0x4d')){logger[_0x1f63('0x33')](_0x1f63('0x82'));return{'id':_0x3cede6['data'][0x0][_0x1f63('0x83')]['id']};}})[_0x1f63('0x30')](function(_0x26cc4d){logger[_0x1f63('0x33')](_0x1f63('0x84'),_0x26cc4d[_0x1f63('0x32')]);console[_0x1f63('0x4f')](_0x1f63('0x84'),_0x26cc4d);});}exports[_0x1f63('0x85')]=function(_0x30659e,_0xd4b417,_0x2e1e33,_0x5e27d4,_0x6dc742,_0x5eb1f4){var _0x4a1498,_0x339bc6,_0xa82e64;_0x5eb1f4[_0x1f63('0x86')]=intUtil[_0x1f63('0x87')](_0x5eb1f4['host']);_0x5eb1f4[_0x1f63('0x88')]=intUtil[_0x1f63('0x87')](_0x5eb1f4[_0x1f63('0x88')]);if(_0x6dc742&&_0x6dc742[_0x1f63('0x89')]){logger[_0x1f63('0x33')](_0x1f63('0x8a'),_0x1f63('0x8b'));_0xd4b417[_0x1f63('0x8c')]=_0x5eb1f4[_0x1f63('0x88')]+_0x1f63('0x8d')+_0xd4b417['uniqueid']+_0x1f63('0x8e')+md5(_0xd4b417[_0x1f63('0x8f')]);}else{_0xd4b417[_0x1f63('0x8c')]='';}var _0x49aa93=_0x5eb1f4[_0x1f63('0x86')]==='zoho.eu'?'eu':_0x1f63('0x90');return getAccessToken(_0x5eb1f4)['then'](function(_0x397152){_0xa82e64=_0x397152;return getUser(_0xa82e64,_0x49aa93,_0x5eb1f4,_0x5e27d4['email']);})[_0x1f63('0x2d')](function(_0x79f02){_0x4a1498=_0x79f02;logger[_0x1f63('0x33')](_0x1f63('0x91'),_0x4a1498['id']);return getEndUser(_0xa82e64,_0x49aa93,_0x5eb1f4,_0xd4b417[_0x1f63('0x92')],_0xd4b417['calleridnum'],_0x4a1498,_0x2e1e33);})[_0x1f63('0x2d')](function(_0x1e4659){_0x339bc6=_0x1e4659;return getCall(_0xa82e64,_0x49aa93,_0x5eb1f4,_0x4a1498,_0x339bc6,_0x2e1e33,_0xd4b417,'Inbound');})[_0x1f63('0x2d')](function(_0x5384de){if(_0x5384de){logger['info'](_0x1f63('0x93'),_0x5384de['id']);logger['info'](_0x1f63('0x8a'),_0x1f63('0x94'));emit(util['format']('user:%s',_0x5e27d4[_0x1f63('0x1b')]),_0x1f63('0x95'),{'uri':_0x1f63('0x96')+_0x5eb1f4[_0x1f63('0x86')]+_0x1f63('0x97')+_0x5384de['id']});}})[_0x1f63('0x30')](function(_0x5ccaac){logger[_0x1f63('0x31')](_0x1f63('0x8a'),JSON[_0x1f63('0xf')](_0x5ccaac));});};exports[_0x1f63('0x7c')]=function(_0x4f6c3f,_0x405629,_0x277366,_0x470153,_0x1b809b,_0x4f04f4,_0x3fcbc9){var _0x7aadc8,_0x515ff5,_0x2301ec;_0x4f04f4[_0x1f63('0x86')]=intUtil['stripTrailingSlash'](_0x4f04f4[_0x1f63('0x86')]);_0x4f04f4[_0x1f63('0x88')]=intUtil['stripTrailingSlash'](_0x4f04f4[_0x1f63('0x88')]);if(_0x3fcbc9&&_0x3fcbc9['recordingFormat']&&_0x3fcbc9[_0x1f63('0x98')]!=='none'){logger[_0x1f63('0x33')](_0x1f63('0x99'),_0x1f63('0x8b'));_0x405629[_0x1f63('0x8c')]=_0x4f04f4[_0x1f63('0x88')]+_0x1f63('0x8d')+_0x405629[_0x1f63('0x8f')]+_0x1f63('0x8e')+md5(_0x405629['uniqueid']);}var _0x5b34b3=_0x4f04f4[_0x1f63('0x86')]===_0x1f63('0x9a')?'eu':_0x1f63('0x90');return getAccessToken(_0x4f04f4)['then'](function(_0x5094e6){_0x2301ec=_0x5094e6;return getUser(_0x2301ec,_0x5b34b3,_0x4f04f4,_0x470153[_0x1f63('0x3c')]);})[_0x1f63('0x2d')](function(_0x39f81c){_0x7aadc8=_0x39f81c;logger[_0x1f63('0x33')](_0x1f63('0x91'),_0x7aadc8['id']);return getEndUser(_0x2301ec,_0x5b34b3,_0x4f04f4,_0x405629[_0x1f63('0x9b')],_0x405629[_0x1f63('0x9c')],_0x7aadc8,_0x277366);})['then'](function(_0x569e94){_0x515ff5=_0x569e94;return getCall(_0x2301ec,_0x5b34b3,_0x4f04f4,_0x7aadc8,_0x515ff5,_0x277366,_0x405629,'Outbound');})[_0x1f63('0x2d')](function(_0x44a022){if(_0x44a022){logger['info'](_0x1f63('0x93'),_0x44a022['id']);logger[_0x1f63('0x33')](_0x1f63('0x99'),_0x1f63('0x94'));emit(util[_0x1f63('0x66')]('user:%s',_0x470153[_0x1f63('0x1b')]),'trigger:browser:url',{'uri':_0x1f63('0x96')+_0x4f04f4[_0x1f63('0x86')]+_0x1f63('0x97')+_0x44a022['id']});}})[_0x1f63('0x30')](function(_0x5d08a7){logger[_0x1f63('0x31')]('[OUTBOUND]',JSON[_0x1f63('0xf')](_0x5d08a7));});};exports[_0x1f63('0x9d')]=function(_0x2f3b7d,_0x33fb4c,_0x2d69d6,_0x2bc1fe,_0x25b8a3,_0x1e475e){var _0x553f0b,_0x572ced,_0x4c32e6;_0x1e475e[_0x1f63('0x86')]=intUtil[_0x1f63('0x87')](_0x1e475e[_0x1f63('0x86')]);_0x1e475e['serverUrl']=intUtil['stripTrailingSlash'](_0x1e475e[_0x1f63('0x88')]);if(_0x25b8a3&&_0x25b8a3[_0x1f63('0x89')]){logger[_0x1f63('0x33')]('['+_0x33fb4c[_0x1f63('0x6e')]['toUpperCase']()+']',_0x1f63('0x8b'));_0x33fb4c['recordingURL']=_0x1e475e[_0x1f63('0x88')]+_0x1f63('0x8d')+_0x33fb4c['uniqueid']+'/downloads?type=uniqueid&token='+md5(_0x33fb4c[_0x1f63('0x8f')]);}else{_0x33fb4c[_0x1f63('0x8c')]='';}var _0x233c67=_0x1e475e[_0x1f63('0x86')]===_0x1f63('0x9a')?'eu':_0x1f63('0x90');return getAccessToken(_0x1e475e)[_0x1f63('0x2d')](function(_0x488cb2){_0x4c32e6=_0x488cb2;return getUser(_0x4c32e6,_0x233c67,_0x1e475e);})['then'](function(_0x313501){_0x553f0b=_0x313501;logger[_0x1f63('0x33')](_0x1f63('0x91'),_0x553f0b['id']);return getEndUser(_0x4c32e6,_0x233c67,_0x1e475e,_0x33fb4c[_0x1f63('0x92')],_0x33fb4c[_0x1f63('0x9e')],_0x553f0b,_0x2d69d6);})[_0x1f63('0x2d')](function(_0x22bb91){_0x572ced=_0x22bb91;return getCall(_0x4c32e6,_0x233c67,_0x1e475e,_0x553f0b,_0x572ced,_0x2d69d6,_0x33fb4c,_0x1f63('0x7f'));})[_0x1f63('0x2d')](function(_0x574185){if(_0x574185){logger[_0x1f63('0x33')]('The\x20Call\x20ID\x20is:',_0x574185['id']);}})['catch'](function(_0x1b7da7){logger[_0x1f63('0x31')]('['+_0x33fb4c[_0x1f63('0x6e')]['toUpperCase']()+']',JSON[_0x1f63('0xf')](_0x1b7da7));});}; \ 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 95ac83d..6cbbee3 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 _0x2340=['%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs','mustache','trigger','data2','Script','data3','render','error','format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info'];(function(_0x4226a3,_0x2b5fdf){var _0x21ff9e=function(_0x4e17a2){while(--_0x4e17a2){_0x4226a3['push'](_0x4226a3['shift']());}};_0x21ff9e(++_0x2b5fdf);}(_0x2340,0xf8));var _0x0234=function(_0x3d67d9,_0x5b0e8b){_0x3d67d9=_0x3d67d9-0x0;var _0xec066e=_0x2340[_0x3d67d9];return _0xec066e;};'use strict';var util=require(_0x0234('0x0'));var sh=require(_0x0234('0x1'));var Mustache=require(_0x0234('0x2'));var logger=require('../../../../config/logger')(_0x0234('0x3'));exports['exec']=function(_0x3854c0,_0x59425f){var _0x21da32=_0x3854c0[_0x0234('0x4')]?_0x3854c0['data2']:_0x0234('0x5');var _0xd21609=_0x3854c0[_0x0234('0x6')]?Mustache[_0x0234('0x7')](_0x3854c0['data3'],_0x59425f):_0x59425f;sh['exec'](_0xd21609,function(_0x1ca24d,_0xfded56,_0x16466f){if(_0x1ca24d!==0x0){logger[_0x0234('0x8')](util[_0x0234('0x9')](_0x0234('0xa'),_0x21da32,_0xd21609,_0x1ca24d,_0x16466f));}else{logger[_0x0234('0xb')](util[_0x0234('0x9')](_0x0234('0xc'),_0x21da32,_0xd21609,_0xfded56));}});}; \ No newline at end of file +var _0x1119=['Script','data3','error','format','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs','mustache','../../../../config/logger','trigger','exec','data2'];(function(_0x20dd93,_0x5d1135){var _0x451af4=function(_0x260e56){while(--_0x260e56){_0x20dd93['push'](_0x20dd93['shift']());}};_0x451af4(++_0x5d1135);}(_0x1119,0x165));var _0x9111=function(_0x29379a,_0x16b64f){_0x29379a=_0x29379a-0x0;var _0x125b52=_0x1119[_0x29379a];return _0x125b52;};'use strict';var util=require(_0x9111('0x0'));var sh=require(_0x9111('0x1'));var Mustache=require(_0x9111('0x2'));var logger=require(_0x9111('0x3'))(_0x9111('0x4'));exports[_0x9111('0x5')]=function(_0x465208,_0x1ac8d6){var _0x2bb988=_0x465208[_0x9111('0x6')]?_0x465208[_0x9111('0x6')]:_0x9111('0x7');var _0x35603a=_0x465208[_0x9111('0x8')]?Mustache['render'](_0x465208[_0x9111('0x8')],_0x1ac8d6):_0x1ac8d6;sh[_0x9111('0x5')](_0x35603a,function(_0x4ca3b8,_0x262a52,_0x4d9dc5){if(_0x4ca3b8!==0x0){logger[_0x9111('0x9')](util[_0x9111('0xa')](_0x9111('0xb'),_0x2bb988,_0x35603a,_0x4ca3b8,_0x4d9dc5));}else{logger[_0x9111('0xc')](util[_0x9111('0xa')](_0x9111('0xd'),_0x2bb988,_0x35603a,_0x262a52));}});}; \ 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 371f452..045296a 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 _0x6013=['message','lodash','mustache','../../../../config/logger','trigger','exec','data1','toUpperCase','render','data5','number','data6','parse','error','stack','GET','DELETE','POST','data7','body','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','format','data2','stringify','isNil','object','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s'];(function(_0x342401,_0x628117){var _0x21ba20=function(_0x4fc4ca){while(--_0x4fc4ca){_0x342401['push'](_0x342401['shift']());}};_0x21ba20(++_0x628117);}(_0x6013,0x197));var _0x3601=function(_0x3bad26,_0x1cf013){_0x3bad26=_0x3bad26-0x0;var _0x42e1ff=_0x6013[_0x3bad26];return _0x42e1ff;};'use strict';var rp=require('request-promise');var util=require('util');var _=require(_0x3601('0x0'));var Mustache=require(_0x3601('0x1'));var logger=require(_0x3601('0x2'))(_0x3601('0x3'));exports[_0x3601('0x4')]=function(_0x38654e,_0x17c1d8){var _0x5567d9,_0x52a7b4;var _0x57118f={'method':_0x38654e[_0x3601('0x5')][_0x3601('0x6')](),'uri':Mustache[_0x3601('0x7')](_0x38654e['data2'],_0x17c1d8),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x38654e[_0x3601('0x8')])===_0x3601('0x9')&&parseInt(_0x38654e['data5'])>=0x1&&parseInt(_0x38654e['data5'])<=0xa?parseInt(_0x38654e[_0x3601('0x8')])*0x3e8:0x5*0x3e8};try{_0x57118f['headers']=_0x38654e[_0x3601('0xa')]?JSON[_0x3601('0xb')](Mustache[_0x3601('0x7')](_0x38654e['data6'],_0x17c1d8)):{};}catch(_0x187c8b){logger[_0x3601('0xc')](_0x187c8b[_0x3601('0xd')]);}switch(_0x38654e['data1'][_0x3601('0x6')]()){case _0x3601('0xe'):case _0x3601('0xf'):_0x5567d9=null;_0x57118f['qs']=_0x17c1d8;break;case _0x3601('0x10'):case'PUT':if(_0x38654e[_0x3601('0x11')]){try{_0x5567d9=JSON[_0x3601('0xb')](Mustache[_0x3601('0x7')](_0x38654e[_0x3601('0x11')],_0x17c1d8));_0x57118f[_0x3601('0x12')]=_0x5567d9;}catch(_0x3fc1b6){logger[_0x3601('0xc')](_0x3fc1b6['stack']);logger[_0x3601('0xc')](_0x3601('0x13'));}}else{_0x5567d9=_0x17c1d8;_0x57118f[_0x3601('0x12')]=_0x5567d9;}break;}logger[_0x3601('0x14')](util[_0x3601('0x15')]('%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s',_0x38654e[_0x3601('0x5')],_0x38654e[_0x3601('0x16')],JSON[_0x3601('0x17')](_0x57118f)));rp(_0x57118f)['then'](function(_0x233edb){_0x5567d9=!_[_0x3601('0x18')](_0x5567d9)?',\x20request\x20body:\x20'+_0x5567d9:'';_0x52a7b4=typeof _0x233edb[_0x3601('0x12')]===_0x3601('0x19')?JSON[_0x3601('0x17')](_0x233edb['body']):_0x233edb[_0x3601('0x12')];logger['info'](util[_0x3601('0x15')]('%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s',_0x38654e[_0x3601('0x5')],_0x38654e[_0x3601('0x16')],_0x233edb['statusCode'],_0x52a7b4));})[_0x3601('0x1a')](function(_0x5cb99e){logger[_0x3601('0xc')](util['format'](_0x3601('0x1b'),_0x38654e[_0x3601('0x5')],_0x38654e[_0x3601('0x16')],_0x5cb99e['statusCode'],_0x5cb99e['name'],_0x5cb99e[_0x3601('0x1c')]));});}; \ No newline at end of file +var _0xb2aa=['message','request-promise','util','lodash','mustache','../../../../config/logger','trigger','exec','data1','render','data2','data5','headers','data6','parse','error','stack','toUpperCase','GET','DELETE','POST','PUT','data7','body','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','then',',\x20request\x20body:\x20','object','format','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','statusCode','name'];(function(_0x43b616,_0xb842c){var _0xc188db=function(_0x2faaf5){while(--_0x2faaf5){_0x43b616['push'](_0x43b616['shift']());}};_0xc188db(++_0xb842c);}(_0xb2aa,0x70));var _0xab2a=function(_0x5161ef,_0x59b9bb){_0x5161ef=_0x5161ef-0x0;var _0x3ce796=_0xb2aa[_0x5161ef];return _0x3ce796;};'use strict';var rp=require(_0xab2a('0x0'));var util=require(_0xab2a('0x1'));var _=require(_0xab2a('0x2'));var Mustache=require(_0xab2a('0x3'));var logger=require(_0xab2a('0x4'))(_0xab2a('0x5'));exports[_0xab2a('0x6')]=function(_0x343d38,_0x2741eb){var _0x375f3c,_0x2e5a61;var _0x35cf91={'method':_0x343d38[_0xab2a('0x7')]['toUpperCase'](),'uri':Mustache[_0xab2a('0x8')](_0x343d38[_0xab2a('0x9')],_0x2741eb),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x343d38[_0xab2a('0xa')])==='number'&&parseInt(_0x343d38[_0xab2a('0xa')])>=0x1&&parseInt(_0x343d38['data5'])<=0xa?parseInt(_0x343d38[_0xab2a('0xa')])*0x3e8:0x5*0x3e8};try{_0x35cf91[_0xab2a('0xb')]=_0x343d38[_0xab2a('0xc')]?JSON[_0xab2a('0xd')](Mustache[_0xab2a('0x8')](_0x343d38['data6'],_0x2741eb)):{};}catch(_0x233a95){logger[_0xab2a('0xe')](_0x233a95[_0xab2a('0xf')]);}switch(_0x343d38[_0xab2a('0x7')][_0xab2a('0x10')]()){case _0xab2a('0x11'):case _0xab2a('0x12'):_0x375f3c=null;_0x35cf91['qs']=_0x2741eb;break;case _0xab2a('0x13'):case _0xab2a('0x14'):if(_0x343d38[_0xab2a('0x15')]){try{_0x375f3c=JSON[_0xab2a('0xd')](Mustache['render'](_0x343d38[_0xab2a('0x15')],_0x2741eb));_0x35cf91[_0xab2a('0x16')]=_0x375f3c;}catch(_0x2e7427){logger[_0xab2a('0xe')](_0x2e7427[_0xab2a('0xf')]);logger[_0xab2a('0xe')](_0xab2a('0x17'));}}else{_0x375f3c=_0x2741eb;_0x35cf91[_0xab2a('0x16')]=_0x375f3c;}break;}logger[_0xab2a('0x18')](util['format'](_0xab2a('0x19'),_0x343d38[_0xab2a('0x7')],_0x343d38[_0xab2a('0x9')],JSON[_0xab2a('0x1a')](_0x35cf91)));rp(_0x35cf91)[_0xab2a('0x1b')](function(_0x1c1084){_0x375f3c=!_['isNil'](_0x375f3c)?_0xab2a('0x1c')+_0x375f3c:'';_0x2e5a61=typeof _0x1c1084['body']===_0xab2a('0x1d')?JSON[_0xab2a('0x1a')](_0x1c1084[_0xab2a('0x16')]):_0x1c1084[_0xab2a('0x16')];logger[_0xab2a('0x18')](util[_0xab2a('0x1e')](_0xab2a('0x1f'),_0x343d38[_0xab2a('0x7')],_0x343d38[_0xab2a('0x9')],_0x1c1084['statusCode'],_0x2e5a61));})[_0xab2a('0x20')](function(_0x17f60c){logger[_0xab2a('0xe')](util[_0xab2a('0x1e')](_0xab2a('0x21'),_0x343d38[_0xab2a('0x7')],_0x343d38[_0xab2a('0x9')],_0x17f60c[_0xab2a('0x22')],_0x17f60c[_0xab2a('0x23')],_0x17f60c[_0xab2a('0x24')]));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index eb52051..d2929c6 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 _0x1983=['exports','jayson/promise','bluebird','../../config/logger','routing','client','then','rpc','error','message','result','catch'];(function(_0x87533b,_0x39971b){var _0x529e89=function(_0x2becb6){while(--_0x2becb6){_0x87533b['push'](_0x87533b['shift']());}};_0x529e89(++_0x39971b);}(_0x1983,0xfd));var _0x3198=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0x1983[_0x5f1391];return _0x50ebe3;};'use strict';var jayson=require(_0x3198('0x0'));var BPromise=require(_0x3198('0x1'));var logger=require(_0x3198('0x2'))(_0x3198('0x3'));var client=jayson[_0x3198('0x4')]['http']({'port':0x2329});client['Request']=function(_0x1c0cd3,_0x4a0c55){return new BPromise(function(_0x54f6f1,_0x250e58){return client['request'](_0x1c0cd3,_0x4a0c55)[_0x3198('0x5')](function(_0x123228){logger['debug'](_0x3198('0x6'),'routing',_0x1c0cd3,_0x4a0c55,_0x123228);if(_0x123228[_0x3198('0x7')]){logger[_0x3198('0x7')](_0x3198('0x6'),'routing',_0x1c0cd3,_0x123228[_0x3198('0x7')][_0x3198('0x8')],_0x4a0c55);return _0x250e58(_0x123228[_0x3198('0x7')][_0x3198('0x8')]);}else{return _0x54f6f1(_0x123228[_0x3198('0x9')]);}})[_0x3198('0xa')](function(_0xe2188d){logger[_0x3198('0x7')](_0x3198('0x6'),_0x3198('0x3'),_0x1c0cd3,_0xe2188d,_0x4a0c55);return _0x250e58(_0xe2188d);});});};module[_0x3198('0xb')]=client; \ No newline at end of file +var _0x81af=['request','then','rpc','error','message','result','catch','exports','jayson/promise','bluebird','../../config/logger','routing','client','Request'];(function(_0x2b10c6,_0x185590){var _0x3789d2=function(_0x272987){while(--_0x272987){_0x2b10c6['push'](_0x2b10c6['shift']());}};_0x3789d2(++_0x185590);}(_0x81af,0xe8));var _0xf81a=function(_0x54a500,_0x269414){_0x54a500=_0x54a500-0x0;var _0x4e2342=_0x81af[_0x54a500];return _0x4e2342;};'use strict';var jayson=require(_0xf81a('0x0'));var BPromise=require(_0xf81a('0x1'));var logger=require(_0xf81a('0x2'))(_0xf81a('0x3'));var client=jayson[_0xf81a('0x4')]['http']({'port':0x2329});client[_0xf81a('0x5')]=function(_0x2efd3f,_0x23a896){return new BPromise(function(_0x2b3650,_0x452cc8){return client[_0xf81a('0x6')](_0x2efd3f,_0x23a896)[_0xf81a('0x7')](function(_0x67b166){logger['debug'](_0xf81a('0x8'),_0xf81a('0x3'),_0x2efd3f,_0x23a896,_0x67b166);if(_0x67b166['error']){logger[_0xf81a('0x9')](_0xf81a('0x8'),_0xf81a('0x3'),_0x2efd3f,_0x67b166[_0xf81a('0x9')][_0xf81a('0xa')],_0x23a896);return _0x452cc8(_0x67b166[_0xf81a('0x9')][_0xf81a('0xa')]);}else{return _0x2b3650(_0x67b166[_0xf81a('0xb')]);}})[_0xf81a('0xc')](function(_0x5b3b19){logger[_0xf81a('0x9')](_0xf81a('0x8'),_0xf81a('0x3'),_0x2efd3f,_0x5b3b19,_0x23a896);return _0x452cc8(_0x5b3b19);});});};module[_0xf81a('0xd')]=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index eb0b7a3..0206f97 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 _0x254f=['resolve','then','getMailAccounts','initMailAccounts','refresh','mailAccounts','listen','getSettings','catch','./realtime','./rpc/mailAccount','./rpc/setting'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x254f,0x8d));var _0xf254=function(_0x2c73fd,_0x2f514f){_0x2c73fd=_0x2c73fd-0x0;var _0x9ee71c=_0x254f[_0x2c73fd];return _0x9ee71c;};'use strict';var BPromise=require('bluebird');var server=require('./server');var Realtime=require(_0xf254('0x0'));var EmailChannel=require('./lib/email');var mailAccount=require(_0xf254('0x1'));var setting=require(_0xf254('0x2'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise[_0xf254('0x3')]()[_0xf254('0x4')](mailAccount[_0xf254('0x5')]())['then'](realtime[_0xf254('0x6')]())[_0xf254('0x4')](function(){email[_0xf254('0x7')](realtime[_0xf254('0x8')]);return realtime;});}function main(){return server[_0xf254('0x9')](realtime,email)[_0xf254('0x4')](function(){return initRealtime();})['then'](function(){return setting[_0xf254('0xa')]();})[_0xf254('0x4')](function(_0x161005){return setInterval(initRealtime,_0x161005['loginMailFrequency']*0x3e8);})[_0xf254('0xb')](function(_0x43069b){console['log'](_0x43069b);});}main(); \ No newline at end of file +var _0xc808=['resolve','then','getMailAccounts','initMailAccounts','refresh','mailAccounts','catch','log','bluebird','./server','./realtime','./rpc/mailAccount','./rpc/setting'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc808,0x97));var _0x8c80=function(_0x2cfb48,_0x24b83b){_0x2cfb48=_0x2cfb48-0x0;var _0xc4594f=_0xc808[_0x2cfb48];return _0xc4594f;};'use strict';var BPromise=require(_0x8c80('0x0'));var server=require(_0x8c80('0x1'));var Realtime=require(_0x8c80('0x2'));var EmailChannel=require('./lib/email');var mailAccount=require(_0x8c80('0x3'));var setting=require(_0x8c80('0x4'));var realtime=new Realtime();var email=new EmailChannel(realtime);function initRealtime(){return BPromise[_0x8c80('0x5')]()[_0x8c80('0x6')](mailAccount[_0x8c80('0x7')]())[_0x8c80('0x6')](realtime[_0x8c80('0x8')]())[_0x8c80('0x6')](function(){email[_0x8c80('0x9')](realtime[_0x8c80('0xa')]);return realtime;});}function main(){return server['listen'](realtime,email)['then'](function(){return initRealtime();})[_0x8c80('0x6')](function(){return setting['getSettings']();})[_0x8c80('0x6')](function(_0x129696){return setInterval(initRealtime,_0x129696['loginMailFrequency']*0x3e8);})[_0x8c80('0xb')](function(_0x12a111){console[_0x8c80('0xc')](_0x12a111);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index cd23734..43655e5 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 _0xdfbf=['socket.io-emitter','./imap','./smtp','../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','emit','key','Imap','status','total','isNil','mailAccount:update','prototype','refresh','active','hasOwnProperty','box','handleImapBox','bind','handleImapError','disabled','messageStatus','connected','name','messages','handleImapEmail','firstName','lastName','from','then','Mail\x20accepted\x20from\x20routing','catch','error','Mail\x20not\x20accepted\x20from\x20routing\x20%s','stringify','handleImapEnd','lastSync','send','verifySmtp','Smtp','verify','exports','lodash','bluebird','md5','../../../config/environment','../../../config/logger','email','redis','defaults','localhost'];(function(_0x1177db,_0x10e9a5){var _0x253c82=function(_0x582d58){while(--_0x582d58){_0x1177db['push'](_0x1177db['shift']());}};_0x253c82(++_0x10e9a5);}(_0xdfbf,0x1af));var _0xfdfb=function(_0x498ba2,_0x11182a){_0x498ba2=_0x498ba2-0x0;var _0x15cfc=_0xdfbf[_0x498ba2];return _0x15cfc;};'use strict';var _=require(_0xfdfb('0x0'));var moment=require('moment');var BPromise=require(_0xfdfb('0x1'));var md5=require(_0xfdfb('0x2'));var Redis=require('ioredis');var config=require(_0xfdfb('0x3'));var logger=require(_0xfdfb('0x4'))(_0xfdfb('0x5'));config[_0xfdfb('0x6')]=_[_0xfdfb('0x7')](config[_0xfdfb('0x6')],{'host':_0xfdfb('0x8'),'port':0x18eb});var io=require(_0xfdfb('0x9'))(new Redis(config[_0xfdfb('0x6')]));var EmailImap=require(_0xfdfb('0xa'));var EmailSmtp=require(_0xfdfb('0xb'));var mailAccount=require(_0xfdfb('0xc'));var md5Accounts={};function EmailChannel(_0x1785bd){logger[_0xfdfb('0xd')](_0xfdfb('0xe'));this[_0xfdfb('0xf')]=_0x1785bd[_0xfdfb('0xf')];this[_0xfdfb('0x10')]={};this[_0xfdfb('0x11')]=new EmailSmtp();}EmailChannel['prototype'][_0xfdfb('0x12')]=function(_0x390045){var _0x3d8bf4=this[_0xfdfb('0xf')][_0x390045];var _0x5bae14={'id':_0x3d8bf4['id'],'name':_0x3d8bf4['name'],'key':_0x3d8bf4[_0xfdfb('0x13')],'active':_0x3d8bf4['active'],'Imap':{'status':_0x3d8bf4[_0xfdfb('0x14')][_0xfdfb('0x15')],'messageStatus':_0x3d8bf4[_0xfdfb('0x14')]['messageStatus'],'total':_0x3d8bf4['Imap'][_0xfdfb('0x16')]}};if(_[_0xfdfb('0x17')](md5Accounts[_0x390045])){md5Accounts[_0x390045]={};}var _0x491b0a=md5(JSON['stringify'](_0x5bae14));if(md5Accounts[_0x390045]['md5']!==_0x491b0a){md5Accounts[_0x390045][_0xfdfb('0x2')]=_0x491b0a;io['emit'](_0xfdfb('0x18'),_0x5bae14);}};EmailChannel[_0xfdfb('0x19')][_0xfdfb('0x1a')]=function(_0x531f9f){for(var _0x6a70c8 in _0x531f9f){if(_0x531f9f['hasOwnProperty'](_0x6a70c8)){if(_0x531f9f[_0x6a70c8][_0xfdfb('0x14')]&&_0x531f9f[_0x6a70c8][_0xfdfb('0x1b')]){var _0x2d7029=_0x531f9f[_0x6a70c8][_0xfdfb('0x14')];if(!this['imapAccounts'][_0xfdfb('0x1c')](_0x2d7029['id'])){this[_0xfdfb('0x10')][_0x2d7029['id']]=new EmailImap(_0x2d7029,_0x531f9f[_0x6a70c8][_0xfdfb('0x5')]);this[_0xfdfb('0x10')][_0x2d7029['id']]['on'](_0xfdfb('0x1d'),this[_0xfdfb('0x1e')][_0xfdfb('0x1f')](this,_0x6a70c8));this[_0xfdfb('0x10')][_0x2d7029['id']]['on'](_0xfdfb('0x5'),this['handleImapEmail']['bind'](this,_0x6a70c8));this[_0xfdfb('0x10')][_0x2d7029['id']]['on']('end',this['handleImapEnd'][_0xfdfb('0x1f')](this,_0x6a70c8));this[_0xfdfb('0x10')][_0x2d7029['id']]['on']('error',this[_0xfdfb('0x20')][_0xfdfb('0x1f')](this,_0x6a70c8));}}else{if(_[_0xfdfb('0x17')](this[_0xfdfb('0xf')][_0x6a70c8][_0xfdfb('0x14')])){this[_0xfdfb('0xf')][_0x6a70c8][_0xfdfb('0x14')]={};}this[_0xfdfb('0xf')][_0x6a70c8][_0xfdfb('0x14')][_0xfdfb('0x15')]=_0xfdfb('0x21');this[_0xfdfb('0xf')][_0x6a70c8][_0xfdfb('0x14')][_0xfdfb('0x22')]='';this[_0xfdfb('0x12')](_0x6a70c8);}}}};EmailChannel[_0xfdfb('0x19')][_0xfdfb('0x1e')]=function(_0x4f1058,_0x59ca08){if(this['mailAccounts'][_0x4f1058]){this[_0xfdfb('0xf')][_0x4f1058][_0xfdfb('0x14')][_0xfdfb('0x15')]=_0xfdfb('0x23');this[_0xfdfb('0xf')][_0x4f1058]['Imap'][_0xfdfb('0x22')]=_0x59ca08[_0xfdfb('0x24')];if(_0x59ca08[_0xfdfb('0x25')]){this[_0xfdfb('0xf')][_0x4f1058][_0xfdfb('0x14')][_0xfdfb('0x16')]=_0x59ca08[_0xfdfb('0x25')][_0xfdfb('0x16')];}return this[_0xfdfb('0x12')](_0x4f1058);}};EmailChannel[_0xfdfb('0x19')][_0xfdfb('0x26')]=function(_0x507325,_0x42b00e){logger[_0xfdfb('0xd')]('New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s',_0x42b00e[_0xfdfb('0x27')],_0x42b00e[_0xfdfb('0x28')],_0x42b00e[_0xfdfb('0x29')],_0x507325);if(this['mailAccounts'][_0x507325]){return mailAccount['notify'](_0x507325,_0x42b00e)[_0xfdfb('0x2a')](function(_0x2a8bce){if(_0x2a8bce){logger[_0xfdfb('0xd')](_0xfdfb('0x2b'));}})[_0xfdfb('0x2c')](function(_0x3f5add){logger[_0xfdfb('0x2d')](_0xfdfb('0x2e'),JSON[_0xfdfb('0x2f')](_0x3f5add));});}};EmailChannel[_0xfdfb('0x19')][_0xfdfb('0x30')]=function(_0x43032d){if(this[_0xfdfb('0xf')][_0x43032d]&&this[_0xfdfb('0xf')][_0x43032d]['Imap']){if(this[_0xfdfb('0x10')][this[_0xfdfb('0xf')][_0x43032d]['Imap']['id']]){delete this[_0xfdfb('0x10')][this[_0xfdfb('0xf')][_0x43032d][_0xfdfb('0x14')]['id']];}this['mailAccounts'][_0x43032d]['Imap'][_0xfdfb('0x31')]=moment();this[_0xfdfb('0x12')](_0x43032d);}};EmailChannel[_0xfdfb('0x19')][_0xfdfb('0x20')]=function(_0x455098,_0x22956b){if(this[_0xfdfb('0xf')][_0x455098]){this['mailAccounts'][_0x455098][_0xfdfb('0x14')][_0xfdfb('0x15')]='error';this[_0xfdfb('0xf')][_0x455098]['Imap']['messageStatus']=_0x22956b;return this[_0xfdfb('0x12')](_0x455098);}};EmailChannel[_0xfdfb('0x19')]['sendMail']=function(_0x34b343,_0x443d51){return this['smtp'][_0xfdfb('0x32')](_0x34b343,_0x443d51);};EmailChannel['prototype'][_0xfdfb('0x33')]=function(_0x1df2d3){var _0x4f7e1b=this;if(this[_0xfdfb('0xf')][_0x1df2d3['id']]){if(_[_0xfdfb('0x17')](this[_0xfdfb('0xf')][_0x1df2d3['id']]['Smtp'])){this[_0xfdfb('0xf')][_0x1df2d3['id']][_0xfdfb('0x34')]={};}this[_0xfdfb('0xf')][_0x1df2d3['id']]['Smtp']['lastSync']=moment();return new BPromise(function(_0x32ecbb,_0x5c6c09){return _0x4f7e1b['smtp'][_0xfdfb('0x35')](_0x1df2d3)[_0xfdfb('0x2a')](function(_0x5913bb){_0x4f7e1b[_0xfdfb('0xf')][_0x1df2d3['id']]['Smtp'][_0xfdfb('0x15')]='verified';_0x4f7e1b[_0xfdfb('0xf')][_0x1df2d3['id']][_0xfdfb('0x34')][_0xfdfb('0x22')]='';_0x4f7e1b[_0xfdfb('0x12')](_0x1df2d3['id']);_0x32ecbb(_0x5913bb);})['catch'](function(_0x187d10){_0x4f7e1b[_0xfdfb('0xf')][_0x1df2d3['id']][_0xfdfb('0x34')]['status']=_0xfdfb('0x2d');_0x4f7e1b[_0xfdfb('0xf')][_0x1df2d3['id']][_0xfdfb('0x34')][_0xfdfb('0x22')]=_0x187d10;_0x4f7e1b[_0xfdfb('0x12')](_0x1df2d3['id']);_0x5c6c09(_0x187d10);});});}return this['smtp'][_0xfdfb('0x35')](_0x1df2d3);};module[_0xfdfb('0x36')]=EmailChannel; \ No newline at end of file +var _0x4570=['../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','prototype','emit','name','key','status','Imap','messageStatus','isNil','mailAccount:update','refresh','hasOwnProperty','active','imapAccounts','box','handleImapEmail','bind','end','handleImapEnd','handleImapError','disabled','handleImapBox','connected','messages','total','firstName','lastName','notify','then','Mail\x20accepted\x20from\x20routing','error','Mail\x20not\x20accepted\x20from\x20routing\x20%s','stringify','lastSync','sendMail','smtp','send','verifySmtp','Smtp','verify','exports','bluebird','md5','ioredis','../../../config/logger','email','redis','defaults','localhost','socket.io-emitter','./imap','./smtp'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x4570,0x108));var _0x0457=function(_0x2d2498,_0x26426d){_0x2d2498=_0x2d2498-0x0;var _0x447a5b=_0x4570[_0x2d2498];return _0x447a5b;};'use strict';var _=require('lodash');var moment=require('moment');var BPromise=require(_0x0457('0x0'));var md5=require(_0x0457('0x1'));var Redis=require(_0x0457('0x2'));var config=require('../../../config/environment');var logger=require(_0x0457('0x3'))(_0x0457('0x4'));config[_0x0457('0x5')]=_[_0x0457('0x6')](config['redis'],{'host':_0x0457('0x7'),'port':0x18eb});var io=require(_0x0457('0x8'))(new Redis(config[_0x0457('0x5')]));var EmailImap=require(_0x0457('0x9'));var EmailSmtp=require(_0x0457('0xa'));var mailAccount=require(_0x0457('0xb'));var md5Accounts={};function EmailChannel(_0x12bf7c){logger[_0x0457('0xc')](_0x0457('0xd'));this[_0x0457('0xe')]=_0x12bf7c[_0x0457('0xe')];this['imapAccounts']={};this['smtp']=new EmailSmtp();}EmailChannel[_0x0457('0xf')][_0x0457('0x10')]=function(_0x45b81e){var _0x311ecd=this[_0x0457('0xe')][_0x45b81e];var _0xd7d1a8={'id':_0x311ecd['id'],'name':_0x311ecd[_0x0457('0x11')],'key':_0x311ecd[_0x0457('0x12')],'active':_0x311ecd['active'],'Imap':{'status':_0x311ecd['Imap'][_0x0457('0x13')],'messageStatus':_0x311ecd[_0x0457('0x14')][_0x0457('0x15')],'total':_0x311ecd[_0x0457('0x14')]['total']}};if(_[_0x0457('0x16')](md5Accounts[_0x45b81e])){md5Accounts[_0x45b81e]={};}var _0x112fff=md5(JSON['stringify'](_0xd7d1a8));if(md5Accounts[_0x45b81e][_0x0457('0x1')]!==_0x112fff){md5Accounts[_0x45b81e][_0x0457('0x1')]=_0x112fff;io[_0x0457('0x10')](_0x0457('0x17'),_0xd7d1a8);}};EmailChannel[_0x0457('0xf')][_0x0457('0x18')]=function(_0x49d45b){for(var _0x31c180 in _0x49d45b){if(_0x49d45b[_0x0457('0x19')](_0x31c180)){if(_0x49d45b[_0x31c180][_0x0457('0x14')]&&_0x49d45b[_0x31c180][_0x0457('0x1a')]){var _0x30777e=_0x49d45b[_0x31c180][_0x0457('0x14')];if(!this[_0x0457('0x1b')][_0x0457('0x19')](_0x30777e['id'])){this[_0x0457('0x1b')][_0x30777e['id']]=new EmailImap(_0x30777e,_0x49d45b[_0x31c180][_0x0457('0x4')]);this[_0x0457('0x1b')][_0x30777e['id']]['on'](_0x0457('0x1c'),this['handleImapBox']['bind'](this,_0x31c180));this[_0x0457('0x1b')][_0x30777e['id']]['on']('email',this[_0x0457('0x1d')][_0x0457('0x1e')](this,_0x31c180));this[_0x0457('0x1b')][_0x30777e['id']]['on'](_0x0457('0x1f'),this[_0x0457('0x20')][_0x0457('0x1e')](this,_0x31c180));this['imapAccounts'][_0x30777e['id']]['on']('error',this[_0x0457('0x21')][_0x0457('0x1e')](this,_0x31c180));}}else{if(_[_0x0457('0x16')](this[_0x0457('0xe')][_0x31c180][_0x0457('0x14')])){this[_0x0457('0xe')][_0x31c180][_0x0457('0x14')]={};}this[_0x0457('0xe')][_0x31c180]['Imap'][_0x0457('0x13')]=_0x0457('0x22');this[_0x0457('0xe')][_0x31c180][_0x0457('0x14')][_0x0457('0x15')]='';this['emit'](_0x31c180);}}}};EmailChannel[_0x0457('0xf')][_0x0457('0x23')]=function(_0x425f99,_0x5b9cb5){if(this[_0x0457('0xe')][_0x425f99]){this[_0x0457('0xe')][_0x425f99][_0x0457('0x14')][_0x0457('0x13')]=_0x0457('0x24');this[_0x0457('0xe')][_0x425f99][_0x0457('0x14')][_0x0457('0x15')]=_0x5b9cb5[_0x0457('0x11')];if(_0x5b9cb5[_0x0457('0x25')]){this[_0x0457('0xe')][_0x425f99][_0x0457('0x14')]['total']=_0x5b9cb5[_0x0457('0x25')][_0x0457('0x26')];}return this[_0x0457('0x10')](_0x425f99);}};EmailChannel[_0x0457('0xf')]['handleImapEmail']=function(_0x4d90a4,_0x38f062){logger[_0x0457('0xc')]('New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s',_0x38f062[_0x0457('0x27')],_0x38f062[_0x0457('0x28')],_0x38f062['from'],_0x4d90a4);if(this['mailAccounts'][_0x4d90a4]){return mailAccount[_0x0457('0x29')](_0x4d90a4,_0x38f062)[_0x0457('0x2a')](function(_0x1a7b72){if(_0x1a7b72){logger['info'](_0x0457('0x2b'));}})['catch'](function(_0x595d72){logger[_0x0457('0x2c')](_0x0457('0x2d'),JSON[_0x0457('0x2e')](_0x595d72));});}};EmailChannel[_0x0457('0xf')][_0x0457('0x20')]=function(_0xe01693){if(this[_0x0457('0xe')][_0xe01693]&&this[_0x0457('0xe')][_0xe01693][_0x0457('0x14')]){if(this[_0x0457('0x1b')][this['mailAccounts'][_0xe01693][_0x0457('0x14')]['id']]){delete this[_0x0457('0x1b')][this[_0x0457('0xe')][_0xe01693][_0x0457('0x14')]['id']];}this[_0x0457('0xe')][_0xe01693][_0x0457('0x14')][_0x0457('0x2f')]=moment();this['emit'](_0xe01693);}};EmailChannel[_0x0457('0xf')][_0x0457('0x21')]=function(_0x580d68,_0x1e5e7d){if(this[_0x0457('0xe')][_0x580d68]){this[_0x0457('0xe')][_0x580d68][_0x0457('0x14')][_0x0457('0x13')]='error';this[_0x0457('0xe')][_0x580d68][_0x0457('0x14')][_0x0457('0x15')]=_0x1e5e7d;return this[_0x0457('0x10')](_0x580d68);}};EmailChannel[_0x0457('0xf')][_0x0457('0x30')]=function(_0xe6db19,_0x7db357){return this[_0x0457('0x31')][_0x0457('0x32')](_0xe6db19,_0x7db357);};EmailChannel[_0x0457('0xf')][_0x0457('0x33')]=function(_0x3e03b2){var _0x573645=this;if(this['mailAccounts'][_0x3e03b2['id']]){if(_[_0x0457('0x16')](this[_0x0457('0xe')][_0x3e03b2['id']][_0x0457('0x34')])){this[_0x0457('0xe')][_0x3e03b2['id']][_0x0457('0x34')]={};}this['mailAccounts'][_0x3e03b2['id']]['Smtp'][_0x0457('0x2f')]=moment();return new BPromise(function(_0x103fdc,_0x1f0e4f){return _0x573645[_0x0457('0x31')][_0x0457('0x35')](_0x3e03b2)[_0x0457('0x2a')](function(_0x3b6b86){_0x573645[_0x0457('0xe')][_0x3e03b2['id']]['Smtp'][_0x0457('0x13')]='verified';_0x573645['mailAccounts'][_0x3e03b2['id']][_0x0457('0x34')][_0x0457('0x15')]='';_0x573645[_0x0457('0x10')](_0x3e03b2['id']);_0x103fdc(_0x3b6b86);})['catch'](function(_0xd989e){_0x573645[_0x0457('0xe')][_0x3e03b2['id']][_0x0457('0x34')][_0x0457('0x13')]=_0x0457('0x2c');_0x573645['mailAccounts'][_0x3e03b2['id']]['Smtp'][_0x0457('0x15')]=_0xd989e;_0x573645['emit'](_0x3e03b2['id']);_0x1f0e4f(_0xd989e);});});}return this[_0x0457('0x31')]['verify'](_0x3e03b2);};module[_0x0457('0x36')]=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index 948a9ab..1eec4c5 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 _0x132f=['iconv','Iconv','events','EventEmitter','./utils','email','mailbox','account','getAccount','once','ready','end','handleEnd','bind','error','handleError','connect','inherits','authTimeout','isNil','user','password','host','port','tls','required','anonymous@xcally.com','prototype','handleReady','openBox','handleOpenBox','emit','handleCloseBox','readUnseen','search','UNSEEN','handleReadUnseen','message','handleFetchMessage','handleFetchError','handleFetchEnd','body','handleMessageBody','attributes','handleSimpleParser','handleMessageEnd','closeBox','stringify','textCode','hasOwnProperty','path','util','imap','lodash','randomstring','mailparser'];(function(_0x143172,_0x30b931){var _0x940ffb=function(_0x1220f4){while(--_0x1220f4){_0x143172['push'](_0x143172['shift']());}};_0x940ffb(++_0x30b931);}(_0x132f,0x182));var _0xf132=function(_0x7feb90,_0x28e700){_0x7feb90=_0x7feb90-0x0;var _0x3c5b33=_0x132f[_0x7feb90];return _0x3c5b33;};'use strict';var fs=require('fs');var path=require(_0xf132('0x0'));var util=require(_0xf132('0x1'));var Imap=require(_0xf132('0x2'));var _=require(_0xf132('0x3'));var rs=require(_0xf132('0x4'));var simpleParser=require(_0xf132('0x5'))['simpleParser'];var Iconv=require(_0xf132('0x6'))[_0xf132('0x7')];var EventEmitter=require(_0xf132('0x8'))[_0xf132('0x9')];var utils=require(_0xf132('0xa'));var logger=require('../../../config/logger')(_0xf132('0xb'));function EmailImap(_0x280c1f,_0x533464){this[_0xf132('0xc')]='INBOX';this[_0xf132('0xd')]=this[_0xf132('0xe')](_0x280c1f,_0x533464);this[_0xf132('0x2')]=new Imap(this[_0xf132('0xd')]);this[_0xf132('0x2')][_0xf132('0xf')](_0xf132('0x10'),this['handleReady']['bind'](this));this[_0xf132('0x2')][_0xf132('0xf')](_0xf132('0x11'),this[_0xf132('0x12')][_0xf132('0x13')](this));this[_0xf132('0x2')]['on'](_0xf132('0x14'),this[_0xf132('0x15')][_0xf132('0x13')](this));this[_0xf132('0x2')][_0xf132('0x16')]();}util[_0xf132('0x17')](EmailImap,EventEmitter);EmailImap['prototype'][_0xf132('0xe')]=function(_0x259b76,_0x569b7e){var _0x18f348={'connTimeout':_0x259b76['connTimeout']?_0x259b76['connTimeout']*0x3e8:0x2710,'authTimeout':_0x259b76[_0xf132('0x18')]?_0x259b76[_0xf132('0x18')]*0x3e8:0x1388};if(_[_0xf132('0x19')](_0x259b76['service'])){if(_0x259b76['authentication']){_0x18f348[_0xf132('0x1a')]=_0x259b76[_0xf132('0x1a')];_0x18f348[_0xf132('0x1b')]=_0x259b76[_0xf132('0x1b')];}_0x18f348['host']=_0x259b76[_0xf132('0x1c')];_0x18f348[_0xf132('0x1d')]=_0x259b76[_0xf132('0x1d')]||0x3e1;if(_0x259b76[_0xf132('0x1e')]){_0x18f348['tls']=!![];}else{_0x18f348[_0xf132('0x1e')]=![];_0x18f348['autotls']=_0xf132('0x1f');}}else{_0x18f348[_0xf132('0x1a')]=_0x259b76['user'];_0x18f348[_0xf132('0x1b')]=_0x259b76['password'];_0x18f348['host']=utils['getHost'](_0x259b76['service']);_0x18f348[_0xf132('0x1d')]=0x3e1;_0x18f348[_0xf132('0x1e')]=!![];}_0x18f348[_0xf132('0xb')]=_0x569b7e||_0x259b76[_0xf132('0x1a')]||_0xf132('0x20');return _0x18f348;};EmailImap[_0xf132('0x21')][_0xf132('0x22')]=function(){this['imap'][_0xf132('0x23')](this[_0xf132('0xc')],![],this[_0xf132('0x24')][_0xf132('0x13')](this));};EmailImap[_0xf132('0x21')][_0xf132('0x24')]=function(_0x6f16b1,_0x4f1e5f){if(_0x6f16b1){this[_0xf132('0x15')](_0x6f16b1,!![]);}else{this[_0xf132('0x25')]('box',_0x4f1e5f);this['readUnseen']();}};EmailImap[_0xf132('0x21')][_0xf132('0x26')]=function(_0x3933bc){if(_0x3933bc){this[_0xf132('0x15')](_0x3933bc,!![]);}else{this[_0xf132('0x2')][_0xf132('0x11')]();}};EmailImap[_0xf132('0x21')][_0xf132('0x27')]=function(){this[_0xf132('0x2')][_0xf132('0x28')]([_0xf132('0x29')],this[_0xf132('0x2a')][_0xf132('0x13')](this));};EmailImap['prototype'][_0xf132('0x2a')]=function(_0x519127,_0x4ff070){if(_0x519127){this[_0xf132('0x15')](_0x519127,!![]);}else{if(_0x4ff070['length']){try{var _0x549bd0=this[_0xf132('0x2')]['fetch'](_0x4ff070,{'bodies':'','markSeen':!![]});_0x549bd0['on'](_0xf132('0x2b'),this[_0xf132('0x2c')][_0xf132('0x13')](this));_0x549bd0[_0xf132('0xf')](_0xf132('0x14'),this[_0xf132('0x2d')][_0xf132('0x13')](this));_0x549bd0[_0xf132('0xf')](_0xf132('0x11'),this[_0xf132('0x2e')][_0xf132('0x13')](this));}catch(_0x584511){logger[_0xf132('0x14')](_0x584511);}}else{this[_0xf132('0x2')]['closeBox'](!![],this[_0xf132('0x26')][_0xf132('0x13')](this));}}};EmailImap['prototype']['handleFetchMessage']=function(_0x3dfda5,_0x31356c){_0x3dfda5['on'](_0xf132('0x2f'),this[_0xf132('0x30')][_0xf132('0x13')](this));_0x3dfda5[_0xf132('0xf')](_0xf132('0x31'),this['handleMessageAttributes']['bind'](this));_0x3dfda5['once']('end',this['handleMessageEnd'][_0xf132('0x13')](this));};EmailImap['prototype'][_0xf132('0x30')]=function(_0x245e1e,_0x19d0fa){simpleParser(_0x245e1e,{'Iconv':Iconv},this[_0xf132('0x32')][_0xf132('0x13')](this));};EmailImap[_0xf132('0x21')]['handleMessageAttributes']=function(_0x51e99b){};EmailImap['prototype'][_0xf132('0x33')]=function(){};EmailImap['prototype'][_0xf132('0x32')]=function(_0x54b933,_0x4f09b7){if(_0x54b933){logger[_0xf132('0x14')](_0x54b933);}else{var _0x427430=this;utils['parser'](this[_0xf132('0xd')],_0x4f09b7,function(_0x843850){_0x427430[_0xf132('0x25')](_0xf132('0xb'),_0x843850);});}};EmailImap['prototype']['handleFetchEnd']=function(){this['imap'][_0xf132('0x34')](!![],this[_0xf132('0x26')][_0xf132('0x13')](this));};EmailImap[_0xf132('0x21')]['handleFetchError']=function(_0x4e9119){this['handleError'](_0x4e9119);this[_0xf132('0x2')][_0xf132('0x34')](!![],this[_0xf132('0x26')]['bind'](this));};EmailImap[_0xf132('0x21')][_0xf132('0x12')]=function(){this[_0xf132('0x25')]('end');};EmailImap[_0xf132('0x21')][_0xf132('0x15')]=function(_0x2ede85,_0x4c597f){logger[_0xf132('0x14')]('handleError',this[_0xf132('0xd')][_0xf132('0xb')],JSON[_0xf132('0x35')](_0x2ede85));var _0x391aa0='';if(_0x2ede85){if(_0x2ede85[_0xf132('0x36')]){_0x391aa0=_0x2ede85['textCode'];}else{for(var _0x4afcb0 in _0x2ede85){if(_0x2ede85[_0xf132('0x37')](_0x4afcb0)){_0x391aa0+=_['upperFirst'](_0x4afcb0)+':\x20'+_0x2ede85[_0x4afcb0]+'\x0a';}}}}if(_0x4c597f){this[_0xf132('0x2')]['end']();}else{this[_0xf132('0x25')]('error',_0x391aa0);this[_0xf132('0x25')]('end');}};module['exports']=EmailImap; \ No newline at end of file +var _0xae1a=['textCode','upperFirst','exports','path','util','imap','mailparser','Iconv','events','EventEmitter','./utils','../../../config/logger','email','mailbox','INBOX','account','getAccount','once','ready','bind','end','error','connect','prototype','authTimeout','isNil','authentication','user','password','host','port','tls','autotls','required','getHost','service','handleReady','openBox','handleOpenBox','handleError','emit','box','readUnseen','handleCloseBox','search','UNSEEN','handleReadUnseen','length','fetch','message','handleFetchMessage','handleFetchError','handleFetchEnd','closeBox','body','handleMessageBody','attributes','handleSimpleParser','parser','handleEnd','stringify'];(function(_0x284591,_0x3e4e5c){var _0x598f5e=function(_0x36aaa2){while(--_0x36aaa2){_0x284591['push'](_0x284591['shift']());}};_0x598f5e(++_0x3e4e5c);}(_0xae1a,0xba));var _0xaae1=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0xae1a[_0x2d8fc2];return _0x3a9e53;};'use strict';var fs=require('fs');var path=require(_0xaae1('0x0'));var util=require(_0xaae1('0x1'));var Imap=require(_0xaae1('0x2'));var _=require('lodash');var rs=require('randomstring');var simpleParser=require(_0xaae1('0x3'))['simpleParser'];var Iconv=require('iconv')[_0xaae1('0x4')];var EventEmitter=require(_0xaae1('0x5'))[_0xaae1('0x6')];var utils=require(_0xaae1('0x7'));var logger=require(_0xaae1('0x8'))(_0xaae1('0x9'));function EmailImap(_0x46ff9b,_0x51228c){this[_0xaae1('0xa')]=_0xaae1('0xb');this[_0xaae1('0xc')]=this[_0xaae1('0xd')](_0x46ff9b,_0x51228c);this[_0xaae1('0x2')]=new Imap(this[_0xaae1('0xc')]);this[_0xaae1('0x2')][_0xaae1('0xe')](_0xaae1('0xf'),this['handleReady'][_0xaae1('0x10')](this));this[_0xaae1('0x2')][_0xaae1('0xe')](_0xaae1('0x11'),this['handleEnd'][_0xaae1('0x10')](this));this[_0xaae1('0x2')]['on'](_0xaae1('0x12'),this['handleError']['bind'](this));this['imap'][_0xaae1('0x13')]();}util['inherits'](EmailImap,EventEmitter);EmailImap[_0xaae1('0x14')]['getAccount']=function(_0x524231,_0x129623){var _0x3aae6b={'connTimeout':_0x524231['connTimeout']?_0x524231['connTimeout']*0x3e8:0x2710,'authTimeout':_0x524231[_0xaae1('0x15')]?_0x524231['authTimeout']*0x3e8:0x1388};if(_[_0xaae1('0x16')](_0x524231['service'])){if(_0x524231[_0xaae1('0x17')]){_0x3aae6b[_0xaae1('0x18')]=_0x524231[_0xaae1('0x18')];_0x3aae6b[_0xaae1('0x19')]=_0x524231[_0xaae1('0x19')];}_0x3aae6b['host']=_0x524231[_0xaae1('0x1a')];_0x3aae6b[_0xaae1('0x1b')]=_0x524231['port']||0x3e1;if(_0x524231[_0xaae1('0x1c')]){_0x3aae6b[_0xaae1('0x1c')]=!![];}else{_0x3aae6b['tls']=![];_0x3aae6b[_0xaae1('0x1d')]=_0xaae1('0x1e');}}else{_0x3aae6b['user']=_0x524231[_0xaae1('0x18')];_0x3aae6b[_0xaae1('0x19')]=_0x524231['password'];_0x3aae6b[_0xaae1('0x1a')]=utils[_0xaae1('0x1f')](_0x524231[_0xaae1('0x20')]);_0x3aae6b['port']=0x3e1;_0x3aae6b[_0xaae1('0x1c')]=!![];}_0x3aae6b[_0xaae1('0x9')]=_0x129623||_0x524231['user']||'anonymous@xcally.com';return _0x3aae6b;};EmailImap['prototype'][_0xaae1('0x21')]=function(){this[_0xaae1('0x2')][_0xaae1('0x22')](this[_0xaae1('0xa')],![],this['handleOpenBox'][_0xaae1('0x10')](this));};EmailImap['prototype'][_0xaae1('0x23')]=function(_0x12fa63,_0x4e4283){if(_0x12fa63){this[_0xaae1('0x24')](_0x12fa63,!![]);}else{this[_0xaae1('0x25')](_0xaae1('0x26'),_0x4e4283);this[_0xaae1('0x27')]();}};EmailImap[_0xaae1('0x14')][_0xaae1('0x28')]=function(_0x36fd90){if(_0x36fd90){this[_0xaae1('0x24')](_0x36fd90,!![]);}else{this['imap']['end']();}};EmailImap[_0xaae1('0x14')][_0xaae1('0x27')]=function(){this[_0xaae1('0x2')][_0xaae1('0x29')]([_0xaae1('0x2a')],this[_0xaae1('0x2b')][_0xaae1('0x10')](this));};EmailImap[_0xaae1('0x14')][_0xaae1('0x2b')]=function(_0x545385,_0x5c6f64){if(_0x545385){this[_0xaae1('0x24')](_0x545385,!![]);}else{if(_0x5c6f64[_0xaae1('0x2c')]){try{var _0x14fcd0=this[_0xaae1('0x2')][_0xaae1('0x2d')](_0x5c6f64,{'bodies':'','markSeen':!![]});_0x14fcd0['on'](_0xaae1('0x2e'),this[_0xaae1('0x2f')][_0xaae1('0x10')](this));_0x14fcd0[_0xaae1('0xe')](_0xaae1('0x12'),this[_0xaae1('0x30')][_0xaae1('0x10')](this));_0x14fcd0[_0xaae1('0xe')]('end',this[_0xaae1('0x31')][_0xaae1('0x10')](this));}catch(_0x3ae8ed){logger[_0xaae1('0x12')](_0x3ae8ed);}}else{this[_0xaae1('0x2')][_0xaae1('0x32')](!![],this[_0xaae1('0x28')]['bind'](this));}}};EmailImap[_0xaae1('0x14')][_0xaae1('0x2f')]=function(_0x12fe4f,_0x5d640b){_0x12fe4f['on'](_0xaae1('0x33'),this[_0xaae1('0x34')][_0xaae1('0x10')](this));_0x12fe4f[_0xaae1('0xe')](_0xaae1('0x35'),this['handleMessageAttributes']['bind'](this));_0x12fe4f['once'](_0xaae1('0x11'),this['handleMessageEnd']['bind'](this));};EmailImap['prototype'][_0xaae1('0x34')]=function(_0x3591dd,_0x208e8d){simpleParser(_0x3591dd,{'Iconv':Iconv},this[_0xaae1('0x36')][_0xaae1('0x10')](this));};EmailImap[_0xaae1('0x14')]['handleMessageAttributes']=function(_0x1eb114){};EmailImap['prototype']['handleMessageEnd']=function(){};EmailImap[_0xaae1('0x14')][_0xaae1('0x36')]=function(_0x51cc76,_0x123d7a){if(_0x51cc76){logger[_0xaae1('0x12')](_0x51cc76);}else{var _0x286521=this;utils[_0xaae1('0x37')](this[_0xaae1('0xc')],_0x123d7a,function(_0x4b47a6){_0x286521[_0xaae1('0x25')](_0xaae1('0x9'),_0x4b47a6);});}};EmailImap[_0xaae1('0x14')][_0xaae1('0x31')]=function(){this[_0xaae1('0x2')][_0xaae1('0x32')](!![],this[_0xaae1('0x28')][_0xaae1('0x10')](this));};EmailImap[_0xaae1('0x14')][_0xaae1('0x30')]=function(_0xad861d){this[_0xaae1('0x24')](_0xad861d);this['imap'][_0xaae1('0x32')](!![],this[_0xaae1('0x28')][_0xaae1('0x10')](this));};EmailImap[_0xaae1('0x14')][_0xaae1('0x38')]=function(){this[_0xaae1('0x25')](_0xaae1('0x11'));};EmailImap['prototype']['handleError']=function(_0x43fe32,_0x54263d){logger['error']('handleError',this[_0xaae1('0xc')][_0xaae1('0x9')],JSON[_0xaae1('0x39')](_0x43fe32));var _0xcc6ec8='';if(_0x43fe32){if(_0x43fe32['textCode']){_0xcc6ec8=_0x43fe32[_0xaae1('0x3a')];}else{for(var _0x2937ea in _0x43fe32){if(_0x43fe32['hasOwnProperty'](_0x2937ea)){_0xcc6ec8+=_[_0xaae1('0x3b')](_0x2937ea)+':\x20'+_0x43fe32[_0x2937ea]+'\x0a';}}}}if(_0x54263d){this[_0xaae1('0x2')][_0xaae1('0x11')]();}else{this[_0xaae1('0x25')]('error',_0xcc6ec8);this[_0xaae1('0x25')](_0xaae1('0x11'));}};module[_0xaae1('0x3c')]=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index 3e4624f..16d3708 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 _0x9ef3=['toString','verify','Not\x20verifired','exports','nodemailer','nodemailer-plugin-inline-base64','prototype','use','compile','sendMail'];(function(_0x40eec9,_0x817a67){var _0xfee890=function(_0x186640){while(--_0x186640){_0x40eec9['push'](_0x40eec9['shift']());}};_0xfee890(++_0x817a67);}(_0x9ef3,0x14e));var _0x39ef=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9ef3[_0x3dd15e];return _0x231fd0;};'use strict';var nodemailer=require(_0x39ef('0x0'));var BPromise=require('bluebird');var inlineBase64=require(_0x39ef('0x1'));function EmailSmtp(){}EmailSmtp[_0x39ef('0x2')]['send']=function(_0x366e30,_0x12a8dd){return new BPromise(function(_0x39c16d,_0x117bee){var _0x412754=nodemailer['createTransport'](_0x366e30);_0x412754[_0x39ef('0x3')](_0x39ef('0x4'),inlineBase64());_0x412754[_0x39ef('0x5')](_0x12a8dd,function(_0x130b1c,_0x4f5307){if(_0x130b1c){_0x117bee(_0x130b1c[_0x39ef('0x6')]());}else{_0x39c16d(_0x4f5307);}});});};EmailSmtp[_0x39ef('0x2')][_0x39ef('0x7')]=function(_0x54bc50){return new BPromise(function(_0x47c4cd,_0x17da9d){var _0x13fbf2=nodemailer['createTransport'](_0x54bc50);_0x13fbf2[_0x39ef('0x7')](function(_0x4d2cd8,_0x4712eb){if(_0x4d2cd8){_0x17da9d(_0x4d2cd8[_0x39ef('0x6')]());}else{if(_0x4712eb){_0x47c4cd(_0x4712eb);}else{_0x17da9d(_0x39ef('0x8'));}}});});};module[_0x39ef('0x9')]=EmailSmtp; \ No newline at end of file +var _0x317b=['nodemailer','bluebird','nodemailer-plugin-inline-base64','send','createTransport','use','toString','Not\x20verifired','exports'];(function(_0x53592a,_0x4f4970){var _0x17970a=function(_0x4d4df7){while(--_0x4d4df7){_0x53592a['push'](_0x53592a['shift']());}};_0x17970a(++_0x4f4970);}(_0x317b,0x18c));var _0xb317=function(_0xe259a4,_0x398cff){_0xe259a4=_0xe259a4-0x0;var _0x27216b=_0x317b[_0xe259a4];return _0x27216b;};'use strict';var nodemailer=require(_0xb317('0x0'));var BPromise=require(_0xb317('0x1'));var inlineBase64=require(_0xb317('0x2'));function EmailSmtp(){}EmailSmtp['prototype'][_0xb317('0x3')]=function(_0x490d72,_0x3626b8){return new BPromise(function(_0x3f3cb4,_0x4238fd){var _0x5c491b=nodemailer[_0xb317('0x4')](_0x490d72);_0x5c491b[_0xb317('0x5')]('compile',inlineBase64());_0x5c491b['sendMail'](_0x3626b8,function(_0xa54c22,_0x3e61b8){if(_0xa54c22){_0x4238fd(_0xa54c22[_0xb317('0x6')]());}else{_0x3f3cb4(_0x3e61b8);}});});};EmailSmtp['prototype']['verify']=function(_0x5c3a1f){return new BPromise(function(_0x7739a8,_0x9007ef){var _0x5f2028=nodemailer[_0xb317('0x4')](_0x5c3a1f);_0x5f2028['verify'](function(_0x5b59c0,_0x5c94ee){if(_0x5b59c0){_0x9007ef(_0x5b59c0[_0xb317('0x6')]());}else{if(_0x5c94ee){_0x7739a8(_0x5c94ee);}else{_0x9007ef(_0xb317('0x7'));}}});});};module[_0xb317('0x8')]=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index 6482583..64e2a5a 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 _0x3e4d=['value','name','indexOf','split','length','slice','Anonymous','pop','html','test','includes','','body','textAsHtml','message','originCc','isEmpty','bcc','type','attachment','filename','attachment-','format','%s-%s','now','join','server/files/attachments/','writeFileSync','content','push','contentType','headerLines','Auto-Submitted:\x20auto-replied','Precedence:\x20auto_reply','line','isAutoreply','from','subject','inReplyTo','date','YYYY-MM-DD\x20HH:mm:ss','filter','application/ms-tnef','info','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','messageId','parseBuffer','BodyHTML','

Empty\x20message

','Attachments','Title','Data','getHost','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','outlook365','outlook.office365.com','lodash','randomstring','../../../config/logger','email','../../../config/environment','address','anonymous','generate','@xcally.com','head'];(function(_0x25af06,_0x398b8b){var _0x17eddb=function(_0x24b642){while(--_0x24b642){_0x25af06['push'](_0x25af06['shift']());}};_0x17eddb(++_0x398b8b);}(_0x3e4d,0x16d));var _0xd3e4=function(_0x51f545,_0x13ad62){_0x51f545=_0x51f545-0x0;var _0xd7b74a=_0x3e4d[_0x51f545];return _0xd7b74a;};'use strict';var _=require(_0xd3e4('0x0'));var moment=require('moment');var random=require(_0xd3e4('0x1'));var fs=require('fs');var path=require('path');var util=require('util');var tnef=require('node-tnef');var logger=require(_0xd3e4('0x2'))(_0xd3e4('0x3'));var config=require(_0xd3e4('0x4'));function getAddress(_0x5ea48b){var _0xc5abea=_['head'](_0x5ea48b['value']);return _0xc5abea&&_0xc5abea[_0xd3e4('0x5')]?_0xc5abea[_0xd3e4('0x5')]:_0xd3e4('0x6')+random[_0xd3e4('0x7')](0x6)+_0xd3e4('0x8');}function getFirstName(_0x4b3954){var _0x68d3a8=_[_0xd3e4('0x9')](_0x4b3954[_0xd3e4('0xa')]);if(_0x68d3a8&&_0x68d3a8['name']){if(_0x68d3a8[_0xd3e4('0xb')]==_0x68d3a8[_0xd3e4('0x5')]){return _0x68d3a8['name']['substring'](0x0,_0x68d3a8[_0xd3e4('0xb')][_0xd3e4('0xc')]('@'));}var _0x2f805e=_0x68d3a8[_0xd3e4('0xb')][_0xd3e4('0xd')](/\s+/);return _0x2f805e[_0xd3e4('0xe')]>0x1?_0x2f805e[_0xd3e4('0xf')](0x0,-0x1)['join']('\x20'):_0x68d3a8[_0xd3e4('0xb')];}return _0xd3e4('0x10');}function getLastName(_0x27f3a7){var _0x4f15ef=_['head'](_0x27f3a7[_0xd3e4('0xa')]);if(_0x4f15ef&&_0x4f15ef['name']){var _0x33daec=_0x4f15ef[_0xd3e4('0xb')]['split'](/\s+/);return _0x33daec[_0xd3e4('0xe')]>0x1?_0x33daec[_0xd3e4('0x11')]():'';}return'';}function getMails(_0x4d5136,_0x4fae0a){var _0x5acc91='';for(var _0x353f84=0x0;_0x353f84<_0x4fae0a[_0xd3e4('0xa')][_0xd3e4('0xe')];_0x353f84+=0x1){if(_0x4fae0a[_0xd3e4('0xa')][_0x353f84][_0xd3e4('0x5')]!==_0x4d5136){if(!_['isEmpty'](_0x5acc91)){_0x5acc91+=',';}_0x5acc91+=_0x4fae0a[_0xd3e4('0xa')][_0x353f84][_0xd3e4('0xb')]||_0x4fae0a[_0xd3e4('0xa')][_0x353f84]['address']||'';_0x5acc91+='\x20<';_0x5acc91+=_0x4fae0a[_0xd3e4('0xa')][_0x353f84][_0xd3e4('0x5')]?_0x4fae0a[_0xd3e4('0xa')][_0x353f84]['address']:_0xd3e4('0x6')+random[_0xd3e4('0x7')](0x6)+_0xd3e4('0x8');_0x5acc91+='>';}}return _0x5acc91;}function parseEmail(_0x44dd10,_0x4386b0,_0xa147d2){if(_0x4386b0[_0xd3e4('0x12')]){var _0x186786=/)<[^<]*)*<\/script>/gi;while(_0x186786[_0xd3e4('0x13')](_0x4386b0[_0xd3e4('0x12')])){_0x4386b0['html']=_0x4386b0[_0xd3e4('0x12')]['replace'](_0x186786,'');}if(_0x4386b0[_0xd3e4('0x12')][_0xd3e4('0x14')](_0xd3e4('0x15'))){var _0x82d2c5=[];_0x4386b0[_0xd3e4('0x16')][_0xd3e4('0x17')](_0x16a06e=>{_0x82d2c5['push'](_0x16a06e['filename']);});var _0x81b1f5=/]+>/g;var _0x239763=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0xebf9ff=_0x4386b0[_0xd3e4('0x12')][_0xd3e4('0x18')](_0x239763,_0xd3e4('0x19'));var _0x462586=_0xebf9ff['replace'](_0x81b1f5,'_IMG');for(let _0x578c9e=0x0;_0x578c9e<_0x82d2c5[_0xd3e4('0xe')];_0x578c9e++){var _0x5e96fc=_0x462586[_0xd3e4('0x18')](_0xd3e4('0x1a'),'\x20[Attachment:\x20'+_0x82d2c5[_0x578c9e]+_0xd3e4('0x1b'));_0x462586=_0x5e96fc;}_0x4386b0[_0xd3e4('0x12')]=_0x462586;}_0xa147d2[_0xd3e4('0x1c')]=_0x4386b0[_0xd3e4('0x12')];}else{_0xa147d2[_0xd3e4('0x1c')]=_0x4386b0[_0xd3e4('0x1d')];}if(_0xa147d2[_0xd3e4('0x1c')]){_0xa147d2[_0xd3e4('0x1c')]=_0xa147d2[_0xd3e4('0x1c')][_0xd3e4('0x18')](/0x0){var _0x576d32=[_0xd3e4('0x30'),'X-Auto-Response-Suppress:\x20All',_0xd3e4('0x31')];for(var _0x52f496=0x0;_0x52f496<_0x4386b0[_0xd3e4('0x2f')][_0xd3e4('0xe')];_0x52f496++){var _0xcee5c=_[_0xd3e4('0xc')](_0x576d32,_0x4386b0[_0xd3e4('0x2f')][_0x52f496][_0xd3e4('0x32')]);if(_0xcee5c>=0x0){_0xa147d2[_0xd3e4('0x33')]=!![];}}}return _0xa147d2;}exports['parser']=function(_0x4fef51,_0x5b97f8,_0x768fd1){var _0x32e5a5={'from':getAddress(_0x5b97f8[_0xd3e4('0x34')]),'firstName':getFirstName(_0x5b97f8[_0xd3e4('0x34')]),'lastName':getLastName(_0x5b97f8[_0xd3e4('0x34')]),'mapKey':_0xd3e4('0x3'),'message':{'from':getMails(_0x4fef51[_0xd3e4('0x3')],_0x5b97f8[_0xd3e4('0x34')]),'to':_0x4fef51[_0xd3e4('0x3')],'cc':'','subject':_0x5b97f8[_0xd3e4('0x35')]||'','messageId':_0x5b97f8['messageId'],'inReplyTo':_0x5b97f8[_0xd3e4('0x36')],'sentAt':moment(_0x5b97f8[_0xd3e4('0x37')])[_0xd3e4('0x26')](_0xd3e4('0x38')),'attach':![],'attachments':[]}};if(!_0x5b97f8[_0xd3e4('0x12')]&&!_0x5b97f8[_0xd3e4('0x1d')]){var _0x1e4d83=_[_0xd3e4('0x39')](_0x5b97f8[_0xd3e4('0x16')],{'contentType':_0xd3e4('0x3a')});if(_0x1e4d83[_0xd3e4('0xe')]){logger[_0xd3e4('0x3b')](util['format'](_0xd3e4('0x3c'),_0x5b97f8[_0xd3e4('0x3d')]));tnef[_0xd3e4('0x3e')](_['first'](_0x1e4d83)[_0xd3e4('0x2c')],function(_0x515728,_0x199354){if(_0x199354){_0x5b97f8[_0xd3e4('0x12')]=_0x199354[_0xd3e4('0x3f')]||_0xd3e4('0x40');if(_0x199354[_0xd3e4('0x41')]){for(var _0x4e113c=0x0;_0x4e113c<_0x199354[_0xd3e4('0x41')][_0xd3e4('0xe')];_0x4e113c++){var _0x56ad46=_0x199354[_0xd3e4('0x41')][_0x4e113c];_0x32e5a5[_0xd3e4('0x1e')][_0xd3e4('0x16')]['push']({'filename':_0x56ad46[_0xd3e4('0x42')],'content':Buffer[_0xd3e4('0x34')](_0x56ad46[_0xd3e4('0x43')])});}}}_0x768fd1(parseEmail(_0x4fef51,_0x5b97f8,_0x32e5a5));});}else{_0x5b97f8[_0xd3e4('0x12')]=_0xd3e4('0x40');_0x768fd1(parseEmail(_0x4fef51,_0x5b97f8,_0x32e5a5));}}else{_0x768fd1(parseEmail(_0x4fef51,_0x5b97f8,_0x32e5a5));}};exports[_0xd3e4('0x44')]=function(_0x380e65){switch(_0x380e65){case'gmail':return _0xd3e4('0x45');case _0xd3e4('0x46'):return _0xd3e4('0x47');case _0xd3e4('0x48'):return'imap-mail.outlook.com';case _0xd3e4('0x49'):return _0xd3e4('0x4a');}return'127.0.0.1';}; \ No newline at end of file +var _0x980e=['value','name','substring','indexOf','slice','join','isEmpty','html','test','replace','\x20[Attachment:\x20','\x20]','body','textAsHtml','message','originTo','originCc','includes','bcc','attach','attachment','filename','attachment-','format','now','root','writeFileSync','content','contentType','headerLines','X-Auto-Response-Suppress:\x20All','Precedence:\x20auto_reply','line','isAutoreply','from','messageId','inReplyTo','date','YYYY-MM-DD\x20HH:mm:ss','filter','application/ms-tnef','info','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','parseBuffer','first','

Empty\x20message

','Attachments','Title','Data','getHost','imap.gmail.com','imap.mail.yahoo.com','outlook365','outlook.office365.com','127.0.0.1','lodash','path','node-tnef','email','../../../config/environment','head','address','anonymous','generate','@xcally.com'];(function(_0x14bbb3,_0x45d41e){var _0x4b1fe3=function(_0x5777a5){while(--_0x5777a5){_0x14bbb3['push'](_0x14bbb3['shift']());}};_0x4b1fe3(++_0x45d41e);}(_0x980e,0x1a6));var _0xe980=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x980e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xe980('0x0'));var moment=require('moment');var random=require('randomstring');var fs=require('fs');var path=require(_0xe980('0x1'));var util=require('util');var tnef=require(_0xe980('0x2'));var logger=require('../../../config/logger')(_0xe980('0x3'));var config=require(_0xe980('0x4'));function getAddress(_0x599c53){var _0x4eb599=_[_0xe980('0x5')](_0x599c53['value']);return _0x4eb599&&_0x4eb599['address']?_0x4eb599[_0xe980('0x6')]:_0xe980('0x7')+random[_0xe980('0x8')](0x6)+_0xe980('0x9');}function getFirstName(_0x2d76d0){var _0x44995d=_['head'](_0x2d76d0[_0xe980('0xa')]);if(_0x44995d&&_0x44995d[_0xe980('0xb')]){if(_0x44995d[_0xe980('0xb')]==_0x44995d['address']){return _0x44995d[_0xe980('0xb')][_0xe980('0xc')](0x0,_0x44995d[_0xe980('0xb')][_0xe980('0xd')]('@'));}var _0x161409=_0x44995d['name']['split'](/\s+/);return _0x161409['length']>0x1?_0x161409[_0xe980('0xe')](0x0,-0x1)[_0xe980('0xf')]('\x20'):_0x44995d['name'];}return'Anonymous';}function getLastName(_0x70bd13){var _0x13dc0e=_[_0xe980('0x5')](_0x70bd13[_0xe980('0xa')]);if(_0x13dc0e&&_0x13dc0e[_0xe980('0xb')]){var _0x14979f=_0x13dc0e[_0xe980('0xb')]['split'](/\s+/);return _0x14979f['length']>0x1?_0x14979f['pop']():'';}return'';}function getMails(_0x594116,_0xd9fff2){var _0x1e6760='';for(var _0x406418=0x0;_0x406418<_0xd9fff2[_0xe980('0xa')]['length'];_0x406418+=0x1){if(_0xd9fff2[_0xe980('0xa')][_0x406418][_0xe980('0x6')]!==_0x594116){if(!_[_0xe980('0x10')](_0x1e6760)){_0x1e6760+=',';}_0x1e6760+=_0xd9fff2['value'][_0x406418]['name']||_0xd9fff2[_0xe980('0xa')][_0x406418][_0xe980('0x6')]||'';_0x1e6760+='\x20<';_0x1e6760+=_0xd9fff2[_0xe980('0xa')][_0x406418][_0xe980('0x6')]?_0xd9fff2[_0xe980('0xa')][_0x406418][_0xe980('0x6')]:_0xe980('0x7')+random[_0xe980('0x8')](0x6)+'@xcally.com';_0x1e6760+='>';}}return _0x1e6760;}function parseEmail(_0x50bf1c,_0x12ddc4,_0x2cfe2b){if(_0x12ddc4[_0xe980('0x11')]){var _0x4f929f=/)<[^<]*)*<\/script>/gi;while(_0x4f929f[_0xe980('0x12')](_0x12ddc4[_0xe980('0x11')])){_0x12ddc4['html']=_0x12ddc4[_0xe980('0x11')][_0xe980('0x13')](_0x4f929f,'');}if(_0x12ddc4[_0xe980('0x11')]['includes'](_0xe980('0x14'))){var _0x4e9a85=[];_0x12ddc4[_0xe980('0x15')][_0xe980('0x16')](_0x146fe5=>{_0x4e9a85[_0xe980('0x17')](_0x146fe5['filename']);});var _0x11e5dd=/]+>/g;var _0x392bd1=/src="data:image\/([a-zA-Z]*);base64,([^"]*)"/g;var _0xdc9ad7=_0x12ddc4['html']['replace'](_0x392bd1,_0xe980('0x18'));var _0x138a75=_0xdc9ad7['replace'](_0x11e5dd,_0xe980('0x19'));for(let _0x565424=0x0;_0x565424<_0x4e9a85[_0xe980('0x1a')];_0x565424++){var _0x2b618a=_0x138a75[_0xe980('0x13')](_0xe980('0x19'),_0xe980('0x1b')+_0x4e9a85[_0x565424]+_0xe980('0x1c'));_0x138a75=_0x2b618a;}_0x12ddc4['html']=_0x138a75;}_0x2cfe2b[_0xe980('0x1d')]=_0x12ddc4['html'];}else{_0x2cfe2b[_0xe980('0x1d')]=_0x12ddc4[_0xe980('0x1e')];}if(_0x2cfe2b[_0xe980('0x1d')]){_0x2cfe2b[_0xe980('0x1d')]=_0x2cfe2b[_0xe980('0x1d')]['replace'](/0x0){var _0x1368d6=['Auto-Submitted:\x20auto-replied',_0xe980('0x2f'),_0xe980('0x30')];for(var _0x46197d=0x0;_0x46197d<_0x12ddc4['headerLines'][_0xe980('0x1a')];_0x46197d++){var _0x2c5719=_[_0xe980('0xd')](_0x1368d6,_0x12ddc4['headerLines'][_0x46197d][_0xe980('0x31')]);if(_0x2c5719>=0x0){_0x2cfe2b[_0xe980('0x32')]=!![];}}}return _0x2cfe2b;}exports['parser']=function(_0x110c26,_0x27d09d,_0x3d9246){var _0x105b6e={'from':getAddress(_0x27d09d[_0xe980('0x33')]),'firstName':getFirstName(_0x27d09d[_0xe980('0x33')]),'lastName':getLastName(_0x27d09d['from']),'mapKey':_0xe980('0x3'),'message':{'from':getMails(_0x110c26[_0xe980('0x3')],_0x27d09d[_0xe980('0x33')]),'to':_0x110c26[_0xe980('0x3')],'cc':'','subject':_0x27d09d['subject']||'','messageId':_0x27d09d[_0xe980('0x34')],'inReplyTo':_0x27d09d[_0xe980('0x35')],'sentAt':moment(_0x27d09d[_0xe980('0x36')])[_0xe980('0x28')](_0xe980('0x37')),'attach':![],'attachments':[]}};if(!_0x27d09d[_0xe980('0x11')]&&!_0x27d09d['textAsHtml']){var _0x30855d=_[_0xe980('0x38')](_0x27d09d[_0xe980('0x15')],{'contentType':_0xe980('0x39')});if(_0x30855d[_0xe980('0x1a')]){logger[_0xe980('0x3a')](util[_0xe980('0x28')](_0xe980('0x3b'),_0x27d09d[_0xe980('0x34')]));tnef[_0xe980('0x3c')](_[_0xe980('0x3d')](_0x30855d)[_0xe980('0x2c')],function(_0x2cf4e8,_0x1fda18){if(_0x1fda18){_0x27d09d['html']=_0x1fda18['BodyHTML']||_0xe980('0x3e');if(_0x1fda18[_0xe980('0x3f')]){for(var _0x5b2b7d=0x0;_0x5b2b7d<_0x1fda18['Attachments'][_0xe980('0x1a')];_0x5b2b7d++){var _0x1e1b18=_0x1fda18[_0xe980('0x3f')][_0x5b2b7d];_0x105b6e[_0xe980('0x1f')][_0xe980('0x15')]['push']({'filename':_0x1e1b18[_0xe980('0x40')],'content':Buffer[_0xe980('0x33')](_0x1e1b18[_0xe980('0x41')])});}}}_0x3d9246(parseEmail(_0x110c26,_0x27d09d,_0x105b6e));});}else{_0x27d09d['html']='

Empty\x20message

';_0x3d9246(parseEmail(_0x110c26,_0x27d09d,_0x105b6e));}}else{_0x3d9246(parseEmail(_0x110c26,_0x27d09d,_0x105b6e));}};exports[_0xe980('0x42')]=function(_0xd6c3b5){switch(_0xd6c3b5){case'gmail':return _0xe980('0x43');case'yahoo':return _0xe980('0x44');case'hotmail':return'imap-mail.outlook.com';case _0xe980('0x45'):return _0xe980('0x46');}return _0xe980('0x47');}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index d1b84aa..951cf65 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 _0x5a80=['Service','key','SERV','active','Imap','Smtp','lodash','name'];(function(_0x58f2bb,_0x106aa5){var _0x5be0f3=function(_0x3d76e4){while(--_0x3d76e4){_0x58f2bb['push'](_0x58f2bb['shift']());}};_0x5be0f3(++_0x106aa5);}(_0x5a80,0x196));var _0x05a8=function(_0x35f28e,_0x2a7413){_0x35f28e=_0x35f28e-0x0;var _0x2fa36d=_0x5a80[_0x35f28e];return _0x2fa36d;};'use strict';var _=require(_0x05a8('0x0'));function MailAccount(_0x2d9f24){this['id']=_0x2d9f24['id']||0x0;this[_0x05a8('0x1')]=_0x2d9f24['name']||_0x05a8('0x2');this[_0x05a8('0x3')]=_0x2d9f24['key']||_0x05a8('0x4');this[_0x05a8('0x5')]=_0x2d9f24[_0x05a8('0x5')]||![];this[_0x05a8('0x6')]=_0x2d9f24['Imap']||[];this[_0x05a8('0x7')]=_0x2d9f24[_0x05a8('0x7')]||[];}module['exports']=MailAccount; \ No newline at end of file +var _0xb81e=['key','active','Imap','Smtp','lodash','name'];(function(_0x263714,_0x399b37){var _0x1cd43d=function(_0x2f2d3a){while(--_0x2f2d3a){_0x263714['push'](_0x263714['shift']());}};_0x1cd43d(++_0x399b37);}(_0xb81e,0x1b4));var _0xeb81=function(_0x37b1e6,_0x19d83d){_0x37b1e6=_0x37b1e6-0x0;var _0x43585c=_0xb81e[_0x37b1e6];return _0x43585c;};'use strict';var _=require(_0xeb81('0x0'));function MailAccount(_0x59bf63){this['id']=_0x59bf63['id']||0x0;this[_0xeb81('0x1')]=_0x59bf63[_0xeb81('0x1')]||'Service';this[_0xeb81('0x2')]=_0x59bf63[_0xeb81('0x2')]||'SERV';this[_0xeb81('0x3')]=_0x59bf63[_0xeb81('0x3')]||![];this['Imap']=_0x59bf63[_0xeb81('0x4')]||[];this['Smtp']=_0x59bf63[_0xeb81('0x5')]||[];}module['exports']=MailAccount; \ No newline at end of file diff --git a/server/services/email/realtime/index.js b/server/services/email/realtime/index.js index 37b184b..8f7f21c 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 _0x5136=['prototype','mergeFromDatabase','initMailAccounts','isUndefined','lodash','../model/mailAccount','mailAccounts','hasOwnProperty'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x5136,0x1ac));var _0x6513=function(_0x152620,_0x102bb1){_0x152620=_0x152620-0x0;var _0x3cc6fa=_0x5136[_0x152620];return _0x3cc6fa;};'use strict';var _=require(_0x6513('0x0'));var MailAccount=require(_0x6513('0x1'));var Realtime=function(){this[_0x6513('0x2')]={};};function freeIsNotKey(_0x5170da,_0x4a43ce,_0x5ab7bf){var _0x532f81=_['mapKeys'](_0x5170da,function(_0x8d69ad,_0x3eee8b){return _0x8d69ad[_0x5ab7bf];});for(var _0x4fa228 in _0x4a43ce){if(_0x4a43ce[_0x6513('0x3')](_0x4fa228)){if(!_0x532f81[_0x4fa228]){delete _0x4a43ce[_0x4fa228];}}}}Realtime[_0x6513('0x4')][_0x6513('0x5')]=function(_0x593976,_0x488d9b){for(var _0x1fdd0f in _0x488d9b){if(_0x593976[_0x6513('0x3')](_0x1fdd0f)){_0x593976[_0x1fdd0f]=_0x488d9b[_0x1fdd0f];}}};Realtime[_0x6513('0x4')][_0x6513('0x6')]=function(){var _0x127770=this;return function(_0x16cc0c){if(_0x16cc0c){freeIsNotKey(_0x16cc0c,_0x127770[_0x6513('0x2')],'id');for(var _0x3a26d0=0x0,_0x59909e={},_0x46a869={};_0x3a26d0<_0x16cc0c['length'];_0x3a26d0+=0x1){_0x59909e=_0x16cc0c[_0x3a26d0];if(_[_0x6513('0x7')](_0x127770[_0x6513('0x2')][_0x59909e['id']])){_0x127770[_0x6513('0x2')][_0x59909e['id']]=new MailAccount(_0x59909e);}else{_['merge'](_0x127770[_0x6513('0x2')][_0x59909e['id']],_0x59909e);}}}return _0x127770[_0x6513('0x2')];};};module['exports']=Realtime; \ No newline at end of file +var _0x62c9=['length','isUndefined','merge','exports','../model/mailAccount','mailAccounts','mapKeys','hasOwnProperty','prototype','initMailAccounts'];(function(_0x52adce,_0x5fe2fe){var _0x1d9490=function(_0x211ee1){while(--_0x211ee1){_0x52adce['push'](_0x52adce['shift']());}};_0x1d9490(++_0x5fe2fe);}(_0x62c9,0x1e4));var _0x962c=function(_0x203c69,_0x2fe0e1){_0x203c69=_0x203c69-0x0;var _0x11afda=_0x62c9[_0x203c69];return _0x11afda;};'use strict';var _=require('lodash');var MailAccount=require(_0x962c('0x0'));var Realtime=function(){this[_0x962c('0x1')]={};};function freeIsNotKey(_0x4cb05f,_0x58c552,_0x2bf8df){var _0x1d7d4e=_[_0x962c('0x2')](_0x4cb05f,function(_0x692b3c,_0x36eb3e){return _0x692b3c[_0x2bf8df];});for(var _0x58e7c6 in _0x58c552){if(_0x58c552[_0x962c('0x3')](_0x58e7c6)){if(!_0x1d7d4e[_0x58e7c6]){delete _0x58c552[_0x58e7c6];}}}}Realtime[_0x962c('0x4')]['mergeFromDatabase']=function(_0x32126d,_0x3f5e4a){for(var _0x102156 in _0x3f5e4a){if(_0x32126d[_0x962c('0x3')](_0x102156)){_0x32126d[_0x102156]=_0x3f5e4a[_0x102156];}}};Realtime[_0x962c('0x4')][_0x962c('0x5')]=function(){var _0x5c68d5=this;return function(_0x4b95b4){if(_0x4b95b4){freeIsNotKey(_0x4b95b4,_0x5c68d5['mailAccounts'],'id');for(var _0x21c99d=0x0,_0x40d7f2={},_0x125376={};_0x21c99d<_0x4b95b4[_0x962c('0x6')];_0x21c99d+=0x1){_0x40d7f2=_0x4b95b4[_0x21c99d];if(_[_0x962c('0x7')](_0x5c68d5[_0x962c('0x1')][_0x40d7f2['id']])){_0x5c68d5[_0x962c('0x1')][_0x40d7f2['id']]=new MailAccount(_0x40d7f2);}else{_[_0x962c('0x8')](_0x5c68d5[_0x962c('0x1')][_0x40d7f2['id']],_0x40d7f2);}}}return _0x5c68d5[_0x962c('0x1')];};};module[_0x962c('0x9')]=Realtime; \ No newline at end of file diff --git a/server/services/email/rpc/mailAccount.js b/server/services/email/rpc/mailAccount.js index 64fc5ed..7edca30 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 _0xa68e=['MailServerIn','MailServerOut','Smtp','getMailAccount','notify','Request','NotifyMailAccount','../client','getMailAccounts','GetMailAccount','name','service','email','active','key','ListId','TemplateId'];(function(_0x2d1cfe,_0x57bf1a){var _0x559449=function(_0x12e885){while(--_0x12e885){_0x2d1cfe['push'](_0x2d1cfe['shift']());}};_0x559449(++_0x57bf1a);}(_0xa68e,0xd3));var _0xea68=function(_0x509b99,_0x3ff1f0){_0x509b99=_0x509b99-0x0;var _0x383d46=_0xa68e[_0x509b99];return _0x383d46;};'use strict';var client=require(_0xea68('0x0'));exports[_0xea68('0x1')]=function(){return function(){return client['Request'](_0xea68('0x2'),{'options':{'attributes':['id',_0xea68('0x3'),_0xea68('0x4'),_0xea68('0x5'),_0xea68('0x6'),_0xea68('0x7'),_0xea68('0x8'),_0xea68('0x9')],'raw':![],'include':[{'model':_0xea68('0xa'),'as':'Imap'},{'model':_0xea68('0xb'),'as':_0xea68('0xc')}]},'log':_0xea68('0xd')});};};exports[_0xea68('0xe')]=function(_0xddd0a3,_0x33a901){return client[_0xea68('0xf')](_0xea68('0x10'),{'account':{'id':_0xddd0a3},'body':_0x33a901,'log':_0xea68('0x10')});}; \ No newline at end of file +var _0x8254=['key','ListId','TemplateId','MailServerIn','Imap','MailServerOut','getMailAccount','notify','NotifyMailAccount','../client','Request','name','service','email'];(function(_0x50097b,_0xd3a06b){var _0x55d890=function(_0x235af8){while(--_0x235af8){_0x50097b['push'](_0x50097b['shift']());}};_0x55d890(++_0xd3a06b);}(_0x8254,0x95));var _0x4825=function(_0x3f14a4,_0x345d80){_0x3f14a4=_0x3f14a4-0x0;var _0x1358e2=_0x8254[_0x3f14a4];return _0x1358e2;};'use strict';var client=require(_0x4825('0x0'));exports['getMailAccounts']=function(){return function(){return client[_0x4825('0x1')]('GetMailAccount',{'options':{'attributes':['id',_0x4825('0x2'),_0x4825('0x3'),_0x4825('0x4'),'active',_0x4825('0x5'),_0x4825('0x6'),_0x4825('0x7')],'raw':![],'include':[{'model':_0x4825('0x8'),'as':_0x4825('0x9')},{'model':_0x4825('0xa'),'as':'Smtp'}]},'log':_0x4825('0xb')});};};exports[_0x4825('0xc')]=function(_0x3c8ed4,_0x547731){return client[_0x4825('0x1')](_0x4825('0xd'),{'account':{'id':_0x3c8ed4},'body':_0x547731,'log':_0x4825('0xd')});}; \ No newline at end of file diff --git a/server/services/email/rpc/setting.js b/server/services/email/rpc/setting.js index a3cfa52..5467172 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 _0xd683=['Request','ShowSetting','loginMailFrequency','GetSettings'];(function(_0x211f51,_0x3af006){var _0x152287=function(_0x39b7af){while(--_0x39b7af){_0x211f51['push'](_0x211f51['shift']());}};_0x152287(++_0x3af006);}(_0xd683,0x168));var _0x3d68=function(_0x1671e8,_0x405093){_0x1671e8=_0x1671e8-0x0;var _0x4c2781=_0xd683[_0x1671e8];return _0x4c2781;};'use strict';var client=require('../client');exports['getSettings']=function(){return client[_0x3d68('0x0')](_0x3d68('0x1'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':[_0x3d68('0x2')]},'log':_0x3d68('0x3')});}; \ No newline at end of file +var _0x5413=['Request','ShowSetting','../client','getSettings'];(function(_0x222550,_0x3c0a0c){var _0x58ac61=function(_0x4f7201){while(--_0x4f7201){_0x222550['push'](_0x222550['shift']());}};_0x58ac61(++_0x3c0a0c);}(_0x5413,0x19e));var _0x3541=function(_0x1bdf6d,_0x11f12a){_0x1bdf6d=_0x1bdf6d-0x0;var _0x416906=_0x5413[_0x1bdf6d];return _0x416906;};'use strict';var client=require(_0x3541('0x0'));exports[_0x3541('0x1')]=function(){return client[_0x3541('0x2')](_0x3541('0x3'),{'options':{'raw':!![],'where':{'id':0x1},'attributes':['loginMailFrequency']},'log':'GetSettings'});}; \ No newline at end of file diff --git a/server/services/email/server/index.js b/server/services/email/server/index.js index 0cdaeb2..c8c2389 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(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xa9e0[_0x56482c];return _0x5aae7a;};'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(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xa9e0,0x123));var _0x0a9e=function(_0x373dee,_0x1a8c45){_0x373dee=_0x373dee-0x0;var _0x46798f=_0xa9e0[_0x373dee];return _0x46798f;};'use strict';var jayson=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var logger=require('../../../config/logger')('email');exports[_0x0a9e('0x3')]=function(_0x4ce2f1,_0x333808){return new BPromise(function(_0x432180,_0x2ab90b){var _0x991246={'SendMail':function(_0x981158){var _0x57b080=this;return new Promise(function(_0x219af0,_0x441e3a){_0x333808[_0x0a9e('0x4')](_0x981158['account'],_0x981158['message'])[_0x0a9e('0x5')](function(_0x56465b){_0x219af0({'code':0xc8,'message':_0x56465b});})['catch'](function(_0x39753a){_0x441e3a(_0x57b080[_0x0a9e('0x6')](0x1f4,_0x39753a));});});},'VerifySmtp':function(_0x307b3e){var _0x3ab53f=this;return new Promise(function(_0xfeb75b,_0xbd1168){_0x333808['verifySmtp'](_0x307b3e['account'])['then'](function(_0x4cfe67){_0xfeb75b({'code':0xc8,'message':_0x0a9e('0x7')});})[_0x0a9e('0x8')](function(_0xd5b662){_0xbd1168(_0x3ab53f[_0x0a9e('0x6')](0x1f4,_0xd5b662));});});},'MailAccounts':function(_0x32d742){return new Promise(function(_0x69aeb7,_0x5db4b0){var _0x4283ce=_[_0x0a9e('0x9')](_0x4ce2f1[_0x0a9e('0xa')]);for(var _0x281129=0x0;_0x281129<_0x4283ce[_0x0a9e('0xb')];_0x281129+=0x1){if(_0x4283ce[_0x281129][_0x0a9e('0xc')]&&_0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')]){delete _0x4283ce[_0x281129]['Imap'][_0x0a9e('0xd')];}if(_0x4283ce[_0x281129]['Smtp']&&_0x4283ce[_0x281129][_0x0a9e('0xe')][_0x0a9e('0xf')]){delete _0x4283ce[_0x281129]['Smtp'][_0x0a9e('0xf')];}}_0x69aeb7({'count':_0x4283ce['length'],'rows':_0x4283ce});});}};var _0x459eb1=jayson[_0x0a9e('0x10')](_0x991246)[_0x0a9e('0x11')]();_0x459eb1['on'](_0x0a9e('0x6'),function(_0x31b1ca){logger[_0x0a9e('0x6')](JSON[_0x0a9e('0x12')](_0x31b1ca));return _0x2ab90b(_0x31b1ca);});_0x459eb1[_0x0a9e('0x3')](0x232b,_0x0a9e('0x13'),function(){console[_0x0a9e('0x14')](_0x0a9e('0x15'),0x232b);return _0x432180(_0x0a9e('0x16')+0x232b);});});}; \ No newline at end of file diff --git a/server/services/express/index.js b/server/services/express/index.js index 6dadd20..102e2d2 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 _0x0dc9=['listen','socket.io','websocket','polling','redis','defaults','localhost','socket.io-redis','../../config/triggers','default','../../routes','once','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','port','exports','lodash','http','ioredis','../../config/environment','createServer','timeout'];(function(_0x51d129,_0x175d7d){var _0x44c377=function(_0x5ee454){while(--_0x5ee454){_0x51d129['push'](_0x51d129['shift']());}};_0x44c377(++_0x175d7d);}(_0x0dc9,0xe0));var _0x90dc=function(_0x2a0824,_0x21d97a){_0x2a0824=_0x2a0824-0x0;var _0x1a78f7=_0x0dc9[_0x2a0824];return _0x1a78f7;};'use strict';var _=require(_0x90dc('0x0'));var http=require(_0x90dc('0x1'));var express=require('express');var sticky=require('sticky-session');var Redis=require(_0x90dc('0x2'));var config=require(_0x90dc('0x3'));var app=express();var server=http[_0x90dc('0x4')](app);server[_0x90dc('0x5')]=0xdbba0;if(sticky[_0x90dc('0x6')](server,config['port'])){var socketio=require(_0x90dc('0x7'))(server,{'transports':[_0x90dc('0x8'),_0x90dc('0x9')]});config[_0x90dc('0xa')]=_[_0x90dc('0xb')](config[_0x90dc('0xa')],{'host':_0x90dc('0xc'),'port':0x18eb});socketio['adapter'](require(_0x90dc('0xd'))({'pubClient':new Redis(config['redis']),'subClient':new Redis(config['redis'])}));require(_0x90dc('0xe'))[_0x90dc('0xf')]();require('../../config/socketio')[_0x90dc('0xf')](socketio);require('../../config/express')[_0x90dc('0xf')](app);require(_0x90dc('0x10'))[_0x90dc('0xf')](app);}else{server[_0x90dc('0x11')](_0x90dc('0x12'),function(){console[_0x90dc('0x13')](_0x90dc('0x14'),config[_0x90dc('0x15')]);});}exports=module[_0x90dc('0x16')]=app; \ No newline at end of file +var _0x1fea=['exports','lodash','http','sticky-session','ioredis','../../config/environment','createServer','timeout','listen','port','socket.io','websocket','polling','redis','defaults','localhost','adapter','socket.io-redis','../../config/triggers','default','../../config/socketio','../../config/express','../../routes','once','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!'];(function(_0x1ba40c,_0x2c7584){var _0x1b60e3=function(_0x37bacb){while(--_0x37bacb){_0x1ba40c['push'](_0x1ba40c['shift']());}};_0x1b60e3(++_0x2c7584);}(_0x1fea,0x145));var _0xa1fe=function(_0xfb16f5,_0x402792){_0xfb16f5=_0xfb16f5-0x0;var _0x4ac988=_0x1fea[_0xfb16f5];return _0x4ac988;};'use strict';var _=require(_0xa1fe('0x0'));var http=require(_0xa1fe('0x1'));var express=require('express');var sticky=require(_0xa1fe('0x2'));var Redis=require(_0xa1fe('0x3'));var config=require(_0xa1fe('0x4'));var app=express();var server=http[_0xa1fe('0x5')](app);server[_0xa1fe('0x6')]=0xdbba0;if(sticky[_0xa1fe('0x7')](server,config[_0xa1fe('0x8')])){var socketio=require(_0xa1fe('0x9'))(server,{'transports':[_0xa1fe('0xa'),_0xa1fe('0xb')]});config[_0xa1fe('0xc')]=_[_0xa1fe('0xd')](config[_0xa1fe('0xc')],{'host':_0xa1fe('0xe'),'port':0x18eb});socketio[_0xa1fe('0xf')](require(_0xa1fe('0x10'))({'pubClient':new Redis(config[_0xa1fe('0xc')]),'subClient':new Redis(config[_0xa1fe('0xc')])}));require(_0xa1fe('0x11'))[_0xa1fe('0x12')]();require(_0xa1fe('0x13'))[_0xa1fe('0x12')](socketio);require(_0xa1fe('0x14'))['default'](app);require(_0xa1fe('0x15'))[_0xa1fe('0x12')](app);}else{server[_0xa1fe('0x16')](_0xa1fe('0x17'),function(){console[_0xa1fe('0x18')](_0xa1fe('0x19'),config[_0xa1fe('0x8')]);});}exports=module[_0xa1fe('0x1a')]=app; \ No newline at end of file diff --git a/server/services/routing/client.js b/server/services/routing/client.js index e9b0316..b20af74 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 _0xd94c=['then','debug','rpc','error','message','result','jayson/promise','../../config/logger','routing','client','http','request'];(function(_0x3eb4a9,_0x359d73){var _0x48dbad=function(_0x3a3ca6){while(--_0x3a3ca6){_0x3eb4a9['push'](_0x3eb4a9['shift']());}};_0x48dbad(++_0x359d73);}(_0xd94c,0xde));var _0xcd94=function(_0x22b1c4,_0x34032b){_0x22b1c4=_0x22b1c4-0x0;var _0x37be68=_0xd94c[_0x22b1c4];return _0x37be68;};'use strict';var jayson=require(_0xcd94('0x0'));var BPromise=require('bluebird');var logger=require(_0xcd94('0x1'))(_0xcd94('0x2'));var client=jayson[_0xcd94('0x3')][_0xcd94('0x4')]({'port':0x2329});client['Request']=function(_0x42bb42,_0x5b961f){return new BPromise(function(_0x19a144,_0x2f6cb4){return client[_0xcd94('0x5')](_0x42bb42,_0x5b961f)[_0xcd94('0x6')](function(_0x166a31){logger[_0xcd94('0x7')](_0xcd94('0x8'),_0xcd94('0x2'),_0x42bb42,_0x5b961f,_0x166a31);if(_0x166a31['error']){logger['error'](_0xcd94('0x8'),_0xcd94('0x2'),_0x42bb42,_0x166a31[_0xcd94('0x9')][_0xcd94('0xa')],_0x5b961f);return _0x2f6cb4(_0x166a31[_0xcd94('0x9')][_0xcd94('0xa')]);}else{return _0x19a144(_0x166a31[_0xcd94('0xb')]);}})['catch'](function(_0x702d3b){logger[_0xcd94('0x9')]('rpc',_0xcd94('0x2'),_0x42bb42,_0x702d3b,_0x5b961f);return _0x2f6cb4(_0x702d3b);});});};module['exports']=client; \ No newline at end of file +var _0x2ac8=['http','Request','request','error','rpc','message','result','catch','exports','../../config/logger','routing','client'];(function(_0x27842c,_0x324fcb){var _0x493de8=function(_0x1f6c85){while(--_0x1f6c85){_0x27842c['push'](_0x27842c['shift']());}};_0x493de8(++_0x324fcb);}(_0x2ac8,0x81));var _0x82ac=function(_0x2a883e,_0x39fd08){_0x2a883e=_0x2a883e-0x0;var _0x141c0c=_0x2ac8[_0x2a883e];return _0x141c0c;};'use strict';var jayson=require('jayson/promise');var BPromise=require('bluebird');var logger=require(_0x82ac('0x0'))(_0x82ac('0x1'));var client=jayson[_0x82ac('0x2')][_0x82ac('0x3')]({'port':0x2329});client[_0x82ac('0x4')]=function(_0x130e1d,_0x43f4a2){return new BPromise(function(_0x1cf9a2,_0x354764){return client[_0x82ac('0x5')](_0x130e1d,_0x43f4a2)['then'](function(_0x246266){logger['debug']('rpc','routing',_0x130e1d,_0x43f4a2,_0x246266);if(_0x246266['error']){logger[_0x82ac('0x6')](_0x82ac('0x7'),_0x82ac('0x1'),_0x130e1d,_0x246266['error'][_0x82ac('0x8')],_0x43f4a2);return _0x354764(_0x246266[_0x82ac('0x6')][_0x82ac('0x8')]);}else{return _0x1cf9a2(_0x246266[_0x82ac('0x9')]);}})[_0x82ac('0xa')](function(_0x38e21b){logger[_0x82ac('0x6')]('rpc',_0x82ac('0x1'),_0x130e1d,_0x38e21b,_0x43f4a2);return _0x354764(_0x38e21b);});});};module[_0x82ac('0xb')]=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index ef718f1..1309470 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 _0x8f4d=['./rpc/mailQueue','./rpc/whatsappQueue','then','initAgents','initIntervals','getChatQueues','initChatQueues','getSmsQueues','initSmsQueues','getMailQueues','initMailQueues','getFaxQueues','initFaxQueues','getWhatsappQueues','initWhatsappQueues','catch','log','bluebird','./server','./realtime','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue'];(function(_0x3ba2a0,_0x5453a5){var _0x575d6c=function(_0x122450){while(--_0x122450){_0x3ba2a0['push'](_0x3ba2a0['shift']());}};_0x575d6c(++_0x5453a5);}(_0x8f4d,0x181));var _0xd8f4=function(_0x9c2427,_0x17c865){_0x9c2427=_0x9c2427-0x0;var _0x51984f=_0x8f4d[_0x9c2427];return _0x51984f;};'use strict';var BPromise=require(_0xd8f4('0x0'));var server=require(_0xd8f4('0x1'));var Realtime=require(_0xd8f4('0x2'));var user=require('./rpc/user');var interval=require(_0xd8f4('0x3'));var openchannelQueue=require(_0xd8f4('0x4'));var chatQueue=require(_0xd8f4('0x5'));var smsQueue=require('./rpc/smsQueue');var mailQueue=require(_0xd8f4('0x6'));var faxQueue=require('./rpc/faxQueue');var whatsappQueue=require(_0xd8f4('0x7'));var realtime=new Realtime();function initRealtime(){return BPromise['resolve']()[_0xd8f4('0x8')](user['getAgents']())['then'](realtime[_0xd8f4('0x9')]())[_0xd8f4('0x8')](interval['getIntervals']())[_0xd8f4('0x8')](realtime[_0xd8f4('0xa')]())['then'](openchannelQueue['getOpenchannelQueues']())[_0xd8f4('0x8')](realtime['initOpenchannelQueues']())[_0xd8f4('0x8')](chatQueue[_0xd8f4('0xb')]())['then'](realtime[_0xd8f4('0xc')]())[_0xd8f4('0x8')](smsQueue[_0xd8f4('0xd')]())[_0xd8f4('0x8')](realtime[_0xd8f4('0xe')]())[_0xd8f4('0x8')](mailQueue[_0xd8f4('0xf')]())[_0xd8f4('0x8')](realtime[_0xd8f4('0x10')]())[_0xd8f4('0x8')](faxQueue[_0xd8f4('0x11')]())[_0xd8f4('0x8')](realtime[_0xd8f4('0x12')]())[_0xd8f4('0x8')](whatsappQueue[_0xd8f4('0x13')]())[_0xd8f4('0x8')](realtime[_0xd8f4('0x14')]())[_0xd8f4('0x8')](function(){return realtime;});}function main(){return server['listen'](realtime)['then'](function(_0x21a521){return initRealtime();})[_0xd8f4('0x8')](function(_0x1b8315){return setInterval(initRealtime,0x1388);})[_0xd8f4('0x15')](function(_0xb7fb01){console[_0xd8f4('0x16')](_0xb7fb01);});}main(); \ No newline at end of file +var _0x1d92=['getOpenchannelQueues','initOpenchannelQueues','initChatQueues','getSmsQueues','initSmsQueues','getMailQueues','initMailQueues','getFaxQueues','initFaxQueues','getWhatsappQueues','listen','catch','log','bluebird','./server','./realtime','./rpc/user','./rpc/interval','./rpc/openchannelQueue','./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','./rpc/whatsappQueue','then','getAgents','initAgents','getIntervals','initIntervals'];(function(_0x34c5ae,_0x1bd250){var _0x134720=function(_0x48e60d){while(--_0x48e60d){_0x34c5ae['push'](_0x34c5ae['shift']());}};_0x134720(++_0x1bd250);}(_0x1d92,0x12f));var _0x21d9=function(_0x49c957,_0x3509d8){_0x49c957=_0x49c957-0x0;var _0x5b1d38=_0x1d92[_0x49c957];return _0x5b1d38;};'use strict';var BPromise=require(_0x21d9('0x0'));var server=require(_0x21d9('0x1'));var Realtime=require(_0x21d9('0x2'));var user=require(_0x21d9('0x3'));var interval=require(_0x21d9('0x4'));var openchannelQueue=require(_0x21d9('0x5'));var chatQueue=require(_0x21d9('0x6'));var smsQueue=require(_0x21d9('0x7'));var mailQueue=require(_0x21d9('0x8'));var faxQueue=require(_0x21d9('0x9'));var whatsappQueue=require(_0x21d9('0xa'));var realtime=new Realtime();function initRealtime(){return BPromise['resolve']()[_0x21d9('0xb')](user[_0x21d9('0xc')]())[_0x21d9('0xb')](realtime[_0x21d9('0xd')]())[_0x21d9('0xb')](interval[_0x21d9('0xe')]())[_0x21d9('0xb')](realtime[_0x21d9('0xf')]())['then'](openchannelQueue[_0x21d9('0x10')]())[_0x21d9('0xb')](realtime[_0x21d9('0x11')]())[_0x21d9('0xb')](chatQueue['getChatQueues']())[_0x21d9('0xb')](realtime[_0x21d9('0x12')]())[_0x21d9('0xb')](smsQueue[_0x21d9('0x13')]())[_0x21d9('0xb')](realtime[_0x21d9('0x14')]())[_0x21d9('0xb')](mailQueue[_0x21d9('0x15')]())[_0x21d9('0xb')](realtime[_0x21d9('0x16')]())[_0x21d9('0xb')](faxQueue[_0x21d9('0x17')]())[_0x21d9('0xb')](realtime[_0x21d9('0x18')]())['then'](whatsappQueue[_0x21d9('0x19')]())[_0x21d9('0xb')](realtime['initWhatsappQueues']())[_0x21d9('0xb')](function(){return realtime;});}function main(){return server[_0x21d9('0x1a')](realtime)[_0x21d9('0xb')](function(_0x16f446){return initRealtime();})[_0x21d9('0xb')](function(_0xf2d4db){return setInterval(initRealtime,0x1388);})[_0x21d9('0x1b')](function(_0x40f9aa){console[_0x21d9('0x1c')](_0x40f9aa);});}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 c9619c9..41408a6 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(_0x3dd3bc,_0x32950b){var _0x172373=function(_0x2b0f0d){while(--_0x2b0f0d){_0x3dd3bc['push'](_0x3dd3bc['shift']());}};_0x172373(++_0x32950b);}(_0x326f,0xd1));var _0xf326=function(_0xf8bcb8,_0x1710db){_0xf8bcb8=_0xf8bcb8-0x0;var _0x112c38=_0x326f[_0xf8bcb8];return _0x112c38;};'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 _0x814b=['init','parse','map','object','lodash','util','events','EventEmitter','isNil','register','ignoreFactChanges','inherits','prototype','rules','isArray','concat','isObject','push','sync','filter','activeRules','orderBy','asc','execute','result','clone','name','ruleRef','call','next','isEqual','nextTick','restart','length','condition','matchPath','noop','findRules','matches','turn','prioritize','priority','toJSON','toString','consequence','fromJSON'];(function(_0x259ad7,_0x87c846){var _0x260f63=function(_0x4f4390){while(--_0x4f4390){_0x259ad7['push'](_0x259ad7['shift']());}};_0x260f63(++_0x87c846);}(_0x814b,0x1a2));var _0xb814=function(_0x16b561,_0x5a914f){_0x16b561=_0x16b561-0x0;var _0x22599f=_0x814b[_0x16b561];return _0x22599f;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var EventEmitter=require(_0xb814('0x2'))[_0xb814('0x3')];function RuleEngine(_0xfbb64b,_0x477725){this['init']();if(!_[_0xb814('0x4')](_0xfbb64b)){this[_0xb814('0x5')](_0xfbb64b);}if(_0x477725){this[_0xb814('0x6')]=_0x477725[_0xb814('0x6')];}return this;}util[_0xb814('0x7')](RuleEngine,EventEmitter);RuleEngine[_0xb814('0x8')]['init']=function(_0x3b0829){this[_0xb814('0x9')]=[];this['activeRules']=[];};RuleEngine[_0xb814('0x8')][_0xb814('0x5')]=function(_0x186d5a){if(Array[_0xb814('0xa')](_0x186d5a)){this[_0xb814('0x9')]=this[_0xb814('0x9')][_0xb814('0xb')](_0x186d5a);}else if(_0x186d5a!==null&&_[_0xb814('0xc')](_0x186d5a)){this[_0xb814('0x9')][_0xb814('0xd')](_0x186d5a);}this[_0xb814('0xe')]();};RuleEngine['prototype'][_0xb814('0xe')]=function(){this['activeRules']=this[_0xb814('0x9')][_0xb814('0xf')](function(_0x35b10d){if(_[_0xb814('0x4')](_0x35b10d['on'])){_0x35b10d['on']=!![];}if(_0x35b10d['on']===!![]){return _0x35b10d;}});this[_0xb814('0x10')]=_[_0xb814('0x11')](this[_0xb814('0x10')],['p'],[_0xb814('0x12')]);};RuleEngine[_0xb814('0x8')][_0xb814('0x13')]=function(_0x3f4881,_0x44fb96){var _0x17f5bd=![];_0x3f4881[_0xb814('0x14')]=!![];var _0x303aca=_[_0xb814('0x15')](_0x3f4881);var _0x45e0d0=_[_0xb814('0x15')](_0x3f4881);var _0x125ce2=this[_0xb814('0x10')];var _0x7a21ef=[];var _0x48c9df=this[_0xb814('0x6')];(function FnRuleLoop(_0x55ba16){var _0x270598={'rules':function(){return _0x125ce2;},'rule':function(){return _0x125ce2[_0x55ba16];},'when':function(_0xfac75b){if(_0xfac75b){var _0x4c3007=_0x125ce2[_0x55ba16]['consequence'];_0x4c3007['ruleRef']=_0x125ce2[_0x55ba16]['id']||_0x125ce2[_0x55ba16][_0xb814('0x16')]||'index_'+_0x55ba16;process['nextTick'](function(){_0x7a21ef[_0xb814('0xd')](_0x4c3007[_0xb814('0x17')]);_0x4c3007[_0xb814('0x18')](_0x303aca,_0x270598);});}else{process['nextTick'](function(){_0x270598[_0xb814('0x19')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x17f5bd=!![];return FnRuleLoop(0x0);},'next':function(_0x531032){if(!_0x48c9df&&!_[_0xb814('0x1a')](_0x45e0d0,_0x303aca)){_0x45e0d0=_[_0xb814('0x15')](_0x303aca);process[_0xb814('0x1b')](function(){_0x270598[_0xb814('0x1c')]();});}else{process[_0xb814('0x1b')](function(){if(_[_0xb814('0x4')](_0x531032)){return FnRuleLoop(_0x55ba16+0x1);}else{return FnRuleLoop(_0x531032);}});}}};if(_0x55ba16<_0x125ce2[_0xb814('0x1d')]&&_0x17f5bd===![]){var _0x594470=_0x125ce2[_0x55ba16][_0xb814('0x1e')];_0x594470['call'](_0x303aca,_0x270598);}else{process[_0xb814('0x1b')](function(){_0x303aca[_0xb814('0x1f')]=_0x7a21ef;return _0x44fb96?_0x44fb96(_0x303aca):_[_0xb814('0x20')]();});}}(0x0));};RuleEngine[_0xb814('0x8')][_0xb814('0x21')]=function(_0xb9e57d){if(_[_0xb814('0x4')](_0xb9e57d)){return this['rules'];}else{var _0x392222=_[_0xb814('0x22')](_0xb9e57d);return _[_0xb814('0xf')](this[_0xb814('0x9')],_0x392222);}};RuleEngine[_0xb814('0x8')][_0xb814('0x23')]=function(_0x3f0150,_0x1e4e89){var _0x5a6291=_0x3f0150==='on'||_0x3f0150==='ON'?!![]:![];var _0x271aa8=this[_0xb814('0x21')](_0x1e4e89);for(var _0x52ed64=0x0,_0x9008b2=_0x271aa8[_0xb814('0x1d')];_0x52ed64<_0x9008b2;_0x52ed64+=0x1){_0x271aa8[_0x52ed64]['on']=_0x5a6291;}this[_0xb814('0xe')]();};RuleEngine['prototype'][_0xb814('0x24')]=function(_0x2051d0,_0x58c3ca){_0x2051d0=parseInt(_0x2051d0,0xa);var _0x338a28=this['findRules'](_0x58c3ca);for(var _0x6efe9a=0x0,_0x5f3e9b=_0x338a28['length'];_0x6efe9a<_0x5f3e9b;_0x6efe9a+=0x1){_0x338a28[_0x6efe9a][_0xb814('0x25')]=_0x2051d0;}this['sync']();};RuleEngine[_0xb814('0x8')][_0xb814('0x26')]=function(){var _0x2b91bd=this['rules'];if(_0x2b91bd instanceof Array){_0x2b91bd=_0x2b91bd['map'](function(_0x26d3a9){_0x26d3a9[_0xb814('0x1e')]=_0x26d3a9['condition'][_0xb814('0x27')]();_0x26d3a9[_0xb814('0x28')]=_0x26d3a9[_0xb814('0x28')][_0xb814('0x27')]();return _0x26d3a9;});}else if(!_[_0xb814('0x4')](_0x2b91bd)){_0x2b91bd[_0xb814('0x1e')]=_0x2b91bd[_0xb814('0x1e')]['toString']();_0x2b91bd[_0xb814('0x28')]=_0x2b91bd[_0xb814('0x28')][_0xb814('0x27')]();}return _0x2b91bd;};RuleEngine[_0xb814('0x8')][_0xb814('0x29')]=function(_0x4ff31a){this[_0xb814('0x2a')]();if(_['isString'](_0x4ff31a)){_0x4ff31a=JSON[_0xb814('0x2b')](_0x4ff31a);}if(_0x4ff31a instanceof Array){_0x4ff31a=_0x4ff31a[_0xb814('0x2c')](function(_0xe0f509){_0xe0f509['condition']=eval('('+_0xe0f509[_0xb814('0x1e')]+')');_0xe0f509[_0xb814('0x28')]=eval('('+_0xe0f509['consequence']+')');return _0xe0f509;});}else if(_0x4ff31a!==null&&typeof _0x4ff31a==_0xb814('0x2d')){_0x4ff31a[_0xb814('0x1e')]=eval('('+_0x4ff31a[_0xb814('0x1e')]+')');_0x4ff31a[_0xb814('0x28')]=eval('('+_0x4ff31a[_0xb814('0x28')]+')');}this[_0xb814('0x5')](_0x4ff31a);};module['exports']=RuleEngine; \ No newline at end of file diff --git a/server/services/routing/mailRpc/index.js b/server/services/routing/mailRpc/index.js index 3aabf7b..d74a5a6 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 _0xd977=['then','error','result','sendMailMessage','SendMail','client','http','request'];(function(_0x5b91c7,_0x41895f){var _0x140071=function(_0x16b163){while(--_0x16b163){_0x5b91c7['push'](_0x5b91c7['shift']());}};_0x140071(++_0x41895f);}(_0xd977,0x14d));var _0x7d97=function(_0x3d1984,_0x1d8761){_0x3d1984=_0x3d1984-0x0;var _0x472f24=_0xd977[_0x3d1984];return _0x472f24;};'use strict';var BPromise=require('bluebird');var jayson=require('jayson/promise');var client=jayson[_0x7d97('0x0')][_0x7d97('0x1')]({'port':0x232b});function request(_0x15c146,_0x262573){return new BPromise(function(_0x41a5f4,_0x2499c8){return client[_0x7d97('0x2')](_0x15c146,_0x262573)[_0x7d97('0x3')](function(_0x48f80a){if(_0x48f80a[_0x7d97('0x4')]){return _0x2499c8(_0x48f80a[_0x7d97('0x4')]['message']);}else{return _0x41a5f4(_0x48f80a[_0x7d97('0x5')]);}})['catch'](function(_0xc6eaf0){return _0x2499c8(_0xc6eaf0);});});}exports[_0x7d97('0x6')]=function(_0x32a3ea,_0x4cae0a){return request(_0x7d97('0x7'),{'account':_0x32a3ea,'message':_0x4cae0a});}; \ No newline at end of file +var _0x57fd=['then','error','sendMailMessage','SendMail','bluebird','jayson/promise','client','request'];(function(_0x1ab0ca,_0x7f7dd6){var _0x3be475=function(_0x443f95){while(--_0x443f95){_0x1ab0ca['push'](_0x1ab0ca['shift']());}};_0x3be475(++_0x7f7dd6);}(_0x57fd,0x10c));var _0xd57f=function(_0x556f23,_0x30ed54){_0x556f23=_0x556f23-0x0;var _0x4dcecc=_0x57fd[_0x556f23];return _0x4dcecc;};'use strict';var BPromise=require(_0xd57f('0x0'));var jayson=require(_0xd57f('0x1'));var client=jayson[_0xd57f('0x2')]['http']({'port':0x232b});function request(_0x316d3c,_0x38d2a4){return new BPromise(function(_0x55e9da,_0x37c065){return client[_0xd57f('0x3')](_0x316d3c,_0x38d2a4)[_0xd57f('0x4')](function(_0x40607c){if(_0x40607c['error']){return _0x37c065(_0x40607c[_0xd57f('0x5')]['message']);}else{return _0x55e9da(_0x40607c['result']);}})['catch'](function(_0x38efbf){return _0x37c065(_0x38efbf);});});}exports[_0xd57f('0x6')]=function(_0x551eef,_0x5b8f86){return request(_0xd57f('0x7'),{'account':_0x551eef,'message':_0x5b8f86});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index 017ac43..559ab41 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 _0x8ae0=['prototype','getChannelStatus','CurrentCapacity','Capacity','maxcapacity','working','idle','mail','chat','fax','sms','whatsapp','length','Status','StatusTime','toNumber','mailStatus','smsCurrentCapacity','stringify','lodash','moment','md5','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCapacity','mailStatusTime','mailCapacity','faxStatus','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatus','smsStatusTime','smsCapacity','whatsappStatusTime','whatsappCapacity','whatsappCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','busyQueue','updateRealtime'];(function(_0x382a62,_0x1baa5e){var _0x490a25=function(_0x1b3427){while(--_0x1b3427){_0x382a62['push'](_0x382a62['shift']());}};_0x490a25(++_0x1baa5e);}(_0x8ae0,0x169));var _0x08ae=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x8ae0[_0x8c43de];return _0xa6591b;};'use strict';var _=require(_0x08ae('0x0'));var moment=require(_0x08ae('0x1'));var md5=require(_0x08ae('0x2'));var Redis=require(_0x08ae('0x3'));var config=require(_0x08ae('0x4'));config[_0x08ae('0x5')]=_['defaults'](config['redis'],{'host':_0x08ae('0x6'),'port':0x18eb});var io=require(_0x08ae('0x7'))(new Redis(config['redis']));function Agent(_0x170eb4){this['id']=_0x170eb4['id']||0x0;this['name']=_0x170eb4[_0x08ae('0x8')]||'';this[_0x08ae('0x9')]=_0x170eb4[_0x08ae('0x9')]||!![];this[_0x08ae('0xa')]=_0x170eb4[_0x08ae('0xa')]||![];this[_0x08ae('0xb')]=_0x170eb4[_0x08ae('0xb')]||![];this['mailPause']=_0x170eb4[_0x08ae('0xc')]||![];this[_0x08ae('0xd')]=_0x170eb4['faxPause']||![];this['smsPause']=_0x170eb4['smsPause']||![];this[_0x08ae('0xe')]=_0x170eb4[_0x08ae('0xe')]||![];this[_0x08ae('0xf')]=_0x08ae('0x10');this[_0x08ae('0x11')]=0x0;this[_0x08ae('0x12')]=_0x170eb4['chatCapacity']||0x0;this['chatCurrentCapacity']=0x0;this['mailStatus']=_0x08ae('0x10');this[_0x08ae('0x13')]=0x0;this[_0x08ae('0x14')]=_0x170eb4['mailCapacity']||0x0;this['mailCurrentCapacity']=0x0;this[_0x08ae('0x15')]='unknown';this[_0x08ae('0x16')]=0x0;this[_0x08ae('0x17')]=_0x170eb4[_0x08ae('0x17')]||0x0;this[_0x08ae('0x18')]=0x0;this[_0x08ae('0x19')]=_0x08ae('0x10');this[_0x08ae('0x1a')]=0x0;this[_0x08ae('0x1b')]=_0x170eb4[_0x08ae('0x1b')]||0x0;this['smsCurrentCapacity']=0x0;this['whatsappStatus']='unknown';this[_0x08ae('0x1c')]=0x0;this[_0x08ae('0x1d')]=_0x170eb4[_0x08ae('0x1d')]||0x0;this[_0x08ae('0x1e')]=0x0;this[_0x08ae('0x1f')]='unknown';this[_0x08ae('0x20')]=0x0;this[_0x08ae('0x21')]=_0x170eb4['openchannelCapacity']||0x0;this[_0x08ae('0x22')]=0x0;this[_0x08ae('0x23')]=![];this[_0x08ae('0x24')]=undefined;this['md5']='';this[_0x08ae('0x25')]();}Agent[_0x08ae('0x26')][_0x08ae('0x27')]=function(_0x481318){if(this[_0x481318+_0x08ae('0x28')]>0x0){if(this[_0x481318+_0x08ae('0x29')]>0x0&&this[_0x481318+_0x08ae('0x28')]>=this[_0x481318+_0x08ae('0x29')]){return _0x08ae('0x2a');}else{return _0x08ae('0x2b');}}else{return _0x08ae('0x2c');}};Agent[_0x08ae('0x26')][_0x08ae('0x25')]=function(){var _0xf841bf=[_0x08ae('0x2d'),_0x08ae('0x2e'),'openchannel',_0x08ae('0x2f'),_0x08ae('0x30'),_0x08ae('0x31')];for(var _0x308ba2=0x0;_0x308ba2<_0xf841bf[_0x08ae('0x32')];_0x308ba2+=0x1){var _0x17e877=this[_0x08ae('0x27')](_0xf841bf[_0x308ba2]);if(this[_0xf841bf[_0x308ba2]+_0x08ae('0x33')]!==_0x17e877){this[_0xf841bf[_0x308ba2]+_0x08ae('0x34')]=_[_0x08ae('0x35')](moment()['format']('x'));}this[_0xf841bf[_0x308ba2]+_0x08ae('0x33')]=_0x17e877;}var _0x186817={'id':this['id'],'name':this[_0x08ae('0x8')],'online':this[_0x08ae('0x9')],'voicePause':this['voicePause'],'chatPause':this[_0x08ae('0xb')],'mailPause':this[_0x08ae('0xc')],'smsPause':this['smsPause'],'faxPause':this[_0x08ae('0xd')],'openchannelPause':this[_0x08ae('0xe')],'chatStatus':this['chatStatus'],'chatStatusTime':this[_0x08ae('0x11')],'chatCapacity':this[_0x08ae('0x12')],'chatCurrentCapacity':this['chatCurrentCapacity'],'mailStatus':this[_0x08ae('0x36')],'mailStatusTime':this[_0x08ae('0x13')],'mailCapacity':this[_0x08ae('0x14')],'mailCurrentCapacity':this['mailCurrentCapacity'],'faxStatus':this[_0x08ae('0x15')],'faxStatusTime':this[_0x08ae('0x16')],'faxCapacity':this['faxCapacity'],'faxCurrentCapacity':this[_0x08ae('0x18')],'smsStatus':this[_0x08ae('0x19')],'smsStatusTime':this[_0x08ae('0x1a')],'smsCapacity':this[_0x08ae('0x1b')],'smsCurrentCapacity':this[_0x08ae('0x37')],'whatsappStatus':this['whatsappStatus'],'whatsappStatusTime':this[_0x08ae('0x1c')],'whatsappCapacity':this[_0x08ae('0x1d')],'whatsappCurrentCapacity':this[_0x08ae('0x1e')],'openchannelStatus':this[_0x08ae('0x1f')],'openchannelStatusTime':this[_0x08ae('0x20')],'openchannelCapacity':this[_0x08ae('0x21')],'openchannelCurrentCapacity':this[_0x08ae('0x22')],'busy':this[_0x08ae('0x23')],'busyQueue':this[_0x08ae('0x24')]};var _0xc01a69=md5(JSON[_0x08ae('0x38')](_0x186817));if(this[_0x08ae('0x2')]!==_0xc01a69){this[_0x08ae('0x2')]=_0xc01a69;io['emit']('user:save',_0x186817);}};module['exports']=Agent; \ No newline at end of file +var _0x52b0=['busyQueue','updateRealtime','prototype','getChannelStatus','CurrentCapacity','Capacity','working','idle','openchannel','fax','whatsapp','faxPause','faxStatusTime','smsStatusTime','smsCurrentCapacity','whatsappCurrentCapacity','stringify','user:save','lodash','moment','md5','../../../config/environment','redis','socket.io-emitter','name','online','voicePause','chatPause','mailPause','smsPause','openchannelPause','chatStatus','unknown','chatCapacity','chatCurrentCapacity','mailStatus','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxCapacity','faxCurrentCapacity','smsStatus','smsCapacity','whatsappStatus','whatsappStatusTime','whatsappCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy'];(function(_0x3220bb,_0x342a03){var _0x23415c=function(_0x56cc05){while(--_0x56cc05){_0x3220bb['push'](_0x3220bb['shift']());}};_0x23415c(++_0x342a03);}(_0x52b0,0x17e));var _0x052b=function(_0x6e595,_0x3eb6d9){_0x6e595=_0x6e595-0x0;var _0x4b6cda=_0x52b0[_0x6e595];return _0x4b6cda;};'use strict';var _=require(_0x052b('0x0'));var moment=require(_0x052b('0x1'));var md5=require(_0x052b('0x2'));var Redis=require('ioredis');var config=require(_0x052b('0x3'));config[_0x052b('0x4')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x052b('0x5'))(new Redis(config[_0x052b('0x4')]));function Agent(_0x429adc){this['id']=_0x429adc['id']||0x0;this[_0x052b('0x6')]=_0x429adc['name']||'';this[_0x052b('0x7')]=_0x429adc[_0x052b('0x7')]||!![];this[_0x052b('0x8')]=_0x429adc[_0x052b('0x8')]||![];this[_0x052b('0x9')]=_0x429adc['chatPause']||![];this['mailPause']=_0x429adc[_0x052b('0xa')]||![];this['faxPause']=_0x429adc['faxPause']||![];this[_0x052b('0xb')]=_0x429adc['smsPause']||![];this[_0x052b('0xc')]=_0x429adc['openchannelPause']||![];this[_0x052b('0xd')]=_0x052b('0xe');this['chatStatusTime']=0x0;this[_0x052b('0xf')]=_0x429adc[_0x052b('0xf')]||0x0;this[_0x052b('0x10')]=0x0;this[_0x052b('0x11')]=_0x052b('0xe');this[_0x052b('0x12')]=0x0;this[_0x052b('0x13')]=_0x429adc[_0x052b('0x13')]||0x0;this[_0x052b('0x14')]=0x0;this[_0x052b('0x15')]=_0x052b('0xe');this['faxStatusTime']=0x0;this[_0x052b('0x16')]=_0x429adc[_0x052b('0x16')]||0x0;this[_0x052b('0x17')]=0x0;this[_0x052b('0x18')]=_0x052b('0xe');this['smsStatusTime']=0x0;this['smsCapacity']=_0x429adc[_0x052b('0x19')]||0x0;this['smsCurrentCapacity']=0x0;this[_0x052b('0x1a')]=_0x052b('0xe');this[_0x052b('0x1b')]=0x0;this[_0x052b('0x1c')]=_0x429adc[_0x052b('0x1c')]||0x0;this['whatsappCurrentCapacity']=0x0;this[_0x052b('0x1d')]='unknown';this[_0x052b('0x1e')]=0x0;this[_0x052b('0x1f')]=_0x429adc[_0x052b('0x1f')]||0x0;this[_0x052b('0x20')]=0x0;this[_0x052b('0x21')]=![];this[_0x052b('0x22')]=undefined;this[_0x052b('0x2')]='';this[_0x052b('0x23')]();}Agent[_0x052b('0x24')][_0x052b('0x25')]=function(_0x54205b){if(this[_0x54205b+_0x052b('0x26')]>0x0){if(this[_0x54205b+_0x052b('0x27')]>0x0&&this[_0x54205b+_0x052b('0x26')]>=this[_0x54205b+_0x052b('0x27')]){return'maxcapacity';}else{return _0x052b('0x28');}}else{return _0x052b('0x29');}};Agent['prototype'][_0x052b('0x23')]=function(){var _0x4d6f7f=['mail','chat',_0x052b('0x2a'),_0x052b('0x2b'),'sms',_0x052b('0x2c')];for(var _0x3fef7b=0x0;_0x3fef7b<_0x4d6f7f['length'];_0x3fef7b+=0x1){var _0x32429f=this['getChannelStatus'](_0x4d6f7f[_0x3fef7b]);if(this[_0x4d6f7f[_0x3fef7b]+'Status']!==_0x32429f){this[_0x4d6f7f[_0x3fef7b]+'StatusTime']=_['toNumber'](moment()['format']('x'));}this[_0x4d6f7f[_0x3fef7b]+'Status']=_0x32429f;}var _0x3864eb={'id':this['id'],'name':this['name'],'online':this[_0x052b('0x7')],'voicePause':this[_0x052b('0x8')],'chatPause':this['chatPause'],'mailPause':this['mailPause'],'smsPause':this[_0x052b('0xb')],'faxPause':this[_0x052b('0x2d')],'openchannelPause':this[_0x052b('0xc')],'chatStatus':this['chatStatus'],'chatStatusTime':this['chatStatusTime'],'chatCapacity':this['chatCapacity'],'chatCurrentCapacity':this[_0x052b('0x10')],'mailStatus':this[_0x052b('0x11')],'mailStatusTime':this['mailStatusTime'],'mailCapacity':this[_0x052b('0x13')],'mailCurrentCapacity':this['mailCurrentCapacity'],'faxStatus':this[_0x052b('0x15')],'faxStatusTime':this[_0x052b('0x2e')],'faxCapacity':this[_0x052b('0x16')],'faxCurrentCapacity':this['faxCurrentCapacity'],'smsStatus':this[_0x052b('0x18')],'smsStatusTime':this[_0x052b('0x2f')],'smsCapacity':this[_0x052b('0x19')],'smsCurrentCapacity':this[_0x052b('0x30')],'whatsappStatus':this['whatsappStatus'],'whatsappStatusTime':this[_0x052b('0x1b')],'whatsappCapacity':this[_0x052b('0x1c')],'whatsappCurrentCapacity':this[_0x052b('0x31')],'openchannelStatus':this[_0x052b('0x1d')],'openchannelStatusTime':this['openchannelStatusTime'],'openchannelCapacity':this[_0x052b('0x1f')],'openchannelCurrentCapacity':this['openchannelCurrentCapacity'],'busy':this[_0x052b('0x21')],'busyQueue':this[_0x052b('0x22')]};var _0xdae06b=md5(JSON[_0x052b('0x32')](_0x3864eb));if(this[_0x052b('0x2')]!==_0xdae06b){this[_0x052b('0x2')]=_0xdae06b;io['emit'](_0x052b('0x33'),_0x3864eb);}};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 c4abe97..313b91a 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 _0x32df=['loggedIn','paused','length','online','chatPause','available','name','stringify','md5','format','chat:queue:%s','emit','chat_queue:save','exports','lodash','util','ioredis','../../../config/environment','defaults','redis','localhost','socket.io-emitter','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','prototype','map','_rr','updateRealtime'];(function(_0x33cb54,_0x276c23){var _0x479518=function(_0x50956f){while(--_0x50956f){_0x33cb54['push'](_0x33cb54['shift']());}};_0x479518(++_0x276c23);}(_0x32df,0x1bb));var _0xf32d=function(_0x5e75ec,_0x53402b){_0x5e75ec=_0x5e75ec-0x0;var _0x5977ba=_0x32df[_0x5e75ec];return _0x5977ba;};'use strict';var _=require(_0xf32d('0x0'));var md5=require('md5');var util=require(_0xf32d('0x1'));var Redis=require(_0xf32d('0x2'));var config=require(_0xf32d('0x3'));config['redis']=_[_0xf32d('0x4')](config[_0xf32d('0x5')],{'host':_0xf32d('0x6'),'port':0x18eb});var io=require(_0xf32d('0x7'))(new Redis(config[_0xf32d('0x5')]));function ChatQueue(_0x3655e3){this['id']=_0x3655e3['id']||0x0;this['name']=_0x3655e3['name']||'';this[_0xf32d('0x8')]=_0x3655e3[_0xf32d('0x8')]||0xa;this[_0xf32d('0x9')]=_0x3655e3[_0xf32d('0x9')]||_0xf32d('0xa');this[_0xf32d('0xb')]=_0x3655e3[_0xf32d('0xb')];this[_0xf32d('0xc')]={};this[_0xf32d('0xd')]=0x0;this['md5']='';this[_0xf32d('0xe')]();this['updateRealtime']();}ChatQueue[_0xf32d('0xf')][_0xf32d('0xe')]=function(){var _0x569037=this[_0xf32d('0xc')]['_rr'];this[_0xf32d('0xc')]=_[_0xf32d('0x10')](this[_0xf32d('0xb')],'id');this[_0xf32d('0xc')][_0xf32d('0x11')]=_0x569037;};ChatQueue[_0xf32d('0xf')][_0xf32d('0x12')]=function(){this[_0xf32d('0x13')]=0x0;this[_0xf32d('0x14')]=0x0;for(var _0x1a84c6=0x0;_0x1a84c6=0x0?this[_0xf32d('0x18')]:0x0;var _0x5ea1f2={'id':this['id'],'available':this['available'],'loggedIn':this[_0xf32d('0x13')],'name':this[_0xf32d('0x19')],'paused':this['paused'],'waiting':this[_0xf32d('0xd')]};var _0x4b7b06=md5(JSON[_0xf32d('0x1a')](_0x5ea1f2));if(this[_0xf32d('0x1b')]!==_0x4b7b06){this['md5']=_0x4b7b06;io['to'](util[_0xf32d('0x1c')](_0xf32d('0x1d'),_0x5ea1f2['name']))[_0xf32d('0x1e')](_0xf32d('0x1f'),_0x5ea1f2);}};module[_0xf32d('0x20')]=ChatQueue; \ No newline at end of file +var _0xd662=['chat_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','timeout','strategy','beepall','waiting','updateRouting','updateRealtime','prototype','mapAgentsId','_rr','Agents','loggedIn','online','available','paused','name','stringify','format','chat:queue:%s','emit'];(function(_0x455f66,_0x1f3529){var _0x13578c=function(_0x2a7d4e){while(--_0x2a7d4e){_0x455f66['push'](_0x455f66['shift']());}};_0x13578c(++_0x1f3529);}(_0xd662,0x93));var _0x2d66=function(_0x398f31,_0x2e7b98){_0x398f31=_0x398f31-0x0;var _0x38a6cd=_0xd662[_0x398f31];return _0x38a6cd;};'use strict';var _=require(_0x2d66('0x0'));var md5=require(_0x2d66('0x1'));var util=require(_0x2d66('0x2'));var Redis=require(_0x2d66('0x3'));var config=require(_0x2d66('0x4'));config[_0x2d66('0x5')]=_[_0x2d66('0x6')](config[_0x2d66('0x5')],{'host':_0x2d66('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function ChatQueue(_0x26d2b4){this['id']=_0x26d2b4['id']||0x0;this['name']=_0x26d2b4['name']||'';this[_0x2d66('0x8')]=_0x26d2b4[_0x2d66('0x8')]||0xa;this[_0x2d66('0x9')]=_0x26d2b4[_0x2d66('0x9')]||_0x2d66('0xa');this['Agents']=_0x26d2b4['Agents'];this['mapAgentsId']={};this[_0x2d66('0xb')]=0x0;this[_0x2d66('0x1')]='';this[_0x2d66('0xc')]();this[_0x2d66('0xd')]();}ChatQueue[_0x2d66('0xe')]['updateRouting']=function(){var _0x3296f3=this[_0x2d66('0xf')][_0x2d66('0x10')];this['mapAgentsId']=_['map'](this[_0x2d66('0x11')],'id');this[_0x2d66('0xf')]['_rr']=_0x3296f3;};ChatQueue[_0x2d66('0xe')][_0x2d66('0xd')]=function(){this[_0x2d66('0x12')]=0x0;this['paused']=0x0;for(var _0x4eb243=0x0;_0x4eb243=0x0?this['available']:0x0;var _0x13cde0={'id':this['id'],'available':this[_0x2d66('0x14')],'loggedIn':this[_0x2d66('0x12')],'name':this[_0x2d66('0x16')],'paused':this['paused'],'waiting':this[_0x2d66('0xb')]};var _0xe7b85a=md5(JSON[_0x2d66('0x17')](_0x13cde0));if(this['md5']!==_0xe7b85a){this[_0x2d66('0x1')]=_0xe7b85a;io['to'](util[_0x2d66('0x18')](_0x2d66('0x19'),_0x13cde0[_0x2d66('0x16')]))[_0x2d66('0x1a')](_0x2d66('0x1b'),_0x13cde0);}};module[_0x2d66('0x1c')]=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index 5d7873c..fb88d04 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 _0xf3d9=['stringify','fax:queue:%s','emit','lodash','md5','util','ioredis','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name','timeout','strategy','Agents','waiting','updateRealtime','prototype','updateRouting','mapAgentsId','_rr','length','online','loggedIn','faxPause','paused','available'];(function(_0xd73f26,_0x5ea8b1){var _0x4936b1=function(_0x3f03b2){while(--_0x3f03b2){_0xd73f26['push'](_0xd73f26['shift']());}};_0x4936b1(++_0x5ea8b1);}(_0xf3d9,0x8f));var _0x9f3d=function(_0x15e5d5,_0x495891){_0x15e5d5=_0x15e5d5-0x0;var _0x3d9e44=_0xf3d9[_0x15e5d5];return _0x3d9e44;};'use strict';var _=require(_0x9f3d('0x0'));var md5=require(_0x9f3d('0x1'));var util=require(_0x9f3d('0x2'));var Redis=require(_0x9f3d('0x3'));var config=require(_0x9f3d('0x4'));config['redis']=_[_0x9f3d('0x5')](config[_0x9f3d('0x6')],{'host':_0x9f3d('0x7'),'port':0x18eb});var io=require(_0x9f3d('0x8'))(new Redis(config[_0x9f3d('0x6')]));function FaxQueue(_0x57ea38){this['id']=_0x57ea38['id']||0x0;this[_0x9f3d('0x9')]=_0x57ea38[_0x9f3d('0x9')]||'';this[_0x9f3d('0xa')]=_0x57ea38[_0x9f3d('0xa')]||0xa;this[_0x9f3d('0xb')]=_0x57ea38[_0x9f3d('0xb')]||'beepall';this[_0x9f3d('0xc')]=_0x57ea38[_0x9f3d('0xc')];this['mapAgentsId']={};this[_0x9f3d('0xd')]=0x0;this[_0x9f3d('0x1')]='';this['updateRouting']();this[_0x9f3d('0xe')]();}FaxQueue[_0x9f3d('0xf')][_0x9f3d('0x10')]=function(){var _0x1d08bc=this[_0x9f3d('0x11')][_0x9f3d('0x12')];this[_0x9f3d('0x11')]=_['map'](this[_0x9f3d('0xc')],'id');this['mapAgentsId']['_rr']=_0x1d08bc;};FaxQueue[_0x9f3d('0xf')][_0x9f3d('0xe')]=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0x25a010=0x0;_0x25a010=0x0?this[_0x9f3d('0x18')]:0x0;var _0x3bac83={'id':this['id'],'available':this[_0x9f3d('0x18')],'loggedIn':this[_0x9f3d('0x15')],'name':this[_0x9f3d('0x9')],'paused':this['paused'],'waiting':this['waiting']};var _0x4ca3f8=md5(JSON[_0x9f3d('0x19')](_0x3bac83));if(this[_0x9f3d('0x1')]!==_0x4ca3f8){this['md5']=_0x4ca3f8;io['to'](util['format'](_0x9f3d('0x1a'),_0x3bac83[_0x9f3d('0x9')]))[_0x9f3d('0x1b')]('fax_queue:save',_0x3bac83);}};module['exports']=FaxQueue; \ No newline at end of file +var _0x49d2=['socket.io-emitter','name','timeout','strategy','beepall','mapAgentsId','waiting','updateRealtime','prototype','updateRouting','_rr','map','loggedIn','paused','Agents','length','online','faxPause','available','stringify','format','fax:queue:%s','emit','fax_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','defaults'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x49d2,0x99));var _0x249d=function(_0x45f111,_0x3a1a4a){_0x45f111=_0x45f111-0x0;var _0x483508=_0x49d2[_0x45f111];return _0x483508;};'use strict';var _=require(_0x249d('0x0'));var md5=require(_0x249d('0x1'));var util=require(_0x249d('0x2'));var Redis=require(_0x249d('0x3'));var config=require(_0x249d('0x4'));config[_0x249d('0x5')]=_[_0x249d('0x6')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x249d('0x7'))(new Redis(config[_0x249d('0x5')]));function FaxQueue(_0x1610e2){this['id']=_0x1610e2['id']||0x0;this[_0x249d('0x8')]=_0x1610e2[_0x249d('0x8')]||'';this['timeout']=_0x1610e2[_0x249d('0x9')]||0xa;this['strategy']=_0x1610e2[_0x249d('0xa')]||_0x249d('0xb');this['Agents']=_0x1610e2['Agents'];this[_0x249d('0xc')]={};this[_0x249d('0xd')]=0x0;this[_0x249d('0x1')]='';this['updateRouting']();this[_0x249d('0xe')]();}FaxQueue[_0x249d('0xf')][_0x249d('0x10')]=function(){var _0x33d55b=this[_0x249d('0xc')][_0x249d('0x11')];this[_0x249d('0xc')]=_[_0x249d('0x12')](this['Agents'],'id');this[_0x249d('0xc')][_0x249d('0x11')]=_0x33d55b;};FaxQueue[_0x249d('0xf')][_0x249d('0xe')]=function(){this[_0x249d('0x13')]=0x0;this[_0x249d('0x14')]=0x0;for(var _0x361de0=0x0;_0x361de0=0x0?this['available']:0x0;var _0x3f9997={'id':this['id'],'available':this[_0x249d('0x19')],'loggedIn':this[_0x249d('0x13')],'name':this[_0x249d('0x8')],'paused':this[_0x249d('0x14')],'waiting':this[_0x249d('0xd')]};var _0x31fa59=md5(JSON[_0x249d('0x1a')](_0x3f9997));if(this[_0x249d('0x1')]!==_0x31fa59){this['md5']=_0x31fa59;io['to'](util[_0x249d('0x1b')](_0x249d('0x1c'),_0x3f9997[_0x249d('0x8')]))[_0x249d('0x1d')](_0x249d('0x1e'),_0x3f9997);}};module[_0x249d('0x1f')]=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index bb97f62..770b1bc 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 _0x00e1=['exports','name','Intervals'];(function(_0x37ec07,_0x4d7bf5){var _0xbe29e2=function(_0x29457a){while(--_0x29457a){_0x37ec07['push'](_0x37ec07['shift']());}};_0xbe29e2(++_0x4d7bf5);}(_0x00e1,0xb8));var _0x100e=function(_0x213b61,_0x36d5c2){_0x213b61=_0x213b61-0x0;var _0x4f5550=_0x00e1[_0x213b61];return _0x4f5550;};'use strict';function Interval(_0x319151){this['id']=_0x319151['id']||0x0;this['name']=_0x319151[_0x100e('0x0')]||'';this[_0x100e('0x1')]=_0x319151[_0x100e('0x1')]||{};}module[_0x100e('0x2')]=Interval; \ No newline at end of file +var _0x1c31=['exports','name','Intervals'];(function(_0x49c5dd,_0x246ea5){var _0x14181e=function(_0x5c0a8d){while(--_0x5c0a8d){_0x49c5dd['push'](_0x49c5dd['shift']());}};_0x14181e(++_0x246ea5);}(_0x1c31,0x178));var _0x11c3=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x1c31[_0x19e35c];return _0x3e1fe8;};'use strict';function Interval(_0x16315f){this['id']=_0x16315f['id']||0x0;this[_0x11c3('0x0')]=_0x16315f['name']||'';this[_0x11c3('0x1')]=_0x16315f[_0x11c3('0x1')]||{};}module[_0x11c3('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 b2d4774..464e5c1 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 _0x57ca=['ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','map','paused','length','available','loggedIn','stringify','lodash','md5','util'];(function(_0x2c5efc,_0x3886ec){var _0x3ea6f3=function(_0x78d7d3){while(--_0x78d7d3){_0x2c5efc['push'](_0x2c5efc['shift']());}};_0x3ea6f3(++_0x3886ec);}(_0x57ca,0x1dd));var _0xa57c=function(_0xc1587c,_0x17dbd1){_0xc1587c=_0xc1587c-0x0;var _0x1a013d=_0x57ca[_0xc1587c];return _0x1a013d;};'use strict';var _=require(_0xa57c('0x0'));var md5=require(_0xa57c('0x1'));var util=require(_0xa57c('0x2'));var Redis=require(_0xa57c('0x3'));var config=require(_0xa57c('0x4'));config['redis']=_['defaults'](config[_0xa57c('0x5')],{'host':_0xa57c('0x6'),'port':0x18eb});var io=require(_0xa57c('0x7'))(new Redis(config[_0xa57c('0x5')]));function MailQueue(_0x37144b){this['id']=_0x37144b['id']||0x0;this[_0xa57c('0x8')]=_0x37144b[_0xa57c('0x8')]||'';this[_0xa57c('0x9')]=_0x37144b[_0xa57c('0x9')]||0xa;this[_0xa57c('0xa')]=_0x37144b[_0xa57c('0xa')]||_0xa57c('0xb');this[_0xa57c('0xc')]=_0x37144b[_0xa57c('0xc')];this[_0xa57c('0xd')]={};this[_0xa57c('0xe')]=0x0;this[_0xa57c('0x1')]='';this[_0xa57c('0xf')]();this[_0xa57c('0x10')]();}MailQueue[_0xa57c('0x11')][_0xa57c('0xf')]=function(){var _0x2134ea=this[_0xa57c('0xd')]['_rr'];this[_0xa57c('0xd')]=_[_0xa57c('0x12')](this[_0xa57c('0xc')],'id');this['mapAgentsId']['_rr']=_0x2134ea;};MailQueue['prototype'][_0xa57c('0x10')]=function(){this['loggedIn']=0x0;this[_0xa57c('0x13')]=0x0;for(var _0x150e89=0x0;_0x150e89=0x0?this[_0xa57c('0x15')]:0x0;var _0x387e31={'id':this['id'],'available':this[_0xa57c('0x15')],'loggedIn':this[_0xa57c('0x16')],'name':this['name'],'paused':this['paused'],'waiting':this[_0xa57c('0xe')]};var _0x4180d1=md5(JSON[_0xa57c('0x17')](_0x387e31));if(this[_0xa57c('0x1')]!==_0x4180d1){this['md5']=_0x4180d1;io['to'](util['format']('mail:queue:%s',_0x387e31['name']))['emit']('mail_queue:save',_0x387e31);}};module['exports']=MailQueue; \ No newline at end of file +var _0x7878=['updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','length','online','mailPause','available','format','mail:queue:%s','emit','exports','lodash','md5','util','ioredis','../../../config/environment','redis','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId'];(function(_0x2becd7,_0xe22fc0){var _0x6226be=function(_0x33dc68){while(--_0x33dc68){_0x2becd7['push'](_0x2becd7['shift']());}};_0x6226be(++_0xe22fc0);}(_0x7878,0x10b));var _0x8787=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7878[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x8787('0x0'));var md5=require(_0x8787('0x1'));var util=require(_0x8787('0x2'));var Redis=require(_0x8787('0x3'));var config=require(_0x8787('0x4'));config[_0x8787('0x5')]=_['defaults'](config[_0x8787('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x8787('0x6'))(new Redis(config[_0x8787('0x5')]));function MailQueue(_0x124217){this['id']=_0x124217['id']||0x0;this[_0x8787('0x7')]=_0x124217[_0x8787('0x7')]||'';this['timeout']=_0x124217[_0x8787('0x8')]||0xa;this[_0x8787('0x9')]=_0x124217[_0x8787('0x9')]||_0x8787('0xa');this[_0x8787('0xb')]=_0x124217[_0x8787('0xb')];this[_0x8787('0xc')]={};this['waiting']=0x0;this['md5']='';this[_0x8787('0xd')]();this[_0x8787('0xe')]();}MailQueue[_0x8787('0xf')][_0x8787('0xd')]=function(){var _0xad7bc6=this['mapAgentsId'][_0x8787('0x10')];this['mapAgentsId']=_[_0x8787('0x11')](this[_0x8787('0xb')],'id');this['mapAgentsId'][_0x8787('0x10')]=_0xad7bc6;};MailQueue[_0x8787('0xf')]['updateRealtime']=function(){this[_0x8787('0x12')]=0x0;this[_0x8787('0x13')]=0x0;for(var _0x39a7e1=0x0;_0x39a7e1=0x0?this[_0x8787('0x17')]:0x0;var _0x942a1a={'id':this['id'],'available':this['available'],'loggedIn':this[_0x8787('0x12')],'name':this[_0x8787('0x7')],'paused':this['paused'],'waiting':this['waiting']};var _0x548598=md5(JSON['stringify'](_0x942a1a));if(this['md5']!==_0x548598){this[_0x8787('0x1')]=_0x548598;io['to'](util[_0x8787('0x18')](_0x8787('0x19'),_0x942a1a[_0x8787('0x7')]))[_0x8787('0x1a')]('mail_queue:save',_0x942a1a);}};module[_0x8787('0x1b')]=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index cd58954..b7b1135 100644 --- a/server/services/routing/model/openchannelQueue.js +++ b/server/services/routing/model/openchannelQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xadb5=['../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','_rr','prototype','updateRealtime','paused','loggedIn','openchannelPause','available','stringify','format','openchannel:queue:%s','emit','md5','ioredis'];(function(_0x4a94d0,_0x374e5d){var _0x50128a=function(_0x595a2c){while(--_0x595a2c){_0x4a94d0['push'](_0x4a94d0['shift']());}};_0x50128a(++_0x374e5d);}(_0xadb5,0xad));var _0x5adb=function(_0x3f4e31,_0x5d66b2){_0x3f4e31=_0x3f4e31-0x0;var _0x3e2822=_0xadb5[_0x3f4e31];return _0x3e2822;};'use strict';var _=require('lodash');var md5=require(_0x5adb('0x0'));var util=require('util');var Redis=require(_0x5adb('0x1'));var config=require(_0x5adb('0x2'));config[_0x5adb('0x3')]=_['defaults'](config[_0x5adb('0x3')],{'host':_0x5adb('0x4'),'port':0x18eb});var io=require(_0x5adb('0x5'))(new Redis(config['redis']));function OpenchannelQueue(_0x35a5d3){this['id']=_0x35a5d3['id']||0x0;this[_0x5adb('0x6')]=_0x35a5d3[_0x5adb('0x6')]||'';this[_0x5adb('0x7')]=_0x35a5d3[_0x5adb('0x7')]||0xa;this[_0x5adb('0x8')]=_0x35a5d3[_0x5adb('0x8')]||_0x5adb('0x9');this[_0x5adb('0xa')]=_0x35a5d3[_0x5adb('0xa')];this[_0x5adb('0xb')]={};this[_0x5adb('0xc')]=0x0;this[_0x5adb('0x0')]='';this[_0x5adb('0xd')]();this['updateRealtime']();}OpenchannelQueue['prototype'][_0x5adb('0xd')]=function(){var _0x1ea238=this[_0x5adb('0xb')]['_rr'];this[_0x5adb('0xb')]=_['map'](this[_0x5adb('0xa')],'id');this['mapAgentsId'][_0x5adb('0xe')]=_0x1ea238;};OpenchannelQueue[_0x5adb('0xf')][_0x5adb('0x10')]=function(){this['loggedIn']=0x0;this[_0x5adb('0x11')]=0x0;for(var _0x34af2c=0x0;_0x34af2c=0x0?this['available']:0x0;var _0x3fff62={'id':this['id'],'available':this['available'],'loggedIn':this[_0x5adb('0x12')],'name':this['name'],'paused':this[_0x5adb('0x11')],'waiting':this['waiting']};var _0x5e218c=md5(JSON[_0x5adb('0x15')](_0x3fff62));if(this[_0x5adb('0x0')]!==_0x5e218c){this[_0x5adb('0x0')]=_0x5e218c;io['to'](util[_0x5adb('0x16')](_0x5adb('0x17'),_0x3fff62['name']))[_0x5adb('0x18')]('openchannel_queue:save',_0x3fff62);}};module['exports']=OpenchannelQueue; \ No newline at end of file +var _0x814b=['prototype','map','_rr','loggedIn','paused','length','online','openchannelPause','available','format','openchannel_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime'];(function(_0x24739e,_0x25c9d7){var _0x2e394d=function(_0x5a2e20){while(--_0x5a2e20){_0x24739e['push'](_0x24739e['shift']());}};_0x2e394d(++_0x25c9d7);}(_0x814b,0x1a2));var _0xb814=function(_0x5ef161,_0x27d16c){_0x5ef161=_0x5ef161-0x0;var _0x1c6e9e=_0x814b[_0x5ef161];return _0x1c6e9e;};'use strict';var _=require(_0xb814('0x0'));var md5=require(_0xb814('0x1'));var util=require(_0xb814('0x2'));var Redis=require(_0xb814('0x3'));var config=require(_0xb814('0x4'));config[_0xb814('0x5')]=_['defaults'](config[_0xb814('0x5')],{'host':_0xb814('0x6'),'port':0x18eb});var io=require(_0xb814('0x7'))(new Redis(config[_0xb814('0x5')]));function OpenchannelQueue(_0x44931c){this['id']=_0x44931c['id']||0x0;this[_0xb814('0x8')]=_0x44931c['name']||'';this[_0xb814('0x9')]=_0x44931c[_0xb814('0x9')]||0xa;this['strategy']=_0x44931c[_0xb814('0xa')]||_0xb814('0xb');this[_0xb814('0xc')]=_0x44931c[_0xb814('0xc')];this[_0xb814('0xd')]={};this[_0xb814('0xe')]=0x0;this[_0xb814('0x1')]='';this[_0xb814('0xf')]();this[_0xb814('0x10')]();}OpenchannelQueue[_0xb814('0x11')][_0xb814('0xf')]=function(){var _0x4b5f14=this[_0xb814('0xd')]['_rr'];this[_0xb814('0xd')]=_[_0xb814('0x12')](this[_0xb814('0xc')],'id');this[_0xb814('0xd')][_0xb814('0x13')]=_0x4b5f14;};OpenchannelQueue[_0xb814('0x11')][_0xb814('0x10')]=function(){this[_0xb814('0x14')]=0x0;this[_0xb814('0x15')]=0x0;for(var _0x2ab627=0x0;_0x2ab627=0x0?this['available']:0x0;var _0x270598={'id':this['id'],'available':this[_0xb814('0x19')],'loggedIn':this['loggedIn'],'name':this['name'],'paused':this['paused'],'waiting':this[_0xb814('0xe')]};var _0x4d5276=md5(JSON['stringify'](_0x270598));if(this[_0xb814('0x1')]!==_0x4d5276){this[_0xb814('0x1')]=_0x4d5276;io['to'](util[_0xb814('0x1a')]('openchannel:queue:%s',_0x270598[_0xb814('0x8')]))['emit'](_0xb814('0x1b'),_0x270598);}};module[_0xb814('0x1c')]=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index 582267c..46edf7a 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 _0xb205=['available','stringify','format','sms:queue:%s','emit','sms_queue:save','lodash','md5','util','ioredis','../../../config/environment','redis','socket.io-emitter','name','timeout','strategy','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','paused','length','loggedIn'];(function(_0x2ca616,_0x384ec8){var _0x53155f=function(_0x108627){while(--_0x108627){_0x2ca616['push'](_0x2ca616['shift']());}};_0x53155f(++_0x384ec8);}(_0xb205,0xf0));var _0x5b20=function(_0xf18eb2,_0x2ced71){_0xf18eb2=_0xf18eb2-0x0;var _0x31e8af=_0xb205[_0xf18eb2];return _0x31e8af;};'use strict';var _=require(_0x5b20('0x0'));var md5=require(_0x5b20('0x1'));var util=require(_0x5b20('0x2'));var Redis=require(_0x5b20('0x3'));var config=require(_0x5b20('0x4'));config['redis']=_['defaults'](config[_0x5b20('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x5b20('0x6'))(new Redis(config[_0x5b20('0x5')]));function SmsQueue(_0x5a4526){this['id']=_0x5a4526['id']||0x0;this[_0x5b20('0x7')]=_0x5a4526[_0x5b20('0x7')]||'';this[_0x5b20('0x8')]=_0x5a4526['timeout']||0xa;this[_0x5b20('0x9')]=_0x5a4526[_0x5b20('0x9')]||'beepall';this['Agents']=_0x5a4526[_0x5b20('0xa')];this[_0x5b20('0xb')]={};this[_0x5b20('0xc')]=0x0;this[_0x5b20('0x1')]='';this[_0x5b20('0xd')]();this[_0x5b20('0xe')]();}SmsQueue[_0x5b20('0xf')]['updateRouting']=function(){var _0xdec7cd=this[_0x5b20('0xb')][_0x5b20('0x10')];this['mapAgentsId']=_['map'](this[_0x5b20('0xa')],'id');this[_0x5b20('0xb')][_0x5b20('0x10')]=_0xdec7cd;};SmsQueue[_0x5b20('0xf')][_0x5b20('0xe')]=function(){this['loggedIn']=0x0;this[_0x5b20('0x11')]=0x0;for(var _0x32c2df=0x0;_0x32c2df=0x0?this[_0x5b20('0x14')]:0x0;var _0x301c9a={'id':this['id'],'available':this[_0x5b20('0x14')],'loggedIn':this[_0x5b20('0x13')],'name':this['name'],'paused':this[_0x5b20('0x11')],'waiting':this['waiting']};var _0x1a75d7=md5(JSON[_0x5b20('0x15')](_0x301c9a));if(this['md5']!==_0x1a75d7){this[_0x5b20('0x1')]=_0x1a75d7;io['to'](util[_0x5b20('0x16')](_0x5b20('0x17'),_0x301c9a['name']))[_0x5b20('0x18')](_0x5b20('0x19'),_0x301c9a);}};module['exports']=SmsQueue; \ No newline at end of file +var _0x644a=['exports','lodash','md5','util','ioredis','../../../config/environment','defaults','redis','name','timeout','strategy','beepall','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','Agents','loggedIn','paused','length','available','stringify','format','sms:queue:%s','sms_queue:save'];(function(_0x24c135,_0xdb4450){var _0x290c66=function(_0x537cf8){while(--_0x537cf8){_0x24c135['push'](_0x24c135['shift']());}};_0x290c66(++_0xdb4450);}(_0x644a,0xfd));var _0xa644=function(_0x53e297,_0x53189b){_0x53e297=_0x53e297-0x0;var _0x4380ff=_0x644a[_0x53e297];return _0x4380ff;};'use strict';var _=require(_0xa644('0x0'));var md5=require(_0xa644('0x1'));var util=require(_0xa644('0x2'));var Redis=require(_0xa644('0x3'));var config=require(_0xa644('0x4'));config['redis']=_[_0xa644('0x5')](config[_0xa644('0x6')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xa644('0x6')]));function SmsQueue(_0x40a46b){this['id']=_0x40a46b['id']||0x0;this[_0xa644('0x7')]=_0x40a46b['name']||'';this[_0xa644('0x8')]=_0x40a46b[_0xa644('0x8')]||0xa;this['strategy']=_0x40a46b[_0xa644('0x9')]||_0xa644('0xa');this['Agents']=_0x40a46b['Agents'];this[_0xa644('0xb')]={};this[_0xa644('0xc')]=0x0;this['md5']='';this[_0xa644('0xd')]();this[_0xa644('0xe')]();}SmsQueue[_0xa644('0xf')][_0xa644('0xd')]=function(){var _0x1b8510=this['mapAgentsId'][_0xa644('0x10')];this[_0xa644('0xb')]=_[_0xa644('0x11')](this[_0xa644('0x12')],'id');this[_0xa644('0xb')][_0xa644('0x10')]=_0x1b8510;};SmsQueue['prototype'][_0xa644('0xe')]=function(){this[_0xa644('0x13')]=0x0;this[_0xa644('0x14')]=0x0;for(var _0x10783c=0x0;_0x10783c=0x0?this[_0xa644('0x16')]:0x0;var _0x6fb957={'id':this['id'],'available':this[_0xa644('0x16')],'loggedIn':this[_0xa644('0x13')],'name':this[_0xa644('0x7')],'paused':this[_0xa644('0x14')],'waiting':this[_0xa644('0xc')]};var _0x27ca70=md5(JSON[_0xa644('0x17')](_0x6fb957));if(this[_0xa644('0x1')]!==_0x27ca70){this['md5']=_0x27ca70;io['to'](util[_0xa644('0x18')](_0xa644('0x19'),_0x6fb957[_0xa644('0x7')]))['emit'](_0xa644('0x1a'),_0x6fb957);}};module[_0xa644('0x1b')]=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/model/whatsappQueue.js b/server/services/routing/model/whatsappQueue.js index 7e9cb53..a52a75b 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 _0xfc2d=['util','ioredis','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','length','online','available','stringify','format','whatsapp:queue:%s','emit','whatsapp_queue:save','exports','lodash','md5'];(function(_0x2a2f52,_0x37a983){var _0x1e1816=function(_0x35d531){while(--_0x35d531){_0x2a2f52['push'](_0x2a2f52['shift']());}};_0x1e1816(++_0x37a983);}(_0xfc2d,0x1b0));var _0xdfc2=function(_0x30bd4d,_0x50eb60){_0x30bd4d=_0x30bd4d-0x0;var _0x306915=_0xfc2d[_0x30bd4d];return _0x306915;};'use strict';var _=require(_0xdfc2('0x0'));var md5=require(_0xdfc2('0x1'));var util=require(_0xdfc2('0x2'));var Redis=require(_0xdfc2('0x3'));var config=require('../../../config/environment');config[_0xdfc2('0x4')]=_[_0xdfc2('0x5')](config[_0xdfc2('0x4')],{'host':_0xdfc2('0x6'),'port':0x18eb});var io=require(_0xdfc2('0x7'))(new Redis(config['redis']));function WhatsappQueue(_0x57ef5e){this['id']=_0x57ef5e['id']||0x0;this[_0xdfc2('0x8')]=_0x57ef5e[_0xdfc2('0x8')]||'';this['timeout']=_0x57ef5e[_0xdfc2('0x9')]||0xa;this[_0xdfc2('0xa')]=_0x57ef5e['strategy']||_0xdfc2('0xb');this[_0xdfc2('0xc')]=_0x57ef5e['Agents'];this[_0xdfc2('0xd')]={};this[_0xdfc2('0xe')]=0x0;this[_0xdfc2('0x1')]='';this[_0xdfc2('0xf')]();this[_0xdfc2('0x10')]();}WhatsappQueue[_0xdfc2('0x11')]['updateRouting']=function(){var _0x4694d5=this[_0xdfc2('0xd')][_0xdfc2('0x12')];this[_0xdfc2('0xd')]=_[_0xdfc2('0x13')](this['Agents'],'id');this[_0xdfc2('0xd')][_0xdfc2('0x12')]=_0x4694d5;};WhatsappQueue[_0xdfc2('0x11')][_0xdfc2('0x10')]=function(){this[_0xdfc2('0x14')]=0x0;this[_0xdfc2('0x15')]=0x0;for(var _0x274ce2=0x0;_0x274ce2=0x0?this[_0xdfc2('0x18')]:0x0;var _0x4e76b6={'id':this['id'],'available':this['available'],'loggedIn':this[_0xdfc2('0x14')],'name':this[_0xdfc2('0x8')],'paused':this[_0xdfc2('0x15')],'waiting':this['waiting']};var _0x447e25=md5(JSON[_0xdfc2('0x19')](_0x4e76b6));if(this['md5']!==_0x447e25){this[_0xdfc2('0x1')]=_0x447e25;io['to'](util[_0xdfc2('0x1a')](_0xdfc2('0x1b'),_0x4e76b6['name']))[_0xdfc2('0x1c')](_0xdfc2('0x1d'),_0x4e76b6);}};module[_0xdfc2('0x1e')]=WhatsappQueue; \ No newline at end of file +var _0x330f=['strategy','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','available','stringify','format','whatsapp:queue:%s','whatsapp_queue:save','exports','lodash','md5','util','ioredis','../../../config/environment','redis','name'];(function(_0x3df71c,_0x1b67c7){var _0x2f2c7d=function(_0x126262){while(--_0x126262){_0x3df71c['push'](_0x3df71c['shift']());}};_0x2f2c7d(++_0x1b67c7);}(_0x330f,0x101));var _0xf330=function(_0x309458,_0xba6e63){_0x309458=_0x309458-0x0;var _0x3306ee=_0x330f[_0x309458];return _0x3306ee;};'use strict';var _=require(_0xf330('0x0'));var md5=require(_0xf330('0x1'));var util=require(_0xf330('0x2'));var Redis=require(_0xf330('0x3'));var config=require(_0xf330('0x4'));config[_0xf330('0x5')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function WhatsappQueue(_0x27f5e3){this['id']=_0x27f5e3['id']||0x0;this[_0xf330('0x6')]=_0x27f5e3['name']||'';this['timeout']=_0x27f5e3['timeout']||0xa;this[_0xf330('0x7')]=_0x27f5e3[_0xf330('0x7')]||'beepall';this[_0xf330('0x8')]=_0x27f5e3[_0xf330('0x8')];this[_0xf330('0x9')]={};this[_0xf330('0xa')]=0x0;this[_0xf330('0x1')]='';this[_0xf330('0xb')]();this[_0xf330('0xc')]();}WhatsappQueue[_0xf330('0xd')][_0xf330('0xb')]=function(){var _0x18a671=this[_0xf330('0x9')][_0xf330('0xe')];this[_0xf330('0x9')]=_[_0xf330('0xf')](this[_0xf330('0x8')],'id');this[_0xf330('0x9')][_0xf330('0xe')]=_0x18a671;};WhatsappQueue[_0xf330('0xd')]['updateRealtime']=function(){this[_0xf330('0x10')]=0x0;this[_0xf330('0x11')]=0x0;for(var _0x124d92=0x0;_0x124d92=0x0?this[_0xf330('0x12')]:0x0;var _0x5109f9={'id':this['id'],'available':this[_0xf330('0x12')],'loggedIn':this[_0xf330('0x10')],'name':this[_0xf330('0x6')],'paused':this[_0xf330('0x11')],'waiting':this[_0xf330('0xa')]};var _0xe7c4e0=md5(JSON[_0xf330('0x13')](_0x5109f9));if(this['md5']!==_0xe7c4e0){this['md5']=_0xe7c4e0;io['to'](util[_0xf330('0x14')](_0xf330('0x15'),_0x5109f9[_0xf330('0x6')]))['emit'](_0xf330('0x16'),_0x5109f9);}};module[_0xf330('0x17')]=WhatsappQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index 46f12ec..2f1f068 100644 --- a/server/services/routing/realtime/index.js +++ b/server/services/routing/realtime/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['isUndefined','initIntervals','updateRealtime','updateRouting','initSmsQueues','smsQueues','initMailQueues','mailQueues','initWhatsappQueues','whatsappQueues','exports','bluebird','util','lodash','../model/interval','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','chatQueues','faxQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0xa9e0[_0x5037ab];return _0x512adb;};'use strict';var BPromise=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var _=require(_0x0a9e('0x2'));var moment=require('moment');var Agent=require('../model/agent');var Interval=require(_0x0a9e('0x3'));var OpenchannelQueue=require('../model/openchannelQueue');var ChatQueue=require(_0x0a9e('0x4'));var SmsQueue=require(_0x0a9e('0x5'));var MailQueue=require(_0x0a9e('0x6'));var FaxQueue=require(_0x0a9e('0x7'));var WhatsappQueue=require(_0x0a9e('0x8'));var Realtime=function(){this['agents']={};this[_0x0a9e('0x9')]={};this[_0x0a9e('0xa')]={};this[_0x0a9e('0xb')]={};this['smsQueues']={};this['mailQueues']={};this[_0x0a9e('0xc')]={};this['whatsappQueues']={};this['chatQueuesWaitingInteractions']={};this[_0x0a9e('0xd')]={};this[_0x0a9e('0xe')]={};this[_0x0a9e('0xf')]={};this[_0x0a9e('0x10')]={};this[_0x0a9e('0x11')]={};};function freeIsNotKey(_0xbd1168,_0x4a4c56,_0x50dfb2){var _0x527cdd=_['mapKeys'](_0xbd1168,function(_0x273d4d,_0x36471c){return _0x273d4d[_0x50dfb2];});for(var _0xd5b662 in _0x4a4c56){if(_0x4a4c56[_0x0a9e('0x12')](_0xd5b662)){if(!_0x527cdd[_0xd5b662]){delete _0x4a4c56[_0xd5b662];}}}}Realtime[_0x0a9e('0x13')][_0x0a9e('0x14')]=function(_0x5db4b0,_0x4283ce){for(var _0x239b12 in _0x4283ce){if(_0x5db4b0[_0x0a9e('0x12')](_0x239b12)){_0x5db4b0[_0x239b12]=_0x4283ce[_0x239b12];}}};Realtime[_0x0a9e('0x13')][_0x0a9e('0x15')]=function(){var _0x4d5611=this;return function(_0x52a03d){if(_0x52a03d){freeIsNotKey(_0x52a03d,_0x4d5611[_0x0a9e('0x16')],'id');for(var _0x5d0880=0x0,_0x1985b6={},_0x519dfd={};_0x5d0880<_0x52a03d[_0x0a9e('0x17')];_0x5d0880+=0x1){_0x1985b6=_0x52a03d[_0x5d0880];if(_[_0x0a9e('0x18')](_0x4d5611['agents'][_0x1985b6['id']])){_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']]=new Agent(_0x1985b6);}else{_0x4d5611['mergeFromDatabase'](_0x4d5611[_0x0a9e('0x16')][_0x1985b6['id']],_0x1985b6);}}}return _0x4d5611[_0x0a9e('0x16')];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x19')]=function(){var _0x31b1ca=this;return function(_0x2eb11f){if(_0x2eb11f){freeIsNotKey(_0x2eb11f,_0x31b1ca[_0x0a9e('0x9')],'id');for(var _0x20559e=0x0,_0x1314ae={},_0x112016={};_0x20559e<_0x2eb11f[_0x0a9e('0x17')];_0x20559e+=0x1){_0x1314ae=_0x2eb11f[_0x20559e];if(_[_0x0a9e('0x18')](_0x31b1ca['intervals'][_0x1314ae['id']])){_0x31b1ca[_0x0a9e('0x9')][_0x1314ae['id']]=new Interval(_0x1314ae);}else{_0x31b1ca[_0x0a9e('0x14')](_0x31b1ca['intervals'][_0x1314ae['id']],_0x1314ae);}}}return _0x31b1ca[_0x0a9e('0x9')];};};Realtime['prototype']['initOpenchannelQueues']=function(){var _0x3a02e1=this;return function(_0x432e56){if(_0x432e56){freeIsNotKey(_0x432e56,_0x3a02e1[_0x0a9e('0xa')],'id');for(var _0x30bae6=0x0,_0x4abc77={},_0xfb6e48={};_0x30bae6<_0x432e56[_0x0a9e('0x17')];_0x30bae6+=0x1){_0x4abc77=_0x432e56[_0x30bae6];if(_[_0x0a9e('0x18')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']])){_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']]=new OpenchannelQueue(_0x4abc77);}else{_0x3a02e1[_0x0a9e('0x14')](_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']],_0x4abc77);}_0x3a02e1['openchannelQueues'][_0x4abc77['id']]['updateRouting']();_0x3a02e1[_0x0a9e('0xa')][_0x4abc77['id']][_0x0a9e('0x1a')]();}}return _0x3a02e1[_0x0a9e('0xa')];};};Realtime[_0x0a9e('0x13')]['initChatQueues']=function(){var _0x384319=this;return function(_0x479bc4){if(_0x479bc4){freeIsNotKey(_0x479bc4,_0x384319[_0x0a9e('0xb')],'id');for(var _0x5bfb33=0x0,_0x1dc186={},_0x34dc65={};_0x5bfb33<_0x479bc4[_0x0a9e('0x17')];_0x5bfb33+=0x1){_0x1dc186=_0x479bc4[_0x5bfb33];if(_[_0x0a9e('0x18')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']])){_0x384319[_0x0a9e('0xb')][_0x1dc186['id']]=new ChatQueue(_0x1dc186);}else{_0x384319[_0x0a9e('0x14')](_0x384319[_0x0a9e('0xb')][_0x1dc186['id']],_0x1dc186);}_0x384319['chatQueues'][_0x1dc186['id']][_0x0a9e('0x1b')]();_0x384319[_0x0a9e('0xb')][_0x1dc186['id']][_0x0a9e('0x1a')]();}}return _0x384319[_0x0a9e('0xb')];};};Realtime['prototype'][_0x0a9e('0x1c')]=function(){var _0x40e7a3=this;return function(_0x1843b2){if(_0x1843b2){freeIsNotKey(_0x1843b2,_0x40e7a3[_0x0a9e('0x1d')],'id');for(var _0x58b06f=0x0,_0x563b45={},_0x296f41={};_0x58b06f<_0x1843b2[_0x0a9e('0x17')];_0x58b06f+=0x1){_0x563b45=_0x1843b2[_0x58b06f];if(_[_0x0a9e('0x18')](_0x40e7a3['smsQueues'][_0x563b45['id']])){_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']]=new SmsQueue(_0x563b45);}else{_0x40e7a3['mergeFromDatabase'](_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']],_0x563b45);}_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1b')]();_0x40e7a3[_0x0a9e('0x1d')][_0x563b45['id']][_0x0a9e('0x1a')]();}}return _0x40e7a3['smsQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x1e')]=function(){var _0x40cb85=this;return function(_0x2da5c0){if(_0x2da5c0){freeIsNotKey(_0x2da5c0,_0x40cb85[_0x0a9e('0x1f')],'id');for(var _0x409319=0x0,_0x332d35={},_0x39e565={};_0x409319<_0x2da5c0['length'];_0x409319+=0x1){_0x332d35=_0x2da5c0[_0x409319];if(_[_0x0a9e('0x18')](_0x40cb85['mailQueues'][_0x332d35['id']])){_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]=new MailQueue(_0x332d35);}else{_0x40cb85[_0x0a9e('0x14')](_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']],_0x332d35);}_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']]['updateRouting']();_0x40cb85[_0x0a9e('0x1f')][_0x332d35['id']][_0x0a9e('0x1a')]();}}return _0x40cb85[_0x0a9e('0x1f')];};};Realtime[_0x0a9e('0x13')]['initFaxQueues']=function(){var _0x54135e=this;return function(_0x1e8694){if(_0x1e8694){freeIsNotKey(_0x1e8694,_0x54135e['faxQueues'],'id');for(var _0x24936a=0x0,_0x3d9717={},_0x381c37={};_0x24936a<_0x1e8694[_0x0a9e('0x17')];_0x24936a+=0x1){_0x3d9717=_0x1e8694[_0x24936a];if(_['isUndefined'](_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']])){_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]=new FaxQueue(_0x3d9717);}else{_0x54135e[_0x0a9e('0x14')](_0x54135e['faxQueues'][_0x3d9717['id']],_0x3d9717);}_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']][_0x0a9e('0x1b')]();_0x54135e[_0x0a9e('0xc')][_0x3d9717['id']]['updateRealtime']();}}return _0x54135e['faxQueues'];};};Realtime[_0x0a9e('0x13')][_0x0a9e('0x20')]=function(){var _0x5adda1=this;return function(_0x2b814e){if(_0x2b814e){freeIsNotKey(_0x2b814e,_0x5adda1[_0x0a9e('0x21')],'id');for(var _0x2e1b3a=0x0,_0x148f55={},_0x4b38d9={};_0x2e1b3a<_0x2b814e['length'];_0x2e1b3a+=0x1){_0x148f55=_0x2b814e[_0x2e1b3a];if(_[_0x0a9e('0x18')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']])){_0x5adda1['whatsappQueues'][_0x148f55['id']]=new WhatsappQueue(_0x148f55);}else{_0x5adda1[_0x0a9e('0x14')](_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']],_0x148f55);}_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']]['updateRouting']();_0x5adda1[_0x0a9e('0x21')][_0x148f55['id']][_0x0a9e('0x1a')]();}}return _0x5adda1[_0x0a9e('0x21')];};};module[_0x0a9e('0x22')]=Realtime; \ No newline at end of file +var _0xa9e0=['isUndefined','initIntervals','updateRealtime','updateRouting','initSmsQueues','smsQueues','initMailQueues','mailQueues','initWhatsappQueues','whatsappQueues','exports','bluebird','util','lodash','../model/interval','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','../model/whatsappQueue','intervals','openchannelQueues','chatQueues','faxQueues','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','hasOwnProperty','prototype','mergeFromDatabase','initAgents','agents','length'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0xa9e0[_0x5783f4];return _0x28e380;};'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 53004cd..a89214e 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 _0x7144=['update','Request','UpdateChatInteraction','AddTagsToChatInteraction','addTagsToChatInteraction'];(function(_0x1c638c,_0x5eba63){var _0x170b1d=function(_0x4066c9){while(--_0x4066c9){_0x1c638c['push'](_0x1c638c['shift']());}};_0x170b1d(++_0x5eba63);}(_0x7144,0x6e));var _0x4714=function(_0x159552,_0x5195eb){_0x159552=_0x159552-0x0;var _0x2132bf=_0x7144[_0x159552];return _0x2132bf;};'use strict';var client=require('../client');exports[_0x4714('0x0')]=function(_0x22f996,_0x469554){return client[_0x4714('0x1')](_0x4714('0x2'),{'body':_0x469554,'options':{'where':{'id':_0x22f996}},'log':'updateChatInteraction'});};exports['addTags']=function(_0x30f99b,_0x2cde09){return client[_0x4714('0x1')](_0x4714('0x3'),{'body':_0x2cde09,'options':{'where':{'id':_0x30f99b}},'log':_0x4714('0x4')});}; \ No newline at end of file +var _0xeb73=['addTags','Request','AddTagsToChatInteraction','addTagsToChatInteraction','../client','update','UpdateChatInteraction'];(function(_0xeb3eaa,_0x4aa790){var _0x586cf2=function(_0x3552f6){while(--_0x3552f6){_0xeb3eaa['push'](_0xeb3eaa['shift']());}};_0x586cf2(++_0x4aa790);}(_0xeb73,0x6d));var _0x3eb7=function(_0x292c39,_0x46338b){_0x292c39=_0x292c39-0x0;var _0x56859d=_0xeb73[_0x292c39];return _0x56859d;};'use strict';var client=require(_0x3eb7('0x0'));exports[_0x3eb7('0x1')]=function(_0x59fdb7,_0x159502){return client['Request'](_0x3eb7('0x2'),{'body':_0x159502,'options':{'where':{'id':_0x59fdb7}},'log':'updateChatInteraction'});};exports[_0x3eb7('0x3')]=function(_0x4f2a46,_0x251f50){return client[_0x3eb7('0x4')](_0x3eb7('0x5'),{'body':_0x251f50,'options':{'where':{'id':_0x4f2a46}},'log':_0x3eb7('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index 0f0564e..e0b8ba0 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 _0x84a7=['CreateChatMessage','createChatMessage','create','Request'];(function(_0x461c6e,_0x2800ab){var _0xdbeb1a=function(_0x366172){while(--_0x366172){_0x461c6e['push'](_0x461c6e['shift']());}};_0xdbeb1a(++_0x2800ab);}(_0x84a7,0x172));var _0x784a=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x84a7[_0x2641f9];return _0x585741;};'use strict';var client=require('../client');exports[_0x784a('0x0')]=function(_0x5335e9){return client[_0x784a('0x1')](_0x784a('0x2'),{'body':_0x5335e9,'log':_0x784a('0x3')});}; \ No newline at end of file +var _0xe75d=['Request','create'];(function(_0x5b86e6,_0x47cf12){var _0x642515=function(_0x7fb12f){while(--_0x7fb12f){_0x5b86e6['push'](_0x5b86e6['shift']());}};_0x642515(++_0x47cf12);}(_0xe75d,0x17b));var _0xde75=function(_0x92eb6,_0x2c450a){_0x92eb6=_0x92eb6-0x0;var _0x19bf1d=_0xe75d[_0x92eb6];return _0x19bf1d;};'use strict';var client=require('../client');exports[_0xde75('0x0')]=function(_0x5b0978){return client[_0xde75('0x1')]('CreateChatMessage',{'body':_0x5b0978,'log':'createChatMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index c134ca8..0ee0744 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 _0x5b7f=['GetChatQueue','name','timeout','strategy','User','Agents','online','chatPause','../client','getChatQueues','Request'];(function(_0x35e92e,_0x21581b){var _0x1205a8=function(_0x4325d8){while(--_0x4325d8){_0x35e92e['push'](_0x35e92e['shift']());}};_0x1205a8(++_0x21581b);}(_0x5b7f,0x8c));var _0xf5b7=function(_0x544577,_0x246538){_0x544577=_0x544577-0x0;var _0x5593fd=_0x5b7f[_0x544577];return _0x5593fd;};'use strict';var client=require(_0xf5b7('0x0'));exports[_0xf5b7('0x1')]=function(){return function(){return client[_0xf5b7('0x2')](_0xf5b7('0x3'),{'options':{'raw':![],'attributes':['id',_0xf5b7('0x4'),_0xf5b7('0x5'),_0xf5b7('0x6')],'include':[{'model':_0xf5b7('0x7'),'as':_0xf5b7('0x8'),'attributes':['id',_0xf5b7('0x4'),_0xf5b7('0x9'),_0xf5b7('0xa')]}]},'log':_0xf5b7('0x1')});};}; \ No newline at end of file +var _0x98d5=['GetChatQueue','name','timeout','strategy','User','Agents','online','getChatQueues','../client'];(function(_0x5c2e3e,_0x26ecd3){var _0x53f64a=function(_0x2b5df8){while(--_0x2b5df8){_0x5c2e3e['push'](_0x5c2e3e['shift']());}};_0x53f64a(++_0x26ecd3);}(_0x98d5,0xfb));var _0x598d=function(_0x2140b5,_0x336543){_0x2140b5=_0x2140b5-0x0;var _0x2d6b60=_0x98d5[_0x2140b5];return _0x2d6b60;};'use strict';var client=require(_0x598d('0x0'));exports['getChatQueues']=function(){return function(){return client['Request'](_0x598d('0x1'),{'options':{'raw':![],'attributes':['id',_0x598d('0x2'),_0x598d('0x3'),_0x598d('0x4')],'include':[{'model':_0x598d('0x5'),'as':_0x598d('0x6'),'attributes':['id',_0x598d('0x2'),_0x598d('0x7'),'chatPause']}]},'log':_0x598d('0x8')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index 2c77379..3b86bde 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 _0xc79f=['CreateChatQueueReport','update','UpdateChatQueueReport','DESC','../client','create','Request'];(function(_0x54b04a,_0x4b8613){var _0x4bb9f8=function(_0x3b7fc9){while(--_0x3b7fc9){_0x54b04a['push'](_0x54b04a['shift']());}};_0x4bb9f8(++_0x4b8613);}(_0xc79f,0x82));var _0xfc79=function(_0x41e046,_0x33aa5){_0x41e046=_0x41e046-0x0;var _0x556b4d=_0xc79f[_0x41e046];return _0x556b4d;};'use strict';var client=require(_0xfc79('0x0'));exports[_0xfc79('0x1')]=function(_0x10d1ee){return client[_0xfc79('0x2')](_0xfc79('0x3'),{'body':_0x10d1ee,'log':'CreateChatQueueReport'});};exports[_0xfc79('0x4')]=function(_0x31cbc0,_0xa5d8da){return client[_0xfc79('0x2')](_0xfc79('0x5'),{'body':_0xa5d8da,'options':{'where':{'uniqueid':_0x31cbc0},'order':[['id',_0xfc79('0x6')]],'limit':0x1},'log':_0xfc79('0x5')});}; \ No newline at end of file +var _0x9491=['update','DESC','../client','create','Request','CreateChatQueueReport'];(function(_0x59aebc,_0x179774){var _0x1417e6=function(_0xec9419){while(--_0xec9419){_0x59aebc['push'](_0x59aebc['shift']());}};_0x1417e6(++_0x179774);}(_0x9491,0xb6));var _0x1949=function(_0x191a8b,_0x336a4a){_0x191a8b=_0x191a8b-0x0;var _0x1366db=_0x9491[_0x191a8b];return _0x1366db;};'use strict';var client=require(_0x1949('0x0'));exports[_0x1949('0x1')]=function(_0x778256){return client[_0x1949('0x2')](_0x1949('0x3'),{'body':_0x778256,'log':_0x1949('0x3')});};exports[_0x1949('0x4')]=function(_0x39082e,_0x4270d7){return client[_0x1949('0x2')]('UpdateChatQueueReport',{'body':_0x4270d7,'options':{'where':{'uniqueid':_0x39082e},'order':[['id',_0x1949('0x5')]],'limit':0x1},'log':'UpdateChatQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index 49fb677..5f12122 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(_0x54b062,_0x264bb5){var _0x255e41=function(_0x3c7e6f){while(--_0x3c7e6f){_0x54b062['push'](_0x54b062['shift']());}};_0x255e41(++_0x264bb5);}(_0x7a54,0x106));var _0x47a5=function(_0x316890,_0x109169){_0x316890=_0x316890-0x0;var _0x2a15ec=_0x7a54[_0x316890];return _0x2a15ec;};'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(_0xc6be3a,_0x540e05){var _0x56a310=function(_0x50a144){while(--_0x50a144){_0xc6be3a['push'](_0xc6be3a['shift']());}};_0x56a310(++_0x540e05);}(_0x7a54,0x106));var _0x47a5=function(_0x246595,_0xb0743a){_0x246595=_0x246595-0x0;var _0xe08bc1=_0x7a54[_0x246595];return _0xe08bc1;};'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 ad79d2c..cab23f8 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 _0x9edf=['CreateFaxMessage','createFaxMessage','../client','create','Request'];(function(_0x550859,_0x2973c4){var _0x322aaf=function(_0x5ca88f){while(--_0x5ca88f){_0x550859['push'](_0x550859['shift']());}};_0x322aaf(++_0x2973c4);}(_0x9edf,0x10b));var _0xf9ed=function(_0x99a113,_0x92ccf9){_0x99a113=_0x99a113-0x0;var _0x1b1390=_0x9edf[_0x99a113];return _0x1b1390;};'use strict';var client=require(_0xf9ed('0x0'));exports[_0xf9ed('0x1')]=function(_0x26dc24){return client[_0xf9ed('0x2')](_0xf9ed('0x3'),{'body':_0x26dc24,'log':_0xf9ed('0x4')});}; \ No newline at end of file +var _0xfbb2=['createFaxMessage','../client'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfbb2,0xa1));var _0x2fbb=function(_0x589ac8,_0x10ac6e){_0x589ac8=_0x589ac8-0x0;var _0x1bb5dc=_0xfbb2[_0x589ac8];return _0x1bb5dc;};'use strict';var client=require(_0x2fbb('0x0'));exports['create']=function(_0x44df36){return client['Request']('CreateFaxMessage',{'body':_0x44df36,'log':_0x2fbb('0x1')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index 599b8cb..3f6f60e 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 _0xcab2=['getFaxQueues','Request','name','timeout','strategy','User','Agents','online','faxPause','../client'];(function(_0x5471ec,_0x1ce81a){var _0x121d4c=function(_0xefb655){while(--_0xefb655){_0x5471ec['push'](_0x5471ec['shift']());}};_0x121d4c(++_0x1ce81a);}(_0xcab2,0x1c1));var _0x2cab=function(_0x56c729,_0x41358f){_0x56c729=_0x56c729-0x0;var _0x5cfb6c=_0xcab2[_0x56c729];return _0x5cfb6c;};'use strict';var client=require(_0x2cab('0x0'));exports[_0x2cab('0x1')]=function(){return function(){return client[_0x2cab('0x2')]('GetFaxQueue',{'options':{'raw':![],'attributes':['id',_0x2cab('0x3'),_0x2cab('0x4'),_0x2cab('0x5')],'include':[{'model':_0x2cab('0x6'),'as':_0x2cab('0x7'),'attributes':['id','name',_0x2cab('0x8'),_0x2cab('0x9')]}]},'log':'getFaxQueues'});};}; \ No newline at end of file +var _0x5bf9=['Agents','online','faxPause','../client','getFaxQueues','GetFaxQueue','name','timeout','strategy','User'];(function(_0x23f8d2,_0x301fec){var _0x5d174b=function(_0x2c3c9e){while(--_0x2c3c9e){_0x23f8d2['push'](_0x23f8d2['shift']());}};_0x5d174b(++_0x301fec);}(_0x5bf9,0x1e3));var _0x95bf=function(_0x5bafe8,_0x5301a3){_0x5bafe8=_0x5bafe8-0x0;var _0x20bbfe=_0x5bf9[_0x5bafe8];return _0x20bbfe;};'use strict';var client=require(_0x95bf('0x0'));exports[_0x95bf('0x1')]=function(){return function(){return client['Request'](_0x95bf('0x2'),{'options':{'raw':![],'attributes':['id',_0x95bf('0x3'),_0x95bf('0x4'),_0x95bf('0x5')],'include':[{'model':_0x95bf('0x6'),'as':_0x95bf('0x7'),'attributes':['id',_0x95bf('0x3'),_0x95bf('0x8'),_0x95bf('0x9')]}]},'log':_0x95bf('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index d589300..1df9f36 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 _0xaec8=['../client','Request','update','UpdateFaxQueueReport','DESC'];(function(_0x367336,_0x18c229){var _0x3423a7=function(_0xa8fa05){while(--_0xa8fa05){_0x367336['push'](_0x367336['shift']());}};_0x3423a7(++_0x18c229);}(_0xaec8,0x14f));var _0x8aec=function(_0x5f43ce,_0x3a3aa1){_0x5f43ce=_0x5f43ce-0x0;var _0x2de5b1=_0xaec8[_0x5f43ce];return _0x2de5b1;};'use strict';var client=require(_0x8aec('0x0'));exports['create']=function(_0x574e5d){return client[_0x8aec('0x1')]('CreateFaxQueueReport',{'body':_0x574e5d,'log':'CreateFaxQueueReport'});};exports[_0x8aec('0x2')]=function(_0x4d2c53,_0x11c8dc){return client[_0x8aec('0x1')](_0x8aec('0x3'),{'body':_0x11c8dc,'options':{'where':{'uniqueid':_0x4d2c53},'order':[['id',_0x8aec('0x4')]],'limit':0x1},'log':_0x8aec('0x3')});}; \ No newline at end of file +var _0x2658=['UpdateFaxQueueReport','../client','create','Request','CreateFaxQueueReport','update','DESC'];(function(_0x439293,_0x258a28){var _0x174cf8=function(_0x2cea88){while(--_0x2cea88){_0x439293['push'](_0x439293['shift']());}};_0x174cf8(++_0x258a28);}(_0x2658,0xb7));var _0x8265=function(_0x11a287,_0x57df55){_0x11a287=_0x11a287-0x0;var _0x111e64=_0x2658[_0x11a287];return _0x111e64;};'use strict';var client=require(_0x8265('0x0'));exports[_0x8265('0x1')]=function(_0x56076a){return client[_0x8265('0x2')](_0x8265('0x3'),{'body':_0x56076a,'log':_0x8265('0x3')});};exports[_0x8265('0x4')]=function(_0xa1ef57,_0x2770ff){return client['Request']('UpdateFaxQueueReport',{'body':_0x2770ff,'options':{'where':{'uniqueid':_0xa1ef57},'order':[['id',_0x8265('0x5')]],'limit':0x1},'log':_0x8265('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index 9016eef..1adf2d3 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 _0xb272=['name','Interval','Intervals','getIntervals','../client','Request'];(function(_0x9ace37,_0x4d1159){var _0x23ecc0=function(_0xda11a){while(--_0xda11a){_0x9ace37['push'](_0x9ace37['shift']());}};_0x23ecc0(++_0x4d1159);}(_0xb272,0x124));var _0x2b27=function(_0x2e0af0,_0x83719c){_0x2e0af0=_0x2e0af0-0x0;var _0x2dfdc9=_0xb272[_0x2e0af0];return _0x2dfdc9;};'use strict';var client=require(_0x2b27('0x0'));exports['getIntervals']=function(){return function(){return client[_0x2b27('0x1')]('GetInterval',{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x2b27('0x2')],'include':[{'model':_0x2b27('0x3'),'as':_0x2b27('0x4'),'attributes':['id',_0x2b27('0x2'),'interval']}]},'log':_0x2b27('0x5')});};}; \ No newline at end of file +var _0x9f77=['GetInterval','Intervals','name','getIntervals','Request'];(function(_0x566bdf,_0x1f4861){var _0x331215=function(_0x524d0d){while(--_0x524d0d){_0x566bdf['push'](_0x566bdf['shift']());}};_0x331215(++_0x1f4861);}(_0x9f77,0xfd));var _0x79f7=function(_0x36365f,_0xf62bed){_0x36365f=_0x36365f-0x0;var _0x76655c=_0x9f77[_0x36365f];return _0x76655c;};'use strict';var client=require('../client');exports[_0x79f7('0x0')]=function(){return function(){return client[_0x79f7('0x1')](_0x79f7('0x2'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id','name'],'include':[{'model':'Interval','as':_0x79f7('0x3'),'attributes':['id',_0x79f7('0x4'),'interval']}]},'log':'getIntervals'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index ae69c1a..0234ce6 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 _0x7b84=['AddTagsToMailInteraction','addTagsToChatInteraction','../client','update','Request','UpdateMailInteraction','updateMailInteraction'];(function(_0x3cbe06,_0x3f96d5){var _0x20cb99=function(_0x1eaf48){while(--_0x1eaf48){_0x3cbe06['push'](_0x3cbe06['shift']());}};_0x20cb99(++_0x3f96d5);}(_0x7b84,0x17c));var _0x47b8=function(_0xae9b54,_0x1436e5){_0xae9b54=_0xae9b54-0x0;var _0x19bbc6=_0x7b84[_0xae9b54];return _0x19bbc6;};'use strict';var client=require(_0x47b8('0x0'));exports[_0x47b8('0x1')]=function(_0x186f89,_0xda244a){return client[_0x47b8('0x2')](_0x47b8('0x3'),{'body':_0xda244a,'options':{'where':{'id':_0x186f89}},'log':_0x47b8('0x4')});};exports['addTags']=function(_0x445a5f,_0x1fa41a){return client[_0x47b8('0x2')](_0x47b8('0x5'),{'body':_0x1fa41a,'options':{'where':{'id':_0x445a5f}},'log':_0x47b8('0x6')});}; \ No newline at end of file +var _0x7880=['AddTagsToMailInteraction','addTagsToChatInteraction','update','Request','UpdateMailInteraction','updateMailInteraction'];(function(_0x3a78a0,_0x44985f){var _0x48e917=function(_0x1e428c){while(--_0x1e428c){_0x3a78a0['push'](_0x3a78a0['shift']());}};_0x48e917(++_0x44985f);}(_0x7880,0x1f4));var _0x0788=function(_0x5b3b9b,_0x1c71b0){_0x5b3b9b=_0x5b3b9b-0x0;var _0x47c1d7=_0x7880[_0x5b3b9b];return _0x47c1d7;};'use strict';var client=require('../client');exports[_0x0788('0x0')]=function(_0x219c25,_0x841a33){return client[_0x0788('0x1')](_0x0788('0x2'),{'body':_0x841a33,'options':{'where':{'id':_0x219c25}},'log':_0x0788('0x3')});};exports['addTags']=function(_0x3925a6,_0x1e0814){return client[_0x0788('0x1')](_0x0788('0x4'),{'body':_0x1e0814,'options':{'where':{'id':_0x3925a6}},'log':_0x0788('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index 898e718..5639564 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 _0xf0ba=['create','Request','CreateMailMessage','createMailMessage'];(function(_0x329664,_0x130748){var _0x4e346e=function(_0x172b0d){while(--_0x172b0d){_0x329664['push'](_0x329664['shift']());}};_0x4e346e(++_0x130748);}(_0xf0ba,0x1f4));var _0xaf0b=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf0ba[_0x14add3];return _0x4a174f;};'use strict';var client=require('../client');exports[_0xaf0b('0x0')]=function(_0x52faab){return client[_0xaf0b('0x1')](_0xaf0b('0x2'),{'body':_0x52faab,'log':_0xaf0b('0x3')});}; \ No newline at end of file +var _0xa0ff=['../client','create','createMailMessage'];(function(_0x42f105,_0x30fddd){var _0x4c2bc2=function(_0x580c51){while(--_0x580c51){_0x42f105['push'](_0x42f105['shift']());}};_0x4c2bc2(++_0x30fddd);}(_0xa0ff,0x11a));var _0xfa0f=function(_0x1eb82d,_0x1e23cb){_0x1eb82d=_0x1eb82d-0x0;var _0x2c9502=_0xa0ff[_0x1eb82d];return _0x2c9502;};'use strict';var client=require(_0xfa0f('0x0'));exports[_0xfa0f('0x1')]=function(_0x2b5b01){return client['Request']('CreateMailMessage',{'body':_0x2b5b01,'log':_0xfa0f('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index f384f33..954434c 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 _0x455b=['getMailQueues','Request','GetMailQueue','strategy','User','Agents','name','online','../client'];(function(_0x2f590c,_0x45fa8d){var _0x17f83d=function(_0x4c7360){while(--_0x4c7360){_0x2f590c['push'](_0x2f590c['shift']());}};_0x17f83d(++_0x45fa8d);}(_0x455b,0x14c));var _0xb455=function(_0x1bec05,_0x58475e){_0x1bec05=_0x1bec05-0x0;var _0x5995e8=_0x455b[_0x1bec05];return _0x5995e8;};'use strict';var client=require(_0xb455('0x0'));exports[_0xb455('0x1')]=function(){return function(){return client[_0xb455('0x2')](_0xb455('0x3'),{'options':{'raw':![],'attributes':['id','name','timeout',_0xb455('0x4')],'include':[{'model':_0xb455('0x5'),'as':_0xb455('0x6'),'attributes':['id',_0xb455('0x7'),_0xb455('0x8'),'mailPause']}]},'log':_0xb455('0x1')});};}; \ No newline at end of file +var _0x0c48=['Agents','mailPause','../client','getMailQueues','Request','GetMailQueue','name','timeout','User'];(function(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0x0c48,0x1e8));var _0x80c4=function(_0x4050a2,_0x185d9d){_0x4050a2=_0x4050a2-0x0;var _0x2fea5c=_0x0c48[_0x4050a2];return _0x2fea5c;};'use strict';var client=require(_0x80c4('0x0'));exports[_0x80c4('0x1')]=function(){return function(){return client[_0x80c4('0x2')](_0x80c4('0x3'),{'options':{'raw':![],'attributes':['id',_0x80c4('0x4'),_0x80c4('0x5'),'strategy'],'include':[{'model':_0x80c4('0x6'),'as':_0x80c4('0x7'),'attributes':['id',_0x80c4('0x4'),'online',_0x80c4('0x8')]}]},'log':'getMailQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index 3b1e556..56ee8dd 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 _0xfdcf=['UpdateMailQueueReport','create','Request','CreateMailQueueReport','update'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0xfdcf,0xf6));var _0xffdc=function(_0x286a54,_0x1126a9){_0x286a54=_0x286a54-0x0;var _0x5cc54d=_0xfdcf[_0x286a54];return _0x5cc54d;};'use strict';var client=require('../client');exports[_0xffdc('0x0')]=function(_0x34ab34){return client[_0xffdc('0x1')](_0xffdc('0x2'),{'body':_0x34ab34,'log':_0xffdc('0x2')});};exports[_0xffdc('0x3')]=function(_0xaadd58,_0x1ae783){return client[_0xffdc('0x1')](_0xffdc('0x4'),{'body':_0x1ae783,'options':{'where':{'uniqueid':_0xaadd58},'order':[['id','DESC']],'limit':0x1},'log':'UpdateMailQueueReport'});}; \ No newline at end of file +var _0x0baa=['create','Request','CreateMailQueueReport','update','DESC','../client'];(function(_0x402a69,_0x2e6ab1){var _0x14b09e=function(_0x5e818a){while(--_0x5e818a){_0x402a69['push'](_0x402a69['shift']());}};_0x14b09e(++_0x2e6ab1);}(_0x0baa,0xa1));var _0xa0ba=function(_0x4c401c,_0x3edd8f){_0x4c401c=_0x4c401c-0x0;var _0x9e1a03=_0x0baa[_0x4c401c];return _0x9e1a03;};'use strict';var client=require(_0xa0ba('0x0'));exports[_0xa0ba('0x1')]=function(_0x3f60c9){return client[_0xa0ba('0x2')](_0xa0ba('0x3'),{'body':_0x3f60c9,'log':_0xa0ba('0x3')});};exports[_0xa0ba('0x4')]=function(_0x50888f,_0x1e7429){return client['Request']('UpdateMailQueueReport',{'body':_0x1e7429,'options':{'where':{'uniqueid':_0x50888f},'order':[['id',_0xa0ba('0x5')]],'limit':0x1},'log':'UpdateMailQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index 3c61cbd..899038d 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 _0x4410=['Request','AddTagsToOpenchannelInteraction','updateOpenchannelInteraction','addTags'];(function(_0x4307c3,_0x454b3f){var _0x80659a=function(_0x452824){while(--_0x452824){_0x4307c3['push'](_0x4307c3['shift']());}};_0x80659a(++_0x454b3f);}(_0x4410,0xda));var _0x0441=function(_0x588011,_0x5e9d11){_0x588011=_0x588011-0x0;var _0x3b3773=_0x4410[_0x588011];return _0x3b3773;};'use strict';var client=require('../client');exports['update']=function(_0x415edc,_0x27d599){return client['Request']('UpdateOpenchannelInteraction',{'body':_0x27d599,'options':{'where':{'id':_0x415edc}},'log':_0x0441('0x0')});};exports[_0x0441('0x1')]=function(_0x24ca41,_0x3d54fe){return client[_0x0441('0x2')](_0x0441('0x3'),{'body':_0x3d54fe,'options':{'where':{'id':_0x24ca41}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0xfc2c=['../client','update','Request','UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTags','AddTagsToOpenchannelInteraction','addTagsToChatInteraction'];(function(_0x39b3bd,_0x1c307a){var _0x46c65d=function(_0x185209){while(--_0x185209){_0x39b3bd['push'](_0x39b3bd['shift']());}};_0x46c65d(++_0x1c307a);}(_0xfc2c,0x98));var _0xcfc2=function(_0x5d5a7a,_0xe36329){_0x5d5a7a=_0x5d5a7a-0x0;var _0x2f9a7e=_0xfc2c[_0x5d5a7a];return _0x2f9a7e;};'use strict';var client=require(_0xcfc2('0x0'));exports[_0xcfc2('0x1')]=function(_0x5b5c4f,_0x2e0348){return client[_0xcfc2('0x2')](_0xcfc2('0x3'),{'body':_0x2e0348,'options':{'where':{'id':_0x5b5c4f}},'log':_0xcfc2('0x4')});};exports[_0xcfc2('0x5')]=function(_0x14b1f8,_0x258ef7){return client[_0xcfc2('0x2')](_0xcfc2('0x6'),{'body':_0x258ef7,'options':{'where':{'id':_0x14b1f8}},'log':_0xcfc2('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index 050abc7..875619f 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 _0x89e7=['../client','create','Request','CreateOpenchannelMessage','createOpenchannelMessage'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x89e7,0x136));var _0x789e=function(_0x4ae6ef,_0xc2af80){_0x4ae6ef=_0x4ae6ef-0x0;var _0x3cbb4e=_0x89e7[_0x4ae6ef];return _0x3cbb4e;};'use strict';var client=require(_0x789e('0x0'));exports[_0x789e('0x1')]=function(_0x58fb08){return client[_0x789e('0x2')](_0x789e('0x3'),{'body':_0x58fb08,'log':_0x789e('0x4')});}; \ No newline at end of file +var _0x1461=['CreateOpenchannelMessage','createOpenchannelMessage','../client'];(function(_0x142b90,_0x33f0ae){var _0x306f99=function(_0x339350){while(--_0x339350){_0x142b90['push'](_0x142b90['shift']());}};_0x306f99(++_0x33f0ae);}(_0x1461,0x140));var _0x1146=function(_0x447127,_0xbe4ade){_0x447127=_0x447127-0x0;var _0x358a25=_0x1461[_0x447127];return _0x358a25;};'use strict';var client=require(_0x1146('0x0'));exports['create']=function(_0x5a3bd6){return client['Request'](_0x1146('0x1'),{'body':_0x5a3bd6,'log':_0x1146('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index 197c9eb..6304ecb 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 _0x752c=['online','openchannelPause','getOpenchannelQueues','../client','Request','GetOpenchannelQueue','name','timeout','strategy','User','Agents'];(function(_0x6cf19c,_0x2f3f02){var _0xce14f3=function(_0x474587){while(--_0x474587){_0x6cf19c['push'](_0x6cf19c['shift']());}};_0xce14f3(++_0x2f3f02);}(_0x752c,0xea));var _0xc752=function(_0x427565,_0x4506f2){_0x427565=_0x427565-0x0;var _0xaf0ccb=_0x752c[_0x427565];return _0xaf0ccb;};'use strict';var client=require(_0xc752('0x0'));exports['getOpenchannelQueues']=function(){return function(){return client[_0xc752('0x1')](_0xc752('0x2'),{'options':{'raw':![],'attributes':['id',_0xc752('0x3'),_0xc752('0x4'),_0xc752('0x5')],'include':[{'model':_0xc752('0x6'),'as':_0xc752('0x7'),'attributes':['id',_0xc752('0x3'),_0xc752('0x8'),_0xc752('0x9')]}]},'log':_0xc752('0xa')});};}; \ No newline at end of file +var _0xb541=['getOpenchannelQueues','Request','timeout','strategy','User','Agents','name','online','../client'];(function(_0x38f63c,_0x12d79d){var _0x5e8503=function(_0x4c8c70){while(--_0x4c8c70){_0x38f63c['push'](_0x38f63c['shift']());}};_0x5e8503(++_0x12d79d);}(_0xb541,0x19d));var _0x1b54=function(_0x27214f,_0x27d2cf){_0x27214f=_0x27214f-0x0;var _0x13dcfd=_0xb541[_0x27214f];return _0x13dcfd;};'use strict';var client=require(_0x1b54('0x0'));exports[_0x1b54('0x1')]=function(){return function(){return client[_0x1b54('0x2')]('GetOpenchannelQueue',{'options':{'raw':![],'attributes':['id','name',_0x1b54('0x3'),_0x1b54('0x4')],'include':[{'model':_0x1b54('0x5'),'as':_0x1b54('0x6'),'attributes':['id',_0x1b54('0x7'),_0x1b54('0x8'),'openchannelPause']}]},'log':_0x1b54('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index a0a9068..e6ac40e 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 _0x7a8a=['create','Request','CreateOpenchannelQueueReport','DESC','UpdateOpenchannelQueueReport','../client'];(function(_0x59dfe2,_0x5399f6){var _0x1659b8=function(_0x2386db){while(--_0x2386db){_0x59dfe2['push'](_0x59dfe2['shift']());}};_0x1659b8(++_0x5399f6);}(_0x7a8a,0xb3));var _0xa7a8=function(_0x2d4064,_0x16d97b){_0x2d4064=_0x2d4064-0x0;var _0x55b0e7=_0x7a8a[_0x2d4064];return _0x55b0e7;};'use strict';var client=require(_0xa7a8('0x0'));exports[_0xa7a8('0x1')]=function(_0x2adddd){return client[_0xa7a8('0x2')](_0xa7a8('0x3'),{'body':_0x2adddd,'log':_0xa7a8('0x3')});};exports['update']=function(_0x219d85,_0x1e2469){return client['Request']('UpdateOpenchannelQueueReport',{'body':_0x1e2469,'options':{'where':{'uniqueid':_0x219d85},'order':[['id',_0xa7a8('0x4')]],'limit':0x1},'log':_0xa7a8('0x5')});}; \ No newline at end of file +var _0xa047=['CreateOpenchannelQueueReport','UpdateOpenchannelQueueReport','DESC','../client','create','Request'];(function(_0x51b713,_0x5648bf){var _0x3d8353=function(_0x814a0f){while(--_0x814a0f){_0x51b713['push'](_0x51b713['shift']());}};_0x3d8353(++_0x5648bf);}(_0xa047,0x1c5));var _0x7a04=function(_0x4eb6ec,_0x7f2520){_0x4eb6ec=_0x4eb6ec-0x0;var _0x58881b=_0xa047[_0x4eb6ec];return _0x58881b;};'use strict';var client=require(_0x7a04('0x0'));exports[_0x7a04('0x1')]=function(_0x2c22ee){return client[_0x7a04('0x2')]('CreateOpenchannelQueueReport',{'body':_0x2c22ee,'log':_0x7a04('0x3')});};exports['update']=function(_0x132966,_0x269341){return client[_0x7a04('0x2')](_0x7a04('0x4'),{'body':_0x269341,'options':{'where':{'uniqueid':_0x132966},'order':[['id',_0x7a04('0x5')]],'limit':0x1},'log':'UpdateOpenchannelQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index 83bfe01..9f20264 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 _0x4849=['Request','UpdateSmsInteraction','updateSmsInteraction','addTags','AddTagsToSmsInteraction','addTagsToSmsInteraction','../client','update'];(function(_0x500a2c,_0xfe5b5b){var _0x192e0d=function(_0x3ceb73){while(--_0x3ceb73){_0x500a2c['push'](_0x500a2c['shift']());}};_0x192e0d(++_0xfe5b5b);}(_0x4849,0x86));var _0x9484=function(_0x22153e,_0xc6a9af){_0x22153e=_0x22153e-0x0;var _0x5cebed=_0x4849[_0x22153e];return _0x5cebed;};'use strict';var client=require(_0x9484('0x0'));exports[_0x9484('0x1')]=function(_0x4fcfaf,_0x11cf8a){return client[_0x9484('0x2')](_0x9484('0x3'),{'body':_0x11cf8a,'options':{'where':{'id':_0x4fcfaf}},'log':_0x9484('0x4')});};exports[_0x9484('0x5')]=function(_0x3f3057,_0x6ea4d8){return client['Request'](_0x9484('0x6'),{'body':_0x6ea4d8,'options':{'where':{'id':_0x3f3057}},'log':_0x9484('0x7')});}; \ No newline at end of file +var _0x20d7=['Request'];(function(_0x223f3b,_0x461e12){var _0x198669=function(_0x5a13d9){while(--_0x5a13d9){_0x223f3b['push'](_0x223f3b['shift']());}};_0x198669(++_0x461e12);}(_0x20d7,0x146));var _0x720d=function(_0x2f346d,_0x3170d1){_0x2f346d=_0x2f346d-0x0;var _0x10ee83=_0x20d7[_0x2f346d];return _0x10ee83;};'use strict';var client=require('../client');exports['update']=function(_0x5583f5,_0x686ffb){return client[_0x720d('0x0')]('UpdateSmsInteraction',{'body':_0x686ffb,'options':{'where':{'id':_0x5583f5}},'log':'updateSmsInteraction'});};exports['addTags']=function(_0x3a9884,_0x241e8d){return client['Request']('AddTagsToSmsInteraction',{'body':_0x241e8d,'options':{'where':{'id':_0x3a9884}},'log':'addTagsToSmsInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index 4f870fd..085899d 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 _0xd075=['createSmsMessage','Request'];(function(_0x119d5a,_0x19b457){var _0x15bff4=function(_0x1b7c78){while(--_0x1b7c78){_0x119d5a['push'](_0x119d5a['shift']());}};_0x15bff4(++_0x19b457);}(_0xd075,0x1bb));var _0x5d07=function(_0xa56451,_0x4e3d72){_0xa56451=_0xa56451-0x0;var _0x12a904=_0xd075[_0xa56451];return _0x12a904;};'use strict';var client=require('../client');exports['create']=function(_0x42b3da){return client[_0x5d07('0x0')]('CreateSmsMessage',{'body':_0x42b3da,'log':_0x5d07('0x1')});}; \ No newline at end of file +var _0x91ea=['CreateSmsMessage','createSmsMessage','../client','create','Request'];(function(_0x2cc594,_0x4d727b){var _0x4abff7=function(_0x22b01d){while(--_0x22b01d){_0x2cc594['push'](_0x2cc594['shift']());}};_0x4abff7(++_0x4d727b);}(_0x91ea,0x70));var _0xa91e=function(_0x12af26,_0xb04b61){_0x12af26=_0x12af26-0x0;var _0x55ff8d=_0x91ea[_0x12af26];return _0x55ff8d;};'use strict';var client=require(_0xa91e('0x0'));exports[_0xa91e('0x1')]=function(_0x3d7b9b){return client[_0xa91e('0x2')](_0xa91e('0x3'),{'body':_0x3d7b9b,'log':_0xa91e('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index 65b30af..8c703a9 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 _0xa9e0=['name','online','smsPause','../client','getSmsQueues','Request','timeout','User','Agents'];(function(_0x199e32,_0x217eb5){var _0x38265c=function(_0x1bd35b){while(--_0x1bd35b){_0x199e32['push'](_0x199e32['shift']());}};_0x38265c(++_0x217eb5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0xa9e0[_0x40ac5e];return _0x2839d6;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id','name',_0x0a9e('0x3'),'strategy'],'include':[{'model':_0x0a9e('0x4'),'as':_0x0a9e('0x5'),'attributes':['id',_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8')]}]},'log':'getSmsQueues'});};}; \ No newline at end of file +var _0xa9e0=['name','online','smsPause','../client','getSmsQueues','Request','timeout','User','Agents'];(function(_0x533050,_0x16ca70){var _0x2cd7bc=function(_0x5d43b5){while(--_0x5d43b5){_0x533050['push'](_0x533050['shift']());}};_0x2cd7bc(++_0x16ca70);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0xa9e0[_0x4dbaad];return _0x226c72;};'use strict';var client=require(_0x0a9e('0x0'));exports[_0x0a9e('0x1')]=function(){return function(){return client[_0x0a9e('0x2')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id','name',_0x0a9e('0x3'),'strategy'],'include':[{'model':_0x0a9e('0x4'),'as':_0x0a9e('0x5'),'attributes':['id',_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8')]}]},'log':'getSmsQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index e15d3c9..ad563dd 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 _0x9c44=['Request','CreateSmsQueueReport','update','UpdateSmsQueueReport'];(function(_0x1725f6,_0x3bce2e){var _0x10be49=function(_0x20aa24){while(--_0x20aa24){_0x1725f6['push'](_0x1725f6['shift']());}};_0x10be49(++_0x3bce2e);}(_0x9c44,0x178));var _0x49c4=function(_0x1d9aa0,_0x272488){_0x1d9aa0=_0x1d9aa0-0x0;var _0x226868=_0x9c44[_0x1d9aa0];return _0x226868;};'use strict';var client=require('../client');exports['create']=function(_0x1ffbbf){return client[_0x49c4('0x0')](_0x49c4('0x1'),{'body':_0x1ffbbf,'log':_0x49c4('0x1')});};exports[_0x49c4('0x2')]=function(_0x2ad237,_0x4e0313){return client['Request'](_0x49c4('0x3'),{'body':_0x4e0313,'options':{'where':{'uniqueid':_0x2ad237},'order':[['id','DESC']],'limit':0x1},'log':_0x49c4('0x3')});}; \ No newline at end of file +var _0x008c=['../client','create','Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC'];(function(_0x5f5399,_0x4928ca){var _0x5e5647=function(_0x55f02e){while(--_0x55f02e){_0x5f5399['push'](_0x5f5399['shift']());}};_0x5e5647(++_0x4928ca);}(_0x008c,0x188));var _0xc008=function(_0x57808d,_0x3b6920){_0x57808d=_0x57808d-0x0;var _0x4f4ed1=_0x008c[_0x57808d];return _0x4f4ed1;};'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 26cee4e..f0b6c16 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(_0x146e36,_0x3207e6){var _0x36ff78=function(_0x504638){while(--_0x504638){_0x146e36['push'](_0x146e36['shift']());}};_0x36ff78(++_0x3207e6);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1cfa0d,_0x4391f2){_0x1cfa0d=_0x1cfa0d-0x0;var _0xe33279=_0xa9e0[_0x1cfa0d];return _0xe33279;};'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(_0x30229a,_0x9b7356){var _0x5df408=function(_0x16eeaf){while(--_0x16eeaf){_0x30229a['push'](_0x30229a['shift']());}};_0x5df408(++_0x9b7356);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0xa9e0[_0x4b7b62];return _0x2280df;};'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 64d6fe4..ad28729 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 _0x7923=['update','Request','UpdateWhatsappInteraction','updateWhatsappInteraction','AddTagsToWhatsappInteraction','../client'];(function(_0x49de1a,_0x3b1047){var _0x53170f=function(_0x4e2c37){while(--_0x4e2c37){_0x49de1a['push'](_0x49de1a['shift']());}};_0x53170f(++_0x3b1047);}(_0x7923,0x8f));var _0x3792=function(_0x561fcc,_0x289736){_0x561fcc=_0x561fcc-0x0;var _0x22ec67=_0x7923[_0x561fcc];return _0x22ec67;};'use strict';var client=require(_0x3792('0x0'));exports[_0x3792('0x1')]=function(_0x2fb5a5,_0xdc0c64){return client[_0x3792('0x2')](_0x3792('0x3'),{'body':_0xdc0c64,'options':{'where':{'id':_0x2fb5a5}},'log':_0x3792('0x4')});};exports['addTags']=function(_0x21134d,_0x51d334){return client['Request'](_0x3792('0x5'),{'body':_0x51d334,'options':{'where':{'id':_0x21134d}},'log':'addTagsToWhatsappInteraction'});}; \ No newline at end of file +var _0xc838=['UpdateWhatsappInteraction','updateWhatsappInteraction','addTags','AddTagsToWhatsappInteraction','addTagsToWhatsappInteraction','../client','update','Request'];(function(_0x1d05c2,_0x1a6c2d){var _0x4766f5=function(_0xa0df0){while(--_0xa0df0){_0x1d05c2['push'](_0x1d05c2['shift']());}};_0x4766f5(++_0x1a6c2d);}(_0xc838,0xbd));var _0x8c83=function(_0x52795e,_0x5d9b5b){_0x52795e=_0x52795e-0x0;var _0x67b297=_0xc838[_0x52795e];return _0x67b297;};'use strict';var client=require(_0x8c83('0x0'));exports[_0x8c83('0x1')]=function(_0x19ffb7,_0x332598){return client[_0x8c83('0x2')](_0x8c83('0x3'),{'body':_0x332598,'options':{'where':{'id':_0x19ffb7}},'log':_0x8c83('0x4')});};exports[_0x8c83('0x5')]=function(_0x2bb018,_0x85c36d){return client[_0x8c83('0x2')](_0x8c83('0x6'),{'body':_0x85c36d,'options':{'where':{'id':_0x2bb018}},'log':_0x8c83('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappMessage.js b/server/services/routing/rpc/whatsappMessage.js index 02a149f..4e5c540 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 _0x87cb=['createWhatsappMessage','CreateWhatsappMessage'];(function(_0x1cf6bb,_0x2661e2){var _0xe208a6=function(_0x5345fa){while(--_0x5345fa){_0x1cf6bb['push'](_0x1cf6bb['shift']());}};_0xe208a6(++_0x2661e2);}(_0x87cb,0x19d));var _0xb87c=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0x87cb[_0xbd08b4];return _0x314f1e;};'use strict';var client=require('../client');exports['create']=function(_0x37c9bd){return client['Request'](_0xb87c('0x0'),{'body':_0x37c9bd,'log':_0xb87c('0x1')});}; \ No newline at end of file +var _0x464b=['../client','create','Request','CreateWhatsappMessage'];(function(_0x353150,_0x1ab0ef){var _0x3dc923=function(_0xd33b75){while(--_0xd33b75){_0x353150['push'](_0x353150['shift']());}};_0x3dc923(++_0x1ab0ef);}(_0x464b,0x1b8));var _0xb464=function(_0x574510,_0x2b73dd){_0x574510=_0x574510-0x0;var _0x2f9603=_0x464b[_0x574510];return _0x2f9603;};'use strict';var client=require(_0xb464('0x0'));exports[_0xb464('0x1')]=function(_0x3ef00c){return client[_0xb464('0x2')](_0xb464('0x3'),{'body':_0x3ef00c,'log':'createWhatsappMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueue.js b/server/services/routing/rpc/whatsappQueue.js index ba5da24..055a01a 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 _0x598e=['../client','getWhatsappQueues','name','timeout','strategy','User','Agents','online','whatsappPause'];(function(_0x3d8d33,_0x11799f){var _0x598936=function(_0x1c4bff){while(--_0x1c4bff){_0x3d8d33['push'](_0x3d8d33['shift']());}};_0x598936(++_0x11799f);}(_0x598e,0x18c));var _0xe598=function(_0x505151,_0x8e3de9){_0x505151=_0x505151-0x0;var _0x541232=_0x598e[_0x505151];return _0x541232;};'use strict';var client=require(_0xe598('0x0'));exports[_0xe598('0x1')]=function(){return function(){return client['Request']('GetWhatsappQueue',{'options':{'raw':![],'attributes':['id',_0xe598('0x2'),_0xe598('0x3'),_0xe598('0x4')],'include':[{'model':_0xe598('0x5'),'as':_0xe598('0x6'),'attributes':['id',_0xe598('0x2'),_0xe598('0x7'),_0xe598('0x8')]}]},'log':'getWhatsappQueues'});};}; \ No newline at end of file +var _0x787a=['online','getWhatsappQueues','GetWhatsappQueue','name','timeout','User','Agents'];(function(_0x20fb45,_0x7db0f6){var _0x45d4d0=function(_0x31644a){while(--_0x31644a){_0x20fb45['push'](_0x20fb45['shift']());}};_0x45d4d0(++_0x7db0f6);}(_0x787a,0xf6));var _0xa787=function(_0x2674f3,_0x2a97e7){_0x2674f3=_0x2674f3-0x0;var _0x5a8401=_0x787a[_0x2674f3];return _0x5a8401;};'use strict';var client=require('../client');exports[_0xa787('0x0')]=function(){return function(){return client['Request'](_0xa787('0x1'),{'options':{'raw':![],'attributes':['id',_0xa787('0x2'),_0xa787('0x3'),'strategy'],'include':[{'model':_0xa787('0x4'),'as':_0xa787('0x5'),'attributes':['id',_0xa787('0x2'),_0xa787('0x6'),'whatsappPause']}]},'log':_0xa787('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/whatsappQueueReport.js b/server/services/routing/rpc/whatsappQueueReport.js index f3730da..ea9fc36 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 _0x746b=['UpdateWhatsappQueueReport','../client','create','CreateWhatsappQueueReport','update','Request'];(function(_0xa85344,_0x4e827a){var _0x307144=function(_0x5112f8){while(--_0x5112f8){_0xa85344['push'](_0xa85344['shift']());}};_0x307144(++_0x4e827a);}(_0x746b,0xc7));var _0xb746=function(_0x36d790,_0x5e2433){_0x36d790=_0x36d790-0x0;var _0x2dab5f=_0x746b[_0x36d790];return _0x2dab5f;};'use strict';var client=require(_0xb746('0x0'));exports[_0xb746('0x1')]=function(_0x23c85c){return client['Request'](_0xb746('0x2'),{'body':_0x23c85c,'log':'CreateWhatsappQueueReport'});};exports[_0xb746('0x3')]=function(_0x34db82,_0x389588){return client[_0xb746('0x4')](_0xb746('0x5'),{'body':_0x389588,'options':{'where':{'uniqueid':_0x34db82},'order':[['id','DESC']],'limit':0x1},'log':'UpdateWhatsappQueueReport'});}; \ No newline at end of file +var _0xeff7=['update','UpdateWhatsappQueueReport','DESC','../client','create'];(function(_0x3c904f,_0x27cae5){var _0x15f198=function(_0x3cb4c0){while(--_0x3cb4c0){_0x3c904f['push'](_0x3c904f['shift']());}};_0x15f198(++_0x27cae5);}(_0xeff7,0xd5));var _0x7eff=function(_0x5db68e,_0x134e36){_0x5db68e=_0x5db68e-0x0;var _0x27ca99=_0xeff7[_0x5db68e];return _0x27ca99;};'use strict';var client=require(_0x7eff('0x0'));exports[_0x7eff('0x1')]=function(_0x2eabfa){return client['Request']('CreateWhatsappQueueReport',{'body':_0x2eabfa,'log':'CreateWhatsappQueueReport'});};exports[_0x7eff('0x2')]=function(_0x1bc1ae,_0x162986){return client['Request'](_0x7eff('0x3'),{'body':_0x162986,'options':{'where':{'uniqueid':_0x1bc1ae},'order':[['id',_0x7eff('0x4')]],'limit':0x1},'log':_0x7eff('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/server/applications/agent.js b/server/services/routing/server/applications/agent.js index 601bd30..195d919 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 _0xa28c=['log','stack','validate','util','seq-queue','routing','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','error','map','message','join','stop','find','agents','timeout','createQueue','channel','START:%s','rules','end','info','close','complete','next','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s'];(function(_0x17dea5,_0x3439f3){var _0x4df79c=function(_0x6da011){while(--_0x6da011){_0x17dea5['push'](_0x17dea5['shift']());}};_0x4df79c(++_0x3439f3);}(_0xa28c,0x182));var _0xca28=function(_0x543084,_0x4337f5){_0x543084=_0x543084-0x0;var _0x306a57=_0xa28c[_0x543084];return _0x306a57;};'use strict';var schema=require(_0xca28('0x0'));var _=require('lodash');var util=require(_0xca28('0x1'));var seqqueue=require(_0xca28('0x2'));var logger=require('../../../../config/logger')(_0xca28('0x3'));var strategy=require(_0xca28('0x4'));var queue=schema({'name':{'type':_0xca28('0x5'),'required':!![],'message':_0xca28('0x6')},'timeout':{'type':'number','message':'timeout\x20is\x20a\x20number'}});function writeLog(_0x152131,_0x2a7323,_0x3e97b2){return logger['info'](util[_0xca28('0x7')](_0xca28('0x8'),_0x152131,_0x2a7323[_0xca28('0x9')],_0x3e97b2));}function handleFindAgent(_0x55edcc){return function(_0x2a1618){return _0x2a1618[_0xca28('0x9')][_0xca28('0xa')]()===_0x55edcc['toLowerCase']();};}exports['consequence']=function(_0x2821b5,_0x1cca17,_0x371145,_0x582737){return function(_0x5cb415){try{var _0x2e05a1={'name':_0x1cca17[0x0],'timeout':_0x1cca17[0x1]};var _0x47fc52=queue[_0xca28('0x0')](_0x2e05a1,{'typecast':!![]});if(_0x47fc52['length']){logger[_0xca28('0xb')]('[%s][AGENT]\x20%s',_0x2821b5,_[_0xca28('0xc')](_0x47fc52,_0xca28('0xd'))[_0xca28('0xe')](',\x20'));_0x5cb415[_0xca28('0xf')]();}else{var _0x1e4c7a=_[_0xca28('0x10')](_0x371145[_0xca28('0x11')],handleFindAgent(_0x2e05a1[_0xca28('0x9')]));if(_0x1e4c7a){var _0x28e877=(_0x2e05a1[_0xca28('0x12')]||0xa)*0x3e8;var _0x964b22,_0x50dde5;var _0x2ae98b=seqqueue[_0xca28('0x13')](_0x28e877);_0x2ae98b['id']=_0x2821b5;_0x2ae98b['atimeout']=_0x28e877;_0x2ae98b[_0xca28('0x14')]=_0x582737[_0xca28('0x14')];writeLog(_0x2821b5,_0x1e4c7a,util[_0xca28('0x7')](_0xca28('0x15'),_0x28e877));_0x371145[_0xca28('0x16')][_0x2821b5]['on'](_0xca28('0x17'),function(){logger[_0xca28('0x18')]('[%s][AGENT]\x20ROUTING\x20STOPPED',_0x2821b5);clearTimeout(_0x50dde5);_0x50dde5=undefined;_0x2ae98b[_0xca28('0x19')]();if(_0x371145['rules'][_0x2821b5]){delete _0x371145[_0xca28('0x16')][_0x2821b5];}_0x5cb415['stop']();});_0x371145[_0xca28('0x16')][_0x2821b5]['on'](_0xca28('0x1a'),function(){if(_0x371145[_0xca28('0x16')][_0x2821b5]){delete _0x371145[_0xca28('0x16')][_0x2821b5];}});_0x50dde5=setTimeout(function(){logger[_0xca28('0x18')]('[%s][AGENT]\x20ROUTING\x20END',_0x2821b5);clearTimeout(_0x50dde5);_0x2ae98b[_0xca28('0x19')]();_0x5cb415[_0xca28('0x1b')]();},_0x28e877);strategy[_0xca28('0x1c')](_0x2ae98b,_0x1e4c7a,_0x371145,_0x582737);}else{logger[_0xca28('0xb')](_0xca28('0x1d'),_0x2821b5,_0x2e05a1[_0xca28('0x9')]);_0x5cb415[_0xca28('0xf')]();}}}catch(_0x598735){console[_0xca28('0x1e')](_0x598735);logger[_0xca28('0xb')]('[%s][QUEUE]\x20%s',_0x2821b5,_0x598735[_0xca28('0x1f')]);_0x5cb415[_0xca28('0xf')]();}};}; \ No newline at end of file +var _0x7ca9=['validate','[%s][AGENT]\x20%s','map','join','stop','find','agents','timeout','createQueue','channel','START:%s','rules','end','info','[%s][AGENT]\x20ROUTING\x20STOPPED','close','complete','[%s][AGENT]\x20ROUTING\x20END','next','agent','error','[%s][AGENT]\x20agent\x20not\x20found\x20%s','[%s][QUEUE]\x20%s','stack','lodash','seq-queue','../../../../config/logger','routing','./strategy','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','timeout\x20is\x20a\x20number','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7ca9,0x180));var _0x97ca=function(_0x1d227e,_0x491955){_0x1d227e=_0x1d227e-0x0;var _0x4f752a=_0x7ca9[_0x1d227e];return _0x4f752a;};'use strict';var schema=require('validate');var _=require(_0x97ca('0x0'));var util=require('util');var seqqueue=require(_0x97ca('0x1'));var logger=require(_0x97ca('0x2'))(_0x97ca('0x3'));var strategy=require(_0x97ca('0x4'));var queue=schema({'name':{'type':'string','required':!![],'message':_0x97ca('0x5')},'timeout':{'type':'number','message':_0x97ca('0x6')}});function writeLog(_0x90ab6d,_0x29792c,_0x13fe63){return logger['info'](util[_0x97ca('0x7')](_0x97ca('0x8'),_0x90ab6d,_0x29792c[_0x97ca('0x9')],_0x13fe63));}function handleFindAgent(_0x153721){return function(_0x44cbe2){return _0x44cbe2[_0x97ca('0x9')][_0x97ca('0xa')]()===_0x153721[_0x97ca('0xa')]();};}exports[_0x97ca('0xb')]=function(_0x3bba87,_0x2f4b50,_0x4ce967,_0x2b8b52){return function(_0x3c18fb){try{var _0x312349={'name':_0x2f4b50[0x0],'timeout':_0x2f4b50[0x1]};var _0x133b57=queue[_0x97ca('0xc')](_0x312349,{'typecast':!![]});if(_0x133b57['length']){logger['error'](_0x97ca('0xd'),_0x3bba87,_[_0x97ca('0xe')](_0x133b57,'message')[_0x97ca('0xf')](',\x20'));_0x3c18fb[_0x97ca('0x10')]();}else{var _0x69c146=_[_0x97ca('0x11')](_0x4ce967[_0x97ca('0x12')],handleFindAgent(_0x312349[_0x97ca('0x9')]));if(_0x69c146){var _0x29e84e=(_0x312349[_0x97ca('0x13')]||0xa)*0x3e8;var _0x5adc3b,_0x57f1da;var _0x149fb3=seqqueue[_0x97ca('0x14')](_0x29e84e);_0x149fb3['id']=_0x3bba87;_0x149fb3['atimeout']=_0x29e84e;_0x149fb3[_0x97ca('0x15')]=_0x2b8b52[_0x97ca('0x15')];writeLog(_0x3bba87,_0x69c146,util[_0x97ca('0x7')](_0x97ca('0x16'),_0x29e84e));_0x4ce967[_0x97ca('0x17')][_0x3bba87]['on'](_0x97ca('0x18'),function(){logger[_0x97ca('0x19')](_0x97ca('0x1a'),_0x3bba87);clearTimeout(_0x57f1da);_0x57f1da=undefined;_0x149fb3[_0x97ca('0x1b')]();if(_0x4ce967[_0x97ca('0x17')][_0x3bba87]){delete _0x4ce967[_0x97ca('0x17')][_0x3bba87];}_0x3c18fb[_0x97ca('0x10')]();});_0x4ce967['rules'][_0x3bba87]['on'](_0x97ca('0x1c'),function(){if(_0x4ce967['rules'][_0x3bba87]){delete _0x4ce967['rules'][_0x3bba87];}});_0x57f1da=setTimeout(function(){logger[_0x97ca('0x19')](_0x97ca('0x1d'),_0x3bba87);clearTimeout(_0x57f1da);_0x149fb3[_0x97ca('0x1b')]();_0x3c18fb[_0x97ca('0x1e')]();},_0x29e84e);strategy[_0x97ca('0x1f')](_0x149fb3,_0x69c146,_0x4ce967,_0x2b8b52);}else{logger[_0x97ca('0x20')](_0x97ca('0x21'),_0x3bba87,_0x312349[_0x97ca('0x9')]);_0x3c18fb['stop']();}}}catch(_0x185933){console['log'](_0x185933);logger[_0x97ca('0x20')](_0x97ca('0x22'),_0x3bba87,_0x185933[_0x97ca('0x23')]);_0x3c18fb['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/amazonlex.js b/server/services/routing/server/applications/amazonlex.js index 4e65868..ab2868a 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 _0x351e=['chat','account','AccountId','upperFirst','InteractionId','interaction','created','isEmpty','body','Message','create','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!','message','error','next','amazonlex','providerName','stringify','dialogState','Failed','aws-sdk','./utils','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','isNil','UserId','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','contact','format','out','channel','whatsapp','phone'];(function(_0x130867,_0x188e00){var _0x2c849b=function(_0x166a48){while(--_0x166a48){_0x130867['push'](_0x130867['shift']());}};_0x2c849b(++_0x188e00);}(_0x351e,0x10f));var _0xe351=function(_0x3bbd2d,_0xf8ba3c){_0x3bbd2d=_0x3bbd2d-0x0;var _0x241bd4=_0x351e[_0x3bbd2d];return _0x241bd4;};'use strict';var _=require('lodash');var moment=require('moment');var AWS=require(_0xe351('0x0'));var utils=require(_0xe351('0x1'));var logger=require('../../../../config/logger')('routing');var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0xe351('0x2')),'mailMessage':require(_0xe351('0x3')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0xe351('0x4')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports['consequence']=function(_0x4e55f8,_0x14e1cd){return function(_0x43bd1f){try{if(!_[_0xe351('0x5')](this['interaction'][_0xe351('0x6')])){logger[_0xe351('0x7')](_0xe351('0x8'),_0x4e55f8,_0xe351('0x9'));return _0x43bd1f['next']();}var _0xb56364={'ContactId':this[_0xe351('0xa')]['id'],'sentAt':moment()[_0xe351('0xb')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0xe351('0xc')};if(this[_0xe351('0xd')]==='sms'||this['channel']===_0xe351('0xe')){_0xb56364[_0xe351('0xf')]=this['interaction'][_0xe351('0xf')];}var _0x216ab3=this[_0xe351('0xd')];if(_0x216ab3===_0xe351('0x10')){_0xb56364['ChatWebsiteId']=this[_0xe351('0x11')]['id'];}else{_0xb56364[_['upperFirst'](_0x216ab3)+_0xe351('0x12')]=this[_0xe351('0x11')]['id'];}_0xb56364[_[_0xe351('0x13')](_0x216ab3)+_0xe351('0x14')]=this['interaction']['id'];if(this[_0xe351('0x15')][_0xe351('0x16')]){var _0x432d65=_0x14e1cd[0x4];if(!_[_0xe351('0x17')](_0x432d65)){_0xb56364[_0xe351('0x18')]=utils['getMustacheRender'](_0x432d65,this);return rpc[_0x216ab3+_0xe351('0x19')][_0xe351('0x1a')](_0xb56364)[_0xe351('0x1b')](function(_0x513840){logger['info'](_0xe351('0x8'),_0x4e55f8,_0xb56364[_0xe351('0x18')]);})[_0xe351('0x1c')](function(_0x3611cf){logger['error'](_0xe351('0x8'),_0x4e55f8,JSON['stringify'](_0x3611cf));})[_0xe351('0x1d')](function(){logger[_0xe351('0x7')](_0xe351('0x1e'),_0x4e55f8);_0x43bd1f[_0xe351('0x1f')]();});}else{logger[_0xe351('0x7')](_0xe351('0x20'),_0x4e55f8);_0x43bd1f[_0xe351('0x1f')]();}}else{var _0x2f91f9=this;var _0x3d65ff=new AWS['LexRuntime']({'accessKeyId':_0x14e1cd[0x0],'secretAccessKey':_0x14e1cd[0x1],'region':_0x14e1cd[0x2]});var _0x2a286={'botAlias':'$LATEST','botName':_0x14e1cd[0x3],'inputText':this[_0xe351('0x21')][_0xe351('0x18')],'userId':this[_0xe351('0xd')]+':'+this[_0xe351('0x15')]['id']['toString']()};_0x3d65ff['postText'](_0x2a286,function(_0x7ed21d,_0x210e65){if(_0x7ed21d){logger[_0xe351('0x22')](_0xe351('0x8'),_0x4e55f8,_0x7ed21d[_0xe351('0x21')]);_0x43bd1f[_0xe351('0x23')]();}else if(_0x210e65&&_0x210e65['message']){_0x2f91f9['body'][_0xe351('0x24')]=_0x210e65;_0xb56364[_0xe351('0x18')]=_0x210e65[_0xe351('0x21')];_0xb56364[_0xe351('0x25')]=_0xe351('0x24');_0xb56364['providerResponse']=JSON[_0xe351('0x26')](_0x210e65);return rpc[_0x216ab3+_0xe351('0x19')][_0xe351('0x1a')](_0xb56364)[_0xe351('0x1b')](function(_0x5b1cfc){logger[_0xe351('0x7')](_0xe351('0x8'),_0x4e55f8,_0xb56364['body']);if(_0x210e65[_0xe351('0x27')]==_0xe351('0x28')){_0x43bd1f['next']();}else{_0x43bd1f['stop']();}})[_0xe351('0x1c')](function(_0x2c038a){logger[_0xe351('0x22')](_0xe351('0x8'),_0x4e55f8,JSON[_0xe351('0x26')](_0x2c038a));_0x43bd1f['next']();});}else{_0x43bd1f['next']();}});}}catch(_0x834820){logger[_0xe351('0x22')](_0xe351('0x8'),_0x4e55f8,JSON[_0xe351('0x26')](_0x834820));_0x43bd1f[_0xe351('0x1f')]();}};}; \ No newline at end of file +var _0x6d37=['isEmpty','body','getMustacheRender','Message','catch','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','LexRuntime','$LATEST','toString','postText','message','amazonlex','providerName','stringify','create','then','dialogState','Failed','stop','error','lodash','moment','aws-sdk','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','isNil','interaction','info','[%s][AMAZONLEX]\x20%s','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','whatsapp','phone','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created'];(function(_0x3a1282,_0x348c1e){var _0x1e29f8=function(_0x493d0c){while(--_0x493d0c){_0x3a1282['push'](_0x3a1282['shift']());}};_0x1e29f8(++_0x348c1e);}(_0x6d37,0x1ad));var _0x76d3=function(_0x2feb66,_0x25333e){_0x2feb66=_0x2feb66-0x0;var _0x386cfd=_0x6d37[_0x2feb66];return _0x386cfd;};'use strict';var _=require(_0x76d3('0x0'));var moment=require(_0x76d3('0x1'));var AWS=require(_0x76d3('0x2'));var utils=require(_0x76d3('0x3'));var logger=require(_0x76d3('0x4'))('routing');var rpc={'chatMessage':require(_0x76d3('0x5')),'openchannelMessage':require(_0x76d3('0x6')),'mailMessage':require(_0x76d3('0x7')),'smsMessage':require(_0x76d3('0x8')),'faxMessage':require(_0x76d3('0x9')),'whatsappMessage':require(_0x76d3('0xa'))};exports['consequence']=function(_0x3e669d,_0x38e424){return function(_0x1d774f){try{if(!_[_0x76d3('0xb')](this[_0x76d3('0xc')]['UserId'])){logger[_0x76d3('0xd')](_0x76d3('0xe'),_0x3e669d,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x1d774f[_0x76d3('0xf')]();}var _0x2e00c2={'ContactId':this[_0x76d3('0x10')]['id'],'sentAt':moment()[_0x76d3('0x11')](_0x76d3('0x12')),'direction':_0x76d3('0x13')};if(this['channel']==='sms'||this[_0x76d3('0x14')]===_0x76d3('0x15')){_0x2e00c2['phone']=this[_0x76d3('0xc')][_0x76d3('0x16')];}var _0x5d44a7=this['channel'];if(_0x5d44a7===_0x76d3('0x17')){_0x2e00c2[_0x76d3('0x18')]=this[_0x76d3('0x19')]['id'];}else{_0x2e00c2[_[_0x76d3('0x1a')](_0x5d44a7)+_0x76d3('0x1b')]=this[_0x76d3('0x19')]['id'];}_0x2e00c2[_[_0x76d3('0x1a')](_0x5d44a7)+_0x76d3('0x1c')]=this[_0x76d3('0xc')]['id'];if(this['interaction'][_0x76d3('0x1d')]){var _0xf40b62=_0x38e424[0x4];if(!_[_0x76d3('0x1e')](_0xf40b62)){_0x2e00c2[_0x76d3('0x1f')]=utils[_0x76d3('0x20')](_0xf40b62,this);return rpc[_0x5d44a7+_0x76d3('0x21')]['create'](_0x2e00c2)['then'](function(_0x15737b){logger[_0x76d3('0xd')](_0x76d3('0xe'),_0x3e669d,_0x2e00c2[_0x76d3('0x1f')]);})[_0x76d3('0x22')](function(_0x5d2609){logger['error'](_0x76d3('0xe'),_0x3e669d,JSON['stringify'](_0x5d2609));})[_0x76d3('0x23')](function(){logger[_0x76d3('0xd')](_0x76d3('0x24'),_0x3e669d);_0x1d774f['stop']();});}else{logger[_0x76d3('0xd')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x3e669d);_0x1d774f['stop']();}}else{var _0x4a3287=this;var _0x3833eb=new AWS[(_0x76d3('0x25'))]({'accessKeyId':_0x38e424[0x0],'secretAccessKey':_0x38e424[0x1],'region':_0x38e424[0x2]});var _0x2a6e70={'botAlias':_0x76d3('0x26'),'botName':_0x38e424[0x3],'inputText':this['message'][_0x76d3('0x1f')],'userId':this[_0x76d3('0x14')]+':'+this[_0x76d3('0xc')]['id'][_0x76d3('0x27')]()};_0x3833eb[_0x76d3('0x28')](_0x2a6e70,function(_0x3e646a,_0x510b75){if(_0x3e646a){logger['error']('[%s][AMAZONLEX]\x20%s',_0x3e669d,_0x3e646a[_0x76d3('0x29')]);_0x1d774f[_0x76d3('0xf')]();}else if(_0x510b75&&_0x510b75['message']){_0x4a3287[_0x76d3('0x1f')][_0x76d3('0x2a')]=_0x510b75;_0x2e00c2[_0x76d3('0x1f')]=_0x510b75[_0x76d3('0x29')];_0x2e00c2[_0x76d3('0x2b')]=_0x76d3('0x2a');_0x2e00c2['providerResponse']=JSON[_0x76d3('0x2c')](_0x510b75);return rpc[_0x5d44a7+_0x76d3('0x21')][_0x76d3('0x2d')](_0x2e00c2)[_0x76d3('0x2e')](function(_0xbccba5){logger['info'](_0x76d3('0xe'),_0x3e669d,_0x2e00c2[_0x76d3('0x1f')]);if(_0x510b75[_0x76d3('0x2f')]==_0x76d3('0x30')){_0x1d774f[_0x76d3('0xf')]();}else{_0x1d774f[_0x76d3('0x31')]();}})[_0x76d3('0x22')](function(_0x3b6736){logger['error']('[%s][AMAZONLEX]\x20%s',_0x3e669d,JSON[_0x76d3('0x2c')](_0x3b6736));_0x1d774f[_0x76d3('0xf')]();});}else{_0x1d774f[_0x76d3('0xf')]();}});}}catch(_0x43ed9b){logger[_0x76d3('0x32')](_0x76d3('0xe'),_0x3e669d,JSON['stringify'](_0x43ed9b));_0x1d774f[_0x76d3('0x31')]();}};}; \ 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 f710928..fccc7f9 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 _0xb76e=['service','port','secure','user','pass','html','replace','','headers','auto-replied','auto_reply','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','messageId','create','stringify','catch','error','[RPC][%s][AUTOREPLY]\x20%s','Interaction','update','[%s][AUTOREPLY][autoreplyExecuted]\x20%s','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','finally','resolve','stop','lodash','moment','../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/whatsappInteraction','channel','mail','body','isAutoreply','[%s][AUTOREPLY]\x20%s','Autoreply\x20not\x20executed\x20(message\x20is\x20autoreply)','next','isNil','interaction','created','info','Autoreply\x20already\x20sent','autoreplyExecuted','One\x20Time\x20already\x20sent','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','getMustacheRender','message','from','phone','read','subject','startsWith','Re:\x20','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','Message','Smtp'];(function(_0x4913f1,_0x2564ac){var _0x45710f=function(_0x441312){while(--_0x441312){_0x4913f1['push'](_0x4913f1['shift']());}};_0x45710f(++_0x2564ac);}(_0xb76e,0x137));var _0xeb76=function(_0x4c7e3f,_0xe430d6){_0x4c7e3f=_0x4c7e3f-0x0;var _0x252e30=_0xb76e[_0x4c7e3f];return _0x252e30;};'use strict';var _=require(_0xeb76('0x0'));var moment=require(_0xeb76('0x1'));var utils=require('./utils');var logger=require(_0xeb76('0x2'))(_0xeb76('0x3'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0xeb76('0x4')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0xeb76('0x5')),'faxMessage':require(_0xeb76('0x6')),'whatsappMessage':require('../../rpc/whatsappMessage'),'chatInteraction':require(_0xeb76('0x7')),'openchannelInteraction':require(_0xeb76('0x8')),'mailInteraction':require('../../rpc/mailInteraction'),'smsInteraction':require('../../rpc/smsInteraction'),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0xeb76('0x9'))};var mailRpc=require('../../mailRpc');exports['consequence']=function(_0x532215,_0x488ce2,_0x47c5db,_0x43159){return function(_0x53e5d7){try{var _0x1eee75=this[_0xeb76('0xa')];if(_0x1eee75===_0xeb76('0xb')&&_0x43159[_0xeb76('0xc')][_0xeb76('0xd')]){logger['info'](_0xeb76('0xe'),_0x532215,_0xeb76('0xf'));return _0x53e5d7[_0xeb76('0x10')]();}if(_0x488ce2[0x0]==='1'&&(_[_0xeb76('0x11')](this[_0xeb76('0x12')][_0xeb76('0x13')])||!this[_0xeb76('0x12')]['created'])){logger[_0xeb76('0x14')](_0xeb76('0xe'),_0x532215,_0xeb76('0x15'));return _0x53e5d7[_0xeb76('0x10')]();}if(_0x488ce2[0x0]==='2'&&this[_0xeb76('0x12')][_0xeb76('0x16')]){logger[_0xeb76('0x14')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0x532215,_0xeb76('0x17'));return _0x53e5d7[_0xeb76('0x10')]();}var _0x41b5b5={'ContactId':this[_0xeb76('0x18')]['id'],'sentAt':moment()[_0xeb76('0x19')](_0xeb76('0x1a')),'direction':_0xeb76('0x1b')};if(this[_0xeb76('0xa')]===_0xeb76('0xb')){_0x41b5b5[_0xeb76('0xc')]=utils[_0xeb76('0x1c')](_0x488ce2[0x2],this);}else{_0x41b5b5[_0xeb76('0xc')]=utils[_0xeb76('0x1c')](_0x488ce2[0x1],this);}if(this[_0xeb76('0x1d')]){_0x41b5b5['to']=this[_0xeb76('0x1d')][_0xeb76('0x1e')]||'';if(this[_0xeb76('0xa')]==='mail'&&_0x488ce2[0x1]==='1'){_0x41b5b5['cc']=this[_0xeb76('0x1d')]['cc']||'';}_0x41b5b5[_0xeb76('0x1e')]=this['message']['to']||'';_0x41b5b5['phone']=this['message'][_0xeb76('0x1f')]||'';_0x41b5b5[_0xeb76('0x20')]=!![];if(this[_0xeb76('0x1d')][_0xeb76('0x21')]){_0x41b5b5[_0xeb76('0x21')]='';_0x41b5b5[_0xeb76('0x21')]+=_[_0xeb76('0x22')](this[_0xeb76('0x1d')]['subject'],'Re:')?'':_0xeb76('0x23');_0x41b5b5[_0xeb76('0x21')]+=this[_0xeb76('0x1d')][_0xeb76('0x21')];}}if(this[_0xeb76('0xa')]===_0xeb76('0x24')){_0x41b5b5[_0xeb76('0x25')]=this[_0xeb76('0x26')]['id'];}else{_0x41b5b5[_[_0xeb76('0x27')](this[_0xeb76('0xa')])+_0xeb76('0x28')]=this[_0xeb76('0x26')]['id'];}_0x41b5b5[_[_0xeb76('0x27')](this[_0xeb76('0xa')])+_0xeb76('0x29')]=this[_0xeb76('0x12')]['id'];var _0x2615b1=this[_0xeb76('0x12')];if(rpc[this[_0xeb76('0xa')]+_0xeb76('0x2a')]){if(this[_0xeb76('0xa')]===_0xeb76('0xb')){var _0x291bcf={'tls':{'rejectUnauthorized':![]}};if(this[_0xeb76('0x26')][_0xeb76('0x2b')][_0xeb76('0x2c')]){_0x291bcf[_0xeb76('0x2c')]=this[_0xeb76('0x26')]['Smtp'][_0xeb76('0x2c')];}else{_0x291bcf['host']=this[_0xeb76('0x26')][_0xeb76('0x2b')]['host'];_0x291bcf[_0xeb76('0x2d')]=this[_0xeb76('0x26')][_0xeb76('0x2b')][_0xeb76('0x2d')];_0x291bcf[_0xeb76('0x2e')]=this['account'][_0xeb76('0x2b')][_0xeb76('0x2e')];}if(this[_0xeb76('0x26')][_0xeb76('0x2b')]['authentication']){_0x291bcf['auth']={'user':this[_0xeb76('0x26')][_0xeb76('0x2b')][_0xeb76('0x2f')],'pass':this[_0xeb76('0x26')]['Smtp'][_0xeb76('0x30')]};}_0x41b5b5['inReplyTo']=this['message']['messageId'];_0x41b5b5[_0xeb76('0x31')]=''+_[_0xeb76('0x32')](_0x41b5b5[_0xeb76('0xc')],_0xeb76('0x33'),'','replace','','headers','auto-replied','All','sendMailMessage','then','messageId','stringify','catch','error','finally','autoreplyExecuted','update','[RPC][%s][AUTOREPLY][autoreplyExecuted]\x20%s','create','resolve','Interaction','stop','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcad5,0x95));var _0x5cad=function(_0x88dcaa,_0x73ad50){_0x88dcaa=_0x88dcaa-0x0;var _0x508f09=_0xcad5[_0x88dcaa];return _0x508f09;};'use strict';var _=require('lodash');var moment=require(_0x5cad('0x0'));var utils=require('./utils');var logger=require(_0x5cad('0x1'))(_0x5cad('0x2'));var rpc={'chatMessage':require(_0x5cad('0x3')),'openchannelMessage':require(_0x5cad('0x4')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x5cad('0x5')),'faxMessage':require(_0x5cad('0x6')),'whatsappMessage':require(_0x5cad('0x7')),'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0x5cad('0x8')),'mailInteraction':require(_0x5cad('0x9')),'smsInteraction':require(_0x5cad('0xa')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require('../../rpc/whatsappInteraction')};var mailRpc=require(_0x5cad('0xb'));exports[_0x5cad('0xc')]=function(_0xbdb068,_0x3ce8b1,_0x40b915,_0x466a02){return function(_0x115c0c){try{var _0x54a48a=this[_0x5cad('0xd')];if(_0x54a48a==='mail'&&_0x466a02[_0x5cad('0xe')][_0x5cad('0xf')]){logger['info']('[%s][AUTOREPLY]\x20%s',_0xbdb068,_0x5cad('0x10'));return _0x115c0c[_0x5cad('0x11')]();}if(_0x3ce8b1[0x0]==='1'&&(_['isNil'](this[_0x5cad('0x12')]['created'])||!this[_0x5cad('0x12')]['created'])){logger[_0x5cad('0x13')](_0x5cad('0x14'),_0xbdb068,_0x5cad('0x15'));return _0x115c0c[_0x5cad('0x11')]();}if(_0x3ce8b1[0x0]==='2'&&this[_0x5cad('0x12')]['autoreplyExecuted']){logger['info'](_0x5cad('0x16'),_0xbdb068,_0x5cad('0x17'));return _0x115c0c[_0x5cad('0x11')]();}var _0x587e74={'ContactId':this[_0x5cad('0x18')]['id'],'sentAt':moment()['format'](_0x5cad('0x19')),'direction':_0x5cad('0x1a')};if(this[_0x5cad('0xd')]===_0x5cad('0x1b')){_0x587e74['body']=utils[_0x5cad('0x1c')](_0x3ce8b1[0x2],this);}else{_0x587e74[_0x5cad('0xe')]=utils[_0x5cad('0x1c')](_0x3ce8b1[0x1],this);}if(this[_0x5cad('0x1d')]){_0x587e74['to']=this[_0x5cad('0x1d')]['from']||'';if(this[_0x5cad('0xd')]===_0x5cad('0x1b')&&_0x3ce8b1[0x1]==='1'){_0x587e74['cc']=this[_0x5cad('0x1d')]['cc']||'';}_0x587e74[_0x5cad('0x1e')]=this[_0x5cad('0x1d')]['to']||'';_0x587e74[_0x5cad('0x1f')]=this['message'][_0x5cad('0x1f')]||'';_0x587e74['read']=!![];if(this[_0x5cad('0x1d')][_0x5cad('0x20')]){_0x587e74[_0x5cad('0x20')]='';_0x587e74[_0x5cad('0x20')]+=_['startsWith'](this[_0x5cad('0x1d')][_0x5cad('0x20')],_0x5cad('0x21'))?'':_0x5cad('0x22');_0x587e74[_0x5cad('0x20')]+=this[_0x5cad('0x1d')][_0x5cad('0x20')];}}if(this['channel']===_0x5cad('0x23')){_0x587e74[_0x5cad('0x24')]=this[_0x5cad('0x25')]['id'];}else{_0x587e74[_['upperFirst'](this[_0x5cad('0xd')])+_0x5cad('0x26')]=this['account']['id'];}_0x587e74[_[_0x5cad('0x27')](this[_0x5cad('0xd')])+_0x5cad('0x28')]=this[_0x5cad('0x12')]['id'];var _0x2cb5d3=this[_0x5cad('0x12')];if(rpc[this[_0x5cad('0xd')]+_0x5cad('0x29')]){if(this['channel']===_0x5cad('0x1b')){var _0x23aa86={'tls':{'rejectUnauthorized':![]}};if(this['account'][_0x5cad('0x2a')]['service']){_0x23aa86[_0x5cad('0x2b')]=this[_0x5cad('0x25')][_0x5cad('0x2a')][_0x5cad('0x2b')];}else{_0x23aa86[_0x5cad('0x2c')]=this[_0x5cad('0x25')][_0x5cad('0x2a')]['host'];_0x23aa86[_0x5cad('0x2d')]=this['account'][_0x5cad('0x2a')][_0x5cad('0x2d')];_0x23aa86[_0x5cad('0x2e')]=this[_0x5cad('0x25')][_0x5cad('0x2a')][_0x5cad('0x2e')];}if(this[_0x5cad('0x25')][_0x5cad('0x2a')][_0x5cad('0x2f')]){_0x23aa86[_0x5cad('0x30')]={'user':this[_0x5cad('0x25')][_0x5cad('0x2a')][_0x5cad('0x31')],'pass':this[_0x5cad('0x25')][_0x5cad('0x2a')][_0x5cad('0x32')]};}_0x587e74[_0x5cad('0x33')]=this[_0x5cad('0x1d')]['messageId'];_0x587e74[_0x5cad('0x34')]=_0x5cad('0x35')+_[_0x5cad('0x36')](_0x587e74[_0x5cad('0xe')],_0x5cad('0x37'),_0x5cad('0x38'))+_0x5cad('0x39');_0x587e74[_0x5cad('0x3a')]={'Auto-Submitted':_0x5cad('0x3b'),'X-Auto-Response-Suppress':_0x5cad('0x3c'),'Precedence':'auto_reply'};return mailRpc[_0x5cad('0x3d')](_0x23aa86,_0x587e74)[_0x5cad('0x3e')](function(_0x2fbb06){logger['info']('[%s][AUTOREPLY]\x20SMTP\x20SENT',_0xbdb068);_0x587e74[_0x5cad('0x3f')]=_0x2fbb06[_0x5cad('0x1d')]['messageId'];return rpc[_0x54a48a+_0x5cad('0x29')]['create'](_0x587e74);})['then'](function(_0x28fd1f){logger[_0x5cad('0x13')](_0x5cad('0x14'),_0xbdb068,JSON[_0x5cad('0x40')](_0x28fd1f));})[_0x5cad('0x41')](function(_0x1615a1){logger[_0x5cad('0x42')]('[RPC][%s][AUTOREPLY]\x20%s',_0xbdb068,JSON[_0x5cad('0x40')](_0x1615a1));})[_0x5cad('0x43')](function(){Promise['resolve']()[_0x5cad('0x3e')](function(){if(_0x3ce8b1[0x0]!=='2'||_0x2cb5d3[_0x5cad('0x44')])return;return rpc[_0x54a48a+'Interaction'][_0x5cad('0x45')](_0x2cb5d3['id'],{'autoreplyExecuted':!![]})[_0x5cad('0x3e')](function(_0x304d2e){logger[_0x5cad('0x13')]('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0xbdb068,JSON[_0x5cad('0x40')](_0x304d2e));})[_0x5cad('0x41')](function(_0x4eae84){logger[_0x5cad('0x42')](_0x5cad('0x46'),_0xbdb068,JSON['stringify'](_0x4eae84));});})[_0x5cad('0x3e')](function(){_0x115c0c['next']();});});}else{return rpc[this[_0x5cad('0xd')]+_0x5cad('0x29')][_0x5cad('0x47')](_0x587e74)[_0x5cad('0x3e')](function(_0x4feadb){logger['info'](_0x5cad('0x14'),_0xbdb068,_0x587e74[_0x5cad('0xe')]);})[_0x5cad('0x41')](function(_0x20969a){logger[_0x5cad('0x42')]('[%s][AUTOREPLY]\x20%s',_0xbdb068,JSON[_0x5cad('0x40')](_0x20969a));})[_0x5cad('0x43')](function(){Promise[_0x5cad('0x48')]()[_0x5cad('0x3e')](function(){if(_0x3ce8b1[0x0]!=='2'||_0x2cb5d3[_0x5cad('0x44')])return;return rpc[_0x54a48a+_0x5cad('0x49')][_0x5cad('0x45')](_0x2cb5d3['id'],{'autoreplyExecuted':!![]})[_0x5cad('0x3e')](function(_0x27cd86){logger['info']('[%s][AUTOREPLY][autoreplyExecuted]\x20%s',_0xbdb068,JSON[_0x5cad('0x40')](_0x27cd86));})['catch'](function(_0x3fa2e7){logger[_0x5cad('0x42')](_0x5cad('0x46'),_0xbdb068,JSON[_0x5cad('0x40')](_0x3fa2e7));});})[_0x5cad('0x3e')](function(){_0x115c0c[_0x5cad('0x11')]();});});}}}catch(_0x38f5b6){logger[_0x5cad('0x42')](_0x5cad('0x14'),_0xbdb068,JSON[_0x5cad('0x40')](_0x38f5b6));_0x115c0c[_0x5cad('0x4a')]();}};}; \ 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 5150ff9..effd8d7 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 _0xe4f9=['stop','routing','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','consequence','[%s][CLOSE]\x20reason\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','system','channel','Interaction','update','interaction','then','info','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','error','[%s][CLOSE]\x20%s','stringify','finally'];(function(_0x557ba5,_0x55735b){var _0x4c7d96=function(_0x4ed4d8){while(--_0x4ed4d8){_0x557ba5['push'](_0x557ba5['shift']());}};_0x4c7d96(++_0x55735b);}(_0xe4f9,0xbe));var _0x9e4f=function(_0x553618,_0x33000e){_0x553618=_0x553618-0x0;var _0x3a99ab=_0xe4f9[_0x553618];return _0x3a99ab;};'use strict';var moment=require('moment');var logger=require('../../../../config/logger')(_0x9e4f('0x0'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0x9e4f('0x1')),'smsInteraction':require(_0x9e4f('0x2')),'mailInteraction':require(_0x9e4f('0x3')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require('../../rpc/whatsappInteraction')};exports[_0x9e4f('0x4')]=function(_0x24c411,_0x17d788,_0x579a56,_0x4abc16){return function(_0x43a11f){try{logger['info'](_0x9e4f('0x5'),_0x24c411,_0x17d788[0x0]);var _0x4a42c2={'closed':0x1,'closedAt':moment()[_0x9e4f('0x6')](_0x9e4f('0x7')),'closeReason':_0x9e4f('0x8'),'disposition':_0x17d788[0x0]};if(rpc[_0x4abc16[_0x9e4f('0x9')]+'Interaction']){rpc[_0x4abc16[_0x9e4f('0x9')]+_0x9e4f('0xa')][_0x9e4f('0xb')](_0x4abc16[_0x9e4f('0xc')]['id'],_0x4a42c2)[_0x9e4f('0xd')](function(_0x27c688){logger[_0x9e4f('0xe')](_0x9e4f('0xf'),_0x24c411,_0x4abc16[_0x9e4f('0xc')]['id']);})['catch'](function(_0x5c0cb5){logger[_0x9e4f('0x10')](_0x9e4f('0x11'),_0x24c411,JSON[_0x9e4f('0x12')](_0x5c0cb5));})[_0x9e4f('0x13')](function(){_0x43a11f[_0x9e4f('0x14')]();});}}catch(_0x2f1e99){logger[_0x9e4f('0x10')](_0x9e4f('0x11'),_0x24c411,JSON[_0x9e4f('0x12')](_0x2f1e99));_0x43a11f[_0x9e4f('0x14')]();}};}; \ No newline at end of file +var _0x86fa=['format','YYYY-MM-DD\x20HH:mm:ss','channel','Interaction','update','interaction','then','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','error','[%s][CLOSE]\x20%s','stringify','finally','stop','moment','routing','../../rpc/chatInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/whatsappInteraction','info'];(function(_0x18a79d,_0x57bd2c){var _0x4f8848=function(_0x28af80){while(--_0x28af80){_0x18a79d['push'](_0x18a79d['shift']());}};_0x4f8848(++_0x57bd2c);}(_0x86fa,0x125));var _0xa86f=function(_0x1e18e8,_0x566d5f){_0x1e18e8=_0x1e18e8-0x0;var _0x392e81=_0x86fa[_0x1e18e8];return _0x392e81;};'use strict';var moment=require(_0xa86f('0x0'));var logger=require('../../../../config/logger')(_0xa86f('0x1'));var rpc={'chatInteraction':require(_0xa86f('0x2')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0xa86f('0x3')),'mailInteraction':require(_0xa86f('0x4')),'faxInteraction':require('../../rpc/faxInteraction'),'whatsappInteraction':require(_0xa86f('0x5'))};exports['consequence']=function(_0x30bb4d,_0x1ba7cf,_0x5627a3,_0xaea27d){return function(_0x120722){try{logger[_0xa86f('0x6')]('[%s][CLOSE]\x20reason\x20%s',_0x30bb4d,_0x1ba7cf[0x0]);var _0x15d9e8={'closed':0x1,'closedAt':moment()[_0xa86f('0x7')](_0xa86f('0x8')),'closeReason':'system','disposition':_0x1ba7cf[0x0]};if(rpc[_0xaea27d[_0xa86f('0x9')]+_0xa86f('0xa')]){rpc[_0xaea27d['channel']+_0xa86f('0xa')][_0xa86f('0xb')](_0xaea27d[_0xa86f('0xc')]['id'],_0x15d9e8)[_0xa86f('0xd')](function(_0x339e42){logger['info'](_0xa86f('0xe'),_0x30bb4d,_0xaea27d['interaction']['id']);})['catch'](function(_0x4630ec){logger[_0xa86f('0xf')](_0xa86f('0x10'),_0x30bb4d,JSON[_0xa86f('0x11')](_0x4630ec));})[_0xa86f('0x12')](function(){_0x120722[_0xa86f('0x13')]();});}}catch(_0x629a7b){logger[_0xa86f('0xf')](_0xa86f('0x10'),_0x30bb4d,JSON[_0xa86f('0x11')](_0x629a7b));_0x120722['stop']();}};}; \ 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 c8d3569..ccfa6d0 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 _0xab9f=['channel','sms','whatsapp','phone','ChatWebsiteId','account','upperFirst','AccountId','created','body','Message','create','then','info','catch','error','[%s][DIALOGFLOW]\x20%s','stringify','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','textRequest','dialogflow','result','fulfillment','speech','providerName','providerResponse','metadata','endConversation','message','lodash','apiai-promise','md5','./utils','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/faxMessage','consequence','interaction','UserId','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','out'];(function(_0x127d07,_0x8bea8e){var _0x5e54ef=function(_0x558ce6){while(--_0x558ce6){_0x127d07['push'](_0x127d07['shift']());}};_0x5e54ef(++_0x8bea8e);}(_0xab9f,0x1bd));var _0xfab9=function(_0x2fe7f5,_0x3ec1db){_0x2fe7f5=_0x2fe7f5-0x0;var _0x106f34=_0xab9f[_0x2fe7f5];return _0x106f34;};'use strict';var _=require(_0xfab9('0x0'));var moment=require('moment');var apiai=require(_0xfab9('0x1'));var md5=require(_0xfab9('0x2'));var utils=require(_0xfab9('0x3'));var logger=require('../../../../config/logger')(_0xfab9('0x4'));var rpc={'chatMessage':require(_0xfab9('0x5')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0xfab9('0x6')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0xfab9('0x7')),'whatsappMessage':require('../../rpc/whatsappMessage')};exports[_0xfab9('0x8')]=function(_0x341aaf,_0x1918e4){return function(_0x27e769){try{if(!_['isNil'](this[_0xfab9('0x9')][_0xfab9('0xa')])){logger['info']('[%s][DIALOGFLOW]\x20%s',_0x341aaf,_0xfab9('0xb'));return _0x27e769[_0xfab9('0xc')]();}var _0xcc59f9={'ContactId':this[_0xfab9('0xd')]['id'],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0xfab9('0xe')};if(this[_0xfab9('0xf')]===_0xfab9('0x10')||this[_0xfab9('0xf')]===_0xfab9('0x11')){_0xcc59f9[_0xfab9('0x12')]=this[_0xfab9('0x9')][_0xfab9('0x12')];}var _0x3a39c0=this[_0xfab9('0xf')];if(_0x3a39c0==='chat'){_0xcc59f9[_0xfab9('0x13')]=this[_0xfab9('0x14')]['id'];}else{_0xcc59f9[_[_0xfab9('0x15')](_0x3a39c0)+_0xfab9('0x16')]=this[_0xfab9('0x14')]['id'];}_0xcc59f9[_[_0xfab9('0x15')](_0x3a39c0)+'InteractionId']=this[_0xfab9('0x9')]['id'];if(this[_0xfab9('0x9')][_0xfab9('0x17')]){var _0x479db4=_0x1918e4[0x2];if(!_['isEmpty'](_0x479db4)){_0xcc59f9[_0xfab9('0x18')]=utils['getMustacheRender'](_0x479db4,this);return rpc[_0x3a39c0+_0xfab9('0x19')][_0xfab9('0x1a')](_0xcc59f9)[_0xfab9('0x1b')](function(_0x41509f){logger[_0xfab9('0x1c')]('[%s][DIALOGFLOW]\x20%s',_0x341aaf,_0xcc59f9[_0xfab9('0x18')]);})[_0xfab9('0x1d')](function(_0x3f3180){logger[_0xfab9('0x1e')](_0xfab9('0x1f'),_0x341aaf,JSON[_0xfab9('0x20')](_0x3f3180));})[_0xfab9('0x21')](function(){logger[_0xfab9('0x1c')](_0xfab9('0x22'),_0x341aaf);_0x27e769[_0xfab9('0x23')]();});}else{logger[_0xfab9('0x1c')]('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x341aaf);_0x27e769[_0xfab9('0x23')]();}}else{var _0x2ba794=this;var _0x39ef03=apiai(_0x1918e4[0x0],{'language':_0x1918e4[0x1]||'en'});return _0x39ef03[_0xfab9('0x24')](this['message'][_0xfab9('0x18')],{'sessionId':md5(this[_0xfab9('0x9')]['id'])})[_0xfab9('0x1b')](function(_0x1dd605){_0x2ba794[_0xfab9('0x18')][_0xfab9('0x25')]=_0x1dd605;_0xcc59f9[_0xfab9('0x18')]=_0x1dd605[_0xfab9('0x26')][_0xfab9('0x27')][_0xfab9('0x28')];_0xcc59f9[_0xfab9('0x29')]=_0xfab9('0x25');_0xcc59f9[_0xfab9('0x2a')]=JSON[_0xfab9('0x20')](_0x1dd605);return rpc[_0x3a39c0+_0xfab9('0x19')][_0xfab9('0x1a')](_0xcc59f9)['then'](function(_0x1bb377){logger[_0xfab9('0x1c')](_0xfab9('0x1f'),_0x341aaf,_0xcc59f9[_0xfab9('0x18')]);if(_0x1dd605['result'][_0xfab9('0x2b')][_0xfab9('0x2c')]){_0x27e769[_0xfab9('0xc')]();}else{_0x27e769[_0xfab9('0x23')]();}})[_0xfab9('0x1d')](function(_0x155440){logger[_0xfab9('0x1e')](_0xfab9('0x1f'),_0x341aaf,JSON[_0xfab9('0x20')](_0x155440));_0x27e769[_0xfab9('0xc')]();});})[_0xfab9('0x1d')](function(_0x34b04e){logger[_0xfab9('0x1e')](_0xfab9('0x1f'),_0x341aaf,_0x34b04e[_0xfab9('0x2d')]);_0x27e769[_0xfab9('0xc')]();});}}catch(_0x10cca4){logger[_0xfab9('0x1e')](_0xfab9('0x1f'),_0x341aaf,JSON[_0xfab9('0x20')](_0x10cca4));_0x27e769[_0xfab9('0x23')]();}};}; \ No newline at end of file +var _0xcbd3=['catch','lodash','moment','apiai-promise','md5','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','interaction','UserId','info','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','format','YYYY-MM-DD\x20HH:mm:ss','out','sms','channel','whatsapp','phone','upperFirst','InteractionId','created','body','getMustacheRender','Message','error','stringify','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','textRequest','message','dialogflow','result','fulfillment','speech','providerName','providerResponse','create','then','endConversation','next'];(function(_0x207dcd,_0x190164){var _0x3b8bd8=function(_0x587c35){while(--_0x587c35){_0x207dcd['push'](_0x207dcd['shift']());}};_0x3b8bd8(++_0x190164);}(_0xcbd3,0x1eb));var _0x3cbd=function(_0x528c56,_0xa1fef8){_0x528c56=_0x528c56-0x0;var _0x1a2f45=_0xcbd3[_0x528c56];return _0x1a2f45;};'use strict';var _=require(_0x3cbd('0x0'));var moment=require(_0x3cbd('0x1'));var apiai=require(_0x3cbd('0x2'));var md5=require(_0x3cbd('0x3'));var utils=require(_0x3cbd('0x4'));var logger=require(_0x3cbd('0x5'))(_0x3cbd('0x6'));var rpc={'chatMessage':require(_0x3cbd('0x7')),'openchannelMessage':require(_0x3cbd('0x8')),'mailMessage':require(_0x3cbd('0x9')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x3cbd('0xa')),'whatsappMessage':require(_0x3cbd('0xb'))};exports['consequence']=function(_0x372e19,_0x4e006f){return function(_0x25420f){try{if(!_['isNil'](this[_0x3cbd('0xc')][_0x3cbd('0xd')])){logger[_0x3cbd('0xe')](_0x3cbd('0xf'),_0x372e19,_0x3cbd('0x10'));return _0x25420f['next']();}var _0x37934c={'ContactId':this['contact']['id'],'sentAt':moment()[_0x3cbd('0x11')](_0x3cbd('0x12')),'direction':_0x3cbd('0x13')};if(this['channel']===_0x3cbd('0x14')||this[_0x3cbd('0x15')]===_0x3cbd('0x16')){_0x37934c[_0x3cbd('0x17')]=this['interaction']['phone'];}var _0xc90a9a=this[_0x3cbd('0x15')];if(_0xc90a9a==='chat'){_0x37934c['ChatWebsiteId']=this['account']['id'];}else{_0x37934c[_[_0x3cbd('0x18')](_0xc90a9a)+'AccountId']=this['account']['id'];}_0x37934c[_[_0x3cbd('0x18')](_0xc90a9a)+_0x3cbd('0x19')]=this[_0x3cbd('0xc')]['id'];if(this[_0x3cbd('0xc')][_0x3cbd('0x1a')]){var _0x1114b9=_0x4e006f[0x2];if(!_['isEmpty'](_0x1114b9)){_0x37934c[_0x3cbd('0x1b')]=utils[_0x3cbd('0x1c')](_0x1114b9,this);return rpc[_0xc90a9a+_0x3cbd('0x1d')]['create'](_0x37934c)['then'](function(_0x1727dd){logger['info'](_0x3cbd('0xf'),_0x372e19,_0x37934c[_0x3cbd('0x1b')]);})['catch'](function(_0x5e40e5){logger[_0x3cbd('0x1e')](_0x3cbd('0xf'),_0x372e19,JSON[_0x3cbd('0x1f')](_0x5e40e5));})[_0x3cbd('0x20')](function(){logger[_0x3cbd('0xe')](_0x3cbd('0x21'),_0x372e19);_0x25420f[_0x3cbd('0x22')]();});}else{logger[_0x3cbd('0xe')](_0x3cbd('0x23'),_0x372e19);_0x25420f['stop']();}}else{var _0x543b51=this;var _0x375f0d=apiai(_0x4e006f[0x0],{'language':_0x4e006f[0x1]||'en'});return _0x375f0d[_0x3cbd('0x24')](this[_0x3cbd('0x25')][_0x3cbd('0x1b')],{'sessionId':md5(this[_0x3cbd('0xc')]['id'])})['then'](function(_0x420c46){_0x543b51[_0x3cbd('0x1b')][_0x3cbd('0x26')]=_0x420c46;_0x37934c[_0x3cbd('0x1b')]=_0x420c46[_0x3cbd('0x27')][_0x3cbd('0x28')][_0x3cbd('0x29')];_0x37934c[_0x3cbd('0x2a')]=_0x3cbd('0x26');_0x37934c[_0x3cbd('0x2b')]=JSON[_0x3cbd('0x1f')](_0x420c46);return rpc[_0xc90a9a+_0x3cbd('0x1d')][_0x3cbd('0x2c')](_0x37934c)[_0x3cbd('0x2d')](function(_0x494734){logger[_0x3cbd('0xe')](_0x3cbd('0xf'),_0x372e19,_0x37934c[_0x3cbd('0x1b')]);if(_0x420c46[_0x3cbd('0x27')]['metadata'][_0x3cbd('0x2e')]){_0x25420f[_0x3cbd('0x2f')]();}else{_0x25420f[_0x3cbd('0x22')]();}})['catch'](function(_0x25a1da){logger['error'](_0x3cbd('0xf'),_0x372e19,JSON[_0x3cbd('0x1f')](_0x25a1da));_0x25420f[_0x3cbd('0x2f')]();});})[_0x3cbd('0x30')](function(_0x48029b){logger[_0x3cbd('0x1e')](_0x3cbd('0xf'),_0x372e19,_0x48029b[_0x3cbd('0x25')]);_0x25420f[_0x3cbd('0x2f')]();});}}catch(_0x32d2c9){logger['error']('[%s][DIALOGFLOW]\x20%s',_0x372e19,JSON[_0x3cbd('0x1f')](_0x32d2c9));_0x25420f['stop']();}};}; \ 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 fff6463..1a66386 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 _0x28a2=['stringify','consequence','isNil','interaction','UserId','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','phone','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','catch','error','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','SessionsClient','sessionPath','detectIntent','length','dialogflowV2','queryResult','diagnosticInfo','fields','end_conversation','boolValue','DIALOGFLOWV2_ACTION','action','allRequiredParamsPresent','DIALOGFLOWV2_INTENTNAME','intent','DIALOGFLOWV2_INTENTDISPLAYNAME','displayName','DIALOGFLOWV2_ISFALLBACKINTENT','isFallback','DIALOGFLOWV2_QUERYTEXT','queryText','intentDetectionConfidence','providerResponse','fulfillmentText','push','all','lodash','dialogflow','md5','moment','bluebird','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','clone','body','Message','create','then','info','[%s][DIALOGFLOWV2]\x20%s'];(function(_0x4495e2,_0x297a68){var _0x26d6c8=function(_0x4945b2){while(--_0x4945b2){_0x4495e2['push'](_0x4495e2['shift']());}};_0x26d6c8(++_0x297a68);}(_0x28a2,0x141));var _0x228a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x28a2[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x228a('0x0'));var dialogflow=require(_0x228a('0x1'));var md5=require(_0x228a('0x2'));var moment=require(_0x228a('0x3'));var Promise=require(_0x228a('0x4'));var logger=require(_0x228a('0x5'))(_0x228a('0x6'));var utils=require('./utils');var rpc={'chatMessage':require(_0x228a('0x7')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x228a('0x8')),'smsMessage':require(_0x228a('0x9')),'faxMessage':require(_0x228a('0xa')),'whatsappMessage':require(_0x228a('0xb'))};function createMessage(_0x100a6a,_0x484c54,_0x270d15,_0x7767ab){return new Promise(function(_0x105317,_0x20494b){var _0x57acb6=_[_0x228a('0xc')](_0x270d15);_0x57acb6[_0x228a('0xd')]=_0x7767ab;return rpc[_0x484c54+_0x228a('0xe')][_0x228a('0xf')](_0x57acb6)[_0x228a('0x10')](function(){logger[_0x228a('0x11')](_0x228a('0x12'),_0x100a6a,_0x57acb6[_0x228a('0xd')]);_0x105317();})['catch'](function(_0x4e685c){logger['error'](_0x228a('0x12'),_0x100a6a,JSON[_0x228a('0x13')](_0x4e685c));_0x20494b(_0x4e685c);});});}exports[_0x228a('0x14')]=function(_0x128af1,_0x23d138){return function(_0x561324){try{if(!_[_0x228a('0x15')](this[_0x228a('0x16')][_0x228a('0x17')])){logger['info']('[%s][DIALOGFLOWV2]\x20%s',_0x128af1,_0x228a('0x18'));return _0x561324[_0x228a('0x19')]();}var _0x11ffa3={'ContactId':this[_0x228a('0x1a')]['id'],'sentAt':moment()[_0x228a('0x1b')](_0x228a('0x1c')),'direction':_0x228a('0x1d')};if(this[_0x228a('0x1e')]==='sms'||this[_0x228a('0x1e')]==='whatsapp'){_0x11ffa3[_0x228a('0x1f')]=this[_0x228a('0x16')][_0x228a('0x1f')];}var _0x18004e=this['channel'];if(_0x18004e==='chat'){_0x11ffa3[_0x228a('0x20')]=this[_0x228a('0x21')]['id'];}else{_0x11ffa3[_[_0x228a('0x22')](_0x18004e)+_0x228a('0x23')]=this[_0x228a('0x21')]['id'];}_0x11ffa3[_[_0x228a('0x22')](_0x18004e)+_0x228a('0x24')]=this[_0x228a('0x16')]['id'];if(this[_0x228a('0x16')]['created']){var _0x2cd403=_0x23d138[0x4];if(!_['isEmpty'](_0x2cd403)){_0x11ffa3[_0x228a('0xd')]=utils['getMustacheRender'](_0x2cd403,this);return rpc[_0x18004e+_0x228a('0xe')][_0x228a('0xf')](_0x11ffa3)[_0x228a('0x10')](function(_0x2203b7){logger[_0x228a('0x11')](_0x228a('0x12'),_0x128af1,_0x11ffa3[_0x228a('0xd')]);})[_0x228a('0x25')](function(_0x149da9){logger[_0x228a('0x26')](_0x228a('0x12'),_0x128af1,JSON['stringify'](_0x149da9));})['finally'](function(){logger[_0x228a('0x11')](_0x228a('0x27'),_0x128af1);_0x561324[_0x228a('0x28')]();});}else{logger['info'](_0x228a('0x29'),_0x128af1);_0x561324[_0x228a('0x28')]();}}else{var _0x28e4d6=this;var _0x574820=_0x23d138[0x2]['replace'](/\\n/g,'\x0a');var _0x4d8c9e={'credentials':{'private_key':_0x574820,'client_email':_0x23d138[0x1]}};var _0x31d047=new dialogflow[(_0x228a('0x2a'))](_0x4d8c9e);var _0x4b5961=_0x31d047[_0x228a('0x2b')](_0x23d138[0x0],md5(_0x28e4d6[_0x228a('0x16')]['id']));var _0x52995b={'session':_0x4b5961,'queryInput':{'text':{'text':_0x28e4d6['message'][_0x228a('0xd')],'languageCode':_0x23d138[0x3]||'en'}}};return _0x31d047[_0x228a('0x2c')](_0x52995b)['then'](function(_0x4be255){if(_0x4be255&&_0x4be255[_0x228a('0x2d')]){_0x28e4d6['body'][_0x228a('0x2e')]=_0x4be255;var _0x79dd28=_0x4be255[0x0];var _0x32d874=_0x79dd28[_0x228a('0x2f')]['diagnosticInfo']&&_0x79dd28[_0x228a('0x2f')][_0x228a('0x30')]['fields']?_0x79dd28[_0x228a('0x2f')][_0x228a('0x30')][_0x228a('0x31')][_0x228a('0x32')][_0x228a('0x33')]:![];_0x28e4d6[_0x228a('0xd')][_0x228a('0x34')]=_0x79dd28[_0x228a('0x2f')][_0x228a('0x35')];_0x28e4d6[_0x228a('0xd')]['DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT']=_0x79dd28[_0x228a('0x2f')][_0x228a('0x36')];_0x28e4d6[_0x228a('0xd')]['DIALOGFLOWV2_ENDCONVERSATION']=_0x79dd28[_0x228a('0x2f')][_0x228a('0x30')]&&_0x79dd28[_0x228a('0x2f')][_0x228a('0x30')]['fields']?_0x79dd28['queryResult'][_0x228a('0x30')][_0x228a('0x31')]['end_conversation'][_0x228a('0x33')]:![];_0x28e4d6['body'][_0x228a('0x37')]=_0x79dd28[_0x228a('0x2f')][_0x228a('0x38')]['name'];_0x28e4d6[_0x228a('0xd')][_0x228a('0x39')]=_0x79dd28[_0x228a('0x2f')]['intent'][_0x228a('0x3a')];_0x28e4d6[_0x228a('0xd')][_0x228a('0x3b')]=_0x79dd28[_0x228a('0x2f')][_0x228a('0x38')][_0x228a('0x3c')];_0x28e4d6['body']['DIALOGFLOWV2_LANGUAGECODE']=_0x79dd28['queryResult']['languageCode'];_0x28e4d6[_0x228a('0xd')][_0x228a('0x3d')]=_0x79dd28[_0x228a('0x2f')][_0x228a('0x3e')];_0x28e4d6[_0x228a('0xd')]['DIALOGFLOWV2_SCORE']=_0x79dd28['queryResult'][_0x228a('0x3f')];_0x11ffa3['providerName']='dialogflowV2';_0x11ffa3[_0x228a('0x40')]=JSON['stringify'](_0x4be255);var _0x23f9d5=[];for(var _0x2bc2f7=0x0;_0x2bc2f7<_0x4be255[_0x228a('0x2d')];_0x2bc2f7++){var _0x639ca8=_0x4be255[_0x2bc2f7];if(_0x639ca8&&_0x639ca8[_0x228a('0x2f')]&&_0x639ca8[_0x228a('0x2f')][_0x228a('0x41')]){_0x23f9d5[_0x228a('0x42')](createMessage(_0x128af1,_0x18004e,_0x11ffa3,_0x639ca8[_0x228a('0x2f')][_0x228a('0x41')]));}}return Promise[_0x228a('0x43')](_0x23f9d5)[_0x228a('0x10')](function(){if(_0x32d874){_0x561324[_0x228a('0x19')]();}else{_0x561324[_0x228a('0x28')]();}})['catch'](function(_0x4e7015){logger[_0x228a('0x26')](_0x228a('0x12'),_0x128af1,JSON[_0x228a('0x13')](_0x4e7015));_0x561324[_0x228a('0x19')]();});}})[_0x228a('0x25')](function(_0x159bad){logger[_0x228a('0x26')](_0x228a('0x12'),_0x128af1,_0x159bad['message']);_0x561324[_0x228a('0x19')]();});}}catch(_0xc24006){logger[_0x228a('0x26')](_0x228a('0x12'),_0x128af1,JSON['stringify'](_0xc24006));_0x561324['stop']();}};}; \ No newline at end of file +var _0x7056=['isFallback','DIALOGFLOWV2_LANGUAGECODE','queryText','DIALOGFLOWV2_SCORE','intentDetectionConfidence','providerName','providerResponse','fulfillmentText','push','md5','bluebird','../../../../config/logger','routing','./utils','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','Message','create','then','[%s][DIALOGFLOWV2]\x20%s','body','catch','error','stringify','consequence','isNil','UserId','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','sms','phone','ChatWebsiteId','AccountId','account','upperFirst','InteractionId','interaction','created','getMustacheRender','info','finally','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOWV2]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','replace','SessionsClient','sessionPath','message','length','dialogflowV2','diagnosticInfo','queryResult','end_conversation','DIALOGFLOWV2_ACTION','DIALOGFLOWV2_ALLREQUIREDPARAMSPRESENT','allRequiredParamsPresent','fields','DIALOGFLOWV2_INTENTNAME','intent','name','DIALOGFLOWV2_INTENTDISPLAYNAME','displayName','DIALOGFLOWV2_ISFALLBACKINTENT'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x7056,0x1f3));var _0x6705=function(_0x17bed5,_0x182368){_0x17bed5=_0x17bed5-0x0;var _0x21e949=_0x7056[_0x17bed5];return _0x21e949;};'use strict';var _=require('lodash');var dialogflow=require('dialogflow');var md5=require(_0x6705('0x0'));var moment=require('moment');var Promise=require(_0x6705('0x1'));var logger=require(_0x6705('0x2'))(_0x6705('0x3'));var utils=require(_0x6705('0x4'));var rpc={'chatMessage':require(_0x6705('0x5')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x6705('0x6')),'smsMessage':require(_0x6705('0x7')),'faxMessage':require(_0x6705('0x8')),'whatsappMessage':require('../../rpc/whatsappMessage')};function createMessage(_0x214ae2,_0x31c4b3,_0xa862b1,_0xd0ae8e){return new Promise(function(_0x45b522,_0x385e5a){var _0x198663=_['clone'](_0xa862b1);_0x198663['body']=_0xd0ae8e;return rpc[_0x31c4b3+_0x6705('0x9')][_0x6705('0xa')](_0x198663)[_0x6705('0xb')](function(){logger['info'](_0x6705('0xc'),_0x214ae2,_0x198663[_0x6705('0xd')]);_0x45b522();})[_0x6705('0xe')](function(_0x3c3afd){logger[_0x6705('0xf')]('[%s][DIALOGFLOWV2]\x20%s',_0x214ae2,JSON[_0x6705('0x10')](_0x3c3afd));_0x385e5a(_0x3c3afd);});});}exports[_0x6705('0x11')]=function(_0x1011e3,_0x2fef49){return function(_0x4fe625){try{if(!_[_0x6705('0x12')](this['interaction'][_0x6705('0x13')])){logger['info'](_0x6705('0xc'),_0x1011e3,_0x6705('0x14'));return _0x4fe625[_0x6705('0x15')]();}var _0xb253f8={'ContactId':this[_0x6705('0x16')]['id'],'sentAt':moment()[_0x6705('0x17')](_0x6705('0x18')),'direction':_0x6705('0x19')};if(this[_0x6705('0x1a')]===_0x6705('0x1b')||this[_0x6705('0x1a')]==='whatsapp'){_0xb253f8[_0x6705('0x1c')]=this['interaction'][_0x6705('0x1c')];}var _0x356f93=this[_0x6705('0x1a')];if(_0x356f93==='chat'){_0xb253f8[_0x6705('0x1d')]=this['account']['id'];}else{_0xb253f8[_['upperFirst'](_0x356f93)+_0x6705('0x1e')]=this[_0x6705('0x1f')]['id'];}_0xb253f8[_[_0x6705('0x20')](_0x356f93)+_0x6705('0x21')]=this[_0x6705('0x22')]['id'];if(this['interaction'][_0x6705('0x23')]){var _0x2b4e87=_0x2fef49[0x4];if(!_['isEmpty'](_0x2b4e87)){_0xb253f8['body']=utils[_0x6705('0x24')](_0x2b4e87,this);return rpc[_0x356f93+_0x6705('0x9')]['create'](_0xb253f8)[_0x6705('0xb')](function(_0x2b0b19){logger[_0x6705('0x25')](_0x6705('0xc'),_0x1011e3,_0xb253f8[_0x6705('0xd')]);})[_0x6705('0xe')](function(_0x1829e0){logger[_0x6705('0xf')](_0x6705('0xc'),_0x1011e3,JSON['stringify'](_0x1829e0));})[_0x6705('0x26')](function(){logger[_0x6705('0x25')](_0x6705('0x27'),_0x1011e3);_0x4fe625[_0x6705('0x28')]();});}else{logger[_0x6705('0x25')](_0x6705('0x29'),_0x1011e3);_0x4fe625[_0x6705('0x28')]();}}else{var _0x250284=this;var _0x2916d6=_0x2fef49[0x2][_0x6705('0x2a')](/\\n/g,'\x0a');var _0x127779={'credentials':{'private_key':_0x2916d6,'client_email':_0x2fef49[0x1]}};var _0x2a12c7=new dialogflow[(_0x6705('0x2b'))](_0x127779);var _0xd9248d=_0x2a12c7[_0x6705('0x2c')](_0x2fef49[0x0],md5(_0x250284[_0x6705('0x22')]['id']));var _0x278bb9={'session':_0xd9248d,'queryInput':{'text':{'text':_0x250284[_0x6705('0x2d')][_0x6705('0xd')],'languageCode':_0x2fef49[0x3]||'en'}}};return _0x2a12c7['detectIntent'](_0x278bb9)['then'](function(_0x523eb6){if(_0x523eb6&&_0x523eb6[_0x6705('0x2e')]){_0x250284[_0x6705('0xd')][_0x6705('0x2f')]=_0x523eb6;var _0x5bc016=_0x523eb6[0x0];var _0x474d36=_0x5bc016['queryResult'][_0x6705('0x30')]&&_0x5bc016[_0x6705('0x31')][_0x6705('0x30')]['fields']?_0x5bc016[_0x6705('0x31')][_0x6705('0x30')]['fields'][_0x6705('0x32')]['boolValue']:![];_0x250284[_0x6705('0xd')][_0x6705('0x33')]=_0x5bc016[_0x6705('0x31')]['action'];_0x250284[_0x6705('0xd')][_0x6705('0x34')]=_0x5bc016['queryResult'][_0x6705('0x35')];_0x250284[_0x6705('0xd')]['DIALOGFLOWV2_ENDCONVERSATION']=_0x5bc016['queryResult'][_0x6705('0x30')]&&_0x5bc016[_0x6705('0x31')][_0x6705('0x30')]['fields']?_0x5bc016[_0x6705('0x31')][_0x6705('0x30')][_0x6705('0x36')][_0x6705('0x32')]['boolValue']:![];_0x250284[_0x6705('0xd')][_0x6705('0x37')]=_0x5bc016[_0x6705('0x31')][_0x6705('0x38')][_0x6705('0x39')];_0x250284[_0x6705('0xd')][_0x6705('0x3a')]=_0x5bc016[_0x6705('0x31')][_0x6705('0x38')][_0x6705('0x3b')];_0x250284['body'][_0x6705('0x3c')]=_0x5bc016[_0x6705('0x31')][_0x6705('0x38')][_0x6705('0x3d')];_0x250284[_0x6705('0xd')][_0x6705('0x3e')]=_0x5bc016['queryResult']['languageCode'];_0x250284[_0x6705('0xd')]['DIALOGFLOWV2_QUERYTEXT']=_0x5bc016['queryResult'][_0x6705('0x3f')];_0x250284[_0x6705('0xd')][_0x6705('0x40')]=_0x5bc016[_0x6705('0x31')][_0x6705('0x41')];_0xb253f8[_0x6705('0x42')]=_0x6705('0x2f');_0xb253f8[_0x6705('0x43')]=JSON[_0x6705('0x10')](_0x523eb6);var _0xfb4c0d=[];for(var _0x41f2cc=0x0;_0x41f2cc<_0x523eb6['length'];_0x41f2cc++){var _0x59d6c7=_0x523eb6[_0x41f2cc];if(_0x59d6c7&&_0x59d6c7[_0x6705('0x31')]&&_0x59d6c7[_0x6705('0x31')][_0x6705('0x44')]){_0xfb4c0d[_0x6705('0x45')](createMessage(_0x1011e3,_0x356f93,_0xb253f8,_0x59d6c7[_0x6705('0x31')][_0x6705('0x44')]));}}return Promise['all'](_0xfb4c0d)[_0x6705('0xb')](function(){if(_0x474d36){_0x4fe625[_0x6705('0x15')]();}else{_0x4fe625[_0x6705('0x28')]();}})[_0x6705('0xe')](function(_0x5a94b3){logger[_0x6705('0xf')](_0x6705('0xc'),_0x1011e3,JSON['stringify'](_0x5a94b3));_0x4fe625[_0x6705('0x15')]();});}})[_0x6705('0xe')](function(_0x58c187){logger['error']('[%s][DIALOGFLOWV2]\x20%s',_0x1011e3,_0x58c187[_0x6705('0x2d')]);_0x4fe625[_0x6705('0x15')]();});}}catch(_0x1b3a23){logger[_0x6705('0xf')](_0x6705('0xc'),_0x1011e3,JSON[_0x6705('0x10')](_0x1b3a23));_0x4fe625[_0x6705('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 3143e1f..63b107a 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 _0x05fb=['number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','consequence','error','map','message','join','stop','condition','priorityTrue','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','findIndex','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','[%s][GOTOIF]\x20eval\x20error:\x20%s','[%s][GOTOIF]\x20%s','stringify','validate','lodash','html-to-text','./utils','../../../../config/logger','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x05fb,0x19c));var _0xb05f=function(_0x59357a,_0x59443f){_0x59357a=_0x59357a-0x0;var _0x28c05e=_0x05fb[_0x59357a];return _0x28c05e;};'use strict';var schema=require(_0xb05f('0x0'));var _=require(_0xb05f('0x1'));var htmlToText=require(_0xb05f('0x2'));var utils=require(_0xb05f('0x3'));var logger=require(_0xb05f('0x4'))(_0xb05f('0x5'));var gotoif=schema({'condition':{'type':_0xb05f('0x6'),'required':!![],'message':_0xb05f('0x7')},'priorityTrue':{'type':_0xb05f('0x8'),'message':_0xb05f('0x9')},'priorityFalse':{'type':_0xb05f('0x8'),'message':_0xb05f('0xa')}});exports[_0xb05f('0xb')]=function(_0x8c0350,_0x40c6b8){return function(_0x250dc){try{var _0x4d59cf={'condition':htmlToText['fromString'](utils['getMustacheRender'](_0x40c6b8[0x0],this),{'wordwrap':![]})['replace'](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x40c6b8[0x1],'priorityFalse':_0x40c6b8[0x2]};var _0x220068=gotoif['validate'](_0x4d59cf,{'typecast':!![]});if(_0x220068['length']){logger[_0xb05f('0xc')]('[%s][GOTOIF]\x20%s',_0x8c0350,_[_0xb05f('0xd')](_0x220068,_0xb05f('0xe'))[_0xb05f('0xf')](',\x20'));_0x250dc[_0xb05f('0x10')]();}else{try{var _0x289b65=eval('('+_0x4d59cf[_0xb05f('0x11')]+')');var _0x16fa3e=_0x289b65?_0x4d59cf[_0xb05f('0x12')]:_0x4d59cf[_0xb05f('0x13')];logger[_0xb05f('0x14')](_0xb05f('0x15'),_0x8c0350,_0x4d59cf[_0xb05f('0x11')],_0x289b65,_0x16fa3e||_0xb05f('0x16'));if(_0x16fa3e){var _0x144ead=_[_0xb05f('0x17')](_0x250dc[_0xb05f('0x18')](),{'p':_0x16fa3e});if(_0x144ead>=0x0){logger[_0xb05f('0x14')](_0xb05f('0x19'),_0x8c0350,_0x16fa3e||'next',_0x144ead);_0x250dc['next'](_0x144ead);}else{logger[_0xb05f('0x14')](_0xb05f('0x1a'),_0x8c0350,_0x16fa3e||'next');_0x250dc[_0xb05f('0x10')]();}}else{_0x250dc[_0xb05f('0x16')]();}}catch(_0x42af3e){logger['error'](_0xb05f('0x1b'),_0x8c0350,_0x42af3e[_0xb05f('0xe')]);_0x250dc['stop']();}}}catch(_0xec2076){logger['error'](_0xb05f('0x1c'),_0x8c0350,JSON[_0xb05f('0x1d')](_0xec2076));_0x250dc['stop']();}};}; \ No newline at end of file +var _0x5add=['validate','html-to-text','routing','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','consequence','fromString','getMustacheRender','length','error','map','message','stop','condition','priorityTrue','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','[%s][GOTOIF]\x20eval\x20error:\x20%s','[%s][GOTOIF]\x20%s','stringify'];(function(_0x1db2e6,_0x2121ee){var _0xd4014=function(_0x3a5476){while(--_0x3a5476){_0x1db2e6['push'](_0x1db2e6['shift']());}};_0xd4014(++_0x2121ee);}(_0x5add,0x10e));var _0xd5ad=function(_0x48ae70,_0x463f02){_0x48ae70=_0x48ae70-0x0;var _0x2496b9=_0x5add[_0x48ae70];return _0x2496b9;};'use strict';var schema=require(_0xd5ad('0x0'));var _=require('lodash');var htmlToText=require(_0xd5ad('0x1'));var utils=require('./utils');var logger=require('../../../../config/logger')(_0xd5ad('0x2'));var gotoif=schema({'condition':{'type':'string','required':!![],'message':_0xd5ad('0x3')},'priorityTrue':{'type':_0xd5ad('0x4'),'message':_0xd5ad('0x5')},'priorityFalse':{'type':_0xd5ad('0x4'),'message':_0xd5ad('0x6')}});exports[_0xd5ad('0x7')]=function(_0x332a88,_0x1bc972){return function(_0x40dd83){try{var _0x4dc6b1={'condition':htmlToText[_0xd5ad('0x8')](utils[_0xd5ad('0x9')](_0x1bc972[0x0],this),{'wordwrap':![]})['replace'](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x1bc972[0x1],'priorityFalse':_0x1bc972[0x2]};var _0x461e86=gotoif[_0xd5ad('0x0')](_0x4dc6b1,{'typecast':!![]});if(_0x461e86[_0xd5ad('0xa')]){logger[_0xd5ad('0xb')]('[%s][GOTOIF]\x20%s',_0x332a88,_[_0xd5ad('0xc')](_0x461e86,_0xd5ad('0xd'))['join'](',\x20'));_0x40dd83[_0xd5ad('0xe')]();}else{try{var _0x2810be=eval('('+_0x4dc6b1[_0xd5ad('0xf')]+')');var _0x161043=_0x2810be?_0x4dc6b1[_0xd5ad('0x10')]:_0x4dc6b1[_0xd5ad('0x11')];logger[_0xd5ad('0x12')](_0xd5ad('0x13'),_0x332a88,_0x4dc6b1[_0xd5ad('0xf')],_0x2810be,_0x161043||_0xd5ad('0x14'));if(_0x161043){var _0xcb7246=_['findIndex'](_0x40dd83[_0xd5ad('0x15')](),{'p':_0x161043});if(_0xcb7246>=0x0){logger['info'](_0xd5ad('0x16'),_0x332a88,_0x161043||_0xd5ad('0x14'),_0xcb7246);_0x40dd83[_0xd5ad('0x14')](_0xcb7246);}else{logger[_0xd5ad('0x12')](_0xd5ad('0x17'),_0x332a88,_0x161043||_0xd5ad('0x14'));_0x40dd83[_0xd5ad('0xe')]();}}else{_0x40dd83[_0xd5ad('0x14')]();}}catch(_0x49350c){logger['error'](_0xd5ad('0x18'),_0x332a88,_0x49350c[_0xd5ad('0xd')]);_0x40dd83[_0xd5ad('0xe')]();}}}catch(_0x5c21e2){logger[_0xd5ad('0xb')](_0xd5ad('0x19'),_0x332a88,JSON[_0xd5ad('0x1a')](_0x5c21e2));_0x40dd83['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/gotop.js b/server/services/routing/server/applications/gotop.js index 2870d97..f55766c 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 _0x7052=['consequence','validate','length','[%s][GOTOP]\x20%s','join','stop','info','rules','priority','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','error','lodash','../../../../config/logger','routing'];(function(_0x1806a9,_0x5a85ba){var _0x260ef1=function(_0x3e3f1a){while(--_0x3e3f1a){_0x1806a9['push'](_0x1806a9['shift']());}};_0x260ef1(++_0x5a85ba);}(_0x7052,0xbd));var _0x2705=function(_0x296897,_0x4d23ea){_0x296897=_0x296897-0x0;var _0x2b44ab=_0x7052[_0x296897];return _0x2b44ab;};'use strict';var schema=require('validate');var _=require(_0x2705('0x0'));var logger=require(_0x2705('0x1'))(_0x2705('0x2'));var gotop=schema({'priority':{'type':'number','required':!![],'message':'priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required'}});exports[_0x2705('0x3')]=function(_0xac66c5,_0x4475ad){return function(_0x2ea301){try{var _0x490147={'priority':_0x4475ad[0x0]};var _0x4cf781=gotop[_0x2705('0x4')](_0x490147,{'typecast':!![]});if(_0x4cf781[_0x2705('0x5')]){logger['error'](_0x2705('0x6'),_0xac66c5,_['map'](_0x4cf781,'message')[_0x2705('0x7')](',\x20'));_0x2ea301[_0x2705('0x8')]();}else{logger[_0x2705('0x9')]('[%s][GOTOP]\x20priority\x20%s',_0xac66c5,_0x490147['priority']);if(_0x490147['priority']){var _0x5d08da=_['findIndex'](_0x2ea301[_0x2705('0xa')](),{'p':_0x490147[_0x2705('0xb')]});if(_0x5d08da>=0x0){logger[_0x2705('0x9')](_0x2705('0xc'),_0xac66c5,_0x490147[_0x2705('0xb')]||_0x2705('0xd'),_0x5d08da);_0x2ea301[_0x2705('0xd')](_0x5d08da);}else{logger[_0x2705('0x9')](_0x2705('0xe'),_0xac66c5,_0x490147[_0x2705('0xb')]||_0x2705('0xd'));_0x2ea301['stop']();}}else{_0x2ea301['next']();}}}catch(_0x4aa899){logger[_0x2705('0xf')](_0x2705('0x6'),_0xac66c5,JSON['stringify'](_0x4aa899));_0x2ea301['stop']();}};}; \ No newline at end of file +var _0x8811=['priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','length','error','[%s][GOTOP]\x20%s','message','join','stop','info','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','stringify','../../../../config/logger','number'];(function(_0x4d89fd,_0x411fe1){var _0x3262a6=function(_0x2c7505){while(--_0x2c7505){_0x4d89fd['push'](_0x4d89fd['shift']());}};_0x3262a6(++_0x411fe1);}(_0x8811,0xdb));var _0x1881=function(_0x307862,_0x2394d7){_0x307862=_0x307862-0x0;var _0x321b40=_0x8811[_0x307862];return _0x321b40;};'use strict';var schema=require('validate');var _=require('lodash');var logger=require(_0x1881('0x0'))('routing');var gotop=schema({'priority':{'type':_0x1881('0x1'),'required':!![],'message':_0x1881('0x2')}});exports[_0x1881('0x3')]=function(_0x5c37a9,_0x21d355){return function(_0x457906){try{var _0x5364a1={'priority':_0x21d355[0x0]};var _0x456315=gotop['validate'](_0x5364a1,{'typecast':!![]});if(_0x456315[_0x1881('0x4')]){logger[_0x1881('0x5')](_0x1881('0x6'),_0x5c37a9,_['map'](_0x456315,_0x1881('0x7'))[_0x1881('0x8')](',\x20'));_0x457906[_0x1881('0x9')]();}else{logger[_0x1881('0xa')](_0x1881('0xb'),_0x5c37a9,_0x5364a1[_0x1881('0xc')]);if(_0x5364a1[_0x1881('0xc')]){var _0x19fc5c=_[_0x1881('0xd')](_0x457906['rules'](),{'p':_0x5364a1[_0x1881('0xc')]});if(_0x19fc5c>=0x0){logger['info'](_0x1881('0xe'),_0x5c37a9,_0x5364a1['priority']||'next',_0x19fc5c);_0x457906[_0x1881('0xf')](_0x19fc5c);}else{logger[_0x1881('0xa')]('[%s][GOTOP]\x20priority\x20%s\x20not\x20found',_0x5c37a9,_0x5364a1['priority']||'next');_0x457906[_0x1881('0x9')]();}}else{_0x457906[_0x1881('0xf')]();}}}catch(_0x79941e){logger['error'](_0x1881('0x6'),_0x5c37a9,JSON[_0x1881('0x10')](_0x79941e));_0x457906['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 7bdcfc8..27cff25 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 _0x1356=['[%s][MESSAGE]\x20%s','catch','stringify','stop','error','lodash','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','getMustacheRender','contact','channel','chat','upperFirst','interaction','Message','create','then','info'];(function(_0x4ee604,_0x2b2176){var _0x54d338=function(_0x31c15a){while(--_0x31c15a){_0x4ee604['push'](_0x4ee604['shift']());}};_0x54d338(++_0x2b2176);}(_0x1356,0x10d));var _0x6135=function(_0x6ef6fb,_0x5f4b1c){_0x6ef6fb=_0x6ef6fb-0x0;var _0x5cd62b=_0x1356[_0x6ef6fb];return _0x5cd62b;};'use strict';var _=require(_0x6135('0x0'));var utils=require(_0x6135('0x1'));var logger=require(_0x6135('0x2'))(_0x6135('0x3'));var rpc={'chatMessage':require(_0x6135('0x4')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require(_0x6135('0x5')),'smsMessage':require(_0x6135('0x6')),'faxMessage':require(_0x6135('0x7')),'whatsappMessage':require(_0x6135('0x8'))};exports['consequence']=function(_0x3b0bb4,_0x221eaa){return function(_0x405784){try{var _0x1cbd22={'body':utils[_0x6135('0x9')](_0x221eaa[0x0],this),'ContactId':this[_0x6135('0xa')]['id']};if(this[_0x6135('0xb')]===_0x6135('0xc')){_0x1cbd22['ChatWebsiteId']=this['account']['id'];}else{_0x1cbd22[_['upperFirst'](this[_0x6135('0xb')])+'AccountId']=this['account']['id'];}_0x1cbd22[_[_0x6135('0xd')](this[_0x6135('0xb')])+'InteractionId']=this[_0x6135('0xe')]['id'];if(rpc[this[_0x6135('0xb')]+_0x6135('0xf')]){return rpc[this[_0x6135('0xb')]+_0x6135('0xf')][_0x6135('0x10')](_0x1cbd22)[_0x6135('0x11')](function(_0x111a53){logger[_0x6135('0x12')](_0x6135('0x13'),_0x3b0bb4,_0x1cbd22['body']);_0x405784['next']();})[_0x6135('0x14')](function(_0x2ed091){logger['error']('[%s][MESSAGE]\x20%s',_0x3b0bb4,JSON[_0x6135('0x15')](_0x2ed091));_0x405784[_0x6135('0x16')]();});}}catch(_0x4dae6f){logger[_0x6135('0x17')](_0x6135('0x13'),_0x3b0bb4,JSON[_0x6135('0x15')](_0x4dae6f));_0x405784[_0x6135('0x16')]();}};}; \ No newline at end of file +var _0xfbb2=['body','next','[%s][MESSAGE]\x20%s','stringify','stop','error','lodash','./utils','../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','../../rpc/whatsappMessage','consequence','getMustacheRender','channel','chat','ChatWebsiteId','account','upperFirst','InteractionId','interaction','Message','create','then','info'];(function(_0x5303f8,_0x4ff4cf){var _0x13447c=function(_0x5726d8){while(--_0x5726d8){_0x5303f8['push'](_0x5303f8['shift']());}};_0x13447c(++_0x4ff4cf);}(_0xfbb2,0xae));var _0x2fbb=function(_0x4503df,_0xfec122){_0x4503df=_0x4503df-0x0;var _0x3f1b2b=_0xfbb2[_0x4503df];return _0x3f1b2b;};'use strict';var _=require(_0x2fbb('0x0'));var utils=require(_0x2fbb('0x1'));var logger=require(_0x2fbb('0x2'))(_0x2fbb('0x3'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x2fbb('0x4')),'mailMessage':require(_0x2fbb('0x5')),'smsMessage':require(_0x2fbb('0x6')),'faxMessage':require(_0x2fbb('0x7')),'whatsappMessage':require(_0x2fbb('0x8'))};exports[_0x2fbb('0x9')]=function(_0x20964b,_0x5eebfc){return function(_0x448c4b){try{var _0x170c70={'body':utils[_0x2fbb('0xa')](_0x5eebfc[0x0],this),'ContactId':this['contact']['id']};if(this[_0x2fbb('0xb')]===_0x2fbb('0xc')){_0x170c70[_0x2fbb('0xd')]=this[_0x2fbb('0xe')]['id'];}else{_0x170c70[_[_0x2fbb('0xf')](this['channel'])+'AccountId']=this['account']['id'];}_0x170c70[_['upperFirst'](this[_0x2fbb('0xb')])+_0x2fbb('0x10')]=this[_0x2fbb('0x11')]['id'];if(rpc[this['channel']+_0x2fbb('0x12')]){return rpc[this['channel']+_0x2fbb('0x12')][_0x2fbb('0x13')](_0x170c70)[_0x2fbb('0x14')](function(_0x2eea84){logger[_0x2fbb('0x15')]('[%s][MESSAGE]\x20%s',_0x20964b,_0x170c70[_0x2fbb('0x16')]);_0x448c4b[_0x2fbb('0x17')]();})['catch'](function(_0x1e1264){logger['error'](_0x2fbb('0x18'),_0x20964b,JSON[_0x2fbb('0x19')](_0x1e1264));_0x448c4b[_0x2fbb('0x1a')]();});}}catch(_0x5bfe53){logger[_0x2fbb('0x1b')](_0x2fbb('0x18'),_0x20964b,JSON[_0x2fbb('0x19')](_0x5bfe53));_0x448c4b[_0x2fbb('0x1a')]();}};}; \ 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 086303b..286b7ca 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 _0x87d2=['getMustacheRender','next','error','stringify','stop','../../../../config/logger','routing','consequence','info','[%s][NOOP]\x20%s'];(function(_0x10cc81,_0x172700){var _0x3bbe1e=function(_0x319ed2){while(--_0x319ed2){_0x10cc81['push'](_0x10cc81['shift']());}};_0x3bbe1e(++_0x172700);}(_0x87d2,0x163));var _0x287d=function(_0x73f54a,_0x1a7b6e){_0x73f54a=_0x73f54a-0x0;var _0x7c93be=_0x87d2[_0x73f54a];return _0x7c93be;};'use strict';var utils=require('./utils');var logger=require(_0x287d('0x0'))(_0x287d('0x1'));exports[_0x287d('0x2')]=function(_0x1dd164,_0x405b44){return function(_0x4e1ba5){try{logger[_0x287d('0x3')](_0x287d('0x4'),_0x1dd164,utils[_0x287d('0x5')](_0x405b44[0x0],this));_0x4e1ba5[_0x287d('0x6')]();}catch(_0x634ca2){logger[_0x287d('0x7')](_0x287d('0x4'),_0x1dd164,JSON[_0x287d('0x8')](_0x634ca2));_0x4e1ba5[_0x287d('0x9')]();}};}; \ No newline at end of file +var _0x9a17=['stop','./utils','consequence','info','[%s][NOOP]\x20%s','next','stringify'];(function(_0x5607eb,_0x27bef6){var _0x13ff9b=function(_0x28a034){while(--_0x28a034){_0x5607eb['push'](_0x5607eb['shift']());}};_0x13ff9b(++_0x27bef6);}(_0x9a17,0x13c));var _0x79a1=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0x9a17[_0x273c39];return _0x46d6b5;};'use strict';var utils=require(_0x79a1('0x0'));var logger=require('../../../../config/logger')('routing');exports[_0x79a1('0x1')]=function(_0x5521ea,_0x3cd1ef){return function(_0x1a0bd2){try{logger[_0x79a1('0x2')](_0x79a1('0x3'),_0x5521ea,utils['getMustacheRender'](_0x3cd1ef[0x0],this));_0x1a0bd2[_0x79a1('0x4')]();}catch(_0x184f62){logger['error'](_0x79a1('0x3'),_0x5521ea,JSON[_0x79a1('0x5')](_0x184f62));_0x1a0bd2[_0x79a1('0x6')]();}};}; \ 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 39b6b23..0fa62eb 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 _0xfef3=['../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','channel','InteractionId','interaction','MessageId','message','AccountId','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','create\x20queue\x20report','[%s][STOP:QUEUE][NAME:%s]','update','catch','error','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','length','map','join','stop','find','Queues','createQueue','atimeout','qtimeout','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','next','rrmemory','log','[%s][QUEUE]\x20%s','validate','util','moment','ioredis','../../../../config/logger','routing','redis','defaults','localhost','socket.io-emitter','queue_id','account','queue','from','joinAt','emit','clone','format','pick','%s:queue:%s','%s_queue_waiting_interaction:%s','save','remove','../../rpc/openchannelQueueReport'];(function(_0x29db2d,_0x24adce){var _0x35bfc1=function(_0x31ed79){while(--_0x31ed79){_0x29db2d['push'](_0x29db2d['shift']());}};_0x35bfc1(++_0x24adce);}(_0xfef3,0x118));var _0x3fef=function(_0x4722a4,_0x1c710e){_0x4722a4=_0x4722a4-0x0;var _0x9e8608=_0xfef3[_0x4722a4];return _0x9e8608;};'use strict';var schema=require(_0x3fef('0x0'));var _=require('lodash');var util=require(_0x3fef('0x1'));var seqqueue=require('seq-queue');var moment=require(_0x3fef('0x2'));var Redis=require(_0x3fef('0x3'));var config=require('../../../../config/environment');var logger=require(_0x3fef('0x4'))(_0x3fef('0x5'));var strategy=require('./strategy');config[_0x3fef('0x6')]=_[_0x3fef('0x7')](config['redis'],{'host':_0x3fef('0x8'),'port':0x18eb});var io=require(_0x3fef('0x9'))(new Redis(config[_0x3fef('0x6')]));var attributes=['id',_0x3fef('0xa'),_0x3fef('0xb'),_0x3fef('0xc'),_0x3fef('0xd'),_0x3fef('0xe')];function emit(_0x31c30f,_0x307586,_0x67cdd8){io['to'](_0x31c30f)[_0x3fef('0xf')](_0x307586,_0x67cdd8);}function emitChannelQueueInteraction(_0x1a7ef7,_0x7cc5b,_0x5b5a07,_0xab6df8,_0x3560d9,_0x11696d,_0x49d216,_0x1c20b3){var _0x4c4a47=_[_0x3fef('0x10')](_0x5b5a07);_0x4c4a47[_0x3fef('0xa')]=_0x1c20b3;_0x4c4a47[_0x3fef('0xc')]=_0x7cc5b;_0x4c4a47['account']=_0xab6df8;_0x4c4a47['id']=_0x3560d9;if(_0x11696d){_0x49d216[util[_0x3fef('0x11')]('%sQueuesWaitingInteractions',_0x1a7ef7)][_0x3560d9]=_[_0x3fef('0x12')](_0x4c4a47,attributes);}else{delete _0x49d216[util[_0x3fef('0x11')]('%sQueuesWaitingInteractions',_0x1a7ef7)][_0x3560d9];}emit(util[_0x3fef('0x11')](_0x3fef('0x13'),_0x1a7ef7,_0x7cc5b),util[_0x3fef('0x11')](_0x3fef('0x14'),_0x1a7ef7,_0x11696d?_0x3fef('0x15'):_0x3fef('0x16')),_['pick'](_0x4c4a47,attributes));}var rpc={'openchannelQueueReport':require(_0x3fef('0x17')),'mailQueueReport':require(_0x3fef('0x18')),'chatQueueReport':require(_0x3fef('0x19')),'smsQueueReport':require(_0x3fef('0x1a')),'faxQueueReport':require(_0x3fef('0x1b')),'whatsappQueueReport':require(_0x3fef('0x1c'))};var queue=schema({'name':{'type':'string','required':!![],'message':_0x3fef('0x1d')},'timeout':{'type':_0x3fef('0x1e'),'message':'timeout\x20is\x20a\x20number'}});function startRouting(_0x2c7f36,_0x51a554,_0x42e095,_0x218f91){if(_0x2c7f36&&_0x51a554&&_0x42e095){_0x51a554[_0x3fef('0x1f')]+=0x1;var _0x2b5226={'uniqueid':_0x2c7f36,'from':_0x42e095[_0x3fef('0x20')]?_0x42e095[_0x3fef('0x20')][_0x3fef('0xd')]:'','joinAt':moment()[_0x3fef('0x11')](_0x3fef('0x21')),'ContactId':_0x42e095[_0x3fef('0x22')]?_0x42e095[_0x3fef('0x22')]['id']:null,'ListId':_0x42e095[_0x3fef('0x23')]?_0x42e095[_0x3fef('0x23')]['id']:null};_0x2b5226[_['upperFirst'](_0x42e095['channel'])+'QueueId']=_0x51a554['id']||null;_0x2b5226[_[_0x3fef('0x24')](_0x42e095[_0x3fef('0x25')])+_0x3fef('0x26')]=_0x42e095['interaction']?_0x42e095[_0x3fef('0x27')]['id']:null;_0x2b5226[_['upperFirst'](_0x42e095[_0x3fef('0x25')])+_0x3fef('0x28')]=_0x42e095[_0x3fef('0x29')]?_0x42e095[_0x3fef('0x29')]['id']:null;_0x2b5226[_[_0x3fef('0x24')](_0x42e095['channel'])+(_0x42e095['channel']!=='chat'?_0x3fef('0x2a'):_0x3fef('0x2b'))]=_0x42e095['account']?_0x42e095[_0x3fef('0xb')]['id']:null;logger[_0x3fef('0x2c')](util['format'](_0x3fef('0x2d'),_0x2c7f36,_0x51a554[_0x3fef('0x2e')]));emitChannelQueueInteraction(_0x42e095[_0x3fef('0x25')],_0x51a554[_0x3fef('0x2e')],_0x2b5226,_0x42e095[_0x3fef('0xb')][_0x3fef('0x2e')],_0x42e095[_0x3fef('0x29')]['id'],!![],_0x218f91,_0x51a554['id']);if(rpc[_0x42e095['channel']+_0x3fef('0x2f')]){return rpc[_0x42e095[_0x3fef('0x25')]+_0x3fef('0x2f')][_0x3fef('0x30')](_0x2b5226)['catch'](function(_0xcd635d){logger['error'](_0x3fef('0x31'));});}}}function stopRouting(_0x3c4483,_0x16009a,_0x1136b3,_0x10b803){if(_0x3c4483&&_0x16009a){_0x16009a[_0x3fef('0x1f')]-=0x1;var _0x355c03={'leaveAt':moment()[_0x3fef('0x11')](_0x3fef('0x21')),'acceptAt':moment()[_0x3fef('0x11')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':'accepted'};logger[_0x3fef('0x2c')](util['format'](_0x3fef('0x32'),_0x3c4483,_0x16009a[_0x3fef('0x2e')]));emitChannelQueueInteraction(_0x1136b3[_0x3fef('0x25')],_0x16009a[_0x3fef('0x2e')],_0x1136b3[_0x3fef('0x20')],_0x1136b3[_0x3fef('0xb')][_0x3fef('0x2e')],_0x1136b3[_0x3fef('0x29')]['id'],![],_0x10b803,_0x16009a['id']);if(rpc[_0x1136b3[_0x3fef('0x25')]+_0x3fef('0x2f')]){return rpc[_0x1136b3[_0x3fef('0x25')]+_0x3fef('0x2f')][_0x3fef('0x33')](_0x3c4483,_0x355c03)[_0x3fef('0x34')](function(_0x58d276){logger[_0x3fef('0x35')](_0x3fef('0x36'));});}}}function endRouting(_0x31669f,_0x19e935,_0x1879ec,_0x52a3c4){if(_0x31669f&&_0x19e935){_0x19e935['waiting']-=0x1;var _0x5cbea8={'leaveAt':moment()[_0x3fef('0x11')](_0x3fef('0x21')),'exitAt':moment()[_0x3fef('0x11')](_0x3fef('0x21')),'reason':_0x3fef('0x37')};logger[_0x3fef('0x2c')](util[_0x3fef('0x11')](_0x3fef('0x38'),_0x31669f,_0x19e935[_0x3fef('0x2e')]));emitChannelQueueInteraction(_0x1879ec[_0x3fef('0x25')],_0x19e935[_0x3fef('0x2e')],_0x1879ec['body'],_0x1879ec[_0x3fef('0xb')][_0x3fef('0x2e')],_0x1879ec['message']['id'],![],_0x52a3c4);if(rpc[_0x1879ec['channel']+_0x3fef('0x2f')]){return rpc[_0x1879ec[_0x3fef('0x25')]+_0x3fef('0x2f')][_0x3fef('0x33')](_0x31669f,_0x5cbea8)[_0x3fef('0x34')](function(_0x201aa3){logger[_0x3fef('0x35')](_0x3fef('0x36'));});}}}function handleFindQueue(_0x577ab8){return function(_0x107d42){return _0x107d42[_0x3fef('0x2e')][_0x3fef('0x39')]()===_0x577ab8[_0x3fef('0x39')]();};}exports[_0x3fef('0x3a')]=function(_0x2143ec,_0x545154,_0x798184,_0x3df52b){return function(_0x301f65){try{var _0x12867c={'name':_0x545154[0x0],'timeout':_0x545154[0x1]};var _0x254880=queue[_0x3fef('0x0')](_0x12867c,{'typecast':!![]});if(_0x254880[_0x3fef('0x3b')]){logger[_0x3fef('0x35')]('[%s][QUEUE]\x20%s',_0x2143ec,_[_0x3fef('0x3c')](_0x254880,_0x3fef('0x29'))[_0x3fef('0x3d')](',\x20'));_0x301f65[_0x3fef('0x3e')]();}else{var _0x1879c1=_[_0x3fef('0x3f')](_0x798184[_0x3df52b['channel']+_0x3fef('0x40')],handleFindQueue(_0x12867c['name']));if(_0x1879c1){startRouting(_0x2143ec,_0x1879c1,_0x3df52b,_0x798184);var _0x3bcb0e=(_0x1879c1[_0x3fef('0x37')]||0xa)*0x3e8;var _0x59e3b0=(_0x12867c[_0x3fef('0x37')]||0x14)*0x3e8;var _0x4e662c,_0x416a81;if(_0x3bcb0e>_0x59e3b0){_0x59e3b0=_0x3bcb0e;}var _0x29f5d3=seqqueue[_0x3fef('0x41')](_0x3bcb0e);_0x29f5d3['id']=_0x2143ec;_0x29f5d3[_0x3fef('0x42')]=_0x3bcb0e;_0x29f5d3[_0x3fef('0x43')]=_0x59e3b0;_0x29f5d3[_0x3fef('0x25')]=_0x3df52b[_0x3fef('0x25')];_0x798184[_0x3fef('0x44')][_0x2143ec]['on'](_0x3fef('0x45'),function(){logger[_0x3fef('0x2c')](_0x3fef('0x46'),_0x2143ec);stopRouting(_0x2143ec,_0x1879c1,_0x3df52b,_0x798184);clearTimeout(_0x4e662c);_0x4e662c=undefined;_0x29f5d3[_0x3fef('0x47')](!![]);if(_0x798184[_0x3fef('0x44')][_0x2143ec]){delete _0x798184['rules'][_0x2143ec];}_0x301f65[_0x3fef('0x3e')]();});_0x798184[_0x3fef('0x44')][_0x2143ec]['on']('complete',function(){if(_0x798184[_0x3fef('0x44')][_0x2143ec]){delete _0x798184[_0x3fef('0x44')][_0x2143ec];}});_0x4e662c=setTimeout(function(){logger[_0x3fef('0x2c')]('[%s][QUEUE]\x20APPLICATION\x20END',_0x2143ec);endRouting(_0x2143ec,_0x1879c1,_0x3df52b,_0x798184);clearTimeout(_0x4e662c);_0x29f5d3[_0x3fef('0x47')](!![]);_0x301f65[_0x3fef('0x48')]();},_0x59e3b0);switch(_0x1879c1['strategy']){case _0x3fef('0x49'):strategy['rrmemory'](_0x29f5d3,_0x1879c1,_0x798184,_0x3df52b);break;default:strategy['beepall'](_0x29f5d3,_0x1879c1,_0x798184,_0x3df52b);}}else{logger[_0x3fef('0x35')]('[%s][QUEUE]\x20queue\x20not\x20found\x20%s',_0x2143ec,_0x12867c[_0x3fef('0x2e')]);_0x301f65[_0x3fef('0x3e')]();}}}catch(_0x4f7b3c){console[_0x3fef('0x4a')](_0x4f7b3c);logger[_0x3fef('0x35')](_0x3fef('0x4b'),_0x2143ec,_0x4f7b3c['stack']);_0x301f65[_0x3fef('0x3e')]();}};}; \ No newline at end of file +var _0xf3f1=['../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','../../rpc/whatsappQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','waiting','from','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','channel','QueueId','interaction','MessageId','message','chat','AccountId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','accepted','[%s][STOP:QUEUE][NAME:%s]','body','update','catch','error','update\x20queue\x20report','[%s][END:QUEUE][NAME:%s]','toLowerCase','length','[%s][QUEUE]\x20%s','join','stop','find','Queues','timeout','createQueue','atimeout','rules','end','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','complete','[%s][QUEUE]\x20APPLICATION\x20END','next','strategy','rrmemory','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','validate','util','ioredis','../../../../config/environment','routing','./strategy','redis','socket.io-emitter','queue_id','account','queue','joinAt','emit','clone','format','pick','%s:queue:%s','%s_queue_waiting_interaction:%s','save','remove','../../rpc/mailQueueReport'];(function(_0x5f5886,_0x479ff0){var _0x5bc911=function(_0x165649){while(--_0x165649){_0x5f5886['push'](_0x5f5886['shift']());}};_0x5bc911(++_0x479ff0);}(_0xf3f1,0x113));var _0x1f3f=function(_0x2d91c6,_0x10ae0e){_0x2d91c6=_0x2d91c6-0x0;var _0x3a8d19=_0xf3f1[_0x2d91c6];return _0x3a8d19;};'use strict';var schema=require(_0x1f3f('0x0'));var _=require('lodash');var util=require(_0x1f3f('0x1'));var seqqueue=require('seq-queue');var moment=require('moment');var Redis=require(_0x1f3f('0x2'));var config=require(_0x1f3f('0x3'));var logger=require('../../../../config/logger')(_0x1f3f('0x4'));var strategy=require(_0x1f3f('0x5'));config[_0x1f3f('0x6')]=_['defaults'](config[_0x1f3f('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x1f3f('0x7'))(new Redis(config[_0x1f3f('0x6')]));var attributes=['id',_0x1f3f('0x8'),_0x1f3f('0x9'),_0x1f3f('0xa'),'from',_0x1f3f('0xb')];function emit(_0x22ccbd,_0x1ee9e5,_0x32e8e6){io['to'](_0x22ccbd)[_0x1f3f('0xc')](_0x1ee9e5,_0x32e8e6);}function emitChannelQueueInteraction(_0x512b8a,_0x2f7b42,_0x17be2d,_0x4f2e22,_0x31c091,_0x8cca39,_0x299485,_0x172a8a){var _0x1b7d74=_[_0x1f3f('0xd')](_0x17be2d);_0x1b7d74['queue_id']=_0x172a8a;_0x1b7d74[_0x1f3f('0xa')]=_0x2f7b42;_0x1b7d74['account']=_0x4f2e22;_0x1b7d74['id']=_0x31c091;if(_0x8cca39){_0x299485[util[_0x1f3f('0xe')]('%sQueuesWaitingInteractions',_0x512b8a)][_0x31c091]=_[_0x1f3f('0xf')](_0x1b7d74,attributes);}else{delete _0x299485[util[_0x1f3f('0xe')]('%sQueuesWaitingInteractions',_0x512b8a)][_0x31c091];}emit(util[_0x1f3f('0xe')](_0x1f3f('0x10'),_0x512b8a,_0x2f7b42),util['format'](_0x1f3f('0x11'),_0x512b8a,_0x8cca39?_0x1f3f('0x12'):_0x1f3f('0x13')),_['pick'](_0x1b7d74,attributes));}var rpc={'openchannelQueueReport':require('../../rpc/openchannelQueueReport'),'mailQueueReport':require(_0x1f3f('0x14')),'chatQueueReport':require(_0x1f3f('0x15')),'smsQueueReport':require(_0x1f3f('0x16')),'faxQueueReport':require(_0x1f3f('0x17')),'whatsappQueueReport':require(_0x1f3f('0x18'))};var queue=schema({'name':{'type':_0x1f3f('0x19'),'required':!![],'message':_0x1f3f('0x1a')},'timeout':{'type':_0x1f3f('0x1b'),'message':_0x1f3f('0x1c')}});function startRouting(_0x56d524,_0x1de801,_0x6aebc4,_0x8c5d73){if(_0x56d524&&_0x1de801&&_0x6aebc4){_0x1de801[_0x1f3f('0x1d')]+=0x1;var _0x3512cb={'uniqueid':_0x56d524,'from':_0x6aebc4['body']?_0x6aebc4['body'][_0x1f3f('0x1e')]:'','joinAt':moment()[_0x1f3f('0xe')](_0x1f3f('0x1f')),'ContactId':_0x6aebc4[_0x1f3f('0x20')]?_0x6aebc4[_0x1f3f('0x20')]['id']:null,'ListId':_0x6aebc4[_0x1f3f('0x21')]?_0x6aebc4[_0x1f3f('0x21')]['id']:null};_0x3512cb[_[_0x1f3f('0x22')](_0x6aebc4[_0x1f3f('0x23')])+_0x1f3f('0x24')]=_0x1de801['id']||null;_0x3512cb[_[_0x1f3f('0x22')](_0x6aebc4[_0x1f3f('0x23')])+'InteractionId']=_0x6aebc4[_0x1f3f('0x25')]?_0x6aebc4[_0x1f3f('0x25')]['id']:null;_0x3512cb[_[_0x1f3f('0x22')](_0x6aebc4[_0x1f3f('0x23')])+_0x1f3f('0x26')]=_0x6aebc4[_0x1f3f('0x27')]?_0x6aebc4['message']['id']:null;_0x3512cb[_[_0x1f3f('0x22')](_0x6aebc4[_0x1f3f('0x23')])+(_0x6aebc4[_0x1f3f('0x23')]!==_0x1f3f('0x28')?_0x1f3f('0x29'):'WebsiteId')]=_0x6aebc4[_0x1f3f('0x9')]?_0x6aebc4[_0x1f3f('0x9')]['id']:null;logger[_0x1f3f('0x2a')](util[_0x1f3f('0xe')](_0x1f3f('0x2b'),_0x56d524,_0x1de801['name']));emitChannelQueueInteraction(_0x6aebc4[_0x1f3f('0x23')],_0x1de801['name'],_0x3512cb,_0x6aebc4[_0x1f3f('0x9')][_0x1f3f('0x2c')],_0x6aebc4[_0x1f3f('0x27')]['id'],!![],_0x8c5d73,_0x1de801['id']);if(rpc[_0x6aebc4[_0x1f3f('0x23')]+'QueueReport']){return rpc[_0x6aebc4[_0x1f3f('0x23')]+_0x1f3f('0x2d')]['create'](_0x3512cb)['catch'](function(_0x113b95){logger['error']('create\x20queue\x20report');});}}}function stopRouting(_0x890b58,_0x2698a7,_0x31486e,_0x767e10){if(_0x890b58&&_0x2698a7){_0x2698a7[_0x1f3f('0x1d')]-=0x1;var _0x234d2b={'leaveAt':moment()[_0x1f3f('0xe')]('YYYY-MM-DD\x20HH:mm:ss'),'acceptAt':moment()[_0x1f3f('0xe')](_0x1f3f('0x1f')),'reason':_0x1f3f('0x2e')};logger[_0x1f3f('0x2a')](util[_0x1f3f('0xe')](_0x1f3f('0x2f'),_0x890b58,_0x2698a7[_0x1f3f('0x2c')]));emitChannelQueueInteraction(_0x31486e[_0x1f3f('0x23')],_0x2698a7[_0x1f3f('0x2c')],_0x31486e[_0x1f3f('0x30')],_0x31486e[_0x1f3f('0x9')][_0x1f3f('0x2c')],_0x31486e[_0x1f3f('0x27')]['id'],![],_0x767e10,_0x2698a7['id']);if(rpc[_0x31486e[_0x1f3f('0x23')]+'QueueReport']){return rpc[_0x31486e[_0x1f3f('0x23')]+'QueueReport'][_0x1f3f('0x31')](_0x890b58,_0x234d2b)[_0x1f3f('0x32')](function(_0x1e474a){logger[_0x1f3f('0x33')](_0x1f3f('0x34'));});}}}function endRouting(_0xe25360,_0x18d9e6,_0x92ac56,_0x3ea4a8){if(_0xe25360&&_0x18d9e6){_0x18d9e6[_0x1f3f('0x1d')]-=0x1;var _0xde7d57={'leaveAt':moment()[_0x1f3f('0xe')]('YYYY-MM-DD\x20HH:mm:ss'),'exitAt':moment()[_0x1f3f('0xe')](_0x1f3f('0x1f')),'reason':'timeout'};logger[_0x1f3f('0x2a')](util['format'](_0x1f3f('0x35'),_0xe25360,_0x18d9e6['name']));emitChannelQueueInteraction(_0x92ac56[_0x1f3f('0x23')],_0x18d9e6[_0x1f3f('0x2c')],_0x92ac56['body'],_0x92ac56[_0x1f3f('0x9')][_0x1f3f('0x2c')],_0x92ac56[_0x1f3f('0x27')]['id'],![],_0x3ea4a8);if(rpc[_0x92ac56[_0x1f3f('0x23')]+_0x1f3f('0x2d')]){return rpc[_0x92ac56[_0x1f3f('0x23')]+_0x1f3f('0x2d')]['update'](_0xe25360,_0xde7d57)[_0x1f3f('0x32')](function(_0x5ec89f){logger['error']('update\x20queue\x20report');});}}}function handleFindQueue(_0x312c4e){return function(_0x86b967){return _0x86b967[_0x1f3f('0x2c')]['toLowerCase']()===_0x312c4e[_0x1f3f('0x36')]();};}exports['consequence']=function(_0x2b766f,_0x58e169,_0x2cf5ce,_0x2a3449){return function(_0x2530d5){try{var _0x25eb96={'name':_0x58e169[0x0],'timeout':_0x58e169[0x1]};var _0x281b08=queue[_0x1f3f('0x0')](_0x25eb96,{'typecast':!![]});if(_0x281b08[_0x1f3f('0x37')]){logger[_0x1f3f('0x33')](_0x1f3f('0x38'),_0x2b766f,_['map'](_0x281b08,_0x1f3f('0x27'))[_0x1f3f('0x39')](',\x20'));_0x2530d5[_0x1f3f('0x3a')]();}else{var _0x2ae541=_[_0x1f3f('0x3b')](_0x2cf5ce[_0x2a3449['channel']+_0x1f3f('0x3c')],handleFindQueue(_0x25eb96[_0x1f3f('0x2c')]));if(_0x2ae541){startRouting(_0x2b766f,_0x2ae541,_0x2a3449,_0x2cf5ce);var _0x12d29b=(_0x2ae541[_0x1f3f('0x3d')]||0xa)*0x3e8;var _0x32da93=(_0x25eb96['timeout']||0x14)*0x3e8;var _0x28ffed,_0x4cb31e;if(_0x12d29b>_0x32da93){_0x32da93=_0x12d29b;}var _0x51dc28=seqqueue[_0x1f3f('0x3e')](_0x12d29b);_0x51dc28['id']=_0x2b766f;_0x51dc28[_0x1f3f('0x3f')]=_0x12d29b;_0x51dc28['qtimeout']=_0x32da93;_0x51dc28[_0x1f3f('0x23')]=_0x2a3449[_0x1f3f('0x23')];_0x2cf5ce[_0x1f3f('0x40')][_0x2b766f]['on'](_0x1f3f('0x41'),function(){logger[_0x1f3f('0x2a')](_0x1f3f('0x42'),_0x2b766f);stopRouting(_0x2b766f,_0x2ae541,_0x2a3449,_0x2cf5ce);clearTimeout(_0x28ffed);_0x28ffed=undefined;_0x51dc28[_0x1f3f('0x43')](!![]);if(_0x2cf5ce['rules'][_0x2b766f]){delete _0x2cf5ce[_0x1f3f('0x40')][_0x2b766f];}_0x2530d5[_0x1f3f('0x3a')]();});_0x2cf5ce[_0x1f3f('0x40')][_0x2b766f]['on'](_0x1f3f('0x44'),function(){if(_0x2cf5ce[_0x1f3f('0x40')][_0x2b766f]){delete _0x2cf5ce[_0x1f3f('0x40')][_0x2b766f];}});_0x28ffed=setTimeout(function(){logger[_0x1f3f('0x2a')](_0x1f3f('0x45'),_0x2b766f);endRouting(_0x2b766f,_0x2ae541,_0x2a3449,_0x2cf5ce);clearTimeout(_0x28ffed);_0x51dc28['close'](!![]);_0x2530d5[_0x1f3f('0x46')]();},_0x32da93);switch(_0x2ae541[_0x1f3f('0x47')]){case _0x1f3f('0x48'):strategy[_0x1f3f('0x48')](_0x51dc28,_0x2ae541,_0x2cf5ce,_0x2a3449);break;default:strategy['beepall'](_0x51dc28,_0x2ae541,_0x2cf5ce,_0x2a3449);}}else{logger[_0x1f3f('0x33')](_0x1f3f('0x49'),_0x2b766f,_0x25eb96[_0x1f3f('0x2c')]);_0x2530d5[_0x1f3f('0x3a')]();}}}catch(_0x53e2a9){console['log'](_0x53e2a9);logger[_0x1f3f('0x33')](_0x1f3f('0x38'),_0x2b766f,_0x53e2a9['stack']);_0x2530d5[_0x1f3f('0x3a')]();}};}; \ 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 60d1a31..01508cb 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 _0xbb12=['writeLog','TIMEOUT','exports','lodash','uuid','./util','../../../../../config/logger','routing','squeue','agent','realtime','push','handleRun','bind','handleTimeout','timeout','drained','handleDrained','prototype','[%s][AGENT]\x20try\x20with\x20%s','isNil','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','channel','showNotification','notificationId','RINGING',':FORCED','info','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','busy'];(function(_0x3ec748,_0x645ea2){var _0x1aefd6=function(_0x1ff023){while(--_0x1ff023){_0x3ec748['push'](_0x3ec748['shift']());}};_0x1aefd6(++_0x645ea2);}(_0xbb12,0x1a7));var _0x2bb1=function(_0x93b713,_0x59d132){_0x93b713=_0x93b713-0x0;var _0x49509f=_0xbb12[_0x93b713];return _0x49509f;};'use strict';var _=require(_0x2bb1('0x0'));var uuid=require(_0x2bb1('0x1'));var util=require(_0x2bb1('0x2'));var logger=require(_0x2bb1('0x3'))(_0x2bb1('0x4'));var Agent=function(_0x290955,_0x2eb048,_0x4e1096,_0x86ade7){this['notificationId']=uuid['v4']();this[_0x2bb1('0x5')]=_0x290955;this[_0x2bb1('0x6')]=_0x2eb048;this[_0x2bb1('0x7')]=_0x4e1096;this[_0x2bb1('0x4')]=_0x86ade7;this[_0x2bb1('0x5')][_0x2bb1('0x8')](this[_0x2bb1('0x9')][_0x2bb1('0xa')](this),this[_0x2bb1('0xb')][_0x2bb1('0xa')](this));this[_0x2bb1('0x5')]['on'](_0x2bb1('0xc'),this[_0x2bb1('0xb')]['bind'](this));this['squeue']['on'](_0x2bb1('0xd'),this[_0x2bb1('0xe')][_0x2bb1('0xa')](this));};Agent[_0x2bb1('0xf')][_0x2bb1('0x8')]=function(){this[_0x2bb1('0x5')]['push'](this[_0x2bb1('0x9')][_0x2bb1('0xa')](this),this[_0x2bb1('0xb')][_0x2bb1('0xa')](this));};Agent['prototype'][_0x2bb1('0xe')]=function(){this[_0x2bb1('0xb')](!![]);};Agent[_0x2bb1('0xf')]['handleRun']=function(_0x2c6ea4){logger['info'](_0x2bb1('0x10'),this[_0x2bb1('0x5')]['id'],this['agent']['id']);if(_[_0x2bb1('0x11')](this[_0x2bb1('0x7')][_0x2bb1('0x12')][this[_0x2bb1('0x6')]['id']])){logger['info'](_0x2bb1('0x13'),this[_0x2bb1('0x5')]['id'],this[_0x2bb1('0x6')]['id']);setTimeout(this[_0x2bb1('0x8')][_0x2bb1('0xa')](this),0x3e8);}else{if(this[_0x2bb1('0x4')][_0x2bb1('0x14')]||util[_0x2bb1('0x15')](this[_0x2bb1('0x5')]['id'],this[_0x2bb1('0x7')]['agents'][this[_0x2bb1('0x6')]['id']],this['squeue'][_0x2bb1('0x16')],![])){this[_0x2bb1('0x7')][_0x2bb1('0x12')][this[_0x2bb1('0x6')]['id']]['busy']=!![];this['realtime'][_0x2bb1('0x12')][this['agent']['id']]['busyQueue']=undefined;util[_0x2bb1('0x17')](this[_0x2bb1('0x18')],this[_0x2bb1('0x5')]['id'],this[_0x2bb1('0x7')][_0x2bb1('0x12')][this[_0x2bb1('0x6')]['id']],null,this[_0x2bb1('0x4')]);util['writeLog'](this['squeue']['id'],this[_0x2bb1('0x7')][_0x2bb1('0x12')][this[_0x2bb1('0x6')]['id']],_0x2bb1('0x19')+(this['routing'][_0x2bb1('0x14')]?_0x2bb1('0x1a'):''));}else{logger[_0x2bb1('0x1b')](_0x2bb1('0x1c'),this[_0x2bb1('0x5')]['id'],this[_0x2bb1('0x6')]['id']);setTimeout(this[_0x2bb1('0x8')][_0x2bb1('0xa')](this),0x3e8);}}};Agent['prototype'][_0x2bb1('0xb')]=function(_0x3d834b){if(_[_0x2bb1('0x11')](this['realtime'][_0x2bb1('0x12')][this[_0x2bb1('0x6')]['id']])){return logger[_0x2bb1('0x1b')](_0x2bb1('0x13'),this[_0x2bb1('0x5')]['id'],this[_0x2bb1('0x6')]['id']);}else{logger[_0x2bb1('0x1b')](_0x2bb1('0x1d'),this['squeue']['id'],this[_0x2bb1('0x6')]['id']);util[_0x2bb1('0x1e')](this[_0x2bb1('0x18')],this[_0x2bb1('0x5')]['id'],this[_0x2bb1('0x7')][_0x2bb1('0x12')][this[_0x2bb1('0x6')]['id']],null,this[_0x2bb1('0x4')]);this[_0x2bb1('0x7')][_0x2bb1('0x12')][this[_0x2bb1('0x6')]['id']][_0x2bb1('0x1f')]=![];this[_0x2bb1('0x7')][_0x2bb1('0x12')][this[_0x2bb1('0x6')]['id']]['busyQueue']=undefined;util[_0x2bb1('0x20')](this[_0x2bb1('0x5')]['id'],this[_0x2bb1('0x7')][_0x2bb1('0x12')][this['agent']['id']],_0x3d834b?'STOP':_0x2bb1('0x21'));}if(!_0x3d834b){setTimeout(this[_0x2bb1('0x8')][_0x2bb1('0xa')](this),0x3e8);}};function agent(_0x549137,_0x2d60dd,_0x46ff18,_0x58f32a){return new Agent(_0x549137,_0x2d60dd,_0x46ff18,_0x58f32a);}module[_0x2bb1('0x22')]=agent; \ No newline at end of file +var _0x4b85=['handleDrained','prototype','isNil','agents','agent','info','forcedOwnership','isAgentAvailable','channel','busy','busyQueue','writeLog','RINGING',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','STOP','TIMEOUT','exports','lodash','uuid','./util','../../../../../config/logger','notificationId','squeue','realtime','routing','push','handleRun','bind','handleTimeout','drained'];(function(_0x4b5347,_0xe50c07){var _0x182a1b=function(_0x3bac0e){while(--_0x3bac0e){_0x4b5347['push'](_0x4b5347['shift']());}};_0x182a1b(++_0xe50c07);}(_0x4b85,0x9d));var _0x54b8=function(_0x3e6adc,_0x4f3da0){_0x3e6adc=_0x3e6adc-0x0;var _0x12e215=_0x4b85[_0x3e6adc];return _0x12e215;};'use strict';var _=require(_0x54b8('0x0'));var uuid=require(_0x54b8('0x1'));var util=require(_0x54b8('0x2'));var logger=require(_0x54b8('0x3'))('routing');var Agent=function(_0x19a987,_0x5a0f45,_0x36c921,_0x2a3b0f){this[_0x54b8('0x4')]=uuid['v4']();this[_0x54b8('0x5')]=_0x19a987;this['agent']=_0x5a0f45;this[_0x54b8('0x6')]=_0x36c921;this[_0x54b8('0x7')]=_0x2a3b0f;this[_0x54b8('0x5')][_0x54b8('0x8')](this[_0x54b8('0x9')][_0x54b8('0xa')](this),this[_0x54b8('0xb')][_0x54b8('0xa')](this));this[_0x54b8('0x5')]['on']('timeout',this[_0x54b8('0xb')][_0x54b8('0xa')](this));this[_0x54b8('0x5')]['on'](_0x54b8('0xc'),this[_0x54b8('0xd')]['bind'](this));};Agent[_0x54b8('0xe')][_0x54b8('0x8')]=function(){this[_0x54b8('0x5')][_0x54b8('0x8')](this['handleRun']['bind'](this),this['handleTimeout'][_0x54b8('0xa')](this));};Agent['prototype'][_0x54b8('0xd')]=function(){this[_0x54b8('0xb')](!![]);};Agent[_0x54b8('0xe')]['handleRun']=function(_0x5806e8){logger['info']('[%s][AGENT]\x20try\x20with\x20%s',this[_0x54b8('0x5')]['id'],this['agent']['id']);if(_[_0x54b8('0xf')](this[_0x54b8('0x6')][_0x54b8('0x10')][this[_0x54b8('0x11')]['id']])){logger[_0x54b8('0x12')]('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0x54b8('0x5')]['id'],this['agent']['id']);setTimeout(this['push'][_0x54b8('0xa')](this),0x3e8);}else{if(this['routing'][_0x54b8('0x13')]||util[_0x54b8('0x14')](this['squeue']['id'],this['realtime'][_0x54b8('0x10')][this[_0x54b8('0x11')]['id']],this[_0x54b8('0x5')][_0x54b8('0x15')],![])){this['realtime']['agents'][this['agent']['id']][_0x54b8('0x16')]=!![];this[_0x54b8('0x6')][_0x54b8('0x10')][this['agent']['id']][_0x54b8('0x17')]=undefined;util['showNotification'](this[_0x54b8('0x4')],this[_0x54b8('0x5')]['id'],this[_0x54b8('0x6')][_0x54b8('0x10')][this[_0x54b8('0x11')]['id']],null,this['routing']);util[_0x54b8('0x18')](this[_0x54b8('0x5')]['id'],this[_0x54b8('0x6')]['agents'][this[_0x54b8('0x11')]['id']],_0x54b8('0x19')+(this[_0x54b8('0x7')]['forcedOwnership']?_0x54b8('0x1a'):''));}else{logger[_0x54b8('0x12')](_0x54b8('0x1b'),this[_0x54b8('0x5')]['id'],this[_0x54b8('0x11')]['id']);setTimeout(this['push'][_0x54b8('0xa')](this),0x3e8);}}};Agent[_0x54b8('0xe')][_0x54b8('0xb')]=function(_0x643a93){if(_[_0x54b8('0xf')](this[_0x54b8('0x6')][_0x54b8('0x10')][this[_0x54b8('0x11')]['id']])){return logger[_0x54b8('0x12')](_0x54b8('0x1c'),this[_0x54b8('0x5')]['id'],this[_0x54b8('0x11')]['id']);}else{logger[_0x54b8('0x12')](_0x54b8('0x1d'),this[_0x54b8('0x5')]['id'],this[_0x54b8('0x11')]['id']);util[_0x54b8('0x1e')](this['notificationId'],this[_0x54b8('0x5')]['id'],this[_0x54b8('0x6')][_0x54b8('0x10')][this[_0x54b8('0x11')]['id']],null,this['routing']);this['realtime'][_0x54b8('0x10')][this[_0x54b8('0x11')]['id']][_0x54b8('0x16')]=![];this[_0x54b8('0x6')][_0x54b8('0x10')][this['agent']['id']][_0x54b8('0x17')]=undefined;util[_0x54b8('0x18')](this[_0x54b8('0x5')]['id'],this[_0x54b8('0x6')][_0x54b8('0x10')][this[_0x54b8('0x11')]['id']],_0x643a93?_0x54b8('0x1f'):_0x54b8('0x20'));}if(!_0x643a93){setTimeout(this[_0x54b8('0x8')][_0x54b8('0xa')](this),0x3e8);}};function agent(_0xb3d5fb,_0x9c0950,_0x85e88c,_0x5637b4){return new Agent(_0xb3d5fb,_0x9c0950,_0x85e88c,_0x5637b4);}module[_0x54b8('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 dea0bda..084f869 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 _0x37a7=['[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','writeLog','RINGING','busy','busyQueue','name','notificationId','info','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','[%s][QUEUE]\x20EMPTY','length','STOP','TIMEOUT','exports','lodash','uuid','squeue','queue','realtime','routing','handleRun','bind','handleTimeout','timeout','drained','handleDrained','prototype','push','isNil','Agents','agents'];(function(_0x57c518,_0x6f6ee1){var _0x45c58d=function(_0x50dc4b){while(--_0x50dc4b){_0x57c518['push'](_0x57c518['shift']());}};_0x45c58d(++_0x6f6ee1);}(_0x37a7,0x6f));var _0x737a=function(_0x4186b3,_0x5e73da){_0x4186b3=_0x4186b3-0x0;var _0xde48c5=_0x37a7[_0x4186b3];return _0xde48c5;};'use strict';var _=require(_0x737a('0x0'));var uuid=require(_0x737a('0x1'));var util=require('./util');var logger=require('../../../../../config/logger')('routing');var Beepall=function(_0x2d4b54,_0xc5eaef,_0x53a261,_0x524516){this['notificationId']=uuid['v4']();this[_0x737a('0x2')]=_0x2d4b54;this[_0x737a('0x3')]=_0xc5eaef;this[_0x737a('0x4')]=_0x53a261;this[_0x737a('0x5')]=_0x524516;this[_0x737a('0x2')]['push'](this[_0x737a('0x6')][_0x737a('0x7')](this),this[_0x737a('0x8')][_0x737a('0x7')](this));this['squeue']['on'](_0x737a('0x9'),this[_0x737a('0x8')]['bind'](this));this[_0x737a('0x2')]['on'](_0x737a('0xa'),this[_0x737a('0xb')][_0x737a('0x7')](this));};Beepall[_0x737a('0xc')][_0x737a('0xd')]=function(){this[_0x737a('0x2')]['push'](this[_0x737a('0x6')][_0x737a('0x7')](this),this[_0x737a('0x8')][_0x737a('0x7')](this));};Beepall[_0x737a('0xc')][_0x737a('0xb')]=function(_0x1210f3){this[_0x737a('0x8')](!![]);};Beepall['prototype'][_0x737a('0x6')]=function(_0x34dc87){var _0x5ac00d=!![];if(!_['isNil'](this[_0x737a('0x3')])&&!_[_0x737a('0xe')](this[_0x737a('0x3')][_0x737a('0xf')])&&this[_0x737a('0x3')][_0x737a('0xf')]['length']>0x0){for(var _0x369f2f=0x0,_0x4a8323;_0x369f2f0x0){for(var _0x4d99c0=0x0,_0x3a6e26;_0x4d99c00x0&&_0x1e512d[_0x219be1+_0x5474('0x26')]>=_0x1e512d[_0x219be1+'Capacity']){writeLog(_0xe4850d,_0x1e512d,_0x219be1[_0x5474('0x27')]()+'\x20MAXCAPACITY');return![];}}return!![];};exports[_0x5474('0x28')]=function(_0x1384e4,_0x2a8730,_0x5865fe,_0x574ed6,_0x42b99a){return sendNotification(!![],_0x1384e4,_0x2a8730,_0x5865fe,_0x574ed6,_0x42b99a);};exports['hideNotification']=function(_0x57731b,_0x5d2381,_0x492a31,_0x168dee,_0x1b8adb){return sendNotification(![],_0x57731b,_0x5d2381,_0x492a31,_0x168dee,_0x1b8adb);};exports['writeLog']=writeLog; \ No newline at end of file +var _0xc4aa=['util','../utils','mustache','ioredis','../../../../../config/environment','defaults','redis','localhost','socket.io-emitter','format','user:%s','emit','split','\x20interaction','account','notificationSound','notificationShake','body','queue','getMustacheRender','notificationTemplate','msg','I\x20can\x27t\x20render\x20your\x20template','error','name','notification:%s','save','remove','info','[%s][QUEUE][AGENT:%s][STATUS:%s]','BUSY','online','OFFLINE','Pause','PAUSE','hasOwnProperty','Capacity','CurrentCapacity','toUpperCase','\x20MAXCAPACITY','showNotification','hideNotification','writeLog','lodash'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0xc4aa[_0x46698a];return _0x356db0;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var utils=require(_0xac4a('0x2'));var Mustache=require(_0xac4a('0x3'));var Redis=require(_0xac4a('0x4'));var config=require(_0xac4a('0x5'));var logger=require('../../../../../config/logger')('routing');config['redis']=_[_0xac4a('0x6')](config[_0xac4a('0x7')],{'host':_0xac4a('0x8'),'port':0x18eb});var io=require(_0xac4a('0x9'))(new Redis(config[_0xac4a('0x7')]));function emit(_0x15cd34,_0x3ef77c,_0x10525b){io['to'](_0x15cd34)['emit'](_0x3ef77c,_0x10525b);}function sendNotification(_0x5b8339,_0x1aba6d,_0x2a4d53,_0x26ec84,_0x4f4146,_0x1d182e){io['to'](util[_0xac4a('0xa')](_0xac4a('0xb'),_0x26ec84['name']))[_0xac4a('0xc')]('user:save',_0x26ec84);var _0x2f062c=_0x1d182e||{};var _0x4855b6=_0x2a4d53[_0xac4a('0xd')]('.');var _0x2a0776={'uniqueid':_0x1aba6d,'channel':_0x4855b6[0x0],'id':_0x4855b6[0x1],'title':_0x4855b6[0x0]+_0xac4a('0xe'),'interactionId':_0x4855b6[0x2],'queue':_0x4f4146?_0x4f4146['name']:null,'sound':_0x2f062c[_0xac4a('0xf')][_0xac4a('0x10')],'shake':_0x2f062c[_0xac4a('0xf')][_0xac4a('0x11')]};try{if(!_0x2f062c[_0xac4a('0x12')]){_0x2f062c[_0xac4a('0x12')]={};}if(_0x4f4146){_0x2f062c[_0xac4a('0x12')][_0xac4a('0x13')]=_0x4f4146;}else if(_0x2f062c[_0xac4a('0x12')][_0xac4a('0x13')]){delete _0x2f062c[_0xac4a('0x12')][_0xac4a('0x13')];}_0x2a0776['msg']=utils[_0xac4a('0x14')](_0x2f062c[_0xac4a('0xf')][_0xac4a('0x15')],_0x2f062c);}catch(_0x144553){_0x2a0776[_0xac4a('0x16')]=_0xac4a('0x17');logger[_0xac4a('0x18')](util[_0xac4a('0xa')]('[%s][QUEUE]\x20%s',_0x1aba6d,_0x144553['message']));}io['to'](util[_0xac4a('0xa')](_0xac4a('0xb'),_0x26ec84[_0xac4a('0x19')]))['emit'](util[_0xac4a('0xa')](_0xac4a('0x1a'),_0x5b8339?_0xac4a('0x1b'):_0xac4a('0x1c')),_0x2a0776);}function writeLog(_0x123694,_0x3e829c,_0xe38996){return logger[_0xac4a('0x1d')](util['format'](_0xac4a('0x1e'),_0x123694,_0x3e829c[_0xac4a('0x19')],_0xe38996));}exports['isAgentAvailable']=function(_0x3d7ce0,_0x4169c0,_0x3eacd3,_0x947d8e){if(_0x4169c0['busy']){writeLog(_0x3d7ce0,_0x4169c0,_0xac4a('0x1f'));return![];}if(!_0x4169c0[_0xac4a('0x20')]){writeLog(_0x3d7ce0,_0x4169c0,_0xac4a('0x21'));return![];}if(_0x4169c0[_0x3eacd3+_0xac4a('0x22')]){writeLog(_0x3d7ce0,_0x4169c0,_0xac4a('0x23'));return![];}if(_0x947d8e&&_0x4169c0[_0xac4a('0x24')](_0x3eacd3+_0xac4a('0x25'))&&_0x4169c0[_0xac4a('0x24')](_0x3eacd3+_0xac4a('0x26'))){if(_0x4169c0[_0x3eacd3+_0xac4a('0x25')]>0x0&&_0x4169c0[_0x3eacd3+_0xac4a('0x26')]>=_0x4169c0[_0x3eacd3+_0xac4a('0x25')]){writeLog(_0x3d7ce0,_0x4169c0,_0x3eacd3[_0xac4a('0x27')]()+_0xac4a('0x28'));return![];}}return!![];};exports[_0xac4a('0x29')]=function(_0x20202c,_0x4e17ce,_0x23b061,_0x267a22,_0x42a33c){return sendNotification(!![],_0x20202c,_0x4e17ce,_0x23b061,_0x267a22,_0x42a33c);};exports[_0xac4a('0x2a')]=function(_0x116700,_0x4a5a9e,_0x47f49c,_0xdb7e,_0x7a948b){return sendNotification(![],_0x116700,_0x4a5a9e,_0x47f49c,_0xdb7e,_0x7a948b);};exports[_0xac4a('0x2b')]=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 92c55b4..f962492 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 _0x25b0=['error','[%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','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','isObject','stringify','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','validate','shelljs','lodash','./utils','../../../../config/logger','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x25b0,0x140));var _0x025b=function(_0x2932cf,_0x362fd9){_0x2932cf=_0x2932cf-0x0;var _0x1711dd=_0x25b0[_0x2932cf];return _0x1711dd;};'use strict';var schema=require(_0x025b('0x0'));var sh=require(_0x025b('0x1'));var _=require(_0x025b('0x2'));var utils=require(_0x025b('0x3'));var logger=require(_0x025b('0x4'))(_0x025b('0x5'));var system=schema({'command':{'type':_0x025b('0x6'),'required':!![],'message':_0x025b('0x7')}});exports[_0x025b('0x8')]=function(_0x286601,_0x516a8d){return function(_0xf0bd10){try{var _0x41b88b={'command':_0x516a8d[0x0]};var _0x41d8a4=system['validate'](_0x41b88b,{'typecast':!![]});if(_0x41d8a4[_0x025b('0x9')]){logger[_0x025b('0xa')](_0x025b('0xb'),_0x286601,_[_0x025b('0xc')](_0x41d8a4,_0x025b('0xd'))[_0x025b('0xe')](',\x20'));logger[_0x025b('0xf')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x286601);_0xf0bd10[_0x025b('0x10')]();}else{var _0x30d59e=this;var _0x3fb897=utils[_0x025b('0x11')](_0x516a8d[0x0],this);logger[_0x025b('0xf')](_0x025b('0x12'),_0x286601,_0x3fb897);sh[_0x025b('0x13')](_[_0x025b('0x14')](_0x3fb897),function(_0x2cf688,_0x5a80a3){logger[_0x025b('0xf')](_0x025b('0x15'),_0x286601,_0x2cf688);if(_0x2cf688==0x0){var _0x288d63=_0x5a80a3[_0x025b('0x16')](/(\r\n|\n|\r)/gm,'');if(_[_0x025b('0x17')](_0x516a8d[0x1])||_['isEmpty'](_0x516a8d[0x1])){logger[_0x025b('0xf')](_0x025b('0x18'),_0x286601);_0x30d59e[_0x025b('0x19')][_0x516a8d[0x1]]=_0x288d63;}else{logger[_0x025b('0xf')](_0x025b('0x1a'),_0x286601,_0x516a8d[0x1],_0x288d63);_0x30d59e[_0x025b('0x19')][_0x516a8d[0x1]]=_0x288d63;}}_0xf0bd10[_0x025b('0x10')]();});}}catch(_0x50d54b){logger[_0x025b('0xa')](_0x025b('0xb'),_0x286601,_[_0x025b('0x1b')](_0x50d54b)?JSON[_0x025b('0x1c')](_0x50d54b):_0x50d54b);logger[_0x025b('0xf')](_0x025b('0x1d'),_0x286601);_0xf0bd10[_0x025b('0x10')]();}};}; \ No newline at end of file +var _0x67c7=['command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','length','error','[%s][SYSTEM]\x20%s','map','message','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','isObject','stringify','validate','shelljs','lodash','./utils','../../../../config/logger','routing','string'];(function(_0x3441d0,_0x17d75b){var _0x1c1e06=function(_0x5159a3){while(--_0x5159a3){_0x3441d0['push'](_0x3441d0['shift']());}};_0x1c1e06(++_0x17d75b);}(_0x67c7,0x172));var _0x767c=function(_0x3e750b,_0x2070d9){_0x3e750b=_0x3e750b-0x0;var _0x1e2ac3=_0x67c7[_0x3e750b];return _0x1e2ac3;};'use strict';var schema=require(_0x767c('0x0'));var sh=require(_0x767c('0x1'));var _=require(_0x767c('0x2'));var utils=require(_0x767c('0x3'));var logger=require(_0x767c('0x4'))(_0x767c('0x5'));var system=schema({'command':{'type':_0x767c('0x6'),'required':!![],'message':_0x767c('0x7')}});exports['consequence']=function(_0x30fc1c,_0x3cf008){return function(_0x53a5a7){try{var _0x116f27={'command':_0x3cf008[0x0]};var _0xf3bf74=system[_0x767c('0x0')](_0x116f27,{'typecast':!![]});if(_0xf3bf74[_0x767c('0x8')]){logger[_0x767c('0x9')](_0x767c('0xa'),_0x30fc1c,_[_0x767c('0xb')](_0xf3bf74,_0x767c('0xc'))[_0x767c('0xd')](',\x20'));logger[_0x767c('0xe')](_0x767c('0xf'),_0x30fc1c);_0x53a5a7[_0x767c('0x10')]();}else{var _0x19722a=this;var _0x199177=utils[_0x767c('0x11')](_0x3cf008[0x0],this);logger['info'](_0x767c('0x12'),_0x30fc1c,_0x199177);sh[_0x767c('0x13')](_[_0x767c('0x14')](_0x199177),function(_0x32fc1f,_0x5a8b08){logger[_0x767c('0xe')](_0x767c('0x15'),_0x30fc1c,_0x32fc1f);if(_0x32fc1f==0x0){var _0x206983=_0x5a8b08[_0x767c('0x16')](/(\r\n|\n|\r)/gm,'');if(_['isNil'](_0x3cf008[0x1])||_[_0x767c('0x17')](_0x3cf008[0x1])){logger[_0x767c('0xe')](_0x767c('0x18'),_0x30fc1c);_0x19722a[_0x767c('0x19')][_0x3cf008[0x1]]=_0x206983;}else{logger[_0x767c('0xe')](_0x767c('0x1a'),_0x30fc1c,_0x3cf008[0x1],_0x206983);_0x19722a[_0x767c('0x19')][_0x3cf008[0x1]]=_0x206983;}}_0x53a5a7[_0x767c('0x10')]();});}}catch(_0x1d07fc){logger['error'](_0x767c('0xa'),_0x30fc1c,_[_0x767c('0x1b')](_0x1d07fc)?JSON[_0x767c('0x1c')](_0x1d07fc):_0x1d07fc);logger[_0x767c('0xe')](_0x767c('0xf'),_0x30fc1c);_0x53a5a7[_0x767c('0x10')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/tag.js b/server/services/routing/server/applications/tag.js index e5f6426..766d5e4 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 _0xcb97=['../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../../../config/logger','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','[%s][TAG]\x20%s','message','join','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction','addTags','interaction','then','info','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','catch','stringify','finally','error','isObject','validate','lodash','../../rpc/chatInteraction','../../rpc/mailInteraction'];(function(_0xa79520,_0x3d9a1a){var _0x4a7e1e=function(_0x42c5d9){while(--_0x42c5d9){_0xa79520['push'](_0xa79520['shift']());}};_0x4a7e1e(++_0x3d9a1a);}(_0xcb97,0x114));var _0x7cb9=function(_0x53561b,_0x1706b3){_0x53561b=_0x53561b-0x0;var _0x3fa06d=_0xcb97[_0x53561b];return _0x3fa06d;};'use strict';var schema=require(_0x7cb9('0x0'));var _=require(_0x7cb9('0x1'));var rpc={'chatInteraction':require(_0x7cb9('0x2')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0x7cb9('0x3')),'faxInteraction':require(_0x7cb9('0x4')),'whatsappInteraction':require(_0x7cb9('0x5'))};var logger=require(_0x7cb9('0x6'))('routing');var tag=schema({'tag':{'type':_0x7cb9('0x7'),'required':!![],'message':_0x7cb9('0x8')}});exports[_0x7cb9('0x9')]=function(_0x4b2eca,_0x4c8f18,_0x81c04f,_0xb71c97){return function(_0x43725a){try{var _0x510f85={'tag':_0x4c8f18[0x0]};var _0x57b6e1=tag[_0x7cb9('0x0')](_0x510f85,{'typecast':!![]});if(_0x57b6e1[_0x7cb9('0xa')]){logger['error'](_0x7cb9('0xb'),_0x4b2eca,_['map'](_0x57b6e1,_0x7cb9('0xc'))[_0x7cb9('0xd')](',\x20'));logger['info'](_0x7cb9('0xe'),_0x4b2eca);_0x43725a[_0x7cb9('0xf')]();}else{var _0x138b8d={'ids':[_0x4c8f18[0x0]]};if(rpc[_0xb71c97['channel']+'Interaction']){rpc[_0xb71c97[_0x7cb9('0x10')]+_0x7cb9('0x11')][_0x7cb9('0x12')](_0xb71c97[_0x7cb9('0x13')]['id'],_0x138b8d)[_0x7cb9('0x14')](function(_0x5e7ba4){logger[_0x7cb9('0x15')](_0x7cb9('0x16'),_0x4b2eca,_0x4c8f18[0x1],_0xb71c97[_0x7cb9('0x10')],_0xb71c97[_0x7cb9('0x13')]['id']);})[_0x7cb9('0x17')](function(_0x14c0ab){logger['error']('[%s][TAG]\x20%s',_0x4b2eca,JSON[_0x7cb9('0x18')](_0x14c0ab));logger[_0x7cb9('0x15')](_0x7cb9('0xe'),_0x4b2eca);})[_0x7cb9('0x19')](function(){_0x43725a[_0x7cb9('0xf')]();});}}}catch(_0x428088){logger[_0x7cb9('0x1a')](_0x7cb9('0xb'),_0x4b2eca,_[_0x7cb9('0x1b')](_0x428088)?JSON[_0x7cb9('0x18')](_0x428088):_0x428088);logger['info'](_0x7cb9('0xe'),_0x4b2eca);_0x43725a[_0x7cb9('0xf')]();}};}; \ No newline at end of file +var _0xd9d8=['routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][TAG]\x20%s','map','message','join','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next','next','channel','Interaction','addTags','interaction','then','catch','stringify','info','finally','isObject','validate','lodash','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','../../rpc/whatsappInteraction','../../../../config/logger'];(function(_0xb4c736,_0x3c97a6){var _0x4a67c8=function(_0x300f74){while(--_0x300f74){_0xb4c736['push'](_0xb4c736['shift']());}};_0x4a67c8(++_0x3c97a6);}(_0xd9d8,0xb1));var _0x8d9d=function(_0x1be157,_0x97edbe){_0x1be157=_0x1be157-0x0;var _0x42e690=_0xd9d8[_0x1be157];return _0x42e690;};'use strict';var schema=require(_0x8d9d('0x0'));var _=require(_0x8d9d('0x1'));var rpc={'chatInteraction':require(_0x8d9d('0x2')),'openchannelInteraction':require(_0x8d9d('0x3')),'smsInteraction':require(_0x8d9d('0x4')),'mailInteraction':require(_0x8d9d('0x5')),'faxInteraction':require(_0x8d9d('0x6')),'whatsappInteraction':require(_0x8d9d('0x7'))};var logger=require(_0x8d9d('0x8'))(_0x8d9d('0x9'));var tag=schema({'tag':{'type':_0x8d9d('0xa'),'required':!![],'message':_0x8d9d('0xb')}});exports[_0x8d9d('0xc')]=function(_0x393966,_0x31e9b8,_0x3c67e6,_0x38d5d7){return function(_0x1ae260){try{var _0x372fba={'tag':_0x31e9b8[0x0]};var _0x19c44d=tag[_0x8d9d('0x0')](_0x372fba,{'typecast':!![]});if(_0x19c44d[_0x8d9d('0xd')]){logger[_0x8d9d('0xe')](_0x8d9d('0xf'),_0x393966,_[_0x8d9d('0x10')](_0x19c44d,_0x8d9d('0x11'))[_0x8d9d('0x12')](',\x20'));logger['info'](_0x8d9d('0x13'),_0x393966);_0x1ae260[_0x8d9d('0x14')]();}else{var _0x4c1412={'ids':[_0x31e9b8[0x0]]};if(rpc[_0x38d5d7[_0x8d9d('0x15')]+_0x8d9d('0x16')]){rpc[_0x38d5d7[_0x8d9d('0x15')]+'Interaction'][_0x8d9d('0x17')](_0x38d5d7[_0x8d9d('0x18')]['id'],_0x4c1412)[_0x8d9d('0x19')](function(_0x234a08){logger['info']('[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s',_0x393966,_0x31e9b8[0x1],_0x38d5d7[_0x8d9d('0x15')],_0x38d5d7[_0x8d9d('0x18')]['id']);})[_0x8d9d('0x1a')](function(_0x1101b0){logger[_0x8d9d('0xe')](_0x8d9d('0xf'),_0x393966,JSON[_0x8d9d('0x1b')](_0x1101b0));logger[_0x8d9d('0x1c')](_0x8d9d('0x13'),_0x393966);})[_0x8d9d('0x1d')](function(){_0x1ae260[_0x8d9d('0x14')]();});}}}catch(_0x118954){logger[_0x8d9d('0xe')](_0x8d9d('0xf'),_0x393966,_[_0x8d9d('0x1e')](_0x118954)?JSON[_0x8d9d('0x1b')](_0x118954):_0x118954);logger[_0x8d9d('0x1c')](_0x8d9d('0x13'),_0x393966);_0x1ae260[_0x8d9d('0x14')]();}};}; \ 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 c6f9ced..4838730 100644 --- a/server/services/routing/server/applications/utils.js +++ b/server/services/routing/server/applications/utils.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['exports','render','merge','body','contact','message','account','interaction','list','mustache','lodash'];(function(_0x1f38dd,_0x2b8969){var _0x408adb=function(_0x2b6045){while(--_0x2b6045){_0x1f38dd['push'](_0x1f38dd['shift']());}};_0x408adb(++_0x2b8969);}(_0xe706,0xa3));var _0x6e70=function(_0x2db146,_0x509cc5){_0x2db146=_0x2db146-0x0;var _0x524bcb=_0xe706[_0x2db146];return _0x524bcb;};'use strict';var Mustache=require(_0x6e70('0x0'));var _=require(_0x6e70('0x1'));module[_0x6e70('0x2')]={'getMustacheRender':function(_0x5e8446,_0x2cae77){return Mustache[_0x6e70('0x3')](_0x5e8446,_[_0x6e70('0x4')](_0x2cae77[_0x6e70('0x5')],{'contact':_0x2cae77[_0x6e70('0x6')],'message':_0x2cae77[_0x6e70('0x7')],'account':_0x2cae77[_0x6e70('0x8')],'interaction':_0x2cae77[_0x6e70('0x9')],'list':_0x2cae77[_0x6e70('0xa')]}))||'';}}; \ No newline at end of file +var _0xa9e0=['message','account','interaction','mustache','lodash','exports','render','body','contact'];(function(_0x233296,_0x2bd683){var _0x3f46e8=function(_0xff2bb8){while(--_0xff2bb8){_0x233296['push'](_0x233296['shift']());}};_0x3f46e8(++_0x2bd683);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf71120,_0x25b7f9){_0xf71120=_0xf71120-0x0;var _0xbe2fd3=_0xa9e0[_0xf71120];return _0xbe2fd3;};'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 27180fa..8c3bc75 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 _0x1465=['isNil','IntervalId','Intervals','map','interval','listen','rules','channel','message','interaction','applications','isArray','length','existsSync','.js','app','toLowerCase','appdata','split','mail','push','slice','join','dialogflow','dialogflowv2','amazonlex','TagId','format','%s:%s:%s','./interval','condition','intervals','./applications/','consequence','priority','info','Push\x20new\x20rule','on\x20interval','\x20|\x20','error','Applications\x20executed','stringify','emit','complete','No\x20applications\x20to\x20execute','stack','routing\x20is\x20empty','agent','agents','busyQueue','QueueReport','update','UserId','catch','message\x20is\x20empty','busy','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','chatQueues','available','loggedIn','name','paused','waiting','mailQueues','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','whatsappQueuesWaitingInteractions','server','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','bluebird','uuid','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','%s.%s.%s'];(function(_0x37ded3,_0x371ebb){var _0x51e49e=function(_0x30cc78){while(--_0x30cc78){_0x37ded3['push'](_0x37ded3['shift']());}};_0x51e49e(++_0x371ebb);}(_0x1465,0x1c7));var _0x5146=function(_0x2132a3,_0x4639e9){_0x2132a3=_0x2132a3-0x0;var _0x21890c=_0x1465[_0x2132a3];return _0x21890c;};'use strict';var _=require(_0x5146('0x0'));var util=require(_0x5146('0x1'));var path=require('path');var fs=require('fs');var jayson=require(_0x5146('0x2'));var BPromise=require(_0x5146('0x3'));var uuid=require(_0x5146('0x4'));var config=require('../../../config/environment');var logger=require(_0x5146('0x5'))(_0x5146('0x6'));var rpc={'openchannelQueueReport':require(_0x5146('0x7')),'mailQueueReport':require(_0x5146('0x8')),'chatQueueReport':require('../rpc/chatQueueReport'),'smsQueueReport':require('../rpc/smsQueueReport'),'faxQueueReport':require('../rpc/faxQueueReport'),'whatsappQueueReport':require('../rpc/whatsappQueueReport')};var RuleEngine=require('../lib/rule-engine');function getId(_0x21813c,_0x28e0ed,_0x4acb43){return util['format'](_0x5146('0x9'),_0x21813c,_0x28e0ed||0x0,_0x4acb43||0x0);}function getIntervals(_0x1709fa,_0x5f1167){var _0x20b852=[];if(!_[_0x5146('0xa')](_0x5f1167[_0x5146('0xb')])&&!_[_0x5146('0xa')](_0x1709fa[_0x5f1167[_0x5146('0xb')]])&&!_[_0x5146('0xa')](_0x1709fa[_0x5f1167[_0x5146('0xb')]][_0x5146('0xc')])){_0x20b852=_[_0x5146('0xd')](_0x1709fa[_0x5f1167[_0x5146('0xb')]][_0x5146('0xc')],'interval');}else if(!_['isNil'](_0x5f1167[_0x5146('0xe')])){_0x20b852=[_0x5f1167[_0x5146('0xe')]];}return _0x20b852;}exports[_0x5146('0xf')]=function(_0x5d71ee){_0x5d71ee[_0x5146('0x10')]={};return new BPromise(function(_0x4a6929,_0x13702a){var _0x1e5f90={'Start':function(_0x362401){var _0x3a8f08=this;return new Promise(function(_0x1e0926,_0x2e86e9){if(_0x362401){try{var _0x5b95c5=[];var _0x5269c2=getId(_0x362401[_0x5146('0x11')],_0x362401[_0x5146('0x12')]?_0x362401[_0x5146('0x12')]['id']:0x0,_0x362401[_0x5146('0x13')]?_0x362401['interaction']['id']:0x0);if(_0x362401[_0x5146('0x14')]&&_[_0x5146('0x15')](_0x362401['applications'])&&_0x362401[_0x5146('0x14')][_0x5146('0x16')]){for(var _0x295c11=0x0;_0x295c11<_0x362401[_0x5146('0x14')][_0x5146('0x16')];_0x295c11+=0x1){var _0xbe944e=_0x362401[_0x5146('0x14')][_0x295c11];if(fs[_0x5146('0x17')](path['join'](__dirname,_0x5146('0x14'),_0xbe944e['app']+_0x5146('0x18')))){var _0x2360c6=[];switch(_0xbe944e[_0x5146('0x19')][_0x5146('0x1a')]()){case'autoreply':var _0xd33f72=_0xbe944e[_0x5146('0x1b')][_0x5146('0x1c')](',');if(_0x362401['channel']===_0x5146('0x1d')){_0x2360c6[_0x5146('0x1e')](_0xd33f72[0x0]);_0x2360c6['push'](_0xd33f72[0x1]);_0x2360c6[_0x5146('0x1e')](_0xd33f72[_0x5146('0x1f')](0x2,_0xd33f72['length'])[_0x5146('0x20')](','));}else{_0x2360c6[_0x5146('0x1e')](_0xd33f72[0x0]);_0x2360c6[_0x5146('0x1e')](_0xd33f72[_0x5146('0x1f')](0x1,_0xd33f72[_0x5146('0x16')])[_0x5146('0x20')](','));}break;case _0x5146('0x21'):var _0x23e282=_0xbe944e['appdata'][_0x5146('0x1c')](',');_0x2360c6['push'](_0x23e282[0x0]);_0x2360c6[_0x5146('0x1e')](_0x23e282[0x1]);_0x2360c6[_0x5146('0x1e')](_0x23e282[_0x5146('0x1f')](0x2,_0x23e282[_0x5146('0x16')])[_0x5146('0x20')](','));break;case _0x5146('0x22'):var _0x345ab4=_0xbe944e[_0x5146('0x1b')]['split'](',');_0x2360c6['push'](_0x345ab4[0x0]);_0x2360c6['push'](_0x345ab4[0x1]);_0x2360c6[_0x5146('0x1e')](_0x345ab4[0x2]);_0x2360c6[_0x5146('0x1e')](_0x345ab4[0x3]);_0x2360c6['push'](_0x345ab4[_0x5146('0x1f')](0x4,_0x345ab4[_0x5146('0x16')])['join'](','));break;case _0x5146('0x23'):var _0x5d4a06=_0xbe944e[_0x5146('0x1b')]['split'](',');_0x2360c6[_0x5146('0x1e')](_0x5d4a06[0x0]);_0x2360c6[_0x5146('0x1e')](_0x5d4a06[0x1]);_0x2360c6['push'](_0x5d4a06[0x2]);_0x2360c6[_0x5146('0x1e')](_0x5d4a06[0x3]);_0x2360c6['push'](_0x5d4a06[_0x5146('0x1f')](0x4,_0x5d4a06['length'])[_0x5146('0x20')](','));break;case _0x5146('0x12'):_0x2360c6['push'](_0xbe944e[_0x5146('0x1b')]);break;case'tag':_0x2360c6['push'](_0xbe944e[_0x5146('0x24')]);_0x2360c6[_0x5146('0x1e')](_0xbe944e[_0x5146('0x1b')]);break;default:_0x2360c6=_[_0x5146('0xa')](_0xbe944e[_0x5146('0x1b')])?[]:_0xbe944e['appdata'][_0x5146('0x1c')](',');}var _0x533f51={'id':util[_0x5146('0x25')](_0x5146('0x26'),_0x5269c2,_0xbe944e['id'],_0xbe944e[_0x5146('0x19')]),'condition':require(_0x5146('0x27'))[_0x5146('0x28')](_0x5269c2,getIntervals(_0x5d71ee[_0x5146('0x29')],_0xbe944e),_0x5d71ee),'consequence':require(_0x5146('0x2a')+_0xbe944e[_0x5146('0x19')])[_0x5146('0x2b')](_0x5269c2,_0x2360c6,_0x5d71ee,_0x362401),'p':_0xbe944e[_0x5146('0x2c')]||0x0};logger[_0x5146('0x2d')](_0x5146('0x2e'),_0x533f51['id'],_0x5146('0x2f'),getIntervals(_0x5d71ee[_0x5146('0x29')],_0xbe944e)['join'](_0x5146('0x30')));_0x5b95c5['push'](_0x533f51);}else{logger[_0x5146('0x31')]('Please\x20create\x20a\x20new\x20file\x20under',path[_0x5146('0x20')](__dirname,_0x5146('0x14'),_0xbe944e[_0x5146('0x19')]+_0x5146('0x18')));}}_0x5d71ee[_0x5146('0x10')][_0x5269c2]=new RuleEngine(_0x5b95c5);_0x5d71ee[_0x5146('0x10')][_0x5269c2]['execute'](_0x362401,function(_0x4e7d7a){logger[_0x5146('0x2d')](_0x5146('0x32'),JSON[_0x5146('0x33')](_0x4e7d7a['matchPath']));if(_0x5d71ee[_0x5146('0x10')][_0x5269c2]){_0x5d71ee[_0x5146('0x10')][_0x5269c2][_0x5146('0x34')](_0x5146('0x35'));}});return _0x1e0926({'code':0xc8,'message':_0x362401});}else{logger[_0x5146('0x2d')](_0x5146('0x36'));return _0x1e0926({'code':0xc8,'message':_0x362401});}}catch(_0x4b4021){logger[_0x5146('0x31')](_0x4b4021[_0x5146('0x37')]);return _0x2e86e9(_0x3a8f08[_0x5146('0x31')](0x1f4,_0x4b4021));}}return _0x2e86e9(_0x5146('0x38'));});},'AcceptMessage':function(_0x1d736e){var _0x1d7b80=this;return new Promise(function(_0x32f964,_0x53a0c8){if(_0x1d736e[_0x5146('0x39')]&&_0x1d736e['agent']['id']){if(_0x5d71ee['agents'][_0x1d736e[_0x5146('0x39')]['id']]){_0x5d71ee[_0x5146('0x3a')][_0x1d736e[_0x5146('0x39')]['id']]['busy']=![];_0x5d71ee['agents'][_0x1d736e[_0x5146('0x39')]['id']][_0x5146('0x3b')]=undefined;}}if(_0x1d736e['message']&&_0x1d736e[_0x5146('0x12')]['id']){try{var _0xf4eb7e=getId(_0x1d736e[_0x5146('0x11')],_0x1d736e['message']?_0x1d736e[_0x5146('0x12')]['id']:0x0,_0x1d736e[_0x5146('0x13')]?_0x1d736e[_0x5146('0x13')]['id']:0x0);if(_0x5d71ee[_0x5146('0x10')][_0xf4eb7e]){_0x5d71ee[_0x5146('0x10')][_0xf4eb7e]['emit']('end');if(rpc[_0x1d736e['channel']+'QueueReport']){rpc[_0x1d736e[_0x5146('0x11')]+_0x5146('0x3c')][_0x5146('0x3d')](_0xf4eb7e,{'UserId':_0x1d736e['message'][_0x5146('0x3e')]})[_0x5146('0x3f')](function(_0x2af247){logger[_0x5146('0x31')]('error\x20update\x20queue\x20report');});}}return _0x32f964({'code':0xc8,'message':_0x1d736e});}catch(_0xf2c8c1){logger[_0x5146('0x31')](_0xf2c8c1[_0x5146('0x37')]);return _0x53a0c8(_0x1d7b80[_0x5146('0x31')](0x1f4,_0xf2c8c1));}}logger['error'](_0x5146('0x40'));return _0x53a0c8(_0x1d7b80[_0x5146('0x31')](0x1f4,_0x5146('0x40')));});},'RejectMessage':function(_0x1e572d){var _0x2ab619=this;return new Promise(function(_0x2aace3,_0x2e248a){if(_0x1e572d[_0x5146('0x39')]&&_0x1e572d[_0x5146('0x39')]['id']){try{if(_0x5d71ee[_0x5146('0x3a')][_0x1e572d[_0x5146('0x39')]['id']]){_0x5d71ee[_0x5146('0x3a')][_0x1e572d[_0x5146('0x39')]['id']][_0x5146('0x41')]=![];_0x5d71ee[_0x5146('0x3a')][_0x1e572d[_0x5146('0x39')]['id']][_0x5146('0x3b')]=undefined;}return _0x2aace3({'code':0xc8,'message':_0x1e572d});}catch(_0x56b616){logger['error'](_0x56b616[_0x5146('0x37')]);return _0x2e248a(_0x2ab619[_0x5146('0x31')](0x1f4,_0x56b616));}}logger[_0x5146('0x31')](_0x5146('0x40'));return _0x2e248a(_0x2ab619[_0x5146('0x31')](0x1f4,'message\x20is\x20empty'));});},'AbandonInteraction':function(_0x4dfbf4){var _0x36bb25=this;return new Promise(function(_0x1a4202,_0x201a0f){if(_0x4dfbf4[_0x5146('0x11')]&&_0x4dfbf4['interaction']&&_0x4dfbf4[_0x5146('0x13')]['id']){try{var _0x3dee7a=getId(_0x4dfbf4['channel'],_0x4dfbf4[_0x5146('0x12')]?_0x4dfbf4[_0x5146('0x12')]['id']:0x0,_0x4dfbf4['interaction']?_0x4dfbf4[_0x5146('0x13')]['id']:0x0);if(_0x5d71ee[_0x5146('0x10')][_0x3dee7a]){_0x5d71ee[_0x5146('0x10')][_0x3dee7a]['emit']('end');}return _0x1a4202({'code':0xc8,'message':_0x4dfbf4});}catch(_0x454ea2){logger['error'](_0x454ea2['stack']);return _0x201a0f(_0x36bb25[_0x5146('0x31')](0x1f4,_0x454ea2));}}logger[_0x5146('0x31')]('message\x20is\x20empty');return _0x201a0f(_0x36bb25[_0x5146('0x31')](0x1f4,_0x5146('0x40')));});},'AgentCapacity':function(_0x1b36dd){var _0x5d9e90=this;return new Promise(function(_0x2ef89f,_0x2c56b5){if(_0x5d71ee['agents'][_0x5146('0x42')](_0x1b36dd['id'])){for(var _0x26babf in _0x1b36dd[_0x5146('0x43')]){if(_0x1b36dd[_0x5146('0x43')][_0x5146('0x42')](_0x26babf)){if(_0x5d71ee['agents'][_0x1b36dd['id']][_0x5146('0x42')](_0x26babf+'CurrentCapacity')){_0x5d71ee['agents'][_0x1b36dd['id']][_0x26babf+_0x5146('0x44')]=parseInt(_0x1b36dd[_0x5146('0x43')][_0x26babf],0xa);}}}_0x5d71ee['agents'][_0x1b36dd['id']][_0x5146('0x45')]();return _0x2ef89f({'code':0xc8,'message':_0x5d71ee[_0x5146('0x3a')][_0x1b36dd['id']]});}else{return _0x2c56b5(_0x5d9e90[_0x5146('0x31')](0x1f4,_0x5146('0x46')));}});},'Agents':function(_0x41f4be){return new Promise(function(_0x14801c,_0x11cad8){var _0x14de55=_[_0x5146('0x47')](_0x5d71ee['agents']);_0x14801c({'count':_0x14de55[_0x5146('0x16')],'rows':_0x14de55});});},'ChatQueues':function(_0x53382d){return new Promise(function(_0x4a2151,_0x3d6c75){var _0x553ad6=[];for(var _0x4afe0b in _0x5d71ee['chatQueues']){if(_0x5d71ee[_0x5146('0x48')][_0x5146('0x42')](_0x4afe0b)){var _0x538a6a=_0x5d71ee['chatQueues'][_0x4afe0b];var _0x29dd63={'id':_0x538a6a['id'],'available':_0x538a6a[_0x5146('0x49')],'loggedIn':_0x538a6a[_0x5146('0x4a')],'name':_0x538a6a[_0x5146('0x4b')],'paused':_0x538a6a[_0x5146('0x4c')],'waiting':_0x538a6a[_0x5146('0x4d')]};_0x553ad6['push'](_0x29dd63);}}_0x4a2151({'count':_0x553ad6[_0x5146('0x16')],'rows':_0x553ad6});});},'MailQueues':function(_0x7302b4){return new Promise(function(_0x263f3f,_0x2df870){var _0x507a05=[];for(var _0x32d5a7 in _0x5d71ee[_0x5146('0x4e')]){if(_0x5d71ee[_0x5146('0x4e')][_0x5146('0x42')](_0x32d5a7)){var _0x175df1=_0x5d71ee['mailQueues'][_0x32d5a7];var _0x68456f={'id':_0x175df1['id'],'available':_0x175df1['available'],'loggedIn':_0x175df1[_0x5146('0x4a')],'name':_0x175df1['name'],'paused':_0x175df1['paused'],'waiting':_0x175df1[_0x5146('0x4d')]};_0x507a05['push'](_0x68456f);}}_0x263f3f({'count':_0x507a05[_0x5146('0x16')],'rows':_0x507a05});});},'OpenchannelQueues':function(_0x190202){return new Promise(function(_0x3247af,_0x4ea102){var _0x3ad799=[];for(var _0x101df3 in _0x5d71ee[_0x5146('0x4f')]){if(_0x5d71ee['openchannelQueues'][_0x5146('0x42')](_0x101df3)){var _0x56a335=_0x5d71ee[_0x5146('0x4f')][_0x101df3];var _0x43421f={'id':_0x56a335['id'],'available':_0x56a335[_0x5146('0x49')],'loggedIn':_0x56a335[_0x5146('0x4a')],'name':_0x56a335['name'],'paused':_0x56a335[_0x5146('0x4c')],'waiting':_0x56a335[_0x5146('0x4d')]};_0x3ad799[_0x5146('0x1e')](_0x43421f);}}_0x3247af({'count':_0x3ad799['length'],'rows':_0x3ad799});});},'SmsQueues':function(_0x4548a8){return new Promise(function(_0x182b79,_0x5219f5){var _0x5a5764=[];for(var _0x1d2885 in _0x5d71ee[_0x5146('0x50')]){if(_0x5d71ee['smsQueues'][_0x5146('0x42')](_0x1d2885)){var _0x287c6d=_0x5d71ee[_0x5146('0x50')][_0x1d2885];var _0x1f42d5={'id':_0x287c6d['id'],'available':_0x287c6d[_0x5146('0x49')],'loggedIn':_0x287c6d['loggedIn'],'name':_0x287c6d['name'],'paused':_0x287c6d[_0x5146('0x4c')],'waiting':_0x287c6d[_0x5146('0x4d')]};_0x5a5764['push'](_0x1f42d5);}}_0x182b79({'count':_0x5a5764[_0x5146('0x16')],'rows':_0x5a5764});});},'FaxQueues':function(_0x1908bd){return new Promise(function(_0xf19e82,_0x3ebdd1){var _0x126d71=[];for(var _0x4c50b9 in _0x5d71ee[_0x5146('0x51')]){if(_0x5d71ee[_0x5146('0x51')][_0x5146('0x42')](_0x4c50b9)){var _0x27d9e2=_0x5d71ee[_0x5146('0x51')][_0x4c50b9];var _0x53c7fc={'id':_0x27d9e2['id'],'available':_0x27d9e2[_0x5146('0x49')],'loggedIn':_0x27d9e2[_0x5146('0x4a')],'name':_0x27d9e2[_0x5146('0x4b')],'paused':_0x27d9e2[_0x5146('0x4c')],'waiting':_0x27d9e2[_0x5146('0x4d')]};_0x126d71['push'](_0x53c7fc);}}_0xf19e82({'count':_0x126d71[_0x5146('0x16')],'rows':_0x126d71});});},'WhatsappQueues':function(_0x1d499f){return new Promise(function(_0x245a20,_0x26e96d){var _0x3a976d=[];for(var _0x1ef7ac in _0x5d71ee[_0x5146('0x52')]){if(_0x5d71ee[_0x5146('0x52')][_0x5146('0x42')](_0x1ef7ac)){var _0x1aeae9=_0x5d71ee[_0x5146('0x52')][_0x1ef7ac];var _0x4e8b7c={'id':_0x1aeae9['id'],'available':_0x1aeae9['available'],'loggedIn':_0x1aeae9['loggedIn'],'name':_0x1aeae9['name'],'paused':_0x1aeae9[_0x5146('0x4c')],'waiting':_0x1aeae9[_0x5146('0x4d')]};_0x3a976d['push'](_0x4e8b7c);}}_0x245a20({'count':_0x3a976d[_0x5146('0x16')],'rows':_0x3a976d});});},'ChatQueuesWaitingInteractions':function(_0x3e3a64){return new Promise(function(_0x120805,_0x593c9d){var _0x3a2743=_['values'](_0x5d71ee[_0x5146('0x53')]);_0x120805({'count':_0x3a2743['length'],'rows':_0x3a2743});});},'MailQueuesWaitingInteractions':function(_0x45039e){return new Promise(function(_0x286bb7,_0x3ea6ec){var _0x58da14=_['values'](_0x5d71ee[_0x5146('0x54')]);_0x286bb7({'count':_0x58da14[_0x5146('0x16')],'rows':_0x58da14});});},'OpenchannelQueuesWaitingInteractions':function(_0x522a56){return new Promise(function(_0x517fc2,_0x4b6c10){var _0x42040b=_['values'](_0x5d71ee['openchannelQueuesWaitingInteractions']);_0x517fc2({'count':_0x42040b[_0x5146('0x16')],'rows':_0x42040b});});},'SmsQueuesWaitingInteractions':function(_0x56e13c){return new Promise(function(_0x49acba,_0x41e164){var _0x388ad6=_[_0x5146('0x47')](_0x5d71ee[_0x5146('0x55')]);_0x49acba({'count':_0x388ad6[_0x5146('0x16')],'rows':_0x388ad6});});},'FaxQueuesWaitingInteractions':function(_0x2ebab9){return new Promise(function(_0x58b3f5,_0x1e82f9){var _0x44b5c9=_[_0x5146('0x47')](_0x5d71ee[_0x5146('0x56')]);_0x58b3f5({'count':_0x44b5c9[_0x5146('0x16')],'rows':_0x44b5c9});});},'WhatsappQueuesWaitingInteractions':function(_0x437ef6){return new Promise(function(_0x582e07,_0xd3df2){var _0x3fb421=_[_0x5146('0x47')](_0x5d71ee[_0x5146('0x57')]);_0x582e07({'count':_0x3fb421['length'],'rows':_0x3fb421});});}};var _0x35d53b=jayson[_0x5146('0x58')](_0x1e5f90)['http']();_0x35d53b['on'](_0x5146('0x31'),function(_0x551505){logger[_0x5146('0x31')](JSON[_0x5146('0x33')](_0x551505));return _0x13702a(_0x551505);});_0x35d53b[_0x5146('0xf')](0x232c,_0x5146('0x59'),function(){console[_0x5146('0x5a')](_0x5146('0x5b'),0x232c);return _0x4a6929(_0x5146('0x5c')+0x232c);});});}; \ No newline at end of file +var _0x9850=['Push\x20new\x20rule','on\x20interval','\x20|\x20','Please\x20create\x20a\x20new\x20file\x20under','.js','emit','No\x20applications\x20to\x20execute','error','stack','routing\x20is\x20empty','agent','agents','busy','busyQueue','QueueReport','update','UserId','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','values','chatQueues','available','name','paused','mailQueues','loggedIn','waiting','openchannelQueues','smsQueues','faxQueues','whatsappQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','smsQueuesWaitingInteractions','server','http','stringify','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','util','jayson/promise','bluebird','uuid','../../../config/environment','../../../config/logger','routing','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../rpc/whatsappQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','listen','rules','channel','message','interaction','applications','isArray','length','existsSync','app','toLowerCase','autoreply','split','mail','push','slice','join','dialogflow','appdata','amazonlex','./interval','intervals','./applications/','info'];(function(_0x467700,_0x186cb9){var _0x4bc720=function(_0x3d5fff){while(--_0x3d5fff){_0x467700['push'](_0x467700['shift']());}};_0x4bc720(++_0x186cb9);}(_0x9850,0x84));var _0x0985=function(_0x18542b,_0x8e0932){_0x18542b=_0x18542b-0x0;var _0x523b7a=_0x9850[_0x18542b];return _0x523b7a;};'use strict';var _=require('lodash');var util=require(_0x0985('0x0'));var path=require('path');var fs=require('fs');var jayson=require(_0x0985('0x1'));var BPromise=require(_0x0985('0x2'));var uuid=require(_0x0985('0x3'));var config=require(_0x0985('0x4'));var logger=require(_0x0985('0x5'))(_0x0985('0x6'));var rpc={'openchannelQueueReport':require('../rpc/openchannelQueueReport'),'mailQueueReport':require(_0x0985('0x7')),'chatQueueReport':require(_0x0985('0x8')),'smsQueueReport':require(_0x0985('0x9')),'faxQueueReport':require(_0x0985('0xa')),'whatsappQueueReport':require(_0x0985('0xb'))};var RuleEngine=require(_0x0985('0xc'));function getId(_0x8b7291,_0x2accaf,_0x36ed5e){return util[_0x0985('0xd')](_0x0985('0xe'),_0x8b7291,_0x2accaf||0x0,_0x36ed5e||0x0);}function getIntervals(_0x35558f,_0x3cc149){var _0x1205fe=[];if(!_[_0x0985('0xf')](_0x3cc149[_0x0985('0x10')])&&!_['isNil'](_0x35558f[_0x3cc149[_0x0985('0x10')]])&&!_['isNil'](_0x35558f[_0x3cc149['IntervalId']][_0x0985('0x11')])){_0x1205fe=_[_0x0985('0x12')](_0x35558f[_0x3cc149['IntervalId']][_0x0985('0x11')],'interval');}else if(!_[_0x0985('0xf')](_0x3cc149[_0x0985('0x13')])){_0x1205fe=[_0x3cc149[_0x0985('0x13')]];}return _0x1205fe;}exports[_0x0985('0x14')]=function(_0x25a34b){_0x25a34b[_0x0985('0x15')]={};return new BPromise(function(_0x5d8ba9,_0x5c0439){var _0x10696e={'Start':function(_0x16f310){var _0x5bdf24=this;return new Promise(function(_0x2772b5,_0xa6f28d){if(_0x16f310){try{var _0x24b247=[];var _0x7165cd=getId(_0x16f310[_0x0985('0x16')],_0x16f310['message']?_0x16f310[_0x0985('0x17')]['id']:0x0,_0x16f310[_0x0985('0x18')]?_0x16f310[_0x0985('0x18')]['id']:0x0);if(_0x16f310[_0x0985('0x19')]&&_[_0x0985('0x1a')](_0x16f310[_0x0985('0x19')])&&_0x16f310['applications']['length']){for(var _0x161343=0x0;_0x161343<_0x16f310[_0x0985('0x19')][_0x0985('0x1b')];_0x161343+=0x1){var _0x4c4182=_0x16f310[_0x0985('0x19')][_0x161343];if(fs[_0x0985('0x1c')](path['join'](__dirname,_0x0985('0x19'),_0x4c4182[_0x0985('0x1d')]+'.js'))){var _0x1313ad=[];switch(_0x4c4182[_0x0985('0x1d')][_0x0985('0x1e')]()){case _0x0985('0x1f'):var _0x2cdabf=_0x4c4182['appdata'][_0x0985('0x20')](',');if(_0x16f310['channel']===_0x0985('0x21')){_0x1313ad[_0x0985('0x22')](_0x2cdabf[0x0]);_0x1313ad[_0x0985('0x22')](_0x2cdabf[0x1]);_0x1313ad[_0x0985('0x22')](_0x2cdabf[_0x0985('0x23')](0x2,_0x2cdabf[_0x0985('0x1b')])[_0x0985('0x24')](','));}else{_0x1313ad[_0x0985('0x22')](_0x2cdabf[0x0]);_0x1313ad['push'](_0x2cdabf['slice'](0x1,_0x2cdabf[_0x0985('0x1b')])[_0x0985('0x24')](','));}break;case _0x0985('0x25'):var _0x37db4c=_0x4c4182[_0x0985('0x26')][_0x0985('0x20')](',');_0x1313ad[_0x0985('0x22')](_0x37db4c[0x0]);_0x1313ad['push'](_0x37db4c[0x1]);_0x1313ad[_0x0985('0x22')](_0x37db4c[_0x0985('0x23')](0x2,_0x37db4c[_0x0985('0x1b')])[_0x0985('0x24')](','));break;case'dialogflowv2':var _0x5175f6=_0x4c4182['appdata'][_0x0985('0x20')](',');_0x1313ad[_0x0985('0x22')](_0x5175f6[0x0]);_0x1313ad[_0x0985('0x22')](_0x5175f6[0x1]);_0x1313ad[_0x0985('0x22')](_0x5175f6[0x2]);_0x1313ad[_0x0985('0x22')](_0x5175f6[0x3]);_0x1313ad[_0x0985('0x22')](_0x5175f6[_0x0985('0x23')](0x4,_0x5175f6[_0x0985('0x1b')])[_0x0985('0x24')](','));break;case _0x0985('0x27'):var _0x4be905=_0x4c4182['appdata'][_0x0985('0x20')](',');_0x1313ad['push'](_0x4be905[0x0]);_0x1313ad[_0x0985('0x22')](_0x4be905[0x1]);_0x1313ad[_0x0985('0x22')](_0x4be905[0x2]);_0x1313ad[_0x0985('0x22')](_0x4be905[0x3]);_0x1313ad[_0x0985('0x22')](_0x4be905[_0x0985('0x23')](0x4,_0x4be905[_0x0985('0x1b')])[_0x0985('0x24')](','));break;case _0x0985('0x17'):_0x1313ad[_0x0985('0x22')](_0x4c4182[_0x0985('0x26')]);break;case'tag':_0x1313ad[_0x0985('0x22')](_0x4c4182['TagId']);_0x1313ad['push'](_0x4c4182['appdata']);break;default:_0x1313ad=_['isNil'](_0x4c4182['appdata'])?[]:_0x4c4182[_0x0985('0x26')][_0x0985('0x20')](',');}var _0x2259e6={'id':util['format']('%s:%s:%s',_0x7165cd,_0x4c4182['id'],_0x4c4182[_0x0985('0x1d')]),'condition':require(_0x0985('0x28'))['condition'](_0x7165cd,getIntervals(_0x25a34b[_0x0985('0x29')],_0x4c4182),_0x25a34b),'consequence':require(_0x0985('0x2a')+_0x4c4182[_0x0985('0x1d')])['consequence'](_0x7165cd,_0x1313ad,_0x25a34b,_0x16f310),'p':_0x4c4182['priority']||0x0};logger[_0x0985('0x2b')](_0x0985('0x2c'),_0x2259e6['id'],_0x0985('0x2d'),getIntervals(_0x25a34b['intervals'],_0x4c4182)[_0x0985('0x24')](_0x0985('0x2e')));_0x24b247['push'](_0x2259e6);}else{logger['error'](_0x0985('0x2f'),path[_0x0985('0x24')](__dirname,_0x0985('0x19'),_0x4c4182[_0x0985('0x1d')]+_0x0985('0x30')));}}_0x25a34b[_0x0985('0x15')][_0x7165cd]=new RuleEngine(_0x24b247);_0x25a34b['rules'][_0x7165cd]['execute'](_0x16f310,function(_0x53874a){logger['info']('Applications\x20executed',JSON['stringify'](_0x53874a['matchPath']));if(_0x25a34b['rules'][_0x7165cd]){_0x25a34b['rules'][_0x7165cd][_0x0985('0x31')]('complete');}});return _0x2772b5({'code':0xc8,'message':_0x16f310});}else{logger['info'](_0x0985('0x32'));return _0x2772b5({'code':0xc8,'message':_0x16f310});}}catch(_0x1ddd20){logger[_0x0985('0x33')](_0x1ddd20[_0x0985('0x34')]);return _0xa6f28d(_0x5bdf24[_0x0985('0x33')](0x1f4,_0x1ddd20));}}return _0xa6f28d(_0x0985('0x35'));});},'AcceptMessage':function(_0x41dd2f){var _0x22019a=this;return new Promise(function(_0x4b4aba,_0x4de125){if(_0x41dd2f[_0x0985('0x36')]&&_0x41dd2f['agent']['id']){if(_0x25a34b[_0x0985('0x37')][_0x41dd2f[_0x0985('0x36')]['id']]){_0x25a34b[_0x0985('0x37')][_0x41dd2f[_0x0985('0x36')]['id']][_0x0985('0x38')]=![];_0x25a34b[_0x0985('0x37')][_0x41dd2f[_0x0985('0x36')]['id']][_0x0985('0x39')]=undefined;}}if(_0x41dd2f[_0x0985('0x17')]&&_0x41dd2f['message']['id']){try{var _0x2d8c2d=getId(_0x41dd2f[_0x0985('0x16')],_0x41dd2f['message']?_0x41dd2f[_0x0985('0x17')]['id']:0x0,_0x41dd2f[_0x0985('0x18')]?_0x41dd2f['interaction']['id']:0x0);if(_0x25a34b[_0x0985('0x15')][_0x2d8c2d]){_0x25a34b[_0x0985('0x15')][_0x2d8c2d][_0x0985('0x31')]('end');if(rpc[_0x41dd2f['channel']+'QueueReport']){rpc[_0x41dd2f[_0x0985('0x16')]+_0x0985('0x3a')][_0x0985('0x3b')](_0x2d8c2d,{'UserId':_0x41dd2f[_0x0985('0x17')][_0x0985('0x3c')]})[_0x0985('0x3d')](function(_0x7da753){logger['error'](_0x0985('0x3e'));});}}return _0x4b4aba({'code':0xc8,'message':_0x41dd2f});}catch(_0xd7f3d6){logger[_0x0985('0x33')](_0xd7f3d6[_0x0985('0x34')]);return _0x4de125(_0x22019a[_0x0985('0x33')](0x1f4,_0xd7f3d6));}}logger[_0x0985('0x33')]('message\x20is\x20empty');return _0x4de125(_0x22019a['error'](0x1f4,_0x0985('0x3f')));});},'RejectMessage':function(_0x1345dc){var _0x1a3bfb=this;return new Promise(function(_0x4f4088,_0x492c76){if(_0x1345dc[_0x0985('0x36')]&&_0x1345dc[_0x0985('0x36')]['id']){try{if(_0x25a34b[_0x0985('0x37')][_0x1345dc[_0x0985('0x36')]['id']]){_0x25a34b[_0x0985('0x37')][_0x1345dc[_0x0985('0x36')]['id']][_0x0985('0x38')]=![];_0x25a34b['agents'][_0x1345dc['agent']['id']][_0x0985('0x39')]=undefined;}return _0x4f4088({'code':0xc8,'message':_0x1345dc});}catch(_0x4e1d68){logger[_0x0985('0x33')](_0x4e1d68[_0x0985('0x34')]);return _0x492c76(_0x1a3bfb[_0x0985('0x33')](0x1f4,_0x4e1d68));}}logger['error'](_0x0985('0x3f'));return _0x492c76(_0x1a3bfb[_0x0985('0x33')](0x1f4,_0x0985('0x3f')));});},'AbandonInteraction':function(_0x5b2a0f){var _0x410449=this;return new Promise(function(_0x5905d0,_0x3516a8){if(_0x5b2a0f[_0x0985('0x16')]&&_0x5b2a0f[_0x0985('0x18')]&&_0x5b2a0f[_0x0985('0x18')]['id']){try{var _0x88a7f9=getId(_0x5b2a0f['channel'],_0x5b2a0f[_0x0985('0x17')]?_0x5b2a0f[_0x0985('0x17')]['id']:0x0,_0x5b2a0f[_0x0985('0x18')]?_0x5b2a0f['interaction']['id']:0x0);if(_0x25a34b['rules'][_0x88a7f9]){_0x25a34b[_0x0985('0x15')][_0x88a7f9]['emit']('end');}return _0x5905d0({'code':0xc8,'message':_0x5b2a0f});}catch(_0x5077d2){logger['error'](_0x5077d2[_0x0985('0x34')]);return _0x3516a8(_0x410449[_0x0985('0x33')](0x1f4,_0x5077d2));}}logger[_0x0985('0x33')]('message\x20is\x20empty');return _0x3516a8(_0x410449[_0x0985('0x33')](0x1f4,'message\x20is\x20empty'));});},'AgentCapacity':function(_0x3c59ae){var _0x5cac42=this;return new Promise(function(_0x1e07c3,_0x565f65){if(_0x25a34b['agents'][_0x0985('0x40')](_0x3c59ae['id'])){for(var _0x3e4035 in _0x3c59ae['capacity']){if(_0x3c59ae[_0x0985('0x41')][_0x0985('0x40')](_0x3e4035)){if(_0x25a34b[_0x0985('0x37')][_0x3c59ae['id']][_0x0985('0x40')](_0x3e4035+_0x0985('0x42'))){_0x25a34b[_0x0985('0x37')][_0x3c59ae['id']][_0x3e4035+_0x0985('0x42')]=parseInt(_0x3c59ae[_0x0985('0x41')][_0x3e4035],0xa);}}}_0x25a34b[_0x0985('0x37')][_0x3c59ae['id']][_0x0985('0x43')]();return _0x1e07c3({'code':0xc8,'message':_0x25a34b[_0x0985('0x37')][_0x3c59ae['id']]});}else{return _0x565f65(_0x5cac42[_0x0985('0x33')](0x1f4,_0x0985('0x44')));}});},'Agents':function(_0x33c9a9){return new Promise(function(_0x2fbe4c,_0x31303f){var _0x4151e0=_[_0x0985('0x45')](_0x25a34b['agents']);_0x2fbe4c({'count':_0x4151e0[_0x0985('0x1b')],'rows':_0x4151e0});});},'ChatQueues':function(_0x43d0d7){return new Promise(function(_0xbc708e,_0x4cd4e2){var _0xfff69c=[];for(var _0x3ca15d in _0x25a34b[_0x0985('0x46')]){if(_0x25a34b[_0x0985('0x46')]['hasOwnProperty'](_0x3ca15d)){var _0x4e3ba2=_0x25a34b[_0x0985('0x46')][_0x3ca15d];var _0x3a39a3={'id':_0x4e3ba2['id'],'available':_0x4e3ba2[_0x0985('0x47')],'loggedIn':_0x4e3ba2['loggedIn'],'name':_0x4e3ba2[_0x0985('0x48')],'paused':_0x4e3ba2[_0x0985('0x49')],'waiting':_0x4e3ba2['waiting']};_0xfff69c[_0x0985('0x22')](_0x3a39a3);}}_0xbc708e({'count':_0xfff69c[_0x0985('0x1b')],'rows':_0xfff69c});});},'MailQueues':function(_0x27f61b){return new Promise(function(_0x3da7b3,_0x3af4b0){var _0x4d256f=[];for(var _0x239913 in _0x25a34b[_0x0985('0x4a')]){if(_0x25a34b[_0x0985('0x4a')]['hasOwnProperty'](_0x239913)){var _0x3870c0=_0x25a34b[_0x0985('0x4a')][_0x239913];var _0x505601={'id':_0x3870c0['id'],'available':_0x3870c0['available'],'loggedIn':_0x3870c0[_0x0985('0x4b')],'name':_0x3870c0['name'],'paused':_0x3870c0[_0x0985('0x49')],'waiting':_0x3870c0[_0x0985('0x4c')]};_0x4d256f[_0x0985('0x22')](_0x505601);}}_0x3da7b3({'count':_0x4d256f[_0x0985('0x1b')],'rows':_0x4d256f});});},'OpenchannelQueues':function(_0x3d50a0){return new Promise(function(_0x2aabb9,_0x39fda9){var _0x7b0196=[];for(var _0x14c60c in _0x25a34b['openchannelQueues']){if(_0x25a34b[_0x0985('0x4d')]['hasOwnProperty'](_0x14c60c)){var _0x482d30=_0x25a34b[_0x0985('0x4d')][_0x14c60c];var _0x3d6d52={'id':_0x482d30['id'],'available':_0x482d30['available'],'loggedIn':_0x482d30[_0x0985('0x4b')],'name':_0x482d30['name'],'paused':_0x482d30['paused'],'waiting':_0x482d30[_0x0985('0x4c')]};_0x7b0196[_0x0985('0x22')](_0x3d6d52);}}_0x2aabb9({'count':_0x7b0196['length'],'rows':_0x7b0196});});},'SmsQueues':function(_0x4736c1){return new Promise(function(_0x3191c1,_0x2fd500){var _0x4ba286=[];for(var _0x209dc8 in _0x25a34b[_0x0985('0x4e')]){if(_0x25a34b[_0x0985('0x4e')][_0x0985('0x40')](_0x209dc8)){var _0x5dc0f4=_0x25a34b[_0x0985('0x4e')][_0x209dc8];var _0x35b03a={'id':_0x5dc0f4['id'],'available':_0x5dc0f4[_0x0985('0x47')],'loggedIn':_0x5dc0f4['loggedIn'],'name':_0x5dc0f4[_0x0985('0x48')],'paused':_0x5dc0f4['paused'],'waiting':_0x5dc0f4[_0x0985('0x4c')]};_0x4ba286[_0x0985('0x22')](_0x35b03a);}}_0x3191c1({'count':_0x4ba286[_0x0985('0x1b')],'rows':_0x4ba286});});},'FaxQueues':function(_0x12aa9f){return new Promise(function(_0x25950b,_0x36da68){var _0x1f53ee=[];for(var _0x21e549 in _0x25a34b['faxQueues']){if(_0x25a34b[_0x0985('0x4f')][_0x0985('0x40')](_0x21e549)){var _0x5c6049=_0x25a34b[_0x0985('0x4f')][_0x21e549];var _0x48a77e={'id':_0x5c6049['id'],'available':_0x5c6049['available'],'loggedIn':_0x5c6049[_0x0985('0x4b')],'name':_0x5c6049[_0x0985('0x48')],'paused':_0x5c6049[_0x0985('0x49')],'waiting':_0x5c6049[_0x0985('0x4c')]};_0x1f53ee[_0x0985('0x22')](_0x48a77e);}}_0x25950b({'count':_0x1f53ee[_0x0985('0x1b')],'rows':_0x1f53ee});});},'WhatsappQueues':function(_0x1be63f){return new Promise(function(_0x9148dd,_0x15ebdd){var _0x415e35=[];for(var _0x32421a in _0x25a34b[_0x0985('0x50')]){if(_0x25a34b[_0x0985('0x50')][_0x0985('0x40')](_0x32421a)){var _0x885355=_0x25a34b[_0x0985('0x50')][_0x32421a];var _0x4ea0cf={'id':_0x885355['id'],'available':_0x885355[_0x0985('0x47')],'loggedIn':_0x885355[_0x0985('0x4b')],'name':_0x885355[_0x0985('0x48')],'paused':_0x885355[_0x0985('0x49')],'waiting':_0x885355['waiting']};_0x415e35[_0x0985('0x22')](_0x4ea0cf);}}_0x9148dd({'count':_0x415e35[_0x0985('0x1b')],'rows':_0x415e35});});},'ChatQueuesWaitingInteractions':function(_0x48cc79){return new Promise(function(_0x314bf9,_0x817b36){var _0x2316ad=_[_0x0985('0x45')](_0x25a34b[_0x0985('0x51')]);_0x314bf9({'count':_0x2316ad[_0x0985('0x1b')],'rows':_0x2316ad});});},'MailQueuesWaitingInteractions':function(_0x5525cb){return new Promise(function(_0x4b1908,_0x4f8460){var _0x28bc56=_[_0x0985('0x45')](_0x25a34b[_0x0985('0x52')]);_0x4b1908({'count':_0x28bc56[_0x0985('0x1b')],'rows':_0x28bc56});});},'OpenchannelQueuesWaitingInteractions':function(_0x530c10){return new Promise(function(_0x557850,_0x5c7bd6){var _0x21aff2=_[_0x0985('0x45')](_0x25a34b['openchannelQueuesWaitingInteractions']);_0x557850({'count':_0x21aff2[_0x0985('0x1b')],'rows':_0x21aff2});});},'SmsQueuesWaitingInteractions':function(_0x5e6dab){return new Promise(function(_0xf72c8b,_0x23ed5c){var _0x19a7e2=_[_0x0985('0x45')](_0x25a34b[_0x0985('0x53')]);_0xf72c8b({'count':_0x19a7e2['length'],'rows':_0x19a7e2});});},'FaxQueuesWaitingInteractions':function(_0x12f7bb){return new Promise(function(_0xdee90b,_0x2356e2){var _0x53457f=_[_0x0985('0x45')](_0x25a34b['faxQueuesWaitingInteractions']);_0xdee90b({'count':_0x53457f[_0x0985('0x1b')],'rows':_0x53457f});});},'WhatsappQueuesWaitingInteractions':function(_0x1aa27d){return new Promise(function(_0x3c5818,_0xb526d3){var _0x1fd403=_[_0x0985('0x45')](_0x25a34b['whatsappQueuesWaitingInteractions']);_0x3c5818({'count':_0x1fd403['length'],'rows':_0x1fd403});});}};var _0x2b8ed6=jayson[_0x0985('0x54')](_0x10696e)[_0x0985('0x55')]();_0x2b8ed6['on'](_0x0985('0x33'),function(_0x315a36){logger[_0x0985('0x33')](JSON[_0x0985('0x56')](_0x315a36));return _0x5c0439(_0x315a36);});_0x2b8ed6['listen'](0x232c,'127.0.0.1',function(){console['log'](_0x0985('0x57'),0x232c);return _0x5d8ba9('RPC\x20listening\x20on\x20port:'+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index bb13b2d..6b505f1 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 _0x9521=['push','iftime\x20%s','indexOf','true','[%s][INTERVAL]\x20%s','info','[%s][INTERVAL]\x20%s\x20%s','\x20|\x20','when','log','join','stack','util','bluebird','jayson/promise','lodash','routing','http','then','error','message','catch','condition','rules','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length'];(function(_0x49ccfe,_0x360c03){var _0x3536cc=function(_0x3685da){while(--_0x3685da){_0x49ccfe['push'](_0x49ccfe['shift']());}};_0x3536cc(++_0x360c03);}(_0x9521,0x1d7));var _0x1952=function(_0x4c73ac,_0x46b73c){_0x4c73ac=_0x4c73ac-0x0;var _0x9839ee=_0x9521[_0x4c73ac];return _0x9839ee;};'use strict';var util=require(_0x1952('0x0'));var BPromise=require(_0x1952('0x1'));var jayson=require(_0x1952('0x2'));var _=require(_0x1952('0x3'));var logger=require('../../../config/logger')(_0x1952('0x4'));var client=jayson['client'][_0x1952('0x5')]({'port':0x232a});function request(_0x5a1510,_0x131145){return new BPromise(function(_0x611eb6,_0x25f4f0){return client['request'](_0x5a1510,_0x131145)[_0x1952('0x6')](function(_0x9ee861){if(_0x9ee861[_0x1952('0x7')]){return _0x25f4f0(_0x9ee861[_0x1952('0x7')][_0x1952('0x8')]);}else{return _0x611eb6(_0x9ee861['result']);}})[_0x1952('0x9')](function(_0x3ade52){return _0x25f4f0(_0x3ade52);});});}exports[_0x1952('0xa')]=function(_0x42c457,_0x2d2479,_0x2903c1){return function(_0x3310a9){if(_0x2903c1[_0x1952('0xb')]&&!_0x2903c1['rules'][_0x42c457]){logger['info'](_0x1952('0xc'),_0x42c457);return _0x3310a9[_0x1952('0xd')]();}var _0x16edd2=[];for(var _0x411e66=0x0;_0x411e66<_0x2d2479[_0x1952('0xe')];_0x411e66+=0x1){_0x16edd2[_0x1952('0xf')](request('Command',{'command':util['format'](_0x1952('0x10'),_0x2d2479[_0x411e66])})['then'](function(_0x10ca3c){return _0x10ca3c&&_0x10ca3c[_0x1952('0x8')]&&_0x10ca3c[_0x1952('0x8')][_0x1952('0x11')](_0x1952('0x12'))>=0x0?!![]:![];})[_0x1952('0x9')](function(_0x5d666d){logger[_0x1952('0x7')](_0x1952('0x13'),_0x42c457,_0x2d2479[_0x411e66]);}));}BPromise['all'](_0x16edd2)['then'](function(_0x2261d8){var _0x5152bd=_['some'](_0x2261d8);logger[_0x1952('0x14')](_0x1952('0x15'),_0x42c457,_0x2d2479['join'](_0x1952('0x16')),_0x5152bd);_0x3310a9[_0x1952('0x17')](_0x5152bd);})['catch'](function(_0x15101c){console[_0x1952('0x18')](_0x15101c);logger['error'](_0x1952('0x15'),_0x42c457,_0x2d2479[_0x1952('0x19')]('\x20|\x20'),_0x15101c[_0x1952('0x1a')]);_0x3310a9['stop']();});};}; \ No newline at end of file +var _0xa7f8=['[%s][INTERVAL]\x20%s\x20%s','\x20|\x20','when','join','stack','../../../config/logger','routing','client','http','then','error','message','condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','push','format','iftime\x20%s','indexOf','true','[%s][INTERVAL]\x20%s','all','some'];(function(_0xfe425b,_0x144814){var _0x5a1bc5=function(_0x1ffc5b){while(--_0x1ffc5b){_0xfe425b['push'](_0xfe425b['shift']());}};_0x5a1bc5(++_0x144814);}(_0xa7f8,0xe6));var _0x8a7f=function(_0x259264,_0xfe2f1f){_0x259264=_0x259264-0x0;var _0x333ff4=_0xa7f8[_0x259264];return _0x333ff4;};'use strict';var util=require('util');var BPromise=require('bluebird');var jayson=require('jayson/promise');var _=require('lodash');var logger=require(_0x8a7f('0x0'))(_0x8a7f('0x1'));var client=jayson[_0x8a7f('0x2')][_0x8a7f('0x3')]({'port':0x232a});function request(_0x3d7bde,_0x201d42){return new BPromise(function(_0x40b7d2,_0x45f595){return client['request'](_0x3d7bde,_0x201d42)[_0x8a7f('0x4')](function(_0xb7447c){if(_0xb7447c['error']){return _0x45f595(_0xb7447c[_0x8a7f('0x5')][_0x8a7f('0x6')]);}else{return _0x40b7d2(_0xb7447c['result']);}})['catch'](function(_0x171aa3){return _0x45f595(_0x171aa3);});});}exports[_0x8a7f('0x7')]=function(_0x44c42b,_0xab83ef,_0x1cb5d1){return function(_0x3d2bde){if(_0x1cb5d1[_0x8a7f('0x8')]&&!_0x1cb5d1[_0x8a7f('0x8')][_0x44c42b]){logger[_0x8a7f('0x9')](_0x8a7f('0xa'),_0x44c42b);return _0x3d2bde[_0x8a7f('0xb')]();}var _0x53206c=[];for(var _0x430a67=0x0;_0x430a67<_0xab83ef['length'];_0x430a67+=0x1){_0x53206c[_0x8a7f('0xc')](request('Command',{'command':util[_0x8a7f('0xd')](_0x8a7f('0xe'),_0xab83ef[_0x430a67])})[_0x8a7f('0x4')](function(_0x4bd69c){return _0x4bd69c&&_0x4bd69c[_0x8a7f('0x6')]&&_0x4bd69c[_0x8a7f('0x6')][_0x8a7f('0xf')](_0x8a7f('0x10'))>=0x0?!![]:![];})['catch'](function(_0x50f7a8){logger['error'](_0x8a7f('0x11'),_0x44c42b,_0xab83ef[_0x430a67]);}));}BPromise[_0x8a7f('0x12')](_0x53206c)[_0x8a7f('0x4')](function(_0x2ba620){var _0x1e3f42=_[_0x8a7f('0x13')](_0x2ba620);logger['info'](_0x8a7f('0x14'),_0x44c42b,_0xab83ef['join'](_0x8a7f('0x15')),_0x1e3f42);_0x3d2bde[_0x8a7f('0x16')](_0x1e3f42);})['catch'](function(_0x618425){console['log'](_0x618425);logger[_0x8a7f('0x5')]('[%s][INTERVAL]\x20%s\x20%s',_0x44c42b,_0xab83ef[_0x8a7f('0x17')](_0x8a7f('0x15')),_0x618425[_0x8a7f('0x18')]);_0x3d2bde[_0x8a7f('0xb')]();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index 5d81e45..08900b4 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 _0x2f68=['called','connectedlinenum','connectedlinename','info','[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called','error','agentringnoanswer','isNil','[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout','agentringnoanswerAt','reason','holdtime','ringtime','talktime','push','[%s][agents][agentringnoanswer]','queuecallerabandon','forIn','includes','[%s][agents][queuecallerabandon]','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','now','abandoned','agentconnect','[%s][agents][agentconnect]','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','agentcomplete','[%s][agents][agentcomplete]','[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete','agentcompleteAt','diffTime','agentconnectAt','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfereruniqueid','transfer','transfertype','blind','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid','origtransfererlinkedid','[%s][agents][attendedtransfer]\x20agent:%s','secondtransfereruniqueid','transferexten','origtransfererexten','transferuniqueid','transfereeuniqueid','clone','calleridnum','calleridname','agententerreason','secondtransfererlinkedid','ATTENDED','secondtransfererexten','transfertargetuniqueid','hangup','[%s][agents][hangup]','cause','rejected','splice','complete','agent','[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s','util','./utils','format','uniqueid','channel','membername','interface','lastevent','queue','then','type','agentacw','acw','acwtime','acwTimeout','request','CreateVoiceAgentReport','agentcalled','debug','[%s][agents][agentcalled]','destuniqueid','agentcalledAt'];(function(_0xb99509,_0x28ebdc){var _0x12453c=function(_0x576687){while(--_0x576687){_0xb99509['push'](_0xb99509['shift']());}};_0x12453c(++_0x28ebdc);}(_0x2f68,0x9a));var _0x82f6=function(_0x3879c7,_0x483ae7){_0x3879c7=_0x3879c7-0x0;var _0x2caa73=_0x2f68[_0x3879c7];return _0x2caa73;};'use strict';var _=require('lodash');var util=require(_0x82f6('0x0'));var utils=require(_0x82f6('0x1'));var agents={};var transfers={};var unanswered=[];function writeDB(_0x24c877,_0x3a9c8f){utils['info'](util[_0x82f6('0x2')]('[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s',_0x24c877[_0x82f6('0x3')],_0x24c877[_0x82f6('0x4')],_0x24c877['queue'],_0x24c877[_0x82f6('0x5')],_0x24c877[_0x82f6('0x6')],_0x24c877['calleridnum'],_0x24c877['connectedlinenum'],_0x24c877[_0x82f6('0x7')]));if(_0x24c877['queue']){utils['getVoiceQueueByName'](_0x24c877[_0x82f6('0x8')])[_0x82f6('0x9')](function(_0x250d71){if(_0x250d71){_0x24c877['type']=_0x250d71[_0x82f6('0xa')];_0x24c877[_0x82f6('0xb')]=_0x24c877['agentcomplete']?_0x250d71[_0x82f6('0xc')]:![];_0x24c877[_0x82f6('0xd')]=_0x24c877[_0x82f6('0xb')]?_0x250d71[_0x82f6('0xe')]:0x0;}utils[_0x82f6('0xf')](_0x82f6('0x10'),_0x24c877);});}else{utils['request'](_0x82f6('0x10'),_0x24c877);}if(_0x3a9c8f){delete transfers[_0x24c877[_0x82f6('0x3')]];}else{delete agents[_0x24c877['destuniqueid']];}}exports[_0x82f6('0x11')]=function(_0x1f8bf5){try{utils[_0x82f6('0x12')](util[_0x82f6('0x2')](_0x82f6('0x13'),_0x1f8bf5[_0x82f6('0x3')]),_0x1f8bf5);agents[_0x1f8bf5[_0x82f6('0x14')]]=_0x1f8bf5;agents[_0x1f8bf5[_0x82f6('0x14')]][_0x82f6('0x15')]=utils['now']();agents[_0x1f8bf5[_0x82f6('0x14')]]['lastevent']=_0x82f6('0x16');agents[_0x1f8bf5[_0x82f6('0x14')]][_0x82f6('0x17')]=null;agents[_0x1f8bf5[_0x82f6('0x14')]][_0x82f6('0x18')]=null;utils[_0x82f6('0x19')](util[_0x82f6('0x2')](_0x82f6('0x1a'),_0x1f8bf5[_0x82f6('0x3')],agents[_0x1f8bf5[_0x82f6('0x14')]][_0x82f6('0x5')],_0x1f8bf5[_0x82f6('0x14')]));}catch(_0x2652a9){utils[_0x82f6('0x1b')](util[_0x82f6('0x2')]('[%s][agents][agentcalled]',_0x1f8bf5[_0x82f6('0x3')]),_0x2652a9);}};exports[_0x82f6('0x1c')]=function(_0x55cbce){try{if(!_[_0x82f6('0x1d')](agents[_0x55cbce[_0x82f6('0x14')]])){utils[_0x82f6('0x12')](util[_0x82f6('0x2')]('[%s][agents][agentringnoanswer]',_0x55cbce[_0x82f6('0x3')]),_0x55cbce);utils['info'](util[_0x82f6('0x2')](_0x82f6('0x1e'),_0x55cbce['uniqueid'],agents[_0x55cbce['destuniqueid']][_0x82f6('0x5')],_0x55cbce[_0x82f6('0x14')]));agents[_0x55cbce['destuniqueid']]['agentringnoanswer']=!![];agents[_0x55cbce[_0x82f6('0x14')]][_0x82f6('0x1f')]=utils['now']();agents[_0x55cbce[_0x82f6('0x14')]][_0x82f6('0x7')]='timeout';agents[_0x55cbce['destuniqueid']][_0x82f6('0x20')]='timeout';agents[_0x55cbce[_0x82f6('0x14')]][_0x82f6('0x21')]=_0x55cbce['ringtime']?parseInt(_0x55cbce[_0x82f6('0x22')])/0x3e8:0x0;agents[_0x55cbce[_0x82f6('0x14')]][_0x82f6('0x23')]=0x0;unanswered[_0x82f6('0x24')](_0x55cbce['destuniqueid']);}}catch(_0x40a071){utils[_0x82f6('0x1b')](util[_0x82f6('0x2')](_0x82f6('0x25'),_0x55cbce[_0x82f6('0x3')]),_0x40a071);}};exports[_0x82f6('0x26')]=function(_0x27e473){try{_[_0x82f6('0x27')](agents,function(_0x1e1aa4,_0x402449){if(_0x1e1aa4[_0x82f6('0x3')]==_0x27e473[_0x82f6('0x3')]&&!_[_0x82f6('0x28')](unanswered,_0x1e1aa4[_0x82f6('0x14')])){utils['debug'](util[_0x82f6('0x2')](_0x82f6('0x29'),_0x27e473[_0x82f6('0x3')]),_0x27e473);utils['info'](util[_0x82f6('0x2')](_0x82f6('0x2a'),_0x27e473[_0x82f6('0x3')],_0x1e1aa4[_0x82f6('0x5')],_0x1e1aa4[_0x82f6('0x14')]));_0x1e1aa4[_0x82f6('0x1c')]=!![];_0x1e1aa4[_0x82f6('0x1f')]=utils[_0x82f6('0x2b')]();_0x1e1aa4[_0x82f6('0x7')]=_0x82f6('0x2c');_0x1e1aa4[_0x82f6('0x20')]=_0x82f6('0x2c');_0x1e1aa4[_0x82f6('0x21')]=_0x27e473[_0x82f6('0x21')];_0x1e1aa4['talktime']=0x0;writeDB(_0x1e1aa4);}});}catch(_0x13a409){utils[_0x82f6('0x1b')](util[_0x82f6('0x2')](_0x82f6('0x29'),_0x27e473[_0x82f6('0x3')]),_0x13a409);}};exports[_0x82f6('0x2d')]=function(_0x34c2f1){try{if(agents[_0x34c2f1[_0x82f6('0x14')]]){utils[_0x82f6('0x12')](util[_0x82f6('0x2')](_0x82f6('0x2e'),_0x34c2f1[_0x82f6('0x3')]),_0x34c2f1);utils[_0x82f6('0x19')](util[_0x82f6('0x2')]('[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect',_0x34c2f1[_0x82f6('0x3')],agents[_0x34c2f1['destuniqueid']]['membername'],_0x34c2f1[_0x82f6('0x14')]));agents[_0x34c2f1[_0x82f6('0x14')]]['agentconnectAt']=utils[_0x82f6('0x2b')]();agents[_0x34c2f1[_0x82f6('0x14')]][_0x82f6('0x17')]=_0x34c2f1['connectedlinenum'];agents[_0x34c2f1[_0x82f6('0x14')]]['connectedlinename']=_0x34c2f1[_0x82f6('0x18')];agents[_0x34c2f1['destuniqueid']][_0x82f6('0x21')]=_0x34c2f1['ringtime'];agents[_0x34c2f1[_0x82f6('0x14')]][_0x82f6('0x7')]='connect';_[_0x82f6('0x27')](agents,function(_0x368c11,_0x3e7c53){if(_0x368c11[_0x82f6('0x14')]!=_0x34c2f1['destuniqueid']&&_0x368c11[_0x82f6('0x3')]==_0x34c2f1[_0x82f6('0x3')]){_0x368c11[_0x82f6('0x23')]=0x0;_0x368c11[_0x82f6('0x21')]=_0x34c2f1['ringtime'];_0x368c11[_0x82f6('0x1c')]=!![];_0x368c11[_0x82f6('0x1f')]=utils['now']();_0x368c11[_0x82f6('0x7')]=_0x82f6('0x2f');_0x368c11[_0x82f6('0x20')]=_0x82f6('0x2f');_0x368c11[_0x82f6('0x30')]=_0x34c2f1['destuniqueid'];_0x368c11[_0x82f6('0x31')]=_0x34c2f1['membername'];writeDB(_0x368c11);}});}}catch(_0x139614){utils[_0x82f6('0x1b')](util[_0x82f6('0x2')](_0x82f6('0x2e'),_0x34c2f1[_0x82f6('0x3')]),_0x139614);}};exports[_0x82f6('0x32')]=function(_0x43fefc){try{if(!_['isNil'](agents[_0x43fefc[_0x82f6('0x14')]])){utils[_0x82f6('0x12')](util[_0x82f6('0x2')](_0x82f6('0x33'),_0x43fefc['uniqueid']),_0x43fefc);utils[_0x82f6('0x19')](util['format'](_0x82f6('0x34'),_0x43fefc[_0x82f6('0x3')],agents[_0x43fefc[_0x82f6('0x14')]][_0x82f6('0x5')],_0x43fefc[_0x82f6('0x14')]));agents[_0x43fefc[_0x82f6('0x14')]]['agentcomplete']=!![];agents[_0x43fefc[_0x82f6('0x14')]][_0x82f6('0x35')]=utils[_0x82f6('0x2b')]();agents[_0x43fefc[_0x82f6('0x14')]][_0x82f6('0x23')]=utils[_0x82f6('0x36')](agents[_0x43fefc[_0x82f6('0x14')]][_0x82f6('0x35')],agents[_0x43fefc['destuniqueid']][_0x82f6('0x37')]);agents[_0x43fefc[_0x82f6('0x14')]]['reason']=_0x43fefc[_0x82f6('0x20')];agents[_0x43fefc['destuniqueid']][_0x82f6('0x7')]='complete';writeDB(agents[_0x43fefc[_0x82f6('0x14')]]);}}catch(_0x31dec7){utils[_0x82f6('0x1b')](util[_0x82f6('0x2')](_0x82f6('0x33'),_0x43fefc[_0x82f6('0x3')]),_0x31dec7);}};exports['blindtransfer']=function(_0x3cb1f0){try{if(!_[_0x82f6('0x1d')](agents[_0x3cb1f0['transfereruniqueid']])){utils['debug'](util[_0x82f6('0x2')](_0x82f6('0x38'),_0x3cb1f0[_0x82f6('0x3')]),_0x3cb1f0);utils['info'](util[_0x82f6('0x2')](_0x82f6('0x39'),_0x3cb1f0[_0x82f6('0x3')],agents[_0x3cb1f0[_0x82f6('0x3a')]]['membername'],agents[_0x3cb1f0['transfereruniqueid']][_0x82f6('0x3')]));agents[_0x3cb1f0[_0x82f6('0x3a')]][_0x82f6('0x3b')]=!![];agents[_0x3cb1f0['transfereruniqueid']][_0x82f6('0x3c')]=_0x82f6('0x3d');agents[_0x3cb1f0['transfereruniqueid']]['transferexten']=_0x3cb1f0['extension'];agents[_0x3cb1f0[_0x82f6('0x3a')]]['transferuniqueid']=agents[_0x3cb1f0[_0x82f6('0x3a')]]['uniqueid'];}}catch(_0x33c359){utils['error'](util[_0x82f6('0x2')]('[%s][agents][blindtransfer]',_0x3cb1f0[_0x82f6('0x3')]),_0x33c359);}};exports[_0x82f6('0x3e')]=function(_0x44de65){try{utils[_0x82f6('0x12')](util[_0x82f6('0x2')](_0x82f6('0x3f'),_0x44de65['origtransfereruniqueid']),_0x44de65);if(_0x44de65[_0x82f6('0x40')]==_0x44de65[_0x82f6('0x41')]){if(!_[_0x82f6('0x1d')](agents[_0x44de65['secondtransfereruniqueid']])){utils['info'](util[_0x82f6('0x2')](_0x82f6('0x42'),_0x44de65[_0x82f6('0x40')],agents[_0x44de65[_0x82f6('0x43')]]['membername']));agents[_0x44de65[_0x82f6('0x43')]][_0x82f6('0x3b')]=!![];agents[_0x44de65[_0x82f6('0x43')]]['transfertype']='ATTENDED';agents[_0x44de65['secondtransfereruniqueid']][_0x82f6('0x44')]=_0x44de65[_0x82f6('0x45')];agents[_0x44de65[_0x82f6('0x43')]][_0x82f6('0x46')]=_0x44de65[_0x82f6('0x40')];}if(_0x44de65[_0x82f6('0x47')]&&agents[_0x44de65[_0x82f6('0x47')]]){agents[_0x44de65[_0x82f6('0x47')]]['agententerreason']=0x1;transfers[_0x44de65[_0x82f6('0x47')]]=_[_0x82f6('0x48')](agents[_0x44de65[_0x82f6('0x47')]]);transfers[_0x44de65[_0x82f6('0x47')]]['calleridnum']=agents[_0x44de65['secondtransfereruniqueid']][_0x82f6('0x49')];transfers[_0x44de65[_0x82f6('0x47')]]['calleridname']=agents[_0x44de65[_0x82f6('0x43')]][_0x82f6('0x4a')];transfers[_0x44de65[_0x82f6('0x47')]]['agentcalledAt']=utils[_0x82f6('0x2b')]();transfers[_0x44de65[_0x82f6('0x47')]][_0x82f6('0x37')]=utils[_0x82f6('0x2b')]();transfers[_0x44de65[_0x82f6('0x47')]][_0x82f6('0x21')]=0x0;transfers[_0x44de65['transfereeuniqueid']][_0x82f6('0x4b')]=0x2;}}else if(_0x44de65[_0x82f6('0x43')]==_0x44de65[_0x82f6('0x4c')]){if(!_[_0x82f6('0x1d')](agents[_0x44de65[_0x82f6('0x40')]])){utils['info'](util[_0x82f6('0x2')](_0x82f6('0x42'),_0x44de65[_0x82f6('0x40')],agents[_0x44de65[_0x82f6('0x40')]][_0x82f6('0x5')]));agents[_0x44de65[_0x82f6('0x40')]][_0x82f6('0x3b')]=!![];agents[_0x44de65[_0x82f6('0x40')]]['transfertype']=_0x82f6('0x4d');agents[_0x44de65['origtransfereruniqueid']][_0x82f6('0x44')]=_0x44de65[_0x82f6('0x4e')];agents[_0x44de65['origtransfereruniqueid']][_0x82f6('0x46')]=_0x44de65[_0x82f6('0x43')];}if(_0x44de65[_0x82f6('0x4f')]&&agents[_0x44de65['transfertargetuniqueid']]){agents[_0x44de65['transfertargetuniqueid']][_0x82f6('0x4b')]=0x1;transfers[_0x44de65[_0x82f6('0x4f')]]=_['clone'](agents[_0x44de65['transfertargetuniqueid']]);transfers[_0x44de65[_0x82f6('0x4f')]][_0x82f6('0x49')]=agents[_0x44de65[_0x82f6('0x40')]][_0x82f6('0x49')];transfers[_0x44de65[_0x82f6('0x4f')]][_0x82f6('0x4a')]=agents[_0x44de65[_0x82f6('0x40')]][_0x82f6('0x4a')];transfers[_0x44de65[_0x82f6('0x4f')]][_0x82f6('0x15')]=utils[_0x82f6('0x2b')]();transfers[_0x44de65[_0x82f6('0x4f')]]['agentconnectAt']=utils[_0x82f6('0x2b')]();transfers[_0x44de65[_0x82f6('0x4f')]][_0x82f6('0x21')]=0x0;transfers[_0x44de65[_0x82f6('0x4f')]][_0x82f6('0x4b')]=0x2;}}}catch(_0x4ef838){utils[_0x82f6('0x1b')](util[_0x82f6('0x2')](_0x82f6('0x3f'),_0x44de65['origtransfereruniqueid']),_0x4ef838);}};exports[_0x82f6('0x50')]=function(_0x192dc7){try{utils[_0x82f6('0x12')](util[_0x82f6('0x2')](_0x82f6('0x51'),_0x192dc7[_0x82f6('0x3')]),_0x192dc7);if(agents[_0x192dc7[_0x82f6('0x3')]]&&agents[_0x192dc7['uniqueid']][_0x82f6('0x20')]==='timeout'){if(_0x192dc7[_0x82f6('0x52')]==='21'){agents[_0x192dc7[_0x82f6('0x3')]][_0x82f6('0x20')]=_0x82f6('0x53');agents[_0x192dc7[_0x82f6('0x3')]][_0x82f6('0x7')]=_0x82f6('0x53');}utils[_0x82f6('0x19')](util[_0x82f6('0x2')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x192dc7[_0x82f6('0x3')],agents[_0x192dc7[_0x82f6('0x3')]][_0x82f6('0x5')],agents[_0x192dc7[_0x82f6('0x3')]][_0x82f6('0x20')],agents[_0x192dc7[_0x82f6('0x3')]]['lastevent']));writeDB(agents[_0x192dc7[_0x82f6('0x3')]]);var _0x443547=unanswered['indexOf'](_0x192dc7['uniqueid']);if(_0x443547>-0x1){unanswered[_0x82f6('0x54')](_0x443547,0x1);}}if(transfers[_0x192dc7[_0x82f6('0x3')]]){transfers[_0x192dc7[_0x82f6('0x3')]][_0x82f6('0x32')]=!![];transfers[_0x192dc7[_0x82f6('0x3')]][_0x82f6('0x35')]=utils['now']();transfers[_0x192dc7[_0x82f6('0x3')]]['talktime']=utils[_0x82f6('0x36')](transfers[_0x192dc7['uniqueid']][_0x82f6('0x35')],transfers[_0x192dc7['uniqueid']][_0x82f6('0x37')]);transfers[_0x192dc7[_0x82f6('0x3')]][_0x82f6('0x20')]='agent';transfers[_0x192dc7[_0x82f6('0x3')]]['lastevent']=_0x82f6('0x55');utils[_0x82f6('0x19')](util[_0x82f6('0x2')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x192dc7[_0x82f6('0x3')],transfers[_0x192dc7[_0x82f6('0x3')]][_0x82f6('0x5')],transfers[_0x192dc7['uniqueid']]['reason'],transfers[_0x192dc7[_0x82f6('0x3')]][_0x82f6('0x7')]));writeDB(transfers[_0x192dc7[_0x82f6('0x3')]],!![]);}if(agents[_0x192dc7[_0x82f6('0x3')]]&&agents[_0x192dc7[_0x82f6('0x3')]][_0x82f6('0x37')]){agents[_0x192dc7[_0x82f6('0x3')]][_0x82f6('0x32')]=!![];agents[_0x192dc7['uniqueid']][_0x82f6('0x35')]=utils[_0x82f6('0x2b')]();agents[_0x192dc7['uniqueid']][_0x82f6('0x23')]=utils[_0x82f6('0x36')](agents[_0x192dc7[_0x82f6('0x3')]]['agentcompleteAt'],agents[_0x192dc7[_0x82f6('0x3')]][_0x82f6('0x37')]);agents[_0x192dc7[_0x82f6('0x3')]][_0x82f6('0x20')]=agents[_0x192dc7['uniqueid']][_0x82f6('0x3b')]?_0x82f6('0x3b'):_0x82f6('0x56');agents[_0x192dc7[_0x82f6('0x3')]][_0x82f6('0x7')]=_0x82f6('0x55');utils['info'](util[_0x82f6('0x2')](_0x82f6('0x57'),_0x192dc7[_0x82f6('0x3')],agents[_0x192dc7[_0x82f6('0x3')]][_0x82f6('0x5')],agents[_0x192dc7['uniqueid']][_0x82f6('0x20')],agents[_0x192dc7['uniqueid']][_0x82f6('0x7')]));writeDB(agents[_0x192dc7[_0x82f6('0x3')]]);}}catch(_0x425e33){utils[_0x82f6('0x1b')](util[_0x82f6('0x2')](_0x82f6('0x51'),_0x192dc7[_0x82f6('0x3')]),_0x425e33);}}; \ No newline at end of file +var _0xf290=['now','connectedlinename','error','agentringnoanswer','timeout','reason','holdtime','push','[%s][agents][agentringnoanswer]','includes','debug','[%s][agents][queuecallerabandon]\x20agent:%s\x20destuniqueid:%s\x20lastevent:abandoned','agentringnoanswerAt','abandoned','talktime','agentconnect','[%s][agents][agentconnect]\x20agent:%s\x20destuniqueid:%s\x20lastevent:connect','agentconnectAt','ringtime','connect','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','[%s][agents][agentconnect]','isNil','[%s][agents][agentcomplete]','agentcompleteAt','diffTime','complete','blindtransfer','transfereruniqueid','[%s][agents][blindtransfer]','[%s][agents][blindtransfer]\x20agent:%s\x20transferuniqueid:%s','transfer','blind','transferexten','extension','transferuniqueid','attendedtransfer','[%s][agents][attendedtransfer]','origtransfereruniqueid','secondtransfereruniqueid','transfertype','ATTENDED','origtransfererexten','transfereeuniqueid','agententerreason','secondtransfererlinkedid','[%s][agents][attendedtransfer]\x20agent:%s','secondtransfererexten','transfertargetuniqueid','clone','calleridname','hangup','[%s][agents][hangup]','rejected','indexOf','agent','util','info','format','[%s][agents][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','uniqueid','channel','membername','calleridnum','connectedlinenum','lastevent','queue','getVoiceQueueByName','then','type','agentacw','agentcomplete','acw','acwtime','request','CreateVoiceAgentReport','destuniqueid','agentcalled','[%s][agents][agentcalled]','agentcalledAt'];(function(_0x37bc9f,_0x36e6e8){var _0x318bb6=function(_0x3cbb47){while(--_0x3cbb47){_0x37bc9f['push'](_0x37bc9f['shift']());}};_0x318bb6(++_0x36e6e8);}(_0xf290,0xde));var _0x0f29=function(_0x104e21,_0x2ea86f){_0x104e21=_0x104e21-0x0;var _0x605b37=_0xf290[_0x104e21];return _0x605b37;};'use strict';var _=require('lodash');var util=require(_0x0f29('0x0'));var utils=require('./utils');var agents={};var transfers={};var unanswered=[];function writeDB(_0x1d35f0,_0x4b16e4){utils[_0x0f29('0x1')](util[_0x0f29('0x2')](_0x0f29('0x3'),_0x1d35f0[_0x0f29('0x4')],_0x1d35f0[_0x0f29('0x5')],_0x1d35f0['queue'],_0x1d35f0[_0x0f29('0x6')],_0x1d35f0['interface'],_0x1d35f0[_0x0f29('0x7')],_0x1d35f0[_0x0f29('0x8')],_0x1d35f0[_0x0f29('0x9')]));if(_0x1d35f0[_0x0f29('0xa')]){utils[_0x0f29('0xb')](_0x1d35f0[_0x0f29('0xa')])[_0x0f29('0xc')](function(_0x3c6a6e){if(_0x3c6a6e){_0x1d35f0[_0x0f29('0xd')]=_0x3c6a6e[_0x0f29('0xd')];_0x1d35f0[_0x0f29('0xe')]=_0x1d35f0[_0x0f29('0xf')]?_0x3c6a6e[_0x0f29('0x10')]:![];_0x1d35f0[_0x0f29('0x11')]=_0x1d35f0[_0x0f29('0xe')]?_0x3c6a6e['acwTimeout']:0x0;}utils[_0x0f29('0x12')]('CreateVoiceAgentReport',_0x1d35f0);});}else{utils[_0x0f29('0x12')](_0x0f29('0x13'),_0x1d35f0);}if(_0x4b16e4){delete transfers[_0x1d35f0[_0x0f29('0x4')]];}else{delete agents[_0x1d35f0[_0x0f29('0x14')]];}}exports[_0x0f29('0x15')]=function(_0x2d2573){try{utils['debug'](util[_0x0f29('0x2')](_0x0f29('0x16'),_0x2d2573[_0x0f29('0x4')]),_0x2d2573);agents[_0x2d2573[_0x0f29('0x14')]]=_0x2d2573;agents[_0x2d2573[_0x0f29('0x14')]][_0x0f29('0x17')]=utils[_0x0f29('0x18')]();agents[_0x2d2573[_0x0f29('0x14')]]['lastevent']='called';agents[_0x2d2573[_0x0f29('0x14')]][_0x0f29('0x8')]=null;agents[_0x2d2573[_0x0f29('0x14')]][_0x0f29('0x19')]=null;utils['info'](util[_0x0f29('0x2')]('[%s][agents][agentcalled]\x20agent:%s\x20destuniqueid:%s\x20lastevent:called',_0x2d2573[_0x0f29('0x4')],agents[_0x2d2573['destuniqueid']]['membername'],_0x2d2573['destuniqueid']));}catch(_0x23a44f){utils[_0x0f29('0x1a')](util[_0x0f29('0x2')](_0x0f29('0x16'),_0x2d2573[_0x0f29('0x4')]),_0x23a44f);}};exports[_0x0f29('0x1b')]=function(_0x150271){try{if(!_['isNil'](agents[_0x150271[_0x0f29('0x14')]])){utils['debug'](util['format']('[%s][agents][agentringnoanswer]',_0x150271['uniqueid']),_0x150271);utils[_0x0f29('0x1')](util[_0x0f29('0x2')]('[%s][agents][agentringnoanswer]\x20agent:%s\x20destuniqueid:%s\x20lastevent:timeout',_0x150271[_0x0f29('0x4')],agents[_0x150271[_0x0f29('0x14')]][_0x0f29('0x6')],_0x150271[_0x0f29('0x14')]));agents[_0x150271[_0x0f29('0x14')]]['agentringnoanswer']=!![];agents[_0x150271[_0x0f29('0x14')]]['agentringnoanswerAt']=utils[_0x0f29('0x18')]();agents[_0x150271[_0x0f29('0x14')]][_0x0f29('0x9')]=_0x0f29('0x1c');agents[_0x150271['destuniqueid']][_0x0f29('0x1d')]='timeout';agents[_0x150271['destuniqueid']][_0x0f29('0x1e')]=_0x150271['ringtime']?parseInt(_0x150271['ringtime'])/0x3e8:0x0;agents[_0x150271['destuniqueid']]['talktime']=0x0;unanswered[_0x0f29('0x1f')](_0x150271[_0x0f29('0x14')]);}}catch(_0x4cc5a0){utils[_0x0f29('0x1a')](util[_0x0f29('0x2')](_0x0f29('0x20'),_0x150271['uniqueid']),_0x4cc5a0);}};exports['queuecallerabandon']=function(_0x37ebcc){try{_['forIn'](agents,function(_0x36b65c,_0x561c31){if(_0x36b65c['uniqueid']==_0x37ebcc[_0x0f29('0x4')]&&!_[_0x0f29('0x21')](unanswered,_0x36b65c[_0x0f29('0x14')])){utils[_0x0f29('0x22')](util['format']('[%s][agents][queuecallerabandon]',_0x37ebcc[_0x0f29('0x4')]),_0x37ebcc);utils['info'](util['format'](_0x0f29('0x23'),_0x37ebcc['uniqueid'],_0x36b65c[_0x0f29('0x6')],_0x36b65c['destuniqueid']));_0x36b65c['agentringnoanswer']=!![];_0x36b65c[_0x0f29('0x24')]=utils[_0x0f29('0x18')]();_0x36b65c[_0x0f29('0x9')]=_0x0f29('0x25');_0x36b65c[_0x0f29('0x1d')]='abandoned';_0x36b65c[_0x0f29('0x1e')]=_0x37ebcc['holdtime'];_0x36b65c[_0x0f29('0x26')]=0x0;writeDB(_0x36b65c);}});}catch(_0x3e8f3f){utils[_0x0f29('0x1a')](util[_0x0f29('0x2')]('[%s][agents][queuecallerabandon]',_0x37ebcc[_0x0f29('0x4')]),_0x3e8f3f);}};exports[_0x0f29('0x27')]=function(_0x5be4fa){try{if(agents[_0x5be4fa[_0x0f29('0x14')]]){utils[_0x0f29('0x22')](util['format']('[%s][agents][agentconnect]',_0x5be4fa[_0x0f29('0x4')]),_0x5be4fa);utils[_0x0f29('0x1')](util[_0x0f29('0x2')](_0x0f29('0x28'),_0x5be4fa[_0x0f29('0x4')],agents[_0x5be4fa[_0x0f29('0x14')]]['membername'],_0x5be4fa[_0x0f29('0x14')]));agents[_0x5be4fa['destuniqueid']][_0x0f29('0x29')]=utils['now']();agents[_0x5be4fa[_0x0f29('0x14')]][_0x0f29('0x8')]=_0x5be4fa[_0x0f29('0x8')];agents[_0x5be4fa['destuniqueid']]['connectedlinename']=_0x5be4fa[_0x0f29('0x19')];agents[_0x5be4fa['destuniqueid']][_0x0f29('0x1e')]=_0x5be4fa[_0x0f29('0x2a')];agents[_0x5be4fa[_0x0f29('0x14')]][_0x0f29('0x9')]=_0x0f29('0x2b');_['forIn'](agents,function(_0x13c05c,_0xf77c66){if(_0x13c05c[_0x0f29('0x14')]!=_0x5be4fa[_0x0f29('0x14')]&&_0x13c05c[_0x0f29('0x4')]==_0x5be4fa[_0x0f29('0x4')]){_0x13c05c[_0x0f29('0x26')]=0x0;_0x13c05c[_0x0f29('0x1e')]=_0x5be4fa[_0x0f29('0x2a')];_0x13c05c['agentringnoanswer']=!![];_0x13c05c[_0x0f29('0x24')]=utils[_0x0f29('0x18')]();_0x13c05c[_0x0f29('0x9')]=_0x0f29('0x2c');_0x13c05c['reason']=_0x0f29('0x2c');_0x13c05c[_0x0f29('0x2d')]=_0x5be4fa[_0x0f29('0x14')];_0x13c05c[_0x0f29('0x2e')]=_0x5be4fa[_0x0f29('0x6')];writeDB(_0x13c05c);}});}}catch(_0x56062d){utils[_0x0f29('0x1a')](util[_0x0f29('0x2')](_0x0f29('0x2f'),_0x5be4fa['uniqueid']),_0x56062d);}};exports[_0x0f29('0xf')]=function(_0x284279){try{if(!_[_0x0f29('0x30')](agents[_0x284279[_0x0f29('0x14')]])){utils[_0x0f29('0x22')](util[_0x0f29('0x2')](_0x0f29('0x31'),_0x284279[_0x0f29('0x4')]),_0x284279);utils['info'](util['format']('[%s][agents][agentcomplete]\x20agent:%s\x20destuniqueid:%s\x20lastevent:complete',_0x284279[_0x0f29('0x4')],agents[_0x284279[_0x0f29('0x14')]][_0x0f29('0x6')],_0x284279[_0x0f29('0x14')]));agents[_0x284279[_0x0f29('0x14')]][_0x0f29('0xf')]=!![];agents[_0x284279['destuniqueid']][_0x0f29('0x32')]=utils['now']();agents[_0x284279[_0x0f29('0x14')]]['talktime']=utils[_0x0f29('0x33')](agents[_0x284279[_0x0f29('0x14')]][_0x0f29('0x32')],agents[_0x284279[_0x0f29('0x14')]][_0x0f29('0x29')]);agents[_0x284279['destuniqueid']][_0x0f29('0x1d')]=_0x284279[_0x0f29('0x1d')];agents[_0x284279[_0x0f29('0x14')]]['lastevent']=_0x0f29('0x34');writeDB(agents[_0x284279['destuniqueid']]);}}catch(_0x4fd625){utils[_0x0f29('0x1a')](util[_0x0f29('0x2')](_0x0f29('0x31'),_0x284279[_0x0f29('0x4')]),_0x4fd625);}};exports[_0x0f29('0x35')]=function(_0x335435){try{if(!_['isNil'](agents[_0x335435[_0x0f29('0x36')]])){utils[_0x0f29('0x22')](util[_0x0f29('0x2')](_0x0f29('0x37'),_0x335435[_0x0f29('0x4')]),_0x335435);utils[_0x0f29('0x1')](util[_0x0f29('0x2')](_0x0f29('0x38'),_0x335435[_0x0f29('0x4')],agents[_0x335435[_0x0f29('0x36')]]['membername'],agents[_0x335435['transfereruniqueid']][_0x0f29('0x4')]));agents[_0x335435[_0x0f29('0x36')]][_0x0f29('0x39')]=!![];agents[_0x335435[_0x0f29('0x36')]]['transfertype']=_0x0f29('0x3a');agents[_0x335435[_0x0f29('0x36')]][_0x0f29('0x3b')]=_0x335435[_0x0f29('0x3c')];agents[_0x335435[_0x0f29('0x36')]][_0x0f29('0x3d')]=agents[_0x335435[_0x0f29('0x36')]]['uniqueid'];}}catch(_0x17f33){utils[_0x0f29('0x1a')](util[_0x0f29('0x2')](_0x0f29('0x37'),_0x335435[_0x0f29('0x4')]),_0x17f33);}};exports[_0x0f29('0x3e')]=function(_0x5ec172){try{utils[_0x0f29('0x22')](util[_0x0f29('0x2')](_0x0f29('0x3f'),_0x5ec172['origtransfereruniqueid']),_0x5ec172);if(_0x5ec172[_0x0f29('0x40')]==_0x5ec172['origtransfererlinkedid']){if(!_[_0x0f29('0x30')](agents[_0x5ec172['secondtransfereruniqueid']])){utils[_0x0f29('0x1')](util[_0x0f29('0x2')]('[%s][agents][attendedtransfer]\x20agent:%s',_0x5ec172[_0x0f29('0x40')],agents[_0x5ec172[_0x0f29('0x41')]][_0x0f29('0x6')]));agents[_0x5ec172['secondtransfereruniqueid']][_0x0f29('0x39')]=!![];agents[_0x5ec172['secondtransfereruniqueid']][_0x0f29('0x42')]=_0x0f29('0x43');agents[_0x5ec172['secondtransfereruniqueid']][_0x0f29('0x3b')]=_0x5ec172[_0x0f29('0x44')];agents[_0x5ec172['secondtransfereruniqueid']][_0x0f29('0x3d')]=_0x5ec172['origtransfereruniqueid'];}if(_0x5ec172[_0x0f29('0x45')]&&agents[_0x5ec172['transfereeuniqueid']]){agents[_0x5ec172[_0x0f29('0x45')]][_0x0f29('0x46')]=0x1;transfers[_0x5ec172[_0x0f29('0x45')]]=_['clone'](agents[_0x5ec172[_0x0f29('0x45')]]);transfers[_0x5ec172[_0x0f29('0x45')]][_0x0f29('0x7')]=agents[_0x5ec172[_0x0f29('0x41')]]['calleridnum'];transfers[_0x5ec172[_0x0f29('0x45')]]['calleridname']=agents[_0x5ec172[_0x0f29('0x41')]]['calleridname'];transfers[_0x5ec172[_0x0f29('0x45')]][_0x0f29('0x17')]=utils[_0x0f29('0x18')]();transfers[_0x5ec172[_0x0f29('0x45')]][_0x0f29('0x29')]=utils[_0x0f29('0x18')]();transfers[_0x5ec172[_0x0f29('0x45')]]['holdtime']=0x0;transfers[_0x5ec172[_0x0f29('0x45')]]['agententerreason']=0x2;}}else if(_0x5ec172[_0x0f29('0x41')]==_0x5ec172[_0x0f29('0x47')]){if(!_[_0x0f29('0x30')](agents[_0x5ec172['origtransfereruniqueid']])){utils[_0x0f29('0x1')](util[_0x0f29('0x2')](_0x0f29('0x48'),_0x5ec172[_0x0f29('0x40')],agents[_0x5ec172[_0x0f29('0x40')]]['membername']));agents[_0x5ec172['origtransfereruniqueid']][_0x0f29('0x39')]=!![];agents[_0x5ec172[_0x0f29('0x40')]][_0x0f29('0x42')]='ATTENDED';agents[_0x5ec172['origtransfereruniqueid']][_0x0f29('0x3b')]=_0x5ec172[_0x0f29('0x49')];agents[_0x5ec172[_0x0f29('0x40')]]['transferuniqueid']=_0x5ec172['secondtransfereruniqueid'];}if(_0x5ec172['transfertargetuniqueid']&&agents[_0x5ec172[_0x0f29('0x4a')]]){agents[_0x5ec172[_0x0f29('0x4a')]]['agententerreason']=0x1;transfers[_0x5ec172[_0x0f29('0x4a')]]=_[_0x0f29('0x4b')](agents[_0x5ec172['transfertargetuniqueid']]);transfers[_0x5ec172[_0x0f29('0x4a')]]['calleridnum']=agents[_0x5ec172[_0x0f29('0x40')]][_0x0f29('0x7')];transfers[_0x5ec172['transfertargetuniqueid']][_0x0f29('0x4c')]=agents[_0x5ec172[_0x0f29('0x40')]][_0x0f29('0x4c')];transfers[_0x5ec172[_0x0f29('0x4a')]][_0x0f29('0x17')]=utils[_0x0f29('0x18')]();transfers[_0x5ec172['transfertargetuniqueid']][_0x0f29('0x29')]=utils[_0x0f29('0x18')]();transfers[_0x5ec172[_0x0f29('0x4a')]]['holdtime']=0x0;transfers[_0x5ec172[_0x0f29('0x4a')]][_0x0f29('0x46')]=0x2;}}}catch(_0x4bbc7e){utils[_0x0f29('0x1a')](util['format'](_0x0f29('0x3f'),_0x5ec172[_0x0f29('0x40')]),_0x4bbc7e);}};exports[_0x0f29('0x4d')]=function(_0x4bd8f1){try{utils[_0x0f29('0x22')](util[_0x0f29('0x2')](_0x0f29('0x4e'),_0x4bd8f1[_0x0f29('0x4')]),_0x4bd8f1);if(agents[_0x4bd8f1[_0x0f29('0x4')]]&&agents[_0x4bd8f1[_0x0f29('0x4')]]['reason']===_0x0f29('0x1c')){if(_0x4bd8f1['cause']==='21'){agents[_0x4bd8f1['uniqueid']][_0x0f29('0x1d')]=_0x0f29('0x4f');agents[_0x4bd8f1['uniqueid']][_0x0f29('0x9')]=_0x0f29('0x4f');}utils['info'](util['format']('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x4bd8f1['uniqueid'],agents[_0x4bd8f1[_0x0f29('0x4')]][_0x0f29('0x6')],agents[_0x4bd8f1['uniqueid']]['reason'],agents[_0x4bd8f1[_0x0f29('0x4')]]['lastevent']));writeDB(agents[_0x4bd8f1[_0x0f29('0x4')]]);var _0x473eac=unanswered[_0x0f29('0x50')](_0x4bd8f1[_0x0f29('0x4')]);if(_0x473eac>-0x1){unanswered['splice'](_0x473eac,0x1);}}if(transfers[_0x4bd8f1[_0x0f29('0x4')]]){transfers[_0x4bd8f1[_0x0f29('0x4')]][_0x0f29('0xf')]=!![];transfers[_0x4bd8f1[_0x0f29('0x4')]][_0x0f29('0x32')]=utils['now']();transfers[_0x4bd8f1[_0x0f29('0x4')]][_0x0f29('0x26')]=utils[_0x0f29('0x33')](transfers[_0x4bd8f1[_0x0f29('0x4')]][_0x0f29('0x32')],transfers[_0x4bd8f1[_0x0f29('0x4')]][_0x0f29('0x29')]);transfers[_0x4bd8f1[_0x0f29('0x4')]][_0x0f29('0x1d')]=_0x0f29('0x51');transfers[_0x4bd8f1[_0x0f29('0x4')]][_0x0f29('0x9')]=_0x0f29('0x34');utils[_0x0f29('0x1')](util[_0x0f29('0x2')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x4bd8f1[_0x0f29('0x4')],transfers[_0x4bd8f1[_0x0f29('0x4')]][_0x0f29('0x6')],transfers[_0x4bd8f1[_0x0f29('0x4')]]['reason'],transfers[_0x4bd8f1['uniqueid']][_0x0f29('0x9')]));writeDB(transfers[_0x4bd8f1[_0x0f29('0x4')]],!![]);}if(agents[_0x4bd8f1[_0x0f29('0x4')]]&&agents[_0x4bd8f1['uniqueid']][_0x0f29('0x29')]){agents[_0x4bd8f1['uniqueid']][_0x0f29('0xf')]=!![];agents[_0x4bd8f1['uniqueid']][_0x0f29('0x32')]=utils[_0x0f29('0x18')]();agents[_0x4bd8f1[_0x0f29('0x4')]]['talktime']=utils[_0x0f29('0x33')](agents[_0x4bd8f1['uniqueid']]['agentcompleteAt'],agents[_0x4bd8f1[_0x0f29('0x4')]]['agentconnectAt']);agents[_0x4bd8f1[_0x0f29('0x4')]][_0x0f29('0x1d')]=agents[_0x4bd8f1['uniqueid']][_0x0f29('0x39')]?_0x0f29('0x39'):_0x0f29('0x51');agents[_0x4bd8f1[_0x0f29('0x4')]][_0x0f29('0x9')]=_0x0f29('0x34');utils[_0x0f29('0x1')](util[_0x0f29('0x2')]('[%s][agents][hangup]\x20agent:%s\x20reason:%s\x20lastevent:%s',_0x4bd8f1[_0x0f29('0x4')],agents[_0x4bd8f1[_0x0f29('0x4')]][_0x0f29('0x6')],agents[_0x4bd8f1['uniqueid']][_0x0f29('0x1d')],agents[_0x4bd8f1[_0x0f29('0x4')]]['lastevent']));writeDB(agents[_0x4bd8f1[_0x0f29('0x4')]]);}}catch(_0x5e39a7){utils[_0x0f29('0x1a')](util['format'](_0x0f29('0x4e'),_0x4bd8f1['uniqueid']),_0x5e39a7);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index 9a9bf08..cc0a6c3 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 _0x39b7=['sipcallid','[%s][calls][varset]\x20variable:sipcallid\x20value:%s','newexten','[%s][calls][newexten]','application','appdata','toLowerCase','startsWith','split','substring','lastIndexOf','includes','hangup','noop','execif','set','gotoif','lastapplication','util','./utils','FAILED','NO\x20ANSWER','ANSWERED','BUSY','blinds','uniqueid','transfereeuniqueid','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','queue','membername','interface','calleridnum','connectedlinenum','lastevent','accountcode','getUserByInternal','request','CreateVoiceCallReport','newchannel','debug','[%s][calls][newchannel]','linkedid','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','exten','context','now','DOCUMENTATION','newstate','[%s][calls][newstate]','isNil','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','destinationchannel','answertime','disposition','toNumber','channelstate','error','[%s][calls][hangup]','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','cause-txt','diffTime','endtime','starttime','billableseconds','[%s][calls][attendedtransfer]','localtwolinkedid','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','origtransfereruniqueid','secondtransfererchannel','userfield','_attended','transfertargetchannel','origtransfererchannel','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s','musiconholdstop','[%s][calls][musiconholdstop]','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','[%s][calls][varset]','variable','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','xmd-phone','destination','\x22\x20<','xmd-callerid-preview','xmd-callerid','[%s][calls][varset]\x20variable:%s\x20value:%s','xmcs-queue','xmd-queue','lastdata','xmd-contactid','[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s','ContactId','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s'];(function(_0x229871,_0x3e45fc){var _0x126b33=function(_0x28e262){while(--_0x28e262){_0x229871['push'](_0x229871['shift']());}};_0x126b33(++_0x3e45fc);}(_0x39b7,0x15c));var _0x739b=function(_0x4e9f5d,_0x391085){_0x4e9f5d=_0x4e9f5d-0x0;var _0x162e63=_0x39b7[_0x4e9f5d];return _0x162e63;};'use strict';var _=require('lodash');var util=require(_0x739b('0x0'));var utils=require(_0x739b('0x1'));var transfers=require('./transfers.controller');var dispositions=['NO\x20ANSWER',_0x739b('0x2'),_0x739b('0x2'),_0x739b('0x3'),_0x739b('0x3'),'NO\x20ANSWER',_0x739b('0x4'),_0x739b('0x5'),'FAILED',_0x739b('0x2'),_0x739b('0x2')];var channels={};function writeDB(_0x27b7a5){var _0x4961c9;if(transfers[_0x739b('0x6')][_0x27b7a5['uniqueid']]){_0x4961c9=_0x27b7a5['uniqueid'];_0x27b7a5[_0x739b('0x7')]=transfers[_0x739b('0x6')][_0x27b7a5['uniqueid']][_0x739b('0x8')];}utils[_0x739b('0x9')](util[_0x739b('0xa')](_0x739b('0xb'),_0x27b7a5[_0x739b('0x7')],_0x27b7a5[_0x739b('0xc')],_0x27b7a5[_0x739b('0xd')],_0x27b7a5[_0x739b('0xe')],_0x27b7a5[_0x739b('0xf')],_0x27b7a5[_0x739b('0x10')],_0x27b7a5[_0x739b('0x11')],_0x27b7a5[_0x739b('0x12')]));if(_0x27b7a5[_0x739b('0x13')]){utils[_0x739b('0x14')](_0x27b7a5['accountcode'])['then'](function(_0x4489c7){if(_0x4489c7){_0x27b7a5['UserId']=_0x4489c7['id'];}utils[_0x739b('0x15')](_0x739b('0x16'),_0x27b7a5);});}else{utils[_0x739b('0x15')](_0x739b('0x16'),_0x27b7a5);}if(channels[_0x27b7a5[_0x739b('0x7')]]){delete channels[_0x27b7a5[_0x739b('0x7')]];}else if(_0x4961c9&&channels[_0x4961c9]){delete transfers[_0x739b('0x6')][_0x4961c9];delete channels[_0x4961c9];}}exports[_0x739b('0x17')]=function(_0x23ff30){try{utils[_0x739b('0x18')](util[_0x739b('0xa')](_0x739b('0x19'),_0x23ff30[_0x739b('0x7')]),_0x23ff30);if(_0x23ff30[_0x739b('0x7')]==_0x23ff30[_0x739b('0x1a')]&&_0x23ff30[_0x739b('0xc')]!=_0x739b('0x1b')){utils[_0x739b('0x9')](util[_0x739b('0xa')](_0x739b('0x1c'),_0x23ff30[_0x739b('0x7')],_0x23ff30['context'],_0x23ff30['exten']));channels[_0x23ff30[_0x739b('0x7')]]={'uniqueid':_0x23ff30[_0x739b('0x7')],'accountcode':_0x23ff30[_0x739b('0x13')],'source':_0x23ff30[_0x739b('0x10')],'destination':_0x23ff30[_0x739b('0x1d')],'destinationcontext':_0x23ff30[_0x739b('0x1e')],'channel':_0x23ff30[_0x739b('0xc')],'starttime':utils[_0x739b('0x1f')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':'NO\x20ANSWER','amaflags':_0x739b('0x20')};}}catch(_0x4c0843){utils['error'](util['format'](_0x739b('0x19'),_0x23ff30[_0x739b('0x7')]),_0x4c0843);}};exports[_0x739b('0x21')]=function(_0x338d44){try{utils[_0x739b('0x18')](util['format'](_0x739b('0x22'),_0x338d44['uniqueid']),_0x338d44);if(!_[_0x739b('0x23')](channels[_0x338d44[_0x739b('0x7')]])&&_0x338d44['channelstate']==0x6){utils[_0x739b('0x9')](util[_0x739b('0xa')](_0x739b('0x24'),_0x338d44[_0x739b('0x7')],_0x338d44[_0x739b('0x1e')],_0x338d44[_0x739b('0xc')]));if(_[_0x739b('0x23')](channels[_0x338d44[_0x739b('0x7')]][_0x739b('0x25')])){channels[_0x338d44['uniqueid']][_0x739b('0x25')]=utils[_0x739b('0x1f')]();}}else if(!_[_0x739b('0x23')](channels[_0x338d44[_0x739b('0x1a')]])&&_0x338d44['channelstate']==0x6&&_0x338d44['context']!='transfer'){utils[_0x739b('0x9')](util[_0x739b('0xa')]('[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x338d44['uniqueid'],_0x338d44[_0x739b('0x1a')],_0x338d44[_0x739b('0x1e')],_0x338d44[_0x739b('0xc')]));channels[_0x338d44[_0x739b('0x1a')]][_0x739b('0x13')]=_0x338d44[_0x739b('0x13')];channels[_0x338d44[_0x739b('0x1a')]][_0x739b('0x26')]=_0x338d44[_0x739b('0xc')];if(_[_0x739b('0x23')](channels[_0x338d44['linkedid']][_0x739b('0x27')])){channels[_0x338d44[_0x739b('0x1a')]][_0x739b('0x27')]=utils[_0x739b('0x1f')]();}channels[_0x338d44[_0x739b('0x1a')]][_0x739b('0x28')]=dispositions[_[_0x739b('0x29')](_0x338d44[_0x739b('0x2a')])]||_0x739b('0x4');}}catch(_0x3fa00d){utils[_0x739b('0x2b')](util[_0x739b('0xa')](_0x739b('0x22'),_0x338d44[_0x739b('0x7')]),_0x3fa00d);}};exports['hangup']=function(_0x5b9503){try{if(!_['isNil'](channels[_0x5b9503[_0x739b('0x7')]])){utils[_0x739b('0x18')](util['format'](_0x739b('0x2c'),_0x5b9503[_0x739b('0x7')]),_0x5b9503);if(_[_0x739b('0x23')](channels[_0x5b9503[_0x739b('0x7')]][_0x739b('0x2d')])){channels[_0x5b9503['uniqueid']][_0x739b('0x2d')]=_0x5b9503[_0x739b('0x2e')]+'\x20<'+_0x5b9503['calleridnum']+'>';}utils['info'](util[_0x739b('0xa')](_0x739b('0x2f'),_0x5b9503['uniqueid'],channels[_0x5b9503[_0x739b('0x7')]]['callerid'],_0x5b9503[_0x739b('0x30')]));channels[_0x5b9503[_0x739b('0x7')]]['endtime']=utils[_0x739b('0x1f')]();channels[_0x5b9503['uniqueid']]['duration']=utils[_0x739b('0x31')](channels[_0x5b9503[_0x739b('0x7')]][_0x739b('0x32')],channels[_0x5b9503['uniqueid']][_0x739b('0x33')]);channels[_0x5b9503[_0x739b('0x7')]][_0x739b('0x34')]=channels[_0x5b9503[_0x739b('0x7')]][_0x739b('0x27')]?utils[_0x739b('0x31')](channels[_0x5b9503[_0x739b('0x7')]][_0x739b('0x32')],channels[_0x5b9503['uniqueid']][_0x739b('0x27')]):0x0;writeDB(channels[_0x5b9503[_0x739b('0x7')]]);}}catch(_0x552f1f){utils[_0x739b('0x2b')](util[_0x739b('0xa')](_0x739b('0x2c'),_0x5b9503['uniqueid']),_0x552f1f);}};exports['attendedtransfer']=function(_0x5324eb){try{if(!_['isNil'](channels[_0x5324eb['localtwolinkedid']])){utils['debug'](util['format'](_0x739b('0x35'),_0x5324eb['origtransfereruniqueid']),_0x5324eb);if(channels[_0x5324eb[_0x739b('0x36')]][_0x739b('0xc')]==_0x5324eb[_0x739b('0x37')]){utils[_0x739b('0x9')](util['format'](_0x739b('0x38'),_0x5324eb[_0x739b('0x39')],_0x5324eb[_0x739b('0x36')],_0x5324eb[_0x739b('0x3a')]));channels[_0x5324eb[_0x739b('0x36')]][_0x739b('0x26')]=_0x5324eb[_0x739b('0x3a')];channels[_0x5324eb[_0x739b('0x36')]][_0x739b('0x3b')]=_0x739b('0x3c');}else if(channels[_0x5324eb[_0x739b('0x36')]][_0x739b('0xc')]=_0x5324eb[_0x739b('0x3d')]){utils[_0x739b('0x9')](util[_0x739b('0xa')](_0x739b('0x38'),_0x5324eb[_0x739b('0x39')],_0x5324eb[_0x739b('0x36')],_0x5324eb[_0x739b('0x3e')]));channels[_0x5324eb[_0x739b('0x36')]][_0x739b('0x26')]=_0x5324eb['origtransfererchannel'];channels[_0x5324eb[_0x739b('0x36')]][_0x739b('0x3b')]=_0x739b('0x3c');}}}catch(_0x388334){utils[_0x739b('0x2b')](util[_0x739b('0xa')](_0x739b('0x35'),_0x5324eb[_0x739b('0x39')]),_0x388334);}};exports[_0x739b('0x3f')]=function(_0x8ec20){try{if(!_['isNil'](channels[_0x8ec20[_0x739b('0x7')]])){utils[_0x739b('0x18')](util[_0x739b('0xa')](_0x739b('0x40'),_0x8ec20[_0x739b('0x7')]),_0x8ec20);channels[_0x8ec20[_0x739b('0x7')]][_0x739b('0x41')]=utils[_0x739b('0x1f')]();utils[_0x739b('0x9')](util['format'](_0x739b('0x42'),_0x8ec20['uniqueid'],channels[_0x8ec20[_0x739b('0x7')]][_0x739b('0x41')]));}}catch(_0x3a09ae){utils[_0x739b('0x2b')](util[_0x739b('0xa')](_0x739b('0x40'),_0x8ec20[_0x739b('0x7')]),_0x3a09ae);}};exports[_0x739b('0x43')]=function(_0xd8b6c9){try{if(!_[_0x739b('0x23')](channels[_0xd8b6c9[_0x739b('0x7')]])){utils[_0x739b('0x18')](util[_0x739b('0xa')](_0x739b('0x44'),_0xd8b6c9[_0x739b('0x7')]),_0xd8b6c9);if(!_[_0x739b('0x23')](channels[_0xd8b6c9[_0x739b('0x7')]][_0x739b('0x41')])){channels[_0xd8b6c9[_0x739b('0x7')]][_0x739b('0x45')]+=utils[_0x739b('0x31')](utils[_0x739b('0x1f')](),channels[_0xd8b6c9[_0x739b('0x7')]]['musiconholdstartAt']);utils[_0x739b('0x9')](util[_0x739b('0xa')](_0x739b('0x46'),_0xd8b6c9['uniqueid'],channels[_0xd8b6c9[_0x739b('0x7')]][_0x739b('0x45')]));delete channels[_0xd8b6c9['uniqueid']][_0x739b('0x41')];}}}catch(_0x9d728){utils[_0x739b('0x2b')](util[_0x739b('0xa')](_0x739b('0x44'),_0xd8b6c9['uniqueid']),_0x9d728);}};exports['varset']=function(_0x877d5c){try{if(!_[_0x739b('0x23')](channels[_0x877d5c['uniqueid']])){utils[_0x739b('0x18')](util[_0x739b('0xa')](_0x739b('0x47'),_0x877d5c[_0x739b('0x7')]),_0x877d5c);if(!_[_0x739b('0x23')](_0x877d5c[_0x739b('0x48')]['xmd-originatecalleridnum'])){utils[_0x739b('0x9')](util['format'](_0x739b('0x49'),_0x877d5c[_0x739b('0x7')],_0x877d5c['value']));channels[_0x877d5c[_0x739b('0x7')]]['source']=_0x877d5c[_0x739b('0x4a')];}if(!_[_0x739b('0x23')](_0x877d5c[_0x739b('0x48')][_0x739b('0x4b')])){utils[_0x739b('0x9')](util[_0x739b('0xa')]('[%s][calls][varset]\x20variable:xmd-phone\x20value:%s',_0x877d5c[_0x739b('0x7')],_0x877d5c['value']));channels[_0x877d5c[_0x739b('0x7')]][_0x739b('0x4c')]=_0x877d5c[_0x739b('0x4a')];channels[_0x877d5c[_0x739b('0x7')]][_0x739b('0x2d')]='\x22'+_0x877d5c[_0x739b('0x4a')]+_0x739b('0x4d')+_0x877d5c[_0x739b('0x4a')]+'>';}if(!_[_0x739b('0x23')](_0x877d5c[_0x739b('0x48')][_0x739b('0x4e')])||!_[_0x739b('0x23')](_0x877d5c['variable'][_0x739b('0x4f')])){utils['info'](util[_0x739b('0xa')](_0x739b('0x50'),_0x877d5c[_0x739b('0x7')],!_[_0x739b('0x23')](_0x877d5c[_0x739b('0x48')][_0x739b('0x4e')])?_0x739b('0x4e'):'xmd-callerid',_0x877d5c[_0x739b('0x4a')]));channels[_0x877d5c[_0x739b('0x7')]][_0x739b('0x2d')]=_0x877d5c[_0x739b('0x4a')];}if(!_['isNil'](_0x877d5c['variable']['xmd-queue'])||!_['isNil'](_0x877d5c[_0x739b('0x48')][_0x739b('0x51')])){utils['info'](util['format'](_0x739b('0x50'),_0x877d5c[_0x739b('0x7')],!_[_0x739b('0x23')](_0x877d5c[_0x739b('0x48')][_0x739b('0x52')])?_0x739b('0x52'):_0x739b('0x51'),_0x877d5c['value']));channels[_0x877d5c[_0x739b('0x7')]]['lastapplication']='Queue';channels[_0x877d5c['uniqueid']][_0x739b('0x53')]=_0x877d5c[_0x739b('0x4a')];channels[_0x877d5c[_0x739b('0x7')]][_0x739b('0xd')]=!![];}if(!_[_0x739b('0x23')](_0x877d5c[_0x739b('0x48')][_0x739b('0x54')])){utils[_0x739b('0x9')](util[_0x739b('0xa')](_0x739b('0x55'),_0x877d5c[_0x739b('0x7')],_0x877d5c[_0x739b('0x4a')]));channels[_0x877d5c['uniqueid']][_0x739b('0x56')]=_0x877d5c[_0x739b('0x4a')];}if(!_[_0x739b('0x23')](_0x877d5c[_0x739b('0x48')][_0x739b('0x57')])){utils[_0x739b('0x9')](util[_0x739b('0xa')](_0x739b('0x58'),_0x877d5c[_0x739b('0x7')],_0x877d5c['value']));channels[_0x877d5c[_0x739b('0x7')]][_0x739b('0x59')]=_0x877d5c[_0x739b('0x4a')];}if(!_[_0x739b('0x23')](_0x877d5c[_0x739b('0x48')][_0x739b('0x5a')])){utils[_0x739b('0x9')](util[_0x739b('0xa')](_0x739b('0x5b'),_0x877d5c[_0x739b('0x7')],_0x877d5c[_0x739b('0x4a')]));channels[_0x877d5c[_0x739b('0x7')]]['routeid']=_0x877d5c['value'];}if(!_[_0x739b('0x23')](_0x877d5c[_0x739b('0x48')][_0x739b('0x5c')])){utils['info'](util[_0x739b('0xa')](_0x739b('0x5d'),_0x877d5c[_0x739b('0x7')],_0x877d5c[_0x739b('0x4a')]));channels[_0x877d5c[_0x739b('0x7')]][_0x739b('0x5c')]=_0x877d5c[_0x739b('0x4a')];}}}catch(_0x52f471){utils['error'](util['format'](_0x739b('0x47'),_0x877d5c[_0x739b('0x7')]),_0x52f471);}};exports[_0x739b('0x5e')]=function(_0x4a0d66){try{if(!_[_0x739b('0x23')](channels[_0x4a0d66['uniqueid']])){utils[_0x739b('0x18')](util[_0x739b('0xa')](_0x739b('0x5f'),_0x4a0d66['uniqueid']),_0x4a0d66);utils['info'](util['format']('[%s][calls][newexten]\x20application:%s\x20appdata:%s',_0x4a0d66[_0x739b('0x7')],_0x4a0d66[_0x739b('0x60')],_0x4a0d66[_0x739b('0x61')]));if(_0x4a0d66[_0x739b('0x60')][_0x739b('0x62')]()=='set'&&_[_0x739b('0x63')](_0x4a0d66[_0x739b('0x61')][_0x739b('0x62')](),'cdr')){var _0x5ccf18=_0x4a0d66[_0x739b('0x61')][_0x739b('0x64')]('=');var _0x471124=_0x5ccf18[0x0][_0x739b('0x65')](_0x5ccf18[0x0]['lastIndexOf']('(')+0x1,_0x5ccf18[0x0][_0x739b('0x66')](')'));var _0x1139d4=_0x5ccf18[0x1];channels[_0x4a0d66[_0x739b('0x7')]][_0x471124]=_0x1139d4;}if(!_[_0x739b('0x67')]([_0x739b('0x68'),_0x739b('0x69'),_0x739b('0x6a'),_0x739b('0x6b'),_0x739b('0x6c')],_0x4a0d66[_0x739b('0x60')][_0x739b('0x62')]())){channels[_0x4a0d66[_0x739b('0x7')]][_0x739b('0x6d')]=_0x4a0d66[_0x739b('0x60')];channels[_0x4a0d66[_0x739b('0x7')]][_0x739b('0x53')]=_0x4a0d66[_0x739b('0x61')];}}}catch(_0x3e85ad){utils[_0x739b('0x2b')](util['format']('[%s][calls][newexten]',_0x4a0d66[_0x739b('0x7')]),_0x3e85ad);}}; \ No newline at end of file +var _0xec0c=['attendedtransfer','localtwolinkedid','[%s][calls][attendedtransfer]','transfereechannel','[%s][calls][attendedtransfer]\x20localtwolinkedid:%s\x20destinationchannel:%s','origtransfereruniqueid','secondtransfererchannel','userfield','_attended','transfertargetchannel','origtransfererchannel','musiconholdstart','[%s][calls][musiconholdstart]','musiconholdstartAt','musiconholdstop','[%s][calls][musiconholdstop]','mohtime','[%s][calls][musiconholdstop]\x20mohtime:%s','varset','[%s][calls][varset]','variable','xmd-originatecalleridnum','[%s][calls][varset]\x20variable:xmd-originatecalleridnum\x20value:%s','value','source','[%s][calls][varset]\x20variable:xmd-phone\x20value:%s','destination','xmd-callerid-preview','[%s][calls][varset]\x20variable:%s\x20value:%s','xmd-queue','xmcs-queue','Queue','queue','xmd-contactid','ContactId','xmd-cdrtype','[%s][calls][varset]\x20variable:xmd-cdrtype\x20value:%s','type','outboundrouteid','[%s][calls][varset]\x20variable:outboundrouteid\x20value:%s','routeid','sipcallid','newexten','[%s][calls][newexten]','[%s][calls][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','startsWith','cdr','split','substring','lastIndexOf','includes','hangup','noop','gotoif','lastapplication','lastdata','lodash','./utils','NO\x20ANSWER','ANSWERED','BUSY','FAILED','uniqueid','blinds','transfereeuniqueid','info','format','[%s][calls][writeDB]\x20channel:%s\x20queue:%s\x20agent:%s\x20interface:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20lastevent:%s','channel','membername','interface','calleridnum','connectedlinenum','accountcode','getUserByInternal','then','UserId','request','CreateVoiceCallReport','newchannel','debug','[%s][calls][newchannel]','linkedid','OutgoingSpoolFailed','[%s][calls][newchannel]\x20context:%s\x20exten:%s','context','exten','now','DOCUMENTATION','[%s][calls][newstate]','isNil','[%s][calls][newstate]\x20context:%s\x20channel:%s','systemanswertime','channelstate','transfer','destinationchannel','answertime','disposition','toNumber','error','[%s][calls][hangup]','callerid','calleridname','[%s][calls][hangup]\x20callerid:%s\x20reason:%s','endtime','duration','diffTime','starttime','billableseconds'];(function(_0x51525e,_0x3b39f4){var _0x5c122b=function(_0x5adaa9){while(--_0x5adaa9){_0x51525e['push'](_0x51525e['shift']());}};_0x5c122b(++_0x3b39f4);}(_0xec0c,0x18b));var _0xcec0=function(_0x4b40c7,_0x5832ae){_0x4b40c7=_0x4b40c7-0x0;var _0x4c0922=_0xec0c[_0x4b40c7];return _0x4c0922;};'use strict';var _=require(_0xcec0('0x0'));var util=require('util');var utils=require(_0xcec0('0x1'));var transfers=require('./transfers.controller');var dispositions=[_0xcec0('0x2'),'FAILED','FAILED','NO\x20ANSWER',_0xcec0('0x2'),_0xcec0('0x2'),_0xcec0('0x3'),_0xcec0('0x4'),_0xcec0('0x5'),'FAILED','FAILED'];var channels={};function writeDB(_0xbfa74a){var _0x5691df;if(transfers['blinds'][_0xbfa74a[_0xcec0('0x6')]]){_0x5691df=_0xbfa74a[_0xcec0('0x6')];_0xbfa74a['uniqueid']=transfers[_0xcec0('0x7')][_0xbfa74a[_0xcec0('0x6')]][_0xcec0('0x8')];}utils[_0xcec0('0x9')](util[_0xcec0('0xa')](_0xcec0('0xb'),_0xbfa74a[_0xcec0('0x6')],_0xbfa74a[_0xcec0('0xc')],_0xbfa74a['queue'],_0xbfa74a[_0xcec0('0xd')],_0xbfa74a[_0xcec0('0xe')],_0xbfa74a[_0xcec0('0xf')],_0xbfa74a[_0xcec0('0x10')],_0xbfa74a['lastevent']));if(_0xbfa74a[_0xcec0('0x11')]){utils[_0xcec0('0x12')](_0xbfa74a[_0xcec0('0x11')])[_0xcec0('0x13')](function(_0x272b53){if(_0x272b53){_0xbfa74a[_0xcec0('0x14')]=_0x272b53['id'];}utils[_0xcec0('0x15')](_0xcec0('0x16'),_0xbfa74a);});}else{utils[_0xcec0('0x15')]('CreateVoiceCallReport',_0xbfa74a);}if(channels[_0xbfa74a[_0xcec0('0x6')]]){delete channels[_0xbfa74a['uniqueid']];}else if(_0x5691df&&channels[_0x5691df]){delete transfers[_0xcec0('0x7')][_0x5691df];delete channels[_0x5691df];}}exports[_0xcec0('0x17')]=function(_0x347c47){try{utils[_0xcec0('0x18')](util['format'](_0xcec0('0x19'),_0x347c47[_0xcec0('0x6')]),_0x347c47);if(_0x347c47[_0xcec0('0x6')]==_0x347c47[_0xcec0('0x1a')]&&_0x347c47[_0xcec0('0xc')]!=_0xcec0('0x1b')){utils['info'](util[_0xcec0('0xa')](_0xcec0('0x1c'),_0x347c47[_0xcec0('0x6')],_0x347c47[_0xcec0('0x1d')],_0x347c47[_0xcec0('0x1e')]));channels[_0x347c47['uniqueid']]={'uniqueid':_0x347c47[_0xcec0('0x6')],'accountcode':_0x347c47['accountcode'],'source':_0x347c47[_0xcec0('0xf')],'destination':_0x347c47[_0xcec0('0x1e')],'destinationcontext':_0x347c47[_0xcec0('0x1d')],'channel':_0x347c47[_0xcec0('0xc')],'starttime':utils[_0xcec0('0x1f')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0xcec0('0x2'),'amaflags':_0xcec0('0x20')};}}catch(_0x4958f7){utils['error'](util[_0xcec0('0xa')](_0xcec0('0x19'),_0x347c47[_0xcec0('0x6')]),_0x4958f7);}};exports['newstate']=function(_0x2ffa4b){try{utils[_0xcec0('0x18')](util[_0xcec0('0xa')](_0xcec0('0x21'),_0x2ffa4b['uniqueid']),_0x2ffa4b);if(!_[_0xcec0('0x22')](channels[_0x2ffa4b['uniqueid']])&&_0x2ffa4b['channelstate']==0x6){utils['info'](util[_0xcec0('0xa')](_0xcec0('0x23'),_0x2ffa4b[_0xcec0('0x6')],_0x2ffa4b[_0xcec0('0x1d')],_0x2ffa4b[_0xcec0('0xc')]));if(_['isNil'](channels[_0x2ffa4b[_0xcec0('0x6')]]['systemanswertime'])){channels[_0x2ffa4b['uniqueid']][_0xcec0('0x24')]=utils['now']();}}else if(!_['isNil'](channels[_0x2ffa4b[_0xcec0('0x1a')]])&&_0x2ffa4b[_0xcec0('0x25')]==0x6&&_0x2ffa4b['context']!=_0xcec0('0x26')){utils[_0xcec0('0x9')](util[_0xcec0('0xa')]('[%s][calls][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x2ffa4b['uniqueid'],_0x2ffa4b[_0xcec0('0x1a')],_0x2ffa4b[_0xcec0('0x1d')],_0x2ffa4b[_0xcec0('0xc')]));channels[_0x2ffa4b[_0xcec0('0x1a')]][_0xcec0('0x11')]=_0x2ffa4b[_0xcec0('0x11')];channels[_0x2ffa4b[_0xcec0('0x1a')]][_0xcec0('0x27')]=_0x2ffa4b['channel'];if(_['isNil'](channels[_0x2ffa4b[_0xcec0('0x1a')]][_0xcec0('0x28')])){channels[_0x2ffa4b[_0xcec0('0x1a')]][_0xcec0('0x28')]=utils['now']();}channels[_0x2ffa4b[_0xcec0('0x1a')]][_0xcec0('0x29')]=dispositions[_[_0xcec0('0x2a')](_0x2ffa4b[_0xcec0('0x25')])]||_0xcec0('0x3');}}catch(_0x59fa7d){utils[_0xcec0('0x2b')](util[_0xcec0('0xa')](_0xcec0('0x21'),_0x2ffa4b['uniqueid']),_0x59fa7d);}};exports['hangup']=function(_0x21c389){try{if(!_[_0xcec0('0x22')](channels[_0x21c389['uniqueid']])){utils['debug'](util['format'](_0xcec0('0x2c'),_0x21c389[_0xcec0('0x6')]),_0x21c389);if(_[_0xcec0('0x22')](channels[_0x21c389[_0xcec0('0x6')]][_0xcec0('0x2d')])){channels[_0x21c389['uniqueid']]['callerid']=_0x21c389[_0xcec0('0x2e')]+'\x20<'+_0x21c389[_0xcec0('0xf')]+'>';}utils[_0xcec0('0x9')](util[_0xcec0('0xa')](_0xcec0('0x2f'),_0x21c389['uniqueid'],channels[_0x21c389[_0xcec0('0x6')]][_0xcec0('0x2d')],_0x21c389['cause-txt']));channels[_0x21c389[_0xcec0('0x6')]][_0xcec0('0x30')]=utils[_0xcec0('0x1f')]();channels[_0x21c389[_0xcec0('0x6')]][_0xcec0('0x31')]=utils[_0xcec0('0x32')](channels[_0x21c389[_0xcec0('0x6')]][_0xcec0('0x30')],channels[_0x21c389[_0xcec0('0x6')]][_0xcec0('0x33')]);channels[_0x21c389[_0xcec0('0x6')]][_0xcec0('0x34')]=channels[_0x21c389[_0xcec0('0x6')]][_0xcec0('0x28')]?utils['diffTime'](channels[_0x21c389[_0xcec0('0x6')]][_0xcec0('0x30')],channels[_0x21c389['uniqueid']][_0xcec0('0x28')]):0x0;writeDB(channels[_0x21c389[_0xcec0('0x6')]]);}}catch(_0x1a8962){utils[_0xcec0('0x2b')](util['format'](_0xcec0('0x2c'),_0x21c389['uniqueid']),_0x1a8962);}};exports[_0xcec0('0x35')]=function(_0x195d06){try{if(!_[_0xcec0('0x22')](channels[_0x195d06[_0xcec0('0x36')]])){utils['debug'](util[_0xcec0('0xa')](_0xcec0('0x37'),_0x195d06['origtransfereruniqueid']),_0x195d06);if(channels[_0x195d06['localtwolinkedid']]['channel']==_0x195d06[_0xcec0('0x38')]){utils[_0xcec0('0x9')](util[_0xcec0('0xa')](_0xcec0('0x39'),_0x195d06[_0xcec0('0x3a')],_0x195d06['localtwolinkedid'],_0x195d06[_0xcec0('0x3b')]));channels[_0x195d06[_0xcec0('0x36')]][_0xcec0('0x27')]=_0x195d06[_0xcec0('0x3b')];channels[_0x195d06[_0xcec0('0x36')]][_0xcec0('0x3c')]=_0xcec0('0x3d');}else if(channels[_0x195d06[_0xcec0('0x36')]][_0xcec0('0xc')]=_0x195d06[_0xcec0('0x3e')]){utils[_0xcec0('0x9')](util[_0xcec0('0xa')](_0xcec0('0x39'),_0x195d06[_0xcec0('0x3a')],_0x195d06[_0xcec0('0x36')],_0x195d06['origtransfererchannel']));channels[_0x195d06[_0xcec0('0x36')]][_0xcec0('0x27')]=_0x195d06[_0xcec0('0x3f')];channels[_0x195d06[_0xcec0('0x36')]][_0xcec0('0x3c')]='_attended';}}}catch(_0x5670db){utils[_0xcec0('0x2b')](util[_0xcec0('0xa')](_0xcec0('0x37'),_0x195d06[_0xcec0('0x3a')]),_0x5670db);}};exports[_0xcec0('0x40')]=function(_0x58800b){try{if(!_[_0xcec0('0x22')](channels[_0x58800b[_0xcec0('0x6')]])){utils['debug'](util['format'](_0xcec0('0x41'),_0x58800b[_0xcec0('0x6')]),_0x58800b);channels[_0x58800b[_0xcec0('0x6')]][_0xcec0('0x42')]=utils[_0xcec0('0x1f')]();utils[_0xcec0('0x9')](util[_0xcec0('0xa')]('[%s][calls][musiconholdstart]\x20musiconholdstartAt:%s',_0x58800b[_0xcec0('0x6')],channels[_0x58800b[_0xcec0('0x6')]][_0xcec0('0x42')]));}}catch(_0x4400a3){utils[_0xcec0('0x2b')](util[_0xcec0('0xa')]('[%s][calls][musiconholdstart]',_0x58800b['uniqueid']),_0x4400a3);}};exports[_0xcec0('0x43')]=function(_0x2a83a7){try{if(!_[_0xcec0('0x22')](channels[_0x2a83a7[_0xcec0('0x6')]])){utils[_0xcec0('0x18')](util[_0xcec0('0xa')](_0xcec0('0x44'),_0x2a83a7['uniqueid']),_0x2a83a7);if(!_[_0xcec0('0x22')](channels[_0x2a83a7['uniqueid']][_0xcec0('0x42')])){channels[_0x2a83a7[_0xcec0('0x6')]][_0xcec0('0x45')]+=utils['diffTime'](utils[_0xcec0('0x1f')](),channels[_0x2a83a7[_0xcec0('0x6')]][_0xcec0('0x42')]);utils[_0xcec0('0x9')](util[_0xcec0('0xa')](_0xcec0('0x46'),_0x2a83a7[_0xcec0('0x6')],channels[_0x2a83a7[_0xcec0('0x6')]][_0xcec0('0x45')]));delete channels[_0x2a83a7['uniqueid']][_0xcec0('0x42')];}}}catch(_0x4d7075){utils[_0xcec0('0x2b')](util['format'](_0xcec0('0x44'),_0x2a83a7[_0xcec0('0x6')]),_0x4d7075);}};exports[_0xcec0('0x47')]=function(_0x4374fc){try{if(!_['isNil'](channels[_0x4374fc[_0xcec0('0x6')]])){utils['debug'](util[_0xcec0('0xa')](_0xcec0('0x48'),_0x4374fc[_0xcec0('0x6')]),_0x4374fc);if(!_['isNil'](_0x4374fc[_0xcec0('0x49')][_0xcec0('0x4a')])){utils[_0xcec0('0x9')](util[_0xcec0('0xa')](_0xcec0('0x4b'),_0x4374fc['uniqueid'],_0x4374fc[_0xcec0('0x4c')]));channels[_0x4374fc[_0xcec0('0x6')]][_0xcec0('0x4d')]=_0x4374fc[_0xcec0('0x4c')];}if(!_[_0xcec0('0x22')](_0x4374fc[_0xcec0('0x49')]['xmd-phone'])){utils['info'](util['format'](_0xcec0('0x4e'),_0x4374fc[_0xcec0('0x6')],_0x4374fc[_0xcec0('0x4c')]));channels[_0x4374fc[_0xcec0('0x6')]][_0xcec0('0x4f')]=_0x4374fc[_0xcec0('0x4c')];channels[_0x4374fc['uniqueid']][_0xcec0('0x2d')]='\x22'+_0x4374fc['value']+'\x22\x20<'+_0x4374fc[_0xcec0('0x4c')]+'>';}if(!_[_0xcec0('0x22')](_0x4374fc[_0xcec0('0x49')][_0xcec0('0x50')])||!_['isNil'](_0x4374fc[_0xcec0('0x49')]['xmd-callerid'])){utils[_0xcec0('0x9')](util[_0xcec0('0xa')](_0xcec0('0x51'),_0x4374fc[_0xcec0('0x6')],!_[_0xcec0('0x22')](_0x4374fc[_0xcec0('0x49')][_0xcec0('0x50')])?_0xcec0('0x50'):'xmd-callerid',_0x4374fc['value']));channels[_0x4374fc[_0xcec0('0x6')]][_0xcec0('0x2d')]=_0x4374fc['value'];}if(!_['isNil'](_0x4374fc[_0xcec0('0x49')][_0xcec0('0x52')])||!_[_0xcec0('0x22')](_0x4374fc['variable'][_0xcec0('0x53')])){utils[_0xcec0('0x9')](util[_0xcec0('0xa')](_0xcec0('0x51'),_0x4374fc[_0xcec0('0x6')],!_['isNil'](_0x4374fc['variable'][_0xcec0('0x52')])?_0xcec0('0x52'):_0xcec0('0x53'),_0x4374fc[_0xcec0('0x4c')]));channels[_0x4374fc[_0xcec0('0x6')]]['lastapplication']=_0xcec0('0x54');channels[_0x4374fc[_0xcec0('0x6')]]['lastdata']=_0x4374fc['value'];channels[_0x4374fc[_0xcec0('0x6')]][_0xcec0('0x55')]=!![];}if(!_[_0xcec0('0x22')](_0x4374fc[_0xcec0('0x49')][_0xcec0('0x56')])){utils[_0xcec0('0x9')](util['format']('[%s][calls][varset]\x20variable:xmd-contactid\x20value:%s',_0x4374fc['uniqueid'],_0x4374fc[_0xcec0('0x4c')]));channels[_0x4374fc[_0xcec0('0x6')]][_0xcec0('0x57')]=_0x4374fc[_0xcec0('0x4c')];}if(!_[_0xcec0('0x22')](_0x4374fc[_0xcec0('0x49')][_0xcec0('0x58')])){utils['info'](util['format'](_0xcec0('0x59'),_0x4374fc[_0xcec0('0x6')],_0x4374fc[_0xcec0('0x4c')]));channels[_0x4374fc[_0xcec0('0x6')]][_0xcec0('0x5a')]=_0x4374fc['value'];}if(!_[_0xcec0('0x22')](_0x4374fc['variable'][_0xcec0('0x5b')])){utils[_0xcec0('0x9')](util[_0xcec0('0xa')](_0xcec0('0x5c'),_0x4374fc[_0xcec0('0x6')],_0x4374fc[_0xcec0('0x4c')]));channels[_0x4374fc[_0xcec0('0x6')]][_0xcec0('0x5d')]=_0x4374fc[_0xcec0('0x4c')];}if(!_[_0xcec0('0x22')](_0x4374fc['variable'][_0xcec0('0x5e')])){utils['info'](util[_0xcec0('0xa')]('[%s][calls][varset]\x20variable:sipcallid\x20value:%s',_0x4374fc['uniqueid'],_0x4374fc[_0xcec0('0x4c')]));channels[_0x4374fc[_0xcec0('0x6')]][_0xcec0('0x5e')]=_0x4374fc['value'];}}}catch(_0x1afe98){utils[_0xcec0('0x2b')](util[_0xcec0('0xa')]('[%s][calls][varset]',_0x4374fc[_0xcec0('0x6')]),_0x1afe98);}};exports[_0xcec0('0x5f')]=function(_0x5e2f9a){try{if(!_[_0xcec0('0x22')](channels[_0x5e2f9a[_0xcec0('0x6')]])){utils[_0xcec0('0x18')](util[_0xcec0('0xa')](_0xcec0('0x60'),_0x5e2f9a[_0xcec0('0x6')]),_0x5e2f9a);utils[_0xcec0('0x9')](util[_0xcec0('0xa')](_0xcec0('0x61'),_0x5e2f9a[_0xcec0('0x6')],_0x5e2f9a[_0xcec0('0x62')],_0x5e2f9a[_0xcec0('0x63')]));if(_0x5e2f9a[_0xcec0('0x62')][_0xcec0('0x64')]()=='set'&&_[_0xcec0('0x65')](_0x5e2f9a['appdata'][_0xcec0('0x64')](),_0xcec0('0x66'))){var _0x4428cf=_0x5e2f9a[_0xcec0('0x63')][_0xcec0('0x67')]('=');var _0x55f756=_0x4428cf[0x0][_0xcec0('0x68')](_0x4428cf[0x0]['lastIndexOf']('(')+0x1,_0x4428cf[0x0][_0xcec0('0x69')](')'));var _0xf216e=_0x4428cf[0x1];channels[_0x5e2f9a[_0xcec0('0x6')]][_0x55f756]=_0xf216e;}if(!_[_0xcec0('0x6a')]([_0xcec0('0x6b'),_0xcec0('0x6c'),'execif','set',_0xcec0('0x6d')],_0x5e2f9a[_0xcec0('0x62')][_0xcec0('0x64')]())){channels[_0x5e2f9a['uniqueid']][_0xcec0('0x6e')]=_0x5e2f9a[_0xcec0('0x62')];channels[_0x5e2f9a['uniqueid']][_0xcec0('0x6f')]=_0x5e2f9a[_0xcec0('0x63')];}}}catch(_0x3b6a26){utils[_0xcec0('0x2b')](util[_0xcec0('0xa')](_0xcec0('0x60'),_0x5e2f9a[_0xcec0('0x6')]),_0x3b6a26);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index 756a770..7d9dd7d 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 _0xcf7b=['[core]\x20connected','shutdown','[core]\x20shutdown','[core]\x20fullybooted','error','[core]\x20close','./utils','connect','info'];(function(_0xc4980e,_0x14d513){var _0x44b5e7=function(_0x1ab712){while(--_0x1ab712){_0xc4980e['push'](_0xc4980e['shift']());}};_0x44b5e7(++_0x14d513);}(_0xcf7b,0x14a));var _0xbcf7=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0xcf7b[_0x1d1779];return _0x2377e9;};'use strict';var utils=require(_0xbcf7('0x0'));exports[_0xbcf7('0x1')]=function(){utils[_0xbcf7('0x2')](_0xbcf7('0x3'));};exports[_0xbcf7('0x4')]=function(){utils[_0xbcf7('0x2')](_0xbcf7('0x5'));};exports['fullybooted']=function(){utils[_0xbcf7('0x2')](_0xbcf7('0x6'));};exports[_0xbcf7('0x7')]=function(_0xb69aff){utils[_0xbcf7('0x7')]('[core]\x20error',_0xb69aff);};exports['close']=function(){utils[_0xbcf7('0x2')](_0xbcf7('0x8'));};exports['managerevent']=function(_0x1bfa41){}; \ No newline at end of file +var _0x7c35=['[core]\x20connected','shutdown','info','error','[core]\x20error','close','[core]\x20close','managerevent','connect'];(function(_0x4dc1e4,_0x5a7946){var _0x513ee3=function(_0x1df515){while(--_0x1df515){_0x4dc1e4['push'](_0x4dc1e4['shift']());}};_0x513ee3(++_0x5a7946);}(_0x7c35,0x128));var _0x57c3=function(_0x3ec385,_0x26c54b){_0x3ec385=_0x3ec385-0x0;var _0x5583e7=_0x7c35[_0x3ec385];return _0x5583e7;};'use strict';var utils=require('./utils');exports[_0x57c3('0x0')]=function(){utils['info'](_0x57c3('0x1'));};exports[_0x57c3('0x2')]=function(){utils[_0x57c3('0x3')]('[core]\x20shutdown');};exports['fullybooted']=function(){utils[_0x57c3('0x3')]('[core]\x20fullybooted');};exports[_0x57c3('0x4')]=function(_0x52f7c5){utils[_0x57c3('0x4')](_0x57c3('0x5'),_0x52f7c5);};exports[_0x57c3('0x6')]=function(){utils[_0x57c3('0x3')](_0x57c3('0x7'));};exports[_0x57c3('0x8')]=function(_0x194b80){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index 0ba99de..71095ba 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 _0x384c=['value','dialbegin','[%s][dials][dialbegin]','assign','starttime','now','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','error','dialend','dialstatus','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','holdtime','[%s][dials][hangup]','lodash','util','./utils','info','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','dialstring','connectedlinenum','CreateVoiceDialReport','newexten','[%s][dials][newexten]','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata','startsWith','toLowerCase','split','varset','debug','[%s][dials][varset]','isNil','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s'];(function(_0xaf4af7,_0x6a8b6f){var _0x596009=function(_0x563e6f){while(--_0x563e6f){_0xaf4af7['push'](_0xaf4af7['shift']());}};_0x596009(++_0x6a8b6f);}(_0x384c,0xb8));var _0xc384=function(_0x2e3206,_0x31b698){_0x2e3206=_0x2e3206-0x0;var _0x283560=_0x384c[_0x2e3206];return _0x283560;};'use strict';var _=require(_0xc384('0x0'));var util=require(_0xc384('0x1'));var utils=require(_0xc384('0x2'));var dials={};function writeDB(_0xb85d72){utils[_0xc384('0x3')](util[_0xc384('0x4')](_0xc384('0x5'),_0xb85d72[_0xc384('0x6')],_0xb85d72['channel'],_0xb85d72[_0xc384('0x7')],_0xb85d72['calleridnum'],_0xb85d72[_0xc384('0x8')],_0xb85d72['dialstatus']));utils['request'](_0xc384('0x9'),_0xb85d72);delete dials[_0xb85d72[_0xc384('0x6')]];}exports[_0xc384('0xa')]=function(_0x1c0ffd){try{utils['debug'](util[_0xc384('0x4')](_0xc384('0xb'),_0x1c0ffd['uniqueid']),_0x1c0ffd);utils[_0xc384('0x3')](util[_0xc384('0x4')](_0xc384('0xc'),_0x1c0ffd[_0xc384('0x6')],_0x1c0ffd[_0xc384('0xd')],_0x1c0ffd[_0xc384('0xe')]));if(_0x1c0ffd['application']['toLowerCase']()=='set'&&_[_0xc384('0xf')](_0x1c0ffd[_0xc384('0xe')][_0xc384('0x10')](),'cdr(routeid)')){var _0x144621=_0x1c0ffd['appdata'][_0xc384('0x11')]('=');dials[_0x1c0ffd[_0xc384('0x6')]]={'routeId':_0x144621[0x1]};}}catch(_0x261091){utils['error'](util[_0xc384('0x4')](_0xc384('0xb'),_0x1c0ffd[_0xc384('0x6')]),_0x261091);}};exports[_0xc384('0x12')]=function(_0x3a7e4e){try{utils[_0xc384('0x13')](util[_0xc384('0x4')](_0xc384('0x14'),_0x3a7e4e['uniqueid']),_0x3a7e4e);if(!_[_0xc384('0x15')](_0x3a7e4e['variable'][_0xc384('0x16')])){utils[_0xc384('0x3')](util[_0xc384('0x4')](_0xc384('0x17'),_0x3a7e4e[_0xc384('0x6')],_0x3a7e4e[_0xc384('0x18')]));dials[_0x3a7e4e[_0xc384('0x6')]]={'routeId':_0x3a7e4e[_0xc384('0x18')]};}}catch(_0x1d479c){utils['error'](util['format'](_0xc384('0x14'),_0x3a7e4e[_0xc384('0x6')]),_0x1d479c);}};exports[_0xc384('0x19')]=function(_0x101e95){try{if(!_[_0xc384('0x15')](dials[_0x101e95[_0xc384('0x6')]])){utils[_0xc384('0x13')](util[_0xc384('0x4')](_0xc384('0x1a'),_0x101e95[_0xc384('0x6')]),_0x101e95);dials[_0x101e95[_0xc384('0x6')]]=_[_0xc384('0x1b')](dials[_0x101e95[_0xc384('0x6')]],_0x101e95);dials[_0x101e95['uniqueid']][_0xc384('0x1c')]=utils[_0xc384('0x1d')]();dials[_0x101e95[_0xc384('0x6')]][_0xc384('0x1e')]=_0xc384('0x1f');utils[_0xc384('0x3')](util[_0xc384('0x4')](_0xc384('0x20'),_0x101e95[_0xc384('0x6')],dials[_0x101e95[_0xc384('0x6')]][_0xc384('0x1c')]));}}catch(_0x575158){utils[_0xc384('0x21')](util[_0xc384('0x4')](_0xc384('0x1a'),_0x101e95[_0xc384('0x6')]),_0x575158);}};exports[_0xc384('0x22')]=function(_0x139f7c){try{if(!_[_0xc384('0x15')](dials[_0x139f7c[_0xc384('0x6')]])){utils[_0xc384('0x13')](util[_0xc384('0x4')]('[%s][dials][dialend]',_0x139f7c[_0xc384('0x6')]),_0x139f7c);dials[_0x139f7c['uniqueid']][_0xc384('0x23')]=_0x139f7c[_0xc384('0x23')];if(_0x139f7c['dialstatus']==_0xc384('0x24')){dials[_0x139f7c[_0xc384('0x6')]]=_['assign'](dials[_0x139f7c[_0xc384('0x6')]],_0x139f7c);dials[_0x139f7c[_0xc384('0x6')]][_0xc384('0x25')]=utils['now']();dials[_0x139f7c['uniqueid']][_0xc384('0x1e')]=_0xc384('0x26');utils[_0xc384('0x3')](util[_0xc384('0x4')](_0xc384('0x27'),_0x139f7c['uniqueid'],_0x139f7c[_0xc384('0x23')],dials[_0x139f7c[_0xc384('0x6')]]['answertime']));}else{utils[_0xc384('0x3')](util['format'](_0xc384('0x28'),_0x139f7c['uniqueid'],_0x139f7c[_0xc384('0x23')]));}}}catch(_0x56ef96){utils[_0xc384('0x21')](util[_0xc384('0x4')]('[%s][dials][dialend]',_0x139f7c[_0xc384('0x6')]),_0x56ef96);}};exports[_0xc384('0x29')]=function(_0x146239){try{if(!_[_0xc384('0x15')](dials[_0x146239[_0xc384('0x6')]])){utils[_0xc384('0x13')](util[_0xc384('0x4')]('[%s][dials][hangup]',_0x146239[_0xc384('0x6')]),_0x146239);utils['info'](util[_0xc384('0x4')](_0xc384('0x2a'),_0x146239[_0xc384('0x6')],_0x146239[_0xc384('0x2b')],_0x146239[_0xc384('0x2c')],_0x146239[_0xc384('0x2d')]));dials[_0x146239[_0xc384('0x6')]]=_[_0xc384('0x1b')](dials[_0x146239[_0xc384('0x6')]],{'endtime':utils[_0xc384('0x1d')](),'lastevent':_0xc384('0x2e')});dials[_0x146239['uniqueid']][_0xc384('0x2f')]=utils[_0xc384('0x30')](dials[_0x146239['uniqueid']][_0xc384('0x31')],dials[_0x146239[_0xc384('0x6')]][_0xc384('0x1c')]);dials[_0x146239['uniqueid']][_0xc384('0x32')]=utils[_0xc384('0x30')](dials[_0x146239['uniqueid']][_0xc384('0x25')]||dials[_0x146239['uniqueid']][_0xc384('0x31')],dials[_0x146239['uniqueid']][_0xc384('0x1c')]);dials[_0x146239[_0xc384('0x6')]]['billableseconds']=dials[_0x146239['uniqueid']][_0xc384('0x25')]?utils['diffTime'](dials[_0x146239[_0xc384('0x6')]][_0xc384('0x31')],dials[_0x146239['uniqueid']][_0xc384('0x25')]):0x0;writeDB(dials[_0x146239[_0xc384('0x6')]]);}}catch(_0x48f95a){utils[_0xc384('0x21')](util[_0xc384('0x4')](_0xc384('0x33'),_0x146239[_0xc384('0x6')]),_0x48f95a);}}; \ No newline at end of file +var _0x4041=['split','error','varset','[%s][dials][varset]','variable','outboundrouteid','[%s][dials][varset]\x20variable:outboundrouteid\x20value:%s','dialbegin','isNil','[%s][dials][dialbegin]','lastevent','called','[%s][dials][hangup]\x20starttime:%s\x20lastevent:called','starttime','dialend','[%s][dials][dialend]','assign','answertime','now','connect','[%s][dials][dialend]\x20dialstatus:%s\x20answertime:%s\x20lastevent:connect','[%s][dials][dialend]\x20dialstatus:%s','hangup','[%s][dials][hangup]','[%s][dials][hangup]\x20calleridnum:%s\x20calleridname:%s\x20lastevent:complete\x20reason:%s','calleridname','cause-txt','complete','endtime','diffTime','billableseconds','lodash','info','format','[%s][dials][writeDB]\x20channel:%s\x20dialstring:%s\x20calleridnum:%s\x20connectedlinenum:%s\x20dialstatus:%s','uniqueid','channel','dialstring','calleridnum','connectedlinenum','dialstatus','request','CreateVoiceDialReport','newexten','debug','[%s][dials][newexten]','[%s][dials][newexten]\x20application:%s\x20appdata:%s','application','appdata','toLowerCase','startsWith','cdr(routeid)'];(function(_0x5341d2,_0x2da6d6){var _0x3a4d6a=function(_0x254688){while(--_0x254688){_0x5341d2['push'](_0x5341d2['shift']());}};_0x3a4d6a(++_0x2da6d6);}(_0x4041,0xbb));var _0x1404=function(_0x3c1d17,_0x2b921f){_0x3c1d17=_0x3c1d17-0x0;var _0x3655f4=_0x4041[_0x3c1d17];return _0x3655f4;};'use strict';var _=require(_0x1404('0x0'));var util=require('util');var utils=require('./utils');var dials={};function writeDB(_0x174ec3){utils[_0x1404('0x1')](util[_0x1404('0x2')](_0x1404('0x3'),_0x174ec3[_0x1404('0x4')],_0x174ec3[_0x1404('0x5')],_0x174ec3[_0x1404('0x6')],_0x174ec3[_0x1404('0x7')],_0x174ec3[_0x1404('0x8')],_0x174ec3[_0x1404('0x9')]));utils[_0x1404('0xa')](_0x1404('0xb'),_0x174ec3);delete dials[_0x174ec3[_0x1404('0x4')]];}exports[_0x1404('0xc')]=function(_0x5d8ab8){try{utils[_0x1404('0xd')](util[_0x1404('0x2')](_0x1404('0xe'),_0x5d8ab8[_0x1404('0x4')]),_0x5d8ab8);utils[_0x1404('0x1')](util[_0x1404('0x2')](_0x1404('0xf'),_0x5d8ab8[_0x1404('0x4')],_0x5d8ab8[_0x1404('0x10')],_0x5d8ab8[_0x1404('0x11')]));if(_0x5d8ab8[_0x1404('0x10')][_0x1404('0x12')]()=='set'&&_[_0x1404('0x13')](_0x5d8ab8[_0x1404('0x11')][_0x1404('0x12')](),_0x1404('0x14'))){var _0x18667c=_0x5d8ab8[_0x1404('0x11')][_0x1404('0x15')]('=');dials[_0x5d8ab8[_0x1404('0x4')]]={'routeId':_0x18667c[0x1]};}}catch(_0xfd1358){utils[_0x1404('0x16')](util[_0x1404('0x2')](_0x1404('0xe'),_0x5d8ab8[_0x1404('0x4')]),_0xfd1358);}};exports[_0x1404('0x17')]=function(_0x212336){try{utils[_0x1404('0xd')](util[_0x1404('0x2')](_0x1404('0x18'),_0x212336['uniqueid']),_0x212336);if(!_['isNil'](_0x212336[_0x1404('0x19')][_0x1404('0x1a')])){utils[_0x1404('0x1')](util[_0x1404('0x2')](_0x1404('0x1b'),_0x212336[_0x1404('0x4')],_0x212336['value']));dials[_0x212336[_0x1404('0x4')]]={'routeId':_0x212336['value']};}}catch(_0x4f4068){utils[_0x1404('0x16')](util['format'](_0x1404('0x18'),_0x212336['uniqueid']),_0x4f4068);}};exports[_0x1404('0x1c')]=function(_0xf64ec1){try{if(!_[_0x1404('0x1d')](dials[_0xf64ec1[_0x1404('0x4')]])){utils[_0x1404('0xd')](util[_0x1404('0x2')](_0x1404('0x1e'),_0xf64ec1[_0x1404('0x4')]),_0xf64ec1);dials[_0xf64ec1[_0x1404('0x4')]]=_['assign'](dials[_0xf64ec1[_0x1404('0x4')]],_0xf64ec1);dials[_0xf64ec1[_0x1404('0x4')]]['starttime']=utils['now']();dials[_0xf64ec1[_0x1404('0x4')]][_0x1404('0x1f')]=_0x1404('0x20');utils[_0x1404('0x1')](util[_0x1404('0x2')](_0x1404('0x21'),_0xf64ec1['uniqueid'],dials[_0xf64ec1[_0x1404('0x4')]][_0x1404('0x22')]));}}catch(_0x5a8f44){utils[_0x1404('0x16')](util[_0x1404('0x2')](_0x1404('0x1e'),_0xf64ec1[_0x1404('0x4')]),_0x5a8f44);}};exports[_0x1404('0x23')]=function(_0xc30df){try{if(!_[_0x1404('0x1d')](dials[_0xc30df[_0x1404('0x4')]])){utils['debug'](util['format'](_0x1404('0x24'),_0xc30df[_0x1404('0x4')]),_0xc30df);dials[_0xc30df[_0x1404('0x4')]]['dialstatus']=_0xc30df['dialstatus'];if(_0xc30df[_0x1404('0x9')]=='ANSWER'){dials[_0xc30df[_0x1404('0x4')]]=_[_0x1404('0x25')](dials[_0xc30df['uniqueid']],_0xc30df);dials[_0xc30df[_0x1404('0x4')]][_0x1404('0x26')]=utils[_0x1404('0x27')]();dials[_0xc30df[_0x1404('0x4')]][_0x1404('0x1f')]=_0x1404('0x28');utils[_0x1404('0x1')](util[_0x1404('0x2')](_0x1404('0x29'),_0xc30df['uniqueid'],_0xc30df[_0x1404('0x9')],dials[_0xc30df[_0x1404('0x4')]][_0x1404('0x26')]));}else{utils[_0x1404('0x1')](util[_0x1404('0x2')](_0x1404('0x2a'),_0xc30df[_0x1404('0x4')],_0xc30df['dialstatus']));}}}catch(_0x47a2f3){utils[_0x1404('0x16')](util['format'](_0x1404('0x24'),_0xc30df['uniqueid']),_0x47a2f3);}};exports[_0x1404('0x2b')]=function(_0x45b515){try{if(!_['isNil'](dials[_0x45b515[_0x1404('0x4')]])){utils[_0x1404('0xd')](util[_0x1404('0x2')](_0x1404('0x2c'),_0x45b515['uniqueid']),_0x45b515);utils[_0x1404('0x1')](util[_0x1404('0x2')](_0x1404('0x2d'),_0x45b515[_0x1404('0x4')],_0x45b515[_0x1404('0x7')],_0x45b515[_0x1404('0x2e')],_0x45b515[_0x1404('0x2f')]));dials[_0x45b515[_0x1404('0x4')]]=_[_0x1404('0x25')](dials[_0x45b515[_0x1404('0x4')]],{'endtime':utils[_0x1404('0x27')](),'lastevent':_0x1404('0x30')});dials[_0x45b515[_0x1404('0x4')]]['duration']=utils['diffTime'](dials[_0x45b515[_0x1404('0x4')]][_0x1404('0x31')],dials[_0x45b515[_0x1404('0x4')]][_0x1404('0x22')]);dials[_0x45b515[_0x1404('0x4')]]['holdtime']=utils[_0x1404('0x32')](dials[_0x45b515[_0x1404('0x4')]][_0x1404('0x26')]||dials[_0x45b515[_0x1404('0x4')]][_0x1404('0x31')],dials[_0x45b515[_0x1404('0x4')]][_0x1404('0x22')]);dials[_0x45b515[_0x1404('0x4')]][_0x1404('0x33')]=dials[_0x45b515['uniqueid']]['answertime']?utils['diffTime'](dials[_0x45b515[_0x1404('0x4')]][_0x1404('0x31')],dials[_0x45b515[_0x1404('0x4')]][_0x1404('0x26')]):0x0;writeDB(dials[_0x45b515['uniqueid']]);}}catch(_0x2d1339){utils[_0x1404('0x16')](util[_0x1404('0x2')](_0x1404('0x2c'),_0x45b515[_0x1404('0x4')]),_0x2d1339);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index 7da2051..2a19d34 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 _0x7325=['dialend','[%s][index][dialend]','asterisk-manager','./utils','asterisk','port','username','password','keepConnected','xdr','disabled','./agents.controller','./calls.controller','./queues.controller','./recordings.controller','./dials.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','managerevent','devicestatechange','format','[%s][index][devicestatechange]','device','agentcalled','[%s][index][agentcalled]','uniqueid','[%s][index][agentringnoanswer]','agentringnoanswer','debug','agentconnect','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','musiconholdstart','[%s][index][musiconholdstart]','[%s][index][musiconholdstop]','musiconholdstop','newstate','[%s][index][newstate]','hangup','[%s][index][hangup]','cdr','[%s][index][cdr]','blindtransfer','[%s][index][blindtransfer]','attendedtransfer','[%s][index][attendedtransfer]','origtransfereruniqueid','[%s][index][varset]','varset','newexten','[%s][index][newexten]','newchannel','[%s][index][newchannel]','dialbegin','[%s]dialbegin'];(function(_0x31e3e4,_0x5c795a){var _0x4ee39e=function(_0x21ee01){while(--_0x21ee01){_0x31e3e4['push'](_0x31e3e4['shift']());}};_0x4ee39e(++_0x5c795a);}(_0x7325,0x147));var _0x5732=function(_0x453ec6,_0x2b1fb5){_0x453ec6=_0x453ec6-0x0;var _0x32418e=_0x7325[_0x453ec6];return _0x32418e;};var AsteriskManager=require(_0x5732('0x0'));var config=require('../../config/environment');var utils=require(_0x5732('0x1'));var util=require('util');var ami=new AsteriskManager(config[_0x5732('0x2')][_0x5732('0x3')],config['asterisk']['ip'],config[_0x5732('0x2')][_0x5732('0x4')],config['asterisk'][_0x5732('0x5')],!![]);ami[_0x5732('0x6')]();if(config[_0x5732('0x7')]&&config[_0x5732('0x7')][_0x5732('0x8')]){utils['info']('XDR\x20DISABLED');}else{var agents=require(_0x5732('0x9'));var calls=require(_0x5732('0xa'));var queues=require(_0x5732('0xb'));var recordings=require(_0x5732('0xc'));var members=require('./members.controller');var dials=require(_0x5732('0xd'));var transfers=require(_0x5732('0xe'));var core=require(_0x5732('0xf'));ami['on'](_0x5732('0x10'),core[_0x5732('0x10')]);ami['on'](_0x5732('0x11'),core[_0x5732('0x11')]);ami['on'](_0x5732('0x12'),core[_0x5732('0x12')]);ami['on']('error',core[_0x5732('0x13')]);ami['on']('close',core['close']);ami['on'](_0x5732('0x14'),core['managerevent']);ami['on'](_0x5732('0x15'),function(_0x518646){try{utils['debug'](util[_0x5732('0x16')](_0x5732('0x17'),_0x518646[_0x5732('0x18')]),_0x518646);members[_0x5732('0x15')](_0x518646);}catch(_0x25b42f){utils[_0x5732('0x13')](util['format'](_0x5732('0x17'),_0x518646[_0x5732('0x18')]),_0x25b42f);}});ami['on'](_0x5732('0x19'),function(_0x6fafe2){try{utils['debug'](util['format'](_0x5732('0x1a'),_0x6fafe2[_0x5732('0x1b')]),_0x6fafe2);agents[_0x5732('0x19')](_0x6fafe2);}catch(_0x4389f9){utils[_0x5732('0x13')](util[_0x5732('0x16')]('[%s][index][agentcalled]',_0x6fafe2['uniqueid']),_0x4389f9);}});ami['on']('agentringnoanswer',function(_0x31780d){try{utils['debug'](util[_0x5732('0x16')](_0x5732('0x1c'),_0x31780d['uniqueid']),_0x31780d);agents[_0x5732('0x1d')](_0x31780d);}catch(_0x93503a){utils[_0x5732('0x13')](util[_0x5732('0x16')](_0x5732('0x1c'),_0x31780d[_0x5732('0x1b')]),_0x93503a);}});ami['on']('agentconnect',function(_0x206c59){try{utils[_0x5732('0x1e')](util[_0x5732('0x16')]('[%s][index][agentconnect]',_0x206c59[_0x5732('0x1b')]),_0x206c59);agents[_0x5732('0x1f')](_0x206c59);queues['agentconnect'](_0x206c59);}catch(_0x1586db){utils[_0x5732('0x13')](util[_0x5732('0x16')]('[%s][index][agentconnect]',_0x206c59['uniqueid']),_0x1586db);}});ami['on'](_0x5732('0x20'),function(_0x402ca2){try{utils[_0x5732('0x1e')](util[_0x5732('0x16')](_0x5732('0x21'),_0x402ca2[_0x5732('0x1b')]),_0x402ca2);agents['agentcomplete'](_0x402ca2);queues[_0x5732('0x20')](_0x402ca2);members[_0x5732('0x20')](_0x402ca2);}catch(_0x5083e9){utils[_0x5732('0x13')](util[_0x5732('0x16')]('[%s][index][agentcomplete]',_0x402ca2['uniqueid']),_0x5083e9);}});ami['on'](_0x5732('0x22'),function(_0x4e702b){try{utils[_0x5732('0x1e')](util[_0x5732('0x16')](_0x5732('0x23'),_0x4e702b[_0x5732('0x1b')]),_0x4e702b);agents[_0x5732('0x22')](_0x4e702b);queues[_0x5732('0x22')](_0x4e702b);}catch(_0x1e2955){utils['error'](util[_0x5732('0x16')](_0x5732('0x23'),_0x4e702b[_0x5732('0x1b')]),_0x1e2955);}});ami['on'](_0x5732('0x24'),function(_0x221384){try{utils[_0x5732('0x1e')](util['format'](_0x5732('0x25'),_0x221384[_0x5732('0x1b')]),_0x221384);queues['queuecallerjoin'](_0x221384);recordings[_0x5732('0x24')](_0x221384);}catch(_0xa0b1c3){utils[_0x5732('0x13')](util[_0x5732('0x16')](_0x5732('0x25'),_0x221384['uniqueid']),_0xa0b1c3);}});ami['on'](_0x5732('0x26'),function(_0x2b4197){try{utils[_0x5732('0x1e')](util[_0x5732('0x16')](_0x5732('0x27'),_0x2b4197[_0x5732('0x1b')]),_0x2b4197);queues[_0x5732('0x26')](_0x2b4197);}catch(_0x42cd4c){utils['error'](util['format'](_0x5732('0x27'),_0x2b4197[_0x5732('0x1b')]),_0x42cd4c);}});ami['on'](_0x5732('0x28'),function(_0x2cc6e7){try{utils[_0x5732('0x1e')](util[_0x5732('0x16')]('[%s][index][musiconholdstart]',_0x2cc6e7['uniqueid']),_0x2cc6e7);queues[_0x5732('0x28')](_0x2cc6e7);calls['musiconholdstart'](_0x2cc6e7);}catch(_0x44a3c0){utils['error'](util[_0x5732('0x16')](_0x5732('0x29'),_0x2cc6e7[_0x5732('0x1b')]),_0x44a3c0);}});ami['on']('musiconholdstop',function(_0xa67ac5){try{utils[_0x5732('0x1e')](util[_0x5732('0x16')](_0x5732('0x2a'),_0xa67ac5['uniqueid']),_0xa67ac5);queues[_0x5732('0x2b')](_0xa67ac5);calls['musiconholdstop'](_0xa67ac5);}catch(_0x37b32d){utils[_0x5732('0x13')](util[_0x5732('0x16')]('[%s][index][musiconholdstop]',_0xa67ac5[_0x5732('0x1b')]),_0x37b32d);}});ami['on'](_0x5732('0x2c'),function(_0x1251f3){try{utils[_0x5732('0x1e')](util[_0x5732('0x16')](_0x5732('0x2d'),_0x1251f3[_0x5732('0x1b')]),_0x1251f3);calls[_0x5732('0x2c')](_0x1251f3);recordings['newstate'](_0x1251f3);}catch(_0x467d9a){utils[_0x5732('0x13')](util[_0x5732('0x16')]('[%s][index][newstate]',_0x1251f3[_0x5732('0x1b')]),_0x467d9a);}});ami['on'](_0x5732('0x2e'),function(_0x5c63df){try{utils['debug'](util['format'](_0x5732('0x2f'),_0x5c63df['uniqueid']),_0x5c63df);calls[_0x5732('0x2e')](_0x5c63df);recordings[_0x5732('0x2e')](_0x5c63df);dials[_0x5732('0x2e')](_0x5c63df);agents['hangup'](_0x5c63df);queues[_0x5732('0x2e')](_0x5c63df);}catch(_0x19efe7){utils[_0x5732('0x13')](util[_0x5732('0x16')](_0x5732('0x2f'),_0x5c63df[_0x5732('0x1b')]),_0x19efe7);}});ami['on'](_0x5732('0x30'),function(_0x52d33b){try{utils[_0x5732('0x1e')](util[_0x5732('0x16')](_0x5732('0x31'),_0x52d33b['uniqueid']),_0x52d33b);members['cdr'](_0x52d33b);}catch(_0x216c90){utils[_0x5732('0x13')](util[_0x5732('0x16')](_0x5732('0x31'),_0x52d33b['uniqueid']),_0x216c90);}});ami['on'](_0x5732('0x32'),function(_0x1e92db){try{utils[_0x5732('0x1e')](util[_0x5732('0x16')](_0x5732('0x33'),_0x1e92db[_0x5732('0x1b')]),_0x1e92db);queues[_0x5732('0x32')](_0x1e92db);agents['blindtransfer'](_0x1e92db);transfers['blindtransfer'](_0x1e92db);}catch(_0x4afb16){utils[_0x5732('0x13')](util[_0x5732('0x16')](_0x5732('0x33'),_0x1e92db['uniqueid']),_0x4afb16);}});ami['on'](_0x5732('0x34'),function(_0x46c4ff){try{utils[_0x5732('0x1e')](util['format'](_0x5732('0x35'),_0x46c4ff[_0x5732('0x36')]),_0x46c4ff);queues['attendedtransfer'](_0x46c4ff);transfers[_0x5732('0x34')](_0x46c4ff);agents[_0x5732('0x34')](_0x46c4ff);calls[_0x5732('0x34')](_0x46c4ff);}catch(_0x574cc2){utils[_0x5732('0x13')](util['format'](_0x5732('0x35'),_0x46c4ff['origtransfereruniqueid']),_0x574cc2);}});ami['on']('varset',function(_0x39044b){try{utils[_0x5732('0x1e')](util['format'](_0x5732('0x37'),_0x39044b[_0x5732('0x1b')]),_0x39044b);queues[_0x5732('0x38')](_0x39044b);recordings[_0x5732('0x38')](_0x39044b);calls[_0x5732('0x38')](_0x39044b);dials[_0x5732('0x38')](_0x39044b);}catch(_0x4101b9){utils['error'](util[_0x5732('0x16')](_0x5732('0x37'),_0x39044b[_0x5732('0x1b')]),_0x4101b9);}});ami['on'](_0x5732('0x39'),function(_0x53ab8f){try{utils[_0x5732('0x1e')](util[_0x5732('0x16')](_0x5732('0x3a'),_0x53ab8f[_0x5732('0x1b')]),_0x53ab8f);calls['newexten'](_0x53ab8f);recordings[_0x5732('0x39')](_0x53ab8f);dials[_0x5732('0x39')](_0x53ab8f);}catch(_0x12fc75){utils[_0x5732('0x13')](util[_0x5732('0x16')]('[%s][index][newexten]',_0x53ab8f[_0x5732('0x1b')]),_0x12fc75);}});ami['on'](_0x5732('0x3b'),function(_0x23fbd3){try{utils[_0x5732('0x1e')](util[_0x5732('0x16')](_0x5732('0x3c'),_0x23fbd3[_0x5732('0x1b')]),_0x23fbd3);calls['newchannel'](_0x23fbd3);recordings[_0x5732('0x3b')](_0x23fbd3);}catch(_0x3110ff){utils[_0x5732('0x13')](util[_0x5732('0x16')]('[%s][index][newchannel]',_0x23fbd3[_0x5732('0x1b')]),_0x3110ff);}});ami['on'](_0x5732('0x3d'),function(_0x273570){try{utils[_0x5732('0x1e')](util[_0x5732('0x16')]('[%s][index][dialbegin]',_0x273570[_0x5732('0x1b')]),_0x273570);dials[_0x5732('0x3d')](_0x273570);}catch(_0x401804){utils[_0x5732('0x13')](util[_0x5732('0x16')](_0x5732('0x3e'),_0x273570[_0x5732('0x1b')]),_0x401804);}});ami['on'](_0x5732('0x3f'),function(_0x25e4b5){try{utils[_0x5732('0x1e')](util['format'](_0x5732('0x40'),_0x25e4b5[_0x5732('0x1b')]),_0x25e4b5);dials[_0x5732('0x3f')](_0x25e4b5);}catch(_0x1fdbdf){utils[_0x5732('0x13')](util[_0x5732('0x16')]('[%s][index][dialend]',_0x25e4b5[_0x5732('0x1b')]),_0x1fdbdf);}});} \ No newline at end of file +var _0x9b8f=['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][dialend]','asterisk-manager','../../config/environment','./utils','util','asterisk','port','password','keepConnected','xdr','disabled','info','./agents.controller','./calls.controller','./queues.controller','./recordings.controller','./members.controller','./dials.controller','./core.controller','shutdown','fullybooted','error','close','managerevent','devicestatechange','format','device','[%s][index][devicestatechange]','agentcalled','debug','[%s][index][agentcalled]','uniqueid','agentringnoanswer','[%s][index][agentringnoanswer]','agentconnect','[%s][index][agentconnect]','agentcomplete','[%s][index][agentcomplete]','queuecallerabandon','[%s][index][queuecallerabandon]','queuecallerjoin','[%s][index][queuecallerjoin]','queuecallerleave','[%s][index][queuecallerleave]','[%s][index][musiconholdstart]','musiconholdstart','[%s][index][musiconholdstop]','musiconholdstop','newstate','[%s][index][newstate]','[%s][index][hangup]','hangup'];(function(_0x3a427a,_0x34b0c7){var _0x5b6542=function(_0x1a9a11){while(--_0x1a9a11){_0x3a427a['push'](_0x3a427a['shift']());}};_0x5b6542(++_0x34b0c7);}(_0x9b8f,0xd5));var _0xf9b8=function(_0x281784,_0x55fd96){_0x281784=_0x281784-0x0;var _0x203503=_0x9b8f[_0x281784];return _0x203503;};var AsteriskManager=require(_0xf9b8('0x0'));var config=require(_0xf9b8('0x1'));var utils=require(_0xf9b8('0x2'));var util=require(_0xf9b8('0x3'));var ami=new AsteriskManager(config[_0xf9b8('0x4')][_0xf9b8('0x5')],config['asterisk']['ip'],config['asterisk']['username'],config['asterisk'][_0xf9b8('0x6')],!![]);ami[_0xf9b8('0x7')]();if(config['xdr']&&config[_0xf9b8('0x8')][_0xf9b8('0x9')]){utils[_0xf9b8('0xa')]('XDR\x20DISABLED');}else{var agents=require(_0xf9b8('0xb'));var calls=require(_0xf9b8('0xc'));var queues=require(_0xf9b8('0xd'));var recordings=require(_0xf9b8('0xe'));var members=require(_0xf9b8('0xf'));var dials=require(_0xf9b8('0x10'));var transfers=require('./transfers.controller');var core=require(_0xf9b8('0x11'));ami['on']('connect',core['connect']);ami['on']('shutdown',core[_0xf9b8('0x12')]);ami['on'](_0xf9b8('0x13'),core[_0xf9b8('0x13')]);ami['on'](_0xf9b8('0x14'),core['error']);ami['on'](_0xf9b8('0x15'),core['close']);ami['on'](_0xf9b8('0x16'),core[_0xf9b8('0x16')]);ami['on'](_0xf9b8('0x17'),function(_0x19fb31){try{utils['debug'](util[_0xf9b8('0x18')]('[%s][index][devicestatechange]',_0x19fb31[_0xf9b8('0x19')]),_0x19fb31);members[_0xf9b8('0x17')](_0x19fb31);}catch(_0x186dd0){utils[_0xf9b8('0x14')](util[_0xf9b8('0x18')](_0xf9b8('0x1a'),_0x19fb31[_0xf9b8('0x19')]),_0x186dd0);}});ami['on'](_0xf9b8('0x1b'),function(_0x542db9){try{utils[_0xf9b8('0x1c')](util['format'](_0xf9b8('0x1d'),_0x542db9[_0xf9b8('0x1e')]),_0x542db9);agents['agentcalled'](_0x542db9);}catch(_0x53f031){utils[_0xf9b8('0x14')](util[_0xf9b8('0x18')](_0xf9b8('0x1d'),_0x542db9[_0xf9b8('0x1e')]),_0x53f031);}});ami['on'](_0xf9b8('0x1f'),function(_0x5c9dc7){try{utils[_0xf9b8('0x1c')](util['format'](_0xf9b8('0x20'),_0x5c9dc7[_0xf9b8('0x1e')]),_0x5c9dc7);agents[_0xf9b8('0x1f')](_0x5c9dc7);}catch(_0xb12207){utils['error'](util[_0xf9b8('0x18')](_0xf9b8('0x20'),_0x5c9dc7['uniqueid']),_0xb12207);}});ami['on'](_0xf9b8('0x21'),function(_0x2f7a23){try{utils[_0xf9b8('0x1c')](util[_0xf9b8('0x18')](_0xf9b8('0x22'),_0x2f7a23[_0xf9b8('0x1e')]),_0x2f7a23);agents['agentconnect'](_0x2f7a23);queues[_0xf9b8('0x21')](_0x2f7a23);}catch(_0x108d0f){utils['error'](util['format'](_0xf9b8('0x22'),_0x2f7a23[_0xf9b8('0x1e')]),_0x108d0f);}});ami['on'](_0xf9b8('0x23'),function(_0x2abeb2){try{utils[_0xf9b8('0x1c')](util[_0xf9b8('0x18')](_0xf9b8('0x24'),_0x2abeb2['uniqueid']),_0x2abeb2);agents['agentcomplete'](_0x2abeb2);queues[_0xf9b8('0x23')](_0x2abeb2);members[_0xf9b8('0x23')](_0x2abeb2);}catch(_0x352e7b){utils[_0xf9b8('0x14')](util['format'](_0xf9b8('0x24'),_0x2abeb2[_0xf9b8('0x1e')]),_0x352e7b);}});ami['on'](_0xf9b8('0x25'),function(_0x10b7e6){try{utils['debug'](util[_0xf9b8('0x18')](_0xf9b8('0x26'),_0x10b7e6['uniqueid']),_0x10b7e6);agents[_0xf9b8('0x25')](_0x10b7e6);queues[_0xf9b8('0x25')](_0x10b7e6);}catch(_0x327977){utils[_0xf9b8('0x14')](util['format'](_0xf9b8('0x26'),_0x10b7e6[_0xf9b8('0x1e')]),_0x327977);}});ami['on'](_0xf9b8('0x27'),function(_0x1548d8){try{utils[_0xf9b8('0x1c')](util[_0xf9b8('0x18')](_0xf9b8('0x28'),_0x1548d8[_0xf9b8('0x1e')]),_0x1548d8);queues[_0xf9b8('0x27')](_0x1548d8);recordings[_0xf9b8('0x27')](_0x1548d8);}catch(_0xe98eaf){utils[_0xf9b8('0x14')](util[_0xf9b8('0x18')](_0xf9b8('0x28'),_0x1548d8[_0xf9b8('0x1e')]),_0xe98eaf);}});ami['on'](_0xf9b8('0x29'),function(_0x351ef3){try{utils[_0xf9b8('0x1c')](util['format'](_0xf9b8('0x2a'),_0x351ef3[_0xf9b8('0x1e')]),_0x351ef3);queues[_0xf9b8('0x29')](_0x351ef3);}catch(_0x127f15){utils[_0xf9b8('0x14')](util[_0xf9b8('0x18')](_0xf9b8('0x2a'),_0x351ef3[_0xf9b8('0x1e')]),_0x127f15);}});ami['on']('musiconholdstart',function(_0x5d1f34){try{utils[_0xf9b8('0x1c')](util[_0xf9b8('0x18')](_0xf9b8('0x2b'),_0x5d1f34[_0xf9b8('0x1e')]),_0x5d1f34);queues[_0xf9b8('0x2c')](_0x5d1f34);calls[_0xf9b8('0x2c')](_0x5d1f34);}catch(_0x2a48dd){utils['error'](util[_0xf9b8('0x18')]('[%s][index][musiconholdstart]',_0x5d1f34[_0xf9b8('0x1e')]),_0x2a48dd);}});ami['on']('musiconholdstop',function(_0x4e72b7){try{utils[_0xf9b8('0x1c')](util[_0xf9b8('0x18')](_0xf9b8('0x2d'),_0x4e72b7['uniqueid']),_0x4e72b7);queues['musiconholdstop'](_0x4e72b7);calls[_0xf9b8('0x2e')](_0x4e72b7);}catch(_0x25d5d2){utils[_0xf9b8('0x14')](util[_0xf9b8('0x18')](_0xf9b8('0x2d'),_0x4e72b7[_0xf9b8('0x1e')]),_0x25d5d2);}});ami['on'](_0xf9b8('0x2f'),function(_0x1af641){try{utils[_0xf9b8('0x1c')](util[_0xf9b8('0x18')](_0xf9b8('0x30'),_0x1af641[_0xf9b8('0x1e')]),_0x1af641);calls[_0xf9b8('0x2f')](_0x1af641);recordings[_0xf9b8('0x2f')](_0x1af641);}catch(_0x2185e6){utils[_0xf9b8('0x14')](util['format'](_0xf9b8('0x30'),_0x1af641[_0xf9b8('0x1e')]),_0x2185e6);}});ami['on']('hangup',function(_0x2e8a42){try{utils[_0xf9b8('0x1c')](util[_0xf9b8('0x18')](_0xf9b8('0x31'),_0x2e8a42[_0xf9b8('0x1e')]),_0x2e8a42);calls[_0xf9b8('0x32')](_0x2e8a42);recordings[_0xf9b8('0x32')](_0x2e8a42);dials['hangup'](_0x2e8a42);agents[_0xf9b8('0x32')](_0x2e8a42);queues[_0xf9b8('0x32')](_0x2e8a42);}catch(_0x2ceb1f){utils[_0xf9b8('0x14')](util['format'](_0xf9b8('0x31'),_0x2e8a42[_0xf9b8('0x1e')]),_0x2ceb1f);}});ami['on'](_0xf9b8('0x33'),function(_0x52d914){try{utils[_0xf9b8('0x1c')](util['format'](_0xf9b8('0x34'),_0x52d914[_0xf9b8('0x1e')]),_0x52d914);members[_0xf9b8('0x33')](_0x52d914);}catch(_0x502293){utils['error'](util[_0xf9b8('0x18')]('[%s][index][cdr]',_0x52d914[_0xf9b8('0x1e')]),_0x502293);}});ami['on']('blindtransfer',function(_0x1fbb0f){try{utils[_0xf9b8('0x1c')](util[_0xf9b8('0x18')]('[%s][index][blindtransfer]',_0x1fbb0f['uniqueid']),_0x1fbb0f);queues[_0xf9b8('0x35')](_0x1fbb0f);agents['blindtransfer'](_0x1fbb0f);transfers[_0xf9b8('0x35')](_0x1fbb0f);}catch(_0x2e023d){utils['error'](util[_0xf9b8('0x18')](_0xf9b8('0x36'),_0x1fbb0f[_0xf9b8('0x1e')]),_0x2e023d);}});ami['on'](_0xf9b8('0x37'),function(_0x2b1ee9){try{utils[_0xf9b8('0x1c')](util[_0xf9b8('0x18')](_0xf9b8('0x38'),_0x2b1ee9[_0xf9b8('0x39')]),_0x2b1ee9);queues['attendedtransfer'](_0x2b1ee9);transfers[_0xf9b8('0x37')](_0x2b1ee9);agents['attendedtransfer'](_0x2b1ee9);calls[_0xf9b8('0x37')](_0x2b1ee9);}catch(_0x321f01){utils[_0xf9b8('0x14')](util['format'](_0xf9b8('0x38'),_0x2b1ee9[_0xf9b8('0x39')]),_0x321f01);}});ami['on'](_0xf9b8('0x3a'),function(_0x5a44b8){try{utils[_0xf9b8('0x1c')](util['format']('[%s][index][varset]',_0x5a44b8[_0xf9b8('0x1e')]),_0x5a44b8);queues['varset'](_0x5a44b8);recordings[_0xf9b8('0x3a')](_0x5a44b8);calls[_0xf9b8('0x3a')](_0x5a44b8);dials[_0xf9b8('0x3a')](_0x5a44b8);}catch(_0x1c6fad){utils[_0xf9b8('0x14')](util[_0xf9b8('0x18')](_0xf9b8('0x3b'),_0x5a44b8[_0xf9b8('0x1e')]),_0x1c6fad);}});ami['on'](_0xf9b8('0x3c'),function(_0x174899){try{utils[_0xf9b8('0x1c')](util['format']('[%s][index][newexten]',_0x174899['uniqueid']),_0x174899);calls['newexten'](_0x174899);recordings[_0xf9b8('0x3c')](_0x174899);dials[_0xf9b8('0x3c')](_0x174899);}catch(_0x1703ed){utils['error'](util[_0xf9b8('0x18')](_0xf9b8('0x3d'),_0x174899[_0xf9b8('0x1e')]),_0x1703ed);}});ami['on'](_0xf9b8('0x3e'),function(_0x84aa30){try{utils[_0xf9b8('0x1c')](util[_0xf9b8('0x18')](_0xf9b8('0x3f'),_0x84aa30[_0xf9b8('0x1e')]),_0x84aa30);calls['newchannel'](_0x84aa30);recordings['newchannel'](_0x84aa30);}catch(_0x305ed8){utils['error'](util['format']('[%s][index][newchannel]',_0x84aa30[_0xf9b8('0x1e')]),_0x305ed8);}});ami['on']('dialbegin',function(_0x2fd56f){try{utils[_0xf9b8('0x1c')](util['format']('[%s][index][dialbegin]',_0x2fd56f[_0xf9b8('0x1e')]),_0x2fd56f);dials[_0xf9b8('0x40')](_0x2fd56f);}catch(_0x9e64e8){utils['error'](util['format']('[%s]dialbegin',_0x2fd56f[_0xf9b8('0x1e')]),_0x9e64e8);}});ami['on']('dialend',function(_0x3221e3){try{utils[_0xf9b8('0x1c')](util[_0xf9b8('0x18')]('[%s][index][dialend]',_0x3221e3[_0xf9b8('0x1e')]),_0x3221e3);dials['dialend'](_0x3221e3);}catch(_0x46f7a0){utils[_0xf9b8('0x14')](util['format'](_0xf9b8('0x41'),_0x3221e3[_0xf9b8('0x1e')]),_0x46f7a0);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index f6e1f20..542949d 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 _0xc9b6=['agent','NOT_INUSE','exitAt','duration','enterAt','agentcomplete','isNil','[%s][members][agentcomplete]','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','cdr','[%s][members][cdr]','assign','data1','source','data3','destination','destinationchannel','type','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','lodash','util','./utils','Queue:','info','[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','interface','channel','data2','getUserByInterface','then','membername','request','CreateMemberReport','split','name','internal','catch','error','[%s][members][writeDB]','startsWith','devicestatechange','debug','format','[%s][members][devicestatechange]','device','[%s][members][devicestatechange]\x20state:%s\x20interface:%s','state','INUSE','BUSY','voice','TALKING','now'];(function(_0x310246,_0x4f96d9){var _0x3e808e=function(_0x541515){while(--_0x541515){_0x310246['push'](_0x310246['shift']());}};_0x3e808e(++_0x4f96d9);}(_0xc9b6,0xb6));var _0x6c9b=function(_0x18381f,_0x45e87c){_0x18381f=_0x18381f-0x0;var _0x1ccb6e=_0xc9b6[_0x18381f];return _0x1ccb6e;};'use strict';var _=require(_0x6c9b('0x0'));var util=require(_0x6c9b('0x1'));var utils=require(_0x6c9b('0x2'));var members={};var exclude=['Local/_attended@transfer',_0x6c9b('0x3')];function writeDB(_0x32f5b4){utils[_0x6c9b('0x4')](util['format'](_0x6c9b('0x5'),_0x32f5b4[_0x6c9b('0x6')],_0x32f5b4[_0x6c9b('0x7')],_0x32f5b4[_0x6c9b('0x8')],_0x32f5b4[_0x6c9b('0x9')],_0x32f5b4['membername'],_0x32f5b4['type']));if(_0x32f5b4[_0x6c9b('0x7')]){utils[_0x6c9b('0xa')](_0x32f5b4[_0x6c9b('0x7')])[_0x6c9b('0xb')](function(_0x58b390){if(_0x58b390){_0x32f5b4[_0x6c9b('0xc')]=_0x58b390['name'];_0x32f5b4['internal']=_0x58b390['internal'];utils[_0x6c9b('0xd')](_0x6c9b('0xe'),_0x32f5b4);}else{utils['getUserByName'](_0x32f5b4[_0x6c9b('0x7')][_0x6c9b('0xf')]('/')[0x1])[_0x6c9b('0xb')](function(_0xa592a0){if(_0xa592a0){_0x32f5b4[_0x6c9b('0xc')]=_0xa592a0[_0x6c9b('0x10')];_0x32f5b4[_0x6c9b('0x11')]=_0xa592a0[_0x6c9b('0x11')];utils[_0x6c9b('0xd')](_0x6c9b('0xe'),_0x32f5b4);}});}})[_0x6c9b('0x12')](function(_0x4b36e9){utils[_0x6c9b('0x13')](util['format'](_0x6c9b('0x14'),_0x32f5b4[_0x6c9b('0x6')]),_0x4b36e9);});}delete members[_0x32f5b4[_0x6c9b('0x7')]];}function startsWith(_0x29e5d9,_0x277e8f){return _['some'](_0x29e5d9,function(_0x2fdfbd){return _[_0x6c9b('0x15')](_0x277e8f,_0x2fdfbd);});}exports[_0x6c9b('0x16')]=function(_0x53cb9b){try{utils[_0x6c9b('0x17')](util[_0x6c9b('0x18')](_0x6c9b('0x19'),members[_0x53cb9b[_0x6c9b('0x1a')]]?members[_0x53cb9b['device']][_0x6c9b('0x6')]:_0x53cb9b[_0x6c9b('0x1a')]),_0x53cb9b);utils[_0x6c9b('0x4')](util['format'](_0x6c9b('0x1b'),members[_0x53cb9b[_0x6c9b('0x1a')]]?members[_0x53cb9b[_0x6c9b('0x1a')]][_0x6c9b('0x6')]:_0x53cb9b[_0x6c9b('0x1a')],_0x53cb9b[_0x6c9b('0x1c')],_0x53cb9b[_0x6c9b('0x1a')]));switch(_0x53cb9b[_0x6c9b('0x1c')]){case _0x6c9b('0x1d'):case _0x6c9b('0x1e'):if(!startsWith(exclude,_0x53cb9b['device'])){members[_0x53cb9b[_0x6c9b('0x1a')]]={'channel':_0x6c9b('0x1f'),'interface':_0x53cb9b[_0x6c9b('0x1a')],'type':_0x6c9b('0x20'),'enterAt':utils[_0x6c9b('0x21')](),'role':_0x6c9b('0x22')};}break;case _0x6c9b('0x23'):if(!_['isNil'](members[_0x53cb9b[_0x6c9b('0x1a')]])){members[_0x53cb9b[_0x6c9b('0x1a')]][_0x6c9b('0x24')]=utils['now']();members[_0x53cb9b['device']][_0x6c9b('0x25')]=utils['diffTime'](members[_0x53cb9b[_0x6c9b('0x1a')]][_0x6c9b('0x24')],members[_0x53cb9b[_0x6c9b('0x1a')]][_0x6c9b('0x26')]);if(members[_0x53cb9b[_0x6c9b('0x1a')]][_0x6c9b('0x6')]){writeDB(members[_0x53cb9b[_0x6c9b('0x1a')]]);}}break;default:break;}}catch(_0x3d9af2){utils[_0x6c9b('0x13')](util['format'](_0x6c9b('0x19'),members[_0x53cb9b[_0x6c9b('0x1a')]]?members[_0x53cb9b[_0x6c9b('0x1a')]][_0x6c9b('0x6')]:_0x53cb9b[_0x6c9b('0x1a')]),_0x3d9af2);}};exports[_0x6c9b('0x27')]=function(_0x392dbe){try{if(!_[_0x6c9b('0x28')](members[_0x392dbe[_0x6c9b('0x7')]])){utils[_0x6c9b('0x17')](util[_0x6c9b('0x18')](_0x6c9b('0x29'),_0x392dbe[_0x6c9b('0x6')]),_0x392dbe);utils['info'](util['format'](_0x6c9b('0x2a'),_0x392dbe['uniqueid'],_0x392dbe['interface'],_0x392dbe[_0x6c9b('0x2b')]));members[_0x392dbe[_0x6c9b('0x7')]]=_['assign'](members[_0x392dbe[_0x6c9b('0x7')]],{'data4':_0x392dbe[_0x6c9b('0x2b')],'uniqueid':_0x392dbe[_0x6c9b('0x6')]});}}catch(_0x4a1941){utils['error'](util[_0x6c9b('0x18')]('[%s][members][agentcomplete]',_0x392dbe[_0x6c9b('0x6')]),_0x4a1941);}};exports[_0x6c9b('0x2c')]=function(_0x14c459){try{utils[_0x6c9b('0x17')](util[_0x6c9b('0x18')](_0x6c9b('0x2d'),_0x14c459[_0x6c9b('0x6')]),_0x14c459);if(_0x14c459[_0x6c9b('0x8')]){var _0xe886e7=_0x14c459[_0x6c9b('0x8')][_0x6c9b('0xf')]('-')[0x0];if(!_[_0x6c9b('0x28')](members[_0xe886e7])){members[_0xe886e7]=_[_0x6c9b('0x2e')](members[_0xe886e7],{'data1':members[_0xe886e7][_0x6c9b('0x2f')]||_0x14c459['type'],'data2':members[_0xe886e7][_0x6c9b('0x9')]||_0x14c459[_0x6c9b('0x30')],'data3':members[_0xe886e7][_0x6c9b('0x31')]||_0x14c459[_0x6c9b('0x32')],'uniqueid':members[_0xe886e7][_0x6c9b('0x6')]||_0x14c459[_0x6c9b('0x6')]});utils[_0x6c9b('0x4')](util[_0x6c9b('0x18')]('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x14c459[_0x6c9b('0x6')],members[_0xe886e7][_0x6c9b('0x2f')],members[_0xe886e7][_0x6c9b('0x9')],members[_0xe886e7]['data3']));if(members[_0xe886e7][_0x6c9b('0x24')]){writeDB(members[_0xe886e7]);}}}if(_0x14c459[_0x6c9b('0x33')]){var _0xc30862=_0x14c459['destinationchannel'][_0x6c9b('0xf')]('-')[0x0];if(!_[_0x6c9b('0x28')](members[_0xc30862])){members[_0xc30862]=_[_0x6c9b('0x2e')](members[_0xc30862],{'data1':members[_0xc30862][_0x6c9b('0x2f')]||_0x14c459[_0x6c9b('0x34')],'data2':members[_0xc30862][_0x6c9b('0x9')]||_0x14c459[_0x6c9b('0x30')],'data3':members[_0xc30862][_0x6c9b('0x31')]||_0x14c459[_0x6c9b('0x32')],'uniqueid':members[_0xc30862]['uniqueid']||_0x14c459[_0x6c9b('0x6')]});utils[_0x6c9b('0x4')](util['format'](_0x6c9b('0x35'),_0x14c459[_0x6c9b('0x6')],members[_0xc30862][_0x6c9b('0x2f')],members[_0xc30862]['data2'],members[_0xc30862]['data3']));if(members[_0xc30862]['exitAt']){writeDB(members[_0xc30862]);}}}}catch(_0x507173){utils[_0x6c9b('0x13')](util[_0x6c9b('0x18')](_0x6c9b('0x2d'),_0x14c459[_0x6c9b('0x6')]),_0x507173);}}; \ No newline at end of file +var _0x65b3=['[%s][members][writeDB]\x20interface:%s\x20channel:%s\x20data2:%s\x20agent:%s\x20type:%s','uniqueid','channel','data2','membername','interface','getUserByInterface','then','name','internal','request','CreateMemberReport','split','catch','error','[%s][members][writeDB]','some','startsWith','devicestatechange','debug','[%s][members][devicestatechange]','device','state','INUSE','BUSY','voice','TALKING','now','agent','isNil','exitAt','duration','diffTime','enterAt','agentcomplete','info','[%s][members][agentcomplete]\x20interface:%s\x20queue:%s','queue','[%s][members][cdr]','data1','type','data3','[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s','destinationchannel','destination','lodash','util','./utils','Local/_attended@transfer','Queue:','format'];(function(_0x461983,_0x27c922){var _0x2d5d41=function(_0x2299c4){while(--_0x2299c4){_0x461983['push'](_0x461983['shift']());}};_0x2d5d41(++_0x27c922);}(_0x65b3,0xc6));var _0x365b=function(_0x56e4e7,_0x1db098){_0x56e4e7=_0x56e4e7-0x0;var _0x383618=_0x65b3[_0x56e4e7];return _0x383618;};'use strict';var _=require(_0x365b('0x0'));var util=require(_0x365b('0x1'));var utils=require(_0x365b('0x2'));var members={};var exclude=[_0x365b('0x3'),_0x365b('0x4')];function writeDB(_0x86c875){utils['info'](util[_0x365b('0x5')](_0x365b('0x6'),_0x86c875[_0x365b('0x7')],_0x86c875['interface'],_0x86c875[_0x365b('0x8')],_0x86c875[_0x365b('0x9')],_0x86c875[_0x365b('0xa')],_0x86c875['type']));if(_0x86c875[_0x365b('0xb')]){utils[_0x365b('0xc')](_0x86c875[_0x365b('0xb')])[_0x365b('0xd')](function(_0x25e24c){if(_0x25e24c){_0x86c875['membername']=_0x25e24c[_0x365b('0xe')];_0x86c875[_0x365b('0xf')]=_0x25e24c[_0x365b('0xf')];utils[_0x365b('0x10')](_0x365b('0x11'),_0x86c875);}else{utils['getUserByName'](_0x86c875[_0x365b('0xb')][_0x365b('0x12')]('/')[0x1])[_0x365b('0xd')](function(_0xe11fd8){if(_0xe11fd8){_0x86c875['membername']=_0xe11fd8['name'];_0x86c875[_0x365b('0xf')]=_0xe11fd8[_0x365b('0xf')];utils[_0x365b('0x10')]('CreateMemberReport',_0x86c875);}});}})[_0x365b('0x13')](function(_0x543f4c){utils[_0x365b('0x14')](util[_0x365b('0x5')](_0x365b('0x15'),_0x86c875[_0x365b('0x7')]),_0x543f4c);});}delete members[_0x86c875[_0x365b('0xb')]];}function startsWith(_0x3af95f,_0x2813df){return _[_0x365b('0x16')](_0x3af95f,function(_0x1e93d9){return _[_0x365b('0x17')](_0x2813df,_0x1e93d9);});}exports[_0x365b('0x18')]=function(_0x13403b){try{utils[_0x365b('0x19')](util[_0x365b('0x5')](_0x365b('0x1a'),members[_0x13403b[_0x365b('0x1b')]]?members[_0x13403b[_0x365b('0x1b')]][_0x365b('0x7')]:_0x13403b[_0x365b('0x1b')]),_0x13403b);utils['info'](util[_0x365b('0x5')]('[%s][members][devicestatechange]\x20state:%s\x20interface:%s',members[_0x13403b[_0x365b('0x1b')]]?members[_0x13403b[_0x365b('0x1b')]][_0x365b('0x7')]:_0x13403b[_0x365b('0x1b')],_0x13403b[_0x365b('0x1c')],_0x13403b[_0x365b('0x1b')]));switch(_0x13403b[_0x365b('0x1c')]){case _0x365b('0x1d'):case _0x365b('0x1e'):if(!startsWith(exclude,_0x13403b[_0x365b('0x1b')])){members[_0x13403b[_0x365b('0x1b')]]={'channel':_0x365b('0x1f'),'interface':_0x13403b[_0x365b('0x1b')],'type':_0x365b('0x20'),'enterAt':utils[_0x365b('0x21')](),'role':_0x365b('0x22')};}break;case'NOT_INUSE':if(!_[_0x365b('0x23')](members[_0x13403b[_0x365b('0x1b')]])){members[_0x13403b[_0x365b('0x1b')]][_0x365b('0x24')]=utils[_0x365b('0x21')]();members[_0x13403b['device']][_0x365b('0x25')]=utils[_0x365b('0x26')](members[_0x13403b[_0x365b('0x1b')]]['exitAt'],members[_0x13403b[_0x365b('0x1b')]][_0x365b('0x27')]);if(members[_0x13403b[_0x365b('0x1b')]][_0x365b('0x7')]){writeDB(members[_0x13403b[_0x365b('0x1b')]]);}}break;default:break;}}catch(_0x8b9b5c){utils[_0x365b('0x14')](util[_0x365b('0x5')](_0x365b('0x1a'),members[_0x13403b['device']]?members[_0x13403b[_0x365b('0x1b')]]['uniqueid']:_0x13403b[_0x365b('0x1b')]),_0x8b9b5c);}};exports[_0x365b('0x28')]=function(_0x5ee181){try{if(!_[_0x365b('0x23')](members[_0x5ee181[_0x365b('0xb')]])){utils[_0x365b('0x19')](util['format']('[%s][members][agentcomplete]',_0x5ee181[_0x365b('0x7')]),_0x5ee181);utils[_0x365b('0x29')](util[_0x365b('0x5')](_0x365b('0x2a'),_0x5ee181['uniqueid'],_0x5ee181[_0x365b('0xb')],_0x5ee181[_0x365b('0x2b')]));members[_0x5ee181[_0x365b('0xb')]]=_['assign'](members[_0x5ee181['interface']],{'data4':_0x5ee181[_0x365b('0x2b')],'uniqueid':_0x5ee181[_0x365b('0x7')]});}}catch(_0x50d3f4){utils[_0x365b('0x14')](util['format']('[%s][members][agentcomplete]',_0x5ee181[_0x365b('0x7')]),_0x50d3f4);}};exports['cdr']=function(_0x581410){try{utils[_0x365b('0x19')](util[_0x365b('0x5')](_0x365b('0x2c'),_0x581410[_0x365b('0x7')]),_0x581410);if(_0x581410['channel']){var _0x3c7612=_0x581410[_0x365b('0x8')][_0x365b('0x12')]('-')[0x0];if(!_['isNil'](members[_0x3c7612])){members[_0x3c7612]=_['assign'](members[_0x3c7612],{'data1':members[_0x3c7612][_0x365b('0x2d')]||_0x581410[_0x365b('0x2e')],'data2':members[_0x3c7612]['data2']||_0x581410['source'],'data3':members[_0x3c7612][_0x365b('0x2f')]||_0x581410['destination'],'uniqueid':members[_0x3c7612]['uniqueid']||_0x581410[_0x365b('0x7')]});utils[_0x365b('0x29')](util[_0x365b('0x5')](_0x365b('0x30'),_0x581410[_0x365b('0x7')],members[_0x3c7612][_0x365b('0x2d')],members[_0x3c7612][_0x365b('0x9')],members[_0x3c7612][_0x365b('0x2f')]));if(members[_0x3c7612][_0x365b('0x24')]){writeDB(members[_0x3c7612]);}}}if(_0x581410[_0x365b('0x31')]){var _0x52465b=_0x581410[_0x365b('0x31')][_0x365b('0x12')]('-')[0x0];if(!_[_0x365b('0x23')](members[_0x52465b])){members[_0x52465b]=_['assign'](members[_0x52465b],{'data1':members[_0x52465b][_0x365b('0x2d')]||_0x581410[_0x365b('0x2e')],'data2':members[_0x52465b]['data2']||_0x581410['source'],'data3':members[_0x52465b][_0x365b('0x2f')]||_0x581410[_0x365b('0x32')],'uniqueid':members[_0x52465b][_0x365b('0x7')]||_0x581410[_0x365b('0x7')]});utils[_0x365b('0x29')](util[_0x365b('0x5')]('[%s][members][cdr]\x20type:%s\x20source:%s\x20destination:%s',_0x581410[_0x365b('0x7')],members[_0x52465b][_0x365b('0x2d')],members[_0x52465b][_0x365b('0x9')],members[_0x52465b]['data3']));if(members[_0x52465b][_0x365b('0x24')]){writeDB(members[_0x52465b]);}}}}catch(_0x2ba36c){utils[_0x365b('0x14')](util['format'](_0x365b('0x2c'),_0x581410[_0x365b('0x7')]),_0x2ba36c);}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index 8b7901b..3dba7b4 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 _0xbc2e=['request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','assign','position','now','error','isNil','[%s][queues][hangup]','queuecallerleaveAt','queuecallerabandon','queuecallercomplete','COMPLETEDBYAGENT','name','[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s','queuecallerenterreason','varset','[%s][queues][varset]','variable','queuestatus','value','toUpperCase','CONTINUE','queuecallerexit','queuecallerexitAt','queueposition','queuecallerabandonAt','[%s][queues][queuecallerabandon]','queuecallerleave','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','holdtime','diffTime','queuecallerjoinAt','count','connectedlinename','agentconnect','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','assigned','[%s][queues][agentcomplete]','queuecallercompleteAt','reason','transfer','TRANSFER','COMPLETEDBY','blindtransfer','transfereeuniqueid','transfertype','transferexten','extension','transferuniqueid','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','[%s][queues][blindtransfer]','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','transfereelinkedid','transfertargetuniqueid','calleridname','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s','secondtransfereruniqueid','secondtransfererexten','ATTENDED','transfertargetlinkedid','clone','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s','musiconholdstart','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','[%s][queues][musiconholdstart]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','util','./utils','info','format','[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s','uniqueid','queue','lastAssignedTo','calleridnum','accountcode','queuecallerexitreason','getVoiceQueueByName','then','type'];(function(_0x42be20,_0x5f4866){var _0x4168d7=function(_0x1432bc){while(--_0x1432bc){_0x42be20['push'](_0x42be20['shift']());}};_0x4168d7(++_0x5f4866);}(_0xbc2e,0xb9));var _0xebc2=function(_0x55a108,_0x13f86c){_0x55a108=_0x55a108-0x0;var _0x4caf93=_0xbc2e[_0x55a108];return _0x4caf93;};'use strict';var _=require(_0xebc2('0x0'));var util=require(_0xebc2('0x1'));var utils=require(_0xebc2('0x2'));var queues={};function writeDB(_0x2b06bf){utils[_0xebc2('0x3')](util[_0xebc2('0x4')](_0xebc2('0x5'),_0x2b06bf[_0xebc2('0x6')],_0x2b06bf['channel'],_0x2b06bf[_0xebc2('0x7')],_0x2b06bf[_0xebc2('0x8')],_0x2b06bf[_0xebc2('0x9')],_0x2b06bf[_0xebc2('0xa')],_0x2b06bf[_0xebc2('0xb')]));if(_0x2b06bf[_0xebc2('0x7')]){utils[_0xebc2('0xc')](_0x2b06bf[_0xebc2('0x7')])[_0xebc2('0xd')](function(_0x3d5b44){if(_0x3d5b44){_0x2b06bf[_0xebc2('0xe')]=_0x3d5b44[_0xebc2('0xe')];}utils[_0xebc2('0xf')]('CreateVoiceQueueReport',_0x2b06bf);});}else{utils['request'](_0xebc2('0x10'),_0x2b06bf);}if(_0x2b06bf[_0xebc2('0x11')]){delete queues[_0x2b06bf['transfereduniqueid']];}else{delete queues[_0x2b06bf['uniqueid']];}}exports[_0xebc2('0x12')]=function(_0x474162){try{utils[_0xebc2('0x13')](util['format'](_0xebc2('0x14'),_0x474162[_0xebc2('0x6')]),_0x474162);utils[_0xebc2('0x3')](util[_0xebc2('0x4')](_0xebc2('0x15'),_0x474162[_0xebc2('0x6')],_0x474162['queue'],_0x474162['position']));queues[_0x474162[_0xebc2('0x6')]]=_[_0xebc2('0x16')](_0x474162,{'originalposition':_0x474162[_0xebc2('0x17')],'queuecallerjoinAt':utils[_0xebc2('0x18')](),'mohtime':0x0});}catch(_0x2249d1){utils[_0xebc2('0x19')](util['format'](_0xebc2('0x14'),_0x474162[_0xebc2('0x6')]),_0x2249d1);}};exports['hangup']=function(_0x4b4ac7){try{if(!_[_0xebc2('0x1a')](queues[_0x4b4ac7['uniqueid']])){utils['debug'](util['format'](_0xebc2('0x1b'),_0x4b4ac7[_0xebc2('0x6')]),_0x4b4ac7);if(queues[_0x4b4ac7[_0xebc2('0x6')]][_0xebc2('0x1c')]){if(!queues[_0x4b4ac7[_0xebc2('0x6')]][_0xebc2('0x1d')]&&!queues[_0x4b4ac7[_0xebc2('0x6')]]['queuecallerexit']){queues[_0x4b4ac7[_0xebc2('0x6')]][_0xebc2('0x1e')]=!![];queues[_0x4b4ac7[_0xebc2('0x6')]]['queuecallercompleteAt']=utils[_0xebc2('0x18')]();queues[_0x4b4ac7[_0xebc2('0x6')]][_0xebc2('0xb')]=_0xebc2('0x1f');}utils['info'](util[_0xebc2('0x4')]('[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s',_0x4b4ac7[_0xebc2('0x6')],queues[_0x4b4ac7['uniqueid']][_0xebc2('0x20')],queues[_0x4b4ac7['uniqueid']][_0xebc2('0xb')]));writeDB(queues[_0x4b4ac7[_0xebc2('0x6')]]);}else if(queues[_0x4b4ac7[_0xebc2('0x6')]][_0xebc2('0x11')]){utils[_0xebc2('0x3')](util[_0xebc2('0x4')](_0xebc2('0x21'),_0x4b4ac7[_0xebc2('0x6')],queues[_0x4b4ac7[_0xebc2('0x6')]][_0xebc2('0x20')],queues[_0x4b4ac7[_0xebc2('0x6')]][_0xebc2('0x11')]));queues[queues[_0x4b4ac7['uniqueid']][_0xebc2('0x11')]]=queues[_0x4b4ac7[_0xebc2('0x6')]];queues[queues[_0x4b4ac7[_0xebc2('0x6')]][_0xebc2('0x11')]][_0xebc2('0x22')]=0x2;delete queues[_0x4b4ac7['uniqueid']];}}}catch(_0x3bb70b){utils['error'](util[_0xebc2('0x4')](_0xebc2('0x1b'),_0x4b4ac7[_0xebc2('0x6')]),_0x3bb70b);}};exports[_0xebc2('0x23')]=function(_0x212592){try{utils['debug'](util[_0xebc2('0x4')](_0xebc2('0x24'),_0x212592[_0xebc2('0x6')]),_0x212592);if(!_[_0xebc2('0x1a')](_0x212592[_0xebc2('0x25')][_0xebc2('0x26')])&&_0x212592[_0xebc2('0x27')][_0xebc2('0x28')]()!==_0xebc2('0x29')){if(!_[_0xebc2('0x1a')](queues[_0x212592['uniqueid']])){queues[_0x212592[_0xebc2('0x6')]][_0xebc2('0x1d')]=![];queues[_0x212592['uniqueid']]['queuecallerabandonAt']=null;queues[_0x212592['uniqueid']][_0xebc2('0x2a')]=!![];queues[_0x212592[_0xebc2('0x6')]][_0xebc2('0x2b')]=utils['now']();queues[_0x212592[_0xebc2('0x6')]][_0xebc2('0xb')]=_0x212592[_0xebc2('0x27')][_0xebc2('0x28')]();utils[_0xebc2('0x3')](util[_0xebc2('0x4')]('[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s',_0x212592[_0xebc2('0x6')],queues[_0x212592[_0xebc2('0x6')]][_0xebc2('0x20')],_0x212592[_0xebc2('0x27')],queues[_0x212592[_0xebc2('0x6')]][_0xebc2('0xb')]));writeDB(queues[_0x212592['uniqueid']]);}}else if(!_[_0xebc2('0x1a')](_0x212592['variable'][_0xebc2('0x2c')])){if(!_[_0xebc2('0x1a')](queues[_0x212592[_0xebc2('0x6')]])&&!queues[_0x212592['uniqueid']]['queuecallerabandon']){queues[_0x212592[_0xebc2('0x6')]][_0xebc2('0x1d')]=![];queues[_0x212592['uniqueid']][_0xebc2('0x2d')]=null;queues[_0x212592['uniqueid']][_0xebc2('0x2a')]=!![];queues[_0x212592['uniqueid']][_0xebc2('0x2b')]=utils[_0xebc2('0x18')]();queues[_0x212592['uniqueid']][_0xebc2('0xb')]='EXITWITHKEY';utils[_0xebc2('0x3')](util[_0xebc2('0x4')]('[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s',_0x212592[_0xebc2('0x6')],queues[_0x212592[_0xebc2('0x6')]][_0xebc2('0x20')],_0x212592[_0xebc2('0x27')],queues[_0x212592[_0xebc2('0x6')]][_0xebc2('0xb')]));}}}catch(_0x770ee4){utils['error'](util[_0xebc2('0x4')](_0xebc2('0x24'),_0x212592[_0xebc2('0x6')]),_0x770ee4);}};exports['queuecallerabandon']=function(_0x5d9a3d){try{if(!_[_0xebc2('0x1a')](queues[_0x5d9a3d[_0xebc2('0x6')]])){utils['debug'](util['format'](_0xebc2('0x2e'),_0x5d9a3d[_0xebc2('0x6')]),_0x5d9a3d);queues[_0x5d9a3d['uniqueid']][_0xebc2('0x2a')]=![];queues[_0x5d9a3d[_0xebc2('0x6')]][_0xebc2('0x2b')]=null;queues[_0x5d9a3d['uniqueid']][_0xebc2('0x1d')]=!![];queues[_0x5d9a3d[_0xebc2('0x6')]][_0xebc2('0x2d')]=utils[_0xebc2('0x18')]();queues[_0x5d9a3d[_0xebc2('0x6')]][_0xebc2('0xb')]='ABANDONED';utils[_0xebc2('0x3')](util['format']('[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s',_0x5d9a3d['uniqueid'],queues[_0x5d9a3d[_0xebc2('0x6')]]['name'],queues[_0x5d9a3d[_0xebc2('0x6')]][_0xebc2('0xb')]));}}catch(_0x3af33c){utils[_0xebc2('0x19')](util['format'](_0xebc2('0x2e'),_0x5d9a3d[_0xebc2('0x6')]),_0x3af33c);}};exports[_0xebc2('0x2f')]=function(_0x577c49){try{if(!_[_0xebc2('0x1a')](queues[_0x577c49['uniqueid']])){utils['debug'](util['format'](_0xebc2('0x30'),_0x577c49['uniqueid']),_0x577c49);utils['info'](util['format'](_0xebc2('0x31'),_0x577c49[_0xebc2('0x6')],queues[_0x577c49['uniqueid']][_0xebc2('0x20')],_0x577c49[_0xebc2('0x32')],_0x577c49['connectedlinename']));queues[_0x577c49[_0xebc2('0x6')]][_0xebc2('0x2f')]=!![];queues[_0x577c49[_0xebc2('0x6')]]['queuecallerleaveAt']=utils[_0xebc2('0x18')]();queues[_0x577c49[_0xebc2('0x6')]][_0xebc2('0x33')]=utils[_0xebc2('0x34')](queues[_0x577c49[_0xebc2('0x6')]][_0xebc2('0x1c')],queues[_0x577c49['uniqueid']][_0xebc2('0x35')]);queues[_0x577c49['uniqueid']]['position']=_0x577c49['position'];queues[_0x577c49['uniqueid']][_0xebc2('0x36')]=_0x577c49[_0xebc2('0x36')];queues[_0x577c49[_0xebc2('0x6')]][_0xebc2('0x32')]=_0x577c49[_0xebc2('0x32')];queues[_0x577c49[_0xebc2('0x6')]][_0xebc2('0x37')]=_0x577c49[_0xebc2('0x37')];}}catch(_0x497ccf){utils[_0xebc2('0x19')](util[_0xebc2('0x4')]('[%s][queues][queuecallerleave]',_0x577c49[_0xebc2('0x6')]),_0x497ccf);}};exports[_0xebc2('0x38')]=function(_0x99d50f){try{if(!_[_0xebc2('0x1a')](queues[_0x99d50f[_0xebc2('0x6')]])){utils[_0xebc2('0x13')](util['format'](_0xebc2('0x39'),_0x99d50f[_0xebc2('0x6')]),_0x99d50f);utils['info'](util[_0xebc2('0x4')](_0xebc2('0x3a'),_0x99d50f[_0xebc2('0x6')],queues[_0x99d50f[_0xebc2('0x6')]][_0xebc2('0x20')],_0x99d50f[_0xebc2('0x3b')],_0x99d50f[_0xebc2('0x3c')]));queues[_0x99d50f['uniqueid']]['queuecallerabandon']=![];queues[_0x99d50f['uniqueid']][_0xebc2('0x1d')]=![];queues[_0x99d50f[_0xebc2('0x6')]][_0xebc2('0x2d')]=null;queues[_0x99d50f['uniqueid']][_0xebc2('0x2a')]=![];queues[_0x99d50f[_0xebc2('0x6')]][_0xebc2('0xb')]=null;queues[_0x99d50f[_0xebc2('0x6')]][_0xebc2('0x2b')]=null;queues[_0x99d50f[_0xebc2('0x6')]][_0xebc2('0x3d')]=!![];queues[_0x99d50f[_0xebc2('0x6')]]['accountcode']=_0x99d50f[_0xebc2('0x3c')];queues[_0x99d50f[_0xebc2('0x6')]][_0xebc2('0x8')]=_0x99d50f[_0xebc2('0x3b')];}}catch(_0x56956b){utils[_0xebc2('0x19')](util[_0xebc2('0x4')](_0xebc2('0x39'),_0x99d50f[_0xebc2('0x6')]),_0x56956b);}};exports['agentcomplete']=function(_0x41362c){try{if(!_['isNil'](queues[_0x41362c[_0xebc2('0x6')]])){if(queues[_0x41362c[_0xebc2('0x6')]][_0xebc2('0x1c')]){utils[_0xebc2('0x13')](util['format'](_0xebc2('0x3e'),_0x41362c[_0xebc2('0x6')]),_0x41362c);queues[_0x41362c[_0xebc2('0x6')]]['queuecallerabandon']=![];queues[_0x41362c[_0xebc2('0x6')]][_0xebc2('0x1d')]=![];queues[_0x41362c[_0xebc2('0x6')]]['queuecallerabandonAt']=null;queues[_0x41362c['uniqueid']][_0xebc2('0x2a')]=![];queues[_0x41362c[_0xebc2('0x6')]]['queuecallerexitAt']=null;queues[_0x41362c[_0xebc2('0x6')]][_0xebc2('0x3d')]=!![];queues[_0x41362c[_0xebc2('0x6')]][_0xebc2('0x8')]=_0x41362c['membername'];queues[_0x41362c[_0xebc2('0x6')]][_0xebc2('0x1e')]=!![];queues[_0x41362c[_0xebc2('0x6')]][_0xebc2('0x3f')]=utils[_0xebc2('0x18')]();if(_0x41362c[_0xebc2('0x40')]==_0xebc2('0x41')){if(!queues[_0x41362c[_0xebc2('0x6')]][_0xebc2('0x41')]){queues[_0x41362c[_0xebc2('0x6')]]['queuecallerexitreason']=_0xebc2('0x42');}}else{queues[_0x41362c[_0xebc2('0x6')]]['queuecallerexitreason']=_0xebc2('0x43')+_0x41362c[_0xebc2('0x40')][_0xebc2('0x28')]();}utils[_0xebc2('0x3')](util[_0xebc2('0x4')]('[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s',_0x41362c['uniqueid'],queues[_0x41362c[_0xebc2('0x6')]][_0xebc2('0x20')],_0x41362c['membername'],queues[_0x41362c['uniqueid']][_0xebc2('0xb')]));writeDB(queues[_0x41362c['uniqueid']]);}}}catch(_0x34b82e){utils[_0xebc2('0x19')](util[_0xebc2('0x4')](_0xebc2('0x3e'),_0x41362c['uniqueid']),_0x34b82e);}};exports[_0xebc2('0x44')]=function(_0x282fbc){try{if(!_[_0xebc2('0x1a')](queues[_0x282fbc[_0xebc2('0x45')]])){utils['debug'](util[_0xebc2('0x4')]('[%s][queues][blindtransfer]',_0x282fbc[_0xebc2('0x6')]),_0x282fbc);queues[_0x282fbc[_0xebc2('0x45')]][_0xebc2('0x41')]=!![];queues[_0x282fbc[_0xebc2('0x45')]][_0xebc2('0x46')]='BLIND';queues[_0x282fbc['transfereeuniqueid']][_0xebc2('0x47')]=_0x282fbc[_0xebc2('0x48')];queues[_0x282fbc[_0xebc2('0x45')]][_0xebc2('0x49')]=_0x282fbc[_0xebc2('0x45')];queues[_0x282fbc[_0xebc2('0x45')]][_0xebc2('0xb')]=_0xebc2('0x4a');utils[_0xebc2('0x3')](util[_0xebc2('0x4')](_0xebc2('0x4b'),_0x282fbc[_0xebc2('0x6')],queues[_0x282fbc['transfereeuniqueid']]['name'],_0x282fbc[_0xebc2('0x45')],_0x282fbc[_0xebc2('0x48')]));}}catch(_0x1d9f98){utils[_0xebc2('0x19')](util[_0xebc2('0x4')](_0xebc2('0x4c'),_0x282fbc[_0xebc2('0x6')]),_0x1d9f98);}};exports[_0xebc2('0x4d')]=function(_0x5007c2){try{utils[_0xebc2('0x13')](util[_0xebc2('0x4')]('[%s][queues][attendedtransfer]',_0x5007c2[_0xebc2('0x4e')]),_0x5007c2);if(_0x5007c2[_0xebc2('0x4e')]==_0x5007c2[_0xebc2('0x4f')]){if(!_[_0xebc2('0x1a')](queues[_0x5007c2[_0xebc2('0x50')]])){utils[_0xebc2('0x3')](util[_0xebc2('0x4')](_0xebc2('0x51'),_0x5007c2[_0xebc2('0x4e')],queues[_0x5007c2[_0xebc2('0x50')]]['name'],_0x5007c2[_0xebc2('0x52')]));queues[_0x5007c2['secondtransfererlinkedid']]['transfer']=!![];queues[_0x5007c2['secondtransfererlinkedid']][_0xebc2('0x46')]='ATTENDED';queues[_0x5007c2[_0xebc2('0x50')]][_0xebc2('0x47')]=_0x5007c2[_0xebc2('0x52')];queues[_0x5007c2[_0xebc2('0x50')]][_0xebc2('0x49')]=_0x5007c2[_0xebc2('0x4e')];queues[_0x5007c2[_0xebc2('0x50')]][_0xebc2('0xb')]='ATTENDEDTRANSFER';}if(!_[_0xebc2('0x1a')](queues[_0x5007c2[_0xebc2('0x4f')]])){if(_0x5007c2[_0xebc2('0x53')]&&queues[_0x5007c2[_0xebc2('0x53')]]){queues[_0x5007c2[_0xebc2('0x53')]]['queuecallerenterreason']=0x1;queues[_0x5007c2[_0xebc2('0x45')]]=_['clone'](queues[_0x5007c2['transfereelinkedid']]);queues[_0x5007c2[_0xebc2('0x45')]][_0xebc2('0x11')]=_0x5007c2[_0xebc2('0x54')];queues[_0x5007c2[_0xebc2('0x45')]][_0xebc2('0x22')]=0x2;queues[_0x5007c2['transfereeuniqueid']][_0xebc2('0x9')]=queues[_0x5007c2[_0xebc2('0x50')]]['calleridnum'];queues[_0x5007c2[_0xebc2('0x45')]]['calleridname']=queues[_0x5007c2[_0xebc2('0x50')]][_0xebc2('0x55')];queues[_0x5007c2['transfereeuniqueid']][_0xebc2('0x35')]=utils[_0xebc2('0x18')]();queues[_0x5007c2['transfereeuniqueid']][_0xebc2('0x1c')]=utils[_0xebc2('0x18')]();queues[_0x5007c2[_0xebc2('0x45')]][_0xebc2('0x33')]=0x0;queues[_0x5007c2[_0xebc2('0x45')]]['mohtime']=0x0;utils[_0xebc2('0x3')](util['format'](_0xebc2('0x56'),_0x5007c2[_0xebc2('0x4e')],queues[_0x5007c2[_0xebc2('0x45')]][_0xebc2('0x20')],queues[_0x5007c2[_0xebc2('0x45')]]['calleridnum'],queues[_0x5007c2[_0xebc2('0x45')]][_0xebc2('0x55')]));}else{utils[_0xebc2('0x3')](util['format'](_0xebc2('0x57'),_0x5007c2[_0xebc2('0x4e')],queues[_0x5007c2[_0xebc2('0x4f')]][_0xebc2('0x20')],_0x5007c2[_0xebc2('0x50')]));queues[_0x5007c2[_0xebc2('0x4f')]][_0xebc2('0x11')]=_0x5007c2[_0xebc2('0x50')];}}}else if(_0x5007c2[_0xebc2('0x58')]==_0x5007c2[_0xebc2('0x50')]){if(!_['isNil'](queues[_0x5007c2['origtransfererlinkedid']])){utils['info'](util['format']('[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER',_0x5007c2[_0xebc2('0x4e')],queues[_0x5007c2[_0xebc2('0x4f')]][_0xebc2('0x20')],_0x5007c2[_0xebc2('0x58')],_0x5007c2[_0xebc2('0x59')]));queues[_0x5007c2[_0xebc2('0x4f')]][_0xebc2('0x41')]=!![];queues[_0x5007c2[_0xebc2('0x4f')]][_0xebc2('0x46')]=_0xebc2('0x5a');queues[_0x5007c2[_0xebc2('0x4f')]][_0xebc2('0x47')]=_0x5007c2[_0xebc2('0x59')];queues[_0x5007c2['origtransfererlinkedid']][_0xebc2('0x49')]=_0x5007c2[_0xebc2('0x58')];queues[_0x5007c2[_0xebc2('0x4f')]][_0xebc2('0xb')]='ATTENDEDTRANSFER';}if(!_[_0xebc2('0x1a')](queues[_0x5007c2['secondtransfererlinkedid']])){if(_0x5007c2[_0xebc2('0x5b')]&&queues[_0x5007c2[_0xebc2('0x5b')]]){queues[_0x5007c2[_0xebc2('0x5b')]][_0xebc2('0x22')]=0x1;queues[_0x5007c2['transfertargetuniqueid']]=_[_0xebc2('0x5c')](queues[_0x5007c2[_0xebc2('0x5b')]]);queues[_0x5007c2[_0xebc2('0x54')]]['transfereduniqueid']=_0x5007c2[_0xebc2('0x54')];queues[_0x5007c2[_0xebc2('0x54')]][_0xebc2('0x22')]=0x2;queues[_0x5007c2[_0xebc2('0x54')]][_0xebc2('0x9')]=queues[_0x5007c2[_0xebc2('0x4f')]][_0xebc2('0x9')];queues[_0x5007c2[_0xebc2('0x54')]]['calleridname']=queues[_0x5007c2[_0xebc2('0x4f')]][_0xebc2('0x55')];queues[_0x5007c2[_0xebc2('0x54')]][_0xebc2('0x35')]=utils[_0xebc2('0x18')]();queues[_0x5007c2['transfertargetuniqueid']][_0xebc2('0x1c')]=utils[_0xebc2('0x18')]();queues[_0x5007c2[_0xebc2('0x54')]][_0xebc2('0x33')]=0x0;queues[_0x5007c2[_0xebc2('0x54')]][_0xebc2('0x5d')]=0x0;utils[_0xebc2('0x3')](util[_0xebc2('0x4')](_0xebc2('0x5e'),_0x5007c2[_0xebc2('0x4e')],queues[_0x5007c2['transfertargetuniqueid']][_0xebc2('0x20')],queues[_0x5007c2['transfertargetuniqueid']][_0xebc2('0x11')],queues[_0x5007c2[_0xebc2('0x54')]][_0xebc2('0x9')],queues[_0x5007c2[_0xebc2('0x54')]][_0xebc2('0x55')]));}else{utils[_0xebc2('0x3')](util[_0xebc2('0x4')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x5007c2[_0xebc2('0x4e')],queues[_0x5007c2[_0xebc2('0x50')]][_0xebc2('0x20')],_0x5007c2[_0xebc2('0x4f')]));queues[_0x5007c2[_0xebc2('0x50')]][_0xebc2('0x11')]=_0x5007c2[_0xebc2('0x4f')];}}}}catch(_0x2c6e37){utils[_0xebc2('0x19')](util[_0xebc2('0x4')]('[%s][queues][attendedtransfer]',_0x5007c2[_0xebc2('0x4e')]),_0x2c6e37);}};exports[_0xebc2('0x5f')]=function(_0x16d791){try{if(!_[_0xebc2('0x1a')](queues[_0x16d791['uniqueid']])){utils[_0xebc2('0x13')](util[_0xebc2('0x4')]('[%s][queues][musiconholdstart]',_0x16d791[_0xebc2('0x6')]),_0x16d791);queues[_0x16d791[_0xebc2('0x6')]][_0xebc2('0x60')]=utils['now']();utils[_0xebc2('0x3')](util['format'](_0xebc2('0x61'),_0x16d791[_0xebc2('0x6')],queues[_0x16d791[_0xebc2('0x6')]][_0xebc2('0x20')],queues[_0x16d791[_0xebc2('0x6')]][_0xebc2('0x60')]));}}catch(_0x2e69be){utils[_0xebc2('0x19')](util[_0xebc2('0x4')](_0xebc2('0x62'),_0x16d791[_0xebc2('0x6')]),_0x2e69be);}};exports['musiconholdstop']=function(_0x1d6150){try{if(!_[_0xebc2('0x1a')](queues[_0x1d6150[_0xebc2('0x6')]])){if(!_[_0xebc2('0x1a')](queues[_0x1d6150[_0xebc2('0x6')]][_0xebc2('0x60')])){utils['debug'](util['format']('[%s][queues][musiconholdstop]',_0x1d6150['uniqueid']),_0x1d6150);queues[_0x1d6150[_0xebc2('0x6')]][_0xebc2('0x5d')]+=utils[_0xebc2('0x34')](utils[_0xebc2('0x18')](),queues[_0x1d6150['uniqueid']][_0xebc2('0x60')]);utils[_0xebc2('0x3')](util[_0xebc2('0x4')](_0xebc2('0x63'),_0x1d6150['uniqueid'],queues[_0x1d6150['uniqueid']][_0xebc2('0x20')],queues[_0x1d6150[_0xebc2('0x6')]][_0xebc2('0x5d')]));delete queues[_0x1d6150[_0xebc2('0x6')]]['musiconholdstartAt'];}}}catch(_0x4f5834){utils[_0xebc2('0x19')](util[_0xebc2('0x4')]('[%s][queues][musiconholdstop]',_0x1d6150[_0xebc2('0x6')]),_0x4f5834);}}; \ No newline at end of file +var _0x59d5=['[%s][queues][attendedtransfer]','musiconholdstart','musiconholdstartAt','[%s][queues][musiconholdstop]\x20name:%s\x20musiconholdstartAt:%s','[%s][queues][musiconholdstart]','musiconholdstop','[%s][queues][musiconholdstop]','[%s][queues][musiconholdstop]\x20name:%s\x20mohtime:%s','lodash','util','info','format','uniqueid','channel','queue','lastAssignedTo','accountcode','queuecallerexitreason','getVoiceQueueByName','type','CreateVoiceQueueReport','request','transfereduniqueid','queuecallerjoin','debug','[%s][queues][queuecallerjoin]','[%s][queues][queuecallerjoin]\x20name:%s\x20position:%s','position','error','hangup','[%s][queues][hangup]','queuecallerleaveAt','queuecallerabandon','COMPLETEDBYAGENT','name','queuecallerenterreason','varset','[%s][queues][varset]','variable','toUpperCase','CONTINUE','isNil','queuecallerabandonAt','queuecallerexit','queuecallerexitAt','[%s][queues][varset]\x20name:%s\x20variable:queuestatus\x20value:%s\x20queuecallerexitreason:%s','queueposition','now','value','[%s][queues][queuecallerabandon]','ABANDONED','[%s][queues][queuecallerabandon]\x20name:%s\x20queuecallerexitreason:%s','[%s][queues][queuecallerleave]','[%s][queues][queuecallerleave]\x20name:%s\x20connectedlinenum:%s\x20connectedlinename:%s','connectedlinenum','connectedlinename','holdtime','diffTime','count','[%s][queues][agentconnect]','[%s][queues][agentconnect]\x20name:%s\x20agent:%s\x20accountcode:%s','membername','destaccountcode','assigned','queuecallercomplete','queuecallercompleteAt','reason','transfer','COMPLETEDBY','[%s][queues][agentcomplete]\x20name:%s\x20agent:%s\x20queuecallerexitreason:%s','transfereeuniqueid','[%s][queues][blindtransfer]','transfertype','BLIND','transferexten','BLINDTRANSFER','[%s][queues][blindtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:BLINDTRANSFER','extension','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','[%s][queues][attendedtransfer]\x20name:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','origtransfererexten','ATTENDED','transferuniqueid','transfereelinkedid','clone','calleridnum','calleridname','queuecallerjoinAt','mohtime','[%s][queues][attendedtransfer]\x20name:%s\x20calleridnum:%s\x20calleridname:%s','[%s][queues][attendedtransfer]\x20name:%s\x20transferuniqueid:%s\x20transferexten:%s\x20queuecallerexitreason:ATTENDEDTRANSFER','secondtransfereruniqueid','secondtransfererexten','ATTENDEDTRANSFER','transfertargetlinkedid','transfertargetuniqueid','[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s\x20calleridnum:%s\x20calleridname:%s'];(function(_0x2ae8ce,_0x2a5a1f){var _0x4bf686=function(_0x41cabf){while(--_0x41cabf){_0x2ae8ce['push'](_0x2ae8ce['shift']());}};_0x4bf686(++_0x2a5a1f);}(_0x59d5,0x134));var _0x559d=function(_0x5e31c8,_0x16488d){_0x5e31c8=_0x5e31c8-0x0;var _0x3e7841=_0x59d5[_0x5e31c8];return _0x3e7841;};'use strict';var _=require(_0x559d('0x0'));var util=require(_0x559d('0x1'));var utils=require('./utils');var queues={};function writeDB(_0x522c18){utils[_0x559d('0x2')](util[_0x559d('0x3')]('[%s][queues][writeDB]\x20channel:%s\x20queue:%s\x20lastAssignedTo:%s\x20calleridnum:%s\x20accountcode:%s\x20queuecallerexitreason:%s',_0x522c18[_0x559d('0x4')],_0x522c18[_0x559d('0x5')],_0x522c18[_0x559d('0x6')],_0x522c18[_0x559d('0x7')],_0x522c18['calleridnum'],_0x522c18[_0x559d('0x8')],_0x522c18[_0x559d('0x9')]));if(_0x522c18[_0x559d('0x6')]){utils[_0x559d('0xa')](_0x522c18[_0x559d('0x6')])['then'](function(_0x52b6f6){if(_0x52b6f6){_0x522c18[_0x559d('0xb')]=_0x52b6f6[_0x559d('0xb')];}utils['request'](_0x559d('0xc'),_0x522c18);});}else{utils[_0x559d('0xd')](_0x559d('0xc'),_0x522c18);}if(_0x522c18['transfereduniqueid']){delete queues[_0x522c18[_0x559d('0xe')]];}else{delete queues[_0x522c18[_0x559d('0x4')]];}}exports[_0x559d('0xf')]=function(_0x22f0f1){try{utils[_0x559d('0x10')](util['format'](_0x559d('0x11'),_0x22f0f1['uniqueid']),_0x22f0f1);utils[_0x559d('0x2')](util[_0x559d('0x3')](_0x559d('0x12'),_0x22f0f1[_0x559d('0x4')],_0x22f0f1['queue'],_0x22f0f1[_0x559d('0x13')]));queues[_0x22f0f1[_0x559d('0x4')]]=_['assign'](_0x22f0f1,{'originalposition':_0x22f0f1['position'],'queuecallerjoinAt':utils['now'](),'mohtime':0x0});}catch(_0x36dae0){utils[_0x559d('0x14')](util[_0x559d('0x3')](_0x559d('0x11'),_0x22f0f1[_0x559d('0x4')]),_0x36dae0);}};exports[_0x559d('0x15')]=function(_0x2f40dc){try{if(!_['isNil'](queues[_0x2f40dc['uniqueid']])){utils[_0x559d('0x10')](util[_0x559d('0x3')](_0x559d('0x16'),_0x2f40dc['uniqueid']),_0x2f40dc);if(queues[_0x2f40dc['uniqueid']][_0x559d('0x17')]){if(!queues[_0x2f40dc[_0x559d('0x4')]][_0x559d('0x18')]&&!queues[_0x2f40dc['uniqueid']]['queuecallerexit']){queues[_0x2f40dc['uniqueid']]['queuecallercomplete']=!![];queues[_0x2f40dc['uniqueid']]['queuecallercompleteAt']=utils['now']();queues[_0x2f40dc[_0x559d('0x4')]][_0x559d('0x9')]=_0x559d('0x19');}utils['info'](util['format']('[%s][queues][hangup]\x20name:%s\x20queuecallerexitreason:%s',_0x2f40dc[_0x559d('0x4')],queues[_0x2f40dc[_0x559d('0x4')]][_0x559d('0x1a')],queues[_0x2f40dc[_0x559d('0x4')]][_0x559d('0x9')]));writeDB(queues[_0x2f40dc[_0x559d('0x4')]]);}else if(queues[_0x2f40dc[_0x559d('0x4')]][_0x559d('0xe')]){utils[_0x559d('0x2')](util[_0x559d('0x3')]('[%s][queues][hangup]\x20name:%s\x20transfereduniqueid:%s',_0x2f40dc[_0x559d('0x4')],queues[_0x2f40dc[_0x559d('0x4')]][_0x559d('0x1a')],queues[_0x2f40dc[_0x559d('0x4')]][_0x559d('0xe')]));queues[queues[_0x2f40dc[_0x559d('0x4')]][_0x559d('0xe')]]=queues[_0x2f40dc[_0x559d('0x4')]];queues[queues[_0x2f40dc[_0x559d('0x4')]][_0x559d('0xe')]][_0x559d('0x1b')]=0x2;delete queues[_0x2f40dc['uniqueid']];}}}catch(_0x2edfed){utils[_0x559d('0x14')](util['format'](_0x559d('0x16'),_0x2f40dc[_0x559d('0x4')]),_0x2edfed);}};exports[_0x559d('0x1c')]=function(_0x4d4de7){try{utils[_0x559d('0x10')](util['format'](_0x559d('0x1d'),_0x4d4de7[_0x559d('0x4')]),_0x4d4de7);if(!_['isNil'](_0x4d4de7[_0x559d('0x1e')]['queuestatus'])&&_0x4d4de7['value'][_0x559d('0x1f')]()!==_0x559d('0x20')){if(!_[_0x559d('0x21')](queues[_0x4d4de7[_0x559d('0x4')]])){queues[_0x4d4de7[_0x559d('0x4')]]['queuecallerabandon']=![];queues[_0x4d4de7[_0x559d('0x4')]][_0x559d('0x22')]=null;queues[_0x4d4de7[_0x559d('0x4')]][_0x559d('0x23')]=!![];queues[_0x4d4de7[_0x559d('0x4')]][_0x559d('0x24')]=utils['now']();queues[_0x4d4de7[_0x559d('0x4')]][_0x559d('0x9')]=_0x4d4de7['value'][_0x559d('0x1f')]();utils[_0x559d('0x2')](util[_0x559d('0x3')](_0x559d('0x25'),_0x4d4de7[_0x559d('0x4')],queues[_0x4d4de7[_0x559d('0x4')]][_0x559d('0x1a')],_0x4d4de7['value'],queues[_0x4d4de7['uniqueid']][_0x559d('0x9')]));writeDB(queues[_0x4d4de7[_0x559d('0x4')]]);}}else if(!_[_0x559d('0x21')](_0x4d4de7[_0x559d('0x1e')][_0x559d('0x26')])){if(!_[_0x559d('0x21')](queues[_0x4d4de7['uniqueid']])&&!queues[_0x4d4de7[_0x559d('0x4')]]['queuecallerabandon']){queues[_0x4d4de7[_0x559d('0x4')]][_0x559d('0x18')]=![];queues[_0x4d4de7[_0x559d('0x4')]][_0x559d('0x22')]=null;queues[_0x4d4de7[_0x559d('0x4')]][_0x559d('0x23')]=!![];queues[_0x4d4de7[_0x559d('0x4')]]['queuecallerexitAt']=utils[_0x559d('0x27')]();queues[_0x4d4de7[_0x559d('0x4')]][_0x559d('0x9')]='EXITWITHKEY';utils[_0x559d('0x2')](util['format']('[%s][queues][varset]\x20name:%s\x20variable:queueposition\x20value:%s\x20queuecallerexitreason:%s',_0x4d4de7[_0x559d('0x4')],queues[_0x4d4de7[_0x559d('0x4')]][_0x559d('0x1a')],_0x4d4de7[_0x559d('0x28')],queues[_0x4d4de7[_0x559d('0x4')]][_0x559d('0x9')]));}}}catch(_0x4d7d76){utils[_0x559d('0x14')](util[_0x559d('0x3')](_0x559d('0x1d'),_0x4d4de7[_0x559d('0x4')]),_0x4d7d76);}};exports[_0x559d('0x18')]=function(_0x1161aa){try{if(!_[_0x559d('0x21')](queues[_0x1161aa[_0x559d('0x4')]])){utils[_0x559d('0x10')](util[_0x559d('0x3')](_0x559d('0x29'),_0x1161aa[_0x559d('0x4')]),_0x1161aa);queues[_0x1161aa[_0x559d('0x4')]]['queuecallerexit']=![];queues[_0x1161aa['uniqueid']][_0x559d('0x24')]=null;queues[_0x1161aa[_0x559d('0x4')]][_0x559d('0x18')]=!![];queues[_0x1161aa[_0x559d('0x4')]][_0x559d('0x22')]=utils['now']();queues[_0x1161aa['uniqueid']][_0x559d('0x9')]=_0x559d('0x2a');utils[_0x559d('0x2')](util[_0x559d('0x3')](_0x559d('0x2b'),_0x1161aa['uniqueid'],queues[_0x1161aa[_0x559d('0x4')]][_0x559d('0x1a')],queues[_0x1161aa[_0x559d('0x4')]][_0x559d('0x9')]));}}catch(_0x4f17f6){utils[_0x559d('0x14')](util[_0x559d('0x3')](_0x559d('0x29'),_0x1161aa[_0x559d('0x4')]),_0x4f17f6);}};exports['queuecallerleave']=function(_0x41c70c){try{if(!_['isNil'](queues[_0x41c70c[_0x559d('0x4')]])){utils[_0x559d('0x10')](util[_0x559d('0x3')](_0x559d('0x2c'),_0x41c70c[_0x559d('0x4')]),_0x41c70c);utils[_0x559d('0x2')](util[_0x559d('0x3')](_0x559d('0x2d'),_0x41c70c[_0x559d('0x4')],queues[_0x41c70c[_0x559d('0x4')]][_0x559d('0x1a')],_0x41c70c[_0x559d('0x2e')],_0x41c70c[_0x559d('0x2f')]));queues[_0x41c70c[_0x559d('0x4')]]['queuecallerleave']=!![];queues[_0x41c70c[_0x559d('0x4')]][_0x559d('0x17')]=utils[_0x559d('0x27')]();queues[_0x41c70c[_0x559d('0x4')]][_0x559d('0x30')]=utils[_0x559d('0x31')](queues[_0x41c70c[_0x559d('0x4')]][_0x559d('0x17')],queues[_0x41c70c[_0x559d('0x4')]]['queuecallerjoinAt']);queues[_0x41c70c[_0x559d('0x4')]][_0x559d('0x13')]=_0x41c70c[_0x559d('0x13')];queues[_0x41c70c['uniqueid']][_0x559d('0x32')]=_0x41c70c[_0x559d('0x32')];queues[_0x41c70c[_0x559d('0x4')]]['connectedlinenum']=_0x41c70c[_0x559d('0x2e')];queues[_0x41c70c[_0x559d('0x4')]][_0x559d('0x2f')]=_0x41c70c['connectedlinename'];}}catch(_0x3dad22){utils['error'](util[_0x559d('0x3')](_0x559d('0x2c'),_0x41c70c[_0x559d('0x4')]),_0x3dad22);}};exports['agentconnect']=function(_0xf7224c){try{if(!_[_0x559d('0x21')](queues[_0xf7224c['uniqueid']])){utils['debug'](util[_0x559d('0x3')](_0x559d('0x33'),_0xf7224c[_0x559d('0x4')]),_0xf7224c);utils[_0x559d('0x2')](util[_0x559d('0x3')](_0x559d('0x34'),_0xf7224c['uniqueid'],queues[_0xf7224c[_0x559d('0x4')]][_0x559d('0x1a')],_0xf7224c[_0x559d('0x35')],_0xf7224c[_0x559d('0x36')]));queues[_0xf7224c[_0x559d('0x4')]][_0x559d('0x18')]=![];queues[_0xf7224c[_0x559d('0x4')]]['queuecallerabandon']=![];queues[_0xf7224c['uniqueid']]['queuecallerabandonAt']=null;queues[_0xf7224c['uniqueid']][_0x559d('0x23')]=![];queues[_0xf7224c[_0x559d('0x4')]]['queuecallerexitreason']=null;queues[_0xf7224c[_0x559d('0x4')]][_0x559d('0x24')]=null;queues[_0xf7224c[_0x559d('0x4')]]['assigned']=!![];queues[_0xf7224c[_0x559d('0x4')]][_0x559d('0x8')]=_0xf7224c[_0x559d('0x36')];queues[_0xf7224c[_0x559d('0x4')]][_0x559d('0x7')]=_0xf7224c[_0x559d('0x35')];}}catch(_0x56c191){utils['error'](util[_0x559d('0x3')]('[%s][queues][agentconnect]',_0xf7224c[_0x559d('0x4')]),_0x56c191);}};exports['agentcomplete']=function(_0x217418){try{if(!_[_0x559d('0x21')](queues[_0x217418['uniqueid']])){if(queues[_0x217418['uniqueid']][_0x559d('0x17')]){utils[_0x559d('0x10')](util['format']('[%s][queues][agentcomplete]',_0x217418[_0x559d('0x4')]),_0x217418);queues[_0x217418[_0x559d('0x4')]][_0x559d('0x18')]=![];queues[_0x217418[_0x559d('0x4')]][_0x559d('0x18')]=![];queues[_0x217418[_0x559d('0x4')]]['queuecallerabandonAt']=null;queues[_0x217418[_0x559d('0x4')]][_0x559d('0x23')]=![];queues[_0x217418[_0x559d('0x4')]][_0x559d('0x24')]=null;queues[_0x217418[_0x559d('0x4')]][_0x559d('0x37')]=!![];queues[_0x217418[_0x559d('0x4')]][_0x559d('0x7')]=_0x217418[_0x559d('0x35')];queues[_0x217418[_0x559d('0x4')]][_0x559d('0x38')]=!![];queues[_0x217418[_0x559d('0x4')]][_0x559d('0x39')]=utils[_0x559d('0x27')]();if(_0x217418[_0x559d('0x3a')]==_0x559d('0x3b')){if(!queues[_0x217418[_0x559d('0x4')]][_0x559d('0x3b')]){queues[_0x217418[_0x559d('0x4')]][_0x559d('0x9')]='TRANSFER';}}else{queues[_0x217418['uniqueid']][_0x559d('0x9')]=_0x559d('0x3c')+_0x217418[_0x559d('0x3a')][_0x559d('0x1f')]();}utils[_0x559d('0x2')](util['format'](_0x559d('0x3d'),_0x217418[_0x559d('0x4')],queues[_0x217418[_0x559d('0x4')]]['name'],_0x217418[_0x559d('0x35')],queues[_0x217418[_0x559d('0x4')]][_0x559d('0x9')]));writeDB(queues[_0x217418[_0x559d('0x4')]]);}}}catch(_0xaeb840){utils[_0x559d('0x14')](util[_0x559d('0x3')]('[%s][queues][agentcomplete]',_0x217418[_0x559d('0x4')]),_0xaeb840);}};exports['blindtransfer']=function(_0xd4df6a){try{if(!_[_0x559d('0x21')](queues[_0xd4df6a[_0x559d('0x3e')]])){utils[_0x559d('0x10')](util['format'](_0x559d('0x3f'),_0xd4df6a['uniqueid']),_0xd4df6a);queues[_0xd4df6a['transfereeuniqueid']]['transfer']=!![];queues[_0xd4df6a[_0x559d('0x3e')]][_0x559d('0x40')]=_0x559d('0x41');queues[_0xd4df6a[_0x559d('0x3e')]][_0x559d('0x42')]=_0xd4df6a['extension'];queues[_0xd4df6a[_0x559d('0x3e')]]['transferuniqueid']=_0xd4df6a['transfereeuniqueid'];queues[_0xd4df6a['transfereeuniqueid']][_0x559d('0x9')]=_0x559d('0x43');utils[_0x559d('0x2')](util[_0x559d('0x3')](_0x559d('0x44'),_0xd4df6a[_0x559d('0x4')],queues[_0xd4df6a[_0x559d('0x3e')]][_0x559d('0x1a')],_0xd4df6a[_0x559d('0x3e')],_0xd4df6a[_0x559d('0x45')]));}}catch(_0x4ecad7){utils[_0x559d('0x14')](util[_0x559d('0x3')](_0x559d('0x3f'),_0xd4df6a[_0x559d('0x4')]),_0x4ecad7);}};exports[_0x559d('0x46')]=function(_0x11eb81){try{utils[_0x559d('0x10')](util[_0x559d('0x3')]('[%s][queues][attendedtransfer]',_0x11eb81[_0x559d('0x47')]),_0x11eb81);if(_0x11eb81[_0x559d('0x47')]==_0x11eb81[_0x559d('0x48')]){if(!_[_0x559d('0x21')](queues[_0x11eb81[_0x559d('0x49')]])){utils[_0x559d('0x2')](util[_0x559d('0x3')](_0x559d('0x4a'),_0x11eb81['origtransfereruniqueid'],queues[_0x11eb81[_0x559d('0x49')]][_0x559d('0x1a')],_0x11eb81[_0x559d('0x4b')]));queues[_0x11eb81[_0x559d('0x49')]][_0x559d('0x3b')]=!![];queues[_0x11eb81[_0x559d('0x49')]]['transfertype']=_0x559d('0x4c');queues[_0x11eb81['secondtransfererlinkedid']]['transferexten']=_0x11eb81['origtransfererexten'];queues[_0x11eb81[_0x559d('0x49')]][_0x559d('0x4d')]=_0x11eb81[_0x559d('0x47')];queues[_0x11eb81[_0x559d('0x49')]][_0x559d('0x9')]='ATTENDEDTRANSFER';}if(!_['isNil'](queues[_0x11eb81[_0x559d('0x48')]])){if(_0x11eb81['transfereelinkedid']&&queues[_0x11eb81[_0x559d('0x4e')]]){queues[_0x11eb81[_0x559d('0x4e')]][_0x559d('0x1b')]=0x1;queues[_0x11eb81['transfereeuniqueid']]=_[_0x559d('0x4f')](queues[_0x11eb81[_0x559d('0x4e')]]);queues[_0x11eb81[_0x559d('0x3e')]][_0x559d('0xe')]=_0x11eb81['transfertargetuniqueid'];queues[_0x11eb81['transfereeuniqueid']]['queuecallerenterreason']=0x2;queues[_0x11eb81[_0x559d('0x3e')]][_0x559d('0x50')]=queues[_0x11eb81[_0x559d('0x49')]][_0x559d('0x50')];queues[_0x11eb81[_0x559d('0x3e')]][_0x559d('0x51')]=queues[_0x11eb81[_0x559d('0x49')]][_0x559d('0x51')];queues[_0x11eb81[_0x559d('0x3e')]][_0x559d('0x52')]=utils['now']();queues[_0x11eb81[_0x559d('0x3e')]][_0x559d('0x17')]=utils[_0x559d('0x27')]();queues[_0x11eb81['transfereeuniqueid']][_0x559d('0x30')]=0x0;queues[_0x11eb81[_0x559d('0x3e')]][_0x559d('0x53')]=0x0;utils[_0x559d('0x2')](util['format'](_0x559d('0x54'),_0x11eb81['origtransfereruniqueid'],queues[_0x11eb81[_0x559d('0x3e')]][_0x559d('0x1a')],queues[_0x11eb81[_0x559d('0x3e')]][_0x559d('0x50')],queues[_0x11eb81[_0x559d('0x3e')]][_0x559d('0x51')]));}else{utils['info'](util[_0x559d('0x3')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x11eb81[_0x559d('0x47')],queues[_0x11eb81[_0x559d('0x48')]][_0x559d('0x1a')],_0x11eb81[_0x559d('0x49')]));queues[_0x11eb81[_0x559d('0x48')]][_0x559d('0xe')]=_0x11eb81[_0x559d('0x49')];}}}else if(_0x11eb81['secondtransfereruniqueid']==_0x11eb81['secondtransfererlinkedid']){if(!_[_0x559d('0x21')](queues[_0x11eb81[_0x559d('0x48')]])){utils[_0x559d('0x2')](util['format'](_0x559d('0x55'),_0x11eb81[_0x559d('0x47')],queues[_0x11eb81['origtransfererlinkedid']][_0x559d('0x1a')],_0x11eb81[_0x559d('0x56')],_0x11eb81[_0x559d('0x57')]));queues[_0x11eb81['origtransfererlinkedid']][_0x559d('0x3b')]=!![];queues[_0x11eb81[_0x559d('0x48')]][_0x559d('0x40')]=_0x559d('0x4c');queues[_0x11eb81[_0x559d('0x48')]][_0x559d('0x42')]=_0x11eb81[_0x559d('0x57')];queues[_0x11eb81[_0x559d('0x48')]]['transferuniqueid']=_0x11eb81['secondtransfereruniqueid'];queues[_0x11eb81['origtransfererlinkedid']][_0x559d('0x9')]=_0x559d('0x58');}if(!_[_0x559d('0x21')](queues[_0x11eb81[_0x559d('0x49')]])){if(_0x11eb81[_0x559d('0x59')]&&queues[_0x11eb81[_0x559d('0x59')]]){queues[_0x11eb81[_0x559d('0x59')]][_0x559d('0x1b')]=0x1;queues[_0x11eb81[_0x559d('0x5a')]]=_['clone'](queues[_0x11eb81[_0x559d('0x59')]]);queues[_0x11eb81['transfertargetuniqueid']]['transfereduniqueid']=_0x11eb81[_0x559d('0x5a')];queues[_0x11eb81['transfertargetuniqueid']]['queuecallerenterreason']=0x2;queues[_0x11eb81['transfertargetuniqueid']]['calleridnum']=queues[_0x11eb81[_0x559d('0x48')]][_0x559d('0x50')];queues[_0x11eb81[_0x559d('0x5a')]][_0x559d('0x51')]=queues[_0x11eb81[_0x559d('0x48')]][_0x559d('0x51')];queues[_0x11eb81[_0x559d('0x5a')]][_0x559d('0x52')]=utils[_0x559d('0x27')]();queues[_0x11eb81[_0x559d('0x5a')]][_0x559d('0x17')]=utils['now']();queues[_0x11eb81['transfertargetuniqueid']]['holdtime']=0x0;queues[_0x11eb81[_0x559d('0x5a')]][_0x559d('0x53')]=0x0;utils[_0x559d('0x2')](util[_0x559d('0x3')](_0x559d('0x5b'),_0x11eb81['origtransfereruniqueid'],queues[_0x11eb81['transfertargetuniqueid']][_0x559d('0x1a')],queues[_0x11eb81['transfertargetuniqueid']]['transfereduniqueid'],queues[_0x11eb81['transfertargetuniqueid']][_0x559d('0x50')],queues[_0x11eb81[_0x559d('0x5a')]][_0x559d('0x51')]));}else{utils[_0x559d('0x2')](util[_0x559d('0x3')]('[%s][queues][attendedtransfer]\x20name:%s\x20transfereduniqueid:%s',_0x11eb81[_0x559d('0x47')],queues[_0x11eb81[_0x559d('0x49')]][_0x559d('0x1a')],_0x11eb81['origtransfererlinkedid']));queues[_0x11eb81[_0x559d('0x49')]][_0x559d('0xe')]=_0x11eb81['origtransfererlinkedid'];}}}}catch(_0x24c171){utils['error'](util[_0x559d('0x3')](_0x559d('0x5c'),_0x11eb81[_0x559d('0x47')]),_0x24c171);}};exports[_0x559d('0x5d')]=function(_0x2251a9){try{if(!_[_0x559d('0x21')](queues[_0x2251a9[_0x559d('0x4')]])){utils[_0x559d('0x10')](util[_0x559d('0x3')]('[%s][queues][musiconholdstart]',_0x2251a9[_0x559d('0x4')]),_0x2251a9);queues[_0x2251a9[_0x559d('0x4')]][_0x559d('0x5e')]=utils[_0x559d('0x27')]();utils[_0x559d('0x2')](util[_0x559d('0x3')](_0x559d('0x5f'),_0x2251a9[_0x559d('0x4')],queues[_0x2251a9[_0x559d('0x4')]][_0x559d('0x1a')],queues[_0x2251a9['uniqueid']][_0x559d('0x5e')]));}}catch(_0x57c950){utils[_0x559d('0x14')](util['format'](_0x559d('0x60'),_0x2251a9[_0x559d('0x4')]),_0x57c950);}};exports[_0x559d('0x61')]=function(_0x2a0d1f){try{if(!_[_0x559d('0x21')](queues[_0x2a0d1f[_0x559d('0x4')]])){if(!_[_0x559d('0x21')](queues[_0x2a0d1f[_0x559d('0x4')]][_0x559d('0x5e')])){utils[_0x559d('0x10')](util[_0x559d('0x3')](_0x559d('0x62'),_0x2a0d1f['uniqueid']),_0x2a0d1f);queues[_0x2a0d1f['uniqueid']]['mohtime']+=utils[_0x559d('0x31')](utils[_0x559d('0x27')](),queues[_0x2a0d1f[_0x559d('0x4')]]['musiconholdstartAt']);utils[_0x559d('0x2')](util[_0x559d('0x3')](_0x559d('0x63'),_0x2a0d1f[_0x559d('0x4')],queues[_0x2a0d1f[_0x559d('0x4')]]['name'],queues[_0x2a0d1f['uniqueid']][_0x559d('0x53')]));delete queues[_0x2a0d1f[_0x559d('0x4')]]['musiconholdstartAt'];}}}catch(_0x2a850a){utils['error'](util[_0x559d('0x3')]('[%s][queues][musiconholdstop]',_0x2a0d1f[_0x559d('0x4')]),_0x2a850a);}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index ea08717..db38d5b 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 _0xc752=['[%s][recordings][queuecallerjoin]\x20queue:%s','queue','lodash','info','format','[%s][recordings][writeDB]','accountcode','getUserByInternal','then','membername','name','UserId','request','CreateVoiceRecording','newchannel','uniqueid','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','context','exten','channel','error','newstate','debug','[%s][recordings][newstate]','channelstate','[%s][recordings][newstate]\x20context:%s\x20channel:%s','isNil','linkedid','transfer','[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s','variable','mixmonitor_filename','[%s][recordings][varset]','[%s][recordings][varset]\x20variable:%s\x20value:%s','endsWith','value','.wav49','.WAV','monitors','push','hangup','[%s][recordings][hangup]','calleridnum','cause-txt','calleridname','connectedlinenum','connectedlinename','type','outbound','clone','newexten','[%s][recordings][newexten]','[%s][recordings][newexten]\x20application:%s\x20appdata:%s','appdata','application','set','startsWith','cdr','split','lastIndexOf','[%s][recordings][queuecallerjoin]'];(function(_0x4bf038,_0x15bef3){var _0x2e5e8a=function(_0x4101d0){while(--_0x4101d0){_0x4bf038['push'](_0x4bf038['shift']());}};_0x2e5e8a(++_0x15bef3);}(_0xc752,0xf6));var _0x2c75=function(_0x101659,_0x3509fa){_0x101659=_0x101659-0x0;var _0x26ca66=_0xc752[_0x101659];return _0x26ca66;};'use strict';var _=require(_0x2c75('0x0'));var util=require('util');var utils=require('./utils');var recordings={};function writeDB(_0x1074fd){utils[_0x2c75('0x1')](util[_0x2c75('0x2')](_0x2c75('0x3'),_0x1074fd['uniqueid']));if(_0x1074fd[_0x2c75('0x4')]){utils[_0x2c75('0x5')](_0x1074fd[_0x2c75('0x4')])[_0x2c75('0x6')](function(_0x251d9e){if(_0x251d9e){_0x1074fd[_0x2c75('0x7')]=_0x251d9e[_0x2c75('0x8')];_0x1074fd[_0x2c75('0x9')]=_0x251d9e['id'];}utils[_0x2c75('0xa')](_0x2c75('0xb'),_0x1074fd);});}else{utils[_0x2c75('0xa')](_0x2c75('0xb'),_0x1074fd);}}exports[_0x2c75('0xc')]=function(_0x52e8cd){try{utils['debug'](util[_0x2c75('0x2')]('[%s][recordings][newchannel]',_0x52e8cd['uniqueid']),_0x52e8cd);if(_0x52e8cd[_0x2c75('0xd')]==_0x52e8cd['linkedid']){utils['info'](util['format'](_0x2c75('0xe'),_0x52e8cd[_0x2c75('0xd')],_0x52e8cd[_0x2c75('0xf')],_0x52e8cd[_0x2c75('0x10')]));recordings[_0x52e8cd[_0x2c75('0xd')]]={'uniqueid':_0x52e8cd[_0x2c75('0xd')],'accountcode':_0x52e8cd['accountcode'],'exten':_0x52e8cd[_0x2c75('0x10')],'context':_0x52e8cd[_0x2c75('0xf')],'channel':_0x52e8cd[_0x2c75('0x11')],'monitors':[]};}}catch(_0x2ecd4d){utils[_0x2c75('0x12')](util[_0x2c75('0x2')]('[%s][recordings][newchannel]',_0x52e8cd['uniqueid']),_0x2ecd4d);}};exports[_0x2c75('0x13')]=function(_0x2ba91d){try{utils[_0x2c75('0x14')](util[_0x2c75('0x2')](_0x2c75('0x15'),_0x2ba91d['uniqueid']),_0x2ba91d);if(!_['isNil'](recordings[_0x2ba91d[_0x2c75('0xd')]])&&_0x2ba91d[_0x2c75('0x16')]==0x6){utils[_0x2c75('0x1')](util[_0x2c75('0x2')](_0x2c75('0x17'),_0x2ba91d[_0x2c75('0xd')],_0x2ba91d[_0x2c75('0xf')],_0x2ba91d[_0x2c75('0x11')]));}else if(!_[_0x2c75('0x18')](recordings[_0x2ba91d[_0x2c75('0x19')]])&&_0x2ba91d[_0x2c75('0x16')]==0x6&&_0x2ba91d[_0x2c75('0xf')]!=_0x2c75('0x1a')){utils[_0x2c75('0x1')](util[_0x2c75('0x2')](_0x2c75('0x1b'),_0x2ba91d['uniqueid'],_0x2ba91d['linkedid'],_0x2ba91d[_0x2c75('0xf')],_0x2ba91d[_0x2c75('0x11')]));recordings[_0x2ba91d[_0x2c75('0x19')]][_0x2c75('0x4')]=_0x2ba91d[_0x2c75('0x4')];}}catch(_0x5d4360){utils[_0x2c75('0x12')](util[_0x2c75('0x2')]('[%s][recordings][newstate]',_0x2ba91d[_0x2c75('0xd')]),_0x5d4360);}};exports['varset']=function(_0x128444){try{if(!_[_0x2c75('0x18')](_0x128444[_0x2c75('0x1c')])&&!_[_0x2c75('0x18')](_0x128444[_0x2c75('0x1c')][_0x2c75('0x1d')])){utils[_0x2c75('0x14')](util['format'](_0x2c75('0x1e'),_0x128444['uniqueid']),_0x128444);utils[_0x2c75('0x1')](util[_0x2c75('0x2')](_0x2c75('0x1f'),_0x128444[_0x2c75('0xd')],_0x128444[_0x2c75('0x1c')],_0x128444['value']));if(_[_0x2c75('0x20')](_0x128444['value'],'.wav49')){_0x128444[_0x2c75('0x21')]=_0x128444['value']['replace'](_0x2c75('0x22'),_0x2c75('0x23'));}if(recordings[_0x128444['linkedid']]){var _0x49d032=_['find'](recordings[_0x128444[_0x2c75('0x19')]]['monitors'],{'value':_0x128444[_0x2c75('0x21')]});if(_[_0x2c75('0x18')](_0x49d032)){recordings[_0x128444['linkedid']][_0x2c75('0x24')][_0x2c75('0x25')]({'value':_0x128444[_0x2c75('0x21')]});}}}}catch(_0x170c93){utils[_0x2c75('0x12')](util[_0x2c75('0x2')](_0x2c75('0x1e'),_0x128444[_0x2c75('0xd')]),_0x170c93);}};exports[_0x2c75('0x26')]=function(_0x38f90d){try{if(!_[_0x2c75('0x18')](recordings[_0x38f90d[_0x2c75('0xd')]])){utils[_0x2c75('0x14')](util[_0x2c75('0x2')](_0x2c75('0x27'),_0x38f90d[_0x2c75('0xd')]),_0x38f90d);utils[_0x2c75('0x1')](util[_0x2c75('0x2')]('[%s][recordings][hangup]\x20calleridnum:%s\x20calleridname:%s\x20reason:%s',_0x38f90d[_0x2c75('0xd')],_0x38f90d[_0x2c75('0x28')],_0x38f90d['calleridname'],_0x38f90d[_0x2c75('0x29')]));recordings[_0x38f90d[_0x2c75('0xd')]][_0x2c75('0x28')]=_0x38f90d[_0x2c75('0x28')];recordings[_0x38f90d[_0x2c75('0xd')]]['calleridname']=_0x38f90d[_0x2c75('0x2a')];recordings[_0x38f90d[_0x2c75('0xd')]][_0x2c75('0x2b')]=_0x38f90d[_0x2c75('0x2b')];recordings[_0x38f90d['uniqueid']][_0x2c75('0x2c')]=_0x38f90d[_0x2c75('0x2c')];if(recordings[_0x38f90d[_0x2c75('0xd')]][_0x2c75('0x2d')]==_0x2c75('0x2e')&&recordings[_0x38f90d[_0x2c75('0xd')]][_0x2c75('0x4')]){recordings[_0x38f90d['uniqueid']][_0x2c75('0x2b')]=recordings[_0x38f90d[_0x2c75('0xd')]][_0x2c75('0x4')];recordings[_0x38f90d[_0x2c75('0xd')]]['connectedlinename']='';}recordings[_0x38f90d[_0x2c75('0xd')]][_0x2c75('0x24')]['forEach'](function(_0x29ce3e){var _0x2366a7=_[_0x2c75('0x2f')](recordings[_0x38f90d[_0x2c75('0xd')]]);_0x2366a7['value']=_0x29ce3e[_0x2c75('0x21')];writeDB(_0x2366a7);});delete recordings[_0x38f90d['uniqueid']];}}catch(_0x356430){utils[_0x2c75('0x12')](util['format'](_0x2c75('0x27'),_0x38f90d[_0x2c75('0xd')]),_0x356430);}};exports[_0x2c75('0x30')]=function(_0x5c1124){try{if(!_[_0x2c75('0x18')](recordings[_0x5c1124[_0x2c75('0xd')]])){utils[_0x2c75('0x14')](util[_0x2c75('0x2')](_0x2c75('0x31'),_0x5c1124[_0x2c75('0xd')]),_0x5c1124);utils[_0x2c75('0x1')](util[_0x2c75('0x2')](_0x2c75('0x32'),_0x5c1124['uniqueid'],_0x5c1124['application'],_0x5c1124[_0x2c75('0x33')]));if(_0x5c1124[_0x2c75('0x34')]['toLowerCase']()==_0x2c75('0x35')&&_[_0x2c75('0x36')](_0x5c1124[_0x2c75('0x33')]['toLowerCase'](),_0x2c75('0x37'))){var _0x22eba=_0x5c1124[_0x2c75('0x33')][_0x2c75('0x38')]('=');var _0x4ce235=_0x22eba[0x0]['substring'](_0x22eba[0x0][_0x2c75('0x39')]('(')+0x1,_0x22eba[0x0][_0x2c75('0x39')](')'));var _0xc62588=_0x22eba[0x1];recordings[_0x5c1124[_0x2c75('0xd')]][_0x4ce235]=_0xc62588;}}}catch(_0x249bad){utils[_0x2c75('0x12')](util[_0x2c75('0x2')](_0x2c75('0x31'),_0x5c1124[_0x2c75('0xd')]),_0x249bad);}};exports['queuecallerjoin']=function(_0x5c90b5){try{if(!_[_0x2c75('0x18')](recordings[_0x5c90b5[_0x2c75('0xd')]])){utils[_0x2c75('0x14')](util[_0x2c75('0x2')](_0x2c75('0x3a'),_0x5c90b5[_0x2c75('0xd')]),_0x5c90b5);utils[_0x2c75('0x1')](util['format'](_0x2c75('0x3b'),_0x5c90b5['uniqueid'],_0x5c90b5[_0x2c75('0x3c')]));recordings[_0x5c90b5[_0x2c75('0xd')]][_0x2c75('0x3c')]=_0x5c90b5[_0x2c75('0x3c')];}}catch(_0x292b49){utils[_0x2c75('0x12')](util[_0x2c75('0x2')](_0x2c75('0x3a'),_0x5c90b5[_0x2c75('0xd')]),_0x292b49);}}; \ No newline at end of file +var _0x32eb=['util','./utils','info','[%s][recordings][writeDB]','uniqueid','getUserByInternal','accountcode','membername','name','UserId','CreateVoiceRecording','newchannel','debug','[%s][recordings][newchannel]','linkedid','format','[%s][recordings][newchannel]\x20context:%s\x20exten:%s','exten','context','channel','error','[%s][recordings][newstate]','isNil','channelstate','transfer','varset','variable','mixmonitor_filename','[%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','cause-txt','connectedlinenum','connectedlinename','type','outbound','forEach','clone','newexten','application','appdata','set','startsWith','toLowerCase','cdr','split','substring','lastIndexOf','[%s][recordings][newexten]','queuecallerjoin','[%s][recordings][queuecallerjoin]\x20queue:%s','queue','[%s][recordings][queuecallerjoin]','lodash'];(function(_0x13d399,_0x3d572e){var _0x1d0622=function(_0x560fec){while(--_0x560fec){_0x13d399['push'](_0x13d399['shift']());}};_0x1d0622(++_0x3d572e);}(_0x32eb,0x83));var _0xb32e=function(_0x57d0dc,_0x387f3e){_0x57d0dc=_0x57d0dc-0x0;var _0x177765=_0x32eb[_0x57d0dc];return _0x177765;};'use strict';var _=require(_0xb32e('0x0'));var util=require(_0xb32e('0x1'));var utils=require(_0xb32e('0x2'));var recordings={};function writeDB(_0x4ad913){utils[_0xb32e('0x3')](util['format'](_0xb32e('0x4'),_0x4ad913[_0xb32e('0x5')]));if(_0x4ad913['accountcode']){utils[_0xb32e('0x6')](_0x4ad913[_0xb32e('0x7')])['then'](function(_0x104059){if(_0x104059){_0x4ad913[_0xb32e('0x8')]=_0x104059[_0xb32e('0x9')];_0x4ad913[_0xb32e('0xa')]=_0x104059['id'];}utils['request']('CreateVoiceRecording',_0x4ad913);});}else{utils['request'](_0xb32e('0xb'),_0x4ad913);}}exports[_0xb32e('0xc')]=function(_0xfca926){try{utils[_0xb32e('0xd')](util['format'](_0xb32e('0xe'),_0xfca926[_0xb32e('0x5')]),_0xfca926);if(_0xfca926[_0xb32e('0x5')]==_0xfca926[_0xb32e('0xf')]){utils[_0xb32e('0x3')](util[_0xb32e('0x10')](_0xb32e('0x11'),_0xfca926['uniqueid'],_0xfca926['context'],_0xfca926['exten']));recordings[_0xfca926['uniqueid']]={'uniqueid':_0xfca926['uniqueid'],'accountcode':_0xfca926[_0xb32e('0x7')],'exten':_0xfca926[_0xb32e('0x12')],'context':_0xfca926[_0xb32e('0x13')],'channel':_0xfca926[_0xb32e('0x14')],'monitors':[]};}}catch(_0x5c9ea8){utils[_0xb32e('0x15')](util['format'](_0xb32e('0xe'),_0xfca926[_0xb32e('0x5')]),_0x5c9ea8);}};exports['newstate']=function(_0x310f21){try{utils[_0xb32e('0xd')](util[_0xb32e('0x10')](_0xb32e('0x16'),_0x310f21[_0xb32e('0x5')]),_0x310f21);if(!_[_0xb32e('0x17')](recordings[_0x310f21[_0xb32e('0x5')]])&&_0x310f21[_0xb32e('0x18')]==0x6){utils[_0xb32e('0x3')](util['format']('[%s][recordings][newstate]\x20context:%s\x20channel:%s',_0x310f21[_0xb32e('0x5')],_0x310f21[_0xb32e('0x13')],_0x310f21[_0xb32e('0x14')]));}else if(!_[_0xb32e('0x17')](recordings[_0x310f21['linkedid']])&&_0x310f21[_0xb32e('0x18')]==0x6&&_0x310f21[_0xb32e('0x13')]!=_0xb32e('0x19')){utils['info'](util[_0xb32e('0x10')]('[%s][recordings][newstate]\x20linkedid:%s\x20context:%s\x20channel:%s',_0x310f21[_0xb32e('0x5')],_0x310f21[_0xb32e('0xf')],_0x310f21[_0xb32e('0x13')],_0x310f21[_0xb32e('0x14')]));recordings[_0x310f21[_0xb32e('0xf')]][_0xb32e('0x7')]=_0x310f21[_0xb32e('0x7')];}}catch(_0x394810){utils[_0xb32e('0x15')](util['format']('[%s][recordings][newstate]',_0x310f21['uniqueid']),_0x394810);}};exports[_0xb32e('0x1a')]=function(_0x1748dd){try{if(!_[_0xb32e('0x17')](_0x1748dd[_0xb32e('0x1b')])&&!_['isNil'](_0x1748dd[_0xb32e('0x1b')][_0xb32e('0x1c')])){utils[_0xb32e('0xd')](util[_0xb32e('0x10')](_0xb32e('0x1d'),_0x1748dd[_0xb32e('0x5')]),_0x1748dd);utils[_0xb32e('0x3')](util[_0xb32e('0x10')](_0xb32e('0x1e'),_0x1748dd[_0xb32e('0x5')],_0x1748dd[_0xb32e('0x1b')],_0x1748dd[_0xb32e('0x1f')]));if(_[_0xb32e('0x20')](_0x1748dd[_0xb32e('0x1f')],_0xb32e('0x21'))){_0x1748dd[_0xb32e('0x1f')]=_0x1748dd['value'][_0xb32e('0x22')](_0xb32e('0x21'),_0xb32e('0x23'));}if(recordings[_0x1748dd[_0xb32e('0xf')]]){var _0x109d48=_[_0xb32e('0x24')](recordings[_0x1748dd[_0xb32e('0xf')]]['monitors'],{'value':_0x1748dd[_0xb32e('0x1f')]});if(_[_0xb32e('0x17')](_0x109d48)){recordings[_0x1748dd[_0xb32e('0xf')]][_0xb32e('0x25')][_0xb32e('0x26')]({'value':_0x1748dd[_0xb32e('0x1f')]});}}}}catch(_0x4e9e59){utils[_0xb32e('0x15')](util[_0xb32e('0x10')](_0xb32e('0x1d'),_0x1748dd[_0xb32e('0x5')]),_0x4e9e59);}};exports[_0xb32e('0x27')]=function(_0x4ec526){try{if(!_[_0xb32e('0x17')](recordings[_0x4ec526[_0xb32e('0x5')]])){utils[_0xb32e('0xd')](util[_0xb32e('0x10')](_0xb32e('0x28'),_0x4ec526['uniqueid']),_0x4ec526);utils[_0xb32e('0x3')](util[_0xb32e('0x10')](_0xb32e('0x29'),_0x4ec526[_0xb32e('0x5')],_0x4ec526[_0xb32e('0x2a')],_0x4ec526[_0xb32e('0x2b')],_0x4ec526[_0xb32e('0x2c')]));recordings[_0x4ec526[_0xb32e('0x5')]][_0xb32e('0x2a')]=_0x4ec526[_0xb32e('0x2a')];recordings[_0x4ec526[_0xb32e('0x5')]][_0xb32e('0x2b')]=_0x4ec526[_0xb32e('0x2b')];recordings[_0x4ec526[_0xb32e('0x5')]][_0xb32e('0x2d')]=_0x4ec526['connectedlinenum'];recordings[_0x4ec526[_0xb32e('0x5')]][_0xb32e('0x2e')]=_0x4ec526[_0xb32e('0x2e')];if(recordings[_0x4ec526[_0xb32e('0x5')]][_0xb32e('0x2f')]==_0xb32e('0x30')&&recordings[_0x4ec526[_0xb32e('0x5')]][_0xb32e('0x7')]){recordings[_0x4ec526['uniqueid']][_0xb32e('0x2d')]=recordings[_0x4ec526[_0xb32e('0x5')]][_0xb32e('0x7')];recordings[_0x4ec526[_0xb32e('0x5')]][_0xb32e('0x2e')]='';}recordings[_0x4ec526[_0xb32e('0x5')]][_0xb32e('0x25')][_0xb32e('0x31')](function(_0x269edf){var _0x1dcf60=_[_0xb32e('0x32')](recordings[_0x4ec526[_0xb32e('0x5')]]);_0x1dcf60[_0xb32e('0x1f')]=_0x269edf[_0xb32e('0x1f')];writeDB(_0x1dcf60);});delete recordings[_0x4ec526['uniqueid']];}}catch(_0x56e877){utils['error'](util[_0xb32e('0x10')]('[%s][recordings][hangup]',_0x4ec526[_0xb32e('0x5')]),_0x56e877);}};exports[_0xb32e('0x33')]=function(_0x29f14a){try{if(!_[_0xb32e('0x17')](recordings[_0x29f14a[_0xb32e('0x5')]])){utils[_0xb32e('0xd')](util['format']('[%s][recordings][newexten]',_0x29f14a[_0xb32e('0x5')]),_0x29f14a);utils['info'](util[_0xb32e('0x10')]('[%s][recordings][newexten]\x20application:%s\x20appdata:%s',_0x29f14a[_0xb32e('0x5')],_0x29f14a[_0xb32e('0x34')],_0x29f14a[_0xb32e('0x35')]));if(_0x29f14a['application']['toLowerCase']()==_0xb32e('0x36')&&_[_0xb32e('0x37')](_0x29f14a[_0xb32e('0x35')][_0xb32e('0x38')](),_0xb32e('0x39'))){var _0x47b688=_0x29f14a[_0xb32e('0x35')][_0xb32e('0x3a')]('=');var _0x4fd963=_0x47b688[0x0][_0xb32e('0x3b')](_0x47b688[0x0][_0xb32e('0x3c')]('(')+0x1,_0x47b688[0x0]['lastIndexOf'](')'));var _0x2d9265=_0x47b688[0x1];recordings[_0x29f14a[_0xb32e('0x5')]][_0x4fd963]=_0x2d9265;}}}catch(_0x19cbf8){utils[_0xb32e('0x15')](util['format'](_0xb32e('0x3d'),_0x29f14a[_0xb32e('0x5')]),_0x19cbf8);}};exports[_0xb32e('0x3e')]=function(_0x2bd68c){try{if(!_[_0xb32e('0x17')](recordings[_0x2bd68c[_0xb32e('0x5')]])){utils['debug'](util[_0xb32e('0x10')]('[%s][recordings][queuecallerjoin]',_0x2bd68c[_0xb32e('0x5')]),_0x2bd68c);utils[_0xb32e('0x3')](util['format'](_0xb32e('0x3f'),_0x2bd68c[_0xb32e('0x5')],_0x2bd68c['queue']));recordings[_0x2bd68c[_0xb32e('0x5')]]['queue']=_0x2bd68c[_0xb32e('0x40')];}}catch(_0x20fa31){utils['error'](util[_0xb32e('0x10')](_0xb32e('0x41'),_0x2bd68c['uniqueid']),_0x20fa31);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index ffb0261..7b06f67 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 _0x5ede=['transferercalleridname','transfereecalleridnum','blind','blinds','transfereruniqueid','attendedtransfer','[%s][transfers][attendedtransfer]','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','assign','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','origtransfererexten','isNil','transfertargetchannel','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetlinkedid','error','lodash','util','./utils','info','format','[%s][transfers][writeDB]\x20type:%s','type','attended','origtransfereruniqueid','request','blindtransfer','debug','[%s][transfers][blindtransfer]','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','uniqueid','transferercalleridnum'];(function(_0x3443b3,_0x308277){var _0x23eddb=function(_0x1aca07){while(--_0x1aca07){_0x3443b3['push'](_0x3443b3['shift']());}};_0x23eddb(++_0x308277);}(_0x5ede,0x6e));var _0xe5ed=function(_0x4df6ba,_0x477c3e){_0x4df6ba=_0x4df6ba-0x0;var _0x472acf=_0x5ede[_0x4df6ba];return _0x472acf;};'use strict';var _=require(_0xe5ed('0x0'));var util=require(_0xe5ed('0x1'));var utils=require(_0xe5ed('0x2'));function writeDB(_0x5d0e74){utils[_0xe5ed('0x3')](util[_0xe5ed('0x4')](_0xe5ed('0x5'),_0x5d0e74[_0xe5ed('0x6')]===_0xe5ed('0x7')?_0x5d0e74[_0xe5ed('0x8')]:_0x5d0e74['uniqueid'],_0x5d0e74['type']));utils[_0xe5ed('0x9')]('CreateVoiceTransferReport',_0x5d0e74);}exports['blinds']={};exports[_0xe5ed('0xa')]=function(_0x1374bf){try{utils[_0xe5ed('0xb')](util[_0xe5ed('0x4')](_0xe5ed('0xc'),_0x1374bf['uniqueid']),_0x1374bf);utils[_0xe5ed('0x3')](util[_0xe5ed('0x4')](_0xe5ed('0xd'),_0x1374bf[_0xe5ed('0xe')],_0x1374bf[_0xe5ed('0xf')],_0x1374bf[_0xe5ed('0x10')],_0x1374bf[_0xe5ed('0x11')],_0x1374bf['transfereecalleridname']));_0x1374bf[_0xe5ed('0x6')]=_0xe5ed('0x12');exports[_0xe5ed('0x13')][_0x1374bf[_0xe5ed('0x14')]]=_0x1374bf;writeDB(_0x1374bf);}catch(_0x5c52ff){utils['error'](util[_0xe5ed('0x4')](_0xe5ed('0xc'),_0x1374bf[_0xe5ed('0xe')]),_0x5c52ff);}};exports[_0xe5ed('0x15')]=function(_0xd258e1){try{utils[_0xe5ed('0xb')](util[_0xe5ed('0x4')](_0xe5ed('0x16'),_0xd258e1[_0xe5ed('0x8')]),_0xd258e1);utils[_0xe5ed('0x3')](util[_0xe5ed('0x4')](_0xe5ed('0x17'),_0xd258e1['origtransfereruniqueid'],_0xd258e1[_0xe5ed('0x18')],_0xd258e1[_0xe5ed('0x19')],_0xd258e1[_0xe5ed('0x1a')],_0xd258e1['transfertargetcalleridname']));_0xd258e1=_[_0xe5ed('0x1b')](_0xd258e1,{'transfererchannel':_0xd258e1['origtransfererchannel'],'transferercalleridnum':_0xd258e1[_0xe5ed('0x18')],'transferercalleridname':_0xd258e1[_0xe5ed('0x19')],'transfererconnectedlinenum':_0xd258e1[_0xe5ed('0x1c')],'transfererconnectedlinename':_0xd258e1[_0xe5ed('0x1d')],'transfereraccountcode':_0xd258e1[_0xe5ed('0x1e')],'transferercontext':_0xd258e1[_0xe5ed('0x1f')],'transfererexten':_0xd258e1['secondtransfererexten'],'transfererlinkedid':_0xd258e1['origtransfererlinkedid'],'context':_0xd258e1['origtransferercontext'],'extension':_0xd258e1[_0xe5ed('0x20')],'type':_0xe5ed('0x7')});if(_[_0xe5ed('0x21')](_0xd258e1['transfereechannel'])){_0xd258e1=_[_0xe5ed('0x1b')](_0xd258e1,{'transfereechannel':_0xd258e1[_0xe5ed('0x22')],'transfereecalleridnum':_0xd258e1[_0xe5ed('0x1a')],'transfereecalleridname':_0xd258e1[_0xe5ed('0x23')],'transfereeconnectedlinenum':_0xd258e1[_0xe5ed('0x24')],'transfereeconnectedlinename':_0xd258e1[_0xe5ed('0x25')],'transfereeaccountcode':_0xd258e1[_0xe5ed('0x26')],'transfereecontext':_0xd258e1[_0xe5ed('0x27')],'transfereeexten':_0xd258e1['transfertargetexten'],'transfereelinkedid':_0xd258e1[_0xe5ed('0x28')]});}writeDB(_0xd258e1);}catch(_0x893325){utils[_0xe5ed('0x29')](util[_0xe5ed('0x4')]('[%s][transfers][attendedtransfer]',_0xd258e1['origtransfereruniqueid']),_0x893325);}}; \ No newline at end of file +var _0xb539=['[%s][transfers][attendedtransfer]','origtransfereruniqueid','[%s][transfers][attendedtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','origtransferercalleridnum','origtransferercalleridname','transfertargetcalleridnum','transfertargetcalleridname','origtransfererchannel','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransfererexten','isNil','transfereechannel','assign','transfertargetchannel','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetexten','util','[%s][transfers][writeDB]\x20type:%s','type','attended','request','CreateVoiceTransferReport','blindtransfer','debug','[%s][transfers][blindtransfer]','info','[%s][transfers][blindtransfer]\x20transferercalleridnum:%s\x20transferercalleridname:%s\x20transfereecalleridnum:%s\x20transfereecalleridname:%s','uniqueid','transferercalleridnum','transferercalleridname','transfereecalleridname','blind','blinds','transfereruniqueid','error','format','attendedtransfer'];(function(_0xdce170,_0x188450){var _0x313344=function(_0x36874c){while(--_0x36874c){_0xdce170['push'](_0xdce170['shift']());}};_0x313344(++_0x188450);}(_0xb539,0x165));var _0x9b53=function(_0x10ea76,_0x507f0c){_0x10ea76=_0x10ea76-0x0;var _0x748ae1=_0xb539[_0x10ea76];return _0x748ae1;};'use strict';var _=require('lodash');var util=require(_0x9b53('0x0'));var utils=require('./utils');function writeDB(_0x1aadda){utils['info'](util['format'](_0x9b53('0x1'),_0x1aadda[_0x9b53('0x2')]===_0x9b53('0x3')?_0x1aadda['origtransfereruniqueid']:_0x1aadda['uniqueid'],_0x1aadda[_0x9b53('0x2')]));utils[_0x9b53('0x4')](_0x9b53('0x5'),_0x1aadda);}exports['blinds']={};exports[_0x9b53('0x6')]=function(_0x7d1b57){try{utils[_0x9b53('0x7')](util['format'](_0x9b53('0x8'),_0x7d1b57['uniqueid']),_0x7d1b57);utils[_0x9b53('0x9')](util['format'](_0x9b53('0xa'),_0x7d1b57[_0x9b53('0xb')],_0x7d1b57[_0x9b53('0xc')],_0x7d1b57[_0x9b53('0xd')],_0x7d1b57['transfereecalleridnum'],_0x7d1b57[_0x9b53('0xe')]));_0x7d1b57[_0x9b53('0x2')]=_0x9b53('0xf');exports[_0x9b53('0x10')][_0x7d1b57[_0x9b53('0x11')]]=_0x7d1b57;writeDB(_0x7d1b57);}catch(_0x5df291){utils[_0x9b53('0x12')](util[_0x9b53('0x13')]('[%s][transfers][blindtransfer]',_0x7d1b57[_0x9b53('0xb')]),_0x5df291);}};exports[_0x9b53('0x14')]=function(_0x32d0bb){try{utils[_0x9b53('0x7')](util[_0x9b53('0x13')](_0x9b53('0x15'),_0x32d0bb[_0x9b53('0x16')]),_0x32d0bb);utils[_0x9b53('0x9')](util[_0x9b53('0x13')](_0x9b53('0x17'),_0x32d0bb[_0x9b53('0x16')],_0x32d0bb[_0x9b53('0x18')],_0x32d0bb[_0x9b53('0x19')],_0x32d0bb[_0x9b53('0x1a')],_0x32d0bb[_0x9b53('0x1b')]));_0x32d0bb=_['assign'](_0x32d0bb,{'transfererchannel':_0x32d0bb[_0x9b53('0x1c')],'transferercalleridnum':_0x32d0bb[_0x9b53('0x18')],'transferercalleridname':_0x32d0bb[_0x9b53('0x19')],'transfererconnectedlinenum':_0x32d0bb['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x32d0bb['secondtransfererconnectedlinename'],'transfereraccountcode':_0x32d0bb[_0x9b53('0x1d')],'transferercontext':_0x32d0bb[_0x9b53('0x1e')],'transfererexten':_0x32d0bb[_0x9b53('0x1f')],'transfererlinkedid':_0x32d0bb[_0x9b53('0x20')],'context':_0x32d0bb['origtransferercontext'],'extension':_0x32d0bb[_0x9b53('0x21')],'type':'attended'});if(_[_0x9b53('0x22')](_0x32d0bb[_0x9b53('0x23')])){_0x32d0bb=_[_0x9b53('0x24')](_0x32d0bb,{'transfereechannel':_0x32d0bb[_0x9b53('0x25')],'transfereecalleridnum':_0x32d0bb['transfertargetcalleridnum'],'transfereecalleridname':_0x32d0bb[_0x9b53('0x1b')],'transfereeconnectedlinenum':_0x32d0bb[_0x9b53('0x26')],'transfereeconnectedlinename':_0x32d0bb[_0x9b53('0x27')],'transfereeaccountcode':_0x32d0bb[_0x9b53('0x28')],'transfereecontext':_0x32d0bb['transfertargetcontext'],'transfereeexten':_0x32d0bb[_0x9b53('0x29')],'transfereelinkedid':_0x32d0bb['transfertargetlinkedid']});}writeDB(_0x32d0bb);}catch(_0x455c5c){utils[_0x9b53('0x12')](util[_0x9b53('0x13')](_0x9b53('0x15'),_0x32d0bb[_0x9b53('0x16')]),_0x455c5c);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index d2a59c8..5a3a373 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 _0x9c0b=['found','[utils][getUserByInternal]','getUserByInterface','[utils][getUserByInterface]\x20interface:%s\x20%s','getUserByName','[utils][getUserByName]\x20name:%s\x20%s','notfound','[utils][getUserByName]','getVoiceQueueByName','type','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','length','[utils][getVoiceQueueByName]','addTime','add','seconds','YYYY-MM-DD\x20HH:mm:ss','subtractTime','format','diffTime','diff','isAfter','isBefore','bluebird','jayson/promise','util','client','../../config/logger','info','inspect','debug','error','request','then','[utils][request]\x20name:%s','catch','GetUser','name','interface','[utils][getUser]\x20where:%s','stringify','result','getUserByInternal'];(function(_0x16d345,_0x13c7c8){var _0x293935=function(_0x307dbd){while(--_0x307dbd){_0x16d345['push'](_0x16d345['shift']());}};_0x293935(++_0x13c7c8);}(_0x9c0b,0xc8));var _0xb9c0=function(_0xd6640b,_0x475e47){_0xd6640b=_0xd6640b-0x0;var _0x4c843e=_0x9c0b[_0xd6640b];return _0x4c843e;};'use strict';var BPromise=require(_0xb9c0('0x0'));var jayson=require(_0xb9c0('0x1'));var moment=require('moment');var util=require(_0xb9c0('0x2'));var client=jayson[_0xb9c0('0x3')]['http']({'port':0x2329});var logger=require(_0xb9c0('0x4'))('xdr');exports[_0xb9c0('0x5')]=function(_0x2a461a,_0x30068b){logger['info'](_0x2a461a,_0x30068b?util[_0xb9c0('0x6')](_0x30068b,{'showHidden':![],'depth':null}):'');};exports[_0xb9c0('0x7')]=function(_0x2c3272,_0x4556dc){logger[_0xb9c0('0x7')](_0x2c3272,_0x4556dc?util[_0xb9c0('0x6')](_0x4556dc,{'showHidden':![],'depth':null}):'');};exports['error']=function(_0x21b5ba,_0x3273ba){logger[_0xb9c0('0x8')](_0x21b5ba,_0x3273ba?util[_0xb9c0('0x6')](_0x3273ba,{'showHidden':![],'depth':null}):'');};exports[_0xb9c0('0x9')]=function(_0x4310a2,_0x126fee){return client[_0xb9c0('0x9')](_0x4310a2,{'body':_0x126fee})[_0xb9c0('0xa')](function(_0x3ccf17){logger[_0xb9c0('0x7')](_0xb9c0('0xb'),_0x4310a2,_0x3ccf17?util[_0xb9c0('0x6')](_0x3ccf17,{'showHidden':![],'depth':null}):'');})[_0xb9c0('0xc')](function(_0x17973f){logger['error'](_0xb9c0('0xb'),_0x4310a2,_0x17973f?util[_0xb9c0('0x6')](_0x17973f,{'showHidden':![],'depth':null}):'');});};function getUser(_0x2194c1){return client[_0xb9c0('0x9')](_0xb9c0('0xd'),{'options':{'raw':!![],'attributes':['id','internal',_0xb9c0('0xe'),_0xb9c0('0xf')],'where':_0x2194c1,'limit':0x1}})[_0xb9c0('0xa')](function(_0x550e02){logger['debug'](_0xb9c0('0x10'),JSON[_0xb9c0('0x11')](_0x2194c1),_0x550e02?util[_0xb9c0('0x6')](_0x550e02,{'showHidden':![],'depth':null}):'');return _0x550e02[_0xb9c0('0x12')]['length']?_0x550e02[_0xb9c0('0x12')][0x0]:null;});}exports[_0xb9c0('0x13')]=function(_0x106369){return new BPromise(function(_0x2fd9ad,_0x2bb45b){if(_0x106369){return getUser({'internal':_0x106369})[_0xb9c0('0xa')](function(_0x3b33cf){logger[_0xb9c0('0x5')]('[utils][getUserByInternal]\x20internal:%s\x20%s',_0x106369,_0x3b33cf?_0xb9c0('0x14'):'notfound');return _0x2fd9ad(_0x3b33cf);})[_0xb9c0('0xc')](function(_0x2390fc){logger[_0xb9c0('0x8')](_0xb9c0('0x15'),_0x2390fc?util[_0xb9c0('0x6')](_0x2390fc,{'showHidden':![],'depth':null}):'');return _0x2fd9ad(null);});}return _0x2fd9ad(null);});};exports[_0xb9c0('0x16')]=function(_0x4cae21){return new BPromise(function(_0x4c45ce,_0x3c10c6){if(_0x4cae21){return getUser({'interface':_0x4cae21})[_0xb9c0('0xa')](function(_0x1dbec3){logger['info'](_0xb9c0('0x17'),_0x4cae21,_0x1dbec3?'found':'notfound');return _0x4c45ce(_0x1dbec3);})[_0xb9c0('0xc')](function(_0xc26998){logger[_0xb9c0('0x8')]('[utils][getUserByInterface]',_0xc26998?util[_0xb9c0('0x6')](_0xc26998,{'showHidden':![],'depth':null}):'');return _0x4c45ce(null);});}return _0x4c45ce(null);});};exports[_0xb9c0('0x18')]=function(_0x1eaa30){return new BPromise(function(_0xf786ab,_0x58c989){if(_0x1eaa30){return getUser({'name':_0x1eaa30})[_0xb9c0('0xa')](function(_0x1eb64e){logger[_0xb9c0('0x5')](_0xb9c0('0x19'),_0x1eaa30,_0x1eb64e?_0xb9c0('0x14'):_0xb9c0('0x1a'));return _0xf786ab(_0x1eb64e);})[_0xb9c0('0xc')](function(_0x2b1558){logger[_0xb9c0('0x8')](_0xb9c0('0x1b'),_0x2b1558?util[_0xb9c0('0x6')](_0x2b1558,{'showHidden':![],'depth':null}):'');return _0xf786ab(null);});}return _0xf786ab(null);});};exports[_0xb9c0('0x1c')]=function(_0x4ddd29){return new BPromise(function(_0x4b5cbb,_0x3e1d05){if(_0x4ddd29){return client['request']('GetVoiceQueue',{'options':{'raw':!![],'attributes':['id',_0xb9c0('0xe'),_0xb9c0('0x1d'),'acw','acwTimeout'],'where':{'name':_0x4ddd29},'limit':0x1}})[_0xb9c0('0xa')](function(_0xd1a6cf){logger[_0xb9c0('0x7')](_0xb9c0('0x1e'),_0x4ddd29,_0xd1a6cf?util[_0xb9c0('0x6')](_0xd1a6cf,{'showHidden':![],'depth':null}):'');logger['info'](_0xb9c0('0x1f'),_0x4ddd29,_0xd1a6cf?_0xb9c0('0x14'):_0xb9c0('0x1a'));return _0x4b5cbb(_0xd1a6cf['result'][_0xb9c0('0x20')]?_0xd1a6cf[_0xb9c0('0x12')][0x0]:null);})[_0xb9c0('0xc')](function(_0x277ccd){logger[_0xb9c0('0x8')](_0xb9c0('0x21'),_0x277ccd?util[_0xb9c0('0x6')](_0x277ccd,{'showHidden':![],'depth':null}):'');return _0x4b5cbb(null);});}return _0x4b5cbb(null);});};exports[_0xb9c0('0x22')]=function(_0xf29a60,_0x485756){return moment(_0xf29a60)[_0xb9c0('0x23')](_0x485756,_0xb9c0('0x24'))['format'](_0xb9c0('0x25'));};exports[_0xb9c0('0x26')]=function(_0x3ac35a,_0x33b62f){return moment(_0x3ac35a)['subtract'](_0x33b62f,_0xb9c0('0x24'))[_0xb9c0('0x27')](_0xb9c0('0x25'));};exports[_0xb9c0('0x28')]=function(_0x41c4cd,_0x1c8e1e){return moment(_0x41c4cd)[_0xb9c0('0x29')](moment(_0x1c8e1e),_0xb9c0('0x24'));};exports['sumTime']=function(_0x173fbd,_0x266271){return parseInt(_0x173fbd,0xa)+parseInt(_0x266271,0xa);};exports['now']=function(){return moment()[_0xb9c0('0x27')](_0xb9c0('0x25'));};exports['isAfter']=function(_0x27c1a0,_0x29697b){if(_0x29697b){return moment(_0x27c1a0)[_0xb9c0('0x2a')](_0x29697b);}return!![];};exports[_0xb9c0('0x2b')]=function(_0x3b4030,_0x49cfa9){if(_0x49cfa9){return moment(_0x3b4030)['isBefore'](_0x49cfa9);}else if(_0x3b4030){return!![];}return![];}; \ No newline at end of file +var _0x48ba=['moment','util','client','http','../../config/logger','info','debug','error','request','[utils][request]\x20name:%s','inspect','catch','GetUser','interface','then','result','length','getUserByInternal','[utils][getUserByInternal]\x20internal:%s\x20%s','[utils][getUserByInterface]\x20interface:%s\x20%s','notfound','[utils][getUserByInterface]','getUserByName','found','[utils][getUserByName]','getVoiceQueueByName','GetVoiceQueue','name','type','acw','acwTimeout','[utils][getVoiceQueueByName]\x20name:%s','[utils][getVoiceQueueByName]\x20name:%s\x20%s','[utils][getVoiceQueueByName]','addTime','add','seconds','subtractTime','format','YYYY-MM-DD\x20HH:mm:ss','diffTime','diff','sumTime','isAfter','isBefore','jayson/promise'];(function(_0x1ce33f,_0x10f49c){var _0x3ed506=function(_0x42c57b){while(--_0x42c57b){_0x1ce33f['push'](_0x1ce33f['shift']());}};_0x3ed506(++_0x10f49c);}(_0x48ba,0x89));var _0xa48b=function(_0x234c55,_0x4a4980){_0x234c55=_0x234c55-0x0;var _0x4474c6=_0x48ba[_0x234c55];return _0x4474c6;};'use strict';var BPromise=require('bluebird');var jayson=require(_0xa48b('0x0'));var moment=require(_0xa48b('0x1'));var util=require(_0xa48b('0x2'));var client=jayson[_0xa48b('0x3')][_0xa48b('0x4')]({'port':0x2329});var logger=require(_0xa48b('0x5'))('xdr');exports[_0xa48b('0x6')]=function(_0x4b7ab7,_0x2857a1){logger[_0xa48b('0x6')](_0x4b7ab7,_0x2857a1?util['inspect'](_0x2857a1,{'showHidden':![],'depth':null}):'');};exports[_0xa48b('0x7')]=function(_0x3a23ad,_0x1cabca){logger['debug'](_0x3a23ad,_0x1cabca?util['inspect'](_0x1cabca,{'showHidden':![],'depth':null}):'');};exports['error']=function(_0x2ebd5f,_0x27614b){logger[_0xa48b('0x8')](_0x2ebd5f,_0x27614b?util['inspect'](_0x27614b,{'showHidden':![],'depth':null}):'');};exports[_0xa48b('0x9')]=function(_0x5f221a,_0x106273){return client[_0xa48b('0x9')](_0x5f221a,{'body':_0x106273})['then'](function(_0x27ab36){logger[_0xa48b('0x7')](_0xa48b('0xa'),_0x5f221a,_0x27ab36?util[_0xa48b('0xb')](_0x27ab36,{'showHidden':![],'depth':null}):'');})[_0xa48b('0xc')](function(_0x56b53d){logger['error'](_0xa48b('0xa'),_0x5f221a,_0x56b53d?util[_0xa48b('0xb')](_0x56b53d,{'showHidden':![],'depth':null}):'');});};function getUser(_0x420d9f){return client['request'](_0xa48b('0xd'),{'options':{'raw':!![],'attributes':['id','internal','name',_0xa48b('0xe')],'where':_0x420d9f,'limit':0x1}})[_0xa48b('0xf')](function(_0x4b0bda){logger[_0xa48b('0x7')]('[utils][getUser]\x20where:%s',JSON['stringify'](_0x420d9f),_0x4b0bda?util['inspect'](_0x4b0bda,{'showHidden':![],'depth':null}):'');return _0x4b0bda[_0xa48b('0x10')][_0xa48b('0x11')]?_0x4b0bda[_0xa48b('0x10')][0x0]:null;});}exports[_0xa48b('0x12')]=function(_0x3136ca){return new BPromise(function(_0x34e1e8,_0x3f8194){if(_0x3136ca){return getUser({'internal':_0x3136ca})[_0xa48b('0xf')](function(_0x2c05a7){logger[_0xa48b('0x6')](_0xa48b('0x13'),_0x3136ca,_0x2c05a7?'found':'notfound');return _0x34e1e8(_0x2c05a7);})['catch'](function(_0x2d5ea5){logger[_0xa48b('0x8')]('[utils][getUserByInternal]',_0x2d5ea5?util['inspect'](_0x2d5ea5,{'showHidden':![],'depth':null}):'');return _0x34e1e8(null);});}return _0x34e1e8(null);});};exports['getUserByInterface']=function(_0x2dcc5a){return new BPromise(function(_0x4743fc,_0x4b56b0){if(_0x2dcc5a){return getUser({'interface':_0x2dcc5a})['then'](function(_0x143ea2){logger[_0xa48b('0x6')](_0xa48b('0x14'),_0x2dcc5a,_0x143ea2?'found':_0xa48b('0x15'));return _0x4743fc(_0x143ea2);})[_0xa48b('0xc')](function(_0x1d5868){logger[_0xa48b('0x8')](_0xa48b('0x16'),_0x1d5868?util[_0xa48b('0xb')](_0x1d5868,{'showHidden':![],'depth':null}):'');return _0x4743fc(null);});}return _0x4743fc(null);});};exports[_0xa48b('0x17')]=function(_0x927dbc){return new BPromise(function(_0x6aa09b,_0x50a11b){if(_0x927dbc){return getUser({'name':_0x927dbc})[_0xa48b('0xf')](function(_0x171f31){logger[_0xa48b('0x6')]('[utils][getUserByName]\x20name:%s\x20%s',_0x927dbc,_0x171f31?_0xa48b('0x18'):_0xa48b('0x15'));return _0x6aa09b(_0x171f31);})[_0xa48b('0xc')](function(_0x298ae4){logger[_0xa48b('0x8')](_0xa48b('0x19'),_0x298ae4?util[_0xa48b('0xb')](_0x298ae4,{'showHidden':![],'depth':null}):'');return _0x6aa09b(null);});}return _0x6aa09b(null);});};exports[_0xa48b('0x1a')]=function(_0x1fb786){return new BPromise(function(_0x34e3bf,_0x404aed){if(_0x1fb786){return client[_0xa48b('0x9')](_0xa48b('0x1b'),{'options':{'raw':!![],'attributes':['id',_0xa48b('0x1c'),_0xa48b('0x1d'),_0xa48b('0x1e'),_0xa48b('0x1f')],'where':{'name':_0x1fb786},'limit':0x1}})[_0xa48b('0xf')](function(_0x1a6fc2){logger[_0xa48b('0x7')](_0xa48b('0x20'),_0x1fb786,_0x1a6fc2?util['inspect'](_0x1a6fc2,{'showHidden':![],'depth':null}):'');logger['info'](_0xa48b('0x21'),_0x1fb786,_0x1a6fc2?_0xa48b('0x18'):_0xa48b('0x15'));return _0x34e3bf(_0x1a6fc2[_0xa48b('0x10')][_0xa48b('0x11')]?_0x1a6fc2[_0xa48b('0x10')][0x0]:null);})['catch'](function(_0x28649b){logger[_0xa48b('0x8')](_0xa48b('0x22'),_0x28649b?util[_0xa48b('0xb')](_0x28649b,{'showHidden':![],'depth':null}):'');return _0x34e3bf(null);});}return _0x34e3bf(null);});};exports[_0xa48b('0x23')]=function(_0x5e4860,_0x2f7d17){return moment(_0x5e4860)[_0xa48b('0x24')](_0x2f7d17,_0xa48b('0x25'))['format']('YYYY-MM-DD\x20HH:mm:ss');};exports[_0xa48b('0x26')]=function(_0x39baf4,_0x2e8e9d){return moment(_0x39baf4)['subtract'](_0x2e8e9d,_0xa48b('0x25'))[_0xa48b('0x27')](_0xa48b('0x28'));};exports[_0xa48b('0x29')]=function(_0x132582,_0x53f67e){return moment(_0x132582)[_0xa48b('0x2a')](moment(_0x53f67e),_0xa48b('0x25'));};exports[_0xa48b('0x2b')]=function(_0x135e96,_0x4efe0c){return parseInt(_0x135e96,0xa)+parseInt(_0x4efe0c,0xa);};exports['now']=function(){return moment()[_0xa48b('0x27')](_0xa48b('0x28'));};exports[_0xa48b('0x2c')]=function(_0x5ed43d,_0x5693b1){if(_0x5693b1){return moment(_0x5ed43d)['isAfter'](_0x5693b1);}return!![];};exports['isBefore']=function(_0x2f2d67,_0x349405){if(_0x349405){return moment(_0x2f2d67)[_0xa48b('0x2d')](_0x349405);}else if(_0x2f2d67){return!![];}return![];}; \ No newline at end of file